From b0619fe020494243fb90c610afbfe941bcb46752 Mon Sep 17 00:00:00 2001 From: support Date: Fri, 15 Jul 2022 07:11:20 +0000 Subject: [PATCH] Built motion from commit 79c7c506.|2.6.12 --- 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 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.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/voiceQueueSummary.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/realtime/utils.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/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1203 files changed, 1203 insertions(+), 1203 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index d08024c..179e544 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-07-15T06:45:48.176Z", + "time": "2022-07-15T07:03:09.832Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7665dea..9f0eaf5 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-07-15T06:45:48.176Z", + "time": "2022-07-15T07:03:09.832Z", "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 1957b29..6c6a32b 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 _0x7ab6=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x15b612,_0x3570c8){var _0x5bea74=function(_0x29c3db){while(--_0x29c3db){_0x15b612['push'](_0x15b612['shift']());}};_0x5bea74(++_0x3570c8);}(_0x7ab6,0x1bf));var _0x67ab=function(_0x19ad32,_0xcda39d){_0x19ad32=_0x19ad32-0x0;var _0x2d96c8=_0x7ab6[_0x19ad32];return _0x2d96c8;};'use strict';var Sequelize=require(_0x67ab('0x0'));module[_0x67ab('0x1')]={'name':{'type':Sequelize[_0x67ab('0x2')],'get':function(_0x46bb94){return this[_0x67ab('0x3')](_0x67ab('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x67ab('0x5'),_0x67ab('0x6'),_0x67ab('0x7'),'jscripty',_0x67ab('0x8'),'browser',_0x67ab('0x9'),'script']],'msg':_0x67ab('0xa')}},'comment':_0x67ab('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x67ab('0xb')},'data2':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x67ab('0xd')},'data7':{'type':Sequelize[_0x67ab('0xe')],'comments':_0x67ab('0xf')}}; \ No newline at end of file +var _0x5e85=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','motionbar','jscripty','browser'];(function(_0x1c8de9,_0x5b826b){var _0x284b59=function(_0xb0c110){while(--_0xb0c110){_0x1c8de9['push'](_0x1c8de9['shift']());}};_0x284b59(++_0x5b826b);}(_0x5e85,0x161));var _0x55e8=function(_0x878aa5,_0x163df7){_0x878aa5=_0x878aa5-0x0;var _0x35534b=_0x5e85[_0x878aa5];return _0x35534b;};'use strict';var Sequelize=require(_0x55e8('0x0'));module[_0x55e8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b3374){return this[_0x55e8('0x2')]('action');}},'action':{'type':Sequelize[_0x55e8('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x55e8('0x4'),_0x55e8('0x5'),'urlForward',_0x55e8('0x6'),_0x55e8('0x7'),_0x55e8('0x8')]],'msg':_0x55e8('0x9')}},'comment':_0x55e8('0x9')},'data1':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xa')},'data2':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xb')},'data3':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x55e8('0xd')},'data5':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comments':_0x55e8('0xe')},'data6':{'type':Sequelize[_0x55e8('0x3')],'comments':_0x55e8('0xf')},'data7':{'type':Sequelize[_0x55e8('0x10')],'comments':_0x55e8('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index d1bb29b..bfed0dc 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 _0x169f=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','status','error','stack','name','body','Action','params','catch','find','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs'];(function(_0x18983d,_0x3472b3){var _0x340651=function(_0x3d8cb7){while(--_0x3d8cb7){_0x18983d['push'](_0x18983d['shift']());}};_0x340651(++_0x3472b3);}(_0x169f,0x13b));var _0xf169=function(_0x59c23e,_0x555150){_0x59c23e=_0x59c23e-0x0;var _0x1db2b4=_0x169f[_0x59c23e];return _0x1db2b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf169('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf169('0x1'));var rp=require('request-promise');var moment=require(_0xf169('0x2'));var BPromise=require(_0xf169('0x3'));var Mustache=require(_0xf169('0x4'));var util=require('util');var path=require(_0xf169('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf169('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf169('0x7'));var squel=require(_0xf169('0x8'));var crypto=require(_0xf169('0x9'));var jsforce=require(_0xf169('0xa'));var deskjs=require(_0xf169('0xb'));var toCsv=require(_0xf169('0xc'));var querystring=require(_0xf169('0xd'));var Papa=require(_0xf169('0xe'));var Redis=require(_0xf169('0xf'));var authService=require(_0xf169('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf169('0x11'));var hardwareService=require(_0xf169('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf169('0x13'));var config=require(_0xf169('0x14'));var licenseUtil=require(_0xf169('0x15'));var db=require(_0xf169('0x16'))['db'];function respondWithStatusCode(_0x5752d4,_0x1bf8b4){_0x1bf8b4=_0x1bf8b4||0xcc;return function(_0x50245a){if(_0x50245a){return _0x5752d4[_0xf169('0x17')](_0x1bf8b4);}return _0x5752d4['status'](_0x1bf8b4)[_0xf169('0x18')]();};}function respondWithResult(_0x4f1879,_0x35ca7a){_0x35ca7a=_0x35ca7a||0xc8;return function(_0x970789){if(_0x970789){return _0x4f1879['status'](_0x35ca7a)[_0xf169('0x19')](_0x970789);}};}function respondWithFilteredResult(_0x3c221c,_0x2d4eb5){return function(_0x4d3807){if(_0x4d3807){var _0x573224=typeof _0x2d4eb5[_0xf169('0x1a')]==='undefined'&&typeof _0x2d4eb5['limit']===_0xf169('0x1b');var _0x31237e=_0x4d3807[_0xf169('0x1c')];var _0x47ef98=_0x573224?0x0:_0x2d4eb5[_0xf169('0x1a')];var _0x5d6a6d=_0x573224?_0x4d3807['count']:_0x2d4eb5[_0xf169('0x1a')]+_0x2d4eb5[_0xf169('0x1d')];var _0xde4dfe;if(_0x5d6a6d>=_0x31237e){_0x5d6a6d=_0x31237e;_0xde4dfe=0xc8;}else{_0xde4dfe=0xce;}_0x3c221c['status'](_0xde4dfe);return _0x3c221c[_0xf169('0x1e')](_0xf169('0x1f'),_0x47ef98+'-'+_0x5d6a6d+'/'+_0x31237e)[_0xf169('0x19')](_0x4d3807);}return null;};}function patchUpdates(_0x5f2cf9){return function(_0x37fa8e){try{jsonpatch['apply'](_0x37fa8e,_0x5f2cf9,!![]);}catch(_0xab7a8d){return BPromise[_0xf169('0x20')](_0xab7a8d);}return _0x37fa8e[_0xf169('0x21')]();};}function saveUpdates(_0x526fa9,_0x23442c){return function(_0x56f724){if(_0x56f724){return _0x56f724[_0xf169('0x22')](_0x526fa9)[_0xf169('0x23')](function(_0x41eb0f){return _0x41eb0f;});}return null;};}function removeEntity(_0x6d6ed5,_0x580923){return function(_0x5498ed){if(_0x5498ed){return _0x5498ed[_0xf169('0x24')]()[_0xf169('0x23')](function(){_0x6d6ed5[_0xf169('0x25')](0xcc)[_0xf169('0x18')]();});}};}function handleEntityNotFound(_0x299d49,_0x14de7d){return function(_0x52ba5c){if(!_0x52ba5c){_0x299d49['sendStatus'](0x194);}return _0x52ba5c;};}function handleError(_0x40dfab,_0x463b5b){_0x463b5b=_0x463b5b||0x1f4;return function(_0x2c129f){logger[_0xf169('0x26')](_0x2c129f[_0xf169('0x27')]);if(_0x2c129f['name']){delete _0x2c129f[_0xf169('0x28')];}_0x40dfab[_0xf169('0x25')](_0x463b5b)['send'](_0x2c129f);};}exports[_0xf169('0x22')]=function(_0x2dbe30,_0x288a74){if(_0x2dbe30[_0xf169('0x29')]['id']){delete _0x2dbe30['body']['id'];}return db[_0xf169('0x2a')]['find']({'where':{'id':_0x2dbe30[_0xf169('0x2b')]['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x288a74,null))[_0xf169('0x23')](saveUpdates(_0x2dbe30[_0xf169('0x29')],null))[_0xf169('0x23')](respondWithResult(_0x288a74,null))[_0xf169('0x2c')](handleError(_0x288a74,null));};exports['destroy']=function(_0x1bf8e4,_0x13cdd0){return db[_0xf169('0x2a')][_0xf169('0x2d')]({'where':{'id':_0x1bf8e4['params']['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x13cdd0,null))[_0xf169('0x23')](removeEntity(_0x13cdd0,null))[_0xf169('0x2c')](handleError(_0x13cdd0,null));}; \ No newline at end of file +var _0x5cf8=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','body','find','params','Action','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0x80b32f,_0x890ca){var _0x599198=function(_0x4aa7db){while(--_0x4aa7db){_0x80b32f['push'](_0x80b32f['shift']());}};_0x599198(++_0x890ca);}(_0x5cf8,0xe0));var _0x85cf=function(_0x55e45c,_0x3fd637){_0x55e45c=_0x55e45c-0x0;var _0x5d304e=_0x5cf8[_0x55e45c];return _0x5d304e;};'use strict';var emlformat=require(_0x85cf('0x0'));var rimraf=require(_0x85cf('0x1'));var zipdir=require(_0x85cf('0x2'));var jsonpatch=require(_0x85cf('0x3'));var rp=require(_0x85cf('0x4'));var moment=require('moment');var BPromise=require(_0x85cf('0x5'));var Mustache=require(_0x85cf('0x6'));var util=require(_0x85cf('0x7'));var path=require('path');var sox=require(_0x85cf('0x8'));var csv=require('to-csv');var ejs=require(_0x85cf('0x9'));var fs=require('fs');var fs_extra=require(_0x85cf('0xa'));var _=require(_0x85cf('0xb'));var squel=require(_0x85cf('0xc'));var crypto=require(_0x85cf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x85cf('0xe'));var toCsv=require(_0x85cf('0xf'));var querystring=require(_0x85cf('0x10'));var Papa=require(_0x85cf('0x11'));var Redis=require(_0x85cf('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x85cf('0x13'));var hardwareService=require(_0x85cf('0x14'));var logger=require(_0x85cf('0x15'))(_0x85cf('0x16'));var utils=require(_0x85cf('0x17'));var config=require(_0x85cf('0x18'));var licenseUtil=require(_0x85cf('0x19'));var db=require(_0x85cf('0x1a'))['db'];function respondWithStatusCode(_0x2c87ad,_0x3249f8){_0x3249f8=_0x3249f8||0xcc;return function(_0x4c005b){if(_0x4c005b){return _0x2c87ad[_0x85cf('0x1b')](_0x3249f8);}return _0x2c87ad[_0x85cf('0x1c')](_0x3249f8)[_0x85cf('0x1d')]();};}function respondWithResult(_0x16595e,_0x2200e4){_0x2200e4=_0x2200e4||0xc8;return function(_0x2a3606){if(_0x2a3606){return _0x16595e[_0x85cf('0x1c')](_0x2200e4)[_0x85cf('0x1e')](_0x2a3606);}};}function respondWithFilteredResult(_0x4eb40f,_0x34b31d){return function(_0x284aac){if(_0x284aac){var _0x5b4702=typeof _0x34b31d[_0x85cf('0x1f')]==='undefined'&&typeof _0x34b31d['limit']==='undefined';var _0x305869=_0x284aac[_0x85cf('0x20')];var _0x4128c6=_0x5b4702?0x0:_0x34b31d[_0x85cf('0x1f')];var _0x425294=_0x5b4702?_0x284aac['count']:_0x34b31d[_0x85cf('0x1f')]+_0x34b31d[_0x85cf('0x21')];var _0x1abac3;if(_0x425294>=_0x305869){_0x425294=_0x305869;_0x1abac3=0xc8;}else{_0x1abac3=0xce;}_0x4eb40f['status'](_0x1abac3);return _0x4eb40f[_0x85cf('0x22')](_0x85cf('0x23'),_0x4128c6+'-'+_0x425294+'/'+_0x305869)['json'](_0x284aac);}return null;};}function patchUpdates(_0x52d19d){return function(_0x2aa61c){try{jsonpatch[_0x85cf('0x24')](_0x2aa61c,_0x52d19d,!![]);}catch(_0x95943e){return BPromise[_0x85cf('0x25')](_0x95943e);}return _0x2aa61c['save']();};}function saveUpdates(_0x3708d9,_0xe27031){return function(_0x1101a5){if(_0x1101a5){return _0x1101a5[_0x85cf('0x26')](_0x3708d9)[_0x85cf('0x27')](function(_0x1a9135){return _0x1a9135;});}return null;};}function removeEntity(_0x49943e,_0x343254){return function(_0x1369a1){if(_0x1369a1){return _0x1369a1[_0x85cf('0x28')]()['then'](function(){_0x49943e['status'](0xcc)[_0x85cf('0x1d')]();});}};}function handleEntityNotFound(_0x5f30ef,_0x16f14f){return function(_0x338b19){if(!_0x338b19){_0x5f30ef['sendStatus'](0x194);}return _0x338b19;};}function handleError(_0x584e8c,_0x2c389b){_0x2c389b=_0x2c389b||0x1f4;return function(_0x58fbbd){logger['error'](_0x58fbbd[_0x85cf('0x29')]);if(_0x58fbbd[_0x85cf('0x2a')]){delete _0x58fbbd[_0x85cf('0x2a')];}_0x584e8c['status'](_0x2c389b)['send'](_0x58fbbd);};}exports[_0x85cf('0x26')]=function(_0x2b3965,_0x52c79f){if(_0x2b3965[_0x85cf('0x2b')]['id']){delete _0x2b3965[_0x85cf('0x2b')]['id'];}return db['Action'][_0x85cf('0x2c')]({'where':{'id':_0x2b3965[_0x85cf('0x2d')]['id']}})[_0x85cf('0x27')](handleEntityNotFound(_0x52c79f,null))[_0x85cf('0x27')](saveUpdates(_0x2b3965[_0x85cf('0x2b')],null))[_0x85cf('0x27')](respondWithResult(_0x52c79f,null))['catch'](handleError(_0x52c79f,null));};exports[_0x85cf('0x28')]=function(_0x369aaa,_0x50e783){return db[_0x85cf('0x2e')]['find']({'where':{'id':_0x369aaa['params']['id']}})['then'](handleEntityNotFound(_0x50e783,null))[_0x85cf('0x27')](removeEntity(_0x50e783,null))[_0x85cf('0x2f')](handleError(_0x50e783,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 96a8f6d..ec6ba48 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 _0x0a78=['api','bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x3d220e,_0x3a67a5){var _0x421b95=function(_0x4c6a9a){while(--_0x4c6a9a){_0x3d220e['push'](_0x3d220e['shift']());}};_0x421b95(++_0x3a67a5);}(_0x0a78,0x1ab));var _0x80a7=function(_0x33a877,_0x413a2d){_0x33a877=_0x33a877-0x0;var _0x459879=_0x0a78[_0x33a877];return _0x459879;};'use strict';var _=require(_0x80a7('0x0'));var util=require(_0x80a7('0x1'));var logger=require('../../config/logger')(_0x80a7('0x2'));var moment=require('moment');var BPromise=require(_0x80a7('0x3'));var rp=require(_0x80a7('0x4'));var fs=require('fs');var path=require(_0x80a7('0x5'));var rimraf=require('rimraf');var config=require(_0x80a7('0x6'));var attributes=require('./action.attributes');module[_0x80a7('0x7')]=function(_0x38425e,_0x546c40){return _0x38425e[_0x80a7('0x8')](_0x80a7('0x9'),attributes,{'tableName':_0x80a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff01=['rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4e198a,_0x5a6bad){var _0xb84bfe=function(_0x58d2b2){while(--_0x58d2b2){_0x4e198a['push'](_0x4e198a['shift']());}};_0xb84bfe(++_0x5a6bad);}(_0xff01,0x130));var _0x1ff0=function(_0xfe28c5,_0x452499){_0xfe28c5=_0xfe28c5-0x0;var _0xad25d1=_0xff01[_0xfe28c5];return _0xad25d1;};'use strict';var _=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var logger=require(_0x1ff0('0x2'))(_0x1ff0('0x3'));var moment=require(_0x1ff0('0x4'));var BPromise=require(_0x1ff0('0x5'));var rp=require(_0x1ff0('0x6'));var fs=require('fs');var path=require(_0x1ff0('0x7'));var rimraf=require(_0x1ff0('0x8'));var config=require('../../config/environment');var attributes=require(_0x1ff0('0x9'));module['exports']=function(_0x34c0f2,_0x43d97b){return _0x34c0f2[_0x1ff0('0xa')](_0x1ff0('0xb'),attributes,{'tableName':_0x1ff0('0xc'),'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 0627500..1e5d425 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(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x53ec,0x192));var _0xc53e=function(_0x2bf6be,_0x5b23f1){_0x2bf6be=_0x2bf6be-0x0;var _0x532ef4=_0x53ec[_0x2bf6be];return _0x532ef4;};'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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x822d4e,_0x3acaac){var _0x5b7fd9=function(_0x4055e6){while(--_0x4055e6){_0x822d4e['push'](_0x822d4e['shift']());}};_0x5b7fd9(++_0x3acaac);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'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')]('Action,\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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 3d836f9..97def7a 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 _0xcfdf=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xcfdf,0x195));var _0xfcfd=function(_0x25147b,_0x534c37){_0x25147b=_0x25147b-0x0;var _0x12bc18=_0xcfdf[_0x25147b];return _0x12bc18;};'use strict';var multer=require('multer');var util=require(_0xfcfd('0x0'));var path=require(_0xfcfd('0x1'));var timeout=require(_0xfcfd('0x2'));var express=require(_0xfcfd('0x3'));var router=express[_0xfcfd('0x4')]();var fs_extra=require(_0xfcfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfcfd('0x6'));var config=require(_0xfcfd('0x7'));var controller=require(_0xfcfd('0x8'));router[_0xfcfd('0x9')]('/:id',auth[_0xfcfd('0xa')](),controller[_0xfcfd('0xb')]);router[_0xfcfd('0xc')](_0xfcfd('0xd'),auth[_0xfcfd('0xa')](),controller['destroy']);module[_0xfcfd('0xe')]=router; \ No newline at end of file +var _0x347e=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','update','delete','exports','multer','util','path'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x347e,0x135));var _0xe347=function(_0x24e893,_0x130483){_0x24e893=_0x24e893-0x0;var _0x437e82=_0x347e[_0x24e893];return _0x437e82;};'use strict';var multer=require(_0xe347('0x0'));var util=require(_0xe347('0x1'));var path=require(_0xe347('0x2'));var timeout=require(_0xe347('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe347('0x4'));var auth=require(_0xe347('0x5'));var interaction=require(_0xe347('0x6'));var config=require('../../config/environment');var controller=require(_0xe347('0x7'));router['put'](_0xe347('0x8'),auth[_0xe347('0x9')](),controller[_0xe347('0xa')]);router[_0xe347('0xb')]('/:id',auth[_0xe347('0x9')](),controller['destroy']);module[_0xe347('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 28b25e6..296788e 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd51=['sequelize','STRING'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5f9a43,_0x33b992){_0x5f9a43=_0x5f9a43-0x0;var _0x1bbb9e=_0xbd51[_0x5f9a43];return _0x1bbb9e;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x1a043b,_0x4d540a){var _0x105ff5=function(_0x49532e){while(--_0x49532e){_0x1a043b['push'](_0x1a043b['shift']());}};_0x105ff5(++_0x4d540a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6fead9b..6bb2151 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 _0x95c3=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','select','output','web','fullPath','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','groupBy','Limited\x20Query:','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x29ce11,_0x3887ab){var _0x255fa8=function(_0x4b5475){while(--_0x4b5475){_0x29ce11['push'](_0x29ce11['shift']());}};_0x255fa8(++_0x3887ab);}(_0x95c3,0x6d));var _0x395c=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x95c3[_0x52f1e6];return _0x21f104;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x395c('0x0'));var jsonpatch=require(_0x395c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x395c('0x2'));var Mustache=require(_0x395c('0x3'));var util=require(_0x395c('0x4'));var path=require(_0x395c('0x5'));var sox=require(_0x395c('0x6'));var csv=require('to-csv');var ejs=require(_0x395c('0x7'));var fs=require('fs');var fs_extra=require(_0x395c('0x8'));var _=require(_0x395c('0x9'));var squel=require(_0x395c('0xa'));var crypto=require(_0x395c('0xb'));var jsforce=require(_0x395c('0xc'));var deskjs=require(_0x395c('0xd'));var toCsv=require(_0x395c('0xe'));var querystring=require(_0x395c('0xf'));var Papa=require(_0x395c('0x10'));var Redis=require(_0x395c('0x11'));var authService=require(_0x395c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x395c('0x13'));var hardwareService=require(_0x395c('0x14'));var logger=require(_0x395c('0x15'))(_0x395c('0x16'));var utils=require('../../config/utils');var config=require(_0x395c('0x17'));var licenseUtil=require(_0x395c('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x395c('0x19'))[_0x395c('0x1a')];function respondWithStatusCode(_0x2d5125,_0x3cba31){_0x3cba31=_0x3cba31||0xcc;return function(_0x4ffd1f){if(_0x4ffd1f){return _0x2d5125[_0x395c('0x1b')](_0x3cba31);}return _0x2d5125['status'](_0x3cba31)['end']();};}function respondWithResult(_0x493e3b,_0x3173d9){_0x3173d9=_0x3173d9||0xc8;return function(_0x134bf5){if(_0x134bf5){return _0x493e3b[_0x395c('0x1c')](_0x3173d9)[_0x395c('0x1d')](_0x134bf5);}};}function respondWithFilteredResult(_0x2a60d6,_0x5e498e){return function(_0x24b7ba){if(_0x24b7ba){var _0x265c93=typeof _0x5e498e[_0x395c('0x1e')]===_0x395c('0x1f')&&typeof _0x5e498e[_0x395c('0x20')]===_0x395c('0x1f');var _0x55516b=_0x24b7ba['count'];var _0x202efc=_0x265c93?0x0:_0x5e498e[_0x395c('0x1e')];var _0xefe87b=_0x265c93?_0x24b7ba[_0x395c('0x21')]:_0x5e498e[_0x395c('0x1e')]+_0x5e498e['limit'];var _0x5b117e;if(_0xefe87b>=_0x55516b){_0xefe87b=_0x55516b;_0x5b117e=0xc8;}else{_0x5b117e=0xce;}_0x2a60d6[_0x395c('0x1c')](_0x5b117e);return _0x2a60d6[_0x395c('0x22')](_0x395c('0x23'),_0x202efc+'-'+_0xefe87b+'/'+_0x55516b)[_0x395c('0x1d')](_0x24b7ba);}return null;};}function patchUpdates(_0x164628){return function(_0x1c2e7a){try{jsonpatch[_0x395c('0x24')](_0x1c2e7a,_0x164628,!![]);}catch(_0x2c3882){return BPromise[_0x395c('0x25')](_0x2c3882);}return _0x1c2e7a[_0x395c('0x26')]();};}function saveUpdates(_0x160e3b,_0x30eeec){return function(_0x41d2ae){if(_0x41d2ae){return _0x41d2ae[_0x395c('0x27')](_0x160e3b)[_0x395c('0x28')](function(_0x520ee6){return _0x520ee6;});}return null;};}function removeEntity(_0x404384,_0x221350){return function(_0x56faad){if(_0x56faad){return _0x56faad[_0x395c('0x29')]()[_0x395c('0x28')](function(){var _0x6e557f=_0x56faad['get']({'plain':!![]});var _0x977443=_0x395c('0x2a');return db[_0x395c('0x2b')][_0x395c('0x29')]({'where':{'type':_0x977443,'resourceId':_0x6e557f['id']}})[_0x395c('0x28')](function(){return _0x56faad;});})['then'](function(){_0x404384[_0x395c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4b54,_0x328a2c){return function(_0xc609e5){if(!_0xc609e5){_0x2d4b54[_0x395c('0x1b')](0x194);}return _0xc609e5;};}function handleError(_0x1c33f4,_0x26343c){_0x26343c=_0x26343c||0x1f4;return function(_0x393c50){logger[_0x395c('0x2c')](_0x393c50[_0x395c('0x2d')]);if(_0x393c50['name']){delete _0x393c50[_0x395c('0x2e')];}_0x1c33f4[_0x395c('0x1c')](_0x26343c)['send'](_0x393c50);};}exports[_0x395c('0x2f')]=function(_0x2625b7,_0xdb4d05){var _0x453680={},_0x3f6a1d={},_0x3130ad={'count':0x0,'rows':[]};var _0x5159ab=_[_0x395c('0x30')](db['AnalyticCustomReport'][_0x395c('0x31')],function(_0x4189b4){return{'name':_0x4189b4[_0x395c('0x32')],'type':_0x4189b4['type']['key']};});_0x3f6a1d[_0x395c('0x33')]=_[_0x395c('0x30')](_0x5159ab,'name');_0x3f6a1d[_0x395c('0x34')]=_[_0x395c('0x35')](_0x2625b7[_0x395c('0x34')]);_0x3f6a1d[_0x395c('0x36')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],_0x3f6a1d[_0x395c('0x34')]);_0x453680[_0x395c('0x38')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],qs[_0x395c('0x39')](_0x2625b7[_0x395c('0x34')][_0x395c('0x39')]));_0x453680[_0x395c('0x38')]=_0x453680['attributes']['length']?_0x453680[_0x395c('0x38')]:_0x3f6a1d[_0x395c('0x33')];if(!_0x2625b7[_0x395c('0x34')][_0x395c('0x3a')](_0x395c('0x3b'))){_0x453680[_0x395c('0x20')]=qs[_0x395c('0x20')](_0x2625b7['query'][_0x395c('0x20')]);_0x453680[_0x395c('0x1e')]=qs[_0x395c('0x1e')](_0x2625b7['query'][_0x395c('0x1e')]);}_0x453680[_0x395c('0x3c')]=qs[_0x395c('0x3d')](_0x2625b7['query']['sort']);_0x453680[_0x395c('0x3e')]=qs['filters'](_[_0x395c('0x3f')](_0x2625b7[_0x395c('0x34')],_0x3f6a1d[_0x395c('0x36')]),_0x5159ab);if(_0x2625b7['query']['filter']){_0x453680[_0x395c('0x3e')]=_[_0x395c('0x40')](_0x453680['where'],{'$or':_['map'](_0x5159ab,function(_0x1028d5){if(_0x1028d5[_0x395c('0x41')]!==_0x395c('0x42')){var _0x181e33={};_0x181e33[_0x1028d5[_0x395c('0x2e')]]={'$like':'%'+_0x2625b7[_0x395c('0x34')]['filter']+'%'};return _0x181e33;}})});}_0x453680=_['merge']({},_0x453680,_0x2625b7[_0x395c('0x43')]);var _0x22d7aa={'where':_0x453680[_0x395c('0x3e')]};return db['AnalyticCustomReport'][_0x395c('0x21')](_0x22d7aa)['then'](function(_0x3421f8){_0x3130ad[_0x395c('0x21')]=_0x3421f8;if(_0x2625b7['query'][_0x395c('0x44')]){_0x453680[_0x395c('0x45')]=[{'all':!![]}];}return db[_0x395c('0x46')][_0x395c('0x47')](_0x453680);})[_0x395c('0x28')](function(_0x8474af){_0x3130ad[_0x395c('0x48')]=_0x8474af;return _0x3130ad;})[_0x395c('0x28')](respondWithFilteredResult(_0xdb4d05,_0x453680))[_0x395c('0x49')](handleError(_0xdb4d05,null));};exports[_0x395c('0x4a')]=function(_0x3c59a2,_0x5dfba4){var _0x4b47d9={'raw':![],'where':{'id':_0x3c59a2['params']['id']}},_0x596819={};_0x596819[_0x395c('0x33')]=_[_0x395c('0x35')](db[_0x395c('0x46')][_0x395c('0x31')]);_0x596819[_0x395c('0x34')]=_['keys'](_0x3c59a2['query']);_0x596819[_0x395c('0x36')]=_['intersection'](_0x596819[_0x395c('0x33')],_0x596819[_0x395c('0x34')]);_0x4b47d9[_0x395c('0x38')]=_[_0x395c('0x37')](_0x596819[_0x395c('0x33')],qs[_0x395c('0x39')](_0x3c59a2[_0x395c('0x34')][_0x395c('0x39')]));_0x4b47d9[_0x395c('0x38')]=_0x4b47d9['attributes'][_0x395c('0x4b')]?_0x4b47d9[_0x395c('0x38')]:_0x596819[_0x395c('0x33')];if(_0x3c59a2[_0x395c('0x34')][_0x395c('0x44')]){_0x4b47d9[_0x395c('0x45')]=[{'all':!![]}];}_0x4b47d9=_['merge']({},_0x4b47d9,_0x3c59a2[_0x395c('0x43')]);return db['AnalyticCustomReport'][_0x395c('0x4c')](_0x4b47d9)['then'](handleEntityNotFound(_0x5dfba4,null))['then'](respondWithResult(_0x5dfba4,null))[_0x395c('0x49')](handleError(_0x5dfba4,null));};exports[_0x395c('0x4d')]=function(_0x432cb4,_0x2a4979){return db[_0x395c('0x46')][_0x395c('0x4d')](_0x432cb4[_0x395c('0x4e')],{})[_0x395c('0x28')](function(_0x1c6520){var _0x4a053f=_0x432cb4['user']['get']({'plain':!![]});if(!_0x4a053f)throw new Error(_0x395c('0x4f'));if(_0x4a053f[_0x395c('0x50')]===_0x395c('0x51')){var _0x52f975=_0x1c6520[_0x395c('0x52')]({'plain':!![]});var _0x3710ed=_0x395c('0x53');return db['UserProfileSection'][_0x395c('0x4c')]({'where':{'name':_0x3710ed,'userProfileId':_0x4a053f['userProfileId']},'raw':!![]})[_0x395c('0x28')](function(_0x47735e){if(_0x47735e&&_0x47735e[_0x395c('0x54')]===0x0){return db[_0x395c('0x2b')]['create']({'name':_0x52f975[_0x395c('0x2e')],'resourceId':_0x52f975['id'],'type':_0x395c('0x2a'),'sectionId':_0x47735e['id']},{})['then'](function(){return _0x1c6520;});}else{return _0x1c6520;}})['catch'](function(_0x535cc1){logger['error'](_0x395c('0x55'),_0x535cc1);throw _0x535cc1;});}return _0x1c6520;})[_0x395c('0x28')](respondWithResult(_0x2a4979,0xc9))['catch'](handleError(_0x2a4979,null));};exports['update']=function(_0x5a8889,_0x31f41b){if(_0x5a8889['body']['id']){delete _0x5a8889[_0x395c('0x4e')]['id'];}return db[_0x395c('0x46')][_0x395c('0x4c')]({'where':{'id':_0x5a8889['params']['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x31f41b,null))[_0x395c('0x28')](saveUpdates(_0x5a8889[_0x395c('0x4e')],null))['then'](respondWithResult(_0x31f41b,null))['catch'](handleError(_0x31f41b,null));};exports[_0x395c('0x29')]=function(_0x4e7928,_0x5dde80){return db['AnalyticCustomReport'][_0x395c('0x4c')]({'where':{'id':_0x4e7928[_0x395c('0x56')]['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x5dde80,null))[_0x395c('0x28')](removeEntity(_0x5dde80,null))[_0x395c('0x49')](handleError(_0x5dde80,null));};exports[_0x395c('0x57')]=function(_0x4a319e,_0x351f54){var _0x455648=0xa;var _0x59d63f=[_0x395c('0x58'),_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0x240f99={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x395c('0x5c'),'MAX':_0x395c('0x5d'),'MIN':_0x395c('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1cee20={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x32c356=function(_0x156ace){return!_[_0x395c('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x395c('0x66')],_0x156ace);};var _0x208d6d=function(_0xbb1a7){if(!_0xbb1a7||!_0xbb1a7['rules'][_0x395c('0x4b')]){return'';}for(var _0x272e13='(',_0x136fca=0x0;_0x136fca<_0xbb1a7[_0x395c('0x67')]['length'];_0x136fca+=0x1){_0x136fca>0x0&&(_0x272e13+='\x20'+_0xbb1a7[_0x395c('0x68')]+'\x20');_0x272e13+=_0xbb1a7[_0x395c('0x67')][_0x136fca]['group']?_0x208d6d(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x69')]):_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6a')]+'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')]+(_0x32c356(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')])?'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6c')]:'');}return _0x272e13+')';};var _0x3bda2a={'where':{'id':_0x4a319e[_0x395c('0x56')]['id']}},_0x227331,_0x3daee5,_0x353b19,_0x3cdb8f,_0x34f5b3;_0x3bda2a=_['merge']({},_0x3bda2a,_0x4a319e[_0x395c('0x43')]);return db[_0x395c('0x46')]['find'](_0x3bda2a)[_0x395c('0x28')](function(_0x2c02ef){if(_0x2c02ef){_0x227331=_0x2c02ef;return _0x2c02ef[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x566612){if(_0x566612){if(!_0x566612['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3daee5=_0x566612;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xd72304){if(_0xd72304){_0x353b19=_[_0x395c('0x71')](_0xd72304,'id');var _0xa8d112;var _0x21a9a=squel['select']();_0x21a9a[_0x395c('0x72')](_0x227331['table']);for(var _0xd2bef9=0x0;_0xd2bef9<_0x3daee5[_0x395c('0x4b')];_0xd2bef9+=0x1){_0xa8d112=_0x3daee5[_0xd2bef9]['MetricId']?_0x353b19[_0x3daee5[_0xd2bef9][_0x395c('0x73')]][_0x395c('0x74')]:_0x3daee5[_0xd2bef9][_0x395c('0x6a')];_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x75')]?_[_0x395c('0x76')](_0x240f99[_0x3daee5[_0xd2bef9][_0x395c('0x75')]],'%s',_0xa8d112):_0xa8d112;_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x77')]?_[_0x395c('0x76')](_0x1cee20[_0x3daee5[_0xd2bef9][_0x395c('0x77')]],'%s',_0xa8d112):_0xa8d112;if(_0x3daee5[_0xd2bef9]['groupBy']){_0x21a9a[_0x395c('0x69')](_0xa8d112);}_0x3daee5[_0xd2bef9]['orderBy']&&_0x21a9a[_0x395c('0x3c')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x78')]===_0x395c('0x79')?![]:!![]);_0x21a9a[_0x395c('0x6a')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x7a')]||_0xa8d112);}if(_0x227331[_0x395c('0x7b')]){_0x227331[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x7b')]);for(var _0xe4c769=0x0;_0xe4c769<_0x227331['joins'][_0x395c('0x4b')];_0xe4c769+=0x1){if(_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x59d63f,_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')])&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7d')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]){_0x21a9a[_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]](_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x227331[_0x395c('0x81')],_0x227331['joins'][_0xe4c769][_0x395c('0x7d')],_0x227331['joins'][_0xe4c769]['foreignTable'],_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]));}}}if(_0x227331[_0x395c('0x82')]){_0x227331[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x82')]);_0x21a9a[_0x395c('0x3e')](_0x208d6d(_0x227331[_0x395c('0x82')][_0x395c('0x69')]));}_0x34f5b3=_0x21a9a[_0x395c('0x83')]();_0x21a9a[_0x395c('0x20')](_0x455648);_0x21a9a[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')]('Limited\x20Query:',_0x21a9a[_0x395c('0x85')]());return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x21a9a[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](respondWithResult(_0x351f54,null))[_0x395c('0x49')](handleError(_0x351f54,null));};function runReport(_0x52faf5,_0x429758,_0x30c58d){var _0x3430f0=_0x429758[_0x395c('0x2e')];var _0x355de9=0xa;var _0x2132af=[_0x395c('0x58'),_0x395c('0x59'),'right_join',_0x395c('0x5b')];var _0x5c3d60={'SUM':'SUM(%s)','COUNT':_0x395c('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x395c('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':_0x395c('0x8b')};var _0x261770={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x504672=function(_0x1c8ecb){return!_['includes'](['IS\x20NULL',_0x395c('0x8c'),'IS\x20EMPTY',_0x395c('0x66')],_0x1c8ecb);};var _0x117d2c=function(_0x2e9031){if(!_0x2e9031||!_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x5ed96f='(',_0xf2e9dd=0x0;_0xf2e9dd<_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')];_0xf2e9dd+=0x1){_0xf2e9dd>0x0&&(_0x5ed96f+='\x20'+_0x2e9031['operator']+'\x20');_0x5ed96f+=_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x69')]?_0x117d2c(_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x69')]):_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6a')]+'\x20'+_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x6b')]+(_0x504672(_0x2e9031[_0x395c('0x67')][_0xf2e9dd]['condition'])?'\x20'+_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6c')]:'');}return _0x5ed96f+')';};var _0x706699={'where':{'id':_0x52faf5['id']}},_0x465df4,_0x2de332,_0x391be6,_0x3fa8cf,_0x20c968;_0x706699=_[_0x395c('0x40')]({},_0x706699,_0x30c58d);return db[_0x395c('0x46')][_0x395c('0x4c')](_0x706699)[_0x395c('0x28')](function(_0x10d1f8){if(_0x10d1f8){_0x465df4=_0x10d1f8;return _0x10d1f8[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x126f6c){if(_0x126f6c){if(!_0x126f6c['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2de332=_0x126f6c;return db[_0x395c('0x70')]['findAll']({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xe8d66c){if(_0xe8d66c){_0x391be6=_[_0x395c('0x71')](_0xe8d66c,'id');var _0x516bad;var _0x52ecbf=squel[_0x395c('0x8e')]();_0x52ecbf[_0x395c('0x72')](_0x465df4['table']);for(var _0x46a431=0x0;_0x46a431<_0x2de332['length'];_0x46a431+=0x1){_0x516bad=_0x2de332[_0x46a431][_0x395c('0x73')]?_0x391be6[_0x2de332[_0x46a431][_0x395c('0x73')]]['metric']:_0x2de332[_0x46a431][_0x395c('0x6a')];_0x516bad=_0x2de332[_0x46a431]['function']?_[_0x395c('0x76')](_0x5c3d60[_0x2de332[_0x46a431]['function']],'%s',_0x516bad):_0x516bad;_0x516bad=_0x2de332[_0x46a431][_0x395c('0x77')]?_[_0x395c('0x76')](_0x261770[_0x2de332[_0x46a431][_0x395c('0x77')]],'%s',_0x516bad):_0x516bad;if(_0x2de332[_0x46a431]['groupBy']){_0x52ecbf['group'](_0x516bad);}_0x2de332[_0x46a431][_0x395c('0x78')]&&_0x52ecbf[_0x395c('0x3c')](_0x516bad,_0x2de332[_0x46a431]['orderBy']===_0x395c('0x79')?![]:!![]);_0x52ecbf[_0x395c('0x6a')](_0x516bad,_0x2de332[_0x46a431]['alias']||_0x516bad);}if(_0x465df4['joins']){_0x465df4[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x7b')]);for(var _0x38dc7b=0x0;_0x38dc7b<_0x465df4[_0x395c('0x7b')][_0x395c('0x4b')];_0x38dc7b+=0x1){if(_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x2132af,_0x465df4['joins'][_0x38dc7b][_0x395c('0x41')])&&_0x465df4[_0x395c('0x7b')][_0x38dc7b]['parentKey']&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')]&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7f')]){_0x52ecbf[_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]](_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignTable'],null,util[_0x395c('0x77')]('%s.%s\x20=\x20%s.%s',_0x465df4['table'],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7d')],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')],_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignKey']));}}}if(_0x465df4[_0x395c('0x82')]){_0x465df4[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x82')]);_0x52ecbf['where'](_0x117d2c(_0x465df4['conditions']['group']));}_0x20c968=_0x52ecbf['clone']();_0x52ecbf[_0x395c('0x20')](_0x355de9);_0x52ecbf[_0x395c('0x1e')](0x0);return;}})['then'](function(){if(_0x429758[_0x395c('0x8f')]===_0x395c('0x90')){return null;}var _0x67fcf4=_[_0x395c('0x40')](_0x429758,{'name':_0x429758[_0x395c('0x91')]||_0x429758[_0x395c('0x2e')]||_0x465df4['name'],'basename':_0x3430f0,'savename':util[_0x395c('0x77')]('%s-%s.%s',_0x429758['name']||_0x465df4[_0x395c('0x2e')],require(_0x395c('0x92'))['generate'](0x4),_0x429758['output']||_0x395c('0x93')),'reportId':_0x465df4['id'],'reportType':_0x395c('0x94')});return db['AnalyticExtractedReport'][_0x395c('0x4d')](_0x67fcf4,{'raw':!![]});})[_0x395c('0x28')](function(_0x28098f){if(_0x465df4['table']===_0x395c('0x95')){_0x20c968[_0x395c('0x3e')](_0x465df4[_0x395c('0x81')]+_0x395c('0x96'),_0x429758[_0x395c('0x97')],_0x429758[_0x395c('0x98')]);}else{_0x20c968['where'](_0x465df4[_0x395c('0x81')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x429758[_0x395c('0x97')],_0x429758['endDate']);}if(_0x28098f){logger[_0x395c('0x99')](_0x395c('0x9a'),_0x20c968[_0x395c('0x85')]());require(_0x395c('0x9b'))[_0x395c('0x9c')](path['join'](__dirname,_0x395c('0x9d'),_0x28098f['output']),[_0x28098f['id'],_0x20c968['toString'](),path[_0x395c('0x58')](__dirname,'../../files/reports',_0x28098f[_0x395c('0x9e')]),_0x3430f0]);return _0x28098f;}else{var _0x260ea1=squel[_0x395c('0x8e')]();_0x260ea1[_0x395c('0x72')]('('+_0x20c968[_0x395c('0x85')]()+')',_0x395c('0x9f'));_0x260ea1['field'](_0x395c('0xa0'),_0x395c('0x21'));_0x20c968['limit'](_0x429758[_0x395c('0x20')]||_0x355de9);_0x20c968['offset'](_0x429758['offset']||0x0);return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x260ea1[_0x395c('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x395c('0x88')]})[_0x395c('0x28')](function(_0x541db6){if(!_0x541db6[_0x395c('0x4b')]){_0x3fa8cf=0x0;}else{_0x3fa8cf=_0x541db6[0x0][_0x395c('0x21')]||0x0;}return dbH['sequelize'][_0x395c('0x34')](_0x20c968[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')]['SELECT']});})['then'](function(_0x5f4be7){return{'rows':_0x5f4be7||[],'count':_0x3fa8cf};});}});}exports[_0x395c('0xa1')]=function(_0x4a7bf5,_0x27d594){return runReport(_0x4a7bf5[_0x395c('0x56')],_0x4a7bf5[_0x395c('0x34')],_0x4a7bf5[_0x395c('0x43')])[_0x395c('0x28')](respondWithResult(_0x27d594,null))[_0x395c('0x49')](handleError(_0x27d594,null));};exports['runReport']=runReport;exports['query']=function(_0x4bc3ab,_0x39ef20){var _0x20b9d1=0xa;var _0x23635d=['join',_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0xb51bff={'SUM':_0x395c('0xa2'),'COUNT':_0x395c('0x89'),'COUNT DISTINCT':_0x395c('0x5c'),'MAX':'MAX(%s)','MIN':_0x395c('0x5e'),'AVG':_0x395c('0x8a'),'GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x441b08={'SEC_TO_TIME':_0x395c('0xa3'),'DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x19fe31=function(_0x1e199c){return!_[_0x395c('0x65')]([_0x395c('0xa4'),_0x395c('0x8c'),_0x395c('0xa5'),'IS\x20NOT\x20EMPTY'],_0x1e199c);};var _0x4bd290=function(_0x1e9560){if(!_0x1e9560||!_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x57c75e='(',_0x18bae9=0x0;_0x18bae9<_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')];_0x18bae9+=0x1){_0x18bae9>0x0&&(_0x57c75e+='\x20'+_0x1e9560['operator']+'\x20');_0x57c75e+=_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]?_0x4bd290(_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]):_0x1e9560[_0x395c('0x67')][_0x18bae9]['field']+'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6b')]+(_0x19fe31(_0x1e9560['rules'][_0x18bae9][_0x395c('0x6b')])?'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6c')]:'');}return _0x57c75e+')';};var _0x58b238={'where':{'id':_0x4bc3ab[_0x395c('0x56')]['id']}},_0x2c235b,_0x2264d9,_0x203dbd,_0x5043f9,_0x320baf;_0x58b238=_[_0x395c('0x40')]({},_0x58b238,_0x4bc3ab[_0x395c('0x43')]);return db['AnalyticCustomReport']['find'](_0x58b238)['then'](function(_0x3e90e3){if(_0x3e90e3){_0x2c235b=_0x3e90e3;return _0x3e90e3['getFields']();}return null;})[_0x395c('0x28')](function(_0xefad23){if(_0xefad23){if(!_0xefad23['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2264d9=_0xefad23;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0x468ffa){if(_0x468ffa){_0x203dbd=_[_0x395c('0x71')](_0x468ffa,'id');var _0x53f6e7;var _0x2b4696=squel[_0x395c('0x8e')]();_0x2b4696[_0x395c('0x72')](_0x2c235b[_0x395c('0x81')]);for(var _0x2ac5d5=0x0;_0x2ac5d5<_0x2264d9[_0x395c('0x4b')];_0x2ac5d5+=0x1){_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x73')]?_0x203dbd[_0x2264d9[_0x2ac5d5][_0x395c('0x73')]][_0x395c('0x74')]:_0x2264d9[_0x2ac5d5][_0x395c('0x6a')];_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x75')]?_[_0x395c('0x76')](_0xb51bff[_0x2264d9[_0x2ac5d5][_0x395c('0x75')]],'%s',_0x53f6e7):_0x53f6e7;_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x77')]?_[_0x395c('0x76')](_0x441b08[_0x2264d9[_0x2ac5d5][_0x395c('0x77')]],'%s',_0x53f6e7):_0x53f6e7;if(_0x2264d9[_0x2ac5d5][_0x395c('0xa6')]){_0x2b4696[_0x395c('0x69')](_0x53f6e7);}_0x2264d9[_0x2ac5d5][_0x395c('0x78')]&&_0x2b4696['order'](_0x53f6e7,_0x2264d9[_0x2ac5d5]['orderBy']===_0x395c('0x79')?![]:!![]);_0x2b4696[_0x395c('0x6a')](_0x53f6e7,_0x2264d9[_0x2ac5d5][_0x395c('0x7a')]||_0x53f6e7);}if(_0x2c235b[_0x395c('0x7b')]){_0x2c235b['joins']=JSON[_0x395c('0x7c')](_0x2c235b['joins']);for(var _0x84ea7f=0x0;_0x84ea7f<_0x2c235b['joins'][_0x395c('0x4b')];_0x84ea7f+=0x1){if(_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')]&&_['includes'](_0x23635d,_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')])&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey']&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignTable']&&_0x2c235b['joins'][_0x84ea7f]['foreignKey']){_0x2b4696[_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['type']](_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x2c235b['table'],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey'],_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignKey']));}}}if(_0x2c235b[_0x395c('0x82')]){_0x2c235b[_0x395c('0x82')]=JSON['parse'](_0x2c235b[_0x395c('0x82')]);_0x2b4696['where'](_0x4bd290(_0x2c235b[_0x395c('0x82')][_0x395c('0x69')]));}_0x320baf=_0x2b4696[_0x395c('0x83')]();_0x2b4696['limit'](_0x20b9d1);_0x2b4696[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')](_0x395c('0xa7'),_0x2b4696[_0x395c('0x85')]());return dbH['sequelize']['query'](_0x2b4696['toString'](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](function(){return{'sql':_0x320baf[_0x395c('0x85')]()};})[_0x395c('0x28')](respondWithResult(_0x39ef20,null))[_0x395c('0x49')](handleError(_0x39ef20,null));}; \ No newline at end of file +var _0x1e91=['send','index','map','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','QueryTypes','COUNT(%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','Sequelize','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','sequelize','SELECT','run','runReport','value','select','metric','debug','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','get','UserProfileResource','error','name'];(function(_0x3ba1b1,_0x35446d){var _0x473018=function(_0x11ca92){while(--_0x11ca92){_0x3ba1b1['push'](_0x3ba1b1['shift']());}};_0x473018(++_0x35446d);}(_0x1e91,0x1d0));var _0x11e9=function(_0x27f424,_0xa6af37){_0x27f424=_0x27f424-0x0;var _0x5ae589=_0x1e91[_0x27f424];return _0x5ae589;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11e9('0x0'));var zipdir=require(_0x11e9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11e9('0x2'));var moment=require(_0x11e9('0x3'));var BPromise=require(_0x11e9('0x4'));var Mustache=require(_0x11e9('0x5'));var util=require('util');var path=require(_0x11e9('0x6'));var sox=require(_0x11e9('0x7'));var csv=require(_0x11e9('0x8'));var ejs=require(_0x11e9('0x9'));var fs=require('fs');var fs_extra=require(_0x11e9('0xa'));var _=require('lodash');var squel=require(_0x11e9('0xb'));var crypto=require(_0x11e9('0xc'));var jsforce=require(_0x11e9('0xd'));var deskjs=require(_0x11e9('0xe'));var toCsv=require(_0x11e9('0x8'));var querystring=require('querystring');var Papa=require(_0x11e9('0xf'));var Redis=require(_0x11e9('0x10'));var authService=require(_0x11e9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x11e9('0x12'));var logger=require(_0x11e9('0x13'))(_0x11e9('0x14'));var utils=require(_0x11e9('0x15'));var config=require(_0x11e9('0x16'));var licenseUtil=require(_0x11e9('0x17'));var db=require(_0x11e9('0x18'))['db'];var dbH=require(_0x11e9('0x18'))[_0x11e9('0x19')];function respondWithStatusCode(_0x3f51c6,_0x2e9c78){_0x2e9c78=_0x2e9c78||0xcc;return function(_0x290e9b){if(_0x290e9b){return _0x3f51c6['sendStatus'](_0x2e9c78);}return _0x3f51c6['status'](_0x2e9c78)[_0x11e9('0x1a')]();};}function respondWithResult(_0x2abd33,_0x5b3e0a){_0x5b3e0a=_0x5b3e0a||0xc8;return function(_0x30629e){if(_0x30629e){return _0x2abd33[_0x11e9('0x1b')](_0x5b3e0a)[_0x11e9('0x1c')](_0x30629e);}};}function respondWithFilteredResult(_0x4b2364,_0x19031d){return function(_0xecf89a){if(_0xecf89a){var _0x1d831d=typeof _0x19031d[_0x11e9('0x1d')]===_0x11e9('0x1e')&&typeof _0x19031d['limit']===_0x11e9('0x1e');var _0x468e66=_0xecf89a[_0x11e9('0x1f')];var _0x232622=_0x1d831d?0x0:_0x19031d[_0x11e9('0x1d')];var _0x49679b=_0x1d831d?_0xecf89a[_0x11e9('0x1f')]:_0x19031d[_0x11e9('0x1d')]+_0x19031d[_0x11e9('0x20')];var _0x384608;if(_0x49679b>=_0x468e66){_0x49679b=_0x468e66;_0x384608=0xc8;}else{_0x384608=0xce;}_0x4b2364[_0x11e9('0x1b')](_0x384608);return _0x4b2364[_0x11e9('0x21')]('Content-Range',_0x232622+'-'+_0x49679b+'/'+_0x468e66)[_0x11e9('0x1c')](_0xecf89a);}return null;};}function patchUpdates(_0x48fb76){return function(_0x4cb8cf){try{jsonpatch[_0x11e9('0x22')](_0x4cb8cf,_0x48fb76,!![]);}catch(_0x57eebe){return BPromise[_0x11e9('0x23')](_0x57eebe);}return _0x4cb8cf[_0x11e9('0x24')]();};}function saveUpdates(_0x5a0744,_0x598c76){return function(_0x38831c){if(_0x38831c){return _0x38831c[_0x11e9('0x25')](_0x5a0744)[_0x11e9('0x26')](function(_0x27eb23){return _0x27eb23;});}return null;};}function removeEntity(_0x1521c4,_0xccaa9b){return function(_0x1c73c8){if(_0x1c73c8){return _0x1c73c8['destroy']()[_0x11e9('0x26')](function(){var _0x278a2f=_0x1c73c8[_0x11e9('0x27')]({'plain':!![]});var _0x43f763='CustomReports';return db[_0x11e9('0x28')]['destroy']({'where':{'type':_0x43f763,'resourceId':_0x278a2f['id']}})[_0x11e9('0x26')](function(){return _0x1c73c8;});})[_0x11e9('0x26')](function(){_0x1521c4['status'](0xcc)[_0x11e9('0x1a')]();});}};}function handleEntityNotFound(_0x46af11,_0x40279d){return function(_0x44ebd5){if(!_0x44ebd5){_0x46af11['sendStatus'](0x194);}return _0x44ebd5;};}function handleError(_0x42096e,_0x4ca2bd){_0x4ca2bd=_0x4ca2bd||0x1f4;return function(_0x3a0c78){logger[_0x11e9('0x29')](_0x3a0c78['stack']);if(_0x3a0c78['name']){delete _0x3a0c78[_0x11e9('0x2a')];}_0x42096e[_0x11e9('0x1b')](_0x4ca2bd)[_0x11e9('0x2b')](_0x3a0c78);};}exports[_0x11e9('0x2c')]=function(_0x1a1bde,_0x582079){var _0x1b8281={},_0x1f668f={},_0x1f309f={'count':0x0,'rows':[]};var _0x502bf2=_[_0x11e9('0x2d')](db['AnalyticCustomReport']['rawAttributes'],function(_0x33b7e0){return{'name':_0x33b7e0['fieldName'],'type':_0x33b7e0[_0x11e9('0x2e')][_0x11e9('0x2f')]};});_0x1f668f[_0x11e9('0x30')]=_[_0x11e9('0x2d')](_0x502bf2,_0x11e9('0x2a'));_0x1f668f['query']=_[_0x11e9('0x31')](_0x1a1bde['query']);_0x1f668f['filters']=_[_0x11e9('0x32')](_0x1f668f[_0x11e9('0x30')],_0x1f668f[_0x11e9('0x33')]);_0x1b8281[_0x11e9('0x34')]=_['intersection'](_0x1f668f['model'],qs[_0x11e9('0x35')](_0x1a1bde['query'][_0x11e9('0x35')]));_0x1b8281[_0x11e9('0x34')]=_0x1b8281[_0x11e9('0x34')][_0x11e9('0x36')]?_0x1b8281['attributes']:_0x1f668f[_0x11e9('0x30')];if(!_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x37')](_0x11e9('0x38'))){_0x1b8281[_0x11e9('0x20')]=qs[_0x11e9('0x20')](_0x1a1bde['query'][_0x11e9('0x20')]);_0x1b8281[_0x11e9('0x1d')]=qs[_0x11e9('0x1d')](_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x1d')]);}_0x1b8281[_0x11e9('0x39')]=qs[_0x11e9('0x3a')](_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3a')]);_0x1b8281[_0x11e9('0x3b')]=qs[_0x11e9('0x3c')](_[_0x11e9('0x3d')](_0x1a1bde[_0x11e9('0x33')],_0x1f668f['filters']),_0x502bf2);if(_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3e')]){_0x1b8281[_0x11e9('0x3b')]=_['merge'](_0x1b8281[_0x11e9('0x3b')],{'$or':_[_0x11e9('0x2d')](_0x502bf2,function(_0x43a37f){if(_0x43a37f[_0x11e9('0x2e')]!=='VIRTUAL'){var _0x1cd6e7={};_0x1cd6e7[_0x43a37f['name']]={'$like':'%'+_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3e')]+'%'};return _0x1cd6e7;}})});}_0x1b8281=_[_0x11e9('0x3f')]({},_0x1b8281,_0x1a1bde[_0x11e9('0x40')]);var _0x252abb={'where':_0x1b8281[_0x11e9('0x3b')]};return db[_0x11e9('0x41')][_0x11e9('0x1f')](_0x252abb)[_0x11e9('0x26')](function(_0x3022e6){_0x1f309f[_0x11e9('0x1f')]=_0x3022e6;if(_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x42')]){_0x1b8281['include']=[{'all':!![]}];}return db[_0x11e9('0x41')][_0x11e9('0x43')](_0x1b8281);})[_0x11e9('0x26')](function(_0x52b6c3){_0x1f309f[_0x11e9('0x44')]=_0x52b6c3;return _0x1f309f;})[_0x11e9('0x26')](respondWithFilteredResult(_0x582079,_0x1b8281))[_0x11e9('0x45')](handleError(_0x582079,null));};exports[_0x11e9('0x46')]=function(_0x2b88ec,_0x3fe633){var _0x962f9b={'raw':![],'where':{'id':_0x2b88ec[_0x11e9('0x47')]['id']}},_0x354edc={};_0x354edc['model']=_[_0x11e9('0x31')](db['AnalyticCustomReport'][_0x11e9('0x48')]);_0x354edc['query']=_['keys'](_0x2b88ec[_0x11e9('0x33')]);_0x354edc[_0x11e9('0x3c')]=_[_0x11e9('0x32')](_0x354edc[_0x11e9('0x30')],_0x354edc[_0x11e9('0x33')]);_0x962f9b['attributes']=_['intersection'](_0x354edc[_0x11e9('0x30')],qs[_0x11e9('0x35')](_0x2b88ec[_0x11e9('0x33')][_0x11e9('0x35')]));_0x962f9b[_0x11e9('0x34')]=_0x962f9b[_0x11e9('0x34')][_0x11e9('0x36')]?_0x962f9b['attributes']:_0x354edc[_0x11e9('0x30')];if(_0x2b88ec[_0x11e9('0x33')][_0x11e9('0x42')]){_0x962f9b[_0x11e9('0x49')]=[{'all':!![]}];}_0x962f9b=_[_0x11e9('0x3f')]({},_0x962f9b,_0x2b88ec[_0x11e9('0x40')]);return db['AnalyticCustomReport'][_0x11e9('0x4a')](_0x962f9b)[_0x11e9('0x26')](handleEntityNotFound(_0x3fe633,null))[_0x11e9('0x26')](respondWithResult(_0x3fe633,null))[_0x11e9('0x45')](handleError(_0x3fe633,null));};exports['create']=function(_0x41099,_0x472cde){return db[_0x11e9('0x41')][_0x11e9('0x4b')](_0x41099[_0x11e9('0x4c')],{})[_0x11e9('0x26')](function(_0x3186e4){var _0x7e4ea7=_0x41099[_0x11e9('0x4d')][_0x11e9('0x27')]({'plain':!![]});if(!_0x7e4ea7)throw new Error(_0x11e9('0x4e'));if(_0x7e4ea7[_0x11e9('0x4f')]==='user'){var _0x12323c=_0x3186e4[_0x11e9('0x27')]({'plain':!![]});var _0x282bd7=_0x11e9('0x50');return db[_0x11e9('0x51')][_0x11e9('0x4a')]({'where':{'name':_0x282bd7,'userProfileId':_0x7e4ea7['userProfileId']},'raw':!![]})[_0x11e9('0x26')](function(_0x4c6f74){if(_0x4c6f74&&_0x4c6f74[_0x11e9('0x52')]===0x0){return db['UserProfileResource'][_0x11e9('0x4b')]({'name':_0x12323c[_0x11e9('0x2a')],'resourceId':_0x12323c['id'],'type':_0x11e9('0x53'),'sectionId':_0x4c6f74['id']},{})[_0x11e9('0x26')](function(){return _0x3186e4;});}else{return _0x3186e4;}})[_0x11e9('0x45')](function(_0x15cef8){logger['error'](_0x11e9('0x54'),_0x15cef8);throw _0x15cef8;});}return _0x3186e4;})[_0x11e9('0x26')](respondWithResult(_0x472cde,0xc9))[_0x11e9('0x45')](handleError(_0x472cde,null));};exports[_0x11e9('0x25')]=function(_0x5dc41e,_0x588d8e){if(_0x5dc41e[_0x11e9('0x4c')]['id']){delete _0x5dc41e[_0x11e9('0x4c')]['id'];}return db[_0x11e9('0x41')][_0x11e9('0x4a')]({'where':{'id':_0x5dc41e[_0x11e9('0x47')]['id']}})[_0x11e9('0x26')](handleEntityNotFound(_0x588d8e,null))[_0x11e9('0x26')](saveUpdates(_0x5dc41e[_0x11e9('0x4c')],null))[_0x11e9('0x26')](respondWithResult(_0x588d8e,null))['catch'](handleError(_0x588d8e,null));};exports[_0x11e9('0x55')]=function(_0x4ca36a,_0x1a30be){return db['AnalyticCustomReport'][_0x11e9('0x4a')]({'where':{'id':_0x4ca36a[_0x11e9('0x47')]['id']}})[_0x11e9('0x26')](handleEntityNotFound(_0x1a30be,null))[_0x11e9('0x26')](removeEntity(_0x1a30be,null))[_0x11e9('0x45')](handleError(_0x1a30be,null));};exports[_0x11e9('0x56')]=function(_0x2f231e,_0x31949e){var _0x56c81f=0xa;var _0x201756=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0x549b79={'SUM':_0x11e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x11e9('0x5f'),'GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':_0x11e9('0x61')};var _0x3b4f91={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4fa69e=function(_0x239f29){return!_[_0x11e9('0x64')]([_0x11e9('0x65'),_0x11e9('0x66'),'IS\x20EMPTY',_0x11e9('0x67')],_0x239f29);};var _0x99fd7=function(_0x165cfd){if(!_0x165cfd||!_0x165cfd['rules'][_0x11e9('0x36')]){return'';}for(var _0x3340e0='(',_0x1e29b0=0x0;_0x1e29b0<_0x165cfd[_0x11e9('0x68')][_0x11e9('0x36')];_0x1e29b0+=0x1){_0x1e29b0>0x0&&(_0x3340e0+='\x20'+_0x165cfd[_0x11e9('0x69')]+'\x20');_0x3340e0+=_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6a')]?_0x99fd7(_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6a')]):_0x165cfd[_0x11e9('0x68')][_0x1e29b0]['field']+'\x20'+_0x165cfd['rules'][_0x1e29b0]['condition']+(_0x4fa69e(_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6b')])?'\x20'+_0x165cfd[_0x11e9('0x68')][_0x1e29b0]['value']:'');}return _0x3340e0+')';};var _0x361c8c={'where':{'id':_0x2f231e['params']['id']}},_0x124532,_0xffad16,_0x3801f0,_0x3572e1,_0x7341eb;_0x361c8c=_[_0x11e9('0x3f')]({},_0x361c8c,_0x2f231e[_0x11e9('0x40')]);return db[_0x11e9('0x41')][_0x11e9('0x4a')](_0x361c8c)['then'](function(_0x26984a){if(_0x26984a){_0x124532=_0x26984a;return _0x26984a[_0x11e9('0x6c')]();}return null;})[_0x11e9('0x26')](function(_0x44caf0){if(_0x44caf0){if(!_0x44caf0[_0x11e9('0x36')]){throw new db['Sequelize'][(_0x11e9('0x6d'))](_0x11e9('0x6e'),0x193);}_0xffad16=_0x44caf0;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x344095){if(_0x344095){_0x3801f0=_[_0x11e9('0x70')](_0x344095,'id');var _0x39acd1;var _0x3d48a1=squel['select']();_0x3d48a1[_0x11e9('0x71')](_0x124532[_0x11e9('0x72')]);for(var _0x2de040=0x0;_0x2de040<_0xffad16[_0x11e9('0x36')];_0x2de040+=0x1){_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x73')]?_0x3801f0[_0xffad16[_0x2de040][_0x11e9('0x73')]]['metric']:_0xffad16[_0x2de040][_0x11e9('0x74')];_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x75')]?_[_0x11e9('0x76')](_0x549b79[_0xffad16[_0x2de040][_0x11e9('0x75')]],'%s',_0x39acd1):_0x39acd1;_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x77')]?_['replace'](_0x3b4f91[_0xffad16[_0x2de040][_0x11e9('0x77')]],'%s',_0x39acd1):_0x39acd1;if(_0xffad16[_0x2de040][_0x11e9('0x78')]){_0x3d48a1['group'](_0x39acd1);}_0xffad16[_0x2de040]['orderBy']&&_0x3d48a1[_0x11e9('0x39')](_0x39acd1,_0xffad16[_0x2de040][_0x11e9('0x79')]===_0x11e9('0x7a')?![]:!![]);_0x3d48a1['field'](_0x39acd1,_0xffad16[_0x2de040][_0x11e9('0x7b')]||_0x39acd1);}if(_0x124532[_0x11e9('0x7c')]){_0x124532[_0x11e9('0x7c')]=JSON[_0x11e9('0x7d')](_0x124532['joins']);for(var _0x7ef269=0x0;_0x7ef269<_0x124532[_0x11e9('0x7c')][_0x11e9('0x36')];_0x7ef269+=0x1){if(_0x124532['joins'][_0x7ef269][_0x11e9('0x2e')]&&_['includes'](_0x201756,_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x2e')])&&_0x124532['joins'][_0x7ef269][_0x11e9('0x7e')]&&_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')]&&_0x124532[_0x11e9('0x7c')][_0x7ef269]['foreignKey']){_0x3d48a1[_0x124532['joins'][_0x7ef269]['type']](_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')],null,util['format'](_0x11e9('0x80'),_0x124532[_0x11e9('0x72')],_0x124532[_0x11e9('0x7c')][_0x7ef269]['parentKey'],_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')],_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x81')]));}}}if(_0x124532['conditions']){_0x124532[_0x11e9('0x82')]=JSON[_0x11e9('0x7d')](_0x124532['conditions']);_0x3d48a1[_0x11e9('0x3b')](_0x99fd7(_0x124532[_0x11e9('0x82')][_0x11e9('0x6a')]));}_0x7341eb=_0x3d48a1[_0x11e9('0x83')]();_0x3d48a1[_0x11e9('0x20')](_0x56c81f);_0x3d48a1[_0x11e9('0x1d')](0x0);logger['debug'](_0x11e9('0x84'),_0x3d48a1[_0x11e9('0x85')]());return dbH['sequelize']['query'](_0x3d48a1[_0x11e9('0x85')](),{'type':dbH['sequelize'][_0x11e9('0x86')]['SELECT']});}})[_0x11e9('0x26')](respondWithResult(_0x31949e,null))[_0x11e9('0x45')](handleError(_0x31949e,null));};function runReport(_0x56d38b,_0x40b67d,_0x5d29ed){var _0x13b7eb=_0x40b67d['name'];var _0x2297a4=0xa;var _0x270905=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0x2ed1fd={'SUM':'SUM(%s)','COUNT':_0x11e9('0x87'),'COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':_0x11e9('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':_0x11e9('0x61')};var _0x49d3a2={'SEC_TO_TIME':_0x11e9('0x89'),'DATE':_0x11e9('0x8a'),'HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':_0x11e9('0x8b')};var _0x145727=function(_0x43376e){return!_['includes']([_0x11e9('0x65'),_0x11e9('0x66'),_0x11e9('0x8c'),_0x11e9('0x67')],_0x43376e);};var _0x49d742=function(_0xeb16a9){if(!_0xeb16a9||!_0xeb16a9[_0x11e9('0x68')][_0x11e9('0x36')]){return'';}for(var _0x540d1f='(',_0x42c6b3=0x0;_0x42c6b3<_0xeb16a9['rules'][_0x11e9('0x36')];_0x42c6b3+=0x1){_0x42c6b3>0x0&&(_0x540d1f+='\x20'+_0xeb16a9['operator']+'\x20');_0x540d1f+=_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6a')]?_0x49d742(_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6a')]):_0xeb16a9[_0x11e9('0x68')][_0x42c6b3]['field']+'\x20'+_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6b')]+(_0x145727(_0xeb16a9['rules'][_0x42c6b3][_0x11e9('0x6b')])?'\x20'+_0xeb16a9['rules'][_0x42c6b3]['value']:'');}return _0x540d1f+')';};var _0x203c03={'where':{'id':_0x56d38b['id']}},_0x4bf3c4,_0x5a38e2,_0x34d8e7,_0xbc6a54,_0x209e8e;_0x203c03=_['merge']({},_0x203c03,_0x5d29ed);return db[_0x11e9('0x41')]['find'](_0x203c03)['then'](function(_0x4b1a87){if(_0x4b1a87){_0x4bf3c4=_0x4b1a87;return _0x4b1a87[_0x11e9('0x6c')]();}return null;})[_0x11e9('0x26')](function(_0x556ca9){if(_0x556ca9){if(!_0x556ca9[_0x11e9('0x36')]){throw new db[(_0x11e9('0x8d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5a38e2=_0x556ca9;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x56b34f){if(_0x56b34f){_0x34d8e7=_['keyBy'](_0x56b34f,'id');var _0x124cee;var _0x36217d=squel['select']();_0x36217d[_0x11e9('0x71')](_0x4bf3c4[_0x11e9('0x72')]);for(var _0x4de937=0x0;_0x4de937<_0x5a38e2[_0x11e9('0x36')];_0x4de937+=0x1){_0x124cee=_0x5a38e2[_0x4de937]['MetricId']?_0x34d8e7[_0x5a38e2[_0x4de937]['MetricId']]['metric']:_0x5a38e2[_0x4de937]['field'];_0x124cee=_0x5a38e2[_0x4de937][_0x11e9('0x75')]?_[_0x11e9('0x76')](_0x2ed1fd[_0x5a38e2[_0x4de937]['function']],'%s',_0x124cee):_0x124cee;_0x124cee=_0x5a38e2[_0x4de937]['format']?_[_0x11e9('0x76')](_0x49d3a2[_0x5a38e2[_0x4de937]['format']],'%s',_0x124cee):_0x124cee;if(_0x5a38e2[_0x4de937][_0x11e9('0x78')]){_0x36217d[_0x11e9('0x6a')](_0x124cee);}_0x5a38e2[_0x4de937][_0x11e9('0x79')]&&_0x36217d[_0x11e9('0x39')](_0x124cee,_0x5a38e2[_0x4de937]['orderBy']===_0x11e9('0x7a')?![]:!![]);_0x36217d[_0x11e9('0x74')](_0x124cee,_0x5a38e2[_0x4de937][_0x11e9('0x7b')]||_0x124cee);}if(_0x4bf3c4[_0x11e9('0x7c')]){_0x4bf3c4['joins']=JSON[_0x11e9('0x7d')](_0x4bf3c4[_0x11e9('0x7c')]);for(var _0x357077=0x0;_0x357077<_0x4bf3c4['joins'][_0x11e9('0x36')];_0x357077+=0x1){if(_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')]&&_['includes'](_0x270905,_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')])&&_0x4bf3c4['joins'][_0x357077]['parentKey']&&_0x4bf3c4[_0x11e9('0x7c')][_0x357077]['foreignTable']&&_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x81')]){_0x36217d[_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')]](_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x7f')],null,util[_0x11e9('0x77')]('%s.%s\x20=\x20%s.%s',_0x4bf3c4[_0x11e9('0x72')],_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x7e')],_0x4bf3c4[_0x11e9('0x7c')][_0x357077]['foreignTable'],_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x81')]));}}}if(_0x4bf3c4[_0x11e9('0x82')]){_0x4bf3c4[_0x11e9('0x82')]=JSON[_0x11e9('0x7d')](_0x4bf3c4[_0x11e9('0x82')]);_0x36217d[_0x11e9('0x3b')](_0x49d742(_0x4bf3c4[_0x11e9('0x82')][_0x11e9('0x6a')]));}_0x209e8e=_0x36217d[_0x11e9('0x83')]();_0x36217d[_0x11e9('0x20')](_0x2297a4);_0x36217d[_0x11e9('0x1d')](0x0);return;}})[_0x11e9('0x26')](function(){if(_0x40b67d[_0x11e9('0x8e')]===_0x11e9('0x8f')){return null;}var _0x456074=_[_0x11e9('0x3f')](_0x40b67d,{'name':_0x40b67d[_0x11e9('0x90')]||_0x40b67d[_0x11e9('0x2a')]||_0x4bf3c4[_0x11e9('0x2a')],'basename':_0x13b7eb,'savename':util[_0x11e9('0x77')]('%s-%s.%s',_0x40b67d[_0x11e9('0x2a')]||_0x4bf3c4[_0x11e9('0x2a')],require(_0x11e9('0x91'))[_0x11e9('0x92')](0x4),_0x40b67d[_0x11e9('0x8e')]||_0x11e9('0x93')),'reportId':_0x4bf3c4['id'],'reportType':_0x11e9('0x94')});return db[_0x11e9('0x95')]['create'](_0x456074,{'raw':!![]});})['then'](function(_0x134f75){if(_0x4bf3c4['table']==='cdr'){_0x209e8e['where'](_0x4bf3c4[_0x11e9('0x72')]+_0x11e9('0x96'),_0x40b67d[_0x11e9('0x97')],_0x40b67d[_0x11e9('0x98')]);}else{_0x209e8e[_0x11e9('0x3b')](_0x4bf3c4[_0x11e9('0x72')]+_0x11e9('0x99'),_0x40b67d[_0x11e9('0x97')],_0x40b67d[_0x11e9('0x98')]);}if(_0x134f75){logger[_0x11e9('0x9a')](_0x11e9('0x9b'),_0x209e8e[_0x11e9('0x85')]());require(_0x11e9('0x9c'))[_0x11e9('0x9d')](path['join'](__dirname,_0x11e9('0x9e'),_0x134f75['output']),[_0x134f75['id'],_0x209e8e[_0x11e9('0x85')](),path[_0x11e9('0x57')](__dirname,'../../files/reports',_0x134f75[_0x11e9('0x9f')]),_0x13b7eb]);return _0x134f75;}else{var _0xc2f347=squel['select']();_0xc2f347[_0x11e9('0x71')]('('+_0x209e8e[_0x11e9('0x85')]()+')','countTable');_0xc2f347[_0x11e9('0x74')](_0x11e9('0xa0'),_0x11e9('0x1f'));_0x209e8e[_0x11e9('0x20')](_0x40b67d['limit']||_0x2297a4);_0x209e8e[_0x11e9('0x1d')](_0x40b67d[_0x11e9('0x1d')]||0x0);return dbH[_0x11e9('0xa1')]['query'](_0xc2f347['toString'](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')]['SELECT']})[_0x11e9('0x26')](function(_0x21592d){if(!_0x21592d[_0x11e9('0x36')]){_0xbc6a54=0x0;}else{_0xbc6a54=_0x21592d[0x0][_0x11e9('0x1f')]||0x0;}return dbH[_0x11e9('0xa1')]['query'](_0x209e8e[_0x11e9('0x85')](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')][_0x11e9('0xa2')]});})['then'](function(_0x5ebccf){return{'rows':_0x5ebccf||[],'count':_0xbc6a54};});}});}exports[_0x11e9('0xa3')]=function(_0x299dc7,_0x51e2d5){return runReport(_0x299dc7[_0x11e9('0x47')],_0x299dc7['query'],_0x299dc7[_0x11e9('0x40')])['then'](respondWithResult(_0x51e2d5,null))['catch'](handleError(_0x51e2d5,null));};exports[_0x11e9('0xa4')]=runReport;exports[_0x11e9('0x33')]=function(_0x221300,_0x5dd0a5){var _0x2e3ed0=0xa;var _0x1333e4=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0xd2aa06={'SUM':_0x11e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x11e9('0x5f'),'GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xe8b688={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x11e9('0x8a'),'HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':_0x11e9('0x8b')};var _0x440c64=function(_0x432da6){return!_['includes']([_0x11e9('0x65'),_0x11e9('0x66'),_0x11e9('0x8c'),_0x11e9('0x67')],_0x432da6);};var _0x7aee04=function(_0x13b7f6){if(!_0x13b7f6||!_0x13b7f6[_0x11e9('0x68')][_0x11e9('0x36')]){return'';}for(var _0x202bbd='(',_0x7a25b1=0x0;_0x7a25b1<_0x13b7f6[_0x11e9('0x68')][_0x11e9('0x36')];_0x7a25b1+=0x1){_0x7a25b1>0x0&&(_0x202bbd+='\x20'+_0x13b7f6[_0x11e9('0x69')]+'\x20');_0x202bbd+=_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6a')]?_0x7aee04(_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6a')]):_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x74')]+'\x20'+_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6b')]+(_0x440c64(_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6b')])?'\x20'+_0x13b7f6['rules'][_0x7a25b1][_0x11e9('0xa5')]:'');}return _0x202bbd+')';};var _0x19cb52={'where':{'id':_0x221300[_0x11e9('0x47')]['id']}},_0x1c2031,_0x377fdf,_0x5b2a4c,_0x5bf5f7,_0x404128;_0x19cb52=_[_0x11e9('0x3f')]({},_0x19cb52,_0x221300[_0x11e9('0x40')]);return db[_0x11e9('0x41')][_0x11e9('0x4a')](_0x19cb52)['then'](function(_0x1dd63c){if(_0x1dd63c){_0x1c2031=_0x1dd63c;return _0x1dd63c['getFields']();}return null;})[_0x11e9('0x26')](function(_0x43e7b4){if(_0x43e7b4){if(!_0x43e7b4['length']){throw new db['Sequelize'][(_0x11e9('0x6d'))](_0x11e9('0x6e'),0x193);}_0x377fdf=_0x43e7b4;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x20fbd8){if(_0x20fbd8){_0x5b2a4c=_[_0x11e9('0x70')](_0x20fbd8,'id');var _0x557f0d;var _0x430002=squel[_0x11e9('0xa6')]();_0x430002[_0x11e9('0x71')](_0x1c2031[_0x11e9('0x72')]);for(var _0x460cd9=0x0;_0x460cd9<_0x377fdf['length'];_0x460cd9+=0x1){_0x557f0d=_0x377fdf[_0x460cd9][_0x11e9('0x73')]?_0x5b2a4c[_0x377fdf[_0x460cd9][_0x11e9('0x73')]][_0x11e9('0xa7')]:_0x377fdf[_0x460cd9]['field'];_0x557f0d=_0x377fdf[_0x460cd9]['function']?_[_0x11e9('0x76')](_0xd2aa06[_0x377fdf[_0x460cd9][_0x11e9('0x75')]],'%s',_0x557f0d):_0x557f0d;_0x557f0d=_0x377fdf[_0x460cd9][_0x11e9('0x77')]?_[_0x11e9('0x76')](_0xe8b688[_0x377fdf[_0x460cd9]['format']],'%s',_0x557f0d):_0x557f0d;if(_0x377fdf[_0x460cd9][_0x11e9('0x78')]){_0x430002[_0x11e9('0x6a')](_0x557f0d);}_0x377fdf[_0x460cd9][_0x11e9('0x79')]&&_0x430002['order'](_0x557f0d,_0x377fdf[_0x460cd9]['orderBy']===_0x11e9('0x7a')?![]:!![]);_0x430002[_0x11e9('0x74')](_0x557f0d,_0x377fdf[_0x460cd9]['alias']||_0x557f0d);}if(_0x1c2031[_0x11e9('0x7c')]){_0x1c2031[_0x11e9('0x7c')]=JSON['parse'](_0x1c2031[_0x11e9('0x7c')]);for(var _0x4108a9=0x0;_0x4108a9<_0x1c2031[_0x11e9('0x7c')][_0x11e9('0x36')];_0x4108a9+=0x1){if(_0x1c2031['joins'][_0x4108a9]['type']&&_[_0x11e9('0x64')](_0x1333e4,_0x1c2031['joins'][_0x4108a9]['type'])&&_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7e')]&&_0x1c2031['joins'][_0x4108a9][_0x11e9('0x7f')]&&_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x81')]){_0x430002[_0x1c2031['joins'][_0x4108a9]['type']](_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7f')],null,util[_0x11e9('0x77')]('%s.%s\x20=\x20%s.%s',_0x1c2031['table'],_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7e')],_0x1c2031['joins'][_0x4108a9][_0x11e9('0x7f')],_0x1c2031['joins'][_0x4108a9][_0x11e9('0x81')]));}}}if(_0x1c2031[_0x11e9('0x82')]){_0x1c2031['conditions']=JSON[_0x11e9('0x7d')](_0x1c2031['conditions']);_0x430002['where'](_0x7aee04(_0x1c2031['conditions'][_0x11e9('0x6a')]));}_0x404128=_0x430002['clone']();_0x430002[_0x11e9('0x20')](_0x2e3ed0);_0x430002[_0x11e9('0x1d')](0x0);logger[_0x11e9('0xa8')]('Limited\x20Query:',_0x430002[_0x11e9('0x85')]());return dbH[_0x11e9('0xa1')][_0x11e9('0x33')](_0x430002['toString'](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')][_0x11e9('0xa2')]});}})[_0x11e9('0x26')](function(){return{'sql':_0x404128['toString']()};})['then'](respondWithResult(_0x5dd0a5,null))['catch'](handleError(_0x5dd0a5,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 1e46f20..03bcfc6 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 _0x98e8=['api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x584d2a,_0x80af2e){var _0x2929cc=function(_0xbca9e3){while(--_0xbca9e3){_0x584d2a['push'](_0x584d2a['shift']());}};_0x2929cc(++_0x80af2e);}(_0x98e8,0x10e));var _0x898e=function(_0x52c3e2,_0x332d61){_0x52c3e2=_0x52c3e2-0x0;var _0x325392=_0x98e8[_0x52c3e2];return _0x325392;};'use strict';var _=require(_0x898e('0x0'));var util=require(_0x898e('0x1'));var logger=require(_0x898e('0x2'))(_0x898e('0x3'));var moment=require('moment');var BPromise=require(_0x898e('0x4'));var rp=require(_0x898e('0x5'));var fs=require('fs');var path=require(_0x898e('0x6'));var rimraf=require('rimraf');var config=require(_0x898e('0x7'));var attributes=require(_0x898e('0x8'));module[_0x898e('0x9')]=function(_0xa016de,_0x37bb10){return _0xa016de[_0x898e('0xa')](_0x898e('0xb'),attributes,{'tableName':_0x898e('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe657=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x8473ab,_0x11263e){var _0x3a89c0=function(_0x95ab9f){while(--_0x95ab9f){_0x8473ab['push'](_0x8473ab['shift']());}};_0x3a89c0(++_0x11263e);}(_0xe657,0x1c1));var _0x7e65=function(_0xdfe8c4,_0x3f695c){_0xdfe8c4=_0xdfe8c4-0x0;var _0x5ee124=_0xe657[_0xdfe8c4];return _0x5ee124;};'use strict';var _=require(_0x7e65('0x0'));var util=require(_0x7e65('0x1'));var logger=require(_0x7e65('0x2'))('api');var moment=require(_0x7e65('0x3'));var BPromise=require(_0x7e65('0x4'));var rp=require(_0x7e65('0x5'));var fs=require('fs');var path=require(_0x7e65('0x6'));var rimraf=require(_0x7e65('0x7'));var config=require(_0x7e65('0x8'));var attributes=require(_0x7e65('0x9'));module['exports']=function(_0x4e416a,_0x51ba1d){return _0x4e416a[_0x7e65('0xa')](_0x7e65('0xb'),attributes,{'tableName':_0x7e65('0xc'),'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 4ed2332..c7f31ea 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 _0xebb5=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x34d2a0,_0x6cde4f){var _0x505c5b=function(_0x2130a3){while(--_0x2130a3){_0x34d2a0['push'](_0x34d2a0['shift']());}};_0x505c5b(++_0x6cde4f);}(_0xebb5,0xb5));var _0x5ebb=function(_0x22d9ee,_0x2f495b){_0x22d9ee=_0x22d9ee-0x0;var _0x3f66f1=_0xebb5[_0x22d9ee];return _0x3f66f1;};'use strict';var _=require(_0x5ebb('0x0'));var util=require(_0x5ebb('0x1'));var moment=require(_0x5ebb('0x2'));var BPromise=require(_0x5ebb('0x3'));var rs=require(_0x5ebb('0x4'));var fs=require('fs');var Redis=require(_0x5ebb('0x5'));var db=require(_0x5ebb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ebb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5ebb('0x8'));var client=jayson[_0x5ebb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b31a8,_0x2a417f,_0x1954a7){return new BPromise(function(_0x259c3d,_0x767513){return client[_0x5ebb('0xa')](_0x3b31a8,_0x1954a7)[_0x5ebb('0xb')](function(_0x34136c){logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));logger[_0x5ebb('0xe')](_0x5ebb('0xf'),_0x2a417f,_0x5ebb('0xd'),JSON[_0x5ebb('0x10')](_0x34136c));if(_0x34136c[_0x5ebb('0x11')]){if(_0x34136c['error']['code']===0x1f4){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')]['message']);return _0x767513(_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);}logger['error'](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);return _0x259c3d(_0x34136c['error'][_0x5ebb('0x12')]);}else{logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));_0x259c3d(_0x34136c[_0x5ebb('0x13')][_0x5ebb('0x12')]);}})['catch'](function(_0xbac4ed){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0xbac4ed);_0x767513(_0xbac4ed);});});} \ No newline at end of file +var _0xd3be=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2514ff,_0x381293){var _0x21579d=function(_0x411c12){while(--_0x411c12){_0x2514ff['push'](_0x2514ff['shift']());}};_0x21579d(++_0x381293);}(_0xd3be,0xdf));var _0xed3b=function(_0x5d35b7,_0x3337e2){_0x5d35b7=_0x5d35b7-0x0;var _0x158b8b=_0xd3be[_0x5d35b7];return _0x158b8b;};'use strict';var _=require(_0xed3b('0x0'));var util=require(_0xed3b('0x1'));var moment=require(_0xed3b('0x2'));var BPromise=require('bluebird');var rs=require(_0xed3b('0x3'));var fs=require('fs');var Redis=require(_0xed3b('0x4'));var db=require(_0xed3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed3b('0x6'))(_0xed3b('0x7'));var config=require(_0xed3b('0x8'));var jayson=require(_0xed3b('0x9'));var client=jayson['client'][_0xed3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47dbac,_0x4d281e,_0x44bfb7){return new BPromise(function(_0x16bea0,_0x4f5223){return client[_0xed3b('0xb')](_0x47dbac,_0x44bfb7)[_0xed3b('0xc')](function(_0x3ff99d){logger[_0xed3b('0xd')](_0xed3b('0xe'),_0x4d281e,_0xed3b('0xf'));logger['debug'](_0xed3b('0x10'),_0x4d281e,'request\x20sent',JSON['stringify'](_0x3ff99d));if(_0x3ff99d[_0xed3b('0x11')]){if(_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x12')]===0x1f4){logger[_0xed3b('0x11')](_0xed3b('0xe'),_0x4d281e,_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);return _0x4f5223(_0x3ff99d['error'][_0xed3b('0x13')]);}logger[_0xed3b('0x11')](_0xed3b('0xe'),_0x4d281e,_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);return _0x16bea0(_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);}else{logger[_0xed3b('0xd')](_0xed3b('0xe'),_0x4d281e,_0xed3b('0xf'));_0x16bea0(_0x3ff99d[_0xed3b('0x14')]['message']);}})[_0xed3b('0x15')](function(_0x3ff86b){logger[_0xed3b('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4d281e,_0x3ff86b);_0x4f5223(_0x3ff86b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f7be351..cb4cf2c 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 _0x7490=['/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview'];(function(_0x5d0969,_0x15e07f){var _0x2f67aa=function(_0x59e132){while(--_0x59e132){_0x5d0969['push'](_0x5d0969['shift']());}};_0x2f67aa(++_0x15e07f);}(_0x7490,0xf4));var _0x0749=function(_0x2d9951,_0x121f23){_0x2d9951=_0x2d9951-0x0;var _0x310df9=_0x7490[_0x2d9951];return _0x310df9;};'use strict';var multer=require(_0x0749('0x0'));var util=require('util');var path=require(_0x0749('0x1'));var timeout=require(_0x0749('0x2'));var express=require(_0x0749('0x3'));var router=express[_0x0749('0x4')]();var fs_extra=require(_0x0749('0x5'));var auth=require(_0x0749('0x6'));var interaction=require(_0x0749('0x7'));var config=require(_0x0749('0x8'));var controller=require(_0x0749('0x9'));router[_0x0749('0xa')]('/',auth[_0x0749('0xb')](),controller[_0x0749('0xc')]);router['get'](_0x0749('0xd'),auth[_0x0749('0xb')](),controller['show']);router[_0x0749('0xa')](_0x0749('0xe'),auth[_0x0749('0xb')](),controller[_0x0749('0xf')]);router[_0x0749('0xa')](_0x0749('0x10'),auth[_0x0749('0xb')](),controller[_0x0749('0x11')]);router[_0x0749('0xa')](_0x0749('0x12'),auth['isAuthenticated'](),controller[_0x0749('0x13')]);router['post']('/',auth[_0x0749('0xb')](),controller[_0x0749('0x14')]);router[_0x0749('0x15')]('/:id',auth[_0x0749('0xb')](),controller[_0x0749('0x16')]);router[_0x0749('0x17')](_0x0749('0xd'),auth[_0x0749('0xb')](),controller[_0x0749('0x18')]);module[_0x0749('0x19')]=router; \ No newline at end of file +var _0xd78c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','query','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0xd78c,0x10d));var _0xcd78=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd78c[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xcd78('0x0'));var util=require(_0xcd78('0x1'));var path=require(_0xcd78('0x2'));var timeout=require(_0xcd78('0x3'));var express=require(_0xcd78('0x4'));var router=express[_0xcd78('0x5')]();var fs_extra=require(_0xcd78('0x6'));var auth=require(_0xcd78('0x7'));var interaction=require(_0xcd78('0x8'));var config=require(_0xcd78('0x9'));var controller=require(_0xcd78('0xa'));router[_0xcd78('0xb')]('/',auth[_0xcd78('0xc')](),controller['index']);router[_0xcd78('0xb')](_0xcd78('0xd'),auth['isAuthenticated'](),controller[_0xcd78('0xe')]);router['get'](_0xcd78('0xf'),auth['isAuthenticated'](),controller[_0xcd78('0x10')]);router[_0xcd78('0xb')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xcd78('0xb')]('/:id/query',auth[_0xcd78('0xc')](),controller[_0xcd78('0x11')]);router[_0xcd78('0x12')]('/',auth[_0xcd78('0xc')](),controller[_0xcd78('0x13')]);router[_0xcd78('0x14')](_0xcd78('0xd'),auth[_0xcd78('0xc')](),controller['update']);router[_0xcd78('0x15')](_0xcd78('0xd'),auth[_0xcd78('0xc')](),controller['destroy']);module[_0xcd78('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 24a0e75..6afd776 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 _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x26eeaf,_0x18f26d){var _0x20a33c=function(_0xe8790e){while(--_0xe8790e){_0x26eeaf['push'](_0x26eeaf['shift']());}};_0x20a33c(++_0x18f26d);}(_0x53ec,0x192));var _0xc53e=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x53ec[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x55ad58,_0x44c12f){var _0x471b98=function(_0x52a1cd){while(--_0x52a1cd){_0x55ad58['push'](_0x55ad58['shift']());}};_0x471b98(++_0x44c12f);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x299565,_0x13b4df){_0x299565=_0x299565-0x0;var _0x413367=_0x3eea[_0x299565];return _0x413367;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 5c5d1f2..ca4c3af 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_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)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x1868f4,_0x150266){var _0x273bf8=function(_0x596165){while(--_0x596165){_0x1868f4['push'](_0x1868f4['shift']());}};_0x273bf8(++_0x150266);}(_0xda19,0xd5));var _0x9da1=function(_0x2b6fb8,_0x13466c){_0x2b6fb8=_0x2b6fb8-0x0;var _0x3b161a=_0xda19[_0x2b6fb8];return _0x3b161a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file +var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','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/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x191559,_0xb1a10f){var _0x1f6626=function(_0x61578b){while(--_0x61578b){_0x191559['push'](_0x191559['shift']());}};_0x1f6626(++_0xb1a10f);}(_0x814b,0x1a2));var _0xb814=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x814b[_0x5a2299];return _0xedff0f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'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 _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c9ec0de..0f4255e 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 _0x7010=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','api','moment','request-promise','path'];(function(_0x4d529a,_0x317bce){var _0x5754d9=function(_0x353b20){while(--_0x353b20){_0x4d529a['push'](_0x4d529a['shift']());}};_0x5754d9(++_0x317bce);}(_0x7010,0x9b));var _0x0701=function(_0x1c6efd,_0xb2f3cd){_0x1c6efd=_0x1c6efd-0x0;var _0x53a918=_0x7010[_0x1c6efd];return _0x53a918;};'use strict';var _=require(_0x0701('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0701('0x1'));var moment=require(_0x0701('0x2'));var BPromise=require('bluebird');var rp=require(_0x0701('0x3'));var fs=require('fs');var path=require(_0x0701('0x4'));var rimraf=require(_0x0701('0x5'));var config=require(_0x0701('0x6'));var attributes=require(_0x0701('0x7'));module[_0x0701('0x8')]=function(_0x2b1ec9,_0x4d2e89){return _0x2b1ec9['define'](_0x0701('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab19=['AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0xab19,0x138));var _0x9ab1=function(_0x3750cb,_0x505a79){_0x3750cb=_0x3750cb-0x0;var _0xc93ab6=_0xab19[_0x3750cb];return _0xc93ab6;};'use strict';var _=require('lodash');var util=require(_0x9ab1('0x0'));var logger=require('../../config/logger')(_0x9ab1('0x1'));var moment=require(_0x9ab1('0x2'));var BPromise=require(_0x9ab1('0x3'));var rp=require(_0x9ab1('0x4'));var fs=require('fs');var path=require(_0x9ab1('0x5'));var rimraf=require(_0x9ab1('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ab1('0x7'));module['exports']=function(_0x2aff26,_0xb5bba5){return _0x2aff26['define'](_0x9ab1('0x8'),attributes,{'tableName':_0x9ab1('0x9'),'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 d91296d..41147b9 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 _0x1002=['client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x36ff0d,_0x4dad91){var _0x49ba07=function(_0x34352d){while(--_0x34352d){_0x36ff0d['push'](_0x36ff0d['shift']());}};_0x49ba07(++_0x4dad91);}(_0x1002,0x9e));var _0x2100=function(_0x6598bd,_0x2240d4){_0x6598bd=_0x6598bd-0x0;var _0x46b063=_0x1002[_0x6598bd];return _0x46b063;};'use strict';var _=require(_0x2100('0x0'));var util=require('util');var moment=require(_0x2100('0x1'));var BPromise=require(_0x2100('0x2'));var rs=require(_0x2100('0x3'));var fs=require('fs');var Redis=require(_0x2100('0x4'));var db=require(_0x2100('0x5'))['db'];var utils=require(_0x2100('0x6'));var logger=require(_0x2100('0x7'))(_0x2100('0x8'));var config=require('../../config/environment');var jayson=require(_0x2100('0x9'));var client=jayson[_0x2100('0xa')][_0x2100('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187b83,_0x3f011,_0x3ab061){return new BPromise(function(_0x1718dd,_0x47bab1){return client[_0x2100('0xc')](_0x187b83,_0x3ab061)[_0x2100('0xd')](function(_0x5c5c84){logger[_0x2100('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x2100('0xf'));logger[_0x2100('0x10')](_0x2100('0x11'),_0x3f011,_0x2100('0xf'),JSON[_0x2100('0x12')](_0x5c5c84));if(_0x5c5c84[_0x2100('0x13')]){if(_0x5c5c84['error']['code']===0x1f4){logger[_0x2100('0x13')](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x47bab1(_0x5c5c84['error'][_0x2100('0x15')]);}logger['error'](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x1718dd(_0x5c5c84[_0x2100('0x13')]['message']);}else{logger[_0x2100('0xe')](_0x2100('0x14'),_0x3f011,'request\x20sent');_0x1718dd(_0x5c5c84[_0x2100('0x16')]['message']);}})[_0x2100('0x17')](function(_0x895649){logger[_0x2100('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x895649);_0x47bab1(_0x895649);});});} \ No newline at end of file +var _0x1d37=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x2c4d32,_0x69e859){var _0x19fe28=function(_0x167e8e){while(--_0x167e8e){_0x2c4d32['push'](_0x2c4d32['shift']());}};_0x19fe28(++_0x69e859);}(_0x1d37,0xfe));var _0x71d3=function(_0x45fc9c,_0x70f2cb){_0x45fc9c=_0x45fc9c-0x0;var _0x984946=_0x1d37[_0x45fc9c];return _0x984946;};'use strict';var _=require(_0x71d3('0x0'));var util=require('util');var moment=require(_0x71d3('0x1'));var BPromise=require(_0x71d3('0x2'));var rs=require(_0x71d3('0x3'));var fs=require('fs');var Redis=require(_0x71d3('0x4'));var db=require(_0x71d3('0x5'))['db'];var utils=require(_0x71d3('0x6'));var logger=require(_0x71d3('0x7'))(_0x71d3('0x8'));var config=require('../../config/environment');var jayson=require(_0x71d3('0x9'));var client=jayson['client'][_0x71d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48971f,_0x4fad8f,_0x5cd9cb){return new BPromise(function(_0x37ff50,_0x2c72f6){return client[_0x71d3('0xb')](_0x48971f,_0x5cd9cb)['then'](function(_0xd89246){logger[_0x71d3('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fad8f,_0x71d3('0xd'));logger[_0x71d3('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4fad8f,'request\x20sent',JSON[_0x71d3('0xf')](_0xd89246));if(_0xd89246[_0x71d3('0x10')]){if(_0xd89246[_0x71d3('0x10')]['code']===0x1f4){logger['error'](_0x71d3('0x11'),_0x4fad8f,_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);return _0x2c72f6(_0xd89246['error'][_0x71d3('0x12')]);}logger[_0x71d3('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fad8f,_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);return _0x37ff50(_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);}else{logger[_0x71d3('0xc')](_0x71d3('0x11'),_0x4fad8f,_0x71d3('0xd'));_0x37ff50(_0xd89246[_0x71d3('0x13')][_0x71d3('0x12')]);}})[_0x71d3('0x14')](function(_0x5143d7){logger['error'](_0x71d3('0x11'),_0x4fad8f,_0x5143d7);_0x2c72f6(_0x5143d7);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 2cd638e..2bce2b6 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 _0x93a6=['/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93a6,0x1ac));var _0x693a=function(_0x187dbd,_0x2ecf58){_0x187dbd=_0x187dbd-0x0;var _0x45d1e9=_0x93a6[_0x187dbd];return _0x45d1e9;};'use strict';var multer=require(_0x693a('0x0'));var util=require(_0x693a('0x1'));var path=require(_0x693a('0x2'));var timeout=require(_0x693a('0x3'));var express=require('express');var router=express[_0x693a('0x4')]();var fs_extra=require(_0x693a('0x5'));var auth=require(_0x693a('0x6'));var interaction=require(_0x693a('0x7'));var config=require(_0x693a('0x8'));var controller=require(_0x693a('0x9'));router[_0x693a('0xa')]('/',auth[_0x693a('0xb')](),controller['index']);router[_0x693a('0xa')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0xd')]);router[_0x693a('0xa')](_0x693a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x693a('0xa')](_0x693a('0xf'),auth['isAuthenticated'](),controller[_0x693a('0x10')]);router[_0x693a('0xa')](_0x693a('0x11'),auth[_0x693a('0xb')](),controller[_0x693a('0x12')]);router[_0x693a('0x13')]('/',auth[_0x693a('0xb')](),controller[_0x693a('0x14')]);router[_0x693a('0x15')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x16')]);router[_0x693a('0x17')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x18')]);module[_0x693a('0x19')]=router; \ No newline at end of file +var _0x4f14=['preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview'];(function(_0x23bddf,_0x4c3a28){var _0x3feb29=function(_0x1bcc05){while(--_0x1bcc05){_0x23bddf['push'](_0x23bddf['shift']());}};_0x3feb29(++_0x4c3a28);}(_0x4f14,0x11d));var _0x44f1=function(_0x55edc6,_0x18485c){_0x55edc6=_0x55edc6-0x0;var _0xd2d02c=_0x4f14[_0x55edc6];return _0xd2d02c;};'use strict';var multer=require(_0x44f1('0x0'));var util=require(_0x44f1('0x1'));var path=require(_0x44f1('0x2'));var timeout=require(_0x44f1('0x3'));var express=require(_0x44f1('0x4'));var router=express[_0x44f1('0x5')]();var fs_extra=require(_0x44f1('0x6'));var auth=require(_0x44f1('0x7'));var interaction=require(_0x44f1('0x8'));var config=require('../../config/environment');var controller=require(_0x44f1('0x9'));router[_0x44f1('0xa')]('/',auth[_0x44f1('0xb')](),controller[_0x44f1('0xc')]);router[_0x44f1('0xa')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['show']);router[_0x44f1('0xa')](_0x44f1('0xe'),auth[_0x44f1('0xb')](),controller[_0x44f1('0xf')]);router[_0x44f1('0xa')](_0x44f1('0x10'),auth[_0x44f1('0xb')](),controller[_0x44f1('0x11')]);router['get'](_0x44f1('0x12'),auth[_0x44f1('0xb')](),controller[_0x44f1('0x13')]);router[_0x44f1('0x14')]('/',auth[_0x44f1('0xb')](),controller[_0x44f1('0x15')]);router[_0x44f1('0x16')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['update']);router[_0x44f1('0x17')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['destroy']);module[_0x44f1('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 556dbef..560f72f 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 _0xc293=['ENUM','csv','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','STRING'];(function(_0x39db98,_0x28c7d9){var _0x5939cf=function(_0x5ed6c6){while(--_0x5ed6c6){_0x39db98['push'](_0x39db98['shift']());}};_0x5939cf(++_0x28c7d9);}(_0xc293,0xe7));var _0x3c29=function(_0x196126,_0x35ce6c){_0x196126=_0x196126-0x0;var _0xe144e9=_0xc293[_0x196126];return _0xe144e9;};'use strict';var Sequelize=require(_0x3c29('0x0'));var moment=require(_0x3c29('0x1'));module['exports']={'name':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3c29('0x3')](_0x3c29('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3c29('0x5')]},'endDate':{'type':Sequelize[_0x3c29('0x5')]},'status':{'type':Sequelize[_0x3c29('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3c29('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x3c29('0x6')},'reportId':{'type':Sequelize[_0x3c29('0x7')](0xb)[_0x3c29('0x8')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0244=['scheduled','INTEGER','UNSIGNED','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual'];(function(_0x385ef4,_0x593598){var _0x2a7f3f=function(_0x7898fc){while(--_0x7898fc){_0x385ef4['push'](_0x385ef4['shift']());}};_0x2a7f3f(++_0x593598);}(_0x0244,0x10b));var _0x4024=function(_0x4421a0,_0x1525bc){_0x4421a0=_0x4421a0-0x0;var _0x5626d0=_0x0244[_0x4421a0];return _0x5626d0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4024('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0x4024('0x1')]('csv',_0x4024('0x2'),_0x4024('0x3')),'allowNull':![],'defaultValue':_0x4024('0x4')},'savename':{'type':Sequelize[_0x4024('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4024('0x5')]},'endDate':{'type':Sequelize[_0x4024('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x4024('0x6')},'type':{'type':Sequelize['ENUM'](_0x4024('0x7'),_0x4024('0x8')),'allowNull':![],'defaultValue':_0x4024('0x7')},'reportId':{'type':Sequelize[_0x4024('0x9')](0xb)[_0x4024('0xa')]},'reportType':{'type':Sequelize[_0x4024('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index a0fbbe8..cfdeb01 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 _0x2367=['sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x19b2fb,_0x57af95){var _0x4ecad7=function(_0x3e6806){while(--_0x3e6806){_0x19b2fb['push'](_0x19b2fb['shift']());}};_0x4ecad7(++_0x57af95);}(_0x2367,0xb5));var _0x7236=function(_0x403145,_0x3aec5e){_0x403145=_0x403145-0x0;var _0x5e1d6f=_0x2367[_0x403145];return _0x5e1d6f;};'use strict';var emlformat=require(_0x7236('0x0'));var rimraf=require(_0x7236('0x1'));var zipdir=require(_0x7236('0x2'));var jsonpatch=require(_0x7236('0x3'));var rp=require(_0x7236('0x4'));var moment=require('moment');var BPromise=require(_0x7236('0x5'));var Mustache=require(_0x7236('0x6'));var util=require(_0x7236('0x7'));var path=require(_0x7236('0x8'));var sox=require(_0x7236('0x9'));var csv=require(_0x7236('0xa'));var ejs=require(_0x7236('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7236('0xc'));var squel=require(_0x7236('0xd'));var crypto=require(_0x7236('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7236('0xa'));var querystring=require('querystring');var Papa=require(_0x7236('0xf'));var Redis=require('ioredis');var authService=require(_0x7236('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7236('0x12'))(_0x7236('0x13'));var utils=require(_0x7236('0x14'));var config=require(_0x7236('0x15'));var licenseUtil=require(_0x7236('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19066d,_0x305e05){_0x305e05=_0x305e05||0xcc;return function(_0x1489c2){if(_0x1489c2){return _0x19066d['sendStatus'](_0x305e05);}return _0x19066d[_0x7236('0x17')](_0x305e05)[_0x7236('0x18')]();};}function respondWithResult(_0x42bc5c,_0xcff778){_0xcff778=_0xcff778||0xc8;return function(_0x172fd3){if(_0x172fd3){return _0x42bc5c[_0x7236('0x17')](_0xcff778)[_0x7236('0x19')](_0x172fd3);}};}function respondWithFilteredResult(_0x4140b5,_0xb3f7e7){return function(_0x425602){if(_0x425602){var _0x435213=typeof _0xb3f7e7[_0x7236('0x1a')]===_0x7236('0x1b')&&typeof _0xb3f7e7['limit']==='undefined';var _0x2872b8=_0x425602[_0x7236('0x1c')];var _0x2d78e2=_0x435213?0x0:_0xb3f7e7[_0x7236('0x1a')];var _0x4db8f3=_0x435213?_0x425602[_0x7236('0x1c')]:_0xb3f7e7[_0x7236('0x1a')]+_0xb3f7e7[_0x7236('0x1d')];var _0x152ec4;if(_0x4db8f3>=_0x2872b8){_0x4db8f3=_0x2872b8;_0x152ec4=0xc8;}else{_0x152ec4=0xce;}_0x4140b5['status'](_0x152ec4);return _0x4140b5['set'](_0x7236('0x1e'),_0x2d78e2+'-'+_0x4db8f3+'/'+_0x2872b8)[_0x7236('0x19')](_0x425602);}return null;};}function patchUpdates(_0x1405b0){return function(_0x10af4c){try{jsonpatch[_0x7236('0x1f')](_0x10af4c,_0x1405b0,!![]);}catch(_0x479bc1){return BPromise[_0x7236('0x20')](_0x479bc1);}return _0x10af4c['save']();};}function saveUpdates(_0x309c07,_0x1f2907){return function(_0x4d47a5){if(_0x4d47a5){return _0x4d47a5[_0x7236('0x21')](_0x309c07)[_0x7236('0x22')](function(_0x17d613){return _0x17d613;});}return null;};}function removeEntity(_0xb735e1,_0x217a8e){return function(_0x5ecf0f){if(_0x5ecf0f){return _0x5ecf0f[_0x7236('0x23')]()['then'](function(){var _0x40889f=_0x5ecf0f[_0x7236('0x24')]({'plain':!![]});var _0x469f2d=_0x7236('0x25');return db['UserProfileResource'][_0x7236('0x23')]({'where':{'type':_0x469f2d,'resourceId':_0x40889f['id']}})[_0x7236('0x22')](function(){return _0x5ecf0f;});})[_0x7236('0x22')](function(){_0xb735e1[_0x7236('0x17')](0xcc)[_0x7236('0x18')]();});}};}function handleEntityNotFound(_0x57c943,_0x135dc6){return function(_0x38e710){if(!_0x38e710){_0x57c943[_0x7236('0x26')](0x194);}return _0x38e710;};}function handleError(_0x278559,_0x15e5bb){_0x15e5bb=_0x15e5bb||0x1f4;return function(_0xd999f4){logger[_0x7236('0x27')](_0xd999f4[_0x7236('0x28')]);if(_0xd999f4[_0x7236('0x29')]){delete _0xd999f4[_0x7236('0x29')];}_0x278559[_0x7236('0x17')](_0x15e5bb)[_0x7236('0x2a')](_0xd999f4);};}exports[_0x7236('0x2b')]=function(_0x4e4d69,_0x1b43de){var _0x539b84={},_0x3a193a={},_0x4b700d={'count':0x0,'rows':[]};var _0x319abf=_[_0x7236('0x2c')](db['AnalyticExtractedReport'][_0x7236('0x2d')],function(_0x284876){return{'name':_0x284876[_0x7236('0x2e')],'type':_0x284876[_0x7236('0x2f')][_0x7236('0x30')]};});_0x3a193a[_0x7236('0x31')]=_[_0x7236('0x2c')](_0x319abf,_0x7236('0x29'));_0x3a193a['query']=_[_0x7236('0x32')](_0x4e4d69[_0x7236('0x33')]);_0x3a193a[_0x7236('0x34')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],_0x3a193a[_0x7236('0x33')]);_0x539b84[_0x7236('0x36')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],qs[_0x7236('0x37')](_0x4e4d69['query'][_0x7236('0x37')]));_0x539b84['attributes']=_0x539b84[_0x7236('0x36')][_0x7236('0x38')]?_0x539b84[_0x7236('0x36')]:_0x3a193a[_0x7236('0x31')];if(!_0x4e4d69[_0x7236('0x33')][_0x7236('0x39')]('nolimit')){_0x539b84[_0x7236('0x1d')]=qs['limit'](_0x4e4d69['query'][_0x7236('0x1d')]);_0x539b84[_0x7236('0x1a')]=qs[_0x7236('0x1a')](_0x4e4d69[_0x7236('0x33')]['offset']);}_0x539b84[_0x7236('0x3a')]=qs[_0x7236('0x3b')](_0x4e4d69[_0x7236('0x33')]['sort']);_0x539b84['where']=qs[_0x7236('0x34')](_[_0x7236('0x3c')](_0x4e4d69[_0x7236('0x33')],_0x3a193a[_0x7236('0x34')]),_0x319abf);if(_0x4e4d69['query'][_0x7236('0x3d')]){_0x539b84['where']=_[_0x7236('0x3e')](_0x539b84['where'],{'$or':_[_0x7236('0x2c')](_0x319abf,function(_0x3d8d36){if(_0x3d8d36[_0x7236('0x2f')]!=='VIRTUAL'){var _0x262b97={};_0x262b97[_0x3d8d36[_0x7236('0x29')]]={'$like':'%'+_0x4e4d69[_0x7236('0x33')][_0x7236('0x3d')]+'%'};return _0x262b97;}})});}_0x539b84=_[_0x7236('0x3e')]({},_0x539b84,_0x4e4d69['options']);var _0x1a9d98={'where':_0x539b84[_0x7236('0x3f')]};return db[_0x7236('0x40')]['count'](_0x1a9d98)[_0x7236('0x22')](function(_0x4a0cb3){_0x4b700d[_0x7236('0x1c')]=_0x4a0cb3;if(_0x4e4d69[_0x7236('0x33')][_0x7236('0x41')]){_0x539b84[_0x7236('0x42')]=[{'all':!![]}];}return db[_0x7236('0x40')][_0x7236('0x43')](_0x539b84);})[_0x7236('0x22')](function(_0x19489c){_0x4b700d['rows']=_0x19489c;return _0x4b700d;})[_0x7236('0x22')](respondWithFilteredResult(_0x1b43de,_0x539b84))[_0x7236('0x44')](handleError(_0x1b43de,null));};exports[_0x7236('0x45')]=function(_0x1f25cb,_0x54aa22){var _0x2e16de={'raw':!![],'where':{'id':_0x1f25cb[_0x7236('0x46')]['id']}},_0x4d8abf={};_0x4d8abf[_0x7236('0x31')]=_['keys'](db[_0x7236('0x40')]['rawAttributes']);_0x4d8abf[_0x7236('0x33')]=_[_0x7236('0x32')](_0x1f25cb['query']);_0x4d8abf['filters']=_[_0x7236('0x35')](_0x4d8abf[_0x7236('0x31')],_0x4d8abf[_0x7236('0x33')]);_0x2e16de['attributes']=_['intersection'](_0x4d8abf[_0x7236('0x31')],qs[_0x7236('0x37')](_0x1f25cb['query'][_0x7236('0x37')]));_0x2e16de['attributes']=_0x2e16de[_0x7236('0x36')]['length']?_0x2e16de[_0x7236('0x36')]:_0x4d8abf[_0x7236('0x31')];if(_0x1f25cb['query']['includeAll']){_0x2e16de[_0x7236('0x42')]=[{'all':!![]}];}_0x2e16de=_[_0x7236('0x3e')]({},_0x2e16de,_0x1f25cb[_0x7236('0x47')]);return db['AnalyticExtractedReport'][_0x7236('0x48')](_0x2e16de)['then'](handleEntityNotFound(_0x54aa22,null))[_0x7236('0x22')](respondWithResult(_0x54aa22,null))['catch'](handleError(_0x54aa22,null));};exports[_0x7236('0x49')]=function(_0x102ebe,_0x4ebb31){return db[_0x7236('0x40')][_0x7236('0x49')](_0x102ebe['body'],{})[_0x7236('0x22')](function(_0x2f0817){var _0x372d16=_0x102ebe[_0x7236('0x4a')][_0x7236('0x24')]({'plain':!![]});if(!_0x372d16)throw new Error(_0x7236('0x4b'));if(_0x372d16[_0x7236('0x4c')]===_0x7236('0x4a')){var _0x34fc99=_0x2f0817[_0x7236('0x24')]({'plain':!![]});var _0x470f81=_0x7236('0x25');return db[_0x7236('0x4d')]['find']({'where':{'name':_0x470f81,'userProfileId':_0x372d16[_0x7236('0x4e')]},'raw':!![]})[_0x7236('0x22')](function(_0x3940aa){if(_0x3940aa&&_0x3940aa[_0x7236('0x4f')]===0x0){return db['UserProfileResource'][_0x7236('0x49')]({'name':_0x34fc99[_0x7236('0x29')],'resourceId':_0x34fc99['id'],'type':_0x3940aa[_0x7236('0x29')],'sectionId':_0x3940aa['id']},{})[_0x7236('0x22')](function(){return _0x2f0817;});}else{return _0x2f0817;}})[_0x7236('0x44')](function(_0x4ceae2){logger[_0x7236('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ceae2);throw _0x4ceae2;});}return _0x2f0817;})[_0x7236('0x22')](respondWithResult(_0x4ebb31,0xc9))[_0x7236('0x44')](handleError(_0x4ebb31,null));};exports[_0x7236('0x21')]=function(_0x5a875a,_0x3f547e){if(_0x5a875a['body']['id']){delete _0x5a875a['body']['id'];}return db[_0x7236('0x40')]['find']({'where':{'id':_0x5a875a[_0x7236('0x46')]['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x3f547e,null))[_0x7236('0x22')](saveUpdates(_0x5a875a[_0x7236('0x50')],null))['then'](respondWithResult(_0x3f547e,null))[_0x7236('0x44')](handleError(_0x3f547e,null));};exports[_0x7236('0x23')]=function(_0x1be458,_0x4031d5){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x1be458['params']['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x4031d5,null))[_0x7236('0x22')](removeEntity(_0x4031d5,null))[_0x7236('0x44')](handleError(_0x4031d5,null));};exports['download']=function(_0x389089,_0x2ca120,_0x24ccf6){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x389089[_0x7236('0x46')]['id']},'attributes':['name',_0x7236('0x51'),_0x7236('0x52'),_0x7236('0x53')],'raw':!![]})[_0x7236('0x22')](handleEntityNotFound(_0x2ca120,null))[_0x7236('0x22')](function(_0x32684c){if(_0x32684c){if(!fs[_0x7236('0x54')](path[_0x7236('0x55')](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]))){throw new db[(_0x7236('0x58'))][(_0x7236('0x59'))](_0x7236('0x5a'));}if(_0x389089[_0x7236('0x33')][_0x7236('0x5b')]){return _0x2ca120[_0x7236('0x26')](0xc8);}return _0x2ca120[_0x7236('0x5c')](path['join'](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]),util[_0x7236('0x5d')]('%s.%s',_0x32684c['basename']||_0x32684c[_0x7236('0x29')],_0x32684c[_0x7236('0x53')][_0x7236('0x5e')]()));}})[_0x7236('0x44')](handleError(_0x2ca120,null));}; \ No newline at end of file +var _0x98ba=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x98ba,0x147));var _0xa98b=function(_0x3ce878,_0x5bff06){_0x3ce878=_0x3ce878-0x0;var _0x39e51f=_0x98ba[_0x3ce878];return _0x39e51f;};'use strict';var emlformat=require(_0xa98b('0x0'));var rimraf=require(_0xa98b('0x1'));var zipdir=require(_0xa98b('0x2'));var jsonpatch=require(_0xa98b('0x3'));var rp=require('request-promise');var moment=require(_0xa98b('0x4'));var BPromise=require(_0xa98b('0x5'));var Mustache=require(_0xa98b('0x6'));var util=require(_0xa98b('0x7'));var path=require('path');var sox=require(_0xa98b('0x8'));var csv=require('to-csv');var ejs=require(_0xa98b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa98b('0xa'));var squel=require(_0xa98b('0xb'));var crypto=require(_0xa98b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa98b('0xd'));var toCsv=require(_0xa98b('0xe'));var querystring=require(_0xa98b('0xf'));var Papa=require(_0xa98b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa98b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa98b('0x12'));var logger=require(_0xa98b('0x13'))(_0xa98b('0x14'));var utils=require(_0xa98b('0x15'));var config=require(_0xa98b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa98b('0x17'))['db'];function respondWithStatusCode(_0x4e1158,_0x22cf16){_0x22cf16=_0x22cf16||0xcc;return function(_0x45284e){if(_0x45284e){return _0x4e1158[_0xa98b('0x18')](_0x22cf16);}return _0x4e1158[_0xa98b('0x19')](_0x22cf16)[_0xa98b('0x1a')]();};}function respondWithResult(_0x2d0a5f,_0x3efbcc){_0x3efbcc=_0x3efbcc||0xc8;return function(_0x42922b){if(_0x42922b){return _0x2d0a5f[_0xa98b('0x19')](_0x3efbcc)[_0xa98b('0x1b')](_0x42922b);}};}function respondWithFilteredResult(_0x27153b,_0x12f5da){return function(_0x36b004){if(_0x36b004){var _0x52c2e2=typeof _0x12f5da[_0xa98b('0x1c')]===_0xa98b('0x1d')&&typeof _0x12f5da[_0xa98b('0x1e')]===_0xa98b('0x1d');var _0x498e64=_0x36b004[_0xa98b('0x1f')];var _0x292ade=_0x52c2e2?0x0:_0x12f5da[_0xa98b('0x1c')];var _0x181ab9=_0x52c2e2?_0x36b004[_0xa98b('0x1f')]:_0x12f5da[_0xa98b('0x1c')]+_0x12f5da['limit'];var _0x3f4880;if(_0x181ab9>=_0x498e64){_0x181ab9=_0x498e64;_0x3f4880=0xc8;}else{_0x3f4880=0xce;}_0x27153b['status'](_0x3f4880);return _0x27153b[_0xa98b('0x20')](_0xa98b('0x21'),_0x292ade+'-'+_0x181ab9+'/'+_0x498e64)[_0xa98b('0x1b')](_0x36b004);}return null;};}function patchUpdates(_0xb3e6ed){return function(_0x11abea){try{jsonpatch[_0xa98b('0x22')](_0x11abea,_0xb3e6ed,!![]);}catch(_0x4f3dc9){return BPromise[_0xa98b('0x23')](_0x4f3dc9);}return _0x11abea['save']();};}function saveUpdates(_0x233c6f,_0x3c712b){return function(_0x550ae0){if(_0x550ae0){return _0x550ae0['update'](_0x233c6f)['then'](function(_0x28a356){return _0x28a356;});}return null;};}function removeEntity(_0x5bc0d4,_0x5e0eff){return function(_0x54d478){if(_0x54d478){return _0x54d478[_0xa98b('0x24')]()[_0xa98b('0x25')](function(){var _0x102109=_0x54d478[_0xa98b('0x26')]({'plain':!![]});var _0x4f119f=_0xa98b('0x27');return db['UserProfileResource'][_0xa98b('0x24')]({'where':{'type':_0x4f119f,'resourceId':_0x102109['id']}})[_0xa98b('0x25')](function(){return _0x54d478;});})[_0xa98b('0x25')](function(){_0x5bc0d4[_0xa98b('0x19')](0xcc)[_0xa98b('0x1a')]();});}};}function handleEntityNotFound(_0x495c88,_0x4e4bf7){return function(_0x19c6cb){if(!_0x19c6cb){_0x495c88[_0xa98b('0x18')](0x194);}return _0x19c6cb;};}function handleError(_0x15daf9,_0x469e7a){_0x469e7a=_0x469e7a||0x1f4;return function(_0x2524ea){logger['error'](_0x2524ea[_0xa98b('0x28')]);if(_0x2524ea[_0xa98b('0x29')]){delete _0x2524ea[_0xa98b('0x29')];}_0x15daf9[_0xa98b('0x19')](_0x469e7a)[_0xa98b('0x2a')](_0x2524ea);};}exports[_0xa98b('0x2b')]=function(_0x58e809,_0x406a4c){var _0x227797={},_0x5a78db={},_0x1a7038={'count':0x0,'rows':[]};var _0x1bd565=_[_0xa98b('0x2c')](db[_0xa98b('0x2d')][_0xa98b('0x2e')],function(_0x4aa678){return{'name':_0x4aa678[_0xa98b('0x2f')],'type':_0x4aa678[_0xa98b('0x30')][_0xa98b('0x31')]};});_0x5a78db[_0xa98b('0x32')]=_['map'](_0x1bd565,_0xa98b('0x29'));_0x5a78db[_0xa98b('0x33')]=_[_0xa98b('0x34')](_0x58e809[_0xa98b('0x33')]);_0x5a78db[_0xa98b('0x35')]=_[_0xa98b('0x36')](_0x5a78db[_0xa98b('0x32')],_0x5a78db[_0xa98b('0x33')]);_0x227797[_0xa98b('0x37')]=_['intersection'](_0x5a78db['model'],qs[_0xa98b('0x38')](_0x58e809['query'][_0xa98b('0x38')]));_0x227797[_0xa98b('0x37')]=_0x227797[_0xa98b('0x37')][_0xa98b('0x39')]?_0x227797[_0xa98b('0x37')]:_0x5a78db[_0xa98b('0x32')];if(!_0x58e809[_0xa98b('0x33')][_0xa98b('0x3a')](_0xa98b('0x3b'))){_0x227797[_0xa98b('0x1e')]=qs['limit'](_0x58e809[_0xa98b('0x33')][_0xa98b('0x1e')]);_0x227797[_0xa98b('0x1c')]=qs[_0xa98b('0x1c')](_0x58e809[_0xa98b('0x33')][_0xa98b('0x1c')]);}_0x227797['order']=qs[_0xa98b('0x3c')](_0x58e809[_0xa98b('0x33')]['sort']);_0x227797[_0xa98b('0x3d')]=qs['filters'](_[_0xa98b('0x3e')](_0x58e809[_0xa98b('0x33')],_0x5a78db[_0xa98b('0x35')]),_0x1bd565);if(_0x58e809[_0xa98b('0x33')][_0xa98b('0x3f')]){_0x227797[_0xa98b('0x3d')]=_[_0xa98b('0x40')](_0x227797[_0xa98b('0x3d')],{'$or':_['map'](_0x1bd565,function(_0x3b23ff){if(_0x3b23ff['type']!==_0xa98b('0x41')){var _0x50bc61={};_0x50bc61[_0x3b23ff[_0xa98b('0x29')]]={'$like':'%'+_0x58e809[_0xa98b('0x33')][_0xa98b('0x3f')]+'%'};return _0x50bc61;}})});}_0x227797=_[_0xa98b('0x40')]({},_0x227797,_0x58e809['options']);var _0x132760={'where':_0x227797[_0xa98b('0x3d')]};return db[_0xa98b('0x2d')][_0xa98b('0x1f')](_0x132760)['then'](function(_0x502fc1){_0x1a7038[_0xa98b('0x1f')]=_0x502fc1;if(_0x58e809[_0xa98b('0x33')][_0xa98b('0x42')]){_0x227797[_0xa98b('0x43')]=[{'all':!![]}];}return db[_0xa98b('0x2d')][_0xa98b('0x44')](_0x227797);})[_0xa98b('0x25')](function(_0x2c9e20){_0x1a7038['rows']=_0x2c9e20;return _0x1a7038;})[_0xa98b('0x25')](respondWithFilteredResult(_0x406a4c,_0x227797))['catch'](handleError(_0x406a4c,null));};exports[_0xa98b('0x45')]=function(_0x3cf813,_0xea6b9d){var _0x3c748a={'raw':!![],'where':{'id':_0x3cf813[_0xa98b('0x46')]['id']}},_0x18ff73={};_0x18ff73[_0xa98b('0x32')]=_[_0xa98b('0x34')](db[_0xa98b('0x2d')][_0xa98b('0x2e')]);_0x18ff73[_0xa98b('0x33')]=_[_0xa98b('0x34')](_0x3cf813[_0xa98b('0x33')]);_0x18ff73[_0xa98b('0x35')]=_['intersection'](_0x18ff73[_0xa98b('0x32')],_0x18ff73[_0xa98b('0x33')]);_0x3c748a[_0xa98b('0x37')]=_[_0xa98b('0x36')](_0x18ff73[_0xa98b('0x32')],qs[_0xa98b('0x38')](_0x3cf813[_0xa98b('0x33')][_0xa98b('0x38')]));_0x3c748a[_0xa98b('0x37')]=_0x3c748a[_0xa98b('0x37')][_0xa98b('0x39')]?_0x3c748a[_0xa98b('0x37')]:_0x18ff73[_0xa98b('0x32')];if(_0x3cf813[_0xa98b('0x33')][_0xa98b('0x42')]){_0x3c748a[_0xa98b('0x43')]=[{'all':!![]}];}_0x3c748a=_[_0xa98b('0x40')]({},_0x3c748a,_0x3cf813[_0xa98b('0x47')]);return db[_0xa98b('0x2d')]['find'](_0x3c748a)[_0xa98b('0x25')](handleEntityNotFound(_0xea6b9d,null))[_0xa98b('0x25')](respondWithResult(_0xea6b9d,null))[_0xa98b('0x48')](handleError(_0xea6b9d,null));};exports[_0xa98b('0x49')]=function(_0x2e9a10,_0x473ce8){return db[_0xa98b('0x2d')][_0xa98b('0x49')](_0x2e9a10[_0xa98b('0x4a')],{})[_0xa98b('0x25')](function(_0x3fba50){var _0x341936=_0x2e9a10[_0xa98b('0x4b')]['get']({'plain':!![]});if(!_0x341936)throw new Error(_0xa98b('0x4c'));if(_0x341936[_0xa98b('0x4d')]===_0xa98b('0x4b')){var _0x86c04e=_0x3fba50[_0xa98b('0x26')]({'plain':!![]});var _0x4e3587=_0xa98b('0x27');return db[_0xa98b('0x4e')][_0xa98b('0x4f')]({'where':{'name':_0x4e3587,'userProfileId':_0x341936['userProfileId']},'raw':!![]})[_0xa98b('0x25')](function(_0x12f9b9){if(_0x12f9b9&&_0x12f9b9['autoAssociation']===0x0){return db[_0xa98b('0x50')]['create']({'name':_0x86c04e[_0xa98b('0x29')],'resourceId':_0x86c04e['id'],'type':_0x12f9b9[_0xa98b('0x29')],'sectionId':_0x12f9b9['id']},{})['then'](function(){return _0x3fba50;});}else{return _0x3fba50;}})[_0xa98b('0x48')](function(_0x418dd0){logger[_0xa98b('0x51')](_0xa98b('0x52'),_0x418dd0);throw _0x418dd0;});}return _0x3fba50;})[_0xa98b('0x25')](respondWithResult(_0x473ce8,0xc9))[_0xa98b('0x48')](handleError(_0x473ce8,null));};exports['update']=function(_0xaea4ae,_0x148603){if(_0xaea4ae[_0xa98b('0x4a')]['id']){delete _0xaea4ae['body']['id'];}return db[_0xa98b('0x2d')][_0xa98b('0x4f')]({'where':{'id':_0xaea4ae[_0xa98b('0x46')]['id']}})[_0xa98b('0x25')](handleEntityNotFound(_0x148603,null))[_0xa98b('0x25')](saveUpdates(_0xaea4ae[_0xa98b('0x4a')],null))[_0xa98b('0x25')](respondWithResult(_0x148603,null))[_0xa98b('0x48')](handleError(_0x148603,null));};exports[_0xa98b('0x24')]=function(_0x6408e3,_0x3d5344){return db['AnalyticExtractedReport'][_0xa98b('0x4f')]({'where':{'id':_0x6408e3[_0xa98b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d5344,null))[_0xa98b('0x25')](removeEntity(_0x3d5344,null))[_0xa98b('0x48')](handleError(_0x3d5344,null));};exports[_0xa98b('0x53')]=function(_0xa264e7,_0x24db6e,_0x32b25c){return db[_0xa98b('0x2d')]['find']({'where':{'id':_0xa264e7[_0xa98b('0x46')]['id']},'attributes':[_0xa98b('0x29'),_0xa98b('0x54'),_0xa98b('0x55'),_0xa98b('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x24db6e,null))[_0xa98b('0x25')](function(_0x52b386){if(_0x52b386){if(!fs[_0xa98b('0x57')](path[_0xa98b('0x58')](config[_0xa98b('0x59')],_0xa98b('0x5a'),_0x52b386[_0xa98b('0x55')]))){throw new db['Sequelize'][(_0xa98b('0x5b'))](_0xa98b('0x5c'));}if(_0xa264e7[_0xa98b('0x33')][_0xa98b('0x5d')]){return _0x24db6e[_0xa98b('0x18')](0xc8);}return _0x24db6e['download'](path[_0xa98b('0x58')](config['root'],_0xa98b('0x5a'),_0x52b386[_0xa98b('0x55')]),util['format']('%s.%s',_0x52b386[_0xa98b('0x54')]||_0x52b386[_0xa98b('0x29')],_0x52b386[_0xa98b('0x56')][_0xa98b('0x5e')]()));}})[_0xa98b('0x48')](handleError(_0x24db6e,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f41ea23..4c38967 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 _0x05b5=['path','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x05b5,0x114));var _0x505b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x05b5[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x505b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x505b('0x1'));var BPromise=require(_0x505b('0x2'));var rp=require(_0x505b('0x3'));var fs=require('fs');var path=require(_0x505b('0x4'));var rimraf=require(_0x505b('0x5'));var config=require(_0x505b('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x505b('0x7')]=function(_0xcd07df,_0x2a0a73){return _0xcd07df['define'](_0x505b('0x8'),attributes,{'tableName':_0x505b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5beb=['moment','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api'];(function(_0x86f228,_0x6e0345){var _0x3b0c39=function(_0xa7cb1d){while(--_0xa7cb1d){_0x86f228['push'](_0x86f228['shift']());}};_0x3b0c39(++_0x6e0345);}(_0x5beb,0x81));var _0xb5be=function(_0x3f22a9,_0x2908fb){_0x3f22a9=_0x3f22a9-0x0;var _0x48143c=_0x5beb[_0x3f22a9];return _0x48143c;};'use strict';var _=require(_0xb5be('0x0'));var util=require(_0xb5be('0x1'));var logger=require('../../config/logger')(_0xb5be('0x2'));var moment=require(_0xb5be('0x3'));var BPromise=require('bluebird');var rp=require(_0xb5be('0x4'));var fs=require('fs');var path=require(_0xb5be('0x5'));var rimraf=require('rimraf');var config=require(_0xb5be('0x6'));var attributes=require(_0xb5be('0x7'));module[_0xb5be('0x8')]=function(_0x141bcb,_0x47bc3d){return _0x141bcb[_0xb5be('0x9')](_0xb5be('0xa'),attributes,{'tableName':_0xb5be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 0891a13..62228a0 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 _0x5b12=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x5b12,0xa3));var _0x25b1=function(_0x1c8d0e,_0x38e48b){_0x1c8d0e=_0x1c8d0e-0x0;var _0x30f9b4=_0x5b12[_0x1c8d0e];return _0x30f9b4;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});} \ No newline at end of file +var _0x1c52=['code','message','info','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x5d5fcd,_0x165444){var _0x5ec451=function(_0x1fb0c5){while(--_0x1fb0c5){_0x5d5fcd['push'](_0x5d5fcd['shift']());}};_0x5ec451(++_0x165444);}(_0x1c52,0x7c));var _0x21c5=function(_0x50c1cf,_0x4d75e8){_0x50c1cf=_0x50c1cf-0x0;var _0x4c285c=_0x1c52[_0x50c1cf];return _0x4c285c;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x4'));var logger=require(_0x21c5('0x5'))('rpc');var config=require(_0x21c5('0x6'));var jayson=require(_0x21c5('0x7'));var client=jayson[_0x21c5('0x8')][_0x21c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b12d5,_0xed0195,_0xb4b1e4){return new BPromise(function(_0x4c5a4f,_0xd34da2){return client[_0x21c5('0xa')](_0x5b12d5,_0xb4b1e4)[_0x21c5('0xb')](function(_0x27389f){logger['info'](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));logger[_0x21c5('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xed0195,_0x21c5('0xd'),JSON['stringify'](_0x27389f));if(_0x27389f[_0x21c5('0xf')]){if(_0x27389f[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xed0195,_0x27389f[_0x21c5('0xf')]['message']);return _0xd34da2(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}logger['error'](_0x21c5('0xc'),_0xed0195,_0x27389f['error']['message']);return _0x4c5a4f(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}else{logger[_0x21c5('0x12')](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));_0x4c5a4f(_0x27389f[_0x21c5('0x13')][_0x21c5('0x11')]);}})['catch'](function(_0x331080){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xed0195,_0x331080);_0xd34da2(_0x331080);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 7d2088c..b1d301c 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 _0xb61b=['Router','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','exports','multer','util','express'];(function(_0x3a3f0c,_0x174f79){var _0x184722=function(_0x4fb5c3){while(--_0x4fb5c3){_0x3a3f0c['push'](_0x3a3f0c['shift']());}};_0x184722(++_0x174f79);}(_0xb61b,0xbd));var _0xbb61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb61b[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xbb61('0x0'));var util=require(_0xbb61('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb61('0x2'));var router=express[_0xbb61('0x3')]();var fs_extra=require(_0xbb61('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb61('0x5'));router[_0xbb61('0x6')]('/',auth[_0xbb61('0x7')](),controller[_0xbb61('0x8')]);router[_0xbb61('0x6')](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xa')]);router[_0xbb61('0x6')](_0xbb61('0xb'),auth['isAuthenticated'](),controller[_0xbb61('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb61('0xd')]);router['put'](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xe')]);router['delete']('/:id',auth[_0xbb61('0x7')](),controller['destroy']);module[_0xbb61('0xf')]=router; \ No newline at end of file +var _0x7311=['/:id','show','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7311,0xc6));var _0x1731=function(_0x2d4686,_0x3d6dbb){_0x2d4686=_0x2d4686-0x0;var _0x16f68b=_0x7311[_0x2d4686];return _0x16f68b;};'use strict';var multer=require(_0x1731('0x0'));var util=require(_0x1731('0x1'));var path=require(_0x1731('0x2'));var timeout=require(_0x1731('0x3'));var express=require(_0x1731('0x4'));var router=express[_0x1731('0x5')]();var fs_extra=require(_0x1731('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1731('0x7'));var controller=require(_0x1731('0x8'));router[_0x1731('0x9')]('/',auth[_0x1731('0xa')](),controller[_0x1731('0xb')]);router['get'](_0x1731('0xc'),auth['isAuthenticated'](),controller[_0x1731('0xd')]);router['get']('/:id/download',auth[_0x1731('0xa')](),controller[_0x1731('0xe')]);router[_0x1731('0xf')]('/',auth['isAuthenticated'](),controller[_0x1731('0x10')]);router[_0x1731('0x11')]('/:id',auth[_0x1731('0xa')](),controller[_0x1731('0x12')]);router[_0x1731('0x13')](_0x1731('0xc'),auth[_0x1731('0xa')](),controller[_0x1731('0x14')]);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 117a9d8..3604fab 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 _0x932a=['sequelize','exports','STRING','BOOLEAN'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x932a,0x64));var _0xa932=function(_0x247d01,_0x1851fb){_0x247d01=_0x247d01-0x0;var _0xf18e8=_0x932a[_0x247d01];return _0xf18e8;};'use strict';var Sequelize=require(_0xa932('0x0'));module[_0xa932('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa932('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa932('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa932('0x2')]},'custom':{'type':Sequelize[_0xa932('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdebb=['TEXT','STRING','BOOLEAN','exports'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xdebb,0x19f));var _0xbdeb=function(_0x51a5f0,_0x242359){_0x51a5f0=_0x51a5f0-0x0;var _0x5e4c22=_0xdebb[_0x51a5f0];return _0x5e4c22;};'use strict';var Sequelize=require('sequelize');module[_0xbdeb('0x0')]={'field':{'type':Sequelize[_0xbdeb('0x1')]},'alias':{'type':Sequelize[_0xbdeb('0x2')]},'function':{'type':Sequelize[_0xbdeb('0x2')]},'format':{'type':Sequelize[_0xbdeb('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbdeb('0x2')]},'custom':{'type':Sequelize[_0xbdeb('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 27db7ff..6c0bb7a 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 _0xb642=['fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','AnalyticFieldReport','rows','catch','params','keys','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','findAll','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb642,0x15d));var _0x2b64=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xb642[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b64('0x0'));var zipdir=require(_0x2b64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b64('0x2'));var moment=require(_0x2b64('0x3'));var BPromise=require(_0x2b64('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2b64('0x5'));var sox=require('sox');var csv=require(_0x2b64('0x6'));var ejs=require(_0x2b64('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b64('0x8'));var squel=require(_0x2b64('0x9'));var crypto=require(_0x2b64('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2b64('0xb'));var toCsv=require(_0x2b64('0x6'));var querystring=require(_0x2b64('0xc'));var Papa=require('papaparse');var Redis=require(_0x2b64('0xd'));var authService=require(_0x2b64('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b64('0xf'));var logger=require(_0x2b64('0x10'))(_0x2b64('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2b64('0x12'));var db=require(_0x2b64('0x13'))['db'];function respondWithStatusCode(_0x1c8a6d,_0x1f1bfd){_0x1f1bfd=_0x1f1bfd||0xcc;return function(_0x135a8b){if(_0x135a8b){return _0x1c8a6d[_0x2b64('0x14')](_0x1f1bfd);}return _0x1c8a6d[_0x2b64('0x15')](_0x1f1bfd)[_0x2b64('0x16')]();};}function respondWithResult(_0x4a6d40,_0x3cd9c3){_0x3cd9c3=_0x3cd9c3||0xc8;return function(_0x49e0cc){if(_0x49e0cc){return _0x4a6d40[_0x2b64('0x15')](_0x3cd9c3)['json'](_0x49e0cc);}};}function respondWithFilteredResult(_0x6897a9,_0x762c03){return function(_0x272ad6){if(_0x272ad6){var _0x3e1675=typeof _0x762c03[_0x2b64('0x17')]===_0x2b64('0x18')&&typeof _0x762c03[_0x2b64('0x19')]==='undefined';var _0x49f71e=_0x272ad6['count'];var _0x356a18=_0x3e1675?0x0:_0x762c03[_0x2b64('0x17')];var _0x26a6ef=_0x3e1675?_0x272ad6[_0x2b64('0x1a')]:_0x762c03[_0x2b64('0x17')]+_0x762c03['limit'];var _0x3c6c62;if(_0x26a6ef>=_0x49f71e){_0x26a6ef=_0x49f71e;_0x3c6c62=0xc8;}else{_0x3c6c62=0xce;}_0x6897a9['status'](_0x3c6c62);return _0x6897a9[_0x2b64('0x1b')](_0x2b64('0x1c'),_0x356a18+'-'+_0x26a6ef+'/'+_0x49f71e)[_0x2b64('0x1d')](_0x272ad6);}return null;};}function patchUpdates(_0x35e8d2){return function(_0xa3c626){try{jsonpatch['apply'](_0xa3c626,_0x35e8d2,!![]);}catch(_0x322c96){return BPromise[_0x2b64('0x1e')](_0x322c96);}return _0xa3c626['save']();};}function saveUpdates(_0x37ccfa,_0x5871bc){return function(_0x14416f){if(_0x14416f){return _0x14416f[_0x2b64('0x1f')](_0x37ccfa)[_0x2b64('0x20')](function(_0xb664ce){return _0xb664ce;});}return null;};}function removeEntity(_0x4210e2,_0x39c08b){return function(_0x4be1f1){if(_0x4be1f1){return _0x4be1f1[_0x2b64('0x21')]()[_0x2b64('0x20')](function(){_0x4210e2[_0x2b64('0x15')](0xcc)[_0x2b64('0x16')]();});}};}function handleEntityNotFound(_0x30a93e,_0x4f4ec9){return function(_0xd94601){if(!_0xd94601){_0x30a93e[_0x2b64('0x14')](0x194);}return _0xd94601;};}function handleError(_0x149e97,_0xc2f3ed){_0xc2f3ed=_0xc2f3ed||0x1f4;return function(_0x2b5c19){logger[_0x2b64('0x22')](_0x2b5c19[_0x2b64('0x23')]);if(_0x2b5c19[_0x2b64('0x24')]){delete _0x2b5c19[_0x2b64('0x24')];}_0x149e97[_0x2b64('0x15')](_0xc2f3ed)[_0x2b64('0x25')](_0x2b5c19);};}exports[_0x2b64('0x26')]=function(_0x4a5188,_0x224763){var _0x3cf5fc={},_0x1ab1d2={},_0x463a0d={'count':0x0,'rows':[]};var _0x55fd7a=_[_0x2b64('0x27')](db['AnalyticFieldReport'][_0x2b64('0x28')],function(_0x234312){return{'name':_0x234312[_0x2b64('0x29')],'type':_0x234312[_0x2b64('0x2a')][_0x2b64('0x2b')]};});_0x1ab1d2['model']=_[_0x2b64('0x27')](_0x55fd7a,_0x2b64('0x24'));_0x1ab1d2[_0x2b64('0x2c')]=_['keys'](_0x4a5188['query']);_0x1ab1d2[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x1ab1d2[_0x2b64('0x2f')],_0x1ab1d2[_0x2b64('0x2c')]);_0x3cf5fc[_0x2b64('0x30')]=_['intersection'](_0x1ab1d2['model'],qs[_0x2b64('0x31')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x3cf5fc[_0x2b64('0x30')]=_0x3cf5fc[_0x2b64('0x30')][_0x2b64('0x32')]?_0x3cf5fc[_0x2b64('0x30')]:_0x1ab1d2[_0x2b64('0x2f')];if(!_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x33')](_0x2b64('0x34'))){_0x3cf5fc['limit']=qs[_0x2b64('0x19')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x19')]);_0x3cf5fc['offset']=qs['offset'](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x17')]);}_0x3cf5fc['order']=qs[_0x2b64('0x35')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x35')]);_0x3cf5fc[_0x2b64('0x36')]=qs[_0x2b64('0x2d')](_[_0x2b64('0x37')](_0x4a5188['query'],_0x1ab1d2[_0x2b64('0x2d')]),_0x55fd7a);if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]){_0x3cf5fc['where']=_[_0x2b64('0x39')](_0x3cf5fc['where'],{'$or':_[_0x2b64('0x27')](_0x55fd7a,function(_0x15e999){if(_0x15e999[_0x2b64('0x2a')]!==_0x2b64('0x3a')){var _0x4f21d0={};_0x4f21d0[_0x15e999[_0x2b64('0x24')]]={'$like':'%'+_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]+'%'};return _0x4f21d0;}})});}_0x3cf5fc=_[_0x2b64('0x39')]({},_0x3cf5fc,_0x4a5188['options']);var _0x17603e={'where':_0x3cf5fc[_0x2b64('0x36')]};return db['AnalyticFieldReport']['count'](_0x17603e)['then'](function(_0x5aa7fb){_0x463a0d[_0x2b64('0x1a')]=_0x5aa7fb;if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x3cf5fc[_0x2b64('0x3c')]=[{'all':!![]}];}return db[_0x2b64('0x3d')]['findAll'](_0x3cf5fc);})['then'](function(_0x340e1a){_0x463a0d[_0x2b64('0x3e')]=_0x340e1a;return _0x463a0d;})[_0x2b64('0x20')](respondWithFilteredResult(_0x224763,_0x3cf5fc))[_0x2b64('0x3f')](handleError(_0x224763,null));};exports['show']=function(_0x1da8bc,_0x5db4af){var _0x42bd9d={'raw':![],'where':{'id':_0x1da8bc[_0x2b64('0x40')]['id']}},_0x3dd6d0={};_0x3dd6d0['model']=_[_0x2b64('0x41')](db[_0x2b64('0x3d')][_0x2b64('0x28')]);_0x3dd6d0[_0x2b64('0x2c')]=_[_0x2b64('0x41')](_0x1da8bc['query']);_0x3dd6d0[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x3dd6d0[_0x2b64('0x2f')],_0x3dd6d0[_0x2b64('0x2c')]);_0x42bd9d[_0x2b64('0x30')]=_[_0x2b64('0x2e')](_0x3dd6d0['model'],qs[_0x2b64('0x31')](_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x42bd9d[_0x2b64('0x30')]=_0x42bd9d[_0x2b64('0x30')][_0x2b64('0x32')]?_0x42bd9d[_0x2b64('0x30')]:_0x3dd6d0[_0x2b64('0x2f')];if(_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x42bd9d[_0x2b64('0x3c')]=[{'all':!![]}];}_0x42bd9d=_[_0x2b64('0x39')]({},_0x42bd9d,_0x1da8bc[_0x2b64('0x42')]);return db['AnalyticFieldReport'][_0x2b64('0x43')](_0x42bd9d)['then'](handleEntityNotFound(_0x5db4af,null))[_0x2b64('0x20')](respondWithResult(_0x5db4af,null))[_0x2b64('0x3f')](handleError(_0x5db4af,null));};exports['create']=function(_0xf652e5,_0x192fe4){return db[_0x2b64('0x3d')][_0x2b64('0x44')](_0xf652e5[_0x2b64('0x45')],{})['then'](respondWithResult(_0x192fe4,0xc9))[_0x2b64('0x3f')](handleError(_0x192fe4,null));};exports[_0x2b64('0x46')]=function(_0x49fda3,_0x45960b){return db['AnalyticFieldReport']['bulkCreate'](_0x49fda3[_0x2b64('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x45960b,0xc9))[_0x2b64('0x3f')](handleError(_0x45960b,null));};exports[_0x2b64('0x1f')]=function(_0x537c60,_0x5a35f5){if(_0x537c60['body']['id']){delete _0x537c60[_0x2b64('0x45')]['id'];}return db[_0x2b64('0x3d')][_0x2b64('0x43')]({'where':{'id':_0x537c60['params']['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x5a35f5,null))[_0x2b64('0x20')](saveUpdates(_0x537c60[_0x2b64('0x45')],null))['then'](respondWithResult(_0x5a35f5,null))[_0x2b64('0x3f')](handleError(_0x5a35f5,null));};exports['destroy']=function(_0xcdfcd2,_0x58a529){return db[_0x2b64('0x3d')]['find']({'where':{'id':_0xcdfcd2[_0x2b64('0x40')]['id']}})['then'](handleEntityNotFound(_0x58a529,null))[_0x2b64('0x20')](removeEntity(_0x58a529,null))[_0x2b64('0x3f')](handleError(_0x58a529,null));};exports[_0x2b64('0x47')]=function(_0x285694,_0x10d0c7){return db[_0x2b64('0x3d')][_0x2b64('0x21')]({'where':{'id':_0x285694[_0x2b64('0x2c')][_0x2b64('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x2b64('0x20')](respondWithResult(_0x10d0c7,0xcc))['catch'](handleError(_0x10d0c7,null));};exports[_0x2b64('0x49')]=function(_0x224eea,_0x48c224,_0x40cb1e){return db['AnalyticCustomReport'][_0x2b64('0x4a')]({'where':{'id':_0x224eea[_0x2b64('0x40')]['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x48c224,null))[_0x2b64('0x20')](function(_0x75f2dd){if(_0x75f2dd){return db[_0x2b64('0x4b')][_0x2b64('0x4c')](function(_0x50300b){return db['AnalyticFieldReport'][_0x2b64('0x21')]({'where':{'CustomReportId':_0x224eea[_0x2b64('0x40')]['id']},'transaction':_0x50300b})['then'](function(_0x2b7ced){var _0x1348d7=_[_0x2b64('0x27')](_0x224eea[_0x2b64('0x45')],function(_0x3a0656){delete _0x3a0656['id'];_0x3a0656['CustomReportId']=_0x224eea['params']['id'];return _0x3a0656;});return db[_0x2b64('0x3d')]['bulkCreate'](_0x1348d7,{'transaction':_0x50300b});});})['then'](function(){return db[_0x2b64('0x3d')][_0x2b64('0x4d')]({'where':{'CustomReportId':_0x224eea['params']['id']}});});}})['then'](respondWithResult(_0x48c224,null))[_0x2b64('0x3f')](handleError(_0x48c224,null));}; \ No newline at end of file +var _0xb107=['filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','find','catch','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','status','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x595e6a,_0x470428){var _0x1ab357=function(_0x13be26){while(--_0x13be26){_0x595e6a['push'](_0x595e6a['shift']());}};_0x1ab357(++_0x470428);}(_0xb107,0x157));var _0x7b10=function(_0x43ae08,_0x17c9a7){_0x43ae08=_0x43ae08-0x0;var _0x368c3e=_0xb107[_0x43ae08];return _0x368c3e;};'use strict';var emlformat=require(_0x7b10('0x0'));var rimraf=require(_0x7b10('0x1'));var zipdir=require(_0x7b10('0x2'));var jsonpatch=require(_0x7b10('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b10('0x4'));var Mustache=require(_0x7b10('0x5'));var util=require(_0x7b10('0x6'));var path=require(_0x7b10('0x7'));var sox=require(_0x7b10('0x8'));var csv=require(_0x7b10('0x9'));var ejs=require(_0x7b10('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b10('0xb'));var squel=require(_0x7b10('0xc'));var crypto=require(_0x7b10('0xd'));var jsforce=require(_0x7b10('0xe'));var deskjs=require(_0x7b10('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7b10('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b10('0x11'));var logger=require(_0x7b10('0x12'))(_0x7b10('0x13'));var utils=require(_0x7b10('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357792,_0x148f0c){_0x148f0c=_0x148f0c||0xcc;return function(_0x495171){if(_0x495171){return _0x357792['sendStatus'](_0x148f0c);}return _0x357792['status'](_0x148f0c)[_0x7b10('0x15')]();};}function respondWithResult(_0x26b85b,_0xa47908){_0xa47908=_0xa47908||0xc8;return function(_0x16e739){if(_0x16e739){return _0x26b85b['status'](_0xa47908)['json'](_0x16e739);}};}function respondWithFilteredResult(_0x2ad258,_0xe65ddc){return function(_0x315ef3){if(_0x315ef3){var _0x429520=typeof _0xe65ddc[_0x7b10('0x16')]===_0x7b10('0x17')&&typeof _0xe65ddc[_0x7b10('0x18')]==='undefined';var _0x2fdc4a=_0x315ef3[_0x7b10('0x19')];var _0x13286a=_0x429520?0x0:_0xe65ddc['offset'];var _0x10dad7=_0x429520?_0x315ef3[_0x7b10('0x19')]:_0xe65ddc[_0x7b10('0x16')]+_0xe65ddc['limit'];var _0x74bc51;if(_0x10dad7>=_0x2fdc4a){_0x10dad7=_0x2fdc4a;_0x74bc51=0xc8;}else{_0x74bc51=0xce;}_0x2ad258['status'](_0x74bc51);return _0x2ad258[_0x7b10('0x1a')](_0x7b10('0x1b'),_0x13286a+'-'+_0x10dad7+'/'+_0x2fdc4a)[_0x7b10('0x1c')](_0x315ef3);}return null;};}function patchUpdates(_0x2fa0c1){return function(_0x8fde2b){try{jsonpatch['apply'](_0x8fde2b,_0x2fa0c1,!![]);}catch(_0x599610){return BPromise[_0x7b10('0x1d')](_0x599610);}return _0x8fde2b['save']();};}function saveUpdates(_0x30314d,_0x5af895){return function(_0x5254c0){if(_0x5254c0){return _0x5254c0[_0x7b10('0x1e')](_0x30314d)[_0x7b10('0x1f')](function(_0x1d01c1){return _0x1d01c1;});}return null;};}function removeEntity(_0x4201ab,_0x39ba60){return function(_0x5ca8fe){if(_0x5ca8fe){return _0x5ca8fe[_0x7b10('0x20')]()['then'](function(){_0x4201ab[_0x7b10('0x21')](0xcc)[_0x7b10('0x15')]();});}};}function handleEntityNotFound(_0x42b2c9,_0x58b147){return function(_0x5c3745){if(!_0x5c3745){_0x42b2c9[_0x7b10('0x22')](0x194);}return _0x5c3745;};}function handleError(_0x106b69,_0x12304a){_0x12304a=_0x12304a||0x1f4;return function(_0x1b585b){logger[_0x7b10('0x23')](_0x1b585b[_0x7b10('0x24')]);if(_0x1b585b[_0x7b10('0x25')]){delete _0x1b585b['name'];}_0x106b69['status'](_0x12304a)[_0x7b10('0x26')](_0x1b585b);};}exports[_0x7b10('0x27')]=function(_0x348a09,_0x15b653){var _0x3756b={},_0x41508d={},_0x29875f={'count':0x0,'rows':[]};var _0x4c7c60=_[_0x7b10('0x28')](db[_0x7b10('0x29')]['rawAttributes'],function(_0xbd9eb4){return{'name':_0xbd9eb4[_0x7b10('0x2a')],'type':_0xbd9eb4[_0x7b10('0x2b')][_0x7b10('0x2c')]};});_0x41508d['model']=_[_0x7b10('0x28')](_0x4c7c60,_0x7b10('0x25'));_0x41508d[_0x7b10('0x2d')]=_[_0x7b10('0x2e')](_0x348a09[_0x7b10('0x2d')]);_0x41508d[_0x7b10('0x2f')]=_[_0x7b10('0x30')](_0x41508d[_0x7b10('0x31')],_0x41508d[_0x7b10('0x2d')]);_0x3756b['attributes']=_[_0x7b10('0x30')](_0x41508d[_0x7b10('0x31')],qs[_0x7b10('0x32')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x32')]));_0x3756b['attributes']=_0x3756b['attributes']['length']?_0x3756b[_0x7b10('0x33')]:_0x41508d['model'];if(!_0x348a09[_0x7b10('0x2d')][_0x7b10('0x34')](_0x7b10('0x35'))){_0x3756b[_0x7b10('0x18')]=qs[_0x7b10('0x18')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x18')]);_0x3756b[_0x7b10('0x16')]=qs[_0x7b10('0x16')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x16')]);}_0x3756b[_0x7b10('0x36')]=qs['sort'](_0x348a09['query'][_0x7b10('0x37')]);_0x3756b[_0x7b10('0x38')]=qs[_0x7b10('0x2f')](_['pick'](_0x348a09[_0x7b10('0x2d')],_0x41508d[_0x7b10('0x2f')]),_0x4c7c60);if(_0x348a09['query'][_0x7b10('0x39')]){_0x3756b['where']=_[_0x7b10('0x3a')](_0x3756b[_0x7b10('0x38')],{'$or':_['map'](_0x4c7c60,function(_0x416d1e){if(_0x416d1e[_0x7b10('0x2b')]!==_0x7b10('0x3b')){var _0x316ab4={};_0x316ab4[_0x416d1e[_0x7b10('0x25')]]={'$like':'%'+_0x348a09['query'][_0x7b10('0x39')]+'%'};return _0x316ab4;}})});}_0x3756b=_[_0x7b10('0x3a')]({},_0x3756b,_0x348a09[_0x7b10('0x3c')]);var _0x5218ad={'where':_0x3756b[_0x7b10('0x38')]};return db[_0x7b10('0x29')][_0x7b10('0x19')](_0x5218ad)[_0x7b10('0x1f')](function(_0xa200e7){_0x29875f[_0x7b10('0x19')]=_0xa200e7;if(_0x348a09[_0x7b10('0x2d')][_0x7b10('0x3d')]){_0x3756b[_0x7b10('0x3e')]=[{'all':!![]}];}return db[_0x7b10('0x29')]['findAll'](_0x3756b);})[_0x7b10('0x1f')](function(_0x152e8c){_0x29875f[_0x7b10('0x3f')]=_0x152e8c;return _0x29875f;})[_0x7b10('0x1f')](respondWithFilteredResult(_0x15b653,_0x3756b))['catch'](handleError(_0x15b653,null));};exports[_0x7b10('0x40')]=function(_0x2f1219,_0x1f6998){var _0x1e6253={'raw':![],'where':{'id':_0x2f1219[_0x7b10('0x41')]['id']}},_0x155a25={};_0x155a25[_0x7b10('0x31')]=_[_0x7b10('0x2e')](db['AnalyticFieldReport'][_0x7b10('0x42')]);_0x155a25['query']=_[_0x7b10('0x2e')](_0x2f1219['query']);_0x155a25[_0x7b10('0x2f')]=_[_0x7b10('0x30')](_0x155a25[_0x7b10('0x31')],_0x155a25[_0x7b10('0x2d')]);_0x1e6253[_0x7b10('0x33')]=_['intersection'](_0x155a25['model'],qs['fields'](_0x2f1219['query'][_0x7b10('0x32')]));_0x1e6253[_0x7b10('0x33')]=_0x1e6253[_0x7b10('0x33')][_0x7b10('0x43')]?_0x1e6253['attributes']:_0x155a25[_0x7b10('0x31')];if(_0x2f1219[_0x7b10('0x2d')][_0x7b10('0x3d')]){_0x1e6253[_0x7b10('0x3e')]=[{'all':!![]}];}_0x1e6253=_[_0x7b10('0x3a')]({},_0x1e6253,_0x2f1219[_0x7b10('0x3c')]);return db[_0x7b10('0x29')][_0x7b10('0x44')](_0x1e6253)[_0x7b10('0x1f')](handleEntityNotFound(_0x1f6998,null))[_0x7b10('0x1f')](respondWithResult(_0x1f6998,null))[_0x7b10('0x45')](handleError(_0x1f6998,null));};exports[_0x7b10('0x46')]=function(_0x59eb92,_0x248b38){return db[_0x7b10('0x29')][_0x7b10('0x46')](_0x59eb92[_0x7b10('0x47')],{})[_0x7b10('0x1f')](respondWithResult(_0x248b38,0xc9))[_0x7b10('0x45')](handleError(_0x248b38,null));};exports[_0x7b10('0x48')]=function(_0x403760,_0x44af1c){return db[_0x7b10('0x29')][_0x7b10('0x48')](_0x403760[_0x7b10('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x44af1c,0xc9))['catch'](handleError(_0x44af1c,null));};exports[_0x7b10('0x1e')]=function(_0x3284a1,_0x502df7){if(_0x3284a1[_0x7b10('0x47')]['id']){delete _0x3284a1[_0x7b10('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7b10('0x44')]({'where':{'id':_0x3284a1[_0x7b10('0x41')]['id']}})[_0x7b10('0x1f')](handleEntityNotFound(_0x502df7,null))[_0x7b10('0x1f')](saveUpdates(_0x3284a1[_0x7b10('0x47')],null))['then'](respondWithResult(_0x502df7,null))[_0x7b10('0x45')](handleError(_0x502df7,null));};exports[_0x7b10('0x20')]=function(_0x5c0742,_0xf7b42a){return db[_0x7b10('0x29')][_0x7b10('0x44')]({'where':{'id':_0x5c0742[_0x7b10('0x41')]['id']}})[_0x7b10('0x1f')](handleEntityNotFound(_0xf7b42a,null))['then'](removeEntity(_0xf7b42a,null))[_0x7b10('0x45')](handleError(_0xf7b42a,null));};exports['bulkDestroy']=function(_0x39f9de,_0x1eda68){return db['AnalyticFieldReport'][_0x7b10('0x20')]({'where':{'id':_0x39f9de[_0x7b10('0x2d')][_0x7b10('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x7b10('0x1f')](respondWithResult(_0x1eda68,0xcc))[_0x7b10('0x45')](handleError(_0x1eda68,null));};exports[_0x7b10('0x4a')]=function(_0xc68cfc,_0x3ec1f9,_0x24f101){return db[_0x7b10('0x4b')][_0x7b10('0x4c')]({'where':{'id':_0xc68cfc[_0x7b10('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ec1f9,null))[_0x7b10('0x1f')](function(_0x3c0bc5){if(_0x3c0bc5){return db[_0x7b10('0x4d')][_0x7b10('0x4e')](function(_0xbc74fe){return db[_0x7b10('0x29')]['destroy']({'where':{'CustomReportId':_0xc68cfc[_0x7b10('0x41')]['id']},'transaction':_0xbc74fe})[_0x7b10('0x1f')](function(_0x17d2eb){var _0x3c194c=_[_0x7b10('0x28')](_0xc68cfc[_0x7b10('0x47')],function(_0x5b023d){delete _0x5b023d['id'];_0x5b023d[_0x7b10('0x4f')]=_0xc68cfc[_0x7b10('0x41')]['id'];return _0x5b023d;});return db[_0x7b10('0x29')][_0x7b10('0x48')](_0x3c194c,{'transaction':_0xbc74fe});});})[_0x7b10('0x1f')](function(){return db[_0x7b10('0x29')]['findAll']({'where':{'CustomReportId':_0xc68cfc['params']['id']}});});}})[_0x7b10('0x1f')](respondWithResult(_0x3ec1f9,null))['catch'](handleError(_0x3ec1f9,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9f7494b..631cd8b 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 _0xea85=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58b095,_0x13df00){var _0x3cb122=function(_0x20124e){while(--_0x20124e){_0x58b095['push'](_0x58b095['shift']());}};_0x3cb122(++_0x13df00);}(_0xea85,0xec));var _0x5ea8=function(_0xeae901,_0x33afa0){_0xeae901=_0xeae901-0x0;var _0x491531=_0xea85[_0xeae901];return _0x491531;};'use strict';var _=require('lodash');var util=require(_0x5ea8('0x0'));var logger=require('../../config/logger')(_0x5ea8('0x1'));var moment=require('moment');var BPromise=require(_0x5ea8('0x2'));var rp=require(_0x5ea8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ea8('0x4'));var config=require(_0x5ea8('0x5'));var attributes=require(_0x5ea8('0x6'));module[_0x5ea8('0x7')]=function(_0x171603,_0x5aa784){return _0x171603[_0x5ea8('0x8')](_0x5ea8('0x9'),attributes,{'tableName':_0x5ea8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87cc=['api','moment','bluebird','request-promise','../../config/environment','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0xc2a130,_0x900599){var _0x247f87=function(_0x3c78c3){while(--_0x3c78c3){_0xc2a130['push'](_0xc2a130['shift']());}};_0x247f87(++_0x900599);}(_0x87cc,0x19c));var _0xc87c=function(_0x49f9e8,_0x54ee65){_0x49f9e8=_0x49f9e8-0x0;var _0xdd03e4=_0x87cc[_0x49f9e8];return _0xdd03e4;};'use strict';var _=require('lodash');var util=require(_0xc87c('0x0'));var logger=require(_0xc87c('0x1'))(_0xc87c('0x2'));var moment=require(_0xc87c('0x3'));var BPromise=require(_0xc87c('0x4'));var rp=require(_0xc87c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc87c('0x6'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x41cbfc,_0x553ace){return _0x41cbfc['define'](_0xc87c('0x7'),attributes,{'tableName':_0xc87c('0x8'),'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 7d79d3d..6a97e37 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 _0xffa8=['AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xffa8,0x170));var _0x8ffa=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xffa8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x8ffa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ffa('0x1'));var fs=require('fs');var Redis=require(_0x8ffa('0x2'));var db=require(_0x8ffa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ffa('0x4'))(_0x8ffa('0x5'));var config=require(_0x8ffa('0x6'));var jayson=require(_0x8ffa('0x7'));var client=jayson[_0x8ffa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5e72,_0x362fe0,_0x131e40){return new BPromise(function(_0x3fd5d2,_0x536a63){return client[_0x8ffa('0x9')](_0x1e5e72,_0x131e40)[_0x8ffa('0xa')](function(_0x364ac6){logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,'request\x20sent');logger[_0x8ffa('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x362fe0,_0x8ffa('0xe'),JSON[_0x8ffa('0xf')](_0x364ac6));if(_0x364ac6['error']){if(_0x364ac6['error'][_0x8ffa('0x10')]===0x1f4){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);return _0x536a63(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}logger[_0x8ffa('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x362fe0,_0x364ac6['error'][_0x8ffa('0x12')]);return _0x3fd5d2(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}else{logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,_0x8ffa('0xe'));_0x3fd5d2(_0x364ac6['result'][_0x8ffa('0x12')]);}})[_0x8ffa('0x13')](function(_0x39f164){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x39f164);_0x536a63(_0x39f164);});});} \ No newline at end of file +var _0x6449=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x32ac3d,_0x12aef3){var _0x4065b8=function(_0x2dcca7){while(--_0x2dcca7){_0x32ac3d['push'](_0x32ac3d['shift']());}};_0x4065b8(++_0x12aef3);}(_0x6449,0x1a4));var _0x9644=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x6449[_0x31ced5];return _0x10d9e5;};'use strict';var _=require('lodash');var util=require(_0x9644('0x0'));var moment=require(_0x9644('0x1'));var BPromise=require(_0x9644('0x2'));var rs=require(_0x9644('0x3'));var fs=require('fs');var Redis=require(_0x9644('0x4'));var db=require(_0x9644('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9644('0x6'))(_0x9644('0x7'));var config=require(_0x9644('0x8'));var jayson=require(_0x9644('0x9'));var client=jayson['client'][_0x9644('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4662b1,_0x3aab6a,_0x4445bc){return new BPromise(function(_0x1067c5,_0x3eae31){return client[_0x9644('0xb')](_0x4662b1,_0x4445bc)[_0x9644('0xc')](function(_0x9b8175){logger[_0x9644('0xd')](_0x9644('0xe'),_0x3aab6a,_0x9644('0xf'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3aab6a,_0x9644('0xf'),JSON['stringify'](_0x9b8175));if(_0x9b8175[_0x9644('0x10')]){if(_0x9b8175[_0x9644('0x10')][_0x9644('0x11')]===0x1f4){logger[_0x9644('0x10')](_0x9644('0xe'),_0x3aab6a,_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);return _0x3eae31(_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);}logger[_0x9644('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3aab6a,_0x9b8175['error'][_0x9644('0x12')]);return _0x1067c5(_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);}else{logger[_0x9644('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3aab6a,_0x9644('0xf'));_0x1067c5(_0x9b8175[_0x9644('0x13')][_0x9644('0x12')]);}})[_0x9644('0x14')](function(_0x2d54e3){logger[_0x9644('0x10')](_0x9644('0xe'),_0x3aab6a,_0x2d54e3);_0x3eae31(_0x2d54e3);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 32066f7..45c786d 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(_0xc153db,_0x516c10){var _0x4dc97d=function(_0x10fc05){while(--_0x10fc05){_0xc153db['push'](_0xc153db['shift']());}};_0x4dc97d(++_0x516c10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x54919b,_0x23ff76){var _0x49a8a5=function(_0x37ee89){while(--_0x37ee89){_0x54919b['push'](_0x54919b['shift']());}};_0x49a8a5(++_0x23ff76);}(_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('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 9725838..b3bd9bb 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 _0x7c59=['exports','STRING','name'];(function(_0x54214c,_0x278464){var _0x4b9671=function(_0x17b6d8){while(--_0x17b6d8){_0x54214c['push'](_0x54214c['shift']());}};_0x4b9671(++_0x278464);}(_0x7c59,0x147));var _0x97c5=function(_0x21b613,_0x18972f){_0x21b613=_0x21b613-0x0;var _0x266727=_0x7c59[_0x21b613];return _0x266727;};'use strict';var Sequelize=require('sequelize');module[_0x97c5('0x0')]={'name':{'type':Sequelize[_0x97c5('0x1')],'allowNull':![],'unique':_0x97c5('0x2')},'table':{'type':Sequelize[_0x97c5('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x97c5('0x1')]}}; \ No newline at end of file +var _0xc686=['STRING'];(function(_0x346b2b,_0x3c7be1){var _0xe31b68=function(_0xd2f439){while(--_0xd2f439){_0x346b2b['push'](_0x346b2b['shift']());}};_0xe31b68(++_0x3c7be1);}(_0xc686,0x148));var _0x6c68=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc686[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6c68('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x6c68('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x6c68('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 6f2650e..25b9895 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x6dd3c1,_0x53cf52){var _0xdef05a=function(_0x26a262){while(--_0x26a262){_0x6dd3c1['push'](_0x6dd3c1['shift']());}};_0xdef05a(++_0x53cf52);}(_0x008c,0x188));var _0xc008=function(_0xf5b712,_0x5487bf){_0xf5b712=_0xf5b712-0x0;var _0x410413=_0x008c[_0xf5b712];return _0x410413;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x84ab,0x12f));var _0xb84a=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x84ab[_0x37ffea];return _0x2e2615;};'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(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index dd0154e..5020ef9 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 _0xbd3c=['bluebird','request-promise','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x37e343,_0x5dbfea){var _0xf688dc=function(_0x3b4766){while(--_0x3b4766){_0x37e343['push'](_0x37e343['shift']());}};_0xf688dc(++_0x5dbfea);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x230be7,_0x26d232){_0x230be7=_0x230be7-0x0;var _0x10983b=_0xbd3c[_0x230be7];return _0x10983b;};'use strict';var _=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var logger=require(_0xcbd3('0x2'))('api');var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var rp=require(_0xcbd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbd3('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xcbd3('0x7')]=function(_0x3e5103,_0x5b27a3){return _0x3e5103[_0xcbd3('0x8')](_0xcbd3('0x9'),attributes,{'tableName':_0xcbd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5c8=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x307462,_0x58a62f){var _0x7bced2=function(_0x5aacee){while(--_0x5aacee){_0x307462['push'](_0x307462['shift']());}};_0x7bced2(++_0x58a62f);}(_0xc5c8,0x118));var _0x8c5c=function(_0x5c8aee,_0x374f36){_0x5c8aee=_0x5c8aee-0x0;var _0x292920=_0xc5c8[_0x5c8aee];return _0x292920;};'use strict';var _=require(_0x8c5c('0x0'));var util=require(_0x8c5c('0x1'));var logger=require(_0x8c5c('0x2'))('api');var moment=require(_0x8c5c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c5c('0x4'));var rimraf=require(_0x8c5c('0x5'));var config=require('../../config/environment');var attributes=require(_0x8c5c('0x6'));module[_0x8c5c('0x7')]=function(_0x390b86,_0x2e297d){return _0x390b86[_0x8c5c('0x8')](_0x8c5c('0x9'),attributes,{'tableName':_0x8c5c('0xa'),'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 35f8a78..d01fdf6 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 _0x184f=['http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17770a,_0xe0364f){var _0x525494=function(_0x51f212){while(--_0x51f212){_0x17770a['push'](_0x17770a['shift']());}};_0x525494(++_0xe0364f);}(_0x184f,0x17c));var _0xf184=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x184f[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0xf184('0x0'));var util=require(_0xf184('0x1'));var moment=require(_0xf184('0x2'));var BPromise=require(_0xf184('0x3'));var rs=require(_0xf184('0x4'));var fs=require('fs');var Redis=require(_0xf184('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf184('0x6'));var logger=require(_0xf184('0x7'))(_0xf184('0x8'));var config=require(_0xf184('0x9'));var jayson=require(_0xf184('0xa'));var client=jayson['client'][_0xf184('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x260323,_0x3e2615,_0x2f7242){return new BPromise(function(_0x3e8071,_0x3f34a7){return client['request'](_0x260323,_0x2f7242)[_0xf184('0xc')](function(_0x3ea5c4){logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));logger[_0xf184('0x10')](_0xf184('0x11'),_0x3e2615,_0xf184('0xf'),JSON[_0xf184('0x12')](_0x3ea5c4));if(_0x3ea5c4[_0xf184('0x13')]){if(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x14')]===0x1f4){logger['error'](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')]['message']);return _0x3f34a7(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);}logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);return _0x3e8071(_0x3ea5c4['error'][_0xf184('0x15')]);}else{logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));_0x3e8071(_0x3ea5c4['result'][_0xf184('0x15')]);}})[_0xf184('0x16')](function(_0x4a018b){logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x4a018b);_0x3f34a7(_0x4a018b);});});} \ No newline at end of file +var _0x06bb=['debug','error','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x58401b,_0x1fe81c){var _0x5d7f3f=function(_0x1f8cd8){while(--_0x1f8cd8){_0x58401b['push'](_0x58401b['shift']());}};_0x5d7f3f(++_0x1fe81c);}(_0x06bb,0x17e));var _0xb06b=function(_0x4467f2,_0x512525){_0x4467f2=_0x4467f2-0x0;var _0x1fcc7d=_0x06bb[_0x4467f2];return _0x1fcc7d;};'use strict';var _=require(_0xb06b('0x0'));var util=require('util');var moment=require(_0xb06b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb06b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb06b('0x3'))['db'];var utils=require(_0xb06b('0x4'));var logger=require(_0xb06b('0x5'))(_0xb06b('0x6'));var config=require(_0xb06b('0x7'));var jayson=require(_0xb06b('0x8'));var client=jayson[_0xb06b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27578e,_0x104306,_0xcbf83d){return new BPromise(function(_0x527159,_0x36cb7c){return client[_0xb06b('0xa')](_0x27578e,_0xcbf83d)['then'](function(_0x382c44){logger[_0xb06b('0xb')](_0xb06b('0xc'),_0x104306,_0xb06b('0xd'));logger[_0xb06b('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x104306,'request\x20sent',JSON['stringify'](_0x382c44));if(_0x382c44[_0xb06b('0xf')]){if(_0x382c44[_0xb06b('0xf')]['code']===0x1f4){logger[_0xb06b('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0x382c44['error'][_0xb06b('0x10')]);return _0x36cb7c(_0x382c44[_0xb06b('0xf')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0x382c44[_0xb06b('0xf')][_0xb06b('0x10')]);return _0x527159(_0x382c44[_0xb06b('0xf')][_0xb06b('0x10')]);}else{logger[_0xb06b('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0xb06b('0xd'));_0x527159(_0x382c44['result'][_0xb06b('0x10')]);}})[_0xb06b('0x11')](function(_0x22e9a8){logger['error'](_0xb06b('0xc'),_0x104306,_0x22e9a8);_0x36cb7c(_0x22e9a8);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a8472af..27728f6 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 _0x24ce=['delete','destroy','util','path','connect-timeout','express','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x24ce,0x1de));var _0xe24c=function(_0xd8d721,_0x85473b){_0xd8d721=_0xd8d721-0x0;var _0x2ed4dd=_0x24ce[_0xd8d721];return _0x2ed4dd;};'use strict';var multer=require('multer');var util=require(_0xe24c('0x0'));var path=require(_0xe24c('0x1'));var timeout=require(_0xe24c('0x2'));var express=require(_0xe24c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe24c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe24c('0x5'));router[_0xe24c('0x6')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0x8')]);router[_0xe24c('0x6')]('/:id',auth[_0xe24c('0x7')](),controller[_0xe24c('0x9')]);router[_0xe24c('0xa')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0xb')]);router[_0xe24c('0xc')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0xe')]);router[_0xe24c('0xf')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd206=['isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x26c1ea,_0x1c2f33){var _0x394cee=function(_0x22b216){while(--_0x22b216){_0x26c1ea['push'](_0x26c1ea['shift']());}};_0x394cee(++_0x1c2f33);}(_0xd206,0x107));var _0x6d20=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xd206[_0x616290];return _0x453879;};'use strict';var multer=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var path=require('path');var timeout=require(_0x6d20('0x2'));var express=require(_0x6d20('0x3'));var router=express[_0x6d20('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d20('0x5'));var interaction=require(_0x6d20('0x6'));var config=require(_0x6d20('0x7'));var controller=require(_0x6d20('0x8'));router['get']('/',auth[_0x6d20('0x9')](),controller['index']);router['get'](_0x6d20('0xa'),auth[_0x6d20('0x9')](),controller['show']);router[_0x6d20('0xb')]('/',auth['isAuthenticated'](),controller[_0x6d20('0xc')]);router[_0x6d20('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6d20('0xe')](_0x6d20('0xa'),auth['isAuthenticated'](),controller[_0x6d20('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 928a2fe..6ec9d95 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 _0xf906=['exports','TEXT','sequelize'];(function(_0x42e8a3,_0x341058){var _0x59524d=function(_0x132ea5){while(--_0x132ea5){_0x42e8a3['push'](_0x42e8a3['shift']());}};_0x59524d(++_0x341058);}(_0xf906,0x176));var _0x6f90=function(_0x2a7d28,_0x5cc069){_0x2a7d28=_0x2a7d28-0x0;var _0xbdd0db=_0xf906[_0x2a7d28];return _0xbdd0db;};'use strict';var Sequelize=require(_0x6f90('0x0'));module[_0x6f90('0x1')]={'tree':{'type':Sequelize[_0x6f90('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8ead=['exports','TEXT','sequelize'];(function(_0x23d313,_0x4a9058){var _0x30aaa0=function(_0x4f3735){while(--_0x4f3735){_0x23d313['push'](_0x23d313['shift']());}};_0x30aaa0(++_0x4a9058);}(_0x8ead,0x1c4));var _0xd8ea=function(_0x4ef375,_0x2be61a){_0x4ef375=_0x4ef375-0x0;var _0x4bd11a=_0x8ead[_0x4ef375];return _0x4bd11a;};'use strict';var Sequelize=require(_0xd8ea('0x0'));module[_0xd8ea('0x1')]={'tree':{'type':Sequelize[_0xd8ea('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 16f1766..b1e73cf 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 _0xf4bf=['destroy','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','zip-dir','fast-json-patch','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0x309a3b,_0x4cb4dd){var _0x3152ac=function(_0x2c69bc){while(--_0x2c69bc){_0x309a3b['push'](_0x309a3b['shift']());}};_0x3152ac(++_0x4cb4dd);}(_0xf4bf,0xb0));var _0xff4b=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xf4bf[_0x1e081a];return _0x428209;};'use strict';var emlformat=require(_0xff4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff4b('0x1'));var jsonpatch=require(_0xff4b('0x2'));var rp=require('request-promise');var moment=require(_0xff4b('0x3'));var BPromise=require(_0xff4b('0x4'));var Mustache=require(_0xff4b('0x5'));var util=require(_0xff4b('0x6'));var path=require(_0xff4b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff4b('0x8'));var fs=require('fs');var fs_extra=require(_0xff4b('0x9'));var _=require(_0xff4b('0xa'));var squel=require(_0xff4b('0xb'));var crypto=require(_0xff4b('0xc'));var jsforce=require(_0xff4b('0xd'));var deskjs=require(_0xff4b('0xe'));var toCsv=require(_0xff4b('0xf'));var querystring=require(_0xff4b('0x10'));var Papa=require(_0xff4b('0x11'));var Redis=require(_0xff4b('0x12'));var authService=require(_0xff4b('0x13'));var qs=require(_0xff4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff4b('0x15'));var logger=require(_0xff4b('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff4b('0x17'))['db'];function respondWithStatusCode(_0x507d3c,_0x146270){_0x146270=_0x146270||0xcc;return function(_0x1b50bb){if(_0x1b50bb){return _0x507d3c[_0xff4b('0x18')](_0x146270);}return _0x507d3c[_0xff4b('0x19')](_0x146270)['end']();};}function respondWithResult(_0x2f2b22,_0x405869){_0x405869=_0x405869||0xc8;return function(_0x4f2104){if(_0x4f2104){return _0x2f2b22[_0xff4b('0x19')](_0x405869)[_0xff4b('0x1a')](_0x4f2104);}};}function respondWithFilteredResult(_0xa19e02,_0x5e0e86){return function(_0x20fd03){if(_0x20fd03){var _0x595bf4=typeof _0x5e0e86[_0xff4b('0x1b')]===_0xff4b('0x1c')&&typeof _0x5e0e86[_0xff4b('0x1d')]==='undefined';var _0x4ccba3=_0x20fd03[_0xff4b('0x1e')];var _0x5d363b=_0x595bf4?0x0:_0x5e0e86[_0xff4b('0x1b')];var _0x16f61c=_0x595bf4?_0x20fd03[_0xff4b('0x1e')]:_0x5e0e86[_0xff4b('0x1b')]+_0x5e0e86[_0xff4b('0x1d')];var _0x5e6f44;if(_0x16f61c>=_0x4ccba3){_0x16f61c=_0x4ccba3;_0x5e6f44=0xc8;}else{_0x5e6f44=0xce;}_0xa19e02['status'](_0x5e6f44);return _0xa19e02[_0xff4b('0x1f')](_0xff4b('0x20'),_0x5d363b+'-'+_0x16f61c+'/'+_0x4ccba3)[_0xff4b('0x1a')](_0x20fd03);}return null;};}function patchUpdates(_0x5ea71d){return function(_0x70849b){try{jsonpatch['apply'](_0x70849b,_0x5ea71d,!![]);}catch(_0x308bf6){return BPromise[_0xff4b('0x21')](_0x308bf6);}return _0x70849b[_0xff4b('0x22')]();};}function saveUpdates(_0x1383a1,_0x3e64ab){return function(_0x4d4172){if(_0x4d4172){return _0x4d4172[_0xff4b('0x23')](_0x1383a1)[_0xff4b('0x24')](function(_0x5709d7){return _0x5709d7;});}return null;};}function removeEntity(_0x1c1ba3,_0xe910b0){return function(_0xe790ca){if(_0xe790ca){return _0xe790ca[_0xff4b('0x25')]()['then'](function(){_0x1c1ba3[_0xff4b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167461,_0x5872d6){return function(_0x28d88a){if(!_0x28d88a){_0x167461['sendStatus'](0x194);}return _0x28d88a;};}function handleError(_0x5715ee,_0x4cf60b){_0x4cf60b=_0x4cf60b||0x1f4;return function(_0x4e6759){logger['error'](_0x4e6759['stack']);if(_0x4e6759[_0xff4b('0x26')]){delete _0x4e6759[_0xff4b('0x26')];}_0x5715ee['status'](_0x4cf60b)['send'](_0x4e6759);};}exports[_0xff4b('0x27')]=function(_0x11324a,_0x1ab691){var _0x215259={},_0x46f331={},_0xf76797={'count':0x0,'rows':[]};var _0x3ea00f=_[_0xff4b('0x28')](db['AnalyticTreeReport'][_0xff4b('0x29')],function(_0x4633d0){return{'name':_0x4633d0['fieldName'],'type':_0x4633d0[_0xff4b('0x2a')][_0xff4b('0x2b')]};});_0x46f331[_0xff4b('0x2c')]=_[_0xff4b('0x28')](_0x3ea00f,_0xff4b('0x26'));_0x46f331['query']=_[_0xff4b('0x2d')](_0x11324a[_0xff4b('0x2e')]);_0x46f331[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x46f331[_0xff4b('0x2c')],_0x46f331['query']);_0x215259[_0xff4b('0x31')]=_['intersection'](_0x46f331[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x11324a[_0xff4b('0x2e')]['fields']));_0x215259['attributes']=_0x215259[_0xff4b('0x31')][_0xff4b('0x33')]?_0x215259[_0xff4b('0x31')]:_0x46f331['model'];if(!_0x11324a[_0xff4b('0x2e')][_0xff4b('0x34')]('nolimit')){_0x215259[_0xff4b('0x1d')]=qs[_0xff4b('0x1d')](_0x11324a['query'][_0xff4b('0x1d')]);_0x215259[_0xff4b('0x1b')]=qs['offset'](_0x11324a[_0xff4b('0x2e')][_0xff4b('0x1b')]);}_0x215259[_0xff4b('0x35')]=qs[_0xff4b('0x36')](_0x11324a['query']['sort']);_0x215259['where']=qs[_0xff4b('0x2f')](_[_0xff4b('0x37')](_0x11324a['query'],_0x46f331[_0xff4b('0x2f')]),_0x3ea00f);if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x38')]){_0x215259[_0xff4b('0x39')]=_['merge'](_0x215259[_0xff4b('0x39')],{'$or':_[_0xff4b('0x28')](_0x3ea00f,function(_0x48bf4c){if(_0x48bf4c['type']!=='VIRTUAL'){var _0x4edb1c={};_0x4edb1c[_0x48bf4c[_0xff4b('0x26')]]={'$like':'%'+_0x11324a['query'][_0xff4b('0x38')]+'%'};return _0x4edb1c;}})});}_0x215259=_[_0xff4b('0x3a')]({},_0x215259,_0x11324a[_0xff4b('0x3b')]);var _0x2815b7={'where':_0x215259['where']};return db[_0xff4b('0x3c')][_0xff4b('0x1e')](_0x2815b7)[_0xff4b('0x24')](function(_0x31a962){_0xf76797['count']=_0x31a962;if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x215259['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xff4b('0x3e')](_0x215259);})[_0xff4b('0x24')](function(_0x477432){_0xf76797[_0xff4b('0x3f')]=_0x477432;return _0xf76797;})[_0xff4b('0x24')](respondWithFilteredResult(_0x1ab691,_0x215259))[_0xff4b('0x40')](handleError(_0x1ab691,null));};exports[_0xff4b('0x41')]=function(_0x18829e,_0x2d46b7){var _0x21a216={'raw':!![],'where':{'id':_0x18829e[_0xff4b('0x42')]['id']}},_0x5c0794={};_0x5c0794[_0xff4b('0x2c')]=_[_0xff4b('0x2d')](db[_0xff4b('0x3c')][_0xff4b('0x29')]);_0x5c0794['query']=_[_0xff4b('0x2d')](_0x18829e[_0xff4b('0x2e')]);_0x5c0794[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x5c0794[_0xff4b('0x2c')],_0x5c0794[_0xff4b('0x2e')]);_0x21a216['attributes']=_['intersection'](_0x5c0794[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x18829e['query'][_0xff4b('0x32')]));_0x21a216[_0xff4b('0x31')]=_0x21a216[_0xff4b('0x31')][_0xff4b('0x33')]?_0x21a216[_0xff4b('0x31')]:_0x5c0794[_0xff4b('0x2c')];if(_0x18829e[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x21a216[_0xff4b('0x43')]=[{'all':!![]}];}_0x21a216=_['merge']({},_0x21a216,_0x18829e['options']);return db[_0xff4b('0x3c')]['find'](_0x21a216)[_0xff4b('0x24')](handleEntityNotFound(_0x2d46b7,null))[_0xff4b('0x24')](respondWithResult(_0x2d46b7,null))[_0xff4b('0x40')](handleError(_0x2d46b7,null));};exports[_0xff4b('0x44')]=function(_0x4bab3f,_0x1e7866){return db[_0xff4b('0x3c')][_0xff4b('0x44')](_0x4bab3f[_0xff4b('0x45')],{})[_0xff4b('0x24')](respondWithResult(_0x1e7866,0xc9))[_0xff4b('0x40')](handleError(_0x1e7866,null));};exports[_0xff4b('0x23')]=function(_0x2974f5,_0x569412){if(_0x2974f5[_0xff4b('0x45')]['id']){delete _0x2974f5[_0xff4b('0x45')]['id'];}return db[_0xff4b('0x3c')][_0xff4b('0x46')]({'where':{'id':_0x2974f5[_0xff4b('0x42')]['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x569412,null))[_0xff4b('0x24')](saveUpdates(_0x2974f5[_0xff4b('0x45')],null))[_0xff4b('0x24')](respondWithResult(_0x569412,null))['catch'](handleError(_0x569412,null));};exports[_0xff4b('0x25')]=function(_0x33110,_0x4fd8c7){return db['AnalyticTreeReport']['find']({'where':{'id':_0x33110['params']['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x4fd8c7,null))['then'](removeEntity(_0x4fd8c7,null))[_0xff4b('0x40')](handleError(_0x4fd8c7,null));}; \ No newline at end of file +var _0x79b6=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','stack','name','index','map','AnalyticTreeReport','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x197122,_0x350384){var _0x405a4a=function(_0xcf36eb){while(--_0xcf36eb){_0x197122['push'](_0x197122['shift']());}};_0x405a4a(++_0x350384);}(_0x79b6,0x84));var _0x679b=function(_0x327c0e,_0xcd6344){_0x327c0e=_0x327c0e-0x0;var _0x3a38b6=_0x79b6[_0x327c0e];return _0x3a38b6;};'use strict';var emlformat=require(_0x679b('0x0'));var rimraf=require(_0x679b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x679b('0x2'));var moment=require(_0x679b('0x3'));var BPromise=require(_0x679b('0x4'));var Mustache=require('mustache');var util=require(_0x679b('0x5'));var path=require(_0x679b('0x6'));var sox=require(_0x679b('0x7'));var csv=require(_0x679b('0x8'));var ejs=require(_0x679b('0x9'));var fs=require('fs');var fs_extra=require(_0x679b('0xa'));var _=require(_0x679b('0xb'));var squel=require('squel');var crypto=require(_0x679b('0xc'));var jsforce=require(_0x679b('0xd'));var deskjs=require(_0x679b('0xe'));var toCsv=require(_0x679b('0x8'));var querystring=require(_0x679b('0xf'));var Papa=require(_0x679b('0x10'));var Redis=require('ioredis');var authService=require(_0x679b('0x11'));var qs=require(_0x679b('0x12'));var as=require(_0x679b('0x13'));var hardwareService=require(_0x679b('0x14'));var logger=require('../../config/logger')(_0x679b('0x15'));var utils=require('../../config/utils');var config=require(_0x679b('0x16'));var licenseUtil=require(_0x679b('0x17'));var db=require(_0x679b('0x18'))['db'];function respondWithStatusCode(_0xd605b0,_0x8b5fc8){_0x8b5fc8=_0x8b5fc8||0xcc;return function(_0x1a34ef){if(_0x1a34ef){return _0xd605b0[_0x679b('0x19')](_0x8b5fc8);}return _0xd605b0['status'](_0x8b5fc8)['end']();};}function respondWithResult(_0x58a662,_0x183b7b){_0x183b7b=_0x183b7b||0xc8;return function(_0xb67091){if(_0xb67091){return _0x58a662[_0x679b('0x1a')](_0x183b7b)[_0x679b('0x1b')](_0xb67091);}};}function respondWithFilteredResult(_0x1bf1eb,_0x4b04ef){return function(_0x2a4ab6){if(_0x2a4ab6){var _0x2296bd=typeof _0x4b04ef[_0x679b('0x1c')]==='undefined'&&typeof _0x4b04ef['limit']===_0x679b('0x1d');var _0x59ff82=_0x2a4ab6[_0x679b('0x1e')];var _0x2c6c23=_0x2296bd?0x0:_0x4b04ef['offset'];var _0x1b6b1e=_0x2296bd?_0x2a4ab6[_0x679b('0x1e')]:_0x4b04ef[_0x679b('0x1c')]+_0x4b04ef[_0x679b('0x1f')];var _0x3a2071;if(_0x1b6b1e>=_0x59ff82){_0x1b6b1e=_0x59ff82;_0x3a2071=0xc8;}else{_0x3a2071=0xce;}_0x1bf1eb[_0x679b('0x1a')](_0x3a2071);return _0x1bf1eb[_0x679b('0x20')]('Content-Range',_0x2c6c23+'-'+_0x1b6b1e+'/'+_0x59ff82)[_0x679b('0x1b')](_0x2a4ab6);}return null;};}function patchUpdates(_0x622957){return function(_0x231e01){try{jsonpatch[_0x679b('0x21')](_0x231e01,_0x622957,!![]);}catch(_0x5f1603){return BPromise['reject'](_0x5f1603);}return _0x231e01[_0x679b('0x22')]();};}function saveUpdates(_0x2644e3,_0x513613){return function(_0x408ca8){if(_0x408ca8){return _0x408ca8[_0x679b('0x23')](_0x2644e3)[_0x679b('0x24')](function(_0x591e36){return _0x591e36;});}return null;};}function removeEntity(_0x195942,_0x588496){return function(_0x2c2c6f){if(_0x2c2c6f){return _0x2c2c6f[_0x679b('0x25')]()[_0x679b('0x24')](function(){_0x195942['status'](0xcc)[_0x679b('0x26')]();});}};}function handleEntityNotFound(_0x1cc5fd,_0x35bbc7){return function(_0x25538b){if(!_0x25538b){_0x1cc5fd[_0x679b('0x19')](0x194);}return _0x25538b;};}function handleError(_0x3f36c5,_0x59e586){_0x59e586=_0x59e586||0x1f4;return function(_0xdd548f){logger['error'](_0xdd548f[_0x679b('0x27')]);if(_0xdd548f[_0x679b('0x28')]){delete _0xdd548f[_0x679b('0x28')];}_0x3f36c5['status'](_0x59e586)['send'](_0xdd548f);};}exports[_0x679b('0x29')]=function(_0x37a86c,_0xe9f57){var _0x430a11={},_0x262099={},_0x24c8e2={'count':0x0,'rows':[]};var _0x294063=_[_0x679b('0x2a')](db[_0x679b('0x2b')]['rawAttributes'],function(_0x6a8a4a){return{'name':_0x6a8a4a[_0x679b('0x2c')],'type':_0x6a8a4a[_0x679b('0x2d')]['key']};});_0x262099['model']=_['map'](_0x294063,_0x679b('0x28'));_0x262099[_0x679b('0x2e')]=_[_0x679b('0x2f')](_0x37a86c[_0x679b('0x2e')]);_0x262099[_0x679b('0x30')]=_[_0x679b('0x31')](_0x262099[_0x679b('0x32')],_0x262099[_0x679b('0x2e')]);_0x430a11[_0x679b('0x33')]=_[_0x679b('0x31')](_0x262099['model'],qs[_0x679b('0x34')](_0x37a86c[_0x679b('0x2e')][_0x679b('0x34')]));_0x430a11[_0x679b('0x33')]=_0x430a11[_0x679b('0x33')]['length']?_0x430a11[_0x679b('0x33')]:_0x262099[_0x679b('0x32')];if(!_0x37a86c[_0x679b('0x2e')][_0x679b('0x35')](_0x679b('0x36'))){_0x430a11[_0x679b('0x1f')]=qs['limit'](_0x37a86c[_0x679b('0x2e')][_0x679b('0x1f')]);_0x430a11[_0x679b('0x1c')]=qs[_0x679b('0x1c')](_0x37a86c['query'][_0x679b('0x1c')]);}_0x430a11[_0x679b('0x37')]=qs[_0x679b('0x38')](_0x37a86c[_0x679b('0x2e')][_0x679b('0x38')]);_0x430a11['where']=qs[_0x679b('0x30')](_[_0x679b('0x39')](_0x37a86c['query'],_0x262099[_0x679b('0x30')]),_0x294063);if(_0x37a86c[_0x679b('0x2e')][_0x679b('0x3a')]){_0x430a11['where']=_[_0x679b('0x3b')](_0x430a11[_0x679b('0x3c')],{'$or':_[_0x679b('0x2a')](_0x294063,function(_0x39f42b){if(_0x39f42b[_0x679b('0x2d')]!=='VIRTUAL'){var _0x55404d={};_0x55404d[_0x39f42b[_0x679b('0x28')]]={'$like':'%'+_0x37a86c['query'][_0x679b('0x3a')]+'%'};return _0x55404d;}})});}_0x430a11=_[_0x679b('0x3b')]({},_0x430a11,_0x37a86c[_0x679b('0x3d')]);var _0x2da713={'where':_0x430a11[_0x679b('0x3c')]};return db[_0x679b('0x2b')][_0x679b('0x1e')](_0x2da713)[_0x679b('0x24')](function(_0x7706ef){_0x24c8e2[_0x679b('0x1e')]=_0x7706ef;if(_0x37a86c[_0x679b('0x2e')][_0x679b('0x3e')]){_0x430a11[_0x679b('0x3f')]=[{'all':!![]}];}return db[_0x679b('0x2b')][_0x679b('0x40')](_0x430a11);})[_0x679b('0x24')](function(_0x4d1504){_0x24c8e2[_0x679b('0x41')]=_0x4d1504;return _0x24c8e2;})[_0x679b('0x24')](respondWithFilteredResult(_0xe9f57,_0x430a11))[_0x679b('0x42')](handleError(_0xe9f57,null));};exports[_0x679b('0x43')]=function(_0x534108,_0x2061dd){var _0xa33260={'raw':!![],'where':{'id':_0x534108['params']['id']}},_0x468939={};_0x468939['model']=_[_0x679b('0x2f')](db[_0x679b('0x2b')]['rawAttributes']);_0x468939['query']=_['keys'](_0x534108['query']);_0x468939[_0x679b('0x30')]=_[_0x679b('0x31')](_0x468939[_0x679b('0x32')],_0x468939[_0x679b('0x2e')]);_0xa33260['attributes']=_[_0x679b('0x31')](_0x468939[_0x679b('0x32')],qs[_0x679b('0x34')](_0x534108[_0x679b('0x2e')][_0x679b('0x34')]));_0xa33260[_0x679b('0x33')]=_0xa33260[_0x679b('0x33')]['length']?_0xa33260[_0x679b('0x33')]:_0x468939[_0x679b('0x32')];if(_0x534108[_0x679b('0x2e')]['includeAll']){_0xa33260[_0x679b('0x3f')]=[{'all':!![]}];}_0xa33260=_['merge']({},_0xa33260,_0x534108['options']);return db['AnalyticTreeReport']['find'](_0xa33260)[_0x679b('0x24')](handleEntityNotFound(_0x2061dd,null))[_0x679b('0x24')](respondWithResult(_0x2061dd,null))[_0x679b('0x42')](handleError(_0x2061dd,null));};exports[_0x679b('0x44')]=function(_0x7e0ac3,_0x20b8e4){return db[_0x679b('0x2b')]['create'](_0x7e0ac3[_0x679b('0x45')],{})['then'](respondWithResult(_0x20b8e4,0xc9))[_0x679b('0x42')](handleError(_0x20b8e4,null));};exports['update']=function(_0x2a69d1,_0x3c8ac4){if(_0x2a69d1['body']['id']){delete _0x2a69d1[_0x679b('0x45')]['id'];}return db[_0x679b('0x2b')][_0x679b('0x46')]({'where':{'id':_0x2a69d1[_0x679b('0x47')]['id']}})[_0x679b('0x24')](handleEntityNotFound(_0x3c8ac4,null))[_0x679b('0x24')](saveUpdates(_0x2a69d1[_0x679b('0x45')],null))['then'](respondWithResult(_0x3c8ac4,null))[_0x679b('0x42')](handleError(_0x3c8ac4,null));};exports[_0x679b('0x25')]=function(_0x15597c,_0x39d4bb){return db['AnalyticTreeReport'][_0x679b('0x46')]({'where':{'id':_0x15597c[_0x679b('0x47')]['id']}})[_0x679b('0x24')](handleEntityNotFound(_0x39d4bb,null))[_0x679b('0x24')](removeEntity(_0x39d4bb,null))[_0x679b('0x42')](handleError(_0x39d4bb,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 22de259..83431c4 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 _0x33fe=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticTreeReport','lodash'];(function(_0x220256,_0x1fee31){var _0x3e8b32=function(_0x4d765f){while(--_0x4d765f){_0x220256['push'](_0x220256['shift']());}};_0x3e8b32(++_0x1fee31);}(_0x33fe,0x1cd));var _0xe33f=function(_0x1bf69b,_0x3e889c){_0x1bf69b=_0x1bf69b-0x0;var _0x252aa8=_0x33fe[_0x1bf69b];return _0x252aa8;};'use strict';var _=require(_0xe33f('0x0'));var util=require(_0xe33f('0x1'));var logger=require(_0xe33f('0x2'))('api');var moment=require(_0xe33f('0x3'));var BPromise=require(_0xe33f('0x4'));var rp=require(_0xe33f('0x5'));var fs=require('fs');var path=require(_0xe33f('0x6'));var rimraf=require(_0xe33f('0x7'));var config=require(_0xe33f('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x466059,_0x164ae0){return _0x466059[_0xe33f('0x9')](_0xe33f('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52f0=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0x52f0,0xa1));var _0x052f=function(_0x1765c4,_0x151565){_0x1765c4=_0x1765c4-0x0;var _0x56645f=_0x52f0[_0x1765c4];return _0x56645f;};'use strict';var _=require(_0x052f('0x0'));var util=require(_0x052f('0x1'));var logger=require(_0x052f('0x2'))('api');var moment=require(_0x052f('0x3'));var BPromise=require(_0x052f('0x4'));var rp=require(_0x052f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x052f('0x6'));var config=require(_0x052f('0x7'));var attributes=require(_0x052f('0x8'));module[_0x052f('0x9')]=function(_0x3010e8,_0x172e9b){return _0x3010e8[_0x052f('0xa')](_0x052f('0xb'),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 8a99995..bad7b32 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 _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(_0xbc0cdb,_0x277170){var _0x25e621=function(_0x5d66a6){while(--_0x5d66a6){_0xbc0cdb['push'](_0xbc0cdb['shift']());}};_0x25e621(++_0x277170);}(_0xdb28,0x106));var _0x8db2=function(_0x4fed3d,_0x1a5c6e){_0x4fed3d=_0x4fed3d-0x0;var _0x5bb04e=_0xdb28[_0x4fed3d];return _0x5bb04e;};'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 +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(_0x191323,_0x395e8c){var _0xa3d43f=function(_0x408d9f){while(--_0x408d9f){_0x191323['push'](_0x191323['shift']());}};_0xa3d43f(++_0x395e8c);}(_0xdb28,0x106));var _0x8db2=function(_0xe14ea0,_0xfb030e){_0xe14ea0=_0xe14ea0-0x0;var _0x365aa2=_0xdb28[_0xe14ea0];return _0x365aa2;};'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 c55a1b6..182e949 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 _0x4534=['get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4534,0xc6));var _0x4453=function(_0x2cc0a0,_0x4e9c49){_0x2cc0a0=_0x2cc0a0-0x0;var _0x24e0fe=_0x4534[_0x2cc0a0];return _0x24e0fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4453('0x0'));var timeout=require(_0x4453('0x1'));var express=require('express');var router=express[_0x4453('0x2')]();var fs_extra=require(_0x4453('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4453('0x4'));var config=require('../../config/environment');var controller=require(_0x4453('0x5'));router[_0x4453('0x6')]('/',auth['isAuthenticated'](),controller[_0x4453('0x7')]);router[_0x4453('0x6')]('/:id',auth[_0x4453('0x8')](),controller[_0x4453('0x9')]);router[_0x4453('0xa')]('/',auth['isAuthenticated'](),controller[_0x4453('0xb')]);router[_0x4453('0xc')](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xe')]);router['delete'](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xf')]);module[_0x4453('0x10')]=router; \ No newline at end of file +var _0x8913=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','../../config/environment'];(function(_0x3f80a6,_0x3960a8){var _0x20ffcb=function(_0x331363){while(--_0x331363){_0x3f80a6['push'](_0x3f80a6['shift']());}};_0x20ffcb(++_0x3960a8);}(_0x8913,0xab));var _0x3891=function(_0x1280b8,_0x403c4f){_0x1280b8=_0x1280b8-0x0;var _0x54b802=_0x8913[_0x1280b8];return _0x54b802;};'use strict';var multer=require(_0x3891('0x0'));var util=require('util');var path=require(_0x3891('0x1'));var timeout=require(_0x3891('0x2'));var express=require(_0x3891('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3891('0x4'));var controller=require(_0x3891('0x5'));router[_0x3891('0x6')]('/',auth[_0x3891('0x7')](),controller[_0x3891('0x8')]);router['get'](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xa')]);router[_0x3891('0xb')]('/',auth[_0x3891('0x7')](),controller['create']);router[_0x3891('0xc')](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xd')]);router[_0x3891('0xe')](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('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 9451f7d..73f6fce 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 _0x9649=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9649,0x19f));var _0x9964=function(_0x2a8acc,_0x150fe2){_0x2a8acc=_0x2a8acc-0x0;var _0x4c507b=_0x9649[_0x2a8acc];return _0x4c507b;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize[_0x9964('0x2')]},'basename':{'type':Sequelize[_0x9964('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9009=['sequelize','STRING'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9009,0x1d4));var _0x9900=function(_0x5d0877,_0x4423e5){_0x5d0877=_0x5d0877-0x0;var _0x8413be=_0x9009[_0x5d0877];return _0x8413be;};'use strict';var Sequelize=require(_0x9900('0x0'));module['exports']={'name':{'type':Sequelize[_0x9900('0x1')]},'basename':{'type':Sequelize[_0x9900('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6f800f5..9cc546f 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 _0x9fb0=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','get','omit','createdAt','body','create','destroy','basename','file','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','error','stack','name','send','map','Attachment','rawAttributes'];(function(_0x18f8ff,_0x257e95){var _0x18de97=function(_0xc8eb68){while(--_0xc8eb68){_0x18f8ff['push'](_0x18f8ff['shift']());}};_0x18de97(++_0x257e95);}(_0x9fb0,0x1dd));var _0x09fb=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x9fb0[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0x09fb('0x0'));var rimraf=require(_0x09fb('0x1'));var zipdir=require(_0x09fb('0x2'));var jsonpatch=require(_0x09fb('0x3'));var rp=require('request-promise');var moment=require(_0x09fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09fb('0x5'));var util=require('util');var path=require(_0x09fb('0x6'));var sox=require(_0x09fb('0x7'));var csv=require('to-csv');var ejs=require(_0x09fb('0x8'));var fs=require('fs');var fs_extra=require(_0x09fb('0x9'));var _=require(_0x09fb('0xa'));var squel=require(_0x09fb('0xb'));var crypto=require(_0x09fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x09fb('0xd'));var toCsv=require(_0x09fb('0xe'));var querystring=require(_0x09fb('0xf'));var Papa=require(_0x09fb('0x10'));var Redis=require(_0x09fb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x09fb('0x12'));var as=require(_0x09fb('0x13'));var hardwareService=require(_0x09fb('0x14'));var logger=require('../../config/logger')(_0x09fb('0x15'));var utils=require('../../config/utils');var config=require(_0x09fb('0x16'));var licenseUtil=require(_0x09fb('0x17'));var db=require(_0x09fb('0x18'))['db'];function respondWithStatusCode(_0x419176,_0x22569f){_0x22569f=_0x22569f||0xcc;return function(_0x530a48){if(_0x530a48){return _0x419176[_0x09fb('0x19')](_0x22569f);}return _0x419176[_0x09fb('0x1a')](_0x22569f)[_0x09fb('0x1b')]();};}function respondWithResult(_0x377287,_0x1adc74){_0x1adc74=_0x1adc74||0xc8;return function(_0x8a8bcf){if(_0x8a8bcf){return _0x377287[_0x09fb('0x1a')](_0x1adc74)[_0x09fb('0x1c')](_0x8a8bcf);}};}function respondWithFilteredResult(_0x583e69,_0x470182){return function(_0x1cebc4){if(_0x1cebc4){var _0x57d362=typeof _0x470182['offset']==='undefined'&&typeof _0x470182[_0x09fb('0x1d')]===_0x09fb('0x1e');var _0x4752f6=_0x1cebc4[_0x09fb('0x1f')];var _0x26cf1f=_0x57d362?0x0:_0x470182[_0x09fb('0x20')];var _0x1c7657=_0x57d362?_0x1cebc4[_0x09fb('0x1f')]:_0x470182[_0x09fb('0x20')]+_0x470182['limit'];var _0x2e4675;if(_0x1c7657>=_0x4752f6){_0x1c7657=_0x4752f6;_0x2e4675=0xc8;}else{_0x2e4675=0xce;}_0x583e69[_0x09fb('0x1a')](_0x2e4675);return _0x583e69[_0x09fb('0x21')](_0x09fb('0x22'),_0x26cf1f+'-'+_0x1c7657+'/'+_0x4752f6)[_0x09fb('0x1c')](_0x1cebc4);}return null;};}function patchUpdates(_0x439536){return function(_0x41920f){try{jsonpatch['apply'](_0x41920f,_0x439536,!![]);}catch(_0x4a1f7d){return BPromise['reject'](_0x4a1f7d);}return _0x41920f[_0x09fb('0x23')]();};}function saveUpdates(_0x25f8a4,_0x3f3757){return function(_0x16e812){if(_0x16e812){return _0x16e812[_0x09fb('0x24')](_0x25f8a4)[_0x09fb('0x25')](function(_0x721ecb){return _0x721ecb;});}return null;};}function removeEntity(_0x488eb0,_0x57ce77){return function(_0x2671b1){if(_0x2671b1){return _0x2671b1['destroy']()[_0x09fb('0x25')](function(){_0x488eb0['status'](0xcc)[_0x09fb('0x1b')]();});}};}function handleEntityNotFound(_0x42e590,_0x3b1e72){return function(_0x1dfa7d){if(!_0x1dfa7d){_0x42e590[_0x09fb('0x19')](0x194);}return _0x1dfa7d;};}function handleError(_0x41cfc8,_0x57861a){_0x57861a=_0x57861a||0x1f4;return function(_0xe8928a){logger[_0x09fb('0x26')](_0xe8928a[_0x09fb('0x27')]);if(_0xe8928a[_0x09fb('0x28')]){delete _0xe8928a[_0x09fb('0x28')];}_0x41cfc8[_0x09fb('0x1a')](_0x57861a)[_0x09fb('0x29')](_0xe8928a);};}exports['index']=function(_0x23119b,_0x50cbea){var _0x5f5ec={},_0x1e797c={},_0x4445cb={'count':0x0,'rows':[]};var _0x375c0d=_[_0x09fb('0x2a')](db[_0x09fb('0x2b')][_0x09fb('0x2c')],function(_0x16cc38){return{'name':_0x16cc38[_0x09fb('0x2d')],'type':_0x16cc38[_0x09fb('0x2e')][_0x09fb('0x2f')]};});_0x1e797c[_0x09fb('0x30')]=_[_0x09fb('0x2a')](_0x375c0d,_0x09fb('0x28'));_0x1e797c[_0x09fb('0x31')]=_['keys'](_0x23119b[_0x09fb('0x31')]);_0x1e797c[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],_0x1e797c[_0x09fb('0x31')]);_0x5f5ec[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x23119b['query'][_0x09fb('0x35')]));_0x5f5ec[_0x09fb('0x34')]=_0x5f5ec[_0x09fb('0x34')][_0x09fb('0x36')]?_0x5f5ec[_0x09fb('0x34')]:_0x1e797c[_0x09fb('0x30')];if(!_0x23119b[_0x09fb('0x31')][_0x09fb('0x37')](_0x09fb('0x38'))){_0x5f5ec[_0x09fb('0x1d')]=qs[_0x09fb('0x1d')](_0x23119b['query'][_0x09fb('0x1d')]);_0x5f5ec[_0x09fb('0x20')]=qs[_0x09fb('0x20')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x20')]);}_0x5f5ec['order']=qs[_0x09fb('0x39')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x39')]);_0x5f5ec[_0x09fb('0x3a')]=qs[_0x09fb('0x32')](_['pick'](_0x23119b[_0x09fb('0x31')],_0x1e797c[_0x09fb('0x32')]),_0x375c0d);if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3b')]){_0x5f5ec[_0x09fb('0x3a')]=_[_0x09fb('0x3c')](_0x5f5ec[_0x09fb('0x3a')],{'$or':_[_0x09fb('0x2a')](_0x375c0d,function(_0x14628f){if(_0x14628f[_0x09fb('0x2e')]!=='VIRTUAL'){var _0x59bb4f={};_0x59bb4f[_0x14628f[_0x09fb('0x28')]]={'$like':'%'+_0x23119b[_0x09fb('0x31')]['filter']+'%'};return _0x59bb4f;}})});}_0x5f5ec=_[_0x09fb('0x3c')]({},_0x5f5ec,_0x23119b[_0x09fb('0x3d')]);var _0x5d9659={'where':_0x5f5ec[_0x09fb('0x3a')]};return db[_0x09fb('0x2b')][_0x09fb('0x1f')](_0x5d9659)['then'](function(_0x28a108){_0x4445cb[_0x09fb('0x1f')]=_0x28a108;if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x5f5ec[_0x09fb('0x3f')]=[{'all':!![]}];}return db[_0x09fb('0x2b')][_0x09fb('0x40')](_0x5f5ec);})['then'](function(_0x37b1a2){_0x4445cb[_0x09fb('0x41')]=_0x37b1a2;return _0x4445cb;})['then'](respondWithFilteredResult(_0x50cbea,_0x5f5ec))[_0x09fb('0x42')](handleError(_0x50cbea,null));};exports[_0x09fb('0x43')]=function(_0x222cb9,_0x3ea311){var _0x4eca5c={'raw':!![],'where':{'id':_0x222cb9[_0x09fb('0x44')]['id']}},_0x1e90a2={};_0x1e90a2[_0x09fb('0x30')]=_['keys'](db['Attachment'][_0x09fb('0x2c')]);_0x1e90a2[_0x09fb('0x31')]=_[_0x09fb('0x45')](_0x222cb9['query']);_0x1e90a2[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e90a2[_0x09fb('0x30')],_0x1e90a2['query']);_0x4eca5c[_0x09fb('0x34')]=_['intersection'](_0x1e90a2['model'],qs[_0x09fb('0x35')](_0x222cb9[_0x09fb('0x31')][_0x09fb('0x35')]));_0x4eca5c[_0x09fb('0x34')]=_0x4eca5c[_0x09fb('0x34')][_0x09fb('0x36')]?_0x4eca5c['attributes']:_0x1e90a2['model'];if(_0x222cb9[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x4eca5c[_0x09fb('0x3f')]=[{'all':!![]}];}_0x4eca5c=_[_0x09fb('0x3c')]({},_0x4eca5c,_0x222cb9[_0x09fb('0x3d')]);return db[_0x09fb('0x2b')]['find'](_0x4eca5c)[_0x09fb('0x25')](handleEntityNotFound(_0x3ea311,null))[_0x09fb('0x25')](respondWithResult(_0x3ea311,null))[_0x09fb('0x42')](handleError(_0x3ea311,null));};exports['clone']=function(_0x552969,_0x1ab5cb){var _0xc83c9b={'where':{'id':_0x552969[_0x09fb('0x44')]['id']}},_0x2d72e5={};_0x2d72e5[_0x09fb('0x30')]=_[_0x09fb('0x45')](db[_0x09fb('0x2b')][_0x09fb('0x2c')]);_0xc83c9b[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x2d72e5[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x552969[_0x09fb('0x31')][_0x09fb('0x35')]));_0xc83c9b[_0x09fb('0x34')]=_0xc83c9b['attributes'][_0x09fb('0x36')]?_0xc83c9b[_0x09fb('0x34')]:_0x2d72e5[_0x09fb('0x30')];if(_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]){_0xc83c9b[_0x09fb('0x3f')]=[{'all':!![]}];}_0xc83c9b=_[_0x09fb('0x3c')]({},_0xc83c9b,_0x552969['options']);return db['Attachment'][_0x09fb('0x46')](_0xc83c9b)[_0x09fb('0x25')](handleEntityNotFound(_0x1ab5cb,null))[_0x09fb('0x25')](function(_0x3e3e9a){if(_0x3e3e9a){var _0x3f5370=_0x3e3e9a[_0x09fb('0x47')]({'plain':!![]});_0x3f5370=qs[_0x09fb('0x48')](_0x3f5370,['id',_0x09fb('0x49'),'updatedAt']);_0x552969[_0x09fb('0x4a')]=_[_0x09fb('0x48')](_0x552969[_0x09fb('0x4a')],['id',_0x09fb('0x49'),'updatedAt']);return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_[_0x09fb('0x3c')](_0x3f5370,_0x552969[_0x09fb('0x4a')]),{'include':_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]?[{'all':!![]}]:undefined});}})[_0x09fb('0x25')](respondWithResult(_0x1ab5cb,0xc9))[_0x09fb('0x42')](handleError(_0x1ab5cb,null));};exports[_0x09fb('0x24')]=function(_0x337602,_0x41ed5a){if(_0x337602[_0x09fb('0x4a')]['id']){delete _0x337602[_0x09fb('0x4a')]['id'];}return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x337602[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x41ed5a,null))[_0x09fb('0x25')](saveUpdates(_0x337602[_0x09fb('0x4a')],null))[_0x09fb('0x25')](respondWithResult(_0x41ed5a,null))[_0x09fb('0x42')](handleError(_0x41ed5a,null));};exports[_0x09fb('0x4c')]=function(_0x9f686f,_0x476b2f){return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x9f686f[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x476b2f,null))[_0x09fb('0x25')](removeEntity(_0x476b2f,null))[_0x09fb('0x42')](handleError(_0x476b2f,null));};exports[_0x09fb('0x4b')]=function(_0x475e88,_0x2d138c,_0x1d0b6c){_0x475e88[_0x09fb('0x4a')][_0x09fb('0x28')]=_0x475e88['file']['originalname'];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x4d')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x4f')];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x2e')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x50')];return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_0x475e88['body'])[_0x09fb('0x25')](respondWithResult(_0x2d138c,0xc9))[_0x09fb('0x42')](handleError(_0x2d138c,null));};exports[_0x09fb('0x51')]=function(_0x4ee1f8,_0x572949,_0x5a2477){return db[_0x09fb('0x2b')]['findOne']({'where':{'id':_0x4ee1f8[_0x09fb('0x44')]['id']},'raw':!![]})[_0x09fb('0x25')](handleEntityNotFound(_0x572949,null))['then'](function(_0x10e382){if(_0x10e382){var _0x4e1259=_0x10e382[_0x09fb('0x52')]!==null;var _0x3a5010=path[_0x09fb('0x53')](config[_0x09fb('0x54')],_0x09fb('0x55'));if(_0x4e1259){_0x3a5010=path[_0x09fb('0x53')](_0x3a5010,_0x09fb('0x56'));}var _0x5ce674=path['join'](_0x3a5010,_0x10e382[_0x09fb('0x4d')]);return _0x572949['download'](_0x5ce674);}})[_0x09fb('0x42')](handleError(_0x572949,null));}; \ No newline at end of file +var _0x7968=['mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','merge','find','clone','get','createdAt','body','updatedAt','create','originalname','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x2ea58d,_0x3bf0ee){var _0x538406=function(_0x3d0f06){while(--_0x3d0f06){_0x2ea58d['push'](_0x2ea58d['shift']());}};_0x538406(++_0x3bf0ee);}(_0x7968,0x1bd));var _0x8796=function(_0x1c6ac9,_0x1a4c6e){_0x1c6ac9=_0x1c6ac9-0x0;var _0x1286ce=_0x7968[_0x1c6ac9];return _0x1286ce;};'use strict';var emlformat=require(_0x8796('0x0'));var rimraf=require(_0x8796('0x1'));var zipdir=require(_0x8796('0x2'));var jsonpatch=require(_0x8796('0x3'));var rp=require('request-promise');var moment=require(_0x8796('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8796('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8796('0x6'));var ejs=require(_0x8796('0x7'));var fs=require('fs');var fs_extra=require(_0x8796('0x8'));var _=require(_0x8796('0x9'));var squel=require(_0x8796('0xa'));var crypto=require(_0x8796('0xb'));var jsforce=require(_0x8796('0xc'));var deskjs=require(_0x8796('0xd'));var toCsv=require(_0x8796('0x6'));var querystring=require(_0x8796('0xe'));var Papa=require(_0x8796('0xf'));var Redis=require('ioredis');var authService=require(_0x8796('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8796('0x11'));var hardwareService=require(_0x8796('0x12'));var logger=require(_0x8796('0x13'))(_0x8796('0x14'));var utils=require(_0x8796('0x15'));var config=require(_0x8796('0x16'));var licenseUtil=require(_0x8796('0x17'));var db=require(_0x8796('0x18'))['db'];function respondWithStatusCode(_0x18b5d9,_0x33ce42){_0x33ce42=_0x33ce42||0xcc;return function(_0x48c700){if(_0x48c700){return _0x18b5d9[_0x8796('0x19')](_0x33ce42);}return _0x18b5d9['status'](_0x33ce42)[_0x8796('0x1a')]();};}function respondWithResult(_0x417ade,_0x4bf70a){_0x4bf70a=_0x4bf70a||0xc8;return function(_0x4a8f24){if(_0x4a8f24){return _0x417ade[_0x8796('0x1b')](_0x4bf70a)['json'](_0x4a8f24);}};}function respondWithFilteredResult(_0x4ca2fe,_0x2fa708){return function(_0x1c595e){if(_0x1c595e){var _0x5037fc=typeof _0x2fa708[_0x8796('0x1c')]==='undefined'&&typeof _0x2fa708[_0x8796('0x1d')]===_0x8796('0x1e');var _0x3c53c7=_0x1c595e[_0x8796('0x1f')];var _0x39959d=_0x5037fc?0x0:_0x2fa708[_0x8796('0x1c')];var _0x414391=_0x5037fc?_0x1c595e['count']:_0x2fa708[_0x8796('0x1c')]+_0x2fa708[_0x8796('0x1d')];var _0x9aac38;if(_0x414391>=_0x3c53c7){_0x414391=_0x3c53c7;_0x9aac38=0xc8;}else{_0x9aac38=0xce;}_0x4ca2fe['status'](_0x9aac38);return _0x4ca2fe[_0x8796('0x20')](_0x8796('0x21'),_0x39959d+'-'+_0x414391+'/'+_0x3c53c7)[_0x8796('0x22')](_0x1c595e);}return null;};}function patchUpdates(_0x16c8a9){return function(_0xe43e91){try{jsonpatch['apply'](_0xe43e91,_0x16c8a9,!![]);}catch(_0x5ebefe){return BPromise['reject'](_0x5ebefe);}return _0xe43e91[_0x8796('0x23')]();};}function saveUpdates(_0x508243,_0x597823){return function(_0x2cf38a){if(_0x2cf38a){return _0x2cf38a[_0x8796('0x24')](_0x508243)[_0x8796('0x25')](function(_0x3b4e78){return _0x3b4e78;});}return null;};}function removeEntity(_0x5c5f1e,_0x500cb){return function(_0x3e667c){if(_0x3e667c){return _0x3e667c[_0x8796('0x26')]()[_0x8796('0x25')](function(){_0x5c5f1e[_0x8796('0x1b')](0xcc)[_0x8796('0x1a')]();});}};}function handleEntityNotFound(_0x30cfd5,_0x41250f){return function(_0x47e070){if(!_0x47e070){_0x30cfd5[_0x8796('0x19')](0x194);}return _0x47e070;};}function handleError(_0x36638f,_0x510941){_0x510941=_0x510941||0x1f4;return function(_0x3be189){logger[_0x8796('0x27')](_0x3be189[_0x8796('0x28')]);if(_0x3be189[_0x8796('0x29')]){delete _0x3be189[_0x8796('0x29')];}_0x36638f[_0x8796('0x1b')](_0x510941)[_0x8796('0x2a')](_0x3be189);};}exports[_0x8796('0x2b')]=function(_0xae3c72,_0x5ab9bc){var _0x3d0e47={},_0x53d8bc={},_0x417d7b={'count':0x0,'rows':[]};var _0x2b6d76=_[_0x8796('0x2c')](db[_0x8796('0x2d')]['rawAttributes'],function(_0x454c40){return{'name':_0x454c40[_0x8796('0x2e')],'type':_0x454c40['type']['key']};});_0x53d8bc['model']=_[_0x8796('0x2c')](_0x2b6d76,_0x8796('0x29'));_0x53d8bc[_0x8796('0x2f')]=_[_0x8796('0x30')](_0xae3c72[_0x8796('0x2f')]);_0x53d8bc[_0x8796('0x31')]=_[_0x8796('0x32')](_0x53d8bc[_0x8796('0x33')],_0x53d8bc['query']);_0x3d0e47[_0x8796('0x34')]=_['intersection'](_0x53d8bc[_0x8796('0x33')],qs[_0x8796('0x35')](_0xae3c72[_0x8796('0x2f')][_0x8796('0x35')]));_0x3d0e47[_0x8796('0x34')]=_0x3d0e47['attributes'][_0x8796('0x36')]?_0x3d0e47[_0x8796('0x34')]:_0x53d8bc['model'];if(!_0xae3c72[_0x8796('0x2f')][_0x8796('0x37')](_0x8796('0x38'))){_0x3d0e47[_0x8796('0x1d')]=qs[_0x8796('0x1d')](_0xae3c72[_0x8796('0x2f')][_0x8796('0x1d')]);_0x3d0e47['offset']=qs[_0x8796('0x1c')](_0xae3c72['query']['offset']);}_0x3d0e47['order']=qs['sort'](_0xae3c72[_0x8796('0x2f')][_0x8796('0x39')]);_0x3d0e47[_0x8796('0x3a')]=qs[_0x8796('0x31')](_[_0x8796('0x3b')](_0xae3c72['query'],_0x53d8bc['filters']),_0x2b6d76);if(_0xae3c72['query'][_0x8796('0x3c')]){_0x3d0e47[_0x8796('0x3a')]=_['merge'](_0x3d0e47['where'],{'$or':_[_0x8796('0x2c')](_0x2b6d76,function(_0x210c5f){if(_0x210c5f[_0x8796('0x3d')]!==_0x8796('0x3e')){var _0x4ecbe9={};_0x4ecbe9[_0x210c5f[_0x8796('0x29')]]={'$like':'%'+_0xae3c72[_0x8796('0x2f')][_0x8796('0x3c')]+'%'};return _0x4ecbe9;}})});}_0x3d0e47=_['merge']({},_0x3d0e47,_0xae3c72[_0x8796('0x3f')]);var _0x27fc10={'where':_0x3d0e47[_0x8796('0x3a')]};return db['Attachment']['count'](_0x27fc10)['then'](function(_0x16b586){_0x417d7b['count']=_0x16b586;if(_0xae3c72[_0x8796('0x2f')][_0x8796('0x40')]){_0x3d0e47['include']=[{'all':!![]}];}return db[_0x8796('0x2d')]['findAll'](_0x3d0e47);})['then'](function(_0x4a832f){_0x417d7b[_0x8796('0x41')]=_0x4a832f;return _0x417d7b;})[_0x8796('0x25')](respondWithFilteredResult(_0x5ab9bc,_0x3d0e47))[_0x8796('0x42')](handleError(_0x5ab9bc,null));};exports[_0x8796('0x43')]=function(_0xfcad66,_0x836ac3){var _0x1c433c={'raw':!![],'where':{'id':_0xfcad66[_0x8796('0x44')]['id']}},_0x2bfb58={};_0x2bfb58['model']=_[_0x8796('0x30')](db[_0x8796('0x2d')]['rawAttributes']);_0x2bfb58[_0x8796('0x2f')]=_[_0x8796('0x30')](_0xfcad66[_0x8796('0x2f')]);_0x2bfb58[_0x8796('0x31')]=_[_0x8796('0x32')](_0x2bfb58[_0x8796('0x33')],_0x2bfb58[_0x8796('0x2f')]);_0x1c433c[_0x8796('0x34')]=_[_0x8796('0x32')](_0x2bfb58['model'],qs[_0x8796('0x35')](_0xfcad66[_0x8796('0x2f')][_0x8796('0x35')]));_0x1c433c['attributes']=_0x1c433c['attributes']['length']?_0x1c433c[_0x8796('0x34')]:_0x2bfb58[_0x8796('0x33')];if(_0xfcad66[_0x8796('0x2f')][_0x8796('0x40')]){_0x1c433c[_0x8796('0x45')]=[{'all':!![]}];}_0x1c433c=_[_0x8796('0x46')]({},_0x1c433c,_0xfcad66[_0x8796('0x3f')]);return db[_0x8796('0x2d')][_0x8796('0x47')](_0x1c433c)[_0x8796('0x25')](handleEntityNotFound(_0x836ac3,null))[_0x8796('0x25')](respondWithResult(_0x836ac3,null))[_0x8796('0x42')](handleError(_0x836ac3,null));};exports[_0x8796('0x48')]=function(_0x45af25,_0x4b5955){var _0x323452={'where':{'id':_0x45af25[_0x8796('0x44')]['id']}},_0x166e73={};_0x166e73[_0x8796('0x33')]=_['keys'](db[_0x8796('0x2d')]['rawAttributes']);_0x323452['attributes']=_[_0x8796('0x32')](_0x166e73[_0x8796('0x33')],qs['fields'](_0x45af25[_0x8796('0x2f')][_0x8796('0x35')]));_0x323452[_0x8796('0x34')]=_0x323452[_0x8796('0x34')][_0x8796('0x36')]?_0x323452[_0x8796('0x34')]:_0x166e73['model'];if(_0x45af25[_0x8796('0x2f')][_0x8796('0x40')]){_0x323452['include']=[{'all':!![]}];}_0x323452=_[_0x8796('0x46')]({},_0x323452,_0x45af25['options']);return db[_0x8796('0x2d')][_0x8796('0x47')](_0x323452)[_0x8796('0x25')](handleEntityNotFound(_0x4b5955,null))['then'](function(_0x20c448){if(_0x20c448){var _0xa0a53a=_0x20c448[_0x8796('0x49')]({'plain':!![]});_0xa0a53a=qs['omit'](_0xa0a53a,['id',_0x8796('0x4a'),'updatedAt']);_0x45af25[_0x8796('0x4b')]=_['omit'](_0x45af25[_0x8796('0x4b')],['id','createdAt',_0x8796('0x4c')]);return db['Attachment'][_0x8796('0x4d')](_[_0x8796('0x46')](_0xa0a53a,_0x45af25['body']),{'include':_0x45af25['query'][_0x8796('0x40')]?[{'all':!![]}]:undefined});}})[_0x8796('0x25')](respondWithResult(_0x4b5955,0xc9))[_0x8796('0x42')](handleError(_0x4b5955,null));};exports[_0x8796('0x24')]=function(_0x3b35c9,_0x1c5fe9){if(_0x3b35c9[_0x8796('0x4b')]['id']){delete _0x3b35c9[_0x8796('0x4b')]['id'];}return db[_0x8796('0x2d')]['find']({'where':{'id':_0x3b35c9['params']['id']}})[_0x8796('0x25')](handleEntityNotFound(_0x1c5fe9,null))[_0x8796('0x25')](saveUpdates(_0x3b35c9['body'],null))[_0x8796('0x25')](respondWithResult(_0x1c5fe9,null))[_0x8796('0x42')](handleError(_0x1c5fe9,null));};exports[_0x8796('0x26')]=function(_0x32fd76,_0xcbae6a){return db[_0x8796('0x2d')][_0x8796('0x47')]({'where':{'id':_0x32fd76[_0x8796('0x44')]['id']}})[_0x8796('0x25')](handleEntityNotFound(_0xcbae6a,null))[_0x8796('0x25')](removeEntity(_0xcbae6a,null))[_0x8796('0x42')](handleError(_0xcbae6a,null));};exports['create']=function(_0x28c690,_0x4e2507,_0x319bdc){_0x28c690[_0x8796('0x4b')][_0x8796('0x29')]=_0x28c690['file'][_0x8796('0x4e')];_0x28c690[_0x8796('0x4b')]['basename']=_0x28c690[_0x8796('0x4f')][_0x8796('0x50')];_0x28c690[_0x8796('0x4b')]['type']=_0x28c690[_0x8796('0x4f')][_0x8796('0x51')];return db[_0x8796('0x2d')][_0x8796('0x4d')](_0x28c690[_0x8796('0x4b')])['then'](respondWithResult(_0x4e2507,0xc9))[_0x8796('0x42')](handleError(_0x4e2507,null));};exports[_0x8796('0x52')]=function(_0x452825,_0x3a0946,_0x406765){return db[_0x8796('0x2d')][_0x8796('0x53')]({'where':{'id':_0x452825[_0x8796('0x44')]['id']},'raw':!![]})[_0x8796('0x25')](handleEntityNotFound(_0x3a0946,null))[_0x8796('0x25')](function(_0x52cf8a){if(_0x52cf8a){var _0x7e17de=_0x52cf8a[_0x8796('0x54')]!==null;var _0x58690d=path[_0x8796('0x55')](config[_0x8796('0x56')],_0x8796('0x57'));if(_0x7e17de){_0x58690d=path[_0x8796('0x55')](_0x58690d,_0x8796('0x58'));}var _0x2ed0b1=path[_0x8796('0x55')](_0x58690d,_0x52cf8a[_0x8796('0x59')]);return _0x3a0946[_0x8796('0x52')](_0x2ed0b1);}})[_0x8796('0x42')](handleError(_0x3a0946,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index daaada8..05fb964 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 _0xebd3=['attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x451df9,_0x5e6047){var _0x59da59=function(_0x42bcd8){while(--_0x42bcd8){_0x451df9['push'](_0x451df9['shift']());}};_0x59da59(++_0x5e6047);}(_0xebd3,0x10f));var _0x3ebd=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0xebd3[_0x53f964];return _0x17be6c;};'use strict';var _=require(_0x3ebd('0x0'));var util=require(_0x3ebd('0x1'));var logger=require(_0x3ebd('0x2'))(_0x3ebd('0x3'));var moment=require(_0x3ebd('0x4'));var BPromise=require(_0x3ebd('0x5'));var rp=require(_0x3ebd('0x6'));var fs=require('fs');var path=require(_0x3ebd('0x7'));var rimraf=require(_0x3ebd('0x8'));var config=require(_0x3ebd('0x9'));var attributes=require(_0x3ebd('0xa'));module[_0x3ebd('0xb')]=function(_0xa768c7,_0x22a69f){return _0xa768c7[_0x3ebd('0xc')](_0x3ebd('0xd'),attributes,{'tableName':_0x3ebd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f66=['./attachment.attributes','exports','Attachment','lodash','util','bluebird','rimraf','../../config/environment'];(function(_0x2e2aa7,_0x29adde){var _0x4c4445=function(_0x124d5b){while(--_0x124d5b){_0x2e2aa7['push'](_0x2e2aa7['shift']());}};_0x4c4445(++_0x29adde);}(_0x1f66,0xeb));var _0x61f6=function(_0x1bbd1f,_0x3ddc56){_0x1bbd1f=_0x1bbd1f-0x0;var _0x5c88b0=_0x1f66[_0x1bbd1f];return _0x5c88b0;};'use strict';var _=require(_0x61f6('0x0'));var util=require(_0x61f6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x61f6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61f6('0x3'));var config=require(_0x61f6('0x4'));var attributes=require(_0x61f6('0x5'));module[_0x61f6('0x6')]=function(_0x4709c0,_0x10eca7){return _0x4709c0['define'](_0x61f6('0x7'),attributes,{'tableName':'attachments','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 eb2aa0b..9432525 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 _0xd87e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','Attachment,\x20%s,\x20%s'];(function(_0x42cde2,_0x13f233){var _0x15c4b6=function(_0x1a3628){while(--_0x1a3628){_0x42cde2['push'](_0x42cde2['shift']());}};_0x15c4b6(++_0x13f233);}(_0xd87e,0x1bf));var _0xed87=function(_0x3b45e8,_0x628af6){_0x3b45e8=_0x3b45e8-0x0;var _0x370099=_0xd87e[_0x3b45e8];return _0x370099;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('Attachment,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')](_0x2c386a[_0xed87('0x18')],{'raw':_0x2c386a[_0xed87('0x19')]?_0x2c386a[_0xed87('0x19')][_0xed87('0x1a')]===undefined?!![]:![]:!![]})[_0xed87('0x9')](function(_0x3b7981){logger['info']('CreateAttachment',_0x2c386a);logger['debug']('CreateAttachment',_0x2c386a,JSON[_0xed87('0xf')](_0x3b7981));_0x5f4076(_0x3b7981);})['catch'](function(_0x4191a7){logger[_0xed87('0x10')]('CreateAttachment',_0x4191a7[_0xed87('0x12')],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x4191a7[_0xed87('0x12')]));});});}; \ No newline at end of file +var _0x8b29=['bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateAttachment','create','body','options','lodash','moment'];(function(_0x4102f9,_0x47ff76){var _0x2d3ebc=function(_0x2ede38){while(--_0x2ede38){_0x4102f9['push'](_0x4102f9['shift']());}};_0x2d3ebc(++_0x47ff76);}(_0x8b29,0xbe));var _0x98b2=function(_0xa0cbbd,_0x49e591){_0xa0cbbd=_0xa0cbbd-0x0;var _0x21d204=_0x8b29[_0xa0cbbd];return _0x21d204;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ef5,_0x221cee,_0x2cd0cb){return new BPromise(function(_0x417ca6,_0x388827){return client[_0x98b2('0x9')](_0x3e7ef5,_0x2cd0cb)[_0x98b2('0xa')](function(_0x501b51){logger['info'](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));logger[_0x98b2('0xd')](_0x98b2('0xe'),_0x221cee,_0x98b2('0xc'),JSON[_0x98b2('0xf')](_0x501b51));if(_0x501b51['error']){if(_0x501b51[_0x98b2('0x10')][_0x98b2('0x11')]===0x1f4){logger['error'](_0x98b2('0xb'),_0x221cee,_0x501b51[_0x98b2('0x10')][_0x98b2('0x12')]);return _0x388827(_0x501b51['error']['message']);}logger[_0x98b2('0x10')]('Attachment,\x20%s,\x20%s',_0x221cee,_0x501b51[_0x98b2('0x10')]['message']);return _0x417ca6(_0x501b51['error']['message']);}else{logger[_0x98b2('0x13')](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));_0x417ca6(_0x501b51['result']['message']);}})['catch'](function(_0x389d22){logger[_0x98b2('0x10')](_0x98b2('0xb'),_0x221cee,_0x389d22);_0x388827(_0x389d22);});});}exports[_0x98b2('0x14')]=function(_0x4b9f2c){var _0x1cd8c6=this;return new Promise(function(_0x588837,_0x989082){return db['Attachment'][_0x98b2('0x15')](_0x4b9f2c[_0x98b2('0x16')],{'raw':_0x4b9f2c[_0x98b2('0x17')]?_0x4b9f2c[_0x98b2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x98b2('0xa')](function(_0x242cbd){logger['info']('CreateAttachment',_0x4b9f2c);logger[_0x98b2('0xd')](_0x98b2('0x14'),_0x4b9f2c,JSON['stringify'](_0x242cbd));_0x588837(_0x242cbd);})['catch'](function(_0x3796c0){logger[_0x98b2('0x10')]('CreateAttachment',_0x3796c0[_0x98b2('0x12')],_0x4b9f2c);_0x989082(_0x1cd8c6[_0x98b2('0x10')](0x1f4,_0x3796c0[_0x98b2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 7017d93..4b3f771 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x1621f8,_0x5d4d97){var _0xda6552=function(_0x550d95){while(--_0x550d95){_0x1621f8['push'](_0x1621f8['shift']());}};_0xda6552(++_0x5d4d97);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4dae3e,_0x343290){_0x4dae3e=_0x4dae3e-0x0;var _0x464847=_0x5f2f[_0x4dae3e];return _0x464847;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x472ffa,_0x22e185){var _0x2bfefd=function(_0x5a95b3){while(--_0x5a95b3){_0x472ffa['push'](_0x472ffa['shift']());}};_0x2bfefd(++_0x22e185);}(_0x5f2f,0x73));var _0xf5f2=function(_0x19e013,_0x5c74e0){_0x19e013=_0x19e013-0x0;var _0x58c128=_0x5f2f[_0x19e013];return _0x58c128;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 1a365b1..4ec1d0d 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f18=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','user','add','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error'];(function(_0x30fb4f,_0x2e4430){var _0x4ff8c8=function(_0x4a2b9a){while(--_0x4a2b9a){_0x30fb4f['push'](_0x30fb4f['shift']());}};_0x4ff8c8(++_0x2e4430);}(_0x8f18,0x108));var _0x88f1=function(_0x28fd98,_0xc2597b){_0x28fd98=_0x28fd98-0x0;var _0x2dcb8e=_0x8f18[_0x28fd98];return _0x2dcb8e;};'use strict';var passport=require(_0x88f1('0x0'));var LocalStrategy=require(_0x88f1('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x88f1('0x2'));var BPromise=require(_0x88f1('0x3'));var util=require('util');var db=require(_0x88f1('0x4'))['db'];var authService=require(_0x88f1('0x5'));var utils=require(_0x88f1('0x6'));var config=require(_0x88f1('0x7'));var logger=require('../../config/logger')(_0x88f1('0x8'));function isActiveDirectoryConfigured(_0x4fc7df){var _0x10e421=![];if(typeof _0x4fc7df[_0x88f1('0x9')]!==_0x88f1('0xa')){_0x10e421=_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xb')]&&_0x4fc7df[_0x88f1('0x9')]['url']&&_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xc')];}return _0x10e421;}function adAuthenticate(_0x428129,_0x8295b0,_0x1ec829){return new BPromise(function(_0x16e857,_0x401f31){try{var _0x3aa48e=new ActiveDirectory(_0x428129);_0x3aa48e[_0x88f1('0xd')](_0x8295b0,_0x1ec829,function(_0x1b4c87,_0x35dc22){if(_0x1b4c87){logger['error'](_0x88f1('0xe'),_0x8295b0,util[_0x88f1('0xf')](_0x1b4c87,{'showHidden':![],'depth':null}));_0x401f31(_0x88f1('0x10'));}else if(!_0x35dc22){logger[_0x88f1('0x11')](_0x88f1('0x12'),_0x8295b0);_0x401f31(_0x88f1('0x10'));}else{_0x16e857(_0x35dc22);}});}catch(_0x466a70){_0x401f31(_0x466a70);}});}function ActiveDirectoryAuthenticate(_0x181acd,_0x440408,_0x34d1cc,_0x59ebb1){var _0x155369,_0x525615;if(!isActiveDirectoryConfigured(config)){logger[_0x88f1('0x11')](_0x88f1('0x13'),_0x440408);return _0x59ebb1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x88f1('0x14')][_0x88f1('0x15')]({'where':{'id':0x1},'attributes':[_0x88f1('0x16'),_0x88f1('0x17')],'raw':!![]})[_0x88f1('0x18')](function(_0x492dda){_0x155369=_0x492dda;if(!_0x155369[_0x88f1('0x16')]){logger[_0x88f1('0x11')](_0x88f1('0x19'),_0x440408);throw new Error(_0x88f1('0x10'));}return _0x181acd[_0x88f1('0x15')]({'attributes':['id',_0x88f1('0x1a'),_0x88f1('0x1b'),_0x88f1('0x1c'),_0x88f1('0x1d'),_0x88f1('0x1e'),'blocked',_0x88f1('0x1f'),_0x88f1('0x20')],'where':{'name':_0x440408,'role':{'$or':[_0x88f1('0x21'),_0x88f1('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0x88f1('0x18')](function(_0x358183){if(!_0x358183||_0x358183&&_0x358183[_0x88f1('0x1a')]!==_0x440408){throw new Error(_0x88f1('0x10'));}_0x525615=_0x358183;var _0x4a6bf8=_0x525615[_0x88f1('0x1a')]+'@'+config['activedirectory'][_0x88f1('0xc')];return adAuthenticate(config['activedirectory'],_0x4a6bf8,_0x34d1cc);})['then'](function(_0x39ec2d){if(_0x525615[_0x88f1('0x1e')]){throw new Error(_0x88f1('0x10'));}if(_0x155369[_0x88f1('0x17')]>0x0){if(_0x525615['blocked']){if(moment(_0x525615[_0x88f1('0x1f')])[_0x88f1('0x23')](_0x155369[_0x88f1('0x17')],_0x88f1('0x24'))>moment()){throw new Error(_0x88f1('0x10'));}return utils['clearBlockUser'](_0x525615,0x0,![],null)['then'](function(){return utils[_0x88f1('0x25')](_0x525615);})[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}else{return utils[_0x88f1('0x25')](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}}else{return utils['getLicense'](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}})[_0x88f1('0x26')](function(_0x218a97){return _0x59ebb1(null,![],_0x218a97);});}function handleError(_0x3ff0fd,_0x484fc6,_0x2f5dc2){return _0x3ff0fd[_0x88f1('0x27')](_0x484fc6||0x1f4)[_0x88f1('0x28')]({'message':_0x2f5dc2?_0x2f5dc2['message']||_0x2f5dc2:''});}exports[_0x88f1('0x29')]=function(_0x57c98a,_0x4ad56c,_0x29a7d5){passport['authenticate'](_0x88f1('0x2a'),function(_0x5c21ab,_0x34490c,_0x11241c){var _0x502b07=_0x5c21ab||_0x11241c;if(_0x502b07){return handleError(_0x4ad56c,0x191,_0x502b07);}if(!_0x34490c){return handleError(_0x4ad56c,0x194,{'message':_0x88f1('0x2b')});}else{var _0xeb6c40={'payload':{'id':_0x34490c['id'],'role':_0x34490c[_0x88f1('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xeb6c40)['then'](function(_0x5c7fe8){_0x4ad56c[_0x88f1('0x2c')]({'id':_0x34490c['id'],'token':_0x5c7fe8,'statusCall':'','isAlreadyLogged':_0x34490c[_0x88f1('0x20')]});});}})(_0x57c98a,_0x4ad56c,_0x29a7d5);};passport[_0x88f1('0x2d')](_0x88f1('0x2a'),new LocalStrategy({'usernameField':_0x88f1('0x1a'),'passwordField':_0x88f1('0x1b')},function(_0x146e92,_0xf45a9b,_0xaf3a5c){return ActiveDirectoryAuthenticate(db[_0x88f1('0x2e')],_0x146e92,_0xf45a9b,_0xaf3a5c);})); \ No newline at end of file +var _0x40a3=['role','blockedAt','online','admin','user','agent','name','blockDuration','blocked','minutes','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x40a3,0x1c3));var _0x340a=function(_0x302e77,_0x3bc416){_0x302e77=_0x302e77-0x0;var _0x490f3d=_0x40a3[_0x302e77];return _0x490f3d;};'use strict';var passport=require(_0x340a('0x0'));var LocalStrategy=require(_0x340a('0x1'))[_0x340a('0x2')];var moment=require(_0x340a('0x3'));var ActiveDirectory=require(_0x340a('0x4'));var BPromise=require('bluebird');var util=require(_0x340a('0x5'));var db=require(_0x340a('0x6'))['db'];var authService=require(_0x340a('0x7'));var utils=require(_0x340a('0x8'));var config=require(_0x340a('0x9'));var logger=require(_0x340a('0xa'))(_0x340a('0xb'));function isActiveDirectoryConfigured(_0x33e52b){var _0xd4559f=![];if(typeof _0x33e52b[_0x340a('0xc')]!==_0x340a('0xd')){_0xd4559f=_0x33e52b[_0x340a('0xc')][_0x340a('0xe')]&&_0x33e52b['activedirectory']['url']&&_0x33e52b[_0x340a('0xc')][_0x340a('0xf')];}return _0xd4559f;}function adAuthenticate(_0x245459,_0x80c108,_0x158db8){return new BPromise(function(_0x19c616,_0x27e260){try{var _0x16a530=new ActiveDirectory(_0x245459);_0x16a530[_0x340a('0x10')](_0x80c108,_0x158db8,function(_0x4c7cfa,_0x41586b){if(_0x4c7cfa){logger[_0x340a('0x11')](_0x340a('0x12'),_0x80c108,util[_0x340a('0x13')](_0x4c7cfa,{'showHidden':![],'depth':null}));_0x27e260('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x41586b){logger[_0x340a('0x11')](_0x340a('0x14'),_0x80c108);_0x27e260(_0x340a('0x15'));}else{_0x19c616(_0x41586b);}});}catch(_0x12dd29){_0x27e260(_0x12dd29);}});}function ActiveDirectoryAuthenticate(_0x180789,_0x12070b,_0x3aaf46,_0x529397){var _0x36c2d7,_0x4b145f;if(!isActiveDirectoryConfigured(config)){logger[_0x340a('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x12070b);return _0x529397(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x340a('0x16')][_0x340a('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0x340a('0x18')](function(_0x46c98f){_0x36c2d7=_0x46c98f;if(!_0x36c2d7[_0x340a('0x19')]){logger[_0x340a('0x11')](_0x340a('0x1a'),_0x12070b);throw new Error(_0x340a('0x15'));}return _0x180789[_0x340a('0x17')]({'attributes':['id','name',_0x340a('0x1b'),_0x340a('0x1c'),_0x340a('0x1d'),'disabled','blocked',_0x340a('0x1e'),_0x340a('0x1f')],'where':{'name':_0x12070b,'role':{'$or':[_0x340a('0x20'),_0x340a('0x21'),_0x340a('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0xe7c338){if(!_0xe7c338||_0xe7c338&&_0xe7c338[_0x340a('0x23')]!==_0x12070b){throw new Error(_0x340a('0x15'));}_0x4b145f=_0xe7c338;var _0x4418bf=_0x4b145f[_0x340a('0x23')]+'@'+config[_0x340a('0xc')]['domain'];return adAuthenticate(config[_0x340a('0xc')],_0x4418bf,_0x3aaf46);})[_0x340a('0x18')](function(_0x459a99){if(_0x4b145f['disabled']){throw new Error(_0x340a('0x15'));}if(_0x36c2d7[_0x340a('0x24')]>0x0){if(_0x4b145f[_0x340a('0x25')]){if(moment(_0x4b145f[_0x340a('0x1e')])['add'](_0x36c2d7['blockDuration'],_0x340a('0x26'))>moment()){throw new Error(_0x340a('0x15'));}return utils['clearBlockUser'](_0x4b145f,0x0,![],null)['then'](function(){return utils[_0x340a('0x27')](_0x4b145f);})[_0x340a('0x18')](function(){return _0x529397(null,_0x4b145f);});}else{return utils[_0x340a('0x27')](_0x4b145f)['then'](function(){return _0x529397(null,_0x4b145f);});}}else{return utils[_0x340a('0x27')](_0x4b145f)[_0x340a('0x18')](function(){return _0x529397(null,_0x4b145f);});}})[_0x340a('0x28')](function(_0x596299){return _0x529397(null,![],_0x596299);});}function handleError(_0x2c5d7d,_0x952a95,_0x26ed27){return _0x2c5d7d['status'](_0x952a95||0x1f4)['send']({'message':_0x26ed27?_0x26ed27[_0x340a('0x29')]||_0x26ed27:''});}exports[_0x340a('0x2a')]=function(_0x4f474c,_0x231e00,_0x446b98){passport[_0x340a('0x10')](_0x340a('0x2b'),function(_0xd54679,_0x4e3bc6,_0x351e8a){var _0x2f1ce4=_0xd54679||_0x351e8a;if(_0x2f1ce4){return handleError(_0x231e00,0x191,_0x2f1ce4);}if(!_0x4e3bc6){return handleError(_0x231e00,0x194,{'message':_0x340a('0x2c')});}else{var _0x1c0916={'payload':{'id':_0x4e3bc6['id'],'role':_0x4e3bc6[_0x340a('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x340a('0x2d')](_0x1c0916)[_0x340a('0x18')](function(_0x5c9adf){_0x231e00[_0x340a('0x2e')]({'id':_0x4e3bc6['id'],'token':_0x5c9adf,'statusCall':'','isAlreadyLogged':_0x4e3bc6[_0x340a('0x1f')]});});}})(_0x4f474c,_0x231e00,_0x446b98);};passport['use'](_0x340a('0x2b'),new LocalStrategy({'usernameField':_0x340a('0x23'),'passwordField':_0x340a('0x1b')},function(_0x397831,_0x1cdee6,_0x4b7c19){return ActiveDirectoryAuthenticate(db[_0x340a('0x2f')],_0x397831,_0x1cdee6,_0x4b7c19);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index b654bff..640e0c0 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f7d=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x18c944,_0x4fbff2){var _0x472f3f=function(_0x38b93e){while(--_0x38b93e){_0x18c944['push'](_0x18c944['shift']());}};_0x472f3f(++_0x4fbff2);}(_0x5f7d,0xbb));var _0xd5f7=function(_0x2b6948,_0x548400){_0x2b6948=_0x2b6948-0x0;var _0x1fe750=_0x5f7d[_0x2b6948];return _0x1fe750;};'use strict';var express=require(_0xd5f7('0x0'));var router=express[_0xd5f7('0x1')]();var controller=require(_0xd5f7('0x2'));router[_0xd5f7('0x3')]('/',controller[_0xd5f7('0x4')]);module['exports']=router; \ No newline at end of file +var _0x7e2f=['exports','express','Router','post','login'];(function(_0x116482,_0x35ddae){var _0x56db37=function(_0xc3685c){while(--_0xc3685c){_0x116482['push'](_0x116482['shift']());}};_0x56db37(++_0x35ddae);}(_0x7e2f,0x164));var _0xf7e2=function(_0x100dea,_0x2ca828){_0x100dea=_0x100dea-0x0;var _0x785cb5=_0x7e2f[_0x100dea];return _0x785cb5;};'use strict';var express=require(_0xf7e2('0x0'));var router=express[_0xf7e2('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xf7e2('0x2')]('/',controller[_0xf7e2('0x3')]);module[_0xf7e2('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d9085f4..b8c0c10 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x24f004,_0x40f832){var _0x3f4286=function(_0x478a1a){while(--_0x478a1a){_0x24f004['push'](_0x24f004['shift']());}};_0x3f4286(++_0x40f832);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7a54,0x106));var _0x47a5=function(_0x51d9c4,_0x3d1835){_0x51d9c4=_0x51d9c4-0x0;var _0x1f3b35=_0x7a54[_0x51d9c4];return _0x1f3b35;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index b238447..2dbdf99 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 _0x170d=['login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware'];(function(_0x3fa45b,_0x4b0ef3){var _0x251136=function(_0x5bc70a){while(--_0x5bc70a){_0x3fa45b['push'](_0x3fa45b['shift']());}};_0x251136(++_0x4b0ef3);}(_0x170d,0x13b));var _0xd170=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x170d[_0x59ee6f];return _0x4c0979;};'use strict';var express=require(_0xd170('0x0'));var passport=require(_0xd170('0x1'));var router=express[_0xd170('0x2')]();var controller=require(_0xd170('0x3'));var userController=require(_0xd170('0x4'));var authService=require(_0xd170('0x5'));router['get']('/',controller['login']);router[_0xd170('0x6')]('/callback',controller[_0xd170('0x7')],authService[_0xd170('0x8')],userController[_0xd170('0x9')],authService[_0xd170('0xa')]);module[_0xd170('0xb')]=router; \ No newline at end of file +var _0x433b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','passport','Router'];(function(_0x46744a,_0x5725f9){var _0x3a1d95=function(_0x1b40a7){while(--_0x1b40a7){_0x46744a['push'](_0x46744a['shift']());}};_0x3a1d95(++_0x5725f9);}(_0x433b,0x15c));var _0xb433=function(_0x47c5bd,_0x7605da){_0x47c5bd=_0x47c5bd-0x0;var _0x2447dc=_0x433b[_0x47c5bd];return _0x2447dc;};'use strict';var express=require('express');var passport=require(_0xb433('0x0'));var router=express[_0xb433('0x1')]();var controller=require(_0xb433('0x2'));var userController=require(_0xb433('0x3'));var authService=require(_0xb433('0x4'));router[_0xb433('0x5')]('/',controller[_0xb433('0x6')]);router[_0xb433('0x5')](_0xb433('0x7'),controller[_0xb433('0x8')],authService['isMiddleware'],userController[_0xb433('0x6')],authService[_0xb433('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 464e87e..6ecf4f0 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 _0xb56f=['forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','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','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','use','util','passport','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','merge','format','request','SendMail','error','message','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online'];(function(_0xb050c6,_0x3ee607){var _0x7d06ee=function(_0x37d479){while(--_0x37d479){_0xb050c6['push'](_0xb050c6['shift']());}};_0x7d06ee(++_0x3ee607);}(_0xb56f,0x70));var _0xfb56=function(_0x44c35f,_0x153e3f){_0x44c35f=_0x44c35f-0x0;var _0x415a67=_0xb56f[_0x44c35f];return _0x415a67;};'use strict';var util=require(_0xfb56('0x0'));var passport=require(_0xfb56('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xfb56('0x2'));var _=require(_0xfb56('0x3'));var rs=require(_0xfb56('0x4'));var moment=require(_0xfb56('0x5'));var db=require(_0xfb56('0x6'))['db'];var authService=require(_0xfb56('0x7'));var utils=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232b});function localAuthenticate(_0x690c3a,_0x26c86b,_0xa800c0,_0x328c59){var _0x58274b,_0x1dfea8;return db[_0xfb56('0xb')][_0xfb56('0xc')]({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0x41acc9){_0x58274b=_0x41acc9;return _0x690c3a[_0xfb56('0xc')]({'attributes':['id',_0xfb56('0x10'),_0xfb56('0x11'),'salt','role',_0xfb56('0x12'),'blocked','blockedAt',_0xfb56('0x13')],'where':{'name':_0x26c86b,'role':{'$or':[_0xfb56('0x14'),_0xfb56('0x15'),_0xfb56('0x16')]}}});})[_0xfb56('0xf')](function(_0x4f4a27){if(!_0x4f4a27||_0x4f4a27&&_0x4f4a27[_0xfb56('0x10')]!==_0x26c86b){throw new Error(_0xfb56('0x17'));}else{_0x1dfea8=_0x4f4a27;return _0x1dfea8;}})[_0xfb56('0xf')](function(){_0x1dfea8[_0xfb56('0x18')](_0xa800c0,function(_0x200d89,_0x1407b6){var _0x345da0=_0x1dfea8[_0xfb56('0x13')]+0x1;if(_0x200d89){return _0x328c59(_0x200d89);}else if(!_0x1407b6){if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8['blocked']){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b['blockDuration'],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x345da0>=_0x58274b[_0xfb56('0xd')]){return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,!![],moment())[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)['then'](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8[_0xfb56('0x1d')]){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);})[_0xfb56('0x1f')](function(_0x16ebfb){return _0x328c59(null,![],_0x16ebfb);});}}else{if(_0x1dfea8[_0xfb56('0x1d')]){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1e')](_0x1dfea8)[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}}});})[_0xfb56('0x1f')](function(_0x3a0cc5){return _0x328c59(null,![],_0x3a0cc5);});}function sendServiceMail(_0xc6f4dc){return db[_0xfb56('0x20')][_0xfb56('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0xfb56('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xfb56('0x23'),'include':[{'model':db[_0xfb56('0x24')],'as':_0xfb56('0x24')}]}]})[_0xfb56('0xf')](function(_0x305503){if(!_0x305503){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3c2fc0=_0x305503[_0xfb56('0x25')]();var _0x1117d5={'account':_0x3c2fc0,'message':_[_0xfb56('0x26')]({'from':util[_0xfb56('0x27')]('\x22%s\x22\x20<%s>',_0x305503[_0xfb56('0x10')],_0x305503[_0xfb56('0x22')]||_0x305503[_0xfb56('0x23')][_0xfb56('0x15')])},_0xc6f4dc)};return client[_0xfb56('0x28')](_0xfb56('0x29'),_0x1117d5);})[_0xfb56('0xf')](function(_0x598b0d){if(_0x598b0d[_0xfb56('0x2a')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x598b0d[_0xfb56('0x2a')][_0xfb56('0x2b')]||JSON[_0xfb56('0x2c')](_0x598b0d[_0xfb56('0x2a')])));}return!![];});}function handleError(_0xefea57,_0x1e7655,_0x39323c){return _0xefea57[_0xfb56('0x2d')](_0x1e7655||0x1f4)[_0xfb56('0x2e')]({'message':_0x39323c?_0x39323c['message']||_0x39323c:''});}exports['login']=function(_0x36b3f9,_0xcdf580,_0x531c86){passport['authenticate']('local-login',function(_0x230db5,_0x597c12,_0x5381e3){var _0xad2345=_0x230db5||_0x5381e3;if(_0xad2345){return handleError(_0xcdf580,0x191,_0xad2345);}if(!_0x597c12){return handleError(_0xcdf580,0x194,{'message':_0xfb56('0x2f')});}else{var _0x559e50={'payload':{'id':_0x597c12['id'],'role':_0x597c12[_0xfb56('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xfb56('0x31')](_0x559e50)[_0xfb56('0xf')](function(_0x4a9ded){_0xcdf580[_0xfb56('0x32')]({'id':_0x597c12['id'],'token':_0x4a9ded,'statusCall':'','isAlreadyLogged':_0x597c12[_0xfb56('0x33')]});});}})(_0x36b3f9,_0xcdf580,_0x531c86);};exports[_0xfb56('0x34')]=function(_0xfe7b16,_0xc4a936){if(!_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')]){return handleError(_0xc4a936,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x40541e=rs[_0xfb56('0x36')]();_0xfe7b16[_0xfb56('0x35')]['email']=_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')][_0xfb56('0x37')]()['toLowerCase']();var _0x3e7750;return db[_0xfb56('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0xb9975f){_0x3e7750=_0xb9975f;return db[_0xfb56('0x38')]['find']({'where':{'email':_0xfe7b16[_0xfb56('0x35')]['email']}});})[_0xfb56('0xf')](function(_0x42be24){if(!_0x42be24){throw new Error(_0xfb56('0x39'));}if(_0x42be24[_0xfb56('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x42be24[_0xfb56('0x1d')]){if(moment(_0x42be24[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x3e7750[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x42be24['blocked']=![];_0x42be24[_0xfb56('0x19')]=null;}}_0x42be24['resetPasswordToken']=_0x40541e;_0x42be24['resetPasswordExpires']=Date[_0xfb56('0x3a')]()+0x36ee80;return _0x42be24['save']();})[_0xfb56('0xf')](function(){return sendServiceMail({'to':_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')],'subject':_0xfb56('0x3b'),'text':_0xfb56('0x3c')+_0xfb56('0x3d')+_0xfb56('0x3e')+_0xfe7b16[_0xfb56('0x3f')][_0xfb56('0x40')]+'/reset/'+_0x40541e+'\x0a\x0a'+_0xfb56('0x41')});})['then'](function(){_0xc4a936[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x42')});})[_0xfb56('0x1f')](function(_0x388e31){return handleError(_0xc4a936,0x1f4,_0x388e31);});};exports[_0xfb56('0x43')]=function(_0xb452bd,_0xc094fd){return db[_0xfb56('0x38')][_0xfb56('0x21')]({'where':{'resetPasswordToken':_0xb452bd[_0xfb56('0x44')][_0xfb56('0x45')],'resetPasswordExpires':{'$gt':Date[_0xfb56('0x3a')]()}}})[_0xfb56('0xf')](function(_0x28dfc0){if(!_0x28dfc0){throw new Error(_0xfb56('0x46'));}return db[_0xfb56('0xb')]['findOne']({'attributes':['id',_0xfb56('0x47'),_0xfb56('0x48'),_0xfb56('0x49')]})[_0xfb56('0xf')](function(_0x3060a7){if(_0x3060a7[_0xfb56('0x47')])authService[_0xfb56('0x4a')](_0xb452bd[_0xfb56('0x35')][_0xfb56('0x11')]);if(!_0x3060a7[_0xfb56('0x48')]||!_0x28dfc0[_0xfb56('0x4b')])return _0x28dfc0;authService[_0xfb56('0x4c')](_0xb452bd['body'][_0xfb56('0x11')],_0x28dfc0['previousPasswords'],_0x3060a7[_0xfb56('0x49')]);return _0x28dfc0;})[_0xfb56('0xf')](function(){_0x28dfc0[_0xfb56('0x11')]=_0xb452bd[_0xfb56('0x35')]['password'];_0x28dfc0[_0xfb56('0x4d')]=null;_0x28dfc0[_0xfb56('0x4e')]=null;return _0x28dfc0[_0xfb56('0x4f')]();});})[_0xfb56('0xf')](function(){_0xc094fd[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x50')});})['catch'](function(_0x432f34){return handleError(_0xc094fd,0x1f4,_0x432f34);});};passport[_0xfb56('0x51')]('local-login',new LocalStrategy({'usernameField':_0xfb56('0x10'),'passwordField':_0xfb56('0x11')},function(_0x6b1ab6,_0x4f258b,_0x54ff23){return localAuthenticate(db[_0xfb56('0x38')],_0x6b1ab6,_0x4f258b,_0x54ff23);})); \ No newline at end of file +var _0x310f=['resetPasswordToken','resetPasswordExpires','Password\x20reset!','util','passport-local','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','name','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory'];(function(_0x22574c,_0x416cfd){var _0x38a919=function(_0x164633){while(--_0x164633){_0x22574c['push'](_0x22574c['shift']());}};_0x38a919(++_0x416cfd);}(_0x310f,0xf9));var _0xf310=function(_0x2ba3a2,_0x27b815){_0x2ba3a2=_0x2ba3a2-0x0;var _0x25870e=_0x310f[_0x2ba3a2];return _0x25870e;};'use strict';var util=require(_0xf310('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf310('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xf310('0x2'));var moment=require(_0xf310('0x3'));var db=require(_0xf310('0x4'))['db'];var authService=require(_0xf310('0x5'));var utils=require(_0xf310('0x6'));var client=jayson['client'][_0xf310('0x7')]({'port':0x232b});function localAuthenticate(_0x8bbf06,_0x39ec73,_0x4d7965,_0x608a73){var _0x5c90c6,_0x31eff2;return db[_0xf310('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xf310('0x9'),_0xf310('0xa')],'raw':!![]})[_0xf310('0xb')](function(_0x33ed89){_0x5c90c6=_0x33ed89;return _0x8bbf06[_0xf310('0xc')]({'attributes':['id','name',_0xf310('0xd'),_0xf310('0xe'),'role','disabled',_0xf310('0xf'),_0xf310('0x10'),_0xf310('0x11')],'where':{'name':_0x39ec73,'role':{'$or':[_0xf310('0x12'),_0xf310('0x13'),_0xf310('0x14')]}}});})[_0xf310('0xb')](function(_0x569925){if(!_0x569925||_0x569925&&_0x569925['name']!==_0x39ec73){throw new Error(_0xf310('0x15'));}else{_0x31eff2=_0x569925;return _0x31eff2;}})[_0xf310('0xb')](function(){_0x31eff2[_0xf310('0x16')](_0x4d7965,function(_0x2bd0ed,_0x5330ca){var _0x743d40=_0x31eff2[_0xf310('0x11')]+0x1;if(_0x2bd0ed){return _0x608a73(_0x2bd0ed);}else if(!_0x5330ca){if(_0x31eff2[_0xf310('0x17')]){return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5c90c6[_0xf310('0x9')]>0x0){if(_0x31eff2['blocked']){if(_0x5c90c6['blockDuration']>0x0){if(moment(_0x31eff2['blockedAt'])[_0xf310('0x18')](_0x5c90c6['blockDuration'],_0xf310('0x19'))>moment()){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils['clearBlockUser'](_0x31eff2,_0x743d40,![],null)[_0xf310('0xb')](function(){return _0x608a73(null,![],{'message':_0xf310('0x15')});});}}else{return _0x608a73(null,![],{'message':_0xf310('0x15')});}}else{if(_0x743d40>=_0x5c90c6[_0xf310('0x9')]){return utils[_0xf310('0x1a')](_0x31eff2,0x0,!![],moment())['then'](function(){return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf310('0x1a')](_0x31eff2,_0x743d40,![],null)[_0xf310('0xb')](function(){return _0x608a73(null,![],{'message':_0xf310('0x15')});});}}}else{return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x31eff2[_0xf310('0x17')]){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else if(_0x5c90c6['allowedLoginAttempts']>0x0){if(_0x31eff2[_0xf310('0xf')]){if(_0x5c90c6[_0xf310('0xa')]>0x0){if(moment(_0x31eff2[_0xf310('0x10')])[_0xf310('0x18')](_0x5c90c6[_0xf310('0xa')],_0xf310('0x19'))>moment()){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils[_0xf310('0x1a')](_0x31eff2,0x0,![],null)['then'](function(){return utils[_0xf310('0x1b')](_0x31eff2);})[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);});}}else{return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xf310('0x1a')](_0x31eff2,0x0,![],null)[_0xf310('0xb')](function(){return utils[_0xf310('0x1b')](_0x31eff2);})[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);})[_0xf310('0x1c')](function(_0x258fdb){return _0x608a73(null,![],_0x258fdb);});}}else{if(_0x31eff2[_0xf310('0xf')]){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils[_0xf310('0x1b')](_0x31eff2)[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);});}}}});})[_0xf310('0x1c')](function(_0x19bb3c){return _0x608a73(null,![],_0x19bb3c);});}function sendServiceMail(_0x2d5d60){return db[_0xf310('0x1d')][_0xf310('0x1e')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xf310('0x1f'),'include':[{'model':db['CloudProvider'],'as':_0xf310('0x20')}]}]})[_0xf310('0xb')](function(_0x1aca71){if(!_0x1aca71){throw new Error(_0xf310('0x21'));}var _0x462979=_0x1aca71[_0xf310('0x22')]();var _0x23ea19={'account':_0x462979,'message':_[_0xf310('0x23')]({'from':util[_0xf310('0x24')]('\x22%s\x22\x20<%s>',_0x1aca71[_0xf310('0x25')],_0x1aca71[_0xf310('0x26')]||_0x1aca71[_0xf310('0x1f')][_0xf310('0x13')])},_0x2d5d60)};return client[_0xf310('0x27')](_0xf310('0x28'),_0x23ea19);})[_0xf310('0xb')](function(_0x2ca45f){if(_0x2ca45f[_0xf310('0x29')]){throw new Error(util[_0xf310('0x24')](_0xf310('0x2a'),_0x2ca45f[_0xf310('0x29')][_0xf310('0x2b')]||JSON[_0xf310('0x2c')](_0x2ca45f[_0xf310('0x29')])));}return!![];});}function handleError(_0x288cf2,_0x1a1fb4,_0x49b461){return _0x288cf2[_0xf310('0x2d')](_0x1a1fb4||0x1f4)[_0xf310('0x2e')]({'message':_0x49b461?_0x49b461[_0xf310('0x2b')]||_0x49b461:''});}exports[_0xf310('0x2f')]=function(_0x223cda,_0x2eb74a,_0x4b3133){passport[_0xf310('0x16')](_0xf310('0x30'),function(_0x3d12c1,_0x29445a,_0x36fbd1){var _0xe943d5=_0x3d12c1||_0x36fbd1;if(_0xe943d5){return handleError(_0x2eb74a,0x191,_0xe943d5);}if(!_0x29445a){return handleError(_0x2eb74a,0x194,{'message':_0xf310('0x31')});}else{var _0x63851f={'payload':{'id':_0x29445a['id'],'role':_0x29445a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x63851f)[_0xf310('0xb')](function(_0x2ec5e0){_0x2eb74a[_0xf310('0x32')]({'id':_0x29445a['id'],'token':_0x2ec5e0,'statusCall':'','isAlreadyLogged':_0x29445a[_0xf310('0x33')]});});}})(_0x223cda,_0x2eb74a,_0x4b3133);};exports['forgot']=function(_0x3e1cf7,_0x3e3950){if(!_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]){return handleError(_0x3e3950,0x1f4,{'message':_0xf310('0x35')});}var _0x402999=rs[_0xf310('0x36')]();_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]=_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')][_0xf310('0x37')]()[_0xf310('0x38')]();var _0x152c06;return db[_0xf310('0x8')][_0xf310('0xc')]({'where':{'id':0x1},'attributes':[_0xf310('0x9'),_0xf310('0xa')],'raw':!![]})[_0xf310('0xb')](function(_0xc6094a){_0x152c06=_0xc6094a;return db[_0xf310('0x39')][_0xf310('0x1e')]({'where':{'email':_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]}});})[_0xf310('0xb')](function(_0x3307a4){if(!_0x3307a4){throw new Error(_0xf310('0x3a'));}if(_0x3307a4[_0xf310('0x17')]){throw new Error(_0xf310('0x3b'));}if(_0x3307a4['blocked']){if(moment(_0x3307a4[_0xf310('0x10')])[_0xf310('0x18')](_0x152c06[_0xf310('0xa')],_0xf310('0x19'))>moment()){throw new Error(_0xf310('0x3c'));}else{_0x3307a4[_0xf310('0xf')]=![];_0x3307a4[_0xf310('0x10')]=null;}}_0x3307a4['resetPasswordToken']=_0x402999;_0x3307a4['resetPasswordExpires']=Date[_0xf310('0x3d')]()+0x36ee80;return _0x3307a4[_0xf310('0x3e')]();})[_0xf310('0xb')](function(){return sendServiceMail({'to':_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')],'subject':_0xf310('0x3f'),'text':_0xf310('0x40')+_0xf310('0x41')+_0xf310('0x42')+_0x3e1cf7[_0xf310('0x43')][_0xf310('0x44')]+'/reset/'+_0x402999+'\x0a\x0a'+_0xf310('0x45')});})['then'](function(){_0x3e3950[_0xf310('0x2d')](0xc8)[_0xf310('0x2e')]({'message':_0xf310('0x46')});})[_0xf310('0x1c')](function(_0x31aead){return handleError(_0x3e3950,0x1f4,_0x31aead);});};exports['reset']=function(_0x24ac9a,_0x5ad28f){return db[_0xf310('0x39')][_0xf310('0x1e')]({'where':{'resetPasswordToken':_0x24ac9a[_0xf310('0x47')][_0xf310('0x48')],'resetPasswordExpires':{'$gt':Date[_0xf310('0x3d')]()}}})[_0xf310('0xb')](function(_0xb10fc7){if(!_0xb10fc7){throw new Error(_0xf310('0x49'));}return db[_0xf310('0x8')]['findOne']({'attributes':['id','securePassword',_0xf310('0x4a'),_0xf310('0x4b')]})[_0xf310('0xb')](function(_0x170f3e){if(_0x170f3e[_0xf310('0x4c')])authService[_0xf310('0x4d')](_0x24ac9a['body'][_0xf310('0xd')]);if(!_0x170f3e[_0xf310('0x4a')]||!_0xb10fc7['previousPasswords'])return _0xb10fc7;authService[_0xf310('0x4e')](_0x24ac9a[_0xf310('0x34')][_0xf310('0xd')],_0xb10fc7['previousPasswords'],_0x170f3e[_0xf310('0x4b')]);return _0xb10fc7;})['then'](function(){_0xb10fc7[_0xf310('0xd')]=_0x24ac9a['body'][_0xf310('0xd')];_0xb10fc7[_0xf310('0x4f')]=null;_0xb10fc7[_0xf310('0x50')]=null;return _0xb10fc7[_0xf310('0x3e')]();});})[_0xf310('0xb')](function(){_0x5ad28f[_0xf310('0x2d')](0xc8)[_0xf310('0x2e')]({'message':_0xf310('0x51')});})[_0xf310('0x1c')](function(_0x4ddc4c){return handleError(_0x5ad28f,0x1f4,_0x4ddc4c);});};passport['use'](_0xf310('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0xf310('0xd')},function(_0x324b6b,_0x4ae829,_0x154be5){return localAuthenticate(db[_0xf310('0x39')],_0x324b6b,_0x4ae829,_0x154be5);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 514064e..8d0126c 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 _0x1cb4=['post','login','/forgot','forgot','/reset/:token','express','Router'];(function(_0x347ae8,_0x55e717){var _0x109fb6=function(_0x4657fc){while(--_0x4657fc){_0x347ae8['push'](_0x347ae8['shift']());}};_0x109fb6(++_0x55e717);}(_0x1cb4,0x18d));var _0x41cb=function(_0x774780,_0x3012aa){_0x774780=_0x774780-0x0;var _0x596b9a=_0x1cb4[_0x774780];return _0x596b9a;};'use strict';var express=require(_0x41cb('0x0'));var router=express[_0x41cb('0x1')]();var controller=require('./authLocal.controller');router[_0x41cb('0x2')]('/',controller[_0x41cb('0x3')]);router[_0x41cb('0x2')](_0x41cb('0x4'),controller[_0x41cb('0x5')]);router['post'](_0x41cb('0x6'),controller['reset']);module['exports']=router; \ No newline at end of file +var _0xf8f5=['exports','Router','./authLocal.controller','login','post','reset'];(function(_0x59591b,_0x354045){var _0x576642=function(_0x12d1ce){while(--_0x12d1ce){_0x59591b['push'](_0x59591b['shift']());}};_0x576642(++_0x354045);}(_0xf8f5,0x13f));var _0x5f8f=function(_0x1e80f9,_0xa68ab1){_0x1e80f9=_0x1e80f9-0x0;var _0x46f8f5=_0xf8f5[_0x1e80f9];return _0x46f8f5;};'use strict';var express=require('express');var router=express[_0x5f8f('0x0')]();var controller=require(_0x5f8f('0x1'));router['post']('/',controller[_0x5f8f('0x2')]);router[_0x5f8f('0x3')]('/forgot',controller['forgot']);router[_0x5f8f('0x3')]('/reset/:token',controller[_0x5f8f('0x4')]);module[_0x5f8f('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 c261b45..ccba078 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 _0x8fe8=['sequelize','exports','STRING','INTEGER'];(function(_0x21b49a,_0x4a930c){var _0x2e0492=function(_0x4fb37e){while(--_0x4fb37e){_0x21b49a['push'](_0x21b49a['shift']());}};_0x2e0492(++_0x4a930c);}(_0x8fe8,0x100));var _0x88fe=function(_0x67d9d7,_0x49b147){_0x67d9d7=_0x67d9d7-0x0;var _0x2a7c7f=_0x8fe8[_0x67d9d7];return _0x2a7c7f;};'use strict';var Sequelize=require(_0x88fe('0x0'));module[_0x88fe('0x1')]={'name':{'type':Sequelize[_0x88fe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x88fe('0x2')]},'description':{'type':Sequelize[_0x88fe('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x88fe('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3511=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x3511,0x1c2));var _0x1351=function(_0x5ecac1,_0x2d7338){_0x5ecac1=_0x5ecac1-0x0;var _0x1fe487=_0x3511[_0x5ecac1];return _0x1fe487;};'use strict';var Sequelize=require(_0x1351('0x0'));module[_0x1351('0x1')]={'name':{'type':Sequelize[_0x1351('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1351('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1351('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 44b1326..2239a5a 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 _0x7943=['Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','rows','show','params','includeAll','catch','create','body','Condition','addConditions','ids','omit','getConditions','findOne','merge','addActions','Action','find','getActions','eml-format','zip-dir','request-promise','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/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7943,0x7e));var _0x3794=function(_0x831dc4,_0x1877c9){_0x831dc4=_0x831dc4-0x0;var _0x4087eb=_0x7943[_0x831dc4];return _0x4087eb;};'use strict';var emlformat=require(_0x3794('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3794('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3794('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3794('0x3'));var util=require('util');var path=require(_0x3794('0x4'));var sox=require(_0x3794('0x5'));var csv=require(_0x3794('0x6'));var ejs=require(_0x3794('0x7'));var fs=require('fs');var fs_extra=require(_0x3794('0x8'));var _=require(_0x3794('0x9'));var squel=require(_0x3794('0xa'));var crypto=require(_0x3794('0xb'));var jsforce=require(_0x3794('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3794('0x6'));var querystring=require(_0x3794('0xd'));var Papa=require(_0x3794('0xe'));var Redis=require(_0x3794('0xf'));var authService=require(_0x3794('0x10'));var qs=require(_0x3794('0x11'));var as=require(_0x3794('0x12'));var hardwareService=require(_0x3794('0x13'));var logger=require('../../config/logger')(_0x3794('0x14'));var utils=require(_0x3794('0x15'));var config=require(_0x3794('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3794('0x17'))['db'];function respondWithStatusCode(_0x22b5e5,_0x5e0a2d){_0x5e0a2d=_0x5e0a2d||0xcc;return function(_0x15dbbd){if(_0x15dbbd){return _0x22b5e5['sendStatus'](_0x5e0a2d);}return _0x22b5e5[_0x3794('0x18')](_0x5e0a2d)[_0x3794('0x19')]();};}function respondWithResult(_0x115f2c,_0xa08c4d){_0xa08c4d=_0xa08c4d||0xc8;return function(_0x1e1b64){if(_0x1e1b64){return _0x115f2c[_0x3794('0x18')](_0xa08c4d)['json'](_0x1e1b64);}};}function respondWithFilteredResult(_0x3e6f44,_0x27dcdf){return function(_0xa81d2a){if(_0xa81d2a){var _0x15a95d=typeof _0x27dcdf[_0x3794('0x1a')]==='undefined'&&typeof _0x27dcdf[_0x3794('0x1b')]===_0x3794('0x1c');var _0x315758=_0xa81d2a[_0x3794('0x1d')];var _0x1ecb34=_0x15a95d?0x0:_0x27dcdf[_0x3794('0x1a')];var _0x577fbe=_0x15a95d?_0xa81d2a[_0x3794('0x1d')]:_0x27dcdf[_0x3794('0x1a')]+_0x27dcdf[_0x3794('0x1b')];var _0x5499c2;if(_0x577fbe>=_0x315758){_0x577fbe=_0x315758;_0x5499c2=0xc8;}else{_0x5499c2=0xce;}_0x3e6f44[_0x3794('0x18')](_0x5499c2);return _0x3e6f44['set'](_0x3794('0x1e'),_0x1ecb34+'-'+_0x577fbe+'/'+_0x315758)[_0x3794('0x1f')](_0xa81d2a);}return null;};}function patchUpdates(_0x4453c1){return function(_0x130f4f){try{jsonpatch['apply'](_0x130f4f,_0x4453c1,!![]);}catch(_0x234a03){return BPromise['reject'](_0x234a03);}return _0x130f4f[_0x3794('0x20')]();};}function saveUpdates(_0x2e6b67,_0x16b26e){return function(_0x58a970){if(_0x58a970){return _0x58a970[_0x3794('0x21')](_0x2e6b67)[_0x3794('0x22')](function(_0x3f60c9){return _0x3f60c9;});}return null;};}function removeEntity(_0x49dc47,_0x2497eb){return function(_0x42f162){if(_0x42f162){return _0x42f162[_0x3794('0x23')]()['then'](function(){_0x49dc47[_0x3794('0x18')](0xcc)[_0x3794('0x19')]();});}};}function handleEntityNotFound(_0x5ee5f0,_0x2bdc0a){return function(_0x56b3dc){if(!_0x56b3dc){_0x5ee5f0[_0x3794('0x24')](0x194);}return _0x56b3dc;};}function handleError(_0x5eddd5,_0xdbe130){_0xdbe130=_0xdbe130||0x1f4;return function(_0x285eb9){logger[_0x3794('0x25')](_0x285eb9[_0x3794('0x26')]);if(_0x285eb9[_0x3794('0x27')]){delete _0x285eb9[_0x3794('0x27')];}_0x5eddd5[_0x3794('0x18')](_0xdbe130)[_0x3794('0x28')](_0x285eb9);};}exports[_0x3794('0x29')]=function(_0x44fe69,_0x2045f5){var _0x3a3c8a={},_0x5a3e70={},_0x434dc3={'count':0x0,'rows':[]};var _0x1025a0=_['map'](db[_0x3794('0x2a')][_0x3794('0x2b')],function(_0x180f9f){return{'name':_0x180f9f[_0x3794('0x2c')],'type':_0x180f9f[_0x3794('0x2d')][_0x3794('0x2e')]};});_0x5a3e70['model']=_[_0x3794('0x2f')](_0x1025a0,_0x3794('0x27'));_0x5a3e70[_0x3794('0x30')]=_[_0x3794('0x31')](_0x44fe69[_0x3794('0x30')]);_0x5a3e70[_0x3794('0x32')]=_[_0x3794('0x33')](_0x5a3e70['model'],_0x5a3e70[_0x3794('0x30')]);_0x3a3c8a['attributes']=_[_0x3794('0x33')](_0x5a3e70[_0x3794('0x34')],qs[_0x3794('0x35')](_0x44fe69[_0x3794('0x30')]['fields']));_0x3a3c8a[_0x3794('0x36')]=_0x3a3c8a[_0x3794('0x36')][_0x3794('0x37')]?_0x3a3c8a['attributes']:_0x5a3e70[_0x3794('0x34')];if(!_0x44fe69[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x3a3c8a[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x1b')]);_0x3a3c8a[_0x3794('0x1a')]=qs['offset'](_0x44fe69[_0x3794('0x30')][_0x3794('0x1a')]);}_0x3a3c8a[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x3b')]);_0x3a3c8a[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x44fe69[_0x3794('0x30')],_0x5a3e70['filters']),_0x1025a0);if(_0x44fe69[_0x3794('0x30')][_0x3794('0x3e')]){_0x3a3c8a['where']=_['merge'](_0x3a3c8a[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1025a0,function(_0x5209c1){if(_0x5209c1[_0x3794('0x2d')]!=='VIRTUAL'){var _0x44414f={};_0x44414f[_0x5209c1[_0x3794('0x27')]]={'$like':'%'+_0x44fe69['query'][_0x3794('0x3e')]+'%'};return _0x44414f;}})});}_0x3a3c8a=_['merge']({},_0x3a3c8a,_0x44fe69[_0x3794('0x3f')]);var _0x301e21={'where':_0x3a3c8a[_0x3794('0x3c')]};return db[_0x3794('0x2a')][_0x3794('0x1d')](_0x301e21)[_0x3794('0x22')](function(_0x4f3808){_0x434dc3[_0x3794('0x1d')]=_0x4f3808;if(_0x44fe69[_0x3794('0x30')]['includeAll']){_0x3a3c8a[_0x3794('0x40')]=[{'all':!![]}];}return db[_0x3794('0x2a')][_0x3794('0x41')](_0x3a3c8a);})[_0x3794('0x22')](function(_0x188785){_0x434dc3[_0x3794('0x42')]=_0x188785;return _0x434dc3;})[_0x3794('0x22')](respondWithFilteredResult(_0x2045f5,_0x3a3c8a))['catch'](handleError(_0x2045f5,null));};exports[_0x3794('0x43')]=function(_0x3b2237,_0x357d97){var _0x36f023={'raw':![],'where':{'id':_0x3b2237[_0x3794('0x44')]['id']}},_0x30cdda={};_0x30cdda[_0x3794('0x34')]=_[_0x3794('0x31')](db['Automation'][_0x3794('0x2b')]);_0x30cdda[_0x3794('0x30')]=_['keys'](_0x3b2237[_0x3794('0x30')]);_0x30cdda['filters']=_[_0x3794('0x33')](_0x30cdda[_0x3794('0x34')],_0x30cdda['query']);_0x36f023['attributes']=_['intersection'](_0x30cdda[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3b2237[_0x3794('0x30')]['fields']));_0x36f023[_0x3794('0x36')]=_0x36f023[_0x3794('0x36')]['length']?_0x36f023[_0x3794('0x36')]:_0x30cdda[_0x3794('0x34')];if(_0x3b2237['query'][_0x3794('0x45')]){_0x36f023[_0x3794('0x40')]=[{'all':!![]}];}_0x36f023=_['merge']({},_0x36f023,_0x3b2237[_0x3794('0x3f')]);return db[_0x3794('0x2a')]['find'](_0x36f023)[_0x3794('0x22')](handleEntityNotFound(_0x357d97,null))[_0x3794('0x22')](respondWithResult(_0x357d97,null))[_0x3794('0x46')](handleError(_0x357d97,null));};exports[_0x3794('0x47')]=function(_0x454149,_0x479fb1){return db['Automation'][_0x3794('0x47')](_0x454149[_0x3794('0x48')],{})[_0x3794('0x22')](respondWithResult(_0x479fb1,0xc9))[_0x3794('0x46')](handleError(_0x479fb1,null));};exports[_0x3794('0x21')]=function(_0x4f1dd5,_0x2a3a70){if(_0x4f1dd5['body']['id']){delete _0x4f1dd5[_0x3794('0x48')]['id'];}return db[_0x3794('0x2a')]['find']({'where':{'id':_0x4f1dd5[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x2a3a70,null))[_0x3794('0x22')](saveUpdates(_0x4f1dd5['body'],null))['then'](respondWithResult(_0x2a3a70,null))[_0x3794('0x46')](handleError(_0x2a3a70,null));};exports[_0x3794('0x23')]=function(_0x453b42,_0x22f277){return db['Automation']['find']({'where':{'id':_0x453b42[_0x3794('0x44')]['id']}})['then'](handleEntityNotFound(_0x22f277,null))[_0x3794('0x22')](removeEntity(_0x22f277,null))[_0x3794('0x46')](handleError(_0x22f277,null));};exports['addConditions']=function(_0x57d1dd,_0x10a779,_0x1fcf7e){return db[_0x3794('0x49')]['find']({'where':{'id':_0x57d1dd['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x10a779,null))[_0x3794('0x22')](function(_0x1f2d79){if(_0x1f2d79){return _0x1f2d79[_0x3794('0x4a')](_0x57d1dd[_0x3794('0x48')][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x57d1dd[_0x3794('0x48')],[_0x3794('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x10a779,null))['catch'](handleError(_0x10a779,null));};exports[_0x3794('0x4d')]=function(_0x541ceb,_0x4f0b1b,_0x499208){var _0x1567b8={};var _0x30ea87={};var _0x1aed29;var _0x3ac82d;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x541ceb['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x4f0b1b,null))[_0x3794('0x22')](function(_0x6ca493){if(_0x6ca493){_0x1aed29=_0x6ca493;_0x30ea87[_0x3794('0x34')]=_[_0x3794('0x31')](db['Condition'][_0x3794('0x2b')]);_0x30ea87['query']=_[_0x3794('0x31')](_0x541ceb[_0x3794('0x30')]);_0x30ea87['filters']=_['intersection'](_0x30ea87[_0x3794('0x34')],_0x30ea87[_0x3794('0x30')]);_0x1567b8[_0x3794('0x36')]=_[_0x3794('0x33')](_0x30ea87[_0x3794('0x34')],qs[_0x3794('0x35')](_0x541ceb['query'][_0x3794('0x35')]));_0x1567b8['attributes']=_0x1567b8[_0x3794('0x36')][_0x3794('0x37')]?_0x1567b8[_0x3794('0x36')]:_0x30ea87[_0x3794('0x34')];_0x1567b8[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x3b')]);_0x1567b8[_0x3794('0x3c')]=qs[_0x3794('0x32')](_['pick'](_0x541ceb['query'],_0x30ea87[_0x3794('0x32')]));if(_0x541ceb[_0x3794('0x30')][_0x3794('0x3e')]){_0x1567b8['where']=_[_0x3794('0x4f')](_0x1567b8[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1567b8[_0x3794('0x36')],function(_0x5d9fac){var _0x1a129e={};_0x1a129e[_0x5d9fac]={'$like':'%'+_0x541ceb['query'][_0x3794('0x3e')]+'%'};return _0x1a129e;})});}_0x1567b8=_[_0x3794('0x4f')]({},_0x1567b8,_0x541ceb[_0x3794('0x3f')]);return _0x1aed29[_0x3794('0x4d')](_0x1567b8);}})[_0x3794('0x22')](function(_0x43a89e){if(_0x43a89e){_0x3ac82d=_0x43a89e['length'];if(!_0x541ceb[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x1567b8[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1b')]);_0x1567b8['offset']=qs[_0x3794('0x1a')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x1aed29['getConditions'](_0x1567b8);}})[_0x3794('0x22')](function(_0xb0bb53){if(_0xb0bb53){return _0xb0bb53?{'count':_0x3ac82d,'rows':_0xb0bb53}:null;}})['then'](respondWithResult(_0x4f0b1b,null))[_0x3794('0x46')](handleError(_0x4f0b1b,null));};exports[_0x3794('0x50')]=function(_0x6b7f9c,_0x3c6579,_0x54f51e){return db[_0x3794('0x51')][_0x3794('0x52')]({'where':{'id':_0x6b7f9c[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3c6579,null))[_0x3794('0x22')](function(_0x2a9144){if(_0x2a9144){return _0x2a9144[_0x3794('0x50')](_0x6b7f9c['body'][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x6b7f9c[_0x3794('0x48')],['ids','id'])||{});}})[_0x3794('0x22')](respondWithResult(_0x3c6579,null))[_0x3794('0x46')](handleError(_0x3c6579,null));};exports[_0x3794('0x53')]=function(_0x3a1fac,_0x3f0393,_0x272886){var _0x544618={};var _0xa68b2={};var _0x2ee4de;var _0x48a57a;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x3a1fac[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3f0393,null))[_0x3794('0x22')](function(_0x123dde){if(_0x123dde){_0x2ee4de=_0x123dde;_0xa68b2[_0x3794('0x34')]=_[_0x3794('0x31')](db[_0x3794('0x51')][_0x3794('0x2b')]);_0xa68b2[_0x3794('0x30')]=_[_0x3794('0x31')](_0x3a1fac[_0x3794('0x30')]);_0xa68b2[_0x3794('0x32')]=_['intersection'](_0xa68b2['model'],_0xa68b2['query']);_0x544618[_0x3794('0x36')]=_['intersection'](_0xa68b2[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3a1fac['query'][_0x3794('0x35')]));_0x544618[_0x3794('0x36')]=_0x544618[_0x3794('0x36')][_0x3794('0x37')]?_0x544618[_0x3794('0x36')]:_0xa68b2[_0x3794('0x34')];_0x544618[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x3b')]);_0x544618[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x3a1fac[_0x3794('0x30')],_0xa68b2[_0x3794('0x32')]));if(_0x3a1fac[_0x3794('0x30')]['filter']){_0x544618[_0x3794('0x3c')]=_[_0x3794('0x4f')](_0x544618[_0x3794('0x3c')],{'$or':_['map'](_0x544618[_0x3794('0x36')],function(_0x4c5042){var _0x3d902d={};_0x3d902d[_0x4c5042]={'$like':'%'+_0x3a1fac[_0x3794('0x30')][_0x3794('0x3e')]+'%'};return _0x3d902d;})});}_0x544618=_[_0x3794('0x4f')]({},_0x544618,_0x3a1fac[_0x3794('0x3f')]);return _0x2ee4de[_0x3794('0x53')](_0x544618);}})[_0x3794('0x22')](function(_0x5b1a54){if(_0x5b1a54){_0x48a57a=_0x5b1a54[_0x3794('0x37')];if(!_0x3a1fac[_0x3794('0x30')]['hasOwnProperty']('nolimit')){_0x544618[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1b')]);_0x544618[_0x3794('0x1a')]=qs['offset'](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x2ee4de['getActions'](_0x544618);}})[_0x3794('0x22')](function(_0x5035cf){if(_0x5035cf){return _0x5035cf?{'count':_0x48a57a,'rows':_0x5035cf}:null;}})['then'](respondWithResult(_0x3f0393,null))[_0x3794('0x46')](handleError(_0x3f0393,null));}; \ No newline at end of file +var _0x08ff=['name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','findAll','catch','length','find','create','body','params','destroy','Condition','addConditions','ids','omit','getConditions','filter','addActions','getActions','findOne','Action','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','reject','save','update','then','error','stack','send','index','map','Automation','rawAttributes','fieldName','key','model'];(function(_0x5177c4,_0x1a76ab){var _0x6be752=function(_0x2269a3){while(--_0x2269a3){_0x5177c4['push'](_0x5177c4['shift']());}};_0x6be752(++_0x1a76ab);}(_0x08ff,0xbc));var _0xf08f=function(_0x23f5f6,_0x3950b2){_0x23f5f6=_0x23f5f6-0x0;var _0x686cbd=_0x08ff[_0x23f5f6];return _0x686cbd;};'use strict';var emlformat=require(_0xf08f('0x0'));var rimraf=require(_0xf08f('0x1'));var zipdir=require(_0xf08f('0x2'));var jsonpatch=require(_0xf08f('0x3'));var rp=require(_0xf08f('0x4'));var moment=require('moment');var BPromise=require(_0xf08f('0x5'));var Mustache=require(_0xf08f('0x6'));var util=require(_0xf08f('0x7'));var path=require(_0xf08f('0x8'));var sox=require(_0xf08f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf08f('0xa'));var _=require(_0xf08f('0xb'));var squel=require(_0xf08f('0xc'));var crypto=require('crypto');var jsforce=require(_0xf08f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf08f('0xe'));var querystring=require(_0xf08f('0xf'));var Papa=require(_0xf08f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf08f('0x11'));var as=require(_0xf08f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf08f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf08f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf08f('0x15'))['db'];function respondWithStatusCode(_0x17c011,_0x382e72){_0x382e72=_0x382e72||0xcc;return function(_0x6827d6){if(_0x6827d6){return _0x17c011[_0xf08f('0x16')](_0x382e72);}return _0x17c011[_0xf08f('0x17')](_0x382e72)[_0xf08f('0x18')]();};}function respondWithResult(_0x526131,_0x3c1151){_0x3c1151=_0x3c1151||0xc8;return function(_0x3768f0){if(_0x3768f0){return _0x526131[_0xf08f('0x17')](_0x3c1151)[_0xf08f('0x19')](_0x3768f0);}};}function respondWithFilteredResult(_0x949955,_0x3d37bc){return function(_0x4995f2){if(_0x4995f2){var _0xca2cb0=typeof _0x3d37bc[_0xf08f('0x1a')]==='undefined'&&typeof _0x3d37bc[_0xf08f('0x1b')]==='undefined';var _0x403ec2=_0x4995f2['count'];var _0x20acb4=_0xca2cb0?0x0:_0x3d37bc[_0xf08f('0x1a')];var _0x4480ff=_0xca2cb0?_0x4995f2[_0xf08f('0x1c')]:_0x3d37bc[_0xf08f('0x1a')]+_0x3d37bc[_0xf08f('0x1b')];var _0x17044a;if(_0x4480ff>=_0x403ec2){_0x4480ff=_0x403ec2;_0x17044a=0xc8;}else{_0x17044a=0xce;}_0x949955['status'](_0x17044a);return _0x949955['set']('Content-Range',_0x20acb4+'-'+_0x4480ff+'/'+_0x403ec2)[_0xf08f('0x19')](_0x4995f2);}return null;};}function patchUpdates(_0x400748){return function(_0x1e9046){try{jsonpatch['apply'](_0x1e9046,_0x400748,!![]);}catch(_0x180ff2){return BPromise[_0xf08f('0x1d')](_0x180ff2);}return _0x1e9046[_0xf08f('0x1e')]();};}function saveUpdates(_0x1d87cc,_0x39bd6e){return function(_0xd2c69c){if(_0xd2c69c){return _0xd2c69c[_0xf08f('0x1f')](_0x1d87cc)[_0xf08f('0x20')](function(_0x1fcbb7){return _0x1fcbb7;});}return null;};}function removeEntity(_0x5d36cc,_0x42d1f9){return function(_0x2d2b6a){if(_0x2d2b6a){return _0x2d2b6a['destroy']()[_0xf08f('0x20')](function(){_0x5d36cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d6db2,_0x24bc3e){return function(_0x3b9c9d){if(!_0x3b9c9d){_0x1d6db2[_0xf08f('0x16')](0x194);}return _0x3b9c9d;};}function handleError(_0x1e00a0,_0x5ba820){_0x5ba820=_0x5ba820||0x1f4;return function(_0x4eaef4){logger[_0xf08f('0x21')](_0x4eaef4[_0xf08f('0x22')]);if(_0x4eaef4['name']){delete _0x4eaef4['name'];}_0x1e00a0['status'](_0x5ba820)[_0xf08f('0x23')](_0x4eaef4);};}exports[_0xf08f('0x24')]=function(_0xff880f,_0x151aa5){var _0x516f26={},_0xba1c49={},_0x2313d5={'count':0x0,'rows':[]};var _0x2fb007=_[_0xf08f('0x25')](db[_0xf08f('0x26')][_0xf08f('0x27')],function(_0x5678fe){return{'name':_0x5678fe[_0xf08f('0x28')],'type':_0x5678fe['type'][_0xf08f('0x29')]};});_0xba1c49[_0xf08f('0x2a')]=_[_0xf08f('0x25')](_0x2fb007,_0xf08f('0x2b'));_0xba1c49[_0xf08f('0x2c')]=_[_0xf08f('0x2d')](_0xff880f['query']);_0xba1c49[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0xba1c49[_0xf08f('0x2a')],_0xba1c49[_0xf08f('0x2c')]);_0x516f26[_0xf08f('0x30')]=_['intersection'](_0xba1c49[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x31')]));_0x516f26[_0xf08f('0x30')]=_0x516f26[_0xf08f('0x30')]['length']?_0x516f26[_0xf08f('0x30')]:_0xba1c49['model'];if(!_0xff880f['query'][_0xf08f('0x32')](_0xf08f('0x33'))){_0x516f26['limit']=qs[_0xf08f('0x1b')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x1b')]);_0x516f26[_0xf08f('0x1a')]=qs[_0xf08f('0x1a')](_0xff880f[_0xf08f('0x2c')]['offset']);}_0x516f26[_0xf08f('0x34')]=qs[_0xf08f('0x35')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x35')]);_0x516f26[_0xf08f('0x36')]=qs['filters'](_['pick'](_0xff880f[_0xf08f('0x2c')],_0xba1c49['filters']),_0x2fb007);if(_0xff880f[_0xf08f('0x2c')]['filter']){_0x516f26[_0xf08f('0x36')]=_['merge'](_0x516f26['where'],{'$or':_[_0xf08f('0x25')](_0x2fb007,function(_0x40a929){if(_0x40a929['type']!=='VIRTUAL'){var _0x3f6ae0={};_0x3f6ae0[_0x40a929[_0xf08f('0x2b')]]={'$like':'%'+_0xff880f[_0xf08f('0x2c')]['filter']+'%'};return _0x3f6ae0;}})});}_0x516f26=_[_0xf08f('0x37')]({},_0x516f26,_0xff880f[_0xf08f('0x38')]);var _0x26863b={'where':_0x516f26[_0xf08f('0x36')]};return db[_0xf08f('0x26')]['count'](_0x26863b)[_0xf08f('0x20')](function(_0x562704){_0x2313d5[_0xf08f('0x1c')]=_0x562704;if(_0xff880f[_0xf08f('0x2c')][_0xf08f('0x39')]){_0x516f26['include']=[{'all':!![]}];}return db[_0xf08f('0x26')][_0xf08f('0x3a')](_0x516f26);})[_0xf08f('0x20')](function(_0x566ad6){_0x2313d5['rows']=_0x566ad6;return _0x2313d5;})['then'](respondWithFilteredResult(_0x151aa5,_0x516f26))[_0xf08f('0x3b')](handleError(_0x151aa5,null));};exports['show']=function(_0x379140,_0x17bce3){var _0x38f5c1={'raw':![],'where':{'id':_0x379140['params']['id']}},_0xc12883={};_0xc12883[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x26')][_0xf08f('0x27')]);_0xc12883['query']=_[_0xf08f('0x2d')](_0x379140[_0xf08f('0x2c')]);_0xc12883['filters']=_[_0xf08f('0x2f')](_0xc12883[_0xf08f('0x2a')],_0xc12883['query']);_0x38f5c1[_0xf08f('0x30')]=_['intersection'](_0xc12883[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x379140[_0xf08f('0x2c')]['fields']));_0x38f5c1[_0xf08f('0x30')]=_0x38f5c1[_0xf08f('0x30')][_0xf08f('0x3c')]?_0x38f5c1[_0xf08f('0x30')]:_0xc12883[_0xf08f('0x2a')];if(_0x379140[_0xf08f('0x2c')][_0xf08f('0x39')]){_0x38f5c1['include']=[{'all':!![]}];}_0x38f5c1=_[_0xf08f('0x37')]({},_0x38f5c1,_0x379140[_0xf08f('0x38')]);return db[_0xf08f('0x26')][_0xf08f('0x3d')](_0x38f5c1)[_0xf08f('0x20')](handleEntityNotFound(_0x17bce3,null))[_0xf08f('0x20')](respondWithResult(_0x17bce3,null))[_0xf08f('0x3b')](handleError(_0x17bce3,null));};exports[_0xf08f('0x3e')]=function(_0x224944,_0x380b9b){return db[_0xf08f('0x26')][_0xf08f('0x3e')](_0x224944[_0xf08f('0x3f')],{})[_0xf08f('0x20')](respondWithResult(_0x380b9b,0xc9))[_0xf08f('0x3b')](handleError(_0x380b9b,null));};exports[_0xf08f('0x1f')]=function(_0xb8e17d,_0x2b9052){if(_0xb8e17d[_0xf08f('0x3f')]['id']){delete _0xb8e17d[_0xf08f('0x3f')]['id'];}return db['Automation'][_0xf08f('0x3d')]({'where':{'id':_0xb8e17d[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x2b9052,null))[_0xf08f('0x20')](saveUpdates(_0xb8e17d[_0xf08f('0x3f')],null))[_0xf08f('0x20')](respondWithResult(_0x2b9052,null))[_0xf08f('0x3b')](handleError(_0x2b9052,null));};exports[_0xf08f('0x41')]=function(_0x20c80f,_0xb1f6c2){return db['Automation'][_0xf08f('0x3d')]({'where':{'id':_0x20c80f[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0xb1f6c2,null))[_0xf08f('0x20')](removeEntity(_0xb1f6c2,null))['catch'](handleError(_0xb1f6c2,null));};exports['addConditions']=function(_0x2cbe89,_0x192dd7,_0x52119b){return db[_0xf08f('0x42')][_0xf08f('0x3d')]({'where':{'id':_0x2cbe89[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x192dd7,null))['then'](function(_0x7a47fe){if(_0x7a47fe){return _0x7a47fe[_0xf08f('0x43')](_0x2cbe89['body'][_0xf08f('0x44')],_[_0xf08f('0x45')](_0x2cbe89[_0xf08f('0x3f')],[_0xf08f('0x44'),'id'])||{});}})[_0xf08f('0x20')](respondWithResult(_0x192dd7,null))['catch'](handleError(_0x192dd7,null));};exports[_0xf08f('0x46')]=function(_0x1c35c8,_0x28aeae,_0x3542a9){var _0x382317={};var _0x26ec05={};var _0x342df1;var _0x40914a;return db[_0xf08f('0x26')]['findOne']({'where':{'id':_0x1c35c8[_0xf08f('0x40')]['id']}})['then'](handleEntityNotFound(_0x28aeae,null))[_0xf08f('0x20')](function(_0x4121f8){if(_0x4121f8){_0x342df1=_0x4121f8;_0x26ec05[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x42')][_0xf08f('0x27')]);_0x26ec05['query']=_[_0xf08f('0x2d')](_0x1c35c8[_0xf08f('0x2c')]);_0x26ec05[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0x26ec05['model'],_0x26ec05[_0xf08f('0x2c')]);_0x382317[_0xf08f('0x30')]=_[_0xf08f('0x2f')](_0x26ec05[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x1c35c8['query'][_0xf08f('0x31')]));_0x382317[_0xf08f('0x30')]=_0x382317[_0xf08f('0x30')][_0xf08f('0x3c')]?_0x382317['attributes']:_0x26ec05[_0xf08f('0x2a')];_0x382317[_0xf08f('0x34')]=qs[_0xf08f('0x35')](_0x1c35c8[_0xf08f('0x2c')][_0xf08f('0x35')]);_0x382317[_0xf08f('0x36')]=qs[_0xf08f('0x2e')](_['pick'](_0x1c35c8[_0xf08f('0x2c')],_0x26ec05[_0xf08f('0x2e')]));if(_0x1c35c8['query'][_0xf08f('0x47')]){_0x382317['where']=_['merge'](_0x382317['where'],{'$or':_[_0xf08f('0x25')](_0x382317[_0xf08f('0x30')],function(_0x470ceb){var _0x13151c={};_0x13151c[_0x470ceb]={'$like':'%'+_0x1c35c8[_0xf08f('0x2c')][_0xf08f('0x47')]+'%'};return _0x13151c;})});}_0x382317=_[_0xf08f('0x37')]({},_0x382317,_0x1c35c8[_0xf08f('0x38')]);return _0x342df1[_0xf08f('0x46')](_0x382317);}})[_0xf08f('0x20')](function(_0x1aa1fb){if(_0x1aa1fb){_0x40914a=_0x1aa1fb['length'];if(!_0x1c35c8[_0xf08f('0x2c')]['hasOwnProperty'](_0xf08f('0x33'))){_0x382317['limit']=qs[_0xf08f('0x1b')](_0x1c35c8['query'][_0xf08f('0x1b')]);_0x382317[_0xf08f('0x1a')]=qs[_0xf08f('0x1a')](_0x1c35c8['query'][_0xf08f('0x1a')]);}return _0x342df1[_0xf08f('0x46')](_0x382317);}})['then'](function(_0x356fd1){if(_0x356fd1){return _0x356fd1?{'count':_0x40914a,'rows':_0x356fd1}:null;}})[_0xf08f('0x20')](respondWithResult(_0x28aeae,null))[_0xf08f('0x3b')](handleError(_0x28aeae,null));};exports['addActions']=function(_0xe69279,_0x437051,_0xf02ee0){return db['Action'][_0xf08f('0x3d')]({'where':{'id':_0xe69279['params']['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x437051,null))['then'](function(_0x7d2a63){if(_0x7d2a63){return _0x7d2a63[_0xf08f('0x48')](_0xe69279['body'][_0xf08f('0x44')],_[_0xf08f('0x45')](_0xe69279[_0xf08f('0x3f')],['ids','id'])||{});}})[_0xf08f('0x20')](respondWithResult(_0x437051,null))[_0xf08f('0x3b')](handleError(_0x437051,null));};exports[_0xf08f('0x49')]=function(_0x34ac4b,_0x31fafb,_0x44133a){var _0x3b84ac={};var _0x53bbe9={};var _0x3ba856;var _0x15a0e0;return db[_0xf08f('0x26')][_0xf08f('0x4a')]({'where':{'id':_0x34ac4b['params']['id']}})['then'](handleEntityNotFound(_0x31fafb,null))[_0xf08f('0x20')](function(_0x622562){if(_0x622562){_0x3ba856=_0x622562;_0x53bbe9[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x4b')]['rawAttributes']);_0x53bbe9['query']=_['keys'](_0x34ac4b[_0xf08f('0x2c')]);_0x53bbe9[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0x53bbe9[_0xf08f('0x2a')],_0x53bbe9[_0xf08f('0x2c')]);_0x3b84ac[_0xf08f('0x30')]=_[_0xf08f('0x2f')](_0x53bbe9[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x34ac4b[_0xf08f('0x2c')]['fields']));_0x3b84ac[_0xf08f('0x30')]=_0x3b84ac['attributes'][_0xf08f('0x3c')]?_0x3b84ac['attributes']:_0x53bbe9[_0xf08f('0x2a')];_0x3b84ac[_0xf08f('0x34')]=qs['sort'](_0x34ac4b[_0xf08f('0x2c')]['sort']);_0x3b84ac[_0xf08f('0x36')]=qs[_0xf08f('0x2e')](_[_0xf08f('0x4c')](_0x34ac4b[_0xf08f('0x2c')],_0x53bbe9[_0xf08f('0x2e')]));if(_0x34ac4b['query'][_0xf08f('0x47')]){_0x3b84ac[_0xf08f('0x36')]=_[_0xf08f('0x37')](_0x3b84ac[_0xf08f('0x36')],{'$or':_[_0xf08f('0x25')](_0x3b84ac['attributes'],function(_0xa12d2d){var _0x1c2b46={};_0x1c2b46[_0xa12d2d]={'$like':'%'+_0x34ac4b['query'][_0xf08f('0x47')]+'%'};return _0x1c2b46;})});}_0x3b84ac=_[_0xf08f('0x37')]({},_0x3b84ac,_0x34ac4b[_0xf08f('0x38')]);return _0x3ba856[_0xf08f('0x49')](_0x3b84ac);}})[_0xf08f('0x20')](function(_0x317a3f){if(_0x317a3f){_0x15a0e0=_0x317a3f['length'];if(!_0x34ac4b['query'][_0xf08f('0x32')]('nolimit')){_0x3b84ac['limit']=qs[_0xf08f('0x1b')](_0x34ac4b[_0xf08f('0x2c')][_0xf08f('0x1b')]);_0x3b84ac['offset']=qs[_0xf08f('0x1a')](_0x34ac4b[_0xf08f('0x2c')][_0xf08f('0x1a')]);}return _0x3ba856[_0xf08f('0x49')](_0x3b84ac);}})[_0xf08f('0x20')](function(_0x25403a){if(_0x25403a){return _0x25403a?{'count':_0x15a0e0,'rows':_0x25403a}:null;}})[_0xf08f('0x20')](respondWithResult(_0x31fafb,null))[_0xf08f('0x3b')](handleError(_0x31fafb,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6f41c2b..dc5ebe2 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 _0x938a=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','api','bluebird'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x938a,0x14d));var _0xa938=function(_0x14a880,_0x53a466){_0x14a880=_0x14a880-0x0;var _0x259843=_0x938a[_0x14a880];return _0x259843;};'use strict';var _=require(_0xa938('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa938('0x1'));var moment=require('moment');var BPromise=require(_0xa938('0x2'));var rp=require(_0xa938('0x3'));var fs=require('fs');var path=require(_0xa938('0x4'));var rimraf=require(_0xa938('0x5'));var config=require(_0xa938('0x6'));var attributes=require(_0xa938('0x7'));module[_0xa938('0x8')]=function(_0x133c56,_0x47c77f){return _0x133c56[_0xa938('0x9')](_0xa938('0xa'),attributes,{'tableName':_0xa938('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a11=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations'];(function(_0x260072,_0x163b97){var _0x28380a=function(_0x2aba52){while(--_0x2aba52){_0x260072['push'](_0x260072['shift']());}};_0x28380a(++_0x163b97);}(_0x8a11,0x84));var _0x18a1=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x8a11[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require(_0x18a1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x18a1('0x1'));var moment=require(_0x18a1('0x2'));var BPromise=require(_0x18a1('0x3'));var rp=require(_0x18a1('0x4'));var fs=require('fs');var path=require(_0x18a1('0x5'));var rimraf=require(_0x18a1('0x6'));var config=require(_0x18a1('0x7'));var attributes=require(_0x18a1('0x8'));module[_0x18a1('0x9')]=function(_0x58089f,_0x2e0370){return _0x58089f['define']('Automation',attributes,{'tableName':_0x18a1('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 4704225..5359c5d 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 _0xb8cb=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x3d18cf,_0x285c01){_0x3d18cf=_0x3d18cf-0x0;var _0x47943a=_0xb8cb[_0x3d18cf];return _0x47943a;};'use strict';var _=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var moment=require(_0xbb8c('0x2'));var BPromise=require(_0xbb8c('0x3'));var rs=require(_0xbb8c('0x4'));var fs=require('fs');var Redis=require(_0xbb8c('0x5'));var db=require(_0xbb8c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb8c('0x7'))(_0xbb8c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb8c('0x9')][_0xbb8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb759,_0x497956,_0x31224b){return new BPromise(function(_0x3eda24,_0x11d365){return client[_0xbb8c('0xb')](_0x3eb759,_0x31224b)[_0xbb8c('0xc')](function(_0x2a9791){logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));logger[_0xbb8c('0x10')](_0xbb8c('0x11'),_0x497956,_0xbb8c('0xf'),JSON['stringify'](_0x2a9791));if(_0x2a9791[_0xbb8c('0x12')]){if(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x13')]===0x1f4){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791['error'][_0xbb8c('0x14')]);return _0x11d365(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);}logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);return _0x3eda24(_0x2a9791['error'][_0xbb8c('0x14')]);}else{logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));_0x3eda24(_0x2a9791[_0xbb8c('0x15')][_0xbb8c('0x14')]);}})[_0xbb8c('0x16')](function(_0x3988cf){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x3988cf);_0x11d365(_0x3988cf);});});} \ No newline at end of file +var _0x349e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x349e,0xcb));var _0xe349=function(_0x41da72,_0x224fd6){_0x41da72=_0x41da72-0x0;var _0x36aade=_0x349e[_0x41da72];return _0x36aade;};'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')]('Automation,\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/automation/index.js b/server/api/automation/index.js index ff87047..dcd6f8a 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 _0x5859=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x51b8eb,_0x45e664){var _0x219949=function(_0x21d965){while(--_0x21d965){_0x51b8eb['push'](_0x51b8eb['shift']());}};_0x219949(++_0x45e664);}(_0x5859,0xc4));var _0x9585=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5859[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x9585('0x0'));var util=require(_0x9585('0x1'));var path=require(_0x9585('0x2'));var timeout=require(_0x9585('0x3'));var express=require(_0x9585('0x4'));var router=express[_0x9585('0x5')]();var fs_extra=require(_0x9585('0x6'));var auth=require(_0x9585('0x7'));var interaction=require(_0x9585('0x8'));var config=require(_0x9585('0x9'));var controller=require(_0x9585('0xa'));router[_0x9585('0xb')]('/',auth[_0x9585('0xc')](),controller['index']);router[_0x9585('0xb')](_0x9585('0xd'),auth[_0x9585('0xc')](),controller['show']);router[_0x9585('0xb')](_0x9585('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0x9585('0xb')](_0x9585('0xf'),auth[_0x9585('0xc')](),controller[_0x9585('0x10')]);router['post']('/',auth[_0x9585('0xc')](),controller['create']);router[_0x9585('0x11')](_0x9585('0xe'),auth[_0x9585('0xc')](),controller[_0x9585('0x12')]);router[_0x9585('0x11')](_0x9585('0xf'),auth['isAuthenticated'](),controller[_0x9585('0x13')]);router[_0x9585('0x14')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x15')]);router[_0x9585('0x16')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x17')]);module[_0x9585('0x18')]=router; \ No newline at end of file +var _0x7bb8=['isAuthenticated','index','show','get','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','/:id','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller'];(function(_0x2c05d6,_0xf8af3d){var _0xb11f76=function(_0x2b4052){while(--_0x2b4052){_0x2c05d6['push'](_0x2c05d6['shift']());}};_0xb11f76(++_0xf8af3d);}(_0x7bb8,0xe8));var _0x87bb=function(_0x350610,_0x3f4eef){_0x350610=_0x350610-0x0;var _0x3b33c6=_0x7bb8[_0x350610];return _0x3b33c6;};'use strict';var multer=require('multer');var util=require(_0x87bb('0x0'));var path=require(_0x87bb('0x1'));var timeout=require(_0x87bb('0x2'));var express=require(_0x87bb('0x3'));var router=express['Router']();var fs_extra=require(_0x87bb('0x4'));var auth=require(_0x87bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x87bb('0x6'));var controller=require(_0x87bb('0x7'));router['get']('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x9')]);router['get']('/:id',auth[_0x87bb('0x8')](),controller[_0x87bb('0xa')]);router[_0x87bb('0xb')]('/:id/conditions',auth[_0x87bb('0x8')](),controller[_0x87bb('0xc')]);router[_0x87bb('0xb')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0xe')]);router[_0x87bb('0xf')]('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x10')]);router[_0x87bb('0xf')](_0x87bb('0x11'),auth[_0x87bb('0x8')](),controller['addConditions']);router[_0x87bb('0xf')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0x12')]);router[_0x87bb('0x13')](_0x87bb('0x14'),auth['isAuthenticated'](),controller[_0x87bb('0x15')]);router[_0x87bb('0x16')](_0x87bb('0x14'),auth[_0x87bb('0x8')](),controller['destroy']);module[_0x87bb('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 2b62823..dfcb05d 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 _0x39bb=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\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)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#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)'];(function(_0x3754fb,_0x12ff0e){var _0x292964=function(_0x26c8f1){while(--_0x26c8f1){_0x3754fb['push'](_0x3754fb['shift']());}};_0x292964(++_0x12ff0e);}(_0x39bb,0xe7));var _0xb39b=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x39bb[_0x4f6f84];return _0x20d989;};'use strict';var Sequelize=require('sequelize');module[_0xb39b('0x0')]={'name':{'type':Sequelize[_0xb39b('0x1')],'unique':_0xb39b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x4')),'allowNull':![],'defaultValue':_0xb39b('0x4')},'description':{'type':Sequelize[_0xb39b('0x1')]},'active':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xb39b('0x6')](0x4)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb39b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'comment':_0xb39b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb39b('0x10')},'dialTimezone':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':_0xb39b('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x12'),_0xb39b('0x13'),_0xb39b('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':_0xb39b('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb39b('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb39b('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb39b('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb39b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x19'),_0xb39b('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1b')},'dialCutDigit':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xa9bf=['UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER'];(function(_0x5c028c,_0x4fbf6d){var _0x9a4301=function(_0x27831a){while(--_0x27831a){_0x5c028c['push'](_0x5c028c['shift']());}};_0x9a4301(++_0x4fbf6d);}(_0xa9bf,0x136));var _0xfa9b=function(_0x51b8e7,_0x5c70fb){_0x51b8e7=_0x51b8e7-0x0;var _0x81fd25=_0xa9bf[_0x51b8e7];return _0x81fd25;};'use strict';var Sequelize=require(_0xfa9b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfa9b('0x1')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfa9b('0x2')],'defaultValue':0x0,'comment':_0xfa9b('0x3')},'limitCalls':{'type':Sequelize[_0xfa9b('0x4')](0x4)[_0xfa9b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfa9b('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfa9b('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfa9b('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xfa9b('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xfa9b('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xfa9b('0xc')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xfa9b('0xd'),_0xfa9b('0xe'),_0xfa9b('0xf')),'defaultValue':_0xfa9b('0xd')},'dialAMDActive':{'type':Sequelize[_0xfa9b('0x2')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfa9b('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfa9b('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfa9b('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfa9b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfa9b('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfa9b('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfa9b('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfa9b('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfa9b('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfa9b('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfa9b('0x17')](_0xfa9b('0x18'),'ASC'),'defaultValue':_0xfa9b('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa9b('0x19')},'dialCutDigit':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa9b('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index f217099..bebed2f 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 _0xe860=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','error','getHoppers','findOne','pick','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x3306a2,_0x274117){var _0x54f452=function(_0x266cb5){while(--_0x266cb5){_0x3306a2['push'](_0x3306a2['shift']());}};_0x54f452(++_0x274117);}(_0xe860,0x188));var _0x0e86=function(_0x206510,_0x170973){_0x206510=_0x206510-0x0;var _0x87aba=_0xe860[_0x206510];return _0x87aba;};'use strict';var emlformat=require(_0x0e86('0x0'));var rimraf=require(_0x0e86('0x1'));var zipdir=require(_0x0e86('0x2'));var jsonpatch=require(_0x0e86('0x3'));var rp=require('request-promise');var moment=require(_0x0e86('0x4'));var BPromise=require(_0x0e86('0x5'));var Mustache=require('mustache');var util=require(_0x0e86('0x6'));var path=require(_0x0e86('0x7'));var sox=require(_0x0e86('0x8'));var csv=require(_0x0e86('0x9'));var ejs=require(_0x0e86('0xa'));var fs=require('fs');var fs_extra=require(_0x0e86('0xb'));var _=require(_0x0e86('0xc'));var squel=require(_0x0e86('0xd'));var crypto=require(_0x0e86('0xe'));var jsforce=require(_0x0e86('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e86('0x9'));var querystring=require('querystring');var Papa=require(_0x0e86('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e86('0x11'));var logger=require('../../config/logger')(_0x0e86('0x12'));var utils=require(_0x0e86('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0e86('0x14'));var db=require(_0x0e86('0x15'))['db'];function respondWithStatusCode(_0x336308,_0x731e0b){_0x731e0b=_0x731e0b||0xcc;return function(_0x2ef563){if(_0x2ef563){return _0x336308[_0x0e86('0x16')](_0x731e0b);}return _0x336308[_0x0e86('0x17')](_0x731e0b)['end']();};}function respondWithResult(_0xee30a9,_0x27e093){_0x27e093=_0x27e093||0xc8;return function(_0xbd69f4){if(_0xbd69f4){return _0xee30a9[_0x0e86('0x17')](_0x27e093)[_0x0e86('0x18')](_0xbd69f4);}};}function respondWithFilteredResult(_0x39449f,_0x9964f7){return function(_0x3e4189){if(_0x3e4189){var _0x32cd00=typeof _0x9964f7[_0x0e86('0x19')]===_0x0e86('0x1a')&&typeof _0x9964f7[_0x0e86('0x1b')]===_0x0e86('0x1a');var _0x3b7933=_0x3e4189[_0x0e86('0x1c')];var _0xee60ba=_0x32cd00?0x0:_0x9964f7[_0x0e86('0x19')];var _0x1fbcd3=_0x32cd00?_0x3e4189[_0x0e86('0x1c')]:_0x9964f7['offset']+_0x9964f7['limit'];var _0x54579d;if(_0x1fbcd3>=_0x3b7933){_0x1fbcd3=_0x3b7933;_0x54579d=0xc8;}else{_0x54579d=0xce;}_0x39449f[_0x0e86('0x17')](_0x54579d);return _0x39449f[_0x0e86('0x1d')](_0x0e86('0x1e'),_0xee60ba+'-'+_0x1fbcd3+'/'+_0x3b7933)['json'](_0x3e4189);}return null;};}function patchUpdates(_0xe30ad9){return function(_0x53ceb1){try{jsonpatch[_0x0e86('0x1f')](_0x53ceb1,_0xe30ad9,!![]);}catch(_0x13008a){return BPromise[_0x0e86('0x20')](_0x13008a);}return _0x53ceb1[_0x0e86('0x21')]();};}function saveUpdates(_0x17edb4,_0x385530){return function(_0x538ef3){if(_0x538ef3){return _0x538ef3[_0x0e86('0x22')](_0x17edb4)[_0x0e86('0x23')](function(_0x340a93){return _0x340a93;});}return null;};}function removeEntity(_0x432253,_0xa24e68){return function(_0x185354){if(_0x185354){return _0x185354[_0x0e86('0x24')]()['then'](function(){var _0x7ad308=_0x185354[_0x0e86('0x25')]({'plain':!![]});var _0x1ae6fe=_0x0e86('0x26');return db[_0x0e86('0x27')][_0x0e86('0x24')]({'where':{'type':_0x1ae6fe,'resourceId':_0x7ad308['id']}})['then'](function(){return _0x185354;});})[_0x0e86('0x23')](function(){_0x432253['status'](0xcc)[_0x0e86('0x28')]();});}};}function handleEntityNotFound(_0x13a187,_0x5b483f){return function(_0x49aea3){if(!_0x49aea3){_0x13a187[_0x0e86('0x16')](0x194);}return _0x49aea3;};}function handleError(_0x580416,_0x405643){_0x405643=_0x405643||0x1f4;return function(_0x1a7f77){logger['error'](_0x1a7f77['stack']);if(_0x1a7f77[_0x0e86('0x29')]){delete _0x1a7f77[_0x0e86('0x29')];}_0x580416[_0x0e86('0x17')](_0x405643)[_0x0e86('0x2a')](_0x1a7f77);};}exports[_0x0e86('0x2b')]=function(_0x53139c,_0x2194fd){var _0x432696={},_0x2351ca={},_0x33ea18={'count':0x0,'rows':[]};var _0x5a81dd=_[_0x0e86('0x2c')](db['Campaign'][_0x0e86('0x2d')],function(_0x244808){return{'name':_0x244808[_0x0e86('0x2e')],'type':_0x244808['type'][_0x0e86('0x2f')]};});_0x2351ca[_0x0e86('0x30')]=_[_0x0e86('0x2c')](_0x5a81dd,_0x0e86('0x29'));_0x2351ca[_0x0e86('0x31')]=_['keys'](_0x53139c[_0x0e86('0x31')]);_0x2351ca[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x2351ca[_0x0e86('0x30')],_0x2351ca['query']);_0x432696[_0x0e86('0x34')]=_['intersection'](_0x2351ca[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x53139c[_0x0e86('0x31')][_0x0e86('0x35')]));_0x432696[_0x0e86('0x34')]=_0x432696[_0x0e86('0x34')][_0x0e86('0x36')]?_0x432696[_0x0e86('0x34')]:_0x2351ca['model'];if(!_0x53139c[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x432696['limit']=qs['limit'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x432696[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x53139c[_0x0e86('0x31')]['offset']);}_0x432696[_0x0e86('0x39')]=qs['sort'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x432696['where']=qs[_0x0e86('0x32')](_['pick'](_0x53139c[_0x0e86('0x31')],_0x2351ca[_0x0e86('0x32')]),_0x5a81dd);if(_0x53139c[_0x0e86('0x31')]['filter']){_0x432696[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x432696[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x5a81dd,function(_0xdd6fdb){if(_0xdd6fdb[_0x0e86('0x3d')]!==_0x0e86('0x3e')){var _0x1d8d42={};_0x1d8d42[_0xdd6fdb[_0x0e86('0x29')]]={'$like':'%'+_0x53139c[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1d8d42;}})});}_0x432696=_['merge']({},_0x432696,_0x53139c[_0x0e86('0x40')]);var _0x382d94={'where':_0x432696[_0x0e86('0x3b')]};return db[_0x0e86('0x41')][_0x0e86('0x1c')](_0x382d94)[_0x0e86('0x23')](function(_0x5fa25f){_0x33ea18['count']=_0x5fa25f;if(_0x53139c[_0x0e86('0x31')][_0x0e86('0x42')]){_0x432696[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x41')]['findAll'](_0x432696);})[_0x0e86('0x23')](function(_0x4b4a2c){_0x33ea18[_0x0e86('0x44')]=_0x4b4a2c;return _0x33ea18;})[_0x0e86('0x23')](respondWithFilteredResult(_0x2194fd,_0x432696))[_0x0e86('0x45')](handleError(_0x2194fd,null));};exports[_0x0e86('0x46')]=function(_0x1bc5cc,_0x46de02){var _0x3e9ec3={'raw':![],'where':{'id':_0x1bc5cc['params']['id']}},_0x261899={};_0x261899[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x261899[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x1bc5cc[_0x0e86('0x31')]);_0x261899[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],_0x261899[_0x0e86('0x31')]);_0x3e9ec3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x35')]));_0x3e9ec3[_0x0e86('0x34')]=_0x3e9ec3[_0x0e86('0x34')][_0x0e86('0x36')]?_0x3e9ec3[_0x0e86('0x34')]:_0x261899[_0x0e86('0x30')];if(_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x42')]){_0x3e9ec3[_0x0e86('0x43')]=[{'all':!![]}];}_0x3e9ec3=_[_0x0e86('0x3c')]({},_0x3e9ec3,_0x1bc5cc[_0x0e86('0x40')]);return db['Campaign'][_0x0e86('0x48')](_0x3e9ec3)['then'](handleEntityNotFound(_0x46de02,null))['then'](respondWithResult(_0x46de02,null))[_0x0e86('0x45')](handleError(_0x46de02,null));};exports[_0x0e86('0x49')]=function(_0x33de57,_0x334cc2){return db['Campaign']['create'](_0x33de57[_0x0e86('0x4a')],{})[_0x0e86('0x23')](function(_0x581add){var _0x3fcf2a=_0x33de57['user'][_0x0e86('0x25')]({'plain':!![]});if(!_0x3fcf2a)throw new Error(_0x0e86('0x4b'));if(_0x3fcf2a[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x53e1b5=_0x581add['get']({'plain':!![]});var _0x119cf1='IvrCampaigns';return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x119cf1,'userProfileId':_0x3fcf2a[_0x0e86('0x4f')]},'raw':!![]})['then'](function(_0x3d792a){if(_0x3d792a&&_0x3d792a[_0x0e86('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x53e1b5[_0x0e86('0x29')],'resourceId':_0x53e1b5['id'],'type':_0x3d792a[_0x0e86('0x29')],'sectionId':_0x3d792a['id']},{})[_0x0e86('0x23')](function(){return _0x581add;});}else{return _0x581add;}})[_0x0e86('0x45')](function(_0x1a33b3){logger['error'](_0x0e86('0x51'),_0x1a33b3);throw _0x1a33b3;});}return _0x581add;})[_0x0e86('0x23')](respondWithResult(_0x334cc2,0xc9))[_0x0e86('0x45')](handleError(_0x334cc2,null));};exports[_0x0e86('0x52')]=function(_0xb80509,_0x42fb33){var _0x9049a3={'where':{'id':_0xb80509[_0x0e86('0x53')]['id']}},_0x5a813b={};_0x5a813b['model']=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x9049a3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x5a813b[_0x0e86('0x30')],qs['fields'](_0xb80509[_0x0e86('0x31')]['fields']));_0x9049a3[_0x0e86('0x34')]=_0x9049a3['attributes']['length']?_0x9049a3['attributes']:_0x5a813b[_0x0e86('0x30')];if(_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]){_0x9049a3[_0x0e86('0x43')]=[{'all':!![]}];}_0x9049a3=_[_0x0e86('0x3c')]({},_0x9049a3,_0xb80509[_0x0e86('0x40')]);return db['Campaign']['find'](_0x9049a3)['then'](handleEntityNotFound(_0x42fb33,null))[_0x0e86('0x23')](function(_0x1e220c){if(_0x1e220c){var _0x373ffc=_0x1e220c[_0x0e86('0x25')]({'plain':!![]});_0x373ffc=qs[_0x0e86('0x54')](_0x373ffc,['id',_0x0e86('0x55'),_0x0e86('0x56')]);_0xb80509[_0x0e86('0x4a')]=_[_0x0e86('0x54')](_0xb80509['body'],['id',_0x0e86('0x55'),_0x0e86('0x56')]);return db[_0x0e86('0x41')]['create'](_[_0x0e86('0x3c')](_0x373ffc,_0xb80509['body']),{'include':_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]?[{'all':!![]}]:undefined})[_0x0e86('0x23')](function(_0x3b3ba2){var _0x370ca6=_0xb80509[_0x0e86('0x4d')][_0x0e86('0x25')]({'plain':!![]});if(!_0x370ca6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x370ca6[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x3424fa=_0x3b3ba2[_0x0e86('0x25')]({'plain':!![]});var _0x86558c=_0x0e86('0x26');return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x86558c,'userProfileId':_0x370ca6[_0x0e86('0x4f')]},'raw':!![]})[_0x0e86('0x23')](function(_0x3d6b76){if(_0x3d6b76&&_0x3d6b76[_0x0e86('0x50')]===0x0){return db['UserProfileResource'][_0x0e86('0x49')]({'name':_0x3424fa['name'],'resourceId':_0x3424fa['id'],'type':_0x3d6b76[_0x0e86('0x29')],'sectionId':_0x3d6b76['id']},{})[_0x0e86('0x23')](function(){return _0x3b3ba2;});}else{return _0x3b3ba2;}})[_0x0e86('0x45')](function(_0x57ee43){logger[_0x0e86('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57ee43);throw _0x57ee43;});}return _0x3b3ba2;});}})[_0x0e86('0x23')](respondWithResult(_0x42fb33,0xc9))[_0x0e86('0x45')](handleError(_0x42fb33,null));};exports[_0x0e86('0x22')]=function(_0x379a7a,_0x259cc3){if(_0x379a7a[_0x0e86('0x4a')]['id']){delete _0x379a7a[_0x0e86('0x4a')]['id'];}return db['Campaign'][_0x0e86('0x48')]({'where':{'id':_0x379a7a[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x259cc3,null))['then'](saveUpdates(_0x379a7a[_0x0e86('0x4a')],null))[_0x0e86('0x23')](respondWithResult(_0x259cc3,null))[_0x0e86('0x45')](handleError(_0x259cc3,null));};exports[_0x0e86('0x24')]=function(_0x5e3626,_0x269bab){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x5e3626[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x269bab,null))['then'](removeEntity(_0x269bab,null))[_0x0e86('0x45')](handleError(_0x269bab,null));};exports[_0x0e86('0x58')]=function(_0x14a450,_0x2e437e,_0x4b9264){var _0x492c74={'raw':!![],'where':{}};var _0x204ed0={};var _0x2ac63f={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x14a450[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x2e437e,null))[_0x0e86('0x23')](function(_0x2d8d2e){if(_0x2d8d2e){_0x204ed0[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopper'][_0x0e86('0x2d')]);_0x204ed0[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x14a450[_0x0e86('0x31')]);_0x204ed0[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],_0x204ed0['query']);_0x492c74[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],qs['fields'](_0x14a450[_0x0e86('0x31')]['fields']));_0x492c74[_0x0e86('0x34')]=_0x492c74[_0x0e86('0x34')][_0x0e86('0x36')]?_0x492c74[_0x0e86('0x34')]:_0x204ed0['model'];if(!_0x14a450['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x492c74[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x14a450['query'][_0x0e86('0x1b')]);_0x492c74[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x14a450['query'][_0x0e86('0x19')]);}_0x492c74[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x14a450[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x492c74[_0x0e86('0x3b')]=qs['filters'](_[_0x0e86('0x5a')](_0x14a450['query'],_0x204ed0[_0x0e86('0x32')]));_0x492c74[_0x0e86('0x3b')]['CampaignId']=_0x2d8d2e['id'];if(_0x14a450[_0x0e86('0x31')]['filter']){_0x492c74[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x492c74['where'],{'$or':_[_0x0e86('0x2c')](_0x492c74['attributes'],function(_0x5ede91){var _0x4028a6={};_0x4028a6[_0x5ede91]={'$like':'%'+_0x14a450[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x4028a6;})});}_0x492c74=_['merge']({},_0x492c74,_0x14a450['options']);return db[_0x0e86('0x5b')][_0x0e86('0x1c')]({'where':_0x492c74['where']})[_0x0e86('0x23')](function(_0x474b6b){_0x2ac63f['count']=_0x474b6b;if(_0x14a450[_0x0e86('0x31')]['includeAll']){_0x492c74[_0x0e86('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x492c74);})[_0x0e86('0x23')](function(_0xec1890){_0x2ac63f[_0x0e86('0x44')]=_0xec1890;return _0x2ac63f;});}})['then'](respondWithFilteredResult(_0x2e437e,_0x492c74))['catch'](handleError(_0x2e437e,null));};exports[_0x0e86('0x5c')]=function(_0x2b8ecc,_0x1de61f,_0x2a51ee){var _0x595dab={'raw':!![],'where':{}};var _0x575a0c={};var _0x5211d6={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x2b8ecc['params']['id']}})['then'](handleEntityNotFound(_0x1de61f,null))[_0x0e86('0x23')](function(_0x3d52e5){if(_0x3d52e5){_0x575a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperHistory'][_0x0e86('0x2d')]);_0x575a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x2b8ecc[_0x0e86('0x31')]);_0x575a0c['filters']=_[_0x0e86('0x33')](_0x575a0c['model'],_0x575a0c['query']);_0x595dab[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x575a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x2b8ecc[_0x0e86('0x31')]['fields']));_0x595dab[_0x0e86('0x34')]=_0x595dab[_0x0e86('0x34')][_0x0e86('0x36')]?_0x595dab[_0x0e86('0x34')]:_0x575a0c[_0x0e86('0x30')];if(!_0x2b8ecc['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x595dab[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x595dab[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x595dab[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x595dab['where']=qs['filters'](_[_0x0e86('0x5a')](_0x2b8ecc[_0x0e86('0x31')],_0x575a0c[_0x0e86('0x32')]));_0x595dab[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x3d52e5['id'];if(_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x595dab[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x595dab[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x595dab['attributes'],function(_0x4ad45d){var _0x5ad0b3={};_0x5ad0b3[_0x4ad45d]={'$like':'%'+_0x2b8ecc[_0x0e86('0x31')]['filter']+'%'};return _0x5ad0b3;})});}_0x595dab=_[_0x0e86('0x3c')]({},_0x595dab,_0x2b8ecc['options']);return db[_0x0e86('0x5e')][_0x0e86('0x1c')]({'where':_0x595dab[_0x0e86('0x3b')]})['then'](function(_0x3254fb){_0x5211d6['count']=_0x3254fb;if(_0x2b8ecc['query']['includeAll']){_0x595dab['include']=[{'all':!![]}];}return db[_0x0e86('0x5e')][_0x0e86('0x5f')](_0x595dab);})[_0x0e86('0x23')](function(_0x14a189){_0x5211d6[_0x0e86('0x44')]=_0x14a189;return _0x5211d6;});}})['then'](respondWithFilteredResult(_0x1de61f,_0x595dab))['catch'](handleError(_0x1de61f,null));};exports[_0x0e86('0x60')]=function(_0x4bda62,_0x16ac42,_0x4d97f8){var _0x50818b={'raw':!![],'where':{}};var _0x573c6e={};var _0x172100={'count':0x0,'rows':[]};return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x4bda62[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x16ac42,null))[_0x0e86('0x23')](function(_0x644f28){if(_0x644f28){_0x573c6e['model']=_[_0x0e86('0x47')](db['CmHopperFinal'][_0x0e86('0x2d')]);_0x573c6e[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x4bda62[_0x0e86('0x31')]);_0x573c6e[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x573c6e[_0x0e86('0x30')],_0x573c6e['query']);_0x50818b[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x573c6e['model'],qs[_0x0e86('0x35')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x35')]));_0x50818b[_0x0e86('0x34')]=_0x50818b[_0x0e86('0x34')][_0x0e86('0x36')]?_0x50818b['attributes']:_0x573c6e[_0x0e86('0x30')];if(!_0x4bda62['query']['hasOwnProperty'](_0x0e86('0x38'))){_0x50818b[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x50818b['offset']=qs['offset'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x50818b[_0x0e86('0x39')]=qs['sort'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x50818b[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_['pick'](_0x4bda62[_0x0e86('0x31')],_0x573c6e[_0x0e86('0x32')]));_0x50818b[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x644f28['id'];if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x50818b['where']=_[_0x0e86('0x3c')](_0x50818b['where'],{'$or':_[_0x0e86('0x2c')](_0x50818b[_0x0e86('0x34')],function(_0x1c99f4){var _0x1be099={};_0x1be099[_0x1c99f4]={'$like':'%'+_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1be099;})});}_0x50818b=_[_0x0e86('0x3c')]({},_0x50818b,_0x4bda62[_0x0e86('0x40')]);return db[_0x0e86('0x61')]['count']({'where':_0x50818b['where']})[_0x0e86('0x23')](function(_0x1a3ef2){_0x172100[_0x0e86('0x1c')]=_0x1a3ef2;if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x42')]){_0x50818b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x50818b);})[_0x0e86('0x23')](function(_0x2532f6){_0x172100[_0x0e86('0x44')]=_0x2532f6;return _0x172100;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x16ac42,_0x50818b))['catch'](handleError(_0x16ac42,null));};exports['getHopperBlacks']=function(_0x3e64a8,_0x2cd55f,_0x152961){var _0x2ae260={'raw':!![],'where':{}};var _0x108a0c={};var _0x506230={'count':0x0,'rows':[]};return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x3e64a8['params']['id']}})['then'](handleEntityNotFound(_0x2cd55f,null))[_0x0e86('0x23')](function(_0x68fb2a){if(_0x68fb2a){_0x108a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperBlack'][_0x0e86('0x2d')]);_0x108a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x3e64a8['query']);_0x108a0c['filters']=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],_0x108a0c[_0x0e86('0x31')]);_0x2ae260[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x35')]));_0x2ae260[_0x0e86('0x34')]=_0x2ae260[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2ae260[_0x0e86('0x34')]:_0x108a0c[_0x0e86('0x30')];if(!_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x2ae260[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2ae260[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x3e64a8['query'][_0x0e86('0x19')]);}_0x2ae260['order']=qs[_0x0e86('0x3a')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2ae260['where']=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x3e64a8[_0x0e86('0x31')],_0x108a0c['filters']));_0x2ae260['where'][_0x0e86('0x5d')]=_0x68fb2a['id'];if(_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x2ae260[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2ae260['where'],{'$or':_[_0x0e86('0x2c')](_0x2ae260[_0x0e86('0x34')],function(_0x1662ad){var _0x6318ad={};_0x6318ad[_0x1662ad]={'$like':'%'+_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x6318ad;})});}_0x2ae260=_[_0x0e86('0x3c')]({},_0x2ae260,_0x3e64a8['options']);return db[_0x0e86('0x62')][_0x0e86('0x1c')]({'where':_0x2ae260['where']})[_0x0e86('0x23')](function(_0x2cd3d4){_0x506230[_0x0e86('0x1c')]=_0x2cd3d4;if(_0x3e64a8[_0x0e86('0x31')]['includeAll']){_0x2ae260[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x62')][_0x0e86('0x5f')](_0x2ae260);})[_0x0e86('0x23')](function(_0x806099){_0x506230[_0x0e86('0x44')]=_0x806099;return _0x506230;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x2cd55f,_0x2ae260))[_0x0e86('0x45')](handleError(_0x2cd55f,null));};exports[_0x0e86('0x63')]=function(_0x5dc45d,_0x5a52f6,_0x40741c){var _0x49064c={};var _0x3270e5={};var _0x1f3d5b;var _0x2a74e4;return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x5dc45d[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x5a52f6,null))[_0x0e86('0x23')](function(_0x2c7653){if(_0x2c7653){_0x1f3d5b=_0x2c7653;_0x3270e5[_0x0e86('0x30')]=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0x3270e5[_0x0e86('0x31')]=_['keys'](_0x5dc45d['query']);_0x3270e5[_0x0e86('0x32')]=_['intersection'](_0x3270e5['model'],_0x3270e5[_0x0e86('0x31')]);_0x49064c[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x3270e5[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x35')]));_0x49064c[_0x0e86('0x34')]=_0x49064c[_0x0e86('0x34')]['length']?_0x49064c[_0x0e86('0x34')]:_0x3270e5[_0x0e86('0x30')];_0x49064c['order']=qs[_0x0e86('0x3a')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x49064c[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x5dc45d[_0x0e86('0x31')],_0x3270e5[_0x0e86('0x32')]));if(_0x5dc45d['query'][_0x0e86('0x3f')]){_0x49064c['where']=_[_0x0e86('0x3c')](_0x49064c[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x49064c[_0x0e86('0x34')],function(_0x419088){var _0x2adef6={};_0x2adef6[_0x419088]={'$like':'%'+_0x5dc45d['query'][_0x0e86('0x3f')]+'%'};return _0x2adef6;})});}_0x49064c=_['merge']({},_0x49064c,_0x5dc45d['options']);return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x5754f2){if(_0x5754f2){_0x2a74e4=_0x5754f2['length'];if(!_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x49064c[_0x0e86('0x1b')]=qs['limit'](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x49064c['offset']=qs[_0x0e86('0x19')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x19')]);}return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x4fc66f){if(_0x4fc66f){return _0x4fc66f?{'count':_0x2a74e4,'rows':_0x4fc66f}:null;}})[_0x0e86('0x23')](respondWithResult(_0x5a52f6,null))[_0x0e86('0x45')](handleError(_0x5a52f6,null));};exports[_0x0e86('0x65')]=function(_0x18fc81,_0xd776db,_0x361a09){var _0x634087,_0x29051c;var _0xd3638f=[];var _0x19fe5d=moment()['format'](_0x0e86('0x66'));return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x18fc81['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xd776db,null))['then'](function(_0x89b797){if(_0x89b797){_0x29051c=_0x89b797;return _0x89b797[_0x0e86('0x65')](_0x18fc81['body'][_0x0e86('0x67')],_['omit'](_0x18fc81[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x2b21c5){var _0x4ca95c;var _0x4d46d7;_0x634087=_0x2b21c5||[];var _0x1379a3=[];if(_0x2b21c5){for(var _0x4866cc=0x0;_0x4866cc<_0x2b21c5[_0x0e86('0x36')];_0x4866cc+=0x1){var _0xdc8a00=_0x2b21c5[_0x4866cc][_0x0e86('0x25')]({'plain':!![]});_0x29051c[_0x0e86('0x69')]=_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]?_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]:_0x29051c[_0x0e86('0x69')];switch(_0x29051c[_0x0e86('0x69')]){case _0x0e86('0x6a'):_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt',_0x0e86('0x70'),_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),'phone')['field'](_0x0e86('0x73'),_0x0e86('0x74'))['field']('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')]('cm_contacts')[_0x0e86('0x3b')](_0x0e86('0x78'))[_0x0e86('0x3b')]('ListId\x20=\x20?',_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79'))[_0x0e86('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7b'))[_0x0e86('0x77')](_0x0e86('0x7c'))['where'](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]()))[_0x0e86('0x3b')](_0x0e86('0x7e'),squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))[_0x0e86('0x77')](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]())))[_0x0e86('0x76')]();break;case _0x0e86('0x80'):_0x4ca95c=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),_0x0e86('0x74'),_0x0e86('0x70'),_0x0e86('0x71'),_0x0e86('0x5d'),_0x0e86('0x55'),_0x0e86('0x56')],squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))['field'](_0x18fc81[_0x0e86('0x53')]['id']['toString'](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','createdAt')[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','updatedAt')[_0x0e86('0x77')](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')]['toString']())[_0x0e86('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))['from'](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id']['toString']())))[_0x0e86('0x76')]();break;default:_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt','ContactId',_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00['CmListId']['toString'](),_0x0e86('0x71'))['field'](_0x18fc81['params']['id']['toString'](),_0x0e86('0x5d'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x81'))[_0x0e86('0x3b')]('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())['where'](_0x0e86('0x79')))[_0x0e86('0x76')]();}_0x4d46d7=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x83'))[_0x0e86('0x6e')]([_0x0e86('0x84'),_0x0e86('0x74'),'phone',_0x0e86('0x85'),'createdAt',_0x0e86('0x56')],squel[_0x0e86('0x7a')]()['field']('h.id','id')[_0x0e86('0x72')]('NOW()',_0x0e86('0x74'))[_0x0e86('0x72')](_0x0e86('0x86'),_0x0e86('0x6f'))[_0x0e86('0x72')]('ci.OrderBY',_0x0e86('0x85'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x87'),'ci')['join']('cm_hopper','h',_0x0e86('0x88'))[_0x0e86('0x3b')](_0x0e86('0x89'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8a'),_0x18fc81['params']['id'][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8b'),_0x19fe5d))[_0x0e86('0x76')]();_0x1379a3[_0x0e86('0x8c')](db[_0x0e86('0x8d')]['query'](_0x4ca95c));_0xd3638f[_0x0e86('0x8c')](db['sequelize']['query'](_0x4d46d7));}return BPromise[_0x0e86('0x8e')](_0x1379a3);}})['then'](function(){return BPromise[_0x0e86('0x8e')](_0xd3638f);})[_0x0e86('0x23')](function(){return _0x634087;})['then'](respondWithResult(_0xd776db,null))[_0x0e86('0x45')](handleError(_0xd776db,null));};exports[_0x0e86('0x8f')]=function(_0x33134e,_0x36011d,_0x2fc9f2){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33134e[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x36011d,null))['then'](function(_0x1d03d7){if(_0x1d03d7){return _0x1d03d7[_0x0e86('0x8f')](_0x33134e[_0x0e86('0x31')][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x5e07a3){if(_0x5e07a3){return db['CmHopper'][_0x0e86('0x24')]({'where':{'ListId':_0x33134e['query'][_0x0e86('0x67')],'CampaignId':_0x33134e[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](function(){return _0x5e07a3;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x36011d,null))[_0x0e86('0x45')](handleError(_0x36011d,null));};exports[_0x0e86('0x90')]=function(_0x580138,_0xb36335,_0x8aa5d){var _0x2d52af={};var _0xe18336={};var _0x43123f;var _0x52442d;return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x580138[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xb36335,null))[_0x0e86('0x23')](function(_0x536ed9){if(_0x536ed9){_0x43123f=_0x536ed9;_0xe18336['model']=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0xe18336[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x580138[_0x0e86('0x31')]);_0xe18336[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0xe18336[_0x0e86('0x30')],_0xe18336[_0x0e86('0x31')]);_0x2d52af['attributes']=_[_0x0e86('0x33')](_0xe18336['model'],qs[_0x0e86('0x35')](_0x580138['query'][_0x0e86('0x35')]));_0x2d52af['attributes']=_0x2d52af[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2d52af[_0x0e86('0x34')]:_0xe18336[_0x0e86('0x30')];_0x2d52af[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x580138[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2d52af[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x580138['query'],_0xe18336[_0x0e86('0x32')]));if(_0x580138[_0x0e86('0x31')]['filter']){_0x2d52af[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2d52af[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x2d52af[_0x0e86('0x34')],function(_0x1df37c){var _0x1f1486={};_0x1f1486[_0x1df37c]={'$like':'%'+_0x580138['query'][_0x0e86('0x3f')]+'%'};return _0x1f1486;})});}_0x2d52af=_[_0x0e86('0x3c')]({},_0x2d52af,_0x580138[_0x0e86('0x40')]);return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x427d8c){if(_0x427d8c){_0x52442d=_0x427d8c[_0x0e86('0x36')];if(!_0x580138[_0x0e86('0x31')][_0x0e86('0x37')]('nolimit')){_0x2d52af['limit']=qs[_0x0e86('0x1b')](_0x580138[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2d52af['offset']=qs[_0x0e86('0x19')](_0x580138[_0x0e86('0x31')]['offset']);}return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x5544cd){if(_0x5544cd){return _0x5544cd?{'count':_0x52442d,'rows':_0x5544cd}:null;}})['then'](respondWithResult(_0xb36335,null))[_0x0e86('0x45')](handleError(_0xb36335,null));};exports['addBlackLists']=function(_0x342522,_0x369a02,_0x1564e3){var _0x4e3bc0,_0x5ddc03;var _0x470a96=[];var _0x1dfe5f=moment()[_0x0e86('0x91')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0e86('0x41')]['find']({'where':{'id':_0x342522[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x369a02,null))[_0x0e86('0x23')](function(_0x3b8ad0){if(_0x3b8ad0){_0x5ddc03=_0x3b8ad0;return _0x3b8ad0['addBlackLists'](_0x342522['body'][_0x0e86('0x67')],_['omit'](_0x342522[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x5a557a){var _0x4d9f1e;var _0x175419;_0x4e3bc0=_0x5a557a||[];var _0x1e9950=[];if(_0x5a557a){for(var _0x4e3bcb=0x0;_0x4e3bcb<_0x5a557a['length'];_0x4e3bcb+=0x1){var _0x496260=_0x5a557a[_0x4e3bcb][_0x0e86('0x25')]({'plain':!![]});_0x4d9f1e=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x92'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'ContactId',_0x0e86('0x71'),_0x0e86('0x5d'),'createdAt',_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0x496260['CmListId']['toString'](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x342522['params']['id']['toString'](),_0x0e86('0x5d'))['field']('NOW()',_0x0e86('0x55'))[_0x0e86('0x72')]('NOW()',_0x0e86('0x56'))['from'](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0x496260[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79')))['toString']();_0x1e9950['push'](db['sequelize'][_0x0e86('0x31')](_0x4d9f1e));}return BPromise['all'](_0x1e9950);}})[_0x0e86('0x23')](function(){return _0x4e3bc0;})[_0x0e86('0x23')](respondWithResult(_0x369a02,null))[_0x0e86('0x45')](handleError(_0x369a02,null));};exports['removeBlackLists']=function(_0x33c463,_0x56cd27,_0x51dc39){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33c463['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x56cd27,null))[_0x0e86('0x23')](function(_0x2d4e0c){if(_0x2d4e0c){return _0x2d4e0c[_0x0e86('0x93')](_0x33c463['query'][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x468f4e){if(_0x468f4e){return db['CmHopperBlack'][_0x0e86('0x24')]({'where':{'ListId':_0x33c463['query'][_0x0e86('0x67')],'CampaignId':_0x33c463['params']['id']}})['then'](function(){return _0x468f4e;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x56cd27,null))['catch'](handleError(_0x56cd27,null));}; \ No newline at end of file +var _0xbca8=['hasOwnProperty','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','apply','reject','then','destroy','get','IvrCampaigns','end','error','name','send','map','Campaign','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','clone','params','options','createdAt','updatedAt','body','omit','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0xbca8,0xcc));var _0x8bca=function(_0x40d342,_0x110e54){_0x40d342=_0x40d342-0x0;var _0x153c50=_0xbca8[_0x40d342];return _0x153c50;};'use strict';var emlformat=require(_0x8bca('0x0'));var rimraf=require(_0x8bca('0x1'));var zipdir=require(_0x8bca('0x2'));var jsonpatch=require(_0x8bca('0x3'));var rp=require(_0x8bca('0x4'));var moment=require('moment');var BPromise=require(_0x8bca('0x5'));var Mustache=require(_0x8bca('0x6'));var util=require(_0x8bca('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8bca('0x8'));var ejs=require(_0x8bca('0x9'));var fs=require('fs');var fs_extra=require(_0x8bca('0xa'));var _=require(_0x8bca('0xb'));var squel=require('squel');var crypto=require(_0x8bca('0xc'));var jsforce=require(_0x8bca('0xd'));var deskjs=require(_0x8bca('0xe'));var toCsv=require(_0x8bca('0x8'));var querystring=require(_0x8bca('0xf'));var Papa=require(_0x8bca('0x10'));var Redis=require(_0x8bca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bca('0x12'));var hardwareService=require(_0x8bca('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8bca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8bca('0x15'));var db=require(_0x8bca('0x16'))['db'];function respondWithStatusCode(_0x5eec01,_0x62c6d1){_0x62c6d1=_0x62c6d1||0xcc;return function(_0x1fe1b5){if(_0x1fe1b5){return _0x5eec01[_0x8bca('0x17')](_0x62c6d1);}return _0x5eec01[_0x8bca('0x18')](_0x62c6d1)['end']();};}function respondWithResult(_0x4bbf5c,_0x250d09){_0x250d09=_0x250d09||0xc8;return function(_0x59b65b){if(_0x59b65b){return _0x4bbf5c[_0x8bca('0x18')](_0x250d09)[_0x8bca('0x19')](_0x59b65b);}};}function respondWithFilteredResult(_0x145cfd,_0x2e3633){return function(_0x1c3590){if(_0x1c3590){var _0x1c78d5=typeof _0x2e3633['offset']==='undefined'&&typeof _0x2e3633[_0x8bca('0x1a')]==='undefined';var _0x2bd7b1=_0x1c3590[_0x8bca('0x1b')];var _0x4e24c8=_0x1c78d5?0x0:_0x2e3633['offset'];var _0x5622ba=_0x1c78d5?_0x1c3590[_0x8bca('0x1b')]:_0x2e3633[_0x8bca('0x1c')]+_0x2e3633['limit'];var _0x1a834c;if(_0x5622ba>=_0x2bd7b1){_0x5622ba=_0x2bd7b1;_0x1a834c=0xc8;}else{_0x1a834c=0xce;}_0x145cfd['status'](_0x1a834c);return _0x145cfd['set']('Content-Range',_0x4e24c8+'-'+_0x5622ba+'/'+_0x2bd7b1)[_0x8bca('0x19')](_0x1c3590);}return null;};}function patchUpdates(_0x17046f){return function(_0xdafaa1){try{jsonpatch[_0x8bca('0x1d')](_0xdafaa1,_0x17046f,!![]);}catch(_0x2d64cd){return BPromise[_0x8bca('0x1e')](_0x2d64cd);}return _0xdafaa1['save']();};}function saveUpdates(_0x315a59,_0x20dc10){return function(_0xf3296b){if(_0xf3296b){return _0xf3296b['update'](_0x315a59)[_0x8bca('0x1f')](function(_0x5ac207){return _0x5ac207;});}return null;};}function removeEntity(_0x1f014d,_0x4e4bff){return function(_0x2e3522){if(_0x2e3522){return _0x2e3522[_0x8bca('0x20')]()[_0x8bca('0x1f')](function(){var _0x8620e2=_0x2e3522[_0x8bca('0x21')]({'plain':!![]});var _0x3a7498=_0x8bca('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a7498,'resourceId':_0x8620e2['id']}})[_0x8bca('0x1f')](function(){return _0x2e3522;});})[_0x8bca('0x1f')](function(){_0x1f014d['status'](0xcc)[_0x8bca('0x23')]();});}};}function handleEntityNotFound(_0x706106,_0x103b53){return function(_0x344eae){if(!_0x344eae){_0x706106[_0x8bca('0x17')](0x194);}return _0x344eae;};}function handleError(_0x54ccae,_0x4767b5){_0x4767b5=_0x4767b5||0x1f4;return function(_0x58bfda){logger[_0x8bca('0x24')](_0x58bfda['stack']);if(_0x58bfda[_0x8bca('0x25')]){delete _0x58bfda[_0x8bca('0x25')];}_0x54ccae[_0x8bca('0x18')](_0x4767b5)[_0x8bca('0x26')](_0x58bfda);};}exports['index']=function(_0x252819,_0x429c3a){var _0x288f99={},_0x543897={},_0x539f7e={'count':0x0,'rows':[]};var _0x4dc8ef=_[_0x8bca('0x27')](db[_0x8bca('0x28')][_0x8bca('0x29')],function(_0x5b13a1){return{'name':_0x5b13a1[_0x8bca('0x2a')],'type':_0x5b13a1[_0x8bca('0x2b')]['key']};});_0x543897[_0x8bca('0x2c')]=_[_0x8bca('0x27')](_0x4dc8ef,_0x8bca('0x25'));_0x543897[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x252819['query']);_0x543897[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x543897[_0x8bca('0x2c')],_0x543897[_0x8bca('0x2d')]);_0x288f99[_0x8bca('0x31')]=_['intersection'](_0x543897[_0x8bca('0x2c')],qs['fields'](_0x252819['query'][_0x8bca('0x32')]));_0x288f99[_0x8bca('0x31')]=_0x288f99['attributes']['length']?_0x288f99[_0x8bca('0x31')]:_0x543897[_0x8bca('0x2c')];if(!_0x252819[_0x8bca('0x2d')]['hasOwnProperty'](_0x8bca('0x33'))){_0x288f99['limit']=qs[_0x8bca('0x1a')](_0x252819[_0x8bca('0x2d')]['limit']);_0x288f99[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x252819[_0x8bca('0x2d')]['offset']);}_0x288f99[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x252819['query']['sort']);_0x288f99[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x252819['query'],_0x543897[_0x8bca('0x2f')]),_0x4dc8ef);if(_0x252819[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x288f99[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x288f99[_0x8bca('0x36')],{'$or':_['map'](_0x4dc8ef,function(_0x150b0d){if(_0x150b0d[_0x8bca('0x2b')]!==_0x8bca('0x39')){var _0x8873d1={};_0x8873d1[_0x150b0d[_0x8bca('0x25')]]={'$like':'%'+_0x252819[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x8873d1;}})});}_0x288f99=_[_0x8bca('0x38')]({},_0x288f99,_0x252819['options']);var _0x4c01f7={'where':_0x288f99[_0x8bca('0x36')]};return db[_0x8bca('0x28')]['count'](_0x4c01f7)[_0x8bca('0x1f')](function(_0x2bc3ff){_0x539f7e[_0x8bca('0x1b')]=_0x2bc3ff;if(_0x252819[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x288f99[_0x8bca('0x3b')]=[{'all':!![]}];}return db[_0x8bca('0x28')][_0x8bca('0x3c')](_0x288f99);})[_0x8bca('0x1f')](function(_0x4b2839){_0x539f7e[_0x8bca('0x3d')]=_0x4b2839;return _0x539f7e;})['then'](respondWithFilteredResult(_0x429c3a,_0x288f99))[_0x8bca('0x3e')](handleError(_0x429c3a,null));};exports[_0x8bca('0x3f')]=function(_0x23bd03,_0x11a4be){var _0x291a77={'raw':![],'where':{'id':_0x23bd03['params']['id']}},_0x165404={};_0x165404[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db['Campaign'][_0x8bca('0x29')]);_0x165404['query']=_['keys'](_0x23bd03['query']);_0x165404['filters']=_[_0x8bca('0x30')](_0x165404[_0x8bca('0x2c')],_0x165404[_0x8bca('0x2d')]);_0x291a77[_0x8bca('0x31')]=_['intersection'](_0x165404[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x23bd03[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x291a77['attributes']=_0x291a77[_0x8bca('0x31')][_0x8bca('0x40')]?_0x291a77[_0x8bca('0x31')]:_0x165404[_0x8bca('0x2c')];if(_0x23bd03[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x291a77[_0x8bca('0x3b')]=[{'all':!![]}];}_0x291a77=_[_0x8bca('0x38')]({},_0x291a77,_0x23bd03['options']);return db[_0x8bca('0x28')][_0x8bca('0x41')](_0x291a77)['then'](handleEntityNotFound(_0x11a4be,null))['then'](respondWithResult(_0x11a4be,null))[_0x8bca('0x3e')](handleError(_0x11a4be,null));};exports[_0x8bca('0x42')]=function(_0x41379f,_0x58a6c0){return db[_0x8bca('0x28')][_0x8bca('0x42')](_0x41379f['body'],{})[_0x8bca('0x1f')](function(_0x123e37){var _0x32e030=_0x41379f[_0x8bca('0x43')]['get']({'plain':!![]});if(!_0x32e030)throw new Error(_0x8bca('0x44'));if(_0x32e030[_0x8bca('0x45')]==='user'){var _0x3174b0=_0x123e37[_0x8bca('0x21')]({'plain':!![]});var _0x16dfb9='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x16dfb9,'userProfileId':_0x32e030[_0x8bca('0x46')]},'raw':!![]})['then'](function(_0x3547bd){if(_0x3547bd&&_0x3547bd[_0x8bca('0x47')]===0x0){return db['UserProfileResource'][_0x8bca('0x42')]({'name':_0x3174b0[_0x8bca('0x25')],'resourceId':_0x3174b0['id'],'type':_0x3547bd['name'],'sectionId':_0x3547bd['id']},{})[_0x8bca('0x1f')](function(){return _0x123e37;});}else{return _0x123e37;}})[_0x8bca('0x3e')](function(_0x5b4ffd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b4ffd);throw _0x5b4ffd;});}return _0x123e37;})[_0x8bca('0x1f')](respondWithResult(_0x58a6c0,0xc9))[_0x8bca('0x3e')](handleError(_0x58a6c0,null));};exports[_0x8bca('0x48')]=function(_0x134d07,_0x5c14dd){var _0xc2ec12={'where':{'id':_0x134d07[_0x8bca('0x49')]['id']}},_0x6e7dd7={};_0x6e7dd7[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x28')][_0x8bca('0x29')]);_0xc2ec12[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x6e7dd7[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x134d07[_0x8bca('0x2d')][_0x8bca('0x32')]));_0xc2ec12[_0x8bca('0x31')]=_0xc2ec12[_0x8bca('0x31')]['length']?_0xc2ec12[_0x8bca('0x31')]:_0x6e7dd7[_0x8bca('0x2c')];if(_0x134d07['query'][_0x8bca('0x3a')]){_0xc2ec12[_0x8bca('0x3b')]=[{'all':!![]}];}_0xc2ec12=_[_0x8bca('0x38')]({},_0xc2ec12,_0x134d07[_0x8bca('0x4a')]);return db[_0x8bca('0x28')][_0x8bca('0x41')](_0xc2ec12)[_0x8bca('0x1f')](handleEntityNotFound(_0x5c14dd,null))[_0x8bca('0x1f')](function(_0x2ce8fb){if(_0x2ce8fb){var _0x411772=_0x2ce8fb[_0x8bca('0x21')]({'plain':!![]});_0x411772=qs['omit'](_0x411772,['id',_0x8bca('0x4b'),_0x8bca('0x4c')]);_0x134d07[_0x8bca('0x4d')]=_[_0x8bca('0x4e')](_0x134d07['body'],['id',_0x8bca('0x4b'),_0x8bca('0x4c')]);return db[_0x8bca('0x28')][_0x8bca('0x42')](_['merge'](_0x411772,_0x134d07[_0x8bca('0x4d')]),{'include':_0x134d07[_0x8bca('0x2d')][_0x8bca('0x3a')]?[{'all':!![]}]:undefined})[_0x8bca('0x1f')](function(_0x1d3975){var _0x13d038=_0x134d07[_0x8bca('0x43')][_0x8bca('0x21')]({'plain':!![]});if(!_0x13d038)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d038['role']===_0x8bca('0x43')){var _0x1d9b41=_0x1d3975[_0x8bca('0x21')]({'plain':!![]});var _0x30f6b3=_0x8bca('0x22');return db[_0x8bca('0x4f')]['find']({'where':{'name':_0x30f6b3,'userProfileId':_0x13d038[_0x8bca('0x46')]},'raw':!![]})['then'](function(_0x1672fe){if(_0x1672fe&&_0x1672fe['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1d9b41[_0x8bca('0x25')],'resourceId':_0x1d9b41['id'],'type':_0x1672fe[_0x8bca('0x25')],'sectionId':_0x1672fe['id']},{})[_0x8bca('0x1f')](function(){return _0x1d3975;});}else{return _0x1d3975;}})[_0x8bca('0x3e')](function(_0x153116){logger['error'](_0x8bca('0x50'),_0x153116);throw _0x153116;});}return _0x1d3975;});}})[_0x8bca('0x1f')](respondWithResult(_0x5c14dd,0xc9))[_0x8bca('0x3e')](handleError(_0x5c14dd,null));};exports[_0x8bca('0x51')]=function(_0x17cb8e,_0x1133fe){if(_0x17cb8e['body']['id']){delete _0x17cb8e['body']['id'];}return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x17cb8e['params']['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x1133fe,null))[_0x8bca('0x1f')](saveUpdates(_0x17cb8e[_0x8bca('0x4d')],null))[_0x8bca('0x1f')](respondWithResult(_0x1133fe,null))[_0x8bca('0x3e')](handleError(_0x1133fe,null));};exports[_0x8bca('0x20')]=function(_0x2621ac,_0x3e8058){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x2621ac['params']['id']}})['then'](handleEntityNotFound(_0x3e8058,null))[_0x8bca('0x1f')](removeEntity(_0x3e8058,null))[_0x8bca('0x3e')](handleError(_0x3e8058,null));};exports[_0x8bca('0x52')]=function(_0x12ab81,_0x33d117,_0x26f374){var _0x18c6cb={'raw':!![],'where':{}};var _0x4dd3d5={};var _0x35e6eb={'count':0x0,'rows':[]};return db[_0x8bca('0x28')]['findOne']({'where':{'id':_0x12ab81[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x33d117,null))[_0x8bca('0x1f')](function(_0x243988){if(_0x243988){_0x4dd3d5['model']=_[_0x8bca('0x2e')](db[_0x8bca('0x53')][_0x8bca('0x29')]);_0x4dd3d5[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x12ab81[_0x8bca('0x2d')]);_0x4dd3d5[_0x8bca('0x2f')]=_['intersection'](_0x4dd3d5['model'],_0x4dd3d5[_0x8bca('0x2d')]);_0x18c6cb[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x4dd3d5[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x18c6cb['attributes']=_0x18c6cb[_0x8bca('0x31')][_0x8bca('0x40')]?_0x18c6cb[_0x8bca('0x31')]:_0x4dd3d5[_0x8bca('0x2c')];if(!_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x18c6cb[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x12ab81[_0x8bca('0x2d')]['limit']);_0x18c6cb[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x12ab81['query'][_0x8bca('0x1c')]);}_0x18c6cb[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x18c6cb['where']=qs[_0x8bca('0x2f')](_[_0x8bca('0x55')](_0x12ab81[_0x8bca('0x2d')],_0x4dd3d5[_0x8bca('0x2f')]));_0x18c6cb[_0x8bca('0x36')][_0x8bca('0x56')]=_0x243988['id'];if(_0x12ab81['query'][_0x8bca('0x37')]){_0x18c6cb[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x18c6cb[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x18c6cb['attributes'],function(_0x35958f){var _0x42b85b={};_0x42b85b[_0x35958f]={'$like':'%'+_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x42b85b;})});}_0x18c6cb=_[_0x8bca('0x38')]({},_0x18c6cb,_0x12ab81[_0x8bca('0x4a')]);return db['CmHopper'][_0x8bca('0x1b')]({'where':_0x18c6cb[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x4d9477){_0x35e6eb['count']=_0x4d9477;if(_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x18c6cb[_0x8bca('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x8bca('0x3c')](_0x18c6cb);})['then'](function(_0x12fc38){_0x35e6eb['rows']=_0x12fc38;return _0x35e6eb;});}})['then'](respondWithFilteredResult(_0x33d117,_0x18c6cb))[_0x8bca('0x3e')](handleError(_0x33d117,null));};exports[_0x8bca('0x57')]=function(_0x18d999,_0x57ae60,_0x1fa442){var _0x46d56a={'raw':!![],'where':{}};var _0x5e5b2c={};var _0x3281c7={'count':0x0,'rows':[]};return db['Campaign'][_0x8bca('0x58')]({'where':{'id':_0x18d999['params']['id']}})['then'](handleEntityNotFound(_0x57ae60,null))[_0x8bca('0x1f')](function(_0x2a308b){if(_0x2a308b){_0x5e5b2c['model']=_[_0x8bca('0x2e')](db[_0x8bca('0x59')][_0x8bca('0x29')]);_0x5e5b2c[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x18d999[_0x8bca('0x2d')]);_0x5e5b2c['filters']=_['intersection'](_0x5e5b2c[_0x8bca('0x2c')],_0x5e5b2c['query']);_0x46d56a['attributes']=_['intersection'](_0x5e5b2c['model'],qs[_0x8bca('0x32')](_0x18d999['query'][_0x8bca('0x32')]));_0x46d56a[_0x8bca('0x31')]=_0x46d56a[_0x8bca('0x31')][_0x8bca('0x40')]?_0x46d56a[_0x8bca('0x31')]:_0x5e5b2c[_0x8bca('0x2c')];if(!_0x18d999[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x46d56a['limit']=qs[_0x8bca('0x1a')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x1a')]);_0x46d56a[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x1c')]);}_0x46d56a['order']=qs[_0x8bca('0x35')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x46d56a[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x18d999['query'],_0x5e5b2c[_0x8bca('0x2f')]));_0x46d56a[_0x8bca('0x36')]['CampaignId']=_0x2a308b['id'];if(_0x18d999[_0x8bca('0x2d')]['filter']){_0x46d56a[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x46d56a[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x46d56a[_0x8bca('0x31')],function(_0x153ff1){var _0x1455fd={};_0x1455fd[_0x153ff1]={'$like':'%'+_0x18d999[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x1455fd;})});}_0x46d56a=_['merge']({},_0x46d56a,_0x18d999[_0x8bca('0x4a')]);return db[_0x8bca('0x59')][_0x8bca('0x1b')]({'where':_0x46d56a[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x566946){_0x3281c7['count']=_0x566946;if(_0x18d999[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x46d56a['include']=[{'all':!![]}];}return db[_0x8bca('0x59')][_0x8bca('0x3c')](_0x46d56a);})[_0x8bca('0x1f')](function(_0x3dde74){_0x3281c7[_0x8bca('0x3d')]=_0x3dde74;return _0x3281c7;});}})['then'](respondWithFilteredResult(_0x57ae60,_0x46d56a))[_0x8bca('0x3e')](handleError(_0x57ae60,null));};exports[_0x8bca('0x5a')]=function(_0x319387,_0xef2a8b,_0x2c1557){var _0x473672={'raw':!![],'where':{}};var _0x222efa={};var _0x90fafe={'count':0x0,'rows':[]};return db[_0x8bca('0x28')]['findOne']({'where':{'id':_0x319387[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0xef2a8b,null))['then'](function(_0x2143e2){if(_0x2143e2){_0x222efa[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db['CmHopperFinal'][_0x8bca('0x29')]);_0x222efa[_0x8bca('0x2d')]=_['keys'](_0x319387[_0x8bca('0x2d')]);_0x222efa[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x222efa[_0x8bca('0x2c')],_0x222efa[_0x8bca('0x2d')]);_0x473672['attributes']=_[_0x8bca('0x30')](_0x222efa[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x319387[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x473672['attributes']=_0x473672[_0x8bca('0x31')][_0x8bca('0x40')]?_0x473672[_0x8bca('0x31')]:_0x222efa['model'];if(!_0x319387['query']['hasOwnProperty'](_0x8bca('0x33'))){_0x473672[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x319387[_0x8bca('0x2d')]['limit']);_0x473672['offset']=qs[_0x8bca('0x1c')](_0x319387[_0x8bca('0x2d')][_0x8bca('0x1c')]);}_0x473672[_0x8bca('0x34')]=qs['sort'](_0x319387['query'][_0x8bca('0x35')]);_0x473672['where']=qs[_0x8bca('0x2f')](_[_0x8bca('0x55')](_0x319387[_0x8bca('0x2d')],_0x222efa[_0x8bca('0x2f')]));_0x473672[_0x8bca('0x36')]['CampaignId']=_0x2143e2['id'];if(_0x319387['query'][_0x8bca('0x37')]){_0x473672[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x473672[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x473672['attributes'],function(_0x49e6f0){var _0x2d6d91={};_0x2d6d91[_0x49e6f0]={'$like':'%'+_0x319387[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x2d6d91;})});}_0x473672=_[_0x8bca('0x38')]({},_0x473672,_0x319387[_0x8bca('0x4a')]);return db[_0x8bca('0x5b')][_0x8bca('0x1b')]({'where':_0x473672[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x30470c){_0x90fafe[_0x8bca('0x1b')]=_0x30470c;if(_0x319387[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x473672['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x8bca('0x3c')](_0x473672);})[_0x8bca('0x1f')](function(_0x5dbd2e){_0x90fafe[_0x8bca('0x3d')]=_0x5dbd2e;return _0x90fafe;});}})[_0x8bca('0x1f')](respondWithFilteredResult(_0xef2a8b,_0x473672))[_0x8bca('0x3e')](handleError(_0xef2a8b,null));};exports[_0x8bca('0x5c')]=function(_0x280d1d,_0x215c78,_0x45bd58){var _0x1a5a65={'raw':!![],'where':{}};var _0x194f58={};var _0x12d957={'count':0x0,'rows':[]};return db['Campaign'][_0x8bca('0x58')]({'where':{'id':_0x280d1d[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x215c78,null))[_0x8bca('0x1f')](function(_0xd09bd0){if(_0xd09bd0){_0x194f58[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x5d')][_0x8bca('0x29')]);_0x194f58[_0x8bca('0x2d')]=_['keys'](_0x280d1d[_0x8bca('0x2d')]);_0x194f58[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x194f58['model'],_0x194f58[_0x8bca('0x2d')]);_0x1a5a65[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x194f58[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x1a5a65[_0x8bca('0x31')]=_0x1a5a65[_0x8bca('0x31')][_0x8bca('0x40')]?_0x1a5a65[_0x8bca('0x31')]:_0x194f58[_0x8bca('0x2c')];if(!_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x1a5a65[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x1a')]);_0x1a5a65[_0x8bca('0x1c')]=qs['offset'](_0x280d1d['query']['offset']);}_0x1a5a65[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x1a5a65[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x280d1d[_0x8bca('0x2d')],_0x194f58['filters']));_0x1a5a65[_0x8bca('0x36')]['CampaignId']=_0xd09bd0['id'];if(_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x1a5a65['where']=_['merge'](_0x1a5a65[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x1a5a65[_0x8bca('0x31')],function(_0x4fb3e2){var _0x5cfce1={};_0x5cfce1[_0x4fb3e2]={'$like':'%'+_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x5cfce1;})});}_0x1a5a65=_[_0x8bca('0x38')]({},_0x1a5a65,_0x280d1d[_0x8bca('0x4a')]);return db[_0x8bca('0x5d')][_0x8bca('0x1b')]({'where':_0x1a5a65['where']})['then'](function(_0x2b1e57){_0x12d957[_0x8bca('0x1b')]=_0x2b1e57;if(_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x1a5a65[_0x8bca('0x3b')]=[{'all':!![]}];}return db[_0x8bca('0x5d')][_0x8bca('0x3c')](_0x1a5a65);})[_0x8bca('0x1f')](function(_0x204d9c){_0x12d957[_0x8bca('0x3d')]=_0x204d9c;return _0x12d957;});}})[_0x8bca('0x1f')](respondWithFilteredResult(_0x215c78,_0x1a5a65))[_0x8bca('0x3e')](handleError(_0x215c78,null));};exports[_0x8bca('0x5e')]=function(_0x2d3041,_0x3421ae,_0x16b698){var _0x31070e={};var _0x22c9f1={};var _0x364e03;var _0x1fb3d2;return db[_0x8bca('0x28')][_0x8bca('0x58')]({'where':{'id':_0x2d3041[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x3421ae,null))[_0x8bca('0x1f')](function(_0x4cefb0){if(_0x4cefb0){_0x364e03=_0x4cefb0;_0x22c9f1[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x5f')]['rawAttributes']);_0x22c9f1[_0x8bca('0x2d')]=_['keys'](_0x2d3041[_0x8bca('0x2d')]);_0x22c9f1[_0x8bca('0x2f')]=_['intersection'](_0x22c9f1[_0x8bca('0x2c')],_0x22c9f1['query']);_0x31070e[_0x8bca('0x31')]=_['intersection'](_0x22c9f1[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x2d3041[_0x8bca('0x2d')]['fields']));_0x31070e[_0x8bca('0x31')]=_0x31070e['attributes'][_0x8bca('0x40')]?_0x31070e[_0x8bca('0x31')]:_0x22c9f1['model'];_0x31070e[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x2d3041[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x31070e[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x2d3041['query'],_0x22c9f1[_0x8bca('0x2f')]));if(_0x2d3041['query'][_0x8bca('0x37')]){_0x31070e[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x31070e[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x31070e[_0x8bca('0x31')],function(_0x55b799){var _0x5e02d2={};_0x5e02d2[_0x55b799]={'$like':'%'+_0x2d3041['query']['filter']+'%'};return _0x5e02d2;})});}_0x31070e=_[_0x8bca('0x38')]({},_0x31070e,_0x2d3041[_0x8bca('0x4a')]);return _0x364e03[_0x8bca('0x5e')](_0x31070e);}})[_0x8bca('0x1f')](function(_0x6cedc3){if(_0x6cedc3){_0x1fb3d2=_0x6cedc3['length'];if(!_0x2d3041['query'][_0x8bca('0x54')](_0x8bca('0x33'))){_0x31070e[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x2d3041['query'][_0x8bca('0x1a')]);_0x31070e[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x2d3041['query'][_0x8bca('0x1c')]);}return _0x364e03[_0x8bca('0x5e')](_0x31070e);}})[_0x8bca('0x1f')](function(_0xe6d2c6){if(_0xe6d2c6){return _0xe6d2c6?{'count':_0x1fb3d2,'rows':_0xe6d2c6}:null;}})['then'](respondWithResult(_0x3421ae,null))[_0x8bca('0x3e')](handleError(_0x3421ae,null));};exports[_0x8bca('0x60')]=function(_0x14a9c1,_0x146796,_0x3e7d0c){var _0x29eac1,_0x49c29a;var _0x2ec68f=[];var _0x3c17a4=moment()[_0x8bca('0x61')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x14a9c1[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x146796,null))[_0x8bca('0x1f')](function(_0x5b601d){if(_0x5b601d){_0x49c29a=_0x5b601d;return _0x5b601d['addLists'](_0x14a9c1[_0x8bca('0x4d')][_0x8bca('0x62')],_[_0x8bca('0x4e')](_0x14a9c1[_0x8bca('0x4d')],[_0x8bca('0x62'),'id'])||{});}return null;})[_0x8bca('0x63')](function(_0x446d0b){var _0x4a8102;var _0x19da71;_0x29eac1=_0x446d0b||[];var _0xaae941=[];if(_0x446d0b){for(var _0x37e651=0x0;_0x37e651<_0x446d0b[_0x8bca('0x40')];_0x37e651+=0x1){var _0x265c90=_0x446d0b[_0x37e651][_0x8bca('0x21')]({'plain':!![]});_0x49c29a[_0x8bca('0x64')]=_0x14a9c1[_0x8bca('0x4d')][_0x8bca('0x64')]?_0x14a9c1['body']['dialCheckDuplicateType']:_0x49c29a['dialCheckDuplicateType'];switch(_0x49c29a[_0x8bca('0x64')]){case _0x8bca('0x65'):_0x4a8102=squel['insert']()[_0x8bca('0x66')](_0x8bca('0x67'))[_0x8bca('0x68')]([_0x8bca('0x69'),_0x8bca('0x6a'),_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()['field'](_0x8bca('0x69'),_0x8bca('0x69'))[_0x8bca('0x6e')]('NOW()',_0x8bca('0x6a'))[_0x8bca('0x6e')]('id','ContactId')[_0x8bca('0x6e')](_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')](),_0x8bca('0x6c'))['field'](_0x14a9c1['params']['id']['toString'](),_0x8bca('0x56'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27','createdAt')[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))['where']('ListId\x20=\x20?',_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())[_0x8bca('0x36')](_0x8bca('0x74'))[_0x8bca('0x36')](_0x8bca('0x75'),squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x76'))[_0x8bca('0x71')](_0x8bca('0x77'))[_0x8bca('0x36')](_0x8bca('0x78'),_0x14a9c1[_0x8bca('0x49')]['id']['toString']()))[_0x8bca('0x36')](_0x8bca('0x75'),squel['select']()['field'](_0x8bca('0x79'))[_0x8bca('0x71')]('cm_hopper')['where'](_0x8bca('0x78'),_0x14a9c1['params']['id'][_0x8bca('0x70')]())))[_0x8bca('0x70')]();break;case _0x8bca('0x7a'):_0x4a8102=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')](_0x8bca('0x67'))[_0x8bca('0x68')](['phone',_0x8bca('0x6a'),_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),'createdAt',_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x69'),_0x8bca('0x69'))[_0x8bca('0x6e')](_0x8bca('0x7c'),_0x8bca('0x6a'))[_0x8bca('0x6e')]('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')](),'ListId')[_0x8bca('0x6e')](_0x14a9c1[_0x8bca('0x49')]['id'][_0x8bca('0x70')](),_0x8bca('0x56'))['field']('\x27'+_0x3c17a4+'\x27','createdAt')[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')]('cm_contacts')[_0x8bca('0x36')]('deletedAt\x20IS\x20NULL')[_0x8bca('0x36')](_0x8bca('0x7d'),_0x265c90[_0x8bca('0x6f')]['toString']())['where'](_0x8bca('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x79'))[_0x8bca('0x71')](_0x8bca('0x67'))[_0x8bca('0x36')]('CampaignId\x20=\x20?',_0x14a9c1[_0x8bca('0x49')]['id'][_0x8bca('0x70')]())))[_0x8bca('0x70')]();break;default:_0x4a8102=squel['insert']()['into']('cm_hopper')[_0x8bca('0x68')]([_0x8bca('0x69'),'scheduledAt',_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),'updatedAt'],squel['select']()[_0x8bca('0x6e')]('phone',_0x8bca('0x69'))[_0x8bca('0x6e')]('NOW()','scheduledAt')[_0x8bca('0x6e')]('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x265c90['CmListId'][_0x8bca('0x70')](),'ListId')[_0x8bca('0x6e')](_0x14a9c1['params']['id']['toString'](),'CampaignId')['field']('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4b'))['field']('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))[_0x8bca('0x36')]('ListId\x20=\x20?',_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())['where'](_0x8bca('0x74')))['toString']();}_0x19da71=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')](_0x8bca('0x7e'))[_0x8bca('0x68')]([_0x8bca('0x7f'),_0x8bca('0x6a'),'phone','OrderBy',_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x80'),'id')[_0x8bca('0x6e')](_0x8bca('0x7c'),'scheduledAt')['field']('ci.item',_0x8bca('0x69'))[_0x8bca('0x6e')](_0x8bca('0x81'),_0x8bca('0x82'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4b'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')]('cm_contact_has_items','ci')[_0x8bca('0x83')](_0x8bca('0x67'),'h',_0x8bca('0x84'))[_0x8bca('0x36')](_0x8bca('0x85'),_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())[_0x8bca('0x36')](_0x8bca('0x86'),_0x14a9c1[_0x8bca('0x49')]['id']['toString']())[_0x8bca('0x36')](_0x8bca('0x87'),_0x3c17a4))[_0x8bca('0x70')]();_0xaae941[_0x8bca('0x88')](db[_0x8bca('0x89')][_0x8bca('0x2d')](_0x4a8102));_0x2ec68f[_0x8bca('0x88')](db['sequelize'][_0x8bca('0x2d')](_0x19da71));}return BPromise[_0x8bca('0x8a')](_0xaae941);}})[_0x8bca('0x1f')](function(){return BPromise[_0x8bca('0x8a')](_0x2ec68f);})[_0x8bca('0x1f')](function(){return _0x29eac1;})[_0x8bca('0x1f')](respondWithResult(_0x146796,null))[_0x8bca('0x3e')](handleError(_0x146796,null));};exports['removeLists']=function(_0x22c7c7,_0x17b179,_0x8e017c){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x22c7c7[_0x8bca('0x49')]['id']}})['then'](handleEntityNotFound(_0x17b179,null))['then'](function(_0x314497){if(_0x314497){return _0x314497[_0x8bca('0x8b')](_0x22c7c7[_0x8bca('0x2d')][_0x8bca('0x62')]);}})[_0x8bca('0x1f')](function(_0x4525ce){if(_0x4525ce){return db[_0x8bca('0x53')][_0x8bca('0x20')]({'where':{'ListId':_0x22c7c7[_0x8bca('0x2d')][_0x8bca('0x62')],'CampaignId':_0x22c7c7[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](function(){return _0x4525ce;});}})[_0x8bca('0x1f')](respondWithStatusCode(_0x17b179,null))['catch'](handleError(_0x17b179,null));};exports[_0x8bca('0x8c')]=function(_0x510ba5,_0x27a4be,_0x44aea0){var _0x47cec2={};var _0x4e8b75={};var _0x4fa822;var _0x227f3f;return db[_0x8bca('0x28')][_0x8bca('0x58')]({'where':{'id':_0x510ba5[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x27a4be,null))[_0x8bca('0x1f')](function(_0x192bd5){if(_0x192bd5){_0x4fa822=_0x192bd5;_0x4e8b75['model']=_[_0x8bca('0x2e')](db['CmList'][_0x8bca('0x29')]);_0x4e8b75[_0x8bca('0x2d')]=_['keys'](_0x510ba5[_0x8bca('0x2d')]);_0x4e8b75[_0x8bca('0x2f')]=_['intersection'](_0x4e8b75[_0x8bca('0x2c')],_0x4e8b75[_0x8bca('0x2d')]);_0x47cec2['attributes']=_[_0x8bca('0x30')](_0x4e8b75['model'],qs[_0x8bca('0x32')](_0x510ba5[_0x8bca('0x2d')]['fields']));_0x47cec2['attributes']=_0x47cec2[_0x8bca('0x31')]['length']?_0x47cec2[_0x8bca('0x31')]:_0x4e8b75[_0x8bca('0x2c')];_0x47cec2[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x47cec2['where']=qs['filters'](_[_0x8bca('0x55')](_0x510ba5['query'],_0x4e8b75[_0x8bca('0x2f')]));if(_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x47cec2[_0x8bca('0x36')]=_['merge'](_0x47cec2[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x47cec2['attributes'],function(_0x10d2f5){var _0x23f618={};_0x23f618[_0x10d2f5]={'$like':'%'+_0x510ba5[_0x8bca('0x2d')]['filter']+'%'};return _0x23f618;})});}_0x47cec2=_[_0x8bca('0x38')]({},_0x47cec2,_0x510ba5[_0x8bca('0x4a')]);return _0x4fa822[_0x8bca('0x8c')](_0x47cec2);}})[_0x8bca('0x1f')](function(_0x23c6a2){if(_0x23c6a2){_0x227f3f=_0x23c6a2[_0x8bca('0x40')];if(!_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x47cec2[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x510ba5['query'][_0x8bca('0x1a')]);_0x47cec2[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x510ba5['query'][_0x8bca('0x1c')]);}return _0x4fa822[_0x8bca('0x8c')](_0x47cec2);}})['then'](function(_0x3e243d){if(_0x3e243d){return _0x3e243d?{'count':_0x227f3f,'rows':_0x3e243d}:null;}})[_0x8bca('0x1f')](respondWithResult(_0x27a4be,null))[_0x8bca('0x3e')](handleError(_0x27a4be,null));};exports[_0x8bca('0x8d')]=function(_0x1d2df1,_0x44dc99,_0x385119){var _0x1671d6,_0x21534b;var _0x28400f=[];var _0x2cc157=moment()[_0x8bca('0x61')](_0x8bca('0x8e'));return db['Campaign']['find']({'where':{'id':_0x1d2df1[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x44dc99,null))[_0x8bca('0x1f')](function(_0x52bef4){if(_0x52bef4){_0x21534b=_0x52bef4;return _0x52bef4[_0x8bca('0x8d')](_0x1d2df1[_0x8bca('0x4d')][_0x8bca('0x62')],_[_0x8bca('0x4e')](_0x1d2df1['body'],[_0x8bca('0x62'),'id'])||{});}return null;})[_0x8bca('0x63')](function(_0xf7b106){var _0x34fb34;var _0x13841a;_0x1671d6=_0xf7b106||[];var _0x5b9fd9=[];if(_0xf7b106){for(var _0x355512=0x0;_0x355512<_0xf7b106['length'];_0x355512+=0x1){var _0x30d51c=_0xf7b106[_0x355512][_0x8bca('0x21')]({'plain':!![]});_0x34fb34=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')]('cm_hopper_black')[_0x8bca('0x68')](['phone','ContactId',_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()['field']('phone',_0x8bca('0x69'))['field']('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x30d51c[_0x8bca('0x6f')][_0x8bca('0x70')](),_0x8bca('0x6c'))[_0x8bca('0x6e')](_0x1d2df1[_0x8bca('0x49')]['id'][_0x8bca('0x70')](),_0x8bca('0x56'))[_0x8bca('0x6e')](_0x8bca('0x7c'),'createdAt')[_0x8bca('0x6e')]('NOW()',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))[_0x8bca('0x36')](_0x8bca('0x7d'),_0x30d51c[_0x8bca('0x6f')][_0x8bca('0x70')]())['where'](_0x8bca('0x74')))[_0x8bca('0x70')]();_0x5b9fd9['push'](db[_0x8bca('0x89')]['query'](_0x34fb34));}return BPromise[_0x8bca('0x8a')](_0x5b9fd9);}})[_0x8bca('0x1f')](function(){return _0x1671d6;})['then'](respondWithResult(_0x44dc99,null))['catch'](handleError(_0x44dc99,null));};exports[_0x8bca('0x8f')]=function(_0x2dbd22,_0x570de3,_0x21d79c){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x2dbd22[_0x8bca('0x49')]['id']}})['then'](handleEntityNotFound(_0x570de3,null))[_0x8bca('0x1f')](function(_0x21ec10){if(_0x21ec10){return _0x21ec10[_0x8bca('0x8f')](_0x2dbd22['query'][_0x8bca('0x62')]);}})[_0x8bca('0x1f')](function(_0x10b7ec){if(_0x10b7ec){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x2dbd22[_0x8bca('0x2d')][_0x8bca('0x62')],'CampaignId':_0x2dbd22[_0x8bca('0x49')]['id']}})['then'](function(){return _0x10b7ec;});}})[_0x8bca('0x1f')](respondWithStatusCode(_0x570de3,null))['catch'](handleError(_0x570de3,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 864e1ba..7af845c 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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 6908ffa..3aebb79 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 _0x757f=['info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','raw','where','options','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0x757f,0xee));var _0xf757=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0x757f[_0x3beea0];return _0x314eb1;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var moment=require(_0xf757('0x1'));var BPromise=require(_0xf757('0x2'));var rs=require(_0xf757('0x3'));var fs=require('fs');var Redis=require(_0xf757('0x4'));var db=require(_0xf757('0x5'))['db'];var utils=require(_0xf757('0x6'));var logger=require(_0xf757('0x7'))(_0xf757('0x8'));var config=require(_0xf757('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf757('0xa')][_0xf757('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e1e06,_0x2c0fcf,_0x44b312){return new BPromise(function(_0x565224,_0x5bf802){return client[_0xf757('0xc')](_0x4e1e06,_0x44b312)[_0xf757('0xd')](function(_0x1360ac){logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));logger[_0xf757('0x10')](_0xf757('0x11'),_0x2c0fcf,_0xf757('0xf'),JSON[_0xf757('0x12')](_0x1360ac));if(_0x1360ac[_0xf757('0x13')]){if(_0x1360ac[_0xf757('0x13')][_0xf757('0x14')]===0x1f4){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x5bf802(_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);}logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x565224(_0x1360ac['error'][_0xf757('0x16')]);}else{logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));_0x565224(_0x1360ac[_0xf757('0x17')][_0xf757('0x16')]);}})['catch'](function(_0x1c5934){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1c5934);_0x5bf802(_0x1c5934);});});}exports[_0xf757('0x18')]=function(_0x54af52){var _0x2ef7fe=this;return new Promise(function(_0x4124a0,_0x23277e){return db[_0xf757('0x19')][_0xf757('0x1a')]({'raw':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1b')]===undefined?!![]:![]:!![],'where':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1c')]||null:null,'attributes':_0x54af52[_0xf757('0x1d')]?_0x54af52['options'][_0xf757('0x1e')]||null:null,'limit':_0x54af52[_0xf757('0x1d')]?_0x54af52[_0xf757('0x1d')][_0xf757('0x1f')]||null:null,'include':_0x54af52['options']?_0x54af52['options'][_0xf757('0x20')]?_[_0xf757('0x21')](_0x54af52[_0xf757('0x1d')][_0xf757('0x20')],function(_0x3d38dd){return{'model':db[_0x3d38dd[_0xf757('0x22')]],'as':_0x3d38dd['as'],'attributes':_0x3d38dd[_0xf757('0x1e')],'include':_0x3d38dd[_0xf757('0x20')]?_[_0xf757('0x21')](_0x3d38dd[_0xf757('0x20')],function(_0x4d9012){return{'model':db[_0x4d9012['model']],'as':_0x4d9012['as'],'attributes':_0x4d9012[_0xf757('0x1e')],'include':_0x4d9012[_0xf757('0x20')]?_[_0xf757('0x21')](_0x4d9012[_0xf757('0x20')],function(_0x207bae){return{'model':db[_0x207bae[_0xf757('0x22')]],'as':_0x207bae['as'],'attributes':_0x207bae[_0xf757('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf757('0xd')](function(_0x58ac7a){logger['info'](_0xf757('0x18'),_0x54af52);logger['debug'](_0xf757('0x18'),_0x54af52,JSON['stringify'](_0x58ac7a));_0x4124a0(_0x58ac7a);})[_0xf757('0x23')](function(_0x1345d6){logger['error'](_0xf757('0x18'),_0x1345d6[_0xf757('0x16')],_0x54af52);_0x23277e(_0x2ef7fe[_0xf757('0x13')](0x1f4,_0x1345d6[_0xf757('0x16')]));});});}; \ No newline at end of file +var _0xce25=['code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x3ab4bb,_0x4568e8){var _0x46aa87=function(_0xcc43bf){while(--_0xcc43bf){_0x3ab4bb['push'](_0x3ab4bb['shift']());}};_0x46aa87(++_0x4568e8);}(_0xce25,0x196));var _0x5ce2=function(_0x238020,_0x3fa739){_0x238020=_0x238020-0x0;var _0x550533=_0xce25[_0x238020];return _0x550533;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ce2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce2('0x1'))['db'];var utils=require(_0x5ce2('0x2'));var logger=require('../../config/logger')(_0x5ce2('0x3'));var config=require(_0x5ce2('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ce2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x417149,_0x1ab2e7,_0xcb80ee){return new BPromise(function(_0x4a57a6,_0x2ccf81){return client[_0x5ce2('0x6')](_0x417149,_0xcb80ee)[_0x5ce2('0x7')](function(_0x49ede4){logger[_0x5ce2('0x8')](_0x5ce2('0x9'),_0x1ab2e7,_0x5ce2('0xa'));logger[_0x5ce2('0xb')](_0x5ce2('0xc'),_0x1ab2e7,_0x5ce2('0xa'),JSON['stringify'](_0x49ede4));if(_0x49ede4[_0x5ce2('0xd')]){if(_0x49ede4['error'][_0x5ce2('0xe')]===0x1f4){logger[_0x5ce2('0xd')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4['error']['message']);return _0x2ccf81(_0x49ede4['error'][_0x5ce2('0xf')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4[_0x5ce2('0xd')]['message']);return _0x4a57a6(_0x49ede4[_0x5ce2('0xd')][_0x5ce2('0xf')]);}else{logger[_0x5ce2('0x8')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x5ce2('0xa'));_0x4a57a6(_0x49ede4[_0x5ce2('0x10')][_0x5ce2('0xf')]);}})['catch'](function(_0x4b89d3){logger[_0x5ce2('0xd')](_0x5ce2('0x9'),_0x1ab2e7,_0x4b89d3);_0x2ccf81(_0x4b89d3);});});}exports[_0x5ce2('0x11')]=function(_0x5369e7){var _0x19915d=this;return new Promise(function(_0x30cb39,_0x3dd57a){return db[_0x5ce2('0x12')][_0x5ce2('0x13')]({'raw':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x15')]===undefined?!![]:![]:!![],'where':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x16')]||null:null,'attributes':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x17')]||null:null,'limit':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x18')]||null:null,'include':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')]['include']?_['map'](_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x19')],function(_0x3440b5){return{'model':db[_0x3440b5['model']],'as':_0x3440b5['as'],'attributes':_0x3440b5['attributes'],'include':_0x3440b5[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3440b5['include'],function(_0x3008af){return{'model':db[_0x3008af[_0x5ce2('0x1b')]],'as':_0x3008af['as'],'attributes':_0x3008af[_0x5ce2('0x17')],'include':_0x3008af[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3008af[_0x5ce2('0x19')],function(_0x3a4bb9){return{'model':db[_0x3a4bb9[_0x5ce2('0x1b')]],'as':_0x3a4bb9['as'],'attributes':_0x3a4bb9[_0x5ce2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5ce2('0x7')](function(_0x2f4ccd){logger[_0x5ce2('0x8')](_0x5ce2('0x11'),_0x5369e7);logger[_0x5ce2('0xb')](_0x5ce2('0x11'),_0x5369e7,JSON[_0x5ce2('0x1c')](_0x2f4ccd));_0x30cb39(_0x2f4ccd);})[_0x5ce2('0x1d')](function(_0x2898ae){logger[_0x5ce2('0xd')](_0x5ce2('0x11'),_0x2898ae[_0x5ce2('0xf')],_0x5369e7);_0x3dd57a(_0x19915d[_0x5ce2('0xd')](0x1f4,_0x2898ae[_0x5ce2('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 736a7eb..3d000d7 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 _0x6208=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','get','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x47370b,_0x1c12e8){var _0x43e3e2=function(_0x52fffe){while(--_0x52fffe){_0x47370b['push'](_0x47370b['shift']());}};_0x43e3e2(++_0x1c12e8);}(_0x6208,0x15c));var _0x8620=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x6208[_0x2fbd0e];return _0x481c9f;};'use strict';var multer=require(_0x8620('0x0'));var util=require(_0x8620('0x1'));var path=require('path');var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var fs_extra=require(_0x8620('0x4'));var auth=require(_0x8620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8620('0x6'));router['get']('/',auth[_0x8620('0x7')](),controller['index']);router[_0x8620('0x8')](_0x8620('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8620('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x8620('0x8')](_0x8620('0xa'),auth[_0x8620('0x7')](),controller[_0x8620('0xb')]);router[_0x8620('0x8')](_0x8620('0xc'),auth[_0x8620('0x7')](),controller[_0x8620('0xd')]);router[_0x8620('0x8')](_0x8620('0xe'),auth[_0x8620('0x7')](),controller['getHopperBlacks']);router[_0x8620('0x8')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller['getLists']);router[_0x8620('0x8')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller[_0x8620('0x11')]);router[_0x8620('0x12')]('/',auth[_0x8620('0x7')](),controller[_0x8620('0x13')]);router[_0x8620('0x12')](_0x8620('0x14'),auth[_0x8620('0x7')](),controller[_0x8620('0x15')]);router[_0x8620('0x12')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x16')]);router[_0x8620('0x12')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller['addBlackLists']);router[_0x8620('0x17')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller['update']);router[_0x8620('0x18')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller[_0x8620('0x19')]);router['delete'](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x1a')]);router[_0x8620('0x18')]('/:id/blacklists',auth[_0x8620('0x7')](),controller[_0x8620('0x1b')]);module[_0x8620('0x1c')]=router; \ No newline at end of file +var _0x5119=['/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','clone','addLists','put','/:id','update','destroy','removeLists','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','show','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x19e785,_0x115ef1){var _0x5b4a67=function(_0x156346){while(--_0x156346){_0x19e785['push'](_0x19e785['shift']());}};_0x5b4a67(++_0x115ef1);}(_0x5119,0xc0));var _0x9511=function(_0x3b6d96,_0x5d3241){_0x3b6d96=_0x3b6d96-0x0;var _0x1e6b1c=_0x5119[_0x3b6d96];return _0x1e6b1c;};'use strict';var multer=require(_0x9511('0x0'));var util=require('util');var path=require(_0x9511('0x1'));var timeout=require(_0x9511('0x2'));var express=require(_0x9511('0x3'));var router=express[_0x9511('0x4')]();var fs_extra=require(_0x9511('0x5'));var auth=require(_0x9511('0x6'));var interaction=require(_0x9511('0x7'));var config=require(_0x9511('0x8'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9511('0x9')]);router['get']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0xb')]);router[_0x9511('0xc')](_0x9511('0xd'),auth[_0x9511('0xa')](),controller[_0x9511('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x9511('0xf')]);router[_0x9511('0xc')](_0x9511('0x10'),auth['isAuthenticated'](),controller[_0x9511('0x11')]);router[_0x9511('0xc')](_0x9511('0x12'),auth[_0x9511('0xa')](),controller[_0x9511('0x13')]);router[_0x9511('0xc')](_0x9511('0x14'),auth[_0x9511('0xa')](),controller['getLists']);router[_0x9511('0xc')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller['getBlackLists']);router[_0x9511('0x16')]('/',auth['isAuthenticated'](),controller[_0x9511('0x17')]);router['post'](_0x9511('0x18'),auth[_0x9511('0xa')](),controller[_0x9511('0x19')]);router['post'](_0x9511('0x14'),auth[_0x9511('0xa')](),controller[_0x9511('0x1a')]);router[_0x9511('0x16')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller['addBlackLists']);router[_0x9511('0x1b')](_0x9511('0x1c'),auth['isAuthenticated'](),controller[_0x9511('0x1d')]);router['delete']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0x1e')]);router['delete'](_0x9511('0x14'),auth[_0x9511('0xa')](),controller[_0x9511('0x1f')]);router[_0x9511('0x20')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller[_0x9511('0x21')]);module[_0x9511('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e61b06c..a079c6f 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 _0xbc74=['exports','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0x10d8ad,_0x4c10fa){var _0x212cfc=function(_0x40a5d7){while(--_0x40a5d7){_0x10d8ad['push'](_0x10d8ad['shift']());}};_0x212cfc(++_0x4c10fa);}(_0xbc74,0x162));var _0x4bc7=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xbc74[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0x4bc7('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4bc7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4bc7('0x2')]},'name':{'type':Sequelize[_0x4bc7('0x3')],'get':function(){return this[_0x4bc7('0x4')](_0x4bc7('0x5'));}}}; \ No newline at end of file +var _0x1497=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x4a258b,_0xb0006c){var _0x5ea6dc=function(_0x43bae0){while(--_0x43bae0){_0x4a258b['push'](_0x4a258b['shift']());}};_0x5ea6dc(++_0xb0006c);}(_0x1497,0x1ec));var _0x7149=function(_0x435d38,_0x2a187a){_0x435d38=_0x435d38-0x0;var _0x49e4f7=_0x1497[_0x435d38];return _0x49e4f7;};'use strict';var Sequelize=require(_0x7149('0x0'));module[_0x7149('0x1')]={'key':{'type':Sequelize[_0x7149('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7149('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x7149('0x2')]},'name':{'type':Sequelize[_0x7149('0x4')],'get':function(){return this[_0x7149('0x5')](_0x7149('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b42015a..0bdddc0 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 _0x22f3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','eml-format','rimraf'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0x22f3,0xae));var _0x322f=function(_0x438c82,_0xd70276){_0x438c82=_0x438c82-0x0;var _0x17073a=_0x22f3[_0x438c82];return _0x17073a;};'use strict';var emlformat=require(_0x322f('0x0'));var rimraf=require(_0x322f('0x1'));var zipdir=require(_0x322f('0x2'));var jsonpatch=require(_0x322f('0x3'));var rp=require(_0x322f('0x4'));var moment=require(_0x322f('0x5'));var BPromise=require(_0x322f('0x6'));var Mustache=require(_0x322f('0x7'));var util=require('util');var path=require(_0x322f('0x8'));var sox=require(_0x322f('0x9'));var csv=require(_0x322f('0xa'));var ejs=require(_0x322f('0xb'));var fs=require('fs');var fs_extra=require(_0x322f('0xc'));var _=require('lodash');var squel=require(_0x322f('0xd'));var crypto=require(_0x322f('0xe'));var jsforce=require(_0x322f('0xf'));var deskjs=require(_0x322f('0x10'));var toCsv=require(_0x322f('0xa'));var querystring=require(_0x322f('0x11'));var Papa=require(_0x322f('0x12'));var Redis=require(_0x322f('0x13'));var authService=require(_0x322f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x322f('0x15'));var hardwareService=require(_0x322f('0x16'));var logger=require(_0x322f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x322f('0x18'));var licenseUtil=require(_0x322f('0x19'));var db=require(_0x322f('0x1a'))['db'];function respondWithStatusCode(_0x152be9,_0x39ad87){_0x39ad87=_0x39ad87||0xcc;return function(_0x58bfdf){if(_0x58bfdf){return _0x152be9[_0x322f('0x1b')](_0x39ad87);}return _0x152be9['status'](_0x39ad87)['end']();};}function respondWithResult(_0x497629,_0x2f7320){_0x2f7320=_0x2f7320||0xc8;return function(_0x15685f){if(_0x15685f){return _0x497629[_0x322f('0x1c')](_0x2f7320)[_0x322f('0x1d')](_0x15685f);}};}function respondWithFilteredResult(_0x2683c5,_0x4cda22){return function(_0x1fc16a){if(_0x1fc16a){var _0x452ae6=typeof _0x4cda22['offset']===_0x322f('0x1e')&&typeof _0x4cda22[_0x322f('0x1f')]===_0x322f('0x1e');var _0x1e3852=_0x1fc16a[_0x322f('0x20')];var _0x542583=_0x452ae6?0x0:_0x4cda22['offset'];var _0x171586=_0x452ae6?_0x1fc16a[_0x322f('0x20')]:_0x4cda22[_0x322f('0x21')]+_0x4cda22[_0x322f('0x1f')];var _0x3bcc9c;if(_0x171586>=_0x1e3852){_0x171586=_0x1e3852;_0x3bcc9c=0xc8;}else{_0x3bcc9c=0xce;}_0x2683c5[_0x322f('0x1c')](_0x3bcc9c);return _0x2683c5[_0x322f('0x22')](_0x322f('0x23'),_0x542583+'-'+_0x171586+'/'+_0x1e3852)[_0x322f('0x1d')](_0x1fc16a);}return null;};}function patchUpdates(_0xc9ff8){return function(_0x160c4c){try{jsonpatch[_0x322f('0x24')](_0x160c4c,_0xc9ff8,!![]);}catch(_0x298554){return BPromise[_0x322f('0x25')](_0x298554);}return _0x160c4c[_0x322f('0x26')]();};}function saveUpdates(_0x1c105d,_0x183894){return function(_0x25d529){if(_0x25d529){return _0x25d529[_0x322f('0x27')](_0x1c105d)[_0x322f('0x28')](function(_0x471712){return _0x471712;});}return null;};}function removeEntity(_0xa4cd26,_0x1967d7){return function(_0x3985fd){if(_0x3985fd){return _0x3985fd[_0x322f('0x29')]()[_0x322f('0x28')](function(){var _0x48c0e1=_0x3985fd[_0x322f('0x2a')]({'plain':!![]});var _0x5c7d99=_0x322f('0x2b');return db[_0x322f('0x2c')][_0x322f('0x29')]({'where':{'type':_0x5c7d99,'resourceId':_0x48c0e1['id']}})[_0x322f('0x28')](function(){return _0x3985fd;});})[_0x322f('0x28')](function(){_0xa4cd26[_0x322f('0x1c')](0xcc)[_0x322f('0x2d')]();});}};}function handleEntityNotFound(_0x873312,_0x64f44f){return function(_0x2e9ed3){if(!_0x2e9ed3){_0x873312[_0x322f('0x1b')](0x194);}return _0x2e9ed3;};}function handleError(_0x4ab290,_0x1f777c){_0x1f777c=_0x1f777c||0x1f4;return function(_0x4c5090){logger[_0x322f('0x2e')](_0x4c5090['stack']);if(_0x4c5090[_0x322f('0x2f')]){delete _0x4c5090[_0x322f('0x2f')];}_0x4ab290[_0x322f('0x1c')](_0x1f777c)['send'](_0x4c5090);};}exports['index']=function(_0x292ba0,_0x37b307){var _0x5d4207={},_0x200679={},_0x340fe3={'count':0x0,'rows':[]};var _0x407a4a=_['map'](db[_0x322f('0x30')][_0x322f('0x31')],function(_0xd65f1a){return{'name':_0xd65f1a[_0x322f('0x32')],'type':_0xd65f1a['type'][_0x322f('0x33')]};});_0x200679[_0x322f('0x34')]=_[_0x322f('0x35')](_0x407a4a,_0x322f('0x2f'));_0x200679[_0x322f('0x36')]=_[_0x322f('0x37')](_0x292ba0[_0x322f('0x36')]);_0x200679[_0x322f('0x38')]=_['intersection'](_0x200679[_0x322f('0x34')],_0x200679[_0x322f('0x36')]);_0x5d4207[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x200679[_0x322f('0x34')],qs[_0x322f('0x3b')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3b')]));_0x5d4207['attributes']=_0x5d4207[_0x322f('0x39')]['length']?_0x5d4207[_0x322f('0x39')]:_0x200679['model'];if(!_0x292ba0[_0x322f('0x36')]['hasOwnProperty']('nolimit')){_0x5d4207['limit']=qs['limit'](_0x292ba0[_0x322f('0x36')][_0x322f('0x1f')]);_0x5d4207[_0x322f('0x21')]=qs[_0x322f('0x21')](_0x292ba0[_0x322f('0x36')][_0x322f('0x21')]);}_0x5d4207[_0x322f('0x3c')]=qs[_0x322f('0x3d')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3d')]);_0x5d4207[_0x322f('0x3e')]=qs['filters'](_[_0x322f('0x3f')](_0x292ba0[_0x322f('0x36')],_0x200679['filters']),_0x407a4a);if(_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]){_0x5d4207[_0x322f('0x3e')]=_['merge'](_0x5d4207[_0x322f('0x3e')],{'$or':[{'key':{'$like':'%'+_0x292ba0[_0x322f('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]+'%'}}]});}_0x5d4207=_[_0x322f('0x41')]({},_0x5d4207,_0x292ba0[_0x322f('0x42')]);var _0x57a041={'where':_0x5d4207[_0x322f('0x3e')]};return db[_0x322f('0x30')][_0x322f('0x20')](_0x57a041)['then'](function(_0x9ee9b8){_0x340fe3[_0x322f('0x20')]=_0x9ee9b8;if(_0x292ba0[_0x322f('0x36')][_0x322f('0x43')]){_0x5d4207[_0x322f('0x44')]=[{'all':!![]}];}return db[_0x322f('0x30')][_0x322f('0x45')](_0x5d4207);})[_0x322f('0x28')](function(_0x4228bf){_0x340fe3['rows']=_0x4228bf;return _0x340fe3;})[_0x322f('0x28')](respondWithFilteredResult(_0x37b307,_0x5d4207))[_0x322f('0x46')](handleError(_0x37b307,null));};exports[_0x322f('0x47')]=function(_0x2b3556,_0x126d2d){var _0x503f04={'raw':!![],'where':{'id':_0x2b3556[_0x322f('0x48')]['id']}},_0x358bab={};_0x358bab[_0x322f('0x34')]=_[_0x322f('0x37')](db['CannedAnswer'][_0x322f('0x31')]);_0x358bab[_0x322f('0x36')]=_[_0x322f('0x37')](_0x2b3556[_0x322f('0x36')]);_0x358bab['filters']=_[_0x322f('0x3a')](_0x358bab[_0x322f('0x34')],_0x358bab['query']);_0x503f04[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x358bab['model'],qs[_0x322f('0x3b')](_0x2b3556[_0x322f('0x36')]['fields']));_0x503f04[_0x322f('0x39')]=_0x503f04['attributes'][_0x322f('0x49')]?_0x503f04[_0x322f('0x39')]:_0x358bab['model'];if(_0x2b3556[_0x322f('0x36')][_0x322f('0x43')]){_0x503f04[_0x322f('0x44')]=[{'all':!![]}];}_0x503f04=_[_0x322f('0x41')]({},_0x503f04,_0x2b3556[_0x322f('0x42')]);return db[_0x322f('0x30')][_0x322f('0x4a')](_0x503f04)['then'](handleEntityNotFound(_0x126d2d,null))[_0x322f('0x28')](respondWithResult(_0x126d2d,null))['catch'](handleError(_0x126d2d,null));};exports[_0x322f('0x27')]=function(_0x1e4bdc,_0x220b99){if(_0x1e4bdc['body']['id']){delete _0x1e4bdc['body']['id'];}return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x1e4bdc[_0x322f('0x48')]['id']}})[_0x322f('0x28')](handleEntityNotFound(_0x220b99,null))[_0x322f('0x28')](saveUpdates(_0x1e4bdc[_0x322f('0x4b')],null))['then'](respondWithResult(_0x220b99,null))[_0x322f('0x46')](handleError(_0x220b99,null));};exports[_0x322f('0x29')]=function(_0x29b876,_0x10ae12){return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x29b876['params']['id']}})['then'](handleEntityNotFound(_0x10ae12,null))[_0x322f('0x28')](removeEntity(_0x10ae12,null))['catch'](handleError(_0x10ae12,null));};exports['create']=function(_0x5bc13e,_0x198fa3){var _0x11b77b={'key':_0x5bc13e[_0x322f('0x4b')][_0x322f('0x33')]};if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4c')]){_0x11b77b[_0x322f('0x4c')]=_0x5bc13e[_0x322f('0x4b')]['MailAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')]){_0x11b77b[_0x322f('0x4d')]=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4e')]){_0x11b77b[_0x322f('0x4e')]=_0x5bc13e['body']['OpenchannelAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')]){_0x11b77b['ChatWebsiteId']=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')];}return db['CannedAnswer'][_0x322f('0x4a')]({'where':_0x11b77b})['then'](function(_0x3b9e5c){if(_0x3b9e5c){throw new db[(_0x322f('0x50'))][(_0x322f('0x51'))](_0x322f('0x52'));}return db[_0x322f('0x30')][_0x322f('0x53')](_0x5bc13e['body']);})[_0x322f('0x28')](function(_0x34c816){var _0x4798e0=_0x5bc13e[_0x322f('0x54')]['get']({'plain':!![]});if(!_0x4798e0)throw new Error(_0x322f('0x55'));if(_0x4798e0[_0x322f('0x56')]===_0x322f('0x54')){var _0x28695a=_0x34c816['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x4798e0['userProfileId']},'raw':!![]})[_0x322f('0x28')](function(_0x20dd74){if(_0x20dd74&&_0x20dd74[_0x322f('0x57')]===0x0){return db[_0x322f('0x2c')][_0x322f('0x53')]({'name':_0x28695a['name'],'resourceId':_0x28695a['id'],'type':_0x20dd74[_0x322f('0x2f')],'sectionId':_0x20dd74['id']},{})['then'](function(){return _0x34c816;});}else{return _0x34c816;}})['catch'](function(_0x5e2269){logger[_0x322f('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2269);throw _0x5e2269;});}return _0x34c816;})[_0x322f('0x28')](respondWithResult(_0x198fa3,0xc9))['catch'](handleError(_0x198fa3,null));}; \ No newline at end of file +var _0xf530=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','CannedAnswers','end','sendStatus','error','stack','name','send','map','CannedAnswer','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','rows','catch','show','params','rawAttributes','include','find','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','get','UserProfileSection','userProfileId'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xf530,0xf6));var _0x0f53=function(_0x4e5d34,_0x42fc23){_0x4e5d34=_0x4e5d34-0x0;var _0xdf9586=_0xf530[_0x4e5d34];return _0xdf9586;};'use strict';var emlformat=require(_0x0f53('0x0'));var rimraf=require(_0x0f53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f53('0x2'));var rp=require(_0x0f53('0x3'));var moment=require(_0x0f53('0x4'));var BPromise=require(_0x0f53('0x5'));var Mustache=require(_0x0f53('0x6'));var util=require(_0x0f53('0x7'));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('lodash');var squel=require(_0x0f53('0x8'));var crypto=require(_0x0f53('0x9'));var jsforce=require(_0x0f53('0xa'));var deskjs=require(_0x0f53('0xb'));var toCsv=require(_0x0f53('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f53('0xd'));var authService=require(_0x0f53('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0f53('0xf'));var hardwareService=require(_0x0f53('0x10'));var logger=require(_0x0f53('0x11'))(_0x0f53('0x12'));var utils=require('../../config/utils');var config=require(_0x0f53('0x13'));var licenseUtil=require(_0x0f53('0x14'));var db=require(_0x0f53('0x15'))['db'];function respondWithStatusCode(_0x590db3,_0x3fa5a9){_0x3fa5a9=_0x3fa5a9||0xcc;return function(_0x5eca1c){if(_0x5eca1c){return _0x590db3['sendStatus'](_0x3fa5a9);}return _0x590db3[_0x0f53('0x16')](_0x3fa5a9)['end']();};}function respondWithResult(_0x2fdd43,_0x5aa4a1){_0x5aa4a1=_0x5aa4a1||0xc8;return function(_0x273b7c){if(_0x273b7c){return _0x2fdd43[_0x0f53('0x16')](_0x5aa4a1)['json'](_0x273b7c);}};}function respondWithFilteredResult(_0x1975b1,_0x101c9e){return function(_0x2415b4){if(_0x2415b4){var _0x444529=typeof _0x101c9e[_0x0f53('0x17')]===_0x0f53('0x18')&&typeof _0x101c9e['limit']===_0x0f53('0x18');var _0x1bd151=_0x2415b4[_0x0f53('0x19')];var _0x3af042=_0x444529?0x0:_0x101c9e['offset'];var _0x405e2c=_0x444529?_0x2415b4[_0x0f53('0x19')]:_0x101c9e[_0x0f53('0x17')]+_0x101c9e[_0x0f53('0x1a')];var _0x3fcbc2;if(_0x405e2c>=_0x1bd151){_0x405e2c=_0x1bd151;_0x3fcbc2=0xc8;}else{_0x3fcbc2=0xce;}_0x1975b1['status'](_0x3fcbc2);return _0x1975b1[_0x0f53('0x1b')](_0x0f53('0x1c'),_0x3af042+'-'+_0x405e2c+'/'+_0x1bd151)['json'](_0x2415b4);}return null;};}function patchUpdates(_0x1d3ead){return function(_0x5e1b19){try{jsonpatch[_0x0f53('0x1d')](_0x5e1b19,_0x1d3ead,!![]);}catch(_0x1b4e6f){return BPromise[_0x0f53('0x1e')](_0x1b4e6f);}return _0x5e1b19['save']();};}function saveUpdates(_0x759735,_0x49dc3e){return function(_0x186071){if(_0x186071){return _0x186071['update'](_0x759735)[_0x0f53('0x1f')](function(_0x50a6dc){return _0x50a6dc;});}return null;};}function removeEntity(_0x5c70b7,_0x82879e){return function(_0x192dee){if(_0x192dee){return _0x192dee[_0x0f53('0x20')]()[_0x0f53('0x1f')](function(){var _0x4dc0d6=_0x192dee['get']({'plain':!![]});var _0x196782=_0x0f53('0x21');return db['UserProfileResource'][_0x0f53('0x20')]({'where':{'type':_0x196782,'resourceId':_0x4dc0d6['id']}})[_0x0f53('0x1f')](function(){return _0x192dee;});})['then'](function(){_0x5c70b7['status'](0xcc)[_0x0f53('0x22')]();});}};}function handleEntityNotFound(_0x3a480c,_0x41b7ad){return function(_0x302f03){if(!_0x302f03){_0x3a480c[_0x0f53('0x23')](0x194);}return _0x302f03;};}function handleError(_0x1ecf62,_0x66e399){_0x66e399=_0x66e399||0x1f4;return function(_0x299dd8){logger[_0x0f53('0x24')](_0x299dd8[_0x0f53('0x25')]);if(_0x299dd8[_0x0f53('0x26')]){delete _0x299dd8[_0x0f53('0x26')];}_0x1ecf62[_0x0f53('0x16')](_0x66e399)[_0x0f53('0x27')](_0x299dd8);};}exports['index']=function(_0x38cbe6,_0x53d371){var _0x3d3c35={},_0x693e27={},_0x51748b={'count':0x0,'rows':[]};var _0x2b1ea9=_[_0x0f53('0x28')](db[_0x0f53('0x29')]['rawAttributes'],function(_0x24cb74){return{'name':_0x24cb74['fieldName'],'type':_0x24cb74['type'][_0x0f53('0x2a')]};});_0x693e27['model']=_[_0x0f53('0x28')](_0x2b1ea9,_0x0f53('0x26'));_0x693e27[_0x0f53('0x2b')]=_[_0x0f53('0x2c')](_0x38cbe6[_0x0f53('0x2b')]);_0x693e27[_0x0f53('0x2d')]=_[_0x0f53('0x2e')](_0x693e27[_0x0f53('0x2f')],_0x693e27[_0x0f53('0x2b')]);_0x3d3c35[_0x0f53('0x30')]=_[_0x0f53('0x2e')](_0x693e27['model'],qs[_0x0f53('0x31')](_0x38cbe6['query'][_0x0f53('0x31')]));_0x3d3c35[_0x0f53('0x30')]=_0x3d3c35['attributes'][_0x0f53('0x32')]?_0x3d3c35[_0x0f53('0x30')]:_0x693e27[_0x0f53('0x2f')];if(!_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x33')](_0x0f53('0x34'))){_0x3d3c35[_0x0f53('0x1a')]=qs[_0x0f53('0x1a')](_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x1a')]);_0x3d3c35[_0x0f53('0x17')]=qs['offset'](_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x17')]);}_0x3d3c35[_0x0f53('0x35')]=qs[_0x0f53('0x36')](_0x38cbe6[_0x0f53('0x2b')]['sort']);_0x3d3c35[_0x0f53('0x37')]=qs[_0x0f53('0x2d')](_['pick'](_0x38cbe6['query'],_0x693e27[_0x0f53('0x2d')]),_0x2b1ea9);if(_0x38cbe6['query']['filter']){_0x3d3c35[_0x0f53('0x37')]=_[_0x0f53('0x38')](_0x3d3c35[_0x0f53('0x37')],{'$or':[{'key':{'$like':'%'+_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x39')]+'%'}},{'value':{'$like':'%'+_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x39')]+'%'}}]});}_0x3d3c35=_['merge']({},_0x3d3c35,_0x38cbe6[_0x0f53('0x3a')]);var _0x9b503e={'where':_0x3d3c35[_0x0f53('0x37')]};return db[_0x0f53('0x29')]['count'](_0x9b503e)[_0x0f53('0x1f')](function(_0x38d8fd){_0x51748b[_0x0f53('0x19')]=_0x38d8fd;if(_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x3b')]){_0x3d3c35['include']=[{'all':!![]}];}return db[_0x0f53('0x29')]['findAll'](_0x3d3c35);})[_0x0f53('0x1f')](function(_0x216b2f){_0x51748b[_0x0f53('0x3c')]=_0x216b2f;return _0x51748b;})['then'](respondWithFilteredResult(_0x53d371,_0x3d3c35))[_0x0f53('0x3d')](handleError(_0x53d371,null));};exports[_0x0f53('0x3e')]=function(_0x2e081a,_0x729fe6){var _0x35bf00={'raw':!![],'where':{'id':_0x2e081a[_0x0f53('0x3f')]['id']}},_0x38733c={};_0x38733c[_0x0f53('0x2f')]=_[_0x0f53('0x2c')](db[_0x0f53('0x29')][_0x0f53('0x40')]);_0x38733c['query']=_['keys'](_0x2e081a[_0x0f53('0x2b')]);_0x38733c[_0x0f53('0x2d')]=_[_0x0f53('0x2e')](_0x38733c[_0x0f53('0x2f')],_0x38733c['query']);_0x35bf00[_0x0f53('0x30')]=_[_0x0f53('0x2e')](_0x38733c[_0x0f53('0x2f')],qs[_0x0f53('0x31')](_0x2e081a[_0x0f53('0x2b')]['fields']));_0x35bf00['attributes']=_0x35bf00[_0x0f53('0x30')][_0x0f53('0x32')]?_0x35bf00[_0x0f53('0x30')]:_0x38733c[_0x0f53('0x2f')];if(_0x2e081a[_0x0f53('0x2b')]['includeAll']){_0x35bf00[_0x0f53('0x41')]=[{'all':!![]}];}_0x35bf00=_[_0x0f53('0x38')]({},_0x35bf00,_0x2e081a['options']);return db[_0x0f53('0x29')][_0x0f53('0x42')](_0x35bf00)[_0x0f53('0x1f')](handleEntityNotFound(_0x729fe6,null))[_0x0f53('0x1f')](respondWithResult(_0x729fe6,null))[_0x0f53('0x3d')](handleError(_0x729fe6,null));};exports[_0x0f53('0x43')]=function(_0x1d990e,_0x596c77){if(_0x1d990e[_0x0f53('0x44')]['id']){delete _0x1d990e['body']['id'];}return db[_0x0f53('0x29')][_0x0f53('0x42')]({'where':{'id':_0x1d990e[_0x0f53('0x3f')]['id']}})['then'](handleEntityNotFound(_0x596c77,null))['then'](saveUpdates(_0x1d990e[_0x0f53('0x44')],null))['then'](respondWithResult(_0x596c77,null))[_0x0f53('0x3d')](handleError(_0x596c77,null));};exports[_0x0f53('0x20')]=function(_0x1db7be,_0x5619df){return db[_0x0f53('0x29')][_0x0f53('0x42')]({'where':{'id':_0x1db7be[_0x0f53('0x3f')]['id']}})[_0x0f53('0x1f')](handleEntityNotFound(_0x5619df,null))[_0x0f53('0x1f')](removeEntity(_0x5619df,null))['catch'](handleError(_0x5619df,null));};exports['create']=function(_0x580def,_0x5291fb){var _0x5f3357={'key':_0x580def['body']['key']};if(_0x580def[_0x0f53('0x44')][_0x0f53('0x45')]){_0x5f3357['MailAccountId']=_0x580def[_0x0f53('0x44')][_0x0f53('0x45')];}else if(_0x580def[_0x0f53('0x44')][_0x0f53('0x46')]){_0x5f3357['SmsAccountId']=_0x580def['body'][_0x0f53('0x46')];}else if(_0x580def['body'][_0x0f53('0x47')]){_0x5f3357['OpenchannelAccountId']=_0x580def['body'][_0x0f53('0x47')];}else if(_0x580def['body'][_0x0f53('0x48')]){_0x5f3357[_0x0f53('0x48')]=_0x580def[_0x0f53('0x44')][_0x0f53('0x48')];}return db['CannedAnswer']['find']({'where':_0x5f3357})[_0x0f53('0x1f')](function(_0x4282d8){if(_0x4282d8){throw new db['Sequelize']['ValidationError'](_0x0f53('0x49'));}return db['CannedAnswer']['create'](_0x580def[_0x0f53('0x44')]);})[_0x0f53('0x1f')](function(_0x40c458){var _0x26406b=_0x580def[_0x0f53('0x4a')]['get']({'plain':!![]});if(!_0x26406b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26406b['role']===_0x0f53('0x4a')){var _0x37a297=_0x40c458[_0x0f53('0x4b')]({'plain':!![]});return db[_0x0f53('0x4c')][_0x0f53('0x42')]({'where':{'name':'CannedAnswers','userProfileId':_0x26406b[_0x0f53('0x4d')]},'raw':!![]})[_0x0f53('0x1f')](function(_0x39c837){if(_0x39c837&&_0x39c837[_0x0f53('0x4e')]===0x0){return db['UserProfileResource'][_0x0f53('0x4f')]({'name':_0x37a297[_0x0f53('0x26')],'resourceId':_0x37a297['id'],'type':_0x39c837[_0x0f53('0x26')],'sectionId':_0x39c837['id']},{})[_0x0f53('0x1f')](function(){return _0x40c458;});}else{return _0x40c458;}})[_0x0f53('0x3d')](function(_0x1bccfd){logger[_0x0f53('0x24')](_0x0f53('0x50'),_0x1bccfd);throw _0x1bccfd;});}return _0x40c458;})[_0x0f53('0x1f')](respondWithResult(_0x5291fb,0xc9))['catch'](handleError(_0x5291fb,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index a5020c0..b3f2af4 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 _0xd0a9=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xd0a9,0x10b));var _0x9d0a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xd0a9[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require(_0x9d0a('0x0'));var logger=require(_0x9d0a('0x1'))(_0x9d0a('0x2'));var moment=require(_0x9d0a('0x3'));var BPromise=require(_0x9d0a('0x4'));var rp=require(_0x9d0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9d0a('0x6'));var attributes=require(_0x9d0a('0x7'));module[_0x9d0a('0x8')]=function(_0x13e08f,_0x5c9aa3){return _0x13e08f['define'](_0x9d0a('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d0a('0xa'),'collate':_0x9d0a('0xb')});}; \ No newline at end of file +var _0xb545=['util','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x49f7fb,_0xc53472){var _0x7a885e=function(_0x452160){while(--_0x452160){_0x49f7fb['push'](_0x49f7fb['shift']());}};_0x7a885e(++_0xc53472);}(_0xb545,0x74));var _0x5b54=function(_0x49eb9d,_0x3e8ff7){_0x49eb9d=_0x49eb9d-0x0;var _0x43124d=_0xb545[_0x49eb9d];return _0x43124d;};'use strict';var _=require(_0x5b54('0x0'));var util=require(_0x5b54('0x1'));var logger=require('../../config/logger')(_0x5b54('0x2'));var moment=require(_0x5b54('0x3'));var BPromise=require(_0x5b54('0x4'));var rp=require(_0x5b54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b54('0x6'));var attributes=require(_0x5b54('0x7'));module['exports']=function(_0x52b69a,_0x358863){return _0x52b69a[_0x5b54('0x8')](_0x5b54('0x9'),attributes,{'tableName':_0x5b54('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b54('0xb'),'collate':_0x5b54('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 286fc0b..7610ac5 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(_0xae0e9b,_0x209495){var _0x5dec3a=function(_0x5df799){while(--_0x5df799){_0xae0e9b['push'](_0xae0e9b['shift']());}};_0x5dec3a(++_0x209495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x23e063,_0x3412f7){var _0xe60535=function(_0x1a8434){while(--_0x1a8434){_0x23e063['push'](_0x23e063['shift']());}};_0xe60535(++_0x3412f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 32ab53c..39adbde 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 _0x3e28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x4104f0,_0x489f33){var _0xe518fd=function(_0x6c75dd){while(--_0x6c75dd){_0x4104f0['push'](_0x4104f0['shift']());}};_0xe518fd(++_0x489f33);}(_0x3e28,0x142));var _0x83e2=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x3e28[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x83e2('0x0'));var util=require(_0x83e2('0x1'));var path=require(_0x83e2('0x2'));var timeout=require(_0x83e2('0x3'));var express=require('express');var router=express[_0x83e2('0x4')]();var fs_extra=require(_0x83e2('0x5'));var auth=require(_0x83e2('0x6'));var interaction=require(_0x83e2('0x7'));var config=require(_0x83e2('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xa')]);router['get'](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0xc')]);router[_0x83e2('0xd')]('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xe')]);router[_0x83e2('0xf')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x10')]);router[_0x83e2('0x11')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x12')]);module[_0x83e2('0x13')]=router; \ No newline at end of file +var _0x5eab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x45376e,_0x1ed151){var _0x4f5baf=function(_0x5cb66d){while(--_0x5cb66d){_0x45376e['push'](_0x45376e['shift']());}};_0x4f5baf(++_0x1ed151);}(_0x5eab,0xe4));var _0xb5ea=function(_0x215b11,_0xf38206){_0x215b11=_0x215b11-0x0;var _0x32b490=_0x5eab[_0x215b11];return _0x32b490;};'use strict';var multer=require(_0xb5ea('0x0'));var util=require(_0xb5ea('0x1'));var path=require(_0xb5ea('0x2'));var timeout=require('connect-timeout');var express=require(_0xb5ea('0x3'));var router=express[_0xb5ea('0x4')]();var fs_extra=require(_0xb5ea('0x5'));var auth=require(_0xb5ea('0x6'));var interaction=require(_0xb5ea('0x7'));var config=require(_0xb5ea('0x8'));var controller=require(_0xb5ea('0x9'));router[_0xb5ea('0xa')]('/',auth[_0xb5ea('0xb')](),controller[_0xb5ea('0xc')]);router['get'](_0xb5ea('0xd'),auth['isAuthenticated'](),controller[_0xb5ea('0xe')]);router[_0xb5ea('0xf')]('/',auth[_0xb5ea('0xb')](),controller[_0xb5ea('0x10')]);router[_0xb5ea('0x11')](_0xb5ea('0xd'),auth['isAuthenticated'](),controller[_0xb5ea('0x12')]);router['delete'](_0xb5ea('0xd'),auth[_0xb5ea('0xb')](),controller[_0xb5ea('0x13')]);module[_0xb5ea('0x14')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 5862f37..6d9cc9b 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 _0xaf09=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2639fe,_0x508cb9){var _0x5148bd=function(_0x430192){while(--_0x430192){_0x2639fe['push'](_0x2639fe['shift']());}};_0x5148bd(++_0x508cb9);}(_0xaf09,0x10d));var _0x9af0=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xaf09[_0x4b26b5];return _0x4dec71;};'use strict';var Sequelize=require(_0x9af0('0x0'));module[_0x9af0('0x1')]={'calldate':{'type':Sequelize[_0x9af0('0x2')],'allowNull':![],'defaultValue':_0x9af0('0x3')},'clid':{'type':Sequelize[_0x9af0('0x4')]},'src':{'type':Sequelize[_0x9af0('0x4')]},'dst':{'type':Sequelize[_0x9af0('0x4')]},'dcontext':{'type':Sequelize[_0x9af0('0x4')]},'channel':{'type':Sequelize[_0x9af0('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9af0('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9af0('0x4')]},'linkedid':{'type':Sequelize[_0x9af0('0x4')]},'sequence':{'type':Sequelize[_0x9af0('0x4')]},'peeraccount':{'type':Sequelize[_0x9af0('0x4')]},'type':{'type':Sequelize[_0x9af0('0x4')]},'tag':{'type':Sequelize[_0x9af0('0x4')]}}; \ No newline at end of file +var _0x90db=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x1bc598,_0x3eda62){var _0x14aa71=function(_0x526a01){while(--_0x526a01){_0x1bc598['push'](_0x1bc598['shift']());}};_0x14aa71(++_0x3eda62);}(_0x90db,0x1c0));var _0xb90d=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x90db[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require('sequelize');module[_0xb90d('0x0')]={'calldate':{'type':Sequelize[_0xb90d('0x1')],'allowNull':![],'defaultValue':_0xb90d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xb90d('0x3')]},'lastapp':{'type':Sequelize[_0xb90d('0x3')]},'lastdata':{'type':Sequelize[_0xb90d('0x3')]},'duration':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb90d('0x3')]},'amaflags':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb90d('0x3')]},'userfield':{'type':Sequelize[_0xb90d('0x3')]},'uniqueid':{'type':Sequelize[_0xb90d('0x3')]},'linkedid':{'type':Sequelize[_0xb90d('0x3')]},'sequence':{'type':Sequelize[_0xb90d('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb90d('0x3')]},'tag':{'type':Sequelize[_0xb90d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 35681ce..879cad4 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 _0x79a8=['reject','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x79a8,0x1d0));var _0x879a=function(_0x2ebd68,_0x10e9cc){_0x2ebd68=_0x2ebd68-0x0;var _0x2e68d5=_0x79a8[_0x2ebd68];return _0x2e68d5;};'use strict';var emlformat=require(_0x879a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879a('0x1'));var jsonpatch=require(_0x879a('0x2'));var rp=require(_0x879a('0x3'));var moment=require('moment');var BPromise=require(_0x879a('0x4'));var Mustache=require('mustache');var util=require(_0x879a('0x5'));var path=require(_0x879a('0x6'));var sox=require(_0x879a('0x7'));var csv=require(_0x879a('0x8'));var ejs=require(_0x879a('0x9'));var fs=require('fs');var fs_extra=require(_0x879a('0xa'));var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x8'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879a('0x12'));var logger=require(_0x879a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x879a('0x14'));var licenseUtil=require(_0x879a('0x15'));var db=require(_0x879a('0x16'))['db'];function respondWithStatusCode(_0x320115,_0x54a9b6){_0x54a9b6=_0x54a9b6||0xcc;return function(_0x4738b4){if(_0x4738b4){return _0x320115[_0x879a('0x17')](_0x54a9b6);}return _0x320115[_0x879a('0x18')](_0x54a9b6)[_0x879a('0x19')]();};}function respondWithResult(_0x1a20c5,_0x1c2853){_0x1c2853=_0x1c2853||0xc8;return function(_0x461f1e){if(_0x461f1e){return _0x1a20c5[_0x879a('0x18')](_0x1c2853)[_0x879a('0x1a')](_0x461f1e);}};}function respondWithFilteredResult(_0x16b649,_0x5b4dbe){return function(_0x4a1e0e){if(_0x4a1e0e){var _0x3b8680=typeof _0x5b4dbe[_0x879a('0x1b')]==='undefined'&&typeof _0x5b4dbe[_0x879a('0x1c')]===_0x879a('0x1d');var _0x149105=_0x4a1e0e[_0x879a('0x1e')];var _0x32d9f5=_0x3b8680?0x0:_0x5b4dbe[_0x879a('0x1b')];var _0x4160bd=_0x3b8680?_0x4a1e0e[_0x879a('0x1e')]:_0x5b4dbe[_0x879a('0x1b')]+_0x5b4dbe[_0x879a('0x1c')];var _0x14241a;if(_0x4160bd>=_0x149105){_0x4160bd=_0x149105;_0x14241a=0xc8;}else{_0x14241a=0xce;}_0x16b649[_0x879a('0x18')](_0x14241a);return _0x16b649[_0x879a('0x1f')](_0x879a('0x20'),_0x32d9f5+'-'+_0x4160bd+'/'+_0x149105)['json'](_0x4a1e0e);}return null;};}function patchUpdates(_0x830b36){return function(_0x326e6a){try{jsonpatch['apply'](_0x326e6a,_0x830b36,!![]);}catch(_0x25a57d){return BPromise[_0x879a('0x21')](_0x25a57d);}return _0x326e6a['save']();};}function saveUpdates(_0x56e394,_0x4ed0d6){return function(_0x28c401){if(_0x28c401){return _0x28c401[_0x879a('0x22')](_0x56e394)[_0x879a('0x23')](function(_0x38d42c){return _0x38d42c;});}return null;};}function removeEntity(_0x4c3808,_0x5c21e2){return function(_0x3674f9){if(_0x3674f9){return _0x3674f9[_0x879a('0x24')]()[_0x879a('0x23')](function(){_0x4c3808[_0x879a('0x18')](0xcc)[_0x879a('0x19')]();});}};}function handleEntityNotFound(_0x1dd818,_0x7d67ed){return function(_0x14213c){if(!_0x14213c){_0x1dd818[_0x879a('0x17')](0x194);}return _0x14213c;};}function handleError(_0x2ee375,_0x272bf9){_0x272bf9=_0x272bf9||0x1f4;return function(_0x3510cc){logger[_0x879a('0x25')](_0x3510cc['stack']);if(_0x3510cc[_0x879a('0x26')]){delete _0x3510cc[_0x879a('0x26')];}_0x2ee375[_0x879a('0x18')](_0x272bf9)[_0x879a('0x27')](_0x3510cc);};}exports[_0x879a('0x28')]=function(_0x3030e0,_0x3ef6c1){var _0x2d9ed3={},_0x3ca5cd={},_0x1b6c15={'count':0x0,'rows':[]};var _0x2605e9=_[_0x879a('0x29')](db[_0x879a('0x2a')][_0x879a('0x2b')],function(_0x99559){return{'name':_0x99559[_0x879a('0x2c')],'type':_0x99559[_0x879a('0x2d')][_0x879a('0x2e')]};});_0x3ca5cd['model']=_[_0x879a('0x29')](_0x2605e9,'name');_0x3ca5cd[_0x879a('0x2f')]=_[_0x879a('0x30')](_0x3030e0[_0x879a('0x2f')]);_0x3ca5cd['filters']=_[_0x879a('0x31')](_0x3ca5cd['model'],_0x3ca5cd['query']);_0x2d9ed3['attributes']=_['intersection'](_0x3ca5cd[_0x879a('0x32')],qs[_0x879a('0x33')](_0x3030e0['query'][_0x879a('0x33')]));_0x2d9ed3[_0x879a('0x34')]=_0x2d9ed3[_0x879a('0x34')]['length']?_0x2d9ed3[_0x879a('0x34')]:_0x3ca5cd[_0x879a('0x32')];if(!_0x3030e0[_0x879a('0x2f')][_0x879a('0x35')]('nolimit')){_0x2d9ed3[_0x879a('0x1c')]=qs[_0x879a('0x1c')](_0x3030e0[_0x879a('0x2f')][_0x879a('0x1c')]);_0x2d9ed3['offset']=qs[_0x879a('0x1b')](_0x3030e0['query'][_0x879a('0x1b')]);}_0x2d9ed3['order']=qs[_0x879a('0x36')](_0x3030e0[_0x879a('0x2f')]['sort']);_0x2d9ed3[_0x879a('0x37')]=qs[_0x879a('0x38')](_[_0x879a('0x39')](_0x3030e0[_0x879a('0x2f')],_0x3ca5cd['filters']),_0x2605e9);if(_0x3030e0[_0x879a('0x2f')][_0x879a('0x3a')]){_0x2d9ed3[_0x879a('0x37')]=_['merge'](_0x2d9ed3['where'],{'$or':_['map'](_0x2605e9,function(_0x5de17f){if(_0x5de17f['type']!==_0x879a('0x3b')){var _0x142bdc={};_0x142bdc[_0x5de17f[_0x879a('0x26')]]={'$like':'%'+_0x3030e0['query']['filter']+'%'};return _0x142bdc;}})});}_0x2d9ed3=_['merge']({},_0x2d9ed3,_0x3030e0[_0x879a('0x3c')]);var _0x5597f9={'where':_0x2d9ed3[_0x879a('0x37')]};return db[_0x879a('0x2a')][_0x879a('0x1e')](_0x5597f9)['then'](function(_0x4f9681){_0x1b6c15[_0x879a('0x1e')]=_0x4f9681;if(_0x3030e0['query'][_0x879a('0x3d')]){_0x2d9ed3[_0x879a('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0x879a('0x3f')](_0x2d9ed3);})[_0x879a('0x23')](function(_0x2cc43c){_0x1b6c15['rows']=_0x2cc43c;return _0x1b6c15;})[_0x879a('0x23')](respondWithFilteredResult(_0x3ef6c1,_0x2d9ed3))[_0x879a('0x40')](handleError(_0x3ef6c1,null));};exports['show']=function(_0x7d99a0,_0x2456a4){var _0x4dedfe={'raw':!![],'where':{'id':_0x7d99a0[_0x879a('0x41')]['id']}},_0x14f8e7={};_0x14f8e7[_0x879a('0x32')]=_[_0x879a('0x30')](db['Cdr'][_0x879a('0x2b')]);_0x14f8e7['query']=_[_0x879a('0x30')](_0x7d99a0['query']);_0x14f8e7[_0x879a('0x38')]=_['intersection'](_0x14f8e7[_0x879a('0x32')],_0x14f8e7[_0x879a('0x2f')]);_0x4dedfe[_0x879a('0x34')]=_[_0x879a('0x31')](_0x14f8e7[_0x879a('0x32')],qs[_0x879a('0x33')](_0x7d99a0['query'][_0x879a('0x33')]));_0x4dedfe[_0x879a('0x34')]=_0x4dedfe[_0x879a('0x34')]['length']?_0x4dedfe[_0x879a('0x34')]:_0x14f8e7[_0x879a('0x32')];if(_0x7d99a0[_0x879a('0x2f')]['includeAll']){_0x4dedfe[_0x879a('0x3e')]=[{'all':!![]}];}_0x4dedfe=_[_0x879a('0x42')]({},_0x4dedfe,_0x7d99a0[_0x879a('0x3c')]);return db[_0x879a('0x2a')]['find'](_0x4dedfe)['then'](handleEntityNotFound(_0x2456a4,null))[_0x879a('0x23')](respondWithResult(_0x2456a4,null))[_0x879a('0x40')](handleError(_0x2456a4,null));};exports['create']=function(_0x2ff7cd,_0x4420ac){return db['Cdr'][_0x879a('0x43')](_0x2ff7cd[_0x879a('0x44')],{})[_0x879a('0x23')](respondWithResult(_0x4420ac,0xc9))[_0x879a('0x40')](handleError(_0x4420ac,null));};exports['update']=function(_0x3ffbe6,_0x32933f){if(_0x3ffbe6[_0x879a('0x44')]['id']){delete _0x3ffbe6['body']['id'];}return db['Cdr'][_0x879a('0x45')]({'where':{'id':_0x3ffbe6[_0x879a('0x41')]['id']}})['then'](handleEntityNotFound(_0x32933f,null))[_0x879a('0x23')](saveUpdates(_0x3ffbe6[_0x879a('0x44')],null))[_0x879a('0x23')](respondWithResult(_0x32933f,null))['catch'](handleError(_0x32933f,null));};exports[_0x879a('0x24')]=function(_0x677418,_0xc1c234){return db[_0x879a('0x2a')]['find']({'where':{'id':_0x677418[_0x879a('0x41')]['id']}})[_0x879a('0x23')](handleEntityNotFound(_0xc1c234,null))['then'](removeEntity(_0xc1c234,null))[_0x879a('0x40')](handleError(_0xc1c234,null));};exports[_0x879a('0x46')]=function(_0x59ff36,_0x51644c){return db[_0x879a('0x2a')]['describe']()['then'](respondWithResult(_0x51644c,null))[_0x879a('0x40')](handleError(_0x51644c,null));}; \ No newline at end of file +var _0x1224=['sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order'];(function(_0x4551fb,_0x2b8b8e){var _0x562381=function(_0x3b3bff){while(--_0x3b3bff){_0x4551fb['push'](_0x4551fb['shift']());}};_0x562381(++_0x2b8b8e);}(_0x1224,0x10d));var _0x4122=function(_0x2c85c0,_0x1dac4f){_0x2c85c0=_0x2c85c0-0x0;var _0xf4d4c9=_0x1224[_0x2c85c0];return _0xf4d4c9;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={},_0x43c51c={},_0x79c85={'count':0x0,'rows':[]};var _0x31f141=_['map'](db[_0x4122('0x30')]['rawAttributes'],function(_0x3e4eee){return{'name':_0x3e4eee[_0x4122('0x31')],'type':_0x3e4eee[_0x4122('0x32')][_0x4122('0x33')]};});_0x43c51c[_0x4122('0x34')]=_[_0x4122('0x35')](_0x31f141,_0x4122('0x2d'));_0x43c51c[_0x4122('0x36')]=_['keys'](_0xfefaf6[_0x4122('0x36')]);_0x43c51c[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x34')],_0x43c51c[_0x4122('0x36')]);_0x2e5bc2[_0x4122('0x38')]=_[_0x4122('0x39')](_0x43c51c['model'],qs[_0x4122('0x3a')](_0xfefaf6[_0x4122('0x36')]['fields']));_0x2e5bc2['attributes']=_0x2e5bc2[_0x4122('0x38')]['length']?_0x2e5bc2[_0x4122('0x38')]:_0x43c51c[_0x4122('0x34')];if(!_0xfefaf6['query'][_0x4122('0x3b')](_0x4122('0x3c'))){_0x2e5bc2[_0x4122('0x3d')]=qs['limit'](_0xfefaf6[_0x4122('0x36')]['limit']);_0x2e5bc2[_0x4122('0x22')]=qs[_0x4122('0x22')](_0xfefaf6[_0x4122('0x36')]['offset']);}_0x2e5bc2[_0x4122('0x3e')]=qs['sort'](_0xfefaf6[_0x4122('0x36')][_0x4122('0x3f')]);_0x2e5bc2['where']=qs['filters'](_['pick'](_0xfefaf6[_0x4122('0x36')],_0x43c51c['filters']),_0x31f141);if(_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]){_0x2e5bc2[_0x4122('0x41')]=_[_0x4122('0x42')](_0x2e5bc2[_0x4122('0x41')],{'$or':_['map'](_0x31f141,function(_0x5c20ec){if(_0x5c20ec[_0x4122('0x32')]!=='VIRTUAL'){var _0xf4ab54={};_0xf4ab54[_0x5c20ec['name']]={'$like':'%'+_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]+'%'};return _0xf4ab54;}})});}_0x2e5bc2=_['merge']({},_0x2e5bc2,_0xfefaf6[_0x4122('0x43')]);var _0x2b7d56={'where':_0x2e5bc2[_0x4122('0x41')]};return db[_0x4122('0x30')][_0x4122('0x24')](_0x2b7d56)[_0x4122('0x2a')](function(_0x5b8fe2){_0x79c85[_0x4122('0x24')]=_0x5b8fe2;if(_0xfefaf6['query'][_0x4122('0x44')]){_0x2e5bc2['include']=[{'all':!![]}];}return db[_0x4122('0x30')][_0x4122('0x45')](_0x2e5bc2);})[_0x4122('0x2a')](function(_0x469fdd){_0x79c85[_0x4122('0x46')]=_0x469fdd;return _0x79c85;})['then'](respondWithFilteredResult(_0x5f32c5,_0x2e5bc2))[_0x4122('0x47')](handleError(_0x5f32c5,null));};exports[_0x4122('0x48')]=function(_0x59ed80,_0x589b39){var _0x5853ae={'raw':!![],'where':{'id':_0x59ed80[_0x4122('0x49')]['id']}},_0x297937={};_0x297937[_0x4122('0x34')]=_[_0x4122('0x4a')](db[_0x4122('0x30')][_0x4122('0x4b')]);_0x297937[_0x4122('0x36')]=_[_0x4122('0x4a')](_0x59ed80[_0x4122('0x36')]);_0x297937['filters']=_[_0x4122('0x39')](_0x297937['model'],_0x297937['query']);_0x5853ae[_0x4122('0x38')]=_[_0x4122('0x39')](_0x297937[_0x4122('0x34')],qs['fields'](_0x59ed80[_0x4122('0x36')][_0x4122('0x3a')]));_0x5853ae['attributes']=_0x5853ae[_0x4122('0x38')][_0x4122('0x4c')]?_0x5853ae[_0x4122('0x38')]:_0x297937[_0x4122('0x34')];if(_0x59ed80['query'][_0x4122('0x44')]){_0x5853ae[_0x4122('0x4d')]=[{'all':!![]}];}_0x5853ae=_[_0x4122('0x42')]({},_0x5853ae,_0x59ed80[_0x4122('0x43')]);return db[_0x4122('0x30')]['find'](_0x5853ae)['then'](handleEntityNotFound(_0x589b39,null))[_0x4122('0x2a')](respondWithResult(_0x589b39,null))[_0x4122('0x47')](handleError(_0x589b39,null));};exports[_0x4122('0x4e')]=function(_0x13cc1d,_0x144d4c){return db['Cdr'][_0x4122('0x4e')](_0x13cc1d[_0x4122('0x4f')],{})[_0x4122('0x2a')](respondWithResult(_0x144d4c,0xc9))['catch'](handleError(_0x144d4c,null));};exports[_0x4122('0x29')]=function(_0x53f7d9,_0x39515c){if(_0x53f7d9[_0x4122('0x4f')]['id']){delete _0x53f7d9[_0x4122('0x4f')]['id'];}return db[_0x4122('0x30')]['find']({'where':{'id':_0x53f7d9['params']['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x39515c,null))[_0x4122('0x2a')](saveUpdates(_0x53f7d9[_0x4122('0x4f')],null))[_0x4122('0x2a')](respondWithResult(_0x39515c,null))['catch'](handleError(_0x39515c,null));};exports[_0x4122('0x50')]=function(_0x5678ff,_0x376782){return db['Cdr'][_0x4122('0x51')]({'where':{'id':_0x5678ff[_0x4122('0x49')]['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x376782,null))[_0x4122('0x2a')](removeEntity(_0x376782,null))[_0x4122('0x47')](handleError(_0x376782,null));};exports[_0x4122('0x52')]=function(_0x4fb7ac,_0xf265ed){return db['Cdr'][_0x4122('0x52')]()[_0x4122('0x2a')](respondWithResult(_0xf265ed,null))[_0x4122('0x47')](handleError(_0xf265ed,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 9c2d328..11d8fa1 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(_0x801484,_0x184262){var _0x2ecd18=function(_0x4ee805){while(--_0x4ee805){_0x801484['push'](_0x801484['shift']());}};_0x2ecd18(++_0x184262);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x696973,_0x3b62b4){var _0x527f71=function(_0x4e0db0){while(--_0x4e0db0){_0x696973['push'](_0x696973['shift']());}};_0x527f71(++_0x3b62b4);}(_0x7a54,0x106));var _0x47a5=function(_0x8713ca,_0x1ce76d){_0x8713ca=_0x8713ca-0x0;var _0x2dc080=_0x7a54[_0x8713ca];return _0x2dc080;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index ca2345c..a7c8824 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 _0x459f=['error','code','message','Cdr,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x459f,0x1e8));var _0xf459=function(_0x5f0746,_0x88ab3d){_0x5f0746=_0x5f0746-0x0;var _0x573949=_0x459f[_0x5f0746];return _0x573949;};'use strict';var _=require(_0xf459('0x0'));var util=require(_0xf459('0x1'));var moment=require(_0xf459('0x2'));var BPromise=require(_0xf459('0x3'));var rs=require(_0xf459('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf459('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf459('0x6'));var jayson=require(_0xf459('0x7'));var client=jayson[_0xf459('0x8')][_0xf459('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363157,_0x3cd829,_0x3a989e){return new BPromise(function(_0x5ba229,_0x28a153){return client[_0xf459('0xa')](_0x363157,_0x3a989e)[_0xf459('0xb')](function(_0x599c50){logger[_0xf459('0xc')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0xf459('0xd'));logger[_0xf459('0xe')](_0xf459('0xf'),_0x3cd829,'request\x20sent',JSON['stringify'](_0x599c50));if(_0x599c50[_0xf459('0x10')]){if(_0x599c50[_0xf459('0x10')][_0xf459('0x11')]===0x1f4){logger[_0xf459('0x10')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x28a153(_0x599c50[_0xf459('0x10')][_0xf459('0x12')]);}logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x5ba229(_0x599c50['error'][_0xf459('0x12')]);}else{logger['info'](_0xf459('0x13'),_0x3cd829,_0xf459('0xd'));_0x5ba229(_0x599c50[_0xf459('0x14')][_0xf459('0x12')]);}})['catch'](function(_0x2288ec){logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x2288ec);_0x28a153(_0x2288ec);});});} \ No newline at end of file +var _0xf34b=['debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf34b,0xe5));var _0xbf34=function(_0x46e4fd,_0x2a3819){_0x46e4fd=_0x46e4fd-0x0;var _0x2032e1=_0xf34b[_0x46e4fd];return _0x2032e1;};'use strict';var _=require('lodash');var util=require(_0xbf34('0x0'));var moment=require(_0xbf34('0x1'));var BPromise=require(_0xbf34('0x2'));var rs=require(_0xbf34('0x3'));var fs=require('fs');var Redis=require(_0xbf34('0x4'));var db=require(_0xbf34('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf34('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf34('0x7'));var client=jayson[_0xbf34('0x8')][_0xbf34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x495e47,_0x136354,_0x1f50c3){return new BPromise(function(_0x3e1ce2,_0x35897e){return client['request'](_0x495e47,_0x1f50c3)[_0xbf34('0xa')](function(_0x212bc5){logger[_0xbf34('0xb')](_0xbf34('0xc'),_0x136354,'request\x20sent');logger[_0xbf34('0xd')](_0xbf34('0xe'),_0x136354,_0xbf34('0xf'),JSON[_0xbf34('0x10')](_0x212bc5));if(_0x212bc5[_0xbf34('0x11')]){if(_0x212bc5[_0xbf34('0x11')][_0xbf34('0x12')]===0x1f4){logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);return _0x35897e(_0x212bc5[_0xbf34('0x11')]['message']);}logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);return _0x3e1ce2(_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);}else{logger[_0xbf34('0xb')](_0xbf34('0xc'),_0x136354,'request\x20sent');_0x3e1ce2(_0x212bc5[_0xbf34('0x14')][_0xbf34('0x13')]);}})[_0xbf34('0x15')](function(_0x198e9c){logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x198e9c);_0x35897e(_0x198e9c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 8fefaea..c527281 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x19f727,_0x28224e){var _0x412836=function(_0x40634f){while(--_0x40634f){_0x19f727['push'](_0x19f727['shift']());}};_0x412836(++_0x28224e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x46891a,_0x3e3051){var _0x4c578d=function(_0x3cf400){while(--_0x3cf400){_0x46891a['push'](_0x46891a['shift']());}};_0x4c578d(++_0x3e3051);}(_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'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 68ff948..24f61d0 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 _0x278a=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x278a,0x90));var _0xa278=function(_0x37c900,_0x363707){_0x37c900=_0x37c900-0x0;var _0x85741f=_0x278a[_0x37c900];return _0x85741f;};'use strict';var Sequelize=require('sequelize');module[_0xa278('0x0')]={'priority':{'type':Sequelize[_0xa278('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa278('0x2')],'allowNull':![],'defaultValue':_0xa278('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa278('0x4')}}; \ No newline at end of file +var _0x4089=['INTEGER','STRING','noop','*,*,*,*'];(function(_0x43fd11,_0x5f4a49){var _0x402181=function(_0x4e2ab2){while(--_0x4e2ab2){_0x43fd11['push'](_0x43fd11['shift']());}};_0x402181(++_0x5f4a49);}(_0x4089,0x84));var _0x9408=function(_0x30fb66,_0x35da54){_0x30fb66=_0x30fb66-0x0;var _0x2880d9=_0x4089[_0x30fb66];return _0x2880d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9408('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9408('0x1')],'allowNull':![],'defaultValue':_0x9408('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9408('0x1')]},'interval':{'type':Sequelize[_0x9408('0x1')],'defaultValue':_0x9408('0x3')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 9c6e455..c358aef 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 _0x3ae9=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','show','params','model','query','filters','attributes','intersection','fields','length','includeAll','include','merge','ChatApplication','catch','body','find','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x16eadc,_0x3fc953){var _0x5b05c8=function(_0xd8b9cf){while(--_0xd8b9cf){_0x16eadc['push'](_0x16eadc['shift']());}};_0x5b05c8(++_0x3fc953);}(_0x3ae9,0xdb));var _0x93ae=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x3ae9[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93ae('0x0'));var jsonpatch=require(_0x93ae('0x1'));var rp=require(_0x93ae('0x2'));var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var Mustache=require(_0x93ae('0x4'));var util=require(_0x93ae('0x5'));var path=require(_0x93ae('0x6'));var sox=require('sox');var csv=require(_0x93ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ae('0x8'));var _=require(_0x93ae('0x9'));var squel=require(_0x93ae('0xa'));var crypto=require(_0x93ae('0xb'));var jsforce=require(_0x93ae('0xc'));var deskjs=require(_0x93ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93ae('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ae('0xf'));var as=require(_0x93ae('0x10'));var hardwareService=require(_0x93ae('0x11'));var logger=require(_0x93ae('0x12'))(_0x93ae('0x13'));var utils=require(_0x93ae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x93ae('0x15'))['db'];function respondWithStatusCode(_0x1a23a3,_0x4a9f52){_0x4a9f52=_0x4a9f52||0xcc;return function(_0x571e5f){if(_0x571e5f){return _0x1a23a3[_0x93ae('0x16')](_0x4a9f52);}return _0x1a23a3['status'](_0x4a9f52)[_0x93ae('0x17')]();};}function respondWithResult(_0xbaf0e,_0x5b4ea1){_0x5b4ea1=_0x5b4ea1||0xc8;return function(_0x392a55){if(_0x392a55){return _0xbaf0e[_0x93ae('0x18')](_0x5b4ea1)[_0x93ae('0x19')](_0x392a55);}};}function respondWithFilteredResult(_0x1f8aa2,_0x121937){return function(_0x2d1df5){if(_0x2d1df5){var _0x5ed82a=typeof _0x121937[_0x93ae('0x1a')]===_0x93ae('0x1b')&&typeof _0x121937[_0x93ae('0x1c')]==='undefined';var _0x1a1718=_0x2d1df5['count'];var _0x54cfd0=_0x5ed82a?0x0:_0x121937[_0x93ae('0x1a')];var _0x51c77d=_0x5ed82a?_0x2d1df5[_0x93ae('0x1d')]:_0x121937[_0x93ae('0x1a')]+_0x121937['limit'];var _0x2dd19a;if(_0x51c77d>=_0x1a1718){_0x51c77d=_0x1a1718;_0x2dd19a=0xc8;}else{_0x2dd19a=0xce;}_0x1f8aa2[_0x93ae('0x18')](_0x2dd19a);return _0x1f8aa2[_0x93ae('0x1e')](_0x93ae('0x1f'),_0x54cfd0+'-'+_0x51c77d+'/'+_0x1a1718)['json'](_0x2d1df5);}return null;};}function patchUpdates(_0x128913){return function(_0x2f4187){try{jsonpatch['apply'](_0x2f4187,_0x128913,!![]);}catch(_0x3e0407){return BPromise[_0x93ae('0x20')](_0x3e0407);}return _0x2f4187[_0x93ae('0x21')]();};}function saveUpdates(_0x29922f,_0x26d5ac){return function(_0x468fdf){if(_0x468fdf){return _0x468fdf[_0x93ae('0x22')](_0x29922f)['then'](function(_0x5e7c32){return _0x5e7c32;});}return null;};}function removeEntity(_0xd33af5,_0x283e50){return function(_0x4f9f43){if(_0x4f9f43){return _0x4f9f43['destroy']()[_0x93ae('0x23')](function(){_0xd33af5[_0x93ae('0x18')](0xcc)[_0x93ae('0x17')]();});}};}function handleEntityNotFound(_0x10f6a3,_0x1abea7){return function(_0xe17086){if(!_0xe17086){_0x10f6a3[_0x93ae('0x16')](0x194);}return _0xe17086;};}function handleError(_0x32ddca,_0x542656){_0x542656=_0x542656||0x1f4;return function(_0x564c15){logger['error'](_0x564c15[_0x93ae('0x24')]);if(_0x564c15[_0x93ae('0x25')]){delete _0x564c15[_0x93ae('0x25')];}_0x32ddca[_0x93ae('0x18')](_0x542656)[_0x93ae('0x26')](_0x564c15);};}exports[_0x93ae('0x27')]=function(_0x520d6d,_0x54a37b){var _0x223f42={'raw':!![],'where':{'id':_0x520d6d[_0x93ae('0x28')]['id']}},_0x115ac5={};_0x115ac5[_0x93ae('0x29')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x115ac5[_0x93ae('0x2a')]=_['keys'](_0x520d6d[_0x93ae('0x2a')]);_0x115ac5[_0x93ae('0x2b')]=_['intersection'](_0x115ac5[_0x93ae('0x29')],_0x115ac5[_0x93ae('0x2a')]);_0x223f42[_0x93ae('0x2c')]=_[_0x93ae('0x2d')](_0x115ac5[_0x93ae('0x29')],qs[_0x93ae('0x2e')](_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x2e')]));_0x223f42['attributes']=_0x223f42[_0x93ae('0x2c')][_0x93ae('0x2f')]?_0x223f42[_0x93ae('0x2c')]:_0x115ac5[_0x93ae('0x29')];if(_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x30')]){_0x223f42[_0x93ae('0x31')]=[{'all':!![]}];}_0x223f42=_[_0x93ae('0x32')]({},_0x223f42,_0x520d6d['options']);return db[_0x93ae('0x33')]['find'](_0x223f42)[_0x93ae('0x23')](handleEntityNotFound(_0x54a37b,null))[_0x93ae('0x23')](respondWithResult(_0x54a37b,null))[_0x93ae('0x34')](handleError(_0x54a37b,null));};exports[_0x93ae('0x22')]=function(_0x1778f7,_0x46ade5){if(_0x1778f7['body']['id']){delete _0x1778f7[_0x93ae('0x35')]['id'];}return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x1778f7['params']['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x46ade5,null))[_0x93ae('0x23')](saveUpdates(_0x1778f7[_0x93ae('0x35')],null))['then'](respondWithResult(_0x46ade5,null))['catch'](handleError(_0x46ade5,null));};exports[_0x93ae('0x37')]=function(_0x266126,_0x31e9b0){return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x266126[_0x93ae('0x28')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x31e9b0,null))[_0x93ae('0x23')](removeEntity(_0x31e9b0,null))[_0x93ae('0x34')](handleError(_0x31e9b0,null));}; \ No newline at end of file +var _0xd52d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','ChatApplication','catch','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x541c5d,_0x2ef384){var _0x3568b5=function(_0x589bd1){while(--_0x589bd1){_0x541c5d['push'](_0x541c5d['shift']());}};_0x3568b5(++_0x2ef384);}(_0xd52d,0x1c7));var _0xdd52=function(_0x2a5497,_0x19bceb){_0x2a5497=_0x2a5497-0x0;var _0x5a335a=_0xd52d[_0x2a5497];return _0x5a335a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd52('0x0'));var zipdir=require(_0xdd52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd52('0x3'));var util=require(_0xdd52('0x4'));var path=require(_0xdd52('0x5'));var sox=require(_0xdd52('0x6'));var csv=require(_0xdd52('0x7'));var ejs=require(_0xdd52('0x8'));var fs=require('fs');var fs_extra=require(_0xdd52('0x9'));var _=require(_0xdd52('0xa'));var squel=require('squel');var crypto=require(_0xdd52('0xb'));var jsforce=require(_0xdd52('0xc'));var deskjs=require(_0xdd52('0xd'));var toCsv=require(_0xdd52('0x7'));var querystring=require(_0xdd52('0xe'));var Papa=require(_0xdd52('0xf'));var Redis=require(_0xdd52('0x10'));var authService=require(_0xdd52('0x11'));var qs=require(_0xdd52('0x12'));var as=require(_0xdd52('0x13'));var hardwareService=require(_0xdd52('0x14'));var logger=require(_0xdd52('0x15'))(_0xdd52('0x16'));var utils=require('../../config/utils');var config=require(_0xdd52('0x17'));var licenseUtil=require(_0xdd52('0x18'));var db=require(_0xdd52('0x19'))['db'];function respondWithStatusCode(_0x2e940f,_0x19283f){_0x19283f=_0x19283f||0xcc;return function(_0xee8463){if(_0xee8463){return _0x2e940f['sendStatus'](_0x19283f);}return _0x2e940f[_0xdd52('0x1a')](_0x19283f)[_0xdd52('0x1b')]();};}function respondWithResult(_0x2e5642,_0x55b823){_0x55b823=_0x55b823||0xc8;return function(_0x3f6585){if(_0x3f6585){return _0x2e5642[_0xdd52('0x1a')](_0x55b823)[_0xdd52('0x1c')](_0x3f6585);}};}function respondWithFilteredResult(_0x181876,_0x336797){return function(_0x12c6da){if(_0x12c6da){var _0x25a2b7=typeof _0x336797[_0xdd52('0x1d')]==='undefined'&&typeof _0x336797[_0xdd52('0x1e')]==='undefined';var _0x2822be=_0x12c6da[_0xdd52('0x1f')];var _0x4568dc=_0x25a2b7?0x0:_0x336797[_0xdd52('0x1d')];var _0x4dc017=_0x25a2b7?_0x12c6da[_0xdd52('0x1f')]:_0x336797[_0xdd52('0x1d')]+_0x336797[_0xdd52('0x1e')];var _0x13f667;if(_0x4dc017>=_0x2822be){_0x4dc017=_0x2822be;_0x13f667=0xc8;}else{_0x13f667=0xce;}_0x181876['status'](_0x13f667);return _0x181876[_0xdd52('0x20')]('Content-Range',_0x4568dc+'-'+_0x4dc017+'/'+_0x2822be)[_0xdd52('0x1c')](_0x12c6da);}return null;};}function patchUpdates(_0x56e1db){return function(_0x30c411){try{jsonpatch[_0xdd52('0x21')](_0x30c411,_0x56e1db,!![]);}catch(_0x5a671a){return BPromise[_0xdd52('0x22')](_0x5a671a);}return _0x30c411['save']();};}function saveUpdates(_0x38c153,_0x59a041){return function(_0x14cd54){if(_0x14cd54){return _0x14cd54[_0xdd52('0x23')](_0x38c153)[_0xdd52('0x24')](function(_0xfd321){return _0xfd321;});}return null;};}function removeEntity(_0x1e8dbb,_0x455e74){return function(_0x3ce226){if(_0x3ce226){return _0x3ce226[_0xdd52('0x25')]()['then'](function(){_0x1e8dbb[_0xdd52('0x1a')](0xcc)[_0xdd52('0x1b')]();});}};}function handleEntityNotFound(_0x592f15,_0x1156cc){return function(_0x353fde){if(!_0x353fde){_0x592f15[_0xdd52('0x26')](0x194);}return _0x353fde;};}function handleError(_0x2f2dfa,_0x4ee66d){_0x4ee66d=_0x4ee66d||0x1f4;return function(_0x41c7e5){logger[_0xdd52('0x27')](_0x41c7e5[_0xdd52('0x28')]);if(_0x41c7e5['name']){delete _0x41c7e5['name'];}_0x2f2dfa[_0xdd52('0x1a')](_0x4ee66d)['send'](_0x41c7e5);};}exports[_0xdd52('0x29')]=function(_0x3f96bd,_0xeb81a0){var _0x539418={'raw':!![],'where':{'id':_0x3f96bd[_0xdd52('0x2a')]['id']}},_0x499e14={};_0x499e14[_0xdd52('0x2b')]=_[_0xdd52('0x2c')](db['ChatApplication']['rawAttributes']);_0x499e14[_0xdd52('0x2d')]=_['keys'](_0x3f96bd[_0xdd52('0x2d')]);_0x499e14[_0xdd52('0x2e')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],_0x499e14[_0xdd52('0x2d')]);_0x539418[_0xdd52('0x30')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],qs[_0xdd52('0x31')](_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x31')]));_0x539418[_0xdd52('0x30')]=_0x539418[_0xdd52('0x30')][_0xdd52('0x32')]?_0x539418[_0xdd52('0x30')]:_0x499e14[_0xdd52('0x2b')];if(_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x33')]){_0x539418[_0xdd52('0x34')]=[{'all':!![]}];}_0x539418=_[_0xdd52('0x35')]({},_0x539418,_0x3f96bd[_0xdd52('0x36')]);return db['ChatApplication'][_0xdd52('0x37')](_0x539418)[_0xdd52('0x24')](handleEntityNotFound(_0xeb81a0,null))['then'](respondWithResult(_0xeb81a0,null))['catch'](handleError(_0xeb81a0,null));};exports['update']=function(_0x17f735,_0x10d053){if(_0x17f735[_0xdd52('0x38')]['id']){delete _0x17f735[_0xdd52('0x38')]['id'];}return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x17f735[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x10d053,null))[_0xdd52('0x24')](saveUpdates(_0x17f735[_0xdd52('0x38')],null))['then'](respondWithResult(_0x10d053,null))[_0xdd52('0x3a')](handleError(_0x10d053,null));};exports[_0xdd52('0x25')]=function(_0x19ab35,_0x3497c3){return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x19ab35[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x3497c3,null))[_0xdd52('0x24')](removeEntity(_0x3497c3,null))[_0xdd52('0x3a')](handleError(_0x3497c3,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d5a7d1a..3c1ba58 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 _0x8743=['bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8743,0xa3));var _0x3874=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8743[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x3874('0x0'));var util=require(_0x3874('0x1'));var logger=require(_0x3874('0x2'))(_0x3874('0x3'));var moment=require(_0x3874('0x4'));var BPromise=require(_0x3874('0x5'));var rp=require(_0x3874('0x6'));var fs=require('fs');var path=require(_0x3874('0x7'));var rimraf=require(_0x3874('0x8'));var config=require('../../config/environment');var attributes=require(_0x3874('0x9'));module[_0x3874('0xa')]=function(_0x1de2f9,_0x4fd2de){return _0x1de2f9[_0x3874('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3874('0xc'),'collate':_0x3874('0xd')});}; \ No newline at end of file +var _0xd2d6=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xd2d6,0xa3));var _0x6d2d=function(_0x2b30cc,_0x54f567){_0x2b30cc=_0x2b30cc-0x0;var _0x39122c=_0xd2d6[_0x2b30cc];return _0x39122c;};'use strict';var _=require(_0x6d2d('0x0'));var util=require(_0x6d2d('0x1'));var logger=require(_0x6d2d('0x2'))('api');var moment=require(_0x6d2d('0x3'));var BPromise=require(_0x6d2d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d2d('0x5'));var rimraf=require(_0x6d2d('0x6'));var config=require(_0x6d2d('0x7'));var attributes=require(_0x6d2d('0x8'));module[_0x6d2d('0x9')]=function(_0x43dfa0,_0x3575eb){return _0x43dfa0[_0x6d2d('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d2d('0xb'),'collate':_0x6d2d('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5640d0b..97d4ef2 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 _0xa0b1=['stringify','error','message','info','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1f7f32,_0x1e0a55){var _0x47ab3a=function(_0x3d6afc){while(--_0x3d6afc){_0x1f7f32['push'](_0x1f7f32['shift']());}};_0x47ab3a(++_0x1e0a55);}(_0xa0b1,0xa5));var _0x1a0b=function(_0x49923f,_0x671404){_0x49923f=_0x49923f-0x0;var _0x560684=_0xa0b1[_0x49923f];return _0x560684;};'use strict';var _=require(_0x1a0b('0x0'));var util=require('util');var moment=require(_0x1a0b('0x1'));var BPromise=require(_0x1a0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a0b('0x3'));var logger=require(_0x1a0b('0x4'))(_0x1a0b('0x5'));var config=require(_0x1a0b('0x6'));var jayson=require(_0x1a0b('0x7'));var client=jayson[_0x1a0b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311a81,_0x52fe19,_0x34d49e){return new BPromise(function(_0x444f46,_0x40e322){return client[_0x1a0b('0x9')](_0x311a81,_0x34d49e)[_0x1a0b('0xa')](function(_0x33e882){logger['info'](_0x1a0b('0xb'),_0x52fe19,_0x1a0b('0xc'));logger[_0x1a0b('0xd')](_0x1a0b('0xe'),_0x52fe19,'request\x20sent',JSON[_0x1a0b('0xf')](_0x33e882));if(_0x33e882[_0x1a0b('0x10')]){if(_0x33e882[_0x1a0b('0x10')]['code']===0x1f4){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x33e882[_0x1a0b('0x10')]['message']);return _0x40e322(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}logger[_0x1a0b('0x10')](_0x1a0b('0xb'),_0x52fe19,_0x33e882['error'][_0x1a0b('0x11')]);return _0x444f46(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}else{logger[_0x1a0b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x52fe19,_0x1a0b('0xc'));_0x444f46(_0x33e882['result'][_0x1a0b('0x11')]);}})[_0x1a0b('0x13')](function(_0x24d28a){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x24d28a);_0x40e322(_0x24d28a);});});} \ No newline at end of file +var _0x1ec9=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ChatApplication,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x1ec9,0x142));var _0x91ec=function(_0x7dfaa,_0x1c8ae2){_0x7dfaa=_0x7dfaa-0x0;var _0x561f7d=_0x1ec9[_0x7dfaa];return _0x561f7d;};'use strict';var _=require(_0x91ec('0x0'));var util=require(_0x91ec('0x1'));var moment=require('moment');var BPromise=require(_0x91ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91ec('0x3'))['db'];var utils=require(_0x91ec('0x4'));var logger=require(_0x91ec('0x5'))(_0x91ec('0x6'));var config=require(_0x91ec('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x539328,_0x4266ed,_0xdfe11d){return new BPromise(function(_0x5ccb50,_0x198664){return client[_0x91ec('0x9')](_0x539328,_0xdfe11d)[_0x91ec('0xa')](function(_0x42f1a2){logger['info'](_0x91ec('0xb'),_0x4266ed,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4266ed,'request\x20sent',JSON[_0x91ec('0xc')](_0x42f1a2));if(_0x42f1a2[_0x91ec('0xd')]){if(_0x42f1a2['error'][_0x91ec('0xe')]===0x1f4){logger[_0x91ec('0xd')](_0x91ec('0xb'),_0x4266ed,_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);return _0x198664(_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);}logger[_0x91ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);return _0x5ccb50(_0x42f1a2[_0x91ec('0xd')]['message']);}else{logger[_0x91ec('0x10')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,'request\x20sent');_0x5ccb50(_0x42f1a2[_0x91ec('0x11')][_0x91ec('0xf')]);}})[_0x91ec('0x12')](function(_0x4075ed){logger[_0x91ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,_0x4075ed);_0x198664(_0x4075ed);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 48d9f5e..ef4ed64 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 _0x7b1e=['fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x579d67,_0x56a6aa){var _0x826234=function(_0x270f06){while(--_0x270f06){_0x579d67['push'](_0x579d67['shift']());}};_0x826234(++_0x56a6aa);}(_0x7b1e,0xe8));var _0xe7b1=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x7b1e[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0xe7b1('0x0'));var util=require(_0xe7b1('0x1'));var path=require(_0xe7b1('0x2'));var timeout=require(_0xe7b1('0x3'));var express=require(_0xe7b1('0x4'));var router=express[_0xe7b1('0x5')]();var fs_extra=require(_0xe7b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe7b1('0x7'));var config=require(_0xe7b1('0x8'));var controller=require(_0xe7b1('0x9'));router[_0xe7b1('0xa')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe7b1('0xc')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xd')]);router[_0xe7b1('0xe')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xf')]);module[_0xe7b1('0x10')]=router; \ No newline at end of file +var _0xaa79=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x8c20da,_0x49cfd6){var _0x50d918=function(_0xeaf97d){while(--_0xeaf97d){_0x8c20da['push'](_0x8c20da['shift']());}};_0x50d918(++_0x49cfd6);}(_0xaa79,0xd6));var _0x9aa7=function(_0x396052,_0x46a315){_0x396052=_0x396052-0x0;var _0x2221c4=_0xaa79[_0x396052];return _0x2221c4;};'use strict';var multer=require(_0x9aa7('0x0'));var util=require(_0x9aa7('0x1'));var path=require(_0x9aa7('0x2'));var timeout=require(_0x9aa7('0x3'));var express=require(_0x9aa7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9aa7('0x5'));var interaction=require(_0x9aa7('0x6'));var config=require(_0x9aa7('0x7'));var controller=require(_0x9aa7('0x8'));router[_0x9aa7('0x9')](_0x9aa7('0xa'),auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xc')]);router['put'](_0x9aa7('0xa'),auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xd')]);router[_0x9aa7('0xe')]('/:id',auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xf')]);module[_0x9aa7('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index dc31b56..41dcc55 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 _0x3adf=['STRING','BOOLEAN','sequelize','exports'];(function(_0xa91eed,_0x4b7c93){var _0x1c77fc=function(_0x67d2f){while(--_0x67d2f){_0xa91eed['push'](_0xa91eed['shift']());}};_0x1c77fc(++_0x4b7c93);}(_0x3adf,0x1a6));var _0xf3ad=function(_0x1193d0,_0x299caa){_0x1193d0=_0x1193d0-0x0;var _0x16d3a3=_0x3adf[_0x1193d0];return _0x16d3a3;};'use strict';var Sequelize=require(_0xf3ad('0x0'));module[_0xf3ad('0x1')]={'name':{'type':Sequelize[_0xf3ad('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf3ad('0x2')]},'write':{'type':Sequelize[_0xf3ad('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc177=['STRING','BOOLEAN','sequelize','exports'];(function(_0x51c021,_0x1706ca){var _0xab7c52=function(_0x32f913){while(--_0x32f913){_0x51c021['push'](_0x51c021['shift']());}};_0xab7c52(++_0x1706ca);}(_0xc177,0x1b2));var _0x7c17=function(_0x319f8c,_0x4db9c4){_0x319f8c=_0x319f8c-0x0;var _0x9be6dc=_0xc177[_0x319f8c];return _0x9be6dc;};'use strict';var Sequelize=require(_0x7c17('0x0'));module[_0x7c17('0x1')]={'name':{'type':Sequelize[_0x7c17('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7c17('0x2')]},'write':{'type':Sequelize[_0x7c17('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index df4b2c8..268f618 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 _0x5b75=['show','params','fields','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','nolimit','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','ChatGroup','include','findAll','rows','catch'];(function(_0x405ac9,_0x2c795c){var _0x2d200f=function(_0x27ae59){while(--_0x27ae59){_0x405ac9['push'](_0x405ac9['shift']());}};_0x2d200f(++_0x2c795c);}(_0x5b75,0x137));var _0x55b7=function(_0x5211bc,_0x410051){_0x5211bc=_0x5211bc-0x0;var _0x2e5a9f=_0x5b75[_0x5211bc];return _0x2e5a9f;};'use strict';var emlformat=require(_0x55b7('0x0'));var rimraf=require(_0x55b7('0x1'));var zipdir=require(_0x55b7('0x2'));var jsonpatch=require(_0x55b7('0x3'));var rp=require('request-promise');var moment=require(_0x55b7('0x4'));var BPromise=require(_0x55b7('0x5'));var Mustache=require(_0x55b7('0x6'));var util=require('util');var path=require(_0x55b7('0x7'));var sox=require(_0x55b7('0x8'));var csv=require(_0x55b7('0x9'));var ejs=require(_0x55b7('0xa'));var fs=require('fs');var fs_extra=require(_0x55b7('0xb'));var _=require(_0x55b7('0xc'));var squel=require(_0x55b7('0xd'));var crypto=require(_0x55b7('0xe'));var jsforce=require(_0x55b7('0xf'));var deskjs=require(_0x55b7('0x10'));var toCsv=require(_0x55b7('0x9'));var querystring=require('querystring');var Papa=require(_0x55b7('0x11'));var Redis=require(_0x55b7('0x12'));var authService=require(_0x55b7('0x13'));var qs=require(_0x55b7('0x14'));var as=require(_0x55b7('0x15'));var hardwareService=require(_0x55b7('0x16'));var logger=require(_0x55b7('0x17'))(_0x55b7('0x18'));var utils=require(_0x55b7('0x19'));var config=require(_0x55b7('0x1a'));var licenseUtil=require(_0x55b7('0x1b'));var db=require(_0x55b7('0x1c'))['db'];config[_0x55b7('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x55b7('0x1e'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3feb9b,_0xa5ab){_0xa5ab=_0xa5ab||0xcc;return function(_0xd47649){if(_0xd47649){return _0x3feb9b[_0x55b7('0x1f')](_0xa5ab);}return _0x3feb9b[_0x55b7('0x20')](_0xa5ab)['end']();};}function respondWithResult(_0x44ca4c,_0x29dad5){_0x29dad5=_0x29dad5||0xc8;return function(_0x5801b1){if(_0x5801b1){return _0x44ca4c[_0x55b7('0x20')](_0x29dad5)[_0x55b7('0x21')](_0x5801b1);}};}function respondWithFilteredResult(_0x5a85d9,_0xdc2a74){return function(_0x9b18ba){if(_0x9b18ba){var _0x2efc38=typeof _0xdc2a74[_0x55b7('0x22')]===_0x55b7('0x23')&&typeof _0xdc2a74[_0x55b7('0x24')]==='undefined';var _0x4d62af=_0x9b18ba[_0x55b7('0x25')];var _0x2ce3dc=_0x2efc38?0x0:_0xdc2a74[_0x55b7('0x22')];var _0x1e3645=_0x2efc38?_0x9b18ba['count']:_0xdc2a74['offset']+_0xdc2a74[_0x55b7('0x24')];var _0x6e295c;if(_0x1e3645>=_0x4d62af){_0x1e3645=_0x4d62af;_0x6e295c=0xc8;}else{_0x6e295c=0xce;}_0x5a85d9[_0x55b7('0x20')](_0x6e295c);return _0x5a85d9[_0x55b7('0x26')](_0x55b7('0x27'),_0x2ce3dc+'-'+_0x1e3645+'/'+_0x4d62af)['json'](_0x9b18ba);}return null;};}function patchUpdates(_0x28dbfb){return function(_0xf497fc){try{jsonpatch[_0x55b7('0x28')](_0xf497fc,_0x28dbfb,!![]);}catch(_0x2332a2){return BPromise[_0x55b7('0x29')](_0x2332a2);}return _0xf497fc['save']();};}function saveUpdates(_0x5b0343,_0x472d3f){return function(_0x5e6c86){if(_0x5e6c86){return _0x5e6c86[_0x55b7('0x2a')](_0x5b0343)[_0x55b7('0x2b')](function(_0x5f0781){return _0x5f0781;});}return null;};}function removeEntity(_0x12a218,_0x1008cf){return function(_0x1b19be){if(_0x1b19be){return _0x1b19be[_0x55b7('0x2c')]()[_0x55b7('0x2b')](function(){_0x12a218[_0x55b7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e434,_0x34aee7){return function(_0x22a246){if(!_0x22a246){_0x46e434[_0x55b7('0x1f')](0x194);}return _0x22a246;};}function handleError(_0x3af05e,_0x4b541c){_0x4b541c=_0x4b541c||0x1f4;return function(_0x16f9bb){logger['error'](_0x16f9bb[_0x55b7('0x2d')]);if(_0x16f9bb[_0x55b7('0x2e')]){delete _0x16f9bb['name'];}_0x3af05e['status'](_0x4b541c)['send'](_0x16f9bb);};}exports[_0x55b7('0x2f')]=function(_0x5f326f,_0x31d6dc){var _0x3b1935={},_0x2878a9={},_0x199fcd={'count':0x0,'rows':[]};var _0x35e1fb=_['map'](db['ChatGroup'][_0x55b7('0x30')],function(_0x3645ac){return{'name':_0x3645ac[_0x55b7('0x31')],'type':_0x3645ac[_0x55b7('0x32')][_0x55b7('0x33')]};});_0x2878a9[_0x55b7('0x34')]=_['map'](_0x35e1fb,_0x55b7('0x2e'));_0x2878a9[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x5f326f[_0x55b7('0x35')]);_0x2878a9[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],_0x2878a9['query']);_0x3b1935[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],qs['fields'](_0x5f326f['query']['fields']));_0x3b1935[_0x55b7('0x39')]=_0x3b1935[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x3b1935[_0x55b7('0x39')]:_0x2878a9[_0x55b7('0x34')];if(!_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3b')]('nolimit')){_0x3b1935[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0x5f326f['query']['limit']);_0x3b1935['offset']=qs['offset'](_0x5f326f['query'][_0x55b7('0x22')]);}_0x3b1935[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x3b1935['where']=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0x5f326f[_0x55b7('0x35')],_0x2878a9[_0x55b7('0x37')]),_0x35e1fb);if(_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x3b1935[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x3b1935[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x35e1fb,function(_0x613a81){if(_0x613a81['type']!=='VIRTUAL'){var _0x12976b={};_0x12976b[_0x613a81['name']]={'$like':'%'+_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x12976b;}})});}_0x3b1935=_[_0x55b7('0x41')]({},_0x3b1935,_0x5f326f[_0x55b7('0x43')]);var _0x25c857={'where':_0x3b1935[_0x55b7('0x40')]};return db[_0x55b7('0x44')][_0x55b7('0x25')](_0x25c857)[_0x55b7('0x2b')](function(_0x34bf78){_0x199fcd[_0x55b7('0x25')]=_0x34bf78;if(_0x5f326f[_0x55b7('0x35')]['includeAll']){_0x3b1935[_0x55b7('0x45')]=[{'all':!![]}];}return db[_0x55b7('0x44')][_0x55b7('0x46')](_0x3b1935);})[_0x55b7('0x2b')](function(_0x2c4d49){_0x199fcd[_0x55b7('0x47')]=_0x2c4d49;return _0x199fcd;})[_0x55b7('0x2b')](respondWithFilteredResult(_0x31d6dc,_0x3b1935))[_0x55b7('0x48')](handleError(_0x31d6dc,null));};exports[_0x55b7('0x49')]=function(_0x477897,_0x477982){var _0x16f80f={'raw':!![],'where':{'id':_0x477897[_0x55b7('0x4a')]['id']}},_0x52146f={};_0x52146f[_0x55b7('0x34')]=_[_0x55b7('0x36')](db[_0x55b7('0x44')][_0x55b7('0x30')]);_0x52146f[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x477897[_0x55b7('0x35')]);_0x52146f['filters']=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],_0x52146f['query']);_0x16f80f[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0x477897[_0x55b7('0x35')]['fields']));_0x16f80f[_0x55b7('0x39')]=_0x16f80f[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x16f80f[_0x55b7('0x39')]:_0x52146f[_0x55b7('0x34')];if(_0x477897[_0x55b7('0x35')][_0x55b7('0x4c')]){_0x16f80f['include']=[{'all':!![]}];}_0x16f80f=_[_0x55b7('0x41')]({},_0x16f80f,_0x477897['options']);return db[_0x55b7('0x44')][_0x55b7('0x4d')](_0x16f80f)[_0x55b7('0x2b')](handleEntityNotFound(_0x477982,null))[_0x55b7('0x2b')](respondWithResult(_0x477982,null))[_0x55b7('0x48')](handleError(_0x477982,null));};exports[_0x55b7('0x4e')]=function(_0x9055df,_0x42bfad){return db[_0x55b7('0x44')]['create'](_0x9055df[_0x55b7('0x4f')],{})[_0x55b7('0x2b')](respondWithResult(_0x42bfad,0xc9))['catch'](handleError(_0x42bfad,null));};exports[_0x55b7('0x2a')]=function(_0x5b7d1e,_0x49f01c){if(_0x5b7d1e[_0x55b7('0x4f')]['id']){delete _0x5b7d1e[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5b7d1e[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x49f01c,null))[_0x55b7('0x2b')](saveUpdates(_0x5b7d1e[_0x55b7('0x4f')],null))['then'](respondWithResult(_0x49f01c,null))['catch'](handleError(_0x49f01c,null));};exports[_0x55b7('0x2c')]=function(_0x3923ad,_0x483713){return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x3923ad[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x483713,null))[_0x55b7('0x2b')](removeEntity(_0x483713,null))[_0x55b7('0x48')](handleError(_0x483713,null));};exports['describe']=function(_0x143d56,_0x156b7f){return db[_0x55b7('0x44')][_0x55b7('0x50')]()['then'](respondWithResult(_0x156b7f,null))[_0x55b7('0x48')](handleError(_0x156b7f,null));};exports[_0x55b7('0x51')]=function(_0x285a01,_0x44ede3,_0x5ea535){return db[_0x55b7('0x52')][_0x55b7('0x25')]({'where':{'ChatGroupId':_0x285a01['params']['id'],'ToId':_0x285a01[_0x55b7('0x53')]['id'],'read':![]}})[_0x55b7('0x2b')](function(_0x4017ff){return{'id':_[_0x55b7('0x54')](_0x285a01[_0x55b7('0x4a')]['id']),'count':_0x4017ff};})['then'](respondWithResult(_0x44ede3,null))[_0x55b7('0x48')](handleError(_0x44ede3,null));};exports[_0x55b7('0x55')]=function(_0x59290b,_0x996d84,_0x1cf788){return db['ChatGroup']['find']({'where':{'id':_0x59290b[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x996d84,null))[_0x55b7('0x2b')](function(_0x245df7){if(_0x245df7){return _0x245df7[_0x55b7('0x55')](_0x59290b[_0x55b7('0x4f')][_0x55b7('0x56')],_[_0x55b7('0x57')](_0x59290b['body'],[_0x55b7('0x56'),'id'])||{});}})[_0x55b7('0x2b')](respondWithResult(_0x996d84,null))[_0x55b7('0x48')](handleError(_0x996d84,null));};exports[_0x55b7('0x58')]=function(_0x1a3ead,_0x4d864e,_0x467f7e){var _0x4ff6f8={};var _0x51c814={};var _0x572af2;var _0x4b3b46;return db[_0x55b7('0x44')]['findOne']({'where':{'id':_0x1a3ead['params']['id']}})['then'](handleEntityNotFound(_0x4d864e,null))[_0x55b7('0x2b')](function(_0x4689e2){if(_0x4689e2){_0x572af2=_0x4689e2;_0x51c814['model']=_[_0x55b7('0x36')](db[_0x55b7('0x59')]['rawAttributes']);_0x51c814['query']=_[_0x55b7('0x36')](_0x1a3ead['query']);_0x51c814[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x51c814[_0x55b7('0x34')],_0x51c814['query']);_0x4ff6f8[_0x55b7('0x39')]=_['intersection'](_0x51c814['model'],qs[_0x55b7('0x4b')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x4b')]));_0x4ff6f8[_0x55b7('0x39')]=_0x4ff6f8[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x4ff6f8[_0x55b7('0x39')]:_0x51c814[_0x55b7('0x34')];_0x4ff6f8[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x4ff6f8['where']=qs['filters'](_[_0x55b7('0x3e')](_0x1a3ead[_0x55b7('0x35')],_0x51c814[_0x55b7('0x37')]));if(_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x4ff6f8['where']=_[_0x55b7('0x41')](_0x4ff6f8[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x4ff6f8[_0x55b7('0x39')],function(_0x183530){var _0x3def34={};_0x3def34[_0x183530]={'$like':'%'+_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x3def34;})});}_0x4ff6f8=_['merge']({},_0x4ff6f8,_0x1a3ead[_0x55b7('0x43')]);return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})['then'](function(_0x1e9faa){if(_0x1e9faa){_0x4b3b46=_0x1e9faa[_0x55b7('0x3a')];if(!_0x1a3ead['query'][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x4ff6f8[_0x55b7('0x24')]=qs['limit'](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x24')]);_0x4ff6f8[_0x55b7('0x22')]=qs['offset'](_0x1a3ead['query'][_0x55b7('0x22')]);}return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})[_0x55b7('0x2b')](function(_0x590669){if(_0x590669){return _0x590669?{'count':_0x4b3b46,'rows':_0x590669}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x4d864e,null))[_0x55b7('0x48')](handleError(_0x4d864e,null));};exports['removeMembers']=function(_0x150393,_0x2a5c5d,_0x50a3ea){return db[_0x55b7('0x44')]['find']({'where':{'id':_0x150393['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x2a5c5d,null))[_0x55b7('0x2b')](function(_0x5aee6c){if(_0x5aee6c){return _0x5aee6c['removeMembers'](_0x150393[_0x55b7('0x35')][_0x55b7('0x56')]);}})[_0x55b7('0x2b')](respondWithStatusCode(_0x2a5c5d,null))[_0x55b7('0x48')](handleError(_0x2a5c5d,null));};exports['addMessage']=function(_0x5520b6,_0x17c6fa,_0x55ffdd){if(_0x5520b6[_0x55b7('0x4f')]['id']){delete _0x5520b6[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5520b6[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x17c6fa,null))[_0x55b7('0x2b')](function(_0x3d079f){if(_0x3d079f){_0x5520b6[_0x55b7('0x4f')]['ChatGroupId']=_0x3d079f['id'];return db[_0x55b7('0x52')][_0x55b7('0x4e')](_0x5520b6['body']);}})['then'](respondWithResult(_0x17c6fa,null))[_0x55b7('0x48')](handleError(_0x17c6fa,null));};exports['getMessages']=function(_0xcde715,_0x5267b4,_0x15d434){var _0x48cdb9={};var _0x1544cc={};var _0x49ad61;var _0x1adbd9;return db['ChatGroup'][_0x55b7('0x5b')]({'where':{'id':_0xcde715['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x5267b4,null))[_0x55b7('0x2b')](function(_0x1cdaf3){if(_0x1cdaf3){_0x49ad61=_0x1cdaf3;_0x1544cc[_0x55b7('0x34')]=_[_0x55b7('0x36')](db['ChatInternalMessage'][_0x55b7('0x30')]);_0x1544cc[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0xcde715['query']);_0x1544cc[_0x55b7('0x37')]=_['intersection'](_0x1544cc[_0x55b7('0x34')],_0x1544cc['query']);_0x48cdb9['attributes']=_[_0x55b7('0x38')](_0x1544cc[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0xcde715['query'][_0x55b7('0x4b')]));_0x48cdb9[_0x55b7('0x39')]=_0x48cdb9[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x48cdb9[_0x55b7('0x39')]:_0x1544cc[_0x55b7('0x34')];_0x48cdb9[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0xcde715[_0x55b7('0x35')]['sort']);_0x48cdb9[_0x55b7('0x40')]=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0xcde715[_0x55b7('0x35')],_0x1544cc[_0x55b7('0x37')]));if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],{'$or':_['map'](_0x48cdb9[_0x55b7('0x39')],function(_0x469c0b){var _0x4b7b97={};_0x4b7b97[_0x469c0b]={'$like':'%'+_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x4b7b97;})});}if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x5c')]){var _0x56e082=_0xcde715[_0x55b7('0x35')]['$gte'][_0x55b7('0x5d')](',');var _0x37f399={};_0x37f399[_0x56e082[0x0]]={'$gte':moment(_0x56e082[0x1])['format'](_0x55b7('0x5e'))};_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],_0x37f399);}_0x48cdb9=_['merge']({},_0x48cdb9,_0xcde715['options']);return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0xc73b75){if(_0xc73b75){_0x1adbd9=_0xc73b75[_0x55b7('0x3a')];if(!_0xcde715[_0x55b7('0x35')][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x48cdb9[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0xcde715['query'][_0x55b7('0x24')]);_0x48cdb9[_0x55b7('0x22')]=qs[_0x55b7('0x22')](_0xcde715['query'][_0x55b7('0x22')]);}return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0x21f179){if(_0x21f179){return _0x21f179?{'count':_0x1adbd9,'rows':_0x21f179}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x5267b4,null))[_0x55b7('0x48')](handleError(_0x5267b4,null));}; \ No newline at end of file +var _0xfcb2=['offset','undefined','limit','count','Content-Range','json','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','where','merge','VIRTUAL','includeAll','ChatGroup','rows','catch','show','params','include','options','find','create','body','getUnread','ChatInternalMessage','addMembers','ids','omit','pick','filter','length','hasOwnProperty','getMembers','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status'];(function(_0x14d17d,_0x56493b){var _0x388bb6=function(_0x3dd963){while(--_0x3dd963){_0x14d17d['push'](_0x14d17d['shift']());}};_0x388bb6(++_0x56493b);}(_0xfcb2,0xa2));var _0x2fcb=function(_0x523297,_0x15f343){_0x523297=_0x523297-0x0;var _0x530017=_0xfcb2[_0x523297];return _0x530017;};'use strict';var emlformat=require(_0x2fcb('0x0'));var rimraf=require(_0x2fcb('0x1'));var zipdir=require(_0x2fcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fcb('0x3'));var moment=require('moment');var BPromise=require(_0x2fcb('0x4'));var Mustache=require(_0x2fcb('0x5'));var util=require(_0x2fcb('0x6'));var path=require(_0x2fcb('0x7'));var sox=require(_0x2fcb('0x8'));var csv=require('to-csv');var ejs=require(_0x2fcb('0x9'));var fs=require('fs');var fs_extra=require(_0x2fcb('0xa'));var _=require(_0x2fcb('0xb'));var squel=require('squel');var crypto=require(_0x2fcb('0xc'));var jsforce=require(_0x2fcb('0xd'));var deskjs=require(_0x2fcb('0xe'));var toCsv=require(_0x2fcb('0xf'));var querystring=require('querystring');var Papa=require(_0x2fcb('0x10'));var Redis=require(_0x2fcb('0x11'));var authService=require(_0x2fcb('0x12'));var qs=require(_0x2fcb('0x13'));var as=require(_0x2fcb('0x14'));var hardwareService=require(_0x2fcb('0x15'));var logger=require(_0x2fcb('0x16'))(_0x2fcb('0x17'));var utils=require(_0x2fcb('0x18'));var config=require(_0x2fcb('0x19'));var licenseUtil=require(_0x2fcb('0x1a'));var db=require(_0x2fcb('0x1b'))['db'];config['redis']=_[_0x2fcb('0x1c')](config[_0x2fcb('0x1d')],{'host':_0x2fcb('0x1e'),'port':0x18eb});var socket=require(_0x2fcb('0x1f'))(new Redis(config[_0x2fcb('0x1d')]));require(_0x2fcb('0x20'))['register'](socket);function respondWithStatusCode(_0x1bc884,_0xba21d7){_0xba21d7=_0xba21d7||0xcc;return function(_0x3d69ce){if(_0x3d69ce){return _0x1bc884[_0x2fcb('0x21')](_0xba21d7);}return _0x1bc884['status'](_0xba21d7)[_0x2fcb('0x22')]();};}function respondWithResult(_0x8e5a34,_0x2f1a49){_0x2f1a49=_0x2f1a49||0xc8;return function(_0x2c0d19){if(_0x2c0d19){return _0x8e5a34[_0x2fcb('0x23')](_0x2f1a49)['json'](_0x2c0d19);}};}function respondWithFilteredResult(_0x4453fb,_0x28dd2d){return function(_0x5311b1){if(_0x5311b1){var _0x10ffbc=typeof _0x28dd2d[_0x2fcb('0x24')]===_0x2fcb('0x25')&&typeof _0x28dd2d[_0x2fcb('0x26')]===_0x2fcb('0x25');var _0x1f68aa=_0x5311b1[_0x2fcb('0x27')];var _0x5bf009=_0x10ffbc?0x0:_0x28dd2d[_0x2fcb('0x24')];var _0x518d68=_0x10ffbc?_0x5311b1[_0x2fcb('0x27')]:_0x28dd2d[_0x2fcb('0x24')]+_0x28dd2d[_0x2fcb('0x26')];var _0x1c674d;if(_0x518d68>=_0x1f68aa){_0x518d68=_0x1f68aa;_0x1c674d=0xc8;}else{_0x1c674d=0xce;}_0x4453fb[_0x2fcb('0x23')](_0x1c674d);return _0x4453fb['set'](_0x2fcb('0x28'),_0x5bf009+'-'+_0x518d68+'/'+_0x1f68aa)[_0x2fcb('0x29')](_0x5311b1);}return null;};}function patchUpdates(_0x155464){return function(_0x35159b){try{jsonpatch['apply'](_0x35159b,_0x155464,!![]);}catch(_0x59c5c8){return BPromise['reject'](_0x59c5c8);}return _0x35159b[_0x2fcb('0x2a')]();};}function saveUpdates(_0x41bb07,_0x4e1f71){return function(_0x53b6ed){if(_0x53b6ed){return _0x53b6ed[_0x2fcb('0x2b')](_0x41bb07)['then'](function(_0x5b4498){return _0x5b4498;});}return null;};}function removeEntity(_0x243786,_0x51e378){return function(_0x131383){if(_0x131383){return _0x131383[_0x2fcb('0x2c')]()[_0x2fcb('0x2d')](function(){_0x243786[_0x2fcb('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a847,_0x326298){return function(_0x311904){if(!_0x311904){_0x51a847[_0x2fcb('0x21')](0x194);}return _0x311904;};}function handleError(_0xc4d7fe,_0x34d225){_0x34d225=_0x34d225||0x1f4;return function(_0x4b5464){logger[_0x2fcb('0x2e')](_0x4b5464[_0x2fcb('0x2f')]);if(_0x4b5464[_0x2fcb('0x30')]){delete _0x4b5464[_0x2fcb('0x30')];}_0xc4d7fe[_0x2fcb('0x23')](_0x34d225)[_0x2fcb('0x31')](_0x4b5464);};}exports[_0x2fcb('0x32')]=function(_0x72424b,_0x4858b9){var _0x469d66={},_0x1b186f={},_0x5d836c={'count':0x0,'rows':[]};var _0x5542c8=_[_0x2fcb('0x33')](db['ChatGroup'][_0x2fcb('0x34')],function(_0x2d3c1e){return{'name':_0x2d3c1e[_0x2fcb('0x35')],'type':_0x2d3c1e[_0x2fcb('0x36')][_0x2fcb('0x37')]};});_0x1b186f[_0x2fcb('0x38')]=_[_0x2fcb('0x33')](_0x5542c8,_0x2fcb('0x30'));_0x1b186f[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x72424b[_0x2fcb('0x39')]);_0x1b186f['filters']=_[_0x2fcb('0x3b')](_0x1b186f[_0x2fcb('0x38')],_0x1b186f[_0x2fcb('0x39')]);_0x469d66[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x1b186f[_0x2fcb('0x38')],qs['fields'](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x469d66['attributes']=_0x469d66[_0x2fcb('0x3c')]['length']?_0x469d66['attributes']:_0x1b186f['model'];if(!_0x72424b[_0x2fcb('0x39')]['hasOwnProperty'](_0x2fcb('0x3e'))){_0x469d66[_0x2fcb('0x26')]=qs[_0x2fcb('0x26')](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x26')]);_0x469d66['offset']=qs[_0x2fcb('0x24')](_0x72424b[_0x2fcb('0x39')]['offset']);}_0x469d66[_0x2fcb('0x3f')]=qs['sort'](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x40')]);_0x469d66['where']=qs['filters'](_['pick'](_0x72424b[_0x2fcb('0x39')],_0x1b186f[_0x2fcb('0x41')]),_0x5542c8);if(_0x72424b['query']['filter']){_0x469d66[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x469d66[_0x2fcb('0x42')],{'$or':_[_0x2fcb('0x33')](_0x5542c8,function(_0x279db2){if(_0x279db2[_0x2fcb('0x36')]!==_0x2fcb('0x44')){var _0x4fd0ab={};_0x4fd0ab[_0x279db2[_0x2fcb('0x30')]]={'$like':'%'+_0x72424b['query']['filter']+'%'};return _0x4fd0ab;}})});}_0x469d66=_[_0x2fcb('0x43')]({},_0x469d66,_0x72424b['options']);var _0x3241df={'where':_0x469d66[_0x2fcb('0x42')]};return db['ChatGroup'][_0x2fcb('0x27')](_0x3241df)[_0x2fcb('0x2d')](function(_0x3a242d){_0x5d836c['count']=_0x3a242d;if(_0x72424b['query'][_0x2fcb('0x45')]){_0x469d66['include']=[{'all':!![]}];}return db[_0x2fcb('0x46')]['findAll'](_0x469d66);})[_0x2fcb('0x2d')](function(_0x1db681){_0x5d836c[_0x2fcb('0x47')]=_0x1db681;return _0x5d836c;})['then'](respondWithFilteredResult(_0x4858b9,_0x469d66))[_0x2fcb('0x48')](handleError(_0x4858b9,null));};exports[_0x2fcb('0x49')]=function(_0x283367,_0x20fb0a){var _0x1a11a7={'raw':!![],'where':{'id':_0x283367[_0x2fcb('0x4a')]['id']}},_0x3c543d={};_0x3c543d['model']=_[_0x2fcb('0x3a')](db[_0x2fcb('0x46')][_0x2fcb('0x34')]);_0x3c543d[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x283367['query']);_0x3c543d[_0x2fcb('0x41')]=_[_0x2fcb('0x3b')](_0x3c543d[_0x2fcb('0x38')],_0x3c543d['query']);_0x1a11a7[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x3c543d[_0x2fcb('0x38')],qs[_0x2fcb('0x3d')](_0x283367[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x1a11a7['attributes']=_0x1a11a7[_0x2fcb('0x3c')]['length']?_0x1a11a7['attributes']:_0x3c543d['model'];if(_0x283367['query']['includeAll']){_0x1a11a7[_0x2fcb('0x4b')]=[{'all':!![]}];}_0x1a11a7=_[_0x2fcb('0x43')]({},_0x1a11a7,_0x283367[_0x2fcb('0x4c')]);return db[_0x2fcb('0x46')][_0x2fcb('0x4d')](_0x1a11a7)[_0x2fcb('0x2d')](handleEntityNotFound(_0x20fb0a,null))['then'](respondWithResult(_0x20fb0a,null))[_0x2fcb('0x48')](handleError(_0x20fb0a,null));};exports[_0x2fcb('0x4e')]=function(_0x4feba0,_0x348b04){return db[_0x2fcb('0x46')][_0x2fcb('0x4e')](_0x4feba0[_0x2fcb('0x4f')],{})[_0x2fcb('0x2d')](respondWithResult(_0x348b04,0xc9))[_0x2fcb('0x48')](handleError(_0x348b04,null));};exports[_0x2fcb('0x2b')]=function(_0x9850d0,_0x283d7f){if(_0x9850d0[_0x2fcb('0x4f')]['id']){delete _0x9850d0[_0x2fcb('0x4f')]['id'];}return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x9850d0[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x283d7f,null))[_0x2fcb('0x2d')](saveUpdates(_0x9850d0['body'],null))[_0x2fcb('0x2d')](respondWithResult(_0x283d7f,null))[_0x2fcb('0x48')](handleError(_0x283d7f,null));};exports[_0x2fcb('0x2c')]=function(_0x510b54,_0x1c577d){return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x510b54[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x1c577d,null))[_0x2fcb('0x2d')](removeEntity(_0x1c577d,null))['catch'](handleError(_0x1c577d,null));};exports['describe']=function(_0x13c461,_0x1c3f0f){return db[_0x2fcb('0x46')]['describe']()[_0x2fcb('0x2d')](respondWithResult(_0x1c3f0f,null))[_0x2fcb('0x48')](handleError(_0x1c3f0f,null));};exports[_0x2fcb('0x50')]=function(_0x1dd70,_0x551a53,_0x1cd9fa){return db[_0x2fcb('0x51')][_0x2fcb('0x27')]({'where':{'ChatGroupId':_0x1dd70[_0x2fcb('0x4a')]['id'],'ToId':_0x1dd70['user']['id'],'read':![]}})['then'](function(_0x20cf4e){return{'id':_['toInteger'](_0x1dd70[_0x2fcb('0x4a')]['id']),'count':_0x20cf4e};})[_0x2fcb('0x2d')](respondWithResult(_0x551a53,null))[_0x2fcb('0x48')](handleError(_0x551a53,null));};exports[_0x2fcb('0x52')]=function(_0x18b5a6,_0x383137,_0x59abf1){return db[_0x2fcb('0x46')]['find']({'where':{'id':_0x18b5a6[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x383137,null))[_0x2fcb('0x2d')](function(_0x39646b){if(_0x39646b){return _0x39646b[_0x2fcb('0x52')](_0x18b5a6['body'][_0x2fcb('0x53')],_[_0x2fcb('0x54')](_0x18b5a6[_0x2fcb('0x4f')],['ids','id'])||{});}})[_0x2fcb('0x2d')](respondWithResult(_0x383137,null))['catch'](handleError(_0x383137,null));};exports['getMembers']=function(_0xabd242,_0x3c7ec0,_0x3563c2){var _0x3bdafd={};var _0x26f81b={};var _0xb9fa9f;var _0x21a55f;return db[_0x2fcb('0x46')]['findOne']({'where':{'id':_0xabd242[_0x2fcb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c7ec0,null))[_0x2fcb('0x2d')](function(_0x161c0f){if(_0x161c0f){_0xb9fa9f=_0x161c0f;_0x26f81b[_0x2fcb('0x38')]=_[_0x2fcb('0x3a')](db['User']['rawAttributes']);_0x26f81b[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0xabd242[_0x2fcb('0x39')]);_0x26f81b['filters']=_[_0x2fcb('0x3b')](_0x26f81b[_0x2fcb('0x38')],_0x26f81b['query']);_0x3bdafd[_0x2fcb('0x3c')]=_['intersection'](_0x26f81b[_0x2fcb('0x38')],qs[_0x2fcb('0x3d')](_0xabd242[_0x2fcb('0x39')]['fields']));_0x3bdafd['attributes']=_0x3bdafd[_0x2fcb('0x3c')]['length']?_0x3bdafd['attributes']:_0x26f81b[_0x2fcb('0x38')];_0x3bdafd[_0x2fcb('0x3f')]=qs[_0x2fcb('0x40')](_0xabd242['query']['sort']);_0x3bdafd['where']=qs[_0x2fcb('0x41')](_[_0x2fcb('0x55')](_0xabd242[_0x2fcb('0x39')],_0x26f81b[_0x2fcb('0x41')]));if(_0xabd242['query'][_0x2fcb('0x56')]){_0x3bdafd[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x3bdafd[_0x2fcb('0x42')],{'$or':_['map'](_0x3bdafd[_0x2fcb('0x3c')],function(_0x594044){var _0x4f8ebb={};_0x4f8ebb[_0x594044]={'$like':'%'+_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x56')]+'%'};return _0x4f8ebb;})});}_0x3bdafd=_[_0x2fcb('0x43')]({},_0x3bdafd,_0xabd242[_0x2fcb('0x4c')]);return _0xb9fa9f['getMembers'](_0x3bdafd);}})[_0x2fcb('0x2d')](function(_0xedff81){if(_0xedff81){_0x21a55f=_0xedff81[_0x2fcb('0x57')];if(!_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x58')](_0x2fcb('0x3e'))){_0x3bdafd[_0x2fcb('0x26')]=qs[_0x2fcb('0x26')](_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x26')]);_0x3bdafd[_0x2fcb('0x24')]=qs['offset'](_0xabd242['query'][_0x2fcb('0x24')]);}return _0xb9fa9f[_0x2fcb('0x59')](_0x3bdafd);}})[_0x2fcb('0x2d')](function(_0x48ee49){if(_0x48ee49){return _0x48ee49?{'count':_0x21a55f,'rows':_0x48ee49}:null;}})[_0x2fcb('0x2d')](respondWithResult(_0x3c7ec0,null))[_0x2fcb('0x48')](handleError(_0x3c7ec0,null));};exports[_0x2fcb('0x5a')]=function(_0x71e11,_0x249f4f,_0x4ce9dd){return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x71e11['params']['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x249f4f,null))[_0x2fcb('0x2d')](function(_0x45bc34){if(_0x45bc34){return _0x45bc34[_0x2fcb('0x5a')](_0x71e11[_0x2fcb('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x249f4f,null))[_0x2fcb('0x48')](handleError(_0x249f4f,null));};exports[_0x2fcb('0x5b')]=function(_0x44e6d5,_0x5edbfb,_0x1fa3a8){if(_0x44e6d5[_0x2fcb('0x4f')]['id']){delete _0x44e6d5[_0x2fcb('0x4f')]['id'];}return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x44e6d5[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x5edbfb,null))[_0x2fcb('0x2d')](function(_0x316cc6){if(_0x316cc6){_0x44e6d5[_0x2fcb('0x4f')][_0x2fcb('0x5c')]=_0x316cc6['id'];return db[_0x2fcb('0x51')][_0x2fcb('0x4e')](_0x44e6d5[_0x2fcb('0x4f')]);}})[_0x2fcb('0x2d')](respondWithResult(_0x5edbfb,null))[_0x2fcb('0x48')](handleError(_0x5edbfb,null));};exports['getMessages']=function(_0x1d974f,_0x1bd307,_0x545e68){var _0x22125d={};var _0x43f3f4={};var _0x33b687;var _0x52f5c0;return db['ChatGroup'][_0x2fcb('0x5d')]({'where':{'id':_0x1d974f[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x1bd307,null))[_0x2fcb('0x2d')](function(_0x2861bd){if(_0x2861bd){_0x33b687=_0x2861bd;_0x43f3f4[_0x2fcb('0x38')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x43f3f4[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x1d974f[_0x2fcb('0x39')]);_0x43f3f4['filters']=_[_0x2fcb('0x3b')](_0x43f3f4[_0x2fcb('0x38')],_0x43f3f4['query']);_0x22125d[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x43f3f4['model'],qs[_0x2fcb('0x3d')](_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x22125d[_0x2fcb('0x3c')]=_0x22125d['attributes'][_0x2fcb('0x57')]?_0x22125d['attributes']:_0x43f3f4[_0x2fcb('0x38')];_0x22125d['order']=qs[_0x2fcb('0x40')](_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x40')]);_0x22125d['where']=qs[_0x2fcb('0x41')](_[_0x2fcb('0x55')](_0x1d974f['query'],_0x43f3f4[_0x2fcb('0x41')]));if(_0x1d974f[_0x2fcb('0x39')]['filter']){_0x22125d[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x22125d[_0x2fcb('0x42')],{'$or':_[_0x2fcb('0x33')](_0x22125d['attributes'],function(_0x36ed8a){var _0x44fe1c={};_0x44fe1c[_0x36ed8a]={'$like':'%'+_0x1d974f['query'][_0x2fcb('0x56')]+'%'};return _0x44fe1c;})});}if(_0x1d974f['query']['$gte']){var _0x3e48ea=_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x5e')][_0x2fcb('0x5f')](',');var _0x47054c={};_0x47054c[_0x3e48ea[0x0]]={'$gte':moment(_0x3e48ea[0x1])[_0x2fcb('0x60')](_0x2fcb('0x61'))};_0x22125d[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x22125d[_0x2fcb('0x42')],_0x47054c);}_0x22125d=_[_0x2fcb('0x43')]({},_0x22125d,_0x1d974f[_0x2fcb('0x4c')]);return _0x33b687[_0x2fcb('0x62')](_0x22125d);}})[_0x2fcb('0x2d')](function(_0x419a37){if(_0x419a37){_0x52f5c0=_0x419a37[_0x2fcb('0x57')];if(!_0x1d974f[_0x2fcb('0x39')]['hasOwnProperty'](_0x2fcb('0x3e'))){_0x22125d['limit']=qs['limit'](_0x1d974f['query'][_0x2fcb('0x26')]);_0x22125d[_0x2fcb('0x24')]=qs[_0x2fcb('0x24')](_0x1d974f[_0x2fcb('0x39')]['offset']);}return _0x33b687[_0x2fcb('0x62')](_0x22125d);}})[_0x2fcb('0x2d')](function(_0x383e77){if(_0x383e77){return _0x383e77?{'count':_0x52f5c0,'rows':_0x383e77}:null;}})[_0x2fcb('0x2d')](respondWithResult(_0x1bd307,null))[_0x2fcb('0x48')](handleError(_0x1bd307,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index add507f..7d34ca8 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 _0x9b7c=['ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b7c,0x176));var _0xc9b7=function(_0x1ea053,_0x22aecc){_0x1ea053=_0x1ea053-0x0;var _0x444b08=_0x9b7c[_0x1ea053];return _0x444b08;};'use strict';var EventEmitter=require(_0xc9b7('0x0'));var ChatGroup=require(_0xc9b7('0x1'))['db'][_0xc9b7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc9b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9b7('0x4'),'afterDestroy':_0xc9b7('0x5')};function emitEvent(_0x29399d){return function(_0xee2a38,_0x251da6,_0x4a6516){ChatGroupEvents[_0xc9b7('0x6')](_0x29399d+':'+_0xee2a38['id'],_0xee2a38);ChatGroupEvents[_0xc9b7('0x6')](_0x29399d,_0xee2a38);_0x4a6516(null);};}for(var e in events){if(events[_0xc9b7('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x626d=['ChatGroup','setMaxListeners','save','remove','emit','exports','events'];(function(_0xc85e7f,_0x10574a){var _0x90e7c6=function(_0x4b2c85){while(--_0x4b2c85){_0xc85e7f['push'](_0xc85e7f['shift']());}};_0x90e7c6(++_0x10574a);}(_0x626d,0xa0));var _0xd626=function(_0x989980,_0x1e5018){_0x989980=_0x989980-0x0;var _0x939945=_0x626d[_0x989980];return _0x939945;};'use strict';var EventEmitter=require(_0xd626('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xd626('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd626('0x2')](0x0);var events={'afterCreate':_0xd626('0x3'),'afterUpdate':'update','afterDestroy':_0xd626('0x4')};function emitEvent(_0x33e3fc){return function(_0x31b2a5,_0x1ea984,_0xada387){ChatGroupEvents['emit'](_0x33e3fc+':'+_0x31b2a5['id'],_0x31b2a5);ChatGroupEvents[_0xd626('0x5')](_0x33e3fc,_0x31b2a5);_0xada387(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xd626('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index c5f6986..eee08cc 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 _0x8786=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0xdfc19,_0x48a555){var _0x1c3a65=function(_0x5dfc48){while(--_0x5dfc48){_0xdfc19['push'](_0xdfc19['shift']());}};_0x1c3a65(++_0x48a555);}(_0x8786,0x6c));var _0x6878=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8786[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var logger=require(_0x6878('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6878('0x3'));var rp=require(_0x6878('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6878('0x5'));var attributes=require(_0x6878('0x6'));module[_0x6878('0x7')]=function(_0x5851a6,_0x2c5f10){return _0x5851a6['define']('ChatGroup',attributes,{'tableName':_0x6878('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d7f=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x4d2612,_0x1f2501){var _0x1f21c4=function(_0x51ecab){while(--_0x51ecab){_0x4d2612['push'](_0x4d2612['shift']());}};_0x1f21c4(++_0x1f2501);}(_0x4d7f,0x161));var _0xf4d7=function(_0x580ea0,_0x3f57ef){_0x580ea0=_0x580ea0-0x0;var _0x54755e=_0x4d7f[_0x580ea0];return _0x54755e;};'use strict';var _=require(_0xf4d7('0x0'));var util=require(_0xf4d7('0x1'));var logger=require(_0xf4d7('0x2'))(_0xf4d7('0x3'));var moment=require(_0xf4d7('0x4'));var BPromise=require(_0xf4d7('0x5'));var rp=require(_0xf4d7('0x6'));var fs=require('fs');var path=require(_0xf4d7('0x7'));var rimraf=require(_0xf4d7('0x8'));var config=require(_0xf4d7('0x9'));var attributes=require(_0xf4d7('0xa'));module['exports']=function(_0x169cc6,_0x5793e4){return _0x169cc6[_0xf4d7('0xb')](_0xf4d7('0xc'),attributes,{'tableName':_0xf4d7('0xd'),'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 c10d2fa..63bbc99 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 _0x61a5=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x308119,_0x2335dd){var _0x30a8d7=function(_0x2d52ce){while(--_0x2d52ce){_0x308119['push'](_0x308119['shift']());}};_0x30a8d7(++_0x2335dd);}(_0x61a5,0xf0));var _0x561a=function(_0x131205,_0x57575c){_0x131205=_0x131205-0x0;var _0x305300=_0x61a5[_0x131205];return _0x305300;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require(_0x561a('0x3'));var fs=require('fs');var Redis=require(_0x561a('0x4'));var db=require(_0x561a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x561a('0x6'))(_0x561a('0x7'));var config=require('../../config/environment');var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});config[_0x561a('0xb')]=_[_0x561a('0xc')](config[_0x561a('0xb')],{'host':_0x561a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x561a('0xb')]));require('./chatGroup.socket')[_0x561a('0xe')](socket);function respondWithRpcPromise(_0x5288b4,_0x5b3510,_0x34e464){return new BPromise(function(_0x4071ba,_0x522f52){return client[_0x561a('0xf')](_0x5288b4,_0x34e464)['then'](function(_0x205e99){logger[_0x561a('0x10')](_0x561a('0x11'),_0x5b3510,_0x561a('0x12'));logger[_0x561a('0x13')](_0x561a('0x14'),_0x5b3510,_0x561a('0x12'),JSON[_0x561a('0x15')](_0x205e99));if(_0x205e99[_0x561a('0x16')]){if(_0x205e99[_0x561a('0x16')][_0x561a('0x17')]===0x1f4){logger[_0x561a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x522f52(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}logger[_0x561a('0x16')](_0x561a('0x11'),_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x4071ba(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}else{logger[_0x561a('0x10')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x561a('0x12'));_0x4071ba(_0x205e99[_0x561a('0x19')]['message']);}})[_0x561a('0x1a')](function(_0x785831){logger['error'](_0x561a('0x11'),_0x5b3510,_0x785831);_0x522f52(_0x785831);});});} \ No newline at end of file +var _0x8ece=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1ffa28,_0x104537){var _0x235fbb=function(_0x1dcc42){while(--_0x1dcc42){_0x1ffa28['push'](_0x1ffa28['shift']());}};_0x235fbb(++_0x104537);}(_0x8ece,0x195));var _0xe8ec=function(_0x3b8576,_0x241739){_0x3b8576=_0x3b8576-0x0;var _0x410744=_0x8ece[_0x3b8576];return _0x410744;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x4'))['db'];var utils=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});config[_0xe8ec('0xb')]=_[_0xe8ec('0xc')](config[_0xe8ec('0xb')],{'host':_0xe8ec('0xd'),'port':0x18eb});var socket=require(_0xe8ec('0xe'))(new Redis(config['redis']));require(_0xe8ec('0xf'))['register'](socket);function respondWithRpcPromise(_0x1345e0,_0x5b1569,_0x1b0a84){return new BPromise(function(_0x278f86,_0x4ff773){return client[_0xe8ec('0x10')](_0x1345e0,_0x1b0a84)[_0xe8ec('0x11')](function(_0x959f4){logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));logger[_0xe8ec('0x15')](_0xe8ec('0x16'),_0x5b1569,_0xe8ec('0x14'),JSON[_0xe8ec('0x17')](_0x959f4));if(_0x959f4['error']){if(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x19')]===0x1f4){logger[_0xe8ec('0x18')](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x4ff773(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);}logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x278f86(_0x959f4['error'][_0xe8ec('0x1a')]);}else{logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));_0x278f86(_0x959f4[_0xe8ec('0x1b')][_0xe8ec('0x1a')]);}})[_0xe8ec('0x1c')](function(_0x2e54f0){logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x2e54f0);_0x4ff773(_0x2e54f0);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 4667f66..c3bd289 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 _0x0eba=['removeListener','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x0eba,0x1d1));var _0xa0eb=function(_0x5715a2,_0x17e9c0){_0x5715a2=_0x5715a2-0x0;var _0x2ebf35=_0x0eba[_0x5715a2];return _0x2ebf35;};'use strict';var ChatGroupEvents=require(_0xa0eb('0x0'));var events=[_0xa0eb('0x1'),'remove','update'];function createListener(_0x38a06c,_0x475489){return function(_0x2c2d08){_0x475489[_0xa0eb('0x2')](_0x38a06c,_0x2c2d08);};}function removeListener(_0x984986,_0x397bd6){return function(){ChatGroupEvents[_0xa0eb('0x3')](_0x984986,_0x397bd6);};}exports['register']=function(_0x255b93){for(var _0x15ed4e=0x0,_0x545d73=events[_0xa0eb('0x4')];_0x15ed4e<_0x545d73;_0x15ed4e++){var _0x3f4cfd=events[_0x15ed4e];var _0x569016=createListener(_0xa0eb('0x5')+_0x3f4cfd,_0x255b93);ChatGroupEvents['on'](_0x3f4cfd,_0x569016);}}; \ No newline at end of file +var _0x363a=['./chatGroup.events','remove','emit','register','chatGroup:'];(function(_0x51d92a,_0x49d811){var _0x1236b0=function(_0x46c098){while(--_0x46c098){_0x51d92a['push'](_0x51d92a['shift']());}};_0x1236b0(++_0x49d811);}(_0x363a,0x1d6));var _0xa363=function(_0x1475a6,_0x56628c){_0x1475a6=_0x1475a6-0x0;var _0x3c0d07=_0x363a[_0x1475a6];return _0x3c0d07;};'use strict';var ChatGroupEvents=require(_0xa363('0x0'));var events=['save',_0xa363('0x1'),'update'];function createListener(_0x3e3904,_0x3ed619){return function(_0x38b957){_0x3ed619[_0xa363('0x2')](_0x3e3904,_0x38b957);};}function removeListener(_0x19adfb,_0x117c5a){return function(){ChatGroupEvents['removeListener'](_0x19adfb,_0x117c5a);};}exports[_0xa363('0x3')]=function(_0x16526d){for(var _0x43de0a=0x0,_0x135b6f=events['length'];_0x43de0a<_0x135b6f;_0x43de0a++){var _0x28b096=events[_0x43de0a];var _0x5447ed=createListener(_0xa363('0x4')+_0x28b096,_0x16526d);ChatGroupEvents['on'](_0x28b096,_0x5447ed);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 1a4af5c..fe0edf5 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 _0x1be7=['../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/messages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x353f81,_0x2e9105){var _0x261d52=function(_0x358e45){while(--_0x358e45){_0x353f81['push'](_0x353f81['shift']());}};_0x261d52(++_0x2e9105);}(_0x1be7,0x1d8));var _0x71be=function(_0x26f081,_0x4277f3){_0x26f081=_0x26f081-0x0;var _0x4bf032=_0x1be7[_0x26f081];return _0x4bf032;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x71be('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x71be('0x1'));var auth=require(_0x71be('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x71be('0x3'));var controller=require(_0x71be('0x4'));router[_0x71be('0x5')]('/',auth['isAuthenticated'](),controller[_0x71be('0x6')]);router[_0x71be('0x5')](_0x71be('0x7'),auth[_0x71be('0x8')](),controller[_0x71be('0x9')]);router[_0x71be('0x5')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0xb')]);router[_0x71be('0x5')]('/:id/unread',auth[_0x71be('0x8')](),controller[_0x71be('0xc')]);router['get']('/:id/members',auth[_0x71be('0x8')](),controller['getMembers']);router[_0x71be('0x5')](_0x71be('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x71be('0xe')]('/',auth['isAuthenticated'](),controller[_0x71be('0xf')]);router[_0x71be('0xe')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x11')]);router[_0x71be('0xe')](_0x71be('0xd'),auth[_0x71be('0x8')](),controller[_0x71be('0x12')]);router[_0x71be('0x13')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x14')]);router[_0x71be('0x15')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x16')]);router[_0x71be('0x15')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x17')]);module[_0x71be('0x18')]=router; \ No newline at end of file +var _0x4219=['post','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','create'];(function(_0x484a3e,_0x4c0eda){var _0x29a66a=function(_0x5310c3){while(--_0x5310c3){_0x484a3e['push'](_0x484a3e['shift']());}};_0x29a66a(++_0x4c0eda);}(_0x4219,0x17d));var _0x9421=function(_0xd89388,_0x33c473){_0xd89388=_0xd89388-0x0;var _0x4157a3=_0x4219[_0xd89388];return _0x4157a3;};'use strict';var multer=require('multer');var util=require(_0x9421('0x0'));var path=require(_0x9421('0x1'));var timeout=require(_0x9421('0x2'));var express=require(_0x9421('0x3'));var router=express[_0x9421('0x4')]();var fs_extra=require(_0x9421('0x5'));var auth=require(_0x9421('0x6'));var interaction=require(_0x9421('0x7'));var config=require(_0x9421('0x8'));var controller=require(_0x9421('0x9'));router['get']('/',auth[_0x9421('0xa')](),controller[_0x9421('0xb')]);router[_0x9421('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x9421('0xd')]);router['get'](_0x9421('0xe'),auth[_0x9421('0xa')](),controller[_0x9421('0xf')]);router[_0x9421('0xc')](_0x9421('0x10'),auth[_0x9421('0xa')](),controller[_0x9421('0x11')]);router[_0x9421('0xc')]('/:id/members',auth[_0x9421('0xa')](),controller[_0x9421('0x12')]);router[_0x9421('0xc')](_0x9421('0x13'),auth[_0x9421('0xa')](),controller[_0x9421('0x14')]);router['post']('/',auth[_0x9421('0xa')](),controller[_0x9421('0x15')]);router[_0x9421('0x16')](_0x9421('0x17'),auth[_0x9421('0xa')](),controller[_0x9421('0x18')]);router[_0x9421('0x16')]('/:id/messages',auth[_0x9421('0xa')](),controller[_0x9421('0x19')]);router[_0x9421('0x1a')](_0x9421('0xe'),auth[_0x9421('0xa')](),controller[_0x9421('0x1b')]);router[_0x9421('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9421('0x1d')]);router[_0x9421('0x1c')](_0x9421('0x17'),auth[_0x9421('0xa')](),controller[_0x9421('0x1e')]);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 fbef10e..b5b3e44 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 _0x3c0d=['DATE','long','out','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x578e15,_0x8e0df0){var _0x4c547d=function(_0x3c6888){while(--_0x3c6888){_0x578e15['push'](_0x578e15['shift']());}};_0x4c547d(++_0x8e0df0);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x4e823f,_0x1eb3f9){_0x4e823f=_0x4e823f-0x0;var _0x294b36=_0x3c0d[_0x4e823f];return _0x294b36;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd3c0('0x0')]},'ratingType':{'type':Sequelize[_0xd3c0('0x1')](_0xd3c0('0x2'),_0xd3c0('0x3')),'defaultValue':_0xd3c0('0x2')},'ratingMessage':{'type':Sequelize[_0xd3c0('0x4')]},'pathTranscript':{'type':Sequelize[_0xd3c0('0x4')]},'mailTranscript':{'type':Sequelize[_0xd3c0('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd3c0('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd3c0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd3c0('0x5')]},'browserName':{'type':Sequelize[_0xd3c0('0x5')]},'browserVersion':{'type':Sequelize[_0xd3c0('0x5')]},'osName':{'type':Sequelize[_0xd3c0('0x5')]},'osVersion':{'type':Sequelize[_0xd3c0('0x5')]},'deviceModel':{'type':Sequelize[_0xd3c0('0x5')]},'deviceVendor':{'type':Sequelize[_0xd3c0('0x5')]},'deviceType':{'type':Sequelize[_0xd3c0('0x5')]},'referer':{'type':Sequelize[_0xd3c0('0x4')]},'customerIp':{'type':Sequelize[_0xd3c0('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xd3c0('0x7'))},'read1stAt':{'type':Sequelize[_0xd3c0('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd3c0('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd3c0('0x5')]},'customerPort':{'type':Sequelize[_0xd3c0('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xd3c0('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb248=['INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN'];(function(_0x2d5818,_0xc9aa8b){var _0x1d1e9d=function(_0xdea9e8){while(--_0xdea9e8){_0x2d5818['push'](_0x2d5818['shift']());}};_0x1d1e9d(++_0xc9aa8b);}(_0xb248,0xc6));var _0x8b24=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb248[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x8b24('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8b24('0x2')]},'ratingType':{'type':Sequelize[_0x8b24('0x3')](_0x8b24('0x4'),'thumb'),'defaultValue':_0x8b24('0x4')},'ratingMessage':{'type':Sequelize[_0x8b24('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8b24('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8b24('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8b24('0x6')]},'thirdDisposition':{'type':Sequelize[_0x8b24('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x8b24('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8b24('0x6')]},'osVersion':{'type':Sequelize[_0x8b24('0x6')]},'deviceModel':{'type':Sequelize[_0x8b24('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x8b24('0x6')]},'referer':{'type':Sequelize[_0x8b24('0x5')]},'customerIp':{'type':Sequelize[_0x8b24('0x6')]},'formData':{'type':Sequelize[_0x8b24('0x5')](_0x8b24('0x8'))},'read1stAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8b24('0x3')]('in',_0x8b24('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8b24('0x6')]},'customerPort':{'type':Sequelize[_0x8b24('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x8b24('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index cdb8371..c856604 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 _0xdfd5=['order','ChatInteractionId','includeAgent','push','rows','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','files','tmp','transcript-%d-%s.zip','lastName','attachments','read','Account','mkdirSync','Chat','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createWriteStream','firstName','value','server','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','merge','body','contact','agent','interaction','map','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','params','model','keys','ChatInteraction','filters','intersection','fields','attributes','includeAll','include','options','create','update','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooMetadata','vidaooApiKey','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','attachId','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ContactId','Messages','length','agentAlias','System','customer','Visitor','website_alias','%s%d','agent_alias','alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','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','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfd5,0x1c3));var _0x5dfd=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xdfd5[_0xc0a3d3];return _0x3386e8;};'use strict';var rimraf=require(_0x5dfd('0x0'));var zipdir=require(_0x5dfd('0x1'));var rp=require(_0x5dfd('0x2'));var moment=require(_0x5dfd('0x3'));var BPromise=require(_0x5dfd('0x4'));var Mustache=require(_0x5dfd('0x5'));var util=require(_0x5dfd('0x6'));var path=require(_0x5dfd('0x7'));var ejs=require(_0x5dfd('0x8'));var fs=require('fs');var _=require(_0x5dfd('0x9'));var Redis=require(_0x5dfd('0xa'));var interaction=require(_0x5dfd('0xb'));var qs=require('../../components/parsers/qs');var pdf=require(_0x5dfd('0xc'));var logger=require(_0x5dfd('0xd'))('api');var config=require(_0x5dfd('0xe'));var db=require('../../mysqldb')['db'];config[_0x5dfd('0xf')]=_[_0x5dfd('0x10')](config[_0x5dfd('0xf')],{'host':_0x5dfd('0x11'),'port':0x18eb});var socket=require(_0x5dfd('0x12'))(new Redis(config[_0x5dfd('0xf')]));require('./chatInteraction.socket')[_0x5dfd('0x13')](socket);var jayson=require(_0x5dfd('0x14'));var client=jayson[_0x5dfd('0x15')][_0x5dfd('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x5dfd('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x567186,_0x5e63cd,_0xa31e,_0x22c24c){return new BPromise(function(_0xbc4f07,_0x5f5342){var _0x4dfecd=_0x22c24c||client;return _0x4dfecd[_0x5dfd('0x17')](_0x567186,_0xa31e)[_0x5dfd('0x18')](function(_0x1b265e){logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));logger[_0x5dfd('0x1c')](_0x5dfd('0x1d'),_0x5e63cd,_0x5dfd('0x1b'),JSON[_0x5dfd('0x1e')](_0x1b265e));if(_0x1b265e[_0x5dfd('0x1f')]){if(_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x20')]===0x1f4){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0x5f5342(_0x1b265e['error']['message']);}logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0xbc4f07(_0x1b265e['error']['message']);}else{logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));_0xbc4f07(_0x1b265e['result'][_0x5dfd('0x21')]);}})[_0x5dfd('0x22')](function(_0xa72fe0){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0xa72fe0);_0x5f5342(_0xa72fe0);});});}function respondWithStatusCode(_0x25f52d,_0x11de10){_0x11de10=_0x11de10||0xcc;return function(_0x1fe62a){if(_0x1fe62a){return _0x25f52d[_0x5dfd('0x23')](_0x11de10);}return _0x25f52d[_0x5dfd('0x24')](_0x11de10)[_0x5dfd('0x25')]();};}function respondWithResult(_0x3b2bc5,_0x1ee99f){_0x1ee99f=_0x1ee99f||0xc8;return function(_0x149c22){if(_0x149c22){return _0x3b2bc5[_0x5dfd('0x24')](_0x1ee99f)[_0x5dfd('0x26')](_0x149c22);}};}function respondWithFilteredResult(_0x5165f4,_0x5ee86b){return function(_0x1a2f90){if(_0x1a2f90){var _0x96e0aa=typeof _0x5ee86b[_0x5dfd('0x27')]===_0x5dfd('0x28')&&typeof _0x5ee86b[_0x5dfd('0x29')]===_0x5dfd('0x28');var _0x24f158=_0x1a2f90[_0x5dfd('0x2a')];var _0x350ee2=_0x96e0aa?0x0:_0x5ee86b[_0x5dfd('0x27')];var _0x3230ab=_0x96e0aa?_0x1a2f90[_0x5dfd('0x2a')]:_0x5ee86b[_0x5dfd('0x27')]+_0x5ee86b[_0x5dfd('0x29')];var _0x41a7c5;if(_0x3230ab>=_0x24f158){_0x3230ab=_0x24f158;_0x41a7c5=0xc8;}else{_0x41a7c5=0xce;}_0x5165f4[_0x5dfd('0x24')](_0x41a7c5);return _0x5165f4[_0x5dfd('0x2b')](_0x5dfd('0x2c'),_0x350ee2+'-'+_0x3230ab+'/'+_0x24f158)['json'](_0x1a2f90);}return null;};}function saveUpdates(_0x13bc15){return function(_0x3c3b30){if(_0x3c3b30){return _0x3c3b30['update'](_0x13bc15)['then'](function(_0x15b12f){return _0x15b12f;});}return null;};}function removeEntity(_0x57d752){return function(_0x286a37){if(_0x286a37){return _0x286a37[_0x5dfd('0x2d')]()[_0x5dfd('0x18')](function(){_0x57d752[_0x5dfd('0x24')](0xcc)[_0x5dfd('0x25')]();});}};}function handleEntityNotFound(_0x296624){return function(_0x40dff6){if(!_0x40dff6){_0x296624['sendStatus'](0x194);}return _0x40dff6;};}function handleError(_0x26416b,_0x11b367){_0x11b367=_0x11b367||0x1f4;return function(_0x5cd921){logger['error'](_0x5cd921[_0x5dfd('0x2e')]);if(_0x5cd921[_0x5dfd('0x2f')]){delete _0x5cd921[_0x5dfd('0x2f')];}_0x26416b[_0x5dfd('0x24')](_0x11b367)['send'](_0x5cd921);};}function getMustacheRender(_0x434eb1,_0x5b8a61){return Mustache[_0x5dfd('0x30')](_0x434eb1,_[_0x5dfd('0x31')](_0x5b8a61[_0x5dfd('0x32')],{'contact':_0x5b8a61[_0x5dfd('0x33')],'message':_0x5b8a61[_0x5dfd('0x21')],'agent':_0x5b8a61[_0x5dfd('0x34')],'interaction':_0x5b8a61[_0x5dfd('0x35')],'account':_0x5b8a61['account']}))||'';}exports['index']=function(_0x263f18,_0x13d7d3){var _0x5dc4be={};var _0x218b46=_[_0x5dfd('0x36')](db['ChatInteraction'][_0x5dfd('0x37')],function(_0x4ebc78){return{'name':_0x4ebc78[_0x5dfd('0x38')],'type':_0x4ebc78[_0x5dfd('0x39')][_0x5dfd('0x3a')]};});_0x5dc4be=qs['getOptions'](_0x218b46,_0x263f18);return interaction[_0x5dfd('0x3b')](_0x5dfd('0x3c'),_0x263f18[_0x5dfd('0x3d')],_0x263f18[_0x5dfd('0x3e')],_0x5dc4be,_0x218b46)[_0x5dfd('0x18')](respondWithFilteredResult(_0x13d7d3,_0x5dc4be))['catch'](handleError(_0x13d7d3,null));};exports[_0x5dfd('0x3f')]=function(_0x18ac03,_0x4680a4){var _0x5f153={'raw':![],'where':{'id':_0x18ac03[_0x5dfd('0x40')]['id']}},_0x5928d3={};_0x5928d3[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x43')]['rawAttributes']);_0x5928d3[_0x5dfd('0x3d')]=_['keys'](_0x18ac03[_0x5dfd('0x3d')]);_0x5928d3[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],_0x5928d3[_0x5dfd('0x3d')]);_0x5f153['attributes']=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x5f153[_0x5dfd('0x47')]=_0x5f153[_0x5dfd('0x47')]['length']?_0x5f153[_0x5dfd('0x47')]:_0x5928d3[_0x5dfd('0x41')];if(_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x5f153[_0x5dfd('0x49')]=[{'all':!![]}];}_0x5f153=_[_0x5dfd('0x31')]({},_0x5f153,_0x18ac03[_0x5dfd('0x4a')]);return db[_0x5dfd('0x43')]['find'](_0x5f153)[_0x5dfd('0x18')](handleEntityNotFound(_0x4680a4,null))[_0x5dfd('0x18')](respondWithResult(_0x4680a4,null))[_0x5dfd('0x22')](handleError(_0x4680a4,null));};exports[_0x5dfd('0x4b')]=function(_0x2d3aa5,_0x136f15){return db[_0x5dfd('0x43')][_0x5dfd('0x4b')](_0x2d3aa5[_0x5dfd('0x32')],{})[_0x5dfd('0x18')](respondWithResult(_0x136f15,0xc9))[_0x5dfd('0x22')](handleError(_0x136f15,null));};exports[_0x5dfd('0x4c')]=function(_0x3ce5fd,_0x24361d){if(_0x3ce5fd['body']['id']){delete _0x3ce5fd[_0x5dfd('0x32')]['id'];}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x3ce5fd['params']['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x24361d,null))[_0x5dfd('0x18')](saveUpdates(_0x3ce5fd[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x24361d,null))[_0x5dfd('0x22')](handleError(_0x24361d,null));};exports[_0x5dfd('0x2d')]=function(_0x4f57ae,_0x422706){return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x4f57ae[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x422706,null))[_0x5dfd('0x18')](removeEntity(_0x422706,null))[_0x5dfd('0x22')](handleError(_0x422706,null));};exports[_0x5dfd('0x4e')]=function(_0x2e19bb,_0x166ced){return db['ChatInteraction'][_0x5dfd('0x4e')]()[_0x5dfd('0x18')](respondWithResult(_0x166ced,null))[_0x5dfd('0x22')](handleError(_0x166ced,null));};exports['createVidaooSession']=function(_0x71ba3e,_0x32532d){var _0x3865e5=_0x71ba3e[_0x5dfd('0x40')]['id'];var _0x333035;var _0xd98c0f;var _0x40e9d7;return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x3865e5}})['then'](function(_0x28c84a){_0x333035=_0x28c84a;return db[_0x5dfd('0x50')]['findOne']({'where':{'id':_0x28c84a[_0x5dfd('0x51')]},'attributes':['id','vidaooApiKey',_0x5dfd('0x52'),'vidaooTopic','vidaooNote',_0x5dfd('0x53')],'raw':!![]});})[_0x5dfd('0x18')](function(_0x4f3af6){if(_0x4f3af6&&_0x4f3af6[_0x5dfd('0x54')]&&_0x4f3af6[_0x5dfd('0x52')]){_0xd98c0f=_0x4f3af6;var _0x2f38c5={'interaction':{'id':_0x3865e5},'agent':{'id':_0x71ba3e[_0x5dfd('0x3e')]['id'],'name':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x2f')],'fullname':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x55')],'email':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]},'contact':_0x71ba3e['body'][_0x5dfd('0x33')],'account':_0x71ba3e[_0x5dfd('0x32')][_0x5dfd('0x57')]};var _0x2d8585={'rejectUnauthorized':![],'method':_0x5dfd('0x58'),'url':_0x5dfd('0x59'),'headers':{'X-APIKEY':_0x4f3af6[_0x5dfd('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]],'buttons':null,'topic':_0xd98c0f[_0x5dfd('0x5a')],'note':_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x5c')])?null:getMustacheRender(_0xd98c0f[_0x5dfd('0x5c')],_0x2f38c5),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x53')])){var _0xe2649d=getMustacheRender(_0xd98c0f[_0x5dfd('0x53')],_0x2f38c5);var _0x5726df=JSON['parse'](_0xe2649d);_0x2d8585[_0x5dfd('0x32')][_0x5dfd('0x5d')]=_0x5726df;}}catch(_0x642260){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2d8585);}else{throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x60'));}})['then'](function(_0x11334e){_0x40e9d7=_0x11334e;if(_0x40e9d7['id']){var _0x4b8f19={'body':_0x40e9d7['join_url'],'ChatWebsiteId':_0xd98c0f['id'],'ChatInteractionId':_0x333035['id'],'direction':_0x5dfd('0x61'),'UserId':_0x71ba3e['user']['id']};return db[_0x5dfd('0x62')]['create'](_0x4b8f19,{});}else{throw new db['Sequelize'][(_0x5dfd('0x5f'))](_0x5dfd('0x63'));}})[_0x5dfd('0x18')](function(){return _0x333035[_0x5dfd('0x64')]({'vidaooSessionId':_0x40e9d7['id']});})[_0x5dfd('0x18')](respondWithResult(_0x32532d,null))['catch'](handleError(_0x32532d,null));};exports['customUpdate']=function(_0x177168,_0x476020){if(_0x177168[_0x5dfd('0x32')]['id']){delete _0x177168['body']['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x177168[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x65')],'as':_0x5dfd('0x66')}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x476020,null))['then'](saveUpdates(_0x177168[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x476020,null))['catch'](handleError(_0x476020,null));};exports['abandon']=function(_0x4766c5,_0x34357c){if(_0x4766c5[_0x5dfd('0x32')]['id']){delete _0x4766c5[_0x5dfd('0x32')]['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4766c5['params']['id']}})[_0x5dfd('0x18')](function(_0x355b5e){if(!_0x355b5e){logger[_0x5dfd('0x1f')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5dfd('0x67'),0x194,_0x5dfd('0x68'));_0x34357c[_0x5dfd('0x23')](0x194);}else{if(_0x355b5e[_0x5dfd('0x69')]){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x6a'));}}return _0x355b5e;})[_0x5dfd('0x18')](function(_0x5c5583){if(_0x5c5583){return _0x5c5583[_0x5dfd('0x4c')]({'closed':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6b')],'disposition':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6c')]})[_0x5dfd('0x18')](function(_0x3de061){return _0x3de061;});}})[_0x5dfd('0x18')](function(){return respondWithRpcPromise(_0x5dfd('0x6d'),_0x5dfd('0x67'),_0x4766c5[_0x5dfd('0x32')],client9004);})['then'](respondWithResult(_0x34357c,null))['catch'](handleError(_0x34357c,null));};exports[_0x5dfd('0x6e')]=function(_0x3dd887,_0x2ae1fe){_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x2f')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x70')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x71')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x72')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x39')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x73')];return db[_0x5dfd('0x74')]['create'](_0x3dd887['body'])[_0x5dfd('0x18')](respondWithResult(_0x2ae1fe,0xc9))[_0x5dfd('0x22')](handleError(_0x2ae1fe,null));};exports['attachmentDownload']=function(_0x1d8f5f,_0x5b75e4){return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f[_0x5dfd('0x40')]['id']},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null))[_0x5dfd('0x18')](function(_0x158a97){if(_0x158a97){if(_0x158a97[_0x5dfd('0x6b')]){return _0x5b75e4[_0x5dfd('0x24')](0x193)[_0x5dfd('0x26')]({'status':0x193,'message':_0x5dfd('0x75')});}return db['Attachment'][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f['query'][_0x5dfd('0x76')]},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null));}})['then'](function(_0xc20fa7){if(_0xc20fa7){var _0x2df00c=_0xc20fa7['ChatOfflineMessageId']!==null;var _0x522d2e=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x79'));if(_0x2df00c){_0x522d2e=path[_0x5dfd('0x77')](_0x522d2e,'offline-chat/');}var _0x35d594=path['join'](_0x522d2e,_0xc20fa7[_0x5dfd('0x71')]);return _0x5b75e4['download'](_0x35d594);}})['catch'](handleError(_0x5b75e4,null));};exports['close']=function(_0x36c9fa,_0x2bb094){var _0x4118de=null;var _0x1f57a0=null;var _0x4be4c1=null;if(_0x36c9fa[_0x5dfd('0x32')]['id']){delete _0x36c9fa['body']['id'];}if(_0x36c9fa['body'][_0x5dfd('0x7a')]){_0x4be4c1=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x7b'),util[_0x5dfd('0x7c')](_0x5dfd('0x7d'),Date[_0x5dfd('0x7e')]()));_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7f')]=_0x4be4c1;}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x36c9fa[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x62')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x2bb094,null))[_0x5dfd('0x18')](saveUpdates(_0x36c9fa['body'],null))[_0x5dfd('0x18')](function(_0x20d94f){if(_0x20d94f){_0x4118de=_0x20d94f;return db[_0x5dfd('0x50')][_0x5dfd('0x4d')]({'where':{'id':_0x4118de['ChatWebsiteId']}});}})[_0x5dfd('0x18')](function(_0x1abfac){if(_0x1abfac){_0x1f57a0=_0x1abfac;return db[_0x5dfd('0x65')]['find']({'where':{'id':_0x4118de[_0x5dfd('0x80')]}});}})[_0x5dfd('0x18')](function(_0x2bd84b){if(_0x2bd84b){if(_0x4be4c1){var _0x14eec1=null;for(var _0x45a598=0x1;_0x45a598<_0x4118de[_0x5dfd('0x81')][_0x5dfd('0x82')];++_0x45a598){_0x14eec1=_0x4118de['Messages'][_0x45a598];var _0xabe737=_0x14eec1[_0x5dfd('0x69')]?util[_0x5dfd('0x7c')]('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');var _0x57c664=_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x85')]||util[_0x5dfd('0x7c')]('%s%d',_0x5dfd('0x86'),_0x14eec1[_0x5dfd('0x80')]);switch(_0x1f57a0['agentIdentifier']){case _0x5dfd('0x87'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format'](_0x5dfd('0x88'),_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');break;case _0x5dfd('0x89'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1['User'][_0x5dfd('0x8a')]||_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;case _0x5dfd('0x8c'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;default:_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format']('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');}var _0x27e002=util[_0x5dfd('0x7c')](_0x5dfd('0x8d'),moment(_0x14eec1[_0x5dfd('0x8e')])[_0x5dfd('0x7c')](_0x5dfd('0x8f')),_0x14eec1[_0x5dfd('0x90')]==='in'?_0x57c664:_0xabe737,_0x14eec1[_0x5dfd('0x32')]);if(!_0x14eec1[_0x5dfd('0x91')]){fs[_0x5dfd('0x92')](_0x4be4c1,_0x27e002);}}return db['MailAccount'][_0x5dfd('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x5dfd('0x93')],'as':_0x5dfd('0x94'),'raw':!![],'include':[{'model':db[_0x5dfd('0x95')],'as':_0x5dfd('0x95'),'raw':!![]}]}]});}}})[_0x5dfd('0x18')](function(_0xea5e0){if(!_0xea5e0||!_0xea5e0[_0x5dfd('0x94')]||!_0x36c9fa[_0x5dfd('0x32')])return _0x4118de;var _0xb8a62b=_0xea5e0['getSmtpOptions']();return respondWithRpcPromise(_0x5dfd('0x96'),'sendMail',{'account':_0xb8a62b,'message':{'from':util[_0x5dfd('0x7c')](_0x5dfd('0x97'),_0xea5e0[_0x5dfd('0x2f')],_0xea5e0[_0x5dfd('0x56')]||_0xea5e0[_0x5dfd('0x94')][_0x5dfd('0x3e')]),'to':_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7a')],'subject':_0x5dfd('0x98'),'text':util[_0x5dfd('0x7c')](_0x5dfd('0x99'),_0x36c9fa['body'][_0x5dfd('0x7a')]),'attachments':[{'path':_0x4be4c1}]}})[_0x5dfd('0x18')](function(){return _0x4118de;})[_0x5dfd('0x22')](function(_0x421991){logger[_0x5dfd('0x1f')](_0x421991);});})[_0x5dfd('0x18')](respondWithStatusCode(_0x2bb094,0xc8))[_0x5dfd('0x22')](handleError(_0x2bb094,null));};exports[_0x5dfd('0x9a')]=function(_0x1d8b85,_0x2e4360){return db[_0x5dfd('0x62')][_0x5dfd('0x4d')]({'where':{'id':_0x1d8b85[_0x5dfd('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e4360,null))[_0x5dfd('0x18')](function(_0x2fc5f6){if(_0x2fc5f6){return _0x2fc5f6[_0x5dfd('0x9a')](_0x1d8b85[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x1d8b85[_0x5dfd('0x32')],[_0x5dfd('0x9b'),'id'])||{});}})[_0x5dfd('0x18')](respondWithResult(_0x2e4360,null))[_0x5dfd('0x22')](handleError(_0x2e4360,null));};exports['getMessages']=function(_0x16d6e8,_0x29b226){var _0x253810={'raw':![],'where':{}};var _0x9bc8a2={};var _0x4fe0a7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dfd('0x4f')]({'where':{'id':_0x16d6e8[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x29b226,null))[_0x5dfd('0x18')](function(_0x340282){if(_0x340282){_0x9bc8a2[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x9bc8a2['query']=_[_0x5dfd('0x42')](_0x16d6e8[_0x5dfd('0x3d')]);_0x9bc8a2['filters']=_[_0x5dfd('0x45')](_0x9bc8a2[_0x5dfd('0x41')],_0x9bc8a2[_0x5dfd('0x3d')]);_0x253810['attributes']=_['intersection'](_0x9bc8a2[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x16d6e8[_0x5dfd('0x3d')]['fields']));_0x253810['attributes']=_0x253810['attributes'][_0x5dfd('0x82')]?_0x253810['attributes']:_0x9bc8a2[_0x5dfd('0x41')];if(!_0x16d6e8['query'][_0x5dfd('0x9d')](_0x5dfd('0x9e'))){_0x253810[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x253810[_0x5dfd('0x27')]=qs[_0x5dfd('0x27')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x253810['order']=qs[_0x5dfd('0x9f')](_0x16d6e8[_0x5dfd('0x3d')]['sort']);_0x253810[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x16d6e8[_0x5dfd('0x3d')],_0x9bc8a2[_0x5dfd('0x44')]));_0x253810[_0x5dfd('0xa0')]['ChatInteractionId']=_0x340282['id'];if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x253810['where']=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],{'$or':_[_0x5dfd('0x36')](_0x253810[_0x5dfd('0x47')],function(_0x45e502){var _0xddded4={};_0xddded4[_0x45e502]={'$like':'%'+_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]+'%'};return _0xddded4;})});}if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')]){var _0x5be9a2=_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')][_0x5dfd('0xa4')](',');var _0x4777f8={};_0x4777f8[_0x5be9a2[0x0]]={'$gte':moment(_0x5be9a2[0x1])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))};_0x253810[_0x5dfd('0xa0')]=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],_0x4777f8);}_0x253810=_[_0x5dfd('0x31')]({},_0x253810,_0x16d6e8[_0x5dfd('0x4a')]);return db['ChatMessage']['count']({'where':_0x253810['where']})[_0x5dfd('0x18')](function(_0x55051b){_0x4fe0a7[_0x5dfd('0x2a')]=_0x55051b;if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x253810['include']=[{'all':!![]}];}return db[_0x5dfd('0x62')][_0x5dfd('0x3b')](_0x253810);})[_0x5dfd('0x18')](function(_0x4c2e7b){_0x4fe0a7['rows']=_0x4c2e7b;return _0x4fe0a7;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x29b226,_0x253810))['catch'](handleError(_0x29b226,null));};exports[_0x5dfd('0xa6')]=function(_0x460008,_0x28bd3b){var _0x204d36={'where':{}},_0x551579={},_0x13b2a1={'count':0x0,'rows':[]};return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x460008[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x28bd3b,null))[_0x5dfd('0x18')](function(_0x21c7f1){if(_0x21c7f1){_0x551579[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x551579[_0x5dfd('0x3d')]=_[_0x5dfd('0x42')](_0x460008[_0x5dfd('0x3d')]);_0x551579[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],_0x551579[_0x5dfd('0x3d')]);_0x204d36[_0x5dfd('0x47')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],qs['fields'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x204d36[_0x5dfd('0x47')]=_0x204d36[_0x5dfd('0x47')][_0x5dfd('0x82')]?_0x204d36[_0x5dfd('0x47')]:_0x551579['model'];if(!_0x460008[_0x5dfd('0x3d')]['hasOwnProperty']('nolimit')){_0x204d36[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x204d36[_0x5dfd('0x27')]=qs['offset'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x204d36[_0x5dfd('0xa7')]=qs[_0x5dfd('0x9f')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x9f')]);_0x204d36[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x460008[_0x5dfd('0x3d')],_0x551579[_0x5dfd('0x44')]));_0x204d36['where'][_0x5dfd('0xa8')]=_0x21c7f1['id'];if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x204d36['where']=_[_0x5dfd('0x31')](_0x204d36[_0x5dfd('0xa0')],{'$or':_['map'](_0x204d36[_0x5dfd('0x47')],function(_0x14b098){var _0xe07a6f={};_0xe07a6f[_0x14b098]={'$like':'%'+_0x460008[_0x5dfd('0x3d')]['filter']+'%'};return _0xe07a6f;})});}_0x204d36['where'][_0x5dfd('0x91')]=![];if(_0x460008[_0x5dfd('0x3d')]['id']){_0x204d36[_0x5dfd('0xa0')]['id']={'$gt':_0x460008[_0x5dfd('0x3d')]['id']};}_0x204d36=_['merge']({},_0x204d36,_0x460008[_0x5dfd('0x4a')]);return db[_0x5dfd('0x62')][_0x5dfd('0x2a')]({'where':_0x204d36[_0x5dfd('0xa0')]})[_0x5dfd('0x18')](function(_0x1b6518){_0x13b2a1['count']=_0x1b6518;_0x204d36[_0x5dfd('0x49')]=[];if(_0x460008['query'][_0x5dfd('0xa9')]){_0x204d36['include'][_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id',_0x5dfd('0x55'),_0x5dfd('0x8a')]});}if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x204d36[_0x5dfd('0x49')]=[{'all':!![]}];}return db[_0x5dfd('0x62')]['findAll'](_0x204d36);})[_0x5dfd('0x18')](function(_0x507f08){_0x13b2a1[_0x5dfd('0xab')]=_0x507f08;return _0x13b2a1;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x28bd3b,_0x204d36))['catch'](handleError(_0x28bd3b,null));};exports['addTags']=function(_0x4a180b,_0x4ceb2e){return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4a180b[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x4ceb2e,null))[_0x5dfd('0x18')](function(_0x3f23fd){if(_0x3f23fd){return _0x3f23fd[_0x5dfd('0xac')](_0x4a180b[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x4a180b['body'],[_0x5dfd('0x9b'),'id'])||{})[_0x5dfd('0xad')](function(){return db[_0x5dfd('0xae')]['findAll']({'attributes':['id',_0x5dfd('0x2f'),_0x5dfd('0xaf')],'where':{'id':_0x4a180b['body'][_0x5dfd('0x9b')]}});})[_0x5dfd('0x18')](function(_0x5c600c){socket[_0x5dfd('0xb0')](_0x5dfd('0xb1'),{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]});return{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]};});}})[_0x5dfd('0x18')](respondWithResult(_0x4ceb2e,null))[_0x5dfd('0x22')](handleError(_0x4ceb2e,null));};exports[_0x5dfd('0xb2')]=function(_0xc7a87d,_0x2398e4){return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0xc7a87d[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x2398e4,null))['then'](function(_0x11a262){if(_0x11a262){return _0x11a262['removeTags'](_0xc7a87d[_0x5dfd('0x3d')][_0x5dfd('0x9b')]);}})[_0x5dfd('0x18')](respondWithStatusCode(_0x2398e4,null))['catch'](handleError(_0x2398e4,null));};exports[_0x5dfd('0xb3')]=function(_0x26ea70,_0x5984c5){var _0x4481f5=moment()['unix']()[_0x5dfd('0xb4')]();var _0x179265=path[_0x5dfd('0x77')](config['root'],'server',_0x5dfd('0xb5'),_0x5dfd('0xb6'));var _0x493023=path['join'](config['root'],'server','files','attachments');var _0x32ea28=path[_0x5dfd('0x77')](_0x179265,_0x4481f5);var _0x303f79=util[_0x5dfd('0x7c')](_0x5dfd('0xb7'),_0x26ea70[_0x5dfd('0x40')]['id'],_0x4481f5);var _0xaec36b=path['join'](_0x179265,_0x303f79);var _0x447e42=[];_0x447e42[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id','fullname'],'raw':!![]});_0x447e42['push']({'model':db['CmContact'],'as':_0x5dfd('0x66'),'attributes':['id','firstName',_0x5dfd('0xb8')],'raw':!![]});if(_0x26ea70[_0x5dfd('0x3d')][_0x5dfd('0xb9')]){_0x447e42['push']({'model':db['Attachment'],'as':_0x5dfd('0x74'),'raw':!![]});}var _0xf8fa16=[{'model':db[_0x5dfd('0x62')],'as':'Messages','attributes':['id',_0x5dfd('0x32'),_0x5dfd('0x8e'),'direction',_0x5dfd('0x91'),_0x5dfd('0xba')],'include':_0x447e42}];_0xf8fa16[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x50')],'as':_0x5dfd('0xbb'),'attributes':['id',_0x5dfd('0x2f')]});_0xf8fa16['push']({'model':db[_0x5dfd('0x8b')],'as':'Owner','attributes':['id',_0x5dfd('0x55')]});return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x26ea70[_0x5dfd('0x40')]['id']},'include':_0xf8fa16})[_0x5dfd('0x18')](handleEntityNotFound(_0x5984c5,null))['then'](function(_0x2f3704){if(_0x2f3704){var _0x2af6d0=_0x2f3704['get']({'plain':!![]});fs[_0x5dfd('0xbc')](_0x32ea28);var _0x31b0d7={'channel':_0x5dfd('0xbd'),'account':_0x2af6d0[_0x5dfd('0xbb')]['name'],'agent':_0x2af6d0['Owner']?_0x2af6d0['Owner']['fullname']:'N.A.','createdAt':moment(_0x2af6d0['createdAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')](),'closedAt':_0x2af6d0[_0x5dfd('0x6b')]?moment(_0x2af6d0['closedAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')]():'','disposition':_0x2af6d0['disposition'],'chatInfo':{'browser':_0x2af6d0[_0x5dfd('0xbe')],'os':_0x2af6d0[_0x5dfd('0xbf')],'referer':_0x2af6d0[_0x5dfd('0xc0')],'customerIp':_0x2af6d0['customerIp'],'customerPort':_0x2af6d0[_0x5dfd('0xc1')]?_0x2af6d0[_0x5dfd('0xc1')]:_0x5dfd('0xc2')},'messages':_(_0x2af6d0[_0x5dfd('0x81')])[_0x5dfd('0xc3')]()[_0x5dfd('0xa2')]({'secret':![]})['map'](function(_0xacb12a){if(_0xacb12a['Attachment']){var _0x7df070=path[_0x5dfd('0x77')](_0x493023,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]);if(fs[_0x5dfd('0xc4')](_0x7df070)){fs['createReadStream'](_0x7df070)['pipe'](fs[_0x5dfd('0xc5')](path[_0x5dfd('0x77')](_0x32ea28,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')])));}}return{'date':moment(_0xacb12a[_0x5dfd('0x8e')])[_0x5dfd('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0xacb12a[_0x5dfd('0x90')]===_0x5dfd('0x61')?_0xacb12a[_0x5dfd('0x8b')]?_0xacb12a[_0x5dfd('0x8b')]['fullname']:'System':_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xc6')]+(_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xb8')]?'\x20'+_0xacb12a[_0x5dfd('0x66')]['lastName']:''),'body':_0xacb12a['Attachment']?_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]:_0xacb12a[_0x5dfd('0x32')],'direction':_0xacb12a['direction']===_0x5dfd('0x61')?'A':'C','secret':_0xacb12a[_0x5dfd('0x91')],'read':_0xacb12a[_0x5dfd('0xba')],'attachment':_0xacb12a[_0x5dfd('0x74')]};})[_0x5dfd('0xc7')]()};return ejs['renderFile'](path[_0x5dfd('0x77')](config['root'],_0x5dfd('0xc8'),_0x5dfd('0xc9'),'downloadInteraction.ejs'),{'interaction':_0x31b0d7})[_0x5dfd('0x18')](function(_0x134519){var _0x44e4b0=path[_0x5dfd('0x77')](_0x32ea28,_0x5dfd('0xca')+_0x2af6d0['id']+'-'+_0x4481f5+_0x5dfd('0xcb'));var _0x539313={'path':_0x44e4b0,'channel':_0x5dfd('0xbd'),'interactionId':_0x2af6d0['id']};return pdf[_0x5dfd('0xcc')](_0x134519,_0x539313);})[_0x5dfd('0x18')](function(){return new Promise(function(_0x2a8266,_0x5a7422){zipdir(_0x32ea28,{'saveTo':_0xaec36b},function(_0x507fa2,_0x4ce325){if(_0x507fa2)return _0x5a7422(_0x507fa2);return _0x2a8266(_0x4ce325);});})[_0x5dfd('0x18')](function(){return new BPromise(function(_0xda5f61,_0xb60d91){rimraf(_0x32ea28,function(_0x2960bc){if(_0x2960bc)_0xb60d91(_0x2960bc);return _0xda5f61();});});})[_0x5dfd('0x18')](function(){return _0x5984c5[_0x5dfd('0xb3')](_0xaec36b,_0x303f79,function(_0x381941){if(_0x381941){logger[_0x5dfd('0x1f')]('err',_0x381941);}else{fs[_0x5dfd('0xcd')](_0xaec36b);}});});});}else{return _0x5984c5[_0x5dfd('0x23')](0xc8);}})['catch'](handleError(_0x5984c5,null));}; \ No newline at end of file +var _0xa641=['unlinkSync','zip-dir','request-promise','util','path','ejs','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','destroy','name','send','render','merge','body','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','params','model','keys','filters','intersection','attributes','fields','include','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','mailTranscript','format','transcript-%s.txt','now','User','ChatWebsite','ContactId','Messages','length','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','getMyMessages','push','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','direction','read','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','existsSync','pipe','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa641,0x199));var _0x1a64=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa641[_0x4e676e];return _0x336a3c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x1a64('0x0'));var rp=require(_0x1a64('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a64('0x2'));var path=require(_0x1a64('0x3'));var ejs=require(_0x1a64('0x4'));var fs=require('fs');var _=require(_0x1a64('0x5'));var Redis=require(_0x1a64('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x1a64('0x7'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x1a64('0x8'));var config=require(_0x1a64('0x9'));var db=require(_0x1a64('0xa'))['db'];config['redis']=_[_0x1a64('0xb')](config[_0x1a64('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a64('0xd'))(new Redis(config[_0x1a64('0xc')]));require(_0x1a64('0xe'))['register'](socket);var jayson=require(_0x1a64('0xf'));var client=jayson[_0x1a64('0x10')][_0x1a64('0x11')]({'port':0x232b});var client9004=jayson['client'][_0x1a64('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x15a5d3,_0x37b612,_0x5ba2e9,_0x195186){return new BPromise(function(_0x5b385e,_0x231d68){var _0x51a48c=_0x195186||client;return _0x51a48c[_0x1a64('0x12')](_0x15a5d3,_0x5ba2e9)[_0x1a64('0x13')](function(_0x950204){logger[_0x1a64('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x37b612,'request\x20sent');logger[_0x1a64('0x15')](_0x1a64('0x16'),_0x37b612,_0x1a64('0x17'),JSON['stringify'](_0x950204));if(_0x950204['error']){if(_0x950204[_0x1a64('0x18')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x37b612,_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);return _0x231d68(_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);}logger[_0x1a64('0x18')](_0x1a64('0x1a'),_0x37b612,_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);return _0x5b385e(_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);}else{logger[_0x1a64('0x14')](_0x1a64('0x1a'),_0x37b612,_0x1a64('0x17'));_0x5b385e(_0x950204[_0x1a64('0x1b')][_0x1a64('0x19')]);}})[_0x1a64('0x1c')](function(_0x5ea058){logger[_0x1a64('0x18')](_0x1a64('0x1a'),_0x37b612,_0x5ea058);_0x231d68(_0x5ea058);});});}function respondWithStatusCode(_0x1f6fb5,_0x516c69){_0x516c69=_0x516c69||0xcc;return function(_0xc71066){if(_0xc71066){return _0x1f6fb5[_0x1a64('0x1d')](_0x516c69);}return _0x1f6fb5['status'](_0x516c69)[_0x1a64('0x1e')]();};}function respondWithResult(_0x3c74ec,_0x5630ce){_0x5630ce=_0x5630ce||0xc8;return function(_0x286743){if(_0x286743){return _0x3c74ec[_0x1a64('0x1f')](_0x5630ce)['json'](_0x286743);}};}function respondWithFilteredResult(_0xf3ad73,_0x4e3f92){return function(_0x523d6e){if(_0x523d6e){var _0x57168c=typeof _0x4e3f92['offset']==='undefined'&&typeof _0x4e3f92[_0x1a64('0x20')]===_0x1a64('0x21');var _0x21084f=_0x523d6e[_0x1a64('0x22')];var _0x17fbc0=_0x57168c?0x0:_0x4e3f92['offset'];var _0x5916bc=_0x57168c?_0x523d6e[_0x1a64('0x22')]:_0x4e3f92[_0x1a64('0x23')]+_0x4e3f92[_0x1a64('0x20')];var _0x2e3da4;if(_0x5916bc>=_0x21084f){_0x5916bc=_0x21084f;_0x2e3da4=0xc8;}else{_0x2e3da4=0xce;}_0xf3ad73[_0x1a64('0x1f')](_0x2e3da4);return _0xf3ad73[_0x1a64('0x24')](_0x1a64('0x25'),_0x17fbc0+'-'+_0x5916bc+'/'+_0x21084f)['json'](_0x523d6e);}return null;};}function saveUpdates(_0x3c2b26){return function(_0x1004ad){if(_0x1004ad){return _0x1004ad['update'](_0x3c2b26)['then'](function(_0x212d33){return _0x212d33;});}return null;};}function removeEntity(_0x264138){return function(_0xfe058d){if(_0xfe058d){return _0xfe058d[_0x1a64('0x26')]()['then'](function(){_0x264138[_0x1a64('0x1f')](0xcc)[_0x1a64('0x1e')]();});}};}function handleEntityNotFound(_0x3c12f6){return function(_0x4563a1){if(!_0x4563a1){_0x3c12f6[_0x1a64('0x1d')](0x194);}return _0x4563a1;};}function handleError(_0x3a42fc,_0x53ff3e){_0x53ff3e=_0x53ff3e||0x1f4;return function(_0x2fd0c8){logger[_0x1a64('0x18')](_0x2fd0c8['stack']);if(_0x2fd0c8[_0x1a64('0x27')]){delete _0x2fd0c8[_0x1a64('0x27')];}_0x3a42fc[_0x1a64('0x1f')](_0x53ff3e)[_0x1a64('0x28')](_0x2fd0c8);};}function getMustacheRender(_0x235c58,_0x4a6b9f){return Mustache[_0x1a64('0x29')](_0x235c58,_[_0x1a64('0x2a')](_0x4a6b9f[_0x1a64('0x2b')],{'contact':_0x4a6b9f['contact'],'message':_0x4a6b9f[_0x1a64('0x19')],'agent':_0x4a6b9f['agent'],'interaction':_0x4a6b9f[_0x1a64('0x2c')],'account':_0x4a6b9f[_0x1a64('0x2d')]}))||'';}exports[_0x1a64('0x2e')]=function(_0x18d31a,_0x59aaf2){var _0x4a9ca5={};var _0x82ab76=_[_0x1a64('0x2f')](db[_0x1a64('0x30')][_0x1a64('0x31')],function(_0x5c953c){return{'name':_0x5c953c[_0x1a64('0x32')],'type':_0x5c953c[_0x1a64('0x33')][_0x1a64('0x34')]};});_0x4a9ca5=qs[_0x1a64('0x35')](_0x82ab76,_0x18d31a);return interaction[_0x1a64('0x36')](_0x1a64('0x37'),_0x18d31a[_0x1a64('0x38')],_0x18d31a[_0x1a64('0x39')],_0x4a9ca5,_0x82ab76)[_0x1a64('0x13')](respondWithFilteredResult(_0x59aaf2,_0x4a9ca5))['catch'](handleError(_0x59aaf2,null));};exports['show']=function(_0x3d3b4c,_0x2b1a1e){var _0x437a36={'raw':![],'where':{'id':_0x3d3b4c[_0x1a64('0x3a')]['id']}},_0x183501={};_0x183501[_0x1a64('0x3b')]=_[_0x1a64('0x3c')](db[_0x1a64('0x30')][_0x1a64('0x31')]);_0x183501[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x3d3b4c[_0x1a64('0x38')]);_0x183501[_0x1a64('0x3d')]=_[_0x1a64('0x3e')](_0x183501[_0x1a64('0x3b')],_0x183501[_0x1a64('0x38')]);_0x437a36[_0x1a64('0x3f')]=_[_0x1a64('0x3e')](_0x183501['model'],qs[_0x1a64('0x40')](_0x3d3b4c[_0x1a64('0x38')]['fields']));_0x437a36[_0x1a64('0x3f')]=_0x437a36[_0x1a64('0x3f')]['length']?_0x437a36[_0x1a64('0x3f')]:_0x183501[_0x1a64('0x3b')];if(_0x3d3b4c[_0x1a64('0x38')]['includeAll']){_0x437a36[_0x1a64('0x41')]=[{'all':!![]}];}_0x437a36=_[_0x1a64('0x2a')]({},_0x437a36,_0x3d3b4c['options']);return db['ChatInteraction'][_0x1a64('0x42')](_0x437a36)[_0x1a64('0x13')](handleEntityNotFound(_0x2b1a1e,null))[_0x1a64('0x13')](respondWithResult(_0x2b1a1e,null))[_0x1a64('0x1c')](handleError(_0x2b1a1e,null));};exports['create']=function(_0x54777b,_0x48a095){return db['ChatInteraction'][_0x1a64('0x43')](_0x54777b['body'],{})['then'](respondWithResult(_0x48a095,0xc9))[_0x1a64('0x1c')](handleError(_0x48a095,null));};exports['update']=function(_0x558e63,_0x176d5c){if(_0x558e63[_0x1a64('0x2b')]['id']){delete _0x558e63[_0x1a64('0x2b')]['id'];}return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x558e63[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x176d5c,null))['then'](saveUpdates(_0x558e63[_0x1a64('0x2b')],null))[_0x1a64('0x13')](respondWithResult(_0x176d5c,null))[_0x1a64('0x1c')](handleError(_0x176d5c,null));};exports['destroy']=function(_0x4441b5,_0x3a24ea){return db[_0x1a64('0x30')]['find']({'where':{'id':_0x4441b5['params']['id']}})['then'](handleEntityNotFound(_0x3a24ea,null))[_0x1a64('0x13')](removeEntity(_0x3a24ea,null))[_0x1a64('0x1c')](handleError(_0x3a24ea,null));};exports[_0x1a64('0x44')]=function(_0x54ffee,_0x303447){return db[_0x1a64('0x30')][_0x1a64('0x44')]()[_0x1a64('0x13')](respondWithResult(_0x303447,null))[_0x1a64('0x1c')](handleError(_0x303447,null));};exports[_0x1a64('0x45')]=function(_0x29c915,_0x3c62ef){var _0x2279bd=_0x29c915['params']['id'];var _0x3e0a5c;var _0x19b7a9;var _0x530d47;return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x2279bd}})[_0x1a64('0x13')](function(_0x2a7931){_0x3e0a5c=_0x2a7931;return db['ChatWebsite']['findOne']({'where':{'id':_0x2a7931[_0x1a64('0x47')]},'attributes':['id',_0x1a64('0x48'),_0x1a64('0x49'),_0x1a64('0x4a'),_0x1a64('0x4b'),_0x1a64('0x4c')],'raw':!![]});})[_0x1a64('0x13')](function(_0x4b94a0){if(_0x4b94a0&&_0x4b94a0['vidaooApiKey']&&_0x4b94a0['vidaooEscalation']){_0x19b7a9=_0x4b94a0;var _0x17fa55={'interaction':{'id':_0x2279bd},'agent':{'id':_0x29c915[_0x1a64('0x39')]['id'],'name':_0x29c915['user'][_0x1a64('0x27')],'fullname':_0x29c915[_0x1a64('0x39')][_0x1a64('0x4d')],'email':_0x29c915['user'][_0x1a64('0x4e')]},'contact':_0x29c915[_0x1a64('0x2b')][_0x1a64('0x4f')],'account':_0x29c915['body'][_0x1a64('0x2d')]};var _0x54f570={'rejectUnauthorized':![],'method':_0x1a64('0x50'),'url':_0x1a64('0x51'),'headers':{'X-APIKEY':_0x4b94a0[_0x1a64('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x29c915[_0x1a64('0x39')][_0x1a64('0x4e')]],'buttons':null,'topic':_0x19b7a9[_0x1a64('0x4a')],'note':_[_0x1a64('0x52')](_0x19b7a9[_0x1a64('0x4b')])?null:getMustacheRender(_0x19b7a9['vidaooNote'],_0x17fa55),'metadata':null},'redirect':_0x1a64('0x53'),'json':!![]};try{if(!_[_0x1a64('0x52')](_0x19b7a9[_0x1a64('0x4c')])){var _0x1aa14e=getMustacheRender(_0x19b7a9[_0x1a64('0x4c')],_0x17fa55);var _0x565e78=JSON[_0x1a64('0x54')](_0x1aa14e);_0x54f570[_0x1a64('0x2b')][_0x1a64('0x55')]=_0x565e78;}}catch(_0x319363){throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x54f570);}else{throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x1a64('0x13')](function(_0x581434){_0x530d47=_0x581434;if(_0x530d47['id']){var _0x665aae={'body':_0x530d47[_0x1a64('0x58')],'ChatWebsiteId':_0x19b7a9['id'],'ChatInteractionId':_0x3e0a5c['id'],'direction':'out','UserId':_0x29c915[_0x1a64('0x39')]['id']};return db[_0x1a64('0x59')][_0x1a64('0x43')](_0x665aae,{});}else{throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1a64('0x13')](function(){return _0x3e0a5c[_0x1a64('0x5a')]({'vidaooSessionId':_0x530d47['id']});})[_0x1a64('0x13')](respondWithResult(_0x3c62ef,null))[_0x1a64('0x1c')](handleError(_0x3c62ef,null));};exports[_0x1a64('0x5b')]=function(_0x5dd1f4,_0x24b291){if(_0x5dd1f4[_0x1a64('0x2b')]['id']){delete _0x5dd1f4[_0x1a64('0x2b')]['id'];}return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x5dd1f4[_0x1a64('0x3a')]['id']},'include':[{'model':db[_0x1a64('0x5c')],'as':_0x1a64('0x5d')}]})['then'](handleEntityNotFound(_0x24b291,null))[_0x1a64('0x13')](saveUpdates(_0x5dd1f4[_0x1a64('0x2b')],null))[_0x1a64('0x13')](respondWithResult(_0x24b291,null))[_0x1a64('0x1c')](handleError(_0x24b291,null));};exports[_0x1a64('0x5e')]=function(_0x3ecf23,_0x108da6){if(_0x3ecf23[_0x1a64('0x2b')]['id']){delete _0x3ecf23['body']['id'];}return db['ChatInteraction'][_0x1a64('0x42')]({'where':{'id':_0x3ecf23[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](function(_0x1be29f){if(!_0x1be29f){logger[_0x1a64('0x18')](_0x1a64('0x5f'),_0x1a64('0x5e'),0x194,_0x1a64('0x60'));_0x108da6[_0x1a64('0x1d')](0x194);}else{if(_0x1be29f[_0x1a64('0x61')]){throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))](_0x1a64('0x62'));}}return _0x1be29f;})['then'](function(_0x5e0627){if(_0x5e0627){return _0x5e0627['update']({'closed':_0x3ecf23[_0x1a64('0x2b')][_0x1a64('0x63')],'disposition':_0x3ecf23['body']['disposition']})['then'](function(_0x191c21){return _0x191c21;});}})[_0x1a64('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x1a64('0x5e'),_0x3ecf23['body'],client9004);})[_0x1a64('0x13')](respondWithResult(_0x108da6,null))[_0x1a64('0x1c')](handleError(_0x108da6,null));};exports[_0x1a64('0x64')]=function(_0x46c07b,_0x2c63bf){_0x46c07b[_0x1a64('0x2b')][_0x1a64('0x27')]=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x66')];_0x46c07b['body'][_0x1a64('0x67')]=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x68')];_0x46c07b[_0x1a64('0x2b')]['type']=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x69')];return db[_0x1a64('0x6a')][_0x1a64('0x43')](_0x46c07b['body'])[_0x1a64('0x13')](respondWithResult(_0x2c63bf,0xc9))[_0x1a64('0x1c')](handleError(_0x2c63bf,null));};exports[_0x1a64('0x6b')]=function(_0x4e1d73,_0x2f3338){return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x4e1d73['params']['id']},'raw':!![]})[_0x1a64('0x13')](handleEntityNotFound(_0x2f3338,null))['then'](function(_0xba9f42){if(_0xba9f42){if(_0xba9f42[_0x1a64('0x63')]){return _0x2f3338[_0x1a64('0x1f')](0x193)[_0x1a64('0x6c')]({'status':0x193,'message':_0x1a64('0x6d')});}return db['Attachment'][_0x1a64('0x46')]({'where':{'id':_0x4e1d73['query'][_0x1a64('0x6e')]},'raw':!![]})[_0x1a64('0x13')](handleEntityNotFound(_0x2f3338,null));}})['then'](function(_0x1a7539){if(_0x1a7539){var _0x4d895b=_0x1a7539['ChatOfflineMessageId']!==null;var _0x6c8f4d=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],_0x1a64('0x71'));if(_0x4d895b){_0x6c8f4d=path['join'](_0x6c8f4d,_0x1a64('0x72'));}var _0x4edd79=path['join'](_0x6c8f4d,_0x1a7539[_0x1a64('0x67')]);return _0x2f3338['download'](_0x4edd79);}})['catch'](handleError(_0x2f3338,null));};exports['close']=function(_0x14ce35,_0x466e70){var _0x499857=null;var _0x2ed772=null;var _0x359d57=null;if(_0x14ce35['body']['id']){delete _0x14ce35[_0x1a64('0x2b')]['id'];}if(_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x73')]){_0x359d57=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],'server/files/chat/upload/',util[_0x1a64('0x74')](_0x1a64('0x75'),Date[_0x1a64('0x76')]()));_0x14ce35[_0x1a64('0x2b')]['pathTranscript']=_0x359d57;}return db['ChatInteraction'][_0x1a64('0x42')]({'where':{'id':_0x14ce35['params']['id']},'include':[{'model':db[_0x1a64('0x59')],'as':'Messages','include':[{'model':db[_0x1a64('0x77')],'as':_0x1a64('0x77')}]}]})[_0x1a64('0x13')](handleEntityNotFound(_0x466e70,null))[_0x1a64('0x13')](saveUpdates(_0x14ce35[_0x1a64('0x2b')],null))[_0x1a64('0x13')](function(_0xda163e){if(_0xda163e){_0x499857=_0xda163e;return db[_0x1a64('0x78')]['find']({'where':{'id':_0x499857[_0x1a64('0x47')]}});}})[_0x1a64('0x13')](function(_0xa24c0a){if(_0xa24c0a){_0x2ed772=_0xa24c0a;return db[_0x1a64('0x5c')]['find']({'where':{'id':_0x499857[_0x1a64('0x79')]}});}})[_0x1a64('0x13')](function(_0x2176c7){if(_0x2176c7){if(_0x359d57){var _0x3cfb92=null;for(var _0x3308e1=0x1;_0x3308e1<_0x499857[_0x1a64('0x7a')][_0x1a64('0x7b')];++_0x3308e1){_0x3cfb92=_0x499857['Messages'][_0x3308e1];var _0x2fea2e=_0x3cfb92['UserId']?util[_0x1a64('0x74')](_0x1a64('0x7c'),_0x2ed772[_0x1a64('0x7d')],_0x3cfb92[_0x1a64('0x61')]):'System';var _0x557867=_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x7e')]||util['format'](_0x1a64('0x7c'),_0x1a64('0x7f'),_0x3cfb92[_0x1a64('0x79')]);switch(_0x2ed772[_0x1a64('0x80')]){case _0x1a64('0x81'):_0x2fea2e=_0x3cfb92['UserId']?util['format'](_0x1a64('0x7c'),_0x2ed772['agentAlias'],_0x3cfb92['UserId']):_0x1a64('0x82');break;case'agent_alias':_0x2fea2e=_0x3cfb92['UserId']?_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x83')]||_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82');break;case'agent_fullname':_0x2fea2e=_0x3cfb92[_0x1a64('0x61')]?_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82');break;default:_0x2fea2e=_0x3cfb92['UserId']?util[_0x1a64('0x74')](_0x1a64('0x7c'),_0x2ed772[_0x1a64('0x7d')],_0x3cfb92[_0x1a64('0x61')]):_0x1a64('0x82');}var _0xd884a1=util[_0x1a64('0x74')](_0x1a64('0x84'),moment(_0x3cfb92[_0x1a64('0x85')])[_0x1a64('0x74')](_0x1a64('0x86')),_0x3cfb92['direction']==='in'?_0x557867:_0x2fea2e,_0x3cfb92['body']);if(!_0x3cfb92[_0x1a64('0x87')]){fs[_0x1a64('0x88')](_0x359d57,_0xd884a1);}}return db[_0x1a64('0x89')][_0x1a64('0x46')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1a64('0x8a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x1a64('0x13')](function(_0x4aa540){if(!_0x4aa540||!_0x4aa540[_0x1a64('0x8a')]||!_0x14ce35[_0x1a64('0x2b')])return _0x499857;var _0xad1595=_0x4aa540[_0x1a64('0x8b')]();return respondWithRpcPromise('SendMail',_0x1a64('0x8c'),{'account':_0xad1595,'message':{'from':util[_0x1a64('0x74')](_0x1a64('0x8d'),_0x4aa540[_0x1a64('0x27')],_0x4aa540[_0x1a64('0x4e')]||_0x4aa540[_0x1a64('0x8a')][_0x1a64('0x39')]),'to':_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x73')],'subject':_0x1a64('0x8e'),'text':util[_0x1a64('0x74')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x14ce35['body'][_0x1a64('0x73')]),'attachments':[{'path':_0x359d57}]}})[_0x1a64('0x13')](function(){return _0x499857;})[_0x1a64('0x1c')](function(_0x37a943){logger['error'](_0x37a943);});})['then'](respondWithStatusCode(_0x466e70,0xc8))[_0x1a64('0x1c')](handleError(_0x466e70,null));};exports[_0x1a64('0x8f')]=function(_0x171499,_0x8e9541){return db['ChatMessage'][_0x1a64('0x42')]({'where':{'id':_0x171499[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x8e9541,null))[_0x1a64('0x13')](function(_0x286b91){if(_0x286b91){return _0x286b91[_0x1a64('0x8f')](_0x171499['body'][_0x1a64('0x90')],_[_0x1a64('0x91')](_0x171499['body'],[_0x1a64('0x90'),'id'])||{});}})[_0x1a64('0x13')](respondWithResult(_0x8e9541,null))[_0x1a64('0x1c')](handleError(_0x8e9541,null));};exports[_0x1a64('0x92')]=function(_0x3ba777,_0x467fb1){var _0xd8bead={'raw':![],'where':{}};var _0x1e5f01={};var _0x590db6={'count':0x0,'rows':[]};return db[_0x1a64('0x30')]['findOne']({'where':{'id':_0x3ba777[_0x1a64('0x3a')]['id']}})['then'](handleEntityNotFound(_0x467fb1,null))[_0x1a64('0x13')](function(_0x47a817){if(_0x47a817){_0x1e5f01['model']=_[_0x1a64('0x3c')](db[_0x1a64('0x59')][_0x1a64('0x31')]);_0x1e5f01[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x3ba777[_0x1a64('0x38')]);_0x1e5f01[_0x1a64('0x3d')]=_['intersection'](_0x1e5f01['model'],_0x1e5f01[_0x1a64('0x38')]);_0xd8bead[_0x1a64('0x3f')]=_[_0x1a64('0x3e')](_0x1e5f01[_0x1a64('0x3b')],qs[_0x1a64('0x40')](_0x3ba777[_0x1a64('0x38')]['fields']));_0xd8bead['attributes']=_0xd8bead[_0x1a64('0x3f')][_0x1a64('0x7b')]?_0xd8bead['attributes']:_0x1e5f01['model'];if(!_0x3ba777[_0x1a64('0x38')][_0x1a64('0x93')](_0x1a64('0x94'))){_0xd8bead[_0x1a64('0x20')]=qs[_0x1a64('0x20')](_0x3ba777['query'][_0x1a64('0x20')]);_0xd8bead['offset']=qs[_0x1a64('0x23')](_0x3ba777['query'][_0x1a64('0x23')]);}_0xd8bead[_0x1a64('0x95')]=qs[_0x1a64('0x96')](_0x3ba777['query'][_0x1a64('0x96')]);_0xd8bead['where']=qs['filters'](_[_0x1a64('0x97')](_0x3ba777[_0x1a64('0x38')],_0x1e5f01[_0x1a64('0x3d')]));_0xd8bead['where'][_0x1a64('0x98')]=_0x47a817['id'];if(_0x3ba777[_0x1a64('0x38')]['filter']){_0xd8bead[_0x1a64('0x99')]=_[_0x1a64('0x2a')](_0xd8bead[_0x1a64('0x99')],{'$or':_[_0x1a64('0x2f')](_0xd8bead[_0x1a64('0x3f')],function(_0x513e72){var _0x577af4={};_0x577af4[_0x513e72]={'$like':'%'+_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9a')]+'%'};return _0x577af4;})});}if(_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9b')]){var _0x294799=_0x3ba777[_0x1a64('0x38')]['$gte'][_0x1a64('0x9c')](',');var _0x404058={};_0x404058[_0x294799[0x0]]={'$gte':moment(_0x294799[0x1])[_0x1a64('0x74')](_0x1a64('0x9d'))};_0xd8bead[_0x1a64('0x99')]=_['merge'](_0xd8bead[_0x1a64('0x99')],_0x404058);}_0xd8bead=_['merge']({},_0xd8bead,_0x3ba777[_0x1a64('0x9e')]);return db['ChatMessage']['count']({'where':_0xd8bead[_0x1a64('0x99')]})[_0x1a64('0x13')](function(_0x4724b7){_0x590db6['count']=_0x4724b7;if(_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9f')]){_0xd8bead[_0x1a64('0x41')]=[{'all':!![]}];}return db[_0x1a64('0x59')][_0x1a64('0x36')](_0xd8bead);})[_0x1a64('0x13')](function(_0x31f7f1){_0x590db6[_0x1a64('0xa0')]=_0x31f7f1;return _0x590db6;});}})[_0x1a64('0x13')](respondWithFilteredResult(_0x467fb1,_0xd8bead))[_0x1a64('0x1c')](handleError(_0x467fb1,null));};exports[_0x1a64('0xa1')]=function(_0x17f008,_0x5cf9fe){var _0x4266d4={'where':{}},_0x8cdf89={},_0x4c44ba={'count':0x0,'rows':[]};return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x17f008['params']['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x5cf9fe,null))['then'](function(_0x2a7d11){if(_0x2a7d11){_0x8cdf89[_0x1a64('0x3b')]=_[_0x1a64('0x3c')](db[_0x1a64('0x59')][_0x1a64('0x31')]);_0x8cdf89[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x17f008['query']);_0x8cdf89[_0x1a64('0x3d')]=_[_0x1a64('0x3e')](_0x8cdf89['model'],_0x8cdf89[_0x1a64('0x38')]);_0x4266d4['attributes']=_[_0x1a64('0x3e')](_0x8cdf89[_0x1a64('0x3b')],qs[_0x1a64('0x40')](_0x17f008[_0x1a64('0x38')][_0x1a64('0x40')]));_0x4266d4[_0x1a64('0x3f')]=_0x4266d4[_0x1a64('0x3f')][_0x1a64('0x7b')]?_0x4266d4['attributes']:_0x8cdf89[_0x1a64('0x3b')];if(!_0x17f008[_0x1a64('0x38')][_0x1a64('0x93')](_0x1a64('0x94'))){_0x4266d4[_0x1a64('0x20')]=qs[_0x1a64('0x20')](_0x17f008[_0x1a64('0x38')][_0x1a64('0x20')]);_0x4266d4[_0x1a64('0x23')]=qs[_0x1a64('0x23')](_0x17f008[_0x1a64('0x38')]['offset']);}_0x4266d4[_0x1a64('0x95')]=qs['sort'](_0x17f008['query']['sort']);_0x4266d4[_0x1a64('0x99')]=qs[_0x1a64('0x3d')](_[_0x1a64('0x97')](_0x17f008[_0x1a64('0x38')],_0x8cdf89['filters']));_0x4266d4[_0x1a64('0x99')][_0x1a64('0x98')]=_0x2a7d11['id'];if(_0x17f008[_0x1a64('0x38')]['filter']){_0x4266d4[_0x1a64('0x99')]=_[_0x1a64('0x2a')](_0x4266d4[_0x1a64('0x99')],{'$or':_[_0x1a64('0x2f')](_0x4266d4[_0x1a64('0x3f')],function(_0x33a008){var _0x3040ca={};_0x3040ca[_0x33a008]={'$like':'%'+_0x17f008[_0x1a64('0x38')][_0x1a64('0x9a')]+'%'};return _0x3040ca;})});}_0x4266d4['where'][_0x1a64('0x87')]=![];if(_0x17f008[_0x1a64('0x38')]['id']){_0x4266d4[_0x1a64('0x99')]['id']={'$gt':_0x17f008[_0x1a64('0x38')]['id']};}_0x4266d4=_[_0x1a64('0x2a')]({},_0x4266d4,_0x17f008[_0x1a64('0x9e')]);return db[_0x1a64('0x59')][_0x1a64('0x22')]({'where':_0x4266d4[_0x1a64('0x99')]})[_0x1a64('0x13')](function(_0x283bc5){_0x4c44ba[_0x1a64('0x22')]=_0x283bc5;_0x4266d4[_0x1a64('0x41')]=[];if(_0x17f008[_0x1a64('0x38')]['includeAgent']){_0x4266d4[_0x1a64('0x41')][_0x1a64('0xa2')]({'model':db[_0x1a64('0x77')],'as':_0x1a64('0x77'),'attributes':['id',_0x1a64('0x4d'),_0x1a64('0x83')]});}if(_0x17f008['query'][_0x1a64('0x9f')]){_0x4266d4[_0x1a64('0x41')]=[{'all':!![]}];}return db[_0x1a64('0x59')]['findAll'](_0x4266d4);})['then'](function(_0x3be321){_0x4c44ba[_0x1a64('0xa0')]=_0x3be321;return _0x4c44ba;});}})[_0x1a64('0x13')](respondWithFilteredResult(_0x5cf9fe,_0x4266d4))['catch'](handleError(_0x5cf9fe,null));};exports[_0x1a64('0xa3')]=function(_0x4bf208,_0x54ecd5){return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x4bf208[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x54ecd5,null))['then'](function(_0x17c76d){if(_0x17c76d){return _0x17c76d[_0x1a64('0xa4')](_0x4bf208['body'][_0x1a64('0x90')],_['omit'](_0x4bf208[_0x1a64('0x2b')],[_0x1a64('0x90'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x1a64('0x27'),_0x1a64('0xa5')],'where':{'id':_0x4bf208['body']['ids']}});})[_0x1a64('0x13')](function(_0x3d6e4f){socket[_0x1a64('0xa6')](_0x1a64('0xa7'),{'id':Number(_0x4bf208[_0x1a64('0x3a')]['id']),'tags':_0x3d6e4f||[]});return{'id':Number(_0x4bf208[_0x1a64('0x3a')]['id']),'tags':_0x3d6e4f||[]};});}})['then'](respondWithResult(_0x54ecd5,null))[_0x1a64('0x1c')](handleError(_0x54ecd5,null));};exports[_0x1a64('0xa8')]=function(_0xe59e81,_0x4873b5){return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0xe59e81['params']['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x4873b5,null))[_0x1a64('0x13')](function(_0x54f1c6){if(_0x54f1c6){return _0x54f1c6['removeTags'](_0xe59e81[_0x1a64('0x38')][_0x1a64('0x90')]);}})[_0x1a64('0x13')](respondWithStatusCode(_0x4873b5,null))[_0x1a64('0x1c')](handleError(_0x4873b5,null));};exports[_0x1a64('0xa9')]=function(_0x3f30fa,_0x38aa49){var _0x5aa2b0=moment()['unix']()[_0x1a64('0xaa')]();var _0x4927cf=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],_0x1a64('0xab'),_0x1a64('0xac'),_0x1a64('0xad'));var _0x5b88fe=path['join'](config[_0x1a64('0x70')],_0x1a64('0xab'),_0x1a64('0xac'),_0x1a64('0xae'));var _0x2fa326=path[_0x1a64('0x6f')](_0x4927cf,_0x5aa2b0);var _0x54de0d=util['format'](_0x1a64('0xaf'),_0x3f30fa[_0x1a64('0x3a')]['id'],_0x5aa2b0);var _0x366745=path[_0x1a64('0x6f')](_0x4927cf,_0x54de0d);var _0x5c1706=[];_0x5c1706['push']({'model':db[_0x1a64('0x77')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5c1706[_0x1a64('0xa2')]({'model':db[_0x1a64('0x5c')],'as':_0x1a64('0x5d'),'attributes':['id',_0x1a64('0xb0'),'lastName'],'raw':!![]});if(_0x3f30fa['query']['attachments']){_0x5c1706[_0x1a64('0xa2')]({'model':db['Attachment'],'as':_0x1a64('0x6a'),'raw':!![]});}var _0x368a01=[{'model':db['ChatMessage'],'as':_0x1a64('0x7a'),'attributes':['id',_0x1a64('0x2b'),_0x1a64('0x85'),_0x1a64('0xb1'),_0x1a64('0x87'),_0x1a64('0xb2')],'include':_0x5c1706}];_0x368a01[_0x1a64('0xa2')]({'model':db[_0x1a64('0x78')],'as':_0x1a64('0xb3'),'attributes':['id',_0x1a64('0x27')]});_0x368a01[_0x1a64('0xa2')]({'model':db[_0x1a64('0x77')],'as':_0x1a64('0xb4'),'attributes':['id','fullname']});return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x3f30fa['params']['id']},'include':_0x368a01})[_0x1a64('0x13')](handleEntityNotFound(_0x38aa49,null))[_0x1a64('0x13')](function(_0x5d4f34){if(_0x5d4f34){var _0x20a865=_0x5d4f34[_0x1a64('0xb5')]({'plain':!![]});fs[_0x1a64('0xb6')](_0x2fa326);var _0xea5e27={'channel':'Chat','account':_0x20a865[_0x1a64('0xb3')][_0x1a64('0x27')],'agent':_0x20a865[_0x1a64('0xb4')]?_0x20a865['Owner'][_0x1a64('0x4d')]:_0x1a64('0xb7'),'createdAt':moment(_0x20a865[_0x1a64('0x85')])[_0x1a64('0x74')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x20a865[_0x1a64('0x63')]?moment(_0x20a865[_0x1a64('0xb8')])[_0x1a64('0x74')](_0x1a64('0x9d'))[_0x1a64('0xaa')]():'','disposition':_0x20a865[_0x1a64('0xb9')],'chatInfo':{'browser':_0x20a865[_0x1a64('0xba')],'os':_0x20a865[_0x1a64('0xbb')],'referer':_0x20a865[_0x1a64('0xbc')],'customerIp':_0x20a865[_0x1a64('0xbd')],'customerPort':_0x20a865[_0x1a64('0xbe')]?_0x20a865[_0x1a64('0xbe')]:_0x1a64('0xb7')},'messages':_(_0x20a865[_0x1a64('0x7a')])['tail']()[_0x1a64('0x9a')]({'secret':![]})[_0x1a64('0x2f')](function(_0x1048d4){if(_0x1048d4[_0x1a64('0x6a')]){var _0x449543=path[_0x1a64('0x6f')](_0x5b88fe,_0x1048d4['Attachment'][_0x1a64('0x67')]);if(fs[_0x1a64('0xbf')](_0x449543)){fs['createReadStream'](_0x449543)[_0x1a64('0xc0')](fs[_0x1a64('0xc1')](path[_0x1a64('0x6f')](_0x2fa326,_0x1048d4['Attachment'][_0x1a64('0x67')])));}}return{'date':moment(_0x1048d4[_0x1a64('0x85')])['format'](_0x1a64('0x9d'))[_0x1a64('0xaa')](),'sender':_0x1048d4['direction']===_0x1a64('0xc2')?_0x1048d4[_0x1a64('0x77')]?_0x1048d4[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82'):_0x1048d4[_0x1a64('0x5d')]['firstName']+(_0x1048d4['Contact'][_0x1a64('0xc3')]?'\x20'+_0x1048d4[_0x1a64('0x5d')][_0x1a64('0xc3')]:''),'body':_0x1048d4[_0x1a64('0x6a')]?_0x1048d4['Attachment'][_0x1a64('0x67')]:_0x1048d4[_0x1a64('0x2b')],'direction':_0x1048d4['direction']===_0x1a64('0xc2')?'A':'C','secret':_0x1048d4['secret'],'read':_0x1048d4['read'],'attachment':_0x1048d4[_0x1a64('0x6a')]};})[_0x1a64('0xc4')]()};return ejs[_0x1a64('0xc5')](path[_0x1a64('0x6f')](config[_0x1a64('0x70')],'server',_0x1a64('0xc6'),_0x1a64('0xc7')),{'interaction':_0xea5e27})['then'](function(_0x1c6318){var _0x52f59e=path[_0x1a64('0x6f')](_0x2fa326,'transcript-'+_0x20a865['id']+'-'+_0x5aa2b0+_0x1a64('0xc8'));var _0x52a754={'path':_0x52f59e,'channel':_0x1a64('0xc9'),'interactionId':_0x20a865['id']};return pdf[_0x1a64('0xca')](_0x1c6318,_0x52a754);})['then'](function(){return new Promise(function(_0x19ee42,_0x456154){zipdir(_0x2fa326,{'saveTo':_0x366745},function(_0x481f6c,_0x5b5923){if(_0x481f6c)return _0x456154(_0x481f6c);return _0x19ee42(_0x5b5923);});})[_0x1a64('0x13')](function(){return new BPromise(function(_0x4f3340,_0x122bc8){rimraf(_0x2fa326,function(_0x803957){if(_0x803957)_0x122bc8(_0x803957);return _0x4f3340();});});})[_0x1a64('0x13')](function(){return _0x38aa49[_0x1a64('0xa9')](_0x366745,_0x54de0d,function(_0x2b6aff){if(_0x2b6aff){logger[_0x1a64('0x18')]('err',_0x2b6aff);}else{fs[_0x1a64('0xcb')](_0x366745);}});});});}else{return _0x38aa49[_0x1a64('0x1d')](0xc8);}})[_0x1a64('0x1c')](handleError(_0x38aa49,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index c730afb..39a0bdd 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 _0xec1a=['findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','Users','map'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xec1a,0xdb));var _0xaec1=function(_0x59e9d8,_0x5e9850){_0x59e9d8=_0x59e9d8-0x0;var _0x33ebc9=_0xec1a[_0x59e9d8];return _0x33ebc9;};'use strict';var EventEmitter=require(_0xaec1('0x0'));var ChatInteraction=require(_0xaec1('0x1'))['db'][_0xaec1('0x2')];var ChatMessage=require(_0xaec1('0x1'))['db'][_0xaec1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec1('0x4')](0x0);var events={'afterCreate':_0xaec1('0x5'),'afterUpdate':_0xaec1('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1e785d){return function(_0x4d2b66,_0x3a3648,_0x2948fd){_0x4d2b66['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1ea22b){_0x4d2b66['setDataValue'](_0xaec1('0x7'),_0x1ea22b[_0xaec1('0x8')](function(_0x282834){return{'id':_0x282834['id']};}));return ChatMessage[_0xaec1('0x9')]({'where':{'ChatInteractionId':_0x4d2b66['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaec1('0xa')](function(_0x3af653){_0x4d2b66[_0xaec1('0xb')](_0xaec1('0xc'),_0x3af653[_0xaec1('0xd')]);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d+':'+_0x4d2b66['id'],_0x4d2b66);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d,_0x4d2b66);_0x2948fd(null);})[_0xaec1('0xf')](_0x2948fd(null));};}for(var e in events){if(events[_0xaec1('0x10')](e)){var event=events[e];ChatInteraction[_0xaec1('0x11')](e,emitEvent(event));}}module[_0xaec1('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x155b=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x155b,0x16a));var _0xb155=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x155b[_0x3817a9];return _0x443f30;};'use strict';var EventEmitter=require(_0xb155('0x0'));var ChatInteraction=require(_0xb155('0x1'))['db'][_0xb155('0x2')];var ChatMessage=require(_0xb155('0x1'))['db'][_0xb155('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb155('0x4')](0x0);var events={'afterCreate':_0xb155('0x5'),'afterUpdate':_0xb155('0x6'),'afterDestroy':_0xb155('0x7')};function emitEvent(_0x1a9f1f){return function(_0x495da9,_0x46b008,_0x8bc4c){_0x495da9[_0xb155('0x8')]({'attributes':['id'],'raw':!![]})[_0xb155('0x9')](function(_0x112068){_0x495da9['setDataValue'](_0xb155('0xa'),_0x112068[_0xb155('0xb')](function(_0x3e17ad){return{'id':_0x3e17ad['id']};}));return ChatMessage[_0xb155('0xc')]({'where':{'ChatInteractionId':_0x495da9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb155('0x9')](function(_0xe9fe15){_0x495da9[_0xb155('0xd')](_0xb155('0xe'),_0xe9fe15[_0xb155('0xf')]);ChatInteractionEvents[_0xb155('0x10')](_0x1a9f1f+':'+_0x495da9['id'],_0x495da9);ChatInteractionEvents[_0xb155('0x10')](_0x1a9f1f,_0x495da9);_0x8bc4c(null);})[_0xb155('0x11')](_0x8bc4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xb155('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 548e867..aa006ac 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 _0xa11b=['request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0xa11b,0xbf));var _0xba11=function(_0x391ff0,_0x46db5d){_0x391ff0=_0x391ff0-0x0;var _0x33fd7b=_0xa11b[_0x391ff0];return _0x33fd7b;};'use strict';var _=require('lodash');var util=require(_0xba11('0x0'));var logger=require(_0xba11('0x1'))(_0xba11('0x2'));var moment=require(_0xba11('0x3'));var BPromise=require('bluebird');var rp=require(_0xba11('0x4'));var fs=require('fs');var path=require(_0xba11('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba11('0x6'));module[_0xba11('0x7')]=function(_0x2619e7,_0x616bcb){return _0x2619e7[_0xba11('0x8')](_0xba11('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db92e,_0x106568,_0x14db16){if(_0x2db92e[_0xba11('0xa')](_0xba11('0xb'))){_0x2db92e['closedAt']=moment()[_0xba11('0xc')](_0xba11('0xd'));}_0x14db16(null,_0x2db92e);}},'charset':'utf8mb4','collate':_0xba11('0xe')});}; \ No newline at end of file +var _0x1396=['changed','closed','format','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0xda8f6f,_0x11c149){var _0x1b3e68=function(_0x168b8d){while(--_0x168b8d){_0xda8f6f['push'](_0xda8f6f['shift']());}};_0x1b3e68(++_0x11c149);}(_0x1396,0x122));var _0x6139=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1396[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6139('0x0'))(_0x6139('0x1'));var moment=require('moment');var BPromise=require(_0x6139('0x2'));var rp=require(_0x6139('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6139('0x4'));var config=require(_0x6139('0x5'));var attributes=require(_0x6139('0x6'));module[_0x6139('0x7')]=function(_0x152d10,_0x591dc2){return _0x152d10[_0x6139('0x8')](_0x6139('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x564e83,_0x1041b5,_0x1a2d2e){if(_0x564e83[_0x6139('0xa')](_0x6139('0xb'))){_0x564e83['closedAt']=moment()[_0x6139('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1a2d2e(null,_0x564e83);}},'charset':_0x6139('0xd'),'collate':_0x6139('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index fc052f3..337601d 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 _0x0814=['where','attributes','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw'];(function(_0x17a23d,_0x4b6c0c){var _0x531cec=function(_0x2c10f4){while(--_0x2c10f4){_0x17a23d['push'](_0x17a23d['shift']());}};_0x531cec(++_0x4b6c0c);}(_0x0814,0x15d));var _0x4081=function(_0x41289e,_0x13bef1){_0x41289e=_0x41289e-0x0;var _0x89a172=_0x0814[_0x41289e];return _0x89a172;};'use strict';var _=require(_0x4081('0x0'));var util=require('util');var moment=require(_0x4081('0x1'));var BPromise=require('bluebird');var rs=require(_0x4081('0x2'));var fs=require('fs');var Redis=require(_0x4081('0x3'));var db=require(_0x4081('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4081('0x5'));var config=require(_0x4081('0x6'));var jayson=require(_0x4081('0x7'));var client=jayson[_0x4081('0x8')][_0x4081('0x9')]({'port':0x232a});config[_0x4081('0xa')]=_['defaults'](config[_0x4081('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4081('0xb'))(new Redis(config[_0x4081('0xa')]));require(_0x4081('0xc'))[_0x4081('0xd')](socket);function respondWithRpcPromise(_0x8584e8,_0x286a05,_0x1340c2){return new BPromise(function(_0x27023d,_0x2ea04a){return client['request'](_0x8584e8,_0x1340c2)[_0x4081('0xe')](function(_0x121ff6){logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');logger[_0x4081('0x11')](_0x4081('0x12'),_0x286a05,_0x4081('0x13'),JSON[_0x4081('0x14')](_0x121ff6));if(_0x121ff6['error']){if(_0x121ff6['error']['code']===0x1f4){logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6['error'][_0x4081('0x16')]);return _0x2ea04a(_0x121ff6[_0x4081('0x15')]['message']);}logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6[_0x4081('0x15')][_0x4081('0x16')]);return _0x27023d(_0x121ff6[_0x4081('0x15')]['message']);}else{logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');_0x27023d(_0x121ff6[_0x4081('0x17')]['message']);}})[_0x4081('0x18')](function(_0x17541f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x286a05,_0x17541f);_0x2ea04a(_0x17541f);});});}exports[_0x4081('0x19')]=function(_0x34cfcc){var _0x2f64e7=this;return new Promise(function(_0x3f145e,_0x5f18c4){return db[_0x4081('0x1a')][_0x4081('0x1b')](_0x34cfcc[_0x4081('0x1c')],{'raw':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc['options'][_0x4081('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x1f')]||null:null,'attributes':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x20')]||null:null,'limit':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')]['limit']||null:null})[_0x4081('0xe')](function(_0x45e92d){logger[_0x4081('0xf')](_0x4081('0x19'),_0x34cfcc);logger[_0x4081('0x11')](_0x4081('0x19'),_0x34cfcc,JSON[_0x4081('0x14')](_0x45e92d));_0x3f145e(_0x45e92d);})[_0x4081('0x18')](function(_0x44d6de){logger['error'](_0x4081('0x19'),_0x44d6de[_0x4081('0x16')],_0x34cfcc);_0x5f18c4(_0x2f64e7[_0x4081('0x15')](0x1f4,_0x44d6de['message']));});});};exports[_0x4081('0x21')]=function(_0x194105){return new Promise(function(_0x15ee6c,_0xa90a85){return db[_0x4081('0x1a')][_0x4081('0x22')]({'where':_0x194105[_0x4081('0x1d')]?_0x194105[_0x4081('0x1d')]['where']||null:null})['then'](function(_0x3b8ca4){if(_0x3b8ca4){return _0x3b8ca4[_0x4081('0x23')](_0x194105[_0x4081('0x1c')][_0x4081('0x24')],_['omit'](_0x194105['body'],[_0x4081('0x24'),'id'])||{});}})['spread'](function(_0xec2384){logger[_0x4081('0xf')](_0x4081('0x25'),_0x194105);logger['debug']('AddTags',_0x194105,JSON[_0x4081('0x14')](_0xec2384));_0x15ee6c(_0xec2384);})[_0x4081('0x18')](function(_0x38e89c){logger[_0x4081('0x15')](_0x4081('0x25'),_0x38e89c[_0x4081('0x16')],_0x194105);_0xa90a85(_this[_0x4081('0x15')](0x1f4,_0x38e89c[_0x4081('0x16')]));});});}; \ No newline at end of file +var _0x067d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','then','catch','AddTagsToChatInteraction','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis'];(function(_0x868d30,_0x121202){var _0xe498ab=function(_0x55f7b6){while(--_0x55f7b6){_0x868d30['push'](_0x868d30['shift']());}};_0xe498ab(++_0x121202);}(_0x067d,0xcd));var _0xd067=function(_0x1b2667,_0x279eb1){_0x1b2667=_0x1b2667-0x0;var _0x179ae8=_0x067d[_0x1b2667];return _0x179ae8;};'use strict';var _=require(_0xd067('0x0'));var util=require(_0xd067('0x1'));var moment=require(_0xd067('0x2'));var BPromise=require('bluebird');var rs=require(_0xd067('0x3'));var fs=require('fs');var Redis=require(_0xd067('0x4'));var db=require(_0xd067('0x5'))['db'];var utils=require(_0xd067('0x6'));var logger=require(_0xd067('0x7'))(_0xd067('0x8'));var config=require(_0xd067('0x9'));var jayson=require(_0xd067('0xa'));var client=jayson[_0xd067('0xb')][_0xd067('0xc')]({'port':0x232a});config[_0xd067('0xd')]=_['defaults'](config[_0xd067('0xd')],{'host':_0xd067('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd067('0xd')]));require(_0xd067('0xf'))[_0xd067('0x10')](socket);function respondWithRpcPromise(_0xdcbfce,_0x214593,_0x566763){return new BPromise(function(_0x5cfe3d,_0x561c78){return client[_0xd067('0x11')](_0xdcbfce,_0x566763)['then'](function(_0x5b4bc6){logger[_0xd067('0x12')](_0xd067('0x13'),_0x214593,'request\x20sent');logger[_0xd067('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x214593,'request\x20sent',JSON[_0xd067('0x15')](_0x5b4bc6));if(_0x5b4bc6[_0xd067('0x16')]){if(_0x5b4bc6['error'][_0xd067('0x17')]===0x1f4){logger[_0xd067('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x214593,_0x5b4bc6[_0xd067('0x16')][_0xd067('0x18')]);return _0x561c78(_0x5b4bc6['error'][_0xd067('0x18')]);}logger[_0xd067('0x16')](_0xd067('0x13'),_0x214593,_0x5b4bc6[_0xd067('0x16')]['message']);return _0x5cfe3d(_0x5b4bc6[_0xd067('0x16')][_0xd067('0x18')]);}else{logger['info'](_0xd067('0x13'),_0x214593,_0xd067('0x19'));_0x5cfe3d(_0x5b4bc6[_0xd067('0x1a')]['message']);}})['catch'](function(_0x33fe23){logger[_0xd067('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x214593,_0x33fe23);_0x561c78(_0x33fe23);});});}exports[_0xd067('0x1b')]=function(_0x96fa05){var _0x524132=this;return new Promise(function(_0x256d9e,_0xfd0b13){return db[_0xd067('0x1c')]['update'](_0x96fa05['body'],{'raw':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x1f')]||null:null,'attributes':_0x96fa05[_0xd067('0x1d')]?_0x96fa05['options'][_0xd067('0x20')]||null:null,'limit':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x21')]||null:null})[_0xd067('0x22')](function(_0x29bc3b){logger[_0xd067('0x12')]('UpdateChatInteraction',_0x96fa05);logger[_0xd067('0x14')](_0xd067('0x1b'),_0x96fa05,JSON[_0xd067('0x15')](_0x29bc3b));_0x256d9e(_0x29bc3b);})[_0xd067('0x23')](function(_0x34de72){logger[_0xd067('0x16')](_0xd067('0x1b'),_0x34de72[_0xd067('0x18')],_0x96fa05);_0xfd0b13(_0x524132[_0xd067('0x16')](0x1f4,_0x34de72[_0xd067('0x18')]));});});};exports[_0xd067('0x24')]=function(_0x30474f){return new Promise(function(_0x50e112,_0x486ee8){return db[_0xd067('0x1c')]['find']({'where':_0x30474f[_0xd067('0x1d')]?_0x30474f[_0xd067('0x1d')]['where']||null:null})[_0xd067('0x22')](function(_0x2200c7){if(_0x2200c7){return _0x2200c7[_0xd067('0x25')](_0x30474f[_0xd067('0x26')][_0xd067('0x27')],_['omit'](_0x30474f['body'],[_0xd067('0x27'),'id'])||{});}})[_0xd067('0x28')](function(_0x2172ff){logger[_0xd067('0x12')](_0xd067('0x29'),_0x30474f);logger['debug']('AddTags',_0x30474f,JSON['stringify'](_0x2172ff));_0x50e112(_0x2172ff);})[_0xd067('0x23')](function(_0x2e8d0a){logger[_0xd067('0x16')](_0xd067('0x29'),_0x2e8d0a['message'],_0x30474f);_0x486ee8(_this[_0xd067('0x16')](0x1f4,_0x2e8d0a[_0xd067('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9468218..20f2575 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 _0xab4b=['length','chatInteraction:','save','emit','removeListener'];(function(_0x39c931,_0xce322a){var _0x4d1dbb=function(_0x31db4e){while(--_0x31db4e){_0x39c931['push'](_0x39c931['shift']());}};_0x4d1dbb(++_0xce322a);}(_0xab4b,0x156));var _0xbab4=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xab4b[_0x257841];return _0x1b87ed;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xbab4('0x0'),'remove','update'];function createListener(_0x28fe4e,_0x479e3b){return function(_0x4eac02){_0x479e3b[_0xbab4('0x1')](_0x28fe4e,_0x4eac02);};}function removeListener(_0x174b76,_0x25f747){return function(){ChatInteractionEvents[_0xbab4('0x2')](_0x174b76,_0x25f747);};}exports['register']=function(_0x365090){for(var _0x6f1a52=0x0,_0x4f1afa=events[_0xbab4('0x3')];_0x6f1a52<_0x4f1afa;_0x6f1a52++){var _0x9851c8=events[_0x6f1a52];var _0x55cdd2=createListener(_0xbab4('0x4')+_0x9851c8,_0x365090);ChatInteractionEvents['on'](_0x9851c8,_0x55cdd2);}}; \ No newline at end of file +var _0x15d6=['save','remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x366d42,_0x338fb4){var _0x1a47f7=function(_0x404f01){while(--_0x404f01){_0x366d42['push'](_0x366d42['shift']());}};_0x1a47f7(++_0x338fb4);}(_0x15d6,0xb3));var _0x615d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x15d6[_0xa464c9];return _0x3d73c4;};'use strict';var ChatInteractionEvents=require(_0x615d('0x0'));var events=[_0x615d('0x1'),_0x615d('0x2'),_0x615d('0x3')];function createListener(_0x46ca8b,_0x423267){return function(_0x688729){_0x423267[_0x615d('0x4')](_0x46ca8b,_0x688729);};}function removeListener(_0x2c6415,_0x5d4beb){return function(){ChatInteractionEvents[_0x615d('0x5')](_0x2c6415,_0x5d4beb);};}exports[_0x615d('0x6')]=function(_0x5296d4){for(var _0x58fdaa=0x0,_0x162493=events[_0x615d('0x7')];_0x58fdaa<_0x162493;_0x58fdaa++){var _0x42ee0f=events[_0x58fdaa];var _0x1cb449=createListener(_0x615d('0x8')+_0x42ee0f,_0x5296d4);ChatInteractionEvents['on'](_0x42ee0f,_0x1cb449);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c5a390e..2b96b2b 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 _0x7aae=['create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7aae,0x1b6));var _0xe7aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7aae[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe7aa('0x0'));var path=require(_0xe7aa('0x1'));var timeout=require(_0xe7aa('0x2'));var express=require('express');var router=express[_0xe7aa('0x3')]();var fs_extra=require(_0xe7aa('0x4'));var auth=require(_0xe7aa('0x5'));var interaction=require(_0xe7aa('0x6'));var config=require(_0xe7aa('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xe7aa('0x8')](),controller['index']);router['get']('/describe',auth[_0xe7aa('0x8')](),controller[_0xe7aa('0x9')]);router[_0xe7aa('0xa')](_0xe7aa('0xb'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xd')]);router['get'](_0xe7aa('0xe'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xf')]);router[_0xe7aa('0xa')](_0xe7aa('0x10'),auth['isAuthenticated'](),controller[_0xe7aa('0x11')]);router['get'](_0xe7aa('0x12'),auth[_0xe7aa('0xc')](),controller['getMyMessages']);router[_0xe7aa('0xa')](_0xe7aa('0x13'),auth['isAuthenticated'](),controller['download']);router[_0xe7aa('0x14')]('/',auth['isAuthenticated'](),controller[_0xe7aa('0x15')]);router[_0xe7aa('0x14')](_0xe7aa('0x16'),auth['isAuthenticated'](),controller[_0xe7aa('0x17')]);var upload=multer({'storage':multer[_0xe7aa('0x18')]({'destination':function(_0x570e00,_0x2da2e4,_0x581d9e){_0x581d9e(null,path[_0xe7aa('0x19')](config[_0xe7aa('0x1a')],_0xe7aa('0x1b')));},'filename':function(_0x48a31b,_0x1a1579,_0x195e17){_0x195e17(null,util[_0xe7aa('0x1c')](_0xe7aa('0x1d'),Date[_0xe7aa('0x1e')](),_0x1a1579[_0xe7aa('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe7aa('0x14')]('/:id/attachment_upload',upload[_0xe7aa('0x20')](_0xe7aa('0x21')),controller[_0xe7aa('0x22')]);router['post'](_0xe7aa('0x10'),auth[_0xe7aa('0xc')](),controller['addMessage']);router[_0xe7aa('0x14')](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),interaction[_0xe7aa('0x24')](_0xe7aa('0x25'),_0xe7aa('0x26')),controller[_0xe7aa('0x27')]);router[_0xe7aa('0x28')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x29')),controller['update']);router[_0xe7aa('0x28')](_0xe7aa('0x2a'),controller[_0xe7aa('0x2b')]);router[_0xe7aa('0x28')](_0xe7aa('0x2c'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0x2d')]);router[_0xe7aa('0x28')]('/:id/close',controller[_0xe7aa('0x2e')]);router[_0xe7aa('0x2f')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x30')),controller[_0xe7aa('0x31')]);router['delete'](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),controller['removeTags']);module[_0xe7aa('0x32')]=router; \ No newline at end of file +var _0x9b6d=['describe','/:id','show','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x483461,_0x3a7690){var _0x1c851f=function(_0x3683ca){while(--_0x3683ca){_0x483461['push'](_0x483461['shift']());}};_0x1c851f(++_0x3a7690);}(_0x9b6d,0x1d5));var _0xd9b6=function(_0x15b6bc,_0x47b90f){_0x15b6bc=_0x15b6bc-0x0;var _0x50fb17=_0x9b6d[_0x15b6bc];return _0x50fb17;};'use strict';var multer=require('multer');var util=require(_0xd9b6('0x0'));var path=require('path');var timeout=require(_0xd9b6('0x1'));var express=require(_0xd9b6('0x2'));var router=express[_0xd9b6('0x3')]();var fs_extra=require(_0xd9b6('0x4'));var auth=require(_0xd9b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd9b6('0x6'));var controller=require('./chatInteraction.controller');router[_0xd9b6('0x7')]('/',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x9')]);router[_0xd9b6('0x7')](_0xd9b6('0xa'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0xb')]);router[_0xd9b6('0x7')](_0xd9b6('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0xd')]);router[_0xd9b6('0x7')]('/:id/attachment_download',auth[_0xd9b6('0xe')](),controller['attachmentDownload']);router[_0xd9b6('0x7')](_0xd9b6('0xf'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x10')]);router[_0xd9b6('0x7')](_0xd9b6('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0x12')]);router['get'](_0xd9b6('0x13'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x14')]);router[_0xd9b6('0x15')]('/',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x16')]);router[_0xd9b6('0x15')](_0xd9b6('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd9b6('0x18')]({'destination':function(_0xa05025,_0x590f10,_0x3030a9){_0x3030a9(null,path['join'](config[_0xd9b6('0x19')],'server/files/attachments/'));},'filename':function(_0x83eaad,_0xc863be,_0xcf1ef5){_0xcf1ef5(null,util['format'](_0xd9b6('0x1a'),Date[_0xd9b6('0x1b')](),_0xc863be['originalname'][_0xd9b6('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd9b6('0x15')](_0xd9b6('0x1d'),upload[_0xd9b6('0x1e')](_0xd9b6('0x1f')),controller[_0xd9b6('0x20')]);router['post'](_0xd9b6('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0x21')]);router[_0xd9b6('0x15')]('/:id/tags',auth[_0xd9b6('0x8')](),interaction['tracked'](_0xd9b6('0x22'),'chatinteraction:addtags'),controller[_0xd9b6('0x23')]);router[_0xd9b6('0x24')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xd9b6('0x22'),_0xd9b6('0x25')),controller[_0xd9b6('0x26')]);router[_0xd9b6('0x24')]('/:id/custom_update',controller[_0xd9b6('0x27')]);router[_0xd9b6('0x24')](_0xd9b6('0x28'),auth[_0xd9b6('0xe')](),controller['abandon']);router[_0xd9b6('0x24')](_0xd9b6('0x29'),controller[_0xd9b6('0x2a')]);router[_0xd9b6('0x2b')](_0xd9b6('0xc'),auth[_0xd9b6('0x8')](),interaction['tracked']('chat',_0xd9b6('0x2c')),controller[_0xd9b6('0x2d')]);router[_0xd9b6('0x2b')]('/:id/tags',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x2e')]);module[_0xd9b6('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index cc7cfec..d0c99fa 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 _0x4058=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x4283e9,_0x55c057){var _0x4e4c67=function(_0x3c700c){while(--_0x3c700c){_0x4283e9['push'](_0x4283e9['shift']());}};_0x4e4c67(++_0x55c057);}(_0x4058,0x1be));var _0x8405=function(_0x25c72c,_0x14f0ab){_0x25c72c=_0x25c72c-0x0;var _0x57e28b=_0x4058[_0x25c72c];return _0x57e28b;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'body':{'type':Sequelize[_0x8405('0x2')](_0x8405('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8405('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8405('0x5')]}}; \ No newline at end of file +var _0xf492=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0xf492,0x102));var _0x2f49=function(_0x1f1578,_0x33d122){_0x1f1578=_0x1f1578-0x0;var _0x2603f6=_0xf492[_0x1f1578];return _0x2603f6;};'use strict';var Sequelize=require(_0x2f49('0x0'));module['exports']={'body':{'type':Sequelize[_0x2f49('0x1')](_0x2f49('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2f49('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2f49('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index c4db13c..3d358e8 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 _0x88b6=['undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','ChatInternalMessage','includeAll','find','create','body','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueues','user','Agents','userProfileId','autoAssociation','UserProfileResource','length','resourceId','push','createdAt','ToId','read','all','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset'];(function(_0x25ab29,_0x364fec){var _0x146cdf=function(_0x5a809d){while(--_0x5a809d){_0x25ab29['push'](_0x25ab29['shift']());}};_0x146cdf(++_0x364fec);}(_0x88b6,0x112));var _0x688b=function(_0x393bf6,_0x45b827){_0x393bf6=_0x393bf6-0x0;var _0x437338=_0x88b6[_0x393bf6];return _0x437338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x688b('0x0'));var zipdir=require(_0x688b('0x1'));var jsonpatch=require(_0x688b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x688b('0x3'));var util=require(_0x688b('0x4'));var path=require(_0x688b('0x5'));var sox=require(_0x688b('0x6'));var csv=require(_0x688b('0x7'));var ejs=require(_0x688b('0x8'));var fs=require('fs');var fs_extra=require(_0x688b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x688b('0xa'));var jsforce=require(_0x688b('0xb'));var deskjs=require(_0x688b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x688b('0xd'));var Papa=require(_0x688b('0xe'));var Redis=require('ioredis');var authService=require(_0x688b('0xf'));var qs=require(_0x688b('0x10'));var as=require(_0x688b('0x11'));var hardwareService=require(_0x688b('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x688b('0x13'));var licenseUtil=require(_0x688b('0x14'));var db=require(_0x688b('0x15'))['db'];config[_0x688b('0x16')]=_[_0x688b('0x17')](config[_0x688b('0x16')],{'host':_0x688b('0x18'),'port':0x18eb});var socket=require(_0x688b('0x19'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x688b('0x1a')](socket);function respondWithStatusCode(_0x5bbc69,_0x2209c9){_0x2209c9=_0x2209c9||0xcc;return function(_0x212a13){if(_0x212a13){return _0x5bbc69[_0x688b('0x1b')](_0x2209c9);}return _0x5bbc69[_0x688b('0x1c')](_0x2209c9)[_0x688b('0x1d')]();};}function respondWithResult(_0x261823,_0x6b16c0){_0x6b16c0=_0x6b16c0||0xc8;return function(_0x1230af){if(_0x1230af){return _0x261823['status'](_0x6b16c0)[_0x688b('0x1e')](_0x1230af);}};}function respondWithFilteredResult(_0x602f7c,_0x2ca610){return function(_0x9157a){if(_0x9157a){var _0x44ca75=typeof _0x2ca610[_0x688b('0x1f')]===_0x688b('0x20')&&typeof _0x2ca610[_0x688b('0x21')]===_0x688b('0x20');var _0x26d69b=_0x9157a[_0x688b('0x22')];var _0x41fe4c=_0x44ca75?0x0:_0x2ca610[_0x688b('0x1f')];var _0x2bad4d=_0x44ca75?_0x9157a[_0x688b('0x22')]:_0x2ca610['offset']+_0x2ca610['limit'];var _0x54558e;if(_0x2bad4d>=_0x26d69b){_0x2bad4d=_0x26d69b;_0x54558e=0xc8;}else{_0x54558e=0xce;}_0x602f7c[_0x688b('0x1c')](_0x54558e);return _0x602f7c[_0x688b('0x23')](_0x688b('0x24'),_0x41fe4c+'-'+_0x2bad4d+'/'+_0x26d69b)[_0x688b('0x1e')](_0x9157a);}return null;};}function patchUpdates(_0x4ef372){return function(_0xe9f43d){try{jsonpatch[_0x688b('0x25')](_0xe9f43d,_0x4ef372,!![]);}catch(_0x270b0e){return BPromise['reject'](_0x270b0e);}return _0xe9f43d['save']();};}function saveUpdates(_0x434106,_0xa934ed){return function(_0x1827ab){if(_0x1827ab){return _0x1827ab[_0x688b('0x26')](_0x434106)[_0x688b('0x27')](function(_0x1310d6){return _0x1310d6;});}return null;};}function removeEntity(_0xa39004,_0x4b7464){return function(_0x3009b8){if(_0x3009b8){return _0x3009b8[_0x688b('0x28')]()[_0x688b('0x27')](function(){_0xa39004[_0x688b('0x1c')](0xcc)[_0x688b('0x1d')]();});}};}function handleEntityNotFound(_0x318c99,_0x4e90b8){return function(_0x327f57){if(!_0x327f57){_0x318c99[_0x688b('0x1b')](0x194);}return _0x327f57;};}function handleError(_0x594ab5,_0x306e19){_0x306e19=_0x306e19||0x1f4;return function(_0x506fe7){logger['error'](_0x506fe7[_0x688b('0x29')]);if(_0x506fe7[_0x688b('0x2a')]){delete _0x506fe7['name'];}_0x594ab5[_0x688b('0x1c')](_0x306e19)['send'](_0x506fe7);};}exports[_0x688b('0x2b')]=function(_0x1cd0a6,_0x5c4211){var _0x4d35c7={},_0x2687ab={},_0x4e3b44={'count':0x0,'rows':[]};var _0x3c1228=_[_0x688b('0x2c')](db['ChatInternalMessage'][_0x688b('0x2d')],function(_0x15e82a){return{'name':_0x15e82a['fieldName'],'type':_0x15e82a[_0x688b('0x2e')]['key']};});_0x2687ab[_0x688b('0x2f')]=_['map'](_0x3c1228,_0x688b('0x2a'));_0x2687ab[_0x688b('0x30')]=_['keys'](_0x1cd0a6[_0x688b('0x30')]);_0x2687ab[_0x688b('0x31')]=_[_0x688b('0x32')](_0x2687ab[_0x688b('0x2f')],_0x2687ab[_0x688b('0x30')]);_0x4d35c7[_0x688b('0x33')]=_[_0x688b('0x32')](_0x2687ab['model'],qs[_0x688b('0x34')](_0x1cd0a6[_0x688b('0x30')]['fields']));_0x4d35c7[_0x688b('0x33')]=_0x4d35c7['attributes']['length']?_0x4d35c7[_0x688b('0x33')]:_0x2687ab[_0x688b('0x2f')];if(!_0x1cd0a6[_0x688b('0x30')][_0x688b('0x35')]('nolimit')){_0x4d35c7[_0x688b('0x21')]=qs[_0x688b('0x21')](_0x1cd0a6[_0x688b('0x30')][_0x688b('0x21')]);_0x4d35c7[_0x688b('0x1f')]=qs[_0x688b('0x1f')](_0x1cd0a6[_0x688b('0x30')]['offset']);}_0x4d35c7['order']=qs['sort'](_0x1cd0a6['query'][_0x688b('0x36')]);_0x4d35c7[_0x688b('0x37')]=qs['filters'](_[_0x688b('0x38')](_0x1cd0a6[_0x688b('0x30')],_0x2687ab[_0x688b('0x31')]),_0x3c1228);if(_0x1cd0a6['query'][_0x688b('0x39')]){_0x4d35c7[_0x688b('0x37')]=_[_0x688b('0x3a')](_0x4d35c7['where'],{'$or':_[_0x688b('0x2c')](_0x3c1228,function(_0x47e653){if(_0x47e653[_0x688b('0x2e')]!==_0x688b('0x3b')){var _0x2c1ee4={};_0x2c1ee4[_0x47e653[_0x688b('0x2a')]]={'$like':'%'+_0x1cd0a6['query'][_0x688b('0x39')]+'%'};return _0x2c1ee4;}})});}_0x4d35c7=_['merge']({},_0x4d35c7,_0x1cd0a6[_0x688b('0x3c')]);var _0x28aa1e={'where':_0x4d35c7[_0x688b('0x37')]};return db['ChatInternalMessage']['count'](_0x28aa1e)[_0x688b('0x27')](function(_0x1fd051){_0x4e3b44[_0x688b('0x22')]=_0x1fd051;if(_0x1cd0a6['query']['includeAll']){_0x4d35c7[_0x688b('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x688b('0x3e')](_0x4d35c7);})[_0x688b('0x27')](function(_0x105635){_0x4e3b44[_0x688b('0x3f')]=_0x105635;return _0x4e3b44;})[_0x688b('0x27')](respondWithFilteredResult(_0x5c4211,_0x4d35c7))[_0x688b('0x40')](handleError(_0x5c4211,null));};exports[_0x688b('0x41')]=function(_0x23cc30,_0x54ff7e){var _0x4bd99f={'raw':!![],'where':{'id':_0x23cc30[_0x688b('0x42')]['id']}},_0x3350be={};_0x3350be[_0x688b('0x2f')]=_[_0x688b('0x43')](db[_0x688b('0x44')]['rawAttributes']);_0x3350be[_0x688b('0x30')]=_['keys'](_0x23cc30[_0x688b('0x30')]);_0x3350be[_0x688b('0x31')]=_['intersection'](_0x3350be[_0x688b('0x2f')],_0x3350be[_0x688b('0x30')]);_0x4bd99f[_0x688b('0x33')]=_[_0x688b('0x32')](_0x3350be[_0x688b('0x2f')],qs[_0x688b('0x34')](_0x23cc30[_0x688b('0x30')][_0x688b('0x34')]));_0x4bd99f[_0x688b('0x33')]=_0x4bd99f[_0x688b('0x33')]['length']?_0x4bd99f[_0x688b('0x33')]:_0x3350be[_0x688b('0x2f')];if(_0x23cc30['query'][_0x688b('0x45')]){_0x4bd99f[_0x688b('0x3d')]=[{'all':!![]}];}_0x4bd99f=_[_0x688b('0x3a')]({},_0x4bd99f,_0x23cc30[_0x688b('0x3c')]);return db[_0x688b('0x44')][_0x688b('0x46')](_0x4bd99f)[_0x688b('0x27')](handleEntityNotFound(_0x54ff7e,null))[_0x688b('0x27')](respondWithResult(_0x54ff7e,null))[_0x688b('0x40')](handleError(_0x54ff7e,null));};exports[_0x688b('0x47')]=function(_0x14f953,_0x217a55){return db['ChatInternalMessage']['create'](_0x14f953[_0x688b('0x48')],{})[_0x688b('0x27')](respondWithResult(_0x217a55,0xc9))[_0x688b('0x40')](handleError(_0x217a55,null));};exports['update']=function(_0x3c717a,_0x1d9c55){if(_0x3c717a[_0x688b('0x48')]['id']){delete _0x3c717a['body']['id'];}return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x3c717a[_0x688b('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d9c55,null))['then'](saveUpdates(_0x3c717a[_0x688b('0x48')],null))[_0x688b('0x27')](respondWithResult(_0x1d9c55,null))['catch'](handleError(_0x1d9c55,null));};exports[_0x688b('0x28')]=function(_0x4b6b68,_0x3d9c3e){return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x4b6b68[_0x688b('0x42')]['id']}})[_0x688b('0x27')](handleEntityNotFound(_0x3d9c3e,null))[_0x688b('0x27')](removeEntity(_0x3d9c3e,null))[_0x688b('0x40')](handleError(_0x3d9c3e,null));};exports[_0x688b('0x49')]=function(_0x1a6902,_0x213200){return db[_0x688b('0x44')][_0x688b('0x49')]()[_0x688b('0x27')](respondWithResult(_0x213200,null))['catch'](handleError(_0x213200,null));};function wrapUser(_0x25b482){return function(_0x1d7371){var _0xcde578=_0x25b482['get']({'plain':!![]});_0xcde578[_0x688b('0x4a')]=[];if(_0x1d7371){_0xcde578[_0x688b('0x4b')]=_0x1d7371['createdAt'];_0xcde578[_0x688b('0x4c')]=_0x1d7371;}else{_0xcde578[_0x688b('0x4b')]=moment(0x0)[_0x688b('0x4d')](_0x688b('0x4e'));_0xcde578[_0x688b('0x4c')]={};}return _0xcde578;};}exports[_0x688b('0x4f')]=function(_0x5bfa33,_0x5f20e5,_0x32414a){var _0x16e7b1=[];return db[_0x688b('0x50')][_0x688b('0x3e')]({'where':{'role':[_0x688b('0x51'),'admin','user']},'attributes':['id',_0x688b('0x52'),'name',_0x688b('0x53'),_0x688b('0x54'),_0x688b('0x55'),_0x688b('0x56'),_0x688b('0x57'),'allowmessenger',_0x688b('0x58')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x688b('0x59'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x688b('0x27')](function(_0x3f79da){if(_0x3f79da){var _0x47a589=_0x5bfa33[_0x688b('0x5a')]['get']({'plain':!![]});if(!_0x47a589)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47a589[_0x688b('0x53')]===_0x688b('0x5a')){return db['UserProfileSection']['find']({'where':{'name':_0x688b('0x5b'),'userProfileId':_0x47a589[_0x688b('0x5c')]},'raw':!![]})[_0x688b('0x27')](function(_0xe4b232){if(_0xe4b232){if(_0xe4b232[_0x688b('0x5d')]===0x0){return db[_0x688b('0x5e')]['findAll']({'where':{'sectionId':_0xe4b232['id']},'raw':!![]})[_0x688b('0x27')](function(_0x39bded){var _0x203d5a=[];if(_['isEmpty'](_0x39bded)){_0x203d5a=_[_0x688b('0x39')](_0x3f79da,function(_0x3d6058){if(_0x3d6058['role']!==_0x688b('0x51')){return _0x3d6058;}});return _0x203d5a;}else{for(var _0x3446d1=0x0;_0x3446d1<_0x3f79da[_0x688b('0x5f')];_0x3446d1++){var _0x3a0b80=_0x3f79da[_0x3446d1];if(_0x3a0b80[_0x688b('0x53')]==='agent'){var _0x4e4841=_[_0x688b('0x46')](_0x39bded,function(_0x553816){return _0x553816[_0x688b('0x60')]===_0x3a0b80['id'];});if(_0x4e4841)_0x203d5a[_0x688b('0x61')](_0x3a0b80);}else{_0x203d5a['push'](_0x3a0b80);}}return _0x203d5a;}});}else{return _0x3f79da;}}else{var _0x4e4ca2=_[_0x688b('0x39')](_0x3f79da,function(_0x247fd2){if(_0x247fd2['role']!=='agent'){return _0x247fd2;}});return _0x4e4ca2;}});}else{return _0x3f79da;}}})[_0x688b('0x27')](function(_0x4ba986){var _0x2ae8a2=[];if(_0x4ba986){_0x16e7b1=_0x4ba986;for(var _0x47be44=0x0;_0x47be44<_0x4ba986['length'];_0x47be44+=0x1){_0x16e7b1[_0x47be44][_0x688b('0x4a')]=[];_0x2ae8a2['push'](db[_0x688b('0x44')][_0x688b('0x46')]({'where':{'FromId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ToId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ChatGroupId':null},'attributes':['id',_0x688b('0x62'),'FromId',_0x688b('0x63'),_0x688b('0x64'),_0x688b('0x48')],'order':qs[_0x688b('0x36')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x688b('0x27')](wrapUser(_0x4ba986[_0x47be44])));}return BPromise[_0x688b('0x65')](_0x2ae8a2);}return[];})[_0x688b('0x27')](function(_0x4be39f){return{'rows':_0x4be39f,'count':_0x4be39f['length']};})[_0x688b('0x27')](respondWithResult(_0x5f20e5,null))['catch'](handleError(_0x5f20e5,null));}; \ No newline at end of file +var _0xc027=['sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','show','params','intersection','include','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','findAll','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','autoAssociation','isEmpty','agent','resourceId','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path'];(function(_0x1d61ca,_0x19164c){var _0x2fdf1f=function(_0x1526e3){while(--_0x1526e3){_0x1d61ca['push'](_0x1d61ca['shift']());}};_0x2fdf1f(++_0x19164c);}(_0xc027,0xcf));var _0x7c02=function(_0x2871c2,_0xe4c551){_0x2871c2=_0x2871c2-0x0;var _0x279bac=_0xc027[_0x2871c2];return _0x279bac;};'use strict';var emlformat=require(_0x7c02('0x0'));var rimraf=require(_0x7c02('0x1'));var zipdir=require(_0x7c02('0x2'));var jsonpatch=require(_0x7c02('0x3'));var rp=require(_0x7c02('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7c02('0x5'));var util=require('util');var path=require(_0x7c02('0x6'));var sox=require(_0x7c02('0x7'));var csv=require('to-csv');var ejs=require(_0x7c02('0x8'));var fs=require('fs');var fs_extra=require(_0x7c02('0x9'));var _=require(_0x7c02('0xa'));var squel=require(_0x7c02('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c02('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7c02('0xd'));var querystring=require(_0x7c02('0xe'));var Papa=require('papaparse');var Redis=require(_0x7c02('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7c02('0x10'));var as=require(_0x7c02('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c02('0x12'));var utils=require(_0x7c02('0x13'));var config=require(_0x7c02('0x14'));var licenseUtil=require(_0x7c02('0x15'));var db=require(_0x7c02('0x16'))['db'];config[_0x7c02('0x17')]=_[_0x7c02('0x18')](config[_0x7c02('0x17')],{'host':_0x7c02('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c02('0x17')]));require(_0x7c02('0x1a'))[_0x7c02('0x1b')](socket);function respondWithStatusCode(_0x36f34b,_0x5728a0){_0x5728a0=_0x5728a0||0xcc;return function(_0x341976){if(_0x341976){return _0x36f34b[_0x7c02('0x1c')](_0x5728a0);}return _0x36f34b[_0x7c02('0x1d')](_0x5728a0)[_0x7c02('0x1e')]();};}function respondWithResult(_0x38f8ab,_0x2b23ea){_0x2b23ea=_0x2b23ea||0xc8;return function(_0x39a1f9){if(_0x39a1f9){return _0x38f8ab[_0x7c02('0x1d')](_0x2b23ea)[_0x7c02('0x1f')](_0x39a1f9);}};}function respondWithFilteredResult(_0x102706,_0x222ba0){return function(_0x2f9f1d){if(_0x2f9f1d){var _0x4ae159=typeof _0x222ba0[_0x7c02('0x20')]===_0x7c02('0x21')&&typeof _0x222ba0[_0x7c02('0x22')]==='undefined';var _0x1eeb3a=_0x2f9f1d[_0x7c02('0x23')];var _0x3a3950=_0x4ae159?0x0:_0x222ba0[_0x7c02('0x20')];var _0x70055d=_0x4ae159?_0x2f9f1d[_0x7c02('0x23')]:_0x222ba0[_0x7c02('0x20')]+_0x222ba0[_0x7c02('0x22')];var _0x3a474e;if(_0x70055d>=_0x1eeb3a){_0x70055d=_0x1eeb3a;_0x3a474e=0xc8;}else{_0x3a474e=0xce;}_0x102706[_0x7c02('0x1d')](_0x3a474e);return _0x102706[_0x7c02('0x24')](_0x7c02('0x25'),_0x3a3950+'-'+_0x70055d+'/'+_0x1eeb3a)[_0x7c02('0x1f')](_0x2f9f1d);}return null;};}function patchUpdates(_0x3ce541){return function(_0x761643){try{jsonpatch[_0x7c02('0x26')](_0x761643,_0x3ce541,!![]);}catch(_0x5edd8c){return BPromise[_0x7c02('0x27')](_0x5edd8c);}return _0x761643[_0x7c02('0x28')]();};}function saveUpdates(_0x5522af,_0x17c2cb){return function(_0x1ed8f4){if(_0x1ed8f4){return _0x1ed8f4[_0x7c02('0x29')](_0x5522af)[_0x7c02('0x2a')](function(_0x5183f7){return _0x5183f7;});}return null;};}function removeEntity(_0x54bf4c,_0x366ba1){return function(_0x352380){if(_0x352380){return _0x352380['destroy']()[_0x7c02('0x2a')](function(){_0x54bf4c['status'](0xcc)[_0x7c02('0x1e')]();});}};}function handleEntityNotFound(_0x2e615d,_0x2c6701){return function(_0x2395ea){if(!_0x2395ea){_0x2e615d['sendStatus'](0x194);}return _0x2395ea;};}function handleError(_0x45e0e8,_0x5e13d8){_0x5e13d8=_0x5e13d8||0x1f4;return function(_0x584c2e){logger[_0x7c02('0x2b')](_0x584c2e[_0x7c02('0x2c')]);if(_0x584c2e[_0x7c02('0x2d')]){delete _0x584c2e[_0x7c02('0x2d')];}_0x45e0e8[_0x7c02('0x1d')](_0x5e13d8)[_0x7c02('0x2e')](_0x584c2e);};}exports[_0x7c02('0x2f')]=function(_0x498bdc,_0x949df5){var _0x5e3b42={},_0xce8aff={},_0x579339={'count':0x0,'rows':[]};var _0x11baa5=_[_0x7c02('0x30')](db[_0x7c02('0x31')][_0x7c02('0x32')],function(_0x56e48d){return{'name':_0x56e48d['fieldName'],'type':_0x56e48d[_0x7c02('0x33')][_0x7c02('0x34')]};});_0xce8aff['model']=_[_0x7c02('0x30')](_0x11baa5,'name');_0xce8aff[_0x7c02('0x35')]=_[_0x7c02('0x36')](_0x498bdc[_0x7c02('0x35')]);_0xce8aff[_0x7c02('0x37')]=_['intersection'](_0xce8aff[_0x7c02('0x38')],_0xce8aff['query']);_0x5e3b42['attributes']=_['intersection'](_0xce8aff[_0x7c02('0x38')],qs[_0x7c02('0x39')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x39')]));_0x5e3b42[_0x7c02('0x3a')]=_0x5e3b42['attributes'][_0x7c02('0x3b')]?_0x5e3b42[_0x7c02('0x3a')]:_0xce8aff['model'];if(!_0x498bdc[_0x7c02('0x35')][_0x7c02('0x3c')](_0x7c02('0x3d'))){_0x5e3b42[_0x7c02('0x22')]=qs[_0x7c02('0x22')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x22')]);_0x5e3b42[_0x7c02('0x20')]=qs[_0x7c02('0x20')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x20')]);}_0x5e3b42['order']=qs[_0x7c02('0x3e')](_0x498bdc['query'][_0x7c02('0x3e')]);_0x5e3b42[_0x7c02('0x3f')]=qs[_0x7c02('0x37')](_[_0x7c02('0x40')](_0x498bdc[_0x7c02('0x35')],_0xce8aff[_0x7c02('0x37')]),_0x11baa5);if(_0x498bdc[_0x7c02('0x35')][_0x7c02('0x41')]){_0x5e3b42[_0x7c02('0x3f')]=_[_0x7c02('0x42')](_0x5e3b42[_0x7c02('0x3f')],{'$or':_[_0x7c02('0x30')](_0x11baa5,function(_0x3fa6f6){if(_0x3fa6f6['type']!=='VIRTUAL'){var _0x196325={};_0x196325[_0x3fa6f6['name']]={'$like':'%'+_0x498bdc[_0x7c02('0x35')][_0x7c02('0x41')]+'%'};return _0x196325;}})});}_0x5e3b42=_[_0x7c02('0x42')]({},_0x5e3b42,_0x498bdc[_0x7c02('0x43')]);var _0x34217d={'where':_0x5e3b42[_0x7c02('0x3f')]};return db[_0x7c02('0x31')]['count'](_0x34217d)[_0x7c02('0x2a')](function(_0x237114){_0x579339[_0x7c02('0x23')]=_0x237114;if(_0x498bdc[_0x7c02('0x35')][_0x7c02('0x44')]){_0x5e3b42['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x5e3b42);})[_0x7c02('0x2a')](function(_0x537438){_0x579339['rows']=_0x537438;return _0x579339;})[_0x7c02('0x2a')](respondWithFilteredResult(_0x949df5,_0x5e3b42))['catch'](handleError(_0x949df5,null));};exports[_0x7c02('0x45')]=function(_0x3d699d,_0x1d4c9f){var _0x460cd2={'raw':!![],'where':{'id':_0x3d699d[_0x7c02('0x46')]['id']}},_0x491407={};_0x491407[_0x7c02('0x38')]=_[_0x7c02('0x36')](db['ChatInternalMessage'][_0x7c02('0x32')]);_0x491407[_0x7c02('0x35')]=_['keys'](_0x3d699d[_0x7c02('0x35')]);_0x491407[_0x7c02('0x37')]=_[_0x7c02('0x47')](_0x491407[_0x7c02('0x38')],_0x491407[_0x7c02('0x35')]);_0x460cd2[_0x7c02('0x3a')]=_[_0x7c02('0x47')](_0x491407[_0x7c02('0x38')],qs[_0x7c02('0x39')](_0x3d699d[_0x7c02('0x35')][_0x7c02('0x39')]));_0x460cd2[_0x7c02('0x3a')]=_0x460cd2[_0x7c02('0x3a')][_0x7c02('0x3b')]?_0x460cd2['attributes']:_0x491407['model'];if(_0x3d699d[_0x7c02('0x35')][_0x7c02('0x44')]){_0x460cd2[_0x7c02('0x48')]=[{'all':!![]}];}_0x460cd2=_[_0x7c02('0x42')]({},_0x460cd2,_0x3d699d['options']);return db[_0x7c02('0x31')][_0x7c02('0x49')](_0x460cd2)[_0x7c02('0x2a')](handleEntityNotFound(_0x1d4c9f,null))[_0x7c02('0x2a')](respondWithResult(_0x1d4c9f,null))[_0x7c02('0x4a')](handleError(_0x1d4c9f,null));};exports[_0x7c02('0x4b')]=function(_0x513ef2,_0x108f59){return db[_0x7c02('0x31')][_0x7c02('0x4b')](_0x513ef2[_0x7c02('0x4c')],{})[_0x7c02('0x2a')](respondWithResult(_0x108f59,0xc9))[_0x7c02('0x4a')](handleError(_0x108f59,null));};exports[_0x7c02('0x29')]=function(_0xa62f5,_0x16b8c6){if(_0xa62f5[_0x7c02('0x4c')]['id']){delete _0xa62f5['body']['id'];}return db[_0x7c02('0x31')][_0x7c02('0x49')]({'where':{'id':_0xa62f5['params']['id']}})[_0x7c02('0x2a')](handleEntityNotFound(_0x16b8c6,null))[_0x7c02('0x2a')](saveUpdates(_0xa62f5[_0x7c02('0x4c')],null))[_0x7c02('0x2a')](respondWithResult(_0x16b8c6,null))[_0x7c02('0x4a')](handleError(_0x16b8c6,null));};exports[_0x7c02('0x4d')]=function(_0x4dbe91,_0x5b7b68){return db[_0x7c02('0x31')][_0x7c02('0x49')]({'where':{'id':_0x4dbe91[_0x7c02('0x46')]['id']}})[_0x7c02('0x2a')](handleEntityNotFound(_0x5b7b68,null))[_0x7c02('0x2a')](removeEntity(_0x5b7b68,null))[_0x7c02('0x4a')](handleError(_0x5b7b68,null));};exports[_0x7c02('0x4e')]=function(_0x486b50,_0xddea67){return db[_0x7c02('0x31')][_0x7c02('0x4e')]()[_0x7c02('0x2a')](respondWithResult(_0xddea67,null))[_0x7c02('0x4a')](handleError(_0xddea67,null));};function wrapUser(_0x1a31b0){return function(_0x3449c3){var _0x5b3bf2=_0x1a31b0[_0x7c02('0x4f')]({'plain':!![]});_0x5b3bf2[_0x7c02('0x50')]=[];if(_0x3449c3){_0x5b3bf2[_0x7c02('0x51')]=_0x3449c3[_0x7c02('0x52')];_0x5b3bf2['lastMessage']=_0x3449c3;}else{_0x5b3bf2[_0x7c02('0x51')]=moment(0x0)[_0x7c02('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b3bf2[_0x7c02('0x54')]={};}return _0x5b3bf2;};}exports[_0x7c02('0x55')]=function(_0xe8b756,_0x4d763d,_0x4682d4){var _0x29bde6=[];return db[_0x7c02('0x56')][_0x7c02('0x57')]({'where':{'role':['agent','admin',_0x7c02('0x58')]},'attributes':['id',_0x7c02('0x59'),_0x7c02('0x2d'),_0x7c02('0x5a'),'userpic',_0x7c02('0x5b'),_0x7c02('0x5c'),_0x7c02('0x5d'),_0x7c02('0x5e'),_0x7c02('0x5f')],'order':qs[_0x7c02('0x3e')](_0x7c02('0x60')),'include':[{'model':db[_0x7c02('0x61')],'as':_0x7c02('0x62'),'attributes':['id',_0x7c02('0x2d'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3b1bb7){if(_0x3b1bb7){var _0x5be4d4=_0xe8b756[_0x7c02('0x58')]['get']({'plain':!![]});if(!_0x5be4d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5be4d4[_0x7c02('0x5a')]===_0x7c02('0x58')){return db['UserProfileSection'][_0x7c02('0x49')]({'where':{'name':'Agents','userProfileId':_0x5be4d4['userProfileId']},'raw':!![]})[_0x7c02('0x2a')](function(_0x3b3ff0){if(_0x3b3ff0){if(_0x3b3ff0[_0x7c02('0x63')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3b3ff0['id']},'raw':!![]})['then'](function(_0x135ee1){var _0xae15cc=[];if(_[_0x7c02('0x64')](_0x135ee1)){_0xae15cc=_[_0x7c02('0x41')](_0x3b1bb7,function(_0x27237e){if(_0x27237e['role']!=='agent'){return _0x27237e;}});return _0xae15cc;}else{for(var _0x3e48d8=0x0;_0x3e48d8<_0x3b1bb7['length'];_0x3e48d8++){var _0x2a7dcb=_0x3b1bb7[_0x3e48d8];if(_0x2a7dcb[_0x7c02('0x5a')]===_0x7c02('0x65')){var _0xe5f2c4=_['find'](_0x135ee1,function(_0xaf7391){return _0xaf7391[_0x7c02('0x66')]===_0x2a7dcb['id'];});if(_0xe5f2c4)_0xae15cc['push'](_0x2a7dcb);}else{_0xae15cc[_0x7c02('0x67')](_0x2a7dcb);}}return _0xae15cc;}});}else{return _0x3b1bb7;}}else{var _0x3ef451=_[_0x7c02('0x41')](_0x3b1bb7,function(_0x47c902){if(_0x47c902[_0x7c02('0x5a')]!==_0x7c02('0x65')){return _0x47c902;}});return _0x3ef451;}});}else{return _0x3b1bb7;}}})[_0x7c02('0x2a')](function(_0x54d075){var _0x36f622=[];if(_0x54d075){_0x29bde6=_0x54d075;for(var _0x2a6e5b=0x0;_0x2a6e5b<_0x54d075[_0x7c02('0x3b')];_0x2a6e5b+=0x1){_0x29bde6[_0x2a6e5b][_0x7c02('0x50')]=[];_0x36f622[_0x7c02('0x67')](db['ChatInternalMessage'][_0x7c02('0x49')]({'where':{'FromId':[_0xe8b756[_0x7c02('0x58')]['id'],_0x54d075[_0x2a6e5b]['id']],'ToId':[_0xe8b756[_0x7c02('0x58')]['id'],_0x54d075[_0x2a6e5b]['id']],'ChatGroupId':null},'attributes':['id',_0x7c02('0x52'),'FromId',_0x7c02('0x68'),_0x7c02('0x69'),'body'],'order':qs[_0x7c02('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7c02('0x2a')](wrapUser(_0x54d075[_0x2a6e5b])));}return BPromise[_0x7c02('0x6a')](_0x36f622);}return[];})[_0x7c02('0x2a')](function(_0x20121c){return{'rows':_0x20121c,'count':_0x20121c[_0x7c02('0x3b')]};})[_0x7c02('0x2a')](respondWithResult(_0x4d763d,null))[_0x7c02('0x4a')](handleError(_0x4d763d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 28676cf..72aa08f 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 _0x6d6d=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x63de62,_0xe5cc89){var _0x3daddf=function(_0x2a5d79){while(--_0x2a5d79){_0x63de62['push'](_0x63de62['shift']());}};_0x3daddf(++_0xe5cc89);}(_0x6d6d,0xd2));var _0xd6d6=function(_0x3cf0c9,_0x4e4ec8){_0x3cf0c9=_0x3cf0c9-0x0;var _0xe29f0e=_0x6d6d[_0x3cf0c9];return _0xe29f0e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd6d6('0x0'))['db'][_0xd6d6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd6d6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd6d6('0x3'),'afterDestroy':_0xd6d6('0x4')};function emitEvent(_0x69ff42){return function(_0xccafee,_0xfb579c,_0x15102b){ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42+':'+_0xccafee['id'],_0xccafee);ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42,_0xccafee);_0x15102b(null);};}for(var e in events){if(events[_0xd6d6('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xbde6=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x36055a,_0x55613a){var _0x1eb71f=function(_0x489fc4){while(--_0x489fc4){_0x36055a['push'](_0x36055a['shift']());}};_0x1eb71f(++_0x55613a);}(_0xbde6,0xae));var _0x6bde=function(_0x14c606,_0x4d97f1){_0x14c606=_0x14c606-0x0;var _0x34fe6e=_0xbde6[_0x14c606];return _0x34fe6e;};'use strict';var EventEmitter=require(_0x6bde('0x0'));var ChatInternalMessage=require(_0x6bde('0x1'))['db'][_0x6bde('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6bde('0x3')](0x0);var events={'afterCreate':_0x6bde('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x185367){return function(_0x1e95b2,_0x24b635,_0x291732){ChatInternalMessageEvents[_0x6bde('0x5')](_0x185367+':'+_0x1e95b2['id'],_0x1e95b2);ChatInternalMessageEvents[_0x6bde('0x5')](_0x185367,_0x1e95b2);_0x291732(null);};}for(var e in events){if(events[_0x6bde('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6bde('0x7')](e,emitEvent(event));}}module[_0x6bde('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 dbf6908..0adcf13 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 _0xc8ed=['bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0xc8ed,0x1bd));var _0xdc8e=function(_0x251ae3,_0x340452){_0x251ae3=_0x251ae3-0x0;var _0x4b6995=_0xc8ed[_0x251ae3];return _0x4b6995;};'use strict';var _=require('lodash');var util=require(_0xdc8e('0x0'));var logger=require(_0xdc8e('0x1'))('api');var moment=require(_0xdc8e('0x2'));var BPromise=require(_0xdc8e('0x3'));var rp=require(_0xdc8e('0x4'));var fs=require('fs');var path=require(_0xdc8e('0x5'));var rimraf=require('rimraf');var config=require(_0xdc8e('0x6'));var attributes=require(_0xdc8e('0x7'));module[_0xdc8e('0x8')]=function(_0x4ce6a8,_0x5494b3){return _0x4ce6a8[_0xdc8e('0x9')](_0xdc8e('0xa'),attributes,{'tableName':_0xdc8e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc8e('0xc'),'collate':_0xdc8e('0xd')});}; \ No newline at end of file +var _0x1135=['moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xaf0e4c,_0x4760ab){var _0x28b3f9=function(_0xc36c19){while(--_0xc36c19){_0xaf0e4c['push'](_0xaf0e4c['shift']());}};_0x28b3f9(++_0x4760ab);}(_0x1135,0x1b7));var _0x5113=function(_0x16ba90,_0x108eb7){_0x16ba90=_0x16ba90-0x0;var _0x2bc281=_0x1135[_0x16ba90];return _0x2bc281;};'use strict';var _=require(_0x5113('0x0'));var util=require(_0x5113('0x1'));var logger=require(_0x5113('0x2'))('api');var moment=require(_0x5113('0x3'));var BPromise=require('bluebird');var rp=require(_0x5113('0x4'));var fs=require('fs');var path=require(_0x5113('0x5'));var rimraf=require(_0x5113('0x6'));var config=require(_0x5113('0x7'));var attributes=require(_0x5113('0x8'));module[_0x5113('0x9')]=function(_0x1fcd0d,_0xb8fccd){return _0x1fcd0d[_0x5113('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5113('0xb'),'collate':_0x5113('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6408a4d..4b27c2f 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 _0x2982=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2db83f,_0x5754fb){var _0x1fbe86=function(_0x16272f){while(--_0x16272f){_0x2db83f['push'](_0x2db83f['shift']());}};_0x1fbe86(++_0x5754fb);}(_0x2982,0x8d));var _0x2298=function(_0x28801e,_0x3c0c42){_0x28801e=_0x28801e-0x0;var _0x56e311=_0x2982[_0x28801e];return _0x56e311;};'use strict';var _=require(_0x2298('0x0'));var util=require('util');var moment=require(_0x2298('0x1'));var BPromise=require(_0x2298('0x2'));var rs=require(_0x2298('0x3'));var fs=require('fs');var Redis=require(_0x2298('0x4'));var db=require(_0x2298('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2298('0x6'))(_0x2298('0x7'));var config=require('../../config/environment');var jayson=require(_0x2298('0x8'));var client=jayson[_0x2298('0x9')][_0x2298('0xa')]({'port':0x232a});config['redis']=_[_0x2298('0xb')](config[_0x2298('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2298('0xd'))['register'](socket);function respondWithRpcPromise(_0x1b34b2,_0xf6e6d9,_0x123b9e){return new BPromise(function(_0x493b7b,_0x11a3f9){return client[_0x2298('0xe')](_0x1b34b2,_0x123b9e)[_0x2298('0xf')](function(_0x1636ab){logger[_0x2298('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x2298('0x11'));logger[_0x2298('0x12')](_0x2298('0x13'),_0xf6e6d9,_0x2298('0x11'),JSON[_0x2298('0x14')](_0x1636ab));if(_0x1636ab[_0x2298('0x15')]){if(_0x1636ab['error'][_0x2298('0x16')]===0x1f4){logger['error'](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x11a3f9(_0x1636ab['error'][_0x2298('0x18')]);}logger[_0x2298('0x15')](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x493b7b(_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);}else{logger[_0x2298('0x10')](_0x2298('0x17'),_0xf6e6d9,_0x2298('0x11'));_0x493b7b(_0x1636ab[_0x2298('0x19')][_0x2298('0x18')]);}})[_0x2298('0x1a')](function(_0x453862){logger[_0x2298('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x453862);_0x11a3f9(_0x453862);});});} \ No newline at end of file +var _0xdadf=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','request','then','info','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x20bcef,_0x55607f){var _0x372a1d=function(_0x2c9b3e){while(--_0x2c9b3e){_0x20bcef['push'](_0x20bcef['shift']());}};_0x372a1d(++_0x55607f);}(_0xdadf,0xc8));var _0xfdad=function(_0x47bf5b,_0x4531da){_0x47bf5b=_0x47bf5b-0x0;var _0x34edac=_0xdadf[_0x47bf5b];return _0x34edac;};'use strict';var _=require(_0xfdad('0x0'));var util=require('util');var moment=require(_0xfdad('0x1'));var BPromise=require(_0xfdad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfdad('0x3'));var db=require(_0xfdad('0x4'))['db'];var utils=require(_0xfdad('0x5'));var logger=require(_0xfdad('0x6'))(_0xfdad('0x7'));var config=require(_0xfdad('0x8'));var jayson=require(_0xfdad('0x9'));var client=jayson['client'][_0xfdad('0xa')]({'port':0x232a});config[_0xfdad('0xb')]=_[_0xfdad('0xc')](config[_0xfdad('0xb')],{'host':_0xfdad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdad('0xb')]));require(_0xfdad('0xe'))['register'](socket);function respondWithRpcPromise(_0xc5be48,_0x5889cd,_0x546cb9){return new BPromise(function(_0x48ee1e,_0x413a62){return client[_0xfdad('0xf')](_0xc5be48,_0x546cb9)[_0xfdad('0x10')](function(_0x29049c){logger[_0xfdad('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x5889cd,_0xfdad('0x12'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5889cd,_0xfdad('0x12'),JSON['stringify'](_0x29049c));if(_0x29049c[_0xfdad('0x13')]){if(_0x29049c['error'][_0xfdad('0x14')]===0x1f4){logger[_0xfdad('0x13')](_0xfdad('0x15'),_0x5889cd,_0x29049c['error'][_0xfdad('0x16')]);return _0x413a62(_0x29049c['error'][_0xfdad('0x16')]);}logger['error'](_0xfdad('0x15'),_0x5889cd,_0x29049c[_0xfdad('0x13')][_0xfdad('0x16')]);return _0x48ee1e(_0x29049c[_0xfdad('0x13')][_0xfdad('0x16')]);}else{logger['info'](_0xfdad('0x15'),_0x5889cd,_0xfdad('0x12'));_0x48ee1e(_0x29049c[_0xfdad('0x17')][_0xfdad('0x16')]);}})[_0xfdad('0x18')](function(_0x47cd2d){logger['error'](_0xfdad('0x15'),_0x5889cd,_0x47cd2d);_0x413a62(_0x47cd2d);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 5283d63..4031087 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 _0xbde6=['removeListener','register','length','./chatInternalMessage.events','save','update','emit'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xbde6,0xc7));var _0x6bde=function(_0x480c85,_0x291d15){_0x480c85=_0x480c85-0x0;var _0x51531c=_0xbde6[_0x480c85];return _0x51531c;};'use strict';var ChatInternalMessageEvents=require(_0x6bde('0x0'));var events=[_0x6bde('0x1'),'remove',_0x6bde('0x2')];function createListener(_0x65e0d7,_0x4c9e67){return function(_0x552583){_0x4c9e67[_0x6bde('0x3')](_0x65e0d7,_0x552583);};}function removeListener(_0x5dc36d,_0x1b6604){return function(){ChatInternalMessageEvents[_0x6bde('0x4')](_0x5dc36d,_0x1b6604);};}exports[_0x6bde('0x5')]=function(_0x22d440){for(var _0x252625=0x0,_0x244daa=events[_0x6bde('0x6')];_0x252625<_0x244daa;_0x252625++){var _0x6b2c8f=events[_0x252625];var _0x24d6a5=createListener('chatInternalMessage:'+_0x6b2c8f,_0x22d440);ChatInternalMessageEvents['on'](_0x6b2c8f,_0x24d6a5);}}; \ No newline at end of file +var _0x7f2e=['removeListener','chatInternalMessage:','./chatInternalMessage.events','remove','emit'];(function(_0x34fe2c,_0x3c12cc){var _0x4fef94=function(_0x761711){while(--_0x761711){_0x34fe2c['push'](_0x34fe2c['shift']());}};_0x4fef94(++_0x3c12cc);}(_0x7f2e,0x19c));var _0xe7f2=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x7f2e[_0x225f50];return _0x19d003;};'use strict';var ChatInternalMessageEvents=require(_0xe7f2('0x0'));var events=['save',_0xe7f2('0x1'),'update'];function createListener(_0x210ba0,_0x4fc5b3){return function(_0x4ad911){_0x4fc5b3[_0xe7f2('0x2')](_0x210ba0,_0x4ad911);};}function removeListener(_0x3c08cb,_0x1c5630){return function(){ChatInternalMessageEvents[_0xe7f2('0x3')](_0x3c08cb,_0x1c5630);};}exports['register']=function(_0x2de62f){for(var _0x14958f=0x0,_0xea3769=events['length'];_0x14958f<_0xea3769;_0x14958f++){var _0x15beaf=events[_0x14958f];var _0x329198=createListener(_0xe7f2('0x4')+_0x15beaf,_0x2de62f);ChatInternalMessageEvents['on'](_0x15beaf,_0x329198);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index af64287..6d27c2a 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 _0x024c=['getUsers','/:id','show','post','create','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/users'];(function(_0x30cb3a,_0x4adc6f){var _0x32e69f=function(_0x14845e){while(--_0x14845e){_0x30cb3a['push'](_0x30cb3a['shift']());}};_0x32e69f(++_0x4adc6f);}(_0x024c,0x1c0));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc024('0x0'));var util=require(_0xc024('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc024('0x2'));var router=express[_0xc024('0x3')]();var fs_extra=require(_0xc024('0x4'));var auth=require(_0xc024('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc024('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xc024('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc024('0x7')](_0xc024('0x8'),auth[_0xc024('0x9')](),controller[_0xc024('0xa')]);router['get'](_0xc024('0xb'),auth[_0xc024('0x9')](),controller[_0xc024('0xc')]);router[_0xc024('0x7')](_0xc024('0xd'),auth['isAuthenticated'](),controller[_0xc024('0xe')]);router[_0xc024('0xf')]('/',auth[_0xc024('0x9')](),controller[_0xc024('0x10')]);router[_0xc024('0x11')]('/:id',controller['update']);router[_0xc024('0x12')](_0xc024('0xd'),auth[_0xc024('0x9')](),controller['destroy']);module[_0xc024('0x13')]=router; \ No newline at end of file +var _0x2d3d=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','getUsers','/:id','show','post','create','put','update'];(function(_0x44adaf,_0xa3c961){var _0x1dad05=function(_0x5540e6){while(--_0x5540e6){_0x44adaf['push'](_0x44adaf['shift']());}};_0x1dad05(++_0xa3c961);}(_0x2d3d,0x1a3));var _0xd2d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d3d[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xd2d3('0x0'));var util=require(_0xd2d3('0x1'));var path=require(_0xd2d3('0x2'));var timeout=require(_0xd2d3('0x3'));var express=require(_0xd2d3('0x4'));var router=express[_0xd2d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd2d3('0x6'));var interaction=require(_0xd2d3('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xd2d3('0x8')]('/',auth[_0xd2d3('0x9')](),controller['index']);router[_0xd2d3('0x8')]('/describe',auth[_0xd2d3('0x9')](),controller[_0xd2d3('0xa')]);router[_0xd2d3('0x8')]('/users',auth[_0xd2d3('0x9')](),controller[_0xd2d3('0xb')]);router[_0xd2d3('0x8')](_0xd2d3('0xc'),auth['isAuthenticated'](),controller[_0xd2d3('0xd')]);router[_0xd2d3('0xe')]('/',auth['isAuthenticated'](),controller[_0xd2d3('0xf')]);router[_0xd2d3('0x10')](_0xd2d3('0xc'),controller[_0xd2d3('0x11')]);router[_0xd2d3('0x12')](_0xd2d3('0xc'),auth[_0xd2d3('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 40e874d..fdfd7f8 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 _0x578c=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x21929f,_0xb96182){var _0x1a6077=function(_0x209786){while(--_0x209786){_0x21929f['push'](_0x21929f['shift']());}};_0x1a6077(++_0xb96182);}(_0x578c,0x158));var _0xc578=function(_0x3e68f3,_0x1ec053){_0x3e68f3=_0x3e68f3-0x0;var _0x27ee2e=_0x578c[_0x3e68f3];return _0x27ee2e;};'use strict';var Sequelize=require(_0xc578('0x0'));module[_0xc578('0x1')]={'body':{'type':Sequelize[_0xc578('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc578('0x4')]('in','out'),'defaultValue':_0xc578('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc578('0x6')]},'providerName':{'type':Sequelize[_0xc578('0x7')]},'providerResponse':{'type':Sequelize[_0xc578('0x2')]}}; \ No newline at end of file +var _0xc224=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x3afeda,_0x4b249f){var _0xb4c759=function(_0x4db382){while(--_0x4db382){_0x3afeda['push'](_0x3afeda['shift']());}};_0xb4c759(++_0x4b249f);}(_0xc224,0x1af));var _0x4c22=function(_0x5614ed,_0x180602){_0x5614ed=_0x5614ed-0x0;var _0xd0b252=_0xc224[_0x5614ed];return _0xd0b252;};'use strict';var Sequelize=require(_0x4c22('0x0'));module[_0x4c22('0x1')]={'body':{'type':Sequelize[_0x4c22('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4c22('0x4')]('in',_0x4c22('0x5')),'defaultValue':_0x4c22('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4c22('0x6')]},'providerName':{'type':Sequelize[_0x4c22('0x7')]},'providerResponse':{'type':Sequelize[_0x4c22('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 4faa73f..55c5125 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 _0xd6e0=['../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','client','http','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','chat-interactions','accept','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','event','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','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'];(function(_0x6c70aa,_0x14bea7){var _0x31dbf0=function(_0x1488a0){while(--_0x1488a0){_0x6c70aa['push'](_0x6c70aa['shift']());}};_0x31dbf0(++_0x14bea7);}(_0xd6e0,0x6d));var _0x0d6e=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0xd6e0[_0x1505e5];return _0x5b1dcd;};'use strict';var emlformat=require(_0x0d6e('0x0'));var rimraf=require(_0x0d6e('0x1'));var zipdir=require(_0x0d6e('0x2'));var jsonpatch=require(_0x0d6e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d6e('0x4'));var Mustache=require(_0x0d6e('0x5'));var util=require(_0x0d6e('0x6'));var path=require(_0x0d6e('0x7'));var sox=require(_0x0d6e('0x8'));var csv=require('to-csv');var ejs=require(_0x0d6e('0x9'));var fs=require('fs');var fs_extra=require(_0x0d6e('0xa'));var _=require(_0x0d6e('0xb'));var squel=require(_0x0d6e('0xc'));var crypto=require(_0x0d6e('0xd'));var jsforce=require(_0x0d6e('0xe'));var deskjs=require(_0x0d6e('0xf'));var toCsv=require(_0x0d6e('0x10'));var querystring=require(_0x0d6e('0x11'));var Papa=require('papaparse');var Redis=require(_0x0d6e('0x12'));var authService=require(_0x0d6e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0d6e('0x14'));var hardwareService=require(_0x0d6e('0x15'));var logger=require(_0x0d6e('0x16'))(_0x0d6e('0x17'));var utils=require(_0x0d6e('0x18'));var config=require(_0x0d6e('0x19'));var licenseUtil=require(_0x0d6e('0x1a'));var db=require(_0x0d6e('0x1b'))['db'];config['redis']=_[_0x0d6e('0x1c')](config['redis'],{'host':_0x0d6e('0x1d'),'port':0x18eb});var socket=require(_0x0d6e('0x1e'))(new Redis(config[_0x0d6e('0x1f')]));require(_0x0d6e('0x20'))[_0x0d6e('0x21')](socket);var jayson=require(_0x0d6e('0x22'));var client=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232c});var client9002=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x3f4a63,_0x117e93,_0x3352ac,_0x448e0b){return new BPromise(function(_0x2cff53,_0xdd2c5f){var _0x3d601a=_0x448e0b||client;return _0x3d601a['request'](_0x3f4a63,_0x3352ac)['then'](function(_0x3477c8){logger['info'](_0x0d6e('0x25'),_0x117e93,'request\x20sent');logger[_0x0d6e('0x26')](_0x0d6e('0x27'),_0x117e93,'request\x20sent',JSON[_0x0d6e('0x28')](_0x3477c8));if(_0x3477c8[_0x0d6e('0x29')]){if(_0x3477c8[_0x0d6e('0x29')]['code']===0x1f4){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);return _0xdd2c5f(_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);}logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8['error'][_0x0d6e('0x2a')]);return _0x2cff53(_0x3477c8['error'][_0x0d6e('0x2a')]);}else{logger[_0x0d6e('0x2b')](_0x0d6e('0x25'),_0x117e93,_0x0d6e('0x2c'));_0x2cff53(_0x3477c8['result'][_0x0d6e('0x2a')]);}})['catch'](function(_0x9cf683){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x9cf683);_0xdd2c5f(_0x9cf683);});});}function respondWithStatusCode(_0x166ec9,_0x2a7490){_0x2a7490=_0x2a7490||0xcc;return function(_0x3ae998){if(_0x3ae998){return _0x166ec9[_0x0d6e('0x2d')](_0x2a7490);}return _0x166ec9[_0x0d6e('0x2e')](_0x2a7490)[_0x0d6e('0x2f')]();};}function respondWithResult(_0x30d853,_0xe8fa){_0xe8fa=_0xe8fa||0xc8;return function(_0x5a357e){if(_0x5a357e){return _0x30d853['status'](_0xe8fa)[_0x0d6e('0x30')](_0x5a357e);}};}function respondWithFilteredResult(_0x29a0f8,_0x43cb7a){return function(_0x3bbdc4){if(_0x3bbdc4){var _0x1c38ab=typeof _0x43cb7a[_0x0d6e('0x31')]===_0x0d6e('0x32')&&typeof _0x43cb7a[_0x0d6e('0x33')]===_0x0d6e('0x32');var _0x133355=_0x3bbdc4[_0x0d6e('0x34')];var _0x5413c6=_0x1c38ab?0x0:_0x43cb7a[_0x0d6e('0x31')];var _0x384c81=_0x1c38ab?_0x3bbdc4[_0x0d6e('0x34')]:_0x43cb7a[_0x0d6e('0x31')]+_0x43cb7a[_0x0d6e('0x33')];var _0x1ce21e;if(_0x384c81>=_0x133355){_0x384c81=_0x133355;_0x1ce21e=0xc8;}else{_0x1ce21e=0xce;}_0x29a0f8[_0x0d6e('0x2e')](_0x1ce21e);return _0x29a0f8[_0x0d6e('0x35')]('Content-Range',_0x5413c6+'-'+_0x384c81+'/'+_0x133355)[_0x0d6e('0x30')](_0x3bbdc4);}return null;};}function patchUpdates(_0x255e8f){return function(_0xc4092){try{jsonpatch[_0x0d6e('0x36')](_0xc4092,_0x255e8f,!![]);}catch(_0x578061){return BPromise[_0x0d6e('0x37')](_0x578061);}return _0xc4092[_0x0d6e('0x38')]();};}function saveUpdates(_0x21576d,_0x244e22){return function(_0x42f7){if(_0x42f7){return _0x42f7['update'](_0x21576d)[_0x0d6e('0x39')](function(_0x4e0375){return _0x4e0375;});}return null;};}function removeEntity(_0x1444a9,_0x50de86){return function(_0x1b9139){if(_0x1b9139){return _0x1b9139[_0x0d6e('0x3a')]()['then'](function(){_0x1444a9[_0x0d6e('0x2e')](0xcc)[_0x0d6e('0x2f')]();});}};}function handleEntityNotFound(_0x46ba49,_0x18009e){return function(_0x5c88be){if(!_0x5c88be){_0x46ba49[_0x0d6e('0x2d')](0x194);}return _0x5c88be;};}function handleError(_0x2224c6,_0x51643f){_0x51643f=_0x51643f||0x1f4;return function(_0xbfa059){logger[_0x0d6e('0x29')](_0xbfa059[_0x0d6e('0x3b')]);if(_0xbfa059[_0x0d6e('0x3c')]){delete _0xbfa059[_0x0d6e('0x3c')];}_0x2224c6['status'](_0x51643f)[_0x0d6e('0x3d')](_0xbfa059);};}exports['index']=function(_0x6a0e02,_0x5299b9){var _0x3144e0={},_0x411942={},_0x3aee44={'count':0x0,'rows':[]};var _0xedb01e=_['map'](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')],function(_0x4bede1){return{'name':_0x4bede1[_0x0d6e('0x40')],'type':_0x4bede1[_0x0d6e('0x41')][_0x0d6e('0x42')]};});_0x411942[_0x0d6e('0x43')]=_[_0x0d6e('0x44')](_0xedb01e,_0x0d6e('0x3c'));_0x411942['query']=_[_0x0d6e('0x45')](_0x6a0e02[_0x0d6e('0x46')]);_0x411942[_0x0d6e('0x47')]=_['intersection'](_0x411942[_0x0d6e('0x43')],_0x411942[_0x0d6e('0x46')]);_0x3144e0[_0x0d6e('0x48')]=_[_0x0d6e('0x49')](_0x411942[_0x0d6e('0x43')],qs[_0x0d6e('0x4a')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x3144e0[_0x0d6e('0x48')]=_0x3144e0[_0x0d6e('0x48')][_0x0d6e('0x4b')]?_0x3144e0[_0x0d6e('0x48')]:_0x411942['model'];if(!_0x6a0e02['query'][_0x0d6e('0x4c')](_0x0d6e('0x4d'))){_0x3144e0[_0x0d6e('0x33')]=qs[_0x0d6e('0x33')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x33')]);_0x3144e0[_0x0d6e('0x31')]=qs[_0x0d6e('0x31')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x31')]);}_0x3144e0[_0x0d6e('0x4e')]=qs[_0x0d6e('0x4f')](_0x6a0e02[_0x0d6e('0x46')]['sort']);_0x3144e0[_0x0d6e('0x50')]=qs['filters'](_['pick'](_0x6a0e02[_0x0d6e('0x46')],_0x411942[_0x0d6e('0x47')]),_0xedb01e);if(_0x6a0e02['query']['filter']){_0x3144e0['where']=_[_0x0d6e('0x51')](_0x3144e0[_0x0d6e('0x50')],{'$or':_[_0x0d6e('0x44')](_0xedb01e,function(_0x412f54){if(_0x412f54['type']!=='VIRTUAL'){var _0x5b114d={};_0x5b114d[_0x412f54[_0x0d6e('0x3c')]]={'$like':'%'+_0x6a0e02['query'][_0x0d6e('0x52')]+'%'};return _0x5b114d;}})});}_0x3144e0=_[_0x0d6e('0x51')]({},_0x3144e0,_0x6a0e02[_0x0d6e('0x53')]);var _0x4e5068={'where':_0x3144e0['where']};return db[_0x0d6e('0x3e')]['count'](_0x4e5068)['then'](function(_0x468e7f){_0x3aee44[_0x0d6e('0x34')]=_0x468e7f;if(_0x6a0e02['query'][_0x0d6e('0x54')]){_0x3144e0[_0x0d6e('0x55')]=[{'all':!![]}];}return db[_0x0d6e('0x3e')][_0x0d6e('0x56')](_0x3144e0);})[_0x0d6e('0x39')](function(_0x4ca73e){_0x3aee44['rows']=_0x4ca73e;return _0x3aee44;})[_0x0d6e('0x39')](respondWithFilteredResult(_0x5299b9,_0x3144e0))[_0x0d6e('0x57')](handleError(_0x5299b9,null));};exports[_0x0d6e('0x58')]=function(_0x23c04a,_0x3a46fd){var _0x396b58={'raw':!![],'where':{'id':_0x23c04a[_0x0d6e('0x59')]['id']}},_0x2a9341={};_0x2a9341['model']=_[_0x0d6e('0x45')](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')]);_0x2a9341[_0x0d6e('0x46')]=_[_0x0d6e('0x45')](_0x23c04a[_0x0d6e('0x46')]);_0x2a9341[_0x0d6e('0x47')]=_[_0x0d6e('0x49')](_0x2a9341[_0x0d6e('0x43')],_0x2a9341[_0x0d6e('0x46')]);_0x396b58['attributes']=_['intersection'](_0x2a9341['model'],qs[_0x0d6e('0x4a')](_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x396b58[_0x0d6e('0x48')]=_0x396b58['attributes'][_0x0d6e('0x4b')]?_0x396b58[_0x0d6e('0x48')]:_0x2a9341[_0x0d6e('0x43')];if(_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x54')]){_0x396b58[_0x0d6e('0x55')]=[{'all':!![]}];}_0x396b58=_[_0x0d6e('0x51')]({},_0x396b58,_0x23c04a['options']);return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')](_0x396b58)[_0x0d6e('0x39')](handleEntityNotFound(_0x3a46fd,null))[_0x0d6e('0x39')](respondWithResult(_0x3a46fd,null))[_0x0d6e('0x57')](handleError(_0x3a46fd,null));};exports[_0x0d6e('0x5b')]=function(_0x956447,_0x241cea){return db[_0x0d6e('0x3e')]['create'](_0x956447[_0x0d6e('0x5c')],{})[_0x0d6e('0x39')](respondWithResult(_0x241cea,0xc9))[_0x0d6e('0x57')](handleError(_0x241cea,null));};exports[_0x0d6e('0x5d')]=function(_0x35d0f3,_0x5b0b8c){if(_0x35d0f3[_0x0d6e('0x5c')]['id']){delete _0x35d0f3[_0x0d6e('0x5c')]['id'];}return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x35d0f3['params']['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5b0b8c,null))[_0x0d6e('0x39')](saveUpdates(_0x35d0f3[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](respondWithResult(_0x5b0b8c,null))[_0x0d6e('0x57')](handleError(_0x5b0b8c,null));};exports[_0x0d6e('0x3a')]=function(_0x6f2fe9,_0x20819e){return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x6f2fe9[_0x0d6e('0x59')]['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x20819e,null))[_0x0d6e('0x39')](removeEntity(_0x20819e,null))[_0x0d6e('0x57')](handleError(_0x20819e,null));};exports[_0x0d6e('0x5e')]=function(_0x314ca2,_0x50e9d5){return db[_0x0d6e('0x3e')][_0x0d6e('0x5e')]()[_0x0d6e('0x39')](respondWithResult(_0x50e9d5,null))[_0x0d6e('0x57')](handleError(_0x50e9d5,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x60')]=function(_0x560857,_0x5704c9,_0xfc96d1){var _0x55099b={'agent':{},'channel':'chat'};if(_0x560857[_0x0d6e('0x5c')]['id']){delete _0x560857['body']['id'];}_0x560857['body']['read']=!![];_0x560857[_0x0d6e('0x5c')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x560857['body'][_0x0d6e('0x61')]=_0x560857['body']['UserId']||_0x560857[_0x0d6e('0x62')]['id'];_0x55099b['agent']['id']=_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')];return db['ChatMessage'][_0x0d6e('0x5a')]({'where':{'id':_0x560857['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5704c9,null))[_0x0d6e('0x39')](saveUpdates(_0x560857[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](function(_0x29988e){if(_0x29988e){_0x55099b[_0x0d6e('0x2a')]=_0x29988e[_0x0d6e('0x63')]({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x29988e[_0x0d6e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5704c9,null))['then'](function(_0x363a9c){if(_0x363a9c){return _0x363a9c[_0x0d6e('0x5d')]({'UserId':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'read1stAt':_['isNil'](_0x363a9c[_0x0d6e('0x66')])?moment()['format'](_0x0d6e('0x67')):undefined});}return null;})['then'](function(_0x48c392){if(_0x48c392){_0x55099b['interaction']=_0x48c392['get']({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x68'),_0x560857['user']['id'],_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')],_0x560857['user'][_0x0d6e('0x69')],_0x55099b[_0x0d6e('0x6a')]['id'],_0x560857[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x560857[_0x0d6e('0x5c')]):'null');return respondWithRpcPromise(_0x0d6e('0x6b'),_0x0d6e('0x6c'),_0x55099b);}return null;})[_0x0d6e('0x39')](function(_0x43fc24){var _0x2c0d3b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x43fc24[_0x0d6e('0x2a')]['ContactId'];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x2c0d3b,{'type':db[_0x0d6e('0x6e')]['QueryTypes'][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0xe7ed40){return _0xe7ed40;});})[_0x0d6e('0x39')](function(_0x15e816){if(_0x15e816){_0x55099b['message'][_0x0d6e('0x70')]=_0x15e816[0x0];if(!_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db[_0x0d6e('0x71')][_0x0d6e('0x5a')]({'where':{'id':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':_0x0d6e('0x72')},'attributes':['id',_0x0d6e('0x3c'),_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x33b5ba){if(!_0x33b5ba)return null;_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x33b5ba;return _0x55099b;})['then'](function(_0x2827ea){if(_0x2827ea){if(_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x75')]){_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x76')]=util['format'](_0x0d6e('0x77'),_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x55099b[_0x0d6e('0x78')];_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x55099b[_0x0d6e('0x78')];_0x55099b['message']['event']=_0x0d6e('0x60');return respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x7b'),'message':_[_0x0d6e('0x51')](_0x55099b[_0x0d6e('0x2a')],JSON['parse'](_0x55099b[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002)[_0x0d6e('0x39')](function(){return _0x55099b;});}return _0x55099b;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x5704c9,null))[_0x0d6e('0x57')](handleError(_0x5704c9,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x37')]=function(_0x537f6b,_0x49f82f,_0x34851f){var _0x583830={'agent':{},'channel':'chat'};if(_0x537f6b[_0x0d6e('0x5c')]['id']){delete _0x537f6b['body']['id'];}_0x537f6b['body'][_0x0d6e('0x61')]=_0x537f6b[_0x0d6e('0x5c')]['UserId']||_0x537f6b[_0x0d6e('0x62')]['id'];_0x583830[_0x0d6e('0x72')]['id']=_0x537f6b['body'][_0x0d6e('0x61')];return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))['then'](function(_0x5dc060){if(_0x5dc060){_0x583830['message']=_0x5dc060['get']({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x5dc060[_0x0d6e('0x65')]}});}return null;})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))[_0x0d6e('0x39')](function(_0x3abfef){if(_0x3abfef){_0x583830[_0x0d6e('0x6a')]=_0x3abfef[_0x0d6e('0x63')]({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x7d'),_0x537f6b[_0x0d6e('0x62')]['id'],_0x537f6b['user']['name'],_0x537f6b['user'][_0x0d6e('0x69')],_0x583830[_0x0d6e('0x6a')]['id'],_0x537f6b[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x537f6b['body']):'null');return respondWithRpcPromise(_0x0d6e('0x7e'),_0x0d6e('0x7f'),_0x583830);}return null;})[_0x0d6e('0x39')](function(_0x151510){var _0x5b6c54=_0x0d6e('0x80')+_0x151510[_0x0d6e('0x2a')][_0x0d6e('0x81')];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x5b6c54,{'type':db[_0x0d6e('0x6e')][_0x0d6e('0x82')][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0x4c8f14){return _0x4c8f14;});})[_0x0d6e('0x39')](function(_0x4d0fa9){if(_0x4d0fa9){_0x583830[_0x0d6e('0x2a')]['contact']=_0x4d0fa9[0x0];if(!_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db['User'][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':'agent'},'attributes':['id','name',_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x2114db){if(!_0x2114db)return null;_0x583830[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x2114db;return _0x583830;})['then'](function(_0x2dafb0){if(_0x2dafb0){_0x2dafb0['message'][_0x0d6e('0x76')]=util['format']('SIP/%s',_0x537f6b[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x83')]=_0x0d6e('0x37');respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x84'),'message':_['merge'](_0x583830[_0x0d6e('0x2a')],JSON[_0x0d6e('0x85')](_0x583830[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002);return _0x583830;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x49f82f,null))['catch'](handleError(_0x49f82f,null));}; \ No newline at end of file +var _0xeddd=['user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','motionChannel','reject','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','update','body','params','describe','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x292fbe,_0x1148ec){var _0x53ddce=function(_0x1890e5){while(--_0x1890e5){_0x292fbe['push'](_0x292fbe['shift']());}};_0x53ddce(++_0x1148ec);}(_0xeddd,0xa8));var _0xdedd=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xeddd[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require(_0xdedd('0x0'));var rimraf=require(_0xdedd('0x1'));var zipdir=require(_0xdedd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdedd('0x3'));var moment=require('moment');var BPromise=require(_0xdedd('0x4'));var Mustache=require(_0xdedd('0x5'));var util=require(_0xdedd('0x6'));var path=require(_0xdedd('0x7'));var sox=require(_0xdedd('0x8'));var csv=require(_0xdedd('0x9'));var ejs=require(_0xdedd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdedd('0xb'));var squel=require('squel');var crypto=require(_0xdedd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdedd('0xd'));var toCsv=require(_0xdedd('0x9'));var querystring=require(_0xdedd('0xe'));var Papa=require(_0xdedd('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdedd('0x10'));var logger=require(_0xdedd('0x11'))(_0xdedd('0x12'));var utils=require(_0xdedd('0x13'));var config=require(_0xdedd('0x14'));var licenseUtil=require(_0xdedd('0x15'));var db=require(_0xdedd('0x16'))['db'];config[_0xdedd('0x17')]=_[_0xdedd('0x18')](config[_0xdedd('0x17')],{'host':_0xdedd('0x19'),'port':0x18eb});var socket=require(_0xdedd('0x1a'))(new Redis(config[_0xdedd('0x17')]));require(_0xdedd('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdedd('0x1c')][_0xdedd('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xdedd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x491595,_0x443358,_0x3d6f09,_0x228aa1){return new BPromise(function(_0x20bb0f,_0x447a06){var _0x263938=_0x228aa1||client;return _0x263938[_0xdedd('0x1e')](_0x491595,_0x3d6f09)[_0xdedd('0x1f')](function(_0x220d39){logger[_0xdedd('0x20')]('ChatMessage,\x20%s,\x20%s',_0x443358,_0xdedd('0x21'));logger[_0xdedd('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x443358,_0xdedd('0x21'),JSON[_0xdedd('0x23')](_0x220d39));if(_0x220d39[_0xdedd('0x24')]){if(_0x220d39[_0xdedd('0x24')][_0xdedd('0x25')]===0x1f4){logger[_0xdedd('0x24')](_0xdedd('0x26'),_0x443358,_0x220d39['error']['message']);return _0x447a06(_0x220d39[_0xdedd('0x24')][_0xdedd('0x27')]);}logger['error'](_0xdedd('0x26'),_0x443358,_0x220d39[_0xdedd('0x24')]['message']);return _0x20bb0f(_0x220d39[_0xdedd('0x24')][_0xdedd('0x27')]);}else{logger['info'](_0xdedd('0x26'),_0x443358,_0xdedd('0x21'));_0x20bb0f(_0x220d39[_0xdedd('0x28')][_0xdedd('0x27')]);}})[_0xdedd('0x29')](function(_0x1ef903){logger['error'](_0xdedd('0x26'),_0x443358,_0x1ef903);_0x447a06(_0x1ef903);});});}function respondWithStatusCode(_0x42c8f7,_0x4abc9e){_0x4abc9e=_0x4abc9e||0xcc;return function(_0x316a9b){if(_0x316a9b){return _0x42c8f7[_0xdedd('0x2a')](_0x4abc9e);}return _0x42c8f7[_0xdedd('0x2b')](_0x4abc9e)[_0xdedd('0x2c')]();};}function respondWithResult(_0x8a1418,_0x73d9de){_0x73d9de=_0x73d9de||0xc8;return function(_0x5f0a15){if(_0x5f0a15){return _0x8a1418[_0xdedd('0x2b')](_0x73d9de)[_0xdedd('0x2d')](_0x5f0a15);}};}function respondWithFilteredResult(_0xa7d00b,_0x1051c6){return function(_0x2f0a29){if(_0x2f0a29){var _0x5bb57f=typeof _0x1051c6['offset']===_0xdedd('0x2e')&&typeof _0x1051c6['limit']===_0xdedd('0x2e');var _0x18a75d=_0x2f0a29[_0xdedd('0x2f')];var _0x5370c8=_0x5bb57f?0x0:_0x1051c6[_0xdedd('0x30')];var _0x351624=_0x5bb57f?_0x2f0a29[_0xdedd('0x2f')]:_0x1051c6['offset']+_0x1051c6[_0xdedd('0x31')];var _0x456329;if(_0x351624>=_0x18a75d){_0x351624=_0x18a75d;_0x456329=0xc8;}else{_0x456329=0xce;}_0xa7d00b[_0xdedd('0x2b')](_0x456329);return _0xa7d00b[_0xdedd('0x32')](_0xdedd('0x33'),_0x5370c8+'-'+_0x351624+'/'+_0x18a75d)[_0xdedd('0x2d')](_0x2f0a29);}return null;};}function patchUpdates(_0x3fa081){return function(_0x38d046){try{jsonpatch[_0xdedd('0x34')](_0x38d046,_0x3fa081,!![]);}catch(_0xbba0f2){return BPromise['reject'](_0xbba0f2);}return _0x38d046[_0xdedd('0x35')]();};}function saveUpdates(_0x4aa293,_0x12857c){return function(_0x28b169){if(_0x28b169){return _0x28b169['update'](_0x4aa293)[_0xdedd('0x1f')](function(_0x475abf){return _0x475abf;});}return null;};}function removeEntity(_0x17b537,_0x521f19){return function(_0x593c63){if(_0x593c63){return _0x593c63[_0xdedd('0x36')]()['then'](function(){_0x17b537[_0xdedd('0x2b')](0xcc)[_0xdedd('0x2c')]();});}};}function handleEntityNotFound(_0x53cc94,_0x590a3a){return function(_0x198416){if(!_0x198416){_0x53cc94[_0xdedd('0x2a')](0x194);}return _0x198416;};}function handleError(_0x4715d3,_0x310ff1){_0x310ff1=_0x310ff1||0x1f4;return function(_0x4b88be){logger[_0xdedd('0x24')](_0x4b88be[_0xdedd('0x37')]);if(_0x4b88be['name']){delete _0x4b88be[_0xdedd('0x38')];}_0x4715d3['status'](_0x310ff1)[_0xdedd('0x39')](_0x4b88be);};}exports[_0xdedd('0x3a')]=function(_0x283886,_0x31837f){var _0x454d74={},_0xeb4285={},_0x2692fe={'count':0x0,'rows':[]};var _0x5a6779=_[_0xdedd('0x3b')](db[_0xdedd('0x3c')]['rawAttributes'],function(_0xadc8e1){return{'name':_0xadc8e1[_0xdedd('0x3d')],'type':_0xadc8e1[_0xdedd('0x3e')][_0xdedd('0x3f')]};});_0xeb4285[_0xdedd('0x40')]=_[_0xdedd('0x3b')](_0x5a6779,_0xdedd('0x38'));_0xeb4285[_0xdedd('0x41')]=_[_0xdedd('0x42')](_0x283886[_0xdedd('0x41')]);_0xeb4285[_0xdedd('0x43')]=_[_0xdedd('0x44')](_0xeb4285[_0xdedd('0x40')],_0xeb4285[_0xdedd('0x41')]);_0x454d74[_0xdedd('0x45')]=_[_0xdedd('0x44')](_0xeb4285[_0xdedd('0x40')],qs[_0xdedd('0x46')](_0x283886['query'][_0xdedd('0x46')]));_0x454d74[_0xdedd('0x45')]=_0x454d74[_0xdedd('0x45')][_0xdedd('0x47')]?_0x454d74[_0xdedd('0x45')]:_0xeb4285[_0xdedd('0x40')];if(!_0x283886[_0xdedd('0x41')]['hasOwnProperty'](_0xdedd('0x48'))){_0x454d74[_0xdedd('0x31')]=qs['limit'](_0x283886[_0xdedd('0x41')][_0xdedd('0x31')]);_0x454d74[_0xdedd('0x30')]=qs[_0xdedd('0x30')](_0x283886[_0xdedd('0x41')][_0xdedd('0x30')]);}_0x454d74[_0xdedd('0x49')]=qs[_0xdedd('0x4a')](_0x283886[_0xdedd('0x41')][_0xdedd('0x4a')]);_0x454d74[_0xdedd('0x4b')]=qs[_0xdedd('0x43')](_[_0xdedd('0x4c')](_0x283886[_0xdedd('0x41')],_0xeb4285[_0xdedd('0x43')]),_0x5a6779);if(_0x283886[_0xdedd('0x41')]['filter']){_0x454d74['where']=_[_0xdedd('0x4d')](_0x454d74['where'],{'$or':_['map'](_0x5a6779,function(_0x864f11){if(_0x864f11[_0xdedd('0x3e')]!==_0xdedd('0x4e')){var _0x3bfedc={};_0x3bfedc[_0x864f11[_0xdedd('0x38')]]={'$like':'%'+_0x283886[_0xdedd('0x41')][_0xdedd('0x4f')]+'%'};return _0x3bfedc;}})});}_0x454d74=_[_0xdedd('0x4d')]({},_0x454d74,_0x283886[_0xdedd('0x50')]);var _0x2e805d={'where':_0x454d74['where']};return db['ChatMessage'][_0xdedd('0x2f')](_0x2e805d)[_0xdedd('0x1f')](function(_0x374e06){_0x2692fe[_0xdedd('0x2f')]=_0x374e06;if(_0x283886['query'][_0xdedd('0x51')]){_0x454d74[_0xdedd('0x52')]=[{'all':!![]}];}return db[_0xdedd('0x3c')][_0xdedd('0x53')](_0x454d74);})[_0xdedd('0x1f')](function(_0xe39b0){_0x2692fe[_0xdedd('0x54')]=_0xe39b0;return _0x2692fe;})[_0xdedd('0x1f')](respondWithFilteredResult(_0x31837f,_0x454d74))[_0xdedd('0x29')](handleError(_0x31837f,null));};exports[_0xdedd('0x55')]=function(_0x227602,_0x7697a7){var _0x4932bd={'raw':!![],'where':{'id':_0x227602['params']['id']}},_0x4bfc9c={};_0x4bfc9c[_0xdedd('0x40')]=_[_0xdedd('0x42')](db[_0xdedd('0x3c')]['rawAttributes']);_0x4bfc9c[_0xdedd('0x41')]=_[_0xdedd('0x42')](_0x227602[_0xdedd('0x41')]);_0x4bfc9c[_0xdedd('0x43')]=_[_0xdedd('0x44')](_0x4bfc9c[_0xdedd('0x40')],_0x4bfc9c[_0xdedd('0x41')]);_0x4932bd['attributes']=_[_0xdedd('0x44')](_0x4bfc9c['model'],qs['fields'](_0x227602[_0xdedd('0x41')][_0xdedd('0x46')]));_0x4932bd['attributes']=_0x4932bd[_0xdedd('0x45')]['length']?_0x4932bd[_0xdedd('0x45')]:_0x4bfc9c[_0xdedd('0x40')];if(_0x227602['query'][_0xdedd('0x51')]){_0x4932bd[_0xdedd('0x52')]=[{'all':!![]}];}_0x4932bd=_['merge']({},_0x4932bd,_0x227602['options']);return db[_0xdedd('0x3c')][_0xdedd('0x56')](_0x4932bd)[_0xdedd('0x1f')](handleEntityNotFound(_0x7697a7,null))[_0xdedd('0x1f')](respondWithResult(_0x7697a7,null))[_0xdedd('0x29')](handleError(_0x7697a7,null));};exports[_0xdedd('0x57')]=function(_0x2e7040,_0x5d3cd1){return db[_0xdedd('0x3c')][_0xdedd('0x57')](_0x2e7040['body'],{})['then'](respondWithResult(_0x5d3cd1,0xc9))['catch'](handleError(_0x5d3cd1,null));};exports[_0xdedd('0x58')]=function(_0x33b665,_0x2ad4b3){if(_0x33b665['body']['id']){delete _0x33b665[_0xdedd('0x59')]['id'];}return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x33b665['params']['id']}})[_0xdedd('0x1f')](handleEntityNotFound(_0x2ad4b3,null))[_0xdedd('0x1f')](saveUpdates(_0x33b665[_0xdedd('0x59')],null))[_0xdedd('0x1f')](respondWithResult(_0x2ad4b3,null))[_0xdedd('0x29')](handleError(_0x2ad4b3,null));};exports[_0xdedd('0x36')]=function(_0x8d74ba,_0x51920b){return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x8d74ba[_0xdedd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x51920b,null))[_0xdedd('0x1f')](removeEntity(_0x51920b,null))[_0xdedd('0x29')](handleError(_0x51920b,null));};exports[_0xdedd('0x5b')]=function(_0x587ee1,_0x48cf67){return db['ChatMessage'][_0xdedd('0x5b')]()['then'](respondWithResult(_0x48cf67,null))[_0xdedd('0x29')](handleError(_0x48cf67,null));};var interaction_log=require(_0xdedd('0x11'))(_0xdedd('0x5c'));exports[_0xdedd('0x5d')]=function(_0x3f4518,_0x5daa53,_0x240c43){var _0x48fcce={'agent':{},'channel':'chat'};if(_0x3f4518['body']['id']){delete _0x3f4518[_0xdedd('0x59')]['id'];}_0x3f4518['body'][_0xdedd('0x5e')]=!![];_0x3f4518['body'][_0xdedd('0x5f')]=moment()['format'](_0xdedd('0x60'));_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')]=_0x3f4518[_0xdedd('0x59')]['UserId']||_0x3f4518[_0xdedd('0x62')]['id'];_0x48fcce[_0xdedd('0x63')]['id']=_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')];return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x3f4518['params']['id'],'UserId':null}})[_0xdedd('0x1f')](handleEntityNotFound(_0x5daa53,null))[_0xdedd('0x1f')](saveUpdates(_0x3f4518[_0xdedd('0x59')],null))[_0xdedd('0x1f')](function(_0x1c360d){if(_0x1c360d){_0x48fcce['message']=_0x1c360d[_0xdedd('0x64')]({'plain':!![]});return db[_0xdedd('0x65')][_0xdedd('0x56')]({'where':{'id':_0x1c360d[_0xdedd('0x66')]}});}return null;})[_0xdedd('0x1f')](handleEntityNotFound(_0x5daa53,null))[_0xdedd('0x1f')](function(_0x52ba38){if(_0x52ba38){return _0x52ba38[_0xdedd('0x58')]({'UserId':_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')],'read1stAt':_[_0xdedd('0x67')](_0x52ba38['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdedd('0x1f')](function(_0x45c484){if(_0x45c484){_0x48fcce[_0xdedd('0x68')]=_0x45c484[_0xdedd('0x64')]({'plain':!![]});interaction_log[_0xdedd('0x20')](_0xdedd('0x69'),_0x3f4518[_0xdedd('0x62')]['id'],_0x3f4518[_0xdedd('0x62')][_0xdedd('0x38')],_0x3f4518['user'][_0xdedd('0x6a')],_0x48fcce[_0xdedd('0x68')]['id'],_0x3f4518[_0xdedd('0x59')]?JSON[_0xdedd('0x23')](_0x3f4518[_0xdedd('0x59')]):'null');return respondWithRpcPromise(_0xdedd('0x6b'),_0xdedd('0x6c'),_0x48fcce);}return null;})[_0xdedd('0x1f')](function(_0x3ad6de){var _0x188041='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ad6de[_0xdedd('0x27')]['ContactId'];return db[_0xdedd('0x6d')][_0xdedd('0x41')](_0x188041,{'type':db[_0xdedd('0x6e')][_0xdedd('0x6f')][_0xdedd('0x70')],'raw':!![]})['then'](function(_0x2b69a5){return _0x2b69a5;});})[_0xdedd('0x1f')](function(_0x309bef){if(_0x309bef){_0x48fcce[_0xdedd('0x27')][_0xdedd('0x71')]=_0x309bef[0x0];if(!_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')])return;return db[_0xdedd('0x72')]['find']({'where':{'id':_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')],'role':_0xdedd('0x63')},'attributes':['id',_0xdedd('0x38'),_0xdedd('0x73'),_0xdedd('0x74'),'internal'],'raw':!![]});}return null;})[_0xdedd('0x1f')](function(_0x2002f7){if(!_0x2002f7)return null;_0x48fcce[_0xdedd('0x27')]['agent']=_0x2002f7;return _0x48fcce;})[_0xdedd('0x1f')](function(_0x1d0dcd){if(_0x1d0dcd){if(_0x3f4518[_0xdedd('0x59')]['manual']){_0x48fcce['message'][_0xdedd('0x75')]=util[_0xdedd('0x76')](_0xdedd('0x77'),_0x3f4518[_0xdedd('0x62')][_0xdedd('0x38')]);_0x48fcce['message']['channel']=_0x48fcce['channel'];_0x48fcce[_0xdedd('0x27')]['motionChannel']=_0x48fcce[_0xdedd('0x78')];_0x48fcce[_0xdedd('0x27')][_0xdedd('0x79')]=_0xdedd('0x5d');return respondWithRpcPromise(_0xdedd('0x7a'),_0xdedd('0x7a'),{'event':_0xdedd('0x7b'),'message':_['merge'](_0x48fcce[_0xdedd('0x27')],JSON[_0xdedd('0x7c')](_0x48fcce[_0xdedd('0x68')]['formData']))},client9002)['then'](function(){return _0x48fcce;});}return _0x48fcce;}return null;})[_0xdedd('0x1f')](respondWithResult(_0x5daa53,null))[_0xdedd('0x29')](handleError(_0x5daa53,null));};var interaction_log=require(_0xdedd('0x11'))(_0xdedd('0x5c'));exports['reject']=function(_0x1ad572,_0x21915f,_0x58445){var _0x472d73={'agent':{},'channel':'chat'};if(_0x1ad572[_0xdedd('0x59')]['id']){delete _0x1ad572[_0xdedd('0x59')]['id'];}_0x1ad572['body'][_0xdedd('0x61')]=_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')]||_0x1ad572[_0xdedd('0x62')]['id'];_0x472d73['agent']['id']=_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')];return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x1ad572[_0xdedd('0x5a')]['id'],'UserId':null}})[_0xdedd('0x1f')](handleEntityNotFound(_0x21915f,null))[_0xdedd('0x1f')](function(_0x32d865){if(_0x32d865){_0x472d73[_0xdedd('0x27')]=_0x32d865['get']({'plain':!![]});return db[_0xdedd('0x65')]['find']({'where':{'id':_0x32d865[_0xdedd('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x21915f,null))[_0xdedd('0x1f')](function(_0x1ff0a1){if(_0x1ff0a1){_0x472d73['interaction']=_0x1ff0a1[_0xdedd('0x64')]({'plain':!![]});interaction_log[_0xdedd('0x20')](_0xdedd('0x7d'),_0x1ad572[_0xdedd('0x62')]['id'],_0x1ad572['user'][_0xdedd('0x38')],_0x1ad572[_0xdedd('0x62')][_0xdedd('0x6a')],_0x472d73[_0xdedd('0x68')]['id'],_0x1ad572['body']?JSON[_0xdedd('0x23')](_0x1ad572['body']):_0xdedd('0x7e'));return respondWithRpcPromise(_0xdedd('0x7f'),_0xdedd('0x80'),_0x472d73);}return null;})[_0xdedd('0x1f')](function(_0x564f39){var _0x33e75f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x564f39[_0xdedd('0x27')]['ContactId'];return db[_0xdedd('0x6d')]['query'](_0x33e75f,{'type':db[_0xdedd('0x6e')][_0xdedd('0x6f')][_0xdedd('0x70')],'raw':!![]})[_0xdedd('0x1f')](function(_0x4ed250){return _0x4ed250;});})[_0xdedd('0x1f')](function(_0x25f6d0){if(_0x25f6d0){_0x472d73[_0xdedd('0x27')]['contact']=_0x25f6d0[0x0];if(!_0x1ad572['body'][_0xdedd('0x61')])return;return db[_0xdedd('0x72')][_0xdedd('0x56')]({'where':{'id':_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')],'role':_0xdedd('0x63')},'attributes':['id',_0xdedd('0x38'),_0xdedd('0x73'),_0xdedd('0x74'),'internal'],'raw':!![]});}return null;})[_0xdedd('0x1f')](function(_0x4a2267){if(!_0x4a2267)return null;_0x472d73[_0xdedd('0x27')][_0xdedd('0x63')]=_0x4a2267;return _0x472d73;})[_0xdedd('0x1f')](function(_0x5a34e3){if(_0x5a34e3){_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x75')]=util[_0xdedd('0x76')](_0xdedd('0x77'),_0x1ad572[_0xdedd('0x62')][_0xdedd('0x38')]);_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x78')]=_0x472d73[_0xdedd('0x78')];_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x81')]=_0x472d73[_0xdedd('0x78')];_0x5a34e3['message']['event']=_0xdedd('0x82');respondWithRpcPromise(_0xdedd('0x7a'),_0xdedd('0x7a'),{'event':_0xdedd('0x83'),'message':_[_0xdedd('0x4d')](_0x472d73[_0xdedd('0x27')],JSON['parse'](_0x472d73['interaction'][_0xdedd('0x84')]))},client9002);return _0x472d73;}return null;})['then'](respondWithResult(_0x21915f,null))[_0xdedd('0x29')](handleError(_0x21915f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index f32bea1..5c838b0 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 _0x6108=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x6108,0x126));var _0x8610=function(_0xb276c0,_0x116692){_0xb276c0=_0xb276c0-0x0;var _0x3b5a6f=_0x6108[_0xb276c0];return _0x3b5a6f;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8610('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8610('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8610('0x2'),'afterDestroy':_0x8610('0x3')};function emitEvent(_0x454a13){return function(_0x57a33f,_0x59dc79,_0x3f3357){ChatMessageEvents[_0x8610('0x4')](_0x454a13+':'+_0x57a33f['id'],_0x57a33f);ChatMessageEvents[_0x8610('0x4')](_0x454a13,_0x57a33f);_0x3f3357(null);};}for(var e in events){if(events[_0x8610('0x5')](e)){var event=events[e];ChatMessage[_0x8610('0x6')](e,emitEvent(event));}}module[_0x8610('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x83aa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x57a2be,_0x2900b6){var _0x7f99d3=function(_0x1732b4){while(--_0x1732b4){_0x57a2be['push'](_0x57a2be['shift']());}};_0x7f99d3(++_0x2900b6);}(_0x83aa,0xb3));var _0xa83a=function(_0x5ade89,_0x2a90b0){_0x5ade89=_0x5ade89-0x0;var _0x272f1f=_0x83aa[_0x5ade89];return _0x272f1f;};'use strict';var EventEmitter=require(_0xa83a('0x0'));var ChatMessage=require(_0xa83a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa83a('0x2')](0x0);var events={'afterCreate':_0xa83a('0x3'),'afterUpdate':_0xa83a('0x4'),'afterDestroy':_0xa83a('0x5')};function emitEvent(_0x2a6180){return function(_0x2e0ddd,_0x2c72fe,_0xce83d9){ChatMessageEvents['emit'](_0x2a6180+':'+_0x2e0ddd['id'],_0x2e0ddd);ChatMessageEvents[_0xa83a('0x6')](_0x2a6180,_0x2e0ddd);_0xce83d9(null);};}for(var e in events){if(events[_0xa83a('0x7')](e)){var event=events[e];ChatMessage[_0xa83a('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index efa6672..593a053 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 _0xf05b=['fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','chat_messages'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf05b,0xbd));var _0xbf05=function(_0x458ad3,_0x1cc9fe){_0x458ad3=_0x458ad3-0x0;var _0x4f9c4d=_0xf05b[_0x458ad3];return _0x4f9c4d;};'use strict';var _=require(_0xbf05('0x0'));var util=require(_0xbf05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf05('0x2'));var BPromise=require(_0xbf05('0x3'));var rp=require(_0xbf05('0x4'));var fs=require('fs');var path=require(_0xbf05('0x5'));var rimraf=require(_0xbf05('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf05('0x7'));module[_0xbf05('0x8')]=function(_0x3f9c35,_0x3a6f09){return _0x3f9c35[_0xbf05('0x9')]('ChatMessage',attributes,{'tableName':_0xbf05('0xa'),'paranoid':![],'indexes':[{'name':_0xbf05('0xb'),'fields':['body'],'type':_0xbf05('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x403655,_0x3da244,_0x5b143c){var _0x1b108c=_0x3f9c35[_0xbf05('0xd')];var _0x381f8c=_0x403655['get']({'plain':!![]});if(_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()==='in'||_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()===_0xbf05('0x10')&&!_0x381f8c[_0xbf05('0x11')]&&!_['isNil'](_0x381f8c['UserId'])){_0x1b108c['ChatInteraction']['findOne']({'where':{'id':_0x381f8c[_0xbf05('0x12')]}})[_0xbf05('0x13')](function(_0x194a9c){if(_0x194a9c){_0x194a9c[_0xbf05('0x14')]({'lastMsgAt':_0x381f8c[_0xbf05('0x15')],'lastMsgDirection':_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()});}})[_0xbf05('0x16')](function(_0x15ed51){console['error'](_0x15ed51);});}_0x5b143c();}},'charset':_0xbf05('0x17'),'collate':_0xbf05('0x18')});}; \ No newline at end of file +var _0xe131=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xe131,0x1b5));var _0x1e13=function(_0x496763,_0x43c2e1){_0x496763=_0x496763-0x0;var _0x19b652=_0xe131[_0x496763];return _0x19b652;};'use strict';var _=require(_0x1e13('0x0'));var util=require(_0x1e13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e13('0x2'));var BPromise=require('bluebird');var rp=require(_0x1e13('0x3'));var fs=require('fs');var path=require(_0x1e13('0x4'));var rimraf=require(_0x1e13('0x5'));var config=require(_0x1e13('0x6'));var attributes=require(_0x1e13('0x7'));module[_0x1e13('0x8')]=function(_0x440239,_0x3ec2e6){return _0x440239[_0x1e13('0x9')](_0x1e13('0xa'),attributes,{'tableName':_0x1e13('0xb'),'paranoid':![],'indexes':[{'name':_0x1e13('0xc'),'fields':[_0x1e13('0xd')],'type':_0x1e13('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1569f3,_0x528329,_0x1012f4){var _0x39e8f1=_0x440239['models'];var _0x523f28=_0x1569f3[_0x1e13('0xf')]({'plain':!![]});if(_0x523f28[_0x1e13('0x10')][_0x1e13('0x11')]()==='in'||_0x523f28['direction'][_0x1e13('0x11')]()==='out'&&!_0x523f28[_0x1e13('0x12')]&&!_[_0x1e13('0x13')](_0x523f28['UserId'])){_0x39e8f1[_0x1e13('0x14')][_0x1e13('0x15')]({'where':{'id':_0x523f28['ChatInteractionId']}})[_0x1e13('0x16')](function(_0x2cc3d0){if(_0x2cc3d0){_0x2cc3d0[_0x1e13('0x17')]({'lastMsgAt':_0x523f28['createdAt'],'lastMsgDirection':_0x523f28[_0x1e13('0x10')][_0x1e13('0x11')]()});}})[_0x1e13('0x18')](function(_0x164aa8){console[_0x1e13('0x19')](_0x164aa8);});}_0x1012f4();}},'charset':_0x1e13('0x1a'),'collate':_0x1e13('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 869d1db..68b44e4 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 _0x9f02=['register','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','raw','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x9f02,0x68));var _0x29f0=function(_0x4f7efa,_0x299b08){_0x4f7efa=_0x4f7efa-0x0;var _0x33d69d=_0x9f02[_0x4f7efa];return _0x33d69d;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29f0('0x1'));var fs=require('fs');var Redis=require(_0x29f0('0x2'));var db=require(_0x29f0('0x3'))['db'];var utils=require(_0x29f0('0x4'));var logger=require(_0x29f0('0x5'))('rpc');var config=require(_0x29f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29f0('0x7')][_0x29f0('0x8')]({'port':0x232a});config[_0x29f0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29f0('0xa'))(new Redis(config['redis']));require(_0x29f0('0xb'))[_0x29f0('0xc')](socket);function respondWithRpcPromise(_0x581e4,_0x529ded,_0x48adaf){return new BPromise(function(_0x3e1eeb,_0x5a8eb2){return client['request'](_0x581e4,_0x48adaf)['then'](function(_0x488b7f){logger[_0x29f0('0xd')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x29f0('0xe'));logger['debug'](_0x29f0('0xf'),_0x529ded,_0x29f0('0xe'),JSON[_0x29f0('0x10')](_0x488b7f));if(_0x488b7f[_0x29f0('0x11')]){if(_0x488b7f['error'][_0x29f0('0x12')]===0x1f4){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x488b7f[_0x29f0('0x11')]['message']);return _0x5a8eb2(_0x488b7f[_0x29f0('0x11')]['message']);}logger[_0x29f0('0x11')](_0x29f0('0x13'),_0x529ded,_0x488b7f['error']['message']);return _0x3e1eeb(_0x488b7f['error'][_0x29f0('0x14')]);}else{logger[_0x29f0('0xd')](_0x29f0('0x13'),_0x529ded,'request\x20sent');_0x3e1eeb(_0x488b7f[_0x29f0('0x15')][_0x29f0('0x14')]);}})[_0x29f0('0x16')](function(_0x12e197){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x12e197);_0x5a8eb2(_0x12e197);});});}exports[_0x29f0('0x17')]=function(_0xf7da2e){var _0x340fc0=this;return new Promise(function(_0x5a4579,_0x2fd36b){return db['ChatMessage'][_0x29f0('0x18')](_0xf7da2e[_0x29f0('0x19')],{'raw':_0xf7da2e[_0x29f0('0x1a')]?_0xf7da2e['options'][_0x29f0('0x1b')]===undefined?!![]:![]:!![]})[_0x29f0('0x1c')](function(_0x23e691){logger[_0x29f0('0xd')](_0x29f0('0x17'),_0xf7da2e);logger['debug'](_0x29f0('0x17'),_0xf7da2e,JSON[_0x29f0('0x10')](_0x23e691));_0x5a4579(_0x23e691);})[_0x29f0('0x16')](function(_0x3d9a49){logger[_0x29f0('0x11')](_0x29f0('0x17'),_0x3d9a49[_0x29f0('0x14')],_0xf7da2e);_0x2fd36b(_0x340fc0[_0x29f0('0x11')](0x1f4,_0x3d9a49[_0x29f0('0x14')]));});});}; \ No newline at end of file +var _0xe0b0=['localhost','socket.io-emitter','redis','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','then','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x5a4bf4,_0x574d36){var _0x4187e8=function(_0x4532b4){while(--_0x4532b4){_0x5a4bf4['push'](_0x5a4bf4['shift']());}};_0x4187e8(++_0x574d36);}(_0xe0b0,0x70));var _0x0e0b=function(_0x5bc683,_0x23fab6){_0x5bc683=_0x5bc683-0x0;var _0x10b119=_0xe0b0[_0x5bc683];return _0x10b119;};'use strict';var _=require(_0x0e0b('0x0'));var util=require(_0x0e0b('0x1'));var moment=require(_0x0e0b('0x2'));var BPromise=require(_0x0e0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e0b('0x4'));var db=require(_0x0e0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e0b('0x6'));var config=require(_0x0e0b('0x7'));var jayson=require(_0x0e0b('0x8'));var client=jayson[_0x0e0b('0x9')][_0x0e0b('0xa')]({'port':0x232a});config['redis']=_[_0x0e0b('0xb')](config['redis'],{'host':_0x0e0b('0xc'),'port':0x18eb});var socket=require(_0x0e0b('0xd'))(new Redis(config[_0x0e0b('0xe')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2fcc75,_0x3d7e51,_0x41f7fa){return new BPromise(function(_0x330756,_0x4d2157){return client['request'](_0x2fcc75,_0x41f7fa)['then'](function(_0x18019a){logger[_0x0e0b('0xf')](_0x0e0b('0x10'),_0x3d7e51,_0x0e0b('0x11'));logger['debug'](_0x0e0b('0x12'),_0x3d7e51,_0x0e0b('0x11'),JSON[_0x0e0b('0x13')](_0x18019a));if(_0x18019a[_0x0e0b('0x14')]){if(_0x18019a[_0x0e0b('0x14')][_0x0e0b('0x15')]===0x1f4){logger[_0x0e0b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3d7e51,_0x18019a['error'][_0x0e0b('0x16')]);return _0x4d2157(_0x18019a[_0x0e0b('0x14')][_0x0e0b('0x16')]);}logger[_0x0e0b('0x14')](_0x0e0b('0x10'),_0x3d7e51,_0x18019a['error']['message']);return _0x330756(_0x18019a[_0x0e0b('0x14')]['message']);}else{logger[_0x0e0b('0xf')](_0x0e0b('0x10'),_0x3d7e51,_0x0e0b('0x11'));_0x330756(_0x18019a[_0x0e0b('0x17')][_0x0e0b('0x16')]);}})[_0x0e0b('0x18')](function(_0x3f665b){logger[_0x0e0b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3d7e51,_0x3f665b);_0x4d2157(_0x3f665b);});});}exports['CreateChatMessage']=function(_0x28747a){var _0x435951=this;return new Promise(function(_0x2a3d0b,_0x3d7341){return db['ChatMessage'][_0x0e0b('0x19')](_0x28747a[_0x0e0b('0x1a')],{'raw':_0x28747a[_0x0e0b('0x1b')]?_0x28747a[_0x0e0b('0x1b')][_0x0e0b('0x1c')]===undefined?!![]:![]:!![]})[_0x0e0b('0x1d')](function(_0x9adbce){logger[_0x0e0b('0xf')](_0x0e0b('0x1e'),_0x28747a);logger['debug'](_0x0e0b('0x1e'),_0x28747a,JSON['stringify'](_0x9adbce));_0x2a3d0b(_0x9adbce);})[_0x0e0b('0x18')](function(_0x2171a6){logger[_0x0e0b('0x14')](_0x0e0b('0x1e'),_0x2171a6['message'],_0x28747a);_0x3d7341(_0x435951[_0x0e0b('0x14')](0x1f4,_0x2171a6[_0x0e0b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 8f58316..10f51e1 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 _0x5183=['./chatMessage.events','save','remove','emit','register','chatMessage:'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5183,0x13e));var _0x3518=function(_0x237b0d,_0x2a940c){_0x237b0d=_0x237b0d-0x0;var _0x1b0713=_0x5183[_0x237b0d];return _0x1b0713;};'use strict';var ChatMessageEvents=require(_0x3518('0x0'));var events=[_0x3518('0x1'),_0x3518('0x2'),'update'];function createListener(_0x5b6958,_0x2323f3){return function(_0x3cc276){_0x2323f3[_0x3518('0x3')](_0x5b6958,_0x3cc276);};}function removeListener(_0x421ab5,_0x5a38df){return function(){ChatMessageEvents['removeListener'](_0x421ab5,_0x5a38df);};}exports[_0x3518('0x4')]=function(_0x1031a9){for(var _0x2c019c=0x0,_0x482b2d=events['length'];_0x2c019c<_0x482b2d;_0x2c019c++){var _0x488c52=events[_0x2c019c];var _0x147b59=createListener(_0x3518('0x5')+_0x488c52,_0x1031a9);ChatMessageEvents['on'](_0x488c52,_0x147b59);}}; \ No newline at end of file +var _0x2e88=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x4de2c5,_0x21aeb7){var _0x4ef52b=function(_0x5e52f4){while(--_0x5e52f4){_0x4de2c5['push'](_0x4de2c5['shift']());}};_0x4ef52b(++_0x21aeb7);}(_0x2e88,0x95));var _0x82e8=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x2e88[_0x5948dd];return _0xb1f8be;};'use strict';var ChatMessageEvents=require(_0x82e8('0x0'));var events=[_0x82e8('0x1'),_0x82e8('0x2'),_0x82e8('0x3')];function createListener(_0x9dd860,_0x46c27f){return function(_0x552153){_0x46c27f[_0x82e8('0x4')](_0x9dd860,_0x552153);};}function removeListener(_0x1d7415,_0x576435){return function(){ChatMessageEvents[_0x82e8('0x5')](_0x1d7415,_0x576435);};}exports[_0x82e8('0x6')]=function(_0x4e909a){for(var _0x3162d1=0x0,_0x1e2496=events[_0x82e8('0x7')];_0x3162d1<_0x1e2496;_0x3162d1++){var _0x27df44=events[_0x3162d1];var _0x393c2c=createListener(_0x82e8('0x8')+_0x27df44,_0x4e909a);ChatMessageEvents['on'](_0x27df44,_0x393c2c);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 4ec6272..0324787 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 _0x79b3=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete'];(function(_0x3aa4a8,_0x53044f){var _0x3968d7=function(_0x38faaf){while(--_0x38faaf){_0x3aa4a8['push'](_0x3aa4a8['shift']());}};_0x3968d7(++_0x53044f);}(_0x79b3,0xb7));var _0x379b=function(_0x1b7623,_0x5460c4){_0x1b7623=_0x1b7623-0x0;var _0xe2d267=_0x79b3[_0x1b7623];return _0xe2d267;};'use strict';var multer=require(_0x379b('0x0'));var util=require(_0x379b('0x1'));var path=require(_0x379b('0x2'));var timeout=require(_0x379b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x379b('0x4'));var auth=require(_0x379b('0x5'));var interaction=require(_0x379b('0x6'));var config=require('../../config/environment');var controller=require(_0x379b('0x7'));router[_0x379b('0x8')]('/',auth[_0x379b('0x9')](),controller['index']);router[_0x379b('0x8')]('/describe',auth[_0x379b('0x9')](),controller[_0x379b('0xa')]);router[_0x379b('0x8')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller[_0x379b('0xc')]);router[_0x379b('0xd')]('/',auth[_0x379b('0x9')](),interaction[_0x379b('0xe')](_0x379b('0xf'),_0x379b('0x10')),controller[_0x379b('0x11')]);router['put']('/:id',controller[_0x379b('0x12')]);router['put'](_0x379b('0x13'),auth[_0x379b('0x9')](),controller[_0x379b('0x14')]);router[_0x379b('0x15')](_0x379b('0x16'),auth[_0x379b('0x9')](),controller[_0x379b('0x17')]);router[_0x379b('0x18')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller['destroy']);module[_0x379b('0x19')]=router; \ No newline at end of file +var _0x88ae=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chat','chatmessage:create','put','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x27ba9c,_0x27a4b3){var _0xca605c=function(_0xb172bd){while(--_0xb172bd){_0x27ba9c['push'](_0x27ba9c['shift']());}};_0xca605c(++_0x27a4b3);}(_0x88ae,0xe5));var _0xe88a=function(_0x287cac,_0xb41eef){_0x287cac=_0x287cac-0x0;var _0x3dcd41=_0x88ae[_0x287cac];return _0x3dcd41;};'use strict';var multer=require('multer');var util=require(_0xe88a('0x0'));var path=require(_0xe88a('0x1'));var timeout=require(_0xe88a('0x2'));var express=require(_0xe88a('0x3'));var router=express['Router']();var fs_extra=require(_0xe88a('0x4'));var auth=require(_0xe88a('0x5'));var interaction=require(_0xe88a('0x6'));var config=require(_0xe88a('0x7'));var controller=require(_0xe88a('0x8'));router['get']('/',auth[_0xe88a('0x9')](),controller[_0xe88a('0xa')]);router[_0xe88a('0xb')](_0xe88a('0xc'),auth[_0xe88a('0x9')](),controller[_0xe88a('0xd')]);router['get'](_0xe88a('0xe'),auth['isAuthenticated'](),controller[_0xe88a('0xf')]);router[_0xe88a('0x10')]('/',auth[_0xe88a('0x9')](),interaction['tracked'](_0xe88a('0x11'),_0xe88a('0x12')),controller['create']);router[_0xe88a('0x13')](_0xe88a('0xe'),controller['update']);router[_0xe88a('0x13')]('/:id/accept',auth[_0xe88a('0x9')](),controller[_0xe88a('0x14')]);router['put'](_0xe88a('0x15'),auth[_0xe88a('0x9')](),controller[_0xe88a('0x16')]);router[_0xe88a('0x17')](_0xe88a('0xe'),auth['isAuthenticated'](),controller[_0xe88a('0x18')]);module[_0xe88a('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8951594..7310dee 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x3f3e83,_0x425bc0){var _0x560422=function(_0x4f78ea){while(--_0x4f78ea){_0x3f3e83['push'](_0x3f3e83['shift']());}};_0x560422(++_0x425bc0);}(_0xb10b,0x12a));var _0xbb10=function(_0x4336a6,_0xc235ca){_0x4336a6=_0x4336a6-0x0;var _0x4012f3=_0xb10b[_0x4336a6];return _0x4012f3;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x2b8fa9,_0x296276){var _0x2583db=function(_0x2270e4){while(--_0x2270e4){_0x2b8fa9['push'](_0x2b8fa9['shift']());}};_0x2583db(++_0x296276);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c0ee6f8..deb6ef8 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7a54,0x106));var _0x47a5=function(_0xc80b7f,_0x2a8c83){_0xc80b7f=_0xc80b7f-0x0;var _0x1ab2cb=_0x7a54[_0xc80b7f];return _0x1ab2cb;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x7a54,0x106));var _0x47a5=function(_0x2cc64e,_0x9ba4ba){_0x2cc64e=_0x2cc64e-0x0;var _0x3e0080=_0x7a54[_0x2cc64e];return _0x3e0080;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index df290a2..7d5de13 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x293a=['ChatOfflineMessage','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x20711e,_0x5b61c9){var _0x173e7f=function(_0x4eabdc){while(--_0x4eabdc){_0x20711e['push'](_0x20711e['shift']());}};_0x173e7f(++_0x5b61c9);}(_0x293a,0xa6));var _0xa293=function(_0x51af8c,_0x7ae22f){_0x51af8c=_0x51af8c-0x0;var _0x170551=_0x293a[_0x51af8c];return _0x170551;};'use strict';var EventEmitter=require(_0xa293('0x0'));var ChatOfflineMessage=require(_0xa293('0x1'))['db'][_0xa293('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa293('0x3'),'afterDestroy':_0xa293('0x4')};function emitEvent(_0x1a971f){return function(_0x1bb168,_0x406ec1,_0x2626cf){ChatOfflineMessageEvents[_0xa293('0x5')](_0x1a971f+':'+_0x1bb168['id'],_0x1bb168);ChatOfflineMessageEvents['emit'](_0x1a971f,_0x1bb168);_0x2626cf(null);};}for(var e in events){if(events[_0xa293('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xa293('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xe29d=['events','../../mysqldb','ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x283152,_0x468a35){var _0x6cb80d=function(_0x17598a){while(--_0x17598a){_0x283152['push'](_0x283152['shift']());}};_0x6cb80d(++_0x468a35);}(_0xe29d,0x1a7));var _0xde29=function(_0x256fb0,_0x3cb5ab){_0x256fb0=_0x256fb0-0x0;var _0x80bcdd=_0xe29d[_0x256fb0];return _0x80bcdd;};'use strict';var EventEmitter=require(_0xde29('0x0'));var ChatOfflineMessage=require(_0xde29('0x1'))['db'][_0xde29('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde29('0x3'),'afterUpdate':'update','afterDestroy':_0xde29('0x4')};function emitEvent(_0x12cc24){return function(_0x40c756,_0x478b2a,_0xef43d5){ChatOfflineMessageEvents['emit'](_0x12cc24+':'+_0x40c756['id'],_0x40c756);ChatOfflineMessageEvents[_0xde29('0x5')](_0x12cc24,_0x40c756);_0xef43d5(null);};}for(var e in events){if(events[_0xde29('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xde29('0x7')](e,emitEvent(event));}}module[_0xde29('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 18ab773..2eac1a9 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 _0x3e82=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x6e8056,_0x786ea0){var _0x5c7a56=function(_0xa43aa5){while(--_0xa43aa5){_0x6e8056['push'](_0x6e8056['shift']());}};_0x5c7a56(++_0x786ea0);}(_0x3e82,0x147));var _0x23e8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e82[_0x40a045];return _0x1a687c;};'use strict';var attributes=require(_0x23e8('0x0'));module['exports']=function(_0x48a682){return _0x48a682[_0x23e8('0x1')](_0x23e8('0x2'),attributes,{'tableName':_0x23e8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x23e8('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xadd6=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x26cee6,_0x4794c6){var _0x54c1a1=function(_0x3ec1d9){while(--_0x3ec1d9){_0x26cee6['push'](_0x26cee6['shift']());}};_0x54c1a1(++_0x4794c6);}(_0xadd6,0xcf));var _0x6add=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xadd6[_0x1a0ef3];return _0x2b86da;};'use strict';var attributes=require(_0x6add('0x0'));module['exports']=function(_0x1c7655){return _0x1c7655['define'](_0x6add('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6add('0x2'),'collate':_0x6add('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 2426662..fa1595e 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 _0xc507=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5aedb2,_0x41d9d5){var _0x4010a1=function(_0x233e99){while(--_0x233e99){_0x5aedb2['push'](_0x5aedb2['shift']());}};_0x4010a1(++_0x41d9d5);}(_0xc507,0x73));var _0x7c50=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0xc507[_0x40ebff];return _0x40122a;};'use strict';var _=require(_0x7c50('0x0'));var util=require(_0x7c50('0x1'));var moment=require(_0x7c50('0x2'));var BPromise=require(_0x7c50('0x3'));var rs=require(_0x7c50('0x4'));var fs=require('fs');var Redis=require(_0x7c50('0x5'));var db=require(_0x7c50('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c50('0x7'))(_0x7c50('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c50('0x9'));var client=jayson[_0x7c50('0xa')][_0x7c50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eda30,_0x1ace0d,_0x815f20){return new BPromise(function(_0x5efd32,_0x909310){return client[_0x7c50('0xc')](_0x2eda30,_0x815f20)[_0x7c50('0xd')](function(_0x1df00b){logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));logger[_0x7c50('0x11')](_0x7c50('0x12'),_0x1ace0d,'request\x20sent',JSON[_0x7c50('0x13')](_0x1df00b));if(_0x1df00b[_0x7c50('0x14')]){if(_0x1df00b[_0x7c50('0x14')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);return _0x909310(_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);}logger[_0x7c50('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b['error'][_0x7c50('0x15')]);return _0x5efd32(_0x1df00b['error']['message']);}else{logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));_0x5efd32(_0x1df00b[_0x7c50('0x16')][_0x7c50('0x15')]);}})[_0x7c50('0x17')](function(_0x2515d7){logger[_0x7c50('0x14')](_0x7c50('0xf'),_0x1ace0d,_0x2515d7);_0x909310(_0x2515d7);});});} \ No newline at end of file +var _0x6f0d=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x11cba0,_0x310f52){var _0xe00153=function(_0x589b86){while(--_0x589b86){_0x11cba0['push'](_0x11cba0['shift']());}};_0xe00153(++_0x310f52);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0x560625,_0x7407e3){_0x560625=_0x560625-0x0;var _0x57db60=_0x6f0d[_0x560625];return _0x57db60;};'use strict';var _=require(_0xd6f0('0x0'));var util=require('util');var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require(_0xd6f0('0x4'));var db=require(_0xd6f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd6f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cf8b2,_0x2ba1b2,_0x289bc6){return new BPromise(function(_0x272022,_0x16f3c4){return client[_0xd6f0('0xa')](_0x1cf8b2,_0x289bc6)[_0xd6f0('0xb')](function(_0x4b8c2b){logger[_0xd6f0('0xc')](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));logger[_0xd6f0('0xf')](_0xd6f0('0x10'),_0x2ba1b2,'request\x20sent',JSON['stringify'](_0x4b8c2b));if(_0x4b8c2b[_0xd6f0('0x11')]){if(_0x4b8c2b['error'][_0xd6f0('0x12')]===0x1f4){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x16f3c4(_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);}logger[_0xd6f0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x272022(_0x4b8c2b['error'][_0xd6f0('0x13')]);}else{logger['info'](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));_0x272022(_0x4b8c2b['result'][_0xd6f0('0x13')]);}})[_0xd6f0('0x14')](function(_0x4b17c2){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b17c2);_0x16f3c4(_0x4b17c2);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 679917c..95a8370 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 _0x854f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','exports'];(function(_0x3fd26c,_0x29e6d1){var _0x8b7bbe=function(_0x3217be){while(--_0x3217be){_0x3fd26c['push'](_0x3fd26c['shift']());}};_0x8b7bbe(++_0x29e6d1);}(_0x854f,0x108));var _0xf854=function(_0x52dfcf,_0x26e802){_0x52dfcf=_0x52dfcf-0x0;var _0x4d89cf=_0x854f[_0x52dfcf];return _0x4d89cf;};'use strict';var multer=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var path=require(_0xf854('0x2'));var timeout=require(_0xf854('0x3'));var express=require(_0xf854('0x4'));var router=express[_0xf854('0x5')]();var fs_extra=require(_0xf854('0x6'));var auth=require(_0xf854('0x7'));var interaction=require(_0xf854('0x8'));var config=require(_0xf854('0x9'));var controller=require(_0xf854('0xa'));router[_0xf854('0xb')]('/',auth[_0xf854('0xc')](),controller[_0xf854('0xd')]);router[_0xf854('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf854('0xe')]);router[_0xf854('0xb')](_0xf854('0xf'),auth['isAuthenticated'](),controller[_0xf854('0x10')]);router[_0xf854('0x11')]('/',auth['isAuthenticated'](),controller[_0xf854('0x12')]);router['put'](_0xf854('0xf'),auth[_0xf854('0xc')](),controller[_0xf854('0x13')]);router[_0xf854('0x14')](_0xf854('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf854('0x15')]=router; \ No newline at end of file +var _0x8274=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8274,0x1df));var _0x4827=function(_0x22dc35,_0x37b6ed){_0x22dc35=_0x22dc35-0x0;var _0x17dcf4=_0x8274[_0x22dc35];return _0x17dcf4;};'use strict';var multer=require(_0x4827('0x0'));var util=require(_0x4827('0x1'));var path=require('path');var timeout=require(_0x4827('0x2'));var express=require(_0x4827('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4827('0x4'));var interaction=require(_0x4827('0x5'));var config=require(_0x4827('0x6'));var controller=require(_0x4827('0x7'));router[_0x4827('0x8')]('/',auth[_0x4827('0x9')](),controller[_0x4827('0xa')]);router['get'](_0x4827('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4827('0x8')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0xd')]);router[_0x4827('0xe')]('/',auth['isAuthenticated'](),controller[_0x4827('0xf')]);router[_0x4827('0x10')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0x11')]);router[_0x4827('0x12')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0x13')]);module[_0x4827('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 9f2c95e..cf95d18 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 _0x7e34=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x160393,_0x4e2ea7){var _0x39865d=function(_0x14362b){while(--_0x14362b){_0x160393['push'](_0x160393['shift']());}};_0x39865d(++_0x4e2ea7);}(_0x7e34,0xb7));var _0x47e3=function(_0x5f1413,_0x4eace2){_0x5f1413=_0x5f1413-0x0;var _0x216666=_0x7e34[_0x5f1413];return _0x216666;};'use strict';var Sequelize=require(_0x47e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x47e3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x47e3('0x2')](_0x47e3('0x3'),_0x47e3('0x4')),'defaultValue':_0x47e3('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x47e3('0x5')]}}; \ No newline at end of file +var _0x2e9c=['ENUM','mouseOver','INTEGER','sequelize','STRING'];(function(_0x1cf7af,_0x50f213){var _0x1b8088=function(_0x127b9e){while(--_0x127b9e){_0x1cf7af['push'](_0x1cf7af['shift']());}};_0x1b8088(++_0x50f213);}(_0x2e9c,0xfd));var _0xc2e9=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x2e9c[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0xc2e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xc2e9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc2e9('0x2')]('mouseOver','timeout'),'defaultValue':_0xc2e9('0x3')},'selector':{'type':Sequelize[_0xc2e9('0x1')]},'timeout':{'type':Sequelize[_0xc2e9('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 6569b43..c802241 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 _0x59c3=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','filters','intersection','query','attributes','fields','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x59c3,0x133));var _0x359c=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x59c3[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0x359c('0x0'));var rimraf=require(_0x359c('0x1'));var zipdir=require(_0x359c('0x2'));var jsonpatch=require(_0x359c('0x3'));var rp=require(_0x359c('0x4'));var moment=require(_0x359c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x359c('0x6'));var util=require(_0x359c('0x7'));var path=require(_0x359c('0x8'));var sox=require(_0x359c('0x9'));var csv=require(_0x359c('0xa'));var ejs=require(_0x359c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359c('0xc'));var squel=require('squel');var crypto=require(_0x359c('0xd'));var jsforce=require(_0x359c('0xe'));var deskjs=require(_0x359c('0xf'));var toCsv=require(_0x359c('0xa'));var querystring=require('querystring');var Papa=require(_0x359c('0x10'));var Redis=require('ioredis');var authService=require(_0x359c('0x11'));var qs=require(_0x359c('0x12'));var as=require(_0x359c('0x13'));var hardwareService=require(_0x359c('0x14'));var logger=require(_0x359c('0x15'))(_0x359c('0x16'));var utils=require('../../config/utils');var config=require(_0x359c('0x17'));var licenseUtil=require(_0x359c('0x18'));var db=require(_0x359c('0x19'))['db'];function respondWithStatusCode(_0x18fab2,_0x1d4d8a){_0x1d4d8a=_0x1d4d8a||0xcc;return function(_0x29d295){if(_0x29d295){return _0x18fab2[_0x359c('0x1a')](_0x1d4d8a);}return _0x18fab2[_0x359c('0x1b')](_0x1d4d8a)[_0x359c('0x1c')]();};}function respondWithResult(_0x4413ce,_0x2cf668){_0x2cf668=_0x2cf668||0xc8;return function(_0xd07946){if(_0xd07946){return _0x4413ce['status'](_0x2cf668)[_0x359c('0x1d')](_0xd07946);}};}function respondWithFilteredResult(_0x1901cc,_0x4d4860){return function(_0x80b8d8){if(_0x80b8d8){var _0x186e45=typeof _0x4d4860[_0x359c('0x1e')]===_0x359c('0x1f')&&typeof _0x4d4860[_0x359c('0x20')]===_0x359c('0x1f');var _0x42d3b5=_0x80b8d8[_0x359c('0x21')];var _0x2931eb=_0x186e45?0x0:_0x4d4860[_0x359c('0x1e')];var _0x2bdd3c=_0x186e45?_0x80b8d8[_0x359c('0x21')]:_0x4d4860[_0x359c('0x1e')]+_0x4d4860[_0x359c('0x20')];var _0x19d0da;if(_0x2bdd3c>=_0x42d3b5){_0x2bdd3c=_0x42d3b5;_0x19d0da=0xc8;}else{_0x19d0da=0xce;}_0x1901cc[_0x359c('0x1b')](_0x19d0da);return _0x1901cc[_0x359c('0x22')](_0x359c('0x23'),_0x2931eb+'-'+_0x2bdd3c+'/'+_0x42d3b5)['json'](_0x80b8d8);}return null;};}function patchUpdates(_0x395ef8){return function(_0x5b305b){try{jsonpatch[_0x359c('0x24')](_0x5b305b,_0x395ef8,!![]);}catch(_0x5df429){return BPromise[_0x359c('0x25')](_0x5df429);}return _0x5b305b[_0x359c('0x26')]();};}function saveUpdates(_0x34f747,_0x402114){return function(_0x6e731c){if(_0x6e731c){return _0x6e731c[_0x359c('0x27')](_0x34f747)[_0x359c('0x28')](function(_0x1fe73f){return _0x1fe73f;});}return null;};}function removeEntity(_0x15b7c7,_0x1d29df){return function(_0x3e9cdf){if(_0x3e9cdf){return _0x3e9cdf[_0x359c('0x29')]()[_0x359c('0x28')](function(){_0x15b7c7[_0x359c('0x1b')](0xcc)[_0x359c('0x1c')]();});}};}function handleEntityNotFound(_0xf6f24,_0x4fbc28){return function(_0xf0770b){if(!_0xf0770b){_0xf6f24[_0x359c('0x1a')](0x194);}return _0xf0770b;};}function handleError(_0x35569d,_0x540fc9){_0x540fc9=_0x540fc9||0x1f4;return function(_0x1436a8){logger[_0x359c('0x2a')](_0x1436a8[_0x359c('0x2b')]);if(_0x1436a8['name']){delete _0x1436a8[_0x359c('0x2c')];}_0x35569d['status'](_0x540fc9)[_0x359c('0x2d')](_0x1436a8);};}exports[_0x359c('0x2e')]=function(_0x1d52ac,_0x31d65c){var _0x512fc0={'raw':!![],'where':{'id':_0x1d52ac[_0x359c('0x2f')]['id']}},_0x2e42f6={};_0x2e42f6[_0x359c('0x30')]=_[_0x359c('0x31')](db[_0x359c('0x32')][_0x359c('0x33')]);_0x2e42f6['query']=_['keys'](_0x1d52ac['query']);_0x2e42f6[_0x359c('0x34')]=_[_0x359c('0x35')](_0x2e42f6['model'],_0x2e42f6[_0x359c('0x36')]);_0x512fc0[_0x359c('0x37')]=_[_0x359c('0x35')](_0x2e42f6[_0x359c('0x30')],qs[_0x359c('0x38')](_0x1d52ac['query'][_0x359c('0x38')]));_0x512fc0[_0x359c('0x37')]=_0x512fc0[_0x359c('0x37')]['length']?_0x512fc0['attributes']:_0x2e42f6['model'];if(_0x1d52ac[_0x359c('0x36')][_0x359c('0x39')]){_0x512fc0['include']=[{'all':!![]}];}_0x512fc0=_[_0x359c('0x3a')]({},_0x512fc0,_0x1d52ac[_0x359c('0x3b')]);return db[_0x359c('0x32')][_0x359c('0x3c')](_0x512fc0)[_0x359c('0x28')](handleEntityNotFound(_0x31d65c,null))[_0x359c('0x28')](respondWithResult(_0x31d65c,null))['catch'](handleError(_0x31d65c,null));};exports[_0x359c('0x3d')]=function(_0x326baa,_0xc2f4b6){return db[_0x359c('0x32')][_0x359c('0x3d')](_0x326baa[_0x359c('0x3e')],{})['then'](respondWithResult(_0xc2f4b6,0xc9))[_0x359c('0x3f')](handleError(_0xc2f4b6,null));};exports['update']=function(_0x5366e0,_0x1cf3f8){if(_0x5366e0[_0x359c('0x3e')]['id']){delete _0x5366e0['body']['id'];}return db[_0x359c('0x32')][_0x359c('0x3c')]({'where':{'id':_0x5366e0[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x1cf3f8,null))['then'](saveUpdates(_0x5366e0[_0x359c('0x3e')],null))[_0x359c('0x28')](respondWithResult(_0x1cf3f8,null))[_0x359c('0x3f')](handleError(_0x1cf3f8,null));};exports['destroy']=function(_0x16ff10,_0x56d973){return db[_0x359c('0x32')]['find']({'where':{'id':_0x16ff10[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x56d973,null))['then'](removeEntity(_0x56d973,null))['catch'](handleError(_0x56d973,null));}; \ No newline at end of file +var _0x61b8=['query','filters','intersection','attributes','includeAll','include','options','ChatProactiveAction','then','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','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','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','params','model','rawAttributes','keys'];(function(_0x1d68e1,_0x241674){var _0x2696aa=function(_0x13fddd){while(--_0x13fddd){_0x1d68e1['push'](_0x1d68e1['shift']());}};_0x2696aa(++_0x241674);}(_0x61b8,0x169));var _0x861b=function(_0x1bbe1d,_0x517125){_0x1bbe1d=_0x1bbe1d-0x0;var _0x508012=_0x61b8[_0x1bbe1d];return _0x508012;};'use strict';var emlformat=require(_0x861b('0x0'));var rimraf=require(_0x861b('0x1'));var zipdir=require(_0x861b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x861b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x861b('0x4'));var util=require(_0x861b('0x5'));var path=require(_0x861b('0x6'));var sox=require('sox');var csv=require(_0x861b('0x7'));var ejs=require(_0x861b('0x8'));var fs=require('fs');var fs_extra=require(_0x861b('0x9'));var _=require(_0x861b('0xa'));var squel=require(_0x861b('0xb'));var crypto=require(_0x861b('0xc'));var jsforce=require(_0x861b('0xd'));var deskjs=require(_0x861b('0xe'));var toCsv=require(_0x861b('0x7'));var querystring=require(_0x861b('0xf'));var Papa=require(_0x861b('0x10'));var Redis=require('ioredis');var authService=require(_0x861b('0x11'));var qs=require(_0x861b('0x12'));var as=require(_0x861b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x861b('0x14'))('api');var utils=require(_0x861b('0x15'));var config=require(_0x861b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x861b('0x17'))['db'];function respondWithStatusCode(_0x16eb59,_0x125345){_0x125345=_0x125345||0xcc;return function(_0x23c3db){if(_0x23c3db){return _0x16eb59[_0x861b('0x18')](_0x125345);}return _0x16eb59[_0x861b('0x19')](_0x125345)[_0x861b('0x1a')]();};}function respondWithResult(_0x21c585,_0x44b444){_0x44b444=_0x44b444||0xc8;return function(_0x226ee9){if(_0x226ee9){return _0x21c585[_0x861b('0x19')](_0x44b444)[_0x861b('0x1b')](_0x226ee9);}};}function respondWithFilteredResult(_0x264ba1,_0x3ee3ab){return function(_0x437bbd){if(_0x437bbd){var _0x3dbd5e=typeof _0x3ee3ab['offset']===_0x861b('0x1c')&&typeof _0x3ee3ab['limit']==='undefined';var _0x3d828f=_0x437bbd['count'];var _0x1b3d5c=_0x3dbd5e?0x0:_0x3ee3ab[_0x861b('0x1d')];var _0x4aafa8=_0x3dbd5e?_0x437bbd[_0x861b('0x1e')]:_0x3ee3ab[_0x861b('0x1d')]+_0x3ee3ab[_0x861b('0x1f')];var _0x11a914;if(_0x4aafa8>=_0x3d828f){_0x4aafa8=_0x3d828f;_0x11a914=0xc8;}else{_0x11a914=0xce;}_0x264ba1['status'](_0x11a914);return _0x264ba1['set'](_0x861b('0x20'),_0x1b3d5c+'-'+_0x4aafa8+'/'+_0x3d828f)[_0x861b('0x1b')](_0x437bbd);}return null;};}function patchUpdates(_0x20422f){return function(_0x4e76a3){try{jsonpatch[_0x861b('0x21')](_0x4e76a3,_0x20422f,!![]);}catch(_0x4dab89){return BPromise[_0x861b('0x22')](_0x4dab89);}return _0x4e76a3[_0x861b('0x23')]();};}function saveUpdates(_0x4af003,_0x4fd2b3){return function(_0x474f49){if(_0x474f49){return _0x474f49[_0x861b('0x24')](_0x4af003)['then'](function(_0x4e61cd){return _0x4e61cd;});}return null;};}function removeEntity(_0x24aed8,_0x47be04){return function(_0x5b91db){if(_0x5b91db){return _0x5b91db[_0x861b('0x25')]()['then'](function(){_0x24aed8['status'](0xcc)[_0x861b('0x1a')]();});}};}function handleEntityNotFound(_0x24d378,_0x22369c){return function(_0xb763e2){if(!_0xb763e2){_0x24d378[_0x861b('0x18')](0x194);}return _0xb763e2;};}function handleError(_0x58527c,_0x536c97){_0x536c97=_0x536c97||0x1f4;return function(_0x726496){logger[_0x861b('0x26')](_0x726496[_0x861b('0x27')]);if(_0x726496[_0x861b('0x28')]){delete _0x726496[_0x861b('0x28')];}_0x58527c[_0x861b('0x19')](_0x536c97)['send'](_0x726496);};}exports['show']=function(_0x3882a1,_0x3aeaf8){var _0x419259={'raw':!![],'where':{'id':_0x3882a1[_0x861b('0x29')]['id']}},_0x1fc11a={};_0x1fc11a[_0x861b('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x861b('0x2b')]);_0x1fc11a['query']=_[_0x861b('0x2c')](_0x3882a1[_0x861b('0x2d')]);_0x1fc11a[_0x861b('0x2e')]=_[_0x861b('0x2f')](_0x1fc11a[_0x861b('0x2a')],_0x1fc11a[_0x861b('0x2d')]);_0x419259[_0x861b('0x30')]=_[_0x861b('0x2f')](_0x1fc11a['model'],qs['fields'](_0x3882a1[_0x861b('0x2d')]['fields']));_0x419259[_0x861b('0x30')]=_0x419259[_0x861b('0x30')]['length']?_0x419259[_0x861b('0x30')]:_0x1fc11a['model'];if(_0x3882a1['query'][_0x861b('0x31')]){_0x419259[_0x861b('0x32')]=[{'all':!![]}];}_0x419259=_['merge']({},_0x419259,_0x3882a1[_0x861b('0x33')]);return db[_0x861b('0x34')]['find'](_0x419259)[_0x861b('0x35')](handleEntityNotFound(_0x3aeaf8,null))[_0x861b('0x35')](respondWithResult(_0x3aeaf8,null))['catch'](handleError(_0x3aeaf8,null));};exports[_0x861b('0x36')]=function(_0x1d0e67,_0x5a48f3){return db[_0x861b('0x34')][_0x861b('0x36')](_0x1d0e67[_0x861b('0x37')],{})['then'](respondWithResult(_0x5a48f3,0xc9))[_0x861b('0x38')](handleError(_0x5a48f3,null));};exports[_0x861b('0x24')]=function(_0x1a677e,_0x2936fc){if(_0x1a677e[_0x861b('0x37')]['id']){delete _0x1a677e['body']['id'];}return db['ChatProactiveAction'][_0x861b('0x39')]({'where':{'id':_0x1a677e[_0x861b('0x29')]['id']}})['then'](handleEntityNotFound(_0x2936fc,null))['then'](saveUpdates(_0x1a677e[_0x861b('0x37')],null))[_0x861b('0x35')](respondWithResult(_0x2936fc,null))[_0x861b('0x38')](handleError(_0x2936fc,null));};exports[_0x861b('0x25')]=function(_0x339a95,_0x307e97){return db['ChatProactiveAction'][_0x861b('0x39')]({'where':{'id':_0x339a95[_0x861b('0x29')]['id']}})[_0x861b('0x35')](handleEntityNotFound(_0x307e97,null))[_0x861b('0x35')](removeEntity(_0x307e97,null))[_0x861b('0x38')](handleError(_0x307e97,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 49e2287..8740d00 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 _0xf68f=['moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api'];(function(_0x27a027,_0x7f9a8f){var _0x4fc60d=function(_0x568acc){while(--_0x568acc){_0x27a027['push'](_0x27a027['shift']());}};_0x4fc60d(++_0x7f9a8f);}(_0xf68f,0x168));var _0xff68=function(_0xa8ef70,_0x364d2f){_0xa8ef70=_0xa8ef70-0x0;var _0x447423=_0xf68f[_0xa8ef70];return _0x447423;};'use strict';var _=require(_0xff68('0x0'));var util=require(_0xff68('0x1'));var logger=require(_0xff68('0x2'))(_0xff68('0x3'));var moment=require(_0xff68('0x4'));var BPromise=require(_0xff68('0x5'));var rp=require(_0xff68('0x6'));var fs=require('fs');var path=require(_0xff68('0x7'));var rimraf=require(_0xff68('0x8'));var config=require('../../config/environment');var attributes=require(_0xff68('0x9'));module[_0xff68('0xa')]=function(_0x473cce,_0x28ea54){return _0x473cce[_0xff68('0xb')](_0xff68('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1c2=['exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatProactiveAction.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf1c2,0x157));var _0x2f1c=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0xf1c2[_0x53ad58];return _0x554b03;};'use strict';var _=require(_0x2f1c('0x0'));var util=require(_0x2f1c('0x1'));var logger=require(_0x2f1c('0x2'))(_0x2f1c('0x3'));var moment=require(_0x2f1c('0x4'));var BPromise=require(_0x2f1c('0x5'));var rp=require(_0x2f1c('0x6'));var fs=require('fs');var path=require(_0x2f1c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2f1c('0x8'));module[_0x2f1c('0x9')]=function(_0x3fdfc6,_0x2c2803){return _0x3fdfc6['define'](_0x2f1c('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index bbd2714..d4892be 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 _0xbd40=['jayson/promise','client','http','request','info','ChatProactiveAction,\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(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xbd40,0x98));var _0x0bd4=function(_0x975e75,_0x42b16c){_0x975e75=_0x975e75-0x0;var _0x3c6f06=_0xbd40[_0x975e75];return _0x3c6f06;};'use strict';var _=require(_0x0bd4('0x0'));var util=require(_0x0bd4('0x1'));var moment=require(_0x0bd4('0x2'));var BPromise=require(_0x0bd4('0x3'));var rs=require(_0x0bd4('0x4'));var fs=require('fs');var Redis=require(_0x0bd4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bd4('0x6'));var logger=require(_0x0bd4('0x7'))(_0x0bd4('0x8'));var config=require('../../config/environment');var jayson=require(_0x0bd4('0x9'));var client=jayson[_0x0bd4('0xa')][_0x0bd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5fed53,_0x4f12ff,_0x536b98){return new BPromise(function(_0x4980d2,_0xa06455){return client[_0x0bd4('0xc')](_0x5fed53,_0x536b98)['then'](function(_0x324dbd){logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));logger[_0x0bd4('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4f12ff,'request\x20sent',JSON[_0x0bd4('0x11')](_0x324dbd));if(_0x324dbd[_0x0bd4('0x12')]){if(_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x13')]===0x1f4){logger['error'](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd['error'][_0x0bd4('0x14')]);return _0xa06455(_0x324dbd['error'][_0x0bd4('0x14')]);}logger[_0x0bd4('0x12')](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x14')]);return _0x4980d2(_0x324dbd['error'][_0x0bd4('0x14')]);}else{logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));_0x4980d2(_0x324dbd[_0x0bd4('0x15')]['message']);}})[_0x0bd4('0x16')](function(_0x5e3018){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f12ff,_0x5e3018);_0xa06455(_0x5e3018);});});} \ No newline at end of file +var _0xa625=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x51e34d,_0x480ab7){var _0x8b5825=function(_0x30511b){while(--_0x30511b){_0x51e34d['push'](_0x51e34d['shift']());}};_0x8b5825(++_0x480ab7);}(_0xa625,0x1d4));var _0x5a62=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xa625[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5a62('0x0'));var BPromise=require('bluebird');var rs=require(_0x5a62('0x1'));var fs=require('fs');var Redis=require(_0x5a62('0x2'));var db=require(_0x5a62('0x3'))['db'];var utils=require(_0x5a62('0x4'));var logger=require(_0x5a62('0x5'))('rpc');var config=require(_0x5a62('0x6'));var jayson=require(_0x5a62('0x7'));var client=jayson[_0x5a62('0x8')][_0x5a62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f30e,_0x524b8c,_0x17ac0b){return new BPromise(function(_0x58b046,_0x2c6e75){return client[_0x5a62('0xa')](_0x44f30e,_0x17ac0b)[_0x5a62('0xb')](function(_0x2156b2){logger[_0x5a62('0xc')](_0x5a62('0xd'),_0x524b8c,_0x5a62('0xe'));logger[_0x5a62('0xf')](_0x5a62('0x10'),_0x524b8c,'request\x20sent',JSON[_0x5a62('0x11')](_0x2156b2));if(_0x2156b2[_0x5a62('0x12')]){if(_0x2156b2['error']['code']===0x1f4){logger[_0x5a62('0x12')](_0x5a62('0xd'),_0x524b8c,_0x2156b2[_0x5a62('0x12')]['message']);return _0x2c6e75(_0x2156b2[_0x5a62('0x12')][_0x5a62('0x13')]);}logger['error'](_0x5a62('0xd'),_0x524b8c,_0x2156b2['error'][_0x5a62('0x13')]);return _0x58b046(_0x2156b2[_0x5a62('0x12')][_0x5a62('0x13')]);}else{logger[_0x5a62('0xc')](_0x5a62('0xd'),_0x524b8c,_0x5a62('0xe'));_0x58b046(_0x2156b2[_0x5a62('0x14')][_0x5a62('0x13')]);}})[_0x5a62('0x15')](function(_0x3b619a){logger['error'](_0x5a62('0xd'),_0x524b8c,_0x3b619a);_0x2c6e75(_0x3b619a);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d839b29..c8c8a96 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0x7da7,0x10d));var _0x77da=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x7da7[_0x1b3a5c];return _0x2ae8cb;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=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(_0x2a2e9c,_0x4108f6){var _0x6f6fc6=function(_0x524998){while(--_0x524998){_0x2a2e9c['push'](_0x2a2e9c['shift']());}};_0x6f6fc6(++_0x4108f6);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x18776a,_0x4fecab){_0x18776a=_0x18776a-0x0;var _0x484e4a=_0xf2ca[_0x18776a];return _0x484e4a;};'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 9a3923a..77a3384 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 _0x26e5=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x32854c,_0x1ceeea){var _0x1b3012=function(_0x15ca7d){while(--_0x15ca7d){_0x32854c['push'](_0x32854c['shift']());}};_0x1b3012(++_0x1ceeea);}(_0x26e5,0xfb));var _0x526e=function(_0xf4f343,_0x41fe4a){_0xf4f343=_0xf4f343-0x0;var _0x4cda68=_0x26e5[_0xf4f343];return _0x4cda68;};'use strict';var Sequelize=require(_0x526e('0x0'));module['exports']={'name':{'type':Sequelize[_0x526e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x526e('0x1')]},'timeout':{'type':Sequelize[_0x526e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x526e('0x3')](_0x526e('0x4'),_0x526e('0x5'),_0x526e('0x6'))}}; \ No newline at end of file +var _0x2509=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x48d2ec,_0x21a83a){var _0x198198=function(_0x1d1f95){while(--_0x1d1f95){_0x48d2ec['push'](_0x48d2ec['shift']());}};_0x198198(++_0x21a83a);}(_0x2509,0xe3));var _0x9250=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x2509[_0x251e8c];return _0x1e0c1d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9250('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9250('0x0')]},'timeout':{'type':Sequelize[_0x9250('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9250('0x2')](_0x9250('0x3'),_0x9250('0x4'),_0x9250('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index e8590f4..6e4ca04 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 _0xee40=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','reject','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','nolimit','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','pick','addTeams','ids','Agents','online','interface','transaction','each','UserChatQueue','findOrCreate','forEach','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xee40,0x85));var _0x0ee4=function(_0x20fe76,_0x1caa47){_0x20fe76=_0x20fe76-0x0;var _0x446f73=_0xee40[_0x20fe76];return _0x446f73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ee4('0x0'));var jsonpatch=require(_0x0ee4('0x1'));var rp=require(_0x0ee4('0x2'));var moment=require('moment');var BPromise=require(_0x0ee4('0x3'));var Mustache=require(_0x0ee4('0x4'));var util=require(_0x0ee4('0x5'));var path=require(_0x0ee4('0x6'));var sox=require('sox');var csv=require(_0x0ee4('0x7'));var ejs=require(_0x0ee4('0x8'));var fs=require('fs');var fs_extra=require(_0x0ee4('0x9'));var _=require(_0x0ee4('0xa'));var squel=require(_0x0ee4('0xb'));var crypto=require(_0x0ee4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ee4('0x7'));var querystring=require(_0x0ee4('0xd'));var Papa=require(_0x0ee4('0xe'));var Redis=require(_0x0ee4('0xf'));var authService=require(_0x0ee4('0x10'));var qs=require(_0x0ee4('0x11'));var as=require(_0x0ee4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee4('0x13'))(_0x0ee4('0x14'));var utils=require(_0x0ee4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0ee4('0x16'));var db=require(_0x0ee4('0x17'))['db'];config[_0x0ee4('0x18')]=_['defaults'](config['redis'],{'host':_0x0ee4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ee4('0x18')]));require(_0x0ee4('0x1a'))[_0x0ee4('0x1b')](socket);var jayson=require(_0x0ee4('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34f82e,_0x5754fb,_0x5db41f,_0x4bc02d){return new BPromise(function(_0x1c0ba5,_0x4de31e){var _0x41bfee=_0x4bc02d||client;return _0x41bfee[_0x0ee4('0x1d')](_0x34f82e,_0x5db41f)[_0x0ee4('0x1e')](function(_0x3e04ce){logger[_0x0ee4('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x0ee4('0x20'));logger[_0x0ee4('0x21')](_0x0ee4('0x22'),_0x5754fb,_0x0ee4('0x20'),JSON[_0x0ee4('0x23')](_0x3e04ce));if(_0x3e04ce[_0x0ee4('0x24')]){if(_0x3e04ce[_0x0ee4('0x24')]['code']===0x1f4){logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x4de31e(_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);}logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x1c0ba5(_0x3e04ce[_0x0ee4('0x24')]['message']);}else{logger[_0x0ee4('0x1f')](_0x0ee4('0x26'),_0x5754fb,'request\x20sent');_0x1c0ba5(_0x3e04ce['result'][_0x0ee4('0x25')]);}})['catch'](function(_0x176baf){logger[_0x0ee4('0x24')](_0x0ee4('0x26'),_0x5754fb,_0x176baf);_0x4de31e(_0x176baf);});});}function respondWithStatusCode(_0x3c00a7,_0x47383d){_0x47383d=_0x47383d||0xcc;return function(_0x318081){if(_0x318081){return _0x3c00a7[_0x0ee4('0x27')](_0x47383d);}return _0x3c00a7['status'](_0x47383d)[_0x0ee4('0x28')]();};}function respondWithResult(_0x2a8ff6,_0x146701){_0x146701=_0x146701||0xc8;return function(_0x35dbe8){if(_0x35dbe8){return _0x2a8ff6[_0x0ee4('0x29')](_0x146701)[_0x0ee4('0x2a')](_0x35dbe8);}};}function respondWithFilteredResult(_0x71541d,_0x1d4400){return function(_0x12409a){if(_0x12409a){var _0x16da09=typeof _0x1d4400['offset']===_0x0ee4('0x2b')&&typeof _0x1d4400[_0x0ee4('0x2c')]===_0x0ee4('0x2b');var _0x3c585c=_0x12409a['count'];var _0x3b515a=_0x16da09?0x0:_0x1d4400[_0x0ee4('0x2d')];var _0x2b205e=_0x16da09?_0x12409a['count']:_0x1d4400[_0x0ee4('0x2d')]+_0x1d4400[_0x0ee4('0x2c')];var _0x53efda;if(_0x2b205e>=_0x3c585c){_0x2b205e=_0x3c585c;_0x53efda=0xc8;}else{_0x53efda=0xce;}_0x71541d[_0x0ee4('0x29')](_0x53efda);return _0x71541d[_0x0ee4('0x2e')](_0x0ee4('0x2f'),_0x3b515a+'-'+_0x2b205e+'/'+_0x3c585c)[_0x0ee4('0x2a')](_0x12409a);}return null;};}function patchUpdates(_0x4798eb){return function(_0x1bf252){try{jsonpatch['apply'](_0x1bf252,_0x4798eb,!![]);}catch(_0x2cf156){return BPromise[_0x0ee4('0x30')](_0x2cf156);}return _0x1bf252['save']();};}function saveUpdates(_0x4bd549,_0x21ddc5){return function(_0x3d7759){if(_0x3d7759){return _0x3d7759[_0x0ee4('0x31')](_0x4bd549)['then'](function(_0x41bc7b){return _0x41bc7b;});}return null;};}function removeEntity(_0x57eac4,_0x2e33a7){return function(_0x4a047f){if(_0x4a047f){return _0x4a047f[_0x0ee4('0x32')]()[_0x0ee4('0x1e')](function(){var _0xb26e32=_0x4a047f[_0x0ee4('0x33')]({'plain':!![]});var _0x100784=_0x0ee4('0x34');return db[_0x0ee4('0x35')]['destroy']({'where':{'type':_0x100784,'resourceId':_0xb26e32['id']}})['then'](function(){return _0x4a047f;});})[_0x0ee4('0x1e')](function(){_0x57eac4[_0x0ee4('0x29')](0xcc)[_0x0ee4('0x28')]();});}};}function handleEntityNotFound(_0x44dd60,_0x1e27df){return function(_0x40d7c2){if(!_0x40d7c2){_0x44dd60['sendStatus'](0x194);}return _0x40d7c2;};}function handleError(_0x2998d7,_0x2e2a13){_0x2e2a13=_0x2e2a13||0x1f4;return function(_0x4f8f15){logger['error'](_0x4f8f15['stack']);if(_0x4f8f15[_0x0ee4('0x36')]){delete _0x4f8f15['name'];}_0x2998d7[_0x0ee4('0x29')](_0x2e2a13)[_0x0ee4('0x37')](_0x4f8f15);};}exports[_0x0ee4('0x38')]=function(_0xb48cf9,_0x38e8c2){var _0x355eec={},_0x454e11={},_0x4bf1ee={'count':0x0,'rows':[]};var _0x346c98=_[_0x0ee4('0x39')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')],function(_0x46c6e4){return{'name':_0x46c6e4['fieldName'],'type':_0x46c6e4['type'][_0x0ee4('0x3c')]};});_0x454e11[_0x0ee4('0x3d')]=_[_0x0ee4('0x39')](_0x346c98,_0x0ee4('0x36'));_0x454e11[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0xb48cf9['query']);_0x454e11['filters']=_[_0x0ee4('0x40')](_0x454e11['model'],_0x454e11[_0x0ee4('0x3e')]);_0x355eec[_0x0ee4('0x41')]=_['intersection'](_0x454e11[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0xb48cf9['query'][_0x0ee4('0x42')]));_0x355eec['attributes']=_0x355eec['attributes']['length']?_0x355eec['attributes']:_0x454e11[_0x0ee4('0x3d')];if(!_0xb48cf9['query'][_0x0ee4('0x43')]('nolimit')){_0x355eec[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0xb48cf9[_0x0ee4('0x3e')]['limit']);_0x355eec[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x355eec[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0xb48cf9['query'][_0x0ee4('0x45')]);_0x355eec[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_['pick'](_0xb48cf9[_0x0ee4('0x3e')],_0x454e11[_0x0ee4('0x47')]),_0x346c98);if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x355eec[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x355eec[_0x0ee4('0x46')],{'$or':_['map'](_0x346c98,function(_0x5ea9cb){if(_0x5ea9cb[_0x0ee4('0x4a')]!==_0x0ee4('0x4b')){var _0x9f3566={};_0x9f3566[_0x5ea9cb[_0x0ee4('0x36')]]={'$like':'%'+_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x9f3566;}})});}_0x355eec=_[_0x0ee4('0x49')]({},_0x355eec,_0xb48cf9[_0x0ee4('0x4c')]);var _0x52dd8e={'where':_0x355eec[_0x0ee4('0x46')]};return db['ChatQueue'][_0x0ee4('0x4d')](_0x52dd8e)['then'](function(_0x52e070){_0x4bf1ee[_0x0ee4('0x4d')]=_0x52e070;if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x355eec[_0x0ee4('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x355eec);})[_0x0ee4('0x1e')](function(_0x2bf9f0){_0x4bf1ee[_0x0ee4('0x50')]=_0x2bf9f0;return _0x4bf1ee;})['then'](respondWithFilteredResult(_0x38e8c2,_0x355eec))[_0x0ee4('0x51')](handleError(_0x38e8c2,null));};exports[_0x0ee4('0x52')]=function(_0x1f4b32,_0x3d81a5){var _0x5520d3={'raw':!![],'where':{'id':_0x1f4b32[_0x0ee4('0x53')]['id']}},_0x333bea={};_0x333bea[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')]);_0x333bea[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0x1f4b32[_0x0ee4('0x3e')]);_0x333bea['filters']=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],_0x333bea[_0x0ee4('0x3e')]);_0x5520d3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],qs['fields'](_0x1f4b32['query'][_0x0ee4('0x42')]));_0x5520d3[_0x0ee4('0x41')]=_0x5520d3['attributes'][_0x0ee4('0x54')]?_0x5520d3[_0x0ee4('0x41')]:_0x333bea[_0x0ee4('0x3d')];if(_0x1f4b32[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x5520d3[_0x0ee4('0x4f')]=[{'all':!![]}];}_0x5520d3=_[_0x0ee4('0x49')]({},_0x5520d3,_0x1f4b32[_0x0ee4('0x4c')]);return db[_0x0ee4('0x3a')][_0x0ee4('0x55')](_0x5520d3)['then'](handleEntityNotFound(_0x3d81a5,null))['then'](respondWithResult(_0x3d81a5,null))[_0x0ee4('0x51')](handleError(_0x3d81a5,null));};exports[_0x0ee4('0x56')]=function(_0x1a4d39,_0x459850){return db[_0x0ee4('0x3a')][_0x0ee4('0x56')](_0x1a4d39['body'],{})['then'](function(_0x3529ed){var _0x53968c=_0x1a4d39[_0x0ee4('0x57')][_0x0ee4('0x33')]({'plain':!![]});if(!_0x53968c)throw new Error(_0x0ee4('0x58'));if(_0x53968c[_0x0ee4('0x59')]===_0x0ee4('0x57')){var _0x1b53ba=_0x3529ed[_0x0ee4('0x33')]({'plain':!![]});var _0x338a17=_0x0ee4('0x34');return db[_0x0ee4('0x5a')]['find']({'where':{'name':_0x338a17,'userProfileId':_0x53968c[_0x0ee4('0x5b')]},'raw':!![]})[_0x0ee4('0x1e')](function(_0x4df7b1){if(_0x4df7b1&&_0x4df7b1['autoAssociation']===0x0){return db[_0x0ee4('0x35')][_0x0ee4('0x56')]({'name':_0x1b53ba[_0x0ee4('0x36')],'resourceId':_0x1b53ba['id'],'type':_0x4df7b1[_0x0ee4('0x36')],'sectionId':_0x4df7b1['id']},{})['then'](function(){return _0x3529ed;});}else{return _0x3529ed;}})[_0x0ee4('0x51')](function(_0x4c90c3){logger[_0x0ee4('0x24')](_0x0ee4('0x5c'),_0x4c90c3);throw _0x4c90c3;});}return _0x3529ed;})['then'](respondWithResult(_0x459850,0xc9))['catch'](handleError(_0x459850,null));};exports[_0x0ee4('0x31')]=function(_0x34c341,_0x53612f){if(_0x34c341[_0x0ee4('0x5d')]['id']){delete _0x34c341[_0x0ee4('0x5d')]['id'];}return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x34c341[_0x0ee4('0x53')]['id']}})['then'](handleEntityNotFound(_0x53612f,null))[_0x0ee4('0x1e')](saveUpdates(_0x34c341[_0x0ee4('0x5d')],null))[_0x0ee4('0x1e')](respondWithResult(_0x53612f,null))['catch'](handleError(_0x53612f,null));};exports['destroy']=function(_0x2a8503,_0x264da4){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x2a8503[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x264da4,null))[_0x0ee4('0x1e')](removeEntity(_0x264da4,null))['catch'](handleError(_0x264da4,null));};exports[_0x0ee4('0x5e')]=function(_0x21b026,_0x151142){return db[_0x0ee4('0x3a')][_0x0ee4('0x5e')]()[_0x0ee4('0x1e')](respondWithResult(_0x151142,null))[_0x0ee4('0x51')](handleError(_0x151142,null));};exports['getMembers']=function(_0x59d16f,_0x1d39cd,_0xe9e1c5){var _0x2fd9e3={'raw':!![],'where':{}},_0x378740={},_0x272901;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x59d16f['params']['id']}})['then'](handleEntityNotFound(_0x1d39cd,null))[_0x0ee4('0x1e')](function(_0x4ab152){if(_0x4ab152){_0x272901=_0x4ab152[_0x0ee4('0x33')]({'plain':!![]});_0x378740[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db['UserChatQueue'][_0x0ee4('0x3b')]);_0x378740['query']=_[_0x0ee4('0x3f')](_0x59d16f[_0x0ee4('0x3e')]);_0x378740['filters']=_[_0x0ee4('0x40')](_0x378740[_0x0ee4('0x3d')],_0x378740[_0x0ee4('0x3e')]);_0x2fd9e3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x378740['model'],qs[_0x0ee4('0x42')](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x2fd9e3[_0x0ee4('0x41')]=_0x2fd9e3['attributes'][_0x0ee4('0x54')]?_0x2fd9e3[_0x0ee4('0x41')]:_0x378740[_0x0ee4('0x3d')];if(!_0x59d16f['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x2fd9e3[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x59d16f['query'][_0x0ee4('0x2c')]);_0x2fd9e3[_0x0ee4('0x2d')]=qs['offset'](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x2fd9e3[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x59d16f['query']['sort']);_0x2fd9e3[_0x0ee4('0x46')]=qs['filters'](_['pick'](_0x59d16f[_0x0ee4('0x3e')],_0x378740['filters']));_0x2fd9e3[_0x0ee4('0x46')][_0x0ee4('0x61')]=_0x4ab152['id'];if(_0x59d16f[_0x0ee4('0x3e')]['filter']){_0x2fd9e3[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x2fd9e3['where'],{'$or':_['map'](_0x2fd9e3[_0x0ee4('0x41')],function(_0x4fed59){var _0x1fa481={};_0x1fa481[_0x4fed59]={'$like':'%'+_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x1fa481;})});}_0x2fd9e3=_[_0x0ee4('0x49')]({},_0x2fd9e3,_0x59d16f['options']);return db['UserChatQueue'][_0x0ee4('0x62')](_0x2fd9e3);}})['then'](function(_0x6e6259){if(_0x6e6259){return db[_0x0ee4('0x63')][_0x0ee4('0x64')]({'where':{'id':_['map'](_0x6e6259,_0x0ee4('0x65')),'role':_0x0ee4('0x66')},'attributes':['id',_0x0ee4('0x36'),_0x0ee4('0x67'),_0x0ee4('0x68'),_0x0ee4('0x69')]});}})[_0x0ee4('0x1e')](function(_0x205462){if(_0x205462){return{'count':_0x205462[_0x0ee4('0x4d')],'rows':_['map'](_0x205462['rows'],function(_0x3ed2fe){return{'membername':_0x3ed2fe[_0x0ee4('0x36')],'UserId':_0x3ed2fe['id'],'queue_name':_0x272901[_0x0ee4('0x36')],'ChatQueueId':_0x272901['id'],'interface':util['format']('%s/%s',_0x0ee4('0x6a'),_0x3ed2fe[_0x0ee4('0x36')]),'penalty':0x0,'paused':_0x3ed2fe[_0x0ee4('0x67')],'createdAt':_0x3ed2fe['createdAt'],'updatedAt':_0x3ed2fe[_0x0ee4('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ee4('0x1e')](respondWithFilteredResult(_0x1d39cd,_0x2fd9e3))[_0x0ee4('0x51')](handleError(_0x1d39cd,null));};exports[_0x0ee4('0x6b')]=function(_0x237456,_0x28aefb,_0x1f60f7){var _0x791468={};var _0x454d28={};var _0x568b6a;var _0x3ae5be;return db['ChatQueue']['findOne']({'where':{'id':_0x237456[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x28aefb,null))[_0x0ee4('0x1e')](function(_0x1b748f){if(_0x1b748f){_0x568b6a=_0x1b748f;_0x454d28['model']=_[_0x0ee4('0x3f')](db['Team'][_0x0ee4('0x3b')]);_0x454d28[_0x0ee4('0x3e')]=_['keys'](_0x237456[_0x0ee4('0x3e')]);_0x454d28[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x454d28[_0x0ee4('0x3d')],_0x454d28[_0x0ee4('0x3e')]);_0x791468['attributes']=_['intersection'](_0x454d28[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x791468['attributes']=_0x791468[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x791468[_0x0ee4('0x41')]:_0x454d28[_0x0ee4('0x3d')];_0x791468[_0x0ee4('0x44')]=qs['sort'](_0x237456['query'][_0x0ee4('0x45')]);_0x791468[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x237456[_0x0ee4('0x3e')],_0x454d28['filters']));if(_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x791468['where']=_[_0x0ee4('0x49')](_0x791468[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x791468['attributes'],function(_0x441e20){var _0x166885={};_0x166885[_0x441e20]={'$like':'%'+_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x166885;})});}_0x791468=_[_0x0ee4('0x49')]({},_0x791468,_0x237456[_0x0ee4('0x4c')]);return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x42a6bf){if(_0x42a6bf){_0x3ae5be=_0x42a6bf[_0x0ee4('0x54')];if(!_0x237456['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x791468['limit']=qs[_0x0ee4('0x2c')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x791468[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x20ba78){if(_0x20ba78){return _0x20ba78?{'count':_0x3ae5be,'rows':_0x20ba78}:null;}})['then'](respondWithResult(_0x28aefb,null))['catch'](handleError(_0x28aefb,null));};exports[_0x0ee4('0x6d')]=function(_0x1bc030,_0x3f4371,_0x409a53){var _0x4d57af=_0x1bc030[_0x0ee4('0x5d')][_0x0ee4('0x6e')];return db['Team'][_0x0ee4('0x62')]({'where':{'id':_0x4d57af},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ee4('0x6f'),'attributes':['id','name',_0x0ee4('0x70'),'voicePause',_0x0ee4('0x71')],'raw':!![]}]})[_0x0ee4('0x1e')](function(_0x555c47){if(_0x555c47){var _0x4b11e6=_['flatMap'](_0x555c47,function(_0x356888){var _0x283a3d=_0x356888[_0x0ee4('0x33')]({'plain':!![]});return _0x283a3d[_0x0ee4('0x6f')];});return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x1bc030[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x59dc8a){return db['sequelize'][_0x0ee4('0x72')](function(_0x3ce6a4){return _0x59dc8a[_0x0ee4('0x6d')](_0x4d57af,{'transaction':_0x3ce6a4})['then'](function(){return BPromise[_0x0ee4('0x73')](_0x4b11e6,function(_0x511cbe){return db[_0x0ee4('0x74')][_0x0ee4('0x75')]({'where':{'UserId':_0x511cbe['id'],'ChatQueueId':_0x1bc030[_0x0ee4('0x53')]['id']},'transaction':_0x3ce6a4});});})[_0x0ee4('0x1e')](function(){_0x4b11e6[_0x0ee4('0x76')](function(_0x5cdaf8){socket['emit'](_0x0ee4('0x77'),{'UserId':_0x5cdaf8['id'],'ChatQueueId':_0x59dc8a['id']});});});});});}})[_0x0ee4('0x1e')](respondWithStatusCode(_0x3f4371,null))[_0x0ee4('0x51')](handleError(_0x3f4371,null));};exports[_0x0ee4('0x78')]=function(_0x406935,_0x48a6ff,_0x900f02){return db[_0x0ee4('0x79')][_0x0ee4('0x62')]({'where':{'id':_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x0ee4('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48a6ff,null))[_0x0ee4('0x1e')](function(_0x162bf4){var _0x4035b2=_[_0x0ee4('0x39')](_0x162bf4,'id');var _0x36bd3d=[];var _0x130b49=[];var _0xc2c7b6=squel[_0x0ee4('0x7a')]();_0xc2c7b6[_0x0ee4('0x7b')](_0x0ee4('0x7c'))[_0x0ee4('0x7d')](_0x0ee4('0x7e'),'tq')['join']('user_has_teams','ut',_0x0ee4('0x7f'))[_0x0ee4('0x46')](_0x0ee4('0x80'),_0x406935[_0x0ee4('0x53')]['id']);for(var _0x32956b=0x0;_0x32956b<_0x162bf4['length'];_0x32956b+=0x1){let _0x1e1fdb=_0x162bf4[_0x32956b];for(var _0x1f9b4d=0x0;_0x1f9b4d<_0x1e1fdb[_0x0ee4('0x6f')]['length'];_0x1f9b4d+=0x1){let _0x5663af=_0x1e1fdb[_0x0ee4('0x6f')][_0x1f9b4d];var _0x4d029a=_0xc2c7b6[_0x0ee4('0x81')]();_0x4d029a[_0x0ee4('0x46')]('ut.UserId\x20=\x20?',_0x5663af['id']);_0x130b49[_0x0ee4('0x82')](db[_0x0ee4('0x83')][_0x0ee4('0x3e')](_0x4d029a[_0x0ee4('0x84')](),{'type':db[_0x0ee4('0x83')]['QueryTypes'][_0x0ee4('0x85')]})[_0x0ee4('0x1e')](function(_0xc3e6a3){if(_0xc3e6a3[_0x0ee4('0x54')]===0x1){return _0x5663af['id'];}else{var _0x5dcddd=_[_0x0ee4('0x86')](_[_0x0ee4('0x39')](_0xc3e6a3,_0x0ee4('0x87')),function(_0x1ae871){return _[_0x0ee4('0x88')](_0x4035b2,_0x1ae871);});if(_0x5dcddd){return _0x5663af['id'];}}}));}}return BPromise[_0x0ee4('0x89')](_0x130b49)[_0x0ee4('0x1e')](function(_0x536496){_0x36bd3d=_(_0x36bd3d)[_0x0ee4('0x8a')](_0x536496)[_0x0ee4('0x8b')]()[_0x0ee4('0x8c')]();return db[_0x0ee4('0x3a')][_0x0ee4('0x55')]({'where':{'id':_0x406935[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x264fb0){return db[_0x0ee4('0x83')][_0x0ee4('0x72')](function(_0x1bddd1){return _0x264fb0[_0x0ee4('0x78')](_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')],{'transaction':_0x1bddd1})[_0x0ee4('0x1e')](function(){if(!_[_0x0ee4('0x8d')](_0x36bd3d)){return _0x264fb0[_0x0ee4('0x8e')](_0x36bd3d,{'transaction':_0x1bddd1});}})['then'](function(){_0x36bd3d[_0x0ee4('0x76')](function(_0x123cb3){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':_0x123cb3,'ChatQueueId':_0x264fb0['id']});});});});});});})['then'](respondWithStatusCode(_0x48a6ff,null))[_0x0ee4('0x51')](handleError(_0x48a6ff,null));};exports['addAgents']=function(_0x4430c0,_0x17f36c,_0xf0b41c){return db['ChatQueue']['find']({'where':{'id':_0x4430c0['params']['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x17f36c,null))[_0x0ee4('0x1e')](function(_0x3a2da2){if(_0x3a2da2){return _0x3a2da2[_0x0ee4('0x91')](_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')],_[_0x0ee4('0x92')](_0x4430c0[_0x0ee4('0x5d')],[_0x0ee4('0x6e'),'id'])||{})[_0x0ee4('0x93')](function(_0x38b2f5){for(var _0x23087a=0x0;_0x23087a<_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x23087a+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x23087a]),'ChatQueueId':Number(_0x4430c0[_0x0ee4('0x53')]['id'])});}return _0x38b2f5;});}})[_0x0ee4('0x1e')](respondWithResult(_0x17f36c,null))['catch'](handleError(_0x17f36c,null));};exports[_0x0ee4('0x8e')]=function(_0x588ac7,_0xe2d58e,_0x4de398){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x588ac7[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0xe2d58e,null))[_0x0ee4('0x1e')](function(_0x5d0071){if(_0x5d0071){return _0x5d0071[_0x0ee4('0x8e')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])[_0x0ee4('0x1e')](function(){if(_[_0x0ee4('0x94')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])){for(var _0x87c05d=0x0;_0x87c05d<_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x87c05d+=0x1){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x87c05d]),'ChatQueueId':Number(_0x588ac7['params']['id'])});}}else{socket['emit'](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')]['ids']),'ChatQueueId':Number(_0x588ac7[_0x0ee4('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0xe2d58e,null))[_0x0ee4('0x51')](handleError(_0xe2d58e,null));};exports[_0x0ee4('0x95')]=function(_0x217a7c,_0x2b5d15,_0x6657f6){var _0x4c7639={};var _0x4f65b9={};var _0x484df7;var _0x4ea576;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x217a7c[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x2b5d15,null))[_0x0ee4('0x1e')](function(_0x2a41e6){if(_0x2a41e6){_0x484df7=_0x2a41e6;_0x4f65b9['model']=_[_0x0ee4('0x3f')](db['User'][_0x0ee4('0x3b')]);_0x4f65b9['query']=_[_0x0ee4('0x3f')](_0x217a7c[_0x0ee4('0x3e')]);_0x4f65b9[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x4f65b9[_0x0ee4('0x3d')],_0x4f65b9['query']);_0x4c7639['attributes']=_[_0x0ee4('0x40')](_0x4f65b9['model'],qs[_0x0ee4('0x42')](_0x217a7c[_0x0ee4('0x3e')]['fields']));_0x4c7639['attributes']=_0x4c7639[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x4c7639[_0x0ee4('0x41')]:_0x4f65b9[_0x0ee4('0x3d')];_0x4c7639[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x45')]);_0x4c7639['where']=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x217a7c['query'],_0x4f65b9[_0x0ee4('0x47')]));if(_0x217a7c['query']['filter']){_0x4c7639[_0x0ee4('0x46')]=_['merge'](_0x4c7639[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x4c7639[_0x0ee4('0x41')],function(_0x173e1d){var _0x587245={};_0x587245[_0x173e1d]={'$like':'%'+_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x587245;})});}_0x4c7639=_['merge']({},_0x4c7639,_0x217a7c[_0x0ee4('0x4c')]);return _0x484df7[_0x0ee4('0x95')](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x735d87){if(_0x735d87){_0x4ea576=_0x735d87[_0x0ee4('0x54')];if(!_0x217a7c[_0x0ee4('0x3e')]['hasOwnProperty'](_0x0ee4('0x60'))){_0x4c7639[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x4c7639['offset']=qs[_0x0ee4('0x2d')](_0x217a7c[_0x0ee4('0x3e')]['offset']);}return _0x484df7['getAgents'](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x43084c){if(_0x43084c){return _0x43084c?{'count':_0x4ea576,'rows':_0x43084c}:null;}})['then'](respondWithResult(_0x2b5d15,null))[_0x0ee4('0x51')](handleError(_0x2b5d15,null));}; \ No newline at end of file +var _0x8760=['to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','ChatQueue','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','rows','format','%s/%s','SIP','createdAt','updatedAt','Team','rawAttributes','addTeams','ids','online','voicePause','interface','flatMap','Agents','each','forEach','emit','userChatQueue:save','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x445770,_0x3bff55){var _0x310ece=function(_0x57df88){while(--_0x57df88){_0x445770['push'](_0x445770['shift']());}};_0x310ece(++_0x3bff55);}(_0x8760,0x132));var _0x0876=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x8760[_0x251d9c];return _0x16ae64;};'use strict';var emlformat=require(_0x0876('0x0'));var rimraf=require(_0x0876('0x1'));var zipdir=require(_0x0876('0x2'));var jsonpatch=require(_0x0876('0x3'));var rp=require(_0x0876('0x4'));var moment=require(_0x0876('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0876('0x6'));var util=require(_0x0876('0x7'));var path=require(_0x0876('0x8'));var sox=require(_0x0876('0x9'));var csv=require(_0x0876('0xa'));var ejs=require(_0x0876('0xb'));var fs=require('fs');var fs_extra=require(_0x0876('0xc'));var _=require('lodash');var squel=require(_0x0876('0xd'));var crypto=require(_0x0876('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0876('0xf'));var Redis=require(_0x0876('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0876('0x11'));var as=require(_0x0876('0x12'));var hardwareService=require(_0x0876('0x13'));var logger=require(_0x0876('0x14'))(_0x0876('0x15'));var utils=require(_0x0876('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0876('0x17'));var db=require(_0x0876('0x18'))['db'];config[_0x0876('0x19')]=_[_0x0876('0x1a')](config[_0x0876('0x19')],{'host':_0x0876('0x1b'),'port':0x18eb});var socket=require(_0x0876('0x1c'))(new Redis(config[_0x0876('0x19')]));require(_0x0876('0x1d'))[_0x0876('0x1e')](socket);var jayson=require(_0x0876('0x1f'));var client=jayson[_0x0876('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1524f7,_0x370588,_0xd0a2d7,_0x2bfb9e){return new BPromise(function(_0x1c6328,_0x48480c){var _0x1092cc=_0x2bfb9e||client;return _0x1092cc[_0x0876('0x21')](_0x1524f7,_0xd0a2d7)['then'](function(_0x27961f){logger[_0x0876('0x22')](_0x0876('0x23'),_0x370588,_0x0876('0x24'));logger[_0x0876('0x25')](_0x0876('0x26'),_0x370588,_0x0876('0x24'),JSON['stringify'](_0x27961f));if(_0x27961f[_0x0876('0x27')]){if(_0x27961f[_0x0876('0x27')]['code']===0x1f4){logger['error'](_0x0876('0x23'),_0x370588,_0x27961f[_0x0876('0x27')][_0x0876('0x28')]);return _0x48480c(_0x27961f[_0x0876('0x27')]['message']);}logger[_0x0876('0x27')]('ChatQueue,\x20%s,\x20%s',_0x370588,_0x27961f['error'][_0x0876('0x28')]);return _0x1c6328(_0x27961f[_0x0876('0x27')][_0x0876('0x28')]);}else{logger[_0x0876('0x22')](_0x0876('0x23'),_0x370588,_0x0876('0x24'));_0x1c6328(_0x27961f[_0x0876('0x29')]['message']);}})[_0x0876('0x2a')](function(_0x140a16){logger[_0x0876('0x27')](_0x0876('0x23'),_0x370588,_0x140a16);_0x48480c(_0x140a16);});});}function respondWithStatusCode(_0x26d07d,_0x1448d4){_0x1448d4=_0x1448d4||0xcc;return function(_0x383707){if(_0x383707){return _0x26d07d[_0x0876('0x2b')](_0x1448d4);}return _0x26d07d[_0x0876('0x2c')](_0x1448d4)[_0x0876('0x2d')]();};}function respondWithResult(_0x41b198,_0x3f7f7b){_0x3f7f7b=_0x3f7f7b||0xc8;return function(_0x3dd9a4){if(_0x3dd9a4){return _0x41b198[_0x0876('0x2c')](_0x3f7f7b)[_0x0876('0x2e')](_0x3dd9a4);}};}function respondWithFilteredResult(_0x437b04,_0x1902de){return function(_0x5b0868){if(_0x5b0868){var _0x1af134=typeof _0x1902de[_0x0876('0x2f')]===_0x0876('0x30')&&typeof _0x1902de['limit']===_0x0876('0x30');var _0x4f1912=_0x5b0868[_0x0876('0x31')];var _0x24ff6f=_0x1af134?0x0:_0x1902de[_0x0876('0x2f')];var _0xa4634b=_0x1af134?_0x5b0868['count']:_0x1902de['offset']+_0x1902de['limit'];var _0x11adc2;if(_0xa4634b>=_0x4f1912){_0xa4634b=_0x4f1912;_0x11adc2=0xc8;}else{_0x11adc2=0xce;}_0x437b04['status'](_0x11adc2);return _0x437b04['set']('Content-Range',_0x24ff6f+'-'+_0xa4634b+'/'+_0x4f1912)[_0x0876('0x2e')](_0x5b0868);}return null;};}function patchUpdates(_0x1f03cf){return function(_0x16aba8){try{jsonpatch[_0x0876('0x32')](_0x16aba8,_0x1f03cf,!![]);}catch(_0x1265b7){return BPromise[_0x0876('0x33')](_0x1265b7);}return _0x16aba8[_0x0876('0x34')]();};}function saveUpdates(_0x314138,_0x43970f){return function(_0x13c155){if(_0x13c155){return _0x13c155[_0x0876('0x35')](_0x314138)[_0x0876('0x36')](function(_0x58bf63){return _0x58bf63;});}return null;};}function removeEntity(_0x3ec54c,_0x1e12a3){return function(_0xb1576){if(_0xb1576){return _0xb1576['destroy']()['then'](function(){var _0x11b5e5=_0xb1576[_0x0876('0x37')]({'plain':!![]});var _0x5524b3=_0x0876('0x38');return db[_0x0876('0x39')][_0x0876('0x3a')]({'where':{'type':_0x5524b3,'resourceId':_0x11b5e5['id']}})[_0x0876('0x36')](function(){return _0xb1576;});})[_0x0876('0x36')](function(){_0x3ec54c['status'](0xcc)[_0x0876('0x2d')]();});}};}function handleEntityNotFound(_0x5246df,_0x3d6dbb){return function(_0xffefb5){if(!_0xffefb5){_0x5246df['sendStatus'](0x194);}return _0xffefb5;};}function handleError(_0x1aedd2,_0x209d6e){_0x209d6e=_0x209d6e||0x1f4;return function(_0x3a5fbb){logger['error'](_0x3a5fbb[_0x0876('0x3b')]);if(_0x3a5fbb[_0x0876('0x3c')]){delete _0x3a5fbb[_0x0876('0x3c')];}_0x1aedd2['status'](_0x209d6e)[_0x0876('0x3d')](_0x3a5fbb);};}exports[_0x0876('0x3e')]=function(_0x2be5c1,_0x314578){var _0x12a9e9={},_0x3cffce={},_0xec9498={'count':0x0,'rows':[]};var _0x4b12f1=_['map'](db[_0x0876('0x3f')]['rawAttributes'],function(_0xa74acd){return{'name':_0xa74acd[_0x0876('0x40')],'type':_0xa74acd[_0x0876('0x41')][_0x0876('0x42')]};});_0x3cffce[_0x0876('0x43')]=_[_0x0876('0x44')](_0x4b12f1,_0x0876('0x3c'));_0x3cffce[_0x0876('0x45')]=_[_0x0876('0x46')](_0x2be5c1[_0x0876('0x45')]);_0x3cffce[_0x0876('0x47')]=_[_0x0876('0x48')](_0x3cffce[_0x0876('0x43')],_0x3cffce[_0x0876('0x45')]);_0x12a9e9[_0x0876('0x49')]=_[_0x0876('0x48')](_0x3cffce[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x4a')]));_0x12a9e9[_0x0876('0x49')]=_0x12a9e9[_0x0876('0x49')][_0x0876('0x4b')]?_0x12a9e9[_0x0876('0x49')]:_0x3cffce[_0x0876('0x43')];if(!_0x2be5c1[_0x0876('0x45')][_0x0876('0x4c')](_0x0876('0x4d'))){_0x12a9e9[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x4e')]);_0x12a9e9[_0x0876('0x2f')]=qs['offset'](_0x2be5c1['query'][_0x0876('0x2f')]);}_0x12a9e9[_0x0876('0x4f')]=qs[_0x0876('0x50')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x50')]);_0x12a9e9['where']=qs['filters'](_[_0x0876('0x51')](_0x2be5c1[_0x0876('0x45')],_0x3cffce[_0x0876('0x47')]),_0x4b12f1);if(_0x2be5c1[_0x0876('0x45')]['filter']){_0x12a9e9[_0x0876('0x52')]=_['merge'](_0x12a9e9[_0x0876('0x52')],{'$or':_[_0x0876('0x44')](_0x4b12f1,function(_0x5e79cf){if(_0x5e79cf[_0x0876('0x41')]!==_0x0876('0x53')){var _0x4d328b={};_0x4d328b[_0x5e79cf['name']]={'$like':'%'+_0x2be5c1[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x4d328b;}})});}_0x12a9e9=_['merge']({},_0x12a9e9,_0x2be5c1[_0x0876('0x55')]);var _0x1b1200={'where':_0x12a9e9[_0x0876('0x52')]};return db[_0x0876('0x3f')]['count'](_0x1b1200)[_0x0876('0x36')](function(_0x16fa85){_0xec9498[_0x0876('0x31')]=_0x16fa85;if(_0x2be5c1['query'][_0x0876('0x56')]){_0x12a9e9[_0x0876('0x57')]=[{'all':!![]}];}return db[_0x0876('0x3f')][_0x0876('0x58')](_0x12a9e9);})[_0x0876('0x36')](function(_0x49dbb1){_0xec9498['rows']=_0x49dbb1;return _0xec9498;})['then'](respondWithFilteredResult(_0x314578,_0x12a9e9))[_0x0876('0x2a')](handleError(_0x314578,null));};exports[_0x0876('0x59')]=function(_0x1a0a9c,_0x58fa25){var _0x4be2c5={'raw':!![],'where':{'id':_0x1a0a9c[_0x0876('0x5a')]['id']}},_0x40b328={};_0x40b328[_0x0876('0x43')]=_[_0x0876('0x46')](db['ChatQueue']['rawAttributes']);_0x40b328[_0x0876('0x45')]=_['keys'](_0x1a0a9c[_0x0876('0x45')]);_0x40b328[_0x0876('0x47')]=_[_0x0876('0x48')](_0x40b328[_0x0876('0x43')],_0x40b328[_0x0876('0x45')]);_0x4be2c5['attributes']=_[_0x0876('0x48')](_0x40b328[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x1a0a9c[_0x0876('0x45')][_0x0876('0x4a')]));_0x4be2c5[_0x0876('0x49')]=_0x4be2c5['attributes'][_0x0876('0x4b')]?_0x4be2c5['attributes']:_0x40b328[_0x0876('0x43')];if(_0x1a0a9c[_0x0876('0x45')][_0x0876('0x56')]){_0x4be2c5[_0x0876('0x57')]=[{'all':!![]}];}_0x4be2c5=_[_0x0876('0x5b')]({},_0x4be2c5,_0x1a0a9c[_0x0876('0x55')]);return db[_0x0876('0x3f')]['find'](_0x4be2c5)[_0x0876('0x36')](handleEntityNotFound(_0x58fa25,null))[_0x0876('0x36')](respondWithResult(_0x58fa25,null))[_0x0876('0x2a')](handleError(_0x58fa25,null));};exports[_0x0876('0x5c')]=function(_0x3a922d,_0xf18768){return db[_0x0876('0x3f')]['create'](_0x3a922d['body'],{})['then'](function(_0xd04599){var _0x30a1a5=_0x3a922d[_0x0876('0x5d')][_0x0876('0x37')]({'plain':!![]});if(!_0x30a1a5)throw new Error(_0x0876('0x5e'));if(_0x30a1a5[_0x0876('0x5f')]===_0x0876('0x5d')){var _0x1a4faf=_0xd04599['get']({'plain':!![]});var _0x22de74=_0x0876('0x38');return db[_0x0876('0x60')]['find']({'where':{'name':_0x22de74,'userProfileId':_0x30a1a5[_0x0876('0x61')]},'raw':!![]})[_0x0876('0x36')](function(_0x551a84){if(_0x551a84&&_0x551a84[_0x0876('0x62')]===0x0){return db['UserProfileResource'][_0x0876('0x5c')]({'name':_0x1a4faf['name'],'resourceId':_0x1a4faf['id'],'type':_0x551a84[_0x0876('0x3c')],'sectionId':_0x551a84['id']},{})[_0x0876('0x36')](function(){return _0xd04599;});}else{return _0xd04599;}})['catch'](function(_0x50578c){logger['error'](_0x0876('0x63'),_0x50578c);throw _0x50578c;});}return _0xd04599;})[_0x0876('0x36')](respondWithResult(_0xf18768,0xc9))[_0x0876('0x2a')](handleError(_0xf18768,null));};exports[_0x0876('0x35')]=function(_0x501a46,_0x5d7c7e){if(_0x501a46[_0x0876('0x64')]['id']){delete _0x501a46[_0x0876('0x64')]['id'];}return db[_0x0876('0x3f')]['find']({'where':{'id':_0x501a46['params']['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x5d7c7e,null))[_0x0876('0x36')](saveUpdates(_0x501a46[_0x0876('0x64')],null))[_0x0876('0x36')](respondWithResult(_0x5d7c7e,null))[_0x0876('0x2a')](handleError(_0x5d7c7e,null));};exports[_0x0876('0x3a')]=function(_0x983c3e,_0x151003){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x983c3e[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x151003,null))['then'](removeEntity(_0x151003,null))[_0x0876('0x2a')](handleError(_0x151003,null));};exports[_0x0876('0x66')]=function(_0xa6eff8,_0x2ff4e4){return db[_0x0876('0x3f')][_0x0876('0x66')]()[_0x0876('0x36')](respondWithResult(_0x2ff4e4,null))['catch'](handleError(_0x2ff4e4,null));};exports[_0x0876('0x67')]=function(_0xcd6094,_0x3f92f3,_0x3a509f){var _0x490127={'raw':!![],'where':{}},_0x277c77={},_0x6fe262;return db[_0x0876('0x3f')][_0x0876('0x68')]({'where':{'id':_0xcd6094[_0x0876('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3f92f3,null))[_0x0876('0x36')](function(_0x20b154){if(_0x20b154){_0x6fe262=_0x20b154[_0x0876('0x37')]({'plain':!![]});_0x277c77[_0x0876('0x43')]=_[_0x0876('0x46')](db['UserChatQueue']['rawAttributes']);_0x277c77['query']=_[_0x0876('0x46')](_0xcd6094['query']);_0x277c77[_0x0876('0x47')]=_['intersection'](_0x277c77[_0x0876('0x43')],_0x277c77[_0x0876('0x45')]);_0x490127[_0x0876('0x49')]=_[_0x0876('0x48')](_0x277c77[_0x0876('0x43')],qs[_0x0876('0x4a')](_0xcd6094[_0x0876('0x45')]['fields']));_0x490127[_0x0876('0x49')]=_0x490127[_0x0876('0x49')][_0x0876('0x4b')]?_0x490127[_0x0876('0x49')]:_0x277c77[_0x0876('0x43')];if(!_0xcd6094['query']['hasOwnProperty'](_0x0876('0x4d'))){_0x490127[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0xcd6094[_0x0876('0x45')][_0x0876('0x4e')]);_0x490127[_0x0876('0x2f')]=qs[_0x0876('0x2f')](_0xcd6094[_0x0876('0x45')]['offset']);}_0x490127['order']=qs[_0x0876('0x50')](_0xcd6094[_0x0876('0x45')][_0x0876('0x50')]);_0x490127['where']=qs[_0x0876('0x47')](_['pick'](_0xcd6094[_0x0876('0x45')],_0x277c77[_0x0876('0x47')]));_0x490127[_0x0876('0x52')][_0x0876('0x69')]=_0x20b154['id'];if(_0xcd6094['query'][_0x0876('0x54')]){_0x490127['where']=_[_0x0876('0x5b')](_0x490127['where'],{'$or':_[_0x0876('0x44')](_0x490127[_0x0876('0x49')],function(_0x475a00){var _0x56431a={};_0x56431a[_0x475a00]={'$like':'%'+_0xcd6094[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x56431a;})});}_0x490127=_[_0x0876('0x5b')]({},_0x490127,_0xcd6094[_0x0876('0x55')]);return db['UserChatQueue'][_0x0876('0x58')](_0x490127);}})[_0x0876('0x36')](function(_0xed3537){if(_0xed3537){return db[_0x0876('0x6a')][_0x0876('0x6b')]({'where':{'id':_[_0x0876('0x44')](_0xed3537,_0x0876('0x6c')),'role':_0x0876('0x6d')},'attributes':['id',_0x0876('0x3c'),_0x0876('0x6e'),'updatedAt','createdAt']});}})['then'](function(_0x15d962){if(_0x15d962){return{'count':_0x15d962['count'],'rows':_[_0x0876('0x44')](_0x15d962[_0x0876('0x6f')],function(_0x1adc3b){return{'membername':_0x1adc3b[_0x0876('0x3c')],'UserId':_0x1adc3b['id'],'queue_name':_0x6fe262['name'],'ChatQueueId':_0x6fe262['id'],'interface':util[_0x0876('0x70')](_0x0876('0x71'),_0x0876('0x72'),_0x1adc3b[_0x0876('0x3c')]),'penalty':0x0,'paused':_0x1adc3b['chatPause'],'createdAt':_0x1adc3b[_0x0876('0x73')],'updatedAt':_0x1adc3b[_0x0876('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0876('0x36')](respondWithFilteredResult(_0x3f92f3,_0x490127))[_0x0876('0x2a')](handleError(_0x3f92f3,null));};exports['getTeams']=function(_0x1d65c8,_0x11e4c2,_0x40d8be){var _0x24767b={};var _0x172977={};var _0x1d6862;var _0x5cb767;return db[_0x0876('0x3f')][_0x0876('0x68')]({'where':{'id':_0x1d65c8[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x11e4c2,null))[_0x0876('0x36')](function(_0x7f5ef5){if(_0x7f5ef5){_0x1d6862=_0x7f5ef5;_0x172977['model']=_['keys'](db[_0x0876('0x75')][_0x0876('0x76')]);_0x172977['query']=_['keys'](_0x1d65c8[_0x0876('0x45')]);_0x172977[_0x0876('0x47')]=_[_0x0876('0x48')](_0x172977[_0x0876('0x43')],_0x172977[_0x0876('0x45')]);_0x24767b[_0x0876('0x49')]=_[_0x0876('0x48')](_0x172977[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x1d65c8[_0x0876('0x45')]['fields']));_0x24767b[_0x0876('0x49')]=_0x24767b[_0x0876('0x49')][_0x0876('0x4b')]?_0x24767b[_0x0876('0x49')]:_0x172977[_0x0876('0x43')];_0x24767b[_0x0876('0x4f')]=qs['sort'](_0x1d65c8[_0x0876('0x45')][_0x0876('0x50')]);_0x24767b[_0x0876('0x52')]=qs[_0x0876('0x47')](_[_0x0876('0x51')](_0x1d65c8['query'],_0x172977['filters']));if(_0x1d65c8['query'][_0x0876('0x54')]){_0x24767b[_0x0876('0x52')]=_[_0x0876('0x5b')](_0x24767b['where'],{'$or':_[_0x0876('0x44')](_0x24767b[_0x0876('0x49')],function(_0x8e4610){var _0xd399e9={};_0xd399e9[_0x8e4610]={'$like':'%'+_0x1d65c8['query']['filter']+'%'};return _0xd399e9;})});}_0x24767b=_[_0x0876('0x5b')]({},_0x24767b,_0x1d65c8[_0x0876('0x55')]);return _0x1d6862['getTeams'](_0x24767b);}})[_0x0876('0x36')](function(_0x5099cd){if(_0x5099cd){_0x5cb767=_0x5099cd[_0x0876('0x4b')];if(!_0x1d65c8[_0x0876('0x45')]['hasOwnProperty']('nolimit')){_0x24767b[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x1d65c8[_0x0876('0x45')][_0x0876('0x4e')]);_0x24767b[_0x0876('0x2f')]=qs[_0x0876('0x2f')](_0x1d65c8['query']['offset']);}return _0x1d6862['getTeams'](_0x24767b);}})[_0x0876('0x36')](function(_0x527d5f){if(_0x527d5f){return _0x527d5f?{'count':_0x5cb767,'rows':_0x527d5f}:null;}})[_0x0876('0x36')](respondWithResult(_0x11e4c2,null))[_0x0876('0x2a')](handleError(_0x11e4c2,null));};exports[_0x0876('0x77')]=function(_0x2d358c,_0xca6bc3,_0xb643c9){var _0x1209d1=_0x2d358c[_0x0876('0x64')][_0x0876('0x78')];return db[_0x0876('0x75')][_0x0876('0x58')]({'where':{'id':_0x1209d1},'attributes':['id'],'include':[{'model':db[_0x0876('0x6a')],'as':'Agents','attributes':['id',_0x0876('0x3c'),_0x0876('0x79'),_0x0876('0x7a'),_0x0876('0x7b')],'raw':!![]}]})[_0x0876('0x36')](function(_0x360301){if(_0x360301){var _0x2b285f=_[_0x0876('0x7c')](_0x360301,function(_0x44dd1b){var _0x5c38df=_0x44dd1b[_0x0876('0x37')]({'plain':!![]});return _0x5c38df[_0x0876('0x7d')];});return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x2d358c[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](function(_0x184552){return db['sequelize']['transaction'](function(_0xcc2d0e){return _0x184552[_0x0876('0x77')](_0x1209d1,{'transaction':_0xcc2d0e})[_0x0876('0x36')](function(){return BPromise[_0x0876('0x7e')](_0x2b285f,function(_0x29179f){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x29179f['id'],'ChatQueueId':_0x2d358c['params']['id']},'transaction':_0xcc2d0e});});})['then'](function(){_0x2b285f[_0x0876('0x7f')](function(_0x254b07){socket[_0x0876('0x80')](_0x0876('0x81'),{'UserId':_0x254b07['id'],'ChatQueueId':_0x184552['id']});});});});});}})[_0x0876('0x36')](respondWithStatusCode(_0xca6bc3,null))[_0x0876('0x2a')](handleError(_0xca6bc3,null));};exports['removeTeams']=function(_0x40b5f5,_0x1a793b,_0x2d76b9){return db[_0x0876('0x75')][_0x0876('0x58')]({'where':{'id':_0x40b5f5[_0x0876('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0876('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0876('0x36')](handleEntityNotFound(_0x1a793b,null))[_0x0876('0x36')](function(_0xddac92){var _0x24026e=_[_0x0876('0x44')](_0xddac92,'id');var _0x4f35da=[];var _0x3b39ce=[];var _0x1ac41d=squel['select']();_0x1ac41d[_0x0876('0x82')]('tq.TeamId')[_0x0876('0x83')](_0x0876('0x84'),'tq')[_0x0876('0x85')](_0x0876('0x86'),'ut',_0x0876('0x87'))['where'](_0x0876('0x88'),_0x40b5f5[_0x0876('0x5a')]['id']);for(var _0x20ebd7=0x0;_0x20ebd7<_0xddac92['length'];_0x20ebd7+=0x1){let _0x56b2d5=_0xddac92[_0x20ebd7];for(var _0x22f735=0x0;_0x22f735<_0x56b2d5['Agents'][_0x0876('0x4b')];_0x22f735+=0x1){let _0x47af80=_0x56b2d5[_0x0876('0x7d')][_0x22f735];var _0x533146=_0x1ac41d[_0x0876('0x89')]();_0x533146[_0x0876('0x52')](_0x0876('0x8a'),_0x47af80['id']);_0x3b39ce['push'](db['sequelize']['query'](_0x533146[_0x0876('0x8b')](),{'type':db[_0x0876('0x8c')][_0x0876('0x8d')][_0x0876('0x8e')]})['then'](function(_0x206faf){if(_0x206faf[_0x0876('0x4b')]===0x1){return _0x47af80['id'];}else{var _0x58fb8d=_[_0x0876('0x8f')](_[_0x0876('0x44')](_0x206faf,_0x0876('0x90')),function(_0x5daaa8){return _[_0x0876('0x91')](_0x24026e,_0x5daaa8);});if(_0x58fb8d){return _0x47af80['id'];}}}));}}return BPromise[_0x0876('0x92')](_0x3b39ce)[_0x0876('0x36')](function(_0x394e3a){_0x4f35da=_(_0x4f35da)[_0x0876('0x93')](_0x394e3a)['compact']()[_0x0876('0x94')]();return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x40b5f5[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](function(_0x1c2635){return db['sequelize'][_0x0876('0x95')](function(_0x53e0aa){return _0x1c2635[_0x0876('0x96')](_0x40b5f5[_0x0876('0x45')][_0x0876('0x78')],{'transaction':_0x53e0aa})[_0x0876('0x36')](function(){if(!_[_0x0876('0x97')](_0x4f35da)){return _0x1c2635[_0x0876('0x98')](_0x4f35da,{'transaction':_0x53e0aa});}})['then'](function(){_0x4f35da['forEach'](function(_0x315ce1){socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':_0x315ce1,'ChatQueueId':_0x1c2635['id']});});});});});});})[_0x0876('0x36')](respondWithStatusCode(_0x1a793b,null))[_0x0876('0x2a')](handleError(_0x1a793b,null));};exports['addAgents']=function(_0x496d3f,_0x122dd9,_0xc8b26a){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x496d3f[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x122dd9,null))[_0x0876('0x36')](function(_0x45a245){if(_0x45a245){return _0x45a245[_0x0876('0x9a')](_0x496d3f[_0x0876('0x64')][_0x0876('0x78')],_[_0x0876('0x9b')](_0x496d3f[_0x0876('0x64')],[_0x0876('0x78'),'id'])||{})[_0x0876('0x9c')](function(_0x58d861){for(var _0x501a1b=0x0;_0x501a1b<_0x496d3f['body'][_0x0876('0x78')]['length'];_0x501a1b+=0x1){socket['emit'](_0x0876('0x81'),{'UserId':Number(_0x496d3f[_0x0876('0x64')][_0x0876('0x78')][_0x501a1b]),'ChatQueueId':Number(_0x496d3f[_0x0876('0x5a')]['id'])});}return _0x58d861;});}})[_0x0876('0x36')](respondWithResult(_0x122dd9,null))['catch'](handleError(_0x122dd9,null));};exports[_0x0876('0x98')]=function(_0x44c3f2,_0x367e9f,_0x5b12f8){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x44c3f2['params']['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x367e9f,null))[_0x0876('0x36')](function(_0x2bb535){if(_0x2bb535){return _0x2bb535[_0x0876('0x98')](_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')])[_0x0876('0x36')](function(){if(_['isArray'](_0x44c3f2[_0x0876('0x45')]['ids'])){for(var _0x29948e=0x0;_0x29948e<_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')][_0x0876('0x4b')];_0x29948e+=0x1){socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':Number(_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')][_0x29948e]),'ChatQueueId':Number(_0x44c3f2[_0x0876('0x5a')]['id'])});}}else{socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':Number(_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')]),'ChatQueueId':Number(_0x44c3f2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x367e9f,null))['catch'](handleError(_0x367e9f,null));};exports[_0x0876('0x9d')]=function(_0x3b93e7,_0x14fea0,_0xc305bc){var _0x5ef0be={};var _0x11345a={};var _0x4ed2dc;var _0x1fd5e2;return db['ChatQueue'][_0x0876('0x68')]({'where':{'id':_0x3b93e7[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x14fea0,null))[_0x0876('0x36')](function(_0x3b6d1d){if(_0x3b6d1d){_0x4ed2dc=_0x3b6d1d;_0x11345a['model']=_[_0x0876('0x46')](db['User'][_0x0876('0x76')]);_0x11345a[_0x0876('0x45')]=_[_0x0876('0x46')](_0x3b93e7['query']);_0x11345a[_0x0876('0x47')]=_['intersection'](_0x11345a['model'],_0x11345a[_0x0876('0x45')]);_0x5ef0be[_0x0876('0x49')]=_[_0x0876('0x48')](_0x11345a['model'],qs[_0x0876('0x4a')](_0x3b93e7[_0x0876('0x45')][_0x0876('0x4a')]));_0x5ef0be[_0x0876('0x49')]=_0x5ef0be[_0x0876('0x49')]['length']?_0x5ef0be[_0x0876('0x49')]:_0x11345a[_0x0876('0x43')];_0x5ef0be['order']=qs[_0x0876('0x50')](_0x3b93e7[_0x0876('0x45')]['sort']);_0x5ef0be['where']=qs[_0x0876('0x47')](_[_0x0876('0x51')](_0x3b93e7[_0x0876('0x45')],_0x11345a[_0x0876('0x47')]));if(_0x3b93e7[_0x0876('0x45')][_0x0876('0x54')]){_0x5ef0be[_0x0876('0x52')]=_['merge'](_0x5ef0be[_0x0876('0x52')],{'$or':_['map'](_0x5ef0be[_0x0876('0x49')],function(_0x2ed4cd){var _0x2b7fc5={};_0x2b7fc5[_0x2ed4cd]={'$like':'%'+_0x3b93e7[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x2b7fc5;})});}_0x5ef0be=_['merge']({},_0x5ef0be,_0x3b93e7['options']);return _0x4ed2dc[_0x0876('0x9d')](_0x5ef0be);}})[_0x0876('0x36')](function(_0x36793c){if(_0x36793c){_0x1fd5e2=_0x36793c[_0x0876('0x4b')];if(!_0x3b93e7[_0x0876('0x45')][_0x0876('0x4c')](_0x0876('0x4d'))){_0x5ef0be[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x3b93e7[_0x0876('0x45')][_0x0876('0x4e')]);_0x5ef0be['offset']=qs[_0x0876('0x2f')](_0x3b93e7['query'][_0x0876('0x2f')]);}return _0x4ed2dc[_0x0876('0x9d')](_0x5ef0be);}})[_0x0876('0x36')](function(_0x226f25){if(_0x226f25){return _0x226f25?{'count':_0x1fd5e2,'rows':_0x226f25}:null;}})[_0x0876('0x36')](respondWithResult(_0x14fea0,null))[_0x0876('0x2a')](handleError(_0x14fea0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ae4a98c..19e0ece 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 _0xf6d1=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1ab59f,_0x2d3051){var _0x234db7=function(_0x2db228){while(--_0x2db228){_0x1ab59f['push'](_0x1ab59f['shift']());}};_0x234db7(++_0x2d3051);}(_0xf6d1,0x99));var _0x1f6d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf6d1[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x1f6d('0x0'));var ChatQueue=require(_0x1f6d('0x1'))['db'][_0x1f6d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1f6d('0x3')](0x0);var events={'afterCreate':_0x1f6d('0x4'),'afterUpdate':_0x1f6d('0x5'),'afterDestroy':_0x1f6d('0x6')};function emitEvent(_0x4fa5a2){return function(_0x1b8190,_0x59e1ab,_0x1532aa){ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2+':'+_0x1b8190['id'],_0x1b8190);ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2,_0x1b8190);_0x1532aa(null);};}for(var e in events){if(events[_0x1f6d('0x8')](e)){var event=events[e];ChatQueue[_0x1f6d('0x9')](e,emitEvent(event));}}module[_0x1f6d('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xe528=['update','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners','save'];(function(_0x3cf1b1,_0x445a0a){var _0x347602=function(_0x19c0a1){while(--_0x19c0a1){_0x3cf1b1['push'](_0x3cf1b1['shift']());}};_0x347602(++_0x445a0a);}(_0xe528,0x9d));var _0x8e52=function(_0x33f43e,_0x349e92){_0x33f43e=_0x33f43e-0x0;var _0xa9ae29=_0xe528[_0x33f43e];return _0xa9ae29;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x8e52('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8e52('0x1')](0x0);var events={'afterCreate':_0x8e52('0x2'),'afterUpdate':_0x8e52('0x3'),'afterDestroy':'remove'};function emitEvent(_0x59aed4){return function(_0x450338,_0x454f2d,_0x1bd4fb){ChatQueueEvents[_0x8e52('0x4')](_0x59aed4+':'+_0x450338['id'],_0x450338);ChatQueueEvents['emit'](_0x59aed4,_0x450338);_0x1bd4fb(null);};}for(var e in events){if(events[_0x8e52('0x5')](e)){var event=events[e];ChatQueue[_0x8e52('0x6')](e,emitEvent(event));}}module[_0x8e52('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 6f01525..ca5bb1b 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 _0x0244=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0xf93365,_0x26c5eb){var _0x42fa5d=function(_0x5b9aee){while(--_0x5b9aee){_0xf93365['push'](_0xf93365['shift']());}};_0x42fa5d(++_0x26c5eb);}(_0x0244,0x14b));var _0x4024=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x0244[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x4024('0x0'));var util=require(_0x4024('0x1'));var logger=require(_0x4024('0x2'))(_0x4024('0x3'));var moment=require(_0x4024('0x4'));var BPromise=require(_0x4024('0x5'));var rp=require(_0x4024('0x6'));var fs=require('fs');var path=require(_0x4024('0x7'));var rimraf=require(_0x4024('0x8'));var config=require(_0x4024('0x9'));var attributes=require('./chatQueue.attributes');module[_0x4024('0xa')]=function(_0x4aca82,_0x41efe7){return _0x4aca82[_0x4024('0xb')](_0x4024('0xc'),attributes,{'tableName':_0x4024('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7de=['bluebird','request-promise','./chatQueue.attributes','chat_queues','lodash','../../config/logger'];(function(_0x16ba5b,_0x34ba4c){var _0xc98ed9=function(_0x197167){while(--_0x197167){_0x16ba5b['push'](_0x16ba5b['shift']());}};_0xc98ed9(++_0x34ba4c);}(_0xb7de,0x70));var _0xeb7d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb7de[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xeb7d('0x0'));var util=require('util');var logger=require(_0xeb7d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xeb7d('0x2'));var rp=require(_0xeb7d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb7d('0x4'));module['exports']=function(_0x3c65ba,_0x3b4c1f){return _0x3c65ba['define']('ChatQueue',attributes,{'tableName':_0xeb7d('0x5'),'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 36c48fd..5715f59 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 _0xc584=['request\x20sent','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ChatQueue','ShowChatQueue','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','request','then','info','debug'];(function(_0x5e745e,_0xde2931){var _0x122dab=function(_0xe396a5){while(--_0xe396a5){_0x5e745e['push'](_0x5e745e['shift']());}};_0x122dab(++_0xde2931);}(_0xc584,0xa8));var _0x4c58=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xc584[_0x312abc];return _0x314298;};'use strict';var _=require('lodash');var util=require(_0x4c58('0x0'));var moment=require(_0x4c58('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c58('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c58('0x3'));var logger=require(_0x4c58('0x4'))(_0x4c58('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c58('0x6'));var client=jayson[_0x4c58('0x7')][_0x4c58('0x8')]({'port':0x232a});config[_0x4c58('0x9')]=_[_0x4c58('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c58('0x9')]));require(_0x4c58('0xb'))[_0x4c58('0xc')](socket);function respondWithRpcPromise(_0x39405a,_0xb89ef4,_0x23a115){return new BPromise(function(_0x85e280,_0xd08c65){return client[_0x4c58('0xd')](_0x39405a,_0x23a115)[_0x4c58('0xe')](function(_0x2b21da){logger[_0x4c58('0xf')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,'request\x20sent');logger[_0x4c58('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xb89ef4,_0x4c58('0x11'),JSON[_0x4c58('0x12')](_0x2b21da));if(_0x2b21da[_0x4c58('0x13')]){if(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x14')]===0x1f4){logger[_0x4c58('0x13')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,_0x2b21da[_0x4c58('0x13')]['message']);return _0xd08c65(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);}logger[_0x4c58('0x13')](_0x4c58('0x16'),_0xb89ef4,_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);return _0x85e280(_0x2b21da['error'][_0x4c58('0x15')]);}else{logger[_0x4c58('0xf')](_0x4c58('0x16'),_0xb89ef4,_0x4c58('0x11'));_0x85e280(_0x2b21da[_0x4c58('0x17')]['message']);}})[_0x4c58('0x18')](function(_0x45b1ab){logger['error'](_0x4c58('0x16'),_0xb89ef4,_0x45b1ab);_0xd08c65(_0x45b1ab);});});}exports[_0x4c58('0x19')]=function(_0x1a0062){var _0x2413f4=this;return new Promise(function(_0x227931,_0x46876f){return db['ChatQueue'][_0x4c58('0x1a')]({'raw':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x1d')]||null:null,'attributes':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'limit':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1f')]||null:null,'include':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x20')],function(_0x41bc70){return{'model':db[_0x41bc70['model']],'as':_0x41bc70['as'],'attributes':_0x41bc70[_0x4c58('0x1e')],'include':_0x41bc70[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x41bc70[_0x4c58('0x20')],function(_0x317409){return{'model':db[_0x317409[_0x4c58('0x22')]],'as':_0x317409['as'],'attributes':_0x317409[_0x4c58('0x1e')],'include':_0x317409[_0x4c58('0x20')]?_['map'](_0x317409[_0x4c58('0x20')],function(_0x10b72c){return{'model':db[_0x10b72c[_0x4c58('0x22')]],'as':_0x10b72c['as'],'attributes':_0x10b72c[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c58('0xe')](function(_0x19ed6e){logger[_0x4c58('0xf')](_0x4c58('0x19'),_0x1a0062);logger[_0x4c58('0x10')](_0x4c58('0x19'),_0x1a0062,JSON[_0x4c58('0x12')](_0x19ed6e));_0x227931(_0x19ed6e);})[_0x4c58('0x18')](function(_0x3ec02a){logger[_0x4c58('0x13')](_0x4c58('0x19'),_0x3ec02a[_0x4c58('0x15')],_0x1a0062);_0x46876f(_0x2413f4[_0x4c58('0x13')](0x1f4,_0x3ec02a[_0x4c58('0x15')]));});});};exports['ShowChatQueue']=function(_0x540fad){var _0x5238c9=this;return new Promise(function(_0x282071,_0x50fbeb){return db[_0x4c58('0x23')]['find']({'raw':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x540fad['options']?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1d')]||null:null,'attributes':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'include':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x20')]?_['map'](_0x540fad['options']['include'],function(_0x284335){return{'model':db[_0x284335[_0x4c58('0x22')]],'as':_0x284335['as'],'attributes':_0x284335[_0x4c58('0x1e')],'include':_0x284335['include']?_[_0x4c58('0x21')](_0x284335[_0x4c58('0x20')],function(_0x10d420){return{'model':db[_0x10d420[_0x4c58('0x22')]],'as':_0x10d420['as'],'attributes':_0x10d420['attributes'],'include':_0x10d420[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x10d420[_0x4c58('0x20')],function(_0x4419a6){return{'model':db[_0x4419a6[_0x4c58('0x22')]],'as':_0x4419a6['as'],'attributes':_0x4419a6[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf032cc){logger['info']('ShowChatQueue',_0x540fad);logger[_0x4c58('0x10')]('ShowChatQueue',_0x540fad,JSON[_0x4c58('0x12')](_0xf032cc));_0x282071(_0xf032cc);})[_0x4c58('0x18')](function(_0x3b6aeb){logger[_0x4c58('0x13')](_0x4c58('0x24'),_0x3b6aeb['message'],_0x540fad);_0x50fbeb(_0x5238c9[_0x4c58('0x13')](0x1f4,_0x3b6aeb[_0x4c58('0x15')]));});});}; \ No newline at end of file +var _0xebc4=['./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','ChatQueue','then','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','socket.io-emitter'];(function(_0x7b7e25,_0x36e928){var _0x24e1e5=function(_0x7711e6){while(--_0x7711e6){_0x7b7e25['push'](_0x7b7e25['shift']());}};_0x24e1e5(++_0x36e928);}(_0xebc4,0xf9));var _0x4ebc=function(_0x8df750,_0x22c0f5){_0x8df750=_0x8df750-0x0;var _0x290bc8=_0xebc4[_0x8df750];return _0x290bc8;};'use strict';var _=require('lodash');var util=require(_0x4ebc('0x0'));var moment=require(_0x4ebc('0x1'));var BPromise=require(_0x4ebc('0x2'));var rs=require(_0x4ebc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ebc('0x4'))['db'];var utils=require(_0x4ebc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ebc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4ebc('0x7')]['http']({'port':0x232a});config[_0x4ebc('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4ebc('0x9'))(new Redis(config[_0x4ebc('0x8')]));require(_0x4ebc('0xa'))[_0x4ebc('0xb')](socket);function respondWithRpcPromise(_0x46e0dc,_0x5d6a99,_0x27a221){return new BPromise(function(_0x1b5dbc,_0x12e3c6){return client[_0x4ebc('0xc')](_0x46e0dc,_0x27a221)['then'](function(_0x1522b9){logger['info'](_0x4ebc('0xd'),_0x5d6a99,_0x4ebc('0xe'));logger[_0x4ebc('0xf')](_0x4ebc('0x10'),_0x5d6a99,'request\x20sent',JSON[_0x4ebc('0x11')](_0x1522b9));if(_0x1522b9['error']){if(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x13')]===0x1f4){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);return _0x12e3c6(_0x1522b9['error'][_0x4ebc('0x14')]);}logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')]['message']);return _0x1b5dbc(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5d6a99,_0x4ebc('0xe'));_0x1b5dbc(_0x1522b9[_0x4ebc('0x15')]['message']);}})[_0x4ebc('0x16')](function(_0x28571e){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x28571e);_0x12e3c6(_0x28571e);});});}exports['GetChatQueue']=function(_0x59251b){var _0x249dcf=this;return new Promise(function(_0x3e6195,_0x137ec9){return db['ChatQueue'][_0x4ebc('0x17')]({'raw':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x19')]===undefined?!![]:![]:!![],'where':_0x59251b['options']?_0x59251b['options'][_0x4ebc('0x1a')]||null:null,'attributes':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'limit':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1c')]||null:null,'include':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x59251b[_0x4ebc('0x18')]['include'],function(_0x376a83){return{'model':db[_0x376a83[_0x4ebc('0x1f')]],'as':_0x376a83['as'],'attributes':_0x376a83[_0x4ebc('0x1b')],'include':_0x376a83[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x376a83[_0x4ebc('0x1d')],function(_0x165924){return{'model':db[_0x165924[_0x4ebc('0x1f')]],'as':_0x165924['as'],'attributes':_0x165924[_0x4ebc('0x1b')],'include':_0x165924[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x165924['include'],function(_0x10b09a){return{'model':db[_0x10b09a[_0x4ebc('0x1f')]],'as':_0x10b09a['as'],'attributes':_0x10b09a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42590d){logger[_0x4ebc('0x20')](_0x4ebc('0x21'),_0x59251b);logger[_0x4ebc('0xf')](_0x4ebc('0x21'),_0x59251b,JSON[_0x4ebc('0x11')](_0x42590d));_0x3e6195(_0x42590d);})[_0x4ebc('0x16')](function(_0x1d3d15){logger[_0x4ebc('0x12')]('GetChatQueue',_0x1d3d15[_0x4ebc('0x14')],_0x59251b);_0x137ec9(_0x249dcf[_0x4ebc('0x12')](0x1f4,_0x1d3d15[_0x4ebc('0x14')]));});});};exports['ShowChatQueue']=function(_0x3f9c40){var _0xbf2673=this;return new Promise(function(_0x141869,_0x3da50a){return db[_0x4ebc('0x22')]['find']({'raw':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1a')]||null:null,'attributes':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'include':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_['map'](_0x3f9c40['options'][_0x4ebc('0x1d')],function(_0x136d78){return{'model':db[_0x136d78[_0x4ebc('0x1f')]],'as':_0x136d78['as'],'attributes':_0x136d78[_0x4ebc('0x1b')],'include':_0x136d78[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x136d78[_0x4ebc('0x1d')],function(_0x4af0ec){return{'model':db[_0x4af0ec[_0x4ebc('0x1f')]],'as':_0x4af0ec['as'],'attributes':_0x4af0ec['attributes'],'include':_0x4af0ec['include']?_[_0x4ebc('0x1e')](_0x4af0ec[_0x4ebc('0x1d')],function(_0x34b276){return{'model':db[_0x34b276[_0x4ebc('0x1f')]],'as':_0x34b276['as'],'attributes':_0x34b276[_0x4ebc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4ebc('0x23')](function(_0x4fcfb6){logger[_0x4ebc('0x20')]('ShowChatQueue',_0x3f9c40);logger['debug'](_0x4ebc('0x24'),_0x3f9c40,JSON[_0x4ebc('0x11')](_0x4fcfb6));_0x141869(_0x4fcfb6);})[_0x4ebc('0x16')](function(_0x28ab22){logger[_0x4ebc('0x12')](_0x4ebc('0x24'),_0x28ab22[_0x4ebc('0x14')],_0x3f9c40);_0x3da50a(_0xbf2673['error'](0x1f4,_0x28ab22['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 0967b79..0b6fa75 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 _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0xa9ac50,_0x14e3e4){var _0xfabbe7=function(_0x2b68b5){while(--_0x2b68b5){_0xa9ac50['push'](_0xa9ac50['shift']());}};_0xfabbe7(++_0x14e3e4);}(_0xec56,0x1bd));var _0x6ec5=function(_0x26e154,_0x5e8835){_0x26e154=_0x26e154-0x0;var _0x3e949d=_0xec56[_0x26e154];return _0x3e949d;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file +var _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x42ffa2,_0x4b3b89){var _0x281f01=function(_0x101e47){while(--_0x101e47){_0x42ffa2['push'](_0x42ffa2['shift']());}};_0x281f01(++_0x4b3b89);}(_0x54ef,0x112));var _0xf54e=function(_0x12baa8,_0x30d9b6){_0x12baa8=_0x12baa8-0x0;var _0x3a0200=_0x54ef[_0x12baa8];return _0x3a0200;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index e4b7ba2..56ff6f0 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3bec85,_0x37d590){var _0x26e51a=function(_0xd347f5){while(--_0xd347f5){_0x3bec85['push'](_0x3bec85['shift']());}};_0x26e51a(++_0x37d590);}(_0xe14b,0x93));var _0xbe14=function(_0x36cfae,_0x35dae4){_0x36cfae=_0x36cfae-0x0;var _0x297137=_0xe14b[_0x36cfae];return _0x297137;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x495acd,_0x2d5066){var _0x4a46d8=function(_0x5dec06){while(--_0x5dec06){_0x495acd['push'](_0x495acd['shift']());}};_0x4a46d8(++_0x2d5066);}(_0x55ca,0x126));var _0xa55c=function(_0x5530a9,_0x48e4c2){_0x5530a9=_0x5530a9-0x0;var _0x1c69f4=_0x55ca[_0x5530a9];return _0x1c69f4;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 228d3e0..0bdb05a 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 _0xdeeb=['exports','STRING','DATE','moment'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xdeeb,0x1b3));var _0xbdee=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xdeeb[_0x9fd887];return _0x1a54ab;};'use strict';var moment=require(_0xbdee('0x0'));var Sequelize=require('sequelize');module[_0xbdee('0x1')]={'uniqueid':{'type':Sequelize[_0xbdee('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbdee('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbdee('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbdee('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2707=['STRING','DATE','moment'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x2707,0x143));var _0x7270=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2707[_0x2e4e19];return _0x9ba20b;};'use strict';var moment=require(_0x7270('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7270('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7270('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7270('0x2')]},'reason':{'type':Sequelize[_0x7270('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 15e9eed..41a7625 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 _0x6ab9=['query','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','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','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','intersection'];(function(_0x2ad5cb,_0x34bf2a){var _0x3e3b42=function(_0x2a7be2){while(--_0x2a7be2){_0x2ad5cb['push'](_0x2ad5cb['shift']());}};_0x3e3b42(++_0x34bf2a);}(_0x6ab9,0x19a));var _0x96ab=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6ab9[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x96ab('0x0'));var rimraf=require(_0x96ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96ab('0x2'));var rp=require(_0x96ab('0x3'));var moment=require(_0x96ab('0x4'));var BPromise=require(_0x96ab('0x5'));var Mustache=require(_0x96ab('0x6'));var util=require('util');var path=require('path');var sox=require(_0x96ab('0x7'));var csv=require(_0x96ab('0x8'));var ejs=require(_0x96ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96ab('0xa'));var squel=require(_0x96ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x96ab('0xc'));var deskjs=require(_0x96ab('0xd'));var toCsv=require(_0x96ab('0x8'));var querystring=require(_0x96ab('0xe'));var Papa=require(_0x96ab('0xf'));var Redis=require(_0x96ab('0x10'));var authService=require(_0x96ab('0x11'));var qs=require(_0x96ab('0x12'));var as=require(_0x96ab('0x13'));var hardwareService=require(_0x96ab('0x14'));var logger=require(_0x96ab('0x15'))(_0x96ab('0x16'));var utils=require(_0x96ab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x96ab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9204,_0x1131b5){_0x1131b5=_0x1131b5||0xcc;return function(_0x2d3ec3){if(_0x2d3ec3){return _0x2c9204[_0x96ab('0x19')](_0x1131b5);}return _0x2c9204[_0x96ab('0x1a')](_0x1131b5)[_0x96ab('0x1b')]();};}function respondWithResult(_0x3ff9a9,_0x24e2c4){_0x24e2c4=_0x24e2c4||0xc8;return function(_0x126761){if(_0x126761){return _0x3ff9a9[_0x96ab('0x1a')](_0x24e2c4)[_0x96ab('0x1c')](_0x126761);}};}function respondWithFilteredResult(_0x4df67b,_0x4ec844){return function(_0x3b54cc){if(_0x3b54cc){var _0x8d5c87=typeof _0x4ec844[_0x96ab('0x1d')]==='undefined'&&typeof _0x4ec844[_0x96ab('0x1e')]===_0x96ab('0x1f');var _0x56f92b=_0x3b54cc[_0x96ab('0x20')];var _0x4eca78=_0x8d5c87?0x0:_0x4ec844[_0x96ab('0x1d')];var _0x1a502a=_0x8d5c87?_0x3b54cc[_0x96ab('0x20')]:_0x4ec844[_0x96ab('0x1d')]+_0x4ec844[_0x96ab('0x1e')];var _0x1577bb;if(_0x1a502a>=_0x56f92b){_0x1a502a=_0x56f92b;_0x1577bb=0xc8;}else{_0x1577bb=0xce;}_0x4df67b[_0x96ab('0x1a')](_0x1577bb);return _0x4df67b[_0x96ab('0x21')](_0x96ab('0x22'),_0x4eca78+'-'+_0x1a502a+'/'+_0x56f92b)[_0x96ab('0x1c')](_0x3b54cc);}return null;};}function patchUpdates(_0x2aa3c4){return function(_0x4f3bb4){try{jsonpatch['apply'](_0x4f3bb4,_0x2aa3c4,!![]);}catch(_0x347b91){return BPromise[_0x96ab('0x23')](_0x347b91);}return _0x4f3bb4[_0x96ab('0x24')]();};}function saveUpdates(_0x583be2,_0x41936c){return function(_0x5ccaaa){if(_0x5ccaaa){return _0x5ccaaa[_0x96ab('0x25')](_0x583be2)['then'](function(_0x33c140){return _0x33c140;});}return null;};}function removeEntity(_0x90fa22,_0x5a02d0){return function(_0x1deef7){if(_0x1deef7){return _0x1deef7[_0x96ab('0x26')]()[_0x96ab('0x27')](function(){_0x90fa22[_0x96ab('0x1a')](0xcc)[_0x96ab('0x1b')]();});}};}function handleEntityNotFound(_0x27d6d5,_0x9cb9b6){return function(_0x2837a7){if(!_0x2837a7){_0x27d6d5[_0x96ab('0x19')](0x194);}return _0x2837a7;};}function handleError(_0x53869e,_0x215f09){_0x215f09=_0x215f09||0x1f4;return function(_0x524e1c){logger[_0x96ab('0x28')](_0x524e1c[_0x96ab('0x29')]);if(_0x524e1c[_0x96ab('0x2a')]){delete _0x524e1c[_0x96ab('0x2a')];}_0x53869e[_0x96ab('0x1a')](_0x215f09)[_0x96ab('0x2b')](_0x524e1c);};}exports[_0x96ab('0x2c')]=function(_0x435613,_0x4f954c){var _0xefb070={},_0x269c51={},_0xa5c503={'count':0x0,'rows':[]};var _0x5a998e=_[_0x96ab('0x2d')](db[_0x96ab('0x2e')][_0x96ab('0x2f')],function(_0x575664){return{'name':_0x575664[_0x96ab('0x30')],'type':_0x575664['type'][_0x96ab('0x31')]};});_0x269c51[_0x96ab('0x32')]=_['map'](_0x5a998e,_0x96ab('0x2a'));_0x269c51['query']=_['keys'](_0x435613['query']);_0x269c51['filters']=_[_0x96ab('0x33')](_0x269c51['model'],_0x269c51[_0x96ab('0x34')]);_0xefb070[_0x96ab('0x35')]=_[_0x96ab('0x33')](_0x269c51[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x435613['query']['fields']));_0xefb070[_0x96ab('0x35')]=_0xefb070[_0x96ab('0x35')]['length']?_0xefb070[_0x96ab('0x35')]:_0x269c51[_0x96ab('0x32')];if(!_0x435613['query']['hasOwnProperty'](_0x96ab('0x37'))){_0xefb070[_0x96ab('0x1e')]=qs[_0x96ab('0x1e')](_0x435613[_0x96ab('0x34')]['limit']);_0xefb070[_0x96ab('0x1d')]=qs['offset'](_0x435613['query'][_0x96ab('0x1d')]);}_0xefb070['order']=qs[_0x96ab('0x38')](_0x435613[_0x96ab('0x34')][_0x96ab('0x38')]);_0xefb070[_0x96ab('0x39')]=qs['filters'](_[_0x96ab('0x3a')](_0x435613[_0x96ab('0x34')],_0x269c51[_0x96ab('0x3b')]),_0x5a998e);if(_0x435613[_0x96ab('0x34')][_0x96ab('0x3c')]){_0xefb070['where']=_[_0x96ab('0x3d')](_0xefb070['where'],{'$or':_[_0x96ab('0x2d')](_0x5a998e,function(_0x4dae51){if(_0x4dae51[_0x96ab('0x3e')]!==_0x96ab('0x3f')){var _0x3f2305={};_0x3f2305[_0x4dae51[_0x96ab('0x2a')]]={'$like':'%'+_0x435613['query'][_0x96ab('0x3c')]+'%'};return _0x3f2305;}})});}_0xefb070=_[_0x96ab('0x3d')]({},_0xefb070,_0x435613[_0x96ab('0x40')]);var _0x3c7e5d={'where':_0xefb070[_0x96ab('0x39')]};return db[_0x96ab('0x2e')][_0x96ab('0x20')](_0x3c7e5d)[_0x96ab('0x27')](function(_0x14bcbf){_0xa5c503[_0x96ab('0x20')]=_0x14bcbf;if(_0x435613[_0x96ab('0x34')][_0x96ab('0x41')]){_0xefb070['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x96ab('0x42')](_0xefb070);})[_0x96ab('0x27')](function(_0xb541d8){_0xa5c503[_0x96ab('0x43')]=_0xb541d8;return _0xa5c503;})[_0x96ab('0x27')](respondWithFilteredResult(_0x4f954c,_0xefb070))[_0x96ab('0x44')](handleError(_0x4f954c,null));};exports[_0x96ab('0x45')]=function(_0x4b73d7,_0x347957){var _0x53f848={'raw':!![],'where':{'id':_0x4b73d7[_0x96ab('0x46')]['id']}},_0x5e8109={};_0x5e8109[_0x96ab('0x32')]=_['keys'](db[_0x96ab('0x2e')][_0x96ab('0x2f')]);_0x5e8109[_0x96ab('0x34')]=_[_0x96ab('0x47')](_0x4b73d7[_0x96ab('0x34')]);_0x5e8109['filters']=_[_0x96ab('0x33')](_0x5e8109['model'],_0x5e8109['query']);_0x53f848[_0x96ab('0x35')]=_['intersection'](_0x5e8109[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x4b73d7[_0x96ab('0x34')]['fields']));_0x53f848[_0x96ab('0x35')]=_0x53f848[_0x96ab('0x35')][_0x96ab('0x48')]?_0x53f848[_0x96ab('0x35')]:_0x5e8109[_0x96ab('0x32')];if(_0x4b73d7['query'][_0x96ab('0x41')]){_0x53f848['include']=[{'all':!![]}];}_0x53f848=_[_0x96ab('0x3d')]({},_0x53f848,_0x4b73d7['options']);return db[_0x96ab('0x2e')]['find'](_0x53f848)[_0x96ab('0x27')](handleEntityNotFound(_0x347957,null))[_0x96ab('0x27')](respondWithResult(_0x347957,null))[_0x96ab('0x44')](handleError(_0x347957,null));};exports[_0x96ab('0x49')]=function(_0x25d387,_0x42dbd7){return db['ChatQueueReport'][_0x96ab('0x49')](_0x25d387[_0x96ab('0x4a')],{})['then'](respondWithResult(_0x42dbd7,0xc9))[_0x96ab('0x44')](handleError(_0x42dbd7,null));};exports['update']=function(_0x14b467,_0x170992){if(_0x14b467[_0x96ab('0x4a')]['id']){delete _0x14b467['body']['id'];}return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x14b467['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x170992,null))[_0x96ab('0x27')](saveUpdates(_0x14b467[_0x96ab('0x4a')],null))[_0x96ab('0x27')](respondWithResult(_0x170992,null))[_0x96ab('0x44')](handleError(_0x170992,null));};exports[_0x96ab('0x26')]=function(_0x13b865,_0x5f2521){return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x13b865['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x5f2521,null))[_0x96ab('0x27')](removeEntity(_0x5f2521,null))['catch'](handleError(_0x5f2521,null));};exports[_0x96ab('0x4c')]=function(_0x2454b4,_0x391169){return db[_0x96ab('0x2e')][_0x96ab('0x4c')]()[_0x96ab('0x27')](respondWithResult(_0x391169,null))[_0x96ab('0x44')](handleError(_0x391169,null));}; \ No newline at end of file +var _0xacc6=['index','map','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueueReport','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send'];(function(_0x283290,_0x1bef2f){var _0x4c7e20=function(_0x44d8ad){while(--_0x44d8ad){_0x283290['push'](_0x283290['shift']());}};_0x4c7e20(++_0x1bef2f);}(_0xacc6,0x150));var _0x6acc=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xacc6[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0x6acc('0x0'));var rimraf=require(_0x6acc('0x1'));var zipdir=require(_0x6acc('0x2'));var jsonpatch=require(_0x6acc('0x3'));var rp=require(_0x6acc('0x4'));var moment=require('moment');var BPromise=require(_0x6acc('0x5'));var Mustache=require(_0x6acc('0x6'));var util=require(_0x6acc('0x7'));var path=require('path');var sox=require(_0x6acc('0x8'));var csv=require('to-csv');var ejs=require(_0x6acc('0x9'));var fs=require('fs');var fs_extra=require(_0x6acc('0xa'));var _=require('lodash');var squel=require(_0x6acc('0xb'));var crypto=require('crypto');var jsforce=require(_0x6acc('0xc'));var deskjs=require(_0x6acc('0xd'));var toCsv=require(_0x6acc('0xe'));var querystring=require(_0x6acc('0xf'));var Papa=require('papaparse');var Redis=require(_0x6acc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6acc('0x11'));var as=require(_0x6acc('0x12'));var hardwareService=require(_0x6acc('0x13'));var logger=require(_0x6acc('0x14'))(_0x6acc('0x15'));var utils=require(_0x6acc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6acc('0x17'));var db=require(_0x6acc('0x18'))['db'];function respondWithStatusCode(_0x1d951c,_0xcf8224){_0xcf8224=_0xcf8224||0xcc;return function(_0x1b95a6){if(_0x1b95a6){return _0x1d951c['sendStatus'](_0xcf8224);}return _0x1d951c['status'](_0xcf8224)[_0x6acc('0x19')]();};}function respondWithResult(_0x497356,_0x14a543){_0x14a543=_0x14a543||0xc8;return function(_0x230318){if(_0x230318){return _0x497356[_0x6acc('0x1a')](_0x14a543)[_0x6acc('0x1b')](_0x230318);}};}function respondWithFilteredResult(_0x3c4e61,_0x4034fb){return function(_0xf24527){if(_0xf24527){var _0xc07208=typeof _0x4034fb[_0x6acc('0x1c')]===_0x6acc('0x1d')&&typeof _0x4034fb[_0x6acc('0x1e')]===_0x6acc('0x1d');var _0x24f513=_0xf24527[_0x6acc('0x1f')];var _0x3818d8=_0xc07208?0x0:_0x4034fb[_0x6acc('0x1c')];var _0x4ee616=_0xc07208?_0xf24527[_0x6acc('0x1f')]:_0x4034fb[_0x6acc('0x1c')]+_0x4034fb[_0x6acc('0x1e')];var _0x151282;if(_0x4ee616>=_0x24f513){_0x4ee616=_0x24f513;_0x151282=0xc8;}else{_0x151282=0xce;}_0x3c4e61['status'](_0x151282);return _0x3c4e61[_0x6acc('0x20')]('Content-Range',_0x3818d8+'-'+_0x4ee616+'/'+_0x24f513)['json'](_0xf24527);}return null;};}function patchUpdates(_0x4af9e){return function(_0x5d5382){try{jsonpatch[_0x6acc('0x21')](_0x5d5382,_0x4af9e,!![]);}catch(_0x3edf4a){return BPromise[_0x6acc('0x22')](_0x3edf4a);}return _0x5d5382[_0x6acc('0x23')]();};}function saveUpdates(_0x245536,_0x5ecb25){return function(_0x3e4a71){if(_0x3e4a71){return _0x3e4a71[_0x6acc('0x24')](_0x245536)['then'](function(_0x334416){return _0x334416;});}return null;};}function removeEntity(_0x5ba0b6,_0x22abf1){return function(_0x1db7bd){if(_0x1db7bd){return _0x1db7bd[_0x6acc('0x25')]()[_0x6acc('0x26')](function(){_0x5ba0b6['status'](0xcc)[_0x6acc('0x19')]();});}};}function handleEntityNotFound(_0xa4d97c,_0x4a4ca1){return function(_0x10f286){if(!_0x10f286){_0xa4d97c[_0x6acc('0x27')](0x194);}return _0x10f286;};}function handleError(_0x441f90,_0x125084){_0x125084=_0x125084||0x1f4;return function(_0x212bde){logger[_0x6acc('0x28')](_0x212bde[_0x6acc('0x29')]);if(_0x212bde[_0x6acc('0x2a')]){delete _0x212bde['name'];}_0x441f90[_0x6acc('0x1a')](_0x125084)[_0x6acc('0x2b')](_0x212bde);};}exports[_0x6acc('0x2c')]=function(_0x490ce6,_0x1bcfad){var _0x8e75a9={},_0x3c8c95={},_0x259373={'count':0x0,'rows':[]};var _0x19fdd3=_[_0x6acc('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x47ff48){return{'name':_0x47ff48['fieldName'],'type':_0x47ff48[_0x6acc('0x2e')][_0x6acc('0x2f')]};});_0x3c8c95[_0x6acc('0x30')]=_[_0x6acc('0x2d')](_0x19fdd3,_0x6acc('0x2a'));_0x3c8c95[_0x6acc('0x31')]=_['keys'](_0x490ce6['query']);_0x3c8c95[_0x6acc('0x32')]=_[_0x6acc('0x33')](_0x3c8c95[_0x6acc('0x30')],_0x3c8c95[_0x6acc('0x31')]);_0x8e75a9['attributes']=_[_0x6acc('0x33')](_0x3c8c95[_0x6acc('0x30')],qs['fields'](_0x490ce6[_0x6acc('0x31')][_0x6acc('0x34')]));_0x8e75a9[_0x6acc('0x35')]=_0x8e75a9['attributes']['length']?_0x8e75a9[_0x6acc('0x35')]:_0x3c8c95[_0x6acc('0x30')];if(!_0x490ce6['query']['hasOwnProperty'](_0x6acc('0x36'))){_0x8e75a9[_0x6acc('0x1e')]=qs[_0x6acc('0x1e')](_0x490ce6['query'][_0x6acc('0x1e')]);_0x8e75a9[_0x6acc('0x1c')]=qs[_0x6acc('0x1c')](_0x490ce6[_0x6acc('0x31')][_0x6acc('0x1c')]);}_0x8e75a9['order']=qs[_0x6acc('0x37')](_0x490ce6['query'][_0x6acc('0x37')]);_0x8e75a9[_0x6acc('0x38')]=qs['filters'](_[_0x6acc('0x39')](_0x490ce6['query'],_0x3c8c95['filters']),_0x19fdd3);if(_0x490ce6[_0x6acc('0x31')][_0x6acc('0x3a')]){_0x8e75a9[_0x6acc('0x38')]=_['merge'](_0x8e75a9[_0x6acc('0x38')],{'$or':_['map'](_0x19fdd3,function(_0x1841b1){if(_0x1841b1['type']!==_0x6acc('0x3b')){var _0x13f74a={};_0x13f74a[_0x1841b1['name']]={'$like':'%'+_0x490ce6[_0x6acc('0x31')][_0x6acc('0x3a')]+'%'};return _0x13f74a;}})});}_0x8e75a9=_[_0x6acc('0x3c')]({},_0x8e75a9,_0x490ce6[_0x6acc('0x3d')]);var _0x46f7db={'where':_0x8e75a9[_0x6acc('0x38')]};return db[_0x6acc('0x3e')]['count'](_0x46f7db)['then'](function(_0x3481ad){_0x259373[_0x6acc('0x1f')]=_0x3481ad;if(_0x490ce6[_0x6acc('0x31')]['includeAll']){_0x8e75a9[_0x6acc('0x3f')]=[{'all':!![]}];}return db[_0x6acc('0x3e')][_0x6acc('0x40')](_0x8e75a9);})[_0x6acc('0x26')](function(_0x3f848c){_0x259373[_0x6acc('0x41')]=_0x3f848c;return _0x259373;})[_0x6acc('0x26')](respondWithFilteredResult(_0x1bcfad,_0x8e75a9))[_0x6acc('0x42')](handleError(_0x1bcfad,null));};exports[_0x6acc('0x43')]=function(_0x1c2776,_0x114709){var _0x17f828={'raw':!![],'where':{'id':_0x1c2776['params']['id']}},_0x5c938d={};_0x5c938d['model']=_[_0x6acc('0x44')](db['ChatQueueReport']['rawAttributes']);_0x5c938d[_0x6acc('0x31')]=_[_0x6acc('0x44')](_0x1c2776[_0x6acc('0x31')]);_0x5c938d[_0x6acc('0x32')]=_[_0x6acc('0x33')](_0x5c938d[_0x6acc('0x30')],_0x5c938d[_0x6acc('0x31')]);_0x17f828[_0x6acc('0x35')]=_[_0x6acc('0x33')](_0x5c938d[_0x6acc('0x30')],qs[_0x6acc('0x34')](_0x1c2776[_0x6acc('0x31')][_0x6acc('0x34')]));_0x17f828['attributes']=_0x17f828[_0x6acc('0x35')][_0x6acc('0x45')]?_0x17f828['attributes']:_0x5c938d[_0x6acc('0x30')];if(_0x1c2776['query'][_0x6acc('0x46')]){_0x17f828[_0x6acc('0x3f')]=[{'all':!![]}];}_0x17f828=_['merge']({},_0x17f828,_0x1c2776[_0x6acc('0x3d')]);return db[_0x6acc('0x3e')][_0x6acc('0x47')](_0x17f828)[_0x6acc('0x26')](handleEntityNotFound(_0x114709,null))[_0x6acc('0x26')](respondWithResult(_0x114709,null))['catch'](handleError(_0x114709,null));};exports[_0x6acc('0x48')]=function(_0x391a4f,_0x45c5e0){return db[_0x6acc('0x3e')][_0x6acc('0x48')](_0x391a4f[_0x6acc('0x49')],{})[_0x6acc('0x26')](respondWithResult(_0x45c5e0,0xc9))[_0x6acc('0x42')](handleError(_0x45c5e0,null));};exports[_0x6acc('0x24')]=function(_0x28e601,_0x1989a6){if(_0x28e601[_0x6acc('0x49')]['id']){delete _0x28e601[_0x6acc('0x49')]['id'];}return db[_0x6acc('0x3e')][_0x6acc('0x47')]({'where':{'id':_0x28e601[_0x6acc('0x4a')]['id']}})[_0x6acc('0x26')](handleEntityNotFound(_0x1989a6,null))['then'](saveUpdates(_0x28e601['body'],null))['then'](respondWithResult(_0x1989a6,null))[_0x6acc('0x42')](handleError(_0x1989a6,null));};exports[_0x6acc('0x25')]=function(_0x5d63ee,_0x13e10e){return db[_0x6acc('0x3e')][_0x6acc('0x47')]({'where':{'id':_0x5d63ee[_0x6acc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13e10e,null))[_0x6acc('0x26')](removeEntity(_0x13e10e,null))[_0x6acc('0x42')](handleError(_0x13e10e,null));};exports[_0x6acc('0x4b')]=function(_0x1a1e1f,_0x459b99){return db['ChatQueueReport'][_0x6acc('0x4b')]()[_0x6acc('0x26')](respondWithResult(_0x459b99,null))[_0x6acc('0x42')](handleError(_0x459b99,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 915a2dd..e7ae753 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x11d3b5,_0x13fce1){var _0x332d27=function(_0x346fcb){while(--_0x346fcb){_0x11d3b5['push'](_0x11d3b5['shift']());}};_0x332d27(++_0x13fce1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 863fe7a..9cef27f 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 _0x8748=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c7bbd,_0x5617f9){var _0x38e260=function(_0x538771){while(--_0x538771){_0x4c7bbd['push'](_0x4c7bbd['shift']());}};_0x38e260(++_0x5617f9);}(_0x8748,0x9e));var _0x8874=function(_0x471cfd,_0xe74c8c){_0x471cfd=_0x471cfd-0x0;var _0x12cf40=_0x8748[_0x471cfd];return _0x12cf40;};'use strict';var _=require(_0x8874('0x0'));var util=require(_0x8874('0x1'));var moment=require(_0x8874('0x2'));var BPromise=require(_0x8874('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8874('0x4'));var db=require(_0x8874('0x5'))['db'];var utils=require(_0x8874('0x6'));var logger=require(_0x8874('0x7'))(_0x8874('0x8'));var config=require(_0x8874('0x9'));var jayson=require(_0x8874('0xa'));var client=jayson['client'][_0x8874('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b372a,_0x1f57b3,_0x482f29){return new BPromise(function(_0x548467,_0x424872){return client['request'](_0x5b372a,_0x482f29)[_0x8874('0xc')](function(_0x21b54d){logger[_0x8874('0xd')](_0x8874('0xe'),_0x1f57b3,_0x8874('0xf'));logger[_0x8874('0x10')](_0x8874('0x11'),_0x1f57b3,_0x8874('0xf'),JSON[_0x8874('0x12')](_0x21b54d));if(_0x21b54d[_0x8874('0x13')]){if(_0x21b54d[_0x8874('0x13')][_0x8874('0x14')]===0x1f4){logger[_0x8874('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x424872(_0x21b54d['error'][_0x8874('0x15')]);}logger['error'](_0x8874('0xe'),_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x548467(_0x21b54d[_0x8874('0x13')]['message']);}else{logger[_0x8874('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x8874('0xf'));_0x548467(_0x21b54d[_0x8874('0x16')][_0x8874('0x15')]);}})['catch'](function(_0x1b0501){logger['error'](_0x8874('0xe'),_0x1f57b3,_0x1b0501);_0x424872(_0x1b0501);});});}exports[_0x8874('0x17')]=function(_0x1a1725){var _0x1e7138=this;return new Promise(function(_0x2122db,_0x484390){return db['ChatQueueReport'][_0x8874('0x18')](_0x1a1725[_0x8874('0x19')],{'raw':_0x1a1725[_0x8874('0x1a')]?_0x1a1725[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![]})[_0x8874('0xc')](function(_0x5e4552){logger[_0x8874('0xd')](_0x8874('0x17'),_0x1a1725);logger[_0x8874('0x10')]('CreateChatQueueReport',_0x1a1725,JSON[_0x8874('0x12')](_0x5e4552));_0x2122db(_0x5e4552);})[_0x8874('0x1c')](function(_0x18c03b){logger['error'](_0x8874('0x17'),_0x18c03b[_0x8874('0x15')],_0x1a1725);_0x484390(_0x1e7138[_0x8874('0x13')](0x1f4,_0x18c03b[_0x8874('0x15')]));});});};exports[_0x8874('0x1d')]=function(_0x55f589){var _0x38e938=this;return new Promise(function(_0x971726,_0x17665a){return db['ChatQueueReport'][_0x8874('0x1e')](_0x55f589['body'],{'raw':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f589['options']?_0x55f589[_0x8874('0x1a')][_0x8874('0x1f')]||null:null,'attributes':_0x55f589['options']?_0x55f589[_0x8874('0x1a')]['attributes']||null:null,'limit':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x20')]||null:null})['then'](function(_0x4a80a6){logger[_0x8874('0xd')]('UpdateChatQueueReport',_0x55f589);logger[_0x8874('0x10')](_0x8874('0x1d'),_0x55f589,JSON[_0x8874('0x12')](_0x4a80a6));_0x971726(_0x4a80a6);})[_0x8874('0x1c')](function(_0x289b2d){logger[_0x8874('0x13')](_0x8874('0x1d'),_0x289b2d[_0x8874('0x15')],_0x55f589);_0x17665a(_0x38e938[_0x8874('0x13')](0x1f4,_0x289b2d[_0x8874('0x15')]));});});}; \ No newline at end of file +var _0x0de2=['message','info','result','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','attributes','limit','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2ab5c1,_0x50cd7d){var _0x24a514=function(_0x48be12){while(--_0x48be12){_0x2ab5c1['push'](_0x2ab5c1['shift']());}};_0x24a514(++_0x50cd7d);}(_0x0de2,0xa4));var _0x20de=function(_0x422994,_0x99047b){_0x422994=_0x422994-0x0;var _0x43ad8f=_0x0de2[_0x422994];return _0x43ad8f;};'use strict';var _=require('lodash');var util=require(_0x20de('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x20de('0x1'));var fs=require('fs');var Redis=require(_0x20de('0x2'));var db=require(_0x20de('0x3'))['db'];var utils=require(_0x20de('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x20de('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x20de('0x6')][_0x20de('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e72e0,_0x92d904,_0x46a18e){return new BPromise(function(_0x3bc681,_0x157494){return client[_0x20de('0x8')](_0x5e72e0,_0x46a18e)[_0x20de('0x9')](function(_0x149e8c){logger['info'](_0x20de('0xa'),_0x92d904,_0x20de('0xb'));logger[_0x20de('0xc')](_0x20de('0xd'),_0x92d904,_0x20de('0xb'),JSON['stringify'](_0x149e8c));if(_0x149e8c[_0x20de('0xe')]){if(_0x149e8c[_0x20de('0xe')][_0x20de('0xf')]===0x1f4){logger[_0x20de('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x92d904,_0x149e8c[_0x20de('0xe')][_0x20de('0x10')]);return _0x157494(_0x149e8c['error'][_0x20de('0x10')]);}logger['error'](_0x20de('0xa'),_0x92d904,_0x149e8c[_0x20de('0xe')]['message']);return _0x3bc681(_0x149e8c[_0x20de('0xe')]['message']);}else{logger[_0x20de('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x92d904,_0x20de('0xb'));_0x3bc681(_0x149e8c[_0x20de('0x12')][_0x20de('0x10')]);}})['catch'](function(_0x4d76da){logger[_0x20de('0xe')](_0x20de('0xa'),_0x92d904,_0x4d76da);_0x157494(_0x4d76da);});});}exports['CreateChatQueueReport']=function(_0x35bd02){var _0x3c2924=this;return new Promise(function(_0x1fb1ce,_0x55d422){return db[_0x20de('0x13')][_0x20de('0x14')](_0x35bd02[_0x20de('0x15')],{'raw':_0x35bd02[_0x20de('0x16')]?_0x35bd02[_0x20de('0x16')][_0x20de('0x17')]===undefined?!![]:![]:!![]})[_0x20de('0x9')](function(_0x3ba9bb){logger[_0x20de('0x11')](_0x20de('0x18'),_0x35bd02);logger[_0x20de('0xc')](_0x20de('0x18'),_0x35bd02,JSON[_0x20de('0x19')](_0x3ba9bb));_0x1fb1ce(_0x3ba9bb);})['catch'](function(_0x57b938){logger[_0x20de('0xe')]('CreateChatQueueReport',_0x57b938[_0x20de('0x10')],_0x35bd02);_0x55d422(_0x3c2924['error'](0x1f4,_0x57b938[_0x20de('0x10')]));});});};exports[_0x20de('0x1a')]=function(_0x3ed8de){var _0x21bd82=this;return new Promise(function(_0x49dcd5,_0x4693c2){return db[_0x20de('0x13')]['update'](_0x3ed8de[_0x20de('0x15')],{'raw':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de['options'][_0x20de('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de['options']['where']||null:null,'attributes':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de[_0x20de('0x16')][_0x20de('0x1b')]||null:null,'limit':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de[_0x20de('0x16')][_0x20de('0x1c')]||null:null})[_0x20de('0x9')](function(_0x366839){logger[_0x20de('0x11')](_0x20de('0x1a'),_0x3ed8de);logger[_0x20de('0xc')](_0x20de('0x1a'),_0x3ed8de,JSON['stringify'](_0x366839));_0x49dcd5(_0x366839);})[_0x20de('0x1d')](function(_0x22ba5e){logger[_0x20de('0xe')](_0x20de('0x1a'),_0x22ba5e['message'],_0x3ed8de);_0x4693c2(_0x21bd82[_0x20de('0xe')](0x1f4,_0x22ba5e[_0x20de('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index f435140..10ddfc3 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 _0x9d47=['put','update','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create'];(function(_0x3423b0,_0x4eb7e8){var _0x4b13cf=function(_0x900ca7){while(--_0x900ca7){_0x3423b0['push'](_0x3423b0['shift']());}};_0x4b13cf(++_0x4eb7e8);}(_0x9d47,0xca));var _0x79d4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9d47[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x79d4('0x0'));var util=require(_0x79d4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x79d4('0x2'));var auth=require(_0x79d4('0x3'));var interaction=require(_0x79d4('0x4'));var config=require(_0x79d4('0x5'));var controller=require(_0x79d4('0x6'));router[_0x79d4('0x7')]('/',auth['isAuthenticated'](),controller[_0x79d4('0x8')]);router['get'](_0x79d4('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0xb')]);router[_0x79d4('0xc')]('/',auth[_0x79d4('0xa')](),controller[_0x79d4('0xd')]);router[_0x79d4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x79d4('0xf')]);router['delete']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0x10')]);module[_0x79d4('0x11')]=router; \ No newline at end of file +var _0xcea1=['isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xcea1,0x7f));var _0x1cea=function(_0x3058bc,_0x391ddb){_0x3058bc=_0x3058bc-0x0;var _0x586a60=_0xcea1[_0x3058bc];return _0x586a60;};'use strict';var multer=require(_0x1cea('0x0'));var util=require(_0x1cea('0x1'));var path=require(_0x1cea('0x2'));var timeout=require(_0x1cea('0x3'));var express=require('express');var router=express[_0x1cea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1cea('0x5'));var interaction=require(_0x1cea('0x6'));var config=require(_0x1cea('0x7'));var controller=require('./chatQueueReport.controller');router[_0x1cea('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1cea('0x8')]('/describe',auth[_0x1cea('0x9')](),controller['describe']);router[_0x1cea('0x8')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0xb')]);router[_0x1cea('0xc')]('/',auth[_0x1cea('0x9')](),controller['create']);router[_0x1cea('0xd')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0xe')]);router[_0x1cea('0xf')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index cc31e85..c336152 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x80d246,_0x167b6a){_0x80d246=_0x80d246-0x0;var _0x45ee56=_0xb43b[_0x80d246];return _0x45ee56;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x214d3d,_0x1c7156){var _0x1d585e=function(_0x41ce57){while(--_0x41ce57){_0x214d3d['push'](_0x214d3d['shift']());}};_0x1d585e(++_0x1c7156);}(_0xe706,0xa3));var _0x6e70=function(_0x374870,_0x82a474){_0x374870=_0x374870-0x0;var _0x4de8f4=_0xe706[_0x374870];return _0x4de8f4;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 67129a1..922497a 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 _0xeb5d=['merge','find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','stack','name','send','map','ChatTransferReport','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include'];(function(_0x44d8d1,_0x2a600e){var _0x5babcf=function(_0x5ae877){while(--_0x5ae877){_0x44d8d1['push'](_0x44d8d1['shift']());}};_0x5babcf(++_0x2a600e);}(_0xeb5d,0x126));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdeb5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdeb5('0x1'));var rp=require(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdeb5('0x4'));var util=require(_0xdeb5('0x5'));var path=require(_0xdeb5('0x6'));var sox=require(_0xdeb5('0x7'));var csv=require(_0xdeb5('0x8'));var ejs=require(_0xdeb5('0x9'));var fs=require('fs');var fs_extra=require(_0xdeb5('0xa'));var _=require(_0xdeb5('0xb'));var squel=require(_0xdeb5('0xc'));var crypto=require('crypto');var jsforce=require(_0xdeb5('0xd'));var deskjs=require(_0xdeb5('0xe'));var toCsv=require(_0xdeb5('0x8'));var querystring=require(_0xdeb5('0xf'));var Papa=require(_0xdeb5('0x10'));var Redis=require(_0xdeb5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdeb5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdeb5('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdeb5('0x14'));var db=require(_0xdeb5('0x15'))['db'];function respondWithStatusCode(_0x5d918f,_0x52af87){_0x52af87=_0x52af87||0xcc;return function(_0x5999b0){if(_0x5999b0){return _0x5d918f[_0xdeb5('0x16')](_0x52af87);}return _0x5d918f[_0xdeb5('0x17')](_0x52af87)[_0xdeb5('0x18')]();};}function respondWithResult(_0x1cd6d0,_0x177a38){_0x177a38=_0x177a38||0xc8;return function(_0x1a653d){if(_0x1a653d){return _0x1cd6d0[_0xdeb5('0x17')](_0x177a38)['json'](_0x1a653d);}};}function respondWithFilteredResult(_0x10a162,_0x5bc7b8){return function(_0x48f79c){if(_0x48f79c){var _0x27ceb4=typeof _0x5bc7b8[_0xdeb5('0x19')]===_0xdeb5('0x1a')&&typeof _0x5bc7b8[_0xdeb5('0x1b')]===_0xdeb5('0x1a');var _0x451bc0=_0x48f79c[_0xdeb5('0x1c')];var _0x4cb8d6=_0x27ceb4?0x0:_0x5bc7b8[_0xdeb5('0x19')];var _0x2256a8=_0x27ceb4?_0x48f79c[_0xdeb5('0x1c')]:_0x5bc7b8[_0xdeb5('0x19')]+_0x5bc7b8[_0xdeb5('0x1b')];var _0x2f3cba;if(_0x2256a8>=_0x451bc0){_0x2256a8=_0x451bc0;_0x2f3cba=0xc8;}else{_0x2f3cba=0xce;}_0x10a162[_0xdeb5('0x17')](_0x2f3cba);return _0x10a162[_0xdeb5('0x1d')](_0xdeb5('0x1e'),_0x4cb8d6+'-'+_0x2256a8+'/'+_0x451bc0)['json'](_0x48f79c);}return null;};}function patchUpdates(_0x396e62){return function(_0xc83d89){try{jsonpatch['apply'](_0xc83d89,_0x396e62,!![]);}catch(_0x3ae0d5){return BPromise[_0xdeb5('0x1f')](_0x3ae0d5);}return _0xc83d89[_0xdeb5('0x20')]();};}function saveUpdates(_0x367d18,_0x43f779){return function(_0x5ece08){if(_0x5ece08){return _0x5ece08['update'](_0x367d18)['then'](function(_0x2aeb30){return _0x2aeb30;});}return null;};}function removeEntity(_0x581e5b,_0x552295){return function(_0xd0405e){if(_0xd0405e){return _0xd0405e[_0xdeb5('0x21')]()[_0xdeb5('0x22')](function(){_0x581e5b['status'](0xcc)[_0xdeb5('0x18')]();});}};}function handleEntityNotFound(_0x38e285,_0x40aaf5){return function(_0x449638){if(!_0x449638){_0x38e285[_0xdeb5('0x16')](0x194);}return _0x449638;};}function handleError(_0xec0fc0,_0x4a0cda){_0x4a0cda=_0x4a0cda||0x1f4;return function(_0xe51ce4){logger['error'](_0xe51ce4[_0xdeb5('0x23')]);if(_0xe51ce4['name']){delete _0xe51ce4[_0xdeb5('0x24')];}_0xec0fc0[_0xdeb5('0x17')](_0x4a0cda)[_0xdeb5('0x25')](_0xe51ce4);};}exports['index']=function(_0x223d5d,_0x334711){var _0x3000f8={},_0x1ad5be={},_0xc09c1e={'count':0x0,'rows':[]};var _0x3474ba=_[_0xdeb5('0x26')](db[_0xdeb5('0x27')]['rawAttributes'],function(_0x307970){return{'name':_0x307970[_0xdeb5('0x28')],'type':_0x307970['type'][_0xdeb5('0x29')]};});_0x1ad5be['model']=_['map'](_0x3474ba,'name');_0x1ad5be[_0xdeb5('0x2a')]=_['keys'](_0x223d5d['query']);_0x1ad5be[_0xdeb5('0x2b')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],_0x1ad5be['query']);_0x3000f8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x2f')]));_0x3000f8['attributes']=_0x3000f8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3000f8[_0xdeb5('0x2e')]:_0x1ad5be[_0xdeb5('0x2d')];if(!_0x223d5d[_0xdeb5('0x2a')]['hasOwnProperty'](_0xdeb5('0x31'))){_0x3000f8[_0xdeb5('0x1b')]=qs[_0xdeb5('0x1b')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x1b')]);_0x3000f8[_0xdeb5('0x19')]=qs[_0xdeb5('0x19')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x19')]);}_0x3000f8[_0xdeb5('0x32')]=qs[_0xdeb5('0x33')](_0x223d5d[_0xdeb5('0x2a')]['sort']);_0x3000f8[_0xdeb5('0x34')]=qs[_0xdeb5('0x2b')](_[_0xdeb5('0x35')](_0x223d5d[_0xdeb5('0x2a')],_0x1ad5be[_0xdeb5('0x2b')]),_0x3474ba);if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x36')]){_0x3000f8[_0xdeb5('0x34')]=_['merge'](_0x3000f8['where'],{'$or':_['map'](_0x3474ba,function(_0x2ce4ef){if(_0x2ce4ef[_0xdeb5('0x37')]!==_0xdeb5('0x38')){var _0x212d5d={};_0x212d5d[_0x2ce4ef['name']]={'$like':'%'+_0x223d5d['query'][_0xdeb5('0x36')]+'%'};return _0x212d5d;}})});}_0x3000f8=_['merge']({},_0x3000f8,_0x223d5d[_0xdeb5('0x39')]);var _0x16a4d2={'where':_0x3000f8[_0xdeb5('0x34')]};return db[_0xdeb5('0x27')][_0xdeb5('0x1c')](_0x16a4d2)[_0xdeb5('0x22')](function(_0xbb9e1a){_0xc09c1e[_0xdeb5('0x1c')]=_0xbb9e1a;if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3000f8['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xdeb5('0x3b')](_0x3000f8);})[_0xdeb5('0x22')](function(_0x19ac48){_0xc09c1e[_0xdeb5('0x3c')]=_0x19ac48;return _0xc09c1e;})['then'](respondWithFilteredResult(_0x334711,_0x3000f8))['catch'](handleError(_0x334711,null));};exports[_0xdeb5('0x3d')]=function(_0x11635d,_0x42aae6){var _0x3fc6e8={'raw':!![],'where':{'id':_0x11635d[_0xdeb5('0x3e')]['id']}},_0x73ab8a={};_0x73ab8a['model']=_[_0xdeb5('0x3f')](db[_0xdeb5('0x27')][_0xdeb5('0x40')]);_0x73ab8a['query']=_[_0xdeb5('0x3f')](_0x11635d[_0xdeb5('0x2a')]);_0x73ab8a['filters']=_['intersection'](_0x73ab8a[_0xdeb5('0x2d')],_0x73ab8a['query']);_0x3fc6e8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x73ab8a[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x11635d['query'][_0xdeb5('0x2f')]));_0x3fc6e8[_0xdeb5('0x2e')]=_0x3fc6e8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3fc6e8[_0xdeb5('0x2e')]:_0x73ab8a['model'];if(_0x11635d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3fc6e8[_0xdeb5('0x41')]=[{'all':!![]}];}_0x3fc6e8=_[_0xdeb5('0x42')]({},_0x3fc6e8,_0x11635d[_0xdeb5('0x39')]);return db[_0xdeb5('0x27')][_0xdeb5('0x43')](_0x3fc6e8)[_0xdeb5('0x22')](handleEntityNotFound(_0x42aae6,null))[_0xdeb5('0x22')](respondWithResult(_0x42aae6,null))['catch'](handleError(_0x42aae6,null));};exports['create']=function(_0x159b4f,_0x486ef1){return db['ChatTransferReport'][_0xdeb5('0x44')](_0x159b4f[_0xdeb5('0x45')],{})[_0xdeb5('0x22')](respondWithResult(_0x486ef1,0xc9))['catch'](handleError(_0x486ef1,null));};exports['update']=function(_0x792656,_0x33cb4f){if(_0x792656['body']['id']){delete _0x792656[_0xdeb5('0x45')]['id'];}return db['ChatTransferReport'][_0xdeb5('0x43')]({'where':{'id':_0x792656[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x33cb4f,null))['then'](saveUpdates(_0x792656[_0xdeb5('0x45')],null))[_0xdeb5('0x22')](respondWithResult(_0x33cb4f,null))[_0xdeb5('0x46')](handleError(_0x33cb4f,null));};exports[_0xdeb5('0x21')]=function(_0x5bbfcd,_0x5d0ea5){return db[_0xdeb5('0x27')][_0xdeb5('0x43')]({'where':{'id':_0x5bbfcd[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x5d0ea5,null))[_0xdeb5('0x22')](removeEntity(_0x5d0ea5,null))[_0xdeb5('0x46')](handleError(_0x5d0ea5,null));};exports[_0xdeb5('0x47')]=function(_0x20dc06,_0x369cd7){return db['ChatTransferReport'][_0xdeb5('0x47')]()[_0xdeb5('0x22')](respondWithResult(_0x369cd7,null))['catch'](handleError(_0x369cd7,null));}; \ No newline at end of file +var _0x09d9=['destroy','sendStatus','error','stack','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','then'];(function(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0x09d9,0x71));var _0x909d=function(_0x38838d,_0x15d035){_0x38838d=_0x38838d-0x0;var _0x9f6165=_0x09d9[_0x38838d];return _0x9f6165;};'use strict';var emlformat=require(_0x909d('0x0'));var rimraf=require(_0x909d('0x1'));var zipdir=require(_0x909d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x909d('0x3'));var moment=require(_0x909d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x909d('0x5'));var util=require('util');var path=require(_0x909d('0x6'));var sox=require(_0x909d('0x7'));var csv=require(_0x909d('0x8'));var ejs=require(_0x909d('0x9'));var fs=require('fs');var fs_extra=require(_0x909d('0xa'));var _=require(_0x909d('0xb'));var squel=require('squel');var crypto=require(_0x909d('0xc'));var jsforce=require(_0x909d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x909d('0x8'));var querystring=require(_0x909d('0xe'));var Papa=require(_0x909d('0xf'));var Redis=require('ioredis');var authService=require(_0x909d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x909d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x909d('0x12'));var utils=require(_0x909d('0x13'));var config=require(_0x909d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x909d('0x15'))['db'];function respondWithStatusCode(_0x30b7e3,_0x286a0e){_0x286a0e=_0x286a0e||0xcc;return function(_0x1e9495){if(_0x1e9495){return _0x30b7e3['sendStatus'](_0x286a0e);}return _0x30b7e3['status'](_0x286a0e)[_0x909d('0x16')]();};}function respondWithResult(_0xe0742c,_0x3651e1){_0x3651e1=_0x3651e1||0xc8;return function(_0x290d2c){if(_0x290d2c){return _0xe0742c['status'](_0x3651e1)[_0x909d('0x17')](_0x290d2c);}};}function respondWithFilteredResult(_0xc9fec0,_0x333d4f){return function(_0x44cd6f){if(_0x44cd6f){var _0x4b0fd6=typeof _0x333d4f['offset']===_0x909d('0x18')&&typeof _0x333d4f['limit']===_0x909d('0x18');var _0x38ee20=_0x44cd6f[_0x909d('0x19')];var _0x2f91c2=_0x4b0fd6?0x0:_0x333d4f[_0x909d('0x1a')];var _0x51eb39=_0x4b0fd6?_0x44cd6f[_0x909d('0x19')]:_0x333d4f[_0x909d('0x1a')]+_0x333d4f[_0x909d('0x1b')];var _0x114f74;if(_0x51eb39>=_0x38ee20){_0x51eb39=_0x38ee20;_0x114f74=0xc8;}else{_0x114f74=0xce;}_0xc9fec0[_0x909d('0x1c')](_0x114f74);return _0xc9fec0[_0x909d('0x1d')](_0x909d('0x1e'),_0x2f91c2+'-'+_0x51eb39+'/'+_0x38ee20)[_0x909d('0x17')](_0x44cd6f);}return null;};}function patchUpdates(_0x184144){return function(_0x1a818f){try{jsonpatch['apply'](_0x1a818f,_0x184144,!![]);}catch(_0x5f14cb){return BPromise[_0x909d('0x1f')](_0x5f14cb);}return _0x1a818f[_0x909d('0x20')]();};}function saveUpdates(_0x1e2400,_0x1a87c5){return function(_0x2d3a68){if(_0x2d3a68){return _0x2d3a68[_0x909d('0x21')](_0x1e2400)[_0x909d('0x22')](function(_0x3b0a71){return _0x3b0a71;});}return null;};}function removeEntity(_0x24e19d,_0x554ba7){return function(_0x36b126){if(_0x36b126){return _0x36b126[_0x909d('0x23')]()['then'](function(){_0x24e19d[_0x909d('0x1c')](0xcc)[_0x909d('0x16')]();});}};}function handleEntityNotFound(_0x57c829,_0x4b2ee3){return function(_0x47dc3b){if(!_0x47dc3b){_0x57c829[_0x909d('0x24')](0x194);}return _0x47dc3b;};}function handleError(_0x39a211,_0x3e24db){_0x3e24db=_0x3e24db||0x1f4;return function(_0x4d5169){logger[_0x909d('0x25')](_0x4d5169[_0x909d('0x26')]);if(_0x4d5169['name']){delete _0x4d5169['name'];}_0x39a211[_0x909d('0x1c')](_0x3e24db)[_0x909d('0x27')](_0x4d5169);};}exports['index']=function(_0x16f7e6,_0x209d66){var _0x4766ea={},_0x1b8f03={},_0x5a9cfc={'count':0x0,'rows':[]};var _0x5a5b70=_[_0x909d('0x28')](db[_0x909d('0x29')][_0x909d('0x2a')],function(_0x250e97){return{'name':_0x250e97[_0x909d('0x2b')],'type':_0x250e97[_0x909d('0x2c')][_0x909d('0x2d')]};});_0x1b8f03['model']=_[_0x909d('0x28')](_0x5a5b70,'name');_0x1b8f03[_0x909d('0x2e')]=_[_0x909d('0x2f')](_0x16f7e6[_0x909d('0x2e')]);_0x1b8f03[_0x909d('0x30')]=_[_0x909d('0x31')](_0x1b8f03[_0x909d('0x32')],_0x1b8f03[_0x909d('0x2e')]);_0x4766ea[_0x909d('0x33')]=_[_0x909d('0x31')](_0x1b8f03[_0x909d('0x32')],qs['fields'](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x34')]));_0x4766ea[_0x909d('0x33')]=_0x4766ea[_0x909d('0x33')][_0x909d('0x35')]?_0x4766ea['attributes']:_0x1b8f03[_0x909d('0x32')];if(!_0x16f7e6['query'][_0x909d('0x36')](_0x909d('0x37'))){_0x4766ea['limit']=qs[_0x909d('0x1b')](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x1b')]);_0x4766ea['offset']=qs[_0x909d('0x1a')](_0x16f7e6['query'][_0x909d('0x1a')]);}_0x4766ea['order']=qs['sort'](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x38')]);_0x4766ea[_0x909d('0x39')]=qs[_0x909d('0x30')](_[_0x909d('0x3a')](_0x16f7e6['query'],_0x1b8f03['filters']),_0x5a5b70);if(_0x16f7e6[_0x909d('0x2e')]['filter']){_0x4766ea[_0x909d('0x39')]=_[_0x909d('0x3b')](_0x4766ea[_0x909d('0x39')],{'$or':_[_0x909d('0x28')](_0x5a5b70,function(_0x369a28){if(_0x369a28[_0x909d('0x2c')]!==_0x909d('0x3c')){var _0x3e8507={};_0x3e8507[_0x369a28[_0x909d('0x3d')]]={'$like':'%'+_0x16f7e6[_0x909d('0x2e')]['filter']+'%'};return _0x3e8507;}})});}_0x4766ea=_[_0x909d('0x3b')]({},_0x4766ea,_0x16f7e6[_0x909d('0x3e')]);var _0x58dc9={'where':_0x4766ea[_0x909d('0x39')]};return db[_0x909d('0x29')]['count'](_0x58dc9)[_0x909d('0x22')](function(_0x4b23ea){_0x5a9cfc['count']=_0x4b23ea;if(_0x16f7e6[_0x909d('0x2e')][_0x909d('0x3f')]){_0x4766ea[_0x909d('0x40')]=[{'all':!![]}];}return db[_0x909d('0x29')][_0x909d('0x41')](_0x4766ea);})[_0x909d('0x22')](function(_0x16db09){_0x5a9cfc[_0x909d('0x42')]=_0x16db09;return _0x5a9cfc;})[_0x909d('0x22')](respondWithFilteredResult(_0x209d66,_0x4766ea))[_0x909d('0x43')](handleError(_0x209d66,null));};exports[_0x909d('0x44')]=function(_0x3c2ec2,_0x1fb43b){var _0x2119d2={'raw':!![],'where':{'id':_0x3c2ec2['params']['id']}},_0x3ad6cc={};_0x3ad6cc[_0x909d('0x32')]=_[_0x909d('0x2f')](db['ChatTransferReport'][_0x909d('0x2a')]);_0x3ad6cc[_0x909d('0x2e')]=_[_0x909d('0x2f')](_0x3c2ec2['query']);_0x3ad6cc[_0x909d('0x30')]=_[_0x909d('0x31')](_0x3ad6cc['model'],_0x3ad6cc['query']);_0x2119d2['attributes']=_[_0x909d('0x31')](_0x3ad6cc['model'],qs[_0x909d('0x34')](_0x3c2ec2[_0x909d('0x2e')]['fields']));_0x2119d2['attributes']=_0x2119d2['attributes'][_0x909d('0x35')]?_0x2119d2[_0x909d('0x33')]:_0x3ad6cc[_0x909d('0x32')];if(_0x3c2ec2[_0x909d('0x2e')][_0x909d('0x3f')]){_0x2119d2['include']=[{'all':!![]}];}_0x2119d2=_[_0x909d('0x3b')]({},_0x2119d2,_0x3c2ec2[_0x909d('0x3e')]);return db[_0x909d('0x29')][_0x909d('0x45')](_0x2119d2)[_0x909d('0x22')](handleEntityNotFound(_0x1fb43b,null))[_0x909d('0x22')](respondWithResult(_0x1fb43b,null))['catch'](handleError(_0x1fb43b,null));};exports[_0x909d('0x46')]=function(_0x376a32,_0x49a6e6){return db[_0x909d('0x29')][_0x909d('0x46')](_0x376a32[_0x909d('0x47')],{})[_0x909d('0x22')](respondWithResult(_0x49a6e6,0xc9))[_0x909d('0x43')](handleError(_0x49a6e6,null));};exports[_0x909d('0x21')]=function(_0x442a63,_0x1aa101){if(_0x442a63['body']['id']){delete _0x442a63[_0x909d('0x47')]['id'];}return db[_0x909d('0x29')][_0x909d('0x45')]({'where':{'id':_0x442a63[_0x909d('0x48')]['id']}})[_0x909d('0x22')](handleEntityNotFound(_0x1aa101,null))[_0x909d('0x22')](saveUpdates(_0x442a63[_0x909d('0x47')],null))['then'](respondWithResult(_0x1aa101,null))[_0x909d('0x43')](handleError(_0x1aa101,null));};exports[_0x909d('0x23')]=function(_0x5009cb,_0x2b8c7a){return db[_0x909d('0x29')][_0x909d('0x45')]({'where':{'id':_0x5009cb[_0x909d('0x48')]['id']}})[_0x909d('0x22')](handleEntityNotFound(_0x2b8c7a,null))[_0x909d('0x22')](removeEntity(_0x2b8c7a,null))[_0x909d('0x43')](handleError(_0x2b8c7a,null));};exports[_0x909d('0x49')]=function(_0x465959,_0x4fbd23){return db['ChatTransferReport'][_0x909d('0x49')]()[_0x909d('0x22')](respondWithResult(_0x4fbd23,null))['catch'](handleError(_0x4fbd23,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 10ae37a..5045642 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 _0x82c3=['request-promise','path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x170685,_0x51edfa){var _0x5a41d8=function(_0xb1ab45){while(--_0xb1ab45){_0x170685['push'](_0x170685['shift']());}};_0x5a41d8(++_0x51edfa);}(_0x82c3,0x1ba));var _0x382c=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x82c3[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x382c('0x0'));var util=require(_0x382c('0x1'));var logger=require(_0x382c('0x2'))(_0x382c('0x3'));var moment=require(_0x382c('0x4'));var BPromise=require(_0x382c('0x5'));var rp=require(_0x382c('0x6'));var fs=require('fs');var path=require(_0x382c('0x7'));var rimraf=require(_0x382c('0x8'));var config=require('../../config/environment');var attributes=require(_0x382c('0x9'));module[_0x382c('0xa')]=function(_0x3ac2ab,_0xc14b66){return _0x3ac2ab['define'](_0x382c('0xb'),attributes,{'tableName':_0x382c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x382c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbbc4=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./chatTransferReport.attributes'];(function(_0x55c97d,_0x228ffc){var _0x1d5112=function(_0x2ab908){while(--_0x2ab908){_0x55c97d['push'](_0x55c97d['shift']());}};_0x1d5112(++_0x228ffc);}(_0xbbc4,0x1ba));var _0x4bbc=function(_0x56fad7,_0x69bcbd){_0x56fad7=_0x56fad7-0x0;var _0x21dad9=_0xbbc4[_0x56fad7];return _0x21dad9;};'use strict';var _=require(_0x4bbc('0x0'));var util=require(_0x4bbc('0x1'));var logger=require(_0x4bbc('0x2'))(_0x4bbc('0x3'));var moment=require(_0x4bbc('0x4'));var BPromise=require(_0x4bbc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4bbc('0x6'));var config=require('../../config/environment');var attributes=require(_0x4bbc('0x7'));module['exports']=function(_0xa2ea30,_0x41e035){return _0xa2ea30['define'](_0x4bbc('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x4bbc('0x9'),'fields':[_0x4bbc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b285360..be0c41a 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 _0x382c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x14545a,_0x1ed81d){var _0x17cd82=function(_0x318cf7){while(--_0x318cf7){_0x14545a['push'](_0x14545a['shift']());}};_0x17cd82(++_0x1ed81d);}(_0x382c,0x12a));var _0xc382=function(_0x320cf5,_0x4e437d){_0x320cf5=_0x320cf5-0x0;var _0xa77006=_0x382c[_0x320cf5];return _0xa77006;};'use strict';var _=require(_0xc382('0x0'));var util=require(_0xc382('0x1'));var moment=require(_0xc382('0x2'));var BPromise=require(_0xc382('0x3'));var rs=require(_0xc382('0x4'));var fs=require('fs');var Redis=require(_0xc382('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc382('0x6'));var logger=require(_0xc382('0x7'))(_0xc382('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc382('0x9')][_0xc382('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ad7a,_0x5a40dd,_0x481d88){return new BPromise(function(_0x2d3a86,_0x3fc1bc){return client[_0xc382('0xb')](_0x27ad7a,_0x481d88)[_0xc382('0xc')](function(_0x4ec866){logger['info'](_0xc382('0xd'),_0x5a40dd,_0xc382('0xe'));logger['debug'](_0xc382('0xf'),_0x5a40dd,_0xc382('0xe'),JSON['stringify'](_0x4ec866));if(_0x4ec866[_0xc382('0x10')]){if(_0x4ec866['error']['code']===0x1f4){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x3fc1bc(_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);}logger['error'](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x2d3a86(_0x4ec866[_0xc382('0x10')]['message']);}else{logger[_0xc382('0x12')](_0xc382('0xd'),_0x5a40dd,'request\x20sent');_0x2d3a86(_0x4ec866[_0xc382('0x13')][_0xc382('0x11')]);}})[_0xc382('0x14')](function(_0x6a6e4b){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x6a6e4b);_0x3fc1bc(_0x6a6e4b);});});} \ No newline at end of file +var _0x5d99=['../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x5d99,0x9a));var _0x95d9=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x5d99[_0x4b03c9];return _0x161ba2;};'use strict';var _=require(_0x95d9('0x0'));var util=require('util');var moment=require(_0x95d9('0x1'));var BPromise=require(_0x95d9('0x2'));var rs=require(_0x95d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x95d9('0x4'))(_0x95d9('0x5'));var config=require(_0x95d9('0x6'));var jayson=require(_0x95d9('0x7'));var client=jayson[_0x95d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54c98a,_0x150407,_0x292a5b){return new BPromise(function(_0x51ee1a,_0x2ff389){return client['request'](_0x54c98a,_0x292a5b)[_0x95d9('0x9')](function(_0x472128){logger[_0x95d9('0xa')](_0x95d9('0xb'),_0x150407,_0x95d9('0xc'));logger['debug'](_0x95d9('0xd'),_0x150407,'request\x20sent',JSON[_0x95d9('0xe')](_0x472128));if(_0x472128[_0x95d9('0xf')]){if(_0x472128[_0x95d9('0xf')][_0x95d9('0x10')]===0x1f4){logger['error'](_0x95d9('0xb'),_0x150407,_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);return _0x2ff389(_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);}logger['error'](_0x95d9('0xb'),_0x150407,_0x472128['error']['message']);return _0x51ee1a(_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);}else{logger[_0x95d9('0xa')](_0x95d9('0xb'),_0x150407,_0x95d9('0xc'));_0x51ee1a(_0x472128[_0x95d9('0x12')]['message']);}})[_0x95d9('0x13')](function(_0x11f8d5){logger[_0x95d9('0xf')](_0x95d9('0xb'),_0x150407,_0x11f8d5);_0x2ff389(_0x11f8d5);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 867898a..c80a0e0 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 _0x2ce0=['describe','get','/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated'];(function(_0x5eb9d2,_0x2761a2){var _0xd3174b=function(_0x26fff7){while(--_0x26fff7){_0x5eb9d2['push'](_0x5eb9d2['shift']());}};_0xd3174b(++_0x2761a2);}(_0x2ce0,0x71));var _0x02ce=function(_0x5a9aed,_0x7ff498){_0x5a9aed=_0x5a9aed-0x0;var _0x58fc5d=_0x2ce0[_0x5a9aed];return _0x58fc5d;};'use strict';var multer=require(_0x02ce('0x0'));var util=require(_0x02ce('0x1'));var path=require(_0x02ce('0x2'));var timeout=require(_0x02ce('0x3'));var express=require(_0x02ce('0x4'));var router=express[_0x02ce('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x02ce('0x6'));var interaction=require(_0x02ce('0x7'));var config=require(_0x02ce('0x8'));var controller=require(_0x02ce('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x02ce('0xa')]);router['get'](_0x02ce('0xb'),auth[_0x02ce('0xc')](),controller[_0x02ce('0xd')]);router[_0x02ce('0xe')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller['show']);router[_0x02ce('0x10')]('/',auth[_0x02ce('0xc')](),controller['create']);router[_0x02ce('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x02ce('0x12')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller[_0x02ce('0x13')]);module[_0x02ce('0x14')]=router; \ No newline at end of file +var _0xeedd=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','describe','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41d0c6,_0x35a93e){var _0x50f407=function(_0x4cce17){while(--_0x4cce17){_0x41d0c6['push'](_0x41d0c6['shift']());}};_0x50f407(++_0x35a93e);}(_0xeedd,0x7d));var _0xdeed=function(_0x58b40b,_0x3c2dbf){_0x58b40b=_0x58b40b-0x0;var _0x5715e2=_0xeedd[_0x58b40b];return _0x5715e2;};'use strict';var multer=require(_0xdeed('0x0'));var util=require(_0xdeed('0x1'));var path=require(_0xdeed('0x2'));var timeout=require(_0xdeed('0x3'));var express=require(_0xdeed('0x4'));var router=express['Router']();var fs_extra=require(_0xdeed('0x5'));var auth=require(_0xdeed('0x6'));var interaction=require(_0xdeed('0x7'));var config=require(_0xdeed('0x8'));var controller=require(_0xdeed('0x9'));router[_0xdeed('0xa')]('/',auth[_0xdeed('0xb')](),controller['index']);router[_0xdeed('0xa')]('/describe',auth[_0xdeed('0xb')](),controller[_0xdeed('0xc')]);router['get'](_0xdeed('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdeed('0xe')](_0xdeed('0xd'),auth[_0xdeed('0xb')](),controller[_0xdeed('0xf')]);router[_0xdeed('0x10')](_0xdeed('0xd'),auth[_0xdeed('0xb')](),controller[_0xdeed('0x11')]);module[_0xdeed('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 8dadf85..d44d12f 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 _0x0bb5=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Feedback','star','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','stringify','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','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x0bb5,0x148));var _0x50bb=function(_0x424e05,_0x6c6e6a){_0x424e05=_0x424e05-0x0;var _0x2a3c50=_0x0bb5[_0x424e05];return _0x2a3c50;};'use strict';var Sequelize=require(_0x50bb('0x0'));var rs=require(_0x50bb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'unique':_0x50bb('0x3')},'description':{'type':Sequelize[_0x50bb('0x2')]},'mapKey':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'key':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0xa'),_0x50bb('0xb')),'defaultValue':_0x50bb('0xa')},'header_online':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xe')},'header_offline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50bb('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x15')},'placeholderMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x16')},'ratingType':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0x17'),'thumb'),'defaultValue':_0x50bb('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x50bb('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x50bb('0x19'),'required':!![]},'props':{'title':_0x50bb('0x1a'),'helpText':''}},{'type':_0x50bb('0x18'),'props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50bb('0x1b'))?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x1b'))):{};},'set':function(_0x5234d7){return this[_0x50bb('0x1e')]('onlineForm',JSON['stringify'](_0x5234d7));}},'offlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null},{'type':_0x50bb('0x1f'),'config':{'placeholder':_0x50bb('0x20')},'props':{'title':_0x50bb('0x20'),'helpText':_0x50bb('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x50bb('0x1d')]('offlineForm')?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x22'))):{};},'set':function(_0x1b7c0f){return this['setDataValue'](_0x50bb('0x22'),JSON[_0x50bb('0x23')](_0x1b7c0f));}},'token':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return rs[_0x50bb('0x24')]();}},'autoclose':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50bb('0x2')]},'forwardOffline':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x50bb('0x2')]},'waitingTitle':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x27')},'offlineMessageBody':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x29')},'skipUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50bb('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50bb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50bb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2d')},'defaultTitle':{'type':Sequelize[_0x50bb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bb('0x7')],'comment':_0x50bb('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![],'comment':_0x50bb('0x31'),'set':function(_0x3a9fe4){if(!_0x3a9fe4)this[_0x50bb('0x1e')](_0x50bb('0x32'),null);this[_0x50bb('0x1e')](_0x50bb('0x33'),_0x3a9fe4);}},'vidaooEscalation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x34')},'vidaooNote':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return _0x50bb('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50bb('0x11')]}}; \ No newline at end of file +var _0x99e9=['System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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}}'];(function(_0x12bcf7,_0x20878d){var _0x516440=function(_0x26eff1){while(--_0x26eff1){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x516440(++_0x20878d);}(_0x99e9,0xb4));var _0x999e=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x99e9[_0x169e53];return _0x252bb3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x999e('0x0'));module[_0x999e('0x1')]={'name':{'type':Sequelize[_0x999e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x999e('0x2')]},'mapKey':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x4')},'customerAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x999e('0x2')]},'animation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x999e('0x9')](_0x999e('0xa'),_0x999e('0xb')),'defaultValue':_0x999e('0xa')},'header_online':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xc')},'start_chat_button':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xf')},'download_transcript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x999e('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x13')},'noteTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x15')},'closingMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'skipMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'conditionAgreement':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x999e('0x18'),_0x999e('0x19')),'defaultValue':_0x999e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x999e('0x1c'),'helpText':''}},{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':_0x999e('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x999e('0x1d')](_0x999e('0x1e'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')]('onlineForm')):{};},'set':function(_0x2e1cc5){return this[_0x999e('0x20')](_0x999e('0x1e'),JSON[_0x999e('0x1a')](_0x2e1cc5));}},'offlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x999e('0x21')},'props':{'title':_0x999e('0x21'),'helpText':_0x999e('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x999e('0x23'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')](_0x999e('0x23'))):{};},'set':function(_0x15dca1){return this[_0x999e('0x20')](_0x999e('0x23'),JSON[_0x999e('0x1a')](_0x15dca1));}},'token':{'type':Sequelize[_0x999e('0x2')],'defaultValue':function(){return rs[_0x999e('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x999e('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x999e('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'sendUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x999e('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x999e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return _0x999e('0x27');}},'notificationSound':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x999e('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x28')},'systemAvatar':{'type':Sequelize[_0x999e('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x999e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'comment':_0x999e('0x29'),'set':function(_0x1e1229){if(!_0x1e1229)this[_0x999e('0x20')]('mandatoryDispositionPauseId',null);this[_0x999e('0x20')]('mandatoryDisposition',_0x1e1229);}},'vidaooEscalation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x999e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x2a')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x999e('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x999e('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x999e('0x8')],'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 6ccbde3..c65a8f5 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 _0xcedc=['UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','showCustomerAvatar','customerAvatar','notify','setUA','headers','user-agent','getResult','chat','Sequelize','difference','createdAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','updatedAt','DESC','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','Chat','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','all','some','server/files/chat/iframe.ejs','address','3.1.0','connection','remoteAddress','referer','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','user'];(function(_0x25ac0f,_0x3e73a3){var _0x2269ef=function(_0x500298){while(--_0x500298){_0x25ac0f['push'](_0x25ac0f['shift']());}};_0x2269ef(++_0x3e73a3);}(_0xcedc,0xd8));var _0xcced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcedc[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xcced('0x0'));var Mustache=require(_0xcced('0x1'));var util=require(_0xcced('0x2'));var path=require(_0xcced('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcced('0x4'));var _=require(_0xcced('0x5'));var querystring=require(_0xcced('0x6'));var Redis=require(_0xcced('0x7'));var qs=require(_0xcced('0x8'));var logger=require(_0xcced('0x9'))('api');var config=require(_0xcced('0xa'));var url=require(_0xcced('0xb'));var db=require('../../mysqldb')['db'];config[_0xcced('0xc')]=_[_0xcced('0xd')](config[_0xcced('0xc')],{'host':_0xcced('0xe'),'port':0x18eb});var socket=require(_0xcced('0xf'))(new Redis(config[_0xcced('0xc')]));require(_0xcced('0x10'))[_0xcced('0x11')](socket);var htmlToText=require(_0xcced('0x12'));var jayson=require('jayson/promise');var client=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232c});var client9002=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232a});var client9003=jayson[_0xcced('0x13')]['http']({'port':0x232b});var client9001=jayson['client'][_0xcced('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x338705,_0x2d2f4b,_0x5b15d7,_0x315c65){return new BPromise(function(_0x3afab5,_0x4e5aa0){var _0x3e7ed0=_0x315c65||client;return _0x3e7ed0['request'](_0x338705,_0x5b15d7)[_0xcced('0x15')](function(_0x542965){logger['info'](_0xcced('0x16'),_0x2d2f4b,_0xcced('0x17'));logger['debug'](_0xcced('0x18'),_0x2d2f4b,_0xcced('0x17'),JSON[_0xcced('0x19')](_0x542965));if(_0x542965[_0xcced('0x1a')]){if(_0x542965[_0xcced('0x1a')][_0xcced('0x1b')]===0x1f4){logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965['error'][_0xcced('0x1c')]);return _0x4e5aa0(_0x542965[_0xcced('0x1a')]['message']);}logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965[_0xcced('0x1a')]['message']);return _0x3afab5(_0x542965[_0xcced('0x1a')][_0xcced('0x1c')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0xcced('0x17'));_0x3afab5(_0x542965['result']['message']);}})[_0xcced('0x1d')](function(_0x3a88da){logger[_0xcced('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0x3a88da);_0x4e5aa0(_0x3a88da);});});}function respondWithStatusCode(_0x36dbdf,_0xdb5c06){_0xdb5c06=_0xdb5c06||0xcc;return function(_0x58acbf){if(_0x58acbf){return _0x36dbdf[_0xcced('0x1e')](_0xdb5c06);}return _0x36dbdf[_0xcced('0x1f')](_0xdb5c06)[_0xcced('0x20')]();};}function respondWithResult(_0x4bf976,_0x4b65e0){_0x4b65e0=_0x4b65e0||0xc8;return function(_0x77182c){if(_0x77182c){return _0x4bf976[_0xcced('0x1f')](_0x4b65e0)[_0xcced('0x21')](_0x77182c);}};}function respondWithFilteredResult(_0x11add6,_0x235945){return function(_0x1198d0){if(_0x1198d0){var _0x59185c=typeof _0x235945['offset']==='undefined'&&typeof _0x235945[_0xcced('0x22')]===_0xcced('0x23');var _0x24315a=_0x1198d0[_0xcced('0x24')];var _0x832dc4=_0x59185c?0x0:_0x235945[_0xcced('0x25')];var _0x10e14e=_0x59185c?_0x1198d0[_0xcced('0x24')]:_0x235945['offset']+_0x235945[_0xcced('0x22')];var _0x101e85;if(_0x10e14e>=_0x24315a){_0x10e14e=_0x24315a;_0x101e85=0xc8;}else{_0x101e85=0xce;}_0x11add6[_0xcced('0x1f')](_0x101e85);return _0x11add6['set']('Content-Range',_0x832dc4+'-'+_0x10e14e+'/'+_0x24315a)[_0xcced('0x21')](_0x1198d0);}return null;};}function saveUpdates(_0x26b3f3){return function(_0x39032a){if(_0x39032a){return _0x39032a[_0xcced('0x26')](_0x26b3f3)['then'](function(_0x42d18a){return _0x42d18a;});}return null;};}function removeEntity(_0x526935){return function(_0x2c2df4){if(_0x2c2df4){return _0x2c2df4[_0xcced('0x27')]()[_0xcced('0x15')](function(){var _0xc010a1=_0x2c2df4[_0xcced('0x28')]({'plain':!![]});var _0x3b1a2b=_0xcced('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b1a2b,'resourceId':_0xc010a1['id']}})[_0xcced('0x15')](function(){return _0x2c2df4;});})['then'](function(){_0x526935['status'](0xcc)[_0xcced('0x20')]();});}};}function handleEntityNotFound(_0x372c9d){return function(_0x19bb1d){if(!_0x19bb1d){_0x372c9d['sendStatus'](0x194);}return _0x19bb1d;};}function handleError(_0x22af8e,_0xab6363){_0xab6363=_0xab6363||0x1f4;return function(_0x515989){logger[_0xcced('0x1a')](_0x515989[_0xcced('0x2a')]);if(_0x515989[_0xcced('0x2b')]){delete _0x515989[_0xcced('0x2b')];}_0x22af8e['status'](_0xab6363)[_0xcced('0x2c')](_0x515989);};}exports[_0xcced('0x2d')]=function(_0x17c101,_0x25ef31){var _0x489f31={'include':[{'model':db[_0xcced('0x2e')],'as':_0xcced('0x2f')}]},_0xcde5f1={},_0x4a9143={'count':0x0,'rows':[]};var _0x30900=_[_0xcced('0x30')](db[_0xcced('0x31')][_0xcced('0x32')],function(_0x52de0b){return{'name':_0x52de0b[_0xcced('0x33')],'type':_0x52de0b['type'][_0xcced('0x34')]};});_0xcde5f1[_0xcced('0x35')]=_['map'](_0x30900,'name');_0xcde5f1[_0xcced('0x36')]=_[_0xcced('0x37')](_0x17c101[_0xcced('0x36')]);_0xcde5f1[_0xcced('0x38')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],_0xcde5f1[_0xcced('0x36')]);_0x489f31[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x17c101[_0xcced('0x36')][_0xcced('0x3b')]));_0x489f31[_0xcced('0x3a')]=_0x489f31[_0xcced('0x3a')][_0xcced('0x3c')]?_0x489f31[_0xcced('0x3a')]:_0xcde5f1[_0xcced('0x35')];if(!_0x17c101[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x489f31['limit']=qs[_0xcced('0x22')](_0x17c101[_0xcced('0x36')][_0xcced('0x22')]);_0x489f31[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x17c101[_0xcced('0x36')]['offset']);}_0x489f31[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x17c101['query'][_0xcced('0x40')]);_0x489f31[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x17c101[_0xcced('0x36')],_0xcde5f1['filters']),_0x30900);if(_0x17c101[_0xcced('0x36')][_0xcced('0x43')]){_0x489f31['where']=_['merge'](_0x489f31[_0xcced('0x41')],{'$or':_['map'](_0x30900,function(_0x84912d){if(_0x84912d[_0xcced('0x44')]!==_0xcced('0x45')){var _0x53ddad={};_0x53ddad[_0x84912d[_0xcced('0x2b')]]={'$like':'%'+_0x17c101[_0xcced('0x36')]['filter']+'%'};return _0x53ddad;}})});}_0x489f31=_[_0xcced('0x46')]({},_0x489f31,_0x17c101['options']);var _0x32d1a1={'where':_0x489f31[_0xcced('0x41')]};return db[_0xcced('0x31')]['count'](_0x32d1a1)[_0xcced('0x15')](function(_0x84dc5e){_0x4a9143['count']=_0x84dc5e;if(_0x17c101['query'][_0xcced('0x47')]){_0x489f31[_0xcced('0x48')]=[{'all':!![]}];}return db[_0xcced('0x31')][_0xcced('0x49')](_0x489f31);})['then'](function(_0x1cc32b){_0x4a9143['rows']=_0x1cc32b;return _0x4a9143;})[_0xcced('0x15')](respondWithFilteredResult(_0x25ef31,_0x489f31))['catch'](handleError(_0x25ef31,null));};exports[_0xcced('0x4a')]=function(_0x478657,_0x362227){var _0x22351d={'raw':![],'where':{'id':_0x478657[_0xcced('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]},_0x302eed={};_0x302eed[_0xcced('0x35')]=_[_0xcced('0x37')](db[_0xcced('0x31')][_0xcced('0x32')]);_0x302eed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x478657[_0xcced('0x36')]);_0x302eed[_0xcced('0x38')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],_0x302eed['query']);_0x22351d[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x478657[_0xcced('0x36')]['fields']));_0x22351d[_0xcced('0x3a')]=_0x22351d['attributes'][_0xcced('0x3c')]?_0x22351d['attributes']:_0x302eed['model'];if(_0x478657[_0xcced('0x36')]['includeAll']){_0x22351d[_0xcced('0x48')]=[{'all':!![]}];}_0x22351d=_['merge']({},_0x22351d,_0x478657[_0xcced('0x4c')]);return db[_0xcced('0x31')][_0xcced('0x4d')](_0x22351d)['then'](handleEntityNotFound(_0x362227,null))['then'](respondWithResult(_0x362227,null))['catch'](handleError(_0x362227,null));};exports[_0xcced('0x4e')]=function(_0x1b8876,_0x4eff77){return db['ChatWebsite'][_0xcced('0x4e')](_0x1b8876['body'],{})[_0xcced('0x15')](function(_0xbaf3a7){var _0x5a44c7=_0x1b8876[_0xcced('0x4f')][_0xcced('0x28')]({'plain':!![]});if(!_0x5a44c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a44c7['role']==='user'){var _0x2547cb=_0xbaf3a7[_0xcced('0x28')]({'plain':!![]});var _0x20f327=_0xcced('0x29');return db[_0xcced('0x50')]['find']({'where':{'name':_0x20f327,'userProfileId':_0x5a44c7['userProfileId']},'raw':!![]})[_0xcced('0x15')](function(_0x5b6915){if(_0x5b6915&&_0x5b6915['autoAssociation']===0x0){return db['UserProfileResource'][_0xcced('0x4e')]({'name':_0x2547cb[_0xcced('0x2b')],'resourceId':_0x2547cb['id'],'type':_0x5b6915[_0xcced('0x2b')],'sectionId':_0x5b6915['id']},{})['then'](function(){return _0xbaf3a7;});}else{return _0xbaf3a7;}})[_0xcced('0x1d')](function(_0x447918){logger['error'](_0xcced('0x51'),_0x447918);throw _0x447918;});}return _0xbaf3a7;})[_0xcced('0x15')](respondWithResult(_0x4eff77,0xc9))[_0xcced('0x1d')](handleError(_0x4eff77,null));};exports[_0xcced('0x26')]=function(_0x4fee8b,_0x5e596f){if(_0x4fee8b['body']['id']){delete _0x4fee8b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4fee8b['params']['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]})[_0xcced('0x15')](handleEntityNotFound(_0x5e596f,null))[_0xcced('0x15')](saveUpdates(_0x4fee8b['body'],null))['then'](respondWithResult(_0x5e596f,null))[_0xcced('0x1d')](handleError(_0x5e596f,null));};exports[_0xcced('0x27')]=function(_0x4a6b0e,_0x84156a){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4a6b0e[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x84156a,null))[_0xcced('0x15')](removeEntity(_0x84156a,null))[_0xcced('0x1d')](handleError(_0x84156a,null));};exports[_0xcced('0x53')]=function(_0x99d1a7,_0x484c22){return db[_0xcced('0x31')]['describe']()[_0xcced('0x15')](respondWithResult(_0x484c22,null))[_0xcced('0x1d')](handleError(_0x484c22,null));};exports['addDisposition']=function(_0x484b01,_0x16bd00){if(_0x484b01[_0xcced('0x52')]['id']){delete _0x484b01[_0xcced('0x52')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x484b01['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16bd00,null))[_0xcced('0x15')](function(_0x203810){if(_0x203810){_0x484b01[_0xcced('0x52')][_0xcced('0x54')]=_0x203810['id'];return db['Disposition']['create'](_0x484b01[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x16bd00,null))[_0xcced('0x1d')](handleError(_0x16bd00,null));};exports[_0xcced('0x55')]=function(_0x5baa67,_0x119b43){var _0x190901={'raw':![],'where':{}};var _0x13ff3b={};var _0x259849={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x5baa67[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x119b43,null))[_0xcced('0x15')](function(_0x40bb9b){if(_0x40bb9b){_0x13ff3b['model']=_['keys'](db[_0xcced('0x56')][_0xcced('0x32')]);_0x13ff3b[_0xcced('0x36')]=_[_0xcced('0x37')](_0x5baa67[_0xcced('0x36')]);_0x13ff3b['filters']=_[_0xcced('0x39')](_0x13ff3b['model'],_0x13ff3b[_0xcced('0x36')]);_0x190901[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x13ff3b[_0xcced('0x35')],qs['fields'](_0x5baa67['query'][_0xcced('0x3b')]));_0x190901[_0xcced('0x3a')]=_0x190901[_0xcced('0x3a')][_0xcced('0x3c')]?_0x190901[_0xcced('0x3a')]:_0x13ff3b['model'];if(!_0x5baa67[_0xcced('0x36')]['hasOwnProperty']('nolimit')){_0x190901[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x5baa67[_0xcced('0x36')][_0xcced('0x22')]);_0x190901[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x5baa67[_0xcced('0x36')][_0xcced('0x25')]);}_0x190901[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x5baa67['query']['sort']);_0x190901[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x5baa67[_0xcced('0x36')],_0x13ff3b[_0xcced('0x38')]));_0x190901[_0xcced('0x41')][_0xcced('0x54')]=_0x40bb9b['id'];if(_0x5baa67['query'][_0xcced('0x43')]){_0x190901[_0xcced('0x41')]=_[_0xcced('0x46')](_0x190901[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x190901['attributes'],function(_0x121add){var _0x45eb39={};_0x45eb39[_0x121add]={'$like':'%'+_0x5baa67['query'][_0xcced('0x43')]+'%'};return _0x45eb39;})});}_0x190901=_[_0xcced('0x46')]({},_0x190901,_0x5baa67[_0xcced('0x4c')]);return db[_0xcced('0x56')][_0xcced('0x24')]({'where':_0x190901[_0xcced('0x41')]})['then'](function(_0x4fed9a){_0x259849['count']=_0x4fed9a;if(_0x5baa67[_0xcced('0x36')][_0xcced('0x47')]){_0x190901[_0xcced('0x48')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x190901);})['then'](function(_0x4106a6){_0x259849['rows']=_0x4106a6;return _0x259849;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x119b43,_0x190901))[_0xcced('0x1d')](handleError(_0x119b43,null));};exports[_0xcced('0x57')]=function(_0x905c67,_0x5d9b30){return db[_0xcced('0x31')]['find']({'where':{'id':_0x905c67[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5d9b30,null))[_0xcced('0x15')](function(_0x45c2e4){if(_0x45c2e4){return _0x45c2e4[_0xcced('0x57')](_0x905c67[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x5d9b30,null))['catch'](handleError(_0x5d9b30,null));};exports[_0xcced('0x59')]=function(_0x53628b,_0x1f838a){if(_0x53628b[_0xcced('0x52')]['id']){delete _0x53628b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')]['find']({'where':{'id':_0x53628b[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x1f838a,null))['then'](function(_0x42bc2b){if(_0x42bc2b){_0x53628b[_0xcced('0x52')]['ChatWebsiteId']=_0x42bc2b['id'];return db[_0xcced('0x5a')][_0xcced('0x4e')](_0x53628b[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x1f838a,null))[_0xcced('0x1d')](handleError(_0x1f838a,null));};exports[_0xcced('0x5b')]=function(_0x525be4,_0x16a041){var _0x562383={'raw':![],'where':{}};var _0x32c9cf={};var _0x27da9d={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x525be4['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16a041,null))[_0xcced('0x15')](function(_0x4f4470){if(_0x4f4470){_0x32c9cf[_0xcced('0x35')]=_[_0xcced('0x37')](db['CannedAnswer'][_0xcced('0x32')]);_0x32c9cf[_0xcced('0x36')]=_[_0xcced('0x37')](_0x525be4[_0xcced('0x36')]);_0x32c9cf[_0xcced('0x38')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],_0x32c9cf[_0xcced('0x36')]);_0x562383[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x525be4[_0xcced('0x36')][_0xcced('0x3b')]));_0x562383[_0xcced('0x3a')]=_0x562383[_0xcced('0x3a')]['length']?_0x562383[_0xcced('0x3a')]:_0x32c9cf['model'];if(!_0x525be4[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x562383[_0xcced('0x22')]=qs['limit'](_0x525be4[_0xcced('0x36')][_0xcced('0x22')]);_0x562383[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x525be4[_0xcced('0x36')]['offset']);}_0x562383[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x525be4[_0xcced('0x36')][_0xcced('0x40')]);_0x562383[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x525be4['query'],_0x32c9cf['filters']));_0x562383[_0xcced('0x41')][_0xcced('0x54')]=_0x4f4470['id'];if(_0x525be4[_0xcced('0x36')]['filter']){_0x562383[_0xcced('0x41')]=_[_0xcced('0x46')](_0x562383[_0xcced('0x41')],{'$or':_['map'](_0x562383[_0xcced('0x3a')],function(_0x3525a7){var _0xe5b610={};_0xe5b610[_0x3525a7]={'$like':'%'+_0x525be4[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0xe5b610;})});}_0x562383=_[_0xcced('0x46')]({},_0x562383,_0x525be4['options']);return db['CannedAnswer'][_0xcced('0x24')]({'where':_0x562383[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x2bfda4){_0x27da9d[_0xcced('0x24')]=_0x2bfda4;if(_0x525be4[_0xcced('0x36')]['includeAll']){_0x562383['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xcced('0x49')](_0x562383);})[_0xcced('0x15')](function(_0x59c572){_0x27da9d[_0xcced('0x5c')]=_0x59c572;return _0x27da9d;});}})['then'](respondWithFilteredResult(_0x16a041,_0x562383))[_0xcced('0x1d')](handleError(_0x16a041,null));};exports[_0xcced('0x5d')]=function(_0x38cfe7,_0x128214){return db['ChatWebsite'][_0xcced('0x4d')]({'where':{'id':_0x38cfe7[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x128214,null))['then'](function(_0x3c9f9e){if(_0x3c9f9e){return _0x3c9f9e['removeAnswers'](_0x38cfe7[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x128214,null))[_0xcced('0x1d')](handleError(_0x128214,null));};exports[_0xcced('0x5e')]=function(_0x5492d1,_0x272f80){_0x5492d1[_0xcced('0x52')][_0xcced('0x5f')]=_0x5492d1[_0xcced('0x60')][_0xcced('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x5492d1[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x272f80,null))[_0xcced('0x15')](saveUpdates(_0x5492d1[_0xcced('0x52')],null))['then'](respondWithResult(_0x272f80,null))[_0xcced('0x1d')](handleError(_0x272f80,null));};exports[_0xcced('0x62')]=function(_0x41ad57,_0x333040){_0x41ad57[_0xcced('0x52')][_0xcced('0x63')]=_0x41ad57[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x41ad57['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x333040,null))[_0xcced('0x15')](saveUpdates(_0x41ad57[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x333040,null))[_0xcced('0x1d')](handleError(_0x333040,null));};exports[_0xcced('0x64')]=function(_0x17d186,_0x19b5c0){_0x17d186[_0xcced('0x52')]['customerAvatar']=_0x17d186[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x17d186[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19b5c0,null))[_0xcced('0x15')](saveUpdates(_0x17d186[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x19b5c0,null))[_0xcced('0x1d')](handleError(_0x19b5c0,null));};exports[_0xcced('0x65')]=function(_0x2118b8,_0x5b2f65){_0x2118b8[_0xcced('0x52')][_0xcced('0x66')]=_0x2118b8[_0xcced('0x60')][_0xcced('0x61')];return db[_0xcced('0x31')]['find']({'where':{'id':_0x2118b8[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5b2f65,null))[_0xcced('0x15')](saveUpdates(_0x2118b8[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x5b2f65,null))['catch'](handleError(_0x5b2f65,null));};exports[_0xcced('0x67')]=function(_0xb0afae,_0x2ca256){var _0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6a'));var _0x1ac382={'where':{'id':_0xb0afae[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x5f')],'raw':!![]};var _0x720878=![];return require(_0xcced('0x6b'))['getLicense']()[_0xcced('0x15')](function(_0x1bfe9c){if(_0x1bfe9c){_0x720878=_0x1bfe9c[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db[_0xcced('0x31')][_0xcced('0x4d')](_0x1ac382);})[_0xcced('0x15')](handleEntityNotFound(_0x2ca256,null))[_0xcced('0x15')](function(_0x1b6826){if(_0x1b6826){if(!_[_0xcced('0x6d')](_0x1b6826[_0xcced('0x5f')])){if(fs['existsSync'](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]))&&_0x720878){_0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]);}}return _0x2ca256[_0xcced('0x6f')](_0x15a356);}})[_0xcced('0x1d')](handleError(_0x2ca256,null));};exports[_0xcced('0x70')]=function(_0x14ffee,_0x4fdb0a){var _0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x71'));var _0x50550f={'where':{'id':_0x14ffee[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x63')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x50550f)[_0xcced('0x15')](handleEntityNotFound(_0x4fdb0a,null))['then'](function(_0x373667){if(_0x373667){if(!_[_0xcced('0x6d')](_0x373667[_0xcced('0x63')])){if(fs[_0xcced('0x72')](path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]))){_0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]);}}return _0x4fdb0a[_0xcced('0x6f')](_0x148f9b);}})['catch'](handleError(_0x4fdb0a,null));};exports['getCustomerAvatar']=function(_0x25a117,_0x33ba63){var _0x13e220=path[_0xcced('0x68')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2ba312={'where':{'id':_0x25a117[_0xcced('0x4b')]['id']},'attributes':['id','customerAvatar',_0xcced('0x74')],'raw':!![]};return db['ChatWebsite'][_0xcced('0x4d')](_0x2ba312)['then'](handleEntityNotFound(_0x33ba63,null))[_0xcced('0x15')](function(_0x2c62b1){if(_0x2c62b1){if(!_[_0xcced('0x6d')](_0x2c62b1[_0xcced('0x75')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]))&&_0x2c62b1['showCustomerAvatar']){_0x13e220=path[_0xcced('0x68')](config['root'],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]);}}return _0x33ba63[_0xcced('0x6f')](_0x13e220);}})[_0xcced('0x1d')](handleError(_0x33ba63,null));};exports['getSystemAvatar']=function(_0x555258,_0x499f0b){var _0x1e4568=path['join'](config[_0xcced('0x69')],'server/files/images/avatars/system_avatar.png');var _0x5e19d0={'where':{'id':_0x555258[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x66')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x5e19d0)[_0xcced('0x15')](handleEntityNotFound(_0x499f0b,null))[_0xcced('0x15')](function(_0x5d1c05){if(_0x5d1c05){if(!_['isNil'](_0x5d1c05[_0xcced('0x66')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']))){_0x1e4568=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']);}}return _0x499f0b['download'](_0x1e4568);}})['catch'](handleError(_0x499f0b,null));};exports[_0xcced('0x76')]=function(_0x5eeb8c,_0x522b3b){var _0x3feaf0=require('user-agent-parser');var _0x4ff851=new _0x3feaf0();var _0x383a05=_0x4ff851[_0xcced('0x77')](_0x5eeb8c[_0xcced('0x78')][_0xcced('0x79')])[_0xcced('0x7a')]();var _0x4459c1={'body':_0x5eeb8c[_0xcced('0x52')],'channel':_0xcced('0x7b')};var _0x5c607d=[];var _0x1d89cb=[];var _0x204b71={};var _0x3dd0a=![];return db['CmContact'][_0xcced('0x53')]()[_0xcced('0x15')](function(_0x9b5bd4){if(!_0x9b5bd4){throw new db[(_0xcced('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x5c607d=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),[_0xcced('0x7e'),'updatedAt']);_0x1d89cb=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),['createdAt','updatedAt','CompanyId','ListId']);if(_0x5eeb8c['body']['id']){delete _0x5eeb8c[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x5eeb8c[_0xcced('0x52')]['from'])){throw new db['Sequelize']['ValidationError'](_0xcced('0x7f'));}if(_['isNil'](_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')])||_0x5eeb8c[_0xcced('0x52')]['body']===''){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80'));}if(_['isNil'](_0x5eeb8c['body'][_0xcced('0x81')])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x83')+_0x1d89cb);}if(!_['includes'](_0x1d89cb,_0x5eeb8c[_0xcced('0x52')]['mapKey'])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x84')+_0x1d89cb);}_0x204b71[_0x5eeb8c['body'][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];})[_0xcced('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x5eeb8c[_0xcced('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0xcced('0x86'),'include':[{'model':db[_0xcced('0x87')],'as':_0xcced('0x88'),'where':_0x204b71,'limit':0x1,'order':[[_0xcced('0x89'),_0xcced('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0xcced('0x8b')}]});})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0xd33f51){if(_0xd33f51&&_0xd33f51[_0xcced('0x86')]){_0x4459c1[_0xcced('0x8c')]=_0xd33f51;_0x4459c1[_0xcced('0x8d')]=_0xd33f51['Applications'];_0x4459c1[_0xcced('0x8e')]=_0xd33f51['List'];_0x4459c1['applications']=_[_0xcced('0x8f')](_0x4459c1[_0xcced('0x8d')],[_0xcced('0x90')],[_0xcced('0x91')]);if(_0x4459c1[_0xcced('0x8c')]['Applications']){delete _0x4459c1['account']['Applications'];}if(_0x4459c1[_0xcced('0x8c')]['List']&&_0x4459c1[_0xcced('0x8c')][_0xcced('0x86')][_0xcced('0x88')][_0xcced('0x3c')]){return _0x4459c1[_0xcced('0x8c')][_0xcced('0x86')]['Contacts'][0x0];}var _0x4ae149=_[_0xcced('0xd')](_0x5eeb8c[_0xcced('0x52')],{'firstName':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0xd33f51[_0xcced('0x92')]});_0x4ae149[_0x5eeb8c[_0xcced('0x52')][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0x4e')](_0x4ae149,{'fields':_0x5c607d,'raw':!![]});}})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0x4a67e9){_0x4459c1[_0xcced('0x93')]=_0x4a67e9;var _0x3b8a26=_0x5eeb8c['body'][_0xcced('0x94')];if(_0x5eeb8c[_0xcced('0x78')][_0xcced('0x95')]){_0x3b8a26=_0x5eeb8c[_0xcced('0x78')]['cf-connecting-ip'];}else if(_0x5eeb8c['headers'][_0xcced('0x96')]){_0x3b8a26=_['first'](_0x5eeb8c[_0xcced('0x78')]['x-forwarded-for'][_0xcced('0x97')](','));}if(_0x4a67e9){var _0x4d89fe={'ContactId':_0x4a67e9['id'],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'from':(_0x4a67e9[_0xcced('0x98')]||'')+'\x20'+(_0x4a67e9[_0xcced('0x99')]||''),'customerIp':_0x3b8a26,'customerPort':_0x5eeb8c['headers']['x-real-port']?_0x5eeb8c[_0xcced('0x78')][_0xcced('0x9a')]:null,'referer':_0x5eeb8c[_0xcced('0x52')]['referer'],'browserName':_0x383a05['browser'][_0xcced('0x2b')]&&_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]?util[_0xcced('0x9d')](_0xcced('0x9e'),_0x383a05['browser']['name'],_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]):_0xcced('0x9f'),'browserVersion':_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]||'unknown','osName':util[_0xcced('0x9d')]('%s\x20%s',_0x383a05['os'][_0xcced('0x2b')],_0x383a05['os']['version']),'osVersion':_0x383a05['os'][_0xcced('0x9c')],'deviceModel':_0x383a05[_0xcced('0xa0')]['model']&&_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')]?util[_0xcced('0x9d')](_0xcced('0xa2'),_0x383a05['device'][_0xcced('0x35')],_0x383a05[_0xcced('0xa0')]['vendor'],_0x383a05[_0xcced('0xa0')][_0xcced('0x44')]):null,'deviceVendor':_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')],'deviceType':_0x383a05['device'][_0xcced('0x44')],'formData':JSON['stringify'](_0x5eeb8c[_0xcced('0x52')])};var _0x2a9a47={'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'closed':![]};if(_0x5eeb8c[_0xcced('0x52')]['threadId']){_0x2a9a47['threadId']=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];return db[_0xcced('0xa4')][_0xcced('0x4d')]({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x3210d6){if(_0x3210d6){return[_0x3210d6,![]];}_0x4d89fe[_0xcced('0xa3')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];_0x4d89fe[_0xcced('0xa5')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa5')];return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x107f3a){return[_0x107f3a,!![]];});});}_0x2a9a47[_0xcced('0xa6')]=_0x4a67e9['id'];if(_0x5eeb8c[_0xcced('0x52')]['interaction']&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa7')]['id']){_0x2a9a47['id']=_0x5eeb8c[_0xcced('0x52')]['interaction']['id'];return db[_0xcced('0xa4')]['find']({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x5d2836){if(_0x5d2836){return[_0x5d2836,![]];}return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)['then'](function(_0x295105){return[_0x295105,!![]];});});}return db['ChatInteraction'][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x3b04a8){return[_0x3b04a8,!![]];});}})[_0xcced('0xa8')](function(_0x36e66a,_0x4ee948){if(_0x36e66a){_0x3dd0a=_0x4ee948;if(!_0x4ee948){var _0x2481d3={'from':(_0x4459c1['contact'][_0xcced('0x98')]||'')+'\x20'+(_0x4459c1[_0xcced('0x93')][_0xcced('0x99')]||'')};if(_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')]&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]&&_0x5eeb8c['body']['threadId']!=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]){_0x2481d3[_0xcced('0xa3')]=_0x5eeb8c['body'][_0xcced('0xa9')];}return _0x36e66a[_0xcced('0x26')](_0x2481d3);}else{return _0x36e66a;}}})['then'](function(_0x4d7979){_0x4459c1[_0xcced('0xa7')]=_0x4d7979['get']({'plain':!![]});_0x4459c1['interaction'][_0xcced('0xaa')]=_0x3dd0a;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xaa')]){if(_0x4459c1['account'][_0xcced('0xab')]){_0x4459c1[_0xcced('0x8d')][_0xcced('0xac')]({'id':0x0,'priority':_0x4459c1[_0xcced('0x8d')][_0xcced('0x3c')]+0x1,'app':_0xcced('0xad'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xcced('0xae')][_0xcced('0x4e')]({'body':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'ChatInteractionId':_0x4d7979['id'],'direction':'in','ContactId':_0x4459c1['contact']['id'],'AttachmentId':_0x5eeb8c['body'][_0xcced('0xaf')]});})[_0xcced('0x15')](function(_0x2d4011){_0x4459c1[_0xcced('0x1c')]=_0x2d4011;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]){return db[_0xcced('0xb1')]['find']({'attributes':['id',_0xcced('0x2b')],'where':{'id':_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]}})['then'](function(_0x5a038d){if(_0x5a038d){_0x4459c1[_0xcced('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcced('0xb2'),'appdata':_0x5a038d[_0xcced('0x2b')]+','+(_0x4459c1[_0xcced('0x8c')][_0xcced('0xb3')]||0xa),'interval':_0xcced('0xb4')});_0x4459c1[_0xcced('0xb5')]=!![];}return respondWithRpcPromise(_0xcced('0xb6'),'startRouting',_0x4459c1);});}return respondWithRpcPromise(_0xcced('0xb6'),_0xcced('0xb7'),_0x4459c1);})[_0xcced('0x15')](function(_0x272749){respondWithRpcPromise(_0xcced('0xb8'),_0xcced('0xb8'),{'event':_0xcced('0x76'),'message':_0x272749},client9002);return _0x272749;})[_0xcced('0x15')](respondWithResult(_0x522b3b,null))[_0xcced('0x1d')](handleError(_0x522b3b,null));};exports[_0xcced('0xb9')]=function(_0x1e2f2a,_0x12b3e7){var _0x59d4cc,_0x4031c4,_0x4f095a;var _0x15de88=[];var _0x11b81a={};var _0x577af7=_0x1e2f2a[_0xcced('0xba')]||[];var _0x115654=[];var _0x1849be;return db['CmContact']['describe']()[_0xcced('0x15')](function(_0x5ee873){if(!_0x5ee873){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0xbb'));}_0x15de88=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x5ee873),[_0xcced('0x7e'),_0xcced('0x89'),_0xcced('0xbc'),_0xcced('0x92')]);if(_0x1e2f2a['body']['id']){delete _0x1e2f2a[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x1e2f2a[_0xcced('0x52')]['from'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))]('from\x20is\x20mandatory'));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['body'])||_0x1e2f2a[_0xcced('0x52')][_0xcced('0x52')]===''){throw _0x12b3e7['status'](0x1f4)['send'](new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80')));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['mapKeyOffline'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbd')+_0x15de88));}if(!_['includes'](_0x15de88,_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbf')+_0x15de88));}_0x11b81a[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];})['then'](function(){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x1e2f2a[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xc0')],'as':'List'},{'model':db[_0xcced('0xc1')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x12b3e7,null))['then'](function(_0x4052d4){if(_0x4052d4&&_0x4052d4[_0xcced('0x86')]){_0x4031c4=_0x4052d4;var _0x3b0a30=_['defaults'](_0x1e2f2a['body'],{'firstName':_0x1e2f2a[_0xcced('0x52')]['from'],'phone':_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0x4052d4['ListId']});_0x3b0a30[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0xc2')]({'where':_0x11b81a,'defaults':_0x3b0a30});}})['spread'](function(_0xeb64f){if(_0xeb64f){_0x4f095a=_0xeb64f;var _0x5781de=fs[_0xcced('0xc3')](path['join'](config[_0xcced('0x69')],_0xcced('0xc4')),_0xcced('0xc5'));var _0x4c2a79=ejs['render'](_0x5781de,{'body':_['toPairs'](_0x1e2f2a['body']['body']),'bodyTitle':_0x4031c4['offlineMessageBody']});return db['ChatOfflineMessage'][_0xcced('0x4e')]({'body':_0x4c2a79,'plainBody':htmlToText[_0xcced('0xc6')](_0x4c2a79),'ContactId':_0xeb64f['id'],'ChatWebsiteId':_0x4031c4['id']});}})[_0xcced('0x15')](function(_0x41900b){_0x1849be=_0x41900b;if(_0x577af7[_0xcced('0x3c')]){var _0xf45315=_0x577af7['map'](function(_0x5a7a57){return{'name':_0x5a7a57[_0xcced('0xc7')],'basename':_0x5a7a57[_0xcced('0x61')],'type':_0x5a7a57[_0xcced('0xc8')],'ChatOfflineMessageId':_0x41900b['id']};});_0x115654=_0xf45315[_0xcced('0x30')](_0x4712d5=>{var _0x167f79={'filename':_0x4712d5['name'],'path':path[_0xcced('0x68')](config['root'],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x4712d5[_0xcced('0xcc')])};return _0x167f79;});if(!_0x4031c4['openNewInteraction']){return db[_0xcced('0xcd')][_0xcced('0xce')](function(_0x80f9f6){return db[_0xcced('0xcf')][_0xcced('0xd0')](_0xf45315,{'transaction':_0x80f9f6});});}}})[_0xcced('0x15')](function(){if(_0x1849be){_0x59d4cc=_0x1849be;return db[_0xcced('0xc1')][_0xcced('0xd1')]({'where':{'service':!![]},'include':[{'model':db[_0xcced('0xd2')],'as':_0xcced('0xd3'),'raw':!![],'include':[{'model':db[_0xcced('0xd4')],'as':_0xcced('0xd4'),'raw':!![]}]}]});}})[_0xcced('0x15')](function(_0x5db023){if(_0x5db023&&_0x5db023[_0xcced('0xd3')]&&_0x4031c4[_0xcced('0xd5')]&&_0x4031c4[_0xcced('0xd6')]){var _0x24ea2d=_0x5db023[_0xcced('0xd7')]();return respondWithRpcPromise(_0xcced('0xd8'),'sendMail',{'account':_0x24ea2d,'message':{'from':util[_0xcced('0x9d')]('\x22%s\x22\x20<%s>',_0x5db023[_0xcced('0x2b')],_0x5db023[_0xcced('0xd9')]||_0x5db023[_0xcced('0xd3')]['user']),'to':_0x4031c4['forwardOfflineAddress'],'subject':_0x4031c4[_0xcced('0xda')],'html':_0x59d4cc[_0xcced('0x52')],'attachments':_0x115654}},client9003)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x19a6a9){logger[_0xcced('0x1a')](_0x19a6a9);});}})[_0xcced('0x15')](function(){if(_0x4031c4&&_0x4031c4['openNewInteraction']&&_0x4031c4[_0xcced('0xdb')]){var _0x463694=[];if(_0x577af7[_0xcced('0x3c')]){_0x463694=_0x577af7[_0xcced('0x30')](function(_0x57659d){return{'name':_0x57659d[_0xcced('0xc7')],'basename':_0x57659d[_0xcced('0x61')],'type':_0x57659d['mimetype'],'ChatOfflineMessageId':_0x1849be['id']};});}var _0x30b372;if(!_[_0xcced('0x6d')](_0x4031c4['subjectOffline'])){var _0x3cb87b=_['map'](_0x1e2f2a[_0xcced('0x52')],function(_0x3eac32){return _0x3eac32;});var _0x5cf6e7=_['toPairsIn'](_0x3cb87b)[0x0];var _0x314276=_[_0xcced('0xdc')](_0x5cf6e7,function(_0x5038e4){return _0x5038e4;});_0x30b372=_0x314276[0x1][_0x4031c4[_0xcced('0xdd')]];}var _0x186eb6={'from':_0x4f095a[_0xcced('0xd9')],'firstName':_0x4f095a[_0xcced('0x98')],'lastName':_0x4f095a['lastName'],'mapKey':_0xcced('0xd9'),'message':{'from':_0x4f095a['email'],'to':_0x4031c4['MailAccount'][_0xcced('0xd9')],'cc':'','subject':_[_0xcced('0x6d')](_0x30b372)?_0x4031c4[_0xcced('0xda')]:_0x30b372,'messageId':'','sentAt':new Date(),'attach':_0x463694[_0xcced('0x3c')],'attachments':_0x463694,'originChannel':_0xcced('0xde'),'ChatWebsiteId':_0x4031c4['id'],'ChatOfflineMessageId':_0x59d4cc['id'],'originTo':_0x4031c4[_0xcced('0xc1')]['email']},'body':_0x59d4cc[_0xcced('0x52')]};var _0x487548={'account':{'id':_0x4031c4[_0xcced('0xdb')]},'body':_0x186eb6,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xcced('0xdf'),_0x487548,client9001)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x1b0f41){logger[_0xcced('0x1a')](_0x1b0f41);});}return;})[_0xcced('0x15')](function(){if(_0x59d4cc){return _0x59d4cc;}})[_0xcced('0x15')](respondWithResult(_0x12b3e7,null))[_0xcced('0x1d')](function(_0x412ceb){logger[_0xcced('0x1a')](_0xcced('0x1d'),_0x412ceb);for(var _0x25cc19 of _0x577af7){var _0x5c565f=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x25cc19[_0xcced('0x61')]);fs_extra[_0xcced('0xe0')](_0x5c565f)[_0xcced('0x1d')](function(_0x5af517){logger[_0xcced('0x1a')](_0xcced('0xe1'),_0x5c565f,_0x5af517);});}});};exports[_0xcced('0xe2')]=function(_0x444000,_0x20b258){return db[_0xcced('0xa4')]['find']({'where':{'id':_0x444000[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x20b258,null))[_0xcced('0x15')](function(_0x5c2028){if(_0x5c2028){return _0x5c2028[_0xcced('0xe2')](_0x444000['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x444000[_0xcced('0x52')],['ids','id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x20b258,null))[_0xcced('0x1d')](handleError(_0x20b258,null));};exports[_0xcced('0xe4')]=function(_0x4965ad,_0x523cec){var _0x1dabe1={'raw':![],'where':{}};var _0x6f026a={};var _0xcd7f43={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x4965ad[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x523cec,null))[_0xcced('0x15')](function(_0x16bcd9){if(_0x16bcd9){_0x6f026a[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatInteraction']['rawAttributes']);_0x6f026a[_0xcced('0x36')]=_[_0xcced('0x37')](_0x4965ad[_0xcced('0x36')]);_0x6f026a[_0xcced('0x38')]=_[_0xcced('0x39')](_0x6f026a[_0xcced('0x35')],_0x6f026a['query']);_0x1dabe1[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x6f026a['model'],qs['fields'](_0x4965ad[_0xcced('0x36')][_0xcced('0x3b')]));_0x1dabe1[_0xcced('0x3a')]=_0x1dabe1[_0xcced('0x3a')][_0xcced('0x3c')]?_0x1dabe1[_0xcced('0x3a')]:_0x6f026a[_0xcced('0x35')];if(!_0x4965ad[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x1dabe1[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x4965ad[_0xcced('0x36')][_0xcced('0x22')]);_0x1dabe1[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x4965ad[_0xcced('0x36')][_0xcced('0x25')]);}_0x1dabe1['order']=qs[_0xcced('0x40')](_0x4965ad['query'][_0xcced('0x40')]);_0x1dabe1[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x4965ad[_0xcced('0x36')],_0x6f026a[_0xcced('0x38')]));_0x1dabe1['where'][_0xcced('0x54')]=_0x16bcd9['id'];if(_0x4965ad['query'][_0xcced('0x43')]){_0x1dabe1[_0xcced('0x41')]=_[_0xcced('0x46')](_0x1dabe1[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x1dabe1[_0xcced('0x3a')],function(_0x20091f){var _0x5e623f={};_0x5e623f[_0x20091f]={'$like':'%'+_0x4965ad['query'][_0xcced('0x43')]+'%'};return _0x5e623f;})});}_0x1dabe1=_[_0xcced('0x46')]({},_0x1dabe1,_0x4965ad[_0xcced('0x4c')]);return db[_0xcced('0xa4')][_0xcced('0x24')]({'where':_0x1dabe1[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x320def){_0xcd7f43[_0xcced('0x24')]=_0x320def;if(_0x4965ad[_0xcced('0x36')][_0xcced('0x47')]){_0x1dabe1[_0xcced('0x48')]=[{'model':db[_0xcced('0x87')],'as':'Contact','required':![]},{'model':db[_0xcced('0xb1')],'as':_0xcced('0xe5'),'attributes':[_0xcced('0x2b'),_0xcced('0xe6'),_0xcced('0xe7')],'required':![]},{'model':db['Tag'],'as':_0xcced('0xe8'),'attributes':['id','name',_0xcced('0xe9')],'where':_0x4965ad[_0xcced('0x36')]['tag']?{'id':_0x4965ad['query']['tag']}:undefined,'required':_0x4965ad[_0xcced('0x36')][_0xcced('0xea')]?!![]:![]}];}return db[_0xcced('0xa4')][_0xcced('0x49')](_0x1dabe1);})['then'](function(_0x397b0e){_0xcd7f43[_0xcced('0x5c')]=_0x397b0e;return _0xcd7f43;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x523cec,_0x1dabe1))[_0xcced('0x1d')](handleError(_0x523cec,null));};function iftimePromise(_0xbbf619,_0x6cf794){return respondWithRpcPromise(_0xcced('0xeb'),'getSnippet',{'command':_0x6cf794[_0xcced('0xec')]?util[_0xcced('0x9d')](_0xcced('0xed'),_0xbbf619[_0xcced('0xee')],_0x6cf794[_0xcced('0xec')]):util[_0xcced('0x9d')](_0xcced('0xef'),_0xbbf619[_0xcced('0xee')])},client9002)['then'](function(_0x2c2fe3){var _0x203b49=_0x2c2fe3&&_0x2c2fe3['indexOf'](_0xcced('0xf0'))>=0x0?!![]:![];logger[_0xcced('0xf1')](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],_0x203b49?_0xcced('0xf3'):_0xcced('0xf4'),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return _0x203b49;})[_0xcced('0x1d')](function(_0x3787f4){logger['error'](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],util[_0xcced('0xf6')](_0x3787f4,{'showHidden':![],'depth':null}),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return![];});}exports[_0xcced('0xf7')]=function(_0x5a9723,_0x20ae4c){var _0x413b6e=0x0;var _0xdc49da=0x0;var _0x7fc2ba=![];var _0x31a461;var _0x118083;return db[_0xcced('0x31')]['find']({'where':{'id':_0x5a9723[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf8'),'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf9'),'attributes':['id',_0xcced('0xee')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20ae4c,null))[_0xcced('0x15')](function(_0x291489){if(_0x291489){_0x31a461=_0x291489;return _0x291489[_0xcced('0xfa')]({'raw':!![]});}})['then'](function(_0x1f9241){if(_0x31a461){if(_0x1f9241){_0x118083=_0x1f9241;}}return require(_0xcced('0x6b'))[_0xcced('0xfb')]();})[_0xcced('0x15')](function(_0x42f5a6){if(_0x42f5a6){_0xdc49da=_0x42f5a6[_0xcced('0xfc')];_0x7fc2ba=_0x42f5a6[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db['ChatInteraction'][_0xcced('0x24')]({'where':{'closed':![]}});})[_0xcced('0x15')](function(_0x50a525){_0x413b6e=_0x50a525;if(_0xdc49da&&_0x50a525>_0xdc49da){return db[_0xcced('0xfd')][_0xcced('0xd1')]({'where':{'id':0x1}})[_0xcced('0x15')](function(_0x102e65){if(_0x102e65){_0x102e65['increment']('chatLicenseExceeded');}});}})[_0xcced('0x15')](function(){if(_0x31a461[_0xcced('0xf8')]&&_0x31a461[_0xcced('0xf8')]['Intervals']){var _0x3750a2=[];for(var _0x354e7c=0x0;_0x354e7c<_0x31a461[_0xcced('0xf8')]['Intervals'][_0xcced('0x3c')];_0x354e7c++){var _0x21be6c=_0x31a461[_0xcced('0xf8')]['Intervals'][_0x354e7c][_0xcced('0x28')]({'plain':!![]});_0x3750a2[_0xcced('0xac')](iftimePromise(_0x21be6c,_0x31a461));}return BPromise[_0xcced('0xfe')](_0x3750a2)['then'](function(_0x3c11e7){return _[_0xcced('0xff')](_0x3c11e7);});}else{return!![];}})[_0xcced('0x15')](function(_0x55e362){var _0x44abed=fs[_0xcced('0xc3')](path[_0xcced('0x68')](config['root'],_0xcced('0x100')),_0xcced('0xc5'));var _0x5887b3=new url['URL'](_0x31a461[_0xcced('0x101')])['origin'];var _0x4b88ad=_0xcced('0x102');var _0xaa4b44=![];var _0x1ea1ff={'chatVersion':_0x4b88ad,'chatWebsiteAddressOrigin':_0x5887b3,'remote':_0x31a461['remote'],'query':querystring[_0xcced('0x19')](_[_0xcced('0x46')](_0x31a461['get']({'plain':!![]}),{'customerIp':_0x5a9723['headers'][_0xcced('0x96')]||_0x5a9723[_0xcced('0x78')]['x-real-ip']||_0x5a9723[_0xcced('0x103')][_0xcced('0x104')]||_0x5a9723['ip'],'referer':_0x5a9723[_0xcced('0x78')][_0xcced('0x105')],'openedInteractions':_0x413b6e,'maxInteractions':_0xdc49da,'virtual':_0x7fc2ba[_0xcced('0xfc')],'online':_0x55e362,'custom':_0x7fc2ba}))[_0xcced('0x106')](/'/g,'\x5c\x27')};_0x20ae4c[_0xcced('0x2c')](ejs[_0xcced('0x107')](Mustache['render'](_0x44abed,_0x1ea1ff),{'proactiveActions':_0x118083,'alignment':_0x31a461[_0xcced('0x108')],'verticalAlignment':_0x31a461[_0xcced('0x109')],'div_color':_0x31a461[_0xcced('0xe9')],'labelText':_0x31a461['labelText'],'text_color':_0x31a461[_0xcced('0x10a')],'text_button_color':_0x31a461['textButtonColor'],'button_color':_0x31a461[_0xcced('0x10b')],'background_color':_0x31a461[_0xcced('0x10c')],'hideWhenOffline':_0x31a461[_0xcced('0x10d')],'intervalId':_0x31a461['IntervalId'],'isDevelopment':_0xaa4b44,'chatVersion':_0x4b88ad}));})[_0xcced('0x1d')](handleError(_0x20ae4c,null));};exports[_0xcced('0x10e')]=function(_0x537fb1,_0x19cabf){var _0x1df2c1=_0x537fb1[_0xcced('0x4b')]['id'];var _0x1fba43=_0x537fb1[_0xcced('0x52')];var _0x1625a2=0xc8;var _0xba9177=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xcced('0x10f')]['ISOLATION_LEVELS'][_0xcced('0x110')]},function(_0x483116){return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(_0xae1e6c){if(_0xae1e6c){return db['ChatApplication'][_0xcced('0x27')]({'where':{'ChatWebsiteId':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(){var _0xc4d6e1=_[_0xcced('0x30')](_0x1fba43,function(_0x424acb){_0x424acb[_0xcced('0x54')]=_0x1df2c1;return _0x424acb;});return db[_0xcced('0x111')][_0xcced('0xd0')](_0xc4d6e1,{'transaction':_0x483116});});}else{_0x1625a2=0x194;_0xba9177=[];}});})[_0xcced('0x15')](function(){if(_0x1625a2!==0x194){return db[_0xcced('0x111')][_0xcced('0x112')]({'where':{'ChatWebsiteId':_0x1df2c1},'order':_0xcced('0x90')})['then'](function(_0x6f4603){_0xba9177=_0x6f4603;});}})[_0xcced('0x1d')](function(_0x7e965b){_0x1625a2=0x1f4;logger[_0xcced('0x1a')](_0x7e965b[_0xcced('0x2a')]);if(_0x7e965b[_0xcced('0x2b')]){delete _0x7e965b[_0xcced('0x2b')];}_0xba9177=_0x7e965b;})[_0xcced('0x113')](function(){if(_0xba9177===null){_0x19cabf[_0xcced('0x1e')](_0x1625a2);}else{if(_0x1625a2===0x1f4){_0x19cabf[_0xcced('0x1f')](_0x1625a2)['send'](_0xba9177);}else{_0x19cabf[_0xcced('0x1f')](_0x1625a2)[_0xcced('0x21')](_0xba9177);}}});};exports['getApplications']=function(_0x1c0aef,_0x5752e7){var _0x508a2c={};var _0x5519d2={};var _0x5abb43;var _0x13a150;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1c0aef[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5752e7,null))[_0xcced('0x15')](function(_0x35b680){if(_0x35b680){_0x5abb43=_0x35b680;_0x5519d2[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatApplication']['rawAttributes']);_0x5519d2[_0xcced('0x36')]=_['keys'](_0x1c0aef[_0xcced('0x36')]);_0x5519d2['filters']=_['intersection'](_0x5519d2[_0xcced('0x35')],_0x5519d2['query']);_0x508a2c[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x5519d2[_0xcced('0x35')],qs['fields'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x3b')]));_0x508a2c['attributes']=_0x508a2c[_0xcced('0x3a')][_0xcced('0x3c')]?_0x508a2c[_0xcced('0x3a')]:_0x5519d2['model'];_0x508a2c[_0xcced('0x3f')]=qs['sort'](_0x1c0aef['query'][_0xcced('0x40')]);_0x508a2c[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x1c0aef[_0xcced('0x36')],_0x5519d2[_0xcced('0x38')]));if(_0x1c0aef[_0xcced('0x36')][_0xcced('0x43')]){_0x508a2c[_0xcced('0x41')]=_['merge'](_0x508a2c['where'],{'$or':_[_0xcced('0x30')](_0x508a2c[_0xcced('0x3a')],function(_0x5c0d5d){var _0x16ed51={};_0x16ed51[_0x5c0d5d]={'$like':'%'+_0x1c0aef['query']['filter']+'%'};return _0x16ed51;})});}_0x508a2c=_['merge']({},_0x508a2c,_0x1c0aef[_0xcced('0x4c')]);return _0x5abb43['getApplications'](_0x508a2c);}})[_0xcced('0x15')](function(_0x2360e3){if(_0x2360e3){_0x13a150=_0x2360e3[_0xcced('0x3c')];if(!_0x1c0aef[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x508a2c['limit']=qs[_0xcced('0x22')](_0x1c0aef['query'][_0xcced('0x22')]);_0x508a2c[_0xcced('0x25')]=qs['offset'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5abb43[_0xcced('0x114')](_0x508a2c);}})[_0xcced('0x15')](function(_0x21f992){if(_0x21f992){return _0x21f992?{'count':_0x13a150,'rows':_0x21f992}:null;}})[_0xcced('0x15')](respondWithResult(_0x5752e7,null))[_0xcced('0x1d')](handleError(_0x5752e7,null));};exports['addProactiveActions']=function(_0x475627,_0x110077){return db[_0xcced('0x115')][_0xcced('0x4d')]({'where':{'id':_0x475627['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x110077,null))['then'](function(_0x38fc70){if(_0x38fc70){return _0x38fc70['addProactiveActions'](_0x475627[_0xcced('0x52')][_0xcced('0x58')],_['omit'](_0x475627[_0xcced('0x52')],[_0xcced('0x58'),'id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x110077,null))[_0xcced('0x1d')](handleError(_0x110077,null));};exports[_0xcced('0xfa')]=function(_0x23c4a0,_0x2001f5){var _0x3fa897={};var _0x2ea578={};var _0x5bcf03;var _0x4522e1;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x23c4a0[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x2001f5,null))[_0xcced('0x15')](function(_0x250d2a){if(_0x250d2a){_0x5bcf03=_0x250d2a;_0x2ea578[_0xcced('0x35')]=_['keys'](db[_0xcced('0x116')]['rawAttributes']);_0x2ea578[_0xcced('0x36')]=_['keys'](_0x23c4a0[_0xcced('0x36')]);_0x2ea578['filters']=_['intersection'](_0x2ea578[_0xcced('0x35')],_0x2ea578[_0xcced('0x36')]);_0x3fa897[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x2ea578['model'],qs[_0xcced('0x3b')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x3b')]));_0x3fa897[_0xcced('0x3a')]=_0x3fa897[_0xcced('0x3a')][_0xcced('0x3c')]?_0x3fa897[_0xcced('0x3a')]:_0x2ea578[_0xcced('0x35')];_0x3fa897['order']=qs[_0xcced('0x40')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x40')]);_0x3fa897['where']=qs[_0xcced('0x38')](_['pick'](_0x23c4a0[_0xcced('0x36')],_0x2ea578[_0xcced('0x38')]));if(_0x23c4a0['query'][_0xcced('0x43')]){_0x3fa897[_0xcced('0x41')]=_[_0xcced('0x46')](_0x3fa897[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x3fa897['attributes'],function(_0x20ee43){var _0x5201ca={};_0x5201ca[_0x20ee43]={'$like':'%'+_0x23c4a0[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x5201ca;})});}_0x3fa897=_[_0xcced('0x46')]({},_0x3fa897,_0x23c4a0[_0xcced('0x4c')]);return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})[_0xcced('0x15')](function(_0x4f74ab){if(_0x4f74ab){_0x4522e1=_0x4f74ab[_0xcced('0x3c')];if(!_0x23c4a0[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x3fa897[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x22')]);_0x3fa897[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})['then'](function(_0x126d2c){if(_0x126d2c){return _0x126d2c?{'count':_0x4522e1,'rows':_0x126d2c}:null;}})[_0xcced('0x15')](respondWithResult(_0x2001f5,null))[_0xcced('0x1d')](handleError(_0x2001f5,null));};exports[_0xcced('0x117')]=function(_0x541e29,_0x3d97b5){var _0x4df014=_0x541e29[_0xcced('0x36')][_0xcced('0x118')]===_0xcced('0x119')?_0xcced('0x11a'):_0xcced('0x11b');return db['ChatWebsite']['find']({'attributes':['id',_0x4df014],'where':{'id':_0x541e29['params']['id']}})['then'](handleEntityNotFound(_0x3d97b5,null))[_0xcced('0x15')](function(_0x21c43d){if(_0x21c43d){var _0x11050f=_0x21c43d[_0x4df014];var _0x1bd368=_0x11050f&&_0x11050f[_0xcced('0x11c')]?_0x11050f[_0xcced('0x11c')]:[];_0x3d97b5[_0xcced('0x2c')]({'fromKey':_[_0xcced('0x6d')](_0x11050f['fromKey'])?undefined:_0x11050f[_0xcced('0x11d')],'count':_0x1bd368[_0xcced('0x3c')],'rows':_0x1bd368});}})[_0xcced('0x1d')](handleError(_0x3d97b5,null));};exports[_0xcced('0x11e')]=function(_0x54e75f,_0x559c0f){var _0x32f99f={'raw':![],'where':{}};var _0xc4c0ed={};var _0x3410d0={'count':0x0,'rows':[]};return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x54e75f['params']['id']}})['then'](handleEntityNotFound(_0x559c0f,null))['then'](function(_0x18dca6){if(_0x18dca6){_0xc4c0ed['model']=_[_0xcced('0x37')](db[_0xcced('0x11f')]['rawAttributes']);_0xc4c0ed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x54e75f[_0xcced('0x36')]);_0xc4c0ed[_0xcced('0x38')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],_0xc4c0ed[_0xcced('0x36')]);_0x32f99f[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x54e75f[_0xcced('0x36')][_0xcced('0x3b')]));_0x32f99f[_0xcced('0x3a')]=_0x32f99f[_0xcced('0x3a')]['length']?_0x32f99f['attributes']:_0xc4c0ed[_0xcced('0x35')];if(!_0x54e75f[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x32f99f[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x54e75f[_0xcced('0x36')][_0xcced('0x22')]);_0x32f99f[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x54e75f['query']['offset']);}_0x32f99f[_0xcced('0x3f')]=qs['sort'](_0x54e75f['query'][_0xcced('0x40')]);_0x32f99f[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x54e75f[_0xcced('0x36')],_0xc4c0ed[_0xcced('0x38')]));_0x32f99f['where'][_0xcced('0x54')]=_0x18dca6['id'];if(_0x54e75f[_0xcced('0x36')]['filter']){_0x32f99f['where']=_[_0xcced('0x46')](_0x32f99f[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x32f99f[_0xcced('0x3a')],function(_0x4f63c9){var _0x53b4b8={};_0x53b4b8[_0x4f63c9]={'$like':'%'+_0x54e75f[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x53b4b8;})});}_0x32f99f=_[_0xcced('0x46')]({},_0x32f99f,_0x54e75f[_0xcced('0x4c')]);return db[_0xcced('0x11f')]['count']({'where':_0x32f99f[_0xcced('0x41')]})[_0xcced('0x15')](function(_0xe329ab){_0x3410d0['count']=_0xe329ab;if(_0x54e75f[_0xcced('0x36')][_0xcced('0x47')]){_0x32f99f['include']=[{'all':!![]}];}else{_0x32f99f['include']=[{'model':db[_0xcced('0x87')],'as':_0xcced('0x120'),'required':![]},{'model':db[_0xcced('0xcf')],'as':_0xcced('0x121'),'required':![]}];}return db[_0xcced('0x11f')][_0xcced('0x49')](_0x32f99f);})[_0xcced('0x15')](function(_0x19f355){_0x3410d0[_0xcced('0x5c')]=_0x19f355;return _0x3410d0;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x559c0f,_0x32f99f))[_0xcced('0x1d')](handleError(_0x559c0f,null));};exports[_0xcced('0x122')]=function(_0x3675f4,_0x562457){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x3675f4[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x562457,null))[_0xcced('0x15')](function(_0x3472ec){if(_0x3472ec){return _0x3472ec[_0xcced('0x122')](_0x3675f4['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x3675f4[_0xcced('0x52')],['ids','id'])||{})[_0xcced('0xa8')](function(_0x27a447){for(var _0x14e490=0x0;_0x14e490<_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0xcced('0x3c')];_0x14e490+=0x1){socket[_0xcced('0x123')](_0xcced('0x124'),{'UserId':Number(_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0x14e490]),'ChatWebsiteId':Number(_0x3675f4[_0xcced('0x4b')]['id'])});}return _0x27a447;});}})[_0xcced('0x15')](respondWithResult(_0x562457,null))[_0xcced('0x1d')](handleError(_0x562457,null));};exports['removeAgents']=function(_0x160764,_0x4d0d2c){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x160764['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x4d0d2c,null))[_0xcced('0x15')](function(_0x4abe52){if(_0x4abe52){return _0x4abe52['removeAgents'](_0x160764[_0xcced('0x36')][_0xcced('0x58')])[_0xcced('0x15')](function(){if(_[_0xcced('0x125')](_0x160764['query'][_0xcced('0x58')])){for(var _0x523a90=0x0;_0x523a90<_0x160764['query'][_0xcced('0x58')][_0xcced('0x3c')];_0x523a90+=0x1){socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')][_0x523a90]),'ChatWebsiteId':Number(_0x160764[_0xcced('0x4b')]['id'])});}}else{socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')]),'ChatWebsiteId':Number(_0x160764['params']['id'])});}});}})[_0xcced('0x15')](respondWithStatusCode(_0x4d0d2c,null))[_0xcced('0x1d')](handleError(_0x4d0d2c,null));};exports[_0xcced('0x127')]=function(_0x55e328,_0x340e31){var _0x58e0ee={};var _0x223776={};var _0x1781f9;var _0x2c50ad;return db['ChatWebsite'][_0xcced('0xd1')]({'where':{'id':_0x55e328[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x340e31,null))['then'](function(_0x15c9ea){if(_0x15c9ea){_0x1781f9=_0x15c9ea;_0x223776[_0xcced('0x35')]=_['keys'](db['User'][_0xcced('0x32')]);_0x223776[_0xcced('0x36')]=_[_0xcced('0x37')](_0x55e328[_0xcced('0x36')]);_0x223776['filters']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],_0x223776[_0xcced('0x36')]);_0x58e0ee['attributes']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],qs['fields'](_0x55e328['query'][_0xcced('0x3b')]));_0x58e0ee[_0xcced('0x3a')]=_0x58e0ee[_0xcced('0x3a')]['length']?_0x58e0ee[_0xcced('0x3a')]:_0x223776[_0xcced('0x35')];_0x58e0ee['order']=qs['sort'](_0x55e328[_0xcced('0x36')][_0xcced('0x40')]);_0x58e0ee[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x55e328[_0xcced('0x36')],_0x223776[_0xcced('0x38')]));if(_0x55e328[_0xcced('0x36')][_0xcced('0x43')]){_0x58e0ee[_0xcced('0x41')]=_[_0xcced('0x46')](_0x58e0ee[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x58e0ee[_0xcced('0x3a')],function(_0x41f2e6){var _0x33f0a5={};_0x33f0a5[_0x41f2e6]={'$like':'%'+_0x55e328[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x33f0a5;})});}_0x58e0ee=_[_0xcced('0x46')]({},_0x58e0ee,_0x55e328[_0xcced('0x4c')]);return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x14b2d7){if(_0x14b2d7){_0x2c50ad=_0x14b2d7[_0xcced('0x3c')];if(!_0x55e328[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x58e0ee['limit']=qs[_0xcced('0x22')](_0x55e328[_0xcced('0x36')][_0xcced('0x22')]);_0x58e0ee[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x55e328[_0xcced('0x36')][_0xcced('0x25')]);}return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x473792){if(_0x473792){return _0x473792?{'count':_0x2c50ad,'rows':_0x473792}:null;}})[_0xcced('0x15')](respondWithResult(_0x340e31,null))['catch'](handleError(_0x340e31,null));}; \ No newline at end of file +var _0x6691=['show','params','length','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','ChatApplication','List','applications','Applications','list','asc','account','ListId','contact','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','offline','send','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','openNewInteraction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail','files','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','URL','address','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','textButtonColor','IntervalId','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','stack','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','url','defaults','redis','localhost','socket.io-emitter','register','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','json','undefined','count','offset','limit','status','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','name','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','ChatWebsite','includeAll','include','findAll','rows'];(function(_0x4e7f55,_0x3729f9){var _0xa2aee1=function(_0x1a66a2){while(--_0x1a66a2){_0x4e7f55['push'](_0x4e7f55['shift']());}};_0xa2aee1(++_0x3729f9);}(_0x6691,0xe7));var _0x1669=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6691[_0x1035c1];return _0x308d67;};'use strict';var BPromise=require(_0x1669('0x0'));var Mustache=require(_0x1669('0x1'));var util=require(_0x1669('0x2'));var path=require(_0x1669('0x3'));var ejs=require(_0x1669('0x4'));var fs=require('fs');var fs_extra=require(_0x1669('0x5'));var _=require(_0x1669('0x6'));var querystring=require(_0x1669('0x7'));var Redis=require(_0x1669('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x1669('0x9'))(_0x1669('0xa'));var config=require(_0x1669('0xb'));var url=require(_0x1669('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1669('0xd')](config[_0x1669('0xe')],{'host':_0x1669('0xf'),'port':0x18eb});var socket=require(_0x1669('0x10'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x1669('0x11')](socket);var htmlToText=require(_0x1669('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x232c});var client9002=jayson[_0x1669('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x232b});var client9001=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x2552a3,_0x5ebf12,_0x4ae9a7,_0x2100b7){return new BPromise(function(_0x4647db,_0x2d926e){var _0x3c352b=_0x2100b7||client;return _0x3c352b[_0x1669('0x15')](_0x2552a3,_0x4ae9a7)[_0x1669('0x16')](function(_0x5868be){logger['info'](_0x1669('0x17'),_0x5ebf12,_0x1669('0x18'));logger[_0x1669('0x19')](_0x1669('0x1a'),_0x5ebf12,'request\x20sent',JSON['stringify'](_0x5868be));if(_0x5868be[_0x1669('0x1b')]){if(_0x5868be[_0x1669('0x1b')][_0x1669('0x1c')]===0x1f4){logger[_0x1669('0x1b')](_0x1669('0x17'),_0x5ebf12,_0x5868be['error']['message']);return _0x2d926e(_0x5868be[_0x1669('0x1b')][_0x1669('0x1d')]);}logger[_0x1669('0x1b')](_0x1669('0x17'),_0x5ebf12,_0x5868be['error']['message']);return _0x4647db(_0x5868be[_0x1669('0x1b')]['message']);}else{logger['info'](_0x1669('0x17'),_0x5ebf12,_0x1669('0x18'));_0x4647db(_0x5868be['result'][_0x1669('0x1d')]);}})[_0x1669('0x1e')](function(_0x1345d8){logger['error'](_0x1669('0x17'),_0x5ebf12,_0x1345d8);_0x2d926e(_0x1345d8);});});}function respondWithStatusCode(_0x87b47b,_0x623948){_0x623948=_0x623948||0xcc;return function(_0x301dc7){if(_0x301dc7){return _0x87b47b['sendStatus'](_0x623948);}return _0x87b47b['status'](_0x623948)[_0x1669('0x1f')]();};}function respondWithResult(_0x43577b,_0x40612b){_0x40612b=_0x40612b||0xc8;return function(_0x321ccf){if(_0x321ccf){return _0x43577b['status'](_0x40612b)[_0x1669('0x20')](_0x321ccf);}};}function respondWithFilteredResult(_0x4401a2,_0x12470c){return function(_0x4a228e){if(_0x4a228e){var _0x3055aa=typeof _0x12470c['offset']===_0x1669('0x21')&&typeof _0x12470c['limit']==='undefined';var _0x1ab97b=_0x4a228e[_0x1669('0x22')];var _0x1f62ea=_0x3055aa?0x0:_0x12470c[_0x1669('0x23')];var _0x35c0ac=_0x3055aa?_0x4a228e[_0x1669('0x22')]:_0x12470c[_0x1669('0x23')]+_0x12470c[_0x1669('0x24')];var _0x57e754;if(_0x35c0ac>=_0x1ab97b){_0x35c0ac=_0x1ab97b;_0x57e754=0xc8;}else{_0x57e754=0xce;}_0x4401a2[_0x1669('0x25')](_0x57e754);return _0x4401a2[_0x1669('0x26')](_0x1669('0x27'),_0x1f62ea+'-'+_0x35c0ac+'/'+_0x1ab97b)[_0x1669('0x20')](_0x4a228e);}return null;};}function saveUpdates(_0x348c14){return function(_0x3b0437){if(_0x3b0437){return _0x3b0437[_0x1669('0x28')](_0x348c14)[_0x1669('0x16')](function(_0x15bebb){return _0x15bebb;});}return null;};}function removeEntity(_0x404d87){return function(_0x1af32e){if(_0x1af32e){return _0x1af32e['destroy']()[_0x1669('0x16')](function(){var _0x324fe9=_0x1af32e[_0x1669('0x29')]({'plain':!![]});var _0x1827e2=_0x1669('0x2a');return db[_0x1669('0x2b')][_0x1669('0x2c')]({'where':{'type':_0x1827e2,'resourceId':_0x324fe9['id']}})[_0x1669('0x16')](function(){return _0x1af32e;});})[_0x1669('0x16')](function(){_0x404d87[_0x1669('0x25')](0xcc)[_0x1669('0x1f')]();});}};}function handleEntityNotFound(_0x3938f1){return function(_0x182241){if(!_0x182241){_0x3938f1[_0x1669('0x2d')](0x194);}return _0x182241;};}function handleError(_0xa74528,_0x5c9be4){_0x5c9be4=_0x5c9be4||0x1f4;return function(_0x58c844){logger[_0x1669('0x1b')](_0x58c844['stack']);if(_0x58c844[_0x1669('0x2e')]){delete _0x58c844['name'];}_0xa74528[_0x1669('0x25')](_0x5c9be4)['send'](_0x58c844);};}exports['index']=function(_0x834182,_0x23bf51){var _0x6165df={'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]},_0x1fdd21={},_0x610175={'count':0x0,'rows':[]};var _0x22ab96=_[_0x1669('0x30')](db['ChatWebsite'][_0x1669('0x31')],function(_0x5925ff){return{'name':_0x5925ff['fieldName'],'type':_0x5925ff['type'][_0x1669('0x32')]};});_0x1fdd21[_0x1669('0x33')]=_[_0x1669('0x30')](_0x22ab96,_0x1669('0x2e'));_0x1fdd21[_0x1669('0x34')]=_[_0x1669('0x35')](_0x834182[_0x1669('0x34')]);_0x1fdd21['filters']=_[_0x1669('0x36')](_0x1fdd21[_0x1669('0x33')],_0x1fdd21[_0x1669('0x34')]);_0x6165df[_0x1669('0x37')]=_['intersection'](_0x1fdd21[_0x1669('0x33')],qs[_0x1669('0x38')](_0x834182[_0x1669('0x34')][_0x1669('0x38')]));_0x6165df[_0x1669('0x37')]=_0x6165df[_0x1669('0x37')]['length']?_0x6165df[_0x1669('0x37')]:_0x1fdd21[_0x1669('0x33')];if(!_0x834182[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x6165df[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x834182[_0x1669('0x34')][_0x1669('0x24')]);_0x6165df[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x834182[_0x1669('0x34')][_0x1669('0x23')]);}_0x6165df[_0x1669('0x3b')]=qs['sort'](_0x834182[_0x1669('0x34')][_0x1669('0x3c')]);_0x6165df[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x834182[_0x1669('0x34')],_0x1fdd21['filters']),_0x22ab96);if(_0x834182['query'][_0x1669('0x40')]){_0x6165df[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x6165df[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x22ab96,function(_0x5bb65a){if(_0x5bb65a[_0x1669('0x42')]!=='VIRTUAL'){var _0x5df323={};_0x5df323[_0x5bb65a[_0x1669('0x2e')]]={'$like':'%'+_0x834182[_0x1669('0x34')][_0x1669('0x40')]+'%'};return _0x5df323;}})});}_0x6165df=_[_0x1669('0x41')]({},_0x6165df,_0x834182['options']);var _0x174e2f={'where':_0x6165df['where']};return db[_0x1669('0x43')][_0x1669('0x22')](_0x174e2f)[_0x1669('0x16')](function(_0x19bdec){_0x610175[_0x1669('0x22')]=_0x19bdec;if(_0x834182[_0x1669('0x34')][_0x1669('0x44')]){_0x6165df[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x43')][_0x1669('0x46')](_0x6165df);})['then'](function(_0x1466a2){_0x610175[_0x1669('0x47')]=_0x1466a2;return _0x610175;})[_0x1669('0x16')](respondWithFilteredResult(_0x23bf51,_0x6165df))['catch'](handleError(_0x23bf51,null));};exports[_0x1669('0x48')]=function(_0x28a30d,_0x490ea2){var _0x19bf78={'raw':![],'where':{'id':_0x28a30d[_0x1669('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]},_0x115645={};_0x115645[_0x1669('0x33')]=_[_0x1669('0x35')](db['ChatWebsite']['rawAttributes']);_0x115645[_0x1669('0x34')]=_[_0x1669('0x35')](_0x28a30d[_0x1669('0x34')]);_0x115645[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x115645[_0x1669('0x33')],_0x115645[_0x1669('0x34')]);_0x19bf78[_0x1669('0x37')]=_[_0x1669('0x36')](_0x115645[_0x1669('0x33')],qs[_0x1669('0x38')](_0x28a30d[_0x1669('0x34')][_0x1669('0x38')]));_0x19bf78[_0x1669('0x37')]=_0x19bf78[_0x1669('0x37')][_0x1669('0x4a')]?_0x19bf78[_0x1669('0x37')]:_0x115645[_0x1669('0x33')];if(_0x28a30d[_0x1669('0x34')][_0x1669('0x44')]){_0x19bf78[_0x1669('0x45')]=[{'all':!![]}];}_0x19bf78=_[_0x1669('0x41')]({},_0x19bf78,_0x28a30d[_0x1669('0x4b')]);return db[_0x1669('0x43')]['find'](_0x19bf78)[_0x1669('0x16')](handleEntityNotFound(_0x490ea2,null))['then'](respondWithResult(_0x490ea2,null))[_0x1669('0x1e')](handleError(_0x490ea2,null));};exports['create']=function(_0x5d527d,_0x575796){return db['ChatWebsite']['create'](_0x5d527d[_0x1669('0x4c')],{})[_0x1669('0x16')](function(_0x5b98c0){var _0x3d08f2=_0x5d527d['user'][_0x1669('0x29')]({'plain':!![]});if(!_0x3d08f2)throw new Error(_0x1669('0x4d'));if(_0x3d08f2[_0x1669('0x4e')]==='user'){var _0x2ecc38=_0x5b98c0[_0x1669('0x29')]({'plain':!![]});var _0x25695c=_0x1669('0x2a');return db[_0x1669('0x4f')][_0x1669('0x50')]({'where':{'name':_0x25695c,'userProfileId':_0x3d08f2['userProfileId']},'raw':!![]})[_0x1669('0x16')](function(_0x4964b0){if(_0x4964b0&&_0x4964b0[_0x1669('0x51')]===0x0){return db['UserProfileResource'][_0x1669('0x52')]({'name':_0x2ecc38[_0x1669('0x2e')],'resourceId':_0x2ecc38['id'],'type':_0x4964b0[_0x1669('0x2e')],'sectionId':_0x4964b0['id']},{})[_0x1669('0x16')](function(){return _0x5b98c0;});}else{return _0x5b98c0;}})['catch'](function(_0x3876cb){logger[_0x1669('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3876cb);throw _0x3876cb;});}return _0x5b98c0;})[_0x1669('0x16')](respondWithResult(_0x575796,0xc9))[_0x1669('0x1e')](handleError(_0x575796,null));};exports[_0x1669('0x28')]=function(_0x38cf1a,_0x2237ab){if(_0x38cf1a[_0x1669('0x4c')]['id']){delete _0x38cf1a[_0x1669('0x4c')]['id'];}return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x38cf1a[_0x1669('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]})[_0x1669('0x16')](handleEntityNotFound(_0x2237ab,null))[_0x1669('0x16')](saveUpdates(_0x38cf1a[_0x1669('0x4c')],null))['then'](respondWithResult(_0x2237ab,null))[_0x1669('0x1e')](handleError(_0x2237ab,null));};exports[_0x1669('0x2c')]=function(_0x3dfa73,_0x4a2eca){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x3dfa73[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4a2eca,null))[_0x1669('0x16')](removeEntity(_0x4a2eca,null))['catch'](handleError(_0x4a2eca,null));};exports[_0x1669('0x53')]=function(_0x2ab2f6,_0xa43a09){return db[_0x1669('0x43')]['describe']()['then'](respondWithResult(_0xa43a09,null))[_0x1669('0x1e')](handleError(_0xa43a09,null));};exports[_0x1669('0x54')]=function(_0x24fc6e,_0xea02bd){if(_0x24fc6e[_0x1669('0x4c')]['id']){delete _0x24fc6e[_0x1669('0x4c')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x24fc6e[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0xea02bd,null))[_0x1669('0x16')](function(_0x5037a8){if(_0x5037a8){_0x24fc6e[_0x1669('0x4c')][_0x1669('0x55')]=_0x5037a8['id'];return db[_0x1669('0x56')][_0x1669('0x52')](_0x24fc6e[_0x1669('0x4c')]);}})['then'](respondWithResult(_0xea02bd,null))[_0x1669('0x1e')](handleError(_0xea02bd,null));};exports[_0x1669('0x57')]=function(_0x3df7fd,_0x7d644){var _0x39f21b={'raw':![],'where':{}};var _0x6d0306={};var _0x272111={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1669('0x58')]({'where':{'id':_0x3df7fd['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x7d644,null))[_0x1669('0x16')](function(_0x4d566e){if(_0x4d566e){_0x6d0306[_0x1669('0x33')]=_['keys'](db[_0x1669('0x56')]['rawAttributes']);_0x6d0306[_0x1669('0x34')]=_['keys'](_0x3df7fd[_0x1669('0x34')]);_0x6d0306['filters']=_[_0x1669('0x36')](_0x6d0306['model'],_0x6d0306[_0x1669('0x34')]);_0x39f21b[_0x1669('0x37')]=_['intersection'](_0x6d0306[_0x1669('0x33')],qs[_0x1669('0x38')](_0x3df7fd[_0x1669('0x34')][_0x1669('0x38')]));_0x39f21b[_0x1669('0x37')]=_0x39f21b[_0x1669('0x37')]['length']?_0x39f21b[_0x1669('0x37')]:_0x6d0306['model'];if(!_0x3df7fd[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x39f21b[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x3df7fd[_0x1669('0x34')][_0x1669('0x24')]);_0x39f21b[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x3df7fd['query'][_0x1669('0x23')]);}_0x39f21b[_0x1669('0x3b')]=qs['sort'](_0x3df7fd[_0x1669('0x34')]['sort']);_0x39f21b['where']=qs[_0x1669('0x3e')](_['pick'](_0x3df7fd[_0x1669('0x34')],_0x6d0306[_0x1669('0x3e')]));_0x39f21b[_0x1669('0x3d')][_0x1669('0x55')]=_0x4d566e['id'];if(_0x3df7fd['query'][_0x1669('0x40')]){_0x39f21b[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x39f21b[_0x1669('0x3d')],{'$or':_['map'](_0x39f21b[_0x1669('0x37')],function(_0x3ca4ab){var _0x3d1dbf={};_0x3d1dbf[_0x3ca4ab]={'$like':'%'+_0x3df7fd[_0x1669('0x34')][_0x1669('0x40')]+'%'};return _0x3d1dbf;})});}_0x39f21b=_[_0x1669('0x41')]({},_0x39f21b,_0x3df7fd[_0x1669('0x4b')]);return db['Disposition'][_0x1669('0x22')]({'where':_0x39f21b[_0x1669('0x3d')]})['then'](function(_0x5db23d){_0x272111[_0x1669('0x22')]=_0x5db23d;if(_0x3df7fd[_0x1669('0x34')][_0x1669('0x44')]){_0x39f21b[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x56')][_0x1669('0x46')](_0x39f21b);})[_0x1669('0x16')](function(_0x533e59){_0x272111['rows']=_0x533e59;return _0x272111;});}})[_0x1669('0x16')](respondWithFilteredResult(_0x7d644,_0x39f21b))[_0x1669('0x1e')](handleError(_0x7d644,null));};exports[_0x1669('0x59')]=function(_0x56f211,_0x70a9ca){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x56f211[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x70a9ca,null))[_0x1669('0x16')](function(_0x1bebe1){if(_0x1bebe1){return _0x1bebe1['removeDispositions'](_0x56f211[_0x1669('0x34')][_0x1669('0x5a')]);}})[_0x1669('0x16')](respondWithStatusCode(_0x70a9ca,null))['catch'](handleError(_0x70a9ca,null));};exports['addAnswer']=function(_0x34d4ec,_0x1158d6){if(_0x34d4ec[_0x1669('0x4c')]['id']){delete _0x34d4ec[_0x1669('0x4c')]['id'];}return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x34d4ec[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x1158d6,null))[_0x1669('0x16')](function(_0x35597e){if(_0x35597e){_0x34d4ec[_0x1669('0x4c')][_0x1669('0x55')]=_0x35597e['id'];return db[_0x1669('0x5b')]['create'](_0x34d4ec[_0x1669('0x4c')]);}})[_0x1669('0x16')](respondWithResult(_0x1158d6,null))['catch'](handleError(_0x1158d6,null));};exports[_0x1669('0x5c')]=function(_0x418eed,_0x5b82bc){var _0x2b538c={'raw':![],'where':{}};var _0xe35d38={};var _0x4137fb={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x418eed[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b82bc,null))['then'](function(_0x3704f4){if(_0x3704f4){_0xe35d38[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0x5b')][_0x1669('0x31')]);_0xe35d38['query']=_['keys'](_0x418eed['query']);_0xe35d38['filters']=_['intersection'](_0xe35d38['model'],_0xe35d38[_0x1669('0x34')]);_0x2b538c[_0x1669('0x37')]=_['intersection'](_0xe35d38[_0x1669('0x33')],qs[_0x1669('0x38')](_0x418eed[_0x1669('0x34')][_0x1669('0x38')]));_0x2b538c[_0x1669('0x37')]=_0x2b538c['attributes'][_0x1669('0x4a')]?_0x2b538c[_0x1669('0x37')]:_0xe35d38['model'];if(!_0x418eed[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x2b538c[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x418eed[_0x1669('0x34')]['limit']);_0x2b538c[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x418eed[_0x1669('0x34')][_0x1669('0x23')]);}_0x2b538c['order']=qs['sort'](_0x418eed[_0x1669('0x34')][_0x1669('0x3c')]);_0x2b538c['where']=qs['filters'](_[_0x1669('0x3f')](_0x418eed['query'],_0xe35d38[_0x1669('0x3e')]));_0x2b538c[_0x1669('0x3d')][_0x1669('0x55')]=_0x3704f4['id'];if(_0x418eed['query'][_0x1669('0x40')]){_0x2b538c[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x2b538c[_0x1669('0x3d')],{'$or':_['map'](_0x2b538c['attributes'],function(_0xe9b1b){var _0x32c53a={};_0x32c53a[_0xe9b1b]={'$like':'%'+_0x418eed['query'][_0x1669('0x40')]+'%'};return _0x32c53a;})});}_0x2b538c=_[_0x1669('0x41')]({},_0x2b538c,_0x418eed[_0x1669('0x4b')]);return db['CannedAnswer']['count']({'where':_0x2b538c[_0x1669('0x3d')]})[_0x1669('0x16')](function(_0x2e88e8){_0x4137fb[_0x1669('0x22')]=_0x2e88e8;if(_0x418eed[_0x1669('0x34')][_0x1669('0x44')]){_0x2b538c[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x5b')][_0x1669('0x46')](_0x2b538c);})[_0x1669('0x16')](function(_0xab854b){_0x4137fb[_0x1669('0x47')]=_0xab854b;return _0x4137fb;});}})['then'](respondWithFilteredResult(_0x5b82bc,_0x2b538c))['catch'](handleError(_0x5b82bc,null));};exports[_0x1669('0x5d')]=function(_0x52ec4b,_0x508b94){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x52ec4b[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x508b94,null))[_0x1669('0x16')](function(_0x1b4941){if(_0x1b4941){return _0x1b4941[_0x1669('0x5d')](_0x52ec4b[_0x1669('0x34')][_0x1669('0x5a')]);}})[_0x1669('0x16')](respondWithStatusCode(_0x508b94,null))[_0x1669('0x1e')](handleError(_0x508b94,null));};exports[_0x1669('0x5e')]=function(_0x247939,_0x4d461d){_0x247939['body'][_0x1669('0x5f')]=_0x247939[_0x1669('0x60')][_0x1669('0x61')];return db['ChatWebsite'][_0x1669('0x50')]({'where':{'id':_0x247939[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4d461d,null))['then'](saveUpdates(_0x247939['body'],null))['then'](respondWithResult(_0x4d461d,null))[_0x1669('0x1e')](handleError(_0x4d461d,null));};exports['addAvatar']=function(_0x1f2f4d,_0x4877aa){_0x1f2f4d['body'][_0x1669('0x62')]=_0x1f2f4d[_0x1669('0x60')][_0x1669('0x61')];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x1f2f4d[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4877aa,null))['then'](saveUpdates(_0x1f2f4d[_0x1669('0x4c')],null))[_0x1669('0x16')](respondWithResult(_0x4877aa,null))[_0x1669('0x1e')](handleError(_0x4877aa,null));};exports[_0x1669('0x63')]=function(_0x563429,_0x25ef1a){_0x563429[_0x1669('0x4c')][_0x1669('0x64')]=_0x563429[_0x1669('0x60')]['filename'];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x563429['params']['id']}})['then'](handleEntityNotFound(_0x25ef1a,null))[_0x1669('0x16')](saveUpdates(_0x563429[_0x1669('0x4c')],null))['then'](respondWithResult(_0x25ef1a,null))['catch'](handleError(_0x25ef1a,null));};exports[_0x1669('0x65')]=function(_0x35b279,_0xd90e09){_0x35b279['body'][_0x1669('0x66')]=_0x35b279[_0x1669('0x60')][_0x1669('0x61')];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x35b279['params']['id']}})['then'](handleEntityNotFound(_0xd90e09,null))[_0x1669('0x16')](saveUpdates(_0x35b279['body'],null))[_0x1669('0x16')](respondWithResult(_0xd90e09,null))[_0x1669('0x1e')](handleError(_0xd90e09,null));};exports[_0x1669('0x67')]=function(_0x5862eb,_0x276b78){var _0x4353c2=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x6a'));var _0x2cab47={'where':{'id':_0x5862eb[_0x1669('0x49')]['id']},'attributes':['id',_0x1669('0x5f')],'raw':!![]};var _0x3679d0=![];return require(_0x1669('0x6b'))[_0x1669('0x6c')]()['then'](function(_0xcf579f){if(_0xcf579f){_0x3679d0=_0xcf579f[_0x1669('0x6d')];}})[_0x1669('0x16')](function(){return db['ChatWebsite'][_0x1669('0x50')](_0x2cab47);})[_0x1669('0x16')](handleEntityNotFound(_0x276b78,null))['then'](function(_0x49c2fe){if(_0x49c2fe){if(!_[_0x1669('0x6e')](_0x49c2fe[_0x1669('0x5f')])){if(fs[_0x1669('0x6f')](path[_0x1669('0x68')](config['root'],_0x1669('0x70'),_0x49c2fe[_0x1669('0x5f')]))&&_0x3679d0){_0x4353c2=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x70'),_0x49c2fe['sitepic']);}}return _0x276b78[_0x1669('0x71')](_0x4353c2);}})['catch'](handleError(_0x276b78,null));};exports[_0x1669('0x72')]=function(_0x344b11,_0x460d0e){var _0x2808ac=path[_0x1669('0x68')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x438abe={'where':{'id':_0x344b11['params']['id']},'attributes':['id',_0x1669('0x62')],'raw':!![]};return db[_0x1669('0x43')][_0x1669('0x50')](_0x438abe)[_0x1669('0x16')](handleEntityNotFound(_0x460d0e,null))[_0x1669('0x16')](function(_0x8c0af8){if(_0x8c0af8){if(!_[_0x1669('0x6e')](_0x8c0af8[_0x1669('0x62')])){if(fs[_0x1669('0x6f')](path['join'](config[_0x1669('0x69')],'server/files/images/avatars/',_0x8c0af8[_0x1669('0x62')]))){_0x2808ac=path[_0x1669('0x68')](config['root'],_0x1669('0x73'),_0x8c0af8['agentAvatar']);}}return _0x460d0e[_0x1669('0x71')](_0x2808ac);}})[_0x1669('0x1e')](handleError(_0x460d0e,null));};exports[_0x1669('0x74')]=function(_0x461af2,_0x337325){var _0x3b7dce=path['join'](config[_0x1669('0x69')],_0x1669('0x75'));var _0x29b2b7={'where':{'id':_0x461af2[_0x1669('0x49')]['id']},'attributes':['id',_0x1669('0x64'),_0x1669('0x76')],'raw':!![]};return db['ChatWebsite'][_0x1669('0x50')](_0x29b2b7)[_0x1669('0x16')](handleEntityNotFound(_0x337325,null))[_0x1669('0x16')](function(_0x55778a){if(_0x55778a){if(!_[_0x1669('0x6e')](_0x55778a[_0x1669('0x64')])){if(fs['existsSync'](path[_0x1669('0x68')](config['root'],_0x1669('0x73'),_0x55778a[_0x1669('0x64')]))&&_0x55778a[_0x1669('0x76')]){_0x3b7dce=path['join'](config['root'],_0x1669('0x73'),_0x55778a[_0x1669('0x64')]);}}return _0x337325[_0x1669('0x71')](_0x3b7dce);}})[_0x1669('0x1e')](handleError(_0x337325,null));};exports['getSystemAvatar']=function(_0x54c7d0,_0x4c379a){var _0x1259d0=path['join'](config[_0x1669('0x69')],_0x1669('0x77'));var _0x5ba281={'where':{'id':_0x54c7d0['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1669('0x43')][_0x1669('0x50')](_0x5ba281)[_0x1669('0x16')](handleEntityNotFound(_0x4c379a,null))[_0x1669('0x16')](function(_0x1ab6fd){if(_0x1ab6fd){if(!_[_0x1669('0x6e')](_0x1ab6fd[_0x1669('0x66')])){if(fs[_0x1669('0x6f')](path['join'](config[_0x1669('0x69')],_0x1669('0x73'),_0x1ab6fd[_0x1669('0x66')]))){_0x1259d0=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x73'),_0x1ab6fd[_0x1669('0x66')]);}}return _0x4c379a[_0x1669('0x71')](_0x1259d0);}})['catch'](handleError(_0x4c379a,null));};exports[_0x1669('0x78')]=function(_0x288269,_0xe08359){var _0x71746a=require(_0x1669('0x79'));var _0x5f3181=new _0x71746a();var _0x2202a3=_0x5f3181[_0x1669('0x7a')](_0x288269['headers'][_0x1669('0x7b')])[_0x1669('0x7c')]();var _0x5a24d3={'body':_0x288269['body'],'channel':_0x1669('0x7d')};var _0x285875=[];var _0x18fd61=[];var _0x1c34af={};var _0x24eb12=![];return db[_0x1669('0x7e')][_0x1669('0x53')]()[_0x1669('0x16')](function(_0x774a7e){if(!_0x774a7e){throw new db['Sequelize'][(_0x1669('0x7f'))](_0x1669('0x80'));}_0x285875=_[_0x1669('0x81')](_['keys'](_0x774a7e),[_0x1669('0x82'),_0x1669('0x83')]);_0x18fd61=_[_0x1669('0x81')](_[_0x1669('0x35')](_0x774a7e),['createdAt',_0x1669('0x83'),_0x1669('0x84'),'ListId']);if(_0x288269['body']['id']){delete _0x288269[_0x1669('0x4c')]['id'];}if(_['isNil'](_0x288269[_0x1669('0x4c')][_0x1669('0x85')])){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x288269['body'][_0x1669('0x4c')])||_0x288269['body']['body']===''){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0x87'));}if(_[_0x1669('0x6e')](_0x288269[_0x1669('0x4c')][_0x1669('0x88')])){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0x89')+_0x18fd61);}if(!_[_0x1669('0x8a')](_0x18fd61,_0x288269['body'][_0x1669('0x88')])){throw new db[(_0x1669('0x86'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18fd61);}_0x1c34af[_0x288269[_0x1669('0x4c')][_0x1669('0x88')]]=_0x288269[_0x1669('0x4c')][_0x1669('0x85')];})[_0x1669('0x16')](function(){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x288269[_0x1669('0x49')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1669('0x7e')],'as':_0x1669('0x8b'),'where':_0x1c34af,'limit':0x1,'order':[['updatedAt',_0x1669('0x8c')]]}]},{'model':db[_0x1669('0x8d')],'as':'Applications'}]});})[_0x1669('0x16')](handleEntityNotFound(_0xe08359,null))['then'](function(_0x81f3f2){if(_0x81f3f2&&_0x81f3f2[_0x1669('0x8e')]){_0x5a24d3['account']=_0x81f3f2;_0x5a24d3[_0x1669('0x8f')]=_0x81f3f2[_0x1669('0x90')];_0x5a24d3[_0x1669('0x91')]=_0x81f3f2['List'];_0x5a24d3[_0x1669('0x8f')]=_['orderBy'](_0x5a24d3[_0x1669('0x8f')],['priority'],[_0x1669('0x92')]);if(_0x5a24d3['account'][_0x1669('0x90')]){delete _0x5a24d3[_0x1669('0x93')][_0x1669('0x90')];}if(_0x5a24d3[_0x1669('0x93')]['List']&&_0x5a24d3[_0x1669('0x93')][_0x1669('0x8e')][_0x1669('0x8b')][_0x1669('0x4a')]){return _0x5a24d3['account'][_0x1669('0x8e')][_0x1669('0x8b')][0x0];}var _0x554124=_[_0x1669('0xd')](_0x288269[_0x1669('0x4c')],{'firstName':_0x288269[_0x1669('0x4c')]['from'],'ListId':_0x81f3f2[_0x1669('0x94')]});_0x554124[_0x288269[_0x1669('0x4c')][_0x1669('0x88')]]=_0x288269[_0x1669('0x4c')][_0x1669('0x85')];return db[_0x1669('0x7e')][_0x1669('0x52')](_0x554124,{'fields':_0x285875,'raw':!![]});}})[_0x1669('0x16')](handleEntityNotFound(_0xe08359,null))[_0x1669('0x16')](function(_0x2ca56e){_0x5a24d3[_0x1669('0x95')]=_0x2ca56e;var _0x51cc77=_0x288269['body'][_0x1669('0x96')];if(_0x288269[_0x1669('0x97')][_0x1669('0x98')]){_0x51cc77=_0x288269['headers'][_0x1669('0x98')];}else if(_0x288269['headers']['x-forwarded-for']){_0x51cc77=_[_0x1669('0x99')](_0x288269['headers'][_0x1669('0x9a')][_0x1669('0x9b')](','));}if(_0x2ca56e){var _0xfc8aaa={'ContactId':_0x2ca56e['id'],'ChatWebsiteId':_0x288269[_0x1669('0x49')]['id'],'from':(_0x2ca56e[_0x1669('0x9c')]||'')+'\x20'+(_0x2ca56e['lastName']||''),'customerIp':_0x51cc77,'customerPort':_0x288269[_0x1669('0x97')][_0x1669('0x9d')]?_0x288269[_0x1669('0x97')][_0x1669('0x9d')]:null,'referer':_0x288269[_0x1669('0x4c')][_0x1669('0x9e')],'browserName':_0x2202a3[_0x1669('0x9f')][_0x1669('0x2e')]&&_0x2202a3[_0x1669('0x9f')]['version']?util[_0x1669('0xa0')]('%s\x20%s',_0x2202a3[_0x1669('0x9f')]['name'],_0x2202a3[_0x1669('0x9f')][_0x1669('0xa1')]):'unknown','browserVersion':_0x2202a3[_0x1669('0x9f')]['version']||_0x1669('0xa2'),'osName':util[_0x1669('0xa0')](_0x1669('0xa3'),_0x2202a3['os'][_0x1669('0x2e')],_0x2202a3['os']['version']),'osVersion':_0x2202a3['os'][_0x1669('0xa1')],'deviceModel':_0x2202a3[_0x1669('0xa4')][_0x1669('0x33')]&&_0x2202a3[_0x1669('0xa4')][_0x1669('0xa5')]?util[_0x1669('0xa0')](_0x1669('0xa6'),_0x2202a3['device'][_0x1669('0x33')],_0x2202a3['device'][_0x1669('0xa5')],_0x2202a3[_0x1669('0xa4')][_0x1669('0x42')]):null,'deviceVendor':_0x2202a3[_0x1669('0xa4')][_0x1669('0xa5')],'deviceType':_0x2202a3['device']['type'],'formData':JSON[_0x1669('0xa7')](_0x288269['body'])};var _0x3b7010={'ChatWebsiteId':_0x288269[_0x1669('0x49')]['id'],'closed':![]};if(_0x288269[_0x1669('0x4c')][_0x1669('0xa8')]){_0x3b7010['threadId']=_0x288269[_0x1669('0x4c')]['threadId'];return db[_0x1669('0xa9')][_0x1669('0x50')]({'where':_0x3b7010})[_0x1669('0x16')](function(_0x4e68e2){if(_0x4e68e2){return[_0x4e68e2,![]];}_0xfc8aaa[_0x1669('0xa8')]=_0x288269[_0x1669('0x4c')]['threadId'];_0xfc8aaa['externalUrl']=_0x288269[_0x1669('0x4c')][_0x1669('0xaa')];return db[_0x1669('0xa9')][_0x1669('0x52')](_0xfc8aaa)[_0x1669('0x16')](function(_0x2c2237){return[_0x2c2237,!![]];});});}_0x3b7010[_0x1669('0xab')]=_0x2ca56e['id'];if(_0x288269['body'][_0x1669('0xac')]&&_0x288269[_0x1669('0x4c')]['interaction']['id']){_0x3b7010['id']=_0x288269[_0x1669('0x4c')]['interaction']['id'];return db['ChatInteraction'][_0x1669('0x50')]({'where':_0x3b7010})[_0x1669('0x16')](function(_0x212c10){if(_0x212c10){return[_0x212c10,![]];}return db['ChatInteraction'][_0x1669('0x52')](_0xfc8aaa)[_0x1669('0x16')](function(_0x9c0df9){return[_0x9c0df9,!![]];});});}return db[_0x1669('0xa9')]['create'](_0xfc8aaa)[_0x1669('0x16')](function(_0x1981ca){return[_0x1981ca,!![]];});}})[_0x1669('0xad')](function(_0x504c18,_0x4f87d4){if(_0x504c18){_0x24eb12=_0x4f87d4;if(!_0x4f87d4){var _0x481499={'from':(_0x5a24d3[_0x1669('0x95')][_0x1669('0x9c')]||'')+'\x20'+(_0x5a24d3['contact'][_0x1669('0xae')]||'')};if(_0x288269['body'][_0x1669('0xa8')]&&_0x288269[_0x1669('0x4c')]['messageId']&&_0x288269[_0x1669('0x4c')][_0x1669('0xa8')]!=_0x288269[_0x1669('0x4c')]['messageId']){_0x481499[_0x1669('0xa8')]=_0x288269[_0x1669('0x4c')][_0x1669('0xaf')];}return _0x504c18[_0x1669('0x28')](_0x481499);}else{return _0x504c18;}}})[_0x1669('0x16')](function(_0x2ae80f){_0x5a24d3[_0x1669('0xac')]=_0x2ae80f['get']({'plain':!![]});_0x5a24d3[_0x1669('0xac')][_0x1669('0xb0')]=_0x24eb12;if(_0x5a24d3[_0x1669('0xac')][_0x1669('0xb0')]){if(_0x5a24d3[_0x1669('0x93')][_0x1669('0xb1')]){_0x5a24d3['applications'][_0x1669('0xb2')]({'id':0x0,'priority':_0x5a24d3['applications'][_0x1669('0x4a')]+0x1,'app':_0x1669('0xb3'),'appdata':_0x1669('0xb4'),'interval':_0x1669('0xb5')});}}return db[_0x1669('0xb6')]['create']({'body':_0x288269['body']['body'],'ChatWebsiteId':_0x288269['params']['id'],'ChatInteractionId':_0x2ae80f['id'],'direction':'in','ContactId':_0x5a24d3[_0x1669('0x95')]['id'],'AttachmentId':_0x288269['body'][_0x1669('0xb7')]});})['then'](function(_0x40eea8){_0x5a24d3['message']=_0x40eea8;if(_0x5a24d3[_0x1669('0xac')]['UserId']){return db[_0x1669('0xb8')]['find']({'attributes':['id',_0x1669('0x2e')],'where':{'id':_0x5a24d3[_0x1669('0xac')][_0x1669('0xb9')]}})[_0x1669('0x16')](function(_0x33a8af){if(_0x33a8af){_0x5a24d3['applications'][_0x1669('0xba')]({'id':0x0,'priority':0x0,'app':_0x1669('0xbb'),'appdata':_0x33a8af['name']+','+(_0x5a24d3[_0x1669('0x93')][_0x1669('0xbc')]||0xa),'interval':_0x1669('0xb5')});_0x5a24d3[_0x1669('0xbd')]=!![];}return respondWithRpcPromise(_0x1669('0xbe'),'startRouting',_0x5a24d3);});}return respondWithRpcPromise(_0x1669('0xbe'),_0x1669('0xbf'),_0x5a24d3);})['then'](function(_0x3798a2){respondWithRpcPromise('EventManager','EventManager',{'event':_0x1669('0x78'),'message':_0x3798a2},client9002);return _0x3798a2;})[_0x1669('0x16')](respondWithResult(_0xe08359,null))[_0x1669('0x1e')](handleError(_0xe08359,null));};exports[_0x1669('0xc0')]=function(_0x21a63c,_0x4858d9){var _0x17a18f,_0x476300,_0x214bdd;var _0x1f54aa=[];var _0x5c6898={};var _0x1cd11a=_0x21a63c['files']||[];var _0x237dbb=[];var _0x18be40;return db[_0x1669('0x7e')]['describe']()[_0x1669('0x16')](function(_0x3efed6){if(!_0x3efed6){throw new db['Sequelize'][(_0x1669('0x7f'))]('no\x20available\x20attributes');}_0x1f54aa=_['difference'](_[_0x1669('0x35')](_0x3efed6),['createdAt',_0x1669('0x83'),'CompanyId',_0x1669('0x94')]);if(_0x21a63c[_0x1669('0x4c')]['id']){delete _0x21a63c[_0x1669('0x4c')]['id'];}if(_[_0x1669('0x6e')](_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')])){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0xc2')));}if(_['isNil'](_0x21a63c['body'][_0x1669('0x4c')])||_0x21a63c[_0x1669('0x4c')][_0x1669('0x4c')]===''){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db['Sequelize'][(_0x1669('0x7f'))](_0x1669('0x87')));}if(_[_0x1669('0x6e')](_0x21a63c[_0x1669('0x4c')]['mapKeyOffline'])){throw _0x4858d9['status'](0x1f4)[_0x1669('0xc1')](new db[(_0x1669('0x86'))]['ValidationError'](_0x1669('0xc3')+_0x1f54aa));}if(!_['includes'](_0x1f54aa,_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')])){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db['Sequelize'][(_0x1669('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f54aa));}_0x5c6898[_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')]]=_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')];})[_0x1669('0x16')](function(){return db[_0x1669('0x43')]['find']({'where':{'id':_0x21a63c[_0x1669('0x49')]['id']},'include':[{'model':db[_0x1669('0xc5')],'as':'List'},{'model':db['MailAccount'],'as':_0x1669('0xc6')}]});})[_0x1669('0x16')](handleEntityNotFound(_0x4858d9,null))[_0x1669('0x16')](function(_0x47ff50){if(_0x47ff50&&_0x47ff50['List']){_0x476300=_0x47ff50;var _0xdcc339=_[_0x1669('0xd')](_0x21a63c[_0x1669('0x4c')],{'firstName':_0x21a63c['body']['from'],'phone':_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')],'ListId':_0x47ff50[_0x1669('0x94')]});_0xdcc339[_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')]]=_0x21a63c['body'][_0x1669('0x85')];return db[_0x1669('0x7e')][_0x1669('0xc7')]({'where':_0x5c6898,'defaults':_0xdcc339});}})['spread'](function(_0x38c602){if(_0x38c602){_0x214bdd=_0x38c602;var _0x164e85=fs[_0x1669('0xc8')](path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0xc9')),_0x1669('0xca'));var _0x3c8975=ejs[_0x1669('0xcb')](_0x164e85,{'body':_[_0x1669('0xcc')](_0x21a63c[_0x1669('0x4c')][_0x1669('0x4c')]),'bodyTitle':_0x476300[_0x1669('0xcd')]});return db[_0x1669('0xce')][_0x1669('0x52')]({'body':_0x3c8975,'plainBody':htmlToText[_0x1669('0xcf')](_0x3c8975),'ContactId':_0x38c602['id'],'ChatWebsiteId':_0x476300['id']});}})['then'](function(_0x3cae4f){_0x18be40=_0x3cae4f;if(_0x1cd11a['length']){var _0xe147a4=_0x1cd11a[_0x1669('0x30')](function(_0x1cf9be){return{'name':_0x1cf9be[_0x1669('0xd0')],'basename':_0x1cf9be[_0x1669('0x61')],'type':_0x1cf9be['mimetype'],'ChatOfflineMessageId':_0x3cae4f['id']};});_0x237dbb=_0xe147a4[_0x1669('0x30')](_0x1f28cc=>{var _0x29e4c8={'filename':_0x1f28cc['name'],'path':path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0xd1'),'files','attachments','offline-chat',_0x1f28cc['basename'])};return _0x29e4c8;});if(!_0x476300[_0x1669('0xd2')]){return db['sequelize']['transaction'](function(_0x318c09){return db[_0x1669('0xd3')][_0x1669('0xd4')](_0xe147a4,{'transaction':_0x318c09});});}}})[_0x1669('0x16')](function(){if(_0x18be40){_0x17a18f=_0x18be40;return db[_0x1669('0xc6')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1669('0xd5'),'raw':!![],'include':[{'model':db[_0x1669('0xd6')],'as':_0x1669('0xd6'),'raw':!![]}]}]});}})[_0x1669('0x16')](function(_0x1c87f6){if(_0x1c87f6&&_0x1c87f6[_0x1669('0xd5')]&&_0x476300[_0x1669('0xd7')]&&_0x476300[_0x1669('0xd8')]){var _0xef67c=_0x1c87f6[_0x1669('0xd9')]();return respondWithRpcPromise('SendMail',_0x1669('0xda'),{'account':_0xef67c,'message':{'from':util[_0x1669('0xa0')](_0x1669('0xdb'),_0x1c87f6[_0x1669('0x2e')],_0x1c87f6['email']||_0x1c87f6[_0x1669('0xd5')]['user']),'to':_0x476300['forwardOfflineAddress'],'subject':_0x476300[_0x1669('0xdc')],'html':_0x17a18f[_0x1669('0x4c')],'attachments':_0x237dbb}},client9003)['then'](function(){return _0x17a18f;})[_0x1669('0x1e')](function(_0x51c454){logger[_0x1669('0x1b')](_0x51c454);});}})['then'](function(){if(_0x476300&&_0x476300[_0x1669('0xd2')]&&_0x476300[_0x1669('0xdd')]){var _0x2764ee=[];if(_0x1cd11a[_0x1669('0x4a')]){_0x2764ee=_0x1cd11a[_0x1669('0x30')](function(_0x50647b){return{'name':_0x50647b[_0x1669('0xd0')],'basename':_0x50647b['filename'],'type':_0x50647b[_0x1669('0xde')],'ChatOfflineMessageId':_0x18be40['id']};});}var _0x6832f1;if(!_['isNil'](_0x476300['subjectOffline'])){var _0x4cc3b5=_[_0x1669('0x30')](_0x21a63c[_0x1669('0x4c')],function(_0x583bf0){return _0x583bf0;});var _0x3790cd=_[_0x1669('0xdf')](_0x4cc3b5)[0x0];var _0x53ec59=_[_0x1669('0xe0')](_0x3790cd,function(_0x3339c9){return _0x3339c9;});_0x6832f1=_0x53ec59[0x1][_0x476300[_0x1669('0xe1')]];}var _0x5583ca={'from':_0x214bdd[_0x1669('0xe2')],'firstName':_0x214bdd[_0x1669('0x9c')],'lastName':_0x214bdd[_0x1669('0xae')],'mapKey':_0x1669('0xe2'),'message':{'from':_0x214bdd['email'],'to':_0x476300[_0x1669('0xc6')][_0x1669('0xe2')],'cc':'','subject':_[_0x1669('0x6e')](_0x6832f1)?_0x476300['offlineMessageSubject']:_0x6832f1,'messageId':'','sentAt':new Date(),'attach':_0x2764ee[_0x1669('0x4a')],'attachments':_0x2764ee,'originChannel':'Chat','ChatWebsiteId':_0x476300['id'],'ChatOfflineMessageId':_0x17a18f['id'],'originTo':_0x476300[_0x1669('0xc6')]['email']},'body':_0x17a18f[_0x1669('0x4c')]};var _0x1983f7={'account':{'id':_0x476300[_0x1669('0xdd')]},'body':_0x5583ca,'log':_0x1669('0xe3')};return respondWithRpcPromise(_0x1669('0xe3'),_0x1669('0xe4'),_0x1983f7,client9001)[_0x1669('0x16')](function(){return _0x17a18f;})[_0x1669('0x1e')](function(_0x2d4f44){logger[_0x1669('0x1b')](_0x2d4f44);});}return;})[_0x1669('0x16')](function(){if(_0x17a18f){return _0x17a18f;}})[_0x1669('0x16')](respondWithResult(_0x4858d9,null))[_0x1669('0x1e')](function(_0x4dbfb1){logger[_0x1669('0x1b')](_0x1669('0x1e'),_0x4dbfb1);for(var _0x2d70fb of _0x1cd11a){var _0x1df1bd=path['join'](config[_0x1669('0x69')],'server',_0x1669('0xe5'),'attachments',_0x1669('0xe6'),_0x2d70fb[_0x1669('0x61')]);fs_extra['remove'](_0x1df1bd)['catch'](function(_0x5e918c){logger[_0x1669('0x1b')](_0x1669('0xe7'),_0x1df1bd,_0x5e918c);});}});};exports['addInteraction']=function(_0x1bbf61,_0x4a657d){return db[_0x1669('0xa9')][_0x1669('0x50')]({'where':{'id':_0x1bbf61[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4a657d,null))[_0x1669('0x16')](function(_0x8e39f2){if(_0x8e39f2){return _0x8e39f2[_0x1669('0xe8')](_0x1bbf61[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x1bbf61['body'],['ids','id'])||{});}})[_0x1669('0x16')](respondWithResult(_0x4a657d,null))[_0x1669('0x1e')](handleError(_0x4a657d,null));};exports[_0x1669('0xea')]=function(_0x36ac99,_0x3c9211){var _0x3e68d0={'raw':![],'where':{}};var _0x2fc665={};var _0x5679f6={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x36ac99[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x3c9211,null))[_0x1669('0x16')](function(_0x3a3660){if(_0x3a3660){_0x2fc665[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0xa9')]['rawAttributes']);_0x2fc665['query']=_['keys'](_0x36ac99['query']);_0x2fc665[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x2fc665[_0x1669('0x33')],_0x2fc665[_0x1669('0x34')]);_0x3e68d0['attributes']=_['intersection'](_0x2fc665[_0x1669('0x33')],qs[_0x1669('0x38')](_0x36ac99[_0x1669('0x34')][_0x1669('0x38')]));_0x3e68d0[_0x1669('0x37')]=_0x3e68d0[_0x1669('0x37')][_0x1669('0x4a')]?_0x3e68d0[_0x1669('0x37')]:_0x2fc665[_0x1669('0x33')];if(!_0x36ac99[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x3e68d0[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x36ac99[_0x1669('0x34')][_0x1669('0x24')]);_0x3e68d0[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x36ac99['query'][_0x1669('0x23')]);}_0x3e68d0[_0x1669('0x3b')]=qs[_0x1669('0x3c')](_0x36ac99[_0x1669('0x34')][_0x1669('0x3c')]);_0x3e68d0[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x36ac99[_0x1669('0x34')],_0x2fc665[_0x1669('0x3e')]));_0x3e68d0[_0x1669('0x3d')][_0x1669('0x55')]=_0x3a3660['id'];if(_0x36ac99[_0x1669('0x34')][_0x1669('0x40')]){_0x3e68d0['where']=_[_0x1669('0x41')](_0x3e68d0['where'],{'$or':_[_0x1669('0x30')](_0x3e68d0[_0x1669('0x37')],function(_0x3fb779){var _0x5af99f={};_0x5af99f[_0x3fb779]={'$like':'%'+_0x36ac99['query'][_0x1669('0x40')]+'%'};return _0x5af99f;})});}_0x3e68d0=_[_0x1669('0x41')]({},_0x3e68d0,_0x36ac99[_0x1669('0x4b')]);return db[_0x1669('0xa9')][_0x1669('0x22')]({'where':_0x3e68d0['where']})[_0x1669('0x16')](function(_0xe46fd5){_0x5679f6[_0x1669('0x22')]=_0xe46fd5;if(_0x36ac99['query'][_0x1669('0x44')]){_0x3e68d0[_0x1669('0x45')]=[{'model':db[_0x1669('0x7e')],'as':_0x1669('0xeb'),'required':![]},{'model':db[_0x1669('0xb8')],'as':_0x1669('0xec'),'attributes':[_0x1669('0x2e'),'fullname',_0x1669('0xed')],'required':![]},{'model':db[_0x1669('0xee')],'as':_0x1669('0xef'),'attributes':['id',_0x1669('0x2e'),_0x1669('0xf0')],'where':_0x36ac99[_0x1669('0x34')]['tag']?{'id':_0x36ac99['query']['tag']}:undefined,'required':_0x36ac99[_0x1669('0x34')][_0x1669('0xf1')]?!![]:![]}];}return db[_0x1669('0xa9')][_0x1669('0x46')](_0x3e68d0);})[_0x1669('0x16')](function(_0x172854){_0x5679f6['rows']=_0x172854;return _0x5679f6;});}})['then'](respondWithFilteredResult(_0x3c9211,_0x3e68d0))[_0x1669('0x1e')](handleError(_0x3c9211,null));};function iftimePromise(_0x2d5324,_0x5bb7d1){return respondWithRpcPromise(_0x1669('0xf2'),_0x1669('0xf3'),{'command':_0x5bb7d1[_0x1669('0xf4')]?util[_0x1669('0xa0')]('iftime\x20%s,%s',_0x2d5324[_0x1669('0xf5')],_0x5bb7d1[_0x1669('0xf4')]):util['format'](_0x1669('0xf6'),_0x2d5324[_0x1669('0xf5')])},client9002)[_0x1669('0x16')](function(_0x427722){var _0x5d5768=_0x427722&&_0x427722[_0x1669('0xf7')](_0x1669('0xf8'))>=0x0?!![]:![];logger[_0x1669('0xf9')](_0x1669('0xfa'),_0x5bb7d1['id'],_0x2d5324['id'],_0x2d5324[_0x1669('0xf5')],_0x5d5768?_0x1669('0xfb'):_0x1669('0xfc'),_0x5bb7d1['timezone']?_0x5bb7d1[_0x1669('0xf4')]:'No\x20timezone');return _0x5d5768;})[_0x1669('0x1e')](function(_0x88d776){logger[_0x1669('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5bb7d1['id'],_0x2d5324['id'],_0x2d5324[_0x1669('0xf5')],util[_0x1669('0xfd')](_0x88d776,{'showHidden':![],'depth':null}),_0x5bb7d1[_0x1669('0xf4')]?_0x5bb7d1[_0x1669('0xf4')]:_0x1669('0xfe'));return![];});}exports['getSnippet']=function(_0x22926c,_0x3ac347){var _0x4ec729=0x0;var _0x165aad=0x0;var _0x1af2e4=![];var _0x31e171;var _0x5cb4a6;return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x22926c[_0x1669('0x49')]['id']},'include':[{'model':db[_0x1669('0xff')],'as':_0x1669('0xff'),'include':[{'model':db['Interval'],'as':_0x1669('0x100'),'attributes':['id',_0x1669('0xf5')],'raw':!![]}]}]})[_0x1669('0x16')](handleEntityNotFound(_0x3ac347,null))[_0x1669('0x16')](function(_0x3f73cc){if(_0x3f73cc){_0x31e171=_0x3f73cc;return _0x3f73cc[_0x1669('0x101')]({'raw':!![]});}})[_0x1669('0x16')](function(_0x1d9e6c){if(_0x31e171){if(_0x1d9e6c){_0x5cb4a6=_0x1d9e6c;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x37475d){if(_0x37475d){_0x165aad=_0x37475d[_0x1669('0x102')];_0x1af2e4=_0x37475d[_0x1669('0x6d')];}})[_0x1669('0x16')](function(){return db[_0x1669('0xa9')][_0x1669('0x22')]({'where':{'closed':![]}});})[_0x1669('0x16')](function(_0x56ed3a){_0x4ec729=_0x56ed3a;if(_0x165aad&&_0x56ed3a>_0x165aad){return db['License'][_0x1669('0x58')]({'where':{'id':0x1}})[_0x1669('0x16')](function(_0x2a3db9){if(_0x2a3db9){_0x2a3db9[_0x1669('0x103')](_0x1669('0x104'));}});}})['then'](function(){if(_0x31e171[_0x1669('0xff')]&&_0x31e171['Interval'][_0x1669('0x100')]){var _0x83fec7=[];for(var _0x274b6a=0x0;_0x274b6a<_0x31e171[_0x1669('0xff')][_0x1669('0x100')][_0x1669('0x4a')];_0x274b6a++){var _0x272e35=_0x31e171[_0x1669('0xff')]['Intervals'][_0x274b6a][_0x1669('0x29')]({'plain':!![]});_0x83fec7[_0x1669('0xb2')](iftimePromise(_0x272e35,_0x31e171));}return BPromise[_0x1669('0x105')](_0x83fec7)[_0x1669('0x16')](function(_0x22afa0){return _['some'](_0x22afa0);});}else{return!![];}})[_0x1669('0x16')](function(_0x5f5e08){var _0x3cbb87=fs[_0x1669('0xc8')](path['join'](config[_0x1669('0x69')],_0x1669('0x106')),_0x1669('0xca'));var _0x5ca537=new url[(_0x1669('0x107'))](_0x31e171[_0x1669('0x108')])['origin'];var _0x247e03=_0x1669('0x109');var _0x39378d=![];var _0x2400a0={'chatVersion':_0x247e03,'chatWebsiteAddressOrigin':_0x5ca537,'remote':_0x31e171[_0x1669('0x10a')],'query':querystring['stringify'](_[_0x1669('0x41')](_0x31e171[_0x1669('0x29')]({'plain':!![]}),{'customerIp':_0x22926c['headers']['x-forwarded-for']||_0x22926c[_0x1669('0x97')][_0x1669('0x10b')]||_0x22926c[_0x1669('0x10c')][_0x1669('0x10d')]||_0x22926c['ip'],'referer':_0x22926c[_0x1669('0x97')]['referer'],'openedInteractions':_0x4ec729,'maxInteractions':_0x165aad,'virtual':_0x1af2e4['virtual'],'online':_0x5f5e08,'custom':_0x1af2e4}))[_0x1669('0x10e')](/'/g,'\x5c\x27')};_0x3ac347[_0x1669('0xc1')](ejs[_0x1669('0xcb')](Mustache[_0x1669('0xcb')](_0x3cbb87,_0x2400a0),{'proactiveActions':_0x5cb4a6,'alignment':_0x31e171[_0x1669('0x10f')],'verticalAlignment':_0x31e171['verticalAlignment'],'div_color':_0x31e171[_0x1669('0xf0')],'labelText':_0x31e171['labelText'],'text_color':_0x31e171[_0x1669('0x110')],'text_button_color':_0x31e171[_0x1669('0x111')],'button_color':_0x31e171['color_button'],'background_color':_0x31e171['backgroundColor'],'hideWhenOffline':_0x31e171['hideWhenOffline'],'intervalId':_0x31e171[_0x1669('0x112')],'isDevelopment':_0x39378d,'chatVersion':_0x247e03}));})[_0x1669('0x1e')](handleError(_0x3ac347,null));};exports[_0x1669('0x113')]=function(_0x1e33b0,_0x466e98){var _0x111746=_0x1e33b0[_0x1669('0x49')]['id'];var _0x2eff3a=_0x1e33b0[_0x1669('0x4c')];var _0x42bc59=0xc8;var _0x28fde8=null;return db[_0x1669('0x114')][_0x1669('0x115')]({'isolationLevel':db[_0x1669('0x114')]['Transaction'][_0x1669('0x116')][_0x1669('0x117')]},function(_0x3577bd){return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x111746},'transaction':_0x3577bd})[_0x1669('0x16')](function(_0xccac2){if(_0xccac2){return db['ChatApplication'][_0x1669('0x2c')]({'where':{'ChatWebsiteId':_0x111746},'transaction':_0x3577bd})[_0x1669('0x16')](function(){var _0x17d532=_[_0x1669('0x30')](_0x2eff3a,function(_0x1e81d2){_0x1e81d2[_0x1669('0x55')]=_0x111746;return _0x1e81d2;});return db[_0x1669('0x8d')][_0x1669('0xd4')](_0x17d532,{'transaction':_0x3577bd});});}else{_0x42bc59=0x194;_0x28fde8=[];}});})[_0x1669('0x16')](function(){if(_0x42bc59!==0x194){return db[_0x1669('0x8d')][_0x1669('0x118')]({'where':{'ChatWebsiteId':_0x111746},'order':_0x1669('0x119')})[_0x1669('0x16')](function(_0x520eba){_0x28fde8=_0x520eba;});}})[_0x1669('0x1e')](function(_0x320a7d){_0x42bc59=0x1f4;logger[_0x1669('0x1b')](_0x320a7d[_0x1669('0x11a')]);if(_0x320a7d['name']){delete _0x320a7d[_0x1669('0x2e')];}_0x28fde8=_0x320a7d;})[_0x1669('0x11b')](function(){if(_0x28fde8===null){_0x466e98[_0x1669('0x2d')](_0x42bc59);}else{if(_0x42bc59===0x1f4){_0x466e98['status'](_0x42bc59)[_0x1669('0xc1')](_0x28fde8);}else{_0x466e98[_0x1669('0x25')](_0x42bc59)[_0x1669('0x20')](_0x28fde8);}}});};exports[_0x1669('0x11c')]=function(_0xde3e5,_0x2a58cb){var _0x18c765={};var _0x3a583a={};var _0xaa7d34;var _0x7cce67;return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0xde3e5['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x2a58cb,null))['then'](function(_0x4e2aee){if(_0x4e2aee){_0xaa7d34=_0x4e2aee;_0x3a583a[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0x8d')][_0x1669('0x31')]);_0x3a583a['query']=_[_0x1669('0x35')](_0xde3e5[_0x1669('0x34')]);_0x3a583a[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x3a583a['model'],_0x3a583a[_0x1669('0x34')]);_0x18c765[_0x1669('0x37')]=_[_0x1669('0x36')](_0x3a583a['model'],qs[_0x1669('0x38')](_0xde3e5[_0x1669('0x34')]['fields']));_0x18c765[_0x1669('0x37')]=_0x18c765[_0x1669('0x37')][_0x1669('0x4a')]?_0x18c765[_0x1669('0x37')]:_0x3a583a[_0x1669('0x33')];_0x18c765['order']=qs['sort'](_0xde3e5['query'][_0x1669('0x3c')]);_0x18c765[_0x1669('0x3d')]=qs['filters'](_['pick'](_0xde3e5[_0x1669('0x34')],_0x3a583a[_0x1669('0x3e')]));if(_0xde3e5[_0x1669('0x34')]['filter']){_0x18c765[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x18c765['where'],{'$or':_[_0x1669('0x30')](_0x18c765[_0x1669('0x37')],function(_0x14ade0){var _0x47c6d3={};_0x47c6d3[_0x14ade0]={'$like':'%'+_0xde3e5[_0x1669('0x34')]['filter']+'%'};return _0x47c6d3;})});}_0x18c765=_['merge']({},_0x18c765,_0xde3e5[_0x1669('0x4b')]);return _0xaa7d34[_0x1669('0x11c')](_0x18c765);}})[_0x1669('0x16')](function(_0x1df05c){if(_0x1df05c){_0x7cce67=_0x1df05c[_0x1669('0x4a')];if(!_0xde3e5[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x18c765['limit']=qs['limit'](_0xde3e5['query'][_0x1669('0x24')]);_0x18c765[_0x1669('0x23')]=qs['offset'](_0xde3e5['query'][_0x1669('0x23')]);}return _0xaa7d34[_0x1669('0x11c')](_0x18c765);}})['then'](function(_0x2d2911){if(_0x2d2911){return _0x2d2911?{'count':_0x7cce67,'rows':_0x2d2911}:null;}})[_0x1669('0x16')](respondWithResult(_0x2a58cb,null))[_0x1669('0x1e')](handleError(_0x2a58cb,null));};exports['addProactiveActions']=function(_0x39094e,_0x3981bb){return db[_0x1669('0x11d')][_0x1669('0x50')]({'where':{'id':_0x39094e[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x3981bb,null))[_0x1669('0x16')](function(_0x2a20f7){if(_0x2a20f7){return _0x2a20f7[_0x1669('0x11e')](_0x39094e[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x39094e[_0x1669('0x4c')],['ids','id'])||{});}})[_0x1669('0x16')](respondWithResult(_0x3981bb,null))[_0x1669('0x1e')](handleError(_0x3981bb,null));};exports['getProactiveActions']=function(_0x372cef,_0xc4e95a){var _0x33a13d={};var _0x64a11b={};var _0x446a96;var _0x4d2a3c;return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x372cef[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0xc4e95a,null))[_0x1669('0x16')](function(_0x5cbf0a){if(_0x5cbf0a){_0x446a96=_0x5cbf0a;_0x64a11b[_0x1669('0x33')]=_['keys'](db[_0x1669('0x11f')][_0x1669('0x31')]);_0x64a11b[_0x1669('0x34')]=_[_0x1669('0x35')](_0x372cef[_0x1669('0x34')]);_0x64a11b[_0x1669('0x3e')]=_['intersection'](_0x64a11b[_0x1669('0x33')],_0x64a11b['query']);_0x33a13d[_0x1669('0x37')]=_[_0x1669('0x36')](_0x64a11b[_0x1669('0x33')],qs[_0x1669('0x38')](_0x372cef[_0x1669('0x34')][_0x1669('0x38')]));_0x33a13d[_0x1669('0x37')]=_0x33a13d[_0x1669('0x37')][_0x1669('0x4a')]?_0x33a13d[_0x1669('0x37')]:_0x64a11b['model'];_0x33a13d[_0x1669('0x3b')]=qs['sort'](_0x372cef['query'][_0x1669('0x3c')]);_0x33a13d['where']=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x372cef[_0x1669('0x34')],_0x64a11b['filters']));if(_0x372cef[_0x1669('0x34')][_0x1669('0x40')]){_0x33a13d[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x33a13d[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x33a13d[_0x1669('0x37')],function(_0x1d7ba5){var _0x4dfdcf={};_0x4dfdcf[_0x1d7ba5]={'$like':'%'+_0x372cef['query'][_0x1669('0x40')]+'%'};return _0x4dfdcf;})});}_0x33a13d=_[_0x1669('0x41')]({},_0x33a13d,_0x372cef[_0x1669('0x4b')]);return _0x446a96['getProactiveActions'](_0x33a13d);}})[_0x1669('0x16')](function(_0x1de237){if(_0x1de237){_0x4d2a3c=_0x1de237[_0x1669('0x4a')];if(!_0x372cef[_0x1669('0x34')]['hasOwnProperty']('nolimit')){_0x33a13d['limit']=qs[_0x1669('0x24')](_0x372cef[_0x1669('0x34')]['limit']);_0x33a13d[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x372cef['query'][_0x1669('0x23')]);}return _0x446a96[_0x1669('0x101')](_0x33a13d);}})[_0x1669('0x16')](function(_0x43d980){if(_0x43d980){return _0x43d980?{'count':_0x4d2a3c,'rows':_0x43d980}:null;}})[_0x1669('0x16')](respondWithResult(_0xc4e95a,null))[_0x1669('0x1e')](handleError(_0xc4e95a,null));};exports[_0x1669('0x120')]=function(_0x10146c,_0x4c397f){var _0x1462fa=_0x10146c[_0x1669('0x34')][_0x1669('0x121')]===_0x1669('0x122')?_0x1669('0x123'):_0x1669('0x124');return db[_0x1669('0x43')][_0x1669('0x50')]({'attributes':['id',_0x1462fa],'where':{'id':_0x10146c[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4c397f,null))['then'](function(_0x3f97e2){if(_0x3f97e2){var _0x13120d=_0x3f97e2[_0x1462fa];var _0x43e785=_0x13120d&&_0x13120d[_0x1669('0x125')]?_0x13120d[_0x1669('0x125')]:[];_0x4c397f[_0x1669('0xc1')]({'fromKey':_[_0x1669('0x6e')](_0x13120d[_0x1669('0x126')])?undefined:_0x13120d['fromKey'],'count':_0x43e785[_0x1669('0x4a')],'rows':_0x43e785});}})[_0x1669('0x1e')](handleError(_0x4c397f,null));};exports[_0x1669('0x127')]=function(_0x2c7619,_0x48a989){var _0x439c90={'raw':![],'where':{}};var _0x2aba09={};var _0x25b0ab={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x2c7619[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x48a989,null))['then'](function(_0x2e59f6){if(_0x2e59f6){_0x2aba09[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0xce')][_0x1669('0x31')]);_0x2aba09[_0x1669('0x34')]=_['keys'](_0x2c7619[_0x1669('0x34')]);_0x2aba09['filters']=_[_0x1669('0x36')](_0x2aba09[_0x1669('0x33')],_0x2aba09[_0x1669('0x34')]);_0x439c90[_0x1669('0x37')]=_[_0x1669('0x36')](_0x2aba09[_0x1669('0x33')],qs['fields'](_0x2c7619['query']['fields']));_0x439c90[_0x1669('0x37')]=_0x439c90[_0x1669('0x37')][_0x1669('0x4a')]?_0x439c90[_0x1669('0x37')]:_0x2aba09[_0x1669('0x33')];if(!_0x2c7619[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x439c90[_0x1669('0x24')]=qs['limit'](_0x2c7619['query'][_0x1669('0x24')]);_0x439c90['offset']=qs[_0x1669('0x23')](_0x2c7619[_0x1669('0x34')][_0x1669('0x23')]);}_0x439c90[_0x1669('0x3b')]=qs['sort'](_0x2c7619['query'][_0x1669('0x3c')]);_0x439c90[_0x1669('0x3d')]=qs['filters'](_['pick'](_0x2c7619['query'],_0x2aba09[_0x1669('0x3e')]));_0x439c90['where'][_0x1669('0x55')]=_0x2e59f6['id'];if(_0x2c7619[_0x1669('0x34')]['filter']){_0x439c90[_0x1669('0x3d')]=_['merge'](_0x439c90['where'],{'$or':_[_0x1669('0x30')](_0x439c90[_0x1669('0x37')],function(_0xe2aa1d){var _0x3e557c={};_0x3e557c[_0xe2aa1d]={'$like':'%'+_0x2c7619['query'][_0x1669('0x40')]+'%'};return _0x3e557c;})});}_0x439c90=_[_0x1669('0x41')]({},_0x439c90,_0x2c7619[_0x1669('0x4b')]);return db['ChatOfflineMessage'][_0x1669('0x22')]({'where':_0x439c90[_0x1669('0x3d')]})[_0x1669('0x16')](function(_0x4adb36){_0x25b0ab['count']=_0x4adb36;if(_0x2c7619[_0x1669('0x34')][_0x1669('0x44')]){_0x439c90[_0x1669('0x45')]=[{'all':!![]}];}else{_0x439c90['include']=[{'model':db['CmContact'],'as':_0x1669('0xeb'),'required':![]},{'model':db[_0x1669('0xd3')],'as':_0x1669('0x128'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x439c90);})[_0x1669('0x16')](function(_0x3e86ac){_0x25b0ab[_0x1669('0x47')]=_0x3e86ac;return _0x25b0ab;});}})[_0x1669('0x16')](respondWithFilteredResult(_0x48a989,_0x439c90))[_0x1669('0x1e')](handleError(_0x48a989,null));};exports[_0x1669('0x129')]=function(_0x4f899d,_0x5a89b2){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x4f899d['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x5a89b2,null))[_0x1669('0x16')](function(_0x895cb7){if(_0x895cb7){return _0x895cb7[_0x1669('0x129')](_0x4f899d[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x4f899d['body'],[_0x1669('0x5a'),'id'])||{})['spread'](function(_0x1a9e25){for(var _0x3e1768=0x0;_0x3e1768<_0x4f899d[_0x1669('0x4c')]['ids'][_0x1669('0x4a')];_0x3e1768+=0x1){socket['emit'](_0x1669('0x12a'),{'UserId':Number(_0x4f899d[_0x1669('0x4c')]['ids'][_0x3e1768]),'ChatWebsiteId':Number(_0x4f899d['params']['id'])});}return _0x1a9e25;});}})[_0x1669('0x16')](respondWithResult(_0x5a89b2,null))[_0x1669('0x1e')](handleError(_0x5a89b2,null));};exports[_0x1669('0x12b')]=function(_0x1d60d1,_0x498179){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x1d60d1[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x498179,null))['then'](function(_0x489c63){if(_0x489c63){return _0x489c63[_0x1669('0x12b')](_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')])[_0x1669('0x16')](function(){if(_[_0x1669('0x12c')](_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')])){for(var _0x724f92=0x0;_0x724f92<_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')][_0x1669('0x4a')];_0x724f92+=0x1){socket[_0x1669('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')][_0x724f92]),'ChatWebsiteId':Number(_0x1d60d1[_0x1669('0x49')]['id'])});}}else{socket[_0x1669('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')]),'ChatWebsiteId':Number(_0x1d60d1['params']['id'])});}});}})[_0x1669('0x16')](respondWithStatusCode(_0x498179,null))[_0x1669('0x1e')](handleError(_0x498179,null));};exports[_0x1669('0x12e')]=function(_0x2f74e9,_0x917dc4){var _0x1d5e1b={};var _0x1e089b={};var _0x5293be;var _0xc13303;return db['ChatWebsite']['findOne']({'where':{'id':_0x2f74e9['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x917dc4,null))[_0x1669('0x16')](function(_0x4abb31){if(_0x4abb31){_0x5293be=_0x4abb31;_0x1e089b['model']=_[_0x1669('0x35')](db[_0x1669('0xb8')][_0x1669('0x31')]);_0x1e089b[_0x1669('0x34')]=_['keys'](_0x2f74e9['query']);_0x1e089b[_0x1669('0x3e')]=_['intersection'](_0x1e089b[_0x1669('0x33')],_0x1e089b[_0x1669('0x34')]);_0x1d5e1b['attributes']=_[_0x1669('0x36')](_0x1e089b[_0x1669('0x33')],qs['fields'](_0x2f74e9['query'][_0x1669('0x38')]));_0x1d5e1b[_0x1669('0x37')]=_0x1d5e1b[_0x1669('0x37')][_0x1669('0x4a')]?_0x1d5e1b[_0x1669('0x37')]:_0x1e089b[_0x1669('0x33')];_0x1d5e1b[_0x1669('0x3b')]=qs['sort'](_0x2f74e9[_0x1669('0x34')]['sort']);_0x1d5e1b[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x2f74e9[_0x1669('0x34')],_0x1e089b[_0x1669('0x3e')]));if(_0x2f74e9[_0x1669('0x34')][_0x1669('0x40')]){_0x1d5e1b['where']=_[_0x1669('0x41')](_0x1d5e1b[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x1d5e1b[_0x1669('0x37')],function(_0xe931a9){var _0x43d45d={};_0x43d45d[_0xe931a9]={'$like':'%'+_0x2f74e9[_0x1669('0x34')]['filter']+'%'};return _0x43d45d;})});}_0x1d5e1b=_[_0x1669('0x41')]({},_0x1d5e1b,_0x2f74e9[_0x1669('0x4b')]);return _0x5293be[_0x1669('0x12e')](_0x1d5e1b);}})[_0x1669('0x16')](function(_0x3f1589){if(_0x3f1589){_0xc13303=_0x3f1589[_0x1669('0x4a')];if(!_0x2f74e9[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x1d5e1b[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x2f74e9[_0x1669('0x34')][_0x1669('0x24')]);_0x1d5e1b[_0x1669('0x23')]=qs['offset'](_0x2f74e9[_0x1669('0x34')][_0x1669('0x23')]);}return _0x5293be['getAgents'](_0x1d5e1b);}})[_0x1669('0x16')](function(_0x475b98){if(_0x475b98){return _0x475b98?{'count':_0xc13303,'rows':_0x475b98}:null;}})['then'](respondWithResult(_0x917dc4,null))[_0x1669('0x1e')](handleError(_0x917dc4,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 98795b6..d6d1dcb 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 _0xa9b1=['exports','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1a9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a9b('0x1')](0x0);var events={'afterCreate':_0x1a9b('0x2'),'afterUpdate':_0x1a9b('0x3'),'afterDestroy':_0x1a9b('0x4')};function emitEvent(_0x10c90c){return function(_0x52f55f,_0x57b453,_0x4914cd){ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c+':'+_0x52f55f['id'],_0x52f55f);ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c,_0x52f55f);_0x4914cd(null);};}for(var e in events){if(events[_0x1a9b('0x6')](e)){var event=events[e];ChatWebsite[_0x1a9b('0x7')](e,emitEvent(event));}}module[_0x1a9b('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa9b1=['exports','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1a9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a9b('0x1')](0x0);var events={'afterCreate':_0x1a9b('0x2'),'afterUpdate':_0x1a9b('0x3'),'afterDestroy':_0x1a9b('0x4')};function emitEvent(_0x10c90c){return function(_0x52f55f,_0x57b453,_0x4914cd){ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c+':'+_0x52f55f['id'],_0x52f55f);ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c,_0x52f55f);_0x4914cd(null);};}for(var e in events){if(events[_0x1a9b('0x6')](e)){var event=events[e];ChatWebsite[_0x1a9b('0x7')](e,emitEvent(event));}}module[_0x1a9b('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 2377bc6..843a767 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 _0x3075=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0x3075,0x1e3));var _0x5307=function(_0x32daf0,_0x4ea4c0){_0x32daf0=_0x32daf0-0x0;var _0x39361c=_0x3075[_0x32daf0];return _0x39361c;};'use strict';var _=require(_0x5307('0x0'));var util=require('util');var logger=require(_0x5307('0x1'))(_0x5307('0x2'));var moment=require(_0x5307('0x3'));var BPromise=require(_0x5307('0x4'));var rp=require(_0x5307('0x5'));var fs=require('fs');var path=require(_0x5307('0x6'));var rimraf=require('rimraf');var config=require(_0x5307('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x5307('0x8')]=function(_0x41967b,_0xfda21){return _0x41967b[_0x5307('0x9')](_0x5307('0xa'),attributes,{'tableName':_0x5307('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8704=['rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x58ce43,_0x4b7288){var _0x1351cd=function(_0x1664fd){while(--_0x1664fd){_0x58ce43['push'](_0x58ce43['shift']());}};_0x1351cd(++_0x4b7288);}(_0x8704,0x1ea));var _0x4870=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x8704[_0x15876a];return _0xbd900f;};'use strict';var _=require(_0x4870('0x0'));var util=require('util');var logger=require(_0x4870('0x1'))(_0x4870('0x2'));var moment=require(_0x4870('0x3'));var BPromise=require(_0x4870('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4870('0x5'));var config=require(_0x4870('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x4870('0x7')]=function(_0x44e866,_0x1dd9e3){return _0x44e866[_0x4870('0x8')](_0x4870('0x9'),attributes,{'tableName':_0x4870('0xa'),'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 8a4a296..cffcbe4 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 _0x421c=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request'];(function(_0xe256e9,_0x5f605d){var _0xc17b10=function(_0x2f0cab){while(--_0x2f0cab){_0xe256e9['push'](_0xe256e9['shift']());}};_0xc17b10(++_0x5f605d);}(_0x421c,0x190));var _0xc421=function(_0x4e0101,_0x41208b){_0x4e0101=_0x4e0101-0x0;var _0x5ba014=_0x421c[_0x4e0101];return _0x5ba014;};'use strict';var _=require(_0xc421('0x0'));var util=require(_0xc421('0x1'));var moment=require(_0xc421('0x2'));var BPromise=require(_0xc421('0x3'));var rs=require(_0xc421('0x4'));var fs=require('fs');var Redis=require(_0xc421('0x5'));var db=require(_0xc421('0x6'))['db'];var utils=require(_0xc421('0x7'));var logger=require(_0xc421('0x8'))(_0xc421('0x9'));var config=require(_0xc421('0xa'));var jayson=require(_0xc421('0xb'));var client=jayson[_0xc421('0xc')][_0xc421('0xd')]({'port':0x232a});config[_0xc421('0xe')]=_[_0xc421('0xf')](config[_0xc421('0xe')],{'host':_0xc421('0x10'),'port':0x18eb});var socket=require(_0xc421('0x11'))(new Redis(config[_0xc421('0xe')]));require(_0xc421('0x12'))['register'](socket);function respondWithRpcPromise(_0x59a090,_0x5c4bfa,_0x3cd89d){return new BPromise(function(_0x2df8f6,_0x120316){return client[_0xc421('0x13')](_0x59a090,_0x3cd89d)['then'](function(_0x2a0c0e){logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,_0xc421('0x16'));logger['debug'](_0xc421('0x17'),_0x5c4bfa,_0xc421('0x16'),JSON[_0xc421('0x18')](_0x2a0c0e));if(_0x2a0c0e[_0xc421('0x19')]){if(_0x2a0c0e[_0xc421('0x19')]['code']===0x1f4){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e[_0xc421('0x19')][_0xc421('0x1a')]);return _0x120316(_0x2a0c0e['error'][_0xc421('0x1a')]);}logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e['error'][_0xc421('0x1a')]);return _0x2df8f6(_0x2a0c0e[_0xc421('0x19')]['message']);}else{logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,'request\x20sent');_0x2df8f6(_0x2a0c0e[_0xc421('0x1b')]['message']);}})['catch'](function(_0x57dbca){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x57dbca);_0x120316(_0x57dbca);});});} \ No newline at end of file +var _0xf2c3=['ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0xe3cdba,_0x3b92d0){var _0x3afefa=function(_0x1d9662){while(--_0x1d9662){_0xe3cdba['push'](_0xe3cdba['shift']());}};_0x3afefa(++_0x3b92d0);}(_0xf2c3,0x6c));var _0x3f2c=function(_0x15781b,_0x4db9bb){_0x15781b=_0x15781b-0x0;var _0x20f955=_0xf2c3[_0x15781b];return _0x20f955;};'use strict';var _=require('lodash');var util=require(_0x3f2c('0x0'));var moment=require(_0x3f2c('0x1'));var BPromise=require(_0x3f2c('0x2'));var rs=require(_0x3f2c('0x3'));var fs=require('fs');var Redis=require(_0x3f2c('0x4'));var db=require(_0x3f2c('0x5'))['db'];var utils=require(_0x3f2c('0x6'));var logger=require(_0x3f2c('0x7'))(_0x3f2c('0x8'));var config=require(_0x3f2c('0x9'));var jayson=require(_0x3f2c('0xa'));var client=jayson[_0x3f2c('0xb')][_0x3f2c('0xc')]({'port':0x232a});config[_0x3f2c('0xd')]=_['defaults'](config[_0x3f2c('0xd')],{'host':_0x3f2c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f2c('0xf'))['register'](socket);function respondWithRpcPromise(_0x5088f1,_0x14c818,_0x1874b2){return new BPromise(function(_0x50ff46,_0x1e433a){return client[_0x3f2c('0x10')](_0x5088f1,_0x1874b2)['then'](function(_0x23ef11){logger[_0x3f2c('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x14c818,'request\x20sent');logger['debug'](_0x3f2c('0x12'),_0x14c818,_0x3f2c('0x13'),JSON['stringify'](_0x23ef11));if(_0x23ef11[_0x3f2c('0x14')]){if(_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x15')]===0x1f4){logger[_0x3f2c('0x14')](_0x3f2c('0x16'),_0x14c818,_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x17')]);return _0x1e433a(_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x17')]);}logger[_0x3f2c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x14c818,_0x23ef11['error'][_0x3f2c('0x17')]);return _0x50ff46(_0x23ef11['error']['message']);}else{logger[_0x3f2c('0x11')](_0x3f2c('0x16'),_0x14c818,'request\x20sent');_0x50ff46(_0x23ef11[_0x3f2c('0x18')]['message']);}})[_0x3f2c('0x19')](function(_0x3ab112){logger[_0x3f2c('0x14')](_0x3f2c('0x16'),_0x14c818,_0x3ab112);_0x1e433a(_0x3ab112);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 12b200d..49209bc 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 _0xe48f=['save','remove','register','length','chatWebsite:'];(function(_0xb2b806,_0x2f8113){var _0x569b6d=function(_0x5596be){while(--_0x5596be){_0xb2b806['push'](_0xb2b806['shift']());}};_0x569b6d(++_0x2f8113);}(_0xe48f,0x1e5));var _0xfe48=function(_0x5cc655,_0x4b6145){_0x5cc655=_0x5cc655-0x0;var _0x244379=_0xe48f[_0x5cc655];return _0x244379;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xfe48('0x0'),_0xfe48('0x1'),'update'];function createListener(_0x4c13ca,_0xaecdbb){return function(_0x49aa2c){_0xaecdbb['emit'](_0x4c13ca,_0x49aa2c);};}function removeListener(_0x209df9,_0x472ba1){return function(){ChatWebsiteEvents['removeListener'](_0x209df9,_0x472ba1);};}exports[_0xfe48('0x2')]=function(_0x4b7610){for(var _0x2faacb=0x0,_0x353965=events[_0xfe48('0x3')];_0x2faacb<_0x353965;_0x2faacb++){var _0x4e5dbd=events[_0x2faacb];var _0x5e011e=createListener(_0xfe48('0x4')+_0x4e5dbd,_0x4b7610);ChatWebsiteEvents['on'](_0x4e5dbd,_0x5e011e);}}; \ No newline at end of file +var _0xa7e8=['save','remove','update','emit','removeListener','length','./chatWebsite.events'];(function(_0x44591b,_0x148970){var _0xbb9e05=function(_0x1d37eb){while(--_0x1d37eb){_0x44591b['push'](_0x44591b['shift']());}};_0xbb9e05(++_0x148970);}(_0xa7e8,0xb5));var _0x8a7e=function(_0x2259d8,_0x47c9a1){_0x2259d8=_0x2259d8-0x0;var _0x291060=_0xa7e8[_0x2259d8];return _0x291060;};'use strict';var ChatWebsiteEvents=require(_0x8a7e('0x0'));var events=[_0x8a7e('0x1'),_0x8a7e('0x2'),_0x8a7e('0x3')];function createListener(_0x439c55,_0x445f83){return function(_0x39e35a){_0x445f83[_0x8a7e('0x4')](_0x439c55,_0x39e35a);};}function removeListener(_0x23ecc4,_0x26f80d){return function(){ChatWebsiteEvents[_0x8a7e('0x5')](_0x23ecc4,_0x26f80d);};}exports['register']=function(_0x44872a){for(var _0x36e5be=0x0,_0x1860e6=events[_0x8a7e('0x6')];_0x36e5be<_0x1860e6;_0x36e5be++){var _0x1f7a52=events[_0x36e5be];var _0x4a5199=createListener('chatWebsite:'+_0x1f7a52,_0x44872a);ChatWebsiteEvents['on'](_0x1f7a52,_0x4a5199);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 21550b2..72c4455 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 _0x0bfb=['/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x49c24f,_0x39766f){var _0x5a3327=function(_0x29662d){while(--_0x29662d){_0x49c24f['push'](_0x49c24f['shift']());}};_0x5a3327(++_0x39766f);}(_0x0bfb,0x87));var _0xb0bf=function(_0x160efe,_0x109650){_0x160efe=_0x160efe-0x0;var _0x25592f=_0x0bfb[_0x160efe];return _0x25592f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0bf('0x0'));var express=require(_0xb0bf('0x1'));var router=express[_0xb0bf('0x2')]();var fs_extra=require(_0xb0bf('0x3'));var auth=require(_0xb0bf('0x4'));var interaction=require(_0xb0bf('0x5'));var config=require('../../config/environment');var controller=require(_0xb0bf('0x6'));router[_0xb0bf('0x7')]('/',auth[_0xb0bf('0x8')](),controller['index']);router[_0xb0bf('0x7')](_0xb0bf('0x9'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xa')]);router[_0xb0bf('0x7')](_0xb0bf('0xb'),auth['isAuthenticated'](),controller[_0xb0bf('0xc')]);router[_0xb0bf('0x7')](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xe')]);router['get'](_0xb0bf('0xf'),auth['isAuthenticated'](),controller[_0xb0bf('0x10')]);router[_0xb0bf('0x7')](_0xb0bf('0x11'),controller[_0xb0bf('0x12')]);router[_0xb0bf('0x7')](_0xb0bf('0x13'),controller[_0xb0bf('0x14')]);router[_0xb0bf('0x7')]('/:id/customer_avatar',controller[_0xb0bf('0x15')]);router[_0xb0bf('0x7')]('/:id/system_avatar',controller[_0xb0bf('0x16')]);router[_0xb0bf('0x7')](_0xb0bf('0x17'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x18')]);router['get'](_0xb0bf('0x19'),controller['getSnippet']);router[_0xb0bf('0x7')](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1b')]);router['get'](_0xb0bf('0x1c'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1d')]);router['get'](_0xb0bf('0x1e'),controller[_0xb0bf('0x1f')]);router['get'](_0xb0bf('0x20'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x21')]);router[_0xb0bf('0x7')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x23')]);router[_0xb0bf('0x24')]('/',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x25')]);router['post'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x26')]);router[_0xb0bf('0x24')](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x27')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x10daca,_0x1d250e,_0x4fc431){_0x4fc431(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x2b')));},'filename':function(_0x200de6,_0x5eefbf,_0x75390b){_0x75390b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date['now'](),_0x5eefbf[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x11'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x31')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x4d9e32,_0x5a526b,_0x368936){_0x368936(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x598110,_0x19fcc2,_0x35e542){_0x35e542(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x19fcc2[_0xb0bf('0x2e')]));}})});router['post']('/:id/avatar',upload['single'](_0xb0bf('0x30')),controller[_0xb0bf('0x34')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x5e2a4c,_0x376bdb,_0x5f2691){_0x5f2691(null,path[_0xb0bf('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x4f01de,_0x43fe49,_0x1dde0b){_0x1dde0b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x43fe49['originalname']));}})});router['post'](_0xb0bf('0x35'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x36')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x497433,_0x398586,_0xe0f4e4){_0xe0f4e4(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x4b62a0,_0x559969,_0x629bd7){_0x629bd7(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x559969[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x37'),upload[_0xb0bf('0x2f')]('file'),controller[_0xb0bf('0x38')]);router[_0xb0bf('0x24')](_0xb0bf('0x39'),controller[_0xb0bf('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x983c1b,_0x6afb3b,_0xebfb8f){const _0x2bfa67=path['join'](config['root'],_0xb0bf('0x3b'),_0xb0bf('0x3c'),_0xb0bf('0x3d'));fs_extra['ensureDir'](_0x2bfa67,function(){_0xebfb8f(null,_0x2bfa67);});},'filename':function(_0x5e7377,_0x5b11ad,_0x4f771b){const _0x11dda6=_0x5b11ad[_0xb0bf('0x2e')][_0xb0bf('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xa5d1a5=path[_0xb0bf('0x3f')](_0x11dda6);const _0x35b942=Date['now']()+'-'+_0x11dda6['replace'](_0xa5d1a5,'')+_0xa5d1a5;_0x4f771b(null,_0x35b942);}})});router['post'](_0xb0bf('0x40'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0xb0bf('0x17'),auth['isAuthenticated'](),controller[_0xb0bf('0x41')]);router['post'](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x42')]);router['post'](_0xb0bf('0x1c'),auth['isAuthenticated'](),controller[_0xb0bf('0x43')]);router[_0xb0bf('0x24')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x44')]);router[_0xb0bf('0x45')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x46')]);router[_0xb0bf('0x47')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x48')]);router['delete'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x49')]);router['delete'](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4a')]);router[_0xb0bf('0x47')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4b')]);module['exports']=router; \ No newline at end of file +var _0x2b19=['root','%s-%s','now','file','addLogo','join','server/files/images/avatars/','originalname','/:id/avatar','single','addAvatar','format','/:id/system_avatar','addSystemAvatar','notify','server/files','attachments','offline-chat','replace','/:id/offline','offline','addInteraction','addApplications','addAgents','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage'];(function(_0x29bd19,_0x43928d){var _0x9551bf=function(_0x2c14a7){while(--_0x2c14a7){_0x29bd19['push'](_0x29bd19['shift']());}};_0x9551bf(++_0x43928d);}(_0x2b19,0x132));var _0x92b1=function(_0x145075,_0x202545){_0x145075=_0x145075-0x0;var _0x34bbd0=_0x2b19[_0x145075];return _0x34bbd0;};'use strict';var multer=require(_0x92b1('0x0'));var util=require(_0x92b1('0x1'));var path=require(_0x92b1('0x2'));var timeout=require(_0x92b1('0x3'));var express=require('express');var router=express[_0x92b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x92b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x92b1('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x92b1('0x7')](),controller['index']);router[_0x92b1('0x8')](_0x92b1('0x9'),auth['isAuthenticated'](),controller[_0x92b1('0xa')]);router[_0x92b1('0x8')](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller[_0x92b1('0xc')]);router['get'](_0x92b1('0xd'),auth[_0x92b1('0x7')](),controller[_0x92b1('0xe')]);router[_0x92b1('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x92b1('0xf')]);router[_0x92b1('0x8')](_0x92b1('0x10'),controller[_0x92b1('0x11')]);router[_0x92b1('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x92b1('0x8')](_0x92b1('0x12'),controller[_0x92b1('0x13')]);router[_0x92b1('0x8')]('/:id/system_avatar',controller[_0x92b1('0x14')]);router[_0x92b1('0x8')](_0x92b1('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x92b1('0x16'),controller[_0x92b1('0x17')]);router[_0x92b1('0x8')](_0x92b1('0x18'),auth[_0x92b1('0x7')](),controller['getApplications']);router[_0x92b1('0x8')](_0x92b1('0x19'),auth['isAuthenticated'](),controller[_0x92b1('0x1a')]);router[_0x92b1('0x8')](_0x92b1('0x1b'),controller[_0x92b1('0x1c')]);router['get'](_0x92b1('0x1d'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x1e')]);router['get'](_0x92b1('0x1f'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x20')]);router[_0x92b1('0x21')]('/',auth[_0x92b1('0x7')](),controller[_0x92b1('0x22')]);router[_0x92b1('0x21')](_0x92b1('0xd'),auth['isAuthenticated'](),controller[_0x92b1('0x23')]);router[_0x92b1('0x21')](_0x92b1('0x24'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x25')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x1cc6e5,_0x1ee6f0,_0xa4dc80){_0xa4dc80(null,path['join'](config[_0x92b1('0x27')],'server/files/images/logos/'));},'filename':function(_0x300666,_0x5a5204,_0x548e8d){_0x548e8d(null,util['format'](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x5a5204['originalname']));}})});router[_0x92b1('0x21')](_0x92b1('0x10'),upload['single'](_0x92b1('0x2a')),controller[_0x92b1('0x2b')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x1f9a0d,_0x18406b,_0xe871ac){_0xe871ac(null,path[_0x92b1('0x2c')](config['root'],_0x92b1('0x2d')));},'filename':function(_0x5247a9,_0x22a01e,_0x94c551){_0x94c551(null,util['format'](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x22a01e[_0x92b1('0x2e')]));}})});router[_0x92b1('0x21')](_0x92b1('0x2f'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller[_0x92b1('0x31')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x4ba860,_0x6c50bb,_0x235694){_0x235694(null,path['join'](config['root'],_0x92b1('0x2d')));},'filename':function(_0x43207a,_0xf37e9,_0x223f26){_0x223f26(null,util[_0x92b1('0x32')](_0x92b1('0x28'),Date['now'](),_0xf37e9[_0x92b1('0x2e')]));}})});router[_0x92b1('0x21')](_0x92b1('0x12'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x196837,_0x15e2d0,_0x33507b){_0x33507b(null,path[_0x92b1('0x2c')](config[_0x92b1('0x27')],_0x92b1('0x2d')));},'filename':function(_0x289ef1,_0x215e4f,_0x41a22e){_0x41a22e(null,util[_0x92b1('0x32')](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x215e4f['originalname']));}})});router[_0x92b1('0x21')](_0x92b1('0x33'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller[_0x92b1('0x34')]);router[_0x92b1('0x21')]('/:id/notify',controller[_0x92b1('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2c34c3,_0x530e98,_0x5418f1){const _0x5d4619=path[_0x92b1('0x2c')](config['root'],_0x92b1('0x36'),_0x92b1('0x37'),_0x92b1('0x38'));fs_extra['ensureDir'](_0x5d4619,function(){_0x5418f1(null,_0x5d4619);});},'filename':function(_0x2298f8,_0xbdd047,_0x282509){const _0x37fb5d=_0xbdd047[_0x92b1('0x2e')][_0x92b1('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5c3523=path['extname'](_0x37fb5d);const _0x9975d5=Date['now']()+'-'+_0x37fb5d[_0x92b1('0x39')](_0x5c3523,'')+_0x5c3523;_0x282509(null,_0x9975d5);}})});router[_0x92b1('0x21')](_0x92b1('0x3a'),offlineUploadMulter['any'](),controller[_0x92b1('0x3b')]);router[_0x92b1('0x21')]('/:id/interactions',auth[_0x92b1('0x7')](),controller[_0x92b1('0x3c')]);router[_0x92b1('0x21')](_0x92b1('0x18'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x3d')]);router['post'](_0x92b1('0x19'),auth[_0x92b1('0x7')](),controller['addProactiveActions']);router[_0x92b1('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0x92b1('0x3e')]);router['put'](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller['update']);router[_0x92b1('0x3f')](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x40')]);router[_0x92b1('0x3f')](_0x92b1('0xd'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x41')]);router[_0x92b1('0x3f')](_0x92b1('0x24'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x42')]);router[_0x92b1('0x3f')](_0x92b1('0x1f'),auth['isAuthenticated'](),controller[_0x92b1('0x43')]);module[_0x92b1('0x44')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index c05a4e4..39c8489 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38f8=['use','isAuthenticated','express','../components/auth/service','../config/environment','Router','production','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x101cad,_0x4e873c){var _0x25d010=function(_0x18a2ed){while(--_0x18a2ed){_0x101cad['push'](_0x101cad['shift']());}};_0x25d010(++_0x4e873c);}(_0x38f8,0x141));var _0x838f=function(_0x311e9b,_0x2937f4){_0x311e9b=_0x311e9b-0x0;var _0x26284c=_0x38f8[_0x311e9b];return _0x26284c;};var beaverLogger=require('beaver-logger/server');var express=require(_0x838f('0x0'));var auth=require(_0x838f('0x1'));var config=require(_0x838f('0x2'));var router=express[_0x838f('0x3')]();var isProduction=config['env']===_0x838f('0x4')||![];function clientSideLogs(_0x4f5a79,_0x35c5dd,_0x348d0d){var _0x2adfab=_0x4f5a79['app']['get'](_0x838f('0x5'));if(!_0x2adfab){throw new Error(_0x838f('0x6'));}return beaverLogger[_0x838f('0x7')]({'uri':_0x838f('0x8'),'logger':_0x2adfab,'enableCors':!isProduction})(_0x4f5a79,_0x35c5dd,_0x348d0d);}router[_0x838f('0x9')](auth[_0x838f('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x010d=['isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x3c61c5,_0x425714){var _0x36ee96=function(_0x549335){while(--_0x549335){_0x3c61c5['push'](_0x3c61c5['shift']());}};_0x36ee96(++_0x425714);}(_0x010d,0x1ef));var _0xd010=function(_0x3a924a,_0x5b8ed3){_0x3a924a=_0x3a924a-0x0;var _0x144b03=_0x010d[_0x3a924a];return _0x144b03;};var beaverLogger=require(_0xd010('0x0'));var express=require(_0xd010('0x1'));var auth=require(_0xd010('0x2'));var config=require(_0xd010('0x3'));var router=express[_0xd010('0x4')]();var isProduction=config[_0xd010('0x5')]==='production'||![];function clientSideLogs(_0x50f5a4,_0x4e7a33,_0x465082){var _0x51afb7=_0x50f5a4[_0xd010('0x6')][_0xd010('0x7')](_0xd010('0x8'));if(!_0x51afb7){throw new Error(_0xd010('0x9'));}return beaverLogger[_0xd010('0xa')]({'uri':_0xd010('0xb'),'logger':_0x51afb7,'enableCors':!isProduction})(_0x50f5a4,_0x4e7a33,_0x465082);}router['use'](auth[_0xd010('0xc')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index e3929e7..f34f841 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 _0x7836=['sequelize','exports','ENUM','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x3b4027,_0x375f0c){var _0x17080b=function(_0x12cbbd){while(--_0x12cbbd){_0x3b4027['push'](_0x3b4027['shift']());}};_0x17080b(++_0x375f0c);}(_0x7836,0x138));var _0x6783=function(_0x1d70e6,_0x31f6eb){_0x1d70e6=_0x1d70e6-0x0;var _0x2d61cb=_0x7836[_0x1d70e6];return _0x2d61cb;};'use strict';var Sequelize=require(_0x6783('0x0'));module[_0x6783('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6783('0x2')]('AmazonAWS','Google',_0x6783('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6783('0x2')](_0x6783('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x6')},'data3':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x7')},'data5':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0x9')},'data6':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xa')},'data7':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xb')}}; \ No newline at end of file +var _0x7f2b=['Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f2b,0x1f4));var _0xb7f2=function(_0x4ad683,_0x5d2b9b){_0x4ad683=_0x4ad683-0x0;var _0x297ec9=_0x7f2b[_0x4ad683];return _0x297ec9;};'use strict';var Sequelize=require(_0xb7f2('0x0'));module[_0xb7f2('0x1')]={'name':{'type':Sequelize[_0xb7f2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb7f2('0x3')](_0xb7f2('0x4'),_0xb7f2('0x5'),_0xb7f2('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb7f2('0x3')](_0xb7f2('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xb7f2('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xb7f2('0x9')},'data4':{'type':Sequelize[_0xb7f2('0x2')],'comment':_0xb7f2('0xa')},'data5':{'type':Sequelize[_0xb7f2('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xb7f2('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xb7f2('0xb')],'comment':_0xb7f2('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a731719..5097bc9 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 _0xe13a=['hasOwnProperty','nolimit','offset','sort','filters','filter','merge','where','options','CloudProvider','includeAll','findAll','MicrosoftAzure','decryptString','data3','catch','show','include','find','service','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','padEnd','slice','index','fieldName','type','map','query','intersection','model','attributes','fields','length'];(function(_0x4637c9,_0x51126e){var _0x434a20=function(_0x325f90){while(--_0x325f90){_0x4637c9['push'](_0x4637c9['shift']());}};_0x434a20(++_0x51126e);}(_0xe13a,0xe9));var _0xae13=function(_0x2a5763,_0x76820e){_0x2a5763=_0x2a5763-0x0;var _0x114144=_0xe13a[_0x2a5763];return _0x114144;};'use strict';var _=require(_0xae13('0x0'));var Redis=require(_0xae13('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xae13('0x2'));var config=require(_0xae13('0x3'));var logger=require(_0xae13('0x4'))(_0xae13('0x5'));var db=require(_0xae13('0x6'))['db'];var oauth=require(_0xae13('0x7'));config[_0xae13('0x8')]=_['defaults'](config[_0xae13('0x8')],{'host':_0xae13('0x9'),'port':0x18eb});var socket=require(_0xae13('0xa'))(new Redis(config[_0xae13('0x8')]));var redis=new Redis(config[_0xae13('0x8')]);function respondWithStatusCode(_0x10a913,_0x13ae1e){_0x13ae1e=_0x13ae1e||0xcc;return function(_0x18f7b7){if(_0x18f7b7){return _0x10a913[_0xae13('0xb')](_0x13ae1e);}return _0x10a913[_0xae13('0xc')](_0x13ae1e)[_0xae13('0xd')]();};}function respondWithResult(_0x107895,_0x37f7e1){_0x37f7e1=_0x37f7e1||0xc8;return function(_0x156b99){if(_0x156b99){return _0x107895[_0xae13('0xc')](_0x37f7e1)['json'](_0x156b99);}};}function respondWithFilteredResult(_0x5af625,_0x3506f5){return function(_0x166f8c){if(_0x166f8c){var _0x7cd23e=typeof _0x3506f5['offset']===_0xae13('0xe')&&typeof _0x3506f5[_0xae13('0xf')]===_0xae13('0xe');var _0x5d1bbd=_0x166f8c[_0xae13('0x10')];var _0x56e461=_0x7cd23e?0x0:_0x3506f5['offset'];var _0x37b51c=_0x7cd23e?_0x166f8c[_0xae13('0x10')]:_0x3506f5['offset']+_0x3506f5['limit'];var _0x18bf31;if(_0x37b51c>=_0x5d1bbd){_0x37b51c=_0x5d1bbd;_0x18bf31=0xc8;}else{_0x18bf31=0xce;}_0x5af625[_0xae13('0xc')](_0x18bf31);return _0x5af625[_0xae13('0x11')](_0xae13('0x12'),_0x56e461+'-'+_0x37b51c+'/'+_0x5d1bbd)[_0xae13('0x13')](_0x166f8c);}return null;};}function saveUpdates(_0x365dbb){return function(_0x565173){if(_0x565173){return _0x565173[_0xae13('0x14')](_0x365dbb)[_0xae13('0x15')](function(_0x401037){return _0x401037;});}return null;};}function removeEntity(_0x324f49){return function(_0x37a11a){if(_0x37a11a){return _0x37a11a[_0xae13('0x16')]()[_0xae13('0x15')](function(){_0x324f49[_0xae13('0xc')](0xcc)[_0xae13('0xd')]();});}};}function handleEntityNotFound(_0x23cbc7){return function(_0x25324a){if(!_0x25324a){_0x23cbc7[_0xae13('0xb')](0x194);}return _0x25324a;};}function handleError(_0x25e8df,_0x4531c8){_0x4531c8=_0x4531c8||0x1f4;return function(_0x1f2d45){logger['error'](_0x1f2d45[_0xae13('0x17')]);if(_0x1f2d45[_0xae13('0x18')]){delete _0x1f2d45['name'];}_0x25e8df[_0xae13('0xc')](_0x4531c8)['send'](_0x1f2d45);};}function maskClientSecret(_0x4b83b9){return _[_0xae13('0x19')](_0x4b83b9[_0xae13('0x1a')](0x0,0x3),0x14,'*');}exports[_0xae13('0x1b')]=function(_0x463a9f,_0x56b368){var _0x5e9092={},_0x1068b6={},_0x15a331={'count':0x0,'rows':[]};var _0x313aa6=_['map'](db['CloudProvider']['rawAttributes'],function(_0x2111d5){return{'name':_0x2111d5[_0xae13('0x1c')],'type':_0x2111d5[_0xae13('0x1d')]['key']};});_0x1068b6['model']=_[_0xae13('0x1e')](_0x313aa6,_0xae13('0x18'));_0x1068b6['query']=_['keys'](_0x463a9f[_0xae13('0x1f')]);_0x1068b6['filters']=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],_0x1068b6[_0xae13('0x1f')]);_0x5e9092[_0xae13('0x22')]=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],qs[_0xae13('0x23')](_0x463a9f[_0xae13('0x1f')][_0xae13('0x23')]));_0x5e9092[_0xae13('0x22')]=_0x5e9092['attributes'][_0xae13('0x24')]?_0x5e9092[_0xae13('0x22')]:_0x1068b6[_0xae13('0x21')];if(!_0x463a9f[_0xae13('0x1f')][_0xae13('0x25')](_0xae13('0x26'))){_0x5e9092['limit']=qs[_0xae13('0xf')](_0x463a9f[_0xae13('0x1f')]['limit']);_0x5e9092[_0xae13('0x27')]=qs['offset'](_0x463a9f[_0xae13('0x1f')]['offset']);}_0x5e9092['order']=qs['sort'](_0x463a9f[_0xae13('0x1f')][_0xae13('0x28')]);_0x5e9092['where']=qs[_0xae13('0x29')](_['pick'](_0x463a9f['query'],_0x1068b6['filters']),_0x313aa6);if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]){_0x5e9092['where']=_[_0xae13('0x2b')](_0x5e9092[_0xae13('0x2c')],{'$or':_['map'](_0x313aa6,function(_0x37de1f){if(_0x37de1f['type']!=='VIRTUAL'){var _0x254bd7={};_0x254bd7[_0x37de1f[_0xae13('0x18')]]={'$like':'%'+_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]+'%'};return _0x254bd7;}})});}_0x5e9092=_['merge']({},_0x5e9092,_0x463a9f[_0xae13('0x2d')]);var _0x168315={'where':_0x5e9092['where']};return db[_0xae13('0x2e')]['count'](_0x168315)[_0xae13('0x15')](function(_0x942c32){_0x15a331[_0xae13('0x10')]=_0x942c32;if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2f')]){_0x5e9092['include']=[{'all':!![]}];}return db[_0xae13('0x2e')][_0xae13('0x30')](_0x5e9092);})[_0xae13('0x15')](function(_0x22ae48){_0x15a331['rows']=_[_0xae13('0x1e')](_0x22ae48,function(_0x5b7e91){if(_0x5b7e91['service']===_0xae13('0x31')){var _0x5c9796=encryptor[_0xae13('0x32')](_0x5b7e91[_0xae13('0x33')]);_0x5b7e91['data3']=maskClientSecret(_0x5c9796);}return _0x5b7e91;});return _0x15a331;})[_0xae13('0x15')](respondWithFilteredResult(_0x56b368,_0x5e9092))[_0xae13('0x34')](handleError(_0x56b368,null));};exports[_0xae13('0x35')]=function(_0x5c1dcc,_0x56076e){var _0x305eef={'raw':!![],'where':{'id':_0x5c1dcc['params']['id']}},_0x56ebd5={};_0x56ebd5[_0xae13('0x21')]=_['keys'](db[_0xae13('0x2e')]['rawAttributes']);_0x56ebd5[_0xae13('0x1f')]=_['keys'](_0x5c1dcc['query']);_0x56ebd5[_0xae13('0x29')]=_['intersection'](_0x56ebd5[_0xae13('0x21')],_0x56ebd5[_0xae13('0x1f')]);_0x305eef[_0xae13('0x22')]=_[_0xae13('0x20')](_0x56ebd5[_0xae13('0x21')],qs[_0xae13('0x23')](_0x5c1dcc[_0xae13('0x1f')][_0xae13('0x23')]));_0x305eef[_0xae13('0x22')]=_0x305eef[_0xae13('0x22')]['length']?_0x305eef[_0xae13('0x22')]:_0x56ebd5[_0xae13('0x21')];if(_0x5c1dcc['query']['includeAll']){_0x305eef[_0xae13('0x36')]=[{'all':!![]}];}_0x305eef=_[_0xae13('0x2b')]({},_0x305eef,_0x5c1dcc[_0xae13('0x2d')]);return db[_0xae13('0x2e')][_0xae13('0x37')](_0x305eef)[_0xae13('0x15')](handleEntityNotFound(_0x56076e,null))[_0xae13('0x15')](function(_0x57c512){if(_0x57c512[_0xae13('0x38')]===_0xae13('0x31')){var _0x126bd8=encryptor[_0xae13('0x32')](_0x57c512[_0xae13('0x33')]);_0x57c512[_0xae13('0x33')]=maskClientSecret(_0x126bd8);}return _0x57c512;})[_0xae13('0x15')](respondWithResult(_0x56076e,null))[_0xae13('0x34')](handleError(_0x56076e,null));};exports['create']=function(_0x37338f,_0x2076f8){if(!_0x37338f[_0xae13('0x39')][_0xae13('0x18')])throw new Error(_0xae13('0x3a'));if(!_0x37338f[_0xae13('0x39')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x419c53=db['CloudProvider'][_0xae13('0x3b')][_0xae13('0x38')][_0xae13('0x3c')];if(!_0x419c53['includes'](_0x37338f[_0xae13('0x39')][_0xae13('0x38')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x419c53[_0xae13('0x3d')](',\x20'));if(_0x37338f[_0xae13('0x39')]['service']===_0xae13('0x31')&&_0x37338f['body']['data3']){_0x37338f['body'][_0xae13('0x33')]=encryptor[_0xae13('0x3e')](_0x37338f[_0xae13('0x39')]['data3']);}return db[_0xae13('0x2e')]['create'](_0x37338f[_0xae13('0x39')],{})[_0xae13('0x15')](respondWithResult(_0x2076f8,0xc9))[_0xae13('0x34')](handleError(_0x2076f8,null));};exports[_0xae13('0x14')]=function(_0x23242a,_0x2827e5){if(_0x23242a[_0xae13('0x39')]['id']){delete _0x23242a[_0xae13('0x39')]['id'];}return db['CloudProvider'][_0xae13('0x37')]({'where':{'id':_0x23242a['params']['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x2827e5,null))[_0xae13('0x15')](function(_0x3804d4){if(_0x3804d4['service']===_0xae13('0x31')&&_0x23242a[_0xae13('0x39')][_0xae13('0x33')]){_0x23242a[_0xae13('0x39')]['data3']=encryptor[_0xae13('0x3e')](_0x23242a['body'][_0xae13('0x33')]);}return _0x3804d4;})['then'](saveUpdates(_0x23242a[_0xae13('0x39')],null))[_0xae13('0x15')](respondWithResult(_0x2827e5,null))['catch'](handleError(_0x2827e5,null));};exports[_0xae13('0x16')]=function(_0x1aa1c4,_0x1742db){return db[_0xae13('0x2e')][_0xae13('0x37')]({'where':{'id':_0x1aa1c4[_0xae13('0x3f')]['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x1742db,null))[_0xae13('0x15')](removeEntity(_0x1742db,null))[_0xae13('0x34')](handleError(_0x1742db,null));};exports[_0xae13('0x40')]=function(_0x180558,_0x1842a5){return db[_0xae13('0x2e')][_0xae13('0x41')]({'where':{'id':_0x180558[_0xae13('0x3f')]['id']},'raw':!![]})[_0xae13('0x15')](function(_0xd847d7){if(!_0xd847d7)return _0x1842a5['sendStatus'](0x194);return{'url':oauth[_0xae13('0x42')](_0xd847d7,_0x180558[_0xae13('0x43')]['id'])};})[_0xae13('0x15')](respondWithResult(_0x1842a5,null))['catch'](handleError(_0x1842a5,null));};exports['oauth2MicrosoftCallback']=function(_0x37c6ad,_0x220ee9){var _0x2b6634=_0x37c6ad[_0xae13('0x39')];var _0x5b04fb;var _0x61b922;if(_0x2b6634[_0xae13('0x44')])throw _0x2b6634;redis['get'](_0x2b6634[_0xae13('0x45')])[_0xae13('0x15')](function(_0x4c2614){if(!_0x4c2614)throw new Error('Invalid\x20state\x20parameter');_0x5b04fb=JSON[_0xae13('0x46')](_0x4c2614);var _0x10903c=Buffer[_0xae13('0x47')](_0x2b6634[_0xae13('0x45')],_0xae13('0x48'))[_0xae13('0x49')](_0xae13('0x4a'));_0x61b922=JSON[_0xae13('0x46')](_0x10903c);if(!oauth[_0xae13('0x4b')](_0x2b6634[_0xae13('0x4c')],_0x5b04fb[_0xae13('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xae13('0x4e')](_0x2b6634['state']);return oauth[_0xae13('0x4f')](_0x2b6634[_0xae13('0x50')],_0x5b04fb);})[_0xae13('0x15')](function(_0x3e7771){_0x5b04fb[_0xae13('0x51')]=_0x3e7771[_0xae13('0x52')];_0x5b04fb['data6']=_0x3e7771[_0xae13('0x53')];return db['CloudProvider'][_0xae13('0x14')]({'data5':_0x5b04fb[_0xae13('0x51')],'data6':_0x5b04fb['data6']},{'where':{'id':_0x5b04fb['id']}});})[_0xae13('0x15')](function(){oauth[_0xae13('0x54')](_0x5b04fb);socket['emit'](_0xae13('0x55'),{'id':_0x61b922['id']});return;})[_0xae13('0x15')](respondWithStatusCode(_0x220ee9,null))[_0xae13('0x34')](function(_0x3b3091){if(_0x61b922){socket['emit']('microsoftAuthorization:error',{'id':_0x61b922['id']});}if(!_0x5b04fb){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x3b3091);return _0x220ee9[_0xae13('0xc')](0x1f4)[_0xae13('0x56')](_0x3b3091[_0xae13('0x57')]);}logger[_0xae13('0x44')](_0xae13('0x58'),_0x5b04fb['id'],JSON[_0xae13('0x59')](_0x3b3091));});}; \ No newline at end of file +var _0x6245=['lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','end','json','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','service','MicrosoftAzure','decryptString','data3','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','find','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','parse','state','base64','toString','ascii','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','microsoftAuthorization:error','stringify'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6245,0x164));var _0x5624=function(_0x3b2e0a,_0x49a3f9){_0x3b2e0a=_0x3b2e0a-0x0;var _0x4a84bd=_0x6245[_0x3b2e0a];return _0x4a84bd;};'use strict';var _=require(_0x5624('0x0'));var Redis=require(_0x5624('0x1'));var qs=require(_0x5624('0x2'));var encryptor=require(_0x5624('0x3'));var config=require(_0x5624('0x4'));var logger=require(_0x5624('0x5'))(_0x5624('0x6'));var db=require(_0x5624('0x7'))['db'];var oauth=require(_0x5624('0x8'));config[_0x5624('0x9')]=_['defaults'](config[_0x5624('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5624('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x5624('0x9')]);function respondWithStatusCode(_0x4b32e3,_0x1d5a46){_0x1d5a46=_0x1d5a46||0xcc;return function(_0x507e20){if(_0x507e20){return _0x4b32e3[_0x5624('0xb')](_0x1d5a46);}return _0x4b32e3[_0x5624('0xc')](_0x1d5a46)[_0x5624('0xd')]();};}function respondWithResult(_0x25722e,_0x20eae9){_0x20eae9=_0x20eae9||0xc8;return function(_0x110704){if(_0x110704){return _0x25722e[_0x5624('0xc')](_0x20eae9)[_0x5624('0xe')](_0x110704);}};}function respondWithFilteredResult(_0x2241a1,_0x12e597){return function(_0x4f373f){if(_0x4f373f){var _0x1c6454=typeof _0x12e597['offset']===_0x5624('0xf')&&typeof _0x12e597['limit']===_0x5624('0xf');var _0xa7dcdb=_0x4f373f[_0x5624('0x10')];var _0x900856=_0x1c6454?0x0:_0x12e597['offset'];var _0xcc6644=_0x1c6454?_0x4f373f[_0x5624('0x10')]:_0x12e597['offset']+_0x12e597[_0x5624('0x11')];var _0x519de3;if(_0xcc6644>=_0xa7dcdb){_0xcc6644=_0xa7dcdb;_0x519de3=0xc8;}else{_0x519de3=0xce;}_0x2241a1[_0x5624('0xc')](_0x519de3);return _0x2241a1['set'](_0x5624('0x12'),_0x900856+'-'+_0xcc6644+'/'+_0xa7dcdb)[_0x5624('0xe')](_0x4f373f);}return null;};}function saveUpdates(_0x2dcf32){return function(_0x15add5){if(_0x15add5){return _0x15add5[_0x5624('0x13')](_0x2dcf32)[_0x5624('0x14')](function(_0xcd02e3){return _0xcd02e3;});}return null;};}function removeEntity(_0x55f2bf){return function(_0x438fde){if(_0x438fde){return _0x438fde[_0x5624('0x15')]()[_0x5624('0x14')](function(){_0x55f2bf[_0x5624('0xc')](0xcc)[_0x5624('0xd')]();});}};}function handleEntityNotFound(_0x31a15f){return function(_0x4ed883){if(!_0x4ed883){_0x31a15f['sendStatus'](0x194);}return _0x4ed883;};}function handleError(_0x4d503f,_0x2749d1){_0x2749d1=_0x2749d1||0x1f4;return function(_0x23d787){logger[_0x5624('0x16')](_0x23d787[_0x5624('0x17')]);if(_0x23d787[_0x5624('0x18')]){delete _0x23d787[_0x5624('0x18')];}_0x4d503f[_0x5624('0xc')](_0x2749d1)[_0x5624('0x19')](_0x23d787);};}function maskClientSecret(_0x5d5b35){return _['padEnd'](_0x5d5b35[_0x5624('0x1a')](0x0,0x3),0x14,'*');}exports[_0x5624('0x1b')]=function(_0x42740a,_0x21f423){var _0x46353e={},_0x3076f0={},_0x1eed80={'count':0x0,'rows':[]};var _0x4d79d7=_[_0x5624('0x1c')](db[_0x5624('0x1d')][_0x5624('0x1e')],function(_0x572a2e){return{'name':_0x572a2e[_0x5624('0x1f')],'type':_0x572a2e[_0x5624('0x20')]['key']};});_0x3076f0[_0x5624('0x21')]=_[_0x5624('0x1c')](_0x4d79d7,_0x5624('0x18'));_0x3076f0[_0x5624('0x22')]=_[_0x5624('0x23')](_0x42740a['query']);_0x3076f0[_0x5624('0x24')]=_[_0x5624('0x25')](_0x3076f0[_0x5624('0x21')],_0x3076f0[_0x5624('0x22')]);_0x46353e[_0x5624('0x26')]=_[_0x5624('0x25')](_0x3076f0[_0x5624('0x21')],qs[_0x5624('0x27')](_0x42740a[_0x5624('0x22')][_0x5624('0x27')]));_0x46353e[_0x5624('0x26')]=_0x46353e['attributes'][_0x5624('0x28')]?_0x46353e['attributes']:_0x3076f0['model'];if(!_0x42740a[_0x5624('0x22')][_0x5624('0x29')](_0x5624('0x2a'))){_0x46353e['limit']=qs[_0x5624('0x11')](_0x42740a[_0x5624('0x22')]['limit']);_0x46353e[_0x5624('0x2b')]=qs[_0x5624('0x2b')](_0x42740a[_0x5624('0x22')][_0x5624('0x2b')]);}_0x46353e[_0x5624('0x2c')]=qs[_0x5624('0x2d')](_0x42740a[_0x5624('0x22')]['sort']);_0x46353e[_0x5624('0x2e')]=qs['filters'](_[_0x5624('0x2f')](_0x42740a[_0x5624('0x22')],_0x3076f0['filters']),_0x4d79d7);if(_0x42740a[_0x5624('0x22')][_0x5624('0x30')]){_0x46353e['where']=_[_0x5624('0x31')](_0x46353e['where'],{'$or':_[_0x5624('0x1c')](_0x4d79d7,function(_0x5c1404){if(_0x5c1404[_0x5624('0x20')]!==_0x5624('0x32')){var _0x244da0={};_0x244da0[_0x5c1404[_0x5624('0x18')]]={'$like':'%'+_0x42740a[_0x5624('0x22')][_0x5624('0x30')]+'%'};return _0x244da0;}})});}_0x46353e=_[_0x5624('0x31')]({},_0x46353e,_0x42740a[_0x5624('0x33')]);var _0x4962aa={'where':_0x46353e[_0x5624('0x2e')]};return db[_0x5624('0x1d')][_0x5624('0x10')](_0x4962aa)[_0x5624('0x14')](function(_0x30f404){_0x1eed80[_0x5624('0x10')]=_0x30f404;if(_0x42740a[_0x5624('0x22')]['includeAll']){_0x46353e[_0x5624('0x34')]=[{'all':!![]}];}return db[_0x5624('0x1d')][_0x5624('0x35')](_0x46353e);})[_0x5624('0x14')](function(_0x192380){_0x1eed80['rows']=_[_0x5624('0x1c')](_0x192380,function(_0x4bdf37){if(_0x4bdf37[_0x5624('0x36')]===_0x5624('0x37')){var _0x3dad41=encryptor[_0x5624('0x38')](_0x4bdf37[_0x5624('0x39')]);_0x4bdf37[_0x5624('0x39')]=maskClientSecret(_0x3dad41);}return _0x4bdf37;});return _0x1eed80;})[_0x5624('0x14')](respondWithFilteredResult(_0x21f423,_0x46353e))['catch'](handleError(_0x21f423,null));};exports['show']=function(_0x199030,_0x3054a9){var _0x4f68bb={'raw':!![],'where':{'id':_0x199030['params']['id']}},_0x42129b={};_0x42129b['model']=_['keys'](db[_0x5624('0x1d')][_0x5624('0x1e')]);_0x42129b['query']=_[_0x5624('0x23')](_0x199030[_0x5624('0x22')]);_0x42129b[_0x5624('0x24')]=_[_0x5624('0x25')](_0x42129b[_0x5624('0x21')],_0x42129b[_0x5624('0x22')]);_0x4f68bb['attributes']=_['intersection'](_0x42129b['model'],qs[_0x5624('0x27')](_0x199030[_0x5624('0x22')]['fields']));_0x4f68bb['attributes']=_0x4f68bb[_0x5624('0x26')][_0x5624('0x28')]?_0x4f68bb[_0x5624('0x26')]:_0x42129b['model'];if(_0x199030[_0x5624('0x22')]['includeAll']){_0x4f68bb['include']=[{'all':!![]}];}_0x4f68bb=_[_0x5624('0x31')]({},_0x4f68bb,_0x199030[_0x5624('0x33')]);return db[_0x5624('0x1d')]['find'](_0x4f68bb)[_0x5624('0x14')](handleEntityNotFound(_0x3054a9,null))[_0x5624('0x14')](function(_0x5b280d){if(_0x5b280d[_0x5624('0x36')]===_0x5624('0x37')){var _0x4247ea=encryptor[_0x5624('0x38')](_0x5b280d[_0x5624('0x39')]);_0x5b280d[_0x5624('0x39')]=maskClientSecret(_0x4247ea);}return _0x5b280d;})[_0x5624('0x14')](respondWithResult(_0x3054a9,null))['catch'](handleError(_0x3054a9,null));};exports[_0x5624('0x3a')]=function(_0x28c674,_0x5bcf11){if(!_0x28c674[_0x5624('0x3b')][_0x5624('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x28c674[_0x5624('0x3b')][_0x5624('0x36')])throw new Error(_0x5624('0x3c'));var _0x3698bf=db[_0x5624('0x1d')][_0x5624('0x1e')]['service'][_0x5624('0x3d')];if(!_0x3698bf[_0x5624('0x3e')](_0x28c674[_0x5624('0x3b')][_0x5624('0x36')]))throw new Error(_0x5624('0x3f')+_0x3698bf[_0x5624('0x40')](',\x20'));if(_0x28c674[_0x5624('0x3b')][_0x5624('0x36')]==='MicrosoftAzure'&&_0x28c674[_0x5624('0x3b')][_0x5624('0x39')]){_0x28c674[_0x5624('0x3b')][_0x5624('0x39')]=encryptor[_0x5624('0x41')](_0x28c674[_0x5624('0x3b')]['data3']);}return db[_0x5624('0x1d')][_0x5624('0x3a')](_0x28c674['body'],{})[_0x5624('0x14')](respondWithResult(_0x5bcf11,0xc9))[_0x5624('0x42')](handleError(_0x5bcf11,null));};exports[_0x5624('0x13')]=function(_0x51fe24,_0x2cee62){if(_0x51fe24[_0x5624('0x3b')]['id']){delete _0x51fe24[_0x5624('0x3b')]['id'];}return db[_0x5624('0x1d')][_0x5624('0x43')]({'where':{'id':_0x51fe24[_0x5624('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cee62,null))[_0x5624('0x14')](function(_0x5c7a30){if(_0x5c7a30[_0x5624('0x36')]===_0x5624('0x37')&&_0x51fe24[_0x5624('0x3b')]['data3']){_0x51fe24['body'][_0x5624('0x39')]=encryptor[_0x5624('0x41')](_0x51fe24[_0x5624('0x3b')][_0x5624('0x39')]);}return _0x5c7a30;})['then'](saveUpdates(_0x51fe24[_0x5624('0x3b')],null))[_0x5624('0x14')](respondWithResult(_0x2cee62,null))[_0x5624('0x42')](handleError(_0x2cee62,null));};exports[_0x5624('0x15')]=function(_0x3b9acf,_0x3015ec){return db['CloudProvider']['find']({'where':{'id':_0x3b9acf[_0x5624('0x44')]['id']}})['then'](handleEntityNotFound(_0x3015ec,null))[_0x5624('0x14')](removeEntity(_0x3015ec,null))[_0x5624('0x42')](handleError(_0x3015ec,null));};exports[_0x5624('0x45')]=function(_0x30f427,_0x146ac5){return db['CloudProvider']['findOne']({'where':{'id':_0x30f427['params']['id']},'raw':!![]})[_0x5624('0x14')](function(_0x41b2b1){if(!_0x41b2b1)return _0x146ac5[_0x5624('0xb')](0x194);return{'url':oauth[_0x5624('0x46')](_0x41b2b1,_0x30f427[_0x5624('0x47')]['id'])};})[_0x5624('0x14')](respondWithResult(_0x146ac5,null))[_0x5624('0x42')](handleError(_0x146ac5,null));};exports[_0x5624('0x48')]=function(_0x11dbc2,_0x1907d8){var _0x4cce28=_0x11dbc2[_0x5624('0x3b')];var _0x1d2aec;var _0x30d666;if(_0x4cce28[_0x5624('0x16')])throw _0x4cce28;redis['get'](_0x4cce28['state'])['then'](function(_0x245527){if(!_0x245527)throw new Error('Invalid\x20state\x20parameter');_0x1d2aec=JSON[_0x5624('0x49')](_0x245527);var _0x566850=Buffer['from'](_0x4cce28[_0x5624('0x4a')],_0x5624('0x4b'))[_0x5624('0x4c')](_0x5624('0x4d'));_0x30d666=JSON['parse'](_0x566850);if(!oauth[_0x5624('0x4e')](_0x4cce28['id_token'],_0x1d2aec['oauth2Claims']))throw new Error(_0x5624('0x4f'));redis[_0x5624('0x50')](_0x4cce28[_0x5624('0x4a')]);return oauth[_0x5624('0x51')](_0x4cce28[_0x5624('0x52')],_0x1d2aec);})[_0x5624('0x14')](function(_0x2acb8a){_0x1d2aec[_0x5624('0x53')]=_0x2acb8a[_0x5624('0x54')];_0x1d2aec[_0x5624('0x55')]=_0x2acb8a['refresh_token'];return db[_0x5624('0x1d')]['update']({'data5':_0x1d2aec[_0x5624('0x53')],'data6':_0x1d2aec[_0x5624('0x55')]},{'where':{'id':_0x1d2aec['id']}});})[_0x5624('0x14')](function(){oauth[_0x5624('0x56')](_0x1d2aec);socket['emit']('microsoftAuthorization:success',{'id':_0x30d666['id']});return;})[_0x5624('0x14')](respondWithStatusCode(_0x1907d8,null))[_0x5624('0x42')](function(_0x43515b){if(_0x30d666){socket['emit'](_0x5624('0x57'),{'id':_0x30d666['id']});}if(!_0x1d2aec){logger[_0x5624('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x43515b);return _0x1907d8['status'](0x1f4)[_0x5624('0x19')](_0x43515b['message']);}logger[_0x5624('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1d2aec['id'],JSON[_0x5624('0x58')](_0x43515b));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 4a0dc2c..3f682ef 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 _0xa64a=['lodash','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xa64a,0xc6));var _0xaa64=function(_0x18bcbf,_0x518845){_0x18bcbf=_0x18bcbf-0x0;var _0x1286e9=_0xa64a[_0x18bcbf];return _0x1286e9;};'use strict';var _=require(_0xaa64('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaa64('0x1'));var BPromise=require(_0xaa64('0x2'));var rp=require(_0xaa64('0x3'));var fs=require('fs');var path=require(_0xaa64('0x4'));var rimraf=require('rimraf');var config=require(_0xaa64('0x5'));var attributes=require(_0xaa64('0x6'));module[_0xaa64('0x7')]=function(_0x4455fa,_0x5bb598){return _0x4455fa[_0xaa64('0x8')](_0xaa64('0x9'),attributes,{'tableName':_0xaa64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x160d=['path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x160d,0x7e));var _0xd160=function(_0x5cae78,_0x398e85){_0x5cae78=_0x5cae78-0x0;var _0x5394b6=_0x160d[_0x5cae78];return _0x5394b6;};'use strict';var _=require('lodash');var util=require(_0xd160('0x0'));var logger=require(_0xd160('0x1'))(_0xd160('0x2'));var moment=require(_0xd160('0x3'));var BPromise=require(_0xd160('0x4'));var rp=require(_0xd160('0x5'));var fs=require('fs');var path=require(_0xd160('0x6'));var rimraf=require(_0xd160('0x7'));var config=require('../../config/environment');var attributes=require(_0xd160('0x8'));module[_0xd160('0x9')]=function(_0x14c4a9,_0x367006){return _0x14c4a9[_0xd160('0xa')](_0xd160('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 390b66e..8c92372 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35ae=['exp','resolve','then','data3','CloudProvider','decryptString','POST','data5','data6','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','intervals','findAll','map','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','push','data7','join','Outlook365','/.default','replace','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','issuer','aud','isAfter','unix'];(function(_0x2612d6,_0x7357a2){var _0x1277b6=function(_0x1d704a){while(--_0x1d704a){_0x2612d6['push'](_0x2612d6['shift']());}};_0x1277b6(++_0x7357a2);}(_0x35ae,0x10f));var _0xe35a=function(_0xd94ba3,_0x5e2e97){_0xd94ba3=_0xd94ba3-0x0;var _0x3c5402=_0x35ae[_0xd94ba3];return _0x3c5402;};'use strict';var _=require(_0xe35a('0x0'));var crypto=require(_0xe35a('0x1'));var jwt=require(_0xe35a('0x2'));var moment=require('moment');var Redis=require(_0xe35a('0x3'));var rp=require(_0xe35a('0x4'));var util=require(_0xe35a('0x5'));var encryptor=require(_0xe35a('0x6'));var config=require(_0xe35a('0x7'));var logger=require(_0xe35a('0x8'))(_0xe35a('0x9'));var schedule=require(_0xe35a('0xa'));var db=require(_0xe35a('0xb'))['db'];config[_0xe35a('0xc')]=_[_0xe35a('0xd')](config[_0xe35a('0xc')],{'host':_0xe35a('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xe35a('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xe35a('0x10'),_0xe35a('0x11'),_0xe35a('0x12'),'offline_access',_0xe35a('0x13'),_0xe35a('0x14'),_0xe35a('0x15')],'Dynamics365':[_0xe35a('0x10'),_0xe35a('0x16')]};var MICROSOFT_AUTH_ENDPOINT=_0xe35a('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0xe35a('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x56e7fe){var _0x70b379=_['map'](AZURE_AUTH_SCOPES[_0x56e7fe[_0xe35a('0x19')]]);if(_0x56e7fe['type']==='Dynamics365')_0x70b379[_0xe35a('0x1a')](_0x56e7fe[_0xe35a('0x1b')]+'/.default');return _0x70b379[_0xe35a('0x1c')]('\x20');}function getAccessTokenScope(_0x58d268){if(_0x58d268[_0xe35a('0x19')]===_0xe35a('0x1d'))return _0xe35a('0x13');if(_0x58d268[_0xe35a('0x19')]==='Dynamics365')return _0x58d268['data7']+_0xe35a('0x1e');}function generateMicrosoftAuthorizationUrl(_0x539298,_0x5138a9){var _0x246154=MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x539298[_0xe35a('0x20')]);var _0x55173e=[_0xe35a('0x21'),_0xe35a('0x22')];var _0x2e59f6=Buffer[_0xe35a('0x23')](JSON[_0xe35a('0x24')]({'id':_0x5138a9}))[_0xe35a('0x25')]('base64');var _0x1e535e=crypto[_0xe35a('0x26')](0x10)[_0xe35a('0x25')](_0xe35a('0x27'));var _0x3519e3=getAuthorizationScopes(_0x539298);var _0x45352a=[{'key':_0xe35a('0x28'),'value':_0x539298['data1']},{'key':_0xe35a('0x29'),'value':encodeURIComponent(_0x55173e['join']('\x20'))},{'key':_0xe35a('0x2a'),'value':_0x539298[_0xe35a('0x2b')]},{'key':_0xe35a('0x2c'),'value':_0xe35a('0x2d')},{'key':'scope','value':encodeURIComponent(_0x3519e3)},{'key':_0xe35a('0x2e'),'value':_0x2e59f6},{'key':_0xe35a('0x2f'),'value':_0x1e535e},{'key':_0xe35a('0x30'),'value':'login'}];var _0x1d25fa=_0x246154+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x45352a,function(_0x17645c){return _0x17645c['key']+'='+_0x17645c[_0xe35a('0x31')];})[_0xe35a('0x1c')]('&');_0x539298[_0xe35a('0x32')]={'issuer':_0x246154[_0xe35a('0x1f')](_0xe35a('0x33'),''),'audience':_0x539298[_0xe35a('0x34')],'state':_0x2e59f6,'nonce':_0x1e535e};redis[_0xe35a('0x35')](_0x2e59f6,JSON[_0xe35a('0x24')](_0x539298));return _0x1d25fa;}function isValidIdToken(_0x5a33cf,_0x13f5a7){try{var _0x45173f=jwt[_0xe35a('0x36')](_0x5a33cf,{'complete':!![]});var _0x184f15=_0x45173f[_0xe35a('0x37')];if(_0x184f15[_0xe35a('0x38')]!==_0x13f5a7[_0xe35a('0x39')])return![];if(_0x184f15[_0xe35a('0x3a')]!==_0x13f5a7['audience'])return![];if(_0x184f15['nonce']!==_0x13f5a7[_0xe35a('0x2f')])return![];if(moment()[_0xe35a('0x3b')](moment[_0xe35a('0x3c')](_0x184f15[_0xe35a('0x3d')])))return![];return!![];}catch(_0x3efbcb){throw _0x3efbcb;}}function refreshOauth2MicrosoftAccessToken(_0x368b3d){return Promise[_0xe35a('0x3e')]()[_0xe35a('0x3f')](function(){if(_0x368b3d[_0xe35a('0x40')])return _0x368b3d;return db[_0xe35a('0x41')]['findOne']({'where':{'id':_0x368b3d['id']},'raw':!![]});})[_0xe35a('0x3f')](function(_0x4149fd){var _0x310fd9={'grant_type':'refresh_token','refresh_token':_0x4149fd['data6'],'scope':getAccessTokenScope(_0x4149fd),'redirect_uri':_0x4149fd[_0xe35a('0x2b')],'client_id':_0x4149fd[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x4149fd[_0xe35a('0x40')])};var _0x41a4c4={'method':_0xe35a('0x43'),'uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x4149fd[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x310fd9,'json':!![]};return rp(_0x41a4c4);})['then'](function(_0x92a9d6){_0x368b3d[_0xe35a('0x44')]=_0x92a9d6['access_token'];_0x368b3d[_0xe35a('0x45')]=_0x92a9d6[_0xe35a('0x46')];return db[_0xe35a('0x41')][_0xe35a('0x47')]({'data5':_0x368b3d[_0xe35a('0x44')],'data6':_0x368b3d[_0xe35a('0x45')]},{'where':{'id':_0x368b3d['id']}});})[_0xe35a('0x3f')](function(){return _0x368b3d;})[_0xe35a('0x48')](function(_0x54fd1a){logger[_0xe35a('0x49')](_0xe35a('0x4a'),_0x368b3d['id'],_0x54fd1a);});}function getOauth2MicrosoftAccessToken(_0x1542d6,_0x3c8587){var _0x974ae={'grant_type':_0xe35a('0x4b'),'code':_0x1542d6,'scope':getAccessTokenScope(_0x3c8587),'redirect_uri':_0x3c8587[_0xe35a('0x2b')],'client_id':_0x3c8587[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x3c8587['data3'])};var _0x1a285c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')](_0xe35a('0x4c'),_0x3c8587[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x974ae,'json':!![]};return rp(_0x1a285c);}function startRefreshInterval(_0x597c7e){var _0xcb86c8=schedule[_0xe35a('0x4d')];if(_0xcb86c8[_0x597c7e['id']])clearInterval(_0xcb86c8[_0x597c7e['id']]);_0xcb86c8[_0x597c7e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x597c7e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xcb86c8;}function startAllRefreshIntervals(){return db[_0xe35a('0x41')][_0xe35a('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe35a('0x3f')](function(_0x1a238b){var _0x1bf494=_0x1a238b[_0xe35a('0x4f')](function(_0x5ccbc4){return refreshOauth2MicrosoftAccessToken(_0x5ccbc4)[_0xe35a('0x3f')](function(_0x1ca80e){startRefreshInterval(_0x1ca80e);});});return Promise['all'](_0x1bf494);})[_0xe35a('0x48')](function(_0x2a0cd1){var _0x315250=_0x2a0cd1?util[_0xe35a('0x50')](_0x2a0cd1,{'showHidden':![],'depth':null}):'';logger[_0xe35a('0x49')](_0xe35a('0x51'),_0x315250);});}module[_0xe35a('0x52')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xab4e=['join','Dynamics365','/.default','replace','data2','code','stringify','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','set','decode','iss','aud','audience','unix','exp','data3','refresh_token','data6','decryptString','{TENANT_ID}','then','data5','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','push','data7'];(function(_0x177777,_0x126b6b){var _0x5dd5c0=function(_0xe7de6e){while(--_0xe7de6e){_0x177777['push'](_0x177777['shift']());}};_0x5dd5c0(++_0x126b6b);}(_0xab4e,0x11a));var _0xeab4=function(_0x21e26a,_0x74beb4){_0x21e26a=_0x21e26a-0x0;var _0x33f236=_0xab4e[_0x21e26a];return _0x33f236;};'use strict';var _=require(_0xeab4('0x0'));var crypto=require(_0xeab4('0x1'));var jwt=require(_0xeab4('0x2'));var moment=require(_0xeab4('0x3'));var Redis=require(_0xeab4('0x4'));var rp=require('request-promise');var util=require(_0xeab4('0x5'));var encryptor=require(_0xeab4('0x6'));var config=require(_0xeab4('0x7'));var logger=require(_0xeab4('0x8'))('api');var schedule=require(_0xeab4('0x9'));var db=require(_0xeab4('0xa'))['db'];config[_0xeab4('0xb')]=_[_0xeab4('0xc')](config[_0xeab4('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xeab4('0xb')]);var MICROSOFT_AUTH_URL=_0xeab4('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xeab4('0xe'),_0xeab4('0xf'),_0xeab4('0x10'),_0xeab4('0x11'),_0xeab4('0x12'),_0xeab4('0x13'),_0xeab4('0x14')],'Dynamics365':[_0xeab4('0xe'),_0xeab4('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xeab4('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4cd173){var _0x48515c=_[_0xeab4('0x16')](AZURE_AUTH_SCOPES[_0x4cd173[_0xeab4('0x17')]]);if(_0x4cd173[_0xeab4('0x17')]==='Dynamics365')_0x48515c[_0xeab4('0x18')](_0x4cd173[_0xeab4('0x19')]+'/.default');return _0x48515c[_0xeab4('0x1a')]('\x20');}function getAccessTokenScope(_0x29f893){if(_0x29f893[_0xeab4('0x17')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x29f893[_0xeab4('0x17')]===_0xeab4('0x1b'))return _0x29f893['data7']+_0xeab4('0x1c');}function generateMicrosoftAuthorizationUrl(_0x4cec5a,_0x10941e){var _0x23c4dd=MICROSOFT_AUTH_URL[_0xeab4('0x1d')]('{TENANT_ID}',_0x4cec5a[_0xeab4('0x1e')]);var _0x55f6da=[_0xeab4('0x1f'),'id_token'];var _0x19979f=Buffer['from'](JSON[_0xeab4('0x20')]({'id':_0x10941e}))[_0xeab4('0x21')](_0xeab4('0x22'));var _0x2315dc=crypto['randomBytes'](0x10)['toString'](_0xeab4('0x23'));var _0x259bd5=getAuthorizationScopes(_0x4cec5a);var _0x77b6f0=[{'key':_0xeab4('0x24'),'value':_0x4cec5a[_0xeab4('0x25')]},{'key':_0xeab4('0x26'),'value':encodeURIComponent(_0x55f6da[_0xeab4('0x1a')]('\x20'))},{'key':_0xeab4('0x27'),'value':_0x4cec5a[_0xeab4('0x28')]},{'key':_0xeab4('0x29'),'value':_0xeab4('0x2a')},{'key':_0xeab4('0x2b'),'value':encodeURIComponent(_0x259bd5)},{'key':_0xeab4('0x2c'),'value':_0x19979f},{'key':_0xeab4('0x2d'),'value':_0x2315dc},{'key':_0xeab4('0x2e'),'value':_0xeab4('0x2f')}];var _0x256f58=_0x23c4dd+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x77b6f0,function(_0x56d471){return _0x56d471['key']+'='+_0x56d471[_0xeab4('0x30')];})[_0xeab4('0x1a')]('&');_0x4cec5a[_0xeab4('0x31')]={'issuer':_0x23c4dd[_0xeab4('0x1d')](_0xeab4('0x32'),''),'audience':_0x4cec5a[_0xeab4('0x25')],'state':_0x19979f,'nonce':_0x2315dc};redis[_0xeab4('0x33')](_0x19979f,JSON['stringify'](_0x4cec5a));return _0x256f58;}function isValidIdToken(_0x12057e,_0x5d4e7c){try{var _0x54712c=jwt[_0xeab4('0x34')](_0x12057e,{'complete':!![]});var _0x15486d=_0x54712c['payload'];if(_0x15486d[_0xeab4('0x35')]!==_0x5d4e7c['issuer'])return![];if(_0x15486d[_0xeab4('0x36')]!==_0x5d4e7c[_0xeab4('0x37')])return![];if(_0x15486d[_0xeab4('0x2d')]!==_0x5d4e7c[_0xeab4('0x2d')])return![];if(moment()['isAfter'](moment[_0xeab4('0x38')](_0x15486d[_0xeab4('0x39')])))return![];return!![];}catch(_0x3cb93b){throw _0x3cb93b;}}function refreshOauth2MicrosoftAccessToken(_0x2b06b5){return Promise['resolve']()['then'](function(){if(_0x2b06b5[_0xeab4('0x3a')])return _0x2b06b5;return db['CloudProvider']['findOne']({'where':{'id':_0x2b06b5['id']},'raw':!![]});})['then'](function(_0x5efec7){var _0x1f2b0e={'grant_type':_0xeab4('0x3b'),'refresh_token':_0x5efec7[_0xeab4('0x3c')],'scope':getAccessTokenScope(_0x5efec7),'redirect_uri':_0x5efec7[_0xeab4('0x28')],'client_id':_0x5efec7[_0xeab4('0x25')],'client_secret':encryptor[_0xeab4('0x3d')](_0x5efec7[_0xeab4('0x3a')])};var _0x15ed44={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xeab4('0x1d')](_0xeab4('0x3e'),_0x5efec7[_0xeab4('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f2b0e,'json':!![]};return rp(_0x15ed44);})[_0xeab4('0x3f')](function(_0x52894c){_0x2b06b5[_0xeab4('0x40')]=_0x52894c['access_token'];_0x2b06b5[_0xeab4('0x3c')]=_0x52894c[_0xeab4('0x3b')];return db[_0xeab4('0x41')][_0xeab4('0x42')]({'data5':_0x2b06b5['data5'],'data6':_0x2b06b5[_0xeab4('0x3c')]},{'where':{'id':_0x2b06b5['id']}});})[_0xeab4('0x3f')](function(){return _0x2b06b5;})[_0xeab4('0x43')](function(_0x14fc30){logger[_0xeab4('0x44')](_0xeab4('0x45'),_0x2b06b5['id'],_0x14fc30);});}function getOauth2MicrosoftAccessToken(_0x50d4f9,_0x4b0982){var _0x382fda={'grant_type':_0xeab4('0x46'),'code':_0x50d4f9,'scope':getAccessTokenScope(_0x4b0982),'redirect_uri':_0x4b0982[_0xeab4('0x28')],'client_id':_0x4b0982[_0xeab4('0x25')],'client_secret':encryptor[_0xeab4('0x3d')](_0x4b0982[_0xeab4('0x3a')])};var _0x324c6b={'method':_0xeab4('0x47'),'uri':MICROSOFT_AUTH_URL[_0xeab4('0x1d')](_0xeab4('0x3e'),_0x4b0982[_0xeab4('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x382fda,'json':!![]};return rp(_0x324c6b);}function startRefreshInterval(_0x31a0c9){var _0x2021cb=schedule[_0xeab4('0x48')];if(_0x2021cb[_0x31a0c9['id']])clearInterval(_0x2021cb[_0x31a0c9['id']]);_0x2021cb[_0x31a0c9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xeab4('0x49')](this,{'id':_0x31a0c9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xeab4('0x48')]=_0x2021cb;}function startAllRefreshIntervals(){return db[_0xeab4('0x41')][_0xeab4('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xeab4('0x3f')](function(_0x5c1048){var _0x91562=_0x5c1048[_0xeab4('0x16')](function(_0x208527){return refreshOauth2MicrosoftAccessToken(_0x208527)[_0xeab4('0x3f')](function(_0x5b8632){startRefreshInterval(_0x5b8632);});});return Promise[_0xeab4('0x4b')](_0x91562);})[_0xeab4('0x43')](function(_0x16eafa){var _0x2d5760=_0x16eafa?util['inspect'](_0x16eafa,{'showHidden':![],'depth':null}):'';logger[_0xeab4('0x44')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2d5760);});}module[_0xeab4('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2f666f8..c093302 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 _0xb515=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x4ca0a1,_0x6158d8){var _0x1c26c3=function(_0x3029e5){while(--_0x3029e5){_0x4ca0a1['push'](_0x4ca0a1['shift']());}};_0x1c26c3(++_0x6158d8);}(_0xb515,0x1b8));var _0x5b51=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb515[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5b51('0x0'));var util=require('util');var moment=require(_0x5b51('0x1'));var BPromise=require(_0x5b51('0x2'));var rs=require(_0x5b51('0x3'));var fs=require('fs');var Redis=require(_0x5b51('0x4'));var db=require(_0x5b51('0x5'))['db'];var utils=require(_0x5b51('0x6'));var logger=require(_0x5b51('0x7'))(_0x5b51('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b51('0x9'));var client=jayson[_0x5b51('0xa')][_0x5b51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293d82,_0x396b3f,_0x2c6d86){return new BPromise(function(_0x1d5082,_0x226e9c){return client[_0x5b51('0xc')](_0x293d82,_0x2c6d86)[_0x5b51('0xd')](function(_0x1085e6){logger[_0x5b51('0xe')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x5b51('0xf'));logger[_0x5b51('0x10')](_0x5b51('0x11'),_0x396b3f,_0x5b51('0xf'),JSON[_0x5b51('0x12')](_0x1085e6));if(_0x1085e6[_0x5b51('0x13')]){if(_0x1085e6['error']['code']===0x1f4){logger['error'](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x226e9c(_0x1085e6[_0x5b51('0x13')]['message']);}logger[_0x5b51('0x13')](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x1d5082(_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);}else{logger[_0x5b51('0xe')](_0x5b51('0x14'),_0x396b3f,_0x5b51('0xf'));_0x1d5082(_0x1085e6[_0x5b51('0x16')][_0x5b51('0x15')]);}})[_0x5b51('0x17')](function(_0x520686){logger[_0x5b51('0x13')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x520686);_0x226e9c(_0x520686);});});} \ No newline at end of file +var _0x30d6=['client','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x30d6,0x1b0));var _0x630d=function(_0x3e3f8b,_0x98ea26){_0x3e3f8b=_0x3e3f8b-0x0;var _0x354e47=_0x30d6[_0x3e3f8b];return _0x354e47;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8950bb,_0x3aa6f4,_0x2c1b77){return new BPromise(function(_0x4b60c1,_0x533e4f){return client[_0x630d('0x9')](_0x8950bb,_0x2c1b77)[_0x630d('0xa')](function(_0x24d260){logger[_0x630d('0xb')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x630d('0xc'));logger[_0x630d('0xd')](_0x630d('0xe'),_0x3aa6f4,_0x630d('0xc'),JSON[_0x630d('0xf')](_0x24d260));if(_0x24d260[_0x630d('0x10')]){if(_0x24d260[_0x630d('0x10')][_0x630d('0x11')]===0x1f4){logger[_0x630d('0x10')](_0x630d('0x12'),_0x3aa6f4,_0x24d260['error'][_0x630d('0x13')]);return _0x533e4f(_0x24d260['error'][_0x630d('0x13')]);}logger[_0x630d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);return _0x4b60c1(_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);}else{logger[_0x630d('0xb')](_0x630d('0x12'),_0x3aa6f4,_0x630d('0xc'));_0x4b60c1(_0x24d260[_0x630d('0x14')]['message']);}})[_0x630d('0x15')](function(_0x4db79d){logger[_0x630d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x4db79d);_0x533e4f(_0x4db79d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8374d87..0b5c476 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x16e773,_0x8abfd7){var _0x54a3e8=function(_0x5a5f25){while(--_0x5a5f25){_0x16e773['push'](_0x16e773['shift']());}};_0x54a3e8(++_0x8abfd7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x5ee49f,_0x317771){var _0x44cca1=function(_0x1f7b6f){while(--_0x1f7b6f){_0x5ee49f['push'](_0x5ee49f['shift']());}};_0x44cca1(++_0x317771);}(_0xdb28,0x106));var _0x8db2=function(_0x4c88c7,_0x3f0882){_0x4c88c7=_0x4c88c7-0x0;var _0x2c03e7=_0xdb28[_0x4c88c7];return _0x2c03e7;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 907de49..ea86756 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 _0xbd94=['STRING','sequelize','name'];(function(_0xb119da,_0x42d325){var _0x3ecb48=function(_0x361539){while(--_0x361539){_0xb119da['push'](_0xb119da['shift']());}};_0x3ecb48(++_0x42d325);}(_0xbd94,0xfd));var _0x4bd9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbd94[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4bd9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4bd9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4bd9('0x2')]},'website':{'type':Sequelize[_0x4bd9('0x2')]},'phone':{'type':Sequelize[_0x4bd9('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4bd9('0x2')]},'street':{'type':Sequelize[_0x4bd9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4bd9('0x2')]},'country':{'type':Sequelize[_0x4bd9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4bd9('0x2')]},'sStreet':{'type':Sequelize[_0x4bd9('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4bd9('0x2')]},'sCountry':{'type':Sequelize[_0x4bd9('0x2')]},'description':{'type':Sequelize[_0x4bd9('0x2')]}}; \ No newline at end of file +var _0x5915=['sequelize','exports','STRING'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5915,0x14a));var _0x5591=function(_0x2d4924,_0x34b36f){_0x2d4924=_0x2d4924-0x0;var _0x2db190=_0x5915[_0x2d4924];return _0x2db190;};'use strict';var Sequelize=require(_0x5591('0x0'));module[_0x5591('0x1')]={'name':{'type':Sequelize[_0x5591('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5591('0x2')]},'website':{'type':Sequelize[_0x5591('0x2')]},'phone':{'type':Sequelize[_0x5591('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5591('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5591('0x2')]},'country':{'type':Sequelize[_0x5591('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5591('0x2')]},'sStreet':{'type':Sequelize[_0x5591('0x2')]},'sPostalCode':{'type':Sequelize[_0x5591('0x2')]},'sCity':{'type':Sequelize[_0x5591('0x2')]},'sCountry':{'type':Sequelize[_0x5591('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 4805c4d..7275b2b 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 _0xa6b9=['filter','map','options','include','rows','catch','show','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','CmContact','omit','ids','getContacts','pick','merge','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x5a2c7b,_0x441265){var _0x3ad931=function(_0x3a3b19){while(--_0x3a3b19){_0x5a2c7b['push'](_0x5a2c7b['shift']());}};_0x3ad931(++_0x441265);}(_0xa6b9,0x75));var _0x9a6b=function(_0x23a2ac,_0x39d9d0){_0x23a2ac=_0x23a2ac-0x0;var _0x28bfb0=_0xa6b9[_0x23a2ac];return _0x28bfb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a6b('0x1'));var rp=require(_0x9a6b('0x2'));var moment=require(_0x9a6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a6b('0x4'));var util=require(_0x9a6b('0x5'));var path=require(_0x9a6b('0x6'));var sox=require(_0x9a6b('0x7'));var csv=require('to-csv');var ejs=require(_0x9a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x9a6b('0x9'));var _=require('lodash');var squel=require(_0x9a6b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a6b('0xb'));var toCsv=require(_0x9a6b('0xc'));var querystring=require(_0x9a6b('0xd'));var Papa=require(_0x9a6b('0xe'));var Redis=require(_0x9a6b('0xf'));var authService=require(_0x9a6b('0x10'));var qs=require(_0x9a6b('0x11'));var as=require(_0x9a6b('0x12'));var hardwareService=require(_0x9a6b('0x13'));var logger=require(_0x9a6b('0x14'))(_0x9a6b('0x15'));var utils=require(_0x9a6b('0x16'));var config=require(_0x9a6b('0x17'));var licenseUtil=require(_0x9a6b('0x18'));var db=require(_0x9a6b('0x19'))['db'];function respondWithStatusCode(_0xdb1b86,_0xa01b90){_0xa01b90=_0xa01b90||0xcc;return function(_0x33dea4){if(_0x33dea4){return _0xdb1b86[_0x9a6b('0x1a')](_0xa01b90);}return _0xdb1b86[_0x9a6b('0x1b')](_0xa01b90)[_0x9a6b('0x1c')]();};}function respondWithResult(_0x4fe70e,_0x566dff){_0x566dff=_0x566dff||0xc8;return function(_0x57001c){if(_0x57001c){return _0x4fe70e['status'](_0x566dff)[_0x9a6b('0x1d')](_0x57001c);}};}function respondWithFilteredResult(_0x1318de,_0x2badbc){return function(_0x3a65ab){if(_0x3a65ab){var _0xb54fbd=typeof _0x2badbc[_0x9a6b('0x1e')]===_0x9a6b('0x1f')&&typeof _0x2badbc[_0x9a6b('0x20')]===_0x9a6b('0x1f');var _0x1258b8=_0x3a65ab[_0x9a6b('0x21')];var _0x167cf2=_0xb54fbd?0x0:_0x2badbc[_0x9a6b('0x1e')];var _0x14d340=_0xb54fbd?_0x3a65ab[_0x9a6b('0x21')]:_0x2badbc[_0x9a6b('0x1e')]+_0x2badbc['limit'];var _0x3e25db;if(_0x14d340>=_0x1258b8){_0x14d340=_0x1258b8;_0x3e25db=0xc8;}else{_0x3e25db=0xce;}_0x1318de[_0x9a6b('0x1b')](_0x3e25db);return _0x1318de['set']('Content-Range',_0x167cf2+'-'+_0x14d340+'/'+_0x1258b8)[_0x9a6b('0x1d')](_0x3a65ab);}return null;};}function patchUpdates(_0x4ebe79){return function(_0x4aca36){try{jsonpatch[_0x9a6b('0x22')](_0x4aca36,_0x4ebe79,!![]);}catch(_0x35933a){return BPromise[_0x9a6b('0x23')](_0x35933a);}return _0x4aca36[_0x9a6b('0x24')]();};}function saveUpdates(_0x132acb,_0x1c7f84){return function(_0x498bc8){if(_0x498bc8){return _0x498bc8['update'](_0x132acb)[_0x9a6b('0x25')](function(_0x49c3ae){return _0x49c3ae;});}return null;};}function removeEntity(_0x93d18,_0xd45f86){return function(_0x5652c5){if(_0x5652c5){return _0x5652c5[_0x9a6b('0x26')]()[_0x9a6b('0x25')](function(){var _0x1ef65d=_0x5652c5[_0x9a6b('0x27')]({'plain':!![]});var _0x24a1d3=_0x9a6b('0x28');return db[_0x9a6b('0x29')]['destroy']({'where':{'type':_0x24a1d3,'resourceId':_0x1ef65d['id']}})[_0x9a6b('0x25')](function(){return _0x5652c5;});})[_0x9a6b('0x25')](function(){_0x93d18['status'](0xcc)[_0x9a6b('0x1c')]();});}};}function handleEntityNotFound(_0x4eac23,_0x327ffc){return function(_0x33fcee){if(!_0x33fcee){_0x4eac23[_0x9a6b('0x1a')](0x194);}return _0x33fcee;};}function handleError(_0x182daf,_0x3e4e4c){_0x3e4e4c=_0x3e4e4c||0x1f4;return function(_0x114042){logger['error'](_0x114042[_0x9a6b('0x2a')]);if(_0x114042[_0x9a6b('0x2b')]){delete _0x114042[_0x9a6b('0x2b')];}_0x182daf['status'](_0x3e4e4c)[_0x9a6b('0x2c')](_0x114042);};}exports[_0x9a6b('0x2d')]=function(_0x519e87,_0x86fc7d){var _0x3e6fe7={},_0x391940={},_0x290ea0={'count':0x0,'rows':[]};return db[_0x9a6b('0x2e')]['describe']()['then'](function(_0x2e9942){_0x391940[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](_0x2e9942);_0x391940[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x519e87[_0x9a6b('0x31')]);_0x391940[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x391940['model'],_0x391940[_0x9a6b('0x31')]);_0x3e6fe7[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x391940['model'],qs[_0x9a6b('0x35')](_0x519e87[_0x9a6b('0x31')]['fields']));_0x3e6fe7[_0x9a6b('0x34')]=_0x3e6fe7[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0x3e6fe7[_0x9a6b('0x34')]:_0x391940['model'];if(!_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x3e6fe7[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x3e6fe7[_0x9a6b('0x1e')]=qs['offset'](_0x519e87['query'][_0x9a6b('0x1e')]);}_0x3e6fe7['order']=qs[_0x9a6b('0x39')](_0x519e87[_0x9a6b('0x31')]['sort']);_0x3e6fe7[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_['pick'](_0x519e87[_0x9a6b('0x31')],_0x391940[_0x9a6b('0x32')]),_0x2e9942);if(_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x3e6fe7[_0x9a6b('0x3a')]=_['merge'](_0x3e6fe7[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x3e6fe7[_0x9a6b('0x34')],function(_0x554329){var _0x53034a={};_0x53034a[_0x554329]={'$like':'%'+_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x53034a;})});}_0x3e6fe7=_['merge']({},_0x3e6fe7,_0x519e87[_0x9a6b('0x3d')]);var _0x301b19={'where':_0x3e6fe7[_0x9a6b('0x3a')]};return db['CmCompany']['count'](_0x301b19)[_0x9a6b('0x25')](function(_0x1ed70d){_0x290ea0[_0x9a6b('0x21')]=_0x1ed70d;if(_0x519e87[_0x9a6b('0x31')]['includeAll']){_0x3e6fe7[_0x9a6b('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x3e6fe7);})[_0x9a6b('0x25')](function(_0x1b3dc8){_0x290ea0[_0x9a6b('0x3f')]=_0x1b3dc8;return _0x290ea0;})[_0x9a6b('0x25')](respondWithFilteredResult(_0x86fc7d,_0x3e6fe7))[_0x9a6b('0x40')](handleError(_0x86fc7d,null));})[_0x9a6b('0x40')](handleError(_0x86fc7d,null));};exports[_0x9a6b('0x41')]=function(_0x4f810e,_0x5d2974){var _0xe79f8a={'raw':![],'where':{'id':_0x4f810e['params']['id']}},_0x466eb0={};_0x466eb0['model']=_[_0x9a6b('0x30')](db['CmCompany'][_0x9a6b('0x42')]);_0x466eb0[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x4f810e[_0x9a6b('0x31')]);_0x466eb0[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x466eb0['model'],_0x466eb0[_0x9a6b('0x31')]);_0xe79f8a['attributes']=_[_0x9a6b('0x33')](_0x466eb0['model'],qs[_0x9a6b('0x35')](_0x4f810e[_0x9a6b('0x31')]['fields']));_0xe79f8a[_0x9a6b('0x34')]=_0xe79f8a[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0xe79f8a[_0x9a6b('0x34')]:_0x466eb0[_0x9a6b('0x2f')];if(_0x4f810e[_0x9a6b('0x31')][_0x9a6b('0x43')]){_0xe79f8a[_0x9a6b('0x3e')]=[{'all':!![]}];}_0xe79f8a=_['merge']({},_0xe79f8a,_0x4f810e[_0x9a6b('0x3d')]);return db[_0x9a6b('0x2e')][_0x9a6b('0x44')](_0xe79f8a)[_0x9a6b('0x25')](handleEntityNotFound(_0x5d2974,null))[_0x9a6b('0x25')](respondWithResult(_0x5d2974,null))[_0x9a6b('0x40')](handleError(_0x5d2974,null));};exports['create']=function(_0x5f5bba,_0x48b54e){return db[_0x9a6b('0x2e')][_0x9a6b('0x45')](_0x5f5bba['body'],{})[_0x9a6b('0x25')](function(_0x25f162){var _0x3f918d=_0x5f5bba[_0x9a6b('0x46')]['get']({'plain':!![]});if(!_0x3f918d)throw new Error(_0x9a6b('0x47'));if(_0x3f918d[_0x9a6b('0x48')]===_0x9a6b('0x46')){var _0x1390c2=_0x25f162[_0x9a6b('0x27')]({'plain':!![]});var _0x2d6d21=_0x9a6b('0x28');return db[_0x9a6b('0x49')][_0x9a6b('0x44')]({'where':{'name':_0x2d6d21,'userProfileId':_0x3f918d['userProfileId']},'raw':!![]})[_0x9a6b('0x25')](function(_0x5e1381){if(_0x5e1381&&_0x5e1381[_0x9a6b('0x4a')]===0x0){return db[_0x9a6b('0x29')][_0x9a6b('0x45')]({'name':_0x1390c2[_0x9a6b('0x2b')],'resourceId':_0x1390c2['id'],'type':_0x5e1381[_0x9a6b('0x2b')],'sectionId':_0x5e1381['id']},{})['then'](function(){return _0x25f162;});}else{return _0x25f162;}})[_0x9a6b('0x40')](function(_0x2882af){logger[_0x9a6b('0x4b')](_0x9a6b('0x4c'),_0x2882af);throw _0x2882af;});}return _0x25f162;})['then'](respondWithResult(_0x48b54e,0xc9))[_0x9a6b('0x40')](handleError(_0x48b54e,null));};exports[_0x9a6b('0x4d')]=function(_0x812e4d,_0x59f3e5){if(_0x812e4d[_0x9a6b('0x4e')]['id']){delete _0x812e4d[_0x9a6b('0x4e')]['id'];}return db[_0x9a6b('0x2e')][_0x9a6b('0x44')]({'where':{'id':_0x812e4d['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x59f3e5,null))['then'](saveUpdates(_0x812e4d[_0x9a6b('0x4e')],null))['then'](respondWithResult(_0x59f3e5,null))['catch'](handleError(_0x59f3e5,null));};exports[_0x9a6b('0x26')]=function(_0x8166be,_0x56c4f4){return db['CmCompany']['find']({'where':{'id':_0x8166be[_0x9a6b('0x4f')]['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x56c4f4,null))[_0x9a6b('0x25')](removeEntity(_0x56c4f4,null))[_0x9a6b('0x40')](handleError(_0x56c4f4,null));};exports['describe']=function(_0x5ae31d,_0x4ca200){return db[_0x9a6b('0x2e')][_0x9a6b('0x50')]()[_0x9a6b('0x25')](respondWithResult(_0x4ca200,null))[_0x9a6b('0x40')](handleError(_0x4ca200,null));};exports[_0x9a6b('0x51')]=function(_0x276373,_0x3f7d3b,_0x133daf){return db[_0x9a6b('0x52')][_0x9a6b('0x44')]({'where':{'id':_0x276373[_0x9a6b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3f7d3b,null))[_0x9a6b('0x25')](function(_0x1dc44c){if(_0x1dc44c){return _0x1dc44c[_0x9a6b('0x51')](_0x276373['body']['ids'],_[_0x9a6b('0x53')](_0x276373[_0x9a6b('0x4e')],[_0x9a6b('0x54'),'id'])||{});}})[_0x9a6b('0x25')](respondWithResult(_0x3f7d3b,null))['catch'](handleError(_0x3f7d3b,null));};exports[_0x9a6b('0x55')]=function(_0x409253,_0x54b6ba,_0x5dfdc9){var _0x42ba25={};var _0x420732={};var _0x3572d0;var _0xd447bb;return db[_0x9a6b('0x2e')]['findOne']({'where':{'id':_0x409253['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x54b6ba,null))['then'](function(_0x57c5e4){if(_0x57c5e4){_0x3572d0=_0x57c5e4;_0x420732[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](db[_0x9a6b('0x52')][_0x9a6b('0x42')]);_0x420732[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x409253[_0x9a6b('0x31')]);_0x420732['filters']=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],_0x420732[_0x9a6b('0x31')]);_0x42ba25[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],qs[_0x9a6b('0x35')](_0x409253[_0x9a6b('0x31')]['fields']));_0x42ba25[_0x9a6b('0x34')]=_0x42ba25['attributes']['length']?_0x42ba25[_0x9a6b('0x34')]:_0x420732[_0x9a6b('0x2f')];_0x42ba25['order']=qs[_0x9a6b('0x39')](_0x409253[_0x9a6b('0x31')]['sort']);_0x42ba25[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_[_0x9a6b('0x56')](_0x409253[_0x9a6b('0x31')],_0x420732[_0x9a6b('0x32')]));if(_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x42ba25[_0x9a6b('0x3a')]=_[_0x9a6b('0x57')](_0x42ba25[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x42ba25['attributes'],function(_0xe2efb){var _0x29ee00={};_0x29ee00[_0xe2efb]={'$like':'%'+_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x29ee00;})});}_0x42ba25=_[_0x9a6b('0x57')]({},_0x42ba25,_0x409253[_0x9a6b('0x3d')]);return _0x3572d0['getContacts'](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x47471e){if(_0x47471e){_0xd447bb=_0x47471e['length'];if(!_0x409253[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x42ba25[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x409253[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x42ba25['offset']=qs[_0x9a6b('0x1e')](_0x409253[_0x9a6b('0x31')]['offset']);}return _0x3572d0[_0x9a6b('0x55')](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x13758a){if(_0x13758a){return _0x13758a?{'count':_0xd447bb,'rows':_0x13758a}:null;}})['then'](respondWithResult(_0x54b6ba,null))[_0x9a6b('0x40')](handleError(_0x54b6ba,null));}; \ No newline at end of file +var _0xbfb8=['../../mysqldb','status','end','offset','undefined','Content-Range','json','apply','reject','save','then','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','count','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','update','destroy','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x44ab0b,_0x4a2fc4){var _0x54f695=function(_0x27da24){while(--_0x27da24){_0x44ab0b['push'](_0x44ab0b['shift']());}};_0x54f695(++_0x4a2fc4);}(_0xbfb8,0x195));var _0x8bfb=function(_0xf7d2be,_0x559b6c){_0xf7d2be=_0xf7d2be-0x0;var _0x1e62c3=_0xbfb8[_0xf7d2be];return _0x1e62c3;};'use strict';var emlformat=require(_0x8bfb('0x0'));var rimraf=require(_0x8bfb('0x1'));var zipdir=require(_0x8bfb('0x2'));var jsonpatch=require(_0x8bfb('0x3'));var rp=require(_0x8bfb('0x4'));var moment=require(_0x8bfb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bfb('0x6'));var util=require('util');var path=require(_0x8bfb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bfb('0x8'));var fs=require('fs');var fs_extra=require(_0x8bfb('0x9'));var _=require(_0x8bfb('0xa'));var squel=require(_0x8bfb('0xb'));var crypto=require(_0x8bfb('0xc'));var jsforce=require(_0x8bfb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8bfb('0xe'));var querystring=require(_0x8bfb('0xf'));var Papa=require(_0x8bfb('0x10'));var Redis=require(_0x8bfb('0x11'));var authService=require(_0x8bfb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8bfb('0x13'));var hardwareService=require(_0x8bfb('0x14'));var logger=require(_0x8bfb('0x15'))(_0x8bfb('0x16'));var utils=require('../../config/utils');var config=require(_0x8bfb('0x17'));var licenseUtil=require(_0x8bfb('0x18'));var db=require(_0x8bfb('0x19'))['db'];function respondWithStatusCode(_0x12dec1,_0x4ac179){_0x4ac179=_0x4ac179||0xcc;return function(_0x4985c5){if(_0x4985c5){return _0x12dec1['sendStatus'](_0x4ac179);}return _0x12dec1[_0x8bfb('0x1a')](_0x4ac179)[_0x8bfb('0x1b')]();};}function respondWithResult(_0x48e8a0,_0x36657f){_0x36657f=_0x36657f||0xc8;return function(_0x52e22b){if(_0x52e22b){return _0x48e8a0[_0x8bfb('0x1a')](_0x36657f)['json'](_0x52e22b);}};}function respondWithFilteredResult(_0x5c615d,_0x31a02c){return function(_0x87c62a){if(_0x87c62a){var _0x1a10ad=typeof _0x31a02c[_0x8bfb('0x1c')]===_0x8bfb('0x1d')&&typeof _0x31a02c['limit']===_0x8bfb('0x1d');var _0xbe5c42=_0x87c62a['count'];var _0x2a7ea2=_0x1a10ad?0x0:_0x31a02c[_0x8bfb('0x1c')];var _0x301c8a=_0x1a10ad?_0x87c62a['count']:_0x31a02c[_0x8bfb('0x1c')]+_0x31a02c['limit'];var _0x4ca033;if(_0x301c8a>=_0xbe5c42){_0x301c8a=_0xbe5c42;_0x4ca033=0xc8;}else{_0x4ca033=0xce;}_0x5c615d[_0x8bfb('0x1a')](_0x4ca033);return _0x5c615d['set'](_0x8bfb('0x1e'),_0x2a7ea2+'-'+_0x301c8a+'/'+_0xbe5c42)[_0x8bfb('0x1f')](_0x87c62a);}return null;};}function patchUpdates(_0xc949c7){return function(_0x2da1c0){try{jsonpatch[_0x8bfb('0x20')](_0x2da1c0,_0xc949c7,!![]);}catch(_0x1e36f0){return BPromise[_0x8bfb('0x21')](_0x1e36f0);}return _0x2da1c0[_0x8bfb('0x22')]();};}function saveUpdates(_0x11d2fa,_0x1220ac){return function(_0x56a39c){if(_0x56a39c){return _0x56a39c['update'](_0x11d2fa)['then'](function(_0x31b718){return _0x31b718;});}return null;};}function removeEntity(_0x1a412b,_0x5a8673){return function(_0x259b18){if(_0x259b18){return _0x259b18['destroy']()[_0x8bfb('0x23')](function(){var _0x4622d7=_0x259b18['get']({'plain':!![]});var _0x2a290c='Companies';return db[_0x8bfb('0x24')]['destroy']({'where':{'type':_0x2a290c,'resourceId':_0x4622d7['id']}})[_0x8bfb('0x23')](function(){return _0x259b18;});})['then'](function(){_0x1a412b[_0x8bfb('0x1a')](0xcc)[_0x8bfb('0x1b')]();});}};}function handleEntityNotFound(_0x2be4de,_0x59e449){return function(_0x539c6b){if(!_0x539c6b){_0x2be4de[_0x8bfb('0x25')](0x194);}return _0x539c6b;};}function handleError(_0x187849,_0x487462){_0x487462=_0x487462||0x1f4;return function(_0x58bd61){logger[_0x8bfb('0x26')](_0x58bd61[_0x8bfb('0x27')]);if(_0x58bd61[_0x8bfb('0x28')]){delete _0x58bd61['name'];}_0x187849[_0x8bfb('0x1a')](_0x487462)[_0x8bfb('0x29')](_0x58bd61);};}exports[_0x8bfb('0x2a')]=function(_0x5bef19,_0xd6e3fe){var _0x5dfd1b={},_0x1b27da={},_0x6bd547={'count':0x0,'rows':[]};return db[_0x8bfb('0x2b')][_0x8bfb('0x2c')]()[_0x8bfb('0x23')](function(_0x48a054){_0x1b27da[_0x8bfb('0x2d')]=_[_0x8bfb('0x2e')](_0x48a054);_0x1b27da[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x5bef19[_0x8bfb('0x2f')]);_0x1b27da[_0x8bfb('0x30')]=_[_0x8bfb('0x31')](_0x1b27da[_0x8bfb('0x2d')],_0x1b27da[_0x8bfb('0x2f')]);_0x5dfd1b[_0x8bfb('0x32')]=_['intersection'](_0x1b27da[_0x8bfb('0x2d')],qs['fields'](_0x5bef19['query'][_0x8bfb('0x33')]));_0x5dfd1b[_0x8bfb('0x32')]=_0x5dfd1b[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x5dfd1b[_0x8bfb('0x32')]:_0x1b27da[_0x8bfb('0x2d')];if(!_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x35')](_0x8bfb('0x36'))){_0x5dfd1b[_0x8bfb('0x37')]=qs[_0x8bfb('0x37')](_0x5bef19['query']['limit']);_0x5dfd1b[_0x8bfb('0x1c')]=qs['offset'](_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x1c')]);}_0x5dfd1b['order']=qs[_0x8bfb('0x38')](_0x5bef19['query'][_0x8bfb('0x38')]);_0x5dfd1b[_0x8bfb('0x39')]=qs[_0x8bfb('0x30')](_['pick'](_0x5bef19['query'],_0x1b27da[_0x8bfb('0x30')]),_0x48a054);if(_0x5bef19['query'][_0x8bfb('0x3a')]){_0x5dfd1b['where']=_[_0x8bfb('0x3b')](_0x5dfd1b[_0x8bfb('0x39')],{'$or':_[_0x8bfb('0x3c')](_0x5dfd1b[_0x8bfb('0x32')],function(_0x485f38){var _0x4e7a15={};_0x4e7a15[_0x485f38]={'$like':'%'+_0x5bef19[_0x8bfb('0x2f')]['filter']+'%'};return _0x4e7a15;})});}_0x5dfd1b=_['merge']({},_0x5dfd1b,_0x5bef19['options']);var _0xbffa9d={'where':_0x5dfd1b['where']};return db[_0x8bfb('0x2b')][_0x8bfb('0x3d')](_0xbffa9d)[_0x8bfb('0x23')](function(_0x4b2163){_0x6bd547[_0x8bfb('0x3d')]=_0x4b2163;if(_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x3e')]){_0x5dfd1b['include']=[{'all':!![]}];}return db[_0x8bfb('0x2b')]['findAll'](_0x5dfd1b);})[_0x8bfb('0x23')](function(_0x2855f6){_0x6bd547[_0x8bfb('0x3f')]=_0x2855f6;return _0x6bd547;})[_0x8bfb('0x23')](respondWithFilteredResult(_0xd6e3fe,_0x5dfd1b))[_0x8bfb('0x40')](handleError(_0xd6e3fe,null));})[_0x8bfb('0x40')](handleError(_0xd6e3fe,null));};exports[_0x8bfb('0x41')]=function(_0x4d5806,_0x527421){var _0x19f42e={'raw':![],'where':{'id':_0x4d5806[_0x8bfb('0x42')]['id']}},_0x5dbe5d={};_0x5dbe5d[_0x8bfb('0x2d')]=_['keys'](db[_0x8bfb('0x2b')][_0x8bfb('0x43')]);_0x5dbe5d[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x4d5806[_0x8bfb('0x2f')]);_0x5dbe5d[_0x8bfb('0x30')]=_['intersection'](_0x5dbe5d['model'],_0x5dbe5d[_0x8bfb('0x2f')]);_0x19f42e[_0x8bfb('0x32')]=_[_0x8bfb('0x31')](_0x5dbe5d['model'],qs[_0x8bfb('0x33')](_0x4d5806[_0x8bfb('0x2f')][_0x8bfb('0x33')]));_0x19f42e['attributes']=_0x19f42e[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x19f42e[_0x8bfb('0x32')]:_0x5dbe5d[_0x8bfb('0x2d')];if(_0x4d5806[_0x8bfb('0x2f')][_0x8bfb('0x3e')]){_0x19f42e[_0x8bfb('0x44')]=[{'all':!![]}];}_0x19f42e=_['merge']({},_0x19f42e,_0x4d5806[_0x8bfb('0x45')]);return db['CmCompany'][_0x8bfb('0x46')](_0x19f42e)['then'](handleEntityNotFound(_0x527421,null))[_0x8bfb('0x23')](respondWithResult(_0x527421,null))[_0x8bfb('0x40')](handleError(_0x527421,null));};exports['create']=function(_0x36742e,_0x97f27a){return db[_0x8bfb('0x2b')][_0x8bfb('0x47')](_0x36742e[_0x8bfb('0x48')],{})['then'](function(_0x567824){var _0x1f2bf2=_0x36742e['user'][_0x8bfb('0x49')]({'plain':!![]});if(!_0x1f2bf2)throw new Error(_0x8bfb('0x4a'));if(_0x1f2bf2[_0x8bfb('0x4b')]==='user'){var _0x1b2ef5=_0x567824[_0x8bfb('0x49')]({'plain':!![]});var _0x38e2aa=_0x8bfb('0x4c');return db[_0x8bfb('0x4d')][_0x8bfb('0x46')]({'where':{'name':_0x38e2aa,'userProfileId':_0x1f2bf2['userProfileId']},'raw':!![]})[_0x8bfb('0x23')](function(_0x173ca1){if(_0x173ca1&&_0x173ca1[_0x8bfb('0x4e')]===0x0){return db[_0x8bfb('0x24')][_0x8bfb('0x47')]({'name':_0x1b2ef5[_0x8bfb('0x28')],'resourceId':_0x1b2ef5['id'],'type':_0x173ca1[_0x8bfb('0x28')],'sectionId':_0x173ca1['id']},{})[_0x8bfb('0x23')](function(){return _0x567824;});}else{return _0x567824;}})['catch'](function(_0x24a89d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24a89d);throw _0x24a89d;});}return _0x567824;})[_0x8bfb('0x23')](respondWithResult(_0x97f27a,0xc9))[_0x8bfb('0x40')](handleError(_0x97f27a,null));};exports[_0x8bfb('0x4f')]=function(_0x429620,_0x2a731d){if(_0x429620['body']['id']){delete _0x429620[_0x8bfb('0x48')]['id'];}return db[_0x8bfb('0x2b')][_0x8bfb('0x46')]({'where':{'id':_0x429620[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x2a731d,null))['then'](saveUpdates(_0x429620['body'],null))[_0x8bfb('0x23')](respondWithResult(_0x2a731d,null))[_0x8bfb('0x40')](handleError(_0x2a731d,null));};exports[_0x8bfb('0x50')]=function(_0x13754b,_0x24ae60){return db[_0x8bfb('0x2b')][_0x8bfb('0x46')]({'where':{'id':_0x13754b[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x24ae60,null))['then'](removeEntity(_0x24ae60,null))[_0x8bfb('0x40')](handleError(_0x24ae60,null));};exports['describe']=function(_0x1121e7,_0x353e64){return db[_0x8bfb('0x2b')][_0x8bfb('0x2c')]()[_0x8bfb('0x23')](respondWithResult(_0x353e64,null))[_0x8bfb('0x40')](handleError(_0x353e64,null));};exports[_0x8bfb('0x51')]=function(_0x44360d,_0x5a63c9,_0xd1099b){return db[_0x8bfb('0x52')][_0x8bfb('0x46')]({'where':{'id':_0x44360d[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x5a63c9,null))['then'](function(_0x90d476){if(_0x90d476){return _0x90d476['addContacts'](_0x44360d[_0x8bfb('0x48')][_0x8bfb('0x53')],_[_0x8bfb('0x54')](_0x44360d[_0x8bfb('0x48')],[_0x8bfb('0x53'),'id'])||{});}})[_0x8bfb('0x23')](respondWithResult(_0x5a63c9,null))[_0x8bfb('0x40')](handleError(_0x5a63c9,null));};exports['getContacts']=function(_0x405c91,_0x1a6631,_0x50715f){var _0x378879={};var _0x566903={};var _0x8ac9ce;var _0xbfb29b;return db[_0x8bfb('0x2b')]['findOne']({'where':{'id':_0x405c91[_0x8bfb('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a6631,null))['then'](function(_0x23d001){if(_0x23d001){_0x8ac9ce=_0x23d001;_0x566903[_0x8bfb('0x2d')]=_[_0x8bfb('0x2e')](db[_0x8bfb('0x52')][_0x8bfb('0x43')]);_0x566903[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x405c91[_0x8bfb('0x2f')]);_0x566903[_0x8bfb('0x30')]=_[_0x8bfb('0x31')](_0x566903[_0x8bfb('0x2d')],_0x566903[_0x8bfb('0x2f')]);_0x378879[_0x8bfb('0x32')]=_[_0x8bfb('0x31')](_0x566903[_0x8bfb('0x2d')],qs[_0x8bfb('0x33')](_0x405c91['query'][_0x8bfb('0x33')]));_0x378879[_0x8bfb('0x32')]=_0x378879[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x378879[_0x8bfb('0x32')]:_0x566903[_0x8bfb('0x2d')];_0x378879['order']=qs[_0x8bfb('0x38')](_0x405c91['query'][_0x8bfb('0x38')]);_0x378879[_0x8bfb('0x39')]=qs[_0x8bfb('0x30')](_['pick'](_0x405c91[_0x8bfb('0x2f')],_0x566903['filters']));if(_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x3a')]){_0x378879[_0x8bfb('0x39')]=_[_0x8bfb('0x3b')](_0x378879[_0x8bfb('0x39')],{'$or':_['map'](_0x378879[_0x8bfb('0x32')],function(_0x1d1312){var _0x360210={};_0x360210[_0x1d1312]={'$like':'%'+_0x405c91[_0x8bfb('0x2f')]['filter']+'%'};return _0x360210;})});}_0x378879=_[_0x8bfb('0x3b')]({},_0x378879,_0x405c91[_0x8bfb('0x45')]);return _0x8ac9ce[_0x8bfb('0x55')](_0x378879);}})[_0x8bfb('0x23')](function(_0x5580c0){if(_0x5580c0){_0xbfb29b=_0x5580c0[_0x8bfb('0x34')];if(!_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x35')]('nolimit')){_0x378879[_0x8bfb('0x37')]=qs[_0x8bfb('0x37')](_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x37')]);_0x378879['offset']=qs[_0x8bfb('0x1c')](_0x405c91['query'][_0x8bfb('0x1c')]);}return _0x8ac9ce['getContacts'](_0x378879);}})['then'](function(_0x32daf5){if(_0x32daf5){return _0x32daf5?{'count':_0xbfb29b,'rows':_0x32daf5}:null;}})['then'](respondWithResult(_0x1a6631,null))['catch'](handleError(_0x1a6631,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 207ec88..6b916d1 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 _0x4edd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api'];(function(_0x3a450c,_0x9dced0){var _0x23a746=function(_0x34ac8a){while(--_0x34ac8a){_0x3a450c['push'](_0x3a450c['shift']());}};_0x23a746(++_0x9dced0);}(_0x4edd,0x193));var _0xd4ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4edd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4ed('0x0'));var util=require(_0xd4ed('0x1'));var logger=require('../../config/logger')(_0xd4ed('0x2'));var moment=require(_0xd4ed('0x3'));var BPromise=require(_0xd4ed('0x4'));var rp=require(_0xd4ed('0x5'));var fs=require('fs');var path=require(_0xd4ed('0x6'));var rimraf=require(_0xd4ed('0x7'));var config=require(_0xd4ed('0x8'));var attributes=require(_0xd4ed('0x9'));module[_0xd4ed('0xa')]=function(_0x56bc60,_0x27495c){return _0x56bc60[_0xd4ed('0xb')](_0xd4ed('0xc'),attributes,{'tableName':_0xd4ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42cd=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','define','CmCompany','cm_companies'];(function(_0x4d168e,_0x2c6b65){var _0x2009e1=function(_0x51b144){while(--_0x51b144){_0x4d168e['push'](_0x4d168e['shift']());}};_0x2009e1(++_0x2c6b65);}(_0x42cd,0xf0));var _0xd42c=function(_0x3282a2,_0xb4b2c9){_0x3282a2=_0x3282a2-0x0;var _0xdec417=_0x42cd[_0x3282a2];return _0xdec417;};'use strict';var _=require(_0xd42c('0x0'));var util=require(_0xd42c('0x1'));var logger=require(_0xd42c('0x2'))(_0xd42c('0x3'));var moment=require('moment');var BPromise=require(_0xd42c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd42c('0x5'));var rimraf=require('rimraf');var config=require(_0xd42c('0x6'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x29bc09,_0xa3d6f){return _0x29bc09[_0xd42c('0x7')](_0xd42c('0x8'),attributes,{'tableName':_0xd42c('0x9'),'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 ceba313..18ea631 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 _0xafe5=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xafe5,0x15f));var _0x5afe=function(_0x1c63b2,_0x44eb5b){_0x1c63b2=_0x1c63b2-0x0;var _0x3fa7b8=_0xafe5[_0x1c63b2];return _0x3fa7b8;};'use strict';var _=require(_0x5afe('0x0'));var util=require(_0x5afe('0x1'));var moment=require(_0x5afe('0x2'));var BPromise=require('bluebird');var rs=require(_0x5afe('0x3'));var fs=require('fs');var Redis=require(_0x5afe('0x4'));var db=require(_0x5afe('0x5'))['db'];var utils=require(_0x5afe('0x6'));var logger=require(_0x5afe('0x7'))('rpc');var config=require(_0x5afe('0x8'));var jayson=require(_0x5afe('0x9'));var client=jayson[_0x5afe('0xa')][_0x5afe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbaf35a,_0x18b10c,_0x597ad4){return new BPromise(function(_0x358b1f,_0xa7246){return client[_0x5afe('0xc')](_0xbaf35a,_0x597ad4)['then'](function(_0x723804){logger[_0x5afe('0xd')]('CmCompany,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'));logger[_0x5afe('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'),JSON[_0x5afe('0x10')](_0x723804));if(_0x723804[_0x5afe('0x11')]){if(_0x723804[_0x5afe('0x11')][_0x5afe('0x12')]===0x1f4){logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804['error']['message']);return _0xa7246(_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);}logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);return _0x358b1f(_0x723804[_0x5afe('0x11')]['message']);}else{logger[_0x5afe('0xd')](_0x5afe('0x13'),_0x18b10c,_0x5afe('0xe'));_0x358b1f(_0x723804[_0x5afe('0x15')][_0x5afe('0x14')]);}})['catch'](function(_0x516978){logger[_0x5afe('0x11')](_0x5afe('0x13'),_0x18b10c,_0x516978);_0xa7246(_0x516978);});});} \ No newline at end of file +var _0xa59f=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa59f,0x16b));var _0xfa59=function(_0x51fe46,_0xb550d1){_0x51fe46=_0x51fe46-0x0;var _0x4d62c2=_0xa59f[_0x51fe46];return _0x4d62c2;};'use strict';var _=require(_0xfa59('0x0'));var util=require(_0xfa59('0x1'));var moment=require(_0xfa59('0x2'));var BPromise=require(_0xfa59('0x3'));var rs=require(_0xfa59('0x4'));var fs=require('fs');var Redis=require(_0xfa59('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfa59('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa59('0x7')][_0xfa59('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x345d54,_0x2af8f9,_0xfcb4e7){return new BPromise(function(_0x262e83,_0x137313){return client[_0xfa59('0x9')](_0x345d54,_0xfcb4e7)['then'](function(_0x235563){logger[_0xfa59('0xa')](_0xfa59('0xb'),_0x2af8f9,'request\x20sent');logger[_0xfa59('0xc')](_0xfa59('0xd'),_0x2af8f9,'request\x20sent',JSON[_0xfa59('0xe')](_0x235563));if(_0x235563[_0xfa59('0xf')]){if(_0x235563[_0xfa59('0xf')][_0xfa59('0x10')]===0x1f4){logger['error'](_0xfa59('0xb'),_0x2af8f9,_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);return _0x137313(_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);}logger[_0xfa59('0xf')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0x235563['error'][_0xfa59('0x11')]);return _0x262e83(_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);}else{logger[_0xfa59('0xa')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0xfa59('0x12'));_0x262e83(_0x235563[_0xfa59('0x13')]['message']);}})[_0xfa59('0x14')](function(_0x3e7983){logger[_0xfa59('0xf')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0x3e7983);_0x137313(_0x3e7983);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 6cb6424..30bf0e2 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 _0x63a9=['get','index','/describe','isAuthenticated','/:id','/:id/contacts','getContacts','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0x1823a0,_0x38947d){var _0x2b780c=function(_0x39d289){while(--_0x39d289){_0x1823a0['push'](_0x1823a0['shift']());}};_0x2b780c(++_0x38947d);}(_0x63a9,0x14f));var _0x963a=function(_0x5649c3,_0x111ee5){_0x5649c3=_0x5649c3-0x0;var _0x4006aa=_0x63a9[_0x5649c3];return _0x4006aa;};'use strict';var multer=require(_0x963a('0x0'));var util=require('util');var path=require(_0x963a('0x1'));var timeout=require(_0x963a('0x2'));var express=require(_0x963a('0x3'));var router=express[_0x963a('0x4')]();var fs_extra=require(_0x963a('0x5'));var auth=require(_0x963a('0x6'));var interaction=require(_0x963a('0x7'));var config=require(_0x963a('0x8'));var controller=require(_0x963a('0x9'));router[_0x963a('0xa')]('/',auth['isAuthenticated'](),controller[_0x963a('0xb')]);router['get'](_0x963a('0xc'),auth[_0x963a('0xd')](),controller['describe']);router['get'](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['show']);router[_0x963a('0xa')](_0x963a('0xf'),auth['isAuthenticated'](),controller[_0x963a('0x10')]);router[_0x963a('0x11')]('/',auth[_0x963a('0xd')](),controller[_0x963a('0x12')]);router[_0x963a('0x11')]('/:id/contacts',auth[_0x963a('0xd')](),controller['addContacts']);router[_0x963a('0x13')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['update']);router[_0x963a('0x14')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller[_0x963a('0x15')]);module[_0x963a('0x16')]=router; \ No newline at end of file +var _0x2477=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','post','addContacts'];(function(_0x371a41,_0x2a19cc){var _0x360d99=function(_0x17a760){while(--_0x17a760){_0x371a41['push'](_0x371a41['shift']());}};_0x360d99(++_0x2a19cc);}(_0x2477,0x138));var _0x7247=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x2477[_0x3bef2c];return _0x331503;};'use strict';var multer=require(_0x7247('0x0'));var util=require(_0x7247('0x1'));var path=require(_0x7247('0x2'));var timeout=require(_0x7247('0x3'));var express=require(_0x7247('0x4'));var router=express[_0x7247('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7247('0x6'));var interaction=require(_0x7247('0x7'));var config=require('../../config/environment');var controller=require(_0x7247('0x8'));router[_0x7247('0x9')]('/',auth[_0x7247('0xa')](),controller[_0x7247('0xb')]);router[_0x7247('0x9')](_0x7247('0xc'),auth[_0x7247('0xa')](),controller[_0x7247('0xd')]);router[_0x7247('0x9')]('/:id',auth[_0x7247('0xa')](),controller[_0x7247('0xe')]);router[_0x7247('0x9')](_0x7247('0xf'),auth[_0x7247('0xa')](),controller['getContacts']);router['post']('/',auth[_0x7247('0xa')](),controller['create']);router[_0x7247('0x10')]('/:id/contacts',auth[_0x7247('0xa')](),controller[_0x7247('0x11')]);router[_0x7247('0x12')]('/:id',auth[_0x7247('0xa')](),controller[_0x7247('0x13')]);router[_0x7247('0x14')]('/:id',auth[_0x7247('0xa')](),controller['destroy']);module[_0x7247('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index b90de5b..6121b3a 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 _0xc43e=['INTEGER','sequelize','STRING','TEXT','UNSIGNED','DATE','NOW'];(function(_0x143bb3,_0x3b1ff9){var _0x358977=function(_0x12743d){while(--_0x12743d){_0x143bb3['push'](_0x143bb3['shift']());}};_0x358977(++_0x3b1ff9);}(_0xc43e,0x13c));var _0xec43=function(_0xdfdcec,_0x5e4bc5){_0xdfdcec=_0xdfdcec-0x0;var _0x4dfb91=_0xc43e[_0xdfdcec];return _0x4dfb91;};'use strict';var _=require('lodash');var Sequelize=require(_0xec43('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xec43('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xec43('0x1')]},'street':{'type':Sequelize[_0xec43('0x1')]},'postalCode':{'type':Sequelize[_0xec43('0x1')]},'city':{'type':Sequelize[_0xec43('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xec43('0x1')]},'description':{'type':Sequelize[_0xec43('0x2')]},'phone':{'type':Sequelize[_0xec43('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xec43('0x1')]},'email':{'type':Sequelize[_0xec43('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xec43('0x1')]},'fb_data':{'type':Sequelize[_0xec43('0x1')]},'twitter':{'type':Sequelize[_0xec43('0x1')]},'skype':{'type':Sequelize[_0xec43('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xec43('0x1')]},'telegram':{'type':Sequelize[_0xec43('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xec43('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xec43('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xec43('0x4')],'defaultValue':Sequelize[_0xec43('0x5')]},'dialTimezone':{'type':Sequelize[_0xec43('0x1')]},'utcOffset':{'type':Sequelize[_0xec43('0x6')]}}; \ No newline at end of file +var _0x80c1=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x80c1,0x68));var _0x180c=function(_0x437c62,_0x593e7a){_0x437c62=_0x437c62-0x0;var _0x6fb267=_0x80c1[_0x437c62];return _0x6fb267;};'use strict';var _=require('lodash');var Sequelize=require(_0x180c('0x0'));module[_0x180c('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x180c('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x180c('0x2')]},'country':{'type':Sequelize[_0x180c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x180c('0x2')]},'description':{'type':Sequelize[_0x180c('0x3')]},'phone':{'type':Sequelize[_0x180c('0x2')]},'mobile':{'type':Sequelize[_0x180c('0x2')]},'fax':{'type':Sequelize[_0x180c('0x2')]},'email':{'type':Sequelize[_0x180c('0x2')]},'url':{'type':Sequelize[_0x180c('0x2')]},'facebook':{'type':Sequelize[_0x180c('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x180c('0x2')]},'skype':{'type':Sequelize[_0x180c('0x2')]},'teams':{'type':Sequelize[_0x180c('0x2')]},'viber':{'type':Sequelize[_0x180c('0x2')]},'line':{'type':Sequelize[_0x180c('0x2')]},'wechat':{'type':Sequelize[_0x180c('0x2')]},'telegram':{'type':Sequelize[_0x180c('0x2')]},'UserId':{'type':Sequelize[_0x180c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x180c('0x2')]},'priority':{'type':Sequelize[_0x180c('0x4')](0x2)[_0x180c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x180c('0x6')],'defaultValue':Sequelize[_0x180c('0x7')]},'dialTimezone':{'type':Sequelize[_0x180c('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e6c4b68..8ffb047 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 697f449..4eeed9a 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 _0xb243=['CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x399b76,_0x796fe7){var _0x51d0e6=function(_0x5d31e5){while(--_0x5d31e5){_0x399b76['push'](_0x399b76['shift']());}};_0x51d0e6(++_0x796fe7);}(_0xb243,0x1b6));var _0x3b24=function(_0x31fd29,_0x2586ea){_0x31fd29=_0x31fd29-0x0;var _0x3a3aef=_0xb243[_0x31fd29];return _0x3a3aef;};'use strict';var EventEmitter=require(_0x3b24('0x0'));var CmContact=require(_0x3b24('0x1'))['db'][_0x3b24('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3b24('0x3')](0x0);var events={'afterCreate':_0x3b24('0x4'),'afterUpdate':_0x3b24('0x5'),'afterDestroy':_0x3b24('0x6')};function emitEvent(_0x4dd9c6){return function(_0x264757,_0x1e40cb,_0x3c1ced){CmContactEvents[_0x3b24('0x7')](_0x4dd9c6+':'+_0x264757['id'],_0x264757);CmContactEvents[_0x3b24('0x7')](_0x4dd9c6,_0x264757);_0x3c1ced(null);};}for(var e in events){if(events[_0x3b24('0x8')](e)){var event=events[e];CmContact[_0x3b24('0x9')](e,emitEvent(event));}}module[_0x3b24('0xa')]=CmContactEvents; \ No newline at end of file +var _0x7340=['exports','events','CmContact','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7340,0x10f));var _0x0734=function(_0x1ad48e,_0x3ba0bb){_0x1ad48e=_0x1ad48e-0x0;var _0x2bdbc4=_0x7340[_0x1ad48e];return _0x2bdbc4;};'use strict';var EventEmitter=require(_0x0734('0x0'));var CmContact=require('../../mysqldb')['db'][_0x0734('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0734('0x2')](0x0);var events={'afterCreate':_0x0734('0x3'),'afterUpdate':'update','afterDestroy':_0x0734('0x4')};function emitEvent(_0x2295e1){return function(_0x1a5413,_0x5163a8,_0x105671){CmContactEvents[_0x0734('0x5')](_0x2295e1+':'+_0x1a5413['id'],_0x1a5413);CmContactEvents[_0x0734('0x5')](_0x2295e1,_0x1a5413);_0x105671(null);};}for(var e in events){if(events[_0x0734('0x6')](e)){var event=events[e];CmContact[_0x0734('0x7')](e,emitEvent(event));}}module[_0x0734('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 07a144c..e91835c 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 _0x3015=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','error','cmContact','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\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','dialCheckDuplicateType','CmList','always','onlyIfOpen','outbound','cmContact,\x20%s,\x20%s','message','Campaign','Lists','length','findAll','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','afterCreate','inspect','scheduledat','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','format','YYYY-MM-DD\x20HH:mm:ss','ret','CmHopper','cmContact,\x20afterCreate\x20'];(function(_0x352b44,_0x4a91a1){var _0x3e8baa=function(_0xed4bc3){while(--_0xed4bc3){_0x352b44['push'](_0x352b44['shift']());}};_0x3e8baa(++_0x4a91a1);}(_0x3015,0x69));var _0x5301=function(_0x5a1111,_0x372ebb){_0x5a1111=_0x5a1111-0x0;var _0x1e4fc9=_0x3015[_0x5a1111];return _0x1e4fc9;};'use strict';var _=require(_0x5301('0x0'));var util=require(_0x5301('0x1'));var logger=require(_0x5301('0x2'))(_0x5301('0x3'));var moment=require('moment');var BPromise=require(_0x5301('0x4'));var rp=require(_0x5301('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5301('0x6'));var config=require(_0x5301('0x7'));var shared=require(_0x5301('0x8'));var attributes=require(_0x5301('0x9'));module[_0x5301('0xa')]=function(_0x4d81b8,_0x3f7bc6){return _0x4d81b8['define'](_0x5301('0xb'),attributes,{'tableName':_0x5301('0xc'),'paranoid':!![],'indexes':[{'name':_0x5301('0xd'),'fields':['phone']},{'name':_0x5301('0xe'),'fields':[_0x5301('0xf'),_0x5301('0x10'),_0x5301('0xd'),'mobile',_0x5301('0x11'),'email'],'type':_0x5301('0x12')}],'timestamps':!![],'charset':_0x5301('0x13'),'collate':_0x5301('0x14'),'hooks':{'afterCreate':function(_0x5e0030,_0x4fb725,_0x110bbb){var _0x2df62c=_0x4d81b8[_0x5301('0x15')];var _0xbeb64b=_0x5e0030[_0x5301('0x16')]({'plain':!![]});function _0x547d76(){return function(_0x2e5d46){logger['error']('cmContact',_0x5301('0x17'),util[_0x5301('0x18')](_0x2e5d46,{'showHidden':![],'depth':null}));};}function _0x2c8fe6(_0x3f6cab,_0x433af4){var _0x1b396f=_0x433af4[_0x5301('0x19')]?_0x433af4['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2ee689,_0x1e7424){if(_[_0x5301('0x1a')](_0x433af4[_0x5301('0x1b')])){_0x2ee689({'ret':_0x1b396f});}else{_0x2df62c[_0x5301('0x1c')][_0x5301('0x1d')]({'where':{'id':_0x3f6cab['id']}})[_0x5301('0x1e')](function(_0x484d7a){if(!_[_0x5301('0x1a')](_0x484d7a)){var _0xfa2286=_0x484d7a[_0x5301('0x1b')];if(!_[_0x5301('0x1a')](_0xfa2286)){var _0x32e121=shared[_0x5301('0x1f')];var _0x2e3cf7=_0x32e121[_0xfa2286];var _0x312ed8=_0x32e121[_0x433af4[_0x5301('0x1b')]];if(!_[_0x5301('0x1a')](_0x2e3cf7)&&!_['isNil'](_0x312ed8)){var _0x15547e=_0x2e3cf7['utcOffset']-_0x312ed8[_0x5301('0x20')];_0x1b396f=_0x433af4[_0x5301('0x19')]?_0x433af4['scheduledat']:moment();var _0x56f0a3=moment(_0x1b396f)['add'](_0x15547e,_0x5301('0x21'));_0x2ee689({'ret':_0x56f0a3[_0x5301('0x22')](_0x5301('0x23'))});}else _0x2ee689({'ret':_0x1b396f});}else _0x2ee689({'ret':_0x1b396f});}else{_0x2ee689({'ret':_0x1b396f});}});}});return 0xa;}var _0x3f8219=function(_0x4cf944){return new BPromise(function(_0x2cb919,_0x441db0){_0x2c8fe6(_0x4cf944,_0xbeb64b)[_0x5301('0x1e')](function(_0x1f47ba){_0xbeb64b['scheduledat']=_0x1f47ba[_0x5301('0x24')];_0x2df62c[_0x5301('0x25')]['findOne']({'where':{'phone':_0xbeb64b[_0x5301('0xd')],'VoiceQueueId':_0x4cf944['id']}})['then'](function(_0x2a3231){if(!_[_0x5301('0x1a')](_0x2a3231)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x27')+_0x4cf944['id']);}return _0x2df62c[_0x5301('0x25')]['create']({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b['priority']:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()[_0x5301('0x22')](_0x5301('0x23')),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b[_0x5301('0x2a')]?moment()['format'](_0x5301('0x23')):undefined,'VoiceQueueId':_0x4cf944['id']});})[_0x5301('0x2b')](function(_0x574ef3){_0x441db0(_0x574ef3);});});});};var _0x32a419=function(_0x3213d3){return new BPromise(function(_0x5a202a,_0x25afd0){_0x2c8fe6(_0x3213d3,_0xbeb64b)[_0x5301('0x1e')](function(_0x4d950a){_0xbeb64b[_0x5301('0x19')]=_0x4d950a[_0x5301('0x24')];_0x2df62c[_0x5301('0x25')][_0x5301('0x1d')]({'where':{'phone':_0xbeb64b[_0x5301('0xd')],'VoiceQueueId':_0x3213d3['id']}})[_0x5301('0x1e')](function(_0xd6e8e){if(!_[_0x5301('0x1a')](_0xd6e8e)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x2c')+_0x3213d3['id']);}return _0x2df62c['CmHopperFinal'][_0x5301('0x1d')]({'where':{'calleridnum':_0xbeb64b[_0x5301('0xd')],'VoiceQueueId':_0x3213d3['id']}});})[_0x5301('0x1e')](function(_0x5d4ad3){if(!_[_0x5301('0x1a')](_0x5d4ad3)){throw new Error(_0x5301('0x2d')+_0xbeb64b['phone']+_0x5301('0x2e')+_0x3213d3['id']);}return _0x2df62c[_0x5301('0x25')][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()['format'](_0x5301('0x23')),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b['callbackUniqueid']?moment()[_0x5301('0x22')](_0x5301('0x23')):undefined,'VoiceQueueId':_0x3213d3['id']});})[_0x5301('0x2b')](function(_0x1c526c){_0x25afd0(_0x1c526c);});});});};function _0x399751(){return function(_0xb01551){logger[_0x5301('0x30')](_0x5301('0x31'),_0x5301('0x17'),util[_0x5301('0x18')](_0xb01551,{'showHidden':![],'depth':null}));};}function _0x4df74f(_0x5e7ce9,_0x1c5529){var _0x299950=_0x1c5529['scheduledat']?_0x1c5529[_0x5301('0x19')]:moment()[_0x5301('0x22')](_0x5301('0x23'));return new BPromise(function(_0x1bea1f,_0x44fde3){if(_[_0x5301('0x1a')](_0x1c5529[_0x5301('0x1b')])){_0x1bea1f({'ret':_0x299950});}else{_0x2df62c['Campaign']['findOne']({'where':{'id':_0x5e7ce9['id']}})['then'](function(_0x305a82){if(!_['isNil'](_0x305a82)){var _0x2f9d95=_0x305a82[_0x5301('0x1b')];if(!_[_0x5301('0x1a')](_0x2f9d95)){var _0x59acfb=shared[_0x5301('0x1f')];var _0x57d062=_0x59acfb[_0x2f9d95];var _0x56410c=_0x59acfb[_0x1c5529[_0x5301('0x1b')]];if(!_[_0x5301('0x1a')](_0x57d062)&&!_[_0x5301('0x1a')](_0x56410c)){var _0x3f568b=_0x57d062[_0x5301('0x20')]-_0x56410c[_0x5301('0x20')];_0x299950=_0x1c5529[_0x5301('0x19')]?_0x1c5529[_0x5301('0x19')]:moment();var _0x4aa0ff=moment(_0x299950)[_0x5301('0x32')](_0x3f568b,'minutes');_0x1bea1f({'ret':_0x4aa0ff[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1bea1f({'ret':_0x299950});}else _0x1bea1f({'ret':_0x299950});}else{_0x1bea1f({'ret':_0x299950});}});}});return 0xa;}var _0x39d0f3=function(_0x2badba){return new BPromise(function(_0x2a1b48,_0x199587){_0x4df74f(_0x2badba,_0xbeb64b)[_0x5301('0x1e')](function(_0x9a78bd){_0xbeb64b[_0x5301('0x19')]=_0x9a78bd[_0x5301('0x24')];_0x2df62c[_0x5301('0x25')][_0x5301('0x1d')]({'where':{'phone':_0xbeb64b['phone'],'CampaignId':_0x2badba['id']}})[_0x5301('0x1e')](function(_0x28bec2){if(!_[_0x5301('0x1a')](_0x28bec2)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x33')+_0x2badba['id']);}return _0x2df62c[_0x5301('0x25')][_0x5301('0x2f')]({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b['priority']:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b['scheduledat']:moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b[_0x5301('0x2a')]?moment()['format'](_0x5301('0x23')):undefined,'CampaignId':_0x2badba['id']});})[_0x5301('0x2b')](function(_0x33885c){_0x199587(_0x33885c);});});});};var _0x4516f4=function(_0x4cdf25){return new BPromise(function(_0xfa6b82,_0x49b031){_0x4df74f(_0x4cdf25,_0xbeb64b)[_0x5301('0x1e')](function(_0x1119a4){_0xbeb64b['scheduledat']=_0x1119a4['ret'];_0x2df62c[_0x5301('0x25')][_0x5301('0x1d')]({'where':{'phone':_0xbeb64b[_0x5301('0xd')],'CampaignId':_0x4cdf25['id']}})[_0x5301('0x1e')](function(_0x467cfa){if(!_[_0x5301('0x1a')](_0x467cfa)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x34')+_0x4cdf25['id']);}return _0x2df62c['CmHopperFinal'][_0x5301('0x1d')]({'where':{'calleridnum':_0xbeb64b[_0x5301('0xd')],'CampaignId':_0x4cdf25['id']}});})[_0x5301('0x1e')](function(_0x10d4c0){if(!_[_0x5301('0x1a')](_0x10d4c0)){throw new Error(_0x5301('0x2d')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x35')+_0x4cdf25['id']);}return _0x2df62c[_0x5301('0x25')][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b['ListId'],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b[_0x5301('0x2a')]:undefined,'callbackat':_0xbeb64b['callbackUniqueid']?moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4cdf25['id']});})[_0x5301('0x2b')](function(_0x5246ca){_0x49b031(_0x5246ca);});});});};if(_0xbeb64b['ListId']){_0x2df62c[_0x5301('0x1c')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x5301('0x36'),_0x5301('0x1b')],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':'Lists','where':{'id':_0xbeb64b['ListId']}}]})[_0x5301('0x1e')](function(_0x516ce2){if(_0x516ce2){var _0x76b815=[];for(var _0x36f54d=0x0,_0x2165de;_0x36f54d<_0x516ce2['length'];_0x36f54d+=0x1){_0x2165de=_0x516ce2[_0x36f54d][_0x5301('0x16')]({'plain':!![]});switch(_0x2165de['dialCheckDuplicateType']){case _0x5301('0x38'):_0x32a419(_0x2165de)[_0x5301('0x2b')](_0x547d76());break;case _0x5301('0x39'):_0x3f8219(_0x2165de)['catch'](_0x547d76());break;default:_0x4df74f(_0x2165de,_0xbeb64b)[_0x5301('0x1e')](function(_0x34f160){_0xbeb64b[_0x5301('0x19')]=_0x34f160[_0x5301('0x24')];_0x2df62c['CmHopper'][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b['ListId'],'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b['callbackUniqueid']?moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2165de['id']})[_0x5301('0x2b')](_0x547d76());});}}}})[_0x5301('0x1e')](function(){return _0x2df62c[_0x5301('0x1c')]['findAll']({'where':{'type':_0x5301('0x3a')},'attributes':['id'],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':'BlackLists','where':{'id':_0xbeb64b[_0x5301('0x28')]}}]})[_0x5301('0x1e')](function(_0x10ca5d){if(_0x10ca5d){var _0x3dc9f8=[];for(var _0x1411cf=0x0,_0xe985b6;_0x1411cf<_0x10ca5d['length'];_0x1411cf+=0x1){_0xe985b6=_0x10ca5d[_0x1411cf][_0x5301('0x16')]({'plain':!![]});_0x2df62c['CmHopperBlack'][_0x5301('0x2f')]({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'VoiceQueueId':_0xe985b6['id']})[_0x5301('0x2b')](function(_0x508674){logger[_0x5301('0x30')](_0x5301('0x3b'),_0x5301('0x17'),_0x508674[_0x5301('0x3c')]);});}}});})[_0x5301('0x1e')](function(){return _0x2df62c[_0x5301('0x3d')]['findAll']({'attributes':['id',_0x5301('0x36'),_0x5301('0x1b')],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':_0x5301('0x3e'),'where':{'id':_0xbeb64b['ListId']}}]})[_0x5301('0x1e')](function(_0x446347){if(_0x446347){var _0x2ab5cc=[];for(var _0x24ae8c=0x0,_0xaefe36;_0x24ae8c<_0x446347[_0x5301('0x3f')];_0x24ae8c+=0x1){_0xaefe36=_0x446347[_0x24ae8c][_0x5301('0x16')]({'plain':!![]});switch(_0xaefe36[_0x5301('0x36')]){case _0x5301('0x38'):_0x4516f4(_0xaefe36)[_0x5301('0x2b')](_0x399751());break;case _0x5301('0x39'):_0x39d0f3(_0xaefe36)[_0x5301('0x2b')](_0x399751());break;default:_0x2df62c['CmHopper'][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()[_0x5301('0x22')](_0x5301('0x23')),'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b[_0x5301('0x2a')]?moment()[_0x5301('0x22')](_0x5301('0x23')):undefined,'CampaignId':_0xaefe36['id']})[_0x5301('0x2b')](_0x399751());}}}});})[_0x5301('0x1e')](function(){return _0x2df62c[_0x5301('0x3d')][_0x5301('0x40')]({'attributes':['id'],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':'BlackLists','where':{'id':_0xbeb64b[_0x5301('0x28')]}}]})['then'](function(_0xf28eff){if(_0xf28eff){var _0x5cb2fb=[];for(var _0x6f7302=0x0,_0x4bbc3f;_0x6f7302<_0xf28eff[_0x5301('0x3f')];_0x6f7302+=0x1){_0x4bbc3f=_0xf28eff[_0x6f7302]['get']({'plain':!![]});_0x2df62c['CmHopperBlack'][_0x5301('0x2f')]({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'CampaignId':_0x4bbc3f['id']})[_0x5301('0x2b')](function(_0x309f4a){logger[_0x5301('0x30')](_0x5301('0x3b'),_0x5301('0x17'),_0x309f4a[_0x5301('0x3c')]);});}}});})[_0x5301('0x1e')](function(){_0x110bbb();})['catch'](function(_0x37d848){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x37d848[_0x5301('0x3c')]);_0x110bbb(_0x37d848);});}else{_0x110bbb(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x406dec,_0x4105b5,_0x30a19a){var _0x4cec5b=_0x4d81b8[_0x5301('0x15')];var _0x1c1dc7=_0x406dec['get']({'plain':!![]});return _0x4cec5b[_0x5301('0x25')]['findAll']({'raw':!![],'where':{'ListId':_0x1c1dc7[_0x5301('0x28')],'ContactId':_0x1c1dc7['id']}})[_0x5301('0x1e')](function(_0x1238c5){if(!_[_0x5301('0x41')](_0x1238c5)){var _0x2c8313=[];for(var _0x336e53=0x0;_0x336e53<_0x1238c5[_0x5301('0x3f')];_0x336e53+=0x1){var _0x29253f=_0x4cec5b[_0x5301('0x25')][_0x5301('0x42')]({'where':{'ListId':_0x1238c5[_0x336e53]['ListId'],'ContactId':_0x1238c5[_0x336e53][_0x5301('0x43')],'VoiceQueueId':_0x1238c5[_0x336e53][_0x5301('0x44')],'CampaignId':_0x1238c5[_0x336e53][_0x5301('0x45')]}});_0x2c8313[_0x5301('0x46')](_0x29253f);}return BPromise['all'](_0x2c8313);}})['then'](function(_0x3a23b2){logger['info'](_0x5301('0x47'),util[_0x5301('0x18')](_0x3a23b2,{'showHidden':![],'depth':null}));_0x30a19a();})['catch'](function(_0x5450a1){logger[_0x5301('0x30')]('[CmContact][afterDestroy][Error]',util[_0x5301('0x18')](_0x5450a1,{'showHidden':![],'depth':null}));_0x30a19a(_0x5450a1);});}}});}; \ No newline at end of file +var _0x681d=['dialTimezone','VoiceQueue','findOne','then','utcOffset','minutes','ret','CmHopper','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','ListId','inspect','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','onlyIfOpen','BlackLists','length','cmContact,\x20%s,\x20%s','message','Campaign','CmHopperBlack','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Error]','lodash','util','moment','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','fti_cm_contacts','firstName','lastName','phone','mobile','fax','FULLTEXT','utf8mb4','models','error','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil'];(function(_0x5bad3f,_0x42d5fe){var _0x5dde00=function(_0x4cce45){while(--_0x4cce45){_0x5bad3f['push'](_0x5bad3f['shift']());}};_0x5dde00(++_0x42d5fe);}(_0x681d,0x13a));var _0xd681=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x681d[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0xd681('0x0'));var util=require(_0xd681('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd681('0x2'));var BPromise=require('bluebird');var rp=require(_0xd681('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd681('0x4'));var config=require(_0xd681('0x5'));var shared=require(_0xd681('0x6'));var attributes=require(_0xd681('0x7'));module[_0xd681('0x8')]=function(_0xe577f9,_0x478c8a){return _0xe577f9[_0xd681('0x9')]('CmContact',attributes,{'tableName':_0xd681('0xa'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0xd681('0xb'),'fields':[_0xd681('0xc'),_0xd681('0xd'),_0xd681('0xe'),_0xd681('0xf'),_0xd681('0x10'),'email'],'type':_0xd681('0x11')}],'timestamps':!![],'charset':_0xd681('0x12'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x59515f,_0x4c0760,_0x845afe){var _0x394d58=_0xe577f9[_0xd681('0x13')];var _0x4209e5=_0x59515f['get']({'plain':!![]});function _0x50723b(){return function(_0x37f410){logger[_0xd681('0x14')]('cmContact',_0xd681('0x15'),util['inspect'](_0x37f410,{'showHidden':![],'depth':null}));};}function _0x2600a2(_0x454c28,_0x2419fb){var _0x462854=_0x2419fb[_0xd681('0x16')]?_0x2419fb[_0xd681('0x16')]:moment()[_0xd681('0x17')](_0xd681('0x18'));return new BPromise(function(_0x53be90,_0x330d7e){if(_[_0xd681('0x19')](_0x2419fb[_0xd681('0x1a')])){_0x53be90({'ret':_0x462854});}else{_0x394d58[_0xd681('0x1b')][_0xd681('0x1c')]({'where':{'id':_0x454c28['id']}})[_0xd681('0x1d')](function(_0x44f0f2){if(!_[_0xd681('0x19')](_0x44f0f2)){var _0x190622=_0x44f0f2['dialTimezone'];if(!_[_0xd681('0x19')](_0x190622)){var _0x5c4077=shared['timezones'];var _0x2791d0=_0x5c4077[_0x190622];var _0x1df378=_0x5c4077[_0x2419fb[_0xd681('0x1a')]];if(!_[_0xd681('0x19')](_0x2791d0)&&!_[_0xd681('0x19')](_0x1df378)){var _0x439691=_0x2791d0[_0xd681('0x1e')]-_0x1df378[_0xd681('0x1e')];_0x462854=_0x2419fb[_0xd681('0x16')]?_0x2419fb[_0xd681('0x16')]:moment();var _0x27d78e=moment(_0x462854)['add'](_0x439691,_0xd681('0x1f'));_0x53be90({'ret':_0x27d78e[_0xd681('0x17')](_0xd681('0x18'))});}else _0x53be90({'ret':_0x462854});}else _0x53be90({'ret':_0x462854});}else{_0x53be90({'ret':_0x462854});}});}});return 0xa;}var _0x2f9890=function(_0x5e2b6b){return new BPromise(function(_0x53e270,_0x11507b){_0x2600a2(_0x5e2b6b,_0x4209e5)[_0xd681('0x1d')](function(_0x5ebe4d){_0x4209e5[_0xd681('0x16')]=_0x5ebe4d[_0xd681('0x20')];_0x394d58[_0xd681('0x21')][_0xd681('0x1c')]({'where':{'phone':_0x4209e5[_0xd681('0xe')],'VoiceQueueId':_0x5e2b6b['id']}})['then'](function(_0x160bb7){if(!_[_0xd681('0x19')](_0x160bb7)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4209e5['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5e2b6b['id']);}return _0x394d58[_0xd681('0x21')]['create']({'phone':_0x4209e5[_0xd681('0xe')],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5['ListId'],'priority':_0x4209e5[_0xd681('0x22')]?_0x4209e5[_0xd681('0x22')]:0x2,'scheduledat':_0x4209e5[_0xd681('0x16')]?_0x4209e5[_0xd681('0x16')]:moment()[_0xd681('0x17')](_0xd681('0x18')),'callback':_0x4209e5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4209e5[_0xd681('0x23')]?_0x4209e5['callbackUniqueid']:undefined,'callbackat':_0x4209e5['callbackUniqueid']?moment()[_0xd681('0x17')](_0xd681('0x18')):undefined,'VoiceQueueId':_0x5e2b6b['id']});})[_0xd681('0x24')](function(_0x187be8){_0x11507b(_0x187be8);});});});};var _0x2d1d8b=function(_0x493c1a){return new BPromise(function(_0x1250c3,_0x358f71){_0x2600a2(_0x493c1a,_0x4209e5)[_0xd681('0x1d')](function(_0x4aeeff){_0x4209e5['scheduledat']=_0x4aeeff[_0xd681('0x20')];_0x394d58[_0xd681('0x21')]['findOne']({'where':{'phone':_0x4209e5['phone'],'VoiceQueueId':_0x493c1a['id']}})['then'](function(_0x203932){if(!_[_0xd681('0x19')](_0x203932)){throw new Error(_0xd681('0x25')+_0x4209e5[_0xd681('0xe')]+_0xd681('0x26')+_0x493c1a['id']);}return _0x394d58['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x4209e5['phone'],'VoiceQueueId':_0x493c1a['id']}});})[_0xd681('0x1d')](function(_0x5ea9c0){if(!_[_0xd681('0x19')](_0x5ea9c0)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4209e5[_0xd681('0xe')]+_0xd681('0x27')+_0x493c1a['id']);}return _0x394d58[_0xd681('0x21')][_0xd681('0x28')]({'phone':_0x4209e5[_0xd681('0xe')],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5[_0xd681('0x29')],'priority':_0x4209e5[_0xd681('0x22')]?_0x4209e5[_0xd681('0x22')]:0x2,'scheduledat':_0x4209e5[_0xd681('0x16')]?_0x4209e5['scheduledat']:moment()[_0xd681('0x17')](_0xd681('0x18')),'callback':_0x4209e5[_0xd681('0x23')]?!![]:![],'callbackuniqueid':_0x4209e5[_0xd681('0x23')]?_0x4209e5[_0xd681('0x23')]:undefined,'callbackat':_0x4209e5[_0xd681('0x23')]?moment()['format'](_0xd681('0x18')):undefined,'VoiceQueueId':_0x493c1a['id']});})[_0xd681('0x24')](function(_0x4355fb){_0x358f71(_0x4355fb);});});});};function _0x1f8785(){return function(_0x112b3c){logger[_0xd681('0x14')]('cmContact',_0xd681('0x15'),util[_0xd681('0x2a')](_0x112b3c,{'showHidden':![],'depth':null}));};}function _0x4129b5(_0x1ff465,_0x483f2f){var _0x33a4bf=_0x483f2f['scheduledat']?_0x483f2f['scheduledat']:moment()[_0xd681('0x17')](_0xd681('0x18'));return new BPromise(function(_0x184770,_0x29fc4f){if(_[_0xd681('0x19')](_0x483f2f[_0xd681('0x1a')])){_0x184770({'ret':_0x33a4bf});}else{_0x394d58['Campaign'][_0xd681('0x1c')]({'where':{'id':_0x1ff465['id']}})[_0xd681('0x1d')](function(_0x4b2887){if(!_[_0xd681('0x19')](_0x4b2887)){var _0x5227f0=_0x4b2887[_0xd681('0x1a')];if(!_[_0xd681('0x19')](_0x5227f0)){var _0x2e6b81=shared['timezones'];var _0x53781f=_0x2e6b81[_0x5227f0];var _0x554d32=_0x2e6b81[_0x483f2f[_0xd681('0x1a')]];if(!_[_0xd681('0x19')](_0x53781f)&&!_[_0xd681('0x19')](_0x554d32)){var _0x519564=_0x53781f['utcOffset']-_0x554d32[_0xd681('0x1e')];_0x33a4bf=_0x483f2f[_0xd681('0x16')]?_0x483f2f[_0xd681('0x16')]:moment();var _0x215e1c=moment(_0x33a4bf)[_0xd681('0x2b')](_0x519564,_0xd681('0x1f'));_0x184770({'ret':_0x215e1c[_0xd681('0x17')](_0xd681('0x18'))});}else _0x184770({'ret':_0x33a4bf});}else _0x184770({'ret':_0x33a4bf});}else{_0x184770({'ret':_0x33a4bf});}});}});return 0xa;}var _0x524e44=function(_0x2c8778){return new BPromise(function(_0x5bcdce,_0x5d60ec){_0x4129b5(_0x2c8778,_0x4209e5)['then'](function(_0x29ea46){_0x4209e5[_0xd681('0x16')]=_0x29ea46['ret'];_0x394d58[_0xd681('0x21')][_0xd681('0x1c')]({'where':{'phone':_0x4209e5[_0xd681('0xe')],'CampaignId':_0x2c8778['id']}})[_0xd681('0x1d')](function(_0x1ec97f){if(!_[_0xd681('0x19')](_0x1ec97f)){throw new Error(_0xd681('0x25')+_0x4209e5['phone']+_0xd681('0x2c')+_0x2c8778['id']);}return _0x394d58[_0xd681('0x21')][_0xd681('0x28')]({'phone':_0x4209e5[_0xd681('0xe')],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5[_0xd681('0x29')],'priority':_0x4209e5[_0xd681('0x22')]?_0x4209e5['priority']:0x2,'scheduledat':_0x4209e5[_0xd681('0x16')]?_0x4209e5['scheduledat']:moment()[_0xd681('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4209e5[_0xd681('0x23')]?!![]:![],'callbackuniqueid':_0x4209e5[_0xd681('0x23')]?_0x4209e5[_0xd681('0x23')]:undefined,'callbackat':_0x4209e5[_0xd681('0x23')]?moment()[_0xd681('0x17')](_0xd681('0x18')):undefined,'CampaignId':_0x2c8778['id']});})[_0xd681('0x24')](function(_0x5cf589){_0x5d60ec(_0x5cf589);});});});};var _0x82c2eb=function(_0x34c1f6){return new BPromise(function(_0x4249dd,_0xe63014){_0x4129b5(_0x34c1f6,_0x4209e5)[_0xd681('0x1d')](function(_0x3fa286){_0x4209e5[_0xd681('0x16')]=_0x3fa286['ret'];_0x394d58['CmHopper']['findOne']({'where':{'phone':_0x4209e5[_0xd681('0xe')],'CampaignId':_0x34c1f6['id']}})[_0xd681('0x1d')](function(_0x5eec1c){if(!_[_0xd681('0x19')](_0x5eec1c)){throw new Error(_0xd681('0x25')+_0x4209e5[_0xd681('0xe')]+_0xd681('0x2d')+_0x34c1f6['id']);}return _0x394d58[_0xd681('0x2e')]['findOne']({'where':{'calleridnum':_0x4209e5[_0xd681('0xe')],'CampaignId':_0x34c1f6['id']}});})[_0xd681('0x1d')](function(_0x2b759b){if(!_['isNil'](_0x2b759b)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4209e5['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x34c1f6['id']);}return _0x394d58[_0xd681('0x21')][_0xd681('0x28')]({'phone':_0x4209e5[_0xd681('0xe')],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5[_0xd681('0x29')],'priority':_0x4209e5['priority']?_0x4209e5['priority']:0x2,'scheduledat':_0x4209e5[_0xd681('0x16')]?_0x4209e5[_0xd681('0x16')]:moment()[_0xd681('0x17')](_0xd681('0x18')),'callback':_0x4209e5[_0xd681('0x23')]?!![]:![],'callbackuniqueid':_0x4209e5[_0xd681('0x23')]?_0x4209e5['callbackUniqueid']:undefined,'callbackat':_0x4209e5[_0xd681('0x23')]?moment()[_0xd681('0x17')](_0xd681('0x18')):undefined,'CampaignId':_0x34c1f6['id']});})[_0xd681('0x24')](function(_0x2cdd6b){_0xe63014(_0x2cdd6b);});});});};if(_0x4209e5[_0xd681('0x29')]){_0x394d58[_0xd681('0x1b')][_0xd681('0x2f')]({'where':{'type':_0xd681('0x30')},'attributes':['id',_0xd681('0x31'),'dialTimezone'],'include':[{'model':_0x394d58[_0xd681('0x32')],'as':_0xd681('0x33'),'where':{'id':_0x4209e5[_0xd681('0x29')]}}]})[_0xd681('0x1d')](function(_0xecadbc){if(_0xecadbc){var _0xad7d81=[];for(var _0x388ed8=0x0,_0x8d3eee;_0x388ed8<_0xecadbc['length'];_0x388ed8+=0x1){_0x8d3eee=_0xecadbc[_0x388ed8][_0xd681('0x34')]({'plain':!![]});switch(_0x8d3eee['dialCheckDuplicateType']){case'always':_0x2d1d8b(_0x8d3eee)[_0xd681('0x24')](_0x50723b());break;case _0xd681('0x35'):_0x2f9890(_0x8d3eee)['catch'](_0x50723b());break;default:_0x4129b5(_0x8d3eee,_0x4209e5)['then'](function(_0x27334f){_0x4209e5['scheduledat']=_0x27334f['ret'];_0x394d58['CmHopper']['create']({'phone':_0x4209e5[_0xd681('0xe')],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5[_0xd681('0x29')],'scheduledat':_0x4209e5[_0xd681('0x16')]?_0x4209e5['scheduledat']:moment()[_0xd681('0x17')](_0xd681('0x18')),'priority':_0x4209e5[_0xd681('0x22')]?_0x4209e5['priority']:0x2,'callback':_0x4209e5[_0xd681('0x23')]?!![]:![],'callbackuniqueid':_0x4209e5[_0xd681('0x23')]?_0x4209e5['callbackUniqueid']:undefined,'callbackat':_0x4209e5[_0xd681('0x23')]?moment()[_0xd681('0x17')](_0xd681('0x18')):undefined,'VoiceQueueId':_0x8d3eee['id']})[_0xd681('0x24')](_0x50723b());});}}}})[_0xd681('0x1d')](function(){return _0x394d58[_0xd681('0x1b')][_0xd681('0x2f')]({'where':{'type':_0xd681('0x30')},'attributes':['id'],'include':[{'model':_0x394d58[_0xd681('0x32')],'as':_0xd681('0x36'),'where':{'id':_0x4209e5[_0xd681('0x29')]}}]})['then'](function(_0x50be24){if(_0x50be24){var _0x2af545=[];for(var _0x723e2=0x0,_0x397d4f;_0x723e2<_0x50be24[_0xd681('0x37')];_0x723e2+=0x1){_0x397d4f=_0x50be24[_0x723e2][_0xd681('0x34')]({'plain':!![]});_0x394d58['CmHopperBlack']['create']({'phone':_0x4209e5[_0xd681('0xe')],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5[_0xd681('0x29')],'VoiceQueueId':_0x397d4f['id']})[_0xd681('0x24')](function(_0x351797){logger['error'](_0xd681('0x38'),_0xd681('0x15'),_0x351797[_0xd681('0x39')]);});}}});})[_0xd681('0x1d')](function(){return _0x394d58['Campaign']['findAll']({'attributes':['id',_0xd681('0x31'),_0xd681('0x1a')],'include':[{'model':_0x394d58['CmList'],'as':_0xd681('0x33'),'where':{'id':_0x4209e5[_0xd681('0x29')]}}]})[_0xd681('0x1d')](function(_0x5db8b1){if(_0x5db8b1){var _0x3926b5=[];for(var _0x2b6db3=0x0,_0x352dd0;_0x2b6db3<_0x5db8b1[_0xd681('0x37')];_0x2b6db3+=0x1){_0x352dd0=_0x5db8b1[_0x2b6db3][_0xd681('0x34')]({'plain':!![]});switch(_0x352dd0[_0xd681('0x31')]){case'always':_0x82c2eb(_0x352dd0)[_0xd681('0x24')](_0x1f8785());break;case _0xd681('0x35'):_0x524e44(_0x352dd0)[_0xd681('0x24')](_0x1f8785());break;default:_0x394d58['CmHopper'][_0xd681('0x28')]({'phone':_0x4209e5[_0xd681('0xe')],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5['ListId'],'scheduledat':_0x4209e5[_0xd681('0x16')]?_0x4209e5[_0xd681('0x16')]:moment()[_0xd681('0x17')](_0xd681('0x18')),'priority':_0x4209e5[_0xd681('0x22')]?_0x4209e5['priority']:0x2,'callback':_0x4209e5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4209e5['callbackUniqueid']?_0x4209e5['callbackUniqueid']:undefined,'callbackat':_0x4209e5[_0xd681('0x23')]?moment()[_0xd681('0x17')](_0xd681('0x18')):undefined,'CampaignId':_0x352dd0['id']})[_0xd681('0x24')](_0x1f8785());}}}});})[_0xd681('0x1d')](function(){return _0x394d58[_0xd681('0x3a')]['findAll']({'attributes':['id'],'include':[{'model':_0x394d58[_0xd681('0x32')],'as':'BlackLists','where':{'id':_0x4209e5[_0xd681('0x29')]}}]})[_0xd681('0x1d')](function(_0x11ea6c){if(_0x11ea6c){var _0x26bd16=[];for(var _0x212bb9=0x0,_0x3fd261;_0x212bb9<_0x11ea6c['length'];_0x212bb9+=0x1){_0x3fd261=_0x11ea6c[_0x212bb9][_0xd681('0x34')]({'plain':!![]});_0x394d58[_0xd681('0x3b')][_0xd681('0x28')]({'phone':_0x4209e5['phone'],'ContactId':_0x4209e5['id'],'ListId':_0x4209e5[_0xd681('0x29')],'CampaignId':_0x3fd261['id']})[_0xd681('0x24')](function(_0x2bd1e0){logger[_0xd681('0x14')]('cmContact,\x20%s,\x20%s',_0xd681('0x15'),_0x2bd1e0['message']);});}}});})[_0xd681('0x1d')](function(){_0x845afe();})['catch'](function(_0x42760a){logger[_0xd681('0x14')](_0xd681('0x38'),'afterCreate',_0x42760a['message']);_0x845afe(_0x42760a);});}else{_0x845afe(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x3aee3b,_0x47b512,_0x254149){var _0x1a310b=_0xe577f9['models'];var _0x29757c=_0x3aee3b[_0xd681('0x34')]({'plain':!![]});return _0x1a310b[_0xd681('0x21')][_0xd681('0x2f')]({'raw':!![],'where':{'ListId':_0x29757c['ListId'],'ContactId':_0x29757c['id']}})['then'](function(_0x55b34d){if(!_[_0xd681('0x3c')](_0x55b34d)){var _0x4adcfc=[];for(var _0xe2663c=0x0;_0xe2663c<_0x55b34d[_0xd681('0x37')];_0xe2663c+=0x1){var _0x53e51a=_0x1a310b[_0xd681('0x21')][_0xd681('0x3d')]({'where':{'ListId':_0x55b34d[_0xe2663c]['ListId'],'ContactId':_0x55b34d[_0xe2663c][_0xd681('0x3e')],'VoiceQueueId':_0x55b34d[_0xe2663c][_0xd681('0x3f')],'CampaignId':_0x55b34d[_0xe2663c][_0xd681('0x40')]}});_0x4adcfc['push'](_0x53e51a);}return BPromise[_0xd681('0x41')](_0x4adcfc);}})['then'](function(_0xc6c426){logger[_0xd681('0x42')]('[CmContact][afterDestroy][Succesfull]',util[_0xd681('0x2a')](_0xc6c426,{'showHidden':![],'depth':null}));_0x254149();})['catch'](function(_0x3fd8d2){logger['error'](_0xd681('0x43'),util['inspect'](_0x3fd8d2,{'showHidden':![],'depth':null}));_0x254149(_0x3fd8d2);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index a08174e..f6538d7 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x578d51,_0x50b7ea){var _0x4c66a6=function(_0x50bea9){while(--_0x50bea9){_0x578d51['push'](_0x578d51['shift']());}};_0x4c66a6(++_0x50b7ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 b8896d7..351c944 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 _0xf2cb=['INTEGER','exports','STRING'];(function(_0x20aa7d,_0x22b467){var _0x5a246a=function(_0x51ae79){while(--_0x51ae79){_0x20aa7d['push'](_0x20aa7d['shift']());}};_0x5a246a(++_0x22b467);}(_0xf2cb,0x130));var _0xbf2c=function(_0x530c3f,_0x3a59c4){_0x530c3f=_0x530c3f-0x0;var _0x24b18d=_0xf2cb[_0x530c3f];return _0x24b18d;};'use strict';var Sequelize=require('sequelize');module[_0xbf2c('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xbf2c('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xbf2c('0x1')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xbf2c('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xbf2c('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0xc36d=['STRING','sequelize','exports','INTEGER'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc36d,0x7d));var _0xdc36=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0xc36d[_0x13524d];return _0x9918b4;};'use strict';var Sequelize=require(_0xdc36('0x0'));module[_0xdc36('0x1')]={'CmContactId':{'type':Sequelize[_0xdc36('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xdc36('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xdc36('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xdc36('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xdc36('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xdc36('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 ad800e4..734db72 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 _0x0dbb=['fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','findAll','rows','catch','show','keys','attributes','length','includeAll','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x1a04ef,_0x541e36){var _0x3b8f4c=function(_0x594dfa){while(--_0x594dfa){_0x1a04ef['push'](_0x1a04ef['shift']());}};_0x3b8f4c(++_0x541e36);}(_0x0dbb,0x181));var _0xb0db=function(_0x2fb21e,_0x2dbb82){_0x2fb21e=_0x2fb21e-0x0;var _0x22dc73=_0x0dbb[_0x2fb21e];return _0x22dc73;};'use strict';var emlformat=require(_0xb0db('0x0'));var rimraf=require(_0xb0db('0x1'));var zipdir=require(_0xb0db('0x2'));var jsonpatch=require(_0xb0db('0x3'));var rp=require(_0xb0db('0x4'));var moment=require(_0xb0db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb0db('0x6'));var util=require(_0xb0db('0x7'));var path=require(_0xb0db('0x8'));var sox=require(_0xb0db('0x9'));var csv=require('to-csv');var ejs=require(_0xb0db('0xa'));var fs=require('fs');var fs_extra=require(_0xb0db('0xb'));var _=require(_0xb0db('0xc'));var squel=require(_0xb0db('0xd'));var crypto=require(_0xb0db('0xe'));var jsforce=require(_0xb0db('0xf'));var deskjs=require(_0xb0db('0x10'));var toCsv=require(_0xb0db('0x11'));var querystring=require('querystring');var Papa=require(_0xb0db('0x12'));var Redis=require(_0xb0db('0x13'));var authService=require(_0xb0db('0x14'));var qs=require(_0xb0db('0x15'));var as=require(_0xb0db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb0db('0x17'));var utils=require(_0xb0db('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb0db('0x19'));var db=require(_0xb0db('0x1a'))['db'];function respondWithStatusCode(_0x270745,_0x550044){_0x550044=_0x550044||0xcc;return function(_0x2a7b0c){if(_0x2a7b0c){return _0x270745[_0xb0db('0x1b')](_0x550044);}return _0x270745['status'](_0x550044)[_0xb0db('0x1c')]();};}function respondWithResult(_0x3d9d40,_0x584017){_0x584017=_0x584017||0xc8;return function(_0x11b761){if(_0x11b761){return _0x3d9d40[_0xb0db('0x1d')](_0x584017)['json'](_0x11b761);}};}function respondWithFilteredResult(_0x98d094,_0x3ff974){return function(_0x195f94){if(_0x195f94){var _0x5e12f9=typeof _0x3ff974[_0xb0db('0x1e')]===_0xb0db('0x1f')&&typeof _0x3ff974['limit']===_0xb0db('0x1f');var _0x50c723=_0x195f94['count'];var _0x1753a6=_0x5e12f9?0x0:_0x3ff974[_0xb0db('0x1e')];var _0x26dd98=_0x5e12f9?_0x195f94[_0xb0db('0x20')]:_0x3ff974['offset']+_0x3ff974[_0xb0db('0x21')];var _0x3b99f7;if(_0x26dd98>=_0x50c723){_0x26dd98=_0x50c723;_0x3b99f7=0xc8;}else{_0x3b99f7=0xce;}_0x98d094[_0xb0db('0x1d')](_0x3b99f7);return _0x98d094['set'](_0xb0db('0x22'),_0x1753a6+'-'+_0x26dd98+'/'+_0x50c723)[_0xb0db('0x23')](_0x195f94);}return null;};}function patchUpdates(_0x10dec8){return function(_0x3e138b){try{jsonpatch[_0xb0db('0x24')](_0x3e138b,_0x10dec8,!![]);}catch(_0x3692d9){return BPromise[_0xb0db('0x25')](_0x3692d9);}return _0x3e138b[_0xb0db('0x26')]();};}function saveUpdates(_0x1cab5d,_0x6a203c){return function(_0x5e691a){if(_0x5e691a){return _0x5e691a[_0xb0db('0x27')](_0x1cab5d)['then'](function(_0x10526b){return _0x10526b;});}return null;};}function removeEntity(_0x24130b,_0x3c5809){return function(_0x24eb12){if(_0x24eb12){return _0x24eb12[_0xb0db('0x28')]()[_0xb0db('0x29')](function(){var _0x3bbf55=_0x24eb12[_0xb0db('0x2a')]({'plain':!![]});var _0x8ecd69=_0xb0db('0x2b');return db[_0xb0db('0x2c')][_0xb0db('0x28')]({'where':{'type':_0x8ecd69,'resourceId':_0x3bbf55['id']}})[_0xb0db('0x29')](function(){return _0x24eb12;});})[_0xb0db('0x29')](function(){_0x24130b['status'](0xcc)[_0xb0db('0x1c')]();});}};}function handleEntityNotFound(_0x37e386,_0x57e341){return function(_0x1a3c0e){if(!_0x1a3c0e){_0x37e386['sendStatus'](0x194);}return _0x1a3c0e;};}function handleError(_0x7e93de,_0x333c05){_0x333c05=_0x333c05||0x1f4;return function(_0x5b2b2b){logger[_0xb0db('0x2d')](_0x5b2b2b[_0xb0db('0x2e')]);if(_0x5b2b2b[_0xb0db('0x2f')]){delete _0x5b2b2b[_0xb0db('0x2f')];}_0x7e93de[_0xb0db('0x1d')](_0x333c05)[_0xb0db('0x30')](_0x5b2b2b);};}exports[_0xb0db('0x31')]=function(_0x2f03cd,_0x4cf028){var _0x18db0f={},_0x16988c={},_0x33a429={'count':0x0,'rows':[]};var _0x59bf3e=_[_0xb0db('0x32')](db[_0xb0db('0x33')][_0xb0db('0x34')],function(_0x49b3ed){return{'name':_0x49b3ed[_0xb0db('0x35')],'type':_0x49b3ed[_0xb0db('0x36')][_0xb0db('0x37')]};});_0x16988c[_0xb0db('0x38')]=_[_0xb0db('0x32')](_0x59bf3e,_0xb0db('0x2f'));_0x16988c[_0xb0db('0x39')]=_['keys'](_0x2f03cd[_0xb0db('0x39')]);_0x16988c[_0xb0db('0x3a')]=_['intersection'](_0x16988c[_0xb0db('0x38')],_0x16988c['query']);_0x18db0f['attributes']=_[_0xb0db('0x3b')](_0x16988c[_0xb0db('0x38')],qs[_0xb0db('0x3c')](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x3c')]));_0x18db0f['attributes']=_0x18db0f['attributes']['length']?_0x18db0f['attributes']:_0x16988c[_0xb0db('0x38')];if(!_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x3d')]('nolimit')){_0x18db0f['limit']=qs['limit'](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x21')]);_0x18db0f['offset']=qs[_0xb0db('0x1e')](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x1e')]);}_0x18db0f[_0xb0db('0x3e')]=qs[_0xb0db('0x3f')](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x3f')]);_0x18db0f['where']=qs[_0xb0db('0x3a')](_[_0xb0db('0x40')](_0x2f03cd[_0xb0db('0x39')],_0x16988c[_0xb0db('0x3a')]),_0x59bf3e);if(_0x2f03cd[_0xb0db('0x39')]['filter']){_0x18db0f['where']=_[_0xb0db('0x41')](_0x18db0f[_0xb0db('0x42')],{'$or':_['map'](_0x59bf3e,function(_0x19fc96){if(_0x19fc96[_0xb0db('0x36')]!==_0xb0db('0x43')){var _0x5d1a69={};_0x5d1a69[_0x19fc96[_0xb0db('0x2f')]]={'$like':'%'+_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x44')]+'%'};return _0x5d1a69;}})});}_0x18db0f=_[_0xb0db('0x41')]({},_0x18db0f,_0x2f03cd['options']);var _0x469092={'where':_0x18db0f[_0xb0db('0x42')]};return db[_0xb0db('0x33')][_0xb0db('0x20')](_0x469092)[_0xb0db('0x29')](function(_0x1dc647){_0x33a429['count']=_0x1dc647;if(_0x2f03cd[_0xb0db('0x39')]['includeAll']){_0x18db0f['include']=[{'all':!![]}];}return db[_0xb0db('0x33')][_0xb0db('0x45')](_0x18db0f);})[_0xb0db('0x29')](function(_0x19d34c){_0x33a429[_0xb0db('0x46')]=_0x19d34c;return _0x33a429;})[_0xb0db('0x29')](respondWithFilteredResult(_0x4cf028,_0x18db0f))[_0xb0db('0x47')](handleError(_0x4cf028,null));};exports[_0xb0db('0x48')]=function(_0x360f2b,_0x113cfe){var _0xc2947d={'raw':!![],'where':{'id':_0x360f2b['params']['id']}},_0x47baba={};_0x47baba[_0xb0db('0x38')]=_[_0xb0db('0x49')](db[_0xb0db('0x33')]['rawAttributes']);_0x47baba['query']=_[_0xb0db('0x49')](_0x360f2b['query']);_0x47baba[_0xb0db('0x3a')]=_['intersection'](_0x47baba[_0xb0db('0x38')],_0x47baba[_0xb0db('0x39')]);_0xc2947d[_0xb0db('0x4a')]=_['intersection'](_0x47baba[_0xb0db('0x38')],qs['fields'](_0x360f2b[_0xb0db('0x39')][_0xb0db('0x3c')]));_0xc2947d[_0xb0db('0x4a')]=_0xc2947d[_0xb0db('0x4a')][_0xb0db('0x4b')]?_0xc2947d[_0xb0db('0x4a')]:_0x47baba[_0xb0db('0x38')];if(_0x360f2b['query'][_0xb0db('0x4c')]){_0xc2947d[_0xb0db('0x4d')]=[{'all':!![]}];}_0xc2947d=_[_0xb0db('0x41')]({},_0xc2947d,_0x360f2b[_0xb0db('0x4e')]);return db[_0xb0db('0x33')]['find'](_0xc2947d)[_0xb0db('0x29')](handleEntityNotFound(_0x113cfe,null))[_0xb0db('0x29')](respondWithResult(_0x113cfe,null))[_0xb0db('0x47')](handleError(_0x113cfe,null));};exports[_0xb0db('0x4f')]=function(_0xa2f68,_0x2e459b){return db[_0xb0db('0x33')]['create'](_0xa2f68['body'],{})['then'](function(_0xc08328){var _0x4892da=_0xa2f68[_0xb0db('0x50')][_0xb0db('0x2a')]({'plain':!![]});if(!_0x4892da)throw new Error(_0xb0db('0x51'));if(_0x4892da[_0xb0db('0x52')]===_0xb0db('0x50')){var _0x1810e0=_0xc08328['get']({'plain':!![]});var _0x442a36='CmContactHasItems';return db[_0xb0db('0x53')][_0xb0db('0x54')]({'where':{'name':_0x442a36,'userProfileId':_0x4892da[_0xb0db('0x55')]},'raw':!![]})[_0xb0db('0x29')](function(_0x2a09d3){if(_0x2a09d3&&_0x2a09d3[_0xb0db('0x56')]===0x0){return db[_0xb0db('0x2c')][_0xb0db('0x4f')]({'name':_0x1810e0[_0xb0db('0x2f')],'resourceId':_0x1810e0['id'],'type':_0x2a09d3['name'],'sectionId':_0x2a09d3['id']},{})[_0xb0db('0x29')](function(){return _0xc08328;});}else{return _0xc08328;}})['catch'](function(_0x2c4db5){logger[_0xb0db('0x2d')](_0xb0db('0x57'),_0x2c4db5);throw _0x2c4db5;});}return _0xc08328;})[_0xb0db('0x29')](respondWithResult(_0x2e459b,0xc9))[_0xb0db('0x47')](handleError(_0x2e459b,null));};exports[_0xb0db('0x27')]=function(_0x4d09ba,_0x1b0ea9){if(_0x4d09ba['body']['id']){delete _0x4d09ba[_0xb0db('0x58')]['id'];}return db[_0xb0db('0x33')][_0xb0db('0x54')]({'where':{'id':_0x4d09ba['params']['id']}})[_0xb0db('0x29')](handleEntityNotFound(_0x1b0ea9,null))[_0xb0db('0x29')](saveUpdates(_0x4d09ba[_0xb0db('0x58')],null))[_0xb0db('0x29')](respondWithResult(_0x1b0ea9,null))[_0xb0db('0x47')](handleError(_0x1b0ea9,null));};exports[_0xb0db('0x28')]=function(_0x21314d,_0xb5f5f3){return db[_0xb0db('0x33')][_0xb0db('0x54')]({'where':{'id':_0x21314d['params']['id']}})[_0xb0db('0x29')](handleEntityNotFound(_0xb5f5f3,null))[_0xb0db('0x29')](removeEntity(_0xb5f5f3,null))[_0xb0db('0x47')](handleError(_0xb5f5f3,null));}; \ No newline at end of file +var _0x1a4a=['catch','params','include','create','body','user','get','role','CmContactHasItems','UserProfileSection','find','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','sox','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/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','destroy','then','UserProfileResource','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','rows'];(function(_0x545d71,_0x2b384a){var _0x338e93=function(_0x31075b){while(--_0x31075b){_0x545d71['push'](_0x545d71['shift']());}};_0x338e93(++_0x2b384a);}(_0x1a4a,0x1c1));var _0xa1a4=function(_0x16bd8c,_0x51a059){_0x16bd8c=_0x16bd8c-0x0;var _0x3ff6e8=_0x1a4a[_0x16bd8c];return _0x3ff6e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1a4('0x0'));var zipdir=require(_0xa1a4('0x1'));var jsonpatch=require(_0xa1a4('0x2'));var rp=require(_0xa1a4('0x3'));var moment=require(_0xa1a4('0x4'));var BPromise=require(_0xa1a4('0x5'));var Mustache=require(_0xa1a4('0x6'));var util=require(_0xa1a4('0x7'));var path=require(_0xa1a4('0x8'));var sox=require(_0xa1a4('0x9'));var csv=require(_0xa1a4('0xa'));var ejs=require(_0xa1a4('0xb'));var fs=require('fs');var fs_extra=require(_0xa1a4('0xc'));var _=require(_0xa1a4('0xd'));var squel=require(_0xa1a4('0xe'));var crypto=require(_0xa1a4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa1a4('0x10'));var toCsv=require(_0xa1a4('0xa'));var querystring=require(_0xa1a4('0x11'));var Papa=require(_0xa1a4('0x12'));var Redis=require(_0xa1a4('0x13'));var authService=require(_0xa1a4('0x14'));var qs=require(_0xa1a4('0x15'));var as=require(_0xa1a4('0x16'));var hardwareService=require(_0xa1a4('0x17'));var logger=require(_0xa1a4('0x18'))(_0xa1a4('0x19'));var utils=require(_0xa1a4('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xa1a4('0x1b'));var db=require(_0xa1a4('0x1c'))['db'];function respondWithStatusCode(_0x4364f8,_0x589c0d){_0x589c0d=_0x589c0d||0xcc;return function(_0x10638d){if(_0x10638d){return _0x4364f8[_0xa1a4('0x1d')](_0x589c0d);}return _0x4364f8[_0xa1a4('0x1e')](_0x589c0d)[_0xa1a4('0x1f')]();};}function respondWithResult(_0x15518f,_0x866767){_0x866767=_0x866767||0xc8;return function(_0x5b5882){if(_0x5b5882){return _0x15518f[_0xa1a4('0x1e')](_0x866767)[_0xa1a4('0x20')](_0x5b5882);}};}function respondWithFilteredResult(_0x4c07ab,_0x5e2bd5){return function(_0x59b78e){if(_0x59b78e){var _0x584c87=typeof _0x5e2bd5['offset']==='undefined'&&typeof _0x5e2bd5[_0xa1a4('0x21')]===_0xa1a4('0x22');var _0x41c411=_0x59b78e[_0xa1a4('0x23')];var _0x375904=_0x584c87?0x0:_0x5e2bd5[_0xa1a4('0x24')];var _0x4456fe=_0x584c87?_0x59b78e[_0xa1a4('0x23')]:_0x5e2bd5[_0xa1a4('0x24')]+_0x5e2bd5[_0xa1a4('0x21')];var _0x4f0669;if(_0x4456fe>=_0x41c411){_0x4456fe=_0x41c411;_0x4f0669=0xc8;}else{_0x4f0669=0xce;}_0x4c07ab[_0xa1a4('0x1e')](_0x4f0669);return _0x4c07ab[_0xa1a4('0x25')](_0xa1a4('0x26'),_0x375904+'-'+_0x4456fe+'/'+_0x41c411)[_0xa1a4('0x20')](_0x59b78e);}return null;};}function patchUpdates(_0x47f1c1){return function(_0x511f6c){try{jsonpatch[_0xa1a4('0x27')](_0x511f6c,_0x47f1c1,!![]);}catch(_0x41dcf8){return BPromise[_0xa1a4('0x28')](_0x41dcf8);}return _0x511f6c['save']();};}function saveUpdates(_0x37e4f2,_0x185d4f){return function(_0x5a6f2f){if(_0x5a6f2f){return _0x5a6f2f['update'](_0x37e4f2)['then'](function(_0x5892c9){return _0x5892c9;});}return null;};}function removeEntity(_0x23448f,_0x5bfc5f){return function(_0x1321f4){if(_0x1321f4){return _0x1321f4[_0xa1a4('0x29')]()[_0xa1a4('0x2a')](function(){var _0x3498e7=_0x1321f4['get']({'plain':!![]});var _0x50089a='CmContactHasItems';return db[_0xa1a4('0x2b')][_0xa1a4('0x29')]({'where':{'type':_0x50089a,'resourceId':_0x3498e7['id']}})[_0xa1a4('0x2a')](function(){return _0x1321f4;});})[_0xa1a4('0x2a')](function(){_0x23448f[_0xa1a4('0x1e')](0xcc)[_0xa1a4('0x1f')]();});}};}function handleEntityNotFound(_0x228741,_0x4df3c7){return function(_0x15b907){if(!_0x15b907){_0x228741[_0xa1a4('0x1d')](0x194);}return _0x15b907;};}function handleError(_0x350928,_0x27edcb){_0x27edcb=_0x27edcb||0x1f4;return function(_0x253879){logger[_0xa1a4('0x2c')](_0x253879['stack']);if(_0x253879['name']){delete _0x253879[_0xa1a4('0x2d')];}_0x350928[_0xa1a4('0x1e')](_0x27edcb)[_0xa1a4('0x2e')](_0x253879);};}exports[_0xa1a4('0x2f')]=function(_0x1d46d5,_0x2967de){var _0x54959c={},_0x440103={},_0x37d480={'count':0x0,'rows':[]};var _0x234331=_[_0xa1a4('0x30')](db[_0xa1a4('0x31')][_0xa1a4('0x32')],function(_0x1c1598){return{'name':_0x1c1598[_0xa1a4('0x33')],'type':_0x1c1598[_0xa1a4('0x34')][_0xa1a4('0x35')]};});_0x440103[_0xa1a4('0x36')]=_[_0xa1a4('0x30')](_0x234331,_0xa1a4('0x2d'));_0x440103[_0xa1a4('0x37')]=_[_0xa1a4('0x38')](_0x1d46d5[_0xa1a4('0x37')]);_0x440103['filters']=_[_0xa1a4('0x39')](_0x440103[_0xa1a4('0x36')],_0x440103[_0xa1a4('0x37')]);_0x54959c[_0xa1a4('0x3a')]=_[_0xa1a4('0x39')](_0x440103[_0xa1a4('0x36')],qs['fields'](_0x1d46d5[_0xa1a4('0x37')][_0xa1a4('0x3b')]));_0x54959c[_0xa1a4('0x3a')]=_0x54959c[_0xa1a4('0x3a')][_0xa1a4('0x3c')]?_0x54959c[_0xa1a4('0x3a')]:_0x440103['model'];if(!_0x1d46d5['query']['hasOwnProperty'](_0xa1a4('0x3d'))){_0x54959c['limit']=qs[_0xa1a4('0x21')](_0x1d46d5[_0xa1a4('0x37')]['limit']);_0x54959c[_0xa1a4('0x24')]=qs[_0xa1a4('0x24')](_0x1d46d5['query'][_0xa1a4('0x24')]);}_0x54959c[_0xa1a4('0x3e')]=qs[_0xa1a4('0x3f')](_0x1d46d5[_0xa1a4('0x37')][_0xa1a4('0x3f')]);_0x54959c[_0xa1a4('0x40')]=qs['filters'](_[_0xa1a4('0x41')](_0x1d46d5[_0xa1a4('0x37')],_0x440103[_0xa1a4('0x42')]),_0x234331);if(_0x1d46d5['query']['filter']){_0x54959c[_0xa1a4('0x40')]=_['merge'](_0x54959c['where'],{'$or':_[_0xa1a4('0x30')](_0x234331,function(_0x435618){if(_0x435618[_0xa1a4('0x34')]!==_0xa1a4('0x43')){var _0x39f5bb={};_0x39f5bb[_0x435618['name']]={'$like':'%'+_0x1d46d5[_0xa1a4('0x37')][_0xa1a4('0x44')]+'%'};return _0x39f5bb;}})});}_0x54959c=_[_0xa1a4('0x45')]({},_0x54959c,_0x1d46d5[_0xa1a4('0x46')]);var _0x3b3fab={'where':_0x54959c[_0xa1a4('0x40')]};return db[_0xa1a4('0x31')][_0xa1a4('0x23')](_0x3b3fab)[_0xa1a4('0x2a')](function(_0x288a81){_0x37d480[_0xa1a4('0x23')]=_0x288a81;if(_0x1d46d5['query'][_0xa1a4('0x47')]){_0x54959c['include']=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x54959c);})['then'](function(_0x34e024){_0x37d480[_0xa1a4('0x48')]=_0x34e024;return _0x37d480;})[_0xa1a4('0x2a')](respondWithFilteredResult(_0x2967de,_0x54959c))[_0xa1a4('0x49')](handleError(_0x2967de,null));};exports['show']=function(_0x384320,_0x571eca){var _0x2aefc4={'raw':!![],'where':{'id':_0x384320[_0xa1a4('0x4a')]['id']}},_0x21aa0d={};_0x21aa0d[_0xa1a4('0x36')]=_[_0xa1a4('0x38')](db[_0xa1a4('0x31')]['rawAttributes']);_0x21aa0d[_0xa1a4('0x37')]=_['keys'](_0x384320['query']);_0x21aa0d[_0xa1a4('0x42')]=_['intersection'](_0x21aa0d[_0xa1a4('0x36')],_0x21aa0d['query']);_0x2aefc4[_0xa1a4('0x3a')]=_[_0xa1a4('0x39')](_0x21aa0d[_0xa1a4('0x36')],qs['fields'](_0x384320['query'][_0xa1a4('0x3b')]));_0x2aefc4[_0xa1a4('0x3a')]=_0x2aefc4[_0xa1a4('0x3a')][_0xa1a4('0x3c')]?_0x2aefc4[_0xa1a4('0x3a')]:_0x21aa0d['model'];if(_0x384320[_0xa1a4('0x37')]['includeAll']){_0x2aefc4[_0xa1a4('0x4b')]=[{'all':!![]}];}_0x2aefc4=_['merge']({},_0x2aefc4,_0x384320[_0xa1a4('0x46')]);return db[_0xa1a4('0x31')]['find'](_0x2aefc4)['then'](handleEntityNotFound(_0x571eca,null))[_0xa1a4('0x2a')](respondWithResult(_0x571eca,null))[_0xa1a4('0x49')](handleError(_0x571eca,null));};exports[_0xa1a4('0x4c')]=function(_0x5e48cc,_0x341767){return db[_0xa1a4('0x31')]['create'](_0x5e48cc[_0xa1a4('0x4d')],{})[_0xa1a4('0x2a')](function(_0x57b61a){var _0x5b8508=_0x5e48cc[_0xa1a4('0x4e')][_0xa1a4('0x4f')]({'plain':!![]});if(!_0x5b8508)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b8508[_0xa1a4('0x50')]===_0xa1a4('0x4e')){var _0x18ab93=_0x57b61a[_0xa1a4('0x4f')]({'plain':!![]});var _0x13b640=_0xa1a4('0x51');return db[_0xa1a4('0x52')][_0xa1a4('0x53')]({'where':{'name':_0x13b640,'userProfileId':_0x5b8508['userProfileId']},'raw':!![]})[_0xa1a4('0x2a')](function(_0x5c340c){if(_0x5c340c&&_0x5c340c[_0xa1a4('0x54')]===0x0){return db[_0xa1a4('0x2b')]['create']({'name':_0x18ab93[_0xa1a4('0x2d')],'resourceId':_0x18ab93['id'],'type':_0x5c340c[_0xa1a4('0x2d')],'sectionId':_0x5c340c['id']},{})[_0xa1a4('0x2a')](function(){return _0x57b61a;});}else{return _0x57b61a;}})[_0xa1a4('0x49')](function(_0x2646d5){logger[_0xa1a4('0x2c')](_0xa1a4('0x55'),_0x2646d5);throw _0x2646d5;});}return _0x57b61a;})['then'](respondWithResult(_0x341767,0xc9))['catch'](handleError(_0x341767,null));};exports[_0xa1a4('0x56')]=function(_0x3df302,_0x1a6a37){if(_0x3df302[_0xa1a4('0x4d')]['id']){delete _0x3df302[_0xa1a4('0x4d')]['id'];}return db[_0xa1a4('0x31')][_0xa1a4('0x53')]({'where':{'id':_0x3df302['params']['id']}})['then'](handleEntityNotFound(_0x1a6a37,null))['then'](saveUpdates(_0x3df302[_0xa1a4('0x4d')],null))[_0xa1a4('0x2a')](respondWithResult(_0x1a6a37,null))[_0xa1a4('0x49')](handleError(_0x1a6a37,null));};exports['destroy']=function(_0x30c92d,_0x55ee4b){return db[_0xa1a4('0x31')][_0xa1a4('0x53')]({'where':{'id':_0x30c92d[_0xa1a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x55ee4b,null))[_0xa1a4('0x2a')](removeEntity(_0x55ee4b,null))['catch'](handleError(_0x55ee4b,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 923fe54..bd191ff 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 _0xdee6=['define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x5c1da5,_0x37188e){var _0x211e5e=function(_0xa41035){while(--_0xa41035){_0x5c1da5['push'](_0x5c1da5['shift']());}};_0x211e5e(++_0x37188e);}(_0xdee6,0x9f));var _0x6dee=function(_0x354e7e,_0x56aa43){_0x354e7e=_0x354e7e-0x0;var _0x3514d8=_0xdee6[_0x354e7e];return _0x3514d8;};'use strict';var _=require(_0x6dee('0x0'));var util=require(_0x6dee('0x1'));var logger=require(_0x6dee('0x2'))('api');var moment=require(_0x6dee('0x3'));var BPromise=require(_0x6dee('0x4'));var rp=require(_0x6dee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dee('0x6'));var config=require(_0x6dee('0x7'));var attributes=require(_0x6dee('0x8'));module['exports']=function(_0x11c51b,_0x5aed7b){return _0x11c51b[_0x6dee('0x9')](_0x6dee('0xa'),attributes,{'tableName':_0x6dee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc46=['lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0xbc46,0x14a));var _0x6bc4=function(_0x58d402,_0x738151){_0x58d402=_0x58d402-0x0;var _0x68b966=_0xbc46[_0x58d402];return _0x68b966;};'use strict';var _=require(_0x6bc4('0x0'));var util=require(_0x6bc4('0x1'));var logger=require(_0x6bc4('0x2'))('api');var moment=require(_0x6bc4('0x3'));var BPromise=require('bluebird');var rp=require(_0x6bc4('0x4'));var fs=require('fs');var path=require(_0x6bc4('0x5'));var rimraf=require('rimraf');var config=require(_0x6bc4('0x6'));var attributes=require(_0x6bc4('0x7'));module[_0x6bc4('0x8')]=function(_0x5ea477,_0x14c469){return _0x5ea477['define'](_0x6bc4('0x9'),attributes,{'tableName':'cm_contact_has_items','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 b1c99f4..a990842 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 _0x2634=['debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x554a13,_0x449e15){var _0x3779bf=function(_0x15febc){while(--_0x15febc){_0x554a13['push'](_0x554a13['shift']());}};_0x3779bf(++_0x449e15);}(_0x2634,0x126));var _0x4263=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2634[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4263('0x0'));var util=require(_0x4263('0x1'));var moment=require(_0x4263('0x2'));var BPromise=require(_0x4263('0x3'));var rs=require(_0x4263('0x4'));var fs=require('fs');var Redis=require(_0x4263('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4263('0x6'))(_0x4263('0x7'));var config=require('../../config/environment');var jayson=require(_0x4263('0x8'));var client=jayson[_0x4263('0x9')][_0x4263('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x572830,_0x184532,_0x3c6fa7){return new BPromise(function(_0x18bb20,_0x450750){return client[_0x4263('0xb')](_0x572830,_0x3c6fa7)[_0x4263('0xc')](function(_0x151582){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x4263('0xd'));logger[_0x4263('0xe')](_0x4263('0xf'),_0x184532,'request\x20sent',JSON[_0x4263('0x10')](_0x151582));if(_0x151582['error']){if(_0x151582[_0x4263('0x11')][_0x4263('0x12')]===0x1f4){logger['error'](_0x4263('0x13'),_0x184532,_0x151582[_0x4263('0x11')]['message']);return _0x450750(_0x151582[_0x4263('0x11')][_0x4263('0x14')]);}logger[_0x4263('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x151582[_0x4263('0x11')][_0x4263('0x14')]);return _0x18bb20(_0x151582['error'][_0x4263('0x14')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x4263('0xd'));_0x18bb20(_0x151582[_0x4263('0x15')][_0x4263('0x14')]);}})['catch'](function(_0x15928e){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x15928e);_0x450750(_0x15928e);});});} \ No newline at end of file +var _0x7e15=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x82bfba,_0x5eab20){var _0x114a32=function(_0x42508e){while(--_0x42508e){_0x82bfba['push'](_0x82bfba['shift']());}};_0x114a32(++_0x5eab20);}(_0x7e15,0x163));var _0x57e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e15[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x57e1('0x0'));var util=require(_0x57e1('0x1'));var moment=require(_0x57e1('0x2'));var BPromise=require(_0x57e1('0x3'));var rs=require(_0x57e1('0x4'));var fs=require('fs');var Redis=require(_0x57e1('0x5'));var db=require(_0x57e1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x57e1('0x7'))(_0x57e1('0x8'));var config=require(_0x57e1('0x9'));var jayson=require(_0x57e1('0xa'));var client=jayson[_0x57e1('0xb')][_0x57e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f184,_0x36d7b5,_0x529dbc){return new BPromise(function(_0x1c24c3,_0x5d6df4){return client[_0x57e1('0xd')](_0x33f184,_0x529dbc)['then'](function(_0x157911){logger[_0x57e1('0xe')](_0x57e1('0xf'),_0x36d7b5,'request\x20sent');logger[_0x57e1('0x10')](_0x57e1('0x11'),_0x36d7b5,_0x57e1('0x12'),JSON['stringify'](_0x157911));if(_0x157911[_0x57e1('0x13')]){if(_0x157911[_0x57e1('0x13')][_0x57e1('0x14')]===0x1f4){logger[_0x57e1('0x13')](_0x57e1('0xf'),_0x36d7b5,_0x157911[_0x57e1('0x13')][_0x57e1('0x15')]);return _0x5d6df4(_0x157911['error'][_0x57e1('0x15')]);}logger[_0x57e1('0x13')](_0x57e1('0xf'),_0x36d7b5,_0x157911[_0x57e1('0x13')][_0x57e1('0x15')]);return _0x1c24c3(_0x157911[_0x57e1('0x13')][_0x57e1('0x15')]);}else{logger['info'](_0x57e1('0xf'),_0x36d7b5,'request\x20sent');_0x1c24c3(_0x157911[_0x57e1('0x16')][_0x57e1('0x15')]);}})[_0x57e1('0x17')](function(_0x54f53e){logger[_0x57e1('0x13')](_0x57e1('0xf'),_0x36d7b5,_0x54f53e);_0x5d6df4(_0x54f53e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 969ebad..5953dee 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 _0x139a=['../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','post','create','put','update','destroy','multer','util','path','fs-extra'];(function(_0x5953be,_0x4e6e20){var _0x4ecf96=function(_0x12d5f8){while(--_0x12d5f8){_0x5953be['push'](_0x5953be['shift']());}};_0x4ecf96(++_0x4e6e20);}(_0x139a,0x1a0));var _0xa139=function(_0x5ebdea,_0x5963dd){_0x5ebdea=_0x5ebdea-0x0;var _0x443a51=_0x139a[_0x5ebdea];return _0x443a51;};'use strict';var multer=require(_0xa139('0x0'));var util=require(_0xa139('0x1'));var path=require(_0xa139('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa139('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa139('0x4'));var config=require(_0xa139('0x5'));var controller=require(_0xa139('0x6'));router[_0xa139('0x7')]('/',auth[_0xa139('0x8')](),controller['index']);router['get'](_0xa139('0x9'),auth[_0xa139('0x8')](),controller['show']);router[_0xa139('0xa')]('/',auth[_0xa139('0x8')](),controller[_0xa139('0xb')]);router[_0xa139('0xc')](_0xa139('0x9'),auth[_0xa139('0x8')](),controller[_0xa139('0xd')]);router['delete'](_0xa139('0x9'),auth['isAuthenticated'](),controller[_0xa139('0xe')]);module['exports']=router; \ No newline at end of file +var _0x25d3=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x25d3,0xc5));var _0x325d=function(_0x518fbb,_0x225475){_0x518fbb=_0x518fbb-0x0;var _0x5c8708=_0x25d3[_0x518fbb];return _0x5c8708;};'use strict';var multer=require(_0x325d('0x0'));var util=require('util');var path=require(_0x325d('0x1'));var timeout=require('connect-timeout');var express=require(_0x325d('0x2'));var router=express[_0x325d('0x3')]();var fs_extra=require(_0x325d('0x4'));var auth=require(_0x325d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x325d('0x6'));var controller=require('./cmContactHasItem.controller');router[_0x325d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x325d('0x7')](_0x325d('0x8'),auth[_0x325d('0x9')](),controller[_0x325d('0xa')]);router[_0x325d('0xb')]('/',auth[_0x325d('0x9')](),controller[_0x325d('0xc')]);router[_0x325d('0xd')](_0x325d('0x8'),auth['isAuthenticated'](),controller[_0x325d('0xe')]);router[_0x325d('0xf')](_0x325d('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x325d('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 3703942..9d7b44c 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 _0x4ba0=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','select','parse','values','isArray'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4ba0,0xe0));var _0x04ba=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x4ba0[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0x04ba('0x0'));var _=require(_0x04ba('0x1'));module[_0x04ba('0x2')]={'name':{'type':Sequelize[_0x04ba('0x3')],'get':function(_0x451ca0){return this[_0x04ba('0x4')](_0x04ba('0x5'));}},'alias':{'type':Sequelize[_0x04ba('0x6')],'allowNull':![],'set':function(_0x2b5ae1){this[_0x04ba('0x7')](_0x04ba('0x5'),_0x2b5ae1?_0x2b5ae1:this[_0x04ba('0x4')](_0x04ba('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x04ba('0x9')),'get':function(){if(this[_0x04ba('0x4')]('type')===_0x04ba('0xa')){return JSON[_0x04ba('0xb')](this[_0x04ba('0x4')](_0x04ba('0xc')));}else{return this['getDataValue'](_0x04ba('0xc'));}},'set':function(_0x8ea11){if(Array[_0x04ba('0xd')](_0x8ea11)){this[_0x04ba('0x7')]('values',JSON['stringify'](_0x8ea11));}else{this['setDataValue']('values',_0x8ea11);}}},'required':{'type':Sequelize[_0x04ba('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x04ba('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x04ba('0xf')](_0x04ba('0x10'))}}; \ No newline at end of file +var _0x86c8=['VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','select','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86c8,0xd5));var _0x886c=function(_0x5bbeaf,_0x4229de){_0x5bbeaf=_0x5bbeaf-0x0;var _0x28c2b3=_0x86c8[_0x5bbeaf];return _0x28c2b3;};'use strict';var Sequelize=require(_0x886c('0x0'));var _=require(_0x886c('0x1'));module[_0x886c('0x2')]={'name':{'type':Sequelize[_0x886c('0x3')],'get':function(_0x36a6d5){return this[_0x886c('0x4')](_0x886c('0x5'));}},'alias':{'type':Sequelize[_0x886c('0x6')],'allowNull':![],'set':function(_0x287b15){this[_0x886c('0x7')]('alias',_0x287b15?_0x287b15:this['getDataValue'](_0x886c('0x8')));}},'type':{'type':Sequelize[_0x886c('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x886c('0x9')),'get':function(){if(this[_0x886c('0x4')](_0x886c('0xa'))===_0x886c('0xb')){return JSON['parse'](this[_0x886c('0x4')]('values'));}else{return this['getDataValue'](_0x886c('0xc'));}},'set':function(_0x338576){if(Array[_0x886c('0xd')](_0x338576)){this['setDataValue'](_0x886c('0xc'),JSON[_0x886c('0xe')](_0x338576));}else{this[_0x886c('0x7')](_0x886c('0xc'),_0x338576);}}},'required':{'type':Sequelize[_0x886c('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x886c('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x886c('0x10')](_0x886c('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d8bf51e..85e937b 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 _0xd7da=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','CmCustomField','rawAttributes','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body','params','sequelize','transaction','create','Sequelize','TEXT','number','switch','defaultValue','cm_contacts','cf_%d','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4ac187,_0x4e1f34){var _0x27ce01=function(_0x21d9ff){while(--_0x21d9ff){_0x4ac187['push'](_0x4ac187['shift']());}};_0x27ce01(++_0x4e1f34);}(_0xd7da,0xec));var _0xad7d=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0xd7da[_0x37a0ab];return _0x13ca1d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad7d('0x0'));var jsonpatch=require(_0xad7d('0x1'));var rp=require(_0xad7d('0x2'));var moment=require(_0xad7d('0x3'));var BPromise=require(_0xad7d('0x4'));var Mustache=require(_0xad7d('0x5'));var util=require(_0xad7d('0x6'));var path=require(_0xad7d('0x7'));var sox=require('sox');var csv=require(_0xad7d('0x8'));var ejs=require(_0xad7d('0x9'));var fs=require('fs');var fs_extra=require(_0xad7d('0xa'));var _=require(_0xad7d('0xb'));var squel=require('squel');var crypto=require(_0xad7d('0xc'));var jsforce=require(_0xad7d('0xd'));var deskjs=require(_0xad7d('0xe'));var toCsv=require(_0xad7d('0x8'));var querystring=require('querystring');var Papa=require(_0xad7d('0xf'));var Redis=require(_0xad7d('0x10'));var authService=require(_0xad7d('0x11'));var qs=require(_0xad7d('0x12'));var as=require(_0xad7d('0x13'));var hardwareService=require(_0xad7d('0x14'));var logger=require(_0xad7d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xad7d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xad7d('0x17'))['db'];function respondWithStatusCode(_0x2091cb,_0x404a99){_0x404a99=_0x404a99||0xcc;return function(_0x37c581){if(_0x37c581){return _0x2091cb[_0xad7d('0x18')](_0x404a99);}return _0x2091cb[_0xad7d('0x19')](_0x404a99)[_0xad7d('0x1a')]();};}function respondWithResult(_0x1239a5,_0x123bfd){_0x123bfd=_0x123bfd||0xc8;return function(_0xf4ad94){if(_0xf4ad94){return _0x1239a5[_0xad7d('0x19')](_0x123bfd)[_0xad7d('0x1b')](_0xf4ad94);}};}function respondWithFilteredResult(_0x4884a9,_0x2ca2cf){return function(_0x432aa4){if(_0x432aa4){var _0x12e295=typeof _0x2ca2cf[_0xad7d('0x1c')]===_0xad7d('0x1d')&&typeof _0x2ca2cf[_0xad7d('0x1e')]===_0xad7d('0x1d');var _0x46b5e5=_0x432aa4[_0xad7d('0x1f')];var _0x19972b=_0x12e295?0x0:_0x2ca2cf[_0xad7d('0x1c')];var _0x383117=_0x12e295?_0x432aa4[_0xad7d('0x1f')]:_0x2ca2cf[_0xad7d('0x1c')]+_0x2ca2cf['limit'];var _0x3a8046;if(_0x383117>=_0x46b5e5){_0x383117=_0x46b5e5;_0x3a8046=0xc8;}else{_0x3a8046=0xce;}_0x4884a9[_0xad7d('0x19')](_0x3a8046);return _0x4884a9[_0xad7d('0x20')](_0xad7d('0x21'),_0x19972b+'-'+_0x383117+'/'+_0x46b5e5)['json'](_0x432aa4);}return null;};}function patchUpdates(_0x5a77fb){return function(_0x58f79c){try{jsonpatch['apply'](_0x58f79c,_0x5a77fb,!![]);}catch(_0x2981e4){return BPromise[_0xad7d('0x22')](_0x2981e4);}return _0x58f79c[_0xad7d('0x23')]();};}function saveUpdates(_0x194bd8,_0x42b353){return function(_0x2a2d6f){if(_0x2a2d6f){return _0x2a2d6f['update'](_0x194bd8)[_0xad7d('0x24')](function(_0x5707ce){return _0x5707ce;});}return null;};}function removeEntity(_0x2794cd,_0x5872ab){return function(_0x268b00){if(_0x268b00){return _0x268b00[_0xad7d('0x25')]()[_0xad7d('0x24')](function(){_0x2794cd[_0xad7d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2577b3,_0x5c6c77){return function(_0x5bdae8){if(!_0x5bdae8){_0x2577b3[_0xad7d('0x18')](0x194);}return _0x5bdae8;};}function handleError(_0x2cda55,_0x125cbc){_0x125cbc=_0x125cbc||0x1f4;return function(_0x36a8c7){logger['error'](_0x36a8c7[_0xad7d('0x26')]);if(_0x36a8c7['name']){delete _0x36a8c7[_0xad7d('0x27')];}_0x2cda55[_0xad7d('0x19')](_0x125cbc)['send'](_0x36a8c7);};}exports['index']=function(_0x5df38e,_0x4a88e4){var _0xaf0fcb={},_0x5b5ae6={},_0x879cc4={'count':0x0,'rows':[]};var _0x5250d9=_['map'](db[_0xad7d('0x28')][_0xad7d('0x29')],function(_0x18ed4a){return{'name':_0x18ed4a['fieldName'],'type':_0x18ed4a[_0xad7d('0x2a')][_0xad7d('0x2b')]};});_0x5b5ae6[_0xad7d('0x2c')]=_[_0xad7d('0x2d')](_[_0xad7d('0x2e')](_0x5250d9,_0xad7d('0x27')),[_0xad7d('0x27')]);_0x5b5ae6['query']=_[_0xad7d('0x2f')](_0x5df38e[_0xad7d('0x30')]);_0x5b5ae6[_0xad7d('0x31')]=_[_0xad7d('0x32')](_0x5b5ae6[_0xad7d('0x2c')],_0x5b5ae6['query']);_0xaf0fcb[_0xad7d('0x33')]=_[_0xad7d('0x32')](_0x5b5ae6[_0xad7d('0x2c')],qs['fields'](_0x5df38e[_0xad7d('0x30')][_0xad7d('0x34')]));_0xaf0fcb[_0xad7d('0x33')]=_0xaf0fcb[_0xad7d('0x33')][_0xad7d('0x35')]?_0xaf0fcb[_0xad7d('0x33')]:_0x5b5ae6['model'];if(!_0x5df38e[_0xad7d('0x30')][_0xad7d('0x36')]('nolimit')){_0xaf0fcb[_0xad7d('0x1e')]=qs[_0xad7d('0x1e')](_0x5df38e[_0xad7d('0x30')]['limit']);_0xaf0fcb['offset']=qs['offset'](_0x5df38e[_0xad7d('0x30')][_0xad7d('0x1c')]);}_0xaf0fcb[_0xad7d('0x37')]=qs[_0xad7d('0x38')](_0x5df38e[_0xad7d('0x30')]['sort']);_0xaf0fcb[_0xad7d('0x39')]=qs[_0xad7d('0x31')](_['pick'](_0x5df38e['query'],_0x5b5ae6[_0xad7d('0x31')]),_0x5250d9);if(_0x5df38e[_0xad7d('0x30')][_0xad7d('0x3a')]){_0xaf0fcb[_0xad7d('0x39')]=_[_0xad7d('0x3b')](_0xaf0fcb[_0xad7d('0x39')],{'$or':_['map'](_0x5250d9,function(_0x3abfcd){if(_0x3abfcd[_0xad7d('0x2a')]!==_0xad7d('0x3c')){var _0x570bee={};_0x570bee[_0x3abfcd[_0xad7d('0x27')]]={'$like':'%'+_0x5df38e['query']['filter']+'%'};return _0x570bee;}})});}_0xaf0fcb=_['merge']({},_0xaf0fcb,_0x5df38e[_0xad7d('0x3d')]);var _0x998fb={'where':_0xaf0fcb[_0xad7d('0x39')]};return db[_0xad7d('0x28')][_0xad7d('0x1f')](_0x998fb)[_0xad7d('0x24')](function(_0x4a50b1){_0x879cc4[_0xad7d('0x1f')]=_0x4a50b1;if(_0x5df38e[_0xad7d('0x30')][_0xad7d('0x3e')]){_0xaf0fcb[_0xad7d('0x3f')]=[{'all':!![]}];}return db[_0xad7d('0x28')][_0xad7d('0x40')](_0xaf0fcb);})[_0xad7d('0x24')](function(_0x54fe21){_0x879cc4[_0xad7d('0x41')]=_0x54fe21;return _0x879cc4;})[_0xad7d('0x24')](respondWithFilteredResult(_0x4a88e4,_0xaf0fcb))[_0xad7d('0x42')](handleError(_0x4a88e4,null));};exports[_0xad7d('0x43')]=function(_0x1efbbe,_0x29d58f){var _0x37b5e4={'raw':!![],'where':{'id':_0x1efbbe['params']['id']}},_0x83f3f0={};_0x83f3f0['model']=_['keys'](db[_0xad7d('0x28')][_0xad7d('0x29')]);_0x83f3f0[_0xad7d('0x30')]=_[_0xad7d('0x2f')](_0x1efbbe[_0xad7d('0x30')]);_0x83f3f0[_0xad7d('0x31')]=_[_0xad7d('0x32')](_0x83f3f0[_0xad7d('0x2c')],_0x83f3f0[_0xad7d('0x30')]);_0x37b5e4[_0xad7d('0x33')]=_[_0xad7d('0x32')](_0x83f3f0[_0xad7d('0x2c')],qs[_0xad7d('0x34')](_0x1efbbe[_0xad7d('0x30')][_0xad7d('0x34')]));_0x37b5e4['attributes']=_0x37b5e4[_0xad7d('0x33')]['length']?_0x37b5e4[_0xad7d('0x33')]:_0x83f3f0[_0xad7d('0x2c')];if(_0x1efbbe[_0xad7d('0x30')][_0xad7d('0x3e')]){_0x37b5e4['include']=[{'all':!![]}];}_0x37b5e4=_[_0xad7d('0x3b')]({},_0x37b5e4,_0x1efbbe[_0xad7d('0x3d')]);return db[_0xad7d('0x28')][_0xad7d('0x44')](_0x37b5e4)[_0xad7d('0x24')](handleEntityNotFound(_0x29d58f,null))[_0xad7d('0x24')](respondWithResult(_0x29d58f,null))[_0xad7d('0x42')](handleError(_0x29d58f,null));};exports['update']=function(_0x3e2160,_0x4cf427){if(_0x3e2160[_0xad7d('0x45')]['id']){delete _0x3e2160[_0xad7d('0x45')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x3e2160['params']['id']}})[_0xad7d('0x24')](handleEntityNotFound(_0x4cf427,null))[_0xad7d('0x24')](saveUpdates(_0x3e2160[_0xad7d('0x45')],null))[_0xad7d('0x24')](respondWithResult(_0x4cf427,null))[_0xad7d('0x42')](handleError(_0x4cf427,null));};exports[_0xad7d('0x25')]=function(_0x2c1459,_0x117f91){return db[_0xad7d('0x28')][_0xad7d('0x44')]({'where':{'id':_0x2c1459[_0xad7d('0x46')]['id']}})['then'](handleEntityNotFound(_0x117f91,null))[_0xad7d('0x24')](removeEntity(_0x117f91,null))[_0xad7d('0x42')](handleError(_0x117f91,null));};exports['create']=function(_0x485583,_0x4b1c7d){var _0x236c11;return db[_0xad7d('0x47')][_0xad7d('0x48')](function(_0x5415b5){return db[_0xad7d('0x28')][_0xad7d('0x49')](_0x485583[_0xad7d('0x45')],{'transaction':_0x5415b5})[_0xad7d('0x24')](function(_0x92e703){_0x236c11=_0x92e703;var _0x2e5320={'type':db[_0xad7d('0x4a')]['TEXT'],'transaction':_0x5415b5};switch(_0x485583['body']['type']){case'text':_0x2e5320['type']=db['Sequelize'][_0xad7d('0x4b')];break;case _0xad7d('0x4c'):_0x2e5320[_0xad7d('0x2a')]=db[_0xad7d('0x4a')]['INTEGER'];break;case _0xad7d('0x4d'):_0x2e5320[_0xad7d('0x2a')]=db[_0xad7d('0x4a')]['BOOLEAN'];_0x2e5320[_0xad7d('0x4e')]=![];break;default:}return db[_0xad7d('0x47')]['queryInterface']['addColumn'](_0xad7d('0x4f'),util['format'](_0xad7d('0x50'),_0x236c11['id']),_0x2e5320);})[_0xad7d('0x24')](function(){return _0x236c11;});})['then'](respondWithResult(_0x4b1c7d,0xc9))[_0xad7d('0x42')](handleError(_0x4b1c7d,null));}; \ No newline at end of file +var _0x861e=['number','switch','BOOLEAN','addColumn','format','cf_%d','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','options','find','catch','body','create','sequelize','transaction','Sequelize','text','TEXT'];(function(_0x5c54e0,_0x3d8d7a){var _0xd6345d=function(_0x20f9e9){while(--_0x20f9e9){_0x5c54e0['push'](_0x5c54e0['shift']());}};_0xd6345d(++_0x3d8d7a);}(_0x861e,0x1aa));var _0xe861=function(_0x5613b7,_0x1e2c68){_0x5613b7=_0x5613b7-0x0;var _0x40dc96=_0x861e[_0x5613b7];return _0x40dc96;};'use strict';var emlformat=require(_0xe861('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe861('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe861('0x2'));var moment=require(_0xe861('0x3'));var BPromise=require(_0xe861('0x4'));var Mustache=require(_0xe861('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe861('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe861('0x7'));var _=require(_0xe861('0x8'));var squel=require(_0xe861('0x9'));var crypto=require(_0xe861('0xa'));var jsforce=require(_0xe861('0xb'));var deskjs=require(_0xe861('0xc'));var toCsv=require(_0xe861('0x6'));var querystring=require('querystring');var Papa=require(_0xe861('0xd'));var Redis=require(_0xe861('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe861('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe861('0x10'));var logger=require(_0xe861('0x11'))(_0xe861('0x12'));var utils=require(_0xe861('0x13'));var config=require(_0xe861('0x14'));var licenseUtil=require(_0xe861('0x15'));var db=require(_0xe861('0x16'))['db'];function respondWithStatusCode(_0x365a28,_0x3ded65){_0x3ded65=_0x3ded65||0xcc;return function(_0x4c82b6){if(_0x4c82b6){return _0x365a28[_0xe861('0x17')](_0x3ded65);}return _0x365a28[_0xe861('0x18')](_0x3ded65)[_0xe861('0x19')]();};}function respondWithResult(_0x2fa373,_0x3da949){_0x3da949=_0x3da949||0xc8;return function(_0x2dbe5b){if(_0x2dbe5b){return _0x2fa373[_0xe861('0x18')](_0x3da949)[_0xe861('0x1a')](_0x2dbe5b);}};}function respondWithFilteredResult(_0x3e57af,_0x20ed4d){return function(_0x128ef7){if(_0x128ef7){var _0x28e17c=typeof _0x20ed4d[_0xe861('0x1b')]===_0xe861('0x1c')&&typeof _0x20ed4d[_0xe861('0x1d')]===_0xe861('0x1c');var _0x144929=_0x128ef7['count'];var _0x389f3c=_0x28e17c?0x0:_0x20ed4d[_0xe861('0x1b')];var _0x161bcd=_0x28e17c?_0x128ef7[_0xe861('0x1e')]:_0x20ed4d['offset']+_0x20ed4d['limit'];var _0x3e95af;if(_0x161bcd>=_0x144929){_0x161bcd=_0x144929;_0x3e95af=0xc8;}else{_0x3e95af=0xce;}_0x3e57af['status'](_0x3e95af);return _0x3e57af[_0xe861('0x1f')]('Content-Range',_0x389f3c+'-'+_0x161bcd+'/'+_0x144929)['json'](_0x128ef7);}return null;};}function patchUpdates(_0x245115){return function(_0x567e5a){try{jsonpatch[_0xe861('0x20')](_0x567e5a,_0x245115,!![]);}catch(_0x445c01){return BPromise[_0xe861('0x21')](_0x445c01);}return _0x567e5a['save']();};}function saveUpdates(_0x140bab,_0x4d8411){return function(_0x431859){if(_0x431859){return _0x431859[_0xe861('0x22')](_0x140bab)[_0xe861('0x23')](function(_0x2f3ef0){return _0x2f3ef0;});}return null;};}function removeEntity(_0x5e0ac6,_0x2c3801){return function(_0x30ee35){if(_0x30ee35){return _0x30ee35[_0xe861('0x24')]()['then'](function(){_0x5e0ac6['status'](0xcc)[_0xe861('0x19')]();});}};}function handleEntityNotFound(_0x3d2ee1,_0x17ef37){return function(_0x4bc3dc){if(!_0x4bc3dc){_0x3d2ee1[_0xe861('0x17')](0x194);}return _0x4bc3dc;};}function handleError(_0x40d413,_0x1c3f3c){_0x1c3f3c=_0x1c3f3c||0x1f4;return function(_0x36fe54){logger[_0xe861('0x25')](_0x36fe54[_0xe861('0x26')]);if(_0x36fe54[_0xe861('0x27')]){delete _0x36fe54[_0xe861('0x27')];}_0x40d413['status'](_0x1c3f3c)['send'](_0x36fe54);};}exports[_0xe861('0x28')]=function(_0x31d5c3,_0x46590a){var _0x59d021={},_0x25cff0={},_0x5f0f11={'count':0x0,'rows':[]};var _0x5c16ac=_[_0xe861('0x29')](db[_0xe861('0x2a')][_0xe861('0x2b')],function(_0x20cd25){return{'name':_0x20cd25[_0xe861('0x2c')],'type':_0x20cd25[_0xe861('0x2d')][_0xe861('0x2e')]};});_0x25cff0[_0xe861('0x2f')]=_[_0xe861('0x30')](_['map'](_0x5c16ac,_0xe861('0x27')),[_0xe861('0x27')]);_0x25cff0['query']=_[_0xe861('0x31')](_0x31d5c3[_0xe861('0x32')]);_0x25cff0[_0xe861('0x33')]=_[_0xe861('0x34')](_0x25cff0['model'],_0x25cff0['query']);_0x59d021[_0xe861('0x35')]=_['intersection'](_0x25cff0[_0xe861('0x2f')],qs[_0xe861('0x36')](_0x31d5c3['query'][_0xe861('0x36')]));_0x59d021['attributes']=_0x59d021[_0xe861('0x35')]['length']?_0x59d021['attributes']:_0x25cff0[_0xe861('0x2f')];if(!_0x31d5c3[_0xe861('0x32')][_0xe861('0x37')]('nolimit')){_0x59d021['limit']=qs['limit'](_0x31d5c3[_0xe861('0x32')]['limit']);_0x59d021[_0xe861('0x1b')]=qs[_0xe861('0x1b')](_0x31d5c3[_0xe861('0x32')][_0xe861('0x1b')]);}_0x59d021[_0xe861('0x38')]=qs[_0xe861('0x39')](_0x31d5c3[_0xe861('0x32')][_0xe861('0x39')]);_0x59d021[_0xe861('0x3a')]=qs[_0xe861('0x33')](_['pick'](_0x31d5c3[_0xe861('0x32')],_0x25cff0['filters']),_0x5c16ac);if(_0x31d5c3[_0xe861('0x32')][_0xe861('0x3b')]){_0x59d021[_0xe861('0x3a')]=_[_0xe861('0x3c')](_0x59d021[_0xe861('0x3a')],{'$or':_[_0xe861('0x29')](_0x5c16ac,function(_0x1f82ff){if(_0x1f82ff[_0xe861('0x2d')]!==_0xe861('0x3d')){var _0x377438={};_0x377438[_0x1f82ff[_0xe861('0x27')]]={'$like':'%'+_0x31d5c3[_0xe861('0x32')][_0xe861('0x3b')]+'%'};return _0x377438;}})});}_0x59d021=_[_0xe861('0x3c')]({},_0x59d021,_0x31d5c3['options']);var _0x5cce30={'where':_0x59d021[_0xe861('0x3a')]};return db['CmCustomField'][_0xe861('0x1e')](_0x5cce30)[_0xe861('0x23')](function(_0x589171){_0x5f0f11[_0xe861('0x1e')]=_0x589171;if(_0x31d5c3['query']['includeAll']){_0x59d021['include']=[{'all':!![]}];}return db['CmCustomField'][_0xe861('0x3e')](_0x59d021);})['then'](function(_0x11073e){_0x5f0f11[_0xe861('0x3f')]=_0x11073e;return _0x5f0f11;})[_0xe861('0x23')](respondWithFilteredResult(_0x46590a,_0x59d021))['catch'](handleError(_0x46590a,null));};exports[_0xe861('0x40')]=function(_0x1fc82a,_0x46b7d9){var _0x5ce903={'raw':!![],'where':{'id':_0x1fc82a[_0xe861('0x41')]['id']}},_0x24e328={};_0x24e328['model']=_[_0xe861('0x31')](db[_0xe861('0x2a')]['rawAttributes']);_0x24e328[_0xe861('0x32')]=_[_0xe861('0x31')](_0x1fc82a[_0xe861('0x32')]);_0x24e328[_0xe861('0x33')]=_[_0xe861('0x34')](_0x24e328[_0xe861('0x2f')],_0x24e328[_0xe861('0x32')]);_0x5ce903['attributes']=_['intersection'](_0x24e328[_0xe861('0x2f')],qs[_0xe861('0x36')](_0x1fc82a[_0xe861('0x32')][_0xe861('0x36')]));_0x5ce903['attributes']=_0x5ce903[_0xe861('0x35')]['length']?_0x5ce903['attributes']:_0x24e328[_0xe861('0x2f')];if(_0x1fc82a[_0xe861('0x32')][_0xe861('0x42')]){_0x5ce903[_0xe861('0x43')]=[{'all':!![]}];}_0x5ce903=_[_0xe861('0x3c')]({},_0x5ce903,_0x1fc82a[_0xe861('0x44')]);return db[_0xe861('0x2a')][_0xe861('0x45')](_0x5ce903)[_0xe861('0x23')](handleEntityNotFound(_0x46b7d9,null))[_0xe861('0x23')](respondWithResult(_0x46b7d9,null))[_0xe861('0x46')](handleError(_0x46b7d9,null));};exports[_0xe861('0x22')]=function(_0x470e33,_0xb9dbe1){if(_0x470e33[_0xe861('0x47')]['id']){delete _0x470e33['body']['id'];}return db['CmCustomField'][_0xe861('0x45')]({'where':{'id':_0x470e33[_0xe861('0x41')]['id']}})[_0xe861('0x23')](handleEntityNotFound(_0xb9dbe1,null))['then'](saveUpdates(_0x470e33[_0xe861('0x47')],null))[_0xe861('0x23')](respondWithResult(_0xb9dbe1,null))[_0xe861('0x46')](handleError(_0xb9dbe1,null));};exports[_0xe861('0x24')]=function(_0x242832,_0x1e4621){return db[_0xe861('0x2a')][_0xe861('0x45')]({'where':{'id':_0x242832[_0xe861('0x41')]['id']}})['then'](handleEntityNotFound(_0x1e4621,null))['then'](removeEntity(_0x1e4621,null))[_0xe861('0x46')](handleError(_0x1e4621,null));};exports[_0xe861('0x48')]=function(_0x4cbc9a,_0x8d7a62){var _0x2d36ad;return db[_0xe861('0x49')][_0xe861('0x4a')](function(_0x27991b){return db['CmCustomField'][_0xe861('0x48')](_0x4cbc9a['body'],{'transaction':_0x27991b})['then'](function(_0x3f423a){_0x2d36ad=_0x3f423a;var _0x40a3bf={'type':db[_0xe861('0x4b')]['TEXT'],'transaction':_0x27991b};switch(_0x4cbc9a[_0xe861('0x47')][_0xe861('0x2d')]){case _0xe861('0x4c'):_0x40a3bf[_0xe861('0x2d')]=db['Sequelize'][_0xe861('0x4d')];break;case _0xe861('0x4e'):_0x40a3bf[_0xe861('0x2d')]=db['Sequelize']['INTEGER'];break;case _0xe861('0x4f'):_0x40a3bf[_0xe861('0x2d')]=db[_0xe861('0x4b')][_0xe861('0x50')];_0x40a3bf['defaultValue']=![];break;default:}return db[_0xe861('0x49')]['queryInterface'][_0xe861('0x51')]('cm_contacts',util[_0xe861('0x52')](_0xe861('0x53'),_0x2d36ad['id']),_0x40a3bf);})[_0xe861('0x23')](function(){return _0x2d36ad;});})[_0xe861('0x23')](respondWithResult(_0x8d7a62,0xc9))[_0xe861('0x46')](handleError(_0x8d7a62,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e36bed3..d8eefe6 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 _0x8d3a=['path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x402495,_0x4325d3){var _0x4dde60=function(_0x5a4de1){while(--_0x5a4de1){_0x402495['push'](_0x402495['shift']());}};_0x4dde60(++_0x4325d3);}(_0x8d3a,0x9f));var _0xa8d3=function(_0x5a9335,_0x41bb2d){_0x5a9335=_0x5a9335-0x0;var _0xbb5e4b=_0x8d3a[_0x5a9335];return _0xbb5e4b;};'use strict';var _=require(_0xa8d3('0x0'));var util=require(_0xa8d3('0x1'));var logger=require(_0xa8d3('0x2'))(_0xa8d3('0x3'));var moment=require('moment');var BPromise=require(_0xa8d3('0x4'));var rp=require(_0xa8d3('0x5'));var fs=require('fs');var path=require(_0xa8d3('0x6'));var rimraf=require(_0xa8d3('0x7'));var config=require(_0xa8d3('0x8'));var attributes=require(_0xa8d3('0x9'));module['exports']=function(_0x55f03a,_0x4174bd){return _0x55f03a['define'](_0xa8d3('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d9a=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','api','moment','request-promise','path'];(function(_0x72872f,_0x22fd46){var _0xf05886=function(_0x388521){while(--_0x388521){_0x72872f['push'](_0x72872f['shift']());}};_0xf05886(++_0x22fd46);}(_0x5d9a,0xae));var _0xa5d9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5d9a[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xa5d9('0x0'));var util=require(_0xa5d9('0x1'));var logger=require('../../config/logger')(_0xa5d9('0x2'));var moment=require(_0xa5d9('0x3'));var BPromise=require('bluebird');var rp=require(_0xa5d9('0x4'));var fs=require('fs');var path=require(_0xa5d9('0x5'));var rimraf=require(_0xa5d9('0x6'));var config=require(_0xa5d9('0x7'));var attributes=require(_0xa5d9('0x8'));module[_0xa5d9('0x9')]=function(_0x292576,_0x1d1694){return _0x292576[_0xa5d9('0xa')](_0xa5d9('0xb'),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 156a063..779c28b 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 _0xe306=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x440d5d,_0x3edda1){var _0x319f6f=function(_0x5d7715){while(--_0x5d7715){_0x440d5d['push'](_0x440d5d['shift']());}};_0x319f6f(++_0x3edda1);}(_0xe306,0x149));var _0x6e30=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe306[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x6e30('0x0'));var util=require(_0x6e30('0x1'));var moment=require(_0x6e30('0x2'));var BPromise=require(_0x6e30('0x3'));var rs=require(_0x6e30('0x4'));var fs=require('fs');var Redis=require(_0x6e30('0x5'));var db=require(_0x6e30('0x6'))['db'];var utils=require(_0x6e30('0x7'));var logger=require(_0x6e30('0x8'))(_0x6e30('0x9'));var config=require(_0x6e30('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46077f,_0x2ce648,_0x579509){return new BPromise(function(_0x4e820a,_0x45226a){return client[_0x6e30('0xc')](_0x46077f,_0x579509)['then'](function(_0x1661ee){logger['info'](_0x6e30('0xd'),_0x2ce648,_0x6e30('0xe'));logger[_0x6e30('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x2ce648,_0x6e30('0xe'),JSON['stringify'](_0x1661ee));if(_0x1661ee[_0x6e30('0x10')]){if(_0x1661ee[_0x6e30('0x10')][_0x6e30('0x11')]===0x1f4){logger[_0x6e30('0x10')](_0x6e30('0xd'),_0x2ce648,_0x1661ee['error'][_0x6e30('0x12')]);return _0x45226a(_0x1661ee['error']['message']);}logger['error'](_0x6e30('0xd'),_0x2ce648,_0x1661ee['error']['message']);return _0x4e820a(_0x1661ee[_0x6e30('0x10')][_0x6e30('0x12')]);}else{logger[_0x6e30('0x13')]('CmCustomField,\x20%s,\x20%s',_0x2ce648,_0x6e30('0xe'));_0x4e820a(_0x1661ee[_0x6e30('0x14')][_0x6e30('0x12')]);}})['catch'](function(_0x284b0c){logger[_0x6e30('0x10')]('CmCustomField,\x20%s,\x20%s',_0x2ce648,_0x284b0c);_0x45226a(_0x284b0c);});});} \ No newline at end of file +var _0x4a0a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','ioredis','../../mysqldb'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x4a0a,0x9c));var _0xa4a0=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x4a0a[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0xa4a0('0x0'));var moment=require(_0xa4a0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4a0('0x2'));var db=require(_0xa4a0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4a0('0x4'))(_0xa4a0('0x5'));var config=require(_0xa4a0('0x6'));var jayson=require(_0xa4a0('0x7'));var client=jayson[_0xa4a0('0x8')][_0xa4a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151258,_0x3b83c3,_0x3232f5){return new BPromise(function(_0x4c8b9e,_0x3b28a9){return client['request'](_0x151258,_0x3232f5)[_0xa4a0('0xa')](function(_0x171b63){logger[_0xa4a0('0xb')](_0xa4a0('0xc'),_0x3b83c3,_0xa4a0('0xd'));logger['debug'](_0xa4a0('0xe'),_0x3b83c3,_0xa4a0('0xd'),JSON['stringify'](_0x171b63));if(_0x171b63['error']){if(_0x171b63[_0xa4a0('0xf')][_0xa4a0('0x10')]===0x1f4){logger['error'](_0xa4a0('0xc'),_0x3b83c3,_0x171b63['error'][_0xa4a0('0x11')]);return _0x3b28a9(_0x171b63[_0xa4a0('0xf')][_0xa4a0('0x11')]);}logger[_0xa4a0('0xf')](_0xa4a0('0xc'),_0x3b83c3,_0x171b63[_0xa4a0('0xf')][_0xa4a0('0x11')]);return _0x4c8b9e(_0x171b63[_0xa4a0('0xf')]['message']);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x3b83c3,'request\x20sent');_0x4c8b9e(_0x171b63[_0xa4a0('0x12')][_0xa4a0('0x11')]);}})[_0xa4a0('0x13')](function(_0xc5f4b9){logger[_0xa4a0('0xf')](_0xa4a0('0xc'),_0x3b83c3,_0xc5f4b9);_0x3b28a9(_0xc5f4b9);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 1af5e4b..2300a19 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x5fc3,0xa8));var _0x35fc=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x5fc3[_0x492af5];return _0x59f529;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0xc')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);router[_0x35fc('0x11')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x931f=['/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated'];(function(_0x5f9cea,_0x5d4a5d){var _0x5a2f04=function(_0x3be405){while(--_0x3be405){_0x5f9cea['push'](_0x5f9cea['shift']());}};_0x5a2f04(++_0x5d4a5d);}(_0x931f,0x139));var _0xf931=function(_0x4bab92,_0x497266){_0x4bab92=_0x4bab92-0x0;var _0x5ebe8b=_0x931f[_0x4bab92];return _0x5ebe8b;};'use strict';var multer=require(_0xf931('0x0'));var util=require(_0xf931('0x1'));var path=require(_0xf931('0x2'));var timeout=require(_0xf931('0x3'));var express=require(_0xf931('0x4'));var router=express[_0xf931('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf931('0x6'));var interaction=require(_0xf931('0x7'));var config=require(_0xf931('0x8'));var controller=require(_0xf931('0x9'));router['get']('/',auth[_0xf931('0xa')](),controller['index']);router['get'](_0xf931('0xb'),auth[_0xf931('0xa')](),controller[_0xf931('0xc')]);router[_0xf931('0xd')]('/',auth[_0xf931('0xa')](),controller['create']);router['put'](_0xf931('0xb'),auth[_0xf931('0xa')](),controller[_0xf931('0xe')]);router[_0xf931('0xf')](_0xf931('0xb'),auth[_0xf931('0xa')](),controller[_0xf931('0x10')]);module[_0xf931('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index c936e03..36d2b2c 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 _0xde29=['sequelize','exports','STRING','BOOLEAN','format','INTEGER','DATE','UNSIGNED','contactListQueue','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xde29,0x15d));var _0x9de2=function(_0x245490,_0x40ba27){_0x245490=_0x245490-0x0;var _0x341444=_0xde29[_0x245490];return _0x341444;};'use strict';var moment=require(_0x9de2('0x0'));var Sequelize=require(_0x9de2('0x1'));module[_0x9de2('0x2')]={'phone':{'type':Sequelize[_0x9de2('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x9de2('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x9de2('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9de2('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9de2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9de2('0x7')]},'priority':{'type':Sequelize[_0x9de2('0x6')](0x2)[_0x9de2('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9de2('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9de2('0x6')],'unique':_0x9de2('0x9')},'ListId':{'type':Sequelize[_0x9de2('0x6')],'unique':_0x9de2('0x9')},'UserId':{'type':Sequelize[_0x9de2('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x9de2('0x6')],'unique':_0x9de2('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x9de2('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xe5eb=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x54a8d3,_0x12b8b7){var _0x5eec0e=function(_0xbc1ade){while(--_0xbc1ade){_0x54a8d3['push'](_0x54a8d3['shift']());}};_0x5eec0e(++_0x12b8b7);}(_0xe5eb,0x185));var _0xbe5e=function(_0x2f4cfb,_0x160886){_0x2f4cfb=_0x2f4cfb-0x0;var _0x2d0702=_0xe5eb[_0x2f4cfb];return _0x2d0702;};'use strict';var moment=require(_0xbe5e('0x0'));var Sequelize=require(_0xbe5e('0x1'));module[_0xbe5e('0x2')]={'phone':{'type':Sequelize[_0xbe5e('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xbe5e('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbe5e('0x5')],'defaultValue':moment()[_0xbe5e('0x6')](_0xbe5e('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbe5e('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbe5e('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbe5e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbe5e('0x5')]},'priority':{'type':Sequelize[_0xbe5e('0x8')](0x2)[_0xbe5e('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbe5e('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbe5e('0x8')],'unique':_0xbe5e('0xa')},'ListId':{'type':Sequelize[_0xbe5e('0x8')],'unique':_0xbe5e('0xa')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xbe5e('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbe5e('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbe5e('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xbe5e('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbe5e('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xbe5e('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 581d360..3df5eaf 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 _0x85d0=['$between','$like','$notLike','$iLike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','keys','includeAll','options','find','create','body','describe','destroy','VoiceQueueId','CampaignId','createdAt','state','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','calleridname','firstName','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','scheduledAt','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getPreviewRecall','scheduledat','LOCK','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','api','../../config/environment','../../mysqldb','json','undefined','limit','count','offset','status','set','update','then','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','model','map','query','intersection','filters','concat','$or','$gt','$gte','$lte','$ne','$eq','$not'];(function(_0x306980,_0xcf2bbc){var _0xdc8123=function(_0x47e3f4){while(--_0x47e3f4){_0x306980['push'](_0x306980['shift']());}};_0xdc8123(++_0xcf2bbc);}(_0x85d0,0x164));var _0x085d=function(_0x3641d7,_0x3d167e){_0x3641d7=_0x3641d7-0x0;var _0x2cf25d=_0x85d0[_0x3641d7];return _0x2cf25d;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x085d('0x0'));var shared=require(_0x085d('0x1'));var db=require(_0x085d('0x2'))['db'];function respondWithResult(_0x313db8,_0x231765){_0x231765=_0x231765||0xc8;return function(_0x19ae4c){if(_0x19ae4c){return _0x313db8['status'](_0x231765)[_0x085d('0x3')](_0x19ae4c);}};}function respondWithFilteredResult(_0x5c917f,_0x364f09){return function(_0x9acc97){if(_0x9acc97){var _0x2a6902=typeof _0x364f09['offset']===_0x085d('0x4')&&typeof _0x364f09[_0x085d('0x5')]===_0x085d('0x4');var _0x3129a8=_0x9acc97[_0x085d('0x6')];var _0x6450ab=_0x2a6902?0x0:_0x364f09[_0x085d('0x7')];var _0x985cb3=_0x2a6902?_0x9acc97[_0x085d('0x6')]:_0x364f09['offset']+_0x364f09[_0x085d('0x5')];var _0x19b205;if(_0x985cb3>=_0x3129a8){_0x985cb3=_0x3129a8;_0x19b205=0xc8;}else{_0x19b205=0xce;}_0x5c917f[_0x085d('0x8')](_0x19b205);return _0x5c917f[_0x085d('0x9')]('Content-Range',_0x6450ab+'-'+_0x985cb3+'/'+_0x3129a8)[_0x085d('0x3')](_0x9acc97);}return null;};}function saveUpdates(_0x2bd6ae,_0x5c6c27){return function(_0x2e0714){if(_0x2e0714){return _0x2e0714[_0x085d('0xa')](_0x2bd6ae)[_0x085d('0xb')](function(_0x6b21d1){return _0x6b21d1;});}return null;};}function handleEntityNotFound(_0x5a5252,_0x4b87b9){return function(_0x19ce18){if(!_0x19ce18){_0x5a5252['sendStatus'](0x194);}return _0x19ce18;};}function handleError(_0x536f36,_0x267374){_0x267374=_0x267374||0x1f4;return function(_0x334263){logger[_0x085d('0xc')](_0x334263[_0x085d('0xd')]);if(_0x334263[_0x085d('0xe')]){delete _0x334263['name'];}_0x536f36[_0x085d('0x8')](_0x267374)[_0x085d('0xf')](_0x334263);};}exports[_0x085d('0x10')]=function(_0x1b0a6c,_0x3e566f){var _0x1c9de6={},_0x5c046e={},_0x6f7604={'count':0x0,'rows':[]};var _0x1195d5=_['map'](db[_0x085d('0x11')][_0x085d('0x12')],function(_0x159291){return{'name':_0x159291[_0x085d('0x13')],'type':_0x159291[_0x085d('0x14')]['key']};});_0x5c046e[_0x085d('0x15')]=_[_0x085d('0x16')](_0x1195d5,_0x085d('0xe'));_0x5c046e[_0x085d('0x17')]=_['keys'](_0x1b0a6c['query']);_0x5c046e['filters']=_[_0x085d('0x18')](_0x5c046e[_0x085d('0x15')],_0x5c046e[_0x085d('0x17')]);_0x5c046e[_0x085d('0x19')]=_[_0x085d('0x1a')](_0x5c046e[_0x085d('0x19')],['$and',_0x085d('0x1b'),_0x085d('0x1c'),_0x085d('0x1d'),'$lt',_0x085d('0x1e'),_0x085d('0x1f'),_0x085d('0x20'),_0x085d('0x21'),_0x085d('0x22'),'$notBetween','$in','$notIn',_0x085d('0x23'),_0x085d('0x24'),_0x085d('0x25'),'$notILike',_0x085d('0x23'),_0x085d('0x26'),_0x085d('0x27'),'$contained',_0x085d('0x28')]);_0x1c9de6[_0x085d('0x29')]=_[_0x085d('0x18')](_0x5c046e[_0x085d('0x15')],qs['fields'](_0x1b0a6c[_0x085d('0x17')][_0x085d('0x2a')]));_0x1c9de6['attributes']=_0x1c9de6[_0x085d('0x29')][_0x085d('0x2b')]?_0x1c9de6['attributes']:_0x5c046e[_0x085d('0x15')];if(!_0x1b0a6c[_0x085d('0x17')][_0x085d('0x2c')]('nolimit')){_0x1c9de6[_0x085d('0x5')]=qs[_0x085d('0x5')](_0x1b0a6c[_0x085d('0x17')]['limit']);_0x1c9de6[_0x085d('0x7')]=qs['offset'](_0x1b0a6c[_0x085d('0x17')][_0x085d('0x7')]);}_0x1c9de6[_0x085d('0x2d')]=qs[_0x085d('0x2e')](_0x1b0a6c['query'][_0x085d('0x2e')]);_0x1c9de6[_0x085d('0x2f')]=qs[_0x085d('0x19')](_[_0x085d('0x30')](_0x1b0a6c['query'],_0x5c046e['filters']),_0x1195d5);if(_0x1b0a6c[_0x085d('0x17')][_0x085d('0x31')]){_0x1c9de6[_0x085d('0x2f')]=_[_0x085d('0x32')](_0x1c9de6[_0x085d('0x2f')],{'$or':_[_0x085d('0x16')](_0x1195d5,function(_0x165eff){if(_0x165eff[_0x085d('0x14')]!==_0x085d('0x33')){var _0x596862={};_0x596862[_0x165eff[_0x085d('0xe')]]={'$like':'%'+_0x1b0a6c[_0x085d('0x17')]['filter']+'%'};return _0x596862;}})});}_0x1c9de6=_[_0x085d('0x32')]({},_0x1c9de6,_0x1b0a6c['options']);var _0x1cc755={'where':_0x1c9de6[_0x085d('0x2f')]};return db['CmHopper'][_0x085d('0x6')](_0x1cc755)[_0x085d('0xb')](function(_0x26d1f2){_0x6f7604[_0x085d('0x6')]=_0x26d1f2;if(_0x1b0a6c[_0x085d('0x17')]['includeAll']){_0x1c9de6[_0x085d('0x34')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1c9de6);})[_0x085d('0xb')](function(_0x32bf4f){_0x6f7604[_0x085d('0x35')]=_0x32bf4f;return _0x6f7604;})[_0x085d('0xb')](respondWithFilteredResult(_0x3e566f,_0x1c9de6))[_0x085d('0x36')](handleError(_0x3e566f,null));};exports['show']=function(_0x10d5cf,_0x47e1e8){var _0x3a8646={'raw':!![],'where':{'id':_0x10d5cf[_0x085d('0x37')]['id']}},_0x65ec6d={};_0x65ec6d['model']=_[_0x085d('0x38')](db['CmHopper'][_0x085d('0x12')]);_0x65ec6d[_0x085d('0x17')]=_['keys'](_0x10d5cf[_0x085d('0x17')]);_0x65ec6d[_0x085d('0x19')]=_[_0x085d('0x18')](_0x65ec6d['model'],_0x65ec6d['query']);_0x3a8646[_0x085d('0x29')]=_[_0x085d('0x18')](_0x65ec6d[_0x085d('0x15')],qs[_0x085d('0x2a')](_0x10d5cf[_0x085d('0x17')][_0x085d('0x2a')]));_0x3a8646[_0x085d('0x29')]=_0x3a8646[_0x085d('0x29')][_0x085d('0x2b')]?_0x3a8646[_0x085d('0x29')]:_0x65ec6d['model'];if(_0x10d5cf['query'][_0x085d('0x39')]){_0x3a8646[_0x085d('0x34')]=[{'all':!![]}];}_0x3a8646=_[_0x085d('0x32')]({},_0x3a8646,_0x10d5cf[_0x085d('0x3a')]);return db[_0x085d('0x11')][_0x085d('0x3b')](_0x3a8646)[_0x085d('0xb')](handleEntityNotFound(_0x47e1e8,null))[_0x085d('0xb')](respondWithResult(_0x47e1e8,null))[_0x085d('0x36')](handleError(_0x47e1e8,null));};exports[_0x085d('0x3c')]=function(_0x20a4ef,_0x4d5167){return db[_0x085d('0x11')][_0x085d('0x3c')](_0x20a4ef[_0x085d('0x3d')],{})[_0x085d('0xb')](respondWithResult(_0x4d5167,0xc9))[_0x085d('0x36')](handleError(_0x4d5167,null));};exports['update']=function(_0x13ba2d,_0x544729){if(_0x13ba2d[_0x085d('0x3d')]['id']){delete _0x13ba2d['body']['id'];}return db['CmHopper'][_0x085d('0x3b')]({'where':{'id':_0x13ba2d[_0x085d('0x37')]['id']}})[_0x085d('0xb')](handleEntityNotFound(_0x544729,null))[_0x085d('0xb')](saveUpdates(_0x13ba2d[_0x085d('0x3d')],null))['then'](respondWithResult(_0x544729,null))['catch'](handleError(_0x544729,null));};exports['describe']=function(_0x580b91,_0x5aeb4a){return db[_0x085d('0x11')][_0x085d('0x3e')]()['then'](respondWithResult(_0x5aeb4a,null))[_0x085d('0x36')](handleError(_0x5aeb4a,null));};exports['destroy']=function(_0x5df4cf,_0x415a4b){var _0x20cdcb;var _0x1da4b8=_0x5df4cf[_0x085d('0x37')]['id'];return db['CmHopper'][_0x085d('0x3b')]({'where':{'id':_0x5df4cf['params']['id']}})[_0x085d('0xb')](handleEntityNotFound(_0x415a4b,null))[_0x085d('0xb')](function(_0x5d6f22){if(_0x5d6f22){return _0x5d6f22[_0x085d('0x3f')]()[_0x085d('0xb')](function(_0x298f6f){return _0x298f6f;});}})[_0x085d('0xb')](function(_0x58955e){_0x20cdcb=_0x58955e;if(_0x58955e){if(_0x58955e[_0x085d('0x40')]||_0x58955e['CampaignId']){return db[_0x58955e[_0x085d('0x40')]?'VoiceQueue':'Campaign'][_0x085d('0x3b')]({'where':{'id':_0x58955e[_0x085d('0x40')]?_0x58955e[_0x085d('0x40')]:_0x58955e[_0x085d('0x41')]},'attributes':['id',_0x085d('0xe')],'raw':!![]});}}})[_0x085d('0xb')](function(_0x1c3081){var _0x1bac21={};if(_0x1c3081){_['merge'](_0x1bac21,_['omit'](_0x20cdcb['dataValues'],[_0x085d('0x42'),'updatedAt','id']));_0x1bac21[_0x085d('0x43')]=0x15;_0x1bac21['statedesc']=_0x085d('0x44');_0x1bac21[_0x085d('0x45')]=_0x1c3081[_0x085d('0xe')];_0x1bac21[_0x085d('0x46')]=_0x5df4cf['user']['name'];_0x1bac21[_0x085d('0x47')]=_0x5df4cf[_0x085d('0x48')]['id'];_0x1bac21['deleted']=!![];_0x1bac21[_0x085d('0x49')]=moment()[_0x085d('0x4a')](_0x085d('0x4b'));_0x1bac21[_0x085d('0x4c')]=_0x20cdcb[_0x085d('0x4d')];_0x1bac21[_0x085d('0x4e')]=_0x20cdcb[_0x085d('0x40')]?_0x085d('0x4f'):'ivr';return db[_0x085d('0x50')]['find']({'where':{'id':_0x1bac21[_0x085d('0x51')]},'attributes':['firstName',_0x085d('0x52')]})['then'](function(_0x402157){if(!_[_0x085d('0x53')](_0x415a4b)&&!_['isNil'](_0x402157['firstName'])){_0x1bac21[_0x085d('0x54')]=_0x402157[_0x085d('0x55')];if(!_[_0x085d('0x53')](_0x402157[_0x085d('0x52')])){_0x1bac21[_0x085d('0x54')]+='\x20'+_0x402157[_0x085d('0x52')];}}})[_0x085d('0x56')](function(){return db[_0x085d('0x57')][_0x085d('0x3c')](_0x1bac21);});}})[_0x085d('0xb')](function(_0x289303){return db[_0x085d('0x58')][_0x085d('0x3f')]({'where':{'CmHopperId':_0x1da4b8}});})[_0x085d('0xb')](function(){return _0x415a4b['status'](0xcc)['end']();})[_0x085d('0x36')](handleError(_0x415a4b,null));};exports[_0x085d('0x59')]=function(_0x4b606d,_0x5b89e1){var _0x4e695e=[];return db[_0x085d('0x50')][_0x085d('0x3e')]()['then'](function(_0x210f01){_0x4e695e=_[_0x085d('0x38')](_0x210f01);return _0x4b606d[_0x085d('0x48')]['getVoiceQueues']({'where':{'type':_0x085d('0x5a'),'dialActive':!![],'dialMethod':_0x085d('0x5b')},'attributes':['id',_0x085d('0x5c'),_0x085d('0x5d')],'raw':!![]});})['then'](function(_0x3fc07e){if(_0x3fc07e&&_0x3fc07e[_0x085d('0x2b')]){return db['sequelize'][_0x085d('0x5e')](function(_0x375779){var _0x1a7ddc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3fc07e,'id')},'$or':[{'UserId':null},{'UserId':_0x4b606d[_0x085d('0x48')]['id']}]};var _0x586569={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3fc07e)['filter']([_0x085d('0x5d'),0x0])['map']('id')[_0x085d('0x5f')]()},'$or':[{'UserId':null},{'UserId':_0x4b606d[_0x085d('0x48')]['id']}]};var _0x50fe13={'$or':[_0x1a7ddc,_0x586569]};var _0x1f23f2=[];if(_0x4b606d[_0x085d('0x3d')]['direction']&&_0x4b606d[_0x085d('0x3d')][_0x085d('0x60')]===_0x085d('0x61')){if(!_[_0x085d('0x62')](_0x4b606d['body']['hopperIds'])){_0x50fe13['id']={'$in':_0x4b606d[_0x085d('0x3d')][_0x085d('0x63')]};}_0x1f23f2=[[_0x085d('0x64'),_0x085d('0x65')],['scheduledAt',_0x3fc07e[0x0]['dialOrderByScheduledAt']==='ASC'?_0x085d('0x66'):'ASC'],db['sequelize'][_0x085d('0x67')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x085d('0x66')]];}else{if(!_[_0x085d('0x62')](_0x4b606d[_0x085d('0x3d')][_0x085d('0x63')])){_0x50fe13['id']={'$notIn':_0x4b606d['body'][_0x085d('0x63')]};}_0x1f23f2=[[_0x085d('0x64'),_0x085d('0x66')],[_0x085d('0x68'),_0x3fc07e[0x0][_0x085d('0x5c')]],db[_0x085d('0x69')][_0x085d('0x67')](_0x085d('0x6a')),['id',_0x085d('0x65')]];}return db[_0x085d('0x11')]['findOne']({'attributes':['id','scheduledat',_0x085d('0x4d'),_0x085d('0x6b')],'where':_0x50fe13,'order':_0x1f23f2,'transaction':_0x375779,'lock':_0x375779['LOCK'][_0x085d('0x6c')],'include':[{'model':db[_0x085d('0x50')],'as':_0x085d('0x6d'),'attributes':_0x4e695e,'include':[{'model':db[_0x085d('0x6e')],'as':_0x085d('0x6f'),'attributes':['id',_0x085d('0xe')]}]},{'model':db[_0x085d('0x70')],'as':_0x085d('0x71'),'attributes':['id',_0x085d('0xe')]},{'model':db[_0x085d('0x72')],'as':_0x085d('0x73'),'attributes':['id',_0x085d('0xe'),_0x085d('0x74')]}]})[_0x085d('0xb')](function(_0xf17978){if(_0xf17978){return _0xf17978[_0x085d('0xa')]({'UserId':_0x4b606d[_0x085d('0x48')]['id']},{'transaction':_0x375779});}});});}})['then'](handleEntityNotFound(_0x5b89e1,null))[_0x085d('0xb')](respondWithResult(_0x5b89e1,null))[_0x085d('0x36')](handleError(_0x5b89e1,null));};exports[_0x085d('0x75')]=function(_0x53d5ba,_0x326e94,_0x4de098){var _0x53fd1b=[];var _0x261ac7=_0x53d5ba[_0x085d('0x37')]['id'];var _0x4ba7a8=_0x53d5ba[_0x085d('0x48')]['id'];return db[_0x085d('0x50')][_0x085d('0x3e')]()[_0x085d('0xb')](function(_0x2f21c0){_0x53fd1b=_['keys'](_0x2f21c0);return db[_0x085d('0x69')][_0x085d('0x5e')](function(_0x5ada01){const _0x52cc7b={'id':_0x261ac7};return db[_0x085d('0x11')]['findOne']({'attributes':['id',_0x085d('0x76'),_0x085d('0x6b')],'where':_0x52cc7b,'transaction':_0x5ada01,'lock':_0x5ada01[_0x085d('0x77')][_0x085d('0x6c')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x53fd1b,'include':[{'model':db[_0x085d('0x6e')],'as':_0x085d('0x6f'),'attributes':['id',_0x085d('0xe')]}]},{'model':db['CmList'],'as':_0x085d('0x71'),'attributes':['id','name']},{'model':db[_0x085d('0x72')],'as':_0x085d('0x73'),'attributes':['id',_0x085d('0xe'),'dialActive']}]})[_0x085d('0xb')](function(_0x5994ec){if(_0x5994ec){return _0x5994ec[_0x085d('0xa')]({'UserId':_0x4ba7a8},{'transaction':_0x5ada01});}});});})[_0x085d('0xb')](handleEntityNotFound(_0x326e94,null))[_0x085d('0xb')](respondWithResult(_0x326e94,null))['catch'](handleError(_0x326e94,null));};exports['getOpenContacts']=function(_0x1c62e5,_0x2bc093){return _0x1c62e5[_0x085d('0x48')][_0x085d('0x78')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x143289){if(_0x143289&&_0x143289[_0x085d('0x2b')]){return db[_0x085d('0x11')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x085d('0x4b'))},'VoiceQueueId':{'$in':_[_0x085d('0x16')](_0x143289,'id')},'$or':[{'UserId':null},{'UserId':_0x1c62e5[_0x085d('0x48')]['id']}]}});}return 0x0;})['then'](function(_0x16f6e7){if(!_['isNil'](_0x16f6e7)&&_[_0x085d('0x79')](_0x16f6e7)){return _0x2bc093[_0x085d('0x8')](0xc8)['json']({'contacts':_0x16f6e7});}else{logger[_0x085d('0xc')](_0x085d('0x7a'),_0x085d('0x7b'),0x194,'entity\x20not\x20found');_0x2bc093[_0x085d('0x7c')](0x194);}})[_0x085d('0x36')](handleError(_0x2bc093,null));};exports[_0x085d('0x7d')]=function(_0x18809c,_0x2de70b){var _0x562711=shared[_0x085d('0x7e')];var _0x11a937=[];_[_0x085d('0x16')](_0x562711,function(_0x4f866b){_0x11a937[_0x085d('0x7f')]({'id':_0x4f866b[_0x085d('0xe')],'name':_0x4f866b[_0x085d('0xe')],'utcOffset':_0x4f866b[_0x085d('0x80')]});});return _0x2de70b[_0x085d('0x8')](0xc8)[_0x085d('0x3')]({'tz':_0x11a937});};exports[_0x085d('0x81')]=function(_0x32cbca,_0x57706d){var _0x1f3144=shared['timezones'];var _0x4a4e8e={};if(!_[_0x085d('0x53')](_0x1f3144[_0x32cbca[_0x085d('0x3d')]['id']]))_0x4a4e8e=_0x1f3144[_0x32cbca[_0x085d('0x3d')]['id']];return _0x57706d[_0x085d('0x8')](0xc8)[_0x085d('0x3')](_0x4a4e8e);}; \ No newline at end of file +var _0xed95=['phone','queue','CmContact','firstName','lastName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','List','dialActive','update','getPreviewRecall','Queue','getOpenContacts','isNil','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','sendStatus','error','name','send','index','map','CmHopper','fieldName','keys','query','filters','intersection','concat','$and','$or','$lt','$lte','$ne','$between','$notBetween','$in','$like','$notLike','$iLike','$overlap','$contains','$contained','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','then','includeAll','include','findAll','rows','params','model','rawAttributes','options','find','catch','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','merge','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4bb604,_0x40cb05){var _0x47ac49=function(_0x5d2e01){while(--_0x5d2e01){_0x4bb604['push'](_0x4bb604['shift']());}};_0x47ac49(++_0x40cb05);}(_0xed95,0xb9));var _0x5ed9=function(_0x129404,_0x1075b2){_0x129404=_0x129404-0x0;var _0x437365=_0xed95[_0x129404];return _0x437365;};'use strict';var moment=require(_0x5ed9('0x0'));var _=require(_0x5ed9('0x1'));var qs=require(_0x5ed9('0x2'));var logger=require(_0x5ed9('0x3'))(_0x5ed9('0x4'));var shared=require(_0x5ed9('0x5'));var db=require(_0x5ed9('0x6'))['db'];function respondWithResult(_0x3e2272,_0x2a28e9){_0x2a28e9=_0x2a28e9||0xc8;return function(_0x7b84d6){if(_0x7b84d6){return _0x3e2272[_0x5ed9('0x7')](_0x2a28e9)[_0x5ed9('0x8')](_0x7b84d6);}};}function respondWithFilteredResult(_0x52a57d,_0x48efa8){return function(_0x2612a8){if(_0x2612a8){var _0x217c71=typeof _0x48efa8[_0x5ed9('0x9')]===_0x5ed9('0xa')&&typeof _0x48efa8[_0x5ed9('0xb')]===_0x5ed9('0xa');var _0x5b48b1=_0x2612a8['count'];var _0x3cbaf0=_0x217c71?0x0:_0x48efa8[_0x5ed9('0x9')];var _0x46fc84=_0x217c71?_0x2612a8[_0x5ed9('0xc')]:_0x48efa8['offset']+_0x48efa8['limit'];var _0x28e087;if(_0x46fc84>=_0x5b48b1){_0x46fc84=_0x5b48b1;_0x28e087=0xc8;}else{_0x28e087=0xce;}_0x52a57d[_0x5ed9('0x7')](_0x28e087);return _0x52a57d[_0x5ed9('0xd')](_0x5ed9('0xe'),_0x3cbaf0+'-'+_0x46fc84+'/'+_0x5b48b1)['json'](_0x2612a8);}return null;};}function saveUpdates(_0x217a53,_0x110d83){return function(_0x246f80){if(_0x246f80){return _0x246f80['update'](_0x217a53)['then'](function(_0x3de296){return _0x3de296;});}return null;};}function handleEntityNotFound(_0x28587e,_0x5e952c){return function(_0x2cfd87){if(!_0x2cfd87){_0x28587e[_0x5ed9('0xf')](0x194);}return _0x2cfd87;};}function handleError(_0x59bace,_0x57692b){_0x57692b=_0x57692b||0x1f4;return function(_0x1d2d60){logger[_0x5ed9('0x10')](_0x1d2d60['stack']);if(_0x1d2d60[_0x5ed9('0x11')]){delete _0x1d2d60[_0x5ed9('0x11')];}_0x59bace['status'](_0x57692b)[_0x5ed9('0x12')](_0x1d2d60);};}exports[_0x5ed9('0x13')]=function(_0x54a570,_0x49fe37){var _0x5a3ac1={},_0x510ffe={},_0x3f65df={'count':0x0,'rows':[]};var _0x409a26=_[_0x5ed9('0x14')](db[_0x5ed9('0x15')]['rawAttributes'],function(_0x120a60){return{'name':_0x120a60[_0x5ed9('0x16')],'type':_0x120a60['type']['key']};});_0x510ffe['model']=_[_0x5ed9('0x14')](_0x409a26,_0x5ed9('0x11'));_0x510ffe['query']=_[_0x5ed9('0x17')](_0x54a570[_0x5ed9('0x18')]);_0x510ffe[_0x5ed9('0x19')]=_[_0x5ed9('0x1a')](_0x510ffe['model'],_0x510ffe[_0x5ed9('0x18')]);_0x510ffe[_0x5ed9('0x19')]=_[_0x5ed9('0x1b')](_0x510ffe[_0x5ed9('0x19')],[_0x5ed9('0x1c'),_0x5ed9('0x1d'),'$gt','$gte',_0x5ed9('0x1e'),_0x5ed9('0x1f'),_0x5ed9('0x20'),'$eq','$not',_0x5ed9('0x21'),_0x5ed9('0x22'),_0x5ed9('0x23'),'$notIn',_0x5ed9('0x24'),_0x5ed9('0x25'),_0x5ed9('0x26'),'$notILike',_0x5ed9('0x24'),_0x5ed9('0x27'),_0x5ed9('0x28'),_0x5ed9('0x29'),'$any']);_0x5a3ac1['attributes']=_[_0x5ed9('0x1a')](_0x510ffe['model'],qs[_0x5ed9('0x2a')](_0x54a570[_0x5ed9('0x18')][_0x5ed9('0x2a')]));_0x5a3ac1[_0x5ed9('0x2b')]=_0x5a3ac1[_0x5ed9('0x2b')][_0x5ed9('0x2c')]?_0x5a3ac1[_0x5ed9('0x2b')]:_0x510ffe['model'];if(!_0x54a570['query']['hasOwnProperty'](_0x5ed9('0x2d'))){_0x5a3ac1[_0x5ed9('0xb')]=qs[_0x5ed9('0xb')](_0x54a570['query'][_0x5ed9('0xb')]);_0x5a3ac1['offset']=qs[_0x5ed9('0x9')](_0x54a570[_0x5ed9('0x18')][_0x5ed9('0x9')]);}_0x5a3ac1[_0x5ed9('0x2e')]=qs[_0x5ed9('0x2f')](_0x54a570[_0x5ed9('0x18')]['sort']);_0x5a3ac1[_0x5ed9('0x30')]=qs[_0x5ed9('0x19')](_[_0x5ed9('0x31')](_0x54a570['query'],_0x510ffe['filters']),_0x409a26);if(_0x54a570[_0x5ed9('0x18')][_0x5ed9('0x32')]){_0x5a3ac1['where']=_['merge'](_0x5a3ac1[_0x5ed9('0x30')],{'$or':_[_0x5ed9('0x14')](_0x409a26,function(_0x13cac8){if(_0x13cac8[_0x5ed9('0x33')]!==_0x5ed9('0x34')){var _0x355899={};_0x355899[_0x13cac8[_0x5ed9('0x11')]]={'$like':'%'+_0x54a570[_0x5ed9('0x18')]['filter']+'%'};return _0x355899;}})});}_0x5a3ac1=_['merge']({},_0x5a3ac1,_0x54a570['options']);var _0x4699a0={'where':_0x5a3ac1[_0x5ed9('0x30')]};return db['CmHopper'][_0x5ed9('0xc')](_0x4699a0)[_0x5ed9('0x35')](function(_0x4407d2){_0x3f65df[_0x5ed9('0xc')]=_0x4407d2;if(_0x54a570['query'][_0x5ed9('0x36')]){_0x5a3ac1[_0x5ed9('0x37')]=[{'all':!![]}];}return db[_0x5ed9('0x15')][_0x5ed9('0x38')](_0x5a3ac1);})[_0x5ed9('0x35')](function(_0x5d01fe){_0x3f65df[_0x5ed9('0x39')]=_0x5d01fe;return _0x3f65df;})[_0x5ed9('0x35')](respondWithFilteredResult(_0x49fe37,_0x5a3ac1))['catch'](handleError(_0x49fe37,null));};exports['show']=function(_0x1ac6b7,_0x52c7ca){var _0x4fedbe={'raw':!![],'where':{'id':_0x1ac6b7[_0x5ed9('0x3a')]['id']}},_0x5a9287={};_0x5a9287[_0x5ed9('0x3b')]=_['keys'](db['CmHopper'][_0x5ed9('0x3c')]);_0x5a9287[_0x5ed9('0x18')]=_[_0x5ed9('0x17')](_0x1ac6b7[_0x5ed9('0x18')]);_0x5a9287[_0x5ed9('0x19')]=_[_0x5ed9('0x1a')](_0x5a9287[_0x5ed9('0x3b')],_0x5a9287[_0x5ed9('0x18')]);_0x4fedbe[_0x5ed9('0x2b')]=_[_0x5ed9('0x1a')](_0x5a9287[_0x5ed9('0x3b')],qs[_0x5ed9('0x2a')](_0x1ac6b7[_0x5ed9('0x18')][_0x5ed9('0x2a')]));_0x4fedbe['attributes']=_0x4fedbe[_0x5ed9('0x2b')][_0x5ed9('0x2c')]?_0x4fedbe[_0x5ed9('0x2b')]:_0x5a9287[_0x5ed9('0x3b')];if(_0x1ac6b7[_0x5ed9('0x18')]['includeAll']){_0x4fedbe[_0x5ed9('0x37')]=[{'all':!![]}];}_0x4fedbe=_['merge']({},_0x4fedbe,_0x1ac6b7[_0x5ed9('0x3d')]);return db[_0x5ed9('0x15')][_0x5ed9('0x3e')](_0x4fedbe)[_0x5ed9('0x35')](handleEntityNotFound(_0x52c7ca,null))[_0x5ed9('0x35')](respondWithResult(_0x52c7ca,null))[_0x5ed9('0x3f')](handleError(_0x52c7ca,null));};exports[_0x5ed9('0x40')]=function(_0x53c64f,_0x5e717b){return db[_0x5ed9('0x15')][_0x5ed9('0x40')](_0x53c64f['body'],{})[_0x5ed9('0x35')](respondWithResult(_0x5e717b,0xc9))[_0x5ed9('0x3f')](handleError(_0x5e717b,null));};exports['update']=function(_0x53a601,_0x23ea4b){if(_0x53a601[_0x5ed9('0x41')]['id']){delete _0x53a601['body']['id'];}return db[_0x5ed9('0x15')][_0x5ed9('0x3e')]({'where':{'id':_0x53a601[_0x5ed9('0x3a')]['id']}})[_0x5ed9('0x35')](handleEntityNotFound(_0x23ea4b,null))[_0x5ed9('0x35')](saveUpdates(_0x53a601[_0x5ed9('0x41')],null))[_0x5ed9('0x35')](respondWithResult(_0x23ea4b,null))[_0x5ed9('0x3f')](handleError(_0x23ea4b,null));};exports[_0x5ed9('0x42')]=function(_0x2620f0,_0x4422dd){return db[_0x5ed9('0x15')][_0x5ed9('0x42')]()['then'](respondWithResult(_0x4422dd,null))[_0x5ed9('0x3f')](handleError(_0x4422dd,null));};exports[_0x5ed9('0x43')]=function(_0x134b29,_0x5e6515){var _0xb50921;var _0x4e65ed=_0x134b29[_0x5ed9('0x3a')]['id'];return db[_0x5ed9('0x15')][_0x5ed9('0x3e')]({'where':{'id':_0x134b29[_0x5ed9('0x3a')]['id']}})[_0x5ed9('0x35')](handleEntityNotFound(_0x5e6515,null))[_0x5ed9('0x35')](function(_0x17c434){if(_0x17c434){return _0x17c434[_0x5ed9('0x43')]()[_0x5ed9('0x35')](function(_0x2ec8c2){return _0x2ec8c2;});}})[_0x5ed9('0x35')](function(_0x345bff){_0xb50921=_0x345bff;if(_0x345bff){if(_0x345bff['VoiceQueueId']||_0x345bff[_0x5ed9('0x44')]){return db[_0x345bff[_0x5ed9('0x45')]?_0x5ed9('0x46'):_0x5ed9('0x47')][_0x5ed9('0x3e')]({'where':{'id':_0x345bff['VoiceQueueId']?_0x345bff['VoiceQueueId']:_0x345bff['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x44a1ee){var _0x1bb8b8={};if(_0x44a1ee){_[_0x5ed9('0x48')](_0x1bb8b8,_[_0x5ed9('0x49')](_0xb50921[_0x5ed9('0x4a')],[_0x5ed9('0x4b'),_0x5ed9('0x4c'),'id']));_0x1bb8b8[_0x5ed9('0x4d')]=0x15;_0x1bb8b8[_0x5ed9('0x4e')]=_0x5ed9('0x4f');_0x1bb8b8[_0x5ed9('0x50')]=_0x44a1ee[_0x5ed9('0x11')];_0x1bb8b8[_0x5ed9('0x51')]=_0x134b29[_0x5ed9('0x52')]['name'];_0x1bb8b8[_0x5ed9('0x53')]=_0x134b29[_0x5ed9('0x52')]['id'];_0x1bb8b8[_0x5ed9('0x4f')]=!![];_0x1bb8b8[_0x5ed9('0x54')]=moment()[_0x5ed9('0x55')](_0x5ed9('0x56'));_0x1bb8b8['calleridnum']=_0xb50921[_0x5ed9('0x57')];_0x1bb8b8['campaigntype']=_0xb50921['VoiceQueueId']?_0x5ed9('0x58'):'ivr';return db[_0x5ed9('0x59')][_0x5ed9('0x3e')]({'where':{'id':_0x1bb8b8['ContactId']},'attributes':[_0x5ed9('0x5a'),_0x5ed9('0x5b')]})[_0x5ed9('0x35')](function(_0x1c0321){if(!_['isNil'](_0x5e6515)&&!_['isNil'](_0x1c0321['firstName'])){_0x1bb8b8[_0x5ed9('0x5c')]=_0x1c0321[_0x5ed9('0x5a')];if(!_['isNil'](_0x1c0321[_0x5ed9('0x5b')])){_0x1bb8b8[_0x5ed9('0x5c')]+='\x20'+_0x1c0321['lastName'];}}})[_0x5ed9('0x5d')](function(){return db[_0x5ed9('0x5e')]['create'](_0x1bb8b8);});}})[_0x5ed9('0x35')](function(_0x3ce6ab){return db[_0x5ed9('0x5f')]['destroy']({'where':{'CmHopperId':_0x4e65ed}});})[_0x5ed9('0x35')](function(){return _0x5e6515[_0x5ed9('0x7')](0xcc)[_0x5ed9('0x60')]();})[_0x5ed9('0x3f')](handleError(_0x5e6515,null));};exports[_0x5ed9('0x61')]=function(_0x10340f,_0x21be65){var _0xe72d99=[];return db['CmContact'][_0x5ed9('0x42')]()[_0x5ed9('0x35')](function(_0x2b36d){_0xe72d99=_[_0x5ed9('0x17')](_0x2b36d);return _0x10340f[_0x5ed9('0x52')][_0x5ed9('0x62')]({'where':{'type':_0x5ed9('0x63'),'dialActive':!![],'dialMethod':_0x5ed9('0x64')},'attributes':['id',_0x5ed9('0x65'),_0x5ed9('0x66')],'raw':!![]});})[_0x5ed9('0x35')](function(_0x3b6d17){if(_0x3b6d17&&_0x3b6d17[_0x5ed9('0x2c')]){return db[_0x5ed9('0x67')][_0x5ed9('0x68')](function(_0x3d51b6){var _0x4b08b1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5ed9('0x55')](_0x5ed9('0x56'))},'VoiceQueueId':{'$in':_['map'](_0x3b6d17,'id')},'$or':[{'UserId':null},{'UserId':_0x10340f[_0x5ed9('0x52')]['id']}]};var _0x97ab7e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3b6d17)[_0x5ed9('0x32')]([_0x5ed9('0x66'),0x0])[_0x5ed9('0x14')]('id')[_0x5ed9('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x10340f[_0x5ed9('0x52')]['id']}]};var _0xe56a17={'$or':[_0x4b08b1,_0x97ab7e]};var _0x54b343=[];if(_0x10340f[_0x5ed9('0x41')]['direction']&&_0x10340f['body'][_0x5ed9('0x6a')]===_0x5ed9('0x6b')){if(!_[_0x5ed9('0x6c')](_0x10340f['body'][_0x5ed9('0x6d')])){_0xe56a17['id']={'$in':_0x10340f[_0x5ed9('0x41')][_0x5ed9('0x6d')]};}_0x54b343=[[_0x5ed9('0x6e'),_0x5ed9('0x6f')],[_0x5ed9('0x70'),_0x3b6d17[0x0][_0x5ed9('0x65')]==='ASC'?'DESC':'ASC'],db[_0x5ed9('0x67')][_0x5ed9('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x5ed9('0x72')]];}else{if(!_[_0x5ed9('0x6c')](_0x10340f[_0x5ed9('0x41')][_0x5ed9('0x6d')])){_0xe56a17['id']={'$notIn':_0x10340f[_0x5ed9('0x41')][_0x5ed9('0x6d')]};}_0x54b343=[[_0x5ed9('0x6e'),_0x5ed9('0x72')],[_0x5ed9('0x70'),_0x3b6d17[0x0][_0x5ed9('0x65')]],db['sequelize'][_0x5ed9('0x71')](_0x5ed9('0x73')),['id',_0x5ed9('0x6f')]];}return db[_0x5ed9('0x15')][_0x5ed9('0x74')]({'attributes':['id',_0x5ed9('0x75'),_0x5ed9('0x57'),_0x5ed9('0x76')],'where':_0xe56a17,'order':_0x54b343,'transaction':_0x3d51b6,'lock':_0x3d51b6[_0x5ed9('0x77')][_0x5ed9('0x78')],'include':[{'model':db[_0x5ed9('0x59')],'as':_0x5ed9('0x79'),'attributes':_0xe72d99,'include':[{'model':db[_0x5ed9('0x7a')],'as':'Company','attributes':['id',_0x5ed9('0x11')]}]},{'model':db['CmList'],'as':_0x5ed9('0x7b'),'attributes':['id',_0x5ed9('0x11')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x5ed9('0x7c')]}]})[_0x5ed9('0x35')](function(_0x13560f){if(_0x13560f){return _0x13560f[_0x5ed9('0x7d')]({'UserId':_0x10340f[_0x5ed9('0x52')]['id']},{'transaction':_0x3d51b6});}});});}})['then'](handleEntityNotFound(_0x21be65,null))['then'](respondWithResult(_0x21be65,null))[_0x5ed9('0x3f')](handleError(_0x21be65,null));};exports[_0x5ed9('0x7e')]=function(_0x2aaa14,_0x64f4b7,_0x55821c){var _0x5bf1c0=[];var _0xbe0e06=_0x2aaa14['params']['id'];var _0x5f46f4=_0x2aaa14[_0x5ed9('0x52')]['id'];return db[_0x5ed9('0x59')][_0x5ed9('0x42')]()['then'](function(_0x24487f){_0x5bf1c0=_[_0x5ed9('0x17')](_0x24487f);return db['sequelize'][_0x5ed9('0x68')](function(_0x18e7a1){const _0x34362c={'id':_0xbe0e06};return db[_0x5ed9('0x15')]['findOne']({'attributes':['id',_0x5ed9('0x75'),'recallme'],'where':_0x34362c,'transaction':_0x18e7a1,'lock':_0x18e7a1[_0x5ed9('0x77')][_0x5ed9('0x78')],'include':[{'model':db[_0x5ed9('0x59')],'as':_0x5ed9('0x79'),'attributes':_0x5bf1c0,'include':[{'model':db[_0x5ed9('0x7a')],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x5ed9('0x11')]},{'model':db[_0x5ed9('0x46')],'as':_0x5ed9('0x7f'),'attributes':['id',_0x5ed9('0x11'),'dialActive']}]})[_0x5ed9('0x35')](function(_0x45cf95){if(_0x45cf95){return _0x45cf95['update']({'UserId':_0x5f46f4},{'transaction':_0x18e7a1});}});});})[_0x5ed9('0x35')](handleEntityNotFound(_0x64f4b7,null))[_0x5ed9('0x35')](respondWithResult(_0x64f4b7,null))[_0x5ed9('0x3f')](handleError(_0x64f4b7,null));};exports[_0x5ed9('0x80')]=function(_0x20a579,_0x533866){return _0x20a579[_0x5ed9('0x52')][_0x5ed9('0x62')]({'where':{'type':_0x5ed9('0x63'),'dialActive':!![],'dialMethod':_0x5ed9('0x64')},'attributes':['id'],'raw':!![]})[_0x5ed9('0x35')](function(_0x24d9fe){if(_0x24d9fe&&_0x24d9fe[_0x5ed9('0x2c')]){return db['CmHopper'][_0x5ed9('0xc')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5ed9('0x55')](_0x5ed9('0x56'))},'VoiceQueueId':{'$in':_[_0x5ed9('0x14')](_0x24d9fe,'id')},'$or':[{'UserId':null},{'UserId':_0x20a579[_0x5ed9('0x52')]['id']}]}});}return 0x0;})[_0x5ed9('0x35')](function(_0x565405){if(!_[_0x5ed9('0x81')](_0x565405)&&_[_0x5ed9('0x82')](_0x565405)){return _0x533866[_0x5ed9('0x7')](0xc8)[_0x5ed9('0x8')]({'contacts':_0x565405});}else{logger['error'](_0x5ed9('0x83'),'getOpenContacts',0x194,_0x5ed9('0x84'));_0x533866[_0x5ed9('0xf')](0x194);}})[_0x5ed9('0x3f')](handleError(_0x533866,null));};exports[_0x5ed9('0x85')]=function(_0x3b474e,_0x5db252){var _0x37b98a=shared[_0x5ed9('0x86')];var _0x682d7c=[];_[_0x5ed9('0x14')](_0x37b98a,function(_0x50d590){_0x682d7c[_0x5ed9('0x87')]({'id':_0x50d590[_0x5ed9('0x11')],'name':_0x50d590[_0x5ed9('0x11')],'utcOffset':_0x50d590['utcOffset']});});return _0x5db252[_0x5ed9('0x7')](0xc8)[_0x5ed9('0x8')]({'tz':_0x682d7c});};exports['getTimezone']=function(_0x1ea31e,_0x2d8868){var _0x2164f1=shared['timezones'];var _0x1bbb1a={};if(!_[_0x5ed9('0x81')](_0x2164f1[_0x1ea31e[_0x5ed9('0x41')]['id']]))_0x1bbb1a=_0x2164f1[_0x1ea31e[_0x5ed9('0x41')]['id']];return _0x2d8868[_0x5ed9('0x7')](0xc8)[_0x5ed9('0x8')](_0x1bbb1a);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 93edd52..c431b26 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x2f14e0,_0x57b51c){var _0x6b043d=function(_0x51a972){while(--_0x51a972){_0x2f14e0['push'](_0x2f14e0['shift']());}};_0x6b043d(++_0x57b51c);}(_0x4819,0xcd));var _0x9481=function(_0x11447e,_0x33dab2){_0x11447e=_0x11447e-0x0;var _0x45a214=_0x4819[_0x11447e];return _0x45a214;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]},{'name':_0x9481('0xd'),'fields':['phone']},{'name':_0x9481('0xe'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5b889c,_0x5089be){var _0x313f75=function(_0x13b941){while(--_0x13b941){_0x5b889c['push'](_0x5b889c['shift']());}};_0x313f75(++_0x5089be);}(_0x5fab,0x177));var _0xb5fa=function(_0x368682,_0x56698f){_0x368682=_0x368682-0x0;var _0x2bc428=_0x5fab[_0x368682];return _0x2bc428;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['scheduledat']},{'name':_0xb5fa('0xe'),'fields':[_0xb5fa('0xe')]},{'name':_0xb5fa('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b1574be..bed5fda 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 _0x0928=['keys','User','Agent','voicePause','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','length','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','raw','attributes','limit','include','map','model','then','debug','stringify','catch','message','ShowCmHopper','CmHopper','find','where','error','CreateCmHopper','create','body','info','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','UPDATE','Contact'];(function(_0x46094e,_0x4396c1){var _0x4ee7c7=function(_0x2aefef){while(--_0x2aefef){_0x46094e['push'](_0x46094e['shift']());}};_0x4ee7c7(++_0x4396c1);}(_0x0928,0x1c1));var _0x8092=function(_0x374737,_0x5e0239){_0x374737=_0x374737-0x0;var _0x209daf=_0x0928[_0x374737];return _0x209daf;};'use strict';var _=require(_0x8092('0x0'));var util=require('util');var moment=require(_0x8092('0x1'));var BPromise=require(_0x8092('0x2'));var db=require(_0x8092('0x3'))['db'];var logger=require(_0x8092('0x4'))(_0x8092('0x5'));exports[_0x8092('0x6')]=function(_0x2ebb33){var _0x1eedd9=this;return new Promise(function(_0x10cb2a,_0x2d91b6){return db['CmHopper'][_0x8092('0x7')]({'raw':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'where':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')]['where']||null:null,'attributes':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0xa')]||null:null,'limit':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0xb')]||null:null,'include':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0xc')]?_['map'](_0x2ebb33[_0x8092('0x8')]['include'],function(_0x369643){return{'model':db[_0x369643['model']],'as':_0x369643['as'],'attributes':_0x369643[_0x8092('0xa')],'include':_0x369643['include']?_[_0x8092('0xd')](_0x369643[_0x8092('0xc')],function(_0x502e82){return{'model':db[_0x502e82[_0x8092('0xe')]],'as':_0x502e82['as'],'attributes':_0x502e82[_0x8092('0xa')],'include':_0x502e82[_0x8092('0xc')]?_['map'](_0x502e82['include'],function(_0x1f48f6){return{'model':db[_0x1f48f6[_0x8092('0xe')]],'as':_0x1f48f6['as'],'attributes':_0x1f48f6[_0x8092('0xa')]};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0x6103d1){logger['info'](_0x8092('0x6'),_0x2ebb33);logger[_0x8092('0x10')](_0x8092('0x6'),_0x2ebb33,JSON[_0x8092('0x11')](_0x6103d1));_0x10cb2a(_0x6103d1);})[_0x8092('0x12')](function(_0x3e72d5){logger['error'](_0x8092('0x6'),_0x3e72d5[_0x8092('0x13')],_0x2ebb33);_0x2d91b6(_0x1eedd9['error'](0x1f4,_0x3e72d5['message']));});});};exports[_0x8092('0x14')]=function(_0x2097bc){var _0x3240ed=this;return new Promise(function(_0x5c9107,_0x3bf00b){return db[_0x8092('0x15')][_0x8092('0x16')]({'raw':_0x2097bc[_0x8092('0x8')]?_0x2097bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x2097bc[_0x8092('0x8')]?_0x2097bc[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x2097bc[_0x8092('0x8')]?_0x2097bc[_0x8092('0x8')][_0x8092('0xa')]||null:null,'include':_0x2097bc['options']?_0x2097bc[_0x8092('0x8')][_0x8092('0xc')]?_['map'](_0x2097bc[_0x8092('0x8')][_0x8092('0xc')],function(_0x17a98f){return{'model':db[_0x17a98f[_0x8092('0xe')]],'as':_0x17a98f['as'],'attributes':_0x17a98f['attributes'],'include':_0x17a98f[_0x8092('0xc')]?_[_0x8092('0xd')](_0x17a98f[_0x8092('0xc')],function(_0x471df7){return{'model':db[_0x471df7[_0x8092('0xe')]],'as':_0x471df7['as'],'attributes':_0x471df7['attributes'],'include':_0x471df7[_0x8092('0xc')]?_['map'](_0x471df7[_0x8092('0xc')],function(_0x1c4241){return{'model':db[_0x1c4241[_0x8092('0xe')]],'as':_0x1c4241['as'],'attributes':_0x1c4241[_0x8092('0xa')]};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0x40b02f){logger['info'](_0x8092('0x14'),_0x2097bc);logger['debug'](_0x8092('0x14'),_0x2097bc,JSON[_0x8092('0x11')](_0x40b02f));_0x5c9107(_0x40b02f);})[_0x8092('0x12')](function(_0x508f95){logger[_0x8092('0x18')](_0x8092('0x14'),_0x508f95[_0x8092('0x13')],_0x2097bc);_0x3bf00b(_0x3240ed[_0x8092('0x18')](0x1f4,_0x508f95[_0x8092('0x13')]));});});};exports[_0x8092('0x19')]=function(_0x4a56c3){var _0x5c7a83=this;return new Promise(function(_0x1fc3d4,_0x10be3f){return db[_0x8092('0x15')][_0x8092('0x1a')](_0x4a56c3[_0x8092('0x1b')],{'raw':_0x4a56c3[_0x8092('0x8')]?_0x4a56c3[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![]})['then'](function(_0xc5549c){logger[_0x8092('0x1c')](_0x8092('0x19'),_0x4a56c3);logger[_0x8092('0x10')]('CreateCmHopper',_0x4a56c3,JSON[_0x8092('0x11')](_0xc5549c));_0x1fc3d4(_0xc5549c);})[_0x8092('0x12')](function(_0x463642){logger['error'](_0x8092('0x19'),_0x463642[_0x8092('0x13')],_0x4a56c3);_0x10be3f(_0x5c7a83[_0x8092('0x18')](0x1f4,_0x463642[_0x8092('0x13')]));});});};exports[_0x8092('0x1d')]=function(_0x108d51){var _0x41dd8b=this;return new Promise(function(_0x1992e3,_0x194fa5){return db[_0x8092('0x15')][_0x8092('0x1e')](_0x108d51['body'],{'raw':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')][_0x8092('0xa')]||null:null,'limit':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')]['limit']||null:null})[_0x8092('0xf')](function(_0x561cb4){logger[_0x8092('0x1c')](_0x8092('0x1d'),_0x108d51);logger[_0x8092('0x1c')](_0x8092('0x1f'),JSON[_0x8092('0x11')](_0x108d51[_0x8092('0x8')][_0x8092('0x17')]),_0x108d51['body'][_0x8092('0x20')]);logger[_0x8092('0x10')](_0x8092('0x1d'),_0x108d51,JSON[_0x8092('0x11')](_0x561cb4));_0x1992e3(_0x561cb4);})[_0x8092('0x12')](function(_0x1f74fd){logger[_0x8092('0x18')]('UpdateCmHopper',_0x1f74fd['message'],_0x108d51);_0x194fa5(_0x41dd8b[_0x8092('0x18')](0x1f4,_0x1f74fd[_0x8092('0x13')]));});});};exports['DestroyCmHopper']=function(_0x250fe9){var _0x32a444=this;return new Promise(function(_0x31994a,_0xcdb23d){return db[_0x8092('0x15')][_0x8092('0x21')]({'where':_0x250fe9[_0x8092('0x8')]?_0x250fe9[_0x8092('0x8')][_0x8092('0x17')]||null:null})[_0x8092('0xf')](function(_0x1cc268){logger[_0x8092('0x1c')](_0x8092('0x22'),_0x250fe9);logger['debug'](_0x8092('0x22'),_0x250fe9,JSON[_0x8092('0x11')](_0x1cc268));_0x31994a(_0x1cc268);})[_0x8092('0x12')](function(_0x45a659){logger['error'](_0x8092('0x22'),_0x45a659['message'],_0x250fe9);_0xcdb23d(_0x32a444[_0x8092('0x18')](0x1f4,_0x45a659[_0x8092('0x13')]));});});};exports[_0x8092('0x23')]=function(_0x15aa0a){var _0x4e25f5=this;return new Promise(function(_0x105fde,_0x59354f){return db[_0x8092('0x24')][_0x8092('0x25')]()[_0x8092('0xf')](function(_0x5b142a){return db[_0x8092('0x26')][_0x8092('0x27')](function(_0x48f031){return db['CmHopper'][_0x8092('0x7')]({'where':_0x15aa0a[_0x8092('0x8')]?_0x15aa0a[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x15aa0a[_0x8092('0x8')]?_0x15aa0a[_0x8092('0x8')]['attributes']||null:null,'limit':_0x15aa0a[_0x8092('0x8')]?_0x15aa0a[_0x8092('0x8')][_0x8092('0xb')]||null:null,'order':_0x15aa0a['options']?_0x15aa0a[_0x8092('0x8')][_0x8092('0x28')]||null:null,'transaction':_0x48f031,'lock':_0x48f031['LOCK'][_0x8092('0x29')],'include':[{'model':db[_0x8092('0x24')],'as':_0x8092('0x2a'),'attributes':_[_0x8092('0x2b')](_0x5b142a)},{'model':db[_0x8092('0x2c')],'as':_0x8092('0x2d'),'attributes':['id','name',_0x8092('0x2e')]}]})[_0x8092('0xf')](function(_0x5a2ce4){var _0x207f53=[];var _0x22799e=[];for(var _0x5c57a4=0x0;_0x5c57a4<_0x5a2ce4['length'];_0x5c57a4+=0x1){var _0x37fd0c=_0x5a2ce4[_0x5c57a4][_0x8092('0x2f')];if(_0x37fd0c===null){_0x207f53[_0x8092('0x30')](_0x5a2ce4[_0x5c57a4]['update'](_0x15aa0a[_0x8092('0x1b')],{'transaction':_0x48f031}));}else if(!_0x22799e[_0x8092('0x31')](_0x37fd0c)){_0x22799e['push'](_0x37fd0c);_0x207f53[_0x8092('0x30')](_0x5a2ce4[_0x5c57a4][_0x8092('0x1e')](_0x15aa0a[_0x8092('0x1b')],{'transaction':_0x48f031}));}}return BPromise[_0x8092('0x32')](_0x207f53);});})[_0x8092('0xf')](function(_0x53112c){logger['info']('GetContactDialer',_0x15aa0a);if(_0x53112c['length']>0x0){logger[_0x8092('0x1c')](_0x8092('0x33'),_0x53112c[0x0]['dataValues']['id'],_0x53112c[0x0][_0x8092('0x34')][_0x8092('0x35')],_0x53112c[0x0][_0x8092('0x34')][_0x8092('0x20')]);}logger[_0x8092('0x10')](_0x8092('0x23'),_0x15aa0a,JSON['stringify'](_0x53112c));_0x105fde(_0x53112c);})['catch'](function(_0x19eabd){logger['error'](_0x8092('0x23'),_0x19eabd[_0x8092('0x13')],_0x15aa0a);_0x59354f(_0x4e25f5[_0x8092('0x18')](0x1f4,_0x19eabd[_0x8092('0x13')]));});});});};exports[_0x8092('0x36')]=function(_0x47ef21){var _0x5b9572=this;return new Promise(function(_0x17fd98,_0x1c000){return db[_0x8092('0x26')][_0x8092('0x27')](function(_0x2b4d19){return db[_0x8092('0x37')]['create'](_0x47ef21[_0x8092('0x1b')],{'raw':_0x47ef21[_0x8092('0x8')]?_0x47ef21[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'transaction':_0x2b4d19})[_0x8092('0xf')](function(){logger[_0x8092('0x1c')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x47ef21['options'][_0x8092('0x17')]),_0x47ef21[_0x8092('0x8')][_0x8092('0x17')][_0x8092('0x20')]);return db['CmHopper'][_0x8092('0x21')]({'where':_0x47ef21[_0x8092('0x8')]?_0x47ef21[_0x8092('0x8')][_0x8092('0x17')]||null:null,'transaction':_0x2b4d19});});})[_0x8092('0xf')](function(_0x6104a6){logger['info'](_0x8092('0x36'),_0x47ef21);logger[_0x8092('0x10')](_0x8092('0x36'),_0x47ef21,JSON[_0x8092('0x11')](_0x6104a6));_0x17fd98(_0x6104a6);})[_0x8092('0x12')](function(_0x19cfa1){logger[_0x8092('0x18')](_0x8092('0x36'),_0x19cfa1[_0x8092('0x13')],_0x47ef21);_0x1c000(_0x5b9572['error'](0x1f4,_0x19cfa1['message']));});});};exports[_0x8092('0x38')]=function(_0xfbdf6a){var _0x374222=this;return new Promise(function(_0x304f83,_0x26fd7c){return db[_0x8092('0x15')][_0x8092('0x7')]({'raw':_0xfbdf6a[_0x8092('0x8')]?_0xfbdf6a[_0x8092('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0xfbdf6a[_0x8092('0x8')]?_0xfbdf6a[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':[[db[_0x8092('0x26')]['fn'](_0x8092('0x39'),db[_0x8092('0x26')]['fn']('IF',db['sequelize'][_0x8092('0x3a')]('`scheduledat`\x20>=\x20'+util[_0x8092('0x3b')]('\x22%s\x22',moment()[_0x8092('0x3b')](_0x8092('0x3c')))+_0x8092('0x3d')))),_0x8092('0x3e')]]})[_0x8092('0xf')](function(_0x2062b6){logger['info']('CountReScheduled',_0xfbdf6a);logger['debug'](_0x8092('0x38'),_0xfbdf6a,JSON[_0x8092('0x11')](_0x2062b6));_0x304f83(_0x2062b6);})[_0x8092('0x12')](function(_0x34c865){logger['error'](_0x8092('0x38'),_0x34c865['message'],_0xfbdf6a);_0x26fd7c(_0x374222[_0x8092('0x18')](0x1f4,_0x34c865[_0x8092('0x13')]));});});};exports[_0x8092('0x3f')]=function(_0x447ac6){var _0x305408=this;return new Promise(function(_0x3b60f9,_0x40c036){return db[_0x8092('0x24')]['describe']()[_0x8092('0xf')](function(){return db[_0x8092('0x26')][_0x8092('0x27')](function(_0x429f7a){return db['CmHopper']['findAll']({'where':_0x447ac6[_0x8092('0x8')]?_0x447ac6[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x447ac6['options']?_0x447ac6[_0x8092('0x8')][_0x8092('0xa')]||null:null,'limit':0x1,'order':_0x447ac6[_0x8092('0x8')]?_0x447ac6['options'][_0x8092('0x28')]||null:null,'group':db[_0x8092('0x15')][_0x8092('0x2f')],'transaction':_0x429f7a,'lock':_0x429f7a[_0x8092('0x40')][_0x8092('0x29')],'include':_0x447ac6[_0x8092('0x8')]?_0x447ac6[_0x8092('0x8')]['include']?_[_0x8092('0xd')](_0x447ac6[_0x8092('0x8')]['include'],function(_0x1703e3){return{'model':db[_0x1703e3[_0x8092('0xe')]],'as':_0x1703e3['as'],'attributes':_0x1703e3[_0x8092('0xa')],'include':_0x1703e3['include']?_['map'](_0x1703e3[_0x8092('0xc')],function(_0x59093d){return{'model':db[_0x59093d[_0x8092('0xe')]],'as':_0x59093d['as'],'attributes':_0x59093d[_0x8092('0xa')],'include':_0x59093d[_0x8092('0xc')]?_[_0x8092('0xd')](_0x59093d[_0x8092('0xc')],function(_0x2ea414){return{'model':db[_0x2ea414['model']],'as':_0x2ea414['as'],'attributes':_0x2ea414['attributes']};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0x3eaa24){var _0x326325=[];for(var _0x29acfe=0x0;_0x29acfe<_0x3eaa24[_0x8092('0x41')];_0x29acfe+=0x1){_0x326325[_0x8092('0x30')](_0x3eaa24[_0x29acfe][_0x8092('0x1e')](_0x447ac6['body'],{'transaction':_0x429f7a}));}return BPromise['all'](_0x326325);});})[_0x8092('0xf')](function(_0x1a10e5){logger[_0x8092('0x1c')](_0x8092('0x3f'),_0x447ac6);logger[_0x8092('0x10')](_0x8092('0x3f'),_0x447ac6,JSON['stringify'](_0x1a10e5));_0x3b60f9(_0x1a10e5);})[_0x8092('0x12')](function(_0x4ea3ee){logger[_0x8092('0x18')]('GetContactRecallMe',_0x4ea3ee['message'],_0x447ac6);_0x40c036(_0x305408[_0x8092('0x18')](0x1f4,_0x4ea3ee[_0x8092('0x13')]));});});});};exports[_0x8092('0x42')]=function(_0x3473ae){var _0x195a0c=this;return new Promise(function(_0x43e8f4,_0x3c54fe){db[_0x8092('0x24')][_0x8092('0x25')]()[_0x8092('0xf')](function(_0x8ca86e){return db[_0x8092('0x15')][_0x8092('0x7')]({'raw':_0x3473ae[_0x8092('0x8')]?_0x3473ae[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'where':_0x3473ae['options']?_0x3473ae[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x3473ae['options']?_0x3473ae['options'][_0x8092('0xa')]||null:null,'limit':_0x3473ae[_0x8092('0x8')]?_0x3473ae[_0x8092('0x8')][_0x8092('0xb')]||null:null,'include':_0x3473ae['options']?_0x3473ae[_0x8092('0x8')]['include']?_['map'](_0x3473ae[_0x8092('0x8')][_0x8092('0xc')],function(_0x1f2940){return{'model':db[_0x1f2940[_0x8092('0xe')]],'as':_0x1f2940['as'],'attributes':_0x1f2940['as']===_0x8092('0x2a')?_[_0x8092('0x2b')](_0x8ca86e):_0x1f2940[_0x8092('0xa')],'include':_0x1f2940[_0x8092('0xc')]?_[_0x8092('0xd')](_0x1f2940[_0x8092('0xc')],function(_0x5c356b){return{'model':db[_0x5c356b[_0x8092('0xe')]],'as':_0x5c356b['as'],'attributes':_0x5c356b[_0x8092('0xa')],'include':_0x5c356b['include']?_[_0x8092('0xd')](_0x5c356b['include'],function(_0x47b24d){return{'model':db[_0x47b24d[_0x8092('0xe')]],'as':_0x47b24d['as'],'attributes':_0x47b24d[_0x8092('0xa')]};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0xbb689c){logger[_0x8092('0x1c')](_0x8092('0x6'),_0x3473ae);logger[_0x8092('0x10')]('GetCmHopper',_0x3473ae,JSON[_0x8092('0x11')](_0xbb689c));_0x43e8f4(_0xbb689c);})[_0x8092('0x12')](function(_0x4eb358){logger['error']('GetCmHopper',_0x4eb358[_0x8092('0x13')],_0x3473ae);_0x3c54fe(_0x195a0c['error'](0x1f4,_0x4eb358[_0x8092('0x13')]));});});});};exports[_0x8092('0x43')]=function(_0x58f9fa){var _0x3a62c4=this;return new Promise(function(_0x5e98fa,_0x26e10c){return db[_0x8092('0x24')][_0x8092('0x44')]({'raw':!![],'where':{'phone':_0x58f9fa['options'][_0x8092('0x17')][_0x8092('0x45')]},'attributes':['id',_0x8092('0x46')],'order':[['id',_0x8092('0x47')]]})[_0x8092('0xf')](function(_0x774669){logger[_0x8092('0x1c')](_0x8092('0x48'),_0x58f9fa);logger[_0x8092('0x10')](_0x8092('0x48'),_0x58f9fa,JSON[_0x8092('0x11')](_0x774669));_0x5e98fa(_0x774669);})['catch'](function(_0x167c45){logger[_0x8092('0x18')](_0x8092('0x48'),_0x167c45[_0x8092('0x13')],_0x58f9fa);_0x26e10c(_0x3a62c4[_0x8092('0x18')](0x1f4,_0x167c45[_0x8092('0x13')]));});});};exports[_0x8092('0x49')]=function(_0x348746){var _0x4e880e=this;return new Promise(function(_0x42e08a,_0x1a037e){return db['sequelize'][_0x8092('0x27')](function(_0x4c2773){var _0x3c6cbb=_0x348746[_0x8092('0x8')]&&_0x348746[_0x8092('0x8')][_0x8092('0x17')]?_0x348746[_0x8092('0x8')][_0x8092('0x17')]:{};return db['CmHopper'][_0x8092('0x1e')](_0x348746[_0x8092('0x1b')],{'where':_0x3c6cbb,'transaction':_0x4c2773})[_0x8092('0xf')](function(_0x46462a){logger[_0x8092('0x1c')]('ResetActiveCalls',_0x348746);logger[_0x8092('0x10')](_0x8092('0x49'),_0x348746,JSON[_0x8092('0x11')](_0x46462a));_0x42e08a(_0x46462a);})[_0x8092('0x12')](function(_0x30cab3){logger[_0x8092('0x18')](_0x8092('0x49'),_0x30cab3['message'],_0x348746);_0x1a037e(_0x4e880e[_0x8092('0x18')](0x1f4,_0x30cab3[_0x8092('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x598201){var _0x597762=this;var _0x4f39e9=_0x598201[_0x8092('0x1b')][_0x8092('0x17')][_0x8092('0x4a')];var _0x363db2=_0x598201[_0x8092('0x1b')][_0x8092('0x17')]['interval'];var _0x4d7bf2=_0x598201[_0x8092('0x1b')][_0x8092('0x17')][_0x8092('0x4b')];return new Promise(function(_0x341959,_0x5a3576){return db[_0x8092('0x15')][_0x8092('0x7')]({'where':{'voiceQueueId':{'$in':_0x4f39e9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x8092('0x26')][_0x8092('0x3a')](_0x8092('0x4c')+_0x363db2+_0x8092('0x4d')),'$gt':db[_0x8092('0x26')][_0x8092('0x3a')]('NOW()')}},'UserId':{'$in':_0x4d7bf2}},'include':[{'model':db['CmContact'],'as':_0x8092('0x2a')},{'model':db[_0x8092('0x2c')],'as':'Agent','attributes':['id',_0x8092('0x4e'),'voicePause']},{'model':db[_0x8092('0x4f')],'as':_0x8092('0x50')}]})[_0x8092('0xf')](function(_0x2d9fbc){if(_0x2d9fbc[_0x8092('0x41')]>0x0){return db[_0x8092('0x26')]['transaction'](function(_0x305095){return db[_0x8092('0x15')][_0x8092('0x1e')]({'recallmeNotifiedDate':db[_0x8092('0x26')][_0x8092('0x3a')]('NOW()')},{'where':{'id':{'$in':_[_0x8092('0xd')](_0x2d9fbc,'id')}},'transaction':_0x305095})[_0x8092('0xf')](function(){_0x341959(_0x2d9fbc);})['catch'](function(_0x272efa){logger[_0x8092('0x18')](_0x8092('0x51'),_0x272efa['message'],_0x598201);_0x5a3576(_0x597762['error'](0x1f4,_0x272efa['message']));});})['catch'](function(_0x21010e){logger[_0x8092('0x18')](_0x8092('0x51'),_0x21010e[_0x8092('0x13')],_0x598201);_0x5a3576(_0x597762[_0x8092('0x18')](0x1f4,_0x21010e[_0x8092('0x13')]));});}else{_0x341959(_0x2d9fbc);}});});}; \ No newline at end of file +var _0xe128=['push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','findOne','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','NOW()','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','body','UpdateCmHopper','update','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe128,0x1a3));var _0x8e12=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xe128[_0x420f2a];return _0x28f802;};'use strict';var _=require(_0x8e12('0x0'));var util=require(_0x8e12('0x1'));var moment=require(_0x8e12('0x2'));var BPromise=require(_0x8e12('0x3'));var db=require(_0x8e12('0x4'))['db'];var logger=require(_0x8e12('0x5'))(_0x8e12('0x6'));exports[_0x8e12('0x7')]=function(_0x4f459d){var _0x675d9a=this;return new Promise(function(_0x3730c4,_0x33cb16){return db[_0x8e12('0x8')][_0x8e12('0x9')]({'raw':_0x4f459d[_0x8e12('0xa')]?_0x4f459d[_0x8e12('0xa')][_0x8e12('0xb')]===undefined?!![]:![]:!![],'where':_0x4f459d[_0x8e12('0xa')]?_0x4f459d[_0x8e12('0xa')][_0x8e12('0xc')]||null:null,'attributes':_0x4f459d[_0x8e12('0xa')]?_0x4f459d['options'][_0x8e12('0xd')]||null:null,'limit':_0x4f459d['options']?_0x4f459d['options'][_0x8e12('0xe')]||null:null,'include':_0x4f459d[_0x8e12('0xa')]?_0x4f459d[_0x8e12('0xa')][_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x4f459d['options'][_0x8e12('0xf')],function(_0x356ae8){return{'model':db[_0x356ae8[_0x8e12('0x11')]],'as':_0x356ae8['as'],'attributes':_0x356ae8['attributes'],'include':_0x356ae8[_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x356ae8[_0x8e12('0xf')],function(_0x31afad){return{'model':db[_0x31afad[_0x8e12('0x11')]],'as':_0x31afad['as'],'attributes':_0x31afad['attributes'],'include':_0x31afad[_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x31afad[_0x8e12('0xf')],function(_0x385d73){return{'model':db[_0x385d73[_0x8e12('0x11')]],'as':_0x385d73['as'],'attributes':_0x385d73[_0x8e12('0xd')]};}):[]};}):[]};}):[]:[]})[_0x8e12('0x12')](function(_0x5b322d){logger[_0x8e12('0x13')](_0x8e12('0x7'),_0x4f459d);logger[_0x8e12('0x14')](_0x8e12('0x7'),_0x4f459d,JSON[_0x8e12('0x15')](_0x5b322d));_0x3730c4(_0x5b322d);})[_0x8e12('0x16')](function(_0x45c7be){logger[_0x8e12('0x17')](_0x8e12('0x7'),_0x45c7be[_0x8e12('0x18')],_0x4f459d);_0x33cb16(_0x675d9a[_0x8e12('0x17')](0x1f4,_0x45c7be[_0x8e12('0x18')]));});});};exports[_0x8e12('0x19')]=function(_0x4d4c7f){var _0x34eb8e=this;return new Promise(function(_0x597422,_0x3c0d90){return db[_0x8e12('0x8')][_0x8e12('0x1a')]({'raw':_0x4d4c7f[_0x8e12('0xa')]?_0x4d4c7f['options'][_0x8e12('0xb')]===undefined?!![]:![]:!![],'where':_0x4d4c7f[_0x8e12('0xa')]?_0x4d4c7f[_0x8e12('0xa')][_0x8e12('0xc')]||null:null,'attributes':_0x4d4c7f[_0x8e12('0xa')]?_0x4d4c7f[_0x8e12('0xa')]['attributes']||null:null,'include':_0x4d4c7f[_0x8e12('0xa')]?_0x4d4c7f[_0x8e12('0xa')][_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x4d4c7f[_0x8e12('0xa')][_0x8e12('0xf')],function(_0x47050f){return{'model':db[_0x47050f['model']],'as':_0x47050f['as'],'attributes':_0x47050f[_0x8e12('0xd')],'include':_0x47050f[_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x47050f[_0x8e12('0xf')],function(_0x5e3cb0){return{'model':db[_0x5e3cb0['model']],'as':_0x5e3cb0['as'],'attributes':_0x5e3cb0[_0x8e12('0xd')],'include':_0x5e3cb0[_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x5e3cb0[_0x8e12('0xf')],function(_0x139b36){return{'model':db[_0x139b36['model']],'as':_0x139b36['as'],'attributes':_0x139b36[_0x8e12('0xd')]};}):[]};}):[]};}):[]:[]})[_0x8e12('0x12')](function(_0x2521ac){logger[_0x8e12('0x13')]('ShowCmHopper',_0x4d4c7f);logger[_0x8e12('0x14')](_0x8e12('0x19'),_0x4d4c7f,JSON[_0x8e12('0x15')](_0x2521ac));_0x597422(_0x2521ac);})[_0x8e12('0x16')](function(_0x5d7741){logger[_0x8e12('0x17')]('ShowCmHopper',_0x5d7741['message'],_0x4d4c7f);_0x3c0d90(_0x34eb8e[_0x8e12('0x17')](0x1f4,_0x5d7741[_0x8e12('0x18')]));});});};exports[_0x8e12('0x1b')]=function(_0x54d930){var _0x10a5e5=this;return new Promise(function(_0x8d1501,_0x7fe519){return db[_0x8e12('0x8')]['create'](_0x54d930[_0x8e12('0x1c')],{'raw':_0x54d930[_0x8e12('0xa')]?_0x54d930[_0x8e12('0xa')]['raw']===undefined?!![]:![]:!![]})[_0x8e12('0x12')](function(_0x43b0e5){logger['info']('CreateCmHopper',_0x54d930);logger['debug']('CreateCmHopper',_0x54d930,JSON[_0x8e12('0x15')](_0x43b0e5));_0x8d1501(_0x43b0e5);})[_0x8e12('0x16')](function(_0x438e21){logger[_0x8e12('0x17')](_0x8e12('0x1b'),_0x438e21[_0x8e12('0x18')],_0x54d930);_0x7fe519(_0x10a5e5[_0x8e12('0x17')](0x1f4,_0x438e21[_0x8e12('0x18')]));});});};exports[_0x8e12('0x1d')]=function(_0x7ad01d){var _0x4610f6=this;return new Promise(function(_0x426048,_0xf73b7f){return db[_0x8e12('0x8')][_0x8e12('0x1e')](_0x7ad01d['body'],{'raw':_0x7ad01d['options']?_0x7ad01d[_0x8e12('0xa')][_0x8e12('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ad01d['options']?_0x7ad01d[_0x8e12('0xa')][_0x8e12('0xc')]||null:null,'attributes':_0x7ad01d[_0x8e12('0xa')]?_0x7ad01d[_0x8e12('0xa')][_0x8e12('0xd')]||null:null,'limit':_0x7ad01d[_0x8e12('0xa')]?_0x7ad01d['options']['limit']||null:null})['then'](function(_0x3268f6){logger['info'](_0x8e12('0x1d'),_0x7ad01d);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8e12('0x15')](_0x7ad01d['options'][_0x8e12('0xc')]),_0x7ad01d[_0x8e12('0x1c')][_0x8e12('0x1f')]);logger[_0x8e12('0x14')]('UpdateCmHopper',_0x7ad01d,JSON[_0x8e12('0x15')](_0x3268f6));_0x426048(_0x3268f6);})[_0x8e12('0x16')](function(_0x4d9882){logger[_0x8e12('0x17')](_0x8e12('0x1d'),_0x4d9882[_0x8e12('0x18')],_0x7ad01d);_0xf73b7f(_0x4610f6[_0x8e12('0x17')](0x1f4,_0x4d9882['message']));});});};exports[_0x8e12('0x20')]=function(_0x5b7f2e){var _0x58e6bb=this;return new Promise(function(_0x40506f,_0x5a4587){return db[_0x8e12('0x8')]['destroy']({'where':_0x5b7f2e[_0x8e12('0xa')]?_0x5b7f2e['options'][_0x8e12('0xc')]||null:null})[_0x8e12('0x12')](function(_0x10e7f9){logger[_0x8e12('0x13')](_0x8e12('0x20'),_0x5b7f2e);logger[_0x8e12('0x14')]('DestroyCmHopper',_0x5b7f2e,JSON['stringify'](_0x10e7f9));_0x40506f(_0x10e7f9);})[_0x8e12('0x16')](function(_0x37dd65){logger[_0x8e12('0x17')](_0x8e12('0x20'),_0x37dd65[_0x8e12('0x18')],_0x5b7f2e);_0x5a4587(_0x58e6bb[_0x8e12('0x17')](0x1f4,_0x37dd65['message']));});});};exports[_0x8e12('0x21')]=function(_0x27a411){var _0x7d2bb0=this;return new Promise(function(_0x12e12f,_0x2d4526){return db[_0x8e12('0x22')][_0x8e12('0x23')]()[_0x8e12('0x12')](function(_0x849334){return db[_0x8e12('0x24')][_0x8e12('0x25')](function(_0x402b22){return db[_0x8e12('0x8')][_0x8e12('0x9')]({'where':_0x27a411['options']?_0x27a411[_0x8e12('0xa')][_0x8e12('0xc')]||null:null,'attributes':_0x27a411[_0x8e12('0xa')]?_0x27a411[_0x8e12('0xa')]['attributes']||null:null,'limit':_0x27a411[_0x8e12('0xa')]?_0x27a411[_0x8e12('0xa')]['limit']||null:null,'order':_0x27a411[_0x8e12('0xa')]?_0x27a411['options'][_0x8e12('0x26')]||null:null,'transaction':_0x402b22,'lock':_0x402b22[_0x8e12('0x27')][_0x8e12('0x28')],'include':[{'model':db[_0x8e12('0x22')],'as':_0x8e12('0x29'),'attributes':_[_0x8e12('0x2a')](_0x849334)},{'model':db[_0x8e12('0x2b')],'as':_0x8e12('0x2c'),'attributes':['id',_0x8e12('0x2d'),_0x8e12('0x2e')]}]})[_0x8e12('0x12')](function(_0x2df902){var _0x136839=[];var _0x57e894=[];for(var _0x2e4389=0x0;_0x2e4389<_0x2df902[_0x8e12('0x2f')];_0x2e4389+=0x1){var _0x1f1b1f=_0x2df902[_0x2e4389][_0x8e12('0x30')];if(_0x1f1b1f===null){_0x136839[_0x8e12('0x31')](_0x2df902[_0x2e4389][_0x8e12('0x1e')](_0x27a411[_0x8e12('0x1c')],{'transaction':_0x402b22}));}else if(!_0x57e894[_0x8e12('0x32')](_0x1f1b1f)){_0x57e894[_0x8e12('0x31')](_0x1f1b1f);_0x136839[_0x8e12('0x31')](_0x2df902[_0x2e4389][_0x8e12('0x1e')](_0x27a411[_0x8e12('0x1c')],{'transaction':_0x402b22}));}}return BPromise[_0x8e12('0x33')](_0x136839);});})[_0x8e12('0x12')](function(_0x4e7928){logger['info'](_0x8e12('0x21'),_0x27a411);if(_0x4e7928[_0x8e12('0x2f')]>0x0){logger[_0x8e12('0x13')](_0x8e12('0x34'),_0x4e7928[0x0][_0x8e12('0x35')]['id'],_0x4e7928[0x0]['dataValues'][_0x8e12('0x36')],_0x4e7928[0x0]['dataValues']['active']);}logger[_0x8e12('0x14')](_0x8e12('0x21'),_0x27a411,JSON[_0x8e12('0x15')](_0x4e7928));_0x12e12f(_0x4e7928);})[_0x8e12('0x16')](function(_0xd18d7e){logger[_0x8e12('0x17')](_0x8e12('0x21'),_0xd18d7e['message'],_0x27a411);_0x2d4526(_0x7d2bb0[_0x8e12('0x17')](0x1f4,_0xd18d7e['message']));});});});};exports['MoveContactManagedDialer']=function(_0x38e874){var _0x5ed6b0=this;return new Promise(function(_0x4d5a3f,_0x471b9b){return db[_0x8e12('0x24')][_0x8e12('0x25')](function(_0x4b75a9){return db['CmHopperFinal']['create'](_0x38e874[_0x8e12('0x1c')],{'raw':_0x38e874[_0x8e12('0xa')]?_0x38e874['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x4b75a9})['then'](function(){logger[_0x8e12('0x13')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x38e874[_0x8e12('0xa')][_0x8e12('0xc')]),_0x38e874[_0x8e12('0xa')][_0x8e12('0xc')][_0x8e12('0x1f')]);return db['CmHopper'][_0x8e12('0x37')]({'where':_0x38e874[_0x8e12('0xa')]?_0x38e874[_0x8e12('0xa')][_0x8e12('0xc')]||null:null,'transaction':_0x4b75a9});});})[_0x8e12('0x12')](function(_0x111852){logger[_0x8e12('0x13')]('MoveContactManagedDialer',_0x38e874);logger[_0x8e12('0x14')]('MoveContactManagedDialer',_0x38e874,JSON['stringify'](_0x111852));_0x4d5a3f(_0x111852);})[_0x8e12('0x16')](function(_0x111dd2){logger[_0x8e12('0x17')](_0x8e12('0x38'),_0x111dd2[_0x8e12('0x18')],_0x38e874);_0x471b9b(_0x5ed6b0['error'](0x1f4,_0x111dd2[_0x8e12('0x18')]));});});};exports[_0x8e12('0x39')]=function(_0x16bf04){var _0x607c4f=this;return new Promise(function(_0x5800a1,_0x351fcf){return db[_0x8e12('0x8')][_0x8e12('0x9')]({'raw':_0x16bf04[_0x8e12('0xa')]?_0x16bf04[_0x8e12('0xa')][_0x8e12('0xb')]===undefined?!![]:![]:!![],'where':_0x16bf04[_0x8e12('0xa')]?_0x16bf04['options'][_0x8e12('0xc')]||null:null,'attributes':[[db['sequelize']['fn'](_0x8e12('0x3a'),db[_0x8e12('0x24')]['fn']('IF',db[_0x8e12('0x24')][_0x8e12('0x3b')](_0x8e12('0x3c')+util['format'](_0x8e12('0x3d'),moment()[_0x8e12('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x8e12('0x3f')))),_0x8e12('0x40')]]})[_0x8e12('0x12')](function(_0x30833b){logger['info']('CountReScheduled',_0x16bf04);logger[_0x8e12('0x14')](_0x8e12('0x39'),_0x16bf04,JSON['stringify'](_0x30833b));_0x5800a1(_0x30833b);})[_0x8e12('0x16')](function(_0x11eb3a){logger[_0x8e12('0x17')](_0x8e12('0x39'),_0x11eb3a[_0x8e12('0x18')],_0x16bf04);_0x351fcf(_0x607c4f[_0x8e12('0x17')](0x1f4,_0x11eb3a[_0x8e12('0x18')]));});});};exports[_0x8e12('0x41')]=function(_0x259970){var _0x281558=this;return new Promise(function(_0x286bc7,_0x8c6d2){return db[_0x8e12('0x22')][_0x8e12('0x23')]()[_0x8e12('0x12')](function(){return db[_0x8e12('0x24')][_0x8e12('0x25')](function(_0xf33516){return db[_0x8e12('0x8')]['findAll']({'where':_0x259970['options']?_0x259970[_0x8e12('0xa')]['where']||null:null,'attributes':_0x259970['options']?_0x259970[_0x8e12('0xa')][_0x8e12('0xd')]||null:null,'limit':0x1,'order':_0x259970['options']?_0x259970[_0x8e12('0xa')][_0x8e12('0x26')]||null:null,'group':db[_0x8e12('0x8')][_0x8e12('0x30')],'transaction':_0xf33516,'lock':_0xf33516[_0x8e12('0x27')][_0x8e12('0x28')],'include':_0x259970[_0x8e12('0xa')]?_0x259970[_0x8e12('0xa')]['include']?_[_0x8e12('0x10')](_0x259970[_0x8e12('0xa')][_0x8e12('0xf')],function(_0x277fc5){return{'model':db[_0x277fc5[_0x8e12('0x11')]],'as':_0x277fc5['as'],'attributes':_0x277fc5[_0x8e12('0xd')],'include':_0x277fc5[_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x277fc5[_0x8e12('0xf')],function(_0x4aeb30){return{'model':db[_0x4aeb30[_0x8e12('0x11')]],'as':_0x4aeb30['as'],'attributes':_0x4aeb30[_0x8e12('0xd')],'include':_0x4aeb30['include']?_[_0x8e12('0x10')](_0x4aeb30[_0x8e12('0xf')],function(_0x274b62){return{'model':db[_0x274b62[_0x8e12('0x11')]],'as':_0x274b62['as'],'attributes':_0x274b62[_0x8e12('0xd')]};}):[]};}):[]};}):[]:[]})[_0x8e12('0x12')](function(_0x5db402){var _0x4d1f28=[];for(var _0x36d894=0x0;_0x36d894<_0x5db402[_0x8e12('0x2f')];_0x36d894+=0x1){_0x4d1f28[_0x8e12('0x31')](_0x5db402[_0x36d894][_0x8e12('0x1e')](_0x259970[_0x8e12('0x1c')],{'transaction':_0xf33516}));}return BPromise[_0x8e12('0x33')](_0x4d1f28);});})['then'](function(_0x40773a){logger[_0x8e12('0x13')](_0x8e12('0x41'),_0x259970);logger['debug'](_0x8e12('0x41'),_0x259970,JSON[_0x8e12('0x15')](_0x40773a));_0x286bc7(_0x40773a);})['catch'](function(_0x10d12e){logger[_0x8e12('0x17')](_0x8e12('0x41'),_0x10d12e[_0x8e12('0x18')],_0x259970);_0x8c6d2(_0x281558[_0x8e12('0x17')](0x1f4,_0x10d12e[_0x8e12('0x18')]));});});});};exports[_0x8e12('0x42')]=function(_0x184d6d){var _0xbcff0a=this;return new Promise(function(_0x58ee6d,_0xc5d4a0){db['CmContact'][_0x8e12('0x23')]()['then'](function(_0x195145){return db[_0x8e12('0x8')][_0x8e12('0x9')]({'raw':_0x184d6d['options']?_0x184d6d[_0x8e12('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x184d6d[_0x8e12('0xa')]?_0x184d6d[_0x8e12('0xa')][_0x8e12('0xc')]||null:null,'attributes':_0x184d6d[_0x8e12('0xa')]?_0x184d6d['options'][_0x8e12('0xd')]||null:null,'limit':_0x184d6d['options']?_0x184d6d['options'][_0x8e12('0xe')]||null:null,'include':_0x184d6d[_0x8e12('0xa')]?_0x184d6d['options'][_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x184d6d['options'][_0x8e12('0xf')],function(_0x3ea92b){return{'model':db[_0x3ea92b[_0x8e12('0x11')]],'as':_0x3ea92b['as'],'attributes':_0x3ea92b['as']===_0x8e12('0x29')?_[_0x8e12('0x2a')](_0x195145):_0x3ea92b[_0x8e12('0xd')],'include':_0x3ea92b['include']?_[_0x8e12('0x10')](_0x3ea92b[_0x8e12('0xf')],function(_0x2c1f7d){return{'model':db[_0x2c1f7d['model']],'as':_0x2c1f7d['as'],'attributes':_0x2c1f7d[_0x8e12('0xd')],'include':_0x2c1f7d[_0x8e12('0xf')]?_[_0x8e12('0x10')](_0x2c1f7d[_0x8e12('0xf')],function(_0x373df5){return{'model':db[_0x373df5['model']],'as':_0x373df5['as'],'attributes':_0x373df5[_0x8e12('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54907b){logger['info'](_0x8e12('0x7'),_0x184d6d);logger[_0x8e12('0x14')](_0x8e12('0x7'),_0x184d6d,JSON[_0x8e12('0x15')](_0x54907b));_0x58ee6d(_0x54907b);})[_0x8e12('0x16')](function(_0x1eedb){logger[_0x8e12('0x17')]('GetCmHopper',_0x1eedb['message'],_0x184d6d);_0xc5d4a0(_0xbcff0a[_0x8e12('0x17')](0x1f4,_0x1eedb[_0x8e12('0x18')]));});});});};exports['GetContactByPhone']=function(_0x570a62){var _0x3517b2=this;return new Promise(function(_0x4701c4,_0x4af814){return db[_0x8e12('0x22')][_0x8e12('0x43')]({'raw':!![],'where':{'phone':_0x570a62[_0x8e12('0xa')][_0x8e12('0xc')][_0x8e12('0x44')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x8e12('0x12')](function(_0x2b02f7){logger[_0x8e12('0x13')](_0x8e12('0x45'),_0x570a62);logger[_0x8e12('0x14')](_0x8e12('0x45'),_0x570a62,JSON[_0x8e12('0x15')](_0x2b02f7));_0x4701c4(_0x2b02f7);})[_0x8e12('0x16')](function(_0x26170a){logger[_0x8e12('0x17')](_0x8e12('0x45'),_0x26170a[_0x8e12('0x18')],_0x570a62);_0x4af814(_0x3517b2[_0x8e12('0x17')](0x1f4,_0x26170a[_0x8e12('0x18')]));});});};exports[_0x8e12('0x46')]=function(_0x4ec78c){var _0x339e7d=this;return new Promise(function(_0x444742,_0x13db88){return db[_0x8e12('0x24')][_0x8e12('0x25')](function(_0x20a4cf){var _0x277685=_0x4ec78c[_0x8e12('0xa')]&&_0x4ec78c[_0x8e12('0xa')][_0x8e12('0xc')]?_0x4ec78c[_0x8e12('0xa')][_0x8e12('0xc')]:{};return db['CmHopper'][_0x8e12('0x1e')](_0x4ec78c[_0x8e12('0x1c')],{'where':_0x277685,'transaction':_0x20a4cf})[_0x8e12('0x12')](function(_0x757f88){logger[_0x8e12('0x13')]('ResetActiveCalls',_0x4ec78c);logger[_0x8e12('0x14')](_0x8e12('0x46'),_0x4ec78c,JSON[_0x8e12('0x15')](_0x757f88));_0x444742(_0x757f88);})[_0x8e12('0x16')](function(_0x137ec4){logger[_0x8e12('0x17')](_0x8e12('0x46'),_0x137ec4[_0x8e12('0x18')],_0x4ec78c);_0x13db88(_0x339e7d['error'](0x1f4,_0x137ec4[_0x8e12('0x18')]));});});});};exports[_0x8e12('0x47')]=function(_0x44b43d){var _0x587c6a=this;var _0x1a8eb2=_0x44b43d['body'][_0x8e12('0xc')][_0x8e12('0x48')];var _0x3df43a=_0x44b43d[_0x8e12('0x1c')][_0x8e12('0xc')][_0x8e12('0x49')];var _0x1d0d62=_0x44b43d[_0x8e12('0x1c')][_0x8e12('0xc')][_0x8e12('0x4a')];return new Promise(function(_0x571183,_0x5e1428){return db['CmHopper'][_0x8e12('0x9')]({'where':{'voiceQueueId':{'$in':_0x1a8eb2},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x8e12('0x3b')]('NOW()\x20+\x20INTERVAL\x20'+_0x3df43a+_0x8e12('0x4b')),'$gt':db[_0x8e12('0x24')][_0x8e12('0x3b')](_0x8e12('0x4c'))}},'UserId':{'$in':_0x1d0d62}},'include':[{'model':db[_0x8e12('0x22')],'as':_0x8e12('0x29')},{'model':db[_0x8e12('0x2b')],'as':_0x8e12('0x2c'),'attributes':['id',_0x8e12('0x2d'),_0x8e12('0x2e')]},{'model':db['CmList'],'as':_0x8e12('0x4d')}]})[_0x8e12('0x12')](function(_0x2c6186){if(_0x2c6186[_0x8e12('0x2f')]>0x0){return db['sequelize']['transaction'](function(_0x17b81e){return db['CmHopper'][_0x8e12('0x1e')]({'recallmeNotifiedDate':db[_0x8e12('0x24')][_0x8e12('0x3b')](_0x8e12('0x4c'))},{'where':{'id':{'$in':_[_0x8e12('0x10')](_0x2c6186,'id')}},'transaction':_0x17b81e})['then'](function(){_0x571183(_0x2c6186);})[_0x8e12('0x16')](function(_0x1d2794){logger[_0x8e12('0x17')](_0x8e12('0x47'),_0x1d2794['message'],_0x44b43d);_0x5e1428(_0x587c6a['error'](0x1f4,_0x1d2794['message']));});})[_0x8e12('0x16')](function(_0x3db363){logger[_0x8e12('0x17')](_0x8e12('0x47'),_0x3db363[_0x8e12('0x18')],_0x44b43d);_0x5e1428(_0x587c6a[_0x8e12('0x17')](0x1f4,_0x3db363['message']));});}else{_0x571183(_0x2c6186);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index e3daabc..4379423 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 _0x4319=['getPreviewRecall','create','post','/preview','getPreview','/timezone','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','index','/describe','isAuthenticated','/opencontacts','/timezones','getTimezones','/:id','show','/:id/previewrecall'];(function(_0x5821f6,_0x5a40b0){var _0x1fb034=function(_0x5dcf91){while(--_0x5dcf91){_0x5821f6['push'](_0x5821f6['shift']());}};_0x1fb034(++_0x5a40b0);}(_0x4319,0x18a));var _0x9431=function(_0x577077,_0x52f056){_0x577077=_0x577077-0x0;var _0x370769=_0x4319[_0x577077];return _0x370769;};'use strict';var express=require(_0x9431('0x0'));var router=express[_0x9431('0x1')]();var auth=require(_0x9431('0x2'));var controller=require(_0x9431('0x3'));router[_0x9431('0x4')]('/',auth['isAuthenticated'](),controller[_0x9431('0x5')]);router['get'](_0x9431('0x6'),auth[_0x9431('0x7')](),controller['describe']);router[_0x9431('0x4')](_0x9431('0x8'),auth[_0x9431('0x7')](),controller['getOpenContacts']);router[_0x9431('0x4')](_0x9431('0x9'),auth[_0x9431('0x7')](),controller[_0x9431('0xa')]);router[_0x9431('0x4')](_0x9431('0xb'),auth[_0x9431('0x7')](),controller[_0x9431('0xc')]);router[_0x9431('0x4')](_0x9431('0xd'),auth[_0x9431('0x7')](),controller[_0x9431('0xe')]);router['post']('/',auth[_0x9431('0x7')](),controller[_0x9431('0xf')]);router[_0x9431('0x10')](_0x9431('0x11'),auth[_0x9431('0x7')](),controller[_0x9431('0x12')]);router[_0x9431('0x10')](_0x9431('0x13'),auth['isAuthenticated'](),controller['getTimezone']);router['put'](_0x9431('0xb'),auth[_0x9431('0x7')](),controller[_0x9431('0x14')]);router[_0x9431('0x15')](_0x9431('0xb'),auth[_0x9431('0x7')](),controller[_0x9431('0x16')]);module[_0x9431('0x17')]=router; \ No newline at end of file +var _0x4bc5=['/timezone','getTimezone','put','update','delete','destroy','express','../../components/auth/service','./cmHopper.controller','get','index','isAuthenticated','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','post','/preview','getPreview'];(function(_0x549c29,_0x180f6d){var _0xc297c6=function(_0x54cffb){while(--_0x54cffb){_0x549c29['push'](_0x549c29['shift']());}};_0xc297c6(++_0x180f6d);}(_0x4bc5,0xc3));var _0x54bc=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4bc5[_0x40a045];return _0x1a687c;};'use strict';var express=require(_0x54bc('0x0'));var router=express['Router']();var auth=require(_0x54bc('0x1'));var controller=require(_0x54bc('0x2'));router[_0x54bc('0x3')]('/',auth['isAuthenticated'](),controller[_0x54bc('0x4')]);router[_0x54bc('0x3')]('/describe',auth[_0x54bc('0x5')](),controller['describe']);router['get'](_0x54bc('0x6'),auth['isAuthenticated'](),controller[_0x54bc('0x7')]);router[_0x54bc('0x3')](_0x54bc('0x8'),auth[_0x54bc('0x5')](),controller[_0x54bc('0x9')]);router['get'](_0x54bc('0xa'),auth[_0x54bc('0x5')](),controller['show']);router[_0x54bc('0x3')](_0x54bc('0xb'),auth['isAuthenticated'](),controller['getPreviewRecall']);router[_0x54bc('0xc')]('/',auth[_0x54bc('0x5')](),controller['create']);router[_0x54bc('0xc')](_0x54bc('0xd'),auth[_0x54bc('0x5')](),controller[_0x54bc('0xe')]);router[_0x54bc('0xc')](_0x54bc('0xf'),auth['isAuthenticated'](),controller[_0x54bc('0x10')]);router[_0x54bc('0x11')](_0x54bc('0xa'),auth[_0x54bc('0x5')](),controller[_0x54bc('0x12')]);router[_0x54bc('0x13')](_0x54bc('0xa'),auth[_0x54bc('0x5')](),controller[_0x54bc('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index cf3ecc1..4bba80c 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 _0xf8ee=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','INTEGER'];(function(_0x2e0aef,_0x3a7819){var _0x5927a3=function(_0x17521d){while(--_0x17521d){_0x2e0aef['push'](_0x2e0aef['shift']());}};_0x5927a3(++_0x3a7819);}(_0xf8ee,0x12e));var _0xef8e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf8ee[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0xef8e('0x0'));module[_0xef8e('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xef8e('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xef8e('0x4')](_0xef8e('0x5'))},'countbusyretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa020=['sequelize','exports','INTEGER','STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa020,0x1b1));var _0x0a02=function(_0x417dd8,_0x127ca3){_0x417dd8=_0x417dd8-0x0;var _0x4bd271=_0xa020[_0x417dd8];return _0x4bd271;};'use strict';var moment=require(_0x0a02('0x0'));var Sequelize=require(_0x0a02('0x1'));module[_0x0a02('0x2')]={'CmHopperId':{'type':Sequelize[_0x0a02('0x3')]},'phone':{'type':Sequelize[_0x0a02('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x0a02('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0a02('0x5')](_0x0a02('0x6'))},'countbusyretry':{'type':Sequelize[_0x0a02('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0a02('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0a02('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0a02('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0a02('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0a02('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0a02('0x3')],'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 a1f56b0..8736565 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 _0xde7f=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format'];(function(_0x225b38,_0x56f90c){var _0x279027=function(_0x293529){while(--_0x293529){_0x225b38['push'](_0x225b38['shift']());}};_0x279027(++_0x56f90c);}(_0xde7f,0x1a3));var _0xfde7=function(_0x4c103b,_0x289328){_0x4c103b=_0x4c103b-0x0;var _0x251473=_0xde7f[_0x4c103b];return _0x251473;};'use strict';var emlformat=require(_0xfde7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfde7('0x1'));var jsonpatch=require(_0xfde7('0x2'));var rp=require('request-promise');var moment=require(_0xfde7('0x3'));var BPromise=require(_0xfde7('0x4'));var Mustache=require(_0xfde7('0x5'));var util=require(_0xfde7('0x6'));var path=require(_0xfde7('0x7'));var sox=require(_0xfde7('0x8'));var csv=require(_0xfde7('0x9'));var ejs=require(_0xfde7('0xa'));var fs=require('fs');var fs_extra=require(_0xfde7('0xb'));var _=require(_0xfde7('0xc'));var squel=require(_0xfde7('0xd'));var crypto=require('crypto');var jsforce=require(_0xfde7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfde7('0xf'));var authService=require(_0xfde7('0x10'));var qs=require(_0xfde7('0x11'));var as=require(_0xfde7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfde7('0x13'))(_0xfde7('0x14'));var utils=require(_0xfde7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfde7('0x16'));var db=require(_0xfde7('0x17'))['db'];function respondWithStatusCode(_0x54c8cc,_0x5832cd){_0x5832cd=_0x5832cd||0xcc;return function(_0x45f4b7){if(_0x45f4b7){return _0x54c8cc[_0xfde7('0x18')](_0x5832cd);}return _0x54c8cc[_0xfde7('0x19')](_0x5832cd)[_0xfde7('0x1a')]();};}function respondWithResult(_0x31dd3c,_0x459418){_0x459418=_0x459418||0xc8;return function(_0x2ae69b){if(_0x2ae69b){return _0x31dd3c[_0xfde7('0x19')](_0x459418)[_0xfde7('0x1b')](_0x2ae69b);}};}function respondWithFilteredResult(_0x251143,_0x5b8814){return function(_0x3b5798){if(_0x3b5798){var _0x408627=typeof _0x5b8814['offset']===_0xfde7('0x1c')&&typeof _0x5b8814['limit']===_0xfde7('0x1c');var _0x5144c8=_0x3b5798[_0xfde7('0x1d')];var _0x5691f1=_0x408627?0x0:_0x5b8814[_0xfde7('0x1e')];var _0x100a4a=_0x408627?_0x3b5798['count']:_0x5b8814[_0xfde7('0x1e')]+_0x5b8814[_0xfde7('0x1f')];var _0x7c0934;if(_0x100a4a>=_0x5144c8){_0x100a4a=_0x5144c8;_0x7c0934=0xc8;}else{_0x7c0934=0xce;}_0x251143[_0xfde7('0x19')](_0x7c0934);return _0x251143['set'](_0xfde7('0x20'),_0x5691f1+'-'+_0x100a4a+'/'+_0x5144c8)[_0xfde7('0x1b')](_0x3b5798);}return null;};}function patchUpdates(_0x3cd233){return function(_0x2824be){try{jsonpatch[_0xfde7('0x21')](_0x2824be,_0x3cd233,!![]);}catch(_0x4c973a){return BPromise[_0xfde7('0x22')](_0x4c973a);}return _0x2824be[_0xfde7('0x23')]();};}function saveUpdates(_0x450d84,_0x46ca24){return function(_0x381b60){if(_0x381b60){return _0x381b60[_0xfde7('0x24')](_0x450d84)[_0xfde7('0x25')](function(_0x423aea){return _0x423aea;});}return null;};}function removeEntity(_0x4054e7,_0x3ee744){return function(_0x51c30f){if(_0x51c30f){return _0x51c30f[_0xfde7('0x26')]()[_0xfde7('0x25')](function(){var _0x280260=_0x51c30f[_0xfde7('0x27')]({'plain':!![]});var _0x50ce38=_0xfde7('0x28');return db[_0xfde7('0x29')][_0xfde7('0x26')]({'where':{'type':_0x50ce38,'resourceId':_0x280260['id']}})['then'](function(){return _0x51c30f;});})['then'](function(){_0x4054e7['status'](0xcc)[_0xfde7('0x1a')]();});}};}function handleEntityNotFound(_0x13f84d,_0x101ca1){return function(_0x48f225){if(!_0x48f225){_0x13f84d[_0xfde7('0x18')](0x194);}return _0x48f225;};}function handleError(_0x41b19c,_0x48e955){_0x48e955=_0x48e955||0x1f4;return function(_0x3ccd8f){logger[_0xfde7('0x2a')](_0x3ccd8f[_0xfde7('0x2b')]);if(_0x3ccd8f[_0xfde7('0x2c')]){delete _0x3ccd8f[_0xfde7('0x2c')];}_0x41b19c['status'](_0x48e955)[_0xfde7('0x2d')](_0x3ccd8f);};}exports[_0xfde7('0x2e')]=function(_0x2f8789,_0x15921f){var _0x3cb46c={},_0x463a8a={},_0x3cdcfd={'count':0x0,'rows':[]};var _0x50101e=_['map'](db[_0xfde7('0x2f')][_0xfde7('0x30')],function(_0x206116){return{'name':_0x206116[_0xfde7('0x31')],'type':_0x206116[_0xfde7('0x32')][_0xfde7('0x33')]};});_0x463a8a[_0xfde7('0x34')]=_[_0xfde7('0x35')](_0x50101e,_0xfde7('0x2c'));_0x463a8a['query']=_['keys'](_0x2f8789[_0xfde7('0x36')]);_0x463a8a['filters']=_['intersection'](_0x463a8a[_0xfde7('0x34')],_0x463a8a[_0xfde7('0x36')]);_0x3cb46c[_0xfde7('0x37')]=_[_0xfde7('0x38')](_0x463a8a[_0xfde7('0x34')],qs[_0xfde7('0x39')](_0x2f8789[_0xfde7('0x36')]['fields']));_0x3cb46c[_0xfde7('0x37')]=_0x3cb46c['attributes']['length']?_0x3cb46c[_0xfde7('0x37')]:_0x463a8a[_0xfde7('0x34')];if(!_0x2f8789[_0xfde7('0x36')][_0xfde7('0x3a')]('nolimit')){_0x3cb46c[_0xfde7('0x1f')]=qs['limit'](_0x2f8789[_0xfde7('0x36')][_0xfde7('0x1f')]);_0x3cb46c['offset']=qs[_0xfde7('0x1e')](_0x2f8789[_0xfde7('0x36')][_0xfde7('0x1e')]);}_0x3cb46c[_0xfde7('0x3b')]=qs[_0xfde7('0x3c')](_0x2f8789['query'][_0xfde7('0x3c')]);_0x3cb46c[_0xfde7('0x3d')]=qs[_0xfde7('0x3e')](_[_0xfde7('0x3f')](_0x2f8789[_0xfde7('0x36')],_0x463a8a[_0xfde7('0x3e')]),_0x50101e);if(_0x2f8789[_0xfde7('0x36')][_0xfde7('0x40')]){_0x3cb46c[_0xfde7('0x3d')]=_[_0xfde7('0x41')](_0x3cb46c[_0xfde7('0x3d')],{'$or':_[_0xfde7('0x35')](_0x50101e,function(_0x5e1698){if(_0x5e1698[_0xfde7('0x32')]!==_0xfde7('0x42')){var _0x4f1ed0={};_0x4f1ed0[_0x5e1698[_0xfde7('0x2c')]]={'$like':'%'+_0x2f8789['query']['filter']+'%'};return _0x4f1ed0;}})});}_0x3cb46c=_[_0xfde7('0x41')]({},_0x3cb46c,_0x2f8789[_0xfde7('0x43')]);var _0x58baa4={'where':_0x3cb46c[_0xfde7('0x3d')]};return db['CmHopperAdditionalPhone']['count'](_0x58baa4)[_0xfde7('0x25')](function(_0x20d644){_0x3cdcfd[_0xfde7('0x1d')]=_0x20d644;if(_0x2f8789[_0xfde7('0x36')][_0xfde7('0x44')]){_0x3cb46c[_0xfde7('0x45')]=[{'all':!![]}];}return db[_0xfde7('0x2f')][_0xfde7('0x46')](_0x3cb46c);})['then'](function(_0x1d75a6){_0x3cdcfd[_0xfde7('0x47')]=_0x1d75a6;return _0x3cdcfd;})[_0xfde7('0x25')](respondWithFilteredResult(_0x15921f,_0x3cb46c))[_0xfde7('0x48')](handleError(_0x15921f,null));};exports[_0xfde7('0x49')]=function(_0x2f1f25,_0x1805c1){var _0x418807={'raw':!![],'where':{'id':_0x2f1f25[_0xfde7('0x4a')]['id']}},_0x2120d5={};_0x2120d5[_0xfde7('0x34')]=_[_0xfde7('0x4b')](db[_0xfde7('0x2f')]['rawAttributes']);_0x2120d5['query']=_[_0xfde7('0x4b')](_0x2f1f25[_0xfde7('0x36')]);_0x2120d5[_0xfde7('0x3e')]=_['intersection'](_0x2120d5[_0xfde7('0x34')],_0x2120d5['query']);_0x418807[_0xfde7('0x37')]=_[_0xfde7('0x38')](_0x2120d5['model'],qs[_0xfde7('0x39')](_0x2f1f25[_0xfde7('0x36')][_0xfde7('0x39')]));_0x418807[_0xfde7('0x37')]=_0x418807[_0xfde7('0x37')]['length']?_0x418807['attributes']:_0x2120d5[_0xfde7('0x34')];if(_0x2f1f25[_0xfde7('0x36')][_0xfde7('0x44')]){_0x418807[_0xfde7('0x45')]=[{'all':!![]}];}_0x418807=_[_0xfde7('0x41')]({},_0x418807,_0x2f1f25['options']);return db[_0xfde7('0x2f')][_0xfde7('0x4c')](_0x418807)[_0xfde7('0x25')](handleEntityNotFound(_0x1805c1,null))[_0xfde7('0x25')](respondWithResult(_0x1805c1,null))[_0xfde7('0x48')](handleError(_0x1805c1,null));};exports[_0xfde7('0x4d')]=function(_0x1fbce8,_0x1640cb){return db[_0xfde7('0x2f')][_0xfde7('0x4d')](_0x1fbce8[_0xfde7('0x4e')],{})['then'](function(_0x3429d5){var _0x3c34b6=_0x1fbce8[_0xfde7('0x4f')][_0xfde7('0x27')]({'plain':!![]});if(!_0x3c34b6)throw new Error(_0xfde7('0x50'));if(_0x3c34b6[_0xfde7('0x51')]===_0xfde7('0x4f')){var _0x46f3bc=_0x3429d5['get']({'plain':!![]});var _0x4f905b='CmHopperAdditionalPhones';return db['UserProfileSection']['find']({'where':{'name':_0x4f905b,'userProfileId':_0x3c34b6['userProfileId']},'raw':!![]})[_0xfde7('0x25')](function(_0x484e71){if(_0x484e71&&_0x484e71[_0xfde7('0x52')]===0x0){return db[_0xfde7('0x29')][_0xfde7('0x4d')]({'name':_0x46f3bc[_0xfde7('0x2c')],'resourceId':_0x46f3bc['id'],'type':_0x484e71[_0xfde7('0x2c')],'sectionId':_0x484e71['id']},{})[_0xfde7('0x25')](function(){return _0x3429d5;});}else{return _0x3429d5;}})[_0xfde7('0x48')](function(_0x5487fa){logger[_0xfde7('0x2a')](_0xfde7('0x53'),_0x5487fa);throw _0x5487fa;});}return _0x3429d5;})[_0xfde7('0x25')](respondWithResult(_0x1640cb,0xc9))[_0xfde7('0x48')](handleError(_0x1640cb,null));};exports[_0xfde7('0x24')]=function(_0x5550ef,_0x188c5f){if(_0x5550ef[_0xfde7('0x4e')]['id']){delete _0x5550ef[_0xfde7('0x4e')]['id'];}return db['CmHopperAdditionalPhone'][_0xfde7('0x4c')]({'where':{'id':_0x5550ef[_0xfde7('0x4a')]['id']}})[_0xfde7('0x25')](handleEntityNotFound(_0x188c5f,null))[_0xfde7('0x25')](saveUpdates(_0x5550ef[_0xfde7('0x4e')],null))[_0xfde7('0x25')](respondWithResult(_0x188c5f,null))['catch'](handleError(_0x188c5f,null));};exports[_0xfde7('0x26')]=function(_0x904057,_0x1864e9){return db[_0xfde7('0x2f')]['find']({'where':{'id':_0x904057[_0xfde7('0x4a')]['id']}})[_0xfde7('0x25')](handleEntityNotFound(_0x1864e9,null))[_0xfde7('0x25')](removeEntity(_0x1864e9,null))[_0xfde7('0x48')](handleError(_0x1864e9,null));}; \ No newline at end of file +var _0x8a62=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','end','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x2ac5bd,_0x3e6c39){var _0x4bfd91=function(_0x21053d){while(--_0x21053d){_0x2ac5bd['push'](_0x2ac5bd['shift']());}};_0x4bfd91(++_0x3e6c39);}(_0x8a62,0xfd));var _0x28a6=function(_0x4f1181,_0x44eb61){_0x4f1181=_0x4f1181-0x0;var _0x3747da=_0x8a62[_0x4f1181];return _0x3747da;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x28a6('0x0'));var jsonpatch=require(_0x28a6('0x1'));var rp=require(_0x28a6('0x2'));var moment=require('moment');var BPromise=require(_0x28a6('0x3'));var Mustache=require(_0x28a6('0x4'));var util=require(_0x28a6('0x5'));var path=require(_0x28a6('0x6'));var sox=require(_0x28a6('0x7'));var csv=require(_0x28a6('0x8'));var ejs=require(_0x28a6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28a6('0xa'));var squel=require(_0x28a6('0xb'));var crypto=require(_0x28a6('0xc'));var jsforce=require(_0x28a6('0xd'));var deskjs=require(_0x28a6('0xe'));var toCsv=require(_0x28a6('0x8'));var querystring=require('querystring');var Papa=require(_0x28a6('0xf'));var Redis=require('ioredis');var authService=require(_0x28a6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x28a6('0x11'));var hardwareService=require(_0x28a6('0x12'));var logger=require(_0x28a6('0x13'))(_0x28a6('0x14'));var utils=require(_0x28a6('0x15'));var config=require(_0x28a6('0x16'));var licenseUtil=require(_0x28a6('0x17'));var db=require(_0x28a6('0x18'))['db'];function respondWithStatusCode(_0x345b54,_0x5e8dbe){_0x5e8dbe=_0x5e8dbe||0xcc;return function(_0x4a1b39){if(_0x4a1b39){return _0x345b54[_0x28a6('0x19')](_0x5e8dbe);}return _0x345b54[_0x28a6('0x1a')](_0x5e8dbe)['end']();};}function respondWithResult(_0x52ee22,_0x1f9074){_0x1f9074=_0x1f9074||0xc8;return function(_0x12cc4f){if(_0x12cc4f){return _0x52ee22['status'](_0x1f9074)[_0x28a6('0x1b')](_0x12cc4f);}};}function respondWithFilteredResult(_0x857871,_0x407435){return function(_0x552915){if(_0x552915){var _0x3f9908=typeof _0x407435[_0x28a6('0x1c')]===_0x28a6('0x1d')&&typeof _0x407435['limit']===_0x28a6('0x1d');var _0x2e31df=_0x552915['count'];var _0x27b5b7=_0x3f9908?0x0:_0x407435[_0x28a6('0x1c')];var _0x3db793=_0x3f9908?_0x552915[_0x28a6('0x1e')]:_0x407435[_0x28a6('0x1c')]+_0x407435[_0x28a6('0x1f')];var _0x40eda6;if(_0x3db793>=_0x2e31df){_0x3db793=_0x2e31df;_0x40eda6=0xc8;}else{_0x40eda6=0xce;}_0x857871['status'](_0x40eda6);return _0x857871['set'](_0x28a6('0x20'),_0x27b5b7+'-'+_0x3db793+'/'+_0x2e31df)[_0x28a6('0x1b')](_0x552915);}return null;};}function patchUpdates(_0x530db1){return function(_0x3c0442){try{jsonpatch[_0x28a6('0x21')](_0x3c0442,_0x530db1,!![]);}catch(_0x3f8829){return BPromise[_0x28a6('0x22')](_0x3f8829);}return _0x3c0442[_0x28a6('0x23')]();};}function saveUpdates(_0x18179b,_0x3e67e2){return function(_0x520936){if(_0x520936){return _0x520936[_0x28a6('0x24')](_0x18179b)[_0x28a6('0x25')](function(_0x40e767){return _0x40e767;});}return null;};}function removeEntity(_0x204480,_0x23a49d){return function(_0x4b1e0c){if(_0x4b1e0c){return _0x4b1e0c['destroy']()[_0x28a6('0x25')](function(){var _0x37e601=_0x4b1e0c[_0x28a6('0x26')]({'plain':!![]});var _0x4b9ee1=_0x28a6('0x27');return db[_0x28a6('0x28')][_0x28a6('0x29')]({'where':{'type':_0x4b9ee1,'resourceId':_0x37e601['id']}})['then'](function(){return _0x4b1e0c;});})[_0x28a6('0x25')](function(){_0x204480['status'](0xcc)[_0x28a6('0x2a')]();});}};}function handleEntityNotFound(_0xaa9c87,_0x51dd10){return function(_0xf98208){if(!_0xf98208){_0xaa9c87[_0x28a6('0x19')](0x194);}return _0xf98208;};}function handleError(_0xe88312,_0x59505c){_0x59505c=_0x59505c||0x1f4;return function(_0x31c2e0){logger[_0x28a6('0x2b')](_0x31c2e0[_0x28a6('0x2c')]);if(_0x31c2e0[_0x28a6('0x2d')]){delete _0x31c2e0[_0x28a6('0x2d')];}_0xe88312[_0x28a6('0x1a')](_0x59505c)[_0x28a6('0x2e')](_0x31c2e0);};}exports[_0x28a6('0x2f')]=function(_0xbf62cc,_0x18a868){var _0x3b14d2={},_0x208b01={},_0xa8e821={'count':0x0,'rows':[]};var _0x2d9e04=_[_0x28a6('0x30')](db[_0x28a6('0x31')][_0x28a6('0x32')],function(_0xc873f1){return{'name':_0xc873f1[_0x28a6('0x33')],'type':_0xc873f1[_0x28a6('0x34')][_0x28a6('0x35')]};});_0x208b01[_0x28a6('0x36')]=_['map'](_0x2d9e04,_0x28a6('0x2d'));_0x208b01['query']=_['keys'](_0xbf62cc['query']);_0x208b01[_0x28a6('0x37')]=_['intersection'](_0x208b01['model'],_0x208b01['query']);_0x3b14d2[_0x28a6('0x38')]=_[_0x28a6('0x39')](_0x208b01[_0x28a6('0x36')],qs[_0x28a6('0x3a')](_0xbf62cc[_0x28a6('0x3b')][_0x28a6('0x3a')]));_0x3b14d2[_0x28a6('0x38')]=_0x3b14d2[_0x28a6('0x38')][_0x28a6('0x3c')]?_0x3b14d2[_0x28a6('0x38')]:_0x208b01[_0x28a6('0x36')];if(!_0xbf62cc[_0x28a6('0x3b')][_0x28a6('0x3d')](_0x28a6('0x3e'))){_0x3b14d2[_0x28a6('0x1f')]=qs[_0x28a6('0x1f')](_0xbf62cc[_0x28a6('0x3b')]['limit']);_0x3b14d2[_0x28a6('0x1c')]=qs['offset'](_0xbf62cc[_0x28a6('0x3b')][_0x28a6('0x1c')]);}_0x3b14d2['order']=qs[_0x28a6('0x3f')](_0xbf62cc['query'][_0x28a6('0x3f')]);_0x3b14d2[_0x28a6('0x40')]=qs['filters'](_[_0x28a6('0x41')](_0xbf62cc[_0x28a6('0x3b')],_0x208b01[_0x28a6('0x37')]),_0x2d9e04);if(_0xbf62cc['query'][_0x28a6('0x42')]){_0x3b14d2[_0x28a6('0x40')]=_[_0x28a6('0x43')](_0x3b14d2[_0x28a6('0x40')],{'$or':_[_0x28a6('0x30')](_0x2d9e04,function(_0x13584a){if(_0x13584a['type']!==_0x28a6('0x44')){var _0x3abe01={};_0x3abe01[_0x13584a[_0x28a6('0x2d')]]={'$like':'%'+_0xbf62cc['query'][_0x28a6('0x42')]+'%'};return _0x3abe01;}})});}_0x3b14d2=_['merge']({},_0x3b14d2,_0xbf62cc[_0x28a6('0x45')]);var _0x56510f={'where':_0x3b14d2[_0x28a6('0x40')]};return db[_0x28a6('0x31')]['count'](_0x56510f)[_0x28a6('0x25')](function(_0x5901d6){_0xa8e821[_0x28a6('0x1e')]=_0x5901d6;if(_0xbf62cc[_0x28a6('0x3b')][_0x28a6('0x46')]){_0x3b14d2[_0x28a6('0x47')]=[{'all':!![]}];}return db[_0x28a6('0x31')][_0x28a6('0x48')](_0x3b14d2);})[_0x28a6('0x25')](function(_0x1a3217){_0xa8e821[_0x28a6('0x49')]=_0x1a3217;return _0xa8e821;})['then'](respondWithFilteredResult(_0x18a868,_0x3b14d2))[_0x28a6('0x4a')](handleError(_0x18a868,null));};exports[_0x28a6('0x4b')]=function(_0x4db53b,_0x237aff){var _0x269ea3={'raw':!![],'where':{'id':_0x4db53b[_0x28a6('0x4c')]['id']}},_0x453b1f={};_0x453b1f['model']=_[_0x28a6('0x4d')](db['CmHopperAdditionalPhone'][_0x28a6('0x32')]);_0x453b1f['query']=_[_0x28a6('0x4d')](_0x4db53b[_0x28a6('0x3b')]);_0x453b1f[_0x28a6('0x37')]=_[_0x28a6('0x39')](_0x453b1f['model'],_0x453b1f[_0x28a6('0x3b')]);_0x269ea3['attributes']=_[_0x28a6('0x39')](_0x453b1f[_0x28a6('0x36')],qs[_0x28a6('0x3a')](_0x4db53b[_0x28a6('0x3b')][_0x28a6('0x3a')]));_0x269ea3[_0x28a6('0x38')]=_0x269ea3['attributes'][_0x28a6('0x3c')]?_0x269ea3[_0x28a6('0x38')]:_0x453b1f[_0x28a6('0x36')];if(_0x4db53b[_0x28a6('0x3b')]['includeAll']){_0x269ea3[_0x28a6('0x47')]=[{'all':!![]}];}_0x269ea3=_[_0x28a6('0x43')]({},_0x269ea3,_0x4db53b['options']);return db['CmHopperAdditionalPhone'][_0x28a6('0x4e')](_0x269ea3)[_0x28a6('0x25')](handleEntityNotFound(_0x237aff,null))[_0x28a6('0x25')](respondWithResult(_0x237aff,null))[_0x28a6('0x4a')](handleError(_0x237aff,null));};exports[_0x28a6('0x4f')]=function(_0x3e90d2,_0x2b19a9){return db[_0x28a6('0x31')][_0x28a6('0x4f')](_0x3e90d2[_0x28a6('0x50')],{})['then'](function(_0x4bb571){var _0x21eae4=_0x3e90d2[_0x28a6('0x51')][_0x28a6('0x26')]({'plain':!![]});if(!_0x21eae4)throw new Error(_0x28a6('0x52'));if(_0x21eae4[_0x28a6('0x53')]===_0x28a6('0x51')){var _0x3cf41a=_0x4bb571[_0x28a6('0x26')]({'plain':!![]});var _0x19dc96=_0x28a6('0x27');return db[_0x28a6('0x54')]['find']({'where':{'name':_0x19dc96,'userProfileId':_0x21eae4[_0x28a6('0x55')]},'raw':!![]})[_0x28a6('0x25')](function(_0x632cff){if(_0x632cff&&_0x632cff[_0x28a6('0x56')]===0x0){return db[_0x28a6('0x28')][_0x28a6('0x4f')]({'name':_0x3cf41a[_0x28a6('0x2d')],'resourceId':_0x3cf41a['id'],'type':_0x632cff[_0x28a6('0x2d')],'sectionId':_0x632cff['id']},{})[_0x28a6('0x25')](function(){return _0x4bb571;});}else{return _0x4bb571;}})['catch'](function(_0x448330){logger[_0x28a6('0x2b')](_0x28a6('0x57'),_0x448330);throw _0x448330;});}return _0x4bb571;})[_0x28a6('0x25')](respondWithResult(_0x2b19a9,0xc9))[_0x28a6('0x4a')](handleError(_0x2b19a9,null));};exports['update']=function(_0xd58f01,_0x5130e3){if(_0xd58f01[_0x28a6('0x50')]['id']){delete _0xd58f01[_0x28a6('0x50')]['id'];}return db[_0x28a6('0x31')][_0x28a6('0x4e')]({'where':{'id':_0xd58f01[_0x28a6('0x4c')]['id']}})[_0x28a6('0x25')](handleEntityNotFound(_0x5130e3,null))[_0x28a6('0x25')](saveUpdates(_0xd58f01[_0x28a6('0x50')],null))[_0x28a6('0x25')](respondWithResult(_0x5130e3,null))[_0x28a6('0x4a')](handleError(_0x5130e3,null));};exports[_0x28a6('0x29')]=function(_0x29dcc8,_0xfcf111){return db[_0x28a6('0x31')]['find']({'where':{'id':_0x29dcc8[_0x28a6('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfcf111,null))[_0x28a6('0x25')](removeEntity(_0xfcf111,null))[_0x28a6('0x4a')](handleError(_0xfcf111,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 3c19ed9..e94e849 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 _0x7698=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','path','./cmHopperAdditionalPhone.attributes','exports'];(function(_0x1ae4ca,_0x42289d){var _0x174cd6=function(_0x21be88){while(--_0x21be88){_0x1ae4ca['push'](_0x1ae4ca['shift']());}};_0x174cd6(++_0x42289d);}(_0x7698,0x7b));var _0x8769=function(_0x778f9a,_0x109615){_0x778f9a=_0x778f9a-0x0;var _0x66d2e5=_0x7698[_0x778f9a];return _0x66d2e5;};'use strict';var _=require(_0x8769('0x0'));var util=require(_0x8769('0x1'));var logger=require(_0x8769('0x2'))(_0x8769('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8769('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8769('0x5'));module[_0x8769('0x6')]=function(_0x8c7169,_0x30cd34){return _0x8c7169[_0x8769('0x7')](_0x8769('0x8'),attributes,{'tableName':_0x8769('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2066=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x366276,_0xa3cbaf){var _0xcefaff=function(_0x53fb69){while(--_0x53fb69){_0x366276['push'](_0x366276['shift']());}};_0xcefaff(++_0xa3cbaf);}(_0x2066,0x7b));var _0x6206=function(_0x12bec6,_0x1bae75){_0x12bec6=_0x12bec6-0x0;var _0x3870a7=_0x2066[_0x12bec6];return _0x3870a7;};'use strict';var _=require(_0x6206('0x0'));var util=require(_0x6206('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6206('0x2'));var BPromise=require(_0x6206('0x3'));var rp=require(_0x6206('0x4'));var fs=require('fs');var path=require(_0x6206('0x5'));var rimraf=require(_0x6206('0x6'));var config=require(_0x6206('0x7'));var attributes=require(_0x6206('0x8'));module[_0x6206('0x9')]=function(_0x18a945,_0x286ce6){return _0x18a945[_0x6206('0xa')](_0x6206('0xb'),attributes,{'tableName':_0x6206('0xc'),'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 b015d48..8f62773 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 _0x35f4=['then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','info','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnosuchnumberretry','VerifyAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','countbusyretry','createdAt','updatedAt','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x4dade6,_0x16b01d){var _0x513270=function(_0x1d4a7f){while(--_0x1d4a7f){_0x4dade6['push'](_0x4dade6['shift']());}};_0x513270(++_0x16b01d);}(_0x35f4,0x9c));var _0x435f=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x35f4[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0x435f('0x0'));var util=require(_0x435f('0x1'));var moment=require(_0x435f('0x2'));var BPromise=require(_0x435f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x435f('0x4'));var db=require(_0x435f('0x5'))['db'];var utils=require(_0x435f('0x6'));var logger=require(_0x435f('0x7'))('rpc');var config=require(_0x435f('0x8'));var jayson=require(_0x435f('0x9'));var client=jayson['client'][_0x435f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ddf,_0x1f3d4c,_0x4c8813){return new BPromise(function(_0x2f3043,_0x45a207){return client[_0x435f('0xb')](_0x3d8ddf,_0x4c8813)[_0x435f('0xc')](function(_0x2fa30b){logger['info'](_0x435f('0xd'),_0x1f3d4c,_0x435f('0xe'));logger[_0x435f('0xf')](_0x435f('0x10'),_0x1f3d4c,_0x435f('0xe'),JSON['stringify'](_0x2fa30b));if(_0x2fa30b[_0x435f('0x11')]){if(_0x2fa30b[_0x435f('0x11')]['code']===0x1f4){logger[_0x435f('0x11')](_0x435f('0xd'),_0x1f3d4c,_0x2fa30b[_0x435f('0x11')][_0x435f('0x12')]);return _0x45a207(_0x2fa30b[_0x435f('0x11')]['message']);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1f3d4c,_0x2fa30b[_0x435f('0x11')][_0x435f('0x12')]);return _0x2f3043(_0x2fa30b[_0x435f('0x11')]['message']);}else{logger[_0x435f('0x13')](_0x435f('0xd'),_0x1f3d4c,_0x435f('0xe'));_0x2f3043(_0x2fa30b['result'][_0x435f('0x12')]);}})[_0x435f('0x14')](function(_0x3b4b95){logger[_0x435f('0x11')](_0x435f('0xd'),_0x1f3d4c,_0x3b4b95);_0x45a207(_0x3b4b95);});});}exports['VerifyAdditionalPhones']=function(_0x5dda87){var _0x41ac15=this;return new Promise(function(_0x107dba,_0x199642){return db[_0x435f('0x15')][_0x435f('0x16')]({'raw':!![],'where':{'ContactId':_0x5dda87[_0x435f('0x17')][_0x435f('0x18')],'ListId':_0x5dda87[_0x435f('0x17')][_0x435f('0x19')],'VoiceQueueId':_0x5dda87[_0x435f('0x17')][_0x435f('0x1a')]===undefined?null:_0x5dda87[_0x435f('0x17')][_0x435f('0x1a')],'CampaignId':_0x5dda87['body'][_0x435f('0x1b')]===undefined?null:_0x5dda87[_0x435f('0x17')][_0x435f('0x1b')]}})[_0x435f('0xc')](function(_0x80bcff){if(_0x80bcff!=null){return db[_0x435f('0x1c')][_0x435f('0x16')]({'raw':!![],'where':{'CmHopperId':_0x80bcff['id'],'OrderBy':{'$gt':_0x80bcff[_0x435f('0x1d')]}},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})[_0x435f('0xc')](function(_0x4b6601){var _0x113885=0x0;if(_0x4b6601){if(_0x4b6601['countbusyretry']+_0x4b6601[_0x435f('0x1f')]+_0x4b6601[_0x435f('0x20')]+_0x4b6601['countnosuchnumberretry']+_0x4b6601[_0x435f('0x21')]+_0x4b6601[_0x435f('0x22')]+_0x4b6601[_0x435f('0x23')]+_0x4b6601[_0x435f('0x24')]<_0x5dda87[_0x435f('0x25')][_0x435f('0x26')])_0x113885=0x1;_0x107dba({'additional':_0x113885});}else{return db[_0x435f('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x80bcff['id']},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})[_0x435f('0xc')](function(_0xda5fc3){var _0x17a8d0=0x0;if(_0xda5fc3){if(_0xda5fc3['countbusyretry']+_0xda5fc3[_0x435f('0x1f')]+_0xda5fc3['countnoanswerretry']+_0xda5fc3[_0x435f('0x27')]+_0xda5fc3[_0x435f('0x21')]+_0xda5fc3[_0x435f('0x22')]+_0xda5fc3[_0x435f('0x23')]+_0xda5fc3[_0x435f('0x24')]<_0x5dda87['entity'][_0x435f('0x26')])_0x17a8d0=0x1;_0x107dba({'additional':_0x17a8d0});}else{_0x107dba({'additional':0x0});}})[_0x435f('0x14')](function(_0x576a3f){logger[_0x435f('0x11')](_0x435f('0x28'),_0x576a3f[_0x435f('0x12')]);_0x199642(_0x41ac15[_0x435f('0x11')](0x1f4,_0x576a3f['message']));});}})[_0x435f('0x14')](function(_0x1b3a6c){logger['error'](_0x435f('0x28'),_0x1b3a6c[_0x435f('0x12')]);_0x199642(_0x41ac15[_0x435f('0x11')](0x1f4,_0x1b3a6c[_0x435f('0x12')]));});}else _0x107dba({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x16337c){var _0x340cb3=this;return new Promise(function(_0x43a1b0,_0x1e5a49){return db[_0x435f('0x15')][_0x435f('0x16')]({'raw':!![],'where':{'ContactId':_0x16337c[_0x435f('0x17')][_0x435f('0x18')],'ListId':_0x16337c[_0x435f('0x17')][_0x435f('0x19')],'VoiceQueueId':_0x16337c['body']['VoiceQueueId']===undefined?null:_0x16337c[_0x435f('0x17')][_0x435f('0x1a')],'CampaignId':_0x16337c[_0x435f('0x17')]['CampaignId']===undefined?null:_0x16337c[_0x435f('0x17')]['CampaignId']}})[_0x435f('0xc')](function(_0x35ead1){if(_0x35ead1!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x35ead1['id'],'OrderBy':{'$gte':_0x35ead1[_0x435f('0x1d')]}},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})['then'](function(_0x1747b3){if(_0x1747b3)return activateAdditionalPhone(_0x35ead1,_0x16337c['body'],_0x1747b3,_0x16337c[_0x435f('0x29')],_0x16337c['waitTime'])['then'](function(_0x58b3d2){_0x43a1b0(_0x58b3d2);});else{return db[_0x435f('0x1c')][_0x435f('0x16')]({'raw':!![],'where':{'CmHopperId':_0x35ead1['id']},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})[_0x435f('0xc')](function(_0x40ab3e){if(_0x40ab3e)return activateAdditionalPhone(_0x35ead1,_0x16337c[_0x435f('0x17')],_0x40ab3e,_0x16337c['duration'],_0x16337c[_0x435f('0x2a')])[_0x435f('0xc')](function(_0x54de4b){_0x43a1b0(_0x54de4b);});else{_0x43a1b0({'id':_0x35ead1['id'],'phone':''});}})['catch'](function(_0x5c6e02){logger[_0x435f('0x11')](_0x435f('0x28'),_0x5c6e02[_0x435f('0x12')]);_0x1e5a49(_0x340cb3[_0x435f('0x11')](0x1f4,_0x5c6e02[_0x435f('0x12')]));});}})[_0x435f('0x14')](function(_0x423280){logger[_0x435f('0x11')](_0x435f('0x28'),_0x423280[_0x435f('0x12')]);_0x1e5a49(_0x340cb3['error'](0x1f4,_0x423280[_0x435f('0x12')]));});}else _0x43a1b0(0x1);});});};function activateAdditionalPhone(_0x53362b,_0x436a29,_0x511372,_0x2c6f9a,_0x361a32){return new Promise(function(_0x415f88,_0x11744e){var _0x4c520c;if(_[_0x435f('0x2b')](_0x511372[_0x435f('0x2c')])){_0x511372[_0x435f('0x2c')]=moment();}if(moment()>moment(_0x511372[_0x435f('0x2c')])){_0x4c520c=moment()[_0x435f('0x2d')](_0x361a32||0x3,_0x435f('0x2e'));}else{if(_0x511372[_0x435f('0x1d')]==0x0){_0x4c520c=moment(_0x511372[_0x435f('0x2c')]);}else{_0x4c520c=moment()['add'](_0x361a32||0x3,_0x435f('0x2e'));}}if(_[_0x435f('0x2b')](_0x4c520c)){_0x4c520c=moment()[_0x435f('0x2d')](_0x361a32||0x3,_0x435f('0x2e'));}var _0x2f3774={'phone':_0x53362b[_0x435f('0x2f')],'active':0x0,'OrderBy':_[_0x435f('0x2b')](_0x53362b['OrderBy'])?0x0:_0x53362b[_0x435f('0x1d')],'scheduledat':moment()[_0x435f('0x2d')](_0x2c6f9a||0x1,_0x435f('0x2e')),'countbusyretry':_0x436a29[_0x435f('0x30')],'countcongestionretry':_0x436a29[_0x435f('0x1f')],'countnoanswerretry':_0x436a29[_0x435f('0x20')],'countnosuchnumberretry':_0x436a29[_0x435f('0x27')],'countdropretry':_0x436a29[_0x435f('0x21')],'countabandonedretry':_0x436a29[_0x435f('0x22')],'countmachineretry':_0x436a29['countmachineretry'],'countagentrejectretry':_0x436a29[_0x435f('0x24')],'createdAt':_0x436a29[_0x435f('0x31')],'updatedAt':_0x436a29[_0x435f('0x32')]};var _0x11dfc4={'CmHopperId':_0x53362b['id'],'phone':_0x511372[_0x435f('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x511372[_0x435f('0x1d')])?0x0:_0x511372[_0x435f('0x1d')],'scheduledat':_0x4c520c,'countbusyretry':_0x511372[_0x435f('0x30')],'countcongestionretry':_0x511372[_0x435f('0x1f')],'countnoanswerretry':_0x511372[_0x435f('0x20')],'countnosuchnumberretry':_0x511372[_0x435f('0x27')],'countdropretry':_0x511372['countdropretry'],'countabandonedretry':_0x511372[_0x435f('0x22')],'countmachineretry':_0x511372[_0x435f('0x23')],'countagentrejectretry':_0x511372['countagentrejectretry'],'createdAt':_0x511372[_0x435f('0x31')],'updatedAt':_0x511372['updatedAt']};return db[_0x435f('0x33')][_0x435f('0x34')](function(_0x385aa3){return db['CmHopperAdditionalPhone'][_0x435f('0x35')](_0x2f3774,{'where':{'id':_0x511372['id']}},{'transaction':_0x385aa3})[_0x435f('0xc')](function(){return db[_0x435f('0x15')][_0x435f('0x35')](_0x11dfc4,{'where':{'id':_0x53362b['id']}},{'transaction':_0x385aa3});});})[_0x435f('0xc')](function(_0x37e5eb){_0x415f88({'id':_0x53362b['id'],'phone':_0x511372['phone']});})[_0x435f('0x14')](function(_0x2780dc){logger['error']('activateAdditionalPhone',_0x2780dc[_0x435f('0x12')]);_0x11744e({'error':_0x2780dc['message']});});});}exports[_0x435f('0x36')]=function(_0x43334f){var _0x595894=this;return new Promise(function(_0x597654,_0x175947){return db['CmHopper'][_0x435f('0x35')](_0x43334f[_0x435f('0x17')][_0x435f('0x37')],{'where':{'id':_0x43334f[_0x435f('0x17')]['id']}})[_0x435f('0xc')](function(_0x41d873){_0x597654(_0x41d873);})[_0x435f('0x14')](function(_0x2bd98f){logger[_0x435f('0x11')](_0x435f('0x36'),_0x2bd98f[_0x435f('0x12')]);_0x175947(_0x595894['error'](0x1f4,_0x2bd98f['message']));});});}; \ No newline at end of file +var _0xa531=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','ASC','countcongestionretry','entity','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','update','field','IncrementPreviewCounters','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x51ac81,_0x4722b2){var _0x12ac7e=function(_0x4dd4c1){while(--_0x4dd4c1){_0x51ac81['push'](_0x51ac81['shift']());}};_0x12ac7e(++_0x4722b2);}(_0xa531,0x12e));var _0x1a53=function(_0x2444a4,_0x36b773){_0x2444a4=_0x2444a4-0x0;var _0x1786fb=_0xa531[_0x2444a4];return _0x1786fb;};'use strict';var _=require(_0x1a53('0x0'));var util=require(_0x1a53('0x1'));var moment=require(_0x1a53('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a53('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a53('0x4'));var logger=require(_0x1a53('0x5'))(_0x1a53('0x6'));var config=require(_0x1a53('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1a53('0x8')][_0x1a53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d1d3f,_0x2f4e98,_0x55382c){return new BPromise(function(_0x4c1ab4,_0xb57b1c){return client[_0x1a53('0xa')](_0x2d1d3f,_0x55382c)[_0x1a53('0xb')](function(_0x10012d){logger[_0x1a53('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2f4e98,_0x1a53('0xd'));logger[_0x1a53('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x2f4e98,'request\x20sent',JSON[_0x1a53('0xf')](_0x10012d));if(_0x10012d[_0x1a53('0x10')]){if(_0x10012d['error'][_0x1a53('0x11')]===0x1f4){logger['error'](_0x1a53('0x12'),_0x2f4e98,_0x10012d[_0x1a53('0x10')][_0x1a53('0x13')]);return _0xb57b1c(_0x10012d[_0x1a53('0x10')][_0x1a53('0x13')]);}logger[_0x1a53('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2f4e98,_0x10012d[_0x1a53('0x10')][_0x1a53('0x13')]);return _0x4c1ab4(_0x10012d[_0x1a53('0x10')][_0x1a53('0x13')]);}else{logger[_0x1a53('0xc')](_0x1a53('0x12'),_0x2f4e98,'request\x20sent');_0x4c1ab4(_0x10012d[_0x1a53('0x14')][_0x1a53('0x13')]);}})[_0x1a53('0x15')](function(_0x3cae4a){logger[_0x1a53('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2f4e98,_0x3cae4a);_0xb57b1c(_0x3cae4a);});});}exports['VerifyAdditionalPhones']=function(_0x5bd6c9){var _0x409d0e=this;return new Promise(function(_0x295a62,_0x3ad41c){return db[_0x1a53('0x16')][_0x1a53('0x17')]({'raw':!![],'where':{'ContactId':_0x5bd6c9[_0x1a53('0x18')][_0x1a53('0x19')],'ListId':_0x5bd6c9['body'][_0x1a53('0x1a')],'VoiceQueueId':_0x5bd6c9[_0x1a53('0x18')][_0x1a53('0x1b')]===undefined?null:_0x5bd6c9[_0x1a53('0x18')][_0x1a53('0x1b')],'CampaignId':_0x5bd6c9[_0x1a53('0x18')][_0x1a53('0x1c')]===undefined?null:_0x5bd6c9[_0x1a53('0x18')][_0x1a53('0x1c')]}})[_0x1a53('0xb')](function(_0x4a2ec7){if(_0x4a2ec7!=null){return db[_0x1a53('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4a2ec7['id'],'OrderBy':{'$gt':_0x4a2ec7[_0x1a53('0x1e')]}},'order':[['OrderBy','ASC']]})['then'](function(_0x1ff0f0){var _0x56dd59=0x0;if(_0x1ff0f0){if(_0x1ff0f0[_0x1a53('0x1f')]+_0x1ff0f0['countcongestionretry']+_0x1ff0f0[_0x1a53('0x20')]+_0x1ff0f0[_0x1a53('0x21')]+_0x1ff0f0[_0x1a53('0x22')]+_0x1ff0f0[_0x1a53('0x23')]+_0x1ff0f0[_0x1a53('0x24')]+_0x1ff0f0[_0x1a53('0x25')]<_0x5bd6c9['entity'][_0x1a53('0x26')])_0x56dd59=0x1;_0x295a62({'additional':_0x56dd59});}else{return db[_0x1a53('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4a2ec7['id']},'order':[[_0x1a53('0x1e'),_0x1a53('0x27')]]})[_0x1a53('0xb')](function(_0xd17829){var _0x49bbaa=0x0;if(_0xd17829){if(_0xd17829['countbusyretry']+_0xd17829[_0x1a53('0x28')]+_0xd17829['countnoanswerretry']+_0xd17829[_0x1a53('0x21')]+_0xd17829[_0x1a53('0x22')]+_0xd17829[_0x1a53('0x23')]+_0xd17829[_0x1a53('0x24')]+_0xd17829['countagentrejectretry']<_0x5bd6c9[_0x1a53('0x29')]['dialGlobalMaxRetry'])_0x49bbaa=0x1;_0x295a62({'additional':_0x49bbaa});}else{_0x295a62({'additional':0x0});}})[_0x1a53('0x15')](function(_0x14834b){logger['error'](_0x1a53('0x2a'),_0x14834b[_0x1a53('0x13')]);_0x3ad41c(_0x409d0e[_0x1a53('0x10')](0x1f4,_0x14834b[_0x1a53('0x13')]));});}})[_0x1a53('0x15')](function(_0x37c316){logger[_0x1a53('0x10')]('VerifyAdditionalPhones',_0x37c316[_0x1a53('0x13')]);_0x3ad41c(_0x409d0e[_0x1a53('0x10')](0x1f4,_0x37c316[_0x1a53('0x13')]));});}else _0x295a62({'additional':0x0});});});};exports[_0x1a53('0x2b')]=function(_0x479bb4){var _0x4ae0e0=this;return new Promise(function(_0x2e788d,_0x4ca8b2){return db[_0x1a53('0x16')][_0x1a53('0x17')]({'raw':!![],'where':{'ContactId':_0x479bb4[_0x1a53('0x18')][_0x1a53('0x19')],'ListId':_0x479bb4[_0x1a53('0x18')][_0x1a53('0x1a')],'VoiceQueueId':_0x479bb4[_0x1a53('0x18')]['VoiceQueueId']===undefined?null:_0x479bb4[_0x1a53('0x18')][_0x1a53('0x1b')],'CampaignId':_0x479bb4[_0x1a53('0x18')][_0x1a53('0x1c')]===undefined?null:_0x479bb4[_0x1a53('0x18')][_0x1a53('0x1c')]}})[_0x1a53('0xb')](function(_0x3e5398){if(_0x3e5398!=null){return db[_0x1a53('0x1d')][_0x1a53('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3e5398['id'],'OrderBy':{'$gte':_0x3e5398['OrderBy']}},'order':[[_0x1a53('0x1e'),'ASC']]})[_0x1a53('0xb')](function(_0x5a2f78){if(_0x5a2f78)return activateAdditionalPhone(_0x3e5398,_0x479bb4[_0x1a53('0x18')],_0x5a2f78,_0x479bb4[_0x1a53('0x2c')],_0x479bb4['waitTime'])[_0x1a53('0xb')](function(_0x5f7f76){_0x2e788d(_0x5f7f76);});else{return db[_0x1a53('0x1d')][_0x1a53('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3e5398['id']},'order':[['OrderBy',_0x1a53('0x27')]]})[_0x1a53('0xb')](function(_0x287d2d){if(_0x287d2d)return activateAdditionalPhone(_0x3e5398,_0x479bb4['body'],_0x287d2d,_0x479bb4[_0x1a53('0x2c')],_0x479bb4[_0x1a53('0x2d')])[_0x1a53('0xb')](function(_0x14eeb5){_0x2e788d(_0x14eeb5);});else{_0x2e788d({'id':_0x3e5398['id'],'phone':''});}})[_0x1a53('0x15')](function(_0x52d38e){logger['error']('VerifyAdditionalPhones',_0x52d38e['message']);_0x4ca8b2(_0x4ae0e0[_0x1a53('0x10')](0x1f4,_0x52d38e[_0x1a53('0x13')]));});}})['catch'](function(_0xbb5f8e){logger[_0x1a53('0x10')]('VerifyAdditionalPhones',_0xbb5f8e[_0x1a53('0x13')]);_0x4ca8b2(_0x4ae0e0[_0x1a53('0x10')](0x1f4,_0xbb5f8e['message']));});}else _0x2e788d(0x1);});});};function activateAdditionalPhone(_0x63889f,_0x14baa3,_0x5d8cdb,_0x569657,_0x2f67eb){return new Promise(function(_0x34174e,_0x9c9cbb){var _0x470d35;if(_[_0x1a53('0x2e')](_0x5d8cdb[_0x1a53('0x2f')])){_0x5d8cdb[_0x1a53('0x2f')]=moment();}if(moment()>moment(_0x5d8cdb['scheduledat'])){_0x470d35=moment()[_0x1a53('0x30')](_0x2f67eb||0x3,_0x1a53('0x31'));}else{if(_0x5d8cdb[_0x1a53('0x1e')]==0x0){_0x470d35=moment(_0x5d8cdb['scheduledat']);}else{_0x470d35=moment()[_0x1a53('0x30')](_0x2f67eb||0x3,'minutes');}}if(_[_0x1a53('0x2e')](_0x470d35)){_0x470d35=moment()[_0x1a53('0x30')](_0x2f67eb||0x3,'minutes');}var _0x26f3c8={'phone':_0x63889f['phone'],'active':0x0,'OrderBy':_[_0x1a53('0x2e')](_0x63889f['OrderBy'])?0x0:_0x63889f[_0x1a53('0x1e')],'scheduledat':moment()[_0x1a53('0x30')](_0x569657||0x1,_0x1a53('0x31')),'countbusyretry':_0x14baa3[_0x1a53('0x1f')],'countcongestionretry':_0x14baa3[_0x1a53('0x28')],'countnoanswerretry':_0x14baa3[_0x1a53('0x20')],'countnosuchnumberretry':_0x14baa3['countnosuchnumberretry'],'countdropretry':_0x14baa3[_0x1a53('0x22')],'countabandonedretry':_0x14baa3[_0x1a53('0x23')],'countmachineretry':_0x14baa3[_0x1a53('0x24')],'countagentrejectretry':_0x14baa3[_0x1a53('0x25')],'createdAt':_0x14baa3[_0x1a53('0x32')],'updatedAt':_0x14baa3[_0x1a53('0x33')]};var _0x51dbb5={'CmHopperId':_0x63889f['id'],'phone':_0x5d8cdb[_0x1a53('0x34')],'active':0x0,'OrderBy':_['isNil'](_0x5d8cdb['OrderBy'])?0x0:_0x5d8cdb[_0x1a53('0x1e')],'scheduledat':_0x470d35,'countbusyretry':_0x5d8cdb[_0x1a53('0x1f')],'countcongestionretry':_0x5d8cdb[_0x1a53('0x28')],'countnoanswerretry':_0x5d8cdb[_0x1a53('0x20')],'countnosuchnumberretry':_0x5d8cdb[_0x1a53('0x21')],'countdropretry':_0x5d8cdb[_0x1a53('0x22')],'countabandonedretry':_0x5d8cdb[_0x1a53('0x23')],'countmachineretry':_0x5d8cdb[_0x1a53('0x24')],'countagentrejectretry':_0x5d8cdb['countagentrejectretry'],'createdAt':_0x5d8cdb[_0x1a53('0x32')],'updatedAt':_0x5d8cdb[_0x1a53('0x33')]};return db['sequelize']['transaction'](function(_0x558144){return db[_0x1a53('0x1d')][_0x1a53('0x35')](_0x26f3c8,{'where':{'id':_0x5d8cdb['id']}},{'transaction':_0x558144})['then'](function(){return db[_0x1a53('0x16')]['update'](_0x51dbb5,{'where':{'id':_0x63889f['id']}},{'transaction':_0x558144});});})['then'](function(_0x275eb2){_0x34174e({'id':_0x63889f['id'],'phone':_0x5d8cdb[_0x1a53('0x34')]});})[_0x1a53('0x15')](function(_0x4f8006){logger[_0x1a53('0x10')]('activateAdditionalPhone',_0x4f8006[_0x1a53('0x13')]);_0x9c9cbb({'error':_0x4f8006['message']});});});}exports['IncrementPreviewCounters']=function(_0x5aad7e){var _0x154e3a=this;return new Promise(function(_0x3a2f16,_0x1f244a){return db[_0x1a53('0x16')][_0x1a53('0x35')](_0x5aad7e[_0x1a53('0x18')][_0x1a53('0x36')],{'where':{'id':_0x5aad7e[_0x1a53('0x18')]['id']}})[_0x1a53('0xb')](function(_0x35ca95){_0x3a2f16(_0x35ca95);})[_0x1a53('0x15')](function(_0x4e266f){logger[_0x1a53('0x10')](_0x1a53('0x37'),_0x4e266f[_0x1a53('0x13')]);_0x1f244a(_0x154e3a[_0x1a53('0x10')](0x1f4,_0x4e266f['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index c71aedf..31c81b4 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 _0xe0c0=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x36ee80,_0x494184){_0x36ee80=_0x36ee80-0x0;var _0x14306c=_0xe0c0[_0x36ee80];return _0x14306c;};'use strict';var multer=require(_0x0e0c('0x0'));var util=require('util');var path=require(_0x0e0c('0x1'));var timeout=require(_0x0e0c('0x2'));var express=require(_0x0e0c('0x3'));var router=express[_0x0e0c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e0c('0x5'));var interaction=require(_0x0e0c('0x6'));var config=require(_0x0e0c('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0e0c('0x8')]('/',auth[_0x0e0c('0x9')](),controller['index']);router[_0x0e0c('0x8')](_0x0e0c('0xa'),auth[_0x0e0c('0x9')](),controller[_0x0e0c('0xb')]);router[_0x0e0c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0e0c('0xa'),auth['isAuthenticated'](),controller[_0x0e0c('0xd')]);router[_0x0e0c('0xe')](_0x0e0c('0xa'),auth[_0x0e0c('0x9')](),controller[_0x0e0c('0xf')]);module[_0x0e0c('0x10')]=router; \ No newline at end of file +var _0x299e=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','./cmHopperAdditionalPhone.controller'];(function(_0x1eb82d,_0x1e23cb){var _0x2c9502=function(_0x4a3500){while(--_0x4a3500){_0x1eb82d['push'](_0x1eb82d['shift']());}};_0x2c9502(++_0x1e23cb);}(_0x299e,0x1e7));var _0xe299=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x299e[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xe299('0x0'));var path=require(_0xe299('0x1'));var timeout=require(_0xe299('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe299('0x3'));var auth=require(_0xe299('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe299('0x5'));router['get']('/',auth[_0xe299('0x6')](),controller[_0xe299('0x7')]);router['get'](_0xe299('0x8'),auth[_0xe299('0x6')](),controller[_0xe299('0x9')]);router[_0xe299('0xa')]('/',auth[_0xe299('0x6')](),controller[_0xe299('0xb')]);router[_0xe299('0xc')](_0xe299('0x8'),auth[_0xe299('0x6')](),controller[_0xe299('0xd')]);router[_0xe299('0xe')](_0xe299('0x8'),auth['isAuthenticated'](),controller[_0xe299('0xf')]);module[_0xe299('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 30abb8a..3ab445b 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 _0xfb15=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xfb15,0x12f));var _0x5fb1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xfb15[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x5fb1('0x0'));var Sequelize=require(_0x5fb1('0x1'));module[_0x5fb1('0x2')]={'phone':{'type':Sequelize[_0x5fb1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5fb1('0x4')],'unique':_0x5fb1('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5fb1('0x5')},'VoiceQueueId':{'type':Sequelize[_0x5fb1('0x4')],'unique':_0x5fb1('0x5')}}; \ No newline at end of file +var _0x67cb=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x2aa9e8,_0x148b35){var _0x55b468=function(_0x57d950){while(--_0x57d950){_0x2aa9e8['push'](_0x2aa9e8['shift']());}};_0x55b468(++_0x148b35);}(_0x67cb,0x19e));var _0xb67c=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x67cb[_0x5a2285];return _0x48f6ed;};'use strict';var moment=require(_0xb67c('0x0'));var Sequelize=require('sequelize');module[_0xb67c('0x1')]={'phone':{'type':Sequelize[_0xb67c('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb67c('0x3')],'unique':_0xb67c('0x4')},'ListId':{'type':Sequelize[_0xb67c('0x3')],'unique':_0xb67c('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'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 649ae6a..5f11104 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 _0x8270=['VIRTUAL','filter','options','CmHopperBlack','include','findAll','rows','catch','show','params','includeAll','find','body','describe','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','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','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type'];(function(_0x26139d,_0x12206b){var _0x1bd4a9=function(_0x9f4228){while(--_0x9f4228){_0x26139d['push'](_0x26139d['shift']());}};_0x1bd4a9(++_0x12206b);}(_0x8270,0xe3));var _0x0827=function(_0x1c16c8,_0x134fe3){_0x1c16c8=_0x1c16c8-0x0;var _0x2e9719=_0x8270[_0x1c16c8];return _0x2e9719;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0827('0x0'));var jsonpatch=require(_0x0827('0x1'));var rp=require(_0x0827('0x2'));var moment=require(_0x0827('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0827('0x4'));var sox=require(_0x0827('0x5'));var csv=require(_0x0827('0x6'));var ejs=require(_0x0827('0x7'));var fs=require('fs');var fs_extra=require(_0x0827('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0827('0x9'));var deskjs=require(_0x0827('0xa'));var toCsv=require(_0x0827('0x6'));var querystring=require(_0x0827('0xb'));var Papa=require(_0x0827('0xc'));var Redis=require(_0x0827('0xd'));var authService=require(_0x0827('0xe'));var qs=require(_0x0827('0xf'));var as=require(_0x0827('0x10'));var hardwareService=require(_0x0827('0x11'));var logger=require(_0x0827('0x12'))(_0x0827('0x13'));var utils=require(_0x0827('0x14'));var config=require(_0x0827('0x15'));var licenseUtil=require(_0x0827('0x16'));var db=require(_0x0827('0x17'))['db'];function respondWithStatusCode(_0x1f8f18,_0x55fdac){_0x55fdac=_0x55fdac||0xcc;return function(_0x454ecf){if(_0x454ecf){return _0x1f8f18['sendStatus'](_0x55fdac);}return _0x1f8f18[_0x0827('0x18')](_0x55fdac)[_0x0827('0x19')]();};}function respondWithResult(_0x410410,_0x31e8dd){_0x31e8dd=_0x31e8dd||0xc8;return function(_0x52ebd0){if(_0x52ebd0){return _0x410410[_0x0827('0x18')](_0x31e8dd)[_0x0827('0x1a')](_0x52ebd0);}};}function respondWithFilteredResult(_0x48f6c0,_0x4dae6b){return function(_0xc0c89d){if(_0xc0c89d){var _0x48a911=typeof _0x4dae6b[_0x0827('0x1b')]===_0x0827('0x1c')&&typeof _0x4dae6b[_0x0827('0x1d')]===_0x0827('0x1c');var _0x5ba0e9=_0xc0c89d[_0x0827('0x1e')];var _0x36b91d=_0x48a911?0x0:_0x4dae6b[_0x0827('0x1b')];var _0x44626f=_0x48a911?_0xc0c89d[_0x0827('0x1e')]:_0x4dae6b['offset']+_0x4dae6b[_0x0827('0x1d')];var _0x2ad0cb;if(_0x44626f>=_0x5ba0e9){_0x44626f=_0x5ba0e9;_0x2ad0cb=0xc8;}else{_0x2ad0cb=0xce;}_0x48f6c0[_0x0827('0x18')](_0x2ad0cb);return _0x48f6c0['set'](_0x0827('0x1f'),_0x36b91d+'-'+_0x44626f+'/'+_0x5ba0e9)[_0x0827('0x1a')](_0xc0c89d);}return null;};}function patchUpdates(_0x3cbfb6){return function(_0x1793a6){try{jsonpatch[_0x0827('0x20')](_0x1793a6,_0x3cbfb6,!![]);}catch(_0x244d65){return BPromise['reject'](_0x244d65);}return _0x1793a6[_0x0827('0x21')]();};}function saveUpdates(_0x59ad84,_0x2840cd){return function(_0x156103){if(_0x156103){return _0x156103[_0x0827('0x22')](_0x59ad84)[_0x0827('0x23')](function(_0x187476){return _0x187476;});}return null;};}function removeEntity(_0x3a0087,_0x4e11a3){return function(_0x4bde4b){if(_0x4bde4b){return _0x4bde4b['destroy']()[_0x0827('0x23')](function(){_0x3a0087[_0x0827('0x18')](0xcc)[_0x0827('0x19')]();});}};}function handleEntityNotFound(_0x309219,_0x30cf94){return function(_0x3073e0){if(!_0x3073e0){_0x309219[_0x0827('0x24')](0x194);}return _0x3073e0;};}function handleError(_0x14ba93,_0x42d557){_0x42d557=_0x42d557||0x1f4;return function(_0x54c617){logger[_0x0827('0x25')](_0x54c617[_0x0827('0x26')]);if(_0x54c617['name']){delete _0x54c617[_0x0827('0x27')];}_0x14ba93[_0x0827('0x18')](_0x42d557)['send'](_0x54c617);};}exports['index']=function(_0x48937b,_0x29f70a){var _0xc86a68={},_0x527835={},_0x437426={'count':0x0,'rows':[]};var _0x4d6e05=_[_0x0827('0x28')](db['CmHopperBlack'][_0x0827('0x29')],function(_0x5aa960){return{'name':_0x5aa960['fieldName'],'type':_0x5aa960['type']['key']};});_0x527835[_0x0827('0x2a')]=_['map'](_0x4d6e05,_0x0827('0x27'));_0x527835[_0x0827('0x2b')]=_[_0x0827('0x2c')](_0x48937b[_0x0827('0x2b')]);_0x527835[_0x0827('0x2d')]=_[_0x0827('0x2e')](_0x527835[_0x0827('0x2a')],_0x527835[_0x0827('0x2b')]);_0xc86a68[_0x0827('0x2f')]=_[_0x0827('0x2e')](_0x527835['model'],qs[_0x0827('0x30')](_0x48937b[_0x0827('0x2b')]['fields']));_0xc86a68[_0x0827('0x2f')]=_0xc86a68[_0x0827('0x2f')][_0x0827('0x31')]?_0xc86a68[_0x0827('0x2f')]:_0x527835['model'];if(!_0x48937b[_0x0827('0x2b')][_0x0827('0x32')]('nolimit')){_0xc86a68[_0x0827('0x1d')]=qs[_0x0827('0x1d')](_0x48937b[_0x0827('0x2b')][_0x0827('0x1d')]);_0xc86a68['offset']=qs[_0x0827('0x1b')](_0x48937b[_0x0827('0x2b')][_0x0827('0x1b')]);}_0xc86a68[_0x0827('0x33')]=qs[_0x0827('0x34')](_0x48937b[_0x0827('0x2b')]['sort']);_0xc86a68[_0x0827('0x35')]=qs[_0x0827('0x2d')](_[_0x0827('0x36')](_0x48937b[_0x0827('0x2b')],_0x527835[_0x0827('0x2d')]),_0x4d6e05);if(_0x48937b[_0x0827('0x2b')]['filter']){_0xc86a68['where']=_[_0x0827('0x37')](_0xc86a68['where'],{'$or':_['map'](_0x4d6e05,function(_0x30df35){if(_0x30df35[_0x0827('0x38')]!==_0x0827('0x39')){var _0x5ef676={};_0x5ef676[_0x30df35[_0x0827('0x27')]]={'$like':'%'+_0x48937b['query'][_0x0827('0x3a')]+'%'};return _0x5ef676;}})});}_0xc86a68=_['merge']({},_0xc86a68,_0x48937b[_0x0827('0x3b')]);var _0xf0f355={'where':_0xc86a68[_0x0827('0x35')]};return db[_0x0827('0x3c')][_0x0827('0x1e')](_0xf0f355)[_0x0827('0x23')](function(_0x2e18b0){_0x437426[_0x0827('0x1e')]=_0x2e18b0;if(_0x48937b[_0x0827('0x2b')]['includeAll']){_0xc86a68[_0x0827('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0827('0x3e')](_0xc86a68);})[_0x0827('0x23')](function(_0x2c8fe8){_0x437426[_0x0827('0x3f')]=_0x2c8fe8;return _0x437426;})[_0x0827('0x23')](respondWithFilteredResult(_0x29f70a,_0xc86a68))[_0x0827('0x40')](handleError(_0x29f70a,null));};exports[_0x0827('0x41')]=function(_0x1a934f,_0x106fb1){var _0x57e6c3={'raw':!![],'where':{'id':_0x1a934f[_0x0827('0x42')]['id']}},_0x2eeffa={};_0x2eeffa[_0x0827('0x2a')]=_[_0x0827('0x2c')](db[_0x0827('0x3c')][_0x0827('0x29')]);_0x2eeffa[_0x0827('0x2b')]=_['keys'](_0x1a934f[_0x0827('0x2b')]);_0x2eeffa[_0x0827('0x2d')]=_[_0x0827('0x2e')](_0x2eeffa['model'],_0x2eeffa[_0x0827('0x2b')]);_0x57e6c3['attributes']=_[_0x0827('0x2e')](_0x2eeffa[_0x0827('0x2a')],qs[_0x0827('0x30')](_0x1a934f[_0x0827('0x2b')][_0x0827('0x30')]));_0x57e6c3[_0x0827('0x2f')]=_0x57e6c3['attributes']['length']?_0x57e6c3['attributes']:_0x2eeffa['model'];if(_0x1a934f[_0x0827('0x2b')][_0x0827('0x43')]){_0x57e6c3[_0x0827('0x3d')]=[{'all':!![]}];}_0x57e6c3=_[_0x0827('0x37')]({},_0x57e6c3,_0x1a934f[_0x0827('0x3b')]);return db['CmHopperBlack'][_0x0827('0x44')](_0x57e6c3)[_0x0827('0x23')](handleEntityNotFound(_0x106fb1,null))[_0x0827('0x23')](respondWithResult(_0x106fb1,null))[_0x0827('0x40')](handleError(_0x106fb1,null));};exports['update']=function(_0x4eaf06,_0x3e845e){if(_0x4eaf06[_0x0827('0x45')]['id']){delete _0x4eaf06[_0x0827('0x45')]['id'];}return db['CmHopperBlack'][_0x0827('0x44')]({'where':{'id':_0x4eaf06[_0x0827('0x42')]['id']}})[_0x0827('0x23')](handleEntityNotFound(_0x3e845e,null))[_0x0827('0x23')](saveUpdates(_0x4eaf06[_0x0827('0x45')],null))[_0x0827('0x23')](respondWithResult(_0x3e845e,null))['catch'](handleError(_0x3e845e,null));};exports['destroy']=function(_0x2d37bb,_0x419cb6){return db[_0x0827('0x3c')]['find']({'where':{'id':_0x2d37bb['params']['id']}})[_0x0827('0x23')](handleEntityNotFound(_0x419cb6,null))[_0x0827('0x23')](removeEntity(_0x419cb6,null))[_0x0827('0x40')](handleError(_0x419cb6,null));};exports[_0x0827('0x46')]=function(_0x331afe,_0x20f6e0){return db[_0x0827('0x3c')][_0x0827('0x46')]()['then'](respondWithResult(_0x20f6e0,null))[_0x0827('0x40')](handleError(_0x20f6e0,null));}; \ No newline at end of file +var _0xaefc=['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','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','error','stack','name','index','CmHopperBlack','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x5ea351,_0x38393e){var _0x2d19b8=function(_0x324b66){while(--_0x324b66){_0x5ea351['push'](_0x5ea351['shift']());}};_0x2d19b8(++_0x38393e);}(_0xaefc,0x11a));var _0xcaef=function(_0x169683,_0x40d687){_0x169683=_0x169683-0x0;var _0x3fc533=_0xaefc[_0x169683];return _0x3fc533;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaef('0x1'));var rp=require(_0xcaef('0x2'));var moment=require(_0xcaef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcaef('0x4'));var util=require(_0xcaef('0x5'));var path=require(_0xcaef('0x6'));var sox=require(_0xcaef('0x7'));var csv=require(_0xcaef('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcaef('0x9'));var _=require(_0xcaef('0xa'));var squel=require(_0xcaef('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcaef('0xc'));var toCsv=require(_0xcaef('0x8'));var querystring=require('querystring');var Papa=require(_0xcaef('0xd'));var Redis=require(_0xcaef('0xe'));var authService=require(_0xcaef('0xf'));var qs=require(_0xcaef('0x10'));var as=require(_0xcaef('0x11'));var hardwareService=require(_0xcaef('0x12'));var logger=require(_0xcaef('0x13'))(_0xcaef('0x14'));var utils=require(_0xcaef('0x15'));var config=require(_0xcaef('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4928cb,_0x4c8f70){_0x4c8f70=_0x4c8f70||0xcc;return function(_0xfba032){if(_0xfba032){return _0x4928cb[_0xcaef('0x17')](_0x4c8f70);}return _0x4928cb['status'](_0x4c8f70)[_0xcaef('0x18')]();};}function respondWithResult(_0x5ec47d,_0x42d74e){_0x42d74e=_0x42d74e||0xc8;return function(_0x54b035){if(_0x54b035){return _0x5ec47d[_0xcaef('0x19')](_0x42d74e)[_0xcaef('0x1a')](_0x54b035);}};}function respondWithFilteredResult(_0x14de07,_0x8a09fc){return function(_0x20f859){if(_0x20f859){var _0xc382c7=typeof _0x8a09fc[_0xcaef('0x1b')]===_0xcaef('0x1c')&&typeof _0x8a09fc[_0xcaef('0x1d')]===_0xcaef('0x1c');var _0x2c9be7=_0x20f859['count'];var _0x2c0616=_0xc382c7?0x0:_0x8a09fc[_0xcaef('0x1b')];var _0x49cd07=_0xc382c7?_0x20f859[_0xcaef('0x1e')]:_0x8a09fc['offset']+_0x8a09fc[_0xcaef('0x1d')];var _0x40f749;if(_0x49cd07>=_0x2c9be7){_0x49cd07=_0x2c9be7;_0x40f749=0xc8;}else{_0x40f749=0xce;}_0x14de07[_0xcaef('0x19')](_0x40f749);return _0x14de07[_0xcaef('0x1f')]('Content-Range',_0x2c0616+'-'+_0x49cd07+'/'+_0x2c9be7)[_0xcaef('0x1a')](_0x20f859);}return null;};}function patchUpdates(_0x19f801){return function(_0x45c528){try{jsonpatch['apply'](_0x45c528,_0x19f801,!![]);}catch(_0x256588){return BPromise[_0xcaef('0x20')](_0x256588);}return _0x45c528[_0xcaef('0x21')]();};}function saveUpdates(_0x3e51af,_0x10e9d0){return function(_0x184c47){if(_0x184c47){return _0x184c47[_0xcaef('0x22')](_0x3e51af)[_0xcaef('0x23')](function(_0x34a9ff){return _0x34a9ff;});}return null;};}function removeEntity(_0xb35aba,_0x975fed){return function(_0x58dec6){if(_0x58dec6){return _0x58dec6['destroy']()[_0xcaef('0x23')](function(){_0xb35aba['status'](0xcc)[_0xcaef('0x18')]();});}};}function handleEntityNotFound(_0xcb270b,_0x340021){return function(_0x165b43){if(!_0x165b43){_0xcb270b['sendStatus'](0x194);}return _0x165b43;};}function handleError(_0x745bac,_0x505157){_0x505157=_0x505157||0x1f4;return function(_0x454a2b){logger[_0xcaef('0x24')](_0x454a2b[_0xcaef('0x25')]);if(_0x454a2b['name']){delete _0x454a2b[_0xcaef('0x26')];}_0x745bac[_0xcaef('0x19')](_0x505157)['send'](_0x454a2b);};}exports[_0xcaef('0x27')]=function(_0x2a9d02,_0x5d5042){var _0x25d03d={},_0x2c79df={},_0x522723={'count':0x0,'rows':[]};var _0x25e3f9=_['map'](db[_0xcaef('0x28')][_0xcaef('0x29')],function(_0x3af140){return{'name':_0x3af140[_0xcaef('0x2a')],'type':_0x3af140[_0xcaef('0x2b')]['key']};});_0x2c79df['model']=_[_0xcaef('0x2c')](_0x25e3f9,'name');_0x2c79df[_0xcaef('0x2d')]=_[_0xcaef('0x2e')](_0x2a9d02[_0xcaef('0x2d')]);_0x2c79df[_0xcaef('0x2f')]=_['intersection'](_0x2c79df[_0xcaef('0x30')],_0x2c79df[_0xcaef('0x2d')]);_0x25d03d[_0xcaef('0x31')]=_[_0xcaef('0x32')](_0x2c79df['model'],qs[_0xcaef('0x33')](_0x2a9d02[_0xcaef('0x2d')][_0xcaef('0x33')]));_0x25d03d[_0xcaef('0x31')]=_0x25d03d[_0xcaef('0x31')][_0xcaef('0x34')]?_0x25d03d[_0xcaef('0x31')]:_0x2c79df[_0xcaef('0x30')];if(!_0x2a9d02[_0xcaef('0x2d')][_0xcaef('0x35')](_0xcaef('0x36'))){_0x25d03d[_0xcaef('0x1d')]=qs[_0xcaef('0x1d')](_0x2a9d02[_0xcaef('0x2d')]['limit']);_0x25d03d[_0xcaef('0x1b')]=qs[_0xcaef('0x1b')](_0x2a9d02[_0xcaef('0x2d')][_0xcaef('0x1b')]);}_0x25d03d[_0xcaef('0x37')]=qs[_0xcaef('0x38')](_0x2a9d02[_0xcaef('0x2d')]['sort']);_0x25d03d[_0xcaef('0x39')]=qs['filters'](_[_0xcaef('0x3a')](_0x2a9d02[_0xcaef('0x2d')],_0x2c79df[_0xcaef('0x2f')]),_0x25e3f9);if(_0x2a9d02[_0xcaef('0x2d')][_0xcaef('0x3b')]){_0x25d03d[_0xcaef('0x39')]=_[_0xcaef('0x3c')](_0x25d03d[_0xcaef('0x39')],{'$or':_['map'](_0x25e3f9,function(_0x23a6c8){if(_0x23a6c8[_0xcaef('0x2b')]!=='VIRTUAL'){var _0x324eb4={};_0x324eb4[_0x23a6c8[_0xcaef('0x26')]]={'$like':'%'+_0x2a9d02['query'][_0xcaef('0x3b')]+'%'};return _0x324eb4;}})});}_0x25d03d=_['merge']({},_0x25d03d,_0x2a9d02[_0xcaef('0x3d')]);var _0x5a721b={'where':_0x25d03d[_0xcaef('0x39')]};return db[_0xcaef('0x28')][_0xcaef('0x1e')](_0x5a721b)[_0xcaef('0x23')](function(_0x5c04d3){_0x522723[_0xcaef('0x1e')]=_0x5c04d3;if(_0x2a9d02[_0xcaef('0x2d')][_0xcaef('0x3e')]){_0x25d03d[_0xcaef('0x3f')]=[{'all':!![]}];}return db[_0xcaef('0x28')][_0xcaef('0x40')](_0x25d03d);})[_0xcaef('0x23')](function(_0x11ee58){_0x522723[_0xcaef('0x41')]=_0x11ee58;return _0x522723;})[_0xcaef('0x23')](respondWithFilteredResult(_0x5d5042,_0x25d03d))[_0xcaef('0x42')](handleError(_0x5d5042,null));};exports[_0xcaef('0x43')]=function(_0x2fe2ab,_0x47d8fc){var _0x397211={'raw':!![],'where':{'id':_0x2fe2ab[_0xcaef('0x44')]['id']}},_0x3c6f35={};_0x3c6f35[_0xcaef('0x30')]=_[_0xcaef('0x2e')](db['CmHopperBlack'][_0xcaef('0x29')]);_0x3c6f35[_0xcaef('0x2d')]=_[_0xcaef('0x2e')](_0x2fe2ab['query']);_0x3c6f35[_0xcaef('0x2f')]=_[_0xcaef('0x32')](_0x3c6f35[_0xcaef('0x30')],_0x3c6f35[_0xcaef('0x2d')]);_0x397211[_0xcaef('0x31')]=_[_0xcaef('0x32')](_0x3c6f35[_0xcaef('0x30')],qs[_0xcaef('0x33')](_0x2fe2ab[_0xcaef('0x2d')]['fields']));_0x397211[_0xcaef('0x31')]=_0x397211[_0xcaef('0x31')]['length']?_0x397211[_0xcaef('0x31')]:_0x3c6f35[_0xcaef('0x30')];if(_0x2fe2ab[_0xcaef('0x2d')][_0xcaef('0x3e')]){_0x397211[_0xcaef('0x3f')]=[{'all':!![]}];}_0x397211=_[_0xcaef('0x3c')]({},_0x397211,_0x2fe2ab[_0xcaef('0x3d')]);return db[_0xcaef('0x28')][_0xcaef('0x45')](_0x397211)[_0xcaef('0x23')](handleEntityNotFound(_0x47d8fc,null))[_0xcaef('0x23')](respondWithResult(_0x47d8fc,null))[_0xcaef('0x42')](handleError(_0x47d8fc,null));};exports[_0xcaef('0x22')]=function(_0x290586,_0x3e9219){if(_0x290586[_0xcaef('0x46')]['id']){delete _0x290586['body']['id'];}return db[_0xcaef('0x28')][_0xcaef('0x45')]({'where':{'id':_0x290586['params']['id']}})['then'](handleEntityNotFound(_0x3e9219,null))['then'](saveUpdates(_0x290586['body'],null))[_0xcaef('0x23')](respondWithResult(_0x3e9219,null))[_0xcaef('0x42')](handleError(_0x3e9219,null));};exports[_0xcaef('0x47')]=function(_0xe3303d,_0x52c7ce){return db[_0xcaef('0x28')][_0xcaef('0x45')]({'where':{'id':_0xe3303d[_0xcaef('0x44')]['id']}})['then'](handleEntityNotFound(_0x52c7ce,null))[_0xcaef('0x23')](removeEntity(_0x52c7ce,null))[_0xcaef('0x42')](handleError(_0x52c7ce,null));};exports[_0xcaef('0x48')]=function(_0x2ef8a7,_0x2f918e){return db[_0xcaef('0x28')][_0xcaef('0x48')]()[_0xcaef('0x23')](respondWithResult(_0x2f918e,null))['catch'](handleError(_0x2f918e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index f12fe92..f97df6c 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 _0x68e3=['./cmHopperBlack.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4bd563,_0x30f1b7){var _0x26a5bf=function(_0x5a3227){while(--_0x5a3227){_0x4bd563['push'](_0x4bd563['shift']());}};_0x26a5bf(++_0x30f1b7);}(_0x68e3,0x70));var _0x368e=function(_0x409d96,_0x183edb){_0x409d96=_0x409d96-0x0;var _0x12df8b=_0x68e3[_0x409d96];return _0x12df8b;};'use strict';var _=require(_0x368e('0x0'));var util=require(_0x368e('0x1'));var logger=require(_0x368e('0x2'))(_0x368e('0x3'));var moment=require(_0x368e('0x4'));var BPromise=require(_0x368e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x368e('0x6'));var rimraf=require('rimraf');var config=require(_0x368e('0x7'));var attributes=require(_0x368e('0x8'));module['exports']=function(_0xefb518,_0x52d173){return _0xefb518[_0x368e('0x9')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa67e=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','cm_hopper_black','util','../../config/logger','moment','bluebird'];(function(_0x511b07,_0x5b4a5c){var _0x1e691f=function(_0x80e8ea){while(--_0x80e8ea){_0x511b07['push'](_0x511b07['shift']());}};_0x1e691f(++_0x5b4a5c);}(_0xa67e,0x104));var _0xea67=function(_0x5da4f5,_0x3444aa){_0x5da4f5=_0x5da4f5-0x0;var _0x8973db=_0xa67e[_0x5da4f5];return _0x8973db;};'use strict';var _=require('lodash');var util=require(_0xea67('0x0'));var logger=require(_0xea67('0x1'))('api');var moment=require(_0xea67('0x2'));var BPromise=require(_0xea67('0x3'));var rp=require(_0xea67('0x4'));var fs=require('fs');var path=require(_0xea67('0x5'));var rimraf=require(_0xea67('0x6'));var config=require(_0xea67('0x7'));var attributes=require(_0xea67('0x8'));module['exports']=function(_0x1592ab,_0x2ad948){return _0x1592ab[_0xea67('0x9')]('CmHopperBlack',attributes,{'tableName':_0xea67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 7f5839c..0402561 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 _0xbcba=['CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','map','attributes','model','stringify','update','body','where','UpdateCmHopperBlack','debug','DestroyCmHopperBlack','destroy','util','moment','ioredis','../../config/logger','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xbcba,0x15d));var _0xabcb=function(_0x5980a0,_0x285a3d){_0x5980a0=_0x5980a0-0x0;var _0x2b4a56=_0xbcba[_0x5980a0];return _0x2b4a56;};'use strict';var _=require('lodash');var util=require(_0xabcb('0x0'));var moment=require(_0xabcb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabcb('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xabcb('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xabcb('0x4'));var client=jayson[_0xabcb('0x5')][_0xabcb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x41a203,_0xf24c6a,_0x11b24c){return new BPromise(function(_0x36a582,_0xe419f2){return client[_0xabcb('0x7')](_0x41a203,_0x11b24c)[_0xabcb('0x8')](function(_0x4c01df){logger['info'](_0xabcb('0x9'),_0xf24c6a,_0xabcb('0xa'));logger['debug'](_0xabcb('0xb'),_0xf24c6a,_0xabcb('0xa'),JSON['stringify'](_0x4c01df));if(_0x4c01df[_0xabcb('0xc')]){if(_0x4c01df[_0xabcb('0xc')][_0xabcb('0xd')]===0x1f4){logger[_0xabcb('0xc')](_0xabcb('0x9'),_0xf24c6a,_0x4c01df['error']['message']);return _0xe419f2(_0x4c01df[_0xabcb('0xc')][_0xabcb('0xe')]);}logger['error'](_0xabcb('0x9'),_0xf24c6a,_0x4c01df[_0xabcb('0xc')][_0xabcb('0xe')]);return _0x36a582(_0x4c01df['error']['message']);}else{logger[_0xabcb('0xf')](_0xabcb('0x9'),_0xf24c6a,_0xabcb('0xa'));_0x36a582(_0x4c01df[_0xabcb('0x10')][_0xabcb('0xe')]);}})[_0xabcb('0x11')](function(_0x823761){logger[_0xabcb('0xc')](_0xabcb('0x9'),_0xf24c6a,_0x823761);_0xe419f2(_0x823761);});});}exports[_0xabcb('0x12')]=function(_0x2ab4af){var _0x2d5acf=this;return new Promise(function(_0x39195d,_0xd20825){return db[_0xabcb('0x13')][_0xabcb('0x14')]({'raw':_0x2ab4af[_0xabcb('0x15')]?_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x16')]===undefined?!![]:![]:!![],'where':_0x2ab4af[_0xabcb('0x15')]?_0x2ab4af[_0xabcb('0x15')]['where']||null:null,'attributes':_0x2ab4af['options']?_0x2ab4af[_0xabcb('0x15')]['attributes']||null:null,'limit':_0x2ab4af['options']?_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x17')]||null:null,'include':_0x2ab4af[_0xabcb('0x15')]?_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x18')]?_[_0xabcb('0x19')](_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x18')],function(_0x562b85){return{'model':db[_0x562b85['model']],'as':_0x562b85['as'],'attributes':_0x562b85['attributes'],'include':_0x562b85[_0xabcb('0x18')]?_['map'](_0x562b85['include'],function(_0xaf217d){return{'model':db[_0xaf217d['model']],'as':_0xaf217d['as'],'attributes':_0xaf217d[_0xabcb('0x1a')],'include':_0xaf217d[_0xabcb('0x18')]?_[_0xabcb('0x19')](_0xaf217d[_0xabcb('0x18')],function(_0x54f83e){return{'model':db[_0x54f83e[_0xabcb('0x1b')]],'as':_0x54f83e['as'],'attributes':_0x54f83e[_0xabcb('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd7965f){logger[_0xabcb('0xf')](_0xabcb('0x12'),_0x2ab4af);logger['debug'](_0xabcb('0x12'),_0x2ab4af,JSON[_0xabcb('0x1c')](_0xd7965f));_0x39195d(_0xd7965f);})[_0xabcb('0x11')](function(_0x2de1c8){logger[_0xabcb('0xc')](_0xabcb('0x12'),_0x2de1c8['message'],_0x2ab4af);_0xd20825(_0x2d5acf['error'](0x1f4,_0x2de1c8[_0xabcb('0xe')]));});});};exports['UpdateCmHopperBlack']=function(_0x46ea76){var _0x407f12=this;return new Promise(function(_0x6bd534,_0x2cfa2b){return db[_0xabcb('0x13')][_0xabcb('0x1d')](_0x46ea76[_0xabcb('0x1e')],{'raw':_0x46ea76[_0xabcb('0x15')]?_0x46ea76['options'][_0xabcb('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46ea76[_0xabcb('0x15')]?_0x46ea76[_0xabcb('0x15')][_0xabcb('0x1f')]||null:null,'attributes':_0x46ea76['options']?_0x46ea76[_0xabcb('0x15')][_0xabcb('0x1a')]||null:null,'limit':_0x46ea76[_0xabcb('0x15')]?_0x46ea76[_0xabcb('0x15')][_0xabcb('0x17')]||null:null})[_0xabcb('0x8')](function(_0x383cf7){logger[_0xabcb('0xf')](_0xabcb('0x20'),_0x46ea76);logger[_0xabcb('0x21')](_0xabcb('0x20'),_0x46ea76,JSON[_0xabcb('0x1c')](_0x383cf7));_0x6bd534(_0x383cf7);})[_0xabcb('0x11')](function(_0x40db64){logger['error'](_0xabcb('0x20'),_0x40db64[_0xabcb('0xe')],_0x46ea76);_0x2cfa2b(_0x407f12[_0xabcb('0xc')](0x1f4,_0x40db64[_0xabcb('0xe')]));});});};exports[_0xabcb('0x22')]=function(_0x2c4848){var _0x34b99a=this;return new Promise(function(_0x5b327b,_0x24f85f){return db['CmHopperBlack'][_0xabcb('0x23')]({'where':_0x2c4848['options']?_0x2c4848[_0xabcb('0x15')][_0xabcb('0x1f')]||null:null})[_0xabcb('0x8')](function(_0x41f34c){logger[_0xabcb('0xf')]('DestroyCmHopperBlack',_0x2c4848);logger[_0xabcb('0x21')](_0xabcb('0x22'),_0x2c4848,JSON[_0xabcb('0x1c')](_0x41f34c));_0x5b327b(_0x41f34c);})[_0xabcb('0x11')](function(_0x1608b3){logger[_0xabcb('0xc')](_0xabcb('0x22'),_0x1608b3['message'],_0x2c4848);_0x24f85f(_0x34b99a['error'](0x1f4,_0x1608b3['message']));});});}; \ No newline at end of file +var _0xa747=['CmHopperBlack,\x20%s,\x20%s','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','body','limit','then','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x529ff7,_0x1a3d1d){var _0x173526=function(_0x3a058d){while(--_0x3a058d){_0x529ff7['push'](_0x529ff7['shift']());}};_0x173526(++_0x1a3d1d);}(_0xa747,0x10f));var _0x7a74=function(_0x1a451c,_0x33b9ad){_0x1a451c=_0x1a451c-0x0;var _0x3dc0d8=_0xa747[_0x1a451c];return _0x3dc0d8;};'use strict';var _=require(_0x7a74('0x0'));var util=require('util');var moment=require(_0x7a74('0x1'));var BPromise=require(_0x7a74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a74('0x3'));var db=require(_0x7a74('0x4'))['db'];var utils=require(_0x7a74('0x5'));var logger=require(_0x7a74('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a74('0x7')][_0x7a74('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c2d25,_0x2ca958,_0x14cb31){return new BPromise(function(_0x3cac77,_0x4b0158){return client[_0x7a74('0x9')](_0x1c2d25,_0x14cb31)['then'](function(_0x37e537){logger[_0x7a74('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x2ca958,_0x7a74('0xb'));logger[_0x7a74('0xc')](_0x7a74('0xd'),_0x2ca958,_0x7a74('0xb'),JSON[_0x7a74('0xe')](_0x37e537));if(_0x37e537[_0x7a74('0xf')]){if(_0x37e537['error']['code']===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x2ca958,_0x37e537[_0x7a74('0xf')][_0x7a74('0x10')]);return _0x4b0158(_0x37e537['error'][_0x7a74('0x10')]);}logger['error'](_0x7a74('0x11'),_0x2ca958,_0x37e537[_0x7a74('0xf')][_0x7a74('0x10')]);return _0x3cac77(_0x37e537[_0x7a74('0xf')][_0x7a74('0x10')]);}else{logger[_0x7a74('0xa')](_0x7a74('0x11'),_0x2ca958,'request\x20sent');_0x3cac77(_0x37e537[_0x7a74('0x12')][_0x7a74('0x10')]);}})[_0x7a74('0x13')](function(_0x2c1926){logger[_0x7a74('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x2ca958,_0x2c1926);_0x4b0158(_0x2c1926);});});}exports[_0x7a74('0x14')]=function(_0x4e0e78){var _0x4fca2a=this;return new Promise(function(_0x21a851,_0x34fc66){return db[_0x7a74('0x15')][_0x7a74('0x16')]({'raw':_0x4e0e78[_0x7a74('0x17')]?_0x4e0e78[_0x7a74('0x17')][_0x7a74('0x18')]===undefined?!![]:![]:!![],'where':_0x4e0e78[_0x7a74('0x17')]?_0x4e0e78[_0x7a74('0x17')][_0x7a74('0x19')]||null:null,'attributes':_0x4e0e78[_0x7a74('0x17')]?_0x4e0e78['options'][_0x7a74('0x1a')]||null:null,'limit':_0x4e0e78[_0x7a74('0x17')]?_0x4e0e78[_0x7a74('0x17')]['limit']||null:null,'include':_0x4e0e78[_0x7a74('0x17')]?_0x4e0e78['options'][_0x7a74('0x1b')]?_[_0x7a74('0x1c')](_0x4e0e78[_0x7a74('0x17')][_0x7a74('0x1b')],function(_0x32346b){return{'model':db[_0x32346b[_0x7a74('0x1d')]],'as':_0x32346b['as'],'attributes':_0x32346b[_0x7a74('0x1a')],'include':_0x32346b[_0x7a74('0x1b')]?_['map'](_0x32346b['include'],function(_0x54e4bd){return{'model':db[_0x54e4bd[_0x7a74('0x1d')]],'as':_0x54e4bd['as'],'attributes':_0x54e4bd[_0x7a74('0x1a')],'include':_0x54e4bd[_0x7a74('0x1b')]?_[_0x7a74('0x1c')](_0x54e4bd[_0x7a74('0x1b')],function(_0x26560b){return{'model':db[_0x26560b[_0x7a74('0x1d')]],'as':_0x26560b['as'],'attributes':_0x26560b[_0x7a74('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e15c9){logger['info'](_0x7a74('0x14'),_0x4e0e78);logger['debug'](_0x7a74('0x14'),_0x4e0e78,JSON[_0x7a74('0xe')](_0x4e15c9));_0x21a851(_0x4e15c9);})[_0x7a74('0x13')](function(_0x45ea35){logger[_0x7a74('0xf')]('GetCmHopperBlack',_0x45ea35['message'],_0x4e0e78);_0x34fc66(_0x4fca2a[_0x7a74('0xf')](0x1f4,_0x45ea35[_0x7a74('0x10')]));});});};exports['UpdateCmHopperBlack']=function(_0x1389f3){var _0x66671=this;return new Promise(function(_0xde7eea,_0x4f9289){return db['CmHopperBlack']['update'](_0x1389f3[_0x7a74('0x1e')],{'raw':_0x1389f3[_0x7a74('0x17')]?_0x1389f3['options'][_0x7a74('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1389f3[_0x7a74('0x17')]?_0x1389f3[_0x7a74('0x17')]['where']||null:null,'attributes':_0x1389f3['options']?_0x1389f3[_0x7a74('0x17')][_0x7a74('0x1a')]||null:null,'limit':_0x1389f3['options']?_0x1389f3[_0x7a74('0x17')][_0x7a74('0x1f')]||null:null})[_0x7a74('0x20')](function(_0x116512){logger[_0x7a74('0xa')](_0x7a74('0x21'),_0x1389f3);logger[_0x7a74('0xc')]('UpdateCmHopperBlack',_0x1389f3,JSON['stringify'](_0x116512));_0xde7eea(_0x116512);})[_0x7a74('0x13')](function(_0x556658){logger['error']('UpdateCmHopperBlack',_0x556658[_0x7a74('0x10')],_0x1389f3);_0x4f9289(_0x66671[_0x7a74('0xf')](0x1f4,_0x556658[_0x7a74('0x10')]));});});};exports[_0x7a74('0x22')]=function(_0x2fe8c6){var _0x5ede6e=this;return new Promise(function(_0x5210ac,_0xac18d3){return db['CmHopperBlack'][_0x7a74('0x23')]({'where':_0x2fe8c6['options']?_0x2fe8c6[_0x7a74('0x17')][_0x7a74('0x19')]||null:null})[_0x7a74('0x20')](function(_0x1c9ad6){logger['info']('DestroyCmHopperBlack',_0x2fe8c6);logger['debug'](_0x7a74('0x22'),_0x2fe8c6,JSON[_0x7a74('0xe')](_0x1c9ad6));_0x5210ac(_0x1c9ad6);})[_0x7a74('0x13')](function(_0x16f987){logger[_0x7a74('0xf')](_0x7a74('0x22'),_0x16f987['message'],_0x2fe8c6);_0xac18d3(_0x5ede6e['error'](0x1f4,_0x16f987[_0x7a74('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 9dc9b42..9a0e3f5 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 _0x1623=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x496125,_0x1a7e95){var _0x14f595=function(_0x41506d){while(--_0x41506d){_0x496125['push'](_0x496125['shift']());}};_0x14f595(++_0x1a7e95);}(_0x1623,0xab));var _0x3162=function(_0x2d4557,_0x116764){_0x2d4557=_0x2d4557-0x0;var _0x3882d1=_0x1623[_0x2d4557];return _0x3882d1;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3162('0xf')]);router[_0x3162('0x10')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x11')]);module[_0x3162('0x12')]=router; \ No newline at end of file +var _0x82c4=['get','/describe','describe','show','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated'];(function(_0x572aa0,_0x4b9e53){var _0x217068=function(_0x16de5e){while(--_0x16de5e){_0x572aa0['push'](_0x572aa0['shift']());}};_0x217068(++_0x4b9e53);}(_0x82c4,0x1ca));var _0x482c=function(_0x17598a,_0x522cc6){_0x17598a=_0x17598a-0x0;var _0x4cd046=_0x82c4[_0x17598a];return _0x4cd046;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xe')](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x10')]);router['delete'](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d35c2a0..e30712d 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 _0xa852=['sequelize','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','seconds','BOOLEAN'];(function(_0x46c4c6,_0x24bf13){var _0x4528c2=function(_0x283dfd){while(--_0x283dfd){_0x46c4c6['push'](_0x46c4c6['shift']());}};_0x4528c2(++_0x24bf13);}(_0xa852,0x14a));var _0x2a85=function(_0x3a63ab,_0x40602f){_0x3a63ab=_0x3a63ab-0x0;var _0x3314e4=_0xa852[_0x3a63ab];return _0x3314e4;};'use strict';var Sequelize=require(_0x2a85('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x2a85('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2a85('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2a85('0x2')]},'calleridnum':{'type':Sequelize[_0x2a85('0x2')]},'calleridname':{'type':Sequelize[_0x2a85('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2a85('0x3')]},'answertime':{'type':Sequelize[_0x2a85('0x3')]},'droptime':{'type':Sequelize[_0x2a85('0x3')]},'endtime':{'type':Sequelize[_0x2a85('0x3')]},'ringtime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2a85('0x2')]},'membername':{'type':Sequelize[_0x2a85('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x2a85('0x2')]},'secondDisposition':{'type':Sequelize[_0x2a85('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2a85('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x1e8a44){var _0x30ec51=this[_0x2a85('0x4')](_0x2a85('0x5'));if(_0x30ec51&&_0x1e8a44){this[_0x2a85('0x6')](_0x2a85('0x7'),moment(_0x1e8a44)['diff'](moment(_0x30ec51),_0x2a85('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2a85('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2a85('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x2a85('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2a85('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff30=['diff','seconds','BOOLEAN','moment','STRING','DATE','INTEGER','endtime','setDataValue','followuptime'];(function(_0x2d1f3d,_0x25a1dd){var _0x51b0e9=function(_0x2e167b){while(--_0x2e167b){_0x2d1f3d['push'](_0x2d1f3d['shift']());}};_0x51b0e9(++_0x25a1dd);}(_0xff30,0xd5));var _0x0ff3=function(_0x2851f1,_0x12288f){_0x2851f1=_0x2851f1-0x0;var _0x13f884=_0xff30[_0x2851f1];return _0x13f884;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0ff3('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0ff3('0x1')]},'scheduledat':{'type':Sequelize[_0x0ff3('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0ff3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0ff3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0ff3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0ff3('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x0ff3('0x1')]},'originatecalleridname':{'type':Sequelize[_0x0ff3('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0ff3('0x1')]},'starttime':{'type':Sequelize[_0x0ff3('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0ff3('0x2')]},'droptime':{'type':Sequelize[_0x0ff3('0x2')]},'endtime':{'type':Sequelize[_0x0ff3('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0ff3('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0ff3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0ff3('0x1')]},'campaign':{'type':Sequelize[_0x0ff3('0x1')]},'campaigntype':{'type':Sequelize[_0x0ff3('0x1')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x0ff3('0x1')]},'disposition':{'type':Sequelize[_0x0ff3('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0ff3('0x1')]},'dispositionat':{'type':Sequelize[_0x0ff3('0x2')],'set':function(_0x343003){var _0x14f0be=this['getDataValue'](_0x0ff3('0x4'));if(_0x14f0be&&_0x343003){this[_0x0ff3('0x5')](_0x0ff3('0x6'),moment(_0x343003)[_0x0ff3('0x7')](moment(_0x14f0be),_0x0ff3('0x8')));}}},'amd':{'type':Sequelize[_0x0ff3('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0ff3('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0ff3('0x2')]},'callback':{'type':Sequelize[_0x0ff3('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x0ff3('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0ff3('0x2')]},'recallme':{'type':Sequelize[_0x0ff3('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0ff3('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0x0ff3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0ff3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0ff3('0x3')],'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 364d372..ce3bb24 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 _0x01d9=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','updatedAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2bcaf7,_0x23431c){var _0x3630e9=function(_0x36e7e1){while(--_0x36e7e1){_0x2bcaf7['push'](_0x2bcaf7['shift']());}};_0x3630e9(++_0x23431c);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':!![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['CmHopperFinal'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')]()[_0x901d('0x28')](respondWithResult(_0x27459b,null))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x2cd965,_0x23f2a9){if(_0x2cd965['body']['uniqueid']){delete _0x2cd965[_0x901d('0x4c')][_0x901d('0x4d')];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'uniqueid':_0x2cd965[_0x901d('0x48')]['id']}})['then'](handleEntityNotFound(_0x23f2a9,null))['then'](saveUpdates(_0x2cd965[_0x901d('0x4c')],null))[_0x901d('0x28')](respondWithResult(_0x23f2a9,null))['catch'](handleError(_0x23f2a9,null));};exports[_0x901d('0x4e')]=function(_0x165207,_0x4d2b2d,_0x4512e5){return db['CmHopperFinal'][_0x901d('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x165207[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),'noAnswerContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x56')))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db['sequelize']['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),'dropContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x4d2b2d,null))['then'](respondWithResult(_0x4d2b2d,null))[_0x901d('0x46')](handleError(_0x4d2b2d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xabab57,_0x219c23,_0xecc8f9){return db[_0x901d('0x2f')][_0x901d('0x4f')]({'raw':![],'where':{'CampaignId':_0xabab57[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),_0x901d('0x5f')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),_0x901d('0x60')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')]['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x219c23,null))[_0x901d('0x28')](respondWithResult(_0x219c23,null))[_0x901d('0x46')](handleError(_0x219c23,null));};exports[_0x901d('0x61')]=function(_0x5cff96,_0x130dfb,_0x302049){return db[_0x901d('0x62')]['find']({'where':{'id':_0x5cff96[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x130dfb,null))[_0x901d('0x28')](function(_0x4b5e3b){var _0x576d50;if(_0x4b5e3b){_0x576d50=squel['insert']()[_0x901d('0x63')](_0x901d('0x64'))['fromQuery'](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x68'),_0x901d('0x69'),'updatedAt'],squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))['field'](_0x901d('0x6e'),'scheduledAt')[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))[_0x901d('0x6b')](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x70'),_0x901d('0x68'))['field'](_0x901d('0x6e'),_0x901d('0x69'))['field'](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')['where'](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id']['toString']())[_0x901d('0x3e')](_0x901d('0x72'),_0x5cff96[_0x901d('0x4c')][_0x901d('0x73')][_0x901d('0x74')]())['where'](_0x901d('0x75'))[_0x901d('0x3e')](_0x901d('0x76'),squel['select']()[_0x901d('0x6b')](_0x901d('0x6d'))[_0x901d('0x77')](_0x901d('0x64'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')](_0x901d('0x7a')))[_0x901d('0x7b')]('ContactId'))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x576d50);}return[];})['then'](respondWithResult(_0x130dfb,null))[_0x901d('0x46')](handleError(_0x130dfb,null));};exports[_0x901d('0x7c')]=function(_0xa14cbd,_0x34f33f,_0x785f77){return db[_0x901d('0x7d')][_0x901d('0x4a')]({'where':{'id':_0xa14cbd[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x34f33f,null))[_0x901d('0x28')](function(_0x28b640){var _0x45601a;if(_0x28b640){_0x45601a=squel[_0x901d('0x7e')]()[_0x901d('0x63')](_0x901d('0x64'))[_0x901d('0x7f')](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x80'),_0x901d('0x69'),_0x901d('0x81')],squel['select']()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))[_0x901d('0x6b')](_0x901d('0x6e'),_0x901d('0x65'))[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))['field'](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x82'),'CampaignId')['field']('NOW()','createdAt')[_0x901d('0x6b')](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')[_0x901d('0x3e')]('CampaignId\x20=\x20?',_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x20?',_0xa14cbd['body'][_0x901d('0x73')][_0x901d('0x74')]())[_0x901d('0x3e')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x901d('0x6a')]()[_0x901d('0x6b')]('phone')[_0x901d('0x77')]('cm_hopper')['where'](_0x901d('0x83'),_0xa14cbd['params']['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x83'),_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x204'))['group'](_0x901d('0x66')))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x45601a);}return[];})[_0x901d('0x28')](respondWithResult(_0x34f33f,null))[_0x901d('0x46')](handleError(_0x34f33f,null));};exports[_0x901d('0x84')]=function(_0x306491,_0x3cb399,_0x101067){return db['CmHopper'][_0x901d('0x85')]({'where':{'VoiceQueueId':_0x306491[_0x901d('0x4c')][_0x901d('0x68')],'CampaignId':_0x306491[_0x901d('0x4c')][_0x901d('0x80')],'ContactId':_0x306491[_0x901d('0x4c')][_0x901d('0x66')]}})[_0x901d('0x28')](handleEntityNotFound(_0x3cb399,null))[_0x901d('0x28')](function(_0x17b7ef){if(_0x17b7ef){return _0x17b7ef;}return null;})[_0x901d('0x28')](respondWithResult(_0x3cb399,null))[_0x901d('0x46')](handleError(_0x3cb399,null));}; \ No newline at end of file +var _0x7c09=['sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','noAnswerContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','state\x20=\x204','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x59aa9c,_0x497c12){var _0x390c6c=function(_0x28144b){while(--_0x28144b){_0x59aa9c['push'](_0x59aa9c['shift']());}};_0x390c6c(++_0x497c12);}(_0x7c09,0x102));var _0x97c0=function(_0x49836f,_0xe56f3c){_0x49836f=_0x49836f-0x0;var _0x3e0202=_0x7c09[_0x49836f];return _0x3e0202;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['CmHopperFinal'][_0x97c0('0x48')]()[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,null))[_0x97c0('0x43')](handleError(_0x4ff0a5,null));};exports['update']=function(_0x3e09d5,_0xac56ac){if(_0x3e09d5[_0x97c0('0x49')][_0x97c0('0x4a')]){delete _0x3e09d5[_0x97c0('0x49')]['uniqueid'];}return db[_0x97c0('0x2b')][_0x97c0('0x47')]({'where':{'uniqueid':_0x3e09d5[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0xac56ac,null))['then'](saveUpdates(_0x3e09d5[_0x97c0('0x49')],null))['then'](respondWithResult(_0xac56ac,null))['catch'](handleError(_0xac56ac,null));};exports[_0x97c0('0x4b')]=function(_0x20e2a5,_0x23c7ad,_0x53a255){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x20e2a5[_0x97c0('0x45')]['id']},'attributes':[[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x4f')))),'noSuchContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x50')))),'noAnswerContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x53')))),_0x97c0('0x54')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x55')))),_0x97c0('0x56')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x59')))),'reCallContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x97c0('0x5a')]]})[_0x97c0('0x24')](handleEntityNotFound(_0x23c7ad,null))[_0x97c0('0x24')](respondWithResult(_0x23c7ad,null))[_0x97c0('0x43')](handleError(_0x23c7ad,null));};exports[_0x97c0('0x5b')]=function(_0x2bb5d3,_0x52643e,_0x3349df){return db[_0x97c0('0x2b')][_0x97c0('0x41')]({'raw':![],'where':{'CampaignId':_0x2bb5d3[_0x97c0('0x45')]['id']},'attributes':[[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x200,\x201,\x20null'))),_0x97c0('0x5c')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x50')))),_0x97c0('0x5d')],[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),_0x97c0('0x54')],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x55')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x59')))),_0x97c0('0x5e')],[db[_0x97c0('0x4c')]['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x5f')))),_0x97c0('0x5a')]]})['then'](handleEntityNotFound(_0x52643e,null))[_0x97c0('0x24')](respondWithResult(_0x52643e,null))[_0x97c0('0x43')](handleError(_0x52643e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x4116c9,_0x30ffa8,_0x1cfe22){return db['VoiceQueue'][_0x97c0('0x47')]({'where':{'id':_0x4116c9[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x30ffa8,null))[_0x97c0('0x24')](function(_0x4d40cd){var _0x4ee6a2;if(_0x4d40cd){_0x4ee6a2=squel['insert']()[_0x97c0('0x60')](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),_0x97c0('0x66'),_0x97c0('0x67'),'createdAt','updatedAt'],squel[_0x97c0('0x68')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x64'))[_0x97c0('0x69')](_0x97c0('0x6b'),'ContactId')['field'](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x6d'),'VoiceQueueId')[_0x97c0('0x69')]('NOW()',_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x74'),_0x4116c9['body']['state'][_0x97c0('0x73')]())[_0x97c0('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x97c0('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x97c0('0x68')]()[_0x97c0('0x69')]('phone')[_0x97c0('0x70')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]()))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9['params']['id'][_0x97c0('0x73')]())['where']('state\x20=\x204'))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')]['query'](_0x4ee6a2);}return[];})[_0x97c0('0x24')](respondWithResult(_0x30ffa8,null))[_0x97c0('0x43')](handleError(_0x30ffa8,null));};exports[_0x97c0('0x78')]=function(_0x5bb9de,_0x388ba1,_0x550a68){return db[_0x97c0('0x79')][_0x97c0('0x47')]({'where':{'id':_0x5bb9de[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x388ba1,null))[_0x97c0('0x24')](function(_0x44f6bc){var _0x37cdb3;if(_0x44f6bc){_0x37cdb3=squel[_0x97c0('0x7a')]()['into'](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),'ListId',_0x97c0('0x7b'),_0x97c0('0x6e'),'updatedAt'],squel['select']()[_0x97c0('0x69')](_0x97c0('0x7c'),_0x97c0('0x63'))['field']('NOW()',_0x97c0('0x64'))['field'](_0x97c0('0x6b'),_0x97c0('0x65'))[_0x97c0('0x69')](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x7d'),'CampaignId')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x74'),_0x5bb9de['body'][_0x97c0('0x7f')][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x80'))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x63'))[_0x97c0('0x70')](_0x97c0('0x61'))[_0x97c0('0x39')]('CampaignId\x20=\x20?',_0x5bb9de[_0x97c0('0x45')]['id']['toString']()))[_0x97c0('0x39')](_0x97c0('0x75'),squel[_0x97c0('0x68')]()['field'](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de['params']['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x81')))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')][_0x97c0('0x2f')](_0x37cdb3);}return[];})[_0x97c0('0x24')](respondWithResult(_0x388ba1,null))[_0x97c0('0x43')](handleError(_0x388ba1,null));};exports[_0x97c0('0x82')]=function(_0x3ebd11,_0x44b374,_0x493e62){return db[_0x97c0('0x83')][_0x97c0('0x84')]({'where':{'VoiceQueueId':_0x3ebd11[_0x97c0('0x49')]['VoiceQueueId'],'CampaignId':_0x3ebd11['body'][_0x97c0('0x7b')],'ContactId':_0x3ebd11[_0x97c0('0x49')][_0x97c0('0x65')]}})[_0x97c0('0x24')](handleEntityNotFound(_0x44b374,null))[_0x97c0('0x24')](function(_0x120d78){if(_0x120d78){return _0x120d78;}return null;})[_0x97c0('0x24')](respondWithResult(_0x44b374,null))[_0x97c0('0x43')](handleError(_0x44b374,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 89ab159..3300448 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 _0x1417=['path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3076b5,_0x6bc9df){var _0x5ef5da=function(_0xac1ad1){while(--_0xac1ad1){_0x3076b5['push'](_0x3076b5['shift']());}};_0x5ef5da(++_0x6bc9df);}(_0x1417,0xcc));var _0x7141=function(_0x11dbb9,_0x2c5980){_0x11dbb9=_0x11dbb9-0x0;var _0x23d35d=_0x1417[_0x11dbb9];return _0x23d35d;};'use strict';var _=require(_0x7141('0x0'));var util=require(_0x7141('0x1'));var logger=require(_0x7141('0x2'))('api');var moment=require(_0x7141('0x3'));var BPromise=require(_0x7141('0x4'));var rp=require(_0x7141('0x5'));var fs=require('fs');var path=require(_0x7141('0x6'));var rimraf=require(_0x7141('0x7'));var config=require('../../config/environment');var attributes=require(_0x7141('0x8'));module[_0x7141('0x9')]=function(_0x38d372,_0x482c1d){return _0x38d372[_0x7141('0xa')](_0x7141('0xb'),attributes,{'tableName':_0x7141('0xc'),'paranoid':![],'indexes':[{'name':_0x7141('0xd'),'fields':['calleridnum']},{'name':_0x7141('0xe'),'fields':[_0x7141('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x507f=['exports','define','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x507f,0x1cb));var _0xf507=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x507f[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0xf507('0x0'));var util=require(_0xf507('0x1'));var logger=require(_0xf507('0x2'))('api');var moment=require(_0xf507('0x3'));var BPromise=require(_0xf507('0x4'));var rp=require(_0xf507('0x5'));var fs=require('fs');var path=require(_0xf507('0x6'));var rimraf=require('rimraf');var config=require(_0xf507('0x7'));var attributes=require(_0xf507('0x8'));module[_0xf507('0x9')]=function(_0x222c1b,_0x4767bb){return _0x222c1b[_0xf507('0xa')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xf507('0xb'),'fields':[_0xf507('0xb')]},{'name':_0xf507('0xc'),'fields':[_0xf507('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f8d58f3..3ec2a05 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 _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(_0x52ac0e,_0x25833e){var _0x59f8a9=function(_0x25b2ad){while(--_0x25b2ad){_0x52ac0e['push'](_0x52ac0e['shift']());}};_0x59f8a9(++_0x25833e);}(_0xb10b,0x12a));var _0xbb10=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0xb10b[_0x426dd2];return _0x4bc76c;};'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 +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(_0x1e2a8b,_0x25bbc5){var _0x10dd57=function(_0x1e2889){while(--_0x1e2889){_0x1e2a8b['push'](_0x1e2a8b['shift']());}};_0x10dd57(++_0x25bbc5);}(_0x7a54,0x106));var _0x47a5=function(_0x7f4ebd,_0x58c728){_0x7f4ebd=_0x7f4ebd-0x0;var _0x4162cb=_0x7a54[_0x7f4ebd];return _0x4162cb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 9bc19c0..e1c570a 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 _0x5f4d=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','express','Router','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe'];(function(_0x21ac50,_0x2256ed){var _0x29744b=function(_0x560a6d){while(--_0x560a6d){_0x21ac50['push'](_0x21ac50['shift']());}};_0x29744b(++_0x2256ed);}(_0x5f4d,0x91));var _0xd5f4=function(_0x28e196,_0x55ea66){_0x28e196=_0x28e196-0x0;var _0xebe98e=_0x5f4d[_0x28e196];return _0xebe98e;};'use strict';var multer=require(_0xd5f4('0x0'));var util=require(_0xd5f4('0x1'));var path=require(_0xd5f4('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5f4('0x3'));var router=express[_0xd5f4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd5f4('0x5'));var config=require('../../config/environment');var controller=require(_0xd5f4('0x6'));router[_0xd5f4('0x7')]('/',auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x9')]);router[_0xd5f4('0x7')](_0xd5f4('0xa'),auth[_0xd5f4('0x8')](),controller['describe']);router[_0xd5f4('0x7')](_0xd5f4('0xb'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0xc')]);router['get'](_0xd5f4('0xd'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0xe')]);router['get'](_0xd5f4('0xf'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x10')]);router[_0xd5f4('0x11')](_0xd5f4('0x12'),auth['isAuthenticated'](),controller[_0xd5f4('0x13')]);router[_0xd5f4('0x11')](_0xd5f4('0x14'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x15')]);router['post']('/checkContactHopper',auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x16')]);router[_0xd5f4('0x17')](_0xd5f4('0xb'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x18')]);module[_0xd5f4('0x19')]=router; \ No newline at end of file +var _0x4f7b=['../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x56f935,_0xbb3e13){var _0x25ff2f=function(_0x3d0fad){while(--_0x3d0fad){_0x56f935['push'](_0x56f935['shift']());}};_0x25ff2f(++_0xbb3e13);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x1e269c,_0x5976d7){_0x1e269c=_0x1e269c-0x0;var _0x52121f=_0x4f7b[_0x1e269c];return _0x52121f;};'use strict';var multer=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var path=require(_0xb4f7('0x2'));var timeout=require(_0xb4f7('0x3'));var express=require('express');var router=express[_0xb4f7('0x4')]();var fs_extra=require(_0xb4f7('0x5'));var auth=require(_0xb4f7('0x6'));var interaction=require(_0xb4f7('0x7'));var config=require(_0xb4f7('0x8'));var controller=require(_0xb4f7('0x9'));router[_0xb4f7('0xa')]('/',auth[_0xb4f7('0xb')](),controller['index']);router[_0xb4f7('0xa')]('/describe',auth[_0xb4f7('0xb')](),controller[_0xb4f7('0xc')]);router[_0xb4f7('0xa')]('/:id',auth[_0xb4f7('0xb')](),controller['show']);router[_0xb4f7('0xa')](_0xb4f7('0xd'),auth[_0xb4f7('0xb')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xb4f7('0xa')](_0xb4f7('0xe'),auth[_0xb4f7('0xb')](),controller[_0xb4f7('0xf')]);router[_0xb4f7('0x10')](_0xb4f7('0x11'),auth[_0xb4f7('0xb')](),controller[_0xb4f7('0x12')]);router['post'](_0xb4f7('0x13'),auth[_0xb4f7('0xb')](),controller[_0xb4f7('0x14')]);router[_0xb4f7('0x10')](_0xb4f7('0x15'),auth[_0xb4f7('0xb')](),controller['checkContactHopper']);router[_0xb4f7('0x16')]('/:id',auth[_0xb4f7('0xb')](),controller[_0xb4f7('0x17')]);module[_0xb4f7('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 220e1a6..59f5818 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 _0x4aef=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x50b1b2,_0x4a6561){var _0x9d440f=function(_0x4cec71){while(--_0x4cec71){_0x50b1b2['push'](_0x50b1b2['shift']());}};_0x9d440f(++_0x4a6561);}(_0x4aef,0x1e6));var _0xf4ae=function(_0x4ad871,_0x4343f3){_0x4ad871=_0x4ad871-0x0;var _0x20344f=_0x4aef[_0x4ad871];return _0x20344f;};'use strict';var Sequelize=require('sequelize');module[_0xf4ae('0x0')]={'state':{'type':Sequelize[_0xf4ae('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf4ae('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf4ae('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xf4ae('0x2')]},'originatecalleridname':{'type':Sequelize[_0xf4ae('0x2')]},'calleridnum':{'type':Sequelize[_0xf4ae('0x2')]},'calleridname':{'type':Sequelize[_0xf4ae('0x2')]},'starttime':{'type':Sequelize[_0xf4ae('0x3')]},'responsetime':{'type':Sequelize[_0xf4ae('0x3')]},'answertime':{'type':Sequelize[_0xf4ae('0x3')]},'droptime':{'type':Sequelize[_0xf4ae('0x3')]},'endtime':{'type':Sequelize[_0xf4ae('0x3')]},'ringtime':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf4ae('0x2')]},'campaign':{'type':Sequelize[_0xf4ae('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf4ae('0x2')]},'reason':{'type':Sequelize[_0xf4ae('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xf4ae('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf4ae('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf4ae('0x3')]},'recallme':{'type':Sequelize[_0xf4ae('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xf4ae('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf43=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xdf43,0x6c));var _0x3df4=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xdf43[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0x3df4('0x0'));module['exports']={'state':{'type':Sequelize[_0x3df4('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3df4('0x2')]},'scheduledat':{'type':Sequelize[_0x3df4('0x3')]},'countbusyretry':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x3df4('0x2')]},'originatecalleridname':{'type':Sequelize[_0x3df4('0x2')]},'calleridnum':{'type':Sequelize[_0x3df4('0x2')]},'calleridname':{'type':Sequelize[_0x3df4('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3df4('0x3')]},'answertime':{'type':Sequelize[_0x3df4('0x3')]},'droptime':{'type':Sequelize[_0x3df4('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3df4('0x2')]},'campaign':{'type':Sequelize[_0x3df4('0x2')]},'campaigntype':{'type':Sequelize[_0x3df4('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3df4('0x2')]},'amd':{'type':Sequelize[_0x3df4('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3df4('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3df4('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3df4('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3df4('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3df4('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8773d13..3080a84 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 _0x6495=['undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','CmHopperHistory','includeAll','findAll','rows','catch','params','create','body','describe','uniqueid','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset'];(function(_0x121d62,_0x407fc5){var _0x204133=function(_0x1bea82){while(--_0x1bea82){_0x121d62['push'](_0x121d62['shift']());}};_0x204133(++_0x407fc5);}(_0x6495,0xc6));var _0x5649=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6495[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5649('0x0'));var zipdir=require(_0x5649('0x1'));var jsonpatch=require(_0x5649('0x2'));var rp=require('request-promise');var moment=require(_0x5649('0x3'));var BPromise=require(_0x5649('0x4'));var Mustache=require('mustache');var util=require(_0x5649('0x5'));var path=require(_0x5649('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5649('0x7'));var fs=require('fs');var fs_extra=require(_0x5649('0x8'));var _=require(_0x5649('0x9'));var squel=require(_0x5649('0xa'));var crypto=require(_0x5649('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5649('0xc'));var toCsv=require(_0x5649('0xd'));var querystring=require(_0x5649('0xe'));var Papa=require(_0x5649('0xf'));var Redis=require('ioredis');var authService=require(_0x5649('0x10'));var qs=require(_0x5649('0x11'));var as=require(_0x5649('0x12'));var hardwareService=require(_0x5649('0x13'));var logger=require('../../config/logger')(_0x5649('0x14'));var utils=require('../../config/utils');var config=require(_0x5649('0x15'));var licenseUtil=require(_0x5649('0x16'));var db=require(_0x5649('0x17'))['db'];function respondWithStatusCode(_0x2c5174,_0x2e211e){_0x2e211e=_0x2e211e||0xcc;return function(_0x138eda){if(_0x138eda){return _0x2c5174['sendStatus'](_0x2e211e);}return _0x2c5174[_0x5649('0x18')](_0x2e211e)['end']();};}function respondWithResult(_0x39e1ab,_0xf5efae){_0xf5efae=_0xf5efae||0xc8;return function(_0x4aa854){if(_0x4aa854){return _0x39e1ab[_0x5649('0x18')](_0xf5efae)[_0x5649('0x19')](_0x4aa854);}};}function respondWithFilteredResult(_0x5df4fe,_0x496ca5){return function(_0x37f742){if(_0x37f742){var _0x2e0882=typeof _0x496ca5[_0x5649('0x1a')]===_0x5649('0x1b')&&typeof _0x496ca5[_0x5649('0x1c')]===_0x5649('0x1b');var _0x5765cb=_0x37f742['count'];var _0x41dd95=_0x2e0882?0x0:_0x496ca5[_0x5649('0x1a')];var _0x584898=_0x2e0882?_0x37f742[_0x5649('0x1d')]:_0x496ca5['offset']+_0x496ca5[_0x5649('0x1c')];var _0x58a5bf;if(_0x584898>=_0x5765cb){_0x584898=_0x5765cb;_0x58a5bf=0xc8;}else{_0x58a5bf=0xce;}_0x5df4fe[_0x5649('0x18')](_0x58a5bf);return _0x5df4fe[_0x5649('0x1e')](_0x5649('0x1f'),_0x41dd95+'-'+_0x584898+'/'+_0x5765cb)[_0x5649('0x19')](_0x37f742);}return null;};}function patchUpdates(_0x378e84){return function(_0x67a632){try{jsonpatch['apply'](_0x67a632,_0x378e84,!![]);}catch(_0x4fb244){return BPromise['reject'](_0x4fb244);}return _0x67a632[_0x5649('0x20')]();};}function saveUpdates(_0x4cb597,_0x42bfd7){return function(_0x16f8ea){if(_0x16f8ea){return _0x16f8ea[_0x5649('0x21')](_0x4cb597)[_0x5649('0x22')](function(_0xbbd819){return _0xbbd819;});}return null;};}function removeEntity(_0xd06fdd,_0x1604ad){return function(_0x11e2f1){if(_0x11e2f1){return _0x11e2f1[_0x5649('0x23')]()['then'](function(){_0xd06fdd[_0x5649('0x18')](0xcc)[_0x5649('0x24')]();});}};}function handleEntityNotFound(_0x3603b8,_0x5d5e26){return function(_0x333c7e){if(!_0x333c7e){_0x3603b8[_0x5649('0x25')](0x194);}return _0x333c7e;};}function handleError(_0x3b0ee2,_0x2600d1){_0x2600d1=_0x2600d1||0x1f4;return function(_0x49a497){logger[_0x5649('0x26')](_0x49a497['stack']);if(_0x49a497[_0x5649('0x27')]){delete _0x49a497['name'];}_0x3b0ee2[_0x5649('0x18')](_0x2600d1)[_0x5649('0x28')](_0x49a497);};}exports[_0x5649('0x29')]=function(_0x5a949d,_0x3f0051){var _0x793e15={},_0xf19d4f={},_0xa22ae2={'count':0x0,'rows':[]};var _0x379b0f=_[_0x5649('0x2a')](db['CmHopperHistory'][_0x5649('0x2b')],function(_0xd1ccc8){return{'name':_0xd1ccc8[_0x5649('0x2c')],'type':_0xd1ccc8[_0x5649('0x2d')][_0x5649('0x2e')]};});_0xf19d4f[_0x5649('0x2f')]=_[_0x5649('0x2a')](_0x379b0f,_0x5649('0x27'));_0xf19d4f[_0x5649('0x30')]=_[_0x5649('0x31')](_0x5a949d[_0x5649('0x30')]);_0xf19d4f['filters']=_[_0x5649('0x32')](_0xf19d4f[_0x5649('0x2f')],_0xf19d4f[_0x5649('0x30')]);_0x793e15[_0x5649('0x33')]=_[_0x5649('0x32')](_0xf19d4f['model'],qs[_0x5649('0x34')](_0x5a949d[_0x5649('0x30')]['fields']));_0x793e15[_0x5649('0x33')]=_0x793e15['attributes'][_0x5649('0x35')]?_0x793e15[_0x5649('0x33')]:_0xf19d4f[_0x5649('0x2f')];if(!_0x5a949d[_0x5649('0x30')][_0x5649('0x36')](_0x5649('0x37'))){_0x793e15[_0x5649('0x1c')]=qs[_0x5649('0x1c')](_0x5a949d[_0x5649('0x30')]['limit']);_0x793e15[_0x5649('0x1a')]=qs[_0x5649('0x1a')](_0x5a949d['query']['offset']);}_0x793e15[_0x5649('0x38')]=qs['sort'](_0x5a949d['query'][_0x5649('0x39')]);_0x793e15[_0x5649('0x3a')]=qs[_0x5649('0x3b')](_['pick'](_0x5a949d[_0x5649('0x30')],_0xf19d4f[_0x5649('0x3b')]),_0x379b0f);if(_0x5a949d[_0x5649('0x30')][_0x5649('0x3c')]){_0x793e15['where']=_['merge'](_0x793e15['where'],{'$or':_[_0x5649('0x2a')](_0x379b0f,function(_0x1fa793){if(_0x1fa793[_0x5649('0x2d')]!==_0x5649('0x3d')){var _0x3838eb={};_0x3838eb[_0x1fa793[_0x5649('0x27')]]={'$like':'%'+_0x5a949d[_0x5649('0x30')][_0x5649('0x3c')]+'%'};return _0x3838eb;}})});}_0x793e15=_[_0x5649('0x3e')]({},_0x793e15,_0x5a949d[_0x5649('0x3f')]);var _0x3f9577={'where':_0x793e15[_0x5649('0x3a')]};return db[_0x5649('0x40')]['count'](_0x3f9577)[_0x5649('0x22')](function(_0x2f517e){_0xa22ae2[_0x5649('0x1d')]=_0x2f517e;if(_0x5a949d['query'][_0x5649('0x41')]){_0x793e15['include']=[{'all':!![]}];}return db[_0x5649('0x40')][_0x5649('0x42')](_0x793e15);})[_0x5649('0x22')](function(_0x3ff8ed){_0xa22ae2[_0x5649('0x43')]=_0x3ff8ed;return _0xa22ae2;})['then'](respondWithFilteredResult(_0x3f0051,_0x793e15))[_0x5649('0x44')](handleError(_0x3f0051,null));};exports['show']=function(_0x546ea5,_0x383b4e){var _0x18859a={'raw':!![],'where':{'id':_0x546ea5[_0x5649('0x45')]['id']}},_0x1d6d8f={};_0x1d6d8f['model']=_[_0x5649('0x31')](db[_0x5649('0x40')][_0x5649('0x2b')]);_0x1d6d8f[_0x5649('0x30')]=_['keys'](_0x546ea5[_0x5649('0x30')]);_0x1d6d8f['filters']=_['intersection'](_0x1d6d8f[_0x5649('0x2f')],_0x1d6d8f['query']);_0x18859a[_0x5649('0x33')]=_[_0x5649('0x32')](_0x1d6d8f[_0x5649('0x2f')],qs[_0x5649('0x34')](_0x546ea5['query'][_0x5649('0x34')]));_0x18859a['attributes']=_0x18859a['attributes']['length']?_0x18859a[_0x5649('0x33')]:_0x1d6d8f['model'];if(_0x546ea5[_0x5649('0x30')][_0x5649('0x41')]){_0x18859a['include']=[{'all':!![]}];}_0x18859a=_['merge']({},_0x18859a,_0x546ea5[_0x5649('0x3f')]);return db[_0x5649('0x40')]['find'](_0x18859a)[_0x5649('0x22')](handleEntityNotFound(_0x383b4e,null))['then'](respondWithResult(_0x383b4e,null))[_0x5649('0x44')](handleError(_0x383b4e,null));};exports[_0x5649('0x46')]=function(_0x3fb234,_0x56d59e){return db[_0x5649('0x40')][_0x5649('0x46')](_0x3fb234[_0x5649('0x47')],{})[_0x5649('0x22')](respondWithResult(_0x56d59e,0xc9))[_0x5649('0x44')](handleError(_0x56d59e,null));};exports[_0x5649('0x48')]=function(_0x28a1b2,_0x4c29f4){return db[_0x5649('0x40')][_0x5649('0x48')]()[_0x5649('0x22')](respondWithResult(_0x4c29f4,null))['catch'](handleError(_0x4c29f4,null));};exports['update']=function(_0x5448ed,_0x4a8b9e){if(_0x5448ed['body'][_0x5649('0x49')]){delete _0x5448ed[_0x5649('0x47')][_0x5649('0x49')];}return db[_0x5649('0x40')][_0x5649('0x4a')]({'where':{'uniqueid':_0x5448ed[_0x5649('0x45')]['id']}})[_0x5649('0x22')](handleEntityNotFound(_0x4a8b9e,null))[_0x5649('0x22')](saveUpdates(_0x5448ed[_0x5649('0x47')],null))[_0x5649('0x22')](respondWithResult(_0x4a8b9e,null))[_0x5649('0x44')](handleError(_0x4a8b9e,null));}; \ No newline at end of file +var _0x645c=['moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','offset','count','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x48cce0,_0x366a85){var _0x3fc225=function(_0x2d3012){while(--_0x2d3012){_0x48cce0['push'](_0x48cce0['shift']());}};_0x3fc225(++_0x366a85);}(_0x645c,0xe6));var _0xc645=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x645c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc645('0x0'));var rimraf=require(_0xc645('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc645('0x2'));var rp=require(_0xc645('0x3'));var moment=require(_0xc645('0x4'));var BPromise=require(_0xc645('0x5'));var Mustache=require(_0xc645('0x6'));var util=require(_0xc645('0x7'));var path=require(_0xc645('0x8'));var sox=require(_0xc645('0x9'));var csv=require(_0xc645('0xa'));var ejs=require(_0xc645('0xb'));var fs=require('fs');var fs_extra=require(_0xc645('0xc'));var _=require('lodash');var squel=require(_0xc645('0xd'));var crypto=require(_0xc645('0xe'));var jsforce=require(_0xc645('0xf'));var deskjs=require(_0xc645('0x10'));var toCsv=require(_0xc645('0xa'));var querystring=require('querystring');var Papa=require(_0xc645('0x11'));var Redis=require(_0xc645('0x12'));var authService=require(_0xc645('0x13'));var qs=require(_0xc645('0x14'));var as=require(_0xc645('0x15'));var hardwareService=require(_0xc645('0x16'));var logger=require(_0xc645('0x17'))(_0xc645('0x18'));var utils=require(_0xc645('0x19'));var config=require(_0xc645('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc645('0x1b'))['db'];function respondWithStatusCode(_0x9b625b,_0x4289c4){_0x4289c4=_0x4289c4||0xcc;return function(_0x2ab0d2){if(_0x2ab0d2){return _0x9b625b['sendStatus'](_0x4289c4);}return _0x9b625b[_0xc645('0x1c')](_0x4289c4)[_0xc645('0x1d')]();};}function respondWithResult(_0x2d3c99,_0x272552){_0x272552=_0x272552||0xc8;return function(_0x332a7a){if(_0x332a7a){return _0x2d3c99[_0xc645('0x1c')](_0x272552)['json'](_0x332a7a);}};}function respondWithFilteredResult(_0x49b787,_0x2a071d){return function(_0x321376){if(_0x321376){var _0x4e89c8=typeof _0x2a071d['offset']===_0xc645('0x1e')&&typeof _0x2a071d['limit']===_0xc645('0x1e');var _0x5796ae=_0x321376['count'];var _0x50e600=_0x4e89c8?0x0:_0x2a071d[_0xc645('0x1f')];var _0x4fac18=_0x4e89c8?_0x321376[_0xc645('0x20')]:_0x2a071d['offset']+_0x2a071d['limit'];var _0x1476ee;if(_0x4fac18>=_0x5796ae){_0x4fac18=_0x5796ae;_0x1476ee=0xc8;}else{_0x1476ee=0xce;}_0x49b787[_0xc645('0x1c')](_0x1476ee);return _0x49b787['set']('Content-Range',_0x50e600+'-'+_0x4fac18+'/'+_0x5796ae)['json'](_0x321376);}return null;};}function patchUpdates(_0x12712b){return function(_0x2ac031){try{jsonpatch[_0xc645('0x21')](_0x2ac031,_0x12712b,!![]);}catch(_0x532109){return BPromise[_0xc645('0x22')](_0x532109);}return _0x2ac031[_0xc645('0x23')]();};}function saveUpdates(_0xdf1759,_0x1f162b){return function(_0x1c38f0){if(_0x1c38f0){return _0x1c38f0[_0xc645('0x24')](_0xdf1759)['then'](function(_0xe9326b){return _0xe9326b;});}return null;};}function removeEntity(_0x3db9f2,_0x210ced){return function(_0x2b3077){if(_0x2b3077){return _0x2b3077[_0xc645('0x25')]()[_0xc645('0x26')](function(){_0x3db9f2['status'](0xcc)[_0xc645('0x1d')]();});}};}function handleEntityNotFound(_0x1e9350,_0x294f19){return function(_0x531f8f){if(!_0x531f8f){_0x1e9350[_0xc645('0x27')](0x194);}return _0x531f8f;};}function handleError(_0x2d9000,_0x3a72fa){_0x3a72fa=_0x3a72fa||0x1f4;return function(_0x52b848){logger[_0xc645('0x28')](_0x52b848[_0xc645('0x29')]);if(_0x52b848['name']){delete _0x52b848[_0xc645('0x2a')];}_0x2d9000[_0xc645('0x1c')](_0x3a72fa)[_0xc645('0x2b')](_0x52b848);};}exports[_0xc645('0x2c')]=function(_0x1cf0aa,_0x58e427){var _0x45b45c={},_0x2ac9c2={},_0x5b468f={'count':0x0,'rows':[]};var _0x2d6642=_[_0xc645('0x2d')](db[_0xc645('0x2e')][_0xc645('0x2f')],function(_0x4f2cbf){return{'name':_0x4f2cbf[_0xc645('0x30')],'type':_0x4f2cbf[_0xc645('0x31')][_0xc645('0x32')]};});_0x2ac9c2[_0xc645('0x33')]=_[_0xc645('0x2d')](_0x2d6642,'name');_0x2ac9c2[_0xc645('0x34')]=_['keys'](_0x1cf0aa[_0xc645('0x34')]);_0x2ac9c2[_0xc645('0x35')]=_[_0xc645('0x36')](_0x2ac9c2[_0xc645('0x33')],_0x2ac9c2[_0xc645('0x34')]);_0x45b45c[_0xc645('0x37')]=_[_0xc645('0x36')](_0x2ac9c2[_0xc645('0x33')],qs[_0xc645('0x38')](_0x1cf0aa[_0xc645('0x34')]['fields']));_0x45b45c['attributes']=_0x45b45c[_0xc645('0x37')][_0xc645('0x39')]?_0x45b45c['attributes']:_0x2ac9c2[_0xc645('0x33')];if(!_0x1cf0aa['query'][_0xc645('0x3a')](_0xc645('0x3b'))){_0x45b45c[_0xc645('0x3c')]=qs[_0xc645('0x3c')](_0x1cf0aa['query'][_0xc645('0x3c')]);_0x45b45c[_0xc645('0x1f')]=qs[_0xc645('0x1f')](_0x1cf0aa[_0xc645('0x34')][_0xc645('0x1f')]);}_0x45b45c[_0xc645('0x3d')]=qs[_0xc645('0x3e')](_0x1cf0aa['query'][_0xc645('0x3e')]);_0x45b45c['where']=qs[_0xc645('0x35')](_['pick'](_0x1cf0aa['query'],_0x2ac9c2[_0xc645('0x35')]),_0x2d6642);if(_0x1cf0aa['query'][_0xc645('0x3f')]){_0x45b45c[_0xc645('0x40')]=_[_0xc645('0x41')](_0x45b45c[_0xc645('0x40')],{'$or':_[_0xc645('0x2d')](_0x2d6642,function(_0x4754a8){if(_0x4754a8[_0xc645('0x31')]!==_0xc645('0x42')){var _0x117704={};_0x117704[_0x4754a8[_0xc645('0x2a')]]={'$like':'%'+_0x1cf0aa[_0xc645('0x34')][_0xc645('0x3f')]+'%'};return _0x117704;}})});}_0x45b45c=_[_0xc645('0x41')]({},_0x45b45c,_0x1cf0aa[_0xc645('0x43')]);var _0xbceaca={'where':_0x45b45c[_0xc645('0x40')]};return db[_0xc645('0x2e')][_0xc645('0x20')](_0xbceaca)['then'](function(_0x3d2d94){_0x5b468f[_0xc645('0x20')]=_0x3d2d94;if(_0x1cf0aa[_0xc645('0x34')][_0xc645('0x44')]){_0x45b45c[_0xc645('0x45')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x45b45c);})[_0xc645('0x26')](function(_0x3fc41a){_0x5b468f[_0xc645('0x46')]=_0x3fc41a;return _0x5b468f;})[_0xc645('0x26')](respondWithFilteredResult(_0x58e427,_0x45b45c))[_0xc645('0x47')](handleError(_0x58e427,null));};exports['show']=function(_0x580923,_0x4c2b1f){var _0xb8e864={'raw':!![],'where':{'id':_0x580923[_0xc645('0x48')]['id']}},_0x8ae29={};_0x8ae29[_0xc645('0x33')]=_[_0xc645('0x49')](db[_0xc645('0x2e')][_0xc645('0x2f')]);_0x8ae29[_0xc645('0x34')]=_[_0xc645('0x49')](_0x580923[_0xc645('0x34')]);_0x8ae29[_0xc645('0x35')]=_['intersection'](_0x8ae29[_0xc645('0x33')],_0x8ae29['query']);_0xb8e864[_0xc645('0x37')]=_['intersection'](_0x8ae29[_0xc645('0x33')],qs[_0xc645('0x38')](_0x580923[_0xc645('0x34')][_0xc645('0x38')]));_0xb8e864[_0xc645('0x37')]=_0xb8e864[_0xc645('0x37')][_0xc645('0x39')]?_0xb8e864['attributes']:_0x8ae29[_0xc645('0x33')];if(_0x580923['query'][_0xc645('0x44')]){_0xb8e864[_0xc645('0x45')]=[{'all':!![]}];}_0xb8e864=_['merge']({},_0xb8e864,_0x580923[_0xc645('0x43')]);return db[_0xc645('0x2e')][_0xc645('0x4a')](_0xb8e864)['then'](handleEntityNotFound(_0x4c2b1f,null))['then'](respondWithResult(_0x4c2b1f,null))[_0xc645('0x47')](handleError(_0x4c2b1f,null));};exports['create']=function(_0x8bdff3,_0x23aa90){return db[_0xc645('0x2e')]['create'](_0x8bdff3[_0xc645('0x4b')],{})[_0xc645('0x26')](respondWithResult(_0x23aa90,0xc9))[_0xc645('0x47')](handleError(_0x23aa90,null));};exports[_0xc645('0x4c')]=function(_0x23ed1f,_0x47e109){return db[_0xc645('0x2e')][_0xc645('0x4c')]()[_0xc645('0x26')](respondWithResult(_0x47e109,null))['catch'](handleError(_0x47e109,null));};exports[_0xc645('0x24')]=function(_0x3c08c4,_0x6e0d1f){if(_0x3c08c4[_0xc645('0x4b')][_0xc645('0x4d')]){delete _0x3c08c4[_0xc645('0x4b')][_0xc645('0x4d')];}return db[_0xc645('0x2e')][_0xc645('0x4a')]({'where':{'uniqueid':_0x3c08c4['params']['id']}})[_0xc645('0x26')](handleEntityNotFound(_0x6e0d1f,null))[_0xc645('0x26')](saveUpdates(_0x3c08c4[_0xc645('0x4b')],null))[_0xc645('0x26')](respondWithResult(_0x6e0d1f,null))[_0xc645('0x47')](handleError(_0x6e0d1f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 3078fad..bf2c4f1 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 _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x50d79c,_0x3687ae){var _0x3be82f=function(_0x3d00e2){while(--_0x3d00e2){_0x50d79c['push'](_0x50d79c['shift']());}};_0x3be82f(++_0x3687ae);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x49c7e0,_0x28845f){_0x49c7e0=_0x49c7e0-0x0;var _0x188fa8=_0xc6ac[_0x49c7e0];return _0x188fa8;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['endtime']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd2=['exports','define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes'];(function(_0x20e5c3,_0x41470c){var _0x401520=function(_0x37f246){while(--_0x37f246){_0x20e5c3['push'](_0x20e5c3['shift']());}};_0x401520(++_0x41470c);}(_0xcdd2,0x83));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var logger=require(_0x2cdd('0x2'))(_0x2cdd('0x3'));var moment=require('moment');var BPromise=require(_0x2cdd('0x4'));var rp=require(_0x2cdd('0x5'));var fs=require('fs');var path=require(_0x2cdd('0x6'));var rimraf=require(_0x2cdd('0x7'));var config=require('../../config/environment');var attributes=require(_0x2cdd('0x8'));module[_0x2cdd('0x9')]=function(_0x5f3b53,_0x1cc1ac){return _0x5f3b53[_0x2cdd('0xa')](_0x2cdd('0xb'),attributes,{'tableName':_0x2cdd('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':'uniqueid','fields':[_0x2cdd('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 8f27f99..d1d6fb0 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 _0x3b75=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util'];(function(_0x41ebe9,_0x450a7e){var _0x4ffe5b=function(_0x40156d){while(--_0x40156d){_0x41ebe9['push'](_0x41ebe9['shift']());}};_0x4ffe5b(++_0x450a7e);}(_0x3b75,0xdc));var _0x53b7=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x3b75[_0x35007a];return _0x574f68;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53b7('0x6'))('rpc');var config=require(_0x53b7('0x7'));var jayson=require(_0x53b7('0x8'));var client=jayson[_0x53b7('0x9')][_0x53b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e5139,_0x5ee630,_0x1f89b7){return new BPromise(function(_0x233482,_0x4275fe){return client['request'](_0x7e5139,_0x1f89b7)[_0x53b7('0xb')](function(_0x4b7c51){logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,_0x53b7('0xe'));logger[_0x53b7('0xf')](_0x53b7('0x10'),_0x5ee630,'request\x20sent',JSON[_0x53b7('0x11')](_0x4b7c51));if(_0x4b7c51[_0x53b7('0x12')]){if(_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x13')]===0x1f4){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x14')]);return _0x4275fe(_0x4b7c51[_0x53b7('0x12')]['message']);}logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51['error']['message']);return _0x233482(_0x4b7c51['error'][_0x53b7('0x14')]);}else{logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,'request\x20sent');_0x233482(_0x4b7c51[_0x53b7('0x15')][_0x53b7('0x14')]);}})[_0x53b7('0x16')](function(_0xe4cb1){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0xe4cb1);_0x4275fe(_0xe4cb1);});});}exports['CreateCmHopperHistory']=function(_0x4eaf6a){var _0x19b100=this;return new Promise(function(_0x45b608,_0x3a049f){return db[_0x53b7('0x17')][_0x53b7('0x18')](_0x4eaf6a[_0x53b7('0x19')],{'raw':_0x4eaf6a[_0x53b7('0x1a')]?_0x4eaf6a[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3b8187){logger[_0x53b7('0xc')](_0x53b7('0x1c'),_0x4eaf6a);logger[_0x53b7('0xf')](_0x53b7('0x1c'),_0x4eaf6a,JSON[_0x53b7('0x11')](_0x3b8187));_0x45b608(_0x3b8187);})[_0x53b7('0x16')](function(_0x237dc9){logger[_0x53b7('0x12')](_0x53b7('0x1c'),_0x237dc9[_0x53b7('0x14')],_0x4eaf6a);_0x3a049f(_0x19b100[_0x53b7('0x12')](0x1f4,_0x237dc9['message']));});});};exports[_0x53b7('0x1d')]=function(_0x54dc05){var _0x41b3a9=this;return new Promise(function(_0x18a2e4,_0x51ff47){return db['CmHopperHistory'][_0x53b7('0x1e')]({'raw':_0x54dc05[_0x53b7('0x1a')]?_0x54dc05[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x54dc05['options']?_0x54dc05[_0x53b7('0x1a')][_0x53b7('0x1f')]||null:null,'attributes':[[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')][_0x53b7('0x22')]('id')),'predictiveIntervalTotalCalls'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x24')))),_0x53b7('0x25')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x26')))),_0x53b7('0x27')],[db['sequelize']['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db['sequelize'][_0x53b7('0x23')](_0x53b7('0x28')))),_0x53b7('0x29')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x2a'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x2b')))),_0x53b7('0x2c')],[db[_0x53b7('0x20')]['fn']('AVG',db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x2d')))),_0x53b7('0x2e')]]})[_0x53b7('0xb')](function(_0x58c406){logger[_0x53b7('0xc')](_0x53b7('0x1d'),_0x54dc05);logger['debug'](_0x53b7('0x1d'),_0x54dc05,JSON[_0x53b7('0x11')](_0x58c406));_0x18a2e4(_0x58c406);})['catch'](function(_0xd825de){logger[_0x53b7('0x12')]('AvgHandleTime',_0xd825de[_0x53b7('0x14')],_0x54dc05);_0x51ff47(_0x41b3a9[_0x53b7('0x12')](0x1f4,_0xd825de[_0x53b7('0x14')]));});});};exports[_0x53b7('0x2f')]=function(_0xcfa83c){var _0x316765=this;return new Promise(function(_0x215c8e,_0x67623f){return db[_0x53b7('0x17')][_0x53b7('0x1e')]({'raw':_0xcfa83c[_0x53b7('0x1a')]?_0xcfa83c[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![],'where':_0xcfa83c['options']?_0xcfa83c['options'][_0x53b7('0x1f')]||null:null,'attributes':[[_0x53b7('0x30'),_0x53b7('0x31')],[db['sequelize']['fn']('COUNT',db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x32')))),_0x53b7('0x33')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x34')))),_0x53b7('0x35')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x24')))),_0x53b7('0x36')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x37')))),_0x53b7('0x38')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x39')))),_0x53b7('0x3a')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db['sequelize'][_0x53b7('0x23')](_0x53b7('0x3b')))),'outboundDropCallsDayTimeout'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x3c')))),_0x53b7('0x3d')],[db[_0x53b7('0x20')]['fn']('COUNT',db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x3e')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x3f')))),_0x53b7('0x40')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x41')))),'outboundOriginateFailureCallsDay'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x42')))),'outboundRejectCallsDay'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x43')))),_0x53b7('0x44')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x45')))),_0x53b7('0x46')],[db[_0x53b7('0x20')]['fn']('COUNT',db[_0x53b7('0x20')]['fn']('IF',db['sequelize'][_0x53b7('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x53b7('0x30')]})[_0x53b7('0xb')](function(_0x34bb06){logger[_0x53b7('0xc')](_0x53b7('0x2f'),_0xcfa83c);logger[_0x53b7('0xf')](_0x53b7('0x2f'),_0xcfa83c,JSON[_0x53b7('0x11')](_0x34bb06));_0x215c8e(_0x34bb06);})['catch'](function(_0x3d2485){logger[_0x53b7('0x12')](_0x53b7('0x2f'),_0x3d2485[_0x53b7('0x14')],_0xcfa83c);_0x67623f(_0x316765[_0x53b7('0x12')](0x1f4,_0x3d2485['message']));});});};exports[_0x53b7('0x47')]=function(_0xf0d227){var _0x4d569c=this;return new Promise(function(_0x3616aa,_0x11bc19){return db['CmHopperHistory']['findAll']({'raw':_0xf0d227[_0x53b7('0x1a')]?_0xf0d227[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![],'where':_0xf0d227[_0x53b7('0x1a')]?_0xf0d227['options'][_0x53b7('0x1f')]||null:null,'attributes':[[_0x53b7('0x30'),'name'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')][_0x53b7('0x22')]('id')),_0x53b7('0x48')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x24')))),_0x53b7('0x49')]],'group':[_0x53b7('0x30')]})[_0x53b7('0xb')](function(_0x1669d4){logger['info'](_0x53b7('0x47'),_0xf0d227);logger[_0x53b7('0xf')]('GetCampaignHopperHistory',_0xf0d227,JSON[_0x53b7('0x11')](_0x1669d4));_0x3616aa(_0x1669d4);})[_0x53b7('0x16')](function(_0x1554a5){logger['error']('GetCampaignHopperHistory',_0x1554a5[_0x53b7('0x14')],_0xf0d227);_0x11bc19(_0x4d569c[_0x53b7('0x12')](0x1f4,_0x1554a5[_0x53b7('0x14')]));});});}; \ No newline at end of file +var _0x1109=['name','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','where','col','ivrAnswerCallsDay','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','COUNT','sequelize','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1109,0x17d));var _0x9110=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x1109[_0x4c440b];return _0x2d48cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9110('0x0'));var BPromise=require('bluebird');var rs=require(_0x9110('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9110('0x2'))['db'];var utils=require(_0x9110('0x3'));var logger=require(_0x9110('0x4'))(_0x9110('0x5'));var config=require(_0x9110('0x6'));var jayson=require(_0x9110('0x7'));var client=jayson[_0x9110('0x8')][_0x9110('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a4a8,_0x4a15c6,_0x5c125b){return new BPromise(function(_0x4d18a6,_0x3d40a9){return client[_0x9110('0xa')](_0x35a4a8,_0x5c125b)[_0x9110('0xb')](function(_0x4e7252){logger[_0x9110('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,'request\x20sent');logger[_0x9110('0xd')](_0x9110('0xe'),_0x4a15c6,_0x9110('0xf'),JSON[_0x9110('0x10')](_0x4e7252));if(_0x4e7252[_0x9110('0x11')]){if(_0x4e7252[_0x9110('0x11')][_0x9110('0x12')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,_0x4e7252[_0x9110('0x11')]['message']);return _0x3d40a9(_0x4e7252['error'][_0x9110('0x13')]);}logger[_0x9110('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,_0x4e7252[_0x9110('0x11')]['message']);return _0x4d18a6(_0x4e7252[_0x9110('0x11')][_0x9110('0x13')]);}else{logger[_0x9110('0xc')](_0x9110('0x14'),_0x4a15c6,_0x9110('0xf'));_0x4d18a6(_0x4e7252[_0x9110('0x15')]['message']);}})['catch'](function(_0x3bffeb){logger[_0x9110('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,_0x3bffeb);_0x3d40a9(_0x3bffeb);});});}exports[_0x9110('0x16')]=function(_0x11dec4){var _0x1bcaf2=this;return new Promise(function(_0x3d21e5,_0x2d75d6){return db[_0x9110('0x17')][_0x9110('0x18')](_0x11dec4[_0x9110('0x19')],{'raw':_0x11dec4[_0x9110('0x1a')]?_0x11dec4[_0x9110('0x1a')][_0x9110('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3563c5){logger[_0x9110('0xc')](_0x9110('0x16'),_0x11dec4);logger[_0x9110('0xd')]('CreateCmHopperHistory',_0x11dec4,JSON[_0x9110('0x10')](_0x3563c5));_0x3d21e5(_0x3563c5);})['catch'](function(_0x5a17b0){logger[_0x9110('0x11')](_0x9110('0x16'),_0x5a17b0[_0x9110('0x13')],_0x11dec4);_0x2d75d6(_0x1bcaf2[_0x9110('0x11')](0x1f4,_0x5a17b0[_0x9110('0x13')]));});});};exports[_0x9110('0x1c')]=function(_0x34903c){var _0x2a6f17=this;return new Promise(function(_0x10759b,_0x5aa7a1){return db[_0x9110('0x17')][_0x9110('0x1d')]({'raw':_0x34903c['options']?_0x34903c[_0x9110('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x34903c[_0x9110('0x1a')]?_0x34903c[_0x9110('0x1a')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x9110('0x1e'),db['sequelize']['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x9110('0x21')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db['sequelize']['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x22')))),_0x9110('0x23')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x24')))),_0x9110('0x25')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x26'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x27')))),_0x9110('0x28')],[db[_0x9110('0x1f')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x9110('0x1f')]['literal'](_0x9110('0x29')))),_0x9110('0x2a')]]})[_0x9110('0xb')](function(_0x34d085){logger[_0x9110('0xc')](_0x9110('0x1c'),_0x34903c);logger[_0x9110('0xd')](_0x9110('0x1c'),_0x34903c,JSON[_0x9110('0x10')](_0x34d085));_0x10759b(_0x34d085);})[_0x9110('0x2b')](function(_0x20e8b2){logger['error'](_0x9110('0x1c'),_0x20e8b2['message'],_0x34903c);_0x5aa7a1(_0x2a6f17[_0x9110('0x11')](0x1f4,_0x20e8b2[_0x9110('0x13')]));});});};exports[_0x9110('0x2c')]=function(_0x3b582c){var _0x4579ce=this;return new Promise(function(_0x240eac,_0x411d29){return db[_0x9110('0x17')][_0x9110('0x1d')]({'raw':_0x3b582c[_0x9110('0x1a')]?_0x3b582c[_0x9110('0x1a')][_0x9110('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b582c[_0x9110('0x1a')]?_0x3b582c['options']['where']||null:null,'attributes':[['campaign',_0x9110('0x2d')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db['sequelize'][_0x9110('0x20')](_0x9110('0x2e')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x2f')))),_0x9110('0x30')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x31')))),_0x9110('0x32')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x33')))),_0x9110('0x34')],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x35')))),_0x9110('0x36')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9110('0x37')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db['sequelize']['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),_0x9110('0x38')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x39')))),_0x9110('0x3a')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')]['literal'](_0x9110('0x3b')))),_0x9110('0x3c')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x9110('0x1f')]['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db['sequelize'][_0x9110('0x20')](_0x9110('0x3d')))),'outboundAnswerAgiCallsDay'],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')]['literal'](_0x9110('0x3e')))),_0x9110('0x3f')],[db['sequelize']['fn'](_0x9110('0x1e'),db['sequelize']['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x40')))),_0x9110('0x41')]],'group':[_0x9110('0x42')]})[_0x9110('0xb')](function(_0x48d4df){logger['info'](_0x9110('0x2c'),_0x3b582c);logger['debug'](_0x9110('0x2c'),_0x3b582c,JSON['stringify'](_0x48d4df));_0x240eac(_0x48d4df);})['catch'](function(_0x25d800){logger[_0x9110('0x11')]('GetVoiceQueueHopperHistory',_0x25d800[_0x9110('0x13')],_0x3b582c);_0x411d29(_0x4579ce[_0x9110('0x11')](0x1f4,_0x25d800[_0x9110('0x13')]));});});};exports[_0x9110('0x43')]=function(_0x214b83){var _0x107130=this;return new Promise(function(_0x4bae4c,_0x43f009){return db['CmHopperHistory'][_0x9110('0x1d')]({'raw':_0x214b83['options']?_0x214b83[_0x9110('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x214b83['options']?_0x214b83[_0x9110('0x1a')][_0x9110('0x44')]||null:null,'attributes':[[_0x9110('0x42'),_0x9110('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')][_0x9110('0x45')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db['sequelize'][_0x9110('0x20')](_0x9110('0x2f')))),_0x9110('0x46')]],'group':['campaign']})[_0x9110('0xb')](function(_0x5a0def){logger[_0x9110('0xc')](_0x9110('0x43'),_0x214b83);logger[_0x9110('0xd')](_0x9110('0x43'),_0x214b83,JSON[_0x9110('0x10')](_0x5a0def));_0x4bae4c(_0x5a0def);})['catch'](function(_0xa27acf){logger['error']('GetCampaignHopperHistory',_0xa27acf[_0x9110('0x13')],_0x214b83);_0x43f009(_0x107130[_0x9110('0x11')](0x1f4,_0xa27acf['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 2c11e04..6bafc96 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 _0xafe0=['update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put'];(function(_0x615dec,_0x2cf0c0){var _0x44c386=function(_0x2b3a81){while(--_0x2b3a81){_0x615dec['push'](_0x615dec['shift']());}};_0x44c386(++_0x2cf0c0);}(_0xafe0,0x191));var _0x0afe=function(_0x236770,_0x8553){_0x236770=_0x236770-0x0;var _0x521ffd=_0xafe0[_0x236770];return _0x521ffd;};'use strict';var multer=require('multer');var util=require(_0x0afe('0x0'));var path=require(_0x0afe('0x1'));var timeout=require(_0x0afe('0x2'));var express=require(_0x0afe('0x3'));var router=express['Router']();var fs_extra=require(_0x0afe('0x4'));var auth=require(_0x0afe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0afe('0x6'));var controller=require(_0x0afe('0x7'));router[_0x0afe('0x8')]('/',auth[_0x0afe('0x9')](),controller['index']);router[_0x0afe('0x8')](_0x0afe('0xa'),auth[_0x0afe('0x9')](),controller[_0x0afe('0xb')]);router['get'](_0x0afe('0xc'),auth[_0x0afe('0x9')](),controller[_0x0afe('0xd')]);router[_0x0afe('0xe')]('/',auth[_0x0afe('0x9')](),controller[_0x0afe('0xf')]);router[_0x0afe('0x10')](_0x0afe('0xc'),auth[_0x0afe('0x9')](),controller[_0x0afe('0x11')]);module[_0x0afe('0x12')]=router; \ No newline at end of file +var _0xe9fb=['post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','show'];(function(_0x311aa6,_0x5c99d0){var _0x3039c5=function(_0x14518e){while(--_0x14518e){_0x311aa6['push'](_0x311aa6['shift']());}};_0x3039c5(++_0x5c99d0);}(_0xe9fb,0x6a));var _0xbe9f=function(_0x22655c,_0x539b9a){_0x22655c=_0x22655c-0x0;var _0x138bbc=_0xe9fb[_0x22655c];return _0x138bbc;};'use strict';var multer=require(_0xbe9f('0x0'));var util=require(_0xbe9f('0x1'));var path=require(_0xbe9f('0x2'));var timeout=require(_0xbe9f('0x3'));var express=require(_0xbe9f('0x4'));var router=express[_0xbe9f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbe9f('0x6'));var interaction=require(_0xbe9f('0x7'));var config=require(_0xbe9f('0x8'));var controller=require(_0xbe9f('0x9'));router[_0xbe9f('0xa')]('/',auth[_0xbe9f('0xb')](),controller[_0xbe9f('0xc')]);router['get']('/describe',auth[_0xbe9f('0xb')](),controller['describe']);router[_0xbe9f('0xa')]('/:id',auth[_0xbe9f('0xb')](),controller[_0xbe9f('0xd')]);router[_0xbe9f('0xe')]('/',auth[_0xbe9f('0xb')](),controller[_0xbe9f('0xf')]);router[_0xbe9f('0x10')](_0xbe9f('0x11'),auth[_0xbe9f('0xb')](),controller[_0xbe9f('0x12')]);module[_0xbe9f('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 232f682..753d550 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 _0x57cf=['exports','STRING','name','sequelize'];(function(_0x39ed50,_0x5df36b){var _0x578a23=function(_0xb3eca){while(--_0xb3eca){_0x39ed50['push'](_0x39ed50['shift']());}};_0x578a23(++_0x5df36b);}(_0x57cf,0x11b));var _0xf57c=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0x57cf[_0x23ec06];return _0x2831d4;};'use strict';var Sequelize=require(_0xf57c('0x0'));module[_0xf57c('0x1')]={'name':{'type':Sequelize[_0xf57c('0x2')],'unique':_0xf57c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf57c('0x2')]},'dialPrefix':{'type':Sequelize[_0xf57c('0x2')]}}; \ No newline at end of file +var _0xd4d1=['exports','STRING','name','sequelize'];(function(_0x109417,_0x45c6f3){var _0x11e088=function(_0x4eadbf){while(--_0x4eadbf){_0x109417['push'](_0x109417['shift']());}};_0x11e088(++_0x45c6f3);}(_0xd4d1,0x123));var _0x1d4d=function(_0x1057c4,_0x1c302d){_0x1057c4=_0x1057c4-0x0;var _0x2cb1bc=_0xd4d1[_0x1057c4];return _0x2cb1bc;};'use strict';var Sequelize=require(_0x1d4d('0x0'));module[_0x1d4d('0x1')]={'name':{'type':Sequelize[_0x1d4d('0x2')],'unique':_0x1d4d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1d4d('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 1ace3a1..099aeb3 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 _0x5ff7=['BOOLEAN','addColumn','cm_contacts','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','info','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','reject','save','then','Lists','destroy','end','error','stack','name','CmList','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','keys','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','describe','ListId','Disposition','findOne','order','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','raw','getContactsCsv','OrderBy','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','each','toString','now','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch'];(function(_0x2cb5ff,_0x2900fe){var _0x1bb7fd=function(_0x345622){while(--_0x345622){_0x2cb5ff['push'](_0x2cb5ff['shift']());}};_0x1bb7fd(++_0x2900fe);}(_0x5ff7,0xa3));var _0x75ff=function(_0x3d5781,_0x12944f){_0x3d5781=_0x3d5781-0x0;var _0x17c186=_0x5ff7[_0x3d5781];return _0x17c186;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x75ff('0x0'));var jsonpatch=require(_0x75ff('0x1'));var rp=require(_0x75ff('0x2'));var moment=require(_0x75ff('0x3'));var BPromise=require(_0x75ff('0x4'));var Mustache=require(_0x75ff('0x5'));var util=require(_0x75ff('0x6'));var path=require(_0x75ff('0x7'));var sox=require('sox');var csv=require(_0x75ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75ff('0x9'));var squel=require(_0x75ff('0xa'));var crypto=require(_0x75ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x75ff('0xc'));var toCsv=require(_0x75ff('0x8'));var querystring=require('querystring');var Papa=require(_0x75ff('0xd'));var Redis=require(_0x75ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x75ff('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x75ff('0x10'));var utils=require(_0x75ff('0x11'));var config=require(_0x75ff('0x12'));var licenseUtil=require(_0x75ff('0x13'));var db=require(_0x75ff('0x14'))['db'];var csv_results;config[_0x75ff('0x15')]=_[_0x75ff('0x16')](config[_0x75ff('0x15')],{'host':_0x75ff('0x17'),'port':0x18eb});var socket=require(_0x75ff('0x18'))(new Redis(config[_0x75ff('0x15')]));require(_0x75ff('0x19'))[_0x75ff('0x1a')](socket);function respondWithStatusCode(_0x5bd679,_0x3fe126){_0x3fe126=_0x3fe126||0xcc;return function(_0x76a479){if(_0x76a479){return _0x5bd679[_0x75ff('0x1b')](_0x3fe126);}return _0x5bd679[_0x75ff('0x1c')](_0x3fe126)['end']();};}function respondWithResult(_0x1cfb58,_0x5e50bb){_0x5e50bb=_0x5e50bb||0xc8;return function(_0x1f09ef){if(_0x1f09ef){return _0x1cfb58[_0x75ff('0x1c')](_0x5e50bb)[_0x75ff('0x1d')](_0x1f09ef);}};}function respondWithFilteredResult(_0x23a760,_0x4f8703){return function(_0x201db9){if(_0x201db9){var _0x49c611=typeof _0x4f8703['offset']==='undefined'&&typeof _0x4f8703[_0x75ff('0x1e')]===_0x75ff('0x1f');var _0x1f8fd1=_0x201db9[_0x75ff('0x20')];var _0x209e49=_0x49c611?0x0:_0x4f8703[_0x75ff('0x21')];var _0x26f654=_0x49c611?_0x201db9[_0x75ff('0x20')]:_0x4f8703['offset']+_0x4f8703[_0x75ff('0x1e')];var _0x28d6e7;if(_0x26f654>=_0x1f8fd1){_0x26f654=_0x1f8fd1;_0x28d6e7=0xc8;}else{_0x28d6e7=0xce;}_0x23a760['status'](_0x28d6e7);return _0x23a760[_0x75ff('0x22')]('Content-Range',_0x209e49+'-'+_0x26f654+'/'+_0x1f8fd1)[_0x75ff('0x1d')](_0x201db9);}return null;};}function patchUpdates(_0x465783){return function(_0x3bdca3){try{jsonpatch['apply'](_0x3bdca3,_0x465783,!![]);}catch(_0x25b0ca){return BPromise[_0x75ff('0x23')](_0x25b0ca);}return _0x3bdca3[_0x75ff('0x24')]();};}function saveUpdates(_0x58a656,_0x3c8d87){return function(_0x81be49){if(_0x81be49){return _0x81be49['update'](_0x58a656)[_0x75ff('0x25')](function(_0x2984da){return _0x2984da;});}return null;};}function removeEntity(_0xaaaa0b,_0x3cbaff){return function(_0x19a898){if(_0x19a898){return _0x19a898['destroy']()['then'](function(){var _0x55df05=_0x19a898['get']({'plain':!![]});var _0x1bbe6e=_0x75ff('0x26');return db['UserProfileResource'][_0x75ff('0x27')]({'where':{'type':_0x1bbe6e,'resourceId':_0x55df05['id']}})[_0x75ff('0x25')](function(){return _0x19a898;});})[_0x75ff('0x25')](function(){_0xaaaa0b[_0x75ff('0x1c')](0xcc)[_0x75ff('0x28')]();});}};}function handleEntityNotFound(_0x19a27d,_0x2c1a94){return function(_0x1c45d8){if(!_0x1c45d8){_0x19a27d[_0x75ff('0x1b')](0x194);}return _0x1c45d8;};}function handleError(_0x3cc287,_0x11daeb){_0x11daeb=_0x11daeb||0x1f4;return function(_0x3906d1){logger[_0x75ff('0x29')](_0x3906d1[_0x75ff('0x2a')]);if(_0x3906d1[_0x75ff('0x2b')]){delete _0x3906d1[_0x75ff('0x2b')];}_0x3cc287[_0x75ff('0x1c')](_0x11daeb)['send'](_0x3906d1);};}exports['index']=function(_0x27709d,_0x98fd2d){var _0x5da72a={},_0x34dbd6={},_0x2e29e0={'count':0x0,'rows':[]};var _0x5a397f=_['map'](db[_0x75ff('0x2c')]['rawAttributes'],function(_0x3db89b){return{'name':_0x3db89b[_0x75ff('0x2d')],'type':_0x3db89b[_0x75ff('0x2e')][_0x75ff('0x2f')]};});_0x34dbd6[_0x75ff('0x30')]=_[_0x75ff('0x31')](_0x5a397f,_0x75ff('0x2b'));_0x34dbd6[_0x75ff('0x32')]=_['keys'](_0x27709d[_0x75ff('0x32')]);_0x34dbd6[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0x34dbd6['model'],_0x34dbd6['query']);_0x5da72a[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x34dbd6[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x27709d[_0x75ff('0x32')][_0x75ff('0x36')]));_0x5da72a[_0x75ff('0x35')]=_0x5da72a[_0x75ff('0x35')]['length']?_0x5da72a[_0x75ff('0x35')]:_0x34dbd6[_0x75ff('0x30')];if(!_0x27709d[_0x75ff('0x32')][_0x75ff('0x37')](_0x75ff('0x38'))){_0x5da72a[_0x75ff('0x1e')]=qs['limit'](_0x27709d[_0x75ff('0x32')][_0x75ff('0x1e')]);_0x5da72a[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0x27709d['query'][_0x75ff('0x21')]);}_0x5da72a['order']=qs[_0x75ff('0x39')](_0x27709d['query'][_0x75ff('0x39')]);_0x5da72a[_0x75ff('0x3a')]=qs[_0x75ff('0x33')](_[_0x75ff('0x3b')](_0x27709d['query'],_0x34dbd6[_0x75ff('0x33')]),_0x5a397f);if(_0x27709d[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x5da72a[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x5da72a[_0x75ff('0x3a')],{'$or':_[_0x75ff('0x31')](_0x5a397f,function(_0x52a6a3){if(_0x52a6a3['type']!==_0x75ff('0x3e')){var _0x332976={};_0x332976[_0x52a6a3[_0x75ff('0x2b')]]={'$like':'%'+_0x27709d[_0x75ff('0x32')]['filter']+'%'};return _0x332976;}})});}_0x5da72a=_['merge']({},_0x5da72a,_0x27709d[_0x75ff('0x3f')]);var _0x4a413b={'where':_0x5da72a[_0x75ff('0x3a')]};return db[_0x75ff('0x2c')]['count'](_0x4a413b)['then'](function(_0x26f309){_0x2e29e0[_0x75ff('0x20')]=_0x26f309;if(_0x27709d[_0x75ff('0x32')][_0x75ff('0x40')]){_0x5da72a['include']=[{'all':!![]}];}return db[_0x75ff('0x2c')][_0x75ff('0x41')](_0x5da72a);})[_0x75ff('0x25')](function(_0x6934a8){_0x2e29e0[_0x75ff('0x42')]=_0x6934a8;return _0x2e29e0;})[_0x75ff('0x25')](respondWithFilteredResult(_0x98fd2d,_0x5da72a))[_0x75ff('0x43')](handleError(_0x98fd2d,null));};exports['show']=function(_0xd805ff,_0x459209){var _0x51136d={'raw':![],'where':{'id':_0xd805ff[_0x75ff('0x44')]['id']}},_0x4445c6={};_0x4445c6[_0x75ff('0x30')]=_['keys'](db['CmList'][_0x75ff('0x45')]);_0x4445c6[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0xd805ff['query']);_0x4445c6[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0x4445c6['model'],_0x4445c6[_0x75ff('0x32')]);_0x51136d[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x4445c6[_0x75ff('0x30')],qs['fields'](_0xd805ff[_0x75ff('0x32')][_0x75ff('0x36')]));_0x51136d[_0x75ff('0x35')]=_0x51136d['attributes'][_0x75ff('0x47')]?_0x51136d['attributes']:_0x4445c6[_0x75ff('0x30')];if(_0xd805ff[_0x75ff('0x32')][_0x75ff('0x40')]){_0x51136d[_0x75ff('0x48')]=[{'all':!![]}];}_0x51136d=_['merge']({},_0x51136d,_0xd805ff[_0x75ff('0x3f')]);return db['CmList'][_0x75ff('0x49')](_0x51136d)[_0x75ff('0x25')](handleEntityNotFound(_0x459209,null))['then'](respondWithResult(_0x459209,null))[_0x75ff('0x43')](handleError(_0x459209,null));};exports[_0x75ff('0x4a')]=function(_0x3a2c63,_0x5e789){return db['CmList'][_0x75ff('0x4a')](_0x3a2c63[_0x75ff('0x4b')],{})[_0x75ff('0x25')](function(_0x9df485){var _0xfa4168=_0x3a2c63[_0x75ff('0x4c')][_0x75ff('0x4d')]({'plain':!![]});if(!_0xfa4168)throw new Error(_0x75ff('0x4e'));if(_0xfa4168['role']===_0x75ff('0x4c')){var _0x50ebd7=_0x9df485['get']({'plain':!![]});var _0x2e8310=_0x75ff('0x26');return db[_0x75ff('0x4f')]['find']({'where':{'name':_0x2e8310,'userProfileId':_0xfa4168[_0x75ff('0x50')]},'raw':!![]})[_0x75ff('0x25')](function(_0x597274){if(_0x597274&&_0x597274[_0x75ff('0x51')]===0x0){return db['UserProfileResource'][_0x75ff('0x4a')]({'name':_0x50ebd7[_0x75ff('0x2b')],'resourceId':_0x50ebd7['id'],'type':_0x597274['name'],'sectionId':_0x597274['id']},{})[_0x75ff('0x25')](function(){return _0x9df485;});}else{return _0x9df485;}})['catch'](function(_0x518bf2){logger[_0x75ff('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x518bf2);throw _0x518bf2;});}return _0x9df485;})[_0x75ff('0x25')](respondWithResult(_0x5e789,0xc9))[_0x75ff('0x43')](handleError(_0x5e789,null));};exports[_0x75ff('0x52')]=function(_0x33154c,_0xef7a55){if(_0x33154c['body']['id']){delete _0x33154c['body']['id'];}return db[_0x75ff('0x2c')]['find']({'where':{'id':_0x33154c['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0xef7a55,null))[_0x75ff('0x25')](saveUpdates(_0x33154c[_0x75ff('0x4b')],null))[_0x75ff('0x25')](respondWithResult(_0xef7a55,null))[_0x75ff('0x43')](handleError(_0xef7a55,null));};exports[_0x75ff('0x27')]=function(_0x28b710,_0x370e6f){return db['CmList']['find']({'where':{'id':_0x28b710[_0x75ff('0x44')]['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x370e6f,null))[_0x75ff('0x25')](removeEntity(_0x370e6f,null))[_0x75ff('0x43')](handleError(_0x370e6f,null));};exports[_0x75ff('0x53')]=function(_0x1123f0,_0x50d09b){return db[_0x75ff('0x2c')]['describe']()[_0x75ff('0x25')](respondWithResult(_0x50d09b,null))['catch'](handleError(_0x50d09b,null));};exports['addDisposition']=function(_0x51f0df,_0x516440,_0x455df4){if(_0x51f0df['body']['id']){delete _0x51f0df[_0x75ff('0x4b')]['id'];}return db[_0x75ff('0x2c')][_0x75ff('0x49')]({'where':{'id':_0x51f0df['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x516440,null))[_0x75ff('0x25')](function(_0x395f75){if(_0x395f75){_0x51f0df[_0x75ff('0x4b')][_0x75ff('0x54')]=_0x395f75['id'];return db[_0x75ff('0x55')]['create'](_0x51f0df[_0x75ff('0x4b')]);}})[_0x75ff('0x25')](respondWithResult(_0x516440,null))[_0x75ff('0x43')](handleError(_0x516440,null));};exports['getDispositions']=function(_0x4b98ac,_0x5975af,_0x578d90){var _0x1b622b={'raw':![],'where':{}};var _0x22ce28={};var _0x3f25f0={'count':0x0,'rows':[]};return db[_0x75ff('0x2c')][_0x75ff('0x56')]({'where':{'id':_0x4b98ac[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x5975af,null))['then'](function(_0x533154){if(_0x533154){_0x22ce28[_0x75ff('0x30')]=_[_0x75ff('0x46')](db[_0x75ff('0x55')]['rawAttributes']);_0x22ce28[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0x4b98ac[_0x75ff('0x32')]);_0x22ce28[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0x22ce28[_0x75ff('0x30')],_0x22ce28[_0x75ff('0x32')]);_0x1b622b[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x22ce28[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x4b98ac[_0x75ff('0x32')]['fields']));_0x1b622b[_0x75ff('0x35')]=_0x1b622b[_0x75ff('0x35')]['length']?_0x1b622b[_0x75ff('0x35')]:_0x22ce28[_0x75ff('0x30')];if(!_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x37')](_0x75ff('0x38'))){_0x1b622b['limit']=qs[_0x75ff('0x1e')](_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x1e')]);_0x1b622b[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0x4b98ac[_0x75ff('0x32')]['offset']);}_0x1b622b[_0x75ff('0x57')]=qs['sort'](_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x39')]);_0x1b622b[_0x75ff('0x3a')]=qs[_0x75ff('0x33')](_[_0x75ff('0x3b')](_0x4b98ac['query'],_0x22ce28['filters']));_0x1b622b['where'][_0x75ff('0x54')]=_0x533154['id'];if(_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x1b622b[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x1b622b[_0x75ff('0x3a')],{'$or':_[_0x75ff('0x31')](_0x1b622b[_0x75ff('0x35')],function(_0x5d3aad){var _0x1d7462={};_0x1d7462[_0x5d3aad]={'$like':'%'+_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x3c')]+'%'};return _0x1d7462;})});}_0x1b622b=_[_0x75ff('0x3d')]({},_0x1b622b,_0x4b98ac[_0x75ff('0x3f')]);return db[_0x75ff('0x55')][_0x75ff('0x20')]({'where':_0x1b622b['where']})[_0x75ff('0x25')](function(_0x439ed5){_0x3f25f0[_0x75ff('0x20')]=_0x439ed5;if(_0x4b98ac['query'][_0x75ff('0x40')]){_0x1b622b[_0x75ff('0x48')]=[{'all':!![]}];}return db[_0x75ff('0x55')][_0x75ff('0x41')](_0x1b622b);})[_0x75ff('0x25')](function(_0x594132){_0x3f25f0[_0x75ff('0x42')]=_0x594132;return _0x3f25f0;});}})[_0x75ff('0x25')](respondWithFilteredResult(_0x5975af,_0x1b622b))[_0x75ff('0x43')](handleError(_0x5975af,null));};exports[_0x75ff('0x58')]=function(_0x22244a,_0x516bfe,_0x15d367){return db['CmList']['find']({'where':{'id':_0x22244a['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x516bfe,null))[_0x75ff('0x25')](function(_0x18676a){if(_0x18676a){return _0x18676a[_0x75ff('0x58')](_0x22244a[_0x75ff('0x32')][_0x75ff('0x59')]);}})[_0x75ff('0x25')](respondWithStatusCode(_0x516bfe,null))['catch'](handleError(_0x516bfe,null));};exports[_0x75ff('0x5a')]=function(_0x7c6815,_0xf1a5cf,_0x1542f5){return db[_0x75ff('0x2c')][_0x75ff('0x49')]({'where':{'id':_0x7c6815[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0xf1a5cf,null))[_0x75ff('0x25')](function(_0x512369){if(_0x512369){var _0xe18a2f=[];var _0xadafee={'success':[],'errors':[]};return db[_0x75ff('0x5b')]['describe']()['then'](function(_0x53b997){if(_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')]&&_[_0x75ff('0x5d')](_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')])){if(_0x7c6815['body']['tags']['length']){_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')]=_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')][_0x75ff('0x5e')](';')+';';}else{_0x7c6815['body'][_0x75ff('0x5c')]=null;}}else{_0x7c6815['body'][_0x75ff('0x5c')]=null;}if(_0x7c6815[_0x75ff('0x4b')]&&_[_0x75ff('0x5d')](_0x7c6815[_0x75ff('0x4b')])){for(var _0x545c8c=0x0;_0x545c8c<_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x47')];_0x545c8c+=0x1){_0x7c6815['body'][_0x545c8c][_0x75ff('0x54')]=_0x7c6815['params']['id'];_0xe18a2f[_0x75ff('0x5f')](_0x7c6815['body'][_0x545c8c]);}return BPromise['each'](_0xe18a2f,function(_0x5c0262){return db[_0x75ff('0x5b')][_0x75ff('0x4a')](_[_0x75ff('0x60')](_0x5c0262,['ids','id'])||{},{'fields':_[_0x75ff('0x46')](_0x53b997),'raw':!![]})[_0x75ff('0x25')](function(_0x1b55ac){_0xadafee[_0x75ff('0x61')][_0x75ff('0x5f')](_0x1b55ac[_0x75ff('0x62')]);})['catch'](function(_0x491977){_0xadafee[_0x75ff('0x63')][_0x75ff('0x5f')]({'data':_0x5c0262,'error':_0x491977[_0x75ff('0x64')]});});})[_0x75ff('0x25')](function(_0xf77933){return _0xadafee;})[_0x75ff('0x43')](function(_0x29aa12){return _0x29aa12;});}else{_0xf1a5cf[_0x75ff('0x1c')](0x190)['json']({'message':_0x75ff('0x65')});}});}})[_0x75ff('0x25')](respondWithResult(_0xf1a5cf,null))[_0x75ff('0x43')](handleError(_0xf1a5cf,null));};exports[_0x75ff('0x66')]=function(_0x1a62ed,_0x57d33b,_0x548d7b){var _0x751459;return db[_0x75ff('0x2c')][_0x75ff('0x49')]({'where':{'id':_0x1a62ed[_0x75ff('0x44')]['id']},'include':[{'model':db[_0x75ff('0x67')],'as':'CustomFields'}]})[_0x75ff('0x25')](handleEntityNotFound(_0x57d33b,null))['then'](function(_0x363f30){if(_0x363f30){_0x751459=_0x363f30;return db['CmContact'][_0x75ff('0x45')];}})['then'](function(_0x2db968){if(_0x2db968){var _0x3b54f0={};var _0xf2e1d8={};_0xf2e1d8[_0x75ff('0x30')]=_[_0x75ff('0x68')](_[_0x75ff('0x46')](_0x2db968),_[_0x75ff('0x31')](_0x751459[_0x75ff('0x69')],function(_0x1f69be){return util[_0x75ff('0x6a')]('cf_%d',_0x1f69be['id']);}));_0xf2e1d8[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0x1a62ed[_0x75ff('0x32')]);_0xf2e1d8[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0xf2e1d8[_0x75ff('0x30')],_0xf2e1d8[_0x75ff('0x32')]);_0x3b54f0['attributes']=_[_0x75ff('0x34')](_0xf2e1d8[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x1a62ed['query'][_0x75ff('0x36')]));_0x3b54f0[_0x75ff('0x35')]=_0x3b54f0[_0x75ff('0x35')][_0x75ff('0x47')]?_0x3b54f0[_0x75ff('0x35')]:_0xf2e1d8[_0x75ff('0x30')];if(!_0x1a62ed['query']['hasOwnProperty'](_0x75ff('0x38'))){_0x3b54f0[_0x75ff('0x1e')]=qs['limit'](_0x1a62ed['query'][_0x75ff('0x1e')]);_0x3b54f0[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0x1a62ed[_0x75ff('0x32')]['offset']);}_0x3b54f0['order']=qs[_0x75ff('0x39')](_0x1a62ed[_0x75ff('0x32')][_0x75ff('0x39')]);_0x3b54f0[_0x75ff('0x3a')]=qs['filters'](_[_0x75ff('0x3b')](_0x1a62ed['query'],_0xf2e1d8[_0x75ff('0x33')]));_0x3b54f0[_0x75ff('0x6b')]=!![];if(_0x1a62ed[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x3b54f0[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x3b54f0[_0x75ff('0x3a')],{'$or':_['map'](_0x3b54f0['attributes'],function(_0x46b9e3){var _0x40bd46={};_0x40bd46[_0x46b9e3]={'$like':'%'+_0x1a62ed['query']['filter']+'%'};return _0x40bd46;})});}_0x3b54f0=_['merge']({},_0x3b54f0,_0x1a62ed['options']);return _0x751459['getContacts'](_0x3b54f0);}})[_0x75ff('0x25')](respondWithResult(_0x57d33b,null))[_0x75ff('0x43')](handleError(_0x57d33b,null));};exports[_0x75ff('0x6c')]=function(_0x471e33,_0x336936,_0x316dc9){var _0x16e46f;var _0x53d8a9;var _0x5f5e05;var _0x583710=_0x471e33[_0x75ff('0x44')]['id'];csv_results=[];return db['ContactItemType'][_0x75ff('0x41')]({'attributes':['id',_0x75ff('0x2b')],'raw':!![],'order':[_0x75ff('0x6d')]})[_0x75ff('0x25')](function(_0x104fc2){_0x16e46f=_0x104fc2;var _0x10823c=_[_0x75ff('0x46')](db[_0x75ff('0x5b')][_0x75ff('0x45')]);return db['CmCustomField'][_0x75ff('0x41')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x43910b){_0x53d8a9=_0x43910b;var _0x1a2574=squel[_0x75ff('0x6e')]()[_0x75ff('0x36')](_0x10823c)[_0x75ff('0x6f')]('cm_contacts','c')[_0x75ff('0x3a')](_0x75ff('0x70'),_0x583710)['where'](_0x75ff('0x71'))[_0x75ff('0x72')]();for(var _0x1af4c0=0x0;_0x1af4c0<_0x53d8a9['length'];_0x1af4c0++){_0x1a2574[_0x75ff('0x73')](_0x75ff('0x74')+_0x53d8a9[_0x1af4c0]['id'],_0x75ff('0x75')+_0x53d8a9[_0x1af4c0][_0x75ff('0x76')]);}for(var _0x1af4c0=0x0;_0x1af4c0<_0x16e46f[_0x75ff('0x47')];_0x1af4c0++){_0x1a2574['field'](squel[_0x75ff('0x6e')]()[_0x75ff('0x73')]('item')[_0x75ff('0x6f')](_0x75ff('0x77'))['where'](_0x75ff('0x78'),_0x16e46f[_0x1af4c0]['id'])['where']('CmContactId\x20=\x20c.id'),_0x75ff('0x79')+_0x16e46f[_0x1af4c0][_0x75ff('0x2b')]);_0x1a2574[_0x75ff('0x73')](squel[_0x75ff('0x6e')]()[_0x75ff('0x73')](_0x75ff('0x7a'))[_0x75ff('0x6f')](_0x75ff('0x77'))['where'](_0x75ff('0x78'),_0x16e46f[_0x1af4c0]['id'])['where']('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x16e46f[_0x1af4c0][_0x75ff('0x2b')]);}var _0x2348b1=[];_0x2348b1[_0x75ff('0x5f')](_0x1a2574['toString']());BPromise[_0x75ff('0x7b')](_0x2348b1,handleQuery)[_0x75ff('0x25')](function(_0x325fa1){handleQuery(_0x1a2574[_0x75ff('0x7c')]());var _0x3217c2=csv_results[0x0];if(!_['isEmpty'](_0x3217c2)){var _0x71c036=toCsv(_0x3217c2);var _0xb4d3af=Date[_0x75ff('0x7d')]();fs['writeFileSync'](util[_0x75ff('0x6a')](_0x75ff('0x7e'),_0x583710,_0xb4d3af),_0x71c036);_0x336936['setHeader'](_0x75ff('0x7f'),_0x75ff('0x80')+util[_0x75ff('0x6a')]('list_%d_%s.csv',_0x583710,_0xb4d3af));_0x336936[_0x75ff('0x81')](_0x75ff('0x82'),_0x75ff('0x83'));return _0x336936[_0x75ff('0x84')](util['format'](_0x75ff('0x7e'),_0x583710,_0xb4d3af));}else{return _0x336936[_0x75ff('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x56854d,_0x50f409,_0x48a82f){var _0xe9174;delete _0x56854d[_0x75ff('0x4b')]['id'];return db[_0x75ff('0x2c')][_0x75ff('0x56')]({'where':{'id':_0x56854d[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x50f409,null))[_0x75ff('0x25')](function(_0xa51ca7){if(_0xa51ca7){return db[_0x75ff('0x85')][_0x75ff('0x86')](function(_0x1a9888){return db[_0x75ff('0x67')]['create'](_0x56854d[_0x75ff('0x4b')],{'transaction':_0x1a9888})['then'](function(_0x12eb59){_0xe9174=_0x12eb59;return _0xa51ca7[_0x75ff('0x87')](_0x12eb59,{'transaction':_0x1a9888});})[_0x75ff('0x25')](function(){var _0x158dd4={'type':db[_0x75ff('0x88')][_0x75ff('0x89')],'transaction':_0x1a9888};switch(_0x56854d[_0x75ff('0x4b')]['type']){case'text':_0x158dd4['type']=db[_0x75ff('0x88')][_0x75ff('0x89')];break;case _0x75ff('0x8a'):_0x158dd4[_0x75ff('0x2e')]=db['Sequelize'][_0x75ff('0x8b')];break;case _0x75ff('0x8c'):_0x158dd4['type']=db['Sequelize'][_0x75ff('0x8d')];_0x158dd4['defaultValue']=![];break;default:}return db[_0x75ff('0x85')]['queryInterface'][_0x75ff('0x8e')](_0x75ff('0x8f'),util[_0x75ff('0x6a')]('cf_%s',_0xe9174['id']),_0x158dd4);})[_0x75ff('0x25')](function(){return _0xe9174;});});}})[_0x75ff('0x25')](respondWithResult(_0x50f409,null))[_0x75ff('0x43')](handleError(_0x50f409,null));};exports[_0x75ff('0x90')]=function(_0x5adbf3,_0x3615db,_0x3af767){var _0x5bf841={};var _0x1ae981={};var _0x5c3f0c;var _0x3cb757;return db[_0x75ff('0x2c')][_0x75ff('0x56')]({'where':{'id':_0x5adbf3[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x3615db,null))[_0x75ff('0x25')](function(_0x1079f4){if(_0x1079f4){_0x5c3f0c=_0x1079f4;_0x1ae981[_0x75ff('0x30')]=_[_0x75ff('0x46')](db['CmCustomField']['rawAttributes']);_0x1ae981[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0x5adbf3[_0x75ff('0x32')]);_0x1ae981['filters']=_[_0x75ff('0x34')](_0x1ae981['model'],_0x1ae981[_0x75ff('0x32')]);_0x5bf841[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x1ae981[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x5adbf3['query'][_0x75ff('0x36')]));_0x5bf841[_0x75ff('0x35')]=_0x5bf841[_0x75ff('0x35')][_0x75ff('0x47')]?_0x5bf841[_0x75ff('0x35')]:_0x1ae981[_0x75ff('0x30')];_0x5bf841[_0x75ff('0x57')]=qs[_0x75ff('0x39')](_0x5adbf3['query']['sort']);_0x5bf841[_0x75ff('0x3a')]=qs['filters'](_['pick'](_0x5adbf3[_0x75ff('0x32')],_0x1ae981['filters']));_0x5bf841['where']=_[_0x75ff('0x3d')](_0x5bf841[_0x75ff('0x3a')],{'$or':[{'ListId':_0x1079f4['id']},{'ListId':null}]});if(_0x5adbf3[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x5bf841[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x5bf841[_0x75ff('0x3a')],{'$or':_['map'](_0x5bf841[_0x75ff('0x35')],function(_0x18a99d){var _0x54fee9={};_0x54fee9[_0x18a99d]={'$like':'%'+_0x5adbf3[_0x75ff('0x32')][_0x75ff('0x3c')]+'%'};return _0x54fee9;})});}_0x5bf841=_[_0x75ff('0x3d')]({},_0x5bf841,_0x5adbf3[_0x75ff('0x3f')]);return db[_0x75ff('0x67')]['findAndCountAll'](_0x5bf841);}})[_0x75ff('0x25')](respondWithResult(_0x3615db,null))[_0x75ff('0x43')](handleError(_0x3615db,null));};exports['getGlobalCustomFields']=function(_0x5af566,_0x145ecb){return db[_0x75ff('0x67')]['findAndCountAll']({'where':{'ListId':null}})[_0x75ff('0x25')](handleEntityNotFound(_0x145ecb,null))[_0x75ff('0x25')](function(_0x466f35){return _0x466f35;})[_0x75ff('0x25')](respondWithResult(_0x145ecb,null))[_0x75ff('0x43')](handleError(_0x145ecb,null));};exports[_0x75ff('0x91')]=function(_0x53e3bf,_0x544875,_0x216594){return db['CmList'][_0x75ff('0x49')]({'where':{'id':_0x53e3bf[_0x75ff('0x44')]['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x544875,null))['then'](function(_0x19cefc){if(_0x19cefc){return _0x19cefc[_0x75ff('0x91')](_0x53e3bf[_0x75ff('0x4b')][_0x75ff('0x59')],_[_0x75ff('0x60')](_0x53e3bf[_0x75ff('0x4b')],[_0x75ff('0x59'),'id'])||{})[_0x75ff('0x92')](function(_0xe73311){for(var _0x45197e=0x0;_0x45197e<_0x53e3bf[_0x75ff('0x4b')][_0x75ff('0x59')]['length'];_0x45197e+=0x1){socket[_0x75ff('0x93')]('userCmList:save',{'UserId':Number(_0x53e3bf[_0x75ff('0x4b')][_0x75ff('0x59')][_0x45197e]),'CmListId':Number(_0x53e3bf[_0x75ff('0x44')]['id'])});}return _0xe73311;});}})[_0x75ff('0x25')](respondWithResult(_0x544875,null))[_0x75ff('0x43')](handleError(_0x544875,null));};exports[_0x75ff('0x94')]=function(_0xeb8a1a,_0x1c76b4,_0x2d2399){return db['CmList'][_0x75ff('0x49')]({'where':{'id':_0xeb8a1a['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x1c76b4,null))[_0x75ff('0x25')](function(_0x391a06){if(_0x391a06){return _0x391a06['removeAgents'](_0xeb8a1a[_0x75ff('0x32')]['ids'])[_0x75ff('0x25')](function(){if(_[_0x75ff('0x5d')](_0xeb8a1a[_0x75ff('0x32')][_0x75ff('0x59')])){for(var _0x171e62=0x0;_0x171e62<_0xeb8a1a['query'][_0x75ff('0x59')][_0x75ff('0x47')];_0x171e62+=0x1){socket['emit'](_0x75ff('0x95'),{'UserId':Number(_0xeb8a1a['query'][_0x75ff('0x59')][_0x171e62]),'CmListId':Number(_0xeb8a1a[_0x75ff('0x44')]['id'])});}}else{socket[_0x75ff('0x93')](_0x75ff('0x95'),{'UserId':Number(_0xeb8a1a[_0x75ff('0x32')][_0x75ff('0x59')]),'CmListId':Number(_0xeb8a1a[_0x75ff('0x44')]['id'])});}});}})[_0x75ff('0x25')](respondWithStatusCode(_0x1c76b4,null))[_0x75ff('0x43')](handleError(_0x1c76b4,null));};exports['getAgents']=function(_0xbca4f2,_0x53f412,_0x43d67c){var _0x3f3e0f={};var _0xfe5865={};var _0x1d880f;var _0x2bb963;return db['CmList'][_0x75ff('0x56')]({'where':{'id':_0xbca4f2['params']['id']}})['then'](handleEntityNotFound(_0x53f412,null))[_0x75ff('0x25')](function(_0x551e0c){if(_0x551e0c){_0x1d880f=_0x551e0c;_0xfe5865[_0x75ff('0x30')]=_['keys'](db['User']['rawAttributes']);_0xfe5865['query']=_['keys'](_0xbca4f2[_0x75ff('0x32')]);_0xfe5865[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0xfe5865[_0x75ff('0x30')],_0xfe5865[_0x75ff('0x32')]);_0x3f3e0f['attributes']=_['intersection'](_0xfe5865['model'],qs[_0x75ff('0x36')](_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x36')]));_0x3f3e0f[_0x75ff('0x35')]=_0x3f3e0f[_0x75ff('0x35')]['length']?_0x3f3e0f[_0x75ff('0x35')]:_0xfe5865['model'];_0x3f3e0f[_0x75ff('0x57')]=qs[_0x75ff('0x39')](_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x39')]);_0x3f3e0f['where']=qs[_0x75ff('0x33')](_[_0x75ff('0x3b')](_0xbca4f2[_0x75ff('0x32')],_0xfe5865['filters']));if(_0xbca4f2['query'][_0x75ff('0x3c')]){_0x3f3e0f[_0x75ff('0x3a')]=_['merge'](_0x3f3e0f[_0x75ff('0x3a')],{'$or':_[_0x75ff('0x31')](_0x3f3e0f[_0x75ff('0x35')],function(_0x2c6500){var _0x14b956={};_0x14b956[_0x2c6500]={'$like':'%'+_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x3c')]+'%'};return _0x14b956;})});}_0x3f3e0f=_[_0x75ff('0x3d')]({},_0x3f3e0f,_0xbca4f2[_0x75ff('0x3f')]);return _0x1d880f[_0x75ff('0x96')](_0x3f3e0f);}})[_0x75ff('0x25')](function(_0x1d4848){if(_0x1d4848){_0x2bb963=_0x1d4848[_0x75ff('0x47')];if(!_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x37')]('nolimit')){_0x3f3e0f[_0x75ff('0x1e')]=qs[_0x75ff('0x1e')](_0xbca4f2[_0x75ff('0x32')]['limit']);_0x3f3e0f[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0xbca4f2['query'][_0x75ff('0x21')]);}return _0x1d880f[_0x75ff('0x96')](_0x3f3e0f);}})['then'](function(_0x427fa1){if(_0x427fa1){return _0x427fa1?{'count':_0x2bb963,'rows':_0x427fa1}:null;}})[_0x75ff('0x25')](respondWithResult(_0x53f412,null))[_0x75ff('0x43')](handleError(_0x53f412,null));};function handleQuery(_0x443e2d){logger[_0x75ff('0x97')](_0x443e2d);return db[_0x75ff('0x85')][_0x75ff('0x32')](_0x443e2d)[_0x75ff('0x92')](function(_0x5d3c31){csv_results['push'](_0x5d3c31);})['catch'](function(_0x4e6daf){logger[_0x75ff('0x29')](_0x4e6daf['message']);});} \ No newline at end of file +var _0xb5c9=['query','filters','intersection','fields','attributes','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','nolimit','order','rows','removeDispositions','addContacts','tags','join','isArray','omit','ids','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','hasOwnProperty','raw','ContactItemType','OrderBy','CmContact','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','select','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','ItemTypeId\x20=\x20?','toString','isEmpty','now','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sendStatus','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','BOOLEAN','defaultValue','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','getAgents','User','info','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model'];(function(_0x45b248,_0x1fd5a9){var _0x3c2880=function(_0x46ea13){while(--_0x46ea13){_0x45b248['push'](_0x45b248['shift']());}};_0x3c2880(++_0x1fd5a9);}(_0xb5c9,0x69));var _0x9b5c=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb5c9[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0x9b5c('0x0'));var rimraf=require(_0x9b5c('0x1'));var zipdir=require(_0x9b5c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b5c('0x3'));var BPromise=require(_0x9b5c('0x4'));var Mustache=require(_0x9b5c('0x5'));var util=require('util');var path=require(_0x9b5c('0x6'));var sox=require(_0x9b5c('0x7'));var csv=require(_0x9b5c('0x8'));var ejs=require(_0x9b5c('0x9'));var fs=require('fs');var fs_extra=require(_0x9b5c('0xa'));var _=require('lodash');var squel=require(_0x9b5c('0xb'));var crypto=require('crypto');var jsforce=require(_0x9b5c('0xc'));var deskjs=require(_0x9b5c('0xd'));var toCsv=require(_0x9b5c('0x8'));var querystring=require(_0x9b5c('0xe'));var Papa=require(_0x9b5c('0xf'));var Redis=require(_0x9b5c('0x10'));var authService=require(_0x9b5c('0x11'));var qs=require(_0x9b5c('0x12'));var as=require(_0x9b5c('0x13'));var hardwareService=require(_0x9b5c('0x14'));var logger=require(_0x9b5c('0x15'))(_0x9b5c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9b5c('0x17'));var db=require(_0x9b5c('0x18'))['db'];var csv_results;config[_0x9b5c('0x19')]=_[_0x9b5c('0x1a')](config[_0x9b5c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b5c('0x1b'))(new Redis(config[_0x9b5c('0x19')]));require(_0x9b5c('0x1c'))[_0x9b5c('0x1d')](socket);function respondWithStatusCode(_0x49b486,_0x3af00a){_0x3af00a=_0x3af00a||0xcc;return function(_0x5ea229){if(_0x5ea229){return _0x49b486['sendStatus'](_0x3af00a);}return _0x49b486[_0x9b5c('0x1e')](_0x3af00a)[_0x9b5c('0x1f')]();};}function respondWithResult(_0x2fd1f6,_0x4405dd){_0x4405dd=_0x4405dd||0xc8;return function(_0x1b6a4e){if(_0x1b6a4e){return _0x2fd1f6['status'](_0x4405dd)[_0x9b5c('0x20')](_0x1b6a4e);}};}function respondWithFilteredResult(_0x3187dc,_0x373036){return function(_0x5e12fa){if(_0x5e12fa){var _0x36762d=typeof _0x373036[_0x9b5c('0x21')]===_0x9b5c('0x22')&&typeof _0x373036[_0x9b5c('0x23')]===_0x9b5c('0x22');var _0x50a74f=_0x5e12fa[_0x9b5c('0x24')];var _0x3f5932=_0x36762d?0x0:_0x373036['offset'];var _0x3ad7bc=_0x36762d?_0x5e12fa[_0x9b5c('0x24')]:_0x373036[_0x9b5c('0x21')]+_0x373036[_0x9b5c('0x23')];var _0x46488c;if(_0x3ad7bc>=_0x50a74f){_0x3ad7bc=_0x50a74f;_0x46488c=0xc8;}else{_0x46488c=0xce;}_0x3187dc[_0x9b5c('0x1e')](_0x46488c);return _0x3187dc[_0x9b5c('0x25')](_0x9b5c('0x26'),_0x3f5932+'-'+_0x3ad7bc+'/'+_0x50a74f)[_0x9b5c('0x20')](_0x5e12fa);}return null;};}function patchUpdates(_0x3cbc81){return function(_0x7ef2f6){try{jsonpatch[_0x9b5c('0x27')](_0x7ef2f6,_0x3cbc81,!![]);}catch(_0x47dd46){return BPromise['reject'](_0x47dd46);}return _0x7ef2f6[_0x9b5c('0x28')]();};}function saveUpdates(_0x1d3bc4,_0x2c0703){return function(_0x5170c2){if(_0x5170c2){return _0x5170c2[_0x9b5c('0x29')](_0x1d3bc4)['then'](function(_0x2576b5){return _0x2576b5;});}return null;};}function removeEntity(_0x31fba1,_0x11e0dd){return function(_0x43cb6b){if(_0x43cb6b){return _0x43cb6b[_0x9b5c('0x2a')]()['then'](function(){var _0x1cb9fb=_0x43cb6b[_0x9b5c('0x2b')]({'plain':!![]});var _0x432fbd='Lists';return db[_0x9b5c('0x2c')]['destroy']({'where':{'type':_0x432fbd,'resourceId':_0x1cb9fb['id']}})[_0x9b5c('0x2d')](function(){return _0x43cb6b;});})[_0x9b5c('0x2d')](function(){_0x31fba1[_0x9b5c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3605ee,_0x4bfd40){return function(_0x1225b5){if(!_0x1225b5){_0x3605ee['sendStatus'](0x194);}return _0x1225b5;};}function handleError(_0x1b09da,_0x10a88f){_0x10a88f=_0x10a88f||0x1f4;return function(_0x176a81){logger[_0x9b5c('0x2e')](_0x176a81[_0x9b5c('0x2f')]);if(_0x176a81[_0x9b5c('0x30')]){delete _0x176a81[_0x9b5c('0x30')];}_0x1b09da[_0x9b5c('0x1e')](_0x10a88f)[_0x9b5c('0x31')](_0x176a81);};}exports[_0x9b5c('0x32')]=function(_0x83bf3d,_0x4c9402){var _0x5eba0b={},_0x4fff39={},_0x33353d={'count':0x0,'rows':[]};var _0x5fed85=_[_0x9b5c('0x33')](db[_0x9b5c('0x34')][_0x9b5c('0x35')],function(_0x3896ce){return{'name':_0x3896ce[_0x9b5c('0x36')],'type':_0x3896ce[_0x9b5c('0x37')][_0x9b5c('0x38')]};});_0x4fff39[_0x9b5c('0x39')]=_['map'](_0x5fed85,_0x9b5c('0x30'));_0x4fff39[_0x9b5c('0x3a')]=_['keys'](_0x83bf3d[_0x9b5c('0x3a')]);_0x4fff39[_0x9b5c('0x3b')]=_['intersection'](_0x4fff39[_0x9b5c('0x39')],_0x4fff39[_0x9b5c('0x3a')]);_0x5eba0b['attributes']=_[_0x9b5c('0x3c')](_0x4fff39['model'],qs[_0x9b5c('0x3d')](_0x83bf3d['query'][_0x9b5c('0x3d')]));_0x5eba0b[_0x9b5c('0x3e')]=_0x5eba0b[_0x9b5c('0x3e')]['length']?_0x5eba0b[_0x9b5c('0x3e')]:_0x4fff39[_0x9b5c('0x39')];if(!_0x83bf3d[_0x9b5c('0x3a')]['hasOwnProperty']('nolimit')){_0x5eba0b[_0x9b5c('0x23')]=qs[_0x9b5c('0x23')](_0x83bf3d[_0x9b5c('0x3a')][_0x9b5c('0x23')]);_0x5eba0b[_0x9b5c('0x21')]=qs[_0x9b5c('0x21')](_0x83bf3d['query'][_0x9b5c('0x21')]);}_0x5eba0b['order']=qs[_0x9b5c('0x3f')](_0x83bf3d[_0x9b5c('0x3a')][_0x9b5c('0x3f')]);_0x5eba0b['where']=qs[_0x9b5c('0x3b')](_[_0x9b5c('0x40')](_0x83bf3d['query'],_0x4fff39[_0x9b5c('0x3b')]),_0x5fed85);if(_0x83bf3d['query'][_0x9b5c('0x41')]){_0x5eba0b[_0x9b5c('0x42')]=_[_0x9b5c('0x43')](_0x5eba0b[_0x9b5c('0x42')],{'$or':_[_0x9b5c('0x33')](_0x5fed85,function(_0xdda5b8){if(_0xdda5b8[_0x9b5c('0x37')]!=='VIRTUAL'){var _0x868635={};_0x868635[_0xdda5b8['name']]={'$like':'%'+_0x83bf3d[_0x9b5c('0x3a')][_0x9b5c('0x41')]+'%'};return _0x868635;}})});}_0x5eba0b=_['merge']({},_0x5eba0b,_0x83bf3d[_0x9b5c('0x44')]);var _0x1766a7={'where':_0x5eba0b[_0x9b5c('0x42')]};return db[_0x9b5c('0x34')][_0x9b5c('0x24')](_0x1766a7)['then'](function(_0x487dca){_0x33353d['count']=_0x487dca;if(_0x83bf3d[_0x9b5c('0x3a')][_0x9b5c('0x45')]){_0x5eba0b[_0x9b5c('0x46')]=[{'all':!![]}];}return db[_0x9b5c('0x34')][_0x9b5c('0x47')](_0x5eba0b);})[_0x9b5c('0x2d')](function(_0x37aac7){_0x33353d['rows']=_0x37aac7;return _0x33353d;})['then'](respondWithFilteredResult(_0x4c9402,_0x5eba0b))['catch'](handleError(_0x4c9402,null));};exports[_0x9b5c('0x48')]=function(_0x596dfc,_0x46dd2b){var _0x11f56f={'raw':![],'where':{'id':_0x596dfc[_0x9b5c('0x49')]['id']}},_0x47dc60={};_0x47dc60[_0x9b5c('0x39')]=_[_0x9b5c('0x4a')](db[_0x9b5c('0x34')][_0x9b5c('0x35')]);_0x47dc60[_0x9b5c('0x3a')]=_['keys'](_0x596dfc[_0x9b5c('0x3a')]);_0x47dc60[_0x9b5c('0x3b')]=_['intersection'](_0x47dc60[_0x9b5c('0x39')],_0x47dc60[_0x9b5c('0x3a')]);_0x11f56f[_0x9b5c('0x3e')]=_[_0x9b5c('0x3c')](_0x47dc60[_0x9b5c('0x39')],qs['fields'](_0x596dfc[_0x9b5c('0x3a')][_0x9b5c('0x3d')]));_0x11f56f['attributes']=_0x11f56f[_0x9b5c('0x3e')][_0x9b5c('0x4b')]?_0x11f56f[_0x9b5c('0x3e')]:_0x47dc60[_0x9b5c('0x39')];if(_0x596dfc[_0x9b5c('0x3a')][_0x9b5c('0x45')]){_0x11f56f[_0x9b5c('0x46')]=[{'all':!![]}];}_0x11f56f=_[_0x9b5c('0x43')]({},_0x11f56f,_0x596dfc['options']);return db['CmList']['find'](_0x11f56f)[_0x9b5c('0x2d')](handleEntityNotFound(_0x46dd2b,null))[_0x9b5c('0x2d')](respondWithResult(_0x46dd2b,null))['catch'](handleError(_0x46dd2b,null));};exports[_0x9b5c('0x4c')]=function(_0x1239d5,_0x31d740){return db[_0x9b5c('0x34')][_0x9b5c('0x4c')](_0x1239d5[_0x9b5c('0x4d')],{})[_0x9b5c('0x2d')](function(_0x43c58d){var _0xd757f8=_0x1239d5[_0x9b5c('0x4e')][_0x9b5c('0x2b')]({'plain':!![]});if(!_0xd757f8)throw new Error(_0x9b5c('0x4f'));if(_0xd757f8[_0x9b5c('0x50')]===_0x9b5c('0x4e')){var _0x1b7253=_0x43c58d[_0x9b5c('0x2b')]({'plain':!![]});var _0x4f6adb=_0x9b5c('0x51');return db[_0x9b5c('0x52')][_0x9b5c('0x53')]({'where':{'name':_0x4f6adb,'userProfileId':_0xd757f8[_0x9b5c('0x54')]},'raw':!![]})[_0x9b5c('0x2d')](function(_0xe1c73a){if(_0xe1c73a&&_0xe1c73a['autoAssociation']===0x0){return db[_0x9b5c('0x2c')][_0x9b5c('0x4c')]({'name':_0x1b7253['name'],'resourceId':_0x1b7253['id'],'type':_0xe1c73a[_0x9b5c('0x30')],'sectionId':_0xe1c73a['id']},{})[_0x9b5c('0x2d')](function(){return _0x43c58d;});}else{return _0x43c58d;}})[_0x9b5c('0x55')](function(_0x38e959){logger['error'](_0x9b5c('0x56'),_0x38e959);throw _0x38e959;});}return _0x43c58d;})['then'](respondWithResult(_0x31d740,0xc9))[_0x9b5c('0x55')](handleError(_0x31d740,null));};exports[_0x9b5c('0x29')]=function(_0x115e95,_0x5756bb){if(_0x115e95[_0x9b5c('0x4d')]['id']){delete _0x115e95[_0x9b5c('0x4d')]['id'];}return db[_0x9b5c('0x34')]['find']({'where':{'id':_0x115e95[_0x9b5c('0x49')]['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x5756bb,null))['then'](saveUpdates(_0x115e95[_0x9b5c('0x4d')],null))[_0x9b5c('0x2d')](respondWithResult(_0x5756bb,null))[_0x9b5c('0x55')](handleError(_0x5756bb,null));};exports[_0x9b5c('0x2a')]=function(_0x14ae41,_0x511567){return db[_0x9b5c('0x34')][_0x9b5c('0x53')]({'where':{'id':_0x14ae41[_0x9b5c('0x49')]['id']}})['then'](handleEntityNotFound(_0x511567,null))[_0x9b5c('0x2d')](removeEntity(_0x511567,null))[_0x9b5c('0x55')](handleError(_0x511567,null));};exports[_0x9b5c('0x57')]=function(_0xa1b89,_0x1da4de){return db['CmList'][_0x9b5c('0x57')]()['then'](respondWithResult(_0x1da4de,null))[_0x9b5c('0x55')](handleError(_0x1da4de,null));};exports[_0x9b5c('0x58')]=function(_0x5d6f1a,_0x55c525,_0x41e971){if(_0x5d6f1a[_0x9b5c('0x4d')]['id']){delete _0x5d6f1a[_0x9b5c('0x4d')]['id'];}return db[_0x9b5c('0x34')][_0x9b5c('0x53')]({'where':{'id':_0x5d6f1a[_0x9b5c('0x49')]['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x55c525,null))['then'](function(_0x327512){if(_0x327512){_0x5d6f1a[_0x9b5c('0x4d')][_0x9b5c('0x59')]=_0x327512['id'];return db['Disposition'][_0x9b5c('0x4c')](_0x5d6f1a[_0x9b5c('0x4d')]);}})[_0x9b5c('0x2d')](respondWithResult(_0x55c525,null))['catch'](handleError(_0x55c525,null));};exports[_0x9b5c('0x5a')]=function(_0x17638c,_0x2999d7,_0x1d968d){var _0x2c2e2b={'raw':![],'where':{}};var _0xc87f0={};var _0x1a149a={'count':0x0,'rows':[]};return db[_0x9b5c('0x34')][_0x9b5c('0x5b')]({'where':{'id':_0x17638c['params']['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x2999d7,null))[_0x9b5c('0x2d')](function(_0x4b03a8){if(_0x4b03a8){_0xc87f0[_0x9b5c('0x39')]=_[_0x9b5c('0x4a')](db[_0x9b5c('0x5c')][_0x9b5c('0x35')]);_0xc87f0['query']=_['keys'](_0x17638c['query']);_0xc87f0[_0x9b5c('0x3b')]=_['intersection'](_0xc87f0[_0x9b5c('0x39')],_0xc87f0['query']);_0x2c2e2b[_0x9b5c('0x3e')]=_[_0x9b5c('0x3c')](_0xc87f0[_0x9b5c('0x39')],qs[_0x9b5c('0x3d')](_0x17638c['query']['fields']));_0x2c2e2b['attributes']=_0x2c2e2b[_0x9b5c('0x3e')][_0x9b5c('0x4b')]?_0x2c2e2b[_0x9b5c('0x3e')]:_0xc87f0[_0x9b5c('0x39')];if(!_0x17638c[_0x9b5c('0x3a')]['hasOwnProperty'](_0x9b5c('0x5d'))){_0x2c2e2b['limit']=qs['limit'](_0x17638c[_0x9b5c('0x3a')]['limit']);_0x2c2e2b[_0x9b5c('0x21')]=qs['offset'](_0x17638c[_0x9b5c('0x3a')][_0x9b5c('0x21')]);}_0x2c2e2b[_0x9b5c('0x5e')]=qs['sort'](_0x17638c[_0x9b5c('0x3a')]['sort']);_0x2c2e2b[_0x9b5c('0x42')]=qs[_0x9b5c('0x3b')](_['pick'](_0x17638c['query'],_0xc87f0[_0x9b5c('0x3b')]));_0x2c2e2b[_0x9b5c('0x42')][_0x9b5c('0x59')]=_0x4b03a8['id'];if(_0x17638c['query'][_0x9b5c('0x41')]){_0x2c2e2b[_0x9b5c('0x42')]=_[_0x9b5c('0x43')](_0x2c2e2b['where'],{'$or':_[_0x9b5c('0x33')](_0x2c2e2b['attributes'],function(_0x5806ca){var _0x565b91={};_0x565b91[_0x5806ca]={'$like':'%'+_0x17638c[_0x9b5c('0x3a')][_0x9b5c('0x41')]+'%'};return _0x565b91;})});}_0x2c2e2b=_[_0x9b5c('0x43')]({},_0x2c2e2b,_0x17638c[_0x9b5c('0x44')]);return db[_0x9b5c('0x5c')]['count']({'where':_0x2c2e2b[_0x9b5c('0x42')]})[_0x9b5c('0x2d')](function(_0x35e683){_0x1a149a['count']=_0x35e683;if(_0x17638c[_0x9b5c('0x3a')][_0x9b5c('0x45')]){_0x2c2e2b[_0x9b5c('0x46')]=[{'all':!![]}];}return db['Disposition'][_0x9b5c('0x47')](_0x2c2e2b);})[_0x9b5c('0x2d')](function(_0xdeb3da){_0x1a149a[_0x9b5c('0x5f')]=_0xdeb3da;return _0x1a149a;});}})['then'](respondWithFilteredResult(_0x2999d7,_0x2c2e2b))[_0x9b5c('0x55')](handleError(_0x2999d7,null));};exports[_0x9b5c('0x60')]=function(_0x21c8cc,_0x247f71,_0x4ce7db){return db[_0x9b5c('0x34')][_0x9b5c('0x53')]({'where':{'id':_0x21c8cc[_0x9b5c('0x49')]['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x247f71,null))[_0x9b5c('0x2d')](function(_0x5bff90){if(_0x5bff90){return _0x5bff90['removeDispositions'](_0x21c8cc[_0x9b5c('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x247f71,null))[_0x9b5c('0x55')](handleError(_0x247f71,null));};exports[_0x9b5c('0x61')]=function(_0x218fbb,_0x18a75a,_0x1dde02){return db[_0x9b5c('0x34')][_0x9b5c('0x53')]({'where':{'id':_0x218fbb[_0x9b5c('0x49')]['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x18a75a,null))[_0x9b5c('0x2d')](function(_0x496606){if(_0x496606){var _0x9d4595=[];var _0x383f1c={'success':[],'errors':[]};return db['CmContact'][_0x9b5c('0x57')]()[_0x9b5c('0x2d')](function(_0x498d4d){if(_0x218fbb[_0x9b5c('0x4d')][_0x9b5c('0x62')]&&_['isArray'](_0x218fbb[_0x9b5c('0x4d')][_0x9b5c('0x62')])){if(_0x218fbb[_0x9b5c('0x4d')]['tags'][_0x9b5c('0x4b')]){_0x218fbb[_0x9b5c('0x4d')][_0x9b5c('0x62')]=_0x218fbb['body'][_0x9b5c('0x62')][_0x9b5c('0x63')](';')+';';}else{_0x218fbb['body']['tags']=null;}}else{_0x218fbb[_0x9b5c('0x4d')][_0x9b5c('0x62')]=null;}if(_0x218fbb[_0x9b5c('0x4d')]&&_[_0x9b5c('0x64')](_0x218fbb[_0x9b5c('0x4d')])){for(var _0x4d590f=0x0;_0x4d590f<_0x218fbb['body'][_0x9b5c('0x4b')];_0x4d590f+=0x1){_0x218fbb[_0x9b5c('0x4d')][_0x4d590f]['ListId']=_0x218fbb['params']['id'];_0x9d4595['push'](_0x218fbb[_0x9b5c('0x4d')][_0x4d590f]);}return BPromise['each'](_0x9d4595,function(_0xb3aadc){return db['CmContact']['create'](_[_0x9b5c('0x65')](_0xb3aadc,[_0x9b5c('0x66'),'id'])||{},{'fields':_[_0x9b5c('0x4a')](_0x498d4d),'raw':!![]})['then'](function(_0x14f7fb){_0x383f1c[_0x9b5c('0x67')][_0x9b5c('0x68')](_0x14f7fb[_0x9b5c('0x69')]);})[_0x9b5c('0x55')](function(_0x47d8bc){_0x383f1c['errors'][_0x9b5c('0x68')]({'data':_0xb3aadc,'error':_0x47d8bc[_0x9b5c('0x6a')]});});})[_0x9b5c('0x2d')](function(_0x9ac5dc){return _0x383f1c;})[_0x9b5c('0x55')](function(_0x278a48){return _0x278a48;});}else{_0x18a75a['status'](0x190)['json']({'message':_0x9b5c('0x6b')});}});}})['then'](respondWithResult(_0x18a75a,null))['catch'](handleError(_0x18a75a,null));};exports[_0x9b5c('0x6c')]=function(_0x58d3bd,_0x2a9d33,_0x3c4b14){var _0x5d4fc7;return db[_0x9b5c('0x34')][_0x9b5c('0x53')]({'where':{'id':_0x58d3bd[_0x9b5c('0x49')]['id']},'include':[{'model':db[_0x9b5c('0x6d')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x2a9d33,null))[_0x9b5c('0x2d')](function(_0x2dbf7d){if(_0x2dbf7d){_0x5d4fc7=_0x2dbf7d;return db['CmContact'][_0x9b5c('0x35')];}})[_0x9b5c('0x2d')](function(_0x31683d){if(_0x31683d){var _0x1b0c65={};var _0x3bad86={};_0x3bad86[_0x9b5c('0x39')]=_[_0x9b5c('0x6e')](_[_0x9b5c('0x4a')](_0x31683d),_[_0x9b5c('0x33')](_0x5d4fc7[_0x9b5c('0x6f')],function(_0x1b89a6){return util[_0x9b5c('0x70')](_0x9b5c('0x71'),_0x1b89a6['id']);}));_0x3bad86[_0x9b5c('0x3a')]=_[_0x9b5c('0x4a')](_0x58d3bd[_0x9b5c('0x3a')]);_0x3bad86[_0x9b5c('0x3b')]=_[_0x9b5c('0x3c')](_0x3bad86[_0x9b5c('0x39')],_0x3bad86['query']);_0x1b0c65['attributes']=_['intersection'](_0x3bad86[_0x9b5c('0x39')],qs[_0x9b5c('0x3d')](_0x58d3bd[_0x9b5c('0x3a')]['fields']));_0x1b0c65['attributes']=_0x1b0c65['attributes'][_0x9b5c('0x4b')]?_0x1b0c65['attributes']:_0x3bad86[_0x9b5c('0x39')];if(!_0x58d3bd['query'][_0x9b5c('0x72')](_0x9b5c('0x5d'))){_0x1b0c65[_0x9b5c('0x23')]=qs['limit'](_0x58d3bd[_0x9b5c('0x3a')][_0x9b5c('0x23')]);_0x1b0c65[_0x9b5c('0x21')]=qs[_0x9b5c('0x21')](_0x58d3bd[_0x9b5c('0x3a')][_0x9b5c('0x21')]);}_0x1b0c65[_0x9b5c('0x5e')]=qs[_0x9b5c('0x3f')](_0x58d3bd[_0x9b5c('0x3a')][_0x9b5c('0x3f')]);_0x1b0c65['where']=qs[_0x9b5c('0x3b')](_[_0x9b5c('0x40')](_0x58d3bd[_0x9b5c('0x3a')],_0x3bad86[_0x9b5c('0x3b')]));_0x1b0c65[_0x9b5c('0x73')]=!![];if(_0x58d3bd[_0x9b5c('0x3a')][_0x9b5c('0x41')]){_0x1b0c65[_0x9b5c('0x42')]=_['merge'](_0x1b0c65[_0x9b5c('0x42')],{'$or':_[_0x9b5c('0x33')](_0x1b0c65[_0x9b5c('0x3e')],function(_0x5cfe44){var _0x4b07a4={};_0x4b07a4[_0x5cfe44]={'$like':'%'+_0x58d3bd[_0x9b5c('0x3a')][_0x9b5c('0x41')]+'%'};return _0x4b07a4;})});}_0x1b0c65=_[_0x9b5c('0x43')]({},_0x1b0c65,_0x58d3bd[_0x9b5c('0x44')]);return _0x5d4fc7[_0x9b5c('0x6c')](_0x1b0c65);}})['then'](respondWithResult(_0x2a9d33,null))[_0x9b5c('0x55')](handleError(_0x2a9d33,null));};exports['getContactsCsv']=function(_0x43b2de,_0x60df4f,_0x57bcc3){var _0x8fd523;var _0x18c8ff;var _0x17b4a7;var _0x4015e4=_0x43b2de[_0x9b5c('0x49')]['id'];csv_results=[];return db[_0x9b5c('0x74')][_0x9b5c('0x47')]({'attributes':['id',_0x9b5c('0x30')],'raw':!![],'order':[_0x9b5c('0x75')]})[_0x9b5c('0x2d')](function(_0x3da4bb){_0x8fd523=_0x3da4bb;var _0x2dc125=_[_0x9b5c('0x4a')](db[_0x9b5c('0x76')]['rawAttributes']);return db['CmCustomField'][_0x9b5c('0x47')]({'raw':!![],'attributes':['id',_0x9b5c('0x77')]})[_0x9b5c('0x2d')](function(_0x4bab8a){_0x18c8ff=_0x4bab8a;var _0x3687ff=squel['select']()[_0x9b5c('0x3d')](_0x2dc125)[_0x9b5c('0x78')](_0x9b5c('0x79'),'c')[_0x9b5c('0x42')](_0x9b5c('0x7a'),_0x4015e4)[_0x9b5c('0x42')](_0x9b5c('0x7b'))[_0x9b5c('0x7c')]();for(var _0x2c29a9=0x0;_0x2c29a9<_0x18c8ff[_0x9b5c('0x4b')];_0x2c29a9++){_0x3687ff[_0x9b5c('0x7d')](_0x9b5c('0x7e')+_0x18c8ff[_0x2c29a9]['id'],'customField_'+_0x18c8ff[_0x2c29a9][_0x9b5c('0x77')]);}for(var _0x2c29a9=0x0;_0x2c29a9<_0x8fd523[_0x9b5c('0x4b')];_0x2c29a9++){_0x3687ff[_0x9b5c('0x7d')](squel[_0x9b5c('0x7f')]()['field'](_0x9b5c('0x80'))[_0x9b5c('0x78')](_0x9b5c('0x81'))[_0x9b5c('0x42')]('ItemTypeId\x20=\x20?',_0x8fd523[_0x2c29a9]['id'])[_0x9b5c('0x42')](_0x9b5c('0x82')),_0x9b5c('0x83')+_0x8fd523[_0x2c29a9][_0x9b5c('0x30')]);_0x3687ff[_0x9b5c('0x7d')](squel[_0x9b5c('0x7f')]()[_0x9b5c('0x7d')]('description')[_0x9b5c('0x78')](_0x9b5c('0x81'))[_0x9b5c('0x42')](_0x9b5c('0x84'),_0x8fd523[_0x2c29a9]['id'])[_0x9b5c('0x42')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x8fd523[_0x2c29a9]['name']);}var _0x5423c5=[];_0x5423c5[_0x9b5c('0x68')](_0x3687ff[_0x9b5c('0x85')]());BPromise['each'](_0x5423c5,handleQuery)[_0x9b5c('0x2d')](function(_0x58dd09){handleQuery(_0x3687ff[_0x9b5c('0x85')]());var _0x4b30ae=csv_results[0x0];if(!_[_0x9b5c('0x86')](_0x4b30ae)){var _0x1498c3=toCsv(_0x4b30ae);var _0x496cde=Date[_0x9b5c('0x87')]();fs['writeFileSync'](util[_0x9b5c('0x70')]('/tmp/list_%d_%s.csv',_0x4015e4,_0x496cde),_0x1498c3);_0x60df4f['setHeader'](_0x9b5c('0x88'),_0x9b5c('0x89')+util[_0x9b5c('0x70')]('list_%d_%s.csv',_0x4015e4,_0x496cde));_0x60df4f['setHeader'](_0x9b5c('0x8a'),_0x9b5c('0x8b'));return _0x60df4f[_0x9b5c('0x8c')](util['format'](_0x9b5c('0x8d'),_0x4015e4,_0x496cde));}else{return _0x60df4f[_0x9b5c('0x8e')](0xcc);}});});});};exports[_0x9b5c('0x8f')]=function(_0x1baed3,_0x5d9afd,_0x5838b3){var _0x33b862;delete _0x1baed3[_0x9b5c('0x4d')]['id'];return db[_0x9b5c('0x34')][_0x9b5c('0x5b')]({'where':{'id':_0x1baed3[_0x9b5c('0x49')]['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x5d9afd,null))['then'](function(_0x2724ce){if(_0x2724ce){return db[_0x9b5c('0x90')][_0x9b5c('0x91')](function(_0x41841c){return db['CmCustomField'][_0x9b5c('0x4c')](_0x1baed3[_0x9b5c('0x4d')],{'transaction':_0x41841c})[_0x9b5c('0x2d')](function(_0x159b5a){_0x33b862=_0x159b5a;return _0x2724ce[_0x9b5c('0x92')](_0x159b5a,{'transaction':_0x41841c});})[_0x9b5c('0x2d')](function(){var _0x2f8789={'type':db['Sequelize'][_0x9b5c('0x93')],'transaction':_0x41841c};switch(_0x1baed3['body'][_0x9b5c('0x37')]){case _0x9b5c('0x94'):_0x2f8789[_0x9b5c('0x37')]=db['Sequelize']['TEXT'];break;case'number':_0x2f8789[_0x9b5c('0x37')]=db[_0x9b5c('0x95')][_0x9b5c('0x96')];break;case'switch':_0x2f8789['type']=db[_0x9b5c('0x95')][_0x9b5c('0x97')];_0x2f8789[_0x9b5c('0x98')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn']('cm_contacts',util['format'](_0x9b5c('0x99'),_0x33b862['id']),_0x2f8789);})['then'](function(){return _0x33b862;});});}})['then'](respondWithResult(_0x5d9afd,null))['catch'](handleError(_0x5d9afd,null));};exports['getCustomFields']=function(_0x24baea,_0x5721e4,_0xf25735){var _0x1f66d2={};var _0x16bab9={};var _0x119a9f;var _0x1434cb;return db[_0x9b5c('0x34')][_0x9b5c('0x5b')]({'where':{'id':_0x24baea[_0x9b5c('0x49')]['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x5721e4,null))[_0x9b5c('0x2d')](function(_0x3c7f6a){if(_0x3c7f6a){_0x119a9f=_0x3c7f6a;_0x16bab9['model']=_['keys'](db[_0x9b5c('0x6d')][_0x9b5c('0x35')]);_0x16bab9[_0x9b5c('0x3a')]=_[_0x9b5c('0x4a')](_0x24baea[_0x9b5c('0x3a')]);_0x16bab9[_0x9b5c('0x3b')]=_[_0x9b5c('0x3c')](_0x16bab9[_0x9b5c('0x39')],_0x16bab9['query']);_0x1f66d2[_0x9b5c('0x3e')]=_['intersection'](_0x16bab9[_0x9b5c('0x39')],qs[_0x9b5c('0x3d')](_0x24baea[_0x9b5c('0x3a')][_0x9b5c('0x3d')]));_0x1f66d2['attributes']=_0x1f66d2['attributes'][_0x9b5c('0x4b')]?_0x1f66d2[_0x9b5c('0x3e')]:_0x16bab9[_0x9b5c('0x39')];_0x1f66d2[_0x9b5c('0x5e')]=qs[_0x9b5c('0x3f')](_0x24baea[_0x9b5c('0x3a')]['sort']);_0x1f66d2[_0x9b5c('0x42')]=qs['filters'](_['pick'](_0x24baea[_0x9b5c('0x3a')],_0x16bab9[_0x9b5c('0x3b')]));_0x1f66d2[_0x9b5c('0x42')]=_[_0x9b5c('0x43')](_0x1f66d2[_0x9b5c('0x42')],{'$or':[{'ListId':_0x3c7f6a['id']},{'ListId':null}]});if(_0x24baea['query'][_0x9b5c('0x41')]){_0x1f66d2[_0x9b5c('0x42')]=_[_0x9b5c('0x43')](_0x1f66d2[_0x9b5c('0x42')],{'$or':_[_0x9b5c('0x33')](_0x1f66d2[_0x9b5c('0x3e')],function(_0x3b99df){var _0x5ae11c={};_0x5ae11c[_0x3b99df]={'$like':'%'+_0x24baea[_0x9b5c('0x3a')][_0x9b5c('0x41')]+'%'};return _0x5ae11c;})});}_0x1f66d2=_[_0x9b5c('0x43')]({},_0x1f66d2,_0x24baea[_0x9b5c('0x44')]);return db[_0x9b5c('0x6d')][_0x9b5c('0x9a')](_0x1f66d2);}})[_0x9b5c('0x2d')](respondWithResult(_0x5721e4,null))[_0x9b5c('0x55')](handleError(_0x5721e4,null));};exports[_0x9b5c('0x9b')]=function(_0x4e50ce,_0xb2e18f){return db['CmCustomField'][_0x9b5c('0x9a')]({'where':{'ListId':null}})[_0x9b5c('0x2d')](handleEntityNotFound(_0xb2e18f,null))[_0x9b5c('0x2d')](function(_0x259181){return _0x259181;})[_0x9b5c('0x2d')](respondWithResult(_0xb2e18f,null))[_0x9b5c('0x55')](handleError(_0xb2e18f,null));};exports[_0x9b5c('0x9c')]=function(_0x554403,_0x14d163,_0x479454){return db['CmList'][_0x9b5c('0x53')]({'where':{'id':_0x554403[_0x9b5c('0x49')]['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0x14d163,null))[_0x9b5c('0x2d')](function(_0x1e3504){if(_0x1e3504){return _0x1e3504[_0x9b5c('0x9c')](_0x554403[_0x9b5c('0x4d')][_0x9b5c('0x66')],_[_0x9b5c('0x65')](_0x554403['body'],['ids','id'])||{})[_0x9b5c('0x9d')](function(_0x56c5cc){for(var _0x2c980c=0x0;_0x2c980c<_0x554403['body'][_0x9b5c('0x66')][_0x9b5c('0x4b')];_0x2c980c+=0x1){socket[_0x9b5c('0x9e')]('userCmList:save',{'UserId':Number(_0x554403[_0x9b5c('0x4d')]['ids'][_0x2c980c]),'CmListId':Number(_0x554403[_0x9b5c('0x49')]['id'])});}return _0x56c5cc;});}})[_0x9b5c('0x2d')](respondWithResult(_0x14d163,null))[_0x9b5c('0x55')](handleError(_0x14d163,null));};exports[_0x9b5c('0x9f')]=function(_0x12bc06,_0xb3f35d,_0x3e465d){return db[_0x9b5c('0x34')]['find']({'where':{'id':_0x12bc06['params']['id']}})['then'](handleEntityNotFound(_0xb3f35d,null))[_0x9b5c('0x2d')](function(_0x30b100){if(_0x30b100){return _0x30b100[_0x9b5c('0x9f')](_0x12bc06[_0x9b5c('0x3a')]['ids'])['then'](function(){if(_['isArray'](_0x12bc06[_0x9b5c('0x3a')][_0x9b5c('0x66')])){for(var _0x484b00=0x0;_0x484b00<_0x12bc06[_0x9b5c('0x3a')]['ids'][_0x9b5c('0x4b')];_0x484b00+=0x1){socket[_0x9b5c('0x9e')]('userCmList:remove',{'UserId':Number(_0x12bc06[_0x9b5c('0x3a')][_0x9b5c('0x66')][_0x484b00]),'CmListId':Number(_0x12bc06[_0x9b5c('0x49')]['id'])});}}else{socket[_0x9b5c('0x9e')]('userCmList:remove',{'UserId':Number(_0x12bc06[_0x9b5c('0x3a')]['ids']),'CmListId':Number(_0x12bc06[_0x9b5c('0x49')]['id'])});}});}})[_0x9b5c('0x2d')](respondWithStatusCode(_0xb3f35d,null))[_0x9b5c('0x55')](handleError(_0xb3f35d,null));};exports[_0x9b5c('0xa0')]=function(_0x38bc27,_0xcd8e0a,_0x22a890){var _0x3f84f8={};var _0x48e93a={};var _0x162f12;var _0x23250e;return db['CmList'][_0x9b5c('0x5b')]({'where':{'id':_0x38bc27['params']['id']}})[_0x9b5c('0x2d')](handleEntityNotFound(_0xcd8e0a,null))[_0x9b5c('0x2d')](function(_0x3fefa6){if(_0x3fefa6){_0x162f12=_0x3fefa6;_0x48e93a[_0x9b5c('0x39')]=_[_0x9b5c('0x4a')](db[_0x9b5c('0xa1')][_0x9b5c('0x35')]);_0x48e93a[_0x9b5c('0x3a')]=_[_0x9b5c('0x4a')](_0x38bc27[_0x9b5c('0x3a')]);_0x48e93a['filters']=_['intersection'](_0x48e93a['model'],_0x48e93a[_0x9b5c('0x3a')]);_0x3f84f8[_0x9b5c('0x3e')]=_['intersection'](_0x48e93a[_0x9b5c('0x39')],qs[_0x9b5c('0x3d')](_0x38bc27[_0x9b5c('0x3a')][_0x9b5c('0x3d')]));_0x3f84f8[_0x9b5c('0x3e')]=_0x3f84f8[_0x9b5c('0x3e')][_0x9b5c('0x4b')]?_0x3f84f8[_0x9b5c('0x3e')]:_0x48e93a[_0x9b5c('0x39')];_0x3f84f8[_0x9b5c('0x5e')]=qs['sort'](_0x38bc27[_0x9b5c('0x3a')]['sort']);_0x3f84f8[_0x9b5c('0x42')]=qs[_0x9b5c('0x3b')](_[_0x9b5c('0x40')](_0x38bc27[_0x9b5c('0x3a')],_0x48e93a[_0x9b5c('0x3b')]));if(_0x38bc27['query'][_0x9b5c('0x41')]){_0x3f84f8['where']=_[_0x9b5c('0x43')](_0x3f84f8[_0x9b5c('0x42')],{'$or':_[_0x9b5c('0x33')](_0x3f84f8[_0x9b5c('0x3e')],function(_0x368b03){var _0x457bec={};_0x457bec[_0x368b03]={'$like':'%'+_0x38bc27[_0x9b5c('0x3a')][_0x9b5c('0x41')]+'%'};return _0x457bec;})});}_0x3f84f8=_['merge']({},_0x3f84f8,_0x38bc27[_0x9b5c('0x44')]);return _0x162f12[_0x9b5c('0xa0')](_0x3f84f8);}})[_0x9b5c('0x2d')](function(_0x226c1f){if(_0x226c1f){_0x23250e=_0x226c1f['length'];if(!_0x38bc27[_0x9b5c('0x3a')][_0x9b5c('0x72')](_0x9b5c('0x5d'))){_0x3f84f8[_0x9b5c('0x23')]=qs['limit'](_0x38bc27[_0x9b5c('0x3a')][_0x9b5c('0x23')]);_0x3f84f8[_0x9b5c('0x21')]=qs[_0x9b5c('0x21')](_0x38bc27['query'][_0x9b5c('0x21')]);}return _0x162f12[_0x9b5c('0xa0')](_0x3f84f8);}})[_0x9b5c('0x2d')](function(_0x4d1139){if(_0x4d1139){return _0x4d1139?{'count':_0x23250e,'rows':_0x4d1139}:null;}})[_0x9b5c('0x2d')](respondWithResult(_0xcd8e0a,null))[_0x9b5c('0x55')](handleError(_0xcd8e0a,null));};function handleQuery(_0x36e56d){logger[_0x9b5c('0xa2')](_0x36e56d);return db[_0x9b5c('0x90')][_0x9b5c('0x3a')](_0x36e56d)['spread'](function(_0x1c0259){csv_results[_0x9b5c('0x68')](_0x1c0259);})[_0x9b5c('0x55')](function(_0x4e15e5){logger[_0x9b5c('0x2e')](_0x4e15e5[_0x9b5c('0x6a')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d91dcf7..7027f7c 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x518bbd,_0x5b73f3){_0x518bbd=_0x518bbd-0x0;var _0x1fb92d=_0x3e74[_0x518bbd];return _0x1fb92d;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x28bb5a,_0xa2396d){var _0x4580a4=function(_0x1c1082){while(--_0x1c1082){_0x28bb5a['push'](_0x28bb5a['shift']());}};_0x4580a4(++_0xa2396d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ee1e5de..1d1a773 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(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x55e0,0xdc));var _0x055e=function(_0x39f9e8,_0x4edccf){_0x39f9e8=_0x39f9e8-0x0;var _0x2d37f6=_0x55e0[_0x39f9e8];return _0x2d37f6;};'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 _0x4ea3=['CmList','cm_lists','lodash','util','../../config/logger','api','bluebird','path','./cmList.attributes','exports','define'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x4ea3,0x70));var _0x34ea=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4ea3[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'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 50430a5..9c2789b 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 _0x9f3b=['./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','redis','localhost','socket.io-emitter'];(function(_0x248fc8,_0x121ebf){var _0x1ec5d1=function(_0x4784fc){while(--_0x4784fc){_0x248fc8['push'](_0x248fc8['shift']());}};_0x1ec5d1(++_0x121ebf);}(_0x9f3b,0x16c));var _0xb9f3=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0x9f3b[_0x12aba8];return _0x2aac66;};'use strict';var _=require('lodash');var util=require(_0xb9f3('0x0'));var moment=require(_0xb9f3('0x1'));var BPromise=require(_0xb9f3('0x2'));var rs=require(_0xb9f3('0x3'));var fs=require('fs');var Redis=require(_0xb9f3('0x4'));var db=require(_0xb9f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9f3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb9f3('0x7')]({'port':0x232a});config[_0xb9f3('0x8')]=_['defaults'](config[_0xb9f3('0x8')],{'host':_0xb9f3('0x9'),'port':0x18eb});var socket=require(_0xb9f3('0xa'))(new Redis(config[_0xb9f3('0x8')]));require(_0xb9f3('0xb'))[_0xb9f3('0xc')](socket);function respondWithRpcPromise(_0xa613eb,_0x5216df,_0x2c1a66){return new BPromise(function(_0x43f37e,_0x481d1f){return client[_0xb9f3('0xd')](_0xa613eb,_0x2c1a66)[_0xb9f3('0xe')](function(_0x23e7bc){logger[_0xb9f3('0xf')](_0xb9f3('0x10'),_0x5216df,_0xb9f3('0x11'));logger[_0xb9f3('0x12')](_0xb9f3('0x13'),_0x5216df,_0xb9f3('0x11'),JSON[_0xb9f3('0x14')](_0x23e7bc));if(_0x23e7bc['error']){if(_0x23e7bc['error'][_0xb9f3('0x15')]===0x1f4){logger[_0xb9f3('0x16')]('CmList,\x20%s,\x20%s',_0x5216df,_0x23e7bc['error'][_0xb9f3('0x17')]);return _0x481d1f(_0x23e7bc[_0xb9f3('0x16')][_0xb9f3('0x17')]);}logger[_0xb9f3('0x16')](_0xb9f3('0x10'),_0x5216df,_0x23e7bc[_0xb9f3('0x16')]['message']);return _0x43f37e(_0x23e7bc[_0xb9f3('0x16')][_0xb9f3('0x17')]);}else{logger[_0xb9f3('0xf')](_0xb9f3('0x10'),_0x5216df,_0xb9f3('0x11'));_0x43f37e(_0x23e7bc[_0xb9f3('0x18')][_0xb9f3('0x17')]);}})['catch'](function(_0x21ce7c){logger[_0xb9f3('0x16')](_0xb9f3('0x10'),_0x5216df,_0x21ce7c);_0x481d1f(_0x21ce7c);});});} \ No newline at end of file +var _0x3e81=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x497b08,_0x37fc63){var _0x39e605=function(_0x3f738b){while(--_0x3f738b){_0x497b08['push'](_0x497b08['shift']());}};_0x39e605(++_0x37fc63);}(_0x3e81,0x136));var _0x13e8=function(_0x569059,_0x490d98){_0x569059=_0x569059-0x0;var _0x4c2cfb=_0x3e81[_0x569059];return _0x4c2cfb;};'use strict';var _=require(_0x13e8('0x0'));var util=require(_0x13e8('0x1'));var moment=require(_0x13e8('0x2'));var BPromise=require(_0x13e8('0x3'));var rs=require(_0x13e8('0x4'));var fs=require('fs');var Redis=require(_0x13e8('0x5'));var db=require(_0x13e8('0x6'))['db'];var utils=require(_0x13e8('0x7'));var logger=require(_0x13e8('0x8'))('rpc');var config=require(_0x13e8('0x9'));var jayson=require(_0x13e8('0xa'));var client=jayson[_0x13e8('0xb')][_0x13e8('0xc')]({'port':0x232a});config[_0x13e8('0xd')]=_[_0x13e8('0xe')](config[_0x13e8('0xd')],{'host':_0x13e8('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13e8('0xd')]));require(_0x13e8('0x10'))[_0x13e8('0x11')](socket);function respondWithRpcPromise(_0x3f8fe7,_0x3d5aa3,_0x131e35){return new BPromise(function(_0x5d25d4,_0x337f8e){return client[_0x13e8('0x12')](_0x3f8fe7,_0x131e35)[_0x13e8('0x13')](function(_0x1f199f){logger[_0x13e8('0x14')](_0x13e8('0x15'),_0x3d5aa3,_0x13e8('0x16'));logger[_0x13e8('0x17')](_0x13e8('0x18'),_0x3d5aa3,'request\x20sent',JSON['stringify'](_0x1f199f));if(_0x1f199f['error']){if(_0x1f199f[_0x13e8('0x19')][_0x13e8('0x1a')]===0x1f4){logger[_0x13e8('0x19')](_0x13e8('0x15'),_0x3d5aa3,_0x1f199f[_0x13e8('0x19')]['message']);return _0x337f8e(_0x1f199f[_0x13e8('0x19')][_0x13e8('0x1b')]);}logger[_0x13e8('0x19')](_0x13e8('0x15'),_0x3d5aa3,_0x1f199f[_0x13e8('0x19')][_0x13e8('0x1b')]);return _0x5d25d4(_0x1f199f[_0x13e8('0x19')][_0x13e8('0x1b')]);}else{logger['info'](_0x13e8('0x15'),_0x3d5aa3,'request\x20sent');_0x5d25d4(_0x1f199f[_0x13e8('0x1c')][_0x13e8('0x1b')]);}})['catch'](function(_0x3fa5d6){logger[_0x13e8('0x19')](_0x13e8('0x15'),_0x3d5aa3,_0x3fa5d6);_0x337f8e(_0x3fa5d6);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index dca0f40..b361c1f 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 _0xa07d=['./cmList.events','save','remove','update','removeListener','register','length','cmList:'];(function(_0x2c16c5,_0x12a02b){var _0x455e0d=function(_0x361e53){while(--_0x361e53){_0x2c16c5['push'](_0x2c16c5['shift']());}};_0x455e0d(++_0x12a02b);}(_0xa07d,0x150));var _0xda07=function(_0x916ccc,_0x19734f){_0x916ccc=_0x916ccc-0x0;var _0xfd449b=_0xa07d[_0x916ccc];return _0xfd449b;};'use strict';var CmListEvents=require(_0xda07('0x0'));var events=[_0xda07('0x1'),_0xda07('0x2'),_0xda07('0x3')];function createListener(_0x1cccb4,_0x2fd6b8){return function(_0x4408c3){_0x2fd6b8['emit'](_0x1cccb4,_0x4408c3);};}function removeListener(_0x437038,_0x281bc2){return function(){CmListEvents[_0xda07('0x4')](_0x437038,_0x281bc2);};}exports[_0xda07('0x5')]=function(_0x54645b){for(var _0x31afbe=0x0,_0x3ad6a3=events[_0xda07('0x6')];_0x31afbe<_0x3ad6a3;_0x31afbe++){var _0x1d7afb=events[_0x31afbe];var _0x37345d=createListener(_0xda07('0x7')+_0x1d7afb,_0x54645b);CmListEvents['on'](_0x1d7afb,_0x37345d);}}; \ No newline at end of file +var _0x4ed3=['update','removeListener','register','length','cmList:','./cmList.events','save','remove'];(function(_0x47510,_0x20d6d6){var _0x31c366=function(_0x405f7b){while(--_0x405f7b){_0x47510['push'](_0x47510['shift']());}};_0x31c366(++_0x20d6d6);}(_0x4ed3,0x18d));var _0x34ed=function(_0xff6bbd,_0x34e0b6){_0xff6bbd=_0xff6bbd-0x0;var _0x2a2697=_0x4ed3[_0xff6bbd];return _0x2a2697;};'use strict';var CmListEvents=require(_0x34ed('0x0'));var events=[_0x34ed('0x1'),_0x34ed('0x2'),_0x34ed('0x3')];function createListener(_0x9e8c0e,_0x216481){return function(_0x187c91){_0x216481['emit'](_0x9e8c0e,_0x187c91);};}function removeListener(_0x5a77ac,_0x25f194){return function(){CmListEvents[_0x34ed('0x4')](_0x5a77ac,_0x25f194);};}exports[_0x34ed('0x5')]=function(_0xf4f052){for(var _0x3b9d43=0x0,_0x74b920=events[_0x34ed('0x6')];_0x3b9d43<_0x74b920;_0x3b9d43++){var _0x33b60f=events[_0x3b9d43];var _0x4d5330=createListener(_0x34ed('0x7')+_0x33b60f,_0xf4f052);CmListEvents['on'](_0x33b60f,_0x4d5330);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b23f075..a06d5c2 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 _0x591a=['/:id/contacts/csv','getContactsCsv','getAgents','post','/:id/contacts','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions'];(function(_0x2c4f3f,_0x266947){var _0x3d0234=function(_0x31495c){while(--_0x31495c){_0x2c4f3f['push'](_0x2c4f3f['shift']());}};_0x3d0234(++_0x266947);}(_0x591a,0xf8));var _0xa591=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x591a[_0xd7b0a4];return _0x184e9e;};'use strict';var multer=require(_0xa591('0x0'));var util=require('util');var path=require(_0xa591('0x1'));var timeout=require('connect-timeout');var express=require(_0xa591('0x2'));var router=express['Router']();var fs_extra=require(_0xa591('0x3'));var auth=require(_0xa591('0x4'));var interaction=require(_0xa591('0x5'));var config=require('../../config/environment');var controller=require(_0xa591('0x6'));router[_0xa591('0x7')]('/',auth[_0xa591('0x8')](),controller[_0xa591('0x9')]);router['get'](_0xa591('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa591('0x7')](_0xa591('0xb'),auth[_0xa591('0x8')](),controller[_0xa591('0xc')]);router[_0xa591('0x7')]('/:id',auth[_0xa591('0x8')](),controller[_0xa591('0xd')]);router[_0xa591('0x7')](_0xa591('0xe'),auth[_0xa591('0x8')](),controller[_0xa591('0xf')]);router[_0xa591('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xa591('0x7')](_0xa591('0x10'),auth[_0xa591('0x8')](),controller[_0xa591('0x11')]);router[_0xa591('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router[_0xa591('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xa591('0x12')]);router[_0xa591('0x13')]('/',auth[_0xa591('0x8')](),controller['create']);router[_0xa591('0x13')](_0xa591('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xa591('0x13')](_0xa591('0x14'),auth[_0xa591('0x8')](),controller[_0xa591('0x15')]);router['post'](_0xa591('0x16'),auth[_0xa591('0x8')](),controller[_0xa591('0x17')]);router[_0xa591('0x13')](_0xa591('0x18'),auth[_0xa591('0x8')](),controller[_0xa591('0x19')]);router[_0xa591('0x1a')](_0xa591('0x1b'),auth[_0xa591('0x8')](),controller[_0xa591('0x1c')]);router[_0xa591('0x1d')](_0xa591('0x1b'),auth['isAuthenticated'](),controller[_0xa591('0x1e')]);router[_0xa591('0x1d')](_0xa591('0xe'),auth['isAuthenticated'](),controller[_0xa591('0x1f')]);router[_0xa591('0x1d')]('/:id/users',auth[_0xa591('0x8')](),controller[_0xa591('0x20')]);module['exports']=router; \ No newline at end of file +var _0xfb44=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','getGlobalCustomFields','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','post','create','addContacts','addCustomField','addAgents','/:id','update','delete','destroy','removeAgents','exports'];(function(_0x290a36,_0x561046){var _0xc59237=function(_0x5c0c52){while(--_0x5c0c52){_0x290a36['push'](_0x290a36['shift']());}};_0xc59237(++_0x561046);}(_0xfb44,0xd9));var _0x4fb4=function(_0x2dce55,_0x47808d){_0x2dce55=_0x2dce55-0x0;var _0x32c4ff=_0xfb44[_0x2dce55];return _0x32c4ff;};'use strict';var multer=require(_0x4fb4('0x0'));var util=require(_0x4fb4('0x1'));var path=require(_0x4fb4('0x2'));var timeout=require(_0x4fb4('0x3'));var express=require('express');var router=express[_0x4fb4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4fb4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4fb4('0x6'));var controller=require('./cmList.controller');router['get']('/',auth[_0x4fb4('0x7')](),controller[_0x4fb4('0x8')]);router[_0x4fb4('0x9')]('/describe',auth[_0x4fb4('0x7')](),controller[_0x4fb4('0xa')]);router[_0x4fb4('0x9')]('/global_fields',auth[_0x4fb4('0x7')](),controller[_0x4fb4('0xb')]);router[_0x4fb4('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4fb4('0x9')](_0x4fb4('0xc'),auth[_0x4fb4('0x7')](),controller[_0x4fb4('0xd')]);router[_0x4fb4('0x9')](_0x4fb4('0xe'),auth['isAuthenticated'](),controller[_0x4fb4('0xf')]);router['get'](_0x4fb4('0x10'),auth[_0x4fb4('0x7')](),controller[_0x4fb4('0x11')]);router[_0x4fb4('0x9')](_0x4fb4('0x12'),auth[_0x4fb4('0x7')](),controller['getCustomFields']);router['get'](_0x4fb4('0x13'),auth[_0x4fb4('0x7')](),controller['getAgents']);router[_0x4fb4('0x14')]('/',auth['isAuthenticated'](),controller[_0x4fb4('0x15')]);router['post']('/:id/dispositions',auth[_0x4fb4('0x7')](),controller['addDisposition']);router[_0x4fb4('0x14')](_0x4fb4('0xe'),auth[_0x4fb4('0x7')](),controller[_0x4fb4('0x16')]);router[_0x4fb4('0x14')]('/:id/fields',auth[_0x4fb4('0x7')](),controller[_0x4fb4('0x17')]);router['post'](_0x4fb4('0x13'),auth[_0x4fb4('0x7')](),controller[_0x4fb4('0x18')]);router['put'](_0x4fb4('0x19'),auth[_0x4fb4('0x7')](),controller[_0x4fb4('0x1a')]);router[_0x4fb4('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x4fb4('0x1c')]);router[_0x4fb4('0x1b')](_0x4fb4('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x4fb4('0x1b')](_0x4fb4('0x13'),auth[_0x4fb4('0x7')](),controller[_0x4fb4('0x1d')]);module[_0x4fb4('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 10c9f69..9997282 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 _0xe543=['sequelize','VIRTUAL','getDataValue','STRING'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xe543,0x13c));var _0x3e54=function(_0x526820,_0x1f4676){_0x526820=_0x526820-0x0;var _0x32e399=_0xe543[_0x526820];return _0x32e399;};'use strict';var Sequelize=require(_0x3e54('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e54('0x1')],'get':function(_0x2dc0ae){return this[_0x3e54('0x2')]('field');}},'field':{'type':Sequelize[_0x3e54('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x3e54('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x3e54('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xdddd=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x35309e,_0x366ab7){var _0x5f5bf6=function(_0x449bca){while(--_0x449bca){_0x35309e['push'](_0x35309e['shift']());}};_0x5f5bf6(++_0x366ab7);}(_0xdddd,0x7c));var _0xdddd=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xdddd[_0x18b344];return _0x5ef6bb;};'use strict';var Sequelize=require(_0xdddd('0x0'));module[_0xdddd('0x1')]={'name':{'type':Sequelize[_0xdddd('0x2')],'get':function(_0x1a0d4){return this[_0xdddd('0x3')]('field');}},'field':{'type':Sequelize[_0xdddd('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xdddd('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 48d4b2a..c68db73 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(_0x59c98,_0x50ef55){var _0x365bac=function(_0x59bc00){while(--_0x59bc00){_0x59c98['push'](_0x59c98['shift']());}};_0x365bac(++_0x50ef55);}(_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){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 _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(_0x4d9e00,_0x5ba667){var _0x374fb5=function(_0x295ff9){while(--_0x295ff9){_0x4d9e00['push'](_0x4d9e00['shift']());}};_0x374fb5(++_0x5ba667);}(_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){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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 656946b..cfff01c 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 _0x4a61=['util','moment','bluebird','request-promise','path','./condition.attributes','exports','define','lodash'];(function(_0x10a62b,_0x3d7f54){var _0x3af3f8=function(_0x341690){while(--_0x341690){_0x10a62b['push'](_0x10a62b['shift']());}};_0x3af3f8(++_0x3d7f54);}(_0x4a61,0x182));var _0x14a6=function(_0x50ff61,_0x311e41){_0x50ff61=_0x50ff61-0x0;var _0x242d76=_0x4a61[_0x50ff61];return _0x242d76;};'use strict';var _=require(_0x14a6('0x0'));var util=require(_0x14a6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x14a6('0x2'));var BPromise=require(_0x14a6('0x3'));var rp=require(_0x14a6('0x4'));var fs=require('fs');var path=require(_0x14a6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x14a6('0x6'));module[_0x14a6('0x7')]=function(_0x2bd54b,_0x1d204a){return _0x2bd54b[_0x14a6('0x8')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd19d=['./condition.attributes','Condition','tools_conditions','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x3270f3,_0x155358){var _0x102730=function(_0x8d90b0){while(--_0x8d90b0){_0x3270f3['push'](_0x3270f3['shift']());}};_0x102730(++_0x155358);}(_0xd19d,0x78));var _0xdd19=function(_0x30c67d,_0x12ee05){_0x30c67d=_0x30c67d-0x0;var _0x559751=_0xd19d[_0x30c67d];return _0x559751;};'use strict';var _=require('lodash');var util=require(_0xdd19('0x0'));var logger=require(_0xdd19('0x1'))('api');var moment=require(_0xdd19('0x2'));var BPromise=require(_0xdd19('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd19('0x4'));var rimraf=require('rimraf');var config=require(_0xdd19('0x5'));var attributes=require(_0xdd19('0x6'));module['exports']=function(_0x46bfc5,_0x3ff03e){return _0x46bfc5['define'](_0xdd19('0x7'),attributes,{'tableName':_0xdd19('0x8'),'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 1257973..754ae6e 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 _0x434e=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0x54e8e1,_0x48c25a){var _0x5944fe=function(_0x489f0c){while(--_0x489f0c){_0x54e8e1['push'](_0x54e8e1['shift']());}};_0x5944fe(++_0x48c25a);}(_0x434e,0x16b));var _0xe434=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x434e[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0xe434('0x0'));var util=require(_0xe434('0x1'));var moment=require(_0xe434('0x2'));var BPromise=require(_0xe434('0x3'));var rs=require(_0xe434('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe434('0x5'))(_0xe434('0x6'));var config=require(_0xe434('0x7'));var jayson=require(_0xe434('0x8'));var client=jayson[_0xe434('0x9')][_0xe434('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1222de,_0x538a4b,_0x240cd3){return new BPromise(function(_0x41f978,_0x2c6817){return client[_0xe434('0xb')](_0x1222de,_0x240cd3)[_0xe434('0xc')](function(_0x1001c6){logger['info'](_0xe434('0xd'),_0x538a4b,_0xe434('0xe'));logger['debug'](_0xe434('0xf'),_0x538a4b,_0xe434('0xe'),JSON[_0xe434('0x10')](_0x1001c6));if(_0x1001c6['error']){if(_0x1001c6[_0xe434('0x11')]['code']===0x1f4){logger[_0xe434('0x11')](_0xe434('0xd'),_0x538a4b,_0x1001c6[_0xe434('0x11')][_0xe434('0x12')]);return _0x2c6817(_0x1001c6[_0xe434('0x11')][_0xe434('0x12')]);}logger[_0xe434('0x11')]('Condition,\x20%s,\x20%s',_0x538a4b,_0x1001c6[_0xe434('0x11')]['message']);return _0x41f978(_0x1001c6[_0xe434('0x11')][_0xe434('0x12')]);}else{logger[_0xe434('0x13')](_0xe434('0xd'),_0x538a4b,'request\x20sent');_0x41f978(_0x1001c6[_0xe434('0x14')][_0xe434('0x12')]);}})['catch'](function(_0x2d6c67){logger[_0xe434('0x11')]('Condition,\x20%s,\x20%s',_0x538a4b,_0x2d6c67);_0x2c6817(_0x2d6c67);});});} \ No newline at end of file +var _0xd600=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xd600,0x79));var _0x0d60=function(_0x2ef9ef,_0x4d614c){_0x2ef9ef=_0x2ef9ef-0x0;var _0x15329a=_0xd600[_0x2ef9ef];return _0x15329a;};'use strict';var _=require(_0x0d60('0x0'));var util=require(_0x0d60('0x1'));var moment=require(_0x0d60('0x2'));var BPromise=require(_0x0d60('0x3'));var rs=require(_0x0d60('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d60('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d60('0x6'))(_0x0d60('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d60('0x8'));var client=jayson['client'][_0x0d60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x124f34,_0x3c6e14,_0x1d29a3){return new BPromise(function(_0x2f239a,_0x5e7f8f){return client['request'](_0x124f34,_0x1d29a3)[_0x0d60('0xa')](function(_0x15b10b){logger[_0x0d60('0xb')](_0x0d60('0xc'),_0x3c6e14,_0x0d60('0xd'));logger['debug'](_0x0d60('0xe'),_0x3c6e14,_0x0d60('0xd'),JSON['stringify'](_0x15b10b));if(_0x15b10b[_0x0d60('0xf')]){if(_0x15b10b[_0x0d60('0xf')][_0x0d60('0x10')]===0x1f4){logger[_0x0d60('0xf')](_0x0d60('0xc'),_0x3c6e14,_0x15b10b[_0x0d60('0xf')][_0x0d60('0x11')]);return _0x5e7f8f(_0x15b10b[_0x0d60('0xf')][_0x0d60('0x11')]);}logger['error'](_0x0d60('0xc'),_0x3c6e14,_0x15b10b[_0x0d60('0xf')][_0x0d60('0x11')]);return _0x2f239a(_0x15b10b[_0x0d60('0xf')][_0x0d60('0x11')]);}else{logger[_0x0d60('0xb')](_0x0d60('0xc'),_0x3c6e14,_0x0d60('0xd'));_0x2f239a(_0x15b10b[_0x0d60('0x12')][_0x0d60('0x11')]);}})[_0x0d60('0x13')](function(_0x41cbbf){logger[_0x0d60('0xf')](_0x0d60('0xc'),_0x3c6e14,_0x41cbbf);_0x5e7f8f(_0x41cbbf);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 6ec246f..83abc20 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 _0xa2a6=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x5bbc18,_0x4c7f09){var _0x205cb2=function(_0x221438){while(--_0x221438){_0x5bbc18['push'](_0x5bbc18['shift']());}};_0x205cb2(++_0x4c7f09);}(_0xa2a6,0x100));var _0x6a2a=function(_0x106d3f,_0x965cb8){_0x106d3f=_0x106d3f-0x0;var _0x559e13=_0xa2a6[_0x106d3f];return _0x559e13;};'use strict';var multer=require('multer');var util=require(_0x6a2a('0x0'));var path=require(_0x6a2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a2a('0x2'));var router=express[_0x6a2a('0x3')]();var fs_extra=require(_0x6a2a('0x4'));var auth=require(_0x6a2a('0x5'));var interaction=require(_0x6a2a('0x6'));var config=require(_0x6a2a('0x7'));var controller=require('./condition.controller');router['put'](_0x6a2a('0x8'),auth[_0x6a2a('0x9')](),controller[_0x6a2a('0xa')]);router[_0x6a2a('0xb')](_0x6a2a('0x8'),auth[_0x6a2a('0x9')](),controller[_0x6a2a('0xc')]);module[_0x6a2a('0xd')]=router; \ No newline at end of file +var _0xb40e=['../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','path','Router','fs-extra','../../components/interaction/service'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xb40e,0x1e8));var _0xeb40=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0xb40e[_0x1314d4];return _0x584ba5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeb40('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeb40('0x1')]();var fs_extra=require(_0xeb40('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xeb40('0x3'));var config=require(_0xeb40('0x4'));var controller=require(_0xeb40('0x5'));router[_0xeb40('0x6')]('/:id',auth[_0xeb40('0x7')](),controller[_0xeb40('0x8')]);router[_0xeb40('0x9')](_0xeb40('0xa'),auth[_0xeb40('0x7')](),controller[_0xeb40('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 1c26520..6223458 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 _0x8da4=['STRING','name','INTEGER','sequelize','exports'];(function(_0x20e36b,_0x322678){var _0x4a20ac=function(_0x24f72f){while(--_0x24f72f){_0x20e36b['push'](_0x20e36b['shift']());}};_0x4a20ac(++_0x322678);}(_0x8da4,0x94));var _0x48da=function(_0x1fb49f,_0x1d48b4){_0x1fb49f=_0x1fb49f-0x0;var _0x3de20d=_0x8da4[_0x1fb49f];return _0x3de20d;};'use strict';var Sequelize=require(_0x48da('0x0'));module[_0x48da('0x1')]={'name':{'type':Sequelize[_0x48da('0x2')],'allowNull':![],'unique':_0x48da('0x3')},'OrderBy':{'type':Sequelize[_0x48da('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xb570=['name','INTEGER','exports','STRING'];(function(_0x10905e,_0x16f95c){var _0x537230=function(_0x4545bc){while(--_0x4545bc){_0x10905e['push'](_0x10905e['shift']());}};_0x537230(++_0x16f95c);}(_0xb570,0x166));var _0x0b57=function(_0x53da63,_0x4b1248){_0x53da63=_0x53da63-0x0;var _0x59296=_0xb570[_0x53da63];return _0x59296;};'use strict';var Sequelize=require('sequelize');module[_0x0b57('0x0')]={'name':{'type':Sequelize[_0x0b57('0x1')],'allowNull':![],'unique':_0x0b57('0x2')},'OrderBy':{'type':Sequelize[_0x0b57('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0b57('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 3f53429..dc6ee62 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 _0xd4f4=['reject','save','update','destroy','get','ContactItemTypes','then','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','sendStatus','end','status','json','offset','undefined','limit','count','set','apply'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x23c357,_0x542faa){_0x23c357=_0x23c357-0x0;var _0x4f90e5=_0xd4f4[_0x23c357];return _0x4f90e5;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551a10,_0x5b4f4e){_0x5b4f4e=_0x5b4f4e||0xcc;return function(_0x15fe6a){if(_0x15fe6a){return _0x551a10[_0x4d4f('0x1d')](_0x5b4f4e);}return _0x551a10['status'](_0x5b4f4e)[_0x4d4f('0x1e')]();};}function respondWithResult(_0x301380,_0x1878b6){_0x1878b6=_0x1878b6||0xc8;return function(_0x59252c){if(_0x59252c){return _0x301380[_0x4d4f('0x1f')](_0x1878b6)[_0x4d4f('0x20')](_0x59252c);}};}function respondWithFilteredResult(_0x1a9173,_0x4a3364){return function(_0x59bfb5){if(_0x59bfb5){var _0x5e4ff5=typeof _0x4a3364[_0x4d4f('0x21')]===_0x4d4f('0x22')&&typeof _0x4a3364[_0x4d4f('0x23')]==='undefined';var _0x30b6b1=_0x59bfb5[_0x4d4f('0x24')];var _0x51dcf1=_0x5e4ff5?0x0:_0x4a3364['offset'];var _0x519501=_0x5e4ff5?_0x59bfb5['count']:_0x4a3364['offset']+_0x4a3364[_0x4d4f('0x23')];var _0x15100a;if(_0x519501>=_0x30b6b1){_0x519501=_0x30b6b1;_0x15100a=0xc8;}else{_0x15100a=0xce;}_0x1a9173[_0x4d4f('0x1f')](_0x15100a);return _0x1a9173[_0x4d4f('0x25')]('Content-Range',_0x51dcf1+'-'+_0x519501+'/'+_0x30b6b1)['json'](_0x59bfb5);}return null;};}function patchUpdates(_0x1e1ae2){return function(_0x4dd360){try{jsonpatch[_0x4d4f('0x26')](_0x4dd360,_0x1e1ae2,!![]);}catch(_0x1e3e9a){return BPromise[_0x4d4f('0x27')](_0x1e3e9a);}return _0x4dd360[_0x4d4f('0x28')]();};}function saveUpdates(_0x3dd36a,_0x5beab4){return function(_0x570520){if(_0x570520){return _0x570520[_0x4d4f('0x29')](_0x3dd36a)['then'](function(_0x247077){return _0x247077;});}return null;};}function removeEntity(_0x3d5d93,_0x2d2fb3){return function(_0x3f4a55){if(_0x3f4a55){return _0x3f4a55[_0x4d4f('0x2a')]()['then'](function(){var _0x44bd2f=_0x3f4a55[_0x4d4f('0x2b')]({'plain':!![]});var _0x1cf365=_0x4d4f('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x1cf365,'resourceId':_0x44bd2f['id']}})[_0x4d4f('0x2d')](function(){return _0x3f4a55;});})[_0x4d4f('0x2d')](function(){_0x3d5d93[_0x4d4f('0x1f')](0xcc)[_0x4d4f('0x1e')]();});}};}function handleEntityNotFound(_0x58acbe,_0x671c87){return function(_0x380ebf){if(!_0x380ebf){_0x58acbe[_0x4d4f('0x1d')](0x194);}return _0x380ebf;};}function handleError(_0x2e91b2,_0x4effb1){_0x4effb1=_0x4effb1||0x1f4;return function(_0x338ba2){logger['error'](_0x338ba2[_0x4d4f('0x2e')]);if(_0x338ba2[_0x4d4f('0x2f')]){delete _0x338ba2['name'];}_0x2e91b2[_0x4d4f('0x1f')](_0x4effb1)[_0x4d4f('0x30')](_0x338ba2);};}exports[_0x4d4f('0x31')]=function(_0x3d7f14,_0x19a502){var _0x43a704={},_0x4c69cb={},_0x36eede={'count':0x0,'rows':[]};var _0x4578b6=_[_0x4d4f('0x32')](db[_0x4d4f('0x33')][_0x4d4f('0x34')],function(_0x4e47e5){return{'name':_0x4e47e5[_0x4d4f('0x35')],'type':_0x4e47e5['type'][_0x4d4f('0x36')]};});_0x4c69cb['model']=_['map'](_0x4578b6,'name');_0x4c69cb[_0x4d4f('0x37')]=_['keys'](_0x3d7f14[_0x4d4f('0x37')]);_0x4c69cb[_0x4d4f('0x38')]=_[_0x4d4f('0x39')](_0x4c69cb['model'],_0x4c69cb[_0x4d4f('0x37')]);_0x43a704[_0x4d4f('0x3a')]=_[_0x4d4f('0x39')](_0x4c69cb['model'],qs[_0x4d4f('0x3b')](_0x3d7f14['query'][_0x4d4f('0x3b')]));_0x43a704[_0x4d4f('0x3a')]=_0x43a704[_0x4d4f('0x3a')][_0x4d4f('0x3c')]?_0x43a704[_0x4d4f('0x3a')]:_0x4c69cb[_0x4d4f('0x3d')];if(!_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x3e')]('nolimit')){_0x43a704['limit']=qs[_0x4d4f('0x23')](_0x3d7f14['query']['limit']);_0x43a704[_0x4d4f('0x21')]=qs[_0x4d4f('0x21')](_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x21')]);}_0x43a704[_0x4d4f('0x3f')]=qs['sort'](_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x40')]);_0x43a704['where']=qs[_0x4d4f('0x38')](_[_0x4d4f('0x41')](_0x3d7f14[_0x4d4f('0x37')],_0x4c69cb[_0x4d4f('0x38')]),_0x4578b6);if(_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x42')]){_0x43a704[_0x4d4f('0x43')]=_[_0x4d4f('0x44')](_0x43a704[_0x4d4f('0x43')],{'$or':_['map'](_0x4578b6,function(_0x55a151){if(_0x55a151[_0x4d4f('0x45')]!==_0x4d4f('0x46')){var _0x4b3ba1={};_0x4b3ba1[_0x55a151[_0x4d4f('0x2f')]]={'$like':'%'+_0x3d7f14['query']['filter']+'%'};return _0x4b3ba1;}})});}_0x43a704=_[_0x4d4f('0x44')]({},_0x43a704,_0x3d7f14[_0x4d4f('0x47')]);var _0x58b52c={'where':_0x43a704['where']};return db[_0x4d4f('0x33')][_0x4d4f('0x24')](_0x58b52c)['then'](function(_0x949a6d){_0x36eede[_0x4d4f('0x24')]=_0x949a6d;if(_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x48')]){_0x43a704[_0x4d4f('0x49')]=[{'all':!![]}];}return db['ContactItemType'][_0x4d4f('0x4a')](_0x43a704);})['then'](function(_0x45a0c1){_0x36eede[_0x4d4f('0x4b')]=_0x45a0c1;return _0x36eede;})['then'](respondWithFilteredResult(_0x19a502,_0x43a704))[_0x4d4f('0x4c')](handleError(_0x19a502,null));};exports[_0x4d4f('0x4d')]=function(_0x1f7169,_0x489abe){var _0x379b59={'raw':!![],'where':{'id':_0x1f7169[_0x4d4f('0x4e')]['id']}},_0x48caa2={};_0x48caa2['model']=_[_0x4d4f('0x4f')](db[_0x4d4f('0x33')][_0x4d4f('0x34')]);_0x48caa2[_0x4d4f('0x37')]=_[_0x4d4f('0x4f')](_0x1f7169['query']);_0x48caa2['filters']=_[_0x4d4f('0x39')](_0x48caa2[_0x4d4f('0x3d')],_0x48caa2[_0x4d4f('0x37')]);_0x379b59[_0x4d4f('0x3a')]=_['intersection'](_0x48caa2['model'],qs['fields'](_0x1f7169[_0x4d4f('0x37')][_0x4d4f('0x3b')]));_0x379b59[_0x4d4f('0x3a')]=_0x379b59[_0x4d4f('0x3a')][_0x4d4f('0x3c')]?_0x379b59[_0x4d4f('0x3a')]:_0x48caa2[_0x4d4f('0x3d')];if(_0x1f7169[_0x4d4f('0x37')][_0x4d4f('0x48')]){_0x379b59[_0x4d4f('0x49')]=[{'all':!![]}];}_0x379b59=_[_0x4d4f('0x44')]({},_0x379b59,_0x1f7169[_0x4d4f('0x47')]);return db['ContactItemType'][_0x4d4f('0x50')](_0x379b59)[_0x4d4f('0x2d')](handleEntityNotFound(_0x489abe,null))['then'](respondWithResult(_0x489abe,null))[_0x4d4f('0x4c')](handleError(_0x489abe,null));};exports['create']=function(_0x15cf38,_0x401466){return db['ContactItemType'][_0x4d4f('0x51')](_0x15cf38[_0x4d4f('0x52')],{})[_0x4d4f('0x2d')](function(_0x21d0d6){var _0x7f22f2=_0x15cf38[_0x4d4f('0x53')][_0x4d4f('0x2b')]({'plain':!![]});if(!_0x7f22f2)throw new Error(_0x4d4f('0x54'));if(_0x7f22f2[_0x4d4f('0x55')]===_0x4d4f('0x53')){var _0xa6cef=_0x21d0d6[_0x4d4f('0x2b')]({'plain':!![]});var _0x504d85=_0x4d4f('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x504d85,'userProfileId':_0x7f22f2['userProfileId']},'raw':!![]})[_0x4d4f('0x2d')](function(_0x168742){if(_0x168742&&_0x168742['autoAssociation']===0x0){return db['UserProfileResource'][_0x4d4f('0x51')]({'name':_0xa6cef[_0x4d4f('0x2f')],'resourceId':_0xa6cef['id'],'type':_0x168742['name'],'sectionId':_0x168742['id']},{})[_0x4d4f('0x2d')](function(){return _0x21d0d6;});}else{return _0x21d0d6;}})['catch'](function(_0x17b59e){logger[_0x4d4f('0x56')](_0x4d4f('0x57'),_0x17b59e);throw _0x17b59e;});}return _0x21d0d6;})[_0x4d4f('0x2d')](respondWithResult(_0x401466,0xc9))['catch'](handleError(_0x401466,null));};exports[_0x4d4f('0x29')]=function(_0x2008c3,_0x36a446){if(_0x2008c3[_0x4d4f('0x52')]['id']){delete _0x2008c3[_0x4d4f('0x52')]['id'];}return db['ContactItemType'][_0x4d4f('0x50')]({'where':{'id':_0x2008c3['params']['id']}})[_0x4d4f('0x2d')](handleEntityNotFound(_0x36a446,null))['then'](saveUpdates(_0x2008c3[_0x4d4f('0x52')],null))[_0x4d4f('0x2d')](respondWithResult(_0x36a446,null))['catch'](handleError(_0x36a446,null));};exports[_0x4d4f('0x2a')]=function(_0x1d8ae6,_0x4d08c8){return db[_0x4d4f('0x33')]['find']({'where':{'id':_0x1d8ae6[_0x4d4f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d08c8,null))['then'](db[_0x4d4f('0x58')][_0x4d4f('0x29')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1d8ae6[_0x4d4f('0x4e')]['id']}}))[_0x4d4f('0x2d')](removeEntity(_0x4d08c8,null))[_0x4d4f('0x4c')](handleError(_0x4d08c8,null));}; \ No newline at end of file +var _0x3423=['../../components/auth/service','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','ContactItemTypes','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','role','user','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','CmContactHasItem','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'];(function(_0x5b459a,_0x72a5bd){var _0x35b0dd=function(_0x287f7d){while(--_0x287f7d){_0x5b459a['push'](_0x5b459a['shift']());}};_0x35b0dd(++_0x72a5bd);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3342('0x0'));var jsonpatch=require(_0x3342('0x1'));var rp=require(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require(_0x3342('0x8'));var csv=require(_0x3342('0x9'));var ejs=require(_0x3342('0xa'));var fs=require('fs');var fs_extra=require(_0x3342('0xb'));var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0x9'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3342('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3342('0x13'));var utils=require(_0x3342('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3342('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x716d80,_0x36e1f4){_0x36e1f4=_0x36e1f4||0xcc;return function(_0x592ba8){if(_0x592ba8){return _0x716d80[_0x3342('0x16')](_0x36e1f4);}return _0x716d80[_0x3342('0x17')](_0x36e1f4)[_0x3342('0x18')]();};}function respondWithResult(_0xe4689e,_0x61fcc0){_0x61fcc0=_0x61fcc0||0xc8;return function(_0x104077){if(_0x104077){return _0xe4689e[_0x3342('0x17')](_0x61fcc0)['json'](_0x104077);}};}function respondWithFilteredResult(_0x3e44f3,_0x19bd71){return function(_0x49afe3){if(_0x49afe3){var _0x40d609=typeof _0x19bd71[_0x3342('0x19')]==='undefined'&&typeof _0x19bd71['limit']===_0x3342('0x1a');var _0x143cf1=_0x49afe3[_0x3342('0x1b')];var _0x2075cb=_0x40d609?0x0:_0x19bd71[_0x3342('0x19')];var _0x156c24=_0x40d609?_0x49afe3[_0x3342('0x1b')]:_0x19bd71[_0x3342('0x19')]+_0x19bd71[_0x3342('0x1c')];var _0x4f4c2a;if(_0x156c24>=_0x143cf1){_0x156c24=_0x143cf1;_0x4f4c2a=0xc8;}else{_0x4f4c2a=0xce;}_0x3e44f3[_0x3342('0x17')](_0x4f4c2a);return _0x3e44f3[_0x3342('0x1d')](_0x3342('0x1e'),_0x2075cb+'-'+_0x156c24+'/'+_0x143cf1)['json'](_0x49afe3);}return null;};}function patchUpdates(_0x3cb86f){return function(_0x463324){try{jsonpatch['apply'](_0x463324,_0x3cb86f,!![]);}catch(_0xe774b7){return BPromise[_0x3342('0x1f')](_0xe774b7);}return _0x463324['save']();};}function saveUpdates(_0x4e1b19,_0x5a0658){return function(_0x3f271c){if(_0x3f271c){return _0x3f271c[_0x3342('0x20')](_0x4e1b19)[_0x3342('0x21')](function(_0x2dbad1){return _0x2dbad1;});}return null;};}function removeEntity(_0xd2b87d,_0x2925a2){return function(_0x26eb87){if(_0x26eb87){return _0x26eb87[_0x3342('0x22')]()['then'](function(){var _0x30ffc9=_0x26eb87['get']({'plain':!![]});var _0x51cf45=_0x3342('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x51cf45,'resourceId':_0x30ffc9['id']}})[_0x3342('0x21')](function(){return _0x26eb87;});})['then'](function(){_0xd2b87d[_0x3342('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x524286,_0x55cddd){return function(_0x1497d9){if(!_0x1497d9){_0x524286[_0x3342('0x16')](0x194);}return _0x1497d9;};}function handleError(_0x1dd607,_0x5eef2b){_0x5eef2b=_0x5eef2b||0x1f4;return function(_0xc275a1){logger[_0x3342('0x24')](_0xc275a1[_0x3342('0x25')]);if(_0xc275a1[_0x3342('0x26')]){delete _0xc275a1['name'];}_0x1dd607[_0x3342('0x17')](_0x5eef2b)[_0x3342('0x27')](_0xc275a1);};}exports[_0x3342('0x28')]=function(_0x301114,_0xf82530){var _0x2cc691={},_0x135760={},_0x47b2a0={'count':0x0,'rows':[]};var _0x2e0bde=_['map'](db[_0x3342('0x29')][_0x3342('0x2a')],function(_0x508f87){return{'name':_0x508f87[_0x3342('0x2b')],'type':_0x508f87[_0x3342('0x2c')][_0x3342('0x2d')]};});_0x135760[_0x3342('0x2e')]=_['map'](_0x2e0bde,_0x3342('0x26'));_0x135760[_0x3342('0x2f')]=_[_0x3342('0x30')](_0x301114[_0x3342('0x2f')]);_0x135760[_0x3342('0x31')]=_[_0x3342('0x32')](_0x135760[_0x3342('0x2e')],_0x135760[_0x3342('0x2f')]);_0x2cc691[_0x3342('0x33')]=_[_0x3342('0x32')](_0x135760[_0x3342('0x2e')],qs[_0x3342('0x34')](_0x301114['query']['fields']));_0x2cc691[_0x3342('0x33')]=_0x2cc691['attributes'][_0x3342('0x35')]?_0x2cc691[_0x3342('0x33')]:_0x135760[_0x3342('0x2e')];if(!_0x301114[_0x3342('0x2f')][_0x3342('0x36')](_0x3342('0x37'))){_0x2cc691[_0x3342('0x1c')]=qs['limit'](_0x301114[_0x3342('0x2f')][_0x3342('0x1c')]);_0x2cc691[_0x3342('0x19')]=qs[_0x3342('0x19')](_0x301114[_0x3342('0x2f')]['offset']);}_0x2cc691[_0x3342('0x38')]=qs['sort'](_0x301114[_0x3342('0x2f')][_0x3342('0x39')]);_0x2cc691[_0x3342('0x3a')]=qs[_0x3342('0x31')](_['pick'](_0x301114[_0x3342('0x2f')],_0x135760['filters']),_0x2e0bde);if(_0x301114[_0x3342('0x2f')][_0x3342('0x3b')]){_0x2cc691[_0x3342('0x3a')]=_[_0x3342('0x3c')](_0x2cc691[_0x3342('0x3a')],{'$or':_[_0x3342('0x3d')](_0x2e0bde,function(_0x32ef9a){if(_0x32ef9a['type']!==_0x3342('0x3e')){var _0x355e83={};_0x355e83[_0x32ef9a['name']]={'$like':'%'+_0x301114[_0x3342('0x2f')][_0x3342('0x3b')]+'%'};return _0x355e83;}})});}_0x2cc691=_['merge']({},_0x2cc691,_0x301114[_0x3342('0x3f')]);var _0x29f0a0={'where':_0x2cc691['where']};return db['ContactItemType']['count'](_0x29f0a0)[_0x3342('0x21')](function(_0x41e727){_0x47b2a0['count']=_0x41e727;if(_0x301114[_0x3342('0x2f')][_0x3342('0x40')]){_0x2cc691[_0x3342('0x41')]=[{'all':!![]}];}return db[_0x3342('0x29')][_0x3342('0x42')](_0x2cc691);})[_0x3342('0x21')](function(_0x34de7b){_0x47b2a0[_0x3342('0x43')]=_0x34de7b;return _0x47b2a0;})['then'](respondWithFilteredResult(_0xf82530,_0x2cc691))['catch'](handleError(_0xf82530,null));};exports[_0x3342('0x44')]=function(_0x7341fa,_0x474196){var _0xee717e={'raw':!![],'where':{'id':_0x7341fa[_0x3342('0x45')]['id']}},_0x717946={};_0x717946['model']=_[_0x3342('0x30')](db[_0x3342('0x29')][_0x3342('0x2a')]);_0x717946[_0x3342('0x2f')]=_[_0x3342('0x30')](_0x7341fa[_0x3342('0x2f')]);_0x717946['filters']=_[_0x3342('0x32')](_0x717946['model'],_0x717946[_0x3342('0x2f')]);_0xee717e[_0x3342('0x33')]=_[_0x3342('0x32')](_0x717946[_0x3342('0x2e')],qs['fields'](_0x7341fa[_0x3342('0x2f')][_0x3342('0x34')]));_0xee717e['attributes']=_0xee717e[_0x3342('0x33')][_0x3342('0x35')]?_0xee717e[_0x3342('0x33')]:_0x717946[_0x3342('0x2e')];if(_0x7341fa['query'][_0x3342('0x40')]){_0xee717e[_0x3342('0x41')]=[{'all':!![]}];}_0xee717e=_['merge']({},_0xee717e,_0x7341fa[_0x3342('0x3f')]);return db['ContactItemType']['find'](_0xee717e)[_0x3342('0x21')](handleEntityNotFound(_0x474196,null))[_0x3342('0x21')](respondWithResult(_0x474196,null))[_0x3342('0x46')](handleError(_0x474196,null));};exports[_0x3342('0x47')]=function(_0x23925e,_0x171387){return db[_0x3342('0x29')]['create'](_0x23925e['body'],{})[_0x3342('0x21')](function(_0x5a9e40){var _0x26251c=_0x23925e['user']['get']({'plain':!![]});if(!_0x26251c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26251c[_0x3342('0x48')]===_0x3342('0x49')){var _0x29ccb6=_0x5a9e40[_0x3342('0x4a')]({'plain':!![]});var _0x5176d7=_0x3342('0x23');return db[_0x3342('0x4b')]['find']({'where':{'name':_0x5176d7,'userProfileId':_0x26251c[_0x3342('0x4c')]},'raw':!![]})[_0x3342('0x21')](function(_0x43c27a){if(_0x43c27a&&_0x43c27a['autoAssociation']===0x0){return db[_0x3342('0x4d')][_0x3342('0x47')]({'name':_0x29ccb6[_0x3342('0x26')],'resourceId':_0x29ccb6['id'],'type':_0x43c27a[_0x3342('0x26')],'sectionId':_0x43c27a['id']},{})[_0x3342('0x21')](function(){return _0x5a9e40;});}else{return _0x5a9e40;}})['catch'](function(_0x2699d2){logger[_0x3342('0x24')](_0x3342('0x4e'),_0x2699d2);throw _0x2699d2;});}return _0x5a9e40;})[_0x3342('0x21')](respondWithResult(_0x171387,0xc9))[_0x3342('0x46')](handleError(_0x171387,null));};exports[_0x3342('0x20')]=function(_0x3db07c,_0x47cf76){if(_0x3db07c[_0x3342('0x4f')]['id']){delete _0x3db07c['body']['id'];}return db[_0x3342('0x29')]['find']({'where':{'id':_0x3db07c[_0x3342('0x45')]['id']}})['then'](handleEntityNotFound(_0x47cf76,null))['then'](saveUpdates(_0x3db07c['body'],null))['then'](respondWithResult(_0x47cf76,null))[_0x3342('0x46')](handleError(_0x47cf76,null));};exports[_0x3342('0x22')]=function(_0x3cd098,_0x476973){return db[_0x3342('0x29')][_0x3342('0x50')]({'where':{'id':_0x3cd098[_0x3342('0x45')]['id']}})[_0x3342('0x21')](handleEntityNotFound(_0x476973,null))[_0x3342('0x21')](db[_0x3342('0x51')][_0x3342('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3cd098['params']['id']}}))['then'](removeEntity(_0x476973,null))[_0x3342('0x46')](handleError(_0x476973,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 129990f..13a7d78 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 _0x58fa=['./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58fa,0x195));var _0xa58f=function(_0x311ab4,_0x31a31b){_0x311ab4=_0x311ab4-0x0;var _0x9c9f40=_0x58fa[_0x311ab4];return _0x9c9f40;};'use strict';var _=require('lodash');var util=require(_0xa58f('0x0'));var logger=require(_0xa58f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa58f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa58f('0x3'));var config=require(_0xa58f('0x4'));var attributes=require(_0xa58f('0x5'));module[_0xa58f('0x6')]=function(_0x32113d,_0x164a3b){return _0x32113d[_0xa58f('0x7')](_0xa58f('0x8'),attributes,{'tableName':_0xa58f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa5d=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types'];(function(_0x5710fd,_0x232ba9){var _0x8355f=function(_0x4677b6){while(--_0x4677b6){_0x5710fd['push'](_0x5710fd['shift']());}};_0x8355f(++_0x232ba9);}(_0xaa5d,0x84));var _0xdaa5=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0xaa5d[_0x1559a5];return _0x17a783;};'use strict';var _=require(_0xdaa5('0x0'));var util=require(_0xdaa5('0x1'));var logger=require('../../config/logger')(_0xdaa5('0x2'));var moment=require('moment');var BPromise=require(_0xdaa5('0x3'));var rp=require(_0xdaa5('0x4'));var fs=require('fs');var path=require(_0xdaa5('0x5'));var rimraf=require('rimraf');var config=require(_0xdaa5('0x6'));var attributes=require(_0xdaa5('0x7'));module[_0xdaa5('0x8')]=function(_0x1eb369,_0x9d6905){return _0x1eb369[_0xdaa5('0x9')]('ContactItemType',attributes,{'tableName':_0xdaa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index f877712..ffec656 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 _0xea35=['ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xea35,0x11a));var _0x5ea3=function(_0x3741cf,_0xa8c157){_0x3741cf=_0x3741cf-0x0;var _0x113afb=_0xea35[_0x3741cf];return _0x113afb;};'use strict';var _=require(_0x5ea3('0x0'));var util=require(_0x5ea3('0x1'));var moment=require(_0x5ea3('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ea3('0x3'));var fs=require('fs');var Redis=require(_0x5ea3('0x4'));var db=require(_0x5ea3('0x5'))['db'];var utils=require(_0x5ea3('0x6'));var logger=require(_0x5ea3('0x7'))('rpc');var config=require(_0x5ea3('0x8'));var jayson=require(_0x5ea3('0x9'));var client=jayson[_0x5ea3('0xa')][_0x5ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29a7d1,_0x48494e,_0x3f6168){return new BPromise(function(_0x163d95,_0x1897fb){return client[_0x5ea3('0xc')](_0x29a7d1,_0x3f6168)['then'](function(_0x109200){logger[_0x5ea3('0xd')](_0x5ea3('0xe'),_0x48494e,_0x5ea3('0xf'));logger[_0x5ea3('0x10')](_0x5ea3('0x11'),_0x48494e,'request\x20sent',JSON[_0x5ea3('0x12')](_0x109200));if(_0x109200[_0x5ea3('0x13')]){if(_0x109200['error'][_0x5ea3('0x14')]===0x1f4){logger[_0x5ea3('0x13')](_0x5ea3('0xe'),_0x48494e,_0x109200[_0x5ea3('0x13')][_0x5ea3('0x15')]);return _0x1897fb(_0x109200[_0x5ea3('0x13')][_0x5ea3('0x15')]);}logger[_0x5ea3('0x13')]('ContactItemType,\x20%s,\x20%s',_0x48494e,_0x109200[_0x5ea3('0x13')][_0x5ea3('0x15')]);return _0x163d95(_0x109200['error'][_0x5ea3('0x15')]);}else{logger['info'](_0x5ea3('0xe'),_0x48494e,_0x5ea3('0xf'));_0x163d95(_0x109200[_0x5ea3('0x16')][_0x5ea3('0x15')]);}})['catch'](function(_0x13d4bb){logger[_0x5ea3('0x13')](_0x5ea3('0xe'),_0x48494e,_0x13d4bb);_0x1897fb(_0x13d4bb);});});} \ No newline at end of file +var _0x438a=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x438a,0x18b));var _0xa438=function(_0x543d6b,_0x59e222){_0x543d6b=_0x543d6b-0x0;var _0x22b6ca=_0x438a[_0x543d6b];return _0x22b6ca;};'use strict';var _=require(_0xa438('0x0'));var util=require(_0xa438('0x1'));var moment=require(_0xa438('0x2'));var BPromise=require(_0xa438('0x3'));var rs=require(_0xa438('0x4'));var fs=require('fs');var Redis=require(_0xa438('0x5'));var db=require(_0xa438('0x6'))['db'];var utils=require(_0xa438('0x7'));var logger=require(_0xa438('0x8'))(_0xa438('0x9'));var config=require(_0xa438('0xa'));var jayson=require(_0xa438('0xb'));var client=jayson[_0xa438('0xc')][_0xa438('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24fbed,_0x124b30,_0x12f794){return new BPromise(function(_0xccd60d,_0x21ad47){return client[_0xa438('0xe')](_0x24fbed,_0x12f794)[_0xa438('0xf')](function(_0x2d4c4a){logger['info']('ContactItemType,\x20%s,\x20%s',_0x124b30,_0xa438('0x10'));logger[_0xa438('0x11')](_0xa438('0x12'),_0x124b30,_0xa438('0x10'),JSON[_0xa438('0x13')](_0x2d4c4a));if(_0x2d4c4a[_0xa438('0x14')]){if(_0x2d4c4a['error'][_0xa438('0x15')]===0x1f4){logger['error'](_0xa438('0x16'),_0x124b30,_0x2d4c4a['error'][_0xa438('0x17')]);return _0x21ad47(_0x2d4c4a['error'][_0xa438('0x17')]);}logger[_0xa438('0x14')](_0xa438('0x16'),_0x124b30,_0x2d4c4a['error'][_0xa438('0x17')]);return _0xccd60d(_0x2d4c4a[_0xa438('0x14')][_0xa438('0x17')]);}else{logger[_0xa438('0x18')](_0xa438('0x16'),_0x124b30,_0xa438('0x10'));_0xccd60d(_0x2d4c4a[_0xa438('0x19')][_0xa438('0x17')]);}})[_0xa438('0x1a')](function(_0x1f113e){logger[_0xa438('0x14')](_0xa438('0x16'),_0x124b30,_0x1f113e);_0x21ad47(_0x1f113e);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 43b13f0..c0aa68b 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 _0x2773=['index','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x2773,0x121));var _0x3277=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2773[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x3277('0x0'));var util=require(_0x3277('0x1'));var path=require(_0x3277('0x2'));var timeout=require(_0x3277('0x3'));var express=require(_0x3277('0x4'));var router=express[_0x3277('0x5')]();var fs_extra=require(_0x3277('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3277('0x7'));var config=require(_0x3277('0x8'));var controller=require(_0x3277('0x9'));router[_0x3277('0xa')]('/',auth['isAuthenticated'](),controller[_0x3277('0xb')]);router[_0x3277('0xa')](_0x3277('0xc'),auth[_0x3277('0xd')](),controller[_0x3277('0xe')]);router[_0x3277('0xf')]('/',auth[_0x3277('0xd')](),controller['create']);router[_0x3277('0x10')](_0x3277('0xc'),auth[_0x3277('0xd')](),controller[_0x3277('0x11')]);router['delete'](_0x3277('0xc'),auth[_0x3277('0xd')](),controller[_0x3277('0x12')]);module[_0x3277('0x13')]=router; \ No newline at end of file +var _0x3fff=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3fd519,_0x12e245){var _0x4a9f0f=function(_0x4cca4d){while(--_0x4cca4d){_0x3fd519['push'](_0x3fd519['shift']());}};_0x4a9f0f(++_0x12e245);}(_0x3fff,0x134));var _0xf3ff=function(_0x20f17f,_0x47be7f){_0x20f17f=_0x20f17f-0x0;var _0x4e2953=_0x3fff[_0x20f17f];return _0x4e2953;};'use strict';var multer=require('multer');var util=require(_0xf3ff('0x0'));var path=require(_0xf3ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3ff('0x2'));var router=express[_0xf3ff('0x3')]();var fs_extra=require(_0xf3ff('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf3ff('0x5'));var config=require(_0xf3ff('0x6'));var controller=require(_0xf3ff('0x7'));router[_0xf3ff('0x8')]('/',auth[_0xf3ff('0x9')](),controller[_0xf3ff('0xa')]);router['get'](_0xf3ff('0xb'),auth[_0xf3ff('0x9')](),controller[_0xf3ff('0xc')]);router[_0xf3ff('0xd')]('/',auth[_0xf3ff('0x9')](),controller[_0xf3ff('0xe')]);router['put']('/:id',auth[_0xf3ff('0x9')](),controller[_0xf3ff('0xf')]);router[_0xf3ff('0x10')](_0xf3ff('0xb'),auth[_0xf3ff('0x9')](),controller[_0xf3ff('0x11')]);module[_0xf3ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 96d8a7b..86d1e83 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 _0xb7e7=['STRING','sequelize'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb7e7[_0x1ccdf7];return _0x52a0ae;};'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 +var _0x757a=['exports','STRING'];(function(_0x356261,_0x313d43){var _0x53269a=function(_0x4cc384){while(--_0x4cc384){_0x356261['push'](_0x356261['shift']());}};_0x53269a(++_0x313d43);}(_0x757a,0xde));var _0xa757=function(_0x23cfad,_0x3800d3){_0x23cfad=_0x23cfad-0x0;var _0x4d56ee=_0x757a[_0x23cfad];return _0x4d56ee;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index d28c17c..7122be5 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 _0x1ff7=['error','name','index','Dashboard','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','clone','rawAttributes','omit','createdAt','updatedAt','includeAll','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','CustomDashboards','destroy','end'];(function(_0x2c2e68,_0x4bdb36){var _0x177829=function(_0x15911a){while(--_0x15911a){_0x2c2e68['push'](_0x2c2e68['shift']());}};_0x177829(++_0x4bdb36);}(_0x1ff7,0x1ea));var _0x71ff=function(_0x5844c9,_0x12e53b){_0x5844c9=_0x5844c9-0x0;var _0x24834e=_0x1ff7[_0x5844c9];return _0x24834e;};'use strict';var emlformat=require(_0x71ff('0x0'));var rimraf=require(_0x71ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x71ff('0x2'));var rp=require(_0x71ff('0x3'));var moment=require(_0x71ff('0x4'));var BPromise=require(_0x71ff('0x5'));var Mustache=require(_0x71ff('0x6'));var util=require(_0x71ff('0x7'));var path=require('path');var sox=require(_0x71ff('0x8'));var csv=require(_0x71ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71ff('0xa'));var _=require('lodash');var squel=require(_0x71ff('0xb'));var crypto=require(_0x71ff('0xc'));var jsforce=require(_0x71ff('0xd'));var deskjs=require(_0x71ff('0xe'));var toCsv=require(_0x71ff('0x9'));var querystring=require(_0x71ff('0xf'));var Papa=require(_0x71ff('0x10'));var Redis=require(_0x71ff('0x11'));var authService=require(_0x71ff('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x71ff('0x13'));var hardwareService=require(_0x71ff('0x14'));var logger=require(_0x71ff('0x15'))(_0x71ff('0x16'));var utils=require(_0x71ff('0x17'));var config=require(_0x71ff('0x18'));var licenseUtil=require(_0x71ff('0x19'));var db=require(_0x71ff('0x1a'))['db'];config['redis']=_[_0x71ff('0x1b')](config[_0x71ff('0x1c')],{'host':_0x71ff('0x1d'),'port':0x18eb});var socket=require(_0x71ff('0x1e'))(new Redis(config[_0x71ff('0x1c')]));require(_0x71ff('0x1f'))[_0x71ff('0x20')](socket);function respondWithStatusCode(_0x47932a,_0x16ff0e){_0x16ff0e=_0x16ff0e||0xcc;return function(_0x490941){if(_0x490941){return _0x47932a[_0x71ff('0x21')](_0x16ff0e);}return _0x47932a['status'](_0x16ff0e)['end']();};}function respondWithResult(_0x5599c4,_0x36772f){_0x36772f=_0x36772f||0xc8;return function(_0x361933){if(_0x361933){return _0x5599c4[_0x71ff('0x22')](_0x36772f)[_0x71ff('0x23')](_0x361933);}};}function respondWithFilteredResult(_0x9716fe,_0x6f675a){return function(_0x3bce37){if(_0x3bce37){var _0x910fdd=typeof _0x6f675a[_0x71ff('0x24')]===_0x71ff('0x25')&&typeof _0x6f675a['limit']==='undefined';var _0x9a2658=_0x3bce37[_0x71ff('0x26')];var _0x5d1370=_0x910fdd?0x0:_0x6f675a[_0x71ff('0x24')];var _0x95710c=_0x910fdd?_0x3bce37[_0x71ff('0x26')]:_0x6f675a[_0x71ff('0x24')]+_0x6f675a[_0x71ff('0x27')];var _0x240b3c;if(_0x95710c>=_0x9a2658){_0x95710c=_0x9a2658;_0x240b3c=0xc8;}else{_0x240b3c=0xce;}_0x9716fe[_0x71ff('0x22')](_0x240b3c);return _0x9716fe[_0x71ff('0x28')](_0x71ff('0x29'),_0x5d1370+'-'+_0x95710c+'/'+_0x9a2658)[_0x71ff('0x23')](_0x3bce37);}return null;};}function patchUpdates(_0x4240c7){return function(_0x391fb5){try{jsonpatch[_0x71ff('0x2a')](_0x391fb5,_0x4240c7,!![]);}catch(_0x5918e4){return BPromise[_0x71ff('0x2b')](_0x5918e4);}return _0x391fb5['save']();};}function saveUpdates(_0x1657cd,_0x3e2be2){return function(_0x210eac){if(_0x210eac){return _0x210eac[_0x71ff('0x2c')](_0x1657cd)[_0x71ff('0x2d')](function(_0x514f94){return _0x514f94;});}return null;};}function removeEntity(_0x46e884,_0x59d4f4){return function(_0x3ef0bc){if(_0x3ef0bc){return _0x3ef0bc['destroy']()['then'](function(){var _0x4709e9=_0x3ef0bc[_0x71ff('0x2e')]({'plain':!![]});var _0xae90ec=_0x71ff('0x2f');return db['UserProfileResource'][_0x71ff('0x30')]({'where':{'type':_0xae90ec,'resourceId':_0x4709e9['id']}})[_0x71ff('0x2d')](function(){return _0x3ef0bc;});})['then'](function(){_0x46e884[_0x71ff('0x22')](0xcc)[_0x71ff('0x31')]();});}};}function handleEntityNotFound(_0x3eb6d7,_0x5a9ce2){return function(_0x11ac7f){if(!_0x11ac7f){_0x3eb6d7[_0x71ff('0x21')](0x194);}return _0x11ac7f;};}function handleError(_0x4a55ec,_0x31dca3){_0x31dca3=_0x31dca3||0x1f4;return function(_0x4ba9a7){logger[_0x71ff('0x32')](_0x4ba9a7['stack']);if(_0x4ba9a7['name']){delete _0x4ba9a7[_0x71ff('0x33')];}_0x4a55ec[_0x71ff('0x22')](_0x31dca3)['send'](_0x4ba9a7);};}exports[_0x71ff('0x34')]=function(_0x34c4fa,_0x481d45){var _0x3f16d6={},_0x5bf7fa={},_0x2c3894={'count':0x0,'rows':[]};var _0x296098=_['map'](db[_0x71ff('0x35')]['rawAttributes'],function(_0x516e86){return{'name':_0x516e86[_0x71ff('0x36')],'type':_0x516e86[_0x71ff('0x37')][_0x71ff('0x38')]};});_0x5bf7fa['model']=_[_0x71ff('0x39')](_0x296098,_0x71ff('0x33'));_0x5bf7fa['query']=_[_0x71ff('0x3a')](_0x34c4fa[_0x71ff('0x3b')]);_0x5bf7fa['filters']=_[_0x71ff('0x3c')](_0x5bf7fa[_0x71ff('0x3d')],_0x5bf7fa['query']);_0x3f16d6[_0x71ff('0x3e')]=_[_0x71ff('0x3c')](_0x5bf7fa[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x3f')]));_0x3f16d6['attributes']=_0x3f16d6['attributes'][_0x71ff('0x40')]?_0x3f16d6[_0x71ff('0x3e')]:_0x5bf7fa[_0x71ff('0x3d')];if(!_0x34c4fa[_0x71ff('0x3b')]['hasOwnProperty']('nolimit')){_0x3f16d6[_0x71ff('0x27')]=qs[_0x71ff('0x27')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x27')]);_0x3f16d6[_0x71ff('0x24')]=qs[_0x71ff('0x24')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x24')]);}_0x3f16d6['order']=qs[_0x71ff('0x41')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x41')]);_0x3f16d6['where']=qs[_0x71ff('0x42')](_[_0x71ff('0x43')](_0x34c4fa['query'],_0x5bf7fa[_0x71ff('0x42')]),_0x296098);if(_0x34c4fa[_0x71ff('0x3b')]['filter']){_0x3f16d6[_0x71ff('0x44')]=_[_0x71ff('0x45')](_0x3f16d6[_0x71ff('0x44')],{'$or':_['map'](_0x296098,function(_0x1ff80f){if(_0x1ff80f['type']!==_0x71ff('0x46')){var _0x345c0b={};_0x345c0b[_0x1ff80f[_0x71ff('0x33')]]={'$like':'%'+_0x34c4fa['query'][_0x71ff('0x47')]+'%'};return _0x345c0b;}})});}_0x3f16d6=_[_0x71ff('0x45')]({},_0x3f16d6,_0x34c4fa[_0x71ff('0x48')]);var _0x33edb2={'where':_0x3f16d6['where']};return db[_0x71ff('0x35')]['count'](_0x33edb2)['then'](function(_0x1d8756){_0x2c3894[_0x71ff('0x26')]=_0x1d8756;if(_0x34c4fa[_0x71ff('0x3b')]['includeAll']){_0x3f16d6[_0x71ff('0x49')]=[{'all':!![]}];}return db[_0x71ff('0x35')][_0x71ff('0x4a')](_0x3f16d6);})['then'](function(_0xb44ff0){_0x2c3894[_0x71ff('0x4b')]=_0xb44ff0;return _0x2c3894;})[_0x71ff('0x2d')](respondWithFilteredResult(_0x481d45,_0x3f16d6))[_0x71ff('0x4c')](handleError(_0x481d45,null));};exports[_0x71ff('0x4d')]=function(_0x3e342f,_0x530733){var _0x3eea66={'raw':![],'where':{'id':_0x3e342f[_0x71ff('0x4e')]['id']}},_0x5567cf={};_0x5567cf[_0x71ff('0x3d')]=_['keys'](db[_0x71ff('0x35')]['rawAttributes']);_0x5567cf['query']=_[_0x71ff('0x3a')](_0x3e342f[_0x71ff('0x3b')]);_0x5567cf[_0x71ff('0x42')]=_[_0x71ff('0x3c')](_0x5567cf['model'],_0x5567cf[_0x71ff('0x3b')]);_0x3eea66[_0x71ff('0x3e')]=_[_0x71ff('0x3c')](_0x5567cf[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x3e342f[_0x71ff('0x3b')][_0x71ff('0x3f')]));_0x3eea66[_0x71ff('0x3e')]=_0x3eea66[_0x71ff('0x3e')][_0x71ff('0x40')]?_0x3eea66[_0x71ff('0x3e')]:_0x5567cf['model'];if(_0x3e342f['query']['includeAll']){_0x3eea66['include']=[{'all':!![]}];}_0x3eea66=_[_0x71ff('0x45')]({},_0x3eea66,_0x3e342f['options']);return db[_0x71ff('0x35')]['find'](_0x3eea66)[_0x71ff('0x2d')](handleEntityNotFound(_0x530733,null))[_0x71ff('0x2d')](respondWithResult(_0x530733,null))[_0x71ff('0x4c')](handleError(_0x530733,null));};exports[_0x71ff('0x4f')]=function(_0x2f2b9d,_0x2661a0){return db['Dashboard'][_0x71ff('0x4f')](_0x2f2b9d[_0x71ff('0x50')],{})[_0x71ff('0x2d')](function(_0x112aa3){var _0x3c7729=_0x2f2b9d[_0x71ff('0x51')][_0x71ff('0x2e')]({'plain':!![]});if(!_0x3c7729)throw new Error(_0x71ff('0x52'));if(_0x3c7729[_0x71ff('0x53')]==='user'){var _0x17fce4=_0x112aa3[_0x71ff('0x2e')]({'plain':!![]});var _0x4786ee=_0x71ff('0x2f');return db['UserProfileSection'][_0x71ff('0x54')]({'where':{'name':_0x4786ee,'userProfileId':_0x3c7729[_0x71ff('0x55')]},'raw':!![]})[_0x71ff('0x2d')](function(_0x381447){if(_0x381447&&_0x381447[_0x71ff('0x56')]===0x0){return db[_0x71ff('0x57')][_0x71ff('0x4f')]({'name':_0x17fce4[_0x71ff('0x33')],'resourceId':_0x17fce4['id'],'type':_0x381447['name'],'sectionId':_0x381447['id']},{})[_0x71ff('0x2d')](function(){return _0x112aa3;});}else{return _0x112aa3;}})[_0x71ff('0x4c')](function(_0x3d1426){logger[_0x71ff('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d1426);throw _0x3d1426;});}return _0x112aa3;})[_0x71ff('0x2d')](respondWithResult(_0x2661a0,0xc9))[_0x71ff('0x4c')](handleError(_0x2661a0,null));};exports[_0x71ff('0x58')]=function(_0x3d46ea,_0x13f2eb){var _0x2daf94={'where':{'id':_0x3d46ea['params']['id']}},_0x22657c={};_0x22657c[_0x71ff('0x3d')]=_[_0x71ff('0x3a')](db[_0x71ff('0x35')][_0x71ff('0x59')]);_0x2daf94['attributes']=_[_0x71ff('0x3c')](_0x22657c[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x3d46ea[_0x71ff('0x3b')]['fields']));_0x2daf94[_0x71ff('0x3e')]=_0x2daf94[_0x71ff('0x3e')]['length']?_0x2daf94['attributes']:_0x22657c[_0x71ff('0x3d')];if(_0x3d46ea[_0x71ff('0x3b')]['includeAll']){_0x2daf94[_0x71ff('0x49')]=[{'all':!![]}];}_0x2daf94=_[_0x71ff('0x45')]({},_0x2daf94,_0x3d46ea['options']);return db['Dashboard']['find'](_0x2daf94)[_0x71ff('0x2d')](handleEntityNotFound(_0x13f2eb,null))[_0x71ff('0x2d')](function(_0xbbede5){if(_0xbbede5){var _0x52a078=_0xbbede5[_0x71ff('0x2e')]({'plain':!![]});_0x52a078=qs[_0x71ff('0x5a')](_0x52a078,['id',_0x71ff('0x5b'),_0x71ff('0x5c')]);_0x3d46ea[_0x71ff('0x50')]=_[_0x71ff('0x5a')](_0x3d46ea[_0x71ff('0x50')],['id',_0x71ff('0x5b'),_0x71ff('0x5c')]);return db['Dashboard']['create'](_[_0x71ff('0x45')](_0x52a078,_0x3d46ea['body']),{'include':_0x3d46ea[_0x71ff('0x3b')][_0x71ff('0x5d')]?[{'all':!![]}]:undefined})[_0x71ff('0x2d')](function(_0x384e6e){var _0x247f93=_0x3d46ea[_0x71ff('0x51')][_0x71ff('0x2e')]({'plain':!![]});if(!_0x247f93)throw new Error(_0x71ff('0x52'));if(_0x247f93['role']===_0x71ff('0x51')){var _0x2d7562=_0x384e6e['get']({'plain':!![]});var _0x30458c='CustomDashboards';return db[_0x71ff('0x5e')][_0x71ff('0x54')]({'where':{'name':_0x30458c,'userProfileId':_0x247f93['userProfileId']},'raw':!![]})[_0x71ff('0x2d')](function(_0x19e00b){if(_0x19e00b&&_0x19e00b[_0x71ff('0x56')]===0x0){return db['UserProfileResource'][_0x71ff('0x4f')]({'name':_0x2d7562['name'],'resourceId':_0x2d7562['id'],'type':_0x19e00b[_0x71ff('0x33')],'sectionId':_0x19e00b['id']},{})[_0x71ff('0x2d')](function(){return _0x384e6e;});}else{return _0x384e6e;}})['catch'](function(_0x45a8a2){logger[_0x71ff('0x32')](_0x71ff('0x5f'),_0x45a8a2);throw _0x45a8a2;});}return _0x384e6e;});}})[_0x71ff('0x2d')](respondWithResult(_0x13f2eb,0xc9))[_0x71ff('0x4c')](handleError(_0x13f2eb,null));};exports[_0x71ff('0x2c')]=function(_0x145e81,_0x56dfe8){if(_0x145e81['body']['id']){delete _0x145e81[_0x71ff('0x50')]['id'];}return db['Dashboard'][_0x71ff('0x54')]({'where':{'id':_0x145e81['params']['id']}})['then'](handleEntityNotFound(_0x56dfe8,null))['then'](saveUpdates(_0x145e81[_0x71ff('0x50')],null))[_0x71ff('0x2d')](respondWithResult(_0x56dfe8,null))[_0x71ff('0x4c')](handleError(_0x56dfe8,null));};exports['destroy']=function(_0x5a3aad,_0x4c4f45){return db['Dashboard'][_0x71ff('0x54')]({'where':{'id':_0x5a3aad[_0x71ff('0x4e')]['id']}})[_0x71ff('0x2d')](handleEntityNotFound(_0x4c4f45,null))[_0x71ff('0x2d')](removeEntity(_0x4c4f45,null))['catch'](handleError(_0x4c4f45,null));};function widgetAttributes(_0x566270){try{switch(_0x566270['type']){case'iframe':return[{'name':_0x71ff('0x60'),'value':_0x566270[_0x71ff('0x60')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0][_0x71ff('0x62')]:undefined)||_0x71ff('0x63')}];case _0x71ff('0x64'):return[{'name':_0x71ff('0x65'),'value':_0x566270[_0x71ff('0x65')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0]['value']:undefined)||''}];case _0x71ff('0x66'):return[{'name':_0x71ff('0x67'),'value':_0x566270[_0x71ff('0x67')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0][_0x71ff('0x62')]:undefined)||'HH:mm:ss'},{'name':_0x71ff('0x68'),'value':_0x566270[_0x71ff('0x68')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x1]?_0x566270[_0x71ff('0x61')][0x1]['value']:undefined)||'0.00'},{'name':_0x71ff('0x69'),'value':_0x566270['attrFontSize']||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x2]?_0x566270['attrs'][0x2][_0x71ff('0x62')]:undefined)||0xc}];case _0x71ff('0x6a'):return[{'name':'attrMetric','value':_0x566270[_0x71ff('0x6b')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270['attrs'][0x0]['value']:undefined)||_0x71ff('0x6c')},{'name':_0x71ff('0x6d'),'value':_0x566270['attrVoiceQueues']||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x1]?_0x566270[_0x71ff('0x61')][0x1]['value']:undefined)||[]},{'name':_0x71ff('0x69'),'value':_0x566270[_0x71ff('0x69')]||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x2]?_0x566270[_0x71ff('0x61')][0x2][_0x71ff('0x62')]:undefined)||0x14},{'name':_0x71ff('0x6e'),'value':_0x566270[_0x71ff('0x6e')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x3]?_0x566270[_0x71ff('0x61')][0x3]['value']:undefined)||_0x71ff('0x6f')},{'name':'attrEmailAccounts','value':_0x566270[_0x71ff('0x70')]||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x4]?_0x566270[_0x71ff('0x61')][0x4][_0x71ff('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x566270[_0x71ff('0x71')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x5]?_0x566270[_0x71ff('0x61')][0x5][_0x71ff('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x566270[_0x71ff('0x72')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x6]?_0x566270['attrs'][0x6][_0x71ff('0x62')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x566270[_0x71ff('0x73')]||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x7]?_0x566270[_0x71ff('0x61')][0x7]['value']:undefined)||''},{'name':_0x71ff('0x74'),'value':_0x566270[_0x71ff('0x74')]||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x8]?_0x566270['attrs'][0x8][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x75'),'value':_0x566270['attrChatWebsites']||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x9]?_0x566270['attrs'][0x9][_0x71ff('0x62')]:undefined)||''}];case _0x71ff('0x76'):case'pie-chart':return[{'name':_0x71ff('0x77'),'value':_0x566270[_0x71ff('0x77')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270['attrs'][0x0][_0x71ff('0x62')]:undefined)||_0x71ff('0x6c')},{'name':_0x71ff('0x78'),'value':_0x566270[_0x71ff('0x78')]||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x1]?_0x566270[_0x71ff('0x61')][0x1][_0x71ff('0x62')]:undefined)||null},{'name':_0x71ff('0x79'),'value':_0x566270[_0x71ff('0x79')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x2]?_0x566270['attrs'][0x2][_0x71ff('0x62')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x566270[_0x71ff('0x6d')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x3]?_0x566270['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x566270[_0x71ff('0x6e')]||(_0x566270['attrs']&&_0x566270['attrs'][0x4]?_0x566270[_0x71ff('0x61')][0x4]['value']:undefined)||'voice'},{'name':_0x71ff('0x70'),'value':_0x566270[_0x71ff('0x70')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x5]?_0x566270[_0x71ff('0x61')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x566270[_0x71ff('0x71')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x6]?_0x566270[_0x71ff('0x61')][0x6][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x72'),'value':_0x566270[_0x71ff('0x72')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x7]?_0x566270[_0x71ff('0x61')][0x7][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x73'),'value':_0x566270[_0x71ff('0x73')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x8]?_0x566270['attrs'][0x8][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x74'),'value':_0x566270[_0x71ff('0x74')]||(_0x566270['attrs']&&_0x566270['attrs'][0x9]?_0x566270[_0x71ff('0x61')][0x9][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x75'),'value':_0x566270[_0x71ff('0x75')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0xa]?_0x566270[_0x71ff('0x61')][0xa][_0x71ff('0x62')]:undefined)||''}];case _0x71ff('0x7a'):return[{'name':_0x71ff('0x7b'),'type':_0x566270['reportType']||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0]['type']:undefined)||null,'value':_0x566270['attrReport']||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0][_0x71ff('0x62')]:undefined)||null},{'name':_0x71ff('0x7c'),'value':_0x566270['attrRefresh']||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x1]?_0x566270[_0x71ff('0x61')][0x1][_0x71ff('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x9cbc49){logger['error'](_0x71ff('0x7d'),JSON[_0x71ff('0x7e')](_0x9cbc49));return[];}}exports[_0x71ff('0x7f')]=function(_0x116415,_0x24d8c2,_0x1d0b7d){if(_0x116415['body']['id']){delete _0x116415[_0x71ff('0x50')]['id'];}return db[_0x71ff('0x35')][_0x71ff('0x54')]({'where':{'id':_0x116415['params']['id']}})['then'](handleEntityNotFound(_0x24d8c2,null))[_0x71ff('0x2d')](function(_0x346e8f){if(_0x346e8f){_0x116415[_0x71ff('0x50')][_0x71ff('0x80')]=_0x346e8f['id'];_0x116415[_0x71ff('0x50')][_0x71ff('0x61')]=widgetAttributes(_0x116415[_0x71ff('0x50')]);return db[_0x71ff('0x81')]['create'](_0x116415[_0x71ff('0x50')]);}})['then'](respondWithResult(_0x24d8c2,null))['catch'](handleError(_0x24d8c2,null));};exports[_0x71ff('0x82')]=function(_0x35a7df,_0x2d1dc5,_0x8ad9b0){var _0x47843b={};var _0x404806={};var _0x1d3903;var _0x4d2d03;return db[_0x71ff('0x35')][_0x71ff('0x83')]({'where':{'id':_0x35a7df[_0x71ff('0x4e')]['id']}})[_0x71ff('0x2d')](handleEntityNotFound(_0x2d1dc5,null))['then'](function(_0xa6ecc7){if(_0xa6ecc7){_0x1d3903=_0xa6ecc7;_0x404806[_0x71ff('0x3d')]=_[_0x71ff('0x3a')](db['DashboardItem'][_0x71ff('0x59')]);_0x404806['query']=_[_0x71ff('0x3a')](_0x35a7df[_0x71ff('0x3b')]);_0x404806[_0x71ff('0x42')]=_['intersection'](_0x404806[_0x71ff('0x3d')],_0x404806[_0x71ff('0x3b')]);_0x47843b[_0x71ff('0x3e')]=_['intersection'](_0x404806[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x35a7df['query'][_0x71ff('0x3f')]));_0x47843b['attributes']=_0x47843b[_0x71ff('0x3e')][_0x71ff('0x40')]?_0x47843b['attributes']:_0x404806[_0x71ff('0x3d')];_0x47843b[_0x71ff('0x84')]=qs[_0x71ff('0x41')](_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x41')]);_0x47843b[_0x71ff('0x44')]=qs[_0x71ff('0x42')](_['pick'](_0x35a7df[_0x71ff('0x3b')],_0x404806[_0x71ff('0x42')]));if(_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x47')]){_0x47843b[_0x71ff('0x44')]=_[_0x71ff('0x45')](_0x47843b[_0x71ff('0x44')],{'$or':_[_0x71ff('0x39')](_0x47843b[_0x71ff('0x3e')],function(_0x181dcc){var _0x16f76c={};_0x16f76c[_0x181dcc]={'$like':'%'+_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x47')]+'%'};return _0x16f76c;})});}_0x47843b=_[_0x71ff('0x45')]({},_0x47843b,_0x35a7df[_0x71ff('0x48')]);return _0x1d3903[_0x71ff('0x82')](_0x47843b);}})['then'](function(_0x48d18b){if(_0x48d18b){_0x4d2d03=_0x48d18b[_0x71ff('0x40')];if(!_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x85')](_0x71ff('0x86'))){_0x47843b['limit']=qs['limit'](_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x27')]);_0x47843b[_0x71ff('0x24')]=qs[_0x71ff('0x24')](_0x35a7df['query'][_0x71ff('0x24')]);}return _0x1d3903[_0x71ff('0x82')](_0x47843b);}})[_0x71ff('0x2d')](function(_0x384ca9){if(_0x384ca9){return _0x384ca9?{'count':_0x4d2d03,'rows':_0x384ca9}:null;}})[_0x71ff('0x2d')](respondWithResult(_0x2d1dc5,null))[_0x71ff('0x4c')](handleError(_0x2d1dc5,null));}; \ No newline at end of file +var _0x3dc5=['params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','createdAt','updatedAt','omit','type','attrs','value','https://','custom','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','voice','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','send','index','map','Dashboard','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show'];(function(_0x4a5c75,_0x563f0b){var _0x49b598=function(_0x342f3d){while(--_0x342f3d){_0x4a5c75['push'](_0x4a5c75['shift']());}};_0x49b598(++_0x563f0b);}(_0x3dc5,0x12b));var _0x53dc=function(_0x436e41,_0x1599b9){_0x436e41=_0x436e41-0x0;var _0x1b84af=_0x3dc5[_0x436e41];return _0x1b84af;};'use strict';var emlformat=require(_0x53dc('0x0'));var rimraf=require(_0x53dc('0x1'));var zipdir=require(_0x53dc('0x2'));var jsonpatch=require(_0x53dc('0x3'));var rp=require(_0x53dc('0x4'));var moment=require('moment');var BPromise=require(_0x53dc('0x5'));var Mustache=require('mustache');var util=require(_0x53dc('0x6'));var path=require(_0x53dc('0x7'));var sox=require('sox');var csv=require(_0x53dc('0x8'));var ejs=require(_0x53dc('0x9'));var fs=require('fs');var fs_extra=require(_0x53dc('0xa'));var _=require('lodash');var squel=require(_0x53dc('0xb'));var crypto=require(_0x53dc('0xc'));var jsforce=require(_0x53dc('0xd'));var deskjs=require(_0x53dc('0xe'));var toCsv=require(_0x53dc('0x8'));var querystring=require(_0x53dc('0xf'));var Papa=require(_0x53dc('0x10'));var Redis=require('ioredis');var authService=require(_0x53dc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53dc('0x12'));var logger=require(_0x53dc('0x13'))('api');var utils=require(_0x53dc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x53dc('0x15'));var db=require('../../mysqldb')['db'];config[_0x53dc('0x16')]=_['defaults'](config[_0x53dc('0x16')],{'host':_0x53dc('0x17'),'port':0x18eb});var socket=require(_0x53dc('0x18'))(new Redis(config[_0x53dc('0x16')]));require('./dashboard.socket')[_0x53dc('0x19')](socket);function respondWithStatusCode(_0x14d1b1,_0x5a175e){_0x5a175e=_0x5a175e||0xcc;return function(_0x375468){if(_0x375468){return _0x14d1b1[_0x53dc('0x1a')](_0x5a175e);}return _0x14d1b1['status'](_0x5a175e)[_0x53dc('0x1b')]();};}function respondWithResult(_0x51ac75,_0x5284f3){_0x5284f3=_0x5284f3||0xc8;return function(_0x305470){if(_0x305470){return _0x51ac75[_0x53dc('0x1c')](_0x5284f3)['json'](_0x305470);}};}function respondWithFilteredResult(_0x5dcc68,_0x467568){return function(_0x477910){if(_0x477910){var _0x132a47=typeof _0x467568[_0x53dc('0x1d')]===_0x53dc('0x1e')&&typeof _0x467568[_0x53dc('0x1f')]===_0x53dc('0x1e');var _0x165cf8=_0x477910[_0x53dc('0x20')];var _0x5a5684=_0x132a47?0x0:_0x467568[_0x53dc('0x1d')];var _0x55b950=_0x132a47?_0x477910[_0x53dc('0x20')]:_0x467568[_0x53dc('0x1d')]+_0x467568[_0x53dc('0x1f')];var _0x1f40be;if(_0x55b950>=_0x165cf8){_0x55b950=_0x165cf8;_0x1f40be=0xc8;}else{_0x1f40be=0xce;}_0x5dcc68[_0x53dc('0x1c')](_0x1f40be);return _0x5dcc68[_0x53dc('0x21')](_0x53dc('0x22'),_0x5a5684+'-'+_0x55b950+'/'+_0x165cf8)['json'](_0x477910);}return null;};}function patchUpdates(_0x30eecc){return function(_0x568b53){try{jsonpatch[_0x53dc('0x23')](_0x568b53,_0x30eecc,!![]);}catch(_0x104b38){return BPromise[_0x53dc('0x24')](_0x104b38);}return _0x568b53['save']();};}function saveUpdates(_0xb32499,_0x2fa01e){return function(_0xfd1d12){if(_0xfd1d12){return _0xfd1d12[_0x53dc('0x25')](_0xb32499)[_0x53dc('0x26')](function(_0x158559){return _0x158559;});}return null;};}function removeEntity(_0x24bda0,_0x570704){return function(_0x36be8c){if(_0x36be8c){return _0x36be8c[_0x53dc('0x27')]()[_0x53dc('0x26')](function(){var _0x119b6a=_0x36be8c[_0x53dc('0x28')]({'plain':!![]});var _0x54c06a=_0x53dc('0x29');return db[_0x53dc('0x2a')][_0x53dc('0x27')]({'where':{'type':_0x54c06a,'resourceId':_0x119b6a['id']}})['then'](function(){return _0x36be8c;});})[_0x53dc('0x26')](function(){_0x24bda0[_0x53dc('0x1c')](0xcc)[_0x53dc('0x1b')]();});}};}function handleEntityNotFound(_0x9b6309,_0x25aeca){return function(_0x59e46b){if(!_0x59e46b){_0x9b6309['sendStatus'](0x194);}return _0x59e46b;};}function handleError(_0xf59227,_0x319ed9){_0x319ed9=_0x319ed9||0x1f4;return function(_0xaa1a5f){logger[_0x53dc('0x2b')](_0xaa1a5f['stack']);if(_0xaa1a5f['name']){delete _0xaa1a5f[_0x53dc('0x2c')];}_0xf59227[_0x53dc('0x1c')](_0x319ed9)[_0x53dc('0x2d')](_0xaa1a5f);};}exports[_0x53dc('0x2e')]=function(_0x39f491,_0x4a0b28){var _0x1f0adb={},_0x1ca2da={},_0x4ce5c5={'count':0x0,'rows':[]};var _0x27df49=_[_0x53dc('0x2f')](db[_0x53dc('0x30')][_0x53dc('0x31')],function(_0x3c4e2b){return{'name':_0x3c4e2b['fieldName'],'type':_0x3c4e2b['type'][_0x53dc('0x32')]};});_0x1ca2da[_0x53dc('0x33')]=_[_0x53dc('0x2f')](_0x27df49,_0x53dc('0x2c'));_0x1ca2da['query']=_[_0x53dc('0x34')](_0x39f491[_0x53dc('0x35')]);_0x1ca2da[_0x53dc('0x36')]=_[_0x53dc('0x37')](_0x1ca2da['model'],_0x1ca2da[_0x53dc('0x35')]);_0x1f0adb[_0x53dc('0x38')]=_[_0x53dc('0x37')](_0x1ca2da[_0x53dc('0x33')],qs[_0x53dc('0x39')](_0x39f491['query'][_0x53dc('0x39')]));_0x1f0adb[_0x53dc('0x38')]=_0x1f0adb['attributes'][_0x53dc('0x3a')]?_0x1f0adb[_0x53dc('0x38')]:_0x1ca2da['model'];if(!_0x39f491[_0x53dc('0x35')][_0x53dc('0x3b')](_0x53dc('0x3c'))){_0x1f0adb[_0x53dc('0x1f')]=qs[_0x53dc('0x1f')](_0x39f491['query']['limit']);_0x1f0adb[_0x53dc('0x1d')]=qs[_0x53dc('0x1d')](_0x39f491[_0x53dc('0x35')][_0x53dc('0x1d')]);}_0x1f0adb['order']=qs['sort'](_0x39f491[_0x53dc('0x35')][_0x53dc('0x3d')]);_0x1f0adb[_0x53dc('0x3e')]=qs[_0x53dc('0x36')](_[_0x53dc('0x3f')](_0x39f491[_0x53dc('0x35')],_0x1ca2da[_0x53dc('0x36')]),_0x27df49);if(_0x39f491['query']['filter']){_0x1f0adb[_0x53dc('0x3e')]=_[_0x53dc('0x40')](_0x1f0adb['where'],{'$or':_[_0x53dc('0x2f')](_0x27df49,function(_0x142e6b){if(_0x142e6b['type']!==_0x53dc('0x41')){var _0x42fa09={};_0x42fa09[_0x142e6b[_0x53dc('0x2c')]]={'$like':'%'+_0x39f491['query'][_0x53dc('0x42')]+'%'};return _0x42fa09;}})});}_0x1f0adb=_[_0x53dc('0x40')]({},_0x1f0adb,_0x39f491[_0x53dc('0x43')]);var _0x4591ef={'where':_0x1f0adb[_0x53dc('0x3e')]};return db['Dashboard']['count'](_0x4591ef)['then'](function(_0x5576fc){_0x4ce5c5[_0x53dc('0x20')]=_0x5576fc;if(_0x39f491[_0x53dc('0x35')][_0x53dc('0x44')]){_0x1f0adb['include']=[{'all':!![]}];}return db[_0x53dc('0x30')][_0x53dc('0x45')](_0x1f0adb);})[_0x53dc('0x26')](function(_0x1a26f5){_0x4ce5c5[_0x53dc('0x46')]=_0x1a26f5;return _0x4ce5c5;})[_0x53dc('0x26')](respondWithFilteredResult(_0x4a0b28,_0x1f0adb))[_0x53dc('0x47')](handleError(_0x4a0b28,null));};exports[_0x53dc('0x48')]=function(_0xa78a71,_0x32b58b){var _0x38810d={'raw':![],'where':{'id':_0xa78a71[_0x53dc('0x49')]['id']}},_0x509738={};_0x509738[_0x53dc('0x33')]=_['keys'](db['Dashboard'][_0x53dc('0x31')]);_0x509738[_0x53dc('0x35')]=_[_0x53dc('0x34')](_0xa78a71[_0x53dc('0x35')]);_0x509738[_0x53dc('0x36')]=_[_0x53dc('0x37')](_0x509738[_0x53dc('0x33')],_0x509738[_0x53dc('0x35')]);_0x38810d['attributes']=_[_0x53dc('0x37')](_0x509738['model'],qs[_0x53dc('0x39')](_0xa78a71[_0x53dc('0x35')]['fields']));_0x38810d[_0x53dc('0x38')]=_0x38810d[_0x53dc('0x38')][_0x53dc('0x3a')]?_0x38810d[_0x53dc('0x38')]:_0x509738['model'];if(_0xa78a71['query'][_0x53dc('0x44')]){_0x38810d['include']=[{'all':!![]}];}_0x38810d=_[_0x53dc('0x40')]({},_0x38810d,_0xa78a71[_0x53dc('0x43')]);return db[_0x53dc('0x30')][_0x53dc('0x4a')](_0x38810d)[_0x53dc('0x26')](handleEntityNotFound(_0x32b58b,null))['then'](respondWithResult(_0x32b58b,null))[_0x53dc('0x47')](handleError(_0x32b58b,null));};exports[_0x53dc('0x4b')]=function(_0x51c13b,_0x42ea99){return db[_0x53dc('0x30')][_0x53dc('0x4b')](_0x51c13b[_0x53dc('0x4c')],{})['then'](function(_0x549986){var _0x39335a=_0x51c13b[_0x53dc('0x4d')][_0x53dc('0x28')]({'plain':!![]});if(!_0x39335a)throw new Error(_0x53dc('0x4e'));if(_0x39335a['role']===_0x53dc('0x4d')){var _0x41ae23=_0x549986[_0x53dc('0x28')]({'plain':!![]});var _0x1a38c7=_0x53dc('0x29');return db[_0x53dc('0x4f')][_0x53dc('0x4a')]({'where':{'name':_0x1a38c7,'userProfileId':_0x39335a[_0x53dc('0x50')]},'raw':!![]})[_0x53dc('0x26')](function(_0x4e592e){if(_0x4e592e&&_0x4e592e[_0x53dc('0x51')]===0x0){return db[_0x53dc('0x2a')][_0x53dc('0x4b')]({'name':_0x41ae23[_0x53dc('0x2c')],'resourceId':_0x41ae23['id'],'type':_0x4e592e[_0x53dc('0x2c')],'sectionId':_0x4e592e['id']},{})[_0x53dc('0x26')](function(){return _0x549986;});}else{return _0x549986;}})[_0x53dc('0x47')](function(_0x376701){logger[_0x53dc('0x2b')](_0x53dc('0x52'),_0x376701);throw _0x376701;});}return _0x549986;})['then'](respondWithResult(_0x42ea99,0xc9))[_0x53dc('0x47')](handleError(_0x42ea99,null));};exports[_0x53dc('0x53')]=function(_0x1864a5,_0x3537e1){var _0x2ca96d={'where':{'id':_0x1864a5[_0x53dc('0x49')]['id']}},_0x1bb47e={};_0x1bb47e[_0x53dc('0x33')]=_[_0x53dc('0x34')](db[_0x53dc('0x30')][_0x53dc('0x31')]);_0x2ca96d[_0x53dc('0x38')]=_['intersection'](_0x1bb47e[_0x53dc('0x33')],qs['fields'](_0x1864a5[_0x53dc('0x35')][_0x53dc('0x39')]));_0x2ca96d[_0x53dc('0x38')]=_0x2ca96d['attributes'][_0x53dc('0x3a')]?_0x2ca96d[_0x53dc('0x38')]:_0x1bb47e['model'];if(_0x1864a5[_0x53dc('0x35')]['includeAll']){_0x2ca96d[_0x53dc('0x54')]=[{'all':!![]}];}_0x2ca96d=_[_0x53dc('0x40')]({},_0x2ca96d,_0x1864a5[_0x53dc('0x43')]);return db[_0x53dc('0x30')][_0x53dc('0x4a')](_0x2ca96d)[_0x53dc('0x26')](handleEntityNotFound(_0x3537e1,null))[_0x53dc('0x26')](function(_0x5a4123){if(_0x5a4123){var _0x5a9ed3=_0x5a4123[_0x53dc('0x28')]({'plain':!![]});_0x5a9ed3=qs['omit'](_0x5a9ed3,['id',_0x53dc('0x55'),_0x53dc('0x56')]);_0x1864a5[_0x53dc('0x4c')]=_[_0x53dc('0x57')](_0x1864a5[_0x53dc('0x4c')],['id','createdAt',_0x53dc('0x56')]);return db[_0x53dc('0x30')][_0x53dc('0x4b')](_['merge'](_0x5a9ed3,_0x1864a5[_0x53dc('0x4c')]),{'include':_0x1864a5[_0x53dc('0x35')][_0x53dc('0x44')]?[{'all':!![]}]:undefined})[_0x53dc('0x26')](function(_0x189299){var _0x3848d7=_0x1864a5[_0x53dc('0x4d')][_0x53dc('0x28')]({'plain':!![]});if(!_0x3848d7)throw new Error(_0x53dc('0x4e'));if(_0x3848d7['role']==='user'){var _0x2d1937=_0x189299[_0x53dc('0x28')]({'plain':!![]});var _0x31db6d=_0x53dc('0x29');return db[_0x53dc('0x4f')][_0x53dc('0x4a')]({'where':{'name':_0x31db6d,'userProfileId':_0x3848d7[_0x53dc('0x50')]},'raw':!![]})['then'](function(_0x588a97){if(_0x588a97&&_0x588a97['autoAssociation']===0x0){return db[_0x53dc('0x2a')][_0x53dc('0x4b')]({'name':_0x2d1937['name'],'resourceId':_0x2d1937['id'],'type':_0x588a97[_0x53dc('0x2c')],'sectionId':_0x588a97['id']},{})[_0x53dc('0x26')](function(){return _0x189299;});}else{return _0x189299;}})[_0x53dc('0x47')](function(_0x575d52){logger[_0x53dc('0x2b')](_0x53dc('0x52'),_0x575d52);throw _0x575d52;});}return _0x189299;});}})['then'](respondWithResult(_0x3537e1,0xc9))[_0x53dc('0x47')](handleError(_0x3537e1,null));};exports[_0x53dc('0x25')]=function(_0x306a6e,_0x28351d){if(_0x306a6e[_0x53dc('0x4c')]['id']){delete _0x306a6e[_0x53dc('0x4c')]['id'];}return db[_0x53dc('0x30')][_0x53dc('0x4a')]({'where':{'id':_0x306a6e[_0x53dc('0x49')]['id']}})[_0x53dc('0x26')](handleEntityNotFound(_0x28351d,null))['then'](saveUpdates(_0x306a6e[_0x53dc('0x4c')],null))[_0x53dc('0x26')](respondWithResult(_0x28351d,null))[_0x53dc('0x47')](handleError(_0x28351d,null));};exports[_0x53dc('0x27')]=function(_0x41974e,_0x415476){return db[_0x53dc('0x30')]['find']({'where':{'id':_0x41974e[_0x53dc('0x49')]['id']}})[_0x53dc('0x26')](handleEntityNotFound(_0x415476,null))[_0x53dc('0x26')](removeEntity(_0x415476,null))[_0x53dc('0x47')](handleError(_0x415476,null));};function widgetAttributes(_0x35cce6){try{switch(_0x35cce6[_0x53dc('0x58')]){case'iframe':return[{'name':'attrUrl','value':_0x35cce6['attrUrl']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x0]?_0x35cce6[_0x53dc('0x59')][0x0][_0x53dc('0x5a')]:undefined)||_0x53dc('0x5b')}];case _0x53dc('0x5c'):return[{'name':_0x53dc('0x5d'),'value':_0x35cce6[_0x53dc('0x5d')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x0]?_0x35cce6[_0x53dc('0x59')][0x0][_0x53dc('0x5a')]:undefined)||''}];case _0x53dc('0x5e'):return[{'name':'attrHourFormat','value':_0x35cce6['attrHourFormat']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x0]?_0x35cce6[_0x53dc('0x59')][0x0]['value']:undefined)||_0x53dc('0x5f')},{'name':_0x53dc('0x60'),'value':_0x35cce6[_0x53dc('0x60')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x1]?_0x35cce6[_0x53dc('0x59')][0x1][_0x53dc('0x5a')]:undefined)||_0x53dc('0x61')},{'name':_0x53dc('0x62'),'value':_0x35cce6[_0x53dc('0x62')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x2]?_0x35cce6[_0x53dc('0x59')][0x2][_0x53dc('0x5a')]:undefined)||0xc}];case _0x53dc('0x63'):return[{'name':_0x53dc('0x64'),'value':_0x35cce6[_0x53dc('0x64')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x0]?_0x35cce6[_0x53dc('0x59')][0x0][_0x53dc('0x5a')]:undefined)||_0x53dc('0x65')},{'name':_0x53dc('0x66'),'value':_0x35cce6[_0x53dc('0x66')]||(_0x35cce6['attrs']&&_0x35cce6[_0x53dc('0x59')][0x1]?_0x35cce6[_0x53dc('0x59')][0x1][_0x53dc('0x5a')]:undefined)||[]},{'name':'attrFontSize','value':_0x35cce6[_0x53dc('0x62')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6['attrs'][0x2]?_0x35cce6[_0x53dc('0x59')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x35cce6['attrChannel']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x3]?_0x35cce6[_0x53dc('0x59')][0x3]['value']:undefined)||'voice'},{'name':_0x53dc('0x67'),'value':_0x35cce6[_0x53dc('0x67')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x4]?_0x35cce6[_0x53dc('0x59')][0x4]['value']:undefined)||''},{'name':_0x53dc('0x68'),'value':_0x35cce6[_0x53dc('0x68')]||(_0x35cce6['attrs']&&_0x35cce6[_0x53dc('0x59')][0x5]?_0x35cce6['attrs'][0x5]['value']:undefined)||''},{'name':_0x53dc('0x69'),'value':_0x35cce6[_0x53dc('0x69')]||(_0x35cce6['attrs']&&_0x35cce6[_0x53dc('0x59')][0x6]?_0x35cce6[_0x53dc('0x59')][0x6][_0x53dc('0x5a')]:undefined)||''},{'name':_0x53dc('0x6a'),'value':_0x35cce6['attrOpenchannelAccounts']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6['attrs'][0x7]?_0x35cce6[_0x53dc('0x59')][0x7][_0x53dc('0x5a')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x35cce6[_0x53dc('0x6b')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x8]?_0x35cce6[_0x53dc('0x59')][0x8][_0x53dc('0x5a')]:undefined)||''},{'name':_0x53dc('0x6c'),'value':_0x35cce6['attrChatWebsites']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x9]?_0x35cce6[_0x53dc('0x59')][0x9][_0x53dc('0x5a')]:undefined)||''}];case _0x53dc('0x6d'):case'pie-chart':return[{'name':_0x53dc('0x6e'),'value':_0x35cce6['attrSerie1']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x0]?_0x35cce6[_0x53dc('0x59')][0x0][_0x53dc('0x5a')]:undefined)||_0x53dc('0x65')},{'name':_0x53dc('0x6f'),'value':_0x35cce6[_0x53dc('0x6f')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6['attrs'][0x1]?_0x35cce6[_0x53dc('0x59')][0x1][_0x53dc('0x5a')]:undefined)||null},{'name':_0x53dc('0x70'),'value':_0x35cce6[_0x53dc('0x70')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x2]?_0x35cce6[_0x53dc('0x59')][0x2]['value']:undefined)||null},{'name':_0x53dc('0x66'),'value':_0x35cce6[_0x53dc('0x66')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6['attrs'][0x3]?_0x35cce6[_0x53dc('0x59')][0x3][_0x53dc('0x5a')]:undefined)||[]},{'name':_0x53dc('0x71'),'value':_0x35cce6['attrChannel']||(_0x35cce6['attrs']&&_0x35cce6['attrs'][0x4]?_0x35cce6[_0x53dc('0x59')][0x4][_0x53dc('0x5a')]:undefined)||_0x53dc('0x72')},{'name':_0x53dc('0x67'),'value':_0x35cce6['attrEmailAccounts']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6['attrs'][0x5]?_0x35cce6[_0x53dc('0x59')][0x5][_0x53dc('0x5a')]:undefined)||''},{'name':_0x53dc('0x68'),'value':_0x35cce6[_0x53dc('0x68')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x6]?_0x35cce6['attrs'][0x6][_0x53dc('0x5a')]:undefined)||''},{'name':_0x53dc('0x69'),'value':_0x35cce6[_0x53dc('0x69')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x7]?_0x35cce6[_0x53dc('0x59')][0x7][_0x53dc('0x5a')]:undefined)||''},{'name':_0x53dc('0x6a'),'value':_0x35cce6[_0x53dc('0x6a')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x8]?_0x35cce6[_0x53dc('0x59')][0x8][_0x53dc('0x5a')]:undefined)||''},{'name':_0x53dc('0x6b'),'value':_0x35cce6[_0x53dc('0x6b')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x9]?_0x35cce6['attrs'][0x9][_0x53dc('0x5a')]:undefined)||''},{'name':_0x53dc('0x6c'),'value':_0x35cce6[_0x53dc('0x6c')]||(_0x35cce6['attrs']&&_0x35cce6['attrs'][0xa]?_0x35cce6[_0x53dc('0x59')][0xa][_0x53dc('0x5a')]:undefined)||''}];case _0x53dc('0x73'):return[{'name':_0x53dc('0x74'),'type':_0x35cce6['reportType']||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x0]?_0x35cce6[_0x53dc('0x59')][0x0][_0x53dc('0x58')]:undefined)||null,'value':_0x35cce6[_0x53dc('0x74')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6[_0x53dc('0x59')][0x0]?_0x35cce6['attrs'][0x0][_0x53dc('0x5a')]:undefined)||null},{'name':_0x53dc('0x75'),'value':_0x35cce6[_0x53dc('0x75')]||(_0x35cce6[_0x53dc('0x59')]&&_0x35cce6['attrs'][0x1]?_0x35cce6[_0x53dc('0x59')][0x1][_0x53dc('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x5d5d22){logger['error'](_0x53dc('0x76'),JSON[_0x53dc('0x77')](_0x5d5d22));return[];}}exports[_0x53dc('0x78')]=function(_0x19fba2,_0x38e850,_0x17f288){if(_0x19fba2[_0x53dc('0x4c')]['id']){delete _0x19fba2[_0x53dc('0x4c')]['id'];}return db[_0x53dc('0x30')]['find']({'where':{'id':_0x19fba2[_0x53dc('0x49')]['id']}})[_0x53dc('0x26')](handleEntityNotFound(_0x38e850,null))[_0x53dc('0x26')](function(_0x4b2ea9){if(_0x4b2ea9){_0x19fba2[_0x53dc('0x4c')][_0x53dc('0x79')]=_0x4b2ea9['id'];_0x19fba2[_0x53dc('0x4c')]['attrs']=widgetAttributes(_0x19fba2['body']);return db['DashboardItem'][_0x53dc('0x4b')](_0x19fba2['body']);}})[_0x53dc('0x26')](respondWithResult(_0x38e850,null))[_0x53dc('0x47')](handleError(_0x38e850,null));};exports[_0x53dc('0x7a')]=function(_0x4d8dfe,_0x176186,_0x17c4be){var _0x37c70d={};var _0x4a3fde={};var _0x1f72aa;var _0x4a0017;return db[_0x53dc('0x30')]['findOne']({'where':{'id':_0x4d8dfe[_0x53dc('0x49')]['id']}})[_0x53dc('0x26')](handleEntityNotFound(_0x176186,null))['then'](function(_0x487eb3){if(_0x487eb3){_0x1f72aa=_0x487eb3;_0x4a3fde[_0x53dc('0x33')]=_[_0x53dc('0x34')](db['DashboardItem']['rawAttributes']);_0x4a3fde['query']=_[_0x53dc('0x34')](_0x4d8dfe[_0x53dc('0x35')]);_0x4a3fde[_0x53dc('0x36')]=_[_0x53dc('0x37')](_0x4a3fde[_0x53dc('0x33')],_0x4a3fde['query']);_0x37c70d['attributes']=_['intersection'](_0x4a3fde[_0x53dc('0x33')],qs[_0x53dc('0x39')](_0x4d8dfe[_0x53dc('0x35')][_0x53dc('0x39')]));_0x37c70d[_0x53dc('0x38')]=_0x37c70d[_0x53dc('0x38')][_0x53dc('0x3a')]?_0x37c70d['attributes']:_0x4a3fde[_0x53dc('0x33')];_0x37c70d[_0x53dc('0x7b')]=qs[_0x53dc('0x3d')](_0x4d8dfe[_0x53dc('0x35')]['sort']);_0x37c70d[_0x53dc('0x3e')]=qs[_0x53dc('0x36')](_[_0x53dc('0x3f')](_0x4d8dfe[_0x53dc('0x35')],_0x4a3fde[_0x53dc('0x36')]));if(_0x4d8dfe[_0x53dc('0x35')][_0x53dc('0x42')]){_0x37c70d[_0x53dc('0x3e')]=_[_0x53dc('0x40')](_0x37c70d[_0x53dc('0x3e')],{'$or':_[_0x53dc('0x2f')](_0x37c70d[_0x53dc('0x38')],function(_0x31cc2f){var _0x376ff2={};_0x376ff2[_0x31cc2f]={'$like':'%'+_0x4d8dfe[_0x53dc('0x35')][_0x53dc('0x42')]+'%'};return _0x376ff2;})});}_0x37c70d=_['merge']({},_0x37c70d,_0x4d8dfe[_0x53dc('0x43')]);return _0x1f72aa[_0x53dc('0x7a')](_0x37c70d);}})[_0x53dc('0x26')](function(_0xd12a7a){if(_0xd12a7a){_0x4a0017=_0xd12a7a[_0x53dc('0x3a')];if(!_0x4d8dfe[_0x53dc('0x35')][_0x53dc('0x3b')](_0x53dc('0x3c'))){_0x37c70d['limit']=qs[_0x53dc('0x1f')](_0x4d8dfe[_0x53dc('0x35')]['limit']);_0x37c70d[_0x53dc('0x1d')]=qs[_0x53dc('0x1d')](_0x4d8dfe[_0x53dc('0x35')][_0x53dc('0x1d')]);}return _0x1f72aa[_0x53dc('0x7a')](_0x37c70d);}})[_0x53dc('0x26')](function(_0x5a21cf){if(_0x5a21cf){return _0x5a21cf?{'count':_0x4a0017,'rows':_0x5a21cf}:null;}})[_0x53dc('0x26')](respondWithResult(_0x176186,null))[_0x53dc('0x47')](handleError(_0x176186,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index ad750d9..3a8de3b 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 _0xbbe5=['save','remove','emit','events','../../mysqldb','Dashboard'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xbbe5,0x171));var _0x5bbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbe5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5bbe('0x0'));var Dashboard=require(_0x5bbe('0x1'))['db'][_0x5bbe('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5bbe('0x3'),'afterUpdate':'update','afterDestroy':_0x5bbe('0x4')};function emitEvent(_0x3f3116){return function(_0x34cf98,_0x3dcd91,_0xbc183a){DashboardEvents[_0x5bbe('0x5')](_0x3f3116+':'+_0x34cf98['id'],_0x34cf98);DashboardEvents[_0x5bbe('0x5')](_0x3f3116,_0x34cf98);_0xbc183a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x1e8b=['hasOwnProperty','hook','../../mysqldb','Dashboard','save','remove','emit'];(function(_0x2bf574,_0x2c43d6){var _0x287d91=function(_0x1a27a4){while(--_0x1a27a4){_0x2bf574['push'](_0x2bf574['shift']());}};_0x287d91(++_0x2c43d6);}(_0x1e8b,0xf0));var _0xb1e8=function(_0x29b35c,_0x2001c5){_0x29b35c=_0x29b35c-0x0;var _0x5ab131=_0x1e8b[_0x29b35c];return _0x5ab131;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xb1e8('0x0'))['db'][_0xb1e8('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb1e8('0x2'),'afterUpdate':'update','afterDestroy':_0xb1e8('0x3')};function emitEvent(_0x1b40cc){return function(_0x432c60,_0x20bfb4,_0x4ee14f){DashboardEvents['emit'](_0x1b40cc+':'+_0x432c60['id'],_0x432c60);DashboardEvents[_0xb1e8('0x4')](_0x1b40cc,_0x432c60);_0x4ee14f(null);};}for(var e in events){if(events[_0xb1e8('0x5')](e)){var event=events[e];Dashboard[_0xb1e8('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 73c2e58..67b32e9 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 _0x48eb=['define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x48eb,0x17a));var _0xb48e=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0x48eb[_0x557f5f];return _0x196eba;};'use strict';var _=require(_0xb48e('0x0'));var util=require(_0xb48e('0x1'));var logger=require(_0xb48e('0x2'))(_0xb48e('0x3'));var moment=require(_0xb48e('0x4'));var BPromise=require(_0xb48e('0x5'));var rp=require(_0xb48e('0x6'));var fs=require('fs');var path=require(_0xb48e('0x7'));var rimraf=require(_0xb48e('0x8'));var config=require(_0xb48e('0x9'));var attributes=require(_0xb48e('0xa'));module[_0xb48e('0xb')]=function(_0x48ade9,_0xac1be2){return _0x48ade9[_0xb48e('0xc')](_0xb48e('0xd'),attributes,{'tableName':_0xb48e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x415e=['./dashboard.attributes','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x328f74,_0xece85b){var _0x152f8e=function(_0x11550a){while(--_0x11550a){_0x328f74['push'](_0x328f74['shift']());}};_0x152f8e(++_0xece85b);}(_0x415e,0x1c6));var _0xe415=function(_0x20a270,_0x8b8437){_0x20a270=_0x20a270-0x0;var _0x49429a=_0x415e[_0x20a270];return _0x49429a;};'use strict';var _=require(_0xe415('0x0'));var util=require(_0xe415('0x1'));var logger=require(_0xe415('0x2'))('api');var moment=require(_0xe415('0x3'));var BPromise=require(_0xe415('0x4'));var rp=require(_0xe415('0x5'));var fs=require('fs');var path=require(_0xe415('0x6'));var rimraf=require(_0xe415('0x7'));var config=require('../../config/environment');var attributes=require(_0xe415('0x8'));module['exports']=function(_0x1f3996,_0x325844){return _0x1f3996['define'](_0xe415('0x9'),attributes,{'tableName':_0xe415('0xa'),'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 df2beed..94c48b6 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 _0x6eea=['defaults','localhost','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis'];(function(_0x57fba0,_0x34fc27){var _0x14de31=function(_0x1b3bbc){while(--_0x1b3bbc){_0x57fba0['push'](_0x57fba0['shift']());}};_0x14de31(++_0x34fc27);}(_0x6eea,0x12d));var _0xa6ee=function(_0x4d672c,_0x15a6e0){_0x4d672c=_0x4d672c-0x0;var _0x22dc61=_0x6eea[_0x4d672c];return _0x22dc61;};'use strict';var _=require(_0xa6ee('0x0'));var util=require('util');var moment=require(_0xa6ee('0x1'));var BPromise=require(_0xa6ee('0x2'));var rs=require(_0xa6ee('0x3'));var fs=require('fs');var Redis=require(_0xa6ee('0x4'));var db=require(_0xa6ee('0x5'))['db'];var utils=require(_0xa6ee('0x6'));var logger=require('../../config/logger')(_0xa6ee('0x7'));var config=require(_0xa6ee('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa6ee('0x9')]({'port':0x232a});config[_0xa6ee('0xa')]=_[_0xa6ee('0xb')](config[_0xa6ee('0xa')],{'host':_0xa6ee('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa6ee('0xd'))[_0xa6ee('0xe')](socket);function respondWithRpcPromise(_0x3a2d4c,_0x5a57a1,_0x148b28){return new BPromise(function(_0x3cd69a,_0x5be69f){return client[_0xa6ee('0xf')](_0x3a2d4c,_0x148b28)[_0xa6ee('0x10')](function(_0x2c08c3){logger['info'](_0xa6ee('0x11'),_0x5a57a1,_0xa6ee('0x12'));logger[_0xa6ee('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5a57a1,_0xa6ee('0x12'),JSON[_0xa6ee('0x14')](_0x2c08c3));if(_0x2c08c3['error']){if(_0x2c08c3[_0xa6ee('0x15')][_0xa6ee('0x16')]===0x1f4){logger['error'](_0xa6ee('0x11'),_0x5a57a1,_0x2c08c3[_0xa6ee('0x15')]['message']);return _0x5be69f(_0x2c08c3[_0xa6ee('0x15')]['message']);}logger[_0xa6ee('0x15')]('Dashboard,\x20%s,\x20%s',_0x5a57a1,_0x2c08c3[_0xa6ee('0x15')][_0xa6ee('0x17')]);return _0x3cd69a(_0x2c08c3[_0xa6ee('0x15')][_0xa6ee('0x17')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x5a57a1,_0xa6ee('0x12'));_0x3cd69a(_0x2c08c3[_0xa6ee('0x18')]['message']);}})[_0xa6ee('0x19')](function(_0x3fa023){logger[_0xa6ee('0x15')](_0xa6ee('0x11'),_0x5a57a1,_0x3fa023);_0x5be69f(_0x3fa023);});});} \ No newline at end of file +var _0xb218=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','Dashboard,\x20%s,\x20%s','message','catch','util','moment','bluebird'];(function(_0x4bbfbf,_0x583fda){var _0x376501=function(_0x47d122){while(--_0x47d122){_0x4bbfbf['push'](_0x4bbfbf['shift']());}};_0x376501(++_0x583fda);}(_0xb218,0x1bf));var _0x8b21=function(_0x5942c7,_0x5368ed){_0x5942c7=_0x5942c7-0x0;var _0x1e6f08=_0xb218[_0x5942c7];return _0x1e6f08;};'use strict';var _=require('lodash');var util=require(_0x8b21('0x0'));var moment=require(_0x8b21('0x1'));var BPromise=require(_0x8b21('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b21('0x3'));var db=require(_0x8b21('0x4'))['db'];var utils=require(_0x8b21('0x5'));var logger=require(_0x8b21('0x6'))(_0x8b21('0x7'));var config=require(_0x8b21('0x8'));var jayson=require(_0x8b21('0x9'));var client=jayson[_0x8b21('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x8b21('0xb')],{'host':_0x8b21('0xc'),'port':0x18eb});var socket=require(_0x8b21('0xd'))(new Redis(config[_0x8b21('0xb')]));require(_0x8b21('0xe'))[_0x8b21('0xf')](socket);function respondWithRpcPromise(_0xc4d1df,_0x57c4ee,_0x4ffa50){return new BPromise(function(_0x1cc03b,_0x9a08ba){return client[_0x8b21('0x10')](_0xc4d1df,_0x4ffa50)[_0x8b21('0x11')](function(_0x2e3a7c){logger['info']('Dashboard,\x20%s,\x20%s',_0x57c4ee,_0x8b21('0x12'));logger['debug'](_0x8b21('0x13'),_0x57c4ee,'request\x20sent',JSON[_0x8b21('0x14')](_0x2e3a7c));if(_0x2e3a7c['error']){if(_0x2e3a7c[_0x8b21('0x15')]['code']===0x1f4){logger[_0x8b21('0x15')](_0x8b21('0x16'),_0x57c4ee,_0x2e3a7c[_0x8b21('0x15')]['message']);return _0x9a08ba(_0x2e3a7c[_0x8b21('0x15')][_0x8b21('0x17')]);}logger[_0x8b21('0x15')]('Dashboard,\x20%s,\x20%s',_0x57c4ee,_0x2e3a7c['error'][_0x8b21('0x17')]);return _0x1cc03b(_0x2e3a7c['error'][_0x8b21('0x17')]);}else{logger['info'](_0x8b21('0x16'),_0x57c4ee,_0x8b21('0x12'));_0x1cc03b(_0x2e3a7c['result']['message']);}})[_0x8b21('0x18')](function(_0x342b6e){logger[_0x8b21('0x15')](_0x8b21('0x16'),_0x57c4ee,_0x342b6e);_0x9a08ba(_0x342b6e);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 0ccacfe..5b81415 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 _0x1c4e=['update','emit','removeListener','register','length','dashboard:','save'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x1c4e,0x76));var _0xe1c4=function(_0x5ced8b,_0x5f0335){_0x5ced8b=_0x5ced8b-0x0;var _0x535973=_0x1c4e[_0x5ced8b];return _0x535973;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xe1c4('0x0'),'remove',_0xe1c4('0x1')];function createListener(_0x4e1726,_0x425a46){return function(_0x36220f){_0x425a46[_0xe1c4('0x2')](_0x4e1726,_0x36220f);};}function removeListener(_0x57118e,_0x130ec4){return function(){DashboardEvents[_0xe1c4('0x3')](_0x57118e,_0x130ec4);};}exports[_0xe1c4('0x4')]=function(_0x5f4a13){for(var _0x174131=0x0,_0x4bdef2=events[_0xe1c4('0x5')];_0x174131<_0x4bdef2;_0x174131++){var _0x17cc88=events[_0x174131];var _0x5e1bdb=createListener(_0xe1c4('0x6')+_0x17cc88,_0x5f4a13);DashboardEvents['on'](_0x17cc88,_0x5e1bdb);}}; \ No newline at end of file +var _0x00c5=['removeListener','register','length','dashboard:','save','remove','update'];(function(_0x5c2a43,_0x1b11f6){var _0x4d67ab=function(_0x2489c2){while(--_0x2489c2){_0x5c2a43['push'](_0x5c2a43['shift']());}};_0x4d67ab(++_0x1b11f6);}(_0x00c5,0x1b6));var _0x500c=function(_0x2a5da4,_0x3102d0){_0x2a5da4=_0x2a5da4-0x0;var _0x3ba3ed=_0x00c5[_0x2a5da4];return _0x3ba3ed;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x500c('0x0'),_0x500c('0x1'),_0x500c('0x2')];function createListener(_0x2f5a1b,_0x4dec34){return function(_0x2db81a){_0x4dec34['emit'](_0x2f5a1b,_0x2db81a);};}function removeListener(_0x43a14e,_0x21c361){return function(){DashboardEvents[_0x500c('0x3')](_0x43a14e,_0x21c361);};}exports[_0x500c('0x4')]=function(_0x5507a3){for(var _0x4f12d9=0x0,_0x407190=events[_0x500c('0x5')];_0x4f12d9<_0x407190;_0x4f12d9++){var _0x4fce3b=events[_0x4f12d9];var _0x3e2e3e=createListener(_0x500c('0x6')+_0x4fce3b,_0x5507a3);DashboardEvents['on'](_0x4fce3b,_0x3e2e3e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 888cc1f..22903f8 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 _0xdfcd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','getItems','post','create','/:id/clone','/:id/items','addItem','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x308838,_0x2ca31b){var _0x3eeaec=function(_0x5d9a4b){while(--_0x5d9a4b){_0x308838['push'](_0x308838['shift']());}};_0x3eeaec(++_0x2ca31b);}(_0xdfcd,0x8b));var _0xddfc=function(_0x2b7969,_0x34e312){_0x2b7969=_0x2b7969-0x0;var _0x1c8e22=_0xdfcd[_0x2b7969];return _0x1c8e22;};'use strict';var multer=require(_0xddfc('0x0'));var util=require(_0xddfc('0x1'));var path=require(_0xddfc('0x2'));var timeout=require('connect-timeout');var express=require(_0xddfc('0x3'));var router=express[_0xddfc('0x4')]();var fs_extra=require(_0xddfc('0x5'));var auth=require(_0xddfc('0x6'));var interaction=require(_0xddfc('0x7'));var config=require(_0xddfc('0x8'));var controller=require(_0xddfc('0x9'));router[_0xddfc('0xa')]('/',auth['isAuthenticated'](),controller[_0xddfc('0xb')]);router[_0xddfc('0xa')](_0xddfc('0xc'),auth[_0xddfc('0xd')](),controller[_0xddfc('0xe')]);router[_0xddfc('0xa')]('/:id/items',auth[_0xddfc('0xd')](),controller[_0xddfc('0xf')]);router[_0xddfc('0x10')]('/',auth['isAuthenticated'](),controller[_0xddfc('0x11')]);router[_0xddfc('0x10')](_0xddfc('0x12'),auth[_0xddfc('0xd')](),controller['clone']);router[_0xddfc('0x10')](_0xddfc('0x13'),auth[_0xddfc('0xd')](),controller[_0xddfc('0x14')]);router['put'](_0xddfc('0xc'),auth[_0xddfc('0xd')](),controller['update']);router[_0xddfc('0x15')](_0xddfc('0xc'),auth[_0xddfc('0xd')](),controller[_0xddfc('0x16')]);module[_0xddfc('0x17')]=router; \ No newline at end of file +var _0xbdf8=['index','/:id','isAuthenticated','/:id/items','getItems','post','/:id/clone','addItem','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xbdf8,0x1c5));var _0x8bdf=function(_0x217a72,_0x4e77a3){_0x217a72=_0x217a72-0x0;var _0x16c639=_0xbdf8[_0x217a72];return _0x16c639;};'use strict';var multer=require(_0x8bdf('0x0'));var util=require('util');var path=require(_0x8bdf('0x1'));var timeout=require(_0x8bdf('0x2'));var express=require('express');var router=express[_0x8bdf('0x3')]();var fs_extra=require(_0x8bdf('0x4'));var auth=require(_0x8bdf('0x5'));var interaction=require(_0x8bdf('0x6'));var config=require('../../config/environment');var controller=require(_0x8bdf('0x7'));router[_0x8bdf('0x8')]('/',auth['isAuthenticated'](),controller[_0x8bdf('0x9')]);router['get'](_0x8bdf('0xa'),auth[_0x8bdf('0xb')](),controller['show']);router[_0x8bdf('0x8')](_0x8bdf('0xc'),auth[_0x8bdf('0xb')](),controller[_0x8bdf('0xd')]);router[_0x8bdf('0xe')]('/',auth[_0x8bdf('0xb')](),controller['create']);router[_0x8bdf('0xe')](_0x8bdf('0xf'),auth[_0x8bdf('0xb')](),controller['clone']);router[_0x8bdf('0xe')]('/:id/items',auth['isAuthenticated'](),controller[_0x8bdf('0x10')]);router['put'](_0x8bdf('0xa'),auth[_0x8bdf('0xb')](),controller[_0x8bdf('0x11')]);router[_0x8bdf('0x12')](_0x8bdf('0xa'),auth['isAuthenticated'](),controller[_0x8bdf('0x13')]);module[_0x8bdf('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 8a31d48..69fb62b 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 _0x5d17=['#ffffff','sequelize','squel','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x5d17,0x114));var _0x75d1=function(_0x2badac,_0x4b93fa){_0x2badac=_0x2badac-0x0;var _0x28276c=_0x5d17[_0x2badac];return _0x28276c;};'use strict';var Sequelize=require(_0x75d1('0x0'));var squel=require(_0x75d1('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x75d1('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x75d1('0x3')]('long'),'get':function(){try{return JSON[_0x75d1('0x4')](this[_0x75d1('0x5')](_0x75d1('0x6')));}catch(_0x32bd45){return[];}},'set':function(_0x56ac0a){try{this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')](_0x56ac0a));}catch(_0x1ee61b){this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x75d1('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x75d1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x75d1('0x2')]},'titleFontSize':{'type':Sequelize[_0x75d1('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7a54,0x106));var _0x47a5=function(_0x2c2aef,_0x4ce4c6){_0x2c2aef=_0x2c2aef-0x0;var _0x498ae0=_0x7a54[_0x2c2aef];return _0x498ae0;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 8aba2e5..5a9de4c 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 _0x1c75=['attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','attrFaxAccounts','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','DashboardItem','find','catch','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x22a835,_0x7e1873){var _0x894890=function(_0x274b0a){while(--_0x274b0a){_0x22a835['push'](_0x22a835['shift']());}};_0x894890(++_0x7e1873);}(_0x1c75,0xce));var _0x51c7=function(_0xa1f3d9,_0x2a0fa4){_0xa1f3d9=_0xa1f3d9-0x0;var _0x5dcb0a=_0x1c75[_0xa1f3d9];return _0x5dcb0a;};'use strict';var emlformat=require(_0x51c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51c7('0x1'));var moment=require(_0x51c7('0x2'));var BPromise=require(_0x51c7('0x3'));var Mustache=require(_0x51c7('0x4'));var util=require(_0x51c7('0x5'));var path=require(_0x51c7('0x6'));var sox=require(_0x51c7('0x7'));var csv=require(_0x51c7('0x8'));var ejs=require(_0x51c7('0x9'));var fs=require('fs');var fs_extra=require(_0x51c7('0xa'));var _=require(_0x51c7('0xb'));var squel=require('squel');var crypto=require(_0x51c7('0xc'));var jsforce=require(_0x51c7('0xd'));var deskjs=require(_0x51c7('0xe'));var toCsv=require(_0x51c7('0x8'));var querystring=require('querystring');var Papa=require(_0x51c7('0xf'));var Redis=require('ioredis');var authService=require(_0x51c7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x51c7('0x11'));var hardwareService=require(_0x51c7('0x12'));var logger=require('../../config/logger')(_0x51c7('0x13'));var utils=require(_0x51c7('0x14'));var config=require(_0x51c7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x51c7('0x16')](config[_0x51c7('0x17')],{'host':_0x51c7('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51c7('0x17')]));require('./dashboardItem.socket')[_0x51c7('0x19')](socket);function respondWithStatusCode(_0x5a5ea9,_0x2e54af){_0x2e54af=_0x2e54af||0xcc;return function(_0x48f08a){if(_0x48f08a){return _0x5a5ea9[_0x51c7('0x1a')](_0x2e54af);}return _0x5a5ea9[_0x51c7('0x1b')](_0x2e54af)[_0x51c7('0x1c')]();};}function respondWithResult(_0x39da99,_0x521d8a){_0x521d8a=_0x521d8a||0xc8;return function(_0x177e14){if(_0x177e14){return _0x39da99[_0x51c7('0x1b')](_0x521d8a)[_0x51c7('0x1d')](_0x177e14);}};}function respondWithFilteredResult(_0x3079b7,_0x209ab3){return function(_0x36b29a){if(_0x36b29a){var _0x4a64e4=typeof _0x209ab3[_0x51c7('0x1e')]===_0x51c7('0x1f')&&typeof _0x209ab3[_0x51c7('0x20')]==='undefined';var _0x3c1f43=_0x36b29a[_0x51c7('0x21')];var _0x51f751=_0x4a64e4?0x0:_0x209ab3['offset'];var _0x1fa9d5=_0x4a64e4?_0x36b29a[_0x51c7('0x21')]:_0x209ab3[_0x51c7('0x1e')]+_0x209ab3[_0x51c7('0x20')];var _0x4072b9;if(_0x1fa9d5>=_0x3c1f43){_0x1fa9d5=_0x3c1f43;_0x4072b9=0xc8;}else{_0x4072b9=0xce;}_0x3079b7[_0x51c7('0x1b')](_0x4072b9);return _0x3079b7[_0x51c7('0x22')]('Content-Range',_0x51f751+'-'+_0x1fa9d5+'/'+_0x3c1f43)[_0x51c7('0x1d')](_0x36b29a);}return null;};}function patchUpdates(_0x11c83d){return function(_0x4e0108){try{jsonpatch[_0x51c7('0x23')](_0x4e0108,_0x11c83d,!![]);}catch(_0x48b259){return BPromise[_0x51c7('0x24')](_0x48b259);}return _0x4e0108[_0x51c7('0x25')]();};}function saveUpdates(_0x414de0,_0x48e6e6){return function(_0x11f01f){if(_0x11f01f){return _0x11f01f[_0x51c7('0x26')](_0x414de0)[_0x51c7('0x27')](function(_0x13a3ad){return _0x13a3ad;});}return null;};}function removeEntity(_0x44de99,_0x1c3935){return function(_0x57fe70){if(_0x57fe70){return _0x57fe70[_0x51c7('0x28')]()['then'](function(){_0x44de99[_0x51c7('0x1b')](0xcc)[_0x51c7('0x1c')]();});}};}function handleEntityNotFound(_0x331ad9,_0x1c29fb){return function(_0x375a70){if(!_0x375a70){_0x331ad9[_0x51c7('0x1a')](0x194);}return _0x375a70;};}function handleError(_0x32ac6e,_0x198465){_0x198465=_0x198465||0x1f4;return function(_0x42745b){logger[_0x51c7('0x29')](_0x42745b[_0x51c7('0x2a')]);if(_0x42745b[_0x51c7('0x2b')]){delete _0x42745b['name'];}_0x32ac6e[_0x51c7('0x1b')](_0x198465)[_0x51c7('0x2c')](_0x42745b);};}exports[_0x51c7('0x2d')]=function(_0x2eebb4,_0x588fbb){var _0x21ff27={'raw':![],'where':{'id':_0x2eebb4[_0x51c7('0x2e')]['id']}},_0x5e90bc={};_0x5e90bc[_0x51c7('0x2f')]=_[_0x51c7('0x30')](db['DashboardItem'][_0x51c7('0x31')]);_0x5e90bc['query']=_[_0x51c7('0x30')](_0x2eebb4[_0x51c7('0x32')]);_0x5e90bc[_0x51c7('0x33')]=_[_0x51c7('0x34')](_0x5e90bc[_0x51c7('0x2f')],_0x5e90bc[_0x51c7('0x32')]);_0x21ff27[_0x51c7('0x35')]=_[_0x51c7('0x34')](_0x5e90bc[_0x51c7('0x2f')],qs[_0x51c7('0x36')](_0x2eebb4['query'][_0x51c7('0x36')]));_0x21ff27['attributes']=_0x21ff27[_0x51c7('0x35')][_0x51c7('0x37')]?_0x21ff27['attributes']:_0x5e90bc[_0x51c7('0x2f')];if(_0x2eebb4[_0x51c7('0x32')][_0x51c7('0x38')]){_0x21ff27[_0x51c7('0x39')]=[{'all':!![]}];}_0x21ff27=_['merge']({},_0x21ff27,_0x2eebb4[_0x51c7('0x3a')]);return db[_0x51c7('0x3b')][_0x51c7('0x3c')](_0x21ff27)[_0x51c7('0x27')](handleEntityNotFound(_0x588fbb,null))['then'](respondWithResult(_0x588fbb,null))[_0x51c7('0x3d')](handleError(_0x588fbb,null));};exports[_0x51c7('0x28')]=function(_0x13fa10,_0x39ba1e){return db[_0x51c7('0x3b')]['find']({'where':{'id':_0x13fa10[_0x51c7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x39ba1e,null))[_0x51c7('0x27')](removeEntity(_0x39ba1e,null))['catch'](handleError(_0x39ba1e,null));};function widgetAttributes(_0x12f54c){try{switch(_0x12f54c[_0x51c7('0x3e')]){case'iframe':return[{'name':_0x51c7('0x3f'),'value':_0x12f54c[_0x51c7('0x3f')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c['attrs'][0x0]['value']:undefined)||_0x51c7('0x41')}];case _0x51c7('0x42'):return[{'name':_0x51c7('0x43'),'value':_0x12f54c[_0x51c7('0x43')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c['attrs'][0x0][_0x51c7('0x44')]:undefined)||''}];case _0x51c7('0x45'):return[{'name':_0x51c7('0x46'),'value':_0x12f54c[_0x51c7('0x46')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x47')},{'name':_0x51c7('0x48'),'value':_0x12f54c[_0x51c7('0x48')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||'0.00'},{'name':_0x51c7('0x49'),'value':_0x12f54c[_0x51c7('0x49')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||0xc}];case _0x51c7('0x4a'):return[{'name':_0x51c7('0x4b'),'value':_0x12f54c[_0x51c7('0x4b')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x0]?_0x12f54c['attrs'][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x4c')},{'name':_0x51c7('0x4d'),'value':_0x12f54c[_0x51c7('0x4d')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||[]},{'name':_0x51c7('0x49'),'value':_0x12f54c['attrFontSize']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x12f54c[_0x51c7('0x4e')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x3]?_0x12f54c[_0x51c7('0x40')][0x3][_0x51c7('0x44')]:undefined)||_0x51c7('0x4f')},{'name':'attrEmailAccounts','value':_0x12f54c['attrEmailAccounts']||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x4]?_0x12f54c[_0x51c7('0x40')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x12f54c['attrFaxAccounts']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x5]?_0x12f54c[_0x51c7('0x40')][0x5][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x50'),'value':_0x12f54c[_0x51c7('0x50')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x6]?_0x12f54c[_0x51c7('0x40')][0x6][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x51'),'value':_0x12f54c[_0x51c7('0x51')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x7]?_0x12f54c[_0x51c7('0x40')][0x7]['value']:undefined)||''},{'name':_0x51c7('0x52'),'value':_0x12f54c[_0x51c7('0x52')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x8]?_0x12f54c[_0x51c7('0x40')][0x8]['value']:undefined)||''},{'name':_0x51c7('0x53'),'value':_0x12f54c[_0x51c7('0x53')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x9]?_0x12f54c[_0x51c7('0x40')][0x9][_0x51c7('0x44')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x51c7('0x54'),'value':_0x12f54c[_0x51c7('0x54')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x4c')},{'name':_0x51c7('0x55'),'value':_0x12f54c[_0x51c7('0x55')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||null},{'name':_0x51c7('0x56'),'value':_0x12f54c[_0x51c7('0x56')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x12f54c['attrVoiceQueues']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x3]?_0x12f54c[_0x51c7('0x40')][0x3][_0x51c7('0x44')]:undefined)||[]},{'name':'attrChannel','value':_0x12f54c[_0x51c7('0x4e')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x4]?_0x12f54c[_0x51c7('0x40')][0x4][_0x51c7('0x44')]:undefined)||'voice'},{'name':_0x51c7('0x57'),'value':_0x12f54c[_0x51c7('0x57')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x5]?_0x12f54c['attrs'][0x5]['value']:undefined)||''},{'name':_0x51c7('0x58'),'value':_0x12f54c[_0x51c7('0x58')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x6]?_0x12f54c[_0x51c7('0x40')][0x6][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x50'),'value':_0x12f54c[_0x51c7('0x50')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x7]?_0x12f54c['attrs'][0x7]['value']:undefined)||''},{'name':_0x51c7('0x51'),'value':_0x12f54c['attrOpenchannelAccounts']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x8]?_0x12f54c[_0x51c7('0x40')][0x8][_0x51c7('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x12f54c[_0x51c7('0x52')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x9]?_0x12f54c['attrs'][0x9][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x53'),'value':_0x12f54c['attrChatWebsites']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0xa]?_0x12f54c[_0x51c7('0x40')][0xa]['value']:undefined)||''}];case _0x51c7('0x59'):return[{'name':_0x51c7('0x5a'),'type':_0x12f54c[_0x51c7('0x5b')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x3e')]:undefined)||null,'value':_0x12f54c[_0x51c7('0x5a')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||null},{'name':_0x51c7('0x5c'),'value':_0x12f54c[_0x51c7('0x5c')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x1]?_0x12f54c['attrs'][0x1][_0x51c7('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x3dabf1){logger[_0x51c7('0x29')]('widgetAttributes:\x20%s',JSON[_0x51c7('0x5d')](_0x3dabf1));return[];}}exports[_0x51c7('0x5e')]=function(_0x354a96,_0x5470b7){if(_0x354a96[_0x51c7('0x5f')]){_0x354a96['body'][_0x51c7('0x40')]=widgetAttributes(_0x354a96[_0x51c7('0x5f')]);}return db['DashboardItem']['create'](_0x354a96['body'],{})[_0x51c7('0x27')](respondWithResult(_0x5470b7,0xc9))[_0x51c7('0x3d')](handleError(_0x5470b7,null));};exports[_0x51c7('0x26')]=function(_0x175bd1,_0x438e7f){if(_0x175bd1[_0x51c7('0x5f')]['id']){delete _0x175bd1[_0x51c7('0x5f')]['id'];}_0x175bd1[_0x51c7('0x5f')][_0x51c7('0x40')]=widgetAttributes(_0x175bd1['body']);return db[_0x51c7('0x3b')][_0x51c7('0x3c')]({'where':{'id':_0x175bd1['params']['id']}})[_0x51c7('0x27')](handleEntityNotFound(_0x438e7f,null))[_0x51c7('0x27')](saveUpdates(_0x175bd1[_0x51c7('0x5f')],null))['then'](respondWithResult(_0x438e7f,null))[_0x51c7('0x3d')](handleError(_0x438e7f,null));}; \ No newline at end of file +var _0x4c9d=['0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','destroy','find','params','type','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone'];(function(_0x52c7f4,_0x2b3ad5){var _0x513d5b=function(_0x39bb23){while(--_0x39bb23){_0x52c7f4['push'](_0x52c7f4['shift']());}};_0x513d5b(++_0x2b3ad5);}(_0x4c9d,0x7c));var _0xd4c9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4c9d[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xd4c9('0x0'));var rimraf=require(_0xd4c9('0x1'));var zipdir=require(_0xd4c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4c9('0x3'));var moment=require(_0xd4c9('0x4'));var BPromise=require(_0xd4c9('0x5'));var Mustache=require(_0xd4c9('0x6'));var util=require(_0xd4c9('0x7'));var path=require(_0xd4c9('0x8'));var sox=require(_0xd4c9('0x9'));var csv=require(_0xd4c9('0xa'));var ejs=require(_0xd4c9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd4c9('0xc'));var crypto=require(_0xd4c9('0xd'));var jsforce=require(_0xd4c9('0xe'));var deskjs=require(_0xd4c9('0xf'));var toCsv=require(_0xd4c9('0xa'));var querystring=require('querystring');var Papa=require(_0xd4c9('0x10'));var Redis=require(_0xd4c9('0x11'));var authService=require(_0xd4c9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4c9('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd4c9('0x14'));var db=require(_0xd4c9('0x15'))['db'];config[_0xd4c9('0x16')]=_['defaults'](config[_0xd4c9('0x16')],{'host':_0xd4c9('0x17'),'port':0x18eb});var socket=require(_0xd4c9('0x18'))(new Redis(config[_0xd4c9('0x16')]));require(_0xd4c9('0x19'))[_0xd4c9('0x1a')](socket);function respondWithStatusCode(_0x2f5f5d,_0x3d268a){_0x3d268a=_0x3d268a||0xcc;return function(_0x1e8953){if(_0x1e8953){return _0x2f5f5d[_0xd4c9('0x1b')](_0x3d268a);}return _0x2f5f5d[_0xd4c9('0x1c')](_0x3d268a)['end']();};}function respondWithResult(_0xf0246a,_0x39e486){_0x39e486=_0x39e486||0xc8;return function(_0x5ef24e){if(_0x5ef24e){return _0xf0246a[_0xd4c9('0x1c')](_0x39e486)[_0xd4c9('0x1d')](_0x5ef24e);}};}function respondWithFilteredResult(_0x4806bd,_0x4057d0){return function(_0x42fd51){if(_0x42fd51){var _0x3ca10b=typeof _0x4057d0[_0xd4c9('0x1e')]===_0xd4c9('0x1f')&&typeof _0x4057d0[_0xd4c9('0x20')]===_0xd4c9('0x1f');var _0x209dc6=_0x42fd51[_0xd4c9('0x21')];var _0x2b1e15=_0x3ca10b?0x0:_0x4057d0[_0xd4c9('0x1e')];var _0x5b70d6=_0x3ca10b?_0x42fd51['count']:_0x4057d0['offset']+_0x4057d0[_0xd4c9('0x20')];var _0x3edfc7;if(_0x5b70d6>=_0x209dc6){_0x5b70d6=_0x209dc6;_0x3edfc7=0xc8;}else{_0x3edfc7=0xce;}_0x4806bd[_0xd4c9('0x1c')](_0x3edfc7);return _0x4806bd[_0xd4c9('0x22')](_0xd4c9('0x23'),_0x2b1e15+'-'+_0x5b70d6+'/'+_0x209dc6)[_0xd4c9('0x1d')](_0x42fd51);}return null;};}function patchUpdates(_0x4cf000){return function(_0x3b9542){try{jsonpatch[_0xd4c9('0x24')](_0x3b9542,_0x4cf000,!![]);}catch(_0x1aa321){return BPromise[_0xd4c9('0x25')](_0x1aa321);}return _0x3b9542[_0xd4c9('0x26')]();};}function saveUpdates(_0x3edab5,_0x5e89fc){return function(_0x572d99){if(_0x572d99){return _0x572d99[_0xd4c9('0x27')](_0x3edab5)[_0xd4c9('0x28')](function(_0x154fdc){return _0x154fdc;});}return null;};}function removeEntity(_0x80466b,_0x52f8e4){return function(_0x423de2){if(_0x423de2){return _0x423de2['destroy']()[_0xd4c9('0x28')](function(){_0x80466b[_0xd4c9('0x1c')](0xcc)[_0xd4c9('0x29')]();});}};}function handleEntityNotFound(_0x2ded54,_0x105040){return function(_0x2417fb){if(!_0x2417fb){_0x2ded54[_0xd4c9('0x1b')](0x194);}return _0x2417fb;};}function handleError(_0x1dc82b,_0x222c78){_0x222c78=_0x222c78||0x1f4;return function(_0x5f38d1){logger[_0xd4c9('0x2a')](_0x5f38d1[_0xd4c9('0x2b')]);if(_0x5f38d1[_0xd4c9('0x2c')]){delete _0x5f38d1[_0xd4c9('0x2c')];}_0x1dc82b[_0xd4c9('0x1c')](_0x222c78)['send'](_0x5f38d1);};}exports[_0xd4c9('0x2d')]=function(_0x4bf1ca,_0x1da5d7){var _0x4fad8d={'raw':![],'where':{'id':_0x4bf1ca['params']['id']}},_0x1c394b={};_0x1c394b[_0xd4c9('0x2e')]=_[_0xd4c9('0x2f')](db[_0xd4c9('0x30')][_0xd4c9('0x31')]);_0x1c394b['query']=_[_0xd4c9('0x2f')](_0x4bf1ca[_0xd4c9('0x32')]);_0x1c394b[_0xd4c9('0x33')]=_[_0xd4c9('0x34')](_0x1c394b[_0xd4c9('0x2e')],_0x1c394b[_0xd4c9('0x32')]);_0x4fad8d['attributes']=_['intersection'](_0x1c394b[_0xd4c9('0x2e')],qs[_0xd4c9('0x35')](_0x4bf1ca[_0xd4c9('0x32')][_0xd4c9('0x35')]));_0x4fad8d['attributes']=_0x4fad8d[_0xd4c9('0x36')][_0xd4c9('0x37')]?_0x4fad8d[_0xd4c9('0x36')]:_0x1c394b[_0xd4c9('0x2e')];if(_0x4bf1ca[_0xd4c9('0x32')][_0xd4c9('0x38')]){_0x4fad8d[_0xd4c9('0x39')]=[{'all':!![]}];}_0x4fad8d=_[_0xd4c9('0x3a')]({},_0x4fad8d,_0x4bf1ca[_0xd4c9('0x3b')]);return db[_0xd4c9('0x30')]['find'](_0x4fad8d)[_0xd4c9('0x28')](handleEntityNotFound(_0x1da5d7,null))[_0xd4c9('0x28')](respondWithResult(_0x1da5d7,null))[_0xd4c9('0x3c')](handleError(_0x1da5d7,null));};exports[_0xd4c9('0x3d')]=function(_0x145bb3,_0x4bb6c4){return db['DashboardItem'][_0xd4c9('0x3e')]({'where':{'id':_0x145bb3[_0xd4c9('0x3f')]['id']}})[_0xd4c9('0x28')](handleEntityNotFound(_0x4bb6c4,null))[_0xd4c9('0x28')](removeEntity(_0x4bb6c4,null))[_0xd4c9('0x3c')](handleError(_0x4bb6c4,null));};function widgetAttributes(_0x4b286d){try{switch(_0x4b286d[_0xd4c9('0x40')]){case'iframe':return[{'name':'attrUrl','value':_0x4b286d[_0xd4c9('0x41')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x0]?_0x4b286d['attrs'][0x0]['value']:undefined)||_0xd4c9('0x43')}];case _0xd4c9('0x44'):return[{'name':_0xd4c9('0x45'),'value':_0x4b286d['attrPath']||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x0]?_0x4b286d[_0xd4c9('0x42')][0x0][_0xd4c9('0x46')]:undefined)||''}];case'clock':return[{'name':_0xd4c9('0x47'),'value':_0x4b286d['attrHourFormat']||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x0]?_0x4b286d[_0xd4c9('0x42')][0x0][_0xd4c9('0x46')]:undefined)||_0xd4c9('0x48')},{'name':_0xd4c9('0x49'),'value':_0x4b286d['attrTimezone']||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x1]?_0x4b286d['attrs'][0x1]['value']:undefined)||_0xd4c9('0x4a')},{'name':_0xd4c9('0x4b'),'value':_0x4b286d[_0xd4c9('0x4b')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x2]?_0x4b286d[_0xd4c9('0x42')][0x2][_0xd4c9('0x46')]:undefined)||0xc}];case _0xd4c9('0x4c'):return[{'name':_0xd4c9('0x4d'),'value':_0x4b286d[_0xd4c9('0x4d')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x0]?_0x4b286d[_0xd4c9('0x42')][0x0]['value']:undefined)||_0xd4c9('0x4e')},{'name':_0xd4c9('0x4f'),'value':_0x4b286d[_0xd4c9('0x4f')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d['attrs'][0x1]?_0x4b286d[_0xd4c9('0x42')][0x1]['value']:undefined)||[]},{'name':_0xd4c9('0x4b'),'value':_0x4b286d[_0xd4c9('0x4b')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d['attrs'][0x2]?_0x4b286d['attrs'][0x2]['value']:undefined)||0x14},{'name':_0xd4c9('0x50'),'value':_0x4b286d[_0xd4c9('0x50')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x3]?_0x4b286d['attrs'][0x3][_0xd4c9('0x46')]:undefined)||_0xd4c9('0x51')},{'name':_0xd4c9('0x52'),'value':_0x4b286d['attrEmailAccounts']||(_0x4b286d['attrs']&&_0x4b286d[_0xd4c9('0x42')][0x4]?_0x4b286d[_0xd4c9('0x42')][0x4]['value']:undefined)||''},{'name':_0xd4c9('0x53'),'value':_0x4b286d['attrFaxAccounts']||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x5]?_0x4b286d[_0xd4c9('0x42')][0x5][_0xd4c9('0x46')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4b286d[_0xd4c9('0x54')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x6]?_0x4b286d[_0xd4c9('0x42')][0x6][_0xd4c9('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4b286d[_0xd4c9('0x55')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d['attrs'][0x7]?_0x4b286d[_0xd4c9('0x42')][0x7]['value']:undefined)||''},{'name':_0xd4c9('0x56'),'value':_0x4b286d[_0xd4c9('0x56')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x8]?_0x4b286d[_0xd4c9('0x42')][0x8][_0xd4c9('0x46')]:undefined)||''},{'name':_0xd4c9('0x57'),'value':_0x4b286d[_0xd4c9('0x57')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x9]?_0x4b286d[_0xd4c9('0x42')][0x9][_0xd4c9('0x46')]:undefined)||''}];case _0xd4c9('0x58'):case'pie-chart':return[{'name':_0xd4c9('0x59'),'value':_0x4b286d[_0xd4c9('0x59')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d['attrs'][0x0]?_0x4b286d[_0xd4c9('0x42')][0x0][_0xd4c9('0x46')]:undefined)||_0xd4c9('0x4e')},{'name':_0xd4c9('0x5a'),'value':_0x4b286d[_0xd4c9('0x5a')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x1]?_0x4b286d['attrs'][0x1][_0xd4c9('0x46')]:undefined)||null},{'name':_0xd4c9('0x5b'),'value':_0x4b286d[_0xd4c9('0x5b')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x2]?_0x4b286d['attrs'][0x2][_0xd4c9('0x46')]:undefined)||null},{'name':_0xd4c9('0x4f'),'value':_0x4b286d['attrVoiceQueues']||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x3]?_0x4b286d[_0xd4c9('0x42')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x4b286d[_0xd4c9('0x50')]||(_0x4b286d['attrs']&&_0x4b286d[_0xd4c9('0x42')][0x4]?_0x4b286d[_0xd4c9('0x42')][0x4][_0xd4c9('0x46')]:undefined)||_0xd4c9('0x51')},{'name':'attrEmailAccounts','value':_0x4b286d[_0xd4c9('0x52')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x5]?_0x4b286d[_0xd4c9('0x42')][0x5][_0xd4c9('0x46')]:undefined)||''},{'name':_0xd4c9('0x53'),'value':_0x4b286d[_0xd4c9('0x53')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d['attrs'][0x6]?_0x4b286d[_0xd4c9('0x42')][0x6][_0xd4c9('0x46')]:undefined)||''},{'name':_0xd4c9('0x54'),'value':_0x4b286d[_0xd4c9('0x54')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x7]?_0x4b286d[_0xd4c9('0x42')][0x7][_0xd4c9('0x46')]:undefined)||''},{'name':_0xd4c9('0x55'),'value':_0x4b286d[_0xd4c9('0x55')]||(_0x4b286d['attrs']&&_0x4b286d[_0xd4c9('0x42')][0x8]?_0x4b286d[_0xd4c9('0x42')][0x8][_0xd4c9('0x46')]:undefined)||''},{'name':_0xd4c9('0x56'),'value':_0x4b286d[_0xd4c9('0x56')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x9]?_0x4b286d['attrs'][0x9][_0xd4c9('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4b286d[_0xd4c9('0x57')]||(_0x4b286d['attrs']&&_0x4b286d[_0xd4c9('0x42')][0xa]?_0x4b286d[_0xd4c9('0x42')][0xa][_0xd4c9('0x46')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x4b286d[_0xd4c9('0x5c')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d['attrs'][0x0]?_0x4b286d['attrs'][0x0]['type']:undefined)||null,'value':_0x4b286d[_0xd4c9('0x5d')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x0]?_0x4b286d[_0xd4c9('0x42')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x4b286d[_0xd4c9('0x5e')]||(_0x4b286d[_0xd4c9('0x42')]&&_0x4b286d[_0xd4c9('0x42')][0x1]?_0x4b286d[_0xd4c9('0x42')][0x1][_0xd4c9('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x50fec6){logger[_0xd4c9('0x2a')](_0xd4c9('0x5f'),JSON[_0xd4c9('0x60')](_0x50fec6));return[];}}exports[_0xd4c9('0x61')]=function(_0xd1a042,_0xd5d3e8){if(_0xd1a042[_0xd4c9('0x62')]){_0xd1a042[_0xd4c9('0x62')][_0xd4c9('0x42')]=widgetAttributes(_0xd1a042[_0xd4c9('0x62')]);}return db['DashboardItem'][_0xd4c9('0x61')](_0xd1a042[_0xd4c9('0x62')],{})['then'](respondWithResult(_0xd5d3e8,0xc9))['catch'](handleError(_0xd5d3e8,null));};exports[_0xd4c9('0x27')]=function(_0x283c17,_0x24efee){if(_0x283c17[_0xd4c9('0x62')]['id']){delete _0x283c17[_0xd4c9('0x62')]['id'];}_0x283c17['body'][_0xd4c9('0x42')]=widgetAttributes(_0x283c17[_0xd4c9('0x62')]);return db['DashboardItem'][_0xd4c9('0x3e')]({'where':{'id':_0x283c17['params']['id']}})[_0xd4c9('0x28')](handleEntityNotFound(_0x24efee,null))[_0xd4c9('0x28')](saveUpdates(_0x283c17[_0xd4c9('0x62')],null))[_0xd4c9('0x28')](respondWithResult(_0x24efee,null))[_0xd4c9('0x3c')](handleError(_0x24efee,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 6db7472..f89d26f 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 _0x3169=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','save','update','remove','emit'];(function(_0x35ea2f,_0x285af4){var _0x12962c=function(_0x229a7b){while(--_0x229a7b){_0x35ea2f['push'](_0x35ea2f['shift']());}};_0x12962c(++_0x285af4);}(_0x3169,0x14f));var _0x9316=function(_0x42e4d7,_0x4bd202){_0x42e4d7=_0x42e4d7-0x0;var _0x346cd8=_0x3169[_0x42e4d7];return _0x346cd8;};'use strict';var EventEmitter=require(_0x9316('0x0'));var DashboardItem=require(_0x9316('0x1'))['db'][_0x9316('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9316('0x3'),'afterUpdate':_0x9316('0x4'),'afterDestroy':_0x9316('0x5')};function emitEvent(_0x469ce6){return function(_0x2b613e,_0x5a9fa8,_0x30b11d){DashboardItemEvents[_0x9316('0x6')](_0x469ce6+':'+_0x2b613e['id'],_0x2b613e);DashboardItemEvents[_0x9316('0x6')](_0x469ce6,_0x2b613e);_0x30b11d(null);};}for(var e in events){if(events[_0x9316('0x7')](e)){var event=events[e];DashboardItem[_0x9316('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x1a38=['events','../../mysqldb','DashboardItem','remove','emit','hasOwnProperty','hook','exports'];(function(_0x44c708,_0x346e58){var _0x577296=function(_0x1d3af3){while(--_0x1d3af3){_0x44c708['push'](_0x44c708['shift']());}};_0x577296(++_0x346e58);}(_0x1a38,0xb0));var _0x81a3=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x1a38[_0x4429e0];return _0x51a5b3;};'use strict';var EventEmitter=require(_0x81a3('0x0'));var DashboardItem=require(_0x81a3('0x1'))['db'][_0x81a3('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x81a3('0x3')};function emitEvent(_0x2402ba){return function(_0x2faf46,_0x28fd86,_0x33a486){DashboardItemEvents[_0x81a3('0x4')](_0x2402ba+':'+_0x2faf46['id'],_0x2faf46);DashboardItemEvents[_0x81a3('0x4')](_0x2402ba,_0x2faf46);_0x33a486(null);};}for(var e in events){if(events[_0x81a3('0x5')](e)){var event=events[e];DashboardItem[_0x81a3('0x6')](e,emitEvent(event));}}module[_0x81a3('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 4692dc9..2650cf5 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 _0xaa85=['api','moment','request-promise','./dashboardItem.attributes','DashboardItem','dashboard_items','util','../../config/logger'];(function(_0x1aec82,_0x5980ba){var _0x10bd0d=function(_0x198be5){while(--_0x198be5){_0x1aec82['push'](_0x1aec82['shift']());}};_0x10bd0d(++_0x5980ba);}(_0xaa85,0x186));var _0x5aa8=function(_0x88c82f,_0x5496a7){_0x88c82f=_0x88c82f-0x0;var _0x4c6256=_0xaa85[_0x88c82f];return _0x4c6256;};'use strict';var _=require('lodash');var util=require(_0x5aa8('0x0'));var logger=require(_0x5aa8('0x1'))(_0x5aa8('0x2'));var moment=require(_0x5aa8('0x3'));var BPromise=require('bluebird');var rp=require(_0x5aa8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5aa8('0x5'));module['exports']=function(_0x89abe1,_0x1c20ab){return _0x89abe1['define'](_0x5aa8('0x6'),attributes,{'tableName':_0x5aa8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaba8=['../../config/logger','api','moment','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xaba8,0x1af));var _0x8aba=function(_0x5a88b1,_0x501071){_0x5a88b1=_0x5a88b1-0x0;var _0x1f8615=_0xaba8[_0x5a88b1];return _0x1f8615;};'use strict';var _=require(_0x8aba('0x0'));var util=require('util');var logger=require(_0x8aba('0x1'))(_0x8aba('0x2'));var moment=require(_0x8aba('0x3'));var BPromise=require('bluebird');var rp=require(_0x8aba('0x4'));var fs=require('fs');var path=require(_0x8aba('0x5'));var rimraf=require(_0x8aba('0x6'));var config=require('../../config/environment');var attributes=require(_0x8aba('0x7'));module[_0x8aba('0x8')]=function(_0x421cbf,_0x896c12){return _0x421cbf[_0x8aba('0x9')](_0x8aba('0xa'),attributes,{'tableName':_0x8aba('0xb'),'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 4b39914..2745fdf 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 _0x6534=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x56a964,_0x4e0409){var _0x1538b6=function(_0x104008){while(--_0x104008){_0x56a964['push'](_0x56a964['shift']());}};_0x1538b6(++_0x4e0409);}(_0x6534,0x1f0));var _0x4653=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6534[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4653('0x0'));var util=require(_0x4653('0x1'));var moment=require('moment');var BPromise=require(_0x4653('0x2'));var rs=require(_0x4653('0x3'));var fs=require('fs');var Redis=require(_0x4653('0x4'));var db=require(_0x4653('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4653('0x6'))(_0x4653('0x7'));var config=require(_0x4653('0x8'));var jayson=require(_0x4653('0x9'));var client=jayson[_0x4653('0xa')][_0x4653('0xb')]({'port':0x232a});config[_0x4653('0xc')]=_[_0x4653('0xd')](config[_0x4653('0xc')],{'host':_0x4653('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4653('0xc')]));require('./dashboardItem.socket')[_0x4653('0xf')](socket);function respondWithRpcPromise(_0x3962d0,_0x2c0aa9,_0x57dce6){return new BPromise(function(_0x19e7d1,_0x12ba85){return client[_0x4653('0x10')](_0x3962d0,_0x57dce6)[_0x4653('0x11')](function(_0x130a2d){logger[_0x4653('0x12')](_0x4653('0x13'),_0x2c0aa9,_0x4653('0x14'));logger[_0x4653('0x15')](_0x4653('0x16'),_0x2c0aa9,_0x4653('0x14'),JSON[_0x4653('0x17')](_0x130a2d));if(_0x130a2d[_0x4653('0x18')]){if(_0x130a2d[_0x4653('0x18')][_0x4653('0x19')]===0x1f4){logger[_0x4653('0x18')](_0x4653('0x13'),_0x2c0aa9,_0x130a2d[_0x4653('0x18')][_0x4653('0x1a')]);return _0x12ba85(_0x130a2d[_0x4653('0x18')][_0x4653('0x1a')]);}logger[_0x4653('0x18')](_0x4653('0x13'),_0x2c0aa9,_0x130a2d[_0x4653('0x18')][_0x4653('0x1a')]);return _0x19e7d1(_0x130a2d[_0x4653('0x18')]['message']);}else{logger['info'](_0x4653('0x13'),_0x2c0aa9,_0x4653('0x14'));_0x19e7d1(_0x130a2d[_0x4653('0x1b')][_0x4653('0x1a')]);}})[_0x4653('0x1c')](function(_0x16e215){logger[_0x4653('0x18')](_0x4653('0x13'),_0x2c0aa9,_0x16e215);_0x12ba85(_0x16e215);});});} \ No newline at end of file +var _0xc32a=['redis','defaults','localhost','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xc14e9b,_0x5c3047){var _0x48f298=function(_0x3ddc68){while(--_0x3ddc68){_0xc14e9b['push'](_0xc14e9b['shift']());}};_0x48f298(++_0x5c3047);}(_0xc32a,0xbf));var _0xac32=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xc32a[_0x528575];return _0x3063b7;};'use strict';var _=require('lodash');var util=require(_0xac32('0x0'));var moment=require(_0xac32('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac32('0x2'))['db'];var utils=require(_0xac32('0x3'));var logger=require(_0xac32('0x4'))(_0xac32('0x5'));var config=require(_0xac32('0x6'));var jayson=require(_0xac32('0x7'));var client=jayson['client'][_0xac32('0x8')]({'port':0x232a});config[_0xac32('0x9')]=_[_0xac32('0xa')](config[_0xac32('0x9')],{'host':_0xac32('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac32('0x9')]));require('./dashboardItem.socket')[_0xac32('0xc')](socket);function respondWithRpcPromise(_0x259cdd,_0xbb4bdc,_0x20c1c5){return new BPromise(function(_0xdd84d8,_0x568281){return client[_0xac32('0xd')](_0x259cdd,_0x20c1c5)[_0xac32('0xe')](function(_0x58419f){logger[_0xac32('0xf')](_0xac32('0x10'),_0xbb4bdc,_0xac32('0x11'));logger[_0xac32('0x12')](_0xac32('0x13'),_0xbb4bdc,_0xac32('0x11'),JSON['stringify'](_0x58419f));if(_0x58419f[_0xac32('0x14')]){if(_0x58419f[_0xac32('0x14')][_0xac32('0x15')]===0x1f4){logger['error'](_0xac32('0x10'),_0xbb4bdc,_0x58419f[_0xac32('0x14')][_0xac32('0x16')]);return _0x568281(_0x58419f[_0xac32('0x14')][_0xac32('0x16')]);}logger[_0xac32('0x14')](_0xac32('0x10'),_0xbb4bdc,_0x58419f[_0xac32('0x14')][_0xac32('0x16')]);return _0xdd84d8(_0x58419f[_0xac32('0x14')]['message']);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0xbb4bdc,_0xac32('0x11'));_0xdd84d8(_0x58419f[_0xac32('0x17')]['message']);}})[_0xac32('0x18')](function(_0x101aa0){logger[_0xac32('0x14')]('DashboardItem,\x20%s,\x20%s',_0xbb4bdc,_0x101aa0);_0x568281(_0x101aa0);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index cca683f..3474bcc 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 _0x555d=['./dashboardItem.events','remove','update','removeListener','register'];(function(_0x3ee573,_0xc9a7f4){var _0x335d5d=function(_0x2a48ed){while(--_0x2a48ed){_0x3ee573['push'](_0x3ee573['shift']());}};_0x335d5d(++_0xc9a7f4);}(_0x555d,0x172));var _0xd555=function(_0x2efbaa,_0x5e7e15){_0x2efbaa=_0x2efbaa-0x0;var _0x284c8e=_0x555d[_0x2efbaa];return _0x284c8e;};'use strict';var DashboardItemEvents=require(_0xd555('0x0'));var events=['save',_0xd555('0x1'),_0xd555('0x2')];function createListener(_0xc1ac7,_0xa5f905){return function(_0x57bf18){_0xa5f905['emit'](_0xc1ac7,_0x57bf18);};}function removeListener(_0x4ccec3,_0x2b0406){return function(){DashboardItemEvents[_0xd555('0x3')](_0x4ccec3,_0x2b0406);};}exports[_0xd555('0x4')]=function(_0x475281){for(var _0x1cb49d=0x0,_0x5a8656=events['length'];_0x1cb49d<_0x5a8656;_0x1cb49d++){var _0x201698=events[_0x1cb49d];var _0x41d8e3=createListener('dashboardItem:'+_0x201698,_0x475281);DashboardItemEvents['on'](_0x201698,_0x41d8e3);}}; \ No newline at end of file +var _0xa396=['remove','register','./dashboardItem.events'];(function(_0x5b9ebc,_0x296ad2){var _0x18f65c=function(_0x3cb6a4){while(--_0x3cb6a4){_0x5b9ebc['push'](_0x5b9ebc['shift']());}};_0x18f65c(++_0x296ad2);}(_0xa396,0xd4));var _0x6a39=function(_0x289fbe,_0x148173){_0x289fbe=_0x289fbe-0x0;var _0x34eb3e=_0xa396[_0x289fbe];return _0x34eb3e;};'use strict';var DashboardItemEvents=require(_0x6a39('0x0'));var events=['save',_0x6a39('0x1'),'update'];function createListener(_0x3d7999,_0x47c607){return function(_0x4b2f06){_0x47c607['emit'](_0x3d7999,_0x4b2f06);};}function removeListener(_0x525e34,_0x3475a4){return function(){DashboardItemEvents['removeListener'](_0x525e34,_0x3475a4);};}exports[_0x6a39('0x2')]=function(_0x406c43){for(var _0x37982d=0x0,_0x5f2492=events['length'];_0x37982d<_0x5f2492;_0x37982d++){var _0x361b8e=events[_0x37982d];var _0x393603=createListener('dashboardItem:'+_0x361b8e,_0x406c43);DashboardItemEvents['on'](_0x361b8e,_0x393603);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b7bdf15..682737e 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 _0xd118=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x7beee0,_0x276758){var _0x2f92bc=function(_0xef1085){while(--_0xef1085){_0x7beee0['push'](_0x7beee0['shift']());}};_0x2f92bc(++_0x276758);}(_0xd118,0x141));var _0x8d11=function(_0x5a6b2c,_0x59263a){_0x5a6b2c=_0x5a6b2c-0x0;var _0x5abdba=_0xd118[_0x5a6b2c];return _0x5abdba;};'use strict';var multer=require(_0x8d11('0x0'));var util=require(_0x8d11('0x1'));var path=require('path');var timeout=require(_0x8d11('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8d11('0x3'));var auth=require(_0x8d11('0x4'));var interaction=require(_0x8d11('0x5'));var config=require(_0x8d11('0x6'));var controller=require(_0x8d11('0x7'));router[_0x8d11('0x8')](_0x8d11('0x9'),auth[_0x8d11('0xa')](),controller[_0x8d11('0xb')]);router[_0x8d11('0xc')]('/',auth[_0x8d11('0xa')](),controller[_0x8d11('0xd')]);router[_0x8d11('0xe')](_0x8d11('0x9'),auth[_0x8d11('0xa')](),controller['update']);router[_0x8d11('0xf')]('/:id',auth[_0x8d11('0xa')](),controller[_0x8d11('0x10')]);module[_0x8d11('0x11')]=router; \ No newline at end of file +var _0x3313=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','post','isAuthenticated','create','update','delete','destroy','multer'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x3313,0x167));var _0x3331=function(_0x391d41,_0x108917){_0x391d41=_0x391d41-0x0;var _0x225185=_0x3313[_0x391d41];return _0x225185;};'use strict';var multer=require(_0x3331('0x0'));var util=require(_0x3331('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3331('0x2')]();var fs_extra=require(_0x3331('0x3'));var auth=require(_0x3331('0x4'));var interaction=require(_0x3331('0x5'));var config=require(_0x3331('0x6'));var controller=require(_0x3331('0x7'));router['get'](_0x3331('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x3331('0x9')]('/',auth[_0x3331('0xa')](),controller[_0x3331('0xb')]);router['put'](_0x3331('0x8'),auth['isAuthenticated'](),controller[_0x3331('0xc')]);router[_0x3331('0xd')](_0x3331('0x8'),auth[_0x3331('0xa')](),controller[_0x3331('0xe')]);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 e35dc6c..714c41e 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 _0x7fb2=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x7fb2,0xc4));var _0x27fb=function(_0x143833,_0x227cc4){_0x143833=_0x143833-0x0;var _0x5f564d=_0x7fb2[_0x143833];return _0x5f564d;};'use strict';var Sequelize=require(_0x27fb('0x0'));module[_0x27fb('0x1')]={'name':{'type':Sequelize[_0x27fb('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x27fb('0x3')](_0x27fb('0x4'),_0x27fb('0x5'),_0x27fb('0x6')),'allowNull':![],'defaultValue':_0x27fb('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfae3=['sequelize','exports','STRING','ENUM','second','third','first'];(function(_0x20f5ea,_0x5146ef){var _0x3dee4f=function(_0x3c418f){while(--_0x3c418f){_0x20f5ea['push'](_0x20f5ea['shift']());}};_0x3dee4f(++_0x5146ef);}(_0xfae3,0x111));var _0x3fae=function(_0x5c879e,_0xe58074){_0x5c879e=_0x5c879e-0x0;var _0x30942b=_0xfae3[_0x5c879e];return _0x30942b;};'use strict';var Sequelize=require(_0x3fae('0x0'));module[_0x3fae('0x1')]={'name':{'type':Sequelize[_0x3fae('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x3fae('0x3')]('first',_0x3fae('0x4'),_0x3fae('0x5')),'allowNull':![],'defaultValue':_0x3fae('0x6')},'description':{'type':Sequelize[_0x3fae('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index af6d2a3..0d90ba0 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 _0xb0b0=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','sendStatus','error','stack','name','send','index','map','Disposition','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x5d9244,_0x497732){var _0x44f1eb=function(_0x3e9f4b){while(--_0x3e9f4b){_0x5d9244['push'](_0x5d9244['shift']());}};_0x44f1eb(++_0x497732);}(_0xb0b0,0x196));var _0x0b0b=function(_0x1f4af2,_0x1d0e3f){_0x1f4af2=_0x1f4af2-0x0;var _0x585c30=_0xb0b0[_0x1f4af2];return _0x585c30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0b0b('0x0'));var jsonpatch=require(_0x0b0b('0x1'));var rp=require(_0x0b0b('0x2'));var moment=require(_0x0b0b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0b0b('0x4'));var util=require(_0x0b0b('0x5'));var path=require(_0x0b0b('0x6'));var sox=require('sox');var csv=require(_0x0b0b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b0b('0x8'));var _=require(_0x0b0b('0x9'));var squel=require(_0x0b0b('0xa'));var crypto=require(_0x0b0b('0xb'));var jsforce=require(_0x0b0b('0xc'));var deskjs=require(_0x0b0b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b0b('0xe'));var Papa=require(_0x0b0b('0xf'));var Redis=require(_0x0b0b('0x10'));var authService=require(_0x0b0b('0x11'));var qs=require(_0x0b0b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b0b('0x13'))(_0x0b0b('0x14'));var utils=require(_0x0b0b('0x15'));var config=require(_0x0b0b('0x16'));var licenseUtil=require(_0x0b0b('0x17'));var db=require(_0x0b0b('0x18'))['db'];function respondWithStatusCode(_0x28b5b0,_0x14ddb6){_0x14ddb6=_0x14ddb6||0xcc;return function(_0x4ba9ce){if(_0x4ba9ce){return _0x28b5b0['sendStatus'](_0x14ddb6);}return _0x28b5b0[_0x0b0b('0x19')](_0x14ddb6)[_0x0b0b('0x1a')]();};}function respondWithResult(_0x47885a,_0x5a1594){_0x5a1594=_0x5a1594||0xc8;return function(_0x1006e9){if(_0x1006e9){return _0x47885a[_0x0b0b('0x19')](_0x5a1594)[_0x0b0b('0x1b')](_0x1006e9);}};}function respondWithFilteredResult(_0x14c2b5,_0x5d4b0c){return function(_0x4a2fab){if(_0x4a2fab){var _0x33b749=typeof _0x5d4b0c[_0x0b0b('0x1c')]==='undefined'&&typeof _0x5d4b0c[_0x0b0b('0x1d')]==='undefined';var _0x5d5c3b=_0x4a2fab[_0x0b0b('0x1e')];var _0x287a17=_0x33b749?0x0:_0x5d4b0c[_0x0b0b('0x1c')];var _0x1503a2=_0x33b749?_0x4a2fab[_0x0b0b('0x1e')]:_0x5d4b0c[_0x0b0b('0x1c')]+_0x5d4b0c[_0x0b0b('0x1d')];var _0x5b2876;if(_0x1503a2>=_0x5d5c3b){_0x1503a2=_0x5d5c3b;_0x5b2876=0xc8;}else{_0x5b2876=0xce;}_0x14c2b5['status'](_0x5b2876);return _0x14c2b5[_0x0b0b('0x1f')](_0x0b0b('0x20'),_0x287a17+'-'+_0x1503a2+'/'+_0x5d5c3b)['json'](_0x4a2fab);}return null;};}function patchUpdates(_0x1bb627){return function(_0x151002){try{jsonpatch[_0x0b0b('0x21')](_0x151002,_0x1bb627,!![]);}catch(_0x355df0){return BPromise[_0x0b0b('0x22')](_0x355df0);}return _0x151002[_0x0b0b('0x23')]();};}function saveUpdates(_0x1e445f,_0x53391d){return function(_0x4fcba6){if(_0x4fcba6){return _0x4fcba6[_0x0b0b('0x24')](_0x1e445f)[_0x0b0b('0x25')](function(_0x1edf75){return _0x1edf75;});}return null;};}function removeEntity(_0x4adcda,_0x31c938){return function(_0x313323){if(_0x313323){return _0x313323[_0x0b0b('0x26')]()[_0x0b0b('0x25')](function(){var _0x2a2600=_0x313323['get']({'plain':!![]});var _0x3e964e=_0x0b0b('0x27');return db[_0x0b0b('0x28')][_0x0b0b('0x26')]({'where':{'type':_0x3e964e,'resourceId':_0x2a2600['id']}})[_0x0b0b('0x25')](function(){return _0x313323;});})[_0x0b0b('0x25')](function(){_0x4adcda[_0x0b0b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x161be7,_0x5d3c9a){return function(_0x5136f0){if(!_0x5136f0){_0x161be7[_0x0b0b('0x29')](0x194);}return _0x5136f0;};}function handleError(_0x2e019d,_0x1ac79e){_0x1ac79e=_0x1ac79e||0x1f4;return function(_0x3f6c03){logger[_0x0b0b('0x2a')](_0x3f6c03[_0x0b0b('0x2b')]);if(_0x3f6c03['name']){delete _0x3f6c03[_0x0b0b('0x2c')];}_0x2e019d[_0x0b0b('0x19')](_0x1ac79e)[_0x0b0b('0x2d')](_0x3f6c03);};}exports[_0x0b0b('0x2e')]=function(_0x425d0a,_0x22413b){var _0x223077={},_0x32196b={},_0xde84e1={'count':0x0,'rows':[]};var _0x1f4090=_[_0x0b0b('0x2f')](db[_0x0b0b('0x30')]['rawAttributes'],function(_0x36a101){return{'name':_0x36a101['fieldName'],'type':_0x36a101[_0x0b0b('0x31')]['key']};});_0x32196b[_0x0b0b('0x32')]=_[_0x0b0b('0x2f')](_0x1f4090,'name');_0x32196b[_0x0b0b('0x33')]=_[_0x0b0b('0x34')](_0x425d0a['query']);_0x32196b[_0x0b0b('0x35')]=_[_0x0b0b('0x36')](_0x32196b[_0x0b0b('0x32')],_0x32196b[_0x0b0b('0x33')]);_0x223077[_0x0b0b('0x37')]=_['intersection'](_0x32196b['model'],qs[_0x0b0b('0x38')](_0x425d0a[_0x0b0b('0x33')]['fields']));_0x223077['attributes']=_0x223077[_0x0b0b('0x37')]['length']?_0x223077[_0x0b0b('0x37')]:_0x32196b[_0x0b0b('0x32')];if(!_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x39')]('nolimit')){_0x223077['limit']=qs[_0x0b0b('0x1d')](_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x1d')]);_0x223077[_0x0b0b('0x1c')]=qs[_0x0b0b('0x1c')](_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x1c')]);}_0x223077[_0x0b0b('0x3a')]=qs[_0x0b0b('0x3b')](_0x425d0a[_0x0b0b('0x33')]['sort']);_0x223077[_0x0b0b('0x3c')]=qs[_0x0b0b('0x35')](_[_0x0b0b('0x3d')](_0x425d0a[_0x0b0b('0x33')],_0x32196b['filters']),_0x1f4090);if(_0x425d0a[_0x0b0b('0x33')]['filter']){_0x223077[_0x0b0b('0x3c')]=_[_0x0b0b('0x3e')](_0x223077[_0x0b0b('0x3c')],{'$or':_[_0x0b0b('0x2f')](_0x1f4090,function(_0x20215b){if(_0x20215b[_0x0b0b('0x31')]!==_0x0b0b('0x3f')){var _0x4b0353={};_0x4b0353[_0x20215b['name']]={'$like':'%'+_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x40')]+'%'};return _0x4b0353;}})});}_0x223077=_[_0x0b0b('0x3e')]({},_0x223077,_0x425d0a['options']);var _0x2d4253={'where':_0x223077['where']};return db[_0x0b0b('0x30')][_0x0b0b('0x1e')](_0x2d4253)['then'](function(_0x485a42){_0xde84e1['count']=_0x485a42;if(_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x41')]){_0x223077['include']=[{'all':!![]}];}return db[_0x0b0b('0x30')][_0x0b0b('0x42')](_0x223077);})[_0x0b0b('0x25')](function(_0x21e640){_0xde84e1[_0x0b0b('0x43')]=_0x21e640;return _0xde84e1;})[_0x0b0b('0x25')](respondWithFilteredResult(_0x22413b,_0x223077))[_0x0b0b('0x44')](handleError(_0x22413b,null));};exports[_0x0b0b('0x45')]=function(_0x58c90e,_0xbd5166){var _0x576df1={'raw':!![],'where':{'id':_0x58c90e[_0x0b0b('0x46')]['id']}},_0x54bc11={};_0x54bc11['model']=_[_0x0b0b('0x34')](db['Disposition'][_0x0b0b('0x47')]);_0x54bc11['query']=_[_0x0b0b('0x34')](_0x58c90e[_0x0b0b('0x33')]);_0x54bc11[_0x0b0b('0x35')]=_[_0x0b0b('0x36')](_0x54bc11[_0x0b0b('0x32')],_0x54bc11[_0x0b0b('0x33')]);_0x576df1['attributes']=_[_0x0b0b('0x36')](_0x54bc11[_0x0b0b('0x32')],qs[_0x0b0b('0x38')](_0x58c90e['query'][_0x0b0b('0x38')]));_0x576df1[_0x0b0b('0x37')]=_0x576df1['attributes']['length']?_0x576df1[_0x0b0b('0x37')]:_0x54bc11['model'];if(_0x58c90e[_0x0b0b('0x33')][_0x0b0b('0x41')]){_0x576df1[_0x0b0b('0x48')]=[{'all':!![]}];}_0x576df1=_[_0x0b0b('0x3e')]({},_0x576df1,_0x58c90e[_0x0b0b('0x49')]);return db['Disposition'][_0x0b0b('0x4a')](_0x576df1)[_0x0b0b('0x25')](handleEntityNotFound(_0xbd5166,null))[_0x0b0b('0x25')](respondWithResult(_0xbd5166,null))[_0x0b0b('0x44')](handleError(_0xbd5166,null));};exports[_0x0b0b('0x4b')]=function(_0x799496,_0x2dfa05){return db['Disposition'][_0x0b0b('0x4b')](_0x799496[_0x0b0b('0x4c')],{})['then'](function(_0x404d45){var _0x2761f0=_0x799496[_0x0b0b('0x4d')][_0x0b0b('0x4e')]({'plain':!![]});if(!_0x2761f0)throw new Error(_0x0b0b('0x4f'));if(_0x2761f0[_0x0b0b('0x50')]==='user'){var _0x412416=_0x404d45[_0x0b0b('0x4e')]({'plain':!![]});var _0x45bc43=_0x0b0b('0x27');return db[_0x0b0b('0x51')][_0x0b0b('0x4a')]({'where':{'name':_0x45bc43,'userProfileId':_0x2761f0[_0x0b0b('0x52')]},'raw':!![]})[_0x0b0b('0x25')](function(_0x34c33a){if(_0x34c33a&&_0x34c33a['autoAssociation']===0x0){return db[_0x0b0b('0x28')][_0x0b0b('0x4b')]({'name':_0x412416['name'],'resourceId':_0x412416['id'],'type':_0x34c33a[_0x0b0b('0x2c')],'sectionId':_0x34c33a['id']},{})['then'](function(){return _0x404d45;});}else{return _0x404d45;}})[_0x0b0b('0x44')](function(_0x153788){logger['error'](_0x0b0b('0x53'),_0x153788);throw _0x153788;});}return _0x404d45;})[_0x0b0b('0x25')](respondWithResult(_0x2dfa05,0xc9))['catch'](handleError(_0x2dfa05,null));};exports['update']=function(_0x12cabf,_0x49287e){if(_0x12cabf['body']['id']){delete _0x12cabf['body']['id'];}return db['Disposition'][_0x0b0b('0x4a')]({'where':{'id':_0x12cabf[_0x0b0b('0x46')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x49287e,null))[_0x0b0b('0x25')](saveUpdates(_0x12cabf[_0x0b0b('0x4c')],null))['then'](respondWithResult(_0x49287e,null))['catch'](handleError(_0x49287e,null));};exports['destroy']=function(_0x14e3cf,_0x4522c6){return db['Disposition']['find']({'where':{'id':_0x14e3cf[_0x0b0b('0x46')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x4522c6,null))[_0x0b0b('0x25')](removeEntity(_0x4522c6,null))[_0x0b0b('0x44')](handleError(_0x4522c6,null));}; \ No newline at end of file +var _0x5f41=['apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','includeAll','findAll','rows','params','merge','options','find','catch','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x49d699,_0x315afe){var _0x19cb80=function(_0x324433){while(--_0x324433){_0x49d699['push'](_0x49d699['shift']());}};_0x19cb80(++_0x315afe);}(_0x5f41,0x14c));var _0x15f4=function(_0x496941,_0x3b7348){_0x496941=_0x496941-0x0;var _0xe5d4fe=_0x5f41[_0x496941];return _0xe5d4fe;};'use strict';var emlformat=require(_0x15f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15f4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x15f4('0x3'));var csv=require(_0x15f4('0x4'));var ejs=require(_0x15f4('0x5'));var fs=require('fs');var fs_extra=require(_0x15f4('0x6'));var _=require('lodash');var squel=require(_0x15f4('0x7'));var crypto=require(_0x15f4('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x15f4('0x4'));var querystring=require(_0x15f4('0x9'));var Papa=require(_0x15f4('0xa'));var Redis=require(_0x15f4('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x15f4('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15f4('0xd'));var logger=require(_0x15f4('0xe'))(_0x15f4('0xf'));var utils=require(_0x15f4('0x10'));var config=require(_0x15f4('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52d5d1,_0x3a76e0){_0x3a76e0=_0x3a76e0||0xcc;return function(_0x55a176){if(_0x55a176){return _0x52d5d1[_0x15f4('0x12')](_0x3a76e0);}return _0x52d5d1[_0x15f4('0x13')](_0x3a76e0)[_0x15f4('0x14')]();};}function respondWithResult(_0x2eb78a,_0x3bd035){_0x3bd035=_0x3bd035||0xc8;return function(_0x34e686){if(_0x34e686){return _0x2eb78a[_0x15f4('0x13')](_0x3bd035)[_0x15f4('0x15')](_0x34e686);}};}function respondWithFilteredResult(_0x22e130,_0x48a599){return function(_0x25a178){if(_0x25a178){var _0xb0c380=typeof _0x48a599[_0x15f4('0x16')]===_0x15f4('0x17')&&typeof _0x48a599[_0x15f4('0x18')]===_0x15f4('0x17');var _0x168b3d=_0x25a178[_0x15f4('0x19')];var _0x1fac43=_0xb0c380?0x0:_0x48a599[_0x15f4('0x16')];var _0x230547=_0xb0c380?_0x25a178['count']:_0x48a599['offset']+_0x48a599[_0x15f4('0x18')];var _0x4c4cf7;if(_0x230547>=_0x168b3d){_0x230547=_0x168b3d;_0x4c4cf7=0xc8;}else{_0x4c4cf7=0xce;}_0x22e130[_0x15f4('0x13')](_0x4c4cf7);return _0x22e130[_0x15f4('0x1a')](_0x15f4('0x1b'),_0x1fac43+'-'+_0x230547+'/'+_0x168b3d)[_0x15f4('0x15')](_0x25a178);}return null;};}function patchUpdates(_0x51f9f5){return function(_0x2d1b64){try{jsonpatch[_0x15f4('0x1c')](_0x2d1b64,_0x51f9f5,!![]);}catch(_0x12094b){return BPromise[_0x15f4('0x1d')](_0x12094b);}return _0x2d1b64[_0x15f4('0x1e')]();};}function saveUpdates(_0x5032c4,_0x5f35ea){return function(_0x29f7b4){if(_0x29f7b4){return _0x29f7b4[_0x15f4('0x1f')](_0x5032c4)[_0x15f4('0x20')](function(_0x63818a){return _0x63818a;});}return null;};}function removeEntity(_0x2a2eeb,_0x3b9f91){return function(_0x53b390){if(_0x53b390){return _0x53b390[_0x15f4('0x21')]()['then'](function(){var _0x2946c6=_0x53b390[_0x15f4('0x22')]({'plain':!![]});var _0x4a4750=_0x15f4('0x23');return db[_0x15f4('0x24')][_0x15f4('0x21')]({'where':{'type':_0x4a4750,'resourceId':_0x2946c6['id']}})[_0x15f4('0x20')](function(){return _0x53b390;});})[_0x15f4('0x20')](function(){_0x2a2eeb[_0x15f4('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x426534,_0x5086af){return function(_0x50c255){if(!_0x50c255){_0x426534[_0x15f4('0x12')](0x194);}return _0x50c255;};}function handleError(_0x1f7dab,_0x8e3592){_0x8e3592=_0x8e3592||0x1f4;return function(_0x464166){logger[_0x15f4('0x25')](_0x464166[_0x15f4('0x26')]);if(_0x464166['name']){delete _0x464166[_0x15f4('0x27')];}_0x1f7dab[_0x15f4('0x13')](_0x8e3592)[_0x15f4('0x28')](_0x464166);};}exports[_0x15f4('0x29')]=function(_0x33d430,_0x151594){var _0x26a19d={},_0x448601={},_0x4bdace={'count':0x0,'rows':[]};var _0x15888a=_[_0x15f4('0x2a')](db[_0x15f4('0x2b')][_0x15f4('0x2c')],function(_0x3b0ea6){return{'name':_0x3b0ea6[_0x15f4('0x2d')],'type':_0x3b0ea6['type'][_0x15f4('0x2e')]};});_0x448601[_0x15f4('0x2f')]=_[_0x15f4('0x2a')](_0x15888a,_0x15f4('0x27'));_0x448601[_0x15f4('0x30')]=_[_0x15f4('0x31')](_0x33d430[_0x15f4('0x30')]);_0x448601[_0x15f4('0x32')]=_[_0x15f4('0x33')](_0x448601[_0x15f4('0x2f')],_0x448601['query']);_0x26a19d[_0x15f4('0x34')]=_[_0x15f4('0x33')](_0x448601[_0x15f4('0x2f')],qs[_0x15f4('0x35')](_0x33d430[_0x15f4('0x30')][_0x15f4('0x35')]));_0x26a19d[_0x15f4('0x34')]=_0x26a19d['attributes'][_0x15f4('0x36')]?_0x26a19d[_0x15f4('0x34')]:_0x448601['model'];if(!_0x33d430[_0x15f4('0x30')]['hasOwnProperty'](_0x15f4('0x37'))){_0x26a19d[_0x15f4('0x18')]=qs['limit'](_0x33d430[_0x15f4('0x30')][_0x15f4('0x18')]);_0x26a19d[_0x15f4('0x16')]=qs[_0x15f4('0x16')](_0x33d430['query']['offset']);}_0x26a19d['order']=qs[_0x15f4('0x38')](_0x33d430[_0x15f4('0x30')][_0x15f4('0x38')]);_0x26a19d[_0x15f4('0x39')]=qs[_0x15f4('0x32')](_['pick'](_0x33d430[_0x15f4('0x30')],_0x448601[_0x15f4('0x32')]),_0x15888a);if(_0x33d430[_0x15f4('0x30')][_0x15f4('0x3a')]){_0x26a19d[_0x15f4('0x39')]=_['merge'](_0x26a19d[_0x15f4('0x39')],{'$or':_[_0x15f4('0x2a')](_0x15888a,function(_0x2d75e4){if(_0x2d75e4['type']!=='VIRTUAL'){var _0x165671={};_0x165671[_0x2d75e4['name']]={'$like':'%'+_0x33d430[_0x15f4('0x30')][_0x15f4('0x3a')]+'%'};return _0x165671;}})});}_0x26a19d=_['merge']({},_0x26a19d,_0x33d430['options']);var _0x8cb58={'where':_0x26a19d[_0x15f4('0x39')]};return db['Disposition']['count'](_0x8cb58)[_0x15f4('0x20')](function(_0x4b67b9){_0x4bdace[_0x15f4('0x19')]=_0x4b67b9;if(_0x33d430[_0x15f4('0x30')][_0x15f4('0x3b')]){_0x26a19d['include']=[{'all':!![]}];}return db['Disposition'][_0x15f4('0x3c')](_0x26a19d);})[_0x15f4('0x20')](function(_0x1f8675){_0x4bdace[_0x15f4('0x3d')]=_0x1f8675;return _0x4bdace;})[_0x15f4('0x20')](respondWithFilteredResult(_0x151594,_0x26a19d))['catch'](handleError(_0x151594,null));};exports['show']=function(_0x499f37,_0x18fae3){var _0x5b408a={'raw':!![],'where':{'id':_0x499f37[_0x15f4('0x3e')]['id']}},_0x113d2d={};_0x113d2d['model']=_[_0x15f4('0x31')](db['Disposition']['rawAttributes']);_0x113d2d['query']=_[_0x15f4('0x31')](_0x499f37[_0x15f4('0x30')]);_0x113d2d[_0x15f4('0x32')]=_[_0x15f4('0x33')](_0x113d2d[_0x15f4('0x2f')],_0x113d2d[_0x15f4('0x30')]);_0x5b408a[_0x15f4('0x34')]=_[_0x15f4('0x33')](_0x113d2d[_0x15f4('0x2f')],qs[_0x15f4('0x35')](_0x499f37[_0x15f4('0x30')][_0x15f4('0x35')]));_0x5b408a['attributes']=_0x5b408a[_0x15f4('0x34')][_0x15f4('0x36')]?_0x5b408a[_0x15f4('0x34')]:_0x113d2d[_0x15f4('0x2f')];if(_0x499f37[_0x15f4('0x30')][_0x15f4('0x3b')]){_0x5b408a['include']=[{'all':!![]}];}_0x5b408a=_[_0x15f4('0x3f')]({},_0x5b408a,_0x499f37[_0x15f4('0x40')]);return db[_0x15f4('0x2b')][_0x15f4('0x41')](_0x5b408a)['then'](handleEntityNotFound(_0x18fae3,null))[_0x15f4('0x20')](respondWithResult(_0x18fae3,null))[_0x15f4('0x42')](handleError(_0x18fae3,null));};exports[_0x15f4('0x43')]=function(_0x357328,_0x36b520){return db[_0x15f4('0x2b')]['create'](_0x357328[_0x15f4('0x44')],{})['then'](function(_0x29b012){var _0x4cf472=_0x357328[_0x15f4('0x45')][_0x15f4('0x22')]({'plain':!![]});if(!_0x4cf472)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cf472['role']===_0x15f4('0x45')){var _0x18fda6=_0x29b012[_0x15f4('0x22')]({'plain':!![]});var _0x310870=_0x15f4('0x23');return db['UserProfileSection'][_0x15f4('0x41')]({'where':{'name':_0x310870,'userProfileId':_0x4cf472[_0x15f4('0x46')]},'raw':!![]})['then'](function(_0x5984ed){if(_0x5984ed&&_0x5984ed['autoAssociation']===0x0){return db[_0x15f4('0x24')][_0x15f4('0x43')]({'name':_0x18fda6[_0x15f4('0x27')],'resourceId':_0x18fda6['id'],'type':_0x5984ed['name'],'sectionId':_0x5984ed['id']},{})['then'](function(){return _0x29b012;});}else{return _0x29b012;}})[_0x15f4('0x42')](function(_0x4fd405){logger[_0x15f4('0x25')](_0x15f4('0x47'),_0x4fd405);throw _0x4fd405;});}return _0x29b012;})[_0x15f4('0x20')](respondWithResult(_0x36b520,0xc9))[_0x15f4('0x42')](handleError(_0x36b520,null));};exports[_0x15f4('0x1f')]=function(_0xc0507c,_0x1152da){if(_0xc0507c['body']['id']){delete _0xc0507c[_0x15f4('0x44')]['id'];}return db[_0x15f4('0x2b')][_0x15f4('0x41')]({'where':{'id':_0xc0507c[_0x15f4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1152da,null))[_0x15f4('0x20')](saveUpdates(_0xc0507c['body'],null))[_0x15f4('0x20')](respondWithResult(_0x1152da,null))['catch'](handleError(_0x1152da,null));};exports[_0x15f4('0x21')]=function(_0x5e14c9,_0x54754b){return db[_0x15f4('0x2b')][_0x15f4('0x41')]({'where':{'id':_0x5e14c9['params']['id']}})[_0x15f4('0x20')](handleEntityNotFound(_0x54754b,null))[_0x15f4('0x20')](removeEntity(_0x54754b,null))[_0x15f4('0x42')](handleError(_0x54754b,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 183b476..c405a37 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 _0xd4bf=['bluebird','path','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd4bf,0x74));var _0xfd4b=function(_0x3c00e5,_0x32fb35){_0x3c00e5=_0x3c00e5-0x0;var _0x172ffd=_0xd4bf[_0x3c00e5];return _0x172ffd;};'use strict';var _=require('lodash');var util=require(_0xfd4b('0x0'));var logger=require(_0xfd4b('0x1'))(_0xfd4b('0x2'));var moment=require(_0xfd4b('0x3'));var BPromise=require(_0xfd4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd4b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd4b('0x6'));module[_0xfd4b('0x7')]=function(_0x1cb792,_0x3dac56){return _0x1cb792[_0xfd4b('0x8')](_0xfd4b('0x9'),attributes,{'tableName':_0xfd4b('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xfd4b('0xb'),'fields':['name',_0xfd4b('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0xfd4b('0xd'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0xfd4b('0xe'),'fields':[_0xfd4b('0xd'),_0xfd4b('0xf')]},{'unique':!![],'name':_0xfd4b('0x10'),'fields':[_0xfd4b('0xd'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xfd4b('0xd'),_0xfd4b('0x11')]},{'unique':!![],'name':_0xfd4b('0x12'),'fields':[_0xfd4b('0xd'),_0xfd4b('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7a7=['name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_chat','name','SmsAccountId'];(function(_0x218d6a,_0x5df04d){var _0x5d7b35=function(_0x330f02){while(--_0x330f02){_0x218d6a['push'](_0x218d6a['shift']());}};_0x5d7b35(++_0x5df04d);}(_0xb7a7,0x98));var _0x7b7a=function(_0x3c37c7,_0x2fc937){_0x3c37c7=_0x3c37c7-0x0;var _0xe7f010=_0xb7a7[_0x3c37c7];return _0xe7f010;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b7a('0x0'))(_0x7b7a('0x1'));var moment=require(_0x7b7a('0x2'));var BPromise=require(_0x7b7a('0x3'));var rp=require(_0x7b7a('0x4'));var fs=require('fs');var path=require(_0x7b7a('0x5'));var rimraf=require(_0x7b7a('0x6'));var config=require(_0x7b7a('0x7'));var attributes=require(_0x7b7a('0x8'));module[_0x7b7a('0x9')]=function(_0x5e9b97,_0x423a3a){return _0x5e9b97[_0x7b7a('0xa')](_0x7b7a('0xb'),attributes,{'tableName':_0x7b7a('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name','ListId']},{'unique':!![],'name':_0x7b7a('0xd'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x7b7a('0xe'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x7b7a('0xe'),_0x7b7a('0xf')]},{'unique':!![],'name':_0x7b7a('0x10'),'fields':[_0x7b7a('0xe'),_0x7b7a('0x11')]},{'unique':!![],'name':_0x7b7a('0x12'),'fields':['name',_0x7b7a('0x13')]},{'unique':!![],'name':_0x7b7a('0x14'),'fields':[_0x7b7a('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 7d2e27b..aed729b 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(_0x21cbc9,_0xfbfbe4){var _0x5504f2=function(_0x5ebe28){while(--_0x5ebe28){_0x21cbc9['push'](_0x21cbc9['shift']());}};_0x5504f2(++_0xfbfbe4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x40d812,_0x3a38d0){var _0x48b260=function(_0x4a782a){while(--_0x4a782a){_0x40d812['push'](_0x40d812['shift']());}};_0x48b260(++_0x3a38d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 2f27189..696330a 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 _0x31b2=['isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get'];(function(_0x67d81c,_0x3cd587){var _0x3a7dc5=function(_0x54b8a3){while(--_0x54b8a3){_0x67d81c['push'](_0x67d81c['shift']());}};_0x3a7dc5(++_0x3cd587);}(_0x31b2,0xa4));var _0x231b=function(_0xc8a02c,_0x4809d3){_0xc8a02c=_0xc8a02c-0x0;var _0x3d89da=_0x31b2[_0xc8a02c];return _0x3d89da;};'use strict';var multer=require(_0x231b('0x0'));var util=require(_0x231b('0x1'));var path=require(_0x231b('0x2'));var timeout=require(_0x231b('0x3'));var express=require(_0x231b('0x4'));var router=express[_0x231b('0x5')]();var fs_extra=require(_0x231b('0x6'));var auth=require(_0x231b('0x7'));var interaction=require(_0x231b('0x8'));var config=require(_0x231b('0x9'));var controller=require(_0x231b('0xa'));router[_0x231b('0xb')]('/',auth[_0x231b('0xc')](),controller[_0x231b('0xd')]);router[_0x231b('0xb')]('/:id',auth[_0x231b('0xc')](),controller[_0x231b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x231b('0xf')]);router[_0x231b('0x10')](_0x231b('0x11'),auth[_0x231b('0xc')](),controller[_0x231b('0x12')]);router[_0x231b('0x13')](_0x231b('0x11'),auth['isAuthenticated'](),controller[_0x231b('0x14')]);module[_0x231b('0x15')]=router; \ No newline at end of file +var _0x709c=['put','/:id','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x709c,0x17e));var _0xc709=function(_0x4f41cb,_0x5bdc04){_0x4f41cb=_0x4f41cb-0x0;var _0x3cf2ea=_0x709c[_0x4f41cb];return _0x3cf2ea;};'use strict';var multer=require('multer');var util=require(_0xc709('0x0'));var path=require('path');var timeout=require(_0xc709('0x1'));var express=require(_0xc709('0x2'));var router=express[_0xc709('0x3')]();var fs_extra=require(_0xc709('0x4'));var auth=require(_0xc709('0x5'));var interaction=require(_0xc709('0x6'));var config=require(_0xc709('0x7'));var controller=require('./disposition.controller');router[_0xc709('0x8')]('/',auth[_0xc709('0x9')](),controller[_0xc709('0xa')]);router['get']('/:id',auth[_0xc709('0x9')](),controller[_0xc709('0xb')]);router[_0xc709('0xc')]('/',auth['isAuthenticated'](),controller[_0xc709('0xd')]);router[_0xc709('0xe')](_0xc709('0xf'),auth[_0xc709('0x9')](),controller['update']);router[_0xc709('0x10')]('/:id',auth[_0xc709('0x9')](),controller['destroy']);module[_0xc709('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index f199a85..7e2ee28 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 _0x2d48=['mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','12000','14400','4800','9600','v17,v27,v29','SIP','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x2d48,0x143));var _0x82d4=function(_0x2586df,_0x17558e){_0x2586df=_0x2586df-0x0;var _0x5bc581=_0x2d48[_0x2586df];return _0x5bc581;};'use strict';var Sequelize=require(_0x82d4('0x0'));module[_0x82d4('0x1')]={'name':{'type':Sequelize[_0x82d4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x82d4('0x2')]},'ecm':{'type':Sequelize[_0x82d4('0x3')](_0x82d4('0x4'),'no'),'defaultValue':_0x82d4('0x4')},'headerinfo':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':_0x82d4('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x82d4('0x6')},'minrate':{'type':Sequelize[_0x82d4('0x3')](_0x82d4('0x7'),'4800',_0x82d4('0x8'),'9600',_0x82d4('0x9'),_0x82d4('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x82d4('0x7'),_0x82d4('0xb'),'7200',_0x82d4('0xc'),_0x82d4('0x9'),_0x82d4('0xa')),'defaultValue':_0x82d4('0xa')},'modem':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':_0x82d4('0xd')},'gateway':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x82d4('0x3')](_0x82d4('0xe'),'IAX',_0x82d4('0xf'),_0x82d4('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x82d4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x82d4('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x82d4('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x82d4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x82d4('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x82d4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x82d4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x82d4('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x82d4('0x12')],'defaultValue':![],'comment':_0x82d4('0x14'),'set':function(_0x4dfaa0){if(!_0x4dfaa0)this[_0x82d4('0x15')](_0x82d4('0x16'),null);this[_0x82d4('0x15')]('mandatoryDisposition',_0x4dfaa0);}}}; \ No newline at end of file +var _0x07ef=['SIP','IAX','KHOMP','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','12000','14400','4800','9600','v17,v27,v29'];(function(_0x16960e,_0x169c9f){var _0x1c24ce=function(_0x58c97){while(--_0x58c97){_0x16960e['push'](_0x16960e['shift']());}};_0x1c24ce(++_0x169c9f);}(_0x07ef,0x1d9));var _0xf07e=function(_0x2bd1f5,_0x8db4ec){_0x2bd1f5=_0x2bd1f5-0x0;var _0x43a4b3=_0x07ef[_0x2bd1f5];return _0x43a4b3;};'use strict';var Sequelize=require(_0xf07e('0x0'));module[_0xf07e('0x1')]={'name':{'type':Sequelize[_0xf07e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xf07e('0x3')](_0xf07e('0x4'),'no'),'defaultValue':_0xf07e('0x4')},'headerinfo':{'type':Sequelize[_0xf07e('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xf07e('0x5')},'minrate':{'type':Sequelize['ENUM']('2400','4800','7200','9600',_0xf07e('0x6'),_0xf07e('0x7')),'defaultValue':_0xf07e('0x8')},'maxrate':{'type':Sequelize[_0xf07e('0x3')]('2400',_0xf07e('0x8'),'7200',_0xf07e('0x9'),_0xf07e('0x6'),_0xf07e('0x7')),'defaultValue':_0xf07e('0x7')},'modem':{'type':Sequelize[_0xf07e('0x2')],'defaultValue':_0xf07e('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xf07e('0xb'),_0xf07e('0xc'),'DADHI',_0xf07e('0xd')),'defaultValue':_0xf07e('0xb')},'key':{'type':Sequelize[_0xf07e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf07e('0xe')],'defaultValue':function(){return _0xf07e('0xf');}},'notificationSound':{'type':Sequelize[_0xf07e('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf07e('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf07e('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf07e('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf07e('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xf07e('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x479128){if(!_0x479128)this[_0xf07e('0x13')](_0xf07e('0x14'),null);this[_0xf07e('0x13')](_0xf07e('0x15'),_0x479128);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 44bd69e..b9b137d 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 _0xdfee=['User','Owner','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','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','VoiceExtension','bulkCreate','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','fax','Contacts','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','end','sendStatus','name','index','mandatoryDispositionPause','map','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','CmContact','Contact'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xdfee,0x10f));var _0xedfe=function(_0x466db8,_0x2b2105){_0x466db8=_0x466db8-0x0;var _0x5e5366=_0xdfee[_0x466db8];return _0x5e5366;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedfe('0x0'));var zipdir=require(_0xedfe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedfe('0x2'));var moment=require('moment');var BPromise=require(_0xedfe('0x3'));var Mustache=require(_0xedfe('0x4'));var util=require(_0xedfe('0x5'));var path=require(_0xedfe('0x6'));var sox=require(_0xedfe('0x7'));var csv=require(_0xedfe('0x8'));var ejs=require(_0xedfe('0x9'));var fs=require('fs');var fs_extra=require(_0xedfe('0xa'));var _=require(_0xedfe('0xb'));var squel=require(_0xedfe('0xc'));var crypto=require('crypto');var jsforce=require(_0xedfe('0xd'));var deskjs=require(_0xedfe('0xe'));var toCsv=require(_0xedfe('0x8'));var querystring=require(_0xedfe('0xf'));var Papa=require(_0xedfe('0x10'));var Redis=require(_0xedfe('0x11'));var authService=require(_0xedfe('0x12'));var qs=require(_0xedfe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedfe('0x14'));var logger=require(_0xedfe('0x15'))(_0xedfe('0x16'));var utils=require('../../config/utils');var config=require(_0xedfe('0x17'));var licenseUtil=require(_0xedfe('0x18'));var db=require(_0xedfe('0x19'))['db'];config['redis']=_[_0xedfe('0x1a')](config[_0xedfe('0x1b')],{'host':_0xedfe('0x1c'),'port':0x18eb});var socket=require(_0xedfe('0x1d'))(new Redis(config['redis']));require(_0xedfe('0x1e'))[_0xedfe('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xedfe('0x20')][_0xedfe('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f19ac,_0x199ab8,_0x90a044,_0x32618c){return new BPromise(function(_0x11415f,_0x1f8123){var _0x3df4e1=_0x32618c||client;return _0x3df4e1[_0xedfe('0x22')](_0x5f19ac,_0x90a044)['then'](function(_0x20df4d){logger[_0xedfe('0x23')](_0xedfe('0x24'),_0x199ab8,_0xedfe('0x25'));logger[_0xedfe('0x26')](_0xedfe('0x27'),_0x199ab8,_0xedfe('0x25'),JSON['stringify'](_0x20df4d));if(_0x20df4d['error']){if(_0x20df4d[_0xedfe('0x28')]['code']===0x1f4){logger[_0xedfe('0x28')](_0xedfe('0x24'),_0x199ab8,_0x20df4d[_0xedfe('0x28')][_0xedfe('0x29')]);return _0x1f8123(_0x20df4d['error'][_0xedfe('0x29')]);}logger[_0xedfe('0x28')](_0xedfe('0x24'),_0x199ab8,_0x20df4d[_0xedfe('0x28')][_0xedfe('0x29')]);return _0x11415f(_0x20df4d[_0xedfe('0x28')][_0xedfe('0x29')]);}else{logger['info'](_0xedfe('0x24'),_0x199ab8,'request\x20sent');_0x11415f(_0x20df4d[_0xedfe('0x2a')][_0xedfe('0x29')]);}})[_0xedfe('0x2b')](function(_0xcd9efa){logger[_0xedfe('0x28')]('FaxAccount,\x20%s,\x20%s',_0x199ab8,_0xcd9efa);_0x1f8123(_0xcd9efa);});});}function respondWithStatusCode(_0x2c2a80,_0x306049){_0x306049=_0x306049||0xcc;return function(_0x20c56a){if(_0x20c56a){return _0x2c2a80['sendStatus'](_0x306049);}return _0x2c2a80['status'](_0x306049)['end']();};}function respondWithResult(_0x2b02c9,_0x30b0cd){_0x30b0cd=_0x30b0cd||0xc8;return function(_0xe193c1){if(_0xe193c1){return _0x2b02c9[_0xedfe('0x2c')](_0x30b0cd)[_0xedfe('0x2d')](_0xe193c1);}};}function respondWithFilteredResult(_0x1b0fbd,_0xf31f24){return function(_0x383d23){if(_0x383d23){var _0x9f237e=typeof _0xf31f24[_0xedfe('0x2e')]==='undefined'&&typeof _0xf31f24[_0xedfe('0x2f')]==='undefined';var _0x30d7c2=_0x383d23[_0xedfe('0x30')];var _0x3edbee=_0x9f237e?0x0:_0xf31f24[_0xedfe('0x2e')];var _0x96c8cc=_0x9f237e?_0x383d23['count']:_0xf31f24['offset']+_0xf31f24[_0xedfe('0x2f')];var _0x5935e2;if(_0x96c8cc>=_0x30d7c2){_0x96c8cc=_0x30d7c2;_0x5935e2=0xc8;}else{_0x5935e2=0xce;}_0x1b0fbd[_0xedfe('0x2c')](_0x5935e2);return _0x1b0fbd[_0xedfe('0x31')]('Content-Range',_0x3edbee+'-'+_0x96c8cc+'/'+_0x30d7c2)[_0xedfe('0x2d')](_0x383d23);}return null;};}function patchUpdates(_0xe056ed){return function(_0x571941){try{jsonpatch[_0xedfe('0x32')](_0x571941,_0xe056ed,!![]);}catch(_0x39e38f){return BPromise[_0xedfe('0x33')](_0x39e38f);}return _0x571941[_0xedfe('0x34')]();};}function saveUpdates(_0x114009,_0x57cb40){return function(_0x30c0f3){if(_0x30c0f3){return _0x30c0f3[_0xedfe('0x35')](_0x114009)[_0xedfe('0x36')](function(_0x5af6e6){return _0x5af6e6;});}return null;};}function removeEntity(_0x4c0ec4,_0x282df7){return function(_0x240944){if(_0x240944){return _0x240944[_0xedfe('0x37')]()[_0xedfe('0x36')](function(){var _0xfb9a6a=_0x240944[_0xedfe('0x38')]({'plain':!![]});var _0x59b15f=_0xedfe('0x39');return db[_0xedfe('0x3a')][_0xedfe('0x37')]({'where':{'type':_0x59b15f,'resourceId':_0xfb9a6a['id']}})[_0xedfe('0x36')](function(){return _0x240944;});})[_0xedfe('0x36')](function(){_0x4c0ec4[_0xedfe('0x2c')](0xcc)[_0xedfe('0x3b')]();});}};}function handleEntityNotFound(_0x3dcb26,_0x1045d5){return function(_0x406028){if(!_0x406028){_0x3dcb26[_0xedfe('0x3c')](0x194);}return _0x406028;};}function handleError(_0x293de9,_0x455c65){_0x455c65=_0x455c65||0x1f4;return function(_0x67172){logger[_0xedfe('0x28')](_0x67172['stack']);if(_0x67172[_0xedfe('0x3d')]){delete _0x67172[_0xedfe('0x3d')];}_0x293de9[_0xedfe('0x2c')](_0x455c65)['send'](_0x67172);};}exports[_0xedfe('0x3e')]=function(_0x3711fd,_0x52c902){var _0x1623fd={'include':[{'model':db['Pause'],'as':_0xedfe('0x3f')}]},_0x58c56a={},_0x5080ea={'count':0x0,'rows':[]};var _0x3be232=_[_0xedfe('0x40')](db['FaxAccount']['rawAttributes'],function(_0x4eac6d){return{'name':_0x4eac6d[_0xedfe('0x41')],'type':_0x4eac6d[_0xedfe('0x42')][_0xedfe('0x43')]};});_0x58c56a[_0xedfe('0x44')]=_[_0xedfe('0x40')](_0x3be232,_0xedfe('0x3d'));_0x58c56a['query']=_['keys'](_0x3711fd[_0xedfe('0x45')]);_0x58c56a['filters']=_[_0xedfe('0x46')](_0x58c56a['model'],_0x58c56a[_0xedfe('0x45')]);_0x1623fd[_0xedfe('0x47')]=_[_0xedfe('0x46')](_0x58c56a['model'],qs[_0xedfe('0x48')](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x48')]));_0x1623fd['attributes']=_0x1623fd[_0xedfe('0x47')][_0xedfe('0x49')]?_0x1623fd[_0xedfe('0x47')]:_0x58c56a[_0xedfe('0x44')];if(!_0x3711fd[_0xedfe('0x45')][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x1623fd[_0xedfe('0x2f')]=qs[_0xedfe('0x2f')](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x2f')]);_0x1623fd['offset']=qs['offset'](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x1623fd[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x4d')]);_0x1623fd[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x3711fd['query'],_0x58c56a[_0xedfe('0x4f')]),_0x3be232);if(_0x3711fd[_0xedfe('0x45')][_0xedfe('0x51')]){_0x1623fd['where']=_[_0xedfe('0x52')](_0x1623fd[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x3be232,function(_0x3069af){if(_0x3069af[_0xedfe('0x42')]!==_0xedfe('0x53')){var _0x193561={};_0x193561[_0x3069af['name']]={'$like':'%'+_0x3711fd['query'][_0xedfe('0x51')]+'%'};return _0x193561;}})});}_0x1623fd=_[_0xedfe('0x52')]({},_0x1623fd,_0x3711fd[_0xedfe('0x54')]);var _0x14c350={'where':_0x1623fd[_0xedfe('0x4e')]};return db[_0xedfe('0x55')]['count'](_0x14c350)[_0xedfe('0x36')](function(_0x2695a2){_0x5080ea[_0xedfe('0x30')]=_0x2695a2;if(_0x3711fd[_0xedfe('0x45')][_0xedfe('0x56')]){_0x1623fd['include']=[{'all':!![]}];}return db[_0xedfe('0x55')][_0xedfe('0x57')](_0x1623fd);})[_0xedfe('0x36')](function(_0x5bdc09){_0x5080ea[_0xedfe('0x58')]=_0x5bdc09;return _0x5080ea;})[_0xedfe('0x36')](respondWithFilteredResult(_0x52c902,_0x1623fd))[_0xedfe('0x2b')](handleError(_0x52c902,null));};exports[_0xedfe('0x59')]=function(_0x305692,_0x4c3e53){var _0x31d1be={'raw':![],'where':{'id':_0x305692[_0xedfe('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0xedfe('0x3f')}]},_0x680f46={};_0x680f46[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0x55')][_0xedfe('0x5c')]);_0x680f46[_0xedfe('0x45')]=_['keys'](_0x305692[_0xedfe('0x45')]);_0x680f46[_0xedfe('0x4f')]=_['intersection'](_0x680f46['model'],_0x680f46[_0xedfe('0x45')]);_0x31d1be[_0xedfe('0x47')]=_['intersection'](_0x680f46[_0xedfe('0x44')],qs['fields'](_0x305692['query']['fields']));_0x31d1be[_0xedfe('0x47')]=_0x31d1be[_0xedfe('0x47')][_0xedfe('0x49')]?_0x31d1be[_0xedfe('0x47')]:_0x680f46[_0xedfe('0x44')];if(_0x305692[_0xedfe('0x45')][_0xedfe('0x56')]){_0x31d1be[_0xedfe('0x5d')]=[{'all':!![]}];}_0x31d1be=_[_0xedfe('0x52')]({},_0x31d1be,_0x305692[_0xedfe('0x54')]);return db[_0xedfe('0x55')][_0xedfe('0x5e')](_0x31d1be)[_0xedfe('0x36')](handleEntityNotFound(_0x4c3e53,null))[_0xedfe('0x36')](respondWithResult(_0x4c3e53,null))['catch'](handleError(_0x4c3e53,null));};exports[_0xedfe('0x5f')]=function(_0xc17bdc,_0x3c1f83){return db[_0xedfe('0x55')]['create'](_0xc17bdc['body'],{})['then'](function(_0x7909bf){var _0x24f21d=_0xc17bdc['user'][_0xedfe('0x38')]({'plain':!![]});if(!_0x24f21d)throw new Error(_0xedfe('0x60'));if(_0x24f21d[_0xedfe('0x61')]===_0xedfe('0x62')){var _0x1b6764=_0x7909bf[_0xedfe('0x38')]({'plain':!![]});var _0x39f538=_0xedfe('0x39');return db[_0xedfe('0x63')][_0xedfe('0x5e')]({'where':{'name':_0x39f538,'userProfileId':_0x24f21d[_0xedfe('0x64')]},'raw':!![]})[_0xedfe('0x36')](function(_0x56f5e4){if(_0x56f5e4&&_0x56f5e4[_0xedfe('0x65')]===0x0){return db['UserProfileResource'][_0xedfe('0x5f')]({'name':_0x1b6764['name'],'resourceId':_0x1b6764['id'],'type':_0x56f5e4[_0xedfe('0x3d')],'sectionId':_0x56f5e4['id']},{})[_0xedfe('0x36')](function(){return _0x7909bf;});}else{return _0x7909bf;}})[_0xedfe('0x2b')](function(_0x4718c3){logger['error'](_0xedfe('0x66'),_0x4718c3);throw _0x4718c3;});}return _0x7909bf;})[_0xedfe('0x36')](respondWithResult(_0x3c1f83,0xc9))[_0xedfe('0x2b')](handleError(_0x3c1f83,null));};exports[_0xedfe('0x35')]=function(_0x4716a3,_0x14c48b){if(_0x4716a3[_0xedfe('0x67')]['id']){delete _0x4716a3[_0xedfe('0x67')]['id'];}return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x4716a3['params']['id']},'include':[{'model':db[_0xedfe('0x68')],'as':_0xedfe('0x3f')}]})[_0xedfe('0x36')](handleEntityNotFound(_0x14c48b,null))[_0xedfe('0x36')](saveUpdates(_0x4716a3[_0xedfe('0x67')],null))[_0xedfe('0x36')](respondWithResult(_0x14c48b,null))[_0xedfe('0x2b')](handleError(_0x14c48b,null));};exports[_0xedfe('0x37')]=function(_0x2ff90f,_0x15cb55){return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x2ff90f[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x15cb55,null))['then'](removeEntity(_0x15cb55,null))[_0xedfe('0x2b')](handleError(_0x15cb55,null));};exports[_0xedfe('0x69')]=function(_0x43b75b,_0x5d1a67){return db[_0xedfe('0x55')][_0xedfe('0x69')]()[_0xedfe('0x36')](respondWithResult(_0x5d1a67,null))[_0xedfe('0x2b')](handleError(_0x5d1a67,null));};exports[_0xedfe('0x6a')]=function(_0x1dc7c0,_0x3be0a8,_0x3a4f8a){if(_0x1dc7c0[_0xedfe('0x67')]['id']){delete _0x1dc7c0['body']['id'];}return db[_0xedfe('0x55')]['find']({'where':{'id':_0x1dc7c0[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x3be0a8,null))[_0xedfe('0x36')](function(_0x596009){if(_0x596009){_0x1dc7c0[_0xedfe('0x67')][_0xedfe('0x6b')]=_0x596009['id'];return db[_0xedfe('0x6c')][_0xedfe('0x5f')](_0x1dc7c0['body']);}})['then'](respondWithResult(_0x3be0a8,null))[_0xedfe('0x2b')](handleError(_0x3be0a8,null));};exports[_0xedfe('0x6d')]=function(_0x14070c,_0x261e29,_0x143c8d){var _0x19f762={'raw':![],'where':{}};var _0x2d57e1={};var _0x136701={'count':0x0,'rows':[]};return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x14070c[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x261e29,null))['then'](function(_0x18fe42){if(_0x18fe42){_0x2d57e1[_0xedfe('0x44')]=_['keys'](db['Disposition']['rawAttributes']);_0x2d57e1[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x14070c[_0xedfe('0x45')]);_0x2d57e1[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x2d57e1[_0xedfe('0x44')],_0x2d57e1['query']);_0x19f762['attributes']=_['intersection'](_0x2d57e1[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x14070c[_0xedfe('0x45')][_0xedfe('0x48')]));_0x19f762[_0xedfe('0x47')]=_0x19f762[_0xedfe('0x47')][_0xedfe('0x49')]?_0x19f762[_0xedfe('0x47')]:_0x2d57e1[_0xedfe('0x44')];if(!_0x14070c['query'][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x19f762['limit']=qs['limit'](_0x14070c[_0xedfe('0x45')][_0xedfe('0x2f')]);_0x19f762[_0xedfe('0x2e')]=qs[_0xedfe('0x2e')](_0x14070c[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x19f762[_0xedfe('0x4c')]=qs['sort'](_0x14070c[_0xedfe('0x45')]['sort']);_0x19f762[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x14070c[_0xedfe('0x45')],_0x2d57e1[_0xedfe('0x4f')]));_0x19f762[_0xedfe('0x4e')]['FaxAccountId']=_0x18fe42['id'];if(_0x14070c[_0xedfe('0x45')][_0xedfe('0x51')]){_0x19f762[_0xedfe('0x4e')]=_[_0xedfe('0x52')](_0x19f762['where'],{'$or':_[_0xedfe('0x40')](_0x19f762[_0xedfe('0x47')],function(_0x4456d4){var _0x3d7926={};_0x3d7926[_0x4456d4]={'$like':'%'+_0x14070c[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x3d7926;})});}_0x19f762=_[_0xedfe('0x52')]({},_0x19f762,_0x14070c[_0xedfe('0x54')]);return db['Disposition']['count']({'where':_0x19f762['where']})['then'](function(_0x3e2296){_0x136701[_0xedfe('0x30')]=_0x3e2296;if(_0x14070c[_0xedfe('0x45')][_0xedfe('0x56')]){_0x19f762['include']=[{'all':!![]}];}return db['Disposition'][_0xedfe('0x57')](_0x19f762);})['then'](function(_0x525dbc){_0x136701[_0xedfe('0x58')]=_0x525dbc;return _0x136701;});}})[_0xedfe('0x36')](respondWithFilteredResult(_0x261e29,_0x19f762))['catch'](handleError(_0x261e29,null));};exports[_0xedfe('0x6f')]=function(_0x4e4e3e,_0x3ca231,_0x28cf23){return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x4e4e3e[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ca231,null))['then'](function(_0x3f751d){if(_0x3f751d){return _0x3f751d[_0xedfe('0x6f')](_0x4e4e3e[_0xedfe('0x45')][_0xedfe('0x70')]);}})[_0xedfe('0x36')](respondWithStatusCode(_0x3ca231,null))['catch'](handleError(_0x3ca231,null));};exports[_0xedfe('0x71')]=function(_0xe773c5,_0x15c17a,_0x877dee){if(_0xe773c5[_0xedfe('0x67')]['id']){delete _0xe773c5['body']['id'];}return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0xe773c5[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x15c17a,null))[_0xedfe('0x36')](function(_0x18b0c6){if(_0x18b0c6){_0xe773c5['body']['FaxAccountId']=_0x18b0c6['id'];return db[_0xedfe('0x72')][_0xedfe('0x5f')](_0xe773c5[_0xedfe('0x67')]);}})['then'](respondWithResult(_0x15c17a,null))[_0xedfe('0x2b')](handleError(_0x15c17a,null));};exports[_0xedfe('0x73')]=function(_0x58c568,_0x35191b,_0x30b2cb){var _0x3280be={'raw':![],'where':{}};var _0x1d7a6d={};var _0x496b39={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x58c568['params']['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x35191b,null))['then'](function(_0x5e1c73){if(_0x5e1c73){_0x1d7a6d[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0x72')][_0xedfe('0x5c')]);_0x1d7a6d[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x58c568[_0xedfe('0x45')]);_0x1d7a6d['filters']=_[_0xedfe('0x46')](_0x1d7a6d['model'],_0x1d7a6d[_0xedfe('0x45')]);_0x3280be['attributes']=_[_0xedfe('0x46')](_0x1d7a6d[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x58c568[_0xedfe('0x45')][_0xedfe('0x48')]));_0x3280be[_0xedfe('0x47')]=_0x3280be[_0xedfe('0x47')][_0xedfe('0x49')]?_0x3280be['attributes']:_0x1d7a6d[_0xedfe('0x44')];if(!_0x58c568['query']['hasOwnProperty']('nolimit')){_0x3280be['limit']=qs['limit'](_0x58c568['query']['limit']);_0x3280be['offset']=qs[_0xedfe('0x2e')](_0x58c568[_0xedfe('0x45')]['offset']);}_0x3280be['order']=qs[_0xedfe('0x4d')](_0x58c568[_0xedfe('0x45')][_0xedfe('0x4d')]);_0x3280be[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_['pick'](_0x58c568['query'],_0x1d7a6d[_0xedfe('0x4f')]));_0x3280be[_0xedfe('0x4e')][_0xedfe('0x6b')]=_0x5e1c73['id'];if(_0x58c568[_0xedfe('0x45')][_0xedfe('0x51')]){_0x3280be['where']=_[_0xedfe('0x52')](_0x3280be[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x3280be['attributes'],function(_0xf8d7d0){var _0x33ef20={};_0x33ef20[_0xf8d7d0]={'$like':'%'+_0x58c568['query'][_0xedfe('0x51')]+'%'};return _0x33ef20;})});}_0x3280be=_[_0xedfe('0x52')]({},_0x3280be,_0x58c568[_0xedfe('0x54')]);return db[_0xedfe('0x72')][_0xedfe('0x30')]({'where':_0x3280be['where']})['then'](function(_0x466b85){_0x496b39[_0xedfe('0x30')]=_0x466b85;if(_0x58c568[_0xedfe('0x45')]['includeAll']){_0x3280be[_0xedfe('0x5d')]=[{'all':!![]}];}return db[_0xedfe('0x72')][_0xedfe('0x57')](_0x3280be);})[_0xedfe('0x36')](function(_0x199adb){_0x496b39[_0xedfe('0x58')]=_0x199adb;return _0x496b39;});}})[_0xedfe('0x36')](respondWithFilteredResult(_0x35191b,_0x3280be))[_0xedfe('0x2b')](handleError(_0x35191b,null));};exports[_0xedfe('0x74')]=function(_0x401f83,_0x31049a,_0x32083e){return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x401f83[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x31049a,null))[_0xedfe('0x36')](function(_0x4fda01){if(_0x4fda01){return _0x4fda01[_0xedfe('0x74')](_0x401f83[_0xedfe('0x45')][_0xedfe('0x70')]);}})[_0xedfe('0x36')](respondWithStatusCode(_0x31049a,null))[_0xedfe('0x2b')](handleError(_0x31049a,null));};exports['addInteraction']=function(_0x24182e,_0x40f95e,_0x1681f4){return db[_0xedfe('0x75')][_0xedfe('0x5e')]({'where':{'id':_0x24182e[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x40f95e,null))['then'](function(_0x41e611){if(_0x41e611){return _0x41e611['addInteraction'](_0x24182e['body'][_0xedfe('0x70')],_[_0xedfe('0x76')](_0x24182e['body'],[_0xedfe('0x70'),'id'])||{});}})['then'](respondWithResult(_0x40f95e,null))[_0xedfe('0x2b')](handleError(_0x40f95e,null));};exports['getInteractions']=function(_0x5e3865,_0x5de3ea,_0x1b81e3){var _0x34a189={'raw':![],'where':{}};var _0xe6cbca={};var _0x2f86e6={'count':0x0,'rows':[]};return db['FaxAccount'][_0xedfe('0x6e')]({'where':{'id':_0x5e3865[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5de3ea,null))['then'](function(_0x334572){if(_0x334572){_0xe6cbca['model']=_['keys'](db[_0xedfe('0x75')][_0xedfe('0x5c')]);_0xe6cbca['query']=_[_0xedfe('0x5b')](_0x5e3865[_0xedfe('0x45')]);_0xe6cbca[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0xe6cbca[_0xedfe('0x44')],_0xe6cbca[_0xedfe('0x45')]);_0x34a189['attributes']=_[_0xedfe('0x46')](_0xe6cbca[_0xedfe('0x44')],qs['fields'](_0x5e3865['query'][_0xedfe('0x48')]));_0x34a189[_0xedfe('0x47')]=_0x34a189[_0xedfe('0x47')]['length']?_0x34a189['attributes']:_0xe6cbca[_0xedfe('0x44')];if(!_0x5e3865['query'][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x34a189['limit']=qs[_0xedfe('0x2f')](_0x5e3865[_0xedfe('0x45')][_0xedfe('0x2f')]);_0x34a189['offset']=qs[_0xedfe('0x2e')](_0x5e3865[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x34a189[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x5e3865[_0xedfe('0x45')]['sort']);_0x34a189[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x5e3865[_0xedfe('0x45')],_0xe6cbca[_0xedfe('0x4f')]));_0x34a189[_0xedfe('0x4e')][_0xedfe('0x6b')]=_0x334572['id'];if(_0x5e3865[_0xedfe('0x45')][_0xedfe('0x51')]){_0x34a189['where']=_['merge'](_0x34a189[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x34a189[_0xedfe('0x47')],function(_0x3f97c4){var _0x49ce5c={};_0x49ce5c[_0x3f97c4]={'$like':'%'+_0x5e3865[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x49ce5c;})});}_0x34a189=_['merge']({},_0x34a189,_0x5e3865[_0xedfe('0x54')]);return db[_0xedfe('0x75')][_0xedfe('0x30')]({'where':_0x34a189[_0xedfe('0x4e')]})[_0xedfe('0x36')](function(_0x449c48){_0x2f86e6[_0xedfe('0x30')]=_0x449c48;if(_0x5e3865[_0xedfe('0x45')]['includeAll']){_0x34a189['include']=[{'model':db[_0xedfe('0x77')],'as':_0xedfe('0x78'),'required':![]},{'model':db[_0xedfe('0x79')],'as':_0xedfe('0x7a'),'attributes':[_0xedfe('0x3d'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xedfe('0x7b'),'attributes':['id','name','color'],'where':_0x5e3865[_0xedfe('0x45')][_0xedfe('0x7c')]?{'id':_0x5e3865[_0xedfe('0x45')]['tag']}:undefined,'required':_0x5e3865[_0xedfe('0x45')][_0xedfe('0x7c')]?!![]:![]}];}return db[_0xedfe('0x75')][_0xedfe('0x57')](_0x34a189);})[_0xedfe('0x36')](function(_0x46adab){_0x2f86e6[_0xedfe('0x58')]=_0x46adab;return _0x2f86e6;});}})[_0xedfe('0x36')](respondWithFilteredResult(_0x5de3ea,_0x34a189))['catch'](handleError(_0x5de3ea,null));};exports[_0xedfe('0x7d')]=function(_0x57e2be,_0x3bea5e){var _0x4f170e=_0x57e2be[_0xedfe('0x5a')]['id'];var _0x93f18f=_0x57e2be[_0xedfe('0x67')];var _0x51d3f8=0xc8;var _0x1ba443=null;return db[_0xedfe('0x7e')]['transaction']({'isolationLevel':db[_0xedfe('0x7e')][_0xedfe('0x7f')][_0xedfe('0x80')]['READ_COMMITTED']},function(_0x21bade){return db[_0xedfe('0x55')]['findOne']({'where':{'id':_0x4f170e},'transaction':_0x21bade})['then'](function(_0x3cb23c){if(_0x3cb23c){return db[_0xedfe('0x81')]['destroy']({'where':{'FaxAccountId':_0x4f170e},'transaction':_0x21bade})[_0xedfe('0x36')](function(){var _0x3afa72=_[_0xedfe('0x40')](_0x93f18f,function(_0x213b35){_0x213b35[_0xedfe('0x6b')]=_0x4f170e;return _0x213b35;});return db['FaxApplication']['bulkCreate'](_0x3afa72,{'transaction':_0x21bade});});}else{_0x51d3f8=0x194;_0x1ba443=[];}});})[_0xedfe('0x36')](function(){if(_0x51d3f8!==0x194){return db[_0xedfe('0x81')][_0xedfe('0x82')]({'where':{'FaxAccountId':_0x4f170e},'order':_0xedfe('0x83')})[_0xedfe('0x36')](function(_0x20a0ad){_0x1ba443=_0x20a0ad;});}})['catch'](function(_0x1e9d36){_0x51d3f8=0x1f4;logger[_0xedfe('0x28')](_0x1e9d36['stack']);if(_0x1e9d36['name']){delete _0x1e9d36[_0xedfe('0x3d')];}_0x1ba443=_0x1e9d36;})['finally'](function(){if(_0x1ba443===null){_0x3bea5e[_0xedfe('0x3c')](_0x51d3f8);}else{if(_0x51d3f8===0x1f4){_0x3bea5e[_0xedfe('0x2c')](_0x51d3f8)['send'](_0x1ba443);}else{_0x3bea5e[_0xedfe('0x2c')](_0x51d3f8)['json'](_0x1ba443);}}});};exports[_0xedfe('0x84')]=function(_0x4fd62b,_0x104dee,_0xab716a){var _0x1a26d4={};var _0x4fc0d1={};var _0x26d18a;var _0x1a1ad2;return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x4fd62b['params']['id']}})['then'](handleEntityNotFound(_0x104dee,null))[_0xedfe('0x36')](function(_0x18d5ca){if(_0x18d5ca){_0x26d18a=_0x18d5ca;_0x4fc0d1[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0x81')][_0xedfe('0x5c')]);_0x4fc0d1[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x4fd62b[_0xedfe('0x45')]);_0x4fc0d1[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x4fc0d1['model'],_0x4fc0d1[_0xedfe('0x45')]);_0x1a26d4[_0xedfe('0x47')]=_['intersection'](_0x4fc0d1['model'],qs[_0xedfe('0x48')](_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x48')]));_0x1a26d4[_0xedfe('0x47')]=_0x1a26d4[_0xedfe('0x47')][_0xedfe('0x49')]?_0x1a26d4[_0xedfe('0x47')]:_0x4fc0d1['model'];_0x1a26d4[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x4fd62b['query']['sort']);_0x1a26d4[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x4fd62b[_0xedfe('0x45')],_0x4fc0d1['filters']));if(_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x51')]){_0x1a26d4[_0xedfe('0x4e')]=_[_0xedfe('0x52')](_0x1a26d4[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x1a26d4['attributes'],function(_0x2f5b53){var _0x3d58fb={};_0x3d58fb[_0x2f5b53]={'$like':'%'+_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x3d58fb;})});}_0x1a26d4=_['merge']({},_0x1a26d4,_0x4fd62b[_0xedfe('0x54')]);return _0x26d18a[_0xedfe('0x84')](_0x1a26d4);}})[_0xedfe('0x36')](function(_0x21519f){if(_0x21519f){_0x1a1ad2=_0x21519f['length'];if(!_0x4fd62b[_0xedfe('0x45')]['hasOwnProperty'](_0xedfe('0x4b'))){_0x1a26d4[_0xedfe('0x2f')]=qs[_0xedfe('0x2f')](_0x4fd62b['query'][_0xedfe('0x2f')]);_0x1a26d4[_0xedfe('0x2e')]=qs[_0xedfe('0x2e')](_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x2e')]);}return _0x26d18a[_0xedfe('0x84')](_0x1a26d4);}})[_0xedfe('0x36')](function(_0x19d7a9){if(_0x19d7a9){return _0x19d7a9?{'count':_0x1a1ad2,'rows':_0x19d7a9}:null;}})[_0xedfe('0x36')](respondWithResult(_0x104dee,null))[_0xedfe('0x2b')](handleError(_0x104dee,null));};function Extension(_0x43ad9b,_0x1d80ec,_0x581ef1,_0xf2b17b){this[_0xedfe('0x85')]='from-voip-provider';this[_0xedfe('0x86')]=_0x43ad9b[_0xedfe('0x87')];this[_0xedfe('0x88')]=_0xf2b17b;this[_0xedfe('0x42')]=_0xedfe('0x89');this[_0xedfe('0x8a')]='Fax\x20Extension';this[_0xedfe('0x6b')]=_0x43ad9b['id'];this[_0xedfe('0x83')]=_0x1d80ec;this[_0xedfe('0x8b')]=_0x581ef1;}function createExtensionsReciveFax(_0x3b89b2){var _0x51cda2=0x1;var _0x2e6375=[];_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,'','Answer'));_0x51cda2+=0x1;_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,_0xedfe('0x8d'),_0xedfe('0x8e')));_0x51cda2+=0x1;for(var _0x5b32f0 in _0x3b89b2){if(_0x3b89b2[_0xedfe('0x4a')](_0x5b32f0)&&(_0x5b32f0===_0xedfe('0x8f')||_0x5b32f0===_0xedfe('0x87')||_0x5b32f0===_0xedfe('0x90')||_0x5b32f0===_0xedfe('0x91')||_0x5b32f0===_0xedfe('0x92')||_0x5b32f0===_0xedfe('0x93')||_0x5b32f0===_0xedfe('0x94')||_0x5b32f0===_0xedfe('0x95')||_0x5b32f0===_0xedfe('0x96'))){_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,_0xedfe('0x97')+_0x5b32f0+')='+_0x3b89b2[_0x5b32f0],_0xedfe('0x8e')));_0x51cda2+=0x1;}}_0x2e6375['push'](new Extension(_0x3b89b2,_0x51cda2,'6',_0xedfe('0x98')));_0x51cda2+=0x1;_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,_0xedfe('0x99'),'ReceiveFax'));_0x51cda2=0x0;return _0x2e6375;}exports['addAccountApplications']=function(_0x15dc55,_0x1071de,_0x3e8982){var _0x4d607e;return db[_0xedfe('0x7e')]['transaction'](function(_0x5ae3d5){return db[_0xedfe('0x55')]['create'](_0x15dc55[_0xedfe('0x67')],{'transaction':_0x5ae3d5})[_0xedfe('0x36')](function(_0x7600cf){_0x4d607e=_0x7600cf[_0xedfe('0x38')]({'plain':!![]});return db[_0xedfe('0x9a')][_0xedfe('0x9b')](createExtensionsReciveFax(_0x4d607e),{'transaction':_0x5ae3d5});});})[_0xedfe('0x36')](function(){return _0x4d607e;})[_0xedfe('0x36')](respondWithResult(_0x1071de,null))[_0xedfe('0x2b')](handleError(_0x1071de,null));};exports['updateAccountApplications']=function(_0x4c2e84,_0xe8b2b4,_0x447692){var _0x59b663;return db[_0xedfe('0x7e')]['transaction'](function(_0x13f950){return db[_0xedfe('0x55')]['update'](_0x4c2e84['body'],{'where':{'id':_0x4c2e84[_0xedfe('0x67')]['id']},'transaction':_0x13f950})[_0xedfe('0x36')](function(_0x3b8223){return db[_0xedfe('0x9a')][_0xedfe('0x37')]({'where':{'FaxAccountId':_0x4c2e84[_0xedfe('0x67')]['id']},'transaction':_0x13f950})[_0xedfe('0x36')](function(_0x19414f){return db['VoiceExtension'][_0xedfe('0x9b')](createExtensionsReciveFax(_[_0xedfe('0x76')](_0x4c2e84[_0xedfe('0x67')],['tech','key',_0xedfe('0x9c'),_0xedfe('0x9d'),_0xedfe('0x9e'),_0xedfe('0x9f')])),{'transaction':_0x13f950});});});})[_0xedfe('0x36')](function(){return db[_0xedfe('0x55')][_0xedfe('0xa0')](_0x4c2e84[_0xedfe('0x67')]['id']);})[_0xedfe('0x36')](respondWithResult(_0xe8b2b4,null))[_0xedfe('0x2b')](handleError(_0xe8b2b4,null));};exports[_0xedfe('0xa1')]=function(_0x20ce57,_0x2d6b8f,_0x1951c7){var _0x67f223={'raw':!![],'where':{}};var _0x27adc9={};var _0x559f33={'count':0x0,'rows':[]};return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x20ce57['params']['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x2d6b8f,null))[_0xedfe('0x36')](function(_0x39121e){if(_0x39121e){_0x27adc9[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0xa2')][_0xedfe('0x5c')]);_0x27adc9['query']=_[_0xedfe('0x5b')](_0x20ce57[_0xedfe('0x45')]);_0x27adc9[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x27adc9[_0xedfe('0x44')],_0x27adc9[_0xedfe('0x45')]);_0x67f223[_0xedfe('0x47')]=_[_0xedfe('0x46')](_0x27adc9[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x20ce57[_0xedfe('0x45')]['fields']));_0x67f223[_0xedfe('0x47')]=_0x67f223[_0xedfe('0x47')][_0xedfe('0x49')]?_0x67f223['attributes']:_0x27adc9[_0xedfe('0x44')];if(!_0x20ce57[_0xedfe('0x45')][_0xedfe('0x4a')]('nolimit')){_0x67f223[_0xedfe('0x2f')]=qs[_0xedfe('0x2f')](_0x20ce57['query']['limit']);_0x67f223[_0xedfe('0x2e')]=qs['offset'](_0x20ce57[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x67f223[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x20ce57['query']['sort']);_0x67f223[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_['pick'](_0x20ce57[_0xedfe('0x45')],_0x27adc9[_0xedfe('0x4f')]));_0x67f223['where'][_0xedfe('0x6b')]=_0x39121e['id'];if(_0x20ce57[_0xedfe('0x45')][_0xedfe('0x51')]){_0x67f223[_0xedfe('0x4e')]=_['merge'](_0x67f223['where'],{'$or':_['map'](_0x67f223[_0xedfe('0x47')],function(_0x4af27f){var _0x554b7f={};_0x554b7f[_0x4af27f]={'$like':'%'+_0x20ce57[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x554b7f;})});}if(_0x20ce57['query']['$gte']){var _0xbf6979=_0x20ce57[_0xedfe('0x45')][_0xedfe('0xa3')]['split'](',');var _0x1a4c5d={};_0x1a4c5d[_0xbf6979[0x0]]={'$gte':moment(_0xbf6979[0x1])[_0xedfe('0xa4')](_0xedfe('0xa5'))};_0x67f223[_0xedfe('0x4e')]=_[_0xedfe('0x52')](_0x67f223[_0xedfe('0x4e')],_0x1a4c5d);}_0x67f223=_[_0xedfe('0x52')]({},_0x67f223,_0x20ce57[_0xedfe('0x54')]);return db[_0xedfe('0xa2')]['count']({'where':_0x67f223['where']})[_0xedfe('0x36')](function(_0x540543){_0x559f33['count']=_0x540543;if(_0x20ce57['query'][_0xedfe('0x56')]){_0x67f223[_0xedfe('0x5d')]=[{'all':!![]}];}return db['FaxMessage'][_0xedfe('0x57')](_0x67f223);})[_0xedfe('0x36')](function(_0x407b6a){_0x559f33['rows']=_0x407b6a;return _0x559f33;});}})['then'](respondWithFilteredResult(_0x2d6b8f,_0x67f223))['catch'](handleError(_0x2d6b8f,null));};exports[_0xedfe('0xa6')]=function(_0x48a3b7,_0x46a6ba,_0x52634d){var _0x332fd0,_0x2c2de7={},_0xd2570e;if(_0x48a3b7[_0xedfe('0x67')]['to']){_0xd2570e=_0x48a3b7[_0xedfe('0x67')]['to'][0x0];}return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x48a3b7[_0xedfe('0x5a')]['id']},'include':[{'model':db[_0xedfe('0xa7')],'as':_0xedfe('0xa8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0xd2570e},'limit':0x1,'order':[[_0xedfe('0x9d'),_0xedfe('0xa9')]]}]}]})[_0xedfe('0x36')](handleEntityNotFound(_0x46a6ba,null))[_0xedfe('0x36')](function(_0x37488d){_0x332fd0=_0x37488d;if(_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')]&&_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0xedfe('0x49')]){for(var _0x5ecbf1=0x0;_0x5ecbf1<_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0xedfe('0x49')];_0x5ecbf1+=0x1){_0x48a3b7['body'][_0xedfe('0xaa')][_0x5ecbf1]={'filename':_0x48a3b7[_0xedfe('0x67')]['attachments'][_0x5ecbf1]['name'],'id':_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0x5ecbf1]['id'],'path':path[_0xedfe('0xab')](config[_0xedfe('0xac')],_0xedfe('0xad'),_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0x5ecbf1]['basename'])};}}return respondWithRpcPromise(_0xedfe('0xae'),_0xedfe('0xae'),{'FaxAccountId':_['isNil'](_0x48a3b7[_0xedfe('0x5a')]['id'])?undefined:_0x48a3b7[_0xedfe('0x5a')]['id'],'path':_['isNil'](_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['path'])?undefined:_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['path'],'fax':_[_0xedfe('0xaf')](_0x48a3b7[_0xedfe('0x67')]['to'][0x0])?undefined:_0x48a3b7[_0xedfe('0x67')]['to'][0x0]},client9002);})[_0xedfe('0x36')](function(){if(_0x332fd0){if(_[_0xedfe('0xaf')](_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xb0')])){_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xb0')]=util['format']('\x22%s\x22\x20<%s>',_0x332fd0['name'],_0x332fd0[_0xedfe('0xb1')]);}if(_0x332fd0[_0xedfe('0xa8')]){if(_0x332fd0[_0xedfe('0xa8')][_0xedfe('0xb2')][_0xedfe('0x49')]){return _0x332fd0[_0xedfe('0xa8')][_0xedfe('0xb2')][0x0];}else{return db[_0xedfe('0x77')][_0xedfe('0x5f')](_['defaults'](_0x48a3b7['body'],{'firstName':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'phone':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'fax':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'ListId':_0x332fd0[_0xedfe('0x9f')]}));}}else{throw new Error(_0xedfe('0xb3'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xedfe('0x36')](function(_0x109ed8){if(_0x109ed8){return db[_0xedfe('0x75')]['find']({'where':{'ContactId':_0x109ed8['id'],'closed':![],'FaxAccountId':_0x332fd0['id']}})[_0xedfe('0x36')](function(_0x139b19){if(_0x139b19){return[_0x139b19,![]];}return db[_0xedfe('0x75')][_0xedfe('0x5f')]({'UserId':_0x48a3b7[_0xedfe('0x62')]['id'],'ContactId':_0x109ed8['id'],'FaxAccountId':_0x332fd0['id'],'fax':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'firstMsgDirection':_0xedfe('0xb4'),'Messages':[_[_0xedfe('0x52')](_0x48a3b7[_0xedfe('0x67')],{'read':![],'body':_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][0x0][_0xedfe('0xb5')],'FaxAccountId':_0x332fd0['id'],'UserId':_0x48a3b7[_0xedfe('0x62')]['id'],'ContactId':_0x109ed8['id'],'AttachmentId':_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xedfe('0xa2')],'as':_0xedfe('0xb6')}]})[_0xedfe('0x36')](function(_0x4c7927){return[_0x4c7927,!![]];});});}else{throw new Error(_0xedfe('0xb7'));}})[_0xedfe('0xb8')](function(_0x3520fb,_0x576568){if(_0x576568){return _0x3520fb;}return db[_0xedfe('0xa2')][_0xedfe('0x5f')]({'direction':_0xedfe('0xb4'),'read':![],'body':_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['filename'],'FaxAccountId':_0x332fd0['id'],'FaxInteractionId':_0x3520fb['id'],'UserId':_0x48a3b7[_0xedfe('0x62')]['id'],'ContactId':_0x3520fb[_0xedfe('0xb9')],'AttachmentId':_0x48a3b7[_0xedfe('0x67')]['attachments'][0x0]['id']})[_0xedfe('0x36')](function(_0x3d63e4){_0x3520fb[_0xedfe('0xba')][_0xedfe('0xb6')]=[];_0x3520fb['dataValues'][_0xedfe('0xb6')]['push'](_0x3d63e4[_0xedfe('0xba')]);return _0x3520fb;});})[_0xedfe('0x36')](function(_0x70be2c){respondWithRpcPromise(_0xedfe('0xbb'),_0xedfe('0xbb'),{'FaxAccountId':_[_0xedfe('0xaf')](_0x48a3b7[_0xedfe('0x5a')]['id'])?undefined:_0x48a3b7[_0xedfe('0x5a')]['id'],'path':_[_0xedfe('0xaf')](_0x48a3b7['body'][_0xedfe('0xaa')][0x0][_0xedfe('0x6')])?undefined:_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][0x0][_0xedfe('0x6')],'fax':_[_0xedfe('0xaf')](_0x48a3b7['body']['to'][0x0])?undefined:_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'AttachmentId':_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][0x0]['id']},client9002)[_0xedfe('0x36')](function(_0x3f1493){logger[_0xedfe('0x23')](_0xedfe('0xbc'),_0x3f1493);})[_0xedfe('0x2b')](function(_0x2734b5){logger[_0xedfe('0x23')](_0xedfe('0xbc'),_0x2734b5);});return _0x70be2c;})[_0xedfe('0x36')](respondWithResult(_0x46a6ba,null))[_0xedfe('0x2b')](handleError(_0x46a6ba,null));};exports[_0xedfe('0xbd')]=function(_0x12b6b4,_0x390d97,_0x2b70ed){return db[_0xedfe('0x55')]['find']({'where':{'id':_0x12b6b4['params']['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x390d97,null))[_0xedfe('0x36')](function(_0x2b6263){if(_0x2b6263){return _0x2b6263[_0xedfe('0xbd')](_0x12b6b4[_0xedfe('0x67')][_0xedfe('0x70')],_['omit'](_0x12b6b4[_0xedfe('0x67')],['ids','id'])||{})[_0xedfe('0xb8')](function(_0x37bc68){for(var _0xcb5b05=0x0;_0xcb5b05<_0x12b6b4[_0xedfe('0x67')][_0xedfe('0x70')][_0xedfe('0x49')];_0xcb5b05+=0x1){socket[_0xedfe('0xbe')](_0xedfe('0xbf'),{'UserId':Number(_0x12b6b4[_0xedfe('0x67')][_0xedfe('0x70')][_0xcb5b05]),'FaxAccountId':Number(_0x12b6b4[_0xedfe('0x5a')]['id'])});}return _0x37bc68;});}})[_0xedfe('0x36')](respondWithResult(_0x390d97,null))['catch'](handleError(_0x390d97,null));};exports[_0xedfe('0xc0')]=function(_0x3813ba,_0x274d04,_0x84341){return db['FaxAccount'][_0xedfe('0x5e')]({'where':{'id':_0x3813ba[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x274d04,null))[_0xedfe('0x36')](function(_0xfee9cd){if(_0xfee9cd){return _0xfee9cd[_0xedfe('0xc0')](_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')])[_0xedfe('0x36')](function(){if(_[_0xedfe('0xc1')](_0x3813ba['query'][_0xedfe('0x70')])){for(var _0x3514eb=0x0;_0x3514eb<_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')][_0xedfe('0x49')];_0x3514eb+=0x1){socket[_0xedfe('0xbe')](_0xedfe('0xc2'),{'UserId':Number(_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')][_0x3514eb]),'FaxAccountId':Number(_0x3813ba['params']['id'])});}}else{socket[_0xedfe('0xbe')](_0xedfe('0xc2'),{'UserId':Number(_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')]),'FaxAccountId':Number(_0x3813ba['params']['id'])});}});}})[_0xedfe('0x36')](respondWithStatusCode(_0x274d04,null))[_0xedfe('0x2b')](handleError(_0x274d04,null));};exports[_0xedfe('0xc3')]=function(_0x3622aa,_0x1faa6d,_0x10215b){var _0x8d17b6={};var _0x420760={};var _0x102c0c;var _0x3b0560;return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x3622aa[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x1faa6d,null))[_0xedfe('0x36')](function(_0x269061){if(_0x269061){_0x102c0c=_0x269061;_0x420760[_0xedfe('0x44')]=_['keys'](db[_0xedfe('0x79')]['rawAttributes']);_0x420760[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x3622aa[_0xedfe('0x45')]);_0x420760[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x420760[_0xedfe('0x44')],_0x420760[_0xedfe('0x45')]);_0x8d17b6[_0xedfe('0x47')]=_['intersection'](_0x420760[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x3622aa['query'][_0xedfe('0x48')]));_0x8d17b6[_0xedfe('0x47')]=_0x8d17b6['attributes']['length']?_0x8d17b6[_0xedfe('0x47')]:_0x420760[_0xedfe('0x44')];_0x8d17b6[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x3622aa['query'][_0xedfe('0x4d')]);_0x8d17b6[_0xedfe('0x4e')]=qs['filters'](_[_0xedfe('0x50')](_0x3622aa[_0xedfe('0x45')],_0x420760[_0xedfe('0x4f')]));if(_0x3622aa[_0xedfe('0x45')][_0xedfe('0x51')]){_0x8d17b6[_0xedfe('0x4e')]=_['merge'](_0x8d17b6[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x8d17b6[_0xedfe('0x47')],function(_0x24aa5f){var _0x6603b8={};_0x6603b8[_0x24aa5f]={'$like':'%'+_0x3622aa[_0xedfe('0x45')]['filter']+'%'};return _0x6603b8;})});}_0x8d17b6=_[_0xedfe('0x52')]({},_0x8d17b6,_0x3622aa[_0xedfe('0x54')]);return _0x102c0c['getAgents'](_0x8d17b6);}})[_0xedfe('0x36')](function(_0x5d3f9e){if(_0x5d3f9e){_0x3b0560=_0x5d3f9e[_0xedfe('0x49')];if(!_0x3622aa['query'][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x8d17b6['limit']=qs[_0xedfe('0x2f')](_0x3622aa[_0xedfe('0x45')]['limit']);_0x8d17b6['offset']=qs[_0xedfe('0x2e')](_0x3622aa[_0xedfe('0x45')][_0xedfe('0x2e')]);}return _0x102c0c['getAgents'](_0x8d17b6);}})[_0xedfe('0x36')](function(_0x5868c1){if(_0x5868c1){return _0x5868c1?{'count':_0x3b0560,'rows':_0x5868c1}:null;}})['then'](respondWithResult(_0x1faa6d,null))[_0xedfe('0x2b')](handleError(_0x1faa6d,null));}; \ No newline at end of file +var _0x92a5=['ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','stack','finally','json','getApplications','context','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','omit','createdAt','updatedAt','ListId','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','out','filename','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','FaxInteraction','getInteractions','Contact','User','Owner','fullname','color','tag','addApplications','sequelize','Transaction'];(function(_0x3a364a,_0x3a33a4){var _0x47ffdf=function(_0x3191ed){while(--_0x3191ed){_0x3a364a['push'](_0x3a364a['shift']());}};_0x47ffdf(++_0x3a33a4);}(_0x92a5,0x1c2));var _0x592a=function(_0x23c1b0,_0x2ce460){_0x23c1b0=_0x23c1b0-0x0;var _0xcb6d9=_0x92a5[_0x23c1b0];return _0xcb6d9;};'use strict';var emlformat=require(_0x592a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x592a('0x1'));var rp=require('request-promise');var moment=require(_0x592a('0x2'));var BPromise=require(_0x592a('0x3'));var Mustache=require(_0x592a('0x4'));var util=require(_0x592a('0x5'));var path=require(_0x592a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x592a('0x7'));var fs=require('fs');var fs_extra=require(_0x592a('0x8'));var _=require('lodash');var squel=require(_0x592a('0x9'));var crypto=require(_0x592a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x592a('0xb'));var querystring=require(_0x592a('0xc'));var Papa=require(_0x592a('0xd'));var Redis=require(_0x592a('0xe'));var authService=require(_0x592a('0xf'));var qs=require(_0x592a('0x10'));var as=require(_0x592a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x592a('0x12'))(_0x592a('0x13'));var utils=require(_0x592a('0x14'));var config=require(_0x592a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x592a('0x16'))['db'];config[_0x592a('0x17')]=_[_0x592a('0x18')](config[_0x592a('0x17')],{'host':_0x592a('0x19'),'port':0x18eb});var socket=require(_0x592a('0x1a'))(new Redis(config['redis']));require(_0x592a('0x1b'))[_0x592a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x592a('0x1d')][_0x592a('0x1e')]({'port':0x232c});var client9002=jayson[_0x592a('0x1d')][_0x592a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1723b3,_0x27485f,_0x10e4bc,_0x5dbeea){return new BPromise(function(_0x4d10b1,_0x2ee9f4){var _0x29c8f7=_0x5dbeea||client;return _0x29c8f7[_0x592a('0x1f')](_0x1723b3,_0x10e4bc)['then'](function(_0x13e542){logger['info'](_0x592a('0x20'),_0x27485f,_0x592a('0x21'));logger['debug'](_0x592a('0x22'),_0x27485f,_0x592a('0x21'),JSON[_0x592a('0x23')](_0x13e542));if(_0x13e542['error']){if(_0x13e542[_0x592a('0x24')]['code']===0x1f4){logger['error'](_0x592a('0x20'),_0x27485f,_0x13e542[_0x592a('0x24')][_0x592a('0x25')]);return _0x2ee9f4(_0x13e542[_0x592a('0x24')][_0x592a('0x25')]);}logger['error'](_0x592a('0x20'),_0x27485f,_0x13e542[_0x592a('0x24')][_0x592a('0x25')]);return _0x4d10b1(_0x13e542['error'][_0x592a('0x25')]);}else{logger[_0x592a('0x26')](_0x592a('0x20'),_0x27485f,_0x592a('0x21'));_0x4d10b1(_0x13e542['result'][_0x592a('0x25')]);}})[_0x592a('0x27')](function(_0x65a7d3){logger['error'](_0x592a('0x20'),_0x27485f,_0x65a7d3);_0x2ee9f4(_0x65a7d3);});});}function respondWithStatusCode(_0x2ebb81,_0x2255bb){_0x2255bb=_0x2255bb||0xcc;return function(_0x416fa9){if(_0x416fa9){return _0x2ebb81[_0x592a('0x28')](_0x2255bb);}return _0x2ebb81['status'](_0x2255bb)[_0x592a('0x29')]();};}function respondWithResult(_0x8eba03,_0x4cff43){_0x4cff43=_0x4cff43||0xc8;return function(_0x40fb3e){if(_0x40fb3e){return _0x8eba03[_0x592a('0x2a')](_0x4cff43)['json'](_0x40fb3e);}};}function respondWithFilteredResult(_0x183483,_0x38dc14){return function(_0x4cf539){if(_0x4cf539){var _0x4593af=typeof _0x38dc14[_0x592a('0x2b')]===_0x592a('0x2c')&&typeof _0x38dc14[_0x592a('0x2d')]===_0x592a('0x2c');var _0x275da5=_0x4cf539[_0x592a('0x2e')];var _0x205ab7=_0x4593af?0x0:_0x38dc14[_0x592a('0x2b')];var _0x2927dd=_0x4593af?_0x4cf539[_0x592a('0x2e')]:_0x38dc14['offset']+_0x38dc14[_0x592a('0x2d')];var _0x114a8a;if(_0x2927dd>=_0x275da5){_0x2927dd=_0x275da5;_0x114a8a=0xc8;}else{_0x114a8a=0xce;}_0x183483[_0x592a('0x2a')](_0x114a8a);return _0x183483[_0x592a('0x2f')](_0x592a('0x30'),_0x205ab7+'-'+_0x2927dd+'/'+_0x275da5)['json'](_0x4cf539);}return null;};}function patchUpdates(_0x48a805){return function(_0x2ab914){try{jsonpatch[_0x592a('0x31')](_0x2ab914,_0x48a805,!![]);}catch(_0x13cfda){return BPromise[_0x592a('0x32')](_0x13cfda);}return _0x2ab914[_0x592a('0x33')]();};}function saveUpdates(_0x367fb3,_0x504174){return function(_0x5e77c0){if(_0x5e77c0){return _0x5e77c0[_0x592a('0x34')](_0x367fb3)[_0x592a('0x35')](function(_0x447e25){return _0x447e25;});}return null;};}function removeEntity(_0x3d4689,_0x275b24){return function(_0x52dfbe){if(_0x52dfbe){return _0x52dfbe[_0x592a('0x36')]()['then'](function(){var _0xcb005e=_0x52dfbe[_0x592a('0x37')]({'plain':!![]});var _0x4e5903=_0x592a('0x38');return db[_0x592a('0x39')][_0x592a('0x36')]({'where':{'type':_0x4e5903,'resourceId':_0xcb005e['id']}})[_0x592a('0x35')](function(){return _0x52dfbe;});})[_0x592a('0x35')](function(){_0x3d4689[_0x592a('0x2a')](0xcc)[_0x592a('0x29')]();});}};}function handleEntityNotFound(_0x3848e6,_0x4604e9){return function(_0x5af2b1){if(!_0x5af2b1){_0x3848e6[_0x592a('0x28')](0x194);}return _0x5af2b1;};}function handleError(_0x3681db,_0x34132d){_0x34132d=_0x34132d||0x1f4;return function(_0x4dbd52){logger['error'](_0x4dbd52['stack']);if(_0x4dbd52[_0x592a('0x3a')]){delete _0x4dbd52[_0x592a('0x3a')];}_0x3681db[_0x592a('0x2a')](_0x34132d)[_0x592a('0x3b')](_0x4dbd52);};}exports[_0x592a('0x3c')]=function(_0x1849ab,_0x473d53){var _0x5df8ce={'include':[{'model':db[_0x592a('0x3d')],'as':_0x592a('0x3e')}]},_0x2dec1c={},_0x4ca8e0={'count':0x0,'rows':[]};var _0x4f5627=_['map'](db[_0x592a('0x3f')][_0x592a('0x40')],function(_0x43bf9a){return{'name':_0x43bf9a[_0x592a('0x41')],'type':_0x43bf9a[_0x592a('0x42')][_0x592a('0x43')]};});_0x2dec1c[_0x592a('0x44')]=_[_0x592a('0x45')](_0x4f5627,_0x592a('0x3a'));_0x2dec1c['query']=_['keys'](_0x1849ab[_0x592a('0x46')]);_0x2dec1c[_0x592a('0x47')]=_[_0x592a('0x48')](_0x2dec1c[_0x592a('0x44')],_0x2dec1c[_0x592a('0x46')]);_0x5df8ce['attributes']=_[_0x592a('0x48')](_0x2dec1c[_0x592a('0x44')],qs[_0x592a('0x49')](_0x1849ab[_0x592a('0x46')][_0x592a('0x49')]));_0x5df8ce[_0x592a('0x4a')]=_0x5df8ce[_0x592a('0x4a')][_0x592a('0x4b')]?_0x5df8ce['attributes']:_0x2dec1c['model'];if(!_0x1849ab[_0x592a('0x46')][_0x592a('0x4c')]('nolimit')){_0x5df8ce[_0x592a('0x2d')]=qs[_0x592a('0x2d')](_0x1849ab[_0x592a('0x46')]['limit']);_0x5df8ce[_0x592a('0x2b')]=qs[_0x592a('0x2b')](_0x1849ab[_0x592a('0x46')][_0x592a('0x2b')]);}_0x5df8ce[_0x592a('0x4d')]=qs['sort'](_0x1849ab[_0x592a('0x46')][_0x592a('0x4e')]);_0x5df8ce[_0x592a('0x4f')]=qs[_0x592a('0x47')](_[_0x592a('0x50')](_0x1849ab[_0x592a('0x46')],_0x2dec1c['filters']),_0x4f5627);if(_0x1849ab['query'][_0x592a('0x51')]){_0x5df8ce[_0x592a('0x4f')]=_[_0x592a('0x52')](_0x5df8ce[_0x592a('0x4f')],{'$or':_['map'](_0x4f5627,function(_0x47197c){if(_0x47197c['type']!==_0x592a('0x53')){var _0x570346={};_0x570346[_0x47197c[_0x592a('0x3a')]]={'$like':'%'+_0x1849ab[_0x592a('0x46')][_0x592a('0x51')]+'%'};return _0x570346;}})});}_0x5df8ce=_[_0x592a('0x52')]({},_0x5df8ce,_0x1849ab[_0x592a('0x54')]);var _0x29f0da={'where':_0x5df8ce[_0x592a('0x4f')]};return db[_0x592a('0x3f')][_0x592a('0x2e')](_0x29f0da)[_0x592a('0x35')](function(_0xd1ab65){_0x4ca8e0['count']=_0xd1ab65;if(_0x1849ab[_0x592a('0x46')][_0x592a('0x55')]){_0x5df8ce[_0x592a('0x56')]=[{'all':!![]}];}return db[_0x592a('0x3f')][_0x592a('0x57')](_0x5df8ce);})[_0x592a('0x35')](function(_0x4d4fa7){_0x4ca8e0[_0x592a('0x58')]=_0x4d4fa7;return _0x4ca8e0;})[_0x592a('0x35')](respondWithFilteredResult(_0x473d53,_0x5df8ce))[_0x592a('0x27')](handleError(_0x473d53,null));};exports[_0x592a('0x59')]=function(_0x2beb36,_0x350d26){var _0x14827f={'raw':![],'where':{'id':_0x2beb36[_0x592a('0x5a')]['id']},'include':[{'model':db[_0x592a('0x3d')],'as':_0x592a('0x3e')}]},_0xaa534c={};_0xaa534c['model']=_[_0x592a('0x5b')](db['FaxAccount']['rawAttributes']);_0xaa534c[_0x592a('0x46')]=_[_0x592a('0x5b')](_0x2beb36['query']);_0xaa534c['filters']=_[_0x592a('0x48')](_0xaa534c['model'],_0xaa534c[_0x592a('0x46')]);_0x14827f[_0x592a('0x4a')]=_[_0x592a('0x48')](_0xaa534c[_0x592a('0x44')],qs['fields'](_0x2beb36['query']['fields']));_0x14827f['attributes']=_0x14827f['attributes'][_0x592a('0x4b')]?_0x14827f[_0x592a('0x4a')]:_0xaa534c['model'];if(_0x2beb36[_0x592a('0x46')][_0x592a('0x55')]){_0x14827f[_0x592a('0x56')]=[{'all':!![]}];}_0x14827f=_[_0x592a('0x52')]({},_0x14827f,_0x2beb36[_0x592a('0x54')]);return db[_0x592a('0x3f')][_0x592a('0x5c')](_0x14827f)[_0x592a('0x35')](handleEntityNotFound(_0x350d26,null))[_0x592a('0x35')](respondWithResult(_0x350d26,null))['catch'](handleError(_0x350d26,null));};exports[_0x592a('0x5d')]=function(_0x13ec9a,_0x2d8ab0){return db[_0x592a('0x3f')]['create'](_0x13ec9a[_0x592a('0x5e')],{})['then'](function(_0x567809){var _0x3f2f40=_0x13ec9a[_0x592a('0x5f')][_0x592a('0x37')]({'plain':!![]});if(!_0x3f2f40)throw new Error(_0x592a('0x60'));if(_0x3f2f40[_0x592a('0x61')]===_0x592a('0x5f')){var _0x3867d6=_0x567809[_0x592a('0x37')]({'plain':!![]});var _0x2da04='FaxAccounts';return db['UserProfileSection'][_0x592a('0x5c')]({'where':{'name':_0x2da04,'userProfileId':_0x3f2f40['userProfileId']},'raw':!![]})[_0x592a('0x35')](function(_0x397534){if(_0x397534&&_0x397534[_0x592a('0x62')]===0x0){return db[_0x592a('0x39')][_0x592a('0x5d')]({'name':_0x3867d6['name'],'resourceId':_0x3867d6['id'],'type':_0x397534[_0x592a('0x3a')],'sectionId':_0x397534['id']},{})[_0x592a('0x35')](function(){return _0x567809;});}else{return _0x567809;}})[_0x592a('0x27')](function(_0x24cbcd){logger[_0x592a('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24cbcd);throw _0x24cbcd;});}return _0x567809;})[_0x592a('0x35')](respondWithResult(_0x2d8ab0,0xc9))['catch'](handleError(_0x2d8ab0,null));};exports[_0x592a('0x34')]=function(_0x184a69,_0xaf8e6f){if(_0x184a69[_0x592a('0x5e')]['id']){delete _0x184a69[_0x592a('0x5e')]['id'];}return db[_0x592a('0x3f')][_0x592a('0x5c')]({'where':{'id':_0x184a69[_0x592a('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x592a('0x3e')}]})[_0x592a('0x35')](handleEntityNotFound(_0xaf8e6f,null))[_0x592a('0x35')](saveUpdates(_0x184a69['body'],null))[_0x592a('0x35')](respondWithResult(_0xaf8e6f,null))['catch'](handleError(_0xaf8e6f,null));};exports[_0x592a('0x36')]=function(_0x51803c,_0x35485b){return db[_0x592a('0x3f')][_0x592a('0x5c')]({'where':{'id':_0x51803c[_0x592a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x35485b,null))['then'](removeEntity(_0x35485b,null))['catch'](handleError(_0x35485b,null));};exports[_0x592a('0x63')]=function(_0x16cd68,_0x5b4628){return db[_0x592a('0x3f')][_0x592a('0x63')]()[_0x592a('0x35')](respondWithResult(_0x5b4628,null))[_0x592a('0x27')](handleError(_0x5b4628,null));};exports[_0x592a('0x64')]=function(_0x5d961d,_0x422d6b,_0x260069){if(_0x5d961d[_0x592a('0x5e')]['id']){delete _0x5d961d[_0x592a('0x5e')]['id'];}return db[_0x592a('0x3f')]['find']({'where':{'id':_0x5d961d['params']['id']}})['then'](handleEntityNotFound(_0x422d6b,null))['then'](function(_0x5e3af8){if(_0x5e3af8){_0x5d961d['body'][_0x592a('0x65')]=_0x5e3af8['id'];return db[_0x592a('0x66')]['create'](_0x5d961d[_0x592a('0x5e')]);}})[_0x592a('0x35')](respondWithResult(_0x422d6b,null))[_0x592a('0x27')](handleError(_0x422d6b,null));};exports[_0x592a('0x67')]=function(_0x509db5,_0x558eeb,_0x26bed){var _0x4d11d4={'raw':![],'where':{}};var _0x2fb1a2={};var _0x564f47={'count':0x0,'rows':[]};return db[_0x592a('0x3f')][_0x592a('0x68')]({'where':{'id':_0x509db5[_0x592a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x558eeb,null))[_0x592a('0x35')](function(_0x2a9f8e){if(_0x2a9f8e){_0x2fb1a2['model']=_[_0x592a('0x5b')](db[_0x592a('0x66')]['rawAttributes']);_0x2fb1a2[_0x592a('0x46')]=_[_0x592a('0x5b')](_0x509db5[_0x592a('0x46')]);_0x2fb1a2[_0x592a('0x47')]=_['intersection'](_0x2fb1a2[_0x592a('0x44')],_0x2fb1a2[_0x592a('0x46')]);_0x4d11d4[_0x592a('0x4a')]=_[_0x592a('0x48')](_0x2fb1a2[_0x592a('0x44')],qs[_0x592a('0x49')](_0x509db5[_0x592a('0x46')][_0x592a('0x49')]));_0x4d11d4[_0x592a('0x4a')]=_0x4d11d4['attributes']['length']?_0x4d11d4['attributes']:_0x2fb1a2[_0x592a('0x44')];if(!_0x509db5[_0x592a('0x46')][_0x592a('0x4c')](_0x592a('0x69'))){_0x4d11d4[_0x592a('0x2d')]=qs[_0x592a('0x2d')](_0x509db5[_0x592a('0x46')][_0x592a('0x2d')]);_0x4d11d4[_0x592a('0x2b')]=qs[_0x592a('0x2b')](_0x509db5['query']['offset']);}_0x4d11d4[_0x592a('0x4d')]=qs['sort'](_0x509db5[_0x592a('0x46')][_0x592a('0x4e')]);_0x4d11d4['where']=qs[_0x592a('0x47')](_[_0x592a('0x50')](_0x509db5[_0x592a('0x46')],_0x2fb1a2[_0x592a('0x47')]));_0x4d11d4['where'][_0x592a('0x65')]=_0x2a9f8e['id'];if(_0x509db5[_0x592a('0x46')][_0x592a('0x51')]){_0x4d11d4[_0x592a('0x4f')]=_['merge'](_0x4d11d4[_0x592a('0x4f')],{'$or':_[_0x592a('0x45')](_0x4d11d4[_0x592a('0x4a')],function(_0x5ed069){var _0x43348b={};_0x43348b[_0x5ed069]={'$like':'%'+_0x509db5['query']['filter']+'%'};return _0x43348b;})});}_0x4d11d4=_[_0x592a('0x52')]({},_0x4d11d4,_0x509db5[_0x592a('0x54')]);return db[_0x592a('0x66')]['count']({'where':_0x4d11d4[_0x592a('0x4f')]})[_0x592a('0x35')](function(_0x5490eb){_0x564f47[_0x592a('0x2e')]=_0x5490eb;if(_0x509db5['query'][_0x592a('0x55')]){_0x4d11d4[_0x592a('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4d11d4);})[_0x592a('0x35')](function(_0x48bb61){_0x564f47['rows']=_0x48bb61;return _0x564f47;});}})[_0x592a('0x35')](respondWithFilteredResult(_0x558eeb,_0x4d11d4))[_0x592a('0x27')](handleError(_0x558eeb,null));};exports[_0x592a('0x6a')]=function(_0x50c59d,_0x41ed4e,_0x36fa0d){return db[_0x592a('0x3f')][_0x592a('0x5c')]({'where':{'id':_0x50c59d[_0x592a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x41ed4e,null))[_0x592a('0x35')](function(_0x43147b){if(_0x43147b){return _0x43147b[_0x592a('0x6a')](_0x50c59d[_0x592a('0x46')]['ids']);}})[_0x592a('0x35')](respondWithStatusCode(_0x41ed4e,null))[_0x592a('0x27')](handleError(_0x41ed4e,null));};exports[_0x592a('0x6b')]=function(_0x2e2cf6,_0x45fa90,_0x4ef9ff){if(_0x2e2cf6[_0x592a('0x5e')]['id']){delete _0x2e2cf6[_0x592a('0x5e')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x2e2cf6[_0x592a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x45fa90,null))[_0x592a('0x35')](function(_0x215941){if(_0x215941){_0x2e2cf6[_0x592a('0x5e')][_0x592a('0x65')]=_0x215941['id'];return db[_0x592a('0x6c')]['create'](_0x2e2cf6[_0x592a('0x5e')]);}})[_0x592a('0x35')](respondWithResult(_0x45fa90,null))['catch'](handleError(_0x45fa90,null));};exports[_0x592a('0x6d')]=function(_0x18b02d,_0x229d82,_0x15beb8){var _0x8c2595={'raw':![],'where':{}};var _0x5934dc={};var _0x3bd3ed={'count':0x0,'rows':[]};return db[_0x592a('0x3f')][_0x592a('0x68')]({'where':{'id':_0x18b02d[_0x592a('0x5a')]['id']}})[_0x592a('0x35')](handleEntityNotFound(_0x229d82,null))['then'](function(_0x2db424){if(_0x2db424){_0x5934dc[_0x592a('0x44')]=_[_0x592a('0x5b')](db['CannedAnswer']['rawAttributes']);_0x5934dc[_0x592a('0x46')]=_[_0x592a('0x5b')](_0x18b02d['query']);_0x5934dc[_0x592a('0x47')]=_['intersection'](_0x5934dc[_0x592a('0x44')],_0x5934dc[_0x592a('0x46')]);_0x8c2595[_0x592a('0x4a')]=_['intersection'](_0x5934dc['model'],qs[_0x592a('0x49')](_0x18b02d['query'][_0x592a('0x49')]));_0x8c2595['attributes']=_0x8c2595[_0x592a('0x4a')][_0x592a('0x4b')]?_0x8c2595['attributes']:_0x5934dc[_0x592a('0x44')];if(!_0x18b02d[_0x592a('0x46')]['hasOwnProperty'](_0x592a('0x69'))){_0x8c2595[_0x592a('0x2d')]=qs['limit'](_0x18b02d[_0x592a('0x46')]['limit']);_0x8c2595[_0x592a('0x2b')]=qs[_0x592a('0x2b')](_0x18b02d['query']['offset']);}_0x8c2595[_0x592a('0x4d')]=qs[_0x592a('0x4e')](_0x18b02d[_0x592a('0x46')][_0x592a('0x4e')]);_0x8c2595[_0x592a('0x4f')]=qs[_0x592a('0x47')](_['pick'](_0x18b02d[_0x592a('0x46')],_0x5934dc[_0x592a('0x47')]));_0x8c2595[_0x592a('0x4f')][_0x592a('0x65')]=_0x2db424['id'];if(_0x18b02d['query']['filter']){_0x8c2595[_0x592a('0x4f')]=_[_0x592a('0x52')](_0x8c2595[_0x592a('0x4f')],{'$or':_[_0x592a('0x45')](_0x8c2595['attributes'],function(_0x552c08){var _0x1f6332={};_0x1f6332[_0x552c08]={'$like':'%'+_0x18b02d[_0x592a('0x46')]['filter']+'%'};return _0x1f6332;})});}_0x8c2595=_['merge']({},_0x8c2595,_0x18b02d[_0x592a('0x54')]);return db[_0x592a('0x6c')][_0x592a('0x2e')]({'where':_0x8c2595[_0x592a('0x4f')]})[_0x592a('0x35')](function(_0x3447ca){_0x3bd3ed[_0x592a('0x2e')]=_0x3447ca;if(_0x18b02d[_0x592a('0x46')][_0x592a('0x55')]){_0x8c2595[_0x592a('0x56')]=[{'all':!![]}];}return db[_0x592a('0x6c')]['findAll'](_0x8c2595);})[_0x592a('0x35')](function(_0x2727f4){_0x3bd3ed[_0x592a('0x58')]=_0x2727f4;return _0x3bd3ed;});}})[_0x592a('0x35')](respondWithFilteredResult(_0x229d82,_0x8c2595))[_0x592a('0x27')](handleError(_0x229d82,null));};exports[_0x592a('0x6e')]=function(_0x4f8fbf,_0x4c5486,_0x429bf8){return db[_0x592a('0x3f')][_0x592a('0x5c')]({'where':{'id':_0x4f8fbf[_0x592a('0x5a')]['id']}})[_0x592a('0x35')](handleEntityNotFound(_0x4c5486,null))[_0x592a('0x35')](function(_0x1809eb){if(_0x1809eb){return _0x1809eb['removeAnswers'](_0x4f8fbf[_0x592a('0x46')][_0x592a('0x6f')]);}})[_0x592a('0x35')](respondWithStatusCode(_0x4c5486,null))[_0x592a('0x27')](handleError(_0x4c5486,null));};exports['addInteraction']=function(_0x5d2983,_0x5c4106,_0xa1f38f){return db[_0x592a('0x70')]['find']({'where':{'id':_0x5d2983[_0x592a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5c4106,null))[_0x592a('0x35')](function(_0x3096ac){if(_0x3096ac){return _0x3096ac['addInteraction'](_0x5d2983[_0x592a('0x5e')][_0x592a('0x6f')],_['omit'](_0x5d2983[_0x592a('0x5e')],[_0x592a('0x6f'),'id'])||{});}})[_0x592a('0x35')](respondWithResult(_0x5c4106,null))['catch'](handleError(_0x5c4106,null));};exports[_0x592a('0x71')]=function(_0xf4eee0,_0x5d7b50,_0x596ff4){var _0x3bd348={'raw':![],'where':{}};var _0x106407={};var _0x31a75c={'count':0x0,'rows':[]};return db[_0x592a('0x3f')][_0x592a('0x68')]({'where':{'id':_0xf4eee0['params']['id']}})['then'](handleEntityNotFound(_0x5d7b50,null))['then'](function(_0xfb2092){if(_0xfb2092){_0x106407['model']=_[_0x592a('0x5b')](db[_0x592a('0x70')]['rawAttributes']);_0x106407[_0x592a('0x46')]=_[_0x592a('0x5b')](_0xf4eee0[_0x592a('0x46')]);_0x106407[_0x592a('0x47')]=_[_0x592a('0x48')](_0x106407[_0x592a('0x44')],_0x106407[_0x592a('0x46')]);_0x3bd348[_0x592a('0x4a')]=_[_0x592a('0x48')](_0x106407[_0x592a('0x44')],qs[_0x592a('0x49')](_0xf4eee0[_0x592a('0x46')][_0x592a('0x49')]));_0x3bd348[_0x592a('0x4a')]=_0x3bd348[_0x592a('0x4a')][_0x592a('0x4b')]?_0x3bd348[_0x592a('0x4a')]:_0x106407[_0x592a('0x44')];if(!_0xf4eee0[_0x592a('0x46')][_0x592a('0x4c')](_0x592a('0x69'))){_0x3bd348[_0x592a('0x2d')]=qs[_0x592a('0x2d')](_0xf4eee0[_0x592a('0x46')]['limit']);_0x3bd348[_0x592a('0x2b')]=qs['offset'](_0xf4eee0[_0x592a('0x46')][_0x592a('0x2b')]);}_0x3bd348['order']=qs[_0x592a('0x4e')](_0xf4eee0['query'][_0x592a('0x4e')]);_0x3bd348[_0x592a('0x4f')]=qs[_0x592a('0x47')](_['pick'](_0xf4eee0[_0x592a('0x46')],_0x106407[_0x592a('0x47')]));_0x3bd348[_0x592a('0x4f')][_0x592a('0x65')]=_0xfb2092['id'];if(_0xf4eee0[_0x592a('0x46')]['filter']){_0x3bd348[_0x592a('0x4f')]=_[_0x592a('0x52')](_0x3bd348[_0x592a('0x4f')],{'$or':_[_0x592a('0x45')](_0x3bd348[_0x592a('0x4a')],function(_0x35dd0b){var _0xb975b1={};_0xb975b1[_0x35dd0b]={'$like':'%'+_0xf4eee0[_0x592a('0x46')][_0x592a('0x51')]+'%'};return _0xb975b1;})});}_0x3bd348=_['merge']({},_0x3bd348,_0xf4eee0[_0x592a('0x54')]);return db[_0x592a('0x70')]['count']({'where':_0x3bd348[_0x592a('0x4f')]})[_0x592a('0x35')](function(_0x211046){_0x31a75c[_0x592a('0x2e')]=_0x211046;if(_0xf4eee0['query'][_0x592a('0x55')]){_0x3bd348['include']=[{'model':db['CmContact'],'as':_0x592a('0x72'),'required':![]},{'model':db[_0x592a('0x73')],'as':_0x592a('0x74'),'attributes':[_0x592a('0x3a'),_0x592a('0x75'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x592a('0x76')],'where':_0xf4eee0[_0x592a('0x46')][_0x592a('0x77')]?{'id':_0xf4eee0[_0x592a('0x46')][_0x592a('0x77')]}:undefined,'required':_0xf4eee0[_0x592a('0x46')][_0x592a('0x77')]?!![]:![]}];}return db[_0x592a('0x70')][_0x592a('0x57')](_0x3bd348);})[_0x592a('0x35')](function(_0x43cf0e){_0x31a75c[_0x592a('0x58')]=_0x43cf0e;return _0x31a75c;});}})[_0x592a('0x35')](respondWithFilteredResult(_0x5d7b50,_0x3bd348))[_0x592a('0x27')](handleError(_0x5d7b50,null));};exports[_0x592a('0x78')]=function(_0x5f0ab6,_0x46072c){var _0x2ecbcb=_0x5f0ab6[_0x592a('0x5a')]['id'];var _0x371d96=_0x5f0ab6[_0x592a('0x5e')];var _0x2e43cf=0xc8;var _0xe90056=null;return db[_0x592a('0x79')]['transaction']({'isolationLevel':db['sequelize'][_0x592a('0x7a')][_0x592a('0x7b')][_0x592a('0x7c')]},function(_0x4b0821){return db[_0x592a('0x3f')]['findOne']({'where':{'id':_0x2ecbcb},'transaction':_0x4b0821})[_0x592a('0x35')](function(_0x27c570){if(_0x27c570){return db[_0x592a('0x7d')][_0x592a('0x36')]({'where':{'FaxAccountId':_0x2ecbcb},'transaction':_0x4b0821})[_0x592a('0x35')](function(){var _0x16003c=_[_0x592a('0x45')](_0x371d96,function(_0x13e814){_0x13e814['FaxAccountId']=_0x2ecbcb;return _0x13e814;});return db[_0x592a('0x7d')][_0x592a('0x7e')](_0x16003c,{'transaction':_0x4b0821});});}else{_0x2e43cf=0x194;_0xe90056=[];}});})['then'](function(){if(_0x2e43cf!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x2ecbcb},'order':_0x592a('0x7f')})[_0x592a('0x35')](function(_0x3dae23){_0xe90056=_0x3dae23;});}})[_0x592a('0x27')](function(_0x1a53dd){_0x2e43cf=0x1f4;logger['error'](_0x1a53dd[_0x592a('0x80')]);if(_0x1a53dd[_0x592a('0x3a')]){delete _0x1a53dd['name'];}_0xe90056=_0x1a53dd;})[_0x592a('0x81')](function(){if(_0xe90056===null){_0x46072c[_0x592a('0x28')](_0x2e43cf);}else{if(_0x2e43cf===0x1f4){_0x46072c[_0x592a('0x2a')](_0x2e43cf)[_0x592a('0x3b')](_0xe90056);}else{_0x46072c[_0x592a('0x2a')](_0x2e43cf)[_0x592a('0x82')](_0xe90056);}}});};exports[_0x592a('0x83')]=function(_0x5305da,_0x5eb23b,_0x1cf205){var _0x34eb22={};var _0x96164a={};var _0x11434d;var _0x1b99d7;return db['FaxAccount'][_0x592a('0x68')]({'where':{'id':_0x5305da[_0x592a('0x5a')]['id']}})[_0x592a('0x35')](handleEntityNotFound(_0x5eb23b,null))['then'](function(_0x3b84ed){if(_0x3b84ed){_0x11434d=_0x3b84ed;_0x96164a[_0x592a('0x44')]=_[_0x592a('0x5b')](db[_0x592a('0x7d')][_0x592a('0x40')]);_0x96164a['query']=_['keys'](_0x5305da[_0x592a('0x46')]);_0x96164a['filters']=_[_0x592a('0x48')](_0x96164a['model'],_0x96164a[_0x592a('0x46')]);_0x34eb22['attributes']=_[_0x592a('0x48')](_0x96164a['model'],qs[_0x592a('0x49')](_0x5305da[_0x592a('0x46')][_0x592a('0x49')]));_0x34eb22['attributes']=_0x34eb22[_0x592a('0x4a')][_0x592a('0x4b')]?_0x34eb22[_0x592a('0x4a')]:_0x96164a[_0x592a('0x44')];_0x34eb22['order']=qs[_0x592a('0x4e')](_0x5305da['query'][_0x592a('0x4e')]);_0x34eb22[_0x592a('0x4f')]=qs[_0x592a('0x47')](_[_0x592a('0x50')](_0x5305da[_0x592a('0x46')],_0x96164a['filters']));if(_0x5305da[_0x592a('0x46')][_0x592a('0x51')]){_0x34eb22[_0x592a('0x4f')]=_[_0x592a('0x52')](_0x34eb22[_0x592a('0x4f')],{'$or':_[_0x592a('0x45')](_0x34eb22[_0x592a('0x4a')],function(_0x14b7f0){var _0xb9d40c={};_0xb9d40c[_0x14b7f0]={'$like':'%'+_0x5305da[_0x592a('0x46')]['filter']+'%'};return _0xb9d40c;})});}_0x34eb22=_['merge']({},_0x34eb22,_0x5305da[_0x592a('0x54')]);return _0x11434d['getApplications'](_0x34eb22);}})[_0x592a('0x35')](function(_0x383e5d){if(_0x383e5d){_0x1b99d7=_0x383e5d[_0x592a('0x4b')];if(!_0x5305da[_0x592a('0x46')][_0x592a('0x4c')]('nolimit')){_0x34eb22[_0x592a('0x2d')]=qs[_0x592a('0x2d')](_0x5305da[_0x592a('0x46')][_0x592a('0x2d')]);_0x34eb22[_0x592a('0x2b')]=qs[_0x592a('0x2b')](_0x5305da[_0x592a('0x46')][_0x592a('0x2b')]);}return _0x11434d[_0x592a('0x83')](_0x34eb22);}})[_0x592a('0x35')](function(_0x43f2a7){if(_0x43f2a7){return _0x43f2a7?{'count':_0x1b99d7,'rows':_0x43f2a7}:null;}})[_0x592a('0x35')](respondWithResult(_0x5eb23b,null))['catch'](handleError(_0x5eb23b,null));};function Extension(_0x39ceaf,_0x1f1ddb,_0x4c6930,_0x2eb1a2){this[_0x592a('0x84')]='from-voip-provider';this[_0x592a('0x85')]=_0x39ceaf[_0x592a('0x86')];this[_0x592a('0x87')]=_0x2eb1a2;this[_0x592a('0x42')]=_0x592a('0x88');this['description']=_0x592a('0x89');this[_0x592a('0x65')]=_0x39ceaf['id'];this['priority']=_0x1f1ddb;this[_0x592a('0x8a')]=_0x4c6930;}function createExtensionsReciveFax(_0x15b7cd){var _0x182e62=0x1;var _0x2523ae=[];_0x2523ae[_0x592a('0x8b')](new Extension(_0x15b7cd,_0x182e62,'',_0x592a('0x8c')));_0x182e62+=0x1;_0x2523ae[_0x592a('0x8b')](new Extension(_0x15b7cd,_0x182e62,_0x592a('0x8d'),_0x592a('0x8e')));_0x182e62+=0x1;for(var _0x56d43f in _0x15b7cd){if(_0x15b7cd[_0x592a('0x4c')](_0x56d43f)&&(_0x56d43f===_0x592a('0x8f')||_0x56d43f===_0x592a('0x86')||_0x56d43f===_0x592a('0x90')||_0x56d43f===_0x592a('0x91')||_0x56d43f===_0x592a('0x92')||_0x56d43f==='maxrate'||_0x56d43f===_0x592a('0x93')||_0x56d43f===_0x592a('0x94')||_0x56d43f===_0x592a('0x95'))){_0x2523ae[_0x592a('0x8b')](new Extension(_0x15b7cd,_0x182e62,_0x592a('0x96')+_0x56d43f+')='+_0x15b7cd[_0x56d43f],'Set'));_0x182e62+=0x1;}}_0x2523ae['push'](new Extension(_0x15b7cd,_0x182e62,'6','Wait'));_0x182e62+=0x1;_0x2523ae[_0x592a('0x8b')](new Extension(_0x15b7cd,_0x182e62,'/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',_0x592a('0x97')));_0x182e62=0x0;return _0x2523ae;}exports[_0x592a('0x98')]=function(_0x256b94,_0x309978,_0x284e2c){var _0x58a60b;return db['sequelize'][_0x592a('0x99')](function(_0xc7c48f){return db[_0x592a('0x3f')][_0x592a('0x5d')](_0x256b94[_0x592a('0x5e')],{'transaction':_0xc7c48f})['then'](function(_0x14e77b){_0x58a60b=_0x14e77b['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x58a60b),{'transaction':_0xc7c48f});});})[_0x592a('0x35')](function(){return _0x58a60b;})[_0x592a('0x35')](respondWithResult(_0x309978,null))[_0x592a('0x27')](handleError(_0x309978,null));};exports[_0x592a('0x9a')]=function(_0x2a420f,_0x1c2be8,_0x49accb){var _0x35d0fd;return db[_0x592a('0x79')][_0x592a('0x99')](function(_0x291d19){return db[_0x592a('0x3f')][_0x592a('0x34')](_0x2a420f[_0x592a('0x5e')],{'where':{'id':_0x2a420f[_0x592a('0x5e')]['id']},'transaction':_0x291d19})[_0x592a('0x35')](function(_0x137a82){return db[_0x592a('0x9b')]['destroy']({'where':{'FaxAccountId':_0x2a420f['body']['id']},'transaction':_0x291d19})[_0x592a('0x35')](function(_0x1cc02d){return db[_0x592a('0x9b')][_0x592a('0x7e')](createExtensionsReciveFax(_[_0x592a('0x9c')](_0x2a420f[_0x592a('0x5e')],['tech',_0x592a('0x43'),_0x592a('0x9d'),_0x592a('0x9e'),'TrunkId',_0x592a('0x9f')])),{'transaction':_0x291d19});});});})[_0x592a('0x35')](function(){return db[_0x592a('0x3f')]['findById'](_0x2a420f[_0x592a('0x5e')]['id']);})[_0x592a('0x35')](respondWithResult(_0x1c2be8,null))['catch'](handleError(_0x1c2be8,null));};exports['getMessages']=function(_0x26e165,_0xc1ef8c,_0x210bbf){var _0x961550={'raw':!![],'where':{}};var _0x15c71e={};var _0x2c658d={'count':0x0,'rows':[]};return db[_0x592a('0x3f')][_0x592a('0x68')]({'where':{'id':_0x26e165['params']['id']}})[_0x592a('0x35')](handleEntityNotFound(_0xc1ef8c,null))['then'](function(_0x55d98b){if(_0x55d98b){_0x15c71e[_0x592a('0x44')]=_[_0x592a('0x5b')](db[_0x592a('0xa0')]['rawAttributes']);_0x15c71e[_0x592a('0x46')]=_['keys'](_0x26e165[_0x592a('0x46')]);_0x15c71e['filters']=_['intersection'](_0x15c71e[_0x592a('0x44')],_0x15c71e['query']);_0x961550[_0x592a('0x4a')]=_[_0x592a('0x48')](_0x15c71e[_0x592a('0x44')],qs['fields'](_0x26e165[_0x592a('0x46')]['fields']));_0x961550['attributes']=_0x961550[_0x592a('0x4a')]['length']?_0x961550[_0x592a('0x4a')]:_0x15c71e['model'];if(!_0x26e165[_0x592a('0x46')][_0x592a('0x4c')](_0x592a('0x69'))){_0x961550['limit']=qs['limit'](_0x26e165[_0x592a('0x46')][_0x592a('0x2d')]);_0x961550[_0x592a('0x2b')]=qs[_0x592a('0x2b')](_0x26e165[_0x592a('0x46')][_0x592a('0x2b')]);}_0x961550[_0x592a('0x4d')]=qs['sort'](_0x26e165[_0x592a('0x46')][_0x592a('0x4e')]);_0x961550[_0x592a('0x4f')]=qs[_0x592a('0x47')](_[_0x592a('0x50')](_0x26e165[_0x592a('0x46')],_0x15c71e[_0x592a('0x47')]));_0x961550[_0x592a('0x4f')][_0x592a('0x65')]=_0x55d98b['id'];if(_0x26e165[_0x592a('0x46')][_0x592a('0x51')]){_0x961550[_0x592a('0x4f')]=_[_0x592a('0x52')](_0x961550['where'],{'$or':_[_0x592a('0x45')](_0x961550[_0x592a('0x4a')],function(_0x23aa0b){var _0x186703={};_0x186703[_0x23aa0b]={'$like':'%'+_0x26e165[_0x592a('0x46')][_0x592a('0x51')]+'%'};return _0x186703;})});}if(_0x26e165['query'][_0x592a('0xa1')]){var _0x409ff2=_0x26e165['query'][_0x592a('0xa1')][_0x592a('0xa2')](',');var _0x343002={};_0x343002[_0x409ff2[0x0]]={'$gte':moment(_0x409ff2[0x1])[_0x592a('0xa3')](_0x592a('0xa4'))};_0x961550[_0x592a('0x4f')]=_[_0x592a('0x52')](_0x961550['where'],_0x343002);}_0x961550=_['merge']({},_0x961550,_0x26e165[_0x592a('0x54')]);return db[_0x592a('0xa0')][_0x592a('0x2e')]({'where':_0x961550[_0x592a('0x4f')]})['then'](function(_0x58c484){_0x2c658d[_0x592a('0x2e')]=_0x58c484;if(_0x26e165[_0x592a('0x46')][_0x592a('0x55')]){_0x961550[_0x592a('0x56')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x961550);})['then'](function(_0x36396d){_0x2c658d[_0x592a('0x58')]=_0x36396d;return _0x2c658d;});}})[_0x592a('0x35')](respondWithFilteredResult(_0xc1ef8c,_0x961550))[_0x592a('0x27')](handleError(_0xc1ef8c,null));};exports['send']=function(_0x5cf972,_0x475b84,_0x84ce35){var _0x5cdbd2,_0x41244a={},_0x26e45d;if(_0x5cf972[_0x592a('0x5e')]['to']){_0x26e45d=_0x5cf972[_0x592a('0x5e')]['to'][0x0];}return db[_0x592a('0x3f')][_0x592a('0x5c')]({'where':{'id':_0x5cf972[_0x592a('0x5a')]['id']},'include':[{'model':db[_0x592a('0xa5')],'as':_0x592a('0xa6'),'include':[{'model':db[_0x592a('0xa7')],'as':_0x592a('0xa8'),'where':{'fax':_0x26e45d},'limit':0x1,'order':[['updatedAt',_0x592a('0xa9')]]}]}]})['then'](handleEntityNotFound(_0x475b84,null))[_0x592a('0x35')](function(_0x10b6f2){_0x5cdbd2=_0x10b6f2;if(_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')]&&_0x5cf972['body'][_0x592a('0xaa')][_0x592a('0x4b')]){for(var _0x1932e8=0x0;_0x1932e8<_0x5cf972['body'][_0x592a('0xaa')][_0x592a('0x4b')];_0x1932e8+=0x1){_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][_0x1932e8]={'filename':_0x5cf972['body'][_0x592a('0xaa')][_0x1932e8][_0x592a('0x3a')],'id':_0x5cf972[_0x592a('0x5e')]['attachments'][_0x1932e8]['id'],'path':path['join'](config['root'],_0x592a('0xab'),_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][_0x1932e8][_0x592a('0xac')])};}}return respondWithRpcPromise(_0x592a('0xad'),_0x592a('0xad'),{'FaxAccountId':_[_0x592a('0xae')](_0x5cf972[_0x592a('0x5a')]['id'])?undefined:_0x5cf972[_0x592a('0x5a')]['id'],'path':_['isNil'](_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][0x0][_0x592a('0x6')])?undefined:_0x5cf972['body'][_0x592a('0xaa')][0x0][_0x592a('0x6')],'fax':_['isNil'](_0x5cf972[_0x592a('0x5e')]['to'][0x0])?undefined:_0x5cf972[_0x592a('0x5e')]['to'][0x0]},client9002);})[_0x592a('0x35')](function(){if(_0x5cdbd2){if(_['isNil'](_0x5cf972['body']['from'])){_0x5cf972[_0x592a('0x5e')]['from']=util[_0x592a('0xa3')](_0x592a('0xaf'),_0x5cdbd2['name'],_0x5cdbd2[_0x592a('0xb0')]);}if(_0x5cdbd2[_0x592a('0xa6')]){if(_0x5cdbd2[_0x592a('0xa6')][_0x592a('0xa8')]['length']){return _0x5cdbd2['List'][_0x592a('0xa8')][0x0];}else{return db[_0x592a('0xa7')]['create'](_[_0x592a('0x18')](_0x5cf972[_0x592a('0x5e')],{'firstName':_0x5cf972['body']['to'][0x0],'phone':_0x5cf972['body']['to'][0x0],'fax':_0x5cf972[_0x592a('0x5e')]['to'][0x0],'ListId':_0x5cdbd2[_0x592a('0x9f')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x592a('0xb1'));}})[_0x592a('0x35')](function(_0x537ec6){if(_0x537ec6){return db[_0x592a('0x70')][_0x592a('0x5c')]({'where':{'ContactId':_0x537ec6['id'],'closed':![],'FaxAccountId':_0x5cdbd2['id']}})['then'](function(_0x1d6087){if(_0x1d6087){return[_0x1d6087,![]];}return db[_0x592a('0x70')][_0x592a('0x5d')]({'UserId':_0x5cf972[_0x592a('0x5f')]['id'],'ContactId':_0x537ec6['id'],'FaxAccountId':_0x5cdbd2['id'],'fax':_0x5cf972['body']['to'][0x0],'firstMsgDirection':_0x592a('0xb2'),'Messages':[_[_0x592a('0x52')](_0x5cf972['body'],{'read':![],'body':_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][0x0][_0x592a('0xb3')],'FaxAccountId':_0x5cdbd2['id'],'UserId':_0x5cf972[_0x592a('0x5f')]['id'],'ContactId':_0x537ec6['id'],'AttachmentId':_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x592a('0xa0')],'as':'Messages'}]})['then'](function(_0x5c184b){return[_0x5c184b,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x592a('0xb4')](function(_0x380c56,_0x3864a7){if(_0x3864a7){return _0x380c56;}return db[_0x592a('0xa0')][_0x592a('0x5d')]({'direction':_0x592a('0xb2'),'read':![],'body':_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][0x0][_0x592a('0xb3')],'FaxAccountId':_0x5cdbd2['id'],'FaxInteractionId':_0x380c56['id'],'UserId':_0x5cf972[_0x592a('0x5f')]['id'],'ContactId':_0x380c56[_0x592a('0xb5')],'AttachmentId':_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][0x0]['id']})['then'](function(_0x38c43e){_0x380c56[_0x592a('0xb6')][_0x592a('0xb7')]=[];_0x380c56['dataValues'][_0x592a('0xb7')][_0x592a('0x8b')](_0x38c43e['dataValues']);return _0x380c56;});})['then'](function(_0xb61fb){respondWithRpcPromise(_0x592a('0xb8'),_0x592a('0xb8'),{'FaxAccountId':_[_0x592a('0xae')](_0x5cf972['params']['id'])?undefined:_0x5cf972[_0x592a('0x5a')]['id'],'path':_['isNil'](_0x5cf972['body'][_0x592a('0xaa')][0x0]['path'])?undefined:_0x5cf972[_0x592a('0x5e')][_0x592a('0xaa')][0x0][_0x592a('0x6')],'fax':_[_0x592a('0xae')](_0x5cf972['body']['to'][0x0])?undefined:_0x5cf972[_0x592a('0x5e')]['to'][0x0],'AttachmentId':_0x5cf972['body']['attachments'][0x0]['id']},client9002)[_0x592a('0x35')](function(_0x1918d5){logger[_0x592a('0x26')]('SendFaxRpc,\x20%s',_0x1918d5);})['catch'](function(_0x2ae620){logger[_0x592a('0x26')](_0x592a('0xb9'),_0x2ae620);});return _0xb61fb;})[_0x592a('0x35')](respondWithResult(_0x475b84,null))['catch'](handleError(_0x475b84,null));};exports['addAgents']=function(_0x4997a4,_0x41bf46,_0x29917a){return db['FaxAccount'][_0x592a('0x5c')]({'where':{'id':_0x4997a4[_0x592a('0x5a')]['id']}})[_0x592a('0x35')](handleEntityNotFound(_0x41bf46,null))[_0x592a('0x35')](function(_0x97fc4d){if(_0x97fc4d){return _0x97fc4d[_0x592a('0xba')](_0x4997a4[_0x592a('0x5e')][_0x592a('0x6f')],_[_0x592a('0x9c')](_0x4997a4[_0x592a('0x5e')],[_0x592a('0x6f'),'id'])||{})[_0x592a('0xb4')](function(_0x19af08){for(var _0x3060ce=0x0;_0x3060ce<_0x4997a4[_0x592a('0x5e')][_0x592a('0x6f')]['length'];_0x3060ce+=0x1){socket[_0x592a('0xbb')]('userFaxAccount:save',{'UserId':Number(_0x4997a4[_0x592a('0x5e')][_0x592a('0x6f')][_0x3060ce]),'FaxAccountId':Number(_0x4997a4[_0x592a('0x5a')]['id'])});}return _0x19af08;});}})[_0x592a('0x35')](respondWithResult(_0x41bf46,null))[_0x592a('0x27')](handleError(_0x41bf46,null));};exports['removeAgents']=function(_0x3ee915,_0x1810d8,_0x38621f){return db[_0x592a('0x3f')][_0x592a('0x5c')]({'where':{'id':_0x3ee915[_0x592a('0x5a')]['id']}})[_0x592a('0x35')](handleEntityNotFound(_0x1810d8,null))[_0x592a('0x35')](function(_0x38bdaf){if(_0x38bdaf){return _0x38bdaf[_0x592a('0xbc')](_0x3ee915[_0x592a('0x46')]['ids'])['then'](function(){if(_['isArray'](_0x3ee915[_0x592a('0x46')][_0x592a('0x6f')])){for(var _0x7e9e34=0x0;_0x7e9e34<_0x3ee915['query']['ids'][_0x592a('0x4b')];_0x7e9e34+=0x1){socket[_0x592a('0xbb')](_0x592a('0xbd'),{'UserId':Number(_0x3ee915[_0x592a('0x46')]['ids'][_0x7e9e34]),'FaxAccountId':Number(_0x3ee915[_0x592a('0x5a')]['id'])});}}else{socket[_0x592a('0xbb')]('userFaxAccount:remove',{'UserId':Number(_0x3ee915['query']['ids']),'FaxAccountId':Number(_0x3ee915[_0x592a('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1810d8,null))[_0x592a('0x27')](handleError(_0x1810d8,null));};exports[_0x592a('0xbe')]=function(_0x415156,_0x3c412a,_0x594c96){var _0x11299d={};var _0x52f7cb={};var _0x3ede7e;var _0x3643f5;return db[_0x592a('0x3f')][_0x592a('0x68')]({'where':{'id':_0x415156[_0x592a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3c412a,null))[_0x592a('0x35')](function(_0x216e5f){if(_0x216e5f){_0x3ede7e=_0x216e5f;_0x52f7cb[_0x592a('0x44')]=_['keys'](db['User'][_0x592a('0x40')]);_0x52f7cb[_0x592a('0x46')]=_[_0x592a('0x5b')](_0x415156[_0x592a('0x46')]);_0x52f7cb[_0x592a('0x47')]=_[_0x592a('0x48')](_0x52f7cb[_0x592a('0x44')],_0x52f7cb[_0x592a('0x46')]);_0x11299d[_0x592a('0x4a')]=_[_0x592a('0x48')](_0x52f7cb[_0x592a('0x44')],qs[_0x592a('0x49')](_0x415156[_0x592a('0x46')][_0x592a('0x49')]));_0x11299d[_0x592a('0x4a')]=_0x11299d[_0x592a('0x4a')][_0x592a('0x4b')]?_0x11299d['attributes']:_0x52f7cb[_0x592a('0x44')];_0x11299d['order']=qs[_0x592a('0x4e')](_0x415156[_0x592a('0x46')]['sort']);_0x11299d[_0x592a('0x4f')]=qs[_0x592a('0x47')](_['pick'](_0x415156[_0x592a('0x46')],_0x52f7cb[_0x592a('0x47')]));if(_0x415156[_0x592a('0x46')][_0x592a('0x51')]){_0x11299d[_0x592a('0x4f')]=_[_0x592a('0x52')](_0x11299d['where'],{'$or':_[_0x592a('0x45')](_0x11299d['attributes'],function(_0xee6af2){var _0x5c6203={};_0x5c6203[_0xee6af2]={'$like':'%'+_0x415156[_0x592a('0x46')][_0x592a('0x51')]+'%'};return _0x5c6203;})});}_0x11299d=_[_0x592a('0x52')]({},_0x11299d,_0x415156['options']);return _0x3ede7e[_0x592a('0xbe')](_0x11299d);}})[_0x592a('0x35')](function(_0x4aefd6){if(_0x4aefd6){_0x3643f5=_0x4aefd6[_0x592a('0x4b')];if(!_0x415156[_0x592a('0x46')][_0x592a('0x4c')]('nolimit')){_0x11299d['limit']=qs[_0x592a('0x2d')](_0x415156['query'][_0x592a('0x2d')]);_0x11299d[_0x592a('0x2b')]=qs[_0x592a('0x2b')](_0x415156['query']['offset']);}return _0x3ede7e[_0x592a('0xbe')](_0x11299d);}})[_0x592a('0x35')](function(_0x2aff){if(_0x2aff){return _0x2aff?{'count':_0x3643f5,'rows':_0x2aff}:null;}})['then'](respondWithResult(_0x3c412a,null))[_0x592a('0x27')](handleError(_0x3c412a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b6b1ab7..7dcaf5b 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 _0xbb29=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xbb29,0x6d));var _0x9bb2=function(_0x4f7398,_0x1713f0){_0x4f7398=_0x4f7398-0x0;var _0x27f5a7=_0xbb29[_0x4f7398];return _0x27f5a7;};'use strict';var EventEmitter=require(_0x9bb2('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9bb2('0x1')](0x0);var events={'afterCreate':_0x9bb2('0x2'),'afterUpdate':_0x9bb2('0x3'),'afterDestroy':_0x9bb2('0x4')};function emitEvent(_0x5d2206){return function(_0x45ab7c,_0x3707d,_0x2fda2d){FaxAccountEvents[_0x9bb2('0x5')](_0x5d2206+':'+_0x45ab7c['id'],_0x45ab7c);FaxAccountEvents[_0x9bb2('0x5')](_0x5d2206,_0x45ab7c);_0x2fda2d(null);};}for(var e in events){if(events[_0x9bb2('0x6')](e)){var event=events[e];FaxAccount[_0x9bb2('0x7')](e,emitEvent(event));}}module[_0x9bb2('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xe174=['exports','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x457f7a,_0xb5f8d2){var _0x3ff173=function(_0x1dbb14){while(--_0x1dbb14){_0x457f7a['push'](_0x457f7a['shift']());}};_0x3ff173(++_0xb5f8d2);}(_0xe174,0x64));var _0x4e17=function(_0x2146dc,_0x5736a0){_0x2146dc=_0x2146dc-0x0;var _0x958647=_0xe174[_0x2146dc];return _0x958647;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x4e17('0x0'))['db'][_0x4e17('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4e17('0x2')](0x0);var events={'afterCreate':_0x4e17('0x3'),'afterUpdate':_0x4e17('0x4'),'afterDestroy':_0x4e17('0x5')};function emitEvent(_0x5405c6){return function(_0x3a1142,_0x3f8742,_0x137e40){FaxAccountEvents[_0x4e17('0x6')](_0x5405c6+':'+_0x3a1142['id'],_0x3a1142);FaxAccountEvents[_0x4e17('0x6')](_0x5405c6,_0x3a1142);_0x137e40(null);};}for(var e in events){if(events[_0x4e17('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x4e17('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 6a9160f..8717b6f 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 _0x3e89=['bluebird','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','../../config/logger','api','moment'];(function(_0x5d1292,_0x4bb67c){var _0x296667=function(_0x216d6b){while(--_0x216d6b){_0x5d1292['push'](_0x5d1292['shift']());}};_0x296667(++_0x4bb67c);}(_0x3e89,0xa4));var _0x93e8=function(_0x4aed73,_0xe214a5){_0x4aed73=_0x4aed73-0x0;var _0x39f0bb=_0x3e89[_0x4aed73];return _0x39f0bb;};'use strict';var _=require('lodash');var util=require(_0x93e8('0x0'));var logger=require(_0x93e8('0x1'))(_0x93e8('0x2'));var moment=require(_0x93e8('0x3'));var BPromise=require(_0x93e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x93e8('0x5'));var config=require(_0x93e8('0x6'));var attributes=require(_0x93e8('0x7'));module[_0x93e8('0x8')]=function(_0x31b78f,_0x6a815f){return _0x31b78f[_0x93e8('0x9')](_0x93e8('0xa'),attributes,{'tableName':_0x93e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe09=['define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x18b0c3,_0xf7aa83){var _0x395709=function(_0x5871ec){while(--_0x5871ec){_0x18b0c3['push'](_0x18b0c3['shift']());}};_0x395709(++_0xf7aa83);}(_0xfe09,0x8a));var _0x9fe0=function(_0xc3b26f,_0x11345e){_0xc3b26f=_0xc3b26f-0x0;var _0x591362=_0xfe09[_0xc3b26f];return _0x591362;};'use strict';var _=require(_0x9fe0('0x0'));var util=require(_0x9fe0('0x1'));var logger=require(_0x9fe0('0x2'))(_0x9fe0('0x3'));var moment=require(_0x9fe0('0x4'));var BPromise=require(_0x9fe0('0x5'));var rp=require(_0x9fe0('0x6'));var fs=require('fs');var path=require(_0x9fe0('0x7'));var rimraf=require(_0x9fe0('0x8'));var config=require(_0x9fe0('0x9'));var attributes=require(_0x9fe0('0xa'));module[_0x9fe0('0xb')]=function(_0x3a647d,_0x5e2611){return _0x3a647d[_0x9fe0('0xc')](_0x9fe0('0xd'),attributes,{'tableName':_0x9fe0('0xe'),'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 0c23eb2..efd03b1 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 _0x4a6a=['contact','FaxInteraction','Contact\x20not\x20found','spread','get','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','unshift','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','then','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','applications','Applications','list','orderBy','priority','asc','length','ListId','create'];(function(_0x3da2f8,_0x50e1f6){var _0xefcb74=function(_0x54fc44){while(--_0x54fc44){_0x3da2f8['push'](_0x3da2f8['shift']());}};_0xefcb74(++_0x50e1f6);}(_0x4a6a,0xc9));var _0xa4a6=function(_0x2de209,_0x5527de){_0x2de209=_0x2de209-0x0;var _0x783a78=_0x4a6a[_0x2de209];return _0x783a78;};'use strict';var _=require(_0xa4a6('0x0'));var util=require(_0xa4a6('0x1'));var moment=require(_0xa4a6('0x2'));var BPromise=require(_0xa4a6('0x3'));var rs=require(_0xa4a6('0x4'));var fs=require('fs');var Redis=require(_0xa4a6('0x5'));var db=require(_0xa4a6('0x6'))['db'];var utils=require(_0xa4a6('0x7'));var logger=require(_0xa4a6('0x8'))(_0xa4a6('0x9'));var config=require(_0xa4a6('0xa'));var jayson=require(_0xa4a6('0xb'));var client=jayson[_0xa4a6('0xc')][_0xa4a6('0xd')]({'port':0x232c});config[_0xa4a6('0xe')]=_[_0xa4a6('0xf')](config[_0xa4a6('0xe')],{'host':_0xa4a6('0x10'),'port':0x18eb});var socket=require(_0xa4a6('0x11'))(new Redis(config[_0xa4a6('0xe')]));require(_0xa4a6('0x12'))[_0xa4a6('0x13')](socket);function respondWithRpcPromise(_0x388ff7,_0x292f7d,_0x18c029){return new BPromise(function(_0x37aa01,_0x237b49){return client[_0xa4a6('0x14')](_0x388ff7,_0x18c029)['then'](function(_0x347403){logger[_0xa4a6('0x15')](_0xa4a6('0x16'),_0x292f7d,_0xa4a6('0x17'));logger[_0xa4a6('0x18')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x292f7d,'request\x20sent',JSON[_0xa4a6('0x19')](_0x347403));if(_0x347403[_0xa4a6('0x1a')]){if(_0x347403[_0xa4a6('0x1a')]['code']===0x1f4){logger['error'](_0xa4a6('0x16'),_0x292f7d,_0x347403['error']['message']);return _0x237b49(_0x347403['error']['message']);}logger[_0xa4a6('0x1a')](_0xa4a6('0x16'),_0x292f7d,_0x347403['error'][_0xa4a6('0x1b')]);return _0x37aa01(_0x347403[_0xa4a6('0x1a')]['message']);}else{logger[_0xa4a6('0x15')](_0xa4a6('0x16'),_0x292f7d,_0xa4a6('0x17'));_0x37aa01(_0x347403[_0xa4a6('0x1c')][_0xa4a6('0x1b')]);}})[_0xa4a6('0x1d')](function(_0x169e0a){logger[_0xa4a6('0x1a')](_0xa4a6('0x16'),_0x292f7d,_0x169e0a);_0x237b49(_0x169e0a);});});}exports[_0xa4a6('0x1e')]=function(_0x15c9bf){var _0x1a5919=this;return new Promise(function(_0x2eea42,_0x252805){return db[_0xa4a6('0x1f')]['findAll']({'raw':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf['options'][_0xa4a6('0x21')]===undefined?!![]:![]:!![],'where':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x22')]||null:null,'attributes':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x23')]||null:null,'limit':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf['options'][_0xa4a6('0x24')]||null:null,'include':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x25')]?_[_0xa4a6('0x26')](_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x25')],function(_0x2cdfa9){return{'model':db[_0x2cdfa9['model']],'as':_0x2cdfa9['as'],'attributes':_0x2cdfa9['attributes'],'include':_0x2cdfa9[_0xa4a6('0x25')]?_['map'](_0x2cdfa9[_0xa4a6('0x25')],function(_0x63bad3){return{'model':db[_0x63bad3['model']],'as':_0x63bad3['as'],'attributes':_0x63bad3[_0xa4a6('0x23')],'include':_0x63bad3[_0xa4a6('0x25')]?_['map'](_0x63bad3[_0xa4a6('0x25')],function(_0xdaab91){return{'model':db[_0xdaab91['model']],'as':_0xdaab91['as'],'attributes':_0xdaab91[_0xa4a6('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa4a6('0x27')](function(_0x54fcb2){logger['info'](_0xa4a6('0x1e'),_0x15c9bf);logger[_0xa4a6('0x18')](_0xa4a6('0x1e'),_0x15c9bf,JSON['stringify'](_0x54fcb2));_0x2eea42(_0x54fcb2);})[_0xa4a6('0x1d')](function(_0x5cd479){logger[_0xa4a6('0x1a')](_0xa4a6('0x1e'),_0x5cd479[_0xa4a6('0x1b')],_0x15c9bf);_0x252805(_0x1a5919[_0xa4a6('0x1a')](0x1f4,_0x5cd479[_0xa4a6('0x1b')]));});});};exports[_0xa4a6('0x28')]=function(_0x494869,_0x5302ce,_0x27b48f){var _0x459b01=this;return new Promise(function(_0xd3d82,_0x1c6969){var _0x36dfd7={'body':_0x494869['body'],'channel':_0xa4a6('0x29')};var _0x5217fe=[];var _0x21d07e=[];var _0x344154={};return db[_0xa4a6('0x2a')]['describe']()['then'](function(_0x47cff3){if(!_0x47cff3){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x2d'));}_0x5217fe=_['difference'](_[_0xa4a6('0x2e')](_0x47cff3),[_0xa4a6('0x2f'),_0xa4a6('0x30')]);_0x21d07e=_[_0xa4a6('0x31')](_[_0xa4a6('0x2e')](_0x47cff3),[_0xa4a6('0x2f'),_0xa4a6('0x30'),_0xa4a6('0x32'),'ListId']);if(_0x494869[_0xa4a6('0x33')]['id']){delete _0x494869['body']['id'];}if(_[_0xa4a6('0x34')](_0x494869[_0xa4a6('0x33')][_0xa4a6('0x35')])){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x36'));}if(_['isNil'](_0x494869[_0xa4a6('0x33')][_0xa4a6('0x33')])||_0x494869[_0xa4a6('0x33')][_0xa4a6('0x33')]===''){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x37'));}if(_[_0xa4a6('0x34')](_0x494869['body']['mapKey'])){throw new db['Sequelize'][(_0xa4a6('0x2c'))](_0xa4a6('0x38')+_0x21d07e);}if(!_['includes'](_0x21d07e,_0x494869[_0xa4a6('0x33')][_0xa4a6('0x39')])){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x3a')+_0x21d07e);}_0x344154[_0x494869[_0xa4a6('0x33')][_0xa4a6('0x39')]]=_0x494869[_0xa4a6('0x33')][_0xa4a6('0x35')];})[_0xa4a6('0x27')](function(){return db[_0xa4a6('0x1f')][_0xa4a6('0x3b')]({'where':{'id':_0x494869[_0xa4a6('0x3c')]['id']},'include':[{'model':db[_0xa4a6('0x3d')],'as':_0xa4a6('0x3e'),'include':[{'model':db[_0xa4a6('0x2a')],'as':_0xa4a6('0x3f'),'where':_0x344154,'limit':0x1,'order':[[_0xa4a6('0x30'),_0xa4a6('0x40')]]}]},{'model':db[_0xa4a6('0x41')],'as':'Applications'}]});})[_0xa4a6('0x27')](function(_0x5e63d5){if(_0x5e63d5&&_0x5e63d5['List']){var _0x46c035=_0x5e63d5['get']({'plain':!![]});_0x36dfd7['account']=_0x46c035;_0x36dfd7[_0xa4a6('0x42')]=_0x46c035[_0xa4a6('0x43')];_0x36dfd7[_0xa4a6('0x44')]=_0x46c035[_0xa4a6('0x3e')];_0x36dfd7[_0xa4a6('0x42')]=_[_0xa4a6('0x45')](_0x36dfd7[_0xa4a6('0x42')],[_0xa4a6('0x46')],[_0xa4a6('0x47')]);if(_0x36dfd7[_0xa4a6('0x3c')]['Applications']){delete _0x36dfd7['account']['Applications'];}if(_0x36dfd7[_0xa4a6('0x3c')]['List']&&_0x36dfd7[_0xa4a6('0x3c')]['List']['Contacts'][_0xa4a6('0x48')]){return _0x36dfd7['account']['List'][_0xa4a6('0x3f')][0x0];}var _0x189aa3=_[_0xa4a6('0xf')](_0x494869[_0xa4a6('0x33')],{'firstName':_0x494869['body'][_0xa4a6('0x35')],'ListId':_0x46c035[_0xa4a6('0x49')]});_0x189aa3[_0x494869[_0xa4a6('0x33')][_0xa4a6('0x39')]]=_0x494869[_0xa4a6('0x33')][_0xa4a6('0x35')];return db[_0xa4a6('0x2a')][_0xa4a6('0x4a')](_0x189aa3,{'fields':_0x5217fe,'raw':!![]});}})[_0xa4a6('0x27')](function(_0x3754c2){_0x36dfd7[_0xa4a6('0x4b')]=_0x3754c2;if(_0x3754c2){var _0x5d755d={'ContactId':_0x3754c2['id'],'FaxAccountId':_0x494869[_0xa4a6('0x3c')]['id'],'fax':_0x3754c2[_0xa4a6('0x29')]};return db[_0xa4a6('0x4c')][_0xa4a6('0x3b')]({'where':{'ContactId':_0x3754c2['id'],'closed':![],'FaxAccountId':_0x494869[_0xa4a6('0x3c')]['id']}})['then'](function(_0x4ff385){if(_0x4ff385){return[_0x4ff385,![]];}return db[_0xa4a6('0x4c')][_0xa4a6('0x4a')](_0x5d755d)[_0xa4a6('0x27')](function(_0xc568e7){return[_0xc568e7,!![]];});});}else{throw new Error(_0xa4a6('0x4d'));}})[_0xa4a6('0x4e')](function(_0x1ea63b,_0x287a92){var _0x3a6a5d=_0x1ea63b[_0xa4a6('0x4f')]({'plain':!![]});if(_0x287a92){if(_0x36dfd7['account']['autoclose']){_0x36dfd7[_0xa4a6('0x42')][_0xa4a6('0x50')]({'id':0x0,'priority':_0x36dfd7[_0xa4a6('0x42')][_0xa4a6('0x48')]+0x1,'app':_0xa4a6('0x51'),'appdata':'unmanaged','interval':_0xa4a6('0x52')});}_0x3a6a5d[_0xa4a6('0x53')]=!![];}else{_0x3a6a5d[_0xa4a6('0x53')]=![];}_0x36dfd7[_0xa4a6('0x54')]=_0x3a6a5d;return db[_0xa4a6('0x55')]['create']({'body':_0x494869[_0xa4a6('0x33')][_0xa4a6('0x33')],'FaxAccountId':_0x494869[_0xa4a6('0x3c')]['id'],'FaxInteractionId':_0x1ea63b['id'],'direction':'in','ContactId':_0x1ea63b[_0xa4a6('0x56')],'AttachmentId':_0x494869[_0xa4a6('0x33')]['AttachmentId']});})[_0xa4a6('0x27')](function(_0x4fef9f){_0x36dfd7[_0xa4a6('0x1b')]=_0x4fef9f;if(_0x36dfd7['interaction']['UserId']){return db['User'][_0xa4a6('0x3b')]({'attributes':['id','name'],'where':{'id':_0x36dfd7['interaction']['UserId']}})[_0xa4a6('0x27')](function(_0x5cea6c){if(_0x5cea6c){_0x36dfd7[_0xa4a6('0x42')][_0xa4a6('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5cea6c[_0xa4a6('0x58')]+','+(_0x36dfd7['account'][_0xa4a6('0x59')]||0xa),'interval':_0xa4a6('0x52')});}return respondWithRpcPromise('Start',_0xa4a6('0x5a'),_0x36dfd7);});}return respondWithRpcPromise(_0xa4a6('0x5b'),_0xa4a6('0x5a'),_0x36dfd7);})[_0xa4a6('0x27')](function(_0x592d28){_0xd3d82(_0x592d28);})['catch'](function(_0x5efe40){_0x1c6969(_0x459b01['error'](0x1f4,_0x5efe40[_0xa4a6('0x1b')]));});});}; \ No newline at end of file +var _0x825f=['model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','orderBy','asc','Contacts','defaults','ListId','contact','FaxInteraction','create','Contact\x20not\x20found','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','debug','error','code','message','info','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','limit','map','include'];(function(_0x4f8ec5,_0x212462){var _0xfb7738=function(_0x366498){while(--_0x366498){_0x4f8ec5['push'](_0x4f8ec5['shift']());}};_0xfb7738(++_0x212462);}(_0x825f,0xe5));var _0xf825=function(_0x3c0ff0,_0x1ae2e9){_0x3c0ff0=_0x3c0ff0-0x0;var _0x342b46=_0x825f[_0x3c0ff0];return _0x342b46;};'use strict';var _=require(_0xf825('0x0'));var util=require(_0xf825('0x1'));var moment=require(_0xf825('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf825('0x3'));var db=require(_0xf825('0x4'))['db'];var utils=require(_0xf825('0x5'));var logger=require(_0xf825('0x6'))(_0xf825('0x7'));var config=require(_0xf825('0x8'));var jayson=require(_0xf825('0x9'));var client=jayson['client'][_0xf825('0xa')]({'port':0x232c});config[_0xf825('0xb')]=_['defaults'](config[_0xf825('0xb')],{'host':_0xf825('0xc'),'port':0x18eb});var socket=require(_0xf825('0xd'))(new Redis(config[_0xf825('0xb')]));require(_0xf825('0xe'))[_0xf825('0xf')](socket);function respondWithRpcPromise(_0x274dc3,_0x443185,_0x3be542){return new BPromise(function(_0xf90deb,_0x329ac3){return client[_0xf825('0x10')](_0x274dc3,_0x3be542)[_0xf825('0x11')](function(_0xd85ef){logger['info']('FaxAccount,\x20%s,\x20%s',_0x443185,_0xf825('0x12'));logger[_0xf825('0x13')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x443185,_0xf825('0x12'),JSON['stringify'](_0xd85ef));if(_0xd85ef[_0xf825('0x14')]){if(_0xd85ef['error'][_0xf825('0x15')]===0x1f4){logger[_0xf825('0x14')]('FaxAccount,\x20%s,\x20%s',_0x443185,_0xd85ef[_0xf825('0x14')][_0xf825('0x16')]);return _0x329ac3(_0xd85ef[_0xf825('0x14')][_0xf825('0x16')]);}logger[_0xf825('0x14')]('FaxAccount,\x20%s,\x20%s',_0x443185,_0xd85ef[_0xf825('0x14')]['message']);return _0xf90deb(_0xd85ef['error'][_0xf825('0x16')]);}else{logger[_0xf825('0x17')](_0xf825('0x18'),_0x443185,_0xf825('0x12'));_0xf90deb(_0xd85ef[_0xf825('0x19')][_0xf825('0x16')]);}})[_0xf825('0x1a')](function(_0x3fd43f){logger[_0xf825('0x14')](_0xf825('0x18'),_0x443185,_0x3fd43f);_0x329ac3(_0x3fd43f);});});}exports[_0xf825('0x1b')]=function(_0x2609e1){var _0x3adaa9=this;return new Promise(function(_0x3c562d,_0x54603a){return db[_0xf825('0x1c')][_0xf825('0x1d')]({'raw':_0x2609e1['options']?_0x2609e1[_0xf825('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2609e1[_0xf825('0x1e')]?_0x2609e1[_0xf825('0x1e')]['where']||null:null,'attributes':_0x2609e1['options']?_0x2609e1[_0xf825('0x1e')][_0xf825('0x1f')]||null:null,'limit':_0x2609e1[_0xf825('0x1e')]?_0x2609e1[_0xf825('0x1e')][_0xf825('0x20')]||null:null,'include':_0x2609e1[_0xf825('0x1e')]?_0x2609e1[_0xf825('0x1e')]['include']?_[_0xf825('0x21')](_0x2609e1[_0xf825('0x1e')][_0xf825('0x22')],function(_0x2cbf9f){return{'model':db[_0x2cbf9f[_0xf825('0x23')]],'as':_0x2cbf9f['as'],'attributes':_0x2cbf9f[_0xf825('0x1f')],'include':_0x2cbf9f[_0xf825('0x22')]?_[_0xf825('0x21')](_0x2cbf9f[_0xf825('0x22')],function(_0x553b2c){return{'model':db[_0x553b2c['model']],'as':_0x553b2c['as'],'attributes':_0x553b2c[_0xf825('0x1f')],'include':_0x553b2c[_0xf825('0x22')]?_['map'](_0x553b2c[_0xf825('0x22')],function(_0x2406e1){return{'model':db[_0x2406e1['model']],'as':_0x2406e1['as'],'attributes':_0x2406e1[_0xf825('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf825('0x11')](function(_0x231885){logger['info'](_0xf825('0x1b'),_0x2609e1);logger[_0xf825('0x13')]('GetFaxAccount',_0x2609e1,JSON['stringify'](_0x231885));_0x3c562d(_0x231885);})[_0xf825('0x1a')](function(_0x1609d5){logger['error'](_0xf825('0x1b'),_0x1609d5['message'],_0x2609e1);_0x54603a(_0x3adaa9[_0xf825('0x14')](0x1f4,_0x1609d5['message']));});});};exports[_0xf825('0x24')]=function(_0x48f207,_0x212012,_0x33ac53){var _0x207c64=this;return new Promise(function(_0x484a5a,_0x7c2f7e){var _0x3a67b2={'body':_0x48f207[_0xf825('0x25')],'channel':_0xf825('0x26')};var _0x35cd40=[];var _0x25b035=[];var _0x1ab047={};return db[_0xf825('0x27')][_0xf825('0x28')]()[_0xf825('0x11')](function(_0x1b3d61){if(!_0x1b3d61){throw new db[(_0xf825('0x29'))][(_0xf825('0x2a'))](_0xf825('0x2b'));}_0x35cd40=_[_0xf825('0x2c')](_[_0xf825('0x2d')](_0x1b3d61),[_0xf825('0x2e'),_0xf825('0x2f')]);_0x25b035=_[_0xf825('0x2c')](_[_0xf825('0x2d')](_0x1b3d61),['createdAt',_0xf825('0x2f'),_0xf825('0x30'),'ListId']);if(_0x48f207[_0xf825('0x25')]['id']){delete _0x48f207[_0xf825('0x25')]['id'];}if(_[_0xf825('0x31')](_0x48f207[_0xf825('0x25')]['from'])){throw new db['Sequelize']['ValidationError'](_0xf825('0x32'));}if(_[_0xf825('0x31')](_0x48f207[_0xf825('0x25')]['body'])||_0x48f207[_0xf825('0x25')]['body']===''){throw new db[(_0xf825('0x29'))]['ValidationError'](_0xf825('0x33'));}if(_['isNil'](_0x48f207['body']['mapKey'])){throw new db[(_0xf825('0x29'))][(_0xf825('0x2a'))](_0xf825('0x34')+_0x25b035);}if(!_[_0xf825('0x35')](_0x25b035,_0x48f207['body'][_0xf825('0x36')])){throw new db[(_0xf825('0x29'))][(_0xf825('0x2a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25b035);}_0x1ab047[_0x48f207[_0xf825('0x25')]['mapKey']]=_0x48f207[_0xf825('0x25')]['from'];})['then'](function(){return db[_0xf825('0x1c')][_0xf825('0x37')]({'where':{'id':_0x48f207[_0xf825('0x38')]['id']},'include':[{'model':db[_0xf825('0x39')],'as':_0xf825('0x3a'),'include':[{'model':db[_0xf825('0x27')],'as':'Contacts','where':_0x1ab047,'limit':0x1,'order':[[_0xf825('0x2f'),_0xf825('0x3b')]]}]},{'model':db[_0xf825('0x3c')],'as':_0xf825('0x3d')}]});})['then'](function(_0x1f2019){if(_0x1f2019&&_0x1f2019[_0xf825('0x3a')]){var _0x189557=_0x1f2019[_0xf825('0x3e')]({'plain':!![]});_0x3a67b2[_0xf825('0x38')]=_0x189557;_0x3a67b2[_0xf825('0x3f')]=_0x189557[_0xf825('0x3d')];_0x3a67b2[_0xf825('0x40')]=_0x189557[_0xf825('0x3a')];_0x3a67b2[_0xf825('0x3f')]=_[_0xf825('0x41')](_0x3a67b2[_0xf825('0x3f')],['priority'],[_0xf825('0x42')]);if(_0x3a67b2[_0xf825('0x38')]['Applications']){delete _0x3a67b2['account'][_0xf825('0x3d')];}if(_0x3a67b2[_0xf825('0x38')][_0xf825('0x3a')]&&_0x3a67b2[_0xf825('0x38')][_0xf825('0x3a')]['Contacts']['length']){return _0x3a67b2['account'][_0xf825('0x3a')][_0xf825('0x43')][0x0];}var _0x3d5654=_[_0xf825('0x44')](_0x48f207['body'],{'firstName':_0x48f207[_0xf825('0x25')]['from'],'ListId':_0x189557[_0xf825('0x45')]});_0x3d5654[_0x48f207[_0xf825('0x25')]['mapKey']]=_0x48f207[_0xf825('0x25')]['from'];return db[_0xf825('0x27')]['create'](_0x3d5654,{'fields':_0x35cd40,'raw':!![]});}})[_0xf825('0x11')](function(_0x68a6d5){_0x3a67b2[_0xf825('0x46')]=_0x68a6d5;if(_0x68a6d5){var _0x20dff1={'ContactId':_0x68a6d5['id'],'FaxAccountId':_0x48f207[_0xf825('0x38')]['id'],'fax':_0x68a6d5[_0xf825('0x26')]};return db[_0xf825('0x47')][_0xf825('0x37')]({'where':{'ContactId':_0x68a6d5['id'],'closed':![],'FaxAccountId':_0x48f207[_0xf825('0x38')]['id']}})['then'](function(_0x13dd8d){if(_0x13dd8d){return[_0x13dd8d,![]];}return db[_0xf825('0x47')][_0xf825('0x48')](_0x20dff1)[_0xf825('0x11')](function(_0x141e35){return[_0x141e35,!![]];});});}else{throw new Error(_0xf825('0x49'));}})['spread'](function(_0x4e9566,_0xb6a3c){var _0x20fc55=_0x4e9566[_0xf825('0x3e')]({'plain':!![]});if(_0xb6a3c){if(_0x3a67b2['account']['autoclose']){_0x3a67b2[_0xf825('0x3f')][_0xf825('0x4a')]({'id':0x0,'priority':_0x3a67b2[_0xf825('0x3f')][_0xf825('0x4b')]+0x1,'app':_0xf825('0x4c'),'appdata':_0xf825('0x4d'),'interval':_0xf825('0x4e')});}_0x20fc55[_0xf825('0x4f')]=!![];}else{_0x20fc55[_0xf825('0x4f')]=![];}_0x3a67b2[_0xf825('0x50')]=_0x20fc55;return db[_0xf825('0x51')][_0xf825('0x48')]({'body':_0x48f207[_0xf825('0x25')][_0xf825('0x25')],'FaxAccountId':_0x48f207['account']['id'],'FaxInteractionId':_0x4e9566['id'],'direction':'in','ContactId':_0x4e9566[_0xf825('0x52')],'AttachmentId':_0x48f207[_0xf825('0x25')][_0xf825('0x53')]});})[_0xf825('0x11')](function(_0x1091cb){_0x3a67b2['message']=_0x1091cb;if(_0x3a67b2[_0xf825('0x50')][_0xf825('0x54')]){return db[_0xf825('0x55')][_0xf825('0x37')]({'attributes':['id',_0xf825('0x56')],'where':{'id':_0x3a67b2[_0xf825('0x50')][_0xf825('0x54')]}})[_0xf825('0x11')](function(_0x5dc0f3){if(_0x5dc0f3){_0x3a67b2[_0xf825('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5dc0f3['name']+','+(_0x3a67b2['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xf825('0x57'),_0x3a67b2);});}return respondWithRpcPromise('Start',_0xf825('0x57'),_0x3a67b2);})[_0xf825('0x11')](function(_0x92dadd){_0x484a5a(_0x92dadd);})[_0xf825('0x1a')](function(_0x2ea71a){_0x7c2f7e(_0x207c64[_0xf825('0x14')](0x1f4,_0x2ea71a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index fe30f3d..1cc6817 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 _0x1695=['removeListener','register','length','faxAccount:','./faxAccount.events','remove','update'];(function(_0xe924a5,_0x1bf7f2){var _0x5e464f=function(_0x4fbeb5){while(--_0x4fbeb5){_0xe924a5['push'](_0xe924a5['shift']());}};_0x5e464f(++_0x1bf7f2);}(_0x1695,0xac));var _0x5169=function(_0x4c2f7d,_0x13bded){_0x4c2f7d=_0x4c2f7d-0x0;var _0x1d20fc=_0x1695[_0x4c2f7d];return _0x1d20fc;};'use strict';var FaxAccountEvents=require(_0x5169('0x0'));var events=['save',_0x5169('0x1'),_0x5169('0x2')];function createListener(_0x505221,_0x5ddf7a){return function(_0x572df0){_0x5ddf7a['emit'](_0x505221,_0x572df0);};}function removeListener(_0xc04684,_0x2cc0bc){return function(){FaxAccountEvents[_0x5169('0x3')](_0xc04684,_0x2cc0bc);};}exports[_0x5169('0x4')]=function(_0x470f6c){for(var _0x6f04e2=0x0,_0x2423f1=events[_0x5169('0x5')];_0x6f04e2<_0x2423f1;_0x6f04e2++){var _0x182abd=events[_0x6f04e2];var _0x44c446=createListener(_0x5169('0x6')+_0x182abd,_0x470f6c);FaxAccountEvents['on'](_0x182abd,_0x44c446);}}; \ No newline at end of file +var _0x6b0c=['emit','removeListener','length','./faxAccount.events','save','remove','update'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x6b0c,0x153));var _0xc6b0=function(_0x3bb026,_0x5ba1aa){_0x3bb026=_0x3bb026-0x0;var _0x4708fd=_0x6b0c[_0x3bb026];return _0x4708fd;};'use strict';var FaxAccountEvents=require(_0xc6b0('0x0'));var events=[_0xc6b0('0x1'),_0xc6b0('0x2'),_0xc6b0('0x3')];function createListener(_0x2cab1c,_0x1c1c2d){return function(_0x5f2791){_0x1c1c2d[_0xc6b0('0x4')](_0x2cab1c,_0x5f2791);};}function removeListener(_0x315fce,_0x381f84){return function(){FaxAccountEvents[_0xc6b0('0x5')](_0x315fce,_0x381f84);};}exports['register']=function(_0xaaf127){for(var _0x2dbe97=0x0,_0x527db1=events[_0xc6b0('0x6')];_0x2dbe97<_0x527db1;_0x2dbe97++){var _0x2012bc=events[_0x2dbe97];var _0x80d95f=createListener('faxAccount:'+_0x2012bc,_0xaaf127);FaxAccountEvents['on'](_0x2012bc,_0x80d95f);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index ec7d0b4..858600b 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(_0x360206,_0x7c26ef){var _0x48eaad=function(_0x8bbd62){while(--_0x8bbd62){_0x360206['push'](_0x360206['shift']());}};_0x48eaad(++_0x7c26ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x12fc29,_0x3fcbd6){var _0x59076c=function(_0x488e58){while(--_0x488e58){_0x12fc29['push'](_0x12fc29['shift']());}};_0x59076c(++_0x3fcbd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 7cb6041..ff3b984 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 _0x9845=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9845,0x15a));var _0x5984=function(_0x2815d5,_0x3530be){_0x2815d5=_0x2815d5-0x0;var _0x2969bc=_0x9845[_0x2815d5];return _0x2969bc;};'use strict';var Sequelize=require(_0x5984('0x0'));module[_0x5984('0x1')]={'priority':{'type':Sequelize[_0x5984('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5984('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5984('0x4')]()},'description':{'type':Sequelize[_0x5984('0x3')]},'interval':{'type':Sequelize[_0x5984('0x3')],'defaultValue':_0x5984('0x5')}}; \ No newline at end of file +var _0x6337=['INTEGER','noop','STRING','exports'];(function(_0xcffcbe,_0x143d81){var _0x447d0d=function(_0x5753c2){while(--_0x5753c2){_0xcffcbe['push'](_0xcffcbe['shift']());}};_0x447d0d(++_0x143d81);}(_0x6337,0x143));var _0x7633=function(_0xd99608,_0x19d8cc){_0xd99608=_0xd99608-0x0;var _0x487e29=_0x6337[_0xd99608];return _0x487e29;};'use strict';var Sequelize=require('sequelize');module[_0x7633('0x0')]={'priority':{'type':Sequelize[_0x7633('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7633('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7633('0x3')]},'interval':{'type':Sequelize[_0x7633('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c4eeed1..6f826e1 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 _0x8ab0=['find','params','destroy','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','order','merge','VIRTUAL','options','where','includeAll','findAll','catch','show','include','create','body'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x8ab0,0xc6));var _0x08ab=function(_0x442bd4,_0x4b51a9){_0x442bd4=_0x442bd4-0x0;var _0x36822e=_0x8ab0[_0x442bd4];return _0x36822e;};'use strict';var emlformat=require(_0x08ab('0x0'));var rimraf=require(_0x08ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x08ab('0x2'));var moment=require(_0x08ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x08ab('0x4'));var util=require(_0x08ab('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x08ab('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x08ab('0x7'));var crypto=require(_0x08ab('0x8'));var jsforce=require(_0x08ab('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08ab('0xa'));var Papa=require('papaparse');var Redis=require(_0x08ab('0xb'));var authService=require(_0x08ab('0xc'));var qs=require(_0x08ab('0xd'));var as=require(_0x08ab('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08ab('0xf'));var utils=require('../../config/utils');var config=require(_0x08ab('0x10'));var licenseUtil=require(_0x08ab('0x11'));var db=require(_0x08ab('0x12'))['db'];function respondWithStatusCode(_0x41dccc,_0x3c4171){_0x3c4171=_0x3c4171||0xcc;return function(_0x5265f1){if(_0x5265f1){return _0x41dccc[_0x08ab('0x13')](_0x3c4171);}return _0x41dccc[_0x08ab('0x14')](_0x3c4171)[_0x08ab('0x15')]();};}function respondWithResult(_0x2c8235,_0x205abc){_0x205abc=_0x205abc||0xc8;return function(_0x99d68d){if(_0x99d68d){return _0x2c8235[_0x08ab('0x14')](_0x205abc)[_0x08ab('0x16')](_0x99d68d);}};}function respondWithFilteredResult(_0x587fed,_0x93c53c){return function(_0x170ef7){if(_0x170ef7){var _0x4335aa=typeof _0x93c53c['offset']===_0x08ab('0x17')&&typeof _0x93c53c['limit']===_0x08ab('0x17');var _0xee9db6=_0x170ef7[_0x08ab('0x18')];var _0x377203=_0x4335aa?0x0:_0x93c53c[_0x08ab('0x19')];var _0x435c6e=_0x4335aa?_0x170ef7[_0x08ab('0x18')]:_0x93c53c[_0x08ab('0x19')]+_0x93c53c[_0x08ab('0x1a')];var _0x54de95;if(_0x435c6e>=_0xee9db6){_0x435c6e=_0xee9db6;_0x54de95=0xc8;}else{_0x54de95=0xce;}_0x587fed[_0x08ab('0x14')](_0x54de95);return _0x587fed[_0x08ab('0x1b')](_0x08ab('0x1c'),_0x377203+'-'+_0x435c6e+'/'+_0xee9db6)['json'](_0x170ef7);}return null;};}function patchUpdates(_0x2bf3a8){return function(_0xed999e){try{jsonpatch[_0x08ab('0x1d')](_0xed999e,_0x2bf3a8,!![]);}catch(_0x244208){return BPromise['reject'](_0x244208);}return _0xed999e['save']();};}function saveUpdates(_0x202daa,_0x409b8e){return function(_0x5ae99e){if(_0x5ae99e){return _0x5ae99e[_0x08ab('0x1e')](_0x202daa)[_0x08ab('0x1f')](function(_0x290900){return _0x290900;});}return null;};}function removeEntity(_0x153bed,_0x3591e2){return function(_0xd3e9f9){if(_0xd3e9f9){return _0xd3e9f9['destroy']()[_0x08ab('0x1f')](function(){_0x153bed[_0x08ab('0x14')](0xcc)[_0x08ab('0x15')]();});}};}function handleEntityNotFound(_0x428aaf,_0xc7aff5){return function(_0x44059c){if(!_0x44059c){_0x428aaf[_0x08ab('0x13')](0x194);}return _0x44059c;};}function handleError(_0x2ad948,_0x595b45){_0x595b45=_0x595b45||0x1f4;return function(_0x10a06c){logger[_0x08ab('0x20')](_0x10a06c[_0x08ab('0x21')]);if(_0x10a06c[_0x08ab('0x22')]){delete _0x10a06c['name'];}_0x2ad948[_0x08ab('0x14')](_0x595b45)[_0x08ab('0x23')](_0x10a06c);};}exports[_0x08ab('0x24')]=function(_0x1660c5,_0x439108){var _0x2c1233={},_0x50835c={},_0x57e484={'count':0x0,'rows':[]};var _0x1c319c=_[_0x08ab('0x25')](db[_0x08ab('0x26')][_0x08ab('0x27')],function(_0x2c9010){return{'name':_0x2c9010[_0x08ab('0x28')],'type':_0x2c9010[_0x08ab('0x29')]['key']};});_0x50835c[_0x08ab('0x2a')]=_[_0x08ab('0x25')](_0x1c319c,_0x08ab('0x22'));_0x50835c['query']=_[_0x08ab('0x2b')](_0x1660c5[_0x08ab('0x2c')]);_0x50835c[_0x08ab('0x2d')]=_[_0x08ab('0x2e')](_0x50835c[_0x08ab('0x2a')],_0x50835c[_0x08ab('0x2c')]);_0x2c1233['attributes']=_[_0x08ab('0x2e')](_0x50835c[_0x08ab('0x2a')],qs[_0x08ab('0x2f')](_0x1660c5[_0x08ab('0x2c')][_0x08ab('0x2f')]));_0x2c1233[_0x08ab('0x30')]=_0x2c1233['attributes'][_0x08ab('0x31')]?_0x2c1233[_0x08ab('0x30')]:_0x50835c['model'];if(!_0x1660c5['query']['hasOwnProperty']('nolimit')){_0x2c1233['limit']=qs[_0x08ab('0x1a')](_0x1660c5[_0x08ab('0x2c')][_0x08ab('0x1a')]);_0x2c1233['offset']=qs['offset'](_0x1660c5['query'][_0x08ab('0x19')]);}_0x2c1233[_0x08ab('0x32')]=qs['sort'](_0x1660c5['query']['sort']);_0x2c1233['where']=qs[_0x08ab('0x2d')](_['pick'](_0x1660c5['query'],_0x50835c[_0x08ab('0x2d')]),_0x1c319c);if(_0x1660c5[_0x08ab('0x2c')]['filter']){_0x2c1233['where']=_[_0x08ab('0x33')](_0x2c1233['where'],{'$or':_['map'](_0x1c319c,function(_0x46d8a2){if(_0x46d8a2[_0x08ab('0x29')]!==_0x08ab('0x34')){var _0x53537a={};_0x53537a[_0x46d8a2[_0x08ab('0x22')]]={'$like':'%'+_0x1660c5[_0x08ab('0x2c')]['filter']+'%'};return _0x53537a;}})});}_0x2c1233=_[_0x08ab('0x33')]({},_0x2c1233,_0x1660c5[_0x08ab('0x35')]);var _0x23d386={'where':_0x2c1233[_0x08ab('0x36')]};return db[_0x08ab('0x26')][_0x08ab('0x18')](_0x23d386)['then'](function(_0x47722b){_0x57e484[_0x08ab('0x18')]=_0x47722b;if(_0x1660c5[_0x08ab('0x2c')][_0x08ab('0x37')]){_0x2c1233['include']=[{'all':!![]}];}return db[_0x08ab('0x26')][_0x08ab('0x38')](_0x2c1233);})['then'](function(_0x469ead){_0x57e484['rows']=_0x469ead;return _0x57e484;})[_0x08ab('0x1f')](respondWithFilteredResult(_0x439108,_0x2c1233))[_0x08ab('0x39')](handleError(_0x439108,null));};exports[_0x08ab('0x3a')]=function(_0x1b3b6c,_0x8c7334){var _0x52dbea={'raw':!![],'where':{'id':_0x1b3b6c['params']['id']}},_0x18a7dc={};_0x18a7dc[_0x08ab('0x2a')]=_['keys'](db[_0x08ab('0x26')][_0x08ab('0x27')]);_0x18a7dc[_0x08ab('0x2c')]=_[_0x08ab('0x2b')](_0x1b3b6c['query']);_0x18a7dc[_0x08ab('0x2d')]=_[_0x08ab('0x2e')](_0x18a7dc['model'],_0x18a7dc[_0x08ab('0x2c')]);_0x52dbea['attributes']=_[_0x08ab('0x2e')](_0x18a7dc[_0x08ab('0x2a')],qs[_0x08ab('0x2f')](_0x1b3b6c[_0x08ab('0x2c')][_0x08ab('0x2f')]));_0x52dbea[_0x08ab('0x30')]=_0x52dbea[_0x08ab('0x30')][_0x08ab('0x31')]?_0x52dbea[_0x08ab('0x30')]:_0x18a7dc['model'];if(_0x1b3b6c[_0x08ab('0x2c')][_0x08ab('0x37')]){_0x52dbea[_0x08ab('0x3b')]=[{'all':!![]}];}_0x52dbea=_[_0x08ab('0x33')]({},_0x52dbea,_0x1b3b6c[_0x08ab('0x35')]);return db['FaxApplication']['find'](_0x52dbea)[_0x08ab('0x1f')](handleEntityNotFound(_0x8c7334,null))['then'](respondWithResult(_0x8c7334,null))[_0x08ab('0x39')](handleError(_0x8c7334,null));};exports[_0x08ab('0x3c')]=function(_0x31fe8b,_0x11a5dd){return db['FaxApplication'][_0x08ab('0x3c')](_0x31fe8b['body'],{})[_0x08ab('0x1f')](respondWithResult(_0x11a5dd,0xc9))[_0x08ab('0x39')](handleError(_0x11a5dd,null));};exports[_0x08ab('0x1e')]=function(_0x27360c,_0x16b27e){if(_0x27360c[_0x08ab('0x3d')]['id']){delete _0x27360c[_0x08ab('0x3d')]['id'];}return db[_0x08ab('0x26')][_0x08ab('0x3e')]({'where':{'id':_0x27360c[_0x08ab('0x3f')]['id']}})['then'](handleEntityNotFound(_0x16b27e,null))[_0x08ab('0x1f')](saveUpdates(_0x27360c['body'],null))[_0x08ab('0x1f')](respondWithResult(_0x16b27e,null))[_0x08ab('0x39')](handleError(_0x16b27e,null));};exports[_0x08ab('0x40')]=function(_0x18806d,_0x28ad38){return db[_0x08ab('0x26')][_0x08ab('0x3e')]({'where':{'id':_0x18806d['params']['id']}})[_0x08ab('0x1f')](handleEntityNotFound(_0x28ad38,null))[_0x08ab('0x1f')](removeEntity(_0x28ad38,null))[_0x08ab('0x39')](handleError(_0x28ad38,null));}; \ No newline at end of file +var _0x88a8=['reject','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','FaxApplication','include','catch','show','params','length','includeAll','options','create','body','update','find','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x88a8,0xc0));var _0x888a=function(_0x592966,_0x480d71){_0x592966=_0x592966-0x0;var _0x10bb86=_0x88a8[_0x592966];return _0x10bb86;};'use strict';var emlformat=require(_0x888a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x888a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x888a('0x2'));var moment=require('moment');var BPromise=require(_0x888a('0x3'));var Mustache=require(_0x888a('0x4'));var util=require(_0x888a('0x5'));var path=require(_0x888a('0x6'));var sox=require(_0x888a('0x7'));var csv=require('to-csv');var ejs=require(_0x888a('0x8'));var fs=require('fs');var fs_extra=require(_0x888a('0x9'));var _=require('lodash');var squel=require(_0x888a('0xa'));var crypto=require(_0x888a('0xb'));var jsforce=require(_0x888a('0xc'));var deskjs=require(_0x888a('0xd'));var toCsv=require(_0x888a('0xe'));var querystring=require(_0x888a('0xf'));var Papa=require('papaparse');var Redis=require(_0x888a('0x10'));var authService=require(_0x888a('0x11'));var qs=require(_0x888a('0x12'));var as=require(_0x888a('0x13'));var hardwareService=require(_0x888a('0x14'));var logger=require('../../config/logger')(_0x888a('0x15'));var utils=require(_0x888a('0x16'));var config=require(_0x888a('0x17'));var licenseUtil=require(_0x888a('0x18'));var db=require(_0x888a('0x19'))['db'];function respondWithStatusCode(_0x129a9a,_0xeb0c2f){_0xeb0c2f=_0xeb0c2f||0xcc;return function(_0x6fd068){if(_0x6fd068){return _0x129a9a['sendStatus'](_0xeb0c2f);}return _0x129a9a[_0x888a('0x1a')](_0xeb0c2f)[_0x888a('0x1b')]();};}function respondWithResult(_0x598f1d,_0x40522b){_0x40522b=_0x40522b||0xc8;return function(_0x27d42b){if(_0x27d42b){return _0x598f1d[_0x888a('0x1a')](_0x40522b)[_0x888a('0x1c')](_0x27d42b);}};}function respondWithFilteredResult(_0x2ca3b3,_0x2208d9){return function(_0x130dbe){if(_0x130dbe){var _0x4917c3=typeof _0x2208d9[_0x888a('0x1d')]===_0x888a('0x1e')&&typeof _0x2208d9['limit']===_0x888a('0x1e');var _0x535cd4=_0x130dbe[_0x888a('0x1f')];var _0x4ac56a=_0x4917c3?0x0:_0x2208d9[_0x888a('0x1d')];var _0x127c50=_0x4917c3?_0x130dbe['count']:_0x2208d9[_0x888a('0x1d')]+_0x2208d9[_0x888a('0x20')];var _0x24848a;if(_0x127c50>=_0x535cd4){_0x127c50=_0x535cd4;_0x24848a=0xc8;}else{_0x24848a=0xce;}_0x2ca3b3['status'](_0x24848a);return _0x2ca3b3[_0x888a('0x21')](_0x888a('0x22'),_0x4ac56a+'-'+_0x127c50+'/'+_0x535cd4)[_0x888a('0x1c')](_0x130dbe);}return null;};}function patchUpdates(_0x4d45ba){return function(_0x2349fe){try{jsonpatch[_0x888a('0x23')](_0x2349fe,_0x4d45ba,!![]);}catch(_0x577956){return BPromise[_0x888a('0x24')](_0x577956);}return _0x2349fe['save']();};}function saveUpdates(_0x2fd31a,_0x25b25e){return function(_0xd515f1){if(_0xd515f1){return _0xd515f1['update'](_0x2fd31a)['then'](function(_0x20efb5){return _0x20efb5;});}return null;};}function removeEntity(_0x3a582d,_0x6497c1){return function(_0x28e41f){if(_0x28e41f){return _0x28e41f[_0x888a('0x25')]()[_0x888a('0x26')](function(){_0x3a582d[_0x888a('0x1a')](0xcc)[_0x888a('0x1b')]();});}};}function handleEntityNotFound(_0x42bd8e,_0x3171b8){return function(_0x1e3fa1){if(!_0x1e3fa1){_0x42bd8e[_0x888a('0x27')](0x194);}return _0x1e3fa1;};}function handleError(_0x314ebe,_0x25a33a){_0x25a33a=_0x25a33a||0x1f4;return function(_0x23c403){logger[_0x888a('0x28')](_0x23c403[_0x888a('0x29')]);if(_0x23c403[_0x888a('0x2a')]){delete _0x23c403[_0x888a('0x2a')];}_0x314ebe['status'](_0x25a33a)[_0x888a('0x2b')](_0x23c403);};}exports[_0x888a('0x2c')]=function(_0x3d59e2,_0x4fe260){var _0x52024b={},_0x136c9b={},_0x1eca31={'count':0x0,'rows':[]};var _0x5143d8=_[_0x888a('0x2d')](db['FaxApplication'][_0x888a('0x2e')],function(_0x2507eb){return{'name':_0x2507eb[_0x888a('0x2f')],'type':_0x2507eb['type'][_0x888a('0x30')]};});_0x136c9b[_0x888a('0x31')]=_['map'](_0x5143d8,_0x888a('0x2a'));_0x136c9b['query']=_[_0x888a('0x32')](_0x3d59e2[_0x888a('0x33')]);_0x136c9b[_0x888a('0x34')]=_[_0x888a('0x35')](_0x136c9b[_0x888a('0x31')],_0x136c9b[_0x888a('0x33')]);_0x52024b[_0x888a('0x36')]=_[_0x888a('0x35')](_0x136c9b[_0x888a('0x31')],qs[_0x888a('0x37')](_0x3d59e2[_0x888a('0x33')]['fields']));_0x52024b['attributes']=_0x52024b[_0x888a('0x36')]['length']?_0x52024b['attributes']:_0x136c9b[_0x888a('0x31')];if(!_0x3d59e2[_0x888a('0x33')]['hasOwnProperty'](_0x888a('0x38'))){_0x52024b[_0x888a('0x20')]=qs['limit'](_0x3d59e2[_0x888a('0x33')][_0x888a('0x20')]);_0x52024b['offset']=qs[_0x888a('0x1d')](_0x3d59e2[_0x888a('0x33')][_0x888a('0x1d')]);}_0x52024b['order']=qs[_0x888a('0x39')](_0x3d59e2[_0x888a('0x33')][_0x888a('0x39')]);_0x52024b['where']=qs[_0x888a('0x34')](_[_0x888a('0x3a')](_0x3d59e2[_0x888a('0x33')],_0x136c9b[_0x888a('0x34')]),_0x5143d8);if(_0x3d59e2[_0x888a('0x33')][_0x888a('0x3b')]){_0x52024b[_0x888a('0x3c')]=_['merge'](_0x52024b[_0x888a('0x3c')],{'$or':_[_0x888a('0x2d')](_0x5143d8,function(_0x425c37){if(_0x425c37[_0x888a('0x3d')]!==_0x888a('0x3e')){var _0x4b8377={};_0x4b8377[_0x425c37[_0x888a('0x2a')]]={'$like':'%'+_0x3d59e2[_0x888a('0x33')][_0x888a('0x3b')]+'%'};return _0x4b8377;}})});}_0x52024b=_[_0x888a('0x3f')]({},_0x52024b,_0x3d59e2['options']);var _0x5682e8={'where':_0x52024b[_0x888a('0x3c')]};return db[_0x888a('0x40')][_0x888a('0x1f')](_0x5682e8)[_0x888a('0x26')](function(_0x3fb75e){_0x1eca31[_0x888a('0x1f')]=_0x3fb75e;if(_0x3d59e2[_0x888a('0x33')]['includeAll']){_0x52024b[_0x888a('0x41')]=[{'all':!![]}];}return db[_0x888a('0x40')]['findAll'](_0x52024b);})[_0x888a('0x26')](function(_0xc73a5b){_0x1eca31['rows']=_0xc73a5b;return _0x1eca31;})[_0x888a('0x26')](respondWithFilteredResult(_0x4fe260,_0x52024b))[_0x888a('0x42')](handleError(_0x4fe260,null));};exports[_0x888a('0x43')]=function(_0x7792e,_0x917933){var _0x19c6fc={'raw':!![],'where':{'id':_0x7792e[_0x888a('0x44')]['id']}},_0x44d64a={};_0x44d64a[_0x888a('0x31')]=_[_0x888a('0x32')](db[_0x888a('0x40')][_0x888a('0x2e')]);_0x44d64a[_0x888a('0x33')]=_[_0x888a('0x32')](_0x7792e[_0x888a('0x33')]);_0x44d64a['filters']=_[_0x888a('0x35')](_0x44d64a[_0x888a('0x31')],_0x44d64a['query']);_0x19c6fc['attributes']=_[_0x888a('0x35')](_0x44d64a[_0x888a('0x31')],qs[_0x888a('0x37')](_0x7792e[_0x888a('0x33')][_0x888a('0x37')]));_0x19c6fc[_0x888a('0x36')]=_0x19c6fc[_0x888a('0x36')][_0x888a('0x45')]?_0x19c6fc[_0x888a('0x36')]:_0x44d64a['model'];if(_0x7792e[_0x888a('0x33')][_0x888a('0x46')]){_0x19c6fc['include']=[{'all':!![]}];}_0x19c6fc=_[_0x888a('0x3f')]({},_0x19c6fc,_0x7792e[_0x888a('0x47')]);return db[_0x888a('0x40')]['find'](_0x19c6fc)[_0x888a('0x26')](handleEntityNotFound(_0x917933,null))[_0x888a('0x26')](respondWithResult(_0x917933,null))[_0x888a('0x42')](handleError(_0x917933,null));};exports[_0x888a('0x48')]=function(_0x1d79db,_0x48fdfd){return db['FaxApplication'][_0x888a('0x48')](_0x1d79db[_0x888a('0x49')],{})[_0x888a('0x26')](respondWithResult(_0x48fdfd,0xc9))[_0x888a('0x42')](handleError(_0x48fdfd,null));};exports[_0x888a('0x4a')]=function(_0x20e74d,_0x4590b9){if(_0x20e74d['body']['id']){delete _0x20e74d[_0x888a('0x49')]['id'];}return db['FaxApplication'][_0x888a('0x4b')]({'where':{'id':_0x20e74d[_0x888a('0x44')]['id']}})['then'](handleEntityNotFound(_0x4590b9,null))[_0x888a('0x26')](saveUpdates(_0x20e74d['body'],null))['then'](respondWithResult(_0x4590b9,null))[_0x888a('0x42')](handleError(_0x4590b9,null));};exports['destroy']=function(_0x5770d5,_0x2f076c){return db[_0x888a('0x40')]['find']({'where':{'id':_0x5770d5['params']['id']}})[_0x888a('0x26')](handleEntityNotFound(_0x2f076c,null))[_0x888a('0x26')](removeEntity(_0x2f076c,null))[_0x888a('0x42')](handleError(_0x2f076c,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4f24728..7203022 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 _0xa9ab=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment','./faxApplication.attributes','exports'];(function(_0x4b0104,_0x308249){var _0x32df6e=function(_0x364a08){while(--_0x364a08){_0x4b0104['push'](_0x4b0104['shift']());}};_0x32df6e(++_0x308249);}(_0xa9ab,0x157));var _0xba9a=function(_0x3ddf88,_0x4cff2e){_0x3ddf88=_0x3ddf88-0x0;var _0x4649e3=_0xa9ab[_0x3ddf88];return _0x4649e3;};'use strict';var _=require(_0xba9a('0x0'));var util=require(_0xba9a('0x1'));var logger=require(_0xba9a('0x2'))('api');var moment=require(_0xba9a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba9a('0x4'));var rimraf=require('rimraf');var config=require(_0xba9a('0x5'));var attributes=require(_0xba9a('0x6'));module[_0xba9a('0x7')]=function(_0x1bc97f,_0xc76e37){return _0x1bc97f[_0xba9a('0x8')](_0xba9a('0x9'),attributes,{'tableName':_0xba9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba9a('0xb'),'collate':_0xba9a('0xc')});}; \ No newline at end of file +var _0xf1ab=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4c9bee,_0x5400fc){var _0x443ad3=function(_0x1755fc){while(--_0x1755fc){_0x4c9bee['push'](_0x4c9bee['shift']());}};_0x443ad3(++_0x5400fc);}(_0xf1ab,0xdf));var _0xbf1a=function(_0x456b74,_0x5a9cc3){_0x456b74=_0x456b74-0x0;var _0x2104e2=_0xf1ab[_0x456b74];return _0x2104e2;};'use strict';var _=require(_0xbf1a('0x0'));var util=require(_0xbf1a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf1a('0x2'));var BPromise=require(_0xbf1a('0x3'));var rp=require(_0xbf1a('0x4'));var fs=require('fs');var path=require(_0xbf1a('0x5'));var rimraf=require(_0xbf1a('0x6'));var config=require(_0xbf1a('0x7'));var attributes=require(_0xbf1a('0x8'));module['exports']=function(_0x35b54b,_0xc2e107){return _0x35b54b[_0xbf1a('0x9')](_0xbf1a('0xa'),attributes,{'tableName':_0xbf1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf1a('0xc'),'collate':_0xbf1a('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index acbd5c4..df8a8b2 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 _0x28fa=['jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x434ec1,_0x16624f){var _0x2b6848=function(_0x53cbd5){while(--_0x53cbd5){_0x434ec1['push'](_0x434ec1['shift']());}};_0x2b6848(++_0x16624f);}(_0x28fa,0x12e));var _0xa28f=function(_0x1e12f1,_0x1ac9e6){_0x1e12f1=_0x1e12f1-0x0;var _0x1f8237=_0x28fa[_0x1e12f1];return _0x1f8237;};'use strict';var _=require(_0xa28f('0x0'));var util=require(_0xa28f('0x1'));var moment=require('moment');var BPromise=require(_0xa28f('0x2'));var rs=require(_0xa28f('0x3'));var fs=require('fs');var Redis=require(_0xa28f('0x4'));var db=require(_0xa28f('0x5'))['db'];var utils=require(_0xa28f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa28f('0x7'));var jayson=require(_0xa28f('0x8'));var client=jayson[_0xa28f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd24a,_0x49730c,_0x40dbc7){return new BPromise(function(_0x1e2189,_0x2290a2){return client[_0xa28f('0xa')](_0x2cd24a,_0x40dbc7)[_0xa28f('0xb')](function(_0x433e3f){logger[_0xa28f('0xc')](_0xa28f('0xd'),_0x49730c,_0xa28f('0xe'));logger[_0xa28f('0xf')](_0xa28f('0x10'),_0x49730c,_0xa28f('0xe'),JSON[_0xa28f('0x11')](_0x433e3f));if(_0x433e3f[_0xa28f('0x12')]){if(_0x433e3f['error'][_0xa28f('0x13')]===0x1f4){logger[_0xa28f('0x12')](_0xa28f('0xd'),_0x49730c,_0x433e3f['error'][_0xa28f('0x14')]);return _0x2290a2(_0x433e3f[_0xa28f('0x12')][_0xa28f('0x14')]);}logger[_0xa28f('0x12')](_0xa28f('0xd'),_0x49730c,_0x433e3f[_0xa28f('0x12')][_0xa28f('0x14')]);return _0x1e2189(_0x433e3f[_0xa28f('0x12')]['message']);}else{logger[_0xa28f('0xc')](_0xa28f('0xd'),_0x49730c,_0xa28f('0xe'));_0x1e2189(_0x433e3f[_0xa28f('0x15')][_0xa28f('0x14')]);}})[_0xa28f('0x16')](function(_0x36ba66){logger[_0xa28f('0x12')]('FaxApplication,\x20%s,\x20%s',_0x49730c,_0x36ba66);_0x2290a2(_0x36ba66);});});}exports['UpdateFaxApplication']=function(_0x3bf5fd){var _0x4c6cf9=this;return new Promise(function(_0x1fac00,_0x2ff087){return db[_0xa28f('0x17')][_0xa28f('0x18')](_0x3bf5fd['body'],{'raw':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd['options'][_0xa28f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd['options'][_0xa28f('0x1b')]||null:null,'attributes':_0x3bf5fd['options']?_0x3bf5fd[_0xa28f('0x19')][_0xa28f('0x1c')]||null:null,'limit':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd[_0xa28f('0x19')][_0xa28f('0x1d')]||null:null})[_0xa28f('0xb')](function(_0x516037){logger[_0xa28f('0xc')](_0xa28f('0x1e'),_0x3bf5fd);logger[_0xa28f('0xf')](_0xa28f('0x1e'),_0x3bf5fd,JSON[_0xa28f('0x11')](_0x516037));_0x1fac00(_0x516037);})['catch'](function(_0x5ecd86){logger['error'](_0xa28f('0x1e'),_0x5ecd86[_0xa28f('0x14')],_0x3bf5fd);_0x2ff087(_0x4c6cf9[_0xa28f('0x12')](0x1f4,_0x5ecd86[_0xa28f('0x14')]));});});}; \ No newline at end of file +var _0x1976=['where','attributes','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxApplication','update','body','options','raw'];(function(_0x4e12df,_0x3a8588){var _0x5822c3=function(_0x445446){while(--_0x445446){_0x4e12df['push'](_0x4e12df['shift']());}};_0x5822c3(++_0x3a8588);}(_0x1976,0x1e3));var _0x6197=function(_0x1577ab,_0x56288b){_0x1577ab=_0x1577ab-0x0;var _0x27402a=_0x1976[_0x1577ab];return _0x27402a;};'use strict';var _=require('lodash');var util=require(_0x6197('0x0'));var moment=require('moment');var BPromise=require(_0x6197('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6197('0x2'));var db=require(_0x6197('0x3'))['db'];var utils=require(_0x6197('0x4'));var logger=require(_0x6197('0x5'))(_0x6197('0x6'));var config=require('../../config/environment');var jayson=require(_0x6197('0x7'));var client=jayson[_0x6197('0x8')][_0x6197('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c5c1,_0x15462b,_0x2fbcb3){return new BPromise(function(_0x196143,_0x46fe19){return client[_0x6197('0xa')](_0x19c5c1,_0x2fbcb3)[_0x6197('0xb')](function(_0x380a5d){logger[_0x6197('0xc')](_0x6197('0xd'),_0x15462b,_0x6197('0xe'));logger[_0x6197('0xf')](_0x6197('0x10'),_0x15462b,'request\x20sent',JSON[_0x6197('0x11')](_0x380a5d));if(_0x380a5d[_0x6197('0x12')]){if(_0x380a5d[_0x6197('0x12')]['code']===0x1f4){logger[_0x6197('0x12')](_0x6197('0xd'),_0x15462b,_0x380a5d['error'][_0x6197('0x13')]);return _0x46fe19(_0x380a5d[_0x6197('0x12')][_0x6197('0x13')]);}logger[_0x6197('0x12')](_0x6197('0xd'),_0x15462b,_0x380a5d[_0x6197('0x12')][_0x6197('0x13')]);return _0x196143(_0x380a5d[_0x6197('0x12')]['message']);}else{logger[_0x6197('0xc')](_0x6197('0xd'),_0x15462b,'request\x20sent');_0x196143(_0x380a5d[_0x6197('0x14')][_0x6197('0x13')]);}})[_0x6197('0x15')](function(_0x382abe){logger['error'](_0x6197('0xd'),_0x15462b,_0x382abe);_0x46fe19(_0x382abe);});});}exports[_0x6197('0x16')]=function(_0x143836){var _0x214049=this;return new Promise(function(_0x48024e,_0x24a557){return db['FaxApplication'][_0x6197('0x17')](_0x143836[_0x6197('0x18')],{'raw':_0x143836[_0x6197('0x19')]?_0x143836[_0x6197('0x19')][_0x6197('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x143836[_0x6197('0x19')]?_0x143836[_0x6197('0x19')][_0x6197('0x1b')]||null:null,'attributes':_0x143836[_0x6197('0x19')]?_0x143836[_0x6197('0x19')][_0x6197('0x1c')]||null:null,'limit':_0x143836[_0x6197('0x19')]?_0x143836['options'][_0x6197('0x1d')]||null:null})['then'](function(_0x43c582){logger['info'](_0x6197('0x16'),_0x143836);logger[_0x6197('0xf')](_0x6197('0x16'),_0x143836,JSON['stringify'](_0x43c582));_0x48024e(_0x43c582);})[_0x6197('0x15')](function(_0x5e779f){logger[_0x6197('0x12')](_0x6197('0x16'),_0x5e779f['message'],_0x143836);_0x24a557(_0x214049[_0x6197('0x12')](0x1f4,_0x5e779f[_0x6197('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0069b7e..238c3e4 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./faxApplication.controller','get'];(function(_0x5009bb,_0x40380c){var _0x48ec0d=function(_0x1ebd8b){while(--_0x1ebd8b){_0x5009bb['push'](_0x5009bb['shift']());}};_0x48ec0d(++_0x40380c);}(_0xda2d,0x102));var _0xdda2=function(_0x3597e0,_0x410575){_0x3597e0=_0x3597e0-0x0;var _0x4192a8=_0xda2d[_0x3597e0];return _0x4192a8;};'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('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0x34b7=['express','Router','fs-extra','../../components/auth/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','path','connect-timeout'];(function(_0x4a9be7,_0x274e5e){var _0x2af3cb=function(_0x12d277){while(--_0x12d277){_0x4a9be7['push'](_0x4a9be7['shift']());}};_0x2af3cb(++_0x274e5e);}(_0x34b7,0x196));var _0x734b=function(_0xc06638,_0x68dc26){_0xc06638=_0xc06638-0x0;var _0x34e96c=_0x34b7[_0xc06638];return _0x34e96c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xd')]);router[_0x734b('0xe')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0xf')]);module[_0x734b('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 7dc2a27..d00ae8c 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 _0x71a5=['out','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x71a5,0x151));var _0x571a=function(_0x1b2dd0,_0x3a1913){_0x1b2dd0=_0x1b2dd0-0x0;var _0x53e12c=_0x71a5[_0x1b2dd0];return _0x53e12c;};'use strict';var Sequelize=require(_0x571a('0x0'));module[_0x571a('0x1')]={'closed':{'type':Sequelize[_0x571a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x571a('0x3')]},'note':{'type':Sequelize[_0x571a('0x3')]},'read1stAt':{'type':Sequelize[_0x571a('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x571a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x571a('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x571a('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xaef5=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xaef5,0xe2));var _0x5aef=function(_0xfd8207,_0x51cc1c){_0xfd8207=_0xfd8207-0x0;var _0x3e5030=_0xaef5[_0xfd8207];return _0x3e5030;};'use strict';var Sequelize=require(_0x5aef('0x0'));module[_0x5aef('0x1')]={'closed':{'type':Sequelize[_0x5aef('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5aef('0x3')]},'disposition':{'type':Sequelize[_0x5aef('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5aef('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x5aef('0x5')]('in',_0x5aef('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5aef('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 6380d47..a039362 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 _0xb004=['keys','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','body','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','fields','hasOwnProperty','limit','order','sort','where','pick','FaxInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','faxInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','format','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','log','err','unlinkSync','zip-dir','path','lodash','ioredis','../../components/interaction/service','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','set','json','then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','findAll','catch','show','model'];(function(_0x45a4f7,_0x4e5edb){var _0x548dc5=function(_0x380083){while(--_0x380083){_0x45a4f7['push'](_0x45a4f7['shift']());}};_0x548dc5(++_0x4e5edb);}(_0xb004,0x1a8));var _0x4b00=function(_0xf3a48c,_0x39f486){_0xf3a48c=_0xf3a48c-0x0;var _0x1e5a07=_0xb004[_0xf3a48c];return _0x1e5a07;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4b00('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x4b00('0x1'));var fs=require('fs');var _=require(_0x4b00('0x2'));var Redis=require(_0x4b00('0x3'));var interaction=require(_0x4b00('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x4b00('0x5'));var db=require(_0x4b00('0x6'))['db'];config[_0x4b00('0x7')]=_['defaults'](config[_0x4b00('0x7')],{'host':_0x4b00('0x8'),'port':0x18eb});var socket=require(_0x4b00('0x9'))(new Redis(config[_0x4b00('0x7')]));require('./faxInteraction.socket')[_0x4b00('0xa')](socket);function respondWithStatusCode(_0x699b44,_0x3f82a7){_0x3f82a7=_0x3f82a7||0xcc;return function(_0x4b30b8){if(_0x4b30b8){return _0x699b44[_0x4b00('0xb')](_0x3f82a7);}return _0x699b44['status'](_0x3f82a7)[_0x4b00('0xc')]();};}function respondWithResult(_0x460076,_0x229728){_0x229728=_0x229728||0xc8;return function(_0x92ad40){if(_0x92ad40){return _0x460076[_0x4b00('0xd')](_0x229728)['json'](_0x92ad40);}};}function respondWithFilteredResult(_0x55a60a,_0x5eb306){return function(_0x42dbba){if(_0x42dbba){var _0x2fcbac=typeof _0x5eb306[_0x4b00('0xe')]===_0x4b00('0xf')&&typeof _0x5eb306['limit']===_0x4b00('0xf');var _0x2dca86=_0x42dbba['count'];var _0x8b7ef7=_0x2fcbac?0x0:_0x5eb306['offset'];var _0x3c7e3e=_0x2fcbac?_0x42dbba[_0x4b00('0x10')]:_0x5eb306[_0x4b00('0xe')]+_0x5eb306['limit'];var _0x111cda;if(_0x3c7e3e>=_0x2dca86){_0x3c7e3e=_0x2dca86;_0x111cda=0xc8;}else{_0x111cda=0xce;}_0x55a60a['status'](_0x111cda);return _0x55a60a[_0x4b00('0x11')]('Content-Range',_0x8b7ef7+'-'+_0x3c7e3e+'/'+_0x2dca86)[_0x4b00('0x12')](_0x42dbba);}return null;};}function saveUpdates(_0x4456de){return function(_0x5acabf){if(_0x5acabf){return _0x5acabf['update'](_0x4456de)[_0x4b00('0x13')](function(_0x7b65af){return _0x7b65af;});}return null;};}function removeEntity(_0x100a22){return function(_0x25ab08){if(_0x25ab08){return _0x25ab08[_0x4b00('0x14')]()[_0x4b00('0x13')](function(){_0x100a22[_0x4b00('0xd')](0xcc)[_0x4b00('0xc')]();});}};}function handleEntityNotFound(_0x3b544c){return function(_0x1a9dd2){if(!_0x1a9dd2){_0x3b544c[_0x4b00('0xb')](0x194);}return _0x1a9dd2;};}function handleError(_0x5a8d63,_0x2f2023){_0x2f2023=_0x2f2023||0x1f4;return function(_0x1980b6){logger[_0x4b00('0x15')](_0x1980b6[_0x4b00('0x16')]);if(_0x1980b6[_0x4b00('0x17')]){delete _0x1980b6[_0x4b00('0x17')];}_0x5a8d63[_0x4b00('0xd')](_0x2f2023)[_0x4b00('0x18')](_0x1980b6);};}exports[_0x4b00('0x19')]=function(_0x2c95a8,_0x3e15ff){var _0x3ddb04={};var _0x923ce7=_[_0x4b00('0x1a')](db[_0x4b00('0x1b')][_0x4b00('0x1c')],function(_0x4708e2){return{'name':_0x4708e2[_0x4b00('0x1d')],'type':_0x4708e2[_0x4b00('0x1e')][_0x4b00('0x1f')]};});_0x3ddb04=qs['getOptions'](_0x923ce7,_0x2c95a8);return interaction[_0x4b00('0x20')]('fax',_0x2c95a8['query'],_0x2c95a8['user'],_0x3ddb04,_0x923ce7)[_0x4b00('0x13')](respondWithFilteredResult(_0x3e15ff,_0x3ddb04))[_0x4b00('0x21')](handleError(_0x3e15ff,null));};exports[_0x4b00('0x22')]=function(_0x26707f,_0x3ebc65){var _0x1b29f0={'raw':![],'where':{'id':_0x26707f['params']['id']}},_0x1882ce={};_0x1882ce[_0x4b00('0x23')]=_[_0x4b00('0x24')](db[_0x4b00('0x1b')][_0x4b00('0x1c')]);_0x1882ce[_0x4b00('0x25')]=_['keys'](_0x26707f[_0x4b00('0x25')]);_0x1882ce[_0x4b00('0x26')]=_[_0x4b00('0x27')](_0x1882ce['model'],_0x1882ce[_0x4b00('0x25')]);_0x1b29f0[_0x4b00('0x28')]=_[_0x4b00('0x27')](_0x1882ce[_0x4b00('0x23')],qs['fields'](_0x26707f[_0x4b00('0x25')]['fields']));_0x1b29f0['attributes']=_0x1b29f0[_0x4b00('0x28')][_0x4b00('0x29')]?_0x1b29f0[_0x4b00('0x28')]:_0x1882ce[_0x4b00('0x23')];if(_0x26707f[_0x4b00('0x25')][_0x4b00('0x2a')]){_0x1b29f0[_0x4b00('0x2b')]=[{'all':!![]}];}_0x1b29f0=_[_0x4b00('0x2c')]({},_0x1b29f0,_0x26707f[_0x4b00('0x2d')]);return db[_0x4b00('0x1b')][_0x4b00('0x2e')](_0x1b29f0)[_0x4b00('0x13')](handleEntityNotFound(_0x3ebc65,null))[_0x4b00('0x13')](respondWithResult(_0x3ebc65,null))[_0x4b00('0x21')](handleError(_0x3ebc65,null));};exports['create']=function(_0x547b77,_0x5ebbde){return db[_0x4b00('0x1b')]['create'](_0x547b77[_0x4b00('0x2f')],{})[_0x4b00('0x13')](respondWithResult(_0x5ebbde,0xc9))[_0x4b00('0x21')](handleError(_0x5ebbde,null));};exports['update']=function(_0x138ac8,_0x48c2d4){if(_0x138ac8['body']['id']){delete _0x138ac8['body']['id'];}return db[_0x4b00('0x1b')]['find']({'where':{'id':_0x138ac8[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x48c2d4,null))[_0x4b00('0x13')](saveUpdates(_0x138ac8[_0x4b00('0x2f')],null))[_0x4b00('0x13')](respondWithResult(_0x48c2d4,null))[_0x4b00('0x21')](handleError(_0x48c2d4,null));};exports[_0x4b00('0x14')]=function(_0x1c43e,_0x30932e){return db['FaxInteraction'][_0x4b00('0x2e')]({'where':{'id':_0x1c43e[_0x4b00('0x30')]['id']}})['then'](handleEntityNotFound(_0x30932e,null))[_0x4b00('0x13')](removeEntity(_0x30932e,null))[_0x4b00('0x21')](handleError(_0x30932e,null));};exports[_0x4b00('0x31')]=function(_0x26d53f,_0x37c5a4){return db[_0x4b00('0x1b')]['describe']()[_0x4b00('0x13')](respondWithResult(_0x37c5a4,null))[_0x4b00('0x21')](handleError(_0x37c5a4,null));};exports[_0x4b00('0x32')]=function(_0xb26c0d,_0x44bf3a){return db[_0x4b00('0x33')][_0x4b00('0x2e')]({'where':{'id':_0xb26c0d[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x44bf3a,null))['then'](function(_0x1991bd){if(_0x1991bd){return _0x1991bd['addMessage'](_0xb26c0d[_0x4b00('0x2f')][_0x4b00('0x34')],_[_0x4b00('0x35')](_0xb26c0d[_0x4b00('0x2f')],['ids','id'])||{});}})['then'](respondWithResult(_0x44bf3a,null))[_0x4b00('0x21')](handleError(_0x44bf3a,null));};exports[_0x4b00('0x36')]=function(_0x432a7d,_0x57e145){var _0x45e2fe={'raw':![],'where':{}};var _0x4ebb94={};var _0x5c9940={'count':0x0,'rows':[]};return db[_0x4b00('0x1b')][_0x4b00('0x37')]({'where':{'id':_0x432a7d[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x57e145,null))['then'](function(_0x154a54){if(_0x154a54){_0x4ebb94['model']=_['keys'](db['FaxMessage'][_0x4b00('0x1c')]);_0x4ebb94[_0x4b00('0x25')]=_[_0x4b00('0x24')](_0x432a7d[_0x4b00('0x25')]);_0x4ebb94[_0x4b00('0x26')]=_[_0x4b00('0x27')](_0x4ebb94['model'],_0x4ebb94[_0x4b00('0x25')]);_0x45e2fe[_0x4b00('0x28')]=_[_0x4b00('0x27')](_0x4ebb94['model'],qs['fields'](_0x432a7d['query'][_0x4b00('0x38')]));_0x45e2fe[_0x4b00('0x28')]=_0x45e2fe[_0x4b00('0x28')]['length']?_0x45e2fe['attributes']:_0x4ebb94[_0x4b00('0x23')];if(!_0x432a7d[_0x4b00('0x25')][_0x4b00('0x39')]('nolimit')){_0x45e2fe['limit']=qs[_0x4b00('0x3a')](_0x432a7d['query']['limit']);_0x45e2fe[_0x4b00('0xe')]=qs[_0x4b00('0xe')](_0x432a7d[_0x4b00('0x25')][_0x4b00('0xe')]);}_0x45e2fe[_0x4b00('0x3b')]=qs[_0x4b00('0x3c')](_0x432a7d[_0x4b00('0x25')][_0x4b00('0x3c')]);_0x45e2fe[_0x4b00('0x3d')]=qs[_0x4b00('0x26')](_[_0x4b00('0x3e')](_0x432a7d['query'],_0x4ebb94['filters']));_0x45e2fe[_0x4b00('0x3d')][_0x4b00('0x3f')]=_0x154a54['id'];if(_0x432a7d[_0x4b00('0x25')][_0x4b00('0x40')]){_0x45e2fe[_0x4b00('0x3d')]=_['merge'](_0x45e2fe[_0x4b00('0x3d')],{'$or':_['map'](_0x45e2fe[_0x4b00('0x28')],function(_0x49871b){var _0x40df75={};_0x40df75[_0x49871b]={'$like':'%'+_0x432a7d['query']['filter']+'%'};return _0x40df75;})});}if(_0x432a7d[_0x4b00('0x25')]['$gte']){var _0x3eb507=_0x432a7d[_0x4b00('0x25')][_0x4b00('0x41')]['split'](',');var _0x9d677e={};_0x9d677e[_0x3eb507[0x0]]={'$gte':moment(_0x3eb507[0x1])['format'](_0x4b00('0x42'))};_0x45e2fe['where']=_[_0x4b00('0x2c')](_0x45e2fe['where'],_0x9d677e);}_0x45e2fe=_['merge']({},_0x45e2fe,_0x432a7d[_0x4b00('0x2d')]);return db[_0x4b00('0x33')][_0x4b00('0x10')]({'where':_0x45e2fe[_0x4b00('0x3d')]})[_0x4b00('0x13')](function(_0x2311e2){_0x5c9940[_0x4b00('0x10')]=_0x2311e2;if(_0x432a7d[_0x4b00('0x25')][_0x4b00('0x2a')]){_0x45e2fe['include']=[{'all':!![]}];}return db[_0x4b00('0x33')][_0x4b00('0x20')](_0x45e2fe);})[_0x4b00('0x13')](function(_0x23468c){_0x5c9940[_0x4b00('0x43')]=_0x23468c;return _0x5c9940;});}})[_0x4b00('0x13')](respondWithFilteredResult(_0x57e145,_0x45e2fe))[_0x4b00('0x21')](handleError(_0x57e145,null));};exports[_0x4b00('0x44')]=function(_0x895df8,_0x2af96b){return db[_0x4b00('0x1b')]['find']({'where':{'id':_0x895df8['params']['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x2af96b,null))[_0x4b00('0x13')](function(_0x1d30a4){if(_0x1d30a4){return _0x1d30a4[_0x4b00('0x45')](_0x895df8[_0x4b00('0x2f')][_0x4b00('0x34')],_['omit'](_0x895df8[_0x4b00('0x2f')],[_0x4b00('0x34'),'id'])||{})['spread'](function(){return db['Tag'][_0x4b00('0x20')]({'attributes':['id','name','color'],'where':{'id':_0x895df8[_0x4b00('0x2f')][_0x4b00('0x34')]}});})[_0x4b00('0x13')](function(_0x1520fc){socket['emit'](_0x4b00('0x46'),{'id':Number(_0x895df8[_0x4b00('0x30')]['id']),'tags':_0x1520fc||[]});return{'id':Number(_0x895df8[_0x4b00('0x30')]['id']),'tags':_0x1520fc||[]};});}})[_0x4b00('0x13')](respondWithResult(_0x2af96b,null))['catch'](handleError(_0x2af96b,null));};exports['removeTags']=function(_0x184397,_0x427b01){return db[_0x4b00('0x1b')]['find']({'where':{'id':_0x184397[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x427b01,null))[_0x4b00('0x13')](function(_0x202d7c){if(_0x202d7c){return _0x202d7c[_0x4b00('0x47')](_0x184397[_0x4b00('0x25')]['ids']);}})[_0x4b00('0x13')](respondWithStatusCode(_0x427b01,null))['catch'](handleError(_0x427b01,null));};exports[_0x4b00('0x48')]=function(_0x224423,_0x19fcf0){var _0x2126c6=moment()[_0x4b00('0x49')]()[_0x4b00('0x4a')]();var _0x281251=path[_0x4b00('0x4b')](config['root'],_0x4b00('0x4c'),_0x4b00('0x4d'),_0x4b00('0x4e'));var _0x350f00=path[_0x4b00('0x4b')](config[_0x4b00('0x4f')],_0x4b00('0x4c'),_0x4b00('0x4d'),_0x4b00('0x50'));var _0x561991=path[_0x4b00('0x4b')](_0x281251,_0x2126c6);var _0x55c53e=util[_0x4b00('0x51')]('transcript-%d-%s.zip',_0x224423[_0x4b00('0x30')]['id'],_0x2126c6);var _0x14949e=path[_0x4b00('0x4b')](_0x281251,_0x55c53e);var _0x29a7c1=[];_0x29a7c1['push']({'model':db[_0x4b00('0x52')],'as':'Attachment','raw':!![]});var _0x41f1b3=[{'model':db[_0x4b00('0x33')],'as':_0x4b00('0x53'),'attributes':['id',_0x4b00('0x2f'),_0x4b00('0x54')],'include':_0x29a7c1}];return db[_0x4b00('0x1b')][_0x4b00('0x2e')]({'where':{'id':_0x224423['params']['id']},'include':_0x41f1b3})[_0x4b00('0x13')](handleEntityNotFound(_0x19fcf0,null))[_0x4b00('0x13')](function(_0x33486d){if(_0x33486d&&_0x33486d[_0x4b00('0x53')]){var _0x742094=_0x33486d[_0x4b00('0x55')]({'plain':!![]});fs['mkdirSync'](_0x561991);for(var _0x3a731a=0x0;_0x3a731a<_0x742094[_0x4b00('0x53')][_0x4b00('0x29')];_0x3a731a++){var _0x4706a1=_0x742094[_0x4b00('0x53')][_0x3a731a][_0x4b00('0x52')];if(_0x4706a1){var _0x274371=path['join'](_0x350f00,_0x4706a1[_0x4b00('0x56')]);if(fs[_0x4b00('0x57')](_0x274371)){fs[_0x4b00('0x58')](_0x274371)['pipe'](fs['createWriteStream'](path[_0x4b00('0x4b')](_0x561991,_0x4706a1[_0x4b00('0x56')])));}}}return BPromise['resolve']()[_0x4b00('0x13')](function(){return new BPromise(function(_0xc7e74a,_0x474c7a){zipdir(_0x561991,{'saveTo':_0x14949e},function(_0x56aece,_0x52611c){if(_0x56aece)return _0x474c7a(_0x56aece);return _0xc7e74a(_0x52611c);});})[_0x4b00('0x13')](function(){return new BPromise(function(_0x19da68,_0xd55431){rimraf(_0x561991,function(_0x2b6b8a){if(_0x2b6b8a)_0xd55431(_0x2b6b8a);return _0x19da68();});});})[_0x4b00('0x13')](function(){return _0x19fcf0['download'](_0x14949e,_0x55c53e,function(_0x2c05c0){if(_0x2c05c0){console[_0x4b00('0x59')](_0x4b00('0x5a'),_0x2c05c0);}else{fs[_0x4b00('0x5b')](_0x14949e);}});});});}else{return _0x19fcf0['sendStatus'](0xc8);}})['catch'](handleError(_0x19fcf0,null));}; \ No newline at end of file +var _0x8a8c=['catch','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','join','root','server','tmp','files','transcript-%d-%s.zip','push','Attachment','Messages','mkdirSync','pipe','createWriteStream','basename','resolve','log','unlinkSync','moment','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','name','index','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','user'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x8a8c,0x163));var _0xc8a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a8c[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xc8a8('0x0'));var BPromise=require('bluebird');var util=require(_0xc8a8('0x1'));var path=require(_0xc8a8('0x2'));var fs=require('fs');var _=require(_0xc8a8('0x3'));var Redis=require(_0xc8a8('0x4'));var interaction=require(_0xc8a8('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xc8a8('0x6'))(_0xc8a8('0x7'));var config=require(_0xc8a8('0x8'));var db=require(_0xc8a8('0x9'))['db'];config[_0xc8a8('0xa')]=_[_0xc8a8('0xb')](config[_0xc8a8('0xa')],{'host':_0xc8a8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc8a8('0xa')]));require(_0xc8a8('0xd'))['register'](socket);function respondWithStatusCode(_0x4f1d2d,_0x484745){_0x484745=_0x484745||0xcc;return function(_0x2d5698){if(_0x2d5698){return _0x4f1d2d[_0xc8a8('0xe')](_0x484745);}return _0x4f1d2d[_0xc8a8('0xf')](_0x484745)[_0xc8a8('0x10')]();};}function respondWithResult(_0x425578,_0x12a141){_0x12a141=_0x12a141||0xc8;return function(_0xc4b306){if(_0xc4b306){return _0x425578[_0xc8a8('0xf')](_0x12a141)[_0xc8a8('0x11')](_0xc4b306);}};}function respondWithFilteredResult(_0x223db6,_0x13d994){return function(_0x15619d){if(_0x15619d){var _0x3ce3a1=typeof _0x13d994[_0xc8a8('0x12')]==='undefined'&&typeof _0x13d994[_0xc8a8('0x13')]===_0xc8a8('0x14');var _0x28a2f5=_0x15619d[_0xc8a8('0x15')];var _0x47b7d8=_0x3ce3a1?0x0:_0x13d994[_0xc8a8('0x12')];var _0x1d2311=_0x3ce3a1?_0x15619d['count']:_0x13d994['offset']+_0x13d994[_0xc8a8('0x13')];var _0x3e39f8;if(_0x1d2311>=_0x28a2f5){_0x1d2311=_0x28a2f5;_0x3e39f8=0xc8;}else{_0x3e39f8=0xce;}_0x223db6[_0xc8a8('0xf')](_0x3e39f8);return _0x223db6['set'](_0xc8a8('0x16'),_0x47b7d8+'-'+_0x1d2311+'/'+_0x28a2f5)[_0xc8a8('0x11')](_0x15619d);}return null;};}function saveUpdates(_0x3abe3d){return function(_0x2f192b){if(_0x2f192b){return _0x2f192b[_0xc8a8('0x17')](_0x3abe3d)[_0xc8a8('0x18')](function(_0x31449e){return _0x31449e;});}return null;};}function removeEntity(_0x274fb2){return function(_0x10590a){if(_0x10590a){return _0x10590a[_0xc8a8('0x19')]()['then'](function(){_0x274fb2[_0xc8a8('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11020c){return function(_0x1e937b){if(!_0x1e937b){_0x11020c[_0xc8a8('0xe')](0x194);}return _0x1e937b;};}function handleError(_0x3d1a7d,_0x43732d){_0x43732d=_0x43732d||0x1f4;return function(_0x28b7aa){logger['error'](_0x28b7aa['stack']);if(_0x28b7aa['name']){delete _0x28b7aa[_0xc8a8('0x1a')];}_0x3d1a7d[_0xc8a8('0xf')](_0x43732d)['send'](_0x28b7aa);};}exports[_0xc8a8('0x1b')]=function(_0x41dde7,_0xc71570){var _0x219142={};var _0x362a0d=_['map'](db[_0xc8a8('0x1c')][_0xc8a8('0x1d')],function(_0xd42d2){return{'name':_0xd42d2[_0xc8a8('0x1e')],'type':_0xd42d2[_0xc8a8('0x1f')][_0xc8a8('0x20')]};});_0x219142=qs[_0xc8a8('0x21')](_0x362a0d,_0x41dde7);return interaction[_0xc8a8('0x22')](_0xc8a8('0x23'),_0x41dde7['query'],_0x41dde7[_0xc8a8('0x24')],_0x219142,_0x362a0d)[_0xc8a8('0x18')](respondWithFilteredResult(_0xc71570,_0x219142))[_0xc8a8('0x25')](handleError(_0xc71570,null));};exports[_0xc8a8('0x26')]=function(_0x20c980,_0x26137d){var _0x22a3f5={'raw':![],'where':{'id':_0x20c980[_0xc8a8('0x27')]['id']}},_0x134ee3={};_0x134ee3[_0xc8a8('0x28')]=_[_0xc8a8('0x29')](db[_0xc8a8('0x1c')][_0xc8a8('0x1d')]);_0x134ee3[_0xc8a8('0x2a')]=_['keys'](_0x20c980[_0xc8a8('0x2a')]);_0x134ee3[_0xc8a8('0x2b')]=_['intersection'](_0x134ee3['model'],_0x134ee3[_0xc8a8('0x2a')]);_0x22a3f5['attributes']=_[_0xc8a8('0x2c')](_0x134ee3[_0xc8a8('0x28')],qs[_0xc8a8('0x2d')](_0x20c980['query'][_0xc8a8('0x2d')]));_0x22a3f5[_0xc8a8('0x2e')]=_0x22a3f5['attributes'][_0xc8a8('0x2f')]?_0x22a3f5['attributes']:_0x134ee3[_0xc8a8('0x28')];if(_0x20c980[_0xc8a8('0x2a')][_0xc8a8('0x30')]){_0x22a3f5[_0xc8a8('0x31')]=[{'all':!![]}];}_0x22a3f5=_['merge']({},_0x22a3f5,_0x20c980[_0xc8a8('0x32')]);return db[_0xc8a8('0x1c')][_0xc8a8('0x33')](_0x22a3f5)[_0xc8a8('0x18')](handleEntityNotFound(_0x26137d,null))[_0xc8a8('0x18')](respondWithResult(_0x26137d,null))[_0xc8a8('0x25')](handleError(_0x26137d,null));};exports['create']=function(_0x601523,_0x4f1f2f){return db[_0xc8a8('0x1c')][_0xc8a8('0x34')](_0x601523['body'],{})['then'](respondWithResult(_0x4f1f2f,0xc9))[_0xc8a8('0x25')](handleError(_0x4f1f2f,null));};exports[_0xc8a8('0x17')]=function(_0x3ee3e9,_0x451bf1){if(_0x3ee3e9[_0xc8a8('0x35')]['id']){delete _0x3ee3e9[_0xc8a8('0x35')]['id'];}return db[_0xc8a8('0x1c')][_0xc8a8('0x33')]({'where':{'id':_0x3ee3e9[_0xc8a8('0x27')]['id']}})[_0xc8a8('0x18')](handleEntityNotFound(_0x451bf1,null))[_0xc8a8('0x18')](saveUpdates(_0x3ee3e9[_0xc8a8('0x35')],null))[_0xc8a8('0x18')](respondWithResult(_0x451bf1,null))[_0xc8a8('0x25')](handleError(_0x451bf1,null));};exports[_0xc8a8('0x19')]=function(_0x4933f5,_0x2b7f75){return db[_0xc8a8('0x1c')][_0xc8a8('0x33')]({'where':{'id':_0x4933f5[_0xc8a8('0x27')]['id']}})[_0xc8a8('0x18')](handleEntityNotFound(_0x2b7f75,null))[_0xc8a8('0x18')](removeEntity(_0x2b7f75,null))[_0xc8a8('0x25')](handleError(_0x2b7f75,null));};exports[_0xc8a8('0x36')]=function(_0x44db45,_0x37db1f){return db['FaxInteraction'][_0xc8a8('0x36')]()[_0xc8a8('0x18')](respondWithResult(_0x37db1f,null))['catch'](handleError(_0x37db1f,null));};exports[_0xc8a8('0x37')]=function(_0x47183b,_0x253e88){return db[_0xc8a8('0x38')][_0xc8a8('0x33')]({'where':{'id':_0x47183b[_0xc8a8('0x27')]['id']}})[_0xc8a8('0x18')](handleEntityNotFound(_0x253e88,null))[_0xc8a8('0x18')](function(_0x4090ed){if(_0x4090ed){return _0x4090ed['addMessage'](_0x47183b['body'][_0xc8a8('0x39')],_[_0xc8a8('0x3a')](_0x47183b[_0xc8a8('0x35')],['ids','id'])||{});}})[_0xc8a8('0x18')](respondWithResult(_0x253e88,null))[_0xc8a8('0x25')](handleError(_0x253e88,null));};exports[_0xc8a8('0x3b')]=function(_0x1b0122,_0x34fede){var _0x37dbc6={'raw':![],'where':{}};var _0x2b69ea={};var _0x464054={'count':0x0,'rows':[]};return db[_0xc8a8('0x1c')][_0xc8a8('0x3c')]({'where':{'id':_0x1b0122[_0xc8a8('0x27')]['id']}})[_0xc8a8('0x18')](handleEntityNotFound(_0x34fede,null))[_0xc8a8('0x18')](function(_0x4d4bdc){if(_0x4d4bdc){_0x2b69ea[_0xc8a8('0x28')]=_['keys'](db['FaxMessage'][_0xc8a8('0x1d')]);_0x2b69ea[_0xc8a8('0x2a')]=_['keys'](_0x1b0122[_0xc8a8('0x2a')]);_0x2b69ea['filters']=_[_0xc8a8('0x2c')](_0x2b69ea[_0xc8a8('0x28')],_0x2b69ea[_0xc8a8('0x2a')]);_0x37dbc6[_0xc8a8('0x2e')]=_[_0xc8a8('0x2c')](_0x2b69ea[_0xc8a8('0x28')],qs[_0xc8a8('0x2d')](_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x2d')]));_0x37dbc6[_0xc8a8('0x2e')]=_0x37dbc6[_0xc8a8('0x2e')][_0xc8a8('0x2f')]?_0x37dbc6[_0xc8a8('0x2e')]:_0x2b69ea[_0xc8a8('0x28')];if(!_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x3d')](_0xc8a8('0x3e'))){_0x37dbc6['limit']=qs[_0xc8a8('0x13')](_0x1b0122['query'][_0xc8a8('0x13')]);_0x37dbc6['offset']=qs[_0xc8a8('0x12')](_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x12')]);}_0x37dbc6[_0xc8a8('0x3f')]=qs[_0xc8a8('0x40')](_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x40')]);_0x37dbc6[_0xc8a8('0x41')]=qs[_0xc8a8('0x2b')](_[_0xc8a8('0x42')](_0x1b0122[_0xc8a8('0x2a')],_0x2b69ea[_0xc8a8('0x2b')]));_0x37dbc6[_0xc8a8('0x41')]['FaxInteractionId']=_0x4d4bdc['id'];if(_0x1b0122['query'][_0xc8a8('0x43')]){_0x37dbc6[_0xc8a8('0x41')]=_[_0xc8a8('0x44')](_0x37dbc6[_0xc8a8('0x41')],{'$or':_['map'](_0x37dbc6[_0xc8a8('0x2e')],function(_0x5dc445){var _0x50f5da={};_0x50f5da[_0x5dc445]={'$like':'%'+_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x43')]+'%'};return _0x50f5da;})});}if(_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x45')]){var _0x236a83=_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x45')]['split'](',');var _0x2f71c4={};_0x2f71c4[_0x236a83[0x0]]={'$gte':moment(_0x236a83[0x1])[_0xc8a8('0x46')](_0xc8a8('0x47'))};_0x37dbc6[_0xc8a8('0x41')]=_[_0xc8a8('0x44')](_0x37dbc6[_0xc8a8('0x41')],_0x2f71c4);}_0x37dbc6=_[_0xc8a8('0x44')]({},_0x37dbc6,_0x1b0122[_0xc8a8('0x32')]);return db[_0xc8a8('0x38')][_0xc8a8('0x15')]({'where':_0x37dbc6[_0xc8a8('0x41')]})[_0xc8a8('0x18')](function(_0xcc0aff){_0x464054['count']=_0xcc0aff;if(_0x1b0122[_0xc8a8('0x2a')][_0xc8a8('0x30')]){_0x37dbc6[_0xc8a8('0x31')]=[{'all':!![]}];}return db[_0xc8a8('0x38')]['findAll'](_0x37dbc6);})['then'](function(_0x717a88){_0x464054[_0xc8a8('0x48')]=_0x717a88;return _0x464054;});}})['then'](respondWithFilteredResult(_0x34fede,_0x37dbc6))['catch'](handleError(_0x34fede,null));};exports[_0xc8a8('0x49')]=function(_0x4b0e0a,_0x47bc38){return db['FaxInteraction'][_0xc8a8('0x33')]({'where':{'id':_0x4b0e0a['params']['id']}})[_0xc8a8('0x18')](handleEntityNotFound(_0x47bc38,null))[_0xc8a8('0x18')](function(_0x4fa04e){if(_0x4fa04e){return _0x4fa04e[_0xc8a8('0x4a')](_0x4b0e0a['body'][_0xc8a8('0x39')],_[_0xc8a8('0x3a')](_0x4b0e0a[_0xc8a8('0x35')],[_0xc8a8('0x39'),'id'])||{})[_0xc8a8('0x4b')](function(){return db[_0xc8a8('0x4c')][_0xc8a8('0x22')]({'attributes':['id',_0xc8a8('0x1a'),_0xc8a8('0x4d')],'where':{'id':_0x4b0e0a[_0xc8a8('0x35')][_0xc8a8('0x39')]}});})[_0xc8a8('0x18')](function(_0x4d4ff6){socket[_0xc8a8('0x4e')]('faxInteractionTags:save',{'id':Number(_0x4b0e0a['params']['id']),'tags':_0x4d4ff6||[]});return{'id':Number(_0x4b0e0a[_0xc8a8('0x27')]['id']),'tags':_0x4d4ff6||[]};});}})[_0xc8a8('0x18')](respondWithResult(_0x47bc38,null))[_0xc8a8('0x25')](handleError(_0x47bc38,null));};exports[_0xc8a8('0x4f')]=function(_0x241d1b,_0x4fdb56){return db[_0xc8a8('0x1c')][_0xc8a8('0x33')]({'where':{'id':_0x241d1b['params']['id']}})[_0xc8a8('0x18')](handleEntityNotFound(_0x4fdb56,null))['then'](function(_0x3100c7){if(_0x3100c7){return _0x3100c7[_0xc8a8('0x4f')](_0x241d1b[_0xc8a8('0x2a')]['ids']);}})[_0xc8a8('0x18')](respondWithStatusCode(_0x4fdb56,null))[_0xc8a8('0x25')](handleError(_0x4fdb56,null));};exports[_0xc8a8('0x50')]=function(_0x25b1c7,_0x9ed152){var _0x4980da=moment()[_0xc8a8('0x51')]()['toString']();var _0x1aa44b=path[_0xc8a8('0x52')](config[_0xc8a8('0x53')],_0xc8a8('0x54'),'files',_0xc8a8('0x55'));var _0x5f5192=path[_0xc8a8('0x52')](config['root'],_0xc8a8('0x54'),_0xc8a8('0x56'),'attachments');var _0x23ce99=path['join'](_0x1aa44b,_0x4980da);var _0x3eb0b8=util[_0xc8a8('0x46')](_0xc8a8('0x57'),_0x25b1c7[_0xc8a8('0x27')]['id'],_0x4980da);var _0x47dc58=path[_0xc8a8('0x52')](_0x1aa44b,_0x3eb0b8);var _0x18db40=[];_0x18db40[_0xc8a8('0x58')]({'model':db[_0xc8a8('0x59')],'as':'Attachment','raw':!![]});var _0x56ce2a=[{'model':db[_0xc8a8('0x38')],'as':_0xc8a8('0x5a'),'attributes':['id',_0xc8a8('0x35'),'createdAt'],'include':_0x18db40}];return db[_0xc8a8('0x1c')]['find']({'where':{'id':_0x25b1c7['params']['id']},'include':_0x56ce2a})[_0xc8a8('0x18')](handleEntityNotFound(_0x9ed152,null))[_0xc8a8('0x18')](function(_0x1fcb32){if(_0x1fcb32&&_0x1fcb32[_0xc8a8('0x5a')]){var _0x28ea82=_0x1fcb32['get']({'plain':!![]});fs[_0xc8a8('0x5b')](_0x23ce99);for(var _0x3f4041=0x0;_0x3f4041<_0x28ea82[_0xc8a8('0x5a')][_0xc8a8('0x2f')];_0x3f4041++){var _0x4d2b0c=_0x28ea82[_0xc8a8('0x5a')][_0x3f4041][_0xc8a8('0x59')];if(_0x4d2b0c){var _0x405501=path[_0xc8a8('0x52')](_0x5f5192,_0x4d2b0c['basename']);if(fs['existsSync'](_0x405501)){fs['createReadStream'](_0x405501)[_0xc8a8('0x5c')](fs[_0xc8a8('0x5d')](path['join'](_0x23ce99,_0x4d2b0c[_0xc8a8('0x5e')])));}}}return BPromise[_0xc8a8('0x5f')]()['then'](function(){return new BPromise(function(_0x359f86,_0x53606a){zipdir(_0x23ce99,{'saveTo':_0x47dc58},function(_0xdcb2cc,_0x324b8b){if(_0xdcb2cc)return _0x53606a(_0xdcb2cc);return _0x359f86(_0x324b8b);});})['then'](function(){return new BPromise(function(_0x7be7d2,_0x59da96){rimraf(_0x23ce99,function(_0x430871){if(_0x430871)_0x59da96(_0x430871);return _0x7be7d2();});});})[_0xc8a8('0x18')](function(){return _0x9ed152[_0xc8a8('0x50')](_0x47dc58,_0x3eb0b8,function(_0x5715ca){if(_0x5715ca){console[_0xc8a8('0x60')]('err',_0x5715ca);}else{fs[_0xc8a8('0x61')](_0x47dc58);}});});});}else{return _0x9ed152[_0xc8a8('0xe')](0xc8);}})['catch'](handleError(_0x9ed152,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4a71b77..b95c1ab 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 _0x159d=['FaxMessage','save','update','remove','getUsers','findAll','setDataValue','emit','catch','hook','exports','../../mysqldb'];(function(_0x3cac01,_0x471c3e){var _0x2d3dbe=function(_0x4f267c){while(--_0x4f267c){_0x3cac01['push'](_0x3cac01['shift']());}};_0x2d3dbe(++_0x471c3e);}(_0x159d,0x77));var _0xd159=function(_0x426fb9,_0x73b8ed){_0x426fb9=_0x426fb9-0x0;var _0x2d1760=_0x159d[_0x426fb9];return _0x2d1760;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xd159('0x0'))['db'][_0xd159('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd159('0x2'),'afterUpdate':_0xd159('0x3'),'afterDestroy':_0xd159('0x4')};function emitEvent(_0x32f5db){return function(_0x4a9d4f,_0x1aeffc,_0x58cff4){_0x4a9d4f[_0xd159('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x486609){_0x4a9d4f['setDataValue']('Users',_0x486609['map'](function(_0x48b505){return{'id':_0x48b505['id']};}));return FaxMessage[_0xd159('0x6')]({'where':{'FaxInteractionId':_0x4a9d4f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16c1d1){_0x4a9d4f[_0xd159('0x7')]('unreadMessages',_0x16c1d1['length']);FaxInteractionEvents[_0xd159('0x8')](_0x32f5db+':'+_0x4a9d4f['id'],_0x4a9d4f);FaxInteractionEvents[_0xd159('0x8')](_0x32f5db,_0x4a9d4f);_0x58cff4(null);})[_0xd159('0x9')](_0x58cff4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xd159('0xa')](e,emitEvent(event));}}module[_0xd159('0xb')]=FaxInteractionEvents; \ No newline at end of file +var _0x3168=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','findAll','setDataValue'];(function(_0x2261bc,_0x187107){var _0x331159=function(_0x11d020){while(--_0x11d020){_0x2261bc['push'](_0x2261bc['shift']());}};_0x331159(++_0x187107);}(_0x3168,0xcd));var _0x8316=function(_0x2d10f0,_0xbcac53){_0x2d10f0=_0x2d10f0-0x0;var _0x58952=_0x3168[_0x2d10f0];return _0x58952;};'use strict';var EventEmitter=require(_0x8316('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x8316('0x1')];var FaxMessage=require(_0x8316('0x2'))['db'][_0x8316('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8316('0x4')](0x0);var events={'afterCreate':_0x8316('0x5'),'afterUpdate':_0x8316('0x6'),'afterDestroy':_0x8316('0x7')};function emitEvent(_0x1ac798){return function(_0x458dd8,_0x105c83,_0x5b2c0d){_0x458dd8['getUsers']({'attributes':['id'],'raw':!![]})[_0x8316('0x8')](function(_0x71f1ca){_0x458dd8['setDataValue']('Users',_0x71f1ca['map'](function(_0x5deb44){return{'id':_0x5deb44['id']};}));return FaxMessage[_0x8316('0x9')]({'where':{'FaxInteractionId':_0x458dd8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x530600){_0x458dd8[_0x8316('0xa')](_0x8316('0xb'),_0x530600[_0x8316('0xc')]);FaxInteractionEvents[_0x8316('0xd')](_0x1ac798+':'+_0x458dd8['id'],_0x458dd8);FaxInteractionEvents[_0x8316('0xd')](_0x1ac798,_0x458dd8);_0x5b2c0d(null);})[_0x8316('0xe')](_0x5b2c0d(null));};}for(var e in events){if(events[_0x8316('0xf')](e)){var event=events[e];FaxInteraction[_0x8316('0x10')](e,emitEvent(event));}}module[_0x8316('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index daf91b4..911fbc7 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 _0xf5ac=['FaxInteraction','fax_interactions','closed','closedAt','format','lodash','../../config/logger','moment','bluebird','path','rimraf','./faxInteraction.attributes','exports','define'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf5ac,0x1a9));var _0xcf5a=function(_0x3a1880,_0x465dc1){_0x3a1880=_0x3a1880-0x0;var _0x448f25=_0xf5ac[_0x3a1880];return _0x448f25;};'use strict';var _=require(_0xcf5a('0x0'));var util=require('util');var logger=require(_0xcf5a('0x1'))('api');var moment=require(_0xcf5a('0x2'));var BPromise=require(_0xcf5a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf5a('0x4'));var rimraf=require(_0xcf5a('0x5'));var config=require('../../config/environment');var attributes=require(_0xcf5a('0x6'));module[_0xcf5a('0x7')]=function(_0x2bfa6f,_0x529b50){return _0x2bfa6f[_0xcf5a('0x8')](_0xcf5a('0x9'),attributes,{'tableName':_0xcf5a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x66dde,_0x267a93,_0x2660b6){if(_0x66dde['changed'](_0xcf5a('0xb'))){_0x66dde[_0xcf5a('0xc')]=moment()[_0xcf5a('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2660b6(null,_0x66dde);}}});}; \ No newline at end of file +var _0x6946=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x5e24d7,_0x11218f){var _0x10063d=function(_0x39fc21){while(--_0x39fc21){_0x5e24d7['push'](_0x5e24d7['shift']());}};_0x10063d(++_0x11218f);}(_0x6946,0x1b3));var _0x6694=function(_0x1389da,_0x289f72){_0x1389da=_0x1389da-0x0;var _0x567186=_0x6946[_0x1389da];return _0x567186;};'use strict';var _=require(_0x6694('0x0'));var util=require(_0x6694('0x1'));var logger=require(_0x6694('0x2'))(_0x6694('0x3'));var moment=require(_0x6694('0x4'));var BPromise=require(_0x6694('0x5'));var rp=require(_0x6694('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6694('0x7'));var attributes=require(_0x6694('0x8'));module[_0x6694('0x9')]=function(_0x2b7543,_0x147626){return _0x2b7543[_0x6694('0xa')](_0x6694('0xb'),attributes,{'tableName':_0x6694('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1add39,_0x4a56ee,_0x534d59){if(_0x1add39[_0x6694('0xd')](_0x6694('0xe'))){_0x1add39[_0x6694('0xf')]=moment()[_0x6694('0x10')](_0x6694('0x11'));}_0x534d59(null,_0x1add39);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5fa6f37..2f526a9 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 _0xc059=['find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','UpdateFaxInteraction','FaxInteraction','update','options','raw','limit','info','stringify','catch','AddTagsToFaxInteraction'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0xc059,0x1a1));var _0x9c05=function(_0x19c55c,_0x1323fe){_0x19c55c=_0x19c55c-0x0;var _0x140dc4=_0xc059[_0x19c55c];return _0x140dc4;};'use strict';var _=require(_0x9c05('0x0'));var util=require('util');var moment=require(_0x9c05('0x1'));var BPromise=require(_0x9c05('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c05('0x3'));var db=require(_0x9c05('0x4'))['db'];var utils=require(_0x9c05('0x5'));var logger=require(_0x9c05('0x6'))('rpc');var config=require(_0x9c05('0x7'));var jayson=require(_0x9c05('0x8'));var client=jayson[_0x9c05('0x9')][_0x9c05('0xa')]({'port':0x232a});config[_0x9c05('0xb')]=_[_0x9c05('0xc')](config[_0x9c05('0xb')],{'host':_0x9c05('0xd'),'port':0x18eb});var socket=require(_0x9c05('0xe'))(new Redis(config[_0x9c05('0xb')]));require(_0x9c05('0xf'))['register'](socket);function respondWithRpcPromise(_0x130e02,_0x40e40d,_0x2297d4){return new BPromise(function(_0x2c1da3,_0x4bc70d){return client['request'](_0x130e02,_0x2297d4)[_0x9c05('0x10')](function(_0x5f30cc){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x40e40d,_0x9c05('0x11'));logger[_0x9c05('0x12')](_0x9c05('0x13'),_0x40e40d,_0x9c05('0x11'),JSON['stringify'](_0x5f30cc));if(_0x5f30cc[_0x9c05('0x14')]){if(_0x5f30cc[_0x9c05('0x14')][_0x9c05('0x15')]===0x1f4){logger[_0x9c05('0x14')](_0x9c05('0x16'),_0x40e40d,_0x5f30cc[_0x9c05('0x14')]['message']);return _0x4bc70d(_0x5f30cc[_0x9c05('0x14')][_0x9c05('0x17')]);}logger[_0x9c05('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x40e40d,_0x5f30cc['error'][_0x9c05('0x17')]);return _0x2c1da3(_0x5f30cc['error'][_0x9c05('0x17')]);}else{logger['info'](_0x9c05('0x16'),_0x40e40d,_0x9c05('0x11'));_0x2c1da3(_0x5f30cc['result'][_0x9c05('0x17')]);}})['catch'](function(_0x1dcfb6){logger[_0x9c05('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x40e40d,_0x1dcfb6);_0x4bc70d(_0x1dcfb6);});});}exports[_0x9c05('0x18')]=function(_0x58ce69){var _0x1536fc=this;return new Promise(function(_0x57265e,_0x3463f2){return db[_0x9c05('0x19')][_0x9c05('0x1a')](_0x58ce69['body'],{'raw':_0x58ce69['options']?_0x58ce69[_0x9c05('0x1b')][_0x9c05('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ce69[_0x9c05('0x1b')]?_0x58ce69[_0x9c05('0x1b')]['where']||null:null,'attributes':_0x58ce69[_0x9c05('0x1b')]?_0x58ce69[_0x9c05('0x1b')]['attributes']||null:null,'limit':_0x58ce69['options']?_0x58ce69[_0x9c05('0x1b')][_0x9c05('0x1d')]||null:null})[_0x9c05('0x10')](function(_0x1fccd8){logger[_0x9c05('0x1e')](_0x9c05('0x18'),_0x58ce69);logger[_0x9c05('0x12')](_0x9c05('0x18'),_0x58ce69,JSON[_0x9c05('0x1f')](_0x1fccd8));_0x57265e(_0x1fccd8);})[_0x9c05('0x20')](function(_0x40b174){logger[_0x9c05('0x14')]('UpdateFaxInteraction',_0x40b174[_0x9c05('0x17')],_0x58ce69);_0x3463f2(_0x1536fc[_0x9c05('0x14')](0x1f4,_0x40b174[_0x9c05('0x17')]));});});};exports[_0x9c05('0x21')]=function(_0x3082c3){return new Promise(function(_0x2a99d8,_0x4421b3){return db[_0x9c05('0x19')][_0x9c05('0x22')]({'where':_0x3082c3[_0x9c05('0x1b')]?_0x3082c3[_0x9c05('0x1b')]['where']||null:null})[_0x9c05('0x10')](function(_0x2ff5c1){if(_0x2ff5c1){return _0x2ff5c1[_0x9c05('0x23')](_0x3082c3[_0x9c05('0x24')][_0x9c05('0x25')],_[_0x9c05('0x26')](_0x3082c3[_0x9c05('0x24')],[_0x9c05('0x25'),'id'])||{});}})[_0x9c05('0x27')](function(_0x3a60b5){logger[_0x9c05('0x1e')](_0x9c05('0x28'),_0x3082c3);logger['debug']('AddTags',_0x3082c3,JSON[_0x9c05('0x1f')](_0x3a60b5));_0x2a99d8(_0x3a60b5);})[_0x9c05('0x20')](function(_0x2ae2f1){logger[_0x9c05('0x14')](_0x9c05('0x28'),_0x2ae2f1[_0x9c05('0x17')],_0x3082c3);_0x4421b3(_this['error'](0x1f4,_0x2ae2f1[_0x9c05('0x17')]));});});}; \ No newline at end of file +var _0x58e1=['moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateFaxInteraction','body','options','raw','attributes','limit','debug','AddTagsToFaxInteraction','omit','spread','AddTags','catch','lodash','util'];(function(_0x3fe39e,_0x479f27){var _0x4e34f3=function(_0x55f2cf){while(--_0x55f2cf){_0x3fe39e['push'](_0x3fe39e['shift']());}};_0x4e34f3(++_0x479f27);}(_0x58e1,0x11e));var _0x158e=function(_0x4e413f,_0x266ab4){_0x4e413f=_0x4e413f-0x0;var _0x2eca8a=_0x58e1[_0x4e413f];return _0x2eca8a;};'use strict';var _=require(_0x158e('0x0'));var util=require(_0x158e('0x1'));var moment=require(_0x158e('0x2'));var BPromise=require('bluebird');var rs=require(_0x158e('0x3'));var fs=require('fs');var Redis=require(_0x158e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x158e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x158e('0x6'));var jayson=require(_0x158e('0x7'));var client=jayson[_0x158e('0x8')][_0x158e('0x9')]({'port':0x232a});config[_0x158e('0xa')]=_[_0x158e('0xb')](config[_0x158e('0xa')],{'host':_0x158e('0xc'),'port':0x18eb});var socket=require(_0x158e('0xd'))(new Redis(config[_0x158e('0xa')]));require(_0x158e('0xe'))['register'](socket);function respondWithRpcPromise(_0x2b1b1e,_0x2e5950,_0x2a8d43){return new BPromise(function(_0x51a7fb,_0x542039){return client[_0x158e('0xf')](_0x2b1b1e,_0x2a8d43)[_0x158e('0x10')](function(_0x51903d){logger[_0x158e('0x11')](_0x158e('0x12'),_0x2e5950,_0x158e('0x13'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2e5950,_0x158e('0x13'),JSON[_0x158e('0x14')](_0x51903d));if(_0x51903d['error']){if(_0x51903d[_0x158e('0x15')]['code']===0x1f4){logger[_0x158e('0x15')](_0x158e('0x12'),_0x2e5950,_0x51903d[_0x158e('0x15')][_0x158e('0x16')]);return _0x542039(_0x51903d[_0x158e('0x15')]['message']);}logger[_0x158e('0x15')](_0x158e('0x12'),_0x2e5950,_0x51903d[_0x158e('0x15')][_0x158e('0x16')]);return _0x51a7fb(_0x51903d['error'][_0x158e('0x16')]);}else{logger['info'](_0x158e('0x12'),_0x2e5950,_0x158e('0x13'));_0x51a7fb(_0x51903d[_0x158e('0x17')][_0x158e('0x16')]);}})['catch'](function(_0x412923){logger[_0x158e('0x15')](_0x158e('0x12'),_0x2e5950,_0x412923);_0x542039(_0x412923);});});}exports[_0x158e('0x18')]=function(_0x360f1a){var _0x20ae1f=this;return new Promise(function(_0x3bb61e,_0x363757){return db['FaxInteraction']['update'](_0x360f1a[_0x158e('0x19')],{'raw':_0x360f1a[_0x158e('0x1a')]?_0x360f1a[_0x158e('0x1a')][_0x158e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x360f1a['options']?_0x360f1a[_0x158e('0x1a')]['where']||null:null,'attributes':_0x360f1a[_0x158e('0x1a')]?_0x360f1a[_0x158e('0x1a')][_0x158e('0x1c')]||null:null,'limit':_0x360f1a[_0x158e('0x1a')]?_0x360f1a[_0x158e('0x1a')][_0x158e('0x1d')]||null:null})['then'](function(_0x3b8a24){logger[_0x158e('0x11')](_0x158e('0x18'),_0x360f1a);logger[_0x158e('0x1e')](_0x158e('0x18'),_0x360f1a,JSON['stringify'](_0x3b8a24));_0x3bb61e(_0x3b8a24);})['catch'](function(_0x2b5bdd){logger[_0x158e('0x15')](_0x158e('0x18'),_0x2b5bdd['message'],_0x360f1a);_0x363757(_0x20ae1f[_0x158e('0x15')](0x1f4,_0x2b5bdd[_0x158e('0x16')]));});});};exports[_0x158e('0x1f')]=function(_0x571e34){return new Promise(function(_0x4784d1,_0x2a4b83){return db['FaxInteraction']['find']({'where':_0x571e34[_0x158e('0x1a')]?_0x571e34[_0x158e('0x1a')]['where']||null:null})[_0x158e('0x10')](function(_0x225632){if(_0x225632){return _0x225632['addTags'](_0x571e34[_0x158e('0x19')]['ids'],_[_0x158e('0x20')](_0x571e34['body'],['ids','id'])||{});}})[_0x158e('0x21')](function(_0x3908ba){logger['info'](_0x158e('0x22'),_0x571e34);logger[_0x158e('0x1e')](_0x158e('0x22'),_0x571e34,JSON[_0x158e('0x14')](_0x3908ba));_0x4784d1(_0x3908ba);})[_0x158e('0x23')](function(_0x2ff2ee){logger[_0x158e('0x15')](_0x158e('0x22'),_0x2ff2ee[_0x158e('0x16')],_0x571e34);_0x2a4b83(_this[_0x158e('0x15')](0x1f4,_0x2ff2ee[_0x158e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 0fa3cd9..0cb729f 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 _0x3f41=['removeListener','faxInteraction:','./faxInteraction.events','save','remove','emit'];(function(_0x1f24d1,_0x519091){var _0x171019=function(_0x60d560){while(--_0x60d560){_0x1f24d1['push'](_0x1f24d1['shift']());}};_0x171019(++_0x519091);}(_0x3f41,0x9e));var _0x13f4=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x3f41[_0xbf8ebe];return _0x1e25e8;};'use strict';var FaxInteractionEvents=require(_0x13f4('0x0'));var events=[_0x13f4('0x1'),_0x13f4('0x2'),'update'];function createListener(_0x3bf0b4,_0x2d8631){return function(_0x4a2069){_0x2d8631[_0x13f4('0x3')](_0x3bf0b4,_0x4a2069);};}function removeListener(_0x9cefb3,_0x10b130){return function(){FaxInteractionEvents[_0x13f4('0x4')](_0x9cefb3,_0x10b130);};}exports['register']=function(_0x15d3ac){for(var _0xf2464=0x0,_0x87a258=events['length'];_0xf2464<_0x87a258;_0xf2464++){var _0x4cdfe4=events[_0xf2464];var _0x583dc8=createListener(_0x13f4('0x5')+_0x4cdfe4,_0x15d3ac);FaxInteractionEvents['on'](_0x4cdfe4,_0x583dc8);}}; \ No newline at end of file +var _0x92fe=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x1691c3,_0x2d14d){var _0x5c123d=function(_0x1a1415){while(--_0x1a1415){_0x1691c3['push'](_0x1691c3['shift']());}};_0x5c123d(++_0x2d14d);}(_0x92fe,0x1f3));var _0xe92f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92fe[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require(_0xe92f('0x0'));var events=[_0xe92f('0x1'),_0xe92f('0x2'),_0xe92f('0x3')];function createListener(_0x19559e,_0x439d44){return function(_0x54b005){_0x439d44[_0xe92f('0x4')](_0x19559e,_0x54b005);};}function removeListener(_0x68afb,_0x1680f9){return function(){FaxInteractionEvents[_0xe92f('0x5')](_0x68afb,_0x1680f9);};}exports[_0xe92f('0x6')]=function(_0x4f48f7){for(var _0x8a4ff9=0x0,_0x969a08=events['length'];_0x8a4ff9<_0x969a08;_0x8a4ff9++){var _0x5f06ed=events[_0x8a4ff9];var _0x50bd18=createListener(_0xe92f('0x7')+_0x5f06ed,_0x4f48f7);FaxInteractionEvents['on'](_0x5f06ed,_0x50bd18);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 5e00d3e..eda4934 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 _0x30e9=['post','create','/:id/messages','/:id/tags','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download'];(function(_0x1ea729,_0x3552bb){var _0x3576c4=function(_0xb12275){while(--_0xb12275){_0x1ea729['push'](_0x1ea729['shift']());}};_0x3576c4(++_0x3552bb);}(_0x30e9,0x158));var _0x930e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x30e9[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x930e('0x0'));var util=require(_0x930e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x930e('0x2'));var router=express[_0x930e('0x3')]();var fs_extra=require(_0x930e('0x4'));var auth=require(_0x930e('0x5'));var interaction=require(_0x930e('0x6'));var config=require(_0x930e('0x7'));var controller=require(_0x930e('0x8'));router[_0x930e('0x9')]('/',auth[_0x930e('0xa')](),controller[_0x930e('0xb')]);router[_0x930e('0x9')](_0x930e('0xc'),auth[_0x930e('0xa')](),controller[_0x930e('0xd')]);router[_0x930e('0x9')](_0x930e('0xe'),auth[_0x930e('0xa')](),controller[_0x930e('0xf')]);router['get']('/:id/messages',auth[_0x930e('0xa')](),controller[_0x930e('0x10')]);router[_0x930e('0x9')](_0x930e('0x11'),auth[_0x930e('0xa')](),controller[_0x930e('0x12')]);router[_0x930e('0x13')]('/',auth[_0x930e('0xa')](),controller[_0x930e('0x14')]);router[_0x930e('0x13')](_0x930e('0x15'),auth[_0x930e('0xa')](),controller['addMessage']);router['post'](_0x930e('0x16'),auth['isAuthenticated'](),interaction[_0x930e('0x17')]('fax',_0x930e('0x18')),controller[_0x930e('0x19')]);router['put']('/:id',auth[_0x930e('0xa')](),interaction['tracked'](_0x930e('0x1a'),_0x930e('0x1b')),controller[_0x930e('0x1c')]);router['delete'](_0x930e('0xe'),auth[_0x930e('0xa')](),interaction[_0x930e('0x17')](_0x930e('0x1a'),_0x930e('0x1d')),controller[_0x930e('0x1e')]);router[_0x930e('0x1f')](_0x930e('0x16'),auth[_0x930e('0xa')](),controller['removeTags']);module[_0x930e('0x20')]=router; \ No newline at end of file +var _0x0806=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','addTags','fax','faxinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','multer'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0806,0x1ef));var _0x6080=function(_0x3cda6a,_0x2673c0){_0x3cda6a=_0x3cda6a-0x0;var _0x4eaec8=_0x0806[_0x3cda6a];return _0x4eaec8;};'use strict';var multer=require(_0x6080('0x0'));var util=require(_0x6080('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6080('0x2'));var router=express[_0x6080('0x3')]();var fs_extra=require(_0x6080('0x4'));var auth=require(_0x6080('0x5'));var interaction=require(_0x6080('0x6'));var config=require('../../config/environment');var controller=require(_0x6080('0x7'));router[_0x6080('0x8')]('/',auth[_0x6080('0x9')](),controller['index']);router[_0x6080('0x8')](_0x6080('0xa'),auth[_0x6080('0x9')](),controller[_0x6080('0xb')]);router[_0x6080('0x8')](_0x6080('0xc'),auth[_0x6080('0x9')](),controller[_0x6080('0xd')]);router[_0x6080('0x8')](_0x6080('0xe'),auth[_0x6080('0x9')](),controller[_0x6080('0xf')]);router['get'](_0x6080('0x10'),auth[_0x6080('0x9')](),controller[_0x6080('0x11')]);router[_0x6080('0x12')]('/',auth[_0x6080('0x9')](),controller[_0x6080('0x13')]);router[_0x6080('0x12')](_0x6080('0xe'),auth[_0x6080('0x9')](),controller[_0x6080('0x14')]);router[_0x6080('0x12')]('/:id/tags',auth[_0x6080('0x9')](),interaction[_0x6080('0x15')]('fax','faxinteraction:addtags'),controller[_0x6080('0x16')]);router['put']('/:id',auth[_0x6080('0x9')](),interaction[_0x6080('0x15')](_0x6080('0x17'),_0x6080('0x18')),controller[_0x6080('0x19')]);router[_0x6080('0x1a')](_0x6080('0xc'),auth['isAuthenticated'](),interaction[_0x6080('0x15')](_0x6080('0x17'),'faxinteraction:destroy'),controller[_0x6080('0x1b')]);router[_0x6080('0x1a')](_0x6080('0x1c'),auth[_0x6080('0x9')](),controller[_0x6080('0x1d')]);module[_0x6080('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 78da86b..ece33e5 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 _0x383d=['medium','BOOLEAN','out','DATE','TEXT'];(function(_0x23ad48,_0x104b01){var _0x199a20=function(_0x4805d0){while(--_0x4805d0){_0x23ad48['push'](_0x23ad48['shift']());}};_0x199a20(++_0x104b01);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd383('0x0')](_0xd383('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xd383('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd383('0x3')),'defaultValue':_0xd383('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd383('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd383('0x4')]}}; \ No newline at end of file +var _0x9de3=['sequelize','TEXT','medium','BOOLEAN','out','DATE'];(function(_0xdd3c42,_0x14e1d7){var _0x9bf118=function(_0x3c072e){while(--_0x3c072e){_0xdd3c42['push'](_0xdd3c42['shift']());}};_0x9bf118(++_0x14e1d7);}(_0x9de3,0xea));var _0x39de=function(_0x2d56e8,_0x5ad430){_0x2d56e8=_0x2d56e8-0x0;var _0x49cfef=_0x9de3[_0x2d56e8];return _0x49cfef;};'use strict';var Sequelize=require(_0x39de('0x0'));module['exports']={'body':{'type':Sequelize[_0x39de('0x1')](_0x39de('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x39de('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x39de('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x39de('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x39de('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 417da1f..fabcc47 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 _0x29e2=['destroy','status','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','include','body','find','params','describe','fax-interactions','fax','read','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE: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','QueryTypes','contact','agent','email','internal','manual','interface','event','accept','acceptmessage','RejectMessage','SELECT','SIP/%s','channel','motionChannel','EventManager','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','attachments','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x48849d,_0x174b98){var _0x424fe8=function(_0x1fc561){while(--_0x1fc561){_0x48849d['push'](_0x48849d['shift']());}};_0x424fe8(++_0x174b98);}(_0x29e2,0x1f0));var _0x229e=function(_0x394cc7,_0x34a8a2){_0x394cc7=_0x394cc7-0x0;var _0x15f617=_0x29e2[_0x394cc7];return _0x15f617;};'use strict';var emlformat=require(_0x229e('0x0'));var rimraf=require(_0x229e('0x1'));var zipdir=require(_0x229e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x229e('0x3'));var moment=require('moment');var BPromise=require(_0x229e('0x4'));var Mustache=require(_0x229e('0x5'));var util=require(_0x229e('0x6'));var path=require('path');var sox=require(_0x229e('0x7'));var csv=require(_0x229e('0x8'));var ejs=require(_0x229e('0x9'));var fs=require('fs');var fs_extra=require(_0x229e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x229e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x229e('0xc'));var toCsv=require(_0x229e('0x8'));var querystring=require('querystring');var Papa=require(_0x229e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x229e('0xe'));var logger=require(_0x229e('0xf'))('api');var utils=require(_0x229e('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x229e('0x11'));var db=require('../../mysqldb')['db'];config[_0x229e('0x12')]=_[_0x229e('0x13')](config['redis'],{'host':_0x229e('0x14'),'port':0x18eb});var socket=require(_0x229e('0x15'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x229e('0x16')](socket);var jayson=require(_0x229e('0x17'));var client=jayson[_0x229e('0x18')][_0x229e('0x19')]({'port':0x232c});var client9002=jayson[_0x229e('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6af2b,_0x1c34d1,_0x28be6d,_0x3b1920){return new BPromise(function(_0x18d737,_0x2189c1){var _0x4f4a95=_0x3b1920||client;return _0x4f4a95[_0x229e('0x1a')](_0xe6af2b,_0x28be6d)['then'](function(_0x4480db){logger[_0x229e('0x1b')](_0x229e('0x1c'),_0x1c34d1,_0x229e('0x1d'));logger[_0x229e('0x1e')](_0x229e('0x1f'),_0x1c34d1,_0x229e('0x1d'),JSON[_0x229e('0x20')](_0x4480db));if(_0x4480db[_0x229e('0x21')]){if(_0x4480db[_0x229e('0x21')][_0x229e('0x22')]===0x1f4){logger['error'](_0x229e('0x1c'),_0x1c34d1,_0x4480db[_0x229e('0x21')][_0x229e('0x23')]);return _0x2189c1(_0x4480db[_0x229e('0x21')]['message']);}logger[_0x229e('0x21')](_0x229e('0x1c'),_0x1c34d1,_0x4480db[_0x229e('0x21')]['message']);return _0x18d737(_0x4480db[_0x229e('0x21')][_0x229e('0x23')]);}else{logger[_0x229e('0x1b')](_0x229e('0x1c'),_0x1c34d1,_0x229e('0x1d'));_0x18d737(_0x4480db[_0x229e('0x24')]['message']);}})[_0x229e('0x25')](function(_0x3cbe27){logger[_0x229e('0x21')]('FaxMessage,\x20%s,\x20%s',_0x1c34d1,_0x3cbe27);_0x2189c1(_0x3cbe27);});});}function respondWithStatusCode(_0x592741,_0x1df24d){_0x1df24d=_0x1df24d||0xcc;return function(_0x5854fa){if(_0x5854fa){return _0x592741[_0x229e('0x26')](_0x1df24d);}return _0x592741['status'](_0x1df24d)[_0x229e('0x27')]();};}function respondWithResult(_0x37778e,_0x23a56e){_0x23a56e=_0x23a56e||0xc8;return function(_0x19dea9){if(_0x19dea9){return _0x37778e['status'](_0x23a56e)['json'](_0x19dea9);}};}function respondWithFilteredResult(_0x48f9a4,_0x364f37){return function(_0x1676be){if(_0x1676be){var _0x561639=typeof _0x364f37[_0x229e('0x28')]===_0x229e('0x29')&&typeof _0x364f37[_0x229e('0x2a')]===_0x229e('0x29');var _0x3ede17=_0x1676be[_0x229e('0x2b')];var _0x5df649=_0x561639?0x0:_0x364f37[_0x229e('0x28')];var _0x4e9659=_0x561639?_0x1676be['count']:_0x364f37[_0x229e('0x28')]+_0x364f37[_0x229e('0x2a')];var _0x3480d2;if(_0x4e9659>=_0x3ede17){_0x4e9659=_0x3ede17;_0x3480d2=0xc8;}else{_0x3480d2=0xce;}_0x48f9a4['status'](_0x3480d2);return _0x48f9a4[_0x229e('0x2c')](_0x229e('0x2d'),_0x5df649+'-'+_0x4e9659+'/'+_0x3ede17)[_0x229e('0x2e')](_0x1676be);}return null;};}function patchUpdates(_0x443e65){return function(_0x3b6385){try{jsonpatch[_0x229e('0x2f')](_0x3b6385,_0x443e65,!![]);}catch(_0x1e2aa7){return BPromise[_0x229e('0x30')](_0x1e2aa7);}return _0x3b6385[_0x229e('0x31')]();};}function saveUpdates(_0x11a489,_0x20c41f){return function(_0x9bac98){if(_0x9bac98){return _0x9bac98[_0x229e('0x32')](_0x11a489)[_0x229e('0x33')](function(_0x5c5abd){return _0x5c5abd;});}return null;};}function removeEntity(_0x2d8c52,_0x565665){return function(_0x508c65){if(_0x508c65){return _0x508c65[_0x229e('0x34')]()[_0x229e('0x33')](function(){_0x2d8c52[_0x229e('0x35')](0xcc)[_0x229e('0x27')]();});}};}function handleEntityNotFound(_0x45792c,_0x5928ad){return function(_0xd2091f){if(!_0xd2091f){_0x45792c[_0x229e('0x26')](0x194);}return _0xd2091f;};}function handleError(_0x18044b,_0x554a73){_0x554a73=_0x554a73||0x1f4;return function(_0x3f5d70){logger[_0x229e('0x21')](_0x3f5d70[_0x229e('0x36')]);if(_0x3f5d70['name']){delete _0x3f5d70[_0x229e('0x37')];}_0x18044b[_0x229e('0x35')](_0x554a73)[_0x229e('0x38')](_0x3f5d70);};}exports[_0x229e('0x39')]=function(_0x14c8c7,_0x16d9db){var _0x4ab028={},_0x2e49b8={},_0x24a474={'count':0x0,'rows':[]};var _0x39a8bd=_[_0x229e('0x3a')](db[_0x229e('0x3b')][_0x229e('0x3c')],function(_0x50c571){return{'name':_0x50c571[_0x229e('0x3d')],'type':_0x50c571[_0x229e('0x3e')][_0x229e('0x3f')]};});_0x2e49b8[_0x229e('0x40')]=_[_0x229e('0x3a')](_0x39a8bd,'name');_0x2e49b8['query']=_[_0x229e('0x41')](_0x14c8c7[_0x229e('0x42')]);_0x2e49b8[_0x229e('0x43')]=_['intersection'](_0x2e49b8[_0x229e('0x40')],_0x2e49b8[_0x229e('0x42')]);_0x4ab028['attributes']=_[_0x229e('0x44')](_0x2e49b8['model'],qs['fields'](_0x14c8c7['query'][_0x229e('0x45')]));_0x4ab028['attributes']=_0x4ab028[_0x229e('0x46')][_0x229e('0x47')]?_0x4ab028[_0x229e('0x46')]:_0x2e49b8['model'];if(!_0x14c8c7['query'][_0x229e('0x48')]('nolimit')){_0x4ab028['limit']=qs[_0x229e('0x2a')](_0x14c8c7[_0x229e('0x42')]['limit']);_0x4ab028['offset']=qs['offset'](_0x14c8c7[_0x229e('0x42')]['offset']);}_0x4ab028[_0x229e('0x49')]=qs[_0x229e('0x4a')](_0x14c8c7[_0x229e('0x42')][_0x229e('0x4a')]);_0x4ab028[_0x229e('0x4b')]=qs[_0x229e('0x43')](_['pick'](_0x14c8c7['query'],_0x2e49b8[_0x229e('0x43')]),_0x39a8bd);if(_0x14c8c7[_0x229e('0x42')][_0x229e('0x4c')]){_0x4ab028[_0x229e('0x4b')]=_[_0x229e('0x4d')](_0x4ab028[_0x229e('0x4b')],{'$or':_[_0x229e('0x3a')](_0x39a8bd,function(_0xf6300a){if(_0xf6300a[_0x229e('0x3e')]!==_0x229e('0x4e')){var _0x3b989d={};_0x3b989d[_0xf6300a[_0x229e('0x37')]]={'$like':'%'+_0x14c8c7['query']['filter']+'%'};return _0x3b989d;}})});}_0x4ab028=_[_0x229e('0x4d')]({},_0x4ab028,_0x14c8c7[_0x229e('0x4f')]);var _0x483a7b={'where':_0x4ab028['where']};return db[_0x229e('0x3b')][_0x229e('0x2b')](_0x483a7b)[_0x229e('0x33')](function(_0x35ba4c){_0x24a474[_0x229e('0x2b')]=_0x35ba4c;if(_0x14c8c7['query'][_0x229e('0x50')]){_0x4ab028['include']=[{'all':!![]}];}return db['FaxMessage'][_0x229e('0x51')](_0x4ab028);})[_0x229e('0x33')](function(_0x25991e){_0x24a474[_0x229e('0x52')]=_0x25991e;return _0x24a474;})[_0x229e('0x33')](respondWithFilteredResult(_0x16d9db,_0x4ab028))[_0x229e('0x25')](handleError(_0x16d9db,null));};exports['show']=function(_0x3efc6,_0x3e623a){var _0x1f4aed={'raw':!![],'where':{'id':_0x3efc6['params']['id']}},_0x35ccdd={};_0x35ccdd['model']=_[_0x229e('0x41')](db['FaxMessage'][_0x229e('0x3c')]);_0x35ccdd[_0x229e('0x42')]=_[_0x229e('0x41')](_0x3efc6[_0x229e('0x42')]);_0x35ccdd[_0x229e('0x43')]=_[_0x229e('0x44')](_0x35ccdd[_0x229e('0x40')],_0x35ccdd['query']);_0x1f4aed[_0x229e('0x46')]=_[_0x229e('0x44')](_0x35ccdd[_0x229e('0x40')],qs[_0x229e('0x45')](_0x3efc6['query'][_0x229e('0x45')]));_0x1f4aed[_0x229e('0x46')]=_0x1f4aed['attributes'][_0x229e('0x47')]?_0x1f4aed[_0x229e('0x46')]:_0x35ccdd[_0x229e('0x40')];if(_0x3efc6[_0x229e('0x42')]['includeAll']){_0x1f4aed[_0x229e('0x53')]=[{'all':!![]}];}_0x1f4aed=_[_0x229e('0x4d')]({},_0x1f4aed,_0x3efc6[_0x229e('0x4f')]);return db['FaxMessage']['find'](_0x1f4aed)['then'](handleEntityNotFound(_0x3e623a,null))[_0x229e('0x33')](respondWithResult(_0x3e623a,null))[_0x229e('0x25')](handleError(_0x3e623a,null));};exports[_0x229e('0x32')]=function(_0xdf5b20,_0x121e38){if(_0xdf5b20[_0x229e('0x54')]['id']){delete _0xdf5b20[_0x229e('0x54')]['id'];}return db[_0x229e('0x3b')][_0x229e('0x55')]({'where':{'id':_0xdf5b20[_0x229e('0x56')]['id']}})[_0x229e('0x33')](handleEntityNotFound(_0x121e38,null))[_0x229e('0x33')](saveUpdates(_0xdf5b20['body'],null))[_0x229e('0x33')](respondWithResult(_0x121e38,null))[_0x229e('0x25')](handleError(_0x121e38,null));};exports['destroy']=function(_0x1c4d06,_0x8a1ce4){return db[_0x229e('0x3b')][_0x229e('0x55')]({'where':{'id':_0x1c4d06['params']['id']}})[_0x229e('0x33')](handleEntityNotFound(_0x8a1ce4,null))[_0x229e('0x33')](removeEntity(_0x8a1ce4,null))['catch'](handleError(_0x8a1ce4,null));};exports[_0x229e('0x57')]=function(_0x28bba0,_0xbb20e3){return db[_0x229e('0x3b')]['describe']()[_0x229e('0x33')](respondWithResult(_0xbb20e3,null))[_0x229e('0x25')](handleError(_0xbb20e3,null));};var interaction_log=require('../../config/logger')(_0x229e('0x58'));exports['accept']=function(_0x4c3a25,_0x1dd5cb,_0x289773){var _0x38ba48={'agent':{},'channel':_0x229e('0x59')};if(_0x4c3a25[_0x229e('0x54')]['id']){delete _0x4c3a25['body']['id'];}_0x4c3a25[_0x229e('0x54')][_0x229e('0x5a')]=!![];_0x4c3a25['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')]=_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')]||_0x4c3a25[_0x229e('0x5c')]['id'];_0x38ba48['agent']['id']=_0x4c3a25['body'][_0x229e('0x5b')];return db[_0x229e('0x3b')]['find']({'where':{'id':_0x4c3a25[_0x229e('0x56')]['id'],'UserId':null}})[_0x229e('0x33')](handleEntityNotFound(_0x1dd5cb,null))['then'](saveUpdates(_0x4c3a25[_0x229e('0x54')],null))[_0x229e('0x33')](function(_0x307fbd){if(_0x307fbd){_0x38ba48['message']=_0x307fbd[_0x229e('0x5d')]({'plain':!![]});return db[_0x229e('0x5e')][_0x229e('0x55')]({'where':{'id':_0x307fbd[_0x229e('0x5f')]}});}return null;})[_0x229e('0x33')](handleEntityNotFound(_0x1dd5cb,null))[_0x229e('0x33')](function(_0x34ba16){if(_0x34ba16){return _0x34ba16['update']({'UserId':_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')],'read1stAt':_[_0x229e('0x60')](_0x34ba16[_0x229e('0x61')])?moment()[_0x229e('0x62')](_0x229e('0x63')):undefined});}return null;})['then'](function(_0x270510){if(_0x270510){_0x38ba48[_0x229e('0x64')]=_0x270510['get']({'plain':!![]});interaction_log['info'](_0x229e('0x65'),_0x4c3a25[_0x229e('0x5c')]['id'],_0x4c3a25[_0x229e('0x5c')][_0x229e('0x37')],_0x4c3a25[_0x229e('0x5c')][_0x229e('0x66')],_0x38ba48[_0x229e('0x64')]['id'],_0x4c3a25[_0x229e('0x54')]?JSON['stringify'](_0x4c3a25[_0x229e('0x54')]):_0x229e('0x67'));return respondWithRpcPromise('AcceptMessage',_0x229e('0x68'),_0x38ba48);}return null;})['then'](function(_0x44d960){var _0x1f9dbc=_0x229e('0x69')+_0x44d960[_0x229e('0x23')][_0x229e('0x6a')];return db[_0x229e('0x6b')][_0x229e('0x42')](_0x1f9dbc,{'type':db[_0x229e('0x6c')][_0x229e('0x6d')]['SELECT'],'raw':!![]})[_0x229e('0x33')](function(_0x4cdba2){return _0x4cdba2;});})[_0x229e('0x33')](function(_0x671a94){if(_0x671a94){_0x38ba48['message'][_0x229e('0x6e')]=_0x671a94[0x0];if(!_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')])return;return db['User']['find']({'where':{'id':_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')],'role':_0x229e('0x6f')},'attributes':['id',_0x229e('0x37'),'fullname',_0x229e('0x70'),_0x229e('0x71')],'raw':!![]});}return null;})[_0x229e('0x33')](function(_0x3b5b6a){if(!_0x3b5b6a)return null;_0x38ba48[_0x229e('0x23')]['agent']=_0x3b5b6a;return _0x38ba48;})['then'](function(_0x12dc18){if(_0x12dc18){if(_0x4c3a25[_0x229e('0x54')][_0x229e('0x72')]){_0x38ba48[_0x229e('0x23')][_0x229e('0x73')]=util['format']('SIP/%s',_0x4c3a25[_0x229e('0x5c')][_0x229e('0x37')]);_0x38ba48[_0x229e('0x23')]['channel']=_0x38ba48['channel'];_0x38ba48[_0x229e('0x23')]['motionChannel']=_0x38ba48['channel'];_0x38ba48[_0x229e('0x23')][_0x229e('0x74')]=_0x229e('0x75');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x229e('0x76'),'message':_0x38ba48[_0x229e('0x23')]},client9002)[_0x229e('0x33')](function(){return _0x38ba48;});}return _0x38ba48;}return null;})['then'](respondWithResult(_0x1dd5cb,null))[_0x229e('0x25')](handleError(_0x1dd5cb,null));};var interaction_log=require(_0x229e('0xf'))('fax-interactions');exports[_0x229e('0x30')]=function(_0x2d12d2,_0x4eae2d,_0x4c0771){var _0x42b10f={'agent':{},'channel':'fax'};if(_0x2d12d2[_0x229e('0x54')]['id']){delete _0x2d12d2[_0x229e('0x54')]['id'];}_0x2d12d2['body'][_0x229e('0x5b')]=_0x2d12d2['body']['UserId']||_0x2d12d2[_0x229e('0x5c')]['id'];_0x42b10f[_0x229e('0x6f')]['id']=_0x2d12d2['body'][_0x229e('0x5b')];return db['FaxMessage']['find']({'where':{'id':_0x2d12d2[_0x229e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4eae2d,null))['then'](function(_0xd3ae61){if(_0xd3ae61){_0x42b10f['message']=_0xd3ae61[_0x229e('0x5d')]({'plain':!![]});return db[_0x229e('0x5e')][_0x229e('0x55')]({'where':{'id':_0xd3ae61[_0x229e('0x5f')]}});}return null;})[_0x229e('0x33')](handleEntityNotFound(_0x4eae2d,null))[_0x229e('0x33')](function(_0x5d6825){if(_0x5d6825){_0x42b10f['interaction']=_0x5d6825['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d12d2[_0x229e('0x5c')]['id'],_0x2d12d2[_0x229e('0x5c')]['name'],_0x2d12d2[_0x229e('0x5c')][_0x229e('0x66')],_0x42b10f[_0x229e('0x64')]['id'],_0x2d12d2[_0x229e('0x54')]?JSON[_0x229e('0x20')](_0x2d12d2[_0x229e('0x54')]):_0x229e('0x67'));return respondWithRpcPromise(_0x229e('0x77'),'rejectMessage',_0x42b10f);}return null;})['then'](function(_0x1c53ac){var _0x1a8e62='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c53ac['message'][_0x229e('0x6a')];return db[_0x229e('0x6b')][_0x229e('0x42')](_0x1a8e62,{'type':db['Sequelize'][_0x229e('0x6d')][_0x229e('0x78')],'raw':!![]})[_0x229e('0x33')](function(_0xfad688){return _0xfad688;});})[_0x229e('0x33')](function(_0x533598){if(_0x533598){_0x42b10f[_0x229e('0x23')][_0x229e('0x6e')]=_0x533598[0x0];if(!_0x2d12d2[_0x229e('0x54')][_0x229e('0x5b')])return;return db['User'][_0x229e('0x55')]({'where':{'id':_0x2d12d2['body'][_0x229e('0x5b')],'role':'agent'},'attributes':['id',_0x229e('0x37'),'fullname',_0x229e('0x70'),_0x229e('0x71')],'raw':!![]});}return null;})['then'](function(_0x121bd1){if(!_0x121bd1)return null;_0x42b10f[_0x229e('0x23')][_0x229e('0x6f')]=_0x121bd1;return _0x42b10f;})[_0x229e('0x33')](function(_0x369084){if(_0x369084){_0x369084['message'][_0x229e('0x73')]=util[_0x229e('0x62')](_0x229e('0x79'),_0x2d12d2[_0x229e('0x5c')]['name']);_0x369084['message'][_0x229e('0x7a')]=_0x42b10f[_0x229e('0x7a')];_0x369084[_0x229e('0x23')][_0x229e('0x7b')]=_0x42b10f[_0x229e('0x7a')];_0x369084[_0x229e('0x23')][_0x229e('0x74')]=_0x229e('0x30');respondWithRpcPromise(_0x229e('0x7c'),_0x229e('0x7c'),{'event':'rejectmessage','message':_0x369084['message']},client9002);return _0x42b10f;}return null;})['then'](respondWithResult(_0x4eae2d,null))[_0x229e('0x25')](handleError(_0x4eae2d,null));};exports['create']=function(_0xd2d79c,_0x57660a){var _0x5d6fa1;return db['FaxMessage'][_0x229e('0x7d')](_0xd2d79c['body'],{})['then'](function(_0x2ff4f9){_0x5d6fa1=_0x2ff4f9;return db[_0x229e('0x7e')][_0x229e('0x7f')]({'where':{'id':_0x5d6fa1[_0x229e('0x6a')]}});})['then'](function(_0x51749c){if(_[_0x229e('0x60')](_0x51749c)){return;}else{_0x5d6fa1['fax']=_0x51749c['fax'];return db[_0x229e('0x80')][_0x229e('0x7f')]({'where':{'id':_0x5d6fa1[_0x229e('0x81')]}});}})[_0x229e('0x33')](function(_0x1f8beb){return respondWithRpcPromise(_0x229e('0x82'),_0x229e('0x82'),{'FaxAccountId':_[_0x229e('0x60')](_0xd2d79c[_0x229e('0x54')])?undefined:_0xd2d79c[_0x229e('0x54')]['FaxAccountId'],'path':_['isNil'](_0x1f8beb)?undefined:util[_0x229e('0x62')](_0x229e('0x83'),_0x1f8beb[_0x229e('0x84')]),'fax':_[_0x229e('0x60')](_0x5d6fa1[_0x229e('0x59')])?undefined:_0x5d6fa1[_0x229e('0x59')],'AttachmentId':_0x5d6fa1[_0x229e('0x81')]},client9002);})[_0x229e('0x33')](respondWithResult(_0x57660a,0xc9))[_0x229e('0x25')](handleError(_0x57660a,null));};exports[_0x229e('0x85')]=function(_0x1969c6,_0x3c3a0f){var _0x5549a0=path[_0x229e('0x86')](config[_0x229e('0x87')],'server','files',_0x229e('0x88'));return db[_0x229e('0x3b')][_0x229e('0x55')]({'where':{'id':_0x1969c6[_0x229e('0x56')]['id']},'include':[{'model':db[_0x229e('0x80')],'as':_0x229e('0x80')}]})[_0x229e('0x33')](handleEntityNotFound(_0x3c3a0f,null))[_0x229e('0x33')](function(_0x341085){if(_0x341085){return _0x3c3a0f['download'](path['join'](_0x5549a0,_0x341085[_0x229e('0x80')]['basename']));}})[_0x229e('0x25')](handleError(_0x3c3a0f,null));}; \ No newline at end of file +var _0x0c2f=['download','join','root','server','files','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','create','findOne','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId'];(function(_0x1fa082,_0x387dd3){var _0x16cb37=function(_0x3a47ec){while(--_0x3a47ec){_0x1fa082['push'](_0x1fa082['shift']());}};_0x16cb37(++_0x387dd3);}(_0x0c2f,0x99));var _0xf0c2=function(_0x38a653,_0x1a5872){_0x38a653=_0x38a653-0x0;var _0x370492=_0x0c2f[_0x38a653];return _0x370492;};'use strict';var emlformat=require(_0xf0c2('0x0'));var rimraf=require(_0xf0c2('0x1'));var zipdir=require(_0xf0c2('0x2'));var jsonpatch=require(_0xf0c2('0x3'));var rp=require('request-promise');var moment=require(_0xf0c2('0x4'));var BPromise=require(_0xf0c2('0x5'));var Mustache=require(_0xf0c2('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf0c2('0x7'));var csv=require(_0xf0c2('0x8'));var ejs=require(_0xf0c2('0x9'));var fs=require('fs');var fs_extra=require(_0xf0c2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf0c2('0xb'));var jsforce=require(_0xf0c2('0xc'));var deskjs=require(_0xf0c2('0xd'));var toCsv=require(_0xf0c2('0x8'));var querystring=require(_0xf0c2('0xe'));var Papa=require(_0xf0c2('0xf'));var Redis=require('ioredis');var authService=require(_0xf0c2('0x10'));var qs=require(_0xf0c2('0x11'));var as=require(_0xf0c2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0c2('0x13'))(_0xf0c2('0x14'));var utils=require(_0xf0c2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf0c2('0x16'));var db=require(_0xf0c2('0x17'))['db'];config[_0xf0c2('0x18')]=_[_0xf0c2('0x19')](config[_0xf0c2('0x18')],{'host':_0xf0c2('0x1a'),'port':0x18eb});var socket=require(_0xf0c2('0x1b'))(new Redis(config[_0xf0c2('0x18')]));require(_0xf0c2('0x1c'))[_0xf0c2('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf0c2('0x1e')][_0xf0c2('0x1f')]({'port':0x232c});var client9002=jayson[_0xf0c2('0x1e')][_0xf0c2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5b4fd1,_0x2e6c9c,_0x13bb8e,_0x3fcf3a){return new BPromise(function(_0xfbde41,_0x15a519){var _0x41ac46=_0x3fcf3a||client;return _0x41ac46[_0xf0c2('0x20')](_0x5b4fd1,_0x13bb8e)[_0xf0c2('0x21')](function(_0x13e6a3){logger['info'](_0xf0c2('0x22'),_0x2e6c9c,'request\x20sent');logger[_0xf0c2('0x23')](_0xf0c2('0x24'),_0x2e6c9c,'request\x20sent',JSON['stringify'](_0x13e6a3));if(_0x13e6a3[_0xf0c2('0x25')]){if(_0x13e6a3[_0xf0c2('0x25')]['code']===0x1f4){logger[_0xf0c2('0x25')](_0xf0c2('0x22'),_0x2e6c9c,_0x13e6a3[_0xf0c2('0x25')][_0xf0c2('0x26')]);return _0x15a519(_0x13e6a3[_0xf0c2('0x25')]['message']);}logger[_0xf0c2('0x25')](_0xf0c2('0x22'),_0x2e6c9c,_0x13e6a3[_0xf0c2('0x25')][_0xf0c2('0x26')]);return _0xfbde41(_0x13e6a3[_0xf0c2('0x25')][_0xf0c2('0x26')]);}else{logger[_0xf0c2('0x27')](_0xf0c2('0x22'),_0x2e6c9c,_0xf0c2('0x28'));_0xfbde41(_0x13e6a3['result'][_0xf0c2('0x26')]);}})[_0xf0c2('0x29')](function(_0x4119af){logger['error'](_0xf0c2('0x22'),_0x2e6c9c,_0x4119af);_0x15a519(_0x4119af);});});}function respondWithStatusCode(_0x18f502,_0x2b78eb){_0x2b78eb=_0x2b78eb||0xcc;return function(_0xa78a48){if(_0xa78a48){return _0x18f502[_0xf0c2('0x2a')](_0x2b78eb);}return _0x18f502['status'](_0x2b78eb)[_0xf0c2('0x2b')]();};}function respondWithResult(_0x3441a8,_0xd172b){_0xd172b=_0xd172b||0xc8;return function(_0x1f2421){if(_0x1f2421){return _0x3441a8[_0xf0c2('0x2c')](_0xd172b)[_0xf0c2('0x2d')](_0x1f2421);}};}function respondWithFilteredResult(_0x1172a5,_0x1e1902){return function(_0x36641c){if(_0x36641c){var _0x14d7bb=typeof _0x1e1902['offset']===_0xf0c2('0x2e')&&typeof _0x1e1902[_0xf0c2('0x2f')]===_0xf0c2('0x2e');var _0x3cf09c=_0x36641c[_0xf0c2('0x30')];var _0x531ae6=_0x14d7bb?0x0:_0x1e1902['offset'];var _0x47942c=_0x14d7bb?_0x36641c[_0xf0c2('0x30')]:_0x1e1902[_0xf0c2('0x31')]+_0x1e1902['limit'];var _0x2b1d56;if(_0x47942c>=_0x3cf09c){_0x47942c=_0x3cf09c;_0x2b1d56=0xc8;}else{_0x2b1d56=0xce;}_0x1172a5[_0xf0c2('0x2c')](_0x2b1d56);return _0x1172a5['set'](_0xf0c2('0x32'),_0x531ae6+'-'+_0x47942c+'/'+_0x3cf09c)[_0xf0c2('0x2d')](_0x36641c);}return null;};}function patchUpdates(_0xd37f74){return function(_0x16c47a){try{jsonpatch[_0xf0c2('0x33')](_0x16c47a,_0xd37f74,!![]);}catch(_0x2fe3a8){return BPromise[_0xf0c2('0x34')](_0x2fe3a8);}return _0x16c47a[_0xf0c2('0x35')]();};}function saveUpdates(_0x3c4723,_0x41bc91){return function(_0x46f806){if(_0x46f806){return _0x46f806[_0xf0c2('0x36')](_0x3c4723)[_0xf0c2('0x21')](function(_0x329f85){return _0x329f85;});}return null;};}function removeEntity(_0x356fd3,_0x2df46d){return function(_0x67786f){if(_0x67786f){return _0x67786f[_0xf0c2('0x37')]()[_0xf0c2('0x21')](function(){_0x356fd3[_0xf0c2('0x2c')](0xcc)[_0xf0c2('0x2b')]();});}};}function handleEntityNotFound(_0x180aec,_0x1f72e1){return function(_0x2206e0){if(!_0x2206e0){_0x180aec[_0xf0c2('0x2a')](0x194);}return _0x2206e0;};}function handleError(_0xd2d16a,_0x54d5e6){_0x54d5e6=_0x54d5e6||0x1f4;return function(_0x5eb446){logger[_0xf0c2('0x25')](_0x5eb446[_0xf0c2('0x38')]);if(_0x5eb446[_0xf0c2('0x39')]){delete _0x5eb446['name'];}_0xd2d16a[_0xf0c2('0x2c')](_0x54d5e6)[_0xf0c2('0x3a')](_0x5eb446);};}exports[_0xf0c2('0x3b')]=function(_0x253d5c,_0x2a1e4c){var _0x58e218={},_0x486faa={},_0x296757={'count':0x0,'rows':[]};var _0x2ead75=_[_0xf0c2('0x3c')](db[_0xf0c2('0x3d')][_0xf0c2('0x3e')],function(_0x4ccb0d){return{'name':_0x4ccb0d[_0xf0c2('0x3f')],'type':_0x4ccb0d[_0xf0c2('0x40')][_0xf0c2('0x41')]};});_0x486faa[_0xf0c2('0x42')]=_[_0xf0c2('0x3c')](_0x2ead75,'name');_0x486faa['query']=_[_0xf0c2('0x43')](_0x253d5c[_0xf0c2('0x44')]);_0x486faa['filters']=_[_0xf0c2('0x45')](_0x486faa['model'],_0x486faa[_0xf0c2('0x44')]);_0x58e218[_0xf0c2('0x46')]=_[_0xf0c2('0x45')](_0x486faa[_0xf0c2('0x42')],qs[_0xf0c2('0x47')](_0x253d5c[_0xf0c2('0x44')][_0xf0c2('0x47')]));_0x58e218['attributes']=_0x58e218['attributes'][_0xf0c2('0x48')]?_0x58e218[_0xf0c2('0x46')]:_0x486faa[_0xf0c2('0x42')];if(!_0x253d5c[_0xf0c2('0x44')][_0xf0c2('0x49')](_0xf0c2('0x4a'))){_0x58e218[_0xf0c2('0x2f')]=qs['limit'](_0x253d5c[_0xf0c2('0x44')][_0xf0c2('0x2f')]);_0x58e218['offset']=qs[_0xf0c2('0x31')](_0x253d5c[_0xf0c2('0x44')]['offset']);}_0x58e218[_0xf0c2('0x4b')]=qs[_0xf0c2('0x4c')](_0x253d5c[_0xf0c2('0x44')][_0xf0c2('0x4c')]);_0x58e218[_0xf0c2('0x4d')]=qs[_0xf0c2('0x4e')](_[_0xf0c2('0x4f')](_0x253d5c['query'],_0x486faa[_0xf0c2('0x4e')]),_0x2ead75);if(_0x253d5c[_0xf0c2('0x44')][_0xf0c2('0x50')]){_0x58e218['where']=_['merge'](_0x58e218[_0xf0c2('0x4d')],{'$or':_[_0xf0c2('0x3c')](_0x2ead75,function(_0x4f27be){if(_0x4f27be[_0xf0c2('0x40')]!==_0xf0c2('0x51')){var _0x4e0db9={};_0x4e0db9[_0x4f27be[_0xf0c2('0x39')]]={'$like':'%'+_0x253d5c[_0xf0c2('0x44')][_0xf0c2('0x50')]+'%'};return _0x4e0db9;}})});}_0x58e218=_[_0xf0c2('0x52')]({},_0x58e218,_0x253d5c[_0xf0c2('0x53')]);var _0x2939df={'where':_0x58e218[_0xf0c2('0x4d')]};return db[_0xf0c2('0x3d')][_0xf0c2('0x30')](_0x2939df)['then'](function(_0x10cf2a){_0x296757[_0xf0c2('0x30')]=_0x10cf2a;if(_0x253d5c[_0xf0c2('0x44')][_0xf0c2('0x54')]){_0x58e218[_0xf0c2('0x55')]=[{'all':!![]}];}return db[_0xf0c2('0x3d')][_0xf0c2('0x56')](_0x58e218);})[_0xf0c2('0x21')](function(_0x1610b9){_0x296757[_0xf0c2('0x57')]=_0x1610b9;return _0x296757;})[_0xf0c2('0x21')](respondWithFilteredResult(_0x2a1e4c,_0x58e218))['catch'](handleError(_0x2a1e4c,null));};exports[_0xf0c2('0x58')]=function(_0x348613,_0x494df4){var _0xfd0fc0={'raw':!![],'where':{'id':_0x348613[_0xf0c2('0x59')]['id']}},_0x37ef9c={};_0x37ef9c[_0xf0c2('0x42')]=_['keys'](db[_0xf0c2('0x3d')][_0xf0c2('0x3e')]);_0x37ef9c[_0xf0c2('0x44')]=_[_0xf0c2('0x43')](_0x348613[_0xf0c2('0x44')]);_0x37ef9c[_0xf0c2('0x4e')]=_[_0xf0c2('0x45')](_0x37ef9c[_0xf0c2('0x42')],_0x37ef9c[_0xf0c2('0x44')]);_0xfd0fc0[_0xf0c2('0x46')]=_['intersection'](_0x37ef9c[_0xf0c2('0x42')],qs[_0xf0c2('0x47')](_0x348613[_0xf0c2('0x44')]['fields']));_0xfd0fc0['attributes']=_0xfd0fc0['attributes'][_0xf0c2('0x48')]?_0xfd0fc0[_0xf0c2('0x46')]:_0x37ef9c[_0xf0c2('0x42')];if(_0x348613['query'][_0xf0c2('0x54')]){_0xfd0fc0['include']=[{'all':!![]}];}_0xfd0fc0=_[_0xf0c2('0x52')]({},_0xfd0fc0,_0x348613[_0xf0c2('0x53')]);return db[_0xf0c2('0x3d')][_0xf0c2('0x5a')](_0xfd0fc0)['then'](handleEntityNotFound(_0x494df4,null))[_0xf0c2('0x21')](respondWithResult(_0x494df4,null))['catch'](handleError(_0x494df4,null));};exports['update']=function(_0xbd4840,_0x4b77d0){if(_0xbd4840['body']['id']){delete _0xbd4840['body']['id'];}return db['FaxMessage'][_0xf0c2('0x5a')]({'where':{'id':_0xbd4840[_0xf0c2('0x59')]['id']}})[_0xf0c2('0x21')](handleEntityNotFound(_0x4b77d0,null))['then'](saveUpdates(_0xbd4840[_0xf0c2('0x5b')],null))[_0xf0c2('0x21')](respondWithResult(_0x4b77d0,null))[_0xf0c2('0x29')](handleError(_0x4b77d0,null));};exports[_0xf0c2('0x37')]=function(_0x36d2e8,_0x153e74){return db['FaxMessage'][_0xf0c2('0x5a')]({'where':{'id':_0x36d2e8[_0xf0c2('0x59')]['id']}})[_0xf0c2('0x21')](handleEntityNotFound(_0x153e74,null))[_0xf0c2('0x21')](removeEntity(_0x153e74,null))[_0xf0c2('0x29')](handleError(_0x153e74,null));};exports['describe']=function(_0x5d9532,_0x550eb6){return db['FaxMessage'][_0xf0c2('0x5c')]()[_0xf0c2('0x21')](respondWithResult(_0x550eb6,null))[_0xf0c2('0x29')](handleError(_0x550eb6,null));};var interaction_log=require('../../config/logger')(_0xf0c2('0x5d'));exports[_0xf0c2('0x5e')]=function(_0x11d944,_0x45dc09,_0x138f12){var _0x156f4c={'agent':{},'channel':_0xf0c2('0x5f')};if(_0x11d944[_0xf0c2('0x5b')]['id']){delete _0x11d944[_0xf0c2('0x5b')]['id'];}_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x60')]=!![];_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x61')]=moment()[_0xf0c2('0x62')](_0xf0c2('0x63'));_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x64')]=_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x64')]||_0x11d944[_0xf0c2('0x65')]['id'];_0x156f4c[_0xf0c2('0x66')]['id']=_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x64')];return db[_0xf0c2('0x3d')]['find']({'where':{'id':_0x11d944['params']['id'],'UserId':null}})[_0xf0c2('0x21')](handleEntityNotFound(_0x45dc09,null))[_0xf0c2('0x21')](saveUpdates(_0x11d944['body'],null))['then'](function(_0x50fdde){if(_0x50fdde){_0x156f4c[_0xf0c2('0x26')]=_0x50fdde[_0xf0c2('0x67')]({'plain':!![]});return db[_0xf0c2('0x68')][_0xf0c2('0x5a')]({'where':{'id':_0x50fdde[_0xf0c2('0x69')]}});}return null;})[_0xf0c2('0x21')](handleEntityNotFound(_0x45dc09,null))[_0xf0c2('0x21')](function(_0x12dfa4){if(_0x12dfa4){return _0x12dfa4[_0xf0c2('0x36')]({'UserId':_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x64')],'read1stAt':_[_0xf0c2('0x6a')](_0x12dfa4[_0xf0c2('0x6b')])?moment()[_0xf0c2('0x62')](_0xf0c2('0x63')):undefined});}return null;})[_0xf0c2('0x21')](function(_0x33bfe1){if(_0x33bfe1){_0x156f4c[_0xf0c2('0x6c')]=_0x33bfe1['get']({'plain':!![]});interaction_log[_0xf0c2('0x27')](_0xf0c2('0x6d'),_0x11d944[_0xf0c2('0x65')]['id'],_0x11d944[_0xf0c2('0x65')][_0xf0c2('0x39')],_0x11d944[_0xf0c2('0x65')][_0xf0c2('0x6e')],_0x156f4c[_0xf0c2('0x6c')]['id'],_0x11d944[_0xf0c2('0x5b')]?JSON[_0xf0c2('0x6f')](_0x11d944['body']):_0xf0c2('0x70'));return respondWithRpcPromise(_0xf0c2('0x71'),_0xf0c2('0x72'),_0x156f4c);}return null;})['then'](function(_0x41a675){var _0x42668e=_0xf0c2('0x73')+_0x41a675[_0xf0c2('0x26')][_0xf0c2('0x74')];return db[_0xf0c2('0x75')]['query'](_0x42668e,{'type':db[_0xf0c2('0x76')][_0xf0c2('0x77')][_0xf0c2('0x78')],'raw':!![]})[_0xf0c2('0x21')](function(_0xab8a59){return _0xab8a59;});})['then'](function(_0x3727fb){if(_0x3727fb){_0x156f4c[_0xf0c2('0x26')][_0xf0c2('0x79')]=_0x3727fb[0x0];if(!_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x64')])return;return db[_0xf0c2('0x7a')][_0xf0c2('0x5a')]({'where':{'id':_0x11d944[_0xf0c2('0x5b')]['UserId'],'role':_0xf0c2('0x66')},'attributes':['id',_0xf0c2('0x39'),_0xf0c2('0x7b'),_0xf0c2('0x7c'),_0xf0c2('0x7d')],'raw':!![]});}return null;})[_0xf0c2('0x21')](function(_0x588b98){if(!_0x588b98)return null;_0x156f4c[_0xf0c2('0x26')][_0xf0c2('0x66')]=_0x588b98;return _0x156f4c;})[_0xf0c2('0x21')](function(_0x142df6){if(_0x142df6){if(_0x11d944[_0xf0c2('0x5b')][_0xf0c2('0x7e')]){_0x156f4c[_0xf0c2('0x26')][_0xf0c2('0x7f')]=util[_0xf0c2('0x62')]('SIP/%s',_0x11d944['user'][_0xf0c2('0x39')]);_0x156f4c[_0xf0c2('0x26')][_0xf0c2('0x80')]=_0x156f4c[_0xf0c2('0x80')];_0x156f4c[_0xf0c2('0x26')]['motionChannel']=_0x156f4c[_0xf0c2('0x80')];_0x156f4c[_0xf0c2('0x26')][_0xf0c2('0x81')]=_0xf0c2('0x5e');return respondWithRpcPromise(_0xf0c2('0x82'),'EventManager',{'event':_0xf0c2('0x83'),'message':_0x156f4c[_0xf0c2('0x26')]},client9002)[_0xf0c2('0x21')](function(){return _0x156f4c;});}return _0x156f4c;}return null;})[_0xf0c2('0x21')](respondWithResult(_0x45dc09,null))[_0xf0c2('0x29')](handleError(_0x45dc09,null));};var interaction_log=require(_0xf0c2('0x13'))(_0xf0c2('0x5d'));exports[_0xf0c2('0x34')]=function(_0x5058a9,_0x272122,_0x3488d1){var _0x5c0488={'agent':{},'channel':_0xf0c2('0x5f')};if(_0x5058a9[_0xf0c2('0x5b')]['id']){delete _0x5058a9[_0xf0c2('0x5b')]['id'];}_0x5058a9['body'][_0xf0c2('0x64')]=_0x5058a9[_0xf0c2('0x5b')][_0xf0c2('0x64')]||_0x5058a9[_0xf0c2('0x65')]['id'];_0x5c0488[_0xf0c2('0x66')]['id']=_0x5058a9[_0xf0c2('0x5b')][_0xf0c2('0x64')];return db[_0xf0c2('0x3d')]['find']({'where':{'id':_0x5058a9[_0xf0c2('0x59')]['id'],'UserId':null}})[_0xf0c2('0x21')](handleEntityNotFound(_0x272122,null))[_0xf0c2('0x21')](function(_0x19ced0){if(_0x19ced0){_0x5c0488[_0xf0c2('0x26')]=_0x19ced0[_0xf0c2('0x67')]({'plain':!![]});return db['FaxInteraction'][_0xf0c2('0x5a')]({'where':{'id':_0x19ced0[_0xf0c2('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x272122,null))[_0xf0c2('0x21')](function(_0xe9ddf4){if(_0xe9ddf4){_0x5c0488[_0xf0c2('0x6c')]=_0xe9ddf4[_0xf0c2('0x67')]({'plain':!![]});interaction_log['info'](_0xf0c2('0x84'),_0x5058a9[_0xf0c2('0x65')]['id'],_0x5058a9['user']['name'],_0x5058a9['user'][_0xf0c2('0x6e')],_0x5c0488[_0xf0c2('0x6c')]['id'],_0x5058a9['body']?JSON[_0xf0c2('0x6f')](_0x5058a9['body']):_0xf0c2('0x70'));return respondWithRpcPromise(_0xf0c2('0x85'),_0xf0c2('0x86'),_0x5c0488);}return null;})[_0xf0c2('0x21')](function(_0x389fbf){var _0x5e349c=_0xf0c2('0x73')+_0x389fbf[_0xf0c2('0x26')][_0xf0c2('0x74')];return db[_0xf0c2('0x75')][_0xf0c2('0x44')](_0x5e349c,{'type':db['Sequelize'][_0xf0c2('0x77')][_0xf0c2('0x78')],'raw':!![]})[_0xf0c2('0x21')](function(_0x8032ac){return _0x8032ac;});})[_0xf0c2('0x21')](function(_0x1e6190){if(_0x1e6190){_0x5c0488['message'][_0xf0c2('0x79')]=_0x1e6190[0x0];if(!_0x5058a9[_0xf0c2('0x5b')][_0xf0c2('0x64')])return;return db[_0xf0c2('0x7a')][_0xf0c2('0x5a')]({'where':{'id':_0x5058a9['body'][_0xf0c2('0x64')],'role':_0xf0c2('0x66')},'attributes':['id',_0xf0c2('0x39'),_0xf0c2('0x7b'),_0xf0c2('0x7c'),_0xf0c2('0x7d')],'raw':!![]});}return null;})[_0xf0c2('0x21')](function(_0x3de4bf){if(!_0x3de4bf)return null;_0x5c0488[_0xf0c2('0x26')][_0xf0c2('0x66')]=_0x3de4bf;return _0x5c0488;})[_0xf0c2('0x21')](function(_0x55fb32){if(_0x55fb32){_0x55fb32[_0xf0c2('0x26')][_0xf0c2('0x7f')]=util[_0xf0c2('0x62')](_0xf0c2('0x87'),_0x5058a9[_0xf0c2('0x65')][_0xf0c2('0x39')]);_0x55fb32[_0xf0c2('0x26')][_0xf0c2('0x80')]=_0x5c0488[_0xf0c2('0x80')];_0x55fb32['message']['motionChannel']=_0x5c0488[_0xf0c2('0x80')];_0x55fb32[_0xf0c2('0x26')]['event']=_0xf0c2('0x34');respondWithRpcPromise('EventManager',_0xf0c2('0x82'),{'event':'rejectmessage','message':_0x55fb32[_0xf0c2('0x26')]},client9002);return _0x5c0488;}return null;})[_0xf0c2('0x21')](respondWithResult(_0x272122,null))[_0xf0c2('0x29')](handleError(_0x272122,null));};exports[_0xf0c2('0x88')]=function(_0x4b49b4,_0x3efdc2){var _0x5f0521;return db[_0xf0c2('0x3d')][_0xf0c2('0x88')](_0x4b49b4[_0xf0c2('0x5b')],{})[_0xf0c2('0x21')](function(_0x52b504){_0x5f0521=_0x52b504;return db['CmContact'][_0xf0c2('0x89')]({'where':{'id':_0x5f0521[_0xf0c2('0x74')]}});})['then'](function(_0xc9d0d2){if(_[_0xf0c2('0x6a')](_0xc9d0d2)){return;}else{_0x5f0521[_0xf0c2('0x5f')]=_0xc9d0d2[_0xf0c2('0x5f')];return db[_0xf0c2('0x8a')][_0xf0c2('0x89')]({'where':{'id':_0x5f0521['AttachmentId']}});}})['then'](function(_0x58bf1e){return respondWithRpcPromise(_0xf0c2('0x8b'),'SendFax',{'FaxAccountId':_['isNil'](_0x4b49b4[_0xf0c2('0x5b')])?undefined:_0x4b49b4[_0xf0c2('0x5b')]['FaxAccountId'],'path':_[_0xf0c2('0x6a')](_0x58bf1e)?undefined:util[_0xf0c2('0x62')](_0xf0c2('0x8c'),_0x58bf1e[_0xf0c2('0x8d')]),'fax':_[_0xf0c2('0x6a')](_0x5f0521[_0xf0c2('0x5f')])?undefined:_0x5f0521[_0xf0c2('0x5f')],'AttachmentId':_0x5f0521[_0xf0c2('0x8e')]},client9002);})['then'](respondWithResult(_0x3efdc2,0xc9))['catch'](handleError(_0x3efdc2,null));};exports[_0xf0c2('0x8f')]=function(_0x3f1a8a,_0x2e6099){var _0x187870=path[_0xf0c2('0x90')](config[_0xf0c2('0x91')],_0xf0c2('0x92'),_0xf0c2('0x93'),'attachments');return db[_0xf0c2('0x3d')][_0xf0c2('0x5a')]({'where':{'id':_0x3f1a8a[_0xf0c2('0x59')]['id']},'include':[{'model':db[_0xf0c2('0x8a')],'as':_0xf0c2('0x8a')}]})['then'](handleEntityNotFound(_0x2e6099,null))[_0xf0c2('0x21')](function(_0x3bc273){if(_0x3bc273){return _0x2e6099[_0xf0c2('0x8f')](path[_0xf0c2('0x90')](_0x187870,_0x3bc273[_0xf0c2('0x8a')]['basename']));}})['catch'](handleError(_0x2e6099,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 06f6793..6c25afd 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 _0x39e6=['update','remove','emit','hasOwnProperty','hook','exports','events','FaxMessage'];(function(_0x39e8dc,_0x426c31){var _0x164cd0=function(_0x65f16e){while(--_0x65f16e){_0x39e8dc['push'](_0x39e8dc['shift']());}};_0x164cd0(++_0x426c31);}(_0x39e6,0x9e));var _0x639e=function(_0x30d828,_0x1b5074){_0x30d828=_0x30d828-0x0;var _0x2e21fb=_0x39e6[_0x30d828];return _0x2e21fb;};'use strict';var EventEmitter=require(_0x639e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x639e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x639e('0x2'),'afterDestroy':_0x639e('0x3')};function emitEvent(_0x529394){return function(_0x467229,_0x207d6a,_0x199e72){FaxMessageEvents[_0x639e('0x4')](_0x529394+':'+_0x467229['id'],_0x467229);FaxMessageEvents[_0x639e('0x4')](_0x529394,_0x467229);_0x199e72(null);};}for(var e in events){if(events[_0x639e('0x5')](e)){var event=events[e];FaxMessage[_0x639e('0x6')](e,emitEvent(event));}}module[_0x639e('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x62f1=['remove','emit','hasOwnProperty','hook','events','FaxMessage','setMaxListeners','save','update'];(function(_0x490f1a,_0x4a69ad){var _0x388e32=function(_0x18f37a){while(--_0x18f37a){_0x490f1a['push'](_0x490f1a['shift']());}};_0x388e32(++_0x4a69ad);}(_0x62f1,0x112));var _0x162f=function(_0x4f3555,_0x40a06f){_0x4f3555=_0x4f3555-0x0;var _0x1c2142=_0x62f1[_0x4f3555];return _0x1c2142;};'use strict';var EventEmitter=require(_0x162f('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x162f('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x162f('0x2')](0x0);var events={'afterCreate':_0x162f('0x3'),'afterUpdate':_0x162f('0x4'),'afterDestroy':_0x162f('0x5')};function emitEvent(_0x364694){return function(_0x36ed0f,_0x223f35,_0xfc0863){FaxMessageEvents[_0x162f('0x6')](_0x364694+':'+_0x36ed0f['id'],_0x36ed0f);FaxMessageEvents['emit'](_0x364694,_0x36ed0f);_0xfc0863(null);};}for(var e in events){if(events[_0x162f('0x7')](e)){var event=events[e];FaxMessage[_0x162f('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 216bf40..06147da 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 _0xa3c8=['then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','exports','define','FaxMessage','FULLTEXT','get','toLowerCase','direction','secret','isNil','UserId','findOne'];(function(_0xb5d30c,_0x53fda0){var _0x3c984f=function(_0x16f51d){while(--_0x16f51d){_0xb5d30c['push'](_0xb5d30c['shift']());}};_0x3c984f(++_0x53fda0);}(_0xa3c8,0x14f));var _0x8a3c=function(_0x554a0c,_0x2dc98e){_0x554a0c=_0x554a0c-0x0;var _0x3aff34=_0xa3c8[_0x554a0c];return _0x3aff34;};'use strict';var _=require(_0x8a3c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8a3c('0x1'));var moment=require('moment');var BPromise=require(_0x8a3c('0x2'));var rp=require(_0x8a3c('0x3'));var fs=require('fs');var path=require(_0x8a3c('0x4'));var rimraf=require(_0x8a3c('0x5'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x8a3c('0x6')]=function(_0x594f37,_0x4d83f6){return _0x594f37[_0x8a3c('0x7')](_0x8a3c('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x8a3c('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9b5f1d,_0x1c9f73,_0x158d9f){var _0x4b052e=_0x594f37['models'];var _0x3febcc=_0x9b5f1d[_0x8a3c('0xa')]({'plain':!![]});if(_0x3febcc['direction'][_0x8a3c('0xb')]()==='in'||_0x3febcc[_0x8a3c('0xc')][_0x8a3c('0xb')]()==='out'&&!_0x3febcc[_0x8a3c('0xd')]&&!_[_0x8a3c('0xe')](_0x3febcc[_0x8a3c('0xf')])){_0x4b052e['FaxInteraction'][_0x8a3c('0x10')]({'where':{'id':_0x3febcc['FaxInteractionId']}})[_0x8a3c('0x11')](function(_0x59f469){if(_0x59f469){_0x59f469['update']({'lastMsgAt':_0x3febcc['createdAt'],'lastMsgDirection':_0x3febcc['direction'][_0x8a3c('0xb')]()});}})[_0x8a3c('0x12')](function(_0x178aac){console[_0x8a3c('0x13')](_0x178aac);});}_0x158d9f();}},'charset':_0x8a3c('0x14'),'collate':_0x8a3c('0x15')});}; \ No newline at end of file +var _0x1619=['path','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2991a3,_0x226957){var _0x424f2a=function(_0x34973f){while(--_0x34973f){_0x2991a3['push'](_0x2991a3['shift']());}};_0x424f2a(++_0x226957);}(_0x1619,0xe2));var _0x9161=function(_0x4bf990,_0x1097a8){_0x4bf990=_0x4bf990-0x0;var _0x577888=_0x1619[_0x4bf990];return _0x577888;};'use strict';var _=require(_0x9161('0x0'));var util=require(_0x9161('0x1'));var logger=require(_0x9161('0x2'))('api');var moment=require(_0x9161('0x3'));var BPromise=require(_0x9161('0x4'));var rp=require(_0x9161('0x5'));var fs=require('fs');var path=require(_0x9161('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x9161('0x7')]=function(_0x1c4271,_0x39134b){return _0x1c4271[_0x9161('0x8')](_0x9161('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x9161('0xa'),'fields':[_0x9161('0xb')],'type':_0x9161('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54b64d,_0xbf14be,_0x38698f){var _0xfa4760=_0x1c4271['models'];var _0x4cf6f7=_0x54b64d[_0x9161('0xd')]({'plain':!![]});if(_0x4cf6f7[_0x9161('0xe')][_0x9161('0xf')]()==='in'||_0x4cf6f7[_0x9161('0xe')]['toLowerCase']()===_0x9161('0x10')&&!_0x4cf6f7[_0x9161('0x11')]&&!_[_0x9161('0x12')](_0x4cf6f7[_0x9161('0x13')])){_0xfa4760[_0x9161('0x14')]['findOne']({'where':{'id':_0x4cf6f7[_0x9161('0x15')]}})[_0x9161('0x16')](function(_0x47f9f7){if(_0x47f9f7){_0x47f9f7[_0x9161('0x17')]({'lastMsgAt':_0x4cf6f7[_0x9161('0x18')],'lastMsgDirection':_0x4cf6f7[_0x9161('0xe')][_0x9161('0xf')]()});}})[_0x9161('0x19')](function(_0x139de5){console[_0x9161('0x1a')](_0x139de5);});}_0x38698f();}},'charset':_0x9161('0x1b'),'collate':_0x9161('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 06e1665..7ecbe15 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 _0xac9d=['then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxMessage','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request'];(function(_0x3e19d7,_0x369ea2){var _0x33f967=function(_0x512abf){while(--_0x512abf){_0x3e19d7['push'](_0x3e19d7['shift']());}};_0x33f967(++_0x369ea2);}(_0xac9d,0x14d));var _0xdac9=function(_0x4e4061,_0x26503b){_0x4e4061=_0x4e4061-0x0;var _0x371dbd=_0xac9d[_0x4e4061];return _0x371dbd;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}exports['CreateFaxMessage']=function(_0x520369){var _0x4029fc=this;return new Promise(function(_0x20ece3,_0x2b9d91){return db[_0xdac9('0x1d')]['create'](_0x520369[_0xdac9('0x1e')],{'raw':_0x520369[_0xdac9('0x1f')]?_0x520369[_0xdac9('0x1f')][_0xdac9('0x20')]===undefined?!![]:![]:!![]})[_0xdac9('0x12')](function(_0x42317c){logger[_0xdac9('0x13')](_0xdac9('0x21'),_0x520369);logger[_0xdac9('0x15')](_0xdac9('0x21'),_0x520369,JSON['stringify'](_0x42317c));_0x20ece3(_0x42317c);})[_0xdac9('0x1c')](function(_0x11f4fd){logger[_0xdac9('0x18')](_0xdac9('0x21'),_0x11f4fd['message'],_0x520369);_0x2b9d91(_0x4029fc[_0xdac9('0x18')](0x1f4,_0x11f4fd['message']));});});};exports[_0xdac9('0x22')]=function(_0x2fce71){var _0x566d8c=this;return new Promise(function(_0x433be9,_0x5105f1){return db[_0xdac9('0x1d')][_0xdac9('0x23')](_0x2fce71[_0xdac9('0x1e')],{'raw':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')]['where']||null:null,'attributes':_0x2fce71['options']?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x24')]||null:null,'limit':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x25')]||null:null})[_0xdac9('0x12')](function(_0xed99f9){logger[_0xdac9('0x13')](_0xdac9('0x22'),_0x2fce71);logger[_0xdac9('0x15')](_0xdac9('0x22'),_0x2fce71,JSON[_0xdac9('0x26')](_0xed99f9));_0x433be9(_0xed99f9);})[_0xdac9('0x1c')](function(_0x336fd5){logger[_0xdac9('0x18')](_0xdac9('0x22'),_0x336fd5[_0xdac9('0x1a')],_0x2fce71);_0x5105f1(_0x566d8c[_0xdac9('0x18')](0x1f4,_0x336fd5[_0xdac9('0x1a')]));});});}; \ No newline at end of file +var _0x70e0=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','stringify','catch','update','raw','where','limit','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x4cb91b,_0x2d024c){var _0x668fb2=function(_0xf5e1e2){while(--_0xf5e1e2){_0x4cb91b['push'](_0x4cb91b['shift']());}};_0x668fb2(++_0x2d024c);}(_0x70e0,0x17b));var _0x070e=function(_0x320a4e,_0x68d610){_0x320a4e=_0x320a4e-0x0;var _0x3f2a82=_0x70e0[_0x320a4e];return _0x3f2a82;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x070e('0x9')],{'host':_0x070e('0xa'),'port':0x18eb});var socket=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x9')]));require(_0x070e('0xc'))[_0x070e('0xd')](socket);function respondWithRpcPromise(_0x11ffa8,_0x4e99e6,_0x49b2fb){return new BPromise(function(_0x50f4eb,_0x2e3e5e){return client[_0x070e('0xe')](_0x11ffa8,_0x49b2fb)[_0x070e('0xf')](function(_0xa927a2){logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));logger[_0x070e('0x13')](_0x070e('0x14'),_0x4e99e6,_0x070e('0x12'),JSON['stringify'](_0xa927a2));if(_0xa927a2['error']){if(_0xa927a2[_0x070e('0x15')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x2e3e5e(_0xa927a2['error']['message']);}logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x50f4eb(_0xa927a2['error']['message']);}else{logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));_0x50f4eb(_0xa927a2[_0x070e('0x17')][_0x070e('0x16')]);}})['catch'](function(_0x3938b5){logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0x3938b5);_0x2e3e5e(_0x3938b5);});});}exports[_0x070e('0x18')]=function(_0x259893){var _0x5c16fd=this;return new Promise(function(_0x5b2f48,_0x4e958f){return db[_0x070e('0x19')][_0x070e('0x1a')](_0x259893[_0x070e('0x1b')],{'raw':_0x259893['options']?_0x259893[_0x070e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x070e('0xf')](function(_0x3f6985){logger[_0x070e('0x10')](_0x070e('0x18'),_0x259893);logger[_0x070e('0x13')](_0x070e('0x18'),_0x259893,JSON[_0x070e('0x1d')](_0x3f6985));_0x5b2f48(_0x3f6985);})[_0x070e('0x1e')](function(_0x595c7e){logger[_0x070e('0x15')](_0x070e('0x18'),_0x595c7e[_0x070e('0x16')],_0x259893);_0x4e958f(_0x5c16fd['error'](0x1f4,_0x595c7e[_0x070e('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x4a2dbd){var _0x2ccbd7=this;return new Promise(function(_0x25f6e,_0x41deb1){return db[_0x070e('0x19')][_0x070e('0x1f')](_0x4a2dbd['body'],{'raw':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x21')]||null:null,'attributes':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')]['attributes']||null:null,'limit':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x22')]||null:null})['then'](function(_0x5c5f0d){logger[_0x070e('0x10')](_0x070e('0x23'),_0x4a2dbd);logger[_0x070e('0x13')]('UpdateFaxMessage',_0x4a2dbd,JSON[_0x070e('0x1d')](_0x5c5f0d));_0x25f6e(_0x5c5f0d);})[_0x070e('0x1e')](function(_0x3a9425){logger[_0x070e('0x15')]('UpdateFaxMessage',_0x3a9425['message'],_0x4a2dbd);_0x41deb1(_0x2ccbd7['error'](0x1f4,_0x3a9425['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 453fa9e..b2c22e3 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 _0xe516=['removeListener','length','./faxMessage.events','save','remove','update'];(function(_0x2d8d12,_0x5ec696){var _0x3c2473=function(_0x26fb3a){while(--_0x26fb3a){_0x2d8d12['push'](_0x2d8d12['shift']());}};_0x3c2473(++_0x5ec696);}(_0xe516,0x6e));var _0x6e51=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0xe516[_0x21090b];return _0x3c68d7;};'use strict';var FaxMessageEvents=require(_0x6e51('0x0'));var events=[_0x6e51('0x1'),_0x6e51('0x2'),_0x6e51('0x3')];function createListener(_0x87a1fa,_0x258b54){return function(_0x2dd363){_0x258b54['emit'](_0x87a1fa,_0x2dd363);};}function removeListener(_0x569c34,_0x4d2e64){return function(){FaxMessageEvents[_0x6e51('0x4')](_0x569c34,_0x4d2e64);};}exports['register']=function(_0x2f6189){for(var _0x19504b=0x0,_0x1ed2a9=events[_0x6e51('0x5')];_0x19504b<_0x1ed2a9;_0x19504b++){var _0x43d4ae=events[_0x19504b];var _0xb52d79=createListener('faxMessage:'+_0x43d4ae,_0x2f6189);FaxMessageEvents['on'](_0x43d4ae,_0xb52d79);}}; \ No newline at end of file +var _0x47c9=['removeListener','register','length','save','update','emit'];(function(_0x300915,_0x320ae4){var _0x5887ed=function(_0x211c35){while(--_0x211c35){_0x300915['push'](_0x300915['shift']());}};_0x5887ed(++_0x320ae4);}(_0x47c9,0x12f));var _0x947c=function(_0xcb304c,_0x4bf637){_0xcb304c=_0xcb304c-0x0;var _0x5c0aa4=_0x47c9[_0xcb304c];return _0x5c0aa4;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x947c('0x0'),'remove',_0x947c('0x1')];function createListener(_0x202df0,_0x4faa23){return function(_0x50f089){_0x4faa23[_0x947c('0x2')](_0x202df0,_0x50f089);};}function removeListener(_0x54ab2e,_0x3dfc9d){return function(){FaxMessageEvents[_0x947c('0x3')](_0x54ab2e,_0x3dfc9d);};}exports[_0x947c('0x4')]=function(_0x4723c4){for(var _0x4ae33c=0x0,_0x4be8eb=events[_0x947c('0x5')];_0x4ae33c<_0x4be8eb;_0x4ae33c++){var _0x2c7c4c=events[_0x4ae33c];var _0x18501a=createListener('faxMessage:'+_0x2c7c4c,_0x4723c4);FaxMessageEvents['on'](_0x2c7c4c,_0x18501a);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index c632edd..c7044a6 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 _0xd87e=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxMessage.controller','isAuthenticated','/describe','describe','get','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','reject','delete','/:id','destroy','exports','multer'];(function(_0x192678,_0x133fdb){var _0x5e0531=function(_0x2b4e88){while(--_0x2b4e88){_0x192678['push'](_0x192678['shift']());}};_0x5e0531(++_0x133fdb);}(_0xd87e,0x1bf));var _0xed87=function(_0x5a0b42,_0x35c33f){_0x5a0b42=_0x5a0b42-0x0;var _0x2558df=_0xd87e[_0x5a0b42];return _0x2558df;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),interaction[_0xed87('0x10')](_0xed87('0x11'),'faxmessage:create'),controller[_0xed87('0x12')]);router[_0xed87('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xed87('0x14')]);router[_0xed87('0x13')](_0xed87('0x15'),auth[_0xed87('0x8')](),controller[_0xed87('0x16')]);router[_0xed87('0x13')]('/:id/reject',auth[_0xed87('0x8')](),controller[_0xed87('0x17')]);router[_0xed87('0x18')](_0xed87('0x19'),auth[_0xed87('0x8')](),controller[_0xed87('0x1a')]);module[_0xed87('0x1b')]=router; \ No newline at end of file +var _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','faxmessage:create'];(function(_0x3438cf,_0x73b174){var _0x278698=function(_0xbba932){while(--_0xbba932){_0x3438cf['push'](_0x3438cf['shift']());}};_0x278698(++_0x73b174);}(_0x1be1,0x192));var _0x11be=function(_0x5a06f7,_0x13aa2b){_0x5a06f7=_0x5a06f7-0x0;var _0x39d952=_0x1be1[_0x5a06f7];return _0x39d952;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('fax',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 4648658..be9fc94 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 _0x0aaa=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x37abd0,_0x1b4681){var _0x19a705=function(_0x4df7dd){while(--_0x4df7dd){_0x37abd0['push'](_0x37abd0['shift']());}};_0x19a705(++_0x1b4681);}(_0x0aaa,0x160));var _0xa0aa=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x0aaa[_0x1dac7a];return _0x4cb363;};'use strict';var Sequelize=require(_0xa0aa('0x0'));module[_0xa0aa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa0aa('0x2')]},'timeout':{'type':Sequelize[_0xa0aa('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa0aa('0x4')](_0xa0aa('0x5'),_0xa0aa('0x6'),_0xa0aa('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa0aa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x508b=['name','ENUM','beepall','roundrobin','INTEGER','exports'];(function(_0xfbf457,_0x23a8e7){var _0x53cddd=function(_0x1c872e){while(--_0x1c872e){_0xfbf457['push'](_0xfbf457['shift']());}};_0x53cddd(++_0x23a8e7);}(_0x508b,0x1c1));var _0xb508=function(_0x2b8d9e,_0x38f52a){_0x2b8d9e=_0x2b8d9e-0x0;var _0x380e14=_0x508b[_0x2b8d9e];return _0x380e14;};'use strict';var Sequelize=require('sequelize');module[_0xb508('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb508('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb508('0x2')]('rrmemory',_0xb508('0x3'),_0xb508('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb508('0x5')],'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 a455cd3..cc03be5 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 _0xab00=['ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','fast-json-patch','moment','bluebird','mustache','util','path','sox','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','api','../../config/environment','redis','localhost','socket.io-emitter','./faxQueue.socket','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','FaxQueue','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','findAll','catch','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserFaxQueue','order','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone'];(function(_0x5605ed,_0x55fc17){var _0x166563=function(_0xcf7b6c){while(--_0xcf7b6c){_0x5605ed['push'](_0x5605ed['shift']());}};_0x166563(++_0x55fc17);}(_0xab00,0x98));var _0x0ab0=function(_0x25b6ac,_0x61b3d8){_0x25b6ac=_0x25b6ac-0x0;var _0x5dedb1=_0xab00[_0x25b6ac];return _0x5dedb1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0ab0('0x0'));var rp=require('request-promise');var moment=require(_0x0ab0('0x1'));var BPromise=require(_0x0ab0('0x2'));var Mustache=require(_0x0ab0('0x3'));var util=require(_0x0ab0('0x4'));var path=require(_0x0ab0('0x5'));var sox=require(_0x0ab0('0x6'));var csv=require(_0x0ab0('0x7'));var ejs=require(_0x0ab0('0x8'));var fs=require('fs');var fs_extra=require(_0x0ab0('0x9'));var _=require(_0x0ab0('0xa'));var squel=require(_0x0ab0('0xb'));var crypto=require(_0x0ab0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0ab0('0xd'));var toCsv=require(_0x0ab0('0x7'));var querystring=require(_0x0ab0('0xe'));var Papa=require(_0x0ab0('0xf'));var Redis=require(_0x0ab0('0x10'));var authService=require(_0x0ab0('0x11'));var qs=require(_0x0ab0('0x12'));var as=require(_0x0ab0('0x13'));var hardwareService=require(_0x0ab0('0x14'));var logger=require('../../config/logger')(_0x0ab0('0x15'));var utils=require('../../config/utils');var config=require(_0x0ab0('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0ab0('0x17')]=_['defaults'](config[_0x0ab0('0x17')],{'host':_0x0ab0('0x18'),'port':0x18eb});var socket=require(_0x0ab0('0x19'))(new Redis(config[_0x0ab0('0x17')]));require(_0x0ab0('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b0a64,_0x572931){_0x572931=_0x572931||0xcc;return function(_0x49f6e8){if(_0x49f6e8){return _0x1b0a64['sendStatus'](_0x572931);}return _0x1b0a64['status'](_0x572931)['end']();};}function respondWithResult(_0x3f50ee,_0x32b815){_0x32b815=_0x32b815||0xc8;return function(_0x5144d5){if(_0x5144d5){return _0x3f50ee[_0x0ab0('0x1b')](_0x32b815)['json'](_0x5144d5);}};}function respondWithFilteredResult(_0x1f6724,_0x3cb311){return function(_0x2af9b0){if(_0x2af9b0){var _0xfea88b=typeof _0x3cb311[_0x0ab0('0x1c')]==='undefined'&&typeof _0x3cb311[_0x0ab0('0x1d')]==='undefined';var _0x33caf7=_0x2af9b0['count'];var _0x464a0e=_0xfea88b?0x0:_0x3cb311[_0x0ab0('0x1c')];var _0x2f0f8c=_0xfea88b?_0x2af9b0['count']:_0x3cb311[_0x0ab0('0x1c')]+_0x3cb311['limit'];var _0x378b00;if(_0x2f0f8c>=_0x33caf7){_0x2f0f8c=_0x33caf7;_0x378b00=0xc8;}else{_0x378b00=0xce;}_0x1f6724['status'](_0x378b00);return _0x1f6724[_0x0ab0('0x1e')](_0x0ab0('0x1f'),_0x464a0e+'-'+_0x2f0f8c+'/'+_0x33caf7)[_0x0ab0('0x20')](_0x2af9b0);}return null;};}function patchUpdates(_0x4a6d69){return function(_0x1aa60f){try{jsonpatch[_0x0ab0('0x21')](_0x1aa60f,_0x4a6d69,!![]);}catch(_0x467d00){return BPromise[_0x0ab0('0x22')](_0x467d00);}return _0x1aa60f[_0x0ab0('0x23')]();};}function saveUpdates(_0x1e00a4,_0x52de87){return function(_0x38acab){if(_0x38acab){return _0x38acab[_0x0ab0('0x24')](_0x1e00a4)[_0x0ab0('0x25')](function(_0x3610cd){return _0x3610cd;});}return null;};}function removeEntity(_0xa990e1,_0x584574){return function(_0x57750c){if(_0x57750c){return _0x57750c[_0x0ab0('0x26')]()[_0x0ab0('0x25')](function(){var _0x35ed7c=_0x57750c[_0x0ab0('0x27')]({'plain':!![]});var _0x9ff681=_0x0ab0('0x28');return db[_0x0ab0('0x29')][_0x0ab0('0x26')]({'where':{'type':_0x9ff681,'resourceId':_0x35ed7c['id']}})['then'](function(){return _0x57750c;});})[_0x0ab0('0x25')](function(){_0xa990e1['status'](0xcc)[_0x0ab0('0x2a')]();});}};}function handleEntityNotFound(_0x512bbb,_0x254014){return function(_0x1b3ad7){if(!_0x1b3ad7){_0x512bbb[_0x0ab0('0x2b')](0x194);}return _0x1b3ad7;};}function handleError(_0x519d3c,_0x5bc300){_0x5bc300=_0x5bc300||0x1f4;return function(_0x5a679a){logger[_0x0ab0('0x2c')](_0x5a679a[_0x0ab0('0x2d')]);if(_0x5a679a['name']){delete _0x5a679a[_0x0ab0('0x2e')];}_0x519d3c[_0x0ab0('0x1b')](_0x5bc300)[_0x0ab0('0x2f')](_0x5a679a);};}exports[_0x0ab0('0x30')]=function(_0x57bbcf,_0x115647){var _0x33127c={},_0x30aeab={},_0x1fe85a={'count':0x0,'rows':[]};var _0x311a7b=_[_0x0ab0('0x31')](db[_0x0ab0('0x32')]['rawAttributes'],function(_0x2157ad){return{'name':_0x2157ad['fieldName'],'type':_0x2157ad[_0x0ab0('0x33')]['key']};});_0x30aeab[_0x0ab0('0x34')]=_[_0x0ab0('0x31')](_0x311a7b,_0x0ab0('0x2e'));_0x30aeab[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0x57bbcf[_0x0ab0('0x35')]);_0x30aeab[_0x0ab0('0x37')]=_['intersection'](_0x30aeab[_0x0ab0('0x34')],_0x30aeab[_0x0ab0('0x35')]);_0x33127c['attributes']=_[_0x0ab0('0x38')](_0x30aeab[_0x0ab0('0x34')],qs['fields'](_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x33127c[_0x0ab0('0x3a')]=_0x33127c[_0x0ab0('0x3a')][_0x0ab0('0x3b')]?_0x33127c[_0x0ab0('0x3a')]:_0x30aeab[_0x0ab0('0x34')];if(!_0x57bbcf['query'][_0x0ab0('0x3c')](_0x0ab0('0x3d'))){_0x33127c[_0x0ab0('0x1d')]=qs[_0x0ab0('0x1d')](_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x1d')]);_0x33127c[_0x0ab0('0x1c')]=qs['offset'](_0x57bbcf[_0x0ab0('0x35')]['offset']);}_0x33127c['order']=qs['sort'](_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x33127c[_0x0ab0('0x3f')]=qs[_0x0ab0('0x37')](_[_0x0ab0('0x40')](_0x57bbcf[_0x0ab0('0x35')],_0x30aeab['filters']),_0x311a7b);if(_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x41')]){_0x33127c[_0x0ab0('0x3f')]=_['merge'](_0x33127c[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x311a7b,function(_0x1c4434){if(_0x1c4434[_0x0ab0('0x33')]!=='VIRTUAL'){var _0x1e1e8f={};_0x1e1e8f[_0x1c4434[_0x0ab0('0x2e')]]={'$like':'%'+_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0x1e1e8f;}})});}_0x33127c=_[_0x0ab0('0x42')]({},_0x33127c,_0x57bbcf[_0x0ab0('0x43')]);var _0x5e59a4={'where':_0x33127c[_0x0ab0('0x3f')]};return db[_0x0ab0('0x32')][_0x0ab0('0x44')](_0x5e59a4)[_0x0ab0('0x25')](function(_0x5ecb20){_0x1fe85a[_0x0ab0('0x44')]=_0x5ecb20;if(_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x45')]){_0x33127c['include']=[{'all':!![]}];}return db[_0x0ab0('0x32')][_0x0ab0('0x46')](_0x33127c);})[_0x0ab0('0x25')](function(_0x48e471){_0x1fe85a['rows']=_0x48e471;return _0x1fe85a;})[_0x0ab0('0x25')](respondWithFilteredResult(_0x115647,_0x33127c))[_0x0ab0('0x47')](handleError(_0x115647,null));};exports['show']=function(_0x4e3d67,_0x11bfcb){var _0x3b200d={'raw':!![],'where':{'id':_0x4e3d67['params']['id']}},_0x22c2c3={};_0x22c2c3['model']=_['keys'](db['FaxQueue'][_0x0ab0('0x48')]);_0x22c2c3[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0x4e3d67[_0x0ab0('0x35')]);_0x22c2c3[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x22c2c3[_0x0ab0('0x34')],_0x22c2c3[_0x0ab0('0x35')]);_0x3b200d[_0x0ab0('0x3a')]=_[_0x0ab0('0x38')](_0x22c2c3['model'],qs[_0x0ab0('0x39')](_0x4e3d67[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x3b200d[_0x0ab0('0x3a')]=_0x3b200d[_0x0ab0('0x3a')][_0x0ab0('0x3b')]?_0x3b200d[_0x0ab0('0x3a')]:_0x22c2c3['model'];if(_0x4e3d67[_0x0ab0('0x35')][_0x0ab0('0x45')]){_0x3b200d['include']=[{'all':!![]}];}_0x3b200d=_[_0x0ab0('0x42')]({},_0x3b200d,_0x4e3d67[_0x0ab0('0x43')]);return db[_0x0ab0('0x32')][_0x0ab0('0x49')](_0x3b200d)[_0x0ab0('0x25')](handleEntityNotFound(_0x11bfcb,null))[_0x0ab0('0x25')](respondWithResult(_0x11bfcb,null))['catch'](handleError(_0x11bfcb,null));};exports[_0x0ab0('0x4a')]=function(_0x4fda6e,_0x268282){return db[_0x0ab0('0x32')][_0x0ab0('0x4a')](_0x4fda6e['body'],{})[_0x0ab0('0x25')](function(_0x2c115b){var _0x32bd5e=_0x4fda6e[_0x0ab0('0x4b')][_0x0ab0('0x27')]({'plain':!![]});if(!_0x32bd5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32bd5e[_0x0ab0('0x4c')]===_0x0ab0('0x4b')){var _0x2bcf25=_0x2c115b[_0x0ab0('0x27')]({'plain':!![]});var _0x359de4=_0x0ab0('0x28');return db[_0x0ab0('0x4d')][_0x0ab0('0x49')]({'where':{'name':_0x359de4,'userProfileId':_0x32bd5e[_0x0ab0('0x4e')]},'raw':!![]})[_0x0ab0('0x25')](function(_0x4621c2){if(_0x4621c2&&_0x4621c2[_0x0ab0('0x4f')]===0x0){return db[_0x0ab0('0x29')][_0x0ab0('0x4a')]({'name':_0x2bcf25[_0x0ab0('0x2e')],'resourceId':_0x2bcf25['id'],'type':_0x4621c2['name'],'sectionId':_0x4621c2['id']},{})[_0x0ab0('0x25')](function(){return _0x2c115b;});}else{return _0x2c115b;}})[_0x0ab0('0x47')](function(_0xbdd28){logger[_0x0ab0('0x2c')](_0x0ab0('0x50'),_0xbdd28);throw _0xbdd28;});}return _0x2c115b;})[_0x0ab0('0x25')](respondWithResult(_0x268282,0xc9))['catch'](handleError(_0x268282,null));};exports[_0x0ab0('0x24')]=function(_0x30913d,_0x425e7f){if(_0x30913d[_0x0ab0('0x51')]['id']){delete _0x30913d[_0x0ab0('0x51')]['id'];}return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x30913d[_0x0ab0('0x52')]['id']}})['then'](handleEntityNotFound(_0x425e7f,null))[_0x0ab0('0x25')](saveUpdates(_0x30913d[_0x0ab0('0x51')],null))[_0x0ab0('0x25')](respondWithResult(_0x425e7f,null))[_0x0ab0('0x47')](handleError(_0x425e7f,null));};exports[_0x0ab0('0x26')]=function(_0x117661,_0x5666a5){return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x117661[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x5666a5,null))['then'](removeEntity(_0x5666a5,null))[_0x0ab0('0x47')](handleError(_0x5666a5,null));};exports[_0x0ab0('0x53')]=function(_0x4eee3f,_0x111f9d){return db[_0x0ab0('0x32')][_0x0ab0('0x53')]()[_0x0ab0('0x25')](respondWithResult(_0x111f9d,null))['catch'](handleError(_0x111f9d,null));};exports[_0x0ab0('0x54')]=function(_0xb04d46,_0x171f2f,_0x494c22){var _0x15948={'raw':!![],'where':{}},_0x198042={},_0x1317e5;return db[_0x0ab0('0x32')][_0x0ab0('0x55')]({'where':{'id':_0xb04d46[_0x0ab0('0x52')]['id']}})['then'](handleEntityNotFound(_0x171f2f,null))[_0x0ab0('0x25')](function(_0x11006e){if(_0x11006e){_0x1317e5=_0x11006e[_0x0ab0('0x27')]({'plain':!![]});_0x198042['model']=_['keys'](db[_0x0ab0('0x56')]['rawAttributes']);_0x198042[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0xb04d46[_0x0ab0('0x35')]);_0x198042[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x198042[_0x0ab0('0x34')],_0x198042[_0x0ab0('0x35')]);_0x15948['attributes']=_[_0x0ab0('0x38')](_0x198042['model'],qs[_0x0ab0('0x39')](_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x15948[_0x0ab0('0x3a')]=_0x15948['attributes'][_0x0ab0('0x3b')]?_0x15948[_0x0ab0('0x3a')]:_0x198042[_0x0ab0('0x34')];if(!_0xb04d46['query'][_0x0ab0('0x3c')](_0x0ab0('0x3d'))){_0x15948['limit']=qs[_0x0ab0('0x1d')](_0xb04d46[_0x0ab0('0x35')]['limit']);_0x15948[_0x0ab0('0x1c')]=qs['offset'](_0xb04d46[_0x0ab0('0x35')]['offset']);}_0x15948[_0x0ab0('0x57')]=qs['sort'](_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x15948[_0x0ab0('0x3f')]=qs[_0x0ab0('0x37')](_[_0x0ab0('0x40')](_0xb04d46['query'],_0x198042[_0x0ab0('0x37')]));_0x15948[_0x0ab0('0x3f')][_0x0ab0('0x58')]=_0x11006e['id'];if(_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x41')]){_0x15948[_0x0ab0('0x3f')]=_[_0x0ab0('0x42')](_0x15948[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x15948[_0x0ab0('0x3a')],function(_0x56c1b4){var _0xbbd896={};_0xbbd896[_0x56c1b4]={'$like':'%'+_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0xbbd896;})});}_0x15948=_[_0x0ab0('0x42')]({},_0x15948,_0xb04d46[_0x0ab0('0x43')]);return db[_0x0ab0('0x56')][_0x0ab0('0x46')](_0x15948);}})['then'](function(_0x437081){if(_0x437081){return db['User'][_0x0ab0('0x59')]({'where':{'id':_[_0x0ab0('0x31')](_0x437081,_0x0ab0('0x5a')),'role':_0x0ab0('0x5b')},'attributes':['id',_0x0ab0('0x2e'),_0x0ab0('0x5c'),_0x0ab0('0x5d'),_0x0ab0('0x5e')]});}})[_0x0ab0('0x25')](function(_0x2a00d6){if(_0x2a00d6){return{'count':_0x2a00d6[_0x0ab0('0x44')],'rows':_[_0x0ab0('0x31')](_0x2a00d6['rows'],function(_0x58951d){return{'membername':_0x58951d[_0x0ab0('0x2e')],'UserId':_0x58951d['id'],'queue_name':_0x1317e5[_0x0ab0('0x2e')],'FaxQueueId':_0x1317e5['id'],'interface':util['format']('%s/%s',_0x0ab0('0x5f'),_0x58951d[_0x0ab0('0x2e')]),'penalty':0x0,'paused':_0x58951d[_0x0ab0('0x5c')],'createdAt':_0x58951d[_0x0ab0('0x5e')],'updatedAt':_0x58951d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ab0('0x25')](respondWithFilteredResult(_0x171f2f,_0x15948))[_0x0ab0('0x47')](handleError(_0x171f2f,null));};exports[_0x0ab0('0x60')]=function(_0x33c27f,_0x518bd2,_0x442b87){var _0x44ad4f={};var _0x1c8f09={};var _0x38b480;var _0xbed607;return db[_0x0ab0('0x32')][_0x0ab0('0x55')]({'where':{'id':_0x33c27f[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x518bd2,null))[_0x0ab0('0x25')](function(_0x5e7062){if(_0x5e7062){_0x38b480=_0x5e7062;_0x1c8f09['model']=_[_0x0ab0('0x36')](db['Team'][_0x0ab0('0x48')]);_0x1c8f09[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0x33c27f[_0x0ab0('0x35')]);_0x1c8f09[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x1c8f09['model'],_0x1c8f09[_0x0ab0('0x35')]);_0x44ad4f[_0x0ab0('0x3a')]=_[_0x0ab0('0x38')](_0x1c8f09[_0x0ab0('0x34')],qs[_0x0ab0('0x39')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x44ad4f[_0x0ab0('0x3a')]=_0x44ad4f[_0x0ab0('0x3a')][_0x0ab0('0x3b')]?_0x44ad4f['attributes']:_0x1c8f09[_0x0ab0('0x34')];_0x44ad4f[_0x0ab0('0x57')]=qs[_0x0ab0('0x3e')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x44ad4f[_0x0ab0('0x3f')]=qs['filters'](_['pick'](_0x33c27f[_0x0ab0('0x35')],_0x1c8f09['filters']));if(_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x41')]){_0x44ad4f[_0x0ab0('0x3f')]=_[_0x0ab0('0x42')](_0x44ad4f[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x44ad4f[_0x0ab0('0x3a')],function(_0x3bab0a){var _0x236798={};_0x236798[_0x3bab0a]={'$like':'%'+_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0x236798;})});}_0x44ad4f=_['merge']({},_0x44ad4f,_0x33c27f[_0x0ab0('0x43')]);return _0x38b480[_0x0ab0('0x60')](_0x44ad4f);}})[_0x0ab0('0x25')](function(_0x2f40f2){if(_0x2f40f2){_0xbed607=_0x2f40f2[_0x0ab0('0x3b')];if(!_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x3c')]('nolimit')){_0x44ad4f['limit']=qs[_0x0ab0('0x1d')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x1d')]);_0x44ad4f[_0x0ab0('0x1c')]=qs[_0x0ab0('0x1c')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x1c')]);}return _0x38b480['getTeams'](_0x44ad4f);}})[_0x0ab0('0x25')](function(_0x3f757b){if(_0x3f757b){return _0x3f757b?{'count':_0xbed607,'rows':_0x3f757b}:null;}})['then'](respondWithResult(_0x518bd2,null))[_0x0ab0('0x47')](handleError(_0x518bd2,null));};exports[_0x0ab0('0x61')]=function(_0x71c3f,_0x169b39,_0x1697ae){var _0x438905=_0x71c3f[_0x0ab0('0x51')][_0x0ab0('0x62')];return db[_0x0ab0('0x63')][_0x0ab0('0x46')]({'where':{'id':_0x438905},'attributes':['id'],'include':[{'model':db[_0x0ab0('0x64')],'as':_0x0ab0('0x65'),'attributes':['id',_0x0ab0('0x2e'),_0x0ab0('0x66'),_0x0ab0('0x67'),'interface'],'raw':!![]}]})[_0x0ab0('0x25')](function(_0x533be0){if(_0x533be0){var _0x4ad5fd=_[_0x0ab0('0x68')](_0x533be0,function(_0x3baf83){var _0x10ba1e=_0x3baf83['get']({'plain':!![]});return _0x10ba1e[_0x0ab0('0x65')];});return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x71c3f['params']['id']}})[_0x0ab0('0x25')](function(_0x2199f2){return db[_0x0ab0('0x69')][_0x0ab0('0x6a')](function(_0x522791){return _0x2199f2[_0x0ab0('0x61')](_0x438905,{'transaction':_0x522791})['then'](function(){return BPromise[_0x0ab0('0x6b')](_0x4ad5fd,function(_0x25ac73){return db[_0x0ab0('0x56')][_0x0ab0('0x6c')]({'where':{'UserId':_0x25ac73['id'],'FaxQueueId':_0x71c3f[_0x0ab0('0x52')]['id']},'transaction':_0x522791});});})[_0x0ab0('0x25')](function(){_0x4ad5fd[_0x0ab0('0x6d')](function(_0x5e4375){socket[_0x0ab0('0x6e')](_0x0ab0('0x6f'),{'UserId':_0x5e4375['id'],'FaxQueueId':_0x2199f2['id']});});});});});}})[_0x0ab0('0x25')](respondWithStatusCode(_0x169b39,null))[_0x0ab0('0x47')](handleError(_0x169b39,null));};exports['removeTeams']=function(_0x4801a2,_0x23a197,_0x25eddf){return db[_0x0ab0('0x63')]['findAll']({'where':{'id':_0x4801a2[_0x0ab0('0x35')][_0x0ab0('0x62')]},'attributes':['id'],'include':[{'model':db[_0x0ab0('0x64')],'as':_0x0ab0('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x23a197,null))[_0x0ab0('0x25')](function(_0x577c6d){var _0x408f8d=_['map'](_0x577c6d,'id');var _0x2f5a32=[];var _0x5bf586=[];var _0x3010d4=squel['select']();_0x3010d4[_0x0ab0('0x70')](_0x0ab0('0x71'))['from']('team_has_fax_queues','tq')['join'](_0x0ab0('0x72'),'ut',_0x0ab0('0x73'))['where'](_0x0ab0('0x74'),_0x4801a2[_0x0ab0('0x52')]['id']);for(var _0x17b4a4=0x0;_0x17b4a4<_0x577c6d[_0x0ab0('0x3b')];_0x17b4a4+=0x1){let _0x1aff04=_0x577c6d[_0x17b4a4];for(var _0x37e42a=0x0;_0x37e42a<_0x1aff04['Agents'][_0x0ab0('0x3b')];_0x37e42a+=0x1){let _0x16557e=_0x1aff04[_0x0ab0('0x65')][_0x37e42a];var _0x34b1ea=_0x3010d4[_0x0ab0('0x75')]();_0x34b1ea[_0x0ab0('0x3f')](_0x0ab0('0x76'),_0x16557e['id']);_0x5bf586[_0x0ab0('0x77')](db[_0x0ab0('0x69')]['query'](_0x34b1ea[_0x0ab0('0x78')](),{'type':db[_0x0ab0('0x69')][_0x0ab0('0x79')][_0x0ab0('0x7a')]})['then'](function(_0x2d8823){if(_0x2d8823[_0x0ab0('0x3b')]===0x1){return _0x16557e['id'];}else{var _0x1dc2f4=_[_0x0ab0('0x7b')](_[_0x0ab0('0x31')](_0x2d8823,_0x0ab0('0x7c')),function(_0x44555e){return _[_0x0ab0('0x7d')](_0x408f8d,_0x44555e);});if(_0x1dc2f4){return _0x16557e['id'];}}}));}}return BPromise['all'](_0x5bf586)[_0x0ab0('0x25')](function(_0x51fa74){_0x2f5a32=_(_0x2f5a32)['union'](_0x51fa74)['compact']()[_0x0ab0('0x7e')]();return db[_0x0ab0('0x32')]['find']({'where':{'id':_0x4801a2[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](function(_0x38818c){return db[_0x0ab0('0x69')][_0x0ab0('0x6a')](function(_0xd28695){return _0x38818c[_0x0ab0('0x7f')](_0x4801a2[_0x0ab0('0x35')][_0x0ab0('0x62')],{'transaction':_0xd28695})[_0x0ab0('0x25')](function(){if(!_[_0x0ab0('0x80')](_0x2f5a32)){return _0x38818c[_0x0ab0('0x81')](_0x2f5a32,{'transaction':_0xd28695});}})['then'](function(){_0x2f5a32[_0x0ab0('0x6d')](function(_0x129fb0){socket['emit'](_0x0ab0('0x82'),{'UserId':_0x129fb0,'FaxQueueId':_0x38818c['id']});});});});});});})[_0x0ab0('0x25')](respondWithStatusCode(_0x23a197,null))[_0x0ab0('0x47')](handleError(_0x23a197,null));};exports['addAgents']=function(_0x235f3d,_0x3ee578,_0x139378){return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x235f3d[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x3ee578,null))[_0x0ab0('0x25')](function(_0x1836bb){if(_0x1836bb){return _0x1836bb[_0x0ab0('0x83')](_0x235f3d[_0x0ab0('0x51')][_0x0ab0('0x62')],_[_0x0ab0('0x84')](_0x235f3d[_0x0ab0('0x51')],[_0x0ab0('0x62'),'id'])||{})[_0x0ab0('0x85')](function(_0x23bf08){for(var _0x499b4d=0x0;_0x499b4d<_0x235f3d['body']['ids'][_0x0ab0('0x3b')];_0x499b4d+=0x1){socket[_0x0ab0('0x6e')]('userFaxQueue:save',{'UserId':Number(_0x235f3d[_0x0ab0('0x51')][_0x0ab0('0x62')][_0x499b4d]),'FaxQueueId':Number(_0x235f3d[_0x0ab0('0x52')]['id'])});}return _0x23bf08;});}})[_0x0ab0('0x25')](respondWithResult(_0x3ee578,null))[_0x0ab0('0x47')](handleError(_0x3ee578,null));};exports[_0x0ab0('0x81')]=function(_0x29e874,_0x4e91ea,_0x7eeb4c){return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x29e874[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x4e91ea,null))[_0x0ab0('0x25')](function(_0x267eb4){if(_0x267eb4){return _0x267eb4['removeAgents'](_0x29e874['query'][_0x0ab0('0x62')])['then'](function(){if(_['isArray'](_0x29e874[_0x0ab0('0x35')]['ids'])){for(var _0x42589e=0x0;_0x42589e<_0x29e874[_0x0ab0('0x35')][_0x0ab0('0x62')]['length'];_0x42589e+=0x1){socket[_0x0ab0('0x6e')](_0x0ab0('0x82'),{'UserId':Number(_0x29e874[_0x0ab0('0x35')][_0x0ab0('0x62')][_0x42589e]),'FaxQueueId':Number(_0x29e874[_0x0ab0('0x52')]['id'])});}}else{socket[_0x0ab0('0x6e')](_0x0ab0('0x82'),{'UserId':Number(_0x29e874[_0x0ab0('0x35')][_0x0ab0('0x62')]),'FaxQueueId':Number(_0x29e874[_0x0ab0('0x52')]['id'])});}});}})[_0x0ab0('0x25')](respondWithStatusCode(_0x4e91ea,null))['catch'](handleError(_0x4e91ea,null));};exports[_0x0ab0('0x86')]=function(_0x49c5f4,_0x30f59f,_0x493b62){var _0x2d0210={};var _0x1e8fde={};var _0x138a5;var _0x569be3;return db['FaxQueue'][_0x0ab0('0x55')]({'where':{'id':_0x49c5f4[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x30f59f,null))[_0x0ab0('0x25')](function(_0x2397b6){if(_0x2397b6){_0x138a5=_0x2397b6;_0x1e8fde['model']=_['keys'](db['User'][_0x0ab0('0x48')]);_0x1e8fde[_0x0ab0('0x35')]=_['keys'](_0x49c5f4[_0x0ab0('0x35')]);_0x1e8fde[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x1e8fde[_0x0ab0('0x34')],_0x1e8fde[_0x0ab0('0x35')]);_0x2d0210[_0x0ab0('0x3a')]=_[_0x0ab0('0x38')](_0x1e8fde[_0x0ab0('0x34')],qs[_0x0ab0('0x39')](_0x49c5f4[_0x0ab0('0x35')]['fields']));_0x2d0210[_0x0ab0('0x3a')]=_0x2d0210['attributes'][_0x0ab0('0x3b')]?_0x2d0210[_0x0ab0('0x3a')]:_0x1e8fde[_0x0ab0('0x34')];_0x2d0210[_0x0ab0('0x57')]=qs[_0x0ab0('0x3e')](_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x2d0210['where']=qs[_0x0ab0('0x37')](_['pick'](_0x49c5f4['query'],_0x1e8fde[_0x0ab0('0x37')]));if(_0x49c5f4[_0x0ab0('0x35')]['filter']){_0x2d0210['where']=_[_0x0ab0('0x42')](_0x2d0210[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x2d0210[_0x0ab0('0x3a')],function(_0x5034e0){var _0x5b48e0={};_0x5b48e0[_0x5034e0]={'$like':'%'+_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0x5b48e0;})});}_0x2d0210=_[_0x0ab0('0x42')]({},_0x2d0210,_0x49c5f4[_0x0ab0('0x43')]);return _0x138a5[_0x0ab0('0x86')](_0x2d0210);}})[_0x0ab0('0x25')](function(_0x3ae346){if(_0x3ae346){_0x569be3=_0x3ae346[_0x0ab0('0x3b')];if(!_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x3c')]('nolimit')){_0x2d0210[_0x0ab0('0x1d')]=qs[_0x0ab0('0x1d')](_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x1d')]);_0x2d0210[_0x0ab0('0x1c')]=qs[_0x0ab0('0x1c')](_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x1c')]);}return _0x138a5['getAgents'](_0x2d0210);}})[_0x0ab0('0x25')](function(_0x551d17){if(_0x551d17){return _0x551d17?{'count':_0x569be3,'rows':_0x551d17}:null;}})[_0x0ab0('0x25')](respondWithResult(_0x30f59f,null))[_0x0ab0('0x47')](handleError(_0x30f59f,null));}; \ No newline at end of file +var _0x6217=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','order','FaxQueueId','UserFaxQueue','agent','faxPause','updatedAt','format','%s/%s','SIP','getTeams','addTeams','User','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','userFaxQueue:save','removeTeams','Team','ids','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','sendStatus','name','send','index','rawAttributes','type','key','model','map'];(function(_0x78f051,_0x2fcac1){var _0x10a8f9=function(_0x4ed88f){while(--_0x4ed88f){_0x78f051['push'](_0x78f051['shift']());}};_0x10a8f9(++_0x2fcac1);}(_0x6217,0xe3));var _0x7621=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0x6217[_0x2731f0];return _0x36a180;};'use strict';var emlformat=require(_0x7621('0x0'));var rimraf=require(_0x7621('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7621('0x2'));var rp=require(_0x7621('0x3'));var moment=require(_0x7621('0x4'));var BPromise=require(_0x7621('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7621('0x6'));var ejs=require(_0x7621('0x7'));var fs=require('fs');var fs_extra=require(_0x7621('0x8'));var _=require(_0x7621('0x9'));var squel=require(_0x7621('0xa'));var crypto=require(_0x7621('0xb'));var jsforce=require(_0x7621('0xc'));var deskjs=require(_0x7621('0xd'));var toCsv=require(_0x7621('0x6'));var querystring=require(_0x7621('0xe'));var Papa=require(_0x7621('0xf'));var Redis=require(_0x7621('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7621('0x11'));var as=require(_0x7621('0x12'));var hardwareService=require(_0x7621('0x13'));var logger=require('../../config/logger')(_0x7621('0x14'));var utils=require(_0x7621('0x15'));var config=require(_0x7621('0x16'));var licenseUtil=require(_0x7621('0x17'));var db=require(_0x7621('0x18'))['db'];config[_0x7621('0x19')]=_[_0x7621('0x1a')](config[_0x7621('0x19')],{'host':_0x7621('0x1b'),'port':0x18eb});var socket=require(_0x7621('0x1c'))(new Redis(config['redis']));require(_0x7621('0x1d'))[_0x7621('0x1e')](socket);function respondWithStatusCode(_0x27209e,_0x4bbe90){_0x4bbe90=_0x4bbe90||0xcc;return function(_0x4f372e){if(_0x4f372e){return _0x27209e['sendStatus'](_0x4bbe90);}return _0x27209e['status'](_0x4bbe90)['end']();};}function respondWithResult(_0x2f7cfc,_0x373499){_0x373499=_0x373499||0xc8;return function(_0x5229cc){if(_0x5229cc){return _0x2f7cfc[_0x7621('0x1f')](_0x373499)[_0x7621('0x20')](_0x5229cc);}};}function respondWithFilteredResult(_0x16fe59,_0x41ac76){return function(_0x2b8052){if(_0x2b8052){var _0x46fd89=typeof _0x41ac76[_0x7621('0x21')]===_0x7621('0x22')&&typeof _0x41ac76[_0x7621('0x23')]==='undefined';var _0x4f0291=_0x2b8052['count'];var _0x5d21dc=_0x46fd89?0x0:_0x41ac76[_0x7621('0x21')];var _0xfe64fd=_0x46fd89?_0x2b8052[_0x7621('0x24')]:_0x41ac76[_0x7621('0x21')]+_0x41ac76['limit'];var _0x49be3d;if(_0xfe64fd>=_0x4f0291){_0xfe64fd=_0x4f0291;_0x49be3d=0xc8;}else{_0x49be3d=0xce;}_0x16fe59[_0x7621('0x1f')](_0x49be3d);return _0x16fe59[_0x7621('0x25')](_0x7621('0x26'),_0x5d21dc+'-'+_0xfe64fd+'/'+_0x4f0291)[_0x7621('0x20')](_0x2b8052);}return null;};}function patchUpdates(_0x30db7f){return function(_0x1aedbb){try{jsonpatch[_0x7621('0x27')](_0x1aedbb,_0x30db7f,!![]);}catch(_0x1cf681){return BPromise[_0x7621('0x28')](_0x1cf681);}return _0x1aedbb['save']();};}function saveUpdates(_0x146f3c,_0x2f6fb4){return function(_0x3df884){if(_0x3df884){return _0x3df884[_0x7621('0x29')](_0x146f3c)['then'](function(_0x18c149){return _0x18c149;});}return null;};}function removeEntity(_0x8c3c96,_0x2a81b6){return function(_0x378a8c){if(_0x378a8c){return _0x378a8c[_0x7621('0x2a')]()[_0x7621('0x2b')](function(){var _0x215f24=_0x378a8c[_0x7621('0x2c')]({'plain':!![]});var _0x1a972e='FaxQueues';return db[_0x7621('0x2d')][_0x7621('0x2a')]({'where':{'type':_0x1a972e,'resourceId':_0x215f24['id']}})[_0x7621('0x2b')](function(){return _0x378a8c;});})[_0x7621('0x2b')](function(){_0x8c3c96[_0x7621('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34f581,_0x28c5b4){return function(_0x40de49){if(!_0x40de49){_0x34f581[_0x7621('0x2e')](0x194);}return _0x40de49;};}function handleError(_0x59ab16,_0xb68667){_0xb68667=_0xb68667||0x1f4;return function(_0x377075){logger['error'](_0x377075['stack']);if(_0x377075[_0x7621('0x2f')]){delete _0x377075[_0x7621('0x2f')];}_0x59ab16['status'](_0xb68667)[_0x7621('0x30')](_0x377075);};}exports[_0x7621('0x31')]=function(_0x24f042,_0x155f9d){var _0x532d90={},_0x40b78b={},_0x406f16={'count':0x0,'rows':[]};var _0x38ce8f=_['map'](db['FaxQueue'][_0x7621('0x32')],function(_0x131bf3){return{'name':_0x131bf3['fieldName'],'type':_0x131bf3[_0x7621('0x33')][_0x7621('0x34')]};});_0x40b78b[_0x7621('0x35')]=_[_0x7621('0x36')](_0x38ce8f,_0x7621('0x2f'));_0x40b78b[_0x7621('0x37')]=_[_0x7621('0x38')](_0x24f042['query']);_0x40b78b[_0x7621('0x39')]=_[_0x7621('0x3a')](_0x40b78b[_0x7621('0x35')],_0x40b78b[_0x7621('0x37')]);_0x532d90['attributes']=_[_0x7621('0x3a')](_0x40b78b[_0x7621('0x35')],qs[_0x7621('0x3b')](_0x24f042[_0x7621('0x37')]['fields']));_0x532d90[_0x7621('0x3c')]=_0x532d90[_0x7621('0x3c')][_0x7621('0x3d')]?_0x532d90[_0x7621('0x3c')]:_0x40b78b[_0x7621('0x35')];if(!_0x24f042['query'][_0x7621('0x3e')](_0x7621('0x3f'))){_0x532d90['limit']=qs[_0x7621('0x23')](_0x24f042[_0x7621('0x37')][_0x7621('0x23')]);_0x532d90[_0x7621('0x21')]=qs[_0x7621('0x21')](_0x24f042[_0x7621('0x37')][_0x7621('0x21')]);}_0x532d90['order']=qs[_0x7621('0x40')](_0x24f042[_0x7621('0x37')]['sort']);_0x532d90[_0x7621('0x41')]=qs[_0x7621('0x39')](_[_0x7621('0x42')](_0x24f042[_0x7621('0x37')],_0x40b78b['filters']),_0x38ce8f);if(_0x24f042['query'][_0x7621('0x43')]){_0x532d90[_0x7621('0x41')]=_[_0x7621('0x44')](_0x532d90[_0x7621('0x41')],{'$or':_[_0x7621('0x36')](_0x38ce8f,function(_0x50a9e9){if(_0x50a9e9[_0x7621('0x33')]!==_0x7621('0x45')){var _0x16bee2={};_0x16bee2[_0x50a9e9['name']]={'$like':'%'+_0x24f042[_0x7621('0x37')]['filter']+'%'};return _0x16bee2;}})});}_0x532d90=_['merge']({},_0x532d90,_0x24f042[_0x7621('0x46')]);var _0x4fbaac={'where':_0x532d90[_0x7621('0x41')]};return db[_0x7621('0x47')][_0x7621('0x24')](_0x4fbaac)[_0x7621('0x2b')](function(_0x5d055a){_0x406f16[_0x7621('0x24')]=_0x5d055a;if(_0x24f042[_0x7621('0x37')][_0x7621('0x48')]){_0x532d90[_0x7621('0x49')]=[{'all':!![]}];}return db[_0x7621('0x47')][_0x7621('0x4a')](_0x532d90);})[_0x7621('0x2b')](function(_0x1b3dc4){_0x406f16[_0x7621('0x4b')]=_0x1b3dc4;return _0x406f16;})[_0x7621('0x2b')](respondWithFilteredResult(_0x155f9d,_0x532d90))[_0x7621('0x4c')](handleError(_0x155f9d,null));};exports['show']=function(_0x2bbdfa,_0x509793){var _0x2ca396={'raw':!![],'where':{'id':_0x2bbdfa[_0x7621('0x4d')]['id']}},_0x365d47={};_0x365d47[_0x7621('0x35')]=_[_0x7621('0x38')](db[_0x7621('0x47')]['rawAttributes']);_0x365d47['query']=_[_0x7621('0x38')](_0x2bbdfa[_0x7621('0x37')]);_0x365d47[_0x7621('0x39')]=_['intersection'](_0x365d47[_0x7621('0x35')],_0x365d47[_0x7621('0x37')]);_0x2ca396[_0x7621('0x3c')]=_[_0x7621('0x3a')](_0x365d47['model'],qs['fields'](_0x2bbdfa[_0x7621('0x37')]['fields']));_0x2ca396[_0x7621('0x3c')]=_0x2ca396[_0x7621('0x3c')][_0x7621('0x3d')]?_0x2ca396['attributes']:_0x365d47['model'];if(_0x2bbdfa[_0x7621('0x37')][_0x7621('0x48')]){_0x2ca396[_0x7621('0x49')]=[{'all':!![]}];}_0x2ca396=_[_0x7621('0x44')]({},_0x2ca396,_0x2bbdfa[_0x7621('0x46')]);return db['FaxQueue'][_0x7621('0x4e')](_0x2ca396)['then'](handleEntityNotFound(_0x509793,null))['then'](respondWithResult(_0x509793,null))['catch'](handleError(_0x509793,null));};exports[_0x7621('0x4f')]=function(_0x3a6768,_0x5bff0b){return db[_0x7621('0x47')][_0x7621('0x4f')](_0x3a6768[_0x7621('0x50')],{})['then'](function(_0x41474e){var _0x1a96aa=_0x3a6768[_0x7621('0x51')][_0x7621('0x2c')]({'plain':!![]});if(!_0x1a96aa)throw new Error(_0x7621('0x52'));if(_0x1a96aa[_0x7621('0x53')]===_0x7621('0x51')){var _0xb3fcce=_0x41474e[_0x7621('0x2c')]({'plain':!![]});var _0x1aa400=_0x7621('0x54');return db[_0x7621('0x55')]['find']({'where':{'name':_0x1aa400,'userProfileId':_0x1a96aa[_0x7621('0x56')]},'raw':!![]})[_0x7621('0x2b')](function(_0x5a47c7){if(_0x5a47c7&&_0x5a47c7[_0x7621('0x57')]===0x0){return db[_0x7621('0x2d')]['create']({'name':_0xb3fcce[_0x7621('0x2f')],'resourceId':_0xb3fcce['id'],'type':_0x5a47c7[_0x7621('0x2f')],'sectionId':_0x5a47c7['id']},{})[_0x7621('0x2b')](function(){return _0x41474e;});}else{return _0x41474e;}})['catch'](function(_0x1e72a8){logger[_0x7621('0x58')](_0x7621('0x59'),_0x1e72a8);throw _0x1e72a8;});}return _0x41474e;})['then'](respondWithResult(_0x5bff0b,0xc9))[_0x7621('0x4c')](handleError(_0x5bff0b,null));};exports['update']=function(_0x4dcc72,_0x240a51){if(_0x4dcc72[_0x7621('0x50')]['id']){delete _0x4dcc72[_0x7621('0x50')]['id'];}return db['FaxQueue'][_0x7621('0x4e')]({'where':{'id':_0x4dcc72[_0x7621('0x4d')]['id']}})['then'](handleEntityNotFound(_0x240a51,null))[_0x7621('0x2b')](saveUpdates(_0x4dcc72['body'],null))['then'](respondWithResult(_0x240a51,null))[_0x7621('0x4c')](handleError(_0x240a51,null));};exports[_0x7621('0x2a')]=function(_0x2f007c,_0x49f2cf){return db[_0x7621('0x47')][_0x7621('0x4e')]({'where':{'id':_0x2f007c[_0x7621('0x4d')]['id']}})[_0x7621('0x2b')](handleEntityNotFound(_0x49f2cf,null))[_0x7621('0x2b')](removeEntity(_0x49f2cf,null))[_0x7621('0x4c')](handleError(_0x49f2cf,null));};exports['describe']=function(_0x14bb3e,_0x4f010f){return db[_0x7621('0x47')]['describe']()[_0x7621('0x2b')](respondWithResult(_0x4f010f,null))[_0x7621('0x4c')](handleError(_0x4f010f,null));};exports[_0x7621('0x5a')]=function(_0x24518d,_0x3a7eef,_0x4f3087){var _0x2aa05a={'raw':!![],'where':{}},_0x2b6a6c={},_0x34a556;return db[_0x7621('0x47')][_0x7621('0x5b')]({'where':{'id':_0x24518d[_0x7621('0x4d')]['id']}})[_0x7621('0x2b')](handleEntityNotFound(_0x3a7eef,null))[_0x7621('0x2b')](function(_0x5b9b8f){if(_0x5b9b8f){_0x34a556=_0x5b9b8f[_0x7621('0x2c')]({'plain':!![]});_0x2b6a6c[_0x7621('0x35')]=_[_0x7621('0x38')](db['UserFaxQueue'][_0x7621('0x32')]);_0x2b6a6c[_0x7621('0x37')]=_[_0x7621('0x38')](_0x24518d[_0x7621('0x37')]);_0x2b6a6c[_0x7621('0x39')]=_['intersection'](_0x2b6a6c['model'],_0x2b6a6c[_0x7621('0x37')]);_0x2aa05a[_0x7621('0x3c')]=_[_0x7621('0x3a')](_0x2b6a6c[_0x7621('0x35')],qs[_0x7621('0x3b')](_0x24518d['query'][_0x7621('0x3b')]));_0x2aa05a['attributes']=_0x2aa05a['attributes'][_0x7621('0x3d')]?_0x2aa05a[_0x7621('0x3c')]:_0x2b6a6c['model'];if(!_0x24518d[_0x7621('0x37')][_0x7621('0x3e')](_0x7621('0x3f'))){_0x2aa05a[_0x7621('0x23')]=qs[_0x7621('0x23')](_0x24518d[_0x7621('0x37')][_0x7621('0x23')]);_0x2aa05a[_0x7621('0x21')]=qs[_0x7621('0x21')](_0x24518d[_0x7621('0x37')][_0x7621('0x21')]);}_0x2aa05a[_0x7621('0x5c')]=qs[_0x7621('0x40')](_0x24518d[_0x7621('0x37')][_0x7621('0x40')]);_0x2aa05a[_0x7621('0x41')]=qs[_0x7621('0x39')](_['pick'](_0x24518d['query'],_0x2b6a6c[_0x7621('0x39')]));_0x2aa05a[_0x7621('0x41')][_0x7621('0x5d')]=_0x5b9b8f['id'];if(_0x24518d['query'][_0x7621('0x43')]){_0x2aa05a[_0x7621('0x41')]=_[_0x7621('0x44')](_0x2aa05a[_0x7621('0x41')],{'$or':_[_0x7621('0x36')](_0x2aa05a[_0x7621('0x3c')],function(_0x5296b6){var _0x47f4dd={};_0x47f4dd[_0x5296b6]={'$like':'%'+_0x24518d[_0x7621('0x37')][_0x7621('0x43')]+'%'};return _0x47f4dd;})});}_0x2aa05a=_[_0x7621('0x44')]({},_0x2aa05a,_0x24518d[_0x7621('0x46')]);return db[_0x7621('0x5e')][_0x7621('0x4a')](_0x2aa05a);}})[_0x7621('0x2b')](function(_0x592919){if(_0x592919){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x592919,'UserId'),'role':_0x7621('0x5f')},'attributes':['id',_0x7621('0x2f'),_0x7621('0x60'),_0x7621('0x61'),'createdAt']});}})['then'](function(_0x5bf9c2){if(_0x5bf9c2){return{'count':_0x5bf9c2[_0x7621('0x24')],'rows':_['map'](_0x5bf9c2[_0x7621('0x4b')],function(_0x535b63){return{'membername':_0x535b63[_0x7621('0x2f')],'UserId':_0x535b63['id'],'queue_name':_0x34a556[_0x7621('0x2f')],'FaxQueueId':_0x34a556['id'],'interface':util[_0x7621('0x62')](_0x7621('0x63'),_0x7621('0x64'),_0x535b63[_0x7621('0x2f')]),'penalty':0x0,'paused':_0x535b63[_0x7621('0x60')],'createdAt':_0x535b63['createdAt'],'updatedAt':_0x535b63[_0x7621('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7621('0x2b')](respondWithFilteredResult(_0x3a7eef,_0x2aa05a))['catch'](handleError(_0x3a7eef,null));};exports['getTeams']=function(_0x416c95,_0x4e79fb,_0xd2aedc){var _0x417a43={};var _0x373449={};var _0x4c999d;var _0x459b87;return db[_0x7621('0x47')]['findOne']({'where':{'id':_0x416c95[_0x7621('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e79fb,null))[_0x7621('0x2b')](function(_0x30a2d8){if(_0x30a2d8){_0x4c999d=_0x30a2d8;_0x373449[_0x7621('0x35')]=_['keys'](db['Team'][_0x7621('0x32')]);_0x373449[_0x7621('0x37')]=_[_0x7621('0x38')](_0x416c95[_0x7621('0x37')]);_0x373449[_0x7621('0x39')]=_[_0x7621('0x3a')](_0x373449[_0x7621('0x35')],_0x373449[_0x7621('0x37')]);_0x417a43['attributes']=_[_0x7621('0x3a')](_0x373449['model'],qs[_0x7621('0x3b')](_0x416c95[_0x7621('0x37')][_0x7621('0x3b')]));_0x417a43[_0x7621('0x3c')]=_0x417a43[_0x7621('0x3c')][_0x7621('0x3d')]?_0x417a43['attributes']:_0x373449[_0x7621('0x35')];_0x417a43['order']=qs[_0x7621('0x40')](_0x416c95[_0x7621('0x37')][_0x7621('0x40')]);_0x417a43[_0x7621('0x41')]=qs[_0x7621('0x39')](_[_0x7621('0x42')](_0x416c95['query'],_0x373449[_0x7621('0x39')]));if(_0x416c95[_0x7621('0x37')][_0x7621('0x43')]){_0x417a43[_0x7621('0x41')]=_[_0x7621('0x44')](_0x417a43[_0x7621('0x41')],{'$or':_[_0x7621('0x36')](_0x417a43[_0x7621('0x3c')],function(_0x593297){var _0x125fcd={};_0x125fcd[_0x593297]={'$like':'%'+_0x416c95[_0x7621('0x37')][_0x7621('0x43')]+'%'};return _0x125fcd;})});}_0x417a43=_[_0x7621('0x44')]({},_0x417a43,_0x416c95['options']);return _0x4c999d[_0x7621('0x65')](_0x417a43);}})[_0x7621('0x2b')](function(_0x2ad671){if(_0x2ad671){_0x459b87=_0x2ad671[_0x7621('0x3d')];if(!_0x416c95[_0x7621('0x37')][_0x7621('0x3e')](_0x7621('0x3f'))){_0x417a43['limit']=qs[_0x7621('0x23')](_0x416c95['query'][_0x7621('0x23')]);_0x417a43[_0x7621('0x21')]=qs[_0x7621('0x21')](_0x416c95['query']['offset']);}return _0x4c999d[_0x7621('0x65')](_0x417a43);}})[_0x7621('0x2b')](function(_0x5b1765){if(_0x5b1765){return _0x5b1765?{'count':_0x459b87,'rows':_0x5b1765}:null;}})['then'](respondWithResult(_0x4e79fb,null))[_0x7621('0x4c')](handleError(_0x4e79fb,null));};exports[_0x7621('0x66')]=function(_0x3efef6,_0x26c75e,_0x4cde77){var _0x36106e=_0x3efef6['body']['ids'];return db['Team'][_0x7621('0x4a')]({'where':{'id':_0x36106e},'attributes':['id'],'include':[{'model':db[_0x7621('0x67')],'as':_0x7621('0x68'),'attributes':['id',_0x7621('0x2f'),_0x7621('0x69'),_0x7621('0x6a'),_0x7621('0x6b')],'raw':!![]}]})['then'](function(_0x12363c){if(_0x12363c){var _0x3af63d=_['flatMap'](_0x12363c,function(_0x6a3ee4){var _0x4874d3=_0x6a3ee4['get']({'plain':!![]});return _0x4874d3[_0x7621('0x68')];});return db['FaxQueue'][_0x7621('0x4e')]({'where':{'id':_0x3efef6[_0x7621('0x4d')]['id']}})['then'](function(_0x5d0c14){return db[_0x7621('0x6c')][_0x7621('0x6d')](function(_0x50ad34){return _0x5d0c14[_0x7621('0x66')](_0x36106e,{'transaction':_0x50ad34})['then'](function(){return BPromise[_0x7621('0x6e')](_0x3af63d,function(_0x2fc465){return db[_0x7621('0x5e')]['findOrCreate']({'where':{'UserId':_0x2fc465['id'],'FaxQueueId':_0x3efef6[_0x7621('0x4d')]['id']},'transaction':_0x50ad34});});})['then'](function(){_0x3af63d[_0x7621('0x6f')](function(_0x192bfc){socket['emit'](_0x7621('0x70'),{'UserId':_0x192bfc['id'],'FaxQueueId':_0x5d0c14['id']});});});});});}})[_0x7621('0x2b')](respondWithStatusCode(_0x26c75e,null))['catch'](handleError(_0x26c75e,null));};exports[_0x7621('0x71')]=function(_0xe97af0,_0x4b90ce,_0x34783a){return db[_0x7621('0x72')]['findAll']({'where':{'id':_0xe97af0[_0x7621('0x37')][_0x7621('0x73')]},'attributes':['id'],'include':[{'model':db[_0x7621('0x67')],'as':_0x7621('0x68'),'attributes':['id'],'raw':!![]}]})[_0x7621('0x2b')](handleEntityNotFound(_0x4b90ce,null))[_0x7621('0x2b')](function(_0xb7a471){var _0x2274e2=_[_0x7621('0x36')](_0xb7a471,'id');var _0x2cd719=[];var _0x1b9083=[];var _0x3be7e9=squel['select']();_0x3be7e9['field'](_0x7621('0x74'))[_0x7621('0x75')]('team_has_fax_queues','tq')[_0x7621('0x76')](_0x7621('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7621('0x41')](_0x7621('0x78'),_0xe97af0['params']['id']);for(var _0x414982=0x0;_0x414982<_0xb7a471['length'];_0x414982+=0x1){let _0x16bc1e=_0xb7a471[_0x414982];for(var _0x1d7433=0x0;_0x1d7433<_0x16bc1e[_0x7621('0x68')][_0x7621('0x3d')];_0x1d7433+=0x1){let _0x3995b1=_0x16bc1e[_0x7621('0x68')][_0x1d7433];var _0x4c645a=_0x3be7e9['clone']();_0x4c645a[_0x7621('0x41')](_0x7621('0x79'),_0x3995b1['id']);_0x1b9083[_0x7621('0x7a')](db[_0x7621('0x6c')][_0x7621('0x37')](_0x4c645a[_0x7621('0x7b')](),{'type':db[_0x7621('0x6c')][_0x7621('0x7c')][_0x7621('0x7d')]})[_0x7621('0x2b')](function(_0x287d5b){if(_0x287d5b[_0x7621('0x3d')]===0x1){return _0x3995b1['id'];}else{var _0x35e840=_[_0x7621('0x7e')](_[_0x7621('0x36')](_0x287d5b,_0x7621('0x7f')),function(_0x2a75e2){return _['includes'](_0x2274e2,_0x2a75e2);});if(_0x35e840){return _0x3995b1['id'];}}}));}}return BPromise[_0x7621('0x80')](_0x1b9083)['then'](function(_0x4c051c){_0x2cd719=_(_0x2cd719)[_0x7621('0x81')](_0x4c051c)[_0x7621('0x82')]()[_0x7621('0x83')]();return db[_0x7621('0x47')]['find']({'where':{'id':_0xe97af0['params']['id']}})['then'](function(_0x46f471){return db['sequelize']['transaction'](function(_0x5d0db4){return _0x46f471[_0x7621('0x71')](_0xe97af0[_0x7621('0x37')][_0x7621('0x73')],{'transaction':_0x5d0db4})[_0x7621('0x2b')](function(){if(!_[_0x7621('0x84')](_0x2cd719)){return _0x46f471[_0x7621('0x85')](_0x2cd719,{'transaction':_0x5d0db4});}})[_0x7621('0x2b')](function(){_0x2cd719[_0x7621('0x6f')](function(_0x1a31dd){socket['emit'](_0x7621('0x86'),{'UserId':_0x1a31dd,'FaxQueueId':_0x46f471['id']});});});});});});})[_0x7621('0x2b')](respondWithStatusCode(_0x4b90ce,null))[_0x7621('0x4c')](handleError(_0x4b90ce,null));};exports[_0x7621('0x87')]=function(_0x44aaf8,_0x4ba430,_0x2d74ec){return db['FaxQueue'][_0x7621('0x4e')]({'where':{'id':_0x44aaf8[_0x7621('0x4d')]['id']}})[_0x7621('0x2b')](handleEntityNotFound(_0x4ba430,null))[_0x7621('0x2b')](function(_0x178f33){if(_0x178f33){return _0x178f33[_0x7621('0x87')](_0x44aaf8[_0x7621('0x50')]['ids'],_[_0x7621('0x88')](_0x44aaf8['body'],[_0x7621('0x73'),'id'])||{})[_0x7621('0x89')](function(_0x3a2bae){for(var _0x1b3258=0x0;_0x1b3258<_0x44aaf8['body']['ids'][_0x7621('0x3d')];_0x1b3258+=0x1){socket[_0x7621('0x8a')](_0x7621('0x70'),{'UserId':Number(_0x44aaf8[_0x7621('0x50')][_0x7621('0x73')][_0x1b3258]),'FaxQueueId':Number(_0x44aaf8[_0x7621('0x4d')]['id'])});}return _0x3a2bae;});}})[_0x7621('0x2b')](respondWithResult(_0x4ba430,null))[_0x7621('0x4c')](handleError(_0x4ba430,null));};exports[_0x7621('0x85')]=function(_0x189426,_0xd261fd,_0x4f4895){return db[_0x7621('0x47')][_0x7621('0x4e')]({'where':{'id':_0x189426['params']['id']}})['then'](handleEntityNotFound(_0xd261fd,null))['then'](function(_0x12396e){if(_0x12396e){return _0x12396e[_0x7621('0x85')](_0x189426[_0x7621('0x37')][_0x7621('0x73')])['then'](function(){if(_[_0x7621('0x8b')](_0x189426[_0x7621('0x37')]['ids'])){for(var _0x4059d1=0x0;_0x4059d1<_0x189426['query'][_0x7621('0x73')][_0x7621('0x3d')];_0x4059d1+=0x1){socket[_0x7621('0x8a')](_0x7621('0x86'),{'UserId':Number(_0x189426[_0x7621('0x37')]['ids'][_0x4059d1]),'FaxQueueId':Number(_0x189426[_0x7621('0x4d')]['id'])});}}else{socket[_0x7621('0x8a')](_0x7621('0x86'),{'UserId':Number(_0x189426[_0x7621('0x37')][_0x7621('0x73')]),'FaxQueueId':Number(_0x189426[_0x7621('0x4d')]['id'])});}});}})[_0x7621('0x2b')](respondWithStatusCode(_0xd261fd,null))[_0x7621('0x4c')](handleError(_0xd261fd,null));};exports['getAgents']=function(_0x18e223,_0x5d0ca2,_0x34ab2f){var _0x37c7ed={};var _0x2ddce1={};var _0x35d1e9;var _0x22424f;return db[_0x7621('0x47')][_0x7621('0x5b')]({'where':{'id':_0x18e223[_0x7621('0x4d')]['id']}})[_0x7621('0x2b')](handleEntityNotFound(_0x5d0ca2,null))[_0x7621('0x2b')](function(_0x56b53f){if(_0x56b53f){_0x35d1e9=_0x56b53f;_0x2ddce1[_0x7621('0x35')]=_[_0x7621('0x38')](db[_0x7621('0x67')][_0x7621('0x32')]);_0x2ddce1[_0x7621('0x37')]=_['keys'](_0x18e223[_0x7621('0x37')]);_0x2ddce1[_0x7621('0x39')]=_[_0x7621('0x3a')](_0x2ddce1['model'],_0x2ddce1['query']);_0x37c7ed['attributes']=_[_0x7621('0x3a')](_0x2ddce1[_0x7621('0x35')],qs['fields'](_0x18e223['query'][_0x7621('0x3b')]));_0x37c7ed['attributes']=_0x37c7ed['attributes'][_0x7621('0x3d')]?_0x37c7ed['attributes']:_0x2ddce1[_0x7621('0x35')];_0x37c7ed['order']=qs[_0x7621('0x40')](_0x18e223[_0x7621('0x37')][_0x7621('0x40')]);_0x37c7ed[_0x7621('0x41')]=qs[_0x7621('0x39')](_[_0x7621('0x42')](_0x18e223[_0x7621('0x37')],_0x2ddce1['filters']));if(_0x18e223['query']['filter']){_0x37c7ed[_0x7621('0x41')]=_['merge'](_0x37c7ed[_0x7621('0x41')],{'$or':_['map'](_0x37c7ed['attributes'],function(_0x210389){var _0x4dd8aa={};_0x4dd8aa[_0x210389]={'$like':'%'+_0x18e223[_0x7621('0x37')][_0x7621('0x43')]+'%'};return _0x4dd8aa;})});}_0x37c7ed=_['merge']({},_0x37c7ed,_0x18e223[_0x7621('0x46')]);return _0x35d1e9[_0x7621('0x8c')](_0x37c7ed);}})[_0x7621('0x2b')](function(_0x498f87){if(_0x498f87){_0x22424f=_0x498f87[_0x7621('0x3d')];if(!_0x18e223['query']['hasOwnProperty'](_0x7621('0x3f'))){_0x37c7ed['limit']=qs[_0x7621('0x23')](_0x18e223[_0x7621('0x37')][_0x7621('0x23')]);_0x37c7ed[_0x7621('0x21')]=qs[_0x7621('0x21')](_0x18e223['query'][_0x7621('0x21')]);}return _0x35d1e9['getAgents'](_0x37c7ed);}})[_0x7621('0x2b')](function(_0x330c82){if(_0x330c82){return _0x330c82?{'count':_0x22424f,'rows':_0x330c82}:null;}})[_0x7621('0x2b')](respondWithResult(_0x5d0ca2,null))[_0x7621('0x4c')](handleError(_0x5d0ca2,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 97c17ed..81cf69c 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 _0xe4e8=['setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue'];(function(_0x348a2b,_0x4a94aa){var _0x504bb1=function(_0x5ec614){while(--_0x5ec614){_0x348a2b['push'](_0x348a2b['shift']());}};_0x504bb1(++_0x4a94aa);}(_0xe4e8,0x14d));var _0x8e4e=function(_0x1c7b72,_0xa118a4){_0x1c7b72=_0x1c7b72-0x0;var _0x3ddd28=_0xe4e8[_0x1c7b72];return _0x3ddd28;};'use strict';var EventEmitter=require(_0x8e4e('0x0'));var FaxQueue=require(_0x8e4e('0x1'))['db'][_0x8e4e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8e4e('0x3')](0x0);var events={'afterCreate':_0x8e4e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x86b2f4){return function(_0x520232,_0x3edf01,_0x270b6a){FaxQueueEvents[_0x8e4e('0x5')](_0x86b2f4+':'+_0x520232['id'],_0x520232);FaxQueueEvents['emit'](_0x86b2f4,_0x520232);_0x270b6a(null);};}for(var e in events){if(events[_0x8e4e('0x6')](e)){var event=events[e];FaxQueue[_0x8e4e('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x55ef=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xcba4b6,_0x1ecf6a){var _0x2bd8bf=function(_0x46812a){while(--_0x46812a){_0xcba4b6['push'](_0xcba4b6['shift']());}};_0x2bd8bf(++_0x1ecf6a);}(_0x55ef,0x135));var _0xf55e=function(_0x554112,_0x325a2a){_0x554112=_0x554112-0x0;var _0x952a74=_0x55ef[_0x554112];return _0x952a74;};'use strict';var EventEmitter=require(_0xf55e('0x0'));var FaxQueue=require(_0xf55e('0x1'))['db'][_0xf55e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf55e('0x3')](0x0);var events={'afterCreate':_0xf55e('0x4'),'afterUpdate':_0xf55e('0x5'),'afterDestroy':_0xf55e('0x6')};function emitEvent(_0x2d6257){return function(_0xd8c51f,_0x3fe761,_0x4877cf){FaxQueueEvents[_0xf55e('0x7')](_0x2d6257+':'+_0xd8c51f['id'],_0xd8c51f);FaxQueueEvents[_0xf55e('0x7')](_0x2d6257,_0xd8c51f);_0x4877cf(null);};}for(var e in events){if(events[_0xf55e('0x8')](e)){var event=events[e];FaxQueue[_0xf55e('0x9')](e,emitEvent(event));}}module[_0xf55e('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e64259b..2e2ae1b 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 _0x7346=['path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1bd92d,_0x5a3707){var _0x628149=function(_0x74e0ef){while(--_0x74e0ef){_0x1bd92d['push'](_0x1bd92d['shift']());}};_0x628149(++_0x5a3707);}(_0x7346,0xc1));var _0x6734=function(_0x4d3a0b,_0x22b4c1){_0x4d3a0b=_0x4d3a0b-0x0;var _0x319e48=_0x7346[_0x4d3a0b];return _0x319e48;};'use strict';var _=require('lodash');var util=require(_0x6734('0x0'));var logger=require(_0x6734('0x1'))(_0x6734('0x2'));var moment=require('moment');var BPromise=require(_0x6734('0x3'));var rp=require(_0x6734('0x4'));var fs=require('fs');var path=require(_0x6734('0x5'));var rimraf=require(_0x6734('0x6'));var config=require('../../config/environment');var attributes=require(_0x6734('0x7'));module[_0x6734('0x8')]=function(_0x5f08e9,_0x1871d5){return _0x5f08e9[_0x6734('0x9')](_0x6734('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9845=['define','fax_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x28c574,_0x3282b1){var _0x3f1093=function(_0x4b5b2d){while(--_0x4b5b2d){_0x28c574['push'](_0x28c574['shift']());}};_0x3f1093(++_0x3282b1);}(_0x9845,0x18e));var _0x5984=function(_0x2629f2,_0x2ac3de){_0x2629f2=_0x2629f2-0x0;var _0x5a59e4=_0x9845[_0x2629f2];return _0x5a59e4;};'use strict';var _=require(_0x5984('0x0'));var util=require('util');var logger=require(_0x5984('0x1'))(_0x5984('0x2'));var moment=require('moment');var BPromise=require(_0x5984('0x3'));var rp=require(_0x5984('0x4'));var fs=require('fs');var path=require(_0x5984('0x5'));var rimraf=require(_0x5984('0x6'));var config=require(_0x5984('0x7'));var attributes=require(_0x5984('0x8'));module[_0x5984('0x9')]=function(_0xc66913,_0x40d42f){return _0xc66913[_0x5984('0xa')]('FaxQueue',attributes,{'tableName':_0x5984('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index f33dc83..ec3c2ad 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 _0x4f5a=['FaxQueue','options','where','attributes','limit','include','model','map','debug','catch','ShowFaxQueue','find','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxQueue'];(function(_0x1cd216,_0x2a8f58){var _0x5b9d23=function(_0x34a4b4){while(--_0x34a4b4){_0x1cd216['push'](_0x1cd216['shift']());}};_0x5b9d23(++_0x2a8f58);}(_0x4f5a,0xa9));var _0xa4f5=function(_0x399d5e,_0x51b93a){_0x399d5e=_0x399d5e-0x0;var _0x428186=_0x4f5a[_0x399d5e];return _0x428186;};'use strict';var _=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var moment=require('moment');var BPromise=require(_0xa4f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4f5('0x4'));var logger=require(_0xa4f5('0x5'))(_0xa4f5('0x6'));var config=require(_0xa4f5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa4f5('0x8')][_0xa4f5('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa4f5('0xa')],{'host':_0xa4f5('0xb'),'port':0x18eb});var socket=require(_0xa4f5('0xc'))(new Redis(config[_0xa4f5('0xa')]));require(_0xa4f5('0xd'))[_0xa4f5('0xe')](socket);function respondWithRpcPromise(_0x3ba156,_0x3b604f,_0x158cca){return new BPromise(function(_0x235d91,_0x361052){return client[_0xa4f5('0xf')](_0x3ba156,_0x158cca)[_0xa4f5('0x10')](function(_0x12ed61){logger[_0xa4f5('0x11')](_0xa4f5('0x12'),_0x3b604f,_0xa4f5('0x13'));logger['debug'](_0xa4f5('0x14'),_0x3b604f,_0xa4f5('0x13'),JSON['stringify'](_0x12ed61));if(_0x12ed61['error']){if(_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x16')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x3b604f,_0x12ed61[_0xa4f5('0x15')]['message']);return _0x361052(_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x17')]);}logger[_0xa4f5('0x15')](_0xa4f5('0x12'),_0x3b604f,_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x17')]);return _0x235d91(_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x17')]);}else{logger[_0xa4f5('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3b604f,_0xa4f5('0x13'));_0x235d91(_0x12ed61[_0xa4f5('0x18')][_0xa4f5('0x17')]);}})['catch'](function(_0x4b7879){logger[_0xa4f5('0x15')]('FaxQueue,\x20%s,\x20%s',_0x3b604f,_0x4b7879);_0x361052(_0x4b7879);});});}exports[_0xa4f5('0x19')]=function(_0x310c34){var _0x5acbbc=this;return new Promise(function(_0x42ba08,_0x30a316){return db[_0xa4f5('0x1a')]['findAll']({'raw':_0x310c34['options']?_0x310c34[_0xa4f5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x310c34[_0xa4f5('0x1b')]?_0x310c34['options'][_0xa4f5('0x1c')]||null:null,'attributes':_0x310c34[_0xa4f5('0x1b')]?_0x310c34['options'][_0xa4f5('0x1d')]||null:null,'limit':_0x310c34[_0xa4f5('0x1b')]?_0x310c34[_0xa4f5('0x1b')][_0xa4f5('0x1e')]||null:null,'include':_0x310c34[_0xa4f5('0x1b')]?_0x310c34[_0xa4f5('0x1b')]['include']?_['map'](_0x310c34[_0xa4f5('0x1b')][_0xa4f5('0x1f')],function(_0x5e4ab2){return{'model':db[_0x5e4ab2[_0xa4f5('0x20')]],'as':_0x5e4ab2['as'],'attributes':_0x5e4ab2[_0xa4f5('0x1d')],'include':_0x5e4ab2[_0xa4f5('0x1f')]?_[_0xa4f5('0x21')](_0x5e4ab2[_0xa4f5('0x1f')],function(_0x26a75f){return{'model':db[_0x26a75f[_0xa4f5('0x20')]],'as':_0x26a75f['as'],'attributes':_0x26a75f['attributes'],'include':_0x26a75f['include']?_[_0xa4f5('0x21')](_0x26a75f[_0xa4f5('0x1f')],function(_0x472323){return{'model':db[_0x472323['model']],'as':_0x472323['as'],'attributes':_0x472323[_0xa4f5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa4f5('0x10')](function(_0x3810b8){logger[_0xa4f5('0x11')](_0xa4f5('0x19'),_0x310c34);logger[_0xa4f5('0x22')](_0xa4f5('0x19'),_0x310c34,JSON['stringify'](_0x3810b8));_0x42ba08(_0x3810b8);})[_0xa4f5('0x23')](function(_0x3b14fa){logger['error'](_0xa4f5('0x19'),_0x3b14fa[_0xa4f5('0x17')],_0x310c34);_0x30a316(_0x5acbbc['error'](0x1f4,_0x3b14fa['message']));});});};exports[_0xa4f5('0x24')]=function(_0x305a31){var _0x32a747=this;return new Promise(function(_0x5978e2,_0x22af4b){return db['FaxQueue'][_0xa4f5('0x25')]({'raw':_0x305a31['options']?_0x305a31['options'][_0xa4f5('0x26')]===undefined?!![]:![]:!![],'where':_0x305a31[_0xa4f5('0x1b')]?_0x305a31[_0xa4f5('0x1b')][_0xa4f5('0x1c')]||null:null,'attributes':_0x305a31[_0xa4f5('0x1b')]?_0x305a31[_0xa4f5('0x1b')][_0xa4f5('0x1d')]||null:null,'include':_0x305a31[_0xa4f5('0x1b')]?_0x305a31['options']['include']?_[_0xa4f5('0x21')](_0x305a31[_0xa4f5('0x1b')][_0xa4f5('0x1f')],function(_0x305539){return{'model':db[_0x305539['model']],'as':_0x305539['as'],'attributes':_0x305539[_0xa4f5('0x1d')],'include':_0x305539['include']?_[_0xa4f5('0x21')](_0x305539[_0xa4f5('0x1f')],function(_0x15e937){return{'model':db[_0x15e937[_0xa4f5('0x20')]],'as':_0x15e937['as'],'attributes':_0x15e937[_0xa4f5('0x1d')],'include':_0x15e937['include']?_[_0xa4f5('0x21')](_0x15e937[_0xa4f5('0x1f')],function(_0x204acf){return{'model':db[_0x204acf[_0xa4f5('0x20')]],'as':_0x204acf['as'],'attributes':_0x204acf[_0xa4f5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa4f5('0x10')](function(_0x58b06a){logger['info'](_0xa4f5('0x24'),_0x305a31);logger['debug'](_0xa4f5('0x24'),_0x305a31,JSON['stringify'](_0x58b06a));_0x5978e2(_0x58b06a);})[_0xa4f5('0x23')](function(_0x1f406d){logger[_0xa4f5('0x15')](_0xa4f5('0x24'),_0x1f406d['message'],_0x305a31);_0x22af4b(_0x32a747[_0xa4f5('0x15')](0x1f4,_0x1f406d['message']));});});}; \ No newline at end of file +var _0x4cd8=['find','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','map','model','ShowFaxQueue'];(function(_0x478020,_0x181316){var _0x17bbc3=function(_0x4d80d1){while(--_0x4d80d1){_0x478020['push'](_0x478020['shift']());}};_0x17bbc3(++_0x181316);}(_0x4cd8,0x158));var _0x84cd=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x4cd8[_0x261e29];return _0x25ef43;};'use strict';var _=require(_0x84cd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x84cd('0x1'));var rs=require(_0x84cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84cd('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x84cd('0x4'));var jayson=require(_0x84cd('0x5'));var client=jayson[_0x84cd('0x6')][_0x84cd('0x7')]({'port':0x232a});config['redis']=_[_0x84cd('0x8')](config[_0x84cd('0x9')],{'host':_0x84cd('0xa'),'port':0x18eb});var socket=require(_0x84cd('0xb'))(new Redis(config['redis']));require(_0x84cd('0xc'))[_0x84cd('0xd')](socket);function respondWithRpcPromise(_0x609d5,_0x2c7b38,_0x1cffb3){return new BPromise(function(_0xcc74da,_0x479605){return client[_0x84cd('0xe')](_0x609d5,_0x1cffb3)[_0x84cd('0xf')](function(_0x3454a2){logger[_0x84cd('0x10')]('FaxQueue,\x20%s,\x20%s',_0x2c7b38,'request\x20sent');logger[_0x84cd('0x11')](_0x84cd('0x12'),_0x2c7b38,'request\x20sent',JSON[_0x84cd('0x13')](_0x3454a2));if(_0x3454a2[_0x84cd('0x14')]){if(_0x3454a2['error'][_0x84cd('0x15')]===0x1f4){logger['error'](_0x84cd('0x16'),_0x2c7b38,_0x3454a2[_0x84cd('0x14')][_0x84cd('0x17')]);return _0x479605(_0x3454a2['error'][_0x84cd('0x17')]);}logger[_0x84cd('0x14')]('FaxQueue,\x20%s,\x20%s',_0x2c7b38,_0x3454a2[_0x84cd('0x14')][_0x84cd('0x17')]);return _0xcc74da(_0x3454a2['error'][_0x84cd('0x17')]);}else{logger[_0x84cd('0x10')](_0x84cd('0x16'),_0x2c7b38,'request\x20sent');_0xcc74da(_0x3454a2[_0x84cd('0x18')]['message']);}})[_0x84cd('0x19')](function(_0x954ddf){logger[_0x84cd('0x14')](_0x84cd('0x16'),_0x2c7b38,_0x954ddf);_0x479605(_0x954ddf);});});}exports[_0x84cd('0x1a')]=function(_0x4fa1d9){var _0x4543cc=this;return new Promise(function(_0x49b926,_0x98b57b){return db[_0x84cd('0x1b')][_0x84cd('0x1c')]({'raw':_0x4fa1d9[_0x84cd('0x1d')]?_0x4fa1d9[_0x84cd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4fa1d9['options']?_0x4fa1d9[_0x84cd('0x1d')][_0x84cd('0x1e')]||null:null,'attributes':_0x4fa1d9[_0x84cd('0x1d')]?_0x4fa1d9[_0x84cd('0x1d')][_0x84cd('0x1f')]||null:null,'limit':_0x4fa1d9[_0x84cd('0x1d')]?_0x4fa1d9[_0x84cd('0x1d')]['limit']||null:null,'include':_0x4fa1d9[_0x84cd('0x1d')]?_0x4fa1d9[_0x84cd('0x1d')][_0x84cd('0x20')]?_['map'](_0x4fa1d9['options'][_0x84cd('0x20')],function(_0x1df354){return{'model':db[_0x1df354['model']],'as':_0x1df354['as'],'attributes':_0x1df354['attributes'],'include':_0x1df354['include']?_[_0x84cd('0x21')](_0x1df354[_0x84cd('0x20')],function(_0x4ae75b){return{'model':db[_0x4ae75b[_0x84cd('0x22')]],'as':_0x4ae75b['as'],'attributes':_0x4ae75b[_0x84cd('0x1f')],'include':_0x4ae75b['include']?_[_0x84cd('0x21')](_0x4ae75b[_0x84cd('0x20')],function(_0x1805fb){return{'model':db[_0x1805fb['model']],'as':_0x1805fb['as'],'attributes':_0x1805fb[_0x84cd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x84cd('0xf')](function(_0x3b740c){logger[_0x84cd('0x10')](_0x84cd('0x1a'),_0x4fa1d9);logger[_0x84cd('0x11')](_0x84cd('0x1a'),_0x4fa1d9,JSON[_0x84cd('0x13')](_0x3b740c));_0x49b926(_0x3b740c);})[_0x84cd('0x19')](function(_0x526cc0){logger[_0x84cd('0x14')](_0x84cd('0x1a'),_0x526cc0[_0x84cd('0x17')],_0x4fa1d9);_0x98b57b(_0x4543cc[_0x84cd('0x14')](0x1f4,_0x526cc0['message']));});});};exports[_0x84cd('0x23')]=function(_0x571046){var _0xdae40d=this;return new Promise(function(_0x551d54,_0x56bb11){return db['FaxQueue'][_0x84cd('0x24')]({'raw':_0x571046[_0x84cd('0x1d')]?_0x571046[_0x84cd('0x1d')][_0x84cd('0x25')]===undefined?!![]:![]:!![],'where':_0x571046['options']?_0x571046[_0x84cd('0x1d')][_0x84cd('0x1e')]||null:null,'attributes':_0x571046['options']?_0x571046[_0x84cd('0x1d')][_0x84cd('0x1f')]||null:null,'include':_0x571046['options']?_0x571046[_0x84cd('0x1d')]['include']?_[_0x84cd('0x21')](_0x571046['options'][_0x84cd('0x20')],function(_0x52faf4){return{'model':db[_0x52faf4[_0x84cd('0x22')]],'as':_0x52faf4['as'],'attributes':_0x52faf4[_0x84cd('0x1f')],'include':_0x52faf4[_0x84cd('0x20')]?_[_0x84cd('0x21')](_0x52faf4[_0x84cd('0x20')],function(_0x35b2ed){return{'model':db[_0x35b2ed[_0x84cd('0x22')]],'as':_0x35b2ed['as'],'attributes':_0x35b2ed[_0x84cd('0x1f')],'include':_0x35b2ed['include']?_[_0x84cd('0x21')](_0x35b2ed[_0x84cd('0x20')],function(_0x342018){return{'model':db[_0x342018[_0x84cd('0x22')]],'as':_0x342018['as'],'attributes':_0x342018[_0x84cd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x84cd('0xf')](function(_0x2daabb){logger[_0x84cd('0x10')](_0x84cd('0x23'),_0x571046);logger[_0x84cd('0x11')]('ShowFaxQueue',_0x571046,JSON['stringify'](_0x2daabb));_0x551d54(_0x2daabb);})[_0x84cd('0x19')](function(_0x35b6e1){logger[_0x84cd('0x14')](_0x84cd('0x23'),_0x35b6e1[_0x84cd('0x17')],_0x571046);_0x56bb11(_0xdae40d['error'](0x1f4,_0x35b6e1[_0x84cd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9dad162..4e62344 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 _0x322d=['length','faxQueue:','./faxQueue.events','remove','emit','removeListener','register'];(function(_0x444d88,_0x56205b){var _0x7e70e3=function(_0x367ab7){while(--_0x367ab7){_0x444d88['push'](_0x444d88['shift']());}};_0x7e70e3(++_0x56205b);}(_0x322d,0x121));var _0xd322=function(_0xe5e3fb,_0x2fa636){_0xe5e3fb=_0xe5e3fb-0x0;var _0xdc5834=_0x322d[_0xe5e3fb];return _0xdc5834;};'use strict';var FaxQueueEvents=require(_0xd322('0x0'));var events=['save',_0xd322('0x1'),'update'];function createListener(_0x2cde9b,_0x1fd902){return function(_0x43661b){_0x1fd902[_0xd322('0x2')](_0x2cde9b,_0x43661b);};}function removeListener(_0x126439,_0x2124bc){return function(){FaxQueueEvents[_0xd322('0x3')](_0x126439,_0x2124bc);};}exports[_0xd322('0x4')]=function(_0x582a6d){for(var _0x11c722=0x0,_0x5343c5=events[_0xd322('0x5')];_0x11c722<_0x5343c5;_0x11c722++){var _0x3caf12=events[_0x11c722];var _0x416c8b=createListener(_0xd322('0x6')+_0x3caf12,_0x582a6d);FaxQueueEvents['on'](_0x3caf12,_0x416c8b);}}; \ No newline at end of file +var _0xa123=['length','faxQueue:','save','update','emit','removeListener','register'];(function(_0x1c2092,_0x34c981){var _0x23c77d=function(_0x5cef72){while(--_0x5cef72){_0x1c2092['push'](_0x1c2092['shift']());}};_0x23c77d(++_0x34c981);}(_0xa123,0x1c2));var _0x3a12=function(_0x225831,_0x3cc0d9){_0x225831=_0x225831-0x0;var _0x19341f=_0xa123[_0x225831];return _0x19341f;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x3a12('0x0'),'remove',_0x3a12('0x1')];function createListener(_0x22b4ae,_0x52e39d){return function(_0x34225e){_0x52e39d[_0x3a12('0x2')](_0x22b4ae,_0x34225e);};}function removeListener(_0x36d699,_0x540e72){return function(){FaxQueueEvents[_0x3a12('0x3')](_0x36d699,_0x540e72);};}exports[_0x3a12('0x4')]=function(_0x51723e){for(var _0x22dd8a=0x0,_0x2c3ce1=events[_0x3a12('0x5')];_0x22dd8a<_0x2c3ce1;_0x22dd8a++){var _0x4f90e8=events[_0x22dd8a];var _0x43da04=createListener(_0x3a12('0x6')+_0x4f90e8,_0x51723e);FaxQueueEvents['on'](_0x4f90e8,_0x43da04);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2c4ab76..ce91d40 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 _0x0a6b=['update','destroy','delete','removeTeams','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','index','/describe','describe','show','get','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x0a6b,0x18e));var _0xb0a6=function(_0xbe2b03,_0xb1f12e){_0xbe2b03=_0xbe2b03-0x0;var _0x50cfb7=_0x0a6b[_0xbe2b03];return _0x50cfb7;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var fs_extra=require(_0xb0a6('0x2'));var auth=require(_0xb0a6('0x3'));var interaction=require(_0xb0a6('0x4'));var config=require('../../config/environment');var controller=require(_0xb0a6('0x5'));router['get']('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x7')]);router['get'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb0a6('0xa')]);router[_0xb0a6('0xb')](_0xb0a6('0xc'),auth[_0xb0a6('0x6')](),controller['getMembers']);router[_0xb0a6('0xb')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0xe')]);router[_0xb0a6('0xb')](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x10')]);router[_0xb0a6('0x11')]('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x12')]);router[_0xb0a6('0x11')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0x13')]);router['post'](_0xb0a6('0xf'),auth['isAuthenticated'](),controller[_0xb0a6('0x14')]);router['put'](_0xb0a6('0x15'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x16')]);router['delete']('/:id',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x17')]);router[_0xb0a6('0x18')](_0xb0a6('0xd'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x19')]);router['delete'](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x1a')]);module[_0xb0a6('0x1b')]=router; \ No newline at end of file +var _0x3f8a=['delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','update'];(function(_0x61d2c5,_0x3841b8){var _0x4ee630=function(_0x56eb73){while(--_0x56eb73){_0x61d2c5['push'](_0x61d2c5['shift']());}};_0x4ee630(++_0x3841b8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x507ccd,_0x54afc9){_0x507ccd=_0x507ccd-0x0;var _0x36887d=_0x3f8a[_0x507ccd];return _0x36887d;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xa')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xa')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router['get'](_0xa3f8('0x11'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x12')]);router[_0xa3f8('0xa')]('/:id/teams',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x13')]);router[_0xa3f8('0xa')](_0xa3f8('0x14'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x15')]);router[_0xa3f8('0x16')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x17')]);router[_0xa3f8('0x16')](_0xa3f8('0x18'),auth[_0xa3f8('0xb')](),controller['addTeams']);router[_0xa3f8('0x16')](_0xa3f8('0x14'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x19')]);router['put'](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1a')]);router[_0xa3f8('0x1b')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1c')]);router[_0xa3f8('0x1b')](_0xa3f8('0x18'),auth[_0xa3f8('0xb')](),controller['removeTeams']);router[_0xa3f8('0x1b')]('/:id/users',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1d')]);module[_0xa3f8('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 3d4e7f8..b0774d1 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 _0x1961=['STRING','DATE','moment','sequelize','exports'];(function(_0x1a7536,_0x30c791){var _0x4660d9=function(_0x1db222){while(--_0x1db222){_0x1a7536['push'](_0x1a7536['shift']());}};_0x4660d9(++_0x30c791);}(_0x1961,0x15b));var _0x1196=function(_0x25cfdb,_0x4e0360){_0x25cfdb=_0x25cfdb-0x0;var _0x36811a=_0x1961[_0x25cfdb];return _0x36811a;};'use strict';var moment=require(_0x1196('0x0'));var Sequelize=require(_0x1196('0x1'));module[_0x1196('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1196('0x3')]},'joinAt':{'type':Sequelize[_0x1196('0x4')]},'leaveAt':{'type':Sequelize[_0x1196('0x4')]},'acceptAt':{'type':Sequelize[_0x1196('0x4')]},'exitAt':{'type':Sequelize[_0x1196('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6761=['moment','exports','STRING','DATE'];(function(_0x2dc80f,_0x2539da){var _0x321b57=function(_0xc086){while(--_0xc086){_0x2dc80f['push'](_0x2dc80f['shift']());}};_0x321b57(++_0x2539da);}(_0x6761,0xc0));var _0x1676=function(_0x3f4a89,_0x2546ab){_0x3f4a89=_0x3f4a89-0x0;var _0x1c6d0a=_0x6761[_0x3f4a89];return _0x1c6d0a;};'use strict';var moment=require(_0x1676('0x0'));var Sequelize=require('sequelize');module[_0x1676('0x1')]={'uniqueid':{'type':Sequelize[_0x1676('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1676('0x2')]},'joinAt':{'type':Sequelize[_0x1676('0x3')]},'leaveAt':{'type':Sequelize[_0x1676('0x3')]},'acceptAt':{'type':Sequelize[_0x1676('0x3')]},'exitAt':{'type':Sequelize[_0x1676('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 2717075..d6479df 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 _0x3cd1=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','then','stack','name','index','FaxQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','options','include','findAll','show','params','length','includeAll','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1d91b7,_0x6115d7){var _0x2b9c36=function(_0x187849){while(--_0x187849){_0x1d91b7['push'](_0x1d91b7['shift']());}};_0x2b9c36(++_0x6115d7);}(_0x3cd1,0x112));var _0x13cd=function(_0x3c009e,_0x24a891){_0x3c009e=_0x3c009e-0x0;var _0x244222=_0x3cd1[_0x3c009e];return _0x244222;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13cd('0x0'));var zipdir=require(_0x13cd('0x1'));var jsonpatch=require(_0x13cd('0x2'));var rp=require(_0x13cd('0x3'));var moment=require(_0x13cd('0x4'));var BPromise=require(_0x13cd('0x5'));var Mustache=require(_0x13cd('0x6'));var util=require(_0x13cd('0x7'));var path=require('path');var sox=require(_0x13cd('0x8'));var csv=require(_0x13cd('0x9'));var ejs=require(_0x13cd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x13cd('0xb'));var crypto=require(_0x13cd('0xc'));var jsforce=require(_0x13cd('0xd'));var deskjs=require(_0x13cd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x13cd('0xf'));var Papa=require(_0x13cd('0x10'));var Redis=require(_0x13cd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x13cd('0x12'));var hardwareService=require(_0x13cd('0x13'));var logger=require(_0x13cd('0x14'))(_0x13cd('0x15'));var utils=require(_0x13cd('0x16'));var config=require(_0x13cd('0x17'));var licenseUtil=require(_0x13cd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da3a7,_0x2fe1a0){_0x2fe1a0=_0x2fe1a0||0xcc;return function(_0x4bab73){if(_0x4bab73){return _0x1da3a7[_0x13cd('0x19')](_0x2fe1a0);}return _0x1da3a7[_0x13cd('0x1a')](_0x2fe1a0)[_0x13cd('0x1b')]();};}function respondWithResult(_0xfff1f2,_0x29e672){_0x29e672=_0x29e672||0xc8;return function(_0x473e50){if(_0x473e50){return _0xfff1f2[_0x13cd('0x1a')](_0x29e672)[_0x13cd('0x1c')](_0x473e50);}};}function respondWithFilteredResult(_0x5cf7a4,_0x24b647){return function(_0x4afa7a){if(_0x4afa7a){var _0x3d790d=typeof _0x24b647[_0x13cd('0x1d')]==='undefined'&&typeof _0x24b647[_0x13cd('0x1e')]===_0x13cd('0x1f');var _0x1af3e3=_0x4afa7a[_0x13cd('0x20')];var _0x1442eb=_0x3d790d?0x0:_0x24b647[_0x13cd('0x1d')];var _0x45b9de=_0x3d790d?_0x4afa7a[_0x13cd('0x20')]:_0x24b647['offset']+_0x24b647[_0x13cd('0x1e')];var _0x4dc631;if(_0x45b9de>=_0x1af3e3){_0x45b9de=_0x1af3e3;_0x4dc631=0xc8;}else{_0x4dc631=0xce;}_0x5cf7a4[_0x13cd('0x1a')](_0x4dc631);return _0x5cf7a4[_0x13cd('0x21')](_0x13cd('0x22'),_0x1442eb+'-'+_0x45b9de+'/'+_0x1af3e3)[_0x13cd('0x1c')](_0x4afa7a);}return null;};}function patchUpdates(_0x5d12b8){return function(_0x2f4368){try{jsonpatch['apply'](_0x2f4368,_0x5d12b8,!![]);}catch(_0x3d4eca){return BPromise[_0x13cd('0x23')](_0x3d4eca);}return _0x2f4368[_0x13cd('0x24')]();};}function saveUpdates(_0x10f682,_0x439ba1){return function(_0x17cfb3){if(_0x17cfb3){return _0x17cfb3['update'](_0x10f682)['then'](function(_0x2c3925){return _0x2c3925;});}return null;};}function removeEntity(_0x4fc1c2,_0x5144cc){return function(_0xc0503f){if(_0xc0503f){return _0xc0503f[_0x13cd('0x25')]()[_0x13cd('0x26')](function(){_0x4fc1c2['status'](0xcc)[_0x13cd('0x1b')]();});}};}function handleEntityNotFound(_0x11124f,_0x20f110){return function(_0x167fa1){if(!_0x167fa1){_0x11124f[_0x13cd('0x19')](0x194);}return _0x167fa1;};}function handleError(_0x1701a3,_0x190876){_0x190876=_0x190876||0x1f4;return function(_0x23019d){logger['error'](_0x23019d[_0x13cd('0x27')]);if(_0x23019d['name']){delete _0x23019d[_0x13cd('0x28')];}_0x1701a3[_0x13cd('0x1a')](_0x190876)['send'](_0x23019d);};}exports[_0x13cd('0x29')]=function(_0x136825,_0x256628){var _0x1f726b={},_0x3fd1f6={},_0x2079d1={'count':0x0,'rows':[]};var _0x115cfc=_['map'](db[_0x13cd('0x2a')]['rawAttributes'],function(_0x5ace47){return{'name':_0x5ace47[_0x13cd('0x2b')],'type':_0x5ace47['type']['key']};});_0x3fd1f6[_0x13cd('0x2c')]=_['map'](_0x115cfc,_0x13cd('0x28'));_0x3fd1f6[_0x13cd('0x2d')]=_[_0x13cd('0x2e')](_0x136825[_0x13cd('0x2d')]);_0x3fd1f6[_0x13cd('0x2f')]=_[_0x13cd('0x30')](_0x3fd1f6[_0x13cd('0x2c')],_0x3fd1f6[_0x13cd('0x2d')]);_0x1f726b[_0x13cd('0x31')]=_[_0x13cd('0x30')](_0x3fd1f6['model'],qs['fields'](_0x136825['query'][_0x13cd('0x32')]));_0x1f726b[_0x13cd('0x31')]=_0x1f726b[_0x13cd('0x31')]['length']?_0x1f726b[_0x13cd('0x31')]:_0x3fd1f6[_0x13cd('0x2c')];if(!_0x136825[_0x13cd('0x2d')][_0x13cd('0x33')](_0x13cd('0x34'))){_0x1f726b['limit']=qs[_0x13cd('0x1e')](_0x136825[_0x13cd('0x2d')][_0x13cd('0x1e')]);_0x1f726b[_0x13cd('0x1d')]=qs[_0x13cd('0x1d')](_0x136825[_0x13cd('0x2d')][_0x13cd('0x1d')]);}_0x1f726b[_0x13cd('0x35')]=qs[_0x13cd('0x36')](_0x136825['query']['sort']);_0x1f726b['where']=qs[_0x13cd('0x2f')](_['pick'](_0x136825[_0x13cd('0x2d')],_0x3fd1f6[_0x13cd('0x2f')]),_0x115cfc);if(_0x136825[_0x13cd('0x2d')][_0x13cd('0x37')]){_0x1f726b[_0x13cd('0x38')]=_[_0x13cd('0x39')](_0x1f726b[_0x13cd('0x38')],{'$or':_[_0x13cd('0x3a')](_0x115cfc,function(_0x1950a4){if(_0x1950a4[_0x13cd('0x3b')]!=='VIRTUAL'){var _0x5eb9ed={};_0x5eb9ed[_0x1950a4[_0x13cd('0x28')]]={'$like':'%'+_0x136825[_0x13cd('0x2d')][_0x13cd('0x37')]+'%'};return _0x5eb9ed;}})});}_0x1f726b=_[_0x13cd('0x39')]({},_0x1f726b,_0x136825[_0x13cd('0x3c')]);var _0x4ea248={'where':_0x1f726b[_0x13cd('0x38')]};return db[_0x13cd('0x2a')][_0x13cd('0x20')](_0x4ea248)[_0x13cd('0x26')](function(_0x1bec66){_0x2079d1[_0x13cd('0x20')]=_0x1bec66;if(_0x136825[_0x13cd('0x2d')]['includeAll']){_0x1f726b[_0x13cd('0x3d')]=[{'all':!![]}];}return db[_0x13cd('0x2a')][_0x13cd('0x3e')](_0x1f726b);})[_0x13cd('0x26')](function(_0x4ba5f6){_0x2079d1['rows']=_0x4ba5f6;return _0x2079d1;})[_0x13cd('0x26')](respondWithFilteredResult(_0x256628,_0x1f726b))['catch'](handleError(_0x256628,null));};exports[_0x13cd('0x3f')]=function(_0x48d843,_0x4ab83c){var _0x200367={'raw':!![],'where':{'id':_0x48d843[_0x13cd('0x40')]['id']}},_0x10bd80={};_0x10bd80[_0x13cd('0x2c')]=_[_0x13cd('0x2e')](db[_0x13cd('0x2a')]['rawAttributes']);_0x10bd80[_0x13cd('0x2d')]=_[_0x13cd('0x2e')](_0x48d843['query']);_0x10bd80[_0x13cd('0x2f')]=_[_0x13cd('0x30')](_0x10bd80[_0x13cd('0x2c')],_0x10bd80['query']);_0x200367[_0x13cd('0x31')]=_[_0x13cd('0x30')](_0x10bd80['model'],qs['fields'](_0x48d843[_0x13cd('0x2d')][_0x13cd('0x32')]));_0x200367[_0x13cd('0x31')]=_0x200367[_0x13cd('0x31')][_0x13cd('0x41')]?_0x200367[_0x13cd('0x31')]:_0x10bd80[_0x13cd('0x2c')];if(_0x48d843[_0x13cd('0x2d')][_0x13cd('0x42')]){_0x200367['include']=[{'all':!![]}];}_0x200367=_['merge']({},_0x200367,_0x48d843[_0x13cd('0x3c')]);return db[_0x13cd('0x2a')][_0x13cd('0x43')](_0x200367)[_0x13cd('0x26')](handleEntityNotFound(_0x4ab83c,null))['then'](respondWithResult(_0x4ab83c,null))[_0x13cd('0x44')](handleError(_0x4ab83c,null));};exports[_0x13cd('0x45')]=function(_0x45c0f6,_0x478538){return db['FaxQueueReport']['create'](_0x45c0f6[_0x13cd('0x46')],{})['then'](respondWithResult(_0x478538,0xc9))[_0x13cd('0x44')](handleError(_0x478538,null));};exports[_0x13cd('0x47')]=function(_0x10f94a,_0x5810ad){if(_0x10f94a[_0x13cd('0x46')]['id']){delete _0x10f94a['body']['id'];}return db[_0x13cd('0x2a')]['find']({'where':{'id':_0x10f94a[_0x13cd('0x40')]['id']}})['then'](handleEntityNotFound(_0x5810ad,null))[_0x13cd('0x26')](saveUpdates(_0x10f94a[_0x13cd('0x46')],null))[_0x13cd('0x26')](respondWithResult(_0x5810ad,null))['catch'](handleError(_0x5810ad,null));};exports[_0x13cd('0x25')]=function(_0x12af6d,_0x37287e){return db['FaxQueueReport']['find']({'where':{'id':_0x12af6d[_0x13cd('0x40')]['id']}})[_0x13cd('0x26')](handleEntityNotFound(_0x37287e,null))['then'](removeEntity(_0x37287e,null))[_0x13cd('0x44')](handleError(_0x37287e,null));};exports[_0x13cd('0x48')]=function(_0x14310e,_0x451746){return db['FaxQueueReport'][_0x13cd('0x48')]()[_0x13cd('0x26')](respondWithResult(_0x451746,null))['catch'](handleError(_0x451746,null));}; \ No newline at end of file +var _0x8b7c=['end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxQueueReport','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x1c075e,_0x575ba3){var _0x2a21a4=function(_0x1156af){while(--_0x1156af){_0x1c075e['push'](_0x1c075e['shift']());}};_0x2a21a4(++_0x575ba3);}(_0x8b7c,0x119));var _0xc8b7=function(_0x469a2d,_0x53bcbe){_0x469a2d=_0x469a2d-0x0;var _0x148147=_0x8b7c[_0x469a2d];return _0x148147;};'use strict';var emlformat=require(_0xc8b7('0x0'));var rimraf=require(_0xc8b7('0x1'));var zipdir=require(_0xc8b7('0x2'));var jsonpatch=require(_0xc8b7('0x3'));var rp=require(_0xc8b7('0x4'));var moment=require(_0xc8b7('0x5'));var BPromise=require(_0xc8b7('0x6'));var Mustache=require(_0xc8b7('0x7'));var util=require('util');var path=require(_0xc8b7('0x8'));var sox=require(_0xc8b7('0x9'));var csv=require(_0xc8b7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8b7('0xb'));var _=require(_0xc8b7('0xc'));var squel=require(_0xc8b7('0xd'));var crypto=require(_0xc8b7('0xe'));var jsforce=require(_0xc8b7('0xf'));var deskjs=require(_0xc8b7('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc8b7('0x11'));var Papa=require('papaparse');var Redis=require(_0xc8b7('0x12'));var authService=require(_0xc8b7('0x13'));var qs=require(_0xc8b7('0x14'));var as=require(_0xc8b7('0x15'));var hardwareService=require(_0xc8b7('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc8b7('0x17'));var licenseUtil=require(_0xc8b7('0x18'));var db=require(_0xc8b7('0x19'))['db'];function respondWithStatusCode(_0x21ec4f,_0x5063ad){_0x5063ad=_0x5063ad||0xcc;return function(_0x5495e9){if(_0x5495e9){return _0x21ec4f['sendStatus'](_0x5063ad);}return _0x21ec4f[_0xc8b7('0x1a')](_0x5063ad)[_0xc8b7('0x1b')]();};}function respondWithResult(_0x38da92,_0x5c6e5b){_0x5c6e5b=_0x5c6e5b||0xc8;return function(_0x19d3ea){if(_0x19d3ea){return _0x38da92[_0xc8b7('0x1a')](_0x5c6e5b)[_0xc8b7('0x1c')](_0x19d3ea);}};}function respondWithFilteredResult(_0x1b7dc0,_0x3d189e){return function(_0x5d412e){if(_0x5d412e){var _0xb53183=typeof _0x3d189e[_0xc8b7('0x1d')]===_0xc8b7('0x1e')&&typeof _0x3d189e[_0xc8b7('0x1f')]===_0xc8b7('0x1e');var _0x186dbd=_0x5d412e[_0xc8b7('0x20')];var _0x485415=_0xb53183?0x0:_0x3d189e['offset'];var _0x1cf47c=_0xb53183?_0x5d412e[_0xc8b7('0x20')]:_0x3d189e[_0xc8b7('0x1d')]+_0x3d189e['limit'];var _0x5df9f7;if(_0x1cf47c>=_0x186dbd){_0x1cf47c=_0x186dbd;_0x5df9f7=0xc8;}else{_0x5df9f7=0xce;}_0x1b7dc0[_0xc8b7('0x1a')](_0x5df9f7);return _0x1b7dc0['set'](_0xc8b7('0x21'),_0x485415+'-'+_0x1cf47c+'/'+_0x186dbd)['json'](_0x5d412e);}return null;};}function patchUpdates(_0x462cce){return function(_0x3b39a3){try{jsonpatch['apply'](_0x3b39a3,_0x462cce,!![]);}catch(_0x298e69){return BPromise['reject'](_0x298e69);}return _0x3b39a3[_0xc8b7('0x22')]();};}function saveUpdates(_0x431163,_0x456eea){return function(_0x5e11cd){if(_0x5e11cd){return _0x5e11cd[_0xc8b7('0x23')](_0x431163)[_0xc8b7('0x24')](function(_0x4065d9){return _0x4065d9;});}return null;};}function removeEntity(_0x5b28ad,_0x3b0e47){return function(_0x191c12){if(_0x191c12){return _0x191c12[_0xc8b7('0x25')]()[_0xc8b7('0x24')](function(){_0x5b28ad[_0xc8b7('0x1a')](0xcc)[_0xc8b7('0x1b')]();});}};}function handleEntityNotFound(_0x2acda2,_0x1c119f){return function(_0x11f863){if(!_0x11f863){_0x2acda2[_0xc8b7('0x26')](0x194);}return _0x11f863;};}function handleError(_0x1439ee,_0x50a33d){_0x50a33d=_0x50a33d||0x1f4;return function(_0x28e65d){logger[_0xc8b7('0x27')](_0x28e65d[_0xc8b7('0x28')]);if(_0x28e65d[_0xc8b7('0x29')]){delete _0x28e65d[_0xc8b7('0x29')];}_0x1439ee[_0xc8b7('0x1a')](_0x50a33d)['send'](_0x28e65d);};}exports['index']=function(_0x16cc83,_0x13ac30){var _0x1eff90={},_0x2a2b25={},_0x24b0b1={'count':0x0,'rows':[]};var _0x17cae3=_[_0xc8b7('0x2a')](db['FaxQueueReport'][_0xc8b7('0x2b')],function(_0x3d6f00){return{'name':_0x3d6f00[_0xc8b7('0x2c')],'type':_0x3d6f00[_0xc8b7('0x2d')][_0xc8b7('0x2e')]};});_0x2a2b25[_0xc8b7('0x2f')]=_[_0xc8b7('0x2a')](_0x17cae3,_0xc8b7('0x29'));_0x2a2b25['query']=_[_0xc8b7('0x30')](_0x16cc83[_0xc8b7('0x31')]);_0x2a2b25[_0xc8b7('0x32')]=_[_0xc8b7('0x33')](_0x2a2b25[_0xc8b7('0x2f')],_0x2a2b25[_0xc8b7('0x31')]);_0x1eff90[_0xc8b7('0x34')]=_[_0xc8b7('0x33')](_0x2a2b25[_0xc8b7('0x2f')],qs[_0xc8b7('0x35')](_0x16cc83[_0xc8b7('0x31')][_0xc8b7('0x35')]));_0x1eff90[_0xc8b7('0x34')]=_0x1eff90['attributes']['length']?_0x1eff90[_0xc8b7('0x34')]:_0x2a2b25['model'];if(!_0x16cc83[_0xc8b7('0x31')][_0xc8b7('0x36')](_0xc8b7('0x37'))){_0x1eff90[_0xc8b7('0x1f')]=qs[_0xc8b7('0x1f')](_0x16cc83['query'][_0xc8b7('0x1f')]);_0x1eff90['offset']=qs[_0xc8b7('0x1d')](_0x16cc83[_0xc8b7('0x31')][_0xc8b7('0x1d')]);}_0x1eff90[_0xc8b7('0x38')]=qs[_0xc8b7('0x39')](_0x16cc83[_0xc8b7('0x31')][_0xc8b7('0x39')]);_0x1eff90[_0xc8b7('0x3a')]=qs[_0xc8b7('0x32')](_[_0xc8b7('0x3b')](_0x16cc83[_0xc8b7('0x31')],_0x2a2b25[_0xc8b7('0x32')]),_0x17cae3);if(_0x16cc83[_0xc8b7('0x31')][_0xc8b7('0x3c')]){_0x1eff90[_0xc8b7('0x3a')]=_[_0xc8b7('0x3d')](_0x1eff90['where'],{'$or':_[_0xc8b7('0x2a')](_0x17cae3,function(_0x4a7169){if(_0x4a7169[_0xc8b7('0x2d')]!==_0xc8b7('0x3e')){var _0x2c2cf4={};_0x2c2cf4[_0x4a7169[_0xc8b7('0x29')]]={'$like':'%'+_0x16cc83['query'][_0xc8b7('0x3c')]+'%'};return _0x2c2cf4;}})});}_0x1eff90=_[_0xc8b7('0x3d')]({},_0x1eff90,_0x16cc83[_0xc8b7('0x3f')]);var _0x31f1c4={'where':_0x1eff90['where']};return db['FaxQueueReport'][_0xc8b7('0x20')](_0x31f1c4)[_0xc8b7('0x24')](function(_0x3a9551){_0x24b0b1['count']=_0x3a9551;if(_0x16cc83['query'][_0xc8b7('0x40')]){_0x1eff90[_0xc8b7('0x41')]=[{'all':!![]}];}return db[_0xc8b7('0x42')][_0xc8b7('0x43')](_0x1eff90);})[_0xc8b7('0x24')](function(_0x3ab722){_0x24b0b1[_0xc8b7('0x44')]=_0x3ab722;return _0x24b0b1;})[_0xc8b7('0x24')](respondWithFilteredResult(_0x13ac30,_0x1eff90))[_0xc8b7('0x45')](handleError(_0x13ac30,null));};exports[_0xc8b7('0x46')]=function(_0x131ae2,_0x53beea){var _0xf33dae={'raw':!![],'where':{'id':_0x131ae2['params']['id']}},_0x3d86af={};_0x3d86af['model']=_[_0xc8b7('0x30')](db[_0xc8b7('0x42')]['rawAttributes']);_0x3d86af[_0xc8b7('0x31')]=_[_0xc8b7('0x30')](_0x131ae2[_0xc8b7('0x31')]);_0x3d86af[_0xc8b7('0x32')]=_[_0xc8b7('0x33')](_0x3d86af[_0xc8b7('0x2f')],_0x3d86af[_0xc8b7('0x31')]);_0xf33dae[_0xc8b7('0x34')]=_[_0xc8b7('0x33')](_0x3d86af[_0xc8b7('0x2f')],qs[_0xc8b7('0x35')](_0x131ae2['query']['fields']));_0xf33dae[_0xc8b7('0x34')]=_0xf33dae['attributes'][_0xc8b7('0x47')]?_0xf33dae[_0xc8b7('0x34')]:_0x3d86af[_0xc8b7('0x2f')];if(_0x131ae2[_0xc8b7('0x31')][_0xc8b7('0x40')]){_0xf33dae[_0xc8b7('0x41')]=[{'all':!![]}];}_0xf33dae=_[_0xc8b7('0x3d')]({},_0xf33dae,_0x131ae2['options']);return db[_0xc8b7('0x42')][_0xc8b7('0x48')](_0xf33dae)[_0xc8b7('0x24')](handleEntityNotFound(_0x53beea,null))[_0xc8b7('0x24')](respondWithResult(_0x53beea,null))[_0xc8b7('0x45')](handleError(_0x53beea,null));};exports[_0xc8b7('0x49')]=function(_0x32d826,_0xccb0da){return db[_0xc8b7('0x42')][_0xc8b7('0x49')](_0x32d826[_0xc8b7('0x4a')],{})[_0xc8b7('0x24')](respondWithResult(_0xccb0da,0xc9))[_0xc8b7('0x45')](handleError(_0xccb0da,null));};exports[_0xc8b7('0x23')]=function(_0x493681,_0x3bd1c8){if(_0x493681[_0xc8b7('0x4a')]['id']){delete _0x493681[_0xc8b7('0x4a')]['id'];}return db[_0xc8b7('0x42')][_0xc8b7('0x48')]({'where':{'id':_0x493681['params']['id']}})[_0xc8b7('0x24')](handleEntityNotFound(_0x3bd1c8,null))[_0xc8b7('0x24')](saveUpdates(_0x493681['body'],null))[_0xc8b7('0x24')](respondWithResult(_0x3bd1c8,null))[_0xc8b7('0x45')](handleError(_0x3bd1c8,null));};exports[_0xc8b7('0x25')]=function(_0x7941a1,_0xc72a6){return db[_0xc8b7('0x42')]['find']({'where':{'id':_0x7941a1[_0xc8b7('0x4b')]['id']}})[_0xc8b7('0x24')](handleEntityNotFound(_0xc72a6,null))['then'](removeEntity(_0xc72a6,null))[_0xc8b7('0x45')](handleError(_0xc72a6,null));};exports[_0xc8b7('0x4c')]=function(_0x538958,_0x47e42c){return db[_0xc8b7('0x42')]['describe']()['then'](respondWithResult(_0x47e42c,null))[_0xc8b7('0x45')](handleError(_0x47e42c,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 2d317af..d46255c 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3b50b3,_0xfe3923){_0x3b50b3=_0x3b50b3-0x0;var _0x529085=_0x1cb9[_0x3b50b3];return _0x529085;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x2c0fe4,_0x3c60cc){var _0x19c3ed=function(_0x52ad20){while(--_0x52ad20){_0x2c0fe4['push'](_0x2c0fe4['shift']());}};_0x19c3ed(++_0x3c60cc);}(_0xe14b,0x93));var _0xbe14=function(_0x14e51e,_0x4da5a8){_0x14e51e=_0x14e51e-0x0;var _0x1186ed=_0xe14b[_0x14e51e];return _0x1186ed;};'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/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 408fe24..b32d661 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 _0x1f4c=['raw','then','UpdateFaxQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options'];(function(_0x225b4e,_0x179ee4){var _0x24237a=function(_0x4ac970){while(--_0x4ac970){_0x225b4e['push'](_0x225b4e['shift']());}};_0x24237a(++_0x179ee4);}(_0x1f4c,0xd2));var _0xc1f4=function(_0x22e9dc,_0x58aad7){_0x22e9dc=_0x22e9dc-0x0;var _0x32c871=_0x1f4c[_0x22e9dc];return _0x32c871;};'use strict';var _=require('lodash');var util=require(_0xc1f4('0x0'));var moment=require(_0xc1f4('0x1'));var BPromise=require(_0xc1f4('0x2'));var rs=require(_0xc1f4('0x3'));var fs=require('fs');var Redis=require(_0xc1f4('0x4'));var db=require(_0xc1f4('0x5'))['db'];var utils=require(_0xc1f4('0x6'));var logger=require('../../config/logger')(_0xc1f4('0x7'));var config=require(_0xc1f4('0x8'));var jayson=require(_0xc1f4('0x9'));var client=jayson[_0xc1f4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x278098,_0x12d98c,_0xaa6c19){return new BPromise(function(_0xa6df28,_0x137424){return client[_0xc1f4('0xb')](_0x278098,_0xaa6c19)['then'](function(_0xdf926f){logger[_0xc1f4('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x12d98c,_0xc1f4('0xd'));logger[_0xc1f4('0xe')](_0xc1f4('0xf'),_0x12d98c,'request\x20sent',JSON[_0xc1f4('0x10')](_0xdf926f));if(_0xdf926f[_0xc1f4('0x11')]){if(_0xdf926f[_0xc1f4('0x11')][_0xc1f4('0x12')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x12d98c,_0xdf926f['error'][_0xc1f4('0x13')]);return _0x137424(_0xdf926f[_0xc1f4('0x11')][_0xc1f4('0x13')]);}logger[_0xc1f4('0x11')](_0xc1f4('0x14'),_0x12d98c,_0xdf926f[_0xc1f4('0x11')][_0xc1f4('0x13')]);return _0xa6df28(_0xdf926f[_0xc1f4('0x11')]['message']);}else{logger[_0xc1f4('0xc')](_0xc1f4('0x14'),_0x12d98c,_0xc1f4('0xd'));_0xa6df28(_0xdf926f[_0xc1f4('0x15')][_0xc1f4('0x13')]);}})[_0xc1f4('0x16')](function(_0x40341b){logger[_0xc1f4('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x12d98c,_0x40341b);_0x137424(_0x40341b);});});}exports[_0xc1f4('0x17')]=function(_0x5db000){var _0x5d94da=this;return new Promise(function(_0x370574,_0xfa785a){return db[_0xc1f4('0x18')][_0xc1f4('0x19')](_0x5db000[_0xc1f4('0x1a')],{'raw':_0x5db000[_0xc1f4('0x1b')]?_0x5db000[_0xc1f4('0x1b')][_0xc1f4('0x1c')]===undefined?!![]:![]:!![]})[_0xc1f4('0x1d')](function(_0x508891){logger['info'](_0xc1f4('0x17'),_0x5db000);logger[_0xc1f4('0xe')](_0xc1f4('0x17'),_0x5db000,JSON['stringify'](_0x508891));_0x370574(_0x508891);})['catch'](function(_0x1cc565){logger[_0xc1f4('0x11')]('CreateFaxQueueReport',_0x1cc565[_0xc1f4('0x13')],_0x5db000);_0xfa785a(_0x5d94da[_0xc1f4('0x11')](0x1f4,_0x1cc565['message']));});});};exports[_0xc1f4('0x1e')]=function(_0xf8ab4e){var _0x306006=this;return new Promise(function(_0x1721d6,_0x1a2fcc){return db[_0xc1f4('0x18')][_0xc1f4('0x1f')](_0xf8ab4e[_0xc1f4('0x1a')],{'raw':_0xf8ab4e[_0xc1f4('0x1b')]?_0xf8ab4e[_0xc1f4('0x1b')][_0xc1f4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf8ab4e[_0xc1f4('0x1b')]?_0xf8ab4e['options']['where']||null:null,'attributes':_0xf8ab4e['options']?_0xf8ab4e['options'][_0xc1f4('0x20')]||null:null,'limit':_0xf8ab4e[_0xc1f4('0x1b')]?_0xf8ab4e[_0xc1f4('0x1b')][_0xc1f4('0x21')]||null:null})[_0xc1f4('0x1d')](function(_0x2cdea3){logger[_0xc1f4('0xc')](_0xc1f4('0x1e'),_0xf8ab4e);logger['debug'](_0xc1f4('0x1e'),_0xf8ab4e,JSON[_0xc1f4('0x10')](_0x2cdea3));_0x1721d6(_0x2cdea3);})[_0xc1f4('0x16')](function(_0x2b39a8){logger['error'](_0xc1f4('0x1e'),_0x2b39a8['message'],_0xf8ab4e);_0x1a2fcc(_0x306006[_0xc1f4('0x11')](0x1f4,_0x2b39a8[_0xc1f4('0x13')]));});});}; \ No newline at end of file +var _0xb40c=['FaxQueueReport','create','options','raw','stringify','UpdateFaxQueueReport','update','body','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport'];(function(_0x16b64b,_0x1b6804){var _0x32cc30=function(_0x1d9caa){while(--_0x1d9caa){_0x16b64b['push'](_0x16b64b['shift']());}};_0x32cc30(++_0x1b6804);}(_0xb40c,0xd1));var _0xcb40=function(_0x40b296,_0x285040){_0x40b296=_0x40b296-0x0;var _0x3d5022=_0xb40c[_0x40b296];return _0x3d5022;};'use strict';var _=require('lodash');var util=require(_0xcb40('0x0'));var moment=require(_0xcb40('0x1'));var BPromise=require(_0xcb40('0x2'));var rs=require(_0xcb40('0x3'));var fs=require('fs');var Redis=require(_0xcb40('0x4'));var db=require(_0xcb40('0x5'))['db'];var utils=require(_0xcb40('0x6'));var logger=require(_0xcb40('0x7'))('rpc');var config=require(_0xcb40('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb40('0x9')][_0xcb40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130a43,_0x47f3f8,_0x147ee8){return new BPromise(function(_0x3870cf,_0x538563){return client[_0xcb40('0xb')](_0x130a43,_0x147ee8)[_0xcb40('0xc')](function(_0xe326b6){logger[_0xcb40('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x47f3f8,'request\x20sent');logger[_0xcb40('0xe')](_0xcb40('0xf'),_0x47f3f8,'request\x20sent',JSON['stringify'](_0xe326b6));if(_0xe326b6[_0xcb40('0x10')]){if(_0xe326b6[_0xcb40('0x10')]['code']===0x1f4){logger[_0xcb40('0x10')](_0xcb40('0x11'),_0x47f3f8,_0xe326b6['error'][_0xcb40('0x12')]);return _0x538563(_0xe326b6[_0xcb40('0x10')][_0xcb40('0x12')]);}logger[_0xcb40('0x10')](_0xcb40('0x11'),_0x47f3f8,_0xe326b6[_0xcb40('0x10')][_0xcb40('0x12')]);return _0x3870cf(_0xe326b6[_0xcb40('0x10')][_0xcb40('0x12')]);}else{logger[_0xcb40('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x47f3f8,'request\x20sent');_0x3870cf(_0xe326b6[_0xcb40('0x13')]['message']);}})[_0xcb40('0x14')](function(_0x418176){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x47f3f8,_0x418176);_0x538563(_0x418176);});});}exports[_0xcb40('0x15')]=function(_0x1d0f9b){var _0x211705=this;return new Promise(function(_0x5641ed,_0x5caa59){return db[_0xcb40('0x16')][_0xcb40('0x17')](_0x1d0f9b['body'],{'raw':_0x1d0f9b[_0xcb40('0x18')]?_0x1d0f9b[_0xcb40('0x18')][_0xcb40('0x19')]===undefined?!![]:![]:!![]})[_0xcb40('0xc')](function(_0x124ce7){logger[_0xcb40('0xd')]('CreateFaxQueueReport',_0x1d0f9b);logger['debug'](_0xcb40('0x15'),_0x1d0f9b,JSON[_0xcb40('0x1a')](_0x124ce7));_0x5641ed(_0x124ce7);})[_0xcb40('0x14')](function(_0x180cd3){logger[_0xcb40('0x10')](_0xcb40('0x15'),_0x180cd3[_0xcb40('0x12')],_0x1d0f9b);_0x5caa59(_0x211705['error'](0x1f4,_0x180cd3[_0xcb40('0x12')]));});});};exports[_0xcb40('0x1b')]=function(_0xab1ef){var _0x410868=this;return new Promise(function(_0xaa2c2d,_0x471500){return db['FaxQueueReport'][_0xcb40('0x1c')](_0xab1ef[_0xcb40('0x1d')],{'raw':_0xab1ef[_0xcb40('0x18')]?_0xab1ef[_0xcb40('0x18')][_0xcb40('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab1ef['options']?_0xab1ef['options'][_0xcb40('0x1e')]||null:null,'attributes':_0xab1ef['options']?_0xab1ef[_0xcb40('0x18')][_0xcb40('0x1f')]||null:null,'limit':_0xab1ef[_0xcb40('0x18')]?_0xab1ef[_0xcb40('0x18')][_0xcb40('0x20')]||null:null})['then'](function(_0x40553d){logger[_0xcb40('0xd')]('UpdateFaxQueueReport',_0xab1ef);logger[_0xcb40('0xe')](_0xcb40('0x1b'),_0xab1ef,JSON[_0xcb40('0x1a')](_0x40553d));_0xaa2c2d(_0x40553d);})[_0xcb40('0x14')](function(_0x36d521){logger['error'](_0xcb40('0x1b'),_0x36d521[_0xcb40('0x12')],_0xab1ef);_0x471500(_0x410868[_0xcb40('0x10')](0x1f4,_0x36d521[_0xcb40('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index cfa0f08..c1f68f3 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 _0xfa9d=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x16bfbf,_0x1ffa04){var _0x15a45d=function(_0x359b47){while(--_0x359b47){_0x16bfbf['push'](_0x16bfbf['shift']());}};_0x15a45d(++_0x1ffa04);}(_0xfa9d,0x1d4));var _0xdfa9=function(_0x2ccbb5,_0x4140e3){_0x2ccbb5=_0x2ccbb5-0x0;var _0x193b18=_0xfa9d[_0x2ccbb5];return _0x193b18;};'use strict';var multer=require(_0xdfa9('0x0'));var util=require(_0xdfa9('0x1'));var path=require(_0xdfa9('0x2'));var timeout=require(_0xdfa9('0x3'));var express=require('express');var router=express[_0xdfa9('0x4')]();var fs_extra=require(_0xdfa9('0x5'));var auth=require(_0xdfa9('0x6'));var interaction=require(_0xdfa9('0x7'));var config=require(_0xdfa9('0x8'));var controller=require(_0xdfa9('0x9'));router[_0xdfa9('0xa')]('/',auth[_0xdfa9('0xb')](),controller[_0xdfa9('0xc')]);router[_0xdfa9('0xa')](_0xdfa9('0xd'),auth['isAuthenticated'](),controller[_0xdfa9('0xe')]);router[_0xdfa9('0xa')](_0xdfa9('0xf'),auth['isAuthenticated'](),controller[_0xdfa9('0x10')]);router[_0xdfa9('0x11')]('/',auth[_0xdfa9('0xb')](),controller[_0xdfa9('0x12')]);router[_0xdfa9('0x13')](_0xdfa9('0xf'),auth['isAuthenticated'](),controller[_0xdfa9('0x14')]);router[_0xdfa9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xdfa9('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3852=['./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3ebbf2,_0x29ffc3){var _0x5a666b=function(_0x483ef1){while(--_0x483ef1){_0x3ebbf2['push'](_0x3ebbf2['shift']());}};_0x5a666b(++_0x29ffc3);}(_0x3852,0xbf));var _0x2385=function(_0x3abd91,_0x24626c){_0x3abd91=_0x3abd91-0x0;var _0x448191=_0x3852[_0x3abd91];return _0x448191;};'use strict';var multer=require(_0x2385('0x0'));var util=require('util');var path=require(_0x2385('0x1'));var timeout=require(_0x2385('0x2'));var express=require('express');var router=express[_0x2385('0x3')]();var fs_extra=require(_0x2385('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2385('0x5'));var config=require(_0x2385('0x6'));var controller=require(_0x2385('0x7'));router[_0x2385('0x8')]('/',auth[_0x2385('0x9')](),controller[_0x2385('0xa')]);router[_0x2385('0x8')]('/describe',auth[_0x2385('0x9')](),controller[_0x2385('0xb')]);router[_0x2385('0x8')](_0x2385('0xc'),auth[_0x2385('0x9')](),controller[_0x2385('0xd')]);router[_0x2385('0xe')]('/',auth[_0x2385('0x9')](),controller['create']);router[_0x2385('0xf')]('/:id',auth[_0x2385('0x9')](),controller[_0x2385('0x10')]);router[_0x2385('0x11')]('/:id',auth[_0x2385('0x9')](),controller['destroy']);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 3c4d84b..f08d48e 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1e196f,_0x533b2d){var _0x5e2791=function(_0x17198b){while(--_0x17198b){_0x1e196f['push'](_0x1e196f['shift']());}};_0x5e2791(++_0x533b2d);}(_0x70e0,0x17b));var _0x070e=function(_0x39424b,_0x148626){_0x39424b=_0x39424b-0x0;var _0x38ffc3=_0x70e0[_0x39424b];return _0x38ffc3;};'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 +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xeb26d1,_0x301de1){var _0x4a4e2e=function(_0xa3dad1){while(--_0xa3dad1){_0xeb26d1['push'](_0xeb26d1['shift']());}};_0x4a4e2e(++_0x301de1);}(_0x54ef,0x112));var _0xf54e=function(_0x14b50a,_0x8ddea5){_0x14b50a=_0x14b50a-0x0;var _0x3ad6fc=_0x54ef[_0x14b50a];return _0x3ad6fc;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 08cac06..d77c60b 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 _0x85ce=['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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','create','body','find','params','describe'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0x85ce,0x138));var _0xe85c=function(_0x7e8014,_0x3513e9){_0x7e8014=_0x7e8014-0x0;var _0x4393c2=_0x85ce[_0x7e8014];return _0x4393c2;};'use strict';var emlformat=require(_0xe85c('0x0'));var rimraf=require(_0xe85c('0x1'));var zipdir=require(_0xe85c('0x2'));var jsonpatch=require(_0xe85c('0x3'));var rp=require(_0xe85c('0x4'));var moment=require(_0xe85c('0x5'));var BPromise=require(_0xe85c('0x6'));var Mustache=require(_0xe85c('0x7'));var util=require(_0xe85c('0x8'));var path=require(_0xe85c('0x9'));var sox=require(_0xe85c('0xa'));var csv=require(_0xe85c('0xb'));var ejs=require(_0xe85c('0xc'));var fs=require('fs');var fs_extra=require(_0xe85c('0xd'));var _=require(_0xe85c('0xe'));var squel=require('squel');var crypto=require(_0xe85c('0xf'));var jsforce=require(_0xe85c('0x10'));var deskjs=require(_0xe85c('0x11'));var toCsv=require(_0xe85c('0xb'));var querystring=require(_0xe85c('0x12'));var Papa=require(_0xe85c('0x13'));var Redis=require(_0xe85c('0x14'));var authService=require(_0xe85c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe85c('0x16'));var hardwareService=require(_0xe85c('0x17'));var logger=require(_0xe85c('0x18'))(_0xe85c('0x19'));var utils=require(_0xe85c('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xe85c('0x1b'));var db=require(_0xe85c('0x1c'))['db'];function respondWithStatusCode(_0xd745d2,_0x41d681){_0x41d681=_0x41d681||0xcc;return function(_0x165aeb){if(_0x165aeb){return _0xd745d2[_0xe85c('0x1d')](_0x41d681);}return _0xd745d2['status'](_0x41d681)['end']();};}function respondWithResult(_0x344ed1,_0x2a9020){_0x2a9020=_0x2a9020||0xc8;return function(_0x4c5caa){if(_0x4c5caa){return _0x344ed1[_0xe85c('0x1e')](_0x2a9020)[_0xe85c('0x1f')](_0x4c5caa);}};}function respondWithFilteredResult(_0x3b6f79,_0x37d7ac){return function(_0x38e292){if(_0x38e292){var _0x86e655=typeof _0x37d7ac[_0xe85c('0x20')]==='undefined'&&typeof _0x37d7ac[_0xe85c('0x21')]==='undefined';var _0x291510=_0x38e292['count'];var _0x273f69=_0x86e655?0x0:_0x37d7ac[_0xe85c('0x20')];var _0x45c928=_0x86e655?_0x38e292[_0xe85c('0x22')]:_0x37d7ac['offset']+_0x37d7ac['limit'];var _0x5a2d6d;if(_0x45c928>=_0x291510){_0x45c928=_0x291510;_0x5a2d6d=0xc8;}else{_0x5a2d6d=0xce;}_0x3b6f79[_0xe85c('0x1e')](_0x5a2d6d);return _0x3b6f79[_0xe85c('0x23')](_0xe85c('0x24'),_0x273f69+'-'+_0x45c928+'/'+_0x291510)[_0xe85c('0x1f')](_0x38e292);}return null;};}function patchUpdates(_0x38a2ec){return function(_0x2d80ef){try{jsonpatch[_0xe85c('0x25')](_0x2d80ef,_0x38a2ec,!![]);}catch(_0x237415){return BPromise[_0xe85c('0x26')](_0x237415);}return _0x2d80ef[_0xe85c('0x27')]();};}function saveUpdates(_0x3b7b33,_0x243ad6){return function(_0xdcd791){if(_0xdcd791){return _0xdcd791[_0xe85c('0x28')](_0x3b7b33)[_0xe85c('0x29')](function(_0x222a3c){return _0x222a3c;});}return null;};}function removeEntity(_0x206c90,_0x27110f){return function(_0x35a461){if(_0x35a461){return _0x35a461['destroy']()[_0xe85c('0x29')](function(){_0x206c90[_0xe85c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc4351,_0x30bfb8){return function(_0x40bfc6){if(!_0x40bfc6){_0xbc4351[_0xe85c('0x1d')](0x194);}return _0x40bfc6;};}function handleError(_0x44feeb,_0x500b25){_0x500b25=_0x500b25||0x1f4;return function(_0x275d67){logger['error'](_0x275d67[_0xe85c('0x2a')]);if(_0x275d67[_0xe85c('0x2b')]){delete _0x275d67[_0xe85c('0x2b')];}_0x44feeb[_0xe85c('0x1e')](_0x500b25)['send'](_0x275d67);};}exports[_0xe85c('0x2c')]=function(_0x313d7a,_0x188b05){var _0x43f420={},_0x3e4aa0={},_0x424359={'count':0x0,'rows':[]};var _0x5143b9=_[_0xe85c('0x2d')](db[_0xe85c('0x2e')][_0xe85c('0x2f')],function(_0x2e8cb3){return{'name':_0x2e8cb3[_0xe85c('0x30')],'type':_0x2e8cb3['type'][_0xe85c('0x31')]};});_0x3e4aa0[_0xe85c('0x32')]=_[_0xe85c('0x2d')](_0x5143b9,_0xe85c('0x2b'));_0x3e4aa0['query']=_[_0xe85c('0x33')](_0x313d7a[_0xe85c('0x34')]);_0x3e4aa0[_0xe85c('0x35')]=_[_0xe85c('0x36')](_0x3e4aa0[_0xe85c('0x32')],_0x3e4aa0['query']);_0x43f420[_0xe85c('0x37')]=_['intersection'](_0x3e4aa0[_0xe85c('0x32')],qs['fields'](_0x313d7a[_0xe85c('0x34')]['fields']));_0x43f420[_0xe85c('0x37')]=_0x43f420[_0xe85c('0x37')][_0xe85c('0x38')]?_0x43f420[_0xe85c('0x37')]:_0x3e4aa0[_0xe85c('0x32')];if(!_0x313d7a[_0xe85c('0x34')]['hasOwnProperty'](_0xe85c('0x39'))){_0x43f420['limit']=qs[_0xe85c('0x21')](_0x313d7a[_0xe85c('0x34')][_0xe85c('0x21')]);_0x43f420['offset']=qs[_0xe85c('0x20')](_0x313d7a[_0xe85c('0x34')]['offset']);}_0x43f420[_0xe85c('0x3a')]=qs[_0xe85c('0x3b')](_0x313d7a[_0xe85c('0x34')][_0xe85c('0x3b')]);_0x43f420[_0xe85c('0x3c')]=qs[_0xe85c('0x35')](_['pick'](_0x313d7a['query'],_0x3e4aa0[_0xe85c('0x35')]),_0x5143b9);if(_0x313d7a[_0xe85c('0x34')][_0xe85c('0x3d')]){_0x43f420[_0xe85c('0x3c')]=_[_0xe85c('0x3e')](_0x43f420[_0xe85c('0x3c')],{'$or':_[_0xe85c('0x2d')](_0x5143b9,function(_0xeb311f){if(_0xeb311f[_0xe85c('0x3f')]!==_0xe85c('0x40')){var _0xf63a41={};_0xf63a41[_0xeb311f[_0xe85c('0x2b')]]={'$like':'%'+_0x313d7a[_0xe85c('0x34')][_0xe85c('0x3d')]+'%'};return _0xf63a41;}})});}_0x43f420=_['merge']({},_0x43f420,_0x313d7a[_0xe85c('0x41')]);var _0x4be18d={'where':_0x43f420[_0xe85c('0x3c')]};return db['FaxTransferReport']['count'](_0x4be18d)['then'](function(_0x13d5d6){_0x424359[_0xe85c('0x22')]=_0x13d5d6;if(_0x313d7a[_0xe85c('0x34')][_0xe85c('0x42')]){_0x43f420[_0xe85c('0x43')]=[{'all':!![]}];}return db[_0xe85c('0x2e')][_0xe85c('0x44')](_0x43f420);})[_0xe85c('0x29')](function(_0x4370bd){_0x424359[_0xe85c('0x45')]=_0x4370bd;return _0x424359;})['then'](respondWithFilteredResult(_0x188b05,_0x43f420))[_0xe85c('0x46')](handleError(_0x188b05,null));};exports[_0xe85c('0x47')]=function(_0x11e8f2,_0x30c4ae){var _0x50564e={'raw':!![],'where':{'id':_0x11e8f2['params']['id']}},_0x41c8af={};_0x41c8af[_0xe85c('0x32')]=_[_0xe85c('0x33')](db['FaxTransferReport'][_0xe85c('0x2f')]);_0x41c8af['query']=_[_0xe85c('0x33')](_0x11e8f2[_0xe85c('0x34')]);_0x41c8af[_0xe85c('0x35')]=_[_0xe85c('0x36')](_0x41c8af['model'],_0x41c8af['query']);_0x50564e['attributes']=_[_0xe85c('0x36')](_0x41c8af[_0xe85c('0x32')],qs[_0xe85c('0x48')](_0x11e8f2['query'][_0xe85c('0x48')]));_0x50564e[_0xe85c('0x37')]=_0x50564e[_0xe85c('0x37')][_0xe85c('0x38')]?_0x50564e[_0xe85c('0x37')]:_0x41c8af['model'];if(_0x11e8f2[_0xe85c('0x34')][_0xe85c('0x42')]){_0x50564e[_0xe85c('0x43')]=[{'all':!![]}];}_0x50564e=_[_0xe85c('0x3e')]({},_0x50564e,_0x11e8f2[_0xe85c('0x41')]);return db[_0xe85c('0x2e')]['find'](_0x50564e)[_0xe85c('0x29')](handleEntityNotFound(_0x30c4ae,null))[_0xe85c('0x29')](respondWithResult(_0x30c4ae,null))['catch'](handleError(_0x30c4ae,null));};exports[_0xe85c('0x49')]=function(_0x1fbd2f,_0x2734d6){return db[_0xe85c('0x2e')]['create'](_0x1fbd2f[_0xe85c('0x4a')],{})[_0xe85c('0x29')](respondWithResult(_0x2734d6,0xc9))[_0xe85c('0x46')](handleError(_0x2734d6,null));};exports[_0xe85c('0x28')]=function(_0x237be9,_0x16ce79){if(_0x237be9[_0xe85c('0x4a')]['id']){delete _0x237be9[_0xe85c('0x4a')]['id'];}return db[_0xe85c('0x2e')]['find']({'where':{'id':_0x237be9['params']['id']}})['then'](handleEntityNotFound(_0x16ce79,null))[_0xe85c('0x29')](saveUpdates(_0x237be9[_0xe85c('0x4a')],null))[_0xe85c('0x29')](respondWithResult(_0x16ce79,null))['catch'](handleError(_0x16ce79,null));};exports['destroy']=function(_0xde8c15,_0x52eb69){return db[_0xe85c('0x2e')][_0xe85c('0x4b')]({'where':{'id':_0xde8c15[_0xe85c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x52eb69,null))[_0xe85c('0x29')](removeEntity(_0x52eb69,null))[_0xe85c('0x46')](handleError(_0x52eb69,null));};exports[_0xe85c('0x4d')]=function(_0x5451f9,_0xe5838d){return db[_0xe85c('0x2e')][_0xe85c('0x4d')]()[_0xe85c('0x29')](respondWithResult(_0xe5838d,null))[_0xe85c('0x46')](handleError(_0xe5838d,null));}; \ No newline at end of file +var _0xed94=['error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xed94,0x15a));var _0x4ed9=function(_0x4e5e6c,_0x959eb4){_0x4e5e6c=_0x4e5e6c-0x0;var _0xcf9053=_0xed94[_0x4e5e6c];return _0xcf9053;};'use strict';var emlformat=require(_0x4ed9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ed9('0x1'));var jsonpatch=require(_0x4ed9('0x2'));var rp=require(_0x4ed9('0x3'));var moment=require(_0x4ed9('0x4'));var BPromise=require(_0x4ed9('0x5'));var Mustache=require(_0x4ed9('0x6'));var util=require('util');var path=require(_0x4ed9('0x7'));var sox=require(_0x4ed9('0x8'));var csv=require(_0x4ed9('0x9'));var ejs=require(_0x4ed9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ed9('0xb'));var squel=require(_0x4ed9('0xc'));var crypto=require(_0x4ed9('0xd'));var jsforce=require(_0x4ed9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4ed9('0x9'));var querystring=require(_0x4ed9('0xf'));var Papa=require(_0x4ed9('0x10'));var Redis=require(_0x4ed9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ed9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ed9('0x13'));var logger=require('../../config/logger')(_0x4ed9('0x14'));var utils=require(_0x4ed9('0x15'));var config=require(_0x4ed9('0x16'));var licenseUtil=require(_0x4ed9('0x17'));var db=require(_0x4ed9('0x18'))['db'];function respondWithStatusCode(_0x544d8f,_0x5ac190){_0x5ac190=_0x5ac190||0xcc;return function(_0x24799f){if(_0x24799f){return _0x544d8f[_0x4ed9('0x19')](_0x5ac190);}return _0x544d8f[_0x4ed9('0x1a')](_0x5ac190)[_0x4ed9('0x1b')]();};}function respondWithResult(_0x3576a7,_0x110ead){_0x110ead=_0x110ead||0xc8;return function(_0x1fcf41){if(_0x1fcf41){return _0x3576a7[_0x4ed9('0x1a')](_0x110ead)[_0x4ed9('0x1c')](_0x1fcf41);}};}function respondWithFilteredResult(_0x4704a4,_0x49fdad){return function(_0x322449){if(_0x322449){var _0x9afaa2=typeof _0x49fdad[_0x4ed9('0x1d')]===_0x4ed9('0x1e')&&typeof _0x49fdad[_0x4ed9('0x1f')]===_0x4ed9('0x1e');var _0x3841ef=_0x322449[_0x4ed9('0x20')];var _0x292557=_0x9afaa2?0x0:_0x49fdad[_0x4ed9('0x1d')];var _0xceda59=_0x9afaa2?_0x322449[_0x4ed9('0x20')]:_0x49fdad[_0x4ed9('0x1d')]+_0x49fdad[_0x4ed9('0x1f')];var _0x3d9de1;if(_0xceda59>=_0x3841ef){_0xceda59=_0x3841ef;_0x3d9de1=0xc8;}else{_0x3d9de1=0xce;}_0x4704a4['status'](_0x3d9de1);return _0x4704a4[_0x4ed9('0x21')](_0x4ed9('0x22'),_0x292557+'-'+_0xceda59+'/'+_0x3841ef)[_0x4ed9('0x1c')](_0x322449);}return null;};}function patchUpdates(_0x1e5c75){return function(_0x2d0940){try{jsonpatch[_0x4ed9('0x23')](_0x2d0940,_0x1e5c75,!![]);}catch(_0x52f7d8){return BPromise['reject'](_0x52f7d8);}return _0x2d0940[_0x4ed9('0x24')]();};}function saveUpdates(_0x1e7713,_0x4eac26){return function(_0x4f4c96){if(_0x4f4c96){return _0x4f4c96[_0x4ed9('0x25')](_0x1e7713)['then'](function(_0x268c9a){return _0x268c9a;});}return null;};}function removeEntity(_0xdb8eae,_0x39d6ca){return function(_0x341d02){if(_0x341d02){return _0x341d02[_0x4ed9('0x26')]()['then'](function(){_0xdb8eae[_0x4ed9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48c424,_0x51f848){return function(_0x16bea6){if(!_0x16bea6){_0x48c424['sendStatus'](0x194);}return _0x16bea6;};}function handleError(_0x122d68,_0x1d98d2){_0x1d98d2=_0x1d98d2||0x1f4;return function(_0x5cf016){logger[_0x4ed9('0x27')](_0x5cf016[_0x4ed9('0x28')]);if(_0x5cf016['name']){delete _0x5cf016[_0x4ed9('0x29')];}_0x122d68[_0x4ed9('0x1a')](_0x1d98d2)[_0x4ed9('0x2a')](_0x5cf016);};}exports[_0x4ed9('0x2b')]=function(_0x3d9c5e,_0x582a3d){var _0x208454={},_0x32085e={},_0x5b10e3={'count':0x0,'rows':[]};var _0x2418f8=_[_0x4ed9('0x2c')](db[_0x4ed9('0x2d')][_0x4ed9('0x2e')],function(_0xa816){return{'name':_0xa816[_0x4ed9('0x2f')],'type':_0xa816[_0x4ed9('0x30')][_0x4ed9('0x31')]};});_0x32085e[_0x4ed9('0x32')]=_['map'](_0x2418f8,_0x4ed9('0x29'));_0x32085e[_0x4ed9('0x33')]=_[_0x4ed9('0x34')](_0x3d9c5e[_0x4ed9('0x33')]);_0x32085e['filters']=_['intersection'](_0x32085e[_0x4ed9('0x32')],_0x32085e['query']);_0x208454[_0x4ed9('0x35')]=_[_0x4ed9('0x36')](_0x32085e[_0x4ed9('0x32')],qs[_0x4ed9('0x37')](_0x3d9c5e['query']['fields']));_0x208454['attributes']=_0x208454[_0x4ed9('0x35')][_0x4ed9('0x38')]?_0x208454[_0x4ed9('0x35')]:_0x32085e[_0x4ed9('0x32')];if(!_0x3d9c5e[_0x4ed9('0x33')]['hasOwnProperty'](_0x4ed9('0x39'))){_0x208454[_0x4ed9('0x1f')]=qs[_0x4ed9('0x1f')](_0x3d9c5e['query']['limit']);_0x208454[_0x4ed9('0x1d')]=qs[_0x4ed9('0x1d')](_0x3d9c5e[_0x4ed9('0x33')][_0x4ed9('0x1d')]);}_0x208454[_0x4ed9('0x3a')]=qs[_0x4ed9('0x3b')](_0x3d9c5e['query'][_0x4ed9('0x3b')]);_0x208454[_0x4ed9('0x3c')]=qs[_0x4ed9('0x3d')](_[_0x4ed9('0x3e')](_0x3d9c5e[_0x4ed9('0x33')],_0x32085e[_0x4ed9('0x3d')]),_0x2418f8);if(_0x3d9c5e[_0x4ed9('0x33')][_0x4ed9('0x3f')]){_0x208454[_0x4ed9('0x3c')]=_[_0x4ed9('0x40')](_0x208454['where'],{'$or':_[_0x4ed9('0x2c')](_0x2418f8,function(_0x1fe0ba){if(_0x1fe0ba[_0x4ed9('0x30')]!==_0x4ed9('0x41')){var _0x65f921={};_0x65f921[_0x1fe0ba[_0x4ed9('0x29')]]={'$like':'%'+_0x3d9c5e[_0x4ed9('0x33')][_0x4ed9('0x3f')]+'%'};return _0x65f921;}})});}_0x208454=_[_0x4ed9('0x40')]({},_0x208454,_0x3d9c5e[_0x4ed9('0x42')]);var _0x22f840={'where':_0x208454[_0x4ed9('0x3c')]};return db[_0x4ed9('0x2d')][_0x4ed9('0x20')](_0x22f840)[_0x4ed9('0x43')](function(_0x168699){_0x5b10e3[_0x4ed9('0x20')]=_0x168699;if(_0x3d9c5e[_0x4ed9('0x33')]['includeAll']){_0x208454[_0x4ed9('0x44')]=[{'all':!![]}];}return db[_0x4ed9('0x2d')][_0x4ed9('0x45')](_0x208454);})['then'](function(_0x16405f){_0x5b10e3[_0x4ed9('0x46')]=_0x16405f;return _0x5b10e3;})[_0x4ed9('0x43')](respondWithFilteredResult(_0x582a3d,_0x208454))[_0x4ed9('0x47')](handleError(_0x582a3d,null));};exports['show']=function(_0x337b6c,_0x56977e){var _0x16c654={'raw':!![],'where':{'id':_0x337b6c['params']['id']}},_0x3ee66a={};_0x3ee66a['model']=_[_0x4ed9('0x34')](db[_0x4ed9('0x2d')]['rawAttributes']);_0x3ee66a[_0x4ed9('0x33')]=_[_0x4ed9('0x34')](_0x337b6c[_0x4ed9('0x33')]);_0x3ee66a['filters']=_[_0x4ed9('0x36')](_0x3ee66a[_0x4ed9('0x32')],_0x3ee66a['query']);_0x16c654[_0x4ed9('0x35')]=_['intersection'](_0x3ee66a[_0x4ed9('0x32')],qs[_0x4ed9('0x37')](_0x337b6c['query'][_0x4ed9('0x37')]));_0x16c654[_0x4ed9('0x35')]=_0x16c654[_0x4ed9('0x35')]['length']?_0x16c654[_0x4ed9('0x35')]:_0x3ee66a[_0x4ed9('0x32')];if(_0x337b6c['query']['includeAll']){_0x16c654[_0x4ed9('0x44')]=[{'all':!![]}];}_0x16c654=_[_0x4ed9('0x40')]({},_0x16c654,_0x337b6c['options']);return db['FaxTransferReport'][_0x4ed9('0x48')](_0x16c654)[_0x4ed9('0x43')](handleEntityNotFound(_0x56977e,null))[_0x4ed9('0x43')](respondWithResult(_0x56977e,null))['catch'](handleError(_0x56977e,null));};exports['create']=function(_0x5e66a2,_0x115462){return db[_0x4ed9('0x2d')][_0x4ed9('0x49')](_0x5e66a2[_0x4ed9('0x4a')],{})[_0x4ed9('0x43')](respondWithResult(_0x115462,0xc9))[_0x4ed9('0x47')](handleError(_0x115462,null));};exports[_0x4ed9('0x25')]=function(_0x1cd9c1,_0x2b4dc0){if(_0x1cd9c1[_0x4ed9('0x4a')]['id']){delete _0x1cd9c1['body']['id'];}return db[_0x4ed9('0x2d')]['find']({'where':{'id':_0x1cd9c1[_0x4ed9('0x4b')]['id']}})[_0x4ed9('0x43')](handleEntityNotFound(_0x2b4dc0,null))[_0x4ed9('0x43')](saveUpdates(_0x1cd9c1[_0x4ed9('0x4a')],null))[_0x4ed9('0x43')](respondWithResult(_0x2b4dc0,null))['catch'](handleError(_0x2b4dc0,null));};exports[_0x4ed9('0x26')]=function(_0x5aa632,_0x4c96ad){return db[_0x4ed9('0x2d')][_0x4ed9('0x48')]({'where':{'id':_0x5aa632[_0x4ed9('0x4b')]['id']}})[_0x4ed9('0x43')](handleEntityNotFound(_0x4c96ad,null))[_0x4ed9('0x43')](removeEntity(_0x4c96ad,null))['catch'](handleError(_0x4c96ad,null));};exports[_0x4ed9('0x4c')]=function(_0x597ae0,_0x15ee54){return db['FaxTransferReport']['describe']()[_0x4ed9('0x43')](respondWithResult(_0x15ee54,null))[_0x4ed9('0x47')](handleError(_0x15ee54,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 5fbab19..1678d56 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 _0xac0d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x427b10,_0x345b56){var _0x52618c=function(_0x5bf9aa){while(--_0x5bf9aa){_0x427b10['push'](_0x427b10['shift']());}};_0x52618c(++_0x345b56);}(_0xac0d,0xb2));var _0xdac0=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xac0d[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xdac0('0x0'));var util=require(_0xdac0('0x1'));var logger=require(_0xdac0('0x2'))('api');var moment=require(_0xdac0('0x3'));var BPromise=require(_0xdac0('0x4'));var rp=require(_0xdac0('0x5'));var fs=require('fs');var path=require(_0xdac0('0x6'));var rimraf=require(_0xdac0('0x7'));var config=require(_0xdac0('0x8'));var attributes=require(_0xdac0('0x9'));module[_0xdac0('0xa')]=function(_0xce252c,_0x22ad56){return _0xce252c[_0xdac0('0xb')](_0xdac0('0xc'),attributes,{'tableName':_0xdac0('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdac0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a69=['uniqueid','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x2d0322,_0x1e154c){var _0x11ca3e=function(_0x1cfec7){while(--_0x1cfec7){_0x2d0322['push'](_0x2d0322['shift']());}};_0x11ca3e(++_0x1e154c);}(_0x7a69,0x1c9));var _0x97a6=function(_0x5e28e1,_0x466ff5){_0x5e28e1=_0x5e28e1-0x0;var _0x15d436=_0x7a69[_0x5e28e1];return _0x15d436;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x97a6('0x0'))(_0x97a6('0x1'));var moment=require('moment');var BPromise=require(_0x97a6('0x2'));var rp=require(_0x97a6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97a6('0x4'));var config=require(_0x97a6('0x5'));var attributes=require(_0x97a6('0x6'));module[_0x97a6('0x7')]=function(_0x3a612b,_0x212c8e){return _0x3a612b[_0x97a6('0x8')](_0x97a6('0x9'),attributes,{'tableName':_0x97a6('0xa'),'paranoid':![],'indexes':[{'name':_0x97a6('0xb'),'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 14c25db..205dca0 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 _0x90a0=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x90a0,0x168));var _0x090a=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x90a0[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x090a('0x0'));var util=require(_0x090a('0x1'));var moment=require(_0x090a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x090a('0x3'));var db=require(_0x090a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x090a('0x5'));var config=require(_0x090a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x090a('0x7')][_0x090a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2202ac,_0x3db7b2,_0x2758c2){return new BPromise(function(_0xa3cd71,_0xe1752d){return client['request'](_0x2202ac,_0x2758c2)[_0x090a('0x9')](function(_0x491512){logger[_0x090a('0xa')](_0x090a('0xb'),_0x3db7b2,_0x090a('0xc'));logger[_0x090a('0xd')](_0x090a('0xe'),_0x3db7b2,'request\x20sent',JSON[_0x090a('0xf')](_0x491512));if(_0x491512[_0x090a('0x10')]){if(_0x491512['error'][_0x090a('0x11')]===0x1f4){logger['error'](_0x090a('0xb'),_0x3db7b2,_0x491512['error'][_0x090a('0x12')]);return _0xe1752d(_0x491512[_0x090a('0x10')]['message']);}logger[_0x090a('0x10')](_0x090a('0xb'),_0x3db7b2,_0x491512[_0x090a('0x10')]['message']);return _0xa3cd71(_0x491512[_0x090a('0x10')][_0x090a('0x12')]);}else{logger[_0x090a('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x3db7b2,'request\x20sent');_0xa3cd71(_0x491512[_0x090a('0x13')][_0x090a('0x12')]);}})[_0x090a('0x14')](function(_0xc88861){logger[_0x090a('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x3db7b2,_0xc88861);_0xe1752d(_0xc88861);});});} \ No newline at end of file +var _0x9f96=['moment','randomstring','../../config/utils','jayson/promise','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x28905f,_0x1a69fc){var _0x570145=function(_0x370649){while(--_0x370649){_0x28905f['push'](_0x28905f['shift']());}};_0x570145(++_0x1a69fc);}(_0x9f96,0x120));var _0x69f9=function(_0xd7d28d,_0x44b1a8){_0xd7d28d=_0xd7d28d-0x0;var _0x5ed9f7=_0x9f96[_0xd7d28d];return _0x5ed9f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x69f9('0x0'));var BPromise=require('bluebird');var rs=require(_0x69f9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x69f9('0x2'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x69f9('0x3'));var client=jayson['client'][_0x69f9('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x5adbb0,_0xcba2e5,_0x210ec3){return new BPromise(function(_0x11e211,_0x3d2127){return client['request'](_0x5adbb0,_0x210ec3)[_0x69f9('0x5')](function(_0x1bad64){logger[_0x69f9('0x6')](_0x69f9('0x7'),_0xcba2e5,_0x69f9('0x8'));logger[_0x69f9('0x9')](_0x69f9('0xa'),_0xcba2e5,'request\x20sent',JSON[_0x69f9('0xb')](_0x1bad64));if(_0x1bad64[_0x69f9('0xc')]){if(_0x1bad64[_0x69f9('0xc')][_0x69f9('0xd')]===0x1f4){logger[_0x69f9('0xc')](_0x69f9('0x7'),_0xcba2e5,_0x1bad64[_0x69f9('0xc')][_0x69f9('0xe')]);return _0x3d2127(_0x1bad64[_0x69f9('0xc')]['message']);}logger[_0x69f9('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0xcba2e5,_0x1bad64[_0x69f9('0xc')][_0x69f9('0xe')]);return _0x11e211(_0x1bad64[_0x69f9('0xc')][_0x69f9('0xe')]);}else{logger[_0x69f9('0x6')](_0x69f9('0x7'),_0xcba2e5,_0x69f9('0x8'));_0x11e211(_0x1bad64[_0x69f9('0xf')][_0x69f9('0xe')]);}})['catch'](function(_0x44d2b9){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0xcba2e5,_0x44d2b9);_0x3d2127(_0x44d2b9);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c713ce8..8b143f4 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 _0x4b7d=['get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x56f63f,_0x59b821){var _0x1930b5=function(_0x1c4e31){while(--_0x1c4e31){_0x56f63f['push'](_0x56f63f['shift']());}};_0x1930b5(++_0x59b821);}(_0x4b7d,0x1df));var _0xd4b7=function(_0x342022,_0x1ee0f7){_0x342022=_0x342022-0x0;var _0x2065d3=_0x4b7d[_0x342022];return _0x2065d3;};'use strict';var multer=require('multer');var util=require(_0xd4b7('0x0'));var path=require('path');var timeout=require(_0xd4b7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd4b7('0x2'));var auth=require(_0xd4b7('0x3'));var interaction=require(_0xd4b7('0x4'));var config=require(_0xd4b7('0x5'));var controller=require(_0xd4b7('0x6'));router[_0xd4b7('0x7')]('/',auth['isAuthenticated'](),controller[_0xd4b7('0x8')]);router[_0xd4b7('0x7')]('/describe',auth[_0xd4b7('0x9')](),controller[_0xd4b7('0xa')]);router[_0xd4b7('0x7')](_0xd4b7('0xb'),auth[_0xd4b7('0x9')](),controller[_0xd4b7('0xc')]);router[_0xd4b7('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd4b7('0xe')](_0xd4b7('0xb'),auth['isAuthenticated'](),controller[_0xd4b7('0xf')]);router[_0xd4b7('0x10')]('/:id',auth[_0xd4b7('0x9')](),controller[_0xd4b7('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe498=['Router','fs-extra','../../components/auth/service','./faxTransferReport.controller','get','index','describe','/:id','isAuthenticated','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x567a58,_0x36167d){var _0x5bfdf8=function(_0x1243c1){while(--_0x1243c1){_0x567a58['push'](_0x567a58['shift']());}};_0x5bfdf8(++_0x36167d);}(_0xe498,0x84));var _0x8e49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe498[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x8e49('0x0'));var path=require(_0x8e49('0x1'));var timeout=require(_0x8e49('0x2'));var express=require(_0x8e49('0x3'));var router=express[_0x8e49('0x4')]();var fs_extra=require(_0x8e49('0x5'));var auth=require(_0x8e49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8e49('0x7'));router[_0x8e49('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e49('0x9')]);router[_0x8e49('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x8e49('0xa')]);router[_0x8e49('0x8')](_0x8e49('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8e49('0xc')](),controller[_0x8e49('0xd')]);router['put'](_0x8e49('0xb'),auth['isAuthenticated'](),controller[_0x8e49('0xe')]);router[_0x8e49('0xf')]('/:id',auth[_0x8e49('0xc')](),controller[_0x8e49('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6838ea5..de27758 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 _0x110d=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x110d,0x12b));var _0xd110=function(_0x1460ab,_0x74d06e){_0x1460ab=_0x1460ab-0x0;var _0x1eeb5c=_0x110d[_0x1460ab];return _0x1eeb5c;};'use strict';var multer=require('multer');var util=require(_0xd110('0x0'));var path=require('path');var timeout=require(_0xd110('0x1'));var express=require(_0xd110('0x2'));var router=express[_0xd110('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd110('0x4'));var interaction=require(_0xd110('0x5'));var config=require(_0xd110('0x6'));var controller=require(_0xd110('0x7'));router[_0xd110('0x8')]('/',auth[_0xd110('0x9')](),controller[_0xd110('0xa')]);router[_0xd110('0x8')](_0xd110('0xb'),auth[_0xd110('0x9')](),controller['show']);router[_0xd110('0x8')](_0xd110('0xc'),auth[_0xd110('0x9')](),controller[_0xd110('0xd')]);router[_0xd110('0x8')](_0xd110('0xe'),auth['isAuthenticated'](),controller[_0xd110('0xf')]);router[_0xd110('0x10')]('/',auth[_0xd110('0x9')](),controller['create']);router[_0xd110('0x10')]('/:id/configurations',auth[_0xd110('0x9')](),controller[_0xd110('0x11')]);router[_0xd110('0x12')](_0xd110('0xb'),auth[_0xd110('0x9')](),controller[_0xd110('0x13')]);router[_0xd110('0x14')](_0xd110('0xb'),auth[_0xd110('0x9')](),controller[_0xd110('0x15')]);module[_0xd110('0x16')]=router; \ No newline at end of file +var _0x2131=['../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1aef22,_0x2d27e9){var _0x70e233=function(_0x315224){while(--_0x315224){_0x1aef22['push'](_0x1aef22['shift']());}};_0x70e233(++_0x2d27e9);}(_0x2131,0x1c2));var _0x1213=function(_0x4a8072,_0x435bab){_0x4a8072=_0x4a8072-0x0;var _0x11a4fe=_0x2131[_0x4a8072];return _0x11a4fe;};'use strict';var multer=require(_0x1213('0x0'));var util=require('util');var path=require(_0x1213('0x1'));var timeout=require(_0x1213('0x2'));var express=require('express');var router=express[_0x1213('0x3')]();var fs_extra=require(_0x1213('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1213('0x5'));var config=require(_0x1213('0x6'));var controller=require(_0x1213('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1213('0x8')]);router[_0x1213('0x9')](_0x1213('0xa'),auth[_0x1213('0xb')](),controller[_0x1213('0xc')]);router[_0x1213('0x9')](_0x1213('0xd'),auth[_0x1213('0xb')](),controller[_0x1213('0xe')]);router[_0x1213('0x9')](_0x1213('0xf'),auth[_0x1213('0xb')](),controller[_0x1213('0x10')]);router[_0x1213('0x11')]('/',auth[_0x1213('0xb')](),controller[_0x1213('0x12')]);router[_0x1213('0x11')](_0x1213('0xd'),auth[_0x1213('0xb')](),controller[_0x1213('0x13')]);router[_0x1213('0x14')](_0x1213('0xa'),auth['isAuthenticated'](),controller[_0x1213('0x15')]);router[_0x1213('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1213('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 6aaf186..ea9e08b 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 _0x54d6=['newTab','sequelize','exports','STRING','ENUM'];(function(_0x45bbde,_0x5395ba){var _0x461478=function(_0x4093bf){while(--_0x4093bf){_0x45bbde['push'](_0x45bbde['shift']());}};_0x461478(++_0x5395ba);}(_0x54d6,0xc9));var _0x654d=function(_0x2a4219,_0x308999){_0x2a4219=_0x2a4219-0x0;var _0x331879=_0x54d6[_0x2a4219];return _0x331879;};'use strict';var Sequelize=require(_0x654d('0x0'));module[_0x654d('0x1')]={'name':{'type':Sequelize[_0x654d('0x2')]},'description':{'type':Sequelize[_0x654d('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x654d('0x2')]},'authType':{'type':Sequelize[_0x654d('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x654d('0x2')]},'consumerKey':{'type':Sequelize[_0x654d('0x2')]},'consumerSecret':{'type':Sequelize[_0x654d('0x2')]},'token':{'type':Sequelize[_0x654d('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x654d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x654d('0x3')]('integrationTab',_0x654d('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x58a6=['STRING','ENUM','basic','newTab','sequelize','exports'];(function(_0x32e7d6,_0x682bc5){var _0x5427cf=function(_0x365c2d){while(--_0x365c2d){_0x32e7d6['push'](_0x32e7d6['shift']());}};_0x5427cf(++_0x682bc5);}(_0x58a6,0x1f0));var _0x658a=function(_0x4e72ec,_0x3d8a73){_0x4e72ec=_0x4e72ec-0x0;var _0x2bc3ee=_0x58a6[_0x4e72ec];return _0x2bc3ee;};'use strict';var Sequelize=require(_0x658a('0x0'));module[_0x658a('0x1')]={'name':{'type':Sequelize[_0x658a('0x2')]},'description':{'type':Sequelize[_0x658a('0x2')]},'username':{'type':Sequelize[_0x658a('0x2')]},'remoteUri':{'type':Sequelize[_0x658a('0x2')]},'authType':{'type':Sequelize[_0x658a('0x3')](_0x658a('0x4')),'defaultValue':_0x658a('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x658a('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x658a('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x658a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x658a('0x3')]('integrationTab',_0x658a('0x5')),'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 afd9207..fedc5fc 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 _0x500c=['Authorization','Basic\x20%s','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','priority','username','password','consumerKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers'];(function(_0x4e06c6,_0x5cffa0){var _0x1dccb6=function(_0x543f7c){while(--_0x543f7c){_0x4e06c6['push'](_0x4e06c6['shift']());}};_0x1dccb6(++_0x5cffa0);}(_0x500c,0x1c5));var _0xc500=function(_0x19ab18,_0x1f2b1d){_0x19ab18=_0x19ab18-0x0;var _0x1e353a=_0x500c[_0x19ab18];return _0x1e353a;};'use strict';var emlformat=require(_0xc500('0x0'));var rimraf=require(_0xc500('0x1'));var zipdir=require(_0xc500('0x2'));var jsonpatch=require(_0xc500('0x3'));var rp=require(_0xc500('0x4'));var moment=require('moment');var BPromise=require(_0xc500('0x5'));var Mustache=require(_0xc500('0x6'));var util=require(_0xc500('0x7'));var path=require(_0xc500('0x8'));var sox=require('sox');var csv=require(_0xc500('0x9'));var ejs=require(_0xc500('0xa'));var fs=require('fs');var fs_extra=require(_0xc500('0xb'));var _=require(_0xc500('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc500('0xd'));var deskjs=require(_0xc500('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc500('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc500('0x10'));var qs=require(_0xc500('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc500('0x12'));var utils=require(_0xc500('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc500('0x14'));var db=require(_0xc500('0x15'))['db'];var integrations=require(_0xc500('0x16'));function respondWithStatusCode(_0x5a0276,_0x470373){_0x470373=_0x470373||0xcc;return function(_0x10ab24){if(_0x10ab24){return _0x5a0276[_0xc500('0x17')](_0x470373);}return _0x5a0276[_0xc500('0x18')](_0x470373)[_0xc500('0x19')]();};}function respondWithResult(_0x547633,_0x2516c4){_0x2516c4=_0x2516c4||0xc8;return function(_0x4edef7){if(_0x4edef7){return _0x547633['status'](_0x2516c4)[_0xc500('0x1a')](_0x4edef7);}};}function respondWithFilteredResult(_0x50aea3,_0x3f79b7){return function(_0x25eb89){if(_0x25eb89){var _0x27b516=typeof _0x3f79b7[_0xc500('0x1b')]==='undefined'&&typeof _0x3f79b7[_0xc500('0x1c')]===_0xc500('0x1d');var _0x1ca6e4=_0x25eb89['count'];var _0x50943b=_0x27b516?0x0:_0x3f79b7['offset'];var _0x103adc=_0x27b516?_0x25eb89[_0xc500('0x1e')]:_0x3f79b7[_0xc500('0x1b')]+_0x3f79b7[_0xc500('0x1c')];var _0x23b7c7;if(_0x103adc>=_0x1ca6e4){_0x103adc=_0x1ca6e4;_0x23b7c7=0xc8;}else{_0x23b7c7=0xce;}_0x50aea3[_0xc500('0x18')](_0x23b7c7);return _0x50aea3['set'](_0xc500('0x1f'),_0x50943b+'-'+_0x103adc+'/'+_0x1ca6e4)[_0xc500('0x1a')](_0x25eb89);}return null;};}function patchUpdates(_0x54a619){return function(_0x5f2381){try{jsonpatch[_0xc500('0x20')](_0x5f2381,_0x54a619,!![]);}catch(_0x20a918){return BPromise[_0xc500('0x21')](_0x20a918);}return _0x5f2381[_0xc500('0x22')]();};}function saveUpdates(_0x342e2c,_0x5c8361){return function(_0x4b20c1){if(_0x4b20c1){return _0x4b20c1[_0xc500('0x23')](_0x342e2c)[_0xc500('0x24')](function(_0x664929){return _0x664929;});}return null;};}function removeEntity(_0x54cf0b,_0x1f496f){return function(_0x1c790d){if(_0x1c790d){return _0x1c790d[_0xc500('0x25')]()[_0xc500('0x24')](function(){_0x54cf0b[_0xc500('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b846e,_0x504cc5){return function(_0x5cff95){if(!_0x5cff95){_0x5b846e[_0xc500('0x17')](0x194);}return _0x5cff95;};}function handleError(_0xac53e3,_0x1800d9){_0x1800d9=_0x1800d9||0x1f4;return function(_0x385643){logger[_0xc500('0x26')](_0x385643['stack']);if(_0x385643[_0xc500('0x27')]){delete _0x385643[_0xc500('0x27')];}_0xac53e3[_0xc500('0x18')](_0x1800d9)[_0xc500('0x28')](_0x385643);};}exports[_0xc500('0x29')]=function(_0x2f9e18,_0x29f8d1){var _0x189e85={},_0x572b4e={},_0x55bae1={'count':0x0,'rows':[]};var _0x58331c=_[_0xc500('0x2a')](db[_0xc500('0x2b')][_0xc500('0x2c')],function(_0x8b3b73){return{'name':_0x8b3b73[_0xc500('0x2d')],'type':_0x8b3b73[_0xc500('0x2e')][_0xc500('0x2f')]};});_0x572b4e['model']=_[_0xc500('0x2a')](_0x58331c,_0xc500('0x27'));_0x572b4e[_0xc500('0x30')]=_[_0xc500('0x31')](_0x2f9e18['query']);_0x572b4e[_0xc500('0x32')]=_[_0xc500('0x33')](_0x572b4e[_0xc500('0x34')],_0x572b4e[_0xc500('0x30')]);_0x189e85[_0xc500('0x35')]=_[_0xc500('0x33')](_0x572b4e['model'],qs[_0xc500('0x36')](_0x2f9e18[_0xc500('0x30')][_0xc500('0x36')]));_0x189e85[_0xc500('0x35')]=_0x189e85[_0xc500('0x35')][_0xc500('0x37')]?_0x189e85[_0xc500('0x35')]:_0x572b4e[_0xc500('0x34')];if(!_0x2f9e18[_0xc500('0x30')][_0xc500('0x38')]('nolimit')){_0x189e85['limit']=qs['limit'](_0x2f9e18[_0xc500('0x30')][_0xc500('0x1c')]);_0x189e85['offset']=qs[_0xc500('0x1b')](_0x2f9e18[_0xc500('0x30')]['offset']);}_0x189e85[_0xc500('0x39')]=qs[_0xc500('0x3a')](_0x2f9e18[_0xc500('0x30')][_0xc500('0x3a')]);_0x189e85['where']=qs[_0xc500('0x32')](_[_0xc500('0x3b')](_0x2f9e18[_0xc500('0x30')],_0x572b4e[_0xc500('0x32')]),_0x58331c);if(_0x2f9e18[_0xc500('0x30')][_0xc500('0x3c')]){_0x189e85[_0xc500('0x3d')]=_['merge'](_0x189e85[_0xc500('0x3d')],{'$or':_[_0xc500('0x2a')](_0x58331c,function(_0x134b7c){if(_0x134b7c['type']!=='VIRTUAL'){var _0x2102d8={};_0x2102d8[_0x134b7c[_0xc500('0x27')]]={'$like':'%'+_0x2f9e18[_0xc500('0x30')][_0xc500('0x3c')]+'%'};return _0x2102d8;}})});}_0x189e85=_[_0xc500('0x3e')]({},_0x189e85,_0x2f9e18[_0xc500('0x3f')]);var _0x5af122={'where':_0x189e85[_0xc500('0x3d')]};return db[_0xc500('0x2b')][_0xc500('0x1e')](_0x5af122)[_0xc500('0x24')](function(_0x4e0b84){_0x55bae1[_0xc500('0x1e')]=_0x4e0b84;if(_0x2f9e18[_0xc500('0x30')][_0xc500('0x40')]){_0x189e85[_0xc500('0x41')]=[{'all':!![]}];}return db[_0xc500('0x2b')][_0xc500('0x42')](_0x189e85);})[_0xc500('0x24')](function(_0x112f4b){_0x55bae1['rows']=_0x112f4b;return _0x55bae1;})[_0xc500('0x24')](respondWithFilteredResult(_0x29f8d1,_0x189e85))[_0xc500('0x43')](handleError(_0x29f8d1,null));};exports[_0xc500('0x44')]=function(_0x557922,_0x5df759){var _0x124c3c={'raw':![],'where':{'id':_0x557922['params']['id']}},_0x1700e4={};_0x1700e4['model']=_[_0xc500('0x31')](db[_0xc500('0x2b')][_0xc500('0x2c')]);_0x1700e4['query']=_[_0xc500('0x31')](_0x557922['query']);_0x1700e4[_0xc500('0x32')]=_[_0xc500('0x33')](_0x1700e4[_0xc500('0x34')],_0x1700e4[_0xc500('0x30')]);_0x124c3c['attributes']=_[_0xc500('0x33')](_0x1700e4[_0xc500('0x34')],qs[_0xc500('0x36')](_0x557922['query'][_0xc500('0x36')]));_0x124c3c[_0xc500('0x35')]=_0x124c3c[_0xc500('0x35')][_0xc500('0x37')]?_0x124c3c[_0xc500('0x35')]:_0x1700e4['model'];if(_0x557922[_0xc500('0x30')][_0xc500('0x40')]){_0x124c3c[_0xc500('0x41')]=[{'all':!![]}];}_0x124c3c=_['merge']({},_0x124c3c,_0x557922[_0xc500('0x3f')]);return db[_0xc500('0x2b')][_0xc500('0x45')](_0x124c3c)[_0xc500('0x24')](handleEntityNotFound(_0x5df759,null))['then'](respondWithResult(_0x5df759,null))['catch'](handleError(_0x5df759,null));};exports[_0xc500('0x46')]=function(_0x996edf,_0xb0e695){return db[_0xc500('0x2b')]['create'](_0x996edf[_0xc500('0x47')],{})[_0xc500('0x24')](respondWithResult(_0xb0e695,0xc9))[_0xc500('0x43')](handleError(_0xb0e695,null));};exports['update']=function(_0xae7bbd,_0x23b8cc){if(_0xae7bbd[_0xc500('0x47')]['id']){delete _0xae7bbd[_0xc500('0x47')]['id'];}return db[_0xc500('0x2b')][_0xc500('0x45')]({'where':{'id':_0xae7bbd['params']['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x23b8cc,null))['then'](saveUpdates(_0xae7bbd['body'],null))['then'](respondWithResult(_0x23b8cc,null))[_0xc500('0x43')](handleError(_0x23b8cc,null));};exports['destroy']=function(_0x5c32fc,_0x659d68){return db[_0xc500('0x2b')][_0xc500('0x45')]({'where':{'id':_0x5c32fc[_0xc500('0x48')]['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x659d68,null))[_0xc500('0x24')](removeEntity(_0x659d68,null))['catch'](handleError(_0x659d68,null));};exports['getConfigurations']=function(_0x4ac8fc,_0x5a850c,_0x5a15d0){var _0x5cf801={};var _0x1b14cc={};var _0x58221a;var _0x4b9712;return db[_0xc500('0x2b')][_0xc500('0x49')]({'where':{'id':_0x4ac8fc[_0xc500('0x48')]['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x5a850c,null))[_0xc500('0x24')](function(_0x23a86c){if(_0x23a86c){_0x58221a=_0x23a86c;_0x1b14cc[_0xc500('0x34')]=_[_0xc500('0x31')](db[_0xc500('0x4a')][_0xc500('0x2c')]);_0x1b14cc[_0xc500('0x30')]=_[_0xc500('0x31')](_0x4ac8fc[_0xc500('0x30')]);_0x1b14cc['filters']=_[_0xc500('0x33')](_0x1b14cc['model'],_0x1b14cc['query']);_0x5cf801[_0xc500('0x35')]=_[_0xc500('0x33')](_0x1b14cc[_0xc500('0x34')],qs[_0xc500('0x36')](_0x4ac8fc['query'][_0xc500('0x36')]));_0x5cf801['attributes']=_0x5cf801[_0xc500('0x35')][_0xc500('0x37')]?_0x5cf801[_0xc500('0x35')]:_0x1b14cc[_0xc500('0x34')];_0x5cf801[_0xc500('0x39')]=qs['sort'](_0x4ac8fc[_0xc500('0x30')]['sort']);_0x5cf801[_0xc500('0x3d')]=qs[_0xc500('0x32')](_[_0xc500('0x3b')](_0x4ac8fc[_0xc500('0x30')],_0x1b14cc[_0xc500('0x32')]));if(_0x4ac8fc[_0xc500('0x30')][_0xc500('0x3c')]){_0x5cf801[_0xc500('0x3d')]=_[_0xc500('0x3e')](_0x5cf801[_0xc500('0x3d')],{'$or':_[_0xc500('0x2a')](_0x5cf801[_0xc500('0x35')],function(_0x4ae6e0){var _0x5a4c0d={};_0x5a4c0d[_0x4ae6e0]={'$like':'%'+_0x4ac8fc[_0xc500('0x30')]['filter']+'%'};return _0x5a4c0d;})});}_0x5cf801=_['merge']({},_0x5cf801,_0x4ac8fc[_0xc500('0x3f')]);return _0x58221a['getConfigurations'](_0x5cf801);}})[_0xc500('0x24')](function(_0x1238e3){if(_0x1238e3){_0x4b9712=_0x1238e3[_0xc500('0x37')];if(!_0x4ac8fc[_0xc500('0x30')][_0xc500('0x38')]('nolimit')){_0x5cf801[_0xc500('0x1c')]=qs[_0xc500('0x1c')](_0x4ac8fc[_0xc500('0x30')][_0xc500('0x1c')]);_0x5cf801[_0xc500('0x1b')]=qs[_0xc500('0x1b')](_0x4ac8fc[_0xc500('0x30')]['offset']);}return _0x58221a['getConfigurations'](_0x5cf801);}})[_0xc500('0x24')](function(_0x1a9eae){if(_0x1a9eae){return _0x1a9eae?{'count':_0x4b9712,'rows':_0x1a9eae}:null;}})['then'](respondWithResult(_0x5a850c,null))[_0xc500('0x43')](handleError(_0x5a850c,null));};exports[_0xc500('0x4b')]=function(_0x183df0,_0x3b725a,_0x42e687){if(_0x183df0[_0xc500('0x47')]['id']){delete _0x183df0[_0xc500('0x47')]['id'];}return db[_0xc500('0x2b')]['findOne']({'where':{'id':_0x183df0[_0xc500('0x48')]['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x3b725a,null))[_0xc500('0x24')](function(_0x3d4460){if(_0x3d4460){_0x183df0['body']['AccountId']=_0x3d4460['id'];_0x183df0[_0xc500('0x47')][_0xc500('0x4c')]=integrations[_0xc500('0x4d')](_0x183df0[_0xc500('0x47')][_0xc500('0x4e')],_0x183df0[_0xc500('0x47')]['type']);_0x183df0[_0xc500('0x47')]['Descriptions']=integrations[_0xc500('0x4f')](_0x183df0[_0xc500('0x47')][_0xc500('0x4e')],_0x183df0[_0xc500('0x47')][_0xc500('0x2e')]);return db['DeskConfiguration'][_0xc500('0x46')](_0x183df0[_0xc500('0x47')],{'include':[{'model':db[_0xc500('0x50')],'as':'Subjects'},{'model':db[_0xc500('0x50')],'as':_0xc500('0x51')}]});}return null;})[_0xc500('0x24')](respondWithResult(_0x3b725a,null))[_0xc500('0x43')](handleError(_0x3b725a,null));};exports['getFields']=function(_0x405024,_0x4ee438,_0x430e91){var _0x5af52d=[{'name':_0xc500('0x52'),'label':_0xc500('0x52'),'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 _0x5df220='';return db[_0xc500('0x2b')][_0xc500('0x49')]({'where':{'id':_0x405024[_0xc500('0x48')]['id']},'attributes':['id','remoteUri','authType',_0xc500('0x53'),_0xc500('0x54'),_0xc500('0x55'),'consumerSecret','token','tokenSecret']})[_0xc500('0x24')](handleEntityNotFound(_0x4ee438,null))[_0xc500('0x24')](function(_0x81c735){if(_0x81c735){_0x5df220=_0x81c735[_0xc500('0x56')];var _0x50dfa9=_0x5df220[_0xc500('0x57')](-0x1);if(_0x50dfa9==='/'){_0x5df220=_0x5df220[_0xc500('0x58')](0x0,_0x5df220[_0xc500('0x59')](_0x50dfa9));}var _0xac5bab={'method':_0xc500('0x5a'),'uri':util[_0xc500('0x5b')](_0xc500('0x5c'),_0x5df220),'headers':{'Content-Type':'application/json','Accept':_0xc500('0x5d')},'json':!![]};if(_0x81c735[_0xc500('0x5e')]===_0xc500('0x5f')){_0xac5bab[_0xc500('0x60')][_0xc500('0x61')]=util[_0xc500('0x5b')](_0xc500('0x62'),new Buffer(util[_0xc500('0x5b')]('%s:%s',_0x81c735[_0xc500('0x53')],_0x81c735[_0xc500('0x54')]))['toString'](_0xc500('0x63')));}return rp(_0xac5bab)['then'](function(_0x33d9a8){return _0x5af52d[_0xc500('0x64')](_[_0xc500('0x2a')](_0x33d9a8['_embedded'][_0xc500('0x65')],function(_0x1d77d3){return{'id':_0x1d77d3[_0xc500('0x27')],'name':_0x1d77d3[_0xc500('0x27')],'type':_0x1d77d3[_0xc500('0x2e')],'active':_0x1d77d3[_0xc500('0x66')],'label':_0x1d77d3[_0xc500('0x67')],'custom':!![]};}));});}})[_0xc500('0x24')](function(_0x58a6d0){return{'count':_0x58a6d0[_0xc500('0x37')],'rows':_0x58a6d0};})[_0xc500('0x24')](respondWithResult(_0x4ee438,null))['catch'](function(_0x11a15b){var _0x21dd85=_0x405024[_0xc500('0x30')][_0xc500('0x68')]?0x1f4:_0x11a15b[_0xc500('0x69')]||0x1f4;logger['error'](_0xc500('0x6a'),_0xc500('0x6b'),_0x21dd85,JSON[_0xc500('0x6c')](_0x11a15b));delete _0x11a15b[_0xc500('0x27')];if(_0x21dd85===0x191){_0x21dd85=0x190;}_0x4ee438[_0xc500('0x18')](_0x21dd85)['send'](_0x405024[_0xc500('0x30')][_0xc500('0x68')]?{'message':_0xc500('0x6d'),'statusCode':_0x11a15b[_0xc500('0x69')]}:_0x11a15b);});}; \ No newline at end of file +var _0x9b69=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','DeskAccount','findAll','rows','show','params','find','catch','create','body','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','Subjects','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','format','basic','headers','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x9b69,0xd8));var _0x99b6=function(_0x135389,_0x2941f1){_0x135389=_0x135389-0x0;var _0x3ef5a0=_0x9b69[_0x135389];return _0x3ef5a0;};'use strict';var emlformat=require(_0x99b6('0x0'));var rimraf=require(_0x99b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99b6('0x2'));var rp=require(_0x99b6('0x3'));var moment=require(_0x99b6('0x4'));var BPromise=require(_0x99b6('0x5'));var Mustache=require(_0x99b6('0x6'));var util=require(_0x99b6('0x7'));var path=require(_0x99b6('0x8'));var sox=require(_0x99b6('0x9'));var csv=require(_0x99b6('0xa'));var ejs=require(_0x99b6('0xb'));var fs=require('fs');var fs_extra=require(_0x99b6('0xc'));var _=require(_0x99b6('0xd'));var squel=require(_0x99b6('0xe'));var crypto=require(_0x99b6('0xf'));var jsforce=require(_0x99b6('0x10'));var deskjs=require(_0x99b6('0x11'));var toCsv=require('to-csv');var querystring=require(_0x99b6('0x12'));var Papa=require(_0x99b6('0x13'));var Redis=require(_0x99b6('0x14'));var authService=require(_0x99b6('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x99b6('0x16'));var hardwareService=require(_0x99b6('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x99b6('0x18'));var config=require(_0x99b6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x99b6('0x1a'))['db'];var integrations=require(_0x99b6('0x1b'));function respondWithStatusCode(_0x39d8ba,_0xc9c4e3){_0xc9c4e3=_0xc9c4e3||0xcc;return function(_0x2f571a){if(_0x2f571a){return _0x39d8ba['sendStatus'](_0xc9c4e3);}return _0x39d8ba[_0x99b6('0x1c')](_0xc9c4e3)[_0x99b6('0x1d')]();};}function respondWithResult(_0x49f89a,_0x269406){_0x269406=_0x269406||0xc8;return function(_0x3ef1df){if(_0x3ef1df){return _0x49f89a[_0x99b6('0x1c')](_0x269406)['json'](_0x3ef1df);}};}function respondWithFilteredResult(_0x405928,_0x419f3f){return function(_0x528d31){if(_0x528d31){var _0x53049c=typeof _0x419f3f['offset']===_0x99b6('0x1e')&&typeof _0x419f3f['limit']==='undefined';var _0x2a5083=_0x528d31[_0x99b6('0x1f')];var _0x43de15=_0x53049c?0x0:_0x419f3f[_0x99b6('0x20')];var _0x5cdfde=_0x53049c?_0x528d31[_0x99b6('0x1f')]:_0x419f3f[_0x99b6('0x20')]+_0x419f3f[_0x99b6('0x21')];var _0xdfa076;if(_0x5cdfde>=_0x2a5083){_0x5cdfde=_0x2a5083;_0xdfa076=0xc8;}else{_0xdfa076=0xce;}_0x405928['status'](_0xdfa076);return _0x405928[_0x99b6('0x22')](_0x99b6('0x23'),_0x43de15+'-'+_0x5cdfde+'/'+_0x2a5083)['json'](_0x528d31);}return null;};}function patchUpdates(_0x2fcba0){return function(_0x53d447){try{jsonpatch['apply'](_0x53d447,_0x2fcba0,!![]);}catch(_0x19e25b){return BPromise[_0x99b6('0x24')](_0x19e25b);}return _0x53d447[_0x99b6('0x25')]();};}function saveUpdates(_0x51998e,_0x93c0b7){return function(_0x1a2972){if(_0x1a2972){return _0x1a2972[_0x99b6('0x26')](_0x51998e)[_0x99b6('0x27')](function(_0x509ce3){return _0x509ce3;});}return null;};}function removeEntity(_0x51adb7,_0x4ca512){return function(_0xe8239a){if(_0xe8239a){return _0xe8239a[_0x99b6('0x28')]()['then'](function(){_0x51adb7[_0x99b6('0x1c')](0xcc)[_0x99b6('0x1d')]();});}};}function handleEntityNotFound(_0x28a711,_0x2cbe3f){return function(_0x3b4e62){if(!_0x3b4e62){_0x28a711['sendStatus'](0x194);}return _0x3b4e62;};}function handleError(_0x241d88,_0x21436f){_0x21436f=_0x21436f||0x1f4;return function(_0x2debd3){logger[_0x99b6('0x29')](_0x2debd3['stack']);if(_0x2debd3[_0x99b6('0x2a')]){delete _0x2debd3[_0x99b6('0x2a')];}_0x241d88[_0x99b6('0x1c')](_0x21436f)[_0x99b6('0x2b')](_0x2debd3);};}exports['index']=function(_0x418887,_0x36d7c4){var _0x2057d9={},_0x4cdfe2={},_0x226df6={'count':0x0,'rows':[]};var _0x4bbc75=_[_0x99b6('0x2c')](db['DeskAccount'][_0x99b6('0x2d')],function(_0x48bf96){return{'name':_0x48bf96['fieldName'],'type':_0x48bf96[_0x99b6('0x2e')][_0x99b6('0x2f')]};});_0x4cdfe2[_0x99b6('0x30')]=_[_0x99b6('0x2c')](_0x4bbc75,'name');_0x4cdfe2[_0x99b6('0x31')]=_[_0x99b6('0x32')](_0x418887[_0x99b6('0x31')]);_0x4cdfe2[_0x99b6('0x33')]=_[_0x99b6('0x34')](_0x4cdfe2[_0x99b6('0x30')],_0x4cdfe2[_0x99b6('0x31')]);_0x2057d9[_0x99b6('0x35')]=_['intersection'](_0x4cdfe2[_0x99b6('0x30')],qs['fields'](_0x418887[_0x99b6('0x31')][_0x99b6('0x36')]));_0x2057d9[_0x99b6('0x35')]=_0x2057d9['attributes'][_0x99b6('0x37')]?_0x2057d9['attributes']:_0x4cdfe2['model'];if(!_0x418887[_0x99b6('0x31')][_0x99b6('0x38')](_0x99b6('0x39'))){_0x2057d9[_0x99b6('0x21')]=qs[_0x99b6('0x21')](_0x418887[_0x99b6('0x31')][_0x99b6('0x21')]);_0x2057d9[_0x99b6('0x20')]=qs[_0x99b6('0x20')](_0x418887[_0x99b6('0x31')][_0x99b6('0x20')]);}_0x2057d9[_0x99b6('0x3a')]=qs[_0x99b6('0x3b')](_0x418887[_0x99b6('0x31')][_0x99b6('0x3b')]);_0x2057d9[_0x99b6('0x3c')]=qs[_0x99b6('0x33')](_[_0x99b6('0x3d')](_0x418887[_0x99b6('0x31')],_0x4cdfe2['filters']),_0x4bbc75);if(_0x418887[_0x99b6('0x31')][_0x99b6('0x3e')]){_0x2057d9[_0x99b6('0x3c')]=_[_0x99b6('0x3f')](_0x2057d9['where'],{'$or':_['map'](_0x4bbc75,function(_0x26a5dc){if(_0x26a5dc[_0x99b6('0x2e')]!=='VIRTUAL'){var _0x1559aa={};_0x1559aa[_0x26a5dc['name']]={'$like':'%'+_0x418887[_0x99b6('0x31')][_0x99b6('0x3e')]+'%'};return _0x1559aa;}})});}_0x2057d9=_[_0x99b6('0x3f')]({},_0x2057d9,_0x418887[_0x99b6('0x40')]);var _0x171cb4={'where':_0x2057d9[_0x99b6('0x3c')]};return db['DeskAccount']['count'](_0x171cb4)[_0x99b6('0x27')](function(_0x5227e3){_0x226df6[_0x99b6('0x1f')]=_0x5227e3;if(_0x418887[_0x99b6('0x31')][_0x99b6('0x41')]){_0x2057d9[_0x99b6('0x42')]=[{'all':!![]}];}return db[_0x99b6('0x43')][_0x99b6('0x44')](_0x2057d9);})[_0x99b6('0x27')](function(_0x2b2d8a){_0x226df6[_0x99b6('0x45')]=_0x2b2d8a;return _0x226df6;})[_0x99b6('0x27')](respondWithFilteredResult(_0x36d7c4,_0x2057d9))['catch'](handleError(_0x36d7c4,null));};exports[_0x99b6('0x46')]=function(_0x9415c7,_0x16e27c){var _0x2e8f72={'raw':![],'where':{'id':_0x9415c7[_0x99b6('0x47')]['id']}},_0x5a4cc8={};_0x5a4cc8[_0x99b6('0x30')]=_[_0x99b6('0x32')](db[_0x99b6('0x43')]['rawAttributes']);_0x5a4cc8[_0x99b6('0x31')]=_[_0x99b6('0x32')](_0x9415c7['query']);_0x5a4cc8[_0x99b6('0x33')]=_[_0x99b6('0x34')](_0x5a4cc8[_0x99b6('0x30')],_0x5a4cc8[_0x99b6('0x31')]);_0x2e8f72['attributes']=_[_0x99b6('0x34')](_0x5a4cc8[_0x99b6('0x30')],qs['fields'](_0x9415c7['query'][_0x99b6('0x36')]));_0x2e8f72[_0x99b6('0x35')]=_0x2e8f72[_0x99b6('0x35')][_0x99b6('0x37')]?_0x2e8f72[_0x99b6('0x35')]:_0x5a4cc8[_0x99b6('0x30')];if(_0x9415c7[_0x99b6('0x31')][_0x99b6('0x41')]){_0x2e8f72[_0x99b6('0x42')]=[{'all':!![]}];}_0x2e8f72=_[_0x99b6('0x3f')]({},_0x2e8f72,_0x9415c7[_0x99b6('0x40')]);return db[_0x99b6('0x43')][_0x99b6('0x48')](_0x2e8f72)[_0x99b6('0x27')](handleEntityNotFound(_0x16e27c,null))[_0x99b6('0x27')](respondWithResult(_0x16e27c,null))[_0x99b6('0x49')](handleError(_0x16e27c,null));};exports['create']=function(_0x41eea9,_0x1d8951){return db[_0x99b6('0x43')][_0x99b6('0x4a')](_0x41eea9[_0x99b6('0x4b')],{})['then'](respondWithResult(_0x1d8951,0xc9))[_0x99b6('0x49')](handleError(_0x1d8951,null));};exports['update']=function(_0x359b47,_0x4d94d1){if(_0x359b47[_0x99b6('0x4b')]['id']){delete _0x359b47[_0x99b6('0x4b')]['id'];}return db[_0x99b6('0x43')][_0x99b6('0x48')]({'where':{'id':_0x359b47['params']['id']}})[_0x99b6('0x27')](handleEntityNotFound(_0x4d94d1,null))[_0x99b6('0x27')](saveUpdates(_0x359b47['body'],null))[_0x99b6('0x27')](respondWithResult(_0x4d94d1,null))['catch'](handleError(_0x4d94d1,null));};exports[_0x99b6('0x28')]=function(_0xa74524,_0x39a677){return db['DeskAccount'][_0x99b6('0x48')]({'where':{'id':_0xa74524[_0x99b6('0x47')]['id']}})[_0x99b6('0x27')](handleEntityNotFound(_0x39a677,null))[_0x99b6('0x27')](removeEntity(_0x39a677,null))['catch'](handleError(_0x39a677,null));};exports[_0x99b6('0x4c')]=function(_0x55e0db,_0x253c97,_0x371eb2){var _0x20e48b={};var _0x2cc780={};var _0x4ca019;var _0x778155;return db['DeskAccount']['findOne']({'where':{'id':_0x55e0db[_0x99b6('0x47')]['id']}})[_0x99b6('0x27')](handleEntityNotFound(_0x253c97,null))[_0x99b6('0x27')](function(_0x54038c){if(_0x54038c){_0x4ca019=_0x54038c;_0x2cc780[_0x99b6('0x30')]=_[_0x99b6('0x32')](db['DeskConfiguration']['rawAttributes']);_0x2cc780[_0x99b6('0x31')]=_['keys'](_0x55e0db[_0x99b6('0x31')]);_0x2cc780[_0x99b6('0x33')]=_[_0x99b6('0x34')](_0x2cc780[_0x99b6('0x30')],_0x2cc780[_0x99b6('0x31')]);_0x20e48b[_0x99b6('0x35')]=_['intersection'](_0x2cc780[_0x99b6('0x30')],qs[_0x99b6('0x36')](_0x55e0db[_0x99b6('0x31')][_0x99b6('0x36')]));_0x20e48b[_0x99b6('0x35')]=_0x20e48b[_0x99b6('0x35')][_0x99b6('0x37')]?_0x20e48b[_0x99b6('0x35')]:_0x2cc780[_0x99b6('0x30')];_0x20e48b[_0x99b6('0x3a')]=qs[_0x99b6('0x3b')](_0x55e0db[_0x99b6('0x31')][_0x99b6('0x3b')]);_0x20e48b['where']=qs['filters'](_['pick'](_0x55e0db[_0x99b6('0x31')],_0x2cc780[_0x99b6('0x33')]));if(_0x55e0db[_0x99b6('0x31')][_0x99b6('0x3e')]){_0x20e48b[_0x99b6('0x3c')]=_[_0x99b6('0x3f')](_0x20e48b['where'],{'$or':_[_0x99b6('0x2c')](_0x20e48b['attributes'],function(_0x18435c){var _0x1199e0={};_0x1199e0[_0x18435c]={'$like':'%'+_0x55e0db[_0x99b6('0x31')][_0x99b6('0x3e')]+'%'};return _0x1199e0;})});}_0x20e48b=_[_0x99b6('0x3f')]({},_0x20e48b,_0x55e0db[_0x99b6('0x40')]);return _0x4ca019[_0x99b6('0x4c')](_0x20e48b);}})[_0x99b6('0x27')](function(_0x2b8006){if(_0x2b8006){_0x778155=_0x2b8006[_0x99b6('0x37')];if(!_0x55e0db[_0x99b6('0x31')]['hasOwnProperty']('nolimit')){_0x20e48b['limit']=qs[_0x99b6('0x21')](_0x55e0db[_0x99b6('0x31')]['limit']);_0x20e48b[_0x99b6('0x20')]=qs[_0x99b6('0x20')](_0x55e0db[_0x99b6('0x31')][_0x99b6('0x20')]);}return _0x4ca019[_0x99b6('0x4c')](_0x20e48b);}})['then'](function(_0x402daf){if(_0x402daf){return _0x402daf?{'count':_0x778155,'rows':_0x402daf}:null;}})['then'](respondWithResult(_0x253c97,null))[_0x99b6('0x49')](handleError(_0x253c97,null));};exports[_0x99b6('0x4d')]=function(_0x38e022,_0x28524,_0xf4a0e7){if(_0x38e022[_0x99b6('0x4b')]['id']){delete _0x38e022['body']['id'];}return db[_0x99b6('0x43')][_0x99b6('0x4e')]({'where':{'id':_0x38e022[_0x99b6('0x47')]['id']}})[_0x99b6('0x27')](handleEntityNotFound(_0x28524,null))[_0x99b6('0x27')](function(_0x383ba9){if(_0x383ba9){_0x38e022[_0x99b6('0x4b')][_0x99b6('0x4f')]=_0x383ba9['id'];_0x38e022[_0x99b6('0x4b')]['Subjects']=integrations[_0x99b6('0x50')](_0x38e022[_0x99b6('0x4b')][_0x99b6('0x51')],_0x38e022[_0x99b6('0x4b')][_0x99b6('0x2e')]);_0x38e022['body'][_0x99b6('0x52')]=integrations[_0x99b6('0x53')](_0x38e022['body'][_0x99b6('0x51')],_0x38e022['body'][_0x99b6('0x2e')]);return db[_0x99b6('0x54')][_0x99b6('0x4a')](_0x38e022[_0x99b6('0x4b')],{'include':[{'model':db['DeskField'],'as':_0x99b6('0x55')},{'model':db[_0x99b6('0x56')],'as':_0x99b6('0x52')}]});}return null;})[_0x99b6('0x27')](respondWithResult(_0x28524,null))[_0x99b6('0x49')](handleError(_0x28524,null));};exports[_0x99b6('0x57')]=function(_0x2d56d4,_0x163620,_0x36c397){var _0x34e338=[{'name':'priority','label':_0x99b6('0x58'),'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 _0x203656='';return db['DeskAccount'][_0x99b6('0x4e')]({'where':{'id':_0x2d56d4['params']['id']},'attributes':['id',_0x99b6('0x59'),_0x99b6('0x5a'),'username',_0x99b6('0x5b'),_0x99b6('0x5c'),_0x99b6('0x5d'),'token',_0x99b6('0x5e')]})[_0x99b6('0x27')](handleEntityNotFound(_0x163620,null))[_0x99b6('0x27')](function(_0x28fd49){if(_0x28fd49){_0x203656=_0x28fd49[_0x99b6('0x59')];var _0x2f45d5=_0x203656[_0x99b6('0x5f')](-0x1);if(_0x2f45d5==='/'){_0x203656=_0x203656[_0x99b6('0x60')](0x0,_0x203656[_0x99b6('0x61')](_0x2f45d5));}var _0xe8da01={'method':_0x99b6('0x62'),'uri':util[_0x99b6('0x63')]('%s/custom_fields',_0x203656),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x28fd49[_0x99b6('0x5a')]===_0x99b6('0x64')){_0xe8da01[_0x99b6('0x65')]['Authorization']=util[_0x99b6('0x63')](_0x99b6('0x66'),new Buffer(util[_0x99b6('0x63')](_0x99b6('0x67'),_0x28fd49[_0x99b6('0x68')],_0x28fd49[_0x99b6('0x5b')]))[_0x99b6('0x69')](_0x99b6('0x6a')));}return rp(_0xe8da01)['then'](function(_0x39ea59){return _0x34e338[_0x99b6('0x6b')](_[_0x99b6('0x2c')](_0x39ea59[_0x99b6('0x6c')][_0x99b6('0x6d')],function(_0x208da5){return{'id':_0x208da5[_0x99b6('0x2a')],'name':_0x208da5[_0x99b6('0x2a')],'type':_0x208da5[_0x99b6('0x2e')],'active':_0x208da5[_0x99b6('0x6e')],'label':_0x208da5[_0x99b6('0x6f')],'custom':!![]};}));});}})[_0x99b6('0x27')](function(_0x5f4e9b){return{'count':_0x5f4e9b[_0x99b6('0x37')],'rows':_0x5f4e9b};})[_0x99b6('0x27')](respondWithResult(_0x163620,null))['catch'](function(_0xcdb099){var _0x3c69e6=_0x2d56d4[_0x99b6('0x31')][_0x99b6('0x70')]?0x1f4:_0xcdb099['statusCode']||0x1f4;logger[_0x99b6('0x29')](_0x99b6('0x71'),'getFields',_0x3c69e6,JSON[_0x99b6('0x72')](_0xcdb099));delete _0xcdb099[_0x99b6('0x2a')];if(_0x3c69e6===0x191){_0x3c69e6=0x190;}_0x163620[_0x99b6('0x1c')](_0x3c69e6)[_0x99b6('0x2b')](_0x2d56d4[_0x99b6('0x31')][_0x99b6('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0xcdb099['statusCode']}:_0xcdb099);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index b498633..7d83fa2 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 _0x2ddc=['../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x3a65d5,_0x4454de){var _0xc94b8d=function(_0x180edf){while(--_0x180edf){_0x3a65d5['push'](_0x3a65d5['shift']());}};_0xc94b8d(++_0x4454de);}(_0x2ddc,0x1cd));var _0xc2dd=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x2ddc[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xc2dd('0x0'));var util=require(_0xc2dd('0x1'));var logger=require(_0xc2dd('0x2'))(_0xc2dd('0x3'));var moment=require('moment');var BPromise=require(_0xc2dd('0x4'));var rp=require(_0xc2dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2dd('0x6'));var config=require(_0xc2dd('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xc2dd('0x8'));module[_0xc2dd('0x9')]=function(_0x3aee54,_0x8ad96c){return _0x3aee54[_0xc2dd('0xa')](_0xc2dd('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ac3=['define','int_desk_accounts','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x315de8,_0x1776fd){var _0x35adf4=function(_0x2ffac7){while(--_0x2ffac7){_0x315de8['push'](_0x315de8['shift']());}};_0x35adf4(++_0x1776fd);}(_0x4ac3,0x124));var _0x34ac=function(_0x321370,_0x19ba69){_0x321370=_0x321370-0x0;var _0x5504c7=_0x4ac3[_0x321370];return _0x5504c7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x34ac('0x0'))(_0x34ac('0x1'));var moment=require(_0x34ac('0x2'));var BPromise=require(_0x34ac('0x3'));var rp=require(_0x34ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x34ac('0x5'));var config=require(_0x34ac('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x34ac('0x7')]=function(_0x2ca2a4,_0x45a444){return _0x2ca2a4[_0x34ac('0x8')]('DeskAccount',attributes,{'tableName':_0x34ac('0x9'),'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 cd90073..ba6f77d 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 _0x7c57=['message','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x7c57,0x177));var _0x77c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c57[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x77c5('0x0'));var util=require(_0x77c5('0x1'));var moment=require(_0x77c5('0x2'));var BPromise=require(_0x77c5('0x3'));var rs=require(_0x77c5('0x4'));var fs=require('fs');var Redis=require(_0x77c5('0x5'));var db=require(_0x77c5('0x6'))['db'];var utils=require(_0x77c5('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x77c5('0x8'));var jayson=require(_0x77c5('0x9'));var client=jayson[_0x77c5('0xa')][_0x77c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6d2816,_0xb7f1de,_0x4ef96b){return new BPromise(function(_0xec118f,_0x1e6e2c){return client[_0x77c5('0xc')](_0x6d2816,_0x4ef96b)[_0x77c5('0xd')](function(_0x10f071){logger[_0x77c5('0xe')](_0x77c5('0xf'),_0xb7f1de,_0x77c5('0x10'));logger[_0x77c5('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xb7f1de,'request\x20sent',JSON[_0x77c5('0x12')](_0x10f071));if(_0x10f071['error']){if(_0x10f071[_0x77c5('0x13')][_0x77c5('0x14')]===0x1f4){logger[_0x77c5('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x10f071['error'][_0x77c5('0x15')]);return _0x1e6e2c(_0x10f071['error']['message']);}logger[_0x77c5('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x10f071['error'][_0x77c5('0x15')]);return _0xec118f(_0x10f071['error'][_0x77c5('0x15')]);}else{logger[_0x77c5('0xe')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x77c5('0x10'));_0xec118f(_0x10f071['result']['message']);}})['catch'](function(_0x1aa4c0){logger[_0x77c5('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x1aa4c0);_0x1e6e2c(_0x1aa4c0);});});}exports[_0x77c5('0x16')]=function(_0x5194a4){var _0x384244=this;return new Promise(function(_0x39e6f3,_0xfe0423){return db[_0x77c5('0x17')][_0x77c5('0x18')]({'raw':_0x5194a4[_0x77c5('0x19')]?_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1a')]===undefined?!![]:![]:!![],'where':_0x5194a4['options']?_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1b')]||null:null,'attributes':_0x5194a4['options']?_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1c')]||null:null,'limit':_0x5194a4[_0x77c5('0x19')]?_0x5194a4['options'][_0x77c5('0x1d')]||null:null,'include':_0x5194a4[_0x77c5('0x19')]?_0x5194a4['options'][_0x77c5('0x1e')]?_[_0x77c5('0x1f')](_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1e')],function(_0x17c458){return{'model':db[_0x17c458[_0x77c5('0x20')]],'as':_0x17c458['as'],'attributes':_0x17c458[_0x77c5('0x1c')],'include':_0x17c458[_0x77c5('0x1e')]?_['map'](_0x17c458['include'],function(_0x1cddec){return{'model':db[_0x1cddec[_0x77c5('0x20')]],'as':_0x1cddec['as'],'attributes':_0x1cddec[_0x77c5('0x1c')],'include':_0x1cddec['include']?_[_0x77c5('0x1f')](_0x1cddec[_0x77c5('0x1e')],function(_0x361702){return{'model':db[_0x361702['model']],'as':_0x361702['as'],'attributes':_0x361702[_0x77c5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a84f1){logger[_0x77c5('0xe')]('GetDeskAccount',_0x5194a4);logger[_0x77c5('0x11')](_0x77c5('0x16'),_0x5194a4,JSON[_0x77c5('0x12')](_0x5a84f1));_0x39e6f3(_0x5a84f1);})[_0x77c5('0x21')](function(_0x14b46f){logger['error']('GetDeskAccount',_0x14b46f['message'],_0x5194a4);_0xfe0423(_0x384244[_0x77c5('0x13')](0x1f4,_0x14b46f['message']));});});};exports[_0x77c5('0x22')]=function(_0x1c4f18){var _0x4d9671=this;return new Promise(function(_0x31c93b,_0x4e5c85){return db[_0x77c5('0x17')][_0x77c5('0x23')]({'raw':_0x1c4f18[_0x77c5('0x19')]?_0x1c4f18['options'][_0x77c5('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c4f18['options']?_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1b')]||null:null,'attributes':_0x1c4f18['options']?_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1c')]||null:null,'include':_0x1c4f18[_0x77c5('0x19')]?_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1e')]?_[_0x77c5('0x1f')](_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1e')],function(_0x5960c5){return{'model':db[_0x5960c5[_0x77c5('0x20')]],'as':_0x5960c5['as'],'attributes':_0x5960c5[_0x77c5('0x1c')],'include':_0x5960c5['include']?_[_0x77c5('0x1f')](_0x5960c5[_0x77c5('0x1e')],function(_0x5a1b06){return{'model':db[_0x5a1b06['model']],'as':_0x5a1b06['as'],'attributes':_0x5a1b06['attributes'],'include':_0x5a1b06[_0x77c5('0x1e')]?_[_0x77c5('0x1f')](_0x5a1b06[_0x77c5('0x1e')],function(_0xabbc1f){return{'model':db[_0xabbc1f[_0x77c5('0x20')]],'as':_0xabbc1f['as'],'attributes':_0xabbc1f[_0x77c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x77c5('0xd')](function(_0x105558){logger[_0x77c5('0xe')](_0x77c5('0x22'),_0x1c4f18);logger[_0x77c5('0x11')](_0x77c5('0x22'),_0x1c4f18,JSON[_0x77c5('0x12')](_0x105558));_0x31c93b(_0x105558);})[_0x77c5('0x21')](function(_0x482ec8){logger['error'](_0x77c5('0x22'),_0x482ec8[_0x77c5('0x15')],_0x1c4f18);_0x4e5c85(_0x4d9671[_0x77c5('0x13')](0x1f4,_0x482ec8['message']));});});}; \ No newline at end of file +var _0x0f85=['ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount'];(function(_0x21add9,_0x323ca9){var _0x16d218=function(_0x5e59eb){while(--_0x5e59eb){_0x21add9['push'](_0x21add9['shift']());}};_0x16d218(++_0x323ca9);}(_0x0f85,0x77));var _0x50f8=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0f85[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x50f8('0x0'));var util=require(_0x50f8('0x1'));var moment=require(_0x50f8('0x2'));var BPromise=require(_0x50f8('0x3'));var rs=require(_0x50f8('0x4'));var fs=require('fs');var Redis=require(_0x50f8('0x5'));var db=require(_0x50f8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x50f8('0x7'))(_0x50f8('0x8'));var config=require(_0x50f8('0x9'));var jayson=require(_0x50f8('0xa'));var client=jayson[_0x50f8('0xb')][_0x50f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33c9b3,_0x50384b,_0x299e42){return new BPromise(function(_0x2618dc,_0x2bec52){return client[_0x50f8('0xd')](_0x33c9b3,_0x299e42)[_0x50f8('0xe')](function(_0x5e2910){logger[_0x50f8('0xf')](_0x50f8('0x10'),_0x50384b,_0x50f8('0x11'));logger[_0x50f8('0x12')](_0x50f8('0x13'),_0x50384b,_0x50f8('0x11'),JSON[_0x50f8('0x14')](_0x5e2910));if(_0x5e2910['error']){if(_0x5e2910[_0x50f8('0x15')][_0x50f8('0x16')]===0x1f4){logger[_0x50f8('0x15')](_0x50f8('0x10'),_0x50384b,_0x5e2910['error'][_0x50f8('0x17')]);return _0x2bec52(_0x5e2910[_0x50f8('0x15')][_0x50f8('0x17')]);}logger['error'](_0x50f8('0x10'),_0x50384b,_0x5e2910[_0x50f8('0x15')][_0x50f8('0x17')]);return _0x2618dc(_0x5e2910[_0x50f8('0x15')][_0x50f8('0x17')]);}else{logger['info'](_0x50f8('0x10'),_0x50384b,_0x50f8('0x11'));_0x2618dc(_0x5e2910[_0x50f8('0x18')][_0x50f8('0x17')]);}})[_0x50f8('0x19')](function(_0x1d926d){logger['error'](_0x50f8('0x10'),_0x50384b,_0x1d926d);_0x2bec52(_0x1d926d);});});}exports['GetDeskAccount']=function(_0x5e54f3){var _0x376804=this;return new Promise(function(_0x4d00cd,_0x2d3c7e){return db[_0x50f8('0x1a')][_0x50f8('0x1b')]({'raw':_0x5e54f3[_0x50f8('0x1c')]?_0x5e54f3['options'][_0x50f8('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e54f3['options']?_0x5e54f3[_0x50f8('0x1c')][_0x50f8('0x1e')]||null:null,'attributes':_0x5e54f3[_0x50f8('0x1c')]?_0x5e54f3[_0x50f8('0x1c')][_0x50f8('0x1f')]||null:null,'limit':_0x5e54f3[_0x50f8('0x1c')]?_0x5e54f3[_0x50f8('0x1c')][_0x50f8('0x20')]||null:null,'include':_0x5e54f3[_0x50f8('0x1c')]?_0x5e54f3[_0x50f8('0x1c')][_0x50f8('0x21')]?_[_0x50f8('0x22')](_0x5e54f3[_0x50f8('0x1c')]['include'],function(_0x2a7d1e){return{'model':db[_0x2a7d1e[_0x50f8('0x23')]],'as':_0x2a7d1e['as'],'attributes':_0x2a7d1e[_0x50f8('0x1f')],'include':_0x2a7d1e['include']?_[_0x50f8('0x22')](_0x2a7d1e[_0x50f8('0x21')],function(_0x54459d){return{'model':db[_0x54459d[_0x50f8('0x23')]],'as':_0x54459d['as'],'attributes':_0x54459d['attributes'],'include':_0x54459d['include']?_[_0x50f8('0x22')](_0x54459d[_0x50f8('0x21')],function(_0x56367c){return{'model':db[_0x56367c[_0x50f8('0x23')]],'as':_0x56367c['as'],'attributes':_0x56367c[_0x50f8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x50f8('0xe')](function(_0x221008){logger['info'](_0x50f8('0x24'),_0x5e54f3);logger['debug'](_0x50f8('0x24'),_0x5e54f3,JSON[_0x50f8('0x14')](_0x221008));_0x4d00cd(_0x221008);})['catch'](function(_0x4f039b){logger[_0x50f8('0x15')](_0x50f8('0x24'),_0x4f039b[_0x50f8('0x17')],_0x5e54f3);_0x2d3c7e(_0x376804[_0x50f8('0x15')](0x1f4,_0x4f039b[_0x50f8('0x17')]));});});};exports[_0x50f8('0x25')]=function(_0x400f78){var _0x3aa8cb=this;return new Promise(function(_0x1db28f,_0x117848){return db['DeskAccount'][_0x50f8('0x26')]({'raw':_0x400f78['options']?_0x400f78[_0x50f8('0x1c')][_0x50f8('0x1d')]===undefined?!![]:![]:!![],'where':_0x400f78[_0x50f8('0x1c')]?_0x400f78[_0x50f8('0x1c')][_0x50f8('0x1e')]||null:null,'attributes':_0x400f78[_0x50f8('0x1c')]?_0x400f78[_0x50f8('0x1c')]['attributes']||null:null,'include':_0x400f78[_0x50f8('0x1c')]?_0x400f78[_0x50f8('0x1c')][_0x50f8('0x21')]?_[_0x50f8('0x22')](_0x400f78[_0x50f8('0x1c')]['include'],function(_0x711474){return{'model':db[_0x711474[_0x50f8('0x23')]],'as':_0x711474['as'],'attributes':_0x711474[_0x50f8('0x1f')],'include':_0x711474['include']?_[_0x50f8('0x22')](_0x711474['include'],function(_0x1606b7){return{'model':db[_0x1606b7['model']],'as':_0x1606b7['as'],'attributes':_0x1606b7[_0x50f8('0x1f')],'include':_0x1606b7[_0x50f8('0x21')]?_['map'](_0x1606b7[_0x50f8('0x21')],function(_0x1ac9fd){return{'model':db[_0x1ac9fd['model']],'as':_0x1ac9fd['as'],'attributes':_0x1ac9fd[_0x50f8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x50f8('0xe')](function(_0x351533){logger[_0x50f8('0xf')]('ShowDeskAccount',_0x400f78);logger[_0x50f8('0x12')](_0x50f8('0x25'),_0x400f78,JSON['stringify'](_0x351533));_0x1db28f(_0x351533);})[_0x50f8('0x19')](function(_0x59731d){logger['error'](_0x50f8('0x25'),_0x59731d['message'],_0x400f78);_0x117848(_0x3aa8cb[_0x50f8('0x15')](0x1f4,_0x59731d['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 0cad84d..9f2e11d 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 _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x175c2c,_0x13e3d6){var _0x49d665=function(_0x348e8a){while(--_0x348e8a){_0x175c2c['push'](_0x175c2c['shift']());}};_0x49d665(++_0x13e3d6);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'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['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x5574d1,_0x1f161c){var _0x5c042a=function(_0x3011c6){while(--_0x3011c6){_0x5574d1['push'](_0x5574d1['shift']());}};_0x5c042a(++_0x1f161c);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 1252692..3639776 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 _0xfa76=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa76,0x160));var _0x6fa7=function(_0x550b4b,_0x204779){_0x550b4b=_0x550b4b-0x0;var _0x5dc3a3=_0xfa76[_0x550b4b];return _0x5dc3a3;};'use strict';var Sequelize=require(_0x6fa7('0x0'));module[_0x6fa7('0x1')]={'name':{'type':Sequelize[_0x6fa7('0x2')]},'description':{'type':Sequelize[_0x6fa7('0x2')]}}; \ No newline at end of file +var _0xee2a=['sequelize','exports','STRING'];(function(_0x51b8a6,_0x3cb235){var _0x42c8e7=function(_0x49ce93){while(--_0x49ce93){_0x51b8a6['push'](_0x51b8a6['shift']());}};_0x42c8e7(++_0x3cb235);}(_0xee2a,0xcf));var _0xaee2=function(_0x538335,_0x517073){_0x538335=_0x538335-0x0;var _0xafd88c=_0xee2a[_0x538335];return _0xafd88c;};'use strict';var Sequelize=require(_0xaee2('0x0'));module[_0xaee2('0x1')]={'name':{'type':Sequelize[_0xaee2('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 b9c20b7..f69070a 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 _0x7d92=['keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','intersection','options','find','create','body','getFields','DeskField','getSubjects','nolimit','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','fieldName','key','model','query'];(function(_0x42e726,_0x567864){var _0x22610f=function(_0x31329f){while(--_0x31329f){_0x42e726['push'](_0x42e726['shift']());}};_0x22610f(++_0x567864);}(_0x7d92,0xcb));var _0x27d9=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x7d92[_0x4164f2];return _0x2575c7;};'use strict';var emlformat=require(_0x27d9('0x0'));var rimraf=require(_0x27d9('0x1'));var zipdir=require(_0x27d9('0x2'));var jsonpatch=require(_0x27d9('0x3'));var rp=require(_0x27d9('0x4'));var moment=require(_0x27d9('0x5'));var BPromise=require(_0x27d9('0x6'));var Mustache=require(_0x27d9('0x7'));var util=require(_0x27d9('0x8'));var path=require(_0x27d9('0x9'));var sox=require(_0x27d9('0xa'));var csv=require(_0x27d9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x27d9('0xc'));var deskjs=require(_0x27d9('0xd'));var toCsv=require(_0x27d9('0xb'));var querystring=require(_0x27d9('0xe'));var Papa=require('papaparse');var Redis=require(_0x27d9('0xf'));var authService=require(_0x27d9('0x10'));var qs=require(_0x27d9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27d9('0x12'))(_0x27d9('0x13'));var utils=require(_0x27d9('0x14'));var config=require(_0x27d9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27d9('0x16'))['db'];function respondWithStatusCode(_0x1d2d88,_0x45cb15){_0x45cb15=_0x45cb15||0xcc;return function(_0x5af9e1){if(_0x5af9e1){return _0x1d2d88[_0x27d9('0x17')](_0x45cb15);}return _0x1d2d88[_0x27d9('0x18')](_0x45cb15)[_0x27d9('0x19')]();};}function respondWithResult(_0x103355,_0x2f6680){_0x2f6680=_0x2f6680||0xc8;return function(_0x509c2b){if(_0x509c2b){return _0x103355[_0x27d9('0x18')](_0x2f6680)[_0x27d9('0x1a')](_0x509c2b);}};}function respondWithFilteredResult(_0x5e7d79,_0x96f1d4){return function(_0xbfd9ae){if(_0xbfd9ae){var _0x103e00=typeof _0x96f1d4['offset']==='undefined'&&typeof _0x96f1d4[_0x27d9('0x1b')]===_0x27d9('0x1c');var _0x549045=_0xbfd9ae[_0x27d9('0x1d')];var _0x4f2daf=_0x103e00?0x0:_0x96f1d4[_0x27d9('0x1e')];var _0xb6c5ae=_0x103e00?_0xbfd9ae[_0x27d9('0x1d')]:_0x96f1d4['offset']+_0x96f1d4[_0x27d9('0x1b')];var _0x13e3d8;if(_0xb6c5ae>=_0x549045){_0xb6c5ae=_0x549045;_0x13e3d8=0xc8;}else{_0x13e3d8=0xce;}_0x5e7d79[_0x27d9('0x18')](_0x13e3d8);return _0x5e7d79[_0x27d9('0x1f')](_0x27d9('0x20'),_0x4f2daf+'-'+_0xb6c5ae+'/'+_0x549045)[_0x27d9('0x1a')](_0xbfd9ae);}return null;};}function patchUpdates(_0x3d5427){return function(_0x145525){try{jsonpatch[_0x27d9('0x21')](_0x145525,_0x3d5427,!![]);}catch(_0x50d1a2){return BPromise[_0x27d9('0x22')](_0x50d1a2);}return _0x145525['save']();};}function saveUpdates(_0x2f36ea,_0x4d6fa5){return function(_0x15b04e){if(_0x15b04e){return _0x15b04e[_0x27d9('0x23')](_0x2f36ea)[_0x27d9('0x24')](function(_0x5509b7){return _0x5509b7;});}return null;};}function removeEntity(_0x3b742f,_0x2671aa){return function(_0x410dd3){if(_0x410dd3){return _0x410dd3[_0x27d9('0x25')]()[_0x27d9('0x24')](function(){_0x3b742f['status'](0xcc)[_0x27d9('0x19')]();});}};}function handleEntityNotFound(_0x55e78f,_0xa00bb3){return function(_0x37b68d){if(!_0x37b68d){_0x55e78f[_0x27d9('0x17')](0x194);}return _0x37b68d;};}function handleError(_0x15f921,_0x12c17b){_0x12c17b=_0x12c17b||0x1f4;return function(_0x551f58){logger[_0x27d9('0x26')](_0x551f58[_0x27d9('0x27')]);if(_0x551f58[_0x27d9('0x28')]){delete _0x551f58[_0x27d9('0x28')];}_0x15f921[_0x27d9('0x18')](_0x12c17b)[_0x27d9('0x29')](_0x551f58);};}exports[_0x27d9('0x2a')]=function(_0x234d34,_0x344d38){var _0x2736b4={},_0x4bd40e={},_0x13cd60={'count':0x0,'rows':[]};var _0x3109d6=_[_0x27d9('0x2b')](db[_0x27d9('0x2c')]['rawAttributes'],function(_0x3e8ee2){return{'name':_0x3e8ee2[_0x27d9('0x2d')],'type':_0x3e8ee2['type'][_0x27d9('0x2e')]};});_0x4bd40e[_0x27d9('0x2f')]=_[_0x27d9('0x2b')](_0x3109d6,'name');_0x4bd40e[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x234d34[_0x27d9('0x30')]);_0x4bd40e['filters']=_['intersection'](_0x4bd40e[_0x27d9('0x2f')],_0x4bd40e[_0x27d9('0x30')]);_0x2736b4[_0x27d9('0x32')]=_['intersection'](_0x4bd40e[_0x27d9('0x2f')],qs['fields'](_0x234d34[_0x27d9('0x30')][_0x27d9('0x33')]));_0x2736b4[_0x27d9('0x32')]=_0x2736b4[_0x27d9('0x32')][_0x27d9('0x34')]?_0x2736b4[_0x27d9('0x32')]:_0x4bd40e[_0x27d9('0x2f')];if(!_0x234d34['query'][_0x27d9('0x35')]('nolimit')){_0x2736b4[_0x27d9('0x1b')]=qs[_0x27d9('0x1b')](_0x234d34[_0x27d9('0x30')]['limit']);_0x2736b4[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x234d34['query'][_0x27d9('0x1e')]);}_0x2736b4[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x234d34[_0x27d9('0x30')][_0x27d9('0x37')]);_0x2736b4[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x234d34[_0x27d9('0x30')],_0x4bd40e[_0x27d9('0x39')]),_0x3109d6);if(_0x234d34[_0x27d9('0x30')][_0x27d9('0x3b')]){_0x2736b4[_0x27d9('0x38')]=_[_0x27d9('0x3c')](_0x2736b4['where'],{'$or':_[_0x27d9('0x2b')](_0x3109d6,function(_0x3e78f0){if(_0x3e78f0[_0x27d9('0x3d')]!==_0x27d9('0x3e')){var _0x20e7f8={};_0x20e7f8[_0x3e78f0[_0x27d9('0x28')]]={'$like':'%'+_0x234d34[_0x27d9('0x30')]['filter']+'%'};return _0x20e7f8;}})});}_0x2736b4=_[_0x27d9('0x3c')]({},_0x2736b4,_0x234d34['options']);var _0x902902={'where':_0x2736b4['where']};return db[_0x27d9('0x2c')][_0x27d9('0x1d')](_0x902902)[_0x27d9('0x24')](function(_0x5369d6){_0x13cd60['count']=_0x5369d6;if(_0x234d34[_0x27d9('0x30')][_0x27d9('0x3f')]){_0x2736b4['include']=[{'all':!![]}];}return db[_0x27d9('0x2c')][_0x27d9('0x40')](_0x2736b4);})[_0x27d9('0x24')](function(_0x2ee87b){_0x13cd60[_0x27d9('0x41')]=_0x2ee87b;return _0x13cd60;})['then'](respondWithFilteredResult(_0x344d38,_0x2736b4))[_0x27d9('0x42')](handleError(_0x344d38,null));};exports['show']=function(_0x142046,_0x7c8af5){var _0x50af02={'raw':![],'where':{'id':_0x142046[_0x27d9('0x43')]['id']}},_0x4addff={};_0x4addff['model']=_['keys'](db[_0x27d9('0x2c')][_0x27d9('0x44')]);_0x4addff[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x142046[_0x27d9('0x30')]);_0x4addff[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x4addff['model'],_0x4addff[_0x27d9('0x30')]);_0x50af02[_0x27d9('0x32')]=_[_0x27d9('0x45')](_0x4addff[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x142046[_0x27d9('0x30')]['fields']));_0x50af02[_0x27d9('0x32')]=_0x50af02[_0x27d9('0x32')]['length']?_0x50af02['attributes']:_0x4addff[_0x27d9('0x2f')];if(_0x142046['query'][_0x27d9('0x3f')]){_0x50af02['include']=[{'all':!![]}];}_0x50af02=_[_0x27d9('0x3c')]({},_0x50af02,_0x142046[_0x27d9('0x46')]);return db[_0x27d9('0x2c')][_0x27d9('0x47')](_0x50af02)[_0x27d9('0x24')](handleEntityNotFound(_0x7c8af5,null))['then'](respondWithResult(_0x7c8af5,null))[_0x27d9('0x42')](handleError(_0x7c8af5,null));};exports[_0x27d9('0x48')]=function(_0x4b0402,_0x4efebd){return db[_0x27d9('0x2c')][_0x27d9('0x48')](_0x4b0402[_0x27d9('0x49')],{})[_0x27d9('0x24')](respondWithResult(_0x4efebd,0xc9))[_0x27d9('0x42')](handleError(_0x4efebd,null));};exports[_0x27d9('0x23')]=function(_0x388e85,_0x31430d){if(_0x388e85[_0x27d9('0x49')]['id']){delete _0x388e85['body']['id'];}return db[_0x27d9('0x2c')][_0x27d9('0x47')]({'where':{'id':_0x388e85[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x31430d,null))[_0x27d9('0x24')](saveUpdates(_0x388e85[_0x27d9('0x49')],null))[_0x27d9('0x24')](respondWithResult(_0x31430d,null))['catch'](handleError(_0x31430d,null));};exports[_0x27d9('0x25')]=function(_0x2f8d32,_0x3168da){return db['DeskConfiguration']['find']({'where':{'id':_0x2f8d32[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x3168da,null))[_0x27d9('0x24')](removeEntity(_0x3168da,null))[_0x27d9('0x42')](handleError(_0x3168da,null));};exports[_0x27d9('0x4a')]=function(_0x2184af,_0x428e0b,_0x45acd6){var _0x50a28f={};var _0x69f9aa={};var _0x30d6f1;var _0x32bf01;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2184af[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x428e0b,null))['then'](function(_0x8d432){if(_0x8d432){_0x30d6f1=_0x8d432;_0x69f9aa['model']=_[_0x27d9('0x31')](db[_0x27d9('0x4b')][_0x27d9('0x44')]);_0x69f9aa['query']=_['keys'](_0x2184af[_0x27d9('0x30')]);_0x69f9aa[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x69f9aa[_0x27d9('0x2f')],_0x69f9aa[_0x27d9('0x30')]);_0x50a28f['attributes']=_[_0x27d9('0x45')](_0x69f9aa[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x2184af[_0x27d9('0x30')]['fields']));_0x50a28f[_0x27d9('0x32')]=_0x50a28f[_0x27d9('0x32')]['length']?_0x50a28f[_0x27d9('0x32')]:_0x69f9aa[_0x27d9('0x2f')];_0x50a28f[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x2184af[_0x27d9('0x30')]['sort']);_0x50a28f[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x2184af[_0x27d9('0x30')],_0x69f9aa['filters']));if(_0x2184af[_0x27d9('0x30')]['filter']){_0x50a28f[_0x27d9('0x38')]=_['merge'](_0x50a28f[_0x27d9('0x38')],{'$or':_['map'](_0x50a28f[_0x27d9('0x32')],function(_0xee49d7){var _0xd2e4fa={};_0xd2e4fa[_0xee49d7]={'$like':'%'+_0x2184af['query'][_0x27d9('0x3b')]+'%'};return _0xd2e4fa;})});}_0x50a28f=_[_0x27d9('0x3c')]({},_0x50a28f,_0x2184af[_0x27d9('0x46')]);return _0x30d6f1['getFields'](_0x50a28f);}})[_0x27d9('0x24')](function(_0x40c03d){if(_0x40c03d){_0x32bf01=_0x40c03d['length'];if(!_0x2184af['query'][_0x27d9('0x35')]('nolimit')){_0x50a28f[_0x27d9('0x1b')]=qs[_0x27d9('0x1b')](_0x2184af[_0x27d9('0x30')][_0x27d9('0x1b')]);_0x50a28f['offset']=qs[_0x27d9('0x1e')](_0x2184af['query']['offset']);}return _0x30d6f1[_0x27d9('0x4a')](_0x50a28f);}})[_0x27d9('0x24')](function(_0x114806){if(_0x114806){return _0x114806?{'count':_0x32bf01,'rows':_0x114806}:null;}})['then'](respondWithResult(_0x428e0b,null))[_0x27d9('0x42')](handleError(_0x428e0b,null));};exports[_0x27d9('0x4c')]=function(_0x38c702,_0x4fe176,_0x411c67){var _0x1e35e5={};var _0x8b71e9={};var _0x40ba32;var _0x3d6b79;return db[_0x27d9('0x2c')]['findOne']({'where':{'id':_0x38c702[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x4fe176,null))[_0x27d9('0x24')](function(_0xa13214){if(_0xa13214){_0x40ba32=_0xa13214;_0x8b71e9[_0x27d9('0x2f')]=_[_0x27d9('0x31')](db[_0x27d9('0x4b')][_0x27d9('0x44')]);_0x8b71e9[_0x27d9('0x30')]=_['keys'](_0x38c702[_0x27d9('0x30')]);_0x8b71e9[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x8b71e9[_0x27d9('0x2f')],_0x8b71e9[_0x27d9('0x30')]);_0x1e35e5[_0x27d9('0x32')]=_[_0x27d9('0x45')](_0x8b71e9[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x38c702[_0x27d9('0x30')]['fields']));_0x1e35e5[_0x27d9('0x32')]=_0x1e35e5[_0x27d9('0x32')][_0x27d9('0x34')]?_0x1e35e5[_0x27d9('0x32')]:_0x8b71e9[_0x27d9('0x2f')];_0x1e35e5[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x38c702[_0x27d9('0x30')][_0x27d9('0x37')]);_0x1e35e5['where']=qs['filters'](_[_0x27d9('0x3a')](_0x38c702[_0x27d9('0x30')],_0x8b71e9[_0x27d9('0x39')]));if(_0x38c702['query'][_0x27d9('0x3b')]){_0x1e35e5[_0x27d9('0x38')]=_[_0x27d9('0x3c')](_0x1e35e5['where'],{'$or':_['map'](_0x1e35e5['attributes'],function(_0x2bdba8){var _0x10c799={};_0x10c799[_0x2bdba8]={'$like':'%'+_0x38c702[_0x27d9('0x30')][_0x27d9('0x3b')]+'%'};return _0x10c799;})});}_0x1e35e5=_[_0x27d9('0x3c')]({},_0x1e35e5,_0x38c702['options']);return _0x40ba32[_0x27d9('0x4c')](_0x1e35e5);}})[_0x27d9('0x24')](function(_0xa86efe){if(_0xa86efe){_0x3d6b79=_0xa86efe[_0x27d9('0x34')];if(!_0x38c702[_0x27d9('0x30')][_0x27d9('0x35')](_0x27d9('0x4d'))){_0x1e35e5['limit']=qs[_0x27d9('0x1b')](_0x38c702[_0x27d9('0x30')][_0x27d9('0x1b')]);_0x1e35e5[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x38c702['query'][_0x27d9('0x1e')]);}return _0x40ba32[_0x27d9('0x4c')](_0x1e35e5);}})[_0x27d9('0x24')](function(_0x3491f5){if(_0x3491f5){return _0x3491f5?{'count':_0x3d6b79,'rows':_0x3491f5}:null;}})['then'](respondWithResult(_0x4fe176,null))[_0x27d9('0x42')](handleError(_0x4fe176,null));};exports['getDescriptions']=function(_0x4adfc3,_0x10e788,_0x3c1966){var _0x27fcdd={};var _0x3d314f={};var _0x46927f;var _0x2964bc;return db[_0x27d9('0x2c')][_0x27d9('0x4e')]({'where':{'id':_0x4adfc3[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x10e788,null))[_0x27d9('0x24')](function(_0x4ce260){if(_0x4ce260){_0x46927f=_0x4ce260;_0x3d314f[_0x27d9('0x2f')]=_[_0x27d9('0x31')](db[_0x27d9('0x4b')][_0x27d9('0x44')]);_0x3d314f[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x4adfc3[_0x27d9('0x30')]);_0x3d314f[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x3d314f[_0x27d9('0x2f')],_0x3d314f[_0x27d9('0x30')]);_0x27fcdd[_0x27d9('0x32')]=_[_0x27d9('0x45')](_0x3d314f[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x33')]));_0x27fcdd[_0x27d9('0x32')]=_0x27fcdd[_0x27d9('0x32')][_0x27d9('0x34')]?_0x27fcdd[_0x27d9('0x32')]:_0x3d314f[_0x27d9('0x2f')];_0x27fcdd['order']=qs[_0x27d9('0x37')](_0x4adfc3['query'][_0x27d9('0x37')]);_0x27fcdd[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x4adfc3['query'],_0x3d314f[_0x27d9('0x39')]));if(_0x4adfc3[_0x27d9('0x30')]['filter']){_0x27fcdd[_0x27d9('0x38')]=_[_0x27d9('0x3c')](_0x27fcdd[_0x27d9('0x38')],{'$or':_['map'](_0x27fcdd['attributes'],function(_0x39bc3e){var _0x502162={};_0x502162[_0x39bc3e]={'$like':'%'+_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x3b')]+'%'};return _0x502162;})});}_0x27fcdd=_[_0x27d9('0x3c')]({},_0x27fcdd,_0x4adfc3[_0x27d9('0x46')]);return _0x46927f[_0x27d9('0x4f')](_0x27fcdd);}})[_0x27d9('0x24')](function(_0x407e92){if(_0x407e92){_0x2964bc=_0x407e92['length'];if(!_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x35')]('nolimit')){_0x27fcdd[_0x27d9('0x1b')]=qs[_0x27d9('0x1b')](_0x4adfc3[_0x27d9('0x30')]['limit']);_0x27fcdd[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x1e')]);}return _0x46927f[_0x27d9('0x4f')](_0x27fcdd);}})['then'](function(_0x564049){if(_0x564049){return _0x564049?{'count':_0x2964bc,'rows':_0x564049}:null;}})['then'](respondWithResult(_0x10e788,null))[_0x27d9('0x42')](handleError(_0x10e788,null));};exports[_0x27d9('0x50')]=function(_0x1f02d9,_0x22db81,_0x31deee){var _0x4cc4b0={};var _0xd65920={};var _0x407cd1;var _0x370fad;return db[_0x27d9('0x2c')]['findOne']({'where':{'id':_0x1f02d9[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x22db81,null))[_0x27d9('0x24')](function(_0x336d0c){if(_0x336d0c){_0x407cd1=_0x336d0c;_0xd65920[_0x27d9('0x2f')]=_[_0x27d9('0x31')](db[_0x27d9('0x51')][_0x27d9('0x44')]);_0xd65920[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x1f02d9['query']);_0xd65920[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0xd65920[_0x27d9('0x2f')],_0xd65920['query']);_0x4cc4b0['attributes']=_['intersection'](_0xd65920[_0x27d9('0x2f')],qs['fields'](_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x33')]));_0x4cc4b0[_0x27d9('0x32')]=_0x4cc4b0[_0x27d9('0x32')][_0x27d9('0x34')]?_0x4cc4b0[_0x27d9('0x32')]:_0xd65920[_0x27d9('0x2f')];_0x4cc4b0[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x1f02d9['query'][_0x27d9('0x37')]);_0x4cc4b0[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x1f02d9[_0x27d9('0x30')],_0xd65920[_0x27d9('0x39')]));if(_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x3b')]){_0x4cc4b0['where']=_['merge'](_0x4cc4b0[_0x27d9('0x38')],{'$or':_[_0x27d9('0x2b')](_0x4cc4b0[_0x27d9('0x32')],function(_0x553b29){var _0x1a4521={};_0x1a4521[_0x553b29]={'$like':'%'+_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x3b')]+'%'};return _0x1a4521;})});}_0x4cc4b0=_[_0x27d9('0x3c')]({},_0x4cc4b0,_0x1f02d9[_0x27d9('0x46')]);return _0x407cd1[_0x27d9('0x50')](_0x4cc4b0);}})[_0x27d9('0x24')](function(_0x728e2f){if(_0x728e2f){_0x370fad=_0x728e2f[_0x27d9('0x34')];if(!_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x35')](_0x27d9('0x4d'))){_0x4cc4b0[_0x27d9('0x1b')]=qs['limit'](_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x1b')]);_0x4cc4b0[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x1e')]);}return _0x407cd1[_0x27d9('0x50')](_0x4cc4b0);}})['then'](function(_0x5b99d7){if(_0x5b99d7){return _0x5b99d7?{'count':_0x370fad,'rows':_0x5b99d7}:null;}})['then'](respondWithResult(_0x22db81,null))['catch'](handleError(_0x22db81,null));};exports[_0x27d9('0x52')]=function(_0x487fce,_0x443ca4,_0x374bc9){if(_0x487fce[_0x27d9('0x49')]['id']){delete _0x487fce['body']['id'];}return db[_0x27d9('0x2c')]['findOne']({'where':{'id':_0x487fce['params']['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x443ca4,null))[_0x27d9('0x24')](function(_0x212285){if(_0x212285){return _0x212285['setTags'](_0x487fce[_0x27d9('0x49')][_0x27d9('0x53')]||[]);}return null;})[_0x27d9('0x24')](respondWithResult(_0x443ca4,null))['catch'](handleError(_0x443ca4,null));}; \ No newline at end of file +var _0x31ba=['rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','DeskConfiguration','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','sort','getSubjects','getDescriptions','Tag','getTags','setTags','ids'];(function(_0x303862,_0x20b5ab){var _0xe6f228=function(_0x41fc5a){while(--_0x41fc5a){_0x303862['push'](_0x303862['shift']());}};_0xe6f228(++_0x20b5ab);}(_0x31ba,0x102));var _0xa31b=function(_0x1c53e1,_0x2f11a8){_0x1c53e1=_0x1c53e1-0x0;var _0x1f5b1f=_0x31ba[_0x1c53e1];return _0x1f5b1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa31b('0x0'));var zipdir=require(_0xa31b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa31b('0x2'));var moment=require(_0xa31b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa31b('0x4'));var util=require(_0xa31b('0x5'));var path=require(_0xa31b('0x6'));var sox=require(_0xa31b('0x7'));var csv=require(_0xa31b('0x8'));var ejs=require(_0xa31b('0x9'));var fs=require('fs');var fs_extra=require(_0xa31b('0xa'));var _=require('lodash');var squel=require(_0xa31b('0xb'));var crypto=require(_0xa31b('0xc'));var jsforce=require(_0xa31b('0xd'));var deskjs=require(_0xa31b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa31b('0xf'));var Redis=require('ioredis');var authService=require(_0xa31b('0x10'));var qs=require(_0xa31b('0x11'));var as=require(_0xa31b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa31b('0x13'));var utils=require(_0xa31b('0x14'));var config=require(_0xa31b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa31b('0x16'))['db'];function respondWithStatusCode(_0x155a08,_0x301e1e){_0x301e1e=_0x301e1e||0xcc;return function(_0x356d25){if(_0x356d25){return _0x155a08[_0xa31b('0x17')](_0x301e1e);}return _0x155a08['status'](_0x301e1e)[_0xa31b('0x18')]();};}function respondWithResult(_0x1920c6,_0x46a7ad){_0x46a7ad=_0x46a7ad||0xc8;return function(_0x2246a8){if(_0x2246a8){return _0x1920c6[_0xa31b('0x19')](_0x46a7ad)[_0xa31b('0x1a')](_0x2246a8);}};}function respondWithFilteredResult(_0x21c4a1,_0x383bed){return function(_0x1f6542){if(_0x1f6542){var _0x225219=typeof _0x383bed['offset']===_0xa31b('0x1b')&&typeof _0x383bed[_0xa31b('0x1c')]===_0xa31b('0x1b');var _0x330453=_0x1f6542[_0xa31b('0x1d')];var _0x1fa90e=_0x225219?0x0:_0x383bed[_0xa31b('0x1e')];var _0x587c55=_0x225219?_0x1f6542[_0xa31b('0x1d')]:_0x383bed[_0xa31b('0x1e')]+_0x383bed[_0xa31b('0x1c')];var _0x4b612f;if(_0x587c55>=_0x330453){_0x587c55=_0x330453;_0x4b612f=0xc8;}else{_0x4b612f=0xce;}_0x21c4a1[_0xa31b('0x19')](_0x4b612f);return _0x21c4a1[_0xa31b('0x1f')](_0xa31b('0x20'),_0x1fa90e+'-'+_0x587c55+'/'+_0x330453)[_0xa31b('0x1a')](_0x1f6542);}return null;};}function patchUpdates(_0x11cf74){return function(_0x70a10a){try{jsonpatch['apply'](_0x70a10a,_0x11cf74,!![]);}catch(_0x181e70){return BPromise[_0xa31b('0x21')](_0x181e70);}return _0x70a10a[_0xa31b('0x22')]();};}function saveUpdates(_0x83cf8d,_0x59536a){return function(_0x15dfb0){if(_0x15dfb0){return _0x15dfb0[_0xa31b('0x23')](_0x83cf8d)[_0xa31b('0x24')](function(_0x453bf8){return _0x453bf8;});}return null;};}function removeEntity(_0x3bb237,_0x3f1b3a){return function(_0x587737){if(_0x587737){return _0x587737[_0xa31b('0x25')]()[_0xa31b('0x24')](function(){_0x3bb237[_0xa31b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x310f1d,_0x541266){return function(_0x1d6603){if(!_0x1d6603){_0x310f1d['sendStatus'](0x194);}return _0x1d6603;};}function handleError(_0x498438,_0x2b0dc2){_0x2b0dc2=_0x2b0dc2||0x1f4;return function(_0x117f50){logger[_0xa31b('0x26')](_0x117f50[_0xa31b('0x27')]);if(_0x117f50[_0xa31b('0x28')]){delete _0x117f50[_0xa31b('0x28')];}_0x498438[_0xa31b('0x19')](_0x2b0dc2)[_0xa31b('0x29')](_0x117f50);};}exports[_0xa31b('0x2a')]=function(_0x5f25fe,_0x356c5f){var _0x57ee17={},_0x3572e4={},_0x14ed5f={'count':0x0,'rows':[]};var _0x55ecbc=_['map'](db['DeskConfiguration']['rawAttributes'],function(_0x41db35){return{'name':_0x41db35[_0xa31b('0x2b')],'type':_0x41db35[_0xa31b('0x2c')][_0xa31b('0x2d')]};});_0x3572e4[_0xa31b('0x2e')]=_['map'](_0x55ecbc,'name');_0x3572e4[_0xa31b('0x2f')]=_[_0xa31b('0x30')](_0x5f25fe[_0xa31b('0x2f')]);_0x3572e4[_0xa31b('0x31')]=_[_0xa31b('0x32')](_0x3572e4['model'],_0x3572e4[_0xa31b('0x2f')]);_0x57ee17['attributes']=_[_0xa31b('0x32')](_0x3572e4[_0xa31b('0x2e')],qs[_0xa31b('0x33')](_0x5f25fe[_0xa31b('0x2f')]['fields']));_0x57ee17['attributes']=_0x57ee17[_0xa31b('0x34')][_0xa31b('0x35')]?_0x57ee17[_0xa31b('0x34')]:_0x3572e4[_0xa31b('0x2e')];if(!_0x5f25fe[_0xa31b('0x2f')][_0xa31b('0x36')](_0xa31b('0x37'))){_0x57ee17['limit']=qs[_0xa31b('0x1c')](_0x5f25fe[_0xa31b('0x2f')][_0xa31b('0x1c')]);_0x57ee17[_0xa31b('0x1e')]=qs['offset'](_0x5f25fe[_0xa31b('0x2f')][_0xa31b('0x1e')]);}_0x57ee17[_0xa31b('0x38')]=qs['sort'](_0x5f25fe[_0xa31b('0x2f')]['sort']);_0x57ee17['where']=qs[_0xa31b('0x31')](_[_0xa31b('0x39')](_0x5f25fe[_0xa31b('0x2f')],_0x3572e4[_0xa31b('0x31')]),_0x55ecbc);if(_0x5f25fe[_0xa31b('0x2f')][_0xa31b('0x3a')]){_0x57ee17[_0xa31b('0x3b')]=_[_0xa31b('0x3c')](_0x57ee17[_0xa31b('0x3b')],{'$or':_[_0xa31b('0x3d')](_0x55ecbc,function(_0x2f9fba){if(_0x2f9fba['type']!==_0xa31b('0x3e')){var _0x2016bb={};_0x2016bb[_0x2f9fba[_0xa31b('0x28')]]={'$like':'%'+_0x5f25fe['query'][_0xa31b('0x3a')]+'%'};return _0x2016bb;}})});}_0x57ee17=_[_0xa31b('0x3c')]({},_0x57ee17,_0x5f25fe[_0xa31b('0x3f')]);var _0x35fcf5={'where':_0x57ee17[_0xa31b('0x3b')]};return db['DeskConfiguration'][_0xa31b('0x1d')](_0x35fcf5)[_0xa31b('0x24')](function(_0x2b10a6){_0x14ed5f[_0xa31b('0x1d')]=_0x2b10a6;if(_0x5f25fe[_0xa31b('0x2f')][_0xa31b('0x40')]){_0x57ee17[_0xa31b('0x41')]=[{'all':!![]}];}return db[_0xa31b('0x42')][_0xa31b('0x43')](_0x57ee17);})[_0xa31b('0x24')](function(_0x19393a){_0x14ed5f[_0xa31b('0x44')]=_0x19393a;return _0x14ed5f;})['then'](respondWithFilteredResult(_0x356c5f,_0x57ee17))[_0xa31b('0x45')](handleError(_0x356c5f,null));};exports[_0xa31b('0x46')]=function(_0x35cf3a,_0x5a20a6){var _0x4b0da7={'raw':![],'where':{'id':_0x35cf3a[_0xa31b('0x47')]['id']}},_0x5b881c={};_0x5b881c[_0xa31b('0x2e')]=_[_0xa31b('0x30')](db[_0xa31b('0x42')][_0xa31b('0x48')]);_0x5b881c[_0xa31b('0x2f')]=_[_0xa31b('0x30')](_0x35cf3a[_0xa31b('0x2f')]);_0x5b881c[_0xa31b('0x31')]=_[_0xa31b('0x32')](_0x5b881c[_0xa31b('0x2e')],_0x5b881c[_0xa31b('0x2f')]);_0x4b0da7[_0xa31b('0x34')]=_['intersection'](_0x5b881c[_0xa31b('0x2e')],qs['fields'](_0x35cf3a[_0xa31b('0x2f')]['fields']));_0x4b0da7[_0xa31b('0x34')]=_0x4b0da7[_0xa31b('0x34')][_0xa31b('0x35')]?_0x4b0da7[_0xa31b('0x34')]:_0x5b881c[_0xa31b('0x2e')];if(_0x35cf3a[_0xa31b('0x2f')][_0xa31b('0x40')]){_0x4b0da7[_0xa31b('0x41')]=[{'all':!![]}];}_0x4b0da7=_['merge']({},_0x4b0da7,_0x35cf3a[_0xa31b('0x3f')]);return db['DeskConfiguration'][_0xa31b('0x49')](_0x4b0da7)[_0xa31b('0x24')](handleEntityNotFound(_0x5a20a6,null))[_0xa31b('0x24')](respondWithResult(_0x5a20a6,null))[_0xa31b('0x45')](handleError(_0x5a20a6,null));};exports[_0xa31b('0x4a')]=function(_0x55d1a5,_0x585147){return db[_0xa31b('0x42')]['create'](_0x55d1a5[_0xa31b('0x4b')],{})[_0xa31b('0x24')](respondWithResult(_0x585147,0xc9))['catch'](handleError(_0x585147,null));};exports['update']=function(_0x4d31ed,_0x6d9591){if(_0x4d31ed[_0xa31b('0x4b')]['id']){delete _0x4d31ed['body']['id'];}return db['DeskConfiguration'][_0xa31b('0x49')]({'where':{'id':_0x4d31ed[_0xa31b('0x47')]['id']}})['then'](handleEntityNotFound(_0x6d9591,null))['then'](saveUpdates(_0x4d31ed[_0xa31b('0x4b')],null))[_0xa31b('0x24')](respondWithResult(_0x6d9591,null))[_0xa31b('0x45')](handleError(_0x6d9591,null));};exports['destroy']=function(_0x1688f0,_0x1e8d90){return db[_0xa31b('0x42')][_0xa31b('0x49')]({'where':{'id':_0x1688f0[_0xa31b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e8d90,null))[_0xa31b('0x24')](removeEntity(_0x1e8d90,null))[_0xa31b('0x45')](handleError(_0x1e8d90,null));};exports[_0xa31b('0x4c')]=function(_0xda1a01,_0x5bc97d,_0x1b54f8){var _0x6d726b={};var _0x1161c7={};var _0x16b235;var _0x181fa5;return db[_0xa31b('0x42')][_0xa31b('0x4d')]({'where':{'id':_0xda1a01[_0xa31b('0x47')]['id']}})[_0xa31b('0x24')](handleEntityNotFound(_0x5bc97d,null))[_0xa31b('0x24')](function(_0x39adda){if(_0x39adda){_0x16b235=_0x39adda;_0x1161c7[_0xa31b('0x2e')]=_[_0xa31b('0x30')](db[_0xa31b('0x4e')][_0xa31b('0x48')]);_0x1161c7[_0xa31b('0x2f')]=_[_0xa31b('0x30')](_0xda1a01[_0xa31b('0x2f')]);_0x1161c7[_0xa31b('0x31')]=_[_0xa31b('0x32')](_0x1161c7[_0xa31b('0x2e')],_0x1161c7['query']);_0x6d726b[_0xa31b('0x34')]=_[_0xa31b('0x32')](_0x1161c7[_0xa31b('0x2e')],qs['fields'](_0xda1a01[_0xa31b('0x2f')][_0xa31b('0x33')]));_0x6d726b['attributes']=_0x6d726b[_0xa31b('0x34')][_0xa31b('0x35')]?_0x6d726b['attributes']:_0x1161c7['model'];_0x6d726b[_0xa31b('0x38')]=qs[_0xa31b('0x4f')](_0xda1a01[_0xa31b('0x2f')]['sort']);_0x6d726b[_0xa31b('0x3b')]=qs[_0xa31b('0x31')](_[_0xa31b('0x39')](_0xda1a01[_0xa31b('0x2f')],_0x1161c7[_0xa31b('0x31')]));if(_0xda1a01[_0xa31b('0x2f')]['filter']){_0x6d726b[_0xa31b('0x3b')]=_[_0xa31b('0x3c')](_0x6d726b[_0xa31b('0x3b')],{'$or':_[_0xa31b('0x3d')](_0x6d726b[_0xa31b('0x34')],function(_0x5ca736){var _0x210a55={};_0x210a55[_0x5ca736]={'$like':'%'+_0xda1a01['query'][_0xa31b('0x3a')]+'%'};return _0x210a55;})});}_0x6d726b=_['merge']({},_0x6d726b,_0xda1a01['options']);return _0x16b235[_0xa31b('0x4c')](_0x6d726b);}})['then'](function(_0x24cb5a){if(_0x24cb5a){_0x181fa5=_0x24cb5a[_0xa31b('0x35')];if(!_0xda1a01[_0xa31b('0x2f')]['hasOwnProperty'](_0xa31b('0x37'))){_0x6d726b[_0xa31b('0x1c')]=qs[_0xa31b('0x1c')](_0xda1a01['query'][_0xa31b('0x1c')]);_0x6d726b['offset']=qs[_0xa31b('0x1e')](_0xda1a01[_0xa31b('0x2f')][_0xa31b('0x1e')]);}return _0x16b235[_0xa31b('0x4c')](_0x6d726b);}})[_0xa31b('0x24')](function(_0x16b230){if(_0x16b230){return _0x16b230?{'count':_0x181fa5,'rows':_0x16b230}:null;}})[_0xa31b('0x24')](respondWithResult(_0x5bc97d,null))[_0xa31b('0x45')](handleError(_0x5bc97d,null));};exports[_0xa31b('0x50')]=function(_0x4ebee6,_0x8b1160,_0x1703d3){var _0xac8c83={};var _0x110e5e={};var _0x531034;var _0x112baa;return db[_0xa31b('0x42')][_0xa31b('0x4d')]({'where':{'id':_0x4ebee6[_0xa31b('0x47')]['id']}})[_0xa31b('0x24')](handleEntityNotFound(_0x8b1160,null))[_0xa31b('0x24')](function(_0x4491f8){if(_0x4491f8){_0x531034=_0x4491f8;_0x110e5e['model']=_['keys'](db['DeskField'][_0xa31b('0x48')]);_0x110e5e[_0xa31b('0x2f')]=_['keys'](_0x4ebee6[_0xa31b('0x2f')]);_0x110e5e['filters']=_[_0xa31b('0x32')](_0x110e5e['model'],_0x110e5e[_0xa31b('0x2f')]);_0xac8c83[_0xa31b('0x34')]=_[_0xa31b('0x32')](_0x110e5e[_0xa31b('0x2e')],qs[_0xa31b('0x33')](_0x4ebee6[_0xa31b('0x2f')]['fields']));_0xac8c83['attributes']=_0xac8c83[_0xa31b('0x34')]['length']?_0xac8c83['attributes']:_0x110e5e[_0xa31b('0x2e')];_0xac8c83['order']=qs[_0xa31b('0x4f')](_0x4ebee6[_0xa31b('0x2f')][_0xa31b('0x4f')]);_0xac8c83['where']=qs['filters'](_[_0xa31b('0x39')](_0x4ebee6['query'],_0x110e5e[_0xa31b('0x31')]));if(_0x4ebee6[_0xa31b('0x2f')][_0xa31b('0x3a')]){_0xac8c83['where']=_[_0xa31b('0x3c')](_0xac8c83[_0xa31b('0x3b')],{'$or':_['map'](_0xac8c83[_0xa31b('0x34')],function(_0x3f4f8d){var _0x59a4fc={};_0x59a4fc[_0x3f4f8d]={'$like':'%'+_0x4ebee6['query']['filter']+'%'};return _0x59a4fc;})});}_0xac8c83=_['merge']({},_0xac8c83,_0x4ebee6[_0xa31b('0x3f')]);return _0x531034['getSubjects'](_0xac8c83);}})[_0xa31b('0x24')](function(_0xdf8e3f){if(_0xdf8e3f){_0x112baa=_0xdf8e3f['length'];if(!_0x4ebee6[_0xa31b('0x2f')][_0xa31b('0x36')](_0xa31b('0x37'))){_0xac8c83['limit']=qs[_0xa31b('0x1c')](_0x4ebee6[_0xa31b('0x2f')][_0xa31b('0x1c')]);_0xac8c83[_0xa31b('0x1e')]=qs[_0xa31b('0x1e')](_0x4ebee6[_0xa31b('0x2f')][_0xa31b('0x1e')]);}return _0x531034[_0xa31b('0x50')](_0xac8c83);}})[_0xa31b('0x24')](function(_0x320b0a){if(_0x320b0a){return _0x320b0a?{'count':_0x112baa,'rows':_0x320b0a}:null;}})['then'](respondWithResult(_0x8b1160,null))['catch'](handleError(_0x8b1160,null));};exports['getDescriptions']=function(_0x1ac62c,_0x3c7ace,_0x5f03ef){var _0x29db98={};var _0x4cdcd2={};var _0x4dd5e9;var _0x15a361;return db[_0xa31b('0x42')]['findOne']({'where':{'id':_0x1ac62c['params']['id']}})[_0xa31b('0x24')](handleEntityNotFound(_0x3c7ace,null))[_0xa31b('0x24')](function(_0xef88dc){if(_0xef88dc){_0x4dd5e9=_0xef88dc;_0x4cdcd2[_0xa31b('0x2e')]=_['keys'](db[_0xa31b('0x4e')][_0xa31b('0x48')]);_0x4cdcd2[_0xa31b('0x2f')]=_[_0xa31b('0x30')](_0x1ac62c[_0xa31b('0x2f')]);_0x4cdcd2[_0xa31b('0x31')]=_[_0xa31b('0x32')](_0x4cdcd2['model'],_0x4cdcd2[_0xa31b('0x2f')]);_0x29db98[_0xa31b('0x34')]=_[_0xa31b('0x32')](_0x4cdcd2['model'],qs['fields'](_0x1ac62c[_0xa31b('0x2f')][_0xa31b('0x33')]));_0x29db98[_0xa31b('0x34')]=_0x29db98[_0xa31b('0x34')][_0xa31b('0x35')]?_0x29db98[_0xa31b('0x34')]:_0x4cdcd2[_0xa31b('0x2e')];_0x29db98[_0xa31b('0x38')]=qs['sort'](_0x1ac62c[_0xa31b('0x2f')]['sort']);_0x29db98[_0xa31b('0x3b')]=qs[_0xa31b('0x31')](_['pick'](_0x1ac62c[_0xa31b('0x2f')],_0x4cdcd2[_0xa31b('0x31')]));if(_0x1ac62c[_0xa31b('0x2f')][_0xa31b('0x3a')]){_0x29db98[_0xa31b('0x3b')]=_[_0xa31b('0x3c')](_0x29db98[_0xa31b('0x3b')],{'$or':_[_0xa31b('0x3d')](_0x29db98[_0xa31b('0x34')],function(_0x675804){var _0x5c3880={};_0x5c3880[_0x675804]={'$like':'%'+_0x1ac62c[_0xa31b('0x2f')][_0xa31b('0x3a')]+'%'};return _0x5c3880;})});}_0x29db98=_['merge']({},_0x29db98,_0x1ac62c['options']);return _0x4dd5e9['getDescriptions'](_0x29db98);}})['then'](function(_0x4d1bdb){if(_0x4d1bdb){_0x15a361=_0x4d1bdb[_0xa31b('0x35')];if(!_0x1ac62c['query'][_0xa31b('0x36')]('nolimit')){_0x29db98[_0xa31b('0x1c')]=qs[_0xa31b('0x1c')](_0x1ac62c[_0xa31b('0x2f')]['limit']);_0x29db98['offset']=qs[_0xa31b('0x1e')](_0x1ac62c[_0xa31b('0x2f')]['offset']);}return _0x4dd5e9[_0xa31b('0x51')](_0x29db98);}})['then'](function(_0x5556ef){if(_0x5556ef){return _0x5556ef?{'count':_0x15a361,'rows':_0x5556ef}:null;}})['then'](respondWithResult(_0x3c7ace,null))[_0xa31b('0x45')](handleError(_0x3c7ace,null));};exports['getTags']=function(_0x852abf,_0x506112,_0x4cd9fc){var _0x302313={};var _0x2e5ff2={};var _0x1e8026;var _0x12ce92;return db[_0xa31b('0x42')][_0xa31b('0x4d')]({'where':{'id':_0x852abf['params']['id']}})[_0xa31b('0x24')](handleEntityNotFound(_0x506112,null))['then'](function(_0x118e7a){if(_0x118e7a){_0x1e8026=_0x118e7a;_0x2e5ff2[_0xa31b('0x2e')]=_[_0xa31b('0x30')](db[_0xa31b('0x52')]['rawAttributes']);_0x2e5ff2[_0xa31b('0x2f')]=_['keys'](_0x852abf[_0xa31b('0x2f')]);_0x2e5ff2[_0xa31b('0x31')]=_[_0xa31b('0x32')](_0x2e5ff2[_0xa31b('0x2e')],_0x2e5ff2[_0xa31b('0x2f')]);_0x302313[_0xa31b('0x34')]=_[_0xa31b('0x32')](_0x2e5ff2['model'],qs['fields'](_0x852abf[_0xa31b('0x2f')][_0xa31b('0x33')]));_0x302313[_0xa31b('0x34')]=_0x302313[_0xa31b('0x34')]['length']?_0x302313['attributes']:_0x2e5ff2['model'];_0x302313[_0xa31b('0x38')]=qs['sort'](_0x852abf[_0xa31b('0x2f')]['sort']);_0x302313[_0xa31b('0x3b')]=qs[_0xa31b('0x31')](_[_0xa31b('0x39')](_0x852abf['query'],_0x2e5ff2[_0xa31b('0x31')]));if(_0x852abf[_0xa31b('0x2f')]['filter']){_0x302313[_0xa31b('0x3b')]=_[_0xa31b('0x3c')](_0x302313[_0xa31b('0x3b')],{'$or':_[_0xa31b('0x3d')](_0x302313[_0xa31b('0x34')],function(_0x4d7440){var _0x4f435e={};_0x4f435e[_0x4d7440]={'$like':'%'+_0x852abf['query']['filter']+'%'};return _0x4f435e;})});}_0x302313=_[_0xa31b('0x3c')]({},_0x302313,_0x852abf[_0xa31b('0x3f')]);return _0x1e8026[_0xa31b('0x53')](_0x302313);}})[_0xa31b('0x24')](function(_0xc7b39d){if(_0xc7b39d){_0x12ce92=_0xc7b39d[_0xa31b('0x35')];if(!_0x852abf[_0xa31b('0x2f')][_0xa31b('0x36')](_0xa31b('0x37'))){_0x302313['limit']=qs['limit'](_0x852abf[_0xa31b('0x2f')][_0xa31b('0x1c')]);_0x302313['offset']=qs[_0xa31b('0x1e')](_0x852abf[_0xa31b('0x2f')]['offset']);}return _0x1e8026['getTags'](_0x302313);}})['then'](function(_0x67491f){if(_0x67491f){return _0x67491f?{'count':_0x12ce92,'rows':_0x67491f}:null;}})['then'](respondWithResult(_0x506112,null))[_0xa31b('0x45')](handleError(_0x506112,null));};exports[_0xa31b('0x54')]=function(_0x1e1ec8,_0x127274,_0x4209b8){if(_0x1e1ec8['body']['id']){delete _0x1e1ec8['body']['id'];}return db[_0xa31b('0x42')]['findOne']({'where':{'id':_0x1e1ec8[_0xa31b('0x47')]['id']}})[_0xa31b('0x24')](handleEntityNotFound(_0x127274,null))[_0xa31b('0x24')](function(_0x317924){if(_0x317924){return _0x317924[_0xa31b('0x54')](_0x1e1ec8['body'][_0xa31b('0x55')]||[]);}return null;})[_0xa31b('0x24')](respondWithResult(_0x127274,null))[_0xa31b('0x45')](handleError(_0x127274,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5ea16fc..299311a 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 _0x925b=['int_desk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x301ea6,_0x202cf3){var _0x3bd1ae=function(_0xc27c01){while(--_0xc27c01){_0x301ea6['push'](_0x301ea6['shift']());}};_0x3bd1ae(++_0x202cf3);}(_0x925b,0x169));var _0xb925=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0x925b[_0x5f746f];return _0x198d15;};'use strict';var _=require(_0xb925('0x0'));var util=require(_0xb925('0x1'));var logger=require(_0xb925('0x2'))('api');var moment=require(_0xb925('0x3'));var BPromise=require(_0xb925('0x4'));var rp=require(_0xb925('0x5'));var fs=require('fs');var path=require(_0xb925('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb925('0x7'));module[_0xb925('0x8')]=function(_0x15328b,_0x11216e){return _0x15328b[_0xb925('0x9')](_0xb925('0xa'),attributes,{'tableName':_0xb925('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x484f=['../../config/environment','define','util','../../config/logger','path'];(function(_0x2680f8,_0x5c2089){var _0x398eb3=function(_0xe263c1){while(--_0xe263c1){_0x2680f8['push'](_0x2680f8['shift']());}};_0x398eb3(++_0x5c2089);}(_0x484f,0x115));var _0xf484=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x484f[_0x368e09];return _0x14b7df;};'use strict';var _=require('lodash');var util=require(_0xf484('0x0'));var logger=require(_0xf484('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf484('0x2'));var rimraf=require('rimraf');var config=require(_0xf484('0x3'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x39f92e,_0xcdec8a){return _0x39f92e[_0xf484('0x4')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index d72a5d7..09cea40 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 _0x29f4=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2797bd,_0x4a1dc1){var _0x3fd47b=function(_0x4542c0){while(--_0x4542c0){_0x2797bd['push'](_0x2797bd['shift']());}};_0x3fd47b(++_0x4a1dc1);}(_0x29f4,0x1d1));var _0x429f=function(_0x29b2c0,_0x585b05){_0x29b2c0=_0x29b2c0-0x0;var _0x569e08=_0x29f4[_0x29b2c0];return _0x569e08;};'use strict';var _=require(_0x429f('0x0'));var util=require(_0x429f('0x1'));var moment=require(_0x429f('0x2'));var BPromise=require(_0x429f('0x3'));var rs=require(_0x429f('0x4'));var fs=require('fs');var Redis=require(_0x429f('0x5'));var db=require(_0x429f('0x6'))['db'];var utils=require(_0x429f('0x7'));var logger=require(_0x429f('0x8'))(_0x429f('0x9'));var config=require(_0x429f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x429f('0xb')][_0x429f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b5bbc,_0x155c27,_0x4c7fcb){return new BPromise(function(_0x31780f,_0x550aeb){return client[_0x429f('0xd')](_0x3b5bbc,_0x4c7fcb)['then'](function(_0x35bbf6){logger['info'](_0x429f('0xe'),_0x155c27,_0x429f('0xf'));logger['debug'](_0x429f('0x10'),_0x155c27,'request\x20sent',JSON[_0x429f('0x11')](_0x35bbf6));if(_0x35bbf6[_0x429f('0x12')]){if(_0x35bbf6['error']['code']===0x1f4){logger[_0x429f('0x12')](_0x429f('0xe'),_0x155c27,_0x35bbf6[_0x429f('0x12')][_0x429f('0x13')]);return _0x550aeb(_0x35bbf6[_0x429f('0x12')][_0x429f('0x13')]);}logger[_0x429f('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x155c27,_0x35bbf6[_0x429f('0x12')][_0x429f('0x13')]);return _0x31780f(_0x35bbf6['error']['message']);}else{logger[_0x429f('0x14')](_0x429f('0xe'),_0x155c27,_0x429f('0xf'));_0x31780f(_0x35bbf6[_0x429f('0x15')][_0x429f('0x13')]);}})[_0x429f('0x16')](function(_0x39e8dd){logger[_0x429f('0x12')](_0x429f('0xe'),_0x155c27,_0x39e8dd);_0x550aeb(_0x39e8dd);});});} \ No newline at end of file +var _0x8a76=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8a76,0x17e));var _0x68a7=function(_0x17a950,_0x208a55){_0x17a950=_0x17a950-0x0;var _0x446fc1=_0x8a76[_0x17a950];return _0x446fc1;};'use strict';var _=require(_0x68a7('0x0'));var util=require('util');var moment=require(_0x68a7('0x1'));var BPromise=require(_0x68a7('0x2'));var rs=require(_0x68a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x68a7('0x4'));var logger=require(_0x68a7('0x5'))(_0x68a7('0x6'));var config=require(_0x68a7('0x7'));var jayson=require(_0x68a7('0x8'));var client=jayson[_0x68a7('0x9')][_0x68a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc65149,_0x37379b,_0x4d1d75){return new BPromise(function(_0x1712b8,_0x1a5f7f){return client[_0x68a7('0xb')](_0xc65149,_0x4d1d75)[_0x68a7('0xc')](function(_0x2b10b3){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x37379b,_0x68a7('0xd'));logger[_0x68a7('0xe')](_0x68a7('0xf'),_0x37379b,_0x68a7('0xd'),JSON['stringify'](_0x2b10b3));if(_0x2b10b3[_0x68a7('0x10')]){if(_0x2b10b3[_0x68a7('0x10')]['code']===0x1f4){logger[_0x68a7('0x10')](_0x68a7('0x11'),_0x37379b,_0x2b10b3['error'][_0x68a7('0x12')]);return _0x1a5f7f(_0x2b10b3['error']['message']);}logger[_0x68a7('0x10')](_0x68a7('0x11'),_0x37379b,_0x2b10b3['error']['message']);return _0x1712b8(_0x2b10b3[_0x68a7('0x10')]['message']);}else{logger[_0x68a7('0x13')](_0x68a7('0x11'),_0x37379b,_0x68a7('0xd'));_0x1712b8(_0x2b10b3[_0x68a7('0x14')][_0x68a7('0x12')]);}})[_0x68a7('0x15')](function(_0x3aa110){logger[_0x68a7('0x10')](_0x68a7('0x11'),_0x37379b,_0x3aa110);_0x1a5f7f(_0x3aa110);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7a01833..259bd1d 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 _0xb9f7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x587c0f,_0x4e548a){var _0x4931b5=function(_0x960fb4){while(--_0x960fb4){_0x587c0f['push'](_0x587c0f['shift']());}};_0x4931b5(++_0x4e548a);}(_0xb9f7,0x18b));var _0x7b9f=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb9f7[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0x7b9f('0x0'));var util=require(_0x7b9f('0x1'));var path=require(_0x7b9f('0x2'));var timeout=require(_0x7b9f('0x3'));var express=require('express');var router=express[_0x7b9f('0x4')]();var fs_extra=require(_0x7b9f('0x5'));var auth=require(_0x7b9f('0x6'));var interaction=require(_0x7b9f('0x7'));var config=require(_0x7b9f('0x8'));var controller=require(_0x7b9f('0x9'));router['get']('/',auth[_0x7b9f('0xa')](),controller[_0x7b9f('0xb')]);router[_0x7b9f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x7b9f('0xd')]);router[_0x7b9f('0xe')]('/',auth[_0x7b9f('0xa')](),controller[_0x7b9f('0xf')]);router[_0x7b9f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7b9f('0x11')]);router['delete']('/:id',auth[_0x7b9f('0xa')](),controller['destroy']);module[_0x7b9f('0x12')]=router; \ No newline at end of file +var _0x9143=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','index'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9143,0x1a9));var _0x3914=function(_0x4dad8d,_0x11be26){_0x4dad8d=_0x4dad8d-0x0;var _0x6ce071=_0x9143[_0x4dad8d];return _0x6ce071;};'use strict';var multer=require(_0x3914('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3914('0x1'));var router=express['Router']();var fs_extra=require(_0x3914('0x2'));var auth=require(_0x3914('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3914('0x4'));var controller=require(_0x3914('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x3914('0x6')]);router[_0x3914('0x7')](_0x3914('0x8'),auth[_0x3914('0x9')](),controller[_0x3914('0xa')]);router[_0x3914('0xb')]('/',auth[_0x3914('0x9')](),controller[_0x3914('0xc')]);router[_0x3914('0xd')](_0x3914('0x8'),auth[_0x3914('0x9')](),controller[_0x3914('0xe')]);router[_0x3914('0xf')](_0x3914('0x8'),auth[_0x3914('0x9')](),controller[_0x3914('0x10')]);module[_0x3914('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 3c5e6b9..a341141 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 _0x52bc=['STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x288325,_0x26e4ff){var _0x3b9fd7=function(_0x1f2816){while(--_0x1f2816){_0x288325['push'](_0x288325['shift']());}};_0x3b9fd7(++_0x26e4ff);}(_0x52bc,0x122));var _0xc52b=function(_0x22cec8,_0x1eea85){_0x22cec8=_0x22cec8-0x0;var _0x56aeba=_0x52bc[_0x22cec8];return _0x56aeba;};'use strict';var Sequelize=require(_0xc52b('0x0'));module['exports']={'type':{'type':Sequelize[_0xc52b('0x1')]('string',_0xc52b('0x2'),_0xc52b('0x3'),_0xc52b('0x4'),_0xc52b('0x5')),'defaultValue':_0xc52b('0x6')},'content':{'type':Sequelize[_0xc52b('0x7')]},'key':{'type':Sequelize[_0xc52b('0x7')]},'keyType':{'type':Sequelize[_0xc52b('0x1')]('string',_0xc52b('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc52b('0x7')]},'idField':{'type':Sequelize[_0xc52b('0x7')]},'nameField':{'type':Sequelize[_0xc52b('0x7')]},'customField':{'type':Sequelize[_0xc52b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x231a=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0x231a,0x1b9));var _0xa231=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x231a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xa231('0x0')]={'type':{'type':Sequelize[_0xa231('0x1')](_0xa231('0x2'),_0xa231('0x3'),'customVariable',_0xa231('0x4'),_0xa231('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa231('0x6')]},'key':{'type':Sequelize[_0xa231('0x6')]},'keyType':{'type':Sequelize[_0xa231('0x1')](_0xa231('0x2'),'variable',_0xa231('0x7'))},'keyContent':{'type':Sequelize[_0xa231('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa231('0x6')]},'customField':{'type':Sequelize[_0xa231('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index a95c327..76c7f5b 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 _0x2a8b=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','keys','query','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','include','findAll','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','sox'];(function(_0x3c3195,_0x595377){var _0x2ee24e=function(_0x1e9457){while(--_0x1e9457){_0x3c3195['push'](_0x3c3195['shift']());}};_0x2ee24e(++_0x595377);}(_0x2a8b,0x10a));var _0xb2a8=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x2a8b[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require(_0xb2a8('0x0'));var rimraf=require(_0xb2a8('0x1'));var zipdir=require(_0xb2a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2a8('0x3'));var moment=require(_0xb2a8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb2a8('0x5'));var csv=require('to-csv');var ejs=require(_0xb2a8('0x6'));var fs=require('fs');var fs_extra=require(_0xb2a8('0x7'));var _=require(_0xb2a8('0x8'));var squel=require(_0xb2a8('0x9'));var crypto=require(_0xb2a8('0xa'));var jsforce=require(_0xb2a8('0xb'));var deskjs=require(_0xb2a8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb2a8('0xd'));var Papa=require('papaparse');var Redis=require(_0xb2a8('0xe'));var authService=require(_0xb2a8('0xf'));var qs=require(_0xb2a8('0x10'));var as=require(_0xb2a8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2a8('0x12'))(_0xb2a8('0x13'));var utils=require(_0xb2a8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb2a8('0x15'));var db=require(_0xb2a8('0x16'))['db'];function respondWithStatusCode(_0x48f264,_0x40141e){_0x40141e=_0x40141e||0xcc;return function(_0x2de735){if(_0x2de735){return _0x48f264[_0xb2a8('0x17')](_0x40141e);}return _0x48f264[_0xb2a8('0x18')](_0x40141e)[_0xb2a8('0x19')]();};}function respondWithResult(_0x3f38c5,_0x367ce7){_0x367ce7=_0x367ce7||0xc8;return function(_0x235950){if(_0x235950){return _0x3f38c5[_0xb2a8('0x18')](_0x367ce7)['json'](_0x235950);}};}function respondWithFilteredResult(_0x217188,_0x3837c3){return function(_0x45c19d){if(_0x45c19d){var _0xc05b9e=typeof _0x3837c3['offset']===_0xb2a8('0x1a')&&typeof _0x3837c3[_0xb2a8('0x1b')]===_0xb2a8('0x1a');var _0x110037=_0x45c19d['count'];var _0x2c80da=_0xc05b9e?0x0:_0x3837c3[_0xb2a8('0x1c')];var _0x38a3f5=_0xc05b9e?_0x45c19d[_0xb2a8('0x1d')]:_0x3837c3[_0xb2a8('0x1c')]+_0x3837c3[_0xb2a8('0x1b')];var _0x2bb137;if(_0x38a3f5>=_0x110037){_0x38a3f5=_0x110037;_0x2bb137=0xc8;}else{_0x2bb137=0xce;}_0x217188[_0xb2a8('0x18')](_0x2bb137);return _0x217188[_0xb2a8('0x1e')](_0xb2a8('0x1f'),_0x2c80da+'-'+_0x38a3f5+'/'+_0x110037)['json'](_0x45c19d);}return null;};}function patchUpdates(_0x159c10){return function(_0x248dc0){try{jsonpatch[_0xb2a8('0x20')](_0x248dc0,_0x159c10,!![]);}catch(_0x59d801){return BPromise[_0xb2a8('0x21')](_0x59d801);}return _0x248dc0['save']();};}function saveUpdates(_0x332679,_0x130e27){return function(_0x450e16){if(_0x450e16){return _0x450e16[_0xb2a8('0x22')](_0x332679)[_0xb2a8('0x23')](function(_0x530624){return _0x530624;});}return null;};}function removeEntity(_0x65a1d2,_0x379753){return function(_0x29c446){if(_0x29c446){return _0x29c446['destroy']()[_0xb2a8('0x23')](function(){_0x65a1d2[_0xb2a8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339582,_0x28add4){return function(_0x5f08b7){if(!_0x5f08b7){_0x339582[_0xb2a8('0x17')](0x194);}return _0x5f08b7;};}function handleError(_0x5f09ee,_0x251151){_0x251151=_0x251151||0x1f4;return function(_0x2906b5){logger['error'](_0x2906b5[_0xb2a8('0x24')]);if(_0x2906b5[_0xb2a8('0x25')]){delete _0x2906b5['name'];}_0x5f09ee['status'](_0x251151)[_0xb2a8('0x26')](_0x2906b5);};}exports[_0xb2a8('0x27')]=function(_0x567be7,_0x10b336){var _0x3d8e67={},_0x133619={},_0x10ac5e={'count':0x0,'rows':[]};var _0x1998a3=_[_0xb2a8('0x28')](db[_0xb2a8('0x29')][_0xb2a8('0x2a')],function(_0x5f0deb){return{'name':_0x5f0deb[_0xb2a8('0x2b')],'type':_0x5f0deb[_0xb2a8('0x2c')][_0xb2a8('0x2d')]};});_0x133619[_0xb2a8('0x2e')]=_[_0xb2a8('0x28')](_0x1998a3,_0xb2a8('0x25'));_0x133619['query']=_[_0xb2a8('0x2f')](_0x567be7[_0xb2a8('0x30')]);_0x133619['filters']=_['intersection'](_0x133619['model'],_0x133619[_0xb2a8('0x30')]);_0x3d8e67['attributes']=_['intersection'](_0x133619['model'],qs['fields'](_0x567be7[_0xb2a8('0x30')][_0xb2a8('0x31')]));_0x3d8e67[_0xb2a8('0x32')]=_0x3d8e67[_0xb2a8('0x32')][_0xb2a8('0x33')]?_0x3d8e67['attributes']:_0x133619[_0xb2a8('0x2e')];if(!_0x567be7[_0xb2a8('0x30')][_0xb2a8('0x34')]('nolimit')){_0x3d8e67[_0xb2a8('0x1b')]=qs['limit'](_0x567be7['query'][_0xb2a8('0x1b')]);_0x3d8e67[_0xb2a8('0x1c')]=qs[_0xb2a8('0x1c')](_0x567be7[_0xb2a8('0x30')][_0xb2a8('0x1c')]);}_0x3d8e67['order']=qs[_0xb2a8('0x35')](_0x567be7[_0xb2a8('0x30')]['sort']);_0x3d8e67[_0xb2a8('0x36')]=qs[_0xb2a8('0x37')](_[_0xb2a8('0x38')](_0x567be7[_0xb2a8('0x30')],_0x133619[_0xb2a8('0x37')]),_0x1998a3);if(_0x567be7[_0xb2a8('0x30')]['filter']){_0x3d8e67[_0xb2a8('0x36')]=_[_0xb2a8('0x39')](_0x3d8e67[_0xb2a8('0x36')],{'$or':_[_0xb2a8('0x28')](_0x1998a3,function(_0x49a695){if(_0x49a695[_0xb2a8('0x2c')]!==_0xb2a8('0x3a')){var _0x1841ae={};_0x1841ae[_0x49a695[_0xb2a8('0x25')]]={'$like':'%'+_0x567be7['query']['filter']+'%'};return _0x1841ae;}})});}_0x3d8e67=_[_0xb2a8('0x39')]({},_0x3d8e67,_0x567be7[_0xb2a8('0x3b')]);var _0x25ffad={'where':_0x3d8e67['where']};return db[_0xb2a8('0x29')][_0xb2a8('0x1d')](_0x25ffad)['then'](function(_0x3629df){_0x10ac5e[_0xb2a8('0x1d')]=_0x3629df;if(_0x567be7['query']['includeAll']){_0x3d8e67[_0xb2a8('0x3c')]=[{'all':!![]}];}return db[_0xb2a8('0x29')][_0xb2a8('0x3d')](_0x3d8e67);})[_0xb2a8('0x23')](function(_0x17e0d6){_0x10ac5e['rows']=_0x17e0d6;return _0x10ac5e;})[_0xb2a8('0x23')](respondWithFilteredResult(_0x10b336,_0x3d8e67))['catch'](handleError(_0x10b336,null));};exports[_0xb2a8('0x3e')]=function(_0x39f745,_0x137f9a){var _0x1f1004={'raw':!![],'where':{'id':_0x39f745[_0xb2a8('0x3f')]['id']}},_0x5d2679={};_0x5d2679[_0xb2a8('0x2e')]=_[_0xb2a8('0x2f')](db['DeskField'][_0xb2a8('0x2a')]);_0x5d2679[_0xb2a8('0x30')]=_[_0xb2a8('0x2f')](_0x39f745[_0xb2a8('0x30')]);_0x5d2679['filters']=_['intersection'](_0x5d2679[_0xb2a8('0x2e')],_0x5d2679[_0xb2a8('0x30')]);_0x1f1004[_0xb2a8('0x32')]=_['intersection'](_0x5d2679[_0xb2a8('0x2e')],qs[_0xb2a8('0x31')](_0x39f745[_0xb2a8('0x30')][_0xb2a8('0x31')]));_0x1f1004[_0xb2a8('0x32')]=_0x1f1004[_0xb2a8('0x32')]['length']?_0x1f1004[_0xb2a8('0x32')]:_0x5d2679[_0xb2a8('0x2e')];if(_0x39f745['query']['includeAll']){_0x1f1004[_0xb2a8('0x3c')]=[{'all':!![]}];}_0x1f1004=_[_0xb2a8('0x39')]({},_0x1f1004,_0x39f745['options']);return db[_0xb2a8('0x29')][_0xb2a8('0x40')](_0x1f1004)[_0xb2a8('0x23')](handleEntityNotFound(_0x137f9a,null))['then'](respondWithResult(_0x137f9a,null))[_0xb2a8('0x41')](handleError(_0x137f9a,null));};exports['create']=function(_0x200709,_0x3b9574){return db['DeskField'][_0xb2a8('0x42')](_0x200709[_0xb2a8('0x43')],{})[_0xb2a8('0x23')](respondWithResult(_0x3b9574,0xc9))['catch'](handleError(_0x3b9574,null));};exports['update']=function(_0x6a57e5,_0x598b6e){if(_0x6a57e5[_0xb2a8('0x43')]['id']){delete _0x6a57e5[_0xb2a8('0x43')]['id'];}return db['DeskField'][_0xb2a8('0x40')]({'where':{'id':_0x6a57e5[_0xb2a8('0x3f')]['id']}})[_0xb2a8('0x23')](handleEntityNotFound(_0x598b6e,null))[_0xb2a8('0x23')](saveUpdates(_0x6a57e5[_0xb2a8('0x43')],null))[_0xb2a8('0x23')](respondWithResult(_0x598b6e,null))[_0xb2a8('0x41')](handleError(_0x598b6e,null));};exports['destroy']=function(_0x19cc9f,_0xddc0e4){return db[_0xb2a8('0x29')][_0xb2a8('0x40')]({'where':{'id':_0x19cc9f[_0xb2a8('0x3f')]['id']}})[_0xb2a8('0x23')](handleEntityNotFound(_0xddc0e4,null))[_0xb2a8('0x23')](removeEntity(_0xddc0e4,null))[_0xb2a8('0x41')](handleError(_0xddc0e4,null));}; \ No newline at end of file +var _0x196b=['includeAll','include','rows','params','keys','find','catch','create','update','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','reject','save','sendStatus','stack','send','index','map','DeskField','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','then'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x196b,0x9d));var _0xb196=function(_0x37eb6c,_0x19956e){_0x37eb6c=_0x37eb6c-0x0;var _0x6353f8=_0x196b[_0x37eb6c];return _0x6353f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb196('0x0'));var jsonpatch=require(_0xb196('0x1'));var rp=require(_0xb196('0x2'));var moment=require(_0xb196('0x3'));var BPromise=require(_0xb196('0x4'));var Mustache=require(_0xb196('0x5'));var util=require(_0xb196('0x6'));var path=require(_0xb196('0x7'));var sox=require(_0xb196('0x8'));var csv=require('to-csv');var ejs=require(_0xb196('0x9'));var fs=require('fs');var fs_extra=require(_0xb196('0xa'));var _=require(_0xb196('0xb'));var squel=require(_0xb196('0xc'));var crypto=require('crypto');var jsforce=require(_0xb196('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb196('0xe'));var querystring=require(_0xb196('0xf'));var Papa=require(_0xb196('0x10'));var Redis=require(_0xb196('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb196('0x12'));var as=require(_0xb196('0x13'));var hardwareService=require(_0xb196('0x14'));var logger=require(_0xb196('0x15'))('api');var utils=require(_0xb196('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb196('0x17'));var db=require(_0xb196('0x18'))['db'];function respondWithStatusCode(_0x292915,_0x3deb0f){_0x3deb0f=_0x3deb0f||0xcc;return function(_0x30dd59){if(_0x30dd59){return _0x292915['sendStatus'](_0x3deb0f);}return _0x292915[_0xb196('0x19')](_0x3deb0f)[_0xb196('0x1a')]();};}function respondWithResult(_0x1473f3,_0x44b7fa){_0x44b7fa=_0x44b7fa||0xc8;return function(_0x184886){if(_0x184886){return _0x1473f3[_0xb196('0x19')](_0x44b7fa)[_0xb196('0x1b')](_0x184886);}};}function respondWithFilteredResult(_0x24b266,_0x5d059f){return function(_0x3e8cb1){if(_0x3e8cb1){var _0x411dc0=typeof _0x5d059f[_0xb196('0x1c')]===_0xb196('0x1d')&&typeof _0x5d059f['limit']===_0xb196('0x1d');var _0x32402f=_0x3e8cb1['count'];var _0x2a85c4=_0x411dc0?0x0:_0x5d059f[_0xb196('0x1c')];var _0x3f8adf=_0x411dc0?_0x3e8cb1[_0xb196('0x1e')]:_0x5d059f[_0xb196('0x1c')]+_0x5d059f['limit'];var _0x28d593;if(_0x3f8adf>=_0x32402f){_0x3f8adf=_0x32402f;_0x28d593=0xc8;}else{_0x28d593=0xce;}_0x24b266[_0xb196('0x19')](_0x28d593);return _0x24b266['set'](_0xb196('0x1f'),_0x2a85c4+'-'+_0x3f8adf+'/'+_0x32402f)[_0xb196('0x1b')](_0x3e8cb1);}return null;};}function patchUpdates(_0x2d0519){return function(_0x3f3ac2){try{jsonpatch['apply'](_0x3f3ac2,_0x2d0519,!![]);}catch(_0x5ba94d){return BPromise[_0xb196('0x20')](_0x5ba94d);}return _0x3f3ac2[_0xb196('0x21')]();};}function saveUpdates(_0x3d3f69,_0x290296){return function(_0x3839f0){if(_0x3839f0){return _0x3839f0['update'](_0x3d3f69)['then'](function(_0x585176){return _0x585176;});}return null;};}function removeEntity(_0x4deb2b,_0x342745){return function(_0x349c5e){if(_0x349c5e){return _0x349c5e['destroy']()['then'](function(){_0x4deb2b['status'](0xcc)[_0xb196('0x1a')]();});}};}function handleEntityNotFound(_0x8209ac,_0x2b9e84){return function(_0x925535){if(!_0x925535){_0x8209ac[_0xb196('0x22')](0x194);}return _0x925535;};}function handleError(_0x855ae2,_0x3b902f){_0x3b902f=_0x3b902f||0x1f4;return function(_0x1e2140){logger['error'](_0x1e2140[_0xb196('0x23')]);if(_0x1e2140['name']){delete _0x1e2140['name'];}_0x855ae2['status'](_0x3b902f)[_0xb196('0x24')](_0x1e2140);};}exports[_0xb196('0x25')]=function(_0x16dd6d,_0x3cf946){var _0x1a0049={},_0x50de49={},_0x205e5f={'count':0x0,'rows':[]};var _0x34a1ab=_[_0xb196('0x26')](db[_0xb196('0x27')][_0xb196('0x28')],function(_0x1988af){return{'name':_0x1988af['fieldName'],'type':_0x1988af[_0xb196('0x29')][_0xb196('0x2a')]};});_0x50de49[_0xb196('0x2b')]=_[_0xb196('0x26')](_0x34a1ab,_0xb196('0x2c'));_0x50de49[_0xb196('0x2d')]=_['keys'](_0x16dd6d[_0xb196('0x2d')]);_0x50de49[_0xb196('0x2e')]=_[_0xb196('0x2f')](_0x50de49[_0xb196('0x2b')],_0x50de49[_0xb196('0x2d')]);_0x1a0049[_0xb196('0x30')]=_[_0xb196('0x2f')](_0x50de49['model'],qs['fields'](_0x16dd6d[_0xb196('0x2d')][_0xb196('0x31')]));_0x1a0049[_0xb196('0x30')]=_0x1a0049[_0xb196('0x30')][_0xb196('0x32')]?_0x1a0049[_0xb196('0x30')]:_0x50de49['model'];if(!_0x16dd6d[_0xb196('0x2d')][_0xb196('0x33')](_0xb196('0x34'))){_0x1a0049['limit']=qs[_0xb196('0x35')](_0x16dd6d['query'][_0xb196('0x35')]);_0x1a0049[_0xb196('0x1c')]=qs[_0xb196('0x1c')](_0x16dd6d[_0xb196('0x2d')][_0xb196('0x1c')]);}_0x1a0049[_0xb196('0x36')]=qs['sort'](_0x16dd6d[_0xb196('0x2d')][_0xb196('0x37')]);_0x1a0049[_0xb196('0x38')]=qs['filters'](_['pick'](_0x16dd6d[_0xb196('0x2d')],_0x50de49['filters']),_0x34a1ab);if(_0x16dd6d[_0xb196('0x2d')][_0xb196('0x39')]){_0x1a0049[_0xb196('0x38')]=_[_0xb196('0x3a')](_0x1a0049[_0xb196('0x38')],{'$or':_['map'](_0x34a1ab,function(_0x148a99){if(_0x148a99[_0xb196('0x29')]!==_0xb196('0x3b')){var _0x38748d={};_0x38748d[_0x148a99['name']]={'$like':'%'+_0x16dd6d[_0xb196('0x2d')][_0xb196('0x39')]+'%'};return _0x38748d;}})});}_0x1a0049=_[_0xb196('0x3a')]({},_0x1a0049,_0x16dd6d[_0xb196('0x3c')]);var _0x42c8a4={'where':_0x1a0049[_0xb196('0x38')]};return db['DeskField'][_0xb196('0x1e')](_0x42c8a4)[_0xb196('0x3d')](function(_0x33a6c4){_0x205e5f[_0xb196('0x1e')]=_0x33a6c4;if(_0x16dd6d['query'][_0xb196('0x3e')]){_0x1a0049[_0xb196('0x3f')]=[{'all':!![]}];}return db[_0xb196('0x27')]['findAll'](_0x1a0049);})['then'](function(_0x390f7d){_0x205e5f[_0xb196('0x40')]=_0x390f7d;return _0x205e5f;})[_0xb196('0x3d')](respondWithFilteredResult(_0x3cf946,_0x1a0049))['catch'](handleError(_0x3cf946,null));};exports['show']=function(_0x357d9a,_0x1eb1f1){var _0x41f9ec={'raw':!![],'where':{'id':_0x357d9a[_0xb196('0x41')]['id']}},_0x12a460={};_0x12a460[_0xb196('0x2b')]=_[_0xb196('0x42')](db['DeskField'][_0xb196('0x28')]);_0x12a460[_0xb196('0x2d')]=_[_0xb196('0x42')](_0x357d9a[_0xb196('0x2d')]);_0x12a460[_0xb196('0x2e')]=_[_0xb196('0x2f')](_0x12a460[_0xb196('0x2b')],_0x12a460['query']);_0x41f9ec[_0xb196('0x30')]=_['intersection'](_0x12a460[_0xb196('0x2b')],qs[_0xb196('0x31')](_0x357d9a[_0xb196('0x2d')][_0xb196('0x31')]));_0x41f9ec[_0xb196('0x30')]=_0x41f9ec['attributes'][_0xb196('0x32')]?_0x41f9ec['attributes']:_0x12a460['model'];if(_0x357d9a[_0xb196('0x2d')][_0xb196('0x3e')]){_0x41f9ec[_0xb196('0x3f')]=[{'all':!![]}];}_0x41f9ec=_[_0xb196('0x3a')]({},_0x41f9ec,_0x357d9a[_0xb196('0x3c')]);return db[_0xb196('0x27')][_0xb196('0x43')](_0x41f9ec)[_0xb196('0x3d')](handleEntityNotFound(_0x1eb1f1,null))['then'](respondWithResult(_0x1eb1f1,null))[_0xb196('0x44')](handleError(_0x1eb1f1,null));};exports[_0xb196('0x45')]=function(_0x53d826,_0x312212){return db[_0xb196('0x27')][_0xb196('0x45')](_0x53d826['body'],{})[_0xb196('0x3d')](respondWithResult(_0x312212,0xc9))[_0xb196('0x44')](handleError(_0x312212,null));};exports[_0xb196('0x46')]=function(_0x5f2be5,_0x56d4a8){if(_0x5f2be5[_0xb196('0x47')]['id']){delete _0x5f2be5[_0xb196('0x47')]['id'];}return db[_0xb196('0x27')][_0xb196('0x43')]({'where':{'id':_0x5f2be5[_0xb196('0x41')]['id']}})[_0xb196('0x3d')](handleEntityNotFound(_0x56d4a8,null))[_0xb196('0x3d')](saveUpdates(_0x5f2be5[_0xb196('0x47')],null))[_0xb196('0x3d')](respondWithResult(_0x56d4a8,null))[_0xb196('0x44')](handleError(_0x56d4a8,null));};exports[_0xb196('0x48')]=function(_0x37bf20,_0x360418){return db[_0xb196('0x27')][_0xb196('0x43')]({'where':{'id':_0x37bf20[_0xb196('0x41')]['id']}})['then'](handleEntityNotFound(_0x360418,null))[_0xb196('0x3d')](removeEntity(_0x360418,null))[_0xb196('0x44')](handleError(_0x360418,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 73b019c..c3c7349 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 _0xe99d=['rimraf','exports','define','DeskField','int_desk_fields','desk_unique_index','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x20d30c,_0x455489){var _0x4fefc1=function(_0x307e3d){while(--_0x307e3d){_0x20d30c['push'](_0x20d30c['shift']());}};_0x4fefc1(++_0x455489);}(_0xe99d,0x156));var _0xde99=function(_0xf4897b,_0xc219a){_0xf4897b=_0xf4897b-0x0;var _0x3a1a7d=_0xe99d[_0xf4897b];return _0x3a1a7d;};'use strict';var _=require(_0xde99('0x0'));var util=require(_0xde99('0x1'));var logger=require(_0xde99('0x2'))('api');var moment=require('moment');var BPromise=require(_0xde99('0x3'));var rp=require(_0xde99('0x4'));var fs=require('fs');var path=require(_0xde99('0x5'));var rimraf=require(_0xde99('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xde99('0x7')]=function(_0x6752fc,_0x218587){return _0x6752fc[_0xde99('0x8')](_0xde99('0x9'),attributes,{'tableName':_0xde99('0xa'),'paranoid':![],'indexes':[{'name':_0xde99('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1796=['request-promise','path','../../config/environment','./intDeskField.attributes','exports','int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger','bluebird'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0x1796,0x159));var _0x6179=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x1796[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x6179('0x0'));var util=require('util');var logger=require(_0x6179('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6179('0x2'));var rp=require(_0x6179('0x3'));var fs=require('fs');var path=require(_0x6179('0x4'));var rimraf=require('rimraf');var config=require(_0x6179('0x5'));var attributes=require(_0x6179('0x6'));module[_0x6179('0x7')]=function(_0x1c9b41,_0x239ab8){return _0x1c9b41['define']('DeskField',attributes,{'tableName':_0x6179('0x8'),'paranoid':![],'indexes':[{'name':_0x6179('0x9'),'fields':[_0x6179('0xa'),_0x6179('0xb')],'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 e0059a6..4b9087c 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 _0x6d5f=['info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x6d5f,0x9f));var _0xf6d5=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x6d5f[_0x4688f3];return _0x470c84;};'use strict';var _=require(_0xf6d5('0x0'));var util=require(_0xf6d5('0x1'));var moment=require(_0xf6d5('0x2'));var BPromise=require(_0xf6d5('0x3'));var rs=require(_0xf6d5('0x4'));var fs=require('fs');var Redis=require(_0xf6d5('0x5'));var db=require(_0xf6d5('0x6'))['db'];var utils=require(_0xf6d5('0x7'));var logger=require(_0xf6d5('0x8'))(_0xf6d5('0x9'));var config=require(_0xf6d5('0xa'));var jayson=require(_0xf6d5('0xb'));var client=jayson[_0xf6d5('0xc')][_0xf6d5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1a96da,_0x158529,_0x31641d){return new BPromise(function(_0x16da18,_0x2abb3e){return client[_0xf6d5('0xe')](_0x1a96da,_0x31641d)[_0xf6d5('0xf')](function(_0x2f4fa1){logger[_0xf6d5('0x10')](_0xf6d5('0x11'),_0x158529,_0xf6d5('0x12'));logger['debug'](_0xf6d5('0x13'),_0x158529,_0xf6d5('0x12'),JSON['stringify'](_0x2f4fa1));if(_0x2f4fa1[_0xf6d5('0x14')]){if(_0x2f4fa1['error'][_0xf6d5('0x15')]===0x1f4){logger[_0xf6d5('0x14')]('DeskField,\x20%s,\x20%s',_0x158529,_0x2f4fa1[_0xf6d5('0x14')]['message']);return _0x2abb3e(_0x2f4fa1[_0xf6d5('0x14')][_0xf6d5('0x16')]);}logger[_0xf6d5('0x14')](_0xf6d5('0x11'),_0x158529,_0x2f4fa1[_0xf6d5('0x14')][_0xf6d5('0x16')]);return _0x16da18(_0x2f4fa1[_0xf6d5('0x14')][_0xf6d5('0x16')]);}else{logger[_0xf6d5('0x10')](_0xf6d5('0x11'),_0x158529,_0xf6d5('0x12'));_0x16da18(_0x2f4fa1[_0xf6d5('0x17')]['message']);}})[_0xf6d5('0x18')](function(_0x2396ac){logger['error'](_0xf6d5('0x11'),_0x158529,_0x2396ac);_0x2abb3e(_0x2396ac);});});} \ No newline at end of file +var _0x534b=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch'];(function(_0x43c987,_0x28c7cf){var _0x47740d=function(_0x26b671){while(--_0x26b671){_0x43c987['push'](_0x43c987['shift']());}};_0x47740d(++_0x28c7cf);}(_0x534b,0x69));var _0xb534=function(_0x2ce9af,_0x5a4c66){_0x2ce9af=_0x2ce9af-0x0;var _0x3623af=_0x534b[_0x2ce9af];return _0x3623af;};'use strict';var _=require(_0xb534('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb534('0x1'));var rs=require(_0xb534('0x2'));var fs=require('fs');var Redis=require(_0xb534('0x3'));var db=require(_0xb534('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb534('0x5'))(_0xb534('0x6'));var config=require(_0xb534('0x7'));var jayson=require(_0xb534('0x8'));var client=jayson[_0xb534('0x9')][_0xb534('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c7b2d,_0x548240,_0x143aae){return new BPromise(function(_0x361240,_0x50ca1e){return client[_0xb534('0xb')](_0x1c7b2d,_0x143aae)['then'](function(_0x116049){logger[_0xb534('0xc')]('DeskField,\x20%s,\x20%s',_0x548240,'request\x20sent');logger['debug'](_0xb534('0xd'),_0x548240,_0xb534('0xe'),JSON[_0xb534('0xf')](_0x116049));if(_0x116049[_0xb534('0x10')]){if(_0x116049[_0xb534('0x10')]['code']===0x1f4){logger['error'](_0xb534('0x11'),_0x548240,_0x116049[_0xb534('0x10')][_0xb534('0x12')]);return _0x50ca1e(_0x116049['error'][_0xb534('0x12')]);}logger[_0xb534('0x10')](_0xb534('0x11'),_0x548240,_0x116049[_0xb534('0x10')][_0xb534('0x12')]);return _0x361240(_0x116049[_0xb534('0x10')][_0xb534('0x12')]);}else{logger[_0xb534('0xc')](_0xb534('0x11'),_0x548240,_0xb534('0xe'));_0x361240(_0x116049[_0xb534('0x13')][_0xb534('0x12')]);}})[_0xb534('0x14')](function(_0x4c72b9){logger['error'](_0xb534('0x11'),_0x548240,_0x4c72b9);_0x50ca1e(_0x4c72b9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 109df1e..b2668bd 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 _0xab6b=['create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post'];(function(_0x3a39ad,_0xd1c4aa){var _0x14ff9c=function(_0x987341){while(--_0x987341){_0x3a39ad['push'](_0x3a39ad['shift']());}};_0x14ff9c(++_0xd1c4aa);}(_0xab6b,0x104));var _0xbab6=function(_0x594de,_0x44f5fa){_0x594de=_0x594de-0x0;var _0x28dbf5=_0xab6b[_0x594de];return _0x28dbf5;};'use strict';var multer=require(_0xbab6('0x0'));var util=require(_0xbab6('0x1'));var path=require(_0xbab6('0x2'));var timeout=require(_0xbab6('0x3'));var express=require('express');var router=express[_0xbab6('0x4')]();var fs_extra=require(_0xbab6('0x5'));var auth=require(_0xbab6('0x6'));var interaction=require(_0xbab6('0x7'));var config=require('../../config/environment');var controller=require(_0xbab6('0x8'));router[_0xbab6('0x9')]('/',auth[_0xbab6('0xa')](),controller[_0xbab6('0xb')]);router[_0xbab6('0x9')](_0xbab6('0xc'),auth[_0xbab6('0xa')](),controller['show']);router[_0xbab6('0x9')]('/:id/configurations',auth[_0xbab6('0xa')](),controller[_0xbab6('0xd')]);router[_0xbab6('0x9')]('/:id/fields',auth[_0xbab6('0xa')](),controller[_0xbab6('0xe')]);router[_0xbab6('0xf')]('/',auth['isAuthenticated'](),controller[_0xbab6('0x10')]);router[_0xbab6('0xf')]('/:id/configurations',auth[_0xbab6('0xa')](),controller[_0xbab6('0x11')]);router[_0xbab6('0x12')](_0xbab6('0xc'),auth[_0xbab6('0xa')](),controller[_0xbab6('0x13')]);router[_0xbab6('0x14')](_0xbab6('0xc'),auth['isAuthenticated'](),controller[_0xbab6('0x15')]);module[_0xbab6('0x16')]=router; \ No newline at end of file +var _0xb3de=['addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xb3de,0x1e2));var _0xeb3d=function(_0x25376c,_0x45e4da){_0x25376c=_0x25376c-0x0;var _0x244715=_0xb3de[_0x25376c];return _0x244715;};'use strict';var multer=require(_0xeb3d('0x0'));var util=require(_0xeb3d('0x1'));var path=require(_0xeb3d('0x2'));var timeout=require(_0xeb3d('0x3'));var express=require(_0xeb3d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeb3d('0x5'));var interaction=require(_0xeb3d('0x6'));var config=require(_0xeb3d('0x7'));var controller=require(_0xeb3d('0x8'));router[_0xeb3d('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb3d('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xeb3d('0x9')](_0xeb3d('0xb'),auth[_0xeb3d('0xc')](),controller[_0xeb3d('0xd')]);router['get'](_0xeb3d('0xe'),auth[_0xeb3d('0xc')](),controller[_0xeb3d('0xf')]);router['post']('/',auth[_0xeb3d('0xc')](),controller[_0xeb3d('0x10')]);router[_0xeb3d('0x11')](_0xeb3d('0xb'),auth['isAuthenticated'](),controller[_0xeb3d('0x12')]);router[_0xeb3d('0x13')]('/:id',auth[_0xeb3d('0xc')](),controller[_0xeb3d('0x14')]);router[_0xeb3d('0x15')](_0xeb3d('0x16'),auth[_0xeb3d('0xc')](),controller[_0xeb3d('0x17')]);module[_0xeb3d('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 497590d..9b41a24 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 _0x448b=['BOOLEAN','sequelize','exports','STRING'];(function(_0xc465f5,_0xa9c358){var _0x3dd839=function(_0x45aa86){while(--_0x45aa86){_0xc465f5['push'](_0xc465f5['shift']());}};_0x3dd839(++_0xa9c358);}(_0x448b,0x125));var _0xb448=function(_0x1a074f,_0x3a121e){_0x1a074f=_0x1a074f-0x0;var _0x4ebcb4=_0x448b[_0x1a074f];return _0x4ebcb4;};'use strict';var Sequelize=require(_0xb448('0x0'));module[_0xb448('0x1')]={'name':{'type':Sequelize[_0xb448('0x2')]},'username':{'type':Sequelize[_0xb448('0x2')]},'password':{'type':Sequelize[_0xb448('0x2')]},'remoteUri':{'type':Sequelize[_0xb448('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb448('0x2')]},'clientSecret':{'type':Sequelize[_0xb448('0x2')]},'serverUrl':{'type':Sequelize[_0xb448('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb448('0x2')]},'modernAuthentication':{'type':Sequelize[_0xb448('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8ba0=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2e7c7f,_0x406704){var _0x1760b3=function(_0x305392){while(--_0x305392){_0x2e7c7f['push'](_0x2e7c7f['shift']());}};_0x1760b3(++_0x406704);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x31fc54,_0x4f74e6){_0x31fc54=_0x31fc54-0x0;var _0x1a427b=_0x8ba0[_0x31fc54];return _0x1a427b;};'use strict';var Sequelize=require(_0x08ba('0x0'));module[_0x08ba('0x1')]={'name':{'type':Sequelize[_0x08ba('0x2')]},'username':{'type':Sequelize[_0x08ba('0x2')]},'password':{'type':Sequelize[_0x08ba('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x08ba('0x2')]},'clientSecret':{'type':Sequelize[_0x08ba('0x2')]},'serverUrl':{'type':Sequelize[_0x08ba('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x08ba('0x2')]},'modernAuthentication':{'type':Sequelize[_0x08ba('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 1efe39b..fefb4ac 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 _0x864e=['body','getConfigurations','Dynamics365Configuration','length','addConfiguration','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','resolvebykpiidname','responseby','responsiblecontactidyominame','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','CloudProvider','data5','data7','modernAuthentication','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','EntityDefinitions(','Bearer\x20','remove','includes','LogicalName','@odata.type','push','MetadataId','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','api','../../mysqldb','status','json','offset','undefined','limit','count','update','then','destroy','end','error','stack','name','index','map','Dynamics365Account','fieldName','type','keys','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','rawAttributes','includeAll','find','catch','create'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x864e,0x13b));var _0xe864=function(_0x2af981,_0x116a02){_0x2af981=_0x2af981-0x0;var _0x13d5f3=_0x864e[_0x2af981];return _0x13d5f3;};'use strict';var rp=require(_0xe864('0x0'));var util=require('util');var _=require(_0xe864('0x1'));var qs=require(_0xe864('0x2'));var logger=require('../../config/logger')(_0xe864('0x3'));var db=require(_0xe864('0x4'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x26cb42,_0x16483e){_0x16483e=_0x16483e||0xc8;return function(_0x3b9b1d){if(_0x3b9b1d){return _0x26cb42[_0xe864('0x5')](_0x16483e)[_0xe864('0x6')](_0x3b9b1d);}};}function respondWithFilteredResult(_0x4114a8,_0x192b78){return function(_0x566236){if(_0x566236){var _0x141284=typeof _0x192b78[_0xe864('0x7')]===_0xe864('0x8')&&typeof _0x192b78[_0xe864('0x9')]===_0xe864('0x8');var _0x460d2e=_0x566236[_0xe864('0xa')];var _0x3a6b2e=_0x141284?0x0:_0x192b78['offset'];var _0xd8ed48=_0x141284?_0x566236['count']:_0x192b78['offset']+_0x192b78['limit'];var _0x1facfb;if(_0xd8ed48>=_0x460d2e){_0xd8ed48=_0x460d2e;_0x1facfb=0xc8;}else{_0x1facfb=0xce;}_0x4114a8[_0xe864('0x5')](_0x1facfb);return _0x4114a8['set']('Content-Range',_0x3a6b2e+'-'+_0xd8ed48+'/'+_0x460d2e)[_0xe864('0x6')](_0x566236);}return null;};}function saveUpdates(_0x4aaaa9){return function(_0x3bc12c){if(_0x3bc12c){return _0x3bc12c[_0xe864('0xb')](_0x4aaaa9)[_0xe864('0xc')](function(_0x299a8e){return _0x299a8e;});}return null;};}function removeEntity(_0x4c6b5c){return function(_0x4ffcb6){if(_0x4ffcb6){return _0x4ffcb6[_0xe864('0xd')]()['then'](function(){_0x4c6b5c[_0xe864('0x5')](0xcc)[_0xe864('0xe')]();});}};}function handleEntityNotFound(_0x56b241){return function(_0x12eb97){if(!_0x12eb97){_0x56b241['sendStatus'](0x194);}return _0x12eb97;};}function handleError(_0x508192,_0x183e4c){_0x183e4c=_0x183e4c||0x1f4;return function(_0x580342){logger[_0xe864('0xf')](_0x580342[_0xe864('0x10')]);if(_0x580342[_0xe864('0x11')]){delete _0x580342['name'];}_0x508192[_0xe864('0x5')](_0x183e4c)['send'](_0x580342);};}exports[_0xe864('0x12')]=function(_0x51ce1b,_0x593fde){var _0x4c4cb3={},_0x59b6d2={},_0x17b67a={'count':0x0,'rows':[]};var _0xcf122e=_[_0xe864('0x13')](db[_0xe864('0x14')]['rawAttributes'],function(_0x47474d){return{'name':_0x47474d[_0xe864('0x15')],'type':_0x47474d[_0xe864('0x16')]['key']};});_0x59b6d2['model']=_[_0xe864('0x13')](_0xcf122e,_0xe864('0x11'));_0x59b6d2['query']=_[_0xe864('0x17')](_0x51ce1b['query']);_0x59b6d2['filters']=_[_0xe864('0x18')](_0x59b6d2[_0xe864('0x19')],_0x59b6d2[_0xe864('0x1a')]);_0x4c4cb3[_0xe864('0x1b')]=_[_0xe864('0x18')](_0x59b6d2[_0xe864('0x19')],qs[_0xe864('0x1c')](_0x51ce1b[_0xe864('0x1a')][_0xe864('0x1c')]));_0x4c4cb3[_0xe864('0x1b')]=_0x4c4cb3[_0xe864('0x1b')]['length']?_0x4c4cb3['attributes']:_0x59b6d2[_0xe864('0x19')];if(!_0x51ce1b['query'][_0xe864('0x1d')](_0xe864('0x1e'))){_0x4c4cb3[_0xe864('0x9')]=qs[_0xe864('0x9')](_0x51ce1b[_0xe864('0x1a')][_0xe864('0x9')]);_0x4c4cb3[_0xe864('0x7')]=qs[_0xe864('0x7')](_0x51ce1b['query'][_0xe864('0x7')]);}_0x4c4cb3[_0xe864('0x1f')]=qs[_0xe864('0x20')](_0x51ce1b[_0xe864('0x1a')][_0xe864('0x20')]);_0x4c4cb3[_0xe864('0x21')]=qs[_0xe864('0x22')](_[_0xe864('0x23')](_0x51ce1b['query'],_0x59b6d2[_0xe864('0x22')]),_0xcf122e);if(_0x51ce1b['query'][_0xe864('0x24')]){_0x4c4cb3[_0xe864('0x21')]=_['merge'](_0x4c4cb3[_0xe864('0x21')],{'$or':_[_0xe864('0x13')](_0xcf122e,function(_0x258bf0){if(_0x258bf0[_0xe864('0x16')]!==_0xe864('0x25')){var _0x39ab4b={};_0x39ab4b[_0x258bf0[_0xe864('0x11')]]={'$like':'%'+_0x51ce1b[_0xe864('0x1a')][_0xe864('0x24')]+'%'};return _0x39ab4b;}})});}_0x4c4cb3=_[_0xe864('0x26')]({},_0x4c4cb3,_0x51ce1b[_0xe864('0x27')]);var _0x15fa8e={'where':_0x4c4cb3['where']};return db['Dynamics365Account'][_0xe864('0xa')](_0x15fa8e)[_0xe864('0xc')](function(_0x2fcb1d){_0x17b67a[_0xe864('0xa')]=_0x2fcb1d;if(_0x51ce1b[_0xe864('0x1a')]['includeAll']){_0x4c4cb3[_0xe864('0x28')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xe864('0x29')](_0x4c4cb3);})[_0xe864('0xc')](function(_0x5529d8){_0x17b67a['rows']=_0x5529d8;return _0x17b67a;})[_0xe864('0xc')](respondWithFilteredResult(_0x593fde,_0x4c4cb3))['catch'](handleError(_0x593fde,null));};exports[_0xe864('0x2a')]=function(_0x3179fa,_0x4ce0ef){var _0x2a4e8a={'raw':![],'where':{'id':_0x3179fa[_0xe864('0x2b')]['id']}},_0x5c75ad={};_0x5c75ad[_0xe864('0x19')]=_[_0xe864('0x17')](db[_0xe864('0x14')][_0xe864('0x2c')]);_0x5c75ad[_0xe864('0x1a')]=_[_0xe864('0x17')](_0x3179fa[_0xe864('0x1a')]);_0x5c75ad[_0xe864('0x22')]=_['intersection'](_0x5c75ad[_0xe864('0x19')],_0x5c75ad[_0xe864('0x1a')]);_0x2a4e8a[_0xe864('0x1b')]=_[_0xe864('0x18')](_0x5c75ad['model'],qs[_0xe864('0x1c')](_0x3179fa[_0xe864('0x1a')][_0xe864('0x1c')]));_0x2a4e8a[_0xe864('0x1b')]=_0x2a4e8a[_0xe864('0x1b')]['length']?_0x2a4e8a[_0xe864('0x1b')]:_0x5c75ad[_0xe864('0x19')];if(_0x3179fa[_0xe864('0x1a')][_0xe864('0x2d')]){_0x2a4e8a['include']=[{'all':!![]}];}_0x2a4e8a=_['merge']({},_0x2a4e8a,_0x3179fa['options']);return db[_0xe864('0x14')][_0xe864('0x2e')](_0x2a4e8a)[_0xe864('0xc')](handleEntityNotFound(_0x4ce0ef,null))['then'](respondWithResult(_0x4ce0ef,null))[_0xe864('0x2f')](handleError(_0x4ce0ef,null));};exports[_0xe864('0x30')]=function(_0x407648,_0x32eb0c){return db['Dynamics365Account'][_0xe864('0x30')](_0x407648['body'],{})[_0xe864('0xc')](respondWithResult(_0x32eb0c,0xc9))[_0xe864('0x2f')](handleError(_0x32eb0c,null));};exports['update']=function(_0x2d4654,_0x5a758c){if(_0x2d4654[_0xe864('0x31')]['id']){delete _0x2d4654[_0xe864('0x31')]['id'];}return db[_0xe864('0x14')][_0xe864('0x2e')]({'where':{'id':_0x2d4654[_0xe864('0x2b')]['id']}})[_0xe864('0xc')](handleEntityNotFound(_0x5a758c,null))[_0xe864('0xc')](saveUpdates(_0x2d4654[_0xe864('0x31')],null))[_0xe864('0xc')](respondWithResult(_0x5a758c,null))[_0xe864('0x2f')](handleError(_0x5a758c,null));};exports[_0xe864('0xd')]=function(_0x3c5de7,_0x1d498b){return db[_0xe864('0x14')][_0xe864('0x2e')]({'where':{'id':_0x3c5de7[_0xe864('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1d498b,null))[_0xe864('0xc')](removeEntity(_0x1d498b,null))[_0xe864('0x2f')](handleError(_0x1d498b,null));};exports[_0xe864('0x32')]=function(_0x35e7fb,_0x3d52d8){var _0x47b1cf={};var _0x4b65aa={};var _0x1923e7;var _0x5edad5;return db[_0xe864('0x14')]['findOne']({'where':{'id':_0x35e7fb['params']['id']}})[_0xe864('0xc')](handleEntityNotFound(_0x3d52d8,null))[_0xe864('0xc')](function(_0x377dc2){if(_0x377dc2){_0x1923e7=_0x377dc2;_0x4b65aa[_0xe864('0x19')]=_[_0xe864('0x17')](db[_0xe864('0x33')][_0xe864('0x2c')]);_0x4b65aa['query']=_[_0xe864('0x17')](_0x35e7fb[_0xe864('0x1a')]);_0x4b65aa[_0xe864('0x22')]=_[_0xe864('0x18')](_0x4b65aa[_0xe864('0x19')],_0x4b65aa[_0xe864('0x1a')]);_0x47b1cf[_0xe864('0x1b')]=_[_0xe864('0x18')](_0x4b65aa[_0xe864('0x19')],qs[_0xe864('0x1c')](_0x35e7fb[_0xe864('0x1a')]['fields']));_0x47b1cf[_0xe864('0x1b')]=_0x47b1cf['attributes'][_0xe864('0x34')]?_0x47b1cf[_0xe864('0x1b')]:_0x4b65aa[_0xe864('0x19')];_0x47b1cf[_0xe864('0x1f')]=qs[_0xe864('0x20')](_0x35e7fb[_0xe864('0x1a')][_0xe864('0x20')]);_0x47b1cf['where']=qs[_0xe864('0x22')](_[_0xe864('0x23')](_0x35e7fb[_0xe864('0x1a')],_0x4b65aa[_0xe864('0x22')]));if(_0x35e7fb['query']['filter']){_0x47b1cf[_0xe864('0x21')]=_['merge'](_0x47b1cf[_0xe864('0x21')],{'$or':_[_0xe864('0x13')](_0x47b1cf[_0xe864('0x1b')],function(_0x42082c){var _0x4df318={};_0x4df318[_0x42082c]={'$like':'%'+_0x35e7fb[_0xe864('0x1a')][_0xe864('0x24')]+'%'};return _0x4df318;})});}_0x47b1cf=_[_0xe864('0x26')]({},_0x47b1cf,_0x35e7fb[_0xe864('0x27')]);return _0x1923e7[_0xe864('0x32')](_0x47b1cf);}})[_0xe864('0xc')](function(_0x333b3){if(_0x333b3){_0x5edad5=_0x333b3[_0xe864('0x34')];if(!_0x35e7fb[_0xe864('0x1a')][_0xe864('0x1d')](_0xe864('0x1e'))){_0x47b1cf[_0xe864('0x9')]=qs['limit'](_0x35e7fb['query'][_0xe864('0x9')]);_0x47b1cf[_0xe864('0x7')]=qs[_0xe864('0x7')](_0x35e7fb['query'][_0xe864('0x7')]);}return _0x1923e7[_0xe864('0x32')](_0x47b1cf);}})[_0xe864('0xc')](function(_0x44141b){if(_0x44141b){return _0x44141b?{'count':_0x5edad5,'rows':_0x44141b}:null;}})[_0xe864('0xc')](respondWithResult(_0x3d52d8,null))[_0xe864('0x2f')](handleError(_0x3d52d8,null));};exports[_0xe864('0x35')]=function(_0x59433c,_0x271726){if(_0x59433c[_0xe864('0x31')]['id']){delete _0x59433c['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x59433c[_0xe864('0x2b')]['id']}})[_0xe864('0xc')](handleEntityNotFound(_0x271726,null))['then'](function(_0x536368){if(_0x536368){_0x59433c[_0xe864('0x31')][_0xe864('0x36')]=_0x536368['id'];_0x59433c['body'][_0xe864('0x37')]=integrations['getSubjects'](_0x59433c[_0xe864('0x31')][_0xe864('0x38')],_0x59433c['body']['type']);_0x59433c['body']['Descriptions']=integrations[_0xe864('0x39')](_0x59433c[_0xe864('0x31')][_0xe864('0x38')],_0x59433c[_0xe864('0x31')][_0xe864('0x16')]);return db[_0xe864('0x33')]['create'](_0x59433c[_0xe864('0x31')],{'include':[{'model':db[_0xe864('0x3a')],'as':_0xe864('0x37')},{'model':db[_0xe864('0x3a')],'as':_0xe864('0x3b')}]});}return null;})[_0xe864('0xc')](respondWithResult(_0x271726,null))[_0xe864('0x2f')](handleError(_0x271726,null));};function sanitizeRemoteUri(_0x210603){var _0x42ae3a=_0x210603[_0xe864('0x3c')](-0x1);if(_0x42ae3a==='/')return _0x210603[_0xe864('0x3d')](0x0,_0x210603[_0xe864('0x3e')](_0x42ae3a));return _0x210603;}function getWebApiUrl(_0x4d1a6d){return util[_0xe864('0x3f')](_0xe864('0x40'),_0x4d1a6d);}exports[_0xe864('0x41')]=function(_0x21f9d4,_0x51b5b1){var _0x55a37c=_0x21f9d4[_0xe864('0x1a')]['ticketType'];var _0x28fef7=_0x55a37c===_0xe864('0x42')?_0xe864('0x43'):_0xe864('0x44');var _0x534d67='';var _0x11a287='';var _0x4fbd8b='';var _0x133387='';var _0x590af4='';var _0x2817b6='';var _0x538c7e='';var _0x1e602e='';var _0x5496af=[_0xe864('0x45'),'description',_0xe864('0x46'),_0xe864('0x47'),_0xe864('0x48'),_0xe864('0x49'),'phonenumber',_0xe864('0x4a'),_0xe864('0x4b'),_0xe864('0x4c')];var _0x3612bb=['accountidname','accountidyominame',_0xe864('0x4d'),_0xe864('0x4e'),_0xe864('0x4f'),_0xe864('0x50'),_0xe864('0x51'),_0xe864('0x52'),_0xe864('0x53'),_0xe864('0x54'),_0xe864('0x55'),_0xe864('0x56'),_0xe864('0x57'),_0xe864('0x58'),'createdonbehalfbyyominame',_0xe864('0x59'),'customeridtype','customeridyominame',_0xe864('0x5a'),_0xe864('0x5b'),_0xe864('0x5c'),_0xe864('0x5d'),_0xe864('0x5e'),_0xe864('0x5f'),'firstresponsebykpiidname',_0xe864('0x60'),_0xe864('0x61'),_0xe864('0x62'),_0xe864('0x63'),_0xe864('0x64'),_0xe864('0x65'),_0xe864('0x66'),_0xe864('0x67'),'modifiedbyname',_0xe864('0x68'),'modifiedon','modifiedonbehalfbyname',_0xe864('0x69'),_0xe864('0x6a'),_0xe864('0x6b'),_0xe864('0x6c'),'onholdtime',_0xe864('0x6d'),_0xe864('0x6e'),_0xe864('0x6f'),_0xe864('0x70'),_0xe864('0x71'),_0xe864('0x72'),'primarycontactidyominame','prioritycodename',_0xe864('0x73'),'productserialnumber','resolveby',_0xe864('0x74'),_0xe864('0x75'),'responsiblecontactidname',_0xe864('0x76'),'sentimentvalue','slainvokedidname',_0xe864('0x77'),_0xe864('0x78'),_0xe864('0x79'),_0xe864('0x7a'),_0xe864('0x7b'),_0xe864('0x7c'),_0xe864('0x7d'),'transactioncurrencyidname',_0xe864('0x7e'),_0xe864('0x7f'),_0xe864('0x80')];var _0x56ca9c=_0x5496af[_0xe864('0x81')](_0x3612bb);return db['Dynamics365Account']['findOne']({'where':{'id':_0x21f9d4[_0xe864('0x2b')]['id']},'attributes':['id',_0xe864('0x82'),_0xe864('0x83'),_0xe864('0x84'),'tenantId','clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0xe864('0x85')],'as':_0xe864('0x85'),'attributes':['id',_0xe864('0x86'),_0xe864('0x87')]}]})[_0xe864('0xc')](handleEntityNotFound(_0x51b5b1,null))[_0xe864('0xc')](function(_0x4fb652){if(_0x4fb652){if(_0x4fb652[_0xe864('0x88')]){_0x4fb652['access_token']=_0x4fb652['CloudProvider'][_0xe864('0x86')];_0x1e602e=sanitizeRemoteUri(_0x4fb652[_0xe864('0x85')][_0xe864('0x87')]);_0x538c7e=getWebApiUrl(_0x1e602e);return _0x4fb652;}_0x1e602e=sanitizeRemoteUri(_0x4fb652[_0xe864('0x84')]);_0x538c7e=getWebApiUrl(_0x1e602e);var _0x492716={'method':_0xe864('0x89'),'uri':_0xe864('0x8a')+_0x4fb652[_0xe864('0x8b')]+_0xe864('0x8c'),'form':{'client_id':_0x4fb652[_0xe864('0x8d')],'resource':_0x1e602e,'username':_0x4fb652['username'],'password':_0x4fb652['password'],'grant_type':_0xe864('0x83'),'client_secret':_0x4fb652['clientSecret']},'json':!![]};return rp(_0x492716);}})[_0xe864('0xc')](function(_0x320fe){_0x2817b6=_0x320fe['access_token'];var _0x4e727f={'method':_0xe864('0x8e'),'uri':encodeURI(_0x538c7e+_0xe864('0x8f')+_0x28fef7+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x2817b6,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x4e727f);})[_0xe864('0xc')](function(_0x29e282){var _0x3dcc16=_0x29e282['value'][0x0];var _0x5ba0a4=_0x3dcc16['MetadataId'];var _0x47ccf2={'method':_0xe864('0x8e'),'uri':_0x538c7e+_0xe864('0x91')+_0x5ba0a4+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xe864('0x92')+_0x2817b6,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x47ccf2);})['then'](function(_0x1c8820){_0x534d67=_0x1c8820;_0x11a287=_0x534d67['Attributes'];_0x11a287=_[_0xe864('0x93')](_0x11a287,function(_0x59278c){return!_0x56ca9c[_0xe864('0x94')](_0x59278c[_0xe864('0x95')]);});var _0x5c1d70=[];var _0xa078b3=[];_0x11a287['forEach'](function(_0x38cfd3){if(_0x38cfd3[_0xe864('0x96')]){var _0x50a388=_0x38cfd3[_0xe864('0x96')][_0xe864('0x3d')](_0x38cfd3[_0xe864('0x96')][_0xe864('0x3e')]('.')+0x1);if(_0x50a388==='PicklistAttributeMetadata'){_0x5c1d70[_0xe864('0x97')](getSelectList(_0x538c7e,_0x55a37c,_0xa078b3,_0x534d67['MetadataId'],_0x38cfd3[_0xe864('0x98')],_0x2817b6));}}});return Promise[_0xe864('0x99')](_0x5c1d70);})[_0xe864('0xc')](function(_0x2b3e47){_0x4fbd8b=_0x2b3e47[0x0];var _0x27143a=[];var _0x503fea=[];_0x11a287[_0xe864('0x9a')](function(_0x548af2){if(!_[_0xe864('0x9b')](_0x548af2[_0xe864('0x96')])){var _0x35ddef=_0x548af2[_0xe864('0x96')][_0xe864('0x3d')](_0x548af2['@odata.type'][_0xe864('0x3e')]('.')+0x1);if(_0x35ddef===_0xe864('0x9c')){_0x27143a[_0xe864('0x97')](getBooleanList(_0x538c7e,_0x55a37c,_0x503fea,_0x534d67[_0xe864('0x98')],_0x548af2[_0xe864('0x98')],_0x2817b6));}}});return Promise['all'](_0x27143a);})[_0xe864('0xc')](function(_0x439f62){_0x133387=_0x439f62[0x0];var _0x1cbe4b=[];var _0x2d6328=[];_0x11a287[_0xe864('0x9a')](function(_0x80e65d){if(_0x80e65d[_0xe864('0x96')]){var _0x3e0b60=_0x80e65d[_0xe864('0x96')][_0xe864('0x3d')](_0x80e65d[_0xe864('0x96')][_0xe864('0x3e')]('.')+0x1);if(_0x3e0b60===_0xe864('0x9d')||_0x3e0b60===_0xe864('0x9e')||_0x3e0b60==='BigIntAttributeMetadata'||_0x3e0b60===_0xe864('0x9f')||_0x3e0b60===_0xe864('0xa0')||_0x3e0b60==='DateTimeAttributeMetadata'||_0x3e0b60===_0xe864('0xa1')||_0x3e0b60===_0xe864('0xa2')||_0x3e0b60===_0xe864('0xa3')||_0x3e0b60==='DecimalAttributeMetadata'){_0x1cbe4b[_0xe864('0x97')](getInputList(_0x538c7e,_0x55a37c,_0x3e0b60,_0x2d6328,_0x534d67[_0xe864('0x98')],_0x80e65d[_0xe864('0x98')],_0x2817b6));}}});return Promise[_0xe864('0x99')](_0x1cbe4b);})[_0xe864('0xc')](function(_0x4eafe5){_0x590af4=_0x4eafe5[0x0];var _0x3bf62b=_0x4fbd8b[_0xe864('0x81')](_0x133387)[_0xe864('0x81')](_0x590af4);var _0x218c59={'count':_0x3bf62b[_0xe864('0x34')],'rows':_0x3bf62b};return _0x218c59;})[_0xe864('0xc')](respondWithResult(_0x51b5b1,null))['catch'](function(_0x33c9e0){var _0x533b2b=_0x21f9d4[_0xe864('0x1a')][_0xe864('0xa4')]?0x1f4:_0x33c9e0[_0xe864('0xa5')]||0x1f4;logger['error'](_0x33c9e0[_0xe864('0x10')]);delete _0x33c9e0['name'];if(_0x533b2b===0x191){_0x533b2b=0x190;}_0x51b5b1['status'](_0x533b2b)['send'](_0x21f9d4[_0xe864('0x1a')][_0xe864('0xa4')]?{'message':_0xe864('0xa6'),'statusCode':_0x33c9e0[_0xe864('0xa5')]}:_0x33c9e0);});};function getSelectList(_0x20c2ca,_0x2d6511,_0x2116a0,_0x589e52,_0x3df1cb,_0x4c93a4){var _0x5bc0c3={'method':'GET','uri':_0x20c2ca+_0xe864('0x91')+_0x589e52+_0xe864('0xa7')+_0x3df1cb+_0xe864('0xa8')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xe864('0x92')+_0x4c93a4,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x5bc0c3)[_0xe864('0xc')](function(_0x40ab44){var _0x8f0d05=[];var _0x5e1ecf=_0x40ab44['OptionSet'][_0xe864('0xa9')];_0x5e1ecf[_0xe864('0x9a')](function(_0x4f4005){_0x8f0d05['push']({'name':_0x4f4005[_0xe864('0xaa')][_0xe864('0xab')][_0xe864('0xaa')],'value':String(_0x4f4005[_0xe864('0xac')])});});var _0x342b1e={'id':_0x2d6511+'_'+_0x40ab44[_0xe864('0x95')],'name':_0x40ab44[_0xe864('0xad')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x8f0d05};_0x2116a0[_0xe864('0x97')](_0x342b1e);return _0x2116a0;});}function getBooleanList(_0x460d93,_0x333464,_0x5175e9,_0x122f33,_0x16b940,_0x28a858){var _0x352161={'method':'GET','uri':_0x460d93+'EntityDefinitions('+_0x122f33+')/Attributes('+_0x16b940+_0xe864('0xae'),'headers':{'Authorization':_0xe864('0x92')+_0x28a858,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x352161)[_0xe864('0xc')](function(_0x2aefa6){var _0x22a94d=[];_0x22a94d[_0xe864('0x97')]({'name':_0x2aefa6['OptionSet'][_0xe864('0xaf')][_0xe864('0xaa')][_0xe864('0xab')][_0xe864('0xaa')],'value':_0xe864('0xb0')},{'name':_0x2aefa6[_0xe864('0xb1')][_0xe864('0xb2')][_0xe864('0xaa')][_0xe864('0xab')]['Label'],'value':_0xe864('0xb3')});var _0x3dd599={'id':_0x333464+'_'+_0x2aefa6[_0xe864('0x95')],'name':_0x2aefa6[_0xe864('0xad')][_0xe864('0xab')]['Label'],'custom':![],'options':_0x22a94d};_0x5175e9['push'](_0x3dd599);return _0x5175e9;});}function getInputList(_0x5192f1,_0x13deba,_0x674686,_0x2502dc,_0x157a60,_0x435ec7,_0x3f7da2){var _0xa674bf={'method':_0xe864('0x8e'),'uri':_0x5192f1+_0xe864('0x91')+_0x157a60+')/Attributes('+_0x435ec7+_0xe864('0xb4')+_0x674686+_0xe864('0xb5'),'headers':{'Authorization':_0xe864('0x92')+_0x3f7da2,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0xa674bf)[_0xe864('0xc')](function(_0x55a92c){var _0x2dcc82={'id':_0x13deba+'_'+_0x55a92c[_0xe864('0x95')],'name':_0x55a92c[_0xe864('0xad')][_0xe864('0xab')]?_0x55a92c['DisplayName'][_0xe864('0xab')][_0xe864('0xaa')]:_0x55a92c[_0xe864('0x95')],'custom':![],'options':[]};_0x2502dc[_0xe864('0x97')](_0x2dcc82);return _0x2502dc;});} \ No newline at end of file +var _0x6f24=['slice','substring','format','%s/api/data/v9.0/','getFields','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','modernAuthentication','CloudProvider','data5','access_token','data7','POST','/oauth2/token','GET','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','lastIndexOf','push','MetadataId','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','true','FalseOption','?$select=DisplayName,LogicalName','DisplayName','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','params','length','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','sort','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field'];(function(_0x2638a5,_0x1e3076){var _0x2d9dd9=function(_0x11a294){while(--_0x11a294){_0x2638a5['push'](_0x2638a5['shift']());}};_0x2d9dd9(++_0x1e3076);}(_0x6f24,0x76));var _0x46f2=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x6f24[_0x4629ee];return _0x47fb5b;};'use strict';var rp=require(_0x46f2('0x0'));var util=require(_0x46f2('0x1'));var _=require('lodash');var qs=require(_0x46f2('0x2'));var logger=require(_0x46f2('0x3'))(_0x46f2('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x46f2('0x5'));function respondWithResult(_0x5d4655,_0x5da2a8){_0x5da2a8=_0x5da2a8||0xc8;return function(_0x37b138){if(_0x37b138){return _0x5d4655[_0x46f2('0x6')](_0x5da2a8)[_0x46f2('0x7')](_0x37b138);}};}function respondWithFilteredResult(_0x20be4a,_0x51d8b6){return function(_0x12d539){if(_0x12d539){var _0xd8ec3d=typeof _0x51d8b6[_0x46f2('0x8')]==='undefined'&&typeof _0x51d8b6[_0x46f2('0x9')]===_0x46f2('0xa');var _0x364fc8=_0x12d539[_0x46f2('0xb')];var _0x588630=_0xd8ec3d?0x0:_0x51d8b6['offset'];var _0x42d435=_0xd8ec3d?_0x12d539[_0x46f2('0xb')]:_0x51d8b6[_0x46f2('0x8')]+_0x51d8b6[_0x46f2('0x9')];var _0x52b5ca;if(_0x42d435>=_0x364fc8){_0x42d435=_0x364fc8;_0x52b5ca=0xc8;}else{_0x52b5ca=0xce;}_0x20be4a[_0x46f2('0x6')](_0x52b5ca);return _0x20be4a[_0x46f2('0xc')](_0x46f2('0xd'),_0x588630+'-'+_0x42d435+'/'+_0x364fc8)[_0x46f2('0x7')](_0x12d539);}return null;};}function saveUpdates(_0x4fa24e){return function(_0x2e3a99){if(_0x2e3a99){return _0x2e3a99[_0x46f2('0xe')](_0x4fa24e)[_0x46f2('0xf')](function(_0x1f5010){return _0x1f5010;});}return null;};}function removeEntity(_0x336f68){return function(_0x115af5){if(_0x115af5){return _0x115af5[_0x46f2('0x10')]()[_0x46f2('0xf')](function(){_0x336f68[_0x46f2('0x6')](0xcc)[_0x46f2('0x11')]();});}};}function handleEntityNotFound(_0x19786c){return function(_0x1a63c){if(!_0x1a63c){_0x19786c[_0x46f2('0x12')](0x194);}return _0x1a63c;};}function handleError(_0x5c885d,_0x29a312){_0x29a312=_0x29a312||0x1f4;return function(_0x4125db){logger[_0x46f2('0x13')](_0x4125db[_0x46f2('0x14')]);if(_0x4125db[_0x46f2('0x15')]){delete _0x4125db[_0x46f2('0x15')];}_0x5c885d[_0x46f2('0x6')](_0x29a312)['send'](_0x4125db);};}exports[_0x46f2('0x16')]=function(_0x5a1380,_0x15ecb2){var _0x9587e2={},_0x48b5ea={},_0x5970a1={'count':0x0,'rows':[]};var _0x45ea96=_[_0x46f2('0x17')](db[_0x46f2('0x18')][_0x46f2('0x19')],function(_0x28dd7d){return{'name':_0x28dd7d[_0x46f2('0x1a')],'type':_0x28dd7d['type'][_0x46f2('0x1b')]};});_0x48b5ea['model']=_[_0x46f2('0x17')](_0x45ea96,'name');_0x48b5ea[_0x46f2('0x1c')]=_[_0x46f2('0x1d')](_0x5a1380[_0x46f2('0x1c')]);_0x48b5ea[_0x46f2('0x1e')]=_[_0x46f2('0x1f')](_0x48b5ea[_0x46f2('0x20')],_0x48b5ea['query']);_0x9587e2[_0x46f2('0x21')]=_[_0x46f2('0x1f')](_0x48b5ea[_0x46f2('0x20')],qs[_0x46f2('0x22')](_0x5a1380['query'][_0x46f2('0x22')]));_0x9587e2[_0x46f2('0x21')]=_0x9587e2[_0x46f2('0x21')]['length']?_0x9587e2[_0x46f2('0x21')]:_0x48b5ea['model'];if(!_0x5a1380['query'][_0x46f2('0x23')]('nolimit')){_0x9587e2[_0x46f2('0x9')]=qs[_0x46f2('0x9')](_0x5a1380['query']['limit']);_0x9587e2[_0x46f2('0x8')]=qs[_0x46f2('0x8')](_0x5a1380[_0x46f2('0x1c')]['offset']);}_0x9587e2[_0x46f2('0x24')]=qs['sort'](_0x5a1380[_0x46f2('0x1c')]['sort']);_0x9587e2[_0x46f2('0x25')]=qs[_0x46f2('0x1e')](_[_0x46f2('0x26')](_0x5a1380[_0x46f2('0x1c')],_0x48b5ea[_0x46f2('0x1e')]),_0x45ea96);if(_0x5a1380[_0x46f2('0x1c')][_0x46f2('0x27')]){_0x9587e2[_0x46f2('0x25')]=_[_0x46f2('0x28')](_0x9587e2[_0x46f2('0x25')],{'$or':_['map'](_0x45ea96,function(_0x1971a5){if(_0x1971a5[_0x46f2('0x29')]!==_0x46f2('0x2a')){var _0x2a4a1f={};_0x2a4a1f[_0x1971a5['name']]={'$like':'%'+_0x5a1380[_0x46f2('0x1c')][_0x46f2('0x27')]+'%'};return _0x2a4a1f;}})});}_0x9587e2=_[_0x46f2('0x28')]({},_0x9587e2,_0x5a1380['options']);var _0x2a379b={'where':_0x9587e2[_0x46f2('0x25')]};return db['Dynamics365Account'][_0x46f2('0xb')](_0x2a379b)[_0x46f2('0xf')](function(_0x12541d){_0x5970a1[_0x46f2('0xb')]=_0x12541d;if(_0x5a1380['query'][_0x46f2('0x2b')]){_0x9587e2[_0x46f2('0x2c')]=[{'all':!![]}];}return db[_0x46f2('0x18')][_0x46f2('0x2d')](_0x9587e2);})[_0x46f2('0xf')](function(_0x4406cf){_0x5970a1['rows']=_0x4406cf;return _0x5970a1;})['then'](respondWithFilteredResult(_0x15ecb2,_0x9587e2))[_0x46f2('0x2e')](handleError(_0x15ecb2,null));};exports['show']=function(_0x54fa91,_0x378ed5){var _0x274ce5={'raw':![],'where':{'id':_0x54fa91[_0x46f2('0x2f')]['id']}},_0x499a12={};_0x499a12[_0x46f2('0x20')]=_['keys'](db[_0x46f2('0x18')]['rawAttributes']);_0x499a12[_0x46f2('0x1c')]=_[_0x46f2('0x1d')](_0x54fa91[_0x46f2('0x1c')]);_0x499a12[_0x46f2('0x1e')]=_[_0x46f2('0x1f')](_0x499a12[_0x46f2('0x20')],_0x499a12['query']);_0x274ce5['attributes']=_['intersection'](_0x499a12[_0x46f2('0x20')],qs[_0x46f2('0x22')](_0x54fa91[_0x46f2('0x1c')][_0x46f2('0x22')]));_0x274ce5['attributes']=_0x274ce5[_0x46f2('0x21')][_0x46f2('0x30')]?_0x274ce5[_0x46f2('0x21')]:_0x499a12[_0x46f2('0x20')];if(_0x54fa91['query']['includeAll']){_0x274ce5[_0x46f2('0x2c')]=[{'all':!![]}];}_0x274ce5=_[_0x46f2('0x28')]({},_0x274ce5,_0x54fa91[_0x46f2('0x31')]);return db[_0x46f2('0x18')][_0x46f2('0x32')](_0x274ce5)[_0x46f2('0xf')](handleEntityNotFound(_0x378ed5,null))[_0x46f2('0xf')](respondWithResult(_0x378ed5,null))[_0x46f2('0x2e')](handleError(_0x378ed5,null));};exports[_0x46f2('0x33')]=function(_0x2b0768,_0x426b74){return db[_0x46f2('0x18')][_0x46f2('0x33')](_0x2b0768['body'],{})[_0x46f2('0xf')](respondWithResult(_0x426b74,0xc9))[_0x46f2('0x2e')](handleError(_0x426b74,null));};exports[_0x46f2('0xe')]=function(_0x5e3624,_0x1b5375){if(_0x5e3624[_0x46f2('0x34')]['id']){delete _0x5e3624[_0x46f2('0x34')]['id'];}return db[_0x46f2('0x18')][_0x46f2('0x32')]({'where':{'id':_0x5e3624['params']['id']}})['then'](handleEntityNotFound(_0x1b5375,null))[_0x46f2('0xf')](saveUpdates(_0x5e3624[_0x46f2('0x34')],null))[_0x46f2('0xf')](respondWithResult(_0x1b5375,null))[_0x46f2('0x2e')](handleError(_0x1b5375,null));};exports[_0x46f2('0x10')]=function(_0x1d90f1,_0x2d4487){return db[_0x46f2('0x18')][_0x46f2('0x32')]({'where':{'id':_0x1d90f1[_0x46f2('0x2f')]['id']}})[_0x46f2('0xf')](handleEntityNotFound(_0x2d4487,null))[_0x46f2('0xf')](removeEntity(_0x2d4487,null))[_0x46f2('0x2e')](handleError(_0x2d4487,null));};exports[_0x46f2('0x35')]=function(_0x3129d1,_0x5752b8){var _0x7b8bdb={};var _0x2feb28={};var _0x19416a;var _0x1967a6;return db['Dynamics365Account'][_0x46f2('0x36')]({'where':{'id':_0x3129d1['params']['id']}})[_0x46f2('0xf')](handleEntityNotFound(_0x5752b8,null))[_0x46f2('0xf')](function(_0x40c867){if(_0x40c867){_0x19416a=_0x40c867;_0x2feb28[_0x46f2('0x20')]=_[_0x46f2('0x1d')](db[_0x46f2('0x37')][_0x46f2('0x19')]);_0x2feb28['query']=_[_0x46f2('0x1d')](_0x3129d1['query']);_0x2feb28[_0x46f2('0x1e')]=_[_0x46f2('0x1f')](_0x2feb28[_0x46f2('0x20')],_0x2feb28[_0x46f2('0x1c')]);_0x7b8bdb['attributes']=_['intersection'](_0x2feb28[_0x46f2('0x20')],qs['fields'](_0x3129d1['query'][_0x46f2('0x22')]));_0x7b8bdb[_0x46f2('0x21')]=_0x7b8bdb[_0x46f2('0x21')]['length']?_0x7b8bdb[_0x46f2('0x21')]:_0x2feb28[_0x46f2('0x20')];_0x7b8bdb[_0x46f2('0x24')]=qs[_0x46f2('0x38')](_0x3129d1[_0x46f2('0x1c')][_0x46f2('0x38')]);_0x7b8bdb[_0x46f2('0x25')]=qs[_0x46f2('0x1e')](_[_0x46f2('0x26')](_0x3129d1[_0x46f2('0x1c')],_0x2feb28[_0x46f2('0x1e')]));if(_0x3129d1[_0x46f2('0x1c')]['filter']){_0x7b8bdb[_0x46f2('0x25')]=_[_0x46f2('0x28')](_0x7b8bdb[_0x46f2('0x25')],{'$or':_['map'](_0x7b8bdb[_0x46f2('0x21')],function(_0x184ab5){var _0x549349={};_0x549349[_0x184ab5]={'$like':'%'+_0x3129d1[_0x46f2('0x1c')][_0x46f2('0x27')]+'%'};return _0x549349;})});}_0x7b8bdb=_[_0x46f2('0x28')]({},_0x7b8bdb,_0x3129d1[_0x46f2('0x31')]);return _0x19416a[_0x46f2('0x35')](_0x7b8bdb);}})['then'](function(_0x46e052){if(_0x46e052){_0x1967a6=_0x46e052[_0x46f2('0x30')];if(!_0x3129d1[_0x46f2('0x1c')][_0x46f2('0x23')](_0x46f2('0x39'))){_0x7b8bdb[_0x46f2('0x9')]=qs['limit'](_0x3129d1['query'][_0x46f2('0x9')]);_0x7b8bdb[_0x46f2('0x8')]=qs['offset'](_0x3129d1[_0x46f2('0x1c')]['offset']);}return _0x19416a[_0x46f2('0x35')](_0x7b8bdb);}})[_0x46f2('0xf')](function(_0x46bf52){if(_0x46bf52){return _0x46bf52?{'count':_0x1967a6,'rows':_0x46bf52}:null;}})[_0x46f2('0xf')](respondWithResult(_0x5752b8,null))[_0x46f2('0x2e')](handleError(_0x5752b8,null));};exports[_0x46f2('0x3a')]=function(_0x5903ed,_0x14a9ca){if(_0x5903ed['body']['id']){delete _0x5903ed[_0x46f2('0x34')]['id'];}return db[_0x46f2('0x18')][_0x46f2('0x36')]({'where':{'id':_0x5903ed[_0x46f2('0x2f')]['id']}})[_0x46f2('0xf')](handleEntityNotFound(_0x14a9ca,null))[_0x46f2('0xf')](function(_0x46aa80){if(_0x46aa80){_0x5903ed['body']['AccountId']=_0x46aa80['id'];_0x5903ed[_0x46f2('0x34')][_0x46f2('0x3b')]=integrations['getSubjects'](_0x5903ed[_0x46f2('0x34')][_0x46f2('0x3c')],_0x5903ed[_0x46f2('0x34')][_0x46f2('0x29')]);_0x5903ed[_0x46f2('0x34')][_0x46f2('0x3d')]=integrations[_0x46f2('0x3e')](_0x5903ed['body']['channel'],_0x5903ed[_0x46f2('0x34')][_0x46f2('0x29')]);return db['Dynamics365Configuration'][_0x46f2('0x33')](_0x5903ed['body'],{'include':[{'model':db[_0x46f2('0x3f')],'as':_0x46f2('0x3b')},{'model':db['Dynamics365Field'],'as':_0x46f2('0x3d')}]});}return null;})[_0x46f2('0xf')](respondWithResult(_0x14a9ca,null))[_0x46f2('0x2e')](handleError(_0x14a9ca,null));};function sanitizeRemoteUri(_0x27a3b2){var _0x3562fb=_0x27a3b2[_0x46f2('0x40')](-0x1);if(_0x3562fb==='/')return _0x27a3b2[_0x46f2('0x41')](0x0,_0x27a3b2['lastIndexOf'](_0x3562fb));return _0x27a3b2;}function getWebApiUrl(_0x179b71){return util[_0x46f2('0x42')](_0x46f2('0x43'),_0x179b71);}exports[_0x46f2('0x44')]=function(_0x455a35,_0x28573b){var _0x9ab912=_0x455a35[_0x46f2('0x1c')]['ticketType'];var _0x5d52ab=_0x9ab912===_0x46f2('0x45')?_0x46f2('0x46'):'PhoneCall';var _0x11e10b='';var _0x1f2801='';var _0x54d689='';var _0x76b230='';var _0x47021e='';var _0x58502c='';var _0x325fb2='';var _0x33f3a1='';var _0x126dca=[_0x46f2('0x47'),_0x46f2('0x48'),_0x46f2('0x49'),_0x46f2('0x4a'),_0x46f2('0x4b'),_0x46f2('0x4c'),_0x46f2('0x4d'),'regardingobjectid',_0x46f2('0x4e'),_0x46f2('0x4f')];var _0x9db04e=['accountidname','accountidyominame',_0x46f2('0x50'),'billedserviceunits',_0x46f2('0x51'),'contactidyominame',_0x46f2('0x52'),_0x46f2('0x53'),_0x46f2('0x54'),'createdbyexternalpartyyominame',_0x46f2('0x55'),_0x46f2('0x56'),_0x46f2('0x57'),'createdonbehalfbyname',_0x46f2('0x58'),_0x46f2('0x59'),_0x46f2('0x5a'),_0x46f2('0x5b'),_0x46f2('0x5c'),_0x46f2('0x5d'),_0x46f2('0x5e'),_0x46f2('0x5f'),_0x46f2('0x60'),_0x46f2('0x61'),'firstresponsebykpiidname',_0x46f2('0x62'),'importsequencenumber',_0x46f2('0x63'),_0x46f2('0x64'),_0x46f2('0x65'),'masteridname','modifiedbyexternalpartyname',_0x46f2('0x66'),'modifiedbyname','modifiedbyyominame',_0x46f2('0x67'),_0x46f2('0x68'),'modifiedonbehalfbyyominame',_0x46f2('0x69'),_0x46f2('0x6a'),'numberofchildincidents',_0x46f2('0x6b'),_0x46f2('0x6c'),_0x46f2('0x6d'),_0x46f2('0x6e'),'owneridyominame',_0x46f2('0x6f'),_0x46f2('0x70'),_0x46f2('0x71'),'prioritycodename',_0x46f2('0x72'),_0x46f2('0x73'),_0x46f2('0x74'),'resolvebykpiidname',_0x46f2('0x75'),_0x46f2('0x76'),_0x46f2('0x77'),_0x46f2('0x78'),_0x46f2('0x79'),_0x46f2('0x7a'),_0x46f2('0x7b'),_0x46f2('0x7c'),_0x46f2('0x7d'),_0x46f2('0x7e'),_0x46f2('0x7f'),_0x46f2('0x80'),'transactioncurrencyidname',_0x46f2('0x81'),_0x46f2('0x82'),_0x46f2('0x83')];var _0x49b924=_0x126dca[_0x46f2('0x84')](_0x9db04e);return db[_0x46f2('0x18')][_0x46f2('0x36')]({'where':{'id':_0x455a35[_0x46f2('0x2f')]['id']},'attributes':['id',_0x46f2('0x85'),_0x46f2('0x86'),'remoteUri',_0x46f2('0x87'),_0x46f2('0x88'),'clientSecret',_0x46f2('0x89')],'include':[{'model':db[_0x46f2('0x8a')],'as':_0x46f2('0x8a'),'attributes':['id',_0x46f2('0x8b'),'data7']}]})[_0x46f2('0xf')](handleEntityNotFound(_0x28573b,null))[_0x46f2('0xf')](function(_0x404187){if(_0x404187){if(_0x404187['modernAuthentication']){_0x404187[_0x46f2('0x8c')]=_0x404187[_0x46f2('0x8a')][_0x46f2('0x8b')];_0x33f3a1=sanitizeRemoteUri(_0x404187[_0x46f2('0x8a')][_0x46f2('0x8d')]);_0x325fb2=getWebApiUrl(_0x33f3a1);return _0x404187;}_0x33f3a1=sanitizeRemoteUri(_0x404187['remoteUri']);_0x325fb2=getWebApiUrl(_0x33f3a1);var _0x587d43={'method':_0x46f2('0x8e'),'uri':'https://login.microsoftonline.com/'+_0x404187[_0x46f2('0x87')]+_0x46f2('0x8f'),'form':{'client_id':_0x404187[_0x46f2('0x88')],'resource':_0x33f3a1,'username':_0x404187['username'],'password':_0x404187['password'],'grant_type':'password','client_secret':_0x404187['clientSecret']},'json':!![]};return rp(_0x587d43);}})['then'](function(_0x6c4681){_0x58502c=_0x6c4681['access_token'];var _0x51fb03={'method':_0x46f2('0x90'),'uri':encodeURI(_0x325fb2+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5d52ab+'\x27'),'headers':{'Authorization':_0x46f2('0x91')+_0x58502c,'If-None-Match':null,'OData-Version':_0x46f2('0x92')},'json':!![]};return rp(_0x51fb03);})[_0x46f2('0xf')](function(_0x3c64f1){var _0x5ddcdf=_0x3c64f1[_0x46f2('0x93')][0x0];var _0x46947a=_0x5ddcdf['MetadataId'];var _0x5dc1c7={'method':_0x46f2('0x90'),'uri':_0x325fb2+_0x46f2('0x94')+_0x46947a+_0x46f2('0x95'),'headers':{'Authorization':_0x46f2('0x91')+_0x58502c,'If-None-Match':null,'OData-Version':_0x46f2('0x92')},'json':!![]};return rp(_0x5dc1c7);})[_0x46f2('0xf')](function(_0x4f2cf6){_0x11e10b=_0x4f2cf6;_0x1f2801=_0x11e10b['Attributes'];_0x1f2801=_[_0x46f2('0x96')](_0x1f2801,function(_0x4d8105){return!_0x49b924[_0x46f2('0x97')](_0x4d8105[_0x46f2('0x98')]);});var _0x64eca5=[];var _0x42a0e5=[];_0x1f2801[_0x46f2('0x99')](function(_0x37b151){if(_0x37b151['@odata.type']){var _0x76677a=_0x37b151[_0x46f2('0x9a')][_0x46f2('0x41')](_0x37b151[_0x46f2('0x9a')][_0x46f2('0x9b')]('.')+0x1);if(_0x76677a==='PicklistAttributeMetadata'){_0x64eca5[_0x46f2('0x9c')](getSelectList(_0x325fb2,_0x9ab912,_0x42a0e5,_0x11e10b['MetadataId'],_0x37b151[_0x46f2('0x9d')],_0x58502c));}}});return Promise[_0x46f2('0x9e')](_0x64eca5);})['then'](function(_0x2f17dd){_0x54d689=_0x2f17dd[0x0];var _0x3463ae=[];var _0x38791f=[];_0x1f2801[_0x46f2('0x99')](function(_0x2f583d){if(!_['isNil'](_0x2f583d[_0x46f2('0x9a')])){var _0x5692f7=_0x2f583d[_0x46f2('0x9a')][_0x46f2('0x41')](_0x2f583d[_0x46f2('0x9a')][_0x46f2('0x9b')]('.')+0x1);if(_0x5692f7===_0x46f2('0x9f')){_0x3463ae[_0x46f2('0x9c')](getBooleanList(_0x325fb2,_0x9ab912,_0x38791f,_0x11e10b[_0x46f2('0x9d')],_0x2f583d[_0x46f2('0x9d')],_0x58502c));}}});return Promise['all'](_0x3463ae);})[_0x46f2('0xf')](function(_0x2a6e89){_0x76b230=_0x2a6e89[0x0];var _0x51a89c=[];var _0x4fe4a2=[];_0x1f2801[_0x46f2('0x99')](function(_0x3a0269){if(_0x3a0269[_0x46f2('0x9a')]){var _0x326baf=_0x3a0269[_0x46f2('0x9a')][_0x46f2('0x41')](_0x3a0269[_0x46f2('0x9a')]['lastIndexOf']('.')+0x1);if(_0x326baf===_0x46f2('0xa0')||_0x326baf===_0x46f2('0xa1')||_0x326baf===_0x46f2('0xa2')||_0x326baf===_0x46f2('0xa3')||_0x326baf==='MemoAttributeMetadata'||_0x326baf===_0x46f2('0xa4')||_0x326baf===_0x46f2('0xa5')||_0x326baf==='EntityNameAttributeMetadata'||_0x326baf==='StateAttributeMetadata'||_0x326baf===_0x46f2('0xa6')){_0x51a89c[_0x46f2('0x9c')](getInputList(_0x325fb2,_0x9ab912,_0x326baf,_0x4fe4a2,_0x11e10b[_0x46f2('0x9d')],_0x3a0269[_0x46f2('0x9d')],_0x58502c));}}});return Promise[_0x46f2('0x9e')](_0x51a89c);})['then'](function(_0x2548d5){_0x47021e=_0x2548d5[0x0];var _0x157c4a=_0x54d689[_0x46f2('0x84')](_0x76b230)[_0x46f2('0x84')](_0x47021e);var _0x5a66dd={'count':_0x157c4a[_0x46f2('0x30')],'rows':_0x157c4a};return _0x5a66dd;})[_0x46f2('0xf')](respondWithResult(_0x28573b,null))[_0x46f2('0x2e')](function(_0x9d6dd4){var _0x4056b3=_0x455a35[_0x46f2('0x1c')][_0x46f2('0xa7')]?0x1f4:_0x9d6dd4[_0x46f2('0xa8')]||0x1f4;logger[_0x46f2('0x13')](_0x9d6dd4[_0x46f2('0x14')]);delete _0x9d6dd4[_0x46f2('0x15')];if(_0x4056b3===0x191){_0x4056b3=0x190;}_0x28573b[_0x46f2('0x6')](_0x4056b3)['send'](_0x455a35[_0x46f2('0x1c')][_0x46f2('0xa7')]?{'message':_0x46f2('0xa9'),'statusCode':_0x9d6dd4['statusCode']}:_0x9d6dd4);});};function getSelectList(_0x387e30,_0x32ae89,_0x1bf98f,_0x31513b,_0x4c6bec,_0x1e955b){var _0x2c719b={'method':_0x46f2('0x90'),'uri':_0x387e30+_0x46f2('0x94')+_0x31513b+_0x46f2('0xaa')+_0x4c6bec+_0x46f2('0xab')+_0x46f2('0xac'),'headers':{'Authorization':_0x46f2('0x91')+_0x1e955b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2c719b)[_0x46f2('0xf')](function(_0xb45e0a){var _0xc5ac25=[];var _0x155d22=_0xb45e0a[_0x46f2('0xad')][_0x46f2('0xae')];_0x155d22['forEach'](function(_0x2afcdd){_0xc5ac25[_0x46f2('0x9c')]({'name':_0x2afcdd[_0x46f2('0xaf')][_0x46f2('0xb0')][_0x46f2('0xaf')],'value':String(_0x2afcdd[_0x46f2('0xb1')])});});var _0x4df563={'id':_0x32ae89+'_'+_0xb45e0a['LogicalName'],'name':_0xb45e0a['DisplayName'][_0x46f2('0xb0')]['Label'],'custom':![],'options':_0xc5ac25};_0x1bf98f['push'](_0x4df563);return _0x1bf98f;});}function getBooleanList(_0x4c3845,_0x3ce2d3,_0x37e0fb,_0x42bdd0,_0x454f50,_0x4020c6){var _0x5a3496={'method':_0x46f2('0x90'),'uri':_0x4c3845+_0x46f2('0x94')+_0x42bdd0+_0x46f2('0xaa')+_0x454f50+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x46f2('0x91')+_0x4020c6,'If-None-Match':null,'OData-Version':_0x46f2('0x92')},'json':!![]};return rp(_0x5a3496)[_0x46f2('0xf')](function(_0x2f41a){var _0x56a30c=[];_0x56a30c[_0x46f2('0x9c')]({'name':_0x2f41a['OptionSet']['TrueOption'][_0x46f2('0xaf')][_0x46f2('0xb0')][_0x46f2('0xaf')],'value':_0x46f2('0xb2')},{'name':_0x2f41a[_0x46f2('0xad')][_0x46f2('0xb3')]['Label']['UserLocalizedLabel'][_0x46f2('0xaf')],'value':'false'});var _0x3c71f2={'id':_0x3ce2d3+'_'+_0x2f41a['LogicalName'],'name':_0x2f41a['DisplayName'][_0x46f2('0xb0')]['Label'],'custom':![],'options':_0x56a30c};_0x37e0fb['push'](_0x3c71f2);return _0x37e0fb;});}function getInputList(_0x2196b6,_0x3abfdc,_0x401718,_0x49cdda,_0x2a6a8e,_0x168dcc,_0x122774){var _0x48385b={'method':_0x46f2('0x90'),'uri':_0x2196b6+'EntityDefinitions('+_0x2a6a8e+_0x46f2('0xaa')+_0x168dcc+')/Microsoft.Dynamics.CRM.'+_0x401718+_0x46f2('0xb4'),'headers':{'Authorization':_0x46f2('0x91')+_0x122774,'If-None-Match':null,'OData-Version':_0x46f2('0x92')},'json':!![]};return rp(_0x48385b)['then'](function(_0x4a5315){var _0x2cd9f7={'id':_0x3abfdc+'_'+_0x4a5315[_0x46f2('0x98')],'name':_0x4a5315[_0x46f2('0xb5')]['UserLocalizedLabel']?_0x4a5315[_0x46f2('0xb5')]['UserLocalizedLabel'][_0x46f2('0xaf')]:_0x4a5315['LogicalName'],'custom':![],'options':[]};_0x49cdda['push'](_0x2cd9f7);return _0x49cdda;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c6a209a..918bfce 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(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 180a6e9..5df9d65 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 _0xbd4b=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','include','model','map','GetDynamics365Account','then','ShowDynamics365Account','stringify','lodash','util','moment','bluebird'];(function(_0x58ddca,_0x93f4e){var _0x9ca931=function(_0x148e0d){while(--_0x148e0d){_0x58ddca['push'](_0x58ddca['shift']());}};_0x9ca931(++_0x93f4e);}(_0xbd4b,0xff));var _0xbbd4=function(_0x3818f9,_0x22664f){_0x3818f9=_0x3818f9-0x0;var _0x4d40cb=_0xbd4b[_0x3818f9];return _0x4d40cb;};'use strict';var _=require(_0xbbd4('0x0'));var util=require(_0xbbd4('0x1'));var moment=require(_0xbbd4('0x2'));var BPromise=require(_0xbbd4('0x3'));var rs=require(_0xbbd4('0x4'));var fs=require('fs');var Redis=require(_0xbbd4('0x5'));var db=require(_0xbbd4('0x6'))['db'];var utils=require(_0xbbd4('0x7'));var logger=require('../../config/logger')(_0xbbd4('0x8'));var config=require(_0xbbd4('0x9'));var jayson=require(_0xbbd4('0xa'));var client=jayson[_0xbbd4('0xb')][_0xbbd4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c4346,_0x5c5bd8,_0x4f9600){return new BPromise(function(_0xad26d3,_0x45d58e){return client[_0xbbd4('0xd')](_0x2c4346,_0x4f9600)['then'](function(_0x153796){logger['info'](_0xbbd4('0xe'),_0x5c5bd8,_0xbbd4('0xf'));logger[_0xbbd4('0x10')](_0xbbd4('0x11'),_0x5c5bd8,_0xbbd4('0xf'),JSON['stringify'](_0x153796));if(_0x153796['error']){if(_0x153796['error'][_0xbbd4('0x12')]===0x1f4){logger[_0xbbd4('0x13')](_0xbbd4('0xe'),_0x5c5bd8,_0x153796[_0xbbd4('0x13')]['message']);return _0x45d58e(_0x153796[_0xbbd4('0x13')]['message']);}logger[_0xbbd4('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x5c5bd8,_0x153796[_0xbbd4('0x13')][_0xbbd4('0x14')]);return _0xad26d3(_0x153796['error'][_0xbbd4('0x14')]);}else{logger[_0xbbd4('0x15')](_0xbbd4('0xe'),_0x5c5bd8,_0xbbd4('0xf'));_0xad26d3(_0x153796[_0xbbd4('0x16')][_0xbbd4('0x14')]);}})[_0xbbd4('0x17')](function(_0x72ddda){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5c5bd8,_0x72ddda);_0x45d58e(_0x72ddda);});});}exports['GetDynamics365Account']=function(_0x3ca0be){var _0x12a4dc=this;return new Promise(function(_0x46689c,_0x34978a){return db[_0xbbd4('0x18')][_0xbbd4('0x19')]({'raw':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be[_0xbbd4('0x1a')][_0xbbd4('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be['options'][_0xbbd4('0x1c')]||null:null,'attributes':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be['options'][_0xbbd4('0x1d')]||null:null,'limit':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be[_0xbbd4('0x1a')]['limit']||null:null,'include':_0x3ca0be['options']?_0x3ca0be[_0xbbd4('0x1a')][_0xbbd4('0x1e')]?_['map'](_0x3ca0be[_0xbbd4('0x1a')][_0xbbd4('0x1e')],function(_0x1d8425){return{'model':db[_0x1d8425[_0xbbd4('0x1f')]],'as':_0x1d8425['as'],'attributes':_0x1d8425['attributes'],'include':_0x1d8425[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x1d8425['include'],function(_0x2adf17){return{'model':db[_0x2adf17[_0xbbd4('0x1f')]],'as':_0x2adf17['as'],'attributes':_0x2adf17[_0xbbd4('0x1d')],'include':_0x2adf17[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x2adf17[_0xbbd4('0x1e')],function(_0x3e84b6){return{'model':db[_0x3e84b6[_0xbbd4('0x1f')]],'as':_0x3e84b6['as'],'attributes':_0x3e84b6[_0xbbd4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45d610){logger[_0xbbd4('0x15')](_0xbbd4('0x21'),_0x3ca0be);logger[_0xbbd4('0x10')](_0xbbd4('0x21'),_0x3ca0be,JSON['stringify'](_0x45d610));_0x46689c(_0x45d610);})[_0xbbd4('0x17')](function(_0x36e01d){logger['error']('GetDynamics365Account',_0x36e01d[_0xbbd4('0x14')],_0x3ca0be);_0x34978a(_0x12a4dc[_0xbbd4('0x13')](0x1f4,_0x36e01d['message']));});});};exports['ShowDynamics365Account']=function(_0x1e15ad){var _0x484c80=this;return new Promise(function(_0x3e4e06,_0x40eb22){return db[_0xbbd4('0x18')]['find']({'raw':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1c')]||null:null,'attributes':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1d')]||null:null,'include':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')]['include']?_[_0xbbd4('0x20')](_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1e')],function(_0x4d9ec4){return{'model':db[_0x4d9ec4[_0xbbd4('0x1f')]],'as':_0x4d9ec4['as'],'attributes':_0x4d9ec4[_0xbbd4('0x1d')],'include':_0x4d9ec4[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x4d9ec4['include'],function(_0x2e997d){return{'model':db[_0x2e997d[_0xbbd4('0x1f')]],'as':_0x2e997d['as'],'attributes':_0x2e997d[_0xbbd4('0x1d')],'include':_0x2e997d[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x2e997d[_0xbbd4('0x1e')],function(_0x27934a){return{'model':db[_0x27934a[_0xbbd4('0x1f')]],'as':_0x27934a['as'],'attributes':_0x27934a[_0xbbd4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x22')](function(_0x55660a){logger['info']('ShowDynamics365Account',_0x1e15ad);logger[_0xbbd4('0x10')](_0xbbd4('0x23'),_0x1e15ad,JSON[_0xbbd4('0x24')](_0x55660a));_0x3e4e06(_0x55660a);})[_0xbbd4('0x17')](function(_0x48b0e5){logger[_0xbbd4('0x13')](_0xbbd4('0x23'),_0x48b0e5[_0xbbd4('0x14')],_0x1e15ad);_0x40eb22(_0x484c80[_0xbbd4('0x13')](0x1f4,_0x48b0e5[_0xbbd4('0x14')]));});});}; \ No newline at end of file +var _0x6b37=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','include','map','model','attributes','find','where','ShowDynamics365Account','lodash'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0x6b37,0xd1));var _0x76b3=function(_0x2eebc2,_0x54ef7c){_0x2eebc2=_0x2eebc2-0x0;var _0x4153a1=_0x6b37[_0x2eebc2];return _0x4153a1;};'use strict';var _=require(_0x76b3('0x0'));var util=require(_0x76b3('0x1'));var moment=require(_0x76b3('0x2'));var BPromise=require(_0x76b3('0x3'));var rs=require(_0x76b3('0x4'));var fs=require('fs');var Redis=require(_0x76b3('0x5'));var db=require(_0x76b3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x76b3('0x7'))(_0x76b3('0x8'));var config=require(_0x76b3('0x9'));var jayson=require(_0x76b3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c221,_0x42a16b,_0x27e08){return new BPromise(function(_0x1c387c,_0x405ac7){return client['request'](_0x36c221,_0x27e08)[_0x76b3('0xb')](function(_0x17a961){logger['info'](_0x76b3('0xc'),_0x42a16b,_0x76b3('0xd'));logger[_0x76b3('0xe')](_0x76b3('0xf'),_0x42a16b,'request\x20sent',JSON[_0x76b3('0x10')](_0x17a961));if(_0x17a961[_0x76b3('0x11')]){if(_0x17a961[_0x76b3('0x11')][_0x76b3('0x12')]===0x1f4){logger[_0x76b3('0x11')](_0x76b3('0xc'),_0x42a16b,_0x17a961['error'][_0x76b3('0x13')]);return _0x405ac7(_0x17a961[_0x76b3('0x11')]['message']);}logger[_0x76b3('0x11')](_0x76b3('0xc'),_0x42a16b,_0x17a961[_0x76b3('0x11')][_0x76b3('0x13')]);return _0x1c387c(_0x17a961[_0x76b3('0x11')][_0x76b3('0x13')]);}else{logger[_0x76b3('0x14')](_0x76b3('0xc'),_0x42a16b,_0x76b3('0xd'));_0x1c387c(_0x17a961[_0x76b3('0x15')][_0x76b3('0x13')]);}})[_0x76b3('0x16')](function(_0x4286f1){logger['error'](_0x76b3('0xc'),_0x42a16b,_0x4286f1);_0x405ac7(_0x4286f1);});});}exports[_0x76b3('0x17')]=function(_0x5f437e){var _0x45c661=this;return new Promise(function(_0x96993a,_0x4cc86c){return db[_0x76b3('0x18')][_0x76b3('0x19')]({'raw':_0x5f437e[_0x76b3('0x1a')]?_0x5f437e[_0x76b3('0x1a')][_0x76b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f437e['options']?_0x5f437e[_0x76b3('0x1a')]['where']||null:null,'attributes':_0x5f437e['options']?_0x5f437e['options']['attributes']||null:null,'limit':_0x5f437e['options']?_0x5f437e[_0x76b3('0x1a')]['limit']||null:null,'include':_0x5f437e[_0x76b3('0x1a')]?_0x5f437e[_0x76b3('0x1a')][_0x76b3('0x1c')]?_[_0x76b3('0x1d')](_0x5f437e[_0x76b3('0x1a')]['include'],function(_0x39b1e8){return{'model':db[_0x39b1e8[_0x76b3('0x1e')]],'as':_0x39b1e8['as'],'attributes':_0x39b1e8[_0x76b3('0x1f')],'include':_0x39b1e8[_0x76b3('0x1c')]?_[_0x76b3('0x1d')](_0x39b1e8[_0x76b3('0x1c')],function(_0x4fc0a3){return{'model':db[_0x4fc0a3[_0x76b3('0x1e')]],'as':_0x4fc0a3['as'],'attributes':_0x4fc0a3['attributes'],'include':_0x4fc0a3['include']?_[_0x76b3('0x1d')](_0x4fc0a3[_0x76b3('0x1c')],function(_0x3de51f){return{'model':db[_0x3de51f[_0x76b3('0x1e')]],'as':_0x3de51f['as'],'attributes':_0x3de51f[_0x76b3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x76b3('0xb')](function(_0x36655f){logger[_0x76b3('0x14')]('GetDynamics365Account',_0x5f437e);logger[_0x76b3('0xe')]('GetDynamics365Account',_0x5f437e,JSON['stringify'](_0x36655f));_0x96993a(_0x36655f);})[_0x76b3('0x16')](function(_0x308ee5){logger['error'](_0x76b3('0x17'),_0x308ee5[_0x76b3('0x13')],_0x5f437e);_0x4cc86c(_0x45c661['error'](0x1f4,_0x308ee5['message']));});});};exports['ShowDynamics365Account']=function(_0x40c5f8){var _0x1b7ac0=this;return new Promise(function(_0x3ef7f1,_0x2f5593){return db[_0x76b3('0x18')][_0x76b3('0x20')]({'raw':_0x40c5f8[_0x76b3('0x1a')]?_0x40c5f8[_0x76b3('0x1a')][_0x76b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x40c5f8[_0x76b3('0x1a')]?_0x40c5f8[_0x76b3('0x1a')][_0x76b3('0x21')]||null:null,'attributes':_0x40c5f8[_0x76b3('0x1a')]?_0x40c5f8[_0x76b3('0x1a')]['attributes']||null:null,'include':_0x40c5f8[_0x76b3('0x1a')]?_0x40c5f8[_0x76b3('0x1a')][_0x76b3('0x1c')]?_['map'](_0x40c5f8[_0x76b3('0x1a')][_0x76b3('0x1c')],function(_0x53bcb4){return{'model':db[_0x53bcb4[_0x76b3('0x1e')]],'as':_0x53bcb4['as'],'attributes':_0x53bcb4[_0x76b3('0x1f')],'include':_0x53bcb4[_0x76b3('0x1c')]?_[_0x76b3('0x1d')](_0x53bcb4[_0x76b3('0x1c')],function(_0x53b23d){return{'model':db[_0x53b23d['model']],'as':_0x53b23d['as'],'attributes':_0x53b23d[_0x76b3('0x1f')],'include':_0x53b23d[_0x76b3('0x1c')]?_[_0x76b3('0x1d')](_0x53b23d['include'],function(_0x54cd44){return{'model':db[_0x54cd44[_0x76b3('0x1e')]],'as':_0x54cd44['as'],'attributes':_0x54cd44[_0x76b3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42d286){logger['info']('ShowDynamics365Account',_0x40c5f8);logger[_0x76b3('0xe')](_0x76b3('0x22'),_0x40c5f8,JSON['stringify'](_0x42d286));_0x3ef7f1(_0x42d286);})[_0x76b3('0x16')](function(_0xe21a8b){logger[_0x76b3('0x11')](_0x76b3('0x22'),_0xe21a8b['message'],_0x40c5f8);_0x2f5593(_0x1b7ac0[_0x76b3('0x11')](0x1f4,_0xe21a8b[_0x76b3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3b8d5b0..afcd3cd 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 _0x6d2d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','path','connect-timeout','express','fs-extra'];(function(_0x56dd7e,_0x2df7ed){var _0x238da6=function(_0x156191){while(--_0x156191){_0x56dd7e['push'](_0x56dd7e['shift']());}};_0x238da6(++_0x2df7ed);}(_0x6d2d,0xbc));var _0xd6d2=function(_0xf2d715,_0x46b278){_0xf2d715=_0xf2d715-0x0;var _0x3f84b4=_0x6d2d[_0xf2d715];return _0x3f84b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd6d2('0x0'));var timeout=require(_0xd6d2('0x1'));var express=require(_0xd6d2('0x2'));var router=express['Router']();var fs_extra=require(_0xd6d2('0x3'));var auth=require(_0xd6d2('0x4'));var interaction=require(_0xd6d2('0x5'));var config=require(_0xd6d2('0x6'));var controller=require(_0xd6d2('0x7'));router[_0xd6d2('0x8')]('/',auth[_0xd6d2('0x9')](),controller[_0xd6d2('0xa')]);router['get'](_0xd6d2('0xb'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0xc')]);router['get'](_0xd6d2('0xd'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0xe')]);router[_0xd6d2('0x8')](_0xd6d2('0xf'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x10')]);router[_0xd6d2('0x8')]('/:id/descriptions',auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x11')]);router[_0xd6d2('0x12')]('/',auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x13')]);router[_0xd6d2('0x14')](_0xd6d2('0xb'),auth['isAuthenticated'](),controller[_0xd6d2('0x15')]);router[_0xd6d2('0x16')](_0xd6d2('0xb'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x17')]);module['exports']=router; \ No newline at end of file +var _0x57c3=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x17f59b,_0x1bc462){var _0x1bd4d8=function(_0xbe97ff){while(--_0xbe97ff){_0x17f59b['push'](_0x17f59b['shift']());}};_0x1bd4d8(++_0x1bc462);}(_0x57c3,0xc2));var _0x357c=function(_0x48f972,_0x4f3f1f){_0x48f972=_0x48f972-0x0;var _0x205413=_0x57c3[_0x48f972];return _0x205413;};'use strict';var multer=require(_0x357c('0x0'));var util=require(_0x357c('0x1'));var path=require(_0x357c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x357c('0x3'));var auth=require(_0x357c('0x4'));var interaction=require(_0x357c('0x5'));var config=require(_0x357c('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0x357c('0x7')]('/',auth['isAuthenticated'](),controller[_0x357c('0x8')]);router[_0x357c('0x7')](_0x357c('0x9'),auth[_0x357c('0xa')](),controller[_0x357c('0xb')]);router[_0x357c('0x7')](_0x357c('0xc'),auth['isAuthenticated'](),controller[_0x357c('0xd')]);router[_0x357c('0x7')](_0x357c('0xe'),auth[_0x357c('0xa')](),controller[_0x357c('0xf')]);router[_0x357c('0x7')](_0x357c('0x10'),auth[_0x357c('0xa')](),controller[_0x357c('0x11')]);router[_0x357c('0x12')]('/',auth[_0x357c('0xa')](),controller[_0x357c('0x13')]);router['put'](_0x357c('0x9'),auth[_0x357c('0xa')](),controller[_0x357c('0x14')]);router['delete']('/:id',auth[_0x357c('0xa')](),controller[_0x357c('0x15')]);module[_0x357c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index ce6d7b4..c08b4d6 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 _0x15f5=['ENUM','incident','contact','nothing','STRING'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x15f5,0x1cb));var _0x515f=function(_0x2576fb,_0x3fea61){_0x2576fb=_0x2576fb-0x0;var _0x1e07f4=_0x15f5[_0x2576fb];return _0x1e07f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x515f('0x0')]},'description':{'type':Sequelize[_0x515f('0x0')]},'ticketType':{'type':Sequelize[_0x515f('0x1')](_0x515f('0x2'),'phonecall'),'defaultValue':_0x515f('0x2')},'moduleCreate':{'type':Sequelize[_0x515f('0x1')](_0x515f('0x3'),_0x515f('0x4')),'defaultValue':_0x515f('0x3'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xee28=['BOOLEAN','sequelize','exports','STRING','incident','phonecall','ENUM','contact','nothing'];(function(_0x2db9e5,_0x5c7696){var _0x7cfc6=function(_0x46e27a){while(--_0x46e27a){_0x2db9e5['push'](_0x2db9e5['shift']());}};_0x7cfc6(++_0x5c7696);}(_0xee28,0x7f));var _0x8ee2=function(_0x54a02e,_0x57e5df){_0x54a02e=_0x54a02e-0x0;var _0x32e842=_0xee28[_0x54a02e];return _0x32e842;};'use strict';var Sequelize=require(_0x8ee2('0x0'));module[_0x8ee2('0x1')]={'name':{'type':Sequelize[_0x8ee2('0x2')]},'description':{'type':Sequelize[_0x8ee2('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x8ee2('0x3'),_0x8ee2('0x4')),'defaultValue':_0x8ee2('0x3')},'moduleCreate':{'type':Sequelize[_0x8ee2('0x5')](_0x8ee2('0x6'),_0x8ee2('0x7')),'defaultValue':_0x8ee2('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x8ee2('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x8ee2('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 5e765fa..1cc9cd1 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 _0xf476=['api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','error','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','then','rows','catch','show','params','intersection','include','find','create','body','getFields','Dynamics365Field','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4f912d,_0x85fc6){var _0x4ab3a2=function(_0x156fdd){while(--_0x156fdd){_0x4f912d['push'](_0x4f912d['shift']());}};_0x4ab3a2(++_0x85fc6);}(_0xf476,0x1d0));var _0x6f47=function(_0x596837,_0x211bd3){_0x596837=_0x596837-0x0;var _0x3835c4=_0xf476[_0x596837];return _0x3835c4;};'use strict';var emlformat=require(_0x6f47('0x0'));var rimraf=require(_0x6f47('0x1'));var zipdir=require(_0x6f47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f47('0x3'));var moment=require(_0x6f47('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f47('0x5'));var path=require(_0x6f47('0x6'));var sox=require(_0x6f47('0x7'));var csv=require(_0x6f47('0x8'));var ejs=require(_0x6f47('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f47('0xa'));var squel=require(_0x6f47('0xb'));var crypto=require(_0x6f47('0xc'));var jsforce=require(_0x6f47('0xd'));var deskjs=require(_0x6f47('0xe'));var toCsv=require(_0x6f47('0x8'));var querystring=require(_0x6f47('0xf'));var Papa=require(_0x6f47('0x10'));var Redis=require(_0x6f47('0x11'));var authService=require(_0x6f47('0x12'));var qs=require(_0x6f47('0x13'));var as=require(_0x6f47('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f47('0x15'))(_0x6f47('0x16'));var utils=require(_0x6f47('0x17'));var config=require(_0x6f47('0x18'));var licenseUtil=require(_0x6f47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49839c,_0x4ad1a5){_0x4ad1a5=_0x4ad1a5||0xcc;return function(_0x49ac79){if(_0x49ac79){return _0x49839c['sendStatus'](_0x4ad1a5);}return _0x49839c[_0x6f47('0x1a')](_0x4ad1a5)[_0x6f47('0x1b')]();};}function respondWithResult(_0x30ea6f,_0x382fa1){_0x382fa1=_0x382fa1||0xc8;return function(_0xfb372b){if(_0xfb372b){return _0x30ea6f['status'](_0x382fa1)['json'](_0xfb372b);}};}function respondWithFilteredResult(_0x534467,_0x64a019){return function(_0x50e5bd){if(_0x50e5bd){var _0x525532=typeof _0x64a019['offset']===_0x6f47('0x1c')&&typeof _0x64a019[_0x6f47('0x1d')]==='undefined';var _0x2f395d=_0x50e5bd[_0x6f47('0x1e')];var _0x5f5a89=_0x525532?0x0:_0x64a019['offset'];var _0x30443d=_0x525532?_0x50e5bd[_0x6f47('0x1e')]:_0x64a019[_0x6f47('0x1f')]+_0x64a019['limit'];var _0x36f549;if(_0x30443d>=_0x2f395d){_0x30443d=_0x2f395d;_0x36f549=0xc8;}else{_0x36f549=0xce;}_0x534467[_0x6f47('0x1a')](_0x36f549);return _0x534467['set'](_0x6f47('0x20'),_0x5f5a89+'-'+_0x30443d+'/'+_0x2f395d)['json'](_0x50e5bd);}return null;};}function patchUpdates(_0x413745){return function(_0x13ca98){try{jsonpatch[_0x6f47('0x21')](_0x13ca98,_0x413745,!![]);}catch(_0x5ef92b){return BPromise[_0x6f47('0x22')](_0x5ef92b);}return _0x13ca98[_0x6f47('0x23')]();};}function saveUpdates(_0x114803,_0x456af3){return function(_0x870af3){if(_0x870af3){return _0x870af3[_0x6f47('0x24')](_0x114803)['then'](function(_0x23b695){return _0x23b695;});}return null;};}function removeEntity(_0x32a4cb,_0x28ecc8){return function(_0x4a0cd9){if(_0x4a0cd9){return _0x4a0cd9[_0x6f47('0x25')]()['then'](function(){_0x32a4cb[_0x6f47('0x1a')](0xcc)[_0x6f47('0x1b')]();});}};}function handleEntityNotFound(_0x3b57fc,_0x13897c){return function(_0x40fd2a){if(!_0x40fd2a){_0x3b57fc[_0x6f47('0x26')](0x194);}return _0x40fd2a;};}function handleError(_0x17b356,_0x2fea4a){_0x2fea4a=_0x2fea4a||0x1f4;return function(_0xe3540c){logger[_0x6f47('0x27')](_0xe3540c['stack']);if(_0xe3540c['name']){delete _0xe3540c[_0x6f47('0x28')];}_0x17b356[_0x6f47('0x1a')](_0x2fea4a)[_0x6f47('0x29')](_0xe3540c);};}exports[_0x6f47('0x2a')]=function(_0x378e8e,_0x624c7f){var _0xf9ff13={},_0x55a1e6={},_0x4f238a={'count':0x0,'rows':[]};var _0x46e22e=_['map'](db[_0x6f47('0x2b')][_0x6f47('0x2c')],function(_0x40637f){return{'name':_0x40637f[_0x6f47('0x2d')],'type':_0x40637f[_0x6f47('0x2e')]['key']};});_0x55a1e6[_0x6f47('0x2f')]=_[_0x6f47('0x30')](_0x46e22e,_0x6f47('0x28'));_0x55a1e6[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x378e8e['query']);_0x55a1e6[_0x6f47('0x33')]=_['intersection'](_0x55a1e6[_0x6f47('0x2f')],_0x55a1e6[_0x6f47('0x31')]);_0xf9ff13[_0x6f47('0x34')]=_['intersection'](_0x55a1e6[_0x6f47('0x2f')],qs[_0x6f47('0x35')](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x35')]));_0xf9ff13[_0x6f47('0x34')]=_0xf9ff13[_0x6f47('0x34')][_0x6f47('0x36')]?_0xf9ff13['attributes']:_0x55a1e6[_0x6f47('0x2f')];if(!_0x378e8e[_0x6f47('0x31')][_0x6f47('0x37')](_0x6f47('0x38'))){_0xf9ff13[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x1d')]);_0xf9ff13[_0x6f47('0x1f')]=qs[_0x6f47('0x1f')](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x1f')]);}_0xf9ff13[_0x6f47('0x39')]=qs['sort'](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x3a')]);_0xf9ff13[_0x6f47('0x3b')]=qs[_0x6f47('0x33')](_['pick'](_0x378e8e[_0x6f47('0x31')],_0x55a1e6[_0x6f47('0x33')]),_0x46e22e);if(_0x378e8e[_0x6f47('0x31')][_0x6f47('0x3c')]){_0xf9ff13[_0x6f47('0x3b')]=_['merge'](_0xf9ff13[_0x6f47('0x3b')],{'$or':_['map'](_0x46e22e,function(_0x56e0a4){if(_0x56e0a4[_0x6f47('0x2e')]!==_0x6f47('0x3d')){var _0x2c47d8={};_0x2c47d8[_0x56e0a4['name']]={'$like':'%'+_0x378e8e['query'][_0x6f47('0x3c')]+'%'};return _0x2c47d8;}})});}_0xf9ff13=_[_0x6f47('0x3e')]({},_0xf9ff13,_0x378e8e[_0x6f47('0x3f')]);var _0x35e64f={'where':_0xf9ff13[_0x6f47('0x3b')]};return db[_0x6f47('0x2b')]['count'](_0x35e64f)['then'](function(_0x453a30){_0x4f238a[_0x6f47('0x1e')]=_0x453a30;if(_0x378e8e[_0x6f47('0x31')][_0x6f47('0x40')]){_0xf9ff13['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0xf9ff13);})[_0x6f47('0x41')](function(_0x814b38){_0x4f238a[_0x6f47('0x42')]=_0x814b38;return _0x4f238a;})[_0x6f47('0x41')](respondWithFilteredResult(_0x624c7f,_0xf9ff13))[_0x6f47('0x43')](handleError(_0x624c7f,null));};exports[_0x6f47('0x44')]=function(_0x5d3aaf,_0x4bd161){var _0x140d95={'raw':![],'where':{'id':_0x5d3aaf[_0x6f47('0x45')]['id']}},_0x5b127d={};_0x5b127d[_0x6f47('0x2f')]=_[_0x6f47('0x32')](db[_0x6f47('0x2b')][_0x6f47('0x2c')]);_0x5b127d[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x5d3aaf[_0x6f47('0x31')]);_0x5b127d[_0x6f47('0x33')]=_[_0x6f47('0x46')](_0x5b127d['model'],_0x5b127d[_0x6f47('0x31')]);_0x140d95[_0x6f47('0x34')]=_[_0x6f47('0x46')](_0x5b127d[_0x6f47('0x2f')],qs['fields'](_0x5d3aaf[_0x6f47('0x31')][_0x6f47('0x35')]));_0x140d95['attributes']=_0x140d95[_0x6f47('0x34')][_0x6f47('0x36')]?_0x140d95[_0x6f47('0x34')]:_0x5b127d[_0x6f47('0x2f')];if(_0x5d3aaf[_0x6f47('0x31')][_0x6f47('0x40')]){_0x140d95[_0x6f47('0x47')]=[{'all':!![]}];}_0x140d95=_['merge']({},_0x140d95,_0x5d3aaf[_0x6f47('0x3f')]);return db[_0x6f47('0x2b')][_0x6f47('0x48')](_0x140d95)[_0x6f47('0x41')](handleEntityNotFound(_0x4bd161,null))[_0x6f47('0x41')](respondWithResult(_0x4bd161,null))[_0x6f47('0x43')](handleError(_0x4bd161,null));};exports[_0x6f47('0x49')]=function(_0x3659ef,_0x483333){return db['Dynamics365Configuration'][_0x6f47('0x49')](_0x3659ef[_0x6f47('0x4a')],{})[_0x6f47('0x41')](respondWithResult(_0x483333,0xc9))['catch'](handleError(_0x483333,null));};exports['update']=function(_0x3984a4,_0x23d684){if(_0x3984a4[_0x6f47('0x4a')]['id']){delete _0x3984a4[_0x6f47('0x4a')]['id'];}return db['Dynamics365Configuration'][_0x6f47('0x48')]({'where':{'id':_0x3984a4[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x23d684,null))[_0x6f47('0x41')](saveUpdates(_0x3984a4[_0x6f47('0x4a')],null))[_0x6f47('0x41')](respondWithResult(_0x23d684,null))['catch'](handleError(_0x23d684,null));};exports[_0x6f47('0x25')]=function(_0x10213d,_0x4da3f7){return db[_0x6f47('0x2b')][_0x6f47('0x48')]({'where':{'id':_0x10213d[_0x6f47('0x45')]['id']}})['then'](handleEntityNotFound(_0x4da3f7,null))[_0x6f47('0x41')](removeEntity(_0x4da3f7,null))[_0x6f47('0x43')](handleError(_0x4da3f7,null));};exports[_0x6f47('0x4b')]=function(_0xe06365,_0x2e65e1,_0x3df2c0){var _0x3066e1={};var _0x44d6bc={};var _0x186ebe;var _0x13ef17;return db[_0x6f47('0x2b')]['findOne']({'where':{'id':_0xe06365[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x2e65e1,null))[_0x6f47('0x41')](function(_0x51450c){if(_0x51450c){_0x186ebe=_0x51450c;_0x44d6bc[_0x6f47('0x2f')]=_[_0x6f47('0x32')](db[_0x6f47('0x4c')][_0x6f47('0x2c')]);_0x44d6bc['query']=_[_0x6f47('0x32')](_0xe06365[_0x6f47('0x31')]);_0x44d6bc[_0x6f47('0x33')]=_[_0x6f47('0x46')](_0x44d6bc[_0x6f47('0x2f')],_0x44d6bc[_0x6f47('0x31')]);_0x3066e1[_0x6f47('0x34')]=_[_0x6f47('0x46')](_0x44d6bc[_0x6f47('0x2f')],qs[_0x6f47('0x35')](_0xe06365[_0x6f47('0x31')][_0x6f47('0x35')]));_0x3066e1[_0x6f47('0x34')]=_0x3066e1['attributes'][_0x6f47('0x36')]?_0x3066e1[_0x6f47('0x34')]:_0x44d6bc['model'];_0x3066e1[_0x6f47('0x39')]=qs[_0x6f47('0x3a')](_0xe06365[_0x6f47('0x31')][_0x6f47('0x3a')]);_0x3066e1[_0x6f47('0x3b')]=qs[_0x6f47('0x33')](_['pick'](_0xe06365['query'],_0x44d6bc[_0x6f47('0x33')]));if(_0xe06365[_0x6f47('0x31')]['filter']){_0x3066e1['where']=_['merge'](_0x3066e1['where'],{'$or':_[_0x6f47('0x30')](_0x3066e1[_0x6f47('0x34')],function(_0x571f8c){var _0x29610e={};_0x29610e[_0x571f8c]={'$like':'%'+_0xe06365[_0x6f47('0x31')][_0x6f47('0x3c')]+'%'};return _0x29610e;})});}_0x3066e1=_[_0x6f47('0x3e')]({},_0x3066e1,_0xe06365[_0x6f47('0x3f')]);return _0x186ebe[_0x6f47('0x4b')](_0x3066e1);}})[_0x6f47('0x41')](function(_0x5eb7ec){if(_0x5eb7ec){_0x13ef17=_0x5eb7ec[_0x6f47('0x36')];if(!_0xe06365[_0x6f47('0x31')][_0x6f47('0x37')]('nolimit')){_0x3066e1[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0xe06365[_0x6f47('0x31')][_0x6f47('0x1d')]);_0x3066e1[_0x6f47('0x1f')]=qs[_0x6f47('0x1f')](_0xe06365['query'][_0x6f47('0x1f')]);}return _0x186ebe[_0x6f47('0x4b')](_0x3066e1);}})[_0x6f47('0x41')](function(_0x444a85){if(_0x444a85){return _0x444a85?{'count':_0x13ef17,'rows':_0x444a85}:null;}})[_0x6f47('0x41')](respondWithResult(_0x2e65e1,null))[_0x6f47('0x43')](handleError(_0x2e65e1,null));};exports[_0x6f47('0x4d')]=function(_0x1a2ad1,_0x36b6e1,_0x3ddb98){var _0x320a3c={};var _0x2b253d={};var _0x50c9f7;var _0x2c181a;return db[_0x6f47('0x2b')][_0x6f47('0x4e')]({'where':{'id':_0x1a2ad1[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x36b6e1,null))[_0x6f47('0x41')](function(_0x1b1ad7){if(_0x1b1ad7){_0x50c9f7=_0x1b1ad7;_0x2b253d[_0x6f47('0x2f')]=_['keys'](db[_0x6f47('0x4c')][_0x6f47('0x2c')]);_0x2b253d[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x1a2ad1[_0x6f47('0x31')]);_0x2b253d['filters']=_[_0x6f47('0x46')](_0x2b253d[_0x6f47('0x2f')],_0x2b253d['query']);_0x320a3c[_0x6f47('0x34')]=_['intersection'](_0x2b253d[_0x6f47('0x2f')],qs['fields'](_0x1a2ad1[_0x6f47('0x31')]['fields']));_0x320a3c[_0x6f47('0x34')]=_0x320a3c[_0x6f47('0x34')][_0x6f47('0x36')]?_0x320a3c[_0x6f47('0x34')]:_0x2b253d[_0x6f47('0x2f')];_0x320a3c['order']=qs['sort'](_0x1a2ad1[_0x6f47('0x31')][_0x6f47('0x3a')]);_0x320a3c[_0x6f47('0x3b')]=qs['filters'](_[_0x6f47('0x4f')](_0x1a2ad1[_0x6f47('0x31')],_0x2b253d[_0x6f47('0x33')]));if(_0x1a2ad1[_0x6f47('0x31')]['filter']){_0x320a3c[_0x6f47('0x3b')]=_['merge'](_0x320a3c[_0x6f47('0x3b')],{'$or':_['map'](_0x320a3c[_0x6f47('0x34')],function(_0x1a8356){var _0x13e430={};_0x13e430[_0x1a8356]={'$like':'%'+_0x1a2ad1[_0x6f47('0x31')][_0x6f47('0x3c')]+'%'};return _0x13e430;})});}_0x320a3c=_[_0x6f47('0x3e')]({},_0x320a3c,_0x1a2ad1['options']);return _0x50c9f7[_0x6f47('0x4d')](_0x320a3c);}})['then'](function(_0x25352d){if(_0x25352d){_0x2c181a=_0x25352d[_0x6f47('0x36')];if(!_0x1a2ad1[_0x6f47('0x31')][_0x6f47('0x37')](_0x6f47('0x38'))){_0x320a3c[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0x1a2ad1['query']['limit']);_0x320a3c['offset']=qs[_0x6f47('0x1f')](_0x1a2ad1[_0x6f47('0x31')]['offset']);}return _0x50c9f7[_0x6f47('0x4d')](_0x320a3c);}})[_0x6f47('0x41')](function(_0x3ae69e){if(_0x3ae69e){return _0x3ae69e?{'count':_0x2c181a,'rows':_0x3ae69e}:null;}})[_0x6f47('0x41')](respondWithResult(_0x36b6e1,null))[_0x6f47('0x43')](handleError(_0x36b6e1,null));};exports['getDescriptions']=function(_0x178174,_0x56f725,_0x300018){var _0x480758={};var _0x1bbd70={};var _0x34cc79;var _0x306e3f;return db[_0x6f47('0x2b')][_0x6f47('0x4e')]({'where':{'id':_0x178174[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x56f725,null))[_0x6f47('0x41')](function(_0x2c3f7d){if(_0x2c3f7d){_0x34cc79=_0x2c3f7d;_0x1bbd70[_0x6f47('0x2f')]=_['keys'](db[_0x6f47('0x4c')][_0x6f47('0x2c')]);_0x1bbd70[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x178174[_0x6f47('0x31')]);_0x1bbd70[_0x6f47('0x33')]=_['intersection'](_0x1bbd70[_0x6f47('0x2f')],_0x1bbd70['query']);_0x480758[_0x6f47('0x34')]=_[_0x6f47('0x46')](_0x1bbd70[_0x6f47('0x2f')],qs[_0x6f47('0x35')](_0x178174['query'][_0x6f47('0x35')]));_0x480758[_0x6f47('0x34')]=_0x480758[_0x6f47('0x34')][_0x6f47('0x36')]?_0x480758[_0x6f47('0x34')]:_0x1bbd70[_0x6f47('0x2f')];_0x480758[_0x6f47('0x39')]=qs['sort'](_0x178174[_0x6f47('0x31')][_0x6f47('0x3a')]);_0x480758[_0x6f47('0x3b')]=qs[_0x6f47('0x33')](_['pick'](_0x178174[_0x6f47('0x31')],_0x1bbd70[_0x6f47('0x33')]));if(_0x178174[_0x6f47('0x31')][_0x6f47('0x3c')]){_0x480758[_0x6f47('0x3b')]=_[_0x6f47('0x3e')](_0x480758[_0x6f47('0x3b')],{'$or':_[_0x6f47('0x30')](_0x480758[_0x6f47('0x34')],function(_0x10ed74){var _0x83ffe6={};_0x83ffe6[_0x10ed74]={'$like':'%'+_0x178174[_0x6f47('0x31')][_0x6f47('0x3c')]+'%'};return _0x83ffe6;})});}_0x480758=_['merge']({},_0x480758,_0x178174[_0x6f47('0x3f')]);return _0x34cc79[_0x6f47('0x50')](_0x480758);}})[_0x6f47('0x41')](function(_0x1cb9b9){if(_0x1cb9b9){_0x306e3f=_0x1cb9b9[_0x6f47('0x36')];if(!_0x178174[_0x6f47('0x31')][_0x6f47('0x37')](_0x6f47('0x38'))){_0x480758[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0x178174[_0x6f47('0x31')][_0x6f47('0x1d')]);_0x480758[_0x6f47('0x1f')]=qs['offset'](_0x178174[_0x6f47('0x31')][_0x6f47('0x1f')]);}return _0x34cc79[_0x6f47('0x50')](_0x480758);}})[_0x6f47('0x41')](function(_0x2538ae){if(_0x2538ae){return _0x2538ae?{'count':_0x306e3f,'rows':_0x2538ae}:null;}})[_0x6f47('0x41')](respondWithResult(_0x56f725,null))[_0x6f47('0x43')](handleError(_0x56f725,null));}; \ No newline at end of file +var _0xe5cd=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','filter','getSubjects','findOne','Dynamics365Field','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes'];(function(_0x2bd184,_0x2cc971){var _0xb28dc1=function(_0x45a1f0){while(--_0x45a1f0){_0x2bd184['push'](_0x2bd184['shift']());}};_0xb28dc1(++_0x2cc971);}(_0xe5cd,0x76));var _0xde5c=function(_0x2be8bf,_0x3f52a7){_0x2be8bf=_0x2be8bf-0x0;var _0x45f42f=_0xe5cd[_0x2be8bf];return _0x45f42f;};'use strict';var emlformat=require(_0xde5c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xde5c('0x1'));var jsonpatch=require(_0xde5c('0x2'));var rp=require(_0xde5c('0x3'));var moment=require(_0xde5c('0x4'));var BPromise=require(_0xde5c('0x5'));var Mustache=require(_0xde5c('0x6'));var util=require('util');var path=require(_0xde5c('0x7'));var sox=require(_0xde5c('0x8'));var csv=require(_0xde5c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde5c('0xa'));var _=require(_0xde5c('0xb'));var squel=require(_0xde5c('0xc'));var crypto=require(_0xde5c('0xd'));var jsforce=require(_0xde5c('0xe'));var deskjs=require(_0xde5c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xde5c('0x10'));var Papa=require(_0xde5c('0x11'));var Redis=require('ioredis');var authService=require(_0xde5c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde5c('0x13'));var hardwareService=require(_0xde5c('0x14'));var logger=require('../../config/logger')(_0xde5c('0x15'));var utils=require(_0xde5c('0x16'));var config=require(_0xde5c('0x17'));var licenseUtil=require(_0xde5c('0x18'));var db=require(_0xde5c('0x19'))['db'];function respondWithStatusCode(_0x587f60,_0x2ed391){_0x2ed391=_0x2ed391||0xcc;return function(_0x4749c6){if(_0x4749c6){return _0x587f60[_0xde5c('0x1a')](_0x2ed391);}return _0x587f60['status'](_0x2ed391)['end']();};}function respondWithResult(_0x1d7875,_0x48acda){_0x48acda=_0x48acda||0xc8;return function(_0x1689bd){if(_0x1689bd){return _0x1d7875['status'](_0x48acda)[_0xde5c('0x1b')](_0x1689bd);}};}function respondWithFilteredResult(_0x42f7e5,_0x31d82){return function(_0x18135b){if(_0x18135b){var _0x2cb9aa=typeof _0x31d82[_0xde5c('0x1c')]==='undefined'&&typeof _0x31d82[_0xde5c('0x1d')]===_0xde5c('0x1e');var _0x46ddcc=_0x18135b[_0xde5c('0x1f')];var _0x4bf903=_0x2cb9aa?0x0:_0x31d82[_0xde5c('0x1c')];var _0x51683b=_0x2cb9aa?_0x18135b['count']:_0x31d82[_0xde5c('0x1c')]+_0x31d82[_0xde5c('0x1d')];var _0x5aadf5;if(_0x51683b>=_0x46ddcc){_0x51683b=_0x46ddcc;_0x5aadf5=0xc8;}else{_0x5aadf5=0xce;}_0x42f7e5[_0xde5c('0x20')](_0x5aadf5);return _0x42f7e5[_0xde5c('0x21')]('Content-Range',_0x4bf903+'-'+_0x51683b+'/'+_0x46ddcc)[_0xde5c('0x1b')](_0x18135b);}return null;};}function patchUpdates(_0xd7ad1f){return function(_0x5868a0){try{jsonpatch[_0xde5c('0x22')](_0x5868a0,_0xd7ad1f,!![]);}catch(_0x4ce5e9){return BPromise['reject'](_0x4ce5e9);}return _0x5868a0[_0xde5c('0x23')]();};}function saveUpdates(_0x5a75a7,_0x44cf96){return function(_0x19073b){if(_0x19073b){return _0x19073b[_0xde5c('0x24')](_0x5a75a7)[_0xde5c('0x25')](function(_0x2bdac3){return _0x2bdac3;});}return null;};}function removeEntity(_0x374e28,_0x415e4f){return function(_0x4c40ec){if(_0x4c40ec){return _0x4c40ec[_0xde5c('0x26')]()[_0xde5c('0x25')](function(){_0x374e28[_0xde5c('0x20')](0xcc)[_0xde5c('0x27')]();});}};}function handleEntityNotFound(_0x3546ca,_0x5d396a){return function(_0x31fdc1){if(!_0x31fdc1){_0x3546ca[_0xde5c('0x1a')](0x194);}return _0x31fdc1;};}function handleError(_0x51924a,_0x57db52){_0x57db52=_0x57db52||0x1f4;return function(_0x297ec8){logger['error'](_0x297ec8[_0xde5c('0x28')]);if(_0x297ec8[_0xde5c('0x29')]){delete _0x297ec8[_0xde5c('0x29')];}_0x51924a[_0xde5c('0x20')](_0x57db52)[_0xde5c('0x2a')](_0x297ec8);};}exports[_0xde5c('0x2b')]=function(_0x13093f,_0x25aa95){var _0x3d8a2f={},_0x56c562={},_0xd6acd6={'count':0x0,'rows':[]};var _0x192348=_[_0xde5c('0x2c')](db['Dynamics365Configuration'][_0xde5c('0x2d')],function(_0x2cc1ac){return{'name':_0x2cc1ac['fieldName'],'type':_0x2cc1ac[_0xde5c('0x2e')][_0xde5c('0x2f')]};});_0x56c562[_0xde5c('0x30')]=_[_0xde5c('0x2c')](_0x192348,_0xde5c('0x29'));_0x56c562[_0xde5c('0x31')]=_[_0xde5c('0x32')](_0x13093f[_0xde5c('0x31')]);_0x56c562[_0xde5c('0x33')]=_[_0xde5c('0x34')](_0x56c562[_0xde5c('0x30')],_0x56c562[_0xde5c('0x31')]);_0x3d8a2f[_0xde5c('0x35')]=_[_0xde5c('0x34')](_0x56c562[_0xde5c('0x30')],qs[_0xde5c('0x36')](_0x13093f[_0xde5c('0x31')][_0xde5c('0x36')]));_0x3d8a2f[_0xde5c('0x35')]=_0x3d8a2f[_0xde5c('0x35')][_0xde5c('0x37')]?_0x3d8a2f[_0xde5c('0x35')]:_0x56c562['model'];if(!_0x13093f[_0xde5c('0x31')][_0xde5c('0x38')](_0xde5c('0x39'))){_0x3d8a2f[_0xde5c('0x1d')]=qs[_0xde5c('0x1d')](_0x13093f[_0xde5c('0x31')][_0xde5c('0x1d')]);_0x3d8a2f['offset']=qs['offset'](_0x13093f[_0xde5c('0x31')][_0xde5c('0x1c')]);}_0x3d8a2f[_0xde5c('0x3a')]=qs[_0xde5c('0x3b')](_0x13093f[_0xde5c('0x31')][_0xde5c('0x3b')]);_0x3d8a2f['where']=qs['filters'](_[_0xde5c('0x3c')](_0x13093f[_0xde5c('0x31')],_0x56c562[_0xde5c('0x33')]),_0x192348);if(_0x13093f[_0xde5c('0x31')]['filter']){_0x3d8a2f[_0xde5c('0x3d')]=_['merge'](_0x3d8a2f[_0xde5c('0x3d')],{'$or':_['map'](_0x192348,function(_0x4a52bb){if(_0x4a52bb[_0xde5c('0x2e')]!==_0xde5c('0x3e')){var _0x62c1eb={};_0x62c1eb[_0x4a52bb['name']]={'$like':'%'+_0x13093f[_0xde5c('0x31')]['filter']+'%'};return _0x62c1eb;}})});}_0x3d8a2f=_[_0xde5c('0x3f')]({},_0x3d8a2f,_0x13093f[_0xde5c('0x40')]);var _0x10df58={'where':_0x3d8a2f[_0xde5c('0x3d')]};return db[_0xde5c('0x41')][_0xde5c('0x1f')](_0x10df58)[_0xde5c('0x25')](function(_0x57262a){_0xd6acd6[_0xde5c('0x1f')]=_0x57262a;if(_0x13093f[_0xde5c('0x31')][_0xde5c('0x42')]){_0x3d8a2f[_0xde5c('0x43')]=[{'all':!![]}];}return db[_0xde5c('0x41')][_0xde5c('0x44')](_0x3d8a2f);})[_0xde5c('0x25')](function(_0x8bdfe7){_0xd6acd6[_0xde5c('0x45')]=_0x8bdfe7;return _0xd6acd6;})['then'](respondWithFilteredResult(_0x25aa95,_0x3d8a2f))[_0xde5c('0x46')](handleError(_0x25aa95,null));};exports[_0xde5c('0x47')]=function(_0x34113a,_0x3cb9d7){var _0x5921ef={'raw':![],'where':{'id':_0x34113a[_0xde5c('0x48')]['id']}},_0x36ba89={};_0x36ba89[_0xde5c('0x30')]=_[_0xde5c('0x32')](db['Dynamics365Configuration'][_0xde5c('0x2d')]);_0x36ba89[_0xde5c('0x31')]=_['keys'](_0x34113a[_0xde5c('0x31')]);_0x36ba89[_0xde5c('0x33')]=_[_0xde5c('0x34')](_0x36ba89[_0xde5c('0x30')],_0x36ba89[_0xde5c('0x31')]);_0x5921ef[_0xde5c('0x35')]=_[_0xde5c('0x34')](_0x36ba89[_0xde5c('0x30')],qs[_0xde5c('0x36')](_0x34113a[_0xde5c('0x31')][_0xde5c('0x36')]));_0x5921ef[_0xde5c('0x35')]=_0x5921ef[_0xde5c('0x35')][_0xde5c('0x37')]?_0x5921ef[_0xde5c('0x35')]:_0x36ba89[_0xde5c('0x30')];if(_0x34113a['query'][_0xde5c('0x42')]){_0x5921ef[_0xde5c('0x43')]=[{'all':!![]}];}_0x5921ef=_[_0xde5c('0x3f')]({},_0x5921ef,_0x34113a[_0xde5c('0x40')]);return db['Dynamics365Configuration'][_0xde5c('0x49')](_0x5921ef)['then'](handleEntityNotFound(_0x3cb9d7,null))[_0xde5c('0x25')](respondWithResult(_0x3cb9d7,null))[_0xde5c('0x46')](handleError(_0x3cb9d7,null));};exports[_0xde5c('0x4a')]=function(_0x4e1770,_0x2491df){return db[_0xde5c('0x41')]['create'](_0x4e1770['body'],{})[_0xde5c('0x25')](respondWithResult(_0x2491df,0xc9))['catch'](handleError(_0x2491df,null));};exports[_0xde5c('0x24')]=function(_0x2c03ba,_0x9e7a90){if(_0x2c03ba['body']['id']){delete _0x2c03ba['body']['id'];}return db[_0xde5c('0x41')]['find']({'where':{'id':_0x2c03ba[_0xde5c('0x48')]['id']}})[_0xde5c('0x25')](handleEntityNotFound(_0x9e7a90,null))[_0xde5c('0x25')](saveUpdates(_0x2c03ba[_0xde5c('0x4b')],null))[_0xde5c('0x25')](respondWithResult(_0x9e7a90,null))[_0xde5c('0x46')](handleError(_0x9e7a90,null));};exports[_0xde5c('0x26')]=function(_0x3c6537,_0x4b9117){return db[_0xde5c('0x41')]['find']({'where':{'id':_0x3c6537['params']['id']}})[_0xde5c('0x25')](handleEntityNotFound(_0x4b9117,null))[_0xde5c('0x25')](removeEntity(_0x4b9117,null))[_0xde5c('0x46')](handleError(_0x4b9117,null));};exports[_0xde5c('0x4c')]=function(_0xadf7af,_0x3e8510,_0xbf95d5){var _0xa15578={};var _0x132b84={};var _0x4b3dcf;var _0x130934;return db[_0xde5c('0x41')]['findOne']({'where':{'id':_0xadf7af[_0xde5c('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e8510,null))['then'](function(_0x532d88){if(_0x532d88){_0x4b3dcf=_0x532d88;_0x132b84['model']=_['keys'](db['Dynamics365Field'][_0xde5c('0x2d')]);_0x132b84['query']=_[_0xde5c('0x32')](_0xadf7af[_0xde5c('0x31')]);_0x132b84['filters']=_[_0xde5c('0x34')](_0x132b84[_0xde5c('0x30')],_0x132b84[_0xde5c('0x31')]);_0xa15578[_0xde5c('0x35')]=_[_0xde5c('0x34')](_0x132b84[_0xde5c('0x30')],qs[_0xde5c('0x36')](_0xadf7af[_0xde5c('0x31')][_0xde5c('0x36')]));_0xa15578[_0xde5c('0x35')]=_0xa15578[_0xde5c('0x35')]['length']?_0xa15578[_0xde5c('0x35')]:_0x132b84['model'];_0xa15578[_0xde5c('0x3a')]=qs[_0xde5c('0x3b')](_0xadf7af[_0xde5c('0x31')][_0xde5c('0x3b')]);_0xa15578[_0xde5c('0x3d')]=qs[_0xde5c('0x33')](_['pick'](_0xadf7af[_0xde5c('0x31')],_0x132b84[_0xde5c('0x33')]));if(_0xadf7af['query'][_0xde5c('0x4d')]){_0xa15578[_0xde5c('0x3d')]=_[_0xde5c('0x3f')](_0xa15578[_0xde5c('0x3d')],{'$or':_[_0xde5c('0x2c')](_0xa15578[_0xde5c('0x35')],function(_0x33b89f){var _0x4a866d={};_0x4a866d[_0x33b89f]={'$like':'%'+_0xadf7af[_0xde5c('0x31')]['filter']+'%'};return _0x4a866d;})});}_0xa15578=_[_0xde5c('0x3f')]({},_0xa15578,_0xadf7af[_0xde5c('0x40')]);return _0x4b3dcf[_0xde5c('0x4c')](_0xa15578);}})[_0xde5c('0x25')](function(_0x43b423){if(_0x43b423){_0x130934=_0x43b423[_0xde5c('0x37')];if(!_0xadf7af[_0xde5c('0x31')][_0xde5c('0x38')](_0xde5c('0x39'))){_0xa15578[_0xde5c('0x1d')]=qs[_0xde5c('0x1d')](_0xadf7af[_0xde5c('0x31')][_0xde5c('0x1d')]);_0xa15578[_0xde5c('0x1c')]=qs[_0xde5c('0x1c')](_0xadf7af[_0xde5c('0x31')][_0xde5c('0x1c')]);}return _0x4b3dcf[_0xde5c('0x4c')](_0xa15578);}})['then'](function(_0x1baa28){if(_0x1baa28){return _0x1baa28?{'count':_0x130934,'rows':_0x1baa28}:null;}})[_0xde5c('0x25')](respondWithResult(_0x3e8510,null))[_0xde5c('0x46')](handleError(_0x3e8510,null));};exports[_0xde5c('0x4e')]=function(_0xdb4375,_0x310994,_0x28a785){var _0x5c66e0={};var _0x3485f7={};var _0x2a9321;var _0x571c63;return db['Dynamics365Configuration'][_0xde5c('0x4f')]({'where':{'id':_0xdb4375[_0xde5c('0x48')]['id']}})[_0xde5c('0x25')](handleEntityNotFound(_0x310994,null))[_0xde5c('0x25')](function(_0x5a12c5){if(_0x5a12c5){_0x2a9321=_0x5a12c5;_0x3485f7[_0xde5c('0x30')]=_[_0xde5c('0x32')](db[_0xde5c('0x50')][_0xde5c('0x2d')]);_0x3485f7[_0xde5c('0x31')]=_['keys'](_0xdb4375[_0xde5c('0x31')]);_0x3485f7[_0xde5c('0x33')]=_[_0xde5c('0x34')](_0x3485f7['model'],_0x3485f7[_0xde5c('0x31')]);_0x5c66e0[_0xde5c('0x35')]=_[_0xde5c('0x34')](_0x3485f7[_0xde5c('0x30')],qs[_0xde5c('0x36')](_0xdb4375['query'][_0xde5c('0x36')]));_0x5c66e0[_0xde5c('0x35')]=_0x5c66e0[_0xde5c('0x35')][_0xde5c('0x37')]?_0x5c66e0[_0xde5c('0x35')]:_0x3485f7['model'];_0x5c66e0[_0xde5c('0x3a')]=qs[_0xde5c('0x3b')](_0xdb4375['query'][_0xde5c('0x3b')]);_0x5c66e0['where']=qs[_0xde5c('0x33')](_[_0xde5c('0x3c')](_0xdb4375[_0xde5c('0x31')],_0x3485f7[_0xde5c('0x33')]));if(_0xdb4375[_0xde5c('0x31')]['filter']){_0x5c66e0['where']=_['merge'](_0x5c66e0[_0xde5c('0x3d')],{'$or':_['map'](_0x5c66e0['attributes'],function(_0x5e1ba7){var _0x319889={};_0x319889[_0x5e1ba7]={'$like':'%'+_0xdb4375[_0xde5c('0x31')][_0xde5c('0x4d')]+'%'};return _0x319889;})});}_0x5c66e0=_[_0xde5c('0x3f')]({},_0x5c66e0,_0xdb4375[_0xde5c('0x40')]);return _0x2a9321[_0xde5c('0x4e')](_0x5c66e0);}})[_0xde5c('0x25')](function(_0x54f3ea){if(_0x54f3ea){_0x571c63=_0x54f3ea[_0xde5c('0x37')];if(!_0xdb4375[_0xde5c('0x31')]['hasOwnProperty'](_0xde5c('0x39'))){_0x5c66e0[_0xde5c('0x1d')]=qs['limit'](_0xdb4375[_0xde5c('0x31')][_0xde5c('0x1d')]);_0x5c66e0[_0xde5c('0x1c')]=qs[_0xde5c('0x1c')](_0xdb4375['query']['offset']);}return _0x2a9321[_0xde5c('0x4e')](_0x5c66e0);}})[_0xde5c('0x25')](function(_0x236836){if(_0x236836){return _0x236836?{'count':_0x571c63,'rows':_0x236836}:null;}})[_0xde5c('0x25')](respondWithResult(_0x310994,null))[_0xde5c('0x46')](handleError(_0x310994,null));};exports[_0xde5c('0x51')]=function(_0x38748b,_0xeb9ac3,_0x45a081){var _0x5f135f={};var _0x64d333={};var _0x2a2ede;var _0x3fb01f;return db[_0xde5c('0x41')][_0xde5c('0x4f')]({'where':{'id':_0x38748b['params']['id']}})[_0xde5c('0x25')](handleEntityNotFound(_0xeb9ac3,null))[_0xde5c('0x25')](function(_0xefaba7){if(_0xefaba7){_0x2a2ede=_0xefaba7;_0x64d333['model']=_[_0xde5c('0x32')](db[_0xde5c('0x50')][_0xde5c('0x2d')]);_0x64d333[_0xde5c('0x31')]=_[_0xde5c('0x32')](_0x38748b['query']);_0x64d333['filters']=_[_0xde5c('0x34')](_0x64d333[_0xde5c('0x30')],_0x64d333[_0xde5c('0x31')]);_0x5f135f['attributes']=_['intersection'](_0x64d333[_0xde5c('0x30')],qs[_0xde5c('0x36')](_0x38748b['query'][_0xde5c('0x36')]));_0x5f135f[_0xde5c('0x35')]=_0x5f135f[_0xde5c('0x35')][_0xde5c('0x37')]?_0x5f135f['attributes']:_0x64d333['model'];_0x5f135f[_0xde5c('0x3a')]=qs[_0xde5c('0x3b')](_0x38748b[_0xde5c('0x31')][_0xde5c('0x3b')]);_0x5f135f['where']=qs[_0xde5c('0x33')](_[_0xde5c('0x3c')](_0x38748b[_0xde5c('0x31')],_0x64d333[_0xde5c('0x33')]));if(_0x38748b[_0xde5c('0x31')][_0xde5c('0x4d')]){_0x5f135f[_0xde5c('0x3d')]=_[_0xde5c('0x3f')](_0x5f135f[_0xde5c('0x3d')],{'$or':_[_0xde5c('0x2c')](_0x5f135f['attributes'],function(_0x2d0fea){var _0x16bf4f={};_0x16bf4f[_0x2d0fea]={'$like':'%'+_0x38748b[_0xde5c('0x31')][_0xde5c('0x4d')]+'%'};return _0x16bf4f;})});}_0x5f135f=_[_0xde5c('0x3f')]({},_0x5f135f,_0x38748b['options']);return _0x2a2ede['getDescriptions'](_0x5f135f);}})[_0xde5c('0x25')](function(_0x1593ee){if(_0x1593ee){_0x3fb01f=_0x1593ee[_0xde5c('0x37')];if(!_0x38748b['query']['hasOwnProperty'](_0xde5c('0x39'))){_0x5f135f['limit']=qs[_0xde5c('0x1d')](_0x38748b[_0xde5c('0x31')][_0xde5c('0x1d')]);_0x5f135f[_0xde5c('0x1c')]=qs[_0xde5c('0x1c')](_0x38748b[_0xde5c('0x31')][_0xde5c('0x1c')]);}return _0x2a2ede[_0xde5c('0x51')](_0x5f135f);}})[_0xde5c('0x25')](function(_0x4cc3c2){if(_0x4cc3c2){return _0x4cc3c2?{'count':_0x3fb01f,'rows':_0x4cc3c2}:null;}})[_0xde5c('0x25')](respondWithResult(_0xeb9ac3,null))[_0xde5c('0x46')](handleError(_0xeb9ac3,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 4d2e2f4..f53bf4d 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 _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x42f1e6,_0x372465){var _0xea2816=function(_0x20050e){while(--_0x20050e){_0x42f1e6['push'](_0x42f1e6['shift']());}};_0xea2816(++_0x372465);}(_0x008c,0x188));var _0xc008=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x008c[_0x432fca];return _0x3adba4;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x473946,_0x117248){var _0xbb9200=function(_0x58a5f9){while(--_0x58a5f9){_0x473946['push'](_0x473946['shift']());}};_0xbb9200(++_0x117248);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0xf3cd[_0x36bc58];return _0x4a547e;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'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 60a4c74..6d7d9ed 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 _0x31e6=['../../config/environment','jayson/promise','client','request','then','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x380c0d,_0x1ce546){var _0x122154=function(_0xf655e0){while(--_0xf655e0){_0x380c0d['push'](_0x380c0d['shift']());}};_0x122154(++_0x1ce546);}(_0x31e6,0x19d));var _0x631e=function(_0x2b9bf2,_0x4696e5){_0x2b9bf2=_0x2b9bf2-0x0;var _0x2740a3=_0x31e6[_0x2b9bf2];return _0x2740a3;};'use strict';var _=require(_0x631e('0x0'));var util=require('util');var moment=require(_0x631e('0x1'));var BPromise=require(_0x631e('0x2'));var rs=require(_0x631e('0x3'));var fs=require('fs');var Redis=require(_0x631e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x631e('0x5'));var logger=require('../../config/logger')(_0x631e('0x6'));var config=require(_0x631e('0x7'));var jayson=require(_0x631e('0x8'));var client=jayson[_0x631e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36d41e,_0x275d9d,_0x4f581f){return new BPromise(function(_0x1d092e,_0x2ef34a){return client[_0x631e('0xa')](_0x36d41e,_0x4f581f)[_0x631e('0xb')](function(_0x504155){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x275d9d,_0x631e('0xc'));logger['debug'](_0x631e('0xd'),_0x275d9d,_0x631e('0xc'),JSON[_0x631e('0xe')](_0x504155));if(_0x504155[_0x631e('0xf')]){if(_0x504155[_0x631e('0xf')][_0x631e('0x10')]===0x1f4){logger['error'](_0x631e('0x11'),_0x275d9d,_0x504155['error'][_0x631e('0x12')]);return _0x2ef34a(_0x504155['error'][_0x631e('0x12')]);}logger['error'](_0x631e('0x11'),_0x275d9d,_0x504155['error'][_0x631e('0x12')]);return _0x1d092e(_0x504155[_0x631e('0xf')][_0x631e('0x12')]);}else{logger['info'](_0x631e('0x11'),_0x275d9d,_0x631e('0xc'));_0x1d092e(_0x504155[_0x631e('0x13')][_0x631e('0x12')]);}})[_0x631e('0x14')](function(_0x116920){logger[_0x631e('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x275d9d,_0x116920);_0x2ef34a(_0x116920);});});} \ No newline at end of file +var _0x2f91=['then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1f5352,_0x49667e){var _0x4a7d8f=function(_0x3fb4d6){while(--_0x3fb4d6){_0x1f5352['push'](_0x1f5352['shift']());}};_0x4a7d8f(++_0x49667e);}(_0x2f91,0x89));var _0x12f9=function(_0x5295c1,_0x579c5e){_0x5295c1=_0x5295c1-0x0;var _0x26b43d=_0x2f91[_0x5295c1];return _0x26b43d;};'use strict';var _=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var moment=require(_0x12f9('0x2'));var BPromise=require(_0x12f9('0x3'));var rs=require(_0x12f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x12f9('0x6'))(_0x12f9('0x7'));var config=require(_0x12f9('0x8'));var jayson=require(_0x12f9('0x9'));var client=jayson[_0x12f9('0xa')][_0x12f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c8944,_0x3adfc9,_0x37f4c5){return new BPromise(function(_0x1be8f5,_0x3ae3bc){return client[_0x12f9('0xc')](_0x1c8944,_0x37f4c5)[_0x12f9('0xd')](function(_0x78368f){logger[_0x12f9('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3adfc9,_0x12f9('0xf'));logger[_0x12f9('0x10')](_0x12f9('0x11'),_0x3adfc9,_0x12f9('0xf'),JSON[_0x12f9('0x12')](_0x78368f));if(_0x78368f['error']){if(_0x78368f[_0x12f9('0x13')][_0x12f9('0x14')]===0x1f4){logger['error'](_0x12f9('0x15'),_0x3adfc9,_0x78368f['error'][_0x12f9('0x16')]);return _0x3ae3bc(_0x78368f[_0x12f9('0x13')]['message']);}logger['error'](_0x12f9('0x15'),_0x3adfc9,_0x78368f['error']['message']);return _0x1be8f5(_0x78368f[_0x12f9('0x13')][_0x12f9('0x16')]);}else{logger['info'](_0x12f9('0x15'),_0x3adfc9,_0x12f9('0xf'));_0x1be8f5(_0x78368f[_0x12f9('0x17')][_0x12f9('0x16')]);}})[_0x12f9('0x18')](function(_0x371230){logger['error'](_0x12f9('0x15'),_0x3adfc9,_0x371230);_0x3ae3bc(_0x371230);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index c3d3053..7925850 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 _0x1de7=['isAuthenticated','show','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','/:id'];(function(_0x47e772,_0xd1354a){var _0x541905=function(_0x558b74){while(--_0x558b74){_0x47e772['push'](_0x47e772['shift']());}};_0x541905(++_0xd1354a);}(_0x1de7,0x14b));var _0x71de=function(_0x40d400,_0x15376c){_0x40d400=_0x40d400-0x0;var _0x1a31a8=_0x1de7[_0x40d400];return _0x1a31a8;};'use strict';var multer=require('multer');var util=require(_0x71de('0x0'));var path=require('path');var timeout=require(_0x71de('0x1'));var express=require(_0x71de('0x2'));var router=express[_0x71de('0x3')]();var fs_extra=require(_0x71de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x71de('0x5'));var config=require('../../config/environment');var controller=require(_0x71de('0x6'));router[_0x71de('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x71de('0x7')](_0x71de('0x8'),auth[_0x71de('0x9')](),controller[_0x71de('0xa')]);router[_0x71de('0xb')]('/',auth[_0x71de('0x9')](),controller[_0x71de('0xc')]);router[_0x71de('0xd')](_0x71de('0x8'),auth[_0x71de('0x9')](),controller[_0x71de('0xe')]);router[_0x71de('0xf')](_0x71de('0x8'),auth['isAuthenticated'](),controller[_0x71de('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa014=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x23db35,_0xfa66d5){var _0xfc84ed=function(_0x565ac8){while(--_0x565ac8){_0x23db35['push'](_0x23db35['shift']());}};_0xfc84ed(++_0xfa66d5);}(_0xa014,0x8d));var _0x4a01=function(_0x5526ed,_0x46044e){_0x5526ed=_0x5526ed-0x0;var _0x567c64=_0xa014[_0x5526ed];return _0x567c64;};'use strict';var multer=require(_0x4a01('0x0'));var util=require('util');var path=require(_0x4a01('0x1'));var timeout=require('connect-timeout');var express=require(_0x4a01('0x2'));var router=express['Router']();var fs_extra=require(_0x4a01('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4a01('0x4'));var config=require(_0x4a01('0x5'));var controller=require(_0x4a01('0x6'));router[_0x4a01('0x7')]('/',auth[_0x4a01('0x8')](),controller['index']);router[_0x4a01('0x7')](_0x4a01('0x9'),auth[_0x4a01('0x8')](),controller[_0x4a01('0xa')]);router[_0x4a01('0xb')]('/',auth['isAuthenticated'](),controller[_0x4a01('0xc')]);router[_0x4a01('0xd')]('/:id',auth[_0x4a01('0x8')](),controller[_0x4a01('0xe')]);router[_0x4a01('0xf')](_0x4a01('0x9'),auth[_0x4a01('0x8')](),controller[_0x4a01('0x10')]);module[_0x4a01('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index f5a8c8f..2ebd29d 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 _0x65bd=['STRING','BOOLEAN','string','variable','customVariable','picklist'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x65bd,0x170));var _0xd65b=function(_0x257d91,_0x32ec73){_0x257d91=_0x257d91-0x0;var _0x2acf5c=_0x65bd[_0x257d91];return _0x2acf5c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xd65b('0x0'),_0xd65b('0x1'),_0xd65b('0x2'),'keyValue',_0xd65b('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd65b('0x4')]},'key':{'type':Sequelize[_0xd65b('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xd65b('0x0'),'variable',_0xd65b('0x2'))},'keyContent':{'type':Sequelize[_0xd65b('0x4')]},'idField':{'type':Sequelize[_0xd65b('0x4')]},'nameField':{'type':Sequelize[_0xd65b('0x4')]},'customField':{'type':Sequelize[_0xd65b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x33ac=['keyValue','picklist','STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x455bbf,_0x487eb1){var _0x31cc6a=function(_0x510dd8){while(--_0x510dd8){_0x455bbf['push'](_0x455bbf['shift']());}};_0x31cc6a(++_0x487eb1);}(_0x33ac,0x1c8));var _0xc33a=function(_0x16d785,_0x2d0d5f){_0x16d785=_0x16d785-0x0;var _0x5e7d68=_0x33ac[_0x16d785];return _0x5e7d68;};'use strict';var Sequelize=require(_0xc33a('0x0'));module[_0xc33a('0x1')]={'type':{'type':Sequelize[_0xc33a('0x2')](_0xc33a('0x3'),'variable','customVariable',_0xc33a('0x4'),_0xc33a('0x5')),'defaultValue':_0xc33a('0x3')},'content':{'type':Sequelize[_0xc33a('0x6')]},'key':{'type':Sequelize[_0xc33a('0x6')]},'keyType':{'type':Sequelize[_0xc33a('0x2')]('string',_0xc33a('0x7'),_0xc33a('0x8'))},'keyContent':{'type':Sequelize[_0xc33a('0x6')]},'idField':{'type':Sequelize[_0xc33a('0x6')]},'nameField':{'type':Sequelize[_0xc33a('0x6')]},'customField':{'type':Sequelize[_0xc33a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc33a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index acf005e..a1f1dd3 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 _0xcb39=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../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','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','show','params','options','find','catch','create','body','destroy'];(function(_0x55796b,_0x1ac546){var _0x1cb038=function(_0x59e366){while(--_0x59e366){_0x55796b['push'](_0x55796b['shift']());}};_0x1cb038(++_0x1ac546);}(_0xcb39,0x1f1));var _0x9cb3=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0xcb39[_0x5b47d9];return _0x4151f0;};'use strict';var emlformat=require(_0x9cb3('0x0'));var rimraf=require(_0x9cb3('0x1'));var zipdir=require(_0x9cb3('0x2'));var jsonpatch=require(_0x9cb3('0x3'));var rp=require(_0x9cb3('0x4'));var moment=require(_0x9cb3('0x5'));var BPromise=require(_0x9cb3('0x6'));var Mustache=require(_0x9cb3('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9cb3('0x8'));var ejs=require(_0x9cb3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9cb3('0xa'));var deskjs=require(_0x9cb3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9cb3('0xc'));var Papa=require(_0x9cb3('0xd'));var Redis=require(_0x9cb3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9cb3('0xf'));var as=require(_0x9cb3('0x10'));var hardwareService=require(_0x9cb3('0x11'));var logger=require(_0x9cb3('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9cb3('0x13'));var licenseUtil=require(_0x9cb3('0x14'));var db=require(_0x9cb3('0x15'))['db'];function respondWithStatusCode(_0xe8de90,_0x35fd77){_0x35fd77=_0x35fd77||0xcc;return function(_0x1724bf){if(_0x1724bf){return _0xe8de90[_0x9cb3('0x16')](_0x35fd77);}return _0xe8de90[_0x9cb3('0x17')](_0x35fd77)[_0x9cb3('0x18')]();};}function respondWithResult(_0x2d57fd,_0x3336ce){_0x3336ce=_0x3336ce||0xc8;return function(_0x547707){if(_0x547707){return _0x2d57fd[_0x9cb3('0x17')](_0x3336ce)[_0x9cb3('0x19')](_0x547707);}};}function respondWithFilteredResult(_0x5c6b36,_0x1a49ea){return function(_0x38414f){if(_0x38414f){var _0x5d0cd1=typeof _0x1a49ea[_0x9cb3('0x1a')]===_0x9cb3('0x1b')&&typeof _0x1a49ea[_0x9cb3('0x1c')]===_0x9cb3('0x1b');var _0x15d657=_0x38414f[_0x9cb3('0x1d')];var _0x53edfc=_0x5d0cd1?0x0:_0x1a49ea['offset'];var _0xff7d34=_0x5d0cd1?_0x38414f[_0x9cb3('0x1d')]:_0x1a49ea[_0x9cb3('0x1a')]+_0x1a49ea[_0x9cb3('0x1c')];var _0x295ccd;if(_0xff7d34>=_0x15d657){_0xff7d34=_0x15d657;_0x295ccd=0xc8;}else{_0x295ccd=0xce;}_0x5c6b36[_0x9cb3('0x17')](_0x295ccd);return _0x5c6b36[_0x9cb3('0x1e')](_0x9cb3('0x1f'),_0x53edfc+'-'+_0xff7d34+'/'+_0x15d657)[_0x9cb3('0x19')](_0x38414f);}return null;};}function patchUpdates(_0x43c17f){return function(_0x1dd809){try{jsonpatch['apply'](_0x1dd809,_0x43c17f,!![]);}catch(_0x453e5f){return BPromise[_0x9cb3('0x20')](_0x453e5f);}return _0x1dd809[_0x9cb3('0x21')]();};}function saveUpdates(_0x3f5208,_0x3ef825){return function(_0x258d12){if(_0x258d12){return _0x258d12[_0x9cb3('0x22')](_0x3f5208)[_0x9cb3('0x23')](function(_0x22ddb9){return _0x22ddb9;});}return null;};}function removeEntity(_0x9c391f,_0x2ac425){return function(_0x3bed23){if(_0x3bed23){return _0x3bed23['destroy']()['then'](function(){_0x9c391f['status'](0xcc)[_0x9cb3('0x18')]();});}};}function handleEntityNotFound(_0x4dfba6,_0x3f56db){return function(_0x9e76d9){if(!_0x9e76d9){_0x4dfba6['sendStatus'](0x194);}return _0x9e76d9;};}function handleError(_0x31de89,_0x2448c4){_0x2448c4=_0x2448c4||0x1f4;return function(_0x513c1b){logger[_0x9cb3('0x24')](_0x513c1b[_0x9cb3('0x25')]);if(_0x513c1b[_0x9cb3('0x26')]){delete _0x513c1b[_0x9cb3('0x26')];}_0x31de89[_0x9cb3('0x17')](_0x2448c4)[_0x9cb3('0x27')](_0x513c1b);};}exports[_0x9cb3('0x28')]=function(_0xbea1a1,_0x9c43ec){var _0x10f2ad={},_0xe79261={},_0x2d5a6c={'count':0x0,'rows':[]};var _0xeb23e7=_[_0x9cb3('0x29')](db[_0x9cb3('0x2a')][_0x9cb3('0x2b')],function(_0x1bfc15){return{'name':_0x1bfc15[_0x9cb3('0x2c')],'type':_0x1bfc15['type']['key']};});_0xe79261[_0x9cb3('0x2d')]=_[_0x9cb3('0x29')](_0xeb23e7,_0x9cb3('0x26'));_0xe79261['query']=_[_0x9cb3('0x2e')](_0xbea1a1[_0x9cb3('0x2f')]);_0xe79261[_0x9cb3('0x30')]=_[_0x9cb3('0x31')](_0xe79261[_0x9cb3('0x2d')],_0xe79261[_0x9cb3('0x2f')]);_0x10f2ad[_0x9cb3('0x32')]=_['intersection'](_0xe79261[_0x9cb3('0x2d')],qs[_0x9cb3('0x33')](_0xbea1a1['query']['fields']));_0x10f2ad[_0x9cb3('0x32')]=_0x10f2ad[_0x9cb3('0x32')][_0x9cb3('0x34')]?_0x10f2ad[_0x9cb3('0x32')]:_0xe79261['model'];if(!_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x35')]('nolimit')){_0x10f2ad[_0x9cb3('0x1c')]=qs[_0x9cb3('0x1c')](_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x1c')]);_0x10f2ad[_0x9cb3('0x1a')]=qs['offset'](_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x1a')]);}_0x10f2ad[_0x9cb3('0x36')]=qs['sort'](_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x37')]);_0x10f2ad[_0x9cb3('0x38')]=qs[_0x9cb3('0x30')](_[_0x9cb3('0x39')](_0xbea1a1['query'],_0xe79261['filters']),_0xeb23e7);if(_0xbea1a1['query'][_0x9cb3('0x3a')]){_0x10f2ad['where']=_[_0x9cb3('0x3b')](_0x10f2ad[_0x9cb3('0x38')],{'$or':_[_0x9cb3('0x29')](_0xeb23e7,function(_0xa056c){if(_0xa056c['type']!=='VIRTUAL'){var _0x5a7459={};_0x5a7459[_0xa056c[_0x9cb3('0x26')]]={'$like':'%'+_0xbea1a1[_0x9cb3('0x2f')]['filter']+'%'};return _0x5a7459;}})});}_0x10f2ad=_['merge']({},_0x10f2ad,_0xbea1a1['options']);var _0x934462={'where':_0x10f2ad['where']};return db[_0x9cb3('0x2a')][_0x9cb3('0x1d')](_0x934462)['then'](function(_0x2920a0){_0x2d5a6c[_0x9cb3('0x1d')]=_0x2920a0;if(_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x3c')]){_0x10f2ad[_0x9cb3('0x3d')]=[{'all':!![]}];}return db[_0x9cb3('0x2a')]['findAll'](_0x10f2ad);})[_0x9cb3('0x23')](function(_0x3cad57){_0x2d5a6c[_0x9cb3('0x3e')]=_0x3cad57;return _0x2d5a6c;})[_0x9cb3('0x23')](respondWithFilteredResult(_0x9c43ec,_0x10f2ad))['catch'](handleError(_0x9c43ec,null));};exports[_0x9cb3('0x3f')]=function(_0x2f68a6,_0x48a35f){var _0x23b3f4={'raw':!![],'where':{'id':_0x2f68a6[_0x9cb3('0x40')]['id']}},_0x5b0919={};_0x5b0919['model']=_[_0x9cb3('0x2e')](db[_0x9cb3('0x2a')][_0x9cb3('0x2b')]);_0x5b0919[_0x9cb3('0x2f')]=_['keys'](_0x2f68a6[_0x9cb3('0x2f')]);_0x5b0919['filters']=_['intersection'](_0x5b0919[_0x9cb3('0x2d')],_0x5b0919[_0x9cb3('0x2f')]);_0x23b3f4[_0x9cb3('0x32')]=_['intersection'](_0x5b0919[_0x9cb3('0x2d')],qs[_0x9cb3('0x33')](_0x2f68a6[_0x9cb3('0x2f')]['fields']));_0x23b3f4['attributes']=_0x23b3f4['attributes']['length']?_0x23b3f4['attributes']:_0x5b0919[_0x9cb3('0x2d')];if(_0x2f68a6[_0x9cb3('0x2f')][_0x9cb3('0x3c')]){_0x23b3f4[_0x9cb3('0x3d')]=[{'all':!![]}];}_0x23b3f4=_['merge']({},_0x23b3f4,_0x2f68a6[_0x9cb3('0x41')]);return db[_0x9cb3('0x2a')][_0x9cb3('0x42')](_0x23b3f4)[_0x9cb3('0x23')](handleEntityNotFound(_0x48a35f,null))[_0x9cb3('0x23')](respondWithResult(_0x48a35f,null))[_0x9cb3('0x43')](handleError(_0x48a35f,null));};exports[_0x9cb3('0x44')]=function(_0x220d2b,_0x10f8b9){return db[_0x9cb3('0x2a')][_0x9cb3('0x44')](_0x220d2b[_0x9cb3('0x45')],{})['then'](respondWithResult(_0x10f8b9,0xc9))[_0x9cb3('0x43')](handleError(_0x10f8b9,null));};exports[_0x9cb3('0x22')]=function(_0x33636d,_0x3bbbf6){if(_0x33636d['body']['id']){delete _0x33636d[_0x9cb3('0x45')]['id'];}return db[_0x9cb3('0x2a')][_0x9cb3('0x42')]({'where':{'id':_0x33636d[_0x9cb3('0x40')]['id']}})[_0x9cb3('0x23')](handleEntityNotFound(_0x3bbbf6,null))[_0x9cb3('0x23')](saveUpdates(_0x33636d[_0x9cb3('0x45')],null))['then'](respondWithResult(_0x3bbbf6,null))[_0x9cb3('0x43')](handleError(_0x3bbbf6,null));};exports[_0x9cb3('0x46')]=function(_0x17301a,_0x84e251){return db[_0x9cb3('0x2a')][_0x9cb3('0x42')]({'where':{'id':_0x17301a['params']['id']}})['then'](handleEntityNotFound(_0x84e251,null))[_0x9cb3('0x23')](removeEntity(_0x84e251,null))['catch'](handleError(_0x84e251,null));}; \ No newline at end of file +var _0x1c66=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','error','name','index','rawAttributes','type','key','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','Dynamics365Field','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c66,0x8f));var _0x61c6=function(_0x4e1553,_0xebcc16){_0x4e1553=_0x4e1553-0x0;var _0x16df67=_0x1c66[_0x4e1553];return _0x16df67;};'use strict';var emlformat=require(_0x61c6('0x0'));var rimraf=require(_0x61c6('0x1'));var zipdir=require(_0x61c6('0x2'));var jsonpatch=require(_0x61c6('0x3'));var rp=require('request-promise');var moment=require(_0x61c6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61c6('0x5'));var util=require(_0x61c6('0x6'));var path=require(_0x61c6('0x7'));var sox=require(_0x61c6('0x8'));var csv=require(_0x61c6('0x9'));var ejs=require(_0x61c6('0xa'));var fs=require('fs');var fs_extra=require(_0x61c6('0xb'));var _=require(_0x61c6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x61c6('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x61c6('0xe'));var Redis=require(_0x61c6('0xf'));var authService=require(_0x61c6('0x10'));var qs=require(_0x61c6('0x11'));var as=require(_0x61c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61c6('0x13'))(_0x61c6('0x14'));var utils=require(_0x61c6('0x15'));var config=require(_0x61c6('0x16'));var licenseUtil=require(_0x61c6('0x17'));var db=require(_0x61c6('0x18'))['db'];function respondWithStatusCode(_0x39af59,_0x895835){_0x895835=_0x895835||0xcc;return function(_0x4affb9){if(_0x4affb9){return _0x39af59[_0x61c6('0x19')](_0x895835);}return _0x39af59[_0x61c6('0x1a')](_0x895835)[_0x61c6('0x1b')]();};}function respondWithResult(_0x9565ce,_0x2edeec){_0x2edeec=_0x2edeec||0xc8;return function(_0x39d0c0){if(_0x39d0c0){return _0x9565ce[_0x61c6('0x1a')](_0x2edeec)[_0x61c6('0x1c')](_0x39d0c0);}};}function respondWithFilteredResult(_0x247e8f,_0x410ed1){return function(_0x4d1bb5){if(_0x4d1bb5){var _0x5549c0=typeof _0x410ed1[_0x61c6('0x1d')]===_0x61c6('0x1e')&&typeof _0x410ed1['limit']===_0x61c6('0x1e');var _0x452594=_0x4d1bb5[_0x61c6('0x1f')];var _0x190f23=_0x5549c0?0x0:_0x410ed1[_0x61c6('0x1d')];var _0x45f546=_0x5549c0?_0x4d1bb5[_0x61c6('0x1f')]:_0x410ed1[_0x61c6('0x1d')]+_0x410ed1[_0x61c6('0x20')];var _0x4e1819;if(_0x45f546>=_0x452594){_0x45f546=_0x452594;_0x4e1819=0xc8;}else{_0x4e1819=0xce;}_0x247e8f['status'](_0x4e1819);return _0x247e8f[_0x61c6('0x21')]('Content-Range',_0x190f23+'-'+_0x45f546+'/'+_0x452594)[_0x61c6('0x1c')](_0x4d1bb5);}return null;};}function patchUpdates(_0x44de2b){return function(_0x3e718e){try{jsonpatch[_0x61c6('0x22')](_0x3e718e,_0x44de2b,!![]);}catch(_0x31642b){return BPromise['reject'](_0x31642b);}return _0x3e718e[_0x61c6('0x23')]();};}function saveUpdates(_0x30fafa,_0x49aaf6){return function(_0x4f83b8){if(_0x4f83b8){return _0x4f83b8[_0x61c6('0x24')](_0x30fafa)['then'](function(_0x5a5534){return _0x5a5534;});}return null;};}function removeEntity(_0x19636b,_0x1debfe){return function(_0x2245e9){if(_0x2245e9){return _0x2245e9[_0x61c6('0x25')]()[_0x61c6('0x26')](function(){_0x19636b[_0x61c6('0x1a')](0xcc)[_0x61c6('0x1b')]();});}};}function handleEntityNotFound(_0x4130a3,_0x5c034b){return function(_0x22da4e){if(!_0x22da4e){_0x4130a3[_0x61c6('0x19')](0x194);}return _0x22da4e;};}function handleError(_0x2007db,_0x32fdb0){_0x32fdb0=_0x32fdb0||0x1f4;return function(_0x557764){logger[_0x61c6('0x27')](_0x557764['stack']);if(_0x557764[_0x61c6('0x28')]){delete _0x557764[_0x61c6('0x28')];}_0x2007db[_0x61c6('0x1a')](_0x32fdb0)['send'](_0x557764);};}exports[_0x61c6('0x29')]=function(_0x30ae70,_0x38bb13){var _0x4c2013={},_0x61750={},_0x576061={'count':0x0,'rows':[]};var _0x58a1d8=_['map'](db['Dynamics365Field'][_0x61c6('0x2a')],function(_0x5bc244){return{'name':_0x5bc244['fieldName'],'type':_0x5bc244[_0x61c6('0x2b')][_0x61c6('0x2c')]};});_0x61750['model']=_['map'](_0x58a1d8,_0x61c6('0x28'));_0x61750['query']=_[_0x61c6('0x2d')](_0x30ae70['query']);_0x61750[_0x61c6('0x2e')]=_[_0x61c6('0x2f')](_0x61750[_0x61c6('0x30')],_0x61750['query']);_0x4c2013[_0x61c6('0x31')]=_[_0x61c6('0x2f')](_0x61750['model'],qs['fields'](_0x30ae70[_0x61c6('0x32')][_0x61c6('0x33')]));_0x4c2013[_0x61c6('0x31')]=_0x4c2013[_0x61c6('0x31')][_0x61c6('0x34')]?_0x4c2013[_0x61c6('0x31')]:_0x61750[_0x61c6('0x30')];if(!_0x30ae70['query'][_0x61c6('0x35')](_0x61c6('0x36'))){_0x4c2013[_0x61c6('0x20')]=qs['limit'](_0x30ae70['query']['limit']);_0x4c2013[_0x61c6('0x1d')]=qs['offset'](_0x30ae70[_0x61c6('0x32')]['offset']);}_0x4c2013[_0x61c6('0x37')]=qs[_0x61c6('0x38')](_0x30ae70[_0x61c6('0x32')][_0x61c6('0x38')]);_0x4c2013[_0x61c6('0x39')]=qs['filters'](_['pick'](_0x30ae70[_0x61c6('0x32')],_0x61750[_0x61c6('0x2e')]),_0x58a1d8);if(_0x30ae70[_0x61c6('0x32')][_0x61c6('0x3a')]){_0x4c2013['where']=_[_0x61c6('0x3b')](_0x4c2013[_0x61c6('0x39')],{'$or':_['map'](_0x58a1d8,function(_0xd943fb){if(_0xd943fb[_0x61c6('0x2b')]!==_0x61c6('0x3c')){var _0x98a529={};_0x98a529[_0xd943fb[_0x61c6('0x28')]]={'$like':'%'+_0x30ae70[_0x61c6('0x32')][_0x61c6('0x3a')]+'%'};return _0x98a529;}})});}_0x4c2013=_[_0x61c6('0x3b')]({},_0x4c2013,_0x30ae70['options']);var _0x30e1cd={'where':_0x4c2013[_0x61c6('0x39')]};return db[_0x61c6('0x3d')][_0x61c6('0x1f')](_0x30e1cd)[_0x61c6('0x26')](function(_0x29664a){_0x576061[_0x61c6('0x1f')]=_0x29664a;if(_0x30ae70[_0x61c6('0x32')][_0x61c6('0x3e')]){_0x4c2013['include']=[{'all':!![]}];}return db[_0x61c6('0x3d')][_0x61c6('0x3f')](_0x4c2013);})['then'](function(_0xa40e0e){_0x576061[_0x61c6('0x40')]=_0xa40e0e;return _0x576061;})[_0x61c6('0x26')](respondWithFilteredResult(_0x38bb13,_0x4c2013))[_0x61c6('0x41')](handleError(_0x38bb13,null));};exports[_0x61c6('0x42')]=function(_0x5c315d,_0x326a2f){var _0x14b236={'raw':!![],'where':{'id':_0x5c315d[_0x61c6('0x43')]['id']}},_0x4d6f63={};_0x4d6f63[_0x61c6('0x30')]=_[_0x61c6('0x2d')](db[_0x61c6('0x3d')][_0x61c6('0x2a')]);_0x4d6f63[_0x61c6('0x32')]=_[_0x61c6('0x2d')](_0x5c315d[_0x61c6('0x32')]);_0x4d6f63[_0x61c6('0x2e')]=_[_0x61c6('0x2f')](_0x4d6f63[_0x61c6('0x30')],_0x4d6f63['query']);_0x14b236[_0x61c6('0x31')]=_[_0x61c6('0x2f')](_0x4d6f63[_0x61c6('0x30')],qs[_0x61c6('0x33')](_0x5c315d[_0x61c6('0x32')][_0x61c6('0x33')]));_0x14b236[_0x61c6('0x31')]=_0x14b236['attributes'][_0x61c6('0x34')]?_0x14b236[_0x61c6('0x31')]:_0x4d6f63[_0x61c6('0x30')];if(_0x5c315d['query']['includeAll']){_0x14b236[_0x61c6('0x44')]=[{'all':!![]}];}_0x14b236=_[_0x61c6('0x3b')]({},_0x14b236,_0x5c315d['options']);return db[_0x61c6('0x3d')][_0x61c6('0x45')](_0x14b236)[_0x61c6('0x26')](handleEntityNotFound(_0x326a2f,null))[_0x61c6('0x26')](respondWithResult(_0x326a2f,null))[_0x61c6('0x41')](handleError(_0x326a2f,null));};exports[_0x61c6('0x46')]=function(_0xf530bb,_0x4cece0){return db[_0x61c6('0x3d')]['create'](_0xf530bb[_0x61c6('0x47')],{})[_0x61c6('0x26')](respondWithResult(_0x4cece0,0xc9))[_0x61c6('0x41')](handleError(_0x4cece0,null));};exports[_0x61c6('0x24')]=function(_0x44bbfc,_0x5d3673){if(_0x44bbfc[_0x61c6('0x47')]['id']){delete _0x44bbfc[_0x61c6('0x47')]['id'];}return db[_0x61c6('0x3d')][_0x61c6('0x45')]({'where':{'id':_0x44bbfc['params']['id']}})[_0x61c6('0x26')](handleEntityNotFound(_0x5d3673,null))[_0x61c6('0x26')](saveUpdates(_0x44bbfc[_0x61c6('0x47')],null))[_0x61c6('0x26')](respondWithResult(_0x5d3673,null))[_0x61c6('0x41')](handleError(_0x5d3673,null));};exports[_0x61c6('0x25')]=function(_0x1abee9,_0x30cc52){return db[_0x61c6('0x3d')]['find']({'where':{'id':_0x1abee9[_0x61c6('0x43')]['id']}})[_0x61c6('0x26')](handleEntityNotFound(_0x30cc52,null))[_0x61c6('0x26')](removeEntity(_0x30cc52,null))[_0x61c6('0x41')](handleError(_0x30cc52,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 543ceee..b8b2ec2 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 _0x6c05=['./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','bluebird','path','../../config/environment'];(function(_0xa5d69f,_0xf23994){var _0x41f9ff=function(_0xb01611){while(--_0xb01611){_0xa5d69f['push'](_0xa5d69f['shift']());}};_0x41f9ff(++_0xf23994);}(_0x6c05,0x73));var _0x56c0=function(_0x3e24b7,_0x54ec5d){_0x3e24b7=_0x3e24b7-0x0;var _0x601f2a=_0x6c05[_0x3e24b7];return _0x601f2a;};'use strict';var _=require(_0x56c0('0x0'));var util=require(_0x56c0('0x1'));var logger=require(_0x56c0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x56c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56c0('0x4'));var rimraf=require('rimraf');var config=require(_0x56c0('0x5'));var attributes=require(_0x56c0('0x6'));module['exports']=function(_0xec7b3b,_0x8dac62){return _0xec7b3b['define'](_0x56c0('0x7'),attributes,{'tableName':_0x56c0('0x8'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x56c0('0x9'),_0x56c0('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0401=['api','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','Dynamics365Field','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3773d6,_0x696a75){var _0x4ce4c2=function(_0x3481ab){while(--_0x3481ab){_0x3773d6['push'](_0x3773d6['shift']());}};_0x4ce4c2(++_0x696a75);}(_0x0401,0x176));var _0x1040=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x0401[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x1040('0x0'));var util=require(_0x1040('0x1'));var logger=require(_0x1040('0x2'))(_0x1040('0x3'));var moment=require('moment');var BPromise=require(_0x1040('0x4'));var rp=require(_0x1040('0x5'));var fs=require('fs');var path=require(_0x1040('0x6'));var rimraf=require(_0x1040('0x7'));var config=require('../../config/environment');var attributes=require(_0x1040('0x8'));module[_0x1040('0x9')]=function(_0x479186,_0x45f332){return _0x479186['define'](_0x1040('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x1040('0xb'),_0x1040('0xc')],'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 76a9c8b..27e8255 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 _0x1ce8=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Dynamics365Field,\x20%s,\x20%s','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x1ce8,0x17a));var _0x81ce=function(_0x4687aa,_0x52ce79){_0x4687aa=_0x4687aa-0x0;var _0x129611=_0x1ce8[_0x4687aa];return _0x129611;};'use strict';var _=require('lodash');var util=require(_0x81ce('0x0'));var moment=require(_0x81ce('0x1'));var BPromise=require(_0x81ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81ce('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x81ce('0x4'));var logger=require('../../config/logger')(_0x81ce('0x5'));var config=require(_0x81ce('0x6'));var jayson=require(_0x81ce('0x7'));var client=jayson[_0x81ce('0x8')][_0x81ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31f726,_0x2d522f,_0x34461a){return new BPromise(function(_0x447333,_0x3096e4){return client[_0x81ce('0xa')](_0x31f726,_0x34461a)[_0x81ce('0xb')](function(_0xff8418){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,_0x81ce('0xc'));logger[_0x81ce('0xd')](_0x81ce('0xe'),_0x2d522f,_0x81ce('0xc'),JSON[_0x81ce('0xf')](_0xff8418));if(_0xff8418[_0x81ce('0x10')]){if(_0xff8418[_0x81ce('0x10')][_0x81ce('0x11')]===0x1f4){logger[_0x81ce('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,_0xff8418[_0x81ce('0x10')][_0x81ce('0x12')]);return _0x3096e4(_0xff8418[_0x81ce('0x10')]['message']);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,_0xff8418['error'][_0x81ce('0x12')]);return _0x447333(_0xff8418[_0x81ce('0x10')][_0x81ce('0x12')]);}else{logger[_0x81ce('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,'request\x20sent');_0x447333(_0xff8418[_0x81ce('0x14')]['message']);}})[_0x81ce('0x15')](function(_0x475ff0){logger[_0x81ce('0x10')](_0x81ce('0x16'),_0x2d522f,_0x475ff0);_0x3096e4(_0x475ff0);});});} \ No newline at end of file +var _0x9d23=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x3b2d98,_0xaa0b26){var _0x256bf1=function(_0x1fe933){while(--_0x1fe933){_0x3b2d98['push'](_0x3b2d98['shift']());}};_0x256bf1(++_0xaa0b26);}(_0x9d23,0x6b));var _0x39d2=function(_0x20a74a,_0x9f11fd){_0x20a74a=_0x20a74a-0x0;var _0x5e5a2b=_0x9d23[_0x20a74a];return _0x5e5a2b;};'use strict';var _=require(_0x39d2('0x0'));var util=require(_0x39d2('0x1'));var moment=require(_0x39d2('0x2'));var BPromise=require(_0x39d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39d2('0x4'));var db=require(_0x39d2('0x5'))['db'];var utils=require(_0x39d2('0x6'));var logger=require('../../config/logger')(_0x39d2('0x7'));var config=require(_0x39d2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x39d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca362e,_0x14d56e,_0x5d30e7){return new BPromise(function(_0x5776f4,_0x19c4eb){return client['request'](_0xca362e,_0x5d30e7)['then'](function(_0x352a14){logger[_0x39d2('0xa')](_0x39d2('0xb'),_0x14d56e,_0x39d2('0xc'));logger[_0x39d2('0xd')](_0x39d2('0xe'),_0x14d56e,_0x39d2('0xc'),JSON[_0x39d2('0xf')](_0x352a14));if(_0x352a14[_0x39d2('0x10')]){if(_0x352a14[_0x39d2('0x10')][_0x39d2('0x11')]===0x1f4){logger['error'](_0x39d2('0xb'),_0x14d56e,_0x352a14[_0x39d2('0x10')][_0x39d2('0x12')]);return _0x19c4eb(_0x352a14[_0x39d2('0x10')][_0x39d2('0x12')]);}logger['error'](_0x39d2('0xb'),_0x14d56e,_0x352a14['error']['message']);return _0x5776f4(_0x352a14['error'][_0x39d2('0x12')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x14d56e,_0x39d2('0xc'));_0x5776f4(_0x352a14[_0x39d2('0x13')]['message']);}})['catch'](function(_0x531602){logger[_0x39d2('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x14d56e,_0x531602);_0x19c4eb(_0x531602);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index e22279a..54af2f4 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 _0xc462=['getFields','post','create','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x2bbc6b,_0x292271){var _0x26f31a=function(_0x335c89){while(--_0x335c89){_0x2bbc6b['push'](_0x2bbc6b['shift']());}};_0x26f31a(++_0x292271);}(_0xc462,0x8b));var _0x2c46=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc462[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0x2c46('0x0'));var util=require('util');var path=require(_0x2c46('0x1'));var timeout=require(_0x2c46('0x2'));var express=require(_0x2c46('0x3'));var router=express[_0x2c46('0x4')]();var fs_extra=require(_0x2c46('0x5'));var auth=require(_0x2c46('0x6'));var interaction=require(_0x2c46('0x7'));var config=require(_0x2c46('0x8'));var controller=require(_0x2c46('0x9'));router[_0x2c46('0xa')]('/',auth[_0x2c46('0xb')](),controller[_0x2c46('0xc')]);router[_0x2c46('0xa')]('/:id',auth[_0x2c46('0xb')](),controller[_0x2c46('0xd')]);router['get'](_0x2c46('0xe'),auth[_0x2c46('0xb')](),controller['getConfigurations']);router[_0x2c46('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2c46('0xf')]);router[_0x2c46('0x10')]('/',auth[_0x2c46('0xb')](),controller[_0x2c46('0x11')]);router['post'](_0x2c46('0xe'),auth[_0x2c46('0xb')](),controller['addConfiguration']);router[_0x2c46('0x12')](_0x2c46('0x13'),auth[_0x2c46('0xb')](),controller['update']);router[_0x2c46('0x14')]('/:id',auth[_0x2c46('0xb')](),controller[_0x2c46('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe0df=['/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','show','isAuthenticated','getConfigurations','/:id/fields','post','create'];(function(_0x323cdd,_0x369714){var _0x24c2da=function(_0x5c9948){while(--_0x5c9948){_0x323cdd['push'](_0x323cdd['shift']());}};_0x24c2da(++_0x369714);}(_0xe0df,0x13f));var _0xfe0d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe0df[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xfe0d('0x0'));var util=require(_0xfe0d('0x1'));var path=require('path');var timeout=require(_0xfe0d('0x2'));var express=require(_0xfe0d('0x3'));var router=express[_0xfe0d('0x4')]();var fs_extra=require(_0xfe0d('0x5'));var auth=require(_0xfe0d('0x6'));var interaction=require(_0xfe0d('0x7'));var config=require(_0xfe0d('0x8'));var controller=require(_0xfe0d('0x9'));router[_0xfe0d('0xa')]('/',auth['isAuthenticated'](),controller[_0xfe0d('0xb')]);router[_0xfe0d('0xa')](_0xfe0d('0xc'),auth['isAuthenticated'](),controller[_0xfe0d('0xd')]);router[_0xfe0d('0xa')]('/:id/configurations',auth[_0xfe0d('0xe')](),controller[_0xfe0d('0xf')]);router[_0xfe0d('0xa')](_0xfe0d('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0xfe0d('0x11')]('/',auth[_0xfe0d('0xe')](),controller[_0xfe0d('0x12')]);router['post'](_0xfe0d('0x13'),auth[_0xfe0d('0xe')](),controller[_0xfe0d('0x14')]);router[_0xfe0d('0x15')](_0xfe0d('0xc'),auth[_0xfe0d('0xe')](),controller[_0xfe0d('0x16')]);router[_0xfe0d('0x17')](_0xfe0d('0xc'),auth[_0xfe0d('0xe')](),controller[_0xfe0d('0x18')]);module[_0xfe0d('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0f7c1e9..542c59b 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 _0x6343=['STRING','remoteUri'];(function(_0x1961e6,_0x1de8a9){var _0x537a34=function(_0x24975c){while(--_0x24975c){_0x1961e6['push'](_0x1961e6['shift']());}};_0x537a34(++_0x1de8a9);}(_0x6343,0x168));var _0x3634=function(_0x4b00ef,_0x360253){_0x4b00ef=_0x4b00ef-0x0;var _0x5994e8=_0x6343[_0x4b00ef];return _0x5994e8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3634('0x1')},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x66fa=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4678df,_0xd9fa62){var _0x25413a=function(_0x5b7d09){while(--_0x5b7d09){_0x4678df['push'](_0x4678df['shift']());}};_0x25413a(++_0xd9fa62);}(_0x66fa,0x117));var _0xa66f=function(_0x3547de,_0x98bc34){_0x3547de=_0x3547de-0x0;var _0x5723cc=_0x66fa[_0x3547de];return _0x5723cc;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa66f('0x2')]},'username':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x3')},'apiKey':{'type':Sequelize[_0xa66f('0x2')]},'remoteUri':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x4')},'serverUrl':{'type':Sequelize[_0xa66f('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 3e2eed9..8f59ef4 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 _0xa788=['fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','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','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','stringify','send','test','statusCode','eml-format','rimraf','zip-dir'];(function(_0x34cac9,_0x46cf35){var _0x1d52f6=function(_0x31d548){while(--_0x31d548){_0x34cac9['push'](_0x34cac9['shift']());}};_0x1d52f6(++_0x46cf35);}(_0xa788,0x70));var _0x8a78=function(_0xa43652,_0x9b0235){_0xa43652=_0xa43652-0x0;var _0x11408e=_0xa788[_0xa43652];return _0x11408e;};'use strict';var emlformat=require(_0x8a78('0x0'));var rimraf=require(_0x8a78('0x1'));var zipdir=require(_0x8a78('0x2'));var jsonpatch=require(_0x8a78('0x3'));var rp=require('request-promise');var moment=require(_0x8a78('0x4'));var BPromise=require(_0x8a78('0x5'));var Mustache=require('mustache');var util=require(_0x8a78('0x6'));var path=require(_0x8a78('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a78('0x8'));var _=require(_0x8a78('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a78('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a78('0xb'));var Papa=require(_0x8a78('0xc'));var Redis=require('ioredis');var authService=require(_0x8a78('0xd'));var qs=require(_0x8a78('0xe'));var as=require(_0x8a78('0xf'));var hardwareService=require(_0x8a78('0x10'));var logger=require(_0x8a78('0x11'))(_0x8a78('0x12'));var utils=require(_0x8a78('0x13'));var config=require(_0x8a78('0x14'));var licenseUtil=require(_0x8a78('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8a78('0x16'));function respondWithStatusCode(_0x294b34,_0x31b77e){_0x31b77e=_0x31b77e||0xcc;return function(_0x4b4bc8){if(_0x4b4bc8){return _0x294b34[_0x8a78('0x17')](_0x31b77e);}return _0x294b34[_0x8a78('0x18')](_0x31b77e)[_0x8a78('0x19')]();};}function respondWithResult(_0x4b073b,_0x423787){_0x423787=_0x423787||0xc8;return function(_0x5bf8a4){if(_0x5bf8a4){return _0x4b073b[_0x8a78('0x18')](_0x423787)['json'](_0x5bf8a4);}};}function respondWithFilteredResult(_0x429b2c,_0x586d47){return function(_0x57212b){if(_0x57212b){var _0x580cf9=typeof _0x586d47[_0x8a78('0x1a')]===_0x8a78('0x1b')&&typeof _0x586d47[_0x8a78('0x1c')]===_0x8a78('0x1b');var _0x303aab=_0x57212b[_0x8a78('0x1d')];var _0x9ce954=_0x580cf9?0x0:_0x586d47[_0x8a78('0x1a')];var _0x20343b=_0x580cf9?_0x57212b[_0x8a78('0x1d')]:_0x586d47[_0x8a78('0x1a')]+_0x586d47[_0x8a78('0x1c')];var _0x23721b;if(_0x20343b>=_0x303aab){_0x20343b=_0x303aab;_0x23721b=0xc8;}else{_0x23721b=0xce;}_0x429b2c[_0x8a78('0x18')](_0x23721b);return _0x429b2c['set'](_0x8a78('0x1e'),_0x9ce954+'-'+_0x20343b+'/'+_0x303aab)['json'](_0x57212b);}return null;};}function patchUpdates(_0xa6f4b8){return function(_0x1dd032){try{jsonpatch['apply'](_0x1dd032,_0xa6f4b8,!![]);}catch(_0x1389e8){return BPromise[_0x8a78('0x1f')](_0x1389e8);}return _0x1dd032[_0x8a78('0x20')]();};}function saveUpdates(_0x43b3b8,_0x2d7d03){return function(_0x530446){if(_0x530446){return _0x530446[_0x8a78('0x21')](_0x43b3b8)['then'](function(_0x3532d1){return _0x3532d1;});}return null;};}function removeEntity(_0x43305f,_0x118357){return function(_0x381795){if(_0x381795){return _0x381795[_0x8a78('0x22')]()[_0x8a78('0x23')](function(){_0x43305f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21908e,_0x2737d0){return function(_0x30fbe9){if(!_0x30fbe9){_0x21908e['sendStatus'](0x194);}return _0x30fbe9;};}function handleError(_0x10e6b6,_0x43f182){_0x43f182=_0x43f182||0x1f4;return function(_0x3c51db){logger[_0x8a78('0x24')](_0x3c51db[_0x8a78('0x25')]);if(_0x3c51db[_0x8a78('0x26')]){delete _0x3c51db[_0x8a78('0x26')];}_0x10e6b6['status'](_0x43f182)['send'](_0x3c51db);};}exports[_0x8a78('0x27')]=function(_0x370927,_0x2c26d0){var _0x19c208={},_0x5138ad={},_0x1561d8={'count':0x0,'rows':[]};var _0x27c5d1=_['map'](db[_0x8a78('0x28')][_0x8a78('0x29')],function(_0x2fbc0e){return{'name':_0x2fbc0e[_0x8a78('0x2a')],'type':_0x2fbc0e[_0x8a78('0x2b')][_0x8a78('0x2c')]};});_0x5138ad[_0x8a78('0x2d')]=_[_0x8a78('0x2e')](_0x27c5d1,_0x8a78('0x26'));_0x5138ad[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x370927['query']);_0x5138ad[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0x5138ad['model'],_0x5138ad[_0x8a78('0x2f')]);_0x19c208['attributes']=_[_0x8a78('0x32')](_0x5138ad[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x370927['query']['fields']));_0x19c208[_0x8a78('0x34')]=_0x19c208['attributes'][_0x8a78('0x35')]?_0x19c208[_0x8a78('0x34')]:_0x5138ad[_0x8a78('0x2d')];if(!_0x370927[_0x8a78('0x2f')][_0x8a78('0x36')]('nolimit')){_0x19c208[_0x8a78('0x1c')]=qs[_0x8a78('0x1c')](_0x370927[_0x8a78('0x2f')][_0x8a78('0x1c')]);_0x19c208[_0x8a78('0x1a')]=qs['offset'](_0x370927[_0x8a78('0x2f')][_0x8a78('0x1a')]);}_0x19c208[_0x8a78('0x37')]=qs['sort'](_0x370927[_0x8a78('0x2f')][_0x8a78('0x38')]);_0x19c208[_0x8a78('0x39')]=qs['filters'](_['pick'](_0x370927['query'],_0x5138ad['filters']),_0x27c5d1);if(_0x370927[_0x8a78('0x2f')][_0x8a78('0x3a')]){_0x19c208[_0x8a78('0x39')]=_[_0x8a78('0x3b')](_0x19c208[_0x8a78('0x39')],{'$or':_[_0x8a78('0x2e')](_0x27c5d1,function(_0x1d5423){if(_0x1d5423['type']!==_0x8a78('0x3c')){var _0x3655d3={};_0x3655d3[_0x1d5423['name']]={'$like':'%'+_0x370927[_0x8a78('0x2f')][_0x8a78('0x3a')]+'%'};return _0x3655d3;}})});}_0x19c208=_[_0x8a78('0x3b')]({},_0x19c208,_0x370927[_0x8a78('0x3d')]);var _0x321519={'where':_0x19c208[_0x8a78('0x39')]};return db[_0x8a78('0x28')][_0x8a78('0x1d')](_0x321519)[_0x8a78('0x23')](function(_0x329ba1){_0x1561d8[_0x8a78('0x1d')]=_0x329ba1;if(_0x370927[_0x8a78('0x2f')][_0x8a78('0x3e')]){_0x19c208[_0x8a78('0x3f')]=[{'all':!![]}];}return db[_0x8a78('0x28')][_0x8a78('0x40')](_0x19c208);})[_0x8a78('0x23')](function(_0x1d87dd){_0x1561d8[_0x8a78('0x41')]=_0x1d87dd;return _0x1561d8;})[_0x8a78('0x23')](respondWithFilteredResult(_0x2c26d0,_0x19c208))[_0x8a78('0x42')](handleError(_0x2c26d0,null));};exports['show']=function(_0x5b894c,_0x2ed20a){var _0x12bbf8={'raw':![],'where':{'id':_0x5b894c[_0x8a78('0x43')]['id']}},_0xb0eea6={};_0xb0eea6[_0x8a78('0x2d')]=_[_0x8a78('0x30')](db['FreshdeskAccount'][_0x8a78('0x29')]);_0xb0eea6[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x5b894c[_0x8a78('0x2f')]);_0xb0eea6[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0xb0eea6[_0x8a78('0x2d')],_0xb0eea6[_0x8a78('0x2f')]);_0x12bbf8[_0x8a78('0x34')]=_[_0x8a78('0x32')](_0xb0eea6[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x5b894c[_0x8a78('0x2f')][_0x8a78('0x33')]));_0x12bbf8[_0x8a78('0x34')]=_0x12bbf8[_0x8a78('0x34')][_0x8a78('0x35')]?_0x12bbf8[_0x8a78('0x34')]:_0xb0eea6[_0x8a78('0x2d')];if(_0x5b894c[_0x8a78('0x2f')]['includeAll']){_0x12bbf8[_0x8a78('0x3f')]=[{'all':!![]}];}_0x12bbf8=_[_0x8a78('0x3b')]({},_0x12bbf8,_0x5b894c[_0x8a78('0x3d')]);return db['FreshdeskAccount'][_0x8a78('0x44')](_0x12bbf8)[_0x8a78('0x23')](handleEntityNotFound(_0x2ed20a,null))[_0x8a78('0x23')](respondWithResult(_0x2ed20a,null))[_0x8a78('0x42')](handleError(_0x2ed20a,null));};exports[_0x8a78('0x45')]=function(_0x32b165,_0x16d46f){return db['FreshdeskAccount'][_0x8a78('0x45')](_0x32b165['body'],{})[_0x8a78('0x23')](respondWithResult(_0x16d46f,0xc9))['catch'](handleError(_0x16d46f,null));};exports['update']=function(_0x568924,_0x2f1542){if(_0x568924[_0x8a78('0x46')]['id']){delete _0x568924[_0x8a78('0x46')]['id'];}return db[_0x8a78('0x28')][_0x8a78('0x44')]({'where':{'id':_0x568924[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f1542,null))['then'](saveUpdates(_0x568924[_0x8a78('0x46')],null))['then'](respondWithResult(_0x2f1542,null))['catch'](handleError(_0x2f1542,null));};exports[_0x8a78('0x22')]=function(_0x1eba19,_0x424400){return db[_0x8a78('0x28')][_0x8a78('0x44')]({'where':{'id':_0x1eba19[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x424400,null))[_0x8a78('0x23')](removeEntity(_0x424400,null))[_0x8a78('0x42')](handleError(_0x424400,null));};exports[_0x8a78('0x47')]=function(_0x18b2a4,_0x445cc9,_0x25709b){var _0xca898d={};var _0x22b554={};var _0x35b5b4;var _0x49e5e4;return db[_0x8a78('0x28')][_0x8a78('0x48')]({'where':{'id':_0x18b2a4[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x445cc9,null))['then'](function(_0x2fb809){if(_0x2fb809){_0x35b5b4=_0x2fb809;_0x22b554['model']=_[_0x8a78('0x30')](db[_0x8a78('0x49')]['rawAttributes']);_0x22b554[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x18b2a4['query']);_0x22b554[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0x22b554[_0x8a78('0x2d')],_0x22b554[_0x8a78('0x2f')]);_0xca898d[_0x8a78('0x34')]=_[_0x8a78('0x32')](_0x22b554[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x33')]));_0xca898d[_0x8a78('0x34')]=_0xca898d[_0x8a78('0x34')][_0x8a78('0x35')]?_0xca898d['attributes']:_0x22b554[_0x8a78('0x2d')];_0xca898d[_0x8a78('0x37')]=qs[_0x8a78('0x38')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x38')]);_0xca898d[_0x8a78('0x39')]=qs[_0x8a78('0x31')](_[_0x8a78('0x4a')](_0x18b2a4[_0x8a78('0x2f')],_0x22b554[_0x8a78('0x31')]));if(_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x3a')]){_0xca898d[_0x8a78('0x39')]=_[_0x8a78('0x3b')](_0xca898d[_0x8a78('0x39')],{'$or':_[_0x8a78('0x2e')](_0xca898d['attributes'],function(_0x402aed){var _0xe3b592={};_0xe3b592[_0x402aed]={'$like':'%'+_0x18b2a4['query'][_0x8a78('0x3a')]+'%'};return _0xe3b592;})});}_0xca898d=_[_0x8a78('0x3b')]({},_0xca898d,_0x18b2a4[_0x8a78('0x3d')]);return _0x35b5b4['getConfigurations'](_0xca898d);}})[_0x8a78('0x23')](function(_0x471b1d){if(_0x471b1d){_0x49e5e4=_0x471b1d[_0x8a78('0x35')];if(!_0x18b2a4[_0x8a78('0x2f')]['hasOwnProperty'](_0x8a78('0x4b'))){_0xca898d[_0x8a78('0x1c')]=qs[_0x8a78('0x1c')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x1c')]);_0xca898d[_0x8a78('0x1a')]=qs[_0x8a78('0x1a')](_0x18b2a4[_0x8a78('0x2f')]['offset']);}return _0x35b5b4[_0x8a78('0x47')](_0xca898d);}})[_0x8a78('0x23')](function(_0x524785){if(_0x524785){return _0x524785?{'count':_0x49e5e4,'rows':_0x524785}:null;}})['then'](respondWithResult(_0x445cc9,null))[_0x8a78('0x42')](handleError(_0x445cc9,null));};exports[_0x8a78('0x4c')]=function(_0xc9b8af,_0x30f0eb,_0x21129d){if(_0xc9b8af[_0x8a78('0x46')]['id']){delete _0xc9b8af[_0x8a78('0x46')]['id'];}return db[_0x8a78('0x28')][_0x8a78('0x48')]({'where':{'id':_0xc9b8af['params']['id']}})['then'](handleEntityNotFound(_0x30f0eb,null))['then'](function(_0x180e32){if(_0x180e32){_0xc9b8af[_0x8a78('0x46')]['AccountId']=_0x180e32['id'];_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x4d')]=integrations[_0x8a78('0x4e')](_0xc9b8af[_0x8a78('0x46')]['channel'],_0xc9b8af[_0x8a78('0x46')]['type']);_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x4f')]=integrations[_0x8a78('0x50')](_0xc9b8af['body'][_0x8a78('0x51')],_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x2b')]);return db[_0x8a78('0x49')][_0x8a78('0x45')](_0xc9b8af[_0x8a78('0x46')],{'include':[{'model':db[_0x8a78('0x52')],'as':_0x8a78('0x4d')},{'model':db['FreshdeskField'],'as':_0x8a78('0x4f')}]});}return null;})[_0x8a78('0x23')](respondWithResult(_0x30f0eb,null))['catch'](handleError(_0x30f0eb,null));};exports[_0x8a78('0x53')]=function(_0x379db5,_0x3df0b4,_0x4850ac){var _0x11ce80='';return db['FreshdeskAccount'][_0x8a78('0x48')]({'where':{'id':_0x379db5[_0x8a78('0x43')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x3df0b4,null))[_0x8a78('0x23')](function(_0x5d5c29){if(_0x5d5c29){_0x11ce80=_0x5d5c29['remoteUri'];var _0x52c94c=_0x11ce80[_0x8a78('0x54')](-0x1);if(_0x52c94c==='/'){_0x11ce80=_0x11ce80[_0x8a78('0x55')](0x0,_0x11ce80[_0x8a78('0x56')](_0x52c94c));}return rp({'method':_0x8a78('0x57'),'uri':util[_0x8a78('0x58')](_0x8a78('0x59'),_0x11ce80,_0x8a78('0x5a')),'headers':{'Authorization':util[_0x8a78('0x58')](_0x8a78('0x5b'),new Buffer(util[_0x8a78('0x58')]('%s:X',_0x5d5c29[_0x8a78('0x5c')]))[_0x8a78('0x5d')](_0x8a78('0x5e')))},'json':!![]});}})[_0x8a78('0x23')](function(_0x20c2e8){if(_0x20c2e8){var _0x1b43cd=[_0x8a78('0x5f'),_0x8a78('0x60'),_0x8a78('0x61'),_0x8a78('0x62'),_0x8a78('0x18'),_0x8a78('0x63'),_0x8a78('0x64'),_0x8a78('0x65'),_0x8a78('0x66'),'group','company'];_[_0x8a78('0x67')](_0x20c2e8,function(_0x5a506d){return _0x1b43cd[_0x8a78('0x68')](_0x5a506d[_0x8a78('0x26')])||!_0x5a506d[_0x8a78('0x69')]&&_0x5a506d[_0x8a78('0x2b')]!==_0x8a78('0x6a')&&_0x5a506d[_0x8a78('0x2b')]!==_0x8a78('0x6b');});return{'count':_0x20c2e8[_0x8a78('0x35')],'rows':_[_0x8a78('0x2e')](_0x20c2e8,function(_0x4f46bb){return{'id':_0x4f46bb[_0x8a78('0x26')],'name':_0x4f46bb[_0x8a78('0x6c')],'custom':!_0x4f46bb[_0x8a78('0x69')],'options':_0x4f46bb[_0x8a78('0x6d')]?_['map'](_0x4f46bb[_0x8a78('0x6d')],function(_0x22a759){return{'name':_[_0x8a78('0x6e')](_0x22a759),'value':_0x22a759};}):[]};})};}})[_0x8a78('0x23')](respondWithResult(_0x3df0b4,null))[_0x8a78('0x42')](function(_0x1f85fb){var _0x1d059d=_0x379db5['query']['test']?0x1f4:_0x1f85fb['statusCode']||0x1f4;logger[_0x8a78('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x8a78('0x53'),_0x1d059d,JSON[_0x8a78('0x6f')](_0x1f85fb));delete _0x1f85fb[_0x8a78('0x26')];if(_0x1d059d===0x191){_0x1d059d=0x190;}_0x3df0b4['status'](_0x1d059d)[_0x8a78('0x70')](_0x379db5['query'][_0x8a78('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x1f85fb[_0x8a78('0x72')]}:_0x1f85fb);});}; \ No newline at end of file +var _0xede3=['undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','FreshdeskAccount','count','include','findAll','catch','show','fields','includeAll','find','body','params','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Descriptions','channel','create','FreshdeskField','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','description','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xede3,0xc0));var _0x3ede=function(_0x29d655,_0x3df89d){_0x29d655=_0x29d655-0x0;var _0x41549b=_0xede3[_0x29d655];return _0x41549b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ede('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ede('0x1'));var rp=require(_0x3ede('0x2'));var moment=require(_0x3ede('0x3'));var BPromise=require(_0x3ede('0x4'));var Mustache=require(_0x3ede('0x5'));var util=require(_0x3ede('0x6'));var path=require(_0x3ede('0x7'));var sox=require(_0x3ede('0x8'));var csv=require(_0x3ede('0x9'));var ejs=require(_0x3ede('0xa'));var fs=require('fs');var fs_extra=require(_0x3ede('0xb'));var _=require(_0x3ede('0xc'));var squel=require(_0x3ede('0xd'));var crypto=require(_0x3ede('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ede('0xf'));var toCsv=require(_0x3ede('0x9'));var querystring=require(_0x3ede('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ede('0x11'));var authService=require(_0x3ede('0x12'));var qs=require(_0x3ede('0x13'));var as=require(_0x3ede('0x14'));var hardwareService=require(_0x3ede('0x15'));var logger=require('../../config/logger')(_0x3ede('0x16'));var utils=require(_0x3ede('0x17'));var config=require(_0x3ede('0x18'));var licenseUtil=require(_0x3ede('0x19'));var db=require(_0x3ede('0x1a'))['db'];var integrations=require(_0x3ede('0x1b'));function respondWithStatusCode(_0x3b2697,_0xf1a93b){_0xf1a93b=_0xf1a93b||0xcc;return function(_0x449111){if(_0x449111){return _0x3b2697[_0x3ede('0x1c')](_0xf1a93b);}return _0x3b2697[_0x3ede('0x1d')](_0xf1a93b)[_0x3ede('0x1e')]();};}function respondWithResult(_0x470bba,_0x5d2d69){_0x5d2d69=_0x5d2d69||0xc8;return function(_0x4e03a5){if(_0x4e03a5){return _0x470bba[_0x3ede('0x1d')](_0x5d2d69)['json'](_0x4e03a5);}};}function respondWithFilteredResult(_0x2ac4d5,_0x59c338){return function(_0x54ae57){if(_0x54ae57){var _0x18e11c=typeof _0x59c338[_0x3ede('0x1f')]===_0x3ede('0x20')&&typeof _0x59c338['limit']===_0x3ede('0x20');var _0x516539=_0x54ae57['count'];var _0x390421=_0x18e11c?0x0:_0x59c338[_0x3ede('0x1f')];var _0x1c0268=_0x18e11c?_0x54ae57['count']:_0x59c338[_0x3ede('0x1f')]+_0x59c338[_0x3ede('0x21')];var _0x4fdcc6;if(_0x1c0268>=_0x516539){_0x1c0268=_0x516539;_0x4fdcc6=0xc8;}else{_0x4fdcc6=0xce;}_0x2ac4d5['status'](_0x4fdcc6);return _0x2ac4d5['set'](_0x3ede('0x22'),_0x390421+'-'+_0x1c0268+'/'+_0x516539)['json'](_0x54ae57);}return null;};}function patchUpdates(_0x38ebd6){return function(_0x5a45ff){try{jsonpatch[_0x3ede('0x23')](_0x5a45ff,_0x38ebd6,!![]);}catch(_0x2de9f4){return BPromise[_0x3ede('0x24')](_0x2de9f4);}return _0x5a45ff[_0x3ede('0x25')]();};}function saveUpdates(_0x33b2d6,_0x472924){return function(_0x582d19){if(_0x582d19){return _0x582d19[_0x3ede('0x26')](_0x33b2d6)[_0x3ede('0x27')](function(_0x1e8384){return _0x1e8384;});}return null;};}function removeEntity(_0x19e9aa,_0x313699){return function(_0x10636f){if(_0x10636f){return _0x10636f[_0x3ede('0x28')]()[_0x3ede('0x27')](function(){_0x19e9aa[_0x3ede('0x1d')](0xcc)[_0x3ede('0x1e')]();});}};}function handleEntityNotFound(_0x553584,_0x5e3304){return function(_0x3765fe){if(!_0x3765fe){_0x553584[_0x3ede('0x1c')](0x194);}return _0x3765fe;};}function handleError(_0x248e17,_0x8e750c){_0x8e750c=_0x8e750c||0x1f4;return function(_0x1f0b36){logger[_0x3ede('0x29')](_0x1f0b36['stack']);if(_0x1f0b36[_0x3ede('0x2a')]){delete _0x1f0b36[_0x3ede('0x2a')];}_0x248e17[_0x3ede('0x1d')](_0x8e750c)['send'](_0x1f0b36);};}exports[_0x3ede('0x2b')]=function(_0x8daee8,_0x449e94){var _0x57cf8a={},_0x3d064a={},_0x481e4e={'count':0x0,'rows':[]};var _0x27c706=_[_0x3ede('0x2c')](db['FreshdeskAccount']['rawAttributes'],function(_0x319fd4){return{'name':_0x319fd4[_0x3ede('0x2d')],'type':_0x319fd4[_0x3ede('0x2e')][_0x3ede('0x2f')]};});_0x3d064a[_0x3ede('0x30')]=_[_0x3ede('0x2c')](_0x27c706,_0x3ede('0x2a'));_0x3d064a[_0x3ede('0x31')]=_[_0x3ede('0x32')](_0x8daee8[_0x3ede('0x31')]);_0x3d064a['filters']=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],_0x3d064a['query']);_0x57cf8a[_0x3ede('0x34')]=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],qs['fields'](_0x8daee8[_0x3ede('0x31')]['fields']));_0x57cf8a[_0x3ede('0x34')]=_0x57cf8a[_0x3ede('0x34')][_0x3ede('0x35')]?_0x57cf8a['attributes']:_0x3d064a['model'];if(!_0x8daee8[_0x3ede('0x31')][_0x3ede('0x36')](_0x3ede('0x37'))){_0x57cf8a[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x8daee8['query'][_0x3ede('0x21')]);_0x57cf8a[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x8daee8[_0x3ede('0x31')]['offset']);}_0x57cf8a[_0x3ede('0x38')]=qs[_0x3ede('0x39')](_0x8daee8[_0x3ede('0x31')]['sort']);_0x57cf8a['where']=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x8daee8[_0x3ede('0x31')],_0x3d064a[_0x3ede('0x3a')]),_0x27c706);if(_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]){_0x57cf8a[_0x3ede('0x3d')]=_['merge'](_0x57cf8a[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x27c706,function(_0xba1c37){if(_0xba1c37['type']!=='VIRTUAL'){var _0x5f0b05={};_0x5f0b05[_0xba1c37[_0x3ede('0x2a')]]={'$like':'%'+_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]+'%'};return _0x5f0b05;}})});}_0x57cf8a=_[_0x3ede('0x3e')]({},_0x57cf8a,_0x8daee8[_0x3ede('0x3f')]);var _0xe752e1={'where':_0x57cf8a[_0x3ede('0x3d')]};return db[_0x3ede('0x40')][_0x3ede('0x41')](_0xe752e1)['then'](function(_0xbd187d){_0x481e4e[_0x3ede('0x41')]=_0xbd187d;if(_0x8daee8[_0x3ede('0x31')]['includeAll']){_0x57cf8a[_0x3ede('0x42')]=[{'all':!![]}];}return db[_0x3ede('0x40')][_0x3ede('0x43')](_0x57cf8a);})[_0x3ede('0x27')](function(_0x59122d){_0x481e4e['rows']=_0x59122d;return _0x481e4e;})[_0x3ede('0x27')](respondWithFilteredResult(_0x449e94,_0x57cf8a))[_0x3ede('0x44')](handleError(_0x449e94,null));};exports[_0x3ede('0x45')]=function(_0x15bfbb,_0x507054){var _0x133c73={'raw':![],'where':{'id':_0x15bfbb['params']['id']}},_0x342bf7={};_0x342bf7['model']=_['keys'](db[_0x3ede('0x40')]['rawAttributes']);_0x342bf7['query']=_['keys'](_0x15bfbb[_0x3ede('0x31')]);_0x342bf7[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x342bf7[_0x3ede('0x30')],_0x342bf7[_0x3ede('0x31')]);_0x133c73[_0x3ede('0x34')]=_['intersection'](_0x342bf7[_0x3ede('0x30')],qs['fields'](_0x15bfbb['query'][_0x3ede('0x46')]));_0x133c73[_0x3ede('0x34')]=_0x133c73[_0x3ede('0x34')]['length']?_0x133c73['attributes']:_0x342bf7[_0x3ede('0x30')];if(_0x15bfbb[_0x3ede('0x31')][_0x3ede('0x47')]){_0x133c73['include']=[{'all':!![]}];}_0x133c73=_[_0x3ede('0x3e')]({},_0x133c73,_0x15bfbb[_0x3ede('0x3f')]);return db[_0x3ede('0x40')][_0x3ede('0x48')](_0x133c73)[_0x3ede('0x27')](handleEntityNotFound(_0x507054,null))[_0x3ede('0x27')](respondWithResult(_0x507054,null))[_0x3ede('0x44')](handleError(_0x507054,null));};exports['create']=function(_0x56081d,_0x53916c){return db['FreshdeskAccount']['create'](_0x56081d[_0x3ede('0x49')],{})[_0x3ede('0x27')](respondWithResult(_0x53916c,0xc9))[_0x3ede('0x44')](handleError(_0x53916c,null));};exports[_0x3ede('0x26')]=function(_0x12f296,_0x1ebd75){if(_0x12f296[_0x3ede('0x49')]['id']){delete _0x12f296['body']['id'];}return db['FreshdeskAccount'][_0x3ede('0x48')]({'where':{'id':_0x12f296[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x1ebd75,null))[_0x3ede('0x27')](saveUpdates(_0x12f296[_0x3ede('0x49')],null))[_0x3ede('0x27')](respondWithResult(_0x1ebd75,null))['catch'](handleError(_0x1ebd75,null));};exports[_0x3ede('0x28')]=function(_0x7fbec6,_0xc55e01){return db[_0x3ede('0x40')][_0x3ede('0x48')]({'where':{'id':_0x7fbec6[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0xc55e01,null))[_0x3ede('0x27')](removeEntity(_0xc55e01,null))['catch'](handleError(_0xc55e01,null));};exports['getConfigurations']=function(_0x573449,_0x284680,_0x6bdbee){var _0x14ccec={};var _0x20068f={};var _0x519daf;var _0x253773;return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x573449['params']['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x284680,null))['then'](function(_0x5a874f){if(_0x5a874f){_0x519daf=_0x5a874f;_0x20068f[_0x3ede('0x30')]=_[_0x3ede('0x32')](db[_0x3ede('0x4b')]['rawAttributes']);_0x20068f[_0x3ede('0x31')]=_['keys'](_0x573449['query']);_0x20068f[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x20068f[_0x3ede('0x30')],_0x20068f['query']);_0x14ccec['attributes']=_['intersection'](_0x20068f[_0x3ede('0x30')],qs[_0x3ede('0x46')](_0x573449[_0x3ede('0x31')]['fields']));_0x14ccec['attributes']=_0x14ccec['attributes'][_0x3ede('0x35')]?_0x14ccec[_0x3ede('0x34')]:_0x20068f[_0x3ede('0x30')];_0x14ccec[_0x3ede('0x38')]=qs['sort'](_0x573449[_0x3ede('0x31')][_0x3ede('0x39')]);_0x14ccec[_0x3ede('0x3d')]=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x573449['query'],_0x20068f['filters']));if(_0x573449['query'][_0x3ede('0x3c')]){_0x14ccec['where']=_['merge'](_0x14ccec[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x14ccec[_0x3ede('0x34')],function(_0x39619a){var _0xdccf67={};_0xdccf67[_0x39619a]={'$like':'%'+_0x573449[_0x3ede('0x31')]['filter']+'%'};return _0xdccf67;})});}_0x14ccec=_[_0x3ede('0x3e')]({},_0x14ccec,_0x573449[_0x3ede('0x3f')]);return _0x519daf[_0x3ede('0x4c')](_0x14ccec);}})['then'](function(_0x44de0f){if(_0x44de0f){_0x253773=_0x44de0f[_0x3ede('0x35')];if(!_0x573449['query'][_0x3ede('0x36')](_0x3ede('0x37'))){_0x14ccec[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x573449[_0x3ede('0x31')]['limit']);_0x14ccec[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x573449[_0x3ede('0x31')]['offset']);}return _0x519daf['getConfigurations'](_0x14ccec);}})['then'](function(_0x1060dd){if(_0x1060dd){return _0x1060dd?{'count':_0x253773,'rows':_0x1060dd}:null;}})[_0x3ede('0x27')](respondWithResult(_0x284680,null))['catch'](handleError(_0x284680,null));};exports[_0x3ede('0x4d')]=function(_0x3c2eec,_0x28ba81,_0x48a2e7){if(_0x3c2eec['body']['id']){delete _0x3c2eec[_0x3ede('0x49')]['id'];}return db[_0x3ede('0x40')][_0x3ede('0x4e')]({'where':{'id':_0x3c2eec[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x28ba81,null))[_0x3ede('0x27')](function(_0x28c19e){if(_0x28c19e){_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x4f')]=_0x28c19e['id'];_0x3c2eec[_0x3ede('0x49')]['Subjects']=integrations['getSubjects'](_0x3c2eec[_0x3ede('0x49')]['channel'],_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x2e')]);_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x50')]=integrations['getDescriptions'](_0x3c2eec['body'][_0x3ede('0x51')],_0x3c2eec[_0x3ede('0x49')]['type']);return db[_0x3ede('0x4b')][_0x3ede('0x52')](_0x3c2eec[_0x3ede('0x49')],{'include':[{'model':db[_0x3ede('0x53')],'as':'Subjects'},{'model':db[_0x3ede('0x53')],'as':'Descriptions'}]});}return null;})[_0x3ede('0x27')](respondWithResult(_0x28ba81,null))[_0x3ede('0x44')](handleError(_0x28ba81,null));};exports['getFields']=function(_0x569aa2,_0x2842df,_0x39205f){var _0x27e3c3='';return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x569aa2[_0x3ede('0x4a')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x2842df,null))['then'](function(_0x13c593){if(_0x13c593){_0x27e3c3=_0x13c593[_0x3ede('0x54')];var _0x1cea7d=_0x27e3c3[_0x3ede('0x55')](-0x1);if(_0x1cea7d==='/'){_0x27e3c3=_0x27e3c3['substring'](0x0,_0x27e3c3[_0x3ede('0x56')](_0x1cea7d));}return rp({'method':_0x3ede('0x57'),'uri':util[_0x3ede('0x58')](_0x3ede('0x59'),_0x27e3c3,_0x3ede('0x5a')),'headers':{'Authorization':util[_0x3ede('0x58')](_0x3ede('0x5b'),new Buffer(util[_0x3ede('0x58')](_0x3ede('0x5c'),_0x13c593[_0x3ede('0x5d')]))[_0x3ede('0x5e')](_0x3ede('0x5f')))},'json':!![]});}})[_0x3ede('0x27')](function(_0x4691d2){if(_0x4691d2){var _0x4fd768=['requester','subject','agent',_0x3ede('0x60'),'status','priority',_0x3ede('0x61'),_0x3ede('0x62'),_0x3ede('0x63'),'group',_0x3ede('0x64')];_[_0x3ede('0x65')](_0x4691d2,function(_0xa9e773){return _0x4fd768[_0x3ede('0x66')](_0xa9e773[_0x3ede('0x2a')])||!_0xa9e773[_0x3ede('0x67')]&&_0xa9e773[_0x3ede('0x2e')]!=='custom_text'&&_0xa9e773['type']!==_0x3ede('0x68');});return{'count':_0x4691d2[_0x3ede('0x35')],'rows':_[_0x3ede('0x2c')](_0x4691d2,function(_0x5aaa01){return{'id':_0x5aaa01[_0x3ede('0x2a')],'name':_0x5aaa01[_0x3ede('0x69')],'custom':!_0x5aaa01[_0x3ede('0x67')],'options':_0x5aaa01[_0x3ede('0x6a')]?_['map'](_0x5aaa01[_0x3ede('0x6a')],function(_0x4ea3b6){return{'name':_['capitalize'](_0x4ea3b6),'value':_0x4ea3b6};}):[]};})};}})[_0x3ede('0x27')](respondWithResult(_0x2842df,null))['catch'](function(_0x1996d9){var _0x130f11=_0x569aa2['query'][_0x3ede('0x6b')]?0x1f4:_0x1996d9[_0x3ede('0x6c')]||0x1f4;logger['error'](_0x3ede('0x6d'),_0x3ede('0x6e'),_0x130f11,JSON['stringify'](_0x1996d9));delete _0x1996d9[_0x3ede('0x2a')];if(_0x130f11===0x191){_0x130f11=0x190;}_0x2842df['status'](_0x130f11)['send'](_0x569aa2[_0x3ede('0x31')][_0x3ede('0x6b')]?{'message':_0x3ede('0x6f'),'statusCode':_0x1996d9[_0x3ede('0x6c')]}:_0x1996d9);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9a8a5c8..ff1b6f8 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 _0x80e0=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x80e0,0xd2));var _0x080e=function(_0x58b067,_0x3cdf3b){_0x58b067=_0x58b067-0x0;var _0x3c4775=_0x80e0[_0x58b067];return _0x3c4775;};'use strict';var _=require(_0x080e('0x0'));var util=require(_0x080e('0x1'));var logger=require('../../config/logger')(_0x080e('0x2'));var moment=require(_0x080e('0x3'));var BPromise=require(_0x080e('0x4'));var rp=require(_0x080e('0x5'));var fs=require('fs');var path=require(_0x080e('0x6'));var rimraf=require(_0x080e('0x7'));var config=require(_0x080e('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x080e('0x9'));module['exports']=function(_0x52ad5e,_0x2c54b3){return _0x52ad5e[_0x080e('0xa')](_0x080e('0xb'),attributes,{'tableName':_0x080e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a7e=['api','bluebird','../../components/integrations/configuration','define','int_freshdesk_accounts','lodash','util','../../config/logger'];(function(_0x2b13bc,_0x45b308){var _0x48275b=function(_0x21d34a){while(--_0x21d34a){_0x2b13bc['push'](_0x2b13bc['shift']());}};_0x48275b(++_0x45b308);}(_0x6a7e,0xd5));var _0xe6a7=function(_0x14d7c9,_0x5d3e5e){_0x14d7c9=_0x14d7c9-0x0;var _0x2e9ede=_0x6a7e[_0x14d7c9];return _0x2e9ede;};'use strict';var _=require(_0xe6a7('0x0'));var util=require(_0xe6a7('0x1'));var logger=require(_0xe6a7('0x2'))(_0xe6a7('0x3'));var moment=require('moment');var BPromise=require(_0xe6a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xe6a7('0x5'));module['exports']=function(_0x10cd8d,_0x6b7ee1){return _0x10cd8d[_0xe6a7('0x6')]('FreshdeskAccount',attributes,{'tableName':_0xe6a7('0x7'),'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 e25a5ab..6b62cfe 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 _0x9658=['find','raw','where','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','attributes','limit','include','map','model','ShowFreshdeskAccount','FreshdeskAccount'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9658,0x6f));var _0x8965=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0x9658[_0x813d0a];return _0x241352;};'use strict';var _=require(_0x8965('0x0'));var util=require('util');var moment=require(_0x8965('0x1'));var BPromise=require(_0x8965('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8965('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8965('0x4'));var logger=require(_0x8965('0x5'))(_0x8965('0x6'));var config=require('../../config/environment');var jayson=require(_0x8965('0x7'));var client=jayson[_0x8965('0x8')][_0x8965('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x290f30,_0x271060,_0x27b334){return new BPromise(function(_0x1e7d61,_0xe14503){return client[_0x8965('0xa')](_0x290f30,_0x27b334)[_0x8965('0xb')](function(_0x214249){logger[_0x8965('0xc')](_0x8965('0xd'),_0x271060,_0x8965('0xe'));logger[_0x8965('0xf')](_0x8965('0x10'),_0x271060,_0x8965('0xe'),JSON[_0x8965('0x11')](_0x214249));if(_0x214249[_0x8965('0x12')]){if(_0x214249['error'][_0x8965('0x13')]===0x1f4){logger[_0x8965('0x12')](_0x8965('0xd'),_0x271060,_0x214249[_0x8965('0x12')][_0x8965('0x14')]);return _0xe14503(_0x214249[_0x8965('0x12')][_0x8965('0x14')]);}logger[_0x8965('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x271060,_0x214249[_0x8965('0x12')][_0x8965('0x14')]);return _0x1e7d61(_0x214249[_0x8965('0x12')][_0x8965('0x14')]);}else{logger[_0x8965('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x271060,_0x8965('0xe'));_0x1e7d61(_0x214249[_0x8965('0x15')][_0x8965('0x14')]);}})[_0x8965('0x16')](function(_0x5c7d55){logger[_0x8965('0x12')](_0x8965('0xd'),_0x271060,_0x5c7d55);_0xe14503(_0x5c7d55);});});}exports[_0x8965('0x17')]=function(_0x2e6851){var _0x2b4f64=this;return new Promise(function(_0x927a0a,_0x579fe6){return db['FreshdeskAccount'][_0x8965('0x18')]({'raw':_0x2e6851[_0x8965('0x19')]?_0x2e6851['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e6851['options']?_0x2e6851['options']['where']||null:null,'attributes':_0x2e6851[_0x8965('0x19')]?_0x2e6851['options'][_0x8965('0x1a')]||null:null,'limit':_0x2e6851[_0x8965('0x19')]?_0x2e6851[_0x8965('0x19')][_0x8965('0x1b')]||null:null,'include':_0x2e6851['options']?_0x2e6851[_0x8965('0x19')][_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x2e6851[_0x8965('0x19')][_0x8965('0x1c')],function(_0x33c208){return{'model':db[_0x33c208[_0x8965('0x1e')]],'as':_0x33c208['as'],'attributes':_0x33c208[_0x8965('0x1a')],'include':_0x33c208[_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x33c208['include'],function(_0x279402){return{'model':db[_0x279402[_0x8965('0x1e')]],'as':_0x279402['as'],'attributes':_0x279402['attributes'],'include':_0x279402[_0x8965('0x1c')]?_['map'](_0x279402['include'],function(_0x1955c1){return{'model':db[_0x1955c1[_0x8965('0x1e')]],'as':_0x1955c1['as'],'attributes':_0x1955c1[_0x8965('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8965('0xb')](function(_0x5abd14){logger['info'](_0x8965('0x17'),_0x2e6851);logger[_0x8965('0xf')](_0x8965('0x17'),_0x2e6851,JSON[_0x8965('0x11')](_0x5abd14));_0x927a0a(_0x5abd14);})[_0x8965('0x16')](function(_0x454748){logger['error']('GetFreshdeskAccount',_0x454748[_0x8965('0x14')],_0x2e6851);_0x579fe6(_0x2b4f64['error'](0x1f4,_0x454748['message']));});});};exports[_0x8965('0x1f')]=function(_0x58df71){var _0x5d169=this;return new Promise(function(_0x4c6c05,_0x4ad940){return db[_0x8965('0x20')][_0x8965('0x21')]({'raw':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')][_0x8965('0x22')]===undefined?!![]:![]:!![],'where':_0x58df71[_0x8965('0x19')]?_0x58df71['options'][_0x8965('0x23')]||null:null,'attributes':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')]['attributes']||null:null,'include':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')][_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x58df71[_0x8965('0x19')][_0x8965('0x1c')],function(_0x30ce7d){return{'model':db[_0x30ce7d[_0x8965('0x1e')]],'as':_0x30ce7d['as'],'attributes':_0x30ce7d[_0x8965('0x1a')],'include':_0x30ce7d[_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x30ce7d[_0x8965('0x1c')],function(_0x333f70){return{'model':db[_0x333f70['model']],'as':_0x333f70['as'],'attributes':_0x333f70[_0x8965('0x1a')],'include':_0x333f70[_0x8965('0x1c')]?_['map'](_0x333f70['include'],function(_0x4149f1){return{'model':db[_0x4149f1[_0x8965('0x1e')]],'as':_0x4149f1['as'],'attributes':_0x4149f1[_0x8965('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8965('0xb')](function(_0x584e46){logger['info'](_0x8965('0x1f'),_0x58df71);logger['debug'](_0x8965('0x1f'),_0x58df71,JSON[_0x8965('0x11')](_0x584e46));_0x4c6c05(_0x584e46);})[_0x8965('0x16')](function(_0x5eac49){logger[_0x8965('0x12')]('ShowFreshdeskAccount',_0x5eac49[_0x8965('0x14')],_0x58df71);_0x4ad940(_0x5d169['error'](0x1f4,_0x5eac49[_0x8965('0x14')]));});});}; \ No newline at end of file +var _0x27b5=['then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','debug','find','ShowFreshdeskAccount','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x1f9b5e,_0x3be190){var _0x115027=function(_0x11ce45){while(--_0x11ce45){_0x1f9b5e['push'](_0x1f9b5e['shift']());}};_0x115027(++_0x3be190);}(_0x27b5,0x1a3));var _0x527b=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0x27b5[_0x3877c1];return _0x59056a;};'use strict';var _=require('lodash');var util=require(_0x527b('0x0'));var moment=require(_0x527b('0x1'));var BPromise=require(_0x527b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x527b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x527b('0x4'));var logger=require(_0x527b('0x5'))(_0x527b('0x6'));var config=require(_0x527b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x527b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x361d84,_0x394192,_0x978f74){return new BPromise(function(_0x314bff,_0x373ae9){return client[_0x527b('0x9')](_0x361d84,_0x978f74)[_0x527b('0xa')](function(_0x5d6b21){logger[_0x527b('0xb')](_0x527b('0xc'),_0x394192,_0x527b('0xd'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x394192,_0x527b('0xd'),JSON[_0x527b('0xe')](_0x5d6b21));if(_0x5d6b21[_0x527b('0xf')]){if(_0x5d6b21[_0x527b('0xf')]['code']===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x394192,_0x5d6b21[_0x527b('0xf')]['message']);return _0x373ae9(_0x5d6b21[_0x527b('0xf')]['message']);}logger[_0x527b('0xf')](_0x527b('0xc'),_0x394192,_0x5d6b21[_0x527b('0xf')][_0x527b('0x10')]);return _0x314bff(_0x5d6b21[_0x527b('0xf')][_0x527b('0x10')]);}else{logger[_0x527b('0xb')](_0x527b('0xc'),_0x394192,_0x527b('0xd'));_0x314bff(_0x5d6b21[_0x527b('0x11')]['message']);}})[_0x527b('0x12')](function(_0x1a8ef9){logger[_0x527b('0xf')](_0x527b('0xc'),_0x394192,_0x1a8ef9);_0x373ae9(_0x1a8ef9);});});}exports[_0x527b('0x13')]=function(_0x1e0957){var _0x18bbf1=this;return new Promise(function(_0x10ef0b,_0x118f9e){return db[_0x527b('0x14')][_0x527b('0x15')]({'raw':_0x1e0957[_0x527b('0x16')]?_0x1e0957[_0x527b('0x16')][_0x527b('0x17')]===undefined?!![]:![]:!![],'where':_0x1e0957['options']?_0x1e0957['options'][_0x527b('0x18')]||null:null,'attributes':_0x1e0957[_0x527b('0x16')]?_0x1e0957[_0x527b('0x16')]['attributes']||null:null,'limit':_0x1e0957[_0x527b('0x16')]?_0x1e0957[_0x527b('0x16')][_0x527b('0x19')]||null:null,'include':_0x1e0957[_0x527b('0x16')]?_0x1e0957[_0x527b('0x16')][_0x527b('0x1a')]?_[_0x527b('0x1b')](_0x1e0957[_0x527b('0x16')][_0x527b('0x1a')],function(_0x4e21b0){return{'model':db[_0x4e21b0['model']],'as':_0x4e21b0['as'],'attributes':_0x4e21b0[_0x527b('0x1c')],'include':_0x4e21b0[_0x527b('0x1a')]?_[_0x527b('0x1b')](_0x4e21b0['include'],function(_0x32fee1){return{'model':db[_0x32fee1[_0x527b('0x1d')]],'as':_0x32fee1['as'],'attributes':_0x32fee1[_0x527b('0x1c')],'include':_0x32fee1[_0x527b('0x1a')]?_[_0x527b('0x1b')](_0x32fee1[_0x527b('0x1a')],function(_0x50ecec){return{'model':db[_0x50ecec['model']],'as':_0x50ecec['as'],'attributes':_0x50ecec[_0x527b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x527b('0xa')](function(_0x4eba15){logger[_0x527b('0xb')](_0x527b('0x13'),_0x1e0957);logger[_0x527b('0x1e')](_0x527b('0x13'),_0x1e0957,JSON['stringify'](_0x4eba15));_0x10ef0b(_0x4eba15);})[_0x527b('0x12')](function(_0x163abe){logger['error'](_0x527b('0x13'),_0x163abe[_0x527b('0x10')],_0x1e0957);_0x118f9e(_0x18bbf1[_0x527b('0xf')](0x1f4,_0x163abe['message']));});});};exports['ShowFreshdeskAccount']=function(_0x59f1aa){var _0x3b7a52=this;return new Promise(function(_0x134d8c,_0x5708c4){return db['FreshdeskAccount'][_0x527b('0x1f')]({'raw':_0x59f1aa[_0x527b('0x16')]?_0x59f1aa[_0x527b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x59f1aa[_0x527b('0x16')]?_0x59f1aa[_0x527b('0x16')][_0x527b('0x18')]||null:null,'attributes':_0x59f1aa['options']?_0x59f1aa['options'][_0x527b('0x1c')]||null:null,'include':_0x59f1aa[_0x527b('0x16')]?_0x59f1aa[_0x527b('0x16')][_0x527b('0x1a')]?_['map'](_0x59f1aa['options']['include'],function(_0x1484bb){return{'model':db[_0x1484bb[_0x527b('0x1d')]],'as':_0x1484bb['as'],'attributes':_0x1484bb[_0x527b('0x1c')],'include':_0x1484bb[_0x527b('0x1a')]?_['map'](_0x1484bb[_0x527b('0x1a')],function(_0x47e62e){return{'model':db[_0x47e62e[_0x527b('0x1d')]],'as':_0x47e62e['as'],'attributes':_0x47e62e['attributes'],'include':_0x47e62e[_0x527b('0x1a')]?_[_0x527b('0x1b')](_0x47e62e[_0x527b('0x1a')],function(_0x579979){return{'model':db[_0x579979[_0x527b('0x1d')]],'as':_0x579979['as'],'attributes':_0x579979[_0x527b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x527b('0xa')](function(_0x1fa425){logger['info']('ShowFreshdeskAccount',_0x59f1aa);logger[_0x527b('0x1e')]('ShowFreshdeskAccount',_0x59f1aa,JSON[_0x527b('0xe')](_0x1fa425));_0x134d8c(_0x1fa425);})[_0x527b('0x12')](function(_0xa97b94){logger[_0x527b('0xf')](_0x527b('0x20'),_0xa97b94[_0x527b('0x10')],_0x59f1aa);_0x5708c4(_0x3b7a52['error'](0x1f4,_0xa97b94[_0x527b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 2fcac76..523d37a 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 _0x1347=['Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create','setTags','put','update','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x10a9f3,_0x3f6e77){var _0x1d1a7e=function(_0x36bb17){while(--_0x36bb17){_0x10a9f3['push'](_0x10a9f3['shift']());}};_0x1d1a7e(++_0x3f6e77);}(_0x1347,0x15b));var _0x7134=function(_0x14e4cf,_0x5ab1da){_0x14e4cf=_0x14e4cf-0x0;var _0x2770b=_0x1347[_0x14e4cf];return _0x2770b;};'use strict';var multer=require('multer');var util=require(_0x7134('0x0'));var path=require(_0x7134('0x1'));var timeout=require(_0x7134('0x2'));var express=require('express');var router=express[_0x7134('0x3')]();var fs_extra=require(_0x7134('0x4'));var auth=require(_0x7134('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7134('0x6'));var controller=require(_0x7134('0x7'));router[_0x7134('0x8')]('/',auth[_0x7134('0x9')](),controller[_0x7134('0xa')]);router[_0x7134('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7134('0x8')](_0x7134('0xb'),auth[_0x7134('0x9')](),controller[_0x7134('0xc')]);router[_0x7134('0x8')](_0x7134('0xd'),auth[_0x7134('0x9')](),controller[_0x7134('0xe')]);router['get'](_0x7134('0xf'),auth[_0x7134('0x9')](),controller['getDescriptions']);router[_0x7134('0x8')]('/:id/tags',auth[_0x7134('0x9')](),controller[_0x7134('0x10')]);router[_0x7134('0x11')]('/',auth[_0x7134('0x9')](),controller[_0x7134('0x12')]);router['post']('/:id/tags',auth[_0x7134('0x9')](),controller[_0x7134('0x13')]);router[_0x7134('0x14')]('/:id',auth[_0x7134('0x9')](),controller[_0x7134('0x15')]);router[_0x7134('0x16')](_0x7134('0x17'),auth[_0x7134('0x9')](),controller[_0x7134('0x18')]);module['exports']=router; \ No newline at end of file +var _0xd849=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','exports','multer','util'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0xd849,0x1d9));var _0x9d84=function(_0x1d4391,_0x16b6ca){_0x1d4391=_0x1d4391-0x0;var _0x51ddfb=_0xd849[_0x1d4391];return _0x51ddfb;};'use strict';var multer=require(_0x9d84('0x0'));var util=require(_0x9d84('0x1'));var path=require(_0x9d84('0x2'));var timeout=require(_0x9d84('0x3'));var express=require(_0x9d84('0x4'));var router=express[_0x9d84('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d84('0x6'));var interaction=require(_0x9d84('0x7'));var config=require('../../config/environment');var controller=require(_0x9d84('0x8'));router[_0x9d84('0x9')]('/',auth[_0x9d84('0xa')](),controller[_0x9d84('0xb')]);router[_0x9d84('0x9')](_0x9d84('0xc'),auth[_0x9d84('0xa')](),controller[_0x9d84('0xd')]);router[_0x9d84('0x9')]('/:id/fields',auth[_0x9d84('0xa')](),controller['getFields']);router[_0x9d84('0x9')](_0x9d84('0xe'),auth['isAuthenticated'](),controller[_0x9d84('0xf')]);router[_0x9d84('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x9d84('0x10')]);router['get'](_0x9d84('0x11'),auth['isAuthenticated'](),controller[_0x9d84('0x12')]);router['post']('/',auth[_0x9d84('0xa')](),controller[_0x9d84('0x13')]);router[_0x9d84('0x14')](_0x9d84('0x11'),auth[_0x9d84('0xa')](),controller[_0x9d84('0x15')]);router[_0x9d84('0x16')](_0x9d84('0xc'),auth[_0x9d84('0xa')](),controller[_0x9d84('0x17')]);router['delete']('/:id',auth[_0x9d84('0xa')](),controller['destroy']);module[_0x9d84('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index abf2082..b7b95c6 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 _0x24b6=['exports','STRING'];(function(_0x348ae6,_0x86aac0){var _0x189205=function(_0x565a75){while(--_0x565a75){_0x348ae6['push'](_0x348ae6['shift']());}};_0x189205(++_0x86aac0);}(_0x24b6,0x124));var _0x624b=function(_0x21c521,_0x441100){_0x21c521=_0x21c521-0x0;var _0x13ae59=_0x24b6[_0x21c521];return _0x13ae59;};'use strict';var Sequelize=require('sequelize');module[_0x624b('0x0')]={'name':{'type':Sequelize[_0x624b('0x1')]},'description':{'type':Sequelize[_0x624b('0x1')]}}; \ No newline at end of file +var _0xa0b0=['sequelize','exports','STRING'];(function(_0x4f091e,_0x7fad8d){var _0x1af6f5=function(_0x8e8605){while(--_0x8e8605){_0x4f091e['push'](_0x4f091e['shift']());}};_0x1af6f5(++_0x7fad8d);}(_0xa0b0,0x111));var _0x0a0b=function(_0x35b521,_0x141277){_0x35b521=_0x35b521-0x0;var _0x4a3fb6=_0xa0b0[_0x35b521];return _0x4a3fb6;};'use strict';var Sequelize=require(_0x0a0b('0x0'));module[_0x0a0b('0x1')]={'name':{'type':Sequelize[_0x0a0b('0x2')]},'description':{'type':Sequelize[_0x0a0b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 389a470..0658087 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 _0x7641=['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','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','length','options','find','create','body','update','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x319889,_0x13d5bf){var _0x4376e9=function(_0xfdf57c){while(--_0xfdf57c){_0x319889['push'](_0x319889['shift']());}};_0x4376e9(++_0x13d5bf);}(_0x7641,0x153));var _0x1764=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7641[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0x1764('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1764('0x1'));var jsonpatch=require(_0x1764('0x2'));var rp=require(_0x1764('0x3'));var moment=require(_0x1764('0x4'));var BPromise=require(_0x1764('0x5'));var Mustache=require(_0x1764('0x6'));var util=require(_0x1764('0x7'));var path=require(_0x1764('0x8'));var sox=require(_0x1764('0x9'));var csv=require(_0x1764('0xa'));var ejs=require(_0x1764('0xb'));var fs=require('fs');var fs_extra=require(_0x1764('0xc'));var _=require(_0x1764('0xd'));var squel=require('squel');var crypto=require(_0x1764('0xe'));var jsforce=require(_0x1764('0xf'));var deskjs=require(_0x1764('0x10'));var toCsv=require(_0x1764('0xa'));var querystring=require(_0x1764('0x11'));var Papa=require(_0x1764('0x12'));var Redis=require(_0x1764('0x13'));var authService=require(_0x1764('0x14'));var qs=require(_0x1764('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1764('0x16'));var logger=require(_0x1764('0x17'))(_0x1764('0x18'));var utils=require(_0x1764('0x19'));var config=require(_0x1764('0x1a'));var licenseUtil=require(_0x1764('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53f72f,_0x4d3bec){_0x4d3bec=_0x4d3bec||0xcc;return function(_0xe1abe9){if(_0xe1abe9){return _0x53f72f[_0x1764('0x1c')](_0x4d3bec);}return _0x53f72f['status'](_0x4d3bec)[_0x1764('0x1d')]();};}function respondWithResult(_0x421f2f,_0x459014){_0x459014=_0x459014||0xc8;return function(_0x3298bb){if(_0x3298bb){return _0x421f2f[_0x1764('0x1e')](_0x459014)[_0x1764('0x1f')](_0x3298bb);}};}function respondWithFilteredResult(_0x429877,_0x2bfb62){return function(_0x1ad53d){if(_0x1ad53d){var _0xe77604=typeof _0x2bfb62['offset']===_0x1764('0x20')&&typeof _0x2bfb62[_0x1764('0x21')]==='undefined';var _0x56ce4b=_0x1ad53d[_0x1764('0x22')];var _0x220e22=_0xe77604?0x0:_0x2bfb62[_0x1764('0x23')];var _0x9a67bc=_0xe77604?_0x1ad53d[_0x1764('0x22')]:_0x2bfb62['offset']+_0x2bfb62[_0x1764('0x21')];var _0x2a6d19;if(_0x9a67bc>=_0x56ce4b){_0x9a67bc=_0x56ce4b;_0x2a6d19=0xc8;}else{_0x2a6d19=0xce;}_0x429877[_0x1764('0x1e')](_0x2a6d19);return _0x429877[_0x1764('0x24')](_0x1764('0x25'),_0x220e22+'-'+_0x9a67bc+'/'+_0x56ce4b)[_0x1764('0x1f')](_0x1ad53d);}return null;};}function patchUpdates(_0x1aa81f){return function(_0x29b446){try{jsonpatch[_0x1764('0x26')](_0x29b446,_0x1aa81f,!![]);}catch(_0x29482c){return BPromise['reject'](_0x29482c);}return _0x29b446[_0x1764('0x27')]();};}function saveUpdates(_0x5e4467,_0x3e4782){return function(_0x5eceda){if(_0x5eceda){return _0x5eceda['update'](_0x5e4467)[_0x1764('0x28')](function(_0x5ed137){return _0x5ed137;});}return null;};}function removeEntity(_0xd51343,_0x370d9e){return function(_0x4cd659){if(_0x4cd659){return _0x4cd659[_0x1764('0x29')]()['then'](function(){_0xd51343[_0x1764('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aade1,_0x77853b){return function(_0x45ab7f){if(!_0x45ab7f){_0x5aade1[_0x1764('0x1c')](0x194);}return _0x45ab7f;};}function handleError(_0x37cabf,_0x4928e6){_0x4928e6=_0x4928e6||0x1f4;return function(_0x460e55){logger[_0x1764('0x2a')](_0x460e55[_0x1764('0x2b')]);if(_0x460e55[_0x1764('0x2c')]){delete _0x460e55['name'];}_0x37cabf[_0x1764('0x1e')](_0x4928e6)[_0x1764('0x2d')](_0x460e55);};}exports['index']=function(_0x1f4d6b,_0x32c9dd){var _0x336bb3={},_0x2b9d87={},_0x45ebb8={'count':0x0,'rows':[]};var _0x353643=_[_0x1764('0x2e')](db[_0x1764('0x2f')][_0x1764('0x30')],function(_0x10453d){return{'name':_0x10453d[_0x1764('0x31')],'type':_0x10453d[_0x1764('0x32')][_0x1764('0x33')]};});_0x2b9d87[_0x1764('0x34')]=_['map'](_0x353643,_0x1764('0x2c'));_0x2b9d87['query']=_[_0x1764('0x35')](_0x1f4d6b[_0x1764('0x36')]);_0x2b9d87[_0x1764('0x37')]=_[_0x1764('0x38')](_0x2b9d87[_0x1764('0x34')],_0x2b9d87[_0x1764('0x36')]);_0x336bb3['attributes']=_[_0x1764('0x38')](_0x2b9d87[_0x1764('0x34')],qs[_0x1764('0x39')](_0x1f4d6b['query'][_0x1764('0x39')]));_0x336bb3[_0x1764('0x3a')]=_0x336bb3['attributes']['length']?_0x336bb3[_0x1764('0x3a')]:_0x2b9d87[_0x1764('0x34')];if(!_0x1f4d6b[_0x1764('0x36')][_0x1764('0x3b')](_0x1764('0x3c'))){_0x336bb3[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x1f4d6b[_0x1764('0x36')][_0x1764('0x21')]);_0x336bb3[_0x1764('0x23')]=qs[_0x1764('0x23')](_0x1f4d6b['query'][_0x1764('0x23')]);}_0x336bb3[_0x1764('0x3d')]=qs[_0x1764('0x3e')](_0x1f4d6b[_0x1764('0x36')][_0x1764('0x3e')]);_0x336bb3[_0x1764('0x3f')]=qs[_0x1764('0x37')](_[_0x1764('0x40')](_0x1f4d6b[_0x1764('0x36')],_0x2b9d87[_0x1764('0x37')]),_0x353643);if(_0x1f4d6b[_0x1764('0x36')][_0x1764('0x41')]){_0x336bb3[_0x1764('0x3f')]=_[_0x1764('0x42')](_0x336bb3[_0x1764('0x3f')],{'$or':_['map'](_0x353643,function(_0x11209c){if(_0x11209c['type']!==_0x1764('0x43')){var _0x1e7ec4={};_0x1e7ec4[_0x11209c[_0x1764('0x2c')]]={'$like':'%'+_0x1f4d6b[_0x1764('0x36')][_0x1764('0x41')]+'%'};return _0x1e7ec4;}})});}_0x336bb3=_[_0x1764('0x42')]({},_0x336bb3,_0x1f4d6b['options']);var _0x2c5a2e={'where':_0x336bb3['where']};return db[_0x1764('0x2f')][_0x1764('0x22')](_0x2c5a2e)[_0x1764('0x28')](function(_0x51d8e9){_0x45ebb8[_0x1764('0x22')]=_0x51d8e9;if(_0x1f4d6b[_0x1764('0x36')][_0x1764('0x44')]){_0x336bb3[_0x1764('0x45')]=[{'all':!![]}];}return db[_0x1764('0x2f')]['findAll'](_0x336bb3);})[_0x1764('0x28')](function(_0x51a038){_0x45ebb8[_0x1764('0x46')]=_0x51a038;return _0x45ebb8;})[_0x1764('0x28')](respondWithFilteredResult(_0x32c9dd,_0x336bb3))[_0x1764('0x47')](handleError(_0x32c9dd,null));};exports['show']=function(_0x50316f,_0x207dad){var _0xddf06c={'raw':![],'where':{'id':_0x50316f[_0x1764('0x48')]['id']}},_0x1aac08={};_0x1aac08[_0x1764('0x34')]=_[_0x1764('0x35')](db['FreshdeskConfiguration'][_0x1764('0x30')]);_0x1aac08[_0x1764('0x36')]=_[_0x1764('0x35')](_0x50316f[_0x1764('0x36')]);_0x1aac08['filters']=_[_0x1764('0x38')](_0x1aac08[_0x1764('0x34')],_0x1aac08[_0x1764('0x36')]);_0xddf06c[_0x1764('0x3a')]=_['intersection'](_0x1aac08[_0x1764('0x34')],qs[_0x1764('0x39')](_0x50316f[_0x1764('0x36')][_0x1764('0x39')]));_0xddf06c[_0x1764('0x3a')]=_0xddf06c['attributes'][_0x1764('0x49')]?_0xddf06c[_0x1764('0x3a')]:_0x1aac08[_0x1764('0x34')];if(_0x50316f[_0x1764('0x36')]['includeAll']){_0xddf06c[_0x1764('0x45')]=[{'all':!![]}];}_0xddf06c=_[_0x1764('0x42')]({},_0xddf06c,_0x50316f[_0x1764('0x4a')]);return db['FreshdeskConfiguration'][_0x1764('0x4b')](_0xddf06c)[_0x1764('0x28')](handleEntityNotFound(_0x207dad,null))['then'](respondWithResult(_0x207dad,null))[_0x1764('0x47')](handleError(_0x207dad,null));};exports[_0x1764('0x4c')]=function(_0x1b308e,_0x104d83){return db[_0x1764('0x2f')][_0x1764('0x4c')](_0x1b308e[_0x1764('0x4d')],{})[_0x1764('0x28')](respondWithResult(_0x104d83,0xc9))[_0x1764('0x47')](handleError(_0x104d83,null));};exports[_0x1764('0x4e')]=function(_0x48882a,_0x12fe7e){if(_0x48882a[_0x1764('0x4d')]['id']){delete _0x48882a[_0x1764('0x4d')]['id'];}return db[_0x1764('0x2f')][_0x1764('0x4b')]({'where':{'id':_0x48882a[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x12fe7e,null))[_0x1764('0x28')](saveUpdates(_0x48882a['body'],null))[_0x1764('0x28')](respondWithResult(_0x12fe7e,null))[_0x1764('0x47')](handleError(_0x12fe7e,null));};exports['destroy']=function(_0x2f1d3e,_0x256d19){return db['FreshdeskConfiguration'][_0x1764('0x4b')]({'where':{'id':_0x2f1d3e[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x256d19,null))['then'](removeEntity(_0x256d19,null))[_0x1764('0x47')](handleError(_0x256d19,null));};exports[_0x1764('0x4f')]=function(_0x1d562f,_0x545d9b,_0x49b976){var _0xc29e9f={};var _0x137215={};var _0x526e29;var _0x89aa63;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x1d562f[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x545d9b,null))[_0x1764('0x28')](function(_0x2ad0fd){if(_0x2ad0fd){_0x526e29=_0x2ad0fd;_0x137215[_0x1764('0x34')]=_[_0x1764('0x35')](db[_0x1764('0x51')][_0x1764('0x30')]);_0x137215['query']=_['keys'](_0x1d562f[_0x1764('0x36')]);_0x137215[_0x1764('0x37')]=_['intersection'](_0x137215['model'],_0x137215['query']);_0xc29e9f[_0x1764('0x3a')]=_[_0x1764('0x38')](_0x137215[_0x1764('0x34')],qs[_0x1764('0x39')](_0x1d562f['query'][_0x1764('0x39')]));_0xc29e9f[_0x1764('0x3a')]=_0xc29e9f['attributes']['length']?_0xc29e9f[_0x1764('0x3a')]:_0x137215[_0x1764('0x34')];_0xc29e9f[_0x1764('0x3d')]=qs['sort'](_0x1d562f[_0x1764('0x36')][_0x1764('0x3e')]);_0xc29e9f['where']=qs[_0x1764('0x37')](_['pick'](_0x1d562f[_0x1764('0x36')],_0x137215[_0x1764('0x37')]));if(_0x1d562f['query'][_0x1764('0x41')]){_0xc29e9f[_0x1764('0x3f')]=_[_0x1764('0x42')](_0xc29e9f['where'],{'$or':_[_0x1764('0x2e')](_0xc29e9f[_0x1764('0x3a')],function(_0x2a10aa){var _0x4ea327={};_0x4ea327[_0x2a10aa]={'$like':'%'+_0x1d562f[_0x1764('0x36')]['filter']+'%'};return _0x4ea327;})});}_0xc29e9f=_['merge']({},_0xc29e9f,_0x1d562f[_0x1764('0x4a')]);return _0x526e29[_0x1764('0x4f')](_0xc29e9f);}})[_0x1764('0x28')](function(_0x169ab6){if(_0x169ab6){_0x89aa63=_0x169ab6['length'];if(!_0x1d562f[_0x1764('0x36')][_0x1764('0x3b')](_0x1764('0x3c'))){_0xc29e9f[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x1d562f[_0x1764('0x36')][_0x1764('0x21')]);_0xc29e9f[_0x1764('0x23')]=qs['offset'](_0x1d562f['query'][_0x1764('0x23')]);}return _0x526e29['getFields'](_0xc29e9f);}})[_0x1764('0x28')](function(_0x3c2540){if(_0x3c2540){return _0x3c2540?{'count':_0x89aa63,'rows':_0x3c2540}:null;}})[_0x1764('0x28')](respondWithResult(_0x545d9b,null))[_0x1764('0x47')](handleError(_0x545d9b,null));};exports[_0x1764('0x52')]=function(_0x2a6ca7,_0x57dfe8,_0x40b264){var _0x456cab={};var _0x2859c5={};var _0x38aa04;var _0x5d7bba;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x2a6ca7[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x57dfe8,null))[_0x1764('0x28')](function(_0x598240){if(_0x598240){_0x38aa04=_0x598240;_0x2859c5[_0x1764('0x34')]=_['keys'](db[_0x1764('0x51')][_0x1764('0x30')]);_0x2859c5[_0x1764('0x36')]=_[_0x1764('0x35')](_0x2a6ca7[_0x1764('0x36')]);_0x2859c5[_0x1764('0x37')]=_[_0x1764('0x38')](_0x2859c5['model'],_0x2859c5[_0x1764('0x36')]);_0x456cab['attributes']=_[_0x1764('0x38')](_0x2859c5[_0x1764('0x34')],qs['fields'](_0x2a6ca7[_0x1764('0x36')][_0x1764('0x39')]));_0x456cab['attributes']=_0x456cab[_0x1764('0x3a')][_0x1764('0x49')]?_0x456cab[_0x1764('0x3a')]:_0x2859c5[_0x1764('0x34')];_0x456cab[_0x1764('0x3d')]=qs[_0x1764('0x3e')](_0x2a6ca7[_0x1764('0x36')][_0x1764('0x3e')]);_0x456cab[_0x1764('0x3f')]=qs['filters'](_[_0x1764('0x40')](_0x2a6ca7[_0x1764('0x36')],_0x2859c5['filters']));if(_0x2a6ca7['query'][_0x1764('0x41')]){_0x456cab['where']=_[_0x1764('0x42')](_0x456cab[_0x1764('0x3f')],{'$or':_[_0x1764('0x2e')](_0x456cab[_0x1764('0x3a')],function(_0x3763b5){var _0x2d181d={};_0x2d181d[_0x3763b5]={'$like':'%'+_0x2a6ca7['query'][_0x1764('0x41')]+'%'};return _0x2d181d;})});}_0x456cab=_['merge']({},_0x456cab,_0x2a6ca7['options']);return _0x38aa04['getSubjects'](_0x456cab);}})['then'](function(_0x38d3d9){if(_0x38d3d9){_0x5d7bba=_0x38d3d9['length'];if(!_0x2a6ca7['query'][_0x1764('0x3b')](_0x1764('0x3c'))){_0x456cab[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x2a6ca7[_0x1764('0x36')][_0x1764('0x21')]);_0x456cab[_0x1764('0x23')]=qs[_0x1764('0x23')](_0x2a6ca7[_0x1764('0x36')]['offset']);}return _0x38aa04['getSubjects'](_0x456cab);}})[_0x1764('0x28')](function(_0x3752f1){if(_0x3752f1){return _0x3752f1?{'count':_0x5d7bba,'rows':_0x3752f1}:null;}})[_0x1764('0x28')](respondWithResult(_0x57dfe8,null))[_0x1764('0x47')](handleError(_0x57dfe8,null));};exports[_0x1764('0x53')]=function(_0x5d9e60,_0x34ab8f,_0x18c002){var _0x3747a7={};var _0x847962={};var _0x266b0b;var _0x3c8aeb;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x5d9e60[_0x1764('0x48')]['id']}})[_0x1764('0x28')](handleEntityNotFound(_0x34ab8f,null))[_0x1764('0x28')](function(_0x27dfa9){if(_0x27dfa9){_0x266b0b=_0x27dfa9;_0x847962[_0x1764('0x34')]=_[_0x1764('0x35')](db[_0x1764('0x51')][_0x1764('0x30')]);_0x847962['query']=_[_0x1764('0x35')](_0x5d9e60[_0x1764('0x36')]);_0x847962[_0x1764('0x37')]=_[_0x1764('0x38')](_0x847962[_0x1764('0x34')],_0x847962[_0x1764('0x36')]);_0x3747a7['attributes']=_[_0x1764('0x38')](_0x847962[_0x1764('0x34')],qs[_0x1764('0x39')](_0x5d9e60[_0x1764('0x36')]['fields']));_0x3747a7[_0x1764('0x3a')]=_0x3747a7[_0x1764('0x3a')][_0x1764('0x49')]?_0x3747a7[_0x1764('0x3a')]:_0x847962['model'];_0x3747a7['order']=qs[_0x1764('0x3e')](_0x5d9e60[_0x1764('0x36')][_0x1764('0x3e')]);_0x3747a7[_0x1764('0x3f')]=qs[_0x1764('0x37')](_[_0x1764('0x40')](_0x5d9e60[_0x1764('0x36')],_0x847962['filters']));if(_0x5d9e60[_0x1764('0x36')]['filter']){_0x3747a7[_0x1764('0x3f')]=_['merge'](_0x3747a7['where'],{'$or':_[_0x1764('0x2e')](_0x3747a7[_0x1764('0x3a')],function(_0x46739b){var _0x3d9458={};_0x3d9458[_0x46739b]={'$like':'%'+_0x5d9e60[_0x1764('0x36')][_0x1764('0x41')]+'%'};return _0x3d9458;})});}_0x3747a7=_[_0x1764('0x42')]({},_0x3747a7,_0x5d9e60[_0x1764('0x4a')]);return _0x266b0b[_0x1764('0x53')](_0x3747a7);}})[_0x1764('0x28')](function(_0x530793){if(_0x530793){_0x3c8aeb=_0x530793[_0x1764('0x49')];if(!_0x5d9e60[_0x1764('0x36')][_0x1764('0x3b')]('nolimit')){_0x3747a7[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x5d9e60[_0x1764('0x36')][_0x1764('0x21')]);_0x3747a7[_0x1764('0x23')]=qs['offset'](_0x5d9e60[_0x1764('0x36')][_0x1764('0x23')]);}return _0x266b0b['getDescriptions'](_0x3747a7);}})[_0x1764('0x28')](function(_0xd5b4a9){if(_0xd5b4a9){return _0xd5b4a9?{'count':_0x3c8aeb,'rows':_0xd5b4a9}:null;}})[_0x1764('0x28')](respondWithResult(_0x34ab8f,null))[_0x1764('0x47')](handleError(_0x34ab8f,null));};exports[_0x1764('0x54')]=function(_0x43107e,_0x2a0fd8,_0x6d6154){var _0x4d6afb={};var _0x262546={};var _0x3b9587;var _0xaf1d01;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x43107e[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a0fd8,null))['then'](function(_0x30faaf){if(_0x30faaf){_0x3b9587=_0x30faaf;_0x262546[_0x1764('0x34')]=_['keys'](db[_0x1764('0x55')][_0x1764('0x30')]);_0x262546['query']=_[_0x1764('0x35')](_0x43107e['query']);_0x262546[_0x1764('0x37')]=_['intersection'](_0x262546[_0x1764('0x34')],_0x262546[_0x1764('0x36')]);_0x4d6afb[_0x1764('0x3a')]=_[_0x1764('0x38')](_0x262546['model'],qs[_0x1764('0x39')](_0x43107e[_0x1764('0x36')][_0x1764('0x39')]));_0x4d6afb[_0x1764('0x3a')]=_0x4d6afb[_0x1764('0x3a')]['length']?_0x4d6afb['attributes']:_0x262546['model'];_0x4d6afb[_0x1764('0x3d')]=qs[_0x1764('0x3e')](_0x43107e['query']['sort']);_0x4d6afb[_0x1764('0x3f')]=qs[_0x1764('0x37')](_['pick'](_0x43107e[_0x1764('0x36')],_0x262546['filters']));if(_0x43107e['query'][_0x1764('0x41')]){_0x4d6afb[_0x1764('0x3f')]=_[_0x1764('0x42')](_0x4d6afb[_0x1764('0x3f')],{'$or':_[_0x1764('0x2e')](_0x4d6afb['attributes'],function(_0xf14f65){var _0xe7f383={};_0xe7f383[_0xf14f65]={'$like':'%'+_0x43107e['query'][_0x1764('0x41')]+'%'};return _0xe7f383;})});}_0x4d6afb=_[_0x1764('0x42')]({},_0x4d6afb,_0x43107e['options']);return _0x3b9587['getTags'](_0x4d6afb);}})[_0x1764('0x28')](function(_0x5745a6){if(_0x5745a6){_0xaf1d01=_0x5745a6[_0x1764('0x49')];if(!_0x43107e[_0x1764('0x36')][_0x1764('0x3b')](_0x1764('0x3c'))){_0x4d6afb[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x43107e['query']['limit']);_0x4d6afb[_0x1764('0x23')]=qs[_0x1764('0x23')](_0x43107e[_0x1764('0x36')]['offset']);}return _0x3b9587[_0x1764('0x54')](_0x4d6afb);}})[_0x1764('0x28')](function(_0x51b8db){if(_0x51b8db){return _0x51b8db?{'count':_0xaf1d01,'rows':_0x51b8db}:null;}})['then'](respondWithResult(_0x2a0fd8,null))[_0x1764('0x47')](handleError(_0x2a0fd8,null));};exports[_0x1764('0x56')]=function(_0x59c1c3,_0x2cedb4,_0x4fff65){if(_0x59c1c3[_0x1764('0x4d')]['id']){delete _0x59c1c3['body']['id'];}return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x59c1c3[_0x1764('0x48')]['id']}})[_0x1764('0x28')](handleEntityNotFound(_0x2cedb4,null))['then'](function(_0x448fda){if(_0x448fda){return _0x448fda['setTags'](_0x59c1c3[_0x1764('0x4d')][_0x1764('0x57')]||[]);}return null;})[_0x1764('0x28')](respondWithResult(_0x2cedb4,null))['catch'](handleError(_0x2cedb4,null));}; \ No newline at end of file +var _0xecad=['getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','findOne','FreshdeskField','sort','filter'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xecad,0x1f3));var _0xdeca=function(_0xe89d97,_0x33e5ac){_0xe89d97=_0xe89d97-0x0;var _0x1b6e5d=_0xecad[_0xe89d97];return _0x1b6e5d;};'use strict';var emlformat=require(_0xdeca('0x0'));var rimraf=require(_0xdeca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdeca('0x2'));var moment=require(_0xdeca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdeca('0x4'));var util=require(_0xdeca('0x5'));var path=require(_0xdeca('0x6'));var sox=require(_0xdeca('0x7'));var csv=require(_0xdeca('0x8'));var ejs=require(_0xdeca('0x9'));var fs=require('fs');var fs_extra=require(_0xdeca('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdeca('0xb'));var jsforce=require(_0xdeca('0xc'));var deskjs=require(_0xdeca('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdeca('0xe'));var Papa=require(_0xdeca('0xf'));var Redis=require(_0xdeca('0x10'));var authService=require(_0xdeca('0x11'));var qs=require(_0xdeca('0x12'));var as=require(_0xdeca('0x13'));var hardwareService=require(_0xdeca('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xdeca('0x15'));var config=require(_0xdeca('0x16'));var licenseUtil=require(_0xdeca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12eb96,_0x5cd7a5){_0x5cd7a5=_0x5cd7a5||0xcc;return function(_0x2629b9){if(_0x2629b9){return _0x12eb96['sendStatus'](_0x5cd7a5);}return _0x12eb96['status'](_0x5cd7a5)[_0xdeca('0x18')]();};}function respondWithResult(_0x444aa3,_0x4fa551){_0x4fa551=_0x4fa551||0xc8;return function(_0x5476d9){if(_0x5476d9){return _0x444aa3[_0xdeca('0x19')](_0x4fa551)[_0xdeca('0x1a')](_0x5476d9);}};}function respondWithFilteredResult(_0x269107,_0x5d587b){return function(_0x47fe37){if(_0x47fe37){var _0xeac4b7=typeof _0x5d587b[_0xdeca('0x1b')]===_0xdeca('0x1c')&&typeof _0x5d587b['limit']==='undefined';var _0x4ffc87=_0x47fe37[_0xdeca('0x1d')];var _0x1f3c63=_0xeac4b7?0x0:_0x5d587b['offset'];var _0x2b6764=_0xeac4b7?_0x47fe37[_0xdeca('0x1d')]:_0x5d587b[_0xdeca('0x1b')]+_0x5d587b['limit'];var _0x33b12b;if(_0x2b6764>=_0x4ffc87){_0x2b6764=_0x4ffc87;_0x33b12b=0xc8;}else{_0x33b12b=0xce;}_0x269107[_0xdeca('0x19')](_0x33b12b);return _0x269107['set']('Content-Range',_0x1f3c63+'-'+_0x2b6764+'/'+_0x4ffc87)[_0xdeca('0x1a')](_0x47fe37);}return null;};}function patchUpdates(_0x2f56f7){return function(_0x3d2f46){try{jsonpatch[_0xdeca('0x1e')](_0x3d2f46,_0x2f56f7,!![]);}catch(_0xd27172){return BPromise['reject'](_0xd27172);}return _0x3d2f46['save']();};}function saveUpdates(_0x3e1603,_0x575c4c){return function(_0x17d18b){if(_0x17d18b){return _0x17d18b[_0xdeca('0x1f')](_0x3e1603)[_0xdeca('0x20')](function(_0x241d34){return _0x241d34;});}return null;};}function removeEntity(_0x537335,_0x5bef36){return function(_0x409c12){if(_0x409c12){return _0x409c12[_0xdeca('0x21')]()[_0xdeca('0x20')](function(){_0x537335['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x127274,_0xb31f81){return function(_0x2f9c50){if(!_0x2f9c50){_0x127274[_0xdeca('0x22')](0x194);}return _0x2f9c50;};}function handleError(_0xbff57a,_0x8a0e0b){_0x8a0e0b=_0x8a0e0b||0x1f4;return function(_0x2051e0){logger[_0xdeca('0x23')](_0x2051e0[_0xdeca('0x24')]);if(_0x2051e0[_0xdeca('0x25')]){delete _0x2051e0['name'];}_0xbff57a[_0xdeca('0x19')](_0x8a0e0b)[_0xdeca('0x26')](_0x2051e0);};}exports[_0xdeca('0x27')]=function(_0x52e365,_0x35a3f1){var _0xdd01a7={},_0x3ad4e4={},_0x4e4ca6={'count':0x0,'rows':[]};var _0x587876=_[_0xdeca('0x28')](db[_0xdeca('0x29')][_0xdeca('0x2a')],function(_0x283018){return{'name':_0x283018['fieldName'],'type':_0x283018['type'][_0xdeca('0x2b')]};});_0x3ad4e4['model']=_[_0xdeca('0x28')](_0x587876,_0xdeca('0x25'));_0x3ad4e4[_0xdeca('0x2c')]=_[_0xdeca('0x2d')](_0x52e365['query']);_0x3ad4e4[_0xdeca('0x2e')]=_[_0xdeca('0x2f')](_0x3ad4e4['model'],_0x3ad4e4[_0xdeca('0x2c')]);_0xdd01a7['attributes']=_[_0xdeca('0x2f')](_0x3ad4e4[_0xdeca('0x30')],qs['fields'](_0x52e365[_0xdeca('0x2c')][_0xdeca('0x31')]));_0xdd01a7[_0xdeca('0x32')]=_0xdd01a7[_0xdeca('0x32')][_0xdeca('0x33')]?_0xdd01a7['attributes']:_0x3ad4e4[_0xdeca('0x30')];if(!_0x52e365['query'][_0xdeca('0x34')](_0xdeca('0x35'))){_0xdd01a7[_0xdeca('0x36')]=qs['limit'](_0x52e365[_0xdeca('0x2c')]['limit']);_0xdd01a7[_0xdeca('0x1b')]=qs[_0xdeca('0x1b')](_0x52e365['query'][_0xdeca('0x1b')]);}_0xdd01a7[_0xdeca('0x37')]=qs['sort'](_0x52e365[_0xdeca('0x2c')]['sort']);_0xdd01a7[_0xdeca('0x38')]=qs['filters'](_[_0xdeca('0x39')](_0x52e365[_0xdeca('0x2c')],_0x3ad4e4[_0xdeca('0x2e')]),_0x587876);if(_0x52e365[_0xdeca('0x2c')]['filter']){_0xdd01a7[_0xdeca('0x38')]=_[_0xdeca('0x3a')](_0xdd01a7[_0xdeca('0x38')],{'$or':_[_0xdeca('0x28')](_0x587876,function(_0x158310){if(_0x158310[_0xdeca('0x3b')]!==_0xdeca('0x3c')){var _0x2bf28b={};_0x2bf28b[_0x158310[_0xdeca('0x25')]]={'$like':'%'+_0x52e365['query']['filter']+'%'};return _0x2bf28b;}})});}_0xdd01a7=_[_0xdeca('0x3a')]({},_0xdd01a7,_0x52e365[_0xdeca('0x3d')]);var _0x4ff6ef={'where':_0xdd01a7[_0xdeca('0x38')]};return db['FreshdeskConfiguration'][_0xdeca('0x1d')](_0x4ff6ef)[_0xdeca('0x20')](function(_0x44623f){_0x4e4ca6[_0xdeca('0x1d')]=_0x44623f;if(_0x52e365[_0xdeca('0x2c')][_0xdeca('0x3e')]){_0xdd01a7[_0xdeca('0x3f')]=[{'all':!![]}];}return db[_0xdeca('0x29')][_0xdeca('0x40')](_0xdd01a7);})[_0xdeca('0x20')](function(_0x2742d6){_0x4e4ca6[_0xdeca('0x41')]=_0x2742d6;return _0x4e4ca6;})[_0xdeca('0x20')](respondWithFilteredResult(_0x35a3f1,_0xdd01a7))[_0xdeca('0x42')](handleError(_0x35a3f1,null));};exports['show']=function(_0x294746,_0x176e6f){var _0x109f37={'raw':![],'where':{'id':_0x294746[_0xdeca('0x43')]['id']}},_0x59595e={};_0x59595e['model']=_[_0xdeca('0x2d')](db['FreshdeskConfiguration'][_0xdeca('0x2a')]);_0x59595e[_0xdeca('0x2c')]=_[_0xdeca('0x2d')](_0x294746[_0xdeca('0x2c')]);_0x59595e['filters']=_[_0xdeca('0x2f')](_0x59595e[_0xdeca('0x30')],_0x59595e['query']);_0x109f37[_0xdeca('0x32')]=_[_0xdeca('0x2f')](_0x59595e[_0xdeca('0x30')],qs[_0xdeca('0x31')](_0x294746['query']['fields']));_0x109f37[_0xdeca('0x32')]=_0x109f37['attributes']['length']?_0x109f37[_0xdeca('0x32')]:_0x59595e[_0xdeca('0x30')];if(_0x294746[_0xdeca('0x2c')][_0xdeca('0x3e')]){_0x109f37[_0xdeca('0x3f')]=[{'all':!![]}];}_0x109f37=_[_0xdeca('0x3a')]({},_0x109f37,_0x294746[_0xdeca('0x3d')]);return db[_0xdeca('0x29')][_0xdeca('0x44')](_0x109f37)['then'](handleEntityNotFound(_0x176e6f,null))['then'](respondWithResult(_0x176e6f,null))[_0xdeca('0x42')](handleError(_0x176e6f,null));};exports[_0xdeca('0x45')]=function(_0x4ab0c9,_0x3ac548){return db['FreshdeskConfiguration'][_0xdeca('0x45')](_0x4ab0c9['body'],{})[_0xdeca('0x20')](respondWithResult(_0x3ac548,0xc9))[_0xdeca('0x42')](handleError(_0x3ac548,null));};exports['update']=function(_0x2bfaed,_0x3ee86b){if(_0x2bfaed[_0xdeca('0x46')]['id']){delete _0x2bfaed['body']['id'];}return db['FreshdeskConfiguration'][_0xdeca('0x44')]({'where':{'id':_0x2bfaed[_0xdeca('0x43')]['id']}})[_0xdeca('0x20')](handleEntityNotFound(_0x3ee86b,null))[_0xdeca('0x20')](saveUpdates(_0x2bfaed[_0xdeca('0x46')],null))[_0xdeca('0x20')](respondWithResult(_0x3ee86b,null))[_0xdeca('0x42')](handleError(_0x3ee86b,null));};exports[_0xdeca('0x21')]=function(_0xf75365,_0xbc21c6){return db[_0xdeca('0x29')]['find']({'where':{'id':_0xf75365['params']['id']}})[_0xdeca('0x20')](handleEntityNotFound(_0xbc21c6,null))[_0xdeca('0x20')](removeEntity(_0xbc21c6,null))[_0xdeca('0x42')](handleError(_0xbc21c6,null));};exports['getFields']=function(_0xadd951,_0x394d4d,_0x5cdd51){var _0x16167a={};var _0xdaa09={};var _0x159707;var _0x45dcae;return db['FreshdeskConfiguration'][_0xdeca('0x47')]({'where':{'id':_0xadd951['params']['id']}})['then'](handleEntityNotFound(_0x394d4d,null))[_0xdeca('0x20')](function(_0x42cda3){if(_0x42cda3){_0x159707=_0x42cda3;_0xdaa09[_0xdeca('0x30')]=_[_0xdeca('0x2d')](db[_0xdeca('0x48')][_0xdeca('0x2a')]);_0xdaa09[_0xdeca('0x2c')]=_[_0xdeca('0x2d')](_0xadd951[_0xdeca('0x2c')]);_0xdaa09[_0xdeca('0x2e')]=_[_0xdeca('0x2f')](_0xdaa09[_0xdeca('0x30')],_0xdaa09[_0xdeca('0x2c')]);_0x16167a[_0xdeca('0x32')]=_[_0xdeca('0x2f')](_0xdaa09[_0xdeca('0x30')],qs[_0xdeca('0x31')](_0xadd951['query']['fields']));_0x16167a[_0xdeca('0x32')]=_0x16167a[_0xdeca('0x32')][_0xdeca('0x33')]?_0x16167a['attributes']:_0xdaa09[_0xdeca('0x30')];_0x16167a[_0xdeca('0x37')]=qs[_0xdeca('0x49')](_0xadd951[_0xdeca('0x2c')][_0xdeca('0x49')]);_0x16167a[_0xdeca('0x38')]=qs[_0xdeca('0x2e')](_[_0xdeca('0x39')](_0xadd951['query'],_0xdaa09[_0xdeca('0x2e')]));if(_0xadd951[_0xdeca('0x2c')][_0xdeca('0x4a')]){_0x16167a[_0xdeca('0x38')]=_['merge'](_0x16167a[_0xdeca('0x38')],{'$or':_['map'](_0x16167a['attributes'],function(_0x4cc315){var _0x34509c={};_0x34509c[_0x4cc315]={'$like':'%'+_0xadd951[_0xdeca('0x2c')]['filter']+'%'};return _0x34509c;})});}_0x16167a=_[_0xdeca('0x3a')]({},_0x16167a,_0xadd951[_0xdeca('0x3d')]);return _0x159707[_0xdeca('0x4b')](_0x16167a);}})[_0xdeca('0x20')](function(_0x1d5817){if(_0x1d5817){_0x45dcae=_0x1d5817[_0xdeca('0x33')];if(!_0xadd951[_0xdeca('0x2c')][_0xdeca('0x34')](_0xdeca('0x35'))){_0x16167a[_0xdeca('0x36')]=qs[_0xdeca('0x36')](_0xadd951[_0xdeca('0x2c')][_0xdeca('0x36')]);_0x16167a[_0xdeca('0x1b')]=qs[_0xdeca('0x1b')](_0xadd951[_0xdeca('0x2c')][_0xdeca('0x1b')]);}return _0x159707[_0xdeca('0x4b')](_0x16167a);}})[_0xdeca('0x20')](function(_0x3d5646){if(_0x3d5646){return _0x3d5646?{'count':_0x45dcae,'rows':_0x3d5646}:null;}})[_0xdeca('0x20')](respondWithResult(_0x394d4d,null))[_0xdeca('0x42')](handleError(_0x394d4d,null));};exports['getSubjects']=function(_0x5cc13e,_0x42d320,_0x5ec18a){var _0x371524={};var _0xd7db7={};var _0x19fea2;var _0x1924fc;return db[_0xdeca('0x29')][_0xdeca('0x47')]({'where':{'id':_0x5cc13e[_0xdeca('0x43')]['id']}})[_0xdeca('0x20')](handleEntityNotFound(_0x42d320,null))['then'](function(_0x56ef5a){if(_0x56ef5a){_0x19fea2=_0x56ef5a;_0xd7db7['model']=_[_0xdeca('0x2d')](db[_0xdeca('0x48')]['rawAttributes']);_0xd7db7[_0xdeca('0x2c')]=_['keys'](_0x5cc13e[_0xdeca('0x2c')]);_0xd7db7[_0xdeca('0x2e')]=_['intersection'](_0xd7db7[_0xdeca('0x30')],_0xd7db7[_0xdeca('0x2c')]);_0x371524[_0xdeca('0x32')]=_[_0xdeca('0x2f')](_0xd7db7[_0xdeca('0x30')],qs[_0xdeca('0x31')](_0x5cc13e['query'][_0xdeca('0x31')]));_0x371524[_0xdeca('0x32')]=_0x371524['attributes']['length']?_0x371524['attributes']:_0xd7db7[_0xdeca('0x30')];_0x371524[_0xdeca('0x37')]=qs['sort'](_0x5cc13e['query'][_0xdeca('0x49')]);_0x371524[_0xdeca('0x38')]=qs[_0xdeca('0x2e')](_[_0xdeca('0x39')](_0x5cc13e[_0xdeca('0x2c')],_0xd7db7[_0xdeca('0x2e')]));if(_0x5cc13e[_0xdeca('0x2c')][_0xdeca('0x4a')]){_0x371524['where']=_[_0xdeca('0x3a')](_0x371524[_0xdeca('0x38')],{'$or':_[_0xdeca('0x28')](_0x371524[_0xdeca('0x32')],function(_0xb6873){var _0x20650e={};_0x20650e[_0xb6873]={'$like':'%'+_0x5cc13e[_0xdeca('0x2c')][_0xdeca('0x4a')]+'%'};return _0x20650e;})});}_0x371524=_['merge']({},_0x371524,_0x5cc13e[_0xdeca('0x3d')]);return _0x19fea2[_0xdeca('0x4c')](_0x371524);}})['then'](function(_0x97a7cc){if(_0x97a7cc){_0x1924fc=_0x97a7cc['length'];if(!_0x5cc13e[_0xdeca('0x2c')][_0xdeca('0x34')](_0xdeca('0x35'))){_0x371524[_0xdeca('0x36')]=qs['limit'](_0x5cc13e[_0xdeca('0x2c')]['limit']);_0x371524[_0xdeca('0x1b')]=qs[_0xdeca('0x1b')](_0x5cc13e[_0xdeca('0x2c')][_0xdeca('0x1b')]);}return _0x19fea2[_0xdeca('0x4c')](_0x371524);}})[_0xdeca('0x20')](function(_0x44af09){if(_0x44af09){return _0x44af09?{'count':_0x1924fc,'rows':_0x44af09}:null;}})[_0xdeca('0x20')](respondWithResult(_0x42d320,null))['catch'](handleError(_0x42d320,null));};exports['getDescriptions']=function(_0x476d01,_0x1f43bd,_0x62049e){var _0x496ee5={};var _0x610b3f={};var _0x40b211;var _0x4cf825;return db[_0xdeca('0x29')][_0xdeca('0x47')]({'where':{'id':_0x476d01[_0xdeca('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f43bd,null))['then'](function(_0x54c598){if(_0x54c598){_0x40b211=_0x54c598;_0x610b3f['model']=_[_0xdeca('0x2d')](db['FreshdeskField'][_0xdeca('0x2a')]);_0x610b3f['query']=_[_0xdeca('0x2d')](_0x476d01['query']);_0x610b3f['filters']=_[_0xdeca('0x2f')](_0x610b3f['model'],_0x610b3f[_0xdeca('0x2c')]);_0x496ee5['attributes']=_[_0xdeca('0x2f')](_0x610b3f[_0xdeca('0x30')],qs[_0xdeca('0x31')](_0x476d01[_0xdeca('0x2c')][_0xdeca('0x31')]));_0x496ee5['attributes']=_0x496ee5[_0xdeca('0x32')][_0xdeca('0x33')]?_0x496ee5['attributes']:_0x610b3f[_0xdeca('0x30')];_0x496ee5[_0xdeca('0x37')]=qs[_0xdeca('0x49')](_0x476d01[_0xdeca('0x2c')][_0xdeca('0x49')]);_0x496ee5[_0xdeca('0x38')]=qs[_0xdeca('0x2e')](_[_0xdeca('0x39')](_0x476d01[_0xdeca('0x2c')],_0x610b3f[_0xdeca('0x2e')]));if(_0x476d01[_0xdeca('0x2c')]['filter']){_0x496ee5[_0xdeca('0x38')]=_[_0xdeca('0x3a')](_0x496ee5[_0xdeca('0x38')],{'$or':_['map'](_0x496ee5[_0xdeca('0x32')],function(_0x4ea4ce){var _0x5b7e6b={};_0x5b7e6b[_0x4ea4ce]={'$like':'%'+_0x476d01[_0xdeca('0x2c')]['filter']+'%'};return _0x5b7e6b;})});}_0x496ee5=_['merge']({},_0x496ee5,_0x476d01[_0xdeca('0x3d')]);return _0x40b211['getDescriptions'](_0x496ee5);}})[_0xdeca('0x20')](function(_0x59620d){if(_0x59620d){_0x4cf825=_0x59620d['length'];if(!_0x476d01[_0xdeca('0x2c')][_0xdeca('0x34')]('nolimit')){_0x496ee5[_0xdeca('0x36')]=qs['limit'](_0x476d01[_0xdeca('0x2c')][_0xdeca('0x36')]);_0x496ee5[_0xdeca('0x1b')]=qs[_0xdeca('0x1b')](_0x476d01[_0xdeca('0x2c')][_0xdeca('0x1b')]);}return _0x40b211[_0xdeca('0x4d')](_0x496ee5);}})[_0xdeca('0x20')](function(_0x4c0e30){if(_0x4c0e30){return _0x4c0e30?{'count':_0x4cf825,'rows':_0x4c0e30}:null;}})[_0xdeca('0x20')](respondWithResult(_0x1f43bd,null))[_0xdeca('0x42')](handleError(_0x1f43bd,null));};exports['getTags']=function(_0x1b7c06,_0x562bd0,_0x105c3){var _0x41170b={};var _0x1f1976={};var _0x2c8ac5;var _0x37e634;return db['FreshdeskConfiguration'][_0xdeca('0x47')]({'where':{'id':_0x1b7c06['params']['id']}})['then'](handleEntityNotFound(_0x562bd0,null))[_0xdeca('0x20')](function(_0x1f21af){if(_0x1f21af){_0x2c8ac5=_0x1f21af;_0x1f1976['model']=_['keys'](db[_0xdeca('0x4e')][_0xdeca('0x2a')]);_0x1f1976['query']=_['keys'](_0x1b7c06[_0xdeca('0x2c')]);_0x1f1976[_0xdeca('0x2e')]=_[_0xdeca('0x2f')](_0x1f1976[_0xdeca('0x30')],_0x1f1976[_0xdeca('0x2c')]);_0x41170b[_0xdeca('0x32')]=_[_0xdeca('0x2f')](_0x1f1976['model'],qs[_0xdeca('0x31')](_0x1b7c06[_0xdeca('0x2c')][_0xdeca('0x31')]));_0x41170b[_0xdeca('0x32')]=_0x41170b[_0xdeca('0x32')]['length']?_0x41170b['attributes']:_0x1f1976['model'];_0x41170b[_0xdeca('0x37')]=qs['sort'](_0x1b7c06[_0xdeca('0x2c')][_0xdeca('0x49')]);_0x41170b[_0xdeca('0x38')]=qs[_0xdeca('0x2e')](_[_0xdeca('0x39')](_0x1b7c06[_0xdeca('0x2c')],_0x1f1976[_0xdeca('0x2e')]));if(_0x1b7c06[_0xdeca('0x2c')][_0xdeca('0x4a')]){_0x41170b[_0xdeca('0x38')]=_['merge'](_0x41170b[_0xdeca('0x38')],{'$or':_[_0xdeca('0x28')](_0x41170b[_0xdeca('0x32')],function(_0x403972){var _0x75bcd6={};_0x75bcd6[_0x403972]={'$like':'%'+_0x1b7c06['query'][_0xdeca('0x4a')]+'%'};return _0x75bcd6;})});}_0x41170b=_['merge']({},_0x41170b,_0x1b7c06[_0xdeca('0x3d')]);return _0x2c8ac5[_0xdeca('0x4f')](_0x41170b);}})[_0xdeca('0x20')](function(_0x2a7b79){if(_0x2a7b79){_0x37e634=_0x2a7b79[_0xdeca('0x33')];if(!_0x1b7c06[_0xdeca('0x2c')]['hasOwnProperty'](_0xdeca('0x35'))){_0x41170b[_0xdeca('0x36')]=qs['limit'](_0x1b7c06[_0xdeca('0x2c')][_0xdeca('0x36')]);_0x41170b[_0xdeca('0x1b')]=qs['offset'](_0x1b7c06['query'][_0xdeca('0x1b')]);}return _0x2c8ac5[_0xdeca('0x4f')](_0x41170b);}})[_0xdeca('0x20')](function(_0x5d9785){if(_0x5d9785){return _0x5d9785?{'count':_0x37e634,'rows':_0x5d9785}:null;}})['then'](respondWithResult(_0x562bd0,null))[_0xdeca('0x42')](handleError(_0x562bd0,null));};exports[_0xdeca('0x50')]=function(_0x4d11a3,_0x142d95,_0x15a92d){if(_0x4d11a3[_0xdeca('0x46')]['id']){delete _0x4d11a3[_0xdeca('0x46')]['id'];}return db[_0xdeca('0x29')][_0xdeca('0x47')]({'where':{'id':_0x4d11a3['params']['id']}})[_0xdeca('0x20')](handleEntityNotFound(_0x142d95,null))[_0xdeca('0x20')](function(_0x28f88a){if(_0x28f88a){return _0x28f88a[_0xdeca('0x50')](_0x4d11a3[_0xdeca('0x46')][_0xdeca('0x51')]||[]);}return null;})[_0xdeca('0x20')](respondWithResult(_0x142d95,null))[_0xdeca('0x42')](handleError(_0x142d95,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 74ecb85..5fd648b 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 _0x42e9=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util'];(function(_0x3b0c93,_0x1d4e5d){var _0x14fd4a=function(_0x22ed7c){while(--_0x22ed7c){_0x3b0c93['push'](_0x3b0c93['shift']());}};_0x14fd4a(++_0x1d4e5d);}(_0x42e9,0x106));var _0x942e=function(_0x88164c,_0xc9afd4){_0x88164c=_0x88164c-0x0;var _0x1ef9a1=_0x42e9[_0x88164c];return _0x1ef9a1;};'use strict';var _=require(_0x942e('0x0'));var util=require(_0x942e('0x1'));var logger=require('../../config/logger')(_0x942e('0x2'));var moment=require(_0x942e('0x3'));var BPromise=require(_0x942e('0x4'));var rp=require(_0x942e('0x5'));var fs=require('fs');var path=require(_0x942e('0x6'));var rimraf=require('rimraf');var config=require(_0x942e('0x7'));var attributes=require(_0x942e('0x8'));module[_0x942e('0x9')]=function(_0x32904d,_0x5eff64){return _0x32904d[_0x942e('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x942e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71c3=['path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2c183c,_0x4883bf){var _0xc66563=function(_0x2f9026){while(--_0x2f9026){_0x2c183c['push'](_0x2c183c['shift']());}};_0xc66563(++_0x4883bf);}(_0x71c3,0x1ce));var _0x371c=function(_0x249941,_0x4cb3ae){_0x249941=_0x249941-0x0;var _0x40f2a6=_0x71c3[_0x249941];return _0x40f2a6;};'use strict';var _=require(_0x371c('0x0'));var util=require(_0x371c('0x1'));var logger=require(_0x371c('0x2'))(_0x371c('0x3'));var moment=require('moment');var BPromise=require(_0x371c('0x4'));var rp=require(_0x371c('0x5'));var fs=require('fs');var path=require(_0x371c('0x6'));var rimraf=require('rimraf');var config=require(_0x371c('0x7'));var attributes=require(_0x371c('0x8'));module[_0x371c('0x9')]=function(_0x37e34d,_0x2a2234){return _0x37e34d['define'](_0x371c('0xa'),attributes,{'tableName':_0x371c('0xb'),'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 aed6008..fe5bc99 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 _0xf982=['ioredis','../../mysqldb','../../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','randomstring'];(function(_0x48b2cb,_0x5da5e7){var _0x3ad90f=function(_0x432a1e){while(--_0x432a1e){_0x48b2cb['push'](_0x48b2cb['shift']());}};_0x3ad90f(++_0x5da5e7);}(_0xf982,0xf6));var _0x2f98=function(_0x275594,_0x1c7994){_0x275594=_0x275594-0x0;var _0x3f4f9b=_0xf982[_0x275594];return _0x3f4f9b;};'use strict';var _=require(_0x2f98('0x0'));var util=require(_0x2f98('0x1'));var moment=require(_0x2f98('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f98('0x3'));var fs=require('fs');var Redis=require(_0x2f98('0x4'));var db=require(_0x2f98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f98('0x6'))(_0x2f98('0x7'));var config=require(_0x2f98('0x8'));var jayson=require(_0x2f98('0x9'));var client=jayson[_0x2f98('0xa')][_0x2f98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487c46,_0x107ce7,_0x33e449){return new BPromise(function(_0x5067fe,_0x325299){return client[_0x2f98('0xc')](_0x487c46,_0x33e449)[_0x2f98('0xd')](function(_0x4039b2){logger[_0x2f98('0xe')](_0x2f98('0xf'),_0x107ce7,_0x2f98('0x10'));logger[_0x2f98('0x11')](_0x2f98('0x12'),_0x107ce7,_0x2f98('0x10'),JSON[_0x2f98('0x13')](_0x4039b2));if(_0x4039b2[_0x2f98('0x14')]){if(_0x4039b2[_0x2f98('0x14')][_0x2f98('0x15')]===0x1f4){logger[_0x2f98('0x14')](_0x2f98('0xf'),_0x107ce7,_0x4039b2[_0x2f98('0x14')][_0x2f98('0x16')]);return _0x325299(_0x4039b2['error'][_0x2f98('0x16')]);}logger[_0x2f98('0x14')](_0x2f98('0xf'),_0x107ce7,_0x4039b2[_0x2f98('0x14')][_0x2f98('0x16')]);return _0x5067fe(_0x4039b2[_0x2f98('0x14')][_0x2f98('0x16')]);}else{logger[_0x2f98('0xe')](_0x2f98('0xf'),_0x107ce7,'request\x20sent');_0x5067fe(_0x4039b2[_0x2f98('0x17')][_0x2f98('0x16')]);}})[_0x2f98('0x18')](function(_0x34b903){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x107ce7,_0x34b903);_0x325299(_0x34b903);});});} \ No newline at end of file +var _0xe790=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','client','http'];(function(_0x5866b7,_0x3ffc7d){var _0x510fed=function(_0x84b2e3){while(--_0x84b2e3){_0x5866b7['push'](_0x5866b7['shift']());}};_0x510fed(++_0x3ffc7d);}(_0xe790,0x127));var _0x0e79=function(_0x255a7c,_0x531eaf){_0x255a7c=_0x255a7c-0x0;var _0x2f2b2f=_0xe790[_0x255a7c];return _0x2f2b2f;};'use strict';var _=require(_0x0e79('0x0'));var util=require(_0x0e79('0x1'));var moment=require(_0x0e79('0x2'));var BPromise=require(_0x0e79('0x3'));var rs=require(_0x0e79('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0e79('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0e79('0x6'));var client=jayson[_0x0e79('0x7')][_0x0e79('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c55ad,_0x23e534,_0x59657f){return new BPromise(function(_0x4d1ff0,_0x107218){return client[_0x0e79('0x9')](_0x5c55ad,_0x59657f)[_0x0e79('0xa')](function(_0x494663){logger[_0x0e79('0xb')](_0x0e79('0xc'),_0x23e534,_0x0e79('0xd'));logger[_0x0e79('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x23e534,'request\x20sent',JSON[_0x0e79('0xf')](_0x494663));if(_0x494663[_0x0e79('0x10')]){if(_0x494663['error'][_0x0e79('0x11')]===0x1f4){logger['error'](_0x0e79('0xc'),_0x23e534,_0x494663[_0x0e79('0x10')]['message']);return _0x107218(_0x494663['error']['message']);}logger['error'](_0x0e79('0xc'),_0x23e534,_0x494663[_0x0e79('0x10')]['message']);return _0x4d1ff0(_0x494663[_0x0e79('0x10')][_0x0e79('0x12')]);}else{logger[_0x0e79('0xb')](_0x0e79('0xc'),_0x23e534,_0x0e79('0xd'));_0x4d1ff0(_0x494663['result'][_0x0e79('0x12')]);}})['catch'](function(_0x4aff5a){logger[_0x0e79('0x10')](_0x0e79('0xc'),_0x23e534,_0x4aff5a);_0x107218(_0x4aff5a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 6f67b5b..9a8eb3f 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 _0xa51f=['./intFreshdeskField.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa51f,0x19b));var _0xfa51=function(_0x3e6647,_0x2c0d09){_0x3e6647=_0x3e6647-0x0;var _0x46bddd=_0xa51f[_0x3e6647];return _0x46bddd;};'use strict';var multer=require(_0xfa51('0x0'));var util=require(_0xfa51('0x1'));var path=require(_0xfa51('0x2'));var timeout=require(_0xfa51('0x3'));var express=require(_0xfa51('0x4'));var router=express['Router']();var fs_extra=require(_0xfa51('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfa51('0x6'));var config=require('../../config/environment');var controller=require(_0xfa51('0x7'));router[_0xfa51('0x8')]('/',auth[_0xfa51('0x9')](),controller[_0xfa51('0xa')]);router[_0xfa51('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfa51('0xb')]('/',auth[_0xfa51('0x9')](),controller[_0xfa51('0xc')]);router[_0xfa51('0xd')](_0xfa51('0xe'),auth['isAuthenticated'](),controller[_0xfa51('0xf')]);router[_0xfa51('0x10')](_0xfa51('0xe'),auth[_0xfa51('0x9')](),controller[_0xfa51('0x11')]);module[_0xfa51('0x12')]=router; \ No newline at end of file +var _0x7055=['Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','multer','util','connect-timeout','express'];(function(_0x2f5259,_0x352194){var _0x898f85=function(_0x249caf){while(--_0x249caf){_0x2f5259['push'](_0x2f5259['shift']());}};_0x898f85(++_0x352194);}(_0x7055,0x6c));var _0x5705=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0x7055[_0x2136d5];return _0x3bee2e;};'use strict';var multer=require(_0x5705('0x0'));var util=require(_0x5705('0x1'));var path=require('path');var timeout=require(_0x5705('0x2'));var express=require(_0x5705('0x3'));var router=express[_0x5705('0x4')]();var fs_extra=require(_0x5705('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5705('0x6'));var config=require('../../config/environment');var controller=require(_0x5705('0x7'));router[_0x5705('0x8')]('/',auth[_0x5705('0x9')](),controller[_0x5705('0xa')]);router[_0x5705('0x8')](_0x5705('0xb'),auth[_0x5705('0x9')](),controller[_0x5705('0xc')]);router['post']('/',auth[_0x5705('0x9')](),controller[_0x5705('0xd')]);router['put'](_0x5705('0xb'),auth[_0x5705('0x9')](),controller['update']);router['delete'](_0x5705('0xb'),auth[_0x5705('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index bf69a49..a4f800e 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 _0x3c7e=['sequelize','exports','ENUM','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x3c7e,0x1e0));var _0xe3c7=function(_0x1c7502,_0x5d2c70){_0x1c7502=_0x1c7502-0x0;var _0x2165fa=_0x3c7e[_0x1c7502];return _0x2165fa;};'use strict';var Sequelize=require(_0xe3c7('0x0'));module[_0xe3c7('0x1')]={'type':{'type':Sequelize[_0xe3c7('0x2')](_0xe3c7('0x3'),_0xe3c7('0x4'),_0xe3c7('0x5'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xe3c7('0x6')]},'key':{'type':Sequelize[_0xe3c7('0x6')]},'keyType':{'type':Sequelize[_0xe3c7('0x2')](_0xe3c7('0x3'),_0xe3c7('0x4'),_0xe3c7('0x5'))},'keyContent':{'type':Sequelize[_0xe3c7('0x6')]},'idField':{'type':Sequelize[_0xe3c7('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe3c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe3c7('0x6')]}}; \ No newline at end of file +var _0x1048=['keyValue','picklist','STRING','string','sequelize','exports','ENUM','variable','customVariable'];(function(_0x5714cc,_0x42739b){var _0x3cad24=function(_0x270da3){while(--_0x270da3){_0x5714cc['push'](_0x5714cc['shift']());}};_0x3cad24(++_0x42739b);}(_0x1048,0x16c));var _0x8104=function(_0x5c1209,_0x20cf38){_0x5c1209=_0x5c1209-0x0;var _0x5c8dfa=_0x1048[_0x5c1209];return _0x5c8dfa;};'use strict';var Sequelize=require(_0x8104('0x0'));module[_0x8104('0x1')]={'type':{'type':Sequelize[_0x8104('0x2')]('string',_0x8104('0x3'),_0x8104('0x4'),_0x8104('0x5'),_0x8104('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8104('0x7')]},'keyType':{'type':Sequelize[_0x8104('0x2')](_0x8104('0x8'),'variable',_0x8104('0x4'))},'keyContent':{'type':Sequelize[_0x8104('0x7')]},'idField':{'type':Sequelize[_0x8104('0x7')]},'nameField':{'type':Sequelize[_0x8104('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8104('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ca1d540..258d529 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 _0xa25c=['map','FreshdeskField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index'];(function(_0x58f067,_0x38135b){var _0x550170=function(_0x1c8551){while(--_0x1c8551){_0x58f067['push'](_0x58f067['shift']());}};_0x550170(++_0x38135b);}(_0xa25c,0x13f));var _0xca25=function(_0x33c102,_0x22faa7){_0x33c102=_0x33c102-0x0;var _0x5921e9=_0xa25c[_0x33c102];return _0x5921e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca25('0x0'));var zipdir=require(_0xca25('0x1'));var jsonpatch=require(_0xca25('0x2'));var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require(_0xca25('0x7'));var path=require('path');var sox=require(_0xca25('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca25('0x9'));var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var licenseUtil=require(_0xca25('0x14'));var db=require(_0xca25('0x15'))['db'];function respondWithStatusCode(_0x5697aa,_0x534bca){_0x534bca=_0x534bca||0xcc;return function(_0x2a7a97){if(_0x2a7a97){return _0x5697aa['sendStatus'](_0x534bca);}return _0x5697aa[_0xca25('0x16')](_0x534bca)[_0xca25('0x17')]();};}function respondWithResult(_0x35093c,_0x1a3207){_0x1a3207=_0x1a3207||0xc8;return function(_0x307e9e){if(_0x307e9e){return _0x35093c[_0xca25('0x16')](_0x1a3207)[_0xca25('0x18')](_0x307e9e);}};}function respondWithFilteredResult(_0x33aa25,_0x2a1af3){return function(_0x42bc1e){if(_0x42bc1e){var _0x2b5cef=typeof _0x2a1af3['offset']===_0xca25('0x19')&&typeof _0x2a1af3[_0xca25('0x1a')]==='undefined';var _0x411230=_0x42bc1e[_0xca25('0x1b')];var _0x3705a0=_0x2b5cef?0x0:_0x2a1af3[_0xca25('0x1c')];var _0x155cf2=_0x2b5cef?_0x42bc1e['count']:_0x2a1af3[_0xca25('0x1c')]+_0x2a1af3[_0xca25('0x1a')];var _0x143243;if(_0x155cf2>=_0x411230){_0x155cf2=_0x411230;_0x143243=0xc8;}else{_0x143243=0xce;}_0x33aa25[_0xca25('0x16')](_0x143243);return _0x33aa25[_0xca25('0x1d')]('Content-Range',_0x3705a0+'-'+_0x155cf2+'/'+_0x411230)[_0xca25('0x18')](_0x42bc1e);}return null;};}function patchUpdates(_0x3598c7){return function(_0x235d92){try{jsonpatch[_0xca25('0x1e')](_0x235d92,_0x3598c7,!![]);}catch(_0x327719){return BPromise[_0xca25('0x1f')](_0x327719);}return _0x235d92[_0xca25('0x20')]();};}function saveUpdates(_0x54c91a,_0x48fdf5){return function(_0x23f69a){if(_0x23f69a){return _0x23f69a[_0xca25('0x21')](_0x54c91a)[_0xca25('0x22')](function(_0x1596dd){return _0x1596dd;});}return null;};}function removeEntity(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(_0x8cec43){return _0x8cec43[_0xca25('0x23')]()[_0xca25('0x22')](function(){_0x2615d4[_0xca25('0x16')](0xcc)[_0xca25('0x17')]();});}};}function handleEntityNotFound(_0x20dc6d,_0x4dffad){return function(_0x1aa848){if(!_0x1aa848){_0x20dc6d[_0xca25('0x24')](0x194);}return _0x1aa848;};}function handleError(_0x7ceacb,_0x374cde){_0x374cde=_0x374cde||0x1f4;return function(_0x220546){logger['error'](_0x220546[_0xca25('0x25')]);if(_0x220546[_0xca25('0x26')]){delete _0x220546[_0xca25('0x26')];}_0x7ceacb[_0xca25('0x16')](_0x374cde)[_0xca25('0x27')](_0x220546);};}exports[_0xca25('0x28')]=function(_0xfd888c,_0x1660a5){var _0x3e72cb={},_0x7b67f4={},_0x190f27={'count':0x0,'rows':[]};var _0x315f76=_[_0xca25('0x29')](db[_0xca25('0x2a')][_0xca25('0x2b')],function(_0x2433bb){return{'name':_0x2433bb[_0xca25('0x2c')],'type':_0x2433bb[_0xca25('0x2d')]['key']};});_0x7b67f4[_0xca25('0x2e')]=_[_0xca25('0x29')](_0x315f76,_0xca25('0x26'));_0x7b67f4['query']=_[_0xca25('0x2f')](_0xfd888c[_0xca25('0x30')]);_0x7b67f4[_0xca25('0x31')]=_[_0xca25('0x32')](_0x7b67f4[_0xca25('0x2e')],_0x7b67f4[_0xca25('0x30')]);_0x3e72cb['attributes']=_[_0xca25('0x32')](_0x7b67f4['model'],qs[_0xca25('0x33')](_0xfd888c[_0xca25('0x30')][_0xca25('0x33')]));_0x3e72cb['attributes']=_0x3e72cb[_0xca25('0x34')][_0xca25('0x35')]?_0x3e72cb[_0xca25('0x34')]:_0x7b67f4[_0xca25('0x2e')];if(!_0xfd888c[_0xca25('0x30')]['hasOwnProperty'](_0xca25('0x36'))){_0x3e72cb[_0xca25('0x1a')]=qs[_0xca25('0x1a')](_0xfd888c[_0xca25('0x30')][_0xca25('0x1a')]);_0x3e72cb[_0xca25('0x1c')]=qs[_0xca25('0x1c')](_0xfd888c['query']['offset']);}_0x3e72cb[_0xca25('0x37')]=qs[_0xca25('0x38')](_0xfd888c['query']['sort']);_0x3e72cb[_0xca25('0x39')]=qs[_0xca25('0x31')](_[_0xca25('0x3a')](_0xfd888c['query'],_0x7b67f4[_0xca25('0x31')]),_0x315f76);if(_0xfd888c[_0xca25('0x30')][_0xca25('0x3b')]){_0x3e72cb[_0xca25('0x39')]=_[_0xca25('0x3c')](_0x3e72cb[_0xca25('0x39')],{'$or':_['map'](_0x315f76,function(_0x290537){if(_0x290537['type']!==_0xca25('0x3d')){var _0x25880f={};_0x25880f[_0x290537[_0xca25('0x26')]]={'$like':'%'+_0xfd888c[_0xca25('0x30')][_0xca25('0x3b')]+'%'};return _0x25880f;}})});}_0x3e72cb=_[_0xca25('0x3c')]({},_0x3e72cb,_0xfd888c[_0xca25('0x3e')]);var _0x19984f={'where':_0x3e72cb[_0xca25('0x39')]};return db['FreshdeskField'][_0xca25('0x1b')](_0x19984f)['then'](function(_0x2d6f27){_0x190f27['count']=_0x2d6f27;if(_0xfd888c[_0xca25('0x30')][_0xca25('0x3f')]){_0x3e72cb[_0xca25('0x40')]=[{'all':!![]}];}return db[_0xca25('0x2a')]['findAll'](_0x3e72cb);})[_0xca25('0x22')](function(_0x5aafa5){_0x190f27[_0xca25('0x41')]=_0x5aafa5;return _0x190f27;})[_0xca25('0x22')](respondWithFilteredResult(_0x1660a5,_0x3e72cb))['catch'](handleError(_0x1660a5,null));};exports[_0xca25('0x42')]=function(_0x183135,_0x52799a){var _0x2ff9c2={'raw':!![],'where':{'id':_0x183135[_0xca25('0x43')]['id']}},_0x1068c9={};_0x1068c9[_0xca25('0x2e')]=_['keys'](db[_0xca25('0x2a')][_0xca25('0x2b')]);_0x1068c9['query']=_['keys'](_0x183135['query']);_0x1068c9['filters']=_[_0xca25('0x32')](_0x1068c9[_0xca25('0x2e')],_0x1068c9[_0xca25('0x30')]);_0x2ff9c2[_0xca25('0x34')]=_['intersection'](_0x1068c9[_0xca25('0x2e')],qs[_0xca25('0x33')](_0x183135[_0xca25('0x30')][_0xca25('0x33')]));_0x2ff9c2['attributes']=_0x2ff9c2[_0xca25('0x34')]['length']?_0x2ff9c2[_0xca25('0x34')]:_0x1068c9[_0xca25('0x2e')];if(_0x183135[_0xca25('0x30')][_0xca25('0x3f')]){_0x2ff9c2[_0xca25('0x40')]=[{'all':!![]}];}_0x2ff9c2=_[_0xca25('0x3c')]({},_0x2ff9c2,_0x183135['options']);return db[_0xca25('0x2a')][_0xca25('0x44')](_0x2ff9c2)[_0xca25('0x22')](handleEntityNotFound(_0x52799a,null))[_0xca25('0x22')](respondWithResult(_0x52799a,null))[_0xca25('0x45')](handleError(_0x52799a,null));};exports[_0xca25('0x46')]=function(_0x1ad2d0,_0x352a17){return db[_0xca25('0x2a')][_0xca25('0x46')](_0x1ad2d0[_0xca25('0x47')],{})[_0xca25('0x22')](respondWithResult(_0x352a17,0xc9))[_0xca25('0x45')](handleError(_0x352a17,null));};exports[_0xca25('0x21')]=function(_0x3279e0,_0x1fba32){if(_0x3279e0[_0xca25('0x47')]['id']){delete _0x3279e0[_0xca25('0x47')]['id'];}return db['FreshdeskField'][_0xca25('0x44')]({'where':{'id':_0x3279e0[_0xca25('0x43')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x1fba32,null))[_0xca25('0x22')](saveUpdates(_0x3279e0['body'],null))[_0xca25('0x22')](respondWithResult(_0x1fba32,null))[_0xca25('0x45')](handleError(_0x1fba32,null));};exports['destroy']=function(_0x2bc528,_0x10692f){return db[_0xca25('0x2a')][_0xca25('0x44')]({'where':{'id':_0x2bc528['params']['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x10692f,null))['then'](removeEntity(_0x10692f,null))[_0xca25('0x45')](handleError(_0x10692f,null));}; \ No newline at end of file +var _0xee5b=['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','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x5db800,_0x9c38a4){var _0x2195d9=function(_0x14ff60){while(--_0x14ff60){_0x5db800['push'](_0x5db800['shift']());}};_0x2195d9(++_0x9c38a4);}(_0xee5b,0x1f4));var _0xbee5=function(_0x18b9d1,_0x402d8c){_0x18b9d1=_0x18b9d1-0x0;var _0x36483d=_0xee5b[_0x18b9d1];return _0x36483d;};'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(){_0xb665df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x519473,_0x50d774){return function(_0x1af3de){if(!_0x1af3de){_0x519473[_0xbee5('0x25')](0x194);}return _0x1af3de;};}function handleError(_0x3b84c8,_0x28c74d){_0x28c74d=_0x28c74d||0x1f4;return function(_0x169042){logger[_0xbee5('0x26')](_0x169042[_0xbee5('0x27')]);if(_0x169042['name']){delete _0x169042[_0xbee5('0x28')];}_0x3b84c8[_0xbee5('0x17')](_0x28c74d)[_0xbee5('0x29')](_0x169042);};}exports[_0xbee5('0x2a')]=function(_0x1a8bcc,_0x5f0419){var _0x21b993={},_0x15ffb1={},_0xb7a077={'count':0x0,'rows':[]};var _0x136a00=_[_0xbee5('0x2b')](db[_0xbee5('0x2c')][_0xbee5('0x2d')],function(_0x36e8bb){return{'name':_0x36e8bb[_0xbee5('0x2e')],'type':_0x36e8bb['type'][_0xbee5('0x2f')]};});_0x15ffb1['model']=_[_0xbee5('0x2b')](_0x136a00,'name');_0x15ffb1[_0xbee5('0x30')]=_['keys'](_0x1a8bcc[_0xbee5('0x30')]);_0x15ffb1['filters']=_[_0xbee5('0x31')](_0x15ffb1[_0xbee5('0x32')],_0x15ffb1[_0xbee5('0x30')]);_0x21b993[_0xbee5('0x33')]=_['intersection'](_0x15ffb1[_0xbee5('0x32')],qs[_0xbee5('0x34')](_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x34')]));_0x21b993['attributes']=_0x21b993[_0xbee5('0x33')][_0xbee5('0x35')]?_0x21b993[_0xbee5('0x33')]:_0x15ffb1[_0xbee5('0x32')];if(!_0x1a8bcc['query'][_0xbee5('0x36')](_0xbee5('0x37'))){_0x21b993[_0xbee5('0x1a')]=qs[_0xbee5('0x1a')](_0x1a8bcc['query'][_0xbee5('0x1a')]);_0x21b993['offset']=qs[_0xbee5('0x19')](_0x1a8bcc['query']['offset']);}_0x21b993['order']=qs[_0xbee5('0x38')](_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x38')]);_0x21b993[_0xbee5('0x39')]=qs[_0xbee5('0x3a')](_[_0xbee5('0x3b')](_0x1a8bcc[_0xbee5('0x30')],_0x15ffb1[_0xbee5('0x3a')]),_0x136a00);if(_0x1a8bcc['query'][_0xbee5('0x3c')]){_0x21b993['where']=_[_0xbee5('0x3d')](_0x21b993[_0xbee5('0x39')],{'$or':_[_0xbee5('0x2b')](_0x136a00,function(_0x49d700){if(_0x49d700['type']!==_0xbee5('0x3e')){var _0x4eb1f8={};_0x4eb1f8[_0x49d700['name']]={'$like':'%'+_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x3c')]+'%'};return _0x4eb1f8;}})});}_0x21b993=_[_0xbee5('0x3d')]({},_0x21b993,_0x1a8bcc[_0xbee5('0x3f')]);var _0x5a2b14={'where':_0x21b993[_0xbee5('0x39')]};return db[_0xbee5('0x2c')][_0xbee5('0x1c')](_0x5a2b14)[_0xbee5('0x23')](function(_0xdcd148){_0xb7a077[_0xbee5('0x1c')]=_0xdcd148;if(_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x40')]){_0x21b993[_0xbee5('0x41')]=[{'all':!![]}];}return db[_0xbee5('0x2c')]['findAll'](_0x21b993);})[_0xbee5('0x23')](function(_0x371015){_0xb7a077['rows']=_0x371015;return _0xb7a077;})[_0xbee5('0x23')](respondWithFilteredResult(_0x5f0419,_0x21b993))[_0xbee5('0x42')](handleError(_0x5f0419,null));};exports[_0xbee5('0x43')]=function(_0x56e3d0,_0x4dad75){var _0x4cfe54={'raw':!![],'where':{'id':_0x56e3d0[_0xbee5('0x44')]['id']}},_0x4b4641={};_0x4b4641[_0xbee5('0x32')]=_[_0xbee5('0x45')](db[_0xbee5('0x2c')][_0xbee5('0x2d')]);_0x4b4641[_0xbee5('0x30')]=_[_0xbee5('0x45')](_0x56e3d0[_0xbee5('0x30')]);_0x4b4641[_0xbee5('0x3a')]=_['intersection'](_0x4b4641['model'],_0x4b4641[_0xbee5('0x30')]);_0x4cfe54['attributes']=_[_0xbee5('0x31')](_0x4b4641[_0xbee5('0x32')],qs['fields'](_0x56e3d0[_0xbee5('0x30')][_0xbee5('0x34')]));_0x4cfe54['attributes']=_0x4cfe54['attributes'][_0xbee5('0x35')]?_0x4cfe54[_0xbee5('0x33')]:_0x4b4641['model'];if(_0x56e3d0[_0xbee5('0x30')][_0xbee5('0x40')]){_0x4cfe54['include']=[{'all':!![]}];}_0x4cfe54=_[_0xbee5('0x3d')]({},_0x4cfe54,_0x56e3d0[_0xbee5('0x3f')]);return db[_0xbee5('0x2c')][_0xbee5('0x46')](_0x4cfe54)[_0xbee5('0x23')](handleEntityNotFound(_0x4dad75,null))[_0xbee5('0x23')](respondWithResult(_0x4dad75,null))[_0xbee5('0x42')](handleError(_0x4dad75,null));};exports['create']=function(_0xd9173,_0x34f01d){return db[_0xbee5('0x2c')][_0xbee5('0x47')](_0xd9173['body'],{})[_0xbee5('0x23')](respondWithResult(_0x34f01d,0xc9))[_0xbee5('0x42')](handleError(_0x34f01d,null));};exports[_0xbee5('0x22')]=function(_0x4aa21a,_0x44d4b1){if(_0x4aa21a[_0xbee5('0x48')]['id']){delete _0x4aa21a['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x4aa21a[_0xbee5('0x44')]['id']}})['then'](handleEntityNotFound(_0x44d4b1,null))[_0xbee5('0x23')](saveUpdates(_0x4aa21a[_0xbee5('0x48')],null))[_0xbee5('0x23')](respondWithResult(_0x44d4b1,null))[_0xbee5('0x42')](handleError(_0x44d4b1,null));};exports[_0xbee5('0x24')]=function(_0x296fc8,_0x55e654){return db[_0xbee5('0x2c')][_0xbee5('0x46')]({'where':{'id':_0x296fc8[_0xbee5('0x44')]['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0x55e654,null))['then'](removeEntity(_0x55e654,null))[_0xbee5('0x42')](handleError(_0x55e654,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 0440fff..4f3c8bc 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 _0x4b8f=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x301ada,_0x40e847){var _0x45e1e4=function(_0xe153d6){while(--_0xe153d6){_0x301ada['push'](_0x301ada['shift']());}};_0x45e1e4(++_0x40e847);}(_0x4b8f,0x103));var _0xf4b8=function(_0x4ef6e9,_0x140c4c){_0x4ef6e9=_0x4ef6e9-0x0;var _0x28270c=_0x4b8f[_0x4ef6e9];return _0x28270c;};'use strict';var _=require('lodash');var util=require(_0xf4b8('0x0'));var logger=require(_0xf4b8('0x1'))(_0xf4b8('0x2'));var moment=require(_0xf4b8('0x3'));var BPromise=require('bluebird');var rp=require(_0xf4b8('0x4'));var fs=require('fs');var path=require(_0xf4b8('0x5'));var rimraf=require(_0xf4b8('0x6'));var config=require('../../config/environment');var attributes=require(_0xf4b8('0x7'));module[_0xf4b8('0x8')]=function(_0x1dd55a,_0x18622b){return _0x1dd55a[_0xf4b8('0x9')](_0xf4b8('0xa'),attributes,{'tableName':_0xf4b8('0xb'),'paranoid':![],'indexes':[{'name':_0xf4b8('0xc'),'fields':[_0xf4b8('0xd'),_0xf4b8('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc53=['rimraf','exports','define','FreshdeskField','freshdesk_unique_index','idField','lodash','util','api','moment','bluebird','path'];(function(_0x188b32,_0xdba9d4){var _0x46643a=function(_0x4f566a){while(--_0x4f566a){_0x188b32['push'](_0x188b32['shift']());}};_0x46643a(++_0xdba9d4);}(_0xdc53,0xa2));var _0x3dc5=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xdc53[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0x3dc5('0x0'));var util=require(_0x3dc5('0x1'));var logger=require('../../config/logger')(_0x3dc5('0x2'));var moment=require(_0x3dc5('0x3'));var BPromise=require(_0x3dc5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dc5('0x5'));var rimraf=require(_0x3dc5('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x3dc5('0x7')]=function(_0x251722,_0x417c22){return _0x251722[_0x3dc5('0x8')](_0x3dc5('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3dc5('0xa'),'fields':[_0x3dc5('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 07aa323..6384452 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 _0xd064=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xd064,0x91));var _0x4d06=function(_0xd29892,_0x2b67b9){_0xd29892=_0xd29892-0x0;var _0x293dfd=_0xd064[_0xd29892];return _0x293dfd;};'use strict';var _=require(_0x4d06('0x0'));var util=require(_0x4d06('0x1'));var moment=require(_0x4d06('0x2'));var BPromise=require(_0x4d06('0x3'));var rs=require(_0x4d06('0x4'));var fs=require('fs');var Redis=require(_0x4d06('0x5'));var db=require(_0x4d06('0x6'))['db'];var utils=require(_0x4d06('0x7'));var logger=require(_0x4d06('0x8'))('rpc');var config=require(_0x4d06('0x9'));var jayson=require(_0x4d06('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e79a2,_0x38c85c,_0x1bb49a){return new BPromise(function(_0x1fe214,_0x81e64c){return client['request'](_0x4e79a2,_0x1bb49a)[_0x4d06('0xb')](function(_0x3d1aa9){logger[_0x4d06('0xc')](_0x4d06('0xd'),_0x38c85c,_0x4d06('0xe'));logger[_0x4d06('0xf')](_0x4d06('0x10'),_0x38c85c,_0x4d06('0xe'),JSON['stringify'](_0x3d1aa9));if(_0x3d1aa9[_0x4d06('0x11')]){if(_0x3d1aa9[_0x4d06('0x11')][_0x4d06('0x12')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x38c85c,_0x3d1aa9[_0x4d06('0x11')][_0x4d06('0x13')]);return _0x81e64c(_0x3d1aa9['error'][_0x4d06('0x13')]);}logger['error'](_0x4d06('0xd'),_0x38c85c,_0x3d1aa9[_0x4d06('0x11')]['message']);return _0x1fe214(_0x3d1aa9['error'][_0x4d06('0x13')]);}else{logger[_0x4d06('0xc')](_0x4d06('0xd'),_0x38c85c,_0x4d06('0xe'));_0x1fe214(_0x3d1aa9[_0x4d06('0x14')][_0x4d06('0x13')]);}})['catch'](function(_0x4733c3){logger['error'](_0x4d06('0xd'),_0x38c85c,_0x4733c3);_0x81e64c(_0x4733c3);});});} \ No newline at end of file +var _0xffef=['request','then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskField,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1ae27a,_0x270e8c){var _0x3f552d=function(_0x34d6c3){while(--_0x34d6c3){_0x1ae27a['push'](_0x1ae27a['shift']());}};_0x3f552d(++_0x270e8c);}(_0xffef,0xd9));var _0xfffe=function(_0x28f816,_0x1302d6){_0x28f816=_0x28f816-0x0;var _0x486015=_0xffef[_0x28f816];return _0x486015;};'use strict';var _=require(_0xfffe('0x0'));var util=require(_0xfffe('0x1'));var moment=require(_0xfffe('0x2'));var BPromise=require(_0xfffe('0x3'));var rs=require(_0xfffe('0x4'));var fs=require('fs');var Redis=require(_0xfffe('0x5'));var db=require(_0xfffe('0x6'))['db'];var utils=require(_0xfffe('0x7'));var logger=require(_0xfffe('0x8'))(_0xfffe('0x9'));var config=require(_0xfffe('0xa'));var jayson=require(_0xfffe('0xb'));var client=jayson['client'][_0xfffe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29e291,_0x24df64,_0x5269df){return new BPromise(function(_0x41dac4,_0x1a8c46){return client[_0xfffe('0xd')](_0x29e291,_0x5269df)[_0xfffe('0xe')](function(_0x2ba7aa){logger[_0xfffe('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x24df64,_0xfffe('0x10'));logger['debug'](_0xfffe('0x11'),_0x24df64,_0xfffe('0x10'),JSON[_0xfffe('0x12')](_0x2ba7aa));if(_0x2ba7aa[_0xfffe('0x13')]){if(_0x2ba7aa[_0xfffe('0x13')]['code']===0x1f4){logger[_0xfffe('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x24df64,_0x2ba7aa[_0xfffe('0x13')][_0xfffe('0x14')]);return _0x1a8c46(_0x2ba7aa['error'][_0xfffe('0x14')]);}logger[_0xfffe('0x13')](_0xfffe('0x15'),_0x24df64,_0x2ba7aa[_0xfffe('0x13')][_0xfffe('0x14')]);return _0x41dac4(_0x2ba7aa[_0xfffe('0x13')][_0xfffe('0x14')]);}else{logger['info'](_0xfffe('0x15'),_0x24df64,_0xfffe('0x10'));_0x41dac4(_0x2ba7aa['result'][_0xfffe('0x14')]);}})[_0xfffe('0x16')](function(_0x4d300a){logger[_0xfffe('0x13')](_0xfffe('0x15'),_0x24df64,_0x4d300a);_0x1a8c46(_0x4d300a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 1ae3e24..05f1a48 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 _0x0102=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','destroy','exports','util','path','connect-timeout','express','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x0102,0x186));var _0x2010=function(_0x4aed79,_0x54a8a4){_0x4aed79=_0x4aed79-0x0;var _0x24c3af=_0x0102[_0x4aed79];return _0x24c3af;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2010('0x4'));router[_0x2010('0x5')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0x7')]);router['get'](_0x2010('0x8'),auth['isAuthenticated'](),controller[_0x2010('0x9')]);router[_0x2010('0x5')]('/:id/configurations',auth[_0x2010('0x6')](),controller[_0x2010('0xa')]);router[_0x2010('0x5')](_0x2010('0xb'),auth[_0x2010('0x6')](),controller[_0x2010('0xc')]);router[_0x2010('0xd')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0xe')]);router[_0x2010('0xd')](_0x2010('0xf'),auth[_0x2010('0x6')](),controller[_0x2010('0x10')]);router[_0x2010('0x11')](_0x2010('0x8'),auth[_0x2010('0x6')](),controller['update']);router['delete'](_0x2010('0x8'),auth[_0x2010('0x6')](),controller[_0x2010('0x12')]);module[_0x2010('0x13')]=router; \ No newline at end of file +var _0xc788=['getConfigurations','post','addConfiguration','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0xf32536,_0x246a47){var _0x118d9d=function(_0x1a7b18){while(--_0x1a7b18){_0xf32536['push'](_0xf32536['shift']());}};_0x118d9d(++_0x246a47);}(_0xc788,0xc4));var _0x8c78=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xc788[_0x4c445a];return _0x2f611c;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/fields',auth[_0x8c78('0x9')](),controller['getFields']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),controller['create']);router[_0x8c78('0xf')](_0x8c78('0xd'),auth['isAuthenticated'](),controller[_0x8c78('0x10')]);router['put']('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x11')]);router[_0x8c78('0x12')](_0x8c78('0xb'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x13')]);module[_0x8c78('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index f61005c..707dd54 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 _0x430c=['sequelize','STRING','username'];(function(_0x43465e,_0x55bc4e){var _0x6c0a31=function(_0x160d19){while(--_0x160d19){_0x43465e['push'](_0x43465e['shift']());}};_0x6c0a31(++_0x55bc4e);}(_0x430c,0x1a1));var _0xc430=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x430c[_0x2bc1fe];return _0x1a47a5;};'use strict';var Sequelize=require(_0xc430('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc430('0x1')]},'username':{'type':Sequelize[_0xc430('0x1')],'unique':_0xc430('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x139fac,_0x313efc){var _0x31cbf7=function(_0x515f1b){while(--_0x515f1b){_0x139fac['push'](_0x139fac['shift']());}};_0x31cbf7(++_0x313efc);}(_0xe5af,0x9c));var _0xfe5a=function(_0x2f61a5,_0x4e1710){_0x2f61a5=_0x2f61a5-0x0;var _0x33642a=_0xe5af[_0x2f61a5];return _0x33642a;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index aace803..0dfd059 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 _0x9884=['request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','desk.js','papaparse','../../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','reject','update','then','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','destroy','getConfigurations','FreshsalesConfiguration','filter','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','remoteUri','username','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch'];(function(_0x45a528,_0xdb424c){var _0x326a53=function(_0xf8a555){while(--_0xf8a555){_0x45a528['push'](_0x45a528['shift']());}};_0x326a53(++_0xdb424c);}(_0x9884,0x191));var _0x4988=function(_0x53548d,_0x47b8d8){_0x53548d=_0x53548d-0x0;var _0x2cea1b=_0x9884[_0x53548d];return _0x2cea1b;};'use strict';var emlformat=require(_0x4988('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4988('0x1'));var jsonpatch=require(_0x4988('0x2'));var rp=require(_0x4988('0x3'));var moment=require(_0x4988('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4988('0x5'));var path=require(_0x4988('0x6'));var sox=require(_0x4988('0x7'));var csv=require(_0x4988('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4988('0x9'));var _=require(_0x4988('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4988('0xb'));var toCsv=require(_0x4988('0x8'));var querystring=require('querystring');var Papa=require(_0x4988('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4988('0xd'));var hardwareService=require(_0x4988('0xe'));var logger=require(_0x4988('0xf'))(_0x4988('0x10'));var utils=require(_0x4988('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4988('0x12'));var db=require(_0x4988('0x13'))['db'];var integrations=require(_0x4988('0x14'));function respondWithStatusCode(_0x56084e,_0x207a80){_0x207a80=_0x207a80||0xcc;return function(_0x12f4c5){if(_0x12f4c5){return _0x56084e[_0x4988('0x15')](_0x207a80);}return _0x56084e[_0x4988('0x16')](_0x207a80)[_0x4988('0x17')]();};}function respondWithResult(_0x2887d8,_0x219532){_0x219532=_0x219532||0xc8;return function(_0x2e2903){if(_0x2e2903){return _0x2887d8[_0x4988('0x16')](_0x219532)[_0x4988('0x18')](_0x2e2903);}};}function respondWithFilteredResult(_0x2ed68e,_0x5537dc){return function(_0x649606){if(_0x649606){var _0xb6ae63=typeof _0x5537dc[_0x4988('0x19')]===_0x4988('0x1a')&&typeof _0x5537dc[_0x4988('0x1b')]===_0x4988('0x1a');var _0x1351db=_0x649606[_0x4988('0x1c')];var _0x3ad946=_0xb6ae63?0x0:_0x5537dc['offset'];var _0x42f35c=_0xb6ae63?_0x649606[_0x4988('0x1c')]:_0x5537dc[_0x4988('0x19')]+_0x5537dc[_0x4988('0x1b')];var _0x527b55;if(_0x42f35c>=_0x1351db){_0x42f35c=_0x1351db;_0x527b55=0xc8;}else{_0x527b55=0xce;}_0x2ed68e[_0x4988('0x16')](_0x527b55);return _0x2ed68e[_0x4988('0x1d')](_0x4988('0x1e'),_0x3ad946+'-'+_0x42f35c+'/'+_0x1351db)[_0x4988('0x18')](_0x649606);}return null;};}function patchUpdates(_0x212139){return function(_0x356f27){try{jsonpatch['apply'](_0x356f27,_0x212139,!![]);}catch(_0x53e56f){return BPromise[_0x4988('0x1f')](_0x53e56f);}return _0x356f27['save']();};}function saveUpdates(_0x390f16,_0x1c130e){return function(_0x1e8f06){if(_0x1e8f06){return _0x1e8f06[_0x4988('0x20')](_0x390f16)[_0x4988('0x21')](function(_0x3b1fbe){return _0x3b1fbe;});}return null;};}function removeEntity(_0x1155f1,_0xf414a1){return function(_0x5b9124){if(_0x5b9124){return _0x5b9124['destroy']()[_0x4988('0x21')](function(){_0x1155f1[_0x4988('0x16')](0xcc)[_0x4988('0x17')]();});}};}function handleEntityNotFound(_0x1d1e53,_0x3d5c0e){return function(_0x2e5213){if(!_0x2e5213){_0x1d1e53[_0x4988('0x15')](0x194);}return _0x2e5213;};}function handleError(_0x2c5a30,_0x54fa71){_0x54fa71=_0x54fa71||0x1f4;return function(_0x2dfbed){logger[_0x4988('0x22')](_0x2dfbed['stack']);if(_0x2dfbed[_0x4988('0x23')]){delete _0x2dfbed[_0x4988('0x23')];}_0x2c5a30['status'](_0x54fa71)[_0x4988('0x24')](_0x2dfbed);};}exports[_0x4988('0x25')]=function(_0xc951f3,_0x367f40){var _0x2e1c80={},_0x3fbe8a={},_0x39cfb9={'count':0x0,'rows':[]};var _0x58b053=_[_0x4988('0x26')](db[_0x4988('0x27')][_0x4988('0x28')],function(_0x5a6d64){return{'name':_0x5a6d64[_0x4988('0x29')],'type':_0x5a6d64[_0x4988('0x2a')][_0x4988('0x2b')]};});_0x3fbe8a[_0x4988('0x2c')]=_[_0x4988('0x26')](_0x58b053,_0x4988('0x23'));_0x3fbe8a[_0x4988('0x2d')]=_[_0x4988('0x2e')](_0xc951f3[_0x4988('0x2d')]);_0x3fbe8a[_0x4988('0x2f')]=_[_0x4988('0x30')](_0x3fbe8a['model'],_0x3fbe8a[_0x4988('0x2d')]);_0x2e1c80[_0x4988('0x31')]=_['intersection'](_0x3fbe8a[_0x4988('0x2c')],qs[_0x4988('0x32')](_0xc951f3[_0x4988('0x2d')][_0x4988('0x32')]));_0x2e1c80[_0x4988('0x31')]=_0x2e1c80[_0x4988('0x31')][_0x4988('0x33')]?_0x2e1c80['attributes']:_0x3fbe8a['model'];if(!_0xc951f3['query'][_0x4988('0x34')](_0x4988('0x35'))){_0x2e1c80['limit']=qs['limit'](_0xc951f3['query'][_0x4988('0x1b')]);_0x2e1c80[_0x4988('0x19')]=qs[_0x4988('0x19')](_0xc951f3[_0x4988('0x2d')][_0x4988('0x19')]);}_0x2e1c80[_0x4988('0x36')]=qs[_0x4988('0x37')](_0xc951f3[_0x4988('0x2d')][_0x4988('0x37')]);_0x2e1c80[_0x4988('0x38')]=qs[_0x4988('0x2f')](_[_0x4988('0x39')](_0xc951f3[_0x4988('0x2d')],_0x3fbe8a[_0x4988('0x2f')]),_0x58b053);if(_0xc951f3['query']['filter']){_0x2e1c80[_0x4988('0x38')]=_['merge'](_0x2e1c80[_0x4988('0x38')],{'$or':_[_0x4988('0x26')](_0x58b053,function(_0x5094da){if(_0x5094da['type']!==_0x4988('0x3a')){var _0xbdddb1={};_0xbdddb1[_0x5094da[_0x4988('0x23')]]={'$like':'%'+_0xc951f3[_0x4988('0x2d')]['filter']+'%'};return _0xbdddb1;}})});}_0x2e1c80=_['merge']({},_0x2e1c80,_0xc951f3[_0x4988('0x3b')]);var _0x33ee9a={'where':_0x2e1c80[_0x4988('0x38')]};return db['FreshsalesAccount'][_0x4988('0x1c')](_0x33ee9a)[_0x4988('0x21')](function(_0x23acb0){_0x39cfb9['count']=_0x23acb0;if(_0xc951f3[_0x4988('0x2d')][_0x4988('0x3c')]){_0x2e1c80[_0x4988('0x3d')]=[{'all':!![]}];}return db[_0x4988('0x27')][_0x4988('0x3e')](_0x2e1c80);})['then'](function(_0x50d440){_0x39cfb9['rows']=_0x50d440;return _0x39cfb9;})['then'](respondWithFilteredResult(_0x367f40,_0x2e1c80))[_0x4988('0x3f')](handleError(_0x367f40,null));};exports[_0x4988('0x40')]=function(_0x29a89f,_0x1c0aea){var _0x3bc47c={'raw':![],'where':{'id':_0x29a89f[_0x4988('0x41')]['id']}},_0x12ee65={};_0x12ee65['model']=_[_0x4988('0x2e')](db[_0x4988('0x27')][_0x4988('0x28')]);_0x12ee65[_0x4988('0x2d')]=_[_0x4988('0x2e')](_0x29a89f['query']);_0x12ee65['filters']=_[_0x4988('0x30')](_0x12ee65[_0x4988('0x2c')],_0x12ee65[_0x4988('0x2d')]);_0x3bc47c['attributes']=_[_0x4988('0x30')](_0x12ee65[_0x4988('0x2c')],qs[_0x4988('0x32')](_0x29a89f[_0x4988('0x2d')][_0x4988('0x32')]));_0x3bc47c[_0x4988('0x31')]=_0x3bc47c[_0x4988('0x31')][_0x4988('0x33')]?_0x3bc47c['attributes']:_0x12ee65[_0x4988('0x2c')];if(_0x29a89f[_0x4988('0x2d')][_0x4988('0x3c')]){_0x3bc47c[_0x4988('0x3d')]=[{'all':!![]}];}_0x3bc47c=_[_0x4988('0x42')]({},_0x3bc47c,_0x29a89f['options']);return db[_0x4988('0x27')][_0x4988('0x43')](_0x3bc47c)[_0x4988('0x21')](handleEntityNotFound(_0x1c0aea,null))['then'](respondWithResult(_0x1c0aea,null))[_0x4988('0x3f')](handleError(_0x1c0aea,null));};exports[_0x4988('0x44')]=function(_0x2da5f5,_0x300e59){return db[_0x4988('0x27')][_0x4988('0x44')](_0x2da5f5[_0x4988('0x45')],{})[_0x4988('0x21')](respondWithResult(_0x300e59,0xc9))[_0x4988('0x3f')](handleError(_0x300e59,null));};exports[_0x4988('0x20')]=function(_0x2ac8b0,_0x191784){if(_0x2ac8b0['body']['id']){delete _0x2ac8b0[_0x4988('0x45')]['id'];}return db[_0x4988('0x27')][_0x4988('0x43')]({'where':{'id':_0x2ac8b0['params']['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x191784,null))['then'](saveUpdates(_0x2ac8b0[_0x4988('0x45')],null))[_0x4988('0x21')](respondWithResult(_0x191784,null))[_0x4988('0x3f')](handleError(_0x191784,null));};exports[_0x4988('0x46')]=function(_0x2f9ba0,_0x289b25){return db[_0x4988('0x27')][_0x4988('0x43')]({'where':{'id':_0x2f9ba0['params']['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x289b25,null))[_0x4988('0x21')](removeEntity(_0x289b25,null))[_0x4988('0x3f')](handleError(_0x289b25,null));};exports[_0x4988('0x47')]=function(_0xdbc452,_0x1e6e70,_0x1375c8){var _0x46212f={};var _0x17a757={};var _0x1e99b2;var _0x3fd6fd;return db[_0x4988('0x27')]['findOne']({'where':{'id':_0xdbc452[_0x4988('0x41')]['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x1e6e70,null))[_0x4988('0x21')](function(_0x13a447){if(_0x13a447){_0x1e99b2=_0x13a447;_0x17a757['model']=_[_0x4988('0x2e')](db[_0x4988('0x48')][_0x4988('0x28')]);_0x17a757[_0x4988('0x2d')]=_[_0x4988('0x2e')](_0xdbc452[_0x4988('0x2d')]);_0x17a757[_0x4988('0x2f')]=_[_0x4988('0x30')](_0x17a757['model'],_0x17a757[_0x4988('0x2d')]);_0x46212f[_0x4988('0x31')]=_[_0x4988('0x30')](_0x17a757[_0x4988('0x2c')],qs[_0x4988('0x32')](_0xdbc452['query'][_0x4988('0x32')]));_0x46212f['attributes']=_0x46212f[_0x4988('0x31')]['length']?_0x46212f[_0x4988('0x31')]:_0x17a757[_0x4988('0x2c')];_0x46212f[_0x4988('0x36')]=qs[_0x4988('0x37')](_0xdbc452[_0x4988('0x2d')][_0x4988('0x37')]);_0x46212f[_0x4988('0x38')]=qs[_0x4988('0x2f')](_[_0x4988('0x39')](_0xdbc452[_0x4988('0x2d')],_0x17a757[_0x4988('0x2f')]));if(_0xdbc452['query'][_0x4988('0x49')]){_0x46212f[_0x4988('0x38')]=_[_0x4988('0x42')](_0x46212f[_0x4988('0x38')],{'$or':_['map'](_0x46212f['attributes'],function(_0x111feb){var _0x2bc08f={};_0x2bc08f[_0x111feb]={'$like':'%'+_0xdbc452['query'][_0x4988('0x49')]+'%'};return _0x2bc08f;})});}_0x46212f=_[_0x4988('0x42')]({},_0x46212f,_0xdbc452[_0x4988('0x3b')]);return _0x1e99b2[_0x4988('0x47')](_0x46212f);}})[_0x4988('0x21')](function(_0x5e86f3){if(_0x5e86f3){_0x3fd6fd=_0x5e86f3[_0x4988('0x33')];if(!_0xdbc452[_0x4988('0x2d')][_0x4988('0x34')](_0x4988('0x35'))){_0x46212f['limit']=qs[_0x4988('0x1b')](_0xdbc452['query'][_0x4988('0x1b')]);_0x46212f['offset']=qs[_0x4988('0x19')](_0xdbc452[_0x4988('0x2d')][_0x4988('0x19')]);}return _0x1e99b2[_0x4988('0x47')](_0x46212f);}})[_0x4988('0x21')](function(_0x1b31c4){if(_0x1b31c4){return _0x1b31c4?{'count':_0x3fd6fd,'rows':_0x1b31c4}:null;}})['then'](respondWithResult(_0x1e6e70,null))[_0x4988('0x3f')](handleError(_0x1e6e70,null));};exports['addConfiguration']=function(_0x32e6a8,_0x1fe48c,_0x15165e){if(_0x32e6a8[_0x4988('0x45')]['id']){delete _0x32e6a8[_0x4988('0x45')]['id'];}return db[_0x4988('0x27')][_0x4988('0x4a')]({'where':{'id':_0x32e6a8[_0x4988('0x41')]['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x1fe48c,null))['then'](function(_0x376ea7){if(_0x376ea7){_0x32e6a8['body'][_0x4988('0x4b')]=_0x376ea7['id'];_0x32e6a8[_0x4988('0x45')][_0x4988('0x4c')]=integrations[_0x4988('0x4d')](_0x32e6a8['body']['channel'],_0x32e6a8['body'][_0x4988('0x2a')]);_0x32e6a8[_0x4988('0x45')][_0x4988('0x4e')]=integrations[_0x4988('0x4f')](_0x32e6a8[_0x4988('0x45')][_0x4988('0x50')],_0x32e6a8[_0x4988('0x45')]['type']);return db[_0x4988('0x48')][_0x4988('0x44')](_0x32e6a8['body'],{'include':[{'model':db[_0x4988('0x51')],'as':_0x4988('0x4c')},{'model':db[_0x4988('0x51')],'as':_0x4988('0x4e')}]});}return null;})['then'](respondWithResult(_0x1fe48c,null))[_0x4988('0x3f')](handleError(_0x1fe48c,null));};exports[_0x4988('0x52')]=function(_0x297ba4,_0x486b6c,_0xa3801a){var _0x7b510d='';var _0x327bb2='';return db[_0x4988('0x27')][_0x4988('0x4a')]({'where':{'id':_0x297ba4[_0x4988('0x41')]['id']},'attributes':['id','username',_0x4988('0x53'),'apiKey']})[_0x4988('0x21')](handleEntityNotFound(_0x486b6c,null))[_0x4988('0x21')](function(_0x256daf){if(_0x256daf){_0x327bb2=_0x256daf[_0x4988('0x54')];_0x7b510d=_0x256daf['remoteUri'];var _0xddaedf=_0x256daf[_0x4988('0x53')][_0x4988('0x55')](-0x1);if(_0xddaedf==='/'){_0x7b510d=_0x7b510d[_0x4988('0x56')](0x0,_0x7b510d[_0x4988('0x57')](_0xddaedf));}return rp({'method':'GET','uri':util[_0x4988('0x58')](_0x4988('0x59'),_0x7b510d,_0x4988('0x5a')),'headers':{'Authorization':_0x4988('0x5b')+_0x256daf[_0x4988('0x5c')]},'json':!![]});}})[_0x4988('0x21')](function(_0xef778f){if(_0xef778f){var _0x3dc8c7=_0xef778f[_0x4988('0x5d')];var _0x47c1c3=![];var _0x45bf4b=null;for(_0x45bf4b=0x0;_0x45bf4b<_0x3dc8c7['length'];_0x45bf4b++){if(_0x3dc8c7[_0x45bf4b][_0x4988('0x5e')]===_0x327bb2){_0x47c1c3=!![];}}if(_0x47c1c3){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4988('0x5f')});}}})['then'](respondWithResult(_0x486b6c,null))['catch'](function(_0x579515){var _0x2e125d=_0x297ba4[_0x4988('0x2d')][_0x4988('0x60')]?0x1f4:_0x579515['statusCode']||0x1f4;logger[_0x4988('0x22')](_0x4988('0x61'),'getFields',_0x2e125d,JSON[_0x4988('0x62')](_0x579515));delete _0x579515[_0x4988('0x23')];if(_0x2e125d===0x191){_0x2e125d=0x190;}_0x486b6c[_0x4988('0x16')](_0x2e125d)[_0x4988('0x24')](_0x297ba4[_0x4988('0x2d')][_0x4988('0x60')]?{'message':_0x4988('0x63'),'statusCode':_0x579515[_0x4988('0x64')]}:_0x579515);});}; \ No newline at end of file +var _0xf8f4=['intersection','find','catch','create','body','getConfigurations','FreshsalesConfiguration','order','pick','options','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','apiKey','username','remoteUri','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','FreshsalesAccount','includeAll','include','findAll','rows','show','params'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0xf8f4,0x1e9));var _0x4f8f=function(_0xbe48c2,_0x3db103){_0xbe48c2=_0xbe48c2-0x0;var _0x39a679=_0xf8f4[_0xbe48c2];return _0x39a679;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f8f('0x0'));var zipdir=require(_0x4f8f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f8f('0x2'));var moment=require(_0x4f8f('0x3'));var BPromise=require(_0x4f8f('0x4'));var Mustache=require(_0x4f8f('0x5'));var util=require(_0x4f8f('0x6'));var path=require(_0x4f8f('0x7'));var sox=require(_0x4f8f('0x8'));var csv=require(_0x4f8f('0x9'));var ejs=require(_0x4f8f('0xa'));var fs=require('fs');var fs_extra=require(_0x4f8f('0xb'));var _=require(_0x4f8f('0xc'));var squel=require(_0x4f8f('0xd'));var crypto=require(_0x4f8f('0xe'));var jsforce=require(_0x4f8f('0xf'));var deskjs=require(_0x4f8f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4f8f('0x11'));var Papa=require(_0x4f8f('0x12'));var Redis=require(_0x4f8f('0x13'));var authService=require(_0x4f8f('0x14'));var qs=require(_0x4f8f('0x15'));var as=require(_0x4f8f('0x16'));var hardwareService=require(_0x4f8f('0x17'));var logger=require(_0x4f8f('0x18'))(_0x4f8f('0x19'));var utils=require(_0x4f8f('0x1a'));var config=require(_0x4f8f('0x1b'));var licenseUtil=require(_0x4f8f('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4f8f('0x1d'));function respondWithStatusCode(_0x5cbd54,_0x22e088){_0x22e088=_0x22e088||0xcc;return function(_0x17f8b7){if(_0x17f8b7){return _0x5cbd54[_0x4f8f('0x1e')](_0x22e088);}return _0x5cbd54[_0x4f8f('0x1f')](_0x22e088)[_0x4f8f('0x20')]();};}function respondWithResult(_0x2c6dd5,_0x40aa46){_0x40aa46=_0x40aa46||0xc8;return function(_0x76a202){if(_0x76a202){return _0x2c6dd5[_0x4f8f('0x1f')](_0x40aa46)[_0x4f8f('0x21')](_0x76a202);}};}function respondWithFilteredResult(_0x56a531,_0x4adcf7){return function(_0x4dbc34){if(_0x4dbc34){var _0x3ba010=typeof _0x4adcf7[_0x4f8f('0x22')]==='undefined'&&typeof _0x4adcf7[_0x4f8f('0x23')]===_0x4f8f('0x24');var _0x32a7b5=_0x4dbc34['count'];var _0x546465=_0x3ba010?0x0:_0x4adcf7[_0x4f8f('0x22')];var _0x57bb54=_0x3ba010?_0x4dbc34[_0x4f8f('0x25')]:_0x4adcf7['offset']+_0x4adcf7[_0x4f8f('0x23')];var _0x5d80e0;if(_0x57bb54>=_0x32a7b5){_0x57bb54=_0x32a7b5;_0x5d80e0=0xc8;}else{_0x5d80e0=0xce;}_0x56a531[_0x4f8f('0x1f')](_0x5d80e0);return _0x56a531[_0x4f8f('0x26')](_0x4f8f('0x27'),_0x546465+'-'+_0x57bb54+'/'+_0x32a7b5)[_0x4f8f('0x21')](_0x4dbc34);}return null;};}function patchUpdates(_0x1f13ab){return function(_0x45eee9){try{jsonpatch[_0x4f8f('0x28')](_0x45eee9,_0x1f13ab,!![]);}catch(_0x282959){return BPromise[_0x4f8f('0x29')](_0x282959);}return _0x45eee9[_0x4f8f('0x2a')]();};}function saveUpdates(_0x57e200,_0x30fc47){return function(_0x374cd1){if(_0x374cd1){return _0x374cd1[_0x4f8f('0x2b')](_0x57e200)[_0x4f8f('0x2c')](function(_0x50a03d){return _0x50a03d;});}return null;};}function removeEntity(_0x54e033,_0x4e7142){return function(_0x43fbb2){if(_0x43fbb2){return _0x43fbb2[_0x4f8f('0x2d')]()[_0x4f8f('0x2c')](function(){_0x54e033[_0x4f8f('0x1f')](0xcc)[_0x4f8f('0x20')]();});}};}function handleEntityNotFound(_0x548a2e,_0x2d654f){return function(_0x110baa){if(!_0x110baa){_0x548a2e[_0x4f8f('0x1e')](0x194);}return _0x110baa;};}function handleError(_0x4931f5,_0x5f0af6){_0x5f0af6=_0x5f0af6||0x1f4;return function(_0x1b72f8){logger['error'](_0x1b72f8[_0x4f8f('0x2e')]);if(_0x1b72f8[_0x4f8f('0x2f')]){delete _0x1b72f8[_0x4f8f('0x2f')];}_0x4931f5[_0x4f8f('0x1f')](_0x5f0af6)[_0x4f8f('0x30')](_0x1b72f8);};}exports[_0x4f8f('0x31')]=function(_0x4e43d3,_0x3392fa){var _0x5abbf0={},_0x1d5cc9={},_0x3ad7b5={'count':0x0,'rows':[]};var _0x3f48e7=_[_0x4f8f('0x32')](db['FreshsalesAccount'][_0x4f8f('0x33')],function(_0x1bc246){return{'name':_0x1bc246[_0x4f8f('0x34')],'type':_0x1bc246[_0x4f8f('0x35')][_0x4f8f('0x36')]};});_0x1d5cc9[_0x4f8f('0x37')]=_['map'](_0x3f48e7,_0x4f8f('0x2f'));_0x1d5cc9[_0x4f8f('0x38')]=_[_0x4f8f('0x39')](_0x4e43d3[_0x4f8f('0x38')]);_0x1d5cc9[_0x4f8f('0x3a')]=_['intersection'](_0x1d5cc9[_0x4f8f('0x37')],_0x1d5cc9[_0x4f8f('0x38')]);_0x5abbf0[_0x4f8f('0x3b')]=_['intersection'](_0x1d5cc9[_0x4f8f('0x37')],qs['fields'](_0x4e43d3[_0x4f8f('0x38')][_0x4f8f('0x3c')]));_0x5abbf0[_0x4f8f('0x3b')]=_0x5abbf0[_0x4f8f('0x3b')][_0x4f8f('0x3d')]?_0x5abbf0['attributes']:_0x1d5cc9[_0x4f8f('0x37')];if(!_0x4e43d3['query'][_0x4f8f('0x3e')](_0x4f8f('0x3f'))){_0x5abbf0['limit']=qs[_0x4f8f('0x23')](_0x4e43d3[_0x4f8f('0x38')]['limit']);_0x5abbf0[_0x4f8f('0x22')]=qs['offset'](_0x4e43d3['query'][_0x4f8f('0x22')]);}_0x5abbf0['order']=qs[_0x4f8f('0x40')](_0x4e43d3[_0x4f8f('0x38')][_0x4f8f('0x40')]);_0x5abbf0['where']=qs[_0x4f8f('0x3a')](_['pick'](_0x4e43d3[_0x4f8f('0x38')],_0x1d5cc9[_0x4f8f('0x3a')]),_0x3f48e7);if(_0x4e43d3[_0x4f8f('0x38')][_0x4f8f('0x41')]){_0x5abbf0['where']=_[_0x4f8f('0x42')](_0x5abbf0[_0x4f8f('0x43')],{'$or':_['map'](_0x3f48e7,function(_0x5dd3f2){if(_0x5dd3f2[_0x4f8f('0x35')]!==_0x4f8f('0x44')){var _0x5ea0d2={};_0x5ea0d2[_0x5dd3f2[_0x4f8f('0x2f')]]={'$like':'%'+_0x4e43d3[_0x4f8f('0x38')]['filter']+'%'};return _0x5ea0d2;}})});}_0x5abbf0=_['merge']({},_0x5abbf0,_0x4e43d3['options']);var _0x417bd2={'where':_0x5abbf0[_0x4f8f('0x43')]};return db[_0x4f8f('0x45')][_0x4f8f('0x25')](_0x417bd2)[_0x4f8f('0x2c')](function(_0x26e2e9){_0x3ad7b5[_0x4f8f('0x25')]=_0x26e2e9;if(_0x4e43d3['query'][_0x4f8f('0x46')]){_0x5abbf0[_0x4f8f('0x47')]=[{'all':!![]}];}return db[_0x4f8f('0x45')][_0x4f8f('0x48')](_0x5abbf0);})['then'](function(_0x1c7f9d){_0x3ad7b5[_0x4f8f('0x49')]=_0x1c7f9d;return _0x3ad7b5;})[_0x4f8f('0x2c')](respondWithFilteredResult(_0x3392fa,_0x5abbf0))['catch'](handleError(_0x3392fa,null));};exports[_0x4f8f('0x4a')]=function(_0x1eb98a,_0x2ab86a){var _0xa01d90={'raw':![],'where':{'id':_0x1eb98a[_0x4f8f('0x4b')]['id']}},_0x2672db={};_0x2672db[_0x4f8f('0x37')]=_[_0x4f8f('0x39')](db[_0x4f8f('0x45')]['rawAttributes']);_0x2672db[_0x4f8f('0x38')]=_[_0x4f8f('0x39')](_0x1eb98a['query']);_0x2672db['filters']=_[_0x4f8f('0x4c')](_0x2672db[_0x4f8f('0x37')],_0x2672db[_0x4f8f('0x38')]);_0xa01d90['attributes']=_[_0x4f8f('0x4c')](_0x2672db['model'],qs[_0x4f8f('0x3c')](_0x1eb98a['query'][_0x4f8f('0x3c')]));_0xa01d90[_0x4f8f('0x3b')]=_0xa01d90[_0x4f8f('0x3b')][_0x4f8f('0x3d')]?_0xa01d90[_0x4f8f('0x3b')]:_0x2672db[_0x4f8f('0x37')];if(_0x1eb98a[_0x4f8f('0x38')][_0x4f8f('0x46')]){_0xa01d90[_0x4f8f('0x47')]=[{'all':!![]}];}_0xa01d90=_[_0x4f8f('0x42')]({},_0xa01d90,_0x1eb98a['options']);return db[_0x4f8f('0x45')][_0x4f8f('0x4d')](_0xa01d90)[_0x4f8f('0x2c')](handleEntityNotFound(_0x2ab86a,null))['then'](respondWithResult(_0x2ab86a,null))[_0x4f8f('0x4e')](handleError(_0x2ab86a,null));};exports[_0x4f8f('0x4f')]=function(_0x59bec7,_0x3226cc){return db['FreshsalesAccount'][_0x4f8f('0x4f')](_0x59bec7['body'],{})[_0x4f8f('0x2c')](respondWithResult(_0x3226cc,0xc9))[_0x4f8f('0x4e')](handleError(_0x3226cc,null));};exports['update']=function(_0xc89dcc,_0x2c91ec){if(_0xc89dcc['body']['id']){delete _0xc89dcc[_0x4f8f('0x50')]['id'];}return db['FreshsalesAccount'][_0x4f8f('0x4d')]({'where':{'id':_0xc89dcc[_0x4f8f('0x4b')]['id']}})[_0x4f8f('0x2c')](handleEntityNotFound(_0x2c91ec,null))['then'](saveUpdates(_0xc89dcc[_0x4f8f('0x50')],null))[_0x4f8f('0x2c')](respondWithResult(_0x2c91ec,null))['catch'](handleError(_0x2c91ec,null));};exports[_0x4f8f('0x2d')]=function(_0x1cc054,_0x453ae4){return db['FreshsalesAccount'][_0x4f8f('0x4d')]({'where':{'id':_0x1cc054[_0x4f8f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x453ae4,null))['then'](removeEntity(_0x453ae4,null))[_0x4f8f('0x4e')](handleError(_0x453ae4,null));};exports[_0x4f8f('0x51')]=function(_0x11d0eb,_0x1ecd05,_0x3f001c){var _0x1b9aa6={};var _0x90ae1={};var _0x18b8c9;var _0x35d25a;return db[_0x4f8f('0x45')]['findOne']({'where':{'id':_0x11d0eb[_0x4f8f('0x4b')]['id']}})[_0x4f8f('0x2c')](handleEntityNotFound(_0x1ecd05,null))['then'](function(_0x1e30a8){if(_0x1e30a8){_0x18b8c9=_0x1e30a8;_0x90ae1[_0x4f8f('0x37')]=_[_0x4f8f('0x39')](db[_0x4f8f('0x52')][_0x4f8f('0x33')]);_0x90ae1[_0x4f8f('0x38')]=_[_0x4f8f('0x39')](_0x11d0eb[_0x4f8f('0x38')]);_0x90ae1[_0x4f8f('0x3a')]=_[_0x4f8f('0x4c')](_0x90ae1[_0x4f8f('0x37')],_0x90ae1[_0x4f8f('0x38')]);_0x1b9aa6['attributes']=_['intersection'](_0x90ae1[_0x4f8f('0x37')],qs[_0x4f8f('0x3c')](_0x11d0eb['query'][_0x4f8f('0x3c')]));_0x1b9aa6[_0x4f8f('0x3b')]=_0x1b9aa6[_0x4f8f('0x3b')][_0x4f8f('0x3d')]?_0x1b9aa6[_0x4f8f('0x3b')]:_0x90ae1[_0x4f8f('0x37')];_0x1b9aa6[_0x4f8f('0x53')]=qs[_0x4f8f('0x40')](_0x11d0eb[_0x4f8f('0x38')]['sort']);_0x1b9aa6['where']=qs[_0x4f8f('0x3a')](_[_0x4f8f('0x54')](_0x11d0eb['query'],_0x90ae1['filters']));if(_0x11d0eb[_0x4f8f('0x38')][_0x4f8f('0x41')]){_0x1b9aa6[_0x4f8f('0x43')]=_[_0x4f8f('0x42')](_0x1b9aa6['where'],{'$or':_[_0x4f8f('0x32')](_0x1b9aa6[_0x4f8f('0x3b')],function(_0x4baf8b){var _0x14f08e={};_0x14f08e[_0x4baf8b]={'$like':'%'+_0x11d0eb[_0x4f8f('0x38')][_0x4f8f('0x41')]+'%'};return _0x14f08e;})});}_0x1b9aa6=_[_0x4f8f('0x42')]({},_0x1b9aa6,_0x11d0eb[_0x4f8f('0x55')]);return _0x18b8c9[_0x4f8f('0x51')](_0x1b9aa6);}})['then'](function(_0x3ab707){if(_0x3ab707){_0x35d25a=_0x3ab707[_0x4f8f('0x3d')];if(!_0x11d0eb['query'][_0x4f8f('0x3e')]('nolimit')){_0x1b9aa6[_0x4f8f('0x23')]=qs[_0x4f8f('0x23')](_0x11d0eb[_0x4f8f('0x38')]['limit']);_0x1b9aa6[_0x4f8f('0x22')]=qs[_0x4f8f('0x22')](_0x11d0eb[_0x4f8f('0x38')][_0x4f8f('0x22')]);}return _0x18b8c9[_0x4f8f('0x51')](_0x1b9aa6);}})[_0x4f8f('0x2c')](function(_0x39950d){if(_0x39950d){return _0x39950d?{'count':_0x35d25a,'rows':_0x39950d}:null;}})[_0x4f8f('0x2c')](respondWithResult(_0x1ecd05,null))[_0x4f8f('0x4e')](handleError(_0x1ecd05,null));};exports[_0x4f8f('0x56')]=function(_0x437760,_0x2b34dc,_0x348eb5){if(_0x437760[_0x4f8f('0x50')]['id']){delete _0x437760[_0x4f8f('0x50')]['id'];}return db[_0x4f8f('0x45')][_0x4f8f('0x57')]({'where':{'id':_0x437760[_0x4f8f('0x4b')]['id']}})[_0x4f8f('0x2c')](handleEntityNotFound(_0x2b34dc,null))[_0x4f8f('0x2c')](function(_0x427536){if(_0x427536){_0x437760[_0x4f8f('0x50')][_0x4f8f('0x58')]=_0x427536['id'];_0x437760[_0x4f8f('0x50')][_0x4f8f('0x59')]=integrations['getSubjects'](_0x437760[_0x4f8f('0x50')][_0x4f8f('0x5a')],_0x437760[_0x4f8f('0x50')][_0x4f8f('0x35')]);_0x437760['body'][_0x4f8f('0x5b')]=integrations[_0x4f8f('0x5c')](_0x437760['body'][_0x4f8f('0x5a')],_0x437760[_0x4f8f('0x50')][_0x4f8f('0x35')]);return db[_0x4f8f('0x52')]['create'](_0x437760[_0x4f8f('0x50')],{'include':[{'model':db[_0x4f8f('0x5d')],'as':_0x4f8f('0x59')},{'model':db['FreshsalesField'],'as':_0x4f8f('0x5b')}]});}return null;})[_0x4f8f('0x2c')](respondWithResult(_0x2b34dc,null))[_0x4f8f('0x4e')](handleError(_0x2b34dc,null));};exports['getFields']=function(_0x2f366f,_0x2b1bd2,_0x1bf446){var _0x5752a5='';var _0x5a5129='';return db['FreshsalesAccount'][_0x4f8f('0x57')]({'where':{'id':_0x2f366f[_0x4f8f('0x4b')]['id']},'attributes':['id','username','remoteUri',_0x4f8f('0x5e')]})[_0x4f8f('0x2c')](handleEntityNotFound(_0x2b1bd2,null))['then'](function(_0x41675d){if(_0x41675d){_0x5a5129=_0x41675d[_0x4f8f('0x5f')];_0x5752a5=_0x41675d['remoteUri'];var _0x4db22c=_0x41675d[_0x4f8f('0x60')][_0x4f8f('0x61')](-0x1);if(_0x4db22c==='/'){_0x5752a5=_0x5752a5[_0x4f8f('0x62')](0x0,_0x5752a5[_0x4f8f('0x63')](_0x4db22c));}return rp({'method':'GET','uri':util[_0x4f8f('0x64')](_0x4f8f('0x65'),_0x5752a5,_0x4f8f('0x66')),'headers':{'Authorization':_0x4f8f('0x67')+_0x41675d[_0x4f8f('0x5e')]},'json':!![]});}})[_0x4f8f('0x2c')](function(_0x415a8c){if(_0x415a8c){var _0x46b66d=_0x415a8c[_0x4f8f('0x68')];var _0x476686=![];var _0x68cd18=null;for(_0x68cd18=0x0;_0x68cd18<_0x46b66d['length'];_0x68cd18++){if(_0x46b66d[_0x68cd18][_0x4f8f('0x69')]===_0x5a5129){_0x476686=!![];}}if(_0x476686){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4f8f('0x6a')});}}})[_0x4f8f('0x2c')](respondWithResult(_0x2b1bd2,null))['catch'](function(_0x53d411){var _0x437ebc=_0x2f366f[_0x4f8f('0x38')][_0x4f8f('0x6b')]?0x1f4:_0x53d411['statusCode']||0x1f4;logger[_0x4f8f('0x6c')](_0x4f8f('0x6d'),'getFields',_0x437ebc,JSON[_0x4f8f('0x6e')](_0x53d411));delete _0x53d411['name'];if(_0x437ebc===0x191){_0x437ebc=0x190;}_0x2b1bd2[_0x4f8f('0x1f')](_0x437ebc)[_0x4f8f('0x30')](_0x2f366f['query'][_0x4f8f('0x6b')]?{'message':_0x4f8f('0x6f'),'statusCode':_0x53d411[_0x4f8f('0x70')]}:_0x53d411);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index ed3a324..2dbedd4 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 _0xe3da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x1ca282,_0x38ad9b){var _0x3c92eb=function(_0x1a3a63){while(--_0x1a3a63){_0x1ca282['push'](_0x1ca282['shift']());}};_0x3c92eb(++_0x38ad9b);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'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'));var integrations=require(_0xae3d('0xb'));module[_0xae3d('0xc')]=function(_0xa54808,_0x476579){return _0xa54808[_0xae3d('0xd')]('FreshsalesAccount',attributes,{'tableName':_0xae3d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b0=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x30851f,_0x4fff33){var _0x35123d=function(_0x2b09a4){while(--_0x2b09a4){_0x30851f['push'](_0x30851f['shift']());}};_0x35123d(++_0x4fff33);}(_0xa6b0,0xaf));var _0x0a6b=function(_0xacd9ad,_0x38f9b5){_0xacd9ad=_0xacd9ad-0x0;var _0x4c1ae2=_0xa6b0[_0xacd9ad];return _0x4c1ae2;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));var integrations=require(_0x0a6b('0x8'));module[_0x0a6b('0x9')]=function(_0x3b6967,_0x1b5fb5){return _0x3b6967[_0x0a6b('0xa')](_0x0a6b('0xb'),attributes,{'tableName':_0x0a6b('0xc'),'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 7454ce2..f7c41f2 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 _0x323f=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','options','where','attributes','include','map','model','catch','ShowFreshsalesAccount','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x401726,_0x174058){var _0x5610ff=function(_0x363bfb){while(--_0x363bfb){_0x401726['push'](_0x401726['shift']());}};_0x5610ff(++_0x174058);}(_0x323f,0x1ee));var _0xf323=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x323f[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});}exports[_0xf323('0x16')]=function(_0x49b115){var _0x2db977=this;return new Promise(function(_0x272aec,_0x1a459d){return db[_0xf323('0x17')]['findAll']({'raw':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')][_0xf323('0x19')]||null:null,'attributes':_0x49b115[_0xf323('0x18')]?_0x49b115['options'][_0xf323('0x1a')]||null:null,'limit':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')]['limit']||null:null,'include':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')][_0xf323('0x1b')]?_[_0xf323('0x1c')](_0x49b115[_0xf323('0x18')][_0xf323('0x1b')],function(_0x189b23){return{'model':db[_0x189b23[_0xf323('0x1d')]],'as':_0x189b23['as'],'attributes':_0x189b23[_0xf323('0x1a')],'include':_0x189b23['include']?_[_0xf323('0x1c')](_0x189b23[_0xf323('0x1b')],function(_0x33dc52){return{'model':db[_0x33dc52[_0xf323('0x1d')]],'as':_0x33dc52['as'],'attributes':_0x33dc52[_0xf323('0x1a')],'include':_0x33dc52[_0xf323('0x1b')]?_['map'](_0x33dc52[_0xf323('0x1b')],function(_0x56ce33){return{'model':db[_0x56ce33[_0xf323('0x1d')]],'as':_0x56ce33['as'],'attributes':_0x56ce33[_0xf323('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46663b){logger[_0xf323('0xd')](_0xf323('0x16'),_0x49b115);logger[_0xf323('0x10')](_0xf323('0x16'),_0x49b115,JSON['stringify'](_0x46663b));_0x272aec(_0x46663b);})[_0xf323('0x1e')](function(_0x34b536){logger[_0xf323('0x13')](_0xf323('0x16'),_0x34b536[_0xf323('0x14')],_0x49b115);_0x1a459d(_0x2db977[_0xf323('0x13')](0x1f4,_0x34b536[_0xf323('0x14')]));});});};exports[_0xf323('0x1f')]=function(_0x139adc){var _0x52300b=this;return new Promise(function(_0x3f23cf,_0x15187c){return db[_0xf323('0x17')][_0xf323('0x20')]({'raw':_0x139adc[_0xf323('0x18')]?_0x139adc['options'][_0xf323('0x21')]===undefined?!![]:![]:!![],'where':_0x139adc[_0xf323('0x18')]?_0x139adc[_0xf323('0x18')][_0xf323('0x19')]||null:null,'attributes':_0x139adc[_0xf323('0x18')]?_0x139adc['options'][_0xf323('0x1a')]||null:null,'include':_0x139adc[_0xf323('0x18')]?_0x139adc[_0xf323('0x18')][_0xf323('0x1b')]?_['map'](_0x139adc[_0xf323('0x18')]['include'],function(_0x372c47){return{'model':db[_0x372c47[_0xf323('0x1d')]],'as':_0x372c47['as'],'attributes':_0x372c47['attributes'],'include':_0x372c47[_0xf323('0x1b')]?_['map'](_0x372c47[_0xf323('0x1b')],function(_0x4a49d2){return{'model':db[_0x4a49d2[_0xf323('0x1d')]],'as':_0x4a49d2['as'],'attributes':_0x4a49d2['attributes'],'include':_0x4a49d2[_0xf323('0x1b')]?_[_0xf323('0x1c')](_0x4a49d2['include'],function(_0x4964a5){return{'model':db[_0x4964a5['model']],'as':_0x4964a5['as'],'attributes':_0x4964a5[_0xf323('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf323('0xc')](function(_0x79e636){logger[_0xf323('0xd')](_0xf323('0x1f'),_0x139adc);logger['debug']('ShowFreshsalesAccount',_0x139adc,JSON['stringify'](_0x79e636));_0x3f23cf(_0x79e636);})[_0xf323('0x1e')](function(_0x59fee2){logger[_0xf323('0x13')]('ShowFreshsalesAccount',_0x59fee2[_0xf323('0x14')],_0x139adc);_0x15187c(_0x52300b[_0xf323('0x13')](0x1f4,_0x59fee2[_0xf323('0x14')]));});});}; \ No newline at end of file +var _0x7a54=['http','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','then','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x36585d,_0x5da28e){var _0xd1ade7=function(_0x59a4aa){while(--_0x59a4aa){_0x36585d['push'](_0x36585d['shift']());}};_0xd1ade7(++_0x5da28e);}(_0x7a54,0x106));var _0x47a5=function(_0x33b288,_0x2b1cdd){_0x33b288=_0x33b288-0x0;var _0x48a485=_0x7a54[_0x33b288];return _0x48a485;};'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')]('FreshsalesAccount,\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['GetFreshsalesAccount']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 10e4ce8..04d8a08 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 _0xf0d8=['/:id','getSubjects','/:id/descriptions','/:id/fields','post','create','put','delete','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x3aa89b,_0xcbfb73){var _0x2cd5b8=function(_0x4ac1f8){while(--_0x4ac1f8){_0x3aa89b['push'](_0x3aa89b['shift']());}};_0x2cd5b8(++_0xcbfb73);}(_0xf0d8,0x198));var _0x8f0d=function(_0x46966b,_0x58bcfb){_0x46966b=_0x46966b-0x0;var _0x2ef00c=_0xf0d8[_0x46966b];return _0x2ef00c;};'use strict';var multer=require('multer');var util=require(_0x8f0d('0x0'));var path=require(_0x8f0d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f0d('0x2'));var router=express[_0x8f0d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8f0d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8f0d('0x5'));var controller=require(_0x8f0d('0x6'));router[_0x8f0d('0x7')]('/',auth[_0x8f0d('0x8')](),controller[_0x8f0d('0x9')]);router[_0x8f0d('0x7')](_0x8f0d('0xa'),auth[_0x8f0d('0x8')](),controller['show']);router[_0x8f0d('0x7')]('/:id/subjects',auth[_0x8f0d('0x8')](),controller[_0x8f0d('0xb')]);router[_0x8f0d('0x7')](_0x8f0d('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x8f0d('0x7')](_0x8f0d('0xd'),auth[_0x8f0d('0x8')](),controller['getFields']);router[_0x8f0d('0xe')]('/',auth[_0x8f0d('0x8')](),controller[_0x8f0d('0xf')]);router[_0x8f0d('0x10')](_0x8f0d('0xa'),auth[_0x8f0d('0x8')](),controller['update']);router[_0x8f0d('0x11')](_0x8f0d('0xa'),auth[_0x8f0d('0x8')](),controller['destroy']);module[_0x8f0d('0x12')]=router; \ No newline at end of file +var _0x560b=['post','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','show','/:id/subjects','/:id/descriptions','getDescriptions','getFields'];(function(_0x1be8b5,_0x155b31){var _0x1d785d=function(_0x54e47d){while(--_0x54e47d){_0x1be8b5['push'](_0x1be8b5['shift']());}};_0x1d785d(++_0x155b31);}(_0x560b,0x6b));var _0xb560=function(_0x1b3150,_0x527084){_0x1b3150=_0x1b3150-0x0;var _0x159b25=_0x560b[_0x1b3150];return _0x159b25;};'use strict';var multer=require(_0xb560('0x0'));var util=require(_0xb560('0x1'));var path=require(_0xb560('0x2'));var timeout=require(_0xb560('0x3'));var express=require(_0xb560('0x4'));var router=express[_0xb560('0x5')]();var fs_extra=require(_0xb560('0x6'));var auth=require(_0xb560('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb560('0x8'));var controller=require(_0xb560('0x9'));router['get']('/',auth[_0xb560('0xa')](),controller[_0xb560('0xb')]);router[_0xb560('0xc')]('/:id',auth[_0xb560('0xa')](),controller[_0xb560('0xd')]);router[_0xb560('0xc')](_0xb560('0xe'),auth[_0xb560('0xa')](),controller['getSubjects']);router[_0xb560('0xc')](_0xb560('0xf'),auth[_0xb560('0xa')](),controller[_0xb560('0x10')]);router[_0xb560('0xc')]('/:id/fields',auth[_0xb560('0xa')](),controller[_0xb560('0x11')]);router[_0xb560('0x12')]('/',auth[_0xb560('0xa')](),controller[_0xb560('0x13')]);router['put']('/:id',auth[_0xb560('0xa')](),controller[_0xb560('0x14')]);router[_0xb560('0x15')](_0xb560('0x16'),auth[_0xb560('0xa')](),controller[_0xb560('0x17')]);module[_0xb560('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 f3ceb62..e84ad04 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 _0xaea8=['sequelize','exports','STRING'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0xaea8,0x99));var _0x8aea=function(_0x18ccee,_0x3e2257){_0x18ccee=_0x18ccee-0x0;var _0x37ae47=_0xaea8[_0x18ccee];return _0x37ae47;};'use strict';var Sequelize=require(_0x8aea('0x0'));module[_0x8aea('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8aea('0x2')]}}; \ No newline at end of file +var _0x9fcf=['sequelize','exports','STRING'];(function(_0x28aad1,_0x5ca3b1){var _0x251733=function(_0x33150b){while(--_0x33150b){_0x28aad1['push'](_0x28aad1['shift']());}};_0x251733(++_0x5ca3b1);}(_0x9fcf,0xc9));var _0xf9fc=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x9fcf[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xf9fc('0x0'));module[_0xf9fc('0x1')]={'name':{'type':Sequelize[_0xf9fc('0x2')]},'description':{'type':Sequelize[_0xf9fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index cf38845..d739c32 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 _0x8752=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','count','json','apply','reject','then','end','error','stack','name','index','FreshsalesConfiguration','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create','body','destroy','findOne','order','getSubjects','nolimit','getDescriptions','FreshsalesField','getFields','eml-format'];(function(_0x34d3c3,_0x92d2bc){var _0x223195=function(_0x4adc4c){while(--_0x4adc4c){_0x34d3c3['push'](_0x34d3c3['shift']());}};_0x223195(++_0x92d2bc);}(_0x8752,0x1c1));var _0x2875=function(_0x2f42d8,_0x72bc12){_0x2f42d8=_0x2f42d8-0x0;var _0xc66ff6=_0x8752[_0x2f42d8];return _0xc66ff6;};'use strict';var emlformat=require(_0x2875('0x0'));var rimraf=require(_0x2875('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2875('0x2'));var rp=require(_0x2875('0x3'));var moment=require(_0x2875('0x4'));var BPromise=require(_0x2875('0x5'));var Mustache=require(_0x2875('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2875('0x7'));var csv=require(_0x2875('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2875('0x9'));var _=require(_0x2875('0xa'));var squel=require(_0x2875('0xb'));var crypto=require('crypto');var jsforce=require(_0x2875('0xc'));var deskjs=require(_0x2875('0xd'));var toCsv=require(_0x2875('0x8'));var querystring=require('querystring');var Papa=require(_0x2875('0xe'));var Redis=require(_0x2875('0xf'));var authService=require(_0x2875('0x10'));var qs=require(_0x2875('0x11'));var as=require(_0x2875('0x12'));var hardwareService=require(_0x2875('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2875('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2875('0x15'))['db'];function respondWithStatusCode(_0x104d6e,_0x2026d3){_0x2026d3=_0x2026d3||0xcc;return function(_0x518682){if(_0x518682){return _0x104d6e[_0x2875('0x16')](_0x2026d3);}return _0x104d6e[_0x2875('0x17')](_0x2026d3)['end']();};}function respondWithResult(_0x3bf87d,_0x1fe913){_0x1fe913=_0x1fe913||0xc8;return function(_0xaadf45){if(_0xaadf45){return _0x3bf87d[_0x2875('0x17')](_0x1fe913)['json'](_0xaadf45);}};}function respondWithFilteredResult(_0x3d91f0,_0x332449){return function(_0xfc2c4d){if(_0xfc2c4d){var _0x444936=typeof _0x332449[_0x2875('0x18')]==='undefined'&&typeof _0x332449[_0x2875('0x19')]==='undefined';var _0x3fede5=_0xfc2c4d[_0x2875('0x1a')];var _0x130957=_0x444936?0x0:_0x332449[_0x2875('0x18')];var _0x4ea887=_0x444936?_0xfc2c4d['count']:_0x332449['offset']+_0x332449[_0x2875('0x19')];var _0x11e45b;if(_0x4ea887>=_0x3fede5){_0x4ea887=_0x3fede5;_0x11e45b=0xc8;}else{_0x11e45b=0xce;}_0x3d91f0['status'](_0x11e45b);return _0x3d91f0['set']('Content-Range',_0x130957+'-'+_0x4ea887+'/'+_0x3fede5)[_0x2875('0x1b')](_0xfc2c4d);}return null;};}function patchUpdates(_0x376a6e){return function(_0x54ae71){try{jsonpatch[_0x2875('0x1c')](_0x54ae71,_0x376a6e,!![]);}catch(_0x93217){return BPromise[_0x2875('0x1d')](_0x93217);}return _0x54ae71['save']();};}function saveUpdates(_0x3584be,_0x44cfbc){return function(_0x1ed8cb){if(_0x1ed8cb){return _0x1ed8cb['update'](_0x3584be)['then'](function(_0x342f2c){return _0x342f2c;});}return null;};}function removeEntity(_0x374bd6,_0x4435e7){return function(_0xfc0a4d){if(_0xfc0a4d){return _0xfc0a4d['destroy']()[_0x2875('0x1e')](function(){_0x374bd6[_0x2875('0x17')](0xcc)[_0x2875('0x1f')]();});}};}function handleEntityNotFound(_0x436f0a,_0x4961cc){return function(_0x21b778){if(!_0x21b778){_0x436f0a[_0x2875('0x16')](0x194);}return _0x21b778;};}function handleError(_0x17b956,_0xb5a77a){_0xb5a77a=_0xb5a77a||0x1f4;return function(_0x5f586c){logger[_0x2875('0x20')](_0x5f586c[_0x2875('0x21')]);if(_0x5f586c[_0x2875('0x22')]){delete _0x5f586c[_0x2875('0x22')];}_0x17b956[_0x2875('0x17')](_0xb5a77a)['send'](_0x5f586c);};}exports[_0x2875('0x23')]=function(_0x5d9d08,_0x5b3b55){var _0x41c3e2={},_0x1ea84a={},_0xcdeb8b={'count':0x0,'rows':[]};var _0x1f82eb=_['map'](db[_0x2875('0x24')][_0x2875('0x25')],function(_0x178c2){return{'name':_0x178c2[_0x2875('0x26')],'type':_0x178c2[_0x2875('0x27')]['key']};});_0x1ea84a['model']=_[_0x2875('0x28')](_0x1f82eb,_0x2875('0x22'));_0x1ea84a[_0x2875('0x29')]=_['keys'](_0x5d9d08[_0x2875('0x29')]);_0x1ea84a[_0x2875('0x2a')]=_[_0x2875('0x2b')](_0x1ea84a[_0x2875('0x2c')],_0x1ea84a[_0x2875('0x29')]);_0x41c3e2['attributes']=_[_0x2875('0x2b')](_0x1ea84a[_0x2875('0x2c')],qs['fields'](_0x5d9d08[_0x2875('0x29')]['fields']));_0x41c3e2['attributes']=_0x41c3e2[_0x2875('0x2d')][_0x2875('0x2e')]?_0x41c3e2[_0x2875('0x2d')]:_0x1ea84a[_0x2875('0x2c')];if(!_0x5d9d08['query'][_0x2875('0x2f')]('nolimit')){_0x41c3e2[_0x2875('0x19')]=qs['limit'](_0x5d9d08['query'][_0x2875('0x19')]);_0x41c3e2[_0x2875('0x18')]=qs[_0x2875('0x18')](_0x5d9d08[_0x2875('0x29')]['offset']);}_0x41c3e2['order']=qs[_0x2875('0x30')](_0x5d9d08[_0x2875('0x29')][_0x2875('0x30')]);_0x41c3e2[_0x2875('0x31')]=qs[_0x2875('0x2a')](_[_0x2875('0x32')](_0x5d9d08[_0x2875('0x29')],_0x1ea84a[_0x2875('0x2a')]),_0x1f82eb);if(_0x5d9d08[_0x2875('0x29')]['filter']){_0x41c3e2[_0x2875('0x31')]=_[_0x2875('0x33')](_0x41c3e2[_0x2875('0x31')],{'$or':_[_0x2875('0x28')](_0x1f82eb,function(_0x447f94){if(_0x447f94[_0x2875('0x27')]!==_0x2875('0x34')){var _0xfc5bb1={};_0xfc5bb1[_0x447f94['name']]={'$like':'%'+_0x5d9d08[_0x2875('0x29')][_0x2875('0x35')]+'%'};return _0xfc5bb1;}})});}_0x41c3e2=_['merge']({},_0x41c3e2,_0x5d9d08[_0x2875('0x36')]);var _0x530efd={'where':_0x41c3e2[_0x2875('0x31')]};return db[_0x2875('0x24')][_0x2875('0x1a')](_0x530efd)[_0x2875('0x1e')](function(_0x1b1f48){_0xcdeb8b[_0x2875('0x1a')]=_0x1b1f48;if(_0x5d9d08['query']['includeAll']){_0x41c3e2[_0x2875('0x37')]=[{'all':!![]}];}return db[_0x2875('0x24')][_0x2875('0x38')](_0x41c3e2);})['then'](function(_0x430856){_0xcdeb8b[_0x2875('0x39')]=_0x430856;return _0xcdeb8b;})[_0x2875('0x1e')](respondWithFilteredResult(_0x5b3b55,_0x41c3e2))[_0x2875('0x3a')](handleError(_0x5b3b55,null));};exports[_0x2875('0x3b')]=function(_0x47f4f1,_0xd56ebd){var _0x5899c2={'raw':![],'where':{'id':_0x47f4f1[_0x2875('0x3c')]['id']}},_0x1f38dc={};_0x1f38dc[_0x2875('0x2c')]=_[_0x2875('0x3d')](db[_0x2875('0x24')][_0x2875('0x25')]);_0x1f38dc['query']=_[_0x2875('0x3d')](_0x47f4f1[_0x2875('0x29')]);_0x1f38dc['filters']=_[_0x2875('0x2b')](_0x1f38dc[_0x2875('0x2c')],_0x1f38dc['query']);_0x5899c2[_0x2875('0x2d')]=_[_0x2875('0x2b')](_0x1f38dc[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x47f4f1[_0x2875('0x29')][_0x2875('0x3e')]));_0x5899c2[_0x2875('0x2d')]=_0x5899c2[_0x2875('0x2d')][_0x2875('0x2e')]?_0x5899c2['attributes']:_0x1f38dc[_0x2875('0x2c')];if(_0x47f4f1[_0x2875('0x29')][_0x2875('0x3f')]){_0x5899c2['include']=[{'all':!![]}];}_0x5899c2=_[_0x2875('0x33')]({},_0x5899c2,_0x47f4f1['options']);return db[_0x2875('0x24')][_0x2875('0x40')](_0x5899c2)[_0x2875('0x1e')](handleEntityNotFound(_0xd56ebd,null))[_0x2875('0x1e')](respondWithResult(_0xd56ebd,null))[_0x2875('0x3a')](handleError(_0xd56ebd,null));};exports['create']=function(_0x2d969c,_0x3c4ad2){return db[_0x2875('0x24')][_0x2875('0x41')](_0x2d969c[_0x2875('0x42')],{})['then'](respondWithResult(_0x3c4ad2,0xc9))[_0x2875('0x3a')](handleError(_0x3c4ad2,null));};exports['update']=function(_0x182451,_0x35b20c){if(_0x182451[_0x2875('0x42')]['id']){delete _0x182451['body']['id'];}return db['FreshsalesConfiguration'][_0x2875('0x40')]({'where':{'id':_0x182451[_0x2875('0x3c')]['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x35b20c,null))[_0x2875('0x1e')](saveUpdates(_0x182451[_0x2875('0x42')],null))[_0x2875('0x1e')](respondWithResult(_0x35b20c,null))[_0x2875('0x3a')](handleError(_0x35b20c,null));};exports[_0x2875('0x43')]=function(_0x467f95,_0x404c57){return db[_0x2875('0x24')][_0x2875('0x40')]({'where':{'id':_0x467f95[_0x2875('0x3c')]['id']}})['then'](handleEntityNotFound(_0x404c57,null))[_0x2875('0x1e')](removeEntity(_0x404c57,null))[_0x2875('0x3a')](handleError(_0x404c57,null));};exports['getSubjects']=function(_0x5b1cd4,_0x38c1c3,_0x5154c2){var _0xb0785e={};var _0x49ee9a={};var _0x41d3da;var _0x6abf2e;return db['FreshsalesConfiguration'][_0x2875('0x44')]({'where':{'id':_0x5b1cd4['params']['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x38c1c3,null))[_0x2875('0x1e')](function(_0x513eff){if(_0x513eff){_0x41d3da=_0x513eff;_0x49ee9a[_0x2875('0x2c')]=_[_0x2875('0x3d')](db['FreshsalesField'][_0x2875('0x25')]);_0x49ee9a['query']=_[_0x2875('0x3d')](_0x5b1cd4[_0x2875('0x29')]);_0x49ee9a[_0x2875('0x2a')]=_[_0x2875('0x2b')](_0x49ee9a[_0x2875('0x2c')],_0x49ee9a['query']);_0xb0785e[_0x2875('0x2d')]=_[_0x2875('0x2b')](_0x49ee9a[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x5b1cd4[_0x2875('0x29')]['fields']));_0xb0785e[_0x2875('0x2d')]=_0xb0785e['attributes'][_0x2875('0x2e')]?_0xb0785e[_0x2875('0x2d')]:_0x49ee9a[_0x2875('0x2c')];_0xb0785e[_0x2875('0x45')]=qs[_0x2875('0x30')](_0x5b1cd4[_0x2875('0x29')][_0x2875('0x30')]);_0xb0785e[_0x2875('0x31')]=qs[_0x2875('0x2a')](_[_0x2875('0x32')](_0x5b1cd4[_0x2875('0x29')],_0x49ee9a[_0x2875('0x2a')]));if(_0x5b1cd4['query'][_0x2875('0x35')]){_0xb0785e['where']=_[_0x2875('0x33')](_0xb0785e[_0x2875('0x31')],{'$or':_[_0x2875('0x28')](_0xb0785e[_0x2875('0x2d')],function(_0x2d6087){var _0x35ea5a={};_0x35ea5a[_0x2d6087]={'$like':'%'+_0x5b1cd4[_0x2875('0x29')][_0x2875('0x35')]+'%'};return _0x35ea5a;})});}_0xb0785e=_[_0x2875('0x33')]({},_0xb0785e,_0x5b1cd4['options']);return _0x41d3da[_0x2875('0x46')](_0xb0785e);}})[_0x2875('0x1e')](function(_0x348dff){if(_0x348dff){_0x6abf2e=_0x348dff[_0x2875('0x2e')];if(!_0x5b1cd4[_0x2875('0x29')][_0x2875('0x2f')](_0x2875('0x47'))){_0xb0785e['limit']=qs['limit'](_0x5b1cd4[_0x2875('0x29')]['limit']);_0xb0785e[_0x2875('0x18')]=qs[_0x2875('0x18')](_0x5b1cd4[_0x2875('0x29')]['offset']);}return _0x41d3da['getSubjects'](_0xb0785e);}})[_0x2875('0x1e')](function(_0x1069ba){if(_0x1069ba){return _0x1069ba?{'count':_0x6abf2e,'rows':_0x1069ba}:null;}})[_0x2875('0x1e')](respondWithResult(_0x38c1c3,null))['catch'](handleError(_0x38c1c3,null));};exports[_0x2875('0x48')]=function(_0x3ab555,_0x4b0627,_0xa47121){var _0x2f2bdb={};var _0x26601c={};var _0x4ce7c1;var _0x43650f;return db[_0x2875('0x24')][_0x2875('0x44')]({'where':{'id':_0x3ab555[_0x2875('0x3c')]['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x4b0627,null))[_0x2875('0x1e')](function(_0x4568fc){if(_0x4568fc){_0x4ce7c1=_0x4568fc;_0x26601c['model']=_['keys'](db[_0x2875('0x49')][_0x2875('0x25')]);_0x26601c[_0x2875('0x29')]=_[_0x2875('0x3d')](_0x3ab555[_0x2875('0x29')]);_0x26601c[_0x2875('0x2a')]=_['intersection'](_0x26601c[_0x2875('0x2c')],_0x26601c[_0x2875('0x29')]);_0x2f2bdb['attributes']=_[_0x2875('0x2b')](_0x26601c[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x3ab555[_0x2875('0x29')][_0x2875('0x3e')]));_0x2f2bdb[_0x2875('0x2d')]=_0x2f2bdb['attributes'][_0x2875('0x2e')]?_0x2f2bdb[_0x2875('0x2d')]:_0x26601c['model'];_0x2f2bdb[_0x2875('0x45')]=qs[_0x2875('0x30')](_0x3ab555[_0x2875('0x29')]['sort']);_0x2f2bdb[_0x2875('0x31')]=qs[_0x2875('0x2a')](_[_0x2875('0x32')](_0x3ab555[_0x2875('0x29')],_0x26601c[_0x2875('0x2a')]));if(_0x3ab555['query'][_0x2875('0x35')]){_0x2f2bdb[_0x2875('0x31')]=_[_0x2875('0x33')](_0x2f2bdb['where'],{'$or':_[_0x2875('0x28')](_0x2f2bdb['attributes'],function(_0x243405){var _0x54a22c={};_0x54a22c[_0x243405]={'$like':'%'+_0x3ab555[_0x2875('0x29')][_0x2875('0x35')]+'%'};return _0x54a22c;})});}_0x2f2bdb=_[_0x2875('0x33')]({},_0x2f2bdb,_0x3ab555['options']);return _0x4ce7c1[_0x2875('0x48')](_0x2f2bdb);}})[_0x2875('0x1e')](function(_0x3c48f4){if(_0x3c48f4){_0x43650f=_0x3c48f4[_0x2875('0x2e')];if(!_0x3ab555['query'][_0x2875('0x2f')](_0x2875('0x47'))){_0x2f2bdb[_0x2875('0x19')]=qs[_0x2875('0x19')](_0x3ab555[_0x2875('0x29')][_0x2875('0x19')]);_0x2f2bdb['offset']=qs[_0x2875('0x18')](_0x3ab555[_0x2875('0x29')]['offset']);}return _0x4ce7c1[_0x2875('0x48')](_0x2f2bdb);}})[_0x2875('0x1e')](function(_0x5c8734){if(_0x5c8734){return _0x5c8734?{'count':_0x43650f,'rows':_0x5c8734}:null;}})[_0x2875('0x1e')](respondWithResult(_0x4b0627,null))[_0x2875('0x3a')](handleError(_0x4b0627,null));};exports[_0x2875('0x4a')]=function(_0x357571,_0x1fdcb0,_0x4602eb){var _0xcc1ae9={};var _0x36b584={};var _0x23ec5c;var _0x180439;return db[_0x2875('0x24')][_0x2875('0x44')]({'where':{'id':_0x357571[_0x2875('0x3c')]['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x1fdcb0,null))['then'](function(_0x571842){if(_0x571842){_0x23ec5c=_0x571842;_0x36b584[_0x2875('0x2c')]=_[_0x2875('0x3d')](db[_0x2875('0x49')][_0x2875('0x25')]);_0x36b584['query']=_[_0x2875('0x3d')](_0x357571[_0x2875('0x29')]);_0x36b584['filters']=_[_0x2875('0x2b')](_0x36b584[_0x2875('0x2c')],_0x36b584[_0x2875('0x29')]);_0xcc1ae9[_0x2875('0x2d')]=_['intersection'](_0x36b584[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x357571['query'][_0x2875('0x3e')]));_0xcc1ae9[_0x2875('0x2d')]=_0xcc1ae9['attributes'][_0x2875('0x2e')]?_0xcc1ae9['attributes']:_0x36b584[_0x2875('0x2c')];_0xcc1ae9['order']=qs[_0x2875('0x30')](_0x357571['query'][_0x2875('0x30')]);_0xcc1ae9[_0x2875('0x31')]=qs[_0x2875('0x2a')](_['pick'](_0x357571[_0x2875('0x29')],_0x36b584[_0x2875('0x2a')]));if(_0x357571[_0x2875('0x29')]['filter']){_0xcc1ae9[_0x2875('0x31')]=_[_0x2875('0x33')](_0xcc1ae9[_0x2875('0x31')],{'$or':_[_0x2875('0x28')](_0xcc1ae9['attributes'],function(_0x567c84){var _0x5a86d3={};_0x5a86d3[_0x567c84]={'$like':'%'+_0x357571['query'][_0x2875('0x35')]+'%'};return _0x5a86d3;})});}_0xcc1ae9=_[_0x2875('0x33')]({},_0xcc1ae9,_0x357571['options']);return _0x23ec5c['getFields'](_0xcc1ae9);}})[_0x2875('0x1e')](function(_0x55b794){if(_0x55b794){_0x180439=_0x55b794[_0x2875('0x2e')];if(!_0x357571['query'][_0x2875('0x2f')](_0x2875('0x47'))){_0xcc1ae9[_0x2875('0x19')]=qs['limit'](_0x357571[_0x2875('0x29')]['limit']);_0xcc1ae9['offset']=qs[_0x2875('0x18')](_0x357571[_0x2875('0x29')]['offset']);}return _0x23ec5c[_0x2875('0x4a')](_0xcc1ae9);}})[_0x2875('0x1e')](function(_0x55e02d){if(_0x55e02d){return _0x55e02d?{'count':_0x180439,'rows':_0x55e02d}:null;}})[_0x2875('0x1e')](respondWithResult(_0x1fdcb0,null))[_0x2875('0x3a')](handleError(_0x1fdcb0,null));}; \ No newline at end of file +var _0x4c28=['getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','merge','find','create','body','getSubjects','FreshsalesField','pick','nolimit','getDescriptions','findOne'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4c28,0x145));var _0x84c2=function(_0x256422,_0x367394){_0x256422=_0x256422-0x0;var _0x55dddc=_0x4c28[_0x256422];return _0x55dddc;};'use strict';var emlformat=require(_0x84c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x84c2('0x1'));var jsonpatch=require(_0x84c2('0x2'));var rp=require(_0x84c2('0x3'));var moment=require(_0x84c2('0x4'));var BPromise=require(_0x84c2('0x5'));var Mustache=require(_0x84c2('0x6'));var util=require(_0x84c2('0x7'));var path=require('path');var sox=require(_0x84c2('0x8'));var csv=require(_0x84c2('0x9'));var ejs=require(_0x84c2('0xa'));var fs=require('fs');var fs_extra=require(_0x84c2('0xb'));var _=require('lodash');var squel=require(_0x84c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x84c2('0x9'));var querystring=require(_0x84c2('0xd'));var Papa=require(_0x84c2('0xe'));var Redis=require(_0x84c2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x84c2('0x10'));var as=require(_0x84c2('0x11'));var hardwareService=require(_0x84c2('0x12'));var logger=require('../../config/logger')(_0x84c2('0x13'));var utils=require(_0x84c2('0x14'));var config=require(_0x84c2('0x15'));var licenseUtil=require(_0x84c2('0x16'));var db=require(_0x84c2('0x17'))['db'];function respondWithStatusCode(_0x426fcd,_0x59be86){_0x59be86=_0x59be86||0xcc;return function(_0x2b8f3a){if(_0x2b8f3a){return _0x426fcd[_0x84c2('0x18')](_0x59be86);}return _0x426fcd['status'](_0x59be86)[_0x84c2('0x19')]();};}function respondWithResult(_0x2170d0,_0x2ada88){_0x2ada88=_0x2ada88||0xc8;return function(_0x2ceee6){if(_0x2ceee6){return _0x2170d0[_0x84c2('0x1a')](_0x2ada88)[_0x84c2('0x1b')](_0x2ceee6);}};}function respondWithFilteredResult(_0x10ca3c,_0x5a7ea7){return function(_0x580c17){if(_0x580c17){var _0x28f94f=typeof _0x5a7ea7['offset']===_0x84c2('0x1c')&&typeof _0x5a7ea7[_0x84c2('0x1d')]==='undefined';var _0x246c1e=_0x580c17[_0x84c2('0x1e')];var _0x39da21=_0x28f94f?0x0:_0x5a7ea7[_0x84c2('0x1f')];var _0x5f0706=_0x28f94f?_0x580c17[_0x84c2('0x1e')]:_0x5a7ea7['offset']+_0x5a7ea7[_0x84c2('0x1d')];var _0x2a8efe;if(_0x5f0706>=_0x246c1e){_0x5f0706=_0x246c1e;_0x2a8efe=0xc8;}else{_0x2a8efe=0xce;}_0x10ca3c[_0x84c2('0x1a')](_0x2a8efe);return _0x10ca3c[_0x84c2('0x20')](_0x84c2('0x21'),_0x39da21+'-'+_0x5f0706+'/'+_0x246c1e)[_0x84c2('0x1b')](_0x580c17);}return null;};}function patchUpdates(_0x2b0ee3){return function(_0x476aad){try{jsonpatch['apply'](_0x476aad,_0x2b0ee3,!![]);}catch(_0x4975b0){return BPromise[_0x84c2('0x22')](_0x4975b0);}return _0x476aad[_0x84c2('0x23')]();};}function saveUpdates(_0x93dbbe,_0x5964a1){return function(_0x384aae){if(_0x384aae){return _0x384aae[_0x84c2('0x24')](_0x93dbbe)[_0x84c2('0x25')](function(_0xf5c9e1){return _0xf5c9e1;});}return null;};}function removeEntity(_0x1d8f76,_0x531ca3){return function(_0x3718db){if(_0x3718db){return _0x3718db[_0x84c2('0x26')]()[_0x84c2('0x25')](function(){_0x1d8f76[_0x84c2('0x1a')](0xcc)[_0x84c2('0x19')]();});}};}function handleEntityNotFound(_0x19bb5c,_0x9aae51){return function(_0x1bccf6){if(!_0x1bccf6){_0x19bb5c[_0x84c2('0x18')](0x194);}return _0x1bccf6;};}function handleError(_0x43f9e5,_0x56d1cf){_0x56d1cf=_0x56d1cf||0x1f4;return function(_0x56af0a){logger['error'](_0x56af0a[_0x84c2('0x27')]);if(_0x56af0a[_0x84c2('0x28')]){delete _0x56af0a['name'];}_0x43f9e5[_0x84c2('0x1a')](_0x56d1cf)[_0x84c2('0x29')](_0x56af0a);};}exports[_0x84c2('0x2a')]=function(_0x3a6cb1,_0x558323){var _0x2fa04b={},_0x38a74a={},_0x4c99ae={'count':0x0,'rows':[]};var _0x2984b7=_[_0x84c2('0x2b')](db[_0x84c2('0x2c')][_0x84c2('0x2d')],function(_0x4f8d50){return{'name':_0x4f8d50['fieldName'],'type':_0x4f8d50[_0x84c2('0x2e')][_0x84c2('0x2f')]};});_0x38a74a['model']=_[_0x84c2('0x2b')](_0x2984b7,_0x84c2('0x28'));_0x38a74a[_0x84c2('0x30')]=_[_0x84c2('0x31')](_0x3a6cb1[_0x84c2('0x30')]);_0x38a74a[_0x84c2('0x32')]=_['intersection'](_0x38a74a[_0x84c2('0x33')],_0x38a74a[_0x84c2('0x30')]);_0x2fa04b[_0x84c2('0x34')]=_['intersection'](_0x38a74a[_0x84c2('0x33')],qs[_0x84c2('0x35')](_0x3a6cb1[_0x84c2('0x30')][_0x84c2('0x35')]));_0x2fa04b[_0x84c2('0x34')]=_0x2fa04b[_0x84c2('0x34')][_0x84c2('0x36')]?_0x2fa04b['attributes']:_0x38a74a[_0x84c2('0x33')];if(!_0x3a6cb1[_0x84c2('0x30')][_0x84c2('0x37')]('nolimit')){_0x2fa04b[_0x84c2('0x1d')]=qs[_0x84c2('0x1d')](_0x3a6cb1[_0x84c2('0x30')][_0x84c2('0x1d')]);_0x2fa04b[_0x84c2('0x1f')]=qs[_0x84c2('0x1f')](_0x3a6cb1[_0x84c2('0x30')][_0x84c2('0x1f')]);}_0x2fa04b[_0x84c2('0x38')]=qs['sort'](_0x3a6cb1[_0x84c2('0x30')][_0x84c2('0x39')]);_0x2fa04b[_0x84c2('0x3a')]=qs[_0x84c2('0x32')](_['pick'](_0x3a6cb1[_0x84c2('0x30')],_0x38a74a['filters']),_0x2984b7);if(_0x3a6cb1[_0x84c2('0x30')]['filter']){_0x2fa04b[_0x84c2('0x3a')]=_['merge'](_0x2fa04b[_0x84c2('0x3a')],{'$or':_[_0x84c2('0x2b')](_0x2984b7,function(_0x2b3a40){if(_0x2b3a40[_0x84c2('0x2e')]!==_0x84c2('0x3b')){var _0x4f29f3={};_0x4f29f3[_0x2b3a40['name']]={'$like':'%'+_0x3a6cb1[_0x84c2('0x30')][_0x84c2('0x3c')]+'%'};return _0x4f29f3;}})});}_0x2fa04b=_['merge']({},_0x2fa04b,_0x3a6cb1[_0x84c2('0x3d')]);var _0x3def7c={'where':_0x2fa04b['where']};return db[_0x84c2('0x2c')][_0x84c2('0x1e')](_0x3def7c)[_0x84c2('0x25')](function(_0x368a79){_0x4c99ae[_0x84c2('0x1e')]=_0x368a79;if(_0x3a6cb1['query'][_0x84c2('0x3e')]){_0x2fa04b[_0x84c2('0x3f')]=[{'all':!![]}];}return db[_0x84c2('0x2c')][_0x84c2('0x40')](_0x2fa04b);})['then'](function(_0x5eda5e){_0x4c99ae[_0x84c2('0x41')]=_0x5eda5e;return _0x4c99ae;})[_0x84c2('0x25')](respondWithFilteredResult(_0x558323,_0x2fa04b))[_0x84c2('0x42')](handleError(_0x558323,null));};exports[_0x84c2('0x43')]=function(_0x1ad555,_0x58d91){var _0x50c720={'raw':![],'where':{'id':_0x1ad555[_0x84c2('0x44')]['id']}},_0x378bcc={};_0x378bcc[_0x84c2('0x33')]=_['keys'](db[_0x84c2('0x2c')][_0x84c2('0x2d')]);_0x378bcc[_0x84c2('0x30')]=_[_0x84c2('0x31')](_0x1ad555[_0x84c2('0x30')]);_0x378bcc[_0x84c2('0x32')]=_[_0x84c2('0x45')](_0x378bcc[_0x84c2('0x33')],_0x378bcc['query']);_0x50c720[_0x84c2('0x34')]=_[_0x84c2('0x45')](_0x378bcc['model'],qs[_0x84c2('0x35')](_0x1ad555[_0x84c2('0x30')]['fields']));_0x50c720['attributes']=_0x50c720[_0x84c2('0x34')][_0x84c2('0x36')]?_0x50c720[_0x84c2('0x34')]:_0x378bcc[_0x84c2('0x33')];if(_0x1ad555['query'][_0x84c2('0x3e')]){_0x50c720['include']=[{'all':!![]}];}_0x50c720=_[_0x84c2('0x46')]({},_0x50c720,_0x1ad555['options']);return db[_0x84c2('0x2c')][_0x84c2('0x47')](_0x50c720)[_0x84c2('0x25')](handleEntityNotFound(_0x58d91,null))[_0x84c2('0x25')](respondWithResult(_0x58d91,null))[_0x84c2('0x42')](handleError(_0x58d91,null));};exports[_0x84c2('0x48')]=function(_0x3177cb,_0x1b1c3b){return db['FreshsalesConfiguration'][_0x84c2('0x48')](_0x3177cb[_0x84c2('0x49')],{})[_0x84c2('0x25')](respondWithResult(_0x1b1c3b,0xc9))[_0x84c2('0x42')](handleError(_0x1b1c3b,null));};exports[_0x84c2('0x24')]=function(_0x3b31a0,_0x69bb52){if(_0x3b31a0[_0x84c2('0x49')]['id']){delete _0x3b31a0[_0x84c2('0x49')]['id'];}return db[_0x84c2('0x2c')]['find']({'where':{'id':_0x3b31a0[_0x84c2('0x44')]['id']}})['then'](handleEntityNotFound(_0x69bb52,null))[_0x84c2('0x25')](saveUpdates(_0x3b31a0[_0x84c2('0x49')],null))[_0x84c2('0x25')](respondWithResult(_0x69bb52,null))['catch'](handleError(_0x69bb52,null));};exports['destroy']=function(_0x5252a3,_0x24e919){return db[_0x84c2('0x2c')][_0x84c2('0x47')]({'where':{'id':_0x5252a3[_0x84c2('0x44')]['id']}})[_0x84c2('0x25')](handleEntityNotFound(_0x24e919,null))[_0x84c2('0x25')](removeEntity(_0x24e919,null))['catch'](handleError(_0x24e919,null));};exports[_0x84c2('0x4a')]=function(_0x10e82b,_0x4de0af,_0x1b19da){var _0x5e62fc={};var _0xcbbc67={};var _0x30ebef;var _0x1d5fbf;return db[_0x84c2('0x2c')]['findOne']({'where':{'id':_0x10e82b['params']['id']}})[_0x84c2('0x25')](handleEntityNotFound(_0x4de0af,null))[_0x84c2('0x25')](function(_0x475eee){if(_0x475eee){_0x30ebef=_0x475eee;_0xcbbc67['model']=_[_0x84c2('0x31')](db[_0x84c2('0x4b')][_0x84c2('0x2d')]);_0xcbbc67[_0x84c2('0x30')]=_[_0x84c2('0x31')](_0x10e82b[_0x84c2('0x30')]);_0xcbbc67[_0x84c2('0x32')]=_['intersection'](_0xcbbc67[_0x84c2('0x33')],_0xcbbc67[_0x84c2('0x30')]);_0x5e62fc[_0x84c2('0x34')]=_[_0x84c2('0x45')](_0xcbbc67[_0x84c2('0x33')],qs[_0x84c2('0x35')](_0x10e82b[_0x84c2('0x30')][_0x84c2('0x35')]));_0x5e62fc['attributes']=_0x5e62fc[_0x84c2('0x34')]['length']?_0x5e62fc[_0x84c2('0x34')]:_0xcbbc67['model'];_0x5e62fc['order']=qs[_0x84c2('0x39')](_0x10e82b[_0x84c2('0x30')]['sort']);_0x5e62fc[_0x84c2('0x3a')]=qs[_0x84c2('0x32')](_[_0x84c2('0x4c')](_0x10e82b[_0x84c2('0x30')],_0xcbbc67[_0x84c2('0x32')]));if(_0x10e82b['query']['filter']){_0x5e62fc[_0x84c2('0x3a')]=_[_0x84c2('0x46')](_0x5e62fc[_0x84c2('0x3a')],{'$or':_[_0x84c2('0x2b')](_0x5e62fc[_0x84c2('0x34')],function(_0x1d0745){var _0x6daa2c={};_0x6daa2c[_0x1d0745]={'$like':'%'+_0x10e82b['query'][_0x84c2('0x3c')]+'%'};return _0x6daa2c;})});}_0x5e62fc=_[_0x84c2('0x46')]({},_0x5e62fc,_0x10e82b[_0x84c2('0x3d')]);return _0x30ebef[_0x84c2('0x4a')](_0x5e62fc);}})[_0x84c2('0x25')](function(_0x47816){if(_0x47816){_0x1d5fbf=_0x47816[_0x84c2('0x36')];if(!_0x10e82b[_0x84c2('0x30')][_0x84c2('0x37')](_0x84c2('0x4d'))){_0x5e62fc['limit']=qs['limit'](_0x10e82b[_0x84c2('0x30')]['limit']);_0x5e62fc[_0x84c2('0x1f')]=qs[_0x84c2('0x1f')](_0x10e82b['query']['offset']);}return _0x30ebef[_0x84c2('0x4a')](_0x5e62fc);}})[_0x84c2('0x25')](function(_0x4f71c6){if(_0x4f71c6){return _0x4f71c6?{'count':_0x1d5fbf,'rows':_0x4f71c6}:null;}})[_0x84c2('0x25')](respondWithResult(_0x4de0af,null))[_0x84c2('0x42')](handleError(_0x4de0af,null));};exports[_0x84c2('0x4e')]=function(_0x3c3923,_0xe56053,_0x3a509a){var _0x2813da={};var _0xf6f2d3={};var _0x3b3bc8;var _0x54342c;return db[_0x84c2('0x2c')][_0x84c2('0x4f')]({'where':{'id':_0x3c3923[_0x84c2('0x44')]['id']}})['then'](handleEntityNotFound(_0xe56053,null))['then'](function(_0x22b724){if(_0x22b724){_0x3b3bc8=_0x22b724;_0xf6f2d3[_0x84c2('0x33')]=_[_0x84c2('0x31')](db[_0x84c2('0x4b')][_0x84c2('0x2d')]);_0xf6f2d3[_0x84c2('0x30')]=_[_0x84c2('0x31')](_0x3c3923[_0x84c2('0x30')]);_0xf6f2d3['filters']=_[_0x84c2('0x45')](_0xf6f2d3[_0x84c2('0x33')],_0xf6f2d3[_0x84c2('0x30')]);_0x2813da[_0x84c2('0x34')]=_['intersection'](_0xf6f2d3['model'],qs[_0x84c2('0x35')](_0x3c3923[_0x84c2('0x30')][_0x84c2('0x35')]));_0x2813da['attributes']=_0x2813da['attributes'][_0x84c2('0x36')]?_0x2813da[_0x84c2('0x34')]:_0xf6f2d3[_0x84c2('0x33')];_0x2813da[_0x84c2('0x38')]=qs[_0x84c2('0x39')](_0x3c3923['query']['sort']);_0x2813da[_0x84c2('0x3a')]=qs[_0x84c2('0x32')](_[_0x84c2('0x4c')](_0x3c3923['query'],_0xf6f2d3['filters']));if(_0x3c3923[_0x84c2('0x30')][_0x84c2('0x3c')]){_0x2813da['where']=_[_0x84c2('0x46')](_0x2813da[_0x84c2('0x3a')],{'$or':_[_0x84c2('0x2b')](_0x2813da[_0x84c2('0x34')],function(_0x7289f5){var _0x1d39a4={};_0x1d39a4[_0x7289f5]={'$like':'%'+_0x3c3923[_0x84c2('0x30')]['filter']+'%'};return _0x1d39a4;})});}_0x2813da=_[_0x84c2('0x46')]({},_0x2813da,_0x3c3923[_0x84c2('0x3d')]);return _0x3b3bc8[_0x84c2('0x4e')](_0x2813da);}})[_0x84c2('0x25')](function(_0x7d7872){if(_0x7d7872){_0x54342c=_0x7d7872['length'];if(!_0x3c3923[_0x84c2('0x30')][_0x84c2('0x37')]('nolimit')){_0x2813da['limit']=qs['limit'](_0x3c3923[_0x84c2('0x30')][_0x84c2('0x1d')]);_0x2813da[_0x84c2('0x1f')]=qs[_0x84c2('0x1f')](_0x3c3923[_0x84c2('0x30')][_0x84c2('0x1f')]);}return _0x3b3bc8[_0x84c2('0x4e')](_0x2813da);}})[_0x84c2('0x25')](function(_0xe65f37){if(_0xe65f37){return _0xe65f37?{'count':_0x54342c,'rows':_0xe65f37}:null;}})[_0x84c2('0x25')](respondWithResult(_0xe56053,null))[_0x84c2('0x42')](handleError(_0xe56053,null));};exports[_0x84c2('0x50')]=function(_0x31eeab,_0x34d453,_0x12882c){var _0x4b282a={};var _0x27283d={};var _0x31fb46;var _0x5377c4;return db[_0x84c2('0x2c')]['findOne']({'where':{'id':_0x31eeab[_0x84c2('0x44')]['id']}})[_0x84c2('0x25')](handleEntityNotFound(_0x34d453,null))[_0x84c2('0x25')](function(_0x2e76d9){if(_0x2e76d9){_0x31fb46=_0x2e76d9;_0x27283d[_0x84c2('0x33')]=_['keys'](db['FreshsalesField'][_0x84c2('0x2d')]);_0x27283d[_0x84c2('0x30')]=_['keys'](_0x31eeab['query']);_0x27283d['filters']=_['intersection'](_0x27283d['model'],_0x27283d[_0x84c2('0x30')]);_0x4b282a[_0x84c2('0x34')]=_['intersection'](_0x27283d['model'],qs['fields'](_0x31eeab[_0x84c2('0x30')][_0x84c2('0x35')]));_0x4b282a[_0x84c2('0x34')]=_0x4b282a['attributes']['length']?_0x4b282a[_0x84c2('0x34')]:_0x27283d[_0x84c2('0x33')];_0x4b282a[_0x84c2('0x38')]=qs[_0x84c2('0x39')](_0x31eeab[_0x84c2('0x30')][_0x84c2('0x39')]);_0x4b282a[_0x84c2('0x3a')]=qs[_0x84c2('0x32')](_[_0x84c2('0x4c')](_0x31eeab[_0x84c2('0x30')],_0x27283d[_0x84c2('0x32')]));if(_0x31eeab['query'][_0x84c2('0x3c')]){_0x4b282a[_0x84c2('0x3a')]=_[_0x84c2('0x46')](_0x4b282a['where'],{'$or':_[_0x84c2('0x2b')](_0x4b282a['attributes'],function(_0x546b12){var _0x2fc12d={};_0x2fc12d[_0x546b12]={'$like':'%'+_0x31eeab['query'][_0x84c2('0x3c')]+'%'};return _0x2fc12d;})});}_0x4b282a=_[_0x84c2('0x46')]({},_0x4b282a,_0x31eeab[_0x84c2('0x3d')]);return _0x31fb46[_0x84c2('0x50')](_0x4b282a);}})[_0x84c2('0x25')](function(_0x57f623){if(_0x57f623){_0x5377c4=_0x57f623[_0x84c2('0x36')];if(!_0x31eeab[_0x84c2('0x30')][_0x84c2('0x37')]('nolimit')){_0x4b282a[_0x84c2('0x1d')]=qs[_0x84c2('0x1d')](_0x31eeab[_0x84c2('0x30')][_0x84c2('0x1d')]);_0x4b282a[_0x84c2('0x1f')]=qs[_0x84c2('0x1f')](_0x31eeab[_0x84c2('0x30')][_0x84c2('0x1f')]);}return _0x31fb46[_0x84c2('0x50')](_0x4b282a);}})[_0x84c2('0x25')](function(_0x1b97ce){if(_0x1b97ce){return _0x1b97ce?{'count':_0x5377c4,'rows':_0x1b97ce}:null;}})[_0x84c2('0x25')](respondWithResult(_0x34d453,null))[_0x84c2('0x42')](handleError(_0x34d453,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 9da62fa..89b1dc6 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 _0x52df=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0xdf3958,_0x4c702f){var _0x5e365c=function(_0x9ec942){while(--_0x9ec942){_0xdf3958['push'](_0xdf3958['shift']());}};_0x5e365c(++_0x4c702f);}(_0x52df,0x99));var _0xf52d=function(_0x3734ad,_0x2d4105){_0x3734ad=_0x3734ad-0x0;var _0x4acb9c=_0x52df[_0x3734ad];return _0x4acb9c;};'use strict';var _=require(_0xf52d('0x0'));var util=require(_0xf52d('0x1'));var logger=require(_0xf52d('0x2'))(_0xf52d('0x3'));var moment=require(_0xf52d('0x4'));var BPromise=require(_0xf52d('0x5'));var rp=require(_0xf52d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf52d('0x7'));var config=require(_0xf52d('0x8'));var attributes=require(_0xf52d('0x9'));module['exports']=function(_0x52a9a5,_0x498cd3){return _0x52a9a5['define'](_0xf52d('0xa'),attributes,{'tableName':_0xf52d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fac=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x3fac,0x168));var _0xc3fa=function(_0x5c9a5a,_0x4c8a5b){_0x5c9a5a=_0x5c9a5a-0x0;var _0x567c0e=_0x3fac[_0x5c9a5a];return _0x567c0e;};'use strict';var _=require(_0xc3fa('0x0'));var util=require(_0xc3fa('0x1'));var logger=require(_0xc3fa('0x2'))(_0xc3fa('0x3'));var moment=require(_0xc3fa('0x4'));var BPromise=require(_0xc3fa('0x5'));var rp=require(_0xc3fa('0x6'));var fs=require('fs');var path=require(_0xc3fa('0x7'));var rimraf=require(_0xc3fa('0x8'));var config=require(_0xc3fa('0x9'));var attributes=require(_0xc3fa('0xa'));module[_0xc3fa('0xb')]=function(_0x2cb148,_0x341ade){return _0x2cb148[_0xc3fa('0xc')](_0xc3fa('0xd'),attributes,{'tableName':_0xc3fa('0xe'),'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 94def8c..4e99520 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 _0x0575=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x22f327,_0x43035f){var _0x2c42f0=function(_0x21c8fc){while(--_0x21c8fc){_0x22f327['push'](_0x22f327['shift']());}};_0x2c42f0(++_0x43035f);}(_0x0575,0x125));var _0x5057=function(_0x201d02,_0x164c77){_0x201d02=_0x201d02-0x0;var _0x49e2d7=_0x0575[_0x201d02];return _0x49e2d7;};'use strict';var _=require(_0x5057('0x0'));var util=require(_0x5057('0x1'));var moment=require('moment');var BPromise=require(_0x5057('0x2'));var rs=require(_0x5057('0x3'));var fs=require('fs');var Redis=require(_0x5057('0x4'));var db=require(_0x5057('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5057('0x6'))(_0x5057('0x7'));var config=require(_0x5057('0x8'));var jayson=require(_0x5057('0x9'));var client=jayson['client'][_0x5057('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e129a,_0x99c709,_0x109ea9){return new BPromise(function(_0x83b4d3,_0x1af39f){return client[_0x5057('0xb')](_0x5e129a,_0x109ea9)['then'](function(_0x2b5d92){logger[_0x5057('0xc')](_0x5057('0xd'),_0x99c709,_0x5057('0xe'));logger[_0x5057('0xf')](_0x5057('0x10'),_0x99c709,_0x5057('0xe'),JSON[_0x5057('0x11')](_0x2b5d92));if(_0x2b5d92[_0x5057('0x12')]){if(_0x2b5d92[_0x5057('0x12')][_0x5057('0x13')]===0x1f4){logger[_0x5057('0x12')](_0x5057('0xd'),_0x99c709,_0x2b5d92[_0x5057('0x12')]['message']);return _0x1af39f(_0x2b5d92['error']['message']);}logger[_0x5057('0x12')](_0x5057('0xd'),_0x99c709,_0x2b5d92[_0x5057('0x12')][_0x5057('0x14')]);return _0x83b4d3(_0x2b5d92['error'][_0x5057('0x14')]);}else{logger[_0x5057('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x99c709,'request\x20sent');_0x83b4d3(_0x2b5d92[_0x5057('0x15')]['message']);}})['catch'](function(_0x51cea1){logger[_0x5057('0x12')](_0x5057('0xd'),_0x99c709,_0x51cea1);_0x1af39f(_0x51cea1);});});} \ No newline at end of file +var _0xefab=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0xefab,0x1b5));var _0xbefa=function(_0xc9c8ca,_0xbc7ae3){_0xc9c8ca=_0xc9c8ca-0x0;var _0x59fc76=_0xefab[_0xc9c8ca];return _0x59fc76;};'use strict';var _=require(_0xbefa('0x0'));var util=require(_0xbefa('0x1'));var moment=require(_0xbefa('0x2'));var BPromise=require(_0xbefa('0x3'));var rs=require(_0xbefa('0x4'));var fs=require('fs');var Redis=require(_0xbefa('0x5'));var db=require(_0xbefa('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbefa('0x7'))('rpc');var config=require(_0xbefa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbefa('0x9')][_0xbefa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bf7a3,_0x54c408,_0x502557){return new BPromise(function(_0x195247,_0x4581f1){return client['request'](_0x1bf7a3,_0x502557)[_0xbefa('0xb')](function(_0x6f66f9){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x54c408,_0xbefa('0xc'));logger[_0xbefa('0xd')](_0xbefa('0xe'),_0x54c408,'request\x20sent',JSON[_0xbefa('0xf')](_0x6f66f9));if(_0x6f66f9[_0xbefa('0x10')]){if(_0x6f66f9['error'][_0xbefa('0x11')]===0x1f4){logger[_0xbefa('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54c408,_0x6f66f9[_0xbefa('0x10')][_0xbefa('0x12')]);return _0x4581f1(_0x6f66f9[_0xbefa('0x10')][_0xbefa('0x12')]);}logger[_0xbefa('0x10')](_0xbefa('0x13'),_0x54c408,_0x6f66f9['error'][_0xbefa('0x12')]);return _0x195247(_0x6f66f9[_0xbefa('0x10')]['message']);}else{logger['info'](_0xbefa('0x13'),_0x54c408,_0xbefa('0xc'));_0x195247(_0x6f66f9[_0xbefa('0x14')][_0xbefa('0x12')]);}})[_0xbefa('0x15')](function(_0x3c1c64){logger['error'](_0xbefa('0x13'),_0x54c408,_0x3c1c64);_0x4581f1(_0x3c1c64);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 10206f4..994e48e 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 _0xf0cc=['fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x57e858,_0xcb95cd){var _0x30a837=function(_0x54d6cd){while(--_0x54d6cd){_0x57e858['push'](_0x57e858['shift']());}};_0x30a837(++_0xcb95cd);}(_0xf0cc,0xa7));var _0xcf0c=function(_0xd8506e,_0x3a4b75){_0xd8506e=_0xd8506e-0x0;var _0x28e5c8=_0xf0cc[_0xd8506e];return _0x28e5c8;};'use strict';var multer=require(_0xcf0c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcf0c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcf0c('0x2'));var auth=require(_0xcf0c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcf0c('0x4'));router[_0xcf0c('0x5')]('/',auth[_0xcf0c('0x6')](),controller['index']);router[_0xcf0c('0x5')](_0xcf0c('0x7'),auth[_0xcf0c('0x6')](),controller['show']);router['post']('/',auth[_0xcf0c('0x6')](),controller['create']);router[_0xcf0c('0x8')]('/:id',auth[_0xcf0c('0x6')](),controller[_0xcf0c('0x9')]);router[_0xcf0c('0xa')](_0xcf0c('0x7'),auth[_0xcf0c('0x6')](),controller[_0xcf0c('0xb')]);module[_0xcf0c('0xc')]=router; \ No newline at end of file +var _0xcb91=['get','index','isAuthenticated','show','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller'];(function(_0x337554,_0x418be3){var _0x23460e=function(_0x22a027){while(--_0x22a027){_0x337554['push'](_0x337554['shift']());}};_0x23460e(++_0x418be3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xcb91[_0x43f881];return _0x365c14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['post']('/',auth[_0x1cb9('0x9')](),controller['create']);router['put'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xc')]);router[_0x1cb9('0xd')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xe')]);module[_0x1cb9('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 3e96c50..9219568 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 _0x3d32=['sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x1c88e7,_0x154945){var _0x5afee3=function(_0x2a31f5){while(--_0x2a31f5){_0x1c88e7['push'](_0x1c88e7['shift']());}};_0x5afee3(++_0x154945);}(_0x3d32,0x75));var _0x23d3=function(_0xe3d30,_0x346dca){_0xe3d30=_0xe3d30-0x0;var _0xd2b70a=_0x3d32[_0xe3d30];return _0xd2b70a;};'use strict';var Sequelize=require(_0x23d3('0x0'));module[_0x23d3('0x1')]={'type':{'type':Sequelize[_0x23d3('0x2')]('string',_0x23d3('0x3'),_0x23d3('0x4'),_0x23d3('0x5'),_0x23d3('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x23d3('0x7')]},'key':{'type':Sequelize[_0x23d3('0x7')]},'keyType':{'type':Sequelize[_0x23d3('0x2')]('string',_0x23d3('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x23d3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x23d3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23d3('0x7')]}}; \ No newline at end of file +var _0xc37f=['string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xc37f,0x130));var _0xfc37=function(_0x232ef3,_0x58d1c1){_0x232ef3=_0x232ef3-0x0;var _0x1cb733=_0xc37f[_0x232ef3];return _0x1cb733;};'use strict';var Sequelize=require(_0xfc37('0x0'));module[_0xfc37('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfc37('0x2'),_0xfc37('0x3'),'customVariable','keyValue',_0xfc37('0x4')),'defaultValue':_0xfc37('0x2')},'content':{'type':Sequelize[_0xfc37('0x5')]},'key':{'type':Sequelize[_0xfc37('0x5')]},'keyType':{'type':Sequelize[_0xfc37('0x6')](_0xfc37('0x2'),'variable',_0xfc37('0x7'))},'keyContent':{'type':Sequelize[_0xfc37('0x5')]},'idField':{'type':Sequelize[_0xfc37('0x5')]},'nameField':{'type':Sequelize[_0xfc37('0x5')]},'customField':{'type':Sequelize[_0xfc37('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index b43033f..2efa67c 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 _0x5e58=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FreshsalesField','includeAll','include','findAll','catch','show','params','length','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x6f41f7,_0x1806aa){var _0x4e1fb0=function(_0x2e6700){while(--_0x2e6700){_0x6f41f7['push'](_0x6f41f7['shift']());}};_0x4e1fb0(++_0x1806aa);}(_0x5e58,0xcd));var _0x85e5=function(_0x28770f,_0x5cff78){_0x28770f=_0x28770f-0x0;var _0x51bfe2=_0x5e58[_0x28770f];return _0x51bfe2;};'use strict';var emlformat=require(_0x85e5('0x0'));var rimraf=require(_0x85e5('0x1'));var zipdir=require(_0x85e5('0x2'));var jsonpatch=require(_0x85e5('0x3'));var rp=require(_0x85e5('0x4'));var moment=require(_0x85e5('0x5'));var BPromise=require(_0x85e5('0x6'));var Mustache=require('mustache');var util=require(_0x85e5('0x7'));var path=require('path');var sox=require(_0x85e5('0x8'));var csv=require(_0x85e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85e5('0xa'));var _=require(_0x85e5('0xb'));var squel=require(_0x85e5('0xc'));var crypto=require(_0x85e5('0xd'));var jsforce=require(_0x85e5('0xe'));var deskjs=require(_0x85e5('0xf'));var toCsv=require(_0x85e5('0x9'));var querystring=require('querystring');var Papa=require(_0x85e5('0x10'));var Redis=require(_0x85e5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x85e5('0x12'));var as=require(_0x85e5('0x13'));var hardwareService=require(_0x85e5('0x14'));var logger=require(_0x85e5('0x15'))(_0x85e5('0x16'));var utils=require(_0x85e5('0x17'));var config=require(_0x85e5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x85e5('0x19'))['db'];function respondWithStatusCode(_0x529b42,_0x2f1e81){_0x2f1e81=_0x2f1e81||0xcc;return function(_0x4c019d){if(_0x4c019d){return _0x529b42[_0x85e5('0x1a')](_0x2f1e81);}return _0x529b42[_0x85e5('0x1b')](_0x2f1e81)[_0x85e5('0x1c')]();};}function respondWithResult(_0xb083b9,_0x1a1d81){_0x1a1d81=_0x1a1d81||0xc8;return function(_0x4a2bb1){if(_0x4a2bb1){return _0xb083b9[_0x85e5('0x1b')](_0x1a1d81)[_0x85e5('0x1d')](_0x4a2bb1);}};}function respondWithFilteredResult(_0x3541ca,_0x1aef93){return function(_0x533b99){if(_0x533b99){var _0x17eacc=typeof _0x1aef93[_0x85e5('0x1e')]===_0x85e5('0x1f')&&typeof _0x1aef93[_0x85e5('0x20')]===_0x85e5('0x1f');var _0x90c5=_0x533b99['count'];var _0x3b1391=_0x17eacc?0x0:_0x1aef93['offset'];var _0x239587=_0x17eacc?_0x533b99[_0x85e5('0x21')]:_0x1aef93['offset']+_0x1aef93[_0x85e5('0x20')];var _0x3a8df9;if(_0x239587>=_0x90c5){_0x239587=_0x90c5;_0x3a8df9=0xc8;}else{_0x3a8df9=0xce;}_0x3541ca['status'](_0x3a8df9);return _0x3541ca[_0x85e5('0x22')](_0x85e5('0x23'),_0x3b1391+'-'+_0x239587+'/'+_0x90c5)[_0x85e5('0x1d')](_0x533b99);}return null;};}function patchUpdates(_0x4c8a64){return function(_0x44b1ef){try{jsonpatch['apply'](_0x44b1ef,_0x4c8a64,!![]);}catch(_0x17ba67){return BPromise[_0x85e5('0x24')](_0x17ba67);}return _0x44b1ef['save']();};}function saveUpdates(_0x357d86,_0x3d8501){return function(_0x103014){if(_0x103014){return _0x103014['update'](_0x357d86)[_0x85e5('0x25')](function(_0x347033){return _0x347033;});}return null;};}function removeEntity(_0x38e9d0,_0x557dc2){return function(_0x1a219f){if(_0x1a219f){return _0x1a219f['destroy']()[_0x85e5('0x25')](function(){_0x38e9d0[_0x85e5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x71cd9c,_0x53a287){return function(_0x57e0d8){if(!_0x57e0d8){_0x71cd9c[_0x85e5('0x1a')](0x194);}return _0x57e0d8;};}function handleError(_0x5a8df5,_0x201081){_0x201081=_0x201081||0x1f4;return function(_0x508a76){logger['error'](_0x508a76[_0x85e5('0x26')]);if(_0x508a76['name']){delete _0x508a76[_0x85e5('0x27')];}_0x5a8df5[_0x85e5('0x1b')](_0x201081)[_0x85e5('0x28')](_0x508a76);};}exports[_0x85e5('0x29')]=function(_0x40a111,_0x9d6d0b){var _0x70d8f3={},_0x367616={},_0x118959={'count':0x0,'rows':[]};var _0x2cffb2=_[_0x85e5('0x2a')](db['FreshsalesField'][_0x85e5('0x2b')],function(_0x367a44){return{'name':_0x367a44[_0x85e5('0x2c')],'type':_0x367a44[_0x85e5('0x2d')][_0x85e5('0x2e')]};});_0x367616['model']=_[_0x85e5('0x2a')](_0x2cffb2,'name');_0x367616[_0x85e5('0x2f')]=_[_0x85e5('0x30')](_0x40a111[_0x85e5('0x2f')]);_0x367616[_0x85e5('0x31')]=_[_0x85e5('0x32')](_0x367616[_0x85e5('0x33')],_0x367616[_0x85e5('0x2f')]);_0x70d8f3[_0x85e5('0x34')]=_[_0x85e5('0x32')](_0x367616[_0x85e5('0x33')],qs[_0x85e5('0x35')](_0x40a111[_0x85e5('0x2f')]['fields']));_0x70d8f3['attributes']=_0x70d8f3[_0x85e5('0x34')]['length']?_0x70d8f3[_0x85e5('0x34')]:_0x367616['model'];if(!_0x40a111[_0x85e5('0x2f')]['hasOwnProperty'](_0x85e5('0x36'))){_0x70d8f3[_0x85e5('0x20')]=qs[_0x85e5('0x20')](_0x40a111[_0x85e5('0x2f')][_0x85e5('0x20')]);_0x70d8f3[_0x85e5('0x1e')]=qs[_0x85e5('0x1e')](_0x40a111[_0x85e5('0x2f')][_0x85e5('0x1e')]);}_0x70d8f3['order']=qs[_0x85e5('0x37')](_0x40a111[_0x85e5('0x2f')]['sort']);_0x70d8f3[_0x85e5('0x38')]=qs[_0x85e5('0x31')](_[_0x85e5('0x39')](_0x40a111[_0x85e5('0x2f')],_0x367616[_0x85e5('0x31')]),_0x2cffb2);if(_0x40a111['query'][_0x85e5('0x3a')]){_0x70d8f3[_0x85e5('0x38')]=_['merge'](_0x70d8f3['where'],{'$or':_[_0x85e5('0x2a')](_0x2cffb2,function(_0xe31a77){if(_0xe31a77[_0x85e5('0x2d')]!==_0x85e5('0x3b')){var _0x4920f3={};_0x4920f3[_0xe31a77[_0x85e5('0x27')]]={'$like':'%'+_0x40a111['query'][_0x85e5('0x3a')]+'%'};return _0x4920f3;}})});}_0x70d8f3=_[_0x85e5('0x3c')]({},_0x70d8f3,_0x40a111[_0x85e5('0x3d')]);var _0x4f2e98={'where':_0x70d8f3[_0x85e5('0x38')]};return db[_0x85e5('0x3e')]['count'](_0x4f2e98)[_0x85e5('0x25')](function(_0x3ea4bb){_0x118959[_0x85e5('0x21')]=_0x3ea4bb;if(_0x40a111['query'][_0x85e5('0x3f')]){_0x70d8f3[_0x85e5('0x40')]=[{'all':!![]}];}return db[_0x85e5('0x3e')][_0x85e5('0x41')](_0x70d8f3);})[_0x85e5('0x25')](function(_0x114486){_0x118959['rows']=_0x114486;return _0x118959;})[_0x85e5('0x25')](respondWithFilteredResult(_0x9d6d0b,_0x70d8f3))[_0x85e5('0x42')](handleError(_0x9d6d0b,null));};exports[_0x85e5('0x43')]=function(_0x524989,_0x42ad71){var _0x523e27={'raw':!![],'where':{'id':_0x524989[_0x85e5('0x44')]['id']}},_0x1288cf={};_0x1288cf[_0x85e5('0x33')]=_[_0x85e5('0x30')](db[_0x85e5('0x3e')]['rawAttributes']);_0x1288cf[_0x85e5('0x2f')]=_['keys'](_0x524989['query']);_0x1288cf[_0x85e5('0x31')]=_[_0x85e5('0x32')](_0x1288cf['model'],_0x1288cf[_0x85e5('0x2f')]);_0x523e27[_0x85e5('0x34')]=_[_0x85e5('0x32')](_0x1288cf[_0x85e5('0x33')],qs[_0x85e5('0x35')](_0x524989[_0x85e5('0x2f')][_0x85e5('0x35')]));_0x523e27[_0x85e5('0x34')]=_0x523e27['attributes'][_0x85e5('0x45')]?_0x523e27[_0x85e5('0x34')]:_0x1288cf[_0x85e5('0x33')];if(_0x524989['query'][_0x85e5('0x3f')]){_0x523e27[_0x85e5('0x40')]=[{'all':!![]}];}_0x523e27=_['merge']({},_0x523e27,_0x524989[_0x85e5('0x3d')]);return db[_0x85e5('0x3e')]['find'](_0x523e27)[_0x85e5('0x25')](handleEntityNotFound(_0x42ad71,null))['then'](respondWithResult(_0x42ad71,null))[_0x85e5('0x42')](handleError(_0x42ad71,null));};exports['create']=function(_0x2119b9,_0x24aa67){return db[_0x85e5('0x3e')][_0x85e5('0x46')](_0x2119b9[_0x85e5('0x47')],{})[_0x85e5('0x25')](respondWithResult(_0x24aa67,0xc9))[_0x85e5('0x42')](handleError(_0x24aa67,null));};exports[_0x85e5('0x48')]=function(_0x46c66b,_0x516760){if(_0x46c66b[_0x85e5('0x47')]['id']){delete _0x46c66b[_0x85e5('0x47')]['id'];}return db[_0x85e5('0x3e')][_0x85e5('0x49')]({'where':{'id':_0x46c66b[_0x85e5('0x44')]['id']}})[_0x85e5('0x25')](handleEntityNotFound(_0x516760,null))['then'](saveUpdates(_0x46c66b[_0x85e5('0x47')],null))[_0x85e5('0x25')](respondWithResult(_0x516760,null))[_0x85e5('0x42')](handleError(_0x516760,null));};exports[_0x85e5('0x4a')]=function(_0x291717,_0x395691){return db[_0x85e5('0x3e')]['find']({'where':{'id':_0x291717[_0x85e5('0x44')]['id']}})[_0x85e5('0x25')](handleEntityNotFound(_0x395691,null))[_0x85e5('0x25')](removeEntity(_0x395691,null))[_0x85e5('0x42')](handleError(_0x395691,null));}; \ No newline at end of file +var _0x439e=['filter','VIRTUAL','options','FreshsalesField','include','findAll','rows','catch','show','params','includeAll','merge','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','count','limit','set','apply','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x439e,0xa0));var _0xe439=function(_0x1ed2e2,_0x1adca1){_0x1ed2e2=_0x1ed2e2-0x0;var _0x446b98=_0x439e[_0x1ed2e2];return _0x446b98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe439('0x0'));var zipdir=require(_0xe439('0x1'));var jsonpatch=require(_0xe439('0x2'));var rp=require(_0xe439('0x3'));var moment=require('moment');var BPromise=require(_0xe439('0x4'));var Mustache=require(_0xe439('0x5'));var util=require(_0xe439('0x6'));var path=require(_0xe439('0x7'));var sox=require(_0xe439('0x8'));var csv=require(_0xe439('0x9'));var ejs=require(_0xe439('0xa'));var fs=require('fs');var fs_extra=require(_0xe439('0xb'));var _=require(_0xe439('0xc'));var squel=require(_0xe439('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe439('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe439('0xf'));var Papa=require(_0xe439('0x10'));var Redis=require('ioredis');var authService=require(_0xe439('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe439('0x12'));var logger=require(_0xe439('0x13'))('api');var utils=require(_0xe439('0x14'));var config=require(_0xe439('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe439('0x16'))['db'];function respondWithStatusCode(_0x114c24,_0x78c12){_0x78c12=_0x78c12||0xcc;return function(_0x2ee2aa){if(_0x2ee2aa){return _0x114c24[_0xe439('0x17')](_0x78c12);}return _0x114c24[_0xe439('0x18')](_0x78c12)[_0xe439('0x19')]();};}function respondWithResult(_0x1d32f1,_0x4d7746){_0x4d7746=_0x4d7746||0xc8;return function(_0x4fac50){if(_0x4fac50){return _0x1d32f1['status'](_0x4d7746)['json'](_0x4fac50);}};}function respondWithFilteredResult(_0x23a8d9,_0x141b7e){return function(_0x2f18cb){if(_0x2f18cb){var _0x496c83=typeof _0x141b7e[_0xe439('0x1a')]==='undefined'&&typeof _0x141b7e['limit']==='undefined';var _0x51ee59=_0x2f18cb['count'];var _0x205edf=_0x496c83?0x0:_0x141b7e[_0xe439('0x1a')];var _0x53e3ba=_0x496c83?_0x2f18cb[_0xe439('0x1b')]:_0x141b7e[_0xe439('0x1a')]+_0x141b7e[_0xe439('0x1c')];var _0x5302b1;if(_0x53e3ba>=_0x51ee59){_0x53e3ba=_0x51ee59;_0x5302b1=0xc8;}else{_0x5302b1=0xce;}_0x23a8d9[_0xe439('0x18')](_0x5302b1);return _0x23a8d9[_0xe439('0x1d')]('Content-Range',_0x205edf+'-'+_0x53e3ba+'/'+_0x51ee59)['json'](_0x2f18cb);}return null;};}function patchUpdates(_0x3bbea8){return function(_0x2e1dec){try{jsonpatch[_0xe439('0x1e')](_0x2e1dec,_0x3bbea8,!![]);}catch(_0x1f753b){return BPromise[_0xe439('0x1f')](_0x1f753b);}return _0x2e1dec['save']();};}function saveUpdates(_0xa9ba13,_0x4a0801){return function(_0x2a74d7){if(_0x2a74d7){return _0x2a74d7[_0xe439('0x20')](_0xa9ba13)['then'](function(_0x1c0cd7){return _0x1c0cd7;});}return null;};}function removeEntity(_0x4c5e6b,_0x1338e0){return function(_0x47a3e9){if(_0x47a3e9){return _0x47a3e9['destroy']()[_0xe439('0x21')](function(){_0x4c5e6b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a4f6f,_0x45f439){return function(_0x457741){if(!_0x457741){_0x3a4f6f[_0xe439('0x17')](0x194);}return _0x457741;};}function handleError(_0x2e2015,_0x3c1ca0){_0x3c1ca0=_0x3c1ca0||0x1f4;return function(_0x5376f3){logger[_0xe439('0x22')](_0x5376f3[_0xe439('0x23')]);if(_0x5376f3[_0xe439('0x24')]){delete _0x5376f3['name'];}_0x2e2015['status'](_0x3c1ca0)[_0xe439('0x25')](_0x5376f3);};}exports['index']=function(_0x45f3cc,_0x420849){var _0x352374={},_0x543bac={},_0x297b43={'count':0x0,'rows':[]};var _0x5f4690=_[_0xe439('0x26')](db['FreshsalesField'][_0xe439('0x27')],function(_0x40fbfd){return{'name':_0x40fbfd[_0xe439('0x28')],'type':_0x40fbfd[_0xe439('0x29')]['key']};});_0x543bac[_0xe439('0x2a')]=_[_0xe439('0x26')](_0x5f4690,_0xe439('0x24'));_0x543bac['query']=_[_0xe439('0x2b')](_0x45f3cc[_0xe439('0x2c')]);_0x543bac[_0xe439('0x2d')]=_[_0xe439('0x2e')](_0x543bac[_0xe439('0x2a')],_0x543bac[_0xe439('0x2c')]);_0x352374[_0xe439('0x2f')]=_[_0xe439('0x2e')](_0x543bac[_0xe439('0x2a')],qs[_0xe439('0x30')](_0x45f3cc[_0xe439('0x2c')]['fields']));_0x352374[_0xe439('0x2f')]=_0x352374[_0xe439('0x2f')][_0xe439('0x31')]?_0x352374[_0xe439('0x2f')]:_0x543bac['model'];if(!_0x45f3cc[_0xe439('0x2c')][_0xe439('0x32')](_0xe439('0x33'))){_0x352374[_0xe439('0x1c')]=qs[_0xe439('0x1c')](_0x45f3cc[_0xe439('0x2c')][_0xe439('0x1c')]);_0x352374[_0xe439('0x1a')]=qs[_0xe439('0x1a')](_0x45f3cc[_0xe439('0x2c')][_0xe439('0x1a')]);}_0x352374[_0xe439('0x34')]=qs['sort'](_0x45f3cc[_0xe439('0x2c')][_0xe439('0x35')]);_0x352374[_0xe439('0x36')]=qs[_0xe439('0x2d')](_[_0xe439('0x37')](_0x45f3cc[_0xe439('0x2c')],_0x543bac[_0xe439('0x2d')]),_0x5f4690);if(_0x45f3cc[_0xe439('0x2c')][_0xe439('0x38')]){_0x352374[_0xe439('0x36')]=_['merge'](_0x352374[_0xe439('0x36')],{'$or':_[_0xe439('0x26')](_0x5f4690,function(_0x1d1e16){if(_0x1d1e16[_0xe439('0x29')]!==_0xe439('0x39')){var _0xbc1bf2={};_0xbc1bf2[_0x1d1e16[_0xe439('0x24')]]={'$like':'%'+_0x45f3cc[_0xe439('0x2c')][_0xe439('0x38')]+'%'};return _0xbc1bf2;}})});}_0x352374=_['merge']({},_0x352374,_0x45f3cc[_0xe439('0x3a')]);var _0x4eca69={'where':_0x352374[_0xe439('0x36')]};return db[_0xe439('0x3b')][_0xe439('0x1b')](_0x4eca69)[_0xe439('0x21')](function(_0x1ba6bb){_0x297b43[_0xe439('0x1b')]=_0x1ba6bb;if(_0x45f3cc[_0xe439('0x2c')]['includeAll']){_0x352374[_0xe439('0x3c')]=[{'all':!![]}];}return db[_0xe439('0x3b')][_0xe439('0x3d')](_0x352374);})[_0xe439('0x21')](function(_0x5edba4){_0x297b43[_0xe439('0x3e')]=_0x5edba4;return _0x297b43;})[_0xe439('0x21')](respondWithFilteredResult(_0x420849,_0x352374))[_0xe439('0x3f')](handleError(_0x420849,null));};exports[_0xe439('0x40')]=function(_0x32586e,_0x2a32ec){var _0x1f65b3={'raw':!![],'where':{'id':_0x32586e[_0xe439('0x41')]['id']}},_0x57d9f2={};_0x57d9f2[_0xe439('0x2a')]=_[_0xe439('0x2b')](db[_0xe439('0x3b')]['rawAttributes']);_0x57d9f2[_0xe439('0x2c')]=_['keys'](_0x32586e[_0xe439('0x2c')]);_0x57d9f2[_0xe439('0x2d')]=_['intersection'](_0x57d9f2['model'],_0x57d9f2[_0xe439('0x2c')]);_0x1f65b3[_0xe439('0x2f')]=_[_0xe439('0x2e')](_0x57d9f2[_0xe439('0x2a')],qs['fields'](_0x32586e['query'][_0xe439('0x30')]));_0x1f65b3['attributes']=_0x1f65b3[_0xe439('0x2f')][_0xe439('0x31')]?_0x1f65b3['attributes']:_0x57d9f2['model'];if(_0x32586e[_0xe439('0x2c')][_0xe439('0x42')]){_0x1f65b3['include']=[{'all':!![]}];}_0x1f65b3=_[_0xe439('0x43')]({},_0x1f65b3,_0x32586e[_0xe439('0x3a')]);return db[_0xe439('0x3b')]['find'](_0x1f65b3)[_0xe439('0x21')](handleEntityNotFound(_0x2a32ec,null))['then'](respondWithResult(_0x2a32ec,null))[_0xe439('0x3f')](handleError(_0x2a32ec,null));};exports[_0xe439('0x44')]=function(_0x75cd2a,_0x2f04b0){return db[_0xe439('0x3b')]['create'](_0x75cd2a[_0xe439('0x45')],{})['then'](respondWithResult(_0x2f04b0,0xc9))[_0xe439('0x3f')](handleError(_0x2f04b0,null));};exports[_0xe439('0x20')]=function(_0x183939,_0x47d578){if(_0x183939[_0xe439('0x45')]['id']){delete _0x183939['body']['id'];}return db[_0xe439('0x3b')][_0xe439('0x46')]({'where':{'id':_0x183939[_0xe439('0x41')]['id']}})['then'](handleEntityNotFound(_0x47d578,null))[_0xe439('0x21')](saveUpdates(_0x183939[_0xe439('0x45')],null))['then'](respondWithResult(_0x47d578,null))[_0xe439('0x3f')](handleError(_0x47d578,null));};exports[_0xe439('0x47')]=function(_0x13f43a,_0x512627){return db[_0xe439('0x3b')][_0xe439('0x46')]({'where':{'id':_0x13f43a['params']['id']}})[_0xe439('0x21')](handleEntityNotFound(_0x512627,null))[_0xe439('0x21')](removeEntity(_0x512627,null))[_0xe439('0x3f')](handleError(_0x512627,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 95fd966..035fc15 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 _0x0ac0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util'];(function(_0x47f36a,_0x5612b7){var _0x120eb8=function(_0x4e2e3f){while(--_0x4e2e3f){_0x47f36a['push'](_0x47f36a['shift']());}};_0x120eb8(++_0x5612b7);}(_0x0ac0,0x130));var _0x00ac=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x0ac0[_0x3ba422];return _0x20b5dd;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var logger=require(_0x00ac('0x2'))('api');var moment=require(_0x00ac('0x3'));var BPromise=require(_0x00ac('0x4'));var rp=require(_0x00ac('0x5'));var fs=require('fs');var path=require(_0x00ac('0x6'));var rimraf=require(_0x00ac('0x7'));var config=require(_0x00ac('0x8'));var attributes=require(_0x00ac('0x9'));module[_0x00ac('0xa')]=function(_0x4caaa8,_0x464817){return _0x4caaa8[_0x00ac('0xb')](_0x00ac('0xc'),attributes,{'tableName':_0x00ac('0xd'),'paranoid':![],'indexes':[{'name':_0x00ac('0xe'),'fields':[_0x00ac('0xf'),_0x00ac('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe77c=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','moment'];(function(_0x2441a3,_0xf3c5aa){var _0x443847=function(_0x3515a8){while(--_0x3515a8){_0x2441a3['push'](_0x2441a3['shift']());}};_0x443847(++_0xf3c5aa);}(_0xe77c,0x176));var _0xce77=function(_0x67b075,_0x43557d){_0x67b075=_0x67b075-0x0;var _0x39d030=_0xe77c[_0x67b075];return _0x39d030;};'use strict';var _=require(_0xce77('0x0'));var util=require(_0xce77('0x1'));var logger=require(_0xce77('0x2'))('api');var moment=require(_0xce77('0x3'));var BPromise=require(_0xce77('0x4'));var rp=require(_0xce77('0x5'));var fs=require('fs');var path=require(_0xce77('0x6'));var rimraf=require(_0xce77('0x7'));var config=require(_0xce77('0x8'));var attributes=require(_0xce77('0x9'));module['exports']=function(_0x5aea39,_0xed47c5){return _0x5aea39['define'](_0xce77('0xa'),attributes,{'tableName':_0xce77('0xb'),'paranoid':![],'indexes':[{'name':_0xce77('0xc'),'fields':['idField',_0xce77('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 ed8f5e5..dee0bad 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 _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x561975,_0x1d64fc){var _0x15b7f5=function(_0x43bfc1){while(--_0x43bfc1){_0x561975['push'](_0x561975['shift']());}};_0x15b7f5(++_0x1d64fc);}(_0x7c09,0x102));var _0x97c0=function(_0x55bb90,_0x51e305){_0x55bb90=_0x55bb90-0x0;var _0x595f13=_0x7c09[_0x55bb90];return _0x595f13;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});} \ No newline at end of file +var _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x468f31,_0x5a6cef){var _0x4b0a42=function(_0x18b651){while(--_0x18b651){_0x468f31['push'](_0x468f31['shift']());}};_0x4b0a42(++_0x5a6cef);}(_0x2bd8,0x130));var _0x82bd=function(_0xa248ac,_0x48272a){_0xa248ac=_0xa248ac-0x0;var _0x1ede04=_0x2bd8[_0xa248ac];return _0x1ede04;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 471f908..7a1882f 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(_0x284cb4,_0x5713d2){var _0xc3724c=function(_0x39c403){while(--_0x39c403){_0x284cb4['push'](_0x284cb4['shift']());}};_0xc3724c(++_0x5713d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0xae9e19,_0x4052ad){var _0x56e48b=function(_0x480352){while(--_0x480352){_0xae9e19['push'](_0xae9e19['shift']());}};_0x56e48b(++_0x4052ad);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index b9239ce..d12b75f 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 _0x7f59=['newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x4ad3be,_0x1ec00d){var _0x1efe95=function(_0x361d46){while(--_0x361d46){_0x4ad3be['push'](_0x4ad3be['shift']());}};_0x1efe95(++_0x1ec00d);}(_0x7f59,0x12e));var _0x97f5=function(_0x517677,_0x5949ab){_0x517677=_0x517677-0x0;var _0x43746d=_0x7f59[_0x517677];return _0x43746d;};'use strict';var Sequelize=require(_0x97f5('0x0'));module[_0x97f5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x97f5('0x2')]},'username':{'type':Sequelize[_0x97f5('0x2')],'unique':_0x97f5('0x3')},'remoteUri':{'type':Sequelize[_0x97f5('0x2')]},'password':{'type':Sequelize[_0x97f5('0x2')]},'clientId':{'type':Sequelize[_0x97f5('0x2')]},'clientSecret':{'type':Sequelize[_0x97f5('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x97f5('0x4')),'defaultValue':_0x97f5('0x5')}}; \ No newline at end of file +var _0x39d7=['newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x163052,_0x143517){var _0x1a6661=function(_0x4d072b){while(--_0x4d072b){_0x163052['push'](_0x163052['shift']());}};_0x1a6661(++_0x143517);}(_0x39d7,0x12d));var _0x739d=function(_0x886693,_0x541621){_0x886693=_0x886693-0x0;var _0x8d7e2f=_0x39d7[_0x886693];return _0x8d7e2f;};'use strict';var Sequelize=require(_0x739d('0x0'));module[_0x739d('0x1')]={'name':{'type':Sequelize[_0x739d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x739d('0x2')],'unique':_0x739d('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x739d('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x739d('0x2')]},'serverUrl':{'type':Sequelize[_0x739d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x739d('0x4')]('integrationTab',_0x739d('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index fa46cd1..2212e4f 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 _0x8939=['login','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','boolean','textarea','phone','remove','includes','label','custom','picklistValues','value','True','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','params','keys','length','find','create','body','catch','update','getConfigurations','findOne','pick','options','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientId'];(function(_0x4821df,_0x50df79){var _0x4b05da=function(_0x59e886){while(--_0x59e886){_0x4821df['push'](_0x4821df['shift']());}};_0x4b05da(++_0x50df79);}(_0x8939,0x116));var _0x9893=function(_0x1690d6,_0x25e4fb){_0x1690d6=_0x1690d6-0x0;var _0xe9bab4=_0x8939[_0x1690d6];return _0xe9bab4;};'use strict';var emlformat=require(_0x9893('0x0'));var rimraf=require(_0x9893('0x1'));var zipdir=require(_0x9893('0x2'));var jsonpatch=require(_0x9893('0x3'));var rp=require(_0x9893('0x4'));var moment=require(_0x9893('0x5'));var BPromise=require(_0x9893('0x6'));var Mustache=require('mustache');var util=require(_0x9893('0x7'));var path=require(_0x9893('0x8'));var sox=require(_0x9893('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9893('0xa'));var _=require(_0x9893('0xb'));var squel=require(_0x9893('0xc'));var crypto=require(_0x9893('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9893('0xe'));var querystring=require(_0x9893('0xf'));var Papa=require(_0x9893('0x10'));var Redis=require(_0x9893('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9893('0x12'));var as=require(_0x9893('0x13'));var hardwareService=require(_0x9893('0x14'));var logger=require('../../config/logger')(_0x9893('0x15'));var utils=require(_0x9893('0x16'));var config=require(_0x9893('0x17'));var licenseUtil=require(_0x9893('0x18'));var db=require(_0x9893('0x19'))['db'];var integrations=require(_0x9893('0x1a'));function respondWithStatusCode(_0x4df5ba,_0x2f4c6b){_0x2f4c6b=_0x2f4c6b||0xcc;return function(_0x143142){if(_0x143142){return _0x4df5ba['sendStatus'](_0x2f4c6b);}return _0x4df5ba[_0x9893('0x1b')](_0x2f4c6b)[_0x9893('0x1c')]();};}function respondWithResult(_0x37ac1b,_0x3e67b2){_0x3e67b2=_0x3e67b2||0xc8;return function(_0x171c46){if(_0x171c46){return _0x37ac1b[_0x9893('0x1b')](_0x3e67b2)[_0x9893('0x1d')](_0x171c46);}};}function respondWithFilteredResult(_0x1bed44,_0x2477bd){return function(_0x4bec2f){if(_0x4bec2f){var _0x42a353=typeof _0x2477bd['offset']==='undefined'&&typeof _0x2477bd[_0x9893('0x1e')]===_0x9893('0x1f');var _0x1d29d2=_0x4bec2f[_0x9893('0x20')];var _0x5255c9=_0x42a353?0x0:_0x2477bd[_0x9893('0x21')];var _0x4bfb67=_0x42a353?_0x4bec2f['count']:_0x2477bd[_0x9893('0x21')]+_0x2477bd[_0x9893('0x1e')];var _0x349bde;if(_0x4bfb67>=_0x1d29d2){_0x4bfb67=_0x1d29d2;_0x349bde=0xc8;}else{_0x349bde=0xce;}_0x1bed44[_0x9893('0x1b')](_0x349bde);return _0x1bed44['set'](_0x9893('0x22'),_0x5255c9+'-'+_0x4bfb67+'/'+_0x1d29d2)[_0x9893('0x1d')](_0x4bec2f);}return null;};}function patchUpdates(_0x935b58){return function(_0x2e2edb){try{jsonpatch[_0x9893('0x23')](_0x2e2edb,_0x935b58,!![]);}catch(_0xf894cc){return BPromise['reject'](_0xf894cc);}return _0x2e2edb[_0x9893('0x24')]();};}function saveUpdates(_0x42a057,_0x38f5be){return function(_0x1cfb23){if(_0x1cfb23){return _0x1cfb23['update'](_0x42a057)[_0x9893('0x25')](function(_0x21e7a8){return _0x21e7a8;});}return null;};}function removeEntity(_0x4ff813,_0x43f9b1){return function(_0x590283){if(_0x590283){return _0x590283[_0x9893('0x26')]()[_0x9893('0x25')](function(){_0x4ff813['status'](0xcc)[_0x9893('0x1c')]();});}};}function handleEntityNotFound(_0x5a3861,_0x42ea65){return function(_0x3a9c83){if(!_0x3a9c83){_0x5a3861[_0x9893('0x27')](0x194);}return _0x3a9c83;};}function handleError(_0xe504b3,_0x168049){_0x168049=_0x168049||0x1f4;return function(_0x41f200){logger[_0x9893('0x28')](_0x41f200[_0x9893('0x29')]);if(_0x41f200[_0x9893('0x2a')]){delete _0x41f200[_0x9893('0x2a')];}_0xe504b3[_0x9893('0x1b')](_0x168049)[_0x9893('0x2b')](_0x41f200);};}exports[_0x9893('0x2c')]=function(_0x2c2767,_0x12f4ae){var _0x293a0a={},_0x10d4c8={},_0x3c97ef={'count':0x0,'rows':[]};var _0x3125ab=_[_0x9893('0x2d')](db[_0x9893('0x2e')][_0x9893('0x2f')],function(_0x3dd433){return{'name':_0x3dd433['fieldName'],'type':_0x3dd433[_0x9893('0x30')][_0x9893('0x31')]};});_0x10d4c8[_0x9893('0x32')]=_[_0x9893('0x2d')](_0x3125ab,'name');_0x10d4c8[_0x9893('0x33')]=_['keys'](_0x2c2767['query']);_0x10d4c8[_0x9893('0x34')]=_[_0x9893('0x35')](_0x10d4c8[_0x9893('0x32')],_0x10d4c8[_0x9893('0x33')]);_0x293a0a[_0x9893('0x36')]=_[_0x9893('0x35')](_0x10d4c8['model'],qs[_0x9893('0x37')](_0x2c2767[_0x9893('0x33')][_0x9893('0x37')]));_0x293a0a[_0x9893('0x36')]=_0x293a0a[_0x9893('0x36')]['length']?_0x293a0a['attributes']:_0x10d4c8[_0x9893('0x32')];if(!_0x2c2767[_0x9893('0x33')][_0x9893('0x38')](_0x9893('0x39'))){_0x293a0a[_0x9893('0x1e')]=qs[_0x9893('0x1e')](_0x2c2767[_0x9893('0x33')][_0x9893('0x1e')]);_0x293a0a['offset']=qs[_0x9893('0x21')](_0x2c2767['query'][_0x9893('0x21')]);}_0x293a0a[_0x9893('0x3a')]=qs[_0x9893('0x3b')](_0x2c2767['query'][_0x9893('0x3b')]);_0x293a0a['where']=qs[_0x9893('0x34')](_['pick'](_0x2c2767[_0x9893('0x33')],_0x10d4c8[_0x9893('0x34')]),_0x3125ab);if(_0x2c2767['query']['filter']){_0x293a0a[_0x9893('0x3c')]=_[_0x9893('0x3d')](_0x293a0a[_0x9893('0x3c')],{'$or':_[_0x9893('0x2d')](_0x3125ab,function(_0x1e7357){if(_0x1e7357['type']!==_0x9893('0x3e')){var _0x3f1c5e={};_0x3f1c5e[_0x1e7357[_0x9893('0x2a')]]={'$like':'%'+_0x2c2767['query'][_0x9893('0x3f')]+'%'};return _0x3f1c5e;}})});}_0x293a0a=_[_0x9893('0x3d')]({},_0x293a0a,_0x2c2767['options']);var _0x489fb6={'where':_0x293a0a[_0x9893('0x3c')]};return db[_0x9893('0x2e')]['count'](_0x489fb6)[_0x9893('0x25')](function(_0x1cfa09){_0x3c97ef[_0x9893('0x20')]=_0x1cfa09;if(_0x2c2767[_0x9893('0x33')][_0x9893('0x40')]){_0x293a0a['include']=[{'all':!![]}];}return db[_0x9893('0x2e')][_0x9893('0x41')](_0x293a0a);})['then'](function(_0x481208){_0x3c97ef[_0x9893('0x42')]=_0x481208;return _0x3c97ef;})['then'](respondWithFilteredResult(_0x12f4ae,_0x293a0a))['catch'](handleError(_0x12f4ae,null));};exports['show']=function(_0x2237f5,_0x27fa09){var _0x1000ae={'raw':![],'where':{'id':_0x2237f5[_0x9893('0x43')]['id']}},_0xc2b565={};_0xc2b565['model']=_[_0x9893('0x44')](db[_0x9893('0x2e')]['rawAttributes']);_0xc2b565[_0x9893('0x33')]=_[_0x9893('0x44')](_0x2237f5[_0x9893('0x33')]);_0xc2b565[_0x9893('0x34')]=_[_0x9893('0x35')](_0xc2b565['model'],_0xc2b565[_0x9893('0x33')]);_0x1000ae[_0x9893('0x36')]=_[_0x9893('0x35')](_0xc2b565['model'],qs['fields'](_0x2237f5['query'][_0x9893('0x37')]));_0x1000ae[_0x9893('0x36')]=_0x1000ae[_0x9893('0x36')][_0x9893('0x45')]?_0x1000ae[_0x9893('0x36')]:_0xc2b565[_0x9893('0x32')];if(_0x2237f5[_0x9893('0x33')][_0x9893('0x40')]){_0x1000ae['include']=[{'all':!![]}];}_0x1000ae=_['merge']({},_0x1000ae,_0x2237f5['options']);return db['SalesforceAccount'][_0x9893('0x46')](_0x1000ae)['then'](handleEntityNotFound(_0x27fa09,null))['then'](respondWithResult(_0x27fa09,null))['catch'](handleError(_0x27fa09,null));};exports[_0x9893('0x47')]=function(_0x23a223,_0x589c53){return db[_0x9893('0x2e')]['create'](_0x23a223[_0x9893('0x48')],{})[_0x9893('0x25')](respondWithResult(_0x589c53,0xc9))[_0x9893('0x49')](handleError(_0x589c53,null));};exports[_0x9893('0x4a')]=function(_0x291072,_0x4fc0b9){if(_0x291072[_0x9893('0x48')]['id']){delete _0x291072['body']['id'];}return db[_0x9893('0x2e')][_0x9893('0x46')]({'where':{'id':_0x291072[_0x9893('0x43')]['id']}})[_0x9893('0x25')](handleEntityNotFound(_0x4fc0b9,null))[_0x9893('0x25')](saveUpdates(_0x291072[_0x9893('0x48')],null))[_0x9893('0x25')](respondWithResult(_0x4fc0b9,null))['catch'](handleError(_0x4fc0b9,null));};exports[_0x9893('0x26')]=function(_0x4cba9a,_0x38dc53){return db['SalesforceAccount'][_0x9893('0x46')]({'where':{'id':_0x4cba9a[_0x9893('0x43')]['id']}})['then'](handleEntityNotFound(_0x38dc53,null))['then'](removeEntity(_0x38dc53,null))['catch'](handleError(_0x38dc53,null));};exports[_0x9893('0x4b')]=function(_0xd9721e,_0x27090d,_0x11077f){var _0x501e67={};var _0x43c512={};var _0x223d1;var _0x2686b7;return db['SalesforceAccount'][_0x9893('0x4c')]({'where':{'id':_0xd9721e[_0x9893('0x43')]['id']}})[_0x9893('0x25')](handleEntityNotFound(_0x27090d,null))[_0x9893('0x25')](function(_0x36c337){if(_0x36c337){_0x223d1=_0x36c337;_0x43c512[_0x9893('0x32')]=_[_0x9893('0x44')](db['SalesforceConfiguration']['rawAttributes']);_0x43c512[_0x9893('0x33')]=_[_0x9893('0x44')](_0xd9721e['query']);_0x43c512[_0x9893('0x34')]=_[_0x9893('0x35')](_0x43c512[_0x9893('0x32')],_0x43c512['query']);_0x501e67['attributes']=_[_0x9893('0x35')](_0x43c512[_0x9893('0x32')],qs[_0x9893('0x37')](_0xd9721e['query'][_0x9893('0x37')]));_0x501e67[_0x9893('0x36')]=_0x501e67[_0x9893('0x36')]['length']?_0x501e67['attributes']:_0x43c512[_0x9893('0x32')];_0x501e67[_0x9893('0x3a')]=qs[_0x9893('0x3b')](_0xd9721e[_0x9893('0x33')][_0x9893('0x3b')]);_0x501e67[_0x9893('0x3c')]=qs[_0x9893('0x34')](_[_0x9893('0x4d')](_0xd9721e[_0x9893('0x33')],_0x43c512['filters']));if(_0xd9721e[_0x9893('0x33')]['filter']){_0x501e67[_0x9893('0x3c')]=_[_0x9893('0x3d')](_0x501e67[_0x9893('0x3c')],{'$or':_[_0x9893('0x2d')](_0x501e67['attributes'],function(_0x249a94){var _0x2a76e2={};_0x2a76e2[_0x249a94]={'$like':'%'+_0xd9721e['query']['filter']+'%'};return _0x2a76e2;})});}_0x501e67=_['merge']({},_0x501e67,_0xd9721e[_0x9893('0x4e')]);return _0x223d1[_0x9893('0x4b')](_0x501e67);}})['then'](function(_0x179544){if(_0x179544){_0x2686b7=_0x179544[_0x9893('0x45')];if(!_0xd9721e['query'][_0x9893('0x38')](_0x9893('0x39'))){_0x501e67['limit']=qs[_0x9893('0x1e')](_0xd9721e['query'][_0x9893('0x1e')]);_0x501e67[_0x9893('0x21')]=qs[_0x9893('0x21')](_0xd9721e[_0x9893('0x33')][_0x9893('0x21')]);}return _0x223d1['getConfigurations'](_0x501e67);}})[_0x9893('0x25')](function(_0x1a00bf){if(_0x1a00bf){return _0x1a00bf?{'count':_0x2686b7,'rows':_0x1a00bf}:null;}})['then'](respondWithResult(_0x27090d,null))[_0x9893('0x49')](handleError(_0x27090d,null));};exports['addConfiguration']=function(_0x459029,_0x1bded0,_0x5e4bea){if(_0x459029[_0x9893('0x48')]['id']){delete _0x459029[_0x9893('0x48')]['id'];}return db[_0x9893('0x2e')][_0x9893('0x4c')]({'where':{'id':_0x459029[_0x9893('0x43')]['id']}})[_0x9893('0x25')](handleEntityNotFound(_0x1bded0,null))[_0x9893('0x25')](function(_0x2e816b){if(_0x2e816b){_0x459029[_0x9893('0x48')]['AccountId']=_0x2e816b['id'];_0x459029['body']['Subjects']=integrations[_0x9893('0x4f')](_0x459029['body'][_0x9893('0x50')],_0x459029[_0x9893('0x48')][_0x9893('0x30')]);_0x459029[_0x9893('0x48')]['Descriptions']=integrations[_0x9893('0x51')](_0x459029['body'][_0x9893('0x50')],_0x459029[_0x9893('0x48')][_0x9893('0x30')]);return db[_0x9893('0x52')][_0x9893('0x47')](_0x459029[_0x9893('0x48')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x9893('0x53')],'as':_0x9893('0x54')}]});}return null;})[_0x9893('0x25')](respondWithResult(_0x1bded0,null))[_0x9893('0x49')](handleError(_0x1bded0,null));};exports[_0x9893('0x55')]=function(_0x3fff9e,_0xa42202,_0x2c032c){var _0x2faf96;var _0x5dbb27='';var _0x4a01c3=_0x9893('0x56');return db[_0x9893('0x2e')][_0x9893('0x4c')]({'where':{'id':_0x3fff9e[_0x9893('0x43')]['id']},'attributes':['id',_0x9893('0x57'),'clientId',_0x9893('0x58'),_0x9893('0x59'),_0x9893('0x5a'),_0x9893('0x5b')]})['then'](handleEntityNotFound(_0xa42202,null))[_0x9893('0x25')](function(_0x1a1883){if(_0x1a1883){_0x5dbb27=_0x1a1883['remoteUri'];var _0x498a4e=_0x5dbb27[_0x9893('0x5c')](-0x1);if(_0x498a4e==='/'){_0x5dbb27=_0x5dbb27[_0x9893('0x5d')](0x0,_0x5dbb27[_0x9893('0x5e')](_0x498a4e));}_0x2faf96=new jsforce[(_0x9893('0x5f'))]({'oauth2':{'loginUrl':_0x5dbb27,'clientId':_0x1a1883[_0x9893('0x60')],'clientSecret':_0x1a1883[_0x9893('0x58')]}});return _0x2faf96[_0x9893('0x61')](_0x1a1883[_0x9893('0x59')],_0x1a1883[_0x9893('0x5a')][_0x9893('0x62')](_0x1a1883[_0x9893('0x5b')]));}})['then'](function(_0x4433d5){if(_0x4433d5){if(!_[_0x9893('0x63')](_0x3fff9e[_0x9893('0x33')][_0x9893('0x64')])){_0x4a01c3=_0x3fff9e[_0x9893('0x33')][_0x9893('0x64')];}return _0x2faf96[_0x9893('0x65')](_0x4a01c3)['describe']();}})[_0x9893('0x25')](function(_0xd2e8f6){var _0x25d26f=['OwnerId',_0x9893('0x66'),_0x9893('0x67'),_0x9893('0x68'),_0x9893('0x69'),_0x9893('0x6a')];var _0x43a852=[_0x9893('0x6b'),_0x9893('0x6c'),'picklist',_0x9893('0x6d'),'email',_0x9893('0x6e'),_0x9893('0x6f')];if(_0xd2e8f6){_[_0x9893('0x70')](_0xd2e8f6[_0x9893('0x37')],function(_0x2ededb){return _0x25d26f['includes'](_0x2ededb[_0x9893('0x2a')])||!_0x43a852[_0x9893('0x71')](_0x2ededb[_0x9893('0x30')]);});return{'count':_0xd2e8f6['fields']['length'],'rows':_[_0x9893('0x2d')](_0xd2e8f6['fields'],function(_0x1fd019){return{'id':_0x1fd019[_0x9893('0x2a')],'name':_0x1fd019[_0x9893('0x72')],'custom':_0x1fd019[_0x9893('0x73')],'options':_0x1fd019[_0x9893('0x74')][_0x9893('0x45')]>0x0?_[_0x9893('0x2d')](_0x1fd019[_0x9893('0x74')],function(_0x41de90){return{'name':_0x41de90[_0x9893('0x72')],'value':_0x41de90[_0x9893('0x75')]};}):_0x1fd019[_0x9893('0x30')]=='boolean'?[{'name':_0x9893('0x76'),'value':'true'},{'name':'False','value':_0x9893('0x77')}]:[]};})};}})[_0x9893('0x25')](respondWithResult(_0xa42202,null))[_0x9893('0x49')](function(_0x5d6e3a){var _0x1193ba=_0x3fff9e[_0x9893('0x33')][_0x9893('0x78')]?0x1f4:_0x5d6e3a[_0x9893('0x79')]||0x1f4;logger['error'](_0x9893('0x7a'),_0x9893('0x55'),_0x1193ba,JSON[_0x9893('0x7b')](_0x5d6e3a));delete _0x5d6e3a[_0x9893('0x2a')];if(_0x1193ba===0x191){_0x1193ba=0x190;}_0xa42202[_0x9893('0x1b')](_0x1193ba)[_0x9893('0x2b')](_0x3fff9e['query'][_0x9893('0x78')]?{'message':_0x9893('0x7c'),'statusCode':_0x5d6e3a['statusCode']}:_0x5d6e3a);});}; \ No newline at end of file +var _0x01f6=['statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','name','send','map','SalesforceAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','filter','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Subjects','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsRecurrence','Description','string','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','True','true','False','false','test'];(function(_0x354172,_0x46613e){var _0x4a4e51=function(_0x339e94){while(--_0x339e94){_0x354172['push'](_0x354172['shift']());}};_0x4a4e51(++_0x46613e);}(_0x01f6,0x173));var _0x601f=function(_0x25e2bc,_0x27d1ef){_0x25e2bc=_0x25e2bc-0x0;var _0x5152d3=_0x01f6[_0x25e2bc];return _0x5152d3;};'use strict';var emlformat=require(_0x601f('0x0'));var rimraf=require(_0x601f('0x1'));var zipdir=require(_0x601f('0x2'));var jsonpatch=require(_0x601f('0x3'));var rp=require('request-promise');var moment=require(_0x601f('0x4'));var BPromise=require(_0x601f('0x5'));var Mustache=require(_0x601f('0x6'));var util=require(_0x601f('0x7'));var path=require(_0x601f('0x8'));var sox=require(_0x601f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x601f('0xa'));var _=require(_0x601f('0xb'));var squel=require(_0x601f('0xc'));var crypto=require(_0x601f('0xd'));var jsforce=require(_0x601f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x601f('0xf'));var querystring=require(_0x601f('0x10'));var Papa=require(_0x601f('0x11'));var Redis=require(_0x601f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x601f('0x13'));var as=require(_0x601f('0x14'));var hardwareService=require(_0x601f('0x15'));var logger=require(_0x601f('0x16'))(_0x601f('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x601f('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x601f('0x19'));function respondWithStatusCode(_0x2234ba,_0x40fa5f){_0x40fa5f=_0x40fa5f||0xcc;return function(_0x298f05){if(_0x298f05){return _0x2234ba[_0x601f('0x1a')](_0x40fa5f);}return _0x2234ba[_0x601f('0x1b')](_0x40fa5f)[_0x601f('0x1c')]();};}function respondWithResult(_0x556302,_0x30c052){_0x30c052=_0x30c052||0xc8;return function(_0x2ee9ec){if(_0x2ee9ec){return _0x556302['status'](_0x30c052)[_0x601f('0x1d')](_0x2ee9ec);}};}function respondWithFilteredResult(_0x52c1ac,_0x5b1d75){return function(_0x507981){if(_0x507981){var _0x3c9a39=typeof _0x5b1d75[_0x601f('0x1e')]===_0x601f('0x1f')&&typeof _0x5b1d75[_0x601f('0x20')]==='undefined';var _0x1c8be9=_0x507981['count'];var _0x54a2b9=_0x3c9a39?0x0:_0x5b1d75[_0x601f('0x1e')];var _0x4b311c=_0x3c9a39?_0x507981[_0x601f('0x21')]:_0x5b1d75[_0x601f('0x1e')]+_0x5b1d75[_0x601f('0x20')];var _0x2e4434;if(_0x4b311c>=_0x1c8be9){_0x4b311c=_0x1c8be9;_0x2e4434=0xc8;}else{_0x2e4434=0xce;}_0x52c1ac['status'](_0x2e4434);return _0x52c1ac[_0x601f('0x22')]('Content-Range',_0x54a2b9+'-'+_0x4b311c+'/'+_0x1c8be9)[_0x601f('0x1d')](_0x507981);}return null;};}function patchUpdates(_0x6c03df){return function(_0x4d67bd){try{jsonpatch['apply'](_0x4d67bd,_0x6c03df,!![]);}catch(_0x40b5a6){return BPromise[_0x601f('0x23')](_0x40b5a6);}return _0x4d67bd['save']();};}function saveUpdates(_0x3ecbc1,_0x536252){return function(_0x1f84d4){if(_0x1f84d4){return _0x1f84d4[_0x601f('0x24')](_0x3ecbc1)[_0x601f('0x25')](function(_0x3469eb){return _0x3469eb;});}return null;};}function removeEntity(_0x3c8583,_0x5f204d){return function(_0x5cd88b){if(_0x5cd88b){return _0x5cd88b[_0x601f('0x26')]()[_0x601f('0x25')](function(){_0x3c8583[_0x601f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c9cef,_0x4534f7){return function(_0xe2e32b){if(!_0xe2e32b){_0x5c9cef['sendStatus'](0x194);}return _0xe2e32b;};}function handleError(_0x228072,_0xdddef0){_0xdddef0=_0xdddef0||0x1f4;return function(_0x2e35ca){logger[_0x601f('0x27')](_0x2e35ca['stack']);if(_0x2e35ca[_0x601f('0x28')]){delete _0x2e35ca[_0x601f('0x28')];}_0x228072[_0x601f('0x1b')](_0xdddef0)[_0x601f('0x29')](_0x2e35ca);};}exports['index']=function(_0x54da36,_0x3eef22){var _0x273c8f={},_0x592dd2={},_0x2d6447={'count':0x0,'rows':[]};var _0x35f894=_[_0x601f('0x2a')](db[_0x601f('0x2b')][_0x601f('0x2c')],function(_0x147816){return{'name':_0x147816[_0x601f('0x2d')],'type':_0x147816['type']['key']};});_0x592dd2[_0x601f('0x2e')]=_[_0x601f('0x2a')](_0x35f894,_0x601f('0x28'));_0x592dd2['query']=_[_0x601f('0x2f')](_0x54da36[_0x601f('0x30')]);_0x592dd2[_0x601f('0x31')]=_[_0x601f('0x32')](_0x592dd2[_0x601f('0x2e')],_0x592dd2[_0x601f('0x30')]);_0x273c8f['attributes']=_['intersection'](_0x592dd2[_0x601f('0x2e')],qs['fields'](_0x54da36[_0x601f('0x30')][_0x601f('0x33')]));_0x273c8f[_0x601f('0x34')]=_0x273c8f['attributes'][_0x601f('0x35')]?_0x273c8f[_0x601f('0x34')]:_0x592dd2['model'];if(!_0x54da36['query'][_0x601f('0x36')](_0x601f('0x37'))){_0x273c8f[_0x601f('0x20')]=qs[_0x601f('0x20')](_0x54da36['query'][_0x601f('0x20')]);_0x273c8f[_0x601f('0x1e')]=qs['offset'](_0x54da36[_0x601f('0x30')][_0x601f('0x1e')]);}_0x273c8f[_0x601f('0x38')]=qs[_0x601f('0x39')](_0x54da36[_0x601f('0x30')][_0x601f('0x39')]);_0x273c8f[_0x601f('0x3a')]=qs[_0x601f('0x31')](_['pick'](_0x54da36['query'],_0x592dd2[_0x601f('0x31')]),_0x35f894);if(_0x54da36[_0x601f('0x30')]['filter']){_0x273c8f[_0x601f('0x3a')]=_[_0x601f('0x3b')](_0x273c8f[_0x601f('0x3a')],{'$or':_[_0x601f('0x2a')](_0x35f894,function(_0x17e30e){if(_0x17e30e[_0x601f('0x3c')]!==_0x601f('0x3d')){var _0x29cf1a={};_0x29cf1a[_0x17e30e[_0x601f('0x28')]]={'$like':'%'+_0x54da36[_0x601f('0x30')]['filter']+'%'};return _0x29cf1a;}})});}_0x273c8f=_['merge']({},_0x273c8f,_0x54da36[_0x601f('0x3e')]);var _0x193a34={'where':_0x273c8f[_0x601f('0x3a')]};return db[_0x601f('0x2b')][_0x601f('0x21')](_0x193a34)[_0x601f('0x25')](function(_0x16d7fc){_0x2d6447[_0x601f('0x21')]=_0x16d7fc;if(_0x54da36[_0x601f('0x30')][_0x601f('0x3f')]){_0x273c8f[_0x601f('0x40')]=[{'all':!![]}];}return db[_0x601f('0x2b')]['findAll'](_0x273c8f);})[_0x601f('0x25')](function(_0x264280){_0x2d6447[_0x601f('0x41')]=_0x264280;return _0x2d6447;})['then'](respondWithFilteredResult(_0x3eef22,_0x273c8f))[_0x601f('0x42')](handleError(_0x3eef22,null));};exports[_0x601f('0x43')]=function(_0xbddca8,_0x2e56f7){var _0x17947d={'raw':![],'where':{'id':_0xbddca8[_0x601f('0x44')]['id']}},_0x3fac6c={};_0x3fac6c[_0x601f('0x2e')]=_['keys'](db[_0x601f('0x2b')][_0x601f('0x2c')]);_0x3fac6c[_0x601f('0x30')]=_['keys'](_0xbddca8['query']);_0x3fac6c[_0x601f('0x31')]=_[_0x601f('0x32')](_0x3fac6c[_0x601f('0x2e')],_0x3fac6c[_0x601f('0x30')]);_0x17947d[_0x601f('0x34')]=_[_0x601f('0x32')](_0x3fac6c['model'],qs[_0x601f('0x33')](_0xbddca8[_0x601f('0x30')]['fields']));_0x17947d['attributes']=_0x17947d[_0x601f('0x34')]['length']?_0x17947d[_0x601f('0x34')]:_0x3fac6c[_0x601f('0x2e')];if(_0xbddca8['query'][_0x601f('0x3f')]){_0x17947d['include']=[{'all':!![]}];}_0x17947d=_[_0x601f('0x3b')]({},_0x17947d,_0xbddca8['options']);return db['SalesforceAccount'][_0x601f('0x45')](_0x17947d)['then'](handleEntityNotFound(_0x2e56f7,null))[_0x601f('0x25')](respondWithResult(_0x2e56f7,null))[_0x601f('0x42')](handleError(_0x2e56f7,null));};exports[_0x601f('0x46')]=function(_0x526704,_0x3ffdd7){return db[_0x601f('0x2b')]['create'](_0x526704[_0x601f('0x47')],{})['then'](respondWithResult(_0x3ffdd7,0xc9))[_0x601f('0x42')](handleError(_0x3ffdd7,null));};exports[_0x601f('0x24')]=function(_0x51661e,_0x433a1a){if(_0x51661e[_0x601f('0x47')]['id']){delete _0x51661e[_0x601f('0x47')]['id'];}return db[_0x601f('0x2b')][_0x601f('0x45')]({'where':{'id':_0x51661e['params']['id']}})[_0x601f('0x25')](handleEntityNotFound(_0x433a1a,null))[_0x601f('0x25')](saveUpdates(_0x51661e[_0x601f('0x47')],null))[_0x601f('0x25')](respondWithResult(_0x433a1a,null))[_0x601f('0x42')](handleError(_0x433a1a,null));};exports['destroy']=function(_0x4437a0,_0x47167b){return db[_0x601f('0x2b')][_0x601f('0x45')]({'where':{'id':_0x4437a0[_0x601f('0x44')]['id']}})[_0x601f('0x25')](handleEntityNotFound(_0x47167b,null))[_0x601f('0x25')](removeEntity(_0x47167b,null))[_0x601f('0x42')](handleError(_0x47167b,null));};exports[_0x601f('0x48')]=function(_0x102c32,_0x2e5aa7,_0x18a1c7){var _0x135d92={};var _0x470550={};var _0x4775a1;var _0x323032;return db[_0x601f('0x2b')][_0x601f('0x49')]({'where':{'id':_0x102c32['params']['id']}})[_0x601f('0x25')](handleEntityNotFound(_0x2e5aa7,null))[_0x601f('0x25')](function(_0x11b7d2){if(_0x11b7d2){_0x4775a1=_0x11b7d2;_0x470550[_0x601f('0x2e')]=_[_0x601f('0x2f')](db[_0x601f('0x4a')]['rawAttributes']);_0x470550[_0x601f('0x30')]=_[_0x601f('0x2f')](_0x102c32[_0x601f('0x30')]);_0x470550[_0x601f('0x31')]=_[_0x601f('0x32')](_0x470550[_0x601f('0x2e')],_0x470550[_0x601f('0x30')]);_0x135d92[_0x601f('0x34')]=_['intersection'](_0x470550[_0x601f('0x2e')],qs['fields'](_0x102c32[_0x601f('0x30')]['fields']));_0x135d92[_0x601f('0x34')]=_0x135d92[_0x601f('0x34')][_0x601f('0x35')]?_0x135d92['attributes']:_0x470550['model'];_0x135d92[_0x601f('0x38')]=qs[_0x601f('0x39')](_0x102c32[_0x601f('0x30')][_0x601f('0x39')]);_0x135d92[_0x601f('0x3a')]=qs[_0x601f('0x31')](_['pick'](_0x102c32[_0x601f('0x30')],_0x470550['filters']));if(_0x102c32['query'][_0x601f('0x4b')]){_0x135d92[_0x601f('0x3a')]=_[_0x601f('0x3b')](_0x135d92[_0x601f('0x3a')],{'$or':_[_0x601f('0x2a')](_0x135d92[_0x601f('0x34')],function(_0x2b3b15){var _0x416493={};_0x416493[_0x2b3b15]={'$like':'%'+_0x102c32[_0x601f('0x30')][_0x601f('0x4b')]+'%'};return _0x416493;})});}_0x135d92=_[_0x601f('0x3b')]({},_0x135d92,_0x102c32[_0x601f('0x3e')]);return _0x4775a1['getConfigurations'](_0x135d92);}})[_0x601f('0x25')](function(_0x5aa1de){if(_0x5aa1de){_0x323032=_0x5aa1de[_0x601f('0x35')];if(!_0x102c32[_0x601f('0x30')][_0x601f('0x36')]('nolimit')){_0x135d92[_0x601f('0x20')]=qs[_0x601f('0x20')](_0x102c32[_0x601f('0x30')][_0x601f('0x20')]);_0x135d92[_0x601f('0x1e')]=qs['offset'](_0x102c32[_0x601f('0x30')][_0x601f('0x1e')]);}return _0x4775a1[_0x601f('0x48')](_0x135d92);}})[_0x601f('0x25')](function(_0x510175){if(_0x510175){return _0x510175?{'count':_0x323032,'rows':_0x510175}:null;}})[_0x601f('0x25')](respondWithResult(_0x2e5aa7,null))[_0x601f('0x42')](handleError(_0x2e5aa7,null));};exports[_0x601f('0x4c')]=function(_0x3d9ed6,_0x50290e,_0x1bea2b){if(_0x3d9ed6[_0x601f('0x47')]['id']){delete _0x3d9ed6[_0x601f('0x47')]['id'];}return db['SalesforceAccount'][_0x601f('0x49')]({'where':{'id':_0x3d9ed6[_0x601f('0x44')]['id']}})[_0x601f('0x25')](handleEntityNotFound(_0x50290e,null))[_0x601f('0x25')](function(_0x2567bd){if(_0x2567bd){_0x3d9ed6[_0x601f('0x47')][_0x601f('0x4d')]=_0x2567bd['id'];_0x3d9ed6[_0x601f('0x47')]['Subjects']=integrations[_0x601f('0x4e')](_0x3d9ed6[_0x601f('0x47')]['channel'],_0x3d9ed6['body'][_0x601f('0x3c')]);_0x3d9ed6[_0x601f('0x47')][_0x601f('0x4f')]=integrations[_0x601f('0x50')](_0x3d9ed6[_0x601f('0x47')][_0x601f('0x51')],_0x3d9ed6[_0x601f('0x47')]['type']);return db[_0x601f('0x4a')][_0x601f('0x46')](_0x3d9ed6[_0x601f('0x47')],{'include':[{'model':db[_0x601f('0x52')],'as':_0x601f('0x53')},{'model':db['SalesforceField'],'as':_0x601f('0x4f')}]});}return null;})[_0x601f('0x25')](respondWithResult(_0x50290e,null))[_0x601f('0x42')](handleError(_0x50290e,null));};exports['getFields']=function(_0x42f024,_0x1d3eea,_0x59292d){var _0x260262;var _0x2b5c3e='';var _0x372330='Task';return db[_0x601f('0x2b')]['findOne']({'where':{'id':_0x42f024[_0x601f('0x44')]['id']},'attributes':['id',_0x601f('0x54'),_0x601f('0x55'),_0x601f('0x56'),_0x601f('0x57'),_0x601f('0x58'),_0x601f('0x59')]})[_0x601f('0x25')](handleEntityNotFound(_0x1d3eea,null))[_0x601f('0x25')](function(_0xca9c59){if(_0xca9c59){_0x2b5c3e=_0xca9c59[_0x601f('0x54')];var _0x33616b=_0x2b5c3e[_0x601f('0x5a')](-0x1);if(_0x33616b==='/'){_0x2b5c3e=_0x2b5c3e[_0x601f('0x5b')](0x0,_0x2b5c3e['lastIndexOf'](_0x33616b));}_0x260262=new jsforce[(_0x601f('0x5c'))]({'oauth2':{'loginUrl':_0x2b5c3e,'clientId':_0xca9c59[_0x601f('0x55')],'clientSecret':_0xca9c59[_0x601f('0x56')]}});return _0x260262[_0x601f('0x5d')](_0xca9c59[_0x601f('0x57')],_0xca9c59[_0x601f('0x58')][_0x601f('0x5e')](_0xca9c59[_0x601f('0x59')]));}})['then'](function(_0x5979f9){if(_0x5979f9){if(!_[_0x601f('0x5f')](_0x42f024['query'][_0x601f('0x60')])){_0x372330=_0x42f024[_0x601f('0x30')][_0x601f('0x60')];}return _0x260262[_0x601f('0x61')](_0x372330)['describe']();}})[_0x601f('0x25')](function(_0x527c18){var _0x3d3862=[_0x601f('0x62'),_0x601f('0x63'),'IsReminderSet',_0x601f('0x64'),'Subject',_0x601f('0x65')];var _0x4d5048=[_0x601f('0x66'),'int','picklist',_0x601f('0x67'),_0x601f('0x68'),_0x601f('0x69'),_0x601f('0x6a')];if(_0x527c18){_[_0x601f('0x6b')](_0x527c18['fields'],function(_0x188bef){return _0x3d3862[_0x601f('0x6c')](_0x188bef['name'])||!_0x4d5048['includes'](_0x188bef[_0x601f('0x3c')]);});return{'count':_0x527c18[_0x601f('0x33')][_0x601f('0x35')],'rows':_[_0x601f('0x2a')](_0x527c18[_0x601f('0x33')],function(_0x57b15){return{'id':_0x57b15[_0x601f('0x28')],'name':_0x57b15[_0x601f('0x6d')],'custom':_0x57b15[_0x601f('0x6e')],'options':_0x57b15['picklistValues']['length']>0x0?_['map'](_0x57b15[_0x601f('0x6f')],function(_0x4eec6e){return{'name':_0x4eec6e[_0x601f('0x6d')],'value':_0x4eec6e['value']};}):_0x57b15[_0x601f('0x3c')]==_0x601f('0x67')?[{'name':_0x601f('0x70'),'value':_0x601f('0x71')},{'name':_0x601f('0x72'),'value':_0x601f('0x73')}]:[]};})};}})[_0x601f('0x25')](respondWithResult(_0x1d3eea,null))[_0x601f('0x42')](function(_0x2e6e44){var _0x449e24=_0x42f024[_0x601f('0x30')][_0x601f('0x74')]?0x1f4:_0x2e6e44[_0x601f('0x75')]||0x1f4;logger[_0x601f('0x27')](_0x601f('0x76'),_0x601f('0x77'),_0x449e24,JSON[_0x601f('0x78')](_0x2e6e44));delete _0x2e6e44[_0x601f('0x28')];if(_0x449e24===0x191){_0x449e24=0x190;}_0x1d3eea[_0x601f('0x1b')](_0x449e24)[_0x601f('0x29')](_0x42f024['query']['test']?{'message':_0x601f('0x79'),'statusCode':_0x2e6e44['statusCode']}:_0x2e6e44);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 88ae929..a6e2f61 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 _0x6e73=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x48cd7c,_0x1682e9){var _0xca7662=function(_0x2b1504){while(--_0x2b1504){_0x48cd7c['push'](_0x48cd7c['shift']());}};_0xca7662(++_0x1682e9);}(_0x6e73,0x110));var _0x36e7=function(_0x202490,_0x28ded8){_0x202490=_0x202490-0x0;var _0x3c49b3=_0x6e73[_0x202490];return _0x3c49b3;};'use strict';var _=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var logger=require(_0x36e7('0x2'))(_0x36e7('0x3'));var moment=require(_0x36e7('0x4'));var BPromise=require(_0x36e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36e7('0x6'));var rimraf=require(_0x36e7('0x7'));var config=require(_0x36e7('0x8'));var attributes=require(_0x36e7('0x9'));var integrations=require(_0x36e7('0xa'));module['exports']=function(_0x4e5059,_0x41cb53){return _0x4e5059[_0x36e7('0xb')](_0x36e7('0xc'),attributes,{'tableName':_0x36e7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef60=['../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intSalesforceAccount.attributes'];(function(_0x304c79,_0x3caf92){var _0x20afac=function(_0x2e6fff){while(--_0x2e6fff){_0x304c79['push'](_0x304c79['shift']());}};_0x20afac(++_0x3caf92);}(_0xef60,0xa0));var _0x0ef6=function(_0x1290fa,_0x20f8f0){_0x1290fa=_0x1290fa-0x0;var _0x80a856=_0xef60[_0x1290fa];return _0x80a856;};'use strict';var _=require(_0x0ef6('0x0'));var util=require(_0x0ef6('0x1'));var logger=require(_0x0ef6('0x2'))(_0x0ef6('0x3'));var moment=require(_0x0ef6('0x4'));var BPromise=require(_0x0ef6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ef6('0x6'));var rimraf=require(_0x0ef6('0x7'));var config=require('../../config/environment');var attributes=require(_0x0ef6('0x8'));var integrations=require(_0x0ef6('0x9'));module['exports']=function(_0x1d664b,_0x45cf86){return _0x1d664b[_0x0ef6('0xa')](_0x0ef6('0xb'),attributes,{'tableName':_0x0ef6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 304ea50..85861f5 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 _0xe27a=['include','map','model','stringify','ShowSalesforceAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit'];(function(_0x5d240d,_0x22e0e0){var _0x59701e=function(_0x47df1d){while(--_0x47df1d){_0x5d240d['push'](_0x5d240d['shift']());}};_0x59701e(++_0x22e0e0);}(_0xe27a,0x1e2));var _0xae27=function(_0x46ee51,_0x2a81b0){_0x46ee51=_0x46ee51-0x0;var _0x2c7f1b=_0xe27a[_0x46ee51];return _0x2c7f1b;};'use strict';var _=require(_0xae27('0x0'));var util=require(_0xae27('0x1'));var moment=require('moment');var BPromise=require(_0xae27('0x2'));var rs=require(_0xae27('0x3'));var fs=require('fs');var Redis=require(_0xae27('0x4'));var db=require(_0xae27('0x5'))['db'];var utils=require(_0xae27('0x6'));var logger=require(_0xae27('0x7'))('rpc');var config=require(_0xae27('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xae27('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22bcb1,_0x1ea458,_0x2fd614){return new BPromise(function(_0x4bba54,_0x554965){return client[_0xae27('0xa')](_0x22bcb1,_0x2fd614)[_0xae27('0xb')](function(_0x3d10aa){logger[_0xae27('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x1ea458,_0xae27('0xd'));logger[_0xae27('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1ea458,_0xae27('0xd'),JSON['stringify'](_0x3d10aa));if(_0x3d10aa['error']){if(_0x3d10aa[_0xae27('0xf')][_0xae27('0x10')]===0x1f4){logger[_0xae27('0xf')](_0xae27('0x11'),_0x1ea458,_0x3d10aa[_0xae27('0xf')][_0xae27('0x12')]);return _0x554965(_0x3d10aa[_0xae27('0xf')]['message']);}logger[_0xae27('0xf')](_0xae27('0x11'),_0x1ea458,_0x3d10aa['error'][_0xae27('0x12')]);return _0x4bba54(_0x3d10aa['error']['message']);}else{logger[_0xae27('0xc')](_0xae27('0x11'),_0x1ea458,_0xae27('0xd'));_0x4bba54(_0x3d10aa[_0xae27('0x13')][_0xae27('0x12')]);}})[_0xae27('0x14')](function(_0x4f71c8){logger[_0xae27('0xf')](_0xae27('0x11'),_0x1ea458,_0x4f71c8);_0x554965(_0x4f71c8);});});}exports[_0xae27('0x15')]=function(_0x4dee1f){var _0x18ca30=this;return new Promise(function(_0x1f04d6,_0x2f1684){return db[_0xae27('0x16')]['findAll']({'raw':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x18')]===undefined?!![]:![]:!![],'where':_0x4dee1f[_0xae27('0x17')]?_0x4dee1f[_0xae27('0x17')][_0xae27('0x19')]||null:null,'attributes':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x1a')]||null:null,'limit':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x1b')]||null:null,'include':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x4dee1f[_0xae27('0x17')][_0xae27('0x1c')],function(_0x2cf928){return{'model':db[_0x2cf928[_0xae27('0x1e')]],'as':_0x2cf928['as'],'attributes':_0x2cf928[_0xae27('0x1a')],'include':_0x2cf928[_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x2cf928[_0xae27('0x1c')],function(_0x561f87){return{'model':db[_0x561f87[_0xae27('0x1e')]],'as':_0x561f87['as'],'attributes':_0x561f87[_0xae27('0x1a')],'include':_0x561f87[_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x561f87[_0xae27('0x1c')],function(_0x4dcaf4){return{'model':db[_0x4dcaf4[_0xae27('0x1e')]],'as':_0x4dcaf4['as'],'attributes':_0x4dcaf4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x444414){logger[_0xae27('0xc')](_0xae27('0x15'),_0x4dee1f);logger[_0xae27('0xe')](_0xae27('0x15'),_0x4dee1f,JSON[_0xae27('0x1f')](_0x444414));_0x1f04d6(_0x444414);})[_0xae27('0x14')](function(_0x5f3bbf){logger[_0xae27('0xf')](_0xae27('0x15'),_0x5f3bbf[_0xae27('0x12')],_0x4dee1f);_0x2f1684(_0x18ca30[_0xae27('0xf')](0x1f4,_0x5f3bbf['message']));});});};exports[_0xae27('0x20')]=function(_0x255967){var _0x1fb88c=this;return new Promise(function(_0x41e07c,_0x34b7b3){return db[_0xae27('0x16')][_0xae27('0x21')]({'raw':_0x255967['options']?_0x255967[_0xae27('0x17')][_0xae27('0x18')]===undefined?!![]:![]:!![],'where':_0x255967[_0xae27('0x17')]?_0x255967[_0xae27('0x17')]['where']||null:null,'attributes':_0x255967['options']?_0x255967['options'][_0xae27('0x1a')]||null:null,'include':_0x255967[_0xae27('0x17')]?_0x255967[_0xae27('0x17')][_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x255967[_0xae27('0x17')]['include'],function(_0x6b35df){return{'model':db[_0x6b35df[_0xae27('0x1e')]],'as':_0x6b35df['as'],'attributes':_0x6b35df[_0xae27('0x1a')],'include':_0x6b35df[_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x6b35df[_0xae27('0x1c')],function(_0x149bd2){return{'model':db[_0x149bd2[_0xae27('0x1e')]],'as':_0x149bd2['as'],'attributes':_0x149bd2[_0xae27('0x1a')],'include':_0x149bd2[_0xae27('0x1c')]?_['map'](_0x149bd2[_0xae27('0x1c')],function(_0x2eaa8c){return{'model':db[_0x2eaa8c['model']],'as':_0x2eaa8c['as'],'attributes':_0x2eaa8c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1210e3){logger['info'](_0xae27('0x20'),_0x255967);logger[_0xae27('0xe')]('ShowSalesforceAccount',_0x255967,JSON[_0xae27('0x1f')](_0x1210e3));_0x41e07c(_0x1210e3);})[_0xae27('0x14')](function(_0x5da733){logger[_0xae27('0xf')]('ShowSalesforceAccount',_0x5da733['message'],_0x255967);_0x34b7b3(_0x1fb88c[_0xae27('0xf')](0x1f4,_0x5da733[_0xae27('0x12')]));});});}; \ No newline at end of file +var _0xa7cb=['stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','model','attributes','map','ShowSalesforceAccount','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0xa7cb,0xdf));var _0xba7c=function(_0x5e7d0c,_0x56ba7b){_0x5e7d0c=_0x5e7d0c-0x0;var _0xc24371=_0xa7cb[_0x5e7d0c];return _0xc24371;};'use strict';var _=require(_0xba7c('0x0'));var util=require(_0xba7c('0x1'));var moment=require(_0xba7c('0x2'));var BPromise=require(_0xba7c('0x3'));var rs=require(_0xba7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xba7c('0x5'));var logger=require('../../config/logger')(_0xba7c('0x6'));var config=require('../../config/environment');var jayson=require(_0xba7c('0x7'));var client=jayson[_0xba7c('0x8')][_0xba7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a825c,_0xec1104,_0x18768b){return new BPromise(function(_0x3338d6,_0x418e95){return client['request'](_0x3a825c,_0x18768b)[_0xba7c('0xa')](function(_0x57c2a3){logger[_0xba7c('0xb')](_0xba7c('0xc'),_0xec1104,_0xba7c('0xd'));logger['debug'](_0xba7c('0xe'),_0xec1104,'request\x20sent',JSON[_0xba7c('0xf')](_0x57c2a3));if(_0x57c2a3[_0xba7c('0x10')]){if(_0x57c2a3[_0xba7c('0x10')][_0xba7c('0x11')]===0x1f4){logger[_0xba7c('0x10')](_0xba7c('0xc'),_0xec1104,_0x57c2a3[_0xba7c('0x10')][_0xba7c('0x12')]);return _0x418e95(_0x57c2a3['error'][_0xba7c('0x12')]);}logger[_0xba7c('0x10')](_0xba7c('0xc'),_0xec1104,_0x57c2a3[_0xba7c('0x10')]['message']);return _0x3338d6(_0x57c2a3[_0xba7c('0x10')]['message']);}else{logger['info'](_0xba7c('0xc'),_0xec1104,'request\x20sent');_0x3338d6(_0x57c2a3[_0xba7c('0x13')][_0xba7c('0x12')]);}})[_0xba7c('0x14')](function(_0x360413){logger[_0xba7c('0x10')](_0xba7c('0xc'),_0xec1104,_0x360413);_0x418e95(_0x360413);});});}exports[_0xba7c('0x15')]=function(_0x45e2ed){var _0x14006a=this;return new Promise(function(_0x312dce,_0xff9d1f){return db[_0xba7c('0x16')][_0xba7c('0x17')]({'raw':_0x45e2ed[_0xba7c('0x18')]?_0x45e2ed[_0xba7c('0x18')][_0xba7c('0x19')]===undefined?!![]:![]:!![],'where':_0x45e2ed[_0xba7c('0x18')]?_0x45e2ed[_0xba7c('0x18')][_0xba7c('0x1a')]||null:null,'attributes':_0x45e2ed[_0xba7c('0x18')]?_0x45e2ed[_0xba7c('0x18')]['attributes']||null:null,'limit':_0x45e2ed[_0xba7c('0x18')]?_0x45e2ed[_0xba7c('0x18')][_0xba7c('0x1b')]||null:null,'include':_0x45e2ed['options']?_0x45e2ed[_0xba7c('0x18')]['include']?_['map'](_0x45e2ed['options'][_0xba7c('0x1c')],function(_0x2a29bc){return{'model':db[_0x2a29bc[_0xba7c('0x1d')]],'as':_0x2a29bc['as'],'attributes':_0x2a29bc[_0xba7c('0x1e')],'include':_0x2a29bc[_0xba7c('0x1c')]?_[_0xba7c('0x1f')](_0x2a29bc[_0xba7c('0x1c')],function(_0x1af563){return{'model':db[_0x1af563[_0xba7c('0x1d')]],'as':_0x1af563['as'],'attributes':_0x1af563[_0xba7c('0x1e')],'include':_0x1af563[_0xba7c('0x1c')]?_[_0xba7c('0x1f')](_0x1af563[_0xba7c('0x1c')],function(_0x68579){return{'model':db[_0x68579[_0xba7c('0x1d')]],'as':_0x68579['as'],'attributes':_0x68579[_0xba7c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xba7c('0xa')](function(_0x2c6247){logger[_0xba7c('0xb')](_0xba7c('0x15'),_0x45e2ed);logger['debug']('GetSalesforceAccount',_0x45e2ed,JSON[_0xba7c('0xf')](_0x2c6247));_0x312dce(_0x2c6247);})[_0xba7c('0x14')](function(_0x25891b){logger[_0xba7c('0x10')](_0xba7c('0x15'),_0x25891b['message'],_0x45e2ed);_0xff9d1f(_0x14006a[_0xba7c('0x10')](0x1f4,_0x25891b[_0xba7c('0x12')]));});});};exports[_0xba7c('0x20')]=function(_0x5c1627){var _0x29c34e=this;return new Promise(function(_0x202614,_0x29f35c){return db[_0xba7c('0x16')]['find']({'raw':_0x5c1627[_0xba7c('0x18')]?_0x5c1627[_0xba7c('0x18')][_0xba7c('0x19')]===undefined?!![]:![]:!![],'where':_0x5c1627[_0xba7c('0x18')]?_0x5c1627['options']['where']||null:null,'attributes':_0x5c1627[_0xba7c('0x18')]?_0x5c1627[_0xba7c('0x18')]['attributes']||null:null,'include':_0x5c1627[_0xba7c('0x18')]?_0x5c1627[_0xba7c('0x18')]['include']?_['map'](_0x5c1627[_0xba7c('0x18')][_0xba7c('0x1c')],function(_0x1cb9b8){return{'model':db[_0x1cb9b8[_0xba7c('0x1d')]],'as':_0x1cb9b8['as'],'attributes':_0x1cb9b8[_0xba7c('0x1e')],'include':_0x1cb9b8[_0xba7c('0x1c')]?_[_0xba7c('0x1f')](_0x1cb9b8['include'],function(_0x38d786){return{'model':db[_0x38d786[_0xba7c('0x1d')]],'as':_0x38d786['as'],'attributes':_0x38d786[_0xba7c('0x1e')],'include':_0x38d786[_0xba7c('0x1c')]?_[_0xba7c('0x1f')](_0x38d786[_0xba7c('0x1c')],function(_0x50c66e){return{'model':db[_0x50c66e['model']],'as':_0x50c66e['as'],'attributes':_0x50c66e[_0xba7c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xba7c('0xa')](function(_0x411479){logger[_0xba7c('0xb')]('ShowSalesforceAccount',_0x5c1627);logger[_0xba7c('0x21')](_0xba7c('0x20'),_0x5c1627,JSON[_0xba7c('0xf')](_0x411479));_0x202614(_0x411479);})[_0xba7c('0x14')](function(_0x3e430e){logger[_0xba7c('0x10')](_0xba7c('0x20'),_0x3e430e[_0xba7c('0x12')],_0x5c1627);_0x29f35c(_0x29c34e['error'](0x1f4,_0x3e430e[_0xba7c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 977f51b..5b1b988 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x0b0e,0x187));var _0xe0b0=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x0b0e[_0xc8db6b];return _0x12cb81;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=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(_0x106b17,_0x5c6c80){var _0x45c7a2=function(_0x47abed){while(--_0x47abed){_0x106b17['push'](_0x106b17['shift']());}};_0x45c7a2(++_0x5c6c80);}(_0x2ef3,0xba));var _0x32ef=function(_0x344e76,_0x16fa11){_0x344e76=_0x344e76-0x0;var _0x37db83=_0x2ef3[_0x344e76];return _0x37db83;};'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 9d2a921..a2c09f9 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 _0x3fc3=['contact_lead','contact','lead','account_contact_lead','account','nothing','STRING','ENUM','Task','Case'];(function(_0x56be6a,_0x4b3fb9){var _0x273b32=function(_0xbfcc38){while(--_0xbfcc38){_0x56be6a['push'](_0x56be6a['shift']());}};_0x273b32(++_0x4b3fb9);}(_0x3fc3,0x150));var _0x33fc=function(_0x2655e6,_0x37a236){_0x2655e6=_0x2655e6-0x0;var _0x4bbd2c=_0x3fc3[_0x2655e6];return _0x4bbd2c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x33fc('0x0')]},'description':{'type':Sequelize[_0x33fc('0x0')]},'ticketType':{'type':Sequelize[_0x33fc('0x1')](_0x33fc('0x2'),_0x33fc('0x3')),'defaultValue':_0x33fc('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x33fc('0x4'),_0x33fc('0x5'),_0x33fc('0x6'),_0x33fc('0x7'),_0x33fc('0x8')),'defaultValue':_0x33fc('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x33fc('0x9'),_0x33fc('0x5'),'lead','account'),'defaultValue':_0x33fc('0x6')},'leadId':{'type':Sequelize[_0x33fc('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x33fc('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x33fc('0x0')]}}; \ No newline at end of file +var _0x85f8=['contact_lead','contact','lead','account_contact_lead','account','nothing','STRING','sequelize','exports','Task','ENUM'];(function(_0x4bf5f2,_0x48040d){var _0x9d49ee=function(_0x2344e7){while(--_0x2344e7){_0x4bf5f2['push'](_0x4bf5f2['shift']());}};_0x9d49ee(++_0x48040d);}(_0x85f8,0x10f));var _0x885f=function(_0x20c480,_0x346eb1){_0x20c480=_0x20c480-0x0;var _0x345d56=_0x85f8[_0x20c480];return _0x345d56;};'use strict';var Sequelize=require(_0x885f('0x0'));module[_0x885f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x885f('0x2'),'Case'),'defaultValue':_0x885f('0x2')},'moduleSearch':{'type':Sequelize[_0x885f('0x3')](_0x885f('0x4'),_0x885f('0x5'),_0x885f('0x6'),_0x885f('0x7'),_0x885f('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x885f('0x3')](_0x885f('0x9'),'contact',_0x885f('0x6'),'account'),'defaultValue':_0x885f('0x6')},'leadId':{'type':Sequelize[_0x885f('0xa')]},'additionalSearchAccount':{'type':Sequelize[_0x885f('0xa')]},'additionalSearchContact':{'type':Sequelize[_0x885f('0xa')]},'additionalSearchLead':{'type':Sequelize[_0x885f('0xa')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 9192be7..272e90c 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 _0x5139=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','SalesforceConfiguration','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','show','rawAttributes','includeAll','find','create','body','catch','destroy','params','SalesforceField','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5c956b,_0xa87d11){var _0xaff46a=function(_0x463d89){while(--_0x463d89){_0x5c956b['push'](_0x5c956b['shift']());}};_0xaff46a(++_0xa87d11);}(_0x5139,0x8c));var _0x9513=function(_0x4a5182,_0x135866){_0x4a5182=_0x4a5182-0x0;var _0x5c1ae5=_0x5139[_0x4a5182];return _0x5c1ae5;};'use strict';var emlformat=require(_0x9513('0x0'));var rimraf=require(_0x9513('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9513('0x2'));var rp=require(_0x9513('0x3'));var moment=require(_0x9513('0x4'));var BPromise=require(_0x9513('0x5'));var Mustache=require(_0x9513('0x6'));var util=require(_0x9513('0x7'));var path=require(_0x9513('0x8'));var sox=require('sox');var csv=require(_0x9513('0x9'));var ejs=require(_0x9513('0xa'));var fs=require('fs');var fs_extra=require(_0x9513('0xb'));var _=require(_0x9513('0xc'));var squel=require('squel');var crypto=require(_0x9513('0xd'));var jsforce=require(_0x9513('0xe'));var deskjs=require(_0x9513('0xf'));var toCsv=require(_0x9513('0x9'));var querystring=require(_0x9513('0x10'));var Papa=require(_0x9513('0x11'));var Redis=require(_0x9513('0x12'));var authService=require(_0x9513('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9513('0x14'));var hardwareService=require(_0x9513('0x15'));var logger=require(_0x9513('0x16'))(_0x9513('0x17'));var utils=require(_0x9513('0x18'));var config=require(_0x9513('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9513('0x1a'))['db'];function respondWithStatusCode(_0x892d5a,_0x2ffb1c){_0x2ffb1c=_0x2ffb1c||0xcc;return function(_0x56407e){if(_0x56407e){return _0x892d5a['sendStatus'](_0x2ffb1c);}return _0x892d5a['status'](_0x2ffb1c)[_0x9513('0x1b')]();};}function respondWithResult(_0x3616ac,_0x2dba56){_0x2dba56=_0x2dba56||0xc8;return function(_0xbb1d3c){if(_0xbb1d3c){return _0x3616ac[_0x9513('0x1c')](_0x2dba56)[_0x9513('0x1d')](_0xbb1d3c);}};}function respondWithFilteredResult(_0x50c21a,_0x1a6589){return function(_0x2c9670){if(_0x2c9670){var _0x2e4ca4=typeof _0x1a6589[_0x9513('0x1e')]==='undefined'&&typeof _0x1a6589['limit']===_0x9513('0x1f');var _0x535a41=_0x2c9670[_0x9513('0x20')];var _0x2e4e36=_0x2e4ca4?0x0:_0x1a6589[_0x9513('0x1e')];var _0x3bca3a=_0x2e4ca4?_0x2c9670['count']:_0x1a6589['offset']+_0x1a6589[_0x9513('0x21')];var _0x418b4d;if(_0x3bca3a>=_0x535a41){_0x3bca3a=_0x535a41;_0x418b4d=0xc8;}else{_0x418b4d=0xce;}_0x50c21a[_0x9513('0x1c')](_0x418b4d);return _0x50c21a[_0x9513('0x22')](_0x9513('0x23'),_0x2e4e36+'-'+_0x3bca3a+'/'+_0x535a41)[_0x9513('0x1d')](_0x2c9670);}return null;};}function patchUpdates(_0x14c998){return function(_0x16d946){try{jsonpatch[_0x9513('0x24')](_0x16d946,_0x14c998,!![]);}catch(_0x27426e){return BPromise[_0x9513('0x25')](_0x27426e);}return _0x16d946[_0x9513('0x26')]();};}function saveUpdates(_0x2510f8,_0x33b2df){return function(_0x1918d0){if(_0x1918d0){return _0x1918d0[_0x9513('0x27')](_0x2510f8)[_0x9513('0x28')](function(_0x414fcb){return _0x414fcb;});}return null;};}function removeEntity(_0x4f1570,_0x39adcc){return function(_0x4b8503){if(_0x4b8503){return _0x4b8503['destroy']()[_0x9513('0x28')](function(){_0x4f1570['status'](0xcc)[_0x9513('0x1b')]();});}};}function handleEntityNotFound(_0x2f64c2,_0x14b598){return function(_0x20a5fd){if(!_0x20a5fd){_0x2f64c2[_0x9513('0x29')](0x194);}return _0x20a5fd;};}function handleError(_0x589213,_0x5f37ef){_0x5f37ef=_0x5f37ef||0x1f4;return function(_0x21fe18){logger[_0x9513('0x2a')](_0x21fe18['stack']);if(_0x21fe18[_0x9513('0x2b')]){delete _0x21fe18['name'];}_0x589213[_0x9513('0x1c')](_0x5f37ef)[_0x9513('0x2c')](_0x21fe18);};}exports[_0x9513('0x2d')]=function(_0x41c2f3,_0x3ec7dc){var _0x40d6d0={},_0x152587={},_0x53f769={'count':0x0,'rows':[]};var _0x1d6c48=_['map'](db[_0x9513('0x2e')]['rawAttributes'],function(_0x58d93b){return{'name':_0x58d93b['fieldName'],'type':_0x58d93b[_0x9513('0x2f')]['key']};});_0x152587[_0x9513('0x30')]=_[_0x9513('0x31')](_0x1d6c48,_0x9513('0x2b'));_0x152587[_0x9513('0x32')]=_[_0x9513('0x33')](_0x41c2f3[_0x9513('0x32')]);_0x152587[_0x9513('0x34')]=_[_0x9513('0x35')](_0x152587[_0x9513('0x30')],_0x152587['query']);_0x40d6d0['attributes']=_[_0x9513('0x35')](_0x152587[_0x9513('0x30')],qs[_0x9513('0x36')](_0x41c2f3[_0x9513('0x32')][_0x9513('0x36')]));_0x40d6d0[_0x9513('0x37')]=_0x40d6d0[_0x9513('0x37')][_0x9513('0x38')]?_0x40d6d0[_0x9513('0x37')]:_0x152587[_0x9513('0x30')];if(!_0x41c2f3[_0x9513('0x32')][_0x9513('0x39')](_0x9513('0x3a'))){_0x40d6d0[_0x9513('0x21')]=qs['limit'](_0x41c2f3[_0x9513('0x32')][_0x9513('0x21')]);_0x40d6d0[_0x9513('0x1e')]=qs[_0x9513('0x1e')](_0x41c2f3['query']['offset']);}_0x40d6d0[_0x9513('0x3b')]=qs[_0x9513('0x3c')](_0x41c2f3[_0x9513('0x32')][_0x9513('0x3c')]);_0x40d6d0['where']=qs[_0x9513('0x34')](_[_0x9513('0x3d')](_0x41c2f3[_0x9513('0x32')],_0x152587[_0x9513('0x34')]),_0x1d6c48);if(_0x41c2f3[_0x9513('0x32')][_0x9513('0x3e')]){_0x40d6d0['where']=_[_0x9513('0x3f')](_0x40d6d0[_0x9513('0x40')],{'$or':_['map'](_0x1d6c48,function(_0x47eef6){if(_0x47eef6[_0x9513('0x2f')]!==_0x9513('0x41')){var _0x549e0f={};_0x549e0f[_0x47eef6['name']]={'$like':'%'+_0x41c2f3['query'][_0x9513('0x3e')]+'%'};return _0x549e0f;}})});}_0x40d6d0=_[_0x9513('0x3f')]({},_0x40d6d0,_0x41c2f3[_0x9513('0x42')]);var _0x6a74d3={'where':_0x40d6d0[_0x9513('0x40')]};return db['SalesforceConfiguration']['count'](_0x6a74d3)['then'](function(_0x189751){_0x53f769[_0x9513('0x20')]=_0x189751;if(_0x41c2f3[_0x9513('0x32')]['includeAll']){_0x40d6d0['include']=[{'all':!![]}];}return db[_0x9513('0x2e')]['findAll'](_0x40d6d0);})['then'](function(_0x3d7ea7){_0x53f769['rows']=_0x3d7ea7;return _0x53f769;})[_0x9513('0x28')](respondWithFilteredResult(_0x3ec7dc,_0x40d6d0))['catch'](handleError(_0x3ec7dc,null));};exports[_0x9513('0x43')]=function(_0x185fd1,_0x2517e3){var _0x3ed689={'raw':![],'where':{'id':_0x185fd1['params']['id']}},_0x178757={};_0x178757[_0x9513('0x30')]=_[_0x9513('0x33')](db[_0x9513('0x2e')][_0x9513('0x44')]);_0x178757[_0x9513('0x32')]=_['keys'](_0x185fd1['query']);_0x178757['filters']=_[_0x9513('0x35')](_0x178757[_0x9513('0x30')],_0x178757[_0x9513('0x32')]);_0x3ed689[_0x9513('0x37')]=_[_0x9513('0x35')](_0x178757[_0x9513('0x30')],qs[_0x9513('0x36')](_0x185fd1[_0x9513('0x32')]['fields']));_0x3ed689['attributes']=_0x3ed689[_0x9513('0x37')][_0x9513('0x38')]?_0x3ed689[_0x9513('0x37')]:_0x178757['model'];if(_0x185fd1['query'][_0x9513('0x45')]){_0x3ed689['include']=[{'all':!![]}];}_0x3ed689=_['merge']({},_0x3ed689,_0x185fd1[_0x9513('0x42')]);return db[_0x9513('0x2e')][_0x9513('0x46')](_0x3ed689)[_0x9513('0x28')](handleEntityNotFound(_0x2517e3,null))['then'](respondWithResult(_0x2517e3,null))['catch'](handleError(_0x2517e3,null));};exports[_0x9513('0x47')]=function(_0x2f2bbb,_0x1e961b){return db['SalesforceConfiguration'][_0x9513('0x47')](_0x2f2bbb[_0x9513('0x48')],{})[_0x9513('0x28')](respondWithResult(_0x1e961b,0xc9))[_0x9513('0x49')](handleError(_0x1e961b,null));};exports[_0x9513('0x27')]=function(_0x1ee3a7,_0x49f108){if(_0x1ee3a7[_0x9513('0x48')]['id']){delete _0x1ee3a7[_0x9513('0x48')]['id'];}return db[_0x9513('0x2e')]['find']({'where':{'id':_0x1ee3a7['params']['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x49f108,null))['then'](saveUpdates(_0x1ee3a7[_0x9513('0x48')],null))[_0x9513('0x28')](respondWithResult(_0x49f108,null))[_0x9513('0x49')](handleError(_0x49f108,null));};exports[_0x9513('0x4a')]=function(_0x394aff,_0x4b3fdb){return db[_0x9513('0x2e')][_0x9513('0x46')]({'where':{'id':_0x394aff[_0x9513('0x4b')]['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x4b3fdb,null))[_0x9513('0x28')](removeEntity(_0x4b3fdb,null))[_0x9513('0x49')](handleError(_0x4b3fdb,null));};exports['getFields']=function(_0x1b3f4b,_0x755fce,_0x476566){var _0x2766f2={};var _0x4ddc0f={};var _0x1dc8da;var _0x38e75e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1b3f4b[_0x9513('0x4b')]['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x755fce,null))['then'](function(_0x28fdd8){if(_0x28fdd8){_0x1dc8da=_0x28fdd8;_0x4ddc0f[_0x9513('0x30')]=_[_0x9513('0x33')](db[_0x9513('0x4c')][_0x9513('0x44')]);_0x4ddc0f[_0x9513('0x32')]=_[_0x9513('0x33')](_0x1b3f4b[_0x9513('0x32')]);_0x4ddc0f[_0x9513('0x34')]=_['intersection'](_0x4ddc0f[_0x9513('0x30')],_0x4ddc0f[_0x9513('0x32')]);_0x2766f2[_0x9513('0x37')]=_[_0x9513('0x35')](_0x4ddc0f[_0x9513('0x30')],qs[_0x9513('0x36')](_0x1b3f4b[_0x9513('0x32')][_0x9513('0x36')]));_0x2766f2[_0x9513('0x37')]=_0x2766f2['attributes'][_0x9513('0x38')]?_0x2766f2[_0x9513('0x37')]:_0x4ddc0f['model'];_0x2766f2[_0x9513('0x3b')]=qs[_0x9513('0x3c')](_0x1b3f4b[_0x9513('0x32')][_0x9513('0x3c')]);_0x2766f2[_0x9513('0x40')]=qs[_0x9513('0x34')](_[_0x9513('0x3d')](_0x1b3f4b[_0x9513('0x32')],_0x4ddc0f[_0x9513('0x34')]));if(_0x1b3f4b[_0x9513('0x32')]['filter']){_0x2766f2[_0x9513('0x40')]=_['merge'](_0x2766f2[_0x9513('0x40')],{'$or':_[_0x9513('0x31')](_0x2766f2[_0x9513('0x37')],function(_0x4a5ba8){var _0x48a74a={};_0x48a74a[_0x4a5ba8]={'$like':'%'+_0x1b3f4b[_0x9513('0x32')][_0x9513('0x3e')]+'%'};return _0x48a74a;})});}_0x2766f2=_[_0x9513('0x3f')]({},_0x2766f2,_0x1b3f4b[_0x9513('0x42')]);return _0x1dc8da[_0x9513('0x4d')](_0x2766f2);}})[_0x9513('0x28')](function(_0x303845){if(_0x303845){_0x38e75e=_0x303845[_0x9513('0x38')];if(!_0x1b3f4b[_0x9513('0x32')]['hasOwnProperty'](_0x9513('0x3a'))){_0x2766f2[_0x9513('0x21')]=qs[_0x9513('0x21')](_0x1b3f4b['query'][_0x9513('0x21')]);_0x2766f2[_0x9513('0x1e')]=qs[_0x9513('0x1e')](_0x1b3f4b['query'][_0x9513('0x1e')]);}return _0x1dc8da['getFields'](_0x2766f2);}})[_0x9513('0x28')](function(_0x453738){if(_0x453738){return _0x453738?{'count':_0x38e75e,'rows':_0x453738}:null;}})[_0x9513('0x28')](respondWithResult(_0x755fce,null))[_0x9513('0x49')](handleError(_0x755fce,null));};exports[_0x9513('0x4e')]=function(_0x28d2b3,_0x596248,_0x44240a){var _0x13e540={};var _0x27cb70={};var _0x43b19e;var _0x5acfb4;return db[_0x9513('0x2e')][_0x9513('0x4f')]({'where':{'id':_0x28d2b3['params']['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x596248,null))[_0x9513('0x28')](function(_0xaed8fe){if(_0xaed8fe){_0x43b19e=_0xaed8fe;_0x27cb70[_0x9513('0x30')]=_['keys'](db[_0x9513('0x4c')][_0x9513('0x44')]);_0x27cb70[_0x9513('0x32')]=_[_0x9513('0x33')](_0x28d2b3[_0x9513('0x32')]);_0x27cb70['filters']=_['intersection'](_0x27cb70[_0x9513('0x30')],_0x27cb70[_0x9513('0x32')]);_0x13e540[_0x9513('0x37')]=_[_0x9513('0x35')](_0x27cb70[_0x9513('0x30')],qs[_0x9513('0x36')](_0x28d2b3[_0x9513('0x32')][_0x9513('0x36')]));_0x13e540[_0x9513('0x37')]=_0x13e540[_0x9513('0x37')]['length']?_0x13e540[_0x9513('0x37')]:_0x27cb70[_0x9513('0x30')];_0x13e540[_0x9513('0x3b')]=qs[_0x9513('0x3c')](_0x28d2b3['query'][_0x9513('0x3c')]);_0x13e540[_0x9513('0x40')]=qs[_0x9513('0x34')](_['pick'](_0x28d2b3[_0x9513('0x32')],_0x27cb70[_0x9513('0x34')]));if(_0x28d2b3['query'][_0x9513('0x3e')]){_0x13e540['where']=_[_0x9513('0x3f')](_0x13e540['where'],{'$or':_['map'](_0x13e540[_0x9513('0x37')],function(_0x45e7ed){var _0x2128bf={};_0x2128bf[_0x45e7ed]={'$like':'%'+_0x28d2b3[_0x9513('0x32')]['filter']+'%'};return _0x2128bf;})});}_0x13e540=_[_0x9513('0x3f')]({},_0x13e540,_0x28d2b3[_0x9513('0x42')]);return _0x43b19e[_0x9513('0x4e')](_0x13e540);}})[_0x9513('0x28')](function(_0x39b5c9){if(_0x39b5c9){_0x5acfb4=_0x39b5c9[_0x9513('0x38')];if(!_0x28d2b3[_0x9513('0x32')][_0x9513('0x39')](_0x9513('0x3a'))){_0x13e540[_0x9513('0x21')]=qs[_0x9513('0x21')](_0x28d2b3['query']['limit']);_0x13e540[_0x9513('0x1e')]=qs['offset'](_0x28d2b3[_0x9513('0x32')]['offset']);}return _0x43b19e[_0x9513('0x4e')](_0x13e540);}})[_0x9513('0x28')](function(_0x4bfe16){if(_0x4bfe16){return _0x4bfe16?{'count':_0x5acfb4,'rows':_0x4bfe16}:null;}})[_0x9513('0x28')](respondWithResult(_0x596248,null))['catch'](handleError(_0x596248,null));};exports['getDescriptions']=function(_0x49b439,_0x2a66df,_0x5e3f69){var _0x405a3e={};var _0x1ded5f={};var _0x2a6c6b;var _0x9d7031;return db['SalesforceConfiguration'][_0x9513('0x4f')]({'where':{'id':_0x49b439[_0x9513('0x4b')]['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x2a66df,null))[_0x9513('0x28')](function(_0x251199){if(_0x251199){_0x2a6c6b=_0x251199;_0x1ded5f['model']=_[_0x9513('0x33')](db['SalesforceField']['rawAttributes']);_0x1ded5f['query']=_[_0x9513('0x33')](_0x49b439[_0x9513('0x32')]);_0x1ded5f[_0x9513('0x34')]=_['intersection'](_0x1ded5f[_0x9513('0x30')],_0x1ded5f[_0x9513('0x32')]);_0x405a3e['attributes']=_[_0x9513('0x35')](_0x1ded5f[_0x9513('0x30')],qs[_0x9513('0x36')](_0x49b439[_0x9513('0x32')]['fields']));_0x405a3e[_0x9513('0x37')]=_0x405a3e[_0x9513('0x37')][_0x9513('0x38')]?_0x405a3e[_0x9513('0x37')]:_0x1ded5f[_0x9513('0x30')];_0x405a3e['order']=qs[_0x9513('0x3c')](_0x49b439[_0x9513('0x32')][_0x9513('0x3c')]);_0x405a3e[_0x9513('0x40')]=qs[_0x9513('0x34')](_['pick'](_0x49b439['query'],_0x1ded5f[_0x9513('0x34')]));if(_0x49b439[_0x9513('0x32')][_0x9513('0x3e')]){_0x405a3e[_0x9513('0x40')]=_[_0x9513('0x3f')](_0x405a3e[_0x9513('0x40')],{'$or':_[_0x9513('0x31')](_0x405a3e['attributes'],function(_0x97e43e){var _0x58f920={};_0x58f920[_0x97e43e]={'$like':'%'+_0x49b439[_0x9513('0x32')]['filter']+'%'};return _0x58f920;})});}_0x405a3e=_[_0x9513('0x3f')]({},_0x405a3e,_0x49b439[_0x9513('0x42')]);return _0x2a6c6b[_0x9513('0x50')](_0x405a3e);}})[_0x9513('0x28')](function(_0x4fc977){if(_0x4fc977){_0x9d7031=_0x4fc977[_0x9513('0x38')];if(!_0x49b439[_0x9513('0x32')][_0x9513('0x39')](_0x9513('0x3a'))){_0x405a3e[_0x9513('0x21')]=qs['limit'](_0x49b439[_0x9513('0x32')][_0x9513('0x21')]);_0x405a3e[_0x9513('0x1e')]=qs[_0x9513('0x1e')](_0x49b439[_0x9513('0x32')][_0x9513('0x1e')]);}return _0x2a6c6b[_0x9513('0x50')](_0x405a3e);}})[_0x9513('0x28')](function(_0x504d4d){if(_0x504d4d){return _0x504d4d?{'count':_0x9d7031,'rows':_0x504d4d}:null;}})[_0x9513('0x28')](respondWithResult(_0x2a66df,null))[_0x9513('0x49')](handleError(_0x2a66df,null));}; \ No newline at end of file +var _0x4ce6=['filters','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','intersection','length','options','find','create','body','destroy','findOne','getFields','getSubjects','getDescriptions','SalesforceField','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','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','json','offset','count','limit','apply','reject','save','then','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','keys'];(function(_0xbb1add,_0x489d26){var _0x1620b1=function(_0x2b43c3){while(--_0x2b43c3){_0xbb1add['push'](_0xbb1add['shift']());}};_0x1620b1(++_0x489d26);}(_0x4ce6,0x108));var _0x64ce=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x4ce6[_0x3474ac];return _0x5345ec;};'use strict';var emlformat=require(_0x64ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x64ce('0x1'));var jsonpatch=require(_0x64ce('0x2'));var rp=require(_0x64ce('0x3'));var moment=require(_0x64ce('0x4'));var BPromise=require(_0x64ce('0x5'));var Mustache=require(_0x64ce('0x6'));var util=require('util');var path=require(_0x64ce('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x64ce('0x8'));var fs=require('fs');var fs_extra=require(_0x64ce('0x9'));var _=require('lodash');var squel=require(_0x64ce('0xa'));var crypto=require(_0x64ce('0xb'));var jsforce=require(_0x64ce('0xc'));var deskjs=require(_0x64ce('0xd'));var toCsv=require(_0x64ce('0xe'));var querystring=require(_0x64ce('0xf'));var Papa=require(_0x64ce('0x10'));var Redis=require(_0x64ce('0x11'));var authService=require(_0x64ce('0x12'));var qs=require(_0x64ce('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64ce('0x14'));var logger=require(_0x64ce('0x15'))(_0x64ce('0x16'));var utils=require(_0x64ce('0x17'));var config=require(_0x64ce('0x18'));var licenseUtil=require(_0x64ce('0x19'));var db=require(_0x64ce('0x1a'))['db'];function respondWithStatusCode(_0x321f24,_0x4dbb9e){_0x4dbb9e=_0x4dbb9e||0xcc;return function(_0x17be05){if(_0x17be05){return _0x321f24['sendStatus'](_0x4dbb9e);}return _0x321f24['status'](_0x4dbb9e)[_0x64ce('0x1b')]();};}function respondWithResult(_0x498d55,_0xedcfa5){_0xedcfa5=_0xedcfa5||0xc8;return function(_0x22e852){if(_0x22e852){return _0x498d55[_0x64ce('0x1c')](_0xedcfa5)[_0x64ce('0x1d')](_0x22e852);}};}function respondWithFilteredResult(_0x3579a3,_0x235a82){return function(_0x476a31){if(_0x476a31){var _0x42df9a=typeof _0x235a82[_0x64ce('0x1e')]==='undefined'&&typeof _0x235a82['limit']==='undefined';var _0x3eca89=_0x476a31[_0x64ce('0x1f')];var _0x1f6fd4=_0x42df9a?0x0:_0x235a82[_0x64ce('0x1e')];var _0x38d441=_0x42df9a?_0x476a31[_0x64ce('0x1f')]:_0x235a82[_0x64ce('0x1e')]+_0x235a82[_0x64ce('0x20')];var _0xafcce4;if(_0x38d441>=_0x3eca89){_0x38d441=_0x3eca89;_0xafcce4=0xc8;}else{_0xafcce4=0xce;}_0x3579a3[_0x64ce('0x1c')](_0xafcce4);return _0x3579a3['set']('Content-Range',_0x1f6fd4+'-'+_0x38d441+'/'+_0x3eca89)[_0x64ce('0x1d')](_0x476a31);}return null;};}function patchUpdates(_0x17a36b){return function(_0x4f8dc2){try{jsonpatch[_0x64ce('0x21')](_0x4f8dc2,_0x17a36b,!![]);}catch(_0x3a8d29){return BPromise[_0x64ce('0x22')](_0x3a8d29);}return _0x4f8dc2[_0x64ce('0x23')]();};}function saveUpdates(_0x2b5f89,_0x1aa495){return function(_0x34a7f7){if(_0x34a7f7){return _0x34a7f7['update'](_0x2b5f89)[_0x64ce('0x24')](function(_0x36c332){return _0x36c332;});}return null;};}function removeEntity(_0x4f9107,_0x1aec1f){return function(_0x9729cf){if(_0x9729cf){return _0x9729cf['destroy']()[_0x64ce('0x24')](function(){_0x4f9107[_0x64ce('0x1c')](0xcc)[_0x64ce('0x1b')]();});}};}function handleEntityNotFound(_0x33feb3,_0x2826f6){return function(_0x2e941c){if(!_0x2e941c){_0x33feb3['sendStatus'](0x194);}return _0x2e941c;};}function handleError(_0x618946,_0x3b77c7){_0x3b77c7=_0x3b77c7||0x1f4;return function(_0x5415de){logger[_0x64ce('0x25')](_0x5415de[_0x64ce('0x26')]);if(_0x5415de['name']){delete _0x5415de[_0x64ce('0x27')];}_0x618946[_0x64ce('0x1c')](_0x3b77c7)[_0x64ce('0x28')](_0x5415de);};}exports['index']=function(_0x24181c,_0x1fd112){var _0x23d5a0={},_0x3e7a52={},_0x2fa80d={'count':0x0,'rows':[]};var _0x46c19b=_[_0x64ce('0x29')](db[_0x64ce('0x2a')][_0x64ce('0x2b')],function(_0x2f8b6b){return{'name':_0x2f8b6b[_0x64ce('0x2c')],'type':_0x2f8b6b[_0x64ce('0x2d')]['key']};});_0x3e7a52[_0x64ce('0x2e')]=_['map'](_0x46c19b,_0x64ce('0x27'));_0x3e7a52['query']=_[_0x64ce('0x2f')](_0x24181c['query']);_0x3e7a52[_0x64ce('0x30')]=_['intersection'](_0x3e7a52['model'],_0x3e7a52['query']);_0x23d5a0[_0x64ce('0x31')]=_['intersection'](_0x3e7a52['model'],qs[_0x64ce('0x32')](_0x24181c[_0x64ce('0x33')][_0x64ce('0x32')]));_0x23d5a0[_0x64ce('0x31')]=_0x23d5a0[_0x64ce('0x31')]['length']?_0x23d5a0[_0x64ce('0x31')]:_0x3e7a52[_0x64ce('0x2e')];if(!_0x24181c[_0x64ce('0x33')][_0x64ce('0x34')](_0x64ce('0x35'))){_0x23d5a0['limit']=qs[_0x64ce('0x20')](_0x24181c[_0x64ce('0x33')][_0x64ce('0x20')]);_0x23d5a0['offset']=qs[_0x64ce('0x1e')](_0x24181c[_0x64ce('0x33')][_0x64ce('0x1e')]);}_0x23d5a0[_0x64ce('0x36')]=qs[_0x64ce('0x37')](_0x24181c[_0x64ce('0x33')][_0x64ce('0x37')]);_0x23d5a0[_0x64ce('0x38')]=qs['filters'](_[_0x64ce('0x39')](_0x24181c['query'],_0x3e7a52['filters']),_0x46c19b);if(_0x24181c[_0x64ce('0x33')]['filter']){_0x23d5a0[_0x64ce('0x38')]=_[_0x64ce('0x3a')](_0x23d5a0[_0x64ce('0x38')],{'$or':_['map'](_0x46c19b,function(_0x3460ae){if(_0x3460ae[_0x64ce('0x2d')]!=='VIRTUAL'){var _0x1a640a={};_0x1a640a[_0x3460ae['name']]={'$like':'%'+_0x24181c[_0x64ce('0x33')][_0x64ce('0x3b')]+'%'};return _0x1a640a;}})});}_0x23d5a0=_[_0x64ce('0x3a')]({},_0x23d5a0,_0x24181c['options']);var _0xdce6d7={'where':_0x23d5a0['where']};return db[_0x64ce('0x2a')][_0x64ce('0x1f')](_0xdce6d7)[_0x64ce('0x24')](function(_0x1eed7f){_0x2fa80d[_0x64ce('0x1f')]=_0x1eed7f;if(_0x24181c['query'][_0x64ce('0x3c')]){_0x23d5a0[_0x64ce('0x3d')]=[{'all':!![]}];}return db[_0x64ce('0x2a')]['findAll'](_0x23d5a0);})[_0x64ce('0x24')](function(_0x824143){_0x2fa80d[_0x64ce('0x3e')]=_0x824143;return _0x2fa80d;})['then'](respondWithFilteredResult(_0x1fd112,_0x23d5a0))[_0x64ce('0x3f')](handleError(_0x1fd112,null));};exports[_0x64ce('0x40')]=function(_0x456fef,_0x132499){var _0x422211={'raw':![],'where':{'id':_0x456fef[_0x64ce('0x41')]['id']}},_0x48043b={};_0x48043b['model']=_[_0x64ce('0x2f')](db[_0x64ce('0x2a')][_0x64ce('0x2b')]);_0x48043b[_0x64ce('0x33')]=_['keys'](_0x456fef[_0x64ce('0x33')]);_0x48043b[_0x64ce('0x30')]=_[_0x64ce('0x42')](_0x48043b['model'],_0x48043b['query']);_0x422211[_0x64ce('0x31')]=_[_0x64ce('0x42')](_0x48043b[_0x64ce('0x2e')],qs[_0x64ce('0x32')](_0x456fef['query'][_0x64ce('0x32')]));_0x422211[_0x64ce('0x31')]=_0x422211[_0x64ce('0x31')][_0x64ce('0x43')]?_0x422211[_0x64ce('0x31')]:_0x48043b[_0x64ce('0x2e')];if(_0x456fef['query'][_0x64ce('0x3c')]){_0x422211['include']=[{'all':!![]}];}_0x422211=_[_0x64ce('0x3a')]({},_0x422211,_0x456fef[_0x64ce('0x44')]);return db[_0x64ce('0x2a')][_0x64ce('0x45')](_0x422211)[_0x64ce('0x24')](handleEntityNotFound(_0x132499,null))[_0x64ce('0x24')](respondWithResult(_0x132499,null))[_0x64ce('0x3f')](handleError(_0x132499,null));};exports[_0x64ce('0x46')]=function(_0x5711f8,_0x40df30){return db['SalesforceConfiguration'][_0x64ce('0x46')](_0x5711f8[_0x64ce('0x47')],{})[_0x64ce('0x24')](respondWithResult(_0x40df30,0xc9))[_0x64ce('0x3f')](handleError(_0x40df30,null));};exports['update']=function(_0x3f565e,_0x1b739c){if(_0x3f565e['body']['id']){delete _0x3f565e[_0x64ce('0x47')]['id'];}return db[_0x64ce('0x2a')][_0x64ce('0x45')]({'where':{'id':_0x3f565e[_0x64ce('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b739c,null))[_0x64ce('0x24')](saveUpdates(_0x3f565e[_0x64ce('0x47')],null))[_0x64ce('0x24')](respondWithResult(_0x1b739c,null))[_0x64ce('0x3f')](handleError(_0x1b739c,null));};exports[_0x64ce('0x48')]=function(_0x4cf1e2,_0x9c65da){return db['SalesforceConfiguration'][_0x64ce('0x45')]({'where':{'id':_0x4cf1e2['params']['id']}})[_0x64ce('0x24')](handleEntityNotFound(_0x9c65da,null))['then'](removeEntity(_0x9c65da,null))[_0x64ce('0x3f')](handleError(_0x9c65da,null));};exports['getFields']=function(_0x4d4e3c,_0x12cde5,_0x158cdd){var _0x266ec2={};var _0xbe7de2={};var _0x27d4fe;var _0xe747bf;return db[_0x64ce('0x2a')][_0x64ce('0x49')]({'where':{'id':_0x4d4e3c[_0x64ce('0x41')]['id']}})[_0x64ce('0x24')](handleEntityNotFound(_0x12cde5,null))[_0x64ce('0x24')](function(_0x4bd73e){if(_0x4bd73e){_0x27d4fe=_0x4bd73e;_0xbe7de2[_0x64ce('0x2e')]=_[_0x64ce('0x2f')](db['SalesforceField'][_0x64ce('0x2b')]);_0xbe7de2[_0x64ce('0x33')]=_[_0x64ce('0x2f')](_0x4d4e3c[_0x64ce('0x33')]);_0xbe7de2['filters']=_[_0x64ce('0x42')](_0xbe7de2[_0x64ce('0x2e')],_0xbe7de2[_0x64ce('0x33')]);_0x266ec2['attributes']=_[_0x64ce('0x42')](_0xbe7de2[_0x64ce('0x2e')],qs['fields'](_0x4d4e3c['query'][_0x64ce('0x32')]));_0x266ec2[_0x64ce('0x31')]=_0x266ec2[_0x64ce('0x31')][_0x64ce('0x43')]?_0x266ec2[_0x64ce('0x31')]:_0xbe7de2['model'];_0x266ec2[_0x64ce('0x36')]=qs[_0x64ce('0x37')](_0x4d4e3c['query'][_0x64ce('0x37')]);_0x266ec2[_0x64ce('0x38')]=qs[_0x64ce('0x30')](_[_0x64ce('0x39')](_0x4d4e3c['query'],_0xbe7de2['filters']));if(_0x4d4e3c[_0x64ce('0x33')]['filter']){_0x266ec2[_0x64ce('0x38')]=_['merge'](_0x266ec2[_0x64ce('0x38')],{'$or':_['map'](_0x266ec2[_0x64ce('0x31')],function(_0x3dffac){var _0x522ce3={};_0x522ce3[_0x3dffac]={'$like':'%'+_0x4d4e3c[_0x64ce('0x33')][_0x64ce('0x3b')]+'%'};return _0x522ce3;})});}_0x266ec2=_['merge']({},_0x266ec2,_0x4d4e3c[_0x64ce('0x44')]);return _0x27d4fe[_0x64ce('0x4a')](_0x266ec2);}})['then'](function(_0x46197e){if(_0x46197e){_0xe747bf=_0x46197e[_0x64ce('0x43')];if(!_0x4d4e3c[_0x64ce('0x33')][_0x64ce('0x34')](_0x64ce('0x35'))){_0x266ec2[_0x64ce('0x20')]=qs['limit'](_0x4d4e3c[_0x64ce('0x33')][_0x64ce('0x20')]);_0x266ec2[_0x64ce('0x1e')]=qs[_0x64ce('0x1e')](_0x4d4e3c[_0x64ce('0x33')][_0x64ce('0x1e')]);}return _0x27d4fe[_0x64ce('0x4a')](_0x266ec2);}})['then'](function(_0x1a1386){if(_0x1a1386){return _0x1a1386?{'count':_0xe747bf,'rows':_0x1a1386}:null;}})[_0x64ce('0x24')](respondWithResult(_0x12cde5,null))[_0x64ce('0x3f')](handleError(_0x12cde5,null));};exports[_0x64ce('0x4b')]=function(_0x4f594d,_0x3c4897,_0x2ad20b){var _0x492d88={};var _0x4415ff={};var _0xe42d2f;var _0x26b859;return db[_0x64ce('0x2a')][_0x64ce('0x49')]({'where':{'id':_0x4f594d[_0x64ce('0x41')]['id']}})[_0x64ce('0x24')](handleEntityNotFound(_0x3c4897,null))['then'](function(_0x360f6e){if(_0x360f6e){_0xe42d2f=_0x360f6e;_0x4415ff['model']=_['keys'](db['SalesforceField'][_0x64ce('0x2b')]);_0x4415ff[_0x64ce('0x33')]=_[_0x64ce('0x2f')](_0x4f594d[_0x64ce('0x33')]);_0x4415ff['filters']=_[_0x64ce('0x42')](_0x4415ff['model'],_0x4415ff['query']);_0x492d88[_0x64ce('0x31')]=_[_0x64ce('0x42')](_0x4415ff[_0x64ce('0x2e')],qs['fields'](_0x4f594d['query'][_0x64ce('0x32')]));_0x492d88['attributes']=_0x492d88[_0x64ce('0x31')][_0x64ce('0x43')]?_0x492d88[_0x64ce('0x31')]:_0x4415ff[_0x64ce('0x2e')];_0x492d88[_0x64ce('0x36')]=qs[_0x64ce('0x37')](_0x4f594d[_0x64ce('0x33')][_0x64ce('0x37')]);_0x492d88[_0x64ce('0x38')]=qs[_0x64ce('0x30')](_['pick'](_0x4f594d[_0x64ce('0x33')],_0x4415ff[_0x64ce('0x30')]));if(_0x4f594d[_0x64ce('0x33')][_0x64ce('0x3b')]){_0x492d88[_0x64ce('0x38')]=_[_0x64ce('0x3a')](_0x492d88[_0x64ce('0x38')],{'$or':_[_0x64ce('0x29')](_0x492d88[_0x64ce('0x31')],function(_0x27feb3){var _0x2fd593={};_0x2fd593[_0x27feb3]={'$like':'%'+_0x4f594d['query']['filter']+'%'};return _0x2fd593;})});}_0x492d88=_['merge']({},_0x492d88,_0x4f594d[_0x64ce('0x44')]);return _0xe42d2f[_0x64ce('0x4b')](_0x492d88);}})[_0x64ce('0x24')](function(_0x5e850b){if(_0x5e850b){_0x26b859=_0x5e850b[_0x64ce('0x43')];if(!_0x4f594d['query'][_0x64ce('0x34')]('nolimit')){_0x492d88[_0x64ce('0x20')]=qs['limit'](_0x4f594d[_0x64ce('0x33')]['limit']);_0x492d88['offset']=qs[_0x64ce('0x1e')](_0x4f594d[_0x64ce('0x33')][_0x64ce('0x1e')]);}return _0xe42d2f[_0x64ce('0x4b')](_0x492d88);}})[_0x64ce('0x24')](function(_0xb0e1a2){if(_0xb0e1a2){return _0xb0e1a2?{'count':_0x26b859,'rows':_0xb0e1a2}:null;}})['then'](respondWithResult(_0x3c4897,null))[_0x64ce('0x3f')](handleError(_0x3c4897,null));};exports[_0x64ce('0x4c')]=function(_0x2f0fd8,_0x1d1f2a,_0x3c751e){var _0x580fc0={};var _0xa7ec2d={};var _0x5ecee3;var _0x4f4105;return db[_0x64ce('0x2a')]['findOne']({'where':{'id':_0x2f0fd8['params']['id']}})[_0x64ce('0x24')](handleEntityNotFound(_0x1d1f2a,null))[_0x64ce('0x24')](function(_0x40f67e){if(_0x40f67e){_0x5ecee3=_0x40f67e;_0xa7ec2d[_0x64ce('0x2e')]=_[_0x64ce('0x2f')](db[_0x64ce('0x4d')][_0x64ce('0x2b')]);_0xa7ec2d[_0x64ce('0x33')]=_[_0x64ce('0x2f')](_0x2f0fd8[_0x64ce('0x33')]);_0xa7ec2d[_0x64ce('0x30')]=_[_0x64ce('0x42')](_0xa7ec2d[_0x64ce('0x2e')],_0xa7ec2d[_0x64ce('0x33')]);_0x580fc0[_0x64ce('0x31')]=_['intersection'](_0xa7ec2d[_0x64ce('0x2e')],qs[_0x64ce('0x32')](_0x2f0fd8[_0x64ce('0x33')][_0x64ce('0x32')]));_0x580fc0[_0x64ce('0x31')]=_0x580fc0[_0x64ce('0x31')][_0x64ce('0x43')]?_0x580fc0[_0x64ce('0x31')]:_0xa7ec2d[_0x64ce('0x2e')];_0x580fc0[_0x64ce('0x36')]=qs[_0x64ce('0x37')](_0x2f0fd8['query']['sort']);_0x580fc0[_0x64ce('0x38')]=qs[_0x64ce('0x30')](_[_0x64ce('0x39')](_0x2f0fd8['query'],_0xa7ec2d[_0x64ce('0x30')]));if(_0x2f0fd8[_0x64ce('0x33')][_0x64ce('0x3b')]){_0x580fc0[_0x64ce('0x38')]=_[_0x64ce('0x3a')](_0x580fc0['where'],{'$or':_[_0x64ce('0x29')](_0x580fc0['attributes'],function(_0x57d6fc){var _0x4674a9={};_0x4674a9[_0x57d6fc]={'$like':'%'+_0x2f0fd8[_0x64ce('0x33')][_0x64ce('0x3b')]+'%'};return _0x4674a9;})});}_0x580fc0=_[_0x64ce('0x3a')]({},_0x580fc0,_0x2f0fd8[_0x64ce('0x44')]);return _0x5ecee3[_0x64ce('0x4c')](_0x580fc0);}})[_0x64ce('0x24')](function(_0x4f6b93){if(_0x4f6b93){_0x4f4105=_0x4f6b93[_0x64ce('0x43')];if(!_0x2f0fd8[_0x64ce('0x33')]['hasOwnProperty'](_0x64ce('0x35'))){_0x580fc0['limit']=qs[_0x64ce('0x20')](_0x2f0fd8[_0x64ce('0x33')]['limit']);_0x580fc0[_0x64ce('0x1e')]=qs[_0x64ce('0x1e')](_0x2f0fd8['query'][_0x64ce('0x1e')]);}return _0x5ecee3[_0x64ce('0x4c')](_0x580fc0);}})['then'](function(_0x5cb403){if(_0x5cb403){return _0x5cb403?{'count':_0x4f4105,'rows':_0x5cb403}:null;}})['then'](respondWithResult(_0x1d1f2a,null))[_0x64ce('0x3f')](handleError(_0x1d1f2a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 6d54786..f11beb5 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 _0xfe9f=['../../config/environment','./intSalesforceConfiguration.attributes','exports','int_salesforce_configurations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3f001b,_0x49b405){var _0x45c596=function(_0x8bde5a){while(--_0x8bde5a){_0x3f001b['push'](_0x3f001b['shift']());}};_0x45c596(++_0x49b405);}(_0xfe9f,0x13a));var _0xffe9=function(_0x39bb1c,_0x32dc1d){_0x39bb1c=_0x39bb1c-0x0;var _0x538669=_0xfe9f[_0x39bb1c];return _0x538669;};'use strict';var _=require(_0xffe9('0x0'));var util=require('util');var logger=require(_0xffe9('0x1'))('api');var moment=require(_0xffe9('0x2'));var BPromise=require(_0xffe9('0x3'));var rp=require(_0xffe9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffe9('0x5'));var config=require(_0xffe9('0x6'));var attributes=require(_0xffe9('0x7'));module[_0xffe9('0x8')]=function(_0x2c53b7,_0x337908){return _0x2c53b7['define']('SalesforceConfiguration',attributes,{'tableName':_0xffe9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc30=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xbc30,0xc8));var _0x0bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc30[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0bc3('0x0'));var util=require('util');var logger=require(_0x0bc3('0x1'))('api');var moment=require(_0x0bc3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bc3('0x3'));var rimraf=require(_0x0bc3('0x4'));var config=require(_0x0bc3('0x5'));var attributes=require(_0x0bc3('0x6'));module[_0x0bc3('0x7')]=function(_0x245742,_0x3e5dcd){return _0x245742[_0x0bc3('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x0bc3('0x9'),'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 8a1a55e..be91772 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 _0x5870=['request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xa5227,_0x58cf43){var _0x450d7a=function(_0x3f6190){while(--_0x3f6190){_0xa5227['push'](_0xa5227['shift']());}};_0x450d7a(++_0x58cf43);}(_0x5870,0x180));var _0x0587=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5870[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x0587('0x0'));var util=require(_0x0587('0x1'));var moment=require(_0x0587('0x2'));var BPromise=require(_0x0587('0x3'));var rs=require(_0x0587('0x4'));var fs=require('fs');var Redis=require(_0x0587('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0587('0x6'));var logger=require(_0x0587('0x7'))(_0x0587('0x8'));var config=require(_0x0587('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0587('0xa')][_0x0587('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27a603,_0x184a13,_0xe7713){return new BPromise(function(_0x312106,_0x1fedfa){return client[_0x0587('0xc')](_0x27a603,_0xe7713)[_0x0587('0xd')](function(_0x19980c){logger['info'](_0x0587('0xe'),_0x184a13,_0x0587('0xf'));logger['debug'](_0x0587('0x10'),_0x184a13,_0x0587('0xf'),JSON[_0x0587('0x11')](_0x19980c));if(_0x19980c[_0x0587('0x12')]){if(_0x19980c[_0x0587('0x12')][_0x0587('0x13')]===0x1f4){logger[_0x0587('0x12')](_0x0587('0xe'),_0x184a13,_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);return _0x1fedfa(_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);}logger[_0x0587('0x12')](_0x0587('0xe'),_0x184a13,_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);return _0x312106(_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);}else{logger['info'](_0x0587('0xe'),_0x184a13,_0x0587('0xf'));_0x312106(_0x19980c[_0x0587('0x15')][_0x0587('0x14')]);}})['catch'](function(_0x1b9d10){logger['error'](_0x0587('0xe'),_0x184a13,_0x1b9d10);_0x1fedfa(_0x1b9d10);});});} \ No newline at end of file +var _0x616f=['http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xe9d651,_0x3b094a){var _0x809c52=function(_0x1cf692){while(--_0x1cf692){_0xe9d651['push'](_0xe9d651['shift']());}};_0x809c52(++_0x3b094a);}(_0x616f,0x1f0));var _0xf616=function(_0x130209,_0x2cc129){_0x130209=_0x130209-0x0;var _0x155fb7=_0x616f[_0x130209];return _0x155fb7;};'use strict';var _=require(_0xf616('0x0'));var util=require(_0xf616('0x1'));var moment=require(_0xf616('0x2'));var BPromise=require(_0xf616('0x3'));var rs=require(_0xf616('0x4'));var fs=require('fs');var Redis=require(_0xf616('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf616('0x6'));var logger=require(_0xf616('0x7'))(_0xf616('0x8'));var config=require(_0xf616('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf616('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2484bb,_0x1bc68c,_0x210e27){return new BPromise(function(_0x36fd1c,_0x1b56f5){return client[_0xf616('0xb')](_0x2484bb,_0x210e27)[_0xf616('0xc')](function(_0x50ee72){logger[_0xf616('0xd')](_0xf616('0xe'),_0x1bc68c,'request\x20sent');logger[_0xf616('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1bc68c,_0xf616('0x10'),JSON[_0xf616('0x11')](_0x50ee72));if(_0x50ee72['error']){if(_0x50ee72['error'][_0xf616('0x12')]===0x1f4){logger[_0xf616('0x13')](_0xf616('0xe'),_0x1bc68c,_0x50ee72[_0xf616('0x13')][_0xf616('0x14')]);return _0x1b56f5(_0x50ee72[_0xf616('0x13')][_0xf616('0x14')]);}logger[_0xf616('0x13')](_0xf616('0xe'),_0x1bc68c,_0x50ee72[_0xf616('0x13')][_0xf616('0x14')]);return _0x36fd1c(_0x50ee72[_0xf616('0x13')][_0xf616('0x14')]);}else{logger[_0xf616('0xd')](_0xf616('0xe'),_0x1bc68c,_0xf616('0x10'));_0x36fd1c(_0x50ee72[_0xf616('0x15')]['message']);}})['catch'](function(_0x1fa4d9){logger[_0xf616('0x13')](_0xf616('0xe'),_0x1bc68c,_0x1fa4d9);_0x1b56f5(_0x1fa4d9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index a7edfe1..4ec68d6 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 _0xc9e3=['get','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated'];(function(_0xdbd240,_0x288e71){var _0x50d6aa=function(_0x402219){while(--_0x402219){_0xdbd240['push'](_0xdbd240['shift']());}};_0x50d6aa(++_0x288e71);}(_0xc9e3,0x81));var _0x3c9e=function(_0x2f6a89,_0x41b125){_0x2f6a89=_0x2f6a89-0x0;var _0x501132=_0xc9e3[_0x2f6a89];return _0x501132;};'use strict';var multer=require(_0x3c9e('0x0'));var util=require(_0x3c9e('0x1'));var path=require(_0x3c9e('0x2'));var timeout=require(_0x3c9e('0x3'));var express=require('express');var router=express[_0x3c9e('0x4')]();var fs_extra=require(_0x3c9e('0x5'));var auth=require(_0x3c9e('0x6'));var interaction=require(_0x3c9e('0x7'));var config=require(_0x3c9e('0x8'));var controller=require(_0x3c9e('0x9'));router['get']('/',auth[_0x3c9e('0xa')](),controller['index']);router[_0x3c9e('0xb')](_0x3c9e('0xc'),auth[_0x3c9e('0xa')](),controller[_0x3c9e('0xd')]);router[_0x3c9e('0xe')]('/',auth[_0x3c9e('0xa')](),controller[_0x3c9e('0xf')]);router[_0x3c9e('0x10')](_0x3c9e('0xc'),auth['isAuthenticated'](),controller[_0x3c9e('0x11')]);router[_0x3c9e('0x12')](_0x3c9e('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3c9e('0x13')]=router; \ No newline at end of file +var _0x0c44=['create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','/:id','isAuthenticated','show','post'];(function(_0x1f782d,_0x5906b8){var _0x228cce=function(_0x3036cc){while(--_0x3036cc){_0x1f782d['push'](_0x1f782d['shift']());}};_0x228cce(++_0x5906b8);}(_0x0c44,0x1d9));var _0x40c4=function(_0x59d22d,_0xafcff7){_0x59d22d=_0x59d22d-0x0;var _0x44b1e2=_0x0c44[_0x59d22d];return _0x44b1e2;};'use strict';var multer=require(_0x40c4('0x0'));var util=require(_0x40c4('0x1'));var path=require('path');var timeout=require(_0x40c4('0x2'));var express=require('express');var router=express[_0x40c4('0x3')]();var fs_extra=require(_0x40c4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x40c4('0x5'));var config=require(_0x40c4('0x6'));var controller=require(_0x40c4('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x40c4('0x8')](_0x40c4('0x9'),auth[_0x40c4('0xa')](),controller[_0x40c4('0xb')]);router[_0x40c4('0xc')]('/',auth['isAuthenticated'](),controller[_0x40c4('0xd')]);router['put'](_0x40c4('0x9'),auth[_0x40c4('0xa')](),controller[_0x40c4('0xe')]);router[_0x40c4('0xf')](_0x40c4('0x9'),auth[_0x40c4('0xa')](),controller[_0x40c4('0x10')]);module[_0x40c4('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 7c7416f..f49c670 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 _0x8b77=['string','variable','customVariable','keyValue','STRING','ENUM','exports'];(function(_0x24d560,_0x2e0e7b){var _0x18f7b3=function(_0x564a93){while(--_0x564a93){_0x24d560['push'](_0x24d560['shift']());}};_0x18f7b3(++_0x2e0e7b);}(_0x8b77,0x110));var _0x78b7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8b77[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x78b7('0x0')]={'type':{'type':Sequelize['ENUM'](_0x78b7('0x1'),_0x78b7('0x2'),_0x78b7('0x3'),_0x78b7('0x4'),'picklist'),'defaultValue':_0x78b7('0x1')},'content':{'type':Sequelize[_0x78b7('0x5')]},'key':{'type':Sequelize[_0x78b7('0x5')]},'keyType':{'type':Sequelize[_0x78b7('0x6')](_0x78b7('0x1'),_0x78b7('0x2'),_0x78b7('0x3'))},'keyContent':{'type':Sequelize[_0x78b7('0x5')]},'idField':{'type':Sequelize[_0x78b7('0x5')]},'variableName':{'type':Sequelize[_0x78b7('0x5')]}}; \ No newline at end of file +var _0x6261=['keyValue','picklist','STRING','ENUM','string','variable','customVariable'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x6261,0x100));var _0x1626=function(_0x14d3c0,_0x57ec6f){_0x14d3c0=_0x14d3c0-0x0;var _0x24199f=_0x6261[_0x14d3c0];return _0x24199f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x1626('0x0'),_0x1626('0x1'),_0x1626('0x2'),_0x1626('0x3'),_0x1626('0x4')),'defaultValue':_0x1626('0x0')},'content':{'type':Sequelize[_0x1626('0x5')]},'key':{'type':Sequelize[_0x1626('0x5')]},'keyType':{'type':Sequelize[_0x1626('0x6')](_0x1626('0x0'),_0x1626('0x1'),_0x1626('0x2'))},'keyContent':{'type':Sequelize[_0x1626('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3710919..2e157b3 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 _0x050c=['catch','show','keys','rawAttributes','includeAll','create','body','params','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceField','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','include','rows'];(function(_0x39fd37,_0x4bce58){var _0x3a2086=function(_0x372a58){while(--_0x372a58){_0x39fd37['push'](_0x39fd37['shift']());}};_0x3a2086(++_0x4bce58);}(_0x050c,0x185));var _0xc050=function(_0x27eda2,_0x678082){_0x27eda2=_0x27eda2-0x0;var _0x373fd6=_0x050c[_0x27eda2];return _0x373fd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc050('0x0'));var zipdir=require(_0xc050('0x1'));var jsonpatch=require(_0xc050('0x2'));var rp=require(_0xc050('0x3'));var moment=require(_0xc050('0x4'));var BPromise=require(_0xc050('0x5'));var Mustache=require(_0xc050('0x6'));var util=require('util');var path=require(_0xc050('0x7'));var sox=require(_0xc050('0x8'));var csv=require(_0xc050('0x9'));var ejs=require(_0xc050('0xa'));var fs=require('fs');var fs_extra=require(_0xc050('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc050('0xc'));var jsforce=require(_0xc050('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc050('0x9'));var querystring=require(_0xc050('0xe'));var Papa=require(_0xc050('0xf'));var Redis=require(_0xc050('0x10'));var authService=require(_0xc050('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc050('0x12'));var hardwareService=require(_0xc050('0x13'));var logger=require(_0xc050('0x14'))(_0xc050('0x15'));var utils=require(_0xc050('0x16'));var config=require(_0xc050('0x17'));var licenseUtil=require(_0xc050('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39bfb5,_0x13fef3){_0x13fef3=_0x13fef3||0xcc;return function(_0x582a51){if(_0x582a51){return _0x39bfb5[_0xc050('0x19')](_0x13fef3);}return _0x39bfb5['status'](_0x13fef3)['end']();};}function respondWithResult(_0x5b6f23,_0x3c6527){_0x3c6527=_0x3c6527||0xc8;return function(_0x42da14){if(_0x42da14){return _0x5b6f23[_0xc050('0x1a')](_0x3c6527)[_0xc050('0x1b')](_0x42da14);}};}function respondWithFilteredResult(_0x720883,_0x14b198){return function(_0x796987){if(_0x796987){var _0x1196ad=typeof _0x14b198[_0xc050('0x1c')]===_0xc050('0x1d')&&typeof _0x14b198[_0xc050('0x1e')]==='undefined';var _0x429f61=_0x796987[_0xc050('0x1f')];var _0x51f0bb=_0x1196ad?0x0:_0x14b198[_0xc050('0x1c')];var _0x21bbc1=_0x1196ad?_0x796987[_0xc050('0x1f')]:_0x14b198['offset']+_0x14b198[_0xc050('0x1e')];var _0x5beb20;if(_0x21bbc1>=_0x429f61){_0x21bbc1=_0x429f61;_0x5beb20=0xc8;}else{_0x5beb20=0xce;}_0x720883['status'](_0x5beb20);return _0x720883[_0xc050('0x20')](_0xc050('0x21'),_0x51f0bb+'-'+_0x21bbc1+'/'+_0x429f61)[_0xc050('0x1b')](_0x796987);}return null;};}function patchUpdates(_0xf85f1){return function(_0x3bc00b){try{jsonpatch[_0xc050('0x22')](_0x3bc00b,_0xf85f1,!![]);}catch(_0x1073b7){return BPromise[_0xc050('0x23')](_0x1073b7);}return _0x3bc00b[_0xc050('0x24')]();};}function saveUpdates(_0x4befbb,_0x315299){return function(_0x2b3d2f){if(_0x2b3d2f){return _0x2b3d2f[_0xc050('0x25')](_0x4befbb)[_0xc050('0x26')](function(_0x66ee25){return _0x66ee25;});}return null;};}function removeEntity(_0x4e62dd,_0x1ddbee){return function(_0x3cf09a){if(_0x3cf09a){return _0x3cf09a[_0xc050('0x27')]()[_0xc050('0x26')](function(){_0x4e62dd[_0xc050('0x1a')](0xcc)[_0xc050('0x28')]();});}};}function handleEntityNotFound(_0x9a26ed,_0x38e7d0){return function(_0x2052fa){if(!_0x2052fa){_0x9a26ed['sendStatus'](0x194);}return _0x2052fa;};}function handleError(_0x2d4d07,_0x32195a){_0x32195a=_0x32195a||0x1f4;return function(_0x5d767a){logger[_0xc050('0x29')](_0x5d767a[_0xc050('0x2a')]);if(_0x5d767a[_0xc050('0x2b')]){delete _0x5d767a[_0xc050('0x2b')];}_0x2d4d07[_0xc050('0x1a')](_0x32195a)[_0xc050('0x2c')](_0x5d767a);};}exports[_0xc050('0x2d')]=function(_0x95dff7,_0x3a4140){var _0x222dab={},_0x53c5ff={},_0x3c47fd={'count':0x0,'rows':[]};var _0x32812d=_[_0xc050('0x2e')](db[_0xc050('0x2f')]['rawAttributes'],function(_0x20873f){return{'name':_0x20873f[_0xc050('0x30')],'type':_0x20873f[_0xc050('0x31')][_0xc050('0x32')]};});_0x53c5ff['model']=_[_0xc050('0x2e')](_0x32812d,_0xc050('0x2b'));_0x53c5ff['query']=_['keys'](_0x95dff7[_0xc050('0x33')]);_0x53c5ff[_0xc050('0x34')]=_['intersection'](_0x53c5ff[_0xc050('0x35')],_0x53c5ff[_0xc050('0x33')]);_0x222dab[_0xc050('0x36')]=_[_0xc050('0x37')](_0x53c5ff['model'],qs[_0xc050('0x38')](_0x95dff7[_0xc050('0x33')][_0xc050('0x38')]));_0x222dab[_0xc050('0x36')]=_0x222dab[_0xc050('0x36')][_0xc050('0x39')]?_0x222dab[_0xc050('0x36')]:_0x53c5ff[_0xc050('0x35')];if(!_0x95dff7['query']['hasOwnProperty']('nolimit')){_0x222dab[_0xc050('0x1e')]=qs[_0xc050('0x1e')](_0x95dff7[_0xc050('0x33')][_0xc050('0x1e')]);_0x222dab[_0xc050('0x1c')]=qs[_0xc050('0x1c')](_0x95dff7[_0xc050('0x33')]['offset']);}_0x222dab[_0xc050('0x3a')]=qs['sort'](_0x95dff7['query'][_0xc050('0x3b')]);_0x222dab[_0xc050('0x3c')]=qs['filters'](_['pick'](_0x95dff7[_0xc050('0x33')],_0x53c5ff[_0xc050('0x34')]),_0x32812d);if(_0x95dff7['query'][_0xc050('0x3d')]){_0x222dab[_0xc050('0x3c')]=_[_0xc050('0x3e')](_0x222dab[_0xc050('0x3c')],{'$or':_[_0xc050('0x2e')](_0x32812d,function(_0x775b6d){if(_0x775b6d[_0xc050('0x31')]!==_0xc050('0x3f')){var _0x1181be={};_0x1181be[_0x775b6d[_0xc050('0x2b')]]={'$like':'%'+_0x95dff7[_0xc050('0x33')][_0xc050('0x3d')]+'%'};return _0x1181be;}})});}_0x222dab=_[_0xc050('0x3e')]({},_0x222dab,_0x95dff7[_0xc050('0x40')]);var _0x4ed97b={'where':_0x222dab['where']};return db[_0xc050('0x2f')][_0xc050('0x1f')](_0x4ed97b)[_0xc050('0x26')](function(_0x1b118f){_0x3c47fd['count']=_0x1b118f;if(_0x95dff7[_0xc050('0x33')]['includeAll']){_0x222dab[_0xc050('0x41')]=[{'all':!![]}];}return db[_0xc050('0x2f')]['findAll'](_0x222dab);})['then'](function(_0xce907e){_0x3c47fd[_0xc050('0x42')]=_0xce907e;return _0x3c47fd;})[_0xc050('0x26')](respondWithFilteredResult(_0x3a4140,_0x222dab))[_0xc050('0x43')](handleError(_0x3a4140,null));};exports[_0xc050('0x44')]=function(_0x337ed2,_0x3b3e76){var _0x38d8d9={'raw':!![],'where':{'id':_0x337ed2['params']['id']}},_0x37c87c={};_0x37c87c[_0xc050('0x35')]=_[_0xc050('0x45')](db[_0xc050('0x2f')][_0xc050('0x46')]);_0x37c87c[_0xc050('0x33')]=_[_0xc050('0x45')](_0x337ed2[_0xc050('0x33')]);_0x37c87c['filters']=_[_0xc050('0x37')](_0x37c87c['model'],_0x37c87c[_0xc050('0x33')]);_0x38d8d9[_0xc050('0x36')]=_[_0xc050('0x37')](_0x37c87c[_0xc050('0x35')],qs[_0xc050('0x38')](_0x337ed2[_0xc050('0x33')]['fields']));_0x38d8d9[_0xc050('0x36')]=_0x38d8d9['attributes']['length']?_0x38d8d9[_0xc050('0x36')]:_0x37c87c['model'];if(_0x337ed2['query'][_0xc050('0x47')]){_0x38d8d9['include']=[{'all':!![]}];}_0x38d8d9=_[_0xc050('0x3e')]({},_0x38d8d9,_0x337ed2[_0xc050('0x40')]);return db[_0xc050('0x2f')]['find'](_0x38d8d9)[_0xc050('0x26')](handleEntityNotFound(_0x3b3e76,null))[_0xc050('0x26')](respondWithResult(_0x3b3e76,null))[_0xc050('0x43')](handleError(_0x3b3e76,null));};exports[_0xc050('0x48')]=function(_0x5ed389,_0x2f15c7){return db['SalesforceField'][_0xc050('0x48')](_0x5ed389[_0xc050('0x49')],{})[_0xc050('0x26')](respondWithResult(_0x2f15c7,0xc9))[_0xc050('0x43')](handleError(_0x2f15c7,null));};exports[_0xc050('0x25')]=function(_0x36c25a,_0x310255){if(_0x36c25a[_0xc050('0x49')]['id']){delete _0x36c25a[_0xc050('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x36c25a[_0xc050('0x4a')]['id']}})['then'](handleEntityNotFound(_0x310255,null))['then'](saveUpdates(_0x36c25a[_0xc050('0x49')],null))['then'](respondWithResult(_0x310255,null))[_0xc050('0x43')](handleError(_0x310255,null));};exports['destroy']=function(_0x1f9d03,_0x2d1d23){return db['SalesforceField'][_0xc050('0x4b')]({'where':{'id':_0x1f9d03[_0xc050('0x4a')]['id']}})[_0xc050('0x26')](handleEntityNotFound(_0x2d1d23,null))['then'](removeEntity(_0x2d1d23,null))[_0xc050('0x43')](handleError(_0x2d1d23,null));}; \ No newline at end of file +var _0xb057=['rows','catch','find','create','body','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll'];(function(_0x91e24e,_0x2eddb3){var _0x642ebd=function(_0x4b53c7){while(--_0x4b53c7){_0x91e24e['push'](_0x91e24e['shift']());}};_0x642ebd(++_0x2eddb3);}(_0xb057,0x95));var _0x7b05=function(_0x5a4813,_0x122be0){_0x5a4813=_0x5a4813-0x0;var _0x4c4086=_0xb057[_0x5a4813];return _0x4c4086;};'use strict';var emlformat=require(_0x7b05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b05('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b05('0x2'));var BPromise=require(_0x7b05('0x3'));var Mustache=require('mustache');var util=require(_0x7b05('0x4'));var path=require(_0x7b05('0x5'));var sox=require(_0x7b05('0x6'));var csv=require(_0x7b05('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b05('0x8'));var squel=require(_0x7b05('0x9'));var crypto=require(_0x7b05('0xa'));var jsforce=require(_0x7b05('0xb'));var deskjs=require(_0x7b05('0xc'));var toCsv=require(_0x7b05('0x7'));var querystring=require('querystring');var Papa=require(_0x7b05('0xd'));var Redis=require('ioredis');var authService=require(_0x7b05('0xe'));var qs=require(_0x7b05('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b05('0x10'));var logger=require(_0x7b05('0x11'))(_0x7b05('0x12'));var utils=require(_0x7b05('0x13'));var config=require(_0x7b05('0x14'));var licenseUtil=require(_0x7b05('0x15'));var db=require(_0x7b05('0x16'))['db'];function respondWithStatusCode(_0x57a281,_0x1fe309){_0x1fe309=_0x1fe309||0xcc;return function(_0x4475d5){if(_0x4475d5){return _0x57a281[_0x7b05('0x17')](_0x1fe309);}return _0x57a281[_0x7b05('0x18')](_0x1fe309)['end']();};}function respondWithResult(_0x1afdac,_0x57b9fd){_0x57b9fd=_0x57b9fd||0xc8;return function(_0x116e57){if(_0x116e57){return _0x1afdac[_0x7b05('0x18')](_0x57b9fd)[_0x7b05('0x19')](_0x116e57);}};}function respondWithFilteredResult(_0x5b8334,_0x1d65a9){return function(_0x3f509e){if(_0x3f509e){var _0x1e6346=typeof _0x1d65a9[_0x7b05('0x1a')]===_0x7b05('0x1b')&&typeof _0x1d65a9[_0x7b05('0x1c')]===_0x7b05('0x1b');var _0x874870=_0x3f509e[_0x7b05('0x1d')];var _0x4616d4=_0x1e6346?0x0:_0x1d65a9[_0x7b05('0x1a')];var _0xe695ab=_0x1e6346?_0x3f509e['count']:_0x1d65a9[_0x7b05('0x1a')]+_0x1d65a9[_0x7b05('0x1c')];var _0x507824;if(_0xe695ab>=_0x874870){_0xe695ab=_0x874870;_0x507824=0xc8;}else{_0x507824=0xce;}_0x5b8334[_0x7b05('0x18')](_0x507824);return _0x5b8334['set'](_0x7b05('0x1e'),_0x4616d4+'-'+_0xe695ab+'/'+_0x874870)[_0x7b05('0x19')](_0x3f509e);}return null;};}function patchUpdates(_0xc20784){return function(_0x4d1872){try{jsonpatch[_0x7b05('0x1f')](_0x4d1872,_0xc20784,!![]);}catch(_0x2a5e84){return BPromise[_0x7b05('0x20')](_0x2a5e84);}return _0x4d1872[_0x7b05('0x21')]();};}function saveUpdates(_0x529526,_0x3fdf77){return function(_0x4a4946){if(_0x4a4946){return _0x4a4946[_0x7b05('0x22')](_0x529526)[_0x7b05('0x23')](function(_0x294c93){return _0x294c93;});}return null;};}function removeEntity(_0x55e7e4,_0x3b337b){return function(_0x4e98f4){if(_0x4e98f4){return _0x4e98f4[_0x7b05('0x24')]()[_0x7b05('0x23')](function(){_0x55e7e4[_0x7b05('0x18')](0xcc)[_0x7b05('0x25')]();});}};}function handleEntityNotFound(_0x32ad0f,_0x2c42f0){return function(_0x15002e){if(!_0x15002e){_0x32ad0f[_0x7b05('0x17')](0x194);}return _0x15002e;};}function handleError(_0x476db3,_0x78552d){_0x78552d=_0x78552d||0x1f4;return function(_0x2e8436){logger[_0x7b05('0x26')](_0x2e8436['stack']);if(_0x2e8436['name']){delete _0x2e8436[_0x7b05('0x27')];}_0x476db3[_0x7b05('0x18')](_0x78552d)[_0x7b05('0x28')](_0x2e8436);};}exports[_0x7b05('0x29')]=function(_0x179d36,_0x51bce5){var _0x56df0e={},_0x483373={},_0x2a7a09={'count':0x0,'rows':[]};var _0x3f5f3a=_['map'](db[_0x7b05('0x2a')][_0x7b05('0x2b')],function(_0x480945){return{'name':_0x480945[_0x7b05('0x2c')],'type':_0x480945[_0x7b05('0x2d')][_0x7b05('0x2e')]};});_0x483373[_0x7b05('0x2f')]=_['map'](_0x3f5f3a,_0x7b05('0x27'));_0x483373['query']=_[_0x7b05('0x30')](_0x179d36[_0x7b05('0x31')]);_0x483373[_0x7b05('0x32')]=_[_0x7b05('0x33')](_0x483373[_0x7b05('0x2f')],_0x483373['query']);_0x56df0e['attributes']=_[_0x7b05('0x33')](_0x483373[_0x7b05('0x2f')],qs[_0x7b05('0x34')](_0x179d36[_0x7b05('0x31')]['fields']));_0x56df0e['attributes']=_0x56df0e[_0x7b05('0x35')][_0x7b05('0x36')]?_0x56df0e[_0x7b05('0x35')]:_0x483373[_0x7b05('0x2f')];if(!_0x179d36[_0x7b05('0x31')]['hasOwnProperty'](_0x7b05('0x37'))){_0x56df0e['limit']=qs[_0x7b05('0x1c')](_0x179d36[_0x7b05('0x31')]['limit']);_0x56df0e[_0x7b05('0x1a')]=qs[_0x7b05('0x1a')](_0x179d36['query'][_0x7b05('0x1a')]);}_0x56df0e[_0x7b05('0x38')]=qs[_0x7b05('0x39')](_0x179d36[_0x7b05('0x31')][_0x7b05('0x39')]);_0x56df0e[_0x7b05('0x3a')]=qs['filters'](_[_0x7b05('0x3b')](_0x179d36[_0x7b05('0x31')],_0x483373[_0x7b05('0x32')]),_0x3f5f3a);if(_0x179d36[_0x7b05('0x31')][_0x7b05('0x3c')]){_0x56df0e[_0x7b05('0x3a')]=_[_0x7b05('0x3d')](_0x56df0e[_0x7b05('0x3a')],{'$or':_[_0x7b05('0x3e')](_0x3f5f3a,function(_0x48cbe4){if(_0x48cbe4[_0x7b05('0x2d')]!=='VIRTUAL'){var _0x23a7b0={};_0x23a7b0[_0x48cbe4[_0x7b05('0x27')]]={'$like':'%'+_0x179d36[_0x7b05('0x31')][_0x7b05('0x3c')]+'%'};return _0x23a7b0;}})});}_0x56df0e=_[_0x7b05('0x3d')]({},_0x56df0e,_0x179d36[_0x7b05('0x3f')]);var _0x8b91be={'where':_0x56df0e[_0x7b05('0x3a')]};return db[_0x7b05('0x2a')][_0x7b05('0x1d')](_0x8b91be)[_0x7b05('0x23')](function(_0x4f7330){_0x2a7a09[_0x7b05('0x1d')]=_0x4f7330;if(_0x179d36[_0x7b05('0x31')][_0x7b05('0x40')]){_0x56df0e[_0x7b05('0x41')]=[{'all':!![]}];}return db[_0x7b05('0x2a')][_0x7b05('0x42')](_0x56df0e);})[_0x7b05('0x23')](function(_0x33ee92){_0x2a7a09[_0x7b05('0x43')]=_0x33ee92;return _0x2a7a09;})[_0x7b05('0x23')](respondWithFilteredResult(_0x51bce5,_0x56df0e))[_0x7b05('0x44')](handleError(_0x51bce5,null));};exports['show']=function(_0x33144e,_0x474bc5){var _0x3fb63c={'raw':!![],'where':{'id':_0x33144e['params']['id']}},_0x26b2fc={};_0x26b2fc['model']=_[_0x7b05('0x30')](db['SalesforceField'][_0x7b05('0x2b')]);_0x26b2fc[_0x7b05('0x31')]=_['keys'](_0x33144e[_0x7b05('0x31')]);_0x26b2fc[_0x7b05('0x32')]=_[_0x7b05('0x33')](_0x26b2fc[_0x7b05('0x2f')],_0x26b2fc[_0x7b05('0x31')]);_0x3fb63c[_0x7b05('0x35')]=_[_0x7b05('0x33')](_0x26b2fc['model'],qs['fields'](_0x33144e[_0x7b05('0x31')][_0x7b05('0x34')]));_0x3fb63c[_0x7b05('0x35')]=_0x3fb63c[_0x7b05('0x35')]['length']?_0x3fb63c[_0x7b05('0x35')]:_0x26b2fc[_0x7b05('0x2f')];if(_0x33144e[_0x7b05('0x31')][_0x7b05('0x40')]){_0x3fb63c[_0x7b05('0x41')]=[{'all':!![]}];}_0x3fb63c=_[_0x7b05('0x3d')]({},_0x3fb63c,_0x33144e[_0x7b05('0x3f')]);return db[_0x7b05('0x2a')][_0x7b05('0x45')](_0x3fb63c)['then'](handleEntityNotFound(_0x474bc5,null))[_0x7b05('0x23')](respondWithResult(_0x474bc5,null))[_0x7b05('0x44')](handleError(_0x474bc5,null));};exports[_0x7b05('0x46')]=function(_0x4d1160,_0x125cf0){return db[_0x7b05('0x2a')][_0x7b05('0x46')](_0x4d1160['body'],{})[_0x7b05('0x23')](respondWithResult(_0x125cf0,0xc9))['catch'](handleError(_0x125cf0,null));};exports[_0x7b05('0x22')]=function(_0x561287,_0x11c273){if(_0x561287[_0x7b05('0x47')]['id']){delete _0x561287[_0x7b05('0x47')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x561287['params']['id']}})[_0x7b05('0x23')](handleEntityNotFound(_0x11c273,null))[_0x7b05('0x23')](saveUpdates(_0x561287[_0x7b05('0x47')],null))[_0x7b05('0x23')](respondWithResult(_0x11c273,null))[_0x7b05('0x44')](handleError(_0x11c273,null));};exports['destroy']=function(_0x1b8f5b,_0x4af7b2){return db[_0x7b05('0x2a')]['find']({'where':{'id':_0x1b8f5b['params']['id']}})[_0x7b05('0x23')](handleEntityNotFound(_0x4af7b2,null))[_0x7b05('0x23')](removeEntity(_0x4af7b2,null))['catch'](handleError(_0x4af7b2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 43fefb5..ae4c01e 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 _0xd750=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','FieldId','lodash'];(function(_0x2b83ff,_0x5a825e){var _0x20a065=function(_0x4c85d5){while(--_0x4c85d5){_0x2b83ff['push'](_0x2b83ff['shift']());}};_0x20a065(++_0x5a825e);}(_0xd750,0x103));var _0x0d75=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0xd750[_0x36da00];return _0x4b72c5;};'use strict';var _=require(_0x0d75('0x0'));var util=require('util');var logger=require(_0x0d75('0x1'))(_0x0d75('0x2'));var moment=require(_0x0d75('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d75('0x4'));var fs=require('fs');var path=require(_0x0d75('0x5'));var rimraf=require(_0x0d75('0x6'));var config=require(_0x0d75('0x7'));var attributes=require(_0x0d75('0x8'));module[_0x0d75('0x9')]=function(_0x3b6f81,_0x5001fd){return _0x3b6f81[_0x0d75('0xa')]('SalesforceField',attributes,{'tableName':_0x0d75('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x0d75('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f97=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3171ef,_0x50dbf9){var _0x248202=function(_0x2ddca7){while(--_0x2ddca7){_0x3171ef['push'](_0x3171ef['shift']());}};_0x248202(++_0x50dbf9);}(_0x3f97,0xf6));var _0x73f9=function(_0x3fae5f,_0x209c3a){_0x3fae5f=_0x3fae5f-0x0;var _0x7e4d7d=_0x3f97[_0x3fae5f];return _0x7e4d7d;};'use strict';var _=require(_0x73f9('0x0'));var util=require(_0x73f9('0x1'));var logger=require(_0x73f9('0x2'))('api');var moment=require(_0x73f9('0x3'));var BPromise=require(_0x73f9('0x4'));var rp=require(_0x73f9('0x5'));var fs=require('fs');var path=require(_0x73f9('0x6'));var rimraf=require(_0x73f9('0x7'));var config=require(_0x73f9('0x8'));var attributes=require(_0x73f9('0x9'));module[_0x73f9('0xa')]=function(_0x1a5f12,_0x48360d){return _0x1a5f12[_0x73f9('0xb')](_0x73f9('0xc'),attributes,{'tableName':_0x73f9('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x73f9('0xe'),'FieldId'],'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 399f469..3700998 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 _0xbc7c=['jayson/promise','client','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x223371,_0x501e73){var _0x2e7f3a=function(_0x3f1294){while(--_0x3f1294){_0x223371['push'](_0x223371['shift']());}};_0x2e7f3a(++_0x501e73);}(_0xbc7c,0x1f0));var _0xcbc7=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xbc7c[_0x1daaa9];return _0x1dd221;};'use strict';var _=require(_0xcbc7('0x0'));var util=require(_0xcbc7('0x1'));var moment=require(_0xcbc7('0x2'));var BPromise=require(_0xcbc7('0x3'));var rs=require(_0xcbc7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbc7('0x6'))(_0xcbc7('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbc7('0x8'));var client=jayson[_0xcbc7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5de767,_0x1627b3,_0x1670a7){return new BPromise(function(_0x2704a0,_0x140fe1){return client[_0xcbc7('0xa')](_0x5de767,_0x1670a7)[_0xcbc7('0xb')](function(_0x229635){logger['info'](_0xcbc7('0xc'),_0x1627b3,_0xcbc7('0xd'));logger['debug'](_0xcbc7('0xe'),_0x1627b3,_0xcbc7('0xd'),JSON[_0xcbc7('0xf')](_0x229635));if(_0x229635[_0xcbc7('0x10')]){if(_0x229635[_0xcbc7('0x10')][_0xcbc7('0x11')]===0x1f4){logger[_0xcbc7('0x10')](_0xcbc7('0xc'),_0x1627b3,_0x229635[_0xcbc7('0x10')]['message']);return _0x140fe1(_0x229635[_0xcbc7('0x10')][_0xcbc7('0x12')]);}logger[_0xcbc7('0x10')](_0xcbc7('0xc'),_0x1627b3,_0x229635[_0xcbc7('0x10')][_0xcbc7('0x12')]);return _0x2704a0(_0x229635[_0xcbc7('0x10')]['message']);}else{logger[_0xcbc7('0x13')](_0xcbc7('0xc'),_0x1627b3,'request\x20sent');_0x2704a0(_0x229635['result']['message']);}})[_0xcbc7('0x14')](function(_0x55b36d){logger['error'](_0xcbc7('0xc'),_0x1627b3,_0x55b36d);_0x140fe1(_0x55b36d);});});} \ No newline at end of file +var _0xbbb6=['request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s'];(function(_0x3dcb7f,_0x1a0c78){var _0x23966d=function(_0x37fc76){while(--_0x37fc76){_0x3dcb7f['push'](_0x3dcb7f['shift']());}};_0x23966d(++_0x1a0c78);}(_0xbbb6,0x70));var _0x6bbb=function(_0x4e0fa4,_0x130453){_0x4e0fa4=_0x4e0fa4-0x0;var _0x19640b=_0xbbb6[_0x4e0fa4];return _0x19640b;};'use strict';var _=require(_0x6bbb('0x0'));var util=require(_0x6bbb('0x1'));var moment=require(_0x6bbb('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bbb('0x3'));var fs=require('fs');var Redis=require(_0x6bbb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bbb('0x5'));var logger=require('../../config/logger')(_0x6bbb('0x6'));var config=require(_0x6bbb('0x7'));var jayson=require(_0x6bbb('0x8'));var client=jayson[_0x6bbb('0x9')][_0x6bbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d6c42,_0x262460,_0x2bfb0a){return new BPromise(function(_0x3f1fc1,_0x4d3062){return client[_0x6bbb('0xb')](_0x5d6c42,_0x2bfb0a)[_0x6bbb('0xc')](function(_0x58fe6b){logger['info'](_0x6bbb('0xd'),_0x262460,_0x6bbb('0xe'));logger['debug'](_0x6bbb('0xf'),_0x262460,_0x6bbb('0xe'),JSON[_0x6bbb('0x10')](_0x58fe6b));if(_0x58fe6b[_0x6bbb('0x11')]){if(_0x58fe6b[_0x6bbb('0x11')]['code']===0x1f4){logger[_0x6bbb('0x11')]('SalesforceField,\x20%s,\x20%s',_0x262460,_0x58fe6b[_0x6bbb('0x11')][_0x6bbb('0x12')]);return _0x4d3062(_0x58fe6b[_0x6bbb('0x11')][_0x6bbb('0x12')]);}logger['error'](_0x6bbb('0xd'),_0x262460,_0x58fe6b[_0x6bbb('0x11')][_0x6bbb('0x12')]);return _0x3f1fc1(_0x58fe6b['error'][_0x6bbb('0x12')]);}else{logger[_0x6bbb('0x13')]('SalesforceField,\x20%s,\x20%s',_0x262460,'request\x20sent');_0x3f1fc1(_0x58fe6b[_0x6bbb('0x14')][_0x6bbb('0x12')]);}})['catch'](function(_0x15c464){logger[_0x6bbb('0x11')]('SalesforceField,\x20%s,\x20%s',_0x262460,_0x15c464);_0x4d3062(_0x15c464);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 738e276..139af42 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 _0x5044=['update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0xfe7a7d,_0x407b42){var _0x5baa5a=function(_0x3cac03){while(--_0x3cac03){_0xfe7a7d['push'](_0xfe7a7d['shift']());}};_0x5baa5a(++_0x407b42);}(_0x5044,0xc8));var _0x4504=function(_0x3aee28,_0x56710a){_0x3aee28=_0x3aee28-0x0;var _0x5b0726=_0x5044[_0x3aee28];return _0x5b0726;};'use strict';var multer=require('multer');var util=require(_0x4504('0x0'));var path=require('path');var timeout=require(_0x4504('0x1'));var express=require(_0x4504('0x2'));var router=express[_0x4504('0x3')]();var fs_extra=require(_0x4504('0x4'));var auth=require(_0x4504('0x5'));var interaction=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var controller=require(_0x4504('0x8'));router['get']('/',auth[_0x4504('0x9')](),controller[_0x4504('0xa')]);router[_0x4504('0xb')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0xd')]);router[_0x4504('0xb')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller['getConfigurations']);router[_0x4504('0xb')]('/:id/fields',auth[_0x4504('0x9')](),controller[_0x4504('0xf')]);router[_0x4504('0x10')]('/',auth[_0x4504('0x9')](),controller[_0x4504('0x11')]);router[_0x4504('0x10')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller[_0x4504('0x12')]);router[_0x4504('0x13')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0x14')]);router['delete'](_0x4504('0xc'),auth[_0x4504('0x9')](),controller['destroy']);module[_0x4504('0x15')]=router; \ No newline at end of file +var _0x4ee2=['post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x4b1629,_0x561638){var _0x5cd450=function(_0x1a008d){while(--_0x1a008d){_0x4b1629['push'](_0x4b1629['shift']());}};_0x5cd450(++_0x561638);}(_0x4ee2,0x140));var _0x24ee=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4ee2[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x24ee('0x0'));var util=require(_0x24ee('0x1'));var path=require(_0x24ee('0x2'));var timeout=require(_0x24ee('0x3'));var express=require(_0x24ee('0x4'));var router=express[_0x24ee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x24ee('0x6'));var interaction=require(_0x24ee('0x7'));var config=require(_0x24ee('0x8'));var controller=require(_0x24ee('0x9'));router[_0x24ee('0xa')]('/',auth['isAuthenticated'](),controller[_0x24ee('0xb')]);router['get']('/:id',auth[_0x24ee('0xc')](),controller[_0x24ee('0xd')]);router[_0x24ee('0xa')](_0x24ee('0xe'),auth[_0x24ee('0xc')](),controller[_0x24ee('0xf')]);router[_0x24ee('0xa')](_0x24ee('0x10'),auth[_0x24ee('0xc')](),controller[_0x24ee('0x11')]);router[_0x24ee('0x12')]('/',auth[_0x24ee('0xc')](),controller[_0x24ee('0x13')]);router[_0x24ee('0x12')]('/:id/configurations',auth[_0x24ee('0xc')](),controller[_0x24ee('0x14')]);router[_0x24ee('0x15')](_0x24ee('0x16'),auth[_0x24ee('0xc')](),controller[_0x24ee('0x17')]);router['delete'](_0x24ee('0x16'),auth[_0x24ee('0xc')](),controller[_0x24ee('0x18')]);module[_0x24ee('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f4738d3..c91c059 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 _0x1ab7=['remoteUri','sequelize','exports','STRING','username'];(function(_0x597aff,_0x2054ac){var _0x55193a=function(_0x22edda){while(--_0x22edda){_0x597aff['push'](_0x597aff['shift']());}};_0x55193a(++_0x2054ac);}(_0x1ab7,0x6a));var _0x71ab=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0x1ab7[_0xcda377];return _0x1c024f;};'use strict';var Sequelize=require(_0x71ab('0x0'));module[_0x71ab('0x1')]={'name':{'type':Sequelize[_0x71ab('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x71ab('0x2')],'unique':_0x71ab('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x71ab('0x2')]},'remoteUri':{'type':Sequelize[_0x71ab('0x2')],'unique':_0x71ab('0x4')},'serverUrl':{'type':Sequelize[_0x71ab('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x59bd=['exports','STRING','username','remoteUri','sequelize'];(function(_0x49b72a,_0xa494ae){var _0x26dd11=function(_0x49704a){while(--_0x49704a){_0x49b72a['push'](_0x49b72a['shift']());}};_0x26dd11(++_0xa494ae);}(_0x59bd,0x112));var _0xd59b=function(_0x4b1380,_0x2120bc){_0x4b1380=_0x4b1380-0x0;var _0x10915f=_0x59bd[_0x4b1380];return _0x10915f;};'use strict';var Sequelize=require(_0xd59b('0x0'));module[_0xd59b('0x1')]={'name':{'type':Sequelize[_0xd59b('0x2')]},'description':{'type':Sequelize[_0xd59b('0x2')]},'username':{'type':Sequelize[_0xd59b('0x2')],'unique':_0xd59b('0x3')},'password':{'type':Sequelize[_0xd59b('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd59b('0x2')],'unique':_0xd59b('0x4')},'serverUrl':{'type':Sequelize[_0xd59b('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index dace65f..e2c604c 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 _0x97be=['TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','incident_state','severity','parent','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','reopened_time','caller_id','short_description','correlation_display','assignment_group','additional_assignee_list','description','calendar_duration','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments','approval','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','label','all','TCL:\x20_object','remove'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x97be,0xc6));var _0xe97b=function(_0x5d1a4b,_0x159c1c){_0x5d1a4b=_0x5d1a4b-0x0;var _0x443d37=_0x97be[_0x5d1a4b];return _0x443d37;};'use strict';var emlformat=require(_0xe97b('0x0'));var rimraf=require(_0xe97b('0x1'));var zipdir=require(_0xe97b('0x2'));var jsonpatch=require(_0xe97b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe97b('0x4'));var Mustache=require('mustache');var util=require(_0xe97b('0x5'));var path=require('path');var sox=require(_0xe97b('0x6'));var csv=require('to-csv');var ejs=require(_0xe97b('0x7'));var fs=require('fs');var fs_extra=require(_0xe97b('0x8'));var _=require(_0xe97b('0x9'));var squel=require('squel');var crypto=require(_0xe97b('0xa'));var jsforce=require(_0xe97b('0xb'));var deskjs=require(_0xe97b('0xc'));var toCsv=require(_0xe97b('0xd'));var querystring=require(_0xe97b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe97b('0xf'));var qs=require(_0xe97b('0x10'));var as=require(_0xe97b('0x11'));var hardwareService=require(_0xe97b('0x12'));var logger=require(_0xe97b('0x13'))('api');var utils=require(_0xe97b('0x14'));var config=require(_0xe97b('0x15'));var licenseUtil=require(_0xe97b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe97b('0x17'));function respondWithStatusCode(_0x3d0ebb,_0x21bba5){_0x21bba5=_0x21bba5||0xcc;return function(_0x1ca77c){if(_0x1ca77c){return _0x3d0ebb['sendStatus'](_0x21bba5);}return _0x3d0ebb[_0xe97b('0x18')](_0x21bba5)[_0xe97b('0x19')]();};}function respondWithResult(_0x163cc4,_0xcc365f){_0xcc365f=_0xcc365f||0xc8;return function(_0x3e08e6){if(_0x3e08e6){return _0x163cc4['status'](_0xcc365f)['json'](_0x3e08e6);}};}function respondWithFilteredResult(_0x5a3170,_0x25bed9){return function(_0x4ceaba){if(_0x4ceaba){var _0x79f207=typeof _0x25bed9[_0xe97b('0x1a')]===_0xe97b('0x1b')&&typeof _0x25bed9[_0xe97b('0x1c')]==='undefined';var _0x30e2b6=_0x4ceaba[_0xe97b('0x1d')];var _0x116ce6=_0x79f207?0x0:_0x25bed9[_0xe97b('0x1a')];var _0x57595f=_0x79f207?_0x4ceaba[_0xe97b('0x1d')]:_0x25bed9[_0xe97b('0x1a')]+_0x25bed9[_0xe97b('0x1c')];var _0x476b38;if(_0x57595f>=_0x30e2b6){_0x57595f=_0x30e2b6;_0x476b38=0xc8;}else{_0x476b38=0xce;}_0x5a3170[_0xe97b('0x18')](_0x476b38);return _0x5a3170[_0xe97b('0x1e')](_0xe97b('0x1f'),_0x116ce6+'-'+_0x57595f+'/'+_0x30e2b6)[_0xe97b('0x20')](_0x4ceaba);}return null;};}function patchUpdates(_0x58ec4f){return function(_0x54c504){try{jsonpatch[_0xe97b('0x21')](_0x54c504,_0x58ec4f,!![]);}catch(_0x193623){return BPromise[_0xe97b('0x22')](_0x193623);}return _0x54c504[_0xe97b('0x23')]();};}function saveUpdates(_0x2afc02,_0x2ab809){return function(_0x329114){if(_0x329114){return _0x329114[_0xe97b('0x24')](_0x2afc02)[_0xe97b('0x25')](function(_0x2dcb23){return _0x2dcb23;});}return null;};}function removeEntity(_0x1333a4,_0x335abd){return function(_0x34103b){if(_0x34103b){return _0x34103b['destroy']()[_0xe97b('0x25')](function(){_0x1333a4['status'](0xcc)[_0xe97b('0x19')]();});}};}function handleEntityNotFound(_0x735d11,_0x19f8c8){return function(_0x34a10f){if(!_0x34a10f){_0x735d11['sendStatus'](0x194);}return _0x34a10f;};}function handleError(_0x55aad9,_0x260577){_0x260577=_0x260577||0x1f4;return function(_0x53642e){logger[_0xe97b('0x26')](_0x53642e[_0xe97b('0x27')]);if(_0x53642e['name']){delete _0x53642e[_0xe97b('0x28')];}_0x55aad9[_0xe97b('0x18')](_0x260577)[_0xe97b('0x29')](_0x53642e);};}exports[_0xe97b('0x2a')]=function(_0x513bd3,_0x282d16){var _0x49e8a4={},_0x44ec72={},_0x48e4fc={'count':0x0,'rows':[]};var _0x55736b=_[_0xe97b('0x2b')](db[_0xe97b('0x2c')][_0xe97b('0x2d')],function(_0x545983){return{'name':_0x545983[_0xe97b('0x2e')],'type':_0x545983[_0xe97b('0x2f')][_0xe97b('0x30')]};});_0x44ec72[_0xe97b('0x31')]=_[_0xe97b('0x2b')](_0x55736b,_0xe97b('0x28'));_0x44ec72[_0xe97b('0x32')]=_['keys'](_0x513bd3['query']);_0x44ec72[_0xe97b('0x33')]=_[_0xe97b('0x34')](_0x44ec72[_0xe97b('0x31')],_0x44ec72[_0xe97b('0x32')]);_0x49e8a4['attributes']=_[_0xe97b('0x34')](_0x44ec72[_0xe97b('0x31')],qs[_0xe97b('0x35')](_0x513bd3['query'][_0xe97b('0x35')]));_0x49e8a4[_0xe97b('0x36')]=_0x49e8a4[_0xe97b('0x36')][_0xe97b('0x37')]?_0x49e8a4[_0xe97b('0x36')]:_0x44ec72[_0xe97b('0x31')];if(!_0x513bd3[_0xe97b('0x32')]['hasOwnProperty']('nolimit')){_0x49e8a4[_0xe97b('0x1c')]=qs[_0xe97b('0x1c')](_0x513bd3[_0xe97b('0x32')][_0xe97b('0x1c')]);_0x49e8a4[_0xe97b('0x1a')]=qs[_0xe97b('0x1a')](_0x513bd3[_0xe97b('0x32')]['offset']);}_0x49e8a4[_0xe97b('0x38')]=qs[_0xe97b('0x39')](_0x513bd3[_0xe97b('0x32')][_0xe97b('0x39')]);_0x49e8a4[_0xe97b('0x3a')]=qs[_0xe97b('0x33')](_[_0xe97b('0x3b')](_0x513bd3[_0xe97b('0x32')],_0x44ec72[_0xe97b('0x33')]),_0x55736b);if(_0x513bd3[_0xe97b('0x32')][_0xe97b('0x3c')]){_0x49e8a4[_0xe97b('0x3a')]=_[_0xe97b('0x3d')](_0x49e8a4[_0xe97b('0x3a')],{'$or':_[_0xe97b('0x2b')](_0x55736b,function(_0x42af50){if(_0x42af50['type']!==_0xe97b('0x3e')){var _0xd2e23={};_0xd2e23[_0x42af50['name']]={'$like':'%'+_0x513bd3['query'][_0xe97b('0x3c')]+'%'};return _0xd2e23;}})});}_0x49e8a4=_['merge']({},_0x49e8a4,_0x513bd3['options']);var _0x59228a={'where':_0x49e8a4['where']};return db[_0xe97b('0x2c')]['count'](_0x59228a)['then'](function(_0x3765be){_0x48e4fc[_0xe97b('0x1d')]=_0x3765be;if(_0x513bd3[_0xe97b('0x32')]['includeAll']){_0x49e8a4[_0xe97b('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xe97b('0x40')](_0x49e8a4);})[_0xe97b('0x25')](function(_0x43e0b8){_0x48e4fc[_0xe97b('0x41')]=_0x43e0b8;return _0x48e4fc;})[_0xe97b('0x25')](respondWithFilteredResult(_0x282d16,_0x49e8a4))[_0xe97b('0x42')](handleError(_0x282d16,null));};exports[_0xe97b('0x43')]=function(_0x15f107,_0x321797){var _0x49734d={'raw':![],'where':{'id':_0x15f107[_0xe97b('0x44')]['id']}},_0x259f70={};_0x259f70['model']=_['keys'](db['ServicenowAccount'][_0xe97b('0x2d')]);_0x259f70[_0xe97b('0x32')]=_[_0xe97b('0x45')](_0x15f107['query']);_0x259f70[_0xe97b('0x33')]=_[_0xe97b('0x34')](_0x259f70[_0xe97b('0x31')],_0x259f70[_0xe97b('0x32')]);_0x49734d[_0xe97b('0x36')]=_[_0xe97b('0x34')](_0x259f70[_0xe97b('0x31')],qs['fields'](_0x15f107[_0xe97b('0x32')][_0xe97b('0x35')]));_0x49734d[_0xe97b('0x36')]=_0x49734d['attributes'][_0xe97b('0x37')]?_0x49734d[_0xe97b('0x36')]:_0x259f70[_0xe97b('0x31')];if(_0x15f107[_0xe97b('0x32')][_0xe97b('0x46')]){_0x49734d[_0xe97b('0x3f')]=[{'all':!![]}];}_0x49734d=_[_0xe97b('0x3d')]({},_0x49734d,_0x15f107[_0xe97b('0x47')]);return db['ServicenowAccount']['find'](_0x49734d)['then'](handleEntityNotFound(_0x321797,null))[_0xe97b('0x25')](respondWithResult(_0x321797,null))[_0xe97b('0x42')](handleError(_0x321797,null));};exports[_0xe97b('0x48')]=function(_0x5cfebe,_0x2a484b){return db['ServicenowAccount'][_0xe97b('0x48')](_0x5cfebe[_0xe97b('0x49')],{})['then'](respondWithResult(_0x2a484b,0xc9))[_0xe97b('0x42')](handleError(_0x2a484b,null));};exports[_0xe97b('0x24')]=function(_0x3d5275,_0x253f5d){if(_0x3d5275['body']['id']){delete _0x3d5275[_0xe97b('0x49')]['id'];}return db[_0xe97b('0x2c')]['find']({'where':{'id':_0x3d5275[_0xe97b('0x44')]['id']}})['then'](handleEntityNotFound(_0x253f5d,null))[_0xe97b('0x25')](saveUpdates(_0x3d5275[_0xe97b('0x49')],null))[_0xe97b('0x25')](respondWithResult(_0x253f5d,null))[_0xe97b('0x42')](handleError(_0x253f5d,null));};exports[_0xe97b('0x4a')]=function(_0x3b7414,_0x279e45){return db[_0xe97b('0x2c')]['find']({'where':{'id':_0x3b7414['params']['id']}})[_0xe97b('0x25')](handleEntityNotFound(_0x279e45,null))['then'](removeEntity(_0x279e45,null))['catch'](handleError(_0x279e45,null));};exports[_0xe97b('0x4b')]=function(_0x50dbc8,_0x5b7327,_0x465c74){var _0x1697f6={};var _0x51cccb={};var _0x46926b;var _0x154dc6;return db['ServicenowAccount'][_0xe97b('0x4c')]({'where':{'id':_0x50dbc8[_0xe97b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b7327,null))[_0xe97b('0x25')](function(_0x584576){if(_0x584576){_0x46926b=_0x584576;_0x51cccb[_0xe97b('0x31')]=_[_0xe97b('0x45')](db['ServicenowConfiguration'][_0xe97b('0x2d')]);_0x51cccb[_0xe97b('0x32')]=_[_0xe97b('0x45')](_0x50dbc8[_0xe97b('0x32')]);_0x51cccb[_0xe97b('0x33')]=_[_0xe97b('0x34')](_0x51cccb['model'],_0x51cccb[_0xe97b('0x32')]);_0x1697f6[_0xe97b('0x36')]=_[_0xe97b('0x34')](_0x51cccb[_0xe97b('0x31')],qs[_0xe97b('0x35')](_0x50dbc8['query'][_0xe97b('0x35')]));_0x1697f6[_0xe97b('0x36')]=_0x1697f6[_0xe97b('0x36')]['length']?_0x1697f6[_0xe97b('0x36')]:_0x51cccb[_0xe97b('0x31')];_0x1697f6['order']=qs[_0xe97b('0x39')](_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x39')]);_0x1697f6[_0xe97b('0x3a')]=qs['filters'](_[_0xe97b('0x3b')](_0x50dbc8[_0xe97b('0x32')],_0x51cccb[_0xe97b('0x33')]));if(_0x50dbc8[_0xe97b('0x32')]['filter']){_0x1697f6[_0xe97b('0x3a')]=_[_0xe97b('0x3d')](_0x1697f6[_0xe97b('0x3a')],{'$or':_[_0xe97b('0x2b')](_0x1697f6['attributes'],function(_0x2a4f93){var _0x210c75={};_0x210c75[_0x2a4f93]={'$like':'%'+_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x3c')]+'%'};return _0x210c75;})});}_0x1697f6=_[_0xe97b('0x3d')]({},_0x1697f6,_0x50dbc8[_0xe97b('0x47')]);return _0x46926b[_0xe97b('0x4b')](_0x1697f6);}})[_0xe97b('0x25')](function(_0x29db96){if(_0x29db96){_0x154dc6=_0x29db96[_0xe97b('0x37')];if(!_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x4d')]('nolimit')){_0x1697f6['limit']=qs[_0xe97b('0x1c')](_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x1c')]);_0x1697f6['offset']=qs['offset'](_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x1a')]);}return _0x46926b[_0xe97b('0x4b')](_0x1697f6);}})[_0xe97b('0x25')](function(_0x5b8160){if(_0x5b8160){return _0x5b8160?{'count':_0x154dc6,'rows':_0x5b8160}:null;}})[_0xe97b('0x25')](respondWithResult(_0x5b7327,null))[_0xe97b('0x42')](handleError(_0x5b7327,null));};exports[_0xe97b('0x4e')]=function(_0x10316c,_0x3e0aa4,_0x4f1631){if(_0x10316c[_0xe97b('0x49')]['id']){delete _0x10316c[_0xe97b('0x49')]['id'];}return db[_0xe97b('0x2c')][_0xe97b('0x4c')]({'where':{'id':_0x10316c[_0xe97b('0x44')]['id']}})[_0xe97b('0x25')](handleEntityNotFound(_0x3e0aa4,null))[_0xe97b('0x25')](function(_0x3758a6){if(_0x3758a6){_0x10316c[_0xe97b('0x49')][_0xe97b('0x4f')]=_0x3758a6['id'];_0x10316c[_0xe97b('0x49')][_0xe97b('0x50')]=integrations[_0xe97b('0x51')](_0x10316c[_0xe97b('0x49')][_0xe97b('0x52')],_0x10316c['body']['type']);_0x10316c[_0xe97b('0x49')][_0xe97b('0x53')]=integrations[_0xe97b('0x54')](_0x10316c[_0xe97b('0x49')][_0xe97b('0x52')],_0x10316c[_0xe97b('0x49')][_0xe97b('0x2f')]);return db['ServicenowConfiguration'][_0xe97b('0x48')](_0x10316c[_0xe97b('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0xe97b('0x50')},{'model':db[_0xe97b('0x55')],'as':_0xe97b('0x53')}]});}return null;})[_0xe97b('0x25')](respondWithResult(_0x3e0aa4,null))[_0xe97b('0x42')](handleError(_0x3e0aa4,null));};exports[_0xe97b('0x56')]=function(_0x94e062,_0x45acd9,_0x3b8c11){var _0x14a91b=[_0xe97b('0x57'),_0xe97b('0x58'),'knowledge',_0xe97b('0x59'),_0xe97b('0x5a'),'notify',_0xe97b('0x5b'),_0xe97b('0x5c'),'category'];var _0x1009c1=[_0xe97b('0x5d'),_0xe97b('0x57'),'caused_by','watch_list',_0xe97b('0x5e'),_0xe97b('0x5f'),_0xe97b('0x60'),_0xe97b('0x58'),_0xe97b('0x61'),_0xe97b('0x62'),_0xe97b('0x63'),_0xe97b('0x64'),'opened_by',_0xe97b('0x65'),'sys_created_on',_0xe97b('0x66'),'state',_0xe97b('0x67'),'knowledge',_0xe97b('0x38'),_0xe97b('0x68'),_0xe97b('0x69'),_0xe97b('0x6a'),_0xe97b('0x6b'),_0xe97b('0x6c'),_0xe97b('0x6d'),_0xe97b('0x6e'),_0xe97b('0x6f'),_0xe97b('0x70'),_0xe97b('0x71'),_0xe97b('0x72'),_0xe97b('0x73'),_0xe97b('0x74'),_0xe97b('0x75'),'business_duration',_0xe97b('0x76'),'work_end',_0xe97b('0x77'),'resolved_at',_0xe97b('0x78'),'approval_set',_0xe97b('0x59'),'work_notes',_0xe97b('0x79'),_0xe97b('0x5a'),_0xe97b('0x7a'),'delivery_task','work_start',_0xe97b('0x7b'),'business_stc',_0xe97b('0x7c'),_0xe97b('0x7d'),_0xe97b('0x7e'),'notify','sys_class_name',_0xe97b('0x7f'),_0xe97b('0x80'),'follow_up',_0xe97b('0x81'),_0xe97b('0x82'),_0xe97b('0x83'),_0xe97b('0x84'),_0xe97b('0x5b'),_0xe97b('0x85'),_0xe97b('0x86'),_0xe97b('0x87'),_0xe97b('0x88'),_0xe97b('0x89'),'assigned_to',_0xe97b('0x5c'),_0xe97b('0x8a'),'sla_due',_0xe97b('0x8b'),'comments_and_work_notes',_0xe97b('0x8c'),_0xe97b('0x8d'),_0xe97b('0x8e'),_0xe97b('0x8f'),'escalation',_0xe97b('0x90'),_0xe97b('0x91'),_0xe97b('0x92'),'category'];var _0x3b678d='';var _0x1feb92='';var _0x2dd3fa=[];var _0x46f7d2='';var _0x496a1d='';var _0x145505=[];var _0x473cd7='';var _0x1f288d='';var _0x3da186={};var _0x485a23='';return db[_0xe97b('0x2c')]['findOne']({'where':{'id':_0x94e062[_0xe97b('0x44')]['id']},'attributes':['id',_0xe97b('0x93'),_0xe97b('0x94'),_0xe97b('0x95'),_0xe97b('0x96'),_0xe97b('0x97')]})[_0xe97b('0x25')](handleEntityNotFound(_0x45acd9,null))[_0xe97b('0x25')](function(_0x1be4c4){if(_0x1be4c4){_0x485a23=_0x1be4c4[_0xe97b('0x96')];var _0x189367=_0x485a23['slice'](-0x1);if(_0x189367==='/'){_0x485a23=_0x485a23[_0xe97b('0x98')](0x0,_0x485a23[_0xe97b('0x99')](_0x189367));}_0x1f288d=util[_0xe97b('0x9a')](_0xe97b('0x9b'),_0x485a23);_0x473cd7=util[_0xe97b('0x9a')](_0xe97b('0x9c'),_0x485a23);_0x3da186={'user':_0x1be4c4['username'],'pass':_0x1be4c4[_0xe97b('0x94')]};var _0x57ed74={'method':'GET','uri':_0x1f288d+_0xe97b('0x9d'),'auth':_0x3da186,'json':!![]};return rp(_0x57ed74);}})['then'](function(_0xa44593){if(_0xa44593['result'][_0xe97b('0x37')]>0x0){_0x3b678d=_0xa44593[_0xe97b('0x9e')];}console[_0xe97b('0x9f')](_0xe97b('0xa0'),_0x3b678d);_0x145505=[];_0x1feb92=Object[_0xe97b('0xa1')]([],_0x3b678d);_['remove'](_0x1feb92,function(_0x1d723f){return!_0x14a91b[_0xe97b('0xa2')](_0x1d723f['name']);});_0x1feb92[_0xe97b('0xa3')](function(_0x4b9b0d){var _0xa6b973=createFieldObject(_0x473cd7,_0x3da186,_0x4b9b0d['internalType'],_0x4b9b0d[_0xe97b('0x28')],_0x4b9b0d[_0xe97b('0xa4')],![]);_0x145505['push'](_0xa6b973);});return Promise[_0xe97b('0xa5')](_0x145505);})[_0xe97b('0x25')](function(_0x327b85){_0x2dd3fa=_0x327b85;_0x46f7d2=Object[_0xe97b('0xa1')]([],_0x3b678d);console['log'](_0xe97b('0xa6'),_0x3b678d);_[_0xe97b('0xa7')](_0x46f7d2,function(_0x36dfd0){return _0x1009c1['includes'](_0x36dfd0[_0xe97b('0x28')]);});console['log'](_0xe97b('0xa8'),_0x46f7d2);_0x145505=[];_0x46f7d2['forEach'](function(_0x2ff6b2){var _0xf5406e=createFieldObject(_0x473cd7,_0x3da186,_0x2ff6b2[_0xe97b('0xa9')],_0x2ff6b2[_0xe97b('0x28')],_0x2ff6b2[_0xe97b('0xa4')],!![]);_0x145505[_0xe97b('0xaa')](_0xf5406e);});return Promise['all'](_0x145505);})['then'](function(_0x385f84){_0x496a1d=_0x385f84;var _0x10a2b6=_0x2dd3fa['concat'](_0x496a1d);return{'count':_0x10a2b6[_0xe97b('0x37')],'rows':_0x10a2b6};})['then'](respondWithResult(_0x45acd9,null))[_0xe97b('0x42')](function(_0x55f060){console['log'](_0xe97b('0xab')+_0x55f060);var _0x53648c=_0x94e062[_0xe97b('0x32')][_0xe97b('0xac')]?0x1f4:_0x55f060[_0xe97b('0xad')]||0x1f4;logger[_0xe97b('0x26')](_0x55f060[_0xe97b('0x27')]);delete _0x55f060[_0xe97b('0x28')];if(_0x53648c===0x191){_0x53648c=0x190;}_0x45acd9['status'](_0x53648c)['send'](_0x94e062['query'][_0xe97b('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x55f060['statusCode']}:_0x55f060);});};function createFieldObject(_0x325ea5,_0x4ed037,_0x382405,_0xf78009,_0x13bd51,_0x23647f){return new Promise(function(_0x49d7a0,_0x52c62d){var _0x34d826={'id':_0xf78009,'name':_0x13bd51,'custom':_0x23647f};if(_0x382405===_0xe97b('0xae')){_0x34d826[_0xe97b('0x47')]=[{'name':_0xe97b('0xaf'),'value':_0xe97b('0xb0')},{'name':_0xe97b('0xb1'),'value':_0xe97b('0xb2')}];_0x49d7a0(_0x34d826);}else{var _0x160717={'method':_0xe97b('0xb3'),'uri':_0x325ea5+_0xe97b('0xb4')+_0xf78009,'auth':_0x4ed037,'json':!![]};return rp(_0x160717)[_0xe97b('0x25')](function(_0x25a453){var _0x5f369d=[];if(_0x25a453['result'][_0xe97b('0x37')]>0x0){_0x25a453[_0xe97b('0x9e')][_0xe97b('0xa3')](function(_0x249ff3){if(_0x249ff3[_0xe97b('0xb5')]===_0xe97b('0xb2')){var _0x2882df={'name':_0x249ff3['label'],'value':_0x249ff3[_0xe97b('0xb6')]};_0x5f369d[_0xe97b('0xaa')](_0x2882df);}});}_0x34d826['options']=_0x5f369d;if(_0x34d826[_0xe97b('0x47')]['length']>0x0){_0x49d7a0(_0x34d826);}else{if(_0x23647f==![]){_0x49d7a0();}else{_0x49d7a0(_0x34d826);}}});}});} \ No newline at end of file +var _0xab7a=['sys_updated_on','number','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','business_stc','additional_assignee_list','description','close_notes','follow_up','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','upon_approval','correlation_id','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','password','GET','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','channel','getDescriptions','ServicenowConfiguration','ServicenowField','Subjects','Descriptions','made_sla','hold_reason','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xab7a,0x107));var _0xaab7=function(_0x1eb837,_0x24429f){_0x1eb837=_0x1eb837-0x0;var _0x4ed333=_0xab7a[_0x1eb837];return _0x4ed333;};'use strict';var emlformat=require(_0xaab7('0x0'));var rimraf=require(_0xaab7('0x1'));var zipdir=require(_0xaab7('0x2'));var jsonpatch=require(_0xaab7('0x3'));var rp=require(_0xaab7('0x4'));var moment=require('moment');var BPromise=require(_0xaab7('0x5'));var Mustache=require(_0xaab7('0x6'));var util=require(_0xaab7('0x7'));var path=require(_0xaab7('0x8'));var sox=require(_0xaab7('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaab7('0xa'));var squel=require(_0xaab7('0xb'));var crypto=require(_0xaab7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaab7('0xd'));var querystring=require('querystring');var Papa=require(_0xaab7('0xe'));var Redis=require(_0xaab7('0xf'));var authService=require(_0xaab7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaab7('0x11'));var hardwareService=require(_0xaab7('0x12'));var logger=require(_0xaab7('0x13'))(_0xaab7('0x14'));var utils=require(_0xaab7('0x15'));var config=require(_0xaab7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaab7('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1de2e3,_0x1d2480){_0x1d2480=_0x1d2480||0xcc;return function(_0x3a84e5){if(_0x3a84e5){return _0x1de2e3[_0xaab7('0x18')](_0x1d2480);}return _0x1de2e3[_0xaab7('0x19')](_0x1d2480)['end']();};}function respondWithResult(_0x40038a,_0x391481){_0x391481=_0x391481||0xc8;return function(_0x135bae){if(_0x135bae){return _0x40038a[_0xaab7('0x19')](_0x391481)[_0xaab7('0x1a')](_0x135bae);}};}function respondWithFilteredResult(_0x55b9eb,_0x2a2d91){return function(_0x1ace93){if(_0x1ace93){var _0x57baf0=typeof _0x2a2d91[_0xaab7('0x1b')]===_0xaab7('0x1c')&&typeof _0x2a2d91['limit']===_0xaab7('0x1c');var _0x587f39=_0x1ace93[_0xaab7('0x1d')];var _0x562d32=_0x57baf0?0x0:_0x2a2d91[_0xaab7('0x1b')];var _0x4dcd2d=_0x57baf0?_0x1ace93[_0xaab7('0x1d')]:_0x2a2d91[_0xaab7('0x1b')]+_0x2a2d91['limit'];var _0x3648ed;if(_0x4dcd2d>=_0x587f39){_0x4dcd2d=_0x587f39;_0x3648ed=0xc8;}else{_0x3648ed=0xce;}_0x55b9eb[_0xaab7('0x19')](_0x3648ed);return _0x55b9eb[_0xaab7('0x1e')](_0xaab7('0x1f'),_0x562d32+'-'+_0x4dcd2d+'/'+_0x587f39)['json'](_0x1ace93);}return null;};}function patchUpdates(_0xe5b52b){return function(_0xdfac4f){try{jsonpatch[_0xaab7('0x20')](_0xdfac4f,_0xe5b52b,!![]);}catch(_0x2977b6){return BPromise['reject'](_0x2977b6);}return _0xdfac4f[_0xaab7('0x21')]();};}function saveUpdates(_0x53b07b,_0xb34c0b){return function(_0x86e14){if(_0x86e14){return _0x86e14[_0xaab7('0x22')](_0x53b07b)[_0xaab7('0x23')](function(_0x5efd34){return _0x5efd34;});}return null;};}function removeEntity(_0xacff26,_0x5a07b0){return function(_0x3f58b3){if(_0x3f58b3){return _0x3f58b3[_0xaab7('0x24')]()[_0xaab7('0x23')](function(){_0xacff26[_0xaab7('0x19')](0xcc)[_0xaab7('0x25')]();});}};}function handleEntityNotFound(_0x57c4a6,_0xc1e12b){return function(_0x456ea1){if(!_0x456ea1){_0x57c4a6[_0xaab7('0x18')](0x194);}return _0x456ea1;};}function handleError(_0x2fbea7,_0x49eef3){_0x49eef3=_0x49eef3||0x1f4;return function(_0x43e0a5){logger[_0xaab7('0x26')](_0x43e0a5['stack']);if(_0x43e0a5[_0xaab7('0x27')]){delete _0x43e0a5[_0xaab7('0x27')];}_0x2fbea7[_0xaab7('0x19')](_0x49eef3)[_0xaab7('0x28')](_0x43e0a5);};}exports['index']=function(_0x560aeb,_0x55a1fb){var _0x595da9={},_0x241dac={},_0x356579={'count':0x0,'rows':[]};var _0x45cbf1=_[_0xaab7('0x29')](db[_0xaab7('0x2a')][_0xaab7('0x2b')],function(_0x24e393){return{'name':_0x24e393[_0xaab7('0x2c')],'type':_0x24e393['type'][_0xaab7('0x2d')]};});_0x241dac[_0xaab7('0x2e')]=_[_0xaab7('0x29')](_0x45cbf1,_0xaab7('0x27'));_0x241dac[_0xaab7('0x2f')]=_[_0xaab7('0x30')](_0x560aeb['query']);_0x241dac['filters']=_[_0xaab7('0x31')](_0x241dac[_0xaab7('0x2e')],_0x241dac[_0xaab7('0x2f')]);_0x595da9[_0xaab7('0x32')]=_['intersection'](_0x241dac[_0xaab7('0x2e')],qs[_0xaab7('0x33')](_0x560aeb[_0xaab7('0x2f')]['fields']));_0x595da9[_0xaab7('0x32')]=_0x595da9[_0xaab7('0x32')]['length']?_0x595da9[_0xaab7('0x32')]:_0x241dac[_0xaab7('0x2e')];if(!_0x560aeb[_0xaab7('0x2f')][_0xaab7('0x34')](_0xaab7('0x35'))){_0x595da9[_0xaab7('0x36')]=qs[_0xaab7('0x36')](_0x560aeb['query'][_0xaab7('0x36')]);_0x595da9[_0xaab7('0x1b')]=qs[_0xaab7('0x1b')](_0x560aeb['query'][_0xaab7('0x1b')]);}_0x595da9[_0xaab7('0x37')]=qs[_0xaab7('0x38')](_0x560aeb['query'][_0xaab7('0x38')]);_0x595da9['where']=qs[_0xaab7('0x39')](_[_0xaab7('0x3a')](_0x560aeb[_0xaab7('0x2f')],_0x241dac['filters']),_0x45cbf1);if(_0x560aeb[_0xaab7('0x2f')][_0xaab7('0x3b')]){_0x595da9[_0xaab7('0x3c')]=_[_0xaab7('0x3d')](_0x595da9['where'],{'$or':_[_0xaab7('0x29')](_0x45cbf1,function(_0x376019){if(_0x376019[_0xaab7('0x3e')]!==_0xaab7('0x3f')){var _0x43d420={};_0x43d420[_0x376019[_0xaab7('0x27')]]={'$like':'%'+_0x560aeb[_0xaab7('0x2f')][_0xaab7('0x3b')]+'%'};return _0x43d420;}})});}_0x595da9=_['merge']({},_0x595da9,_0x560aeb[_0xaab7('0x40')]);var _0x40ed1c={'where':_0x595da9['where']};return db[_0xaab7('0x2a')][_0xaab7('0x1d')](_0x40ed1c)['then'](function(_0x22724f){_0x356579[_0xaab7('0x1d')]=_0x22724f;if(_0x560aeb['query']['includeAll']){_0x595da9[_0xaab7('0x41')]=[{'all':!![]}];}return db[_0xaab7('0x2a')]['findAll'](_0x595da9);})['then'](function(_0x43c50c){_0x356579[_0xaab7('0x42')]=_0x43c50c;return _0x356579;})[_0xaab7('0x23')](respondWithFilteredResult(_0x55a1fb,_0x595da9))[_0xaab7('0x43')](handleError(_0x55a1fb,null));};exports[_0xaab7('0x44')]=function(_0x3aab14,_0x14d649){var _0x5f1229={'raw':![],'where':{'id':_0x3aab14[_0xaab7('0x45')]['id']}},_0x247b9b={};_0x247b9b[_0xaab7('0x2e')]=_[_0xaab7('0x30')](db[_0xaab7('0x2a')]['rawAttributes']);_0x247b9b['query']=_['keys'](_0x3aab14[_0xaab7('0x2f')]);_0x247b9b[_0xaab7('0x39')]=_[_0xaab7('0x31')](_0x247b9b[_0xaab7('0x2e')],_0x247b9b['query']);_0x5f1229['attributes']=_[_0xaab7('0x31')](_0x247b9b[_0xaab7('0x2e')],qs[_0xaab7('0x33')](_0x3aab14[_0xaab7('0x2f')][_0xaab7('0x33')]));_0x5f1229[_0xaab7('0x32')]=_0x5f1229[_0xaab7('0x32')][_0xaab7('0x46')]?_0x5f1229['attributes']:_0x247b9b[_0xaab7('0x2e')];if(_0x3aab14[_0xaab7('0x2f')][_0xaab7('0x47')]){_0x5f1229[_0xaab7('0x41')]=[{'all':!![]}];}_0x5f1229=_[_0xaab7('0x3d')]({},_0x5f1229,_0x3aab14['options']);return db[_0xaab7('0x2a')][_0xaab7('0x48')](_0x5f1229)[_0xaab7('0x23')](handleEntityNotFound(_0x14d649,null))[_0xaab7('0x23')](respondWithResult(_0x14d649,null))[_0xaab7('0x43')](handleError(_0x14d649,null));};exports[_0xaab7('0x49')]=function(_0x2e7635,_0x2bf031){return db[_0xaab7('0x2a')][_0xaab7('0x49')](_0x2e7635[_0xaab7('0x4a')],{})[_0xaab7('0x23')](respondWithResult(_0x2bf031,0xc9))['catch'](handleError(_0x2bf031,null));};exports[_0xaab7('0x22')]=function(_0x14cfdf,_0x5b3571){if(_0x14cfdf[_0xaab7('0x4a')]['id']){delete _0x14cfdf[_0xaab7('0x4a')]['id'];}return db[_0xaab7('0x2a')][_0xaab7('0x48')]({'where':{'id':_0x14cfdf['params']['id']}})[_0xaab7('0x23')](handleEntityNotFound(_0x5b3571,null))[_0xaab7('0x23')](saveUpdates(_0x14cfdf[_0xaab7('0x4a')],null))[_0xaab7('0x23')](respondWithResult(_0x5b3571,null))[_0xaab7('0x43')](handleError(_0x5b3571,null));};exports[_0xaab7('0x24')]=function(_0x4fe586,_0x531629){return db[_0xaab7('0x2a')][_0xaab7('0x48')]({'where':{'id':_0x4fe586[_0xaab7('0x45')]['id']}})['then'](handleEntityNotFound(_0x531629,null))['then'](removeEntity(_0x531629,null))[_0xaab7('0x43')](handleError(_0x531629,null));};exports[_0xaab7('0x4b')]=function(_0x16d8ab,_0x2f3157,_0x35e9cd){var _0x4611a7={};var _0x288bd4={};var _0x3afb9f;var _0x3aa367;return db[_0xaab7('0x2a')][_0xaab7('0x4c')]({'where':{'id':_0x16d8ab[_0xaab7('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f3157,null))['then'](function(_0x532a1b){if(_0x532a1b){_0x3afb9f=_0x532a1b;_0x288bd4[_0xaab7('0x2e')]=_['keys'](db['ServicenowConfiguration'][_0xaab7('0x2b')]);_0x288bd4[_0xaab7('0x2f')]=_[_0xaab7('0x30')](_0x16d8ab['query']);_0x288bd4[_0xaab7('0x39')]=_['intersection'](_0x288bd4['model'],_0x288bd4[_0xaab7('0x2f')]);_0x4611a7[_0xaab7('0x32')]=_[_0xaab7('0x31')](_0x288bd4['model'],qs[_0xaab7('0x33')](_0x16d8ab[_0xaab7('0x2f')]['fields']));_0x4611a7['attributes']=_0x4611a7[_0xaab7('0x32')][_0xaab7('0x46')]?_0x4611a7[_0xaab7('0x32')]:_0x288bd4[_0xaab7('0x2e')];_0x4611a7['order']=qs[_0xaab7('0x38')](_0x16d8ab[_0xaab7('0x2f')][_0xaab7('0x38')]);_0x4611a7[_0xaab7('0x3c')]=qs[_0xaab7('0x39')](_['pick'](_0x16d8ab[_0xaab7('0x2f')],_0x288bd4[_0xaab7('0x39')]));if(_0x16d8ab[_0xaab7('0x2f')][_0xaab7('0x3b')]){_0x4611a7[_0xaab7('0x3c')]=_['merge'](_0x4611a7[_0xaab7('0x3c')],{'$or':_[_0xaab7('0x29')](_0x4611a7[_0xaab7('0x32')],function(_0x17ccf3){var _0x58f848={};_0x58f848[_0x17ccf3]={'$like':'%'+_0x16d8ab[_0xaab7('0x2f')][_0xaab7('0x3b')]+'%'};return _0x58f848;})});}_0x4611a7=_[_0xaab7('0x3d')]({},_0x4611a7,_0x16d8ab['options']);return _0x3afb9f['getConfigurations'](_0x4611a7);}})[_0xaab7('0x23')](function(_0x3615c3){if(_0x3615c3){_0x3aa367=_0x3615c3[_0xaab7('0x46')];if(!_0x16d8ab[_0xaab7('0x2f')]['hasOwnProperty'](_0xaab7('0x35'))){_0x4611a7['limit']=qs[_0xaab7('0x36')](_0x16d8ab[_0xaab7('0x2f')][_0xaab7('0x36')]);_0x4611a7[_0xaab7('0x1b')]=qs[_0xaab7('0x1b')](_0x16d8ab[_0xaab7('0x2f')][_0xaab7('0x1b')]);}return _0x3afb9f[_0xaab7('0x4b')](_0x4611a7);}})[_0xaab7('0x23')](function(_0x20ca09){if(_0x20ca09){return _0x20ca09?{'count':_0x3aa367,'rows':_0x20ca09}:null;}})[_0xaab7('0x23')](respondWithResult(_0x2f3157,null))[_0xaab7('0x43')](handleError(_0x2f3157,null));};exports[_0xaab7('0x4d')]=function(_0x18ac85,_0x3ff3ce,_0x3c8b59){if(_0x18ac85[_0xaab7('0x4a')]['id']){delete _0x18ac85[_0xaab7('0x4a')]['id'];}return db[_0xaab7('0x2a')][_0xaab7('0x4c')]({'where':{'id':_0x18ac85[_0xaab7('0x45')]['id']}})[_0xaab7('0x23')](handleEntityNotFound(_0x3ff3ce,null))[_0xaab7('0x23')](function(_0x2458fa){if(_0x2458fa){_0x18ac85[_0xaab7('0x4a')][_0xaab7('0x4e')]=_0x2458fa['id'];_0x18ac85[_0xaab7('0x4a')]['Subjects']=integrations['getSubjects'](_0x18ac85[_0xaab7('0x4a')][_0xaab7('0x4f')],_0x18ac85['body'][_0xaab7('0x3e')]);_0x18ac85[_0xaab7('0x4a')]['Descriptions']=integrations[_0xaab7('0x50')](_0x18ac85[_0xaab7('0x4a')][_0xaab7('0x4f')],_0x18ac85['body'][_0xaab7('0x3e')]);return db[_0xaab7('0x51')][_0xaab7('0x49')](_0x18ac85[_0xaab7('0x4a')],{'include':[{'model':db[_0xaab7('0x52')],'as':_0xaab7('0x53')},{'model':db[_0xaab7('0x52')],'as':_0xaab7('0x54')}]});}return null;})[_0xaab7('0x23')](respondWithResult(_0x3ff3ce,null))['catch'](handleError(_0x3ff3ce,null));};exports['getFields']=function(_0x2fed2a,_0x5807ec,_0x375649){var _0x2c815d=[_0xaab7('0x55'),_0xaab7('0x56'),'knowledge','subcategory',_0xaab7('0x57'),_0xaab7('0x58'),_0xaab7('0x59'),_0xaab7('0x5a'),_0xaab7('0x5b')];var _0x235141=[_0xaab7('0x5c'),_0xaab7('0x55'),_0xaab7('0x5d'),_0xaab7('0x5e'),'upon_reject',_0xaab7('0x5f'),'child_incidents',_0xaab7('0x56'),'approval_history',_0xaab7('0x60'),'resolved_by',_0xaab7('0x61'),_0xaab7('0x62'),'user_input',_0xaab7('0x63'),_0xaab7('0x64'),_0xaab7('0x65'),_0xaab7('0x66'),_0xaab7('0x67'),_0xaab7('0x37'),_0xaab7('0x68'),_0xaab7('0x69'),_0xaab7('0x6a'),_0xaab7('0x6b'),'impact',_0xaab7('0x6c'),_0xaab7('0x6d'),_0xaab7('0x6e'),_0xaab7('0x6f'),_0xaab7('0x70'),_0xaab7('0x71'),_0xaab7('0x72'),_0xaab7('0x73'),'opened_at',_0xaab7('0x74'),'group_list','work_end',_0xaab7('0x75'),_0xaab7('0x76'),_0xaab7('0x77'),_0xaab7('0x78'),'subcategory',_0xaab7('0x79'),_0xaab7('0x7a'),_0xaab7('0x57'),_0xaab7('0x7b'),'delivery_task',_0xaab7('0x7c'),'assignment_group',_0xaab7('0x7d'),_0xaab7('0x7e'),_0xaab7('0x7f'),'calendar_duration',_0xaab7('0x58'),'sys_class_name',_0xaab7('0x80'),'closed_by',_0xaab7('0x81'),'parent_incident','sys_id',_0xaab7('0x82'),_0xaab7('0x83'),_0xaab7('0x59'),_0xaab7('0x84'),_0xaab7('0x85'),'company',_0xaab7('0x86'),_0xaab7('0x87'),_0xaab7('0x88'),'severity',_0xaab7('0x89'),_0xaab7('0x8a'),_0xaab7('0x8b'),_0xaab7('0x8c'),'due_date',_0xaab7('0x8d'),_0xaab7('0x8e'),'sys_tags','escalation',_0xaab7('0x8f'),_0xaab7('0x90'),'location','category'];var _0xb1f7a7='';var _0x25cbb5='';var _0x523b95=[];var _0x2e6b36='';var _0xc591f7='';var _0x589953=[];var _0x19fc5c='';var _0x10954a='';var _0x13f404={};var _0x344b00='';return db[_0xaab7('0x2a')][_0xaab7('0x4c')]({'where':{'id':_0x2fed2a[_0xaab7('0x45')]['id']},'attributes':['id',_0xaab7('0x91'),'password',_0xaab7('0x92'),_0xaab7('0x93'),_0xaab7('0x94')]})[_0xaab7('0x23')](handleEntityNotFound(_0x5807ec,null))[_0xaab7('0x23')](function(_0x1ba980){if(_0x1ba980){_0x344b00=_0x1ba980[_0xaab7('0x93')];var _0x4674de=_0x344b00[_0xaab7('0x95')](-0x1);if(_0x4674de==='/'){_0x344b00=_0x344b00[_0xaab7('0x96')](0x0,_0x344b00[_0xaab7('0x97')](_0x4674de));}_0x10954a=util[_0xaab7('0x98')](_0xaab7('0x99'),_0x344b00);_0x19fc5c=util[_0xaab7('0x98')]('%s/api/now/table/',_0x344b00);_0x13f404={'user':_0x1ba980[_0xaab7('0x91')],'pass':_0x1ba980[_0xaab7('0x9a')]};var _0x1b7006={'method':_0xaab7('0x9b'),'uri':_0x10954a+'incident?sysparm_display_value=all','auth':_0x13f404,'json':!![]};return rp(_0x1b7006);}})[_0xaab7('0x23')](function(_0x194b2b){if(_0x194b2b[_0xaab7('0x9c')][_0xaab7('0x46')]>0x0){_0xb1f7a7=_0x194b2b['result'];}console[_0xaab7('0x9d')](_0xaab7('0x9e'),_0xb1f7a7);_0x589953=[];_0x25cbb5=Object[_0xaab7('0x9f')]([],_0xb1f7a7);_[_0xaab7('0xa0')](_0x25cbb5,function(_0x40b670){return!_0x2c815d[_0xaab7('0xa1')](_0x40b670['name']);});_0x25cbb5[_0xaab7('0xa2')](function(_0x50d58e){var _0x539143=createFieldObject(_0x19fc5c,_0x13f404,_0x50d58e[_0xaab7('0xa3')],_0x50d58e['name'],_0x50d58e[_0xaab7('0xa4')],![]);_0x589953[_0xaab7('0xa5')](_0x539143);});return Promise[_0xaab7('0xa6')](_0x589953);})[_0xaab7('0x23')](function(_0x99b079){_0x523b95=_0x99b079;_0x2e6b36=Object['assign']([],_0xb1f7a7);console[_0xaab7('0x9d')](_0xaab7('0xa7'),_0xb1f7a7);_[_0xaab7('0xa0')](_0x2e6b36,function(_0x241cff){return _0x235141[_0xaab7('0xa1')](_0x241cff['name']);});console['log'](_0xaab7('0xa8'),_0x2e6b36);_0x589953=[];_0x2e6b36['forEach'](function(_0xff4d91){var _0x2dfe24=createFieldObject(_0x19fc5c,_0x13f404,_0xff4d91[_0xaab7('0xa3')],_0xff4d91[_0xaab7('0x27')],_0xff4d91[_0xaab7('0xa4')],!![]);_0x589953[_0xaab7('0xa5')](_0x2dfe24);});return Promise[_0xaab7('0xa6')](_0x589953);})[_0xaab7('0x23')](function(_0x4baeef){_0xc591f7=_0x4baeef;var _0x349daa=_0x523b95['concat'](_0xc591f7);return{'count':_0x349daa['length'],'rows':_0x349daa};})[_0xaab7('0x23')](respondWithResult(_0x5807ec,null))[_0xaab7('0x43')](function(_0x3b8106){console[_0xaab7('0x9d')](_0xaab7('0xa9')+_0x3b8106);var _0x2e24a6=_0x2fed2a[_0xaab7('0x2f')][_0xaab7('0xaa')]?0x1f4:_0x3b8106['statusCode']||0x1f4;logger['error'](_0x3b8106['stack']);delete _0x3b8106['name'];if(_0x2e24a6===0x191){_0x2e24a6=0x190;}_0x5807ec[_0xaab7('0x19')](_0x2e24a6)[_0xaab7('0x28')](_0x2fed2a[_0xaab7('0x2f')][_0xaab7('0xaa')]?{'message':_0xaab7('0xab'),'statusCode':_0x3b8106[_0xaab7('0xac')]}:_0x3b8106);});};function createFieldObject(_0x18419c,_0x196e1f,_0x11a525,_0x4f308d,_0x11bf6b,_0x31d270){return new Promise(function(_0x351631,_0x1fa6b0){var _0x372817={'id':_0x4f308d,'name':_0x11bf6b,'custom':_0x31d270};if(_0x11a525===_0xaab7('0xad')){_0x372817['options']=[{'name':_0xaab7('0xae'),'value':'true'},{'name':_0xaab7('0xaf'),'value':_0xaab7('0xb0')}];_0x351631(_0x372817);}else{var _0x2157e1={'method':'GET','uri':_0x18419c+_0xaab7('0xb1')+_0x4f308d,'auth':_0x196e1f,'json':!![]};return rp(_0x2157e1)['then'](function(_0x59b90d){var _0xec65d8=[];if(_0x59b90d[_0xaab7('0x9c')][_0xaab7('0x46')]>0x0){_0x59b90d[_0xaab7('0x9c')][_0xaab7('0xa2')](function(_0x34850a){if(_0x34850a[_0xaab7('0xb2')]==='false'){var _0x7e615b={'name':_0x34850a['label'],'value':_0x34850a['value']};_0xec65d8[_0xaab7('0xa5')](_0x7e615b);}});}_0x372817[_0xaab7('0x40')]=_0xec65d8;if(_0x372817[_0xaab7('0x40')][_0xaab7('0x46')]>0x0){_0x351631(_0x372817);}else{if(_0x31d270==![]){_0x351631();}else{_0x351631(_0x372817);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 80cdcbb..9e892db 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 _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0x5358cd,_0x3e94d4){var _0xe31351=function(_0x259d92){while(--_0x259d92){_0x5358cd['push'](_0x5358cd['shift']());}};_0xe31351(++_0x3e94d4);}(_0xd8fb,0x99));var _0xbd8f=function(_0x50e42c,_0x2e6839){_0x50e42c=_0x50e42c-0x0;var _0x22b944=_0xd8fb[_0x50e42c];return _0x22b944;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','bluebird'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x5d58,0x187));var _0x85d5=function(_0x21c16d,_0x178ae9){_0x21c16d=_0x21c16d-0x0;var _0x1e8c8d=_0x5d58[_0x21c16d];return _0x1e8c8d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'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 c7cfe31..a238339 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 _0xf55f=['options','raw','where','limit','include','model','attributes','map','then','find','ShowServicenowAccount','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x3f506a,_0x535543){var _0x563580=function(_0x4eca33){while(--_0x4eca33){_0x3f506a['push'](_0x3f506a['shift']());}};_0x563580(++_0x535543);}(_0xf55f,0xc4));var _0xff55=function(_0x4e2272,_0x2e1ae0){_0x4e2272=_0x4e2272-0x0;var _0x45511c=_0xf55f[_0x4e2272];return _0x45511c;};'use strict';var _=require(_0xff55('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xff55('0x1'));var fs=require('fs');var Redis=require(_0xff55('0x2'));var db=require(_0xff55('0x3'))['db'];var utils=require(_0xff55('0x4'));var logger=require(_0xff55('0x5'))(_0xff55('0x6'));var config=require(_0xff55('0x7'));var jayson=require(_0xff55('0x8'));var client=jayson[_0xff55('0x9')][_0xff55('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47845d,_0x4b2f0c,_0x374305){return new BPromise(function(_0xd1629e,_0x88255d){return client[_0xff55('0xb')](_0x47845d,_0x374305)['then'](function(_0x39367d){logger[_0xff55('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x4b2f0c,_0xff55('0xd'));logger[_0xff55('0xe')](_0xff55('0xf'),_0x4b2f0c,'request\x20sent',JSON[_0xff55('0x10')](_0x39367d));if(_0x39367d['error']){if(_0x39367d[_0xff55('0x11')][_0xff55('0x12')]===0x1f4){logger[_0xff55('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x4b2f0c,_0x39367d[_0xff55('0x11')]['message']);return _0x88255d(_0x39367d['error'][_0xff55('0x13')]);}logger[_0xff55('0x11')](_0xff55('0x14'),_0x4b2f0c,_0x39367d[_0xff55('0x11')][_0xff55('0x13')]);return _0xd1629e(_0x39367d[_0xff55('0x11')][_0xff55('0x13')]);}else{logger[_0xff55('0xc')](_0xff55('0x14'),_0x4b2f0c,_0xff55('0xd'));_0xd1629e(_0x39367d[_0xff55('0x15')][_0xff55('0x13')]);}})[_0xff55('0x16')](function(_0x286d73){logger[_0xff55('0x11')](_0xff55('0x14'),_0x4b2f0c,_0x286d73);_0x88255d(_0x286d73);});});}exports[_0xff55('0x17')]=function(_0x3ebafb){var _0x2ce12e=this;return new Promise(function(_0x5d0c95,_0x425ee6){return db[_0xff55('0x18')][_0xff55('0x19')]({'raw':_0x3ebafb[_0xff55('0x1a')]?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ebafb['options']?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1c')]||null:null,'attributes':_0x3ebafb[_0xff55('0x1a')]?_0x3ebafb[_0xff55('0x1a')]['attributes']||null:null,'limit':_0x3ebafb[_0xff55('0x1a')]?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1d')]||null:null,'include':_0x3ebafb['options']?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1e')]?_['map'](_0x3ebafb['options'][_0xff55('0x1e')],function(_0x144bc8){return{'model':db[_0x144bc8[_0xff55('0x1f')]],'as':_0x144bc8['as'],'attributes':_0x144bc8[_0xff55('0x20')],'include':_0x144bc8[_0xff55('0x1e')]?_[_0xff55('0x21')](_0x144bc8[_0xff55('0x1e')],function(_0x169241){return{'model':db[_0x169241['model']],'as':_0x169241['as'],'attributes':_0x169241[_0xff55('0x20')],'include':_0x169241[_0xff55('0x1e')]?_[_0xff55('0x21')](_0x169241[_0xff55('0x1e')],function(_0x271d1b){return{'model':db[_0x271d1b[_0xff55('0x1f')]],'as':_0x271d1b['as'],'attributes':_0x271d1b[_0xff55('0x20')]};}):[]};}):[]};}):[]:[]})[_0xff55('0x22')](function(_0x30946d){logger['info']('GetServicenowAccount',_0x3ebafb);logger[_0xff55('0xe')](_0xff55('0x17'),_0x3ebafb,JSON[_0xff55('0x10')](_0x30946d));_0x5d0c95(_0x30946d);})[_0xff55('0x16')](function(_0x37d2e3){logger[_0xff55('0x11')](_0xff55('0x17'),_0x37d2e3['message'],_0x3ebafb);_0x425ee6(_0x2ce12e[_0xff55('0x11')](0x1f4,_0x37d2e3[_0xff55('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x43a21a){var _0xb2a9d0=this;return new Promise(function(_0x1f637c,_0x22f1a9){return db[_0xff55('0x18')][_0xff55('0x23')]({'raw':_0x43a21a[_0xff55('0x1a')]?_0x43a21a[_0xff55('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x43a21a['options']?_0x43a21a[_0xff55('0x1a')]['where']||null:null,'attributes':_0x43a21a[_0xff55('0x1a')]?_0x43a21a[_0xff55('0x1a')][_0xff55('0x20')]||null:null,'include':_0x43a21a[_0xff55('0x1a')]?_0x43a21a[_0xff55('0x1a')][_0xff55('0x1e')]?_['map'](_0x43a21a[_0xff55('0x1a')]['include'],function(_0x4eb1aa){return{'model':db[_0x4eb1aa[_0xff55('0x1f')]],'as':_0x4eb1aa['as'],'attributes':_0x4eb1aa[_0xff55('0x20')],'include':_0x4eb1aa['include']?_[_0xff55('0x21')](_0x4eb1aa[_0xff55('0x1e')],function(_0x5954fc){return{'model':db[_0x5954fc['model']],'as':_0x5954fc['as'],'attributes':_0x5954fc[_0xff55('0x20')],'include':_0x5954fc[_0xff55('0x1e')]?_['map'](_0x5954fc['include'],function(_0x1a16d3){return{'model':db[_0x1a16d3[_0xff55('0x1f')]],'as':_0x1a16d3['as'],'attributes':_0x1a16d3[_0xff55('0x20')]};}):[]};}):[]};}):[]:[]})[_0xff55('0x22')](function(_0x5860ed){logger['info'](_0xff55('0x24'),_0x43a21a);logger[_0xff55('0xe')](_0xff55('0x24'),_0x43a21a,JSON[_0xff55('0x10')](_0x5860ed));_0x1f637c(_0x5860ed);})[_0xff55('0x16')](function(_0x3c4bc2){logger[_0xff55('0x11')]('ShowServicenowAccount',_0x3c4bc2[_0xff55('0x13')],_0x43a21a);_0x22f1a9(_0xb2a9d0[_0xff55('0x11')](0x1f4,_0x3c4bc2[_0xff55('0x13')]));});});}; \ No newline at end of file +var _0xdf5f=['rpc','../../config/environment','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','stringify','ShowServicenowAccount','find','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x36daf3,_0x2ea0dd){var _0x3e4e26=function(_0x31999a){while(--_0x31999a){_0x36daf3['push'](_0x36daf3['shift']());}};_0x3e4e26(++_0x2ea0dd);}(_0xdf5f,0x157));var _0xfdf5=function(_0x5b5f0d,_0x4575f0){_0x5b5f0d=_0x5b5f0d-0x0;var _0x5b7c7a=_0xdf5f[_0x5b5f0d];return _0x5b7c7a;};'use strict';var _=require(_0xfdf5('0x0'));var util=require(_0xfdf5('0x1'));var moment=require('moment');var BPromise=require(_0xfdf5('0x2'));var rs=require(_0xfdf5('0x3'));var fs=require('fs');var Redis=require(_0xfdf5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdf5('0x5'));var logger=require(_0xfdf5('0x6'))(_0xfdf5('0x7'));var config=require(_0xfdf5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfdf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0ea8,_0x34cbe3,_0x22eca1){return new BPromise(function(_0x3b735b,_0x1e1609){return client[_0xfdf5('0xa')](_0x5e0ea8,_0x22eca1)['then'](function(_0x44e562){logger['info'](_0xfdf5('0xb'),_0x34cbe3,_0xfdf5('0xc'));logger[_0xfdf5('0xd')](_0xfdf5('0xe'),_0x34cbe3,'request\x20sent',JSON['stringify'](_0x44e562));if(_0x44e562[_0xfdf5('0xf')]){if(_0x44e562[_0xfdf5('0xf')][_0xfdf5('0x10')]===0x1f4){logger[_0xfdf5('0xf')](_0xfdf5('0xb'),_0x34cbe3,_0x44e562[_0xfdf5('0xf')][_0xfdf5('0x11')]);return _0x1e1609(_0x44e562['error']['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x34cbe3,_0x44e562[_0xfdf5('0xf')][_0xfdf5('0x11')]);return _0x3b735b(_0x44e562['error'][_0xfdf5('0x11')]);}else{logger[_0xfdf5('0x12')](_0xfdf5('0xb'),_0x34cbe3,'request\x20sent');_0x3b735b(_0x44e562[_0xfdf5('0x13')][_0xfdf5('0x11')]);}})[_0xfdf5('0x14')](function(_0x2adcf7){logger['error'](_0xfdf5('0xb'),_0x34cbe3,_0x2adcf7);_0x1e1609(_0x2adcf7);});});}exports['GetServicenowAccount']=function(_0x359359){var _0x41a11b=this;return new Promise(function(_0x31f28e,_0x52e988){return db[_0xfdf5('0x15')][_0xfdf5('0x16')]({'raw':_0x359359[_0xfdf5('0x17')]?_0x359359[_0xfdf5('0x17')][_0xfdf5('0x18')]===undefined?!![]:![]:!![],'where':_0x359359[_0xfdf5('0x17')]?_0x359359['options'][_0xfdf5('0x19')]||null:null,'attributes':_0x359359[_0xfdf5('0x17')]?_0x359359[_0xfdf5('0x17')][_0xfdf5('0x1a')]||null:null,'limit':_0x359359['options']?_0x359359['options']['limit']||null:null,'include':_0x359359['options']?_0x359359[_0xfdf5('0x17')][_0xfdf5('0x1b')]?_[_0xfdf5('0x1c')](_0x359359[_0xfdf5('0x17')][_0xfdf5('0x1b')],function(_0x882a3f){return{'model':db[_0x882a3f[_0xfdf5('0x1d')]],'as':_0x882a3f['as'],'attributes':_0x882a3f['attributes'],'include':_0x882a3f[_0xfdf5('0x1b')]?_[_0xfdf5('0x1c')](_0x882a3f['include'],function(_0x171b5e){return{'model':db[_0x171b5e[_0xfdf5('0x1d')]],'as':_0x171b5e['as'],'attributes':_0x171b5e[_0xfdf5('0x1a')],'include':_0x171b5e['include']?_['map'](_0x171b5e['include'],function(_0x311416){return{'model':db[_0x311416[_0xfdf5('0x1d')]],'as':_0x311416['as'],'attributes':_0x311416['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3baa99){logger[_0xfdf5('0x12')](_0xfdf5('0x1e'),_0x359359);logger[_0xfdf5('0xd')](_0xfdf5('0x1e'),_0x359359,JSON[_0xfdf5('0x1f')](_0x3baa99));_0x31f28e(_0x3baa99);})['catch'](function(_0x1967a1){logger[_0xfdf5('0xf')](_0xfdf5('0x1e'),_0x1967a1[_0xfdf5('0x11')],_0x359359);_0x52e988(_0x41a11b['error'](0x1f4,_0x1967a1[_0xfdf5('0x11')]));});});};exports[_0xfdf5('0x20')]=function(_0x557c2f){var _0x32a532=this;return new Promise(function(_0x30d124,_0x5376c8){return db['ServicenowAccount'][_0xfdf5('0x21')]({'raw':_0x557c2f['options']?_0x557c2f[_0xfdf5('0x17')][_0xfdf5('0x18')]===undefined?!![]:![]:!![],'where':_0x557c2f[_0xfdf5('0x17')]?_0x557c2f[_0xfdf5('0x17')]['where']||null:null,'attributes':_0x557c2f[_0xfdf5('0x17')]?_0x557c2f[_0xfdf5('0x17')][_0xfdf5('0x1a')]||null:null,'include':_0x557c2f[_0xfdf5('0x17')]?_0x557c2f[_0xfdf5('0x17')][_0xfdf5('0x1b')]?_['map'](_0x557c2f['options'][_0xfdf5('0x1b')],function(_0xf13f32){return{'model':db[_0xf13f32[_0xfdf5('0x1d')]],'as':_0xf13f32['as'],'attributes':_0xf13f32[_0xfdf5('0x1a')],'include':_0xf13f32['include']?_[_0xfdf5('0x1c')](_0xf13f32[_0xfdf5('0x1b')],function(_0x39c2cc){return{'model':db[_0x39c2cc['model']],'as':_0x39c2cc['as'],'attributes':_0x39c2cc[_0xfdf5('0x1a')],'include':_0x39c2cc['include']?_[_0xfdf5('0x1c')](_0x39c2cc['include'],function(_0x3af445){return{'model':db[_0x3af445[_0xfdf5('0x1d')]],'as':_0x3af445['as'],'attributes':_0x3af445[_0xfdf5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfdf5('0x22')](function(_0x5e867d){logger[_0xfdf5('0x12')](_0xfdf5('0x20'),_0x557c2f);logger[_0xfdf5('0xd')](_0xfdf5('0x20'),_0x557c2f,JSON['stringify'](_0x5e867d));_0x30d124(_0x5e867d);})[_0xfdf5('0x14')](function(_0x2b9108){logger[_0xfdf5('0xf')](_0xfdf5('0x20'),_0x2b9108[_0xfdf5('0x11')],_0x557c2f);_0x5376c8(_0x32a532['error'](0x1f4,_0x2b9108['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index a30bd42..8d6c3e2 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 _0x753c=['isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','post','create','/:id','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x753c,0x15f));var _0xc753=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x753c[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xc753('0x0'));var path=require(_0xc753('0x1'));var timeout=require(_0xc753('0x2'));var express=require(_0xc753('0x3'));var router=express[_0xc753('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc753('0x5'));var interaction=require(_0xc753('0x6'));var config=require(_0xc753('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xc753('0x8')]('/',auth[_0xc753('0x9')](),controller[_0xc753('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc753('0xb')]);router[_0xc753('0x8')]('/:id/fields',auth[_0xc753('0x9')](),controller[_0xc753('0xc')]);router[_0xc753('0x8')](_0xc753('0xd'),auth['isAuthenticated'](),controller[_0xc753('0xe')]);router[_0xc753('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xc753('0xf')]('/',auth[_0xc753('0x9')](),controller[_0xc753('0x10')]);router['put'](_0xc753('0x11'),auth[_0xc753('0x9')](),controller[_0xc753('0x12')]);router['delete'](_0xc753('0x11'),auth[_0xc753('0x9')](),controller['destroy']);module[_0xc753('0x13')]=router; \ No newline at end of file +var _0x323b=['getSubjects','/:id/descriptions','isAuthenticated','getDescriptions','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x323b,0xe2));var _0xb323=function(_0x25b372,_0x5ce232){_0x25b372=_0x25b372-0x0;var _0x5e601e=_0x323b[_0x25b372];return _0x5e601e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb323('0x0'));var timeout=require(_0xb323('0x1'));var express=require(_0xb323('0x2'));var router=express[_0xb323('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb323('0x4'));var config=require(_0xb323('0x5'));var controller=require(_0xb323('0x6'));router[_0xb323('0x7')]('/',auth['isAuthenticated'](),controller[_0xb323('0x8')]);router[_0xb323('0x7')](_0xb323('0x9'),auth['isAuthenticated'](),controller[_0xb323('0xa')]);router[_0xb323('0x7')](_0xb323('0xb'),auth['isAuthenticated'](),controller[_0xb323('0xc')]);router['get'](_0xb323('0xd'),auth['isAuthenticated'](),controller[_0xb323('0xe')]);router['get'](_0xb323('0xf'),auth[_0xb323('0x10')](),controller[_0xb323('0x11')]);router[_0xb323('0x12')]('/',auth[_0xb323('0x10')](),controller[_0xb323('0x13')]);router[_0xb323('0x14')](_0xb323('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xb323('0x15')](_0xb323('0x9'),auth[_0xb323('0x10')](),controller[_0xb323('0x16')]);module[_0xb323('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 8804b67..c53c179 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 _0x1c4d=['exports','STRING','sequelize'];(function(_0x2d2746,_0xaac75f){var _0x1735f7=function(_0x57b441){while(--_0x57b441){_0x2d2746['push'](_0x2d2746['shift']());}};_0x1735f7(++_0xaac75f);}(_0x1c4d,0x197));var _0xd1c4=function(_0x3f2f63,_0x339ed8){_0x3f2f63=_0x3f2f63-0x0;var _0x4c5fd9=_0x1c4d[_0x3f2f63];return _0x4c5fd9;};'use strict';var Sequelize=require(_0xd1c4('0x0'));module[_0xd1c4('0x1')]={'name':{'type':Sequelize[_0xd1c4('0x2')]},'description':{'type':Sequelize[_0xd1c4('0x2')]}}; \ No newline at end of file +var _0x6260=['sequelize','exports','STRING'];(function(_0x99a389,_0x1736ba){var _0x633fcc=function(_0x172a79){while(--_0x172a79){_0x99a389['push'](_0x99a389['shift']());}};_0x633fcc(++_0x1736ba);}(_0x6260,0x78));var _0x0626=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x6260[_0x38854e];return _0x3f8415;};'use strict';var Sequelize=require(_0x0626('0x0'));module[_0x0626('0x1')]={'name':{'type':Sequelize[_0x0626('0x2')]},'description':{'type':Sequelize[_0x0626('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 946e896..f311fc8 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 _0xb877=['length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','ServicenowField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x4994cc,_0x5b4d81){var _0x579f1d=function(_0x2e5d71){while(--_0x2e5d71){_0x4994cc['push'](_0x4994cc['shift']());}};_0x579f1d(++_0x5b4d81);}(_0xb877,0xa9));var _0x7b87=function(_0x28a5b0,_0x155361){_0x28a5b0=_0x28a5b0-0x0;var _0x30ba6a=_0xb877[_0x28a5b0];return _0x30ba6a;};'use strict';var emlformat=require(_0x7b87('0x0'));var rimraf=require(_0x7b87('0x1'));var zipdir=require(_0x7b87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b87('0x3'));var path=require(_0x7b87('0x4'));var sox=require(_0x7b87('0x5'));var csv=require(_0x7b87('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b87('0x7'));var squel=require(_0x7b87('0x8'));var crypto=require(_0x7b87('0x9'));var jsforce=require(_0x7b87('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7b87('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b87('0xc'));var qs=require(_0x7b87('0xd'));var as=require(_0x7b87('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b87('0xf'))(_0x7b87('0x10'));var utils=require('../../config/utils');var config=require(_0x7b87('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x204bde,_0x2ac25c){_0x2ac25c=_0x2ac25c||0xcc;return function(_0xfcfbab){if(_0xfcfbab){return _0x204bde[_0x7b87('0x12')](_0x2ac25c);}return _0x204bde[_0x7b87('0x13')](_0x2ac25c)['end']();};}function respondWithResult(_0x467f5a,_0x2d099f){_0x2d099f=_0x2d099f||0xc8;return function(_0x6e300e){if(_0x6e300e){return _0x467f5a[_0x7b87('0x13')](_0x2d099f)[_0x7b87('0x14')](_0x6e300e);}};}function respondWithFilteredResult(_0x7d4f9d,_0x494620){return function(_0x926e4f){if(_0x926e4f){var _0x4077ae=typeof _0x494620['offset']===_0x7b87('0x15')&&typeof _0x494620[_0x7b87('0x16')]===_0x7b87('0x15');var _0xb95eae=_0x926e4f[_0x7b87('0x17')];var _0x283dec=_0x4077ae?0x0:_0x494620[_0x7b87('0x18')];var _0x1a19e4=_0x4077ae?_0x926e4f[_0x7b87('0x17')]:_0x494620[_0x7b87('0x18')]+_0x494620[_0x7b87('0x16')];var _0x5472d8;if(_0x1a19e4>=_0xb95eae){_0x1a19e4=_0xb95eae;_0x5472d8=0xc8;}else{_0x5472d8=0xce;}_0x7d4f9d['status'](_0x5472d8);return _0x7d4f9d[_0x7b87('0x19')](_0x7b87('0x1a'),_0x283dec+'-'+_0x1a19e4+'/'+_0xb95eae)['json'](_0x926e4f);}return null;};}function patchUpdates(_0x424740){return function(_0x3e390b){try{jsonpatch['apply'](_0x3e390b,_0x424740,!![]);}catch(_0x5b83fc){return BPromise[_0x7b87('0x1b')](_0x5b83fc);}return _0x3e390b['save']();};}function saveUpdates(_0x3e5135,_0x1787c7){return function(_0x13cd16){if(_0x13cd16){return _0x13cd16[_0x7b87('0x1c')](_0x3e5135)[_0x7b87('0x1d')](function(_0x43ecc2){return _0x43ecc2;});}return null;};}function removeEntity(_0x1fcc85,_0x16be5d){return function(_0x4ab092){if(_0x4ab092){return _0x4ab092[_0x7b87('0x1e')]()[_0x7b87('0x1d')](function(){_0x1fcc85[_0x7b87('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ccdf,_0x27d37d){return function(_0x4ae5e5){if(!_0x4ae5e5){_0x58ccdf['sendStatus'](0x194);}return _0x4ae5e5;};}function handleError(_0x5585c6,_0x47a997){_0x47a997=_0x47a997||0x1f4;return function(_0x453c44){logger['error'](_0x453c44['stack']);if(_0x453c44[_0x7b87('0x1f')]){delete _0x453c44['name'];}_0x5585c6[_0x7b87('0x13')](_0x47a997)['send'](_0x453c44);};}exports[_0x7b87('0x20')]=function(_0x4a0873,_0x4e5156){var _0x3a2f75={},_0x1d1d38={},_0x5aebc8={'count':0x0,'rows':[]};var _0x1c6be0=_[_0x7b87('0x21')](db['ServicenowConfiguration']['rawAttributes'],function(_0x2333c7){return{'name':_0x2333c7[_0x7b87('0x22')],'type':_0x2333c7[_0x7b87('0x23')][_0x7b87('0x24')]};});_0x1d1d38['model']=_['map'](_0x1c6be0,_0x7b87('0x1f'));_0x1d1d38[_0x7b87('0x25')]=_[_0x7b87('0x26')](_0x4a0873[_0x7b87('0x25')]);_0x1d1d38[_0x7b87('0x27')]=_[_0x7b87('0x28')](_0x1d1d38[_0x7b87('0x29')],_0x1d1d38[_0x7b87('0x25')]);_0x3a2f75[_0x7b87('0x2a')]=_[_0x7b87('0x28')](_0x1d1d38['model'],qs[_0x7b87('0x2b')](_0x4a0873[_0x7b87('0x25')]['fields']));_0x3a2f75[_0x7b87('0x2a')]=_0x3a2f75['attributes'][_0x7b87('0x2c')]?_0x3a2f75[_0x7b87('0x2a')]:_0x1d1d38[_0x7b87('0x29')];if(!_0x4a0873[_0x7b87('0x25')]['hasOwnProperty'](_0x7b87('0x2d'))){_0x3a2f75['limit']=qs['limit'](_0x4a0873[_0x7b87('0x25')][_0x7b87('0x16')]);_0x3a2f75[_0x7b87('0x18')]=qs[_0x7b87('0x18')](_0x4a0873[_0x7b87('0x25')][_0x7b87('0x18')]);}_0x3a2f75['order']=qs[_0x7b87('0x2e')](_0x4a0873[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x3a2f75[_0x7b87('0x2f')]=qs['filters'](_[_0x7b87('0x30')](_0x4a0873[_0x7b87('0x25')],_0x1d1d38['filters']),_0x1c6be0);if(_0x4a0873[_0x7b87('0x25')][_0x7b87('0x31')]){_0x3a2f75['where']=_[_0x7b87('0x32')](_0x3a2f75[_0x7b87('0x2f')],{'$or':_[_0x7b87('0x21')](_0x1c6be0,function(_0x1d7793){if(_0x1d7793[_0x7b87('0x23')]!==_0x7b87('0x33')){var _0x3d984c={};_0x3d984c[_0x1d7793[_0x7b87('0x1f')]]={'$like':'%'+_0x4a0873['query'][_0x7b87('0x31')]+'%'};return _0x3d984c;}})});}_0x3a2f75=_[_0x7b87('0x32')]({},_0x3a2f75,_0x4a0873[_0x7b87('0x34')]);var _0xf00a82={'where':_0x3a2f75[_0x7b87('0x2f')]};return db[_0x7b87('0x35')][_0x7b87('0x17')](_0xf00a82)['then'](function(_0x4540ab){_0x5aebc8[_0x7b87('0x17')]=_0x4540ab;if(_0x4a0873['query'][_0x7b87('0x36')]){_0x3a2f75['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x7b87('0x37')](_0x3a2f75);})['then'](function(_0x4227b5){_0x5aebc8[_0x7b87('0x38')]=_0x4227b5;return _0x5aebc8;})[_0x7b87('0x1d')](respondWithFilteredResult(_0x4e5156,_0x3a2f75))[_0x7b87('0x39')](handleError(_0x4e5156,null));};exports[_0x7b87('0x3a')]=function(_0x31c016,_0x172181){var _0x372b7c={'raw':![],'where':{'id':_0x31c016[_0x7b87('0x3b')]['id']}},_0x1b5bdd={};_0x1b5bdd[_0x7b87('0x29')]=_[_0x7b87('0x26')](db['ServicenowConfiguration'][_0x7b87('0x3c')]);_0x1b5bdd[_0x7b87('0x25')]=_[_0x7b87('0x26')](_0x31c016[_0x7b87('0x25')]);_0x1b5bdd[_0x7b87('0x27')]=_[_0x7b87('0x28')](_0x1b5bdd[_0x7b87('0x29')],_0x1b5bdd[_0x7b87('0x25')]);_0x372b7c['attributes']=_[_0x7b87('0x28')](_0x1b5bdd[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x31c016[_0x7b87('0x25')]['fields']));_0x372b7c[_0x7b87('0x2a')]=_0x372b7c[_0x7b87('0x2a')][_0x7b87('0x2c')]?_0x372b7c[_0x7b87('0x2a')]:_0x1b5bdd[_0x7b87('0x29')];if(_0x31c016[_0x7b87('0x25')]['includeAll']){_0x372b7c['include']=[{'all':!![]}];}_0x372b7c=_['merge']({},_0x372b7c,_0x31c016[_0x7b87('0x34')]);return db[_0x7b87('0x35')][_0x7b87('0x3d')](_0x372b7c)[_0x7b87('0x1d')](handleEntityNotFound(_0x172181,null))[_0x7b87('0x1d')](respondWithResult(_0x172181,null))[_0x7b87('0x39')](handleError(_0x172181,null));};exports[_0x7b87('0x3e')]=function(_0x13904d,_0x2143e3){return db[_0x7b87('0x35')]['create'](_0x13904d[_0x7b87('0x3f')],{})[_0x7b87('0x1d')](respondWithResult(_0x2143e3,0xc9))[_0x7b87('0x39')](handleError(_0x2143e3,null));};exports['update']=function(_0x59605b,_0x262e7a){if(_0x59605b[_0x7b87('0x3f')]['id']){delete _0x59605b[_0x7b87('0x3f')]['id'];}return db[_0x7b87('0x35')][_0x7b87('0x3d')]({'where':{'id':_0x59605b[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x262e7a,null))[_0x7b87('0x1d')](saveUpdates(_0x59605b['body'],null))[_0x7b87('0x1d')](respondWithResult(_0x262e7a,null))[_0x7b87('0x39')](handleError(_0x262e7a,null));};exports['destroy']=function(_0x501ce6,_0x3457f5){return db[_0x7b87('0x35')][_0x7b87('0x3d')]({'where':{'id':_0x501ce6[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x3457f5,null))[_0x7b87('0x1d')](removeEntity(_0x3457f5,null))[_0x7b87('0x39')](handleError(_0x3457f5,null));};exports[_0x7b87('0x40')]=function(_0x164483,_0x4a0a5a,_0x3b03bd){var _0x155161={};var _0x76c49b={};var _0x356642;var _0x458b7d;return db[_0x7b87('0x35')][_0x7b87('0x41')]({'where':{'id':_0x164483[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x4a0a5a,null))[_0x7b87('0x1d')](function(_0x4d075a){if(_0x4d075a){_0x356642=_0x4d075a;_0x76c49b[_0x7b87('0x29')]=_[_0x7b87('0x26')](db[_0x7b87('0x42')][_0x7b87('0x3c')]);_0x76c49b[_0x7b87('0x25')]=_[_0x7b87('0x26')](_0x164483[_0x7b87('0x25')]);_0x76c49b[_0x7b87('0x27')]=_['intersection'](_0x76c49b['model'],_0x76c49b[_0x7b87('0x25')]);_0x155161['attributes']=_[_0x7b87('0x28')](_0x76c49b[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x164483['query'][_0x7b87('0x2b')]));_0x155161[_0x7b87('0x2a')]=_0x155161['attributes']['length']?_0x155161[_0x7b87('0x2a')]:_0x76c49b['model'];_0x155161[_0x7b87('0x43')]=qs[_0x7b87('0x2e')](_0x164483[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x155161[_0x7b87('0x2f')]=qs['filters'](_[_0x7b87('0x30')](_0x164483['query'],_0x76c49b[_0x7b87('0x27')]));if(_0x164483['query'][_0x7b87('0x31')]){_0x155161[_0x7b87('0x2f')]=_[_0x7b87('0x32')](_0x155161[_0x7b87('0x2f')],{'$or':_[_0x7b87('0x21')](_0x155161['attributes'],function(_0x4cc68e){var _0x5d6979={};_0x5d6979[_0x4cc68e]={'$like':'%'+_0x164483[_0x7b87('0x25')][_0x7b87('0x31')]+'%'};return _0x5d6979;})});}_0x155161=_['merge']({},_0x155161,_0x164483['options']);return _0x356642[_0x7b87('0x40')](_0x155161);}})[_0x7b87('0x1d')](function(_0x5a3446){if(_0x5a3446){_0x458b7d=_0x5a3446[_0x7b87('0x2c')];if(!_0x164483[_0x7b87('0x25')][_0x7b87('0x44')](_0x7b87('0x2d'))){_0x155161['limit']=qs[_0x7b87('0x16')](_0x164483[_0x7b87('0x25')][_0x7b87('0x16')]);_0x155161[_0x7b87('0x18')]=qs[_0x7b87('0x18')](_0x164483['query'][_0x7b87('0x18')]);}return _0x356642[_0x7b87('0x40')](_0x155161);}})[_0x7b87('0x1d')](function(_0x4f1fcd){if(_0x4f1fcd){return _0x4f1fcd?{'count':_0x458b7d,'rows':_0x4f1fcd}:null;}})[_0x7b87('0x1d')](respondWithResult(_0x4a0a5a,null))[_0x7b87('0x39')](handleError(_0x4a0a5a,null));};exports[_0x7b87('0x45')]=function(_0x5c2122,_0x282217,_0xafbdbe){var _0x39fbc1={};var _0x2e4c8f={};var _0x109e3c;var _0x366fe0;return db[_0x7b87('0x35')][_0x7b87('0x41')]({'where':{'id':_0x5c2122[_0x7b87('0x3b')]['id']}})['then'](handleEntityNotFound(_0x282217,null))[_0x7b87('0x1d')](function(_0x8ff101){if(_0x8ff101){_0x109e3c=_0x8ff101;_0x2e4c8f[_0x7b87('0x29')]=_[_0x7b87('0x26')](db['ServicenowField'][_0x7b87('0x3c')]);_0x2e4c8f['query']=_['keys'](_0x5c2122[_0x7b87('0x25')]);_0x2e4c8f[_0x7b87('0x27')]=_['intersection'](_0x2e4c8f[_0x7b87('0x29')],_0x2e4c8f[_0x7b87('0x25')]);_0x39fbc1[_0x7b87('0x2a')]=_['intersection'](_0x2e4c8f[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x5c2122[_0x7b87('0x25')][_0x7b87('0x2b')]));_0x39fbc1['attributes']=_0x39fbc1['attributes'][_0x7b87('0x2c')]?_0x39fbc1[_0x7b87('0x2a')]:_0x2e4c8f[_0x7b87('0x29')];_0x39fbc1[_0x7b87('0x43')]=qs[_0x7b87('0x2e')](_0x5c2122[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x39fbc1['where']=qs[_0x7b87('0x27')](_[_0x7b87('0x30')](_0x5c2122[_0x7b87('0x25')],_0x2e4c8f['filters']));if(_0x5c2122[_0x7b87('0x25')][_0x7b87('0x31')]){_0x39fbc1[_0x7b87('0x2f')]=_[_0x7b87('0x32')](_0x39fbc1[_0x7b87('0x2f')],{'$or':_[_0x7b87('0x21')](_0x39fbc1[_0x7b87('0x2a')],function(_0x195549){var _0x54b024={};_0x54b024[_0x195549]={'$like':'%'+_0x5c2122['query'][_0x7b87('0x31')]+'%'};return _0x54b024;})});}_0x39fbc1=_[_0x7b87('0x32')]({},_0x39fbc1,_0x5c2122[_0x7b87('0x34')]);return _0x109e3c[_0x7b87('0x45')](_0x39fbc1);}})[_0x7b87('0x1d')](function(_0x339c08){if(_0x339c08){_0x366fe0=_0x339c08['length'];if(!_0x5c2122[_0x7b87('0x25')][_0x7b87('0x44')](_0x7b87('0x2d'))){_0x39fbc1[_0x7b87('0x16')]=qs[_0x7b87('0x16')](_0x5c2122[_0x7b87('0x25')][_0x7b87('0x16')]);_0x39fbc1['offset']=qs['offset'](_0x5c2122['query'][_0x7b87('0x18')]);}return _0x109e3c[_0x7b87('0x45')](_0x39fbc1);}})[_0x7b87('0x1d')](function(_0x402818){if(_0x402818){return _0x402818?{'count':_0x366fe0,'rows':_0x402818}:null;}})[_0x7b87('0x1d')](respondWithResult(_0x282217,null))[_0x7b87('0x39')](handleError(_0x282217,null));};exports[_0x7b87('0x46')]=function(_0x286c37,_0x2a73a0,_0x4ab3b0){var _0x45ecda={};var _0x3ae33f={};var _0x28c1b8;var _0x252208;return db[_0x7b87('0x35')][_0x7b87('0x41')]({'where':{'id':_0x286c37[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x2a73a0,null))[_0x7b87('0x1d')](function(_0x2d9d77){if(_0x2d9d77){_0x28c1b8=_0x2d9d77;_0x3ae33f['model']=_[_0x7b87('0x26')](db[_0x7b87('0x42')][_0x7b87('0x3c')]);_0x3ae33f['query']=_[_0x7b87('0x26')](_0x286c37[_0x7b87('0x25')]);_0x3ae33f[_0x7b87('0x27')]=_[_0x7b87('0x28')](_0x3ae33f['model'],_0x3ae33f[_0x7b87('0x25')]);_0x45ecda[_0x7b87('0x2a')]=_['intersection'](_0x3ae33f[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x286c37['query']['fields']));_0x45ecda[_0x7b87('0x2a')]=_0x45ecda[_0x7b87('0x2a')][_0x7b87('0x2c')]?_0x45ecda['attributes']:_0x3ae33f[_0x7b87('0x29')];_0x45ecda['order']=qs[_0x7b87('0x2e')](_0x286c37[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x45ecda['where']=qs[_0x7b87('0x27')](_[_0x7b87('0x30')](_0x286c37['query'],_0x3ae33f[_0x7b87('0x27')]));if(_0x286c37['query'][_0x7b87('0x31')]){_0x45ecda[_0x7b87('0x2f')]=_['merge'](_0x45ecda[_0x7b87('0x2f')],{'$or':_['map'](_0x45ecda[_0x7b87('0x2a')],function(_0x5d5d54){var _0x3ff7cc={};_0x3ff7cc[_0x5d5d54]={'$like':'%'+_0x286c37[_0x7b87('0x25')][_0x7b87('0x31')]+'%'};return _0x3ff7cc;})});}_0x45ecda=_[_0x7b87('0x32')]({},_0x45ecda,_0x286c37[_0x7b87('0x34')]);return _0x28c1b8[_0x7b87('0x46')](_0x45ecda);}})[_0x7b87('0x1d')](function(_0x2aec52){if(_0x2aec52){_0x252208=_0x2aec52[_0x7b87('0x2c')];if(!_0x286c37[_0x7b87('0x25')][_0x7b87('0x44')](_0x7b87('0x2d'))){_0x45ecda['limit']=qs[_0x7b87('0x16')](_0x286c37['query'][_0x7b87('0x16')]);_0x45ecda['offset']=qs['offset'](_0x286c37[_0x7b87('0x25')]['offset']);}return _0x28c1b8[_0x7b87('0x46')](_0x45ecda);}})['then'](function(_0x374105){if(_0x374105){return _0x374105?{'count':_0x252208,'rows':_0x374105}:null;}})[_0x7b87('0x1d')](respondWithResult(_0x2a73a0,null))[_0x7b87('0x39')](handleError(_0x2a73a0,null));}; \ No newline at end of file +var _0x56d5=['query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','rawAttributes','filters','includeAll','find','create','body','params','getFields','findOne','ServicenowField','order','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','ServicenowConfiguration','key','name'];(function(_0x34a10c,_0x7ce96a){var _0x3015ab=function(_0x159266){while(--_0x159266){_0x34a10c['push'](_0x34a10c['shift']());}};_0x3015ab(++_0x7ce96a);}(_0x56d5,0xbf));var _0x556d=function(_0x194712,_0x2b8d54){_0x194712=_0x194712-0x0;var _0x43b4fc=_0x56d5[_0x194712];return _0x43b4fc;};'use strict';var emlformat=require(_0x556d('0x0'));var rimraf=require(_0x556d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x556d('0x2'));var rp=require(_0x556d('0x3'));var moment=require(_0x556d('0x4'));var BPromise=require(_0x556d('0x5'));var Mustache=require(_0x556d('0x6'));var util=require('util');var path=require(_0x556d('0x7'));var sox=require(_0x556d('0x8'));var csv=require(_0x556d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x556d('0xa'));var _=require(_0x556d('0xb'));var squel=require(_0x556d('0xc'));var crypto=require(_0x556d('0xd'));var jsforce=require(_0x556d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x556d('0xf'));var Papa=require(_0x556d('0x10'));var Redis=require('ioredis');var authService=require(_0x556d('0x11'));var qs=require(_0x556d('0x12'));var as=require(_0x556d('0x13'));var hardwareService=require(_0x556d('0x14'));var logger=require(_0x556d('0x15'))('api');var utils=require(_0x556d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x556d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5928a6,_0x5acf37){_0x5acf37=_0x5acf37||0xcc;return function(_0x206b2e){if(_0x206b2e){return _0x5928a6[_0x556d('0x18')](_0x5acf37);}return _0x5928a6[_0x556d('0x19')](_0x5acf37)[_0x556d('0x1a')]();};}function respondWithResult(_0x107021,_0xd4e86c){_0xd4e86c=_0xd4e86c||0xc8;return function(_0x1c01a9){if(_0x1c01a9){return _0x107021['status'](_0xd4e86c)['json'](_0x1c01a9);}};}function respondWithFilteredResult(_0x2bfe5f,_0x399866){return function(_0x3c60f1){if(_0x3c60f1){var _0x439311=typeof _0x399866[_0x556d('0x1b')]==='undefined'&&typeof _0x399866[_0x556d('0x1c')]===_0x556d('0x1d');var _0x198ac2=_0x3c60f1[_0x556d('0x1e')];var _0x2c6ecd=_0x439311?0x0:_0x399866[_0x556d('0x1b')];var _0x29bd88=_0x439311?_0x3c60f1[_0x556d('0x1e')]:_0x399866[_0x556d('0x1b')]+_0x399866[_0x556d('0x1c')];var _0x5aa2e0;if(_0x29bd88>=_0x198ac2){_0x29bd88=_0x198ac2;_0x5aa2e0=0xc8;}else{_0x5aa2e0=0xce;}_0x2bfe5f[_0x556d('0x19')](_0x5aa2e0);return _0x2bfe5f[_0x556d('0x1f')](_0x556d('0x20'),_0x2c6ecd+'-'+_0x29bd88+'/'+_0x198ac2)['json'](_0x3c60f1);}return null;};}function patchUpdates(_0x2771f6){return function(_0x2697c2){try{jsonpatch[_0x556d('0x21')](_0x2697c2,_0x2771f6,!![]);}catch(_0xffa032){return BPromise['reject'](_0xffa032);}return _0x2697c2[_0x556d('0x22')]();};}function saveUpdates(_0x284679,_0x4b9dd6){return function(_0x472ebf){if(_0x472ebf){return _0x472ebf[_0x556d('0x23')](_0x284679)[_0x556d('0x24')](function(_0x7dce6a){return _0x7dce6a;});}return null;};}function removeEntity(_0x7d1466,_0x7297fb){return function(_0x30cc03){if(_0x30cc03){return _0x30cc03[_0x556d('0x25')]()[_0x556d('0x24')](function(){_0x7d1466['status'](0xcc)[_0x556d('0x1a')]();});}};}function handleEntityNotFound(_0x171cc1,_0x4c3bff){return function(_0x21c4c4){if(!_0x21c4c4){_0x171cc1[_0x556d('0x18')](0x194);}return _0x21c4c4;};}function handleError(_0x1491e5,_0x584152){_0x584152=_0x584152||0x1f4;return function(_0x421e6c){logger[_0x556d('0x26')](_0x421e6c[_0x556d('0x27')]);if(_0x421e6c['name']){delete _0x421e6c['name'];}_0x1491e5[_0x556d('0x19')](_0x584152)[_0x556d('0x28')](_0x421e6c);};}exports[_0x556d('0x29')]=function(_0x28684d,_0x2bf96b){var _0x17e8f1={},_0x4c3952={},_0x27c520={'count':0x0,'rows':[]};var _0x5b55df=_[_0x556d('0x2a')](db[_0x556d('0x2b')]['rawAttributes'],function(_0x2c044a){return{'name':_0x2c044a['fieldName'],'type':_0x2c044a['type'][_0x556d('0x2c')]};});_0x4c3952['model']=_[_0x556d('0x2a')](_0x5b55df,_0x556d('0x2d'));_0x4c3952[_0x556d('0x2e')]=_[_0x556d('0x2f')](_0x28684d[_0x556d('0x2e')]);_0x4c3952['filters']=_['intersection'](_0x4c3952[_0x556d('0x30')],_0x4c3952[_0x556d('0x2e')]);_0x17e8f1[_0x556d('0x31')]=_[_0x556d('0x32')](_0x4c3952['model'],qs[_0x556d('0x33')](_0x28684d['query']['fields']));_0x17e8f1[_0x556d('0x31')]=_0x17e8f1['attributes'][_0x556d('0x34')]?_0x17e8f1[_0x556d('0x31')]:_0x4c3952[_0x556d('0x30')];if(!_0x28684d[_0x556d('0x2e')][_0x556d('0x35')]('nolimit')){_0x17e8f1['limit']=qs['limit'](_0x28684d[_0x556d('0x2e')]['limit']);_0x17e8f1[_0x556d('0x1b')]=qs[_0x556d('0x1b')](_0x28684d[_0x556d('0x2e')][_0x556d('0x1b')]);}_0x17e8f1['order']=qs[_0x556d('0x36')](_0x28684d['query'][_0x556d('0x36')]);_0x17e8f1[_0x556d('0x37')]=qs['filters'](_[_0x556d('0x38')](_0x28684d[_0x556d('0x2e')],_0x4c3952['filters']),_0x5b55df);if(_0x28684d[_0x556d('0x2e')][_0x556d('0x39')]){_0x17e8f1[_0x556d('0x37')]=_[_0x556d('0x3a')](_0x17e8f1[_0x556d('0x37')],{'$or':_['map'](_0x5b55df,function(_0x17ad01){if(_0x17ad01[_0x556d('0x3b')]!=='VIRTUAL'){var _0x242f76={};_0x242f76[_0x17ad01[_0x556d('0x2d')]]={'$like':'%'+_0x28684d[_0x556d('0x2e')]['filter']+'%'};return _0x242f76;}})});}_0x17e8f1=_[_0x556d('0x3a')]({},_0x17e8f1,_0x28684d[_0x556d('0x3c')]);var _0x55180c={'where':_0x17e8f1[_0x556d('0x37')]};return db[_0x556d('0x2b')][_0x556d('0x1e')](_0x55180c)[_0x556d('0x24')](function(_0x5a8aea){_0x27c520[_0x556d('0x1e')]=_0x5a8aea;if(_0x28684d[_0x556d('0x2e')]['includeAll']){_0x17e8f1[_0x556d('0x3d')]=[{'all':!![]}];}return db[_0x556d('0x2b')][_0x556d('0x3e')](_0x17e8f1);})[_0x556d('0x24')](function(_0x5d53e2){_0x27c520[_0x556d('0x3f')]=_0x5d53e2;return _0x27c520;})['then'](respondWithFilteredResult(_0x2bf96b,_0x17e8f1))[_0x556d('0x40')](handleError(_0x2bf96b,null));};exports['show']=function(_0x2b80c9,_0xd13d81){var _0xc29035={'raw':![],'where':{'id':_0x2b80c9['params']['id']}},_0x241435={};_0x241435[_0x556d('0x30')]=_[_0x556d('0x2f')](db[_0x556d('0x2b')][_0x556d('0x41')]);_0x241435['query']=_[_0x556d('0x2f')](_0x2b80c9[_0x556d('0x2e')]);_0x241435[_0x556d('0x42')]=_['intersection'](_0x241435[_0x556d('0x30')],_0x241435['query']);_0xc29035[_0x556d('0x31')]=_[_0x556d('0x32')](_0x241435[_0x556d('0x30')],qs[_0x556d('0x33')](_0x2b80c9[_0x556d('0x2e')]['fields']));_0xc29035[_0x556d('0x31')]=_0xc29035[_0x556d('0x31')]['length']?_0xc29035[_0x556d('0x31')]:_0x241435['model'];if(_0x2b80c9[_0x556d('0x2e')][_0x556d('0x43')]){_0xc29035[_0x556d('0x3d')]=[{'all':!![]}];}_0xc29035=_[_0x556d('0x3a')]({},_0xc29035,_0x2b80c9['options']);return db[_0x556d('0x2b')][_0x556d('0x44')](_0xc29035)[_0x556d('0x24')](handleEntityNotFound(_0xd13d81,null))[_0x556d('0x24')](respondWithResult(_0xd13d81,null))[_0x556d('0x40')](handleError(_0xd13d81,null));};exports[_0x556d('0x45')]=function(_0x29d80b,_0x5d0add){return db[_0x556d('0x2b')][_0x556d('0x45')](_0x29d80b['body'],{})[_0x556d('0x24')](respondWithResult(_0x5d0add,0xc9))[_0x556d('0x40')](handleError(_0x5d0add,null));};exports['update']=function(_0x1a4730,_0x5c7848){if(_0x1a4730[_0x556d('0x46')]['id']){delete _0x1a4730[_0x556d('0x46')]['id'];}return db[_0x556d('0x2b')][_0x556d('0x44')]({'where':{'id':_0x1a4730[_0x556d('0x47')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x5c7848,null))[_0x556d('0x24')](saveUpdates(_0x1a4730[_0x556d('0x46')],null))[_0x556d('0x24')](respondWithResult(_0x5c7848,null))[_0x556d('0x40')](handleError(_0x5c7848,null));};exports[_0x556d('0x25')]=function(_0x2557e4,_0x247b5d){return db[_0x556d('0x2b')][_0x556d('0x44')]({'where':{'id':_0x2557e4[_0x556d('0x47')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x247b5d,null))[_0x556d('0x24')](removeEntity(_0x247b5d,null))['catch'](handleError(_0x247b5d,null));};exports[_0x556d('0x48')]=function(_0x5a4ab2,_0xcef0ef,_0x418274){var _0x58f97b={};var _0x5e043d={};var _0x13666b;var _0xae5f38;return db[_0x556d('0x2b')][_0x556d('0x49')]({'where':{'id':_0x5a4ab2[_0x556d('0x47')]['id']}})['then'](handleEntityNotFound(_0xcef0ef,null))['then'](function(_0x2e3ddb){if(_0x2e3ddb){_0x13666b=_0x2e3ddb;_0x5e043d[_0x556d('0x30')]=_[_0x556d('0x2f')](db[_0x556d('0x4a')][_0x556d('0x41')]);_0x5e043d[_0x556d('0x2e')]=_[_0x556d('0x2f')](_0x5a4ab2['query']);_0x5e043d['filters']=_[_0x556d('0x32')](_0x5e043d[_0x556d('0x30')],_0x5e043d[_0x556d('0x2e')]);_0x58f97b[_0x556d('0x31')]=_[_0x556d('0x32')](_0x5e043d['model'],qs[_0x556d('0x33')](_0x5a4ab2['query'][_0x556d('0x33')]));_0x58f97b['attributes']=_0x58f97b[_0x556d('0x31')][_0x556d('0x34')]?_0x58f97b[_0x556d('0x31')]:_0x5e043d[_0x556d('0x30')];_0x58f97b[_0x556d('0x4b')]=qs[_0x556d('0x36')](_0x5a4ab2[_0x556d('0x2e')][_0x556d('0x36')]);_0x58f97b['where']=qs[_0x556d('0x42')](_[_0x556d('0x38')](_0x5a4ab2['query'],_0x5e043d['filters']));if(_0x5a4ab2['query'][_0x556d('0x39')]){_0x58f97b[_0x556d('0x37')]=_[_0x556d('0x3a')](_0x58f97b[_0x556d('0x37')],{'$or':_['map'](_0x58f97b[_0x556d('0x31')],function(_0x1ff5b1){var _0x1cb8ef={};_0x1cb8ef[_0x1ff5b1]={'$like':'%'+_0x5a4ab2['query'][_0x556d('0x39')]+'%'};return _0x1cb8ef;})});}_0x58f97b=_['merge']({},_0x58f97b,_0x5a4ab2['options']);return _0x13666b[_0x556d('0x48')](_0x58f97b);}})[_0x556d('0x24')](function(_0xa2aca4){if(_0xa2aca4){_0xae5f38=_0xa2aca4[_0x556d('0x34')];if(!_0x5a4ab2[_0x556d('0x2e')][_0x556d('0x35')](_0x556d('0x4c'))){_0x58f97b[_0x556d('0x1c')]=qs[_0x556d('0x1c')](_0x5a4ab2[_0x556d('0x2e')][_0x556d('0x1c')]);_0x58f97b['offset']=qs[_0x556d('0x1b')](_0x5a4ab2[_0x556d('0x2e')][_0x556d('0x1b')]);}return _0x13666b['getFields'](_0x58f97b);}})[_0x556d('0x24')](function(_0x3ba671){if(_0x3ba671){return _0x3ba671?{'count':_0xae5f38,'rows':_0x3ba671}:null;}})[_0x556d('0x24')](respondWithResult(_0xcef0ef,null))['catch'](handleError(_0xcef0ef,null));};exports[_0x556d('0x4d')]=function(_0x2c9648,_0x3f2ee0,_0x343338){var _0x3b1393={};var _0x27c06b={};var _0x314236;var _0x4a5dd2;return db[_0x556d('0x2b')][_0x556d('0x49')]({'where':{'id':_0x2c9648['params']['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x3f2ee0,null))[_0x556d('0x24')](function(_0x42b67b){if(_0x42b67b){_0x314236=_0x42b67b;_0x27c06b[_0x556d('0x30')]=_['keys'](db[_0x556d('0x4a')][_0x556d('0x41')]);_0x27c06b['query']=_['keys'](_0x2c9648['query']);_0x27c06b[_0x556d('0x42')]=_['intersection'](_0x27c06b[_0x556d('0x30')],_0x27c06b['query']);_0x3b1393['attributes']=_[_0x556d('0x32')](_0x27c06b[_0x556d('0x30')],qs['fields'](_0x2c9648[_0x556d('0x2e')][_0x556d('0x33')]));_0x3b1393[_0x556d('0x31')]=_0x3b1393[_0x556d('0x31')][_0x556d('0x34')]?_0x3b1393[_0x556d('0x31')]:_0x27c06b[_0x556d('0x30')];_0x3b1393[_0x556d('0x4b')]=qs[_0x556d('0x36')](_0x2c9648[_0x556d('0x2e')][_0x556d('0x36')]);_0x3b1393[_0x556d('0x37')]=qs['filters'](_[_0x556d('0x38')](_0x2c9648[_0x556d('0x2e')],_0x27c06b[_0x556d('0x42')]));if(_0x2c9648['query'][_0x556d('0x39')]){_0x3b1393[_0x556d('0x37')]=_[_0x556d('0x3a')](_0x3b1393[_0x556d('0x37')],{'$or':_[_0x556d('0x2a')](_0x3b1393[_0x556d('0x31')],function(_0x3ed79f){var _0xa29f19={};_0xa29f19[_0x3ed79f]={'$like':'%'+_0x2c9648['query'][_0x556d('0x39')]+'%'};return _0xa29f19;})});}_0x3b1393=_[_0x556d('0x3a')]({},_0x3b1393,_0x2c9648[_0x556d('0x3c')]);return _0x314236[_0x556d('0x4d')](_0x3b1393);}})[_0x556d('0x24')](function(_0x12283b){if(_0x12283b){_0x4a5dd2=_0x12283b[_0x556d('0x34')];if(!_0x2c9648['query']['hasOwnProperty'](_0x556d('0x4c'))){_0x3b1393[_0x556d('0x1c')]=qs[_0x556d('0x1c')](_0x2c9648['query']['limit']);_0x3b1393[_0x556d('0x1b')]=qs[_0x556d('0x1b')](_0x2c9648[_0x556d('0x2e')]['offset']);}return _0x314236[_0x556d('0x4d')](_0x3b1393);}})['then'](function(_0x2558f6){if(_0x2558f6){return _0x2558f6?{'count':_0x4a5dd2,'rows':_0x2558f6}:null;}})['then'](respondWithResult(_0x3f2ee0,null))[_0x556d('0x40')](handleError(_0x3f2ee0,null));};exports[_0x556d('0x4e')]=function(_0x3e96a5,_0x2f632a,_0x4a61a8){var _0x308819={};var _0x431bb2={};var _0x29d842;var _0x1f5e50;return db[_0x556d('0x2b')]['findOne']({'where':{'id':_0x3e96a5[_0x556d('0x47')]['id']}})[_0x556d('0x24')](handleEntityNotFound(_0x2f632a,null))[_0x556d('0x24')](function(_0x253eed){if(_0x253eed){_0x29d842=_0x253eed;_0x431bb2[_0x556d('0x30')]=_[_0x556d('0x2f')](db[_0x556d('0x4a')][_0x556d('0x41')]);_0x431bb2[_0x556d('0x2e')]=_[_0x556d('0x2f')](_0x3e96a5['query']);_0x431bb2['filters']=_[_0x556d('0x32')](_0x431bb2[_0x556d('0x30')],_0x431bb2['query']);_0x308819['attributes']=_[_0x556d('0x32')](_0x431bb2[_0x556d('0x30')],qs[_0x556d('0x33')](_0x3e96a5[_0x556d('0x2e')]['fields']));_0x308819['attributes']=_0x308819[_0x556d('0x31')][_0x556d('0x34')]?_0x308819[_0x556d('0x31')]:_0x431bb2[_0x556d('0x30')];_0x308819[_0x556d('0x4b')]=qs['sort'](_0x3e96a5['query'][_0x556d('0x36')]);_0x308819[_0x556d('0x37')]=qs['filters'](_[_0x556d('0x38')](_0x3e96a5[_0x556d('0x2e')],_0x431bb2[_0x556d('0x42')]));if(_0x3e96a5[_0x556d('0x2e')][_0x556d('0x39')]){_0x308819['where']=_[_0x556d('0x3a')](_0x308819[_0x556d('0x37')],{'$or':_['map'](_0x308819[_0x556d('0x31')],function(_0x2b9afb){var _0x56d25e={};_0x56d25e[_0x2b9afb]={'$like':'%'+_0x3e96a5[_0x556d('0x2e')]['filter']+'%'};return _0x56d25e;})});}_0x308819=_['merge']({},_0x308819,_0x3e96a5[_0x556d('0x3c')]);return _0x29d842['getDescriptions'](_0x308819);}})[_0x556d('0x24')](function(_0x5e05df){if(_0x5e05df){_0x1f5e50=_0x5e05df[_0x556d('0x34')];if(!_0x3e96a5[_0x556d('0x2e')][_0x556d('0x35')](_0x556d('0x4c'))){_0x308819['limit']=qs[_0x556d('0x1c')](_0x3e96a5[_0x556d('0x2e')]['limit']);_0x308819[_0x556d('0x1b')]=qs['offset'](_0x3e96a5[_0x556d('0x2e')][_0x556d('0x1b')]);}return _0x29d842[_0x556d('0x4e')](_0x308819);}})[_0x556d('0x24')](function(_0xf559f4){if(_0xf559f4){return _0xf559f4?{'count':_0x1f5e50,'rows':_0xf559f4}:null;}})['then'](respondWithResult(_0x2f632a,null))[_0x556d('0x40')](handleError(_0x2f632a,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 6d9b624..48f89cb 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 _0x20df=['../../config/environment','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x310784,_0x2cf41a){var _0x1d9552=function(_0x43c5d9){while(--_0x43c5d9){_0x310784['push'](_0x310784['shift']());}};_0x1d9552(++_0x2cf41a);}(_0x20df,0x7c));var _0xf20d=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x20df[_0x5e77db];return _0x34b675;};'use strict';var _=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var logger=require(_0xf20d('0x2'))(_0xf20d('0x3'));var moment=require('moment');var BPromise=require(_0xf20d('0x4'));var rp=require(_0xf20d('0x5'));var fs=require('fs');var path=require(_0xf20d('0x6'));var rimraf=require(_0xf20d('0x7'));var config=require(_0xf20d('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xf20d('0x9')]=function(_0x48d4f2,_0x397065){return _0x48d4f2[_0xf20d('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0xf20d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e3=['./intServicenowConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x16f775,_0x45b10f){var _0x17d9e2=function(_0x3d2ccf){while(--_0x3d2ccf){_0x16f775['push'](_0x16f775['shift']());}};_0x17d9e2(++_0x45b10f);}(_0x70e3,0x9d));var _0x370e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x70e3[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var logger=require(_0x370e('0x2'))(_0x370e('0x3'));var moment=require('moment');var BPromise=require(_0x370e('0x4'));var rp=require(_0x370e('0x5'));var fs=require('fs');var path=require(_0x370e('0x6'));var rimraf=require('rimraf');var config=require(_0x370e('0x7'));var attributes=require(_0x370e('0x8'));module[_0x370e('0x9')]=function(_0x2b99d1,_0x47c815){return _0x2b99d1[_0x370e('0xa')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','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 c5e17bf..3ddc9b3 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 _0x29d0=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xf96040,_0x3e93b4){var _0x1194ea=function(_0x5ce9aa){while(--_0x5ce9aa){_0xf96040['push'](_0xf96040['shift']());}};_0x1194ea(++_0x3e93b4);}(_0x29d0,0x1c2));var _0x029d=function(_0x3b207f,_0x268403){_0x3b207f=_0x3b207f-0x0;var _0x51bedb=_0x29d0[_0x3b207f];return _0x51bedb;};'use strict';var _=require(_0x029d('0x0'));var util=require(_0x029d('0x1'));var moment=require(_0x029d('0x2'));var BPromise=require(_0x029d('0x3'));var rs=require(_0x029d('0x4'));var fs=require('fs');var Redis=require(_0x029d('0x5'));var db=require(_0x029d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x029d('0x7'));var config=require(_0x029d('0x8'));var jayson=require(_0x029d('0x9'));var client=jayson[_0x029d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24de85,_0x3cfde1,_0x496821){return new BPromise(function(_0x1b52ab,_0x68eb10){return client[_0x029d('0xb')](_0x24de85,_0x496821)[_0x029d('0xc')](function(_0x5f24bd){logger[_0x029d('0xd')](_0x029d('0xe'),_0x3cfde1,_0x029d('0xf'));logger[_0x029d('0x10')](_0x029d('0x11'),_0x3cfde1,_0x029d('0xf'),JSON[_0x029d('0x12')](_0x5f24bd));if(_0x5f24bd['error']){if(_0x5f24bd[_0x029d('0x13')][_0x029d('0x14')]===0x1f4){logger[_0x029d('0x13')](_0x029d('0xe'),_0x3cfde1,_0x5f24bd[_0x029d('0x13')]['message']);return _0x68eb10(_0x5f24bd[_0x029d('0x13')][_0x029d('0x15')]);}logger['error'](_0x029d('0xe'),_0x3cfde1,_0x5f24bd[_0x029d('0x13')][_0x029d('0x15')]);return _0x1b52ab(_0x5f24bd[_0x029d('0x13')][_0x029d('0x15')]);}else{logger['info'](_0x029d('0xe'),_0x3cfde1,_0x029d('0xf'));_0x1b52ab(_0x5f24bd['result'][_0x029d('0x15')]);}})['catch'](function(_0x29eb5f){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3cfde1,_0x29eb5f);_0x68eb10(_0x29eb5f);});});} \ No newline at end of file +var _0x8e50=['rpc','../../config/environment','jayson/promise','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x8e50,0x1ae));var _0x08e5=function(_0x104aea,_0x541bf1){_0x104aea=_0x104aea-0x0;var _0x472ade=_0x8e50[_0x104aea];return _0x472ade;};'use strict';var _=require('lodash');var util=require(_0x08e5('0x0'));var moment=require(_0x08e5('0x1'));var BPromise=require(_0x08e5('0x2'));var rs=require(_0x08e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08e5('0x4'))['db'];var utils=require(_0x08e5('0x5'));var logger=require(_0x08e5('0x6'))(_0x08e5('0x7'));var config=require(_0x08e5('0x8'));var jayson=require(_0x08e5('0x9'));var client=jayson[_0x08e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541192,_0x38994f,_0x702103){return new BPromise(function(_0x4c9258,_0x17fc3e){return client[_0x08e5('0xb')](_0x541192,_0x702103)['then'](function(_0x2e1c15){logger[_0x08e5('0xc')](_0x08e5('0xd'),_0x38994f,_0x08e5('0xe'));logger[_0x08e5('0xf')](_0x08e5('0x10'),_0x38994f,_0x08e5('0xe'),JSON[_0x08e5('0x11')](_0x2e1c15));if(_0x2e1c15[_0x08e5('0x12')]){if(_0x2e1c15[_0x08e5('0x12')][_0x08e5('0x13')]===0x1f4){logger[_0x08e5('0x12')](_0x08e5('0xd'),_0x38994f,_0x2e1c15['error'][_0x08e5('0x14')]);return _0x17fc3e(_0x2e1c15[_0x08e5('0x12')]['message']);}logger[_0x08e5('0x12')](_0x08e5('0xd'),_0x38994f,_0x2e1c15[_0x08e5('0x12')][_0x08e5('0x14')]);return _0x4c9258(_0x2e1c15[_0x08e5('0x12')]['message']);}else{logger['info'](_0x08e5('0xd'),_0x38994f,_0x08e5('0xe'));_0x4c9258(_0x2e1c15[_0x08e5('0x15')][_0x08e5('0x14')]);}})[_0x08e5('0x16')](function(_0x1302d8){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x38994f,_0x1302d8);_0x17fc3e(_0x1302d8);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index cf65661..b17fb75 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 _0x5106=['isAuthenticated','get','show','post','put','/:id','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0x5106,0x118));var _0x6510=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5106[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x6510('0x0'));var util=require(_0x6510('0x1'));var path=require(_0x6510('0x2'));var timeout=require(_0x6510('0x3'));var express=require('express');var router=express[_0x6510('0x4')]();var fs_extra=require(_0x6510('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6510('0x6'));var config=require(_0x6510('0x7'));var controller=require(_0x6510('0x8'));router['get']('/',auth[_0x6510('0x9')](),controller['index']);router[_0x6510('0xa')]('/:id',auth[_0x6510('0x9')](),controller[_0x6510('0xb')]);router[_0x6510('0xc')]('/',auth[_0x6510('0x9')](),controller['create']);router[_0x6510('0xd')](_0x6510('0xe'),auth[_0x6510('0x9')](),controller['update']);router[_0x6510('0xf')](_0x6510('0xe'),auth[_0x6510('0x9')](),controller[_0x6510('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe6cb=['delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2c1a6f,_0x147410){var _0x266ce4=function(_0x4491cb){while(--_0x4491cb){_0x2c1a6f['push'](_0x2c1a6f['shift']());}};_0x266ce4(++_0x147410);}(_0xe6cb,0xad));var _0xbe6c=function(_0x5af25e,_0x1afd15){_0x5af25e=_0x5af25e-0x0;var _0x4e29b1=_0xe6cb[_0x5af25e];return _0x4e29b1;};'use strict';var multer=require(_0xbe6c('0x0'));var util=require(_0xbe6c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe6c('0x2'));var router=express[_0xbe6c('0x3')]();var fs_extra=require(_0xbe6c('0x4'));var auth=require(_0xbe6c('0x5'));var interaction=require(_0xbe6c('0x6'));var config=require(_0xbe6c('0x7'));var controller=require(_0xbe6c('0x8'));router[_0xbe6c('0x9')]('/',auth[_0xbe6c('0xa')](),controller[_0xbe6c('0xb')]);router['get'](_0xbe6c('0xc'),auth['isAuthenticated'](),controller[_0xbe6c('0xd')]);router[_0xbe6c('0xe')]('/',auth[_0xbe6c('0xa')](),controller['create']);router[_0xbe6c('0xf')](_0xbe6c('0xc'),auth[_0xbe6c('0xa')](),controller[_0xbe6c('0x10')]);router[_0xbe6c('0x11')](_0xbe6c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe6c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 0ed027b..d75c74d 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 _0x3c54=['BOOLEAN','sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable'];(function(_0x5cf3a3,_0x29327c){var _0x349b78=function(_0x465240){while(--_0x465240){_0x5cf3a3['push'](_0x5cf3a3['shift']());}};_0x349b78(++_0x29327c);}(_0x3c54,0x17d));var _0x43c5=function(_0x142366,_0x36f37a){_0x142366=_0x142366-0x0;var _0x3349d7=_0x3c54[_0x142366];return _0x3349d7;};'use strict';var Sequelize=require(_0x43c5('0x0'));module[_0x43c5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x43c5('0x2'),'variable',_0x43c5('0x3'),_0x43c5('0x4'),_0x43c5('0x5')),'defaultValue':_0x43c5('0x2')},'content':{'type':Sequelize[_0x43c5('0x6')]},'key':{'type':Sequelize[_0x43c5('0x6')]},'keyType':{'type':Sequelize[_0x43c5('0x7')](_0x43c5('0x2'),_0x43c5('0x8'),_0x43c5('0x3'))},'keyContent':{'type':Sequelize[_0x43c5('0x6')]},'idField':{'type':Sequelize[_0x43c5('0x6')]},'nameField':{'type':Sequelize[_0x43c5('0x6')]},'customField':{'type':Sequelize[_0x43c5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x43c5('0x6')]}}; \ No newline at end of file +var _0x3029=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x56c620,_0x14e7da){var _0x33b8cc=function(_0x12d9b6){while(--_0x12d9b6){_0x56c620['push'](_0x56c620['shift']());}};_0x33b8cc(++_0x14e7da);}(_0x3029,0x190));var _0x9302=function(_0x554b96,_0xa7f28){_0x554b96=_0x554b96-0x0;var _0xe445a8=_0x3029[_0x554b96];return _0xe445a8;};'use strict';var Sequelize=require('sequelize');module[_0x9302('0x0')]={'type':{'type':Sequelize[_0x9302('0x1')](_0x9302('0x2'),_0x9302('0x3'),_0x9302('0x4'),_0x9302('0x5'),'picklist'),'defaultValue':_0x9302('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9302('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x9302('0x3'),_0x9302('0x4'))},'keyContent':{'type':Sequelize[_0x9302('0x6')]},'idField':{'type':Sequelize[_0x9302('0x6')]},'nameField':{'type':Sequelize[_0x9302('0x6')]},'customField':{'type':Sequelize[_0x9302('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9302('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c82a6bc..62b750a 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 _0x66b4=['type','key','name','keys','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','ServicenowField','findAll','catch','show','intersection','include','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName'];(function(_0x1250c9,_0x4034c2){var _0x6fbaa=function(_0x368ea0){while(--_0x368ea0){_0x1250c9['push'](_0x1250c9['shift']());}};_0x6fbaa(++_0x4034c2);}(_0x66b4,0x153));var _0x466b=function(_0x240362,_0x2bd6b3){_0x240362=_0x240362-0x0;var _0x54a9db=_0x66b4[_0x240362];return _0x54a9db;};'use strict';var emlformat=require(_0x466b('0x0'));var rimraf=require(_0x466b('0x1'));var zipdir=require(_0x466b('0x2'));var jsonpatch=require(_0x466b('0x3'));var rp=require(_0x466b('0x4'));var moment=require(_0x466b('0x5'));var BPromise=require(_0x466b('0x6'));var Mustache=require(_0x466b('0x7'));var util=require(_0x466b('0x8'));var path=require('path');var sox=require(_0x466b('0x9'));var csv=require(_0x466b('0xa'));var ejs=require(_0x466b('0xb'));var fs=require('fs');var fs_extra=require(_0x466b('0xc'));var _=require(_0x466b('0xd'));var squel=require('squel');var crypto=require(_0x466b('0xe'));var jsforce=require(_0x466b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x466b('0xa'));var querystring=require(_0x466b('0x10'));var Papa=require('papaparse');var Redis=require(_0x466b('0x11'));var authService=require(_0x466b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x466b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x466b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x466b('0x15'));var licenseUtil=require(_0x466b('0x16'));var db=require(_0x466b('0x17'))['db'];function respondWithStatusCode(_0x346aab,_0x1e6091){_0x1e6091=_0x1e6091||0xcc;return function(_0x1046a5){if(_0x1046a5){return _0x346aab[_0x466b('0x18')](_0x1e6091);}return _0x346aab[_0x466b('0x19')](_0x1e6091)[_0x466b('0x1a')]();};}function respondWithResult(_0x97f019,_0x35c6af){_0x35c6af=_0x35c6af||0xc8;return function(_0xaf87ae){if(_0xaf87ae){return _0x97f019[_0x466b('0x19')](_0x35c6af)['json'](_0xaf87ae);}};}function respondWithFilteredResult(_0x44d846,_0x12f0fd){return function(_0xe06bc1){if(_0xe06bc1){var _0xaf0c16=typeof _0x12f0fd[_0x466b('0x1b')]==='undefined'&&typeof _0x12f0fd['limit']===_0x466b('0x1c');var _0x404fce=_0xe06bc1[_0x466b('0x1d')];var _0x4d79ef=_0xaf0c16?0x0:_0x12f0fd[_0x466b('0x1b')];var _0x113154=_0xaf0c16?_0xe06bc1[_0x466b('0x1d')]:_0x12f0fd[_0x466b('0x1b')]+_0x12f0fd[_0x466b('0x1e')];var _0x3a23c5;if(_0x113154>=_0x404fce){_0x113154=_0x404fce;_0x3a23c5=0xc8;}else{_0x3a23c5=0xce;}_0x44d846[_0x466b('0x19')](_0x3a23c5);return _0x44d846[_0x466b('0x1f')](_0x466b('0x20'),_0x4d79ef+'-'+_0x113154+'/'+_0x404fce)[_0x466b('0x21')](_0xe06bc1);}return null;};}function patchUpdates(_0x2b7de0){return function(_0x598318){try{jsonpatch[_0x466b('0x22')](_0x598318,_0x2b7de0,!![]);}catch(_0x286e0e){return BPromise[_0x466b('0x23')](_0x286e0e);}return _0x598318[_0x466b('0x24')]();};}function saveUpdates(_0x28241c,_0x5bab23){return function(_0x479802){if(_0x479802){return _0x479802[_0x466b('0x25')](_0x28241c)[_0x466b('0x26')](function(_0x4b427c){return _0x4b427c;});}return null;};}function removeEntity(_0x247086,_0x183051){return function(_0x197b17){if(_0x197b17){return _0x197b17[_0x466b('0x27')]()['then'](function(){_0x247086['status'](0xcc)[_0x466b('0x1a')]();});}};}function handleEntityNotFound(_0x55cf1a,_0xb9f7a2){return function(_0x2d8ec8){if(!_0x2d8ec8){_0x55cf1a[_0x466b('0x18')](0x194);}return _0x2d8ec8;};}function handleError(_0x334d2d,_0xcd8b17){_0xcd8b17=_0xcd8b17||0x1f4;return function(_0x4c0452){logger[_0x466b('0x28')](_0x4c0452[_0x466b('0x29')]);if(_0x4c0452['name']){delete _0x4c0452['name'];}_0x334d2d[_0x466b('0x19')](_0xcd8b17)['send'](_0x4c0452);};}exports[_0x466b('0x2a')]=function(_0xa6475,_0x4cd1fb){var _0x5aa156={},_0x42613d={},_0x439c15={'count':0x0,'rows':[]};var _0x4b9600=_[_0x466b('0x2b')](db['ServicenowField'][_0x466b('0x2c')],function(_0x12671d){return{'name':_0x12671d[_0x466b('0x2d')],'type':_0x12671d[_0x466b('0x2e')][_0x466b('0x2f')]};});_0x42613d['model']=_['map'](_0x4b9600,_0x466b('0x30'));_0x42613d['query']=_[_0x466b('0x31')](_0xa6475[_0x466b('0x32')]);_0x42613d[_0x466b('0x33')]=_['intersection'](_0x42613d[_0x466b('0x34')],_0x42613d['query']);_0x5aa156['attributes']=_['intersection'](_0x42613d['model'],qs[_0x466b('0x35')](_0xa6475[_0x466b('0x32')][_0x466b('0x35')]));_0x5aa156[_0x466b('0x36')]=_0x5aa156[_0x466b('0x36')][_0x466b('0x37')]?_0x5aa156['attributes']:_0x42613d[_0x466b('0x34')];if(!_0xa6475[_0x466b('0x32')][_0x466b('0x38')](_0x466b('0x39'))){_0x5aa156[_0x466b('0x1e')]=qs['limit'](_0xa6475[_0x466b('0x32')]['limit']);_0x5aa156[_0x466b('0x1b')]=qs[_0x466b('0x1b')](_0xa6475[_0x466b('0x32')][_0x466b('0x1b')]);}_0x5aa156[_0x466b('0x3a')]=qs['sort'](_0xa6475[_0x466b('0x32')][_0x466b('0x3b')]);_0x5aa156[_0x466b('0x3c')]=qs[_0x466b('0x33')](_[_0x466b('0x3d')](_0xa6475[_0x466b('0x32')],_0x42613d['filters']),_0x4b9600);if(_0xa6475[_0x466b('0x32')]['filter']){_0x5aa156[_0x466b('0x3c')]=_[_0x466b('0x3e')](_0x5aa156[_0x466b('0x3c')],{'$or':_[_0x466b('0x2b')](_0x4b9600,function(_0x27307d){if(_0x27307d[_0x466b('0x2e')]!==_0x466b('0x3f')){var _0x1266b3={};_0x1266b3[_0x27307d['name']]={'$like':'%'+_0xa6475[_0x466b('0x32')][_0x466b('0x40')]+'%'};return _0x1266b3;}})});}_0x5aa156=_[_0x466b('0x3e')]({},_0x5aa156,_0xa6475['options']);var _0x1c3286={'where':_0x5aa156[_0x466b('0x3c')]};return db['ServicenowField'][_0x466b('0x1d')](_0x1c3286)[_0x466b('0x26')](function(_0xa1e685){_0x439c15[_0x466b('0x1d')]=_0xa1e685;if(_0xa6475['query'][_0x466b('0x41')]){_0x5aa156['include']=[{'all':!![]}];}return db[_0x466b('0x42')][_0x466b('0x43')](_0x5aa156);})['then'](function(_0x58781f){_0x439c15['rows']=_0x58781f;return _0x439c15;})['then'](respondWithFilteredResult(_0x4cd1fb,_0x5aa156))[_0x466b('0x44')](handleError(_0x4cd1fb,null));};exports[_0x466b('0x45')]=function(_0x35eacd,_0x18fe6e){var _0xb5b98f={'raw':!![],'where':{'id':_0x35eacd['params']['id']}},_0xa7f3e6={};_0xa7f3e6[_0x466b('0x34')]=_[_0x466b('0x31')](db[_0x466b('0x42')][_0x466b('0x2c')]);_0xa7f3e6[_0x466b('0x32')]=_['keys'](_0x35eacd[_0x466b('0x32')]);_0xa7f3e6[_0x466b('0x33')]=_[_0x466b('0x46')](_0xa7f3e6[_0x466b('0x34')],_0xa7f3e6['query']);_0xb5b98f[_0x466b('0x36')]=_[_0x466b('0x46')](_0xa7f3e6[_0x466b('0x34')],qs[_0x466b('0x35')](_0x35eacd[_0x466b('0x32')]['fields']));_0xb5b98f[_0x466b('0x36')]=_0xb5b98f[_0x466b('0x36')]['length']?_0xb5b98f['attributes']:_0xa7f3e6['model'];if(_0x35eacd['query'][_0x466b('0x41')]){_0xb5b98f[_0x466b('0x47')]=[{'all':!![]}];}_0xb5b98f=_[_0x466b('0x3e')]({},_0xb5b98f,_0x35eacd[_0x466b('0x48')]);return db['ServicenowField']['find'](_0xb5b98f)[_0x466b('0x26')](handleEntityNotFound(_0x18fe6e,null))[_0x466b('0x26')](respondWithResult(_0x18fe6e,null))['catch'](handleError(_0x18fe6e,null));};exports[_0x466b('0x49')]=function(_0x4ceffb,_0x4c4345){return db[_0x466b('0x42')][_0x466b('0x49')](_0x4ceffb[_0x466b('0x4a')],{})[_0x466b('0x26')](respondWithResult(_0x4c4345,0xc9))[_0x466b('0x44')](handleError(_0x4c4345,null));};exports['update']=function(_0x334594,_0x5a19bd){if(_0x334594['body']['id']){delete _0x334594[_0x466b('0x4a')]['id'];}return db[_0x466b('0x42')][_0x466b('0x4b')]({'where':{'id':_0x334594[_0x466b('0x4c')]['id']}})[_0x466b('0x26')](handleEntityNotFound(_0x5a19bd,null))[_0x466b('0x26')](saveUpdates(_0x334594[_0x466b('0x4a')],null))['then'](respondWithResult(_0x5a19bd,null))[_0x466b('0x44')](handleError(_0x5a19bd,null));};exports[_0x466b('0x27')]=function(_0x2c371c,_0x1a1d9e){return db[_0x466b('0x42')][_0x466b('0x4b')]({'where':{'id':_0x2c371c[_0x466b('0x4c')]['id']}})[_0x466b('0x26')](handleEntityNotFound(_0x1a1d9e,null))['then'](removeEntity(_0x1a1d9e,null))['catch'](handleError(_0x1a1d9e,null));}; \ No newline at end of file +var _0xb4df=['util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','ServicenowField','count','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x1a1346,_0x492657){var _0x1ce2c9=function(_0x465c83){while(--_0x465c83){_0x1a1346['push'](_0x1a1346['shift']());}};_0x1ce2c9(++_0x492657);}(_0xb4df,0x8a));var _0xfb4d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb4df[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xfb4d('0x0'));var rimraf=require(_0xfb4d('0x1'));var zipdir=require(_0xfb4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb4d('0x3'));var moment=require('moment');var BPromise=require(_0xfb4d('0x4'));var Mustache=require(_0xfb4d('0x5'));var util=require(_0xfb4d('0x6'));var path=require(_0xfb4d('0x7'));var sox=require(_0xfb4d('0x8'));var csv=require(_0xfb4d('0x9'));var ejs=require(_0xfb4d('0xa'));var fs=require('fs');var fs_extra=require(_0xfb4d('0xb'));var _=require('lodash');var squel=require(_0xfb4d('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb4d('0xd'));var deskjs=require(_0xfb4d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfb4d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfb4d('0x11'));var hardwareService=require(_0xfb4d('0x12'));var logger=require(_0xfb4d('0x13'))(_0xfb4d('0x14'));var utils=require('../../config/utils');var config=require(_0xfb4d('0x15'));var licenseUtil=require(_0xfb4d('0x16'));var db=require(_0xfb4d('0x17'))['db'];function respondWithStatusCode(_0x2fa3d8,_0x2c405e){_0x2c405e=_0x2c405e||0xcc;return function(_0x401780){if(_0x401780){return _0x2fa3d8['sendStatus'](_0x2c405e);}return _0x2fa3d8[_0xfb4d('0x18')](_0x2c405e)[_0xfb4d('0x19')]();};}function respondWithResult(_0x4441bb,_0x381e8b){_0x381e8b=_0x381e8b||0xc8;return function(_0x540c8e){if(_0x540c8e){return _0x4441bb['status'](_0x381e8b)[_0xfb4d('0x1a')](_0x540c8e);}};}function respondWithFilteredResult(_0x426bec,_0x24b0e3){return function(_0x20a478){if(_0x20a478){var _0x2fdfd1=typeof _0x24b0e3[_0xfb4d('0x1b')]===_0xfb4d('0x1c')&&typeof _0x24b0e3[_0xfb4d('0x1d')]===_0xfb4d('0x1c');var _0x301d03=_0x20a478['count'];var _0x58163b=_0x2fdfd1?0x0:_0x24b0e3[_0xfb4d('0x1b')];var _0x2ddd06=_0x2fdfd1?_0x20a478['count']:_0x24b0e3[_0xfb4d('0x1b')]+_0x24b0e3[_0xfb4d('0x1d')];var _0x400d63;if(_0x2ddd06>=_0x301d03){_0x2ddd06=_0x301d03;_0x400d63=0xc8;}else{_0x400d63=0xce;}_0x426bec[_0xfb4d('0x18')](_0x400d63);return _0x426bec[_0xfb4d('0x1e')](_0xfb4d('0x1f'),_0x58163b+'-'+_0x2ddd06+'/'+_0x301d03)[_0xfb4d('0x1a')](_0x20a478);}return null;};}function patchUpdates(_0x7a637d){return function(_0x413b27){try{jsonpatch['apply'](_0x413b27,_0x7a637d,!![]);}catch(_0x3b8cf2){return BPromise[_0xfb4d('0x20')](_0x3b8cf2);}return _0x413b27[_0xfb4d('0x21')]();};}function saveUpdates(_0x190db1,_0x1a5aed){return function(_0x263c84){if(_0x263c84){return _0x263c84[_0xfb4d('0x22')](_0x190db1)[_0xfb4d('0x23')](function(_0x1b3acd){return _0x1b3acd;});}return null;};}function removeEntity(_0x494129,_0xbff434){return function(_0x434093){if(_0x434093){return _0x434093[_0xfb4d('0x24')]()[_0xfb4d('0x23')](function(){_0x494129[_0xfb4d('0x18')](0xcc)[_0xfb4d('0x19')]();});}};}function handleEntityNotFound(_0x18b98d,_0x5d7269){return function(_0x1fb9ec){if(!_0x1fb9ec){_0x18b98d[_0xfb4d('0x25')](0x194);}return _0x1fb9ec;};}function handleError(_0x499067,_0x4dfb64){_0x4dfb64=_0x4dfb64||0x1f4;return function(_0x370a8a){logger[_0xfb4d('0x26')](_0x370a8a[_0xfb4d('0x27')]);if(_0x370a8a[_0xfb4d('0x28')]){delete _0x370a8a[_0xfb4d('0x28')];}_0x499067['status'](_0x4dfb64)['send'](_0x370a8a);};}exports[_0xfb4d('0x29')]=function(_0x5c0d8e,_0x2f5b40){var _0x264e5e={},_0x1bdff0={},_0x264ddf={'count':0x0,'rows':[]};var _0x4e2115=_[_0xfb4d('0x2a')](db['ServicenowField'][_0xfb4d('0x2b')],function(_0xb1c66a){return{'name':_0xb1c66a['fieldName'],'type':_0xb1c66a[_0xfb4d('0x2c')]['key']};});_0x1bdff0[_0xfb4d('0x2d')]=_[_0xfb4d('0x2a')](_0x4e2115,_0xfb4d('0x28'));_0x1bdff0['query']=_[_0xfb4d('0x2e')](_0x5c0d8e[_0xfb4d('0x2f')]);_0x1bdff0[_0xfb4d('0x30')]=_[_0xfb4d('0x31')](_0x1bdff0[_0xfb4d('0x2d')],_0x1bdff0[_0xfb4d('0x2f')]);_0x264e5e[_0xfb4d('0x32')]=_[_0xfb4d('0x31')](_0x1bdff0[_0xfb4d('0x2d')],qs[_0xfb4d('0x33')](_0x5c0d8e['query'][_0xfb4d('0x33')]));_0x264e5e[_0xfb4d('0x32')]=_0x264e5e[_0xfb4d('0x32')]['length']?_0x264e5e[_0xfb4d('0x32')]:_0x1bdff0[_0xfb4d('0x2d')];if(!_0x5c0d8e[_0xfb4d('0x2f')][_0xfb4d('0x34')]('nolimit')){_0x264e5e[_0xfb4d('0x1d')]=qs['limit'](_0x5c0d8e[_0xfb4d('0x2f')][_0xfb4d('0x1d')]);_0x264e5e[_0xfb4d('0x1b')]=qs[_0xfb4d('0x1b')](_0x5c0d8e[_0xfb4d('0x2f')]['offset']);}_0x264e5e[_0xfb4d('0x35')]=qs[_0xfb4d('0x36')](_0x5c0d8e['query'][_0xfb4d('0x36')]);_0x264e5e['where']=qs[_0xfb4d('0x30')](_[_0xfb4d('0x37')](_0x5c0d8e[_0xfb4d('0x2f')],_0x1bdff0[_0xfb4d('0x30')]),_0x4e2115);if(_0x5c0d8e[_0xfb4d('0x2f')]['filter']){_0x264e5e[_0xfb4d('0x38')]=_[_0xfb4d('0x39')](_0x264e5e[_0xfb4d('0x38')],{'$or':_[_0xfb4d('0x2a')](_0x4e2115,function(_0x46c0b2){if(_0x46c0b2[_0xfb4d('0x2c')]!==_0xfb4d('0x3a')){var _0x9feacc={};_0x9feacc[_0x46c0b2[_0xfb4d('0x28')]]={'$like':'%'+_0x5c0d8e['query'][_0xfb4d('0x3b')]+'%'};return _0x9feacc;}})});}_0x264e5e=_[_0xfb4d('0x39')]({},_0x264e5e,_0x5c0d8e[_0xfb4d('0x3c')]);var _0x200d77={'where':_0x264e5e['where']};return db[_0xfb4d('0x3d')][_0xfb4d('0x3e')](_0x200d77)[_0xfb4d('0x23')](function(_0x58792e){_0x264ddf[_0xfb4d('0x3e')]=_0x58792e;if(_0x5c0d8e['query'][_0xfb4d('0x3f')]){_0x264e5e[_0xfb4d('0x40')]=[{'all':!![]}];}return db[_0xfb4d('0x3d')][_0xfb4d('0x41')](_0x264e5e);})['then'](function(_0x4b8f07){_0x264ddf[_0xfb4d('0x42')]=_0x4b8f07;return _0x264ddf;})[_0xfb4d('0x23')](respondWithFilteredResult(_0x2f5b40,_0x264e5e))[_0xfb4d('0x43')](handleError(_0x2f5b40,null));};exports['show']=function(_0x1b8219,_0xdef8ac){var _0x547085={'raw':!![],'where':{'id':_0x1b8219[_0xfb4d('0x44')]['id']}},_0x899ff={};_0x899ff[_0xfb4d('0x2d')]=_[_0xfb4d('0x2e')](db[_0xfb4d('0x3d')][_0xfb4d('0x2b')]);_0x899ff['query']=_[_0xfb4d('0x2e')](_0x1b8219[_0xfb4d('0x2f')]);_0x899ff['filters']=_[_0xfb4d('0x31')](_0x899ff['model'],_0x899ff[_0xfb4d('0x2f')]);_0x547085[_0xfb4d('0x32')]=_[_0xfb4d('0x31')](_0x899ff['model'],qs['fields'](_0x1b8219[_0xfb4d('0x2f')][_0xfb4d('0x33')]));_0x547085[_0xfb4d('0x32')]=_0x547085['attributes']['length']?_0x547085[_0xfb4d('0x32')]:_0x899ff[_0xfb4d('0x2d')];if(_0x1b8219[_0xfb4d('0x2f')]['includeAll']){_0x547085['include']=[{'all':!![]}];}_0x547085=_[_0xfb4d('0x39')]({},_0x547085,_0x1b8219['options']);return db[_0xfb4d('0x3d')][_0xfb4d('0x45')](_0x547085)[_0xfb4d('0x23')](handleEntityNotFound(_0xdef8ac,null))['then'](respondWithResult(_0xdef8ac,null))[_0xfb4d('0x43')](handleError(_0xdef8ac,null));};exports[_0xfb4d('0x46')]=function(_0x53725a,_0x596f8e){return db[_0xfb4d('0x3d')][_0xfb4d('0x46')](_0x53725a[_0xfb4d('0x47')],{})[_0xfb4d('0x23')](respondWithResult(_0x596f8e,0xc9))[_0xfb4d('0x43')](handleError(_0x596f8e,null));};exports[_0xfb4d('0x22')]=function(_0x5ac9ca,_0x235a3a){if(_0x5ac9ca[_0xfb4d('0x47')]['id']){delete _0x5ac9ca[_0xfb4d('0x47')]['id'];}return db[_0xfb4d('0x3d')][_0xfb4d('0x45')]({'where':{'id':_0x5ac9ca['params']['id']}})['then'](handleEntityNotFound(_0x235a3a,null))[_0xfb4d('0x23')](saveUpdates(_0x5ac9ca[_0xfb4d('0x47')],null))['then'](respondWithResult(_0x235a3a,null))[_0xfb4d('0x43')](handleError(_0x235a3a,null));};exports[_0xfb4d('0x24')]=function(_0x28c019,_0x577df2){return db[_0xfb4d('0x3d')][_0xfb4d('0x45')]({'where':{'id':_0x28c019[_0xfb4d('0x44')]['id']}})[_0xfb4d('0x23')](handleEntityNotFound(_0x577df2,null))[_0xfb4d('0x23')](removeEntity(_0x577df2,null))['catch'](handleError(_0x577df2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8245e66..a2ae8d8 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 _0xf443=['idField','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x4f0080,_0x5221d2){var _0x1c5234=function(_0x2d6b57){while(--_0x2d6b57){_0x4f0080['push'](_0x4f0080['shift']());}};_0x1c5234(++_0x5221d2);}(_0xf443,0xc4));var _0x3f44=function(_0x555431,_0x5c80ee){_0x555431=_0x555431-0x0;var _0x50bfd8=_0xf443[_0x555431];return _0x50bfd8;};'use strict';var _=require(_0x3f44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3f44('0x1'));var moment=require('moment');var BPromise=require(_0x3f44('0x2'));var rp=require(_0x3f44('0x3'));var fs=require('fs');var path=require(_0x3f44('0x4'));var rimraf=require(_0x3f44('0x5'));var config=require(_0x3f44('0x6'));var attributes=require(_0x3f44('0x7'));module[_0x3f44('0x8')]=function(_0x34e8a8,_0x6a529c){return _0x34e8a8['define'](_0x3f44('0x9'),attributes,{'tableName':_0x3f44('0xa'),'paranoid':![],'indexes':[{'name':_0x3f44('0xb'),'fields':[_0x3f44('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfef1=['path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xfef1,0x179));var _0x1fef=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfef1[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1fef('0x0'));var util=require(_0x1fef('0x1'));var logger=require(_0x1fef('0x2'))(_0x1fef('0x3'));var moment=require(_0x1fef('0x4'));var BPromise=require(_0x1fef('0x5'));var rp=require(_0x1fef('0x6'));var fs=require('fs');var path=require(_0x1fef('0x7'));var rimraf=require(_0x1fef('0x8'));var config=require('../../config/environment');var attributes=require(_0x1fef('0x9'));module[_0x1fef('0xa')]=function(_0x49903a,_0x4aef55){return _0x49903a[_0x1fef('0xb')](_0x1fef('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x1fef('0xd'),'fields':[_0x1fef('0xe'),_0x1fef('0xf')],'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 2626550..c2afca1 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xbab33a,_0x1d65cd){var _0x142d57=function(_0x4f6b29){while(--_0x4f6b29){_0xbab33a['push'](_0xbab33a['shift']());}};_0x142d57(++_0x1d65cd);}(_0xf4eb,0xec));var _0xbf4e=function(_0x388b15,_0x4c9a87){_0x388b15=_0x388b15-0x0;var _0x5d4b7a=_0xf4eb[_0x388b15];return _0x5d4b7a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xda3f,0xec));var _0xfda3=function(_0x5753f1,_0x2f9745){_0x5753f1=_0x5753f1-0x0;var _0x35ca59=_0xda3f[_0x5753f1];return _0x35ca59;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 5bd761c..f28bb19 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(_0x2018e2,_0x9f7e76){var _0xb52669=function(_0x1fb636){while(--_0x1fb636){_0x2018e2['push'](_0x2018e2['shift']());}};_0xb52669(++_0x9f7e76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1d195c,_0x47d30b){var _0x4bdc6d=function(_0x576206){while(--_0x576206){_0x1d195c['push'](_0x1d195c['shift']());}};_0x4bdc6d(++_0x47d30b);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 5ebb49a..4a2f28e 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(_0xc415d0,_0x279bb8){var _0x200069=function(_0x4429ff){while(--_0x4429ff){_0xc415d0['push'](_0xc415d0['shift']());}};_0x200069(++_0x279bb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x199397,_0x10eeb1){var _0x5b7e85=function(_0x3b61f5){while(--_0x3b61f5){_0x199397['push'](_0x199397['shift']());}};_0x5b7e85(++_0x10eeb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 9387311..e74e902 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 _0xc74e=['statusCode','getFields','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','error','name','send','index','SugarcrmAccount','fieldName','map','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','update','getConfigurations','findOne','SugarcrmConfiguration','length','pick','addConfiguration','AccountId','channel','Descriptions','SugarcrmField','Subjects','assigned_user_id','created_by','description','duration_hours','parent_type','parent_name','username','remoteUri','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Calls','values','module_fields','remove','includes','endsWith','value','test'];(function(_0xef792f,_0x22b25e){var _0x2c6714=function(_0x129ea2){while(--_0x129ea2){_0xef792f['push'](_0xef792f['shift']());}};_0x2c6714(++_0x22b25e);}(_0xc74e,0x159));var _0xec74=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc74e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xec74('0x0'));var rimraf=require(_0xec74('0x1'));var zipdir=require(_0xec74('0x2'));var jsonpatch=require(_0xec74('0x3'));var rp=require(_0xec74('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xec74('0x5'));var util=require(_0xec74('0x6'));var path=require(_0xec74('0x7'));var sox=require(_0xec74('0x8'));var csv=require(_0xec74('0x9'));var ejs=require(_0xec74('0xa'));var fs=require('fs');var fs_extra=require(_0xec74('0xb'));var _=require(_0xec74('0xc'));var squel=require(_0xec74('0xd'));var crypto=require(_0xec74('0xe'));var jsforce=require(_0xec74('0xf'));var deskjs=require(_0xec74('0x10'));var toCsv=require('to-csv');var querystring=require(_0xec74('0x11'));var Papa=require('papaparse');var Redis=require(_0xec74('0x12'));var authService=require(_0xec74('0x13'));var qs=require(_0xec74('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec74('0x15'));var logger=require(_0xec74('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xec74('0x17'));var licenseUtil=require(_0xec74('0x18'));var db=require(_0xec74('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x21257d,_0x5f5dd9){_0x5f5dd9=_0x5f5dd9||0xcc;return function(_0x31e99a){if(_0x31e99a){return _0x21257d[_0xec74('0x1a')](_0x5f5dd9);}return _0x21257d['status'](_0x5f5dd9)[_0xec74('0x1b')]();};}function respondWithResult(_0x43ced2,_0x2752ed){_0x2752ed=_0x2752ed||0xc8;return function(_0x3c7784){if(_0x3c7784){return _0x43ced2[_0xec74('0x1c')](_0x2752ed)['json'](_0x3c7784);}};}function respondWithFilteredResult(_0x5bb31e,_0x3cd6ee){return function(_0x515652){if(_0x515652){var _0x3faef2=typeof _0x3cd6ee[_0xec74('0x1d')]===_0xec74('0x1e')&&typeof _0x3cd6ee['limit']===_0xec74('0x1e');var _0x5cdf3b=_0x515652['count'];var _0xcb7d5a=_0x3faef2?0x0:_0x3cd6ee[_0xec74('0x1d')];var _0x1809a6=_0x3faef2?_0x515652[_0xec74('0x1f')]:_0x3cd6ee[_0xec74('0x1d')]+_0x3cd6ee[_0xec74('0x20')];var _0x770394;if(_0x1809a6>=_0x5cdf3b){_0x1809a6=_0x5cdf3b;_0x770394=0xc8;}else{_0x770394=0xce;}_0x5bb31e[_0xec74('0x1c')](_0x770394);return _0x5bb31e[_0xec74('0x21')](_0xec74('0x22'),_0xcb7d5a+'-'+_0x1809a6+'/'+_0x5cdf3b)[_0xec74('0x23')](_0x515652);}return null;};}function patchUpdates(_0x3d3a45){return function(_0x2a5aab){try{jsonpatch[_0xec74('0x24')](_0x2a5aab,_0x3d3a45,!![]);}catch(_0x1381bb){return BPromise['reject'](_0x1381bb);}return _0x2a5aab[_0xec74('0x25')]();};}function saveUpdates(_0x36e3da,_0x2870cc){return function(_0x135992){if(_0x135992){return _0x135992['update'](_0x36e3da)[_0xec74('0x26')](function(_0x28f4d0){return _0x28f4d0;});}return null;};}function removeEntity(_0x4aae27,_0x5071da){return function(_0x34ab25){if(_0x34ab25){return _0x34ab25['destroy']()[_0xec74('0x26')](function(){_0x4aae27[_0xec74('0x1c')](0xcc)[_0xec74('0x1b')]();});}};}function handleEntityNotFound(_0x3b094b,_0x53b1c7){return function(_0x14d3f7){if(!_0x14d3f7){_0x3b094b['sendStatus'](0x194);}return _0x14d3f7;};}function handleError(_0x5c72ea,_0x37a418){_0x37a418=_0x37a418||0x1f4;return function(_0x1a1ff2){logger[_0xec74('0x27')](_0x1a1ff2['stack']);if(_0x1a1ff2[_0xec74('0x28')]){delete _0x1a1ff2['name'];}_0x5c72ea[_0xec74('0x1c')](_0x37a418)[_0xec74('0x29')](_0x1a1ff2);};}exports[_0xec74('0x2a')]=function(_0x3d484e,_0x27f6e7){var _0xf8da16={},_0x1e231f={},_0x195def={'count':0x0,'rows':[]};var _0x44a018=_['map'](db[_0xec74('0x2b')]['rawAttributes'],function(_0xd2c360){return{'name':_0xd2c360[_0xec74('0x2c')],'type':_0xd2c360['type']['key']};});_0x1e231f['model']=_[_0xec74('0x2d')](_0x44a018,'name');_0x1e231f['query']=_['keys'](_0x3d484e[_0xec74('0x2e')]);_0x1e231f[_0xec74('0x2f')]=_['intersection'](_0x1e231f[_0xec74('0x30')],_0x1e231f[_0xec74('0x2e')]);_0xf8da16[_0xec74('0x31')]=_[_0xec74('0x32')](_0x1e231f[_0xec74('0x30')],qs[_0xec74('0x33')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x33')]));_0xf8da16[_0xec74('0x31')]=_0xf8da16[_0xec74('0x31')]['length']?_0xf8da16[_0xec74('0x31')]:_0x1e231f[_0xec74('0x30')];if(!_0x3d484e[_0xec74('0x2e')][_0xec74('0x34')](_0xec74('0x35'))){_0xf8da16['limit']=qs[_0xec74('0x20')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x20')]);_0xf8da16['offset']=qs[_0xec74('0x1d')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x1d')]);}_0xf8da16[_0xec74('0x36')]=qs[_0xec74('0x37')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x37')]);_0xf8da16[_0xec74('0x38')]=qs[_0xec74('0x2f')](_['pick'](_0x3d484e[_0xec74('0x2e')],_0x1e231f[_0xec74('0x2f')]),_0x44a018);if(_0x3d484e['query'][_0xec74('0x39')]){_0xf8da16['where']=_[_0xec74('0x3a')](_0xf8da16[_0xec74('0x38')],{'$or':_[_0xec74('0x2d')](_0x44a018,function(_0x16b972){if(_0x16b972[_0xec74('0x3b')]!=='VIRTUAL'){var _0x29ea31={};_0x29ea31[_0x16b972[_0xec74('0x28')]]={'$like':'%'+_0x3d484e[_0xec74('0x2e')]['filter']+'%'};return _0x29ea31;}})});}_0xf8da16=_[_0xec74('0x3a')]({},_0xf8da16,_0x3d484e[_0xec74('0x3c')]);var _0x217026={'where':_0xf8da16[_0xec74('0x38')]};return db[_0xec74('0x2b')][_0xec74('0x1f')](_0x217026)[_0xec74('0x26')](function(_0x52fecc){_0x195def[_0xec74('0x1f')]=_0x52fecc;if(_0x3d484e['query'][_0xec74('0x3d')]){_0xf8da16[_0xec74('0x3e')]=[{'all':!![]}];}return db[_0xec74('0x2b')][_0xec74('0x3f')](_0xf8da16);})['then'](function(_0x215fe0){_0x195def[_0xec74('0x40')]=_0x215fe0;return _0x195def;})[_0xec74('0x26')](respondWithFilteredResult(_0x27f6e7,_0xf8da16))[_0xec74('0x41')](handleError(_0x27f6e7,null));};exports['show']=function(_0x427fcd,_0x3e5390){var _0x1d145d={'raw':![],'where':{'id':_0x427fcd[_0xec74('0x42')]['id']}},_0x788406={};_0x788406[_0xec74('0x30')]=_[_0xec74('0x43')](db[_0xec74('0x2b')][_0xec74('0x44')]);_0x788406[_0xec74('0x2e')]=_[_0xec74('0x43')](_0x427fcd[_0xec74('0x2e')]);_0x788406[_0xec74('0x2f')]=_[_0xec74('0x32')](_0x788406[_0xec74('0x30')],_0x788406[_0xec74('0x2e')]);_0x1d145d[_0xec74('0x31')]=_[_0xec74('0x32')](_0x788406['model'],qs[_0xec74('0x33')](_0x427fcd[_0xec74('0x2e')]['fields']));_0x1d145d['attributes']=_0x1d145d[_0xec74('0x31')]['length']?_0x1d145d[_0xec74('0x31')]:_0x788406['model'];if(_0x427fcd[_0xec74('0x2e')][_0xec74('0x3d')]){_0x1d145d[_0xec74('0x3e')]=[{'all':!![]}];}_0x1d145d=_[_0xec74('0x3a')]({},_0x1d145d,_0x427fcd[_0xec74('0x3c')]);return db[_0xec74('0x2b')][_0xec74('0x45')](_0x1d145d)[_0xec74('0x26')](handleEntityNotFound(_0x3e5390,null))[_0xec74('0x26')](respondWithResult(_0x3e5390,null))['catch'](handleError(_0x3e5390,null));};exports[_0xec74('0x46')]=function(_0x8ffe49,_0xa395a){return db[_0xec74('0x2b')]['create'](_0x8ffe49[_0xec74('0x47')],{})['then'](respondWithResult(_0xa395a,0xc9))[_0xec74('0x41')](handleError(_0xa395a,null));};exports[_0xec74('0x48')]=function(_0x3a0677,_0x5ae83a){if(_0x3a0677['body']['id']){delete _0x3a0677[_0xec74('0x47')]['id'];}return db['SugarcrmAccount'][_0xec74('0x45')]({'where':{'id':_0x3a0677['params']['id']}})[_0xec74('0x26')](handleEntityNotFound(_0x5ae83a,null))[_0xec74('0x26')](saveUpdates(_0x3a0677[_0xec74('0x47')],null))['then'](respondWithResult(_0x5ae83a,null))[_0xec74('0x41')](handleError(_0x5ae83a,null));};exports['destroy']=function(_0xc3aa84,_0x1341c9){return db[_0xec74('0x2b')][_0xec74('0x45')]({'where':{'id':_0xc3aa84[_0xec74('0x42')]['id']}})[_0xec74('0x26')](handleEntityNotFound(_0x1341c9,null))[_0xec74('0x26')](removeEntity(_0x1341c9,null))[_0xec74('0x41')](handleError(_0x1341c9,null));};exports[_0xec74('0x49')]=function(_0x562277,_0x522b64,_0x47478c){var _0x216181={};var _0x7fec05={};var _0xd7ebf3;var _0x3418f0;return db[_0xec74('0x2b')][_0xec74('0x4a')]({'where':{'id':_0x562277['params']['id']}})['then'](handleEntityNotFound(_0x522b64,null))['then'](function(_0x429f9a){if(_0x429f9a){_0xd7ebf3=_0x429f9a;_0x7fec05['model']=_[_0xec74('0x43')](db[_0xec74('0x4b')][_0xec74('0x44')]);_0x7fec05['query']=_[_0xec74('0x43')](_0x562277[_0xec74('0x2e')]);_0x7fec05['filters']=_['intersection'](_0x7fec05[_0xec74('0x30')],_0x7fec05[_0xec74('0x2e')]);_0x216181[_0xec74('0x31')]=_[_0xec74('0x32')](_0x7fec05[_0xec74('0x30')],qs[_0xec74('0x33')](_0x562277[_0xec74('0x2e')]['fields']));_0x216181[_0xec74('0x31')]=_0x216181[_0xec74('0x31')][_0xec74('0x4c')]?_0x216181[_0xec74('0x31')]:_0x7fec05['model'];_0x216181[_0xec74('0x36')]=qs[_0xec74('0x37')](_0x562277[_0xec74('0x2e')]['sort']);_0x216181[_0xec74('0x38')]=qs['filters'](_[_0xec74('0x4d')](_0x562277[_0xec74('0x2e')],_0x7fec05['filters']));if(_0x562277[_0xec74('0x2e')]['filter']){_0x216181[_0xec74('0x38')]=_[_0xec74('0x3a')](_0x216181[_0xec74('0x38')],{'$or':_[_0xec74('0x2d')](_0x216181[_0xec74('0x31')],function(_0x897b1f){var _0x2999c7={};_0x2999c7[_0x897b1f]={'$like':'%'+_0x562277[_0xec74('0x2e')][_0xec74('0x39')]+'%'};return _0x2999c7;})});}_0x216181=_[_0xec74('0x3a')]({},_0x216181,_0x562277[_0xec74('0x3c')]);return _0xd7ebf3['getConfigurations'](_0x216181);}})[_0xec74('0x26')](function(_0x21ee9e){if(_0x21ee9e){_0x3418f0=_0x21ee9e[_0xec74('0x4c')];if(!_0x562277[_0xec74('0x2e')][_0xec74('0x34')](_0xec74('0x35'))){_0x216181[_0xec74('0x20')]=qs[_0xec74('0x20')](_0x562277['query'][_0xec74('0x20')]);_0x216181[_0xec74('0x1d')]=qs['offset'](_0x562277[_0xec74('0x2e')][_0xec74('0x1d')]);}return _0xd7ebf3[_0xec74('0x49')](_0x216181);}})[_0xec74('0x26')](function(_0x175844){if(_0x175844){return _0x175844?{'count':_0x3418f0,'rows':_0x175844}:null;}})['then'](respondWithResult(_0x522b64,null))[_0xec74('0x41')](handleError(_0x522b64,null));};exports[_0xec74('0x4e')]=function(_0x22b7d9,_0x3e3025,_0x499fe1){if(_0x22b7d9[_0xec74('0x47')]['id']){delete _0x22b7d9[_0xec74('0x47')]['id'];}return db[_0xec74('0x2b')][_0xec74('0x4a')]({'where':{'id':_0x22b7d9['params']['id']}})[_0xec74('0x26')](handleEntityNotFound(_0x3e3025,null))['then'](function(_0x5c1cea){if(_0x5c1cea){_0x22b7d9[_0xec74('0x47')][_0xec74('0x4f')]=_0x5c1cea['id'];_0x22b7d9[_0xec74('0x47')]['Subjects']=integrations['getSubjects'](_0x22b7d9[_0xec74('0x47')][_0xec74('0x50')],_0x22b7d9[_0xec74('0x47')][_0xec74('0x3b')]);_0x22b7d9['body'][_0xec74('0x51')]=integrations['getDescriptions'](_0x22b7d9[_0xec74('0x47')][_0xec74('0x50')],_0x22b7d9[_0xec74('0x47')][_0xec74('0x3b')]);return db['SugarcrmConfiguration'][_0xec74('0x46')](_0x22b7d9['body'],{'include':[{'model':db[_0xec74('0x52')],'as':_0xec74('0x53')},{'model':db[_0xec74('0x52')],'as':_0xec74('0x51')}]});}return null;})[_0xec74('0x26')](respondWithResult(_0x3e3025,null))['catch'](handleError(_0x3e3025,null));};exports['getFields']=function(_0x2f4b79,_0x661e37,_0x9ca542){var _0x919581='';var _0x41e323=['id','name',_0xec74('0x54'),_0xec74('0x55'),_0xec74('0x56'),'date_start',_0xec74('0x57'),'duration_minutes','parent_id',_0xec74('0x58'),_0xec74('0x59'),'direction'];return db[_0xec74('0x2b')][_0xec74('0x4a')]({'where':{'id':_0x2f4b79[_0xec74('0x42')]['id']},'attributes':['id',_0xec74('0x5a'),'password',_0xec74('0x5b')]})[_0xec74('0x26')](handleEntityNotFound(_0x661e37,null))[_0xec74('0x26')](function(_0x30a55f){if(_0x30a55f){_0x919581=_0x30a55f[_0xec74('0x5b')];var _0x5ea06c=_0x919581['slice'](-0x1);if(_0x5ea06c==='/'){_0x919581=_0x919581['substring'](0x0,_0x919581[_0xec74('0x5c')](_0x5ea06c));}return rp({'method':_0xec74('0x5d'),'uri':util[_0xec74('0x5e')](_0xec74('0x5f'),_0x919581,_0xec74('0x60')),'json':!![],'form':{'method':_0xec74('0x61'),'input_type':_0xec74('0x62'),'response_type':'JSON','rest_data':JSON[_0xec74('0x63')]({'user_auth':{'user_name':_0x30a55f['username'],'password':_0x30a55f[_0xec74('0x64')],'encryption':'PLAIN'},'application':_0xec74('0x65')})}});}})['then'](function(_0x266354){if(_0x266354&&_0x266354['name']!==_0xec74('0x66')&&_0x266354[_0xec74('0x28')]!=='Password\x20Expired'){return rp({'method':_0xec74('0x5d'),'uri':util['format'](_0xec74('0x5f'),_0x919581,_0xec74('0x60')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xec74('0x62'),'response_type':_0xec74('0x62'),'rest_data':JSON[_0xec74('0x63')]({'session':_0x266354['id'],'module_name':_0xec74('0x67')})}})[_0xec74('0x26')](function(_0x47c248){if(_0x47c248){var _0x591b74=_[_0xec74('0x68')](_0x47c248[_0xec74('0x69')]);_[_0xec74('0x6a')](_0x591b74,function(_0x1a81bc){return _0x41e323[_0xec74('0x6b')](_0x1a81bc[_0xec74('0x28')]);});return{'count':_0x591b74[_0xec74('0x4c')],'rows':_[_0xec74('0x2d')](_0x591b74,function(_0x443365){return{'id':_0x443365['name'],'name':_0x443365['label'],'custom':_[_0xec74('0x6c')](_0x443365['name'],'_c')?!![]:![],'options':_0x443365['options']?_[_0xec74('0x2d')](_[_0xec74('0x68')](_0x443365[_0xec74('0x3c')]),function(_0xdaa52a){return{'name':_0xdaa52a[_0xec74('0x6d')],'value':_0xdaa52a['name']};}):[]};})};}})[_0xec74('0x26')](respondWithResult(_0x661e37,null))[_0xec74('0x41')](function(_0xb11622){var _0x4ac628=_0x2f4b79[_0xec74('0x2e')][_0xec74('0x6e')]?0x1f4:_0xb11622[_0xec74('0x6f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xec74('0x70'),_0x4ac628,JSON[_0xec74('0x63')](_0xb11622));delete _0xb11622[_0xec74('0x28')];if(_0x4ac628===0x191){_0x4ac628=0x190;}_0x661e37['status'](_0x4ac628)['send'](_0x2f4b79['query'][_0xec74('0x6e')]?{'message':_0xec74('0x71'),'statusCode':_0xb11622[_0xec74('0x6f')]}:_0xb11622);});}else{var _0x14a812=0x1f4;_0x661e37[_0xec74('0x1c')](_0x14a812)[_0xec74('0x29')]({'message':_0xec74('0x71'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x4e6d=['PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','stringify','Calls','values','module_fields','remove','includes','label','endsWith','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SugarcrmAccount','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','POST','format','/service/v4_1/rest.php','login','JSON'];(function(_0x5d8c74,_0x5f546d){var _0x7ebdf4=function(_0x35ca5f){while(--_0x35ca5f){_0x5d8c74['push'](_0x5d8c74['shift']());}};_0x7ebdf4(++_0x5f546d);}(_0x4e6d,0x10a));var _0xd4e6=function(_0xd43e1d,_0x26a204){_0xd43e1d=_0xd43e1d-0x0;var _0x5c7332=_0x4e6d[_0xd43e1d];return _0x5c7332;};'use strict';var emlformat=require(_0xd4e6('0x0'));var rimraf=require(_0xd4e6('0x1'));var zipdir=require(_0xd4e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4e6('0x3'));var moment=require(_0xd4e6('0x4'));var BPromise=require(_0xd4e6('0x5'));var Mustache=require(_0xd4e6('0x6'));var util=require(_0xd4e6('0x7'));var path=require(_0xd4e6('0x8'));var sox=require(_0xd4e6('0x9'));var csv=require('to-csv');var ejs=require(_0xd4e6('0xa'));var fs=require('fs');var fs_extra=require(_0xd4e6('0xb'));var _=require(_0xd4e6('0xc'));var squel=require(_0xd4e6('0xd'));var crypto=require(_0xd4e6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd4e6('0xf'));var toCsv=require(_0xd4e6('0x10'));var querystring=require(_0xd4e6('0x11'));var Papa=require('papaparse');var Redis=require(_0xd4e6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd4e6('0x13'));var as=require(_0xd4e6('0x14'));var hardwareService=require(_0xd4e6('0x15'));var logger=require(_0xd4e6('0x16'))(_0xd4e6('0x17'));var utils=require(_0xd4e6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd4e6('0x19'));var db=require(_0xd4e6('0x1a'))['db'];var integrations=require(_0xd4e6('0x1b'));function respondWithStatusCode(_0x96a21c,_0x41fdb6){_0x41fdb6=_0x41fdb6||0xcc;return function(_0x3a5b24){if(_0x3a5b24){return _0x96a21c['sendStatus'](_0x41fdb6);}return _0x96a21c[_0xd4e6('0x1c')](_0x41fdb6)['end']();};}function respondWithResult(_0x3a4abf,_0x5f0c43){_0x5f0c43=_0x5f0c43||0xc8;return function(_0x4b7bde){if(_0x4b7bde){return _0x3a4abf[_0xd4e6('0x1c')](_0x5f0c43)[_0xd4e6('0x1d')](_0x4b7bde);}};}function respondWithFilteredResult(_0x5240ef,_0x5407bf){return function(_0x1aefc9){if(_0x1aefc9){var _0x5e8e76=typeof _0x5407bf[_0xd4e6('0x1e')]===_0xd4e6('0x1f')&&typeof _0x5407bf[_0xd4e6('0x20')]===_0xd4e6('0x1f');var _0x9bb6de=_0x1aefc9[_0xd4e6('0x21')];var _0x3e84b7=_0x5e8e76?0x0:_0x5407bf['offset'];var _0x4e14ed=_0x5e8e76?_0x1aefc9[_0xd4e6('0x21')]:_0x5407bf[_0xd4e6('0x1e')]+_0x5407bf[_0xd4e6('0x20')];var _0x5b63b3;if(_0x4e14ed>=_0x9bb6de){_0x4e14ed=_0x9bb6de;_0x5b63b3=0xc8;}else{_0x5b63b3=0xce;}_0x5240ef[_0xd4e6('0x1c')](_0x5b63b3);return _0x5240ef[_0xd4e6('0x22')](_0xd4e6('0x23'),_0x3e84b7+'-'+_0x4e14ed+'/'+_0x9bb6de)[_0xd4e6('0x1d')](_0x1aefc9);}return null;};}function patchUpdates(_0x2ec7bf){return function(_0x14838){try{jsonpatch[_0xd4e6('0x24')](_0x14838,_0x2ec7bf,!![]);}catch(_0x1a32a0){return BPromise[_0xd4e6('0x25')](_0x1a32a0);}return _0x14838[_0xd4e6('0x26')]();};}function saveUpdates(_0x2e4562,_0x5ddca9){return function(_0x1438c4){if(_0x1438c4){return _0x1438c4[_0xd4e6('0x27')](_0x2e4562)[_0xd4e6('0x28')](function(_0x42899f){return _0x42899f;});}return null;};}function removeEntity(_0x43cef0,_0x410061){return function(_0x56537a){if(_0x56537a){return _0x56537a[_0xd4e6('0x29')]()[_0xd4e6('0x28')](function(){_0x43cef0[_0xd4e6('0x1c')](0xcc)[_0xd4e6('0x2a')]();});}};}function handleEntityNotFound(_0x536fc1,_0x4b05b4){return function(_0x25eefb){if(!_0x25eefb){_0x536fc1[_0xd4e6('0x2b')](0x194);}return _0x25eefb;};}function handleError(_0x17a5a4,_0x3ab477){_0x3ab477=_0x3ab477||0x1f4;return function(_0x11f327){logger[_0xd4e6('0x2c')](_0x11f327[_0xd4e6('0x2d')]);if(_0x11f327[_0xd4e6('0x2e')]){delete _0x11f327[_0xd4e6('0x2e')];}_0x17a5a4[_0xd4e6('0x1c')](_0x3ab477)['send'](_0x11f327);};}exports[_0xd4e6('0x2f')]=function(_0x2d9b60,_0x11dafd){var _0x358545={},_0x130dce={},_0x511f8a={'count':0x0,'rows':[]};var _0x399b23=_['map'](db['SugarcrmAccount'][_0xd4e6('0x30')],function(_0x4d9a2c){return{'name':_0x4d9a2c[_0xd4e6('0x31')],'type':_0x4d9a2c['type'][_0xd4e6('0x32')]};});_0x130dce[_0xd4e6('0x33')]=_[_0xd4e6('0x34')](_0x399b23,_0xd4e6('0x2e'));_0x130dce[_0xd4e6('0x35')]=_[_0xd4e6('0x36')](_0x2d9b60[_0xd4e6('0x35')]);_0x130dce[_0xd4e6('0x37')]=_[_0xd4e6('0x38')](_0x130dce[_0xd4e6('0x33')],_0x130dce[_0xd4e6('0x35')]);_0x358545[_0xd4e6('0x39')]=_[_0xd4e6('0x38')](_0x130dce[_0xd4e6('0x33')],qs[_0xd4e6('0x3a')](_0x2d9b60[_0xd4e6('0x35')]['fields']));_0x358545['attributes']=_0x358545[_0xd4e6('0x39')][_0xd4e6('0x3b')]?_0x358545[_0xd4e6('0x39')]:_0x130dce['model'];if(!_0x2d9b60[_0xd4e6('0x35')][_0xd4e6('0x3c')](_0xd4e6('0x3d'))){_0x358545[_0xd4e6('0x20')]=qs[_0xd4e6('0x20')](_0x2d9b60[_0xd4e6('0x35')][_0xd4e6('0x20')]);_0x358545[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x2d9b60['query'][_0xd4e6('0x1e')]);}_0x358545[_0xd4e6('0x3e')]=qs[_0xd4e6('0x3f')](_0x2d9b60[_0xd4e6('0x35')][_0xd4e6('0x3f')]);_0x358545[_0xd4e6('0x40')]=qs[_0xd4e6('0x37')](_[_0xd4e6('0x41')](_0x2d9b60[_0xd4e6('0x35')],_0x130dce[_0xd4e6('0x37')]),_0x399b23);if(_0x2d9b60[_0xd4e6('0x35')][_0xd4e6('0x42')]){_0x358545[_0xd4e6('0x40')]=_[_0xd4e6('0x43')](_0x358545[_0xd4e6('0x40')],{'$or':_[_0xd4e6('0x34')](_0x399b23,function(_0x14f00a){if(_0x14f00a[_0xd4e6('0x44')]!==_0xd4e6('0x45')){var _0x5da96b={};_0x5da96b[_0x14f00a['name']]={'$like':'%'+_0x2d9b60[_0xd4e6('0x35')][_0xd4e6('0x42')]+'%'};return _0x5da96b;}})});}_0x358545=_[_0xd4e6('0x43')]({},_0x358545,_0x2d9b60[_0xd4e6('0x46')]);var _0x452a66={'where':_0x358545[_0xd4e6('0x40')]};return db[_0xd4e6('0x47')][_0xd4e6('0x21')](_0x452a66)[_0xd4e6('0x28')](function(_0xbd63ef){_0x511f8a[_0xd4e6('0x21')]=_0xbd63ef;if(_0x2d9b60[_0xd4e6('0x35')]['includeAll']){_0x358545[_0xd4e6('0x48')]=[{'all':!![]}];}return db[_0xd4e6('0x47')][_0xd4e6('0x49')](_0x358545);})['then'](function(_0x4797a8){_0x511f8a[_0xd4e6('0x4a')]=_0x4797a8;return _0x511f8a;})['then'](respondWithFilteredResult(_0x11dafd,_0x358545))[_0xd4e6('0x4b')](handleError(_0x11dafd,null));};exports[_0xd4e6('0x4c')]=function(_0x528a19,_0x4ac9f4){var _0x2b50f4={'raw':![],'where':{'id':_0x528a19[_0xd4e6('0x4d')]['id']}},_0xee309c={};_0xee309c[_0xd4e6('0x33')]=_[_0xd4e6('0x36')](db[_0xd4e6('0x47')][_0xd4e6('0x30')]);_0xee309c[_0xd4e6('0x35')]=_['keys'](_0x528a19[_0xd4e6('0x35')]);_0xee309c[_0xd4e6('0x37')]=_['intersection'](_0xee309c[_0xd4e6('0x33')],_0xee309c[_0xd4e6('0x35')]);_0x2b50f4[_0xd4e6('0x39')]=_['intersection'](_0xee309c[_0xd4e6('0x33')],qs[_0xd4e6('0x3a')](_0x528a19['query'][_0xd4e6('0x3a')]));_0x2b50f4[_0xd4e6('0x39')]=_0x2b50f4['attributes'][_0xd4e6('0x3b')]?_0x2b50f4[_0xd4e6('0x39')]:_0xee309c['model'];if(_0x528a19[_0xd4e6('0x35')]['includeAll']){_0x2b50f4[_0xd4e6('0x48')]=[{'all':!![]}];}_0x2b50f4=_[_0xd4e6('0x43')]({},_0x2b50f4,_0x528a19['options']);return db[_0xd4e6('0x47')]['find'](_0x2b50f4)[_0xd4e6('0x28')](handleEntityNotFound(_0x4ac9f4,null))['then'](respondWithResult(_0x4ac9f4,null))[_0xd4e6('0x4b')](handleError(_0x4ac9f4,null));};exports[_0xd4e6('0x4e')]=function(_0x2160a4,_0x43b656){return db['SugarcrmAccount']['create'](_0x2160a4['body'],{})['then'](respondWithResult(_0x43b656,0xc9))[_0xd4e6('0x4b')](handleError(_0x43b656,null));};exports[_0xd4e6('0x27')]=function(_0xa66b78,_0x4b102c){if(_0xa66b78[_0xd4e6('0x4f')]['id']){delete _0xa66b78[_0xd4e6('0x4f')]['id'];}return db['SugarcrmAccount'][_0xd4e6('0x50')]({'where':{'id':_0xa66b78['params']['id']}})[_0xd4e6('0x28')](handleEntityNotFound(_0x4b102c,null))[_0xd4e6('0x28')](saveUpdates(_0xa66b78[_0xd4e6('0x4f')],null))[_0xd4e6('0x28')](respondWithResult(_0x4b102c,null))[_0xd4e6('0x4b')](handleError(_0x4b102c,null));};exports['destroy']=function(_0x262c2d,_0x205df4){return db[_0xd4e6('0x47')][_0xd4e6('0x50')]({'where':{'id':_0x262c2d[_0xd4e6('0x4d')]['id']}})[_0xd4e6('0x28')](handleEntityNotFound(_0x205df4,null))[_0xd4e6('0x28')](removeEntity(_0x205df4,null))[_0xd4e6('0x4b')](handleError(_0x205df4,null));};exports[_0xd4e6('0x51')]=function(_0x373f4c,_0x291491,_0x2f3710){var _0x479983={};var _0xc3ad65={};var _0x491861;var _0x6d71e2;return db[_0xd4e6('0x47')][_0xd4e6('0x52')]({'where':{'id':_0x373f4c['params']['id']}})[_0xd4e6('0x28')](handleEntityNotFound(_0x291491,null))['then'](function(_0x8ec018){if(_0x8ec018){_0x491861=_0x8ec018;_0xc3ad65[_0xd4e6('0x33')]=_[_0xd4e6('0x36')](db['SugarcrmConfiguration'][_0xd4e6('0x30')]);_0xc3ad65[_0xd4e6('0x35')]=_[_0xd4e6('0x36')](_0x373f4c[_0xd4e6('0x35')]);_0xc3ad65[_0xd4e6('0x37')]=_[_0xd4e6('0x38')](_0xc3ad65['model'],_0xc3ad65[_0xd4e6('0x35')]);_0x479983[_0xd4e6('0x39')]=_[_0xd4e6('0x38')](_0xc3ad65[_0xd4e6('0x33')],qs['fields'](_0x373f4c[_0xd4e6('0x35')][_0xd4e6('0x3a')]));_0x479983[_0xd4e6('0x39')]=_0x479983['attributes'][_0xd4e6('0x3b')]?_0x479983[_0xd4e6('0x39')]:_0xc3ad65[_0xd4e6('0x33')];_0x479983[_0xd4e6('0x3e')]=qs[_0xd4e6('0x3f')](_0x373f4c[_0xd4e6('0x35')]['sort']);_0x479983[_0xd4e6('0x40')]=qs['filters'](_[_0xd4e6('0x41')](_0x373f4c[_0xd4e6('0x35')],_0xc3ad65[_0xd4e6('0x37')]));if(_0x373f4c[_0xd4e6('0x35')]['filter']){_0x479983[_0xd4e6('0x40')]=_[_0xd4e6('0x43')](_0x479983['where'],{'$or':_[_0xd4e6('0x34')](_0x479983[_0xd4e6('0x39')],function(_0x861942){var _0x4dccca={};_0x4dccca[_0x861942]={'$like':'%'+_0x373f4c[_0xd4e6('0x35')][_0xd4e6('0x42')]+'%'};return _0x4dccca;})});}_0x479983=_[_0xd4e6('0x43')]({},_0x479983,_0x373f4c[_0xd4e6('0x46')]);return _0x491861[_0xd4e6('0x51')](_0x479983);}})[_0xd4e6('0x28')](function(_0x8056fa){if(_0x8056fa){_0x6d71e2=_0x8056fa['length'];if(!_0x373f4c['query'][_0xd4e6('0x3c')](_0xd4e6('0x3d'))){_0x479983['limit']=qs[_0xd4e6('0x20')](_0x373f4c[_0xd4e6('0x35')][_0xd4e6('0x20')]);_0x479983[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x373f4c[_0xd4e6('0x35')]['offset']);}return _0x491861['getConfigurations'](_0x479983);}})[_0xd4e6('0x28')](function(_0xacfbcf){if(_0xacfbcf){return _0xacfbcf?{'count':_0x6d71e2,'rows':_0xacfbcf}:null;}})['then'](respondWithResult(_0x291491,null))[_0xd4e6('0x4b')](handleError(_0x291491,null));};exports[_0xd4e6('0x53')]=function(_0x47d07a,_0x3e8b83,_0x866183){if(_0x47d07a[_0xd4e6('0x4f')]['id']){delete _0x47d07a[_0xd4e6('0x4f')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x47d07a[_0xd4e6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e8b83,null))['then'](function(_0x629079){if(_0x629079){_0x47d07a[_0xd4e6('0x4f')][_0xd4e6('0x54')]=_0x629079['id'];_0x47d07a[_0xd4e6('0x4f')][_0xd4e6('0x55')]=integrations['getSubjects'](_0x47d07a[_0xd4e6('0x4f')][_0xd4e6('0x56')],_0x47d07a[_0xd4e6('0x4f')][_0xd4e6('0x44')]);_0x47d07a['body'][_0xd4e6('0x57')]=integrations[_0xd4e6('0x58')](_0x47d07a[_0xd4e6('0x4f')][_0xd4e6('0x56')],_0x47d07a[_0xd4e6('0x4f')]['type']);return db[_0xd4e6('0x59')][_0xd4e6('0x4e')](_0x47d07a[_0xd4e6('0x4f')],{'include':[{'model':db['SugarcrmField'],'as':_0xd4e6('0x55')},{'model':db[_0xd4e6('0x5a')],'as':_0xd4e6('0x57')}]});}return null;})['then'](respondWithResult(_0x3e8b83,null))[_0xd4e6('0x4b')](handleError(_0x3e8b83,null));};exports[_0xd4e6('0x5b')]=function(_0x11df4d,_0x49d2fc,_0x2b929c){var _0x543d89='';var _0x50975a=['id',_0xd4e6('0x2e'),_0xd4e6('0x5c'),_0xd4e6('0x5d'),'description',_0xd4e6('0x5e'),'duration_hours',_0xd4e6('0x5f'),_0xd4e6('0x60'),'parent_type',_0xd4e6('0x61'),_0xd4e6('0x62')];return db[_0xd4e6('0x47')][_0xd4e6('0x52')]({'where':{'id':_0x11df4d[_0xd4e6('0x4d')]['id']},'attributes':['id',_0xd4e6('0x63'),_0xd4e6('0x64'),'remoteUri']})['then'](handleEntityNotFound(_0x49d2fc,null))[_0xd4e6('0x28')](function(_0x16409b){if(_0x16409b){_0x543d89=_0x16409b[_0xd4e6('0x65')];var _0x5b1313=_0x543d89[_0xd4e6('0x66')](-0x1);if(_0x5b1313==='/'){_0x543d89=_0x543d89[_0xd4e6('0x67')](0x0,_0x543d89['lastIndexOf'](_0x5b1313));}return rp({'method':_0xd4e6('0x68'),'uri':util[_0xd4e6('0x69')]('%s%s',_0x543d89,_0xd4e6('0x6a')),'json':!![],'form':{'method':_0xd4e6('0x6b'),'input_type':_0xd4e6('0x6c'),'response_type':_0xd4e6('0x6c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x16409b[_0xd4e6('0x63')],'password':_0x16409b['password'],'encryption':_0xd4e6('0x6d')},'application':_0xd4e6('0x6e')})}});}})[_0xd4e6('0x28')](function(_0x22c091){if(_0x22c091&&_0x22c091[_0xd4e6('0x2e')]!==_0xd4e6('0x6f')&&_0x22c091[_0xd4e6('0x2e')]!==_0xd4e6('0x70')){return rp({'method':_0xd4e6('0x68'),'uri':util['format'](_0xd4e6('0x71'),_0x543d89,_0xd4e6('0x6a')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xd4e6('0x6c'),'rest_data':JSON[_0xd4e6('0x72')]({'session':_0x22c091['id'],'module_name':_0xd4e6('0x73')})}})[_0xd4e6('0x28')](function(_0x9ec0eb){if(_0x9ec0eb){var _0x1364a2=_[_0xd4e6('0x74')](_0x9ec0eb[_0xd4e6('0x75')]);_[_0xd4e6('0x76')](_0x1364a2,function(_0x176f4d){return _0x50975a[_0xd4e6('0x77')](_0x176f4d[_0xd4e6('0x2e')]);});return{'count':_0x1364a2[_0xd4e6('0x3b')],'rows':_[_0xd4e6('0x34')](_0x1364a2,function(_0x9a7072){return{'id':_0x9a7072['name'],'name':_0x9a7072[_0xd4e6('0x78')],'custom':_[_0xd4e6('0x79')](_0x9a7072['name'],'_c')?!![]:![],'options':_0x9a7072[_0xd4e6('0x46')]?_[_0xd4e6('0x34')](_['values'](_0x9a7072['options']),function(_0x25cc4e){return{'name':_0x25cc4e['value'],'value':_0x25cc4e[_0xd4e6('0x2e')]};}):[]};})};}})[_0xd4e6('0x28')](respondWithResult(_0x49d2fc,null))[_0xd4e6('0x4b')](function(_0x2ddcf4){var _0x55e823=_0x11df4d[_0xd4e6('0x35')]['test']?0x1f4:_0x2ddcf4['statusCode']||0x1f4;logger[_0xd4e6('0x2c')]('getFields,\x20%s,\x20%s,\x20%s',_0xd4e6('0x5b'),_0x55e823,JSON[_0xd4e6('0x72')](_0x2ddcf4));delete _0x2ddcf4[_0xd4e6('0x2e')];if(_0x55e823===0x191){_0x55e823=0x190;}_0x49d2fc['status'](_0x55e823)[_0xd4e6('0x7a')](_0x11df4d[_0xd4e6('0x35')]['test']?{'message':_0xd4e6('0x7b'),'statusCode':_0x2ddcf4[_0xd4e6('0x7c')]}:_0x2ddcf4);});}else{var _0xe26ab3=0x1f4;_0x49d2fc[_0xd4e6('0x1c')](_0xe26ab3)['send']({'message':_0xd4e6('0x7b'),'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 6d2bc58..98dc995 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 _0x0830=['int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount'];(function(_0x2212fc,_0x4652dd){var _0x572da4=function(_0x138747){while(--_0x138747){_0x2212fc['push'](_0x2212fc['shift']());}};_0x572da4(++_0x4652dd);}(_0x0830,0x1a5));var _0x0083=function(_0x2d15c6,_0x2489f9){_0x2d15c6=_0x2d15c6-0x0;var _0x2ecfdf=_0x0830[_0x2d15c6];return _0x2ecfdf;};'use strict';var _=require(_0x0083('0x0'));var util=require(_0x0083('0x1'));var logger=require('../../config/logger')(_0x0083('0x2'));var moment=require(_0x0083('0x3'));var BPromise=require(_0x0083('0x4'));var rp=require(_0x0083('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0083('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x0083('0x7'));module[_0x0083('0x8')]=function(_0x5576d5,_0x3109fb){return _0x5576d5[_0x0083('0x9')](_0x0083('0xa'),attributes,{'tableName':_0x0083('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a26=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x3a26,0x129));var _0x63a2=function(_0x470fe2,_0x3075ec){_0x470fe2=_0x470fe2-0x0;var _0x1a08e4=_0x3a26[_0x470fe2];return _0x1a08e4;};'use strict';var _=require(_0x63a2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x63a2('0x1'));var moment=require(_0x63a2('0x2'));var BPromise=require(_0x63a2('0x3'));var rp=require(_0x63a2('0x4'));var fs=require('fs');var path=require(_0x63a2('0x5'));var rimraf=require('rimraf');var config=require(_0x63a2('0x6'));var attributes=require(_0x63a2('0x7'));var integrations=require(_0x63a2('0x8'));module['exports']=function(_0x47023e,_0xd6eecd){return _0x47023e[_0x63a2('0x9')]('SugarcrmAccount',attributes,{'tableName':_0x63a2('0xa'),'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 fcbc56f..eb7e6bf 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 _0x1542=['model','catch','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x560b5c,_0x314575){var _0x5d648f=function(_0x51000a){while(--_0x51000a){_0x560b5c['push'](_0x560b5c['shift']());}};_0x5d648f(++_0x314575);}(_0x1542,0x134));var _0x2154=function(_0x57f85b,_0x2e9f16){_0x57f85b=_0x57f85b-0x0;var _0x1c368d=_0x1542[_0x57f85b];return _0x1c368d;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var moment=require(_0x2154('0x2'));var BPromise=require(_0x2154('0x3'));var rs=require(_0x2154('0x4'));var fs=require('fs');var Redis=require(_0x2154('0x5'));var db=require(_0x2154('0x6'))['db'];var utils=require(_0x2154('0x7'));var logger=require(_0x2154('0x8'))('rpc');var config=require(_0x2154('0x9'));var jayson=require(_0x2154('0xa'));var client=jayson[_0x2154('0xb')][_0x2154('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a0b58,_0x26d209,_0x42491a){return new BPromise(function(_0x2d0694,_0x507ef9){return client[_0x2154('0xd')](_0x4a0b58,_0x42491a)[_0x2154('0xe')](function(_0x123c0f){logger[_0x2154('0xf')](_0x2154('0x10'),_0x26d209,_0x2154('0x11'));logger[_0x2154('0x12')](_0x2154('0x13'),_0x26d209,'request\x20sent',JSON[_0x2154('0x14')](_0x123c0f));if(_0x123c0f['error']){if(_0x123c0f[_0x2154('0x15')][_0x2154('0x16')]===0x1f4){logger[_0x2154('0x15')](_0x2154('0x10'),_0x26d209,_0x123c0f['error'][_0x2154('0x17')]);return _0x507ef9(_0x123c0f[_0x2154('0x15')]['message']);}logger[_0x2154('0x15')](_0x2154('0x10'),_0x26d209,_0x123c0f[_0x2154('0x15')][_0x2154('0x17')]);return _0x2d0694(_0x123c0f[_0x2154('0x15')][_0x2154('0x17')]);}else{logger[_0x2154('0xf')](_0x2154('0x10'),_0x26d209,_0x2154('0x11'));_0x2d0694(_0x123c0f[_0x2154('0x18')][_0x2154('0x17')]);}})['catch'](function(_0x78f8c){logger[_0x2154('0x15')](_0x2154('0x10'),_0x26d209,_0x78f8c);_0x507ef9(_0x78f8c);});});}exports[_0x2154('0x19')]=function(_0x486836){var _0xe22feb=this;return new Promise(function(_0x3d680a,_0xf3dff4){return db[_0x2154('0x1a')][_0x2154('0x1b')]({'raw':_0x486836['options']?_0x486836[_0x2154('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x486836[_0x2154('0x1c')]?_0x486836[_0x2154('0x1c')][_0x2154('0x1d')]||null:null,'attributes':_0x486836[_0x2154('0x1c')]?_0x486836['options'][_0x2154('0x1e')]||null:null,'limit':_0x486836[_0x2154('0x1c')]?_0x486836[_0x2154('0x1c')][_0x2154('0x1f')]||null:null,'include':_0x486836[_0x2154('0x1c')]?_0x486836[_0x2154('0x1c')][_0x2154('0x20')]?_['map'](_0x486836[_0x2154('0x1c')][_0x2154('0x20')],function(_0x3f1212){return{'model':db[_0x3f1212['model']],'as':_0x3f1212['as'],'attributes':_0x3f1212['attributes'],'include':_0x3f1212[_0x2154('0x20')]?_[_0x2154('0x21')](_0x3f1212[_0x2154('0x20')],function(_0xe1f9db){return{'model':db[_0xe1f9db[_0x2154('0x22')]],'as':_0xe1f9db['as'],'attributes':_0xe1f9db[_0x2154('0x1e')],'include':_0xe1f9db[_0x2154('0x20')]?_[_0x2154('0x21')](_0xe1f9db[_0x2154('0x20')],function(_0xbe1f90){return{'model':db[_0xbe1f90[_0x2154('0x22')]],'as':_0xbe1f90['as'],'attributes':_0xbe1f90[_0x2154('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2154('0xe')](function(_0x38b3ec){logger[_0x2154('0xf')](_0x2154('0x19'),_0x486836);logger[_0x2154('0x12')](_0x2154('0x19'),_0x486836,JSON[_0x2154('0x14')](_0x38b3ec));_0x3d680a(_0x38b3ec);})[_0x2154('0x23')](function(_0x10199d){logger[_0x2154('0x15')](_0x2154('0x19'),_0x10199d[_0x2154('0x17')],_0x486836);_0xf3dff4(_0xe22feb[_0x2154('0x15')](0x1f4,_0x10199d['message']));});});};exports['ShowSugarcrmAccount']=function(_0x122881){var _0xfd83ef=this;return new Promise(function(_0xdd491d,_0x580be8){return db[_0x2154('0x1a')][_0x2154('0x24')]({'raw':_0x122881[_0x2154('0x1c')]?_0x122881[_0x2154('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x122881[_0x2154('0x1c')]?_0x122881['options'][_0x2154('0x1d')]||null:null,'attributes':_0x122881[_0x2154('0x1c')]?_0x122881[_0x2154('0x1c')]['attributes']||null:null,'include':_0x122881[_0x2154('0x1c')]?_0x122881['options']['include']?_[_0x2154('0x21')](_0x122881[_0x2154('0x1c')][_0x2154('0x20')],function(_0x3f94ff){return{'model':db[_0x3f94ff['model']],'as':_0x3f94ff['as'],'attributes':_0x3f94ff[_0x2154('0x1e')],'include':_0x3f94ff[_0x2154('0x20')]?_[_0x2154('0x21')](_0x3f94ff[_0x2154('0x20')],function(_0x45a64c){return{'model':db[_0x45a64c[_0x2154('0x22')]],'as':_0x45a64c['as'],'attributes':_0x45a64c[_0x2154('0x1e')],'include':_0x45a64c[_0x2154('0x20')]?_[_0x2154('0x21')](_0x45a64c[_0x2154('0x20')],function(_0x41955c){return{'model':db[_0x41955c[_0x2154('0x22')]],'as':_0x41955c['as'],'attributes':_0x41955c[_0x2154('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295b7a){logger[_0x2154('0xf')](_0x2154('0x25'),_0x122881);logger['debug'](_0x2154('0x25'),_0x122881,JSON[_0x2154('0x14')](_0x295b7a));_0xdd491d(_0x295b7a);})[_0x2154('0x23')](function(_0x5794d3){logger['error']('ShowSugarcrmAccount',_0x5794d3[_0x2154('0x17')],_0x122881);_0x580be8(_0xfd83ef[_0x2154('0x15')](0x1f4,_0x5794d3['message']));});});}; \ No newline at end of file +var _0xcb06=['find','where','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetSugarcrmAccount','options','raw','limit','include','map','model','attributes','ShowSugarcrmAccount','SugarcrmAccount'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xcb06,0x6c));var _0x6cb0=function(_0x187efb,_0xcaa75){_0x187efb=_0x187efb-0x0;var _0x4d72f9=_0xcb06[_0x187efb];return _0x4d72f9;};'use strict';var _=require('lodash');var util=require(_0x6cb0('0x0'));var moment=require(_0x6cb0('0x1'));var BPromise=require(_0x6cb0('0x2'));var rs=require(_0x6cb0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6cb0('0x4'));var logger=require(_0x6cb0('0x5'))(_0x6cb0('0x6'));var config=require(_0x6cb0('0x7'));var jayson=require(_0x6cb0('0x8'));var client=jayson[_0x6cb0('0x9')][_0x6cb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c6551,_0x24249b,_0x5c70b2){return new BPromise(function(_0x4cf25b,_0x5de46f){return client[_0x6cb0('0xb')](_0x5c6551,_0x5c70b2)[_0x6cb0('0xc')](function(_0x21276e){logger[_0x6cb0('0xd')](_0x6cb0('0xe'),_0x24249b,'request\x20sent');logger[_0x6cb0('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x24249b,_0x6cb0('0x10'),JSON['stringify'](_0x21276e));if(_0x21276e['error']){if(_0x21276e[_0x6cb0('0x11')][_0x6cb0('0x12')]===0x1f4){logger[_0x6cb0('0x11')](_0x6cb0('0xe'),_0x24249b,_0x21276e[_0x6cb0('0x11')][_0x6cb0('0x13')]);return _0x5de46f(_0x21276e['error'][_0x6cb0('0x13')]);}logger['error'](_0x6cb0('0xe'),_0x24249b,_0x21276e[_0x6cb0('0x11')][_0x6cb0('0x13')]);return _0x4cf25b(_0x21276e[_0x6cb0('0x11')]['message']);}else{logger[_0x6cb0('0xd')](_0x6cb0('0xe'),_0x24249b,_0x6cb0('0x10'));_0x4cf25b(_0x21276e[_0x6cb0('0x14')][_0x6cb0('0x13')]);}})[_0x6cb0('0x15')](function(_0x1b0fbc){logger[_0x6cb0('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x24249b,_0x1b0fbc);_0x5de46f(_0x1b0fbc);});});}exports[_0x6cb0('0x16')]=function(_0x526bde){var _0x5b97d1=this;return new Promise(function(_0x1c222a,_0x420bf3){return db['SugarcrmAccount']['findAll']({'raw':_0x526bde[_0x6cb0('0x17')]?_0x526bde[_0x6cb0('0x17')][_0x6cb0('0x18')]===undefined?!![]:![]:!![],'where':_0x526bde['options']?_0x526bde[_0x6cb0('0x17')]['where']||null:null,'attributes':_0x526bde[_0x6cb0('0x17')]?_0x526bde[_0x6cb0('0x17')]['attributes']||null:null,'limit':_0x526bde[_0x6cb0('0x17')]?_0x526bde[_0x6cb0('0x17')][_0x6cb0('0x19')]||null:null,'include':_0x526bde['options']?_0x526bde[_0x6cb0('0x17')][_0x6cb0('0x1a')]?_[_0x6cb0('0x1b')](_0x526bde['options']['include'],function(_0x56d0c8){return{'model':db[_0x56d0c8[_0x6cb0('0x1c')]],'as':_0x56d0c8['as'],'attributes':_0x56d0c8[_0x6cb0('0x1d')],'include':_0x56d0c8[_0x6cb0('0x1a')]?_[_0x6cb0('0x1b')](_0x56d0c8[_0x6cb0('0x1a')],function(_0x1521c6){return{'model':db[_0x1521c6['model']],'as':_0x1521c6['as'],'attributes':_0x1521c6[_0x6cb0('0x1d')],'include':_0x1521c6[_0x6cb0('0x1a')]?_['map'](_0x1521c6['include'],function(_0x29d1d2){return{'model':db[_0x29d1d2[_0x6cb0('0x1c')]],'as':_0x29d1d2['as'],'attributes':_0x29d1d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x6cb0('0xc')](function(_0x1eb391){logger['info'](_0x6cb0('0x16'),_0x526bde);logger['debug'](_0x6cb0('0x16'),_0x526bde,JSON['stringify'](_0x1eb391));_0x1c222a(_0x1eb391);})['catch'](function(_0x476c35){logger[_0x6cb0('0x11')]('GetSugarcrmAccount',_0x476c35[_0x6cb0('0x13')],_0x526bde);_0x420bf3(_0x5b97d1[_0x6cb0('0x11')](0x1f4,_0x476c35[_0x6cb0('0x13')]));});});};exports[_0x6cb0('0x1e')]=function(_0x275330){var _0x102f67=this;return new Promise(function(_0x3c06d7,_0xc1fd38){return db[_0x6cb0('0x1f')][_0x6cb0('0x20')]({'raw':_0x275330[_0x6cb0('0x17')]?_0x275330[_0x6cb0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x275330[_0x6cb0('0x17')]?_0x275330[_0x6cb0('0x17')][_0x6cb0('0x21')]||null:null,'attributes':_0x275330['options']?_0x275330[_0x6cb0('0x17')][_0x6cb0('0x1d')]||null:null,'include':_0x275330['options']?_0x275330[_0x6cb0('0x17')][_0x6cb0('0x1a')]?_[_0x6cb0('0x1b')](_0x275330[_0x6cb0('0x17')][_0x6cb0('0x1a')],function(_0x404aa4){return{'model':db[_0x404aa4[_0x6cb0('0x1c')]],'as':_0x404aa4['as'],'attributes':_0x404aa4['attributes'],'include':_0x404aa4[_0x6cb0('0x1a')]?_[_0x6cb0('0x1b')](_0x404aa4[_0x6cb0('0x1a')],function(_0x46c06e){return{'model':db[_0x46c06e['model']],'as':_0x46c06e['as'],'attributes':_0x46c06e['attributes'],'include':_0x46c06e['include']?_[_0x6cb0('0x1b')](_0x46c06e['include'],function(_0x349360){return{'model':db[_0x349360[_0x6cb0('0x1c')]],'as':_0x349360['as'],'attributes':_0x349360[_0x6cb0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6cb0('0xc')](function(_0x1ee70d){logger[_0x6cb0('0xd')]('ShowSugarcrmAccount',_0x275330);logger[_0x6cb0('0xf')](_0x6cb0('0x1e'),_0x275330,JSON[_0x6cb0('0x22')](_0x1ee70d));_0x3c06d7(_0x1ee70d);})['catch'](function(_0x3ca5d7){logger['error'](_0x6cb0('0x1e'),_0x3ca5d7[_0x6cb0('0x13')],_0x275330);_0xc1fd38(_0x102f67[_0x6cb0('0x11')](0x1f4,_0x3ca5d7[_0x6cb0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 6cb4e1c..c54786c 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 _0x5fa3=['show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id'];(function(_0x3e233a,_0x127c27){var _0x59277d=function(_0x257555){while(--_0x257555){_0x3e233a['push'](_0x3e233a['shift']());}};_0x59277d(++_0x127c27);}(_0x5fa3,0x8a));var _0x35fa=function(_0x5e9d76,_0x11e845){_0x5e9d76=_0x5e9d76-0x0;var _0x3ede40=_0x5fa3[_0x5e9d76];return _0x3ede40;};'use strict';var multer=require(_0x35fa('0x0'));var util=require(_0x35fa('0x1'));var path=require('path');var timeout=require(_0x35fa('0x2'));var express=require(_0x35fa('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x35fa('0x4'));var controller=require(_0x35fa('0x5'));router['get']('/',auth[_0x35fa('0x6')](),controller['index']);router[_0x35fa('0x7')](_0x35fa('0x8'),auth[_0x35fa('0x6')](),controller[_0x35fa('0x9')]);router[_0x35fa('0x7')](_0x35fa('0xa'),auth[_0x35fa('0x6')](),controller[_0x35fa('0xb')]);router['get'](_0x35fa('0xc'),auth[_0x35fa('0x6')](),controller['getSubjects']);router[_0x35fa('0x7')](_0x35fa('0xd'),auth[_0x35fa('0x6')](),controller[_0x35fa('0xe')]);router[_0x35fa('0xf')]('/',auth[_0x35fa('0x6')](),controller[_0x35fa('0x10')]);router[_0x35fa('0x11')](_0x35fa('0x8'),auth['isAuthenticated'](),controller[_0x35fa('0x12')]);router[_0x35fa('0x13')](_0x35fa('0x8'),auth[_0x35fa('0x6')](),controller[_0x35fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2aec=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','destroy','exports','multer'];(function(_0x366711,_0x2970b3){var _0x1980b1=function(_0x474b14){while(--_0x474b14){_0x366711['push'](_0x366711['shift']());}};_0x1980b1(++_0x2970b3);}(_0x2aec,0x13f));var _0xc2ae=function(_0x538a47,_0x30b94d){_0x538a47=_0x538a47-0x0;var _0x60f392=_0x2aec[_0x538a47];return _0x60f392;};'use strict';var multer=require(_0xc2ae('0x0'));var util=require('util');var path=require(_0xc2ae('0x1'));var timeout=require(_0xc2ae('0x2'));var express=require(_0xc2ae('0x3'));var router=express[_0xc2ae('0x4')]();var fs_extra=require(_0xc2ae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc2ae('0x6'));var config=require(_0xc2ae('0x7'));var controller=require(_0xc2ae('0x8'));router[_0xc2ae('0x9')]('/',auth[_0xc2ae('0xa')](),controller[_0xc2ae('0xb')]);router['get'](_0xc2ae('0xc'),auth[_0xc2ae('0xa')](),controller[_0xc2ae('0xd')]);router['get']('/:id/fields',auth[_0xc2ae('0xa')](),controller['getFields']);router[_0xc2ae('0x9')](_0xc2ae('0xe'),auth[_0xc2ae('0xa')](),controller[_0xc2ae('0xf')]);router['get'](_0xc2ae('0x10'),auth[_0xc2ae('0xa')](),controller[_0xc2ae('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc2ae('0xc'),auth[_0xc2ae('0xa')](),controller['update']);router['delete'](_0xc2ae('0xc'),auth[_0xc2ae('0xa')](),controller[_0xc2ae('0x12')]);module[_0xc2ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 346b8c1..13a9fb7 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 _0x6c82=['STRING','sequelize','exports'];(function(_0x3d7cc6,_0x2f929b){var _0x49bb95=function(_0x2ad666){while(--_0x2ad666){_0x3d7cc6['push'](_0x3d7cc6['shift']());}};_0x49bb95(++_0x2f929b);}(_0x6c82,0xd6));var _0x26c8=function(_0x433fdf,_0x5f99a0){_0x433fdf=_0x433fdf-0x0;var _0x522aea=_0x6c82[_0x433fdf];return _0x522aea;};'use strict';var Sequelize=require(_0x26c8('0x0'));module[_0x26c8('0x1')]={'name':{'type':Sequelize[_0x26c8('0x2')]},'description':{'type':Sequelize[_0x26c8('0x2')]}}; \ No newline at end of file +var _0x079b=['exports','STRING','sequelize'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x079b,0x107));var _0xb079=function(_0x3e9650,_0x15c3d9){_0x3e9650=_0x3e9650-0x0;var _0x2921f7=_0x079b[_0x3e9650];return _0x2921f7;};'use strict';var Sequelize=require(_0xb079('0x0'));module[_0xb079('0x1')]={'name':{'type':Sequelize[_0xb079('0x2')]},'description':{'type':Sequelize[_0xb079('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index bb0d411..4dc6f7c 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 _0xf2b4=['request-promise','moment','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','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','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','catch','show','params','keys','merge','find','create','body','getFields','SugarcrmField','pick','getSubjects','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0xf2b4,0x139));var _0x4f2b=function(_0xc6f1a0,_0x2f9bc5){_0xc6f1a0=_0xc6f1a0-0x0;var _0x38a80a=_0xf2b4[_0xc6f1a0];return _0x38a80a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f2b('0x0'));var zipdir=require(_0x4f2b('0x1'));var jsonpatch=require(_0x4f2b('0x2'));var rp=require(_0x4f2b('0x3'));var moment=require(_0x4f2b('0x4'));var BPromise=require(_0x4f2b('0x5'));var Mustache=require(_0x4f2b('0x6'));var util=require(_0x4f2b('0x7'));var path=require('path');var sox=require(_0x4f2b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f2b('0x9'));var squel=require(_0x4f2b('0xa'));var crypto=require('crypto');var jsforce=require(_0x4f2b('0xb'));var deskjs=require(_0x4f2b('0xc'));var toCsv=require(_0x4f2b('0xd'));var querystring=require(_0x4f2b('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f2b('0xf'));var authService=require(_0x4f2b('0x10'));var qs=require(_0x4f2b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f2b('0x12'));var logger=require(_0x4f2b('0x13'))(_0x4f2b('0x14'));var utils=require(_0x4f2b('0x15'));var config=require(_0x4f2b('0x16'));var licenseUtil=require(_0x4f2b('0x17'));var db=require(_0x4f2b('0x18'))['db'];function respondWithStatusCode(_0x30e743,_0x31ccc5){_0x31ccc5=_0x31ccc5||0xcc;return function(_0x20e7df){if(_0x20e7df){return _0x30e743[_0x4f2b('0x19')](_0x31ccc5);}return _0x30e743[_0x4f2b('0x1a')](_0x31ccc5)[_0x4f2b('0x1b')]();};}function respondWithResult(_0x434b6b,_0x332124){_0x332124=_0x332124||0xc8;return function(_0x1b4fa6){if(_0x1b4fa6){return _0x434b6b['status'](_0x332124)[_0x4f2b('0x1c')](_0x1b4fa6);}};}function respondWithFilteredResult(_0x505929,_0x35a908){return function(_0x42bd4c){if(_0x42bd4c){var _0x4f5308=typeof _0x35a908['offset']===_0x4f2b('0x1d')&&typeof _0x35a908[_0x4f2b('0x1e')]===_0x4f2b('0x1d');var _0x1551b4=_0x42bd4c[_0x4f2b('0x1f')];var _0x5d4de4=_0x4f5308?0x0:_0x35a908['offset'];var _0x4b0107=_0x4f5308?_0x42bd4c[_0x4f2b('0x1f')]:_0x35a908[_0x4f2b('0x20')]+_0x35a908[_0x4f2b('0x1e')];var _0x178aca;if(_0x4b0107>=_0x1551b4){_0x4b0107=_0x1551b4;_0x178aca=0xc8;}else{_0x178aca=0xce;}_0x505929[_0x4f2b('0x1a')](_0x178aca);return _0x505929[_0x4f2b('0x21')](_0x4f2b('0x22'),_0x5d4de4+'-'+_0x4b0107+'/'+_0x1551b4)['json'](_0x42bd4c);}return null;};}function patchUpdates(_0x308b5e){return function(_0x419c24){try{jsonpatch[_0x4f2b('0x23')](_0x419c24,_0x308b5e,!![]);}catch(_0x3ad967){return BPromise['reject'](_0x3ad967);}return _0x419c24[_0x4f2b('0x24')]();};}function saveUpdates(_0x41bd71,_0x5a9d11){return function(_0x10449e){if(_0x10449e){return _0x10449e[_0x4f2b('0x25')](_0x41bd71)[_0x4f2b('0x26')](function(_0x4e9e55){return _0x4e9e55;});}return null;};}function removeEntity(_0x5001f7,_0x11d4d7){return function(_0x279362){if(_0x279362){return _0x279362[_0x4f2b('0x27')]()[_0x4f2b('0x26')](function(){_0x5001f7[_0x4f2b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ff8ac,_0x1109bc){return function(_0x3e2db0){if(!_0x3e2db0){_0x4ff8ac[_0x4f2b('0x19')](0x194);}return _0x3e2db0;};}function handleError(_0xc0911e,_0x257cef){_0x257cef=_0x257cef||0x1f4;return function(_0x396d09){logger[_0x4f2b('0x28')](_0x396d09['stack']);if(_0x396d09[_0x4f2b('0x29')]){delete _0x396d09[_0x4f2b('0x29')];}_0xc0911e[_0x4f2b('0x1a')](_0x257cef)[_0x4f2b('0x2a')](_0x396d09);};}exports[_0x4f2b('0x2b')]=function(_0x30ba15,_0x13a31a){var _0x19a3e5={},_0x52d43d={},_0x5d5903={'count':0x0,'rows':[]};var _0x27e6d2=_[_0x4f2b('0x2c')](db[_0x4f2b('0x2d')][_0x4f2b('0x2e')],function(_0x4c9924){return{'name':_0x4c9924['fieldName'],'type':_0x4c9924[_0x4f2b('0x2f')]['key']};});_0x52d43d[_0x4f2b('0x30')]=_[_0x4f2b('0x2c')](_0x27e6d2,_0x4f2b('0x29'));_0x52d43d[_0x4f2b('0x31')]=_['keys'](_0x30ba15[_0x4f2b('0x31')]);_0x52d43d[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x52d43d['model'],_0x52d43d['query']);_0x19a3e5[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x52d43d['model'],qs[_0x4f2b('0x35')](_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x19a3e5[_0x4f2b('0x34')]=_0x19a3e5['attributes'][_0x4f2b('0x36')]?_0x19a3e5[_0x4f2b('0x34')]:_0x52d43d[_0x4f2b('0x30')];if(!_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x37')](_0x4f2b('0x38'))){_0x19a3e5['limit']=qs['limit'](_0x30ba15['query']['limit']);_0x19a3e5[_0x4f2b('0x20')]=qs[_0x4f2b('0x20')](_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x20')]);}_0x19a3e5[_0x4f2b('0x39')]=qs[_0x4f2b('0x3a')](_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x3a')]);_0x19a3e5[_0x4f2b('0x3b')]=qs['filters'](_['pick'](_0x30ba15['query'],_0x52d43d['filters']),_0x27e6d2);if(_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x3c')]){_0x19a3e5[_0x4f2b('0x3b')]=_['merge'](_0x19a3e5[_0x4f2b('0x3b')],{'$or':_['map'](_0x27e6d2,function(_0x433c78){if(_0x433c78[_0x4f2b('0x2f')]!==_0x4f2b('0x3d')){var _0x8b0b00={};_0x8b0b00[_0x433c78[_0x4f2b('0x29')]]={'$like':'%'+_0x30ba15['query']['filter']+'%'};return _0x8b0b00;}})});}_0x19a3e5=_['merge']({},_0x19a3e5,_0x30ba15[_0x4f2b('0x3e')]);var _0x456ffb={'where':_0x19a3e5['where']};return db['SugarcrmConfiguration']['count'](_0x456ffb)['then'](function(_0x4f7c67){_0x5d5903[_0x4f2b('0x1f')]=_0x4f7c67;if(_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x3f')]){_0x19a3e5[_0x4f2b('0x40')]=[{'all':!![]}];}return db[_0x4f2b('0x2d')]['findAll'](_0x19a3e5);})[_0x4f2b('0x26')](function(_0x4a9c0f){_0x5d5903['rows']=_0x4a9c0f;return _0x5d5903;})[_0x4f2b('0x26')](respondWithFilteredResult(_0x13a31a,_0x19a3e5))[_0x4f2b('0x41')](handleError(_0x13a31a,null));};exports[_0x4f2b('0x42')]=function(_0x2fa2ef,_0x286682){var _0x2edcd3={'raw':![],'where':{'id':_0x2fa2ef[_0x4f2b('0x43')]['id']}},_0x41638d={};_0x41638d[_0x4f2b('0x30')]=_[_0x4f2b('0x44')](db[_0x4f2b('0x2d')][_0x4f2b('0x2e')]);_0x41638d[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x2fa2ef['query']);_0x41638d[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x41638d['model'],_0x41638d[_0x4f2b('0x31')]);_0x2edcd3['attributes']=_['intersection'](_0x41638d[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x2fa2ef[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x2edcd3['attributes']=_0x2edcd3[_0x4f2b('0x34')]['length']?_0x2edcd3['attributes']:_0x41638d[_0x4f2b('0x30')];if(_0x2fa2ef['query'][_0x4f2b('0x3f')]){_0x2edcd3[_0x4f2b('0x40')]=[{'all':!![]}];}_0x2edcd3=_[_0x4f2b('0x45')]({},_0x2edcd3,_0x2fa2ef[_0x4f2b('0x3e')]);return db[_0x4f2b('0x2d')][_0x4f2b('0x46')](_0x2edcd3)['then'](handleEntityNotFound(_0x286682,null))[_0x4f2b('0x26')](respondWithResult(_0x286682,null))[_0x4f2b('0x41')](handleError(_0x286682,null));};exports[_0x4f2b('0x47')]=function(_0x4b0de0,_0x200369){return db['SugarcrmConfiguration'][_0x4f2b('0x47')](_0x4b0de0['body'],{})[_0x4f2b('0x26')](respondWithResult(_0x200369,0xc9))[_0x4f2b('0x41')](handleError(_0x200369,null));};exports[_0x4f2b('0x25')]=function(_0x4d397d,_0x110ef6){if(_0x4d397d[_0x4f2b('0x48')]['id']){delete _0x4d397d['body']['id'];}return db[_0x4f2b('0x2d')][_0x4f2b('0x46')]({'where':{'id':_0x4d397d[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x110ef6,null))[_0x4f2b('0x26')](saveUpdates(_0x4d397d[_0x4f2b('0x48')],null))[_0x4f2b('0x26')](respondWithResult(_0x110ef6,null))[_0x4f2b('0x41')](handleError(_0x110ef6,null));};exports[_0x4f2b('0x27')]=function(_0x4189cf,_0x2b58e5){return db[_0x4f2b('0x2d')][_0x4f2b('0x46')]({'where':{'id':_0x4189cf[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x2b58e5,null))['then'](removeEntity(_0x2b58e5,null))['catch'](handleError(_0x2b58e5,null));};exports[_0x4f2b('0x49')]=function(_0x51f0b2,_0x13aea8,_0x21a7f8){var _0x2ac6fd={};var _0x5eaede={};var _0x550e4a;var _0x214af0;return db[_0x4f2b('0x2d')]['findOne']({'where':{'id':_0x51f0b2[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x13aea8,null))[_0x4f2b('0x26')](function(_0x14472c){if(_0x14472c){_0x550e4a=_0x14472c;_0x5eaede['model']=_['keys'](db[_0x4f2b('0x4a')]['rawAttributes']);_0x5eaede[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x51f0b2[_0x4f2b('0x31')]);_0x5eaede[_0x4f2b('0x32')]=_['intersection'](_0x5eaede[_0x4f2b('0x30')],_0x5eaede['query']);_0x2ac6fd[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x5eaede[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x2ac6fd[_0x4f2b('0x34')]=_0x2ac6fd['attributes'][_0x4f2b('0x36')]?_0x2ac6fd[_0x4f2b('0x34')]:_0x5eaede[_0x4f2b('0x30')];_0x2ac6fd[_0x4f2b('0x39')]=qs['sort'](_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x3a')]);_0x2ac6fd['where']=qs[_0x4f2b('0x32')](_[_0x4f2b('0x4b')](_0x51f0b2['query'],_0x5eaede[_0x4f2b('0x32')]));if(_0x51f0b2['query'][_0x4f2b('0x3c')]){_0x2ac6fd[_0x4f2b('0x3b')]=_[_0x4f2b('0x45')](_0x2ac6fd['where'],{'$or':_[_0x4f2b('0x2c')](_0x2ac6fd[_0x4f2b('0x34')],function(_0x38bf18){var _0x70453f={};_0x70453f[_0x38bf18]={'$like':'%'+_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x3c')]+'%'};return _0x70453f;})});}_0x2ac6fd=_[_0x4f2b('0x45')]({},_0x2ac6fd,_0x51f0b2[_0x4f2b('0x3e')]);return _0x550e4a[_0x4f2b('0x49')](_0x2ac6fd);}})[_0x4f2b('0x26')](function(_0x4339c6){if(_0x4339c6){_0x214af0=_0x4339c6[_0x4f2b('0x36')];if(!_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x37')](_0x4f2b('0x38'))){_0x2ac6fd['limit']=qs[_0x4f2b('0x1e')](_0x51f0b2['query']['limit']);_0x2ac6fd[_0x4f2b('0x20')]=qs[_0x4f2b('0x20')](_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x20')]);}return _0x550e4a[_0x4f2b('0x49')](_0x2ac6fd);}})[_0x4f2b('0x26')](function(_0x5b86ea){if(_0x5b86ea){return _0x5b86ea?{'count':_0x214af0,'rows':_0x5b86ea}:null;}})[_0x4f2b('0x26')](respondWithResult(_0x13aea8,null))[_0x4f2b('0x41')](handleError(_0x13aea8,null));};exports[_0x4f2b('0x4c')]=function(_0x24386e,_0x5e1d9c,_0x535afa){var _0x213229={};var _0x24b36b={};var _0x48d757;var _0x4dff9b;return db[_0x4f2b('0x2d')]['findOne']({'where':{'id':_0x24386e['params']['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x5e1d9c,null))[_0x4f2b('0x26')](function(_0x4e6fd8){if(_0x4e6fd8){_0x48d757=_0x4e6fd8;_0x24b36b[_0x4f2b('0x30')]=_['keys'](db[_0x4f2b('0x4a')][_0x4f2b('0x2e')]);_0x24b36b[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x24386e[_0x4f2b('0x31')]);_0x24b36b[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x24b36b[_0x4f2b('0x30')],_0x24b36b['query']);_0x213229[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x24b36b[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x213229[_0x4f2b('0x34')]=_0x213229[_0x4f2b('0x34')][_0x4f2b('0x36')]?_0x213229[_0x4f2b('0x34')]:_0x24b36b['model'];_0x213229[_0x4f2b('0x39')]=qs['sort'](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x3a')]);_0x213229[_0x4f2b('0x3b')]=qs['filters'](_[_0x4f2b('0x4b')](_0x24386e['query'],_0x24b36b[_0x4f2b('0x32')]));if(_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x3c')]){_0x213229[_0x4f2b('0x3b')]=_[_0x4f2b('0x45')](_0x213229[_0x4f2b('0x3b')],{'$or':_[_0x4f2b('0x2c')](_0x213229['attributes'],function(_0x2ed911){var _0x3f5956={};_0x3f5956[_0x2ed911]={'$like':'%'+_0x24386e['query'][_0x4f2b('0x3c')]+'%'};return _0x3f5956;})});}_0x213229=_[_0x4f2b('0x45')]({},_0x213229,_0x24386e[_0x4f2b('0x3e')]);return _0x48d757[_0x4f2b('0x4c')](_0x213229);}})[_0x4f2b('0x26')](function(_0x170ab6){if(_0x170ab6){_0x4dff9b=_0x170ab6['length'];if(!_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x37')](_0x4f2b('0x38'))){_0x213229['limit']=qs[_0x4f2b('0x1e')](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x1e')]);_0x213229[_0x4f2b('0x20')]=qs[_0x4f2b('0x20')](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x20')]);}return _0x48d757[_0x4f2b('0x4c')](_0x213229);}})[_0x4f2b('0x26')](function(_0x6a59ea){if(_0x6a59ea){return _0x6a59ea?{'count':_0x4dff9b,'rows':_0x6a59ea}:null;}})[_0x4f2b('0x26')](respondWithResult(_0x5e1d9c,null))[_0x4f2b('0x41')](handleError(_0x5e1d9c,null));};exports[_0x4f2b('0x4d')]=function(_0x4206bb,_0x56a59f,_0x3464a0){var _0x1684ca={};var _0x185a04={};var _0x1d8506;var _0x437b44;return db[_0x4f2b('0x2d')][_0x4f2b('0x4e')]({'where':{'id':_0x4206bb[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x56a59f,null))[_0x4f2b('0x26')](function(_0x436c4c){if(_0x436c4c){_0x1d8506=_0x436c4c;_0x185a04[_0x4f2b('0x30')]=_[_0x4f2b('0x44')](db['SugarcrmField'][_0x4f2b('0x2e')]);_0x185a04[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x4206bb[_0x4f2b('0x31')]);_0x185a04[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x185a04[_0x4f2b('0x30')],_0x185a04[_0x4f2b('0x31')]);_0x1684ca[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x185a04[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x4206bb['query'][_0x4f2b('0x35')]));_0x1684ca['attributes']=_0x1684ca[_0x4f2b('0x34')][_0x4f2b('0x36')]?_0x1684ca['attributes']:_0x185a04[_0x4f2b('0x30')];_0x1684ca['order']=qs['sort'](_0x4206bb['query'][_0x4f2b('0x3a')]);_0x1684ca[_0x4f2b('0x3b')]=qs['filters'](_[_0x4f2b('0x4b')](_0x4206bb['query'],_0x185a04[_0x4f2b('0x32')]));if(_0x4206bb[_0x4f2b('0x31')][_0x4f2b('0x3c')]){_0x1684ca['where']=_[_0x4f2b('0x45')](_0x1684ca['where'],{'$or':_[_0x4f2b('0x2c')](_0x1684ca[_0x4f2b('0x34')],function(_0x31ce7e){var _0x3b2b72={};_0x3b2b72[_0x31ce7e]={'$like':'%'+_0x4206bb['query'][_0x4f2b('0x3c')]+'%'};return _0x3b2b72;})});}_0x1684ca=_[_0x4f2b('0x45')]({},_0x1684ca,_0x4206bb[_0x4f2b('0x3e')]);return _0x1d8506[_0x4f2b('0x4d')](_0x1684ca);}})[_0x4f2b('0x26')](function(_0x3638d3){if(_0x3638d3){_0x437b44=_0x3638d3[_0x4f2b('0x36')];if(!_0x4206bb[_0x4f2b('0x31')]['hasOwnProperty'](_0x4f2b('0x38'))){_0x1684ca[_0x4f2b('0x1e')]=qs[_0x4f2b('0x1e')](_0x4206bb[_0x4f2b('0x31')][_0x4f2b('0x1e')]);_0x1684ca['offset']=qs[_0x4f2b('0x20')](_0x4206bb['query'][_0x4f2b('0x20')]);}return _0x1d8506['getDescriptions'](_0x1684ca);}})[_0x4f2b('0x26')](function(_0x17a1e8){if(_0x17a1e8){return _0x17a1e8?{'count':_0x437b44,'rows':_0x17a1e8}:null;}})['then'](respondWithResult(_0x56a59f,null))[_0x4f2b('0x41')](handleError(_0x56a59f,null));}; \ No newline at end of file +var _0x14bc=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','SugarcrmField','getDescriptions','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x8a507a,_0x55b391){var _0xe00cd5=function(_0x500aaf){while(--_0x500aaf){_0x8a507a['push'](_0x8a507a['shift']());}};_0xe00cd5(++_0x55b391);}(_0x14bc,0x1e0));var _0xc14b=function(_0x199644,_0x32e91c){_0x199644=_0x199644-0x0;var _0x167d39=_0x14bc[_0x199644];return _0x167d39;};'use strict';var emlformat=require(_0xc14b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc14b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc14b('0x2'));var BPromise=require(_0xc14b('0x3'));var Mustache=require(_0xc14b('0x4'));var util=require(_0xc14b('0x5'));var path=require(_0xc14b('0x6'));var sox=require(_0xc14b('0x7'));var csv=require(_0xc14b('0x8'));var ejs=require(_0xc14b('0x9'));var fs=require('fs');var fs_extra=require(_0xc14b('0xa'));var _=require('lodash');var squel=require(_0xc14b('0xb'));var crypto=require(_0xc14b('0xc'));var jsforce=require(_0xc14b('0xd'));var deskjs=require(_0xc14b('0xe'));var toCsv=require(_0xc14b('0x8'));var querystring=require(_0xc14b('0xf'));var Papa=require(_0xc14b('0x10'));var Redis=require(_0xc14b('0x11'));var authService=require(_0xc14b('0x12'));var qs=require(_0xc14b('0x13'));var as=require(_0xc14b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc14b('0x15'));var utils=require(_0xc14b('0x16'));var config=require(_0xc14b('0x17'));var licenseUtil=require(_0xc14b('0x18'));var db=require(_0xc14b('0x19'))['db'];function respondWithStatusCode(_0x47209d,_0x4ee497){_0x4ee497=_0x4ee497||0xcc;return function(_0x2e7824){if(_0x2e7824){return _0x47209d[_0xc14b('0x1a')](_0x4ee497);}return _0x47209d[_0xc14b('0x1b')](_0x4ee497)[_0xc14b('0x1c')]();};}function respondWithResult(_0x1849aa,_0x569e2f){_0x569e2f=_0x569e2f||0xc8;return function(_0x26f49f){if(_0x26f49f){return _0x1849aa[_0xc14b('0x1b')](_0x569e2f)['json'](_0x26f49f);}};}function respondWithFilteredResult(_0x4b9913,_0x198a56){return function(_0x478f60){if(_0x478f60){var _0xd349bc=typeof _0x198a56[_0xc14b('0x1d')]===_0xc14b('0x1e')&&typeof _0x198a56[_0xc14b('0x1f')]===_0xc14b('0x1e');var _0x4fa55b=_0x478f60[_0xc14b('0x20')];var _0x38a0a2=_0xd349bc?0x0:_0x198a56[_0xc14b('0x1d')];var _0x3e2f1b=_0xd349bc?_0x478f60[_0xc14b('0x20')]:_0x198a56[_0xc14b('0x1d')]+_0x198a56[_0xc14b('0x1f')];var _0xb31691;if(_0x3e2f1b>=_0x4fa55b){_0x3e2f1b=_0x4fa55b;_0xb31691=0xc8;}else{_0xb31691=0xce;}_0x4b9913[_0xc14b('0x1b')](_0xb31691);return _0x4b9913[_0xc14b('0x21')](_0xc14b('0x22'),_0x38a0a2+'-'+_0x3e2f1b+'/'+_0x4fa55b)[_0xc14b('0x23')](_0x478f60);}return null;};}function patchUpdates(_0x163e24){return function(_0x4cadee){try{jsonpatch[_0xc14b('0x24')](_0x4cadee,_0x163e24,!![]);}catch(_0x736dc4){return BPromise[_0xc14b('0x25')](_0x736dc4);}return _0x4cadee['save']();};}function saveUpdates(_0x184aeb,_0x5087fd){return function(_0x518cb7){if(_0x518cb7){return _0x518cb7[_0xc14b('0x26')](_0x184aeb)[_0xc14b('0x27')](function(_0x222b59){return _0x222b59;});}return null;};}function removeEntity(_0x35308a,_0x539bf6){return function(_0x2a2e99){if(_0x2a2e99){return _0x2a2e99[_0xc14b('0x28')]()[_0xc14b('0x27')](function(){_0x35308a[_0xc14b('0x1b')](0xcc)[_0xc14b('0x1c')]();});}};}function handleEntityNotFound(_0x1d21e8,_0x437761){return function(_0x3a6689){if(!_0x3a6689){_0x1d21e8['sendStatus'](0x194);}return _0x3a6689;};}function handleError(_0x5d5cff,_0x1734b9){_0x1734b9=_0x1734b9||0x1f4;return function(_0x387754){logger[_0xc14b('0x29')](_0x387754[_0xc14b('0x2a')]);if(_0x387754[_0xc14b('0x2b')]){delete _0x387754['name'];}_0x5d5cff[_0xc14b('0x1b')](_0x1734b9)['send'](_0x387754);};}exports[_0xc14b('0x2c')]=function(_0x32699e,_0x4bc666){var _0x5c3fa7={},_0x36235d={},_0x4da9e0={'count':0x0,'rows':[]};var _0x519371=_[_0xc14b('0x2d')](db[_0xc14b('0x2e')]['rawAttributes'],function(_0x2e1f24){return{'name':_0x2e1f24[_0xc14b('0x2f')],'type':_0x2e1f24[_0xc14b('0x30')][_0xc14b('0x31')]};});_0x36235d[_0xc14b('0x32')]=_[_0xc14b('0x2d')](_0x519371,_0xc14b('0x2b'));_0x36235d[_0xc14b('0x33')]=_[_0xc14b('0x34')](_0x32699e[_0xc14b('0x33')]);_0x36235d[_0xc14b('0x35')]=_[_0xc14b('0x36')](_0x36235d[_0xc14b('0x32')],_0x36235d[_0xc14b('0x33')]);_0x5c3fa7['attributes']=_[_0xc14b('0x36')](_0x36235d[_0xc14b('0x32')],qs[_0xc14b('0x37')](_0x32699e[_0xc14b('0x33')][_0xc14b('0x37')]));_0x5c3fa7['attributes']=_0x5c3fa7[_0xc14b('0x38')][_0xc14b('0x39')]?_0x5c3fa7[_0xc14b('0x38')]:_0x36235d[_0xc14b('0x32')];if(!_0x32699e[_0xc14b('0x33')][_0xc14b('0x3a')](_0xc14b('0x3b'))){_0x5c3fa7[_0xc14b('0x1f')]=qs[_0xc14b('0x1f')](_0x32699e[_0xc14b('0x33')][_0xc14b('0x1f')]);_0x5c3fa7['offset']=qs[_0xc14b('0x1d')](_0x32699e[_0xc14b('0x33')][_0xc14b('0x1d')]);}_0x5c3fa7[_0xc14b('0x3c')]=qs[_0xc14b('0x3d')](_0x32699e[_0xc14b('0x33')][_0xc14b('0x3d')]);_0x5c3fa7['where']=qs[_0xc14b('0x35')](_[_0xc14b('0x3e')](_0x32699e[_0xc14b('0x33')],_0x36235d[_0xc14b('0x35')]),_0x519371);if(_0x32699e[_0xc14b('0x33')][_0xc14b('0x3f')]){_0x5c3fa7[_0xc14b('0x40')]=_[_0xc14b('0x41')](_0x5c3fa7[_0xc14b('0x40')],{'$or':_[_0xc14b('0x2d')](_0x519371,function(_0x45decd){if(_0x45decd[_0xc14b('0x30')]!==_0xc14b('0x42')){var _0x518ce0={};_0x518ce0[_0x45decd['name']]={'$like':'%'+_0x32699e[_0xc14b('0x33')][_0xc14b('0x3f')]+'%'};return _0x518ce0;}})});}_0x5c3fa7=_[_0xc14b('0x41')]({},_0x5c3fa7,_0x32699e[_0xc14b('0x43')]);var _0x18da24={'where':_0x5c3fa7[_0xc14b('0x40')]};return db[_0xc14b('0x2e')][_0xc14b('0x20')](_0x18da24)[_0xc14b('0x27')](function(_0x521ac8){_0x4da9e0[_0xc14b('0x20')]=_0x521ac8;if(_0x32699e[_0xc14b('0x33')][_0xc14b('0x44')]){_0x5c3fa7[_0xc14b('0x45')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xc14b('0x46')](_0x5c3fa7);})['then'](function(_0x1f1db2){_0x4da9e0[_0xc14b('0x47')]=_0x1f1db2;return _0x4da9e0;})[_0xc14b('0x27')](respondWithFilteredResult(_0x4bc666,_0x5c3fa7))[_0xc14b('0x48')](handleError(_0x4bc666,null));};exports[_0xc14b('0x49')]=function(_0x2562e7,_0x2941e6){var _0x5025e1={'raw':![],'where':{'id':_0x2562e7[_0xc14b('0x4a')]['id']}},_0x3f66a0={};_0x3f66a0[_0xc14b('0x32')]=_[_0xc14b('0x34')](db[_0xc14b('0x2e')][_0xc14b('0x4b')]);_0x3f66a0[_0xc14b('0x33')]=_[_0xc14b('0x34')](_0x2562e7['query']);_0x3f66a0[_0xc14b('0x35')]=_['intersection'](_0x3f66a0[_0xc14b('0x32')],_0x3f66a0[_0xc14b('0x33')]);_0x5025e1[_0xc14b('0x38')]=_[_0xc14b('0x36')](_0x3f66a0['model'],qs[_0xc14b('0x37')](_0x2562e7[_0xc14b('0x33')][_0xc14b('0x37')]));_0x5025e1[_0xc14b('0x38')]=_0x5025e1[_0xc14b('0x38')][_0xc14b('0x39')]?_0x5025e1[_0xc14b('0x38')]:_0x3f66a0[_0xc14b('0x32')];if(_0x2562e7[_0xc14b('0x33')]['includeAll']){_0x5025e1[_0xc14b('0x45')]=[{'all':!![]}];}_0x5025e1=_['merge']({},_0x5025e1,_0x2562e7[_0xc14b('0x43')]);return db['SugarcrmConfiguration'][_0xc14b('0x4c')](_0x5025e1)[_0xc14b('0x27')](handleEntityNotFound(_0x2941e6,null))[_0xc14b('0x27')](respondWithResult(_0x2941e6,null))[_0xc14b('0x48')](handleError(_0x2941e6,null));};exports[_0xc14b('0x4d')]=function(_0x5b7192,_0x29e430){return db[_0xc14b('0x2e')][_0xc14b('0x4d')](_0x5b7192[_0xc14b('0x4e')],{})[_0xc14b('0x27')](respondWithResult(_0x29e430,0xc9))['catch'](handleError(_0x29e430,null));};exports['update']=function(_0x1be7fc,_0x1d5a60){if(_0x1be7fc[_0xc14b('0x4e')]['id']){delete _0x1be7fc['body']['id'];}return db[_0xc14b('0x2e')]['find']({'where':{'id':_0x1be7fc[_0xc14b('0x4a')]['id']}})[_0xc14b('0x27')](handleEntityNotFound(_0x1d5a60,null))[_0xc14b('0x27')](saveUpdates(_0x1be7fc[_0xc14b('0x4e')],null))[_0xc14b('0x27')](respondWithResult(_0x1d5a60,null))[_0xc14b('0x48')](handleError(_0x1d5a60,null));};exports[_0xc14b('0x28')]=function(_0x13a3d5,_0x4d91b2){return db[_0xc14b('0x2e')][_0xc14b('0x4c')]({'where':{'id':_0x13a3d5[_0xc14b('0x4a')]['id']}})[_0xc14b('0x27')](handleEntityNotFound(_0x4d91b2,null))[_0xc14b('0x27')](removeEntity(_0x4d91b2,null))[_0xc14b('0x48')](handleError(_0x4d91b2,null));};exports[_0xc14b('0x4f')]=function(_0x153185,_0x185e0f,_0x194839){var _0x247eaf={};var _0x34c8b1={};var _0x46acd5;var _0x2ba56e;return db[_0xc14b('0x2e')][_0xc14b('0x50')]({'where':{'id':_0x153185['params']['id']}})[_0xc14b('0x27')](handleEntityNotFound(_0x185e0f,null))['then'](function(_0x490604){if(_0x490604){_0x46acd5=_0x490604;_0x34c8b1[_0xc14b('0x32')]=_[_0xc14b('0x34')](db[_0xc14b('0x51')]['rawAttributes']);_0x34c8b1[_0xc14b('0x33')]=_[_0xc14b('0x34')](_0x153185[_0xc14b('0x33')]);_0x34c8b1[_0xc14b('0x35')]=_[_0xc14b('0x36')](_0x34c8b1[_0xc14b('0x32')],_0x34c8b1['query']);_0x247eaf[_0xc14b('0x38')]=_[_0xc14b('0x36')](_0x34c8b1['model'],qs['fields'](_0x153185[_0xc14b('0x33')]['fields']));_0x247eaf[_0xc14b('0x38')]=_0x247eaf[_0xc14b('0x38')]['length']?_0x247eaf[_0xc14b('0x38')]:_0x34c8b1['model'];_0x247eaf[_0xc14b('0x3c')]=qs['sort'](_0x153185['query'][_0xc14b('0x3d')]);_0x247eaf[_0xc14b('0x40')]=qs[_0xc14b('0x35')](_[_0xc14b('0x3e')](_0x153185['query'],_0x34c8b1[_0xc14b('0x35')]));if(_0x153185['query'][_0xc14b('0x3f')]){_0x247eaf[_0xc14b('0x40')]=_[_0xc14b('0x41')](_0x247eaf[_0xc14b('0x40')],{'$or':_['map'](_0x247eaf[_0xc14b('0x38')],function(_0x42d8d0){var _0x379a5b={};_0x379a5b[_0x42d8d0]={'$like':'%'+_0x153185[_0xc14b('0x33')][_0xc14b('0x3f')]+'%'};return _0x379a5b;})});}_0x247eaf=_['merge']({},_0x247eaf,_0x153185['options']);return _0x46acd5['getFields'](_0x247eaf);}})[_0xc14b('0x27')](function(_0x216f7d){if(_0x216f7d){_0x2ba56e=_0x216f7d[_0xc14b('0x39')];if(!_0x153185[_0xc14b('0x33')][_0xc14b('0x3a')](_0xc14b('0x3b'))){_0x247eaf[_0xc14b('0x1f')]=qs['limit'](_0x153185[_0xc14b('0x33')][_0xc14b('0x1f')]);_0x247eaf[_0xc14b('0x1d')]=qs[_0xc14b('0x1d')](_0x153185['query'][_0xc14b('0x1d')]);}return _0x46acd5[_0xc14b('0x4f')](_0x247eaf);}})[_0xc14b('0x27')](function(_0x4cf033){if(_0x4cf033){return _0x4cf033?{'count':_0x2ba56e,'rows':_0x4cf033}:null;}})[_0xc14b('0x27')](respondWithResult(_0x185e0f,null))[_0xc14b('0x48')](handleError(_0x185e0f,null));};exports['getSubjects']=function(_0x3e595f,_0x2881d8,_0xff8482){var _0x51d48c={};var _0x118aa2={};var _0x5544b2;var _0x5d16bc;return db['SugarcrmConfiguration'][_0xc14b('0x50')]({'where':{'id':_0x3e595f[_0xc14b('0x4a')]['id']}})[_0xc14b('0x27')](handleEntityNotFound(_0x2881d8,null))['then'](function(_0x1e87eb){if(_0x1e87eb){_0x5544b2=_0x1e87eb;_0x118aa2['model']=_[_0xc14b('0x34')](db[_0xc14b('0x51')][_0xc14b('0x4b')]);_0x118aa2[_0xc14b('0x33')]=_['keys'](_0x3e595f['query']);_0x118aa2[_0xc14b('0x35')]=_[_0xc14b('0x36')](_0x118aa2[_0xc14b('0x32')],_0x118aa2[_0xc14b('0x33')]);_0x51d48c['attributes']=_[_0xc14b('0x36')](_0x118aa2[_0xc14b('0x32')],qs[_0xc14b('0x37')](_0x3e595f[_0xc14b('0x33')][_0xc14b('0x37')]));_0x51d48c[_0xc14b('0x38')]=_0x51d48c[_0xc14b('0x38')][_0xc14b('0x39')]?_0x51d48c['attributes']:_0x118aa2[_0xc14b('0x32')];_0x51d48c[_0xc14b('0x3c')]=qs[_0xc14b('0x3d')](_0x3e595f[_0xc14b('0x33')][_0xc14b('0x3d')]);_0x51d48c[_0xc14b('0x40')]=qs['filters'](_[_0xc14b('0x3e')](_0x3e595f['query'],_0x118aa2[_0xc14b('0x35')]));if(_0x3e595f['query'][_0xc14b('0x3f')]){_0x51d48c['where']=_[_0xc14b('0x41')](_0x51d48c[_0xc14b('0x40')],{'$or':_[_0xc14b('0x2d')](_0x51d48c[_0xc14b('0x38')],function(_0x57888e){var _0x4f2637={};_0x4f2637[_0x57888e]={'$like':'%'+_0x3e595f[_0xc14b('0x33')]['filter']+'%'};return _0x4f2637;})});}_0x51d48c=_[_0xc14b('0x41')]({},_0x51d48c,_0x3e595f[_0xc14b('0x43')]);return _0x5544b2['getSubjects'](_0x51d48c);}})[_0xc14b('0x27')](function(_0x150005){if(_0x150005){_0x5d16bc=_0x150005['length'];if(!_0x3e595f[_0xc14b('0x33')]['hasOwnProperty']('nolimit')){_0x51d48c[_0xc14b('0x1f')]=qs['limit'](_0x3e595f[_0xc14b('0x33')]['limit']);_0x51d48c['offset']=qs[_0xc14b('0x1d')](_0x3e595f[_0xc14b('0x33')][_0xc14b('0x1d')]);}return _0x5544b2['getSubjects'](_0x51d48c);}})[_0xc14b('0x27')](function(_0x2d4ae8){if(_0x2d4ae8){return _0x2d4ae8?{'count':_0x5d16bc,'rows':_0x2d4ae8}:null;}})[_0xc14b('0x27')](respondWithResult(_0x2881d8,null))[_0xc14b('0x48')](handleError(_0x2881d8,null));};exports[_0xc14b('0x52')]=function(_0x2de9c9,_0x55dec7,_0x170467){var _0x204ef5={};var _0x3ec122={};var _0x1081ad;var _0x222a15;return db[_0xc14b('0x2e')][_0xc14b('0x50')]({'where':{'id':_0x2de9c9[_0xc14b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x55dec7,null))[_0xc14b('0x27')](function(_0x55cc41){if(_0x55cc41){_0x1081ad=_0x55cc41;_0x3ec122[_0xc14b('0x32')]=_[_0xc14b('0x34')](db[_0xc14b('0x51')][_0xc14b('0x4b')]);_0x3ec122[_0xc14b('0x33')]=_[_0xc14b('0x34')](_0x2de9c9[_0xc14b('0x33')]);_0x3ec122[_0xc14b('0x35')]=_['intersection'](_0x3ec122['model'],_0x3ec122['query']);_0x204ef5[_0xc14b('0x38')]=_[_0xc14b('0x36')](_0x3ec122[_0xc14b('0x32')],qs[_0xc14b('0x37')](_0x2de9c9['query'][_0xc14b('0x37')]));_0x204ef5[_0xc14b('0x38')]=_0x204ef5[_0xc14b('0x38')]['length']?_0x204ef5['attributes']:_0x3ec122[_0xc14b('0x32')];_0x204ef5['order']=qs[_0xc14b('0x3d')](_0x2de9c9[_0xc14b('0x33')][_0xc14b('0x3d')]);_0x204ef5[_0xc14b('0x40')]=qs['filters'](_[_0xc14b('0x3e')](_0x2de9c9[_0xc14b('0x33')],_0x3ec122['filters']));if(_0x2de9c9[_0xc14b('0x33')][_0xc14b('0x3f')]){_0x204ef5[_0xc14b('0x40')]=_['merge'](_0x204ef5['where'],{'$or':_['map'](_0x204ef5[_0xc14b('0x38')],function(_0x392bf4){var _0x260e6c={};_0x260e6c[_0x392bf4]={'$like':'%'+_0x2de9c9['query'][_0xc14b('0x3f')]+'%'};return _0x260e6c;})});}_0x204ef5=_[_0xc14b('0x41')]({},_0x204ef5,_0x2de9c9['options']);return _0x1081ad[_0xc14b('0x52')](_0x204ef5);}})[_0xc14b('0x27')](function(_0x29b998){if(_0x29b998){_0x222a15=_0x29b998[_0xc14b('0x39')];if(!_0x2de9c9[_0xc14b('0x33')][_0xc14b('0x3a')](_0xc14b('0x3b'))){_0x204ef5[_0xc14b('0x1f')]=qs[_0xc14b('0x1f')](_0x2de9c9[_0xc14b('0x33')][_0xc14b('0x1f')]);_0x204ef5[_0xc14b('0x1d')]=qs[_0xc14b('0x1d')](_0x2de9c9['query']['offset']);}return _0x1081ad[_0xc14b('0x52')](_0x204ef5);}})['then'](function(_0x4ab308){if(_0x4ab308){return _0x4ab308?{'count':_0x222a15,'rows':_0x4ab308}:null;}})['then'](respondWithResult(_0x55dec7,null))[_0xc14b('0x48')](handleError(_0x55dec7,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 23a1d14..30e8ebe 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 _0x4ff4=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x4ff4,0x13b));var _0x44ff=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x4ff4[_0x2bbc07];return _0x6879e4;};'use strict';var _=require(_0x44ff('0x0'));var util=require(_0x44ff('0x1'));var logger=require(_0x44ff('0x2'))(_0x44ff('0x3'));var moment=require(_0x44ff('0x4'));var BPromise=require('bluebird');var rp=require(_0x44ff('0x5'));var fs=require('fs');var path=require(_0x44ff('0x6'));var rimraf=require('rimraf');var config=require(_0x44ff('0x7'));var attributes=require(_0x44ff('0x8'));module[_0x44ff('0x9')]=function(_0x33975b,_0x5cd962){return _0x33975b[_0x44ff('0xa')](_0x44ff('0xb'),attributes,{'tableName':_0x44ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99b1=['api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x2ec546,_0x33ce0a){var _0x226d5d=function(_0x47bea5){while(--_0x47bea5){_0x2ec546['push'](_0x2ec546['shift']());}};_0x226d5d(++_0x33ce0a);}(_0x99b1,0x1bd));var _0x199b=function(_0x730cca,_0x4f1b33){_0x730cca=_0x730cca-0x0;var _0x5cc535=_0x99b1[_0x730cca];return _0x5cc535;};'use strict';var _=require(_0x199b('0x0'));var util=require(_0x199b('0x1'));var logger=require(_0x199b('0x2'))(_0x199b('0x3'));var moment=require(_0x199b('0x4'));var BPromise=require('bluebird');var rp=require(_0x199b('0x5'));var fs=require('fs');var path=require(_0x199b('0x6'));var rimraf=require(_0x199b('0x7'));var config=require(_0x199b('0x8'));var attributes=require(_0x199b('0x9'));module[_0x199b('0xa')]=function(_0x39f546,_0x19782d){return _0x39f546[_0x199b('0xb')](_0x199b('0xc'),attributes,{'tableName':_0x199b('0xd'),'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 f5ab9f7..4bd26e0 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 _0x69de=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x69de,0x1f4));var _0xe69d=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x69de[_0x1cfe2e];return _0x39233f;};'use strict';var _=require(_0xe69d('0x0'));var util=require(_0xe69d('0x1'));var moment=require(_0xe69d('0x2'));var BPromise=require(_0xe69d('0x3'));var rs=require(_0xe69d('0x4'));var fs=require('fs');var Redis=require(_0xe69d('0x5'));var db=require(_0xe69d('0x6'))['db'];var utils=require(_0xe69d('0x7'));var logger=require(_0xe69d('0x8'))(_0xe69d('0x9'));var config=require(_0xe69d('0xa'));var jayson=require(_0xe69d('0xb'));var client=jayson[_0xe69d('0xc')][_0xe69d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x14309a,_0x4e89fe,_0x56fcd7){return new BPromise(function(_0x4f7d88,_0x507f49){return client['request'](_0x14309a,_0x56fcd7)[_0xe69d('0xe')](function(_0x224627){logger[_0xe69d('0xf')](_0xe69d('0x10'),_0x4e89fe,_0xe69d('0x11'));logger[_0xe69d('0x12')](_0xe69d('0x13'),_0x4e89fe,_0xe69d('0x11'),JSON[_0xe69d('0x14')](_0x224627));if(_0x224627[_0xe69d('0x15')]){if(_0x224627[_0xe69d('0x15')]['code']===0x1f4){logger[_0xe69d('0x15')](_0xe69d('0x10'),_0x4e89fe,_0x224627['error']['message']);return _0x507f49(_0x224627[_0xe69d('0x15')][_0xe69d('0x16')]);}logger[_0xe69d('0x15')](_0xe69d('0x10'),_0x4e89fe,_0x224627[_0xe69d('0x15')][_0xe69d('0x16')]);return _0x4f7d88(_0x224627['error'][_0xe69d('0x16')]);}else{logger[_0xe69d('0xf')](_0xe69d('0x10'),_0x4e89fe,_0xe69d('0x11'));_0x4f7d88(_0x224627['result']['message']);}})[_0xe69d('0x17')](function(_0x1410b6){logger['error'](_0xe69d('0x10'),_0x4e89fe,_0x1410b6);_0x507f49(_0x1410b6);});});} \ No newline at end of file +var _0x82ed=['then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request'];(function(_0x2b3632,_0x5aa6b1){var _0x110d6c=function(_0x211fe8){while(--_0x211fe8){_0x2b3632['push'](_0x2b3632['shift']());}};_0x110d6c(++_0x5aa6b1);}(_0x82ed,0x17c));var _0xd82e=function(_0x1c73b1,_0x5c6f36){_0x1c73b1=_0x1c73b1-0x0;var _0x4b9c7c=_0x82ed[_0x1c73b1];return _0x4b9c7c;};'use strict';var _=require(_0xd82e('0x0'));var util=require(_0xd82e('0x1'));var moment=require(_0xd82e('0x2'));var BPromise=require(_0xd82e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd82e('0x4'));var db=require(_0xd82e('0x5'))['db'];var utils=require(_0xd82e('0x6'));var logger=require(_0xd82e('0x7'))(_0xd82e('0x8'));var config=require(_0xd82e('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x160520,_0x287f89,_0xa1e280){return new BPromise(function(_0x23c63c,_0x4beae5){return client[_0xd82e('0xa')](_0x160520,_0xa1e280)[_0xd82e('0xb')](function(_0xce4465){logger['info'](_0xd82e('0xc'),_0x287f89,_0xd82e('0xd'));logger[_0xd82e('0xe')](_0xd82e('0xf'),_0x287f89,'request\x20sent',JSON[_0xd82e('0x10')](_0xce4465));if(_0xce4465[_0xd82e('0x11')]){if(_0xce4465[_0xd82e('0x11')][_0xd82e('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x287f89,_0xce4465[_0xd82e('0x11')][_0xd82e('0x13')]);return _0x4beae5(_0xce4465['error'][_0xd82e('0x13')]);}logger[_0xd82e('0x11')](_0xd82e('0xc'),_0x287f89,_0xce4465[_0xd82e('0x11')]['message']);return _0x23c63c(_0xce4465[_0xd82e('0x11')][_0xd82e('0x13')]);}else{logger[_0xd82e('0x14')](_0xd82e('0xc'),_0x287f89,_0xd82e('0xd'));_0x23c63c(_0xce4465[_0xd82e('0x15')]['message']);}})[_0xd82e('0x16')](function(_0x1b714d){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x287f89,_0x1b714d);_0x4beae5(_0x1b714d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index cb113d6..6b5e2e2 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 _0x2af5=['index','get','/:id','post','create','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated'];(function(_0x6fa59b,_0x3e0ca5){var _0x269256=function(_0x1d1534){while(--_0x1d1534){_0x6fa59b['push'](_0x6fa59b['shift']());}};_0x269256(++_0x3e0ca5);}(_0x2af5,0x17e));var _0x52af=function(_0x4b74d3,_0x607c2c){_0x4b74d3=_0x4b74d3-0x0;var _0x3b38bb=_0x2af5[_0x4b74d3];return _0x3b38bb;};'use strict';var multer=require(_0x52af('0x0'));var util=require(_0x52af('0x1'));var path=require('path');var timeout=require(_0x52af('0x2'));var express=require(_0x52af('0x3'));var router=express['Router']();var fs_extra=require(_0x52af('0x4'));var auth=require(_0x52af('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x52af('0x6'));var controller=require(_0x52af('0x7'));router['get']('/',auth[_0x52af('0x8')](),controller[_0x52af('0x9')]);router[_0x52af('0xa')](_0x52af('0xb'),auth[_0x52af('0x8')](),controller['show']);router[_0x52af('0xc')]('/',auth[_0x52af('0x8')](),controller[_0x52af('0xd')]);router['put'](_0x52af('0xb'),auth[_0x52af('0x8')](),controller[_0x52af('0xe')]);router['delete'](_0x52af('0xb'),auth[_0x52af('0x8')](),controller[_0x52af('0xf')]);module[_0x52af('0x10')]=router; \ No newline at end of file +var _0xd597=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports'];(function(_0x598b37,_0x39e238){var _0x344326=function(_0xf02d63){while(--_0xf02d63){_0x598b37['push'](_0x598b37['shift']());}};_0x344326(++_0x39e238);}(_0xd597,0x190));var _0x7d59=function(_0x282302,_0x4912ae){_0x282302=_0x282302-0x0;var _0x5d61ae=_0xd597[_0x282302];return _0x5d61ae;};'use strict';var multer=require(_0x7d59('0x0'));var util=require(_0x7d59('0x1'));var path=require(_0x7d59('0x2'));var timeout=require('connect-timeout');var express=require(_0x7d59('0x3'));var router=express[_0x7d59('0x4')]();var fs_extra=require(_0x7d59('0x5'));var auth=require(_0x7d59('0x6'));var interaction=require(_0x7d59('0x7'));var config=require(_0x7d59('0x8'));var controller=require(_0x7d59('0x9'));router[_0x7d59('0xa')]('/',auth[_0x7d59('0xb')](),controller[_0x7d59('0xc')]);router[_0x7d59('0xa')](_0x7d59('0xd'),auth[_0x7d59('0xb')](),controller[_0x7d59('0xe')]);router[_0x7d59('0xf')]('/',auth[_0x7d59('0xb')](),controller[_0x7d59('0x10')]);router[_0x7d59('0x11')](_0x7d59('0xd'),auth[_0x7d59('0xb')](),controller['update']);router['delete'](_0x7d59('0xd'),auth['isAuthenticated'](),controller[_0x7d59('0x12')]);module[_0x7d59('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 00706d1..8dea878 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 _0xd9d5=['ENUM','customVariable','BOOLEAN','exports','string','variable','picklist','STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xd9d5,0xeb));var _0x5d9d=function(_0x524b71,_0xae0ecc){_0x524b71=_0x524b71-0x0;var _0x38413f=_0xd9d5[_0x524b71];return _0x38413f;};'use strict';var Sequelize=require('sequelize');module[_0x5d9d('0x0')]={'type':{'type':Sequelize['ENUM'](_0x5d9d('0x1'),_0x5d9d('0x2'),'customVariable','keyValue',_0x5d9d('0x3')),'defaultValue':_0x5d9d('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5d9d('0x4')]},'keyType':{'type':Sequelize[_0x5d9d('0x5')]('string',_0x5d9d('0x2'),_0x5d9d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5d9d('0x4')]},'customField':{'type':Sequelize[_0x5d9d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5d9d('0x4')]}}; \ No newline at end of file +var _0x8894=['keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize','ENUM','customVariable'];(function(_0x13d765,_0x41b11f){var _0x2d237f=function(_0x3f57b6){while(--_0x3f57b6){_0x13d765['push'](_0x13d765['shift']());}};_0x2d237f(++_0x41b11f);}(_0x8894,0xf0));var _0x4889=function(_0x41046c,_0x4a7742){_0x41046c=_0x41046c-0x0;var _0x2ddd3f=_0x8894[_0x41046c];return _0x2ddd3f;};'use strict';var Sequelize=require(_0x4889('0x0'));module['exports']={'type':{'type':Sequelize[_0x4889('0x1')]('string','variable',_0x4889('0x2'),_0x4889('0x3'),_0x4889('0x4')),'defaultValue':_0x4889('0x5')},'content':{'type':Sequelize[_0x4889('0x6')]},'key':{'type':Sequelize[_0x4889('0x6')]},'keyType':{'type':Sequelize[_0x4889('0x1')](_0x4889('0x5'),_0x4889('0x7'),_0x4889('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4889('0x6')]},'nameField':{'type':Sequelize[_0x4889('0x6')]},'customField':{'type':Sequelize[_0x4889('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4889('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 99b45a4..25ee488 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 _0xa6e3=['../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','include','options','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa6e3,0x111));var _0x3a6e=function(_0x533b5f,_0x238373){_0x533b5f=_0x533b5f-0x0;var _0x4b40a3=_0xa6e3[_0x533b5f];return _0x4b40a3;};'use strict';var emlformat=require(_0x3a6e('0x0'));var rimraf=require(_0x3a6e('0x1'));var zipdir=require(_0x3a6e('0x2'));var jsonpatch=require(_0x3a6e('0x3'));var rp=require('request-promise');var moment=require(_0x3a6e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3a6e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3a6e('0x6'));var csv=require('to-csv');var ejs=require(_0x3a6e('0x7'));var fs=require('fs');var fs_extra=require(_0x3a6e('0x8'));var _=require(_0x3a6e('0x9'));var squel=require(_0x3a6e('0xa'));var crypto=require(_0x3a6e('0xb'));var jsforce=require(_0x3a6e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3a6e('0xd'));var querystring=require(_0x3a6e('0xe'));var Papa=require(_0x3a6e('0xf'));var Redis=require(_0x3a6e('0x10'));var authService=require(_0x3a6e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3a6e('0x12'));var hardwareService=require(_0x3a6e('0x13'));var logger=require(_0x3a6e('0x14'))(_0x3a6e('0x15'));var utils=require('../../config/utils');var config=require(_0x3a6e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71c00d,_0x13e374){_0x13e374=_0x13e374||0xcc;return function(_0x55b84a){if(_0x55b84a){return _0x71c00d[_0x3a6e('0x17')](_0x13e374);}return _0x71c00d['status'](_0x13e374)[_0x3a6e('0x18')]();};}function respondWithResult(_0x47a0c1,_0x59ab6d){_0x59ab6d=_0x59ab6d||0xc8;return function(_0x91ea65){if(_0x91ea65){return _0x47a0c1[_0x3a6e('0x19')](_0x59ab6d)['json'](_0x91ea65);}};}function respondWithFilteredResult(_0x4d77ce,_0x7ec5f1){return function(_0x536ae2){if(_0x536ae2){var _0xec1bc4=typeof _0x7ec5f1['offset']===_0x3a6e('0x1a')&&typeof _0x7ec5f1['limit']==='undefined';var _0x3fe7dc=_0x536ae2[_0x3a6e('0x1b')];var _0x22df93=_0xec1bc4?0x0:_0x7ec5f1[_0x3a6e('0x1c')];var _0x17b39f=_0xec1bc4?_0x536ae2['count']:_0x7ec5f1[_0x3a6e('0x1c')]+_0x7ec5f1[_0x3a6e('0x1d')];var _0x258a71;if(_0x17b39f>=_0x3fe7dc){_0x17b39f=_0x3fe7dc;_0x258a71=0xc8;}else{_0x258a71=0xce;}_0x4d77ce['status'](_0x258a71);return _0x4d77ce['set'](_0x3a6e('0x1e'),_0x22df93+'-'+_0x17b39f+'/'+_0x3fe7dc)[_0x3a6e('0x1f')](_0x536ae2);}return null;};}function patchUpdates(_0x40b608){return function(_0x27f2d9){try{jsonpatch[_0x3a6e('0x20')](_0x27f2d9,_0x40b608,!![]);}catch(_0x3e70d5){return BPromise[_0x3a6e('0x21')](_0x3e70d5);}return _0x27f2d9[_0x3a6e('0x22')]();};}function saveUpdates(_0x14f55b,_0x195191){return function(_0xdfe71a){if(_0xdfe71a){return _0xdfe71a['update'](_0x14f55b)[_0x3a6e('0x23')](function(_0x3e264a){return _0x3e264a;});}return null;};}function removeEntity(_0x2af145,_0x177c66){return function(_0x29721e){if(_0x29721e){return _0x29721e[_0x3a6e('0x24')]()[_0x3a6e('0x23')](function(){_0x2af145[_0x3a6e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x299700,_0x2282cd){return function(_0x1a0bb7){if(!_0x1a0bb7){_0x299700[_0x3a6e('0x17')](0x194);}return _0x1a0bb7;};}function handleError(_0x48bfee,_0x16b19c){_0x16b19c=_0x16b19c||0x1f4;return function(_0x196e36){logger[_0x3a6e('0x25')](_0x196e36[_0x3a6e('0x26')]);if(_0x196e36[_0x3a6e('0x27')]){delete _0x196e36[_0x3a6e('0x27')];}_0x48bfee[_0x3a6e('0x19')](_0x16b19c)[_0x3a6e('0x28')](_0x196e36);};}exports['index']=function(_0x531068,_0x4ce658){var _0x5bb701={},_0x5be06={},_0x15d171={'count':0x0,'rows':[]};var _0x5074f1=_[_0x3a6e('0x29')](db[_0x3a6e('0x2a')][_0x3a6e('0x2b')],function(_0x4a0e61){return{'name':_0x4a0e61[_0x3a6e('0x2c')],'type':_0x4a0e61[_0x3a6e('0x2d')][_0x3a6e('0x2e')]};});_0x5be06[_0x3a6e('0x2f')]=_[_0x3a6e('0x29')](_0x5074f1,_0x3a6e('0x27'));_0x5be06[_0x3a6e('0x30')]=_[_0x3a6e('0x31')](_0x531068['query']);_0x5be06[_0x3a6e('0x32')]=_['intersection'](_0x5be06[_0x3a6e('0x2f')],_0x5be06[_0x3a6e('0x30')]);_0x5bb701['attributes']=_[_0x3a6e('0x33')](_0x5be06[_0x3a6e('0x2f')],qs['fields'](_0x531068['query'][_0x3a6e('0x34')]));_0x5bb701[_0x3a6e('0x35')]=_0x5bb701[_0x3a6e('0x35')]['length']?_0x5bb701[_0x3a6e('0x35')]:_0x5be06[_0x3a6e('0x2f')];if(!_0x531068[_0x3a6e('0x30')][_0x3a6e('0x36')](_0x3a6e('0x37'))){_0x5bb701[_0x3a6e('0x1d')]=qs[_0x3a6e('0x1d')](_0x531068['query']['limit']);_0x5bb701[_0x3a6e('0x1c')]=qs['offset'](_0x531068['query'][_0x3a6e('0x1c')]);}_0x5bb701['order']=qs[_0x3a6e('0x38')](_0x531068[_0x3a6e('0x30')][_0x3a6e('0x38')]);_0x5bb701['where']=qs[_0x3a6e('0x32')](_[_0x3a6e('0x39')](_0x531068[_0x3a6e('0x30')],_0x5be06[_0x3a6e('0x32')]),_0x5074f1);if(_0x531068[_0x3a6e('0x30')][_0x3a6e('0x3a')]){_0x5bb701[_0x3a6e('0x3b')]=_[_0x3a6e('0x3c')](_0x5bb701[_0x3a6e('0x3b')],{'$or':_[_0x3a6e('0x29')](_0x5074f1,function(_0x2f7359){if(_0x2f7359[_0x3a6e('0x2d')]!==_0x3a6e('0x3d')){var _0x4802e1={};_0x4802e1[_0x2f7359[_0x3a6e('0x27')]]={'$like':'%'+_0x531068[_0x3a6e('0x30')]['filter']+'%'};return _0x4802e1;}})});}_0x5bb701=_[_0x3a6e('0x3c')]({},_0x5bb701,_0x531068['options']);var _0x3e682b={'where':_0x5bb701['where']};return db[_0x3a6e('0x2a')][_0x3a6e('0x1b')](_0x3e682b)['then'](function(_0x264403){_0x15d171['count']=_0x264403;if(_0x531068['query'][_0x3a6e('0x3e')]){_0x5bb701['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x5bb701);})[_0x3a6e('0x23')](function(_0x1e2a5){_0x15d171[_0x3a6e('0x3f')]=_0x1e2a5;return _0x15d171;})[_0x3a6e('0x23')](respondWithFilteredResult(_0x4ce658,_0x5bb701))[_0x3a6e('0x40')](handleError(_0x4ce658,null));};exports[_0x3a6e('0x41')]=function(_0x328c57,_0x12e4f2){var _0x570dee={'raw':!![],'where':{'id':_0x328c57['params']['id']}},_0xa8b543={};_0xa8b543[_0x3a6e('0x2f')]=_[_0x3a6e('0x31')](db[_0x3a6e('0x2a')][_0x3a6e('0x2b')]);_0xa8b543[_0x3a6e('0x30')]=_[_0x3a6e('0x31')](_0x328c57[_0x3a6e('0x30')]);_0xa8b543[_0x3a6e('0x32')]=_[_0x3a6e('0x33')](_0xa8b543['model'],_0xa8b543[_0x3a6e('0x30')]);_0x570dee[_0x3a6e('0x35')]=_[_0x3a6e('0x33')](_0xa8b543[_0x3a6e('0x2f')],qs['fields'](_0x328c57[_0x3a6e('0x30')]['fields']));_0x570dee[_0x3a6e('0x35')]=_0x570dee[_0x3a6e('0x35')]['length']?_0x570dee[_0x3a6e('0x35')]:_0xa8b543['model'];if(_0x328c57[_0x3a6e('0x30')]['includeAll']){_0x570dee[_0x3a6e('0x42')]=[{'all':!![]}];}_0x570dee=_['merge']({},_0x570dee,_0x328c57[_0x3a6e('0x43')]);return db[_0x3a6e('0x2a')][_0x3a6e('0x44')](_0x570dee)[_0x3a6e('0x23')](handleEntityNotFound(_0x12e4f2,null))['then'](respondWithResult(_0x12e4f2,null))[_0x3a6e('0x40')](handleError(_0x12e4f2,null));};exports[_0x3a6e('0x45')]=function(_0x38768b,_0x52d710){return db['SugarcrmField']['create'](_0x38768b['body'],{})['then'](respondWithResult(_0x52d710,0xc9))[_0x3a6e('0x40')](handleError(_0x52d710,null));};exports[_0x3a6e('0x46')]=function(_0x52e528,_0x4bdbda){if(_0x52e528[_0x3a6e('0x47')]['id']){delete _0x52e528[_0x3a6e('0x47')]['id'];}return db[_0x3a6e('0x2a')]['find']({'where':{'id':_0x52e528[_0x3a6e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4bdbda,null))[_0x3a6e('0x23')](saveUpdates(_0x52e528['body'],null))[_0x3a6e('0x23')](respondWithResult(_0x4bdbda,null))[_0x3a6e('0x40')](handleError(_0x4bdbda,null));};exports[_0x3a6e('0x24')]=function(_0x3f8f2f,_0x34678e){return db[_0x3a6e('0x2a')][_0x3a6e('0x44')]({'where':{'id':_0x3f8f2f[_0x3a6e('0x48')]['id']}})[_0x3a6e('0x23')](handleEntityNotFound(_0x34678e,null))['then'](removeEntity(_0x34678e,null))[_0x3a6e('0x40')](handleError(_0x34678e,null));}; \ No newline at end of file +var _0x23ea=['findAll','rows','show','params','length','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','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','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x5cf7cc,_0x292efc){var _0x5b739f=function(_0xf14879){while(--_0xf14879){_0x5cf7cc['push'](_0x5cf7cc['shift']());}};_0x5b739f(++_0x292efc);}(_0x23ea,0xa1));var _0xa23e=function(_0x3c9f56,_0x198760){_0x3c9f56=_0x3c9f56-0x0;var _0x33f1be=_0x23ea[_0x3c9f56];return _0x33f1be;};'use strict';var emlformat=require(_0xa23e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa23e('0x1'));var jsonpatch=require(_0xa23e('0x2'));var rp=require(_0xa23e('0x3'));var moment=require(_0xa23e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa23e('0x5'));var util=require(_0xa23e('0x6'));var path=require(_0xa23e('0x7'));var sox=require(_0xa23e('0x8'));var csv=require(_0xa23e('0x9'));var ejs=require(_0xa23e('0xa'));var fs=require('fs');var fs_extra=require(_0xa23e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa23e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa23e('0xd'));var toCsv=require(_0xa23e('0x9'));var querystring=require('querystring');var Papa=require(_0xa23e('0xe'));var Redis=require(_0xa23e('0xf'));var authService=require(_0xa23e('0x10'));var qs=require(_0xa23e('0x11'));var as=require(_0xa23e('0x12'));var hardwareService=require(_0xa23e('0x13'));var logger=require(_0xa23e('0x14'))(_0xa23e('0x15'));var utils=require(_0xa23e('0x16'));var config=require(_0xa23e('0x17'));var licenseUtil=require(_0xa23e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1edd92,_0x4bb176){_0x4bb176=_0x4bb176||0xcc;return function(_0x50b72b){if(_0x50b72b){return _0x1edd92['sendStatus'](_0x4bb176);}return _0x1edd92['status'](_0x4bb176)['end']();};}function respondWithResult(_0x5e4e2c,_0x20c039){_0x20c039=_0x20c039||0xc8;return function(_0x2d11da){if(_0x2d11da){return _0x5e4e2c[_0xa23e('0x19')](_0x20c039)[_0xa23e('0x1a')](_0x2d11da);}};}function respondWithFilteredResult(_0x4e23da,_0x1d4a59){return function(_0x33760b){if(_0x33760b){var _0x87dd1c=typeof _0x1d4a59[_0xa23e('0x1b')]==='undefined'&&typeof _0x1d4a59[_0xa23e('0x1c')]===_0xa23e('0x1d');var _0x4897d3=_0x33760b['count'];var _0x5b37ed=_0x87dd1c?0x0:_0x1d4a59[_0xa23e('0x1b')];var _0x52f307=_0x87dd1c?_0x33760b[_0xa23e('0x1e')]:_0x1d4a59[_0xa23e('0x1b')]+_0x1d4a59[_0xa23e('0x1c')];var _0x4d99df;if(_0x52f307>=_0x4897d3){_0x52f307=_0x4897d3;_0x4d99df=0xc8;}else{_0x4d99df=0xce;}_0x4e23da[_0xa23e('0x19')](_0x4d99df);return _0x4e23da[_0xa23e('0x1f')](_0xa23e('0x20'),_0x5b37ed+'-'+_0x52f307+'/'+_0x4897d3)['json'](_0x33760b);}return null;};}function patchUpdates(_0x31afbb){return function(_0x1f5400){try{jsonpatch[_0xa23e('0x21')](_0x1f5400,_0x31afbb,!![]);}catch(_0x407271){return BPromise[_0xa23e('0x22')](_0x407271);}return _0x1f5400['save']();};}function saveUpdates(_0x8f9982,_0x47b6bb){return function(_0x3e17ed){if(_0x3e17ed){return _0x3e17ed[_0xa23e('0x23')](_0x8f9982)[_0xa23e('0x24')](function(_0x3887ac){return _0x3887ac;});}return null;};}function removeEntity(_0x2237b3,_0x40a053){return function(_0x2d9293){if(_0x2d9293){return _0x2d9293[_0xa23e('0x25')]()['then'](function(){_0x2237b3['status'](0xcc)[_0xa23e('0x26')]();});}};}function handleEntityNotFound(_0x8b9949,_0x3b3acb){return function(_0x377575){if(!_0x377575){_0x8b9949[_0xa23e('0x27')](0x194);}return _0x377575;};}function handleError(_0x25bea9,_0x338723){_0x338723=_0x338723||0x1f4;return function(_0x40758a){logger[_0xa23e('0x28')](_0x40758a[_0xa23e('0x29')]);if(_0x40758a[_0xa23e('0x2a')]){delete _0x40758a['name'];}_0x25bea9[_0xa23e('0x19')](_0x338723)['send'](_0x40758a);};}exports[_0xa23e('0x2b')]=function(_0x2316d6,_0x4db762){var _0xf19d2e={},_0x343673={},_0xf1143c={'count':0x0,'rows':[]};var _0x457786=_[_0xa23e('0x2c')](db[_0xa23e('0x2d')][_0xa23e('0x2e')],function(_0x31c558){return{'name':_0x31c558[_0xa23e('0x2f')],'type':_0x31c558['type'][_0xa23e('0x30')]};});_0x343673[_0xa23e('0x31')]=_[_0xa23e('0x2c')](_0x457786,'name');_0x343673['query']=_[_0xa23e('0x32')](_0x2316d6[_0xa23e('0x33')]);_0x343673[_0xa23e('0x34')]=_[_0xa23e('0x35')](_0x343673['model'],_0x343673[_0xa23e('0x33')]);_0xf19d2e['attributes']=_['intersection'](_0x343673[_0xa23e('0x31')],qs[_0xa23e('0x36')](_0x2316d6['query'][_0xa23e('0x36')]));_0xf19d2e[_0xa23e('0x37')]=_0xf19d2e[_0xa23e('0x37')]['length']?_0xf19d2e['attributes']:_0x343673[_0xa23e('0x31')];if(!_0x2316d6[_0xa23e('0x33')][_0xa23e('0x38')]('nolimit')){_0xf19d2e[_0xa23e('0x1c')]=qs[_0xa23e('0x1c')](_0x2316d6[_0xa23e('0x33')][_0xa23e('0x1c')]);_0xf19d2e[_0xa23e('0x1b')]=qs[_0xa23e('0x1b')](_0x2316d6[_0xa23e('0x33')][_0xa23e('0x1b')]);}_0xf19d2e[_0xa23e('0x39')]=qs[_0xa23e('0x3a')](_0x2316d6[_0xa23e('0x33')][_0xa23e('0x3a')]);_0xf19d2e['where']=qs[_0xa23e('0x34')](_['pick'](_0x2316d6['query'],_0x343673['filters']),_0x457786);if(_0x2316d6['query'][_0xa23e('0x3b')]){_0xf19d2e[_0xa23e('0x3c')]=_[_0xa23e('0x3d')](_0xf19d2e[_0xa23e('0x3c')],{'$or':_[_0xa23e('0x2c')](_0x457786,function(_0x15050c){if(_0x15050c[_0xa23e('0x3e')]!==_0xa23e('0x3f')){var _0x5b02e2={};_0x5b02e2[_0x15050c[_0xa23e('0x2a')]]={'$like':'%'+_0x2316d6[_0xa23e('0x33')][_0xa23e('0x3b')]+'%'};return _0x5b02e2;}})});}_0xf19d2e=_[_0xa23e('0x3d')]({},_0xf19d2e,_0x2316d6[_0xa23e('0x40')]);var _0x33b5db={'where':_0xf19d2e['where']};return db[_0xa23e('0x2d')][_0xa23e('0x1e')](_0x33b5db)[_0xa23e('0x24')](function(_0x4235ab){_0xf1143c[_0xa23e('0x1e')]=_0x4235ab;if(_0x2316d6[_0xa23e('0x33')][_0xa23e('0x41')]){_0xf19d2e[_0xa23e('0x42')]=[{'all':!![]}];}return db[_0xa23e('0x2d')][_0xa23e('0x43')](_0xf19d2e);})['then'](function(_0x14ffe3){_0xf1143c[_0xa23e('0x44')]=_0x14ffe3;return _0xf1143c;})[_0xa23e('0x24')](respondWithFilteredResult(_0x4db762,_0xf19d2e))['catch'](handleError(_0x4db762,null));};exports[_0xa23e('0x45')]=function(_0x1153f4,_0x2cd40b){var _0x278ddd={'raw':!![],'where':{'id':_0x1153f4[_0xa23e('0x46')]['id']}},_0x3796a9={};_0x3796a9[_0xa23e('0x31')]=_[_0xa23e('0x32')](db['SugarcrmField'][_0xa23e('0x2e')]);_0x3796a9[_0xa23e('0x33')]=_['keys'](_0x1153f4[_0xa23e('0x33')]);_0x3796a9[_0xa23e('0x34')]=_[_0xa23e('0x35')](_0x3796a9['model'],_0x3796a9[_0xa23e('0x33')]);_0x278ddd['attributes']=_[_0xa23e('0x35')](_0x3796a9[_0xa23e('0x31')],qs[_0xa23e('0x36')](_0x1153f4[_0xa23e('0x33')][_0xa23e('0x36')]));_0x278ddd['attributes']=_0x278ddd[_0xa23e('0x37')][_0xa23e('0x47')]?_0x278ddd[_0xa23e('0x37')]:_0x3796a9[_0xa23e('0x31')];if(_0x1153f4[_0xa23e('0x33')][_0xa23e('0x41')]){_0x278ddd[_0xa23e('0x42')]=[{'all':!![]}];}_0x278ddd=_['merge']({},_0x278ddd,_0x1153f4[_0xa23e('0x40')]);return db['SugarcrmField'][_0xa23e('0x48')](_0x278ddd)[_0xa23e('0x24')](handleEntityNotFound(_0x2cd40b,null))[_0xa23e('0x24')](respondWithResult(_0x2cd40b,null))[_0xa23e('0x49')](handleError(_0x2cd40b,null));};exports[_0xa23e('0x4a')]=function(_0x2a109e,_0x1e316e){return db[_0xa23e('0x2d')][_0xa23e('0x4a')](_0x2a109e[_0xa23e('0x4b')],{})[_0xa23e('0x24')](respondWithResult(_0x1e316e,0xc9))[_0xa23e('0x49')](handleError(_0x1e316e,null));};exports[_0xa23e('0x23')]=function(_0x5ef6b0,_0x4716d7){if(_0x5ef6b0[_0xa23e('0x4b')]['id']){delete _0x5ef6b0[_0xa23e('0x4b')]['id'];}return db['SugarcrmField'][_0xa23e('0x48')]({'where':{'id':_0x5ef6b0['params']['id']}})['then'](handleEntityNotFound(_0x4716d7,null))[_0xa23e('0x24')](saveUpdates(_0x5ef6b0['body'],null))[_0xa23e('0x24')](respondWithResult(_0x4716d7,null))[_0xa23e('0x49')](handleError(_0x4716d7,null));};exports[_0xa23e('0x25')]=function(_0x39a6f7,_0x325853){return db['SugarcrmField'][_0xa23e('0x48')]({'where':{'id':_0x39a6f7[_0xa23e('0x46')]['id']}})[_0xa23e('0x24')](handleEntityNotFound(_0x325853,null))[_0xa23e('0x24')](removeEntity(_0x325853,null))['catch'](handleError(_0x325853,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a95854c..1176d54 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 _0xe21a=['path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3494bb,_0x1d966d){var _0x2b78c6=function(_0x37e6df){while(--_0x37e6df){_0x3494bb['push'](_0x3494bb['shift']());}};_0x2b78c6(++_0x1d966d);}(_0xe21a,0xe8));var _0xae21=function(_0x137762,_0x6da614){_0x137762=_0x137762-0x0;var _0x2493d8=_0xe21a[_0x137762];return _0x2493d8;};'use strict';var _=require('lodash');var util=require(_0xae21('0x0'));var logger=require(_0xae21('0x1'))(_0xae21('0x2'));var moment=require(_0xae21('0x3'));var BPromise=require(_0xae21('0x4'));var rp=require(_0xae21('0x5'));var fs=require('fs');var path=require(_0xae21('0x6'));var rimraf=require('rimraf');var config=require(_0xae21('0x7'));var attributes=require(_0xae21('0x8'));module[_0xae21('0x9')]=function(_0x235f9b,_0xcdd519){return _0x235f9b[_0xae21('0xa')](_0xae21('0xb'),attributes,{'tableName':_0xae21('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xae21('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf28=['exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x16dcc2,_0x1323f2){var _0x41d2ef=function(_0x4b3085){while(--_0x4b3085){_0x16dcc2['push'](_0x16dcc2['shift']());}};_0x41d2ef(++_0x1323f2);}(_0xcf28,0xd3));var _0x8cf2=function(_0x25e793,_0x4d96dc){_0x25e793=_0x25e793-0x0;var _0x50a201=_0xcf28[_0x25e793];return _0x50a201;};'use strict';var _=require('lodash');var util=require(_0x8cf2('0x0'));var logger=require(_0x8cf2('0x1'))(_0x8cf2('0x2'));var moment=require(_0x8cf2('0x3'));var BPromise=require(_0x8cf2('0x4'));var rp=require(_0x8cf2('0x5'));var fs=require('fs');var path=require(_0x8cf2('0x6'));var rimraf=require(_0x8cf2('0x7'));var config=require(_0x8cf2('0x8'));var attributes=require(_0x8cf2('0x9'));module[_0x8cf2('0xa')]=function(_0x366dfe,_0x5221a4){return _0x366dfe[_0x8cf2('0xb')](_0x8cf2('0xc'),attributes,{'tableName':_0x8cf2('0xd'),'paranoid':![],'indexes':[{'name':_0x8cf2('0xe'),'fields':[_0x8cf2('0xf'),_0x8cf2('0x10')],'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 704d35d..0fe9ddb 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 _0xdc8f=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0xdc8f,0x168));var _0xfdc8=function(_0x3f9a64,_0x224930){_0x3f9a64=_0x3f9a64-0x0;var _0x353b88=_0xdc8f[_0x3f9a64];return _0x353b88;};'use strict';var _=require(_0xfdc8('0x0'));var util=require(_0xfdc8('0x1'));var moment=require(_0xfdc8('0x2'));var BPromise=require('bluebird');var rs=require(_0xfdc8('0x3'));var fs=require('fs');var Redis=require(_0xfdc8('0x4'));var db=require(_0xfdc8('0x5'))['db'];var utils=require(_0xfdc8('0x6'));var logger=require(_0xfdc8('0x7'))(_0xfdc8('0x8'));var config=require('../../config/environment');var jayson=require(_0xfdc8('0x9'));var client=jayson['client'][_0xfdc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e8d8c,_0x194de9,_0x1eb884){return new BPromise(function(_0x1d862d,_0x1332e9){return client['request'](_0x3e8d8c,_0x1eb884)[_0xfdc8('0xb')](function(_0x2d5cd4){logger[_0xfdc8('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x194de9,_0xfdc8('0xd'));logger[_0xfdc8('0xe')](_0xfdc8('0xf'),_0x194de9,'request\x20sent',JSON[_0xfdc8('0x10')](_0x2d5cd4));if(_0x2d5cd4[_0xfdc8('0x11')]){if(_0x2d5cd4['error'][_0xfdc8('0x12')]===0x1f4){logger[_0xfdc8('0x11')](_0xfdc8('0x13'),_0x194de9,_0x2d5cd4[_0xfdc8('0x11')][_0xfdc8('0x14')]);return _0x1332e9(_0x2d5cd4[_0xfdc8('0x11')]['message']);}logger[_0xfdc8('0x11')](_0xfdc8('0x13'),_0x194de9,_0x2d5cd4[_0xfdc8('0x11')][_0xfdc8('0x14')]);return _0x1d862d(_0x2d5cd4['error'][_0xfdc8('0x14')]);}else{logger[_0xfdc8('0xc')](_0xfdc8('0x13'),_0x194de9,'request\x20sent');_0x1d862d(_0x2d5cd4[_0xfdc8('0x15')][_0xfdc8('0x14')]);}})['catch'](function(_0x26e3e1){logger[_0xfdc8('0x11')](_0xfdc8('0x13'),_0x194de9,_0x26e3e1);_0x1332e9(_0x26e3e1);});});} \ No newline at end of file +var _0x2b1e=['../../config/logger','rpc','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x2b1e,0x1f2));var _0xe2b1=function(_0x32c0c4,_0x2d15ec){_0x32c0c4=_0x32c0c4-0x0;var _0x5b9b73=_0x2b1e[_0x32c0c4];return _0x5b9b73;};'use strict';var _=require('lodash');var util=require(_0xe2b1('0x0'));var moment=require('moment');var BPromise=require(_0xe2b1('0x1'));var rs=require(_0xe2b1('0x2'));var fs=require('fs');var Redis=require(_0xe2b1('0x3'));var db=require(_0xe2b1('0x4'))['db'];var utils=require(_0xe2b1('0x5'));var logger=require(_0xe2b1('0x6'))(_0xe2b1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe2b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x444234,_0x31e5f4,_0x3a3f6d){return new BPromise(function(_0x22c507,_0x54b349){return client[_0xe2b1('0x9')](_0x444234,_0x3a3f6d)[_0xe2b1('0xa')](function(_0x1be5a0){logger[_0xe2b1('0xb')](_0xe2b1('0xc'),_0x31e5f4,_0xe2b1('0xd'));logger['debug'](_0xe2b1('0xe'),_0x31e5f4,_0xe2b1('0xd'),JSON[_0xe2b1('0xf')](_0x1be5a0));if(_0x1be5a0[_0xe2b1('0x10')]){if(_0x1be5a0[_0xe2b1('0x10')][_0xe2b1('0x11')]===0x1f4){logger[_0xe2b1('0x10')](_0xe2b1('0xc'),_0x31e5f4,_0x1be5a0['error']['message']);return _0x54b349(_0x1be5a0[_0xe2b1('0x10')][_0xe2b1('0x12')]);}logger[_0xe2b1('0x10')](_0xe2b1('0xc'),_0x31e5f4,_0x1be5a0['error']['message']);return _0x22c507(_0x1be5a0[_0xe2b1('0x10')]['message']);}else{logger[_0xe2b1('0xb')](_0xe2b1('0xc'),_0x31e5f4,_0xe2b1('0xd'));_0x22c507(_0x1be5a0[_0xe2b1('0x13')][_0xe2b1('0x12')]);}})[_0xe2b1('0x14')](function(_0x2d6884){logger[_0xe2b1('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x31e5f4,_0x2d6884);_0x54b349(_0x2d6884);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index d66c1cd..690679c 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 _0x7e81=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x24e69f,_0x29f5ee){var _0x96891e=function(_0x391be1){while(--_0x391be1){_0x24e69f['push'](_0x24e69f['shift']());}};_0x96891e(++_0x29f5ee);}(_0x7e81,0xc5));var _0x17e8=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x7e81[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x17e8('0x0'));var util=require(_0x17e8('0x1'));var path=require(_0x17e8('0x2'));var timeout=require(_0x17e8('0x3'));var express=require(_0x17e8('0x4'));var router=express[_0x17e8('0x5')]();var fs_extra=require(_0x17e8('0x6'));var auth=require(_0x17e8('0x7'));var interaction=require(_0x17e8('0x8'));var config=require(_0x17e8('0x9'));var controller=require('./intVtigerAccount.controller');router[_0x17e8('0xa')]('/',auth[_0x17e8('0xb')](),controller[_0x17e8('0xc')]);router[_0x17e8('0xa')](_0x17e8('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x17e8('0xa')](_0x17e8('0xe'),auth[_0x17e8('0xb')](),controller['getConfigurations']);router['get'](_0x17e8('0xf'),auth[_0x17e8('0xb')](),controller[_0x17e8('0x10')]);router[_0x17e8('0x11')]('/',auth[_0x17e8('0xb')](),controller['create']);router[_0x17e8('0x11')](_0x17e8('0xe'),auth['isAuthenticated'](),controller[_0x17e8('0x12')]);router[_0x17e8('0x13')](_0x17e8('0xd'),auth[_0x17e8('0xb')](),controller[_0x17e8('0x14')]);router[_0x17e8('0x15')](_0x17e8('0xd'),auth[_0x17e8('0xb')](),controller[_0x17e8('0x16')]);module[_0x17e8('0x17')]=router; \ No newline at end of file +var _0xfd28=['put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x279b90,_0x15a882){var _0x5135aa=function(_0x144f62){while(--_0x144f62){_0x279b90['push'](_0x279b90['shift']());}};_0x5135aa(++_0x15a882);}(_0xfd28,0x148));var _0x8fd2=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xfd28[_0x1f7413];return _0x2d2775;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['get'](_0x8fd2('0xd'),auth['isAuthenticated'](),controller[_0x8fd2('0xe')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xf')]('/:id/configurations',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x10')]);router[_0x8fd2('0x11')](_0x8fd2('0x12'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x13')]);router[_0x8fd2('0x14')](_0x8fd2('0x12'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x15')]);module[_0x8fd2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 90d86fa..51946bc 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 _0x4e98=['exports','STRING'];(function(_0x41ef85,_0x32cd86){var _0xaf835=function(_0x3b6452){while(--_0x3b6452){_0x41ef85['push'](_0x41ef85['shift']());}};_0xaf835(++_0x32cd86);}(_0x4e98,0x1a4));var _0x84e9=function(_0x277d21,_0x217cc0){_0x277d21=_0x277d21-0x0;var _0x90d12e=_0x4e98[_0x277d21];return _0x90d12e;};'use strict';var Sequelize=require('sequelize');module[_0x84e9('0x0')]={'name':{'type':Sequelize[_0x84e9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x84e9('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x84e9('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2093=['STRING','HelpDesk','sequelize'];(function(_0x417892,_0x4c810b){var _0x4f1b13=function(_0x29d0a6){while(--_0x29d0a6){_0x417892['push'](_0x417892['shift']());}};_0x4f1b13(++_0x4c810b);}(_0x2093,0x1d3));var _0x3209=function(_0x16dfee,_0x1dba0b){_0x16dfee=_0x16dfee-0x0;var _0x3ced82=_0x2093[_0x16dfee];return _0x3ced82;};'use strict';var Sequelize=require(_0x3209('0x0'));module['exports']={'name':{'type':Sequelize[_0x3209('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3209('0x1')]},'username':{'type':Sequelize[_0x3209('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3209('0x1')],'allowNull':![],'defaultValue':_0x3209('0x2')},'remoteUri':{'type':Sequelize[_0x3209('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'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 caee6b4..434819f 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 _0xdc23=['startsWith','cf_','picklist','value','log','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','VtigerAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','format','GET','getchallenge','success','POST','login','result','token','sessionName','reference','owner','remove','includes','false','label'];(function(_0x352f33,_0x500444){var _0x42feae=function(_0x1a64f0){while(--_0x1a64f0){_0x352f33['push'](_0x352f33['shift']());}};_0x42feae(++_0x500444);}(_0xdc23,0x1d2));var _0x3dc2=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0xdc23[_0xb24fad];return _0x173226;};'use strict';var emlformat=require(_0x3dc2('0x0'));var rimraf=require(_0x3dc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dc2('0x2'));var rp=require('request-promise');var moment=require(_0x3dc2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3dc2('0x4'));var util=require('util');var path=require(_0x3dc2('0x5'));var sox=require(_0x3dc2('0x6'));var csv=require(_0x3dc2('0x7'));var ejs=require(_0x3dc2('0x8'));var fs=require('fs');var fs_extra=require(_0x3dc2('0x9'));var _=require(_0x3dc2('0xa'));var squel=require(_0x3dc2('0xb'));var crypto=require(_0x3dc2('0xc'));var jsforce=require(_0x3dc2('0xd'));var deskjs=require(_0x3dc2('0xe'));var toCsv=require(_0x3dc2('0x7'));var querystring=require('querystring');var Papa=require(_0x3dc2('0xf'));var Redis=require('ioredis');var authService=require(_0x3dc2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3dc2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3dc2('0x12'));var utils=require(_0x3dc2('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3dc2('0x14'));function respondWithStatusCode(_0x470562,_0x551fde){_0x551fde=_0x551fde||0xcc;return function(_0x4accc9){if(_0x4accc9){return _0x470562[_0x3dc2('0x15')](_0x551fde);}return _0x470562[_0x3dc2('0x16')](_0x551fde)[_0x3dc2('0x17')]();};}function respondWithResult(_0x446f5d,_0x321378){_0x321378=_0x321378||0xc8;return function(_0x5bfacc){if(_0x5bfacc){return _0x446f5d[_0x3dc2('0x16')](_0x321378)[_0x3dc2('0x18')](_0x5bfacc);}};}function respondWithFilteredResult(_0x272d5d,_0x4148da){return function(_0x5bfe5f){if(_0x5bfe5f){var _0x335418=typeof _0x4148da['offset']===_0x3dc2('0x19')&&typeof _0x4148da['limit']===_0x3dc2('0x19');var _0xe9261c=_0x5bfe5f[_0x3dc2('0x1a')];var _0x38540b=_0x335418?0x0:_0x4148da[_0x3dc2('0x1b')];var _0x3309d8=_0x335418?_0x5bfe5f[_0x3dc2('0x1a')]:_0x4148da[_0x3dc2('0x1b')]+_0x4148da[_0x3dc2('0x1c')];var _0x320151;if(_0x3309d8>=_0xe9261c){_0x3309d8=_0xe9261c;_0x320151=0xc8;}else{_0x320151=0xce;}_0x272d5d['status'](_0x320151);return _0x272d5d[_0x3dc2('0x1d')](_0x3dc2('0x1e'),_0x38540b+'-'+_0x3309d8+'/'+_0xe9261c)[_0x3dc2('0x18')](_0x5bfe5f);}return null;};}function patchUpdates(_0x2db1d1){return function(_0x12481f){try{jsonpatch[_0x3dc2('0x1f')](_0x12481f,_0x2db1d1,!![]);}catch(_0x397c1e){return BPromise[_0x3dc2('0x20')](_0x397c1e);}return _0x12481f['save']();};}function saveUpdates(_0xeaf004,_0x2405a2){return function(_0x3c3848){if(_0x3c3848){return _0x3c3848[_0x3dc2('0x21')](_0xeaf004)[_0x3dc2('0x22')](function(_0x334732){return _0x334732;});}return null;};}function removeEntity(_0x292d54,_0x160779){return function(_0x9aed77){if(_0x9aed77){return _0x9aed77[_0x3dc2('0x23')]()['then'](function(){_0x292d54[_0x3dc2('0x16')](0xcc)[_0x3dc2('0x17')]();});}};}function handleEntityNotFound(_0x225d3e,_0x1de704){return function(_0xfe9a7c){if(!_0xfe9a7c){_0x225d3e[_0x3dc2('0x15')](0x194);}return _0xfe9a7c;};}function handleError(_0x1bf172,_0x257286){_0x257286=_0x257286||0x1f4;return function(_0x3e8b2a){logger['error'](_0x3e8b2a[_0x3dc2('0x24')]);if(_0x3e8b2a['name']){delete _0x3e8b2a[_0x3dc2('0x25')];}_0x1bf172[_0x3dc2('0x16')](_0x257286)['send'](_0x3e8b2a);};}exports[_0x3dc2('0x26')]=function(_0x349c9c,_0x44a9ab){var _0x4e5408={},_0x5662e1={},_0x510969={'count':0x0,'rows':[]};var _0x48429c=_[_0x3dc2('0x27')](db[_0x3dc2('0x28')][_0x3dc2('0x29')],function(_0x335e03){return{'name':_0x335e03['fieldName'],'type':_0x335e03[_0x3dc2('0x2a')][_0x3dc2('0x2b')]};});_0x5662e1[_0x3dc2('0x2c')]=_[_0x3dc2('0x27')](_0x48429c,_0x3dc2('0x25'));_0x5662e1[_0x3dc2('0x2d')]=_[_0x3dc2('0x2e')](_0x349c9c[_0x3dc2('0x2d')]);_0x5662e1[_0x3dc2('0x2f')]=_[_0x3dc2('0x30')](_0x5662e1[_0x3dc2('0x2c')],_0x5662e1[_0x3dc2('0x2d')]);_0x4e5408[_0x3dc2('0x31')]=_[_0x3dc2('0x30')](_0x5662e1[_0x3dc2('0x2c')],qs[_0x3dc2('0x32')](_0x349c9c['query'][_0x3dc2('0x32')]));_0x4e5408[_0x3dc2('0x31')]=_0x4e5408[_0x3dc2('0x31')][_0x3dc2('0x33')]?_0x4e5408[_0x3dc2('0x31')]:_0x5662e1[_0x3dc2('0x2c')];if(!_0x349c9c['query'][_0x3dc2('0x34')](_0x3dc2('0x35'))){_0x4e5408[_0x3dc2('0x1c')]=qs[_0x3dc2('0x1c')](_0x349c9c[_0x3dc2('0x2d')][_0x3dc2('0x1c')]);_0x4e5408[_0x3dc2('0x1b')]=qs[_0x3dc2('0x1b')](_0x349c9c['query']['offset']);}_0x4e5408[_0x3dc2('0x36')]=qs[_0x3dc2('0x37')](_0x349c9c[_0x3dc2('0x2d')][_0x3dc2('0x37')]);_0x4e5408[_0x3dc2('0x38')]=qs[_0x3dc2('0x2f')](_['pick'](_0x349c9c['query'],_0x5662e1[_0x3dc2('0x2f')]),_0x48429c);if(_0x349c9c['query'][_0x3dc2('0x39')]){_0x4e5408[_0x3dc2('0x38')]=_['merge'](_0x4e5408[_0x3dc2('0x38')],{'$or':_[_0x3dc2('0x27')](_0x48429c,function(_0x2f8af4){if(_0x2f8af4[_0x3dc2('0x2a')]!==_0x3dc2('0x3a')){var _0x527a58={};_0x527a58[_0x2f8af4[_0x3dc2('0x25')]]={'$like':'%'+_0x349c9c['query'][_0x3dc2('0x39')]+'%'};return _0x527a58;}})});}_0x4e5408=_[_0x3dc2('0x3b')]({},_0x4e5408,_0x349c9c[_0x3dc2('0x3c')]);var _0x221e2b={'where':_0x4e5408[_0x3dc2('0x38')]};return db[_0x3dc2('0x28')]['count'](_0x221e2b)[_0x3dc2('0x22')](function(_0x5627d2){_0x510969[_0x3dc2('0x1a')]=_0x5627d2;if(_0x349c9c[_0x3dc2('0x2d')][_0x3dc2('0x3d')]){_0x4e5408[_0x3dc2('0x3e')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x4e5408);})['then'](function(_0x5d5af0){_0x510969['rows']=_0x5d5af0;return _0x510969;})[_0x3dc2('0x22')](respondWithFilteredResult(_0x44a9ab,_0x4e5408))[_0x3dc2('0x3f')](handleError(_0x44a9ab,null));};exports[_0x3dc2('0x40')]=function(_0x4a871c,_0x565a4d){var _0x5d896d={'raw':![],'where':{'id':_0x4a871c[_0x3dc2('0x41')]['id']}},_0x528191={};_0x528191[_0x3dc2('0x2c')]=_['keys'](db[_0x3dc2('0x28')][_0x3dc2('0x29')]);_0x528191[_0x3dc2('0x2d')]=_['keys'](_0x4a871c['query']);_0x528191[_0x3dc2('0x2f')]=_['intersection'](_0x528191['model'],_0x528191[_0x3dc2('0x2d')]);_0x5d896d[_0x3dc2('0x31')]=_[_0x3dc2('0x30')](_0x528191[_0x3dc2('0x2c')],qs[_0x3dc2('0x32')](_0x4a871c[_0x3dc2('0x2d')][_0x3dc2('0x32')]));_0x5d896d['attributes']=_0x5d896d[_0x3dc2('0x31')]['length']?_0x5d896d['attributes']:_0x528191['model'];if(_0x4a871c[_0x3dc2('0x2d')][_0x3dc2('0x3d')]){_0x5d896d[_0x3dc2('0x3e')]=[{'all':!![]}];}_0x5d896d=_['merge']({},_0x5d896d,_0x4a871c[_0x3dc2('0x3c')]);return db['VtigerAccount']['find'](_0x5d896d)[_0x3dc2('0x22')](handleEntityNotFound(_0x565a4d,null))[_0x3dc2('0x22')](respondWithResult(_0x565a4d,null))[_0x3dc2('0x3f')](handleError(_0x565a4d,null));};exports[_0x3dc2('0x42')]=function(_0xc13aef,_0x1b5475){return db['VtigerAccount']['create'](_0xc13aef[_0x3dc2('0x43')],{})[_0x3dc2('0x22')](respondWithResult(_0x1b5475,0xc9))[_0x3dc2('0x3f')](handleError(_0x1b5475,null));};exports[_0x3dc2('0x21')]=function(_0x3a36cd,_0x1ee235){if(_0x3a36cd[_0x3dc2('0x43')]['id']){delete _0x3a36cd['body']['id'];}return db[_0x3dc2('0x28')][_0x3dc2('0x44')]({'where':{'id':_0x3a36cd[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0x1ee235,null))[_0x3dc2('0x22')](saveUpdates(_0x3a36cd[_0x3dc2('0x43')],null))[_0x3dc2('0x22')](respondWithResult(_0x1ee235,null))[_0x3dc2('0x3f')](handleError(_0x1ee235,null));};exports['destroy']=function(_0x4dd57e,_0x667c28){return db[_0x3dc2('0x28')]['find']({'where':{'id':_0x4dd57e[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0x667c28,null))[_0x3dc2('0x22')](removeEntity(_0x667c28,null))[_0x3dc2('0x3f')](handleError(_0x667c28,null));};exports[_0x3dc2('0x45')]=function(_0x334aa6,_0xef51ad,_0x2bc57f){var _0x49b74e={};var _0xdfed03={};var _0x3288e2;var _0x79d076;return db[_0x3dc2('0x28')][_0x3dc2('0x46')]({'where':{'id':_0x334aa6[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0xef51ad,null))[_0x3dc2('0x22')](function(_0x21bf75){if(_0x21bf75){_0x3288e2=_0x21bf75;_0xdfed03[_0x3dc2('0x2c')]=_[_0x3dc2('0x2e')](db[_0x3dc2('0x47')]['rawAttributes']);_0xdfed03[_0x3dc2('0x2d')]=_['keys'](_0x334aa6['query']);_0xdfed03[_0x3dc2('0x2f')]=_[_0x3dc2('0x30')](_0xdfed03[_0x3dc2('0x2c')],_0xdfed03[_0x3dc2('0x2d')]);_0x49b74e[_0x3dc2('0x31')]=_[_0x3dc2('0x30')](_0xdfed03[_0x3dc2('0x2c')],qs[_0x3dc2('0x32')](_0x334aa6['query'][_0x3dc2('0x32')]));_0x49b74e[_0x3dc2('0x31')]=_0x49b74e[_0x3dc2('0x31')][_0x3dc2('0x33')]?_0x49b74e[_0x3dc2('0x31')]:_0xdfed03['model'];_0x49b74e['order']=qs['sort'](_0x334aa6['query'][_0x3dc2('0x37')]);_0x49b74e[_0x3dc2('0x38')]=qs['filters'](_[_0x3dc2('0x48')](_0x334aa6[_0x3dc2('0x2d')],_0xdfed03['filters']));if(_0x334aa6[_0x3dc2('0x2d')][_0x3dc2('0x39')]){_0x49b74e['where']=_[_0x3dc2('0x3b')](_0x49b74e['where'],{'$or':_[_0x3dc2('0x27')](_0x49b74e[_0x3dc2('0x31')],function(_0x1b72f6){var _0xc1a067={};_0xc1a067[_0x1b72f6]={'$like':'%'+_0x334aa6[_0x3dc2('0x2d')]['filter']+'%'};return _0xc1a067;})});}_0x49b74e=_[_0x3dc2('0x3b')]({},_0x49b74e,_0x334aa6[_0x3dc2('0x3c')]);return _0x3288e2[_0x3dc2('0x45')](_0x49b74e);}})[_0x3dc2('0x22')](function(_0x221bfc){if(_0x221bfc){_0x79d076=_0x221bfc[_0x3dc2('0x33')];if(!_0x334aa6[_0x3dc2('0x2d')]['hasOwnProperty']('nolimit')){_0x49b74e[_0x3dc2('0x1c')]=qs['limit'](_0x334aa6['query'][_0x3dc2('0x1c')]);_0x49b74e[_0x3dc2('0x1b')]=qs[_0x3dc2('0x1b')](_0x334aa6['query'][_0x3dc2('0x1b')]);}return _0x3288e2[_0x3dc2('0x45')](_0x49b74e);}})[_0x3dc2('0x22')](function(_0x31d6f1){if(_0x31d6f1){return _0x31d6f1?{'count':_0x79d076,'rows':_0x31d6f1}:null;}})[_0x3dc2('0x22')](respondWithResult(_0xef51ad,null))[_0x3dc2('0x3f')](handleError(_0xef51ad,null));};exports['addConfiguration']=function(_0x460e9f,_0x236726,_0x30cf97){if(_0x460e9f[_0x3dc2('0x43')]['id']){delete _0x460e9f['body']['id'];}return db[_0x3dc2('0x28')]['findOne']({'where':{'id':_0x460e9f[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0x236726,null))[_0x3dc2('0x22')](function(_0x46a7e6){if(_0x46a7e6){_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x49')]=_0x46a7e6['id'];_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4a')]=integrations[_0x3dc2('0x4b')](_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4c')],_0x460e9f[_0x3dc2('0x43')]['type']);_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4d')]=integrations[_0x3dc2('0x4e')](_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4c')],_0x460e9f['body'][_0x3dc2('0x2a')]);return db['VtigerConfiguration'][_0x3dc2('0x42')](_0x460e9f[_0x3dc2('0x43')],{'include':[{'model':db[_0x3dc2('0x4f')],'as':_0x3dc2('0x4a')},{'model':db[_0x3dc2('0x4f')],'as':_0x3dc2('0x4d')}]});}return null;})['then'](respondWithResult(_0x236726,null))['catch'](handleError(_0x236726,null));};var md5=require('md5');exports[_0x3dc2('0x50')]=function(_0xac2abf,_0x1b9e5b,_0xb3ab34){var _0x12f046=null;var _0x2cec50=null;var _0x26d4cd=null;var _0x483971=null;var _0x448219='';return db[_0x3dc2('0x28')][_0x3dc2('0x46')]({'where':{'id':_0xac2abf[_0x3dc2('0x41')]['id']},'attributes':['id',_0x3dc2('0x25'),'username',_0x3dc2('0x51'),_0x3dc2('0x52'),_0x3dc2('0x53'),_0x3dc2('0x54'),_0x3dc2('0x55')]})['then'](handleEntityNotFound(_0x1b9e5b,null))[_0x3dc2('0x22')](function(_0x31789f){if(_0x31789f){_0x12f046=_0x31789f[_0x3dc2('0x56')];_0x2cec50=_0x31789f[_0x3dc2('0x55')];_0x26d4cd=_0x31789f[_0x3dc2('0x52')];_0x448219=_0x31789f[_0x3dc2('0x53')];var _0x422665=_0x448219[_0x3dc2('0x57')](-0x1);if(_0x422665==='/'){_0x448219=_0x448219[_0x3dc2('0x58')](0x0,_0x448219['lastIndexOf'](_0x422665));}_0x483971=util[_0x3dc2('0x59')]('%s/webservice.php',_0x448219);var _0xabf144={'method':_0x3dc2('0x5a'),'uri':_0x483971,'qs':{'operation':_0x3dc2('0x5b'),'username':_0x31789f['username']},'json':!![]};return rp(_0xabf144);}})[_0x3dc2('0x22')](function(_0x1b19e4){if(_0x1b19e4[_0x3dc2('0x5c')]){var _0x24ee54={'method':_0x3dc2('0x5d'),'uri':_0x483971,'form':{'operation':_0x3dc2('0x5e'),'username':_0x12f046,'accessKey':md5(_0x1b19e4[_0x3dc2('0x5f')][_0x3dc2('0x60')]+_0x2cec50)},'json':!![]};return rp(_0x24ee54);}})[_0x3dc2('0x22')](function(_0x3e7692){if(_0x3e7692[_0x3dc2('0x5c')]){var _0x3f5157={'method':_0x3dc2('0x5a'),'uri':_0x483971,'qs':{'operation':'describe','username':_0x12f046,'sessionName':_0x3e7692[_0x3dc2('0x5f')][_0x3dc2('0x61')],'elementType':_0x26d4cd},'json':!![]};return rp(_0x3f5157);}})[_0x3dc2('0x22')](function(_0x579bbc){if(_0x579bbc['success']){var _0x4c5b60=['autogenerated',_0x3dc2('0x62'),_0x3dc2('0x63')];_[_0x3dc2('0x64')](_0x579bbc[_0x3dc2('0x5f')][_0x3dc2('0x32')],function(_0x5a965c){return _0x4c5b60[_0x3dc2('0x65')](_0x5a965c[_0x3dc2('0x2a')][_0x3dc2('0x25')]);});_[_0x3dc2('0x64')](_0x579bbc[_0x3dc2('0x5f')][_0x3dc2('0x32')],function(_0x5cbc55){return _0x5cbc55['editable']===_0x3dc2('0x66');});return{'count':_0x579bbc[_0x3dc2('0x5f')][_0x3dc2('0x32')][_0x3dc2('0x33')],'rows':_[_0x3dc2('0x27')](_0x579bbc['result'][_0x3dc2('0x32')],function(_0x2c68ba){return{'id':_0x2c68ba[_0x3dc2('0x25')],'name':_0x2c68ba[_0x3dc2('0x67')],'custom':_[_0x3dc2('0x68')](_0x2c68ba['name'],_0x3dc2('0x69'))?!![]:![],'options':_0x2c68ba[_0x3dc2('0x2a')]['name']===_0x3dc2('0x6a')&&_0x2c68ba[_0x3dc2('0x2a')]['picklistValues']['length']>0x0?_[_0x3dc2('0x27')](_0x2c68ba['type']['picklistValues'],function(_0xc251af){return{'name':_0xc251af[_0x3dc2('0x67')],'value':_0xc251af[_0x3dc2('0x6b')]};}):[]};})};}})[_0x3dc2('0x22')](respondWithResult(_0x1b9e5b,null))[_0x3dc2('0x3f')](function(_0xf021b9){console[_0x3dc2('0x6c')]('vTiger\x20error:\x20'+_0xf021b9);var _0x2e6d56=_0xac2abf[_0x3dc2('0x2d')][_0x3dc2('0x6d')]?0x1f4:_0xf021b9['statusCode']||0x1f4;logger['error'](_0x3dc2('0x6e'),'getFields',_0x2e6d56,JSON['stringify'](_0xf021b9));delete _0xf021b9['name'];if(_0x2e6d56===0x191){_0x2e6d56=0x190;}_0x1b9e5b[_0x3dc2('0x16')](_0x2e6d56)[_0x3dc2('0x6f')](_0xac2abf[_0x3dc2('0x2d')][_0x3dc2('0x6d')]?{'message':_0x3dc2('0x70'),'statusCode':_0xf021b9[_0x3dc2('0x71')]}:_0xf021b9);});}; \ No newline at end of file +var _0x1b9b=['%s/webservice.php','GET','getchallenge','success','login','result','token','describe','sessionName','reference','remove','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','find','create','body','params','findOne','VtigerConfiguration','pick','getConfigurations','AccountId','getSubjects','channel','Descriptions','VtigerField','Subjects','md5','getFields','username','description','remoteUri','serverUrl','accessKey','substring'];(function(_0x4df33e,_0x35ded4){var _0xbc3318=function(_0x5032a2){while(--_0x5032a2){_0x4df33e['push'](_0x4df33e['shift']());}};_0xbc3318(++_0x35ded4);}(_0x1b9b,0x89));var _0xb1b9=function(_0x41ea94,_0x19f5c4){_0x41ea94=_0x41ea94-0x0;var _0x1d3faa=_0x1b9b[_0x41ea94];return _0x1d3faa;};'use strict';var emlformat=require(_0xb1b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1b9('0x1'));var jsonpatch=require(_0xb1b9('0x2'));var rp=require(_0xb1b9('0x3'));var moment=require(_0xb1b9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb1b9('0x5'));var util=require(_0xb1b9('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb1b9('0x7'));var fs=require('fs');var fs_extra=require(_0xb1b9('0x8'));var _=require('lodash');var squel=require(_0xb1b9('0x9'));var crypto=require(_0xb1b9('0xa'));var jsforce=require(_0xb1b9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb1b9('0xc'));var querystring=require(_0xb1b9('0xd'));var Papa=require(_0xb1b9('0xe'));var Redis=require('ioredis');var authService=require(_0xb1b9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb1b9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1b9('0x11'))(_0xb1b9('0x12'));var utils=require(_0xb1b9('0x13'));var config=require(_0xb1b9('0x14'));var licenseUtil=require(_0xb1b9('0x15'));var db=require(_0xb1b9('0x16'))['db'];var integrations=require(_0xb1b9('0x17'));function respondWithStatusCode(_0x2fcc30,_0x517373){_0x517373=_0x517373||0xcc;return function(_0x32eb65){if(_0x32eb65){return _0x2fcc30[_0xb1b9('0x18')](_0x517373);}return _0x2fcc30[_0xb1b9('0x19')](_0x517373)['end']();};}function respondWithResult(_0xa8eab5,_0x391749){_0x391749=_0x391749||0xc8;return function(_0x2b3e71){if(_0x2b3e71){return _0xa8eab5[_0xb1b9('0x19')](_0x391749)[_0xb1b9('0x1a')](_0x2b3e71);}};}function respondWithFilteredResult(_0x2c2a2b,_0x5a5431){return function(_0x10316f){if(_0x10316f){var _0x4cfdfe=typeof _0x5a5431[_0xb1b9('0x1b')]===_0xb1b9('0x1c')&&typeof _0x5a5431[_0xb1b9('0x1d')]===_0xb1b9('0x1c');var _0x5aa4ed=_0x10316f[_0xb1b9('0x1e')];var _0xc5660a=_0x4cfdfe?0x0:_0x5a5431[_0xb1b9('0x1b')];var _0x4cec86=_0x4cfdfe?_0x10316f[_0xb1b9('0x1e')]:_0x5a5431[_0xb1b9('0x1b')]+_0x5a5431[_0xb1b9('0x1d')];var _0x3fb2ff;if(_0x4cec86>=_0x5aa4ed){_0x4cec86=_0x5aa4ed;_0x3fb2ff=0xc8;}else{_0x3fb2ff=0xce;}_0x2c2a2b[_0xb1b9('0x19')](_0x3fb2ff);return _0x2c2a2b['set']('Content-Range',_0xc5660a+'-'+_0x4cec86+'/'+_0x5aa4ed)['json'](_0x10316f);}return null;};}function patchUpdates(_0x3a2831){return function(_0x27c7f0){try{jsonpatch[_0xb1b9('0x1f')](_0x27c7f0,_0x3a2831,!![]);}catch(_0x31b067){return BPromise[_0xb1b9('0x20')](_0x31b067);}return _0x27c7f0[_0xb1b9('0x21')]();};}function saveUpdates(_0x51d4e2,_0x57a8be){return function(_0x1ae945){if(_0x1ae945){return _0x1ae945[_0xb1b9('0x22')](_0x51d4e2)[_0xb1b9('0x23')](function(_0x58f630){return _0x58f630;});}return null;};}function removeEntity(_0x3d20f3,_0xa3d102){return function(_0x50c2a7){if(_0x50c2a7){return _0x50c2a7[_0xb1b9('0x24')]()['then'](function(){_0x3d20f3[_0xb1b9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36970e,_0x578116){return function(_0x326e8f){if(!_0x326e8f){_0x36970e[_0xb1b9('0x18')](0x194);}return _0x326e8f;};}function handleError(_0x3925ee,_0xf08444){_0xf08444=_0xf08444||0x1f4;return function(_0x60a509){logger['error'](_0x60a509[_0xb1b9('0x25')]);if(_0x60a509[_0xb1b9('0x26')]){delete _0x60a509[_0xb1b9('0x26')];}_0x3925ee[_0xb1b9('0x19')](_0xf08444)[_0xb1b9('0x27')](_0x60a509);};}exports[_0xb1b9('0x28')]=function(_0xcdf0cd,_0x4c2187){var _0x493871={},_0x59d433={},_0x435bb0={'count':0x0,'rows':[]};var _0x1fe1cd=_[_0xb1b9('0x29')](db[_0xb1b9('0x2a')][_0xb1b9('0x2b')],function(_0x376f0f){return{'name':_0x376f0f[_0xb1b9('0x2c')],'type':_0x376f0f[_0xb1b9('0x2d')][_0xb1b9('0x2e')]};});_0x59d433[_0xb1b9('0x2f')]=_[_0xb1b9('0x29')](_0x1fe1cd,_0xb1b9('0x26'));_0x59d433['query']=_[_0xb1b9('0x30')](_0xcdf0cd[_0xb1b9('0x31')]);_0x59d433[_0xb1b9('0x32')]=_[_0xb1b9('0x33')](_0x59d433['model'],_0x59d433[_0xb1b9('0x31')]);_0x493871[_0xb1b9('0x34')]=_[_0xb1b9('0x33')](_0x59d433[_0xb1b9('0x2f')],qs[_0xb1b9('0x35')](_0xcdf0cd[_0xb1b9('0x31')][_0xb1b9('0x35')]));_0x493871['attributes']=_0x493871[_0xb1b9('0x34')][_0xb1b9('0x36')]?_0x493871[_0xb1b9('0x34')]:_0x59d433['model'];if(!_0xcdf0cd[_0xb1b9('0x31')][_0xb1b9('0x37')](_0xb1b9('0x38'))){_0x493871['limit']=qs['limit'](_0xcdf0cd[_0xb1b9('0x31')][_0xb1b9('0x1d')]);_0x493871[_0xb1b9('0x1b')]=qs[_0xb1b9('0x1b')](_0xcdf0cd['query'][_0xb1b9('0x1b')]);}_0x493871[_0xb1b9('0x39')]=qs[_0xb1b9('0x3a')](_0xcdf0cd[_0xb1b9('0x31')][_0xb1b9('0x3a')]);_0x493871[_0xb1b9('0x3b')]=qs['filters'](_['pick'](_0xcdf0cd[_0xb1b9('0x31')],_0x59d433[_0xb1b9('0x32')]),_0x1fe1cd);if(_0xcdf0cd[_0xb1b9('0x31')][_0xb1b9('0x3c')]){_0x493871[_0xb1b9('0x3b')]=_[_0xb1b9('0x3d')](_0x493871[_0xb1b9('0x3b')],{'$or':_[_0xb1b9('0x29')](_0x1fe1cd,function(_0x385c2c){if(_0x385c2c[_0xb1b9('0x2d')]!==_0xb1b9('0x3e')){var _0x1f2518={};_0x1f2518[_0x385c2c[_0xb1b9('0x26')]]={'$like':'%'+_0xcdf0cd[_0xb1b9('0x31')]['filter']+'%'};return _0x1f2518;}})});}_0x493871=_['merge']({},_0x493871,_0xcdf0cd[_0xb1b9('0x3f')]);var _0x30c96e={'where':_0x493871[_0xb1b9('0x3b')]};return db[_0xb1b9('0x2a')][_0xb1b9('0x1e')](_0x30c96e)[_0xb1b9('0x23')](function(_0x2b2db6){_0x435bb0['count']=_0x2b2db6;if(_0xcdf0cd[_0xb1b9('0x31')][_0xb1b9('0x40')]){_0x493871[_0xb1b9('0x41')]=[{'all':!![]}];}return db[_0xb1b9('0x2a')]['findAll'](_0x493871);})[_0xb1b9('0x23')](function(_0xe7ad2a){_0x435bb0['rows']=_0xe7ad2a;return _0x435bb0;})[_0xb1b9('0x23')](respondWithFilteredResult(_0x4c2187,_0x493871))[_0xb1b9('0x42')](handleError(_0x4c2187,null));};exports['show']=function(_0xf74e27,_0x3d1f39){var _0x38516c={'raw':![],'where':{'id':_0xf74e27['params']['id']}},_0x4befbe={};_0x4befbe[_0xb1b9('0x2f')]=_[_0xb1b9('0x30')](db[_0xb1b9('0x2a')]['rawAttributes']);_0x4befbe[_0xb1b9('0x31')]=_[_0xb1b9('0x30')](_0xf74e27[_0xb1b9('0x31')]);_0x4befbe['filters']=_['intersection'](_0x4befbe[_0xb1b9('0x2f')],_0x4befbe[_0xb1b9('0x31')]);_0x38516c[_0xb1b9('0x34')]=_['intersection'](_0x4befbe['model'],qs['fields'](_0xf74e27[_0xb1b9('0x31')][_0xb1b9('0x35')]));_0x38516c[_0xb1b9('0x34')]=_0x38516c[_0xb1b9('0x34')][_0xb1b9('0x36')]?_0x38516c[_0xb1b9('0x34')]:_0x4befbe[_0xb1b9('0x2f')];if(_0xf74e27[_0xb1b9('0x31')][_0xb1b9('0x40')]){_0x38516c[_0xb1b9('0x41')]=[{'all':!![]}];}_0x38516c=_[_0xb1b9('0x3d')]({},_0x38516c,_0xf74e27[_0xb1b9('0x3f')]);return db[_0xb1b9('0x2a')][_0xb1b9('0x43')](_0x38516c)['then'](handleEntityNotFound(_0x3d1f39,null))[_0xb1b9('0x23')](respondWithResult(_0x3d1f39,null))[_0xb1b9('0x42')](handleError(_0x3d1f39,null));};exports[_0xb1b9('0x44')]=function(_0x3f712e,_0x176889){return db[_0xb1b9('0x2a')][_0xb1b9('0x44')](_0x3f712e[_0xb1b9('0x45')],{})['then'](respondWithResult(_0x176889,0xc9))[_0xb1b9('0x42')](handleError(_0x176889,null));};exports[_0xb1b9('0x22')]=function(_0x480f50,_0x15cf0b){if(_0x480f50[_0xb1b9('0x45')]['id']){delete _0x480f50[_0xb1b9('0x45')]['id'];}return db[_0xb1b9('0x2a')][_0xb1b9('0x43')]({'where':{'id':_0x480f50[_0xb1b9('0x46')]['id']}})[_0xb1b9('0x23')](handleEntityNotFound(_0x15cf0b,null))['then'](saveUpdates(_0x480f50[_0xb1b9('0x45')],null))['then'](respondWithResult(_0x15cf0b,null))[_0xb1b9('0x42')](handleError(_0x15cf0b,null));};exports[_0xb1b9('0x24')]=function(_0x2cf274,_0x533885){return db[_0xb1b9('0x2a')]['find']({'where':{'id':_0x2cf274[_0xb1b9('0x46')]['id']}})[_0xb1b9('0x23')](handleEntityNotFound(_0x533885,null))[_0xb1b9('0x23')](removeEntity(_0x533885,null))[_0xb1b9('0x42')](handleError(_0x533885,null));};exports['getConfigurations']=function(_0x1c4dc5,_0x19e406,_0x1f9279){var _0xdabe4b={};var _0x125b5f={};var _0x1dad0a;var _0x23ff66;return db[_0xb1b9('0x2a')][_0xb1b9('0x47')]({'where':{'id':_0x1c4dc5[_0xb1b9('0x46')]['id']}})[_0xb1b9('0x23')](handleEntityNotFound(_0x19e406,null))[_0xb1b9('0x23')](function(_0x398bd1){if(_0x398bd1){_0x1dad0a=_0x398bd1;_0x125b5f[_0xb1b9('0x2f')]=_[_0xb1b9('0x30')](db[_0xb1b9('0x48')][_0xb1b9('0x2b')]);_0x125b5f[_0xb1b9('0x31')]=_['keys'](_0x1c4dc5['query']);_0x125b5f[_0xb1b9('0x32')]=_['intersection'](_0x125b5f['model'],_0x125b5f['query']);_0xdabe4b[_0xb1b9('0x34')]=_[_0xb1b9('0x33')](_0x125b5f[_0xb1b9('0x2f')],qs['fields'](_0x1c4dc5[_0xb1b9('0x31')][_0xb1b9('0x35')]));_0xdabe4b[_0xb1b9('0x34')]=_0xdabe4b[_0xb1b9('0x34')]['length']?_0xdabe4b[_0xb1b9('0x34')]:_0x125b5f['model'];_0xdabe4b[_0xb1b9('0x39')]=qs[_0xb1b9('0x3a')](_0x1c4dc5[_0xb1b9('0x31')][_0xb1b9('0x3a')]);_0xdabe4b['where']=qs[_0xb1b9('0x32')](_[_0xb1b9('0x49')](_0x1c4dc5['query'],_0x125b5f[_0xb1b9('0x32')]));if(_0x1c4dc5[_0xb1b9('0x31')][_0xb1b9('0x3c')]){_0xdabe4b[_0xb1b9('0x3b')]=_['merge'](_0xdabe4b['where'],{'$or':_[_0xb1b9('0x29')](_0xdabe4b[_0xb1b9('0x34')],function(_0x41077d){var _0x5c4cf5={};_0x5c4cf5[_0x41077d]={'$like':'%'+_0x1c4dc5[_0xb1b9('0x31')][_0xb1b9('0x3c')]+'%'};return _0x5c4cf5;})});}_0xdabe4b=_[_0xb1b9('0x3d')]({},_0xdabe4b,_0x1c4dc5[_0xb1b9('0x3f')]);return _0x1dad0a[_0xb1b9('0x4a')](_0xdabe4b);}})[_0xb1b9('0x23')](function(_0x54f5f4){if(_0x54f5f4){_0x23ff66=_0x54f5f4[_0xb1b9('0x36')];if(!_0x1c4dc5['query'][_0xb1b9('0x37')](_0xb1b9('0x38'))){_0xdabe4b[_0xb1b9('0x1d')]=qs[_0xb1b9('0x1d')](_0x1c4dc5[_0xb1b9('0x31')]['limit']);_0xdabe4b[_0xb1b9('0x1b')]=qs[_0xb1b9('0x1b')](_0x1c4dc5[_0xb1b9('0x31')]['offset']);}return _0x1dad0a[_0xb1b9('0x4a')](_0xdabe4b);}})[_0xb1b9('0x23')](function(_0x3650c1){if(_0x3650c1){return _0x3650c1?{'count':_0x23ff66,'rows':_0x3650c1}:null;}})[_0xb1b9('0x23')](respondWithResult(_0x19e406,null))[_0xb1b9('0x42')](handleError(_0x19e406,null));};exports['addConfiguration']=function(_0x38087b,_0x5418b3,_0x448b81){if(_0x38087b[_0xb1b9('0x45')]['id']){delete _0x38087b[_0xb1b9('0x45')]['id'];}return db[_0xb1b9('0x2a')][_0xb1b9('0x47')]({'where':{'id':_0x38087b[_0xb1b9('0x46')]['id']}})[_0xb1b9('0x23')](handleEntityNotFound(_0x5418b3,null))[_0xb1b9('0x23')](function(_0x4e0711){if(_0x4e0711){_0x38087b['body'][_0xb1b9('0x4b')]=_0x4e0711['id'];_0x38087b[_0xb1b9('0x45')]['Subjects']=integrations[_0xb1b9('0x4c')](_0x38087b['body'][_0xb1b9('0x4d')],_0x38087b[_0xb1b9('0x45')][_0xb1b9('0x2d')]);_0x38087b['body'][_0xb1b9('0x4e')]=integrations['getDescriptions'](_0x38087b[_0xb1b9('0x45')][_0xb1b9('0x4d')],_0x38087b[_0xb1b9('0x45')]['type']);return db[_0xb1b9('0x48')][_0xb1b9('0x44')](_0x38087b[_0xb1b9('0x45')],{'include':[{'model':db[_0xb1b9('0x4f')],'as':_0xb1b9('0x50')},{'model':db[_0xb1b9('0x4f')],'as':_0xb1b9('0x4e')}]});}return null;})[_0xb1b9('0x23')](respondWithResult(_0x5418b3,null))[_0xb1b9('0x42')](handleError(_0x5418b3,null));};var md5=require(_0xb1b9('0x51'));exports[_0xb1b9('0x52')]=function(_0x409a39,_0x224024,_0x65ae60){var _0xc810c6=null;var _0x18dac3=null;var _0x547e00=null;var _0xaedfa8=null;var _0x498a93='';return db['VtigerAccount'][_0xb1b9('0x47')]({'where':{'id':_0x409a39[_0xb1b9('0x46')]['id']},'attributes':['id',_0xb1b9('0x26'),_0xb1b9('0x53'),_0xb1b9('0x54'),'moduleName',_0xb1b9('0x55'),_0xb1b9('0x56'),_0xb1b9('0x57')]})[_0xb1b9('0x23')](handleEntityNotFound(_0x224024,null))['then'](function(_0x5857e8){if(_0x5857e8){_0xc810c6=_0x5857e8['username'];_0x18dac3=_0x5857e8[_0xb1b9('0x57')];_0x547e00=_0x5857e8['moduleName'];_0x498a93=_0x5857e8[_0xb1b9('0x55')];var _0x33d6c7=_0x498a93['slice'](-0x1);if(_0x33d6c7==='/'){_0x498a93=_0x498a93[_0xb1b9('0x58')](0x0,_0x498a93['lastIndexOf'](_0x33d6c7));}_0xaedfa8=util['format'](_0xb1b9('0x59'),_0x498a93);var _0x10a4f7={'method':_0xb1b9('0x5a'),'uri':_0xaedfa8,'qs':{'operation':_0xb1b9('0x5b'),'username':_0x5857e8[_0xb1b9('0x53')]},'json':!![]};return rp(_0x10a4f7);}})[_0xb1b9('0x23')](function(_0x2ba7bc){if(_0x2ba7bc[_0xb1b9('0x5c')]){var _0x3e2bd7={'method':'POST','uri':_0xaedfa8,'form':{'operation':_0xb1b9('0x5d'),'username':_0xc810c6,'accessKey':md5(_0x2ba7bc[_0xb1b9('0x5e')][_0xb1b9('0x5f')]+_0x18dac3)},'json':!![]};return rp(_0x3e2bd7);}})[_0xb1b9('0x23')](function(_0x37ab1b){if(_0x37ab1b[_0xb1b9('0x5c')]){var _0x1d2348={'method':'GET','uri':_0xaedfa8,'qs':{'operation':_0xb1b9('0x60'),'username':_0xc810c6,'sessionName':_0x37ab1b[_0xb1b9('0x5e')][_0xb1b9('0x61')],'elementType':_0x547e00},'json':!![]};return rp(_0x1d2348);}})[_0xb1b9('0x23')](function(_0x74cec2){if(_0x74cec2[_0xb1b9('0x5c')]){var _0x4c5bd5=['autogenerated',_0xb1b9('0x62'),'owner'];_[_0xb1b9('0x63')](_0x74cec2[_0xb1b9('0x5e')][_0xb1b9('0x35')],function(_0x8c9b88){return _0x4c5bd5['includes'](_0x8c9b88[_0xb1b9('0x2d')]['name']);});_['remove'](_0x74cec2[_0xb1b9('0x5e')]['fields'],function(_0x3887cd){return _0x3887cd[_0xb1b9('0x64')]===_0xb1b9('0x65');});return{'count':_0x74cec2[_0xb1b9('0x5e')]['fields']['length'],'rows':_[_0xb1b9('0x29')](_0x74cec2[_0xb1b9('0x5e')][_0xb1b9('0x35')],function(_0x375691){return{'id':_0x375691['name'],'name':_0x375691[_0xb1b9('0x66')],'custom':_['startsWith'](_0x375691['name'],_0xb1b9('0x67'))?!![]:![],'options':_0x375691[_0xb1b9('0x2d')]['name']===_0xb1b9('0x68')&&_0x375691[_0xb1b9('0x2d')]['picklistValues'][_0xb1b9('0x36')]>0x0?_['map'](_0x375691['type'][_0xb1b9('0x69')],function(_0x2caa17){return{'name':_0x2caa17[_0xb1b9('0x66')],'value':_0x2caa17[_0xb1b9('0x6a')]};}):[]};})};}})[_0xb1b9('0x23')](respondWithResult(_0x224024,null))[_0xb1b9('0x42')](function(_0x5c465d){console[_0xb1b9('0x6b')](_0xb1b9('0x6c')+_0x5c465d);var _0x574529=_0x409a39[_0xb1b9('0x31')][_0xb1b9('0x6d')]?0x1f4:_0x5c465d[_0xb1b9('0x6e')]||0x1f4;logger[_0xb1b9('0x6f')]('getFields,\x20%s,\x20%s,\x20%s',_0xb1b9('0x52'),_0x574529,JSON['stringify'](_0x5c465d));delete _0x5c465d[_0xb1b9('0x26')];if(_0x574529===0x191){_0x574529=0x190;}_0x224024['status'](_0x574529)[_0xb1b9('0x27')](_0x409a39[_0xb1b9('0x31')][_0xb1b9('0x6d')]?{'message':_0xb1b9('0x70'),'statusCode':_0x5c465d[_0xb1b9('0x6e')]}:_0x5c465d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index fdc3e65..09730a9 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 _0x4a34=['exports','define','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x541a30,_0x2006f3){var _0x157eed=function(_0x196e6a){while(--_0x196e6a){_0x541a30['push'](_0x541a30['shift']());}};_0x157eed(++_0x2006f3);}(_0x4a34,0x196));var _0x44a3=function(_0x1a357d,_0x4c24f2){_0x1a357d=_0x1a357d-0x0;var _0x1f220d=_0x4a34[_0x1a357d];return _0x1f220d;};'use strict';var _=require('lodash');var util=require(_0x44a3('0x0'));var logger=require(_0x44a3('0x1'))(_0x44a3('0x2'));var moment=require(_0x44a3('0x3'));var BPromise=require(_0x44a3('0x4'));var rp=require(_0x44a3('0x5'));var fs=require('fs');var path=require(_0x44a3('0x6'));var rimraf=require(_0x44a3('0x7'));var config=require(_0x44a3('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x44a3('0x9'));module[_0x44a3('0xa')]=function(_0x21a64c,_0x36020a){return _0x21a64c[_0x44a3('0xb')]('VtigerAccount',attributes,{'tableName':_0x44a3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc24f=['../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes'];(function(_0x5eb472,_0x426f96){var _0x2045ae=function(_0x1c1975){while(--_0x1c1975){_0x5eb472['push'](_0x5eb472['shift']());}};_0x2045ae(++_0x426f96);}(_0xc24f,0x197));var _0xfc24=function(_0x378ae8,_0x43d7da){_0x378ae8=_0x378ae8-0x0;var _0x9454ff=_0xc24f[_0x378ae8];return _0x9454ff;};'use strict';var _=require(_0xfc24('0x0'));var util=require(_0xfc24('0x1'));var logger=require(_0xfc24('0x2'))(_0xfc24('0x3'));var moment=require('moment');var BPromise=require(_0xfc24('0x4'));var rp=require(_0xfc24('0x5'));var fs=require('fs');var path=require(_0xfc24('0x6'));var rimraf=require('rimraf');var config=require(_0xfc24('0x7'));var attributes=require(_0xfc24('0x8'));var integrations=require(_0xfc24('0x9'));module[_0xfc24('0xa')]=function(_0x513232,_0x2d0532){return _0x513232['define'](_0xfc24('0xb'),attributes,{'tableName':_0xfc24('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 7146756..24efa18 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 _0x6e6c=['where','limit','include','map','attributes','model','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VtigerAccount','findAll','options','raw'];(function(_0x2da046,_0x235efb){var _0x1fa52c=function(_0x4620ce){while(--_0x4620ce){_0x2da046['push'](_0x2da046['shift']());}};_0x1fa52c(++_0x235efb);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301f55,_0x30a10b,_0x4da7bd){return new BPromise(function(_0x324706,_0x15d268){return client['request'](_0x301f55,_0x4da7bd)[_0xc6e6('0x8')](function(_0x481799){logger[_0xc6e6('0x9')](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));logger[_0xc6e6('0xc')](_0xc6e6('0xd'),_0x30a10b,_0xc6e6('0xb'),JSON[_0xc6e6('0xe')](_0x481799));if(_0x481799[_0xc6e6('0xf')]){if(_0x481799[_0xc6e6('0xf')]['code']===0x1f4){logger[_0xc6e6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x15d268(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}logger['error'](_0xc6e6('0xa'),_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x324706(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}else{logger['info'](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));_0x324706(_0x481799['result'][_0xc6e6('0x10')]);}})[_0xc6e6('0x11')](function(_0xedf127){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});}exports['GetVtigerAccount']=function(_0x3a1ccc){var _0x554262=this;return new Promise(function(_0x46e58f,_0x2069e4){return db[_0xc6e6('0x12')][_0xc6e6('0x13')]({'raw':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x15')]===undefined?!![]:![]:!![],'where':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x16')]||null:null,'attributes':_0x3a1ccc['options']?_0x3a1ccc[_0xc6e6('0x14')]['attributes']||null:null,'limit':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x17')]||null:null,'include':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc['options'][_0xc6e6('0x18')]?_[_0xc6e6('0x19')](_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x18')],function(_0x107561){return{'model':db[_0x107561['model']],'as':_0x107561['as'],'attributes':_0x107561[_0xc6e6('0x1a')],'include':_0x107561['include']?_[_0xc6e6('0x19')](_0x107561[_0xc6e6('0x18')],function(_0x2e5e0e){return{'model':db[_0x2e5e0e[_0xc6e6('0x1b')]],'as':_0x2e5e0e['as'],'attributes':_0x2e5e0e['attributes'],'include':_0x2e5e0e[_0xc6e6('0x18')]?_['map'](_0x2e5e0e[_0xc6e6('0x18')],function(_0x534745){return{'model':db[_0x534745[_0xc6e6('0x1b')]],'as':_0x534745['as'],'attributes':_0x534745[_0xc6e6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc6e6('0x8')](function(_0x41e7c2){logger[_0xc6e6('0x9')]('GetVtigerAccount',_0x3a1ccc);logger[_0xc6e6('0xc')](_0xc6e6('0x1c'),_0x3a1ccc,JSON[_0xc6e6('0xe')](_0x41e7c2));_0x46e58f(_0x41e7c2);})[_0xc6e6('0x11')](function(_0x4d1284){logger[_0xc6e6('0xf')]('GetVtigerAccount',_0x4d1284[_0xc6e6('0x10')],_0x3a1ccc);_0x2069e4(_0x554262[_0xc6e6('0xf')](0x1f4,_0x4d1284[_0xc6e6('0x10')]));});});};exports[_0xc6e6('0x1d')]=function(_0xd3b63){var _0x402598=this;return new Promise(function(_0x43ff9c,_0x337442){return db[_0xc6e6('0x12')][_0xc6e6('0x1e')]({'raw':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63[_0xc6e6('0x14')][_0xc6e6('0x15')]===undefined?!![]:![]:!![],'where':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63[_0xc6e6('0x14')][_0xc6e6('0x16')]||null:null,'attributes':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63['options'][_0xc6e6('0x1a')]||null:null,'include':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63['options']['include']?_[_0xc6e6('0x19')](_0xd3b63[_0xc6e6('0x14')][_0xc6e6('0x18')],function(_0x152e45){return{'model':db[_0x152e45[_0xc6e6('0x1b')]],'as':_0x152e45['as'],'attributes':_0x152e45[_0xc6e6('0x1a')],'include':_0x152e45['include']?_[_0xc6e6('0x19')](_0x152e45[_0xc6e6('0x18')],function(_0x1fff39){return{'model':db[_0x1fff39['model']],'as':_0x1fff39['as'],'attributes':_0x1fff39['attributes'],'include':_0x1fff39[_0xc6e6('0x18')]?_[_0xc6e6('0x19')](_0x1fff39[_0xc6e6('0x18')],function(_0x2db0a2){return{'model':db[_0x2db0a2['model']],'as':_0x2db0a2['as'],'attributes':_0x2db0a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6e6('0x8')](function(_0x4e94ea){logger[_0xc6e6('0x9')]('ShowVtigerAccount',_0xd3b63);logger[_0xc6e6('0xc')](_0xc6e6('0x1d'),_0xd3b63,JSON[_0xc6e6('0xe')](_0x4e94ea));_0x43ff9c(_0x4e94ea);})[_0xc6e6('0x11')](function(_0x58b972){logger['error'](_0xc6e6('0x1d'),_0x58b972[_0xc6e6('0x10')],_0xd3b63);_0x337442(_0x402598[_0xc6e6('0xf')](0x1f4,_0x58b972[_0xc6e6('0x10')]));});});}; \ No newline at end of file +var _0x3f8c=['jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','debug','catch','find','raw','ShowVtigerAccount','moment','bluebird','randomstring','ioredis'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x3f8c,0x104));var _0xc3f8=function(_0x478ef3,_0x27e07c){_0x478ef3=_0x478ef3-0x0;var _0x59597e=_0x3f8c[_0x478ef3];return _0x59597e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});}exports[_0xc3f8('0x12')]=function(_0x2e7c0f){var _0x35500f=this;return new Promise(function(_0xb4ab67,_0x47a185){return db[_0xc3f8('0x13')][_0xc3f8('0x14')]({'raw':_0x2e7c0f['options']?_0x2e7c0f[_0xc3f8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x16')]||null:null,'attributes':_0x2e7c0f['options']?_0x2e7c0f['options'][_0xc3f8('0x17')]||null:null,'limit':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x18')]||null:null,'include':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2e7c0f['options']['include'],function(_0x4b83f0){return{'model':db[_0x4b83f0[_0xc3f8('0x1b')]],'as':_0x4b83f0['as'],'attributes':_0x4b83f0['attributes'],'include':_0x4b83f0[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4b83f0['include'],function(_0x4569c2){return{'model':db[_0x4569c2[_0xc3f8('0x1b')]],'as':_0x4569c2['as'],'attributes':_0x4569c2[_0xc3f8('0x17')],'include':_0x4569c2[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4569c2[_0xc3f8('0x19')],function(_0xf1d460){return{'model':db[_0xf1d460[_0xc3f8('0x1b')]],'as':_0xf1d460['as'],'attributes':_0xf1d460[_0xc3f8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x22c8e6){logger[_0xc3f8('0x9')](_0xc3f8('0x12'),_0x2e7c0f);logger[_0xc3f8('0x1c')]('GetVtigerAccount',_0x2e7c0f,JSON[_0xc3f8('0xd')](_0x22c8e6));_0xb4ab67(_0x22c8e6);})[_0xc3f8('0x1d')](function(_0x218029){logger['error'](_0xc3f8('0x12'),_0x218029['message'],_0x2e7c0f);_0x47a185(_0x35500f[_0xc3f8('0xe')](0x1f4,_0x218029[_0xc3f8('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x48b32e){var _0x21a225=this;return new Promise(function(_0x25df65,_0xd32b09){return db[_0xc3f8('0x13')][_0xc3f8('0x1e')]({'raw':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x1f')]===undefined?!![]:![]:!![],'where':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['where']||null:null,'attributes':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x17')]||null:null,'include':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['include']?_['map'](_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x19')],function(_0x76ef00){return{'model':db[_0x76ef00[_0xc3f8('0x1b')]],'as':_0x76ef00['as'],'attributes':_0x76ef00[_0xc3f8('0x17')],'include':_0x76ef00['include']?_[_0xc3f8('0x1a')](_0x76ef00[_0xc3f8('0x19')],function(_0x2ba6aa){return{'model':db[_0x2ba6aa['model']],'as':_0x2ba6aa['as'],'attributes':_0x2ba6aa[_0xc3f8('0x17')],'include':_0x2ba6aa[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2ba6aa['include'],function(_0x21a725){return{'model':db[_0x21a725[_0xc3f8('0x1b')]],'as':_0x21a725['as'],'attributes':_0x21a725['attributes']};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x84d5d2){logger[_0xc3f8('0x9')](_0xc3f8('0x20'),_0x48b32e);logger[_0xc3f8('0x1c')](_0xc3f8('0x20'),_0x48b32e,JSON['stringify'](_0x84d5d2));_0x25df65(_0x84d5d2);})[_0xc3f8('0x1d')](function(_0x2e4880){logger[_0xc3f8('0xe')](_0xc3f8('0x20'),_0x2e4880[_0xc3f8('0x10')],_0x48b32e);_0xd32b09(_0x21a225['error'](0x1f4,_0x2e4880[_0xc3f8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 94e57c5..5433faa 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 _0x119e=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete'];(function(_0x33d0e9,_0x104dda){var _0x32dbf9=function(_0x29193e){while(--_0x29193e){_0x33d0e9['push'](_0x33d0e9['shift']());}};_0x32dbf9(++_0x104dda);}(_0x119e,0x115));var _0xe119=function(_0x45c63e,_0x4aa4e3){_0x45c63e=_0x45c63e-0x0;var _0x42d7c0=_0x119e[_0x45c63e];return _0x42d7c0;};'use strict';var multer=require('multer');var util=require(_0xe119('0x0'));var path=require(_0xe119('0x1'));var timeout=require('connect-timeout');var express=require(_0xe119('0x2'));var router=express[_0xe119('0x3')]();var fs_extra=require(_0xe119('0x4'));var auth=require(_0xe119('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe119('0x6'));var controller=require(_0xe119('0x7'));router[_0xe119('0x8')]('/',auth['isAuthenticated'](),controller[_0xe119('0x9')]);router['get'](_0xe119('0xa'),auth['isAuthenticated'](),controller[_0xe119('0xb')]);router[_0xe119('0x8')](_0xe119('0xc'),auth[_0xe119('0xd')](),controller[_0xe119('0xe')]);router[_0xe119('0x8')](_0xe119('0xf'),auth[_0xe119('0xd')](),controller[_0xe119('0x10')]);router['get'](_0xe119('0x11'),auth[_0xe119('0xd')](),controller[_0xe119('0x12')]);router['post']('/',auth[_0xe119('0xd')](),controller['create']);router[_0xe119('0x13')](_0xe119('0xa'),auth[_0xe119('0xd')](),controller[_0xe119('0x14')]);router[_0xe119('0x15')]('/:id',auth[_0xe119('0xd')](),controller['destroy']);module[_0xe119('0x16')]=router; \ No newline at end of file +var _0x1486=['../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3c5c3e,_0x4f6f26){var _0x4f8e4e=function(_0x4ac9c5){while(--_0x4ac9c5){_0x3c5c3e['push'](_0x3c5c3e['shift']());}};_0x4f8e4e(++_0x4f6f26);}(_0x1486,0x1dd));var _0x6148=function(_0x2040d4,_0x413148){_0x2040d4=_0x2040d4-0x0;var _0x176ee0=_0x1486[_0x2040d4];return _0x176ee0;};'use strict';var multer=require(_0x6148('0x0'));var util=require(_0x6148('0x1'));var path=require(_0x6148('0x2'));var timeout=require('connect-timeout');var express=require(_0x6148('0x3'));var router=express['Router']();var fs_extra=require(_0x6148('0x4'));var auth=require(_0x6148('0x5'));var interaction=require(_0x6148('0x6'));var config=require(_0x6148('0x7'));var controller=require(_0x6148('0x8'));router[_0x6148('0x9')]('/',auth[_0x6148('0xa')](),controller['index']);router[_0x6148('0x9')]('/:id',auth[_0x6148('0xa')](),controller[_0x6148('0xb')]);router[_0x6148('0x9')]('/:id/fields',auth[_0x6148('0xa')](),controller[_0x6148('0xc')]);router[_0x6148('0x9')](_0x6148('0xd'),auth[_0x6148('0xa')](),controller['getSubjects']);router[_0x6148('0x9')](_0x6148('0xe'),auth[_0x6148('0xa')](),controller[_0x6148('0xf')]);router[_0x6148('0x10')]('/',auth[_0x6148('0xa')](),controller[_0x6148('0x11')]);router[_0x6148('0x12')](_0x6148('0x13'),auth[_0x6148('0xa')](),controller['update']);router[_0x6148('0x14')](_0x6148('0x13'),auth[_0x6148('0xa')](),controller['destroy']);module[_0x6148('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 1cfbe6a..acf723d 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 _0xd9ae=['sequelize','exports','STRING'];(function(_0x1f8a69,_0x123ece){var _0x3fb9be=function(_0x318372){while(--_0x318372){_0x1f8a69['push'](_0x1f8a69['shift']());}};_0x3fb9be(++_0x123ece);}(_0xd9ae,0x141));var _0xed9a=function(_0x1d2748,_0x34cd7d){_0x1d2748=_0x1d2748-0x0;var _0x433356=_0xd9ae[_0x1d2748];return _0x433356;};'use strict';var Sequelize=require(_0xed9a('0x0'));module[_0xed9a('0x1')]={'name':{'type':Sequelize[_0xed9a('0x2')]},'description':{'type':Sequelize[_0xed9a('0x2')]}}; \ No newline at end of file +var _0xf41a=['STRING','sequelize','exports'];(function(_0x34944a,_0x1e947c){var _0x1f287c=function(_0x3fc658){while(--_0x3fc658){_0x34944a['push'](_0x34944a['shift']());}};_0x1f287c(++_0x1e947c);}(_0xf41a,0xc1));var _0xaf41=function(_0x1a2d37,_0x19cd85){_0x1a2d37=_0x1a2d37-0x0;var _0x4d5e76=_0xf41a[_0x1a2d37];return _0x4d5e76;};'use strict';var Sequelize=require(_0xaf41('0x0'));module[_0xaf41('0x1')]={'name':{'type':Sequelize[_0xaf41('0x2')]},'description':{'type':Sequelize[_0xaf41('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7e1598f..572569a 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 _0x8d08=['index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','catch','update','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','end','name','send'];(function(_0xff4cb1,_0x1156ea){var _0x3b6feb=function(_0x277294){while(--_0x277294){_0xff4cb1['push'](_0xff4cb1['shift']());}};_0x3b6feb(++_0x1156ea);}(_0x8d08,0x118));var _0x88d0=function(_0x1633e9,_0x50a939){_0x1633e9=_0x1633e9-0x0;var _0x549ace=_0x8d08[_0x1633e9];return _0x549ace;};'use strict';var emlformat=require(_0x88d0('0x0'));var rimraf=require(_0x88d0('0x1'));var zipdir=require(_0x88d0('0x2'));var jsonpatch=require(_0x88d0('0x3'));var rp=require(_0x88d0('0x4'));var moment=require(_0x88d0('0x5'));var BPromise=require(_0x88d0('0x6'));var Mustache=require(_0x88d0('0x7'));var util=require(_0x88d0('0x8'));var path=require(_0x88d0('0x9'));var sox=require(_0x88d0('0xa'));var csv=require(_0x88d0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88d0('0xc'));var _=require(_0x88d0('0xd'));var squel=require('squel');var crypto=require(_0x88d0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x88d0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x88d0('0x10'));var Papa=require(_0x88d0('0x11'));var Redis=require(_0x88d0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x88d0('0x13'));var as=require(_0x88d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88d0('0x15'))('api');var utils=require(_0x88d0('0x16'));var config=require(_0x88d0('0x17'));var licenseUtil=require(_0x88d0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5de471,_0x5da161){_0x5da161=_0x5da161||0xcc;return function(_0x2854a5){if(_0x2854a5){return _0x5de471[_0x88d0('0x19')](_0x5da161);}return _0x5de471[_0x88d0('0x1a')](_0x5da161)['end']();};}function respondWithResult(_0x47a572,_0x57b18e){_0x57b18e=_0x57b18e||0xc8;return function(_0x461ae6){if(_0x461ae6){return _0x47a572[_0x88d0('0x1a')](_0x57b18e)['json'](_0x461ae6);}};}function respondWithFilteredResult(_0x2bba74,_0x189ea6){return function(_0x2b3ebd){if(_0x2b3ebd){var _0x37083a=typeof _0x189ea6['offset']===_0x88d0('0x1b')&&typeof _0x189ea6[_0x88d0('0x1c')]===_0x88d0('0x1b');var _0x3fe6b8=_0x2b3ebd['count'];var _0x100727=_0x37083a?0x0:_0x189ea6[_0x88d0('0x1d')];var _0x5862d1=_0x37083a?_0x2b3ebd[_0x88d0('0x1e')]:_0x189ea6[_0x88d0('0x1d')]+_0x189ea6['limit'];var _0x1212a7;if(_0x5862d1>=_0x3fe6b8){_0x5862d1=_0x3fe6b8;_0x1212a7=0xc8;}else{_0x1212a7=0xce;}_0x2bba74['status'](_0x1212a7);return _0x2bba74[_0x88d0('0x1f')](_0x88d0('0x20'),_0x100727+'-'+_0x5862d1+'/'+_0x3fe6b8)['json'](_0x2b3ebd);}return null;};}function patchUpdates(_0x463d67){return function(_0x46aabb){try{jsonpatch[_0x88d0('0x21')](_0x46aabb,_0x463d67,!![]);}catch(_0x2c2f73){return BPromise['reject'](_0x2c2f73);}return _0x46aabb[_0x88d0('0x22')]();};}function saveUpdates(_0xbeb2f9,_0x40155e){return function(_0x4e8b5a){if(_0x4e8b5a){return _0x4e8b5a['update'](_0xbeb2f9)[_0x88d0('0x23')](function(_0x124525){return _0x124525;});}return null;};}function removeEntity(_0x5d6d85,_0x3bd137){return function(_0x2d2aac){if(_0x2d2aac){return _0x2d2aac[_0x88d0('0x24')]()[_0x88d0('0x23')](function(){_0x5d6d85[_0x88d0('0x1a')](0xcc)[_0x88d0('0x25')]();});}};}function handleEntityNotFound(_0x481a86,_0x2499a1){return function(_0x4d20ae){if(!_0x4d20ae){_0x481a86[_0x88d0('0x19')](0x194);}return _0x4d20ae;};}function handleError(_0x2b5adb,_0x1daaf1){_0x1daaf1=_0x1daaf1||0x1f4;return function(_0x3aa683){logger['error'](_0x3aa683['stack']);if(_0x3aa683[_0x88d0('0x26')]){delete _0x3aa683[_0x88d0('0x26')];}_0x2b5adb[_0x88d0('0x1a')](_0x1daaf1)[_0x88d0('0x27')](_0x3aa683);};}exports[_0x88d0('0x28')]=function(_0xa17c71,_0x32782e){var _0x5bab64={},_0x28f306={},_0x1031ce={'count':0x0,'rows':[]};var _0x39fa16=_[_0x88d0('0x29')](db[_0x88d0('0x2a')][_0x88d0('0x2b')],function(_0x2e2fa5){return{'name':_0x2e2fa5[_0x88d0('0x2c')],'type':_0x2e2fa5[_0x88d0('0x2d')][_0x88d0('0x2e')]};});_0x28f306[_0x88d0('0x2f')]=_[_0x88d0('0x29')](_0x39fa16,_0x88d0('0x26'));_0x28f306[_0x88d0('0x30')]=_['keys'](_0xa17c71[_0x88d0('0x30')]);_0x28f306[_0x88d0('0x31')]=_[_0x88d0('0x32')](_0x28f306[_0x88d0('0x2f')],_0x28f306[_0x88d0('0x30')]);_0x5bab64[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x28f306[_0x88d0('0x2f')],qs[_0x88d0('0x34')](_0xa17c71['query'][_0x88d0('0x34')]));_0x5bab64[_0x88d0('0x33')]=_0x5bab64[_0x88d0('0x33')][_0x88d0('0x35')]?_0x5bab64[_0x88d0('0x33')]:_0x28f306['model'];if(!_0xa17c71[_0x88d0('0x30')][_0x88d0('0x36')](_0x88d0('0x37'))){_0x5bab64[_0x88d0('0x1c')]=qs[_0x88d0('0x1c')](_0xa17c71[_0x88d0('0x30')][_0x88d0('0x1c')]);_0x5bab64[_0x88d0('0x1d')]=qs[_0x88d0('0x1d')](_0xa17c71[_0x88d0('0x30')][_0x88d0('0x1d')]);}_0x5bab64[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0xa17c71[_0x88d0('0x30')]['sort']);_0x5bab64[_0x88d0('0x3a')]=qs['filters'](_[_0x88d0('0x3b')](_0xa17c71['query'],_0x28f306[_0x88d0('0x31')]),_0x39fa16);if(_0xa17c71[_0x88d0('0x30')][_0x88d0('0x3c')]){_0x5bab64['where']=_[_0x88d0('0x3d')](_0x5bab64[_0x88d0('0x3a')],{'$or':_[_0x88d0('0x29')](_0x39fa16,function(_0x274028){if(_0x274028[_0x88d0('0x2d')]!=='VIRTUAL'){var _0x3f7d74={};_0x3f7d74[_0x274028[_0x88d0('0x26')]]={'$like':'%'+_0xa17c71[_0x88d0('0x30')][_0x88d0('0x3c')]+'%'};return _0x3f7d74;}})});}_0x5bab64=_[_0x88d0('0x3d')]({},_0x5bab64,_0xa17c71[_0x88d0('0x3e')]);var _0x49f906={'where':_0x5bab64[_0x88d0('0x3a')]};return db['VtigerConfiguration'][_0x88d0('0x1e')](_0x49f906)['then'](function(_0x25c2ed){_0x1031ce['count']=_0x25c2ed;if(_0xa17c71[_0x88d0('0x30')][_0x88d0('0x3f')]){_0x5bab64[_0x88d0('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x88d0('0x41')](_0x5bab64);})[_0x88d0('0x23')](function(_0xa7bccb){_0x1031ce[_0x88d0('0x42')]=_0xa7bccb;return _0x1031ce;})[_0x88d0('0x23')](respondWithFilteredResult(_0x32782e,_0x5bab64))['catch'](handleError(_0x32782e,null));};exports[_0x88d0('0x43')]=function(_0x430b1a,_0x1d07b7){var _0x18d85d={'raw':![],'where':{'id':_0x430b1a[_0x88d0('0x44')]['id']}},_0x19fcf8={};_0x19fcf8[_0x88d0('0x2f')]=_[_0x88d0('0x45')](db[_0x88d0('0x2a')][_0x88d0('0x2b')]);_0x19fcf8[_0x88d0('0x30')]=_['keys'](_0x430b1a[_0x88d0('0x30')]);_0x19fcf8['filters']=_[_0x88d0('0x32')](_0x19fcf8['model'],_0x19fcf8[_0x88d0('0x30')]);_0x18d85d[_0x88d0('0x33')]=_['intersection'](_0x19fcf8[_0x88d0('0x2f')],qs['fields'](_0x430b1a[_0x88d0('0x30')]['fields']));_0x18d85d[_0x88d0('0x33')]=_0x18d85d[_0x88d0('0x33')]['length']?_0x18d85d[_0x88d0('0x33')]:_0x19fcf8[_0x88d0('0x2f')];if(_0x430b1a['query'][_0x88d0('0x3f')]){_0x18d85d['include']=[{'all':!![]}];}_0x18d85d=_[_0x88d0('0x3d')]({},_0x18d85d,_0x430b1a['options']);return db[_0x88d0('0x2a')][_0x88d0('0x46')](_0x18d85d)[_0x88d0('0x23')](handleEntityNotFound(_0x1d07b7,null))['then'](respondWithResult(_0x1d07b7,null))['catch'](handleError(_0x1d07b7,null));};exports[_0x88d0('0x47')]=function(_0x19dd54,_0x2b7660){return db[_0x88d0('0x2a')]['create'](_0x19dd54['body'],{})[_0x88d0('0x23')](respondWithResult(_0x2b7660,0xc9))[_0x88d0('0x48')](handleError(_0x2b7660,null));};exports[_0x88d0('0x49')]=function(_0x353ecb,_0xd436d3){if(_0x353ecb[_0x88d0('0x4a')]['id']){delete _0x353ecb['body']['id'];}return db['VtigerConfiguration'][_0x88d0('0x46')]({'where':{'id':_0x353ecb['params']['id']}})[_0x88d0('0x23')](handleEntityNotFound(_0xd436d3,null))[_0x88d0('0x23')](saveUpdates(_0x353ecb[_0x88d0('0x4a')],null))['then'](respondWithResult(_0xd436d3,null))[_0x88d0('0x48')](handleError(_0xd436d3,null));};exports[_0x88d0('0x24')]=function(_0x3700b0,_0xfd9205){return db[_0x88d0('0x2a')]['find']({'where':{'id':_0x3700b0[_0x88d0('0x44')]['id']}})[_0x88d0('0x23')](handleEntityNotFound(_0xfd9205,null))[_0x88d0('0x23')](removeEntity(_0xfd9205,null))[_0x88d0('0x48')](handleError(_0xfd9205,null));};exports[_0x88d0('0x4b')]=function(_0x3e6b53,_0x3027d1,_0x315743){var _0xa5c9db={};var _0x336a34={};var _0x1bd51f;var _0x32c374;return db[_0x88d0('0x2a')][_0x88d0('0x4c')]({'where':{'id':_0x3e6b53[_0x88d0('0x44')]['id']}})['then'](handleEntityNotFound(_0x3027d1,null))['then'](function(_0x120270){if(_0x120270){_0x1bd51f=_0x120270;_0x336a34['model']=_[_0x88d0('0x45')](db[_0x88d0('0x4d')][_0x88d0('0x2b')]);_0x336a34['query']=_[_0x88d0('0x45')](_0x3e6b53[_0x88d0('0x30')]);_0x336a34[_0x88d0('0x31')]=_[_0x88d0('0x32')](_0x336a34[_0x88d0('0x2f')],_0x336a34['query']);_0xa5c9db[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x336a34[_0x88d0('0x2f')],qs['fields'](_0x3e6b53[_0x88d0('0x30')]['fields']));_0xa5c9db[_0x88d0('0x33')]=_0xa5c9db[_0x88d0('0x33')][_0x88d0('0x35')]?_0xa5c9db['attributes']:_0x336a34['model'];_0xa5c9db[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0x3e6b53['query']['sort']);_0xa5c9db['where']=qs[_0x88d0('0x31')](_[_0x88d0('0x3b')](_0x3e6b53['query'],_0x336a34['filters']));if(_0x3e6b53[_0x88d0('0x30')]['filter']){_0xa5c9db[_0x88d0('0x3a')]=_[_0x88d0('0x3d')](_0xa5c9db[_0x88d0('0x3a')],{'$or':_[_0x88d0('0x29')](_0xa5c9db[_0x88d0('0x33')],function(_0x27e048){var _0x40ec13={};_0x40ec13[_0x27e048]={'$like':'%'+_0x3e6b53[_0x88d0('0x30')][_0x88d0('0x3c')]+'%'};return _0x40ec13;})});}_0xa5c9db=_[_0x88d0('0x3d')]({},_0xa5c9db,_0x3e6b53[_0x88d0('0x3e')]);return _0x1bd51f[_0x88d0('0x4b')](_0xa5c9db);}})[_0x88d0('0x23')](function(_0xaa92f7){if(_0xaa92f7){_0x32c374=_0xaa92f7[_0x88d0('0x35')];if(!_0x3e6b53['query'][_0x88d0('0x36')]('nolimit')){_0xa5c9db[_0x88d0('0x1c')]=qs['limit'](_0x3e6b53['query'][_0x88d0('0x1c')]);_0xa5c9db[_0x88d0('0x1d')]=qs[_0x88d0('0x1d')](_0x3e6b53['query']['offset']);}return _0x1bd51f['getFields'](_0xa5c9db);}})[_0x88d0('0x23')](function(_0x95b4ac){if(_0x95b4ac){return _0x95b4ac?{'count':_0x32c374,'rows':_0x95b4ac}:null;}})['then'](respondWithResult(_0x3027d1,null))[_0x88d0('0x48')](handleError(_0x3027d1,null));};exports[_0x88d0('0x4e')]=function(_0x5d77c2,_0x2de113,_0x49da23){var _0x55d7cc={};var _0x52c9c1={};var _0x58b3a7;var _0x493c55;return db[_0x88d0('0x2a')][_0x88d0('0x4c')]({'where':{'id':_0x5d77c2[_0x88d0('0x44')]['id']}})[_0x88d0('0x23')](handleEntityNotFound(_0x2de113,null))[_0x88d0('0x23')](function(_0x11de76){if(_0x11de76){_0x58b3a7=_0x11de76;_0x52c9c1[_0x88d0('0x2f')]=_[_0x88d0('0x45')](db[_0x88d0('0x4d')][_0x88d0('0x2b')]);_0x52c9c1[_0x88d0('0x30')]=_[_0x88d0('0x45')](_0x5d77c2[_0x88d0('0x30')]);_0x52c9c1['filters']=_[_0x88d0('0x32')](_0x52c9c1['model'],_0x52c9c1[_0x88d0('0x30')]);_0x55d7cc[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x52c9c1[_0x88d0('0x2f')],qs[_0x88d0('0x34')](_0x5d77c2['query']['fields']));_0x55d7cc[_0x88d0('0x33')]=_0x55d7cc['attributes']['length']?_0x55d7cc[_0x88d0('0x33')]:_0x52c9c1['model'];_0x55d7cc[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0x5d77c2['query'][_0x88d0('0x39')]);_0x55d7cc['where']=qs[_0x88d0('0x31')](_['pick'](_0x5d77c2[_0x88d0('0x30')],_0x52c9c1[_0x88d0('0x31')]));if(_0x5d77c2[_0x88d0('0x30')]['filter']){_0x55d7cc[_0x88d0('0x3a')]=_[_0x88d0('0x3d')](_0x55d7cc[_0x88d0('0x3a')],{'$or':_['map'](_0x55d7cc['attributes'],function(_0x792de){var _0x24a10e={};_0x24a10e[_0x792de]={'$like':'%'+_0x5d77c2[_0x88d0('0x30')]['filter']+'%'};return _0x24a10e;})});}_0x55d7cc=_[_0x88d0('0x3d')]({},_0x55d7cc,_0x5d77c2[_0x88d0('0x3e')]);return _0x58b3a7['getSubjects'](_0x55d7cc);}})[_0x88d0('0x23')](function(_0x42be3c){if(_0x42be3c){_0x493c55=_0x42be3c[_0x88d0('0x35')];if(!_0x5d77c2[_0x88d0('0x30')][_0x88d0('0x36')](_0x88d0('0x37'))){_0x55d7cc[_0x88d0('0x1c')]=qs['limit'](_0x5d77c2[_0x88d0('0x30')][_0x88d0('0x1c')]);_0x55d7cc[_0x88d0('0x1d')]=qs['offset'](_0x5d77c2[_0x88d0('0x30')]['offset']);}return _0x58b3a7[_0x88d0('0x4e')](_0x55d7cc);}})[_0x88d0('0x23')](function(_0x5794ec){if(_0x5794ec){return _0x5794ec?{'count':_0x493c55,'rows':_0x5794ec}:null;}})[_0x88d0('0x23')](respondWithResult(_0x2de113,null))[_0x88d0('0x48')](handleError(_0x2de113,null));};exports['getDescriptions']=function(_0x16a54b,_0x1d57df,_0x261a45){var _0x4450fa={};var _0x48585a={};var _0x254840;var _0x5ea91a;return db[_0x88d0('0x2a')]['findOne']({'where':{'id':_0x16a54b[_0x88d0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d57df,null))[_0x88d0('0x23')](function(_0x54caaf){if(_0x54caaf){_0x254840=_0x54caaf;_0x48585a['model']=_['keys'](db[_0x88d0('0x4d')][_0x88d0('0x2b')]);_0x48585a['query']=_[_0x88d0('0x45')](_0x16a54b[_0x88d0('0x30')]);_0x48585a['filters']=_[_0x88d0('0x32')](_0x48585a['model'],_0x48585a['query']);_0x4450fa[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x48585a[_0x88d0('0x2f')],qs[_0x88d0('0x34')](_0x16a54b[_0x88d0('0x30')][_0x88d0('0x34')]));_0x4450fa['attributes']=_0x4450fa[_0x88d0('0x33')]['length']?_0x4450fa[_0x88d0('0x33')]:_0x48585a[_0x88d0('0x2f')];_0x4450fa[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0x16a54b[_0x88d0('0x30')][_0x88d0('0x39')]);_0x4450fa[_0x88d0('0x3a')]=qs[_0x88d0('0x31')](_[_0x88d0('0x3b')](_0x16a54b[_0x88d0('0x30')],_0x48585a[_0x88d0('0x31')]));if(_0x16a54b[_0x88d0('0x30')][_0x88d0('0x3c')]){_0x4450fa[_0x88d0('0x3a')]=_[_0x88d0('0x3d')](_0x4450fa['where'],{'$or':_[_0x88d0('0x29')](_0x4450fa['attributes'],function(_0x58d92d){var _0x969804={};_0x969804[_0x58d92d]={'$like':'%'+_0x16a54b[_0x88d0('0x30')][_0x88d0('0x3c')]+'%'};return _0x969804;})});}_0x4450fa=_['merge']({},_0x4450fa,_0x16a54b[_0x88d0('0x3e')]);return _0x254840['getDescriptions'](_0x4450fa);}})[_0x88d0('0x23')](function(_0x44b3d3){if(_0x44b3d3){_0x5ea91a=_0x44b3d3[_0x88d0('0x35')];if(!_0x16a54b[_0x88d0('0x30')][_0x88d0('0x36')](_0x88d0('0x37'))){_0x4450fa[_0x88d0('0x1c')]=qs[_0x88d0('0x1c')](_0x16a54b[_0x88d0('0x30')][_0x88d0('0x1c')]);_0x4450fa[_0x88d0('0x1d')]=qs[_0x88d0('0x1d')](_0x16a54b[_0x88d0('0x30')]['offset']);}return _0x254840[_0x88d0('0x4f')](_0x4450fa);}})[_0x88d0('0x23')](function(_0x4f43e2){if(_0x4f43e2){return _0x4f43e2?{'count':_0x5ea91a,'rows':_0x4f43e2}:null;}})[_0x88d0('0x23')](respondWithResult(_0x1d57df,null))[_0x88d0('0x48')](handleError(_0x1d57df,null));}; \ No newline at end of file +var _0x211a=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','pick','getFields','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x2a2849,_0x4340fa){var _0x10fc47=function(_0x5ec51c){while(--_0x5ec51c){_0x2a2849['push'](_0x2a2849['shift']());}};_0x10fc47(++_0x4340fa);}(_0x211a,0x64));var _0xa211=function(_0x49e5ff,_0x3f1460){_0x49e5ff=_0x49e5ff-0x0;var _0x211eac=_0x211a[_0x49e5ff];return _0x211eac;};'use strict';var emlformat=require(_0xa211('0x0'));var rimraf=require(_0xa211('0x1'));var zipdir=require(_0xa211('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa211('0x3'));var moment=require('moment');var BPromise=require(_0xa211('0x4'));var Mustache=require(_0xa211('0x5'));var util=require(_0xa211('0x6'));var path=require(_0xa211('0x7'));var sox=require(_0xa211('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa211('0x9'));var _=require(_0xa211('0xa'));var squel=require('squel');var crypto=require(_0xa211('0xb'));var jsforce=require(_0xa211('0xc'));var deskjs=require(_0xa211('0xd'));var toCsv=require(_0xa211('0xe'));var querystring=require('querystring');var Papa=require(_0xa211('0xf'));var Redis=require(_0xa211('0x10'));var authService=require(_0xa211('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa211('0x12'));var hardwareService=require(_0xa211('0x13'));var logger=require(_0xa211('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa211('0x15'));var db=require(_0xa211('0x16'))['db'];function respondWithStatusCode(_0x2199a5,_0x3c8937){_0x3c8937=_0x3c8937||0xcc;return function(_0x2a6918){if(_0x2a6918){return _0x2199a5['sendStatus'](_0x3c8937);}return _0x2199a5[_0xa211('0x17')](_0x3c8937)['end']();};}function respondWithResult(_0x1d1af6,_0x2abdbf){_0x2abdbf=_0x2abdbf||0xc8;return function(_0x165e08){if(_0x165e08){return _0x1d1af6[_0xa211('0x17')](_0x2abdbf)[_0xa211('0x18')](_0x165e08);}};}function respondWithFilteredResult(_0x27b2f9,_0x22c8b9){return function(_0x4e7e81){if(_0x4e7e81){var _0x5cc1a6=typeof _0x22c8b9[_0xa211('0x19')]===_0xa211('0x1a')&&typeof _0x22c8b9[_0xa211('0x1b')]===_0xa211('0x1a');var _0x41ee49=_0x4e7e81[_0xa211('0x1c')];var _0x388809=_0x5cc1a6?0x0:_0x22c8b9['offset'];var _0x5ccab8=_0x5cc1a6?_0x4e7e81[_0xa211('0x1c')]:_0x22c8b9[_0xa211('0x19')]+_0x22c8b9[_0xa211('0x1b')];var _0x5a2223;if(_0x5ccab8>=_0x41ee49){_0x5ccab8=_0x41ee49;_0x5a2223=0xc8;}else{_0x5a2223=0xce;}_0x27b2f9[_0xa211('0x17')](_0x5a2223);return _0x27b2f9[_0xa211('0x1d')](_0xa211('0x1e'),_0x388809+'-'+_0x5ccab8+'/'+_0x41ee49)[_0xa211('0x18')](_0x4e7e81);}return null;};}function patchUpdates(_0xb9d10f){return function(_0x6f5c2c){try{jsonpatch[_0xa211('0x1f')](_0x6f5c2c,_0xb9d10f,!![]);}catch(_0x4364c4){return BPromise[_0xa211('0x20')](_0x4364c4);}return _0x6f5c2c[_0xa211('0x21')]();};}function saveUpdates(_0x492817,_0x1304d7){return function(_0x1f7e39){if(_0x1f7e39){return _0x1f7e39[_0xa211('0x22')](_0x492817)[_0xa211('0x23')](function(_0x1ddeda){return _0x1ddeda;});}return null;};}function removeEntity(_0x106a87,_0x3ce919){return function(_0x4de90d){if(_0x4de90d){return _0x4de90d[_0xa211('0x24')]()['then'](function(){_0x106a87['status'](0xcc)[_0xa211('0x25')]();});}};}function handleEntityNotFound(_0x8e04ec,_0x5a65e3){return function(_0x40e61d){if(!_0x40e61d){_0x8e04ec[_0xa211('0x26')](0x194);}return _0x40e61d;};}function handleError(_0x4a8c3b,_0x47fffe){_0x47fffe=_0x47fffe||0x1f4;return function(_0x5d49f1){logger[_0xa211('0x27')](_0x5d49f1[_0xa211('0x28')]);if(_0x5d49f1[_0xa211('0x29')]){delete _0x5d49f1[_0xa211('0x29')];}_0x4a8c3b[_0xa211('0x17')](_0x47fffe)[_0xa211('0x2a')](_0x5d49f1);};}exports[_0xa211('0x2b')]=function(_0x231c49,_0x50db0c){var _0x4dd5b0={},_0x1be3e8={},_0x458fed={'count':0x0,'rows':[]};var _0x2f9b8e=_['map'](db[_0xa211('0x2c')][_0xa211('0x2d')],function(_0x46e05d){return{'name':_0x46e05d[_0xa211('0x2e')],'type':_0x46e05d[_0xa211('0x2f')][_0xa211('0x30')]};});_0x1be3e8[_0xa211('0x31')]=_[_0xa211('0x32')](_0x2f9b8e,_0xa211('0x29'));_0x1be3e8[_0xa211('0x33')]=_[_0xa211('0x34')](_0x231c49[_0xa211('0x33')]);_0x1be3e8[_0xa211('0x35')]=_[_0xa211('0x36')](_0x1be3e8[_0xa211('0x31')],_0x1be3e8['query']);_0x4dd5b0[_0xa211('0x37')]=_[_0xa211('0x36')](_0x1be3e8[_0xa211('0x31')],qs[_0xa211('0x38')](_0x231c49[_0xa211('0x33')][_0xa211('0x38')]));_0x4dd5b0['attributes']=_0x4dd5b0[_0xa211('0x37')][_0xa211('0x39')]?_0x4dd5b0[_0xa211('0x37')]:_0x1be3e8[_0xa211('0x31')];if(!_0x231c49[_0xa211('0x33')][_0xa211('0x3a')](_0xa211('0x3b'))){_0x4dd5b0[_0xa211('0x1b')]=qs[_0xa211('0x1b')](_0x231c49[_0xa211('0x33')][_0xa211('0x1b')]);_0x4dd5b0[_0xa211('0x19')]=qs[_0xa211('0x19')](_0x231c49[_0xa211('0x33')][_0xa211('0x19')]);}_0x4dd5b0[_0xa211('0x3c')]=qs['sort'](_0x231c49['query'][_0xa211('0x3d')]);_0x4dd5b0[_0xa211('0x3e')]=qs[_0xa211('0x35')](_['pick'](_0x231c49['query'],_0x1be3e8[_0xa211('0x35')]),_0x2f9b8e);if(_0x231c49[_0xa211('0x33')][_0xa211('0x3f')]){_0x4dd5b0[_0xa211('0x3e')]=_[_0xa211('0x40')](_0x4dd5b0['where'],{'$or':_['map'](_0x2f9b8e,function(_0x17e1ef){if(_0x17e1ef['type']!==_0xa211('0x41')){var _0x2edc65={};_0x2edc65[_0x17e1ef[_0xa211('0x29')]]={'$like':'%'+_0x231c49[_0xa211('0x33')][_0xa211('0x3f')]+'%'};return _0x2edc65;}})});}_0x4dd5b0=_[_0xa211('0x40')]({},_0x4dd5b0,_0x231c49[_0xa211('0x42')]);var _0x21bd7e={'where':_0x4dd5b0['where']};return db[_0xa211('0x2c')][_0xa211('0x1c')](_0x21bd7e)[_0xa211('0x23')](function(_0x56b49d){_0x458fed[_0xa211('0x1c')]=_0x56b49d;if(_0x231c49[_0xa211('0x33')][_0xa211('0x43')]){_0x4dd5b0[_0xa211('0x44')]=[{'all':!![]}];}return db[_0xa211('0x2c')][_0xa211('0x45')](_0x4dd5b0);})[_0xa211('0x23')](function(_0x570378){_0x458fed[_0xa211('0x46')]=_0x570378;return _0x458fed;})['then'](respondWithFilteredResult(_0x50db0c,_0x4dd5b0))[_0xa211('0x47')](handleError(_0x50db0c,null));};exports[_0xa211('0x48')]=function(_0x1703c9,_0x4d36ce){var _0x2c96ae={'raw':![],'where':{'id':_0x1703c9[_0xa211('0x49')]['id']}},_0x2491df={};_0x2491df[_0xa211('0x31')]=_[_0xa211('0x34')](db[_0xa211('0x2c')][_0xa211('0x2d')]);_0x2491df[_0xa211('0x33')]=_[_0xa211('0x34')](_0x1703c9[_0xa211('0x33')]);_0x2491df['filters']=_['intersection'](_0x2491df[_0xa211('0x31')],_0x2491df[_0xa211('0x33')]);_0x2c96ae['attributes']=_[_0xa211('0x36')](_0x2491df[_0xa211('0x31')],qs['fields'](_0x1703c9[_0xa211('0x33')]['fields']));_0x2c96ae[_0xa211('0x37')]=_0x2c96ae[_0xa211('0x37')][_0xa211('0x39')]?_0x2c96ae[_0xa211('0x37')]:_0x2491df[_0xa211('0x31')];if(_0x1703c9[_0xa211('0x33')][_0xa211('0x43')]){_0x2c96ae[_0xa211('0x44')]=[{'all':!![]}];}_0x2c96ae=_['merge']({},_0x2c96ae,_0x1703c9['options']);return db[_0xa211('0x2c')][_0xa211('0x4a')](_0x2c96ae)[_0xa211('0x23')](handleEntityNotFound(_0x4d36ce,null))['then'](respondWithResult(_0x4d36ce,null))['catch'](handleError(_0x4d36ce,null));};exports[_0xa211('0x4b')]=function(_0x54f812,_0x5b164c){return db[_0xa211('0x2c')][_0xa211('0x4b')](_0x54f812[_0xa211('0x4c')],{})['then'](respondWithResult(_0x5b164c,0xc9))['catch'](handleError(_0x5b164c,null));};exports[_0xa211('0x22')]=function(_0x25032c,_0x127d90){if(_0x25032c['body']['id']){delete _0x25032c[_0xa211('0x4c')]['id'];}return db['VtigerConfiguration'][_0xa211('0x4a')]({'where':{'id':_0x25032c[_0xa211('0x49')]['id']}})[_0xa211('0x23')](handleEntityNotFound(_0x127d90,null))['then'](saveUpdates(_0x25032c['body'],null))['then'](respondWithResult(_0x127d90,null))[_0xa211('0x47')](handleError(_0x127d90,null));};exports['destroy']=function(_0xf01f29,_0x4970c1){return db[_0xa211('0x2c')]['find']({'where':{'id':_0xf01f29[_0xa211('0x49')]['id']}})[_0xa211('0x23')](handleEntityNotFound(_0x4970c1,null))[_0xa211('0x23')](removeEntity(_0x4970c1,null))[_0xa211('0x47')](handleError(_0x4970c1,null));};exports['getFields']=function(_0xab622b,_0x16a5b9,_0x3a2b88){var _0x376418={};var _0x2b715e={};var _0x11d688;var _0x8c5788;return db[_0xa211('0x2c')][_0xa211('0x4d')]({'where':{'id':_0xab622b[_0xa211('0x49')]['id']}})[_0xa211('0x23')](handleEntityNotFound(_0x16a5b9,null))[_0xa211('0x23')](function(_0x339cf7){if(_0x339cf7){_0x11d688=_0x339cf7;_0x2b715e[_0xa211('0x31')]=_['keys'](db['VtigerField'][_0xa211('0x2d')]);_0x2b715e[_0xa211('0x33')]=_['keys'](_0xab622b['query']);_0x2b715e[_0xa211('0x35')]=_[_0xa211('0x36')](_0x2b715e[_0xa211('0x31')],_0x2b715e['query']);_0x376418[_0xa211('0x37')]=_[_0xa211('0x36')](_0x2b715e[_0xa211('0x31')],qs[_0xa211('0x38')](_0xab622b[_0xa211('0x33')][_0xa211('0x38')]));_0x376418[_0xa211('0x37')]=_0x376418[_0xa211('0x37')][_0xa211('0x39')]?_0x376418[_0xa211('0x37')]:_0x2b715e[_0xa211('0x31')];_0x376418[_0xa211('0x3c')]=qs[_0xa211('0x3d')](_0xab622b[_0xa211('0x33')][_0xa211('0x3d')]);_0x376418[_0xa211('0x3e')]=qs['filters'](_[_0xa211('0x4e')](_0xab622b['query'],_0x2b715e[_0xa211('0x35')]));if(_0xab622b[_0xa211('0x33')][_0xa211('0x3f')]){_0x376418['where']=_[_0xa211('0x40')](_0x376418[_0xa211('0x3e')],{'$or':_[_0xa211('0x32')](_0x376418[_0xa211('0x37')],function(_0x1cc68f){var _0x571f54={};_0x571f54[_0x1cc68f]={'$like':'%'+_0xab622b[_0xa211('0x33')][_0xa211('0x3f')]+'%'};return _0x571f54;})});}_0x376418=_['merge']({},_0x376418,_0xab622b[_0xa211('0x42')]);return _0x11d688[_0xa211('0x4f')](_0x376418);}})[_0xa211('0x23')](function(_0x5623b9){if(_0x5623b9){_0x8c5788=_0x5623b9[_0xa211('0x39')];if(!_0xab622b[_0xa211('0x33')][_0xa211('0x3a')]('nolimit')){_0x376418[_0xa211('0x1b')]=qs[_0xa211('0x1b')](_0xab622b[_0xa211('0x33')][_0xa211('0x1b')]);_0x376418[_0xa211('0x19')]=qs[_0xa211('0x19')](_0xab622b['query'][_0xa211('0x19')]);}return _0x11d688[_0xa211('0x4f')](_0x376418);}})[_0xa211('0x23')](function(_0x524333){if(_0x524333){return _0x524333?{'count':_0x8c5788,'rows':_0x524333}:null;}})['then'](respondWithResult(_0x16a5b9,null))[_0xa211('0x47')](handleError(_0x16a5b9,null));};exports[_0xa211('0x50')]=function(_0x559f60,_0x3489d5,_0x28e3b2){var _0x224279={};var _0x2c4976={};var _0x1c7f03;var _0x2d57b5;return db['VtigerConfiguration'][_0xa211('0x4d')]({'where':{'id':_0x559f60[_0xa211('0x49')]['id']}})[_0xa211('0x23')](handleEntityNotFound(_0x3489d5,null))[_0xa211('0x23')](function(_0x395a3c){if(_0x395a3c){_0x1c7f03=_0x395a3c;_0x2c4976['model']=_[_0xa211('0x34')](db[_0xa211('0x51')][_0xa211('0x2d')]);_0x2c4976[_0xa211('0x33')]=_[_0xa211('0x34')](_0x559f60['query']);_0x2c4976[_0xa211('0x35')]=_['intersection'](_0x2c4976[_0xa211('0x31')],_0x2c4976[_0xa211('0x33')]);_0x224279[_0xa211('0x37')]=_[_0xa211('0x36')](_0x2c4976[_0xa211('0x31')],qs[_0xa211('0x38')](_0x559f60[_0xa211('0x33')][_0xa211('0x38')]));_0x224279[_0xa211('0x37')]=_0x224279[_0xa211('0x37')][_0xa211('0x39')]?_0x224279[_0xa211('0x37')]:_0x2c4976[_0xa211('0x31')];_0x224279['order']=qs[_0xa211('0x3d')](_0x559f60[_0xa211('0x33')][_0xa211('0x3d')]);_0x224279['where']=qs[_0xa211('0x35')](_['pick'](_0x559f60['query'],_0x2c4976[_0xa211('0x35')]));if(_0x559f60[_0xa211('0x33')][_0xa211('0x3f')]){_0x224279[_0xa211('0x3e')]=_[_0xa211('0x40')](_0x224279[_0xa211('0x3e')],{'$or':_['map'](_0x224279[_0xa211('0x37')],function(_0x168a88){var _0x58288b={};_0x58288b[_0x168a88]={'$like':'%'+_0x559f60[_0xa211('0x33')][_0xa211('0x3f')]+'%'};return _0x58288b;})});}_0x224279=_[_0xa211('0x40')]({},_0x224279,_0x559f60['options']);return _0x1c7f03[_0xa211('0x50')](_0x224279);}})[_0xa211('0x23')](function(_0x544829){if(_0x544829){_0x2d57b5=_0x544829[_0xa211('0x39')];if(!_0x559f60['query']['hasOwnProperty'](_0xa211('0x3b'))){_0x224279[_0xa211('0x1b')]=qs[_0xa211('0x1b')](_0x559f60[_0xa211('0x33')][_0xa211('0x1b')]);_0x224279[_0xa211('0x19')]=qs['offset'](_0x559f60[_0xa211('0x33')][_0xa211('0x19')]);}return _0x1c7f03[_0xa211('0x50')](_0x224279);}})[_0xa211('0x23')](function(_0x2e1fbd){if(_0x2e1fbd){return _0x2e1fbd?{'count':_0x2d57b5,'rows':_0x2e1fbd}:null;}})['then'](respondWithResult(_0x3489d5,null))['catch'](handleError(_0x3489d5,null));};exports['getDescriptions']=function(_0x414f4c,_0x264472,_0x439bd4){var _0x5552dd={};var _0xa9a10d={};var _0x29f0fa;var _0x330383;return db[_0xa211('0x2c')][_0xa211('0x4d')]({'where':{'id':_0x414f4c[_0xa211('0x49')]['id']}})[_0xa211('0x23')](handleEntityNotFound(_0x264472,null))[_0xa211('0x23')](function(_0x24a59b){if(_0x24a59b){_0x29f0fa=_0x24a59b;_0xa9a10d[_0xa211('0x31')]=_[_0xa211('0x34')](db[_0xa211('0x51')][_0xa211('0x2d')]);_0xa9a10d[_0xa211('0x33')]=_[_0xa211('0x34')](_0x414f4c[_0xa211('0x33')]);_0xa9a10d[_0xa211('0x35')]=_[_0xa211('0x36')](_0xa9a10d['model'],_0xa9a10d[_0xa211('0x33')]);_0x5552dd[_0xa211('0x37')]=_['intersection'](_0xa9a10d[_0xa211('0x31')],qs[_0xa211('0x38')](_0x414f4c[_0xa211('0x33')][_0xa211('0x38')]));_0x5552dd['attributes']=_0x5552dd[_0xa211('0x37')][_0xa211('0x39')]?_0x5552dd[_0xa211('0x37')]:_0xa9a10d['model'];_0x5552dd[_0xa211('0x3c')]=qs[_0xa211('0x3d')](_0x414f4c[_0xa211('0x33')]['sort']);_0x5552dd['where']=qs[_0xa211('0x35')](_[_0xa211('0x4e')](_0x414f4c[_0xa211('0x33')],_0xa9a10d[_0xa211('0x35')]));if(_0x414f4c[_0xa211('0x33')][_0xa211('0x3f')]){_0x5552dd[_0xa211('0x3e')]=_[_0xa211('0x40')](_0x5552dd[_0xa211('0x3e')],{'$or':_['map'](_0x5552dd[_0xa211('0x37')],function(_0xaf00fd){var _0x482f52={};_0x482f52[_0xaf00fd]={'$like':'%'+_0x414f4c['query'][_0xa211('0x3f')]+'%'};return _0x482f52;})});}_0x5552dd=_[_0xa211('0x40')]({},_0x5552dd,_0x414f4c[_0xa211('0x42')]);return _0x29f0fa[_0xa211('0x52')](_0x5552dd);}})[_0xa211('0x23')](function(_0x29a27d){if(_0x29a27d){_0x330383=_0x29a27d[_0xa211('0x39')];if(!_0x414f4c['query'][_0xa211('0x3a')](_0xa211('0x3b'))){_0x5552dd[_0xa211('0x1b')]=qs[_0xa211('0x1b')](_0x414f4c[_0xa211('0x33')][_0xa211('0x1b')]);_0x5552dd['offset']=qs[_0xa211('0x19')](_0x414f4c[_0xa211('0x33')]['offset']);}return _0x29f0fa[_0xa211('0x52')](_0x5552dd);}})[_0xa211('0x23')](function(_0x4c09fd){if(_0x4c09fd){return _0x4c09fd?{'count':_0x330383,'rows':_0x4c09fd}:null;}})[_0xa211('0x23')](respondWithResult(_0x264472,null))[_0xa211('0x47')](handleError(_0x264472,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b9422e3..f2baaf1 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 _0x8b3f=['api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0x4724dd,_0x499243){var _0x3af2bf=function(_0x233565){while(--_0x233565){_0x4724dd['push'](_0x4724dd['shift']());}};_0x3af2bf(++_0x499243);}(_0x8b3f,0x128));var _0xf8b3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8b3f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xf8b3('0x0'));var util=require(_0xf8b3('0x1'));var logger=require(_0xf8b3('0x2'))(_0xf8b3('0x3'));var moment=require(_0xf8b3('0x4'));var BPromise=require(_0xf8b3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8b3('0x6'));var rimraf=require(_0xf8b3('0x7'));var config=require(_0xf8b3('0x8'));var attributes=require(_0xf8b3('0x9'));module[_0xf8b3('0xa')]=function(_0x195e8e,_0x1d879f){return _0x195e8e[_0xf8b3('0xb')](_0xf8b3('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x791b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','int_vtiger_configurations','lodash'];(function(_0x12d39e,_0xc9c7c7){var _0x1bd418=function(_0x1182a5){while(--_0x1182a5){_0x12d39e['push'](_0x12d39e['shift']());}};_0x1bd418(++_0xc9c7c7);}(_0x791b,0x153));var _0xb791=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x791b[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xb791('0x0'));var util=require('util');var logger=require(_0xb791('0x1'))(_0xb791('0x2'));var moment=require(_0xb791('0x3'));var BPromise=require(_0xb791('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb791('0x5'));var rimraf=require(_0xb791('0x6'));var config=require(_0xb791('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x57a392,_0x43a0d0){return _0x57a392[_0xb791('0x8')]('VtigerConfiguration',attributes,{'tableName':_0xb791('0x9'),'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 123e1ec..50977fb 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 _0xcb4a=['client','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xa53e56,_0x216856){var _0x361bd2=function(_0x592ca2){while(--_0x592ca2){_0xa53e56['push'](_0xa53e56['shift']());}};_0x361bd2(++_0x216856);}(_0xcb4a,0x182));var _0xacb4=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xcb4a[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xacb4('0x0'));var util=require(_0xacb4('0x1'));var moment=require(_0xacb4('0x2'));var BPromise=require('bluebird');var rs=require(_0xacb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacb4('0x4'))['db'];var utils=require(_0xacb4('0x5'));var logger=require(_0xacb4('0x6'))(_0xacb4('0x7'));var config=require(_0xacb4('0x8'));var jayson=require(_0xacb4('0x9'));var client=jayson[_0xacb4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c123f,_0x4a06ad,_0x5ab195){return new BPromise(function(_0x2bf325,_0x3e93c8){return client[_0xacb4('0xb')](_0x4c123f,_0x5ab195)[_0xacb4('0xc')](function(_0x4e3462){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x4a06ad,_0xacb4('0xd'));logger[_0xacb4('0xe')](_0xacb4('0xf'),_0x4a06ad,_0xacb4('0xd'),JSON['stringify'](_0x4e3462));if(_0x4e3462[_0xacb4('0x10')]){if(_0x4e3462[_0xacb4('0x10')][_0xacb4('0x11')]===0x1f4){logger[_0xacb4('0x10')](_0xacb4('0x12'),_0x4a06ad,_0x4e3462['error'][_0xacb4('0x13')]);return _0x3e93c8(_0x4e3462[_0xacb4('0x10')][_0xacb4('0x13')]);}logger[_0xacb4('0x10')](_0xacb4('0x12'),_0x4a06ad,_0x4e3462[_0xacb4('0x10')][_0xacb4('0x13')]);return _0x2bf325(_0x4e3462['error'][_0xacb4('0x13')]);}else{logger['info'](_0xacb4('0x12'),_0x4a06ad,'request\x20sent');_0x2bf325(_0x4e3462[_0xacb4('0x14')][_0xacb4('0x13')]);}})[_0xacb4('0x15')](function(_0x13c37d){logger[_0xacb4('0x10')](_0xacb4('0x12'),_0x4a06ad,_0x13c37d);_0x3e93c8(_0x13c37d);});});} \ No newline at end of file +var _0x758f=['then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','VtigerConfiguration,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x421239,_0x1dcea3){var _0x5b878c=function(_0x2717bf){while(--_0x2717bf){_0x421239['push'](_0x421239['shift']());}};_0x5b878c(++_0x1dcea3);}(_0x758f,0x83));var _0xf758=function(_0x1aa6c4,_0x1ecfc7){_0x1aa6c4=_0x1aa6c4-0x0;var _0x3a522d=_0x758f[_0x1aa6c4];return _0x3a522d;};'use strict';var _=require(_0xf758('0x0'));var util=require(_0xf758('0x1'));var moment=require(_0xf758('0x2'));var BPromise=require(_0xf758('0x3'));var rs=require(_0xf758('0x4'));var fs=require('fs');var Redis=require(_0xf758('0x5'));var db=require(_0xf758('0x6'))['db'];var utils=require(_0xf758('0x7'));var logger=require(_0xf758('0x8'))(_0xf758('0x9'));var config=require(_0xf758('0xa'));var jayson=require(_0xf758('0xb'));var client=jayson['client'][_0xf758('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2106d5,_0x393778,_0x8b48f0){return new BPromise(function(_0x5346fa,_0x182e63){return client['request'](_0x2106d5,_0x8b48f0)[_0xf758('0xd')](function(_0x47194a){logger[_0xf758('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x393778,'request\x20sent');logger[_0xf758('0xf')](_0xf758('0x10'),_0x393778,'request\x20sent',JSON['stringify'](_0x47194a));if(_0x47194a[_0xf758('0x11')]){if(_0x47194a[_0xf758('0x11')][_0xf758('0x12')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x393778,_0x47194a[_0xf758('0x11')][_0xf758('0x13')]);return _0x182e63(_0x47194a[_0xf758('0x11')][_0xf758('0x13')]);}logger[_0xf758('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x393778,_0x47194a['error'][_0xf758('0x13')]);return _0x5346fa(_0x47194a[_0xf758('0x11')]['message']);}else{logger[_0xf758('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x393778,_0xf758('0x14'));_0x5346fa(_0x47194a[_0xf758('0x15')][_0xf758('0x13')]);}})[_0xf758('0x16')](function(_0x5d912a){logger['error'](_0xf758('0x17'),_0x393778,_0x5d912a);_0x182e63(_0x5d912a);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b143577..e93e1e8 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 _0x97aa=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x2c5d55,_0x48d195){var _0x283683=function(_0x31671f){while(--_0x31671f){_0x2c5d55['push'](_0x2c5d55['shift']());}};_0x283683(++_0x48d195);}(_0x97aa,0xf0));var _0xa97a=function(_0x54803f,_0x17195a){_0x54803f=_0x54803f-0x0;var _0x42a2e2=_0x97aa[_0x54803f];return _0x42a2e2;};'use strict';var multer=require('multer');var util=require(_0xa97a('0x0'));var path=require(_0xa97a('0x1'));var timeout=require(_0xa97a('0x2'));var express=require(_0xa97a('0x3'));var router=express[_0xa97a('0x4')]();var fs_extra=require(_0xa97a('0x5'));var auth=require(_0xa97a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa97a('0x7'));var controller=require(_0xa97a('0x8'));router[_0xa97a('0x9')]('/',auth[_0xa97a('0xa')](),controller[_0xa97a('0xb')]);router[_0xa97a('0x9')](_0xa97a('0xc'),auth[_0xa97a('0xa')](),controller[_0xa97a('0xd')]);router[_0xa97a('0xe')]('/',auth[_0xa97a('0xa')](),controller[_0xa97a('0xf')]);router[_0xa97a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa97a('0x11')]);router[_0xa97a('0x12')]('/:id',auth[_0xa97a('0xa')](),controller[_0xa97a('0x13')]);module[_0xa97a('0x14')]=router; \ No newline at end of file +var _0x9c6c=['./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3b44fd,_0x1b969b){var _0x5c0cbc=function(_0x19760c){while(--_0x19760c){_0x3b44fd['push'](_0x3b44fd['shift']());}};_0x5c0cbc(++_0x1b969b);}(_0x9c6c,0x14f));var _0xc9c6=function(_0x156d6c,_0x438278){_0x156d6c=_0x156d6c-0x0;var _0x25f442=_0x9c6c[_0x156d6c];return _0x25f442;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc9c6('0x0'));var timeout=require(_0xc9c6('0x1'));var express=require(_0xc9c6('0x2'));var router=express[_0xc9c6('0x3')]();var fs_extra=require(_0xc9c6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc9c6('0x5'));var config=require(_0xc9c6('0x6'));var controller=require(_0xc9c6('0x7'));router[_0xc9c6('0x8')]('/',auth[_0xc9c6('0x9')](),controller[_0xc9c6('0xa')]);router[_0xc9c6('0x8')]('/:id',auth[_0xc9c6('0x9')](),controller[_0xc9c6('0xb')]);router[_0xc9c6('0xc')]('/',auth[_0xc9c6('0x9')](),controller[_0xc9c6('0xd')]);router[_0xc9c6('0xe')](_0xc9c6('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xc9c6('0x10')]('/:id',auth[_0xc9c6('0x9')](),controller[_0xc9c6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 163b4f4..2fa3cfa 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 _0xf243=['sequelize','exports','ENUM','variable','picklist','string','STRING','customVariable','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf243,0x10e));var _0x3f24=function(_0x4ccf96,_0x34978e){_0x4ccf96=_0x4ccf96-0x0;var _0xd103b7=_0xf243[_0x4ccf96];return _0xd103b7;};'use strict';var Sequelize=require(_0x3f24('0x0'));module[_0x3f24('0x1')]={'type':{'type':Sequelize[_0x3f24('0x2')]('string',_0x3f24('0x3'),'customVariable','keyValue',_0x3f24('0x4')),'defaultValue':_0x3f24('0x5')},'content':{'type':Sequelize[_0x3f24('0x6')]},'key':{'type':Sequelize[_0x3f24('0x6')]},'keyType':{'type':Sequelize[_0x3f24('0x2')](_0x3f24('0x5'),'variable',_0x3f24('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3f24('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3f24('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f24('0x6')]}}; \ No newline at end of file +var _0x08d3=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x5ccd1d,_0x5ef695){var _0x3e5bf0=function(_0x4cc74f){while(--_0x4cc74f){_0x5ccd1d['push'](_0x5ccd1d['shift']());}};_0x3e5bf0(++_0x5ef695);}(_0x08d3,0x110));var _0x308d=function(_0x530a7f,_0x404520){_0x530a7f=_0x530a7f-0x0;var _0x1f1869=_0x08d3[_0x530a7f];return _0x1f1869;};'use strict';var Sequelize=require('sequelize');module[_0x308d('0x0')]={'type':{'type':Sequelize[_0x308d('0x1')](_0x308d('0x2'),_0x308d('0x3'),_0x308d('0x4'),'keyValue',_0x308d('0x5')),'defaultValue':_0x308d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x308d('0x6')]},'keyType':{'type':Sequelize[_0x308d('0x1')](_0x308d('0x2'),_0x308d('0x3'),_0x308d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x308d('0x6')]},'nameField':{'type':Sequelize[_0x308d('0x6')]},'customField':{'type':Sequelize[_0x308d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x308d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b991150..933003b 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 _0xa56d=['filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','attributes','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys'];(function(_0x1a6e1c,_0x21f20f){var _0x4a8025=function(_0x152b2a){while(--_0x152b2a){_0x1a6e1c['push'](_0x1a6e1c['shift']());}};_0x4a8025(++_0x21f20f);}(_0xa56d,0x1e0));var _0xda56=function(_0x3c7056,_0x4fc530){_0x3c7056=_0x3c7056-0x0;var _0x4f9b36=_0xa56d[_0x3c7056];return _0x4f9b36;};'use strict';var emlformat=require(_0xda56('0x0'));var rimraf=require(_0xda56('0x1'));var zipdir=require(_0xda56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda56('0x4'));var util=require(_0xda56('0x5'));var path=require(_0xda56('0x6'));var sox=require(_0xda56('0x7'));var csv=require(_0xda56('0x8'));var ejs=require(_0xda56('0x9'));var fs=require('fs');var fs_extra=require(_0xda56('0xa'));var _=require(_0xda56('0xb'));var squel=require(_0xda56('0xc'));var crypto=require('crypto');var jsforce=require(_0xda56('0xd'));var deskjs=require(_0xda56('0xe'));var toCsv=require(_0xda56('0x8'));var querystring=require(_0xda56('0xf'));var Papa=require(_0xda56('0x10'));var Redis=require(_0xda56('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xda56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda56('0x13'));var logger=require(_0xda56('0x14'))(_0xda56('0x15'));var utils=require(_0xda56('0x16'));var config=require(_0xda56('0x17'));var licenseUtil=require(_0xda56('0x18'));var db=require(_0xda56('0x19'))['db'];function respondWithStatusCode(_0x393f0b,_0x4df8b7){_0x4df8b7=_0x4df8b7||0xcc;return function(_0x2823d2){if(_0x2823d2){return _0x393f0b[_0xda56('0x1a')](_0x4df8b7);}return _0x393f0b[_0xda56('0x1b')](_0x4df8b7)[_0xda56('0x1c')]();};}function respondWithResult(_0x311546,_0x5645cd){_0x5645cd=_0x5645cd||0xc8;return function(_0x3c47bd){if(_0x3c47bd){return _0x311546[_0xda56('0x1b')](_0x5645cd)[_0xda56('0x1d')](_0x3c47bd);}};}function respondWithFilteredResult(_0x39aa82,_0x3d7454){return function(_0x30a379){if(_0x30a379){var _0x1019e1=typeof _0x3d7454[_0xda56('0x1e')]==='undefined'&&typeof _0x3d7454['limit']===_0xda56('0x1f');var _0x420e22=_0x30a379[_0xda56('0x20')];var _0x4726a5=_0x1019e1?0x0:_0x3d7454[_0xda56('0x1e')];var _0xe7c6f8=_0x1019e1?_0x30a379[_0xda56('0x20')]:_0x3d7454[_0xda56('0x1e')]+_0x3d7454[_0xda56('0x21')];var _0x3dbb08;if(_0xe7c6f8>=_0x420e22){_0xe7c6f8=_0x420e22;_0x3dbb08=0xc8;}else{_0x3dbb08=0xce;}_0x39aa82[_0xda56('0x1b')](_0x3dbb08);return _0x39aa82[_0xda56('0x22')](_0xda56('0x23'),_0x4726a5+'-'+_0xe7c6f8+'/'+_0x420e22)[_0xda56('0x1d')](_0x30a379);}return null;};}function patchUpdates(_0x54e576){return function(_0x36eda8){try{jsonpatch[_0xda56('0x24')](_0x36eda8,_0x54e576,!![]);}catch(_0x1aff93){return BPromise[_0xda56('0x25')](_0x1aff93);}return _0x36eda8['save']();};}function saveUpdates(_0x4292d4,_0x3237c5){return function(_0x2dfc2e){if(_0x2dfc2e){return _0x2dfc2e[_0xda56('0x26')](_0x4292d4)['then'](function(_0x5c3f1e){return _0x5c3f1e;});}return null;};}function removeEntity(_0x4a3ea5,_0x13de4a){return function(_0x1669e2){if(_0x1669e2){return _0x1669e2[_0xda56('0x27')]()[_0xda56('0x28')](function(){_0x4a3ea5[_0xda56('0x1b')](0xcc)[_0xda56('0x1c')]();});}};}function handleEntityNotFound(_0x4670fd,_0x538783){return function(_0x1a6694){if(!_0x1a6694){_0x4670fd['sendStatus'](0x194);}return _0x1a6694;};}function handleError(_0x2a4150,_0x3755f2){_0x3755f2=_0x3755f2||0x1f4;return function(_0x1c45d8){logger['error'](_0x1c45d8[_0xda56('0x29')]);if(_0x1c45d8[_0xda56('0x2a')]){delete _0x1c45d8[_0xda56('0x2a')];}_0x2a4150[_0xda56('0x1b')](_0x3755f2)['send'](_0x1c45d8);};}exports[_0xda56('0x2b')]=function(_0x13b914,_0x5dc8f4){var _0x229927={},_0x2545bf={},_0x4cbf3c={'count':0x0,'rows':[]};var _0x111d60=_[_0xda56('0x2c')](db[_0xda56('0x2d')][_0xda56('0x2e')],function(_0x120df4){return{'name':_0x120df4[_0xda56('0x2f')],'type':_0x120df4[_0xda56('0x30')]['key']};});_0x2545bf[_0xda56('0x31')]=_[_0xda56('0x2c')](_0x111d60,_0xda56('0x2a'));_0x2545bf[_0xda56('0x32')]=_[_0xda56('0x33')](_0x13b914[_0xda56('0x32')]);_0x2545bf[_0xda56('0x34')]=_[_0xda56('0x35')](_0x2545bf[_0xda56('0x31')],_0x2545bf[_0xda56('0x32')]);_0x229927['attributes']=_[_0xda56('0x35')](_0x2545bf[_0xda56('0x31')],qs[_0xda56('0x36')](_0x13b914['query'][_0xda56('0x36')]));_0x229927['attributes']=_0x229927['attributes'][_0xda56('0x37')]?_0x229927['attributes']:_0x2545bf[_0xda56('0x31')];if(!_0x13b914[_0xda56('0x32')][_0xda56('0x38')](_0xda56('0x39'))){_0x229927[_0xda56('0x21')]=qs[_0xda56('0x21')](_0x13b914['query'][_0xda56('0x21')]);_0x229927[_0xda56('0x1e')]=qs[_0xda56('0x1e')](_0x13b914[_0xda56('0x32')][_0xda56('0x1e')]);}_0x229927[_0xda56('0x3a')]=qs['sort'](_0x13b914[_0xda56('0x32')][_0xda56('0x3b')]);_0x229927['where']=qs[_0xda56('0x34')](_[_0xda56('0x3c')](_0x13b914[_0xda56('0x32')],_0x2545bf[_0xda56('0x34')]),_0x111d60);if(_0x13b914[_0xda56('0x32')][_0xda56('0x3d')]){_0x229927[_0xda56('0x3e')]=_['merge'](_0x229927['where'],{'$or':_[_0xda56('0x2c')](_0x111d60,function(_0x3a15b1){if(_0x3a15b1[_0xda56('0x30')]!==_0xda56('0x3f')){var _0x16faae={};_0x16faae[_0x3a15b1[_0xda56('0x2a')]]={'$like':'%'+_0x13b914[_0xda56('0x32')]['filter']+'%'};return _0x16faae;}})});}_0x229927=_['merge']({},_0x229927,_0x13b914[_0xda56('0x40')]);var _0x3cf30f={'where':_0x229927[_0xda56('0x3e')]};return db[_0xda56('0x2d')]['count'](_0x3cf30f)[_0xda56('0x28')](function(_0x509bcb){_0x4cbf3c[_0xda56('0x20')]=_0x509bcb;if(_0x13b914[_0xda56('0x32')][_0xda56('0x41')]){_0x229927[_0xda56('0x42')]=[{'all':!![]}];}return db[_0xda56('0x2d')][_0xda56('0x43')](_0x229927);})[_0xda56('0x28')](function(_0x43c231){_0x4cbf3c[_0xda56('0x44')]=_0x43c231;return _0x4cbf3c;})['then'](respondWithFilteredResult(_0x5dc8f4,_0x229927))['catch'](handleError(_0x5dc8f4,null));};exports['show']=function(_0xa1faca,_0x37a1a3){var _0x10b70b={'raw':!![],'where':{'id':_0xa1faca[_0xda56('0x45')]['id']}},_0x4ae0c5={};_0x4ae0c5[_0xda56('0x31')]=_[_0xda56('0x33')](db[_0xda56('0x2d')][_0xda56('0x2e')]);_0x4ae0c5['query']=_[_0xda56('0x33')](_0xa1faca[_0xda56('0x32')]);_0x4ae0c5[_0xda56('0x34')]=_['intersection'](_0x4ae0c5[_0xda56('0x31')],_0x4ae0c5[_0xda56('0x32')]);_0x10b70b[_0xda56('0x46')]=_[_0xda56('0x35')](_0x4ae0c5[_0xda56('0x31')],qs['fields'](_0xa1faca[_0xda56('0x32')][_0xda56('0x36')]));_0x10b70b[_0xda56('0x46')]=_0x10b70b[_0xda56('0x46')][_0xda56('0x37')]?_0x10b70b['attributes']:_0x4ae0c5[_0xda56('0x31')];if(_0xa1faca['query'][_0xda56('0x41')]){_0x10b70b[_0xda56('0x42')]=[{'all':!![]}];}_0x10b70b=_[_0xda56('0x47')]({},_0x10b70b,_0xa1faca[_0xda56('0x40')]);return db[_0xda56('0x2d')][_0xda56('0x48')](_0x10b70b)['then'](handleEntityNotFound(_0x37a1a3,null))[_0xda56('0x28')](respondWithResult(_0x37a1a3,null))[_0xda56('0x49')](handleError(_0x37a1a3,null));};exports['create']=function(_0x211537,_0x24a79c){return db['VtigerField'][_0xda56('0x4a')](_0x211537['body'],{})['then'](respondWithResult(_0x24a79c,0xc9))[_0xda56('0x49')](handleError(_0x24a79c,null));};exports[_0xda56('0x26')]=function(_0x39354b,_0x574fd8){if(_0x39354b['body']['id']){delete _0x39354b['body']['id'];}return db[_0xda56('0x2d')]['find']({'where':{'id':_0x39354b['params']['id']}})[_0xda56('0x28')](handleEntityNotFound(_0x574fd8,null))['then'](saveUpdates(_0x39354b[_0xda56('0x4b')],null))[_0xda56('0x28')](respondWithResult(_0x574fd8,null))['catch'](handleError(_0x574fd8,null));};exports[_0xda56('0x27')]=function(_0x4ebb5b,_0x5e2eb1){return db[_0xda56('0x2d')][_0xda56('0x48')]({'where':{'id':_0x4ebb5b[_0xda56('0x45')]['id']}})[_0xda56('0x28')](handleEntityNotFound(_0x5e2eb1,null))['then'](removeEntity(_0x5e2eb1,null))[_0xda56('0x49')](handleError(_0x5e2eb1,null));}; \ No newline at end of file +var _0xbdf7=['query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','VtigerField','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','update','destroy','error','name','send','index','map','rawAttributes','key','model'];(function(_0x5469d8,_0x29000a){var _0x4f5f36=function(_0x52c56d){while(--_0x52c56d){_0x5469d8['push'](_0x5469d8['shift']());}};_0x4f5f36(++_0x29000a);}(_0xbdf7,0x1ec));var _0x7bdf=function(_0x41367e,_0x23ea8f){_0x41367e=_0x41367e-0x0;var _0x570087=_0xbdf7[_0x41367e];return _0x570087;};'use strict';var emlformat=require(_0x7bdf('0x0'));var rimraf=require(_0x7bdf('0x1'));var zipdir=require(_0x7bdf('0x2'));var jsonpatch=require(_0x7bdf('0x3'));var rp=require(_0x7bdf('0x4'));var moment=require('moment');var BPromise=require(_0x7bdf('0x5'));var Mustache=require(_0x7bdf('0x6'));var util=require(_0x7bdf('0x7'));var path=require(_0x7bdf('0x8'));var sox=require('sox');var csv=require(_0x7bdf('0x9'));var ejs=require(_0x7bdf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bdf('0xb'));var squel=require(_0x7bdf('0xc'));var crypto=require(_0x7bdf('0xd'));var jsforce=require(_0x7bdf('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7bdf('0xf'));var Papa=require(_0x7bdf('0x10'));var Redis=require(_0x7bdf('0x11'));var authService=require(_0x7bdf('0x12'));var qs=require(_0x7bdf('0x13'));var as=require(_0x7bdf('0x14'));var hardwareService=require(_0x7bdf('0x15'));var logger=require(_0x7bdf('0x16'))(_0x7bdf('0x17'));var utils=require(_0x7bdf('0x18'));var config=require(_0x7bdf('0x19'));var licenseUtil=require(_0x7bdf('0x1a'));var db=require(_0x7bdf('0x1b'))['db'];function respondWithStatusCode(_0x264e33,_0x36f2d2){_0x36f2d2=_0x36f2d2||0xcc;return function(_0x424e6a){if(_0x424e6a){return _0x264e33[_0x7bdf('0x1c')](_0x36f2d2);}return _0x264e33[_0x7bdf('0x1d')](_0x36f2d2)[_0x7bdf('0x1e')]();};}function respondWithResult(_0x40de19,_0x3f70cb){_0x3f70cb=_0x3f70cb||0xc8;return function(_0x45f881){if(_0x45f881){return _0x40de19['status'](_0x3f70cb)['json'](_0x45f881);}};}function respondWithFilteredResult(_0x151fd2,_0x85de5){return function(_0x4c22c3){if(_0x4c22c3){var _0x4357eb=typeof _0x85de5[_0x7bdf('0x1f')]===_0x7bdf('0x20')&&typeof _0x85de5['limit']===_0x7bdf('0x20');var _0x580744=_0x4c22c3[_0x7bdf('0x21')];var _0x36602f=_0x4357eb?0x0:_0x85de5['offset'];var _0x26a05e=_0x4357eb?_0x4c22c3[_0x7bdf('0x21')]:_0x85de5[_0x7bdf('0x1f')]+_0x85de5['limit'];var _0x28e822;if(_0x26a05e>=_0x580744){_0x26a05e=_0x580744;_0x28e822=0xc8;}else{_0x28e822=0xce;}_0x151fd2[_0x7bdf('0x1d')](_0x28e822);return _0x151fd2['set'](_0x7bdf('0x22'),_0x36602f+'-'+_0x26a05e+'/'+_0x580744)[_0x7bdf('0x23')](_0x4c22c3);}return null;};}function patchUpdates(_0x46c17e){return function(_0x38860f){try{jsonpatch[_0x7bdf('0x24')](_0x38860f,_0x46c17e,!![]);}catch(_0x38671b){return BPromise['reject'](_0x38671b);}return _0x38860f['save']();};}function saveUpdates(_0x53cf07,_0x488342){return function(_0x2d5745){if(_0x2d5745){return _0x2d5745[_0x7bdf('0x25')](_0x53cf07)['then'](function(_0x59cdf8){return _0x59cdf8;});}return null;};}function removeEntity(_0x2dafbb,_0x4512a7){return function(_0x425003){if(_0x425003){return _0x425003[_0x7bdf('0x26')]()['then'](function(){_0x2dafbb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52faa0,_0x38e193){return function(_0x987140){if(!_0x987140){_0x52faa0[_0x7bdf('0x1c')](0x194);}return _0x987140;};}function handleError(_0x2b33fa,_0x33ed40){_0x33ed40=_0x33ed40||0x1f4;return function(_0x5efb7f){logger[_0x7bdf('0x27')](_0x5efb7f['stack']);if(_0x5efb7f['name']){delete _0x5efb7f[_0x7bdf('0x28')];}_0x2b33fa[_0x7bdf('0x1d')](_0x33ed40)[_0x7bdf('0x29')](_0x5efb7f);};}exports[_0x7bdf('0x2a')]=function(_0x5a6974,_0x459e57){var _0xdd7751={},_0x5ba5d5={},_0xfb4f4b={'count':0x0,'rows':[]};var _0x25cb82=_[_0x7bdf('0x2b')](db['VtigerField'][_0x7bdf('0x2c')],function(_0x4c1bf9){return{'name':_0x4c1bf9['fieldName'],'type':_0x4c1bf9['type'][_0x7bdf('0x2d')]};});_0x5ba5d5[_0x7bdf('0x2e')]=_[_0x7bdf('0x2b')](_0x25cb82,_0x7bdf('0x28'));_0x5ba5d5[_0x7bdf('0x2f')]=_[_0x7bdf('0x30')](_0x5a6974['query']);_0x5ba5d5[_0x7bdf('0x31')]=_[_0x7bdf('0x32')](_0x5ba5d5[_0x7bdf('0x2e')],_0x5ba5d5[_0x7bdf('0x2f')]);_0xdd7751['attributes']=_[_0x7bdf('0x32')](_0x5ba5d5[_0x7bdf('0x2e')],qs['fields'](_0x5a6974[_0x7bdf('0x2f')][_0x7bdf('0x33')]));_0xdd7751[_0x7bdf('0x34')]=_0xdd7751[_0x7bdf('0x34')]['length']?_0xdd7751[_0x7bdf('0x34')]:_0x5ba5d5[_0x7bdf('0x2e')];if(!_0x5a6974[_0x7bdf('0x2f')][_0x7bdf('0x35')](_0x7bdf('0x36'))){_0xdd7751[_0x7bdf('0x37')]=qs['limit'](_0x5a6974[_0x7bdf('0x2f')][_0x7bdf('0x37')]);_0xdd7751[_0x7bdf('0x1f')]=qs[_0x7bdf('0x1f')](_0x5a6974[_0x7bdf('0x2f')][_0x7bdf('0x1f')]);}_0xdd7751[_0x7bdf('0x38')]=qs[_0x7bdf('0x39')](_0x5a6974['query'][_0x7bdf('0x39')]);_0xdd7751[_0x7bdf('0x3a')]=qs[_0x7bdf('0x31')](_[_0x7bdf('0x3b')](_0x5a6974[_0x7bdf('0x2f')],_0x5ba5d5[_0x7bdf('0x31')]),_0x25cb82);if(_0x5a6974[_0x7bdf('0x2f')][_0x7bdf('0x3c')]){_0xdd7751['where']=_[_0x7bdf('0x3d')](_0xdd7751['where'],{'$or':_[_0x7bdf('0x2b')](_0x25cb82,function(_0x875d36){if(_0x875d36[_0x7bdf('0x3e')]!==_0x7bdf('0x3f')){var _0x20e77d={};_0x20e77d[_0x875d36[_0x7bdf('0x28')]]={'$like':'%'+_0x5a6974[_0x7bdf('0x2f')][_0x7bdf('0x3c')]+'%'};return _0x20e77d;}})});}_0xdd7751=_[_0x7bdf('0x3d')]({},_0xdd7751,_0x5a6974[_0x7bdf('0x40')]);var _0x50efb4={'where':_0xdd7751[_0x7bdf('0x3a')]};return db['VtigerField'][_0x7bdf('0x21')](_0x50efb4)[_0x7bdf('0x41')](function(_0x12e0a8){_0xfb4f4b[_0x7bdf('0x21')]=_0x12e0a8;if(_0x5a6974[_0x7bdf('0x2f')][_0x7bdf('0x42')]){_0xdd7751[_0x7bdf('0x43')]=[{'all':!![]}];}return db[_0x7bdf('0x44')][_0x7bdf('0x45')](_0xdd7751);})[_0x7bdf('0x41')](function(_0x446ce0){_0xfb4f4b[_0x7bdf('0x46')]=_0x446ce0;return _0xfb4f4b;})[_0x7bdf('0x41')](respondWithFilteredResult(_0x459e57,_0xdd7751))[_0x7bdf('0x47')](handleError(_0x459e57,null));};exports[_0x7bdf('0x48')]=function(_0x4b044f,_0x43380c){var _0x5db3e3={'raw':!![],'where':{'id':_0x4b044f[_0x7bdf('0x49')]['id']}},_0x2d0037={};_0x2d0037['model']=_['keys'](db['VtigerField']['rawAttributes']);_0x2d0037['query']=_['keys'](_0x4b044f[_0x7bdf('0x2f')]);_0x2d0037[_0x7bdf('0x31')]=_[_0x7bdf('0x32')](_0x2d0037[_0x7bdf('0x2e')],_0x2d0037[_0x7bdf('0x2f')]);_0x5db3e3['attributes']=_[_0x7bdf('0x32')](_0x2d0037[_0x7bdf('0x2e')],qs['fields'](_0x4b044f[_0x7bdf('0x2f')]['fields']));_0x5db3e3[_0x7bdf('0x34')]=_0x5db3e3[_0x7bdf('0x34')]['length']?_0x5db3e3['attributes']:_0x2d0037[_0x7bdf('0x2e')];if(_0x4b044f[_0x7bdf('0x2f')]['includeAll']){_0x5db3e3[_0x7bdf('0x43')]=[{'all':!![]}];}_0x5db3e3=_['merge']({},_0x5db3e3,_0x4b044f[_0x7bdf('0x40')]);return db[_0x7bdf('0x44')][_0x7bdf('0x4a')](_0x5db3e3)[_0x7bdf('0x41')](handleEntityNotFound(_0x43380c,null))[_0x7bdf('0x41')](respondWithResult(_0x43380c,null))[_0x7bdf('0x47')](handleError(_0x43380c,null));};exports[_0x7bdf('0x4b')]=function(_0x5a7b65,_0x46c1a5){return db[_0x7bdf('0x44')][_0x7bdf('0x4b')](_0x5a7b65[_0x7bdf('0x4c')],{})[_0x7bdf('0x41')](respondWithResult(_0x46c1a5,0xc9))[_0x7bdf('0x47')](handleError(_0x46c1a5,null));};exports[_0x7bdf('0x25')]=function(_0x5f4e99,_0x5eefe5){if(_0x5f4e99['body']['id']){delete _0x5f4e99[_0x7bdf('0x4c')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x5f4e99['params']['id']}})['then'](handleEntityNotFound(_0x5eefe5,null))[_0x7bdf('0x41')](saveUpdates(_0x5f4e99['body'],null))[_0x7bdf('0x41')](respondWithResult(_0x5eefe5,null))[_0x7bdf('0x47')](handleError(_0x5eefe5,null));};exports['destroy']=function(_0xfabd27,_0x418a56){return db[_0x7bdf('0x44')][_0x7bdf('0x4a')]({'where':{'id':_0xfabd27['params']['id']}})[_0x7bdf('0x41')](handleEntityNotFound(_0x418a56,null))[_0x7bdf('0x41')](removeEntity(_0x418a56,null))[_0x7bdf('0x47')](handleError(_0x418a56,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index a51cdba..22d1ed2 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 _0xae0d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3794ab,_0xb9bf66){var _0x422ba3=function(_0xadbcbe){while(--_0xadbcbe){_0x3794ab['push'](_0x3794ab['shift']());}};_0x422ba3(++_0xb9bf66);}(_0xae0d,0x66));var _0xdae0=function(_0x113f04,_0x1ca16f){_0x113f04=_0x113f04-0x0;var _0x19892b=_0xae0d[_0x113f04];return _0x19892b;};'use strict';var _=require(_0xdae0('0x0'));var util=require(_0xdae0('0x1'));var logger=require(_0xdae0('0x2'))(_0xdae0('0x3'));var moment=require(_0xdae0('0x4'));var BPromise=require(_0xdae0('0x5'));var rp=require(_0xdae0('0x6'));var fs=require('fs');var path=require(_0xdae0('0x7'));var rimraf=require(_0xdae0('0x8'));var config=require(_0xdae0('0x9'));var attributes=require('./intVtigerField.attributes');module[_0xdae0('0xa')]=function(_0xb7662e,_0x536ec6){return _0xb7662e['define'](_0xdae0('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xdae0('0xc'),'fields':[_0xdae0('0xd'),_0xdae0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a1b=['util','../../config/logger','api','moment','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x6a1b,0x15d));var _0xb6a1=function(_0x5660d5,_0x235c27){_0x5660d5=_0x5660d5-0x0;var _0x2a144d=_0x6a1b[_0x5660d5];return _0x2a144d;};'use strict';var _=require(_0xb6a1('0x0'));var util=require(_0xb6a1('0x1'));var logger=require(_0xb6a1('0x2'))(_0xb6a1('0x3'));var moment=require(_0xb6a1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb6a1('0x5'));var config=require(_0xb6a1('0x6'));var attributes=require(_0xb6a1('0x7'));module[_0xb6a1('0x8')]=function(_0x5458c3,_0x448029){return _0x5458c3[_0xb6a1('0x9')](_0xb6a1('0xa'),attributes,{'tableName':_0xb6a1('0xb'),'paranoid':![],'indexes':[{'name':_0xb6a1('0xc'),'fields':['idField',_0xb6a1('0xd')],'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 4a3bd80..37d9b6b 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 _0x4804=['../../config/logger','rpc','jayson/promise','http','request','then','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x781950,_0x51b25d){var _0x5cdb4a=function(_0x45cdc8){while(--_0x45cdc8){_0x781950['push'](_0x781950['shift']());}};_0x5cdb4a(++_0x51b25d);}(_0x4804,0x135));var _0x4480=function(_0x10fa56,_0x1694b6){_0x10fa56=_0x10fa56-0x0;var _0x449772=_0x4804[_0x10fa56];return _0x449772;};'use strict';var _=require('lodash');var util=require(_0x4480('0x0'));var moment=require(_0x4480('0x1'));var BPromise=require('bluebird');var rs=require(_0x4480('0x2'));var fs=require('fs');var Redis=require(_0x4480('0x3'));var db=require(_0x4480('0x4'))['db'];var utils=require(_0x4480('0x5'));var logger=require(_0x4480('0x6'))(_0x4480('0x7'));var config=require('../../config/environment');var jayson=require(_0x4480('0x8'));var client=jayson['client'][_0x4480('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5617bb,_0xee3d24,_0x27c8df){return new BPromise(function(_0x584ed2,_0x2a1bb9){return client[_0x4480('0xa')](_0x5617bb,_0x27c8df)[_0x4480('0xb')](function(_0x5f0d4b){logger[_0x4480('0xc')]('VtigerField,\x20%s,\x20%s',_0xee3d24,'request\x20sent');logger[_0x4480('0xd')](_0x4480('0xe'),_0xee3d24,'request\x20sent',JSON[_0x4480('0xf')](_0x5f0d4b));if(_0x5f0d4b['error']){if(_0x5f0d4b[_0x4480('0x10')]['code']===0x1f4){logger['error'](_0x4480('0x11'),_0xee3d24,_0x5f0d4b['error'][_0x4480('0x12')]);return _0x2a1bb9(_0x5f0d4b[_0x4480('0x10')][_0x4480('0x12')]);}logger['error'](_0x4480('0x11'),_0xee3d24,_0x5f0d4b[_0x4480('0x10')][_0x4480('0x12')]);return _0x584ed2(_0x5f0d4b[_0x4480('0x10')][_0x4480('0x12')]);}else{logger[_0x4480('0xc')](_0x4480('0x11'),_0xee3d24,'request\x20sent');_0x584ed2(_0x5f0d4b[_0x4480('0x13')][_0x4480('0x12')]);}})[_0x4480('0x14')](function(_0x430aa8){logger[_0x4480('0x10')](_0x4480('0x11'),_0xee3d24,_0x430aa8);_0x2a1bb9(_0x430aa8);});});} \ No newline at end of file +var _0xed36=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','moment','bluebird','randomstring','ioredis','rpc'];(function(_0x54d3b9,_0x257828){var _0x38af1e=function(_0xed7ffa){while(--_0xed7ffa){_0x54d3b9['push'](_0x54d3b9['shift']());}};_0x38af1e(++_0x257828);}(_0xed36,0x118));var _0x6ed3=function(_0x24c4a2,_0x4a54e3){_0x24c4a2=_0x24c4a2-0x0;var _0x5758e7=_0xed36[_0x24c4a2];return _0x5758e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6ed3('0x0'));var BPromise=require(_0x6ed3('0x1'));var rs=require(_0x6ed3('0x2'));var fs=require('fs');var Redis=require(_0x6ed3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6ed3('0x4'));var config=require('../../config/environment');var jayson=require(_0x6ed3('0x5'));var client=jayson[_0x6ed3('0x6')][_0x6ed3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x273560,_0x1550fb,_0x53c6ee){return new BPromise(function(_0x1a3e93,_0x3c3d6b){return client[_0x6ed3('0x8')](_0x273560,_0x53c6ee)[_0x6ed3('0x9')](function(_0x26034f){logger[_0x6ed3('0xa')](_0x6ed3('0xb'),_0x1550fb,'request\x20sent');logger[_0x6ed3('0xc')](_0x6ed3('0xd'),_0x1550fb,'request\x20sent',JSON['stringify'](_0x26034f));if(_0x26034f[_0x6ed3('0xe')]){if(_0x26034f[_0x6ed3('0xe')][_0x6ed3('0xf')]===0x1f4){logger['error'](_0x6ed3('0xb'),_0x1550fb,_0x26034f[_0x6ed3('0xe')]['message']);return _0x3c3d6b(_0x26034f[_0x6ed3('0xe')][_0x6ed3('0x10')]);}logger['error'](_0x6ed3('0xb'),_0x1550fb,_0x26034f['error'][_0x6ed3('0x10')]);return _0x1a3e93(_0x26034f['error']['message']);}else{logger[_0x6ed3('0xa')](_0x6ed3('0xb'),_0x1550fb,_0x6ed3('0x11'));_0x1a3e93(_0x26034f['result'][_0x6ed3('0x10')]);}})[_0x6ed3('0x12')](function(_0x5dee25){logger[_0x6ed3('0xe')](_0x6ed3('0xb'),_0x1550fb,_0x5dee25);_0x3c3d6b(_0x5dee25);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 0e0f214..49d0165 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 _0xdadf=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0xdadf,0xc7));var _0xfdad=function(_0x29a9d8,_0x19a0d5){_0x29a9d8=_0x29a9d8-0x0;var _0x51cfea=_0xdadf[_0x29a9d8];return _0x51cfea;};'use strict';var multer=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var path=require(_0xfdad('0x2'));var timeout=require(_0xfdad('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfdad('0x4'));var auth=require(_0xfdad('0x5'));var interaction=require(_0xfdad('0x6'));var config=require(_0xfdad('0x7'));var controller=require(_0xfdad('0x8'));router[_0xfdad('0x9')]('/',auth[_0xfdad('0xa')](),controller[_0xfdad('0xb')]);router[_0xfdad('0x9')](_0xfdad('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfdad('0x9')](_0xfdad('0xd'),auth[_0xfdad('0xa')](),controller[_0xfdad('0xe')]);router['get'](_0xfdad('0xf'),auth['isAuthenticated'](),controller[_0xfdad('0x10')]);router[_0xfdad('0x11')]('/',auth[_0xfdad('0xa')](),controller['create']);router[_0xfdad('0x11')](_0xfdad('0xd'),auth[_0xfdad('0xa')](),controller[_0xfdad('0x12')]);router[_0xfdad('0x13')](_0xfdad('0xc'),auth[_0xfdad('0xa')](),controller['update']);router[_0xfdad('0x14')]('/:id',auth[_0xfdad('0xa')](),controller['destroy']);module[_0xfdad('0x15')]=router; \ No newline at end of file +var _0xf539=['/:id/fields','getFields','post','create','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations'];(function(_0x30ff38,_0x2c8756){var _0x3d950a=function(_0x2280f0){while(--_0x2280f0){_0x30ff38['push'](_0x30ff38['shift']());}};_0x3d950a(++_0x2c8756);}(_0xf539,0x180));var _0x9f53=function(_0x2ab10e,_0x3937f3){_0x2ab10e=_0x2ab10e-0x0;var _0x286704=_0xf539[_0x2ab10e];return _0x286704;};'use strict';var multer=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var path=require(_0x9f53('0x2'));var timeout=require(_0x9f53('0x3'));var express=require('express');var router=express[_0x9f53('0x4')]();var fs_extra=require(_0x9f53('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9f53('0x6'));var config=require(_0x9f53('0x7'));var controller=require(_0x9f53('0x8'));router['get']('/',auth[_0x9f53('0x9')](),controller[_0x9f53('0xa')]);router[_0x9f53('0xb')](_0x9f53('0xc'),auth[_0x9f53('0x9')](),controller[_0x9f53('0xd')]);router[_0x9f53('0xb')]('/:id/configurations',auth[_0x9f53('0x9')](),controller[_0x9f53('0xe')]);router[_0x9f53('0xb')](_0x9f53('0xf'),auth[_0x9f53('0x9')](),controller[_0x9f53('0x10')]);router[_0x9f53('0x11')]('/',auth[_0x9f53('0x9')](),controller[_0x9f53('0x12')]);router['post']('/:id/configurations',auth[_0x9f53('0x9')](),controller['addConfiguration']);router[_0x9f53('0x13')]('/:id',auth[_0x9f53('0x9')](),controller['update']);router[_0x9f53('0x14')](_0x9f53('0xc'),auth[_0x9f53('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b0d1fc4..d3b670a 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 _0x363e=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x49564e,_0x2c09b9){var _0xff2ac7=function(_0x13df1a){while(--_0x13df1a){_0x49564e['push'](_0x49564e['shift']());}};_0xff2ac7(++_0x2c09b9);}(_0x363e,0x179));var _0xe363=function(_0x4fa681,_0x2ab2cf){_0x4fa681=_0x4fa681-0x0;var _0x49491f=_0x363e[_0x4fa681];return _0x49491f;};'use strict';var Sequelize=require(_0xe363('0x0'));module[_0xe363('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe363('0x2')]},'username':{'type':Sequelize[_0xe363('0x2')],'unique':_0xe363('0x3')},'password':{'type':Sequelize[_0xe363('0x2')]},'token':{'type':Sequelize[_0xe363('0x2')]},'remoteUri':{'type':Sequelize[_0xe363('0x2')],'unique':_0xe363('0x4')},'authType':{'type':Sequelize[_0xe363('0x5')](_0xe363('0x6'),_0xe363('0x7')),'defaultValue':_0xe363('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe363('0x5')](_0xe363('0x8'),_0xe363('0x9')),'defaultValue':_0xe363('0x8')}}; \ No newline at end of file +var _0xef4d=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xef4d,0x165));var _0xdef4=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xef4d[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0xdef4('0x0'));module[_0xdef4('0x1')]={'name':{'type':Sequelize[_0xdef4('0x2')]},'description':{'type':Sequelize[_0xdef4('0x2')]},'username':{'type':Sequelize[_0xdef4('0x2')],'unique':_0xdef4('0x3')},'password':{'type':Sequelize[_0xdef4('0x2')]},'token':{'type':Sequelize[_0xdef4('0x2')]},'remoteUri':{'type':Sequelize[_0xdef4('0x2')],'unique':_0xdef4('0x4')},'authType':{'type':Sequelize[_0xdef4('0x5')](_0xdef4('0x6'),_0xdef4('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xdef4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdef4('0x5')](_0xdef4('0x8'),_0xdef4('0x9')),'defaultValue':_0xdef4('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 06aa9b0..dcf89ac 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 _0x7af2=['pick','VIRTUAL','filter','merge','options','includeAll','findAll','params','rawAttributes','include','catch','create','body','find','getConfigurations','findOne','ZendeskConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters'];(function(_0x2f2b25,_0x23b207){var _0x2a89f7=function(_0x399880){while(--_0x399880){_0x2f2b25['push'](_0x2f2b25['shift']());}};_0x2a89f7(++_0x23b207);}(_0x7af2,0x119));var _0x27af=function(_0x399a24,_0x39a2f6){_0x399a24=_0x399a24-0x0;var _0x3b8763=_0x7af2[_0x399a24];return _0x3b8763;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x406340,_0x203501){_0x203501=_0x203501||0xcc;return function(_0x1fd964){if(_0x1fd964){return _0x406340[_0x27af('0x17')](_0x203501);}return _0x406340[_0x27af('0x18')](_0x203501)[_0x27af('0x19')]();};}function respondWithResult(_0x234825,_0x3da435){_0x3da435=_0x3da435||0xc8;return function(_0x423222){if(_0x423222){return _0x234825[_0x27af('0x18')](_0x3da435)[_0x27af('0x1a')](_0x423222);}};}function respondWithFilteredResult(_0x9c2d4b,_0x2d7800){return function(_0x3102c4){if(_0x3102c4){var _0x2bfc9=typeof _0x2d7800[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x2d7800[_0x27af('0x1d')]==='undefined';var _0x315661=_0x3102c4[_0x27af('0x1e')];var _0x5997ae=_0x2bfc9?0x0:_0x2d7800['offset'];var _0x20a6d7=_0x2bfc9?_0x3102c4[_0x27af('0x1e')]:_0x2d7800[_0x27af('0x1b')]+_0x2d7800[_0x27af('0x1d')];var _0xec699a;if(_0x20a6d7>=_0x315661){_0x20a6d7=_0x315661;_0xec699a=0xc8;}else{_0xec699a=0xce;}_0x9c2d4b['status'](_0xec699a);return _0x9c2d4b[_0x27af('0x1f')](_0x27af('0x20'),_0x5997ae+'-'+_0x20a6d7+'/'+_0x315661)[_0x27af('0x1a')](_0x3102c4);}return null;};}function patchUpdates(_0x5e7c19){return function(_0x19afb1){try{jsonpatch[_0x27af('0x21')](_0x19afb1,_0x5e7c19,!![]);}catch(_0x2ae47e){return BPromise['reject'](_0x2ae47e);}return _0x19afb1[_0x27af('0x22')]();};}function saveUpdates(_0x2460f4,_0x30720b){return function(_0x2af76d){if(_0x2af76d){return _0x2af76d[_0x27af('0x23')](_0x2460f4)[_0x27af('0x24')](function(_0x43dd9e){return _0x43dd9e;});}return null;};}function removeEntity(_0x35b36d,_0x2e1bb0){return function(_0x49780b){if(_0x49780b){return _0x49780b['destroy']()['then'](function(){_0x35b36d[_0x27af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12625c,_0x396326){return function(_0x4ba49f){if(!_0x4ba49f){_0x12625c[_0x27af('0x17')](0x194);}return _0x4ba49f;};}function handleError(_0x1d9341,_0x463e36){_0x463e36=_0x463e36||0x1f4;return function(_0x424490){logger[_0x27af('0x25')](_0x424490[_0x27af('0x26')]);if(_0x424490[_0x27af('0x27')]){delete _0x424490['name'];}_0x1d9341[_0x27af('0x18')](_0x463e36)[_0x27af('0x28')](_0x424490);};}exports[_0x27af('0x29')]=function(_0xe009a,_0x25d65a){var _0xa08dd9={},_0x42a5b7={},_0x2b26ac={'count':0x0,'rows':[]};var _0x4406e2=_[_0x27af('0x2a')](db[_0x27af('0x2b')]['rawAttributes'],function(_0x15e867){return{'name':_0x15e867[_0x27af('0x2c')],'type':_0x15e867[_0x27af('0x2d')][_0x27af('0x2e')]};});_0x42a5b7[_0x27af('0x2f')]=_[_0x27af('0x2a')](_0x4406e2,'name');_0x42a5b7['query']=_[_0x27af('0x30')](_0xe009a[_0x27af('0x31')]);_0x42a5b7['filters']=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],_0x42a5b7[_0x27af('0x31')]);_0xa08dd9[_0x27af('0x33')]=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xe009a[_0x27af('0x31')][_0x27af('0x34')]));_0xa08dd9[_0x27af('0x33')]=_0xa08dd9[_0x27af('0x33')]['length']?_0xa08dd9['attributes']:_0x42a5b7[_0x27af('0x2f')];if(!_0xe009a[_0x27af('0x31')]['hasOwnProperty'](_0x27af('0x35'))){_0xa08dd9[_0x27af('0x1d')]=qs['limit'](_0xe009a[_0x27af('0x31')][_0x27af('0x1d')]);_0xa08dd9[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xe009a[_0x27af('0x31')]['offset']);}_0xa08dd9[_0x27af('0x36')]=qs[_0x27af('0x37')](_0xe009a['query']['sort']);_0xa08dd9[_0x27af('0x38')]=qs[_0x27af('0x39')](_[_0x27af('0x3a')](_0xe009a[_0x27af('0x31')],_0x42a5b7[_0x27af('0x39')]),_0x4406e2);if(_0xe009a[_0x27af('0x31')]['filter']){_0xa08dd9[_0x27af('0x38')]=_['merge'](_0xa08dd9[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x4406e2,function(_0x2a6b14){if(_0x2a6b14[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x5f5504={};_0x5f5504[_0x2a6b14[_0x27af('0x27')]]={'$like':'%'+_0xe009a[_0x27af('0x31')][_0x27af('0x3c')]+'%'};return _0x5f5504;}})});}_0xa08dd9=_[_0x27af('0x3d')]({},_0xa08dd9,_0xe009a[_0x27af('0x3e')]);var _0x32b558={'where':_0xa08dd9[_0x27af('0x38')]};return db[_0x27af('0x2b')][_0x27af('0x1e')](_0x32b558)[_0x27af('0x24')](function(_0xda424e){_0x2b26ac[_0x27af('0x1e')]=_0xda424e;if(_0xe009a[_0x27af('0x31')][_0x27af('0x3f')]){_0xa08dd9['include']=[{'all':!![]}];}return db[_0x27af('0x2b')][_0x27af('0x40')](_0xa08dd9);})[_0x27af('0x24')](function(_0x373c05){_0x2b26ac['rows']=_0x373c05;return _0x2b26ac;})[_0x27af('0x24')](respondWithFilteredResult(_0x25d65a,_0xa08dd9))['catch'](handleError(_0x25d65a,null));};exports['show']=function(_0x2425dd,_0x3c9c81){var _0x279f99={'raw':![],'where':{'id':_0x2425dd[_0x27af('0x41')]['id']}},_0x17efd6={};_0x17efd6[_0x27af('0x2f')]=_[_0x27af('0x30')](db[_0x27af('0x2b')][_0x27af('0x42')]);_0x17efd6[_0x27af('0x31')]=_[_0x27af('0x30')](_0x2425dd[_0x27af('0x31')]);_0x17efd6['filters']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],_0x17efd6['query']);_0x279f99['attributes']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x2425dd[_0x27af('0x31')][_0x27af('0x34')]));_0x279f99['attributes']=_0x279f99[_0x27af('0x33')]['length']?_0x279f99[_0x27af('0x33')]:_0x17efd6[_0x27af('0x2f')];if(_0x2425dd[_0x27af('0x31')][_0x27af('0x3f')]){_0x279f99[_0x27af('0x43')]=[{'all':!![]}];}_0x279f99=_[_0x27af('0x3d')]({},_0x279f99,_0x2425dd[_0x27af('0x3e')]);return db['ZendeskAccount']['find'](_0x279f99)[_0x27af('0x24')](handleEntityNotFound(_0x3c9c81,null))['then'](respondWithResult(_0x3c9c81,null))[_0x27af('0x44')](handleError(_0x3c9c81,null));};exports[_0x27af('0x45')]=function(_0x226025,_0x389962){return db[_0x27af('0x2b')][_0x27af('0x45')](_0x226025[_0x27af('0x46')],{})['then'](respondWithResult(_0x389962,0xc9))[_0x27af('0x44')](handleError(_0x389962,null));};exports[_0x27af('0x23')]=function(_0x20e180,_0x3fdc0e){if(_0x20e180[_0x27af('0x46')]['id']){delete _0x20e180['body']['id'];}return db[_0x27af('0x2b')][_0x27af('0x47')]({'where':{'id':_0x20e180[_0x27af('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fdc0e,null))['then'](saveUpdates(_0x20e180[_0x27af('0x46')],null))[_0x27af('0x24')](respondWithResult(_0x3fdc0e,null))[_0x27af('0x44')](handleError(_0x3fdc0e,null));};exports['destroy']=function(_0x495794,_0x2fad23){return db['ZendeskAccount'][_0x27af('0x47')]({'where':{'id':_0x495794[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2fad23,null))[_0x27af('0x24')](removeEntity(_0x2fad23,null))[_0x27af('0x44')](handleError(_0x2fad23,null));};exports[_0x27af('0x48')]=function(_0x123533,_0x374794,_0x1b6d94){var _0x24d8bf={};var _0x23369a={};var _0x5c02c1;var _0x76ed78;return db[_0x27af('0x2b')][_0x27af('0x49')]({'where':{'id':_0x123533[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x374794,null))[_0x27af('0x24')](function(_0x20c155){if(_0x20c155){_0x5c02c1=_0x20c155;_0x23369a[_0x27af('0x2f')]=_['keys'](db[_0x27af('0x4a')]['rawAttributes']);_0x23369a[_0x27af('0x31')]=_[_0x27af('0x30')](_0x123533[_0x27af('0x31')]);_0x23369a['filters']=_[_0x27af('0x32')](_0x23369a['model'],_0x23369a[_0x27af('0x31')]);_0x24d8bf[_0x27af('0x33')]=_[_0x27af('0x32')](_0x23369a['model'],qs[_0x27af('0x34')](_0x123533['query'][_0x27af('0x34')]));_0x24d8bf['attributes']=_0x24d8bf[_0x27af('0x33')][_0x27af('0x4b')]?_0x24d8bf[_0x27af('0x33')]:_0x23369a['model'];_0x24d8bf['order']=qs[_0x27af('0x37')](_0x123533[_0x27af('0x31')][_0x27af('0x37')]);_0x24d8bf[_0x27af('0x38')]=qs['filters'](_[_0x27af('0x3a')](_0x123533[_0x27af('0x31')],_0x23369a[_0x27af('0x39')]));if(_0x123533[_0x27af('0x31')][_0x27af('0x3c')]){_0x24d8bf[_0x27af('0x38')]=_['merge'](_0x24d8bf[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x24d8bf[_0x27af('0x33')],function(_0x2401c7){var _0x49eb46={};_0x49eb46[_0x2401c7]={'$like':'%'+_0x123533[_0x27af('0x31')]['filter']+'%'};return _0x49eb46;})});}_0x24d8bf=_[_0x27af('0x3d')]({},_0x24d8bf,_0x123533[_0x27af('0x3e')]);return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x13a5a8){if(_0x13a5a8){_0x76ed78=_0x13a5a8['length'];if(!_0x123533['query'][_0x27af('0x4c')](_0x27af('0x35'))){_0x24d8bf[_0x27af('0x1d')]=qs['limit'](_0x123533[_0x27af('0x31')][_0x27af('0x1d')]);_0x24d8bf['offset']=qs[_0x27af('0x1b')](_0x123533[_0x27af('0x31')]['offset']);}return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x1fa50b){if(_0x1fa50b){return _0x1fa50b?{'count':_0x76ed78,'rows':_0x1fa50b}:null;}})['then'](respondWithResult(_0x374794,null))['catch'](handleError(_0x374794,null));};exports[_0x27af('0x4d')]=function(_0xf97695,_0x2a8534,_0x266220){if(_0xf97695[_0x27af('0x46')]['id']){delete _0xf97695[_0x27af('0x46')]['id'];}return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0xf97695['params']['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2a8534,null))[_0x27af('0x24')](function(_0xa692f6){if(_0xa692f6){_0xf97695[_0x27af('0x46')][_0x27af('0x4e')]=_0xa692f6['id'];_0xf97695[_0x27af('0x46')][_0x27af('0x4f')]=integrations[_0x27af('0x50')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695[_0x27af('0x46')][_0x27af('0x2d')]);_0xf97695[_0x27af('0x46')][_0x27af('0x52')]=integrations[_0x27af('0x53')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695['body'][_0x27af('0x2d')]);return db[_0x27af('0x4a')]['create'](_0xf97695[_0x27af('0x46')],{'include':[{'model':db[_0x27af('0x54')],'as':_0x27af('0x4f')},{'model':db[_0x27af('0x54')],'as':_0x27af('0x52')}]});}return null;})[_0x27af('0x24')](respondWithResult(_0x2a8534,null))['catch'](handleError(_0x2a8534,null));};exports[_0x27af('0x55')]=function(_0x31a595,_0x3a2958,_0x4ab463){var _0x5d7af4='';return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0x31a595[_0x27af('0x41')]['id']},'attributes':['id',_0x27af('0x56'),_0x27af('0x57'),_0x27af('0x58'),_0x27af('0x59'),'remoteUri']})[_0x27af('0x24')](handleEntityNotFound(_0x3a2958,null))[_0x27af('0x24')](function(_0x4ac2a3){if(_0x4ac2a3){_0x5d7af4=_0x4ac2a3[_0x27af('0x5a')];var _0xc0a98c=_0x5d7af4['slice'](-0x1);if(_0xc0a98c==='/'){_0x5d7af4=_0x5d7af4['substring'](0x0,_0x5d7af4[_0x27af('0x5b')](_0xc0a98c));}var _0x287f7c={'method':_0x27af('0x5c'),'uri':util[_0x27af('0x5d')](_0x27af('0x5e'),_0x5d7af4,_0x27af('0x5f')),'json':!![]};switch(_0x4ac2a3[_0x27af('0x59')]){case'password':_0x287f7c[_0x27af('0x60')]={'Authorization':util[_0x27af('0x5d')](_0x27af('0x61'),new Buffer(util[_0x27af('0x5d')]('%s:%s',_0x4ac2a3['username'],_0x4ac2a3[_0x27af('0x57')]))[_0x27af('0x62')](_0x27af('0x63')))};break;case _0x27af('0x58'):_0x287f7c['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x27af('0x5d')](_0x27af('0x64'),_0x4ac2a3[_0x27af('0x56')],_0x4ac2a3[_0x27af('0x58')]))[_0x27af('0x62')](_0x27af('0x63')))};break;default:throw new db['Sequelize']['ValidationError'](_0x27af('0x65'));}return rp(_0x287f7c);}})[_0x27af('0x24')](function(_0x55637f){if(_0x55637f){var _0x2c3d30=['subject','description',_0x27af('0x66'),_0x27af('0x67')];_[_0x27af('0x68')](_0x55637f[_0x27af('0x5f')],function(_0x2b7e18){return _0x2c3d30[_0x27af('0x69')](_0x2b7e18[_0x27af('0x2d')]);});return{'count':_0x55637f[_0x27af('0x5f')][_0x27af('0x4b')],'rows':_[_0x27af('0x2a')](_0x55637f[_0x27af('0x5f')],function(_0x4dd124){return{'id':_0x4dd124['id'],'name':_0x4dd124[_0x27af('0x6a')]>0x7?_0x4dd124[_0x27af('0x6b')]:_0x4dd124[_0x27af('0x2d')],'custom':_0x4dd124['position']>0x7?!![]:![],'options':_0x4dd124[_0x27af('0x6c')]?_0x4dd124[_0x27af('0x6c')]:_0x4dd124[_0x27af('0x6d')]?_0x4dd124['custom_field_options']:[]};})};}})[_0x27af('0x24')](respondWithResult(_0x3a2958,null))['catch'](function(_0x118d06){var _0x9350fa=_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?0x1f4:_0x118d06[_0x27af('0x6f')]||0x1f4;logger[_0x27af('0x25')](_0x27af('0x70'),_0x27af('0x55'),_0x9350fa,JSON['stringify'](_0x118d06));delete _0x118d06[_0x27af('0x27')];if(_0x9350fa===0x191){_0x9350fa=0x190;}_0x3a2958['status'](_0x9350fa)[_0x27af('0x28')](_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x118d06['statusCode']}:_0x118d06);});}; \ No newline at end of file +var _0x0bb5=['offset','limit','undefined','count','set','json','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','authType','remoteUri','substring','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x17d165,_0x275007){var _0xe19dd0=function(_0x195a73){while(--_0x195a73){_0x17d165['push'](_0x17d165['shift']());}};_0xe19dd0(++_0x275007);}(_0x0bb5,0x148));var _0x50bb=function(_0x27b730,_0x39ae1d){_0x27b730=_0x27b730-0x0;var _0x44f9ed=_0x0bb5[_0x27b730];return _0x44f9ed;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x50bb('0x19'));function respondWithStatusCode(_0x58837d,_0x283f04){_0x283f04=_0x283f04||0xcc;return function(_0xd8ab27){if(_0xd8ab27){return _0x58837d[_0x50bb('0x1a')](_0x283f04);}return _0x58837d['status'](_0x283f04)[_0x50bb('0x1b')]();};}function respondWithResult(_0x309986,_0x3094f2){_0x3094f2=_0x3094f2||0xc8;return function(_0x5244b0){if(_0x5244b0){return _0x309986[_0x50bb('0x1c')](_0x3094f2)['json'](_0x5244b0);}};}function respondWithFilteredResult(_0x21befa,_0x3e1a51){return function(_0x253073){if(_0x253073){var _0x42ffab=typeof _0x3e1a51[_0x50bb('0x1d')]==='undefined'&&typeof _0x3e1a51[_0x50bb('0x1e')]===_0x50bb('0x1f');var _0x4b1f5f=_0x253073[_0x50bb('0x20')];var _0x4796ec=_0x42ffab?0x0:_0x3e1a51[_0x50bb('0x1d')];var _0x431ed4=_0x42ffab?_0x253073['count']:_0x3e1a51['offset']+_0x3e1a51[_0x50bb('0x1e')];var _0x1499dc;if(_0x431ed4>=_0x4b1f5f){_0x431ed4=_0x4b1f5f;_0x1499dc=0xc8;}else{_0x1499dc=0xce;}_0x21befa[_0x50bb('0x1c')](_0x1499dc);return _0x21befa[_0x50bb('0x21')]('Content-Range',_0x4796ec+'-'+_0x431ed4+'/'+_0x4b1f5f)[_0x50bb('0x22')](_0x253073);}return null;};}function patchUpdates(_0x32bfc3){return function(_0x4020a0){try{jsonpatch['apply'](_0x4020a0,_0x32bfc3,!![]);}catch(_0x3104c8){return BPromise[_0x50bb('0x23')](_0x3104c8);}return _0x4020a0[_0x50bb('0x24')]();};}function saveUpdates(_0x4825f8,_0x1dbba2){return function(_0x4cc7f9){if(_0x4cc7f9){return _0x4cc7f9[_0x50bb('0x25')](_0x4825f8)[_0x50bb('0x26')](function(_0x1a2a0b){return _0x1a2a0b;});}return null;};}function removeEntity(_0x2ee87a,_0x846311){return function(_0x342078){if(_0x342078){return _0x342078['destroy']()[_0x50bb('0x26')](function(){_0x2ee87a[_0x50bb('0x1c')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x3462c1,_0x5234d7){return function(_0x75fea6){if(!_0x75fea6){_0x3462c1['sendStatus'](0x194);}return _0x75fea6;};}function handleError(_0x55e87b,_0x2befd9){_0x2befd9=_0x2befd9||0x1f4;return function(_0x491632){logger['error'](_0x491632[_0x50bb('0x27')]);if(_0x491632[_0x50bb('0x28')]){delete _0x491632[_0x50bb('0x28')];}_0x55e87b[_0x50bb('0x1c')](_0x2befd9)[_0x50bb('0x29')](_0x491632);};}exports[_0x50bb('0x2a')]=function(_0x41a8ad,_0x41d479){var _0x4f7514={},_0x44ce86={},_0x461cf3={'count':0x0,'rows':[]};var _0x15ee2e=_[_0x50bb('0x2b')](db['ZendeskAccount'][_0x50bb('0x2c')],function(_0x1a62fb){return{'name':_0x1a62fb[_0x50bb('0x2d')],'type':_0x1a62fb[_0x50bb('0x2e')][_0x50bb('0x2f')]};});_0x44ce86[_0x50bb('0x30')]=_[_0x50bb('0x2b')](_0x15ee2e,_0x50bb('0x28'));_0x44ce86[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x41a8ad[_0x50bb('0x31')]);_0x44ce86[_0x50bb('0x33')]=_['intersection'](_0x44ce86[_0x50bb('0x30')],_0x44ce86[_0x50bb('0x31')]);_0x4f7514[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x44ce86[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x36')]));_0x4f7514[_0x50bb('0x34')]=_0x4f7514[_0x50bb('0x34')][_0x50bb('0x37')]?_0x4f7514['attributes']:_0x44ce86[_0x50bb('0x30')];if(!_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x38')](_0x50bb('0x39'))){_0x4f7514[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0x41a8ad['query']['limit']);_0x4f7514[_0x50bb('0x1d')]=qs['offset'](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x1d')]);}_0x4f7514[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x41a8ad[_0x50bb('0x31')]['sort']);_0x4f7514[_0x50bb('0x3c')]=qs['filters'](_[_0x50bb('0x3d')](_0x41a8ad[_0x50bb('0x31')],_0x44ce86[_0x50bb('0x33')]),_0x15ee2e);if(_0x41a8ad['query']['filter']){_0x4f7514[_0x50bb('0x3c')]=_[_0x50bb('0x3e')](_0x4f7514[_0x50bb('0x3c')],{'$or':_[_0x50bb('0x2b')](_0x15ee2e,function(_0x51750b){if(_0x51750b[_0x50bb('0x2e')]!=='VIRTUAL'){var _0x52059b={};_0x52059b[_0x51750b[_0x50bb('0x28')]]={'$like':'%'+_0x41a8ad['query'][_0x50bb('0x3f')]+'%'};return _0x52059b;}})});}_0x4f7514=_[_0x50bb('0x3e')]({},_0x4f7514,_0x41a8ad[_0x50bb('0x40')]);var _0x1f156e={'where':_0x4f7514[_0x50bb('0x3c')]};return db[_0x50bb('0x41')][_0x50bb('0x20')](_0x1f156e)[_0x50bb('0x26')](function(_0x46039a){_0x461cf3[_0x50bb('0x20')]=_0x46039a;if(_0x41a8ad['query']['includeAll']){_0x4f7514[_0x50bb('0x42')]=[{'all':!![]}];}return db[_0x50bb('0x41')][_0x50bb('0x43')](_0x4f7514);})[_0x50bb('0x26')](function(_0x5e8085){_0x461cf3[_0x50bb('0x44')]=_0x5e8085;return _0x461cf3;})['then'](respondWithFilteredResult(_0x41d479,_0x4f7514))[_0x50bb('0x45')](handleError(_0x41d479,null));};exports[_0x50bb('0x46')]=function(_0x379944,_0x40748d){var _0x1c438b={'raw':![],'where':{'id':_0x379944[_0x50bb('0x47')]['id']}},_0x355726={};_0x355726[_0x50bb('0x30')]=_[_0x50bb('0x32')](db[_0x50bb('0x41')][_0x50bb('0x2c')]);_0x355726[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x379944[_0x50bb('0x31')]);_0x355726[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x355726['model'],_0x355726[_0x50bb('0x31')]);_0x1c438b['attributes']=_[_0x50bb('0x35')](_0x355726[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x379944[_0x50bb('0x31')][_0x50bb('0x36')]));_0x1c438b[_0x50bb('0x34')]=_0x1c438b[_0x50bb('0x34')][_0x50bb('0x37')]?_0x1c438b[_0x50bb('0x34')]:_0x355726[_0x50bb('0x30')];if(_0x379944[_0x50bb('0x31')][_0x50bb('0x48')]){_0x1c438b[_0x50bb('0x42')]=[{'all':!![]}];}_0x1c438b=_[_0x50bb('0x3e')]({},_0x1c438b,_0x379944['options']);return db[_0x50bb('0x41')]['find'](_0x1c438b)[_0x50bb('0x26')](handleEntityNotFound(_0x40748d,null))[_0x50bb('0x26')](respondWithResult(_0x40748d,null))[_0x50bb('0x45')](handleError(_0x40748d,null));};exports[_0x50bb('0x49')]=function(_0x650e91,_0x39ac1a){return db[_0x50bb('0x41')][_0x50bb('0x49')](_0x650e91['body'],{})[_0x50bb('0x26')](respondWithResult(_0x39ac1a,0xc9))[_0x50bb('0x45')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x25')]=function(_0x13afe2,_0x3659c4){if(_0x13afe2['body']['id']){delete _0x13afe2[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x13afe2[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3659c4,null))['then'](saveUpdates(_0x13afe2['body'],null))[_0x50bb('0x26')](respondWithResult(_0x3659c4,null))['catch'](handleError(_0x3659c4,null));};exports[_0x50bb('0x4c')]=function(_0x57ee0e,_0x4316e4){return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x57ee0e['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x4316e4,null))[_0x50bb('0x26')](removeEntity(_0x4316e4,null))['catch'](handleError(_0x4316e4,null));};exports[_0x50bb('0x4d')]=function(_0x1dff6a,_0x8d62af,_0x3c525c){var _0x55a4a6={};var _0x33e71f={};var _0x46b51e;var _0x2e0032;return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x1dff6a['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x8d62af,null))['then'](function(_0x38a775){if(_0x38a775){_0x46b51e=_0x38a775;_0x33e71f['model']=_['keys'](db[_0x50bb('0x4f')]['rawAttributes']);_0x33e71f['query']=_[_0x50bb('0x32')](_0x1dff6a[_0x50bb('0x31')]);_0x33e71f[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x33e71f[_0x50bb('0x30')],_0x33e71f[_0x50bb('0x31')]);_0x55a4a6[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x33e71f['model'],qs['fields'](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x36')]));_0x55a4a6[_0x50bb('0x34')]=_0x55a4a6[_0x50bb('0x34')][_0x50bb('0x37')]?_0x55a4a6[_0x50bb('0x34')]:_0x33e71f[_0x50bb('0x30')];_0x55a4a6['order']=qs[_0x50bb('0x3b')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3b')]);_0x55a4a6[_0x50bb('0x3c')]=qs[_0x50bb('0x33')](_['pick'](_0x1dff6a[_0x50bb('0x31')],_0x33e71f[_0x50bb('0x33')]));if(_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]){_0x55a4a6[_0x50bb('0x3c')]=_['merge'](_0x55a4a6[_0x50bb('0x3c')],{'$or':_['map'](_0x55a4a6['attributes'],function(_0x170761){var _0x3057f2={};_0x3057f2[_0x170761]={'$like':'%'+_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]+'%'};return _0x3057f2;})});}_0x55a4a6=_[_0x50bb('0x3e')]({},_0x55a4a6,_0x1dff6a[_0x50bb('0x40')]);return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x330299){if(_0x330299){_0x2e0032=_0x330299[_0x50bb('0x37')];if(!_0x1dff6a[_0x50bb('0x31')]['hasOwnProperty'](_0x50bb('0x39'))){_0x55a4a6['limit']=qs[_0x50bb('0x1e')](_0x1dff6a[_0x50bb('0x31')]['limit']);_0x55a4a6[_0x50bb('0x1d')]=qs[_0x50bb('0x1d')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x1d')]);}return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x2b7df6){if(_0x2b7df6){return _0x2b7df6?{'count':_0x2e0032,'rows':_0x2b7df6}:null;}})[_0x50bb('0x26')](respondWithResult(_0x8d62af,null))['catch'](handleError(_0x8d62af,null));};exports[_0x50bb('0x50')]=function(_0x2dc832,_0x3b17c8,_0x4a226d){if(_0x2dc832[_0x50bb('0x4a')]['id']){delete _0x2dc832[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x2dc832[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3b17c8,null))['then'](function(_0xf47641){if(_0xf47641){_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x51')]=_0xf47641['id'];_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x52')]=integrations[_0x50bb('0x53')](_0x2dc832['body'][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x2e')]);_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x55')]=integrations[_0x50bb('0x56')](_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')]['type']);return db[_0x50bb('0x4f')][_0x50bb('0x49')](_0x2dc832[_0x50bb('0x4a')],{'include':[{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x52')},{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x55')}]});}return null;})[_0x50bb('0x26')](respondWithResult(_0x3b17c8,null))[_0x50bb('0x45')](handleError(_0x3b17c8,null));};exports['getFields']=function(_0x58ad41,_0x5babbc,_0x4159ad){var _0x5ba597='';return db['ZendeskAccount'][_0x50bb('0x4e')]({'where':{'id':_0x58ad41[_0x50bb('0x47')]['id']},'attributes':['id',_0x50bb('0x58'),_0x50bb('0x59'),'token',_0x50bb('0x5a'),_0x50bb('0x5b')]})['then'](handleEntityNotFound(_0x5babbc,null))[_0x50bb('0x26')](function(_0x51e64f){if(_0x51e64f){_0x5ba597=_0x51e64f[_0x50bb('0x5b')];var _0x239a82=_0x5ba597['slice'](-0x1);if(_0x239a82==='/'){_0x5ba597=_0x5ba597[_0x50bb('0x5c')](0x0,_0x5ba597['lastIndexOf'](_0x239a82));}var _0x8f5df6={'method':_0x50bb('0x5d'),'uri':util['format'](_0x50bb('0x5e'),_0x5ba597,_0x50bb('0x5f')),'json':!![]};switch(_0x51e64f[_0x50bb('0x5a')]){case'password':_0x8f5df6[_0x50bb('0x60')]={'Authorization':util[_0x50bb('0x61')](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')]('%s:%s',_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x59')]))['toString']('base64'))};break;case _0x50bb('0x63'):_0x8f5df6[_0x50bb('0x60')]={'Authorization':util['format'](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')](_0x50bb('0x64'),_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x63')]))['toString']('base64'))};break;default:throw new db[(_0x50bb('0x65'))][(_0x50bb('0x66'))](_0x50bb('0x67'));}return rp(_0x8f5df6);}})[_0x50bb('0x26')](function(_0x4b51d4){if(_0x4b51d4){var _0x1975f7=['subject',_0x50bb('0x68'),_0x50bb('0x69'),_0x50bb('0x6a')];_[_0x50bb('0x6b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x217170){return _0x1975f7[_0x50bb('0x6c')](_0x217170['type']);});return{'count':_0x4b51d4[_0x50bb('0x5f')][_0x50bb('0x37')],'rows':_[_0x50bb('0x2b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x5d2dc4){return{'id':_0x5d2dc4['id'],'name':_0x5d2dc4[_0x50bb('0x6d')]>0x7?_0x5d2dc4[_0x50bb('0x6e')]:_0x5d2dc4['type'],'custom':_0x5d2dc4[_0x50bb('0x6d')]>0x7?!![]:![],'options':_0x5d2dc4[_0x50bb('0x6f')]?_0x5d2dc4[_0x50bb('0x6f')]:_0x5d2dc4[_0x50bb('0x70')]?_0x5d2dc4[_0x50bb('0x70')]:[]};})};}})['then'](respondWithResult(_0x5babbc,null))['catch'](function(_0x145cf8){var _0x47e80f=_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?0x1f4:_0x145cf8['statusCode']||0x1f4;logger['error'](_0x50bb('0x72'),_0x50bb('0x73'),_0x47e80f,JSON[_0x50bb('0x74')](_0x145cf8));delete _0x145cf8['name'];if(_0x47e80f===0x191){_0x47e80f=0x190;}_0x5babbc[_0x50bb('0x1c')](_0x47e80f)[_0x50bb('0x29')](_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?{'message':_0x50bb('0x75'),'statusCode':_0x145cf8[_0x50bb('0x76')]}:_0x145cf8);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 875a4f0..6bd0f52 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 _0xd279=['../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','define','int_zendesk_accounts'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd279,0x1ea));var _0x9d27=function(_0x82eddd,_0x32e1fd){_0x82eddd=_0x82eddd-0x0;var _0x56296d=_0xd279[_0x82eddd];return _0x56296d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d27('0x0'))(_0x9d27('0x1'));var moment=require('moment');var BPromise=require(_0x9d27('0x2'));var rp=require(_0x9d27('0x3'));var fs=require('fs');var path=require(_0x9d27('0x4'));var rimraf=require(_0x9d27('0x5'));var config=require('../../config/environment');var attributes=require(_0x9d27('0x6'));var integrations=require(_0x9d27('0x7'));module['exports']=function(_0x42f3f8,_0x1806c0){return _0x42f3f8[_0x9d27('0x8')]('ZendeskAccount',attributes,{'tableName':_0x9d27('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fab=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x487d6e,_0x590ce7){var _0x3d0a2e=function(_0x4d559f){while(--_0x4d559f){_0x487d6e['push'](_0x487d6e['shift']());}};_0x3d0a2e(++_0x590ce7);}(_0x7fab,0x1b0));var _0xb7fa=function(_0x49d21f,_0x6e7f5){_0x49d21f=_0x49d21f-0x0;var _0x1b93f2=_0x7fab[_0x49d21f];return _0x1b93f2;};'use strict';var _=require(_0xb7fa('0x0'));var util=require(_0xb7fa('0x1'));var logger=require(_0xb7fa('0x2'))('api');var moment=require(_0xb7fa('0x3'));var BPromise=require(_0xb7fa('0x4'));var rp=require(_0xb7fa('0x5'));var fs=require('fs');var path=require(_0xb7fa('0x6'));var rimraf=require(_0xb7fa('0x7'));var config=require(_0xb7fa('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xb7fa('0x9'));module[_0xb7fa('0xa')]=function(_0x2a290e,_0x1b7c85){return _0x2a290e[_0xb7fa('0xb')](_0xb7fa('0xc'),attributes,{'tableName':_0xb7fa('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 60c15c8..d493948 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 _0xcde5=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find'];(function(_0x342f6c,_0x45ce86){var _0x40f5e2=function(_0x2ae777){while(--_0x2ae777){_0x342f6c['push'](_0x342f6c['shift']());}};_0x40f5e2(++_0x45ce86);}(_0xcde5,0x1ce));var _0x5cde=function(_0x45f62d,_0x542730){_0x45f62d=_0x45f62d-0x0;var _0x35dd38=_0xcde5[_0x45f62d];return _0x35dd38;};'use strict';var _=require(_0x5cde('0x0'));var util=require(_0x5cde('0x1'));var moment=require(_0x5cde('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cde('0x3'));var db=require(_0x5cde('0x4'))['db'];var utils=require(_0x5cde('0x5'));var logger=require(_0x5cde('0x6'))(_0x5cde('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5cde('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5792c5,_0x4a224e,_0x272674){return new BPromise(function(_0xb5083e,_0x340066){return client[_0x5cde('0x9')](_0x5792c5,_0x272674)[_0x5cde('0xa')](function(_0x3ed8f7){logger[_0x5cde('0xb')](_0x5cde('0xc'),_0x4a224e,_0x5cde('0xd'));logger[_0x5cde('0xe')](_0x5cde('0xf'),_0x4a224e,_0x5cde('0xd'),JSON[_0x5cde('0x10')](_0x3ed8f7));if(_0x3ed8f7[_0x5cde('0x11')]){if(_0x3ed8f7[_0x5cde('0x11')]['code']===0x1f4){logger[_0x5cde('0x11')](_0x5cde('0xc'),_0x4a224e,_0x3ed8f7['error'][_0x5cde('0x12')]);return _0x340066(_0x3ed8f7[_0x5cde('0x11')]['message']);}logger['error'](_0x5cde('0xc'),_0x4a224e,_0x3ed8f7['error'][_0x5cde('0x12')]);return _0xb5083e(_0x3ed8f7['error'][_0x5cde('0x12')]);}else{logger[_0x5cde('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x4a224e,'request\x20sent');_0xb5083e(_0x3ed8f7['result'][_0x5cde('0x12')]);}})[_0x5cde('0x13')](function(_0x443324){logger[_0x5cde('0x11')](_0x5cde('0xc'),_0x4a224e,_0x443324);_0x340066(_0x443324);});});}exports[_0x5cde('0x14')]=function(_0x3d4f5c){var _0x26a50c=this;return new Promise(function(_0x35007b,_0x519293){return db[_0x5cde('0x15')][_0x5cde('0x16')]({'raw':_0x3d4f5c['options']?_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x18')]===undefined?!![]:![]:!![],'where':_0x3d4f5c[_0x5cde('0x17')]?_0x3d4f5c['options'][_0x5cde('0x19')]||null:null,'attributes':_0x3d4f5c[_0x5cde('0x17')]?_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x1a')]||null:null,'limit':_0x3d4f5c['options']?_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x1b')]||null:null,'include':_0x3d4f5c[_0x5cde('0x17')]?_0x3d4f5c['options'][_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x1c')],function(_0x256856){return{'model':db[_0x256856['model']],'as':_0x256856['as'],'attributes':_0x256856['attributes'],'include':_0x256856[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x256856['include'],function(_0x4faa14){return{'model':db[_0x4faa14[_0x5cde('0x1e')]],'as':_0x4faa14['as'],'attributes':_0x4faa14[_0x5cde('0x1a')],'include':_0x4faa14[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x4faa14[_0x5cde('0x1c')],function(_0x363843){return{'model':db[_0x363843[_0x5cde('0x1e')]],'as':_0x363843['as'],'attributes':_0x363843['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cc212){logger[_0x5cde('0xb')](_0x5cde('0x14'),_0x3d4f5c);logger[_0x5cde('0xe')](_0x5cde('0x14'),_0x3d4f5c,JSON[_0x5cde('0x10')](_0x4cc212));_0x35007b(_0x4cc212);})[_0x5cde('0x13')](function(_0x337764){logger['error'](_0x5cde('0x14'),_0x337764[_0x5cde('0x12')],_0x3d4f5c);_0x519293(_0x26a50c[_0x5cde('0x11')](0x1f4,_0x337764['message']));});});};exports[_0x5cde('0x1f')]=function(_0x2200f9){var _0x14d180=this;return new Promise(function(_0x4ae778,_0xef0ead){return db[_0x5cde('0x15')][_0x5cde('0x20')]({'raw':_0x2200f9[_0x5cde('0x17')]?_0x2200f9[_0x5cde('0x17')][_0x5cde('0x18')]===undefined?!![]:![]:!![],'where':_0x2200f9[_0x5cde('0x17')]?_0x2200f9[_0x5cde('0x17')]['where']||null:null,'attributes':_0x2200f9[_0x5cde('0x17')]?_0x2200f9[_0x5cde('0x17')]['attributes']||null:null,'include':_0x2200f9[_0x5cde('0x17')]?_0x2200f9['options'][_0x5cde('0x1c')]?_['map'](_0x2200f9['options'][_0x5cde('0x1c')],function(_0x4a2f59){return{'model':db[_0x4a2f59['model']],'as':_0x4a2f59['as'],'attributes':_0x4a2f59[_0x5cde('0x1a')],'include':_0x4a2f59[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x4a2f59[_0x5cde('0x1c')],function(_0x121fb3){return{'model':db[_0x121fb3[_0x5cde('0x1e')]],'as':_0x121fb3['as'],'attributes':_0x121fb3[_0x5cde('0x1a')],'include':_0x121fb3[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x121fb3[_0x5cde('0x1c')],function(_0x39835d){return{'model':db[_0x39835d[_0x5cde('0x1e')]],'as':_0x39835d['as'],'attributes':_0x39835d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cde('0xa')](function(_0x26eddf){logger[_0x5cde('0xb')](_0x5cde('0x1f'),_0x2200f9);logger[_0x5cde('0xe')]('ShowZendeskAccount',_0x2200f9,JSON[_0x5cde('0x10')](_0x26eddf));_0x4ae778(_0x26eddf);})['catch'](function(_0x148c21){logger['error'](_0x5cde('0x1f'),_0x148c21[_0x5cde('0x12')],_0x2200f9);_0xef0ead(_0x14d180[_0x5cde('0x11')](0x1f4,_0x148c21['message']));});});}; \ No newline at end of file +var _0x0327=['message','GetZendeskAccount','ZendeskAccount','findAll','options','limit','include','map','model','attributes','catch','find','raw','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s'];(function(_0x3e8568,_0x37cce1){var _0x1987ab=function(_0xde8eb3){while(--_0xde8eb3){_0x3e8568['push'](_0x3e8568['shift']());}};_0x1987ab(++_0x37cce1);}(_0x0327,0x18f));var _0x7032=function(_0x4f4eeb,_0x49438b){_0x4f4eeb=_0x4f4eeb-0x0;var _0x387115=_0x0327[_0x4f4eeb];return _0x387115;};'use strict';var _=require(_0x7032('0x0'));var util=require(_0x7032('0x1'));var moment=require(_0x7032('0x2'));var BPromise=require(_0x7032('0x3'));var rs=require(_0x7032('0x4'));var fs=require('fs');var Redis=require(_0x7032('0x5'));var db=require(_0x7032('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7032('0x7'))('rpc');var config=require(_0x7032('0x8'));var jayson=require(_0x7032('0x9'));var client=jayson[_0x7032('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x300af4,_0x2306ee,_0x356ee7){return new BPromise(function(_0x1d4df5,_0x5b2c3b){return client[_0x7032('0xb')](_0x300af4,_0x356ee7)[_0x7032('0xc')](function(_0x5ccab1){logger[_0x7032('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x2306ee,_0x7032('0xe'));logger[_0x7032('0xf')](_0x7032('0x10'),_0x2306ee,_0x7032('0xe'),JSON[_0x7032('0x11')](_0x5ccab1));if(_0x5ccab1[_0x7032('0x12')]){if(_0x5ccab1['error'][_0x7032('0x13')]===0x1f4){logger[_0x7032('0x12')](_0x7032('0x14'),_0x2306ee,_0x5ccab1[_0x7032('0x12')]['message']);return _0x5b2c3b(_0x5ccab1['error'][_0x7032('0x15')]);}logger['error'](_0x7032('0x14'),_0x2306ee,_0x5ccab1[_0x7032('0x12')][_0x7032('0x15')]);return _0x1d4df5(_0x5ccab1['error'][_0x7032('0x15')]);}else{logger['info'](_0x7032('0x14'),_0x2306ee,_0x7032('0xe'));_0x1d4df5(_0x5ccab1['result'][_0x7032('0x15')]);}})['catch'](function(_0x2fd532){logger[_0x7032('0x12')](_0x7032('0x14'),_0x2306ee,_0x2fd532);_0x5b2c3b(_0x2fd532);});});}exports[_0x7032('0x16')]=function(_0x51ac03){var _0x40447f=this;return new Promise(function(_0x42dcde,_0x1a6056){return db[_0x7032('0x17')][_0x7032('0x18')]({'raw':_0x51ac03['options']?_0x51ac03['options']['raw']===undefined?!![]:![]:!![],'where':_0x51ac03[_0x7032('0x19')]?_0x51ac03[_0x7032('0x19')]['where']||null:null,'attributes':_0x51ac03[_0x7032('0x19')]?_0x51ac03['options']['attributes']||null:null,'limit':_0x51ac03[_0x7032('0x19')]?_0x51ac03[_0x7032('0x19')][_0x7032('0x1a')]||null:null,'include':_0x51ac03[_0x7032('0x19')]?_0x51ac03[_0x7032('0x19')][_0x7032('0x1b')]?_[_0x7032('0x1c')](_0x51ac03[_0x7032('0x19')][_0x7032('0x1b')],function(_0x328327){return{'model':db[_0x328327[_0x7032('0x1d')]],'as':_0x328327['as'],'attributes':_0x328327[_0x7032('0x1e')],'include':_0x328327[_0x7032('0x1b')]?_[_0x7032('0x1c')](_0x328327[_0x7032('0x1b')],function(_0x140553){return{'model':db[_0x140553['model']],'as':_0x140553['as'],'attributes':_0x140553[_0x7032('0x1e')],'include':_0x140553[_0x7032('0x1b')]?_['map'](_0x140553[_0x7032('0x1b')],function(_0x2c84e8){return{'model':db[_0x2c84e8[_0x7032('0x1d')]],'as':_0x2c84e8['as'],'attributes':_0x2c84e8['attributes']};}):[]};}):[]};}):[]:[]})[_0x7032('0xc')](function(_0x11ce60){logger[_0x7032('0xd')](_0x7032('0x16'),_0x51ac03);logger[_0x7032('0xf')]('GetZendeskAccount',_0x51ac03,JSON[_0x7032('0x11')](_0x11ce60));_0x42dcde(_0x11ce60);})[_0x7032('0x1f')](function(_0x4ec8d3){logger[_0x7032('0x12')]('GetZendeskAccount',_0x4ec8d3['message'],_0x51ac03);_0x1a6056(_0x40447f[_0x7032('0x12')](0x1f4,_0x4ec8d3[_0x7032('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x14a1c0){var _0x2e3298=this;return new Promise(function(_0xbee935,_0x1f34a0){return db['ZendeskAccount'][_0x7032('0x20')]({'raw':_0x14a1c0[_0x7032('0x19')]?_0x14a1c0[_0x7032('0x19')][_0x7032('0x21')]===undefined?!![]:![]:!![],'where':_0x14a1c0[_0x7032('0x19')]?_0x14a1c0['options']['where']||null:null,'attributes':_0x14a1c0['options']?_0x14a1c0[_0x7032('0x19')][_0x7032('0x1e')]||null:null,'include':_0x14a1c0[_0x7032('0x19')]?_0x14a1c0['options'][_0x7032('0x1b')]?_['map'](_0x14a1c0[_0x7032('0x19')][_0x7032('0x1b')],function(_0x3b9904){return{'model':db[_0x3b9904[_0x7032('0x1d')]],'as':_0x3b9904['as'],'attributes':_0x3b9904[_0x7032('0x1e')],'include':_0x3b9904[_0x7032('0x1b')]?_[_0x7032('0x1c')](_0x3b9904['include'],function(_0x51205e){return{'model':db[_0x51205e[_0x7032('0x1d')]],'as':_0x51205e['as'],'attributes':_0x51205e[_0x7032('0x1e')],'include':_0x51205e[_0x7032('0x1b')]?_[_0x7032('0x1c')](_0x51205e['include'],function(_0xe4840){return{'model':db[_0xe4840[_0x7032('0x1d')]],'as':_0xe4840['as'],'attributes':_0xe4840['attributes']};}):[]};}):[]};}):[]:[]})[_0x7032('0xc')](function(_0x63699a){logger[_0x7032('0xd')](_0x7032('0x22'),_0x14a1c0);logger[_0x7032('0xf')](_0x7032('0x22'),_0x14a1c0,JSON['stringify'](_0x63699a));_0xbee935(_0x63699a);})[_0x7032('0x1f')](function(_0x2c9f1e){logger[_0x7032('0x12')](_0x7032('0x22'),_0x2c9f1e['message'],_0x14a1c0);_0x1f34a0(_0x2e3298[_0x7032('0x12')](0x1f4,_0x2c9f1e[_0x7032('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 9eaeae1..ed00a0c 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 _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3ce4f1,_0xf71413){var _0x3d6e4f=function(_0xab57d0){while(--_0xab57d0){_0x3ce4f1['push'](_0x3ce4f1['shift']());}};_0x3d6e4f(++_0xf71413);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0xe5b5[_0x285800];return _0x4b809e;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4de895,_0x1128ad){var _0x43de60=function(_0x3c2b73){while(--_0x3c2b73){_0x4de895['push'](_0x4de895['shift']());}};_0x43de60(++_0x1128ad);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xe5b5[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index a326124..ffb083f 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 _0x2732=['exports','STRING','sequelize'];(function(_0x5b6dd2,_0x43f939){var _0x4a62e8=function(_0xa07ca4){while(--_0xa07ca4){_0x5b6dd2['push'](_0x5b6dd2['shift']());}};_0x4a62e8(++_0x43f939);}(_0x2732,0xe0));var _0x2273=function(_0x11d694,_0x40a43d){_0x11d694=_0x11d694-0x0;var _0xe1a34d=_0x2732[_0x11d694];return _0xe1a34d;};'use strict';var Sequelize=require(_0x2273('0x0'));module[_0x2273('0x1')]={'name':{'type':Sequelize[_0x2273('0x2')]},'description':{'type':Sequelize[_0x2273('0x2')]}}; \ No newline at end of file +var _0x77f4=['sequelize','exports','STRING'];(function(_0x32603d,_0x3849a9){var _0x43bfa1=function(_0x110b96){while(--_0x110b96){_0x32603d['push'](_0x32603d['shift']());}};_0x43bfa1(++_0x3849a9);}(_0x77f4,0x1ce));var _0x477f=function(_0x2742bf,_0x594b73){_0x2742bf=_0x2742bf-0x0;var _0x13ffc8=_0x77f4[_0x2742bf];return _0x13ffc8;};'use strict';var Sequelize=require(_0x477f('0x0'));module[_0x477f('0x1')]={'name':{'type':Sequelize[_0x477f('0x2')]},'description':{'type':Sequelize[_0x477f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 743f230..d92d2d8 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 _0x0a8c=['includeAll','include','findAll','rows','catch','length','find','create','body','params','getFields','findOne','ZendeskField','rawAttributes','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','ZendeskConfiguration','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0a8c,0xc5));var _0xc0a8=function(_0x345bd5,_0x2c7ae2){_0x345bd5=_0x345bd5-0x0;var _0x4c32a1=_0x0a8c[_0x345bd5];return _0x4c32a1;};'use strict';var emlformat=require(_0xc0a8('0x0'));var rimraf=require(_0xc0a8('0x1'));var zipdir=require(_0xc0a8('0x2'));var jsonpatch=require(_0xc0a8('0x3'));var rp=require('request-promise');var moment=require(_0xc0a8('0x4'));var BPromise=require(_0xc0a8('0x5'));var Mustache=require(_0xc0a8('0x6'));var util=require(_0xc0a8('0x7'));var path=require(_0xc0a8('0x8'));var sox=require(_0xc0a8('0x9'));var csv=require(_0xc0a8('0xa'));var ejs=require(_0xc0a8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0a8('0xc'));var squel=require(_0xc0a8('0xd'));var crypto=require(_0xc0a8('0xe'));var jsforce=require(_0xc0a8('0xf'));var deskjs=require(_0xc0a8('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc0a8('0x11'));var Papa=require(_0xc0a8('0x12'));var Redis=require('ioredis');var authService=require(_0xc0a8('0x13'));var qs=require(_0xc0a8('0x14'));var as=require(_0xc0a8('0x15'));var hardwareService=require(_0xc0a8('0x16'));var logger=require(_0xc0a8('0x17'))(_0xc0a8('0x18'));var utils=require('../../config/utils');var config=require(_0xc0a8('0x19'));var licenseUtil=require(_0xc0a8('0x1a'));var db=require(_0xc0a8('0x1b'))['db'];function respondWithStatusCode(_0x5898ea,_0x54cfb7){_0x54cfb7=_0x54cfb7||0xcc;return function(_0x576f48){if(_0x576f48){return _0x5898ea[_0xc0a8('0x1c')](_0x54cfb7);}return _0x5898ea[_0xc0a8('0x1d')](_0x54cfb7)[_0xc0a8('0x1e')]();};}function respondWithResult(_0x394f71,_0x154707){_0x154707=_0x154707||0xc8;return function(_0x5a82f7){if(_0x5a82f7){return _0x394f71[_0xc0a8('0x1d')](_0x154707)[_0xc0a8('0x1f')](_0x5a82f7);}};}function respondWithFilteredResult(_0x41625a,_0x3f12e4){return function(_0x4e734f){if(_0x4e734f){var _0x3d20be=typeof _0x3f12e4[_0xc0a8('0x20')]===_0xc0a8('0x21')&&typeof _0x3f12e4['limit']==='undefined';var _0x5ac664=_0x4e734f[_0xc0a8('0x22')];var _0x4c9378=_0x3d20be?0x0:_0x3f12e4[_0xc0a8('0x20')];var _0x4adf14=_0x3d20be?_0x4e734f[_0xc0a8('0x22')]:_0x3f12e4[_0xc0a8('0x20')]+_0x3f12e4[_0xc0a8('0x23')];var _0x333fb3;if(_0x4adf14>=_0x5ac664){_0x4adf14=_0x5ac664;_0x333fb3=0xc8;}else{_0x333fb3=0xce;}_0x41625a[_0xc0a8('0x1d')](_0x333fb3);return _0x41625a[_0xc0a8('0x24')](_0xc0a8('0x25'),_0x4c9378+'-'+_0x4adf14+'/'+_0x5ac664)[_0xc0a8('0x1f')](_0x4e734f);}return null;};}function patchUpdates(_0x13fb4e){return function(_0x1af003){try{jsonpatch[_0xc0a8('0x26')](_0x1af003,_0x13fb4e,!![]);}catch(_0x340a9f){return BPromise[_0xc0a8('0x27')](_0x340a9f);}return _0x1af003[_0xc0a8('0x28')]();};}function saveUpdates(_0x332cfd,_0x31a0f5){return function(_0x33f528){if(_0x33f528){return _0x33f528[_0xc0a8('0x29')](_0x332cfd)['then'](function(_0x5e83a4){return _0x5e83a4;});}return null;};}function removeEntity(_0x598133,_0x1b81a5){return function(_0x57c985){if(_0x57c985){return _0x57c985[_0xc0a8('0x2a')]()[_0xc0a8('0x2b')](function(){_0x598133['status'](0xcc)[_0xc0a8('0x1e')]();});}};}function handleEntityNotFound(_0x4f71bf,_0x233c59){return function(_0x44e204){if(!_0x44e204){_0x4f71bf[_0xc0a8('0x1c')](0x194);}return _0x44e204;};}function handleError(_0x26866c,_0x47e71f){_0x47e71f=_0x47e71f||0x1f4;return function(_0x504b05){logger['error'](_0x504b05[_0xc0a8('0x2c')]);if(_0x504b05[_0xc0a8('0x2d')]){delete _0x504b05[_0xc0a8('0x2d')];}_0x26866c[_0xc0a8('0x1d')](_0x47e71f)[_0xc0a8('0x2e')](_0x504b05);};}exports[_0xc0a8('0x2f')]=function(_0x543497,_0x388a6f){var _0x1b46a3={},_0x312494={},_0x220a3e={'count':0x0,'rows':[]};var _0xaba55b=_['map'](db[_0xc0a8('0x30')]['rawAttributes'],function(_0x5e8174){return{'name':_0x5e8174[_0xc0a8('0x31')],'type':_0x5e8174[_0xc0a8('0x32')][_0xc0a8('0x33')]};});_0x312494[_0xc0a8('0x34')]=_['map'](_0xaba55b,_0xc0a8('0x2d'));_0x312494['query']=_[_0xc0a8('0x35')](_0x543497['query']);_0x312494[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x312494[_0xc0a8('0x34')],_0x312494[_0xc0a8('0x38')]);_0x1b46a3[_0xc0a8('0x39')]=_[_0xc0a8('0x37')](_0x312494[_0xc0a8('0x34')],qs['fields'](_0x543497[_0xc0a8('0x38')][_0xc0a8('0x3a')]));_0x1b46a3['attributes']=_0x1b46a3['attributes']['length']?_0x1b46a3[_0xc0a8('0x39')]:_0x312494[_0xc0a8('0x34')];if(!_0x543497[_0xc0a8('0x38')][_0xc0a8('0x3b')](_0xc0a8('0x3c'))){_0x1b46a3[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x543497['query'][_0xc0a8('0x23')]);_0x1b46a3[_0xc0a8('0x20')]=qs['offset'](_0x543497[_0xc0a8('0x38')][_0xc0a8('0x20')]);}_0x1b46a3[_0xc0a8('0x3d')]=qs[_0xc0a8('0x3e')](_0x543497['query'][_0xc0a8('0x3e')]);_0x1b46a3[_0xc0a8('0x3f')]=qs[_0xc0a8('0x36')](_[_0xc0a8('0x40')](_0x543497[_0xc0a8('0x38')],_0x312494['filters']),_0xaba55b);if(_0x543497[_0xc0a8('0x38')][_0xc0a8('0x41')]){_0x1b46a3[_0xc0a8('0x3f')]=_[_0xc0a8('0x42')](_0x1b46a3[_0xc0a8('0x3f')],{'$or':_[_0xc0a8('0x43')](_0xaba55b,function(_0x2feab3){if(_0x2feab3[_0xc0a8('0x32')]!==_0xc0a8('0x44')){var _0x4dffac={};_0x4dffac[_0x2feab3['name']]={'$like':'%'+_0x543497[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x4dffac;}})});}_0x1b46a3=_[_0xc0a8('0x42')]({},_0x1b46a3,_0x543497[_0xc0a8('0x45')]);var _0x58a933={'where':_0x1b46a3['where']};return db[_0xc0a8('0x30')][_0xc0a8('0x22')](_0x58a933)[_0xc0a8('0x2b')](function(_0x2c4cc5){_0x220a3e[_0xc0a8('0x22')]=_0x2c4cc5;if(_0x543497[_0xc0a8('0x38')][_0xc0a8('0x46')]){_0x1b46a3[_0xc0a8('0x47')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xc0a8('0x48')](_0x1b46a3);})[_0xc0a8('0x2b')](function(_0x4766f1){_0x220a3e[_0xc0a8('0x49')]=_0x4766f1;return _0x220a3e;})[_0xc0a8('0x2b')](respondWithFilteredResult(_0x388a6f,_0x1b46a3))[_0xc0a8('0x4a')](handleError(_0x388a6f,null));};exports['show']=function(_0xef4627,_0x5bef75){var _0x20a29a={'raw':![],'where':{'id':_0xef4627['params']['id']}},_0x16833d={};_0x16833d[_0xc0a8('0x34')]=_[_0xc0a8('0x35')](db[_0xc0a8('0x30')]['rawAttributes']);_0x16833d['query']=_[_0xc0a8('0x35')](_0xef4627['query']);_0x16833d[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x16833d['model'],_0x16833d['query']);_0x20a29a[_0xc0a8('0x39')]=_['intersection'](_0x16833d[_0xc0a8('0x34')],qs[_0xc0a8('0x3a')](_0xef4627['query'][_0xc0a8('0x3a')]));_0x20a29a[_0xc0a8('0x39')]=_0x20a29a['attributes'][_0xc0a8('0x4b')]?_0x20a29a[_0xc0a8('0x39')]:_0x16833d['model'];if(_0xef4627[_0xc0a8('0x38')]['includeAll']){_0x20a29a['include']=[{'all':!![]}];}_0x20a29a=_[_0xc0a8('0x42')]({},_0x20a29a,_0xef4627[_0xc0a8('0x45')]);return db[_0xc0a8('0x30')][_0xc0a8('0x4c')](_0x20a29a)[_0xc0a8('0x2b')](handleEntityNotFound(_0x5bef75,null))[_0xc0a8('0x2b')](respondWithResult(_0x5bef75,null))[_0xc0a8('0x4a')](handleError(_0x5bef75,null));};exports[_0xc0a8('0x4d')]=function(_0x149c2a,_0x2133e9){return db['ZendeskConfiguration']['create'](_0x149c2a[_0xc0a8('0x4e')],{})[_0xc0a8('0x2b')](respondWithResult(_0x2133e9,0xc9))[_0xc0a8('0x4a')](handleError(_0x2133e9,null));};exports[_0xc0a8('0x29')]=function(_0x1d73f6,_0x2a666f){if(_0x1d73f6[_0xc0a8('0x4e')]['id']){delete _0x1d73f6[_0xc0a8('0x4e')]['id'];}return db[_0xc0a8('0x30')]['find']({'where':{'id':_0x1d73f6[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x2a666f,null))['then'](saveUpdates(_0x1d73f6[_0xc0a8('0x4e')],null))[_0xc0a8('0x2b')](respondWithResult(_0x2a666f,null))['catch'](handleError(_0x2a666f,null));};exports['destroy']=function(_0x3124af,_0x5c07ae){return db[_0xc0a8('0x30')][_0xc0a8('0x4c')]({'where':{'id':_0x3124af[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x5c07ae,null))['then'](removeEntity(_0x5c07ae,null))[_0xc0a8('0x4a')](handleError(_0x5c07ae,null));};exports[_0xc0a8('0x50')]=function(_0xe76f8a,_0x285a55,_0x2877d8){var _0x5f1b0b={};var _0x5bf5e8={};var _0x2754a4;var _0x4b722e;return db['ZendeskConfiguration'][_0xc0a8('0x51')]({'where':{'id':_0xe76f8a['params']['id']}})['then'](handleEntityNotFound(_0x285a55,null))[_0xc0a8('0x2b')](function(_0x24258c){if(_0x24258c){_0x2754a4=_0x24258c;_0x5bf5e8['model']=_[_0xc0a8('0x35')](db[_0xc0a8('0x52')][_0xc0a8('0x53')]);_0x5bf5e8['query']=_[_0xc0a8('0x35')](_0xe76f8a[_0xc0a8('0x38')]);_0x5bf5e8[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x5bf5e8[_0xc0a8('0x34')],_0x5bf5e8[_0xc0a8('0x38')]);_0x5f1b0b['attributes']=_[_0xc0a8('0x37')](_0x5bf5e8[_0xc0a8('0x34')],qs[_0xc0a8('0x3a')](_0xe76f8a[_0xc0a8('0x38')][_0xc0a8('0x3a')]));_0x5f1b0b[_0xc0a8('0x39')]=_0x5f1b0b['attributes'][_0xc0a8('0x4b')]?_0x5f1b0b[_0xc0a8('0x39')]:_0x5bf5e8[_0xc0a8('0x34')];_0x5f1b0b['order']=qs['sort'](_0xe76f8a['query'][_0xc0a8('0x3e')]);_0x5f1b0b[_0xc0a8('0x3f')]=qs[_0xc0a8('0x36')](_[_0xc0a8('0x40')](_0xe76f8a['query'],_0x5bf5e8[_0xc0a8('0x36')]));if(_0xe76f8a['query'][_0xc0a8('0x41')]){_0x5f1b0b['where']=_['merge'](_0x5f1b0b['where'],{'$or':_[_0xc0a8('0x43')](_0x5f1b0b['attributes'],function(_0x2b2aa4){var _0x89966c={};_0x89966c[_0x2b2aa4]={'$like':'%'+_0xe76f8a[_0xc0a8('0x38')]['filter']+'%'};return _0x89966c;})});}_0x5f1b0b=_[_0xc0a8('0x42')]({},_0x5f1b0b,_0xe76f8a['options']);return _0x2754a4[_0xc0a8('0x50')](_0x5f1b0b);}})[_0xc0a8('0x2b')](function(_0x23d5f6){if(_0x23d5f6){_0x4b722e=_0x23d5f6[_0xc0a8('0x4b')];if(!_0xe76f8a[_0xc0a8('0x38')]['hasOwnProperty'](_0xc0a8('0x3c'))){_0x5f1b0b[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0xe76f8a[_0xc0a8('0x38')][_0xc0a8('0x23')]);_0x5f1b0b[_0xc0a8('0x20')]=qs['offset'](_0xe76f8a[_0xc0a8('0x38')][_0xc0a8('0x20')]);}return _0x2754a4['getFields'](_0x5f1b0b);}})['then'](function(_0x3fcdd2){if(_0x3fcdd2){return _0x3fcdd2?{'count':_0x4b722e,'rows':_0x3fcdd2}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0x285a55,null))[_0xc0a8('0x4a')](handleError(_0x285a55,null));};exports[_0xc0a8('0x54')]=function(_0x47b5c6,_0x438b02,_0x1ae448){var _0x1bb684={};var _0x456649={};var _0x411e60;var _0x3101dd;return db[_0xc0a8('0x30')][_0xc0a8('0x51')]({'where':{'id':_0x47b5c6[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x438b02,null))[_0xc0a8('0x2b')](function(_0x21089a){if(_0x21089a){_0x411e60=_0x21089a;_0x456649['model']=_[_0xc0a8('0x35')](db[_0xc0a8('0x52')][_0xc0a8('0x53')]);_0x456649[_0xc0a8('0x38')]=_[_0xc0a8('0x35')](_0x47b5c6[_0xc0a8('0x38')]);_0x456649[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x456649[_0xc0a8('0x34')],_0x456649[_0xc0a8('0x38')]);_0x1bb684['attributes']=_[_0xc0a8('0x37')](_0x456649['model'],qs[_0xc0a8('0x3a')](_0x47b5c6['query'][_0xc0a8('0x3a')]));_0x1bb684['attributes']=_0x1bb684['attributes']['length']?_0x1bb684[_0xc0a8('0x39')]:_0x456649[_0xc0a8('0x34')];_0x1bb684[_0xc0a8('0x3d')]=qs[_0xc0a8('0x3e')](_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x3e')]);_0x1bb684[_0xc0a8('0x3f')]=qs['filters'](_[_0xc0a8('0x40')](_0x47b5c6[_0xc0a8('0x38')],_0x456649[_0xc0a8('0x36')]));if(_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x41')]){_0x1bb684[_0xc0a8('0x3f')]=_[_0xc0a8('0x42')](_0x1bb684[_0xc0a8('0x3f')],{'$or':_[_0xc0a8('0x43')](_0x1bb684[_0xc0a8('0x39')],function(_0x14d2ed){var _0x569fe0={};_0x569fe0[_0x14d2ed]={'$like':'%'+_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x569fe0;})});}_0x1bb684=_['merge']({},_0x1bb684,_0x47b5c6[_0xc0a8('0x45')]);return _0x411e60['getSubjects'](_0x1bb684);}})[_0xc0a8('0x2b')](function(_0x29ac78){if(_0x29ac78){_0x3101dd=_0x29ac78[_0xc0a8('0x4b')];if(!_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x3b')](_0xc0a8('0x3c'))){_0x1bb684[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x47b5c6['query'][_0xc0a8('0x23')]);_0x1bb684[_0xc0a8('0x20')]=qs[_0xc0a8('0x20')](_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x20')]);}return _0x411e60[_0xc0a8('0x54')](_0x1bb684);}})[_0xc0a8('0x2b')](function(_0x350874){if(_0x350874){return _0x350874?{'count':_0x3101dd,'rows':_0x350874}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0x438b02,null))['catch'](handleError(_0x438b02,null));};exports['getDescriptions']=function(_0x490cb9,_0x4375ba,_0x14479a){var _0x4d533a={};var _0x4a22de={};var _0x432825;var _0xfd6e65;return db['ZendeskConfiguration'][_0xc0a8('0x51')]({'where':{'id':_0x490cb9[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x4375ba,null))[_0xc0a8('0x2b')](function(_0x16ba0f){if(_0x16ba0f){_0x432825=_0x16ba0f;_0x4a22de['model']=_[_0xc0a8('0x35')](db[_0xc0a8('0x52')][_0xc0a8('0x53')]);_0x4a22de['query']=_['keys'](_0x490cb9[_0xc0a8('0x38')]);_0x4a22de[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x4a22de[_0xc0a8('0x34')],_0x4a22de[_0xc0a8('0x38')]);_0x4d533a[_0xc0a8('0x39')]=_[_0xc0a8('0x37')](_0x4a22de[_0xc0a8('0x34')],qs[_0xc0a8('0x3a')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x3a')]));_0x4d533a[_0xc0a8('0x39')]=_0x4d533a[_0xc0a8('0x39')]['length']?_0x4d533a[_0xc0a8('0x39')]:_0x4a22de[_0xc0a8('0x34')];_0x4d533a['order']=qs[_0xc0a8('0x3e')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x3e')]);_0x4d533a['where']=qs[_0xc0a8('0x36')](_[_0xc0a8('0x40')](_0x490cb9['query'],_0x4a22de['filters']));if(_0x490cb9['query'][_0xc0a8('0x41')]){_0x4d533a['where']=_[_0xc0a8('0x42')](_0x4d533a[_0xc0a8('0x3f')],{'$or':_['map'](_0x4d533a[_0xc0a8('0x39')],function(_0x5ced14){var _0x41b287={};_0x41b287[_0x5ced14]={'$like':'%'+_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x41b287;})});}_0x4d533a=_[_0xc0a8('0x42')]({},_0x4d533a,_0x490cb9[_0xc0a8('0x45')]);return _0x432825['getDescriptions'](_0x4d533a);}})[_0xc0a8('0x2b')](function(_0x9f4f1a){if(_0x9f4f1a){_0xfd6e65=_0x9f4f1a[_0xc0a8('0x4b')];if(!_0x490cb9['query']['hasOwnProperty'](_0xc0a8('0x3c'))){_0x4d533a[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x23')]);_0x4d533a['offset']=qs[_0xc0a8('0x20')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x20')]);}return _0x432825[_0xc0a8('0x55')](_0x4d533a);}})[_0xc0a8('0x2b')](function(_0x4a53bb){if(_0x4a53bb){return _0x4a53bb?{'count':_0xfd6e65,'rows':_0x4a53bb}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0x4375ba,null))[_0xc0a8('0x4a')](handleError(_0x4375ba,null));};exports[_0xc0a8('0x56')]=function(_0x5c05f4,_0xeddfd2,_0x8be369){var _0x4abbe8={};var _0x1980a0={};var _0x5b2d40;var _0x13bec5;return db[_0xc0a8('0x30')][_0xc0a8('0x51')]({'where':{'id':_0x5c05f4[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0xeddfd2,null))[_0xc0a8('0x2b')](function(_0x581bb0){if(_0x581bb0){_0x5b2d40=_0x581bb0;_0x1980a0[_0xc0a8('0x34')]=_[_0xc0a8('0x35')](db['Tag'][_0xc0a8('0x53')]);_0x1980a0['query']=_[_0xc0a8('0x35')](_0x5c05f4[_0xc0a8('0x38')]);_0x1980a0[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x1980a0['model'],_0x1980a0[_0xc0a8('0x38')]);_0x4abbe8['attributes']=_[_0xc0a8('0x37')](_0x1980a0['model'],qs['fields'](_0x5c05f4['query'][_0xc0a8('0x3a')]));_0x4abbe8[_0xc0a8('0x39')]=_0x4abbe8[_0xc0a8('0x39')][_0xc0a8('0x4b')]?_0x4abbe8[_0xc0a8('0x39')]:_0x1980a0['model'];_0x4abbe8[_0xc0a8('0x3d')]=qs['sort'](_0x5c05f4[_0xc0a8('0x38')]['sort']);_0x4abbe8['where']=qs['filters'](_[_0xc0a8('0x40')](_0x5c05f4['query'],_0x1980a0['filters']));if(_0x5c05f4[_0xc0a8('0x38')][_0xc0a8('0x41')]){_0x4abbe8['where']=_[_0xc0a8('0x42')](_0x4abbe8['where'],{'$or':_[_0xc0a8('0x43')](_0x4abbe8[_0xc0a8('0x39')],function(_0x2db23b){var _0x25b110={};_0x25b110[_0x2db23b]={'$like':'%'+_0x5c05f4[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x25b110;})});}_0x4abbe8=_[_0xc0a8('0x42')]({},_0x4abbe8,_0x5c05f4[_0xc0a8('0x45')]);return _0x5b2d40['getTags'](_0x4abbe8);}})['then'](function(_0xae8254){if(_0xae8254){_0x13bec5=_0xae8254['length'];if(!_0x5c05f4['query'][_0xc0a8('0x3b')](_0xc0a8('0x3c'))){_0x4abbe8[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x5c05f4['query'][_0xc0a8('0x23')]);_0x4abbe8[_0xc0a8('0x20')]=qs['offset'](_0x5c05f4['query'][_0xc0a8('0x20')]);}return _0x5b2d40['getTags'](_0x4abbe8);}})[_0xc0a8('0x2b')](function(_0x23d7dc){if(_0x23d7dc){return _0x23d7dc?{'count':_0x13bec5,'rows':_0x23d7dc}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0xeddfd2,null))['catch'](handleError(_0xeddfd2,null));};exports[_0xc0a8('0x57')]=function(_0x5b947d,_0x518a5d,_0x2c0cf0){if(_0x5b947d[_0xc0a8('0x4e')]['id']){delete _0x5b947d[_0xc0a8('0x4e')]['id'];}return db[_0xc0a8('0x30')][_0xc0a8('0x51')]({'where':{'id':_0x5b947d[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x518a5d,null))[_0xc0a8('0x2b')](function(_0x11717d){if(_0x11717d){return _0x11717d[_0xc0a8('0x57')](_0x5b947d[_0xc0a8('0x4e')][_0xc0a8('0x58')]||[]);}return null;})[_0xc0a8('0x2b')](respondWithResult(_0x518a5d,null))['catch'](handleError(_0x518a5d,null));}; \ No newline at end of file +var _0x710b=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','map','ZendeskConfiguration','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','destroy','getFields','ZendeskField','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x542d9d,_0x2fe897){var _0x59c46f=function(_0xfddf2f){while(--_0xfddf2f){_0x542d9d['push'](_0x542d9d['shift']());}};_0x59c46f(++_0x2fe897);}(_0x710b,0x8b));var _0xb710=function(_0x2003ca,_0x327d9b){_0x2003ca=_0x2003ca-0x0;var _0xeaa6c9=_0x710b[_0x2003ca];return _0xeaa6c9;};'use strict';var emlformat=require(_0xb710('0x0'));var rimraf=require(_0xb710('0x1'));var zipdir=require(_0xb710('0x2'));var jsonpatch=require(_0xb710('0x3'));var rp=require(_0xb710('0x4'));var moment=require('moment');var BPromise=require(_0xb710('0x5'));var Mustache=require('mustache');var util=require(_0xb710('0x6'));var path=require(_0xb710('0x7'));var sox=require('sox');var csv=require(_0xb710('0x8'));var ejs=require(_0xb710('0x9'));var fs=require('fs');var fs_extra=require(_0xb710('0xa'));var _=require(_0xb710('0xb'));var squel=require(_0xb710('0xc'));var crypto=require('crypto');var jsforce=require(_0xb710('0xd'));var deskjs=require(_0xb710('0xe'));var toCsv=require(_0xb710('0x8'));var querystring=require(_0xb710('0xf'));var Papa=require(_0xb710('0x10'));var Redis=require(_0xb710('0x11'));var authService=require(_0xb710('0x12'));var qs=require(_0xb710('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb710('0x14'));var logger=require(_0xb710('0x15'))(_0xb710('0x16'));var utils=require('../../config/utils');var config=require(_0xb710('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb710('0x18'))['db'];function respondWithStatusCode(_0x5c55f5,_0x50ef4f){_0x50ef4f=_0x50ef4f||0xcc;return function(_0x31222b){if(_0x31222b){return _0x5c55f5[_0xb710('0x19')](_0x50ef4f);}return _0x5c55f5[_0xb710('0x1a')](_0x50ef4f)[_0xb710('0x1b')]();};}function respondWithResult(_0x4a61ef,_0x319f9d){_0x319f9d=_0x319f9d||0xc8;return function(_0x3953ae){if(_0x3953ae){return _0x4a61ef[_0xb710('0x1a')](_0x319f9d)[_0xb710('0x1c')](_0x3953ae);}};}function respondWithFilteredResult(_0x193afc,_0x264298){return function(_0x469c9b){if(_0x469c9b){var _0x274333=typeof _0x264298[_0xb710('0x1d')]===_0xb710('0x1e')&&typeof _0x264298[_0xb710('0x1f')]===_0xb710('0x1e');var _0x1f87bc=_0x469c9b[_0xb710('0x20')];var _0x336d23=_0x274333?0x0:_0x264298[_0xb710('0x1d')];var _0x202555=_0x274333?_0x469c9b[_0xb710('0x20')]:_0x264298[_0xb710('0x1d')]+_0x264298[_0xb710('0x1f')];var _0xb7e4c2;if(_0x202555>=_0x1f87bc){_0x202555=_0x1f87bc;_0xb7e4c2=0xc8;}else{_0xb7e4c2=0xce;}_0x193afc[_0xb710('0x1a')](_0xb7e4c2);return _0x193afc['set'](_0xb710('0x21'),_0x336d23+'-'+_0x202555+'/'+_0x1f87bc)[_0xb710('0x1c')](_0x469c9b);}return null;};}function patchUpdates(_0x53c22c){return function(_0x4cb9e6){try{jsonpatch[_0xb710('0x22')](_0x4cb9e6,_0x53c22c,!![]);}catch(_0x51f663){return BPromise[_0xb710('0x23')](_0x51f663);}return _0x4cb9e6['save']();};}function saveUpdates(_0x28b320,_0x754b87){return function(_0x32616c){if(_0x32616c){return _0x32616c[_0xb710('0x24')](_0x28b320)[_0xb710('0x25')](function(_0x520bd8){return _0x520bd8;});}return null;};}function removeEntity(_0x2ccd94,_0x4afe12){return function(_0x4de27f){if(_0x4de27f){return _0x4de27f['destroy']()['then'](function(){_0x2ccd94[_0xb710('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b1c1c,_0x174ea3){return function(_0x2d378f){if(!_0x2d378f){_0x5b1c1c[_0xb710('0x19')](0x194);}return _0x2d378f;};}function handleError(_0x2368c0,_0x44b97c){_0x44b97c=_0x44b97c||0x1f4;return function(_0x2858d3){logger[_0xb710('0x26')](_0x2858d3['stack']);if(_0x2858d3[_0xb710('0x27')]){delete _0x2858d3[_0xb710('0x27')];}_0x2368c0['status'](_0x44b97c)[_0xb710('0x28')](_0x2858d3);};}exports['index']=function(_0x3881c3,_0x240e25){var _0x48bae={},_0x26c69b={},_0x43c912={'count':0x0,'rows':[]};var _0x8c1638=_[_0xb710('0x29')](db[_0xb710('0x2a')][_0xb710('0x2b')],function(_0x46f44d){return{'name':_0x46f44d['fieldName'],'type':_0x46f44d[_0xb710('0x2c')]['key']};});_0x26c69b[_0xb710('0x2d')]=_[_0xb710('0x29')](_0x8c1638,'name');_0x26c69b[_0xb710('0x2e')]=_[_0xb710('0x2f')](_0x3881c3['query']);_0x26c69b[_0xb710('0x30')]=_[_0xb710('0x31')](_0x26c69b[_0xb710('0x2d')],_0x26c69b[_0xb710('0x2e')]);_0x48bae['attributes']=_['intersection'](_0x26c69b['model'],qs[_0xb710('0x32')](_0x3881c3[_0xb710('0x2e')][_0xb710('0x32')]));_0x48bae[_0xb710('0x33')]=_0x48bae[_0xb710('0x33')][_0xb710('0x34')]?_0x48bae['attributes']:_0x26c69b['model'];if(!_0x3881c3['query'][_0xb710('0x35')](_0xb710('0x36'))){_0x48bae['limit']=qs[_0xb710('0x1f')](_0x3881c3['query'][_0xb710('0x1f')]);_0x48bae[_0xb710('0x1d')]=qs[_0xb710('0x1d')](_0x3881c3[_0xb710('0x2e')][_0xb710('0x1d')]);}_0x48bae[_0xb710('0x37')]=qs[_0xb710('0x38')](_0x3881c3['query'][_0xb710('0x38')]);_0x48bae[_0xb710('0x39')]=qs[_0xb710('0x30')](_[_0xb710('0x3a')](_0x3881c3[_0xb710('0x2e')],_0x26c69b[_0xb710('0x30')]),_0x8c1638);if(_0x3881c3['query'][_0xb710('0x3b')]){_0x48bae[_0xb710('0x39')]=_[_0xb710('0x3c')](_0x48bae['where'],{'$or':_[_0xb710('0x29')](_0x8c1638,function(_0x39e955){if(_0x39e955[_0xb710('0x2c')]!==_0xb710('0x3d')){var _0x5ae416={};_0x5ae416[_0x39e955[_0xb710('0x27')]]={'$like':'%'+_0x3881c3['query']['filter']+'%'};return _0x5ae416;}})});}_0x48bae=_[_0xb710('0x3c')]({},_0x48bae,_0x3881c3[_0xb710('0x3e')]);var _0x4e59ca={'where':_0x48bae['where']};return db[_0xb710('0x2a')][_0xb710('0x20')](_0x4e59ca)[_0xb710('0x25')](function(_0x1328fa){_0x43c912[_0xb710('0x20')]=_0x1328fa;if(_0x3881c3[_0xb710('0x2e')][_0xb710('0x3f')]){_0x48bae['include']=[{'all':!![]}];}return db[_0xb710('0x2a')][_0xb710('0x40')](_0x48bae);})[_0xb710('0x25')](function(_0x103e30){_0x43c912[_0xb710('0x41')]=_0x103e30;return _0x43c912;})[_0xb710('0x25')](respondWithFilteredResult(_0x240e25,_0x48bae))['catch'](handleError(_0x240e25,null));};exports[_0xb710('0x42')]=function(_0x1b7968,_0x58512b){var _0x475caf={'raw':![],'where':{'id':_0x1b7968[_0xb710('0x43')]['id']}},_0x4e4d8d={};_0x4e4d8d['model']=_[_0xb710('0x2f')](db['ZendeskConfiguration'][_0xb710('0x2b')]);_0x4e4d8d[_0xb710('0x2e')]=_[_0xb710('0x2f')](_0x1b7968[_0xb710('0x2e')]);_0x4e4d8d[_0xb710('0x30')]=_[_0xb710('0x31')](_0x4e4d8d[_0xb710('0x2d')],_0x4e4d8d[_0xb710('0x2e')]);_0x475caf[_0xb710('0x33')]=_[_0xb710('0x31')](_0x4e4d8d[_0xb710('0x2d')],qs[_0xb710('0x32')](_0x1b7968[_0xb710('0x2e')][_0xb710('0x32')]));_0x475caf['attributes']=_0x475caf['attributes']['length']?_0x475caf[_0xb710('0x33')]:_0x4e4d8d[_0xb710('0x2d')];if(_0x1b7968[_0xb710('0x2e')][_0xb710('0x3f')]){_0x475caf[_0xb710('0x44')]=[{'all':!![]}];}_0x475caf=_[_0xb710('0x3c')]({},_0x475caf,_0x1b7968['options']);return db[_0xb710('0x2a')][_0xb710('0x45')](_0x475caf)[_0xb710('0x25')](handleEntityNotFound(_0x58512b,null))[_0xb710('0x25')](respondWithResult(_0x58512b,null))['catch'](handleError(_0x58512b,null));};exports['create']=function(_0x5de38e,_0x1adcb6){return db[_0xb710('0x2a')][_0xb710('0x46')](_0x5de38e[_0xb710('0x47')],{})[_0xb710('0x25')](respondWithResult(_0x1adcb6,0xc9))[_0xb710('0x48')](handleError(_0x1adcb6,null));};exports[_0xb710('0x24')]=function(_0x4230df,_0x3c42ce){if(_0x4230df['body']['id']){delete _0x4230df[_0xb710('0x47')]['id'];}return db['ZendeskConfiguration'][_0xb710('0x45')]({'where':{'id':_0x4230df['params']['id']}})[_0xb710('0x25')](handleEntityNotFound(_0x3c42ce,null))['then'](saveUpdates(_0x4230df[_0xb710('0x47')],null))[_0xb710('0x25')](respondWithResult(_0x3c42ce,null))['catch'](handleError(_0x3c42ce,null));};exports[_0xb710('0x49')]=function(_0x363d24,_0x44e7ba){return db[_0xb710('0x2a')][_0xb710('0x45')]({'where':{'id':_0x363d24['params']['id']}})[_0xb710('0x25')](handleEntityNotFound(_0x44e7ba,null))[_0xb710('0x25')](removeEntity(_0x44e7ba,null))[_0xb710('0x48')](handleError(_0x44e7ba,null));};exports[_0xb710('0x4a')]=function(_0x384953,_0x422441,_0x48f334){var _0x29f833={};var _0x1dc791={};var _0x51aeaf;var _0x220cc3;return db[_0xb710('0x2a')]['findOne']({'where':{'id':_0x384953[_0xb710('0x43')]['id']}})[_0xb710('0x25')](handleEntityNotFound(_0x422441,null))[_0xb710('0x25')](function(_0xa86ccf){if(_0xa86ccf){_0x51aeaf=_0xa86ccf;_0x1dc791[_0xb710('0x2d')]=_['keys'](db[_0xb710('0x4b')]['rawAttributes']);_0x1dc791[_0xb710('0x2e')]=_[_0xb710('0x2f')](_0x384953['query']);_0x1dc791[_0xb710('0x30')]=_[_0xb710('0x31')](_0x1dc791[_0xb710('0x2d')],_0x1dc791[_0xb710('0x2e')]);_0x29f833[_0xb710('0x33')]=_['intersection'](_0x1dc791[_0xb710('0x2d')],qs['fields'](_0x384953[_0xb710('0x2e')]['fields']));_0x29f833['attributes']=_0x29f833[_0xb710('0x33')]['length']?_0x29f833[_0xb710('0x33')]:_0x1dc791[_0xb710('0x2d')];_0x29f833[_0xb710('0x37')]=qs[_0xb710('0x38')](_0x384953[_0xb710('0x2e')][_0xb710('0x38')]);_0x29f833[_0xb710('0x39')]=qs[_0xb710('0x30')](_[_0xb710('0x3a')](_0x384953[_0xb710('0x2e')],_0x1dc791[_0xb710('0x30')]));if(_0x384953['query'][_0xb710('0x3b')]){_0x29f833[_0xb710('0x39')]=_[_0xb710('0x3c')](_0x29f833[_0xb710('0x39')],{'$or':_['map'](_0x29f833[_0xb710('0x33')],function(_0x23cc05){var _0x444dfb={};_0x444dfb[_0x23cc05]={'$like':'%'+_0x384953[_0xb710('0x2e')][_0xb710('0x3b')]+'%'};return _0x444dfb;})});}_0x29f833=_[_0xb710('0x3c')]({},_0x29f833,_0x384953[_0xb710('0x3e')]);return _0x51aeaf[_0xb710('0x4a')](_0x29f833);}})[_0xb710('0x25')](function(_0x13eef5){if(_0x13eef5){_0x220cc3=_0x13eef5[_0xb710('0x34')];if(!_0x384953[_0xb710('0x2e')]['hasOwnProperty'](_0xb710('0x36'))){_0x29f833['limit']=qs[_0xb710('0x1f')](_0x384953[_0xb710('0x2e')]['limit']);_0x29f833[_0xb710('0x1d')]=qs[_0xb710('0x1d')](_0x384953['query'][_0xb710('0x1d')]);}return _0x51aeaf[_0xb710('0x4a')](_0x29f833);}})[_0xb710('0x25')](function(_0x1182b0){if(_0x1182b0){return _0x1182b0?{'count':_0x220cc3,'rows':_0x1182b0}:null;}})[_0xb710('0x25')](respondWithResult(_0x422441,null))[_0xb710('0x48')](handleError(_0x422441,null));};exports['getSubjects']=function(_0x2e22b5,_0x3e4a41,_0x3191eb){var _0x507a46={};var _0x1947af={};var _0x18860e;var _0x1063a9;return db[_0xb710('0x2a')][_0xb710('0x4c')]({'where':{'id':_0x2e22b5[_0xb710('0x43')]['id']}})[_0xb710('0x25')](handleEntityNotFound(_0x3e4a41,null))[_0xb710('0x25')](function(_0x16ef7f){if(_0x16ef7f){_0x18860e=_0x16ef7f;_0x1947af[_0xb710('0x2d')]=_[_0xb710('0x2f')](db['ZendeskField'][_0xb710('0x2b')]);_0x1947af[_0xb710('0x2e')]=_[_0xb710('0x2f')](_0x2e22b5[_0xb710('0x2e')]);_0x1947af[_0xb710('0x30')]=_[_0xb710('0x31')](_0x1947af[_0xb710('0x2d')],_0x1947af['query']);_0x507a46[_0xb710('0x33')]=_[_0xb710('0x31')](_0x1947af[_0xb710('0x2d')],qs['fields'](_0x2e22b5[_0xb710('0x2e')]['fields']));_0x507a46['attributes']=_0x507a46['attributes']['length']?_0x507a46[_0xb710('0x33')]:_0x1947af[_0xb710('0x2d')];_0x507a46['order']=qs[_0xb710('0x38')](_0x2e22b5[_0xb710('0x2e')][_0xb710('0x38')]);_0x507a46[_0xb710('0x39')]=qs[_0xb710('0x30')](_[_0xb710('0x3a')](_0x2e22b5[_0xb710('0x2e')],_0x1947af[_0xb710('0x30')]));if(_0x2e22b5['query']['filter']){_0x507a46[_0xb710('0x39')]=_[_0xb710('0x3c')](_0x507a46[_0xb710('0x39')],{'$or':_['map'](_0x507a46['attributes'],function(_0x1e6747){var _0x35ee44={};_0x35ee44[_0x1e6747]={'$like':'%'+_0x2e22b5[_0xb710('0x2e')][_0xb710('0x3b')]+'%'};return _0x35ee44;})});}_0x507a46=_[_0xb710('0x3c')]({},_0x507a46,_0x2e22b5[_0xb710('0x3e')]);return _0x18860e[_0xb710('0x4d')](_0x507a46);}})['then'](function(_0x476f5e){if(_0x476f5e){_0x1063a9=_0x476f5e[_0xb710('0x34')];if(!_0x2e22b5[_0xb710('0x2e')][_0xb710('0x35')]('nolimit')){_0x507a46[_0xb710('0x1f')]=qs[_0xb710('0x1f')](_0x2e22b5[_0xb710('0x2e')][_0xb710('0x1f')]);_0x507a46[_0xb710('0x1d')]=qs[_0xb710('0x1d')](_0x2e22b5['query'][_0xb710('0x1d')]);}return _0x18860e[_0xb710('0x4d')](_0x507a46);}})[_0xb710('0x25')](function(_0x19712d){if(_0x19712d){return _0x19712d?{'count':_0x1063a9,'rows':_0x19712d}:null;}})[_0xb710('0x25')](respondWithResult(_0x3e4a41,null))[_0xb710('0x48')](handleError(_0x3e4a41,null));};exports['getDescriptions']=function(_0x331f68,_0x5675c3,_0xd22b50){var _0x39eb0b={};var _0x25df8b={};var _0x4e0a42;var _0x36a0c5;return db[_0xb710('0x2a')]['findOne']({'where':{'id':_0x331f68[_0xb710('0x43')]['id']}})['then'](handleEntityNotFound(_0x5675c3,null))[_0xb710('0x25')](function(_0x3bdd70){if(_0x3bdd70){_0x4e0a42=_0x3bdd70;_0x25df8b['model']=_['keys'](db[_0xb710('0x4b')][_0xb710('0x2b')]);_0x25df8b[_0xb710('0x2e')]=_['keys'](_0x331f68['query']);_0x25df8b[_0xb710('0x30')]=_[_0xb710('0x31')](_0x25df8b['model'],_0x25df8b[_0xb710('0x2e')]);_0x39eb0b[_0xb710('0x33')]=_[_0xb710('0x31')](_0x25df8b[_0xb710('0x2d')],qs[_0xb710('0x32')](_0x331f68[_0xb710('0x2e')][_0xb710('0x32')]));_0x39eb0b[_0xb710('0x33')]=_0x39eb0b[_0xb710('0x33')]['length']?_0x39eb0b[_0xb710('0x33')]:_0x25df8b[_0xb710('0x2d')];_0x39eb0b['order']=qs[_0xb710('0x38')](_0x331f68['query'][_0xb710('0x38')]);_0x39eb0b['where']=qs[_0xb710('0x30')](_[_0xb710('0x3a')](_0x331f68[_0xb710('0x2e')],_0x25df8b['filters']));if(_0x331f68[_0xb710('0x2e')]['filter']){_0x39eb0b[_0xb710('0x39')]=_[_0xb710('0x3c')](_0x39eb0b[_0xb710('0x39')],{'$or':_[_0xb710('0x29')](_0x39eb0b[_0xb710('0x33')],function(_0x870247){var _0x53b031={};_0x53b031[_0x870247]={'$like':'%'+_0x331f68[_0xb710('0x2e')][_0xb710('0x3b')]+'%'};return _0x53b031;})});}_0x39eb0b=_[_0xb710('0x3c')]({},_0x39eb0b,_0x331f68[_0xb710('0x3e')]);return _0x4e0a42[_0xb710('0x4e')](_0x39eb0b);}})[_0xb710('0x25')](function(_0x46eb27){if(_0x46eb27){_0x36a0c5=_0x46eb27[_0xb710('0x34')];if(!_0x331f68[_0xb710('0x2e')][_0xb710('0x35')](_0xb710('0x36'))){_0x39eb0b[_0xb710('0x1f')]=qs['limit'](_0x331f68[_0xb710('0x2e')]['limit']);_0x39eb0b[_0xb710('0x1d')]=qs['offset'](_0x331f68[_0xb710('0x2e')]['offset']);}return _0x4e0a42['getDescriptions'](_0x39eb0b);}})[_0xb710('0x25')](function(_0x41cb94){if(_0x41cb94){return _0x41cb94?{'count':_0x36a0c5,'rows':_0x41cb94}:null;}})[_0xb710('0x25')](respondWithResult(_0x5675c3,null))[_0xb710('0x48')](handleError(_0x5675c3,null));};exports[_0xb710('0x4f')]=function(_0x4ee5cd,_0x454aa6,_0x26c390){var _0x2aba02={};var _0x2e0419={};var _0x1e8041;var _0x2ff163;return db[_0xb710('0x2a')][_0xb710('0x4c')]({'where':{'id':_0x4ee5cd[_0xb710('0x43')]['id']}})[_0xb710('0x25')](handleEntityNotFound(_0x454aa6,null))[_0xb710('0x25')](function(_0x1dd3d6){if(_0x1dd3d6){_0x1e8041=_0x1dd3d6;_0x2e0419['model']=_[_0xb710('0x2f')](db[_0xb710('0x50')][_0xb710('0x2b')]);_0x2e0419[_0xb710('0x2e')]=_[_0xb710('0x2f')](_0x4ee5cd[_0xb710('0x2e')]);_0x2e0419[_0xb710('0x30')]=_[_0xb710('0x31')](_0x2e0419[_0xb710('0x2d')],_0x2e0419[_0xb710('0x2e')]);_0x2aba02[_0xb710('0x33')]=_[_0xb710('0x31')](_0x2e0419['model'],qs[_0xb710('0x32')](_0x4ee5cd[_0xb710('0x2e')]['fields']));_0x2aba02['attributes']=_0x2aba02['attributes'][_0xb710('0x34')]?_0x2aba02[_0xb710('0x33')]:_0x2e0419[_0xb710('0x2d')];_0x2aba02[_0xb710('0x37')]=qs[_0xb710('0x38')](_0x4ee5cd[_0xb710('0x2e')]['sort']);_0x2aba02[_0xb710('0x39')]=qs[_0xb710('0x30')](_[_0xb710('0x3a')](_0x4ee5cd[_0xb710('0x2e')],_0x2e0419[_0xb710('0x30')]));if(_0x4ee5cd[_0xb710('0x2e')][_0xb710('0x3b')]){_0x2aba02[_0xb710('0x39')]=_['merge'](_0x2aba02[_0xb710('0x39')],{'$or':_[_0xb710('0x29')](_0x2aba02[_0xb710('0x33')],function(_0x52fef9){var _0x514937={};_0x514937[_0x52fef9]={'$like':'%'+_0x4ee5cd[_0xb710('0x2e')][_0xb710('0x3b')]+'%'};return _0x514937;})});}_0x2aba02=_[_0xb710('0x3c')]({},_0x2aba02,_0x4ee5cd[_0xb710('0x3e')]);return _0x1e8041[_0xb710('0x4f')](_0x2aba02);}})[_0xb710('0x25')](function(_0x272397){if(_0x272397){_0x2ff163=_0x272397[_0xb710('0x34')];if(!_0x4ee5cd[_0xb710('0x2e')][_0xb710('0x35')]('nolimit')){_0x2aba02[_0xb710('0x1f')]=qs[_0xb710('0x1f')](_0x4ee5cd['query']['limit']);_0x2aba02[_0xb710('0x1d')]=qs[_0xb710('0x1d')](_0x4ee5cd[_0xb710('0x2e')][_0xb710('0x1d')]);}return _0x1e8041[_0xb710('0x4f')](_0x2aba02);}})[_0xb710('0x25')](function(_0x3d737e){if(_0x3d737e){return _0x3d737e?{'count':_0x2ff163,'rows':_0x3d737e}:null;}})['then'](respondWithResult(_0x454aa6,null))[_0xb710('0x48')](handleError(_0x454aa6,null));};exports['setTags']=function(_0xfac10d,_0x2e622e,_0x5d7bd8){if(_0xfac10d['body']['id']){delete _0xfac10d[_0xb710('0x47')]['id'];}return db[_0xb710('0x2a')]['findOne']({'where':{'id':_0xfac10d[_0xb710('0x43')]['id']}})[_0xb710('0x25')](handleEntityNotFound(_0x2e622e,null))[_0xb710('0x25')](function(_0x5343c5){if(_0x5343c5){return _0x5343c5[_0xb710('0x51')](_0xfac10d['body'][_0xb710('0x52')]||[]);}return null;})['then'](respondWithResult(_0x2e622e,null))[_0xb710('0x48')](handleError(_0x2e622e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index cc05fd8..982ae34 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 _0xda2d=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x531b06,_0x2fee07){var _0x113250=function(_0x50627b){while(--_0x50627b){_0x531b06['push'](_0x531b06['shift']());}};_0x113250(++_0x2fee07);}(_0xda2d,0x102));var _0xdda2=function(_0x38fdd9,_0xf59bf5){_0x38fdd9=_0x38fdd9-0x0;var _0x1776cf=_0xda2d[_0x38fdd9];return _0x1776cf;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb03e=['int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x5bd4fc,_0x4fbd8c){var _0x14b56e=function(_0x361e5c){while(--_0x361e5c){_0x5bd4fc['push'](_0x5bd4fc['shift']());}};_0x14b56e(++_0x4fbd8c);}(_0xb03e,0x1eb));var _0xeb03=function(_0x38c313,_0x1424b7){_0x38c313=_0x38c313-0x0;var _0x325397=_0xb03e[_0x38c313];return _0x325397;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var logger=require(_0xeb03('0x1'))(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var BPromise=require(_0xeb03('0x4'));var rp=require(_0xeb03('0x5'));var fs=require('fs');var path=require(_0xeb03('0x6'));var rimraf=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var attributes=require(_0xeb03('0x9'));module[_0xeb03('0xa')]=function(_0xee2291,_0x4e1cea){return _0xee2291[_0xeb03('0xb')](_0xeb03('0xc'),attributes,{'tableName':_0xeb03('0xd'),'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 08c4c00..e56a151 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 _0x65fe=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2c4aef,_0x116fe2){var _0x3deaed=function(_0x131052){while(--_0x131052){_0x2c4aef['push'](_0x2c4aef['shift']());}};_0x3deaed(++_0x116fe2);}(_0x65fe,0x1ce));var _0xe65f=function(_0x2cbe40,_0x569020){_0x2cbe40=_0x2cbe40-0x0;var _0x4b9e5c=_0x65fe[_0x2cbe40];return _0x4b9e5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe65f('0x0'));var BPromise=require(_0xe65f('0x1'));var rs=require(_0xe65f('0x2'));var fs=require('fs');var Redis=require(_0xe65f('0x3'));var db=require(_0xe65f('0x4'))['db'];var utils=require(_0xe65f('0x5'));var logger=require('../../config/logger')(_0xe65f('0x6'));var config=require(_0xe65f('0x7'));var jayson=require(_0xe65f('0x8'));var client=jayson[_0xe65f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bfe8d,_0x373c87,_0x3b9fad){return new BPromise(function(_0x5a8122,_0xb5dbdb){return client[_0xe65f('0xa')](_0x4bfe8d,_0x3b9fad)[_0xe65f('0xb')](function(_0x2eac8d){logger[_0xe65f('0xc')](_0xe65f('0xd'),_0x373c87,_0xe65f('0xe'));logger[_0xe65f('0xf')](_0xe65f('0x10'),_0x373c87,_0xe65f('0xe'),JSON[_0xe65f('0x11')](_0x2eac8d));if(_0x2eac8d[_0xe65f('0x12')]){if(_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x13')]===0x1f4){logger[_0xe65f('0x12')](_0xe65f('0xd'),_0x373c87,_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x14')]);return _0xb5dbdb(_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x14')]);}logger[_0xe65f('0x12')](_0xe65f('0xd'),_0x373c87,_0x2eac8d['error'][_0xe65f('0x14')]);return _0x5a8122(_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x14')]);}else{logger[_0xe65f('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x373c87,_0xe65f('0xe'));_0x5a8122(_0x2eac8d[_0xe65f('0x15')][_0xe65f('0x14')]);}})['catch'](function(_0x4ef183){logger[_0xe65f('0x12')](_0xe65f('0xd'),_0x373c87,_0x4ef183);_0xb5dbdb(_0x4ef183);});});} \ No newline at end of file +var _0x8834=['http','then','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','ZendeskConfiguration,\x20%s,\x20%s','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x28cbea,_0x59442e){var _0x174d6b=function(_0x2ccaf3){while(--_0x2ccaf3){_0x28cbea['push'](_0x28cbea['shift']());}};_0x174d6b(++_0x59442e);}(_0x8834,0x12a));var _0x4883=function(_0x128be,_0x547569){_0x128be=_0x128be-0x0;var _0x319af3=_0x8834[_0x128be];return _0x319af3;};'use strict';var _=require(_0x4883('0x0'));var util=require(_0x4883('0x1'));var moment=require('moment');var BPromise=require(_0x4883('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4883('0x3'));var db=require(_0x4883('0x4'))['db'];var utils=require(_0x4883('0x5'));var logger=require(_0x4883('0x6'))(_0x4883('0x7'));var config=require('../../config/environment');var jayson=require(_0x4883('0x8'));var client=jayson[_0x4883('0x9')][_0x4883('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27531c,_0x286e25,_0x5a9db0){return new BPromise(function(_0xe9f69f,_0x44b9e1){return client['request'](_0x27531c,_0x5a9db0)[_0x4883('0xb')](function(_0x21871f){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x286e25,'request\x20sent');logger[_0x4883('0xc')](_0x4883('0xd'),_0x286e25,_0x4883('0xe'),JSON[_0x4883('0xf')](_0x21871f));if(_0x21871f[_0x4883('0x10')]){if(_0x21871f[_0x4883('0x10')][_0x4883('0x11')]===0x1f4){logger[_0x4883('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x286e25,_0x21871f[_0x4883('0x10')][_0x4883('0x12')]);return _0x44b9e1(_0x21871f['error'][_0x4883('0x12')]);}logger[_0x4883('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x286e25,_0x21871f['error'][_0x4883('0x12')]);return _0xe9f69f(_0x21871f[_0x4883('0x10')][_0x4883('0x12')]);}else{logger[_0x4883('0x13')](_0x4883('0x14'),_0x286e25,_0x4883('0xe'));_0xe9f69f(_0x21871f[_0x4883('0x15')][_0x4883('0x12')]);}})['catch'](function(_0x5822b2){logger[_0x4883('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x286e25,_0x5822b2);_0x44b9e1(_0x5822b2);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 0eb20b4..fc21c18 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 _0x696d=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x696d,0x65));var _0xd696=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x696d[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0xd696('0x0'));var util=require('util');var path=require(_0xd696('0x1'));var timeout=require(_0xd696('0x2'));var express=require(_0xd696('0x3'));var router=express[_0xd696('0x4')]();var fs_extra=require(_0xd696('0x5'));var auth=require(_0xd696('0x6'));var interaction=require(_0xd696('0x7'));var config=require(_0xd696('0x8'));var controller=require(_0xd696('0x9'));router[_0xd696('0xa')]('/',auth[_0xd696('0xb')](),controller['index']);router[_0xd696('0xa')](_0xd696('0xc'),auth[_0xd696('0xb')](),controller[_0xd696('0xd')]);router['post']('/',auth[_0xd696('0xb')](),controller['create']);router[_0xd696('0xe')](_0xd696('0xc'),auth['isAuthenticated'](),controller[_0xd696('0xf')]);router[_0xd696('0x10')](_0xd696('0xc'),auth['isAuthenticated'](),controller[_0xd696('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf82f=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','show','create','put','update','delete','exports','multer','util','path'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0xf82f,0x8d));var _0xff82=function(_0x47927b,_0x374f23){_0x47927b=_0x47927b-0x0;var _0x5dc8d1=_0xf82f[_0x47927b];return _0x5dc8d1;};'use strict';var multer=require(_0xff82('0x0'));var util=require(_0xff82('0x1'));var path=require(_0xff82('0x2'));var timeout=require(_0xff82('0x3'));var express=require(_0xff82('0x4'));var router=express['Router']();var fs_extra=require(_0xff82('0x5'));var auth=require(_0xff82('0x6'));var interaction=require(_0xff82('0x7'));var config=require(_0xff82('0x8'));var controller=require(_0xff82('0x9'));router[_0xff82('0xa')]('/',auth[_0xff82('0xb')](),controller['index']);router['get']('/:id',auth[_0xff82('0xb')](),controller[_0xff82('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xff82('0xd')]);router[_0xff82('0xe')]('/:id',auth[_0xff82('0xb')](),controller[_0xff82('0xf')]);router[_0xff82('0x10')]('/:id',auth[_0xff82('0xb')](),controller['destroy']);module[_0xff82('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index f2f3dd7..17b814f 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 _0xead6=['exports','ENUM','string','keyValue','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0xead6,0x8f));var _0x6ead=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xead6[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x6ead('0x0'));module[_0x6ead('0x1')]={'type':{'type':Sequelize[_0x6ead('0x2')](_0x6ead('0x3'),'variable','customVariable',_0x6ead('0x4'),_0x6ead('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6ead('0x6')]},'key':{'type':Sequelize[_0x6ead('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x6ead('0x3'),_0x6ead('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x6ead('0x6')]},'idField':{'type':Sequelize[_0x6ead('0x6')]},'nameField':{'type':Sequelize[_0x6ead('0x6')]},'customField':{'type':Sequelize[_0x6ead('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ead('0x6')]}}; \ No newline at end of file +var _0xe723=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3a213b,_0x29fdac){var _0x3898ac=function(_0x422588){while(--_0x422588){_0x3a213b['push'](_0x3a213b['shift']());}};_0x3898ac(++_0x29fdac);}(_0xe723,0x111));var _0x3e72=function(_0x3ec2e1,_0x5d8f00){_0x3ec2e1=_0x3ec2e1-0x0;var _0x10ae56=_0xe723[_0x3ec2e1];return _0x10ae56;};'use strict';var Sequelize=require(_0x3e72('0x0'));module[_0x3e72('0x1')]={'type':{'type':Sequelize[_0x3e72('0x2')](_0x3e72('0x3'),_0x3e72('0x4'),_0x3e72('0x5'),_0x3e72('0x6'),_0x3e72('0x7')),'defaultValue':_0x3e72('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3e72('0x8')]},'keyType':{'type':Sequelize[_0x3e72('0x2')](_0x3e72('0x3'),_0x3e72('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x3e72('0x8')]},'idField':{'type':Sequelize[_0x3e72('0x8')]},'nameField':{'type':Sequelize[_0x3e72('0x8')]},'customField':{'type':Sequelize[_0x3e72('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index dc39ccd..cd49f5a 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 _0x2ac4=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','update','destroy','then','end','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','params'];(function(_0x2110b2,_0x3fdd30){var _0x3d63ab=function(_0x569beb){while(--_0x569beb){_0x2110b2['push'](_0x2110b2['shift']());}};_0x3d63ab(++_0x3fdd30);}(_0x2ac4,0x130));var _0x42ac=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x2ac4[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require(_0x42ac('0x0'));var rimraf=require(_0x42ac('0x1'));var zipdir=require(_0x42ac('0x2'));var jsonpatch=require(_0x42ac('0x3'));var rp=require(_0x42ac('0x4'));var moment=require(_0x42ac('0x5'));var BPromise=require(_0x42ac('0x6'));var Mustache=require(_0x42ac('0x7'));var util=require('util');var path=require(_0x42ac('0x8'));var sox=require(_0x42ac('0x9'));var csv=require(_0x42ac('0xa'));var ejs=require(_0x42ac('0xb'));var fs=require('fs');var fs_extra=require(_0x42ac('0xc'));var _=require(_0x42ac('0xd'));var squel=require(_0x42ac('0xe'));var crypto=require(_0x42ac('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x42ac('0xa'));var querystring=require('querystring');var Papa=require(_0x42ac('0x10'));var Redis=require('ioredis');var authService=require(_0x42ac('0x11'));var qs=require(_0x42ac('0x12'));var as=require(_0x42ac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x42ac('0x14'));var utils=require(_0x42ac('0x15'));var config=require(_0x42ac('0x16'));var licenseUtil=require(_0x42ac('0x17'));var db=require(_0x42ac('0x18'))['db'];function respondWithStatusCode(_0x4d9bd2,_0x571ed6){_0x571ed6=_0x571ed6||0xcc;return function(_0x253645){if(_0x253645){return _0x4d9bd2[_0x42ac('0x19')](_0x571ed6);}return _0x4d9bd2[_0x42ac('0x1a')](_0x571ed6)['end']();};}function respondWithResult(_0xabac7b,_0x5a2c8e){_0x5a2c8e=_0x5a2c8e||0xc8;return function(_0x146908){if(_0x146908){return _0xabac7b['status'](_0x5a2c8e)[_0x42ac('0x1b')](_0x146908);}};}function respondWithFilteredResult(_0x2cfa4d,_0x13354b){return function(_0x5d5f0c){if(_0x5d5f0c){var _0x5dce61=typeof _0x13354b['offset']===_0x42ac('0x1c')&&typeof _0x13354b[_0x42ac('0x1d')]===_0x42ac('0x1c');var _0x230e9a=_0x5d5f0c['count'];var _0x261b89=_0x5dce61?0x0:_0x13354b[_0x42ac('0x1e')];var _0x295073=_0x5dce61?_0x5d5f0c[_0x42ac('0x1f')]:_0x13354b[_0x42ac('0x1e')]+_0x13354b[_0x42ac('0x1d')];var _0x384a1a;if(_0x295073>=_0x230e9a){_0x295073=_0x230e9a;_0x384a1a=0xc8;}else{_0x384a1a=0xce;}_0x2cfa4d[_0x42ac('0x1a')](_0x384a1a);return _0x2cfa4d[_0x42ac('0x20')](_0x42ac('0x21'),_0x261b89+'-'+_0x295073+'/'+_0x230e9a)[_0x42ac('0x1b')](_0x5d5f0c);}return null;};}function patchUpdates(_0x33a912){return function(_0x13df2e){try{jsonpatch['apply'](_0x13df2e,_0x33a912,!![]);}catch(_0x2965ca){return BPromise['reject'](_0x2965ca);}return _0x13df2e['save']();};}function saveUpdates(_0x21cbd1,_0x50e256){return function(_0xe2a905){if(_0xe2a905){return _0xe2a905[_0x42ac('0x22')](_0x21cbd1)['then'](function(_0xcb9c69){return _0xcb9c69;});}return null;};}function removeEntity(_0x206cea,_0x4a62a2){return function(_0x1d91ac){if(_0x1d91ac){return _0x1d91ac[_0x42ac('0x23')]()[_0x42ac('0x24')](function(){_0x206cea[_0x42ac('0x1a')](0xcc)[_0x42ac('0x25')]();});}};}function handleEntityNotFound(_0xaa0835,_0x3368ae){return function(_0x33d0c2){if(!_0x33d0c2){_0xaa0835['sendStatus'](0x194);}return _0x33d0c2;};}function handleError(_0x5549e7,_0x8f89c){_0x8f89c=_0x8f89c||0x1f4;return function(_0x36814a){logger[_0x42ac('0x26')](_0x36814a[_0x42ac('0x27')]);if(_0x36814a[_0x42ac('0x28')]){delete _0x36814a[_0x42ac('0x28')];}_0x5549e7[_0x42ac('0x1a')](_0x8f89c)[_0x42ac('0x29')](_0x36814a);};}exports[_0x42ac('0x2a')]=function(_0x1625d7,_0x56011d){var _0x2dcfa6={},_0x60148d={},_0x52dd82={'count':0x0,'rows':[]};var _0x1034c9=_[_0x42ac('0x2b')](db[_0x42ac('0x2c')][_0x42ac('0x2d')],function(_0x71d698){return{'name':_0x71d698[_0x42ac('0x2e')],'type':_0x71d698['type'][_0x42ac('0x2f')]};});_0x60148d[_0x42ac('0x30')]=_['map'](_0x1034c9,_0x42ac('0x28'));_0x60148d[_0x42ac('0x31')]=_[_0x42ac('0x32')](_0x1625d7[_0x42ac('0x31')]);_0x60148d[_0x42ac('0x33')]=_[_0x42ac('0x34')](_0x60148d[_0x42ac('0x30')],_0x60148d[_0x42ac('0x31')]);_0x2dcfa6[_0x42ac('0x35')]=_['intersection'](_0x60148d[_0x42ac('0x30')],qs[_0x42ac('0x36')](_0x1625d7[_0x42ac('0x31')][_0x42ac('0x36')]));_0x2dcfa6[_0x42ac('0x35')]=_0x2dcfa6['attributes']['length']?_0x2dcfa6['attributes']:_0x60148d[_0x42ac('0x30')];if(!_0x1625d7['query']['hasOwnProperty'](_0x42ac('0x37'))){_0x2dcfa6[_0x42ac('0x1d')]=qs['limit'](_0x1625d7['query'][_0x42ac('0x1d')]);_0x2dcfa6['offset']=qs[_0x42ac('0x1e')](_0x1625d7[_0x42ac('0x31')]['offset']);}_0x2dcfa6[_0x42ac('0x38')]=qs[_0x42ac('0x39')](_0x1625d7[_0x42ac('0x31')][_0x42ac('0x39')]);_0x2dcfa6[_0x42ac('0x3a')]=qs[_0x42ac('0x33')](_[_0x42ac('0x3b')](_0x1625d7[_0x42ac('0x31')],_0x60148d[_0x42ac('0x33')]),_0x1034c9);if(_0x1625d7[_0x42ac('0x31')][_0x42ac('0x3c')]){_0x2dcfa6[_0x42ac('0x3a')]=_[_0x42ac('0x3d')](_0x2dcfa6['where'],{'$or':_[_0x42ac('0x2b')](_0x1034c9,function(_0x3da407){if(_0x3da407[_0x42ac('0x3e')]!==_0x42ac('0x3f')){var _0xf8b69b={};_0xf8b69b[_0x3da407[_0x42ac('0x28')]]={'$like':'%'+_0x1625d7[_0x42ac('0x31')][_0x42ac('0x3c')]+'%'};return _0xf8b69b;}})});}_0x2dcfa6=_['merge']({},_0x2dcfa6,_0x1625d7['options']);var _0xcf56de={'where':_0x2dcfa6['where']};return db[_0x42ac('0x2c')]['count'](_0xcf56de)[_0x42ac('0x24')](function(_0x1db7c2){_0x52dd82[_0x42ac('0x1f')]=_0x1db7c2;if(_0x1625d7[_0x42ac('0x31')][_0x42ac('0x40')]){_0x2dcfa6[_0x42ac('0x41')]=[{'all':!![]}];}return db[_0x42ac('0x2c')][_0x42ac('0x42')](_0x2dcfa6);})[_0x42ac('0x24')](function(_0x1e241d){_0x52dd82[_0x42ac('0x43')]=_0x1e241d;return _0x52dd82;})[_0x42ac('0x24')](respondWithFilteredResult(_0x56011d,_0x2dcfa6))[_0x42ac('0x44')](handleError(_0x56011d,null));};exports[_0x42ac('0x45')]=function(_0x3c14d2,_0xf03051){var _0x2fa4a6={'raw':!![],'where':{'id':_0x3c14d2['params']['id']}},_0x12e098={};_0x12e098['model']=_[_0x42ac('0x32')](db[_0x42ac('0x2c')][_0x42ac('0x2d')]);_0x12e098[_0x42ac('0x31')]=_[_0x42ac('0x32')](_0x3c14d2[_0x42ac('0x31')]);_0x12e098[_0x42ac('0x33')]=_[_0x42ac('0x34')](_0x12e098['model'],_0x12e098[_0x42ac('0x31')]);_0x2fa4a6[_0x42ac('0x35')]=_[_0x42ac('0x34')](_0x12e098[_0x42ac('0x30')],qs[_0x42ac('0x36')](_0x3c14d2[_0x42ac('0x31')][_0x42ac('0x36')]));_0x2fa4a6[_0x42ac('0x35')]=_0x2fa4a6[_0x42ac('0x35')][_0x42ac('0x46')]?_0x2fa4a6['attributes']:_0x12e098['model'];if(_0x3c14d2[_0x42ac('0x31')][_0x42ac('0x40')]){_0x2fa4a6[_0x42ac('0x41')]=[{'all':!![]}];}_0x2fa4a6=_[_0x42ac('0x3d')]({},_0x2fa4a6,_0x3c14d2[_0x42ac('0x47')]);return db['ZendeskField']['find'](_0x2fa4a6)[_0x42ac('0x24')](handleEntityNotFound(_0xf03051,null))[_0x42ac('0x24')](respondWithResult(_0xf03051,null))[_0x42ac('0x44')](handleError(_0xf03051,null));};exports[_0x42ac('0x48')]=function(_0x40a9c8,_0x1d0235){return db['ZendeskField'][_0x42ac('0x48')](_0x40a9c8['body'],{})['then'](respondWithResult(_0x1d0235,0xc9))['catch'](handleError(_0x1d0235,null));};exports[_0x42ac('0x22')]=function(_0x45b9c5,_0x4c3687){if(_0x45b9c5[_0x42ac('0x49')]['id']){delete _0x45b9c5[_0x42ac('0x49')]['id'];}return db[_0x42ac('0x2c')][_0x42ac('0x4a')]({'where':{'id':_0x45b9c5[_0x42ac('0x4b')]['id']}})[_0x42ac('0x24')](handleEntityNotFound(_0x4c3687,null))['then'](saveUpdates(_0x45b9c5[_0x42ac('0x49')],null))[_0x42ac('0x24')](respondWithResult(_0x4c3687,null))[_0x42ac('0x44')](handleError(_0x4c3687,null));};exports[_0x42ac('0x23')]=function(_0x431be0,_0x2f63b3){return db[_0x42ac('0x2c')][_0x42ac('0x4a')]({'where':{'id':_0x431be0['params']['id']}})[_0x42ac('0x24')](handleEntityNotFound(_0x2f63b3,null))[_0x42ac('0x24')](removeEntity(_0x2f63b3,null))[_0x42ac('0x44')](handleError(_0x2f63b3,null));}; \ No newline at end of file +var _0x33e1=['attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskField','rawAttributes','type','key','model','query','keys','intersection','fields'];(function(_0x5c2970,_0x435383){var _0x3f6d7a=function(_0xb438c1){while(--_0xb438c1){_0x5c2970['push'](_0x5c2970['shift']());}};_0x3f6d7a(++_0x435383);}(_0x33e1,0x142));var _0x133e=function(_0x5a8a7a,_0x2a385d){_0x5a8a7a=_0x5a8a7a-0x0;var _0x422f42=_0x33e1[_0x5a8a7a];return _0x422f42;};'use strict';var emlformat=require(_0x133e('0x0'));var rimraf=require(_0x133e('0x1'));var zipdir=require(_0x133e('0x2'));var jsonpatch=require(_0x133e('0x3'));var rp=require(_0x133e('0x4'));var moment=require('moment');var BPromise=require(_0x133e('0x5'));var Mustache=require(_0x133e('0x6'));var util=require(_0x133e('0x7'));var path=require(_0x133e('0x8'));var sox=require(_0x133e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x133e('0xa'));var squel=require(_0x133e('0xb'));var crypto=require(_0x133e('0xc'));var jsforce=require(_0x133e('0xd'));var deskjs=require(_0x133e('0xe'));var toCsv=require(_0x133e('0xf'));var querystring=require(_0x133e('0x10'));var Papa=require(_0x133e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x133e('0x12'));var logger=require(_0x133e('0x13'))(_0x133e('0x14'));var utils=require(_0x133e('0x15'));var config=require(_0x133e('0x16'));var licenseUtil=require(_0x133e('0x17'));var db=require(_0x133e('0x18'))['db'];function respondWithStatusCode(_0x2192f0,_0x256005){_0x256005=_0x256005||0xcc;return function(_0x12714d){if(_0x12714d){return _0x2192f0['sendStatus'](_0x256005);}return _0x2192f0[_0x133e('0x19')](_0x256005)[_0x133e('0x1a')]();};}function respondWithResult(_0x37bd40,_0x227a1f){_0x227a1f=_0x227a1f||0xc8;return function(_0x1fd2d8){if(_0x1fd2d8){return _0x37bd40[_0x133e('0x19')](_0x227a1f)['json'](_0x1fd2d8);}};}function respondWithFilteredResult(_0x4e1547,_0x3bbb5f){return function(_0x5722ed){if(_0x5722ed){var _0xd593e4=typeof _0x3bbb5f['offset']===_0x133e('0x1b')&&typeof _0x3bbb5f['limit']==='undefined';var _0x4aca5f=_0x5722ed[_0x133e('0x1c')];var _0x276902=_0xd593e4?0x0:_0x3bbb5f[_0x133e('0x1d')];var _0x5aeafa=_0xd593e4?_0x5722ed[_0x133e('0x1c')]:_0x3bbb5f[_0x133e('0x1d')]+_0x3bbb5f[_0x133e('0x1e')];var _0x1832a1;if(_0x5aeafa>=_0x4aca5f){_0x5aeafa=_0x4aca5f;_0x1832a1=0xc8;}else{_0x1832a1=0xce;}_0x4e1547[_0x133e('0x19')](_0x1832a1);return _0x4e1547[_0x133e('0x1f')](_0x133e('0x20'),_0x276902+'-'+_0x5aeafa+'/'+_0x4aca5f)['json'](_0x5722ed);}return null;};}function patchUpdates(_0x16073d){return function(_0xf4d9f9){try{jsonpatch[_0x133e('0x21')](_0xf4d9f9,_0x16073d,!![]);}catch(_0x2ce1d9){return BPromise[_0x133e('0x22')](_0x2ce1d9);}return _0xf4d9f9[_0x133e('0x23')]();};}function saveUpdates(_0x49ddb0,_0x1cda65){return function(_0x185033){if(_0x185033){return _0x185033[_0x133e('0x24')](_0x49ddb0)[_0x133e('0x25')](function(_0x52f229){return _0x52f229;});}return null;};}function removeEntity(_0x1948d3,_0x39fb43){return function(_0x5f3f50){if(_0x5f3f50){return _0x5f3f50[_0x133e('0x26')]()[_0x133e('0x25')](function(){_0x1948d3[_0x133e('0x19')](0xcc)[_0x133e('0x1a')]();});}};}function handleEntityNotFound(_0x4431f3,_0x3a2ce6){return function(_0x34e802){if(!_0x34e802){_0x4431f3['sendStatus'](0x194);}return _0x34e802;};}function handleError(_0x43a283,_0x3d9107){_0x3d9107=_0x3d9107||0x1f4;return function(_0x7b5d55){logger['error'](_0x7b5d55[_0x133e('0x27')]);if(_0x7b5d55[_0x133e('0x28')]){delete _0x7b5d55[_0x133e('0x28')];}_0x43a283[_0x133e('0x19')](_0x3d9107)[_0x133e('0x29')](_0x7b5d55);};}exports[_0x133e('0x2a')]=function(_0x241029,_0x46462a){var _0xe420fa={},_0x279970={},_0x440777={'count':0x0,'rows':[]};var _0x448940=_[_0x133e('0x2b')](db[_0x133e('0x2c')][_0x133e('0x2d')],function(_0x4a14fd){return{'name':_0x4a14fd['fieldName'],'type':_0x4a14fd[_0x133e('0x2e')][_0x133e('0x2f')]};});_0x279970[_0x133e('0x30')]=_[_0x133e('0x2b')](_0x448940,_0x133e('0x28'));_0x279970[_0x133e('0x31')]=_[_0x133e('0x32')](_0x241029[_0x133e('0x31')]);_0x279970['filters']=_[_0x133e('0x33')](_0x279970['model'],_0x279970[_0x133e('0x31')]);_0xe420fa['attributes']=_[_0x133e('0x33')](_0x279970['model'],qs[_0x133e('0x34')](_0x241029[_0x133e('0x31')][_0x133e('0x34')]));_0xe420fa[_0x133e('0x35')]=_0xe420fa['attributes']['length']?_0xe420fa[_0x133e('0x35')]:_0x279970['model'];if(!_0x241029['query'][_0x133e('0x36')](_0x133e('0x37'))){_0xe420fa[_0x133e('0x1e')]=qs[_0x133e('0x1e')](_0x241029['query'][_0x133e('0x1e')]);_0xe420fa[_0x133e('0x1d')]=qs[_0x133e('0x1d')](_0x241029[_0x133e('0x31')][_0x133e('0x1d')]);}_0xe420fa[_0x133e('0x38')]=qs[_0x133e('0x39')](_0x241029[_0x133e('0x31')]['sort']);_0xe420fa[_0x133e('0x3a')]=qs[_0x133e('0x3b')](_[_0x133e('0x3c')](_0x241029[_0x133e('0x31')],_0x279970['filters']),_0x448940);if(_0x241029['query'][_0x133e('0x3d')]){_0xe420fa[_0x133e('0x3a')]=_[_0x133e('0x3e')](_0xe420fa[_0x133e('0x3a')],{'$or':_[_0x133e('0x2b')](_0x448940,function(_0x15772e){if(_0x15772e[_0x133e('0x2e')]!==_0x133e('0x3f')){var _0x4699df={};_0x4699df[_0x15772e[_0x133e('0x28')]]={'$like':'%'+_0x241029[_0x133e('0x31')][_0x133e('0x3d')]+'%'};return _0x4699df;}})});}_0xe420fa=_[_0x133e('0x3e')]({},_0xe420fa,_0x241029[_0x133e('0x40')]);var _0x1e28e9={'where':_0xe420fa[_0x133e('0x3a')]};return db[_0x133e('0x2c')][_0x133e('0x1c')](_0x1e28e9)[_0x133e('0x25')](function(_0xca1b4){_0x440777[_0x133e('0x1c')]=_0xca1b4;if(_0x241029['query']['includeAll']){_0xe420fa[_0x133e('0x41')]=[{'all':!![]}];}return db[_0x133e('0x2c')][_0x133e('0x42')](_0xe420fa);})['then'](function(_0x36c66b){_0x440777[_0x133e('0x43')]=_0x36c66b;return _0x440777;})[_0x133e('0x25')](respondWithFilteredResult(_0x46462a,_0xe420fa))[_0x133e('0x44')](handleError(_0x46462a,null));};exports[_0x133e('0x45')]=function(_0x328ae9,_0x515369){var _0x185c7f={'raw':!![],'where':{'id':_0x328ae9[_0x133e('0x46')]['id']}},_0x46a6f3={};_0x46a6f3[_0x133e('0x30')]=_[_0x133e('0x32')](db[_0x133e('0x2c')][_0x133e('0x2d')]);_0x46a6f3[_0x133e('0x31')]=_[_0x133e('0x32')](_0x328ae9[_0x133e('0x31')]);_0x46a6f3[_0x133e('0x3b')]=_[_0x133e('0x33')](_0x46a6f3[_0x133e('0x30')],_0x46a6f3[_0x133e('0x31')]);_0x185c7f[_0x133e('0x35')]=_[_0x133e('0x33')](_0x46a6f3[_0x133e('0x30')],qs[_0x133e('0x34')](_0x328ae9[_0x133e('0x31')][_0x133e('0x34')]));_0x185c7f[_0x133e('0x35')]=_0x185c7f[_0x133e('0x35')][_0x133e('0x47')]?_0x185c7f[_0x133e('0x35')]:_0x46a6f3[_0x133e('0x30')];if(_0x328ae9[_0x133e('0x31')]['includeAll']){_0x185c7f[_0x133e('0x41')]=[{'all':!![]}];}_0x185c7f=_[_0x133e('0x3e')]({},_0x185c7f,_0x328ae9[_0x133e('0x40')]);return db[_0x133e('0x2c')][_0x133e('0x48')](_0x185c7f)['then'](handleEntityNotFound(_0x515369,null))[_0x133e('0x25')](respondWithResult(_0x515369,null))[_0x133e('0x44')](handleError(_0x515369,null));};exports['create']=function(_0x300d1c,_0x4168b1){return db['ZendeskField'][_0x133e('0x49')](_0x300d1c[_0x133e('0x4a')],{})[_0x133e('0x25')](respondWithResult(_0x4168b1,0xc9))[_0x133e('0x44')](handleError(_0x4168b1,null));};exports['update']=function(_0x3d091f,_0x4cb5f8){if(_0x3d091f[_0x133e('0x4a')]['id']){delete _0x3d091f['body']['id'];}return db[_0x133e('0x2c')]['find']({'where':{'id':_0x3d091f[_0x133e('0x46')]['id']}})[_0x133e('0x25')](handleEntityNotFound(_0x4cb5f8,null))['then'](saveUpdates(_0x3d091f[_0x133e('0x4a')],null))['then'](respondWithResult(_0x4cb5f8,null))[_0x133e('0x44')](handleError(_0x4cb5f8,null));};exports[_0x133e('0x26')]=function(_0x17a988,_0xd7ef21){return db[_0x133e('0x2c')][_0x133e('0x48')]({'where':{'id':_0x17a988[_0x133e('0x46')]['id']}})[_0x133e('0x25')](handleEntityNotFound(_0xd7ef21,null))[_0x133e('0x25')](removeEntity(_0xd7ef21,null))[_0x133e('0x44')](handleError(_0xd7ef21,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 00219c5..68156ef 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 _0x09b1=['zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields'];(function(_0x136b8d,_0x428d95){var _0x32ee8a=function(_0xa7c348){while(--_0xa7c348){_0x136b8d['push'](_0x136b8d['shift']());}};_0x32ee8a(++_0x428d95);}(_0x09b1,0x9c));var _0x109b=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x09b1[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x109b('0x0'));var util=require(_0x109b('0x1'));var logger=require(_0x109b('0x2'))(_0x109b('0x3'));var moment=require(_0x109b('0x4'));var BPromise=require(_0x109b('0x5'));var rp=require(_0x109b('0x6'));var fs=require('fs');var path=require(_0x109b('0x7'));var rimraf=require(_0x109b('0x8'));var config=require(_0x109b('0x9'));var attributes=require(_0x109b('0xa'));module[_0x109b('0xb')]=function(_0x462cb6,_0x3dc611){return _0x462cb6['define'](_0x109b('0xc'),attributes,{'tableName':_0x109b('0xd'),'paranoid':![],'indexes':[{'name':_0x109b('0xe'),'fields':[_0x109b('0xf'),_0x109b('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbcf5=['ZendeskField','zendesk_unique_index','idField','lodash','../../config/logger','bluebird','path','./intZendeskField.attributes','define'];(function(_0x551a99,_0x243360){var _0x4e1719=function(_0x42b90d){while(--_0x42b90d){_0x551a99['push'](_0x551a99['shift']());}};_0x4e1719(++_0x243360);}(_0xbcf5,0x16b));var _0x5bcf=function(_0x22ffaf,_0x3c3246){_0x22ffaf=_0x22ffaf-0x0;var _0x1424cb=_0xbcf5[_0x22ffaf];return _0x1424cb;};'use strict';var _=require(_0x5bcf('0x0'));var util=require('util');var logger=require(_0x5bcf('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5bcf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bcf('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5bcf('0x4'));module['exports']=function(_0x132dee,_0x281a82){return _0x132dee[_0x5bcf('0x5')](_0x5bcf('0x6'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x5bcf('0x7'),'fields':[_0x5bcf('0x8'),'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 27b3e4b..c98486f 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 _0xa0ce=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x2e5bd9,_0x1bc893){var _0x44be4b=function(_0x545d5f){while(--_0x545d5f){_0x2e5bd9['push'](_0x2e5bd9['shift']());}};_0x44be4b(++_0x1bc893);}(_0xa0ce,0x195));var _0xea0c=function(_0x5b4917,_0x2f9906){_0x5b4917=_0x5b4917-0x0;var _0x387825=_0xa0ce[_0x5b4917];return _0x387825;};'use strict';var _=require(_0xea0c('0x0'));var util=require('util');var moment=require(_0xea0c('0x1'));var BPromise=require(_0xea0c('0x2'));var rs=require(_0xea0c('0x3'));var fs=require('fs');var Redis=require(_0xea0c('0x4'));var db=require(_0xea0c('0x5'))['db'];var utils=require(_0xea0c('0x6'));var logger=require(_0xea0c('0x7'))(_0xea0c('0x8'));var config=require(_0xea0c('0x9'));var jayson=require(_0xea0c('0xa'));var client=jayson['client'][_0xea0c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a58b6,_0x3f7aff,_0x241b52){return new BPromise(function(_0x50eb46,_0x1d5bc7){return client['request'](_0x2a58b6,_0x241b52)[_0xea0c('0xc')](function(_0x359152){logger[_0xea0c('0xd')](_0xea0c('0xe'),_0x3f7aff,_0xea0c('0xf'));logger['debug'](_0xea0c('0x10'),_0x3f7aff,_0xea0c('0xf'),JSON[_0xea0c('0x11')](_0x359152));if(_0x359152[_0xea0c('0x12')]){if(_0x359152['error']['code']===0x1f4){logger[_0xea0c('0x12')](_0xea0c('0xe'),_0x3f7aff,_0x359152[_0xea0c('0x12')][_0xea0c('0x13')]);return _0x1d5bc7(_0x359152['error']['message']);}logger['error'](_0xea0c('0xe'),_0x3f7aff,_0x359152[_0xea0c('0x12')]['message']);return _0x50eb46(_0x359152[_0xea0c('0x12')][_0xea0c('0x13')]);}else{logger['info'](_0xea0c('0xe'),_0x3f7aff,_0xea0c('0xf'));_0x50eb46(_0x359152[_0xea0c('0x14')][_0xea0c('0x13')]);}})[_0xea0c('0x15')](function(_0x3281a1){logger[_0xea0c('0x12')](_0xea0c('0xe'),_0x3f7aff,_0x3281a1);_0x1d5bc7(_0x3281a1);});});} \ No newline at end of file +var _0xf8ee=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment'];(function(_0xfa2f68,_0x23836e){var _0x252d9a=function(_0x285e61){while(--_0x285e61){_0xfa2f68['push'](_0xfa2f68['shift']());}};_0x252d9a(++_0x23836e);}(_0xf8ee,0x7c));var _0xef8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf8ee[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xef8e('0x0'));var moment=require(_0xef8e('0x1'));var BPromise=require(_0xef8e('0x2'));var rs=require(_0xef8e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef8e('0x4'))['db'];var utils=require(_0xef8e('0x5'));var logger=require(_0xef8e('0x6'))('rpc');var config=require(_0xef8e('0x7'));var jayson=require(_0xef8e('0x8'));var client=jayson['client'][_0xef8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3533c6,_0x2de185,_0x574b90){return new BPromise(function(_0x2eec4c,_0x7af420){return client[_0xef8e('0xa')](_0x3533c6,_0x574b90)[_0xef8e('0xb')](function(_0x51e27d){logger[_0xef8e('0xc')](_0xef8e('0xd'),_0x2de185,_0xef8e('0xe'));logger[_0xef8e('0xf')](_0xef8e('0x10'),_0x2de185,_0xef8e('0xe'),JSON[_0xef8e('0x11')](_0x51e27d));if(_0x51e27d[_0xef8e('0x12')]){if(_0x51e27d[_0xef8e('0x12')][_0xef8e('0x13')]===0x1f4){logger['error'](_0xef8e('0xd'),_0x2de185,_0x51e27d[_0xef8e('0x12')][_0xef8e('0x14')]);return _0x7af420(_0x51e27d[_0xef8e('0x12')]['message']);}logger['error'](_0xef8e('0xd'),_0x2de185,_0x51e27d['error'][_0xef8e('0x14')]);return _0x2eec4c(_0x51e27d[_0xef8e('0x12')][_0xef8e('0x14')]);}else{logger[_0xef8e('0xc')](_0xef8e('0xd'),_0x2de185,'request\x20sent');_0x2eec4c(_0x51e27d['result'][_0xef8e('0x14')]);}})['catch'](function(_0x1130f4){logger['error'](_0xef8e('0xd'),_0x2de185,_0x1130f4);_0x7af420(_0x1130f4);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 5c38319..a88e81b 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 _0x7f9f=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x43fb15,_0x4b3f5b){var _0x42d47a=function(_0x27859b){while(--_0x27859b){_0x43fb15['push'](_0x43fb15['shift']());}};_0x42d47a(++_0x4b3f5b);}(_0x7f9f,0x1ae));var _0xf7f9=function(_0xc16f38,_0x22cdb9){_0xc16f38=_0xc16f38-0x0;var _0x11a838=_0x7f9f[_0xc16f38];return _0x11a838;};'use strict';var multer=require(_0xf7f9('0x0'));var util=require('util');var path=require(_0xf7f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xf7f9('0x2'));var router=express['Router']();var fs_extra=require(_0xf7f9('0x3'));var auth=require(_0xf7f9('0x4'));var interaction=require(_0xf7f9('0x5'));var config=require(_0xf7f9('0x6'));var controller=require(_0xf7f9('0x7'));router[_0xf7f9('0x8')]('/',auth[_0xf7f9('0x9')](),controller[_0xf7f9('0xa')]);router[_0xf7f9('0x8')](_0xf7f9('0xb'),auth[_0xf7f9('0x9')](),controller[_0xf7f9('0xc')]);router['get'](_0xf7f9('0xd'),auth[_0xf7f9('0x9')](),controller[_0xf7f9('0xe')]);router['get'](_0xf7f9('0xf'),auth['isAuthenticated'](),controller[_0xf7f9('0x10')]);router[_0xf7f9('0x11')]('/',auth['isAuthenticated'](),controller[_0xf7f9('0x12')]);router[_0xf7f9('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xf7f9('0x13')](_0xf7f9('0xb'),auth[_0xf7f9('0x9')](),controller[_0xf7f9('0x14')]);router[_0xf7f9('0x15')](_0xf7f9('0xb'),auth['isAuthenticated'](),controller[_0xf7f9('0x16')]);module[_0xf7f9('0x17')]=router; \ No newline at end of file +var _0x4263=['addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create'];(function(_0x23597f,_0x1e34ac){var _0x237f67=function(_0x46f9b8){while(--_0x46f9b8){_0x23597f['push'](_0x23597f['shift']());}};_0x237f67(++_0x1e34ac);}(_0x4263,0xdc));var _0x3426=function(_0x2a4bc0,_0x4b2c3c){_0x2a4bc0=_0x2a4bc0-0x0;var _0x20f5fc=_0x4263[_0x2a4bc0];return _0x20f5fc;};'use strict';var multer=require(_0x3426('0x0'));var util=require(_0x3426('0x1'));var path=require(_0x3426('0x2'));var timeout=require(_0x3426('0x3'));var express=require(_0x3426('0x4'));var router=express[_0x3426('0x5')]();var fs_extra=require(_0x3426('0x6'));var auth=require(_0x3426('0x7'));var interaction=require(_0x3426('0x8'));var config=require('../../config/environment');var controller=require(_0x3426('0x9'));router[_0x3426('0xa')]('/',auth['isAuthenticated'](),controller[_0x3426('0xb')]);router[_0x3426('0xa')](_0x3426('0xc'),auth[_0x3426('0xd')](),controller[_0x3426('0xe')]);router[_0x3426('0xa')](_0x3426('0xf'),auth[_0x3426('0xd')](),controller[_0x3426('0x10')]);router[_0x3426('0xa')](_0x3426('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0x3426('0x12')]('/',auth[_0x3426('0xd')](),controller[_0x3426('0x13')]);router[_0x3426('0x12')](_0x3426('0xf'),auth[_0x3426('0xd')](),controller[_0x3426('0x14')]);router[_0x3426('0x15')]('/:id',auth[_0x3426('0xd')](),controller[_0x3426('0x16')]);router[_0x3426('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 970e492..a4fee10 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 _0x668b=['exports','STRING','sequelize'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x668b,0x140));var _0xb668=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0x668b[_0x65d12e];return _0x4274e0;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb668('0x2')]},'host':{'type':Sequelize[_0xb668('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb668('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb668('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xb668('0x2')]},'refreshToken':{'type':Sequelize[_0xb668('0x2')]}}; \ No newline at end of file +var _0x9c44=['STRING'];(function(_0x59f066,_0x3d8a42){var _0x21187c=function(_0x17a6ee){while(--_0x17a6ee){_0x59f066['push'](_0x59f066['shift']());}};_0x21187c(++_0x3d8a42);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')]},'description':{'type':Sequelize[_0x49c4('0x0')]},'host':{'type':Sequelize[_0x49c4('0x0')]},'zone':{'type':Sequelize[_0x49c4('0x0')]},'clientId':{'type':Sequelize[_0x49c4('0x0')]},'clientSecret':{'type':Sequelize[_0x49c4('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x49c4('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f789105..5ecee13 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 _0x0c44=['zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','Calls','response','error','message','Subject','Description','WhoId','Call_Duration','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','Content-Range','apply','reject','update','then','sendStatus','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','length','sort','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','refreshToken'];(function(_0x281353,_0x5d53a9){var _0x4f4e7b=function(_0x43ade6){while(--_0x43ade6){_0x281353['push'](_0x281353['shift']());}};_0x4f4e7b(++_0x5d53a9);}(_0x0c44,0x182));var _0x40c4=function(_0x5c5231,_0x47847e){_0x5c5231=_0x5c5231-0x0;var _0x47c48c=_0x0c44[_0x5c5231];return _0x47c48c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40c4('0x0'));var zipdir=require(_0x40c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40c4('0x2'));var moment=require(_0x40c4('0x3'));var BPromise=require(_0x40c4('0x4'));var Mustache=require(_0x40c4('0x5'));var util=require('util');var path=require(_0x40c4('0x6'));var sox=require('sox');var csv=require(_0x40c4('0x7'));var ejs=require(_0x40c4('0x8'));var fs=require('fs');var fs_extra=require(_0x40c4('0x9'));var _=require('lodash');var squel=require(_0x40c4('0xa'));var crypto=require(_0x40c4('0xb'));var jsforce=require(_0x40c4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x40c4('0x7'));var querystring=require('querystring');var Papa=require(_0x40c4('0xd'));var Redis=require(_0x40c4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x40c4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40c4('0x10'));var logger=require(_0x40c4('0x11'))(_0x40c4('0x12'));var utils=require(_0x40c4('0x13'));var config=require(_0x40c4('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x40c4('0x15'));function respondWithStatusCode(_0x519904,_0x390e96){_0x390e96=_0x390e96||0xcc;return function(_0x349471){if(_0x349471){return _0x519904['sendStatus'](_0x390e96);}return _0x519904[_0x40c4('0x16')](_0x390e96)[_0x40c4('0x17')]();};}function respondWithResult(_0x1cd12e,_0x4b8eba){_0x4b8eba=_0x4b8eba||0xc8;return function(_0x363ec2){if(_0x363ec2){return _0x1cd12e[_0x40c4('0x16')](_0x4b8eba)[_0x40c4('0x18')](_0x363ec2);}};}function respondWithFilteredResult(_0x372b47,_0x164037){return function(_0x15955b){if(_0x15955b){var _0x177111=typeof _0x164037['offset']===_0x40c4('0x19')&&typeof _0x164037['limit']===_0x40c4('0x19');var _0x5f374c=_0x15955b[_0x40c4('0x1a')];var _0x38ad94=_0x177111?0x0:_0x164037['offset'];var _0x4630e4=_0x177111?_0x15955b['count']:_0x164037['offset']+_0x164037['limit'];var _0x3af19b;if(_0x4630e4>=_0x5f374c){_0x4630e4=_0x5f374c;_0x3af19b=0xc8;}else{_0x3af19b=0xce;}_0x372b47[_0x40c4('0x16')](_0x3af19b);return _0x372b47['set'](_0x40c4('0x1b'),_0x38ad94+'-'+_0x4630e4+'/'+_0x5f374c)['json'](_0x15955b);}return null;};}function patchUpdates(_0x5ac346){return function(_0x533784){try{jsonpatch[_0x40c4('0x1c')](_0x533784,_0x5ac346,!![]);}catch(_0x1df5b7){return BPromise[_0x40c4('0x1d')](_0x1df5b7);}return _0x533784['save']();};}function saveUpdates(_0x52be01,_0x4dd26e){return function(_0x107916){if(_0x107916){return _0x107916[_0x40c4('0x1e')](_0x52be01)[_0x40c4('0x1f')](function(_0x221dad){return _0x221dad;});}return null;};}function removeEntity(_0x3f95c2,_0x5cdb47){return function(_0x307cf5){if(_0x307cf5){return _0x307cf5['destroy']()[_0x40c4('0x1f')](function(){_0x3f95c2[_0x40c4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17cb94,_0x13c5b4){return function(_0x13237d){if(!_0x13237d){_0x17cb94[_0x40c4('0x20')](0x194);}return _0x13237d;};}function handleError(_0x2ed78d,_0x2b30df){_0x2b30df=_0x2b30df||0x1f4;return function(_0x434c85){logger['error'](_0x434c85['stack']);if(_0x434c85[_0x40c4('0x21')]){delete _0x434c85[_0x40c4('0x21')];}_0x2ed78d[_0x40c4('0x16')](_0x2b30df)['send'](_0x434c85);};}exports[_0x40c4('0x22')]=function(_0x2ea7c2,_0x251801){var _0x21330a={},_0x4ba584={},_0x14658d={'count':0x0,'rows':[]};var _0x4523bb=_[_0x40c4('0x23')](db[_0x40c4('0x24')][_0x40c4('0x25')],function(_0x27bcf1){return{'name':_0x27bcf1[_0x40c4('0x26')],'type':_0x27bcf1[_0x40c4('0x27')][_0x40c4('0x28')]};});_0x4ba584['model']=_[_0x40c4('0x23')](_0x4523bb,_0x40c4('0x21'));_0x4ba584['query']=_[_0x40c4('0x29')](_0x2ea7c2[_0x40c4('0x2a')]);_0x4ba584[_0x40c4('0x2b')]=_['intersection'](_0x4ba584[_0x40c4('0x2c')],_0x4ba584['query']);_0x21330a[_0x40c4('0x2d')]=_[_0x40c4('0x2e')](_0x4ba584[_0x40c4('0x2c')],qs[_0x40c4('0x2f')](_0x2ea7c2['query'][_0x40c4('0x2f')]));_0x21330a[_0x40c4('0x2d')]=_0x21330a[_0x40c4('0x2d')]['length']?_0x21330a['attributes']:_0x4ba584[_0x40c4('0x2c')];if(!_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x30')](_0x40c4('0x31'))){_0x21330a[_0x40c4('0x32')]=qs['limit'](_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x32')]);_0x21330a[_0x40c4('0x33')]=qs[_0x40c4('0x33')](_0x2ea7c2[_0x40c4('0x2a')]['offset']);}_0x21330a[_0x40c4('0x34')]=qs['sort'](_0x2ea7c2[_0x40c4('0x2a')]['sort']);_0x21330a[_0x40c4('0x35')]=qs[_0x40c4('0x2b')](_[_0x40c4('0x36')](_0x2ea7c2['query'],_0x4ba584[_0x40c4('0x2b')]),_0x4523bb);if(_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x37')]){_0x21330a['where']=_[_0x40c4('0x38')](_0x21330a[_0x40c4('0x35')],{'$or':_[_0x40c4('0x23')](_0x4523bb,function(_0x3ed9b0){if(_0x3ed9b0[_0x40c4('0x27')]!==_0x40c4('0x39')){var _0x37cc04={};_0x37cc04[_0x3ed9b0['name']]={'$like':'%'+_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x37')]+'%'};return _0x37cc04;}})});}_0x21330a=_[_0x40c4('0x38')]({},_0x21330a,_0x2ea7c2['options']);var _0x1541b0={'where':_0x21330a[_0x40c4('0x35')]};return db[_0x40c4('0x24')]['count'](_0x1541b0)[_0x40c4('0x1f')](function(_0x24e3e9){_0x14658d[_0x40c4('0x1a')]=_0x24e3e9;if(_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x3a')]){_0x21330a[_0x40c4('0x3b')]=[{'all':!![]}];}return db[_0x40c4('0x24')][_0x40c4('0x3c')](_0x21330a);})[_0x40c4('0x1f')](function(_0x45e50c){_0x14658d[_0x40c4('0x3d')]=_0x45e50c;return _0x14658d;})['then'](respondWithFilteredResult(_0x251801,_0x21330a))[_0x40c4('0x3e')](handleError(_0x251801,null));};exports['show']=function(_0x4533ab,_0x4ce31f){var _0x1d7a9a={'raw':![],'where':{'id':_0x4533ab['params']['id']}},_0x2a9c10={};_0x2a9c10[_0x40c4('0x2c')]=_['keys'](db['ZohoAccount'][_0x40c4('0x25')]);_0x2a9c10[_0x40c4('0x2a')]=_[_0x40c4('0x29')](_0x4533ab[_0x40c4('0x2a')]);_0x2a9c10[_0x40c4('0x2b')]=_[_0x40c4('0x2e')](_0x2a9c10[_0x40c4('0x2c')],_0x2a9c10[_0x40c4('0x2a')]);_0x1d7a9a[_0x40c4('0x2d')]=_[_0x40c4('0x2e')](_0x2a9c10[_0x40c4('0x2c')],qs['fields'](_0x4533ab[_0x40c4('0x2a')][_0x40c4('0x2f')]));_0x1d7a9a[_0x40c4('0x2d')]=_0x1d7a9a[_0x40c4('0x2d')]['length']?_0x1d7a9a[_0x40c4('0x2d')]:_0x2a9c10[_0x40c4('0x2c')];if(_0x4533ab[_0x40c4('0x2a')][_0x40c4('0x3a')]){_0x1d7a9a[_0x40c4('0x3b')]=[{'all':!![]}];}_0x1d7a9a=_[_0x40c4('0x38')]({},_0x1d7a9a,_0x4533ab[_0x40c4('0x3f')]);return db[_0x40c4('0x24')]['find'](_0x1d7a9a)['then'](handleEntityNotFound(_0x4ce31f,null))[_0x40c4('0x1f')](respondWithResult(_0x4ce31f,null))[_0x40c4('0x3e')](handleError(_0x4ce31f,null));};exports['create']=function(_0x30364f,_0x62f4c3){return db[_0x40c4('0x24')]['create'](_0x30364f[_0x40c4('0x40')],{})[_0x40c4('0x1f')](respondWithResult(_0x62f4c3,0xc9))[_0x40c4('0x3e')](handleError(_0x62f4c3,null));};exports[_0x40c4('0x1e')]=function(_0x3f8b3b,_0x5d99d5){if(_0x3f8b3b[_0x40c4('0x40')]['id']){delete _0x3f8b3b[_0x40c4('0x40')]['id'];}return db[_0x40c4('0x24')]['find']({'where':{'id':_0x3f8b3b[_0x40c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5d99d5,null))[_0x40c4('0x1f')](saveUpdates(_0x3f8b3b['body'],null))[_0x40c4('0x1f')](respondWithResult(_0x5d99d5,null))[_0x40c4('0x3e')](handleError(_0x5d99d5,null));};exports[_0x40c4('0x42')]=function(_0xeca72f,_0x50141a){return db[_0x40c4('0x24')]['find']({'where':{'id':_0xeca72f['params']['id']}})[_0x40c4('0x1f')](handleEntityNotFound(_0x50141a,null))[_0x40c4('0x1f')](removeEntity(_0x50141a,null))[_0x40c4('0x3e')](handleError(_0x50141a,null));};exports[_0x40c4('0x43')]=function(_0x19a139,_0x3c867b,_0x1854c0){var _0xd8549a={};var _0x22df57={};var _0x38cafc;var _0x5d2bf7;return db['ZohoAccount'][_0x40c4('0x44')]({'where':{'id':_0x19a139[_0x40c4('0x41')]['id']}})[_0x40c4('0x1f')](handleEntityNotFound(_0x3c867b,null))[_0x40c4('0x1f')](function(_0x5bb26e){if(_0x5bb26e){_0x38cafc=_0x5bb26e;_0x22df57['model']=_[_0x40c4('0x29')](db[_0x40c4('0x45')]['rawAttributes']);_0x22df57[_0x40c4('0x2a')]=_[_0x40c4('0x29')](_0x19a139[_0x40c4('0x2a')]);_0x22df57[_0x40c4('0x2b')]=_[_0x40c4('0x2e')](_0x22df57['model'],_0x22df57[_0x40c4('0x2a')]);_0xd8549a['attributes']=_[_0x40c4('0x2e')](_0x22df57[_0x40c4('0x2c')],qs[_0x40c4('0x2f')](_0x19a139['query'][_0x40c4('0x2f')]));_0xd8549a['attributes']=_0xd8549a[_0x40c4('0x2d')][_0x40c4('0x46')]?_0xd8549a[_0x40c4('0x2d')]:_0x22df57[_0x40c4('0x2c')];_0xd8549a[_0x40c4('0x34')]=qs[_0x40c4('0x47')](_0x19a139[_0x40c4('0x2a')][_0x40c4('0x47')]);_0xd8549a[_0x40c4('0x35')]=qs[_0x40c4('0x2b')](_[_0x40c4('0x36')](_0x19a139[_0x40c4('0x2a')],_0x22df57[_0x40c4('0x2b')]));if(_0x19a139[_0x40c4('0x2a')]['filter']){_0xd8549a[_0x40c4('0x35')]=_[_0x40c4('0x38')](_0xd8549a[_0x40c4('0x35')],{'$or':_[_0x40c4('0x23')](_0xd8549a[_0x40c4('0x2d')],function(_0x32fa0f){var _0x16d5ad={};_0x16d5ad[_0x32fa0f]={'$like':'%'+_0x19a139['query']['filter']+'%'};return _0x16d5ad;})});}_0xd8549a=_['merge']({},_0xd8549a,_0x19a139[_0x40c4('0x3f')]);return _0x38cafc[_0x40c4('0x43')](_0xd8549a);}})[_0x40c4('0x1f')](function(_0x1ee889){if(_0x1ee889){_0x5d2bf7=_0x1ee889['length'];if(!_0x19a139[_0x40c4('0x2a')][_0x40c4('0x30')](_0x40c4('0x31'))){_0xd8549a[_0x40c4('0x32')]=qs[_0x40c4('0x32')](_0x19a139['query'][_0x40c4('0x32')]);_0xd8549a[_0x40c4('0x33')]=qs[_0x40c4('0x33')](_0x19a139[_0x40c4('0x2a')][_0x40c4('0x33')]);}return _0x38cafc[_0x40c4('0x43')](_0xd8549a);}})[_0x40c4('0x1f')](function(_0xe71f1){if(_0xe71f1){return _0xe71f1?{'count':_0x5d2bf7,'rows':_0xe71f1}:null;}})[_0x40c4('0x1f')](respondWithResult(_0x3c867b,null))[_0x40c4('0x3e')](handleError(_0x3c867b,null));};exports['addConfiguration']=function(_0x54d62a,_0xcc6730,_0x3d68ac){if(_0x54d62a[_0x40c4('0x40')]['id']){delete _0x54d62a[_0x40c4('0x40')]['id'];}return db[_0x40c4('0x24')][_0x40c4('0x44')]({'where':{'id':_0x54d62a[_0x40c4('0x41')]['id']}})[_0x40c4('0x1f')](handleEntityNotFound(_0xcc6730,null))[_0x40c4('0x1f')](function(_0x13a7a2){if(_0x13a7a2){_0x54d62a[_0x40c4('0x40')][_0x40c4('0x48')]=_0x13a7a2['id'];_0x54d62a['body'][_0x40c4('0x49')]=integrations[_0x40c4('0x4a')](_0x54d62a[_0x40c4('0x40')][_0x40c4('0x4b')],_0x54d62a[_0x40c4('0x40')][_0x40c4('0x27')]);_0x54d62a[_0x40c4('0x40')][_0x40c4('0x4c')]=integrations[_0x40c4('0x4d')](_0x54d62a[_0x40c4('0x40')]['channel'],_0x54d62a[_0x40c4('0x40')][_0x40c4('0x27')]);return db[_0x40c4('0x45')][_0x40c4('0x4e')](_0x54d62a[_0x40c4('0x40')],{'include':[{'model':db['ZohoField'],'as':_0x40c4('0x49')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x40c4('0x1f')](respondWithResult(_0xcc6730,null))[_0x40c4('0x3e')](handleError(_0xcc6730,null));};function getAccessToken(_0x1c12a7){return new Promise(function(_0x556317,_0x1f8480){var _0x1b1cb1;switch(_0x1c12a7[_0x40c4('0x4f')]){case'US':_0x1b1cb1=_0x40c4('0x50');break;case'AU':_0x1b1cb1=_0x40c4('0x51');break;case'EU':_0x1b1cb1='https://accounts.zoho.eu';break;case'IN':_0x1b1cb1=_0x40c4('0x52');break;case'CN':_0x1b1cb1=_0x40c4('0x53');break;default:_0x1b1cb1=_0x40c4('0x54');break;}var _0x386588={'method':_0x40c4('0x55'),'uri':_0x1b1cb1+'/oauth/v2/token','qs':{'refresh_token':_0x1c12a7['refreshToken'],'client_id':_0x1c12a7[_0x40c4('0x56')],'client_secret':_0x1c12a7[_0x40c4('0x57')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x386588)[_0x40c4('0x1f')](function(_0x1d0812){if(_0x1d0812[_0x40c4('0x58')]){_0x556317(_0x1d0812[_0x40c4('0x58')]);}else{_0x1f8480(_0x40c4('0x59'));}})[_0x40c4('0x3e')](function(_0xd30099){_0x1f8480(_0xd30099);});});}exports['getFields']=function(_0x5d6618,_0x565c1a,_0x22822c){var _0x5f2d89,_0x28db88,_0xafb8d2,_0x1eafd3,_0x3677ea;return db['ZohoAccount']['findOne']({'where':{'id':_0x5d6618[_0x40c4('0x41')]['id']},'attributes':['id',_0x40c4('0x5a'),_0x40c4('0x4f'),_0x40c4('0x56'),_0x40c4('0x57'),_0x40c4('0x5b'),_0x40c4('0x5c'),_0x40c4('0x5d')]})[_0x40c4('0x1f')](handleEntityNotFound(_0x565c1a,null))[_0x40c4('0x1f')](function(_0x3fedef){_0x3677ea=_0x3fedef;_0x5f2d89=_0x3677ea[_0x40c4('0x5a')];_0x28db88=_0x5f2d89===_0x40c4('0x5e')?'eu':'com';_0xafb8d2=_0x3677ea[_0x40c4('0x5b')];var _0x2485c7=_0xafb8d2[_0x40c4('0x5f')](-0x1);if(_0x2485c7==='/'||_0x2485c7==='\x5c'||_0x2485c7===':'){_0xafb8d2=_0xafb8d2['substring'](0x0,_0xafb8d2[_0x40c4('0x60')](_0x2485c7));}if(!_0x3677ea['refreshToken']){throw new Error(_0x40c4('0x61'));}return getAccessToken(_0x3677ea);})['then'](function(_0x38b0e2){if(_0x38b0e2){return rp({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x28db88),'qs':{'module':_0x40c4('0x62')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x38b0e2},'json':!![]});}})[_0x40c4('0x1f')](function(_0xa9d22d){if(_0xa9d22d){if(_0xa9d22d[_0x40c4('0x63')]&&_0xa9d22d[_0x40c4('0x63')][_0x40c4('0x64')]){throw new Error(_0xa9d22d[_0x40c4('0x63')][_0x40c4('0x64')][_0x40c4('0x65')]);}var _0x374e17=[];var _0xd792a8=[];var _0x56f381=['Owner',_0x40c4('0x66'),_0x40c4('0x67'),_0x40c4('0x68'),_0x40c4('0x69'),'Call_Result','Call_Start_Time',_0x40c4('0x6a')];_0xd792a8=_[_0x40c4('0x6b')](_0xa9d22d[_0x40c4('0x2f')],function(_0x57e534){return _0x56f381['includes'](_0x57e534[_0x40c4('0x6c')]);});for(var _0x59ef38=0x0;_0x59ef38<_0xd792a8[_0x40c4('0x46')];_0x59ef38++){if(_0xd792a8[_0x59ef38][_0x40c4('0x6d')]===![]){_0x374e17[_0x40c4('0x6e')]({'id':_0xd792a8[_0x59ef38]['id'],'name':_0xd792a8[_0x59ef38][_0x40c4('0x6f')],'custom':_0xd792a8[_0x59ef38][_0x40c4('0x70')],'options':_0xd792a8[_0x59ef38]['data_type']===_0x40c4('0x71')&&_0xd792a8[_0x59ef38][_0x40c4('0x72')][_0x40c4('0x46')]>-0x1?_[_0x40c4('0x23')](_0xd792a8[_0x59ef38]['pick_list_values'],function(_0x236eff){return{'name':_0x236eff,'value':_0x236eff};}):[]});}}return{'count':_0x374e17['length'],'rows':_0x374e17};}else{return{'count':0x0,'rows':[]};}})[_0x40c4('0x1f')](respondWithResult(_0x565c1a,null))['catch'](function(_0x1ee4bf){var _0x1daa0c=_0x5d6618[_0x40c4('0x2a')][_0x40c4('0x73')]?0x1f4:_0x1ee4bf[_0x40c4('0x74')]||0x1f4;logger[_0x40c4('0x64')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1daa0c,JSON[_0x40c4('0x75')](_0x1ee4bf));delete _0x1ee4bf['name'];if(_0x1daa0c===0x191){_0x1daa0c=0x190;}_0x565c1a[_0x40c4('0x16')](_0x1daa0c)[_0x40c4('0x76')](_0x5d6618[_0x40c4('0x2a')][_0x40c4('0x73')]?{'message':_0x40c4('0x77'),'statusCode':_0x1ee4bf[_0x40c4('0x74')]}:_0x1ee4bf);});}; \ No newline at end of file +var _0xb75c=['refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','com','serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','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','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','ZohoAccount','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','findAll','rows','catch','show','rawAttributes','fields','includeAll','include','options','find','create','body','params','getConfigurations','ZohoConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token'];(function(_0x3ff352,_0x257e04){var _0x5f184c=function(_0x3e36eb){while(--_0x3e36eb){_0x3ff352['push'](_0x3ff352['shift']());}};_0x5f184c(++_0x257e04);}(_0xb75c,0x1b8));var _0xcb75=function(_0xe4b102,_0x269fe6){_0xe4b102=_0xe4b102-0x0;var _0x44db7c=_0xb75c[_0xe4b102];return _0x44db7c;};'use strict';var emlformat=require(_0xcb75('0x0'));var rimraf=require(_0xcb75('0x1'));var zipdir=require(_0xcb75('0x2'));var jsonpatch=require(_0xcb75('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcb75('0x4'));var Mustache=require(_0xcb75('0x5'));var util=require(_0xcb75('0x6'));var path=require(_0xcb75('0x7'));var sox=require('sox');var csv=require(_0xcb75('0x8'));var ejs=require(_0xcb75('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb75('0xa'));var jsforce=require(_0xcb75('0xb'));var deskjs=require(_0xcb75('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcb75('0xd'));var Papa=require('papaparse');var Redis=require(_0xcb75('0xe'));var authService=require(_0xcb75('0xf'));var qs=require(_0xcb75('0x10'));var as=require(_0xcb75('0x11'));var hardwareService=require(_0xcb75('0x12'));var logger=require('../../config/logger')(_0xcb75('0x13'));var utils=require(_0xcb75('0x14'));var config=require(_0xcb75('0x15'));var licenseUtil=require(_0xcb75('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x376bdb,_0xe23033){_0xe23033=_0xe23033||0xcc;return function(_0x20acd7){if(_0x20acd7){return _0x376bdb['sendStatus'](_0xe23033);}return _0x376bdb[_0xcb75('0x17')](_0xe23033)['end']();};}function respondWithResult(_0x21cda5,_0x4a8e30){_0x4a8e30=_0x4a8e30||0xc8;return function(_0x5f4401){if(_0x5f4401){return _0x21cda5['status'](_0x4a8e30)['json'](_0x5f4401);}};}function respondWithFilteredResult(_0x4643f6,_0x2b7f63){return function(_0x3a5cbf){if(_0x3a5cbf){var _0x3f64a9=typeof _0x2b7f63[_0xcb75('0x18')]==='undefined'&&typeof _0x2b7f63[_0xcb75('0x19')]===_0xcb75('0x1a');var _0x54406a=_0x3a5cbf[_0xcb75('0x1b')];var _0xaf9c09=_0x3f64a9?0x0:_0x2b7f63[_0xcb75('0x18')];var _0x113352=_0x3f64a9?_0x3a5cbf[_0xcb75('0x1b')]:_0x2b7f63['offset']+_0x2b7f63['limit'];var _0x3ceb9a;if(_0x113352>=_0x54406a){_0x113352=_0x54406a;_0x3ceb9a=0xc8;}else{_0x3ceb9a=0xce;}_0x4643f6[_0xcb75('0x17')](_0x3ceb9a);return _0x4643f6[_0xcb75('0x1c')](_0xcb75('0x1d'),_0xaf9c09+'-'+_0x113352+'/'+_0x54406a)[_0xcb75('0x1e')](_0x3a5cbf);}return null;};}function patchUpdates(_0x31b36a){return function(_0x3a06d6){try{jsonpatch[_0xcb75('0x1f')](_0x3a06d6,_0x31b36a,!![]);}catch(_0x3c4bbb){return BPromise[_0xcb75('0x20')](_0x3c4bbb);}return _0x3a06d6[_0xcb75('0x21')]();};}function saveUpdates(_0x16cd8f,_0x1b5d23){return function(_0x20b52c){if(_0x20b52c){return _0x20b52c[_0xcb75('0x22')](_0x16cd8f)[_0xcb75('0x23')](function(_0x25ef5e){return _0x25ef5e;});}return null;};}function removeEntity(_0x1b3eda,_0x2f779a){return function(_0x31bf93){if(_0x31bf93){return _0x31bf93[_0xcb75('0x24')]()['then'](function(){_0x1b3eda['status'](0xcc)[_0xcb75('0x25')]();});}};}function handleEntityNotFound(_0x486b51,_0x1f2792){return function(_0x551a18){if(!_0x551a18){_0x486b51['sendStatus'](0x194);}return _0x551a18;};}function handleError(_0x13fc49,_0x583634){_0x583634=_0x583634||0x1f4;return function(_0x4b6c6d){logger[_0xcb75('0x26')](_0x4b6c6d[_0xcb75('0x27')]);if(_0x4b6c6d['name']){delete _0x4b6c6d[_0xcb75('0x28')];}_0x13fc49[_0xcb75('0x17')](_0x583634)[_0xcb75('0x29')](_0x4b6c6d);};}exports[_0xcb75('0x2a')]=function(_0x1a64fe,_0x250713){var _0x3d70a1={},_0xbfc0a5={},_0x20697f={'count':0x0,'rows':[]};var _0x46f05c=_['map'](db[_0xcb75('0x2b')]['rawAttributes'],function(_0x342f18){return{'name':_0x342f18[_0xcb75('0x2c')],'type':_0x342f18[_0xcb75('0x2d')][_0xcb75('0x2e')]};});_0xbfc0a5['model']=_[_0xcb75('0x2f')](_0x46f05c,'name');_0xbfc0a5[_0xcb75('0x30')]=_[_0xcb75('0x31')](_0x1a64fe[_0xcb75('0x30')]);_0xbfc0a5[_0xcb75('0x32')]=_[_0xcb75('0x33')](_0xbfc0a5[_0xcb75('0x34')],_0xbfc0a5[_0xcb75('0x30')]);_0x3d70a1[_0xcb75('0x35')]=_['intersection'](_0xbfc0a5[_0xcb75('0x34')],qs['fields'](_0x1a64fe[_0xcb75('0x30')]['fields']));_0x3d70a1[_0xcb75('0x35')]=_0x3d70a1[_0xcb75('0x35')][_0xcb75('0x36')]?_0x3d70a1['attributes']:_0xbfc0a5[_0xcb75('0x34')];if(!_0x1a64fe[_0xcb75('0x30')][_0xcb75('0x37')](_0xcb75('0x38'))){_0x3d70a1[_0xcb75('0x19')]=qs[_0xcb75('0x19')](_0x1a64fe[_0xcb75('0x30')][_0xcb75('0x19')]);_0x3d70a1['offset']=qs[_0xcb75('0x18')](_0x1a64fe[_0xcb75('0x30')][_0xcb75('0x18')]);}_0x3d70a1[_0xcb75('0x39')]=qs[_0xcb75('0x3a')](_0x1a64fe[_0xcb75('0x30')][_0xcb75('0x3a')]);_0x3d70a1[_0xcb75('0x3b')]=qs[_0xcb75('0x32')](_[_0xcb75('0x3c')](_0x1a64fe[_0xcb75('0x30')],_0xbfc0a5[_0xcb75('0x32')]),_0x46f05c);if(_0x1a64fe['query'][_0xcb75('0x3d')]){_0x3d70a1['where']=_[_0xcb75('0x3e')](_0x3d70a1[_0xcb75('0x3b')],{'$or':_[_0xcb75('0x2f')](_0x46f05c,function(_0x26cc69){if(_0x26cc69[_0xcb75('0x2d')]!=='VIRTUAL'){var _0x547fc5={};_0x547fc5[_0x26cc69[_0xcb75('0x28')]]={'$like':'%'+_0x1a64fe[_0xcb75('0x30')][_0xcb75('0x3d')]+'%'};return _0x547fc5;}})});}_0x3d70a1=_[_0xcb75('0x3e')]({},_0x3d70a1,_0x1a64fe['options']);var _0x4e84f5={'where':_0x3d70a1[_0xcb75('0x3b')]};return db['ZohoAccount']['count'](_0x4e84f5)[_0xcb75('0x23')](function(_0x223d22){_0x20697f[_0xcb75('0x1b')]=_0x223d22;if(_0x1a64fe[_0xcb75('0x30')]['includeAll']){_0x3d70a1['include']=[{'all':!![]}];}return db[_0xcb75('0x2b')][_0xcb75('0x3f')](_0x3d70a1);})['then'](function(_0x4031ca){_0x20697f[_0xcb75('0x40')]=_0x4031ca;return _0x20697f;})[_0xcb75('0x23')](respondWithFilteredResult(_0x250713,_0x3d70a1))[_0xcb75('0x41')](handleError(_0x250713,null));};exports[_0xcb75('0x42')]=function(_0xf1b104,_0x1f6e0d){var _0x4612c9={'raw':![],'where':{'id':_0xf1b104['params']['id']}},_0x4cab74={};_0x4cab74[_0xcb75('0x34')]=_[_0xcb75('0x31')](db[_0xcb75('0x2b')][_0xcb75('0x43')]);_0x4cab74['query']=_[_0xcb75('0x31')](_0xf1b104[_0xcb75('0x30')]);_0x4cab74['filters']=_[_0xcb75('0x33')](_0x4cab74[_0xcb75('0x34')],_0x4cab74[_0xcb75('0x30')]);_0x4612c9[_0xcb75('0x35')]=_[_0xcb75('0x33')](_0x4cab74[_0xcb75('0x34')],qs['fields'](_0xf1b104[_0xcb75('0x30')][_0xcb75('0x44')]));_0x4612c9['attributes']=_0x4612c9[_0xcb75('0x35')]['length']?_0x4612c9[_0xcb75('0x35')]:_0x4cab74['model'];if(_0xf1b104[_0xcb75('0x30')][_0xcb75('0x45')]){_0x4612c9[_0xcb75('0x46')]=[{'all':!![]}];}_0x4612c9=_[_0xcb75('0x3e')]({},_0x4612c9,_0xf1b104[_0xcb75('0x47')]);return db[_0xcb75('0x2b')][_0xcb75('0x48')](_0x4612c9)[_0xcb75('0x23')](handleEntityNotFound(_0x1f6e0d,null))[_0xcb75('0x23')](respondWithResult(_0x1f6e0d,null))['catch'](handleError(_0x1f6e0d,null));};exports[_0xcb75('0x49')]=function(_0x46633a,_0x1b4aed){return db[_0xcb75('0x2b')][_0xcb75('0x49')](_0x46633a[_0xcb75('0x4a')],{})[_0xcb75('0x23')](respondWithResult(_0x1b4aed,0xc9))[_0xcb75('0x41')](handleError(_0x1b4aed,null));};exports['update']=function(_0xa87b9b,_0x325c0a){if(_0xa87b9b[_0xcb75('0x4a')]['id']){delete _0xa87b9b[_0xcb75('0x4a')]['id'];}return db[_0xcb75('0x2b')]['find']({'where':{'id':_0xa87b9b[_0xcb75('0x4b')]['id']}})[_0xcb75('0x23')](handleEntityNotFound(_0x325c0a,null))['then'](saveUpdates(_0xa87b9b[_0xcb75('0x4a')],null))[_0xcb75('0x23')](respondWithResult(_0x325c0a,null))[_0xcb75('0x41')](handleError(_0x325c0a,null));};exports[_0xcb75('0x24')]=function(_0xcfb06d,_0x4061fd){return db['ZohoAccount'][_0xcb75('0x48')]({'where':{'id':_0xcfb06d[_0xcb75('0x4b')]['id']}})[_0xcb75('0x23')](handleEntityNotFound(_0x4061fd,null))[_0xcb75('0x23')](removeEntity(_0x4061fd,null))['catch'](handleError(_0x4061fd,null));};exports[_0xcb75('0x4c')]=function(_0x41fc70,_0x45ea5d,_0x34992c){var _0x1e6521={};var _0x1f174a={};var _0xe3ac74;var _0x4da490;return db[_0xcb75('0x2b')]['findOne']({'where':{'id':_0x41fc70['params']['id']}})[_0xcb75('0x23')](handleEntityNotFound(_0x45ea5d,null))[_0xcb75('0x23')](function(_0x13b14a){if(_0x13b14a){_0xe3ac74=_0x13b14a;_0x1f174a[_0xcb75('0x34')]=_[_0xcb75('0x31')](db[_0xcb75('0x4d')][_0xcb75('0x43')]);_0x1f174a[_0xcb75('0x30')]=_['keys'](_0x41fc70[_0xcb75('0x30')]);_0x1f174a['filters']=_[_0xcb75('0x33')](_0x1f174a[_0xcb75('0x34')],_0x1f174a[_0xcb75('0x30')]);_0x1e6521[_0xcb75('0x35')]=_['intersection'](_0x1f174a[_0xcb75('0x34')],qs['fields'](_0x41fc70['query']['fields']));_0x1e6521['attributes']=_0x1e6521[_0xcb75('0x35')][_0xcb75('0x36')]?_0x1e6521['attributes']:_0x1f174a[_0xcb75('0x34')];_0x1e6521[_0xcb75('0x39')]=qs[_0xcb75('0x3a')](_0x41fc70[_0xcb75('0x30')][_0xcb75('0x3a')]);_0x1e6521[_0xcb75('0x3b')]=qs['filters'](_[_0xcb75('0x3c')](_0x41fc70[_0xcb75('0x30')],_0x1f174a[_0xcb75('0x32')]));if(_0x41fc70['query'][_0xcb75('0x3d')]){_0x1e6521[_0xcb75('0x3b')]=_[_0xcb75('0x3e')](_0x1e6521[_0xcb75('0x3b')],{'$or':_[_0xcb75('0x2f')](_0x1e6521[_0xcb75('0x35')],function(_0xa592f1){var _0x187fa5={};_0x187fa5[_0xa592f1]={'$like':'%'+_0x41fc70[_0xcb75('0x30')][_0xcb75('0x3d')]+'%'};return _0x187fa5;})});}_0x1e6521=_['merge']({},_0x1e6521,_0x41fc70['options']);return _0xe3ac74['getConfigurations'](_0x1e6521);}})['then'](function(_0x74ff9d){if(_0x74ff9d){_0x4da490=_0x74ff9d['length'];if(!_0x41fc70[_0xcb75('0x30')][_0xcb75('0x37')]('nolimit')){_0x1e6521['limit']=qs['limit'](_0x41fc70[_0xcb75('0x30')][_0xcb75('0x19')]);_0x1e6521['offset']=qs[_0xcb75('0x18')](_0x41fc70['query'][_0xcb75('0x18')]);}return _0xe3ac74['getConfigurations'](_0x1e6521);}})['then'](function(_0x3211b7){if(_0x3211b7){return _0x3211b7?{'count':_0x4da490,'rows':_0x3211b7}:null;}})[_0xcb75('0x23')](respondWithResult(_0x45ea5d,null))[_0xcb75('0x41')](handleError(_0x45ea5d,null));};exports['addConfiguration']=function(_0x552070,_0x426c1b,_0x43feaf){if(_0x552070['body']['id']){delete _0x552070[_0xcb75('0x4a')]['id'];}return db[_0xcb75('0x2b')][_0xcb75('0x4e')]({'where':{'id':_0x552070[_0xcb75('0x4b')]['id']}})[_0xcb75('0x23')](handleEntityNotFound(_0x426c1b,null))['then'](function(_0x140499){if(_0x140499){_0x552070[_0xcb75('0x4a')][_0xcb75('0x4f')]=_0x140499['id'];_0x552070[_0xcb75('0x4a')][_0xcb75('0x50')]=integrations['getSubjects'](_0x552070['body']['channel'],_0x552070['body']['type']);_0x552070[_0xcb75('0x4a')][_0xcb75('0x51')]=integrations[_0xcb75('0x52')](_0x552070[_0xcb75('0x4a')][_0xcb75('0x53')],_0x552070['body'][_0xcb75('0x2d')]);return db['ZohoConfiguration']['create'](_0x552070[_0xcb75('0x4a')],{'include':[{'model':db[_0xcb75('0x54')],'as':_0xcb75('0x50')},{'model':db[_0xcb75('0x54')],'as':_0xcb75('0x51')}]});}return null;})[_0xcb75('0x23')](respondWithResult(_0x426c1b,null))[_0xcb75('0x41')](handleError(_0x426c1b,null));};function getAccessToken(_0x203a00){return new Promise(function(_0x4b6ec3,_0x48d7b2){var _0x490565;switch(_0x203a00[_0xcb75('0x55')]){case'US':_0x490565=_0xcb75('0x56');break;case'AU':_0x490565=_0xcb75('0x57');break;case'EU':_0x490565=_0xcb75('0x58');break;case'IN':_0x490565='https://accounts.zoho.in';break;case'CN':_0x490565=_0xcb75('0x59');break;default:_0x490565=_0xcb75('0x58');break;}var _0x3740df={'method':_0xcb75('0x5a'),'uri':_0x490565+_0xcb75('0x5b'),'qs':{'refresh_token':_0x203a00[_0xcb75('0x5c')],'client_id':_0x203a00[_0xcb75('0x5d')],'client_secret':_0x203a00[_0xcb75('0x5e')],'grant_type':_0xcb75('0x5f')},'json':!![]};return rp(_0x3740df)[_0xcb75('0x23')](function(_0x18e96a){if(_0x18e96a['access_token']){_0x4b6ec3(_0x18e96a[_0xcb75('0x60')]);}else{_0x48d7b2(_0xcb75('0x61'));}})['catch'](function(_0x1bd5ca){_0x48d7b2(_0x1bd5ca);});});}exports[_0xcb75('0x62')]=function(_0x2411d6,_0x534c7b,_0x4ee88e){var _0x27adfc,_0x6e8bf5,_0x103c8b,_0x420be4,_0x564d63;return db['ZohoAccount'][_0xcb75('0x4e')]({'where':{'id':_0x2411d6['params']['id']},'attributes':['id',_0xcb75('0x63'),'zone',_0xcb75('0x5d'),_0xcb75('0x5e'),'serverUrl',_0xcb75('0x64'),_0xcb75('0x5c')]})[_0xcb75('0x23')](handleEntityNotFound(_0x534c7b,null))[_0xcb75('0x23')](function(_0x3d5690){_0x564d63=_0x3d5690;_0x27adfc=_0x564d63['host'];_0x6e8bf5=_0x27adfc==='zoho.eu'?'eu':_0xcb75('0x65');_0x103c8b=_0x564d63[_0xcb75('0x66')];var _0x2f8b00=_0x103c8b[_0xcb75('0x67')](-0x1);if(_0x2f8b00==='/'||_0x2f8b00==='\x5c'||_0x2f8b00===':'){_0x103c8b=_0x103c8b['substring'](0x0,_0x103c8b[_0xcb75('0x68')](_0x2f8b00));}if(!_0x564d63[_0xcb75('0x5c')]){throw new Error(_0xcb75('0x69'));}return getAccessToken(_0x564d63);})[_0xcb75('0x23')](function(_0x5ee256){if(_0x5ee256){return rp({'method':_0xcb75('0x6a'),'uri':util['format'](_0xcb75('0x6b'),_0x6e8bf5),'qs':{'module':_0xcb75('0x6c')},'headers':{'Authorization':_0xcb75('0x6d')+_0x5ee256},'json':!![]});}})['then'](function(_0x23966c){if(_0x23966c){if(_0x23966c[_0xcb75('0x6e')]&&_0x23966c['response']['error']){throw new Error(_0x23966c['response'][_0xcb75('0x26')][_0xcb75('0x6f')]);}var _0x15a58c=[];var _0x46c58d=[];var _0x447586=[_0xcb75('0x70'),_0xcb75('0x71'),_0xcb75('0x72'),_0xcb75('0x73'),_0xcb75('0x74'),_0xcb75('0x75'),'Call_Start_Time',_0xcb75('0x76')];_0x46c58d=_[_0xcb75('0x77')](_0x23966c[_0xcb75('0x44')],function(_0x290585){return _0x447586[_0xcb75('0x78')](_0x290585[_0xcb75('0x79')]);});for(var _0x5e11f5=0x0;_0x5e11f5<_0x46c58d['length'];_0x5e11f5++){if(_0x46c58d[_0x5e11f5][_0xcb75('0x7a')]===![]){_0x15a58c[_0xcb75('0x7b')]({'id':_0x46c58d[_0x5e11f5]['id'],'name':_0x46c58d[_0x5e11f5]['display_label'],'custom':_0x46c58d[_0x5e11f5][_0xcb75('0x7c')],'options':_0x46c58d[_0x5e11f5][_0xcb75('0x7d')]===_0xcb75('0x7e')&&_0x46c58d[_0x5e11f5]['pick_list_values']['length']>-0x1?_[_0xcb75('0x2f')](_0x46c58d[_0x5e11f5][_0xcb75('0x7f')],function(_0xe8841f){return{'name':_0xe8841f,'value':_0xe8841f};}):[]});}}return{'count':_0x15a58c[_0xcb75('0x36')],'rows':_0x15a58c};}else{return{'count':0x0,'rows':[]};}})[_0xcb75('0x23')](respondWithResult(_0x534c7b,null))[_0xcb75('0x41')](function(_0x2e659e){var _0x263533=_0x2411d6[_0xcb75('0x30')][_0xcb75('0x80')]?0x1f4:_0x2e659e[_0xcb75('0x81')]||0x1f4;logger[_0xcb75('0x26')](_0xcb75('0x82'),_0xcb75('0x62'),_0x263533,JSON[_0xcb75('0x83')](_0x2e659e));delete _0x2e659e[_0xcb75('0x28')];if(_0x263533===0x191){_0x263533=0x190;}_0x534c7b['status'](_0x263533)[_0xcb75('0x29')](_0x2411d6[_0xcb75('0x30')][_0xcb75('0x80')]?{'message':_0xcb75('0x84'),'statusCode':_0x2e659e[_0xcb75('0x81')]}:_0x2e659e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 73d0813..163e468 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 _0x2455=['host','slice','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.eu','application/x-www-form-urlencoded','parse','error','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code'];(function(_0x3fb34e,_0x374153){var _0x588e97=function(_0x5f1096){while(--_0x5f1096){_0x3fb34e['push'](_0x3fb34e['shift']());}};_0x588e97(++_0x374153);}(_0x2455,0x19c));var _0x5245=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x2455[_0x172ed7];return _0xfa8f61;};'use strict';var _=require(_0x5245('0x0'));var util=require(_0x5245('0x1'));var logger=require(_0x5245('0x2'))(_0x5245('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5245('0x4'));var fs=require('fs');var path=require(_0x5245('0x5'));var rimraf=require('rimraf');var config=require(_0x5245('0x6'));var attributes=require(_0x5245('0x7'));var integrations=require(_0x5245('0x8'));module[_0x5245('0x9')]=function(_0x5bcb64,_0x4ab414){return _0x5bcb64[_0x5245('0xa')](_0x5245('0xb'),attributes,{'tableName':_0x5245('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x523331,_0x29be80,_0x4f6ec2){if(_0x523331['changed']('zone')||_0x523331[_0x5245('0xd')](_0x5245('0xe'))||_0x523331[_0x5245('0xd')](_0x5245('0xf'))||_0x523331[_0x5245('0xd')](_0x5245('0x10'))||_0x523331[_0x5245('0xd')](_0x5245('0x11'))||_0x523331[_0x5245('0xd')](_0x5245('0x12'))){var _0x2c2df3,_0x307a9e;_0x2c2df3=_0x523331[_0x5245('0xe')];var _0x42ee7a=_0x2c2df3[_0x5245('0x13')](-0x1);if(_0x42ee7a==='/'||_0x42ee7a==='\x5c'||_0x42ee7a===':'){_0x2c2df3=_0x2c2df3['substring'](0x0,_0x2c2df3[_0x5245('0x14')](_0x42ee7a));}switch(_0x523331[_0x5245('0x15')]){case'US':_0x307a9e='https://accounts.zoho.com';break;case'AU':_0x307a9e=_0x5245('0x16');break;case'IN':_0x307a9e=_0x5245('0x17');break;case'CN':_0x307a9e=_0x5245('0x18');break;default:_0x307a9e='https://accounts.zoho.eu';break;}var _0x3fb677={'method':_0x5245('0x19'),'uri':_0x307a9e+_0x5245('0x1a'),'form':{'grant_type':_0x5245('0x1b'),'client_id':_0x523331[_0x5245('0xf')],'client_secret':_0x523331[_0x5245('0x10')],'redirect_uri':_0x523331[_0x5245('0xe')],'code':_0x523331[_0x5245('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3fb677)[_0x5245('0x1c')](function(_0x5b5d52){var _0x318601=JSON['parse'](_0x5b5d52);if(_0x318601[_0x5245('0x1d')]){_0x523331[_0x5245('0x1e')]=_0x318601['refresh_token'];logger[_0x5245('0x1f')](util[_0x5245('0x20')](_0x5245('0x21'),_0x523331[_0x5245('0x22')],_0x523331['id']));}else{logger['error'](util[_0x5245('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x523331['name'],_0x523331['id']),util[_0x5245('0x23')](_0x318601,{'showHidden':![],'depth':null}));}return _0x4f6ec2(null,_0x29be80);})[_0x5245('0x24')](function(_0x4689dd){logger['error'](util[_0x5245('0x20')](_0x5245('0x25'),_0x523331['name'],_0x523331['id']),util[_0x5245('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4f6ec2(_0x4689dd);});}else{return _0x4f6ec2(null,_0x29be80);}},'beforeUpdate':function(_0x624d5e,_0x1be4dc,_0x46111d){if(_0x624d5e['changed'](_0x5245('0x15'))||_0x624d5e['changed'](_0x5245('0xe'))||_0x624d5e[_0x5245('0xd')]('clientId')||_0x624d5e[_0x5245('0xd')](_0x5245('0x10'))||_0x624d5e[_0x5245('0xd')](_0x5245('0x11'))||_0x624d5e[_0x5245('0xd')](_0x5245('0x12'))){var _0x1ec74e,_0x51253e;_0x1ec74e=_0x624d5e[_0x5245('0xe')];var _0x420a5f=_0x1ec74e['slice'](-0x1);if(_0x420a5f==='/'||_0x420a5f==='\x5c'||_0x420a5f===':'){_0x1ec74e=_0x1ec74e[_0x5245('0x26')](0x0,_0x1ec74e[_0x5245('0x14')](_0x420a5f));}switch(_0x624d5e['zone']){case'US':_0x51253e='https://accounts.zoho.com';break;case'AU':_0x51253e=_0x5245('0x16');break;case'IN':_0x51253e='https://accounts.zoho.in';break;case'CN':_0x51253e=_0x5245('0x18');break;default:_0x51253e=_0x5245('0x27');break;}var _0x2d16f6={'method':'POST','uri':_0x51253e+'/oauth/v2/token','form':{'grant_type':_0x5245('0x1b'),'client_id':_0x624d5e[_0x5245('0xf')],'client_secret':_0x624d5e[_0x5245('0x10')],'redirect_uri':_0x624d5e['serverUrl'],'code':_0x624d5e['code']},'headers':{'Content-Type':_0x5245('0x28')}};return rp(_0x2d16f6)[_0x5245('0x1c')](function(_0x11244a){var _0x201ec9=JSON[_0x5245('0x29')](_0x11244a);if(_0x201ec9[_0x5245('0x1d')]){_0x624d5e['refreshToken']=_0x201ec9[_0x5245('0x1d')];logger['info'](util[_0x5245('0x20')](_0x5245('0x21'),_0x624d5e[_0x5245('0x22')],_0x624d5e['id']));}else{logger[_0x5245('0x2a')](util[_0x5245('0x20')](_0x5245('0x25'),_0x624d5e[_0x5245('0x22')],_0x624d5e['id']),util['inspect'](_0x201ec9,{'showHidden':![],'depth':null}));}return _0x46111d(null,_0x1be4dc);})[_0x5245('0x24')](function(_0x342b25){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x624d5e['name'],_0x624d5e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x46111d(_0x342b25);});}else{return _0x46111d(null,_0x1be4dc);}}}});}; \ No newline at end of file +var _0x462f=['https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','serverUrl','clientId','https://accounts.zoho.com','refreshToken','lodash','util','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientSecret','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x462f,0x1cb));var _0xf462=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x462f[_0x93942f];return _0x23fcd8;};'use strict';var _=require(_0xf462('0x0'));var util=require(_0xf462('0x1'));var logger=require('../../config/logger')(_0xf462('0x2'));var moment=require('moment');var BPromise=require(_0xf462('0x3'));var rp=require(_0xf462('0x4'));var fs=require('fs');var path=require(_0xf462('0x5'));var rimraf=require(_0xf462('0x6'));var config=require('../../config/environment');var attributes=require(_0xf462('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf462('0x8')]=function(_0x191bd0,_0x3d0e5e){return _0x191bd0[_0xf462('0x9')](_0xf462('0xa'),attributes,{'tableName':_0xf462('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28f6a1,_0x562311,_0x3b0079){if(_0x28f6a1[_0xf462('0xc')](_0xf462('0xd'))||_0x28f6a1[_0xf462('0xc')]('serverUrl')||_0x28f6a1[_0xf462('0xc')]('clientId')||_0x28f6a1[_0xf462('0xc')](_0xf462('0xe'))||_0x28f6a1[_0xf462('0xc')]('code')||_0x28f6a1['changed']('host')){var _0x515dea,_0x4ec7e7;_0x515dea=_0x28f6a1['serverUrl'];var _0x385a09=_0x515dea[_0xf462('0xf')](-0x1);if(_0x385a09==='/'||_0x385a09==='\x5c'||_0x385a09===':'){_0x515dea=_0x515dea[_0xf462('0x10')](0x0,_0x515dea[_0xf462('0x11')](_0x385a09));}switch(_0x28f6a1['zone']){case'US':_0x4ec7e7='https://accounts.zoho.com';break;case'AU':_0x4ec7e7=_0xf462('0x12');break;case'IN':_0x4ec7e7=_0xf462('0x13');break;case'CN':_0x4ec7e7=_0xf462('0x14');break;default:_0x4ec7e7=_0xf462('0x15');break;}var _0x317153={'method':_0xf462('0x16'),'uri':_0x4ec7e7+_0xf462('0x17'),'form':{'grant_type':_0xf462('0x18'),'client_id':_0x28f6a1['clientId'],'client_secret':_0x28f6a1[_0xf462('0xe')],'redirect_uri':_0x28f6a1['serverUrl'],'code':_0x28f6a1[_0xf462('0x19')]},'headers':{'Content-Type':_0xf462('0x1a')}};return rp(_0x317153)[_0xf462('0x1b')](function(_0x3e2998){var _0xf63d0c=JSON['parse'](_0x3e2998);if(_0xf63d0c[_0xf462('0x1c')]){_0x28f6a1['refreshToken']=_0xf63d0c[_0xf462('0x1c')];logger['info'](util[_0xf462('0x1d')](_0xf462('0x1e'),_0x28f6a1[_0xf462('0x1f')],_0x28f6a1['id']));}else{logger[_0xf462('0x20')](util[_0xf462('0x1d')](_0xf462('0x21'),_0x28f6a1[_0xf462('0x1f')],_0x28f6a1['id']),util[_0xf462('0x22')](_0xf63d0c,{'showHidden':![],'depth':null}));}return _0x3b0079(null,_0x562311);})[_0xf462('0x23')](function(_0x419a72){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x28f6a1[_0xf462('0x1f')],_0x28f6a1['id']),util[_0xf462('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x3b0079(_0x419a72);});}else{return _0x3b0079(null,_0x562311);}},'beforeUpdate':function(_0x42f406,_0x536ac5,_0x5f5b34){if(_0x42f406['changed'](_0xf462('0xd'))||_0x42f406[_0xf462('0xc')](_0xf462('0x24'))||_0x42f406[_0xf462('0xc')](_0xf462('0x25'))||_0x42f406[_0xf462('0xc')]('clientSecret')||_0x42f406[_0xf462('0xc')](_0xf462('0x19'))||_0x42f406[_0xf462('0xc')]('host')){var _0x5b2f4c,_0x2dc9e9;_0x5b2f4c=_0x42f406['serverUrl'];var _0x13a96d=_0x5b2f4c[_0xf462('0xf')](-0x1);if(_0x13a96d==='/'||_0x13a96d==='\x5c'||_0x13a96d===':'){_0x5b2f4c=_0x5b2f4c['substring'](0x0,_0x5b2f4c['lastIndexOf'](_0x13a96d));}switch(_0x42f406['zone']){case'US':_0x2dc9e9=_0xf462('0x26');break;case'AU':_0x2dc9e9=_0xf462('0x12');break;case'IN':_0x2dc9e9=_0xf462('0x13');break;case'CN':_0x2dc9e9=_0xf462('0x14');break;default:_0x2dc9e9=_0xf462('0x15');break;}var _0xc2515d={'method':_0xf462('0x16'),'uri':_0x2dc9e9+'/oauth/v2/token','form':{'grant_type':_0xf462('0x18'),'client_id':_0x42f406[_0xf462('0x25')],'client_secret':_0x42f406[_0xf462('0xe')],'redirect_uri':_0x42f406[_0xf462('0x24')],'code':_0x42f406[_0xf462('0x19')]},'headers':{'Content-Type':_0xf462('0x1a')}};return rp(_0xc2515d)[_0xf462('0x1b')](function(_0x4b5864){var _0x48eece=JSON['parse'](_0x4b5864);if(_0x48eece['refresh_token']){_0x42f406[_0xf462('0x27')]=_0x48eece[_0xf462('0x1c')];logger['info'](util[_0xf462('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x42f406[_0xf462('0x1f')],_0x42f406['id']));}else{logger[_0xf462('0x20')](util[_0xf462('0x1d')](_0xf462('0x21'),_0x42f406['name'],_0x42f406['id']),util['inspect'](_0x48eece,{'showHidden':![],'depth':null}));}return _0x5f5b34(null,_0x536ac5);})[_0xf462('0x23')](function(_0x42aefc){logger[_0xf462('0x20')](util[_0xf462('0x1d')](_0xf462('0x21'),_0x42f406['name'],_0x42f406['id']),util[_0xf462('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x5f5b34(_0x42aefc);});}else{return _0x5f5b34(null,_0x536ac5);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f33338f..b94f4fc 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 _0xdf92=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','model','map','ShowZohoAccount','find','lodash','bluebird','randomstring','ioredis'];(function(_0x18d290,_0x2b09cb){var _0x370fee=function(_0x1b353f){while(--_0x1b353f){_0x18d290['push'](_0x18d290['shift']());}};_0x370fee(++_0x2b09cb);}(_0xdf92,0x10c));var _0x2df9=function(_0x5c8b35,_0x4bf13e){_0x5c8b35=_0x5c8b35-0x0;var _0x2689c1=_0xdf92[_0x5c8b35];return _0x2689c1;};'use strict';var _=require(_0x2df9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2df9('0x1'));var rs=require(_0x2df9('0x2'));var fs=require('fs');var Redis=require(_0x2df9('0x3'));var db=require(_0x2df9('0x4'))['db'];var utils=require(_0x2df9('0x5'));var logger=require(_0x2df9('0x6'))(_0x2df9('0x7'));var config=require(_0x2df9('0x8'));var jayson=require(_0x2df9('0x9'));var client=jayson[_0x2df9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353f73,_0x1ce438,_0x28f58c){return new BPromise(function(_0x2dc316,_0x24de04){return client['request'](_0x353f73,_0x28f58c)[_0x2df9('0xb')](function(_0x40ff87){logger[_0x2df9('0xc')](_0x2df9('0xd'),_0x1ce438,_0x2df9('0xe'));logger[_0x2df9('0xf')](_0x2df9('0x10'),_0x1ce438,_0x2df9('0xe'),JSON[_0x2df9('0x11')](_0x40ff87));if(_0x40ff87['error']){if(_0x40ff87['error'][_0x2df9('0x12')]===0x1f4){logger['error'](_0x2df9('0xd'),_0x1ce438,_0x40ff87[_0x2df9('0x13')]['message']);return _0x24de04(_0x40ff87['error'][_0x2df9('0x14')]);}logger[_0x2df9('0x13')](_0x2df9('0xd'),_0x1ce438,_0x40ff87[_0x2df9('0x13')]['message']);return _0x2dc316(_0x40ff87[_0x2df9('0x13')][_0x2df9('0x14')]);}else{logger[_0x2df9('0xc')](_0x2df9('0xd'),_0x1ce438,_0x2df9('0xe'));_0x2dc316(_0x40ff87['result'][_0x2df9('0x14')]);}})[_0x2df9('0x15')](function(_0x5b3751){logger[_0x2df9('0x13')](_0x2df9('0xd'),_0x1ce438,_0x5b3751);_0x24de04(_0x5b3751);});});}exports[_0x2df9('0x16')]=function(_0xd48d46){var _0x2ed7e3=this;return new Promise(function(_0x46763a,_0x4e6e3e){return db[_0x2df9('0x17')]['findAll']({'raw':_0xd48d46[_0x2df9('0x18')]?_0xd48d46['options'][_0x2df9('0x19')]===undefined?!![]:![]:!![],'where':_0xd48d46['options']?_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1a')]||null:null,'attributes':_0xd48d46[_0x2df9('0x18')]?_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1b')]||null:null,'limit':_0xd48d46[_0x2df9('0x18')]?_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1c')]||null:null,'include':_0xd48d46['options']?_0xd48d46['options'][_0x2df9('0x1d')]?_['map'](_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1d')],function(_0x160a25){return{'model':db[_0x160a25[_0x2df9('0x1e')]],'as':_0x160a25['as'],'attributes':_0x160a25[_0x2df9('0x1b')],'include':_0x160a25[_0x2df9('0x1d')]?_['map'](_0x160a25['include'],function(_0x5a8cc7){return{'model':db[_0x5a8cc7[_0x2df9('0x1e')]],'as':_0x5a8cc7['as'],'attributes':_0x5a8cc7['attributes'],'include':_0x5a8cc7[_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x5a8cc7[_0x2df9('0x1d')],function(_0x19855e){return{'model':db[_0x19855e[_0x2df9('0x1e')]],'as':_0x19855e['as'],'attributes':_0x19855e[_0x2df9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x979ce4){logger[_0x2df9('0xc')](_0x2df9('0x16'),_0xd48d46);logger[_0x2df9('0xf')]('GetZohoAccount',_0xd48d46,JSON[_0x2df9('0x11')](_0x979ce4));_0x46763a(_0x979ce4);})[_0x2df9('0x15')](function(_0xec5c9f){logger['error'](_0x2df9('0x16'),_0xec5c9f[_0x2df9('0x14')],_0xd48d46);_0x4e6e3e(_0x2ed7e3[_0x2df9('0x13')](0x1f4,_0xec5c9f[_0x2df9('0x14')]));});});};exports[_0x2df9('0x20')]=function(_0x23cc34){var _0x1e010f=this;return new Promise(function(_0x5d96f6,_0x43726b){return db['ZohoAccount'][_0x2df9('0x21')]({'raw':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')][_0x2df9('0x19')]===undefined?!![]:![]:!![],'where':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')]['where']||null:null,'attributes':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')][_0x2df9('0x1b')]||null:null,'include':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')][_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x23cc34['options']['include'],function(_0x40adff){return{'model':db[_0x40adff[_0x2df9('0x1e')]],'as':_0x40adff['as'],'attributes':_0x40adff[_0x2df9('0x1b')],'include':_0x40adff[_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x40adff[_0x2df9('0x1d')],function(_0x1cef4a){return{'model':db[_0x1cef4a['model']],'as':_0x1cef4a['as'],'attributes':_0x1cef4a[_0x2df9('0x1b')],'include':_0x1cef4a[_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x1cef4a['include'],function(_0x3dc758){return{'model':db[_0x3dc758[_0x2df9('0x1e')]],'as':_0x3dc758['as'],'attributes':_0x3dc758[_0x2df9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2df9('0xb')](function(_0x606c11){logger[_0x2df9('0xc')]('ShowZohoAccount',_0x23cc34);logger[_0x2df9('0xf')](_0x2df9('0x20'),_0x23cc34,JSON[_0x2df9('0x11')](_0x606c11));_0x5d96f6(_0x606c11);})['catch'](function(_0x30402c){logger[_0x2df9('0x13')](_0x2df9('0x20'),_0x30402c[_0x2df9('0x14')],_0x23cc34);_0x43726b(_0x1e010f['error'](0x1f4,_0x30402c[_0x2df9('0x14')]));});});}; \ No newline at end of file +var _0x75ea=['error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','limit','map','include','model','attributes','then','info','find','raw','where','ShowZohoAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3185af,_0x58ae43){var _0x1c4e3c=function(_0x54b09e){while(--_0x54b09e){_0x3185af['push'](_0x3185af['shift']());}};_0x1c4e3c(++_0x58ae43);}(_0x75ea,0x7d));var _0xa75e=function(_0x566c5a,_0x14e8c2){_0x566c5a=_0x566c5a-0x0;var _0x40ca3c=_0x75ea[_0x566c5a];return _0x40ca3c;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require('moment');var BPromise=require(_0xa75e('0x2'));var rs=require(_0xa75e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa75e('0x4'))['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa75e('0x9')][_0xa75e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f666f,_0x2c71ef,_0x148a23){return new BPromise(function(_0x31a28d,_0x351164){return client['request'](_0x1f666f,_0x148a23)['then'](function(_0x560baa){logger['info'](_0xa75e('0xb'),_0x2c71ef,'request\x20sent');logger[_0xa75e('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2c71ef,_0xa75e('0xd'),JSON[_0xa75e('0xe')](_0x560baa));if(_0x560baa['error']){if(_0x560baa[_0xa75e('0xf')][_0xa75e('0x10')]===0x1f4){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);return _0x351164(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}logger[_0xa75e('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x2c71ef,_0x560baa[_0xa75e('0xf')]['message']);return _0x31a28d(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}else{logger['info'](_0xa75e('0xb'),_0x2c71ef,_0xa75e('0xd'));_0x31a28d(_0x560baa[_0xa75e('0x12')]['message']);}})[_0xa75e('0x13')](function(_0x315fde){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x315fde);_0x351164(_0x315fde);});});}exports[_0xa75e('0x14')]=function(_0x71fd71){var _0x34c0c2=this;return new Promise(function(_0x44a786,_0x5812ba){return db[_0xa75e('0x15')][_0xa75e('0x16')]({'raw':_0x71fd71[_0xa75e('0x17')]?_0x71fd71['options']['raw']===undefined?!![]:![]:!![],'where':_0x71fd71[_0xa75e('0x17')]?_0x71fd71['options']['where']||null:null,'attributes':_0x71fd71['options']?_0x71fd71[_0xa75e('0x17')]['attributes']||null:null,'limit':_0x71fd71[_0xa75e('0x17')]?_0x71fd71['options'][_0xa75e('0x18')]||null:null,'include':_0x71fd71[_0xa75e('0x17')]?_0x71fd71[_0xa75e('0x17')]['include']?_[_0xa75e('0x19')](_0x71fd71[_0xa75e('0x17')][_0xa75e('0x1a')],function(_0x4e64aa){return{'model':db[_0x4e64aa[_0xa75e('0x1b')]],'as':_0x4e64aa['as'],'attributes':_0x4e64aa[_0xa75e('0x1c')],'include':_0x4e64aa[_0xa75e('0x1a')]?_[_0xa75e('0x19')](_0x4e64aa[_0xa75e('0x1a')],function(_0x29c9df){return{'model':db[_0x29c9df[_0xa75e('0x1b')]],'as':_0x29c9df['as'],'attributes':_0x29c9df[_0xa75e('0x1c')],'include':_0x29c9df[_0xa75e('0x1a')]?_['map'](_0x29c9df['include'],function(_0x278e4a){return{'model':db[_0x278e4a[_0xa75e('0x1b')]],'as':_0x278e4a['as'],'attributes':_0x278e4a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa75e('0x1d')](function(_0x316197){logger[_0xa75e('0x1e')](_0xa75e('0x14'),_0x71fd71);logger[_0xa75e('0xc')](_0xa75e('0x14'),_0x71fd71,JSON['stringify'](_0x316197));_0x44a786(_0x316197);})[_0xa75e('0x13')](function(_0x15241f){logger[_0xa75e('0xf')](_0xa75e('0x14'),_0x15241f[_0xa75e('0x11')],_0x71fd71);_0x5812ba(_0x34c0c2['error'](0x1f4,_0x15241f[_0xa75e('0x11')]));});});};exports['ShowZohoAccount']=function(_0x5799d8){var _0xf86d31=this;return new Promise(function(_0x2a6c74,_0x207be3){return db[_0xa75e('0x15')][_0xa75e('0x1f')]({'raw':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')][_0xa75e('0x20')]===undefined?!![]:![]:!![],'where':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')][_0xa75e('0x21')]||null:null,'attributes':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')]['attributes']||null:null,'include':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')][_0xa75e('0x1a')]?_[_0xa75e('0x19')](_0x5799d8[_0xa75e('0x17')][_0xa75e('0x1a')],function(_0x5c1200){return{'model':db[_0x5c1200['model']],'as':_0x5c1200['as'],'attributes':_0x5c1200['attributes'],'include':_0x5c1200[_0xa75e('0x1a')]?_['map'](_0x5c1200['include'],function(_0x2824d0){return{'model':db[_0x2824d0['model']],'as':_0x2824d0['as'],'attributes':_0x2824d0[_0xa75e('0x1c')],'include':_0x2824d0[_0xa75e('0x1a')]?_[_0xa75e('0x19')](_0x2824d0[_0xa75e('0x1a')],function(_0x4a9356){return{'model':db[_0x4a9356[_0xa75e('0x1b')]],'as':_0x4a9356['as'],'attributes':_0x4a9356[_0xa75e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa75e('0x1d')](function(_0x5f3d8f){logger['info'](_0xa75e('0x22'),_0x5799d8);logger[_0xa75e('0xc')]('ShowZohoAccount',_0x5799d8,JSON[_0xa75e('0xe')](_0x5f3d8f));_0x2a6c74(_0x5f3d8f);})[_0xa75e('0x13')](function(_0x582d73){logger[_0xa75e('0xf')](_0xa75e('0x22'),_0x582d73['message'],_0x5799d8);_0x207be3(_0xf86d31[_0xa75e('0xf')](0x1f4,_0x582d73[_0xa75e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 28d01c4..b726dd9 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 _0x706a=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x706a,0xa8));var _0xa706=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0x706a[_0x26d386];return _0x4ef9a8;};'use strict';var multer=require(_0xa706('0x0'));var util=require(_0xa706('0x1'));var path=require(_0xa706('0x2'));var timeout=require(_0xa706('0x3'));var express=require(_0xa706('0x4'));var router=express[_0xa706('0x5')]();var fs_extra=require(_0xa706('0x6'));var auth=require(_0xa706('0x7'));var interaction=require(_0xa706('0x8'));var config=require(_0xa706('0x9'));var controller=require(_0xa706('0xa'));router[_0xa706('0xb')]('/',auth[_0xa706('0xc')](),controller[_0xa706('0xd')]);router[_0xa706('0xb')](_0xa706('0xe'),auth['isAuthenticated'](),controller[_0xa706('0xf')]);router[_0xa706('0xb')](_0xa706('0x10'),auth[_0xa706('0xc')](),controller[_0xa706('0x11')]);router['get'](_0xa706('0x12'),auth[_0xa706('0xc')](),controller[_0xa706('0x13')]);router[_0xa706('0xb')](_0xa706('0x14'),auth[_0xa706('0xc')](),controller['getDescriptions']);router['post']('/',auth[_0xa706('0xc')](),controller[_0xa706('0x15')]);router[_0xa706('0x16')](_0xa706('0xe'),auth['isAuthenticated'](),controller[_0xa706('0x17')]);router['delete'](_0xa706('0xe'),auth[_0xa706('0xc')](),controller[_0xa706('0x18')]);module[_0xa706('0x19')]=router; \ No newline at end of file +var _0x0fcc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0xa121e,_0xfea98c){var _0x2c3743=function(_0x3c252f){while(--_0x3c252f){_0xa121e['push'](_0xa121e['shift']());}};_0x2c3743(++_0xfea98c);}(_0x0fcc,0x127));var _0xc0fc=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x0fcc[_0x3f94f9];return _0x46f84f;};'use strict';var multer=require(_0xc0fc('0x0'));var util=require(_0xc0fc('0x1'));var path=require(_0xc0fc('0x2'));var timeout=require(_0xc0fc('0x3'));var express=require(_0xc0fc('0x4'));var router=express[_0xc0fc('0x5')]();var fs_extra=require(_0xc0fc('0x6'));var auth=require(_0xc0fc('0x7'));var interaction=require(_0xc0fc('0x8'));var config=require(_0xc0fc('0x9'));var controller=require(_0xc0fc('0xa'));router[_0xc0fc('0xb')]('/',auth[_0xc0fc('0xc')](),controller[_0xc0fc('0xd')]);router['get'](_0xc0fc('0xe'),auth[_0xc0fc('0xc')](),controller[_0xc0fc('0xf')]);router[_0xc0fc('0xb')](_0xc0fc('0x10'),auth[_0xc0fc('0xc')](),controller['getFields']);router['get'](_0xc0fc('0x11'),auth[_0xc0fc('0xc')](),controller[_0xc0fc('0x12')]);router[_0xc0fc('0xb')](_0xc0fc('0x13'),auth[_0xc0fc('0xc')](),controller['getDescriptions']);router[_0xc0fc('0x14')]('/',auth[_0xc0fc('0xc')](),controller[_0xc0fc('0x15')]);router['put']('/:id',auth[_0xc0fc('0xc')](),controller[_0xc0fc('0x16')]);router[_0xc0fc('0x17')]('/:id',auth[_0xc0fc('0xc')](),controller[_0xc0fc('0x18')]);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 16a1946..977309a 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 _0xedad=['STRING','lead','contact','nothing','ENUM','contact_lead','sequelize','exports'];(function(_0x1d5bed,_0x1e8c23){var _0x5a0c53=function(_0x88caa9){while(--_0x88caa9){_0x1d5bed['push'](_0x1d5bed['shift']());}};_0x5a0c53(++_0x1e8c23);}(_0xedad,0x17e));var _0xdeda=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xedad[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xdeda('0x0'));module[_0xdeda('0x1')]={'name':{'type':Sequelize[_0xdeda('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xdeda('0x3'),_0xdeda('0x4'),_0xdeda('0x5')),'defaultValue':_0xdeda('0x3')},'moduleSearch':{'type':Sequelize[_0xdeda('0x6')](_0xdeda('0x7'),'contact',_0xdeda('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xdeda('0x2')]}}; \ No newline at end of file +var _0x975f=['ENUM','lead','contact','nothing','contact_lead','exports','STRING'];(function(_0x33e83c,_0x418faa){var _0x5c6b12=function(_0x4f669d){while(--_0x4f669d){_0x33e83c['push'](_0x33e83c['shift']());}};_0x5c6b12(++_0x418faa);}(_0x975f,0x1e1));var _0xf975=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x975f[_0x521929];return _0x632436;};'use strict';var Sequelize=require('sequelize');module[_0xf975('0x0')]={'name':{'type':Sequelize[_0xf975('0x1')]},'moduleCreate':{'type':Sequelize[_0xf975('0x2')](_0xf975('0x3'),_0xf975('0x4'),_0xf975('0x5')),'defaultValue':_0xf975('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf975('0x6'),_0xf975('0x4'),_0xf975('0x3')),'defaultValue':_0xf975('0x6')},'description':{'type':Sequelize[_0xf975('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 56de207..b0b88c4 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 _0x8faa=['pick','filter','type','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','findOne','ZohoField','getFields','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters'];(function(_0x94e65d,_0xb4e801){var _0x4ff2d5=function(_0xc2592f){while(--_0xc2592f){_0x94e65d['push'](_0x94e65d['shift']());}};_0x4ff2d5(++_0xb4e801);}(_0x8faa,0x117));var _0xa8fa=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x8faa[_0x34d275];return _0x1379cc;};'use strict';var emlformat=require(_0xa8fa('0x0'));var rimraf=require(_0xa8fa('0x1'));var zipdir=require(_0xa8fa('0x2'));var jsonpatch=require(_0xa8fa('0x3'));var rp=require(_0xa8fa('0x4'));var moment=require(_0xa8fa('0x5'));var BPromise=require(_0xa8fa('0x6'));var Mustache=require('mustache');var util=require(_0xa8fa('0x7'));var path=require('path');var sox=require(_0xa8fa('0x8'));var csv=require(_0xa8fa('0x9'));var ejs=require(_0xa8fa('0xa'));var fs=require('fs');var fs_extra=require(_0xa8fa('0xb'));var _=require(_0xa8fa('0xc'));var squel=require(_0xa8fa('0xd'));var crypto=require(_0xa8fa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa8fa('0xf'));var toCsv=require(_0xa8fa('0x9'));var querystring=require(_0xa8fa('0x10'));var Papa=require(_0xa8fa('0x11'));var Redis=require(_0xa8fa('0x12'));var authService=require(_0xa8fa('0x13'));var qs=require(_0xa8fa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8fa('0x15'));var logger=require(_0xa8fa('0x16'))('api');var utils=require(_0xa8fa('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa8fa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x152129,_0x47e80e){_0x47e80e=_0x47e80e||0xcc;return function(_0x22e7bb){if(_0x22e7bb){return _0x152129[_0xa8fa('0x19')](_0x47e80e);}return _0x152129[_0xa8fa('0x1a')](_0x47e80e)[_0xa8fa('0x1b')]();};}function respondWithResult(_0x10c96e,_0x91c93b){_0x91c93b=_0x91c93b||0xc8;return function(_0x3d8e79){if(_0x3d8e79){return _0x10c96e[_0xa8fa('0x1a')](_0x91c93b)[_0xa8fa('0x1c')](_0x3d8e79);}};}function respondWithFilteredResult(_0x5e0111,_0x165874){return function(_0x2d00f3){if(_0x2d00f3){var _0x12ccef=typeof _0x165874[_0xa8fa('0x1d')]===_0xa8fa('0x1e')&&typeof _0x165874[_0xa8fa('0x1f')]===_0xa8fa('0x1e');var _0x547fcc=_0x2d00f3[_0xa8fa('0x20')];var _0x4d4c6b=_0x12ccef?0x0:_0x165874[_0xa8fa('0x1d')];var _0x1ce9ea=_0x12ccef?_0x2d00f3[_0xa8fa('0x20')]:_0x165874[_0xa8fa('0x1d')]+_0x165874[_0xa8fa('0x1f')];var _0x549eb7;if(_0x1ce9ea>=_0x547fcc){_0x1ce9ea=_0x547fcc;_0x549eb7=0xc8;}else{_0x549eb7=0xce;}_0x5e0111[_0xa8fa('0x1a')](_0x549eb7);return _0x5e0111[_0xa8fa('0x21')](_0xa8fa('0x22'),_0x4d4c6b+'-'+_0x1ce9ea+'/'+_0x547fcc)['json'](_0x2d00f3);}return null;};}function patchUpdates(_0x22a582){return function(_0x363b08){try{jsonpatch[_0xa8fa('0x23')](_0x363b08,_0x22a582,!![]);}catch(_0x3b5835){return BPromise[_0xa8fa('0x24')](_0x3b5835);}return _0x363b08[_0xa8fa('0x25')]();};}function saveUpdates(_0xe9b3b0,_0x56786a){return function(_0x59b8dd){if(_0x59b8dd){return _0x59b8dd[_0xa8fa('0x26')](_0xe9b3b0)[_0xa8fa('0x27')](function(_0x3f0239){return _0x3f0239;});}return null;};}function removeEntity(_0x13a0a3,_0x1cc02b){return function(_0x57c347){if(_0x57c347){return _0x57c347[_0xa8fa('0x28')]()['then'](function(){_0x13a0a3[_0xa8fa('0x1a')](0xcc)[_0xa8fa('0x1b')]();});}};}function handleEntityNotFound(_0x1e0dbb,_0x19edf2){return function(_0x3a1c41){if(!_0x3a1c41){_0x1e0dbb['sendStatus'](0x194);}return _0x3a1c41;};}function handleError(_0x236be1,_0x2d29e5){_0x2d29e5=_0x2d29e5||0x1f4;return function(_0x5bf50e){logger[_0xa8fa('0x29')](_0x5bf50e[_0xa8fa('0x2a')]);if(_0x5bf50e[_0xa8fa('0x2b')]){delete _0x5bf50e[_0xa8fa('0x2b')];}_0x236be1['status'](_0x2d29e5)[_0xa8fa('0x2c')](_0x5bf50e);};}exports[_0xa8fa('0x2d')]=function(_0x544bd9,_0x4a4940){var _0x1ec484={},_0x12d611={},_0x5f5702={'count':0x0,'rows':[]};var _0x220770=_[_0xa8fa('0x2e')](db[_0xa8fa('0x2f')][_0xa8fa('0x30')],function(_0x560da6){return{'name':_0x560da6[_0xa8fa('0x31')],'type':_0x560da6['type'][_0xa8fa('0x32')]};});_0x12d611[_0xa8fa('0x33')]=_[_0xa8fa('0x2e')](_0x220770,_0xa8fa('0x2b'));_0x12d611['query']=_['keys'](_0x544bd9[_0xa8fa('0x34')]);_0x12d611['filters']=_[_0xa8fa('0x35')](_0x12d611[_0xa8fa('0x33')],_0x12d611[_0xa8fa('0x34')]);_0x1ec484[_0xa8fa('0x36')]=_[_0xa8fa('0x35')](_0x12d611['model'],qs['fields'](_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x1ec484['attributes']=_0x1ec484[_0xa8fa('0x36')][_0xa8fa('0x38')]?_0x1ec484[_0xa8fa('0x36')]:_0x12d611[_0xa8fa('0x33')];if(!_0x544bd9[_0xa8fa('0x34')]['hasOwnProperty'](_0xa8fa('0x39'))){_0x1ec484['limit']=qs[_0xa8fa('0x1f')](_0x544bd9['query'][_0xa8fa('0x1f')]);_0x1ec484[_0xa8fa('0x1d')]=qs[_0xa8fa('0x1d')](_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x1d')]);}_0x1ec484[_0xa8fa('0x3a')]=qs['sort'](_0x544bd9['query'][_0xa8fa('0x3b')]);_0x1ec484['where']=qs[_0xa8fa('0x3c')](_[_0xa8fa('0x3d')](_0x544bd9['query'],_0x12d611[_0xa8fa('0x3c')]),_0x220770);if(_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x3e')]){_0x1ec484['where']=_['merge'](_0x1ec484['where'],{'$or':_[_0xa8fa('0x2e')](_0x220770,function(_0x36d7d3){if(_0x36d7d3[_0xa8fa('0x3f')]!==_0xa8fa('0x40')){var _0x267a6a={};_0x267a6a[_0x36d7d3['name']]={'$like':'%'+_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x3e')]+'%'};return _0x267a6a;}})});}_0x1ec484=_[_0xa8fa('0x41')]({},_0x1ec484,_0x544bd9[_0xa8fa('0x42')]);var _0x3089df={'where':_0x1ec484[_0xa8fa('0x43')]};return db[_0xa8fa('0x2f')][_0xa8fa('0x20')](_0x3089df)[_0xa8fa('0x27')](function(_0x3e87e9){_0x5f5702[_0xa8fa('0x20')]=_0x3e87e9;if(_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x44')]){_0x1ec484[_0xa8fa('0x45')]=[{'all':!![]}];}return db[_0xa8fa('0x2f')][_0xa8fa('0x46')](_0x1ec484);})['then'](function(_0x761b5a){_0x5f5702[_0xa8fa('0x47')]=_0x761b5a;return _0x5f5702;})[_0xa8fa('0x27')](respondWithFilteredResult(_0x4a4940,_0x1ec484))[_0xa8fa('0x48')](handleError(_0x4a4940,null));};exports[_0xa8fa('0x49')]=function(_0x2e27d2,_0x507b79){var _0x144941={'raw':![],'where':{'id':_0x2e27d2[_0xa8fa('0x4a')]['id']}},_0x51fac3={};_0x51fac3[_0xa8fa('0x33')]=_['keys'](db[_0xa8fa('0x2f')][_0xa8fa('0x30')]);_0x51fac3[_0xa8fa('0x34')]=_[_0xa8fa('0x4b')](_0x2e27d2[_0xa8fa('0x34')]);_0x51fac3[_0xa8fa('0x3c')]=_[_0xa8fa('0x35')](_0x51fac3[_0xa8fa('0x33')],_0x51fac3[_0xa8fa('0x34')]);_0x144941[_0xa8fa('0x36')]=_[_0xa8fa('0x35')](_0x51fac3[_0xa8fa('0x33')],qs[_0xa8fa('0x37')](_0x2e27d2[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x144941[_0xa8fa('0x36')]=_0x144941['attributes'][_0xa8fa('0x38')]?_0x144941['attributes']:_0x51fac3[_0xa8fa('0x33')];if(_0x2e27d2['query']['includeAll']){_0x144941[_0xa8fa('0x45')]=[{'all':!![]}];}_0x144941=_['merge']({},_0x144941,_0x2e27d2[_0xa8fa('0x42')]);return db['ZohoConfiguration']['find'](_0x144941)[_0xa8fa('0x27')](handleEntityNotFound(_0x507b79,null))[_0xa8fa('0x27')](respondWithResult(_0x507b79,null))[_0xa8fa('0x48')](handleError(_0x507b79,null));};exports['create']=function(_0x544999,_0x1e15d3){return db[_0xa8fa('0x2f')][_0xa8fa('0x4c')](_0x544999[_0xa8fa('0x4d')],{})[_0xa8fa('0x27')](respondWithResult(_0x1e15d3,0xc9))['catch'](handleError(_0x1e15d3,null));};exports['update']=function(_0x3797dd,_0x48cfb9){if(_0x3797dd[_0xa8fa('0x4d')]['id']){delete _0x3797dd['body']['id'];}return db['ZohoConfiguration'][_0xa8fa('0x4e')]({'where':{'id':_0x3797dd[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x48cfb9,null))[_0xa8fa('0x27')](saveUpdates(_0x3797dd[_0xa8fa('0x4d')],null))[_0xa8fa('0x27')](respondWithResult(_0x48cfb9,null))[_0xa8fa('0x48')](handleError(_0x48cfb9,null));};exports[_0xa8fa('0x28')]=function(_0x4e2049,_0x56a8f5){return db['ZohoConfiguration'][_0xa8fa('0x4e')]({'where':{'id':_0x4e2049[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x56a8f5,null))[_0xa8fa('0x27')](removeEntity(_0x56a8f5,null))['catch'](handleError(_0x56a8f5,null));};exports['getFields']=function(_0x5900fd,_0x5b16f6,_0x508e7d){var _0x14ac84={};var _0xc2881c={};var _0x449368;var _0x419fd1;return db[_0xa8fa('0x2f')][_0xa8fa('0x4f')]({'where':{'id':_0x5900fd[_0xa8fa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b16f6,null))['then'](function(_0x32cf37){if(_0x32cf37){_0x449368=_0x32cf37;_0xc2881c['model']=_['keys'](db[_0xa8fa('0x50')][_0xa8fa('0x30')]);_0xc2881c['query']=_['keys'](_0x5900fd[_0xa8fa('0x34')]);_0xc2881c['filters']=_[_0xa8fa('0x35')](_0xc2881c[_0xa8fa('0x33')],_0xc2881c[_0xa8fa('0x34')]);_0x14ac84['attributes']=_[_0xa8fa('0x35')](_0xc2881c[_0xa8fa('0x33')],qs[_0xa8fa('0x37')](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x14ac84['attributes']=_0x14ac84['attributes'][_0xa8fa('0x38')]?_0x14ac84[_0xa8fa('0x36')]:_0xc2881c[_0xa8fa('0x33')];_0x14ac84['order']=qs[_0xa8fa('0x3b')](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x3b')]);_0x14ac84[_0xa8fa('0x43')]=qs[_0xa8fa('0x3c')](_['pick'](_0x5900fd[_0xa8fa('0x34')],_0xc2881c[_0xa8fa('0x3c')]));if(_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x3e')]){_0x14ac84[_0xa8fa('0x43')]=_[_0xa8fa('0x41')](_0x14ac84['where'],{'$or':_[_0xa8fa('0x2e')](_0x14ac84['attributes'],function(_0xa5e696){var _0x1aa491={};_0x1aa491[_0xa5e696]={'$like':'%'+_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x3e')]+'%'};return _0x1aa491;})});}_0x14ac84=_['merge']({},_0x14ac84,_0x5900fd[_0xa8fa('0x42')]);return _0x449368[_0xa8fa('0x51')](_0x14ac84);}})[_0xa8fa('0x27')](function(_0x287a9f){if(_0x287a9f){_0x419fd1=_0x287a9f[_0xa8fa('0x38')];if(!_0x5900fd[_0xa8fa('0x34')]['hasOwnProperty'](_0xa8fa('0x39'))){_0x14ac84[_0xa8fa('0x1f')]=qs['limit'](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x1f')]);_0x14ac84[_0xa8fa('0x1d')]=qs['offset'](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x1d')]);}return _0x449368['getFields'](_0x14ac84);}})[_0xa8fa('0x27')](function(_0x39bd99){if(_0x39bd99){return _0x39bd99?{'count':_0x419fd1,'rows':_0x39bd99}:null;}})[_0xa8fa('0x27')](respondWithResult(_0x5b16f6,null))['catch'](handleError(_0x5b16f6,null));};exports['getSubjects']=function(_0x5957d5,_0x922e11,_0x35f2b2){var _0x2f0f7b={};var _0x533c13={};var _0x273a86;var _0x19b20b;return db[_0xa8fa('0x2f')]['findOne']({'where':{'id':_0x5957d5[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x922e11,null))[_0xa8fa('0x27')](function(_0x4132f2){if(_0x4132f2){_0x273a86=_0x4132f2;_0x533c13[_0xa8fa('0x33')]=_[_0xa8fa('0x4b')](db['ZohoField']['rawAttributes']);_0x533c13['query']=_[_0xa8fa('0x4b')](_0x5957d5[_0xa8fa('0x34')]);_0x533c13['filters']=_[_0xa8fa('0x35')](_0x533c13[_0xa8fa('0x33')],_0x533c13['query']);_0x2f0f7b['attributes']=_[_0xa8fa('0x35')](_0x533c13[_0xa8fa('0x33')],qs['fields'](_0x5957d5[_0xa8fa('0x34')]['fields']));_0x2f0f7b[_0xa8fa('0x36')]=_0x2f0f7b[_0xa8fa('0x36')][_0xa8fa('0x38')]?_0x2f0f7b[_0xa8fa('0x36')]:_0x533c13['model'];_0x2f0f7b[_0xa8fa('0x3a')]=qs['sort'](_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x3b')]);_0x2f0f7b[_0xa8fa('0x43')]=qs[_0xa8fa('0x3c')](_[_0xa8fa('0x3d')](_0x5957d5['query'],_0x533c13[_0xa8fa('0x3c')]));if(_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x3e')]){_0x2f0f7b['where']=_['merge'](_0x2f0f7b[_0xa8fa('0x43')],{'$or':_['map'](_0x2f0f7b['attributes'],function(_0x491731){var _0x25915f={};_0x25915f[_0x491731]={'$like':'%'+_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x3e')]+'%'};return _0x25915f;})});}_0x2f0f7b=_['merge']({},_0x2f0f7b,_0x5957d5['options']);return _0x273a86[_0xa8fa('0x52')](_0x2f0f7b);}})[_0xa8fa('0x27')](function(_0x2a636){if(_0x2a636){_0x19b20b=_0x2a636[_0xa8fa('0x38')];if(!_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x53')](_0xa8fa('0x39'))){_0x2f0f7b[_0xa8fa('0x1f')]=qs[_0xa8fa('0x1f')](_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x1f')]);_0x2f0f7b[_0xa8fa('0x1d')]=qs[_0xa8fa('0x1d')](_0x5957d5['query'][_0xa8fa('0x1d')]);}return _0x273a86[_0xa8fa('0x52')](_0x2f0f7b);}})[_0xa8fa('0x27')](function(_0x7bdde5){if(_0x7bdde5){return _0x7bdde5?{'count':_0x19b20b,'rows':_0x7bdde5}:null;}})['then'](respondWithResult(_0x922e11,null))[_0xa8fa('0x48')](handleError(_0x922e11,null));};exports['getDescriptions']=function(_0x36f35c,_0x4f086a,_0x1c9deb){var _0x38c40b={};var _0x559b3d={};var _0x4b905c;var _0x450544;return db[_0xa8fa('0x2f')]['findOne']({'where':{'id':_0x36f35c[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x4f086a,null))[_0xa8fa('0x27')](function(_0xc54497){if(_0xc54497){_0x4b905c=_0xc54497;_0x559b3d[_0xa8fa('0x33')]=_[_0xa8fa('0x4b')](db[_0xa8fa('0x50')][_0xa8fa('0x30')]);_0x559b3d[_0xa8fa('0x34')]=_[_0xa8fa('0x4b')](_0x36f35c['query']);_0x559b3d[_0xa8fa('0x3c')]=_[_0xa8fa('0x35')](_0x559b3d[_0xa8fa('0x33')],_0x559b3d[_0xa8fa('0x34')]);_0x38c40b[_0xa8fa('0x36')]=_[_0xa8fa('0x35')](_0x559b3d['model'],qs['fields'](_0x36f35c[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x38c40b[_0xa8fa('0x36')]=_0x38c40b[_0xa8fa('0x36')][_0xa8fa('0x38')]?_0x38c40b[_0xa8fa('0x36')]:_0x559b3d['model'];_0x38c40b[_0xa8fa('0x3a')]=qs[_0xa8fa('0x3b')](_0x36f35c['query'][_0xa8fa('0x3b')]);_0x38c40b[_0xa8fa('0x43')]=qs[_0xa8fa('0x3c')](_[_0xa8fa('0x3d')](_0x36f35c['query'],_0x559b3d[_0xa8fa('0x3c')]));if(_0x36f35c[_0xa8fa('0x34')]['filter']){_0x38c40b['where']=_['merge'](_0x38c40b['where'],{'$or':_[_0xa8fa('0x2e')](_0x38c40b[_0xa8fa('0x36')],function(_0x40bb73){var _0x40dabe={};_0x40dabe[_0x40bb73]={'$like':'%'+_0x36f35c['query']['filter']+'%'};return _0x40dabe;})});}_0x38c40b=_['merge']({},_0x38c40b,_0x36f35c[_0xa8fa('0x42')]);return _0x4b905c['getDescriptions'](_0x38c40b);}})[_0xa8fa('0x27')](function(_0x3c4924){if(_0x3c4924){_0x450544=_0x3c4924[_0xa8fa('0x38')];if(!_0x36f35c['query'][_0xa8fa('0x53')](_0xa8fa('0x39'))){_0x38c40b['limit']=qs[_0xa8fa('0x1f')](_0x36f35c[_0xa8fa('0x34')]['limit']);_0x38c40b[_0xa8fa('0x1d')]=qs[_0xa8fa('0x1d')](_0x36f35c['query'][_0xa8fa('0x1d')]);}return _0x4b905c[_0xa8fa('0x54')](_0x38c40b);}})[_0xa8fa('0x27')](function(_0x23e9ae){if(_0x23e9ae){return _0x23e9ae?{'count':_0x450544,'rows':_0x23e9ae}:null;}})['then'](respondWithResult(_0x4f086a,null))[_0xa8fa('0x48')](handleError(_0x4f086a,null));}; \ No newline at end of file +var _0x713e=['update','then','error','stack','name','index','ZohoConfiguration','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','catch','show','params','rawAttributes','fields','include','find','body','destroy','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','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','set','apply','save'];(function(_0x21586b,_0x512f74){var _0x3d4780=function(_0xc845b6){while(--_0xc845b6){_0x21586b['push'](_0x21586b['shift']());}};_0x3d4780(++_0x512f74);}(_0x713e,0x15e));var _0xe713=function(_0x3a0631,_0x2d8a7e){_0x3a0631=_0x3a0631-0x0;var _0x44bdf0=_0x713e[_0x3a0631];return _0x44bdf0;};'use strict';var emlformat=require(_0xe713('0x0'));var rimraf=require(_0xe713('0x1'));var zipdir=require(_0xe713('0x2'));var jsonpatch=require(_0xe713('0x3'));var rp=require(_0xe713('0x4'));var moment=require(_0xe713('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe713('0x6'));var util=require('util');var path=require(_0xe713('0x7'));var sox=require(_0xe713('0x8'));var csv=require(_0xe713('0x9'));var ejs=require(_0xe713('0xa'));var fs=require('fs');var fs_extra=require(_0xe713('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe713('0xc'));var deskjs=require(_0xe713('0xd'));var toCsv=require(_0xe713('0x9'));var querystring=require(_0xe713('0xe'));var Papa=require(_0xe713('0xf'));var Redis=require(_0xe713('0x10'));var authService=require(_0xe713('0x11'));var qs=require(_0xe713('0x12'));var as=require(_0xe713('0x13'));var hardwareService=require(_0xe713('0x14'));var logger=require(_0xe713('0x15'))('api');var utils=require(_0xe713('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe713('0x17'))['db'];function respondWithStatusCode(_0xaf3b56,_0x573373){_0x573373=_0x573373||0xcc;return function(_0x2d9721){if(_0x2d9721){return _0xaf3b56[_0xe713('0x18')](_0x573373);}return _0xaf3b56[_0xe713('0x19')](_0x573373)[_0xe713('0x1a')]();};}function respondWithResult(_0x1b8b65,_0x32b0de){_0x32b0de=_0x32b0de||0xc8;return function(_0x5489b8){if(_0x5489b8){return _0x1b8b65[_0xe713('0x19')](_0x32b0de)[_0xe713('0x1b')](_0x5489b8);}};}function respondWithFilteredResult(_0x16d3ba,_0x564bc6){return function(_0x5ed4c1){if(_0x5ed4c1){var _0x523b54=typeof _0x564bc6[_0xe713('0x1c')]===_0xe713('0x1d')&&typeof _0x564bc6[_0xe713('0x1e')]===_0xe713('0x1d');var _0x2b988c=_0x5ed4c1[_0xe713('0x1f')];var _0x26b163=_0x523b54?0x0:_0x564bc6[_0xe713('0x1c')];var _0x388488=_0x523b54?_0x5ed4c1[_0xe713('0x1f')]:_0x564bc6[_0xe713('0x1c')]+_0x564bc6[_0xe713('0x1e')];var _0x5c9379;if(_0x388488>=_0x2b988c){_0x388488=_0x2b988c;_0x5c9379=0xc8;}else{_0x5c9379=0xce;}_0x16d3ba['status'](_0x5c9379);return _0x16d3ba[_0xe713('0x20')]('Content-Range',_0x26b163+'-'+_0x388488+'/'+_0x2b988c)[_0xe713('0x1b')](_0x5ed4c1);}return null;};}function patchUpdates(_0xb4849a){return function(_0x356164){try{jsonpatch[_0xe713('0x21')](_0x356164,_0xb4849a,!![]);}catch(_0x5e8077){return BPromise['reject'](_0x5e8077);}return _0x356164[_0xe713('0x22')]();};}function saveUpdates(_0x2bc3c8,_0x32fd5d){return function(_0x255563){if(_0x255563){return _0x255563[_0xe713('0x23')](_0x2bc3c8)[_0xe713('0x24')](function(_0x43633e){return _0x43633e;});}return null;};}function removeEntity(_0x4350ee,_0x55619f){return function(_0xde7b8b){if(_0xde7b8b){return _0xde7b8b['destroy']()[_0xe713('0x24')](function(){_0x4350ee['status'](0xcc)[_0xe713('0x1a')]();});}};}function handleEntityNotFound(_0x5b2c64,_0x41277b){return function(_0x5e1fab){if(!_0x5e1fab){_0x5b2c64['sendStatus'](0x194);}return _0x5e1fab;};}function handleError(_0x49591d,_0xe04314){_0xe04314=_0xe04314||0x1f4;return function(_0x4c5420){logger[_0xe713('0x25')](_0x4c5420[_0xe713('0x26')]);if(_0x4c5420[_0xe713('0x27')]){delete _0x4c5420[_0xe713('0x27')];}_0x49591d[_0xe713('0x19')](_0xe04314)['send'](_0x4c5420);};}exports[_0xe713('0x28')]=function(_0xc7984e,_0x599f08){var _0x31fdbb={},_0x4810b7={},_0x82822b={'count':0x0,'rows':[]};var _0x9857=_['map'](db[_0xe713('0x29')]['rawAttributes'],function(_0x462c5d){return{'name':_0x462c5d['fieldName'],'type':_0x462c5d['type'][_0xe713('0x2a')]};});_0x4810b7[_0xe713('0x2b')]=_[_0xe713('0x2c')](_0x9857,_0xe713('0x27'));_0x4810b7[_0xe713('0x2d')]=_[_0xe713('0x2e')](_0xc7984e[_0xe713('0x2d')]);_0x4810b7[_0xe713('0x2f')]=_[_0xe713('0x30')](_0x4810b7['model'],_0x4810b7[_0xe713('0x2d')]);_0x31fdbb[_0xe713('0x31')]=_[_0xe713('0x30')](_0x4810b7[_0xe713('0x2b')],qs['fields'](_0xc7984e[_0xe713('0x2d')]['fields']));_0x31fdbb[_0xe713('0x31')]=_0x31fdbb['attributes'][_0xe713('0x32')]?_0x31fdbb['attributes']:_0x4810b7['model'];if(!_0xc7984e[_0xe713('0x2d')]['hasOwnProperty']('nolimit')){_0x31fdbb['limit']=qs['limit'](_0xc7984e['query']['limit']);_0x31fdbb[_0xe713('0x1c')]=qs[_0xe713('0x1c')](_0xc7984e[_0xe713('0x2d')][_0xe713('0x1c')]);}_0x31fdbb[_0xe713('0x33')]=qs[_0xe713('0x34')](_0xc7984e[_0xe713('0x2d')][_0xe713('0x34')]);_0x31fdbb['where']=qs[_0xe713('0x2f')](_[_0xe713('0x35')](_0xc7984e[_0xe713('0x2d')],_0x4810b7[_0xe713('0x2f')]),_0x9857);if(_0xc7984e[_0xe713('0x2d')][_0xe713('0x36')]){_0x31fdbb[_0xe713('0x37')]=_[_0xe713('0x38')](_0x31fdbb[_0xe713('0x37')],{'$or':_[_0xe713('0x2c')](_0x9857,function(_0x546471){if(_0x546471[_0xe713('0x39')]!=='VIRTUAL'){var _0x274da6={};_0x274da6[_0x546471[_0xe713('0x27')]]={'$like':'%'+_0xc7984e[_0xe713('0x2d')][_0xe713('0x36')]+'%'};return _0x274da6;}})});}_0x31fdbb=_[_0xe713('0x38')]({},_0x31fdbb,_0xc7984e[_0xe713('0x3a')]);var _0x91f8c0={'where':_0x31fdbb['where']};return db[_0xe713('0x29')][_0xe713('0x1f')](_0x91f8c0)[_0xe713('0x24')](function(_0x1a3fef){_0x82822b[_0xe713('0x1f')]=_0x1a3fef;if(_0xc7984e[_0xe713('0x2d')][_0xe713('0x3b')]){_0x31fdbb['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0xe713('0x3c')](_0x31fdbb);})[_0xe713('0x24')](function(_0x1f8ae5){_0x82822b['rows']=_0x1f8ae5;return _0x82822b;})['then'](respondWithFilteredResult(_0x599f08,_0x31fdbb))[_0xe713('0x3d')](handleError(_0x599f08,null));};exports[_0xe713('0x3e')]=function(_0x486cde,_0x3d29db){var _0x426d29={'raw':![],'where':{'id':_0x486cde[_0xe713('0x3f')]['id']}},_0x46089d={};_0x46089d[_0xe713('0x2b')]=_[_0xe713('0x2e')](db[_0xe713('0x29')][_0xe713('0x40')]);_0x46089d['query']=_[_0xe713('0x2e')](_0x486cde[_0xe713('0x2d')]);_0x46089d['filters']=_[_0xe713('0x30')](_0x46089d[_0xe713('0x2b')],_0x46089d[_0xe713('0x2d')]);_0x426d29[_0xe713('0x31')]=_[_0xe713('0x30')](_0x46089d[_0xe713('0x2b')],qs[_0xe713('0x41')](_0x486cde['query'][_0xe713('0x41')]));_0x426d29[_0xe713('0x31')]=_0x426d29['attributes'][_0xe713('0x32')]?_0x426d29[_0xe713('0x31')]:_0x46089d[_0xe713('0x2b')];if(_0x486cde['query']['includeAll']){_0x426d29[_0xe713('0x42')]=[{'all':!![]}];}_0x426d29=_[_0xe713('0x38')]({},_0x426d29,_0x486cde['options']);return db[_0xe713('0x29')][_0xe713('0x43')](_0x426d29)[_0xe713('0x24')](handleEntityNotFound(_0x3d29db,null))[_0xe713('0x24')](respondWithResult(_0x3d29db,null))['catch'](handleError(_0x3d29db,null));};exports['create']=function(_0x20547a,_0x20c6a6){return db[_0xe713('0x29')]['create'](_0x20547a[_0xe713('0x44')],{})[_0xe713('0x24')](respondWithResult(_0x20c6a6,0xc9))[_0xe713('0x3d')](handleError(_0x20c6a6,null));};exports[_0xe713('0x23')]=function(_0x4f7de4,_0x1f0cee){if(_0x4f7de4[_0xe713('0x44')]['id']){delete _0x4f7de4[_0xe713('0x44')]['id'];}return db[_0xe713('0x29')][_0xe713('0x43')]({'where':{'id':_0x4f7de4[_0xe713('0x3f')]['id']}})[_0xe713('0x24')](handleEntityNotFound(_0x1f0cee,null))[_0xe713('0x24')](saveUpdates(_0x4f7de4['body'],null))[_0xe713('0x24')](respondWithResult(_0x1f0cee,null))[_0xe713('0x3d')](handleError(_0x1f0cee,null));};exports[_0xe713('0x45')]=function(_0x1ba218,_0x1ee4ef){return db[_0xe713('0x29')][_0xe713('0x43')]({'where':{'id':_0x1ba218[_0xe713('0x3f')]['id']}})[_0xe713('0x24')](handleEntityNotFound(_0x1ee4ef,null))[_0xe713('0x24')](removeEntity(_0x1ee4ef,null))[_0xe713('0x3d')](handleError(_0x1ee4ef,null));};exports[_0xe713('0x46')]=function(_0x5e3076,_0x53f93b,_0x399a0c){var _0x1b9425={};var _0xbc4442={};var _0x9f3731;var _0x4d72f2;return db[_0xe713('0x29')][_0xe713('0x47')]({'where':{'id':_0x5e3076[_0xe713('0x3f')]['id']}})[_0xe713('0x24')](handleEntityNotFound(_0x53f93b,null))[_0xe713('0x24')](function(_0x3f4034){if(_0x3f4034){_0x9f3731=_0x3f4034;_0xbc4442[_0xe713('0x2b')]=_[_0xe713('0x2e')](db[_0xe713('0x48')]['rawAttributes']);_0xbc4442[_0xe713('0x2d')]=_[_0xe713('0x2e')](_0x5e3076[_0xe713('0x2d')]);_0xbc4442[_0xe713('0x2f')]=_['intersection'](_0xbc4442[_0xe713('0x2b')],_0xbc4442[_0xe713('0x2d')]);_0x1b9425[_0xe713('0x31')]=_[_0xe713('0x30')](_0xbc4442[_0xe713('0x2b')],qs[_0xe713('0x41')](_0x5e3076['query'][_0xe713('0x41')]));_0x1b9425['attributes']=_0x1b9425[_0xe713('0x31')][_0xe713('0x32')]?_0x1b9425[_0xe713('0x31')]:_0xbc4442[_0xe713('0x2b')];_0x1b9425[_0xe713('0x33')]=qs[_0xe713('0x34')](_0x5e3076[_0xe713('0x2d')][_0xe713('0x34')]);_0x1b9425[_0xe713('0x37')]=qs[_0xe713('0x2f')](_[_0xe713('0x35')](_0x5e3076['query'],_0xbc4442[_0xe713('0x2f')]));if(_0x5e3076[_0xe713('0x2d')][_0xe713('0x36')]){_0x1b9425['where']=_[_0xe713('0x38')](_0x1b9425[_0xe713('0x37')],{'$or':_['map'](_0x1b9425[_0xe713('0x31')],function(_0x35e6ea){var _0x358c21={};_0x358c21[_0x35e6ea]={'$like':'%'+_0x5e3076[_0xe713('0x2d')][_0xe713('0x36')]+'%'};return _0x358c21;})});}_0x1b9425=_['merge']({},_0x1b9425,_0x5e3076[_0xe713('0x3a')]);return _0x9f3731[_0xe713('0x46')](_0x1b9425);}})['then'](function(_0x4f37fb){if(_0x4f37fb){_0x4d72f2=_0x4f37fb[_0xe713('0x32')];if(!_0x5e3076['query'][_0xe713('0x49')]('nolimit')){_0x1b9425[_0xe713('0x1e')]=qs[_0xe713('0x1e')](_0x5e3076['query']['limit']);_0x1b9425[_0xe713('0x1c')]=qs['offset'](_0x5e3076[_0xe713('0x2d')][_0xe713('0x1c')]);}return _0x9f3731[_0xe713('0x46')](_0x1b9425);}})[_0xe713('0x24')](function(_0x3e8010){if(_0x3e8010){return _0x3e8010?{'count':_0x4d72f2,'rows':_0x3e8010}:null;}})[_0xe713('0x24')](respondWithResult(_0x53f93b,null))[_0xe713('0x3d')](handleError(_0x53f93b,null));};exports[_0xe713('0x4a')]=function(_0x57481d,_0x1931af,_0x1e9925){var _0x1b2429={};var _0xcbc240={};var _0xf990e0;var _0x3324ff;return db[_0xe713('0x29')][_0xe713('0x47')]({'where':{'id':_0x57481d['params']['id']}})[_0xe713('0x24')](handleEntityNotFound(_0x1931af,null))[_0xe713('0x24')](function(_0x128a9d){if(_0x128a9d){_0xf990e0=_0x128a9d;_0xcbc240[_0xe713('0x2b')]=_[_0xe713('0x2e')](db[_0xe713('0x48')][_0xe713('0x40')]);_0xcbc240['query']=_[_0xe713('0x2e')](_0x57481d[_0xe713('0x2d')]);_0xcbc240[_0xe713('0x2f')]=_[_0xe713('0x30')](_0xcbc240[_0xe713('0x2b')],_0xcbc240[_0xe713('0x2d')]);_0x1b2429[_0xe713('0x31')]=_[_0xe713('0x30')](_0xcbc240['model'],qs[_0xe713('0x41')](_0x57481d[_0xe713('0x2d')][_0xe713('0x41')]));_0x1b2429[_0xe713('0x31')]=_0x1b2429[_0xe713('0x31')][_0xe713('0x32')]?_0x1b2429[_0xe713('0x31')]:_0xcbc240[_0xe713('0x2b')];_0x1b2429[_0xe713('0x33')]=qs[_0xe713('0x34')](_0x57481d[_0xe713('0x2d')][_0xe713('0x34')]);_0x1b2429[_0xe713('0x37')]=qs[_0xe713('0x2f')](_[_0xe713('0x35')](_0x57481d['query'],_0xcbc240[_0xe713('0x2f')]));if(_0x57481d['query'][_0xe713('0x36')]){_0x1b2429[_0xe713('0x37')]=_[_0xe713('0x38')](_0x1b2429[_0xe713('0x37')],{'$or':_['map'](_0x1b2429[_0xe713('0x31')],function(_0x5b777e){var _0x4b063c={};_0x4b063c[_0x5b777e]={'$like':'%'+_0x57481d['query']['filter']+'%'};return _0x4b063c;})});}_0x1b2429=_['merge']({},_0x1b2429,_0x57481d[_0xe713('0x3a')]);return _0xf990e0[_0xe713('0x4a')](_0x1b2429);}})[_0xe713('0x24')](function(_0x528603){if(_0x528603){_0x3324ff=_0x528603[_0xe713('0x32')];if(!_0x57481d[_0xe713('0x2d')][_0xe713('0x49')](_0xe713('0x4b'))){_0x1b2429[_0xe713('0x1e')]=qs['limit'](_0x57481d['query'][_0xe713('0x1e')]);_0x1b2429[_0xe713('0x1c')]=qs[_0xe713('0x1c')](_0x57481d[_0xe713('0x2d')][_0xe713('0x1c')]);}return _0xf990e0[_0xe713('0x4a')](_0x1b2429);}})[_0xe713('0x24')](function(_0x4db893){if(_0x4db893){return _0x4db893?{'count':_0x3324ff,'rows':_0x4db893}:null;}})[_0xe713('0x24')](respondWithResult(_0x1931af,null))[_0xe713('0x3d')](handleError(_0x1931af,null));};exports[_0xe713('0x4c')]=function(_0x50acdc,_0x3e14a3,_0x2c45be){var _0x37371f={};var _0x3de4ce={};var _0x580c51;var _0x3575f7;return db['ZohoConfiguration'][_0xe713('0x47')]({'where':{'id':_0x50acdc['params']['id']}})[_0xe713('0x24')](handleEntityNotFound(_0x3e14a3,null))[_0xe713('0x24')](function(_0x43a05c){if(_0x43a05c){_0x580c51=_0x43a05c;_0x3de4ce[_0xe713('0x2b')]=_['keys'](db['ZohoField'][_0xe713('0x40')]);_0x3de4ce[_0xe713('0x2d')]=_['keys'](_0x50acdc[_0xe713('0x2d')]);_0x3de4ce['filters']=_['intersection'](_0x3de4ce[_0xe713('0x2b')],_0x3de4ce[_0xe713('0x2d')]);_0x37371f[_0xe713('0x31')]=_[_0xe713('0x30')](_0x3de4ce[_0xe713('0x2b')],qs['fields'](_0x50acdc[_0xe713('0x2d')][_0xe713('0x41')]));_0x37371f['attributes']=_0x37371f['attributes']['length']?_0x37371f[_0xe713('0x31')]:_0x3de4ce[_0xe713('0x2b')];_0x37371f[_0xe713('0x33')]=qs[_0xe713('0x34')](_0x50acdc[_0xe713('0x2d')][_0xe713('0x34')]);_0x37371f[_0xe713('0x37')]=qs[_0xe713('0x2f')](_[_0xe713('0x35')](_0x50acdc[_0xe713('0x2d')],_0x3de4ce[_0xe713('0x2f')]));if(_0x50acdc['query'][_0xe713('0x36')]){_0x37371f['where']=_[_0xe713('0x38')](_0x37371f[_0xe713('0x37')],{'$or':_[_0xe713('0x2c')](_0x37371f[_0xe713('0x31')],function(_0x2a734f){var _0x20b459={};_0x20b459[_0x2a734f]={'$like':'%'+_0x50acdc[_0xe713('0x2d')]['filter']+'%'};return _0x20b459;})});}_0x37371f=_[_0xe713('0x38')]({},_0x37371f,_0x50acdc[_0xe713('0x3a')]);return _0x580c51['getDescriptions'](_0x37371f);}})['then'](function(_0x3e0569){if(_0x3e0569){_0x3575f7=_0x3e0569[_0xe713('0x32')];if(!_0x50acdc[_0xe713('0x2d')]['hasOwnProperty']('nolimit')){_0x37371f[_0xe713('0x1e')]=qs[_0xe713('0x1e')](_0x50acdc['query'][_0xe713('0x1e')]);_0x37371f[_0xe713('0x1c')]=qs['offset'](_0x50acdc[_0xe713('0x2d')][_0xe713('0x1c')]);}return _0x580c51[_0xe713('0x4c')](_0x37371f);}})[_0xe713('0x24')](function(_0x274d2e){if(_0x274d2e){return _0x274d2e?{'count':_0x3575f7,'rows':_0x274d2e}:null;}})[_0xe713('0x24')](respondWithResult(_0x3e14a3,null))[_0xe713('0x3d')](handleError(_0x3e14a3,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index f251b11..36442d1 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 _0x4f54=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x36b4de,_0x50c1bf){var _0x38e25c=function(_0x2b6331){while(--_0x2b6331){_0x36b4de['push'](_0x36b4de['shift']());}};_0x38e25c(++_0x50c1bf);}(_0x4f54,0x1ed));var _0x44f5=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4f54[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x44f5('0x0'));var util=require('util');var logger=require(_0x44f5('0x1'))(_0x44f5('0x2'));var moment=require(_0x44f5('0x3'));var BPromise=require(_0x44f5('0x4'));var rp=require(_0x44f5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44f5('0x6'));var config=require(_0x44f5('0x7'));var attributes=require(_0x44f5('0x8'));module[_0x44f5('0x9')]=function(_0x2e3040,_0x531dd1){return _0x2e3040[_0x44f5('0xa')](_0x44f5('0xb'),attributes,{'tableName':_0x44f5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf6b=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x3917a8,_0xa82e69){var _0x3f14ae=function(_0x140842){while(--_0x140842){_0x3917a8['push'](_0x3917a8['shift']());}};_0x3f14ae(++_0xa82e69);}(_0xaf6b,0x19e));var _0xbaf6=function(_0x50a959,_0x376640){_0x50a959=_0x50a959-0x0;var _0x3bd030=_0xaf6b[_0x50a959];return _0x3bd030;};'use strict';var _=require(_0xbaf6('0x0'));var util=require('util');var logger=require(_0xbaf6('0x1'))(_0xbaf6('0x2'));var moment=require(_0xbaf6('0x3'));var BPromise=require(_0xbaf6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbaf6('0x5'));var rimraf=require(_0xbaf6('0x6'));var config=require(_0xbaf6('0x7'));var attributes=require(_0xbaf6('0x8'));module[_0xbaf6('0x9')]=function(_0x3534d0,_0x8f2e08){return _0x3534d0[_0xbaf6('0xa')]('ZohoConfiguration',attributes,{'tableName':_0xbaf6('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 05dc6c6..87d4baf 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 _0xc0ba=['info','request\x20sent','debug','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc0ba,0x68));var _0xac0b=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xc0ba[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0xac0b('0x0'));var util=require(_0xac0b('0x1'));var moment=require(_0xac0b('0x2'));var BPromise=require(_0xac0b('0x3'));var rs=require(_0xac0b('0x4'));var fs=require('fs');var Redis=require(_0xac0b('0x5'));var db=require(_0xac0b('0x6'))['db'];var utils=require(_0xac0b('0x7'));var logger=require(_0xac0b('0x8'))(_0xac0b('0x9'));var config=require(_0xac0b('0xa'));var jayson=require(_0xac0b('0xb'));var client=jayson[_0xac0b('0xc')][_0xac0b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2ee263,_0x3b5a48,_0x477a12){return new BPromise(function(_0x570dbe,_0x45dafe){return client[_0xac0b('0xe')](_0x2ee263,_0x477a12)[_0xac0b('0xf')](function(_0x15c0ca){logger[_0xac0b('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3b5a48,_0xac0b('0x11'));logger[_0xac0b('0x12')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3b5a48,'request\x20sent',JSON['stringify'](_0x15c0ca));if(_0x15c0ca['error']){if(_0x15c0ca[_0xac0b('0x13')]['code']===0x1f4){logger[_0xac0b('0x13')](_0xac0b('0x14'),_0x3b5a48,_0x15c0ca[_0xac0b('0x13')]['message']);return _0x45dafe(_0x15c0ca[_0xac0b('0x13')][_0xac0b('0x15')]);}logger[_0xac0b('0x13')](_0xac0b('0x14'),_0x3b5a48,_0x15c0ca[_0xac0b('0x13')][_0xac0b('0x15')]);return _0x570dbe(_0x15c0ca['error'][_0xac0b('0x15')]);}else{logger[_0xac0b('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3b5a48,'request\x20sent');_0x570dbe(_0x15c0ca[_0xac0b('0x16')]['message']);}})[_0xac0b('0x17')](function(_0x22badf){logger[_0xac0b('0x13')](_0xac0b('0x14'),_0x3b5a48,_0x22badf);_0x45dafe(_0x22badf);});});} \ No newline at end of file +var _0xf9c7=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x29dd5e,_0x1ad7e0){var _0x2fb32b=function(_0x30a923){while(--_0x30a923){_0x29dd5e['push'](_0x29dd5e['shift']());}};_0x2fb32b(++_0x1ad7e0);}(_0xf9c7,0x77));var _0x7f9c=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0xf9c7[_0x56608c];return _0x3c7fb0;};'use strict';var _=require(_0x7f9c('0x0'));var util=require(_0x7f9c('0x1'));var moment=require(_0x7f9c('0x2'));var BPromise=require(_0x7f9c('0x3'));var rs=require(_0x7f9c('0x4'));var fs=require('fs');var Redis=require(_0x7f9c('0x5'));var db=require(_0x7f9c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f9c('0x7'))(_0x7f9c('0x8'));var config=require(_0x7f9c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7f9c('0xa')][_0x7f9c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22b469,_0x4a7e89,_0x63c7c){return new BPromise(function(_0x57078f,_0x2de244){return client[_0x7f9c('0xc')](_0x22b469,_0x63c7c)[_0x7f9c('0xd')](function(_0x2d5771){logger[_0x7f9c('0xe')](_0x7f9c('0xf'),_0x4a7e89,_0x7f9c('0x10'));logger[_0x7f9c('0x11')](_0x7f9c('0x12'),_0x4a7e89,_0x7f9c('0x10'),JSON['stringify'](_0x2d5771));if(_0x2d5771[_0x7f9c('0x13')]){if(_0x2d5771[_0x7f9c('0x13')][_0x7f9c('0x14')]===0x1f4){logger['error'](_0x7f9c('0xf'),_0x4a7e89,_0x2d5771[_0x7f9c('0x13')][_0x7f9c('0x15')]);return _0x2de244(_0x2d5771[_0x7f9c('0x13')][_0x7f9c('0x15')]);}logger[_0x7f9c('0x13')](_0x7f9c('0xf'),_0x4a7e89,_0x2d5771['error'][_0x7f9c('0x15')]);return _0x57078f(_0x2d5771[_0x7f9c('0x13')][_0x7f9c('0x15')]);}else{logger[_0x7f9c('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x4a7e89,_0x7f9c('0x10'));_0x57078f(_0x2d5771[_0x7f9c('0x16')]['message']);}})['catch'](function(_0x2fc8ef){logger['error'](_0x7f9c('0xf'),_0x4a7e89,_0x2fc8ef);_0x2de244(_0x2fc8ef);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 8468e8f..22d2ed6 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 _0x5f55=['put','delete','multer','util','path','express','Router','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2eda32,_0x1c314d){var _0x1c1c01=function(_0x310dc1){while(--_0x310dc1){_0x2eda32['push'](_0x2eda32['shift']());}};_0x1c1c01(++_0x1c314d);}(_0x5f55,0x1f1));var _0x55f5=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0x5f55[_0x474035];return _0x1b58e0;};'use strict';var multer=require(_0x55f5('0x0'));var util=require(_0x55f5('0x1'));var path=require(_0x55f5('0x2'));var timeout=require('connect-timeout');var express=require(_0x55f5('0x3'));var router=express[_0x55f5('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(_0x55f5('0x5'));router[_0x55f5('0x6')]('/',auth[_0x55f5('0x7')](),controller[_0x55f5('0x8')]);router['get'](_0x55f5('0x9'),auth[_0x55f5('0x7')](),controller[_0x55f5('0xa')]);router[_0x55f5('0xb')]('/',auth[_0x55f5('0x7')](),controller[_0x55f5('0xc')]);router[_0x55f5('0xd')](_0x55f5('0x9'),auth[_0x55f5('0x7')](),controller['update']);router[_0x55f5('0xe')](_0x55f5('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x08f6=['show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated'];(function(_0x2ff94b,_0x142d74){var _0x52cd01=function(_0x2ed3fc){while(--_0x2ed3fc){_0x2ff94b['push'](_0x2ff94b['shift']());}};_0x52cd01(++_0x142d74);}(_0x08f6,0x1a7));var _0x608f=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0x08f6[_0x4a8418];return _0x390174;};'use strict';var multer=require('multer');var util=require(_0x608f('0x0'));var path=require(_0x608f('0x1'));var timeout=require(_0x608f('0x2'));var express=require('express');var router=express[_0x608f('0x3')]();var fs_extra=require(_0x608f('0x4'));var auth=require(_0x608f('0x5'));var interaction=require(_0x608f('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x608f('0x7'),auth[_0x608f('0x8')](),controller[_0x608f('0x9')]);router[_0x608f('0xa')]('/',auth[_0x608f('0x8')](),controller[_0x608f('0xb')]);router[_0x608f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x608f('0xd')]);router[_0x608f('0xe')](_0x608f('0x7'),auth[_0x608f('0x8')](),controller[_0x608f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index bda3c1a..e30e6a0 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 _0x4504=['sequelize','exports','variable','customVariable','string','STRING','ENUM'];(function(_0x31eb98,_0x592fa2){var _0x20cf3e=function(_0x5e30b1){while(--_0x5e30b1){_0x31eb98['push'](_0x31eb98['shift']());}};_0x20cf3e(++_0x592fa2);}(_0x4504,0xe0));var _0x4450=function(_0x247e6b,_0x4620dc){_0x247e6b=_0x247e6b-0x0;var _0x38c48f=_0x4504[_0x247e6b];return _0x38c48f;};'use strict';var Sequelize=require(_0x4450('0x0'));module[_0x4450('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x4450('0x2'),_0x4450('0x3'),'keyValue','picklist'),'defaultValue':_0x4450('0x4')},'content':{'type':Sequelize[_0x4450('0x5')]},'key':{'type':Sequelize[_0x4450('0x5')]},'keyType':{'type':Sequelize[_0x4450('0x6')]('string',_0x4450('0x2'),_0x4450('0x3'))},'keyContent':{'type':Sequelize[_0x4450('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4450('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4450('0x5')]}}; \ No newline at end of file +var _0xa385=['string','variable','customVariable','STRING','BOOLEAN','exports','ENUM'];(function(_0x5361ee,_0x512372){var _0x16b02e=function(_0x17583c){while(--_0x17583c){_0x5361ee['push'](_0x5361ee['shift']());}};_0x16b02e(++_0x512372);}(_0xa385,0x7c));var _0x5a38=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xa385[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require('sequelize');module[_0x5a38('0x0')]={'type':{'type':Sequelize[_0x5a38('0x1')](_0x5a38('0x2'),_0x5a38('0x3'),_0x5a38('0x4'),'keyValue','picklist'),'defaultValue':_0x5a38('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5a38('0x1')](_0x5a38('0x2'),_0x5a38('0x3'),_0x5a38('0x4'))},'keyContent':{'type':Sequelize[_0x5a38('0x5')]},'idField':{'type':Sequelize[_0x5a38('0x5')]},'nameField':{'type':Sequelize[_0x5a38('0x5')]},'customField':{'type':Sequelize[_0x5a38('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5a38('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 051e1c0..572cc5b 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 _0x30ac=['bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','json','apply','reject','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','merge','options','ZohoField','include','findAll','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1bbbe8,_0x1cc1d8){var _0x2f0e6e=function(_0x1bc3e2){while(--_0x1bc3e2){_0x1bbbe8['push'](_0x1bbbe8['shift']());}};_0x2f0e6e(++_0x1cc1d8);}(_0x30ac,0x11b));var _0xc30a=function(_0x549bc5,_0x5f05d3){_0x549bc5=_0x549bc5-0x0;var _0x5ec97f=_0x30ac[_0x549bc5];return _0x5ec97f;};'use strict';var emlformat=require(_0xc30a('0x0'));var rimraf=require(_0xc30a('0x1'));var zipdir=require(_0xc30a('0x2'));var jsonpatch=require(_0xc30a('0x3'));var rp=require(_0xc30a('0x4'));var moment=require('moment');var BPromise=require(_0xc30a('0x5'));var Mustache=require(_0xc30a('0x6'));var util=require('util');var path=require(_0xc30a('0x7'));var sox=require(_0xc30a('0x8'));var csv=require('to-csv');var ejs=require(_0xc30a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc30a('0xa'));var squel=require(_0xc30a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc30a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc30a('0xd'));var Redis=require(_0xc30a('0xe'));var authService=require(_0xc30a('0xf'));var qs=require(_0xc30a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc30a('0x11'))(_0xc30a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc30a('0x13'));var db=require(_0xc30a('0x14'))['db'];function respondWithStatusCode(_0x35ad47,_0x4f8c5d){_0x4f8c5d=_0x4f8c5d||0xcc;return function(_0x1c995c){if(_0x1c995c){return _0x35ad47['sendStatus'](_0x4f8c5d);}return _0x35ad47['status'](_0x4f8c5d)['end']();};}function respondWithResult(_0x329534,_0x46df70){_0x46df70=_0x46df70||0xc8;return function(_0xcf829b){if(_0xcf829b){return _0x329534[_0xc30a('0x15')](_0x46df70)['json'](_0xcf829b);}};}function respondWithFilteredResult(_0x11fa1f,_0x2d72fb){return function(_0x1d2ae1){if(_0x1d2ae1){var _0xb8e47d=typeof _0x2d72fb[_0xc30a('0x16')]===_0xc30a('0x17')&&typeof _0x2d72fb['limit']==='undefined';var _0x588373=_0x1d2ae1['count'];var _0x2a72f6=_0xb8e47d?0x0:_0x2d72fb[_0xc30a('0x16')];var _0x182aef=_0xb8e47d?_0x1d2ae1[_0xc30a('0x18')]:_0x2d72fb['offset']+_0x2d72fb['limit'];var _0x54fc83;if(_0x182aef>=_0x588373){_0x182aef=_0x588373;_0x54fc83=0xc8;}else{_0x54fc83=0xce;}_0x11fa1f[_0xc30a('0x15')](_0x54fc83);return _0x11fa1f[_0xc30a('0x19')](_0xc30a('0x1a'),_0x2a72f6+'-'+_0x182aef+'/'+_0x588373)[_0xc30a('0x1b')](_0x1d2ae1);}return null;};}function patchUpdates(_0x4d6a68){return function(_0x4ec1f5){try{jsonpatch[_0xc30a('0x1c')](_0x4ec1f5,_0x4d6a68,!![]);}catch(_0x32f0ca){return BPromise[_0xc30a('0x1d')](_0x32f0ca);}return _0x4ec1f5['save']();};}function saveUpdates(_0xec636c,_0x596ca7){return function(_0x29080f){if(_0x29080f){return _0x29080f['update'](_0xec636c)[_0xc30a('0x1e')](function(_0x19ac29){return _0x19ac29;});}return null;};}function removeEntity(_0x4b625d,_0x354e44){return function(_0x4e03c6){if(_0x4e03c6){return _0x4e03c6[_0xc30a('0x1f')]()[_0xc30a('0x1e')](function(){_0x4b625d[_0xc30a('0x15')](0xcc)[_0xc30a('0x20')]();});}};}function handleEntityNotFound(_0x27a471,_0x5e63d6){return function(_0x3307bc){if(!_0x3307bc){_0x27a471[_0xc30a('0x21')](0x194);}return _0x3307bc;};}function handleError(_0x5d3ba7,_0xb6d44e){_0xb6d44e=_0xb6d44e||0x1f4;return function(_0x4a2009){logger[_0xc30a('0x22')](_0x4a2009[_0xc30a('0x23')]);if(_0x4a2009[_0xc30a('0x24')]){delete _0x4a2009['name'];}_0x5d3ba7[_0xc30a('0x15')](_0xb6d44e)[_0xc30a('0x25')](_0x4a2009);};}exports[_0xc30a('0x26')]=function(_0x3a04e8,_0x5d8e6a){var _0x2e6c46={},_0x3c90d9={},_0x2972b0={'count':0x0,'rows':[]};var _0x2a3985=_['map'](db['ZohoField'][_0xc30a('0x27')],function(_0x7bb2e0){return{'name':_0x7bb2e0[_0xc30a('0x28')],'type':_0x7bb2e0[_0xc30a('0x29')][_0xc30a('0x2a')]};});_0x3c90d9[_0xc30a('0x2b')]=_['map'](_0x2a3985,_0xc30a('0x24'));_0x3c90d9[_0xc30a('0x2c')]=_[_0xc30a('0x2d')](_0x3a04e8[_0xc30a('0x2c')]);_0x3c90d9[_0xc30a('0x2e')]=_[_0xc30a('0x2f')](_0x3c90d9[_0xc30a('0x2b')],_0x3c90d9[_0xc30a('0x2c')]);_0x2e6c46[_0xc30a('0x30')]=_[_0xc30a('0x2f')](_0x3c90d9['model'],qs[_0xc30a('0x31')](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x31')]));_0x2e6c46[_0xc30a('0x30')]=_0x2e6c46[_0xc30a('0x30')][_0xc30a('0x32')]?_0x2e6c46['attributes']:_0x3c90d9[_0xc30a('0x2b')];if(!_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x33')](_0xc30a('0x34'))){_0x2e6c46[_0xc30a('0x35')]=qs[_0xc30a('0x35')](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x35')]);_0x2e6c46['offset']=qs['offset'](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x16')]);}_0x2e6c46[_0xc30a('0x36')]=qs[_0xc30a('0x37')](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x37')]);_0x2e6c46[_0xc30a('0x38')]=qs['filters'](_['pick'](_0x3a04e8[_0xc30a('0x2c')],_0x3c90d9[_0xc30a('0x2e')]),_0x2a3985);if(_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x39')]){_0x2e6c46[_0xc30a('0x38')]=_['merge'](_0x2e6c46[_0xc30a('0x38')],{'$or':_[_0xc30a('0x3a')](_0x2a3985,function(_0x5cd2b7){if(_0x5cd2b7[_0xc30a('0x29')]!==_0xc30a('0x3b')){var _0x276266={};_0x276266[_0x5cd2b7['name']]={'$like':'%'+_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x39')]+'%'};return _0x276266;}})});}_0x2e6c46=_[_0xc30a('0x3c')]({},_0x2e6c46,_0x3a04e8[_0xc30a('0x3d')]);var _0x4d81b6={'where':_0x2e6c46[_0xc30a('0x38')]};return db[_0xc30a('0x3e')][_0xc30a('0x18')](_0x4d81b6)['then'](function(_0x1edaf5){_0x2972b0[_0xc30a('0x18')]=_0x1edaf5;if(_0x3a04e8[_0xc30a('0x2c')]['includeAll']){_0x2e6c46[_0xc30a('0x3f')]=[{'all':!![]}];}return db[_0xc30a('0x3e')][_0xc30a('0x40')](_0x2e6c46);})[_0xc30a('0x1e')](function(_0x297f36){_0x2972b0['rows']=_0x297f36;return _0x2972b0;})['then'](respondWithFilteredResult(_0x5d8e6a,_0x2e6c46))[_0xc30a('0x41')](handleError(_0x5d8e6a,null));};exports[_0xc30a('0x42')]=function(_0x24f482,_0x392c74){var _0x54c35a={'raw':!![],'where':{'id':_0x24f482['params']['id']}},_0x16c294={};_0x16c294[_0xc30a('0x2b')]=_[_0xc30a('0x2d')](db[_0xc30a('0x3e')]['rawAttributes']);_0x16c294[_0xc30a('0x2c')]=_[_0xc30a('0x2d')](_0x24f482[_0xc30a('0x2c')]);_0x16c294['filters']=_['intersection'](_0x16c294[_0xc30a('0x2b')],_0x16c294['query']);_0x54c35a[_0xc30a('0x30')]=_[_0xc30a('0x2f')](_0x16c294['model'],qs[_0xc30a('0x31')](_0x24f482['query']['fields']));_0x54c35a[_0xc30a('0x30')]=_0x54c35a[_0xc30a('0x30')]['length']?_0x54c35a['attributes']:_0x16c294[_0xc30a('0x2b')];if(_0x24f482[_0xc30a('0x2c')][_0xc30a('0x43')]){_0x54c35a[_0xc30a('0x3f')]=[{'all':!![]}];}_0x54c35a=_[_0xc30a('0x3c')]({},_0x54c35a,_0x24f482[_0xc30a('0x3d')]);return db[_0xc30a('0x3e')][_0xc30a('0x44')](_0x54c35a)[_0xc30a('0x1e')](handleEntityNotFound(_0x392c74,null))['then'](respondWithResult(_0x392c74,null))['catch'](handleError(_0x392c74,null));};exports[_0xc30a('0x45')]=function(_0x452c3c,_0x47eceb){return db['ZohoField'][_0xc30a('0x45')](_0x452c3c[_0xc30a('0x46')],{})[_0xc30a('0x1e')](respondWithResult(_0x47eceb,0xc9))[_0xc30a('0x41')](handleError(_0x47eceb,null));};exports['update']=function(_0x2f93d0,_0x3e9164){if(_0x2f93d0[_0xc30a('0x46')]['id']){delete _0x2f93d0['body']['id'];}return db[_0xc30a('0x3e')]['find']({'where':{'id':_0x2f93d0[_0xc30a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e9164,null))['then'](saveUpdates(_0x2f93d0[_0xc30a('0x46')],null))[_0xc30a('0x1e')](respondWithResult(_0x3e9164,null))[_0xc30a('0x41')](handleError(_0x3e9164,null));};exports[_0xc30a('0x1f')]=function(_0x141019,_0x3fae5d){return db[_0xc30a('0x3e')][_0xc30a('0x44')]({'where':{'id':_0x141019[_0xc30a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fae5d,null))[_0xc30a('0x1e')](removeEntity(_0x3fae5d,null))[_0xc30a('0x41')](handleError(_0x3fae5d,null));}; \ No newline at end of file +var _0x2539=['apply','reject','update','then','destroy','stack','name','index','map','ZohoField','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','keys','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0xdc28de,_0x1c5aba){var _0x2acdc3=function(_0x28bf21){while(--_0x28bf21){_0xdc28de['push'](_0xdc28de['shift']());}};_0x2acdc3(++_0x1c5aba);}(_0x2539,0x147));var _0x9253=function(_0x334614,_0x13e2c3){_0x334614=_0x334614-0x0;var _0x5c1bc2=_0x2539[_0x334614];return _0x5c1bc2;};'use strict';var emlformat=require(_0x9253('0x0'));var rimraf=require(_0x9253('0x1'));var zipdir=require(_0x9253('0x2'));var jsonpatch=require(_0x9253('0x3'));var rp=require(_0x9253('0x4'));var moment=require(_0x9253('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9253('0x6'));var util=require(_0x9253('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9253('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9253('0x9'));var _=require('lodash');var squel=require(_0x9253('0xa'));var crypto=require(_0x9253('0xb'));var jsforce=require(_0x9253('0xc'));var deskjs=require(_0x9253('0xd'));var toCsv=require(_0x9253('0x8'));var querystring=require(_0x9253('0xe'));var Papa=require(_0x9253('0xf'));var Redis=require('ioredis');var authService=require(_0x9253('0x10'));var qs=require(_0x9253('0x11'));var as=require(_0x9253('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9253('0x13'))('api');var utils=require(_0x9253('0x14'));var config=require(_0x9253('0x15'));var licenseUtil=require(_0x9253('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x507b7c,_0x44ca29){_0x44ca29=_0x44ca29||0xcc;return function(_0x5d467d){if(_0x5d467d){return _0x507b7c[_0x9253('0x17')](_0x44ca29);}return _0x507b7c[_0x9253('0x18')](_0x44ca29)[_0x9253('0x19')]();};}function respondWithResult(_0x4cbcbf,_0x216b26){_0x216b26=_0x216b26||0xc8;return function(_0x2039a9){if(_0x2039a9){return _0x4cbcbf[_0x9253('0x18')](_0x216b26)[_0x9253('0x1a')](_0x2039a9);}};}function respondWithFilteredResult(_0x201d8e,_0x509648){return function(_0x3ee459){if(_0x3ee459){var _0x7690e3=typeof _0x509648[_0x9253('0x1b')]===_0x9253('0x1c')&&typeof _0x509648['limit']==='undefined';var _0x832680=_0x3ee459[_0x9253('0x1d')];var _0x237fb7=_0x7690e3?0x0:_0x509648[_0x9253('0x1b')];var _0x35d4d3=_0x7690e3?_0x3ee459[_0x9253('0x1d')]:_0x509648[_0x9253('0x1b')]+_0x509648[_0x9253('0x1e')];var _0x455e94;if(_0x35d4d3>=_0x832680){_0x35d4d3=_0x832680;_0x455e94=0xc8;}else{_0x455e94=0xce;}_0x201d8e['status'](_0x455e94);return _0x201d8e[_0x9253('0x1f')](_0x9253('0x20'),_0x237fb7+'-'+_0x35d4d3+'/'+_0x832680)['json'](_0x3ee459);}return null;};}function patchUpdates(_0x1bfdef){return function(_0x577600){try{jsonpatch[_0x9253('0x21')](_0x577600,_0x1bfdef,!![]);}catch(_0x1fd368){return BPromise[_0x9253('0x22')](_0x1fd368);}return _0x577600['save']();};}function saveUpdates(_0x291262,_0x39e2ff){return function(_0x255d09){if(_0x255d09){return _0x255d09[_0x9253('0x23')](_0x291262)[_0x9253('0x24')](function(_0x341e14){return _0x341e14;});}return null;};}function removeEntity(_0x30ffdd,_0x1f47eb){return function(_0x38f21c){if(_0x38f21c){return _0x38f21c[_0x9253('0x25')]()[_0x9253('0x24')](function(){_0x30ffdd[_0x9253('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4c89,_0x5d91f2){return function(_0x1531a9){if(!_0x1531a9){_0x5a4c89[_0x9253('0x17')](0x194);}return _0x1531a9;};}function handleError(_0x265144,_0x1ccbff){_0x1ccbff=_0x1ccbff||0x1f4;return function(_0x48a1cb){logger['error'](_0x48a1cb[_0x9253('0x26')]);if(_0x48a1cb['name']){delete _0x48a1cb[_0x9253('0x27')];}_0x265144[_0x9253('0x18')](_0x1ccbff)['send'](_0x48a1cb);};}exports[_0x9253('0x28')]=function(_0x1cc400,_0x2e0ea8){var _0x5bc897={},_0x5d30b9={},_0x129641={'count':0x0,'rows':[]};var _0x493eb3=_[_0x9253('0x29')](db[_0x9253('0x2a')]['rawAttributes'],function(_0x1be7dd){return{'name':_0x1be7dd[_0x9253('0x2b')],'type':_0x1be7dd[_0x9253('0x2c')][_0x9253('0x2d')]};});_0x5d30b9[_0x9253('0x2e')]=_[_0x9253('0x29')](_0x493eb3,'name');_0x5d30b9['query']=_['keys'](_0x1cc400['query']);_0x5d30b9[_0x9253('0x2f')]=_[_0x9253('0x30')](_0x5d30b9[_0x9253('0x2e')],_0x5d30b9[_0x9253('0x31')]);_0x5bc897['attributes']=_[_0x9253('0x30')](_0x5d30b9[_0x9253('0x2e')],qs[_0x9253('0x32')](_0x1cc400[_0x9253('0x31')][_0x9253('0x32')]));_0x5bc897['attributes']=_0x5bc897[_0x9253('0x33')][_0x9253('0x34')]?_0x5bc897[_0x9253('0x33')]:_0x5d30b9[_0x9253('0x2e')];if(!_0x1cc400[_0x9253('0x31')][_0x9253('0x35')](_0x9253('0x36'))){_0x5bc897[_0x9253('0x1e')]=qs[_0x9253('0x1e')](_0x1cc400[_0x9253('0x31')][_0x9253('0x1e')]);_0x5bc897['offset']=qs[_0x9253('0x1b')](_0x1cc400[_0x9253('0x31')][_0x9253('0x1b')]);}_0x5bc897[_0x9253('0x37')]=qs[_0x9253('0x38')](_0x1cc400[_0x9253('0x31')][_0x9253('0x38')]);_0x5bc897[_0x9253('0x39')]=qs[_0x9253('0x2f')](_[_0x9253('0x3a')](_0x1cc400[_0x9253('0x31')],_0x5d30b9[_0x9253('0x2f')]),_0x493eb3);if(_0x1cc400[_0x9253('0x31')][_0x9253('0x3b')]){_0x5bc897[_0x9253('0x39')]=_['merge'](_0x5bc897[_0x9253('0x39')],{'$or':_[_0x9253('0x29')](_0x493eb3,function(_0x598b8d){if(_0x598b8d[_0x9253('0x2c')]!=='VIRTUAL'){var _0x468985={};_0x468985[_0x598b8d[_0x9253('0x27')]]={'$like':'%'+_0x1cc400['query'][_0x9253('0x3b')]+'%'};return _0x468985;}})});}_0x5bc897=_[_0x9253('0x3c')]({},_0x5bc897,_0x1cc400['options']);var _0x30080a={'where':_0x5bc897[_0x9253('0x39')]};return db['ZohoField'][_0x9253('0x1d')](_0x30080a)[_0x9253('0x24')](function(_0xcf00a7){_0x129641[_0x9253('0x1d')]=_0xcf00a7;if(_0x1cc400[_0x9253('0x31')][_0x9253('0x3d')]){_0x5bc897[_0x9253('0x3e')]=[{'all':!![]}];}return db[_0x9253('0x2a')][_0x9253('0x3f')](_0x5bc897);})[_0x9253('0x24')](function(_0x3ad211){_0x129641[_0x9253('0x40')]=_0x3ad211;return _0x129641;})[_0x9253('0x24')](respondWithFilteredResult(_0x2e0ea8,_0x5bc897))['catch'](handleError(_0x2e0ea8,null));};exports['show']=function(_0x2ccd84,_0x20a70c){var _0x5b5afe={'raw':!![],'where':{'id':_0x2ccd84['params']['id']}},_0x2bf2c0={};_0x2bf2c0[_0x9253('0x2e')]=_[_0x9253('0x41')](db['ZohoField']['rawAttributes']);_0x2bf2c0['query']=_[_0x9253('0x41')](_0x2ccd84['query']);_0x2bf2c0[_0x9253('0x2f')]=_[_0x9253('0x30')](_0x2bf2c0[_0x9253('0x2e')],_0x2bf2c0[_0x9253('0x31')]);_0x5b5afe['attributes']=_[_0x9253('0x30')](_0x2bf2c0['model'],qs[_0x9253('0x32')](_0x2ccd84[_0x9253('0x31')]['fields']));_0x5b5afe[_0x9253('0x33')]=_0x5b5afe[_0x9253('0x33')][_0x9253('0x34')]?_0x5b5afe['attributes']:_0x2bf2c0[_0x9253('0x2e')];if(_0x2ccd84['query']['includeAll']){_0x5b5afe[_0x9253('0x3e')]=[{'all':!![]}];}_0x5b5afe=_[_0x9253('0x3c')]({},_0x5b5afe,_0x2ccd84[_0x9253('0x42')]);return db[_0x9253('0x2a')][_0x9253('0x43')](_0x5b5afe)[_0x9253('0x24')](handleEntityNotFound(_0x20a70c,null))[_0x9253('0x24')](respondWithResult(_0x20a70c,null))[_0x9253('0x44')](handleError(_0x20a70c,null));};exports[_0x9253('0x45')]=function(_0x5cc3b9,_0x51c086){return db[_0x9253('0x2a')][_0x9253('0x45')](_0x5cc3b9[_0x9253('0x46')],{})[_0x9253('0x24')](respondWithResult(_0x51c086,0xc9))[_0x9253('0x44')](handleError(_0x51c086,null));};exports[_0x9253('0x23')]=function(_0x16bd23,_0x11bad7){if(_0x16bd23[_0x9253('0x46')]['id']){delete _0x16bd23['body']['id'];}return db[_0x9253('0x2a')][_0x9253('0x43')]({'where':{'id':_0x16bd23[_0x9253('0x47')]['id']}})['then'](handleEntityNotFound(_0x11bad7,null))[_0x9253('0x24')](saveUpdates(_0x16bd23[_0x9253('0x46')],null))[_0x9253('0x24')](respondWithResult(_0x11bad7,null))[_0x9253('0x44')](handleError(_0x11bad7,null));};exports['destroy']=function(_0x129375,_0x13fd11){return db[_0x9253('0x2a')]['find']({'where':{'id':_0x129375[_0x9253('0x47')]['id']}})[_0x9253('0x24')](handleEntityNotFound(_0x13fd11,null))['then'](removeEntity(_0x13fd11,null))[_0x9253('0x44')](handleError(_0x13fd11,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 5eee17c..2981fc7 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 _0x9f0e=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x57e4fc,_0x5438b6){var _0x24987c=function(_0xc1a238){while(--_0xc1a238){_0x57e4fc['push'](_0x57e4fc['shift']());}};_0x24987c(++_0x5438b6);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1c6f04,_0x3b5dfe){_0x1c6f04=_0x1c6f04-0x0;var _0x41c62e=_0x9f0e[_0x1c6f04];return _0x41c62e;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var logger=require(_0xe9f0('0x2'))(_0xe9f0('0x3'));var moment=require(_0xe9f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9f0('0x5'));var rimraf=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var attributes=require(_0xe9f0('0x8'));module[_0xe9f0('0x9')]=function(_0x50313d,_0x5b87c1){return _0x50313d[_0xe9f0('0xa')](_0xe9f0('0xb'),attributes,{'tableName':_0xe9f0('0xc'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xe9f0('0xd'),_0xe9f0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger'];(function(_0x2d0cfb,_0x4f5148){var _0x2315bf=function(_0x27677c){while(--_0x27677c){_0x2d0cfb['push'](_0x2d0cfb['shift']());}};_0x2315bf(++_0x4f5148);}(_0x57ca,0x108));var _0xa57c=function(_0x2023fd,_0x4dce9a){_0x2023fd=_0x2023fd-0x0;var _0x40eb6d=_0x57ca[_0x2023fd];return _0x40eb6d;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[{'name':_0xa57c('0xc'),'fields':['idField',_0xa57c('0xd')],'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 a61c99a..343289e 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 _0xb397=['result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','ZohoField,\x20%s,\x20%s','message'];(function(_0x8629b4,_0xe4f9c0){var _0x3bc42a=function(_0x525241){while(--_0x525241){_0x8629b4['push'](_0x8629b4['shift']());}};_0x3bc42a(++_0xe4f9c0);}(_0xb397,0x166));var _0x7b39=function(_0x366993,_0x581488){_0x366993=_0x366993-0x0;var _0x37c367=_0xb397[_0x366993];return _0x37c367;};'use strict';var _=require('lodash');var util=require(_0x7b39('0x0'));var moment=require('moment');var BPromise=require(_0x7b39('0x1'));var rs=require(_0x7b39('0x2'));var fs=require('fs');var Redis=require(_0x7b39('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b39('0x4'));var logger=require(_0x7b39('0x5'))(_0x7b39('0x6'));var config=require(_0x7b39('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7b39('0x8')][_0x7b39('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bbf6d,_0x28451f,_0x2011ce){return new BPromise(function(_0x105e3a,_0x9d4b92){return client[_0x7b39('0xa')](_0x1bbf6d,_0x2011ce)[_0x7b39('0xb')](function(_0x3deb61){logger[_0x7b39('0xc')]('ZohoField,\x20%s,\x20%s',_0x28451f,_0x7b39('0xd'));logger[_0x7b39('0xe')](_0x7b39('0xf'),_0x28451f,'request\x20sent',JSON[_0x7b39('0x10')](_0x3deb61));if(_0x3deb61[_0x7b39('0x11')]){if(_0x3deb61[_0x7b39('0x11')]['code']===0x1f4){logger[_0x7b39('0x11')](_0x7b39('0x12'),_0x28451f,_0x3deb61[_0x7b39('0x11')][_0x7b39('0x13')]);return _0x9d4b92(_0x3deb61[_0x7b39('0x11')]['message']);}logger['error'](_0x7b39('0x12'),_0x28451f,_0x3deb61[_0x7b39('0x11')][_0x7b39('0x13')]);return _0x105e3a(_0x3deb61['error'][_0x7b39('0x13')]);}else{logger['info'](_0x7b39('0x12'),_0x28451f,_0x7b39('0xd'));_0x105e3a(_0x3deb61[_0x7b39('0x14')]['message']);}})['catch'](function(_0xf5620a){logger[_0x7b39('0x11')]('ZohoField,\x20%s,\x20%s',_0x28451f,_0xf5620a);_0x9d4b92(_0xf5620a);});});} \ No newline at end of file +var _0xc6af=['message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x491e1a,_0x305a7c){var _0x142458=function(_0x2e10ca){while(--_0x2e10ca){_0x491e1a['push'](_0x491e1a['shift']());}};_0x142458(++_0x305a7c);}(_0xc6af,0xec));var _0xfc6a=function(_0x2323f3,_0x511b57){_0x2323f3=_0x2323f3-0x0;var _0x34e1ae=_0xc6af[_0x2323f3];return _0x34e1ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc6a('0x0'));var BPromise=require(_0xfc6a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc6a('0x2'))['db'];var utils=require(_0xfc6a('0x3'));var logger=require(_0xfc6a('0x4'))('rpc');var config=require(_0xfc6a('0x5'));var jayson=require(_0xfc6a('0x6'));var client=jayson[_0xfc6a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea411,_0x417dd7,_0x18d25a){return new BPromise(function(_0x4f2ebd,_0x1436a4){return client[_0xfc6a('0x8')](_0x4ea411,_0x18d25a)[_0xfc6a('0x9')](function(_0x2160f5){logger[_0xfc6a('0xa')](_0xfc6a('0xb'),_0x417dd7,'request\x20sent');logger['debug'](_0xfc6a('0xc'),_0x417dd7,_0xfc6a('0xd'),JSON['stringify'](_0x2160f5));if(_0x2160f5['error']){if(_0x2160f5[_0xfc6a('0xe')][_0xfc6a('0xf')]===0x1f4){logger['error'](_0xfc6a('0xb'),_0x417dd7,_0x2160f5['error']['message']);return _0x1436a4(_0x2160f5['error'][_0xfc6a('0x10')]);}logger[_0xfc6a('0xe')](_0xfc6a('0xb'),_0x417dd7,_0x2160f5[_0xfc6a('0xe')][_0xfc6a('0x10')]);return _0x4f2ebd(_0x2160f5['error'][_0xfc6a('0x10')]);}else{logger[_0xfc6a('0xa')](_0xfc6a('0xb'),_0x417dd7,'request\x20sent');_0x4f2ebd(_0x2160f5['result'][_0xfc6a('0x10')]);}})[_0xfc6a('0x11')](function(_0x7d9375){logger[_0xfc6a('0xe')](_0xfc6a('0xb'),_0x417dd7,_0x7d9375);_0x1436a4(_0x7d9375);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b125172..bc1f4d5 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x238d90,_0x55ab60){var _0x46388a=function(_0x1ea450){while(--_0x1ea450){_0x238d90['push'](_0x238d90['shift']());}};_0x46388a(++_0x55ab60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x187d72,_0xa3a82){var _0x3b3fea=function(_0x45ee56){while(--_0x45ee56){_0x187d72['push'](_0x187d72['shift']());}};_0x3b3fea(++_0xa3a82);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 54d3a62..9a496d3 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 _0x5e0e=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5e0e,0x1c3));var _0xe5e0=function(_0x19faae,_0x5697bc){_0x19faae=_0x19faae-0x0;var _0x363543=_0x5e0e[_0x19faae];return _0x363543;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize[_0xe5e0('0x2')],'allowNull':![],'unique':_0xe5e0('0x3')},'version':{'type':Sequelize[_0xe5e0('0x2')],'allowNull':![],'unique':_0xe5e0('0x3')},'main':{'type':Sequelize[_0xe5e0('0x2')],'defaultValue':_0xe5e0('0x4')},'filename':{'type':Sequelize[_0xe5e0('0x2')]},'path':{'type':Sequelize[_0xe5e0('0x2')]},'type':{'type':Sequelize[_0xe5e0('0x2')]},'size':{'type':Sequelize[_0xe5e0('0x5')]},'active':{'type':Sequelize[_0xe5e0('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xe5e0('0x2')]},'state':{'type':Sequelize[_0xe5e0('0x2')],'unique':_0xe5e0('0x7')},'description':{'type':Sequelize[_0xe5e0('0x2')]},'title':{'type':Sequelize[_0xe5e0('0x2')]},'remoteUri':{'type':Sequelize[_0xe5e0('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x3cbd=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x3cbd,0x1c0));var _0xd3cb=function(_0x3ea61c,_0x42150f){_0x3ea61c=_0x3ea61c-0x0;var _0x5a9497=_0x3cbd[_0x3ea61c];return _0x5a9497;};'use strict';var Sequelize=require('sequelize');module[_0xd3cb('0x0')]={'name':{'type':Sequelize[_0xd3cb('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xd3cb('0x1')],'allowNull':![],'unique':_0xd3cb('0x2')},'main':{'type':Sequelize[_0xd3cb('0x1')],'defaultValue':_0xd3cb('0x3')},'filename':{'type':Sequelize[_0xd3cb('0x1')]},'path':{'type':Sequelize[_0xd3cb('0x1')]},'type':{'type':Sequelize[_0xd3cb('0x1')]},'size':{'type':Sequelize[_0xd3cb('0x4')]},'active':{'type':Sequelize[_0xd3cb('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xd3cb('0x1')]},'logo':{'type':Sequelize[_0xd3cb('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xd3cb('0x6')},'description':{'type':Sequelize[_0xd3cb('0x1')]},'title':{'type':Sequelize[_0xd3cb('0x1')]},'remoteUri':{'type':Sequelize[_0xd3cb('0x1')]},'link':{'type':Sequelize[_0xd3cb('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 8d43d5d..b3e767e 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 _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','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','../../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','apply','save','update','then','destroy','error','name','send','index'];(function(_0x58d381,_0x382cbc){var _0x493124=function(_0x3cdb42){while(--_0x3cdb42){_0x58d381['push'](_0x58d381['shift']());}};_0x493124(++_0x382cbc);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x2a6a31,_0x33778f){var _0x3cc0f8=function(_0x383258){while(--_0x383258){_0x2a6a31['push'](_0x2a6a31['shift']());}};_0x3cc0f8(++_0x33778f);}(_0xfcf0,0x138));var _0x0fcf=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xfcf0[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 39dc656..2d96f7c 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 _0x642d=['rimraf','exports','Integration','integrations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x32f2d9,_0x547052){var _0x117ad6=function(_0x1027c5){while(--_0x1027c5){_0x32f2d9['push'](_0x32f2d9['shift']());}};_0x117ad6(++_0x547052);}(_0x642d,0x130));var _0xd642=function(_0x2a09c4,_0x2fee1c){_0x2a09c4=_0x2a09c4-0x0;var _0x5cb37a=_0x642d[_0x2a09c4];return _0x5cb37a;};'use strict';var _=require(_0xd642('0x0'));var util=require(_0xd642('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd642('0x2'));var BPromise=require(_0xd642('0x3'));var rp=require(_0xd642('0x4'));var fs=require('fs');var path=require(_0xd642('0x5'));var rimraf=require(_0xd642('0x6'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xd642('0x7')]=function(_0x4087c2,_0x304cc3){return _0x4087c2['define'](_0xd642('0x8'),attributes,{'tableName':_0xd642('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2549=['./integration.attributes','exports','define','Integration','integrations','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0xd120d3,_0x2eab13){var _0x1c8d80=function(_0x398429){while(--_0x398429){_0xd120d3['push'](_0xd120d3['shift']());}};_0x1c8d80(++_0x2eab13);}(_0x2549,0xaa));var _0x9254=function(_0x43e953,_0x434b65){_0x43e953=_0x43e953-0x0;var _0x1d1ef8=_0x2549[_0x43e953];return _0x1d1ef8;};'use strict';var _=require('lodash');var util=require(_0x9254('0x0'));var logger=require(_0x9254('0x1'))(_0x9254('0x2'));var moment=require(_0x9254('0x3'));var BPromise=require('bluebird');var rp=require(_0x9254('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9254('0x5'));var config=require('../../config/environment');var attributes=require(_0x9254('0x6'));module[_0x9254('0x7')]=function(_0x4a80cb,_0x5b2f31){return _0x4a80cb[_0x9254('0x8')](_0x9254('0x9'),attributes,{'tableName':_0x9254('0xa'),'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 984fa19..6ed0c93 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 _0x7a54=['info','Integration,\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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x181cbb,_0x409233){_0x181cbb=_0x181cbb-0x0;var _0x5f057e=_0x7a54[_0x181cbb];return _0x5f057e;};'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')]('Integration,\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 _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x144556,_0x5ca316){var _0x1bb692=function(_0x50af98){while(--_0x50af98){_0x144556['push'](_0x144556['shift']());}};_0x1bb692(++_0x5ca316);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x678532,_0x5073c2){_0x678532=_0x678532-0x0;var _0x1d3937=_0xd7d1[_0x678532];return _0x1d3937;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 0e4c1da..a48d0eb 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x0295,0x1f0));var _0x5029=function(_0xe4c712,_0x1e26d5){_0xe4c712=_0xe4c712-0x0;var _0x101962=_0x0295[_0xe4c712];return _0x101962;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file +var _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1e2f6b,_0x9dd727){var _0x3e6e83=function(_0x1180f6){while(--_0x1180f6){_0x1e2f6b['push'](_0x1e2f6b['shift']());}};_0x3e6e83(++_0x9dd727);}(_0x57ca,0x108));var _0xa57c=function(_0x150656,_0x6382ef){_0x150656=_0x150656-0x0;var _0x52d5f1=_0x57ca[_0x150656];return _0x52d5f1;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5c94ee7..1304b95 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 _0xc5e6=['SENDING','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x1f2455,_0x33ee79){var _0x1cf505=function(_0x2dc908){while(--_0x2dc908){_0x1f2455['push'](_0x1f2455['shift']());}};_0x1cf505(++_0x33ee79);}(_0xc5e6,0x83));var _0x6c5e=function(_0x3c6c1b,_0x82a1e4){_0x3c6c1b=_0x3c6c1b-0x0;var _0x15170e=_0xc5e6[_0x3c6c1b];return _0x15170e;};'use strict';var Sequelize=require(_0x6c5e('0x0'));module[_0x6c5e('0x1')]={'integration':{'type':Sequelize[_0x6c5e('0x2')]},'eventChannel':{'type':Sequelize[_0x6c5e('0x2')]},'exitStatus':{'type':Sequelize[_0x6c5e('0x2')]},'ticketId':{'type':Sequelize[_0x6c5e('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6c5e('0x2')]},'calleridnum':{'type':Sequelize[_0x6c5e('0x2')]},'calleridname':{'type':Sequelize[_0x6c5e('0x2')]},'queue':{'type':Sequelize[_0x6c5e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6c5e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6c5e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6c5e('0x3')]},'holdtime':{'type':Sequelize[_0x6c5e('0x4')]},'agentcomplete':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x6c5e('0x4')]},'agentacw':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6c5e('0x4')]},'reason':{'type':Sequelize[_0x6c5e('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6c5e('0x2')]},'channel':{'type':Sequelize[_0x6c5e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6c5e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6c5e('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6c5e('0x2')]},'accountcode':{'type':Sequelize[_0x6c5e('0x2')]},'context':{'type':Sequelize[_0x6c5e('0x2')]},'exten':{'type':Sequelize[_0x6c5e('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x6c5e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x6c5e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6c5e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6c5e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6c5e('0x2')]},'destlanguage':{'type':Sequelize[_0x6c5e('0x2')]},'destaccountcode':{'type':Sequelize[_0x6c5e('0x2')]},'destcontext':{'type':Sequelize[_0x6c5e('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6c5e('0x2')]},'messageId':{'type':Sequelize[_0x6c5e('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6c5e('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x6c5e('0x6')]},'html':{'type':Sequelize[_0x6c5e('0x6')]},'text':{'type':Sequelize[_0x6c5e('0x6')]},'status':{'type':Sequelize[_0x6c5e('0x7')](_0x6c5e('0x8'),_0x6c5e('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x6c5e('0x2')]},'app':{'type':Sequelize[_0x6c5e('0x2')]},'appdata':{'type':Sequelize[_0x6c5e('0x2')]},'projectId':{'type':Sequelize[_0x6c5e('0x4')]}}; \ No newline at end of file +var _0xd0c8=['STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x25ddad,_0x352018){var _0x234a1f=function(_0x5c6744){while(--_0x5c6744){_0x25ddad['push'](_0x25ddad['shift']());}};_0x234a1f(++_0x352018);}(_0xd0c8,0x128));var _0x8d0c=function(_0x4ab721,_0x3152cc){_0x4ab721=_0x4ab721-0x0;var _0x336ec9=_0xd0c8[_0x4ab721];return _0x336ec9;};'use strict';var Sequelize=require(_0x8d0c('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x8d0c('0x1')]},'ticketId':{'type':Sequelize[_0x8d0c('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8d0c('0x1')]},'queue':{'type':Sequelize[_0x8d0c('0x1')]},'interface':{'type':Sequelize[_0x8d0c('0x1')]},'membername':{'type':Sequelize[_0x8d0c('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8d0c('0x2')]},'holdtime':{'type':Sequelize[_0x8d0c('0x3')]},'agentcomplete':{'type':Sequelize[_0x8d0c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8d0c('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8d0c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8d0c('0x3')]},'reason':{'type':Sequelize[_0x8d0c('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x8d0c('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8d0c('0x2')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x8d0c('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x8d0c('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8d0c('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8d0c('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x8d0c('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8d0c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x8d0c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8d0c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8d0c('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8d0c('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8d0c('0x1')]},'destexten':{'type':Sequelize[_0x8d0c('0x1')]},'destpriority':{'type':Sequelize[_0x8d0c('0x1')]},'destuniqueid':{'type':Sequelize[_0x8d0c('0x1')]},'messageId':{'type':Sequelize[_0x8d0c('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x8d0c('0x1')]},'from':{'type':Sequelize[_0x8d0c('0x1')]},'to':{'type':Sequelize[_0x8d0c('0x1')]},'cc':{'type':Sequelize[_0x8d0c('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x8d0c('0x5')]},'text':{'type':Sequelize[_0x8d0c('0x5')]},'status':{'type':Sequelize[_0x8d0c('0x6')](_0x8d0c('0x7'),_0x8d0c('0x8'),_0x8d0c('0x9'),_0x8d0c('0xa'))},'url':{'type':Sequelize[_0x8d0c('0x1')]},'app':{'type':Sequelize[_0x8d0c('0x1')]},'appdata':{'type':Sequelize[_0x8d0c('0x1')]},'projectId':{'type':Sequelize[_0x8d0c('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c1e1971..8eead1f 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 _0xd648=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','includeAll','rows','catch','params','rawAttributes','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','IntegrationReport','fieldName','type','key','model','query','keys','intersection'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xd648,0x1da));var _0x8d64=function(_0x4f45cc,_0x2d99f0){_0x4f45cc=_0x4f45cc-0x0;var _0x1b9315=_0xd648[_0x4f45cc];return _0x1b9315;};'use strict';var emlformat=require(_0x8d64('0x0'));var rimraf=require(_0x8d64('0x1'));var zipdir=require(_0x8d64('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d64('0x3'));var moment=require(_0x8d64('0x4'));var BPromise=require(_0x8d64('0x5'));var Mustache=require(_0x8d64('0x6'));var util=require('util');var path=require(_0x8d64('0x7'));var sox=require(_0x8d64('0x8'));var csv=require('to-csv');var ejs=require(_0x8d64('0x9'));var fs=require('fs');var fs_extra=require(_0x8d64('0xa'));var _=require('lodash');var squel=require(_0x8d64('0xb'));var crypto=require(_0x8d64('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d64('0xd'));var querystring=require(_0x8d64('0xe'));var Papa=require(_0x8d64('0xf'));var Redis=require(_0x8d64('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8d64('0x11'));var as=require(_0x8d64('0x12'));var hardwareService=require(_0x8d64('0x13'));var logger=require('../../config/logger')(_0x8d64('0x14'));var utils=require(_0x8d64('0x15'));var config=require(_0x8d64('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d64('0x17'))['db'];function respondWithStatusCode(_0x277155,_0xa54ba3){_0xa54ba3=_0xa54ba3||0xcc;return function(_0x4623da){if(_0x4623da){return _0x277155['sendStatus'](_0xa54ba3);}return _0x277155[_0x8d64('0x18')](_0xa54ba3)[_0x8d64('0x19')]();};}function respondWithResult(_0x4ac3f7,_0x3096c8){_0x3096c8=_0x3096c8||0xc8;return function(_0x3bfb61){if(_0x3bfb61){return _0x4ac3f7[_0x8d64('0x18')](_0x3096c8)[_0x8d64('0x1a')](_0x3bfb61);}};}function respondWithFilteredResult(_0x135a1f,_0x3a2504){return function(_0x3737ac){if(_0x3737ac){var _0x666255=typeof _0x3a2504[_0x8d64('0x1b')]===_0x8d64('0x1c')&&typeof _0x3a2504[_0x8d64('0x1d')]===_0x8d64('0x1c');var _0x1800a0=_0x3737ac[_0x8d64('0x1e')];var _0x231c34=_0x666255?0x0:_0x3a2504[_0x8d64('0x1b')];var _0x308d2b=_0x666255?_0x3737ac[_0x8d64('0x1e')]:_0x3a2504[_0x8d64('0x1b')]+_0x3a2504[_0x8d64('0x1d')];var _0x4ac75f;if(_0x308d2b>=_0x1800a0){_0x308d2b=_0x1800a0;_0x4ac75f=0xc8;}else{_0x4ac75f=0xce;}_0x135a1f[_0x8d64('0x18')](_0x4ac75f);return _0x135a1f[_0x8d64('0x1f')](_0x8d64('0x20'),_0x231c34+'-'+_0x308d2b+'/'+_0x1800a0)[_0x8d64('0x1a')](_0x3737ac);}return null;};}function patchUpdates(_0xc3aca4){return function(_0x4c2eff){try{jsonpatch[_0x8d64('0x21')](_0x4c2eff,_0xc3aca4,!![]);}catch(_0x41cf22){return BPromise['reject'](_0x41cf22);}return _0x4c2eff['save']();};}function saveUpdates(_0x31f741,_0x4d025e){return function(_0x4c9ce5){if(_0x4c9ce5){return _0x4c9ce5[_0x8d64('0x22')](_0x31f741)['then'](function(_0xa26da4){return _0xa26da4;});}return null;};}function removeEntity(_0x50e390,_0x23118d){return function(_0x3d2b9e){if(_0x3d2b9e){return _0x3d2b9e[_0x8d64('0x23')]()[_0x8d64('0x24')](function(){_0x50e390['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x326406,_0x4b4ad4){return function(_0x169850){if(!_0x169850){_0x326406['sendStatus'](0x194);}return _0x169850;};}function handleError(_0x7ab6be,_0x3db02e){_0x3db02e=_0x3db02e||0x1f4;return function(_0x1e35aa){logger[_0x8d64('0x25')](_0x1e35aa[_0x8d64('0x26')]);if(_0x1e35aa[_0x8d64('0x27')]){delete _0x1e35aa[_0x8d64('0x27')];}_0x7ab6be[_0x8d64('0x18')](_0x3db02e)[_0x8d64('0x28')](_0x1e35aa);};}exports[_0x8d64('0x29')]=function(_0x4bbc53,_0x299e2b){var _0x5ec37f={},_0x21e0cc={},_0x571824={'count':0x0,'rows':[]};var _0x1d5ed2=_[_0x8d64('0x2a')](db[_0x8d64('0x2b')]['rawAttributes'],function(_0x207796){return{'name':_0x207796[_0x8d64('0x2c')],'type':_0x207796[_0x8d64('0x2d')][_0x8d64('0x2e')]};});_0x21e0cc[_0x8d64('0x2f')]=_[_0x8d64('0x2a')](_0x1d5ed2,_0x8d64('0x27'));_0x21e0cc[_0x8d64('0x30')]=_[_0x8d64('0x31')](_0x4bbc53[_0x8d64('0x30')]);_0x21e0cc['filters']=_[_0x8d64('0x32')](_0x21e0cc[_0x8d64('0x2f')],_0x21e0cc[_0x8d64('0x30')]);_0x5ec37f['attributes']=_[_0x8d64('0x32')](_0x21e0cc['model'],qs[_0x8d64('0x33')](_0x4bbc53['query'][_0x8d64('0x33')]));_0x5ec37f['attributes']=_0x5ec37f[_0x8d64('0x34')][_0x8d64('0x35')]?_0x5ec37f['attributes']:_0x21e0cc[_0x8d64('0x2f')];if(!_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x36')](_0x8d64('0x37'))){_0x5ec37f[_0x8d64('0x1d')]=qs['limit'](_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x1d')]);_0x5ec37f[_0x8d64('0x1b')]=qs[_0x8d64('0x1b')](_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x1b')]);}_0x5ec37f[_0x8d64('0x38')]=qs[_0x8d64('0x39')](_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x39')]);_0x5ec37f[_0x8d64('0x3a')]=qs['filters'](_[_0x8d64('0x3b')](_0x4bbc53[_0x8d64('0x30')],_0x21e0cc[_0x8d64('0x3c')]),_0x1d5ed2);if(_0x4bbc53['query'][_0x8d64('0x3d')]){_0x5ec37f['where']=_['merge'](_0x5ec37f[_0x8d64('0x3a')],{'$or':_[_0x8d64('0x2a')](_0x1d5ed2,function(_0x11f8fc){if(_0x11f8fc['type']!==_0x8d64('0x3e')){var _0x2349ab={};_0x2349ab[_0x11f8fc[_0x8d64('0x27')]]={'$like':'%'+_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x3d')]+'%'};return _0x2349ab;}})});}_0x5ec37f=_[_0x8d64('0x3f')]({},_0x5ec37f,_0x4bbc53['options']);var _0x5de613={'where':_0x5ec37f[_0x8d64('0x3a')]};return db[_0x8d64('0x2b')][_0x8d64('0x1e')](_0x5de613)['then'](function(_0x15d37b){_0x571824[_0x8d64('0x1e')]=_0x15d37b;if(_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x40')]){_0x5ec37f['include']=[{'all':!![]}];}return db[_0x8d64('0x2b')]['findAll'](_0x5ec37f);})[_0x8d64('0x24')](function(_0x462d8d){_0x571824[_0x8d64('0x41')]=_0x462d8d;return _0x571824;})[_0x8d64('0x24')](respondWithFilteredResult(_0x299e2b,_0x5ec37f))[_0x8d64('0x42')](handleError(_0x299e2b,null));};exports['show']=function(_0x482225,_0xe88c03){var _0x50aee6={'raw':![],'where':{'id':_0x482225[_0x8d64('0x43')]['id']}},_0x3abee0={};_0x3abee0[_0x8d64('0x2f')]=_[_0x8d64('0x31')](db[_0x8d64('0x2b')][_0x8d64('0x44')]);_0x3abee0['query']=_['keys'](_0x482225[_0x8d64('0x30')]);_0x3abee0[_0x8d64('0x3c')]=_[_0x8d64('0x32')](_0x3abee0[_0x8d64('0x2f')],_0x3abee0['query']);_0x50aee6[_0x8d64('0x34')]=_[_0x8d64('0x32')](_0x3abee0['model'],qs[_0x8d64('0x33')](_0x482225[_0x8d64('0x30')][_0x8d64('0x33')]));_0x50aee6[_0x8d64('0x34')]=_0x50aee6[_0x8d64('0x34')][_0x8d64('0x35')]?_0x50aee6['attributes']:_0x3abee0[_0x8d64('0x2f')];if(_0x482225[_0x8d64('0x30')][_0x8d64('0x40')]){_0x50aee6[_0x8d64('0x45')]=[{'all':!![]}];}_0x50aee6=_[_0x8d64('0x3f')]({},_0x50aee6,_0x482225[_0x8d64('0x46')]);return db[_0x8d64('0x2b')][_0x8d64('0x47')](_0x50aee6)[_0x8d64('0x24')](handleEntityNotFound(_0xe88c03,null))[_0x8d64('0x24')](respondWithResult(_0xe88c03,null))[_0x8d64('0x42')](handleError(_0xe88c03,null));};exports[_0x8d64('0x48')]=function(_0x37ed97,_0x18e18e){return db['IntegrationReport'][_0x8d64('0x48')](_0x37ed97['body'],{})[_0x8d64('0x24')](respondWithResult(_0x18e18e,0xc9))[_0x8d64('0x42')](handleError(_0x18e18e,null));};exports[_0x8d64('0x22')]=function(_0x40e2c6,_0x21250b){if(_0x40e2c6[_0x8d64('0x49')]['id']){delete _0x40e2c6[_0x8d64('0x49')]['id'];}return db[_0x8d64('0x2b')][_0x8d64('0x47')]({'where':{'id':_0x40e2c6[_0x8d64('0x43')]['id']}})[_0x8d64('0x24')](handleEntityNotFound(_0x21250b,null))['then'](saveUpdates(_0x40e2c6['body'],null))[_0x8d64('0x24')](respondWithResult(_0x21250b,null))[_0x8d64('0x42')](handleError(_0x21250b,null));};exports[_0x8d64('0x23')]=function(_0x498444,_0xc7f89d){return db['IntegrationReport'][_0x8d64('0x47')]({'where':{'id':_0x498444[_0x8d64('0x43')]['id']}})[_0x8d64('0x24')](handleEntityNotFound(_0xc7f89d,null))[_0x8d64('0x24')](removeEntity(_0xc7f89d,null))['catch'](handleError(_0xc7f89d,null));};exports[_0x8d64('0x4a')]=function(_0x4117b8,_0x203dca){return db[_0x8d64('0x2b')][_0x8d64('0x4a')]()['then'](respondWithResult(_0x203dca,null))['catch'](handleError(_0x203dca,null));}; \ No newline at end of file +var _0x7718=['json','apply','reject','save','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','IntegrationReport','include','rows','catch','show','params','includeAll','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x4c6eb0,_0x3301b0){var _0x417e51=function(_0x884a0d){while(--_0x884a0d){_0x4c6eb0['push'](_0x4c6eb0['shift']());}};_0x417e51(++_0x3301b0);}(_0x7718,0x1f3));var _0x8771=function(_0x218f85,_0x33824e){_0x218f85=_0x218f85-0x0;var _0x35da76=_0x7718[_0x218f85];return _0x35da76;};'use strict';var emlformat=require(_0x8771('0x0'));var rimraf=require(_0x8771('0x1'));var zipdir=require(_0x8771('0x2'));var jsonpatch=require(_0x8771('0x3'));var rp=require(_0x8771('0x4'));var moment=require(_0x8771('0x5'));var BPromise=require(_0x8771('0x6'));var Mustache=require(_0x8771('0x7'));var util=require('util');var path=require(_0x8771('0x8'));var sox=require(_0x8771('0x9'));var csv=require(_0x8771('0xa'));var ejs=require(_0x8771('0xb'));var fs=require('fs');var fs_extra=require(_0x8771('0xc'));var _=require('lodash');var squel=require(_0x8771('0xd'));var crypto=require(_0x8771('0xe'));var jsforce=require(_0x8771('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8771('0xa'));var querystring=require(_0x8771('0x10'));var Papa=require('papaparse');var Redis=require(_0x8771('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8771('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8771('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8771('0x14'));var config=require(_0x8771('0x15'));var licenseUtil=require(_0x8771('0x16'));var db=require(_0x8771('0x17'))['db'];function respondWithStatusCode(_0x1b2aad,_0x40d1c6){_0x40d1c6=_0x40d1c6||0xcc;return function(_0x160948){if(_0x160948){return _0x1b2aad[_0x8771('0x18')](_0x40d1c6);}return _0x1b2aad[_0x8771('0x19')](_0x40d1c6)[_0x8771('0x1a')]();};}function respondWithResult(_0x332a8c,_0x460fb1){_0x460fb1=_0x460fb1||0xc8;return function(_0x3b20c8){if(_0x3b20c8){return _0x332a8c[_0x8771('0x19')](_0x460fb1)['json'](_0x3b20c8);}};}function respondWithFilteredResult(_0xcbd980,_0x2b4f20){return function(_0x468871){if(_0x468871){var _0x5cc909=typeof _0x2b4f20[_0x8771('0x1b')]===_0x8771('0x1c')&&typeof _0x2b4f20[_0x8771('0x1d')]==='undefined';var _0x3aa81a=_0x468871[_0x8771('0x1e')];var _0x1aa37b=_0x5cc909?0x0:_0x2b4f20[_0x8771('0x1b')];var _0x4251b0=_0x5cc909?_0x468871[_0x8771('0x1e')]:_0x2b4f20[_0x8771('0x1b')]+_0x2b4f20[_0x8771('0x1d')];var _0xeaed45;if(_0x4251b0>=_0x3aa81a){_0x4251b0=_0x3aa81a;_0xeaed45=0xc8;}else{_0xeaed45=0xce;}_0xcbd980[_0x8771('0x19')](_0xeaed45);return _0xcbd980[_0x8771('0x1f')](_0x8771('0x20'),_0x1aa37b+'-'+_0x4251b0+'/'+_0x3aa81a)[_0x8771('0x21')](_0x468871);}return null;};}function patchUpdates(_0x758bf5){return function(_0x5b17b5){try{jsonpatch[_0x8771('0x22')](_0x5b17b5,_0x758bf5,!![]);}catch(_0x2fc82b){return BPromise[_0x8771('0x23')](_0x2fc82b);}return _0x5b17b5[_0x8771('0x24')]();};}function saveUpdates(_0x1d9d31,_0xe0efa3){return function(_0x3f6367){if(_0x3f6367){return _0x3f6367['update'](_0x1d9d31)['then'](function(_0x4fc9c8){return _0x4fc9c8;});}return null;};}function removeEntity(_0x389845,_0x2db7b8){return function(_0x215b34){if(_0x215b34){return _0x215b34[_0x8771('0x25')]()[_0x8771('0x26')](function(){_0x389845[_0x8771('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x485ab5,_0x5ec902){return function(_0x4b433b){if(!_0x4b433b){_0x485ab5['sendStatus'](0x194);}return _0x4b433b;};}function handleError(_0x9c058b,_0x42b7d9){_0x42b7d9=_0x42b7d9||0x1f4;return function(_0x1b8672){logger[_0x8771('0x27')](_0x1b8672['stack']);if(_0x1b8672[_0x8771('0x28')]){delete _0x1b8672[_0x8771('0x28')];}_0x9c058b[_0x8771('0x19')](_0x42b7d9)[_0x8771('0x29')](_0x1b8672);};}exports[_0x8771('0x2a')]=function(_0x198b9a,_0x5e7292){var _0x3561cd={},_0x516a58={},_0x68dc38={'count':0x0,'rows':[]};var _0xc2f8aa=_[_0x8771('0x2b')](db['IntegrationReport'][_0x8771('0x2c')],function(_0x1fbeb7){return{'name':_0x1fbeb7[_0x8771('0x2d')],'type':_0x1fbeb7[_0x8771('0x2e')][_0x8771('0x2f')]};});_0x516a58[_0x8771('0x30')]=_[_0x8771('0x2b')](_0xc2f8aa,_0x8771('0x28'));_0x516a58[_0x8771('0x31')]=_[_0x8771('0x32')](_0x198b9a[_0x8771('0x31')]);_0x516a58[_0x8771('0x33')]=_[_0x8771('0x34')](_0x516a58[_0x8771('0x30')],_0x516a58[_0x8771('0x31')]);_0x3561cd[_0x8771('0x35')]=_[_0x8771('0x34')](_0x516a58[_0x8771('0x30')],qs[_0x8771('0x36')](_0x198b9a[_0x8771('0x31')][_0x8771('0x36')]));_0x3561cd['attributes']=_0x3561cd[_0x8771('0x35')][_0x8771('0x37')]?_0x3561cd[_0x8771('0x35')]:_0x516a58[_0x8771('0x30')];if(!_0x198b9a['query'][_0x8771('0x38')](_0x8771('0x39'))){_0x3561cd['limit']=qs['limit'](_0x198b9a[_0x8771('0x31')][_0x8771('0x1d')]);_0x3561cd[_0x8771('0x1b')]=qs[_0x8771('0x1b')](_0x198b9a[_0x8771('0x31')][_0x8771('0x1b')]);}_0x3561cd[_0x8771('0x3a')]=qs['sort'](_0x198b9a[_0x8771('0x31')][_0x8771('0x3b')]);_0x3561cd['where']=qs[_0x8771('0x33')](_['pick'](_0x198b9a[_0x8771('0x31')],_0x516a58[_0x8771('0x33')]),_0xc2f8aa);if(_0x198b9a[_0x8771('0x31')][_0x8771('0x3c')]){_0x3561cd[_0x8771('0x3d')]=_['merge'](_0x3561cd[_0x8771('0x3d')],{'$or':_['map'](_0xc2f8aa,function(_0x3fa331){if(_0x3fa331[_0x8771('0x2e')]!=='VIRTUAL'){var _0xc9a33b={};_0xc9a33b[_0x3fa331['name']]={'$like':'%'+_0x198b9a[_0x8771('0x31')][_0x8771('0x3c')]+'%'};return _0xc9a33b;}})});}_0x3561cd=_[_0x8771('0x3e')]({},_0x3561cd,_0x198b9a['options']);var _0x525ee4={'where':_0x3561cd[_0x8771('0x3d')]};return db[_0x8771('0x3f')][_0x8771('0x1e')](_0x525ee4)['then'](function(_0x1b49ce){_0x68dc38[_0x8771('0x1e')]=_0x1b49ce;if(_0x198b9a[_0x8771('0x31')]['includeAll']){_0x3561cd[_0x8771('0x40')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x3561cd);})['then'](function(_0x255843){_0x68dc38[_0x8771('0x41')]=_0x255843;return _0x68dc38;})[_0x8771('0x26')](respondWithFilteredResult(_0x5e7292,_0x3561cd))[_0x8771('0x42')](handleError(_0x5e7292,null));};exports[_0x8771('0x43')]=function(_0x5fa8f1,_0x936df9){var _0x26e61c={'raw':![],'where':{'id':_0x5fa8f1[_0x8771('0x44')]['id']}},_0x1e7f33={};_0x1e7f33[_0x8771('0x30')]=_[_0x8771('0x32')](db[_0x8771('0x3f')][_0x8771('0x2c')]);_0x1e7f33[_0x8771('0x31')]=_['keys'](_0x5fa8f1[_0x8771('0x31')]);_0x1e7f33[_0x8771('0x33')]=_[_0x8771('0x34')](_0x1e7f33['model'],_0x1e7f33[_0x8771('0x31')]);_0x26e61c[_0x8771('0x35')]=_[_0x8771('0x34')](_0x1e7f33[_0x8771('0x30')],qs[_0x8771('0x36')](_0x5fa8f1['query'][_0x8771('0x36')]));_0x26e61c[_0x8771('0x35')]=_0x26e61c[_0x8771('0x35')]['length']?_0x26e61c[_0x8771('0x35')]:_0x1e7f33[_0x8771('0x30')];if(_0x5fa8f1[_0x8771('0x31')][_0x8771('0x45')]){_0x26e61c[_0x8771('0x40')]=[{'all':!![]}];}_0x26e61c=_[_0x8771('0x3e')]({},_0x26e61c,_0x5fa8f1[_0x8771('0x46')]);return db['IntegrationReport'][_0x8771('0x47')](_0x26e61c)['then'](handleEntityNotFound(_0x936df9,null))['then'](respondWithResult(_0x936df9,null))[_0x8771('0x42')](handleError(_0x936df9,null));};exports[_0x8771('0x48')]=function(_0x165870,_0xde4fa6){return db['IntegrationReport'][_0x8771('0x48')](_0x165870[_0x8771('0x49')],{})[_0x8771('0x26')](respondWithResult(_0xde4fa6,0xc9))[_0x8771('0x42')](handleError(_0xde4fa6,null));};exports[_0x8771('0x4a')]=function(_0x522c1a,_0x459e8e){if(_0x522c1a[_0x8771('0x49')]['id']){delete _0x522c1a['body']['id'];}return db[_0x8771('0x3f')][_0x8771('0x47')]({'where':{'id':_0x522c1a[_0x8771('0x44')]['id']}})[_0x8771('0x26')](handleEntityNotFound(_0x459e8e,null))[_0x8771('0x26')](saveUpdates(_0x522c1a[_0x8771('0x49')],null))[_0x8771('0x26')](respondWithResult(_0x459e8e,null))[_0x8771('0x42')](handleError(_0x459e8e,null));};exports['destroy']=function(_0x4a9a80,_0x3ebc8b){return db['IntegrationReport'][_0x8771('0x47')]({'where':{'id':_0x4a9a80['params']['id']}})[_0x8771('0x26')](handleEntityNotFound(_0x3ebc8b,null))['then'](removeEntity(_0x3ebc8b,null))[_0x8771('0x42')](handleError(_0x3ebc8b,null));};exports[_0x8771('0x4b')]=function(_0x15641b,_0x62d952){return db[_0x8771('0x3f')][_0x8771('0x4b')]()[_0x8771('0x26')](respondWithResult(_0x62d952,null))[_0x8771('0x42')](handleError(_0x62d952,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d221c48..01a8586 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 _0xfe9f=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','util','api','moment','bluebird','request-promise'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xfe9f,0xaf));var _0xffe9=function(_0x3ddf5c,_0x5e55eb){_0x3ddf5c=_0x3ddf5c-0x0;var _0x4a3410=_0xfe9f[_0x3ddf5c];return _0x4a3410;};'use strict';var _=require('lodash');var util=require(_0xffe9('0x0'));var logger=require('../../config/logger')(_0xffe9('0x1'));var moment=require(_0xffe9('0x2'));var BPromise=require(_0xffe9('0x3'));var rp=require(_0xffe9('0x4'));var fs=require('fs');var path=require(_0xffe9('0x5'));var rimraf=require(_0xffe9('0x6'));var config=require(_0xffe9('0x7'));var attributes=require(_0xffe9('0x8'));module[_0xffe9('0x9')]=function(_0x2d750b,_0x1cd396){return _0x2d750b['define'](_0xffe9('0xa'),attributes,{'tableName':_0xffe9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4859=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0x4859,0x82));var _0x9485=function(_0x33b688,_0x17eb2d){_0x33b688=_0x33b688-0x0;var _0x638751=_0x4859[_0x33b688];return _0x638751;};'use strict';var _=require('lodash');var util=require(_0x9485('0x0'));var logger=require(_0x9485('0x1'))(_0x9485('0x2'));var moment=require('moment');var BPromise=require(_0x9485('0x3'));var rp=require(_0x9485('0x4'));var fs=require('fs');var path=require(_0x9485('0x5'));var rimraf=require(_0x9485('0x6'));var config=require(_0x9485('0x7'));var attributes=require(_0x9485('0x8'));module['exports']=function(_0x145e4b,_0x9dbf64){return _0x145e4b['define'](_0x9485('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index bdcf2f6..0524229 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 _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x340009,_0x416b26){var _0x48f1de=function(_0x35aebd){while(--_0x35aebd){_0x340009['push'](_0x340009['shift']());}};_0x48f1de(++_0x416b26);}(_0xda19,0xd5));var _0x9da1=function(_0x51aff1,_0x1ce446){_0x51aff1=_0x51aff1-0x0;var _0x42a506=_0xda19[_0x51aff1];return _0x42a506;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file +var _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x48483e,_0x3304d8){var _0x26684a=function(_0x38c618){while(--_0x38c618){_0x48483e['push'](_0x48483e['shift']());}};_0x26684a(++_0x3304d8);}(_0x326f,0xd1));var _0xf326=function(_0x3d432f,_0x3ad173){_0x3d432f=_0x3d432f-0x0;var _0x5bf56e=_0x326f[_0x3d432f];return _0x5bf56e;};'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')]('IntegrationReport,\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')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 3d4dc3f..b69a709 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 _0xe202=['express','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x480f46,_0x585199){var _0x1431e0=function(_0x1a24f5){while(--_0x1a24f5){_0x480f46['push'](_0x480f46['shift']());}};_0x1431e0(++_0x585199);}(_0xe202,0x194));var _0x2e20=function(_0x433945,_0x59b45f){_0x433945=_0x433945-0x0;var _0x4a5392=_0xe202[_0x433945];return _0x4a5392;};'use strict';var multer=require(_0x2e20('0x0'));var util=require(_0x2e20('0x1'));var path=require(_0x2e20('0x2'));var timeout=require(_0x2e20('0x3'));var express=require(_0x2e20('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e20('0x5'));var interaction=require(_0x2e20('0x6'));var config=require('../../config/environment');var controller=require(_0x2e20('0x7'));router[_0x2e20('0x8')]('/',auth[_0x2e20('0x9')](),controller[_0x2e20('0xa')]);router[_0x2e20('0x8')]('/:id',auth[_0x2e20('0x9')](),controller['show']);router[_0x2e20('0x8')](_0x2e20('0xb'),auth[_0x2e20('0x9')](),controller[_0x2e20('0xc')]);router[_0x2e20('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e20('0xe')]);router[_0x2e20('0xd')](_0x2e20('0xb'),auth[_0x2e20('0x9')](),controller[_0x2e20('0xf')]);router['post'](_0x2e20('0x10'),auth['isAuthenticated'](),controller[_0x2e20('0x11')]);router[_0x2e20('0x12')](_0x2e20('0x13'),auth[_0x2e20('0x9')](),controller[_0x2e20('0x14')]);router[_0x2e20('0x15')](_0x2e20('0x13'),auth[_0x2e20('0x9')](),controller[_0x2e20('0x16')]);module[_0x2e20('0x17')]=router; \ No newline at end of file +var _0x39d4=['post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','index','get','/:id','isAuthenticated','show','getIntervals','create'];(function(_0x34ef8e,_0x5a9507){var _0x339bf3=function(_0x33cd72){while(--_0x33cd72){_0x34ef8e['push'](_0x34ef8e['shift']());}};_0x339bf3(++_0x5a9507);}(_0x39d4,0x9e));var _0x439d=function(_0x38d7d5,_0x143ee9){_0x38d7d5=_0x38d7d5-0x0;var _0x2fc0fe=_0x39d4[_0x38d7d5];return _0x2fc0fe;};'use strict';var multer=require(_0x439d('0x0'));var util=require(_0x439d('0x1'));var path=require(_0x439d('0x2'));var timeout=require(_0x439d('0x3'));var express=require(_0x439d('0x4'));var router=express[_0x439d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x439d('0x6'));var interaction=require(_0x439d('0x7'));var config=require(_0x439d('0x8'));var controller=require(_0x439d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x439d('0xa')]);router[_0x439d('0xb')](_0x439d('0xc'),auth[_0x439d('0xd')](),controller[_0x439d('0xe')]);router['get']('/:id/sub_intervals',auth[_0x439d('0xd')](),controller[_0x439d('0xf')]);router['post']('/',auth[_0x439d('0xd')](),controller[_0x439d('0x10')]);router[_0x439d('0x11')](_0x439d('0x12'),auth['isAuthenticated'](),controller[_0x439d('0x13')]);router[_0x439d('0x11')](_0x439d('0x14'),auth['isAuthenticated'](),controller[_0x439d('0x15')]);router[_0x439d('0x16')](_0x439d('0xc'),auth[_0x439d('0xd')](),controller['update']);router['delete'](_0x439d('0xc'),auth[_0x439d('0xd')](),controller[_0x439d('0x17')]);module[_0x439d('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 8bf8c60..4a46a18 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 _0xf584=['STRING','sequelize','exports'];(function(_0x38f69b,_0x3dfcd8){var _0x212fbb=function(_0x4271bd){while(--_0x4271bd){_0x38f69b['push'](_0x38f69b['shift']());}};_0x212fbb(++_0x3dfcd8);}(_0xf584,0x15a));var _0x4f58=function(_0x71fe5a,_0x38e957){_0x71fe5a=_0x71fe5a-0x0;var _0x159564=_0xf584[_0x71fe5a];return _0x159564;};'use strict';var Sequelize=require(_0x4f58('0x0'));module[_0x4f58('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f58('0x2')]},'interval':{'type':Sequelize[_0x4f58('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xba61=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba61,0xc5));var _0x1ba6=function(_0x22672b,_0x30ace3){_0x22672b=_0x22672b-0x0;var _0x36f803=_0xba61[_0x22672b];return _0x36f803;};'use strict';var Sequelize=require(_0x1ba6('0x0'));module[_0x1ba6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1ba6('0x2')]},'interval':{'type':Sequelize[_0x1ba6('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 4aab002..6ee95e0 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 _0x8a9c=['UserProfileResource','error','update','addInterval','getIntervals','findOne','hasOwnProperty','addIntervals','IntervalId','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','status','json','offset','undefined','count','limit','set','save','then','destroy','Intervals','end','sendStatus','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','fields','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x46e991,_0x3f80d0){var _0x401105=function(_0x1b1070){while(--_0x1b1070){_0x46e991['push'](_0x46e991['shift']());}};_0x401105(++_0x3f80d0);}(_0x8a9c,0x65));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8a9('0x0'));var zipdir=require(_0xc8a9('0x1'));var jsonpatch=require(_0xc8a9('0x2'));var rp=require('request-promise');var moment=require(_0xc8a9('0x3'));var BPromise=require(_0xc8a9('0x4'));var Mustache=require(_0xc8a9('0x5'));var util=require(_0xc8a9('0x6'));var path=require(_0xc8a9('0x7'));var sox=require(_0xc8a9('0x8'));var csv=require(_0xc8a9('0x9'));var ejs=require(_0xc8a9('0xa'));var fs=require('fs');var fs_extra=require(_0xc8a9('0xb'));var _=require(_0xc8a9('0xc'));var squel=require(_0xc8a9('0xd'));var crypto=require('crypto');var jsforce=require(_0xc8a9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc8a9('0xf'));var Papa=require(_0xc8a9('0x10'));var Redis=require(_0xc8a9('0x11'));var authService=require(_0xc8a9('0x12'));var qs=require(_0xc8a9('0x13'));var as=require(_0xc8a9('0x14'));var hardwareService=require(_0xc8a9('0x15'));var logger=require(_0xc8a9('0x16'))(_0xc8a9('0x17'));var utils=require(_0xc8a9('0x18'));var config=require(_0xc8a9('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0xc8a9('0x1a'));function respondWithStatusCode(_0x1a40c4,_0x11de08){_0x11de08=_0x11de08||0xcc;return function(_0x35e6f1){if(_0x35e6f1){return _0x1a40c4['sendStatus'](_0x11de08);}return _0x1a40c4[_0xc8a9('0x1b')](_0x11de08)['end']();};}function respondWithResult(_0x3561b9,_0x293656){_0x293656=_0x293656||0xc8;return function(_0x735f49){if(_0x735f49){return _0x3561b9[_0xc8a9('0x1b')](_0x293656)[_0xc8a9('0x1c')](_0x735f49);}};}function respondWithFilteredResult(_0x3fed67,_0x5187c9){return function(_0x5cd8b6){if(_0x5cd8b6){var _0x50c309=typeof _0x5187c9[_0xc8a9('0x1d')]==='undefined'&&typeof _0x5187c9['limit']===_0xc8a9('0x1e');var _0x39bf11=_0x5cd8b6[_0xc8a9('0x1f')];var _0x252617=_0x50c309?0x0:_0x5187c9['offset'];var _0x5bd31a=_0x50c309?_0x5cd8b6[_0xc8a9('0x1f')]:_0x5187c9[_0xc8a9('0x1d')]+_0x5187c9[_0xc8a9('0x20')];var _0x33a05d;if(_0x5bd31a>=_0x39bf11){_0x5bd31a=_0x39bf11;_0x33a05d=0xc8;}else{_0x33a05d=0xce;}_0x3fed67[_0xc8a9('0x1b')](_0x33a05d);return _0x3fed67[_0xc8a9('0x21')]('Content-Range',_0x252617+'-'+_0x5bd31a+'/'+_0x39bf11)[_0xc8a9('0x1c')](_0x5cd8b6);}return null;};}function patchUpdates(_0x5302ac){return function(_0x452ef7){try{jsonpatch['apply'](_0x452ef7,_0x5302ac,!![]);}catch(_0x25e1eb){return BPromise['reject'](_0x25e1eb);}return _0x452ef7[_0xc8a9('0x22')]();};}function saveUpdates(_0x97f197,_0x30a139){return function(_0x2b25a4){if(_0x2b25a4){return _0x2b25a4['update'](_0x97f197)[_0xc8a9('0x23')](function(_0x283279){return _0x283279;});}return null;};}function removeEntity(_0x16c977,_0x3f673c){return function(_0xaacc2){if(_0xaacc2){return _0xaacc2[_0xc8a9('0x24')]()[_0xc8a9('0x23')](function(){var _0xc1b9c1=_0xaacc2['get']({'plain':!![]});var _0x30d173=_0xc8a9('0x25');return db['UserProfileResource'][_0xc8a9('0x24')]({'where':{'type':_0x30d173,'resourceId':_0xc1b9c1['id']}})[_0xc8a9('0x23')](function(){return _0xaacc2;});})['then'](function(){_0x16c977[_0xc8a9('0x1b')](0xcc)[_0xc8a9('0x26')]();});}};}function handleEntityNotFound(_0x3207e8,_0x3d7a0d){return function(_0x3524a2){if(!_0x3524a2){_0x3207e8[_0xc8a9('0x27')](0x194);}return _0x3524a2;};}function handleError(_0x2f783e,_0x2a081f){_0x2a081f=_0x2a081f||0x1f4;return function(_0x3f890e){logger['error'](_0x3f890e[_0xc8a9('0x28')]);if(_0x3f890e['name']){delete _0x3f890e[_0xc8a9('0x29')];}_0x2f783e['status'](_0x2a081f)[_0xc8a9('0x2a')](_0x3f890e);};}exports[_0xc8a9('0x2b')]=function(_0x94c52b,_0x5cbc61){var _0x48f34f={},_0x120dbd={},_0x45697e={'count':0x0,'rows':[]};var _0x489881=_[_0xc8a9('0x2c')](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')],function(_0x1e4c16){return{'name':_0x1e4c16[_0xc8a9('0x2f')],'type':_0x1e4c16[_0xc8a9('0x30')][_0xc8a9('0x31')]};});_0x120dbd[_0xc8a9('0x32')]=_['map'](_0x489881,_0xc8a9('0x29'));_0x120dbd[_0xc8a9('0x33')]=_[_0xc8a9('0x34')](_0x94c52b[_0xc8a9('0x33')]);_0x120dbd[_0xc8a9('0x35')]=_['intersection'](_0x120dbd[_0xc8a9('0x32')],_0x120dbd['query']);_0x48f34f['attributes']=_['intersection'](_0x120dbd['model'],qs['fields'](_0x94c52b[_0xc8a9('0x33')]['fields']));_0x48f34f[_0xc8a9('0x36')]=_0x48f34f[_0xc8a9('0x36')][_0xc8a9('0x37')]?_0x48f34f[_0xc8a9('0x36')]:_0x120dbd['model'];if(!_0x94c52b[_0xc8a9('0x33')]['hasOwnProperty'](_0xc8a9('0x38'))){_0x48f34f[_0xc8a9('0x20')]=qs['limit'](_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x20')]);_0x48f34f[_0xc8a9('0x1d')]=qs[_0xc8a9('0x1d')](_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x1d')]);}_0x48f34f[_0xc8a9('0x39')]=qs[_0xc8a9('0x3a')](_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x3a')]);_0x48f34f[_0xc8a9('0x3b')]=qs['filters'](_[_0xc8a9('0x3c')](_0x94c52b['query'],_0x120dbd[_0xc8a9('0x35')]),_0x489881);if(_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x3d')]){_0x48f34f[_0xc8a9('0x3b')]=_[_0xc8a9('0x3e')](_0x48f34f[_0xc8a9('0x3b')],{'$or':_[_0xc8a9('0x2c')](_0x489881,function(_0x104bef){if(_0x104bef[_0xc8a9('0x30')]!==_0xc8a9('0x3f')){var _0x7a8a6d={};_0x7a8a6d[_0x104bef[_0xc8a9('0x29')]]={'$like':'%'+_0x94c52b[_0xc8a9('0x33')]['filter']+'%'};return _0x7a8a6d;}})});}_0x48f34f=_[_0xc8a9('0x3e')]({},_0x48f34f,_0x94c52b[_0xc8a9('0x40')]);var _0x5cc552={'where':_0x48f34f['where']};return db[_0xc8a9('0x2d')][_0xc8a9('0x1f')](_0x5cc552)['then'](function(_0x158b93){_0x45697e['count']=_0x158b93;if(_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x41')]){_0x48f34f[_0xc8a9('0x42')]=[{'all':!![]}];}return db[_0xc8a9('0x2d')][_0xc8a9('0x43')](_0x48f34f);})['then'](function(_0x364e1e){_0x45697e[_0xc8a9('0x44')]=_0x364e1e;return _0x45697e;})['then'](respondWithFilteredResult(_0x5cbc61,_0x48f34f))[_0xc8a9('0x45')](handleError(_0x5cbc61,null));};exports['show']=function(_0x402de6,_0x1ae22c){var _0x16ef11={'raw':!![],'where':{'id':_0x402de6[_0xc8a9('0x46')]['id']}},_0x521741={};_0x521741[_0xc8a9('0x32')]=_[_0xc8a9('0x34')](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')]);_0x521741[_0xc8a9('0x33')]=_[_0xc8a9('0x34')](_0x402de6[_0xc8a9('0x33')]);_0x521741[_0xc8a9('0x35')]=_[_0xc8a9('0x47')](_0x521741[_0xc8a9('0x32')],_0x521741[_0xc8a9('0x33')]);_0x16ef11[_0xc8a9('0x36')]=_[_0xc8a9('0x47')](_0x521741[_0xc8a9('0x32')],qs[_0xc8a9('0x48')](_0x402de6['query']['fields']));_0x16ef11[_0xc8a9('0x36')]=_0x16ef11[_0xc8a9('0x36')][_0xc8a9('0x37')]?_0x16ef11[_0xc8a9('0x36')]:_0x521741[_0xc8a9('0x32')];if(_0x402de6[_0xc8a9('0x33')]['includeAll']){_0x16ef11[_0xc8a9('0x42')]=[{'all':!![]}];}_0x16ef11=_[_0xc8a9('0x3e')]({},_0x16ef11,_0x402de6[_0xc8a9('0x40')]);return db[_0xc8a9('0x2d')]['find'](_0x16ef11)['then'](handleEntityNotFound(_0x1ae22c,null))[_0xc8a9('0x23')](respondWithResult(_0x1ae22c,null))[_0xc8a9('0x45')](handleError(_0x1ae22c,null));};exports['create']=function(_0x153149,_0x284954){return db[_0xc8a9('0x2d')][_0xc8a9('0x49')](_0x153149[_0xc8a9('0x4a')],{})[_0xc8a9('0x23')](function(_0x26ca3b){var _0x298aa6=_0x153149[_0xc8a9('0x4b')][_0xc8a9('0x4c')]({'plain':!![]});if(!_0x298aa6)throw new Error(_0xc8a9('0x4d'));if(_0x298aa6[_0xc8a9('0x4e')]===_0xc8a9('0x4b')){var _0x39ba4f=_0x26ca3b['get']({'plain':!![]});var _0x496c1a=_0xc8a9('0x25');return db[_0xc8a9('0x4f')][_0xc8a9('0x50')]({'where':{'name':_0x496c1a,'userProfileId':_0x298aa6[_0xc8a9('0x51')]},'raw':!![]})[_0xc8a9('0x23')](function(_0xa7850b){if(_0xa7850b&&_0xa7850b[_0xc8a9('0x52')]===0x0){return db[_0xc8a9('0x53')][_0xc8a9('0x49')]({'name':_0x39ba4f[_0xc8a9('0x29')],'resourceId':_0x39ba4f['id'],'type':_0xa7850b[_0xc8a9('0x29')],'sectionId':_0xa7850b['id']},{})[_0xc8a9('0x23')](function(){return _0x26ca3b;});}else{return _0x26ca3b;}})[_0xc8a9('0x45')](function(_0x443809){logger[_0xc8a9('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x443809);throw _0x443809;});}return _0x26ca3b;})[_0xc8a9('0x23')](respondWithResult(_0x284954,0xc9))[_0xc8a9('0x45')](handleError(_0x284954,null));};exports[_0xc8a9('0x55')]=function(_0x1549be,_0xe38142){if(_0x1549be[_0xc8a9('0x4a')]['id']){delete _0x1549be[_0xc8a9('0x4a')]['id'];}return db[_0xc8a9('0x2d')][_0xc8a9('0x50')]({'where':{'id':_0x1549be[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0xe38142,null))[_0xc8a9('0x23')](saveUpdates(_0x1549be['body'],null))[_0xc8a9('0x23')](respondWithResult(_0xe38142,null))[_0xc8a9('0x45')](handleError(_0xe38142,null));};exports[_0xc8a9('0x24')]=function(_0x23ceb2,_0x31f89b){return db['Interval']['find']({'where':{'id':_0x23ceb2['params']['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x31f89b,null))[_0xc8a9('0x23')](removeEntity(_0x31f89b,null))['catch'](handleError(_0x31f89b,null));};exports[_0xc8a9('0x56')]=function(_0x444b28,_0x2766a1,_0x7928f8){if(_0x444b28[_0xc8a9('0x4a')]['id']){delete _0x444b28[_0xc8a9('0x4a')]['id'];}return db[_0xc8a9('0x2d')]['find']({'where':{'id':_0x444b28[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x2766a1,null))[_0xc8a9('0x23')](function(_0x6e1880){if(_0x6e1880){_0x444b28[_0xc8a9('0x4a')]['IntervalId']=_0x6e1880['id'];return db['Interval'][_0xc8a9('0x49')](_0x444b28['body']);}})['then'](respondWithResult(_0x2766a1,null))[_0xc8a9('0x45')](handleError(_0x2766a1,null));};exports[_0xc8a9('0x57')]=function(_0x494337,_0x2b5e83,_0x1432d7){var _0x508d5a={};var _0x3f74c0={};var _0x14a61e;var _0x59fce5;return db[_0xc8a9('0x2d')][_0xc8a9('0x58')]({'where':{'id':_0x494337[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x2b5e83,null))[_0xc8a9('0x23')](function(_0x81bae2){if(_0x81bae2){_0x14a61e=_0x81bae2;_0x3f74c0[_0xc8a9('0x32')]=_['keys'](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')]);_0x3f74c0['query']=_[_0xc8a9('0x34')](_0x494337[_0xc8a9('0x33')]);_0x3f74c0['filters']=_[_0xc8a9('0x47')](_0x3f74c0[_0xc8a9('0x32')],_0x3f74c0[_0xc8a9('0x33')]);_0x508d5a['attributes']=_['intersection'](_0x3f74c0['model'],qs[_0xc8a9('0x48')](_0x494337[_0xc8a9('0x33')]['fields']));_0x508d5a[_0xc8a9('0x36')]=_0x508d5a[_0xc8a9('0x36')][_0xc8a9('0x37')]?_0x508d5a[_0xc8a9('0x36')]:_0x3f74c0[_0xc8a9('0x32')];_0x508d5a[_0xc8a9('0x39')]=qs[_0xc8a9('0x3a')](_0x494337[_0xc8a9('0x33')][_0xc8a9('0x3a')]);_0x508d5a['where']=qs[_0xc8a9('0x35')](_[_0xc8a9('0x3c')](_0x494337['query'],_0x3f74c0[_0xc8a9('0x35')]));if(_0x494337['query']['filter']){_0x508d5a[_0xc8a9('0x3b')]=_[_0xc8a9('0x3e')](_0x508d5a[_0xc8a9('0x3b')],{'$or':_['map'](_0x508d5a[_0xc8a9('0x36')],function(_0x46c182){var _0x31ff73={};_0x31ff73[_0x46c182]={'$like':'%'+_0x494337['query'][_0xc8a9('0x3d')]+'%'};return _0x31ff73;})});}_0x508d5a=_[_0xc8a9('0x3e')]({},_0x508d5a,_0x494337[_0xc8a9('0x40')]);return _0x14a61e['getIntervals'](_0x508d5a);}})['then'](function(_0x2b2a1f){if(_0x2b2a1f){_0x59fce5=_0x2b2a1f[_0xc8a9('0x37')];if(!_0x494337[_0xc8a9('0x33')][_0xc8a9('0x59')](_0xc8a9('0x38'))){_0x508d5a['limit']=qs['limit'](_0x494337[_0xc8a9('0x33')][_0xc8a9('0x20')]);_0x508d5a[_0xc8a9('0x1d')]=qs[_0xc8a9('0x1d')](_0x494337[_0xc8a9('0x33')][_0xc8a9('0x1d')]);}return _0x14a61e[_0xc8a9('0x57')](_0x508d5a);}})[_0xc8a9('0x23')](function(_0x583dfb){if(_0x583dfb){return _0x583dfb?{'count':_0x59fce5,'rows':_0x583dfb}:null;}})['then'](respondWithResult(_0x2b5e83,null))[_0xc8a9('0x45')](handleError(_0x2b5e83,null));};exports[_0xc8a9('0x5a')]=function(_0x42df49,_0x1de63e,_0x95f68a){return db[_0xc8a9('0x2d')][_0xc8a9('0x58')]({'where':{'id':_0x42df49[_0xc8a9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1de63e,null))[_0xc8a9('0x23')](function(_0x55be3b){if(_0x55be3b){return db['sequelize']['transaction'](function(_0x2b38cf){return db[_0xc8a9('0x2d')][_0xc8a9('0x24')]({'where':{'IntervalId':_0x42df49['params']['id']},'transaction':_0x2b38cf})['then'](function(_0x5b4bed){var _0x3904c9=_['map'](_0x42df49['body'],function(_0x252f8f){delete _0x252f8f['id'];_0x252f8f[_0xc8a9('0x5b')]=_0x42df49[_0xc8a9('0x46')]['id'];return _0x252f8f;});return db[_0xc8a9('0x2d')]['bulkCreate'](_0x3904c9,{'transaction':_0x2b38cf});});})[_0xc8a9('0x23')](function(){return db[_0xc8a9('0x2d')]['findAll']({'where':{'IntervalId':_0x42df49[_0xc8a9('0x46')]['id']}});});}})[_0xc8a9('0x23')](respondWithResult(_0x1de63e,null))[_0xc8a9('0x45')](handleError(_0x1de63e,null));}; \ No newline at end of file +var _0xa218=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','limit','count','offset','set','Content-Range','reject','save','then','destroy','get','sendStatus','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Interval','includeAll','include','catch','show','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','IntervalId','getIntervals','addIntervals','findOne','sequelize','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x4259a3,_0x2f9e82){var _0x5dfed4=function(_0x443519){while(--_0x443519){_0x4259a3['push'](_0x4259a3['shift']());}};_0x5dfed4(++_0x2f9e82);}(_0xa218,0x9e));var _0x8a21=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa218[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a21('0x0'));var zipdir=require(_0x8a21('0x1'));var jsonpatch=require(_0x8a21('0x2'));var rp=require(_0x8a21('0x3'));var moment=require(_0x8a21('0x4'));var BPromise=require(_0x8a21('0x5'));var Mustache=require(_0x8a21('0x6'));var util=require(_0x8a21('0x7'));var path=require(_0x8a21('0x8'));var sox=require('sox');var csv=require(_0x8a21('0x9'));var ejs=require(_0x8a21('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8a21('0xb'));var crypto=require(_0x8a21('0xc'));var jsforce=require(_0x8a21('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8a21('0x9'));var querystring=require(_0x8a21('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8a21('0xf'));var qs=require(_0x8a21('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a21('0x11'));var logger=require(_0x8a21('0x12'))(_0x8a21('0x13'));var utils=require(_0x8a21('0x14'));var config=require(_0x8a21('0x15'));var licenseUtil=require(_0x8a21('0x16'));var db=require(_0x8a21('0x17'))['db'];var extensions=require(_0x8a21('0x18'));function respondWithStatusCode(_0x3af8ef,_0x4f8716){_0x4f8716=_0x4f8716||0xcc;return function(_0x3e3061){if(_0x3e3061){return _0x3af8ef['sendStatus'](_0x4f8716);}return _0x3af8ef[_0x8a21('0x19')](_0x4f8716)[_0x8a21('0x1a')]();};}function respondWithResult(_0x382cc0,_0x1e3c62){_0x1e3c62=_0x1e3c62||0xc8;return function(_0x4621d0){if(_0x4621d0){return _0x382cc0[_0x8a21('0x19')](_0x1e3c62)[_0x8a21('0x1b')](_0x4621d0);}};}function respondWithFilteredResult(_0x70d0cb,_0xe851d){return function(_0x206e9e){if(_0x206e9e){var _0x539893=typeof _0xe851d['offset']==='undefined'&&typeof _0xe851d[_0x8a21('0x1c')]==='undefined';var _0xa76860=_0x206e9e[_0x8a21('0x1d')];var _0x477483=_0x539893?0x0:_0xe851d[_0x8a21('0x1e')];var _0x271069=_0x539893?_0x206e9e['count']:_0xe851d[_0x8a21('0x1e')]+_0xe851d[_0x8a21('0x1c')];var _0x156bad;if(_0x271069>=_0xa76860){_0x271069=_0xa76860;_0x156bad=0xc8;}else{_0x156bad=0xce;}_0x70d0cb[_0x8a21('0x19')](_0x156bad);return _0x70d0cb[_0x8a21('0x1f')](_0x8a21('0x20'),_0x477483+'-'+_0x271069+'/'+_0xa76860)[_0x8a21('0x1b')](_0x206e9e);}return null;};}function patchUpdates(_0xdc3ced){return function(_0x936964){try{jsonpatch['apply'](_0x936964,_0xdc3ced,!![]);}catch(_0x1a1836){return BPromise[_0x8a21('0x21')](_0x1a1836);}return _0x936964[_0x8a21('0x22')]();};}function saveUpdates(_0x18e085,_0x165e40){return function(_0x8d5fec){if(_0x8d5fec){return _0x8d5fec['update'](_0x18e085)[_0x8a21('0x23')](function(_0x547d7c){return _0x547d7c;});}return null;};}function removeEntity(_0x27f8f4,_0x2f088c){return function(_0x20de51){if(_0x20de51){return _0x20de51[_0x8a21('0x24')]()[_0x8a21('0x23')](function(){var _0x2a4d20=_0x20de51[_0x8a21('0x25')]({'plain':!![]});var _0x150379='Intervals';return db['UserProfileResource'][_0x8a21('0x24')]({'where':{'type':_0x150379,'resourceId':_0x2a4d20['id']}})[_0x8a21('0x23')](function(){return _0x20de51;});})[_0x8a21('0x23')](function(){_0x27f8f4[_0x8a21('0x19')](0xcc)[_0x8a21('0x1a')]();});}};}function handleEntityNotFound(_0xf8639b,_0x324b6a){return function(_0x1aada){if(!_0x1aada){_0xf8639b[_0x8a21('0x26')](0x194);}return _0x1aada;};}function handleError(_0x5ad75f,_0x2f287a){_0x2f287a=_0x2f287a||0x1f4;return function(_0xe4acd9){logger['error'](_0xe4acd9['stack']);if(_0xe4acd9[_0x8a21('0x27')]){delete _0xe4acd9[_0x8a21('0x27')];}_0x5ad75f[_0x8a21('0x19')](_0x2f287a)[_0x8a21('0x28')](_0xe4acd9);};}exports[_0x8a21('0x29')]=function(_0x1ef499,_0x356e6f){var _0x39ee0a={},_0x3184d0={},_0x805dd2={'count':0x0,'rows':[]};var _0x4828fb=_[_0x8a21('0x2a')](db['Interval'][_0x8a21('0x2b')],function(_0x4485e5){return{'name':_0x4485e5[_0x8a21('0x2c')],'type':_0x4485e5['type'][_0x8a21('0x2d')]};});_0x3184d0['model']=_[_0x8a21('0x2a')](_0x4828fb,_0x8a21('0x27'));_0x3184d0[_0x8a21('0x2e')]=_[_0x8a21('0x2f')](_0x1ef499[_0x8a21('0x2e')]);_0x3184d0[_0x8a21('0x30')]=_[_0x8a21('0x31')](_0x3184d0[_0x8a21('0x32')],_0x3184d0[_0x8a21('0x2e')]);_0x39ee0a['attributes']=_[_0x8a21('0x31')](_0x3184d0[_0x8a21('0x32')],qs[_0x8a21('0x33')](_0x1ef499[_0x8a21('0x2e')][_0x8a21('0x33')]));_0x39ee0a[_0x8a21('0x34')]=_0x39ee0a[_0x8a21('0x34')]['length']?_0x39ee0a[_0x8a21('0x34')]:_0x3184d0['model'];if(!_0x1ef499[_0x8a21('0x2e')][_0x8a21('0x35')](_0x8a21('0x36'))){_0x39ee0a[_0x8a21('0x1c')]=qs[_0x8a21('0x1c')](_0x1ef499[_0x8a21('0x2e')][_0x8a21('0x1c')]);_0x39ee0a[_0x8a21('0x1e')]=qs['offset'](_0x1ef499[_0x8a21('0x2e')][_0x8a21('0x1e')]);}_0x39ee0a[_0x8a21('0x37')]=qs[_0x8a21('0x38')](_0x1ef499[_0x8a21('0x2e')]['sort']);_0x39ee0a[_0x8a21('0x39')]=qs[_0x8a21('0x30')](_[_0x8a21('0x3a')](_0x1ef499[_0x8a21('0x2e')],_0x3184d0[_0x8a21('0x30')]),_0x4828fb);if(_0x1ef499[_0x8a21('0x2e')][_0x8a21('0x3b')]){_0x39ee0a[_0x8a21('0x39')]=_[_0x8a21('0x3c')](_0x39ee0a[_0x8a21('0x39')],{'$or':_[_0x8a21('0x2a')](_0x4828fb,function(_0x46beae){if(_0x46beae['type']!==_0x8a21('0x3d')){var _0x1b1382={};_0x1b1382[_0x46beae[_0x8a21('0x27')]]={'$like':'%'+_0x1ef499[_0x8a21('0x2e')][_0x8a21('0x3b')]+'%'};return _0x1b1382;}})});}_0x39ee0a=_['merge']({},_0x39ee0a,_0x1ef499['options']);var _0x36600d={'where':_0x39ee0a['where']};return db[_0x8a21('0x3e')][_0x8a21('0x1d')](_0x36600d)['then'](function(_0x15b624){_0x805dd2[_0x8a21('0x1d')]=_0x15b624;if(_0x1ef499[_0x8a21('0x2e')][_0x8a21('0x3f')]){_0x39ee0a[_0x8a21('0x40')]=[{'all':!![]}];}return db[_0x8a21('0x3e')]['findAll'](_0x39ee0a);})[_0x8a21('0x23')](function(_0x11934a){_0x805dd2['rows']=_0x11934a;return _0x805dd2;})[_0x8a21('0x23')](respondWithFilteredResult(_0x356e6f,_0x39ee0a))[_0x8a21('0x41')](handleError(_0x356e6f,null));};exports[_0x8a21('0x42')]=function(_0x51a86a,_0x314d8b){var _0x3411b2={'raw':!![],'where':{'id':_0x51a86a['params']['id']}},_0x3d5c93={};_0x3d5c93[_0x8a21('0x32')]=_['keys'](db[_0x8a21('0x3e')][_0x8a21('0x2b')]);_0x3d5c93[_0x8a21('0x2e')]=_[_0x8a21('0x2f')](_0x51a86a['query']);_0x3d5c93[_0x8a21('0x30')]=_[_0x8a21('0x31')](_0x3d5c93[_0x8a21('0x32')],_0x3d5c93[_0x8a21('0x2e')]);_0x3411b2[_0x8a21('0x34')]=_[_0x8a21('0x31')](_0x3d5c93[_0x8a21('0x32')],qs[_0x8a21('0x33')](_0x51a86a['query'][_0x8a21('0x33')]));_0x3411b2[_0x8a21('0x34')]=_0x3411b2['attributes'][_0x8a21('0x43')]?_0x3411b2[_0x8a21('0x34')]:_0x3d5c93[_0x8a21('0x32')];if(_0x51a86a[_0x8a21('0x2e')][_0x8a21('0x3f')]){_0x3411b2[_0x8a21('0x40')]=[{'all':!![]}];}_0x3411b2=_[_0x8a21('0x3c')]({},_0x3411b2,_0x51a86a[_0x8a21('0x44')]);return db[_0x8a21('0x3e')][_0x8a21('0x45')](_0x3411b2)[_0x8a21('0x23')](handleEntityNotFound(_0x314d8b,null))[_0x8a21('0x23')](respondWithResult(_0x314d8b,null))[_0x8a21('0x41')](handleError(_0x314d8b,null));};exports[_0x8a21('0x46')]=function(_0x5d6887,_0x3f466c){return db[_0x8a21('0x3e')][_0x8a21('0x46')](_0x5d6887[_0x8a21('0x47')],{})['then'](function(_0x4c571c){var _0x28fca3=_0x5d6887[_0x8a21('0x48')]['get']({'plain':!![]});if(!_0x28fca3)throw new Error(_0x8a21('0x49'));if(_0x28fca3[_0x8a21('0x4a')]===_0x8a21('0x48')){var _0x3eba2c=_0x4c571c['get']({'plain':!![]});var _0x4a5aea=_0x8a21('0x4b');return db['UserProfileSection'][_0x8a21('0x45')]({'where':{'name':_0x4a5aea,'userProfileId':_0x28fca3[_0x8a21('0x4c')]},'raw':!![]})[_0x8a21('0x23')](function(_0x7545a7){if(_0x7545a7&&_0x7545a7[_0x8a21('0x4d')]===0x0){return db[_0x8a21('0x4e')]['create']({'name':_0x3eba2c['name'],'resourceId':_0x3eba2c['id'],'type':_0x7545a7[_0x8a21('0x27')],'sectionId':_0x7545a7['id']},{})[_0x8a21('0x23')](function(){return _0x4c571c;});}else{return _0x4c571c;}})[_0x8a21('0x41')](function(_0x29d3bb){logger[_0x8a21('0x4f')](_0x8a21('0x50'),_0x29d3bb);throw _0x29d3bb;});}return _0x4c571c;})['then'](respondWithResult(_0x3f466c,0xc9))['catch'](handleError(_0x3f466c,null));};exports[_0x8a21('0x51')]=function(_0x4649f1,_0x1e7498){if(_0x4649f1[_0x8a21('0x47')]['id']){delete _0x4649f1[_0x8a21('0x47')]['id'];}return db['Interval'][_0x8a21('0x45')]({'where':{'id':_0x4649f1[_0x8a21('0x52')]['id']}})[_0x8a21('0x23')](handleEntityNotFound(_0x1e7498,null))[_0x8a21('0x23')](saveUpdates(_0x4649f1[_0x8a21('0x47')],null))['then'](respondWithResult(_0x1e7498,null))[_0x8a21('0x41')](handleError(_0x1e7498,null));};exports[_0x8a21('0x24')]=function(_0x26c55a,_0x2af3b1){return db['Interval'][_0x8a21('0x45')]({'where':{'id':_0x26c55a['params']['id']}})[_0x8a21('0x23')](handleEntityNotFound(_0x2af3b1,null))[_0x8a21('0x23')](removeEntity(_0x2af3b1,null))[_0x8a21('0x41')](handleError(_0x2af3b1,null));};exports['addInterval']=function(_0xd04bf,_0x4581c0,_0x16eb80){if(_0xd04bf[_0x8a21('0x47')]['id']){delete _0xd04bf['body']['id'];}return db['Interval'][_0x8a21('0x45')]({'where':{'id':_0xd04bf[_0x8a21('0x52')]['id']}})[_0x8a21('0x23')](handleEntityNotFound(_0x4581c0,null))[_0x8a21('0x23')](function(_0x4fe2fb){if(_0x4fe2fb){_0xd04bf[_0x8a21('0x47')][_0x8a21('0x53')]=_0x4fe2fb['id'];return db[_0x8a21('0x3e')][_0x8a21('0x46')](_0xd04bf[_0x8a21('0x47')]);}})[_0x8a21('0x23')](respondWithResult(_0x4581c0,null))[_0x8a21('0x41')](handleError(_0x4581c0,null));};exports[_0x8a21('0x54')]=function(_0x4af237,_0x48950f,_0x3d9e24){var _0x4b19a9={};var _0x3981f1={};var _0x100f9e;var _0x46180a;return db[_0x8a21('0x3e')]['findOne']({'where':{'id':_0x4af237[_0x8a21('0x52')]['id']}})[_0x8a21('0x23')](handleEntityNotFound(_0x48950f,null))[_0x8a21('0x23')](function(_0x171c0c){if(_0x171c0c){_0x100f9e=_0x171c0c;_0x3981f1['model']=_[_0x8a21('0x2f')](db[_0x8a21('0x3e')][_0x8a21('0x2b')]);_0x3981f1[_0x8a21('0x2e')]=_['keys'](_0x4af237[_0x8a21('0x2e')]);_0x3981f1[_0x8a21('0x30')]=_[_0x8a21('0x31')](_0x3981f1[_0x8a21('0x32')],_0x3981f1['query']);_0x4b19a9[_0x8a21('0x34')]=_[_0x8a21('0x31')](_0x3981f1[_0x8a21('0x32')],qs[_0x8a21('0x33')](_0x4af237[_0x8a21('0x2e')][_0x8a21('0x33')]));_0x4b19a9[_0x8a21('0x34')]=_0x4b19a9[_0x8a21('0x34')]['length']?_0x4b19a9[_0x8a21('0x34')]:_0x3981f1[_0x8a21('0x32')];_0x4b19a9[_0x8a21('0x37')]=qs[_0x8a21('0x38')](_0x4af237[_0x8a21('0x2e')]['sort']);_0x4b19a9['where']=qs[_0x8a21('0x30')](_['pick'](_0x4af237['query'],_0x3981f1[_0x8a21('0x30')]));if(_0x4af237[_0x8a21('0x2e')][_0x8a21('0x3b')]){_0x4b19a9[_0x8a21('0x39')]=_['merge'](_0x4b19a9[_0x8a21('0x39')],{'$or':_[_0x8a21('0x2a')](_0x4b19a9[_0x8a21('0x34')],function(_0x29d525){var _0x36cc08={};_0x36cc08[_0x29d525]={'$like':'%'+_0x4af237[_0x8a21('0x2e')][_0x8a21('0x3b')]+'%'};return _0x36cc08;})});}_0x4b19a9=_['merge']({},_0x4b19a9,_0x4af237['options']);return _0x100f9e[_0x8a21('0x54')](_0x4b19a9);}})[_0x8a21('0x23')](function(_0x1038bc){if(_0x1038bc){_0x46180a=_0x1038bc['length'];if(!_0x4af237[_0x8a21('0x2e')][_0x8a21('0x35')]('nolimit')){_0x4b19a9[_0x8a21('0x1c')]=qs[_0x8a21('0x1c')](_0x4af237['query'][_0x8a21('0x1c')]);_0x4b19a9[_0x8a21('0x1e')]=qs['offset'](_0x4af237[_0x8a21('0x2e')][_0x8a21('0x1e')]);}return _0x100f9e[_0x8a21('0x54')](_0x4b19a9);}})[_0x8a21('0x23')](function(_0x14f88e){if(_0x14f88e){return _0x14f88e?{'count':_0x46180a,'rows':_0x14f88e}:null;}})[_0x8a21('0x23')](respondWithResult(_0x48950f,null))[_0x8a21('0x41')](handleError(_0x48950f,null));};exports[_0x8a21('0x55')]=function(_0x4f76c1,_0x545077,_0x780f9e){return db[_0x8a21('0x3e')][_0x8a21('0x56')]({'where':{'id':_0x4f76c1[_0x8a21('0x52')]['id']}})[_0x8a21('0x23')](handleEntityNotFound(_0x545077,null))[_0x8a21('0x23')](function(_0x5781d3){if(_0x5781d3){return db[_0x8a21('0x57')]['transaction'](function(_0x57606b){return db[_0x8a21('0x3e')]['destroy']({'where':{'IntervalId':_0x4f76c1[_0x8a21('0x52')]['id']},'transaction':_0x57606b})[_0x8a21('0x23')](function(_0x13881c){var _0x4085b1=_['map'](_0x4f76c1[_0x8a21('0x47')],function(_0x305e09){delete _0x305e09['id'];_0x305e09[_0x8a21('0x53')]=_0x4f76c1[_0x8a21('0x52')]['id'];return _0x305e09;});return db['Interval'][_0x8a21('0x58')](_0x4085b1,{'transaction':_0x57606b});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x4f76c1[_0x8a21('0x52')]['id']}});});}})[_0x8a21('0x23')](respondWithResult(_0x545077,null))[_0x8a21('0x41')](handleError(_0x545077,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 806261b..06d8d98 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 _0xb50e=['Interval','rewrite','interval','string','getIntervals','then','all','map','ifTime','reduce','./interval.attributes','iftime','exports'];(function(_0x5f1013,_0x4f03d4){var _0x20a5bc=function(_0x5e6066){while(--_0x5e6066){_0x5f1013['push'](_0x5f1013['shift']());}};_0x20a5bc(++_0x4f03d4);}(_0xb50e,0x190));var _0xeb50=function(_0x4f708f,_0x19857c){_0x4f708f=_0x4f708f-0x0;var _0xc14ea8=_0xb50e[_0x4f708f];return _0xc14ea8;};'use strict';var attributes=require(_0xeb50('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0xeb50('0x1')];module[_0xeb50('0x2')]=function(_0x10d40a){return _0x10d40a['define'](_0xeb50('0x3'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2fb2df){extensions[_0xeb50('0x4')](_0x10d40a,_0x2fb2df);},'afterBulkCreate':function(_0x14373b,_0x3539f4,_0x4fc94d){_0x4fc94d();extensions[_0xeb50('0x4')](_0x10d40a,_0x14373b[0x0]);},'afterUpdate':function(_0x1df921){extensions[_0xeb50('0x4')](_0x10d40a,_0x1df921);},'afterDestroy':function(_0xe93c70){extensions[_0xeb50('0x4')](_0x10d40a,_0xe93c70);}},'instanceMethods':{'ifTime':function(_0x57f12f=undefined,_0x30c4e3=new Date()){if(typeof this[_0xeb50('0x5')]===_0xeb50('0x6')){return iftime(this[_0xeb50('0x5')],_0x57f12f,_0x30c4e3);}else{return this[_0xeb50('0x7')]()[_0xeb50('0x8')](function(_0x4ed13d){return Promise[_0xeb50('0x9')](_0x4ed13d[_0xeb50('0xa')](function(_0x1a04a8){return _0x1a04a8[_0xeb50('0xb')](_0x57f12f,_0x30c4e3);}));})[_0xeb50('0x8')](function(_0x4c21cb){return _0x4c21cb[_0xeb50('0xc')](function(_0x17d528,_0x53e195){return _0x17d528||_0x53e195;},![]);});}}}});}; \ No newline at end of file +var _0xd745=['Interval','rewrite','string','getIntervals','then','all','map','ifTime','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define'];(function(_0x510c06,_0x3dd341){var _0x2e22e4=function(_0x311a8e){while(--_0x311a8e){_0x510c06['push'](_0x510c06['shift']());}};_0x2e22e4(++_0x3dd341);}(_0xd745,0xe5));var _0x5d74=function(_0x1e87ab,_0x1a6762){_0x1e87ab=_0x1e87ab-0x0;var _0x3b3804=_0xd745[_0x1e87ab];return _0x3b3804;};'use strict';var attributes=require(_0x5d74('0x0'));var extensions=require(_0x5d74('0x1'));var iftime=require(_0x5d74('0x2'))['iftime'];module[_0x5d74('0x3')]=function(_0x38db94){return _0x38db94[_0x5d74('0x4')](_0x5d74('0x5'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x561b4e){extensions[_0x5d74('0x6')](_0x38db94,_0x561b4e);},'afterBulkCreate':function(_0x1a3411,_0x5b3809,_0x563672){_0x563672();extensions['rewrite'](_0x38db94,_0x1a3411[0x0]);},'afterUpdate':function(_0x16c0f9){extensions['rewrite'](_0x38db94,_0x16c0f9);},'afterDestroy':function(_0x11198a){extensions['rewrite'](_0x38db94,_0x11198a);}},'instanceMethods':{'ifTime':function(_0x45c7e7=undefined,_0x3ca1f9=new Date()){if(typeof this['interval']===_0x5d74('0x7')){return iftime(this['interval'],_0x45c7e7,_0x3ca1f9);}else{return this[_0x5d74('0x8')]()[_0x5d74('0x9')](function(_0x5bc6a9){return Promise[_0x5d74('0xa')](_0x5bc6a9[_0x5d74('0xb')](function(_0x4aa8c6){return _0x4aa8c6[_0x5d74('0xc')](_0x45c7e7,_0x3ca1f9);}));})[_0x5d74('0x9')](function(_0x1298d3){return _0x1298d3['reduce'](function(_0x2845a8,_0x2e0a8d){return _0x2845a8||_0x2e0a8d;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e54e731..5fda70e 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 _0x9d8a=['isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','IntervalIftime','lodash','util','../../mysqldb','../../utils/iftime','iftime','GetInterval','Interval','options','raw','where','attributes','map','include','model','then','info','debug','stringify','catch','error','message','ShowInterval','find','all','ifTime','reduce','format','name','join','findById','intervalIds'];(function(_0x17ee90,_0x1025dc){var _0x1b2e52=function(_0x9d70e0){while(--_0x9d70e0){_0x17ee90['push'](_0x17ee90['shift']());}};_0x1b2e52(++_0x1025dc);}(_0x9d8a,0x81));var _0xa9d8=function(_0x293d3e,_0x41b2d9){_0x293d3e=_0x293d3e-0x0;var _0x5abca4=_0x9d8a[_0x293d3e];return _0x5abca4;};'use strict';var _=require(_0xa9d8('0x0'));var util=require(_0xa9d8('0x1'));var db=require(_0xa9d8('0x2'))['db'];var iftime=require(_0xa9d8('0x3'))[_0xa9d8('0x4')];var logger=require('../../config/logger')('rpc');exports[_0xa9d8('0x5')]=function(_0x37b3e6){var _0x334134=this;return new Promise(function(_0x53d0f5,_0x153aa7){return db[_0xa9d8('0x6')]['findAll']({'raw':_0x37b3e6[_0xa9d8('0x7')]?_0x37b3e6[_0xa9d8('0x7')][_0xa9d8('0x8')]===undefined?!![]:![]:!![],'where':_0x37b3e6[_0xa9d8('0x7')]?_0x37b3e6[_0xa9d8('0x7')][_0xa9d8('0x9')]||null:null,'attributes':_0x37b3e6[_0xa9d8('0x7')]?_0x37b3e6[_0xa9d8('0x7')][_0xa9d8('0xa')]||null:null,'limit':_0x37b3e6['options']?_0x37b3e6[_0xa9d8('0x7')]['limit']||null:null,'include':_0x37b3e6['options']?_0x37b3e6['options']['include']?_[_0xa9d8('0xb')](_0x37b3e6['options'][_0xa9d8('0xc')],function(_0x130620){return{'model':db[_0x130620[_0xa9d8('0xd')]],'as':_0x130620['as'],'attributes':_0x130620[_0xa9d8('0xa')],'include':_0x130620[_0xa9d8('0xc')]?_[_0xa9d8('0xb')](_0x130620['include'],function(_0x2bf4be){return{'model':db[_0x2bf4be[_0xa9d8('0xd')]],'as':_0x2bf4be['as'],'attributes':_0x2bf4be[_0xa9d8('0xa')],'include':_0x2bf4be['include']?_[_0xa9d8('0xb')](_0x2bf4be[_0xa9d8('0xc')],function(_0x31c6b1){return{'model':db[_0x31c6b1[_0xa9d8('0xd')]],'as':_0x31c6b1['as'],'attributes':_0x31c6b1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9d8('0xe')](function(_0x5cab98){logger[_0xa9d8('0xf')]('GetInterval',_0x37b3e6);logger[_0xa9d8('0x10')](_0xa9d8('0x5'),_0x37b3e6,JSON[_0xa9d8('0x11')](_0x5cab98));_0x53d0f5(_0x5cab98);})[_0xa9d8('0x12')](function(_0x19e8c8){logger[_0xa9d8('0x13')](_0xa9d8('0x5'),_0x19e8c8[_0xa9d8('0x14')],_0x37b3e6);_0x153aa7(_0x334134['error'](0x1f4,_0x19e8c8[_0xa9d8('0x14')]));});});};exports[_0xa9d8('0x15')]=function(_0x1bfd59){var _0x733468=this;return new Promise(function(_0x196a07,_0xbb507f){return db['Interval'][_0xa9d8('0x16')]({'raw':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59[_0xa9d8('0x7')][_0xa9d8('0x9')]||null:null,'attributes':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59['options'][_0xa9d8('0xa')]||null:null,'include':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59[_0xa9d8('0x7')][_0xa9d8('0xc')]?_[_0xa9d8('0xb')](_0x1bfd59[_0xa9d8('0x7')][_0xa9d8('0xc')],function(_0x458562){return{'model':db[_0x458562[_0xa9d8('0xd')]],'as':_0x458562['as'],'attributes':_0x458562[_0xa9d8('0xa')],'include':_0x458562[_0xa9d8('0xc')]?_[_0xa9d8('0xb')](_0x458562[_0xa9d8('0xc')],function(_0x6e191f){return{'model':db[_0x6e191f['model']],'as':_0x6e191f['as'],'attributes':_0x6e191f[_0xa9d8('0xa')],'include':_0x6e191f['include']?_['map'](_0x6e191f[_0xa9d8('0xc')],function(_0x28eaa9){return{'model':db[_0x28eaa9[_0xa9d8('0xd')]],'as':_0x28eaa9['as'],'attributes':_0x28eaa9[_0xa9d8('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa9d8('0xe')](function(_0x14dea7){logger[_0xa9d8('0xf')](_0xa9d8('0x15'),_0x1bfd59);logger[_0xa9d8('0x10')](_0xa9d8('0x15'),_0x1bfd59,JSON[_0xa9d8('0x11')](_0x14dea7));_0x196a07(_0x14dea7);})[_0xa9d8('0x12')](function(_0x1c62a4){logger[_0xa9d8('0x13')]('ShowInterval',_0x1c62a4[_0xa9d8('0x14')],_0x1bfd59);_0xbb507f(_0x733468[_0xa9d8('0x13')](0x1f4,_0x1c62a4[_0xa9d8('0x14')]));});});};function checkArrayOfIntervals(_0x263626,_0x3b4de8){var _0x1c2ade=[];return db['Interval']['findAll']({'where':{'id':_0x263626}})['then'](function(_0x292749){_0x1c2ade=_0x292749;return Promise[_0xa9d8('0x17')](_0x1c2ade[_0xa9d8('0xb')](function(_0x15d99d){return _0x15d99d[_0xa9d8('0x18')](_0x3b4de8);}));})[_0xa9d8('0xe')](function(_0x6429b6){var _0x455eb6=_0x6429b6[_0xa9d8('0x19')](function(_0x35f421,_0x428c34){return _0x35f421||_0x428c34;},![]);logger[_0xa9d8('0xf')](util[_0xa9d8('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x1c2ade['map'](function(_0x6bb38c){return _0x6bb38c[_0xa9d8('0x1b')];})['join'](',\x20'),_0x1c2ade['map'](function(_0x1f17d1){return _0x1f17d1['id'];})[_0xa9d8('0x1c')](',\x20')));return _0x455eb6;});}function checkSingleInterval(_0x323c97,_0x300a1d){return db['Interval'][_0xa9d8('0x1d')](_0x323c97)[_0xa9d8('0xe')](function(_0x4fa950){if(_0x4fa950){logger['info'](util[_0xa9d8('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x4fa950[_0xa9d8('0x1b')],_0x4fa950['id']));return _0x4fa950[_0xa9d8('0x18')](_0x300a1d);}});}exports['IntervalIftime']=function(_0x51a3bc){var _0x2414af=_0x51a3bc[_0xa9d8('0x1e')];var _0x51a964=Array[_0xa9d8('0x1f')](_0x51a3bc[_0xa9d8('0x20')])?_0x51a3bc['intervals']:typeof _0x51a3bc[_0xa9d8('0x20')]===_0xa9d8('0x21')?[_0x51a3bc[_0xa9d8('0x20')]]:[];var _0x324b80=_0x51a3bc[_0xa9d8('0x22')]||undefined;var _0x1f115d=![];if(_0x51a964[_0xa9d8('0x23')]){logger[_0xa9d8('0xf')](util[_0xa9d8('0x1a')](_0xa9d8('0x24'),_0x51a964[_0xa9d8('0x1c')](';\x20')));}if(_0x324b80){logger[_0xa9d8('0xf')](util[_0xa9d8('0x1a')](_0xa9d8('0x25'),_0x324b80));}logger[_0xa9d8('0x10')]('Iftime',_0x1f115d);logger[_0xa9d8('0x26')](_0xa9d8('0x27'),_0x51a3bc);return Promise['resolve']()['then'](function(){if(Array['isArray'](_0x2414af)){return checkArrayOfIntervals(_0x2414af,_0x324b80);}else if(_0x2414af){return checkSingleInterval(_0x2414af,_0x324b80);}})[_0xa9d8('0xe')](function(_0x4245e1){var _0x21b38a=_0x51a964[_0xa9d8('0x19')](function(_0xb7e65,_0x208506){return _0xb7e65||iftime(_0x208506,_0x324b80);},![]);_0x1f115d=_0x4245e1||_0x21b38a;return _0x1f115d;})[_0xa9d8('0x12')](function(_0x7b788f){logger[_0xa9d8('0x13')](_0xa9d8('0x27'),_0x51a3bc,_0x7b788f);throw this[_0xa9d8('0x13')](0x1f4,_0x7b788f[_0xa9d8('0x14')]);});}; \ No newline at end of file +var _0x0060=['attributes','limit','include','map','model','info','GetInterval','debug','stringify','catch','message','error','ShowInterval','then','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','resolve','reduce','lodash','util','../../mysqldb','iftime','../../config/logger','rpc','Interval','findAll','options','where'];(function(_0x6a65b3,_0x993a00){var _0x5aecf1=function(_0x341b0c){while(--_0x341b0c){_0x6a65b3['push'](_0x6a65b3['shift']());}};_0x5aecf1(++_0x993a00);}(_0x0060,0x1a4));var _0x0006=function(_0x3d3b05,_0x334c57){_0x3d3b05=_0x3d3b05-0x0;var _0x2c6ca3=_0x0060[_0x3d3b05];return _0x2c6ca3;};'use strict';var _=require(_0x0006('0x0'));var util=require(_0x0006('0x1'));var db=require(_0x0006('0x2'))['db'];var iftime=require('../../utils/iftime')[_0x0006('0x3')];var logger=require(_0x0006('0x4'))(_0x0006('0x5'));exports['GetInterval']=function(_0x5ca8bb){var _0x1bdc19=this;return new Promise(function(_0x3b9586,_0x2ee44a){return db[_0x0006('0x6')][_0x0006('0x7')]({'raw':_0x5ca8bb[_0x0006('0x8')]?_0x5ca8bb[_0x0006('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5ca8bb[_0x0006('0x8')]?_0x5ca8bb[_0x0006('0x8')][_0x0006('0x9')]||null:null,'attributes':_0x5ca8bb[_0x0006('0x8')]?_0x5ca8bb[_0x0006('0x8')][_0x0006('0xa')]||null:null,'limit':_0x5ca8bb[_0x0006('0x8')]?_0x5ca8bb['options'][_0x0006('0xb')]||null:null,'include':_0x5ca8bb[_0x0006('0x8')]?_0x5ca8bb[_0x0006('0x8')][_0x0006('0xc')]?_[_0x0006('0xd')](_0x5ca8bb[_0x0006('0x8')]['include'],function(_0xaa7b1){return{'model':db[_0xaa7b1['model']],'as':_0xaa7b1['as'],'attributes':_0xaa7b1[_0x0006('0xa')],'include':_0xaa7b1[_0x0006('0xc')]?_['map'](_0xaa7b1['include'],function(_0x1a1c96){return{'model':db[_0x1a1c96[_0x0006('0xe')]],'as':_0x1a1c96['as'],'attributes':_0x1a1c96['attributes'],'include':_0x1a1c96[_0x0006('0xc')]?_['map'](_0x1a1c96[_0x0006('0xc')],function(_0x569491){return{'model':db[_0x569491[_0x0006('0xe')]],'as':_0x569491['as'],'attributes':_0x569491[_0x0006('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe329e1){logger[_0x0006('0xf')](_0x0006('0x10'),_0x5ca8bb);logger[_0x0006('0x11')](_0x0006('0x10'),_0x5ca8bb,JSON[_0x0006('0x12')](_0xe329e1));_0x3b9586(_0xe329e1);})[_0x0006('0x13')](function(_0x30c6a0){logger['error'](_0x0006('0x10'),_0x30c6a0[_0x0006('0x14')],_0x5ca8bb);_0x2ee44a(_0x1bdc19[_0x0006('0x15')](0x1f4,_0x30c6a0['message']));});});};exports[_0x0006('0x16')]=function(_0x54a5ad){var _0x2e8b72=this;return new Promise(function(_0x57427e,_0x24d95e){return db[_0x0006('0x6')]['find']({'raw':_0x54a5ad['options']?_0x54a5ad[_0x0006('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x54a5ad[_0x0006('0x8')]?_0x54a5ad[_0x0006('0x8')][_0x0006('0x9')]||null:null,'attributes':_0x54a5ad[_0x0006('0x8')]?_0x54a5ad[_0x0006('0x8')][_0x0006('0xa')]||null:null,'include':_0x54a5ad['options']?_0x54a5ad[_0x0006('0x8')][_0x0006('0xc')]?_[_0x0006('0xd')](_0x54a5ad[_0x0006('0x8')]['include'],function(_0x50a061){return{'model':db[_0x50a061[_0x0006('0xe')]],'as':_0x50a061['as'],'attributes':_0x50a061[_0x0006('0xa')],'include':_0x50a061[_0x0006('0xc')]?_[_0x0006('0xd')](_0x50a061[_0x0006('0xc')],function(_0x435fe9){return{'model':db[_0x435fe9[_0x0006('0xe')]],'as':_0x435fe9['as'],'attributes':_0x435fe9[_0x0006('0xa')],'include':_0x435fe9['include']?_['map'](_0x435fe9[_0x0006('0xc')],function(_0x39e419){return{'model':db[_0x39e419['model']],'as':_0x39e419['as'],'attributes':_0x39e419[_0x0006('0xa')]};}):[]};}):[]};}):[]:[]})[_0x0006('0x17')](function(_0x5a5c89){logger[_0x0006('0xf')](_0x0006('0x16'),_0x54a5ad);logger[_0x0006('0x11')](_0x0006('0x16'),_0x54a5ad,JSON[_0x0006('0x12')](_0x5a5c89));_0x57427e(_0x5a5c89);})[_0x0006('0x13')](function(_0x20662b){logger['error'](_0x0006('0x16'),_0x20662b[_0x0006('0x14')],_0x54a5ad);_0x24d95e(_0x2e8b72[_0x0006('0x15')](0x1f4,_0x20662b['message']));});});};function checkArrayOfIntervals(_0x3c9e6c,_0x140eba){var _0x48892e=[];return db[_0x0006('0x6')][_0x0006('0x7')]({'where':{'id':_0x3c9e6c}})[_0x0006('0x17')](function(_0x56506c){_0x48892e=_0x56506c;return Promise['all'](_0x48892e[_0x0006('0xd')](function(_0x58229c){return _0x58229c[_0x0006('0x18')](_0x140eba);}));})[_0x0006('0x17')](function(_0x38019d){var _0x9c04a5=_0x38019d['reduce'](function(_0x558c9a,_0x356923){return _0x558c9a||_0x356923;},![]);logger[_0x0006('0xf')](util[_0x0006('0x19')](_0x0006('0x1a'),_0x48892e['map'](function(_0x1bd46c){return _0x1bd46c[_0x0006('0x1b')];})['join'](',\x20'),_0x48892e['map'](function(_0x931b40){return _0x931b40['id'];})[_0x0006('0x1c')](',\x20')));return _0x9c04a5;});}function checkSingleInterval(_0x52c73b,_0x2e547){return db[_0x0006('0x6')][_0x0006('0x1d')](_0x52c73b)[_0x0006('0x17')](function(_0x41dcb9){if(_0x41dcb9){logger[_0x0006('0xf')](util[_0x0006('0x19')](_0x0006('0x1e'),_0x41dcb9[_0x0006('0x1b')],_0x41dcb9['id']));return _0x41dcb9[_0x0006('0x18')](_0x2e547);}});}exports[_0x0006('0x1f')]=function(_0x4e3680){var _0x4a34a0=_0x4e3680[_0x0006('0x20')];var _0x2f4f7=Array[_0x0006('0x21')](_0x4e3680[_0x0006('0x22')])?_0x4e3680[_0x0006('0x22')]:typeof _0x4e3680[_0x0006('0x22')]===_0x0006('0x23')?[_0x4e3680['intervals']]:[];var _0x56aa5c=_0x4e3680[_0x0006('0x24')]||undefined;var _0x4c9576=![];if(_0x2f4f7[_0x0006('0x25')]){logger[_0x0006('0xf')](util[_0x0006('0x19')](_0x0006('0x26'),_0x2f4f7['join'](';\x20')));}if(_0x56aa5c){logger[_0x0006('0xf')](util[_0x0006('0x19')](_0x0006('0x27'),_0x56aa5c));}logger['debug'](_0x0006('0x28'),_0x4c9576);logger['silly']('IntervalIftime',_0x4e3680);return Promise[_0x0006('0x29')]()[_0x0006('0x17')](function(){if(Array[_0x0006('0x21')](_0x4a34a0)){return checkArrayOfIntervals(_0x4a34a0,_0x56aa5c);}else if(_0x4a34a0){return checkSingleInterval(_0x4a34a0,_0x56aa5c);}})[_0x0006('0x17')](function(_0x3df5a2){var _0x6f7345=_0x2f4f7[_0x0006('0x2a')](function(_0x312aae,_0x41b4e0){return _0x312aae||iftime(_0x41b4e0,_0x56aa5c);},![]);_0x4c9576=_0x3df5a2||_0x6f7345;return _0x4c9576;})[_0x0006('0x13')](function(_0xb149db){logger[_0x0006('0x15')](_0x0006('0x1f'),_0x4e3680,_0xb149db);throw this[_0x0006('0x15')](0x1f4,_0xb149db[_0x0006('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d8109d8..a6fda31 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x8640b0,_0x40629e){var _0xc3b129=function(_0x5e1468){while(--_0x5e1468){_0x8640b0['push'](_0x8640b0['shift']());}};_0xc3b129(++_0x40629e);}(_0xadb5,0xad));var _0x5adb=function(_0x1d5671,_0x2a5885){_0x1d5671=_0x1d5671-0x0;var _0x123482=_0xadb5[_0x1d5671];return _0x123482;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb10b,0x12a));var _0xbb10=function(_0x19d422,_0xcb97a4){_0x19d422=_0x19d422-0x0;var _0x27576b=_0xb10b[_0x19d422];return _0x27576b;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 32e6ff2..3ebb4cc 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 _0xe032=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','remoteAddress','socket','connection','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','base64','request','utf8','end','status','statusCode','json'];(function(_0x32822f,_0x59940e){var _0x3d2f24=function(_0x172bb0){while(--_0x172bb0){_0x32822f['push'](_0x32822f['shift']());}};_0x3d2f24(++_0x59940e);}(_0xe032,0x1cc));var _0x2e03=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0xe032[_0x333767];return _0x51661b;};'use strict';var BPromise=require('bluebird');var https=require(_0x2e03('0x0'));var logger=require(_0x2e03('0x1'))(_0x2e03('0x2'));var USERNAME=_0x2e03('0x3');var PASSWORD=_0x2e03('0x4');function openIssue(_0x2cb55c,_0x13e8b4){var _0x4344a2={'fields':{'project':{'key':_0x2cb55c['key']||_0x2e03('0x5')},'summary':(_0x2cb55c[_0x2e03('0x6')]||_0x2e03('0x7'))+'\x20from\x20'+_0x2cb55c['ip'],'description':_0x2cb55c[_0x2e03('0x8')]||JSON[_0x2e03('0x9')](_0x2cb55c),'issuetype':{'name':_0x2cb55c[_0x2e03('0xa')]||_0x2e03('0xb')}}};_0x4344a2[_0x2e03('0xc')][_0x2e03('0xd')]=_0x2cb55c[_0x2e03('0xe')];_0x4344a2[_0x2e03('0xc')][_0x2e03('0xf')]=_0x2cb55c[_0x2e03('0x10')];_0x4344a2[_0x2e03('0xc')][_0x2e03('0x11')]=_0x2cb55c['newToken'];_0x4344a2[_0x2e03('0xc')]['customfield_11503']=_0x2cb55c[_0x2e03('0x12')];_0x4344a2[_0x2e03('0xc')]['customfield_11504']=_0x2cb55c[_0x2e03('0x13')];_0x4344a2[_0x2e03('0xc')][_0x2e03('0x14')]=_0x2cb55c['ip'];var _0x142ce4={'host':_0x2e03('0x15'),'port':0x1bb,'path':_0x2e03('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x2e03('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x2e03('0x18')](_0x2e03('0x19'))}};var _0x341123=JSON['stringify'](_0x4344a2);var _0x430a64=https[_0x2e03('0x1a')](_0x142ce4,function(_0x142f4d){_0x142f4d['setEncoding'](_0x2e03('0x1b'));var _0x1e2cb2='';_0x142f4d['on']('data',function(_0xd92133){_0x1e2cb2+=_0xd92133;});_0x142f4d['on'](_0x2e03('0x1c'),function(){if(_0x13e8b4){return _0x13e8b4[_0x2e03('0x1d')](_0x142f4d[_0x2e03('0x1e')])[_0x2e03('0x1f')](JSON['parse'](_0x1e2cb2));}});});_0x430a64['on']('error',function(_0x5c9920){if(_0x13e8b4){return _0x13e8b4[_0x2e03('0x1d')](0x1f4)[_0x2e03('0x1f')]({'errors':[{'message':_0x2e03('0x20'),'type':_0x2e03('0x21')}]});}});_0x430a64['write'](_0x341123);_0x430a64[_0x2e03('0x1c')]();}exports[_0x2e03('0x22')]=openIssue;exports[_0x2e03('0x23')]=function(_0x47e07e,_0x1989fd){_0x47e07e[_0x2e03('0x24')]['ip']=_0x47e07e[_0x2e03('0x25')]['x-forwarded-for']||_0x47e07e['connection'][_0x2e03('0x26')]||_0x47e07e[_0x2e03('0x27')][_0x2e03('0x26')]||_0x47e07e[_0x2e03('0x28')][_0x2e03('0x27')]['remoteAddress'];return openIssue(_0x47e07e[_0x2e03('0x24')],_0x1989fd);}; \ No newline at end of file +var _0xfba8=['customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','status','statusCode','error','json','api.jira','write','openIssue','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken'];(function(_0x2aff58,_0x310486){var _0x3628dd=function(_0x5258da){while(--_0x5258da){_0x2aff58['push'](_0x2aff58['shift']());}};_0x3628dd(++_0x310486);}(_0xfba8,0x1cb));var _0x8fba=function(_0x2d25a3,_0x2664bf){_0x2d25a3=_0x2d25a3-0x0;var _0x520004=_0xfba8[_0x2d25a3];return _0x520004;};'use strict';var BPromise=require(_0x8fba('0x0'));var https=require(_0x8fba('0x1'));var logger=require(_0x8fba('0x2'))(_0x8fba('0x3'));var USERNAME=_0x8fba('0x4');var PASSWORD=_0x8fba('0x5');function openIssue(_0x239925,_0x321dee){var _0xfd877b={'fields':{'project':{'key':_0x239925[_0x8fba('0x6')]||_0x8fba('0x7')},'summary':(_0x239925['summary']||_0x8fba('0x8'))+_0x8fba('0x9')+_0x239925['ip'],'description':_0x239925[_0x8fba('0xa')]||JSON[_0x8fba('0xb')](_0x239925),'issuetype':{'name':_0x239925[_0x8fba('0xc')]||_0x8fba('0xd')}}};_0xfd877b[_0x8fba('0xe')][_0x8fba('0xf')]=_0x239925[_0x8fba('0x10')];_0xfd877b[_0x8fba('0xe')][_0x8fba('0x11')]=_0x239925[_0x8fba('0x12')];_0xfd877b[_0x8fba('0xe')][_0x8fba('0x13')]=_0x239925[_0x8fba('0x14')];_0xfd877b[_0x8fba('0xe')][_0x8fba('0x15')]=_0x239925[_0x8fba('0x16')];_0xfd877b[_0x8fba('0xe')]['customfield_11504']=_0x239925[_0x8fba('0x17')];_0xfd877b[_0x8fba('0xe')][_0x8fba('0x18')]=_0x239925['ip'];var _0x5e6039={'host':_0x8fba('0x19'),'port':0x1bb,'path':_0x8fba('0x1a'),'method':_0x8fba('0x1b'),'timeout':0x4e20,'headers':{'Content-Type':_0x8fba('0x1c'),'Authorization':_0x8fba('0x1d')+new Buffer(USERNAME+':'+PASSWORD)[_0x8fba('0x1e')](_0x8fba('0x1f'))}};var _0x29a590=JSON[_0x8fba('0xb')](_0xfd877b);var _0x556954=https['request'](_0x5e6039,function(_0x3403fb){_0x3403fb[_0x8fba('0x20')](_0x8fba('0x21'));var _0x40908f='';_0x3403fb['on'](_0x8fba('0x22'),function(_0x126b32){_0x40908f+=_0x126b32;});_0x3403fb['on'](_0x8fba('0x23'),function(){if(_0x321dee){return _0x321dee[_0x8fba('0x24')](_0x3403fb[_0x8fba('0x25')])['json'](JSON['parse'](_0x40908f));}});});_0x556954['on'](_0x8fba('0x26'),function(_0x595c18){if(_0x321dee){return _0x321dee[_0x8fba('0x24')](0x1f4)[_0x8fba('0x27')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x8fba('0x28')}]});}});_0x556954[_0x8fba('0x29')](_0x29a590);_0x556954[_0x8fba('0x23')]();}exports[_0x8fba('0x2a')]=openIssue;exports['send']=function(_0x2bbd87,_0x4c4b4e){_0x2bbd87[_0x8fba('0x2b')]['ip']=_0x2bbd87['headers'][_0x8fba('0x2c')]||_0x2bbd87[_0x8fba('0x2d')][_0x8fba('0x2e')]||_0x2bbd87[_0x8fba('0x2f')][_0x8fba('0x2e')]||_0x2bbd87[_0x8fba('0x2d')][_0x8fba('0x2f')][_0x8fba('0x2e')];return openIssue(_0x2bbd87[_0x8fba('0x2b')],_0x4c4b4e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 20efacc..fe559be 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 _0xa75b=['isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x420b2b,_0x54e29a){var _0x14b48f=function(_0x10c51f){while(--_0x10c51f){_0x420b2b['push'](_0x420b2b['shift']());}};_0x14b48f(++_0x54e29a);}(_0xa75b,0x170));var _0xba75=function(_0x1557b0,_0xb1f068){_0x1557b0=_0x1557b0-0x0;var _0x27c2ea=_0xa75b[_0x1557b0];return _0x27c2ea;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['post']('/',auth[_0xba75('0xa')](),controller[_0xba75('0xe')]);router[_0xba75('0xf')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x11')]);router[_0xba75('0x12')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x13')]);module[_0xba75('0x14')]=router; \ No newline at end of file +var _0x5ff3=['/:id','post','create','put','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0xfd0ab1,_0x59786e){var _0x30689e=function(_0x484c8b){while(--_0x484c8b){_0xfd0ab1['push'](_0xfd0ab1['shift']());}};_0x30689e(++_0x59786e);}(_0x5ff3,0x17d));var _0x35ff=function(_0x11addf,_0x110920){_0x11addf=_0x11addf-0x0;var _0x30a5a2=_0x5ff3[_0x11addf];return _0x30a5a2;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var fs_extra=require(_0x35ff('0x3'));var auth=require(_0x35ff('0x4'));var interaction=require(_0x35ff('0x5'));var config=require('../../config/environment');var controller=require(_0x35ff('0x6'));router[_0x35ff('0x7')]('/',auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0x7')]('/describe',auth[_0x35ff('0x8')](),controller['describe']);router[_0x35ff('0x7')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller['show']);router[_0x35ff('0xb')]('/',auth['isAuthenticated'](),controller[_0x35ff('0xc')]);router[_0x35ff('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xf')]);module[_0x35ff('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index ed0033c..935ea02 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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0xa5b48e,_0x4f0f23){_0xa5b48e=_0xa5b48e-0x0;var _0x5a83a9=_0x7a54[_0xa5b48e];return _0x5a83a9;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x4f108f,_0x34b9a2){_0x4f108f=_0x4f108f-0x0;var _0x15834e=_0x7a54[_0x4f108f];return _0x15834e;};'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 b9e16e2..7d71041 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 _0x44e8=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','end','error','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x9522dd,_0x5595db){var _0x3ff377=function(_0x1faf4b){while(--_0x1faf4b){_0x9522dd['push'](_0x9522dd['shift']());}};_0x3ff377(++_0x5595db);}(_0x44e8,0xd7));var _0x844e=function(_0x401e8e,_0x56b07a){_0x401e8e=_0x401e8e-0x0;var _0x59c991=_0x44e8[_0x401e8e];return _0x59c991;};'use strict';var emlformat=require(_0x844e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x844e('0x1'));var rp=require(_0x844e('0x2'));var moment=require(_0x844e('0x3'));var BPromise=require(_0x844e('0x4'));var Mustache=require('mustache');var util=require(_0x844e('0x5'));var path=require(_0x844e('0x6'));var sox=require(_0x844e('0x7'));var csv=require(_0x844e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x844e('0x9'));var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0x8'));var querystring=require(_0x844e('0xe'));var Papa=require(_0x844e('0xf'));var Redis=require(_0x844e('0x10'));var authService=require(_0x844e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x12'));var hardwareService=require(_0x844e('0x13'));var logger=require(_0x844e('0x14'))(_0x844e('0x15'));var utils=require(_0x844e('0x16'));var config=require(_0x844e('0x17'));var licenseUtil=require(_0x844e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d3bea,_0x23df3f){_0x23df3f=_0x23df3f||0xcc;return function(_0x52ac76){if(_0x52ac76){return _0x8d3bea[_0x844e('0x19')](_0x23df3f);}return _0x8d3bea[_0x844e('0x1a')](_0x23df3f)['end']();};}function respondWithResult(_0x1f48e2,_0x6b542d){_0x6b542d=_0x6b542d||0xc8;return function(_0x1c1689){if(_0x1c1689){return _0x1f48e2['status'](_0x6b542d)[_0x844e('0x1b')](_0x1c1689);}};}function respondWithFilteredResult(_0x465e49,_0x380eb4){return function(_0x935134){if(_0x935134){var _0x2588a3=typeof _0x380eb4[_0x844e('0x1c')]===_0x844e('0x1d')&&typeof _0x380eb4[_0x844e('0x1e')]==='undefined';var _0x36286c=_0x935134['count'];var _0x3c307f=_0x2588a3?0x0:_0x380eb4['offset'];var _0x315c50=_0x2588a3?_0x935134['count']:_0x380eb4[_0x844e('0x1c')]+_0x380eb4[_0x844e('0x1e')];var _0x2d6ba8;if(_0x315c50>=_0x36286c){_0x315c50=_0x36286c;_0x2d6ba8=0xc8;}else{_0x2d6ba8=0xce;}_0x465e49[_0x844e('0x1a')](_0x2d6ba8);return _0x465e49[_0x844e('0x1f')](_0x844e('0x20'),_0x3c307f+'-'+_0x315c50+'/'+_0x36286c)[_0x844e('0x1b')](_0x935134);}return null;};}function patchUpdates(_0x243aeb){return function(_0x4ffb86){try{jsonpatch[_0x844e('0x21')](_0x4ffb86,_0x243aeb,!![]);}catch(_0x50aeec){return BPromise['reject'](_0x50aeec);}return _0x4ffb86[_0x844e('0x22')]();};}function saveUpdates(_0x345dcc,_0x439b26){return function(_0x286fdd){if(_0x286fdd){return _0x286fdd['update'](_0x345dcc)[_0x844e('0x23')](function(_0x3dde07){return _0x3dde07;});}return null;};}function removeEntity(_0x571498,_0x2520f8){return function(_0x13489b){if(_0x13489b){return _0x13489b[_0x844e('0x24')]()[_0x844e('0x23')](function(){_0x571498[_0x844e('0x1a')](0xcc)[_0x844e('0x25')]();});}};}function handleEntityNotFound(_0x498ae0,_0x399a81){return function(_0xadf0d8){if(!_0xadf0d8){_0x498ae0[_0x844e('0x19')](0x194);}return _0xadf0d8;};}function handleError(_0x263702,_0x2c915f){_0x2c915f=_0x2c915f||0x1f4;return function(_0x5d6856){logger[_0x844e('0x26')](_0x5d6856['stack']);if(_0x5d6856['name']){delete _0x5d6856[_0x844e('0x27')];}_0x263702[_0x844e('0x1a')](_0x2c915f)[_0x844e('0x28')](_0x5d6856);};}exports['index']=function(_0x489349,_0x2d4acd){var _0xc3ec93={},_0x54fd73={},_0x228cc1={'count':0x0,'rows':[]};var _0x81d4de=_[_0x844e('0x29')](db[_0x844e('0x2a')][_0x844e('0x2b')],function(_0x799cde){return{'name':_0x799cde[_0x844e('0x2c')],'type':_0x799cde[_0x844e('0x2d')][_0x844e('0x2e')]};});_0x54fd73[_0x844e('0x2f')]=_['map'](_0x81d4de,_0x844e('0x27'));_0x54fd73[_0x844e('0x30')]=_[_0x844e('0x31')](_0x489349[_0x844e('0x30')]);_0x54fd73[_0x844e('0x32')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],_0x54fd73['query']);_0xc3ec93[_0x844e('0x34')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],qs['fields'](_0x489349[_0x844e('0x30')][_0x844e('0x35')]));_0xc3ec93['attributes']=_0xc3ec93[_0x844e('0x34')][_0x844e('0x36')]?_0xc3ec93['attributes']:_0x54fd73[_0x844e('0x2f')];if(!_0x489349[_0x844e('0x30')][_0x844e('0x37')](_0x844e('0x38'))){_0xc3ec93[_0x844e('0x1e')]=qs[_0x844e('0x1e')](_0x489349[_0x844e('0x30')]['limit']);_0xc3ec93[_0x844e('0x1c')]=qs[_0x844e('0x1c')](_0x489349[_0x844e('0x30')][_0x844e('0x1c')]);}_0xc3ec93[_0x844e('0x39')]=qs[_0x844e('0x3a')](_0x489349[_0x844e('0x30')][_0x844e('0x3a')]);_0xc3ec93[_0x844e('0x3b')]=qs[_0x844e('0x32')](_[_0x844e('0x3c')](_0x489349['query'],_0x54fd73['filters']),_0x81d4de);if(_0x489349[_0x844e('0x30')][_0x844e('0x3d')]){_0xc3ec93[_0x844e('0x3b')]=_[_0x844e('0x3e')](_0xc3ec93[_0x844e('0x3b')],{'$or':_[_0x844e('0x29')](_0x81d4de,function(_0x6f902e){if(_0x6f902e[_0x844e('0x2d')]!==_0x844e('0x3f')){var _0x539077={};_0x539077[_0x6f902e[_0x844e('0x27')]]={'$like':'%'+_0x489349['query'][_0x844e('0x3d')]+'%'};return _0x539077;}})});}_0xc3ec93=_['merge']({},_0xc3ec93,_0x489349[_0x844e('0x40')]);var _0x5dc530={'where':_0xc3ec93[_0x844e('0x3b')]};return db[_0x844e('0x2a')][_0x844e('0x41')](_0x5dc530)[_0x844e('0x23')](function(_0x2eb412){_0x228cc1[_0x844e('0x41')]=_0x2eb412;if(_0x489349[_0x844e('0x30')][_0x844e('0x42')]){_0xc3ec93[_0x844e('0x43')]=[{'all':!![]}];}return db[_0x844e('0x2a')][_0x844e('0x44')](_0xc3ec93);})['then'](function(_0x3ecb60){_0x228cc1[_0x844e('0x45')]=_0x3ecb60;return _0x228cc1;})[_0x844e('0x23')](respondWithFilteredResult(_0x2d4acd,_0xc3ec93))['catch'](handleError(_0x2d4acd,null));};exports['show']=function(_0x213a9f,_0x3e24ca){var _0x1a7817={'raw':!![],'where':{'id':_0x213a9f['params']['id']}},_0x5d8cd9={};_0x5d8cd9['model']=_['keys'](db[_0x844e('0x2a')][_0x844e('0x2b')]);_0x5d8cd9[_0x844e('0x30')]=_[_0x844e('0x31')](_0x213a9f[_0x844e('0x30')]);_0x5d8cd9['filters']=_[_0x844e('0x33')](_0x5d8cd9['model'],_0x5d8cd9['query']);_0x1a7817[_0x844e('0x34')]=_[_0x844e('0x33')](_0x5d8cd9[_0x844e('0x2f')],qs[_0x844e('0x35')](_0x213a9f['query'][_0x844e('0x35')]));_0x1a7817[_0x844e('0x34')]=_0x1a7817[_0x844e('0x34')]['length']?_0x1a7817[_0x844e('0x34')]:_0x5d8cd9[_0x844e('0x2f')];if(_0x213a9f['query'][_0x844e('0x42')]){_0x1a7817[_0x844e('0x43')]=[{'all':!![]}];}_0x1a7817=_[_0x844e('0x3e')]({},_0x1a7817,_0x213a9f[_0x844e('0x40')]);return db[_0x844e('0x2a')][_0x844e('0x46')](_0x1a7817)['then'](handleEntityNotFound(_0x3e24ca,null))[_0x844e('0x23')](respondWithResult(_0x3e24ca,null))[_0x844e('0x47')](handleError(_0x3e24ca,null));};exports[_0x844e('0x48')]=function(_0x29dd8b,_0x1dcfcb){return db[_0x844e('0x2a')][_0x844e('0x48')](_0x29dd8b[_0x844e('0x49')],{})[_0x844e('0x23')](respondWithResult(_0x1dcfcb,0xc9))[_0x844e('0x47')](handleError(_0x1dcfcb,null));};exports['update']=function(_0x32e097,_0x694791){if(_0x32e097[_0x844e('0x49')]['id']){delete _0x32e097['body']['id'];}return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x32e097[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x694791,null))[_0x844e('0x23')](saveUpdates(_0x32e097[_0x844e('0x49')],null))[_0x844e('0x23')](respondWithResult(_0x694791,null))['catch'](handleError(_0x694791,null));};exports[_0x844e('0x24')]=function(_0x3c680c,_0x43e1f5){return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x3c680c[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x43e1f5,null))[_0x844e('0x23')](removeEntity(_0x43e1f5,null))[_0x844e('0x47')](handleError(_0x43e1f5,null));};exports[_0x844e('0x4b')]=function(_0x3af2fe,_0x1dda1d){return db[_0x844e('0x2a')]['describe']()[_0x844e('0x23')](respondWithResult(_0x1dda1d,null))[_0x844e('0x47')](handleError(_0x1dda1d,null));}; \ No newline at end of file +var _0xb138=['filters','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','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','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x42b927,_0x41e04c){var _0xeefddc=function(_0x255cab){while(--_0x255cab){_0x42b927['push'](_0x42b927['shift']());}};_0xeefddc(++_0x41e04c);}(_0xb138,0x1dd));var _0x8b13=function(_0x42599b,_0x4e61b0){_0x42599b=_0x42599b-0x0;var _0x356357=_0xb138[_0x42599b];return _0x356357;};'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')]=_['map'](_0x35fdca,_0x8b13('0x2b'));_0x2bb51d[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x3475d8[_0x8b13('0x35')]);_0x2bb51d['filters']=_['intersection'](_0x2bb51d[_0x8b13('0x34')],_0x2bb51d['query']);_0x114b01['attributes']=_[_0x8b13('0x37')](_0x2bb51d['model'],qs[_0x8b13('0x38')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x38')]));_0x114b01[_0x8b13('0x39')]=_0x114b01[_0x8b13('0x39')][_0x8b13('0x3a')]?_0x114b01[_0x8b13('0x39')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8[_0x8b13('0x35')][_0x8b13('0x3b')]('nolimit')){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3c')](_0x3475d8['query'][_0x8b13('0x3c')]);_0x114b01[_0x8b13('0x3d')]=qs[_0x8b13('0x3e')](_[_0x8b13('0x3f')](_0x3475d8[_0x8b13('0x35')],_0x2bb51d[_0x8b13('0x3e')]),_0x35fdca);if(_0x3475d8['query']['filter']){_0x114b01[_0x8b13('0x3d')]=_['merge'](_0x114b01[_0x8b13('0x3d')],{'$or':_['map'](_0x35fdca,function(_0x590a23){if(_0x590a23[_0x8b13('0x32')]!==_0x8b13('0x40')){var _0x2bc877={};_0x2bc877[_0x590a23[_0x8b13('0x2b')]]={'$like':'%'+_0x3475d8['query']['filter']+'%'};return _0x2bc877;}})});}_0x114b01=_[_0x8b13('0x41')]({},_0x114b01,_0x3475d8['options']);var _0x6ba2f3={'where':_0x114b01[_0x8b13('0x3d')]};return db['JscriptyAnswerReport'][_0x8b13('0x20')](_0x6ba2f3)[_0x8b13('0x26')](function(_0x35c1d6){_0x5ab161[_0x8b13('0x20')]=_0x35c1d6;if(_0x3475d8[_0x8b13('0x35')][_0x8b13('0x42')]){_0x114b01[_0x8b13('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x114b01);})['then'](function(_0x3eb3c5){_0x5ab161[_0x8b13('0x44')]=_0x3eb3c5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x45')](handleError(_0x1511bf,null));};exports[_0x8b13('0x46')]=function(_0x271507,_0x492f7d){var _0x4342db={'raw':!![],'where':{'id':_0x271507[_0x8b13('0x47')]['id']}},_0x50e535={};_0x50e535['model']=_[_0x8b13('0x36')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x50e535[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x271507[_0x8b13('0x35')]);_0x50e535[_0x8b13('0x3e')]=_['intersection'](_0x50e535['model'],_0x50e535['query']);_0x4342db[_0x8b13('0x39')]=_[_0x8b13('0x37')](_0x50e535[_0x8b13('0x34')],qs[_0x8b13('0x38')](_0x271507['query']['fields']));_0x4342db[_0x8b13('0x39')]=_0x4342db['attributes'][_0x8b13('0x3a')]?_0x4342db[_0x8b13('0x39')]:_0x50e535[_0x8b13('0x34')];if(_0x271507[_0x8b13('0x35')][_0x8b13('0x42')]){_0x4342db['include']=[{'all':!![]}];}_0x4342db=_[_0x8b13('0x41')]({},_0x4342db,_0x271507[_0x8b13('0x48')]);return db[_0x8b13('0x2f')][_0x8b13('0x49')](_0x4342db)[_0x8b13('0x26')](handleEntityNotFound(_0x492f7d,null))[_0x8b13('0x26')](respondWithResult(_0x492f7d,null))[_0x8b13('0x45')](handleError(_0x492f7d,null));};exports[_0x8b13('0x4a')]=function(_0x3e192b,_0x518298){return db[_0x8b13('0x2f')]['create'](_0x3e192b[_0x8b13('0x4b')],{})[_0x8b13('0x26')](respondWithResult(_0x518298,0xc9))[_0x8b13('0x45')](handleError(_0x518298,null));};exports['update']=function(_0x148efb,_0x35f612){if(_0x148efb[_0x8b13('0x4b')]['id']){delete _0x148efb[_0x8b13('0x4b')]['id'];}return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x148efb[_0x8b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x35f612,null))[_0x8b13('0x26')](saveUpdates(_0x148efb['body'],null))[_0x8b13('0x26')](respondWithResult(_0x35f612,null))[_0x8b13('0x45')](handleError(_0x35f612,null));};exports[_0x8b13('0x27')]=function(_0x435867,_0x2be640){return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x435867[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x2be640,null))[_0x8b13('0x26')](removeEntity(_0x2be640,null))[_0x8b13('0x45')](handleError(_0x2be640,null));};exports[_0x8b13('0x4c')]=function(_0xd55f3b,_0x2bdfae){return db[_0x8b13('0x2f')][_0x8b13('0x4c')]()[_0x8b13('0x26')](respondWithResult(_0x2bdfae,null))['catch'](handleError(_0x2bdfae,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 292baff..8400a3c 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 _0x7f63=['report_jscripty_answers','util','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','define'];(function(_0x385ec5,_0x3d678e){var _0x65683e=function(_0x27d9cf){while(--_0x27d9cf){_0x385ec5['push'](_0x385ec5['shift']());}};_0x65683e(++_0x3d678e);}(_0x7f63,0x155));var _0x37f6=function(_0x13d017,_0x13c192){_0x13d017=_0x13d017-0x0;var _0x432db4=_0x7f63[_0x13d017];return _0x432db4;};'use strict';var _=require('lodash');var util=require(_0x37f6('0x0'));var logger=require('../../config/logger')(_0x37f6('0x1'));var moment=require(_0x37f6('0x2'));var BPromise=require(_0x37f6('0x3'));var rp=require(_0x37f6('0x4'));var fs=require('fs');var path=require(_0x37f6('0x5'));var rimraf=require(_0x37f6('0x6'));var config=require('../../config/environment');var attributes=require(_0x37f6('0x7'));module['exports']=function(_0x2238b8,_0x39596a){return _0x2238b8[_0x37f6('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x37f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd79b=['rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','request-promise','path'];(function(_0x4fe36d,_0x12806b){var _0x3eb48f=function(_0x2c7eac){while(--_0x2c7eac){_0x4fe36d['push'](_0x4fe36d['shift']());}};_0x3eb48f(++_0x12806b);}(_0xd79b,0x1c2));var _0xbd79=function(_0x98b357,_0x8a11b7){_0x98b357=_0x98b357-0x0;var _0x57f3f7=_0xd79b[_0x98b357];return _0x57f3f7;};'use strict';var _=require(_0xbd79('0x0'));var util=require(_0xbd79('0x1'));var logger=require('../../config/logger')(_0xbd79('0x2'));var moment=require(_0xbd79('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd79('0x4'));var fs=require('fs');var path=require(_0xbd79('0x5'));var rimraf=require(_0xbd79('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd79('0x7'));module[_0xbd79('0x8')]=function(_0x3986c0,_0x39dfa6){return _0x3986c0[_0xbd79('0x9')](_0xbd79('0xa'),attributes,{'tableName':_0xbd79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 5015567..65d2a77 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 _0xcd3a=['result','catch','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0xcd3a,0x66));var _0xacd3=function(_0xe2d38,_0x40a174){_0xe2d38=_0xe2d38-0x0;var _0x8f0317=_0xcd3a[_0xe2d38];return _0x8f0317;};'use strict';var _=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xacd3('0x2'));var fs=require('fs');var Redis=require(_0xacd3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xacd3('0x4'))('rpc');var config=require(_0xacd3('0x5'));var jayson=require(_0xacd3('0x6'));var client=jayson[_0xacd3('0x7')][_0xacd3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x202661,_0x19d247,_0x320870){return new BPromise(function(_0x16c29d,_0x3ca3ee){return client['request'](_0x202661,_0x320870)[_0xacd3('0x9')](function(_0x50f2d6){logger[_0xacd3('0xa')](_0xacd3('0xb'),_0x19d247,_0xacd3('0xc'));logger[_0xacd3('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x19d247,'request\x20sent',JSON[_0xacd3('0xe')](_0x50f2d6));if(_0x50f2d6[_0xacd3('0xf')]){if(_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x10')]===0x1f4){logger[_0xacd3('0xf')](_0xacd3('0xb'),_0x19d247,_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x11')]);return _0x3ca3ee(_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x11')]);}logger[_0xacd3('0xf')](_0xacd3('0xb'),_0x19d247,_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x11')]);return _0x16c29d(_0x50f2d6[_0xacd3('0xf')]['message']);}else{logger[_0xacd3('0xa')](_0xacd3('0xb'),_0x19d247,'request\x20sent');_0x16c29d(_0x50f2d6[_0xacd3('0x12')][_0xacd3('0x11')]);}})[_0xacd3('0x13')](function(_0x325962){logger['error'](_0xacd3('0xb'),_0x19d247,_0x325962);_0x3ca3ee(_0x325962);});});} \ No newline at end of file +var _0x17ca=['request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3b25a0,_0x3b0386){var _0x46ae66=function(_0x11cb1c){while(--_0x11cb1c){_0x3b25a0['push'](_0x3b25a0['shift']());}};_0x46ae66(++_0x3b0386);}(_0x17ca,0x6a));var _0xa17c=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0x17ca[_0x770f7];return _0xe797c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa17c('0x0'));var rs=require(_0xa17c('0x1'));var fs=require('fs');var Redis=require(_0xa17c('0x2'));var db=require(_0xa17c('0x3'))['db'];var utils=require(_0xa17c('0x4'));var logger=require(_0xa17c('0x5'))(_0xa17c('0x6'));var config=require(_0xa17c('0x7'));var jayson=require(_0xa17c('0x8'));var client=jayson[_0xa17c('0x9')][_0xa17c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3379,_0x34d5da,_0x24a1b0){return new BPromise(function(_0x1bae74,_0x73e681){return client[_0xa17c('0xb')](_0x3e3379,_0x24a1b0)[_0xa17c('0xc')](function(_0xdc8d1a){logger[_0xa17c('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x34d5da,_0xa17c('0xe'));logger[_0xa17c('0xf')](_0xa17c('0x10'),_0x34d5da,_0xa17c('0xe'),JSON[_0xa17c('0x11')](_0xdc8d1a));if(_0xdc8d1a[_0xa17c('0x12')]){if(_0xdc8d1a['error'][_0xa17c('0x13')]===0x1f4){logger[_0xa17c('0x12')](_0xa17c('0x14'),_0x34d5da,_0xdc8d1a[_0xa17c('0x12')][_0xa17c('0x15')]);return _0x73e681(_0xdc8d1a[_0xa17c('0x12')][_0xa17c('0x15')]);}logger[_0xa17c('0x12')](_0xa17c('0x14'),_0x34d5da,_0xdc8d1a[_0xa17c('0x12')]['message']);return _0x1bae74(_0xdc8d1a[_0xa17c('0x12')][_0xa17c('0x15')]);}else{logger[_0xa17c('0xd')](_0xa17c('0x14'),_0x34d5da,'request\x20sent');_0x1bae74(_0xdc8d1a[_0xa17c('0x16')][_0xa17c('0x15')]);}})[_0xa17c('0x17')](function(_0x1656d8){logger['error'](_0xa17c('0x14'),_0x34d5da,_0x1656d8);_0x73e681(_0x1656d8);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index d6de10e..f22449a 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 _0x6d78=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','post','create','clone'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x6d78,0x1df));var _0x86d7=function(_0x5d2bd6,_0x377005){_0x5d2bd6=_0x5d2bd6-0x0;var _0x796b32=_0x6d78[_0x5d2bd6];return _0x796b32;};'use strict';var multer=require('multer');var util=require(_0x86d7('0x0'));var path=require(_0x86d7('0x1'));var timeout=require(_0x86d7('0x2'));var express=require(_0x86d7('0x3'));var router=express[_0x86d7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86d7('0x5'));var config=require(_0x86d7('0x6'));var controller=require(_0x86d7('0x7'));router[_0x86d7('0x8')]('/',auth[_0x86d7('0x9')](),controller[_0x86d7('0xa')]);router['get'](_0x86d7('0xb'),auth[_0x86d7('0x9')](),controller[_0x86d7('0xc')]);router[_0x86d7('0x8')](_0x86d7('0xd'),auth['isAuthenticated'](),controller[_0x86d7('0xe')]);router[_0x86d7('0x8')](_0x86d7('0xf'),auth[_0x86d7('0x9')](),controller[_0x86d7('0x10')]);router['get'](_0x86d7('0x11'),auth['isAuthenticated'](),timeout('30s'),controller['getSummary']);router[_0x86d7('0x12')]('/',auth[_0x86d7('0x9')](),controller[_0x86d7('0x13')]);router[_0x86d7('0x12')]('/:id/clone',auth[_0x86d7('0x9')](),controller[_0x86d7('0x14')]);router[_0x86d7('0x15')](_0x86d7('0xb'),auth[_0x86d7('0x9')](),controller[_0x86d7('0x16')]);router[_0x86d7('0x17')](_0x86d7('0xb'),auth[_0x86d7('0x9')](),controller['destroy']);module[_0x86d7('0x18')]=router; \ No newline at end of file +var _0xd86d=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','update','delete','destroy','exports'];(function(_0xe8e2b3,_0x4c5348){var _0x545fa0=function(_0x20d935){while(--_0x20d935){_0xe8e2b3['push'](_0xe8e2b3['shift']());}};_0x545fa0(++_0x4c5348);}(_0xd86d,0x15e));var _0xdd86=function(_0xc1b5d0,_0x36ef3c){_0xc1b5d0=_0xc1b5d0-0x0;var _0x3faf7e=_0xd86d[_0xc1b5d0];return _0x3faf7e;};'use strict';var multer=require('multer');var util=require(_0xdd86('0x0'));var path=require('path');var timeout=require(_0xdd86('0x1'));var express=require('express');var router=express[_0xdd86('0x2')]();var fs_extra=require(_0xdd86('0x3'));var auth=require(_0xdd86('0x4'));var interaction=require(_0xdd86('0x5'));var config=require(_0xdd86('0x6'));var controller=require(_0xdd86('0x7'));router[_0xdd86('0x8')]('/',auth[_0xdd86('0x9')](),controller[_0xdd86('0xa')]);router['get'](_0xdd86('0xb'),auth[_0xdd86('0x9')](),controller[_0xdd86('0xc')]);router[_0xdd86('0x8')]('/:id/sessions',auth[_0xdd86('0x9')](),controller['getSessions']);router['get'](_0xdd86('0xd'),auth['isAuthenticated'](),controller[_0xdd86('0xe')]);router['get'](_0xdd86('0xf'),auth[_0xdd86('0x9')](),timeout(_0xdd86('0x10')),controller[_0xdd86('0x11')]);router[_0xdd86('0x12')]('/',auth[_0xdd86('0x9')](),controller[_0xdd86('0x13')]);router['post'](_0xdd86('0x14'),auth[_0xdd86('0x9')](),controller['clone']);router['put'](_0xdd86('0xb'),auth[_0xdd86('0x9')](),controller[_0xdd86('0x15')]);router[_0xdd86('0x16')](_0xdd86('0xb'),auth[_0xdd86('0x9')](),controller[_0xdd86('0x17')]);module[_0xdd86('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 bfde597..ab7fe2b 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 _0x00f2=['TEXT','isObjectLike','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','exports','name','STRING'];(function(_0x1bae75,_0x228797){var _0x43be36=function(_0x5812fe){while(--_0x5812fe){_0x1bae75['push'](_0x1bae75['shift']());}};_0x43be36(++_0x228797);}(_0x00f2,0xfa));var _0x200f=function(_0x341539,_0x4d51a5){_0x341539=_0x341539-0x0;var _0xc4121d=_0x00f2[_0x341539];return _0xc4121d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x200f('0x0'));var util=require(_0x200f('0x1'));module[_0x200f('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x200f('0x3')},'description':{'type':Sequelize[_0x200f('0x4')]},'formData':{'type':Sequelize[_0x200f('0x5')]('long'),'set':function(_0x23765a){if(_[_0x200f('0x6')](_0x23765a)){this['setDataValue'](_0x200f('0x7'),JSON['stringify'](_0x23765a));}else if(_[_0x200f('0x8')](_0x23765a)){this[_0x200f('0x9')](_0x200f('0x7'),_0x23765a);}else{this['setDataValue'](_0x200f('0x7'),util[_0x200f('0xa')](_0x200f('0xb'),this[_0x200f('0xc')](_0x200f('0x3'))||'',this[_0x200f('0xc')](_0x200f('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x200f('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x200f('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x594f=['description','BOOLEAN','lodash','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','isString','format','getDataValue'];(function(_0x2ef2c5,_0x249f30){var _0x11a799=function(_0x13da56){while(--_0x13da56){_0x2ef2c5['push'](_0x2ef2c5['shift']());}};_0x11a799(++_0x249f30);}(_0x594f,0x147));var _0xf594=function(_0x51b4bb,_0x4a1f1e){_0x51b4bb=_0x51b4bb-0x0;var _0x234460=_0x594f[_0x51b4bb];return _0x234460;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf594('0x0'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xf594('0x1')],'unique':_0xf594('0x2')},'description':{'type':Sequelize[_0xf594('0x1')]},'formData':{'type':Sequelize[_0xf594('0x3')](_0xf594('0x4')),'set':function(_0x394e36){if(_[_0xf594('0x5')](_0x394e36)){this[_0xf594('0x6')](_0xf594('0x7'),JSON['stringify'](_0x394e36));}else if(_[_0xf594('0x8')](_0x394e36)){this[_0xf594('0x6')]('formData',_0x394e36);}else{this['setDataValue'](_0xf594('0x7'),util[_0xf594('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xf594('0xa')](_0xf594('0x2'))||'',this[_0xf594('0xa')](_0xf594('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf594('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index bae5869..bbe6e58 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 _0xa282=['moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','error','stack','name','send','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyProject','include','findAll','rows','catch','params','keys','intersection','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','user','getSessions','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xa282,0x77));var _0x2a28=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xa282[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0x2a28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a28('0x1'));var jsonpatch=require(_0x2a28('0x2'));var rp=require('request-promise');var moment=require(_0x2a28('0x3'));var BPromise=require(_0x2a28('0x4'));var Mustache=require(_0x2a28('0x5'));var util=require(_0x2a28('0x6'));var path=require(_0x2a28('0x7'));var sox=require('sox');var csv=require(_0x2a28('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a28('0x9'));var _=require(_0x2a28('0xa'));var squel=require(_0x2a28('0xb'));var crypto=require(_0x2a28('0xc'));var jsforce=require(_0x2a28('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a28('0x8'));var querystring=require(_0x2a28('0xe'));var Papa=require(_0x2a28('0xf'));var Redis=require(_0x2a28('0x10'));var authService=require(_0x2a28('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a28('0x12'));var logger=require(_0x2a28('0x13'))(_0x2a28('0x14'));var utils=require('../../config/utils');var config=require(_0x2a28('0x15'));var licenseUtil=require(_0x2a28('0x16'));var db=require(_0x2a28('0x17'))['db'];function respondWithStatusCode(_0x52b081,_0x5438fa){_0x5438fa=_0x5438fa||0xcc;return function(_0x4f79c3){if(_0x4f79c3){return _0x52b081[_0x2a28('0x18')](_0x5438fa);}return _0x52b081['status'](_0x5438fa)[_0x2a28('0x19')]();};}function respondWithResult(_0x5ce628,_0x384436){_0x384436=_0x384436||0xc8;return function(_0x16991c){if(_0x16991c){return _0x5ce628[_0x2a28('0x1a')](_0x384436)[_0x2a28('0x1b')](_0x16991c);}};}function respondWithFilteredResult(_0x5b42c4,_0x1259eb){return function(_0x13d751){if(_0x13d751){var _0x246204=typeof _0x1259eb[_0x2a28('0x1c')]==='undefined'&&typeof _0x1259eb[_0x2a28('0x1d')]===_0x2a28('0x1e');var _0x177dbc=_0x13d751[_0x2a28('0x1f')];var _0x1c3d1b=_0x246204?0x0:_0x1259eb[_0x2a28('0x1c')];var _0x11a879=_0x246204?_0x13d751[_0x2a28('0x1f')]:_0x1259eb['offset']+_0x1259eb[_0x2a28('0x1d')];var _0x39bb1d;if(_0x11a879>=_0x177dbc){_0x11a879=_0x177dbc;_0x39bb1d=0xc8;}else{_0x39bb1d=0xce;}_0x5b42c4['status'](_0x39bb1d);return _0x5b42c4[_0x2a28('0x20')](_0x2a28('0x21'),_0x1c3d1b+'-'+_0x11a879+'/'+_0x177dbc)[_0x2a28('0x1b')](_0x13d751);}return null;};}function patchUpdates(_0x137b48){return function(_0x1f4722){try{jsonpatch[_0x2a28('0x22')](_0x1f4722,_0x137b48,!![]);}catch(_0x93aa88){return BPromise[_0x2a28('0x23')](_0x93aa88);}return _0x1f4722[_0x2a28('0x24')]();};}function saveUpdates(_0x4f547b,_0x4906aa){return function(_0x31adbb){if(_0x31adbb){return _0x31adbb[_0x2a28('0x25')](_0x4f547b)[_0x2a28('0x26')](function(_0x4f1539){return _0x4f1539;});}return null;};}function removeEntity(_0x292473,_0x1e0583){return function(_0x555c70){if(_0x555c70){return _0x555c70[_0x2a28('0x27')]()[_0x2a28('0x26')](function(){var _0x595707=_0x555c70[_0x2a28('0x28')]({'plain':!![]});var _0xbdb16c=_0x2a28('0x29');return db['UserProfileResource'][_0x2a28('0x27')]({'where':{'type':_0xbdb16c,'resourceId':_0x595707['id']}})[_0x2a28('0x26')](function(){return _0x555c70;});})[_0x2a28('0x26')](function(){_0x292473[_0x2a28('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39b6ea,_0x24f5b1){return function(_0x24d628){if(!_0x24d628){_0x39b6ea[_0x2a28('0x18')](0x194);}return _0x24d628;};}function handleError(_0x26fcbe,_0x29a588){_0x29a588=_0x29a588||0x1f4;return function(_0x4fcec5){logger[_0x2a28('0x2a')](_0x4fcec5[_0x2a28('0x2b')]);if(_0x4fcec5['name']){delete _0x4fcec5[_0x2a28('0x2c')];}_0x26fcbe[_0x2a28('0x1a')](_0x29a588)[_0x2a28('0x2d')](_0x4fcec5);};}exports['index']=function(_0x872e95,_0x214977){var _0x3e394c={},_0x225052={},_0x41abd7={'count':0x0,'rows':[]};var _0x45389c=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x3d0f3e){return{'name':_0x3d0f3e['fieldName'],'type':_0x3d0f3e[_0x2a28('0x2e')][_0x2a28('0x2f')]};});_0x225052[_0x2a28('0x30')]=_[_0x2a28('0x31')](_0x45389c,'name');_0x225052[_0x2a28('0x32')]=_['keys'](_0x872e95['query']);_0x225052[_0x2a28('0x33')]=_['intersection'](_0x225052[_0x2a28('0x30')],_0x225052[_0x2a28('0x32')]);_0x3e394c[_0x2a28('0x34')]=_['intersection'](_0x225052[_0x2a28('0x30')],qs[_0x2a28('0x35')](_0x872e95['query'][_0x2a28('0x35')]));_0x3e394c[_0x2a28('0x34')]=_0x3e394c[_0x2a28('0x34')][_0x2a28('0x36')]?_0x3e394c['attributes']:_0x225052[_0x2a28('0x30')];if(!_0x872e95[_0x2a28('0x32')][_0x2a28('0x37')](_0x2a28('0x38'))){_0x3e394c[_0x2a28('0x1d')]=qs['limit'](_0x872e95[_0x2a28('0x32')][_0x2a28('0x1d')]);_0x3e394c[_0x2a28('0x1c')]=qs['offset'](_0x872e95[_0x2a28('0x32')][_0x2a28('0x1c')]);}_0x3e394c[_0x2a28('0x39')]=qs[_0x2a28('0x3a')](_0x872e95[_0x2a28('0x32')][_0x2a28('0x3a')]);_0x3e394c[_0x2a28('0x3b')]=qs['filters'](_[_0x2a28('0x3c')](_0x872e95[_0x2a28('0x32')],_0x225052[_0x2a28('0x33')]),_0x45389c);if(_0x872e95['query'][_0x2a28('0x3d')]){_0x3e394c[_0x2a28('0x3b')]=_[_0x2a28('0x3e')](_0x3e394c[_0x2a28('0x3b')],{'$or':_['map'](_0x45389c,function(_0x6326f9){if(_0x6326f9[_0x2a28('0x2e')]!==_0x2a28('0x3f')){var _0x45bb81={};_0x45bb81[_0x6326f9[_0x2a28('0x2c')]]={'$like':'%'+_0x872e95['query'][_0x2a28('0x3d')]+'%'};return _0x45bb81;}})});}_0x3e394c=_['merge']({},_0x3e394c,_0x872e95['options']);var _0x3cd1da={'where':_0x3e394c[_0x2a28('0x3b')]};return db[_0x2a28('0x40')]['count'](_0x3cd1da)[_0x2a28('0x26')](function(_0x29ba57){_0x41abd7[_0x2a28('0x1f')]=_0x29ba57;if(_0x872e95[_0x2a28('0x32')]['includeAll']){_0x3e394c[_0x2a28('0x41')]=[{'all':!![]}];}return db[_0x2a28('0x40')][_0x2a28('0x42')](_0x3e394c);})[_0x2a28('0x26')](function(_0x50845e){_0x41abd7[_0x2a28('0x43')]=_0x50845e;return _0x41abd7;})[_0x2a28('0x26')](respondWithFilteredResult(_0x214977,_0x3e394c))[_0x2a28('0x44')](handleError(_0x214977,null));};exports['show']=function(_0x577f04,_0x405b8b){var _0x1e9c9f={'raw':![],'where':{'id':_0x577f04[_0x2a28('0x45')]['id']}},_0x15027c={};_0x15027c[_0x2a28('0x30')]=_[_0x2a28('0x46')](db[_0x2a28('0x40')]['rawAttributes']);_0x15027c[_0x2a28('0x32')]=_['keys'](_0x577f04[_0x2a28('0x32')]);_0x15027c[_0x2a28('0x33')]=_[_0x2a28('0x47')](_0x15027c[_0x2a28('0x30')],_0x15027c[_0x2a28('0x32')]);_0x1e9c9f['attributes']=_['intersection'](_0x15027c[_0x2a28('0x30')],qs[_0x2a28('0x35')](_0x577f04[_0x2a28('0x32')][_0x2a28('0x35')]));_0x1e9c9f[_0x2a28('0x34')]=_0x1e9c9f[_0x2a28('0x34')][_0x2a28('0x36')]?_0x1e9c9f['attributes']:_0x15027c[_0x2a28('0x30')];if(_0x577f04['query'][_0x2a28('0x48')]){_0x1e9c9f[_0x2a28('0x41')]=[{'all':!![]}];}_0x1e9c9f=_[_0x2a28('0x3e')]({},_0x1e9c9f,_0x577f04[_0x2a28('0x49')]);return db['JscriptyProject'][_0x2a28('0x4a')](_0x1e9c9f)[_0x2a28('0x26')](handleEntityNotFound(_0x405b8b,null))['then'](respondWithResult(_0x405b8b,null))['catch'](handleError(_0x405b8b,null));};exports[_0x2a28('0x4b')]=function(_0x412fa5,_0x32e939){return db[_0x2a28('0x40')]['create'](_0x412fa5[_0x2a28('0x4c')],{})['then'](function(_0xebc294){var _0xf8248b=_0x412fa5['user'][_0x2a28('0x28')]({'plain':!![]});if(!_0xf8248b)throw new Error(_0x2a28('0x4d'));if(_0xf8248b[_0x2a28('0x4e')]==='user'){var _0x5347ae=_0xebc294[_0x2a28('0x28')]({'plain':!![]});var _0x2e6e0d='Projects';return db[_0x2a28('0x4f')][_0x2a28('0x4a')]({'where':{'name':_0x2e6e0d,'userProfileId':_0xf8248b[_0x2a28('0x50')]},'raw':!![]})['then'](function(_0x51abf5){if(_0x51abf5&&_0x51abf5[_0x2a28('0x51')]===0x0){return db[_0x2a28('0x52')][_0x2a28('0x4b')]({'name':_0x5347ae[_0x2a28('0x2c')],'resourceId':_0x5347ae['id'],'type':_0x51abf5[_0x2a28('0x2c')],'sectionId':_0x51abf5['id']},{})['then'](function(){return _0xebc294;});}else{return _0xebc294;}})['catch'](function(_0x36b201){logger[_0x2a28('0x2a')](_0x2a28('0x53'),_0x36b201);throw _0x36b201;});}return _0xebc294;})['then'](respondWithResult(_0x32e939,0xc9))[_0x2a28('0x44')](handleError(_0x32e939,null));};exports[_0x2a28('0x54')]=function(_0x4f4d40,_0x685a59){var _0x400de4={'where':{'id':_0x4f4d40['params']['id']}},_0x23df13={};_0x23df13[_0x2a28('0x30')]=_['keys'](db[_0x2a28('0x40')][_0x2a28('0x55')]);_0x400de4[_0x2a28('0x34')]=_[_0x2a28('0x47')](_0x23df13[_0x2a28('0x30')],qs['fields'](_0x4f4d40[_0x2a28('0x32')][_0x2a28('0x35')]));_0x400de4['attributes']=_0x400de4[_0x2a28('0x34')]['length']?_0x400de4[_0x2a28('0x34')]:_0x23df13[_0x2a28('0x30')];if(_0x4f4d40[_0x2a28('0x32')][_0x2a28('0x48')]){_0x400de4['include']=[{'all':!![]}];}_0x400de4=_[_0x2a28('0x3e')]({},_0x400de4,_0x4f4d40[_0x2a28('0x49')]);return db[_0x2a28('0x40')]['find'](_0x400de4)[_0x2a28('0x26')](handleEntityNotFound(_0x685a59,null))['then'](function(_0x11cc4d){if(_0x11cc4d){var _0x3a8036=_0x11cc4d['get']({'plain':!![]});_0x3a8036=qs[_0x2a28('0x56')](_0x3a8036,['id',_0x2a28('0x57'),_0x2a28('0x58')]);_0x4f4d40[_0x2a28('0x4c')]=_[_0x2a28('0x56')](_0x4f4d40['body'],['id',_0x2a28('0x57'),_0x2a28('0x58')]);return db[_0x2a28('0x40')][_0x2a28('0x4b')](_[_0x2a28('0x3e')](_0x3a8036,_0x4f4d40[_0x2a28('0x4c')]),{'include':_0x4f4d40[_0x2a28('0x32')][_0x2a28('0x48')]?[{'all':!![]}]:undefined})[_0x2a28('0x26')](function(_0x700958){var _0xa54986=_0x4f4d40[_0x2a28('0x59')][_0x2a28('0x28')]({'plain':!![]});if(!_0xa54986)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa54986[_0x2a28('0x4e')]===_0x2a28('0x59')){var _0x5aac83=_0x700958[_0x2a28('0x28')]({'plain':!![]});var _0x22848a=_0x2a28('0x29');return db[_0x2a28('0x4f')][_0x2a28('0x4a')]({'where':{'name':_0x22848a,'userProfileId':_0xa54986['userProfileId']},'raw':!![]})[_0x2a28('0x26')](function(_0x3a371a){if(_0x3a371a&&_0x3a371a[_0x2a28('0x51')]===0x0){return db['UserProfileResource'][_0x2a28('0x4b')]({'name':_0x5aac83[_0x2a28('0x2c')],'resourceId':_0x5aac83['id'],'type':_0x3a371a[_0x2a28('0x2c')],'sectionId':_0x3a371a['id']},{})['then'](function(){return _0x700958;});}else{return _0x700958;}})[_0x2a28('0x44')](function(_0x376f22){logger['error'](_0x2a28('0x53'),_0x376f22);throw _0x376f22;});}return _0x700958;});}})[_0x2a28('0x26')](respondWithResult(_0x685a59,0xc9))['catch'](handleError(_0x685a59,null));};exports[_0x2a28('0x25')]=function(_0x312be8,_0x41d66b){if(_0x312be8[_0x2a28('0x4c')]['id']){delete _0x312be8[_0x2a28('0x4c')]['id'];}return db['JscriptyProject'][_0x2a28('0x4a')]({'where':{'id':_0x312be8['params']['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x41d66b,null))[_0x2a28('0x26')](saveUpdates(_0x312be8[_0x2a28('0x4c')],null))[_0x2a28('0x26')](respondWithResult(_0x41d66b,null))[_0x2a28('0x44')](handleError(_0x41d66b,null));};exports[_0x2a28('0x27')]=function(_0x4c55ff,_0x28dae6){return db['JscriptyProject'][_0x2a28('0x4a')]({'where':{'id':_0x4c55ff[_0x2a28('0x45')]['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x28dae6,null))[_0x2a28('0x26')](removeEntity(_0x28dae6,null))[_0x2a28('0x44')](handleError(_0x28dae6,null));};exports[_0x2a28('0x5a')]=function(_0x25db3f,_0x103b6f,_0x16b7d9){var _0x2632c2={'raw':!![],'where':{}};var _0x37d980={};var _0xdb908a={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x25db3f[_0x2a28('0x45')]['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x103b6f,null))['then'](function(_0x3762da){if(_0x3762da){_0x37d980[_0x2a28('0x30')]=_[_0x2a28('0x46')](db[_0x2a28('0x5b')][_0x2a28('0x55')]);_0x37d980['query']=_[_0x2a28('0x46')](_0x25db3f[_0x2a28('0x32')]);_0x37d980[_0x2a28('0x33')]=_[_0x2a28('0x47')](_0x37d980[_0x2a28('0x30')],_0x37d980[_0x2a28('0x32')]);_0x2632c2['attributes']=_['intersection'](_0x37d980[_0x2a28('0x30')],qs[_0x2a28('0x35')](_0x25db3f['query']['fields']));_0x2632c2[_0x2a28('0x34')]=_0x2632c2[_0x2a28('0x34')][_0x2a28('0x36')]?_0x2632c2[_0x2a28('0x34')]:_0x37d980[_0x2a28('0x30')];if(!_0x25db3f[_0x2a28('0x32')][_0x2a28('0x37')](_0x2a28('0x38'))){_0x2632c2['limit']=qs[_0x2a28('0x1d')](_0x25db3f[_0x2a28('0x32')]['limit']);_0x2632c2[_0x2a28('0x1c')]=qs[_0x2a28('0x1c')](_0x25db3f[_0x2a28('0x32')][_0x2a28('0x1c')]);}_0x2632c2[_0x2a28('0x39')]=qs[_0x2a28('0x3a')](_0x25db3f[_0x2a28('0x32')][_0x2a28('0x3a')]);_0x2632c2['where']=qs[_0x2a28('0x33')](_['pick'](_0x25db3f['query'],_0x37d980[_0x2a28('0x33')]));_0x2632c2[_0x2a28('0x3b')][_0x2a28('0x5c')]=_0x3762da['id'];if(_0x25db3f[_0x2a28('0x32')][_0x2a28('0x3d')]){_0x2632c2[_0x2a28('0x3b')]=_[_0x2a28('0x3e')](_0x2632c2[_0x2a28('0x3b')],{'$or':_['map'](_0x2632c2['attributes'],function(_0x8878bf){var _0x2f0c83={};_0x2f0c83[_0x8878bf]={'$like':'%'+_0x25db3f[_0x2a28('0x32')][_0x2a28('0x3d')]+'%'};return _0x2f0c83;})});}_0x2632c2=_[_0x2a28('0x3e')]({},_0x2632c2,_0x25db3f[_0x2a28('0x49')]);return db[_0x2a28('0x5b')]['count']({'where':_0x2632c2['where']})[_0x2a28('0x26')](function(_0x379ce3){_0xdb908a[_0x2a28('0x1f')]=_0x379ce3;if(_0x25db3f[_0x2a28('0x32')]['includeAll']){_0x2632c2['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2a28('0x42')](_0x2632c2);})[_0x2a28('0x26')](function(_0xdbe497){_0xdb908a[_0x2a28('0x43')]=_0xdbe497;return _0xdb908a;});}})[_0x2a28('0x26')](respondWithFilteredResult(_0x103b6f,_0x2632c2))['catch'](handleError(_0x103b6f,null));};exports[_0x2a28('0x5d')]=function(_0x142ee1,_0x43db5f,_0x2156cb){var _0x592185={'raw':!![],'where':{}};var _0x3f5119={};var _0x35eb15={'count':0x0,'rows':[]};return db[_0x2a28('0x40')]['findOne']({'where':{'id':_0x142ee1['params']['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x43db5f,null))[_0x2a28('0x26')](function(_0xc9b374){if(_0xc9b374){_0x3f5119['model']=_[_0x2a28('0x46')](db[_0x2a28('0x5e')]['rawAttributes']);_0x3f5119['query']=_['keys'](_0x142ee1[_0x2a28('0x32')]);_0x3f5119[_0x2a28('0x33')]=_[_0x2a28('0x47')](_0x3f5119[_0x2a28('0x30')],_0x3f5119[_0x2a28('0x32')]);_0x592185[_0x2a28('0x34')]=_['intersection'](_0x3f5119['model'],qs[_0x2a28('0x35')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x35')]));_0x592185[_0x2a28('0x34')]=_0x592185[_0x2a28('0x34')][_0x2a28('0x36')]?_0x592185['attributes']:_0x3f5119[_0x2a28('0x30')];if(!_0x142ee1[_0x2a28('0x32')][_0x2a28('0x37')](_0x2a28('0x38'))){_0x592185['limit']=qs[_0x2a28('0x1d')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x1d')]);_0x592185[_0x2a28('0x1c')]=qs[_0x2a28('0x1c')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x1c')]);}_0x592185[_0x2a28('0x39')]=qs[_0x2a28('0x3a')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x3a')]);_0x592185[_0x2a28('0x3b')]=qs[_0x2a28('0x33')](_[_0x2a28('0x3c')](_0x142ee1[_0x2a28('0x32')],_0x3f5119[_0x2a28('0x33')]));_0x592185[_0x2a28('0x3b')]['ProjectId']=_0xc9b374['id'];if(_0x142ee1[_0x2a28('0x32')]['filter']){_0x592185[_0x2a28('0x3b')]=_['merge'](_0x592185[_0x2a28('0x3b')],{'$or':_['map'](_0x592185[_0x2a28('0x34')],function(_0x2f9b13){var _0x40816f={};_0x40816f[_0x2f9b13]={'$like':'%'+_0x142ee1[_0x2a28('0x32')][_0x2a28('0x3d')]+'%'};return _0x40816f;})});}_0x592185=_[_0x2a28('0x3e')]({},_0x592185,_0x142ee1[_0x2a28('0x49')]);return db[_0x2a28('0x5e')][_0x2a28('0x1f')]({'where':_0x592185[_0x2a28('0x3b')]})[_0x2a28('0x26')](function(_0x276e92){_0x35eb15['count']=_0x276e92;if(_0x142ee1['query'][_0x2a28('0x48')]){_0x592185['include']=[{'all':!![]}];}return db[_0x2a28('0x5e')][_0x2a28('0x42')](_0x592185);})[_0x2a28('0x26')](function(_0x56d5c6){_0x35eb15[_0x2a28('0x43')]=_0x56d5c6;return _0x35eb15;});}})[_0x2a28('0x26')](respondWithFilteredResult(_0x43db5f,_0x592185))[_0x2a28('0x44')](handleError(_0x43db5f,null));};function char(_0x14074b){return _0x2a28('0x5f')===typeof _0x14074b?String[_0x2a28('0x60')][_0x2a28('0x22')](null,arguments):_0x14074b;}function needsEncapsulation(_0x35c415){return!!_0x35c415&&(_0x35c415[_0x2a28('0x61')]()['indexOf'](char(0xd))>=0x0||_0x35c415[_0x2a28('0x61')]()[_0x2a28('0x62')](char(0xa))>=0x0||_0x35c415['toString']()['indexOf'](char(0x2c))>=0x0||_0x35c415[_0x2a28('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x354352){var _0x31d8d2=char(0x22),_0x3c7e0d='\x5c'+char(0x22),_0x5e57bc=_0x354352['toString']()[_0x2a28('0x63')](new RegExp(_0x31d8d2,'g'),_0x3c7e0d);return _0x31d8d2+_0x5e57bc+_0x31d8d2;}exports[_0x2a28('0x64')]=function(_0xe305a7,_0x1a3d76,_0x1c0caa){var _0x36686e,_0x39ea0c;var _0x465b32={'where':{'ProjectId':_0xe305a7[_0x2a28('0x45')]['id']}};if(_0xe305a7[_0x2a28('0x32')][_0x2a28('0x65')]){_0x465b32[_0x2a28('0x3b')][_0x2a28('0x66')]=JSON[_0x2a28('0x67')](_0xe305a7[_0x2a28('0x32')]['startTime']);}return db[_0x2a28('0x5b')][_0x2a28('0x42')](_0x465b32)[_0x2a28('0x26')](handleEntityNotFound(_0x1a3d76,null))['then'](function(_0x547c22){if(_0x547c22){_0x36686e=_0x547c22;return db[_0x2a28('0x68')][_0x2a28('0x42')]({'where':{'SessionId':{'$in':_[_0x2a28('0x31')](_0x36686e,'id')},'ProjectId':_0xe305a7[_0x2a28('0x45')]['id']},'order':_0x2a28('0x69')});}})[_0x2a28('0x26')](handleEntityNotFound(_0x1a3d76,null))[_0x2a28('0x26')](function(_0x2b5aac){if(_0x2b5aac){_0x39ea0c=_0x2b5aac;var _0x3c3282={};for(var _0x4426d0=0x0,_0x2fd680=_0x39ea0c[_0x2a28('0x36')];_0x4426d0<_0x2fd680;_0x4426d0++){if(!_0x3c3282['hasOwnProperty'](_0x39ea0c[_0x4426d0]['questionId'])){_0x3c3282[_0x39ea0c[_0x4426d0][_0x2a28('0x6a')]]=needsEncapsulation(_0x39ea0c[_0x4426d0][_0x2a28('0x6b')])?encapsulate(_0x39ea0c[_0x4426d0][_0x2a28('0x6b')]):_0x39ea0c[_0x4426d0][_0x2a28('0x6b')];}}var _0x51c374=[],_0xac91be={};for(var _0x31156b=0x0,_0x32fe2a=_0x36686e[_0x2a28('0x36')];_0x31156b<_0x32fe2a;_0x31156b++){_0xac91be={'ProjectId':_0xe305a7[_0x2a28('0x45')]['id'],'SessionId':_0x36686e[_0x31156b]['id'],'StartTime':moment(_0x36686e[_0x31156b][_0x2a28('0x66')])[_0x2a28('0x6c')](_0x2a28('0x6d'))};for(var _0x4a2842=0x0,_0x57527a=_0x39ea0c[_0x2a28('0x36')];_0x4a2842<_0x57527a;_0x4a2842++){if(_0x39ea0c[_0x4a2842][_0x2a28('0x6e')]==_0x36686e[_0x31156b]['id']&&_0x3c3282[_0x2a28('0x37')](_0x39ea0c[_0x4a2842][_0x2a28('0x6a')])){_0xac91be[_0x3c3282[_0x39ea0c[_0x4a2842][_0x2a28('0x6a')]]]=_0x39ea0c[_0x4a2842][_0x2a28('0x6f')];}}for(var _0x52584f in _0x3c3282){if(!_0xac91be[_0x2a28('0x37')](_0x3c3282[_0x52584f])){_0xac91be[_0x3c3282[_0x52584f]]=null;}}_0x51c374[_0x2a28('0x70')](_0xac91be);}return _0x51c374;}})[_0x2a28('0x26')](function(_0x4f8e92){if(!_[_0x2a28('0x71')](_0x4f8e92)){var _0x4f6182=toCsv(_0x4f8e92);var _0x1e2591=Date[_0x2a28('0x72')]();fs['writeFileSync'](util[_0x2a28('0x6c')](_0x2a28('0x73'),_0xe305a7['params']['id'],_0x1e2591),_0x4f6182);_0x1a3d76[_0x2a28('0x74')]('Content-disposition',_0x2a28('0x75')+util[_0x2a28('0x6c')](_0x2a28('0x76'),_0xe305a7[_0x2a28('0x45')]['id'],_0x1e2591));_0x1a3d76['setHeader'](_0x2a28('0x77'),_0x2a28('0x78'));return _0x1a3d76[_0x2a28('0x79')](util[_0x2a28('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xe305a7['params']['id'],_0x1e2591));}else{return _0x1a3d76[_0x2a28('0x18')](0xcc);}})[_0x2a28('0x44')](handleError(_0x1a3d76,null));}; \ No newline at end of file +var _0x056b=['merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','body','getSessions','hasOwnProperty','ProjectId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','nolimit','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','Projects','error','stack','name','index','map','JscriptyProject','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x056b,0xb6));var _0xb056=function(_0x120ab8,_0x577eb9){_0x120ab8=_0x120ab8-0x0;var _0x597e51=_0x056b[_0x120ab8];return _0x597e51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];function respondWithStatusCode(_0x5d8306,_0x49c5ec){_0x49c5ec=_0x49c5ec||0xcc;return function(_0xf3e80f){if(_0xf3e80f){return _0x5d8306[_0xb056('0x1b')](_0x49c5ec);}return _0x5d8306['status'](_0x49c5ec)[_0xb056('0x1c')]();};}function respondWithResult(_0x34611b,_0xf1c2e9){_0xf1c2e9=_0xf1c2e9||0xc8;return function(_0x1197e5){if(_0x1197e5){return _0x34611b[_0xb056('0x1d')](_0xf1c2e9)[_0xb056('0x1e')](_0x1197e5);}};}function respondWithFilteredResult(_0x179e49,_0x4b838e){return function(_0x162146){if(_0x162146){var _0x43565e=typeof _0x4b838e[_0xb056('0x1f')]===_0xb056('0x20')&&typeof _0x4b838e['limit']===_0xb056('0x20');var _0x4e501a=_0x162146[_0xb056('0x21')];var _0x311eb9=_0x43565e?0x0:_0x4b838e['offset'];var _0x29c77e=_0x43565e?_0x162146['count']:_0x4b838e[_0xb056('0x1f')]+_0x4b838e[_0xb056('0x22')];var _0x5e4bd9;if(_0x29c77e>=_0x4e501a){_0x29c77e=_0x4e501a;_0x5e4bd9=0xc8;}else{_0x5e4bd9=0xce;}_0x179e49[_0xb056('0x1d')](_0x5e4bd9);return _0x179e49['set'](_0xb056('0x23'),_0x311eb9+'-'+_0x29c77e+'/'+_0x4e501a)[_0xb056('0x1e')](_0x162146);}return null;};}function patchUpdates(_0x457b54){return function(_0x33dd35){try{jsonpatch['apply'](_0x33dd35,_0x457b54,!![]);}catch(_0x1db585){return BPromise['reject'](_0x1db585);}return _0x33dd35[_0xb056('0x24')]();};}function saveUpdates(_0x5dea90,_0x324ce6){return function(_0x40ac2d){if(_0x40ac2d){return _0x40ac2d[_0xb056('0x25')](_0x5dea90)[_0xb056('0x26')](function(_0x36e539){return _0x36e539;});}return null;};}function removeEntity(_0x4bb6c0,_0x4e66c3){return function(_0x1016da){if(_0x1016da){return _0x1016da[_0xb056('0x27')]()[_0xb056('0x26')](function(){var _0x1bd6ac=_0x1016da['get']({'plain':!![]});var _0x44a14f=_0xb056('0x28');return db['UserProfileResource'][_0xb056('0x27')]({'where':{'type':_0x44a14f,'resourceId':_0x1bd6ac['id']}})[_0xb056('0x26')](function(){return _0x1016da;});})[_0xb056('0x26')](function(){_0x4bb6c0[_0xb056('0x1d')](0xcc)[_0xb056('0x1c')]();});}};}function handleEntityNotFound(_0x4024d7,_0x211898){return function(_0x2042f1){if(!_0x2042f1){_0x4024d7['sendStatus'](0x194);}return _0x2042f1;};}function handleError(_0x29fbc1,_0x51b06b){_0x51b06b=_0x51b06b||0x1f4;return function(_0x3d83d3){logger[_0xb056('0x29')](_0x3d83d3[_0xb056('0x2a')]);if(_0x3d83d3['name']){delete _0x3d83d3[_0xb056('0x2b')];}_0x29fbc1[_0xb056('0x1d')](_0x51b06b)['send'](_0x3d83d3);};}exports[_0xb056('0x2c')]=function(_0x43aa63,_0x329eaa){var _0x1fad05={},_0x3ce984={},_0x4ebca5={'count':0x0,'rows':[]};var _0x87f31e=_[_0xb056('0x2d')](db[_0xb056('0x2e')][_0xb056('0x2f')],function(_0x103482){return{'name':_0x103482['fieldName'],'type':_0x103482[_0xb056('0x30')][_0xb056('0x31')]};});_0x3ce984[_0xb056('0x32')]=_[_0xb056('0x2d')](_0x87f31e,_0xb056('0x2b'));_0x3ce984[_0xb056('0x33')]=_[_0xb056('0x34')](_0x43aa63[_0xb056('0x33')]);_0x3ce984['filters']=_[_0xb056('0x35')](_0x3ce984['model'],_0x3ce984[_0xb056('0x33')]);_0x1fad05['attributes']=_['intersection'](_0x3ce984[_0xb056('0x32')],qs[_0xb056('0x36')](_0x43aa63[_0xb056('0x33')][_0xb056('0x36')]));_0x1fad05[_0xb056('0x37')]=_0x1fad05[_0xb056('0x37')][_0xb056('0x38')]?_0x1fad05['attributes']:_0x3ce984[_0xb056('0x32')];if(!_0x43aa63[_0xb056('0x33')]['hasOwnProperty']('nolimit')){_0x1fad05[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x43aa63[_0xb056('0x33')]['limit']);_0x1fad05[_0xb056('0x1f')]=qs[_0xb056('0x1f')](_0x43aa63[_0xb056('0x33')][_0xb056('0x1f')]);}_0x1fad05[_0xb056('0x39')]=qs[_0xb056('0x3a')](_0x43aa63[_0xb056('0x33')][_0xb056('0x3a')]);_0x1fad05[_0xb056('0x3b')]=qs[_0xb056('0x3c')](_[_0xb056('0x3d')](_0x43aa63[_0xb056('0x33')],_0x3ce984['filters']),_0x87f31e);if(_0x43aa63[_0xb056('0x33')]['filter']){_0x1fad05[_0xb056('0x3b')]=_[_0xb056('0x3e')](_0x1fad05[_0xb056('0x3b')],{'$or':_[_0xb056('0x2d')](_0x87f31e,function(_0x460f28){if(_0x460f28[_0xb056('0x30')]!==_0xb056('0x3f')){var _0x42b54f={};_0x42b54f[_0x460f28['name']]={'$like':'%'+_0x43aa63[_0xb056('0x33')][_0xb056('0x40')]+'%'};return _0x42b54f;}})});}_0x1fad05=_[_0xb056('0x3e')]({},_0x1fad05,_0x43aa63[_0xb056('0x41')]);var _0x134db7={'where':_0x1fad05['where']};return db[_0xb056('0x2e')][_0xb056('0x21')](_0x134db7)[_0xb056('0x26')](function(_0x216f72){_0x4ebca5[_0xb056('0x21')]=_0x216f72;if(_0x43aa63[_0xb056('0x33')]['includeAll']){_0x1fad05[_0xb056('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0xb056('0x43')](_0x1fad05);})[_0xb056('0x26')](function(_0x21d98e){_0x4ebca5[_0xb056('0x44')]=_0x21d98e;return _0x4ebca5;})[_0xb056('0x26')](respondWithFilteredResult(_0x329eaa,_0x1fad05))[_0xb056('0x45')](handleError(_0x329eaa,null));};exports[_0xb056('0x46')]=function(_0x248819,_0x2c8b61){var _0x149341={'raw':![],'where':{'id':_0x248819[_0xb056('0x47')]['id']}},_0x4fa3c5={};_0x4fa3c5[_0xb056('0x32')]=_[_0xb056('0x34')](db['JscriptyProject'][_0xb056('0x2f')]);_0x4fa3c5[_0xb056('0x33')]=_['keys'](_0x248819['query']);_0x4fa3c5[_0xb056('0x3c')]=_[_0xb056('0x35')](_0x4fa3c5[_0xb056('0x32')],_0x4fa3c5[_0xb056('0x33')]);_0x149341['attributes']=_['intersection'](_0x4fa3c5['model'],qs['fields'](_0x248819['query']['fields']));_0x149341[_0xb056('0x37')]=_0x149341['attributes'][_0xb056('0x38')]?_0x149341[_0xb056('0x37')]:_0x4fa3c5[_0xb056('0x32')];if(_0x248819[_0xb056('0x33')][_0xb056('0x48')]){_0x149341[_0xb056('0x42')]=[{'all':!![]}];}_0x149341=_[_0xb056('0x3e')]({},_0x149341,_0x248819[_0xb056('0x41')]);return db['JscriptyProject'][_0xb056('0x49')](_0x149341)[_0xb056('0x26')](handleEntityNotFound(_0x2c8b61,null))['then'](respondWithResult(_0x2c8b61,null))[_0xb056('0x45')](handleError(_0x2c8b61,null));};exports[_0xb056('0x4a')]=function(_0xe40439,_0x2f2d22){return db[_0xb056('0x2e')][_0xb056('0x4a')](_0xe40439['body'],{})[_0xb056('0x26')](function(_0x5e2224){var _0x132268=_0xe40439[_0xb056('0x4b')][_0xb056('0x4c')]({'plain':!![]});if(!_0x132268)throw new Error(_0xb056('0x4d'));if(_0x132268[_0xb056('0x4e')]===_0xb056('0x4b')){var _0x2b6733=_0x5e2224[_0xb056('0x4c')]({'plain':!![]});var _0x5a3bbf=_0xb056('0x28');return db[_0xb056('0x4f')][_0xb056('0x49')]({'where':{'name':_0x5a3bbf,'userProfileId':_0x132268[_0xb056('0x50')]},'raw':!![]})[_0xb056('0x26')](function(_0x35acab){if(_0x35acab&&_0x35acab[_0xb056('0x51')]===0x0){return db[_0xb056('0x52')]['create']({'name':_0x2b6733[_0xb056('0x2b')],'resourceId':_0x2b6733['id'],'type':_0x35acab[_0xb056('0x2b')],'sectionId':_0x35acab['id']},{})[_0xb056('0x26')](function(){return _0x5e2224;});}else{return _0x5e2224;}})[_0xb056('0x45')](function(_0x1a5170){logger[_0xb056('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a5170);throw _0x1a5170;});}return _0x5e2224;})[_0xb056('0x26')](respondWithResult(_0x2f2d22,0xc9))[_0xb056('0x45')](handleError(_0x2f2d22,null));};exports[_0xb056('0x53')]=function(_0x536d85,_0x37c64c){var _0x5119c0={'where':{'id':_0x536d85[_0xb056('0x47')]['id']}},_0x3ad85e={};_0x3ad85e[_0xb056('0x32')]=_[_0xb056('0x34')](db['JscriptyProject'][_0xb056('0x2f')]);_0x5119c0[_0xb056('0x37')]=_['intersection'](_0x3ad85e[_0xb056('0x32')],qs[_0xb056('0x36')](_0x536d85[_0xb056('0x33')][_0xb056('0x36')]));_0x5119c0[_0xb056('0x37')]=_0x5119c0['attributes'][_0xb056('0x38')]?_0x5119c0[_0xb056('0x37')]:_0x3ad85e[_0xb056('0x32')];if(_0x536d85[_0xb056('0x33')][_0xb056('0x48')]){_0x5119c0[_0xb056('0x42')]=[{'all':!![]}];}_0x5119c0=_[_0xb056('0x3e')]({},_0x5119c0,_0x536d85[_0xb056('0x41')]);return db[_0xb056('0x2e')][_0xb056('0x49')](_0x5119c0)[_0xb056('0x26')](handleEntityNotFound(_0x37c64c,null))[_0xb056('0x26')](function(_0x2ab5a8){if(_0x2ab5a8){var _0x3f9964=_0x2ab5a8[_0xb056('0x4c')]({'plain':!![]});_0x3f9964=qs[_0xb056('0x54')](_0x3f9964,['id',_0xb056('0x55'),_0xb056('0x56')]);_0x536d85[_0xb056('0x57')]=_[_0xb056('0x54')](_0x536d85[_0xb056('0x57')],['id','createdAt',_0xb056('0x56')]);return db[_0xb056('0x2e')][_0xb056('0x4a')](_[_0xb056('0x3e')](_0x3f9964,_0x536d85[_0xb056('0x57')]),{'include':_0x536d85[_0xb056('0x33')][_0xb056('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x5b03df){var _0x30441e=_0x536d85[_0xb056('0x4b')][_0xb056('0x4c')]({'plain':!![]});if(!_0x30441e)throw new Error(_0xb056('0x4d'));if(_0x30441e[_0xb056('0x4e')]==='user'){var _0x44e1e9=_0x5b03df[_0xb056('0x4c')]({'plain':!![]});var _0x7471b3=_0xb056('0x28');return db['UserProfileSection'][_0xb056('0x49')]({'where':{'name':_0x7471b3,'userProfileId':_0x30441e[_0xb056('0x50')]},'raw':!![]})[_0xb056('0x26')](function(_0x5e419e){if(_0x5e419e&&_0x5e419e[_0xb056('0x51')]===0x0){return db[_0xb056('0x52')][_0xb056('0x4a')]({'name':_0x44e1e9['name'],'resourceId':_0x44e1e9['id'],'type':_0x5e419e[_0xb056('0x2b')],'sectionId':_0x5e419e['id']},{})[_0xb056('0x26')](function(){return _0x5b03df;});}else{return _0x5b03df;}})[_0xb056('0x45')](function(_0x5bf8ce){logger[_0xb056('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bf8ce);throw _0x5bf8ce;});}return _0x5b03df;});}})[_0xb056('0x26')](respondWithResult(_0x37c64c,0xc9))[_0xb056('0x45')](handleError(_0x37c64c,null));};exports[_0xb056('0x25')]=function(_0x556a93,_0x45d347){if(_0x556a93[_0xb056('0x57')]['id']){delete _0x556a93['body']['id'];}return db[_0xb056('0x2e')][_0xb056('0x49')]({'where':{'id':_0x556a93[_0xb056('0x47')]['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x45d347,null))[_0xb056('0x26')](saveUpdates(_0x556a93['body'],null))['then'](respondWithResult(_0x45d347,null))[_0xb056('0x45')](handleError(_0x45d347,null));};exports['destroy']=function(_0x2d9b20,_0x5971dd){return db[_0xb056('0x2e')][_0xb056('0x49')]({'where':{'id':_0x2d9b20[_0xb056('0x47')]['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x5971dd,null))['then'](removeEntity(_0x5971dd,null))['catch'](handleError(_0x5971dd,null));};exports[_0xb056('0x58')]=function(_0x1e14e1,_0x3b3bbf,_0x21e16a){var _0x47e509={'raw':!![],'where':{}};var _0x2d2c20={};var _0x4d2233={'count':0x0,'rows':[]};return db[_0xb056('0x2e')]['findOne']({'where':{'id':_0x1e14e1[_0xb056('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b3bbf,null))[_0xb056('0x26')](function(_0x443a2e){if(_0x443a2e){_0x2d2c20[_0xb056('0x32')]=_[_0xb056('0x34')](db['JscriptySessionReport'][_0xb056('0x2f')]);_0x2d2c20['query']=_[_0xb056('0x34')](_0x1e14e1[_0xb056('0x33')]);_0x2d2c20[_0xb056('0x3c')]=_[_0xb056('0x35')](_0x2d2c20[_0xb056('0x32')],_0x2d2c20[_0xb056('0x33')]);_0x47e509[_0xb056('0x37')]=_[_0xb056('0x35')](_0x2d2c20[_0xb056('0x32')],qs[_0xb056('0x36')](_0x1e14e1[_0xb056('0x33')][_0xb056('0x36')]));_0x47e509['attributes']=_0x47e509['attributes'][_0xb056('0x38')]?_0x47e509['attributes']:_0x2d2c20[_0xb056('0x32')];if(!_0x1e14e1['query'][_0xb056('0x59')]('nolimit')){_0x47e509['limit']=qs['limit'](_0x1e14e1[_0xb056('0x33')]['limit']);_0x47e509['offset']=qs[_0xb056('0x1f')](_0x1e14e1[_0xb056('0x33')][_0xb056('0x1f')]);}_0x47e509['order']=qs['sort'](_0x1e14e1['query'][_0xb056('0x3a')]);_0x47e509[_0xb056('0x3b')]=qs[_0xb056('0x3c')](_[_0xb056('0x3d')](_0x1e14e1[_0xb056('0x33')],_0x2d2c20[_0xb056('0x3c')]));_0x47e509[_0xb056('0x3b')][_0xb056('0x5a')]=_0x443a2e['id'];if(_0x1e14e1[_0xb056('0x33')][_0xb056('0x40')]){_0x47e509[_0xb056('0x3b')]=_[_0xb056('0x3e')](_0x47e509[_0xb056('0x3b')],{'$or':_[_0xb056('0x2d')](_0x47e509['attributes'],function(_0x5def29){var _0x18feb4={};_0x18feb4[_0x5def29]={'$like':'%'+_0x1e14e1['query'][_0xb056('0x40')]+'%'};return _0x18feb4;})});}_0x47e509=_[_0xb056('0x3e')]({},_0x47e509,_0x1e14e1[_0xb056('0x41')]);return db[_0xb056('0x5b')]['count']({'where':_0x47e509['where']})[_0xb056('0x26')](function(_0x13a0f1){_0x4d2233[_0xb056('0x21')]=_0x13a0f1;if(_0x1e14e1['query']['includeAll']){_0x47e509[_0xb056('0x42')]=[{'all':!![]}];}return db[_0xb056('0x5b')]['findAll'](_0x47e509);})[_0xb056('0x26')](function(_0x456588){_0x4d2233[_0xb056('0x44')]=_0x456588;return _0x4d2233;});}})[_0xb056('0x26')](respondWithFilteredResult(_0x3b3bbf,_0x47e509))[_0xb056('0x45')](handleError(_0x3b3bbf,null));};exports[_0xb056('0x5c')]=function(_0xb96f3c,_0x27b31f,_0x141634){var _0x416d33={'raw':!![],'where':{}};var _0xfad362={};var _0x5a7a61={'count':0x0,'rows':[]};return db[_0xb056('0x2e')][_0xb056('0x5d')]({'where':{'id':_0xb96f3c[_0xb056('0x47')]['id']}})['then'](handleEntityNotFound(_0x27b31f,null))[_0xb056('0x26')](function(_0x4dc495){if(_0x4dc495){_0xfad362['model']=_[_0xb056('0x34')](db[_0xb056('0x5e')][_0xb056('0x2f')]);_0xfad362['query']=_['keys'](_0xb96f3c[_0xb056('0x33')]);_0xfad362[_0xb056('0x3c')]=_['intersection'](_0xfad362[_0xb056('0x32')],_0xfad362['query']);_0x416d33[_0xb056('0x37')]=_[_0xb056('0x35')](_0xfad362['model'],qs['fields'](_0xb96f3c[_0xb056('0x33')][_0xb056('0x36')]));_0x416d33['attributes']=_0x416d33[_0xb056('0x37')]['length']?_0x416d33['attributes']:_0xfad362[_0xb056('0x32')];if(!_0xb96f3c[_0xb056('0x33')][_0xb056('0x59')](_0xb056('0x5f'))){_0x416d33[_0xb056('0x22')]=qs[_0xb056('0x22')](_0xb96f3c['query'][_0xb056('0x22')]);_0x416d33['offset']=qs[_0xb056('0x1f')](_0xb96f3c[_0xb056('0x33')]['offset']);}_0x416d33[_0xb056('0x39')]=qs[_0xb056('0x3a')](_0xb96f3c['query'][_0xb056('0x3a')]);_0x416d33['where']=qs[_0xb056('0x3c')](_['pick'](_0xb96f3c[_0xb056('0x33')],_0xfad362[_0xb056('0x3c')]));_0x416d33['where'][_0xb056('0x5a')]=_0x4dc495['id'];if(_0xb96f3c['query'][_0xb056('0x40')]){_0x416d33[_0xb056('0x3b')]=_[_0xb056('0x3e')](_0x416d33[_0xb056('0x3b')],{'$or':_[_0xb056('0x2d')](_0x416d33[_0xb056('0x37')],function(_0x1bac84){var _0x3eb03c={};_0x3eb03c[_0x1bac84]={'$like':'%'+_0xb96f3c['query'][_0xb056('0x40')]+'%'};return _0x3eb03c;})});}_0x416d33=_['merge']({},_0x416d33,_0xb96f3c['options']);return db['JscriptyAnswerReport'][_0xb056('0x21')]({'where':_0x416d33[_0xb056('0x3b')]})[_0xb056('0x26')](function(_0x2811c4){_0x5a7a61['count']=_0x2811c4;if(_0xb96f3c[_0xb056('0x33')][_0xb056('0x48')]){_0x416d33[_0xb056('0x42')]=[{'all':!![]}];}return db[_0xb056('0x5e')][_0xb056('0x43')](_0x416d33);})['then'](function(_0x9257a8){_0x5a7a61[_0xb056('0x44')]=_0x9257a8;return _0x5a7a61;});}})[_0xb056('0x26')](respondWithFilteredResult(_0x27b31f,_0x416d33))['catch'](handleError(_0x27b31f,null));};function char(_0x526035){return'number'===typeof _0x526035?String['fromCharCode']['apply'](null,arguments):_0x526035;}function needsEncapsulation(_0x5021d2){return!!_0x5021d2&&(_0x5021d2[_0xb056('0x60')]()[_0xb056('0x61')](char(0xd))>=0x0||_0x5021d2[_0xb056('0x60')]()[_0xb056('0x61')](char(0xa))>=0x0||_0x5021d2[_0xb056('0x60')]()[_0xb056('0x61')](char(0x2c))>=0x0||_0x5021d2['toString']()[_0xb056('0x61')](char(0x22))>=0x0);}function encapsulate(_0x1c38f1){var _0x14158f=char(0x22),_0x3e4ba5='\x5c'+char(0x22),_0x1ff1e7=_0x1c38f1[_0xb056('0x60')]()[_0xb056('0x62')](new RegExp(_0x14158f,'g'),_0x3e4ba5);return _0x14158f+_0x1ff1e7+_0x14158f;}exports[_0xb056('0x63')]=function(_0x10ffb8,_0x239950,_0x4a184c){var _0x57c9d3,_0x5270c8;var _0x406887={'where':{'ProjectId':_0x10ffb8['params']['id']}};if(_0x10ffb8[_0xb056('0x33')][_0xb056('0x64')]){_0x406887[_0xb056('0x3b')][_0xb056('0x65')]=JSON[_0xb056('0x66')](_0x10ffb8[_0xb056('0x33')][_0xb056('0x64')]);}return db[_0xb056('0x5b')][_0xb056('0x43')](_0x406887)['then'](handleEntityNotFound(_0x239950,null))[_0xb056('0x26')](function(_0x141dbb){if(_0x141dbb){_0x57c9d3=_0x141dbb;return db[_0xb056('0x67')][_0xb056('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x57c9d3,'id')},'ProjectId':_0x10ffb8['params']['id']},'order':_0xb056('0x68')});}})[_0xb056('0x26')](handleEntityNotFound(_0x239950,null))[_0xb056('0x26')](function(_0x1a3666){if(_0x1a3666){_0x5270c8=_0x1a3666;var _0x8b923b={};for(var _0x8d8f12=0x0,_0x1b1800=_0x5270c8['length'];_0x8d8f12<_0x1b1800;_0x8d8f12++){if(!_0x8b923b[_0xb056('0x59')](_0x5270c8[_0x8d8f12]['questionId'])){_0x8b923b[_0x5270c8[_0x8d8f12][_0xb056('0x69')]]=needsEncapsulation(_0x5270c8[_0x8d8f12][_0xb056('0x6a')])?encapsulate(_0x5270c8[_0x8d8f12]['question']):_0x5270c8[_0x8d8f12][_0xb056('0x6a')];}}var _0x545030=[],_0x155e14={};for(var _0x45f7c9=0x0,_0x930dfc=_0x57c9d3[_0xb056('0x38')];_0x45f7c9<_0x930dfc;_0x45f7c9++){_0x155e14={'ProjectId':_0x10ffb8[_0xb056('0x47')]['id'],'SessionId':_0x57c9d3[_0x45f7c9]['id'],'StartTime':moment(_0x57c9d3[_0x45f7c9]['starttime'])[_0xb056('0x6b')](_0xb056('0x6c'))};for(var _0xa95d7b=0x0,_0xca6cf7=_0x5270c8[_0xb056('0x38')];_0xa95d7b<_0xca6cf7;_0xa95d7b++){if(_0x5270c8[_0xa95d7b][_0xb056('0x6d')]==_0x57c9d3[_0x45f7c9]['id']&&_0x8b923b[_0xb056('0x59')](_0x5270c8[_0xa95d7b][_0xb056('0x69')])){_0x155e14[_0x8b923b[_0x5270c8[_0xa95d7b][_0xb056('0x69')]]]=_0x5270c8[_0xa95d7b][_0xb056('0x6e')];}}for(var _0x62da08 in _0x8b923b){if(!_0x155e14[_0xb056('0x59')](_0x8b923b[_0x62da08])){_0x155e14[_0x8b923b[_0x62da08]]=null;}}_0x545030[_0xb056('0x6f')](_0x155e14);}return _0x545030;}})[_0xb056('0x26')](function(_0x3837af){if(!_[_0xb056('0x70')](_0x3837af)){var _0x10e3b2=toCsv(_0x3837af);var _0x5431a1=Date[_0xb056('0x71')]();fs[_0xb056('0x72')](util['format'](_0xb056('0x73'),_0x10ffb8[_0xb056('0x47')]['id'],_0x5431a1),_0x10e3b2);_0x239950[_0xb056('0x74')](_0xb056('0x75'),_0xb056('0x76')+util[_0xb056('0x6b')](_0xb056('0x77'),_0x10ffb8[_0xb056('0x47')]['id'],_0x5431a1));_0x239950[_0xb056('0x74')](_0xb056('0x78'),_0xb056('0x79'));return _0x239950['download'](util['format'](_0xb056('0x73'),_0x10ffb8['params']['id'],_0x5431a1));}else{return _0x239950[_0xb056('0x1b')](0xcc);}})[_0xb056('0x45')](handleError(_0x239950,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 332c95b..11847e4 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 _0x7a59=['../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','api','moment','bluebird','request-promise','path'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7a59,0x16e));var _0x97a5=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7a59[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x97a5('0x1'));var moment=require(_0x97a5('0x2'));var BPromise=require(_0x97a5('0x3'));var rp=require(_0x97a5('0x4'));var fs=require('fs');var path=require(_0x97a5('0x5'));var rimraf=require('rimraf');var config=require(_0x97a5('0x6'));var attributes=require(_0x97a5('0x7'));module[_0x97a5('0x8')]=function(_0x48201b,_0x438520){return _0x48201b[_0x97a5('0x9')](_0x97a5('0xa'),attributes,{'tableName':_0x97a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21d1=['JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x2b78de,_0x547dd0){var _0x29f987=function(_0x423471){while(--_0x423471){_0x2b78de['push'](_0x2b78de['shift']());}};_0x29f987(++_0x547dd0);}(_0x21d1,0x1c9));var _0x121d=function(_0x3c07a4,_0x429ba8){_0x3c07a4=_0x3c07a4-0x0;var _0x4c1b41=_0x21d1[_0x3c07a4];return _0x4c1b41;};'use strict';var _=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var logger=require(_0x121d('0x2'))(_0x121d('0x3'));var moment=require(_0x121d('0x4'));var BPromise=require(_0x121d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x121d('0x6'));var config=require(_0x121d('0x7'));var attributes=require(_0x121d('0x8'));module[_0x121d('0x9')]=function(_0x2f3987,_0x4c47ee){return _0x2f3987[_0x121d('0xa')](_0x121d('0xb'),attributes,{'tableName':_0x121d('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 5e3f08f..151fc3f 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x1c7bc6,_0x49bd45){var _0x4fe724=function(_0x505910){while(--_0x505910){_0x1c7bc6['push'](_0x1c7bc6['shift']());}};_0x4fe724(++_0x49bd45);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xdb50e1,_0x112a80){var _0x2a50fc=function(_0xd47d89){while(--_0xd47d89){_0xdb50e1['push'](_0xdb50e1['shift']());}};_0x2a50fc(++_0x112a80);}(_0xf4eb,0xec));var _0xbf4e=function(_0x385ee5,_0x341dcf){_0x385ee5=_0x385ee5-0x0;var _0x630f23=_0xf4eb[_0x385ee5];return _0x630f23;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 6c7c137..50dcfd3 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 _0x20a6=['/:id','post','create','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe'];(function(_0x33cf43,_0x4b4de9){var _0x521db5=function(_0x994173){while(--_0x994173){_0x33cf43['push'](_0x33cf43['shift']());}};_0x521db5(++_0x4b4de9);}(_0x20a6,0xfd));var _0x620a=function(_0x239c3c,_0x3c6075){_0x239c3c=_0x239c3c-0x0;var _0x5bfa50=_0x20a6[_0x239c3c];return _0x5bfa50;};'use strict';var multer=require(_0x620a('0x0'));var util=require(_0x620a('0x1'));var path=require('path');var timeout=require(_0x620a('0x2'));var express=require(_0x620a('0x3'));var router=express['Router']();var fs_extra=require(_0x620a('0x4'));var auth=require(_0x620a('0x5'));var interaction=require(_0x620a('0x6'));var config=require(_0x620a('0x7'));var controller=require(_0x620a('0x8'));router[_0x620a('0x9')]('/',auth[_0x620a('0xa')](),controller[_0x620a('0xb')]);router['get']('/describe',auth[_0x620a('0xa')](),controller[_0x620a('0xc')]);router[_0x620a('0x9')](_0x620a('0xd'),auth[_0x620a('0xa')](),controller['show']);router[_0x620a('0xe')]('/',auth[_0x620a('0xa')](),controller[_0x620a('0xf')]);router['put'](_0x620a('0xd'),auth[_0x620a('0xa')](),controller[_0x620a('0x10')]);router[_0x620a('0x11')](_0x620a('0xd'),auth[_0x620a('0xa')](),controller['destroy']);module[_0x620a('0x12')]=router; \ No newline at end of file +var _0xd1aa=['/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xd1aa,0x66));var _0xad1a=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0xd1aa[_0x119280];return _0x481797;};'use strict';var multer=require(_0xad1a('0x0'));var util=require('util');var path=require(_0xad1a('0x1'));var timeout=require(_0xad1a('0x2'));var express=require(_0xad1a('0x3'));var router=express[_0xad1a('0x4')]();var fs_extra=require(_0xad1a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad1a('0x6'));var config=require('../../config/environment');var controller=require(_0xad1a('0x7'));router['get']('/',auth[_0xad1a('0x8')](),controller[_0xad1a('0x9')]);router[_0xad1a('0xa')]('/describe',auth[_0xad1a('0x8')](),controller[_0xad1a('0xb')]);router[_0xad1a('0xa')](_0xad1a('0xc'),auth['isAuthenticated'](),controller[_0xad1a('0xd')]);router[_0xad1a('0xe')]('/',auth[_0xad1a('0x8')](),controller['create']);router['put'](_0xad1a('0xc'),auth[_0xad1a('0x8')](),controller[_0xad1a('0xf')]);router[_0xad1a('0x10')]('/:id',auth[_0xad1a('0x8')](),controller[_0xad1a('0x11')]);module[_0xad1a('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index cc6ebad..7bb7bfa 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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x2bcbe5,_0x1c1d7c){_0x2bcbe5=_0x2bcbe5-0x0;var _0x494ecc=_0x7a54[_0x2bcbe5];return _0x494ecc;};'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(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x188ebc,_0x7f6ebd){_0x188ebc=_0x188ebc-0x0;var _0x307135=_0x7a54[_0x188ebc];return _0x307135;};'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 143bb16..874981e 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 _0xdee6=['hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','params','include','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','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','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0xdee6,0x1f3));var _0x6dee=function(_0x235de2,_0x4f1099){_0x235de2=_0x235de2-0x0;var _0x3ecc49=_0xdee6[_0x235de2];return _0x3ecc49;};'use strict';var emlformat=require(_0x6dee('0x0'));var rimraf=require(_0x6dee('0x1'));var zipdir=require(_0x6dee('0x2'));var jsonpatch=require(_0x6dee('0x3'));var rp=require(_0x6dee('0x4'));var moment=require(_0x6dee('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6dee('0x6'));var path=require(_0x6dee('0x7'));var sox=require(_0x6dee('0x8'));var csv=require(_0x6dee('0x9'));var ejs=require(_0x6dee('0xa'));var fs=require('fs');var fs_extra=require(_0x6dee('0xb'));var _=require(_0x6dee('0xc'));var squel=require(_0x6dee('0xd'));var crypto=require(_0x6dee('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6dee('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6dee('0x10'));var Papa=require(_0x6dee('0x11'));var Redis=require(_0x6dee('0x12'));var authService=require(_0x6dee('0x13'));var qs=require(_0x6dee('0x14'));var as=require(_0x6dee('0x15'));var hardwareService=require(_0x6dee('0x16'));var logger=require(_0x6dee('0x17'))(_0x6dee('0x18'));var utils=require(_0x6dee('0x19'));var config=require(_0x6dee('0x1a'));var licenseUtil=require(_0x6dee('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x128841,_0x2bd0cc){_0x2bd0cc=_0x2bd0cc||0xcc;return function(_0x19bedc){if(_0x19bedc){return _0x128841[_0x6dee('0x1c')](_0x2bd0cc);}return _0x128841[_0x6dee('0x1d')](_0x2bd0cc)[_0x6dee('0x1e')]();};}function respondWithResult(_0x1a3329,_0x45c3c4){_0x45c3c4=_0x45c3c4||0xc8;return function(_0x5725d4){if(_0x5725d4){return _0x1a3329[_0x6dee('0x1d')](_0x45c3c4)['json'](_0x5725d4);}};}function respondWithFilteredResult(_0x42c7fd,_0x5b36d3){return function(_0x188cf4){if(_0x188cf4){var _0x137792=typeof _0x5b36d3[_0x6dee('0x1f')]==='undefined'&&typeof _0x5b36d3['limit']===_0x6dee('0x20');var _0x229457=_0x188cf4['count'];var _0x3f702c=_0x137792?0x0:_0x5b36d3[_0x6dee('0x1f')];var _0x1dbe6e=_0x137792?_0x188cf4[_0x6dee('0x21')]:_0x5b36d3[_0x6dee('0x1f')]+_0x5b36d3[_0x6dee('0x22')];var _0x5747b7;if(_0x1dbe6e>=_0x229457){_0x1dbe6e=_0x229457;_0x5747b7=0xc8;}else{_0x5747b7=0xce;}_0x42c7fd[_0x6dee('0x1d')](_0x5747b7);return _0x42c7fd[_0x6dee('0x23')](_0x6dee('0x24'),_0x3f702c+'-'+_0x1dbe6e+'/'+_0x229457)[_0x6dee('0x25')](_0x188cf4);}return null;};}function patchUpdates(_0x2ffa83){return function(_0x37854b){try{jsonpatch[_0x6dee('0x26')](_0x37854b,_0x2ffa83,!![]);}catch(_0x2e0a91){return BPromise['reject'](_0x2e0a91);}return _0x37854b[_0x6dee('0x27')]();};}function saveUpdates(_0x256d1e,_0x4cfa73){return function(_0x22ae89){if(_0x22ae89){return _0x22ae89[_0x6dee('0x28')](_0x256d1e)[_0x6dee('0x29')](function(_0xc98c3){return _0xc98c3;});}return null;};}function removeEntity(_0x430127,_0x10b9c8){return function(_0xa9001e){if(_0xa9001e){return _0xa9001e[_0x6dee('0x2a')]()[_0x6dee('0x29')](function(){_0x430127[_0x6dee('0x1d')](0xcc)[_0x6dee('0x1e')]();});}};}function handleEntityNotFound(_0x532ed2,_0x547d5b){return function(_0x2ba53c){if(!_0x2ba53c){_0x532ed2[_0x6dee('0x1c')](0x194);}return _0x2ba53c;};}function handleError(_0x39c86f,_0x30768b){_0x30768b=_0x30768b||0x1f4;return function(_0x507316){logger[_0x6dee('0x2b')](_0x507316[_0x6dee('0x2c')]);if(_0x507316[_0x6dee('0x2d')]){delete _0x507316['name'];}_0x39c86f[_0x6dee('0x1d')](_0x30768b)[_0x6dee('0x2e')](_0x507316);};}exports[_0x6dee('0x2f')]=function(_0x60ab02,_0xc7a11a){var _0x440913={},_0x6feb03={},_0x2c606f={'count':0x0,'rows':[]};var _0x2c424c=_[_0x6dee('0x30')](db[_0x6dee('0x31')][_0x6dee('0x32')],function(_0x7fd5ea){return{'name':_0x7fd5ea[_0x6dee('0x33')],'type':_0x7fd5ea[_0x6dee('0x34')]['key']};});_0x6feb03[_0x6dee('0x35')]=_[_0x6dee('0x30')](_0x2c424c,_0x6dee('0x2d'));_0x6feb03[_0x6dee('0x36')]=_[_0x6dee('0x37')](_0x60ab02['query']);_0x6feb03[_0x6dee('0x38')]=_[_0x6dee('0x39')](_0x6feb03[_0x6dee('0x35')],_0x6feb03['query']);_0x440913[_0x6dee('0x3a')]=_['intersection'](_0x6feb03[_0x6dee('0x35')],qs[_0x6dee('0x3b')](_0x60ab02[_0x6dee('0x36')][_0x6dee('0x3b')]));_0x440913[_0x6dee('0x3a')]=_0x440913['attributes'][_0x6dee('0x3c')]?_0x440913[_0x6dee('0x3a')]:_0x6feb03['model'];if(!_0x60ab02[_0x6dee('0x36')][_0x6dee('0x3d')]('nolimit')){_0x440913[_0x6dee('0x22')]=qs[_0x6dee('0x22')](_0x60ab02[_0x6dee('0x36')]['limit']);_0x440913['offset']=qs[_0x6dee('0x1f')](_0x60ab02['query']['offset']);}_0x440913[_0x6dee('0x3e')]=qs[_0x6dee('0x3f')](_0x60ab02[_0x6dee('0x36')][_0x6dee('0x3f')]);_0x440913['where']=qs['filters'](_[_0x6dee('0x40')](_0x60ab02[_0x6dee('0x36')],_0x6feb03['filters']),_0x2c424c);if(_0x60ab02[_0x6dee('0x36')][_0x6dee('0x41')]){_0x440913[_0x6dee('0x42')]=_['merge'](_0x440913[_0x6dee('0x42')],{'$or':_[_0x6dee('0x30')](_0x2c424c,function(_0x405aaa){if(_0x405aaa[_0x6dee('0x34')]!==_0x6dee('0x43')){var _0x5d2d8a={};_0x5d2d8a[_0x405aaa['name']]={'$like':'%'+_0x60ab02[_0x6dee('0x36')]['filter']+'%'};return _0x5d2d8a;}})});}_0x440913=_[_0x6dee('0x44')]({},_0x440913,_0x60ab02['options']);var _0x118330={'where':_0x440913['where']};return db['JscriptyQuestionReport'][_0x6dee('0x21')](_0x118330)['then'](function(_0x591085){_0x2c606f[_0x6dee('0x21')]=_0x591085;if(_0x60ab02[_0x6dee('0x36')][_0x6dee('0x45')]){_0x440913['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x6dee('0x46')](_0x440913);})[_0x6dee('0x29')](function(_0x251ee9){_0x2c606f[_0x6dee('0x47')]=_0x251ee9;return _0x2c606f;})[_0x6dee('0x29')](respondWithFilteredResult(_0xc7a11a,_0x440913))['catch'](handleError(_0xc7a11a,null));};exports['show']=function(_0x4f0d54,_0xfd2803){var _0x331a25={'raw':!![],'where':{'id':_0x4f0d54[_0x6dee('0x48')]['id']}},_0x3072c3={};_0x3072c3[_0x6dee('0x35')]=_['keys'](db[_0x6dee('0x31')][_0x6dee('0x32')]);_0x3072c3['query']=_[_0x6dee('0x37')](_0x4f0d54[_0x6dee('0x36')]);_0x3072c3[_0x6dee('0x38')]=_['intersection'](_0x3072c3[_0x6dee('0x35')],_0x3072c3[_0x6dee('0x36')]);_0x331a25[_0x6dee('0x3a')]=_['intersection'](_0x3072c3['model'],qs[_0x6dee('0x3b')](_0x4f0d54['query'][_0x6dee('0x3b')]));_0x331a25[_0x6dee('0x3a')]=_0x331a25[_0x6dee('0x3a')][_0x6dee('0x3c')]?_0x331a25[_0x6dee('0x3a')]:_0x3072c3[_0x6dee('0x35')];if(_0x4f0d54[_0x6dee('0x36')][_0x6dee('0x45')]){_0x331a25[_0x6dee('0x49')]=[{'all':!![]}];}_0x331a25=_[_0x6dee('0x44')]({},_0x331a25,_0x4f0d54[_0x6dee('0x4a')]);return db[_0x6dee('0x31')][_0x6dee('0x4b')](_0x331a25)[_0x6dee('0x29')](handleEntityNotFound(_0xfd2803,null))[_0x6dee('0x29')](respondWithResult(_0xfd2803,null))['catch'](handleError(_0xfd2803,null));};exports[_0x6dee('0x4c')]=function(_0x498ccb,_0x578c9b){return db[_0x6dee('0x31')][_0x6dee('0x4c')](_0x498ccb[_0x6dee('0x4d')],{})[_0x6dee('0x29')](respondWithResult(_0x578c9b,0xc9))[_0x6dee('0x4e')](handleError(_0x578c9b,null));};exports[_0x6dee('0x28')]=function(_0x50178c,_0x46a38b){if(_0x50178c[_0x6dee('0x4d')]['id']){delete _0x50178c[_0x6dee('0x4d')]['id'];}return db[_0x6dee('0x31')][_0x6dee('0x4b')]({'where':{'id':_0x50178c[_0x6dee('0x48')]['id']}})[_0x6dee('0x29')](handleEntityNotFound(_0x46a38b,null))[_0x6dee('0x29')](saveUpdates(_0x50178c[_0x6dee('0x4d')],null))[_0x6dee('0x29')](respondWithResult(_0x46a38b,null))['catch'](handleError(_0x46a38b,null));};exports[_0x6dee('0x2a')]=function(_0x3c93f6,_0x102623){return db[_0x6dee('0x31')][_0x6dee('0x4b')]({'where':{'id':_0x3c93f6[_0x6dee('0x48')]['id']}})[_0x6dee('0x29')](handleEntityNotFound(_0x102623,null))[_0x6dee('0x29')](removeEntity(_0x102623,null))['catch'](handleError(_0x102623,null));};exports[_0x6dee('0x4f')]=function(_0x14dcce,_0x3c80a2){return db[_0x6dee('0x31')]['describe']()[_0x6dee('0x29')](respondWithResult(_0x3c80a2,null))[_0x6dee('0x4e')](handleError(_0x3c80a2,null));}; \ No newline at end of file +var _0x66dd=['length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','update','then','error','stack','name','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','filters','attributes','fields'];(function(_0x589589,_0x484d80){var _0x1ae411=function(_0x193408){while(--_0x193408){_0x589589['push'](_0x589589['shift']());}};_0x1ae411(++_0x484d80);}(_0x66dd,0x129));var _0xd66d=function(_0x106bf9,_0x4a6b46){_0x106bf9=_0x106bf9-0x0;var _0x342031=_0x66dd[_0x106bf9];return _0x342031;};'use strict';var emlformat=require(_0xd66d('0x0'));var rimraf=require(_0xd66d('0x1'));var zipdir=require(_0xd66d('0x2'));var jsonpatch=require(_0xd66d('0x3'));var rp=require(_0xd66d('0x4'));var moment=require(_0xd66d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd66d('0x6'));var sox=require(_0xd66d('0x7'));var csv=require(_0xd66d('0x8'));var ejs=require(_0xd66d('0x9'));var fs=require('fs');var fs_extra=require(_0xd66d('0xa'));var _=require('lodash');var squel=require(_0xd66d('0xb'));var crypto=require(_0xd66d('0xc'));var jsforce=require(_0xd66d('0xd'));var deskjs=require(_0xd66d('0xe'));var toCsv=require(_0xd66d('0x8'));var querystring=require(_0xd66d('0xf'));var Papa=require('papaparse');var Redis=require(_0xd66d('0x10'));var authService=require(_0xd66d('0x11'));var qs=require(_0xd66d('0x12'));var as=require(_0xd66d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd66d('0x14'));var utils=require('../../config/utils');var config=require(_0xd66d('0x15'));var licenseUtil=require(_0xd66d('0x16'));var db=require(_0xd66d('0x17'))['db'];function respondWithStatusCode(_0x3292b4,_0x105072){_0x105072=_0x105072||0xcc;return function(_0x4d713b){if(_0x4d713b){return _0x3292b4['sendStatus'](_0x105072);}return _0x3292b4[_0xd66d('0x18')](_0x105072)[_0xd66d('0x19')]();};}function respondWithResult(_0xf50480,_0x5e25b5){_0x5e25b5=_0x5e25b5||0xc8;return function(_0x47a56a){if(_0x47a56a){return _0xf50480['status'](_0x5e25b5)[_0xd66d('0x1a')](_0x47a56a);}};}function respondWithFilteredResult(_0x156c10,_0xd204cf){return function(_0x53547){if(_0x53547){var _0x53ef65=typeof _0xd204cf[_0xd66d('0x1b')]===_0xd66d('0x1c')&&typeof _0xd204cf['limit']===_0xd66d('0x1c');var _0x3555ed=_0x53547[_0xd66d('0x1d')];var _0x572863=_0x53ef65?0x0:_0xd204cf[_0xd66d('0x1b')];var _0x2e976b=_0x53ef65?_0x53547[_0xd66d('0x1d')]:_0xd204cf['offset']+_0xd204cf['limit'];var _0x3b78d0;if(_0x2e976b>=_0x3555ed){_0x2e976b=_0x3555ed;_0x3b78d0=0xc8;}else{_0x3b78d0=0xce;}_0x156c10[_0xd66d('0x18')](_0x3b78d0);return _0x156c10[_0xd66d('0x1e')](_0xd66d('0x1f'),_0x572863+'-'+_0x2e976b+'/'+_0x3555ed)[_0xd66d('0x1a')](_0x53547);}return null;};}function patchUpdates(_0x4a6b83){return function(_0x18839d){try{jsonpatch['apply'](_0x18839d,_0x4a6b83,!![]);}catch(_0x36c8bf){return BPromise['reject'](_0x36c8bf);}return _0x18839d['save']();};}function saveUpdates(_0x381d92,_0x5a8cd1){return function(_0x52e0f0){if(_0x52e0f0){return _0x52e0f0[_0xd66d('0x20')](_0x381d92)[_0xd66d('0x21')](function(_0x212772){return _0x212772;});}return null;};}function removeEntity(_0x4d8340,_0x33fdda){return function(_0x2ebc4a){if(_0x2ebc4a){return _0x2ebc4a['destroy']()[_0xd66d('0x21')](function(){_0x4d8340[_0xd66d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28f01f,_0x1c6fb0){return function(_0x2c12e8){if(!_0x2c12e8){_0x28f01f['sendStatus'](0x194);}return _0x2c12e8;};}function handleError(_0x152010,_0x2d90b8){_0x2d90b8=_0x2d90b8||0x1f4;return function(_0x3c2828){logger[_0xd66d('0x22')](_0x3c2828[_0xd66d('0x23')]);if(_0x3c2828[_0xd66d('0x24')]){delete _0x3c2828['name'];}_0x152010[_0xd66d('0x18')](_0x2d90b8)['send'](_0x3c2828);};}exports['index']=function(_0x1f3ab7,_0x40d57c){var _0x32341b={},_0xec0625={},_0xb0f11a={'count':0x0,'rows':[]};var _0x4e9da5=_[_0xd66d('0x25')](db[_0xd66d('0x26')]['rawAttributes'],function(_0x33d112){return{'name':_0x33d112[_0xd66d('0x27')],'type':_0x33d112[_0xd66d('0x28')][_0xd66d('0x29')]};});_0xec0625[_0xd66d('0x2a')]=_['map'](_0x4e9da5,'name');_0xec0625[_0xd66d('0x2b')]=_[_0xd66d('0x2c')](_0x1f3ab7[_0xd66d('0x2b')]);_0xec0625[_0xd66d('0x2d')]=_['intersection'](_0xec0625[_0xd66d('0x2a')],_0xec0625[_0xd66d('0x2b')]);_0x32341b[_0xd66d('0x2e')]=_['intersection'](_0xec0625[_0xd66d('0x2a')],qs[_0xd66d('0x2f')](_0x1f3ab7[_0xd66d('0x2b')][_0xd66d('0x2f')]));_0x32341b[_0xd66d('0x2e')]=_0x32341b['attributes'][_0xd66d('0x30')]?_0x32341b[_0xd66d('0x2e')]:_0xec0625[_0xd66d('0x2a')];if(!_0x1f3ab7[_0xd66d('0x2b')][_0xd66d('0x31')]('nolimit')){_0x32341b[_0xd66d('0x32')]=qs[_0xd66d('0x32')](_0x1f3ab7[_0xd66d('0x2b')]['limit']);_0x32341b[_0xd66d('0x1b')]=qs['offset'](_0x1f3ab7[_0xd66d('0x2b')][_0xd66d('0x1b')]);}_0x32341b[_0xd66d('0x33')]=qs[_0xd66d('0x34')](_0x1f3ab7[_0xd66d('0x2b')][_0xd66d('0x34')]);_0x32341b[_0xd66d('0x35')]=qs['filters'](_['pick'](_0x1f3ab7['query'],_0xec0625['filters']),_0x4e9da5);if(_0x1f3ab7[_0xd66d('0x2b')][_0xd66d('0x36')]){_0x32341b[_0xd66d('0x35')]=_[_0xd66d('0x37')](_0x32341b[_0xd66d('0x35')],{'$or':_[_0xd66d('0x25')](_0x4e9da5,function(_0x589ea8){if(_0x589ea8[_0xd66d('0x28')]!==_0xd66d('0x38')){var _0x48016a={};_0x48016a[_0x589ea8[_0xd66d('0x24')]]={'$like':'%'+_0x1f3ab7[_0xd66d('0x2b')]['filter']+'%'};return _0x48016a;}})});}_0x32341b=_['merge']({},_0x32341b,_0x1f3ab7[_0xd66d('0x39')]);var _0xff9740={'where':_0x32341b[_0xd66d('0x35')]};return db['JscriptyQuestionReport'][_0xd66d('0x1d')](_0xff9740)[_0xd66d('0x21')](function(_0x135d75){_0xb0f11a[_0xd66d('0x1d')]=_0x135d75;if(_0x1f3ab7[_0xd66d('0x2b')][_0xd66d('0x3a')]){_0x32341b[_0xd66d('0x3b')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x32341b);})[_0xd66d('0x21')](function(_0x4db80b){_0xb0f11a['rows']=_0x4db80b;return _0xb0f11a;})[_0xd66d('0x21')](respondWithFilteredResult(_0x40d57c,_0x32341b))[_0xd66d('0x3c')](handleError(_0x40d57c,null));};exports[_0xd66d('0x3d')]=function(_0x4e72fb,_0x3f82cb){var _0xb25bbd={'raw':!![],'where':{'id':_0x4e72fb[_0xd66d('0x3e')]['id']}},_0x322ac8={};_0x322ac8[_0xd66d('0x2a')]=_[_0xd66d('0x2c')](db[_0xd66d('0x26')][_0xd66d('0x3f')]);_0x322ac8[_0xd66d('0x2b')]=_['keys'](_0x4e72fb[_0xd66d('0x2b')]);_0x322ac8[_0xd66d('0x2d')]=_[_0xd66d('0x40')](_0x322ac8[_0xd66d('0x2a')],_0x322ac8['query']);_0xb25bbd[_0xd66d('0x2e')]=_['intersection'](_0x322ac8['model'],qs[_0xd66d('0x2f')](_0x4e72fb[_0xd66d('0x2b')][_0xd66d('0x2f')]));_0xb25bbd['attributes']=_0xb25bbd['attributes'][_0xd66d('0x30')]?_0xb25bbd[_0xd66d('0x2e')]:_0x322ac8[_0xd66d('0x2a')];if(_0x4e72fb[_0xd66d('0x2b')]['includeAll']){_0xb25bbd[_0xd66d('0x3b')]=[{'all':!![]}];}_0xb25bbd=_['merge']({},_0xb25bbd,_0x4e72fb[_0xd66d('0x39')]);return db[_0xd66d('0x26')][_0xd66d('0x41')](_0xb25bbd)['then'](handleEntityNotFound(_0x3f82cb,null))[_0xd66d('0x21')](respondWithResult(_0x3f82cb,null))[_0xd66d('0x3c')](handleError(_0x3f82cb,null));};exports['create']=function(_0xa38c13,_0x5d2cfc){return db[_0xd66d('0x26')][_0xd66d('0x42')](_0xa38c13[_0xd66d('0x43')],{})[_0xd66d('0x21')](respondWithResult(_0x5d2cfc,0xc9))[_0xd66d('0x3c')](handleError(_0x5d2cfc,null));};exports[_0xd66d('0x20')]=function(_0xeff7f,_0x44769f){if(_0xeff7f['body']['id']){delete _0xeff7f[_0xd66d('0x43')]['id'];}return db[_0xd66d('0x26')][_0xd66d('0x41')]({'where':{'id':_0xeff7f[_0xd66d('0x3e')]['id']}})[_0xd66d('0x21')](handleEntityNotFound(_0x44769f,null))[_0xd66d('0x21')](saveUpdates(_0xeff7f[_0xd66d('0x43')],null))[_0xd66d('0x21')](respondWithResult(_0x44769f,null))[_0xd66d('0x3c')](handleError(_0x44769f,null));};exports['destroy']=function(_0x27a956,_0x41b237){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x27a956['params']['id']}})['then'](handleEntityNotFound(_0x41b237,null))['then'](removeEntity(_0x41b237,null))[_0xd66d('0x3c')](handleError(_0x41b237,null));};exports[_0xd66d('0x44')]=function(_0x3ef66d,_0x1b1286){return db[_0xd66d('0x26')][_0xd66d('0x44')]()[_0xd66d('0x21')](respondWithResult(_0x1b1286,null))[_0xd66d('0x3c')](handleError(_0x1b1286,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 8a467f3..a3d6c17 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 _0x0569=['rimraf','../../config/environment','exports','define','report_jscripty_questions','lodash','util','api','moment','request-promise','path'];(function(_0x1e9d62,_0x25bb8e){var _0x56c490=function(_0x19f4e7){while(--_0x19f4e7){_0x1e9d62['push'](_0x1e9d62['shift']());}};_0x56c490(++_0x25bb8e);}(_0x0569,0x123));var _0x9056=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x0569[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x9056('0x0'));var util=require(_0x9056('0x1'));var logger=require('../../config/logger')(_0x9056('0x2'));var moment=require(_0x9056('0x3'));var BPromise=require('bluebird');var rp=require(_0x9056('0x4'));var fs=require('fs');var path=require(_0x9056('0x5'));var rimraf=require(_0x9056('0x6'));var config=require(_0x9056('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x9056('0x8')]=function(_0x2d70bb,_0x20143a){return _0x2d70bb[_0x9056('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x9056('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dfa=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x11a4a8,_0x4eb10f){var _0x30dc6c=function(_0x59e1d4){while(--_0x59e1d4){_0x11a4a8['push'](_0x11a4a8['shift']());}};_0x30dc6c(++_0x4eb10f);}(_0x7dfa,0xa3));var _0xa7df=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0x7dfa[_0x47adb8];return _0x4689a8;};'use strict';var _=require(_0xa7df('0x0'));var util=require('util');var logger=require(_0xa7df('0x1'))('api');var moment=require(_0xa7df('0x2'));var BPromise=require(_0xa7df('0x3'));var rp=require(_0xa7df('0x4'));var fs=require('fs');var path=require(_0xa7df('0x5'));var rimraf=require(_0xa7df('0x6'));var config=require(_0xa7df('0x7'));var attributes=require(_0xa7df('0x8'));module[_0xa7df('0x9')]=function(_0x29c8e5,_0x4e4742){return _0x29c8e5['define'](_0xa7df('0xa'),attributes,{'tableName':_0xa7df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 65377c5..df5d6ab 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 _0xd853=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4a2b3c,_0xc69f59){var _0x4b081b=function(_0x3dfcb1){while(--_0x3dfcb1){_0x4a2b3c['push'](_0x4a2b3c['shift']());}};_0x4b081b(++_0xc69f59);}(_0xd853,0x1c2));var _0x3d85=function(_0x25b430,_0x342119){_0x25b430=_0x25b430-0x0;var _0x32d9e3=_0xd853[_0x25b430];return _0x32d9e3;};'use strict';var _=require(_0x3d85('0x0'));var util=require(_0x3d85('0x1'));var moment=require(_0x3d85('0x2'));var BPromise=require(_0x3d85('0x3'));var rs=require(_0x3d85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d85('0x5'))['db'];var utils=require(_0x3d85('0x6'));var logger=require(_0x3d85('0x7'))(_0x3d85('0x8'));var config=require(_0x3d85('0x9'));var jayson=require(_0x3d85('0xa'));var client=jayson['client'][_0x3d85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171040,_0xc3406e,_0x3106af){return new BPromise(function(_0x38f316,_0xeae9bc){return client[_0x3d85('0xc')](_0x171040,_0x3106af)[_0x3d85('0xd')](function(_0x593506){logger[_0x3d85('0xe')](_0x3d85('0xf'),_0xc3406e,_0x3d85('0x10'));logger[_0x3d85('0x11')](_0x3d85('0x12'),_0xc3406e,_0x3d85('0x10'),JSON[_0x3d85('0x13')](_0x593506));if(_0x593506[_0x3d85('0x14')]){if(_0x593506['error'][_0x3d85('0x15')]===0x1f4){logger[_0x3d85('0x14')](_0x3d85('0xf'),_0xc3406e,_0x593506[_0x3d85('0x14')]['message']);return _0xeae9bc(_0x593506[_0x3d85('0x14')]['message']);}logger[_0x3d85('0x14')](_0x3d85('0xf'),_0xc3406e,_0x593506[_0x3d85('0x14')][_0x3d85('0x16')]);return _0x38f316(_0x593506[_0x3d85('0x14')][_0x3d85('0x16')]);}else{logger[_0x3d85('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xc3406e,_0x3d85('0x10'));_0x38f316(_0x593506[_0x3d85('0x17')]['message']);}})[_0x3d85('0x18')](function(_0x1debab){logger[_0x3d85('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xc3406e,_0x1debab);_0xeae9bc(_0x1debab);});});} \ No newline at end of file +var _0xf27e=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info'];(function(_0x19d742,_0x94b459){var _0x276e8f=function(_0x1c50a1){while(--_0x1c50a1){_0x19d742['push'](_0x19d742['shift']());}};_0x276e8f(++_0x94b459);}(_0xf27e,0xdb));var _0xef27=function(_0x5e0253,_0x5355fd){_0x5e0253=_0x5e0253-0x0;var _0x3a5b2e=_0xf27e[_0x5e0253];return _0x3a5b2e;};'use strict';var _=require(_0xef27('0x0'));var util=require(_0xef27('0x1'));var moment=require(_0xef27('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef27('0x3'));var db=require(_0xef27('0x4'))['db'];var utils=require(_0xef27('0x5'));var logger=require(_0xef27('0x6'))(_0xef27('0x7'));var config=require(_0xef27('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xef27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x149a55,_0x3ee6e9,_0x4db3e5){return new BPromise(function(_0x409a2b,_0x3867b6){return client[_0xef27('0xa')](_0x149a55,_0x4db3e5)['then'](function(_0x252b6b){logger[_0xef27('0xb')](_0xef27('0xc'),_0x3ee6e9,_0xef27('0xd'));logger[_0xef27('0xe')](_0xef27('0xf'),_0x3ee6e9,_0xef27('0xd'),JSON[_0xef27('0x10')](_0x252b6b));if(_0x252b6b[_0xef27('0x11')]){if(_0x252b6b[_0xef27('0x11')][_0xef27('0x12')]===0x1f4){logger[_0xef27('0x11')](_0xef27('0xc'),_0x3ee6e9,_0x252b6b['error'][_0xef27('0x13')]);return _0x3867b6(_0x252b6b[_0xef27('0x11')]['message']);}logger[_0xef27('0x11')](_0xef27('0xc'),_0x3ee6e9,_0x252b6b[_0xef27('0x11')][_0xef27('0x13')]);return _0x409a2b(_0x252b6b[_0xef27('0x11')][_0xef27('0x13')]);}else{logger[_0xef27('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3ee6e9,_0xef27('0xd'));_0x409a2b(_0x252b6b['result'][_0xef27('0x13')]);}})[_0xef27('0x14')](function(_0x1b8111){logger[_0xef27('0x11')](_0xef27('0xc'),_0x3ee6e9,_0x1b8111);_0x3867b6(_0x1b8111);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index e79cdba..5582c7e 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 _0x5c30=['isAuthenticated','show','getQuestions','post','create','put','update','exports','util','path','connect-timeout','express','../../components/interaction/service','./jscriptySessionReport.controller','index','get','describe','/:id'];(function(_0x10f778,_0x41e1d7){var _0x5931f8=function(_0x3f6424){while(--_0x3f6424){_0x10f778['push'](_0x10f778['shift']());}};_0x5931f8(++_0x41e1d7);}(_0x5c30,0x1dc));var _0x05c3=function(_0x48d813,_0x29d6e8){_0x48d813=_0x48d813-0x0;var _0x1a4699=_0x5c30[_0x48d813];return _0x1a4699;};'use strict';var multer=require('multer');var util=require(_0x05c3('0x0'));var path=require(_0x05c3('0x1'));var timeout=require(_0x05c3('0x2'));var express=require(_0x05c3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x05c3('0x4'));var config=require('../../config/environment');var controller=require(_0x05c3('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x05c3('0x6')]);router[_0x05c3('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x05c3('0x8')]);router['get'](_0x05c3('0x9'),auth[_0x05c3('0xa')](),controller[_0x05c3('0xb')]);router['get']('/:id/questions',auth[_0x05c3('0xa')](),controller[_0x05c3('0xc')]);router[_0x05c3('0xd')]('/',auth['isAuthenticated'](),controller[_0x05c3('0xe')]);router[_0x05c3('0xf')](_0x05c3('0x9'),auth[_0x05c3('0xa')](),controller[_0x05c3('0x10')]);router['delete'](_0x05c3('0x9'),auth[_0x05c3('0xa')](),controller['destroy']);module[_0x05c3('0x11')]=router; \ No newline at end of file +var _0x31ac=['../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','create','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31ac,0x10b));var _0xc31a=function(_0x2f4c8d,_0x43aa55){_0x2f4c8d=_0x2f4c8d-0x0;var _0x5c7f16=_0x31ac[_0x2f4c8d];return _0x5c7f16;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc31a('0x0'));var timeout=require(_0xc31a('0x1'));var express=require(_0xc31a('0x2'));var router=express[_0xc31a('0x3')]();var fs_extra=require(_0xc31a('0x4'));var auth=require(_0xc31a('0x5'));var interaction=require(_0xc31a('0x6'));var config=require('../../config/environment');var controller=require(_0xc31a('0x7'));router[_0xc31a('0x8')]('/',auth[_0xc31a('0x9')](),controller[_0xc31a('0xa')]);router['get'](_0xc31a('0xb'),auth[_0xc31a('0x9')](),controller[_0xc31a('0xc')]);router['get'](_0xc31a('0xd'),auth[_0xc31a('0x9')](),controller[_0xc31a('0xe')]);router['get'](_0xc31a('0xf'),auth[_0xc31a('0x9')](),controller[_0xc31a('0x10')]);router['post']('/',auth[_0xc31a('0x9')](),controller[_0xc31a('0x11')]);router[_0xc31a('0x12')](_0xc31a('0xd'),auth[_0xc31a('0x9')](),controller[_0xc31a('0x13')]);router['delete'](_0xc31a('0xd'),auth[_0xc31a('0x9')](),controller['destroy']);module[_0xc31a('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d9b1521..a1746cf 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 _0xe585=['BOOLEAN','moment','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe585,0x9a));var _0x5e58=function(_0x369f7b,_0x451c57){_0x369f7b=_0x369f7b-0x0;var _0x1e3652=_0xe585[_0x369f7b];return _0x1e3652;};'use strict';var moment=require(_0x5e58('0x0'));var Sequelize=require('sequelize');module[_0x5e58('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3e4f55){this[_0x5e58('0x2')](_0x5e58('0x3'),_0x3e4f55);this[_0x5e58('0x2')](_0x5e58('0x4'),moment()[_0x5e58('0x5')](_0x5e58('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x5e58('0x7')]},'projectname':{'type':Sequelize[_0x5e58('0x7')]},'queue':{'type':Sequelize[_0x5e58('0x7')]},'uniqueid':{'type':Sequelize[_0x5e58('0x7')]},'calleridname':{'type':Sequelize[_0x5e58('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x5e58('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xad33=['endtime','format','STRING','BOOLEAN','sequelize','exports','setDataValue','starttime'];(function(_0xb34d04,_0x3d321b){var _0x48b5b9=function(_0x561d62){while(--_0x561d62){_0xb34d04['push'](_0xb34d04['shift']());}};_0x48b5b9(++_0x3d321b);}(_0xad33,0x6c));var _0x3ad3=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0xad33[_0x547ff4];return _0xe41057;};'use strict';var moment=require('moment');var Sequelize=require(_0x3ad3('0x0'));module[_0x3ad3('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x203e74){this[_0x3ad3('0x2')](_0x3ad3('0x3'),_0x203e74);this[_0x3ad3('0x2')](_0x3ad3('0x4'),moment()[_0x3ad3('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x3ad3('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3ad3('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3ad3('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x3ad3('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 2e59847..0810712 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 _0x05ea=['error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','include','rows','catch','show','params','includeAll','create','body','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','sendStatus'];(function(_0x4f5a60,_0x337e0c){var _0x9a0ed1=function(_0x6fd951){while(--_0x6fd951){_0x4f5a60['push'](_0x4f5a60['shift']());}};_0x9a0ed1(++_0x337e0c);}(_0x05ea,0x11d));var _0xa05e=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x05ea[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0xa05e('0x0'));var rimraf=require(_0xa05e('0x1'));var zipdir=require(_0xa05e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa05e('0x3'));var moment=require(_0xa05e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa05e('0x5'));var path=require(_0xa05e('0x6'));var sox=require(_0xa05e('0x7'));var csv=require('to-csv');var ejs=require(_0xa05e('0x8'));var fs=require('fs');var fs_extra=require(_0xa05e('0x9'));var _=require(_0xa05e('0xa'));var squel=require(_0xa05e('0xb'));var crypto=require(_0xa05e('0xc'));var jsforce=require(_0xa05e('0xd'));var deskjs=require(_0xa05e('0xe'));var toCsv=require(_0xa05e('0xf'));var querystring=require('querystring');var Papa=require(_0xa05e('0x10'));var Redis=require(_0xa05e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa05e('0x12'));var hardwareService=require(_0xa05e('0x13'));var logger=require(_0xa05e('0x14'))('api');var utils=require(_0xa05e('0x15'));var config=require(_0xa05e('0x16'));var licenseUtil=require(_0xa05e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf29287,_0xd1822f){_0xd1822f=_0xd1822f||0xcc;return function(_0x75af90){if(_0x75af90){return _0xf29287['sendStatus'](_0xd1822f);}return _0xf29287[_0xa05e('0x18')](_0xd1822f)['end']();};}function respondWithResult(_0x19ee78,_0x32d137){_0x32d137=_0x32d137||0xc8;return function(_0x174299){if(_0x174299){return _0x19ee78[_0xa05e('0x18')](_0x32d137)[_0xa05e('0x19')](_0x174299);}};}function respondWithFilteredResult(_0x593ab7,_0x587885){return function(_0x4ce000){if(_0x4ce000){var _0x293cd8=typeof _0x587885[_0xa05e('0x1a')]==='undefined'&&typeof _0x587885[_0xa05e('0x1b')]==='undefined';var _0x197e44=_0x4ce000[_0xa05e('0x1c')];var _0x528c4e=_0x293cd8?0x0:_0x587885[_0xa05e('0x1a')];var _0x3682a0=_0x293cd8?_0x4ce000[_0xa05e('0x1c')]:_0x587885['offset']+_0x587885[_0xa05e('0x1b')];var _0x49b84e;if(_0x3682a0>=_0x197e44){_0x3682a0=_0x197e44;_0x49b84e=0xc8;}else{_0x49b84e=0xce;}_0x593ab7[_0xa05e('0x18')](_0x49b84e);return _0x593ab7[_0xa05e('0x1d')]('Content-Range',_0x528c4e+'-'+_0x3682a0+'/'+_0x197e44)[_0xa05e('0x19')](_0x4ce000);}return null;};}function patchUpdates(_0x25b819){return function(_0x4b9874){try{jsonpatch[_0xa05e('0x1e')](_0x4b9874,_0x25b819,!![]);}catch(_0x6165e7){return BPromise[_0xa05e('0x1f')](_0x6165e7);}return _0x4b9874[_0xa05e('0x20')]();};}function saveUpdates(_0x20730b,_0x263233){return function(_0x45345e){if(_0x45345e){return _0x45345e[_0xa05e('0x21')](_0x20730b)['then'](function(_0x58287e){return _0x58287e;});}return null;};}function removeEntity(_0x3c2ee5,_0x29cab2){return function(_0x17208b){if(_0x17208b){return _0x17208b['destroy']()['then'](function(){_0x3c2ee5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ca5f3,_0x2ddcf4){return function(_0x3cd7a8){if(!_0x3cd7a8){_0x9ca5f3[_0xa05e('0x22')](0x194);}return _0x3cd7a8;};}function handleError(_0x855f6d,_0x2525ab){_0x2525ab=_0x2525ab||0x1f4;return function(_0x39ee78){logger[_0xa05e('0x23')](_0x39ee78[_0xa05e('0x24')]);if(_0x39ee78[_0xa05e('0x25')]){delete _0x39ee78[_0xa05e('0x25')];}_0x855f6d['status'](_0x2525ab)['send'](_0x39ee78);};}exports[_0xa05e('0x26')]=function(_0x4a11ea,_0x21e318){var _0x3a57e5={},_0x4155d9={},_0x55d08c={'count':0x0,'rows':[]};var _0x3dd9ab=_[_0xa05e('0x27')](db[_0xa05e('0x28')][_0xa05e('0x29')],function(_0x507258){return{'name':_0x507258[_0xa05e('0x2a')],'type':_0x507258[_0xa05e('0x2b')][_0xa05e('0x2c')]};});_0x4155d9[_0xa05e('0x2d')]=_['map'](_0x3dd9ab,_0xa05e('0x25'));_0x4155d9['query']=_[_0xa05e('0x2e')](_0x4a11ea[_0xa05e('0x2f')]);_0x4155d9[_0xa05e('0x30')]=_[_0xa05e('0x31')](_0x4155d9[_0xa05e('0x2d')],_0x4155d9[_0xa05e('0x2f')]);_0x3a57e5[_0xa05e('0x32')]=_[_0xa05e('0x31')](_0x4155d9[_0xa05e('0x2d')],qs[_0xa05e('0x33')](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x33')]));_0x3a57e5[_0xa05e('0x32')]=_0x3a57e5['attributes'][_0xa05e('0x34')]?_0x3a57e5[_0xa05e('0x32')]:_0x4155d9[_0xa05e('0x2d')];if(!_0x4a11ea['query']['hasOwnProperty'](_0xa05e('0x35'))){_0x3a57e5[_0xa05e('0x1b')]=qs[_0xa05e('0x1b')](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x1b')]);_0x3a57e5[_0xa05e('0x1a')]=qs['offset'](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x1a')]);}_0x3a57e5[_0xa05e('0x36')]=qs['sort'](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x37')]);_0x3a57e5['where']=qs[_0xa05e('0x30')](_[_0xa05e('0x38')](_0x4a11ea[_0xa05e('0x2f')],_0x4155d9['filters']),_0x3dd9ab);if(_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x39')]){_0x3a57e5[_0xa05e('0x3a')]=_['merge'](_0x3a57e5[_0xa05e('0x3a')],{'$or':_[_0xa05e('0x27')](_0x3dd9ab,function(_0x521b83){if(_0x521b83[_0xa05e('0x2b')]!==_0xa05e('0x3b')){var _0x5f055b={};_0x5f055b[_0x521b83['name']]={'$like':'%'+_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x39')]+'%'};return _0x5f055b;}})});}_0x3a57e5=_[_0xa05e('0x3c')]({},_0x3a57e5,_0x4a11ea[_0xa05e('0x3d')]);var _0x3496e7={'where':_0x3a57e5[_0xa05e('0x3a')]};return db[_0xa05e('0x28')][_0xa05e('0x1c')](_0x3496e7)[_0xa05e('0x3e')](function(_0x4ce6ab){_0x55d08c[_0xa05e('0x1c')]=_0x4ce6ab;if(_0x4a11ea[_0xa05e('0x2f')]['includeAll']){_0x3a57e5[_0xa05e('0x3f')]=[{'all':!![]}];}return db[_0xa05e('0x28')]['findAll'](_0x3a57e5);})['then'](function(_0x3db1aa){_0x55d08c[_0xa05e('0x40')]=_0x3db1aa;return _0x55d08c;})['then'](respondWithFilteredResult(_0x21e318,_0x3a57e5))[_0xa05e('0x41')](handleError(_0x21e318,null));};exports[_0xa05e('0x42')]=function(_0x541820,_0x20c0c1){var _0x4d07bc={'raw':!![],'where':{'id':_0x541820[_0xa05e('0x43')]['id']}},_0x4a6897={};_0x4a6897[_0xa05e('0x2d')]=_['keys'](db['JscriptySessionReport'][_0xa05e('0x29')]);_0x4a6897[_0xa05e('0x2f')]=_[_0xa05e('0x2e')](_0x541820[_0xa05e('0x2f')]);_0x4a6897[_0xa05e('0x30')]=_[_0xa05e('0x31')](_0x4a6897[_0xa05e('0x2d')],_0x4a6897['query']);_0x4d07bc[_0xa05e('0x32')]=_[_0xa05e('0x31')](_0x4a6897[_0xa05e('0x2d')],qs[_0xa05e('0x33')](_0x541820['query'][_0xa05e('0x33')]));_0x4d07bc['attributes']=_0x4d07bc[_0xa05e('0x32')]['length']?_0x4d07bc[_0xa05e('0x32')]:_0x4a6897[_0xa05e('0x2d')];if(_0x541820['query'][_0xa05e('0x44')]){_0x4d07bc[_0xa05e('0x3f')]=[{'all':!![]}];}_0x4d07bc=_[_0xa05e('0x3c')]({},_0x4d07bc,_0x541820['options']);return db['JscriptySessionReport']['find'](_0x4d07bc)[_0xa05e('0x3e')](handleEntityNotFound(_0x20c0c1,null))[_0xa05e('0x3e')](respondWithResult(_0x20c0c1,null))[_0xa05e('0x41')](handleError(_0x20c0c1,null));};exports[_0xa05e('0x45')]=function(_0x432f97,_0x5aacbd){return db[_0xa05e('0x28')]['create'](_0x432f97[_0xa05e('0x46')],{})['then'](respondWithResult(_0x5aacbd,0xc9))['catch'](handleError(_0x5aacbd,null));};exports[_0xa05e('0x21')]=function(_0x48d745,_0x4a51c6){if(_0x48d745[_0xa05e('0x46')]['id']){delete _0x48d745[_0xa05e('0x46')]['id'];}return db[_0xa05e('0x28')][_0xa05e('0x47')]({'where':{'id':_0x48d745['params']['id']}})[_0xa05e('0x3e')](handleEntityNotFound(_0x4a51c6,null))['then'](saveUpdates(_0x48d745[_0xa05e('0x46')],null))[_0xa05e('0x3e')](respondWithResult(_0x4a51c6,null))[_0xa05e('0x41')](handleError(_0x4a51c6,null));};exports[_0xa05e('0x48')]=function(_0x1cbc7e,_0x369207){return db[_0xa05e('0x28')][_0xa05e('0x47')]({'where':{'id':_0x1cbc7e['params']['id']}})['then'](handleEntityNotFound(_0x369207,null))[_0xa05e('0x3e')](removeEntity(_0x369207,null))[_0xa05e('0x41')](handleError(_0x369207,null));};exports['describe']=function(_0x16e26e,_0x577971){return db['JscriptySessionReport'][_0xa05e('0x49')]()['then'](respondWithResult(_0x577971,null))[_0xa05e('0x41')](handleError(_0x577971,null));};exports[_0xa05e('0x4a')]=function(_0x25f85a,_0x325554,_0x34459d){var _0x2086b4={'raw':!![],'where':{}};var _0x2d3f8f={};var _0x29923f={'count':0x0,'rows':[]};return db[_0xa05e('0x28')][_0xa05e('0x4b')]({'where':{'id':_0x25f85a[_0xa05e('0x43')]['id']}})[_0xa05e('0x3e')](handleEntityNotFound(_0x325554,null))[_0xa05e('0x3e')](function(_0xe32cf0){if(_0xe32cf0){_0x2d3f8f[_0xa05e('0x2d')]=_['keys'](db[_0xa05e('0x4c')][_0xa05e('0x29')]);_0x2d3f8f[_0xa05e('0x2f')]=_['keys'](_0x25f85a[_0xa05e('0x2f')]);_0x2d3f8f['filters']=_[_0xa05e('0x31')](_0x2d3f8f['model'],_0x2d3f8f[_0xa05e('0x2f')]);_0x2086b4[_0xa05e('0x32')]=_[_0xa05e('0x31')](_0x2d3f8f[_0xa05e('0x2d')],qs[_0xa05e('0x33')](_0x25f85a[_0xa05e('0x2f')][_0xa05e('0x33')]));_0x2086b4['attributes']=_0x2086b4['attributes']['length']?_0x2086b4['attributes']:_0x2d3f8f[_0xa05e('0x2d')];if(!_0x25f85a[_0xa05e('0x2f')][_0xa05e('0x4d')]('nolimit')){_0x2086b4[_0xa05e('0x1b')]=qs[_0xa05e('0x1b')](_0x25f85a['query'][_0xa05e('0x1b')]);_0x2086b4[_0xa05e('0x1a')]=qs[_0xa05e('0x1a')](_0x25f85a[_0xa05e('0x2f')][_0xa05e('0x1a')]);}_0x2086b4[_0xa05e('0x36')]=qs[_0xa05e('0x37')](_0x25f85a['query'][_0xa05e('0x37')]);_0x2086b4[_0xa05e('0x3a')]=qs[_0xa05e('0x30')](_['pick'](_0x25f85a[_0xa05e('0x2f')],_0x2d3f8f[_0xa05e('0x30')]));_0x2086b4[_0xa05e('0x3a')][_0xa05e('0x4e')]=_0xe32cf0['id'];if(_0x25f85a['query']['filter']){_0x2086b4[_0xa05e('0x3a')]=_[_0xa05e('0x3c')](_0x2086b4['where'],{'$or':_['map'](_0x2086b4[_0xa05e('0x32')],function(_0x28cd1b){var _0xa108c9={};_0xa108c9[_0x28cd1b]={'$like':'%'+_0x25f85a['query'][_0xa05e('0x39')]+'%'};return _0xa108c9;})});}_0x2086b4=_[_0xa05e('0x3c')]({},_0x2086b4,_0x25f85a[_0xa05e('0x3d')]);return db[_0xa05e('0x4c')][_0xa05e('0x1c')]({'where':_0x2086b4[_0xa05e('0x3a')]})[_0xa05e('0x3e')](function(_0x3a65ef){_0x29923f[_0xa05e('0x1c')]=_0x3a65ef;if(_0x25f85a[_0xa05e('0x2f')]['includeAll']){_0x2086b4[_0xa05e('0x3f')]=[{'all':!![]}];}return db[_0xa05e('0x4c')][_0xa05e('0x4f')](_0x2086b4);})[_0xa05e('0x3e')](function(_0x2cd7ab){_0x29923f[_0xa05e('0x40')]=_0x2cd7ab;return _0x29923f;});}})['then'](respondWithFilteredResult(_0x325554,_0x2086b4))[_0xa05e('0x41')](handleError(_0x325554,null));}; \ No newline at end of file +var _0x78c5=['apply','reject','save','then','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','update','body','destroy','describe','getQuestions','findOne','keys','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','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','status','end','json','offset','undefined','limit','count','set'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x78c5,0x1c5));var _0x578c=function(_0x4618da,_0x27c024){_0x4618da=_0x4618da-0x0;var _0xede04a=_0x78c5[_0x4618da];return _0xede04a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x578c('0x0'));var zipdir=require(_0x578c('0x1'));var jsonpatch=require(_0x578c('0x2'));var rp=require(_0x578c('0x3'));var moment=require(_0x578c('0x4'));var BPromise=require(_0x578c('0x5'));var Mustache=require(_0x578c('0x6'));var util=require('util');var path=require(_0x578c('0x7'));var sox=require(_0x578c('0x8'));var csv=require(_0x578c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x578c('0xa'));var _=require('lodash');var squel=require(_0x578c('0xb'));var crypto=require(_0x578c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x578c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x578c('0xe'));var Papa=require('papaparse');var Redis=require(_0x578c('0xf'));var authService=require(_0x578c('0x10'));var qs=require(_0x578c('0x11'));var as=require(_0x578c('0x12'));var hardwareService=require(_0x578c('0x13'));var logger=require(_0x578c('0x14'))(_0x578c('0x15'));var utils=require(_0x578c('0x16'));var config=require(_0x578c('0x17'));var licenseUtil=require(_0x578c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x493944,_0x5593d4){_0x5593d4=_0x5593d4||0xcc;return function(_0x26b835){if(_0x26b835){return _0x493944['sendStatus'](_0x5593d4);}return _0x493944[_0x578c('0x19')](_0x5593d4)[_0x578c('0x1a')]();};}function respondWithResult(_0x48a1a5,_0x4284ec){_0x4284ec=_0x4284ec||0xc8;return function(_0x5a1f9){if(_0x5a1f9){return _0x48a1a5[_0x578c('0x19')](_0x4284ec)[_0x578c('0x1b')](_0x5a1f9);}};}function respondWithFilteredResult(_0x13cb2f,_0x171f6c){return function(_0xa7f263){if(_0xa7f263){var _0x3c2525=typeof _0x171f6c[_0x578c('0x1c')]===_0x578c('0x1d')&&typeof _0x171f6c[_0x578c('0x1e')]===_0x578c('0x1d');var _0x4978a9=_0xa7f263[_0x578c('0x1f')];var _0x3671e5=_0x3c2525?0x0:_0x171f6c['offset'];var _0x2dde09=_0x3c2525?_0xa7f263[_0x578c('0x1f')]:_0x171f6c['offset']+_0x171f6c[_0x578c('0x1e')];var _0x4d978a;if(_0x2dde09>=_0x4978a9){_0x2dde09=_0x4978a9;_0x4d978a=0xc8;}else{_0x4d978a=0xce;}_0x13cb2f[_0x578c('0x19')](_0x4d978a);return _0x13cb2f[_0x578c('0x20')]('Content-Range',_0x3671e5+'-'+_0x2dde09+'/'+_0x4978a9)[_0x578c('0x1b')](_0xa7f263);}return null;};}function patchUpdates(_0x205cb8){return function(_0x1bec16){try{jsonpatch[_0x578c('0x21')](_0x1bec16,_0x205cb8,!![]);}catch(_0x4fa3fa){return BPromise[_0x578c('0x22')](_0x4fa3fa);}return _0x1bec16[_0x578c('0x23')]();};}function saveUpdates(_0x42e451,_0x3d7eac){return function(_0x44971d){if(_0x44971d){return _0x44971d['update'](_0x42e451)['then'](function(_0x4b8c73){return _0x4b8c73;});}return null;};}function removeEntity(_0x546884,_0xe26474){return function(_0x12664c){if(_0x12664c){return _0x12664c['destroy']()[_0x578c('0x24')](function(){_0x546884[_0x578c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x950a49,_0x21a8a0){return function(_0x3c9b4d){if(!_0x3c9b4d){_0x950a49[_0x578c('0x25')](0x194);}return _0x3c9b4d;};}function handleError(_0x3683c6,_0x1162d3){_0x1162d3=_0x1162d3||0x1f4;return function(_0x5b8827){logger[_0x578c('0x26')](_0x5b8827[_0x578c('0x27')]);if(_0x5b8827[_0x578c('0x28')]){delete _0x5b8827[_0x578c('0x28')];}_0x3683c6[_0x578c('0x19')](_0x1162d3)[_0x578c('0x29')](_0x5b8827);};}exports[_0x578c('0x2a')]=function(_0x18f24a,_0xa41c1c){var _0x3a30ab={},_0x338cee={},_0x49073b={'count':0x0,'rows':[]};var _0xc20f67=_[_0x578c('0x2b')](db[_0x578c('0x2c')]['rawAttributes'],function(_0x365df2){return{'name':_0x365df2['fieldName'],'type':_0x365df2[_0x578c('0x2d')]['key']};});_0x338cee[_0x578c('0x2e')]=_['map'](_0xc20f67,_0x578c('0x28'));_0x338cee[_0x578c('0x2f')]=_['keys'](_0x18f24a[_0x578c('0x2f')]);_0x338cee[_0x578c('0x30')]=_[_0x578c('0x31')](_0x338cee['model'],_0x338cee[_0x578c('0x2f')]);_0x3a30ab['attributes']=_[_0x578c('0x31')](_0x338cee[_0x578c('0x2e')],qs[_0x578c('0x32')](_0x18f24a[_0x578c('0x2f')]['fields']));_0x3a30ab[_0x578c('0x33')]=_0x3a30ab[_0x578c('0x33')][_0x578c('0x34')]?_0x3a30ab[_0x578c('0x33')]:_0x338cee[_0x578c('0x2e')];if(!_0x18f24a['query'][_0x578c('0x35')](_0x578c('0x36'))){_0x3a30ab['limit']=qs['limit'](_0x18f24a[_0x578c('0x2f')][_0x578c('0x1e')]);_0x3a30ab[_0x578c('0x1c')]=qs[_0x578c('0x1c')](_0x18f24a[_0x578c('0x2f')]['offset']);}_0x3a30ab[_0x578c('0x37')]=qs[_0x578c('0x38')](_0x18f24a['query']['sort']);_0x3a30ab[_0x578c('0x39')]=qs[_0x578c('0x30')](_[_0x578c('0x3a')](_0x18f24a[_0x578c('0x2f')],_0x338cee[_0x578c('0x30')]),_0xc20f67);if(_0x18f24a[_0x578c('0x2f')]['filter']){_0x3a30ab['where']=_['merge'](_0x3a30ab[_0x578c('0x39')],{'$or':_[_0x578c('0x2b')](_0xc20f67,function(_0x4e40db){if(_0x4e40db[_0x578c('0x2d')]!==_0x578c('0x3b')){var _0x25a38c={};_0x25a38c[_0x4e40db[_0x578c('0x28')]]={'$like':'%'+_0x18f24a[_0x578c('0x2f')][_0x578c('0x3c')]+'%'};return _0x25a38c;}})});}_0x3a30ab=_[_0x578c('0x3d')]({},_0x3a30ab,_0x18f24a[_0x578c('0x3e')]);var _0x380713={'where':_0x3a30ab['where']};return db[_0x578c('0x2c')][_0x578c('0x1f')](_0x380713)[_0x578c('0x24')](function(_0x38c3e8){_0x49073b[_0x578c('0x1f')]=_0x38c3e8;if(_0x18f24a[_0x578c('0x2f')][_0x578c('0x3f')]){_0x3a30ab['include']=[{'all':!![]}];}return db[_0x578c('0x2c')][_0x578c('0x40')](_0x3a30ab);})[_0x578c('0x24')](function(_0x3760ab){_0x49073b[_0x578c('0x41')]=_0x3760ab;return _0x49073b;})['then'](respondWithFilteredResult(_0xa41c1c,_0x3a30ab))['catch'](handleError(_0xa41c1c,null));};exports[_0x578c('0x42')]=function(_0x16a5a8,_0x596563){var _0x47d90c={'raw':!![],'where':{'id':_0x16a5a8[_0x578c('0x43')]['id']}},_0x370d9d={};_0x370d9d[_0x578c('0x2e')]=_['keys'](db[_0x578c('0x2c')][_0x578c('0x44')]);_0x370d9d['query']=_['keys'](_0x16a5a8[_0x578c('0x2f')]);_0x370d9d[_0x578c('0x30')]=_[_0x578c('0x31')](_0x370d9d[_0x578c('0x2e')],_0x370d9d['query']);_0x47d90c[_0x578c('0x33')]=_[_0x578c('0x31')](_0x370d9d[_0x578c('0x2e')],qs[_0x578c('0x32')](_0x16a5a8['query'][_0x578c('0x32')]));_0x47d90c['attributes']=_0x47d90c['attributes'][_0x578c('0x34')]?_0x47d90c[_0x578c('0x33')]:_0x370d9d['model'];if(_0x16a5a8[_0x578c('0x2f')][_0x578c('0x3f')]){_0x47d90c[_0x578c('0x45')]=[{'all':!![]}];}_0x47d90c=_[_0x578c('0x3d')]({},_0x47d90c,_0x16a5a8[_0x578c('0x3e')]);return db[_0x578c('0x2c')][_0x578c('0x46')](_0x47d90c)['then'](handleEntityNotFound(_0x596563,null))[_0x578c('0x24')](respondWithResult(_0x596563,null))[_0x578c('0x47')](handleError(_0x596563,null));};exports[_0x578c('0x48')]=function(_0x18a1ef,_0x49fd91){return db[_0x578c('0x2c')][_0x578c('0x48')](_0x18a1ef['body'],{})[_0x578c('0x24')](respondWithResult(_0x49fd91,0xc9))['catch'](handleError(_0x49fd91,null));};exports[_0x578c('0x49')]=function(_0x5d7e89,_0x1e38d0){if(_0x5d7e89[_0x578c('0x4a')]['id']){delete _0x5d7e89[_0x578c('0x4a')]['id'];}return db['JscriptySessionReport'][_0x578c('0x46')]({'where':{'id':_0x5d7e89['params']['id']}})[_0x578c('0x24')](handleEntityNotFound(_0x1e38d0,null))[_0x578c('0x24')](saveUpdates(_0x5d7e89[_0x578c('0x4a')],null))['then'](respondWithResult(_0x1e38d0,null))[_0x578c('0x47')](handleError(_0x1e38d0,null));};exports[_0x578c('0x4b')]=function(_0x445443,_0x4750f7){return db['JscriptySessionReport']['find']({'where':{'id':_0x445443[_0x578c('0x43')]['id']}})[_0x578c('0x24')](handleEntityNotFound(_0x4750f7,null))[_0x578c('0x24')](removeEntity(_0x4750f7,null))['catch'](handleError(_0x4750f7,null));};exports[_0x578c('0x4c')]=function(_0x53847b,_0x272a31){return db['JscriptySessionReport']['describe']()[_0x578c('0x24')](respondWithResult(_0x272a31,null))[_0x578c('0x47')](handleError(_0x272a31,null));};exports[_0x578c('0x4d')]=function(_0x43ed09,_0x3c4671,_0x343665){var _0x2d0f31={'raw':!![],'where':{}};var _0x389358={};var _0x493e52={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x578c('0x4e')]({'where':{'id':_0x43ed09[_0x578c('0x43')]['id']}})[_0x578c('0x24')](handleEntityNotFound(_0x3c4671,null))[_0x578c('0x24')](function(_0x53d556){if(_0x53d556){_0x389358['model']=_[_0x578c('0x4f')](db[_0x578c('0x50')][_0x578c('0x44')]);_0x389358[_0x578c('0x2f')]=_['keys'](_0x43ed09[_0x578c('0x2f')]);_0x389358['filters']=_[_0x578c('0x31')](_0x389358[_0x578c('0x2e')],_0x389358[_0x578c('0x2f')]);_0x2d0f31[_0x578c('0x33')]=_[_0x578c('0x31')](_0x389358[_0x578c('0x2e')],qs['fields'](_0x43ed09[_0x578c('0x2f')]['fields']));_0x2d0f31[_0x578c('0x33')]=_0x2d0f31[_0x578c('0x33')]['length']?_0x2d0f31[_0x578c('0x33')]:_0x389358['model'];if(!_0x43ed09[_0x578c('0x2f')][_0x578c('0x35')]('nolimit')){_0x2d0f31[_0x578c('0x1e')]=qs[_0x578c('0x1e')](_0x43ed09[_0x578c('0x2f')][_0x578c('0x1e')]);_0x2d0f31['offset']=qs[_0x578c('0x1c')](_0x43ed09[_0x578c('0x2f')]['offset']);}_0x2d0f31[_0x578c('0x37')]=qs[_0x578c('0x38')](_0x43ed09['query'][_0x578c('0x38')]);_0x2d0f31['where']=qs[_0x578c('0x30')](_[_0x578c('0x3a')](_0x43ed09['query'],_0x389358[_0x578c('0x30')]));_0x2d0f31[_0x578c('0x39')]['SessionId']=_0x53d556['id'];if(_0x43ed09[_0x578c('0x2f')][_0x578c('0x3c')]){_0x2d0f31['where']=_['merge'](_0x2d0f31[_0x578c('0x39')],{'$or':_[_0x578c('0x2b')](_0x2d0f31[_0x578c('0x33')],function(_0x5d3d12){var _0x533b76={};_0x533b76[_0x5d3d12]={'$like':'%'+_0x43ed09['query'][_0x578c('0x3c')]+'%'};return _0x533b76;})});}_0x2d0f31=_[_0x578c('0x3d')]({},_0x2d0f31,_0x43ed09[_0x578c('0x3e')]);return db[_0x578c('0x50')][_0x578c('0x1f')]({'where':_0x2d0f31['where']})[_0x578c('0x24')](function(_0x5ea716){_0x493e52[_0x578c('0x1f')]=_0x5ea716;if(_0x43ed09[_0x578c('0x2f')][_0x578c('0x3f')]){_0x2d0f31[_0x578c('0x45')]=[{'all':!![]}];}return db[_0x578c('0x50')]['findAll'](_0x2d0f31);})[_0x578c('0x24')](function(_0x3d3aec){_0x493e52['rows']=_0x3d3aec;return _0x493e52;});}})[_0x578c('0x24')](respondWithFilteredResult(_0x3c4671,_0x2d0f31))[_0x578c('0x47')](handleError(_0x3c4671,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a78b1a7..a6a7fef 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 _0xdbf5=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0xc4966b,_0x6cd5e0){var _0x1802bb=function(_0x12f623){while(--_0x12f623){_0xc4966b['push'](_0xc4966b['shift']());}};_0x1802bb(++_0x6cd5e0);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1e2720,_0x9fe431){_0x1e2720=_0x1e2720-0x0;var _0x3752fc=_0xdbf5[_0x1e2720];return _0x3752fc;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x563eb4,_0x29bbae){var _0x97db86=function(_0x5f144f){while(--_0x5f144f){_0x563eb4['push'](_0x563eb4['shift']());}};_0x97db86(++_0x29bbae);}(_0xfcf0,0x138));var _0x0fcf=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xfcf0[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index f567ab1..8fff321 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xb8d37c,_0x10a6a4){var _0x400f4b=function(_0x479ae1){while(--_0x479ae1){_0xb8d37c['push'](_0xb8d37c['shift']());}};_0x400f4b(++_0x10a6a4);}(_0x5fab,0x177));var _0xb5fa=function(_0x56456b,_0x5babd7){_0x56456b=_0x56456b-0x0;var _0x37da11=_0x5fab[_0x56456b];return _0x37da11;};'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']('JscriptySessionReport,\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')]('JscriptySessionReport,\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']('JscriptySessionReport,\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 +var _0xdf55=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0xdf55,0x83));var _0x5df5=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0xdf55[_0x22377a];return _0x36f105;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 803d723..a87b81f 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 _0xb2db=['fs-extra','../../components/auth/service','../../config/environment','index','put','update','get','isAuthenticated','downloadLogFile','exports','multer','path','connect-timeout','express'];(function(_0x552ac5,_0x360a34){var _0x3e7286=function(_0x4db179){while(--_0x4db179){_0x552ac5['push'](_0x552ac5['shift']());}};_0x3e7286(++_0x360a34);}(_0xb2db,0x1d8));var _0xbb2d=function(_0x4a1d76,_0x289b80){_0x4a1d76=_0x4a1d76-0x0;var _0x3c1731=_0xb2db[_0x4a1d76];return _0x3c1731;};'use strict';var multer=require(_0xbb2d('0x0'));var util=require('util');var path=require(_0xbb2d('0x1'));var timeout=require(_0xbb2d('0x2'));var express=require(_0xbb2d('0x3'));var router=express['Router']();var fs_extra=require(_0xbb2d('0x4'));var auth=require(_0xbb2d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbb2d('0x6'));var controller=require('./license.controller');router['get']('/',controller[_0xbb2d('0x7')]);router[_0xbb2d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbb2d('0x9')]);router[_0xbb2d('0xa')]('/download_log_file',auth[_0xbb2d('0xb')](),controller[_0xbb2d('0xc')]);module[_0xbb2d('0xd')]=router; \ No newline at end of file +var _0xf4e1=['../../components/interaction/service','../../config/environment','./license.controller','get','/:id','isAuthenticated','/download_log_file','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x43145c,_0x4ea1b4){var _0x2cee86=function(_0x5141d3){while(--_0x5141d3){_0x43145c['push'](_0x43145c['shift']());}};_0x2cee86(++_0x4ea1b4);}(_0xf4e1,0x1c2));var _0x1f4e=function(_0x601156,_0x37de11){_0x601156=_0x601156-0x0;var _0x5a8e2a=_0xf4e1[_0x601156];return _0x5a8e2a;};'use strict';var multer=require(_0x1f4e('0x0'));var util=require('util');var path=require(_0x1f4e('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f4e('0x2'));var router=express[_0x1f4e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f4e('0x4'));var interaction=require(_0x1f4e('0x5'));var config=require(_0x1f4e('0x6'));var controller=require(_0x1f4e('0x7'));router[_0x1f4e('0x8')]('/',controller['index']);router['put'](_0x1f4e('0x9'),auth[_0x1f4e('0xa')](),controller['update']);router[_0x1f4e('0x8')](_0x1f4e('0xb'),auth[_0x1f4e('0xa')](),controller['downloadLogFile']);module[_0x1f4e('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f0e020b..fb4178e 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 _0xb987=['sequelize','exports','TEXT','INTEGER'];(function(_0x30dace,_0x160f9f){var _0x373d35=function(_0x838234){while(--_0x838234){_0x30dace['push'](_0x30dace['shift']());}};_0x373d35(++_0x160f9f);}(_0xb987,0x98));var _0x7b98=function(_0x51ba3c,_0xc2d5b5){_0x51ba3c=_0x51ba3c-0x0;var _0x147cf6=_0xb987[_0x51ba3c];return _0x147cf6;};'use strict';var Sequelize=require(_0x7b98('0x0'));module[_0x7b98('0x1')]={'license':{'type':Sequelize[_0x7b98('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x7b98('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4fac=['STRING','sequelize','exports','TEXT'];(function(_0x33ef8d,_0x4b4736){var _0x3e5270=function(_0x3f2396){while(--_0x3f2396){_0x33ef8d['push'](_0x33ef8d['shift']());}};_0x3e5270(++_0x4b4736);}(_0x4fac,0x119));var _0xc4fa=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4fac[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xc4fa('0x0'));module[_0xc4fa('0x1')]={'license':{'type':Sequelize[_0xc4fa('0x2')]},'data1':{'type':Sequelize[_0xc4fa('0x3')]},'data2':{'type':Sequelize[_0xc4fa('0x3')]},'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 11a0242..eacd97f 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 _0xe8d2=['update','then','destroy','error','name','send','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','length','merge','options','getLicense','body','find','checkLicense','key','catch','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe8d2,0xac));var _0x2e8d=function(_0x231fe7,_0xb617ba){_0x231fe7=_0x231fe7-0x0;var _0x3dc2ab=_0xe8d2[_0x231fe7];return _0x3dc2ab;};'use strict';var emlformat=require(_0x2e8d('0x0'));var rimraf=require(_0x2e8d('0x1'));var zipdir=require(_0x2e8d('0x2'));var jsonpatch=require(_0x2e8d('0x3'));var rp=require(_0x2e8d('0x4'));var moment=require(_0x2e8d('0x5'));var BPromise=require(_0x2e8d('0x6'));var Mustache=require(_0x2e8d('0x7'));var util=require(_0x2e8d('0x8'));var path=require('path');var sox=require(_0x2e8d('0x9'));var csv=require(_0x2e8d('0xa'));var ejs=require(_0x2e8d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2e8d('0xc'));var crypto=require(_0x2e8d('0xd'));var jsforce=require(_0x2e8d('0xe'));var deskjs=require(_0x2e8d('0xf'));var toCsv=require(_0x2e8d('0xa'));var querystring=require('querystring');var Papa=require(_0x2e8d('0x10'));var Redis=require(_0x2e8d('0x11'));var authService=require(_0x2e8d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2e8d('0x13'));var hardwareService=require(_0x2e8d('0x14'));var logger=require(_0x2e8d('0x15'))('api');var utils=require(_0x2e8d('0x16'));var config=require(_0x2e8d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x340dad,_0x115a95){_0x115a95=_0x115a95||0xcc;return function(_0x4db608){if(_0x4db608){return _0x340dad[_0x2e8d('0x18')](_0x115a95);}return _0x340dad['status'](_0x115a95)[_0x2e8d('0x19')]();};}function respondWithResult(_0x33bebf,_0x5e0847){_0x5e0847=_0x5e0847||0xc8;return function(_0x15cb65){if(_0x15cb65){return _0x33bebf[_0x2e8d('0x1a')](_0x5e0847)[_0x2e8d('0x1b')](_0x15cb65);}};}function respondWithFilteredResult(_0x4abec6,_0xf533a6){return function(_0x49420a){if(_0x49420a){var _0x3f29a3=typeof _0xf533a6[_0x2e8d('0x1c')]===_0x2e8d('0x1d')&&typeof _0xf533a6['limit']===_0x2e8d('0x1d');var _0x1d5a5c=_0x49420a[_0x2e8d('0x1e')];var _0x4955d6=_0x3f29a3?0x0:_0xf533a6[_0x2e8d('0x1c')];var _0x49268f=_0x3f29a3?_0x49420a[_0x2e8d('0x1e')]:_0xf533a6[_0x2e8d('0x1c')]+_0xf533a6[_0x2e8d('0x1f')];var _0x5970f9;if(_0x49268f>=_0x1d5a5c){_0x49268f=_0x1d5a5c;_0x5970f9=0xc8;}else{_0x5970f9=0xce;}_0x4abec6['status'](_0x5970f9);return _0x4abec6['set']('Content-Range',_0x4955d6+'-'+_0x49268f+'/'+_0x1d5a5c)[_0x2e8d('0x1b')](_0x49420a);}return null;};}function patchUpdates(_0x1cc0ec){return function(_0x343b3d){try{jsonpatch[_0x2e8d('0x20')](_0x343b3d,_0x1cc0ec,!![]);}catch(_0x171015){return BPromise[_0x2e8d('0x21')](_0x171015);}return _0x343b3d[_0x2e8d('0x22')]();};}function saveUpdates(_0x575777,_0x20aac2){return function(_0x31f78c){if(_0x31f78c){return _0x31f78c[_0x2e8d('0x23')](_0x575777)[_0x2e8d('0x24')](function(_0x4aca53){return _0x4aca53;});}return null;};}function removeEntity(_0x578dc2,_0xcdbac6){return function(_0x5403b7){if(_0x5403b7){return _0x5403b7[_0x2e8d('0x25')]()['then'](function(){_0x578dc2[_0x2e8d('0x1a')](0xcc)[_0x2e8d('0x19')]();});}};}function handleEntityNotFound(_0x2ac264,_0x5f57d8){return function(_0x33095f){if(!_0x33095f){_0x2ac264[_0x2e8d('0x18')](0x194);}return _0x33095f;};}function handleError(_0x2b8df0,_0x16a472){_0x16a472=_0x16a472||0x1f4;return function(_0x294c3a){logger[_0x2e8d('0x26')](_0x294c3a['stack']);if(_0x294c3a['name']){delete _0x294c3a[_0x2e8d('0x27')];}_0x2b8df0[_0x2e8d('0x1a')](_0x16a472)[_0x2e8d('0x28')](_0x294c3a);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x5d52b2,_0x52ef78){var _0x3f39e1={'raw':!![],'where':{'id':0x1}},_0x4fa799={};_0x4fa799[_0x2e8d('0x29')]=_[_0x2e8d('0x2a')](db[_0x2e8d('0x2b')][_0x2e8d('0x2c')]);_0x4fa799['query']=_['keys'](_0x5d52b2[_0x2e8d('0x2d')]);_0x4fa799[_0x2e8d('0x2e')]=_['intersection'](_0x4fa799[_0x2e8d('0x29')],_0x4fa799[_0x2e8d('0x2d')]);_0x3f39e1[_0x2e8d('0x2f')]=_[_0x2e8d('0x30')](_0x4fa799[_0x2e8d('0x29')],qs[_0x2e8d('0x31')](_0x5d52b2[_0x2e8d('0x2d')][_0x2e8d('0x31')]));_0x3f39e1[_0x2e8d('0x2f')]=_0x3f39e1['attributes'][_0x2e8d('0x32')]?_0x3f39e1[_0x2e8d('0x2f')]:_0x4fa799['model'];_0x3f39e1=_[_0x2e8d('0x33')]({},_0x3f39e1,_0x5d52b2[_0x2e8d('0x34')]);return utilLicense[_0x2e8d('0x35')](_0x3f39e1)['then'](respondWithResult(_0x52ef78,null))['catch'](handleError(_0x52ef78,null));};exports['update']=function(_0x2ab21e,_0x59fa0c){if(_0x2ab21e[_0x2e8d('0x36')]['id']){delete _0x2ab21e[_0x2e8d('0x36')]['id'];}return db[_0x2e8d('0x2b')][_0x2e8d('0x37')]({'where':{'id':_0x2ab21e['params']['id']}})['then'](handleEntityNotFound(_0x59fa0c,null))['then'](function(_0x114435){var _0x47eba6=_0x114435['get']({'plain':!![]});return utilLicense[_0x2e8d('0x38')](_0x47eba6,_0x2ab21e['body'][_0x2e8d('0x39')]);})[_0x2e8d('0x24')](function(_0x28796d){if(!_0x28796d['demo']){return saveUpdates(_0x2ab21e[_0x2e8d('0x36')],null);}return _0x28796d;})['then'](respondWithResult(_0x59fa0c,null))[_0x2e8d('0x3a')](handleError(_0x59fa0c,null));};exports['downloadLogFile']=function(_0x2c64e0,_0x3ef524){var _0x314591=_0x2e8d('0x3b');var _0x3297ae=path[_0x2e8d('0x3c')](_0x2e8d('0x3d'),_0x2e8d('0x3e'),_0x2e8d('0x3f'),_0x314591);_0x3ef524[_0x2e8d('0x40')](_0x2e8d('0x41'),_0x2e8d('0x42')+_0x314591);_0x3ef524['set']('Content-Type',_0x2e8d('0x43'));_0x3ef524[_0x2e8d('0x44')](_0x3297ae);}; \ No newline at end of file +var _0x7a63=['xcally','Content-disposition','attachment;\x20filename=','text/plain','eml-format','request-promise','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','then','sendStatus','stack','name','send','index','rawAttributes','query','keys','intersection','model','attributes','fields','length','merge','options','getLicense','catch','body','find','params','checkLicense','key','demo','downloadLogFile','join','/var'];(function(_0x4e8ba9,_0x2650e1){var _0x538f28=function(_0x2531bb){while(--_0x2531bb){_0x4e8ba9['push'](_0x4e8ba9['shift']());}};_0x538f28(++_0x2650e1);}(_0x7a63,0x7c));var _0x37a6=function(_0x143b0f,_0x17b46e){_0x143b0f=_0x143b0f-0x0;var _0x46f47d=_0x7a63[_0x143b0f];return _0x46f47d;};'use strict';var emlformat=require(_0x37a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x37a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37a6('0x2'));var util=require(_0x37a6('0x3'));var path=require('path');var sox=require(_0x37a6('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37a6('0x5'));var _=require('lodash');var squel=require(_0x37a6('0x6'));var crypto=require(_0x37a6('0x7'));var jsforce=require(_0x37a6('0x8'));var deskjs=require(_0x37a6('0x9'));var toCsv=require(_0x37a6('0xa'));var querystring=require(_0x37a6('0xb'));var Papa=require('papaparse');var Redis=require(_0x37a6('0xc'));var authService=require(_0x37a6('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x37a6('0xe'))(_0x37a6('0xf'));var utils=require(_0x37a6('0x10'));var config=require(_0x37a6('0x11'));var licenseUtil=require(_0x37a6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27f277,_0x5ba285){_0x5ba285=_0x5ba285||0xcc;return function(_0x3cecca){if(_0x3cecca){return _0x27f277['sendStatus'](_0x5ba285);}return _0x27f277[_0x37a6('0x13')](_0x5ba285)[_0x37a6('0x14')]();};}function respondWithResult(_0x9216a,_0x3c770f){_0x3c770f=_0x3c770f||0xc8;return function(_0x34b617){if(_0x34b617){return _0x9216a[_0x37a6('0x13')](_0x3c770f)[_0x37a6('0x15')](_0x34b617);}};}function respondWithFilteredResult(_0x1674ab,_0x580ad0){return function(_0x33deb0){if(_0x33deb0){var _0x5e1dc4=typeof _0x580ad0[_0x37a6('0x16')]==='undefined'&&typeof _0x580ad0[_0x37a6('0x17')]===_0x37a6('0x18');var _0x2bb337=_0x33deb0[_0x37a6('0x19')];var _0x494f7b=_0x5e1dc4?0x0:_0x580ad0[_0x37a6('0x16')];var _0x165e21=_0x5e1dc4?_0x33deb0[_0x37a6('0x19')]:_0x580ad0[_0x37a6('0x16')]+_0x580ad0[_0x37a6('0x17')];var _0x214922;if(_0x165e21>=_0x2bb337){_0x165e21=_0x2bb337;_0x214922=0xc8;}else{_0x214922=0xce;}_0x1674ab[_0x37a6('0x13')](_0x214922);return _0x1674ab['set'](_0x37a6('0x1a'),_0x494f7b+'-'+_0x165e21+'/'+_0x2bb337)[_0x37a6('0x15')](_0x33deb0);}return null;};}function patchUpdates(_0x17cb9b){return function(_0x34c704){try{jsonpatch[_0x37a6('0x1b')](_0x34c704,_0x17cb9b,!![]);}catch(_0x3be542){return BPromise['reject'](_0x3be542);}return _0x34c704['save']();};}function saveUpdates(_0x3de550,_0x54aaba){return function(_0x4b5c83){if(_0x4b5c83){return _0x4b5c83[_0x37a6('0x1c')](_0x3de550)[_0x37a6('0x1d')](function(_0x2268a){return _0x2268a;});}return null;};}function removeEntity(_0x115618,_0x2b6174){return function(_0x19417c){if(_0x19417c){return _0x19417c['destroy']()[_0x37a6('0x1d')](function(){_0x115618[_0x37a6('0x13')](0xcc)[_0x37a6('0x14')]();});}};}function handleEntityNotFound(_0x23e05c,_0x3df2a9){return function(_0x3b1fea){if(!_0x3b1fea){_0x23e05c[_0x37a6('0x1e')](0x194);}return _0x3b1fea;};}function handleError(_0x5a113e,_0x599b62){_0x599b62=_0x599b62||0x1f4;return function(_0x5eb9c9){logger['error'](_0x5eb9c9[_0x37a6('0x1f')]);if(_0x5eb9c9[_0x37a6('0x20')]){delete _0x5eb9c9[_0x37a6('0x20')];}_0x5a113e[_0x37a6('0x13')](_0x599b62)[_0x37a6('0x21')](_0x5eb9c9);};}var utilLicense=require(_0x37a6('0x12'));exports[_0x37a6('0x22')]=function(_0x480ddd,_0x36e2f1){var _0x2b3f80={'raw':!![],'where':{'id':0x1}},_0x21ea65={};_0x21ea65['model']=_['keys'](db['License'][_0x37a6('0x23')]);_0x21ea65[_0x37a6('0x24')]=_[_0x37a6('0x25')](_0x480ddd[_0x37a6('0x24')]);_0x21ea65['filters']=_[_0x37a6('0x26')](_0x21ea65[_0x37a6('0x27')],_0x21ea65[_0x37a6('0x24')]);_0x2b3f80[_0x37a6('0x28')]=_['intersection'](_0x21ea65[_0x37a6('0x27')],qs[_0x37a6('0x29')](_0x480ddd[_0x37a6('0x24')][_0x37a6('0x29')]));_0x2b3f80[_0x37a6('0x28')]=_0x2b3f80[_0x37a6('0x28')][_0x37a6('0x2a')]?_0x2b3f80[_0x37a6('0x28')]:_0x21ea65[_0x37a6('0x27')];_0x2b3f80=_[_0x37a6('0x2b')]({},_0x2b3f80,_0x480ddd[_0x37a6('0x2c')]);return utilLicense[_0x37a6('0x2d')](_0x2b3f80)[_0x37a6('0x1d')](respondWithResult(_0x36e2f1,null))[_0x37a6('0x2e')](handleError(_0x36e2f1,null));};exports[_0x37a6('0x1c')]=function(_0x29bae5,_0x5186fa){if(_0x29bae5[_0x37a6('0x2f')]['id']){delete _0x29bae5['body']['id'];}return db['License'][_0x37a6('0x30')]({'where':{'id':_0x29bae5[_0x37a6('0x31')]['id']}})[_0x37a6('0x1d')](handleEntityNotFound(_0x5186fa,null))[_0x37a6('0x1d')](function(_0x21dd41){var _0x194ce8=_0x21dd41['get']({'plain':!![]});return utilLicense[_0x37a6('0x32')](_0x194ce8,_0x29bae5[_0x37a6('0x2f')][_0x37a6('0x33')]);})[_0x37a6('0x1d')](function(_0x292e60){if(!_0x292e60[_0x37a6('0x34')]){return saveUpdates(_0x29bae5[_0x37a6('0x2f')],null);}return _0x292e60;})['then'](respondWithResult(_0x5186fa,null))[_0x37a6('0x2e')](handleError(_0x5186fa,null));};exports[_0x37a6('0x35')]=function(_0x4396b8,_0x366b82){var _0x51e9af='license-info.log';var _0x41f446=path[_0x37a6('0x36')](_0x37a6('0x37'),'log',_0x37a6('0x38'),_0x51e9af);_0x366b82['setHeader'](_0x37a6('0x39'),_0x37a6('0x3a')+_0x51e9af);_0x366b82['set']('Content-Type',_0x37a6('0x3b'));_0x366b82['download'](_0x41f446);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 6eb784d..7f5a0f0 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 _0x93ca=['License','license','lodash','util','../../config/logger','path','rimraf','../../config/environment','define'];(function(_0x1f8679,_0x58bd3a){var _0x31f86f=function(_0x12c327){while(--_0x12c327){_0x1f8679['push'](_0x1f8679['shift']());}};_0x31f86f(++_0x58bd3a);}(_0x93ca,0xec));var _0xa93c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ca[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa93c('0x0'));var util=require(_0xa93c('0x1'));var logger=require(_0xa93c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa93c('0x3'));var rimraf=require(_0xa93c('0x4'));var config=require(_0xa93c('0x5'));var attributes=require('./license.attributes');module['exports']=function(_0x5076b4,_0x15724e){return _0x5076b4[_0xa93c('0x6')](_0xa93c('0x7'),attributes,{'tableName':_0xa93c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58b2=['./license.attributes','License','license','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x253541,_0x516818){var _0x4fdbaf=function(_0x5816c2){while(--_0x5816c2){_0x253541['push'](_0x253541['shift']());}};_0x4fdbaf(++_0x516818);}(_0x58b2,0xd5));var _0x258b=function(_0x18c44d,_0x33976d){_0x18c44d=_0x18c44d-0x0;var _0x71abcf=_0x58b2[_0x18c44d];return _0x71abcf;};'use strict';var _=require(_0x258b('0x0'));var util=require(_0x258b('0x1'));var logger=require('../../config/logger')(_0x258b('0x2'));var moment=require(_0x258b('0x3'));var BPromise=require('bluebird');var rp=require(_0x258b('0x4'));var fs=require('fs');var path=require(_0x258b('0x5'));var rimraf=require('rimraf');var config=require(_0x258b('0x6'));var attributes=require(_0x258b('0x7'));module['exports']=function(_0x8da836,_0x61b608){return _0x8da836['define'](_0x258b('0x8'),attributes,{'tableName':_0x258b('0x9'),'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 8f69499..a8f1f8b 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 _0x3b78=['message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x3b78,0x18e));var _0x83b7=function(_0xc971a4,_0x5b381c){_0xc971a4=_0xc971a4-0x0;var _0x4ebd6b=_0x3b78[_0xc971a4];return _0x4ebd6b;};'use strict';var _=require(_0x83b7('0x0'));var util=require(_0x83b7('0x1'));var moment=require(_0x83b7('0x2'));var BPromise=require('bluebird');var rs=require(_0x83b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83b7('0x4'))['db'];var utils=require(_0x83b7('0x5'));var logger=require('../../config/logger')(_0x83b7('0x6'));var config=require(_0x83b7('0x7'));var jayson=require(_0x83b7('0x8'));var client=jayson[_0x83b7('0x9')][_0x83b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13079a,_0x32ecd1,_0x2b1ed7){return new BPromise(function(_0x319a1c,_0x3626c8){return client['request'](_0x13079a,_0x2b1ed7)[_0x83b7('0xb')](function(_0x4bdcfd){logger[_0x83b7('0xc')](_0x83b7('0xd'),_0x32ecd1,'request\x20sent');logger[_0x83b7('0xe')](_0x83b7('0xf'),_0x32ecd1,_0x83b7('0x10'),JSON[_0x83b7('0x11')](_0x4bdcfd));if(_0x4bdcfd[_0x83b7('0x12')]){if(_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x13')]===0x1f4){logger[_0x83b7('0x12')](_0x83b7('0xd'),_0x32ecd1,_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);return _0x3626c8(_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);}logger[_0x83b7('0x12')](_0x83b7('0xd'),_0x32ecd1,_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);return _0x319a1c(_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);}else{logger[_0x83b7('0xc')](_0x83b7('0xd'),_0x32ecd1,_0x83b7('0x10'));_0x319a1c(_0x4bdcfd[_0x83b7('0x15')][_0x83b7('0x14')]);}})['catch'](function(_0x3a5574){logger['error'](_0x83b7('0xd'),_0x32ecd1,_0x3a5574);_0x3626c8(_0x3a5574);});});} \ No newline at end of file +var _0x10e8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x10e8,0x13a));var _0x810e=function(_0x2bd453,_0x322572){_0x2bd453=_0x2bd453-0x0;var _0x36c295=_0x10e8[_0x2bd453];return _0x36c295;};'use strict';var _=require(_0x810e('0x0'));var util=require(_0x810e('0x1'));var moment=require(_0x810e('0x2'));var BPromise=require(_0x810e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x810e('0x4'));var db=require(_0x810e('0x5'))['db'];var utils=require(_0x810e('0x6'));var logger=require(_0x810e('0x7'))('rpc');var config=require(_0x810e('0x8'));var jayson=require(_0x810e('0x9'));var client=jayson[_0x810e('0xa')][_0x810e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2abc04,_0x55e377,_0x1f36c2){return new BPromise(function(_0x21b280,_0x120c0f){return client['request'](_0x2abc04,_0x1f36c2)['then'](function(_0xc8e8fc){logger[_0x810e('0xc')](_0x810e('0xd'),_0x55e377,_0x810e('0xe'));logger[_0x810e('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x55e377,'request\x20sent',JSON[_0x810e('0x10')](_0xc8e8fc));if(_0xc8e8fc[_0x810e('0x11')]){if(_0xc8e8fc[_0x810e('0x11')]['code']===0x1f4){logger['error'](_0x810e('0xd'),_0x55e377,_0xc8e8fc['error']['message']);return _0x120c0f(_0xc8e8fc[_0x810e('0x11')]['message']);}logger['error'](_0x810e('0xd'),_0x55e377,_0xc8e8fc['error'][_0x810e('0x12')]);return _0x21b280(_0xc8e8fc[_0x810e('0x11')][_0x810e('0x12')]);}else{logger[_0x810e('0xc')](_0x810e('0xd'),_0x55e377,_0x810e('0xe'));_0x21b280(_0xc8e8fc[_0x810e('0x13')][_0x810e('0x12')]);}})[_0x810e('0x14')](function(_0x11f8e5){logger[_0x810e('0x11')](_0x810e('0xd'),_0x55e377,_0x11f8e5);_0x120c0f(_0x11f8e5);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 4512dfa..cf676eb 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 _0x7d44=['getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','addImap','addSmtp','addInteraction','addApplications','send','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications'];(function(_0x3a7ff9,_0x32ff9e){var _0x40cb5c=function(_0x4d0108){while(--_0x4d0108){_0x3a7ff9['push'](_0x3a7ff9['shift']());}};_0x40cb5c(++_0x32ff9e);}(_0x7d44,0x159));var _0x47d4=function(_0x4d1e4d,_0x3b61d4){_0x4d1e4d=_0x4d1e4d-0x0;var _0x5cf861=_0x7d44[_0x4d1e4d];return _0x5cf861;};'use strict';var multer=require(_0x47d4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x47d4('0x1'));var express=require(_0x47d4('0x2'));var router=express['Router']();var fs_extra=require(_0x47d4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x47d4('0x4'));var config=require(_0x47d4('0x5'));var controller=require('./mailAccount.controller');router[_0x47d4('0x6')]('/',auth[_0x47d4('0x7')](),controller[_0x47d4('0x8')]);router[_0x47d4('0x6')](_0x47d4('0x9'),auth[_0x47d4('0x7')](),controller[_0x47d4('0xa')]);router['get']('/:id',auth[_0x47d4('0x7')](),controller[_0x47d4('0xb')]);router[_0x47d4('0x6')](_0x47d4('0xc'),auth[_0x47d4('0x7')](),controller[_0x47d4('0xd')]);router[_0x47d4('0x6')](_0x47d4('0xe'),auth['isAuthenticated'](),controller[_0x47d4('0xf')]);router[_0x47d4('0x6')](_0x47d4('0x10'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x11')]);router[_0x47d4('0x6')](_0x47d4('0x12'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x13')]);router[_0x47d4('0x6')](_0x47d4('0x14'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x15')]);router[_0x47d4('0x6')](_0x47d4('0x16'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x17')]);router[_0x47d4('0x6')](_0x47d4('0x18'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x19')]);router[_0x47d4('0x6')](_0x47d4('0x1a'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x1b')]);router[_0x47d4('0x6')](_0x47d4('0x1c'),auth['isAuthenticated'](),controller[_0x47d4('0x1d')]);router['post'](_0x47d4('0xc'),auth[_0x47d4('0x7')](),controller['addDisposition']);router[_0x47d4('0x1e')](_0x47d4('0xe'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x1f')]);router[_0x47d4('0x1e')]('/',auth[_0x47d4('0x7')](),controller['create']);router[_0x47d4('0x1e')](_0x47d4('0x10'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x20')]);router[_0x47d4('0x1e')](_0x47d4('0x12'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x21')]);router[_0x47d4('0x1e')](_0x47d4('0x14'),auth['isAuthenticated'](),controller[_0x47d4('0x22')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x47d4('0x23')]);router[_0x47d4('0x1e')]('/:id/send',auth[_0x47d4('0x7')](),controller[_0x47d4('0x24')]);router[_0x47d4('0x1e')](_0x47d4('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x47d4('0x25'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x26')]);router[_0x47d4('0x27')](_0x47d4('0xc'),auth['isAuthenticated'](),controller[_0x47d4('0x28')]);router['delete'](_0x47d4('0xe'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x29')]);router[_0x47d4('0x27')](_0x47d4('0x10'),auth['isAuthenticated'](),controller[_0x47d4('0x2a')]);router[_0x47d4('0x27')](_0x47d4('0x12'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x2b')]);router[_0x47d4('0x27')](_0x47d4('0x25'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x2c')]);router[_0x47d4('0x27')](_0x47d4('0x1c'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x2d')]);module['exports']=router; \ No newline at end of file +var _0x4005=['addApplications','/:id/send','send','/:id/users','put','delete','removeDispositions','removeImap','removeSmtp','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','getAgents','post','/:id/canned_answers','create','addInteraction'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0x4005,0x17c));var _0x5400=function(_0x4a09bf,_0x45b7c0){_0x4a09bf=_0x4a09bf-0x0;var _0x5cbad8=_0x4005[_0x4a09bf];return _0x5cbad8;};'use strict';var multer=require(_0x5400('0x0'));var util=require('util');var path=require(_0x5400('0x1'));var timeout=require(_0x5400('0x2'));var express=require(_0x5400('0x3'));var router=express[_0x5400('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5400('0x5'));var config=require(_0x5400('0x6'));var controller=require(_0x5400('0x7'));router[_0x5400('0x8')]('/',auth[_0x5400('0x9')](),controller[_0x5400('0xa')]);router['get'](_0x5400('0xb'),auth[_0x5400('0x9')](),controller['describe']);router[_0x5400('0x8')](_0x5400('0xc'),auth['isAuthenticated'](),controller[_0x5400('0xd')]);router[_0x5400('0x8')](_0x5400('0xe'),auth[_0x5400('0x9')](),controller['getDispositions']);router[_0x5400('0x8')]('/:id/canned_answers',auth[_0x5400('0x9')](),controller[_0x5400('0xf')]);router[_0x5400('0x8')](_0x5400('0x10'),auth['isAuthenticated'](),controller[_0x5400('0x11')]);router['get'](_0x5400('0x12'),auth[_0x5400('0x9')](),controller['getSmtp']);router['get'](_0x5400('0x13'),auth[_0x5400('0x9')](),controller['getInteractions']);router[_0x5400('0x8')](_0x5400('0x14'),auth[_0x5400('0x9')](),controller[_0x5400('0x15')]);router['get'](_0x5400('0x16'),auth[_0x5400('0x9')](),controller[_0x5400('0x17')]);router[_0x5400('0x8')]('/:id/verify',auth[_0x5400('0x9')](),controller[_0x5400('0x18')]);router['get']('/:id/users',auth[_0x5400('0x9')](),controller[_0x5400('0x19')]);router[_0x5400('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x5400('0x1a')](_0x5400('0x1b'),auth[_0x5400('0x9')](),controller['addAnswer']);router[_0x5400('0x1a')]('/',auth['isAuthenticated'](),controller[_0x5400('0x1c')]);router[_0x5400('0x1a')]('/:id/in_servers',auth[_0x5400('0x9')](),controller['addImap']);router[_0x5400('0x1a')](_0x5400('0x12'),auth['isAuthenticated'](),controller['addSmtp']);router['post'](_0x5400('0x13'),auth[_0x5400('0x9')](),controller[_0x5400('0x1d')]);router[_0x5400('0x1a')]('/:id/applications',auth[_0x5400('0x9')](),controller[_0x5400('0x1e')]);router[_0x5400('0x1a')](_0x5400('0x1f'),auth[_0x5400('0x9')](),controller[_0x5400('0x20')]);router[_0x5400('0x1a')](_0x5400('0x21'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5400('0x22')](_0x5400('0xc'),auth[_0x5400('0x9')](),controller['update']);router[_0x5400('0x23')](_0x5400('0xe'),auth[_0x5400('0x9')](),controller[_0x5400('0x24')]);router['delete']('/:id/canned_answers',auth[_0x5400('0x9')](),controller['removeAnswers']);router[_0x5400('0x23')]('/:id/in_servers',auth[_0x5400('0x9')](),controller[_0x5400('0x25')]);router[_0x5400('0x23')](_0x5400('0x12'),auth[_0x5400('0x9')](),controller[_0x5400('0x26')]);router[_0x5400('0x23')](_0x5400('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x5400('0x23')](_0x5400('0x21'),auth[_0x5400('0x9')](),controller[_0x5400('0x27')]);module[_0x5400('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index cab2fbb..10ed23e 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 _0x7d66=['provider','custom','sequelize','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','outlook365'];(function(_0x20ea59,_0x13560d){var _0x155a4f=function(_0x47cc7e){while(--_0x47cc7e){_0x20ea59['push'](_0x20ea59['shift']());}};_0x155a4f(++_0x13560d);}(_0x7d66,0xce));var _0x67d6=function(_0x582274,_0x2cbd9c){_0x582274=_0x582274-0x0;var _0x8f14d3=_0x7d66[_0x582274];return _0x8f14d3;};'use strict';var Sequelize=require(_0x67d6('0x0'));module[_0x67d6('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x67d6('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x67d6('0x4')]},'markAsUnread':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x67d6('0x3')],'allowNull':![],'defaultValue':_0x67d6('0x5')},'fontSize':{'type':Sequelize[_0x67d6('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x67d6('0x4')],'defaultValue':function(){return _0x67d6('0x7');}},'notificationSound':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x67d6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x67d6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x67d6('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3959f0){if(!_0x3959f0)this[_0x67d6('0x8')](_0x67d6('0x9'),null);this['setDataValue'](_0x67d6('0xa'),_0x3959f0);}},'provider':{'type':Sequelize['ENUM'](_0x67d6('0xb'),_0x67d6('0xc'),_0x67d6('0xd'),_0x67d6('0xe')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x67d6('0xf')))return _0x67d6('0x10');return this['getDataValue']('provider');},'set':function(_0x5a5292){if(_0x5a5292==='custom')_0x5a5292=null;return this[_0x67d6('0x8')](_0x67d6('0xf'),_0x5a5292);}}}; \ No newline at end of file +var _0xa421=['UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER'];(function(_0x529b01,_0x2974dc){var _0x5b27bd=function(_0x2518b3){while(--_0x2518b3){_0x529b01['push'](_0x529b01['shift']());}};_0x5b27bd(++_0x2974dc);}(_0xa421,0x1b4));var _0x1a42=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xa421[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require(_0x1a42('0x0'));module[_0x1a42('0x1')]={'description':{'type':Sequelize[_0x1a42('0x2')]},'name':{'type':Sequelize[_0x1a42('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x1a42('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x1a42('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1a42('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x1a42('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1a42('0x2')],'allowNull':![],'defaultValue':_0x1a42('0x4')},'fontSize':{'type':Sequelize[_0x1a42('0x5')](0x2)[_0x1a42('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1a42('0x7');}},'notificationSound':{'type':Sequelize[_0x1a42('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1a42('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1a42('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1a42('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1a42('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a42('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x47f5f3){if(!_0x47f5f3)this[_0x1a42('0x8')](_0x1a42('0x9'),null);this[_0x1a42('0x8')](_0x1a42('0xa'),_0x47f5f3);}},'provider':{'type':Sequelize[_0x1a42('0xb')](_0x1a42('0xc'),_0x1a42('0xd'),_0x1a42('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x1a42('0xf')](_0x1a42('0x10')))return'custom';return this['getDataValue'](_0x1a42('0x10'));},'set':function(_0x227508){if(_0x227508==='custom')_0x227508=null;return this['setDataValue'](_0x1a42('0x10'),_0x227508);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e32906b..f75f2ad 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 _0x7807=['active','description','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','fullname','internal','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','json','getApplications','getMessages','MailMessage','$gte','format','inlineCss','true','split','List','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','join','root','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','sendStatus','stack','name','send','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','find','body','params','Pause','mandatoryDispositionPause','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer','create','removeAnswers','provider','custom'];(function(_0x21e4e8,_0x56756b){var _0x389a84=function(_0x131b30){while(--_0x131b30){_0x21e4e8['push'](_0x21e4e8['shift']());}};_0x389a84(++_0x56756b);}(_0x7807,0x118));var _0x7780=function(_0x5e5cb1,_0x43d287){_0x5e5cb1=_0x5e5cb1-0x0;var _0x3896c9=_0x7807[_0x5e5cb1];return _0x3896c9;};'use strict';var moment=require(_0x7780('0x0'));var BPromise=require(_0x7780('0x1'));var util=require(_0x7780('0x2'));var path=require(_0x7780('0x3'));var _=require('lodash');var juice=require(_0x7780('0x4'));var Redis=require(_0x7780('0x5'));var qs=require(_0x7780('0x6'));var logger=require(_0x7780('0x7'))(_0x7780('0x8'));var config=require(_0x7780('0x9'));var db=require(_0x7780('0xa'))['db'];config['redis']=_[_0x7780('0xb')](config[_0x7780('0xc')],{'host':_0x7780('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7780('0xc')]));require(_0x7780('0xe'))[_0x7780('0xf')](socket);var jayson=require(_0x7780('0x10'));var client=jayson[_0x7780('0x11')][_0x7780('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x37275f,_0x5d1ee1,_0x1e7ffc,_0x349193){return new BPromise(function(_0x32d3a6,_0x4d0145){var _0x1ff702=_0x349193||client;return _0x1ff702[_0x7780('0x13')](_0x37275f,_0x1e7ffc)[_0x7780('0x14')](function(_0x4cf4a3){logger[_0x7780('0x15')](_0x7780('0x16'),_0x5d1ee1,_0x7780('0x17'));logger['debug'](_0x7780('0x18'),_0x5d1ee1,_0x7780('0x17'),JSON[_0x7780('0x19')](_0x4cf4a3));if(_0x4cf4a3[_0x7780('0x1a')]){if(_0x4cf4a3[_0x7780('0x1a')][_0x7780('0x1b')]===0x1f4){logger['error'](_0x7780('0x16'),_0x5d1ee1,_0x4cf4a3['error'][_0x7780('0x1c')]);return _0x4d0145(_0x4cf4a3[_0x7780('0x1a')][_0x7780('0x1c')]);}logger['error'](_0x7780('0x16'),_0x5d1ee1,_0x4cf4a3['error'][_0x7780('0x1c')]);return _0x32d3a6(_0x4cf4a3[_0x7780('0x1a')][_0x7780('0x1c')]);}else{logger['info'](_0x7780('0x16'),_0x5d1ee1,'request\x20sent');_0x32d3a6(_0x4cf4a3[_0x7780('0x1d')]['message']);}})[_0x7780('0x1e')](function(_0x13eaf6){logger['error'](_0x7780('0x16'),_0x5d1ee1,_0x13eaf6);_0x4d0145(_0x13eaf6);});});}function respondWithStatusCode(_0x55b8c3,_0x333a83){_0x333a83=_0x333a83||0xcc;return function(_0x957233){if(_0x957233){return _0x55b8c3['sendStatus'](_0x333a83);}return _0x55b8c3[_0x7780('0x1f')](_0x333a83)[_0x7780('0x20')]();};}function respondWithResult(_0xcfd4c3,_0x21dcc0){_0x21dcc0=_0x21dcc0||0xc8;return function(_0x18441b){if(_0x18441b){return _0xcfd4c3[_0x7780('0x1f')](_0x21dcc0)['json'](_0x18441b);}};}function respondWithFilteredResult(_0x5c5944,_0x2d7dc5){return function(_0x27cd01){if(_0x27cd01){var _0x89a9c=typeof _0x2d7dc5[_0x7780('0x21')]===_0x7780('0x22')&&typeof _0x2d7dc5[_0x7780('0x23')]==='undefined';var _0x72d359=_0x27cd01[_0x7780('0x24')];var _0x2cdfa6=_0x89a9c?0x0:_0x2d7dc5[_0x7780('0x21')];var _0x53b2ac=_0x89a9c?_0x27cd01[_0x7780('0x24')]:_0x2d7dc5['offset']+_0x2d7dc5[_0x7780('0x23')];var _0x18b0d6;if(_0x53b2ac>=_0x72d359){_0x53b2ac=_0x72d359;_0x18b0d6=0xc8;}else{_0x18b0d6=0xce;}_0x5c5944[_0x7780('0x1f')](_0x18b0d6);return _0x5c5944[_0x7780('0x25')](_0x7780('0x26'),_0x2cdfa6+'-'+_0x53b2ac+'/'+_0x72d359)['json'](_0x27cd01);}return null;};}function saveUpdates(_0x3647fd){return function(_0x52ff33){if(_0x52ff33){return _0x52ff33[_0x7780('0x27')](_0x3647fd)[_0x7780('0x14')](function(_0x16f0ff){return _0x16f0ff;});}return null;};}function removeEntity(_0x53eb72){return function(_0x60b0bc){if(_0x60b0bc){return _0x60b0bc[_0x7780('0x28')]()[_0x7780('0x14')](function(){var _0x35258f=_0x60b0bc[_0x7780('0x29')]({'plain':!![]});var _0x552f8f=_0x7780('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x552f8f,'resourceId':_0x35258f['id']}})[_0x7780('0x14')](function(){return _0x60b0bc;});})[_0x7780('0x14')](function(){_0x53eb72['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22cf17){return function(_0x26ab10){if(!_0x26ab10){_0x22cf17[_0x7780('0x2b')](0x194);}return _0x26ab10;};}function handleError(_0x54f317,_0x297640){_0x297640=_0x297640||0x1f4;return function(_0x3c2e4){logger[_0x7780('0x1a')](_0x3c2e4[_0x7780('0x2c')]);if(_0x3c2e4[_0x7780('0x2d')]){delete _0x3c2e4[_0x7780('0x2d')];}_0x54f317['status'](_0x297640)[_0x7780('0x2e')](_0x3c2e4);};}function getImapHost(_0xcda7da){switch(_0xcda7da){case _0x7780('0x2f'):return'imap.gmail.com';case'yahoo':return _0x7780('0x30');case _0x7780('0x31'):return _0x7780('0x32');case'outlook365':return _0x7780('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0xcda7da);}function getSmtpHost(_0x460b24){switch(_0x460b24){case'gmail':return _0x7780('0x34');case _0x7780('0x35'):return _0x7780('0x36');case _0x7780('0x31'):return _0x7780('0x37');case _0x7780('0x38'):return _0x7780('0x39');}throw new Error('Unknown\x20email\x20service\x20provider',_0x460b24);}function getAuthenticationOptions(_0x58a9aa,_0x22e43f){var _0x39c955={};var _0x277e7c={};if(_0x58a9aa){_0x39c955[_0x7780('0x3a')]=_0x277e7c[_0x7780('0x3a')]=_0x22e43f[_0x7780('0x3b')];_0x39c955[_0x7780('0x3c')]=_0x277e7c[_0x7780('0x3d')]=_0x22e43f[_0x7780('0x3c')];if(_0x22e43f[_0x7780('0x3e')]){_0x39c955['modernAuthentication']=_0x277e7c[_0x7780('0x3e')]=!![];_0x39c955[_0x7780('0x3f')]=_0x277e7c[_0x7780('0x3f')]=_0x22e43f[_0x7780('0x3f')];_0x39c955['password']=_0x277e7c[_0x7780('0x3d')]=null;}else{_0x39c955[_0x7780('0x3f')]=_0x277e7c[_0x7780('0x3f')]=null;}_0x39c955[_0x7780('0x40')]=getImapHost(_0x58a9aa);_0x39c955[_0x7780('0x41')]=0x3e1;_0x277e7c['host']=getSmtpHost(_0x58a9aa);_0x277e7c[_0x7780('0x41')]=0x24b;_0x277e7c[_0x7780('0x42')]=![];_0x39c955[_0x7780('0x43')]=_0x277e7c[_0x7780('0x43')]=null;}else{if(_0x22e43f['authentication']){_0x39c955['user']=_0x277e7c[_0x7780('0x3a')]=_0x22e43f['username'];_0x39c955[_0x7780('0x3c')]=_0x277e7c['pass']=_0x22e43f[_0x7780('0x3c')];}else{_0x39c955[_0x7780('0x44')]=_0x277e7c[_0x7780('0x44')]=![];_0x39c955[_0x7780('0x3a')]=_0x277e7c[_0x7780('0x3a')]=null;_0x39c955['password']=_0x277e7c[_0x7780('0x3d')]=null;}_0x39c955['host']=_0x22e43f[_0x7780('0x45')][_0x7780('0x40')];_0x39c955[_0x7780('0x41')]=_0x22e43f['Imap'][_0x7780('0x41')];_0x277e7c[_0x7780('0x40')]=_0x22e43f[_0x7780('0x46')][_0x7780('0x40')];_0x277e7c[_0x7780('0x41')]=_0x22e43f[_0x7780('0x46')]['port'];}return{'Imap':_0x39c955,'Smtp':_0x277e7c};}exports[_0x7780('0x47')]=function(_0x32c8db,_0x3b2468){var _0x469523={'include':[{'model':db[_0x7780('0x48')],'as':'Imap'},{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x11daab={},_0x4223dc={'count':0x0,'rows':[]};var _0x45c60a=_['map'](db[_0x7780('0x4a')][_0x7780('0x4b')],function(_0x168225){return{'name':_0x168225[_0x7780('0x4c')],'type':_0x168225[_0x7780('0x4d')][_0x7780('0x4e')]};});_0x11daab[_0x7780('0x4f')]=_['map'](_0x45c60a,_0x7780('0x2d'));_0x11daab[_0x7780('0x50')]=_[_0x7780('0x51')](_0x32c8db[_0x7780('0x50')]);_0x11daab[_0x7780('0x52')]=_[_0x7780('0x53')](_0x11daab[_0x7780('0x4f')],_0x11daab['query']);_0x469523[_0x7780('0x54')]=_[_0x7780('0x53')](_0x11daab[_0x7780('0x4f')],qs[_0x7780('0x55')](_0x32c8db['query'][_0x7780('0x55')]));_0x469523['attributes']=_0x469523[_0x7780('0x54')][_0x7780('0x56')]?_0x469523[_0x7780('0x54')]:_0x11daab[_0x7780('0x4f')];if(!_0x32c8db[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x469523[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x32c8db[_0x7780('0x50')][_0x7780('0x23')]);_0x469523['offset']=qs[_0x7780('0x21')](_0x32c8db['query'][_0x7780('0x21')]);}_0x469523[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0x32c8db[_0x7780('0x50')][_0x7780('0x5a')]);_0x469523[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x32c8db[_0x7780('0x50')],_0x11daab[_0x7780('0x52')]),_0x45c60a);if(_0x32c8db[_0x7780('0x50')][_0x7780('0x5d')]){_0x469523[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x469523[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x45c60a,function(_0x438eb8){if(_0x438eb8['type']!==_0x7780('0x60')){var _0x13c95f={};_0x13c95f[_0x438eb8[_0x7780('0x2d')]]={'$like':'%'+_0x32c8db[_0x7780('0x50')]['filter']+'%'};return _0x13c95f;}})});}_0x469523=_[_0x7780('0x5e')]({},_0x469523,_0x32c8db[_0x7780('0x61')]);var _0x4a5b7c={'where':_0x469523['where']};return db[_0x7780('0x4a')][_0x7780('0x24')](_0x4a5b7c)['then'](function(_0x28106f){_0x4223dc[_0x7780('0x24')]=_0x28106f;if(_0x32c8db['query'][_0x7780('0x62')]){_0x469523[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x4a')][_0x7780('0x64')](_0x469523);})['then'](function(_0x390820){_0x4223dc[_0x7780('0x65')]=_0x390820;return _0x4223dc;})[_0x7780('0x14')](respondWithFilteredResult(_0x3b2468,_0x469523))[_0x7780('0x1e')](handleError(_0x3b2468,null));};exports['show']=function(_0xe93d9,_0x4d0892){var _0x4dd132={'raw':![],'where':{'id':_0xe93d9['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x7780('0x45')},{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x171e7a={};_0x171e7a['model']=_[_0x7780('0x51')](db[_0x7780('0x4a')][_0x7780('0x4b')]);_0x171e7a[_0x7780('0x50')]=_['keys'](_0xe93d9[_0x7780('0x50')]);_0x171e7a[_0x7780('0x52')]=_['intersection'](_0x171e7a[_0x7780('0x4f')],_0x171e7a['query']);_0x4dd132[_0x7780('0x54')]=_[_0x7780('0x53')](_0x171e7a[_0x7780('0x4f')],qs[_0x7780('0x55')](_0xe93d9['query'][_0x7780('0x55')]));_0x4dd132['attributes']=_0x4dd132[_0x7780('0x54')][_0x7780('0x56')]?_0x4dd132[_0x7780('0x54')]:_0x171e7a[_0x7780('0x4f')];if(_0xe93d9['query'][_0x7780('0x62')]){_0x4dd132[_0x7780('0x63')]=[{'all':!![]}];}_0x4dd132=_['merge']({},_0x4dd132,_0xe93d9[_0x7780('0x61')]);return db['MailAccount'][_0x7780('0x66')](_0x4dd132)[_0x7780('0x14')](handleEntityNotFound(_0x4d0892,null))['then'](respondWithResult(_0x4d0892,null))[_0x7780('0x1e')](handleError(_0x4d0892,null));};exports[_0x7780('0x27')]=function(_0x54b5ad,_0x243bf4){if(_0x54b5ad[_0x7780('0x67')]['id']){delete _0x54b5ad[_0x7780('0x67')]['id'];}var _0x17b967=_0x54b5ad[_0x7780('0x67')]['provider']==='custom'?null:_0x54b5ad[_0x7780('0x67')]['provider'];var _0x287898=_0x54b5ad[_0x7780('0x67')][_0x7780('0x45')]||{};var _0x101b15=_0x54b5ad[_0x7780('0x67')]['Smtp']||{};if(_0x17b967){_0x287898['host']=getImapHost(_0x17b967);_0x287898[_0x7780('0x41')]=0x3e1;_0x101b15['host']=getSmtpHost(_0x17b967);_0x101b15[_0x7780('0x41')]=0x24b;_0x101b15[_0x7780('0x42')]=![];}if(_0x101b15['modernAuthentication']){_0x101b15[_0x7780('0x42')]=![];}else{_0x101b15[_0x7780('0x3f')]=null;}if(!_0x287898['modernAuthentication'])_0x287898[_0x7780('0x3f')]=null;_0x54b5ad[_0x7780('0x67')][_0x7780('0x45')]=_0x287898;_0x54b5ad[_0x7780('0x67')][_0x7780('0x46')]=_0x101b15;return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x54b5ad[_0x7780('0x68')]['id']},'include':[{'model':db[_0x7780('0x48')],'as':_0x7780('0x45')},{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db[_0x7780('0x69')],'as':_0x7780('0x6a')}]})['then'](handleEntityNotFound(_0x243bf4,null))['then'](function(_0x26d79b){if(!_0x26d79b)throw new Error(_0x7780('0x6b'));if(_0x26d79b[_0x7780('0x43')])delete _0x54b5ad[_0x7780('0x67')]['Imap'];return _0x26d79b;})[_0x7780('0x14')](saveUpdates(_0x54b5ad[_0x7780('0x67')],null))['then'](function(_0x3660ee){if(!_0x54b5ad[_0x7780('0x67')]['Imap'])return _0x3660ee;return db[_0x7780('0x48')]['update'](_0x54b5ad[_0x7780('0x67')][_0x7780('0x45')],{'where':{'MailAccountId':_0x3660ee['id']}})[_0x7780('0x14')](function(){return _0x3660ee;});})[_0x7780('0x14')](function(_0xa98454){if(!_0x54b5ad[_0x7780('0x67')][_0x7780('0x46')])return _0xa98454;return db[_0x7780('0x49')][_0x7780('0x27')](_0x54b5ad[_0x7780('0x67')][_0x7780('0x46')],{'where':{'MailAccountId':_0xa98454['id']}})[_0x7780('0x14')](function(){return _0xa98454;});})['then'](respondWithResult(_0x243bf4,null))[_0x7780('0x1e')](handleError(_0x243bf4,null));};exports['describe']=function(_0x636594,_0x3366d7){return db[_0x7780('0x4a')][_0x7780('0x6c')]()[_0x7780('0x14')](respondWithResult(_0x3366d7,null))[_0x7780('0x1e')](handleError(_0x3366d7,null));};exports[_0x7780('0x6d')]=function(_0x65351e,_0x41f271){if(_0x65351e[_0x7780('0x67')]['id']){delete _0x65351e[_0x7780('0x67')]['id'];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x65351e[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x41f271,null))['then'](function(_0x2014a1){if(_0x2014a1){_0x65351e[_0x7780('0x67')][_0x7780('0x6e')]=_0x2014a1['id'];return db[_0x7780('0x6f')]['create'](_0x65351e[_0x7780('0x67')]);}})[_0x7780('0x14')](respondWithResult(_0x41f271,null))[_0x7780('0x1e')](handleError(_0x41f271,null));};exports[_0x7780('0x70')]=function(_0x2089bc,_0x1668dc){var _0x2037c4={'raw':![],'where':{}};var _0x2432bb={};var _0x344fca={'count':0x0,'rows':[]};return db[_0x7780('0x4a')]['findOne']({'where':{'id':_0x2089bc['params']['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x1668dc,null))['then'](function(_0x17750d){if(_0x17750d){_0x2432bb[_0x7780('0x4f')]=_['keys'](db[_0x7780('0x6f')][_0x7780('0x4b')]);_0x2432bb[_0x7780('0x50')]=_[_0x7780('0x51')](_0x2089bc['query']);_0x2432bb[_0x7780('0x52')]=_[_0x7780('0x53')](_0x2432bb[_0x7780('0x4f')],_0x2432bb['query']);_0x2037c4['attributes']=_[_0x7780('0x53')](_0x2432bb['model'],qs[_0x7780('0x55')](_0x2089bc[_0x7780('0x50')][_0x7780('0x55')]));_0x2037c4[_0x7780('0x54')]=_0x2037c4['attributes'][_0x7780('0x56')]?_0x2037c4[_0x7780('0x54')]:_0x2432bb[_0x7780('0x4f')];if(!_0x2089bc[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x2037c4['limit']=qs[_0x7780('0x23')](_0x2089bc[_0x7780('0x50')]['limit']);_0x2037c4[_0x7780('0x21')]=qs['offset'](_0x2089bc['query'][_0x7780('0x21')]);}_0x2037c4[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0x2089bc[_0x7780('0x50')]['sort']);_0x2037c4[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x2089bc['query'],_0x2432bb[_0x7780('0x52')]));_0x2037c4[_0x7780('0x5b')]['MailAccountId']=_0x17750d['id'];if(_0x2089bc[_0x7780('0x50')][_0x7780('0x5d')]){_0x2037c4[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x2037c4[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x2037c4['attributes'],function(_0x3a7d25){var _0x309881={};_0x309881[_0x3a7d25]={'$like':'%'+_0x2089bc[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x309881;})});}_0x2037c4=_[_0x7780('0x5e')]({},_0x2037c4,_0x2089bc[_0x7780('0x61')]);return db[_0x7780('0x6f')]['count']({'where':_0x2037c4[_0x7780('0x5b')]})['then'](function(_0x563120){_0x344fca[_0x7780('0x24')]=_0x563120;if(_0x2089bc[_0x7780('0x50')][_0x7780('0x62')]){_0x2037c4[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x6f')][_0x7780('0x64')](_0x2037c4);})[_0x7780('0x14')](function(_0x1fed3b){_0x344fca[_0x7780('0x65')]=_0x1fed3b;return _0x344fca;});}})[_0x7780('0x14')](respondWithFilteredResult(_0x1668dc,_0x2037c4))['catch'](handleError(_0x1668dc,null));};exports[_0x7780('0x71')]=function(_0x1fa28a,_0x13c281){return db[_0x7780('0x4a')]['find']({'where':{'id':_0x1fa28a[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x13c281,null))[_0x7780('0x14')](function(_0x52ad73){if(_0x52ad73){return _0x52ad73['removeDispositions'](_0x1fa28a['query'][_0x7780('0x72')]);}})['then'](respondWithStatusCode(_0x13c281,null))[_0x7780('0x1e')](handleError(_0x13c281,null));};exports['addAnswer']=function(_0x402c6a,_0xbffdff){if(_0x402c6a['body']['id']){delete _0x402c6a['body']['id'];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x402c6a['params']['id']}})[_0x7780('0x14')](handleEntityNotFound(_0xbffdff,null))[_0x7780('0x14')](function(_0x1d7d49){if(_0x1d7d49){_0x402c6a[_0x7780('0x67')][_0x7780('0x6e')]=_0x1d7d49['id'];return db[_0x7780('0x73')][_0x7780('0x74')](_0x402c6a[_0x7780('0x67')]);}})[_0x7780('0x14')](respondWithResult(_0xbffdff,null))[_0x7780('0x1e')](handleError(_0xbffdff,null));};exports['getAnswers']=function(_0xc2a558,_0x2ae13f){var _0x453f7f={'raw':![],'where':{}};var _0xb2aea2={};var _0xb8dc16={'count':0x0,'rows':[]};return db[_0x7780('0x4a')]['findOne']({'where':{'id':_0xc2a558[_0x7780('0x68')]['id']}})['then'](handleEntityNotFound(_0x2ae13f,null))[_0x7780('0x14')](function(_0x151888){if(_0x151888){_0xb2aea2[_0x7780('0x4f')]=_['keys'](db[_0x7780('0x73')][_0x7780('0x4b')]);_0xb2aea2['query']=_['keys'](_0xc2a558[_0x7780('0x50')]);_0xb2aea2[_0x7780('0x52')]=_[_0x7780('0x53')](_0xb2aea2['model'],_0xb2aea2[_0x7780('0x50')]);_0x453f7f[_0x7780('0x54')]=_[_0x7780('0x53')](_0xb2aea2['model'],qs[_0x7780('0x55')](_0xc2a558[_0x7780('0x50')][_0x7780('0x55')]));_0x453f7f[_0x7780('0x54')]=_0x453f7f[_0x7780('0x54')][_0x7780('0x56')]?_0x453f7f[_0x7780('0x54')]:_0xb2aea2[_0x7780('0x4f')];if(!_0xc2a558[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x453f7f[_0x7780('0x23')]=qs[_0x7780('0x23')](_0xc2a558[_0x7780('0x50')]['limit']);_0x453f7f[_0x7780('0x21')]=qs[_0x7780('0x21')](_0xc2a558[_0x7780('0x50')][_0x7780('0x21')]);}_0x453f7f[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0xc2a558[_0x7780('0x50')][_0x7780('0x5a')]);_0x453f7f['where']=qs[_0x7780('0x52')](_['pick'](_0xc2a558['query'],_0xb2aea2[_0x7780('0x52')]));_0x453f7f[_0x7780('0x5b')]['MailAccountId']=_0x151888['id'];if(_0xc2a558['query'][_0x7780('0x5d')]){_0x453f7f[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x453f7f[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x453f7f[_0x7780('0x54')],function(_0x2ac822){var _0x283eec={};_0x283eec[_0x2ac822]={'$like':'%'+_0xc2a558[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x283eec;})});}_0x453f7f=_[_0x7780('0x5e')]({},_0x453f7f,_0xc2a558[_0x7780('0x61')]);return db[_0x7780('0x73')][_0x7780('0x24')]({'where':_0x453f7f[_0x7780('0x5b')]})[_0x7780('0x14')](function(_0x74a75c){_0xb8dc16[_0x7780('0x24')]=_0x74a75c;if(_0xc2a558[_0x7780('0x50')][_0x7780('0x62')]){_0x453f7f[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x73')]['findAll'](_0x453f7f);})[_0x7780('0x14')](function(_0x439401){_0xb8dc16[_0x7780('0x65')]=_0x439401;return _0xb8dc16;});}})['then'](respondWithFilteredResult(_0x2ae13f,_0x453f7f))[_0x7780('0x1e')](handleError(_0x2ae13f,null));};exports[_0x7780('0x75')]=function(_0x3e2796,_0x1d355b){return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x3e2796[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x1d355b,null))['then'](function(_0x3bb15b){if(_0x3bb15b){return _0x3bb15b[_0x7780('0x75')](_0x3e2796[_0x7780('0x50')]['ids']);}})[_0x7780('0x14')](respondWithStatusCode(_0x1d355b,null))[_0x7780('0x1e')](handleError(_0x1d355b,null));};exports[_0x7780('0x74')]=function(_0x119423,_0x22af1f){var _0x51222f={'name':_0x119423[_0x7780('0x67')][_0x7780('0x2d')],'key':_0x119423[_0x7780('0x67')][_0x7780('0x4e')],'provider':_0x119423[_0x7780('0x67')][_0x7780('0x76')]===_0x7780('0x77')?null:_0x119423[_0x7780('0x67')][_0x7780('0x76')],'email':_0x119423[_0x7780('0x67')]['email'],'ListId':_0x119423[_0x7780('0x67')]['ListId'],'active':!_['isNil'](_0x119423['body'][_0x7780('0x78')])?_0x119423[_0x7780('0x67')][_0x7780('0x78')]:!![],'description':_0x119423[_0x7780('0x67')][_0x7780('0x79')]||null};var _0xed5b08=getAuthenticationOptions(_0x51222f['provider'],_0x119423[_0x7780('0x67')]);_0x51222f[_0x7780('0x45')]=_0xed5b08['Imap'];_0x51222f['Smtp']=_0xed5b08['Smtp'];return db[_0x7780('0x4a')]['create'](_0x51222f,{'include':[{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db[_0x7780('0x48')],'as':_0x7780('0x45')}]})[_0x7780('0x14')](function(_0x2e02e1){var _0x3a7523=_0x119423[_0x7780('0x3a')][_0x7780('0x29')]({'plain':!![]});if(!_0x3a7523)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a7523[_0x7780('0x7a')]==='user'){var _0x18e430=_0x2e02e1[_0x7780('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x7780('0x66')]({'where':{'name':_0x7780('0x2a'),'userProfileId':_0x3a7523[_0x7780('0x7b')]},'raw':!![]})[_0x7780('0x14')](function(_0x18aeb6){if(_0x18aeb6&&_0x18aeb6[_0x7780('0x7c')]===0x0){return db['UserProfileResource'][_0x7780('0x74')]({'name':_0x18e430[_0x7780('0x2d')],'resourceId':_0x18e430['id'],'type':_0x18aeb6['name'],'sectionId':_0x18aeb6['id']},{})['then'](function(){return _0x2e02e1;});}else{return _0x2e02e1;}})['catch'](function(_0x3b8b57){logger[_0x7780('0x1a')](_0x7780('0x7d'),_0x3b8b57);throw _0x3b8b57;});}return _0x2e02e1;})[_0x7780('0x14')](respondWithResult(_0x22af1f,0xc9))[_0x7780('0x1e')](handleError(_0x22af1f,null));};exports[_0x7780('0x7e')]=function(_0x2a3be2,_0x514eba){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x2a3be2[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x514eba,null))['then'](function(_0x5458e4){if(_0x5458e4){return _0x5458e4[_0x7780('0x7e')]();}return null;})[_0x7780('0x14')](respondWithResult(_0x514eba,null))[_0x7780('0x1e')](handleError(_0x514eba,null));};exports[_0x7780('0x80')]=function(_0x5d524d,_0x37d1f2){if(_0x5d524d[_0x7780('0x67')]['id']){delete _0x5d524d[_0x7780('0x67')]['id'];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x5d524d[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x37d1f2,null))['then'](function(_0x4795bd){if(_0x4795bd){_0x5d524d[_0x7780('0x67')]['MailAccountId']=_0x4795bd['id'];return db['MailServerIn'][_0x7780('0x74')](_0x5d524d[_0x7780('0x67')]);}})[_0x7780('0x14')](respondWithResult(_0x37d1f2,null))[_0x7780('0x1e')](handleError(_0x37d1f2,null));};exports[_0x7780('0x81')]=function(_0x89459d,_0x105d78){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x89459d[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x105d78,null))['then'](function(_0x4ab92e){if(_0x4ab92e){return _0x4ab92e[_0x7780('0x82')](null);}return null;})[_0x7780('0x14')](respondWithStatusCode(_0x105d78,null))[_0x7780('0x1e')](handleError(_0x105d78,null));};exports[_0x7780('0x83')]=function(_0x93cb89,_0x28501a){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x93cb89['params']['id']}})['then'](handleEntityNotFound(_0x28501a,null))[_0x7780('0x14')](function(_0x3db94e){if(_0x3db94e){return _0x3db94e[_0x7780('0x83')]();}return null;})[_0x7780('0x14')](respondWithResult(_0x28501a,null))[_0x7780('0x1e')](handleError(_0x28501a,null));};exports[_0x7780('0x84')]=function(_0x34f0e7,_0x178a09){if(_0x34f0e7[_0x7780('0x67')]['id']){delete _0x34f0e7[_0x7780('0x67')]['id'];}return db['MailAccount'][_0x7780('0x66')]({'where':{'id':_0x34f0e7[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x178a09,null))[_0x7780('0x14')](function(_0x292a51){if(_0x292a51){_0x34f0e7[_0x7780('0x67')][_0x7780('0x6e')]=_0x292a51['id'];return db[_0x7780('0x49')][_0x7780('0x74')](_0x34f0e7[_0x7780('0x67')]);}})['then'](respondWithResult(_0x178a09,null))[_0x7780('0x1e')](handleError(_0x178a09,null));};exports[_0x7780('0x85')]=function(_0x64b9c,_0x7947f7){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x64b9c[_0x7780('0x68')]['id']}})['then'](handleEntityNotFound(_0x7947f7,null))[_0x7780('0x14')](function(_0x33283f){if(_0x33283f){return _0x33283f[_0x7780('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x7947f7,null))[_0x7780('0x1e')](handleError(_0x7947f7,null));};exports[_0x7780('0x87')]=function(_0x244131,_0x20a90e){return db[_0x7780('0x88')]['find']({'where':{'id':_0x244131[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x20a90e,null))[_0x7780('0x14')](function(_0x127a70){if(_0x127a70){return _0x127a70[_0x7780('0x87')](_0x244131['body'][_0x7780('0x72')],_[_0x7780('0x89')](_0x244131[_0x7780('0x67')],[_0x7780('0x72'),'id'])||{});}})['then'](respondWithResult(_0x20a90e,null))[_0x7780('0x1e')](handleError(_0x20a90e,null));};exports['getInteractions']=function(_0x1dca45,_0xe2823d){var _0x43ac12={'raw':![],'where':{}};var _0x2ed708={};var _0x2c683a={'count':0x0,'rows':[]};return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x1dca45[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0xe2823d,null))[_0x7780('0x14')](function(_0x111fe4){if(_0x111fe4){_0x2ed708[_0x7780('0x4f')]=_[_0x7780('0x51')](db[_0x7780('0x88')][_0x7780('0x4b')]);_0x2ed708[_0x7780('0x50')]=_['keys'](_0x1dca45[_0x7780('0x50')]);_0x2ed708['filters']=_[_0x7780('0x53')](_0x2ed708['model'],_0x2ed708[_0x7780('0x50')]);_0x43ac12[_0x7780('0x54')]=_[_0x7780('0x53')](_0x2ed708['model'],qs[_0x7780('0x55')](_0x1dca45[_0x7780('0x50')][_0x7780('0x55')]));_0x43ac12['attributes']=_0x43ac12['attributes'][_0x7780('0x56')]?_0x43ac12[_0x7780('0x54')]:_0x2ed708[_0x7780('0x4f')];if(!_0x1dca45[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x43ac12[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x1dca45[_0x7780('0x50')][_0x7780('0x23')]);_0x43ac12[_0x7780('0x21')]=qs[_0x7780('0x21')](_0x1dca45['query']['offset']);}_0x43ac12['order']=qs[_0x7780('0x5a')](_0x1dca45[_0x7780('0x50')][_0x7780('0x5a')]);_0x43ac12[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x1dca45[_0x7780('0x50')],_0x2ed708[_0x7780('0x52')]));_0x43ac12[_0x7780('0x5b')][_0x7780('0x6e')]=_0x111fe4['id'];if(_0x1dca45[_0x7780('0x50')][_0x7780('0x5d')]){_0x43ac12['where']=_[_0x7780('0x5e')](_0x43ac12['where'],{'$or':_[_0x7780('0x5f')](_0x43ac12[_0x7780('0x54')],function(_0x3d3142){var _0x5b5677={};_0x5b5677[_0x3d3142]={'$like':'%'+_0x1dca45[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x5b5677;})});}_0x43ac12=_[_0x7780('0x5e')]({},_0x43ac12,_0x1dca45[_0x7780('0x61')]);return db['MailInteraction'][_0x7780('0x24')]({'where':_0x43ac12['where']})[_0x7780('0x14')](function(_0x49ff24){_0x2c683a[_0x7780('0x24')]=_0x49ff24;if(_0x1dca45[_0x7780('0x50')][_0x7780('0x62')]){_0x43ac12['include']=[{'model':db['CmContact'],'as':_0x7780('0x8a'),'required':![]},{'model':db[_0x7780('0x8b')],'as':_0x7780('0x8c'),'attributes':[_0x7780('0x2d'),_0x7780('0x8d'),_0x7780('0x8e')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x7780('0x8f')],'where':_0x1dca45['query'][_0x7780('0x90')]?{'id':_0x1dca45[_0x7780('0x50')][_0x7780('0x90')]}:undefined,'required':_0x1dca45[_0x7780('0x50')][_0x7780('0x90')]?!![]:![]}];}return db[_0x7780('0x88')][_0x7780('0x64')](_0x43ac12);})[_0x7780('0x14')](function(_0x40e345){_0x2c683a['rows']=_0x40e345;return _0x2c683a;});}})[_0x7780('0x14')](respondWithFilteredResult(_0xe2823d,_0x43ac12))[_0x7780('0x1e')](handleError(_0xe2823d,null));};exports[_0x7780('0x91')]=function addApplications(_0x32c50b,_0x30022a){var _0x17cdaf=_0x32c50b[_0x7780('0x68')]['id'];var _0x430812=_0x32c50b[_0x7780('0x67')];var _0xe11a70=0xc8;var _0x43bdea=null;return db[_0x7780('0x92')]['transaction']({'isolationLevel':db[_0x7780('0x92')][_0x7780('0x93')][_0x7780('0x94')][_0x7780('0x95')]},function(_0x57a56b){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x17cdaf},'transaction':_0x57a56b})[_0x7780('0x14')](function(_0x29c145){if(_0x29c145){return db[_0x7780('0x96')][_0x7780('0x28')]({'where':{'MailAccountId':_0x17cdaf},'transaction':_0x57a56b})['then'](function(){var _0x44ee1c=_[_0x7780('0x5f')](_0x430812,function(_0x265426){_0x265426['MailAccountId']=_0x17cdaf;return _0x265426;});return db['MailApplication']['bulkCreate'](_0x44ee1c,{'transaction':_0x57a56b});});}else{_0xe11a70=0x194;_0x43bdea=[];}});})[_0x7780('0x14')](function(){if(_0xe11a70!==0x194){return db['MailApplication'][_0x7780('0x97')]({'where':{'MailAccountId':_0x17cdaf},'order':_0x7780('0x98')})[_0x7780('0x14')](function(_0x184ff3){_0x43bdea=_0x184ff3;});}})[_0x7780('0x1e')](function(_0x38c90e){_0xe11a70=0x1f4;logger[_0x7780('0x1a')](_0x38c90e[_0x7780('0x2c')]);if(_0x38c90e[_0x7780('0x2d')]){delete _0x38c90e['name'];}_0x43bdea=_0x38c90e;})[_0x7780('0x99')](function(){if(_0x43bdea===null){_0x30022a['sendStatus'](_0xe11a70);}else{if(_0xe11a70===0x1f4){_0x30022a[_0x7780('0x1f')](_0xe11a70)[_0x7780('0x2e')](_0x43bdea);}else{_0x30022a['status'](_0xe11a70)[_0x7780('0x9a')](_0x43bdea);}}});};exports[_0x7780('0x9b')]=function(_0xce6b75,_0x59f014){var _0xae5437={};var _0x24bc95={};var _0x178f74;var _0xcbf04b;return db['MailAccount'][_0x7780('0x7f')]({'where':{'id':_0xce6b75[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x59f014,null))[_0x7780('0x14')](function(_0x2ae61a){if(_0x2ae61a){_0x178f74=_0x2ae61a;_0x24bc95[_0x7780('0x4f')]=_['keys'](db['MailApplication']['rawAttributes']);_0x24bc95[_0x7780('0x50')]=_[_0x7780('0x51')](_0xce6b75['query']);_0x24bc95[_0x7780('0x52')]=_[_0x7780('0x53')](_0x24bc95['model'],_0x24bc95[_0x7780('0x50')]);_0xae5437['attributes']=_[_0x7780('0x53')](_0x24bc95[_0x7780('0x4f')],qs[_0x7780('0x55')](_0xce6b75['query'][_0x7780('0x55')]));_0xae5437[_0x7780('0x54')]=_0xae5437[_0x7780('0x54')][_0x7780('0x56')]?_0xae5437[_0x7780('0x54')]:_0x24bc95[_0x7780('0x4f')];_0xae5437[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0xce6b75['query'][_0x7780('0x5a')]);_0xae5437['where']=qs['filters'](_[_0x7780('0x5c')](_0xce6b75[_0x7780('0x50')],_0x24bc95['filters']));if(_0xce6b75['query'][_0x7780('0x5d')]){_0xae5437[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0xae5437['where'],{'$or':_[_0x7780('0x5f')](_0xae5437[_0x7780('0x54')],function(_0x4fc09b){var _0x9abb71={};_0x9abb71[_0x4fc09b]={'$like':'%'+_0xce6b75[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x9abb71;})});}_0xae5437=_[_0x7780('0x5e')]({},_0xae5437,_0xce6b75[_0x7780('0x61')]);return _0x178f74[_0x7780('0x9b')](_0xae5437);}})[_0x7780('0x14')](function(_0x4db8be){if(_0x4db8be){_0xcbf04b=_0x4db8be[_0x7780('0x56')];if(!_0xce6b75['query'][_0x7780('0x57')]('nolimit')){_0xae5437[_0x7780('0x23')]=qs[_0x7780('0x23')](_0xce6b75[_0x7780('0x50')][_0x7780('0x23')]);_0xae5437[_0x7780('0x21')]=qs[_0x7780('0x21')](_0xce6b75[_0x7780('0x50')][_0x7780('0x21')]);}return _0x178f74['getApplications'](_0xae5437);}})['then'](function(_0x487ced){if(_0x487ced){return _0x487ced?{'count':_0xcbf04b,'rows':_0x487ced}:null;}})['then'](respondWithResult(_0x59f014,null))[_0x7780('0x1e')](handleError(_0x59f014,null));};exports[_0x7780('0x9c')]=function(_0x47fbc5,_0x3b0519){var _0x27f960={'raw':!![],'where':{}};var _0x2347d3={};var _0x5d2cff={'count':0x0,'rows':[]};return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x47fbc5[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x3b0519,null))[_0x7780('0x14')](function(_0x7f1495){if(_0x7f1495){_0x2347d3[_0x7780('0x4f')]=_[_0x7780('0x51')](db[_0x7780('0x9d')][_0x7780('0x4b')]);_0x2347d3[_0x7780('0x50')]=_[_0x7780('0x51')](_0x47fbc5[_0x7780('0x50')]);_0x2347d3[_0x7780('0x52')]=_[_0x7780('0x53')](_0x2347d3[_0x7780('0x4f')],_0x2347d3[_0x7780('0x50')]);_0x27f960[_0x7780('0x54')]=_[_0x7780('0x53')](_0x2347d3[_0x7780('0x4f')],qs[_0x7780('0x55')](_0x47fbc5[_0x7780('0x50')][_0x7780('0x55')]));_0x27f960[_0x7780('0x54')]=_0x27f960['attributes']['length']?_0x27f960['attributes']:_0x2347d3['model'];if(!_0x47fbc5['query'][_0x7780('0x57')]('nolimit')){_0x27f960[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x47fbc5[_0x7780('0x50')]['limit']);_0x27f960[_0x7780('0x21')]=qs[_0x7780('0x21')](_0x47fbc5[_0x7780('0x50')][_0x7780('0x21')]);}_0x27f960['order']=qs[_0x7780('0x5a')](_0x47fbc5['query'][_0x7780('0x5a')]);_0x27f960[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x47fbc5[_0x7780('0x50')],_0x2347d3[_0x7780('0x52')]));_0x27f960[_0x7780('0x5b')]['MailAccountId']=_0x7f1495['id'];if(_0x47fbc5[_0x7780('0x50')][_0x7780('0x5d')]){_0x27f960['where']=_[_0x7780('0x5e')](_0x27f960[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x27f960['attributes'],function(_0x197b15){var _0x485bb0={};_0x485bb0[_0x197b15]={'$like':'%'+_0x47fbc5[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x485bb0;})});}if(_0x47fbc5[_0x7780('0x50')][_0x7780('0x9e')]){var _0x40979d=_0x47fbc5[_0x7780('0x50')][_0x7780('0x9e')]['split'](',');var _0x179238={};_0x179238[_0x40979d[0x0]]={'$gte':moment(_0x40979d[0x1])[_0x7780('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x27f960[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x27f960[_0x7780('0x5b')],_0x179238);}_0x27f960=_[_0x7780('0x5e')]({},_0x27f960,_0x47fbc5[_0x7780('0x61')]);return db['MailMessage'][_0x7780('0x24')]({'where':_0x27f960['where']})[_0x7780('0x14')](function(_0xcdaafd){_0x5d2cff[_0x7780('0x24')]=_0xcdaafd;if(_0x47fbc5[_0x7780('0x50')][_0x7780('0x62')]){_0x27f960[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x9d')][_0x7780('0x64')](_0x27f960);})[_0x7780('0x14')](function(_0x33e769){if(_0x47fbc5[_0x7780('0x50')][_0x7780('0xa0')]===_0x7780('0xa1')){for(var _0x2f36e4=0x0;_0x2f36e4<_0x33e769[_0x7780('0x56')];_0x2f36e4++){_0x33e769[_0x2f36e4][_0x7780('0x67')]=juice(_0x33e769[_0x2f36e4][_0x7780('0x67')]);}}_0x5d2cff[_0x7780('0x65')]=_0x33e769;return _0x5d2cff;});}})['then'](respondWithFilteredResult(_0x3b0519,_0x27f960))[_0x7780('0x1e')](handleError(_0x3b0519,null));};exports[_0x7780('0x2e')]=function(_0xb8b06b,_0x131adf){var _0x2c332f,_0x39ccb2={},_0x206515;if(_0xb8b06b[_0x7780('0x67')]['to']){_0x206515=_0xb8b06b[_0x7780('0x67')]['to'][_0x7780('0xa2')](',')[0x0];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0xb8b06b[_0x7780('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0x7780('0xa3'),'include':[{'model':db[_0x7780('0xa4')],'as':'Contacts','where':{'email':_0x206515},'limit':0x1,'order':[[_0x7780('0xa5'),_0x7780('0xa6')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7780('0xa7')],'as':_0x7780('0xa7'),'raw':!![]}]}]})[_0x7780('0x14')](handleEntityNotFound(_0x131adf,null))['then'](function(_0x223c85){if(!_0x223c85)return;_0x2c332f=_0x223c85;if(!_0x223c85['Smtp'])throw new Error(_0x7780('0xa8'));if(_[_0x7780('0xa9')](_0xb8b06b['body'][_0x7780('0xaa')])){_0xb8b06b['body'][_0x7780('0xaa')]=util['format'](_0x7780('0xab'),_0x223c85['name'],_0x223c85[_0x7780('0xac')]||_0x223c85[_0x7780('0x46')]['user']);}if(_0xb8b06b[_0x7780('0x67')][_0x7780('0xad')]&&_0xb8b06b[_0x7780('0x67')]['attachments']['length']){for(var _0x19ef04=0x0;_0x19ef04<_0xb8b06b[_0x7780('0x67')][_0x7780('0xad')][_0x7780('0x56')];_0x19ef04+=0x1){_0xb8b06b['body']['attachments'][_0x19ef04]={'filename':_0xb8b06b[_0x7780('0x67')]['attachments'][_0x19ef04][_0x7780('0x2d')],'path':path[_0x7780('0xae')](config[_0x7780('0xaf')],'server/files/attachments',_0xb8b06b['body'][_0x7780('0xad')][_0x19ef04][_0x7780('0xb0')])};}}var _0x3c2ac4=_0x223c85[_0x7780('0xb1')]();return respondWithRpcPromise(_0x7780('0xb2'),_0x7780('0xb3'),{'account':_0x3c2ac4,'message':_0xb8b06b[_0x7780('0x67')]});})[_0x7780('0x14')](function(_0x39d797){if(!_0x39d797)return;_0x39ccb2=_0x39d797;if(!_0x2c332f[_0x7780('0xa3')])throw new Error(_0x7780('0xb4'));if(_0x2c332f['List'][_0x7780('0xb5')][_0x7780('0x56')])return _0x2c332f[_0x7780('0xa3')][_0x7780('0xb5')][0x0];return db[_0x7780('0xa4')][_0x7780('0x74')](_['defaults'](_0xb8b06b[_0x7780('0x67')],{'firstName':_0xb8b06b[_0x7780('0x67')]['to'],'email':_0xb8b06b[_0x7780('0x67')]['to'],'phone':_0xb8b06b[_0x7780('0x67')]['to'],'ListId':_0x2c332f[_0x7780('0xb6')]}));})[_0x7780('0x14')](function(_0x3f8159){if(!_0x3f8159)return;var _0x1095fb={'UserId':_0xb8b06b[_0x7780('0x3a')]['id'],'ContactId':_0x3f8159['id'],'MailAccountId':_0x2c332f['id'],'inReplyTo':_0x39ccb2['messageId'],'to':_0xb8b06b[_0x7780('0x67')][_0x7780('0xaa')],'cc':_0xb8b06b[_0x7780('0x67')]['cc'],'subject':_0xb8b06b[_0x7780('0x67')][_0x7780('0xb7')],'attach':_0xb8b06b[_0x7780('0x67')][_0x7780('0xb8')],'firstMsgDirection':_0x7780('0xb9'),'lastMsgAt':moment()[_0x7780('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x7780('0x5e')](_0xb8b06b[_0x7780('0x67')],{'messageId':_0x39ccb2['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2c332f['id'],'UserId':_0xb8b06b[_0x7780('0x3a')]['id'],'ContactId':_0x3f8159['id']})]};if(_0xb8b06b[_0x7780('0x67')][_0x7780('0xba')]){_0x1095fb=_[_0x7780('0x5e')](_0x1095fb,_0xb8b06b[_0x7780('0x67')][_0x7780('0xba')]);}return db[_0x7780('0x88')][_0x7780('0x74')](_0x1095fb,{'include':[{'model':db[_0x7780('0x9d')],'as':_0x7780('0xbb')}]});})[_0x7780('0x14')](respondWithResult(_0x131adf,null))[_0x7780('0x1e')](handleError(_0x131adf,null));};exports[_0x7780('0xbc')]=function(_0x3e621a,_0x47876d){return db[_0x7780('0x4a')]['find']({'where':{'id':_0x3e621a[_0x7780('0x68')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x7780('0x46'),'raw':!![],'include':[{'model':db[_0x7780('0xa7')],'as':_0x7780('0xa7'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x47876d,null))[_0x7780('0x14')](function(_0x49482d){if(!_0x49482d[_0x7780('0x46')])return;var _0xb2e02c=_0x49482d[_0x7780('0xb1')]();return respondWithRpcPromise(_0x7780('0xbd'),_0x7780('0xbc'),{'account':_0xb2e02c});})[_0x7780('0x14')](respondWithResult(_0x47876d,null))[_0x7780('0x1e')](handleError(_0x47876d,null));};exports[_0x7780('0x28')]=function(_0x57a442,_0x859712){return db['MailAccount'][_0x7780('0x66')]({'where':{'id':_0x57a442[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x859712,null))['then'](function(_0x1dda36){if(_0x1dda36&&_0x1dda36[_0x7780('0x43')]){throw new db['Sequelize'][(_0x7780('0xbe'))](_0x7780('0xbf'));}return _0x1dda36;})['then'](removeEntity(_0x859712,null))[_0x7780('0x1e')](handleError(_0x859712,null));};exports[_0x7780('0xc0')]=function(_0x74edf7,_0x1eff2f){return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x74edf7[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x1eff2f,null))[_0x7780('0x14')](function(_0x399e81){if(_0x399e81){return _0x399e81[_0x7780('0xc0')](_0x74edf7[_0x7780('0x67')]['ids'],_[_0x7780('0x89')](_0x74edf7['body'],[_0x7780('0x72'),'id'])||{})[_0x7780('0xc1')](function(_0x2e00b2){for(var _0x5983d1=0x0;_0x5983d1<_0x74edf7['body'][_0x7780('0x72')][_0x7780('0x56')];_0x5983d1+=0x1){socket[_0x7780('0xc2')](_0x7780('0xc3'),{'UserId':Number(_0x74edf7[_0x7780('0x67')][_0x7780('0x72')][_0x5983d1]),'MailAccountId':Number(_0x74edf7[_0x7780('0x68')]['id'])});}return _0x2e00b2;});}})[_0x7780('0x14')](respondWithResult(_0x1eff2f,null))[_0x7780('0x1e')](handleError(_0x1eff2f,null));};exports[_0x7780('0xc4')]=function(_0x34ef95,_0x5ac9d5){return db[_0x7780('0x4a')]['find']({'where':{'id':_0x34ef95['params']['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x5ac9d5,null))['then'](function(_0x245321){if(_0x245321){return _0x245321[_0x7780('0xc4')](_0x34ef95[_0x7780('0x50')][_0x7780('0x72')])[_0x7780('0x14')](function(){if(_[_0x7780('0xc5')](_0x34ef95[_0x7780('0x50')][_0x7780('0x72')])){for(var _0x9d7814=0x0;_0x9d7814<_0x34ef95['query'][_0x7780('0x72')][_0x7780('0x56')];_0x9d7814+=0x1){socket[_0x7780('0xc2')](_0x7780('0xc6'),{'UserId':Number(_0x34ef95['query'][_0x7780('0x72')][_0x9d7814]),'MailAccountId':Number(_0x34ef95[_0x7780('0x68')]['id'])});}}else{socket['emit'](_0x7780('0xc6'),{'UserId':Number(_0x34ef95[_0x7780('0x50')][_0x7780('0x72')]),'MailAccountId':Number(_0x34ef95['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5ac9d5,null))[_0x7780('0x1e')](handleError(_0x5ac9d5,null));};exports[_0x7780('0xc7')]=function(_0x559e27,_0x368335){var _0x55a281={};var _0x1c8786={};var _0x490685;var _0x7031;return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x559e27[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x368335,null))[_0x7780('0x14')](function(_0x217b16){if(_0x217b16){_0x490685=_0x217b16;_0x1c8786[_0x7780('0x4f')]=_[_0x7780('0x51')](db[_0x7780('0x8b')]['rawAttributes']);_0x1c8786['query']=_[_0x7780('0x51')](_0x559e27[_0x7780('0x50')]);_0x1c8786[_0x7780('0x52')]=_[_0x7780('0x53')](_0x1c8786['model'],_0x1c8786['query']);_0x55a281['attributes']=_[_0x7780('0x53')](_0x1c8786[_0x7780('0x4f')],qs['fields'](_0x559e27[_0x7780('0x50')]['fields']));_0x55a281[_0x7780('0x54')]=_0x55a281[_0x7780('0x54')][_0x7780('0x56')]?_0x55a281[_0x7780('0x54')]:_0x1c8786[_0x7780('0x4f')];_0x55a281['order']=qs['sort'](_0x559e27[_0x7780('0x50')]['sort']);_0x55a281[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x559e27[_0x7780('0x50')],_0x1c8786['filters']));if(_0x559e27[_0x7780('0x50')][_0x7780('0x5d')]){_0x55a281[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x55a281['where'],{'$or':_[_0x7780('0x5f')](_0x55a281[_0x7780('0x54')],function(_0x545ce3){var _0x529509={};_0x529509[_0x545ce3]={'$like':'%'+_0x559e27[_0x7780('0x50')]['filter']+'%'};return _0x529509;})});}_0x55a281=_[_0x7780('0x5e')]({},_0x55a281,_0x559e27[_0x7780('0x61')]);return _0x490685[_0x7780('0xc7')](_0x55a281);}})[_0x7780('0x14')](function(_0xdc8294){if(_0xdc8294){_0x7031=_0xdc8294[_0x7780('0x56')];if(!_0x559e27[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x55a281[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x559e27[_0x7780('0x50')][_0x7780('0x23')]);_0x55a281[_0x7780('0x21')]=qs['offset'](_0x559e27[_0x7780('0x50')][_0x7780('0x21')]);}return _0x490685[_0x7780('0xc7')](_0x55a281);}})[_0x7780('0x14')](function(_0x18f6c1){if(_0x18f6c1){return _0x18f6c1?{'count':_0x7031,'rows':_0x18f6c1}:null;}})[_0x7780('0x14')](respondWithResult(_0x368335,null))['catch'](handleError(_0x368335,null));}; \ No newline at end of file +var _0x6640=['status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','MailServerIn','Imap','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','body','provider','custom','Mail\x20Account\x20not\x20found','MailServerOut','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','merge','removeDispositions','addAnswer','getAnswers','CannedAnswer','ids','key','email','ListId','active','description','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','Contact','User','Owner','fullname','internal','color','tag','sequelize','Transaction','MailApplication','bulkCreate','finally','getApplications','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','Contacts','messageId','attach','out','Interaction','Messages','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailAccount.socket','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus'];(function(_0x34bcfa,_0x463600){var _0x3734cd=function(_0x1f329b){while(--_0x1f329b){_0x34bcfa['push'](_0x34bcfa['shift']());}};_0x3734cd(++_0x463600);}(_0x6640,0xa7));var _0x0664=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x6640[_0x4a0e68];return _0x4fb274;};'use strict';var moment=require(_0x0664('0x0'));var BPromise=require(_0x0664('0x1'));var util=require(_0x0664('0x2'));var path=require(_0x0664('0x3'));var _=require(_0x0664('0x4'));var juice=require(_0x0664('0x5'));var Redis=require(_0x0664('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x0664('0x7'))(_0x0664('0x8'));var config=require(_0x0664('0x9'));var db=require(_0x0664('0xa'))['db'];config['redis']=_[_0x0664('0xb')](config[_0x0664('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0664('0xd'))(new Redis(config[_0x0664('0xc')]));require(_0x0664('0xe'))['register'](socket);var jayson=require(_0x0664('0xf'));var client=jayson[_0x0664('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x46f98f,_0x19d3eb,_0x847b55,_0x28d114){return new BPromise(function(_0x2bc373,_0x3f1436){var _0x181e4b=_0x28d114||client;return _0x181e4b[_0x0664('0x11')](_0x46f98f,_0x847b55)[_0x0664('0x12')](function(_0x5cf00a){logger[_0x0664('0x13')](_0x0664('0x14'),_0x19d3eb,_0x0664('0x15'));logger[_0x0664('0x16')](_0x0664('0x17'),_0x19d3eb,_0x0664('0x15'),JSON[_0x0664('0x18')](_0x5cf00a));if(_0x5cf00a[_0x0664('0x19')]){if(_0x5cf00a[_0x0664('0x19')]['code']===0x1f4){logger[_0x0664('0x19')]('MailAccount,\x20%s,\x20%s',_0x19d3eb,_0x5cf00a[_0x0664('0x19')][_0x0664('0x1a')]);return _0x3f1436(_0x5cf00a[_0x0664('0x19')][_0x0664('0x1a')]);}logger[_0x0664('0x19')]('MailAccount,\x20%s,\x20%s',_0x19d3eb,_0x5cf00a[_0x0664('0x19')]['message']);return _0x2bc373(_0x5cf00a[_0x0664('0x19')][_0x0664('0x1a')]);}else{logger[_0x0664('0x13')](_0x0664('0x14'),_0x19d3eb,_0x0664('0x15'));_0x2bc373(_0x5cf00a[_0x0664('0x1b')][_0x0664('0x1a')]);}})['catch'](function(_0x2688dc){logger[_0x0664('0x19')]('MailAccount,\x20%s,\x20%s',_0x19d3eb,_0x2688dc);_0x3f1436(_0x2688dc);});});}function respondWithStatusCode(_0x47bc8d,_0x16267c){_0x16267c=_0x16267c||0xcc;return function(_0x13884d){if(_0x13884d){return _0x47bc8d[_0x0664('0x1c')](_0x16267c);}return _0x47bc8d[_0x0664('0x1d')](_0x16267c)['end']();};}function respondWithResult(_0x1c18ba,_0x3a41c6){_0x3a41c6=_0x3a41c6||0xc8;return function(_0x46f9a0){if(_0x46f9a0){return _0x1c18ba[_0x0664('0x1d')](_0x3a41c6)[_0x0664('0x1e')](_0x46f9a0);}};}function respondWithFilteredResult(_0x302012,_0x40acf0){return function(_0x4f2c85){if(_0x4f2c85){var _0x263b11=typeof _0x40acf0[_0x0664('0x1f')]===_0x0664('0x20')&&typeof _0x40acf0['limit']===_0x0664('0x20');var _0x62c859=_0x4f2c85[_0x0664('0x21')];var _0x230f89=_0x263b11?0x0:_0x40acf0[_0x0664('0x1f')];var _0x4eee8c=_0x263b11?_0x4f2c85[_0x0664('0x21')]:_0x40acf0[_0x0664('0x1f')]+_0x40acf0[_0x0664('0x22')];var _0x2b1b6d;if(_0x4eee8c>=_0x62c859){_0x4eee8c=_0x62c859;_0x2b1b6d=0xc8;}else{_0x2b1b6d=0xce;}_0x302012[_0x0664('0x1d')](_0x2b1b6d);return _0x302012[_0x0664('0x23')](_0x0664('0x24'),_0x230f89+'-'+_0x4eee8c+'/'+_0x62c859)[_0x0664('0x1e')](_0x4f2c85);}return null;};}function saveUpdates(_0x2813c6){return function(_0x374c61){if(_0x374c61){return _0x374c61[_0x0664('0x25')](_0x2813c6)[_0x0664('0x12')](function(_0xb2c9dd){return _0xb2c9dd;});}return null;};}function removeEntity(_0x11a957){return function(_0x28cdd5){if(_0x28cdd5){return _0x28cdd5[_0x0664('0x26')]()[_0x0664('0x12')](function(){var _0xc0ea0=_0x28cdd5['get']({'plain':!![]});var _0x5187ed=_0x0664('0x27');return db[_0x0664('0x28')][_0x0664('0x26')]({'where':{'type':_0x5187ed,'resourceId':_0xc0ea0['id']}})[_0x0664('0x12')](function(){return _0x28cdd5;});})['then'](function(){_0x11a957[_0x0664('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25a70b){return function(_0x31b968){if(!_0x31b968){_0x25a70b[_0x0664('0x1c')](0x194);}return _0x31b968;};}function handleError(_0x6efb97,_0x4aeb9f){_0x4aeb9f=_0x4aeb9f||0x1f4;return function(_0x322a1f){logger[_0x0664('0x19')](_0x322a1f[_0x0664('0x29')]);if(_0x322a1f['name']){delete _0x322a1f[_0x0664('0x2a')];}_0x6efb97[_0x0664('0x1d')](_0x4aeb9f)[_0x0664('0x2b')](_0x322a1f);};}function getImapHost(_0x37b237){switch(_0x37b237){case _0x0664('0x2c'):return _0x0664('0x2d');case _0x0664('0x2e'):return'imap.mail.yahoo.com';case _0x0664('0x2f'):return _0x0664('0x30');case _0x0664('0x31'):return _0x0664('0x32');}throw new Error(_0x0664('0x33'),_0x37b237);}function getSmtpHost(_0x354c4d){switch(_0x354c4d){case _0x0664('0x2c'):return _0x0664('0x34');case _0x0664('0x2e'):return _0x0664('0x35');case _0x0664('0x2f'):return _0x0664('0x36');case'outlook365':return _0x0664('0x37');}throw new Error(_0x0664('0x33'),_0x354c4d);}function getAuthenticationOptions(_0x485a0b,_0xa0dc71){var _0x2d4cf3={};var _0x398303={};if(_0x485a0b){_0x2d4cf3[_0x0664('0x38')]=_0x398303[_0x0664('0x38')]=_0xa0dc71[_0x0664('0x39')];_0x2d4cf3[_0x0664('0x3a')]=_0x398303[_0x0664('0x3b')]=_0xa0dc71[_0x0664('0x3a')];if(_0xa0dc71['modernAuthentication']){_0x2d4cf3['modernAuthentication']=_0x398303[_0x0664('0x3c')]=!![];_0x2d4cf3[_0x0664('0x3d')]=_0x398303['CloudProviderId']=_0xa0dc71['CloudProviderId'];_0x2d4cf3[_0x0664('0x3a')]=_0x398303[_0x0664('0x3b')]=null;}else{_0x2d4cf3[_0x0664('0x3d')]=_0x398303[_0x0664('0x3d')]=null;}_0x2d4cf3[_0x0664('0x3e')]=getImapHost(_0x485a0b);_0x2d4cf3[_0x0664('0x3f')]=0x3e1;_0x398303[_0x0664('0x3e')]=getSmtpHost(_0x485a0b);_0x398303[_0x0664('0x3f')]=0x24b;_0x398303[_0x0664('0x40')]=![];_0x2d4cf3[_0x0664('0x41')]=_0x398303[_0x0664('0x41')]=null;}else{if(_0xa0dc71[_0x0664('0x42')]){_0x2d4cf3[_0x0664('0x38')]=_0x398303[_0x0664('0x38')]=_0xa0dc71[_0x0664('0x39')];_0x2d4cf3[_0x0664('0x3a')]=_0x398303[_0x0664('0x3b')]=_0xa0dc71['password'];}else{_0x2d4cf3[_0x0664('0x42')]=_0x398303['authentication']=![];_0x2d4cf3[_0x0664('0x38')]=_0x398303[_0x0664('0x38')]=null;_0x2d4cf3[_0x0664('0x3a')]=_0x398303[_0x0664('0x3b')]=null;}_0x2d4cf3[_0x0664('0x3e')]=_0xa0dc71['Imap'][_0x0664('0x3e')];_0x2d4cf3[_0x0664('0x3f')]=_0xa0dc71['Imap'][_0x0664('0x3f')];_0x398303[_0x0664('0x3e')]=_0xa0dc71[_0x0664('0x43')][_0x0664('0x3e')];_0x398303[_0x0664('0x3f')]=_0xa0dc71[_0x0664('0x43')][_0x0664('0x3f')];}return{'Imap':_0x2d4cf3,'Smtp':_0x398303};}exports[_0x0664('0x44')]=function(_0x511e8e,_0x498f8e){var _0x21ed5a={'include':[{'model':db[_0x0664('0x45')],'as':_0x0664('0x46')},{'model':db['MailServerOut'],'as':_0x0664('0x43')},{'model':db[_0x0664('0x47')],'as':_0x0664('0x48')}]},_0x4031bd={},_0xc3ad41={'count':0x0,'rows':[]};var _0x50cc39=_[_0x0664('0x49')](db[_0x0664('0x4a')][_0x0664('0x4b')],function(_0x5bf470){return{'name':_0x5bf470[_0x0664('0x4c')],'type':_0x5bf470['type']['key']};});_0x4031bd[_0x0664('0x4d')]=_[_0x0664('0x49')](_0x50cc39,_0x0664('0x2a'));_0x4031bd[_0x0664('0x4e')]=_[_0x0664('0x4f')](_0x511e8e[_0x0664('0x4e')]);_0x4031bd['filters']=_['intersection'](_0x4031bd[_0x0664('0x4d')],_0x4031bd[_0x0664('0x4e')]);_0x21ed5a[_0x0664('0x50')]=_[_0x0664('0x51')](_0x4031bd[_0x0664('0x4d')],qs['fields'](_0x511e8e[_0x0664('0x4e')][_0x0664('0x52')]));_0x21ed5a[_0x0664('0x50')]=_0x21ed5a[_0x0664('0x50')][_0x0664('0x53')]?_0x21ed5a[_0x0664('0x50')]:_0x4031bd[_0x0664('0x4d')];if(!_0x511e8e['query'][_0x0664('0x54')](_0x0664('0x55'))){_0x21ed5a[_0x0664('0x22')]=qs[_0x0664('0x22')](_0x511e8e[_0x0664('0x4e')][_0x0664('0x22')]);_0x21ed5a[_0x0664('0x1f')]=qs[_0x0664('0x1f')](_0x511e8e[_0x0664('0x4e')][_0x0664('0x1f')]);}_0x21ed5a['order']=qs[_0x0664('0x56')](_0x511e8e['query'][_0x0664('0x56')]);_0x21ed5a[_0x0664('0x57')]=qs['filters'](_[_0x0664('0x58')](_0x511e8e['query'],_0x4031bd[_0x0664('0x59')]),_0x50cc39);if(_0x511e8e[_0x0664('0x4e')][_0x0664('0x5a')]){_0x21ed5a['where']=_['merge'](_0x21ed5a[_0x0664('0x57')],{'$or':_['map'](_0x50cc39,function(_0x33e1de){if(_0x33e1de[_0x0664('0x5b')]!==_0x0664('0x5c')){var _0x384068={};_0x384068[_0x33e1de[_0x0664('0x2a')]]={'$like':'%'+_0x511e8e['query']['filter']+'%'};return _0x384068;}})});}_0x21ed5a=_['merge']({},_0x21ed5a,_0x511e8e[_0x0664('0x5d')]);var _0x4f6c41={'where':_0x21ed5a[_0x0664('0x57')]};return db['MailAccount'][_0x0664('0x21')](_0x4f6c41)['then'](function(_0x546e2a){_0xc3ad41[_0x0664('0x21')]=_0x546e2a;if(_0x511e8e[_0x0664('0x4e')][_0x0664('0x5e')]){_0x21ed5a['include']=[{'all':!![]}];}return db[_0x0664('0x4a')][_0x0664('0x5f')](_0x21ed5a);})[_0x0664('0x12')](function(_0x321111){_0xc3ad41[_0x0664('0x60')]=_0x321111;return _0xc3ad41;})[_0x0664('0x12')](respondWithFilteredResult(_0x498f8e,_0x21ed5a))['catch'](handleError(_0x498f8e,null));};exports[_0x0664('0x61')]=function(_0x8e4ea9,_0x10ec4f){var _0x2c867d={'raw':![],'where':{'id':_0x8e4ea9[_0x0664('0x62')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x0664('0x43')},{'model':db[_0x0664('0x47')],'as':_0x0664('0x48')}]},_0x2c14f6={};_0x2c14f6['model']=_['keys'](db[_0x0664('0x4a')]['rawAttributes']);_0x2c14f6[_0x0664('0x4e')]=_[_0x0664('0x4f')](_0x8e4ea9[_0x0664('0x4e')]);_0x2c14f6[_0x0664('0x59')]=_[_0x0664('0x51')](_0x2c14f6[_0x0664('0x4d')],_0x2c14f6[_0x0664('0x4e')]);_0x2c867d[_0x0664('0x50')]=_[_0x0664('0x51')](_0x2c14f6[_0x0664('0x4d')],qs[_0x0664('0x52')](_0x8e4ea9[_0x0664('0x4e')]['fields']));_0x2c867d[_0x0664('0x50')]=_0x2c867d[_0x0664('0x50')]['length']?_0x2c867d['attributes']:_0x2c14f6['model'];if(_0x8e4ea9['query']['includeAll']){_0x2c867d[_0x0664('0x63')]=[{'all':!![]}];}_0x2c867d=_['merge']({},_0x2c867d,_0x8e4ea9[_0x0664('0x5d')]);return db[_0x0664('0x4a')][_0x0664('0x64')](_0x2c867d)[_0x0664('0x12')](handleEntityNotFound(_0x10ec4f,null))[_0x0664('0x12')](respondWithResult(_0x10ec4f,null))[_0x0664('0x65')](handleError(_0x10ec4f,null));};exports[_0x0664('0x25')]=function(_0x586195,_0x2f9c98){if(_0x586195[_0x0664('0x66')]['id']){delete _0x586195[_0x0664('0x66')]['id'];}var _0x1d6314=_0x586195[_0x0664('0x66')][_0x0664('0x67')]===_0x0664('0x68')?null:_0x586195['body'][_0x0664('0x67')];var _0x3c5a3d=_0x586195['body'][_0x0664('0x46')]||{};var _0x2a6e6f=_0x586195[_0x0664('0x66')]['Smtp']||{};if(_0x1d6314){_0x3c5a3d[_0x0664('0x3e')]=getImapHost(_0x1d6314);_0x3c5a3d['port']=0x3e1;_0x2a6e6f['host']=getSmtpHost(_0x1d6314);_0x2a6e6f[_0x0664('0x3f')]=0x24b;_0x2a6e6f[_0x0664('0x40')]=![];}if(_0x2a6e6f[_0x0664('0x3c')]){_0x2a6e6f[_0x0664('0x40')]=![];}else{_0x2a6e6f['CloudProviderId']=null;}if(!_0x3c5a3d['modernAuthentication'])_0x3c5a3d[_0x0664('0x3d')]=null;_0x586195[_0x0664('0x66')]['Imap']=_0x3c5a3d;_0x586195[_0x0664('0x66')][_0x0664('0x43')]=_0x2a6e6f;return db[_0x0664('0x4a')][_0x0664('0x64')]({'where':{'id':_0x586195['params']['id']},'include':[{'model':db[_0x0664('0x45')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x0664('0x43')},{'model':db[_0x0664('0x47')],'as':_0x0664('0x48')}]})[_0x0664('0x12')](handleEntityNotFound(_0x2f9c98,null))['then'](function(_0xaa5564){if(!_0xaa5564)throw new Error(_0x0664('0x69'));if(_0xaa5564[_0x0664('0x41')])delete _0x586195['body']['Imap'];return _0xaa5564;})[_0x0664('0x12')](saveUpdates(_0x586195[_0x0664('0x66')],null))[_0x0664('0x12')](function(_0x584018){if(!_0x586195['body'][_0x0664('0x46')])return _0x584018;return db[_0x0664('0x45')][_0x0664('0x25')](_0x586195[_0x0664('0x66')]['Imap'],{'where':{'MailAccountId':_0x584018['id']}})['then'](function(){return _0x584018;});})[_0x0664('0x12')](function(_0xd6e6cf){if(!_0x586195[_0x0664('0x66')][_0x0664('0x43')])return _0xd6e6cf;return db[_0x0664('0x6a')][_0x0664('0x25')](_0x586195[_0x0664('0x66')][_0x0664('0x43')],{'where':{'MailAccountId':_0xd6e6cf['id']}})['then'](function(){return _0xd6e6cf;});})[_0x0664('0x12')](respondWithResult(_0x2f9c98,null))[_0x0664('0x65')](handleError(_0x2f9c98,null));};exports[_0x0664('0x6b')]=function(_0x76c832,_0x55b528){return db[_0x0664('0x4a')][_0x0664('0x6b')]()[_0x0664('0x12')](respondWithResult(_0x55b528,null))['catch'](handleError(_0x55b528,null));};exports[_0x0664('0x6c')]=function(_0x52db6d,_0x2fd4f4){if(_0x52db6d[_0x0664('0x66')]['id']){delete _0x52db6d[_0x0664('0x66')]['id'];}return db[_0x0664('0x4a')][_0x0664('0x64')]({'where':{'id':_0x52db6d['params']['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x2fd4f4,null))['then'](function(_0x1f1ac0){if(_0x1f1ac0){_0x52db6d['body'][_0x0664('0x6d')]=_0x1f1ac0['id'];return db[_0x0664('0x6e')][_0x0664('0x6f')](_0x52db6d[_0x0664('0x66')]);}})[_0x0664('0x12')](respondWithResult(_0x2fd4f4,null))['catch'](handleError(_0x2fd4f4,null));};exports[_0x0664('0x70')]=function(_0x179672,_0x3019b4){var _0x2b6071={'raw':![],'where':{}};var _0x5f157f={};var _0x11a421={'count':0x0,'rows':[]};return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x179672['params']['id']}})['then'](handleEntityNotFound(_0x3019b4,null))['then'](function(_0x20416c){if(_0x20416c){_0x5f157f[_0x0664('0x4d')]=_['keys'](db['Disposition']['rawAttributes']);_0x5f157f[_0x0664('0x4e')]=_['keys'](_0x179672[_0x0664('0x4e')]);_0x5f157f[_0x0664('0x59')]=_['intersection'](_0x5f157f[_0x0664('0x4d')],_0x5f157f['query']);_0x2b6071[_0x0664('0x50')]=_[_0x0664('0x51')](_0x5f157f[_0x0664('0x4d')],qs['fields'](_0x179672[_0x0664('0x4e')][_0x0664('0x52')]));_0x2b6071[_0x0664('0x50')]=_0x2b6071[_0x0664('0x50')]['length']?_0x2b6071['attributes']:_0x5f157f[_0x0664('0x4d')];if(!_0x179672[_0x0664('0x4e')][_0x0664('0x54')]('nolimit')){_0x2b6071[_0x0664('0x22')]=qs[_0x0664('0x22')](_0x179672[_0x0664('0x4e')][_0x0664('0x22')]);_0x2b6071['offset']=qs['offset'](_0x179672['query'][_0x0664('0x1f')]);}_0x2b6071[_0x0664('0x72')]=qs['sort'](_0x179672[_0x0664('0x4e')][_0x0664('0x56')]);_0x2b6071[_0x0664('0x57')]=qs[_0x0664('0x59')](_[_0x0664('0x58')](_0x179672[_0x0664('0x4e')],_0x5f157f[_0x0664('0x59')]));_0x2b6071[_0x0664('0x57')]['MailAccountId']=_0x20416c['id'];if(_0x179672[_0x0664('0x4e')][_0x0664('0x5a')]){_0x2b6071[_0x0664('0x57')]=_['merge'](_0x2b6071[_0x0664('0x57')],{'$or':_[_0x0664('0x49')](_0x2b6071[_0x0664('0x50')],function(_0x4c4fb2){var _0x3d97a8={};_0x3d97a8[_0x4c4fb2]={'$like':'%'+_0x179672[_0x0664('0x4e')][_0x0664('0x5a')]+'%'};return _0x3d97a8;})});}_0x2b6071=_[_0x0664('0x73')]({},_0x2b6071,_0x179672[_0x0664('0x5d')]);return db[_0x0664('0x6e')][_0x0664('0x21')]({'where':_0x2b6071[_0x0664('0x57')]})[_0x0664('0x12')](function(_0x34b2b8){_0x11a421[_0x0664('0x21')]=_0x34b2b8;if(_0x179672[_0x0664('0x4e')][_0x0664('0x5e')]){_0x2b6071[_0x0664('0x63')]=[{'all':!![]}];}return db[_0x0664('0x6e')][_0x0664('0x5f')](_0x2b6071);})['then'](function(_0x23bc0c){_0x11a421[_0x0664('0x60')]=_0x23bc0c;return _0x11a421;});}})[_0x0664('0x12')](respondWithFilteredResult(_0x3019b4,_0x2b6071))[_0x0664('0x65')](handleError(_0x3019b4,null));};exports[_0x0664('0x74')]=function(_0x115b4a,_0x200b2c){return db[_0x0664('0x4a')][_0x0664('0x64')]({'where':{'id':_0x115b4a['params']['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x200b2c,null))['then'](function(_0x30f89e){if(_0x30f89e){return _0x30f89e[_0x0664('0x74')](_0x115b4a[_0x0664('0x4e')]['ids']);}})[_0x0664('0x12')](respondWithStatusCode(_0x200b2c,null))[_0x0664('0x65')](handleError(_0x200b2c,null));};exports[_0x0664('0x75')]=function(_0x50cb65,_0x2329dc){if(_0x50cb65[_0x0664('0x66')]['id']){delete _0x50cb65['body']['id'];}return db[_0x0664('0x4a')][_0x0664('0x64')]({'where':{'id':_0x50cb65['params']['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x2329dc,null))['then'](function(_0x1340c1){if(_0x1340c1){_0x50cb65[_0x0664('0x66')][_0x0664('0x6d')]=_0x1340c1['id'];return db['CannedAnswer'][_0x0664('0x6f')](_0x50cb65[_0x0664('0x66')]);}})[_0x0664('0x12')](respondWithResult(_0x2329dc,null))[_0x0664('0x65')](handleError(_0x2329dc,null));};exports[_0x0664('0x76')]=function(_0x2b20db,_0x500921){var _0x8dc33e={'raw':![],'where':{}};var _0x1e5d7d={};var _0x25e1cc={'count':0x0,'rows':[]};return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x2b20db[_0x0664('0x62')]['id']}})['then'](handleEntityNotFound(_0x500921,null))[_0x0664('0x12')](function(_0x564ac5){if(_0x564ac5){_0x1e5d7d[_0x0664('0x4d')]=_[_0x0664('0x4f')](db['CannedAnswer']['rawAttributes']);_0x1e5d7d['query']=_['keys'](_0x2b20db[_0x0664('0x4e')]);_0x1e5d7d[_0x0664('0x59')]=_['intersection'](_0x1e5d7d[_0x0664('0x4d')],_0x1e5d7d[_0x0664('0x4e')]);_0x8dc33e[_0x0664('0x50')]=_[_0x0664('0x51')](_0x1e5d7d[_0x0664('0x4d')],qs['fields'](_0x2b20db[_0x0664('0x4e')][_0x0664('0x52')]));_0x8dc33e['attributes']=_0x8dc33e[_0x0664('0x50')][_0x0664('0x53')]?_0x8dc33e[_0x0664('0x50')]:_0x1e5d7d[_0x0664('0x4d')];if(!_0x2b20db[_0x0664('0x4e')][_0x0664('0x54')]('nolimit')){_0x8dc33e[_0x0664('0x22')]=qs[_0x0664('0x22')](_0x2b20db[_0x0664('0x4e')]['limit']);_0x8dc33e[_0x0664('0x1f')]=qs['offset'](_0x2b20db[_0x0664('0x4e')][_0x0664('0x1f')]);}_0x8dc33e[_0x0664('0x72')]=qs[_0x0664('0x56')](_0x2b20db[_0x0664('0x4e')]['sort']);_0x8dc33e[_0x0664('0x57')]=qs[_0x0664('0x59')](_[_0x0664('0x58')](_0x2b20db[_0x0664('0x4e')],_0x1e5d7d[_0x0664('0x59')]));_0x8dc33e[_0x0664('0x57')]['MailAccountId']=_0x564ac5['id'];if(_0x2b20db[_0x0664('0x4e')][_0x0664('0x5a')]){_0x8dc33e['where']=_[_0x0664('0x73')](_0x8dc33e[_0x0664('0x57')],{'$or':_['map'](_0x8dc33e['attributes'],function(_0x4dd5e6){var _0x50c8bf={};_0x50c8bf[_0x4dd5e6]={'$like':'%'+_0x2b20db[_0x0664('0x4e')]['filter']+'%'};return _0x50c8bf;})});}_0x8dc33e=_[_0x0664('0x73')]({},_0x8dc33e,_0x2b20db[_0x0664('0x5d')]);return db[_0x0664('0x77')][_0x0664('0x21')]({'where':_0x8dc33e['where']})[_0x0664('0x12')](function(_0x46bfcf){_0x25e1cc[_0x0664('0x21')]=_0x46bfcf;if(_0x2b20db['query']['includeAll']){_0x8dc33e[_0x0664('0x63')]=[{'all':!![]}];}return db[_0x0664('0x77')][_0x0664('0x5f')](_0x8dc33e);})[_0x0664('0x12')](function(_0x5db617){_0x25e1cc['rows']=_0x5db617;return _0x25e1cc;});}})[_0x0664('0x12')](respondWithFilteredResult(_0x500921,_0x8dc33e))[_0x0664('0x65')](handleError(_0x500921,null));};exports['removeAnswers']=function(_0x300dbf,_0x101d60){return db[_0x0664('0x4a')]['find']({'where':{'id':_0x300dbf[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x101d60,null))[_0x0664('0x12')](function(_0x179df4){if(_0x179df4){return _0x179df4['removeAnswers'](_0x300dbf['query'][_0x0664('0x78')]);}})[_0x0664('0x12')](respondWithStatusCode(_0x101d60,null))['catch'](handleError(_0x101d60,null));};exports[_0x0664('0x6f')]=function(_0x2af8cb,_0x2dcd97){var _0x216699={'name':_0x2af8cb[_0x0664('0x66')][_0x0664('0x2a')],'key':_0x2af8cb[_0x0664('0x66')][_0x0664('0x79')],'provider':_0x2af8cb[_0x0664('0x66')]['provider']===_0x0664('0x68')?null:_0x2af8cb[_0x0664('0x66')]['provider'],'email':_0x2af8cb[_0x0664('0x66')][_0x0664('0x7a')],'ListId':_0x2af8cb[_0x0664('0x66')][_0x0664('0x7b')],'active':!_['isNil'](_0x2af8cb[_0x0664('0x66')]['active'])?_0x2af8cb[_0x0664('0x66')][_0x0664('0x7c')]:!![],'description':_0x2af8cb['body'][_0x0664('0x7d')]||null};var _0x4570af=getAuthenticationOptions(_0x216699[_0x0664('0x67')],_0x2af8cb[_0x0664('0x66')]);_0x216699[_0x0664('0x46')]=_0x4570af[_0x0664('0x46')];_0x216699['Smtp']=_0x4570af[_0x0664('0x43')];return db[_0x0664('0x4a')][_0x0664('0x6f')](_0x216699,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x0664('0x46')}]})[_0x0664('0x12')](function(_0x4278c6){var _0x220ae5=_0x2af8cb[_0x0664('0x38')][_0x0664('0x7e')]({'plain':!![]});if(!_0x220ae5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x220ae5[_0x0664('0x7f')]===_0x0664('0x38')){var _0xff2049=_0x4278c6['get']({'plain':!![]});return db[_0x0664('0x80')][_0x0664('0x64')]({'where':{'name':'MailAccounts','userProfileId':_0x220ae5[_0x0664('0x81')]},'raw':!![]})[_0x0664('0x12')](function(_0x3d7662){if(_0x3d7662&&_0x3d7662[_0x0664('0x82')]===0x0){return db['UserProfileResource'][_0x0664('0x6f')]({'name':_0xff2049['name'],'resourceId':_0xff2049['id'],'type':_0x3d7662[_0x0664('0x2a')],'sectionId':_0x3d7662['id']},{})[_0x0664('0x12')](function(){return _0x4278c6;});}else{return _0x4278c6;}})[_0x0664('0x65')](function(_0x294722){logger[_0x0664('0x19')](_0x0664('0x83'),_0x294722);throw _0x294722;});}return _0x4278c6;})[_0x0664('0x12')](respondWithResult(_0x2dcd97,0xc9))['catch'](handleError(_0x2dcd97,null));};exports[_0x0664('0x84')]=function(_0x548ed3,_0x26744a){return db['MailAccount']['findOne']({'where':{'id':_0x548ed3[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x26744a,null))[_0x0664('0x12')](function(_0x13e28c){if(_0x13e28c){return _0x13e28c['getImap']();}return null;})['then'](respondWithResult(_0x26744a,null))['catch'](handleError(_0x26744a,null));};exports['addImap']=function(_0x47300e,_0x57f6ae){if(_0x47300e[_0x0664('0x66')]['id']){delete _0x47300e['body']['id'];}return db[_0x0664('0x4a')]['find']({'where':{'id':_0x47300e['params']['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x57f6ae,null))['then'](function(_0x418540){if(_0x418540){_0x47300e[_0x0664('0x66')][_0x0664('0x6d')]=_0x418540['id'];return db[_0x0664('0x45')]['create'](_0x47300e[_0x0664('0x66')]);}})[_0x0664('0x12')](respondWithResult(_0x57f6ae,null))[_0x0664('0x65')](handleError(_0x57f6ae,null));};exports[_0x0664('0x85')]=function(_0x38a7d6,_0x3671c3){return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x38a7d6[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x3671c3,null))[_0x0664('0x12')](function(_0x35ddc6){if(_0x35ddc6){return _0x35ddc6[_0x0664('0x86')](null);}return null;})[_0x0664('0x12')](respondWithStatusCode(_0x3671c3,null))[_0x0664('0x65')](handleError(_0x3671c3,null));};exports[_0x0664('0x87')]=function(_0x5198fb,_0x367ae6){return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x5198fb[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x367ae6,null))[_0x0664('0x12')](function(_0x2039e2){if(_0x2039e2){return _0x2039e2[_0x0664('0x87')]();}return null;})[_0x0664('0x12')](respondWithResult(_0x367ae6,null))[_0x0664('0x65')](handleError(_0x367ae6,null));};exports[_0x0664('0x88')]=function(_0x1cd965,_0x14c708){if(_0x1cd965[_0x0664('0x66')]['id']){delete _0x1cd965[_0x0664('0x66')]['id'];}return db['MailAccount'][_0x0664('0x64')]({'where':{'id':_0x1cd965[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x14c708,null))['then'](function(_0x7ef032){if(_0x7ef032){_0x1cd965['body'][_0x0664('0x6d')]=_0x7ef032['id'];return db[_0x0664('0x6a')]['create'](_0x1cd965['body']);}})[_0x0664('0x12')](respondWithResult(_0x14c708,null))[_0x0664('0x65')](handleError(_0x14c708,null));};exports[_0x0664('0x89')]=function(_0x1cf5a6,_0x361226){return db['MailAccount'][_0x0664('0x71')]({'where':{'id':_0x1cf5a6['params']['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x361226,null))[_0x0664('0x12')](function(_0x72b325){if(_0x72b325){return _0x72b325[_0x0664('0x8a')](null);}return null;})[_0x0664('0x12')](respondWithStatusCode(_0x361226,null))[_0x0664('0x65')](handleError(_0x361226,null));};exports[_0x0664('0x8b')]=function(_0x492c0a,_0x1056b2){return db['MailInteraction'][_0x0664('0x64')]({'where':{'id':_0x492c0a[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x1056b2,null))[_0x0664('0x12')](function(_0x49ad86){if(_0x49ad86){return _0x49ad86[_0x0664('0x8b')](_0x492c0a[_0x0664('0x66')][_0x0664('0x78')],_['omit'](_0x492c0a[_0x0664('0x66')],[_0x0664('0x78'),'id'])||{});}})[_0x0664('0x12')](respondWithResult(_0x1056b2,null))['catch'](handleError(_0x1056b2,null));};exports[_0x0664('0x8c')]=function(_0x58f15b,_0x9127b0){var _0x305a8e={'raw':![],'where':{}};var _0x81e3fb={};var _0x449e9d={'count':0x0,'rows':[]};return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x58f15b['params']['id']}})['then'](handleEntityNotFound(_0x9127b0,null))[_0x0664('0x12')](function(_0x405e77){if(_0x405e77){_0x81e3fb[_0x0664('0x4d')]=_[_0x0664('0x4f')](db[_0x0664('0x8d')][_0x0664('0x4b')]);_0x81e3fb['query']=_['keys'](_0x58f15b['query']);_0x81e3fb[_0x0664('0x59')]=_[_0x0664('0x51')](_0x81e3fb[_0x0664('0x4d')],_0x81e3fb['query']);_0x305a8e[_0x0664('0x50')]=_[_0x0664('0x51')](_0x81e3fb[_0x0664('0x4d')],qs[_0x0664('0x52')](_0x58f15b[_0x0664('0x4e')][_0x0664('0x52')]));_0x305a8e[_0x0664('0x50')]=_0x305a8e[_0x0664('0x50')]['length']?_0x305a8e['attributes']:_0x81e3fb['model'];if(!_0x58f15b[_0x0664('0x4e')][_0x0664('0x54')](_0x0664('0x55'))){_0x305a8e[_0x0664('0x22')]=qs[_0x0664('0x22')](_0x58f15b[_0x0664('0x4e')]['limit']);_0x305a8e['offset']=qs[_0x0664('0x1f')](_0x58f15b[_0x0664('0x4e')][_0x0664('0x1f')]);}_0x305a8e[_0x0664('0x72')]=qs[_0x0664('0x56')](_0x58f15b[_0x0664('0x4e')]['sort']);_0x305a8e['where']=qs[_0x0664('0x59')](_['pick'](_0x58f15b[_0x0664('0x4e')],_0x81e3fb[_0x0664('0x59')]));_0x305a8e[_0x0664('0x57')][_0x0664('0x6d')]=_0x405e77['id'];if(_0x58f15b['query']['filter']){_0x305a8e['where']=_[_0x0664('0x73')](_0x305a8e[_0x0664('0x57')],{'$or':_[_0x0664('0x49')](_0x305a8e[_0x0664('0x50')],function(_0x233af6){var _0x44dcb6={};_0x44dcb6[_0x233af6]={'$like':'%'+_0x58f15b[_0x0664('0x4e')][_0x0664('0x5a')]+'%'};return _0x44dcb6;})});}_0x305a8e=_[_0x0664('0x73')]({},_0x305a8e,_0x58f15b[_0x0664('0x5d')]);return db['MailInteraction'][_0x0664('0x21')]({'where':_0x305a8e['where']})['then'](function(_0x4ca9c1){_0x449e9d[_0x0664('0x21')]=_0x4ca9c1;if(_0x58f15b[_0x0664('0x4e')][_0x0664('0x5e')]){_0x305a8e[_0x0664('0x63')]=[{'model':db['CmContact'],'as':_0x0664('0x8e'),'required':![]},{'model':db[_0x0664('0x8f')],'as':_0x0664('0x90'),'attributes':[_0x0664('0x2a'),_0x0664('0x91'),_0x0664('0x92')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0664('0x2a'),_0x0664('0x93')],'where':_0x58f15b[_0x0664('0x4e')][_0x0664('0x94')]?{'id':_0x58f15b[_0x0664('0x4e')][_0x0664('0x94')]}:undefined,'required':_0x58f15b['query'][_0x0664('0x94')]?!![]:![]}];}return db['MailInteraction'][_0x0664('0x5f')](_0x305a8e);})[_0x0664('0x12')](function(_0x4bcb83){_0x449e9d[_0x0664('0x60')]=_0x4bcb83;return _0x449e9d;});}})[_0x0664('0x12')](respondWithFilteredResult(_0x9127b0,_0x305a8e))['catch'](handleError(_0x9127b0,null));};exports['addApplications']=function addApplications(_0x435dc1,_0x4a8246){var _0x1e9726=_0x435dc1[_0x0664('0x62')]['id'];var _0x2dbe54=_0x435dc1[_0x0664('0x66')];var _0x1e2026=0xc8;var _0xbb368e=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0664('0x95')][_0x0664('0x96')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x448328){return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x1e9726},'transaction':_0x448328})[_0x0664('0x12')](function(_0x2899ff){if(_0x2899ff){return db[_0x0664('0x97')][_0x0664('0x26')]({'where':{'MailAccountId':_0x1e9726},'transaction':_0x448328})['then'](function(){var _0x3d709c=_[_0x0664('0x49')](_0x2dbe54,function(_0x5e7e88){_0x5e7e88['MailAccountId']=_0x1e9726;return _0x5e7e88;});return db[_0x0664('0x97')][_0x0664('0x98')](_0x3d709c,{'transaction':_0x448328});});}else{_0x1e2026=0x194;_0xbb368e=[];}});})[_0x0664('0x12')](function(){if(_0x1e2026!==0x194){return db[_0x0664('0x97')]['findAndCountAll']({'where':{'MailAccountId':_0x1e9726},'order':'priority'})[_0x0664('0x12')](function(_0x5c3e46){_0xbb368e=_0x5c3e46;});}})['catch'](function(_0x569b08){_0x1e2026=0x1f4;logger[_0x0664('0x19')](_0x569b08[_0x0664('0x29')]);if(_0x569b08[_0x0664('0x2a')]){delete _0x569b08[_0x0664('0x2a')];}_0xbb368e=_0x569b08;})[_0x0664('0x99')](function(){if(_0xbb368e===null){_0x4a8246[_0x0664('0x1c')](_0x1e2026);}else{if(_0x1e2026===0x1f4){_0x4a8246[_0x0664('0x1d')](_0x1e2026)['send'](_0xbb368e);}else{_0x4a8246[_0x0664('0x1d')](_0x1e2026)[_0x0664('0x1e')](_0xbb368e);}}});};exports['getApplications']=function(_0x2a7413,_0xe1bfe9){var _0xb7607a={};var _0xeb13bb={};var _0x2e2819;var _0x5d2a9f;return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x2a7413[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0xe1bfe9,null))[_0x0664('0x12')](function(_0xa59d33){if(_0xa59d33){_0x2e2819=_0xa59d33;_0xeb13bb[_0x0664('0x4d')]=_[_0x0664('0x4f')](db['MailApplication']['rawAttributes']);_0xeb13bb[_0x0664('0x4e')]=_[_0x0664('0x4f')](_0x2a7413['query']);_0xeb13bb['filters']=_[_0x0664('0x51')](_0xeb13bb[_0x0664('0x4d')],_0xeb13bb[_0x0664('0x4e')]);_0xb7607a[_0x0664('0x50')]=_[_0x0664('0x51')](_0xeb13bb[_0x0664('0x4d')],qs['fields'](_0x2a7413[_0x0664('0x4e')][_0x0664('0x52')]));_0xb7607a['attributes']=_0xb7607a[_0x0664('0x50')][_0x0664('0x53')]?_0xb7607a[_0x0664('0x50')]:_0xeb13bb[_0x0664('0x4d')];_0xb7607a[_0x0664('0x72')]=qs[_0x0664('0x56')](_0x2a7413[_0x0664('0x4e')][_0x0664('0x56')]);_0xb7607a[_0x0664('0x57')]=qs[_0x0664('0x59')](_['pick'](_0x2a7413['query'],_0xeb13bb[_0x0664('0x59')]));if(_0x2a7413['query'][_0x0664('0x5a')]){_0xb7607a['where']=_[_0x0664('0x73')](_0xb7607a[_0x0664('0x57')],{'$or':_[_0x0664('0x49')](_0xb7607a['attributes'],function(_0x2cc228){var _0x2177f2={};_0x2177f2[_0x2cc228]={'$like':'%'+_0x2a7413[_0x0664('0x4e')][_0x0664('0x5a')]+'%'};return _0x2177f2;})});}_0xb7607a=_['merge']({},_0xb7607a,_0x2a7413[_0x0664('0x5d')]);return _0x2e2819[_0x0664('0x9a')](_0xb7607a);}})[_0x0664('0x12')](function(_0x3bfbd0){if(_0x3bfbd0){_0x5d2a9f=_0x3bfbd0['length'];if(!_0x2a7413['query'][_0x0664('0x54')](_0x0664('0x55'))){_0xb7607a['limit']=qs[_0x0664('0x22')](_0x2a7413[_0x0664('0x4e')][_0x0664('0x22')]);_0xb7607a[_0x0664('0x1f')]=qs[_0x0664('0x1f')](_0x2a7413['query'][_0x0664('0x1f')]);}return _0x2e2819['getApplications'](_0xb7607a);}})[_0x0664('0x12')](function(_0x321acf){if(_0x321acf){return _0x321acf?{'count':_0x5d2a9f,'rows':_0x321acf}:null;}})[_0x0664('0x12')](respondWithResult(_0xe1bfe9,null))['catch'](handleError(_0xe1bfe9,null));};exports['getMessages']=function(_0x2375a8,_0xc3a99e){var _0x5c994b={'raw':!![],'where':{}};var _0x21966b={};var _0x43a4b6={'count':0x0,'rows':[]};return db[_0x0664('0x4a')]['findOne']({'where':{'id':_0x2375a8['params']['id']}})[_0x0664('0x12')](handleEntityNotFound(_0xc3a99e,null))[_0x0664('0x12')](function(_0x2987a6){if(_0x2987a6){_0x21966b[_0x0664('0x4d')]=_[_0x0664('0x4f')](db['MailMessage'][_0x0664('0x4b')]);_0x21966b[_0x0664('0x4e')]=_[_0x0664('0x4f')](_0x2375a8['query']);_0x21966b[_0x0664('0x59')]=_[_0x0664('0x51')](_0x21966b[_0x0664('0x4d')],_0x21966b[_0x0664('0x4e')]);_0x5c994b[_0x0664('0x50')]=_[_0x0664('0x51')](_0x21966b[_0x0664('0x4d')],qs[_0x0664('0x52')](_0x2375a8['query'][_0x0664('0x52')]));_0x5c994b[_0x0664('0x50')]=_0x5c994b[_0x0664('0x50')][_0x0664('0x53')]?_0x5c994b[_0x0664('0x50')]:_0x21966b[_0x0664('0x4d')];if(!_0x2375a8[_0x0664('0x4e')][_0x0664('0x54')](_0x0664('0x55'))){_0x5c994b[_0x0664('0x22')]=qs[_0x0664('0x22')](_0x2375a8[_0x0664('0x4e')][_0x0664('0x22')]);_0x5c994b['offset']=qs['offset'](_0x2375a8['query'][_0x0664('0x1f')]);}_0x5c994b[_0x0664('0x72')]=qs['sort'](_0x2375a8[_0x0664('0x4e')][_0x0664('0x56')]);_0x5c994b[_0x0664('0x57')]=qs[_0x0664('0x59')](_[_0x0664('0x58')](_0x2375a8['query'],_0x21966b[_0x0664('0x59')]));_0x5c994b['where'][_0x0664('0x6d')]=_0x2987a6['id'];if(_0x2375a8['query']['filter']){_0x5c994b[_0x0664('0x57')]=_[_0x0664('0x73')](_0x5c994b[_0x0664('0x57')],{'$or':_[_0x0664('0x49')](_0x5c994b[_0x0664('0x50')],function(_0x2aa27d){var _0x10f49a={};_0x10f49a[_0x2aa27d]={'$like':'%'+_0x2375a8['query']['filter']+'%'};return _0x10f49a;})});}if(_0x2375a8[_0x0664('0x4e')][_0x0664('0x9b')]){var _0x519013=_0x2375a8[_0x0664('0x4e')][_0x0664('0x9b')][_0x0664('0x9c')](',');var _0x4d11fe={};_0x4d11fe[_0x519013[0x0]]={'$gte':moment(_0x519013[0x1])['format'](_0x0664('0x9d'))};_0x5c994b[_0x0664('0x57')]=_[_0x0664('0x73')](_0x5c994b[_0x0664('0x57')],_0x4d11fe);}_0x5c994b=_[_0x0664('0x73')]({},_0x5c994b,_0x2375a8[_0x0664('0x5d')]);return db['MailMessage']['count']({'where':_0x5c994b['where']})[_0x0664('0x12')](function(_0x23246b){_0x43a4b6[_0x0664('0x21')]=_0x23246b;if(_0x2375a8[_0x0664('0x4e')][_0x0664('0x5e')]){_0x5c994b[_0x0664('0x63')]=[{'all':!![]}];}return db[_0x0664('0x9e')][_0x0664('0x5f')](_0x5c994b);})[_0x0664('0x12')](function(_0x201fba){if(_0x2375a8[_0x0664('0x4e')][_0x0664('0x9f')]==='true'){for(var _0x7d60c8=0x0;_0x7d60c8<_0x201fba[_0x0664('0x53')];_0x7d60c8++){_0x201fba[_0x7d60c8][_0x0664('0x66')]=juice(_0x201fba[_0x7d60c8][_0x0664('0x66')]);}}_0x43a4b6[_0x0664('0x60')]=_0x201fba;return _0x43a4b6;});}})[_0x0664('0x12')](respondWithFilteredResult(_0xc3a99e,_0x5c994b))['catch'](handleError(_0xc3a99e,null));};exports['send']=function(_0x581115,_0x351f84){var _0x4bb6f3,_0x19b17a={},_0xd1f2d3;if(_0x581115[_0x0664('0x66')]['to']){_0xd1f2d3=_0x581115['body']['to'][_0x0664('0x9c')](',')[0x0];}return db[_0x0664('0x4a')][_0x0664('0x64')]({'where':{'id':_0x581115[_0x0664('0x62')]['id']},'include':[{'model':db[_0x0664('0xa0')],'as':_0x0664('0xa1'),'include':[{'model':db[_0x0664('0xa2')],'as':'Contacts','where':{'email':_0xd1f2d3},'limit':0x1,'order':[[_0x0664('0xa3'),_0x0664('0xa4')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0664('0xa5')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x351f84,null))[_0x0664('0x12')](function(_0x490143){if(!_0x490143)return;_0x4bb6f3=_0x490143;if(!_0x490143['Smtp'])throw new Error(_0x0664('0xa6'));if(_[_0x0664('0xa7')](_0x581115['body'][_0x0664('0xa8')])){_0x581115[_0x0664('0x66')][_0x0664('0xa8')]=util[_0x0664('0xa9')](_0x0664('0xaa'),_0x490143['name'],_0x490143[_0x0664('0x7a')]||_0x490143[_0x0664('0x43')][_0x0664('0x38')]);}if(_0x581115[_0x0664('0x66')][_0x0664('0xab')]&&_0x581115[_0x0664('0x66')][_0x0664('0xab')][_0x0664('0x53')]){for(var _0x2675c2=0x0;_0x2675c2<_0x581115[_0x0664('0x66')][_0x0664('0xab')][_0x0664('0x53')];_0x2675c2+=0x1){_0x581115[_0x0664('0x66')]['attachments'][_0x2675c2]={'filename':_0x581115[_0x0664('0x66')]['attachments'][_0x2675c2][_0x0664('0x2a')],'path':path[_0x0664('0xac')](config[_0x0664('0xad')],_0x0664('0xae'),_0x581115[_0x0664('0x66')]['attachments'][_0x2675c2][_0x0664('0xaf')])};}}var _0x40ea7d=_0x490143[_0x0664('0xb0')]();return respondWithRpcPromise('SendMail',_0x0664('0xb1'),{'account':_0x40ea7d,'message':_0x581115[_0x0664('0x66')]});})[_0x0664('0x12')](function(_0x2f6c02){if(!_0x2f6c02)return;_0x19b17a=_0x2f6c02;if(!_0x4bb6f3[_0x0664('0xa1')])throw new Error(_0x0664('0xb2'));if(_0x4bb6f3['List'][_0x0664('0xb3')]['length'])return _0x4bb6f3[_0x0664('0xa1')]['Contacts'][0x0];return db['CmContact']['create'](_[_0x0664('0xb')](_0x581115[_0x0664('0x66')],{'firstName':_0x581115[_0x0664('0x66')]['to'],'email':_0x581115['body']['to'],'phone':_0x581115['body']['to'],'ListId':_0x4bb6f3[_0x0664('0x7b')]}));})[_0x0664('0x12')](function(_0x4ccb39){if(!_0x4ccb39)return;var _0x411064={'UserId':_0x581115[_0x0664('0x38')]['id'],'ContactId':_0x4ccb39['id'],'MailAccountId':_0x4bb6f3['id'],'inReplyTo':_0x19b17a[_0x0664('0xb4')],'to':_0x581115[_0x0664('0x66')][_0x0664('0xa8')],'cc':_0x581115[_0x0664('0x66')]['cc'],'subject':_0x581115[_0x0664('0x66')]['subject'],'attach':_0x581115[_0x0664('0x66')][_0x0664('0xb5')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x0664('0xa9')](_0x0664('0x9d')),'lastMsgDirection':_0x0664('0xb6'),'Messages':[_[_0x0664('0x73')](_0x581115[_0x0664('0x66')],{'messageId':_0x19b17a[_0x0664('0xb4')],'sentAt':moment()[_0x0664('0xa9')](_0x0664('0x9d')),'read':!![],'MailAccountId':_0x4bb6f3['id'],'UserId':_0x581115[_0x0664('0x38')]['id'],'ContactId':_0x4ccb39['id']})]};if(_0x581115[_0x0664('0x66')][_0x0664('0xb7')]){_0x411064=_[_0x0664('0x73')](_0x411064,_0x581115['body']['Interaction']);}return db[_0x0664('0x8d')][_0x0664('0x6f')](_0x411064,{'include':[{'model':db['MailMessage'],'as':_0x0664('0xb8')}]});})[_0x0664('0x12')](respondWithResult(_0x351f84,null))[_0x0664('0x65')](handleError(_0x351f84,null));};exports['verifySmtp']=function(_0x4ff38d,_0x151fa5){return db['MailAccount']['find']({'where':{'id':_0x4ff38d[_0x0664('0x62')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x0664('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x0664('0x12')](handleEntityNotFound(_0x151fa5,null))[_0x0664('0x12')](function(_0x4721bc){if(!_0x4721bc[_0x0664('0x43')])return;var _0x58fe90=_0x4721bc[_0x0664('0xb0')]();return respondWithRpcPromise(_0x0664('0xb9'),'verifySmtp',{'account':_0x58fe90});})[_0x0664('0x12')](respondWithResult(_0x151fa5,null))[_0x0664('0x65')](handleError(_0x151fa5,null));};exports[_0x0664('0x26')]=function(_0x45ad25,_0x25ebfa){return db['MailAccount'][_0x0664('0x64')]({'where':{'id':_0x45ad25[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x25ebfa,null))[_0x0664('0x12')](function(_0x3c0200){if(_0x3c0200&&_0x3c0200[_0x0664('0x41')]){throw new db['Sequelize'][(_0x0664('0xba'))](_0x0664('0xbb'));}return _0x3c0200;})['then'](removeEntity(_0x25ebfa,null))[_0x0664('0x65')](handleError(_0x25ebfa,null));};exports[_0x0664('0xbc')]=function(_0x26c7e2,_0x5bcee5){return db[_0x0664('0x4a')][_0x0664('0x64')]({'where':{'id':_0x26c7e2[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x5bcee5,null))[_0x0664('0x12')](function(_0x5c27d3){if(_0x5c27d3){return _0x5c27d3[_0x0664('0xbc')](_0x26c7e2[_0x0664('0x66')][_0x0664('0x78')],_[_0x0664('0xbd')](_0x26c7e2[_0x0664('0x66')],['ids','id'])||{})['spread'](function(_0x400ebd){for(var _0x1572e5=0x0;_0x1572e5<_0x26c7e2['body'][_0x0664('0x78')][_0x0664('0x53')];_0x1572e5+=0x1){socket[_0x0664('0xbe')](_0x0664('0xbf'),{'UserId':Number(_0x26c7e2[_0x0664('0x66')][_0x0664('0x78')][_0x1572e5]),'MailAccountId':Number(_0x26c7e2[_0x0664('0x62')]['id'])});}return _0x400ebd;});}})[_0x0664('0x12')](respondWithResult(_0x5bcee5,null))[_0x0664('0x65')](handleError(_0x5bcee5,null));};exports['removeAgents']=function(_0x151fe9,_0xea4b6a){return db[_0x0664('0x4a')]['find']({'where':{'id':_0x151fe9[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0xea4b6a,null))[_0x0664('0x12')](function(_0x48990e){if(_0x48990e){return _0x48990e[_0x0664('0xc0')](_0x151fe9[_0x0664('0x4e')][_0x0664('0x78')])[_0x0664('0x12')](function(){if(_[_0x0664('0xc1')](_0x151fe9[_0x0664('0x4e')][_0x0664('0x78')])){for(var _0x5d19c4=0x0;_0x5d19c4<_0x151fe9[_0x0664('0x4e')]['ids'][_0x0664('0x53')];_0x5d19c4+=0x1){socket['emit'](_0x0664('0xc2'),{'UserId':Number(_0x151fe9['query'][_0x0664('0x78')][_0x5d19c4]),'MailAccountId':Number(_0x151fe9[_0x0664('0x62')]['id'])});}}else{socket['emit'](_0x0664('0xc2'),{'UserId':Number(_0x151fe9[_0x0664('0x4e')]['ids']),'MailAccountId':Number(_0x151fe9[_0x0664('0x62')]['id'])});}});}})[_0x0664('0x12')](respondWithStatusCode(_0xea4b6a,null))[_0x0664('0x65')](handleError(_0xea4b6a,null));};exports[_0x0664('0xc3')]=function(_0x3459a4,_0x247b84){var _0x218bd0={};var _0xf3b7d0={};var _0x3b3d51;var _0x56d20c;return db[_0x0664('0x4a')][_0x0664('0x71')]({'where':{'id':_0x3459a4[_0x0664('0x62')]['id']}})[_0x0664('0x12')](handleEntityNotFound(_0x247b84,null))[_0x0664('0x12')](function(_0x1d0734){if(_0x1d0734){_0x3b3d51=_0x1d0734;_0xf3b7d0[_0x0664('0x4d')]=_[_0x0664('0x4f')](db[_0x0664('0x8f')][_0x0664('0x4b')]);_0xf3b7d0[_0x0664('0x4e')]=_[_0x0664('0x4f')](_0x3459a4[_0x0664('0x4e')]);_0xf3b7d0[_0x0664('0x59')]=_[_0x0664('0x51')](_0xf3b7d0[_0x0664('0x4d')],_0xf3b7d0['query']);_0x218bd0[_0x0664('0x50')]=_['intersection'](_0xf3b7d0['model'],qs[_0x0664('0x52')](_0x3459a4['query'][_0x0664('0x52')]));_0x218bd0[_0x0664('0x50')]=_0x218bd0[_0x0664('0x50')][_0x0664('0x53')]?_0x218bd0[_0x0664('0x50')]:_0xf3b7d0[_0x0664('0x4d')];_0x218bd0[_0x0664('0x72')]=qs[_0x0664('0x56')](_0x3459a4[_0x0664('0x4e')]['sort']);_0x218bd0[_0x0664('0x57')]=qs[_0x0664('0x59')](_[_0x0664('0x58')](_0x3459a4[_0x0664('0x4e')],_0xf3b7d0[_0x0664('0x59')]));if(_0x3459a4[_0x0664('0x4e')]['filter']){_0x218bd0[_0x0664('0x57')]=_[_0x0664('0x73')](_0x218bd0['where'],{'$or':_[_0x0664('0x49')](_0x218bd0['attributes'],function(_0x4a9133){var _0x1c4973={};_0x1c4973[_0x4a9133]={'$like':'%'+_0x3459a4[_0x0664('0x4e')][_0x0664('0x5a')]+'%'};return _0x1c4973;})});}_0x218bd0=_[_0x0664('0x73')]({},_0x218bd0,_0x3459a4['options']);return _0x3b3d51[_0x0664('0xc3')](_0x218bd0);}})[_0x0664('0x12')](function(_0x340d31){if(_0x340d31){_0x56d20c=_0x340d31[_0x0664('0x53')];if(!_0x3459a4[_0x0664('0x4e')]['hasOwnProperty'](_0x0664('0x55'))){_0x218bd0['limit']=qs[_0x0664('0x22')](_0x3459a4['query'][_0x0664('0x22')]);_0x218bd0[_0x0664('0x1f')]=qs[_0x0664('0x1f')](_0x3459a4[_0x0664('0x4e')]['offset']);}return _0x3b3d51[_0x0664('0xc3')](_0x218bd0);}})[_0x0664('0x12')](function(_0x350174){if(_0x350174){return _0x350174?{'count':_0x56d20c,'rows':_0x350174}:null;}})[_0x0664('0x12')](respondWithResult(_0x247b84,null))['catch'](handleError(_0x247b84,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c178b18..b204404 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 _0x8325=['exports','events','MailAccount','save','remove','emit','hasOwnProperty','hook'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8325,0x1f1));var _0x5832=function(_0x2b41e1,_0xc10e43){_0x2b41e1=_0x2b41e1-0x0;var _0x1da82f=_0x8325[_0x2b41e1];return _0x1da82f;};'use strict';var EventEmitter=require(_0x5832('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x5832('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5832('0x2'),'afterUpdate':'update','afterDestroy':_0x5832('0x3')};function emitEvent(_0x39ae55){return function(_0x17bd8b,_0x24e83e,_0x5bfa64){MailAccountEvents['emit'](_0x39ae55+':'+_0x17bd8b['id'],_0x17bd8b);MailAccountEvents[_0x5832('0x4')](_0x39ae55,_0x17bd8b);_0x5bfa64(null);};}for(var e in events){if(events[_0x5832('0x5')](e)){var event=events[e];MailAccount[_0x5832('0x6')](e,emitEvent(event));}}module[_0x5832('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x524e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','MailAccount'];(function(_0x5beda5,_0x1ea9cb){var _0x2e420f=function(_0x19fbf7){while(--_0x19fbf7){_0x5beda5['push'](_0x5beda5['shift']());}};_0x2e420f(++_0x1ea9cb);}(_0x524e,0x15e));var _0xe524=function(_0xdac35a,_0x5b1723){_0xdac35a=_0xdac35a-0x0;var _0x19438d=_0x524e[_0xdac35a];return _0x19438d;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0xe524('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe524('0x1')](0x0);var events={'afterCreate':_0xe524('0x2'),'afterUpdate':_0xe524('0x3'),'afterDestroy':_0xe524('0x4')};function emitEvent(_0x379eb1){return function(_0xabd694,_0x32c90b,_0x10d37a){MailAccountEvents[_0xe524('0x5')](_0x379eb1+':'+_0xabd694['id'],_0xabd694);MailAccountEvents['emit'](_0x379eb1,_0xabd694);_0x10d37a(null);};}for(var e in events){if(events[_0xe524('0x6')](e)){var event=events[e];MailAccount[_0xe524('0x7')](e,emitEvent(event));}}module[_0xe524('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 555ccf3..8e2aef0 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 _0x4724=['OAuth2','data5','auth','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','CloudProvider'];(function(_0x2fec20,_0x273fd0){var _0x369f01=function(_0x344f0e){while(--_0x344f0e){_0x2fec20['push'](_0x2fec20['shift']());}};_0x369f01(++_0x273fd0);}(_0x4724,0x15b));var _0x4472=function(_0x16d7a6,_0x4dac64){_0x16d7a6=_0x16d7a6-0x0;var _0x397bc1=_0x4724[_0x16d7a6];return _0x397bc1;};'use strict';var attributes=require(_0x4472('0x0'));module[_0x4472('0x1')]=function(_0x295584){return _0x295584[_0x4472('0x2')](_0x4472('0x3'),attributes,{'tableName':_0x4472('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2b72d1=this;var _0x3ff695={'id':_0x2b72d1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2b72d1[_0x4472('0x5')]!==_0x4472('0x6')){_0x3ff695[_0x4472('0x7')]=_0x2b72d1[_0x4472('0x5')];}else{_0x3ff695[_0x4472('0x8')]=_0x2b72d1['Smtp'][_0x4472('0x8')];_0x3ff695[_0x4472('0x9')]=_0x2b72d1[_0x4472('0xa')][_0x4472('0x9')];_0x3ff695[_0x4472('0xb')]=_0x2b72d1[_0x4472('0xa')][_0x4472('0xb')];}if(_0x2b72d1['Smtp'][_0x4472('0xc')]){if(_0x2b72d1[_0x4472('0xa')]['modernAuthentication']){if(!_0x2b72d1[_0x4472('0xa')][_0x4472('0xd')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3ff695['auth']={'type':_0x4472('0xe'),'user':_0x2b72d1[_0x4472('0xa')]['user'],'accessToken':_0x2b72d1[_0x4472('0xa')]['CloudProvider'][_0x4472('0xf')]};}else{_0x3ff695[_0x4472('0x10')]={'user':_0x2b72d1[_0x4472('0xa')][_0x4472('0x11')],'pass':_0x2b72d1[_0x4472('0xa')][_0x4472('0x12')]};}}return _0x3ff695;}}});}; \ No newline at end of file +var _0x5f57=['host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','./mailAccount.attributes','exports','define','MailAccount','provider','custom'];(function(_0x1d7636,_0x477d46){var _0x382f4e=function(_0x5de667){while(--_0x5de667){_0x1d7636['push'](_0x1d7636['shift']());}};_0x382f4e(++_0x477d46);}(_0x5f57,0x186));var _0x75f5=function(_0x512c5e,_0x4a888b){_0x512c5e=_0x512c5e-0x0;var _0x30befd=_0x5f57[_0x512c5e];return _0x30befd;};'use strict';var attributes=require(_0x75f5('0x0'));module[_0x75f5('0x1')]=function(_0x454d68){return _0x454d68[_0x75f5('0x2')](_0x75f5('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x486801=this;var _0x5b94ae={'id':_0x486801['id'],'tls':{'rejectUnauthorized':![]}};if(_0x486801[_0x75f5('0x4')]!==_0x75f5('0x5')){_0x5b94ae['service']=_0x486801[_0x75f5('0x4')];}else{_0x5b94ae[_0x75f5('0x6')]=_0x486801[_0x75f5('0x7')]['host'];_0x5b94ae[_0x75f5('0x8')]=_0x486801[_0x75f5('0x7')][_0x75f5('0x8')];_0x5b94ae[_0x75f5('0x9')]=_0x486801[_0x75f5('0x7')][_0x75f5('0x9')];}if(_0x486801[_0x75f5('0x7')][_0x75f5('0xa')]){if(_0x486801[_0x75f5('0x7')][_0x75f5('0xb')]){if(!_0x486801[_0x75f5('0x7')][_0x75f5('0xc')])throw new Error(_0x75f5('0xd'));_0x5b94ae[_0x75f5('0xe')]={'type':'OAuth2','user':_0x486801['Smtp'][_0x75f5('0xf')],'accessToken':_0x486801['Smtp'][_0x75f5('0xc')][_0x75f5('0x10')]};}else{_0x5b94ae['auth']={'user':_0x486801[_0x75f5('0x7')][_0x75f5('0xf')],'pass':_0x486801['Smtp'][_0x75f5('0x11')]};}}return _0x5b94ae;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4fbb018..5014ca6 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 _0xef0f=['Applications','MailServerOut','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','created','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','find','where','setDataValue','getSmtpOptions','ShowMailAccount','body','mail','difference','keys','rawAttributes','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','MailApplication'];(function(_0x4c407d,_0x31d165){var _0x55ea18=function(_0x517e84){while(--_0x517e84){_0x4c407d['push'](_0x4c407d['shift']());}};_0x55ea18(++_0x31d165);}(_0xef0f,0x168));var _0xfef0=function(_0x2fa703,_0x5aee30){_0x2fa703=_0x2fa703-0x0;var _0x39f598=_0xef0f[_0x2fa703];return _0x39f598;};'use strict';var _=require(_0xfef0('0x0'));var moment=require('moment');var BPromise=require(_0xfef0('0x1'));var rs=require(_0xfef0('0x2'));var Redis=require(_0xfef0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xfef0('0x4'))(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfef0('0x7')][_0xfef0('0x8')]({'port':0x232c});config[_0xfef0('0x9')]=_[_0xfef0('0xa')](config[_0xfef0('0x9')],{'host':_0xfef0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0x9')]));require('./mailAccount.socket')[_0xfef0('0xc')](socket);function respondWithRpcPromise(_0x100e3a,_0x3a81cc,_0x2d42dc){return new BPromise(function(_0x334e74,_0x402dff){return client[_0xfef0('0xd')](_0x100e3a,_0x2d42dc)[_0xfef0('0xe')](function(_0x11bbca){logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x3a81cc,'request\x20sent',JSON[_0xfef0('0x14')](_0x11bbca));if(_0x11bbca[_0xfef0('0x15')]){if(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x16')]===0x1f4){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x11bbca[_0xfef0('0x15')]['message']);return _0x402dff(_0x11bbca[_0xfef0('0x15')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3a81cc,_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);return _0x334e74(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);}else{logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));_0x334e74(_0x11bbca[_0xfef0('0x18')]['message']);}})[_0xfef0('0x19')](function(_0x1642cd){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x1642cd);_0x402dff(_0x1642cd);});});}exports[_0xfef0('0x1a')]=function(_0x55912f){var _0x5283e1=this;return new Promise(function(_0x4e24de,_0x20826b){return db[_0xfef0('0x1b')][_0xfef0('0x1c')]({'raw':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')]['where']||null:null,'attributes':_0x55912f['options']?_0x55912f['options'][_0xfef0('0x1e')]||null:null,'limit':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x1f')]||null:null,'include':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x55912f['options']['include'],function(_0x316e20){return{'model':db[_0x316e20[_0xfef0('0x22')]],'as':_0x316e20['as'],'attributes':_0x316e20[_0xfef0('0x1e')],'include':_0x316e20[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x316e20[_0xfef0('0x20')],function(_0x5df04f){return{'model':db[_0x5df04f[_0xfef0('0x22')]],'as':_0x5df04f['as'],'attributes':_0x5df04f[_0xfef0('0x1e')],'include':_0x5df04f['include']?_[_0xfef0('0x21')](_0x5df04f[_0xfef0('0x20')],function(_0xca0cce){return{'model':db[_0xca0cce[_0xfef0('0x22')]],'as':_0xca0cce['as'],'attributes':_0xca0cce[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x3e3c4c){logger[_0xfef0('0xf')](_0xfef0('0x1a'),_0x55912f);logger[_0xfef0('0x12')](_0xfef0('0x1a'),_0x55912f,JSON[_0xfef0('0x14')](_0x3e3c4c));_0x4e24de(_0x3e3c4c);})['catch'](function(_0x445625){logger['error']('GetMailAccount',_0x445625[_0xfef0('0x17')],_0x55912f);_0x20826b(_0x5283e1[_0xfef0('0x15')](0x1f4,_0x445625['message']));});});};exports['ShowMailAccount']=function(_0x5cf518){var _0x4f65cd=this;return new Promise(function(_0x4cce8a,_0x417535){return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'raw':_0x5cf518['options']?_0x5cf518['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x24')]||null:null,'attributes':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518[_0xfef0('0x1d')]['attributes']||null:null,'include':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x5cf518[_0xfef0('0x1d')][_0xfef0('0x20')],function(_0x3e1a64){return{'model':db[_0x3e1a64[_0xfef0('0x22')]],'as':_0x3e1a64['as'],'attributes':_0x3e1a64[_0xfef0('0x1e')],'include':_0x3e1a64[_0xfef0('0x20')]?_['map'](_0x3e1a64[_0xfef0('0x20')],function(_0xea09ec){return{'model':db[_0xea09ec[_0xfef0('0x22')]],'as':_0xea09ec['as'],'attributes':_0xea09ec[_0xfef0('0x1e')],'include':_0xea09ec[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0xea09ec[_0xfef0('0x20')],function(_0xeb75e2){return{'model':db[_0xeb75e2[_0xfef0('0x22')]],'as':_0xeb75e2['as'],'attributes':_0xeb75e2[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x22acf9){if(_0x5cf518[_0xfef0('0x1d')]['smtp']===!![])_0x22acf9[_0xfef0('0x25')]('smtpOptions',_0x22acf9[_0xfef0('0x26')]());logger[_0xfef0('0xf')](_0xfef0('0x27'),_0x5cf518);logger['debug'](_0xfef0('0x27'),_0x5cf518,JSON[_0xfef0('0x14')](_0x22acf9));_0x4cce8a(_0x22acf9);})[_0xfef0('0x19')](function(_0x5537c8){logger[_0xfef0('0x15')](_0xfef0('0x27'),_0x5537c8[_0xfef0('0x17')],_0x5cf518);_0x417535(_0x4f65cd['error'](0x1f4,_0x5537c8[_0xfef0('0x17')]));});});};exports['NotifyMailAccount']=function(_0x49ed48){var _0xf30aff=this;return new Promise(function(_0x547a5d,_0x5c3305){var _0xbf6ddd={'body':_0x49ed48[_0xfef0('0x28')],'channel':_0xfef0('0x29')};var _0x1a6593=_[_0xfef0('0x2a')](_[_0xfef0('0x2b')](db['CmContact'][_0xfef0('0x2c')]),[_0xfef0('0x2d'),'updatedAt','CompanyId',_0xfef0('0x2e')]);var _0x5dc824=![];if(_0x49ed48[_0xfef0('0x28')]['id']){delete _0x49ed48[_0xfef0('0x28')]['id'];}if(_[_0xfef0('0x2f')](_0x49ed48[_0xfef0('0x28')][_0xfef0('0x30')])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x31')));}if(_[_0xfef0('0x2f')](_0x49ed48['body'][_0xfef0('0x28')])||_0x49ed48['body']['body']===''){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x32')));}if(_['isNil'](_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x33')+_0x1a6593));}if(!_[_0xfef0('0x34')](_0x1a6593,_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x35')+_0x1a6593));}var _0x504967={};_0x504967[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body'][_0xfef0('0x30')];return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'where':{'id':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x38')],'as':_0xfef0('0x39'),'include':[{'model':db['CmContact'],'as':_0xfef0('0x3a'),'where':_0x504967,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfef0('0x3b')],'as':_0xfef0('0x3c')},{'model':db[_0xfef0('0x3d')],'as':'Smtp','include':[{'model':db[_0xfef0('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0x51f207){if(_0x51f207&&_0x51f207[_0xfef0('0x39')]){var _0x3d471c=_0x51f207[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x37')]=_[_0xfef0('0x40')](_0x3d471c,[_0xfef0('0x3c'),_0xfef0('0x39')]);_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x41')]=_0x51f207['getSmtpOptions']();_0xbf6ddd['applications']=_0x3d471c[_0xfef0('0x3c')];_0xbf6ddd[_0xfef0('0x42')]=_0x3d471c[_0xfef0('0x39')];_0xbf6ddd[_0xfef0('0x43')]=_[_0xfef0('0x44')](_0xbf6ddd[_0xfef0('0x43')],[_0xfef0('0x45')],[_0xfef0('0x46')]);if(_0xbf6ddd['account']&&_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x47')]){_0xbf6ddd[_0xfef0('0x43')][_0xfef0('0x48')]({'id':0x0,'priority':_0xbf6ddd[_0xfef0('0x43')]['length']+0x1,'app':'close','appdata':'autoclose','interval':_0xfef0('0x49')});}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x3c')]){delete _0xbf6ddd[_0xfef0('0x37')]['Applications'];}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')]){delete _0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')];}if(_0x3d471c[_0xfef0('0x39')][_0xfef0('0x3a')][_0xfef0('0x4a')]){return _0x3d471c['List'][_0xfef0('0x3a')][0x0];}var _0x163255=_['defaults'](_0x49ed48[_0xfef0('0x28')],{'firstName':_0x49ed48['body'][_0xfef0('0x30')],'ListId':_0x3d471c[_0xfef0('0x2e')]});_0x163255[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body']['from'];return db['CmContact'][_0xfef0('0x4b')](_0x163255);}else{throw new Error(_0xfef0('0x4c'));}})[_0xfef0('0xe')](function(_0x34fda3){_0xbf6ddd[_0xfef0('0x4d')]=_0x34fda3;if(_0x34fda3){if(!_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x4e')]){_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')]=rs[_0xfef0('0x4f')]()+'\x20'+_0x49ed48['body'][_0xfef0('0x17')]['from'];}var _0x135653={'ContactId':_0x34fda3['id'],'MailAccountId':_0x49ed48['account']['id'],'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['from'],'cc':_0x49ed48[_0xfef0('0x28')]['message']['cc'],'subject':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['subject'],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'lastMsgAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgDirection':'in'};return db[_0xfef0('0x53')][_0xfef0('0x23')]({'where':{'closed':![],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x54')],'as':_0xfef0('0x55'),'attributes':[_0xfef0('0x4e')],'where':{'messageId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x56')]}}]})[_0xfef0('0xe')](function(_0x28cab7){if(_0x28cab7){return[_0x28cab7,![]];}return db[_0xfef0('0x53')][_0xfef0('0x4b')](_0x135653)['then'](function(_0x12e383){return[_0x12e383,!![]];});});}else{throw new Error(_0xfef0('0x57'));}})[_0xfef0('0x58')](function(_0x3c6bb8,_0x176fc7){if(_0x3c6bb8){_0x5dc824=_0x176fc7;if(!_0x176fc7){return _0x3c6bb8[_0xfef0('0x59')]({'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x30')],'cc':_0x49ed48['body'][_0xfef0('0x17')]['cc'],'subject':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5a')],'attach':_0x3c6bb8[_0xfef0('0x50')]?_0x3c6bb8[_0xfef0('0x50')]:_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgAt':moment()[_0xfef0('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3c6bb8;}}})[_0xfef0('0xe')](function(_0x2ab666){_0xbf6ddd[_0xfef0('0x5b')]=_0x2ab666[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x5c')]=_0x5dc824;return db[_0xfef0('0x54')]['create']({'body':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x28')],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id'],'MailInteractionId':_0x2ab666['id'],'direction':'in','ContactId':_0xbf6ddd[_0xfef0('0x4d')]['id'],'messageId':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['messageId'],'from':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x30')],'to':_0x49ed48[_0xfef0('0x28')]['message']['to'],'cc':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['cc'],'subject':_0x49ed48['body'][_0xfef0('0x17')][_0xfef0('0x5a')],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'Attachments':_0x49ed48['body']['message']['attachments'],'originTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x5d')],'originCc':_0x49ed48['body'][_0xfef0('0x17')]['originCc'],'bcc':_0x49ed48['body']['message'][_0xfef0('0x5e')],'ChatWebsiteId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5f')]||null,'originChannel':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['originChannel']||_0xfef0('0x60'),'ChatOfflineMessageId':_0x49ed48['body']['message'][_0xfef0('0x61')]||null},{'include':[{'model':db[_0xfef0('0x62')],'as':_0xfef0('0x63')}]});})[_0xfef0('0xe')](function(_0x4df63b){_0xbf6ddd['message']=_0x4df63b;if(_0xbf6ddd['interaction'][_0xfef0('0x64')]){return db['User'][_0xfef0('0x23')]({'attributes':['id',_0xfef0('0x65')],'where':{'id':_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x64')]}})[_0xfef0('0xe')](function(_0x4be622){if(_0x4be622){_0xbf6ddd[_0xfef0('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4be622[_0xfef0('0x65')]+','+(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x66')]||0xa),'interval':_0xfef0('0x49')});}return respondWithRpcPromise('Start','startRouting',_0xbf6ddd);});}return respondWithRpcPromise(_0xfef0('0x67'),_0xfef0('0x68'),_0xbf6ddd);})['then'](function(_0x872f99){_0x547a5d(_0x872f99);})[_0xfef0('0x19')](function(_0x4690c0){_0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0x4690c0[_0xfef0('0x17')]));});});}; \ No newline at end of file +var _0xadb5=['ShowMailAccount','smtp','setDataValue','getSmtpOptions','body','mail','difference','rawAttributes','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','CmList','List','CmContact','Contacts','DESC','MailApplication','Applications','Smtp','account','list','applications','orderBy','priority','asc','autoclose','push','length','close','from','then','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','interaction','get','created','attachments','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify'];(function(_0x3fa7d7,_0x4cbb0d){var _0x49b77a=function(_0x330888){while(--_0x330888){_0x3fa7d7['push'](_0x3fa7d7['shift']());}};_0x49b77a(++_0x4cbb0d);}(_0xadb5,0xad));var _0x5adb=function(_0x3a80b1,_0x4d93fd){_0x3a80b1=_0x3a80b1-0x0;var _0x3db01d=_0xadb5[_0x3a80b1];return _0x3db01d;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var BPromise=require('bluebird');var rs=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var db=require(_0x5adb('0x3'))['db'];var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var jayson=require(_0x5adb('0x6'));var client=jayson['client'][_0x5adb('0x7')]({'port':0x232c});config[_0x5adb('0x8')]=_[_0x5adb('0x9')](config[_0x5adb('0x8')],{'host':_0x5adb('0xa'),'port':0x18eb});var socket=require(_0x5adb('0xb'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xc'))[_0x5adb('0xd')](socket);function respondWithRpcPromise(_0x7293ab,_0x34f59d,_0x336bad){return new BPromise(function(_0x129f5a,_0x275428){return client['request'](_0x7293ab,_0x336bad)['then'](function(_0x1a8f66){logger[_0x5adb('0xe')](_0x5adb('0xf'),_0x34f59d,'request\x20sent');logger[_0x5adb('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x34f59d,_0x5adb('0x11'),JSON['stringify'](_0x1a8f66));if(_0x1a8f66[_0x5adb('0x12')]){if(_0x1a8f66[_0x5adb('0x12')][_0x5adb('0x13')]===0x1f4){logger['error'](_0x5adb('0xf'),_0x34f59d,_0x1a8f66[_0x5adb('0x12')][_0x5adb('0x14')]);return _0x275428(_0x1a8f66['error'][_0x5adb('0x14')]);}logger['error'](_0x5adb('0xf'),_0x34f59d,_0x1a8f66[_0x5adb('0x12')][_0x5adb('0x14')]);return _0x129f5a(_0x1a8f66[_0x5adb('0x12')][_0x5adb('0x14')]);}else{logger[_0x5adb('0xe')](_0x5adb('0xf'),_0x34f59d,_0x5adb('0x11'));_0x129f5a(_0x1a8f66[_0x5adb('0x15')]['message']);}})[_0x5adb('0x16')](function(_0x5de028){logger[_0x5adb('0x12')]('MailAccount,\x20%s,\x20%s',_0x34f59d,_0x5de028);_0x275428(_0x5de028);});});}exports[_0x5adb('0x17')]=function(_0x50e84f){var _0x5e218c=this;return new Promise(function(_0x1fbaa5,_0x1bed20){return db[_0x5adb('0x18')][_0x5adb('0x19')]({'raw':_0x50e84f[_0x5adb('0x1a')]?_0x50e84f['options'][_0x5adb('0x1b')]===undefined?!![]:![]:!![],'where':_0x50e84f['options']?_0x50e84f['options'][_0x5adb('0x1c')]||null:null,'attributes':_0x50e84f[_0x5adb('0x1a')]?_0x50e84f[_0x5adb('0x1a')][_0x5adb('0x1d')]||null:null,'limit':_0x50e84f[_0x5adb('0x1a')]?_0x50e84f[_0x5adb('0x1a')][_0x5adb('0x1e')]||null:null,'include':_0x50e84f['options']?_0x50e84f[_0x5adb('0x1a')][_0x5adb('0x1f')]?_[_0x5adb('0x20')](_0x50e84f[_0x5adb('0x1a')][_0x5adb('0x1f')],function(_0x49f203){return{'model':db[_0x49f203[_0x5adb('0x21')]],'as':_0x49f203['as'],'attributes':_0x49f203[_0x5adb('0x1d')],'include':_0x49f203['include']?_[_0x5adb('0x20')](_0x49f203[_0x5adb('0x1f')],function(_0x1a0acd){return{'model':db[_0x1a0acd['model']],'as':_0x1a0acd['as'],'attributes':_0x1a0acd[_0x5adb('0x1d')],'include':_0x1a0acd[_0x5adb('0x1f')]?_[_0x5adb('0x20')](_0x1a0acd[_0x5adb('0x1f')],function(_0x36459b){return{'model':db[_0x36459b[_0x5adb('0x21')]],'as':_0x36459b['as'],'attributes':_0x36459b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d457e){logger[_0x5adb('0xe')](_0x5adb('0x17'),_0x50e84f);logger[_0x5adb('0x10')](_0x5adb('0x17'),_0x50e84f,JSON[_0x5adb('0x22')](_0x5d457e));_0x1fbaa5(_0x5d457e);})['catch'](function(_0x11ec2a){logger[_0x5adb('0x12')](_0x5adb('0x17'),_0x11ec2a[_0x5adb('0x14')],_0x50e84f);_0x1bed20(_0x5e218c[_0x5adb('0x12')](0x1f4,_0x11ec2a[_0x5adb('0x14')]));});});};exports[_0x5adb('0x23')]=function(_0x28bf1f){var _0x138bf6=this;return new Promise(function(_0x260295,_0x4790f1){return db[_0x5adb('0x18')]['find']({'raw':_0x28bf1f[_0x5adb('0x1a')]?_0x28bf1f[_0x5adb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x28bf1f[_0x5adb('0x1a')]?_0x28bf1f[_0x5adb('0x1a')][_0x5adb('0x1c')]||null:null,'attributes':_0x28bf1f['options']?_0x28bf1f[_0x5adb('0x1a')][_0x5adb('0x1d')]||null:null,'include':_0x28bf1f['options']?_0x28bf1f['options'][_0x5adb('0x1f')]?_['map'](_0x28bf1f[_0x5adb('0x1a')][_0x5adb('0x1f')],function(_0x3c2b07){return{'model':db[_0x3c2b07[_0x5adb('0x21')]],'as':_0x3c2b07['as'],'attributes':_0x3c2b07[_0x5adb('0x1d')],'include':_0x3c2b07['include']?_[_0x5adb('0x20')](_0x3c2b07[_0x5adb('0x1f')],function(_0x1c3a5c){return{'model':db[_0x1c3a5c['model']],'as':_0x1c3a5c['as'],'attributes':_0x1c3a5c['attributes'],'include':_0x1c3a5c[_0x5adb('0x1f')]?_[_0x5adb('0x20')](_0x1c3a5c['include'],function(_0x2355bc){return{'model':db[_0x2355bc['model']],'as':_0x2355bc['as'],'attributes':_0x2355bc[_0x5adb('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11cb37){if(_0x28bf1f['options'][_0x5adb('0x24')]===!![])_0x11cb37[_0x5adb('0x25')]('smtpOptions',_0x11cb37[_0x5adb('0x26')]());logger['info'](_0x5adb('0x23'),_0x28bf1f);logger[_0x5adb('0x10')](_0x5adb('0x23'),_0x28bf1f,JSON['stringify'](_0x11cb37));_0x260295(_0x11cb37);})[_0x5adb('0x16')](function(_0x2b3b0b){logger[_0x5adb('0x12')](_0x5adb('0x23'),_0x2b3b0b[_0x5adb('0x14')],_0x28bf1f);_0x4790f1(_0x138bf6['error'](0x1f4,_0x2b3b0b['message']));});});};exports['NotifyMailAccount']=function(_0x599999){var _0x427c71=this;return new Promise(function(_0x2fbe14,_0x3a104a){var _0x399489={'body':_0x599999[_0x5adb('0x27')],'channel':_0x5adb('0x28')};var _0x2c69a8=_[_0x5adb('0x29')](_['keys'](db['CmContact'][_0x5adb('0x2a')]),['createdAt',_0x5adb('0x2b'),_0x5adb('0x2c'),_0x5adb('0x2d')]);var _0x121714=![];if(_0x599999[_0x5adb('0x27')]['id']){delete _0x599999['body']['id'];}if(_[_0x5adb('0x2e')](_0x599999[_0x5adb('0x27')]['from'])){return _0x3a104a(_0x427c71[_0x5adb('0x12')](0x1f4,_0x5adb('0x2f')));}if(_['isNil'](_0x599999[_0x5adb('0x27')][_0x5adb('0x27')])||_0x599999[_0x5adb('0x27')][_0x5adb('0x27')]===''){return _0x3a104a(_0x427c71[_0x5adb('0x12')](0x1f4,_0x5adb('0x30')));}if(_[_0x5adb('0x2e')](_0x599999['body']['mapKey'])){return _0x3a104a(_0x427c71[_0x5adb('0x12')](0x1f4,_0x5adb('0x31')+_0x2c69a8));}if(!_[_0x5adb('0x32')](_0x2c69a8,_0x599999[_0x5adb('0x27')]['mapKey'])){return _0x3a104a(_0x427c71['error'](0x1f4,_0x5adb('0x33')+_0x2c69a8));}var _0x4d7d86={};_0x4d7d86[_0x599999[_0x5adb('0x27')][_0x5adb('0x34')]]=_0x599999[_0x5adb('0x27')]['from'];return db[_0x5adb('0x18')][_0x5adb('0x35')]({'where':{'id':_0x599999['account']['id']},'include':[{'model':db[_0x5adb('0x36')],'as':_0x5adb('0x37'),'include':[{'model':db[_0x5adb('0x38')],'as':_0x5adb('0x39'),'where':_0x4d7d86,'limit':0x1,'order':[[_0x5adb('0x2b'),_0x5adb('0x3a')]]}]},{'model':db[_0x5adb('0x3b')],'as':_0x5adb('0x3c')},{'model':db['MailServerOut'],'as':_0x5adb('0x3d'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x3cd211){if(_0x3cd211&&_0x3cd211[_0x5adb('0x37')]){var _0x207a81=_0x3cd211['get']({'plain':!![]});_0x399489[_0x5adb('0x3e')]=_['omit'](_0x207a81,[_0x5adb('0x3c'),_0x5adb('0x37')]);_0x399489[_0x5adb('0x3e')]['smtpOptions']=_0x3cd211[_0x5adb('0x26')]();_0x399489['applications']=_0x207a81[_0x5adb('0x3c')];_0x399489[_0x5adb('0x3f')]=_0x207a81['List'];_0x399489[_0x5adb('0x40')]=_[_0x5adb('0x41')](_0x399489[_0x5adb('0x40')],[_0x5adb('0x42')],[_0x5adb('0x43')]);if(_0x399489['account']&&_0x399489[_0x5adb('0x3e')][_0x5adb('0x44')]){_0x399489[_0x5adb('0x40')][_0x5adb('0x45')]({'id':0x0,'priority':_0x399489['applications'][_0x5adb('0x46')]+0x1,'app':_0x5adb('0x47'),'appdata':_0x5adb('0x44'),'interval':'*,*,*,*'});}if(_0x399489[_0x5adb('0x3e')][_0x5adb('0x3c')]){delete _0x399489[_0x5adb('0x3e')][_0x5adb('0x3c')];}if(_0x399489['account'][_0x5adb('0x37')]){delete _0x399489[_0x5adb('0x3e')][_0x5adb('0x37')];}if(_0x207a81[_0x5adb('0x37')][_0x5adb('0x39')]['length']){return _0x207a81[_0x5adb('0x37')]['Contacts'][0x0];}var _0x2b790d=_['defaults'](_0x599999[_0x5adb('0x27')],{'firstName':_0x599999[_0x5adb('0x27')][_0x5adb('0x48')],'ListId':_0x207a81[_0x5adb('0x2d')]});_0x2b790d[_0x599999['body'][_0x5adb('0x34')]]=_0x599999[_0x5adb('0x27')][_0x5adb('0x48')];return db['CmContact']['create'](_0x2b790d);}else{throw new Error('List\x20not\x20found');}})[_0x5adb('0x49')](function(_0x31a1f9){_0x399489[_0x5adb('0x4a')]=_0x31a1f9;if(_0x31a1f9){if(!_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4b')]){_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4b')]=rs[_0x5adb('0x4c')]()+'\x20'+_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x48')];}var _0x511746={'ContactId':_0x31a1f9['id'],'MailAccountId':_0x599999['account']['id'],'inReplyTo':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4b')],'to':_0x599999[_0x5adb('0x27')]['message'][_0x5adb('0x48')],'cc':_0x599999[_0x5adb('0x27')]['message']['cc'],'subject':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4d')],'attach':_0x599999['body'][_0x5adb('0x14')][_0x5adb('0x4e')],'lastMsgAt':moment()[_0x5adb('0x4f')](_0x5adb('0x50')),'lastMsgDirection':'in'};return db[_0x5adb('0x51')][_0x5adb('0x35')]({'where':{'closed':![],'MailAccountId':_0x599999['account']['id']},'include':[{'model':db[_0x5adb('0x52')],'as':_0x5adb('0x53'),'attributes':[_0x5adb('0x4b')],'where':{'messageId':_0x599999['body'][_0x5adb('0x14')][_0x5adb('0x54')]}}]})[_0x5adb('0x49')](function(_0x4f6107){if(_0x4f6107){return[_0x4f6107,![]];}return db[_0x5adb('0x51')]['create'](_0x511746)[_0x5adb('0x49')](function(_0x1e7e3a){return[_0x1e7e3a,!![]];});});}else{throw new Error(_0x5adb('0x55'));}})['spread'](function(_0x192b1f,_0x3627d1){if(_0x192b1f){_0x121714=_0x3627d1;if(!_0x3627d1){return _0x192b1f['update']({'inReplyTo':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4b')],'to':_0x599999[_0x5adb('0x27')]['message'][_0x5adb('0x48')],'cc':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')]['cc'],'subject':_0x599999[_0x5adb('0x27')]['message']['subject'],'attach':_0x192b1f[_0x5adb('0x4e')]?_0x192b1f['attach']:_0x599999['body']['message'][_0x5adb('0x4e')],'substatus':null,'substatusAt':moment()[_0x5adb('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x5adb('0x4f')](_0x5adb('0x50')),'lastMsgDirection':'in'});}else{return _0x192b1f;}}})[_0x5adb('0x49')](function(_0xf6ef8a){_0x399489[_0x5adb('0x56')]=_0xf6ef8a[_0x5adb('0x57')]({'plain':!![]});_0x399489[_0x5adb('0x56')][_0x5adb('0x58')]=_0x121714;return db['MailMessage']['create']({'body':_0x599999['body'][_0x5adb('0x27')],'MailAccountId':_0x599999[_0x5adb('0x3e')]['id'],'MailInteractionId':_0xf6ef8a['id'],'direction':'in','ContactId':_0x399489[_0x5adb('0x4a')]['id'],'messageId':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4b')],'from':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')]['from'],'to':_0x599999['body'][_0x5adb('0x14')]['to'],'cc':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')]['cc'],'subject':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4d')],'attach':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x4e')],'Attachments':_0x599999[_0x5adb('0x27')]['message'][_0x5adb('0x59')],'originTo':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')]['originTo'],'originCc':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')]['originCc'],'bcc':_0x599999[_0x5adb('0x27')]['message'][_0x5adb('0x5a')],'ChatWebsiteId':_0x599999[_0x5adb('0x27')]['message'][_0x5adb('0x5b')]||null,'originChannel':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x5c')]||_0x5adb('0x5d'),'ChatOfflineMessageId':_0x599999[_0x5adb('0x27')][_0x5adb('0x14')][_0x5adb('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x5adb('0x5f')}]});})[_0x5adb('0x49')](function(_0x2362b8){_0x399489['message']=_0x2362b8;if(_0x399489['interaction'][_0x5adb('0x60')]){return db['User'][_0x5adb('0x35')]({'attributes':['id',_0x5adb('0x61')],'where':{'id':_0x399489[_0x5adb('0x56')]['UserId']}})[_0x5adb('0x49')](function(_0x288e4f){if(_0x288e4f){_0x399489[_0x5adb('0x40')][_0x5adb('0x62')]({'id':0x0,'priority':0x0,'app':_0x5adb('0x63'),'appdata':_0x288e4f['name']+','+(_0x399489[_0x5adb('0x3e')][_0x5adb('0x64')]||0xa),'interval':_0x5adb('0x65')});}return respondWithRpcPromise(_0x5adb('0x66'),'startRouting',_0x399489);});}return respondWithRpcPromise(_0x5adb('0x66'),_0x5adb('0x67'),_0x399489);})[_0x5adb('0x49')](function(_0x1e9cd1){_0x2fbe14(_0x1e9cd1);})[_0x5adb('0x16')](function(_0x20faf6){_0x3a104a(_0x427c71[_0x5adb('0x12')](0x1f4,_0x20faf6['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index c52ecc6..b1243a9 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 _0xbd44=['length','./mailAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x1717b2,_0x474064){var _0x2b3038=function(_0x1cbd9f){while(--_0x1cbd9f){_0x1717b2['push'](_0x1717b2['shift']());}};_0x2b3038(++_0x474064);}(_0xbd44,0x151));var _0x4bd4=function(_0x1781a6,_0x350cb2){_0x1781a6=_0x1781a6-0x0;var _0x91de61=_0xbd44[_0x1781a6];return _0x91de61;};'use strict';var MailAccountEvents=require(_0x4bd4('0x0'));var events=[_0x4bd4('0x1'),_0x4bd4('0x2'),_0x4bd4('0x3')];function createListener(_0x47ee52,_0x337d39){return function(_0x5680ab){_0x337d39[_0x4bd4('0x4')](_0x47ee52,_0x5680ab);};}function removeListener(_0x569dd1,_0x3ba8d3){return function(){MailAccountEvents[_0x4bd4('0x5')](_0x569dd1,_0x3ba8d3);};}exports[_0x4bd4('0x6')]=function(_0x4f2b4c){for(var _0x412acd=0x0,_0x1ae77d=events[_0x4bd4('0x7')];_0x412acd<_0x1ae77d;_0x412acd++){var _0x558da8=events[_0x412acd];var _0x17dd38=createListener('mailAccount:'+_0x558da8,_0x4f2b4c);MailAccountEvents['on'](_0x558da8,_0x17dd38);}}; \ No newline at end of file +var _0xe4e7=['./mailAccount.events','save','remove','update','removeListener','register','length','mailAccount:'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0xe4e7,0x78));var _0x7e4e=function(_0x5c1b05,_0x213768){_0x5c1b05=_0x5c1b05-0x0;var _0x1a65e7=_0xe4e7[_0x5c1b05];return _0x1a65e7;};'use strict';var MailAccountEvents=require(_0x7e4e('0x0'));var events=[_0x7e4e('0x1'),_0x7e4e('0x2'),_0x7e4e('0x3')];function createListener(_0x1e69da,_0x30e2d4){return function(_0x4ef71e){_0x30e2d4['emit'](_0x1e69da,_0x4ef71e);};}function removeListener(_0x5eec43,_0x358713){return function(){MailAccountEvents[_0x7e4e('0x4')](_0x5eec43,_0x358713);};}exports[_0x7e4e('0x5')]=function(_0x377f01){for(var _0x4290ea=0x0,_0x1bb676=events[_0x7e4e('0x6')];_0x4290ea<_0x1bb676;_0x4290ea++){var _0x354bc0=events[_0x4290ea];var _0x3bd511=createListener(_0x7e4e('0x7')+_0x354bc0,_0x377f01);MailAccountEvents['on'](_0x354bc0,_0x3bd511);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9a19b94..5bcf549 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 _0xcd74=['show','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0x5f4a0b,_0xb8a9b1){var _0x1e5a6f=function(_0x4fb63c){while(--_0x4fb63c){_0x5f4a0b['push'](_0x5f4a0b['shift']());}};_0x1e5a6f(++_0xb8a9b1);}(_0xcd74,0x186));var _0x4cd7=function(_0x1111fa,_0x46727c){_0x1111fa=_0x1111fa-0x0;var _0xf07485=_0xcd74[_0x1111fa];return _0xf07485;};'use strict';var multer=require(_0x4cd7('0x0'));var util=require(_0x4cd7('0x1'));var path=require(_0x4cd7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4cd7('0x3')]();var fs_extra=require(_0x4cd7('0x4'));var auth=require(_0x4cd7('0x5'));var interaction=require(_0x4cd7('0x6'));var config=require(_0x4cd7('0x7'));var controller=require(_0x4cd7('0x8'));router[_0x4cd7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4cd7('0xa')]);router[_0x4cd7('0xb')](_0x4cd7('0xc'),auth['isAuthenticated'](),controller[_0x4cd7('0xd')]);router[_0x4cd7('0xe')](_0x4cd7('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4cd7('0xf')]=router; \ No newline at end of file +var _0x8c5a=['/:id','isAuthenticated','show','put','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','./mailApplication.controller'];(function(_0x22fa9c,_0x1bcb4f){var _0x469074=function(_0x1658e0){while(--_0x1658e0){_0x22fa9c['push'](_0x22fa9c['shift']());}};_0x469074(++_0x1bcb4f);}(_0x8c5a,0x186));var _0xa8c5=function(_0x12131b,_0x465a73){_0x12131b=_0x12131b-0x0;var _0x344993=_0x8c5a[_0x12131b];return _0x344993;};'use strict';var multer=require('multer');var util=require(_0xa8c5('0x0'));var path=require(_0xa8c5('0x1'));var timeout=require(_0xa8c5('0x2'));var express=require('express');var router=express[_0xa8c5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa8c5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa8c5('0x5'));router['get'](_0xa8c5('0x6'),auth[_0xa8c5('0x7')](),controller[_0xa8c5('0x8')]);router[_0xa8c5('0x9')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa8c5('0xa')](_0xa8c5('0x6'),auth[_0xa8c5('0x7')](),controller['destroy']);module[_0xa8c5('0xb')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 37de1c0..1c67922 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 _0xd835=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x2e3ba2,_0x475722){var _0x4114b1=function(_0x24d1e1){while(--_0x24d1e1){_0x2e3ba2['push'](_0x2e3ba2['shift']());}};_0x4114b1(++_0x475722);}(_0xd835,0xfb));var _0x5d83=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0xd835[_0x427d3a];return _0xe5c521;};'use strict';var Sequelize=require(_0x5d83('0x0'));module[_0x5d83('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5d83('0x2')],'allowNull':![],'defaultValue':_0x5d83('0x3')},'appdata':{'type':Sequelize[_0x5d83('0x4')]()},'description':{'type':Sequelize[_0x5d83('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5d83('0x5')}}; \ No newline at end of file +var _0x3695=['INTEGER','STRING','sequelize'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x3695,0x1df));var _0x5369=function(_0x45a1bd,_0x511fe2){_0x45a1bd=_0x45a1bd-0x0;var _0xf3d0a9=_0x3695[_0x45a1bd];return _0xf3d0a9;};'use strict';var Sequelize=require(_0x5369('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5369('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5369('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c948892..7da0209 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 _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x450c4a,_0x1fb7c8){var _0x135232=function(_0x54728d){while(--_0x54728d){_0x450c4a['push'](_0x450c4a['shift']());}};_0x135232(++_0x1fb7c8);}(_0x54ef,0x112));var _0xf54e=function(_0x3e05c1,_0x5575b4){_0x3e05c1=_0x3e05c1-0x0;var _0x7dd89a=_0x54ef[_0x3e05c1];return _0x7dd89a;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x488a0d,_0x3b5878){var _0x467447=function(_0x36106b){while(--_0x36106b){_0x488a0d['push'](_0x488a0d['shift']());}};_0x467447(++_0x3b5878);}(_0x54ef,0x112));var _0xf54e=function(_0x76108d,_0x46add9){_0x76108d=_0x76108d-0x0;var _0x59814c=_0x54ef[_0x76108d];return _0x59814c;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index ef196d0..9e2946e 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 _0x2cec=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4'];(function(_0x121162,_0x45757a){var _0x5ae38f=function(_0x41bc8e){while(--_0x41bc8e){_0x121162['push'](_0x121162['shift']());}};_0x5ae38f(++_0x45757a);}(_0x2cec,0x76));var _0xc2ce=function(_0x5be42a,_0x4c1509){_0x5be42a=_0x5be42a-0x0;var _0x50267c=_0x2cec[_0x5be42a];return _0x50267c;};'use strict';var _=require(_0xc2ce('0x0'));var util=require(_0xc2ce('0x1'));var logger=require(_0xc2ce('0x2'))(_0xc2ce('0x3'));var moment=require(_0xc2ce('0x4'));var BPromise=require(_0xc2ce('0x5'));var rp=require(_0xc2ce('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc2ce('0x7'));var attributes=require(_0xc2ce('0x8'));module[_0xc2ce('0x9')]=function(_0x5720d5,_0x1576d6){return _0x5720d5['define']('MailApplication',attributes,{'tableName':_0xc2ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc2ce('0xb'),'collate':_0xc2ce('0xc')});}; \ No newline at end of file +var _0xb16e=['MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','./mailApplication.attributes','exports'];(function(_0x53972e,_0x275c){var _0xc48fcf=function(_0x1130de){while(--_0x1130de){_0x53972e['push'](_0x53972e['shift']());}};_0xc48fcf(++_0x275c);}(_0xb16e,0x1a8));var _0xeb16=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0xb16e[_0x337a10];return _0x575f98;};'use strict';var _=require('lodash');var util=require(_0xeb16('0x0'));var logger=require(_0xeb16('0x1'))(_0xeb16('0x2'));var moment=require(_0xeb16('0x3'));var BPromise=require(_0xeb16('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb16('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb16('0x6'));module[_0xeb16('0x7')]=function(_0x7dc783,_0x2f9098){return _0x7dc783['define'](_0xeb16('0x8'),attributes,{'tableName':_0xeb16('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb16('0xa'),'collate':_0xeb16('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 1a3da4c..a9211ac 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 _0x9ddb=['rpc','../../config/environment','jayson/promise','client','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailApplication','update','options','raw','where','attributes','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1a8c72,_0x5bd49e){var _0x117e35=function(_0x1ad4cf){while(--_0x1ad4cf){_0x1a8c72['push'](_0x1a8c72['shift']());}};_0x117e35(++_0x5bd49e);}(_0x9ddb,0x6b));var _0xb9dd=function(_0x49c185,_0x4c1ea5){_0x49c185=_0x49c185-0x0;var _0x40dc3e=_0x9ddb[_0x49c185];return _0x40dc3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb9dd('0x0'));var rs=require(_0xb9dd('0x1'));var fs=require('fs');var Redis=require(_0xb9dd('0x2'));var db=require(_0xb9dd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9dd('0x4'))(_0xb9dd('0x5'));var config=require(_0xb9dd('0x6'));var jayson=require(_0xb9dd('0x7'));var client=jayson[_0xb9dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354bb0,_0x566e86,_0x409ebd){return new BPromise(function(_0x1bc7c0,_0x57fc6f){return client[_0xb9dd('0x9')](_0x354bb0,_0x409ebd)[_0xb9dd('0xa')](function(_0x3a3c45){logger['info'](_0xb9dd('0xb'),_0x566e86,_0xb9dd('0xc'));logger[_0xb9dd('0xd')](_0xb9dd('0xe'),_0x566e86,'request\x20sent',JSON[_0xb9dd('0xf')](_0x3a3c45));if(_0x3a3c45['error']){if(_0x3a3c45[_0xb9dd('0x10')][_0xb9dd('0x11')]===0x1f4){logger['error'](_0xb9dd('0xb'),_0x566e86,_0x3a3c45[_0xb9dd('0x10')]['message']);return _0x57fc6f(_0x3a3c45[_0xb9dd('0x10')]['message']);}logger[_0xb9dd('0x10')]('MailApplication,\x20%s,\x20%s',_0x566e86,_0x3a3c45[_0xb9dd('0x10')]['message']);return _0x1bc7c0(_0x3a3c45[_0xb9dd('0x10')][_0xb9dd('0x12')]);}else{logger[_0xb9dd('0x13')](_0xb9dd('0xb'),_0x566e86,'request\x20sent');_0x1bc7c0(_0x3a3c45[_0xb9dd('0x14')]['message']);}})[_0xb9dd('0x15')](function(_0x54df6c){logger[_0xb9dd('0x10')]('MailApplication,\x20%s,\x20%s',_0x566e86,_0x54df6c);_0x57fc6f(_0x54df6c);});});}exports[_0xb9dd('0x16')]=function(_0x4d93c2){var _0x504df6=this;return new Promise(function(_0x58cb8f,_0x378477){return db['MailApplication'][_0xb9dd('0x17')](_0x4d93c2['body'],{'raw':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')][_0xb9dd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')][_0xb9dd('0x1a')]||null:null,'attributes':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')][_0xb9dd('0x1b')]||null:null,'limit':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')]['limit']||null:null})[_0xb9dd('0xa')](function(_0x1eac8a){logger[_0xb9dd('0x13')](_0xb9dd('0x16'),_0x4d93c2);logger['debug'](_0xb9dd('0x16'),_0x4d93c2,JSON[_0xb9dd('0xf')](_0x1eac8a));_0x58cb8f(_0x1eac8a);})[_0xb9dd('0x15')](function(_0x11bf63){logger[_0xb9dd('0x10')]('UpdateMailApplication',_0x11bf63[_0xb9dd('0x12')],_0x4d93c2);_0x378477(_0x504df6[_0xb9dd('0x10')](0x1f4,_0x11bf63['message']));});});}; \ No newline at end of file +var _0x33b1=['jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','update','body','options','where','attributes','limit','then','stringify','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x444c0c,_0x32c3e0){var _0x10f030=function(_0x3b7a04){while(--_0x3b7a04){_0x444c0c['push'](_0x444c0c['shift']());}};_0x10f030(++_0x32c3e0);}(_0x33b1,0x124));var _0x133b=function(_0x14b0cf,_0x223b28){_0x14b0cf=_0x14b0cf-0x0;var _0x601755=_0x33b1[_0x14b0cf];return _0x601755;};'use strict';var _=require('lodash');var util=require(_0x133b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x133b('0x1'));var fs=require('fs');var Redis=require(_0x133b('0x2'));var db=require(_0x133b('0x3'))['db'];var utils=require(_0x133b('0x4'));var logger=require(_0x133b('0x5'))(_0x133b('0x6'));var config=require(_0x133b('0x7'));var jayson=require(_0x133b('0x8'));var client=jayson['client'][_0x133b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4298d0,_0x19e829,_0x554e91){return new BPromise(function(_0x567e66,_0x28214b){return client[_0x133b('0xa')](_0x4298d0,_0x554e91)['then'](function(_0x1e9ad7){logger[_0x133b('0xb')](_0x133b('0xc'),_0x19e829,_0x133b('0xd'));logger[_0x133b('0xe')](_0x133b('0xf'),_0x19e829,_0x133b('0xd'),JSON['stringify'](_0x1e9ad7));if(_0x1e9ad7[_0x133b('0x10')]){if(_0x1e9ad7[_0x133b('0x10')][_0x133b('0x11')]===0x1f4){logger['error'](_0x133b('0xc'),_0x19e829,_0x1e9ad7[_0x133b('0x10')]['message']);return _0x28214b(_0x1e9ad7['error']['message']);}logger[_0x133b('0x10')](_0x133b('0xc'),_0x19e829,_0x1e9ad7[_0x133b('0x10')][_0x133b('0x12')]);return _0x567e66(_0x1e9ad7[_0x133b('0x10')][_0x133b('0x12')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x19e829,'request\x20sent');_0x567e66(_0x1e9ad7[_0x133b('0x13')][_0x133b('0x12')]);}})[_0x133b('0x14')](function(_0xba97df){logger[_0x133b('0x10')](_0x133b('0xc'),_0x19e829,_0xba97df);_0x28214b(_0xba97df);});});}exports[_0x133b('0x15')]=function(_0x5f4c44){var _0x17d2c1=this;return new Promise(function(_0x812ba,_0x3920e5){return db['MailApplication'][_0x133b('0x16')](_0x5f4c44[_0x133b('0x17')],{'raw':_0x5f4c44['options']?_0x5f4c44[_0x133b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f4c44[_0x133b('0x18')]?_0x5f4c44[_0x133b('0x18')][_0x133b('0x19')]||null:null,'attributes':_0x5f4c44[_0x133b('0x18')]?_0x5f4c44[_0x133b('0x18')][_0x133b('0x1a')]||null:null,'limit':_0x5f4c44[_0x133b('0x18')]?_0x5f4c44[_0x133b('0x18')][_0x133b('0x1b')]||null:null})[_0x133b('0x1c')](function(_0x43aabf){logger[_0x133b('0xb')](_0x133b('0x15'),_0x5f4c44);logger[_0x133b('0xe')](_0x133b('0x15'),_0x5f4c44,JSON[_0x133b('0x1d')](_0x43aabf));_0x812ba(_0x43aabf);})['catch'](function(_0x436a7f){logger['error'](_0x133b('0x15'),_0x436a7f[_0x133b('0x12')],_0x5f4c44);_0x3920e5(_0x17d2c1['error'](0x1f4,_0x436a7f[_0x133b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 0743624..5970700 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 _0x1b80=['/:id/messages','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','Router','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','create'];(function(_0x30d1df,_0x51a482){var _0xda3f00=function(_0x100c8b){while(--_0x100c8b){_0x30d1df['push'](_0x30d1df['shift']());}};_0xda3f00(++_0x51a482);}(_0x1b80,0x112));var _0x01b8=function(_0x11dd48,_0x4531a4){_0x11dd48=_0x11dd48-0x0;var _0x11222c=_0x1b80[_0x11dd48];return _0x11222c;};'use strict';var express=require('express');var router=express[_0x01b8('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x01b8('0x1'));var controller=require('./mailInteraction.controller');router[_0x01b8('0x2')]('/',auth[_0x01b8('0x3')](),controller['index']);router[_0x01b8('0x2')](_0x01b8('0x4'),auth[_0x01b8('0x3')](),controller[_0x01b8('0x5')]);router[_0x01b8('0x2')](_0x01b8('0x6'),auth[_0x01b8('0x3')](),controller[_0x01b8('0x7')]);router['get']('/:id/messages',auth[_0x01b8('0x3')](),controller['getMessages']);router[_0x01b8('0x2')](_0x01b8('0x8'),auth['isAuthenticated'](),controller[_0x01b8('0x9')]);router[_0x01b8('0xa')]('/',auth[_0x01b8('0x3')](),controller[_0x01b8('0xb')]);router['post'](_0x01b8('0xc'),auth[_0x01b8('0x3')](),controller[_0x01b8('0xd')]);router[_0x01b8('0xa')]('/:id/tags',auth[_0x01b8('0x3')](),interaction[_0x01b8('0xe')](_0x01b8('0xf'),_0x01b8('0x10')),controller[_0x01b8('0x11')]);router[_0x01b8('0x12')](_0x01b8('0x6'),auth[_0x01b8('0x3')](),interaction[_0x01b8('0xe')](_0x01b8('0xf'),_0x01b8('0x13')),controller[_0x01b8('0x14')]);router[_0x01b8('0x15')](_0x01b8('0x6'),auth[_0x01b8('0x3')](),interaction[_0x01b8('0xe')]('mail',_0x01b8('0x16')),controller[_0x01b8('0x17')]);router[_0x01b8('0x15')](_0x01b8('0x18'),auth[_0x01b8('0x3')](),controller[_0x01b8('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4482=['delete','removeTags','exports','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','mail','mailinteraction:update','destroy'];(function(_0x4c91da,_0x4bbebb){var _0x172d2a=function(_0x3465b2){while(--_0x3465b2){_0x4c91da['push'](_0x4c91da['shift']());}};_0x172d2a(++_0x4bbebb);}(_0x4482,0xff));var _0x2448=function(_0x53a3ff,_0x8e6819){_0x53a3ff=_0x53a3ff-0x0;var _0x4fb860=_0x4482[_0x53a3ff];return _0x4fb860;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x2448('0x0'));var interaction=require('../../components/interaction/service');var controller=require(_0x2448('0x1'));router[_0x2448('0x2')]('/',auth[_0x2448('0x3')](),controller['index']);router['get'](_0x2448('0x4'),auth['isAuthenticated'](),controller['describe']);router[_0x2448('0x2')](_0x2448('0x5'),auth[_0x2448('0x3')](),controller[_0x2448('0x6')]);router[_0x2448('0x2')](_0x2448('0x7'),auth['isAuthenticated'](),controller[_0x2448('0x8')]);router[_0x2448('0x2')]('/:id/download',auth[_0x2448('0x3')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2448('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2448('0xa')]);router[_0x2448('0x9')](_0x2448('0xb'),auth[_0x2448('0x3')](),interaction[_0x2448('0xc')]('mail',_0x2448('0xd')),controller['addTags']);router[_0x2448('0xe')](_0x2448('0x5'),auth[_0x2448('0x3')](),interaction[_0x2448('0xc')](_0x2448('0xf'),_0x2448('0x10')),controller['update']);router['delete'](_0x2448('0x5'),auth[_0x2448('0x3')](),interaction['tracked'](_0x2448('0xf'),'mailinteraction:destroy'),controller[_0x2448('0x11')]);router[_0x2448('0x12')](_0x2448('0xb'),auth[_0x2448('0x3')](),controller[_0x2448('0x13')]);module[_0x2448('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 1fb99e6..dc96c20 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 _0xbeff=['long','DATE','ENUM','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0x2dce9d,_0x2cc39f){var _0x414e7b=function(_0x3408e0){while(--_0x3408e0){_0x2dce9d['push'](_0x2dce9d['shift']());}};_0x414e7b(++_0x2cc39f);}(_0xbeff,0x13e));var _0xfbef=function(_0x5bb2d8,_0x47a1db){_0x5bb2d8=_0x5bb2d8-0x0;var _0x19dc01=_0xbeff[_0x5bb2d8];return _0x19dc01;};'use strict';var Sequelize=require(_0xfbef('0x0'));var iconv=require(_0xfbef('0x1'));module[_0xfbef('0x2')]={'closed':{'type':Sequelize[_0xfbef('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfbef('0x4')]},'secondDisposition':{'type':Sequelize[_0xfbef('0x4')]},'thirdDisposition':{'type':Sequelize[_0xfbef('0x4')]},'note':{'type':Sequelize[_0xfbef('0x4')]},'inReplyTo':{'type':Sequelize[_0xfbef('0x4')](0x1fe)},'to':{'type':Sequelize[_0xfbef('0x4')]},'cc':{'type':Sequelize[_0xfbef('0x5')](_0xfbef('0x6'))},'subject':{'type':Sequelize[_0xfbef('0x5')]()},'attach':{'type':Sequelize[_0xfbef('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xfbef('0x7')]},'substatus':{'type':Sequelize[_0xfbef('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xfbef('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xfbef('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfbef('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfbef('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x75d4=['long','ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x4c6cf1,_0x453d0d){var _0x56e813=function(_0x3e8319){while(--_0x3e8319){_0x4c6cf1['push'](_0x4c6cf1['shift']());}};_0x56e813(++_0x453d0d);}(_0x75d4,0x93));var _0x475d=function(_0x1701ec,_0x2fce5b){_0x1701ec=_0x1701ec-0x0;var _0x111555=_0x75d4[_0x1701ec];return _0x111555;};'use strict';var Sequelize=require(_0x475d('0x0'));var iconv=require('iconv');module[_0x475d('0x1')]={'closed':{'type':Sequelize[_0x475d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x475d('0x3')]},'disposition':{'type':Sequelize[_0x475d('0x4')]},'secondDisposition':{'type':Sequelize[_0x475d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x475d('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x475d('0x5')](_0x475d('0x6'))},'subject':{'type':Sequelize[_0x475d('0x5')]()},'attach':{'type':Sequelize[_0x475d('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x475d('0x3')]},'substatus':{'type':Sequelize[_0x475d('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x475d('0x7')]('in',_0x475d('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x475d('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x475d('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 c5cf74d..ac1bd43 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 _0x27ac=['true','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','push','Attachment','Messages','from','subject','get','mkdirSync','each','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','then','destroy','error','stack','name','send','index','map','MailInteraction','fieldName','type','key','findAll','mail','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x27ac,0xa0));var _0xc27a=function(_0x2e7426,_0x21caa7){_0x2e7426=_0x2e7426-0x0;var _0x4ddeb6=_0x27ac[_0x2e7426];return _0x4ddeb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc27a('0x0'));var zipdir=require('zip-dir');var moment=require(_0xc27a('0x1'));var BPromise=require(_0xc27a('0x2'));var util=require(_0xc27a('0x3'));var path=require(_0xc27a('0x4'));var fs=require('fs');var _=require('lodash');var juice=require(_0xc27a('0x5'));var Redis=require(_0xc27a('0x6'));var interaction=require(_0xc27a('0x7'));var qs=require(_0xc27a('0x8'));var logger=require(_0xc27a('0x9'))(_0xc27a('0xa'));var config=require(_0xc27a('0xb'));var db=require(_0xc27a('0xc'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xc27a('0xd')](config['redis'],{'host':_0xc27a('0xe'),'port':0x18eb});var socket=require(_0xc27a('0xf'))(new Redis(config[_0xc27a('0x10')]));require(_0xc27a('0x11'))[_0xc27a('0x12')](socket);function respondWithStatusCode(_0xc5b21,_0x534a31){_0x534a31=_0x534a31||0xcc;return function(_0x59b8f6){if(_0x59b8f6){return _0xc5b21[_0xc27a('0x13')](_0x534a31);}return _0xc5b21['status'](_0x534a31)['end']();};}function respondWithResult(_0x4b5cd0,_0x208834){_0x208834=_0x208834||0xc8;return function(_0x3d64ef){if(_0x3d64ef){return _0x4b5cd0[_0xc27a('0x14')](_0x208834)[_0xc27a('0x15')](_0x3d64ef);}};}function respondWithFilteredResult(_0x4ac09d,_0x464f88){return function(_0x5dfeb1){if(_0x5dfeb1){var _0x4dd9ec=typeof _0x464f88[_0xc27a('0x16')]==='undefined'&&typeof _0x464f88['limit']===_0xc27a('0x17');var _0x2a3c1e=_0x5dfeb1[_0xc27a('0x18')];var _0x251adb=_0x4dd9ec?0x0:_0x464f88[_0xc27a('0x16')];var _0x5ca042=_0x4dd9ec?_0x5dfeb1[_0xc27a('0x18')]:_0x464f88[_0xc27a('0x16')]+_0x464f88[_0xc27a('0x19')];var _0x154ca5;if(_0x5ca042>=_0x2a3c1e){_0x5ca042=_0x2a3c1e;_0x154ca5=0xc8;}else{_0x154ca5=0xce;}_0x4ac09d['status'](_0x154ca5);return _0x4ac09d['set'](_0xc27a('0x1a'),_0x251adb+'-'+_0x5ca042+'/'+_0x2a3c1e)[_0xc27a('0x15')](_0x5dfeb1);}return null;};}function saveUpdates(_0x3cd19a){return function(_0x4d11d7){if(_0x4d11d7){return _0x4d11d7['update'](_0x3cd19a)[_0xc27a('0x1b')](function(_0xf57c52){return _0xf57c52;});}return null;};}function removeEntity(_0x4f7bda){return function(_0x3acbea){if(_0x3acbea){return _0x3acbea[_0xc27a('0x1c')]()[_0xc27a('0x1b')](function(){_0x4f7bda[_0xc27a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x625d1e){return function(_0x53b78c){if(!_0x53b78c){_0x625d1e[_0xc27a('0x13')](0x194);}return _0x53b78c;};}function handleError(_0x4714ef,_0x3ca347){_0x3ca347=_0x3ca347||0x1f4;return function(_0x228054){logger[_0xc27a('0x1d')](_0x228054[_0xc27a('0x1e')]);if(_0x228054['name']){delete _0x228054[_0xc27a('0x1f')];}_0x4714ef[_0xc27a('0x14')](_0x3ca347)[_0xc27a('0x20')](_0x228054);};}exports[_0xc27a('0x21')]=function(_0x54f323,_0x340945){var _0x550d9e={};var _0x3b310b=_[_0xc27a('0x22')](db[_0xc27a('0x23')]['rawAttributes'],function(_0x4d04fc){return{'name':_0x4d04fc[_0xc27a('0x24')],'type':_0x4d04fc[_0xc27a('0x25')][_0xc27a('0x26')]};});_0x550d9e=qs['getOptions'](_0x3b310b,_0x54f323);return interaction[_0xc27a('0x27')](_0xc27a('0x28'),_0x54f323[_0xc27a('0x29')],_0x54f323['user'],_0x550d9e,_0x3b310b)[_0xc27a('0x1b')](respondWithFilteredResult(_0x340945,_0x550d9e))[_0xc27a('0x2a')](handleError(_0x340945,null));};exports[_0xc27a('0x2b')]=function(_0x2b35fa,_0x5572dd){var _0x2abc9a={'raw':![],'where':{'id':_0x2b35fa[_0xc27a('0x2c')]['id']}},_0x16944c={};_0x16944c[_0xc27a('0x2d')]=_[_0xc27a('0x2e')](db[_0xc27a('0x23')][_0xc27a('0x2f')]);_0x16944c['query']=_['keys'](_0x2b35fa['query']);_0x16944c[_0xc27a('0x30')]=_[_0xc27a('0x31')](_0x16944c[_0xc27a('0x2d')],_0x16944c[_0xc27a('0x29')]);_0x2abc9a[_0xc27a('0x32')]=_[_0xc27a('0x31')](_0x16944c['model'],qs[_0xc27a('0x33')](_0x2b35fa[_0xc27a('0x29')][_0xc27a('0x33')]));_0x2abc9a[_0xc27a('0x32')]=_0x2abc9a['attributes'][_0xc27a('0x34')]?_0x2abc9a[_0xc27a('0x32')]:_0x16944c['model'];if(_0x2b35fa[_0xc27a('0x29')][_0xc27a('0x35')]){_0x2abc9a[_0xc27a('0x36')]=[{'all':!![]}];}_0x2abc9a=_[_0xc27a('0x37')]({},_0x2abc9a,_0x2b35fa[_0xc27a('0x38')]);return db[_0xc27a('0x23')][_0xc27a('0x39')](_0x2abc9a)[_0xc27a('0x1b')](handleEntityNotFound(_0x5572dd,null))['then'](respondWithResult(_0x5572dd,null))[_0xc27a('0x2a')](handleError(_0x5572dd,null));};exports[_0xc27a('0x3a')]=function(_0x20fdca,_0x36bda2){return db[_0xc27a('0x23')][_0xc27a('0x3a')](_0x20fdca[_0xc27a('0x3b')],{})[_0xc27a('0x1b')](respondWithResult(_0x36bda2,0xc9))[_0xc27a('0x2a')](handleError(_0x36bda2,null));};exports[_0xc27a('0x3c')]=function(_0x390460,_0x4b880d){if(_0x390460['body']['id']){delete _0x390460[_0xc27a('0x3b')]['id'];}return db['MailInteraction'][_0xc27a('0x39')]({'where':{'id':_0x390460['params']['id']}})['then'](handleEntityNotFound(_0x4b880d,null))[_0xc27a('0x1b')](saveUpdates(_0x390460[_0xc27a('0x3b')],null))['then'](respondWithResult(_0x4b880d,null))[_0xc27a('0x2a')](handleError(_0x4b880d,null));};exports[_0xc27a('0x1c')]=function(_0x3ff3d8,_0x14f96b){return db[_0xc27a('0x23')][_0xc27a('0x39')]({'where':{'id':_0x3ff3d8[_0xc27a('0x2c')]['id']}})[_0xc27a('0x1b')](handleEntityNotFound(_0x14f96b,null))[_0xc27a('0x1b')](removeEntity(_0x14f96b,null))['catch'](handleError(_0x14f96b,null));};exports['describe']=function(_0x23207f,_0x28575e){return db[_0xc27a('0x23')][_0xc27a('0x3d')]()[_0xc27a('0x1b')](respondWithResult(_0x28575e,null))[_0xc27a('0x2a')](handleError(_0x28575e,null));};exports[_0xc27a('0x3e')]=function(_0x361dcc,_0x2f6458){return db['MailMessage'][_0xc27a('0x39')]({'where':{'id':_0x361dcc[_0xc27a('0x2c')]['id']}})[_0xc27a('0x1b')](handleEntityNotFound(_0x2f6458,null))[_0xc27a('0x1b')](function(_0x5e81d2){if(_0x5e81d2){return _0x5e81d2[_0xc27a('0x3e')](_0x361dcc[_0xc27a('0x3b')][_0xc27a('0x3f')],_[_0xc27a('0x40')](_0x361dcc[_0xc27a('0x3b')],[_0xc27a('0x3f'),'id'])||{});}})[_0xc27a('0x1b')](respondWithResult(_0x2f6458,null))[_0xc27a('0x2a')](handleError(_0x2f6458,null));};exports[_0xc27a('0x41')]=function(_0x313ae2,_0xb087e2){var _0x301d9c={'raw':![],'where':{}};var _0x10ca04={};var _0x333a5f={'count':0x0,'rows':[]};return db['MailInteraction'][_0xc27a('0x42')]({'where':{'id':_0x313ae2['params']['id']}})[_0xc27a('0x1b')](handleEntityNotFound(_0xb087e2,null))[_0xc27a('0x1b')](function(_0x4ca301){if(_0x4ca301){_0x10ca04[_0xc27a('0x2d')]=_[_0xc27a('0x2e')](db[_0xc27a('0x43')]['rawAttributes']);_0x10ca04[_0xc27a('0x29')]=_['keys'](_0x313ae2[_0xc27a('0x29')]);_0x10ca04['filters']=_[_0xc27a('0x31')](_0x10ca04['model'],_0x10ca04['query']);_0x301d9c[_0xc27a('0x32')]=_[_0xc27a('0x31')](_0x10ca04[_0xc27a('0x2d')],qs[_0xc27a('0x33')](_0x313ae2[_0xc27a('0x29')][_0xc27a('0x33')]));_0x301d9c[_0xc27a('0x32')]=_0x301d9c[_0xc27a('0x32')][_0xc27a('0x34')]?_0x301d9c['attributes']:_0x10ca04['model'];if(!_0x313ae2[_0xc27a('0x29')]['hasOwnProperty'](_0xc27a('0x44'))){_0x301d9c[_0xc27a('0x19')]=qs[_0xc27a('0x19')](_0x313ae2[_0xc27a('0x29')][_0xc27a('0x19')]);_0x301d9c[_0xc27a('0x16')]=qs[_0xc27a('0x16')](_0x313ae2['query']['offset']);}_0x301d9c[_0xc27a('0x45')]=qs[_0xc27a('0x46')](_0x313ae2[_0xc27a('0x29')]['sort']);_0x301d9c[_0xc27a('0x47')]=qs[_0xc27a('0x30')](_['pick'](_0x313ae2['query'],_0x10ca04['filters']));_0x301d9c[_0xc27a('0x47')][_0xc27a('0x48')]=_0x4ca301['id'];if(_0x313ae2[_0xc27a('0x29')][_0xc27a('0x49')]){_0x301d9c['where']=_[_0xc27a('0x37')](_0x301d9c[_0xc27a('0x47')],{'$or':_[_0xc27a('0x22')](_0x301d9c[_0xc27a('0x32')],function(_0x5164f6){var _0xe7199f={};_0xe7199f[_0x5164f6]={'$like':'%'+_0x313ae2[_0xc27a('0x29')][_0xc27a('0x49')]+'%'};return _0xe7199f;})});}if(_0x313ae2[_0xc27a('0x29')][_0xc27a('0x4a')]){var _0x42e92b=_0x313ae2[_0xc27a('0x29')]['$gte'][_0xc27a('0x4b')](',');var _0x238e63={};_0x238e63[_0x42e92b[0x0]]={'$gte':moment(_0x42e92b[0x1])['format'](_0xc27a('0x4c'))};_0x301d9c[_0xc27a('0x47')]=_[_0xc27a('0x37')](_0x301d9c['where'],_0x238e63);}_0x301d9c=_[_0xc27a('0x37')]({},_0x301d9c,_0x313ae2[_0xc27a('0x38')]);return db[_0xc27a('0x43')][_0xc27a('0x18')]({'where':_0x301d9c['where']})[_0xc27a('0x1b')](function(_0x2d5aa1){_0x333a5f['count']=_0x2d5aa1;if(_0x313ae2['query'][_0xc27a('0x35')]){_0x301d9c[_0xc27a('0x36')]=[{'all':!![]}];}return db['MailMessage'][_0xc27a('0x27')](_0x301d9c);})['then'](function(_0x3fae8f){if(_0x313ae2['query'][_0xc27a('0x4d')]===_0xc27a('0x4e')){for(var _0x1c3be3=0x0;_0x1c3be3<_0x3fae8f[_0xc27a('0x34')];_0x1c3be3++){_0x3fae8f[_0x1c3be3][_0xc27a('0x3b')]=juice(_0x3fae8f[_0x1c3be3][_0xc27a('0x3b')]);}}_0x333a5f[_0xc27a('0x4f')]=_0x3fae8f;return _0x333a5f;});}})[_0xc27a('0x1b')](respondWithFilteredResult(_0xb087e2,_0x301d9c))['catch'](handleError(_0xb087e2,null));};exports[_0xc27a('0x50')]=function(_0x916a5f,_0xff016d){return db[_0xc27a('0x23')][_0xc27a('0x39')]({'where':{'id':_0x916a5f[_0xc27a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xff016d,null))[_0xc27a('0x1b')](function(_0x3b80a0){if(_0x3b80a0){return _0x3b80a0[_0xc27a('0x51')](_0x916a5f[_0xc27a('0x3b')][_0xc27a('0x3f')],_['omit'](_0x916a5f[_0xc27a('0x3b')],[_0xc27a('0x3f'),'id'])||{})[_0xc27a('0x52')](function(){return db[_0xc27a('0x53')]['findAll']({'attributes':['id',_0xc27a('0x1f'),_0xc27a('0x54')],'where':{'id':_0x916a5f[_0xc27a('0x3b')][_0xc27a('0x3f')]}});})[_0xc27a('0x1b')](function(_0x4a24af){socket[_0xc27a('0x55')](_0xc27a('0x56'),{'id':Number(_0x916a5f['params']['id']),'tags':_0x4a24af||[]});return{'id':Number(_0x916a5f[_0xc27a('0x2c')]['id']),'tags':_0x4a24af||[]};});}})[_0xc27a('0x1b')](respondWithResult(_0xff016d,null))[_0xc27a('0x2a')](handleError(_0xff016d,null));};exports[_0xc27a('0x57')]=function(_0xfb2f77,_0x1149e9){return db[_0xc27a('0x23')][_0xc27a('0x39')]({'where':{'id':_0xfb2f77['params']['id']}})['then'](handleEntityNotFound(_0x1149e9,null))['then'](function(_0xf808dc){if(_0xf808dc){return _0xf808dc[_0xc27a('0x57')](_0xfb2f77[_0xc27a('0x29')][_0xc27a('0x3f')]);}})[_0xc27a('0x1b')](respondWithStatusCode(_0x1149e9,null))['catch'](handleError(_0x1149e9,null));};exports[_0xc27a('0x58')]=function(_0x236426,_0x53269a){var _0x29b368=moment()[_0xc27a('0x59')]()[_0xc27a('0x5a')]();var _0x248101=path[_0xc27a('0x5b')](config[_0xc27a('0x5c')],_0xc27a('0x5d'),_0xc27a('0x5e'),_0xc27a('0x5f'));var _0x25336b=path[_0xc27a('0x5b')](config[_0xc27a('0x5c')],_0xc27a('0x5d'),_0xc27a('0x5e'),_0xc27a('0x60'));var _0x11cd94=path['join'](_0x248101,_0x29b368);var _0x4f6841=util[_0xc27a('0x61')]('transcript-%d-%s.zip',_0x236426['params']['id'],_0x29b368);var _0x456fbd=path['join'](_0x248101,_0x4f6841);var _0x1acae6=[];if(_0x236426[_0xc27a('0x29')][_0xc27a('0x60')]){_0x1acae6[_0xc27a('0x62')]({'model':db[_0xc27a('0x63')],'as':'Attachments','raw':!![]});}var _0xeca510=[{'model':db[_0xc27a('0x43')],'as':_0xc27a('0x64'),'attributes':['id',_0xc27a('0x3b'),_0xc27a('0x65'),'to','cc','bcc',_0xc27a('0x66'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x1acae6}];return db['MailInteraction'][_0xc27a('0x39')]({'where':{'id':_0x236426[_0xc27a('0x2c')]['id']},'include':_0xeca510})[_0xc27a('0x1b')](handleEntityNotFound(_0x53269a,null))['then'](function(_0x5c29e9){if(_0x5c29e9&&_0x5c29e9[_0xc27a('0x64')]){var _0x57f56b=_0x5c29e9[_0xc27a('0x67')]({'plain':!![]});fs[_0xc27a('0x68')](_0x11cd94);return BPromise[_0xc27a('0x69')](_0x57f56b['Messages'],function(_0x413d9c,_0x17fdee){var _0x2b680b={'from':_0x413d9c['from'],'to':_0x413d9c['to']||'missing.recipient@your.company.com','subject':_0x413d9c[_0xc27a('0x66')],'html':htmlEntities[_0xc27a('0x6a')](_0x413d9c[_0xc27a('0x3b')]),'headers':{'Date':moment(_0x413d9c[_0xc27a('0x6b')])[_0xc27a('0x61')](_0xc27a('0x6c'))},'attachments':[]};if(_0x413d9c['cc']){_0x2b680b[_0xc27a('0x6d')]['Cc']=_0x413d9c['cc'];}if(_0x413d9c['bcc']){_0x2b680b[_0xc27a('0x6d')][_0xc27a('0x6e')]=_0x413d9c['bcc'];}return new BPromise(function(_0x16ed21,_0x26bf54){if(_0x413d9c[_0xc27a('0x6f')]){for(var _0x141cff=0x0;_0x141cff<_0x413d9c['Attachments']['length'];_0x141cff++){var _0x4c964a=_0x413d9c[_0xc27a('0x6f')][_0x141cff];var _0x1956d8=path[_0xc27a('0x5b')](_0x25336b,_0x4c964a[_0xc27a('0x70')]);if(fs[_0xc27a('0x71')](_0x1956d8)){_0x2b680b[_0xc27a('0x60')][_0xc27a('0x62')]({'name':_0x4c964a[_0xc27a('0x1f')],'contentType':_0x4c964a[_0xc27a('0x25')],'data':fs[_0xc27a('0x72')](_0x1956d8)});}}}emlformat[_0xc27a('0x73')](_0x2b680b,function(_0x1bb529,_0x43795f){if(_0x1bb529)return _0x26bf54(_0x1bb529);fs[_0xc27a('0x74')](path[_0xc27a('0x5b')](_0x11cd94,util['format'](_0xc27a('0x75'),_0x17fdee)),_0x43795f);return _0x16ed21(_0x43795f);});});})[_0xc27a('0x1b')](function(){return new BPromise(function(_0xe9822d,_0x37ea58){zipdir(_0x11cd94,{'saveTo':_0x456fbd},function(_0x3f94f9,_0x35fd89){if(_0x3f94f9)return _0x37ea58(_0x3f94f9);return _0xe9822d(_0x35fd89);});})['then'](function(){return new BPromise(function(_0x3114bb,_0x55b666){rimraf(_0x11cd94,function(_0x146aef){if(_0x146aef)_0x55b666(_0x146aef);return _0x3114bb();});});})[_0xc27a('0x1b')](function(){return _0x53269a[_0xc27a('0x58')](_0x456fbd,_0x4f6841,function(_0x157ea5){if(!_0x157ea5)fs[_0xc27a('0x76')](_0x456fbd);});});});}else{return _0x53269a[_0xc27a('0x13')](0xc8);}})[_0xc27a('0x2a')](handleError(_0x53269a,null));}; \ No newline at end of file +var _0xe226=['attachments','push','Attachment','Attachments','Messages','bcc','subject','createdAt','mkdirSync','each','from','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','defaults','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','findAll','query','catch','show','params','model','keys','MailInteraction','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','hasOwnProperty','nolimit','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','rows','addTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip'];(function(_0x2a7622,_0x1e8526){var _0x2d5a1f=function(_0xf30bba){while(--_0xf30bba){_0x2a7622['push'](_0x2a7622['shift']());}};_0x2d5a1f(++_0x1e8526);}(_0xe226,0x8a));var _0x6e22=function(_0x26518b,_0x50be7e){_0x26518b=_0x26518b-0x0;var _0x4a28a2=_0xe226[_0x26518b];return _0x4a28a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e22('0x0'));var zipdir=require(_0x6e22('0x1'));var moment=require('moment');var BPromise=require(_0x6e22('0x2'));var util=require(_0x6e22('0x3'));var path=require(_0x6e22('0x4'));var fs=require('fs');var _=require(_0x6e22('0x5'));var juice=require('juice');var Redis=require(_0x6e22('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x6e22('0x7'));var logger=require(_0x6e22('0x8'))(_0x6e22('0x9'));var config=require(_0x6e22('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x6e22('0xb'));config[_0x6e22('0xc')]=_[_0x6e22('0xd')](config[_0x6e22('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x6e22('0xe')](socket);function respondWithStatusCode(_0x18c48b,_0x2d88d5){_0x2d88d5=_0x2d88d5||0xcc;return function(_0x32bef5){if(_0x32bef5){return _0x18c48b[_0x6e22('0xf')](_0x2d88d5);}return _0x18c48b[_0x6e22('0x10')](_0x2d88d5)[_0x6e22('0x11')]();};}function respondWithResult(_0x1cd817,_0x8d5faa){_0x8d5faa=_0x8d5faa||0xc8;return function(_0x26d6e1){if(_0x26d6e1){return _0x1cd817[_0x6e22('0x10')](_0x8d5faa)[_0x6e22('0x12')](_0x26d6e1);}};}function respondWithFilteredResult(_0x1d1795,_0x4e1ddf){return function(_0x51f618){if(_0x51f618){var _0x51292d=typeof _0x4e1ddf[_0x6e22('0x13')]===_0x6e22('0x14')&&typeof _0x4e1ddf[_0x6e22('0x15')]===_0x6e22('0x14');var _0x277f86=_0x51f618['count'];var _0x2363e2=_0x51292d?0x0:_0x4e1ddf[_0x6e22('0x13')];var _0x14b721=_0x51292d?_0x51f618[_0x6e22('0x16')]:_0x4e1ddf['offset']+_0x4e1ddf[_0x6e22('0x15')];var _0x111e5c;if(_0x14b721>=_0x277f86){_0x14b721=_0x277f86;_0x111e5c=0xc8;}else{_0x111e5c=0xce;}_0x1d1795[_0x6e22('0x10')](_0x111e5c);return _0x1d1795[_0x6e22('0x17')](_0x6e22('0x18'),_0x2363e2+'-'+_0x14b721+'/'+_0x277f86)[_0x6e22('0x12')](_0x51f618);}return null;};}function saveUpdates(_0x2c4fc7){return function(_0x136062){if(_0x136062){return _0x136062[_0x6e22('0x19')](_0x2c4fc7)[_0x6e22('0x1a')](function(_0x23d174){return _0x23d174;});}return null;};}function removeEntity(_0x593f4e){return function(_0x5832fa){if(_0x5832fa){return _0x5832fa[_0x6e22('0x1b')]()['then'](function(){_0x593f4e['status'](0xcc)[_0x6e22('0x11')]();});}};}function handleEntityNotFound(_0x13e462){return function(_0x3ebca7){if(!_0x3ebca7){_0x13e462[_0x6e22('0xf')](0x194);}return _0x3ebca7;};}function handleError(_0x83ebe0,_0x26d869){_0x26d869=_0x26d869||0x1f4;return function(_0x12bcc8){logger[_0x6e22('0x1c')](_0x12bcc8['stack']);if(_0x12bcc8[_0x6e22('0x1d')]){delete _0x12bcc8[_0x6e22('0x1d')];}_0x83ebe0[_0x6e22('0x10')](_0x26d869)[_0x6e22('0x1e')](_0x12bcc8);};}exports[_0x6e22('0x1f')]=function(_0x435fec,_0x37f1b9){var _0x2ed9a9={};var _0x488cea=_[_0x6e22('0x20')](db['MailInteraction'][_0x6e22('0x21')],function(_0x4c4d95){return{'name':_0x4c4d95['fieldName'],'type':_0x4c4d95[_0x6e22('0x22')][_0x6e22('0x23')]};});_0x2ed9a9=qs['getOptions'](_0x488cea,_0x435fec);return interaction[_0x6e22('0x24')]('mail',_0x435fec[_0x6e22('0x25')],_0x435fec['user'],_0x2ed9a9,_0x488cea)['then'](respondWithFilteredResult(_0x37f1b9,_0x2ed9a9))[_0x6e22('0x26')](handleError(_0x37f1b9,null));};exports[_0x6e22('0x27')]=function(_0xf08c38,_0x4cd9b2){var _0x22894f={'raw':![],'where':{'id':_0xf08c38[_0x6e22('0x28')]['id']}},_0x4214dc={};_0x4214dc[_0x6e22('0x29')]=_[_0x6e22('0x2a')](db[_0x6e22('0x2b')][_0x6e22('0x21')]);_0x4214dc[_0x6e22('0x25')]=_['keys'](_0xf08c38[_0x6e22('0x25')]);_0x4214dc[_0x6e22('0x2c')]=_[_0x6e22('0x2d')](_0x4214dc[_0x6e22('0x29')],_0x4214dc[_0x6e22('0x25')]);_0x22894f[_0x6e22('0x2e')]=_[_0x6e22('0x2d')](_0x4214dc[_0x6e22('0x29')],qs[_0x6e22('0x2f')](_0xf08c38[_0x6e22('0x25')][_0x6e22('0x2f')]));_0x22894f[_0x6e22('0x2e')]=_0x22894f['attributes'][_0x6e22('0x30')]?_0x22894f[_0x6e22('0x2e')]:_0x4214dc['model'];if(_0xf08c38['query']['includeAll']){_0x22894f[_0x6e22('0x31')]=[{'all':!![]}];}_0x22894f=_[_0x6e22('0x32')]({},_0x22894f,_0xf08c38[_0x6e22('0x33')]);return db[_0x6e22('0x2b')][_0x6e22('0x34')](_0x22894f)[_0x6e22('0x1a')](handleEntityNotFound(_0x4cd9b2,null))[_0x6e22('0x1a')](respondWithResult(_0x4cd9b2,null))[_0x6e22('0x26')](handleError(_0x4cd9b2,null));};exports[_0x6e22('0x35')]=function(_0x21dffd,_0x45c3b4){return db[_0x6e22('0x2b')]['create'](_0x21dffd[_0x6e22('0x36')],{})['then'](respondWithResult(_0x45c3b4,0xc9))[_0x6e22('0x26')](handleError(_0x45c3b4,null));};exports[_0x6e22('0x19')]=function(_0x33fa83,_0x450d34){if(_0x33fa83['body']['id']){delete _0x33fa83[_0x6e22('0x36')]['id'];}return db[_0x6e22('0x2b')][_0x6e22('0x34')]({'where':{'id':_0x33fa83[_0x6e22('0x28')]['id']}})['then'](handleEntityNotFound(_0x450d34,null))['then'](saveUpdates(_0x33fa83[_0x6e22('0x36')],null))[_0x6e22('0x1a')](respondWithResult(_0x450d34,null))[_0x6e22('0x26')](handleError(_0x450d34,null));};exports[_0x6e22('0x1b')]=function(_0x26554e,_0x25d069){return db[_0x6e22('0x2b')][_0x6e22('0x34')]({'where':{'id':_0x26554e[_0x6e22('0x28')]['id']}})[_0x6e22('0x1a')](handleEntityNotFound(_0x25d069,null))[_0x6e22('0x1a')](removeEntity(_0x25d069,null))[_0x6e22('0x26')](handleError(_0x25d069,null));};exports[_0x6e22('0x37')]=function(_0x36c8f4,_0x43b127){return db[_0x6e22('0x2b')][_0x6e22('0x37')]()[_0x6e22('0x1a')](respondWithResult(_0x43b127,null))[_0x6e22('0x26')](handleError(_0x43b127,null));};exports[_0x6e22('0x38')]=function(_0x1a46b6,_0x3866cd){return db['MailMessage'][_0x6e22('0x34')]({'where':{'id':_0x1a46b6['params']['id']}})[_0x6e22('0x1a')](handleEntityNotFound(_0x3866cd,null))[_0x6e22('0x1a')](function(_0x2a5d09){if(_0x2a5d09){return _0x2a5d09['addMessage'](_0x1a46b6[_0x6e22('0x36')][_0x6e22('0x39')],_[_0x6e22('0x3a')](_0x1a46b6[_0x6e22('0x36')],[_0x6e22('0x39'),'id'])||{});}})['then'](respondWithResult(_0x3866cd,null))['catch'](handleError(_0x3866cd,null));};exports[_0x6e22('0x3b')]=function(_0x440b6e,_0x52f73f){var _0x5c4005={'raw':![],'where':{}};var _0x4fd331={};var _0x4db85f={'count':0x0,'rows':[]};return db['MailInteraction'][_0x6e22('0x3c')]({'where':{'id':_0x440b6e[_0x6e22('0x28')]['id']}})['then'](handleEntityNotFound(_0x52f73f,null))[_0x6e22('0x1a')](function(_0x4d8eb6){if(_0x4d8eb6){_0x4fd331['model']=_[_0x6e22('0x2a')](db[_0x6e22('0x3d')]['rawAttributes']);_0x4fd331['query']=_[_0x6e22('0x2a')](_0x440b6e[_0x6e22('0x25')]);_0x4fd331['filters']=_[_0x6e22('0x2d')](_0x4fd331[_0x6e22('0x29')],_0x4fd331['query']);_0x5c4005['attributes']=_[_0x6e22('0x2d')](_0x4fd331[_0x6e22('0x29')],qs[_0x6e22('0x2f')](_0x440b6e[_0x6e22('0x25')][_0x6e22('0x2f')]));_0x5c4005[_0x6e22('0x2e')]=_0x5c4005['attributes'][_0x6e22('0x30')]?_0x5c4005[_0x6e22('0x2e')]:_0x4fd331[_0x6e22('0x29')];if(!_0x440b6e['query'][_0x6e22('0x3e')](_0x6e22('0x3f'))){_0x5c4005['limit']=qs['limit'](_0x440b6e[_0x6e22('0x25')][_0x6e22('0x15')]);_0x5c4005['offset']=qs[_0x6e22('0x13')](_0x440b6e['query'][_0x6e22('0x13')]);}_0x5c4005['order']=qs[_0x6e22('0x40')](_0x440b6e[_0x6e22('0x25')]['sort']);_0x5c4005[_0x6e22('0x41')]=qs['filters'](_[_0x6e22('0x42')](_0x440b6e[_0x6e22('0x25')],_0x4fd331[_0x6e22('0x2c')]));_0x5c4005[_0x6e22('0x41')][_0x6e22('0x43')]=_0x4d8eb6['id'];if(_0x440b6e[_0x6e22('0x25')]['filter']){_0x5c4005[_0x6e22('0x41')]=_['merge'](_0x5c4005[_0x6e22('0x41')],{'$or':_[_0x6e22('0x20')](_0x5c4005[_0x6e22('0x2e')],function(_0x8e2122){var _0x99ef21={};_0x99ef21[_0x8e2122]={'$like':'%'+_0x440b6e[_0x6e22('0x25')][_0x6e22('0x44')]+'%'};return _0x99ef21;})});}if(_0x440b6e[_0x6e22('0x25')][_0x6e22('0x45')]){var _0x1bde58=_0x440b6e[_0x6e22('0x25')][_0x6e22('0x45')][_0x6e22('0x46')](',');var _0x150a94={};_0x150a94[_0x1bde58[0x0]]={'$gte':moment(_0x1bde58[0x1])[_0x6e22('0x47')](_0x6e22('0x48'))};_0x5c4005[_0x6e22('0x41')]=_['merge'](_0x5c4005[_0x6e22('0x41')],_0x150a94);}_0x5c4005=_[_0x6e22('0x32')]({},_0x5c4005,_0x440b6e[_0x6e22('0x33')]);return db['MailMessage'][_0x6e22('0x16')]({'where':_0x5c4005['where']})['then'](function(_0x1a1150){_0x4db85f['count']=_0x1a1150;if(_0x440b6e['query'][_0x6e22('0x49')]){_0x5c4005[_0x6e22('0x31')]=[{'all':!![]}];}return db[_0x6e22('0x3d')]['findAll'](_0x5c4005);})[_0x6e22('0x1a')](function(_0x2049db){if(_0x440b6e['query'][_0x6e22('0x4a')]===_0x6e22('0x4b')){for(var _0x3a332d=0x0;_0x3a332d<_0x2049db[_0x6e22('0x30')];_0x3a332d++){_0x2049db[_0x3a332d][_0x6e22('0x36')]=juice(_0x2049db[_0x3a332d][_0x6e22('0x36')]);}}_0x4db85f[_0x6e22('0x4c')]=_0x2049db;return _0x4db85f;});}})['then'](respondWithFilteredResult(_0x52f73f,_0x5c4005))[_0x6e22('0x26')](handleError(_0x52f73f,null));};exports[_0x6e22('0x4d')]=function(_0x3c963a,_0x32dce5){return db[_0x6e22('0x2b')][_0x6e22('0x34')]({'where':{'id':_0x3c963a['params']['id']}})[_0x6e22('0x1a')](handleEntityNotFound(_0x32dce5,null))[_0x6e22('0x1a')](function(_0x4e08b9){if(_0x4e08b9){return _0x4e08b9['setTags'](_0x3c963a[_0x6e22('0x36')][_0x6e22('0x39')],_[_0x6e22('0x3a')](_0x3c963a['body'],[_0x6e22('0x39'),'id'])||{})[_0x6e22('0x4e')](function(){return db[_0x6e22('0x4f')][_0x6e22('0x24')]({'attributes':['id',_0x6e22('0x1d'),'color'],'where':{'id':_0x3c963a[_0x6e22('0x36')][_0x6e22('0x39')]}});})[_0x6e22('0x1a')](function(_0x368a6e){socket[_0x6e22('0x50')](_0x6e22('0x51'),{'id':Number(_0x3c963a[_0x6e22('0x28')]['id']),'tags':_0x368a6e||[]});return{'id':Number(_0x3c963a['params']['id']),'tags':_0x368a6e||[]};});}})['then'](respondWithResult(_0x32dce5,null))[_0x6e22('0x26')](handleError(_0x32dce5,null));};exports[_0x6e22('0x52')]=function(_0x2ae81c,_0x145e87){return db[_0x6e22('0x2b')]['find']({'where':{'id':_0x2ae81c[_0x6e22('0x28')]['id']}})[_0x6e22('0x1a')](handleEntityNotFound(_0x145e87,null))['then'](function(_0x55340e){if(_0x55340e){return _0x55340e[_0x6e22('0x52')](_0x2ae81c[_0x6e22('0x25')][_0x6e22('0x39')]);}})[_0x6e22('0x1a')](respondWithStatusCode(_0x145e87,null))[_0x6e22('0x26')](handleError(_0x145e87,null));};exports[_0x6e22('0x53')]=function(_0x3541ab,_0x23c59c){var _0x55188d=moment()[_0x6e22('0x54')]()[_0x6e22('0x55')]();var _0x554f11=path['join'](config[_0x6e22('0x56')],_0x6e22('0x57'),_0x6e22('0x58'),_0x6e22('0x59'));var _0x52c3f1=path[_0x6e22('0x5a')](config[_0x6e22('0x56')],_0x6e22('0x57'),_0x6e22('0x58'),'attachments');var _0xcb5de6=path[_0x6e22('0x5a')](_0x554f11,_0x55188d);var _0x5e4905=util['format'](_0x6e22('0x5b'),_0x3541ab[_0x6e22('0x28')]['id'],_0x55188d);var _0x4ead15=path['join'](_0x554f11,_0x5e4905);var _0x221f10=[];if(_0x3541ab[_0x6e22('0x25')][_0x6e22('0x5c')]){_0x221f10[_0x6e22('0x5d')]({'model':db[_0x6e22('0x5e')],'as':_0x6e22('0x5f'),'raw':!![]});}var _0x1de9ea=[{'model':db[_0x6e22('0x3d')],'as':_0x6e22('0x60'),'attributes':['id',_0x6e22('0x36'),'from','to','cc',_0x6e22('0x61'),_0x6e22('0x62'),_0x6e22('0x63')],'where':{'secret':![]},'order':qs[_0x6e22('0x40')]('id'),'include':_0x221f10}];return db[_0x6e22('0x2b')]['find']({'where':{'id':_0x3541ab[_0x6e22('0x28')]['id']},'include':_0x1de9ea})['then'](handleEntityNotFound(_0x23c59c,null))[_0x6e22('0x1a')](function(_0x3d01db){if(_0x3d01db&&_0x3d01db[_0x6e22('0x60')]){var _0x291c34=_0x3d01db['get']({'plain':!![]});fs[_0x6e22('0x64')](_0xcb5de6);return BPromise[_0x6e22('0x65')](_0x291c34['Messages'],function(_0x46eeb3,_0x210c48){var _0xe57a5c={'from':_0x46eeb3[_0x6e22('0x66')],'to':_0x46eeb3['to']||_0x6e22('0x67'),'subject':_0x46eeb3[_0x6e22('0x62')],'html':htmlEntities[_0x6e22('0x68')](_0x46eeb3[_0x6e22('0x36')]),'headers':{'Date':moment(_0x46eeb3[_0x6e22('0x63')])[_0x6e22('0x47')](_0x6e22('0x69'))},'attachments':[]};if(_0x46eeb3['cc']){_0xe57a5c['headers']['Cc']=_0x46eeb3['cc'];}if(_0x46eeb3[_0x6e22('0x61')]){_0xe57a5c[_0x6e22('0x6a')][_0x6e22('0x6b')]=_0x46eeb3[_0x6e22('0x61')];}return new BPromise(function(_0x4ab423,_0xd22fb5){if(_0x46eeb3[_0x6e22('0x5f')]){for(var _0x277e53=0x0;_0x277e53<_0x46eeb3[_0x6e22('0x5f')][_0x6e22('0x30')];_0x277e53++){var _0x311b34=_0x46eeb3['Attachments'][_0x277e53];var _0x17a18a=path['join'](_0x52c3f1,_0x311b34[_0x6e22('0x6c')]);if(fs[_0x6e22('0x6d')](_0x17a18a)){_0xe57a5c[_0x6e22('0x5c')][_0x6e22('0x5d')]({'name':_0x311b34['name'],'contentType':_0x311b34[_0x6e22('0x22')],'data':fs[_0x6e22('0x6e')](_0x17a18a)});}}}emlformat[_0x6e22('0x6f')](_0xe57a5c,function(_0x3e191c,_0x337025){if(_0x3e191c)return _0xd22fb5(_0x3e191c);fs[_0x6e22('0x70')](path[_0x6e22('0x5a')](_0xcb5de6,util['format'](_0x6e22('0x71'),_0x210c48)),_0x337025);return _0x4ab423(_0x337025);});});})[_0x6e22('0x1a')](function(){return new BPromise(function(_0x1e548d,_0x57e8b5){zipdir(_0xcb5de6,{'saveTo':_0x4ead15},function(_0x160a3f,_0x35f99e){if(_0x160a3f)return _0x57e8b5(_0x160a3f);return _0x1e548d(_0x35f99e);});})['then'](function(){return new BPromise(function(_0x4310da,_0x56ab8a){rimraf(_0xcb5de6,function(_0x5224a4){if(_0x5224a4)_0x56ab8a(_0x5224a4);return _0x4310da();});});})['then'](function(){return _0x23c59c['download'](_0x4ead15,_0x5e4905,function(_0x12f264){if(!_0x12f264)fs[_0x6e22('0x72')](_0x4ead15);});});});}else{return _0x23c59c[_0x6e22('0xf')](0xc8);}})[_0x6e22('0x26')](handleError(_0x23c59c,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c04ef25..17d0666 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 _0x9843=['events','../../mysqldb','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x31facf,_0xc01f9a){var _0xa8c81c=function(_0x46614e){while(--_0x46614e){_0x31facf['push'](_0x31facf['shift']());}};_0xa8c81c(++_0xc01f9a);}(_0x9843,0xaa));var _0x3984=function(_0x1657a0,_0x39129c){_0x1657a0=_0x1657a0-0x0;var _0x5246bb=_0x9843[_0x1657a0];return _0x5246bb;};'use strict';var EventEmitter=require(_0x3984('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x3984('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3984('0x2'),'afterUpdate':_0x3984('0x3'),'afterDestroy':_0x3984('0x4')};function emitEvent(_0x311523){return function(_0x595c6a,_0x8c3451,_0x3ed505){_0x595c6a[_0x3984('0x5')]({'attributes':['id'],'raw':!![]})[_0x3984('0x6')](function(_0x281187){_0x595c6a[_0x3984('0x7')](_0x3984('0x8'),_0x281187[_0x3984('0x9')](function(_0x5f0707){return{'id':_0x5f0707['id']};}));return MailMessage[_0x3984('0xa')]({'where':{'MailInteractionId':_0x595c6a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3984('0x6')](function(_0x40ea47){_0x595c6a[_0x3984('0x7')](_0x3984('0xb'),_0x40ea47['length']);MailInteractionEvents[_0x3984('0xc')](_0x311523+':'+_0x595c6a['id'],_0x595c6a);MailInteractionEvents[_0x3984('0xc')](_0x311523,_0x595c6a);_0x3ed505(null);})[_0x3984('0xd')](_0x3ed505(null));};}for(var e in events){if(events[_0x3984('0xe')](e)){var event=events[e];MailInteraction[_0x3984('0xf')](e,emitEvent(event));}}module[_0x3984('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x61e2=['exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook'];(function(_0x54f192,_0x2b713b){var _0x3c7d1d=function(_0x396290){while(--_0x396290){_0x54f192['push'](_0x54f192['shift']());}};_0x3c7d1d(++_0x2b713b);}(_0x61e2,0xc7));var _0x261e=function(_0x21293b,_0x180235){_0x21293b=_0x21293b-0x0;var _0x1df041=_0x61e2[_0x21293b];return _0x1df041;};'use strict';var EventEmitter=require(_0x261e('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x261e('0x1')];var MailMessage=require(_0x261e('0x2'))['db'][_0x261e('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x261e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x261e('0x5'),'afterDestroy':_0x261e('0x6')};function emitEvent(_0xf90f12){return function(_0x2dda42,_0x2b55ae,_0x373800){_0x2dda42[_0x261e('0x7')]({'attributes':['id'],'raw':!![]})[_0x261e('0x8')](function(_0x16d754){_0x2dda42[_0x261e('0x9')](_0x261e('0xa'),_0x16d754[_0x261e('0xb')](function(_0x1314ac){return{'id':_0x1314ac['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2dda42['id'],'direction':'in','read':![]},'raw':!![]});})[_0x261e('0x8')](function(_0x4826fb){_0x2dda42[_0x261e('0x9')]('unreadMessages',_0x4826fb[_0x261e('0xc')]);MailInteractionEvents[_0x261e('0xd')](_0xf90f12+':'+_0x2dda42['id'],_0x2dda42);MailInteractionEvents['emit'](_0xf90f12,_0x2dda42);_0x373800(null);})[_0x261e('0xe')](_0x373800(null));};}for(var e in events){if(events[_0x261e('0xf')](e)){var event=events[e];MailInteraction[_0x261e('0x10')](e,emitEvent(event));}}module[_0x261e('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 2093c74..cee0bf5 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 _0x3323=['closed','closedAt','changed','substatus','substatusAt','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c1013,_0x141999){var _0x51b180=function(_0x27e4a2){while(--_0x27e4a2){_0x1c1013['push'](_0x1c1013['shift']());}};_0x51b180(++_0x141999);}(_0x3323,0xfc));var _0x3332=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3323[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x3332('0x0'));var logger=require(_0x3332('0x1'))('api');var moment=require(_0x3332('0x2'));var BPromise=require(_0x3332('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3332('0x4'));var rimraf=require(_0x3332('0x5'));var config=require(_0x3332('0x6'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x17c500,_0x3a9756){return _0x17c500[_0x3332('0x7')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x3332('0x8'),'to'],'type':_0x3332('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x44c07a,_0x575ee0,_0x1b341c){if(_0x44c07a['substatus']){_0x44c07a['substatusAt']=moment()[_0x3332('0xa')](_0x3332('0xb'));}if(_0x44c07a[_0x3332('0xc')]){_0x44c07a[_0x3332('0xd')]=moment()[_0x3332('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1b341c(null,_0x575ee0);},'beforeUpdate':function(_0x29942f,_0x478cdd,_0x35850e){if(_0x29942f[_0x3332('0xe')](_0x3332('0xf'))){_0x29942f[_0x3332('0x10')]=_0x29942f['substatus']?moment()[_0x3332('0xa')](_0x3332('0xb')):null;}if(_0x29942f[_0x3332('0xe')](_0x3332('0xc'))){_0x29942f[_0x3332('0xd')]=moment()['format'](_0x3332('0xb'));_0x29942f['substatus']=null;_0x29942f[_0x3332('0x10')]=null;}_0x35850e(null,_0x29942f);},'afterUpdate':function(_0x271d80,_0x161a9e,_0x3b1be6){var _0x33760a=_0x17c500[_0x3332('0x11')];var _0xa7c02=_0x271d80[_0x3332('0x12')]({'plain':!![]});if(_0xa7c02[_0x3332('0xc')]){return _0x33760a[_0x3332('0x13')][_0x3332('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0xa7c02['id']}})['then'](function(){_0x3b1be6();})[_0x3332('0x15')](function(_0x2279bf){_0x3b1be6(_0x2279bf);});}else{_0x3b1be6();}}},'charset':_0x3332('0x16'),'collate':_0x3332('0x17')});}; \ No newline at end of file +var _0xd737=['substatus','format','models','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','fti_mail_interactions','subject','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed'];(function(_0x4a7a17,_0x3948c0){var _0x28509e=function(_0x288617){while(--_0x288617){_0x4a7a17['push'](_0x4a7a17['shift']());}};_0x28509e(++_0x3948c0);}(_0xd737,0xbe));var _0x7d73=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0xd737[_0x130719];return _0x159865;};'use strict';var _=require(_0x7d73('0x0'));var util=require(_0x7d73('0x1'));var logger=require(_0x7d73('0x2'))(_0x7d73('0x3'));var moment=require(_0x7d73('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d73('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d73('0x6'));var config=require(_0x7d73('0x7'));var attributes=require(_0x7d73('0x8'));module[_0x7d73('0x9')]=function(_0x2bee27,_0x44d7fa){return _0x2bee27[_0x7d73('0xa')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x7d73('0xb'),'fields':[_0x7d73('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x429400,_0x46c6fc,_0x534498){if(_0x429400['substatus']){_0x429400[_0x7d73('0xd')]=moment()['format'](_0x7d73('0xe'));}if(_0x429400[_0x7d73('0xf')]){_0x429400[_0x7d73('0x10')]=moment()['format'](_0x7d73('0xe'));}_0x534498(null,_0x46c6fc);},'beforeUpdate':function(_0x2412a9,_0x5e778e,_0x8c9775){if(_0x2412a9[_0x7d73('0x11')](_0x7d73('0x12'))){_0x2412a9[_0x7d73('0xd')]=_0x2412a9[_0x7d73('0x12')]?moment()[_0x7d73('0x13')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2412a9[_0x7d73('0x11')](_0x7d73('0xf'))){_0x2412a9['closedAt']=moment()[_0x7d73('0x13')](_0x7d73('0xe'));_0x2412a9[_0x7d73('0x12')]=null;_0x2412a9[_0x7d73('0xd')]=null;}_0x8c9775(null,_0x2412a9);},'afterUpdate':function(_0x4e2b16,_0x579fae,_0x1919a0){var _0x3cf687=_0x2bee27[_0x7d73('0x14')];var _0x18740e=_0x4e2b16['get']({'plain':!![]});if(_0x18740e[_0x7d73('0xf')]){return _0x3cf687[_0x7d73('0x15')][_0x7d73('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x18740e['id']}})[_0x7d73('0x17')](function(){_0x1919a0();})[_0x7d73('0x18')](function(_0x5a0812){_0x1919a0(_0x5a0812);});}else{_0x1919a0();}}},'charset':'utf8mb4','collate':_0x7d73('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8545e18..59d91ee 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 _0xc61d=['raw','where','then','UpdateMailInteraction','stringify','catch','AddTagsToMailInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','MailInteraction','body','options'];(function(_0x5a6f43,_0x13e5b0){var _0x213def=function(_0x3fc044){while(--_0x3fc044){_0x5a6f43['push'](_0x5a6f43['shift']());}};_0x213def(++_0x13e5b0);}(_0xc61d,0xfb));var _0xdc61=function(_0x3d7a10,_0x21bc7b){_0x3d7a10=_0x3d7a10-0x0;var _0x5b0b11=_0xc61d[_0x3d7a10];return _0x5b0b11;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var moment=require(_0xdc61('0x2'));var BPromise=require(_0xdc61('0x3'));var rs=require(_0xdc61('0x4'));var fs=require('fs');var Redis=require(_0xdc61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc61('0x6'));var logger=require(_0xdc61('0x7'))('rpc');var config=require(_0xdc61('0x8'));var jayson=require(_0xdc61('0x9'));var client=jayson[_0xdc61('0xa')][_0xdc61('0xb')]({'port':0x232a});config[_0xdc61('0xc')]=_[_0xdc61('0xd')](config[_0xdc61('0xc')],{'host':_0xdc61('0xe'),'port':0x18eb});var socket=require(_0xdc61('0xf'))(new Redis(config[_0xdc61('0xc')]));require('./mailInteraction.socket')[_0xdc61('0x10')](socket);function respondWithRpcPromise(_0x1682d1,_0x175405,_0x333f0b){return new BPromise(function(_0xf27275,_0x55fe79){return client[_0xdc61('0x11')](_0x1682d1,_0x333f0b)['then'](function(_0x403725){logger['info'](_0xdc61('0x12'),_0x175405,_0xdc61('0x13'));logger[_0xdc61('0x14')](_0xdc61('0x15'),_0x175405,_0xdc61('0x13'),JSON['stringify'](_0x403725));if(_0x403725[_0xdc61('0x16')]){if(_0x403725[_0xdc61('0x16')]['code']===0x1f4){logger[_0xdc61('0x16')](_0xdc61('0x12'),_0x175405,_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);return _0x55fe79(_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);}logger[_0xdc61('0x16')](_0xdc61('0x12'),_0x175405,_0x403725[_0xdc61('0x16')]['message']);return _0xf27275(_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);}else{logger[_0xdc61('0x18')](_0xdc61('0x12'),_0x175405,_0xdc61('0x13'));_0xf27275(_0x403725[_0xdc61('0x19')][_0xdc61('0x17')]);}})['catch'](function(_0x49354d){logger['error'](_0xdc61('0x12'),_0x175405,_0x49354d);_0x55fe79(_0x49354d);});});}exports['UpdateMailInteraction']=function(_0x319d93){var _0x387f9a=this;return new Promise(function(_0xf9aa4e,_0x117d13){return db[_0xdc61('0x1a')]['update'](_0x319d93[_0xdc61('0x1b')],{'raw':_0x319d93[_0xdc61('0x1c')]?_0x319d93[_0xdc61('0x1c')][_0xdc61('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x319d93[_0xdc61('0x1c')]?_0x319d93['options'][_0xdc61('0x1e')]||null:null,'attributes':_0x319d93['options']?_0x319d93['options']['attributes']||null:null,'limit':_0x319d93[_0xdc61('0x1c')]?_0x319d93[_0xdc61('0x1c')]['limit']||null:null})[_0xdc61('0x1f')](function(_0x2c4b9a){logger[_0xdc61('0x18')](_0xdc61('0x20'),_0x319d93);logger[_0xdc61('0x14')](_0xdc61('0x20'),_0x319d93,JSON[_0xdc61('0x21')](_0x2c4b9a));_0xf9aa4e(_0x2c4b9a);})[_0xdc61('0x22')](function(_0x5f5666){logger[_0xdc61('0x16')](_0xdc61('0x20'),_0x5f5666[_0xdc61('0x17')],_0x319d93);_0x117d13(_0x387f9a[_0xdc61('0x16')](0x1f4,_0x5f5666[_0xdc61('0x17')]));});});};exports[_0xdc61('0x23')]=function(_0x217bbd){return new Promise(function(_0x5bb7e5,_0xfc12ac){return db[_0xdc61('0x1a')][_0xdc61('0x24')]({'where':_0x217bbd[_0xdc61('0x1c')]?_0x217bbd['options'][_0xdc61('0x1e')]||null:null})[_0xdc61('0x1f')](function(_0x3a2208){if(_0x3a2208){return _0x3a2208['addTags'](_0x217bbd[_0xdc61('0x1b')][_0xdc61('0x25')],_['omit'](_0x217bbd[_0xdc61('0x1b')],[_0xdc61('0x25'),'id'])||{});}})[_0xdc61('0x26')](function(_0x232d1f){logger[_0xdc61('0x18')](_0xdc61('0x27'),_0x217bbd);logger[_0xdc61('0x14')]('AddTags',_0x217bbd,JSON[_0xdc61('0x21')](_0x232d1f));_0x5bb7e5(_0x232d1f);})['catch'](function(_0x3128b3){logger[_0xdc61('0x16')](_0xdc61('0x27'),_0x3128b3[_0xdc61('0x17')],_0x217bbd);_0xfc12ac(_this[_0xdc61('0x16')](0x1f4,_0x3128b3[_0xdc61('0x17')]));});});}; \ No newline at end of file +var _0x4c0c=['./mailInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','update','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','find','addTags','body','omit','ids','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x3a3016,_0x2af3c3){var _0x17c4af=function(_0x4b7532){while(--_0x4b7532){_0x3a3016['push'](_0x3a3016['shift']());}};_0x17c4af(++_0x2af3c3);}(_0x4c0c,0xef));var _0xc4c0=function(_0x1ddc7d,_0x10674b){_0x1ddc7d=_0x1ddc7d-0x0;var _0x593fff=_0x4c0c[_0x1ddc7d];return _0x593fff;};'use strict';var _=require(_0xc4c0('0x0'));var util=require(_0xc4c0('0x1'));var moment=require('moment');var BPromise=require(_0xc4c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4c0('0x3'));var db=require(_0xc4c0('0x4'))['db'];var utils=require(_0xc4c0('0x5'));var logger=require(_0xc4c0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc4c0('0x7'));var client=jayson[_0xc4c0('0x8')]['http']({'port':0x232a});config['redis']=_[_0xc4c0('0x9')](config[_0xc4c0('0xa')],{'host':_0xc4c0('0xb'),'port':0x18eb});var socket=require(_0xc4c0('0xc'))(new Redis(config['redis']));require(_0xc4c0('0xd'))[_0xc4c0('0xe')](socket);function respondWithRpcPromise(_0x573ad9,_0x1cff15,_0x2ed144){return new BPromise(function(_0x3368fe,_0x4fabd1){return client[_0xc4c0('0xf')](_0x573ad9,_0x2ed144)[_0xc4c0('0x10')](function(_0xa35e0e){logger[_0xc4c0('0x11')]('MailInteraction,\x20%s,\x20%s',_0x1cff15,_0xc4c0('0x12'));logger[_0xc4c0('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1cff15,_0xc4c0('0x12'),JSON[_0xc4c0('0x14')](_0xa35e0e));if(_0xa35e0e[_0xc4c0('0x15')]){if(_0xa35e0e[_0xc4c0('0x15')][_0xc4c0('0x16')]===0x1f4){logger[_0xc4c0('0x15')](_0xc4c0('0x17'),_0x1cff15,_0xa35e0e[_0xc4c0('0x15')][_0xc4c0('0x18')]);return _0x4fabd1(_0xa35e0e['error'][_0xc4c0('0x18')]);}logger[_0xc4c0('0x15')](_0xc4c0('0x17'),_0x1cff15,_0xa35e0e[_0xc4c0('0x15')]['message']);return _0x3368fe(_0xa35e0e[_0xc4c0('0x15')][_0xc4c0('0x18')]);}else{logger[_0xc4c0('0x11')]('MailInteraction,\x20%s,\x20%s',_0x1cff15,_0xc4c0('0x12'));_0x3368fe(_0xa35e0e[_0xc4c0('0x19')][_0xc4c0('0x18')]);}})[_0xc4c0('0x1a')](function(_0x968a77){logger[_0xc4c0('0x15')](_0xc4c0('0x17'),_0x1cff15,_0x968a77);_0x4fabd1(_0x968a77);});});}exports['UpdateMailInteraction']=function(_0x5a43aa){var _0x2a6e08=this;return new Promise(function(_0x11bab6,_0x311594){return db['MailInteraction'][_0xc4c0('0x1b')](_0x5a43aa['body'],{'raw':_0x5a43aa[_0xc4c0('0x1c')]?_0x5a43aa[_0xc4c0('0x1c')][_0xc4c0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a43aa[_0xc4c0('0x1c')]?_0x5a43aa['options'][_0xc4c0('0x1e')]||null:null,'attributes':_0x5a43aa['options']?_0x5a43aa['options'][_0xc4c0('0x1f')]||null:null,'limit':_0x5a43aa['options']?_0x5a43aa[_0xc4c0('0x1c')][_0xc4c0('0x20')]||null:null})[_0xc4c0('0x10')](function(_0x386dab){logger[_0xc4c0('0x11')](_0xc4c0('0x21'),_0x5a43aa);logger['debug']('UpdateMailInteraction',_0x5a43aa,JSON[_0xc4c0('0x14')](_0x386dab));_0x11bab6(_0x386dab);})[_0xc4c0('0x1a')](function(_0x4ab590){logger['error'](_0xc4c0('0x21'),_0x4ab590['message'],_0x5a43aa);_0x311594(_0x2a6e08['error'](0x1f4,_0x4ab590[_0xc4c0('0x18')]));});});};exports[_0xc4c0('0x22')]=function(_0x74b5f){return new Promise(function(_0xb42392,_0x5727a2){return db[_0xc4c0('0x23')][_0xc4c0('0x24')]({'where':_0x74b5f[_0xc4c0('0x1c')]?_0x74b5f[_0xc4c0('0x1c')][_0xc4c0('0x1e')]||null:null})['then'](function(_0x2b37d3){if(_0x2b37d3){return _0x2b37d3[_0xc4c0('0x25')](_0x74b5f[_0xc4c0('0x26')]['ids'],_[_0xc4c0('0x27')](_0x74b5f[_0xc4c0('0x26')],[_0xc4c0('0x28'),'id'])||{});}})['spread'](function(_0x58a62d){logger[_0xc4c0('0x11')](_0xc4c0('0x29'),_0x74b5f);logger['debug'](_0xc4c0('0x29'),_0x74b5f,JSON[_0xc4c0('0x14')](_0x58a62d));_0xb42392(_0x58a62d);})['catch'](function(_0x589e7f){logger['error']('AddTags',_0x589e7f[_0xc4c0('0x18')],_0x74b5f);_0x5727a2(_this[_0xc4c0('0x15')](0x1f4,_0x589e7f[_0xc4c0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 3fdbbd1..4eecb8d 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 _0x76f3=['remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x595687,_0x4f9fdb){var _0x54e645=function(_0x5cc4fe){while(--_0x5cc4fe){_0x595687['push'](_0x595687['shift']());}};_0x54e645(++_0x4f9fdb);}(_0x76f3,0xdf));var _0x376f=function(_0xd2310c,_0xbb64aa){_0xd2310c=_0xd2310c-0x0;var _0x4794d2=_0x76f3[_0xd2310c];return _0x4794d2;};'use strict';var MailInteractionEvents=require(_0x376f('0x0'));var events=[_0x376f('0x1'),_0x376f('0x2'),_0x376f('0x3')];function createListener(_0x3d5eeb,_0x2754f3){return function(_0x1a6f53){_0x2754f3[_0x376f('0x4')](_0x3d5eeb,_0x1a6f53);};}function removeListener(_0x4309ba,_0x454c56){return function(){MailInteractionEvents[_0x376f('0x5')](_0x4309ba,_0x454c56);};}exports[_0x376f('0x6')]=function(_0xe3d4a3){for(var _0x1771f5=0x0,_0x4ca496=events[_0x376f('0x7')];_0x1771f5<_0x4ca496;_0x1771f5++){var _0x4a170e=events[_0x1771f5];var _0x29458a=createListener(_0x376f('0x8')+_0x4a170e,_0xe3d4a3);MailInteractionEvents['on'](_0x4a170e,_0x29458a);}}; \ No newline at end of file +var _0xe437=['./mailInteraction.events','save','update','emit','removeListener','register','mailInteraction:'];(function(_0x38dda2,_0x22a108){var _0x3b68fc=function(_0x346829){while(--_0x346829){_0x38dda2['push'](_0x38dda2['shift']());}};_0x3b68fc(++_0x22a108);}(_0xe437,0xa1));var _0x7e43=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0xe437[_0x90a39a];return _0x2b62f7;};'use strict';var MailInteractionEvents=require(_0x7e43('0x0'));var events=[_0x7e43('0x1'),'remove',_0x7e43('0x2')];function createListener(_0x3fc770,_0x420e2f){return function(_0x30beb0){_0x420e2f[_0x7e43('0x3')](_0x3fc770,_0x30beb0);};}function removeListener(_0x1d04cd,_0x22cd80){return function(){MailInteractionEvents[_0x7e43('0x4')](_0x1d04cd,_0x22cd80);};}exports[_0x7e43('0x5')]=function(_0x473a48){for(var _0x3d1da3=0x0,_0x1f52ad=events['length'];_0x3d1da3<_0x1f52ad;_0x3d1da3++){var _0x42b9fb=events[_0x3d1da3];var _0x1f2ead=createListener(_0x7e43('0x6')+_0x42b9fb,_0x473a48);MailInteractionEvents['on'](_0x42b9fb,_0x1f2ead);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 1478032..93464c7 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 _0x24cf=['/:id','isAuthenticated','/:id/download','download','post','mail','mailmessage:create','create','/:id/accept','accept','put','reject','delete','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','describe'];(function(_0x1ca3f8,_0x2a36da){var _0x11f6c5=function(_0x3c8797){while(--_0x3c8797){_0x1ca3f8['push'](_0x1ca3f8['shift']());}};_0x11f6c5(++_0x2a36da);}(_0x24cf,0x1d5));var _0xf24c=function(_0x364e3c,_0x4783ae){_0x364e3c=_0x364e3c-0x0;var _0x4db121=_0x24cf[_0x364e3c];return _0x4db121;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf24c('0x0'));var timeout=require(_0xf24c('0x1'));var express=require(_0xf24c('0x2'));var router=express[_0xf24c('0x3')]();var fs_extra=require(_0xf24c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf24c('0x5'));var config=require(_0xf24c('0x6'));var controller=require(_0xf24c('0x7'));router[_0xf24c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf24c('0x9'),auth['isAuthenticated'](),controller[_0xf24c('0xa')]);router[_0xf24c('0x8')](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['show']);router[_0xf24c('0x8')](_0xf24c('0xd'),auth[_0xf24c('0xc')](),controller[_0xf24c('0xe')]);router[_0xf24c('0xf')]('/',auth[_0xf24c('0xc')](),interaction['tracked'](_0xf24c('0x10'),_0xf24c('0x11')),controller[_0xf24c('0x12')]);router['put'](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['update']);router['put'](_0xf24c('0x13'),auth['isAuthenticated'](),controller[_0xf24c('0x14')]);router[_0xf24c('0x15')]('/:id/reject',auth[_0xf24c('0xc')](),controller[_0xf24c('0x16')]);router[_0xf24c('0x17')](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mailmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','express','Router'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe706,0xa3));var _0x6e70=function(_0xbae21b,_0x449cfb){_0xbae21b=_0xbae21b-0x0;var _0x10f16f=_0xe706[_0xbae21b];return _0x10f16f;};'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'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')]('/',auth[_0x6e70('0xb')](),interaction['tracked']('mail',_0x6e70('0x14')),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')](_0x6e70('0x18'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x6e70('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x6e70('0x1a')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 25f3c48..dc48899 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 _0xa287=['STRING','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xa287,0x1b1));var _0x7a28=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xa287[_0x16629d];return _0x56ccee;};'use strict';var Sequelize=require(_0x7a28('0x0'));var _=require(_0x7a28('0x1'));module[_0x7a28('0x2')]={'body':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x5'))},'read':{'type':Sequelize[_0x7a28('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7a28('0x7')]('in',_0x7a28('0x8')),'defaultValue':_0x7a28('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7a28('0x9')](0x1fe)},'from':{'type':Sequelize[_0x7a28('0x9')]},'to':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'cc':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'bcc':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'subject':{'type':Sequelize[_0x7a28('0x3')]},'sentAt':{'type':Sequelize[_0x7a28('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7a28('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'originCc':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'originChannel':{'type':Sequelize[_0x7a28('0x7')](_0x7a28('0xb'),_0x7a28('0xc')),'defaultValue':_0x7a28('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x1755=['STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x42c86a,_0x16b79a){var _0x10874b=function(_0x1db90a){while(--_0x1db90a){_0x42c86a['push'](_0x42c86a['shift']());}};_0x10874b(++_0x16b79a);}(_0x1755,0x11d));var _0x5175=function(_0x3e58ea,_0x4b89b9){_0x3e58ea=_0x3e58ea-0x0;var _0x5f0739=_0x1755[_0x3e58ea];return _0x5f0739;};'use strict';var Sequelize=require(_0x5175('0x0'));var _=require(_0x5175('0x1'));module[_0x5175('0x2')]={'body':{'type':Sequelize[_0x5175('0x3')](_0x5175('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5175('0x3')](_0x5175('0x5'))},'read':{'type':Sequelize[_0x5175('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5175('0x7')]('in',_0x5175('0x8')),'defaultValue':_0x5175('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5175('0x9')](0x1fe)},'from':{'type':Sequelize[_0x5175('0x9')]},'to':{'type':Sequelize[_0x5175('0x3')]('long')},'cc':{'type':Sequelize[_0x5175('0x3')](_0x5175('0x4'))},'bcc':{'type':Sequelize[_0x5175('0x3')](_0x5175('0x4'))},'subject':{'type':Sequelize[_0x5175('0x3')]},'sentAt':{'type':Sequelize[_0x5175('0xa')]},'attach':{'type':Sequelize[_0x5175('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5175('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x5175('0x3')](_0x5175('0x4'))},'originCc':{'type':Sequelize[_0x5175('0x3')]('long')},'originChannel':{'type':Sequelize[_0x5175('0x7')](_0x5175('0xc'),_0x5175('0xd')),'defaultValue':_0x5175('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 4d1f067..89ccba6 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 _0xecd9=['jayson/promise','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','status','offset','undefined','limit','count','set','Content-Range','json','end','sendStatus','name','send','index','MailMessage','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','attachments','join','root','basename','ListId','List\x20not\x20found','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','format','UserId','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','agent','interface','channel','motionChannel','event','fromString','EventManager','reject','mail','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','download','unix','toString','files','from','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','build','writeFileSync','moment','bluebird','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register'];(function(_0x1b643c,_0x24061a){var _0x3b65bb=function(_0x4f08d8){while(--_0x4f08d8){_0x1b643c['push'](_0x1b643c['shift']());}};_0x3b65bb(++_0x24061a);}(_0xecd9,0x1b4));var _0x9ecd=function(_0x4e876f,_0x5468a1){_0x4e876f=_0x4e876f-0x0;var _0x5e4ede=_0xecd9[_0x4e876f];return _0x5e4ede;};'use strict';var emlformat=require('eml-format');var moment=require(_0x9ecd('0x0'));var BPromise=require(_0x9ecd('0x1'));var util=require('util');var path=require(_0x9ecd('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x9ecd('0x3'));var htmlToText=require(_0x9ecd('0x4'));var qs=require(_0x9ecd('0x5'));var logger=require(_0x9ecd('0x6'))('api');var interaction_log=require(_0x9ecd('0x6'))('mail-interactions');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x9ecd('0x7')]=_[_0x9ecd('0x8')](config['redis'],{'host':_0x9ecd('0x9'),'port':0x18eb});var socket=require(_0x9ecd('0xa'))(new Redis(config[_0x9ecd('0x7')]));var htmlEntities=require(_0x9ecd('0xb'));require(_0x9ecd('0xc'))[_0x9ecd('0xd')](socket);var jayson=require(_0x9ecd('0xe'));var client=jayson['client'][_0x9ecd('0xf')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x355d8b,_0x52a0a1,_0x596716,_0x18c621){return new BPromise(function(_0x227ea8,_0x1556cd){var _0xb66066=_0x18c621||client;return _0xb66066[_0x9ecd('0x10')](_0x355d8b,_0x596716)[_0x9ecd('0x11')](function(_0x427c30){logger[_0x9ecd('0x12')]('MailMessage,\x20%s,\x20%s',_0x52a0a1,_0x9ecd('0x13'));logger[_0x9ecd('0x14')](_0x9ecd('0x15'),_0x52a0a1,'request\x20sent',JSON['stringify'](_0x427c30));if(_0x427c30['error']){if(_0x427c30[_0x9ecd('0x16')]['code']===0x1f4){logger[_0x9ecd('0x16')](_0x9ecd('0x17'),_0x52a0a1,_0x427c30['error'][_0x9ecd('0x18')]);return _0x1556cd(_0x427c30['error'][_0x9ecd('0x18')]);}logger['error'](_0x9ecd('0x17'),_0x52a0a1,_0x427c30[_0x9ecd('0x16')]['message']);return _0x227ea8(_0x427c30[_0x9ecd('0x16')][_0x9ecd('0x18')]);}else{logger[_0x9ecd('0x12')]('MailMessage,\x20%s,\x20%s',_0x52a0a1,_0x9ecd('0x13'));_0x227ea8(_0x427c30[_0x9ecd('0x19')][_0x9ecd('0x18')]);}})['catch'](function(_0x4fddff){logger[_0x9ecd('0x16')]('MailMessage,\x20%s,\x20%s',_0x52a0a1,_0x4fddff);_0x1556cd(_0x4fddff);});});}function respondWithResult(_0x5cb9c2,_0x1b5903){_0x1b5903=_0x1b5903||0xc8;return function(_0xb958b7){if(_0xb958b7){return _0x5cb9c2[_0x9ecd('0x1a')](_0x1b5903)['json'](_0xb958b7);}};}function respondWithFilteredResult(_0x21a042,_0x41f65b){return function(_0x30d1b4){if(_0x30d1b4){var _0x1831e1=typeof _0x41f65b[_0x9ecd('0x1b')]===_0x9ecd('0x1c')&&typeof _0x41f65b[_0x9ecd('0x1d')]==='undefined';var _0x5934cb=_0x30d1b4[_0x9ecd('0x1e')];var _0x399ff9=_0x1831e1?0x0:_0x41f65b['offset'];var _0x3bacb1=_0x1831e1?_0x30d1b4[_0x9ecd('0x1e')]:_0x41f65b[_0x9ecd('0x1b')]+_0x41f65b[_0x9ecd('0x1d')];var _0x17efac;if(_0x3bacb1>=_0x5934cb){_0x3bacb1=_0x5934cb;_0x17efac=0xc8;}else{_0x17efac=0xce;}_0x21a042[_0x9ecd('0x1a')](_0x17efac);return _0x21a042[_0x9ecd('0x1f')](_0x9ecd('0x20'),_0x399ff9+'-'+_0x3bacb1+'/'+_0x5934cb)[_0x9ecd('0x21')](_0x30d1b4);}return null;};}function saveUpdates(_0xc8ef27){return function(_0x2c6fae){if(_0x2c6fae){return _0x2c6fae['update'](_0xc8ef27)[_0x9ecd('0x11')](function(_0x55cd27){return _0x55cd27;});}return null;};}function removeEntity(_0x232838){return function(_0x4c7d88){if(_0x4c7d88){return _0x4c7d88['destroy']()['then'](function(){_0x232838['status'](0xcc)[_0x9ecd('0x22')]();});}};}function handleEntityNotFound(_0x66467){return function(_0x555931){if(!_0x555931){_0x66467[_0x9ecd('0x23')](0x194);}return _0x555931;};}function handleError(_0xee42f4,_0x45d40e){_0x45d40e=_0x45d40e||0x1f4;return function(_0x103d0f){logger[_0x9ecd('0x16')](_0x103d0f['stack']);if(_0x103d0f[_0x9ecd('0x24')]){delete _0x103d0f[_0x9ecd('0x24')];}_0xee42f4[_0x9ecd('0x1a')](_0x45d40e)[_0x9ecd('0x25')](_0x103d0f);};}exports[_0x9ecd('0x26')]=function(_0x3e05e1,_0x2ca226){var _0x503bd0={},_0x3ef804={},_0x3772a1={'count':0x0,'rows':[]};var _0x44b3b8=_['map'](db[_0x9ecd('0x27')][_0x9ecd('0x28')],function(_0x589b5d){return{'name':_0x589b5d['fieldName'],'type':_0x589b5d[_0x9ecd('0x29')][_0x9ecd('0x2a')]};});_0x3ef804[_0x9ecd('0x2b')]=_[_0x9ecd('0x2c')](_0x44b3b8,_0x9ecd('0x24'));_0x3ef804[_0x9ecd('0x2d')]=_[_0x9ecd('0x2e')](_0x3e05e1[_0x9ecd('0x2d')]);_0x3ef804[_0x9ecd('0x2f')]=_['intersection'](_0x3ef804['model'],_0x3ef804[_0x9ecd('0x2d')]);_0x503bd0[_0x9ecd('0x30')]=_['intersection'](_0x3ef804[_0x9ecd('0x2b')],qs['fields'](_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x31')]));_0x503bd0[_0x9ecd('0x30')]=_0x503bd0['attributes'][_0x9ecd('0x32')]?_0x503bd0['attributes']:_0x3ef804[_0x9ecd('0x2b')];if(!_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x33')](_0x9ecd('0x34'))){_0x503bd0['limit']=qs['limit'](_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x1d')]);_0x503bd0[_0x9ecd('0x1b')]=qs[_0x9ecd('0x1b')](_0x3e05e1['query'][_0x9ecd('0x1b')]);}_0x503bd0[_0x9ecd('0x35')]=qs[_0x9ecd('0x36')](_0x3e05e1['query']['sort']);_0x503bd0[_0x9ecd('0x37')]=qs[_0x9ecd('0x2f')](_['pick'](_0x3e05e1[_0x9ecd('0x2d')],_0x3ef804[_0x9ecd('0x2f')]),_0x44b3b8);if(_0x3e05e1['query'][_0x9ecd('0x38')]){_0x503bd0[_0x9ecd('0x37')]=_[_0x9ecd('0x39')](_0x503bd0[_0x9ecd('0x37')],{'$or':_['map'](_0x44b3b8,function(_0x3ce834){if(_0x3ce834[_0x9ecd('0x29')]!==_0x9ecd('0x3a')){var _0x58778d={};_0x58778d[_0x3ce834[_0x9ecd('0x24')]]={'$like':'%'+_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x38')]+'%'};return _0x58778d;}})});}_0x503bd0=_[_0x9ecd('0x39')]({},_0x503bd0,_0x3e05e1[_0x9ecd('0x3b')]);var _0x15fa01={'where':_0x503bd0[_0x9ecd('0x37')]};return db[_0x9ecd('0x27')][_0x9ecd('0x1e')](_0x15fa01)[_0x9ecd('0x11')](function(_0xee6cfe){_0x3772a1['count']=_0xee6cfe;if(_0x3e05e1[_0x9ecd('0x2d')]['includeAll']){_0x503bd0[_0x9ecd('0x3c')]=[{'all':!![]}];}return db[_0x9ecd('0x27')][_0x9ecd('0x3d')](_0x503bd0);})[_0x9ecd('0x11')](function(_0xb06135){_0x3772a1[_0x9ecd('0x3e')]=_0xb06135;return _0x3772a1;})[_0x9ecd('0x11')](respondWithFilteredResult(_0x2ca226,_0x503bd0))[_0x9ecd('0x3f')](handleError(_0x2ca226,null));};exports[_0x9ecd('0x40')]=function(_0x2f38d8,_0x3e67e8){var _0x192f9b={'raw':!![],'where':{'id':_0x2f38d8[_0x9ecd('0x41')]['id']}},_0x235ea4={};_0x235ea4['model']=_[_0x9ecd('0x2e')](db[_0x9ecd('0x27')]['rawAttributes']);_0x235ea4['query']=_['keys'](_0x2f38d8[_0x9ecd('0x2d')]);_0x235ea4['filters']=_[_0x9ecd('0x42')](_0x235ea4[_0x9ecd('0x2b')],_0x235ea4['query']);_0x192f9b[_0x9ecd('0x30')]=_[_0x9ecd('0x42')](_0x235ea4[_0x9ecd('0x2b')],qs[_0x9ecd('0x31')](_0x2f38d8['query'][_0x9ecd('0x31')]));_0x192f9b['attributes']=_0x192f9b['attributes'][_0x9ecd('0x32')]?_0x192f9b[_0x9ecd('0x30')]:_0x235ea4[_0x9ecd('0x2b')];if(_0x2f38d8[_0x9ecd('0x2d')]['includeAll']){_0x192f9b[_0x9ecd('0x3c')]=[{'all':!![]}];}_0x192f9b=_[_0x9ecd('0x39')]({},_0x192f9b,_0x2f38d8[_0x9ecd('0x3b')]);return db[_0x9ecd('0x27')][_0x9ecd('0x43')](_0x192f9b)['then'](handleEntityNotFound(_0x3e67e8,null))[_0x9ecd('0x11')](respondWithResult(_0x3e67e8,null))['catch'](handleError(_0x3e67e8,null));};exports[_0x9ecd('0x44')]=function(_0x16d7b3,_0x22681e){if(_0x16d7b3[_0x9ecd('0x45')]['id']){delete _0x16d7b3['body']['id'];}return db['MailMessage'][_0x9ecd('0x43')]({'where':{'id':_0x16d7b3['params']['id']}})['then'](handleEntityNotFound(_0x22681e,null))['then'](saveUpdates(_0x16d7b3['body'],null))[_0x9ecd('0x11')](respondWithResult(_0x22681e,null))[_0x9ecd('0x3f')](handleError(_0x22681e,null));};exports['destroy']=function(_0x263a3d,_0x43caf7){return db[_0x9ecd('0x27')]['find']({'where':{'id':_0x263a3d[_0x9ecd('0x41')]['id']}})[_0x9ecd('0x11')](handleEntityNotFound(_0x43caf7,null))[_0x9ecd('0x11')](removeEntity(_0x43caf7,null))[_0x9ecd('0x3f')](handleError(_0x43caf7,null));};exports[_0x9ecd('0x46')]=function(_0x56a05b,_0x1f04eb){return db[_0x9ecd('0x27')][_0x9ecd('0x46')]()[_0x9ecd('0x11')](respondWithResult(_0x1f04eb,null))[_0x9ecd('0x3f')](handleError(_0x1f04eb,null));};exports[_0x9ecd('0x47')]=function(_0x171d13,_0x7f35dc){return db[_0x9ecd('0x27')][_0x9ecd('0x47')](_0x171d13[_0x9ecd('0x45')])['then'](function(_0x8f42fd){if(_0x8f42fd){if(_0x8f42fd[_0x9ecd('0x48')]===_0x9ecd('0x49')&&!_0x8f42fd[_0x9ecd('0x4a')]){var _0xb4705e,_0x355f54,_0x19753c;if(_0x171d13[_0x9ecd('0x45')]['to']){_0x355f54=_0x171d13[_0x9ecd('0x45')]['to'][_0x9ecd('0x4b')](',')[0x0];}return db[_0x9ecd('0x4c')][_0x9ecd('0x4d')]({'where':{'id':_0x8f42fd[_0x9ecd('0x4e')]},'include':[{'model':db['CmList'],'as':_0x9ecd('0x4f'),'include':[{'model':db[_0x9ecd('0x50')],'as':_0x9ecd('0x51'),'where':{'email':_0x355f54},'limit':0x1,'order':[[_0x9ecd('0x52'),_0x9ecd('0x53')]]}]},{'model':db['MailServerOut'],'as':_0x9ecd('0x54'),'raw':!![],'include':[{'model':db[_0x9ecd('0x55')],'as':_0x9ecd('0x55'),'raw':!![]}]}]})[_0x9ecd('0x11')](function(_0x4ee6d6){_0xb4705e=_0x4ee6d6;if(!_0xb4705e||!_0xb4705e[_0x9ecd('0x54')])return;var _0x41b2c7=_0xb4705e['getSmtpOptions']();if(_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')]&&_0x171d13[_0x9ecd('0x45')]['attachments'][_0x9ecd('0x32')]){for(var _0x123652=0x0;_0x123652<_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')]['length'];_0x123652+=0x1){_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')][_0x123652]={'filename':_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')][_0x123652]['name'],'path':path[_0x9ecd('0x57')](config[_0x9ecd('0x58')],'server/files/attachments',_0x171d13['body'][_0x9ecd('0x56')][_0x123652][_0x9ecd('0x59')])};}}_0x19753c={'account':_0x41b2c7,'message':_0x171d13[_0x9ecd('0x45')]};return;})['then'](function(){if(_0xb4705e[_0x9ecd('0x4f')]){if(_0xb4705e['List']['Contacts']['length']){return _0xb4705e['List']['Contacts'][0x0];}else{return db[_0x9ecd('0x50')][_0x9ecd('0x47')](_['defaults'](_0x171d13[_0x9ecd('0x45')],{'firstName':_0x171d13[_0x9ecd('0x45')]['to'],'email':_0x171d13[_0x9ecd('0x45')]['to'],'phone':_0x171d13['body']['to'],'ListId':_0xb4705e[_0x9ecd('0x5a')]}));}}else{throw new Error(_0x9ecd('0x5b'));}})[_0x9ecd('0x11')](function(){if(_0x19753c){return respondWithRpcPromise('SendMail',_0x9ecd('0x5c'),_0x19753c,client9003)[_0x9ecd('0x11')](function(_0xcaca39){return _0x8f42fd[_0x9ecd('0x44')]({'read':!![],'messageId':_0xcaca39[_0x9ecd('0x5d')],'sentAt':moment()['format'](_0x9ecd('0x5e'))});})['catch'](function(_0x4c8025){logger[_0x9ecd('0x16')]('%s',JSON[_0x9ecd('0x5f')](_0x4c8025));return _0x8f42fd;});}return _0x8f42fd;});}return _0x8f42fd;}})[_0x9ecd('0x11')](respondWithResult(_0x7f35dc,0xc9))[_0x9ecd('0x3f')](handleError(_0x7f35dc,null));};exports[_0x9ecd('0x60')]=function(_0xe71639,_0x48b11d){var _0x63baab={'agent':{},'channel':'mail'};if(_0xe71639['body']['id']){delete _0xe71639['body']['id'];}_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x61')]=!![];_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x62')]=moment()[_0x9ecd('0x63')](_0x9ecd('0x5e'));_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x64')]=_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x64')]||_0xe71639['user']['id'];_0x63baab['agent']['id']=_0xe71639['body']['UserId'];return db[_0x9ecd('0x27')]['find']({'where':{'id':_0xe71639[_0x9ecd('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48b11d,null))[_0x9ecd('0x11')](saveUpdates(_0xe71639[_0x9ecd('0x45')],null))[_0x9ecd('0x11')](function(_0x1dabba){if(_0x1dabba){_0x63baab['message']=_0x1dabba[_0x9ecd('0x65')]({'plain':!![]});return db[_0x9ecd('0x66')][_0x9ecd('0x43')]({'where':{'id':_0x1dabba[_0x9ecd('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x48b11d,null))[_0x9ecd('0x11')](function(_0x2f126e){if(_0x2f126e){return _0x2f126e[_0x9ecd('0x44')]({'UserId':_0xe71639['body'][_0x9ecd('0x64')],'read1stAt':_[_0x9ecd('0x68')](_0x2f126e[_0x9ecd('0x69')])?moment()[_0x9ecd('0x63')](_0x9ecd('0x5e')):undefined});}return null;})[_0x9ecd('0x11')](function(_0x1ed7a4){if(_0x1ed7a4){_0x63baab['interaction']=_0x1ed7a4[_0x9ecd('0x65')]({'plain':!![]});interaction_log['info'](_0x9ecd('0x6a'),_0xe71639[_0x9ecd('0x6b')]['id'],_0xe71639[_0x9ecd('0x6b')]['name'],_0xe71639[_0x9ecd('0x6b')][_0x9ecd('0x6c')],_0x63baab['interaction']['id'],_0xe71639[_0x9ecd('0x45')]?JSON[_0x9ecd('0x5f')](_0xe71639[_0x9ecd('0x45')]):'null');return respondWithRpcPromise(_0x9ecd('0x6d'),'acceptMessage',_0x63baab);}return null;})[_0x9ecd('0x11')](function(_0xd664b5){var _0x23e34d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd664b5['message'][_0x9ecd('0x6e')];return db[_0x9ecd('0x6f')][_0x9ecd('0x2d')](_0x23e34d,{'type':db[_0x9ecd('0x70')]['QueryTypes'][_0x9ecd('0x71')],'raw':!![]})[_0x9ecd('0x11')](function(_0x23a536){return _0x23a536;});})[_0x9ecd('0x11')](function(_0x425ae4){if(_0x425ae4){_0x63baab[_0x9ecd('0x18')][_0x9ecd('0x72')]=_0x425ae4[0x0];if(!_0xe71639['body'][_0x9ecd('0x64')])return;return db['User'][_0x9ecd('0x43')]({'where':{'id':_0xe71639[_0x9ecd('0x45')]['UserId'],'role':'agent'},'attributes':['id',_0x9ecd('0x24'),_0x9ecd('0x73'),_0x9ecd('0x74'),_0x9ecd('0x75')],'raw':!![]});}return null;})[_0x9ecd('0x11')](function(_0xbf032){if(!_0xbf032)return null;_0x63baab['message'][_0x9ecd('0x76')]=_0xbf032;return _0x63baab;})[_0x9ecd('0x11')](function(_0x415016){if(_0x415016){if(_0xe71639[_0x9ecd('0x45')]['manual']){_0x63baab[_0x9ecd('0x18')][_0x9ecd('0x77')]=util[_0x9ecd('0x63')]('SIP/%s',_0xe71639['user'][_0x9ecd('0x24')]);_0x63baab[_0x9ecd('0x18')]['channel']=_0x63baab[_0x9ecd('0x78')];_0x63baab[_0x9ecd('0x18')][_0x9ecd('0x79')]=_0x63baab[_0x9ecd('0x78')];_0x63baab['message'][_0x9ecd('0x7a')]='accept';_0x63baab['message']['body']=htmlToText[_0x9ecd('0x7b')](_0x63baab[_0x9ecd('0x18')]['body']);return respondWithRpcPromise('EventManager',_0x9ecd('0x7c'),{'event':'acceptmessage','message':_0x63baab[_0x9ecd('0x18')]},client9002)[_0x9ecd('0x11')](function(){return _0x63baab;});}return _0x63baab;}return null;})[_0x9ecd('0x11')](respondWithResult(_0x48b11d,null))['catch'](handleError(_0x48b11d,null));};exports[_0x9ecd('0x7d')]=function(_0xf4fa1a,_0x3796fd){var _0x54656b={'agent':{},'channel':_0x9ecd('0x7e')};if(_0xf4fa1a[_0x9ecd('0x45')]['id']){delete _0xf4fa1a[_0x9ecd('0x45')]['id'];}_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')]=_0xf4fa1a[_0x9ecd('0x45')]['UserId']||_0xf4fa1a[_0x9ecd('0x6b')]['id'];_0x54656b[_0x9ecd('0x76')]['id']=_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')];return db[_0x9ecd('0x27')][_0x9ecd('0x43')]({'where':{'id':_0xf4fa1a['params']['id'],'UserId':null}})[_0x9ecd('0x11')](handleEntityNotFound(_0x3796fd,null))[_0x9ecd('0x11')](function(_0x13238d){if(_0x13238d){_0x54656b['message']=_0x13238d[_0x9ecd('0x65')]({'plain':!![]});return db[_0x9ecd('0x66')][_0x9ecd('0x43')]({'where':{'id':_0x13238d[_0x9ecd('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x3796fd,null))['then'](function(_0x1842ef){if(_0x1842ef){_0x54656b[_0x9ecd('0x7f')]=_0x1842ef['get']({'plain':!![]});interaction_log['info'](_0x9ecd('0x80'),_0xf4fa1a[_0x9ecd('0x6b')]['id'],_0xf4fa1a[_0x9ecd('0x6b')][_0x9ecd('0x24')],_0xf4fa1a['user']['role'],_0x54656b['interaction']['id'],_0xf4fa1a[_0x9ecd('0x45')]?JSON[_0x9ecd('0x5f')](_0xf4fa1a[_0x9ecd('0x45')]):_0x9ecd('0x81'));return respondWithRpcPromise(_0x9ecd('0x82'),'rejectMessage',_0x54656b);}return null;})['then'](function(_0x1d4070){var _0x54c7ee=_0x9ecd('0x83')+_0x1d4070[_0x9ecd('0x18')]['ContactId'];return db[_0x9ecd('0x6f')][_0x9ecd('0x2d')](_0x54c7ee,{'type':db[_0x9ecd('0x70')][_0x9ecd('0x84')][_0x9ecd('0x71')],'raw':!![]})['then'](function(_0x453b6d){return _0x453b6d;});})['then'](function(_0x2865aa){if(_0x2865aa){_0x54656b[_0x9ecd('0x18')]['contact']=_0x2865aa[0x0];if(!_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')])return;return db['User'][_0x9ecd('0x43')]({'where':{'id':_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')],'role':_0x9ecd('0x76')},'attributes':['id',_0x9ecd('0x24'),_0x9ecd('0x73'),'email',_0x9ecd('0x75')],'raw':!![]});}return null;})[_0x9ecd('0x11')](function(_0x245976){if(!_0x245976)return null;_0x54656b[_0x9ecd('0x18')][_0x9ecd('0x76')]=_0x245976;return _0x54656b;})[_0x9ecd('0x11')](function(_0x498bbb){if(_0x498bbb){_0x498bbb[_0x9ecd('0x18')]['interface']=util['format'](_0x9ecd('0x85'),_0xf4fa1a[_0x9ecd('0x6b')][_0x9ecd('0x24')]);_0x498bbb[_0x9ecd('0x18')][_0x9ecd('0x78')]=_0x54656b[_0x9ecd('0x78')];_0x498bbb['message'][_0x9ecd('0x79')]=_0x54656b['channel'];_0x498bbb['message'][_0x9ecd('0x7a')]=_0x9ecd('0x7d');_0x498bbb['message'][_0x9ecd('0x45')]=htmlToText[_0x9ecd('0x7b')](_0x54656b['message'][_0x9ecd('0x45')]);respondWithRpcPromise('EventManager',_0x9ecd('0x7c'),{'event':'rejectmessage','message':_0x498bbb[_0x9ecd('0x18')]},client9002);return _0x54656b;}return null;})['then'](respondWithResult(_0x3796fd,null))['catch'](handleError(_0x3796fd,null));};exports[_0x9ecd('0x86')]=function(_0xaf975f,_0x98b000){var _0x476f36=moment()[_0x9ecd('0x87')]()[_0x9ecd('0x88')]();var _0x530413=path['join'](config[_0x9ecd('0x58')],'server',_0x9ecd('0x89'),'tmp');var _0x137ebe=path[_0x9ecd('0x57')](config[_0x9ecd('0x58')],'server',_0x9ecd('0x89'),_0x9ecd('0x56'));var _0x4f79b1=util[_0x9ecd('0x63')]('message-%s.eml',_0x476f36);return db[_0x9ecd('0x27')][_0x9ecd('0x43')]({'where':{'id':_0xaf975f['params']['id']},'attributes':['id',_0x9ecd('0x45'),_0x9ecd('0x8a'),'to','cc','bcc',_0x9ecd('0x8b'),_0x9ecd('0x8c')],'include':_0xaf975f[_0x9ecd('0x2d')][_0x9ecd('0x56')]?[{'model':db['Attachment'],'as':_0x9ecd('0x8d')}]:undefined})[_0x9ecd('0x11')](handleEntityNotFound(_0x98b000,null))[_0x9ecd('0x11')](function(_0x26e119){if(_0x26e119){var _0x5e88e2=_0x26e119;var _0x5902c9={'from':_0x5e88e2['from'],'to':_0x5e88e2['to'],'subject':_0x5e88e2[_0x9ecd('0x8b')],'html':htmlEntities['decode'](_0x5e88e2[_0x9ecd('0x45')]),'headers':{'Date':moment(_0x5e88e2[_0x9ecd('0x8c')])['format'](_0x9ecd('0x8e'))},'attachments':[]};if(_0x26e119['cc']){_0x5902c9[_0x9ecd('0x8f')]['Cc']=_0x26e119['cc'];}if(_0x26e119[_0x9ecd('0x90')]){_0x5902c9[_0x9ecd('0x8f')][_0x9ecd('0x91')]=_0x26e119[_0x9ecd('0x90')];}return new BPromise(function(_0x5bd156,_0xa91c00){if(_0x26e119[_0x9ecd('0x8d')]){for(var _0x3eea2a=0x0;_0x3eea2a<_0x26e119[_0x9ecd('0x8d')][_0x9ecd('0x32')];_0x3eea2a++){var _0x55d93f=_0x26e119[_0x9ecd('0x8d')][_0x3eea2a];var _0x266a55=path[_0x9ecd('0x57')](_0x137ebe,_0x55d93f['basename']);if(fs[_0x9ecd('0x92')](_0x266a55)){_0x5902c9['attachments'][_0x9ecd('0x93')]({'name':_0x55d93f[_0x9ecd('0x24')],'contentType':_0x55d93f['type'],'data':fs['readFileSync'](_0x266a55)});}}}emlformat[_0x9ecd('0x94')](_0x5902c9,function(_0x1ba820,_0x1a03de){if(_0x1ba820)return _0xa91c00(_0x1ba820);fs[_0x9ecd('0x95')](path[_0x9ecd('0x57')](_0x530413,_0x4f79b1),_0x1a03de);return _0x5bd156(_0x1a03de);});});}})[_0x9ecd('0x11')](function(_0x1e9bda){if(_0x1e9bda){return _0x98b000[_0x9ecd('0x86')](path[_0x9ecd('0x57')](_0x530413,_0x4f79b1),_0x4f79b1,function(_0x22393a){if(!_0x22393a)fs['unlinkSync'](path['join'](_0x530413,_0x4f79b1));});}})[_0x9ecd('0x3f')](handleError(_0x98b000,null));}; \ No newline at end of file +var _0xed9e=['push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../config/logger','api','mail-interactions','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','rawAttributes','includeAll','find','update','body','params','describe','direction','secret','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','MailServerOut','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','create','ListId','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','UserId','agent','MailInteraction','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','User','event','download','unix','toString','files','server','message-%s.eml','bcc','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','existsSync'];(function(_0x1c57a5,_0x433064){var _0x3dadb9=function(_0x5cf957){while(--_0x5cf957){_0x1c57a5['push'](_0x1c57a5['shift']());}};_0x3dadb9(++_0x433064);}(_0xed9e,0x138));var _0xeed9=function(_0x49d0e3,_0x359aed){_0x49d0e3=_0x49d0e3-0x0;var _0x26d388=_0xed9e[_0x49d0e3];return _0x26d388;};'use strict';var emlformat=require(_0xeed9('0x0'));var moment=require(_0xeed9('0x1'));var BPromise=require(_0xeed9('0x2'));var util=require('util');var path=require(_0xeed9('0x3'));var fs=require('fs');var _=require(_0xeed9('0x4'));var Redis=require(_0xeed9('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0xeed9('0x6'))(_0xeed9('0x7'));var interaction_log=require(_0xeed9('0x6'))(_0xeed9('0x8'));var config=require('../../config/environment');var db=require(_0xeed9('0x9'))['db'];config[_0xeed9('0xa')]=_[_0xeed9('0xb')](config[_0xeed9('0xa')],{'host':_0xeed9('0xc'),'port':0x18eb});var socket=require(_0xeed9('0xd'))(new Redis(config[_0xeed9('0xa')]));var htmlEntities=require(_0xeed9('0xe'));require(_0xeed9('0xf'))[_0xeed9('0x10')](socket);var jayson=require(_0xeed9('0x11'));var client=jayson[_0xeed9('0x12')]['http']({'port':0x232c});var client9003=jayson[_0xeed9('0x12')][_0xeed9('0x13')]({'port':0x232b});var client9002=jayson[_0xeed9('0x12')][_0xeed9('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x3d0883,_0x215b37,_0x1fd3c6,_0x1182d9){return new BPromise(function(_0x2aad6c,_0x3512ef){var _0x535f94=_0x1182d9||client;return _0x535f94[_0xeed9('0x14')](_0x3d0883,_0x1fd3c6)[_0xeed9('0x15')](function(_0x5e01fe){logger['info'](_0xeed9('0x16'),_0x215b37,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x215b37,_0xeed9('0x17'),JSON[_0xeed9('0x18')](_0x5e01fe));if(_0x5e01fe['error']){if(_0x5e01fe['error'][_0xeed9('0x19')]===0x1f4){logger[_0xeed9('0x1a')]('MailMessage,\x20%s,\x20%s',_0x215b37,_0x5e01fe[_0xeed9('0x1a')][_0xeed9('0x1b')]);return _0x3512ef(_0x5e01fe['error'][_0xeed9('0x1b')]);}logger[_0xeed9('0x1a')](_0xeed9('0x16'),_0x215b37,_0x5e01fe['error'][_0xeed9('0x1b')]);return _0x2aad6c(_0x5e01fe[_0xeed9('0x1a')][_0xeed9('0x1b')]);}else{logger[_0xeed9('0x1c')](_0xeed9('0x16'),_0x215b37,_0xeed9('0x17'));_0x2aad6c(_0x5e01fe[_0xeed9('0x1d')][_0xeed9('0x1b')]);}})[_0xeed9('0x1e')](function(_0x3ff6a2){logger[_0xeed9('0x1a')](_0xeed9('0x16'),_0x215b37,_0x3ff6a2);_0x3512ef(_0x3ff6a2);});});}function respondWithResult(_0x20c190,_0x40a2ae){_0x40a2ae=_0x40a2ae||0xc8;return function(_0x37bba4){if(_0x37bba4){return _0x20c190[_0xeed9('0x1f')](_0x40a2ae)[_0xeed9('0x20')](_0x37bba4);}};}function respondWithFilteredResult(_0xe582f0,_0x3db415){return function(_0x19e762){if(_0x19e762){var _0x2a58e9=typeof _0x3db415[_0xeed9('0x21')]===_0xeed9('0x22')&&typeof _0x3db415[_0xeed9('0x23')]==='undefined';var _0x34c65e=_0x19e762[_0xeed9('0x24')];var _0x246e17=_0x2a58e9?0x0:_0x3db415[_0xeed9('0x21')];var _0x29c58b=_0x2a58e9?_0x19e762[_0xeed9('0x24')]:_0x3db415[_0xeed9('0x21')]+_0x3db415[_0xeed9('0x23')];var _0x41ad8e;if(_0x29c58b>=_0x34c65e){_0x29c58b=_0x34c65e;_0x41ad8e=0xc8;}else{_0x41ad8e=0xce;}_0xe582f0[_0xeed9('0x1f')](_0x41ad8e);return _0xe582f0[_0xeed9('0x25')](_0xeed9('0x26'),_0x246e17+'-'+_0x29c58b+'/'+_0x34c65e)[_0xeed9('0x20')](_0x19e762);}return null;};}function saveUpdates(_0x53ebb0){return function(_0x5b2c19){if(_0x5b2c19){return _0x5b2c19['update'](_0x53ebb0)[_0xeed9('0x15')](function(_0x25d71f){return _0x25d71f;});}return null;};}function removeEntity(_0x448b69){return function(_0x463afc){if(_0x463afc){return _0x463afc[_0xeed9('0x27')]()['then'](function(){_0x448b69[_0xeed9('0x1f')](0xcc)[_0xeed9('0x28')]();});}};}function handleEntityNotFound(_0x3b1405){return function(_0x1f719f){if(!_0x1f719f){_0x3b1405[_0xeed9('0x29')](0x194);}return _0x1f719f;};}function handleError(_0x1ba2ac,_0x5d951a){_0x5d951a=_0x5d951a||0x1f4;return function(_0x548866){logger[_0xeed9('0x1a')](_0x548866[_0xeed9('0x2a')]);if(_0x548866['name']){delete _0x548866[_0xeed9('0x2b')];}_0x1ba2ac[_0xeed9('0x1f')](_0x5d951a)[_0xeed9('0x2c')](_0x548866);};}exports[_0xeed9('0x2d')]=function(_0x50f9e3,_0x1b2209){var _0x504a99={},_0x20c25a={},_0x2d9275={'count':0x0,'rows':[]};var _0x1f7944=_[_0xeed9('0x2e')](db[_0xeed9('0x2f')]['rawAttributes'],function(_0x16c87e){return{'name':_0x16c87e[_0xeed9('0x30')],'type':_0x16c87e[_0xeed9('0x31')]['key']};});_0x20c25a['model']=_[_0xeed9('0x2e')](_0x1f7944,_0xeed9('0x2b'));_0x20c25a[_0xeed9('0x32')]=_[_0xeed9('0x33')](_0x50f9e3['query']);_0x20c25a[_0xeed9('0x34')]=_['intersection'](_0x20c25a[_0xeed9('0x35')],_0x20c25a[_0xeed9('0x32')]);_0x504a99[_0xeed9('0x36')]=_[_0xeed9('0x37')](_0x20c25a[_0xeed9('0x35')],qs[_0xeed9('0x38')](_0x50f9e3[_0xeed9('0x32')][_0xeed9('0x38')]));_0x504a99[_0xeed9('0x36')]=_0x504a99[_0xeed9('0x36')][_0xeed9('0x39')]?_0x504a99[_0xeed9('0x36')]:_0x20c25a[_0xeed9('0x35')];if(!_0x50f9e3[_0xeed9('0x32')][_0xeed9('0x3a')](_0xeed9('0x3b'))){_0x504a99[_0xeed9('0x23')]=qs['limit'](_0x50f9e3[_0xeed9('0x32')][_0xeed9('0x23')]);_0x504a99[_0xeed9('0x21')]=qs[_0xeed9('0x21')](_0x50f9e3[_0xeed9('0x32')][_0xeed9('0x21')]);}_0x504a99[_0xeed9('0x3c')]=qs[_0xeed9('0x3d')](_0x50f9e3[_0xeed9('0x32')][_0xeed9('0x3d')]);_0x504a99[_0xeed9('0x3e')]=qs[_0xeed9('0x34')](_['pick'](_0x50f9e3[_0xeed9('0x32')],_0x20c25a[_0xeed9('0x34')]),_0x1f7944);if(_0x50f9e3[_0xeed9('0x32')]['filter']){_0x504a99[_0xeed9('0x3e')]=_[_0xeed9('0x3f')](_0x504a99[_0xeed9('0x3e')],{'$or':_[_0xeed9('0x2e')](_0x1f7944,function(_0x541f7b){if(_0x541f7b['type']!==_0xeed9('0x40')){var _0x135991={};_0x135991[_0x541f7b[_0xeed9('0x2b')]]={'$like':'%'+_0x50f9e3[_0xeed9('0x32')][_0xeed9('0x41')]+'%'};return _0x135991;}})});}_0x504a99=_['merge']({},_0x504a99,_0x50f9e3[_0xeed9('0x42')]);var _0x283e56={'where':_0x504a99['where']};return db[_0xeed9('0x2f')]['count'](_0x283e56)[_0xeed9('0x15')](function(_0x1edec0){_0x2d9275['count']=_0x1edec0;if(_0x50f9e3['query']['includeAll']){_0x504a99[_0xeed9('0x43')]=[{'all':!![]}];}return db[_0xeed9('0x2f')][_0xeed9('0x44')](_0x504a99);})['then'](function(_0x193c77){_0x2d9275[_0xeed9('0x45')]=_0x193c77;return _0x2d9275;})[_0xeed9('0x15')](respondWithFilteredResult(_0x1b2209,_0x504a99))[_0xeed9('0x1e')](handleError(_0x1b2209,null));};exports[_0xeed9('0x46')]=function(_0x564a36,_0x3e9798){var _0x3f9db4={'raw':!![],'where':{'id':_0x564a36['params']['id']}},_0x37bfd5={};_0x37bfd5[_0xeed9('0x35')]=_[_0xeed9('0x33')](db[_0xeed9('0x2f')][_0xeed9('0x47')]);_0x37bfd5[_0xeed9('0x32')]=_[_0xeed9('0x33')](_0x564a36[_0xeed9('0x32')]);_0x37bfd5[_0xeed9('0x34')]=_[_0xeed9('0x37')](_0x37bfd5[_0xeed9('0x35')],_0x37bfd5[_0xeed9('0x32')]);_0x3f9db4[_0xeed9('0x36')]=_[_0xeed9('0x37')](_0x37bfd5[_0xeed9('0x35')],qs[_0xeed9('0x38')](_0x564a36[_0xeed9('0x32')][_0xeed9('0x38')]));_0x3f9db4['attributes']=_0x3f9db4[_0xeed9('0x36')][_0xeed9('0x39')]?_0x3f9db4[_0xeed9('0x36')]:_0x37bfd5[_0xeed9('0x35')];if(_0x564a36['query'][_0xeed9('0x48')]){_0x3f9db4[_0xeed9('0x43')]=[{'all':!![]}];}_0x3f9db4=_['merge']({},_0x3f9db4,_0x564a36[_0xeed9('0x42')]);return db['MailMessage'][_0xeed9('0x49')](_0x3f9db4)[_0xeed9('0x15')](handleEntityNotFound(_0x3e9798,null))[_0xeed9('0x15')](respondWithResult(_0x3e9798,null))[_0xeed9('0x1e')](handleError(_0x3e9798,null));};exports[_0xeed9('0x4a')]=function(_0x569d6d,_0x351dc5){if(_0x569d6d[_0xeed9('0x4b')]['id']){delete _0x569d6d[_0xeed9('0x4b')]['id'];}return db[_0xeed9('0x2f')][_0xeed9('0x49')]({'where':{'id':_0x569d6d[_0xeed9('0x4c')]['id']}})[_0xeed9('0x15')](handleEntityNotFound(_0x351dc5,null))[_0xeed9('0x15')](saveUpdates(_0x569d6d['body'],null))[_0xeed9('0x15')](respondWithResult(_0x351dc5,null))[_0xeed9('0x1e')](handleError(_0x351dc5,null));};exports[_0xeed9('0x27')]=function(_0x36956e,_0x1faaed){return db['MailMessage'][_0xeed9('0x49')]({'where':{'id':_0x36956e[_0xeed9('0x4c')]['id']}})[_0xeed9('0x15')](handleEntityNotFound(_0x1faaed,null))['then'](removeEntity(_0x1faaed,null))[_0xeed9('0x1e')](handleError(_0x1faaed,null));};exports[_0xeed9('0x4d')]=function(_0x2bbbdc,_0x69e8c9){return db[_0xeed9('0x2f')][_0xeed9('0x4d')]()[_0xeed9('0x15')](respondWithResult(_0x69e8c9,null))['catch'](handleError(_0x69e8c9,null));};exports['create']=function(_0x43b388,_0x2c103a){return db[_0xeed9('0x2f')]['create'](_0x43b388['body'])[_0xeed9('0x15')](function(_0x595f78){if(_0x595f78){if(_0x595f78[_0xeed9('0x4e')]==='out'&&!_0x595f78[_0xeed9('0x4f')]){var _0x534f3f,_0xdf5f95,_0x34a1c0;if(_0x43b388['body']['to']){_0xdf5f95=_0x43b388[_0xeed9('0x4b')]['to']['split'](',')[0x0];}return db[_0xeed9('0x50')][_0xeed9('0x51')]({'where':{'id':_0x595f78[_0xeed9('0x52')]},'include':[{'model':db[_0xeed9('0x53')],'as':'List','include':[{'model':db[_0xeed9('0x54')],'as':_0xeed9('0x55'),'where':{'email':_0xdf5f95},'limit':0x1,'order':[[_0xeed9('0x56'),'DESC']]}]},{'model':db[_0xeed9('0x57')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xeed9('0x58')],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x27e1e4){_0x534f3f=_0x27e1e4;if(!_0x534f3f||!_0x534f3f['Smtp'])return;var _0x34bb06=_0x534f3f[_0xeed9('0x59')]();if(_0x43b388[_0xeed9('0x4b')][_0xeed9('0x5a')]&&_0x43b388[_0xeed9('0x4b')]['attachments'][_0xeed9('0x39')]){for(var _0x2f9460=0x0;_0x2f9460<_0x43b388[_0xeed9('0x4b')][_0xeed9('0x5a')][_0xeed9('0x39')];_0x2f9460+=0x1){_0x43b388[_0xeed9('0x4b')]['attachments'][_0x2f9460]={'filename':_0x43b388['body'][_0xeed9('0x5a')][_0x2f9460][_0xeed9('0x2b')],'path':path[_0xeed9('0x5b')](config[_0xeed9('0x5c')],_0xeed9('0x5d'),_0x43b388[_0xeed9('0x4b')][_0xeed9('0x5a')][_0x2f9460][_0xeed9('0x5e')])};}}_0x34a1c0={'account':_0x34bb06,'message':_0x43b388['body']};return;})[_0xeed9('0x15')](function(){if(_0x534f3f['List']){if(_0x534f3f[_0xeed9('0x5f')][_0xeed9('0x55')]['length']){return _0x534f3f[_0xeed9('0x5f')]['Contacts'][0x0];}else{return db[_0xeed9('0x54')][_0xeed9('0x60')](_[_0xeed9('0xb')](_0x43b388[_0xeed9('0x4b')],{'firstName':_0x43b388[_0xeed9('0x4b')]['to'],'email':_0x43b388[_0xeed9('0x4b')]['to'],'phone':_0x43b388[_0xeed9('0x4b')]['to'],'ListId':_0x534f3f[_0xeed9('0x61')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x34a1c0){return respondWithRpcPromise(_0xeed9('0x62'),_0xeed9('0x63'),_0x34a1c0,client9003)['then'](function(_0x894965){return _0x595f78[_0xeed9('0x4a')]({'read':!![],'messageId':_0x894965['messageId'],'sentAt':moment()[_0xeed9('0x64')](_0xeed9('0x65'))});})['catch'](function(_0x5670fd){logger[_0xeed9('0x1a')]('%s',JSON[_0xeed9('0x18')](_0x5670fd));return _0x595f78;});}return _0x595f78;});}return _0x595f78;}})[_0xeed9('0x15')](respondWithResult(_0x2c103a,0xc9))[_0xeed9('0x1e')](handleError(_0x2c103a,null));};exports[_0xeed9('0x66')]=function(_0xd13944,_0x2e15d2){var _0x48244f={'agent':{},'channel':_0xeed9('0x67')};if(_0xd13944['body']['id']){delete _0xd13944[_0xeed9('0x4b')]['id'];}_0xd13944[_0xeed9('0x4b')]['read']=!![];_0xd13944[_0xeed9('0x4b')]['readAt']=moment()['format'](_0xeed9('0x65'));_0xd13944[_0xeed9('0x4b')][_0xeed9('0x68')]=_0xd13944['body']['UserId']||_0xd13944['user']['id'];_0x48244f[_0xeed9('0x69')]['id']=_0xd13944[_0xeed9('0x4b')]['UserId'];return db[_0xeed9('0x2f')][_0xeed9('0x49')]({'where':{'id':_0xd13944[_0xeed9('0x4c')]['id'],'UserId':null}})[_0xeed9('0x15')](handleEntityNotFound(_0x2e15d2,null))[_0xeed9('0x15')](saveUpdates(_0xd13944[_0xeed9('0x4b')],null))[_0xeed9('0x15')](function(_0x2d7f1a){if(_0x2d7f1a){_0x48244f[_0xeed9('0x1b')]=_0x2d7f1a['get']({'plain':!![]});return db[_0xeed9('0x6a')][_0xeed9('0x49')]({'where':{'id':_0x2d7f1a['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2e15d2,null))[_0xeed9('0x15')](function(_0x52010f){if(_0x52010f){return _0x52010f[_0xeed9('0x4a')]({'UserId':_0xd13944[_0xeed9('0x4b')][_0xeed9('0x68')],'read1stAt':_[_0xeed9('0x6b')](_0x52010f['read1stAt'])?moment()[_0xeed9('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xeed9('0x15')](function(_0x119dd0){if(_0x119dd0){_0x48244f[_0xeed9('0x6c')]=_0x119dd0['get']({'plain':!![]});interaction_log['info'](_0xeed9('0x6d'),_0xd13944[_0xeed9('0x6e')]['id'],_0xd13944[_0xeed9('0x6e')]['name'],_0xd13944[_0xeed9('0x6e')][_0xeed9('0x6f')],_0x48244f['interaction']['id'],_0xd13944[_0xeed9('0x4b')]?JSON['stringify'](_0xd13944[_0xeed9('0x4b')]):_0xeed9('0x70'));return respondWithRpcPromise('AcceptMessage',_0xeed9('0x71'),_0x48244f);}return null;})[_0xeed9('0x15')](function(_0x41594e){var _0x1c4725='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x41594e[_0xeed9('0x1b')][_0xeed9('0x72')];return db[_0xeed9('0x73')][_0xeed9('0x32')](_0x1c4725,{'type':db[_0xeed9('0x74')][_0xeed9('0x75')]['SELECT'],'raw':!![]})[_0xeed9('0x15')](function(_0x1c0f59){return _0x1c0f59;});})[_0xeed9('0x15')](function(_0x35d600){if(_0x35d600){_0x48244f[_0xeed9('0x1b')]['contact']=_0x35d600[0x0];if(!_0xd13944[_0xeed9('0x4b')][_0xeed9('0x68')])return;return db['User']['find']({'where':{'id':_0xd13944[_0xeed9('0x4b')]['UserId'],'role':_0xeed9('0x69')},'attributes':['id','name',_0xeed9('0x76'),_0xeed9('0x77'),'internal'],'raw':!![]});}return null;})[_0xeed9('0x15')](function(_0x5c7d36){if(!_0x5c7d36)return null;_0x48244f[_0xeed9('0x1b')][_0xeed9('0x69')]=_0x5c7d36;return _0x48244f;})['then'](function(_0xb7f771){if(_0xb7f771){if(_0xd13944[_0xeed9('0x4b')][_0xeed9('0x78')]){_0x48244f[_0xeed9('0x1b')][_0xeed9('0x79')]=util['format'](_0xeed9('0x7a'),_0xd13944[_0xeed9('0x6e')][_0xeed9('0x2b')]);_0x48244f['message'][_0xeed9('0x7b')]=_0x48244f[_0xeed9('0x7b')];_0x48244f['message'][_0xeed9('0x7c')]=_0x48244f[_0xeed9('0x7b')];_0x48244f[_0xeed9('0x1b')]['event']=_0xeed9('0x66');_0x48244f[_0xeed9('0x1b')][_0xeed9('0x4b')]=htmlToText['fromString'](_0x48244f[_0xeed9('0x1b')]['body']);return respondWithRpcPromise(_0xeed9('0x7d'),_0xeed9('0x7d'),{'event':'acceptmessage','message':_0x48244f[_0xeed9('0x1b')]},client9002)[_0xeed9('0x15')](function(){return _0x48244f;});}return _0x48244f;}return null;})['then'](respondWithResult(_0x2e15d2,null))[_0xeed9('0x1e')](handleError(_0x2e15d2,null));};exports[_0xeed9('0x7e')]=function(_0x12ac9e,_0x4bc6ce){var _0x56b424={'agent':{},'channel':'mail'};if(_0x12ac9e[_0xeed9('0x4b')]['id']){delete _0x12ac9e['body']['id'];}_0x12ac9e[_0xeed9('0x4b')][_0xeed9('0x68')]=_0x12ac9e[_0xeed9('0x4b')][_0xeed9('0x68')]||_0x12ac9e[_0xeed9('0x6e')]['id'];_0x56b424[_0xeed9('0x69')]['id']=_0x12ac9e[_0xeed9('0x4b')]['UserId'];return db[_0xeed9('0x2f')][_0xeed9('0x49')]({'where':{'id':_0x12ac9e[_0xeed9('0x4c')]['id'],'UserId':null}})[_0xeed9('0x15')](handleEntityNotFound(_0x4bc6ce,null))[_0xeed9('0x15')](function(_0x6c8fd5){if(_0x6c8fd5){_0x56b424['message']=_0x6c8fd5['get']({'plain':!![]});return db[_0xeed9('0x6a')][_0xeed9('0x49')]({'where':{'id':_0x6c8fd5[_0xeed9('0x7f')]}});}return null;})[_0xeed9('0x15')](handleEntityNotFound(_0x4bc6ce,null))[_0xeed9('0x15')](function(_0xd6d81a){if(_0xd6d81a){_0x56b424[_0xeed9('0x6c')]=_0xd6d81a['get']({'plain':!![]});interaction_log[_0xeed9('0x1c')](_0xeed9('0x80'),_0x12ac9e[_0xeed9('0x6e')]['id'],_0x12ac9e['user']['name'],_0x12ac9e[_0xeed9('0x6e')]['role'],_0x56b424[_0xeed9('0x6c')]['id'],_0x12ac9e[_0xeed9('0x4b')]?JSON[_0xeed9('0x18')](_0x12ac9e[_0xeed9('0x4b')]):_0xeed9('0x70'));return respondWithRpcPromise(_0xeed9('0x81'),_0xeed9('0x82'),_0x56b424);}return null;})[_0xeed9('0x15')](function(_0x172576){var _0x2b38b2=_0xeed9('0x83')+_0x172576[_0xeed9('0x1b')][_0xeed9('0x72')];return db['sequelize'][_0xeed9('0x32')](_0x2b38b2,{'type':db[_0xeed9('0x74')][_0xeed9('0x75')][_0xeed9('0x84')],'raw':!![]})[_0xeed9('0x15')](function(_0x7e3a33){return _0x7e3a33;});})[_0xeed9('0x15')](function(_0x29803d){if(_0x29803d){_0x56b424[_0xeed9('0x1b')][_0xeed9('0x85')]=_0x29803d[0x0];if(!_0x12ac9e[_0xeed9('0x4b')][_0xeed9('0x68')])return;return db[_0xeed9('0x86')]['find']({'where':{'id':_0x12ac9e[_0xeed9('0x4b')]['UserId'],'role':_0xeed9('0x69')},'attributes':['id',_0xeed9('0x2b'),'fullname',_0xeed9('0x77'),'internal'],'raw':!![]});}return null;})[_0xeed9('0x15')](function(_0x29014d){if(!_0x29014d)return null;_0x56b424[_0xeed9('0x1b')][_0xeed9('0x69')]=_0x29014d;return _0x56b424;})[_0xeed9('0x15')](function(_0x545837){if(_0x545837){_0x545837[_0xeed9('0x1b')][_0xeed9('0x79')]=util[_0xeed9('0x64')]('SIP/%s',_0x12ac9e[_0xeed9('0x6e')][_0xeed9('0x2b')]);_0x545837[_0xeed9('0x1b')][_0xeed9('0x7b')]=_0x56b424[_0xeed9('0x7b')];_0x545837[_0xeed9('0x1b')]['motionChannel']=_0x56b424[_0xeed9('0x7b')];_0x545837['message'][_0xeed9('0x87')]=_0xeed9('0x7e');_0x545837[_0xeed9('0x1b')][_0xeed9('0x4b')]=htmlToText['fromString'](_0x56b424['message']['body']);respondWithRpcPromise(_0xeed9('0x7d'),_0xeed9('0x7d'),{'event':'rejectmessage','message':_0x545837[_0xeed9('0x1b')]},client9002);return _0x56b424;}return null;})[_0xeed9('0x15')](respondWithResult(_0x4bc6ce,null))['catch'](handleError(_0x4bc6ce,null));};exports[_0xeed9('0x88')]=function(_0x45966e,_0x40957c){var _0x405b78=moment()[_0xeed9('0x89')]()[_0xeed9('0x8a')]();var _0x4530c0=path[_0xeed9('0x5b')](config[_0xeed9('0x5c')],'server',_0xeed9('0x8b'),'tmp');var _0x2b5ba2=path['join'](config[_0xeed9('0x5c')],_0xeed9('0x8c'),_0xeed9('0x8b'),_0xeed9('0x5a'));var _0x8df298=util[_0xeed9('0x64')](_0xeed9('0x8d'),_0x405b78);return db[_0xeed9('0x2f')]['find']({'where':{'id':_0x45966e[_0xeed9('0x4c')]['id']},'attributes':['id',_0xeed9('0x4b'),'from','to','cc',_0xeed9('0x8e'),'subject',_0xeed9('0x8f')],'include':_0x45966e[_0xeed9('0x32')][_0xeed9('0x5a')]?[{'model':db[_0xeed9('0x90')],'as':_0xeed9('0x91')}]:undefined})[_0xeed9('0x15')](handleEntityNotFound(_0x40957c,null))[_0xeed9('0x15')](function(_0x1c7a7f){if(_0x1c7a7f){var _0x229d18=_0x1c7a7f;var _0x2c64be={'from':_0x229d18['from'],'to':_0x229d18['to'],'subject':_0x229d18[_0xeed9('0x92')],'html':htmlEntities['decode'](_0x229d18[_0xeed9('0x4b')]),'headers':{'Date':moment(_0x229d18[_0xeed9('0x8f')])[_0xeed9('0x64')](_0xeed9('0x93'))},'attachments':[]};if(_0x1c7a7f['cc']){_0x2c64be['headers']['Cc']=_0x1c7a7f['cc'];}if(_0x1c7a7f[_0xeed9('0x8e')]){_0x2c64be['headers'][_0xeed9('0x94')]=_0x1c7a7f[_0xeed9('0x8e')];}return new BPromise(function(_0x3262d5,_0x14d21a){if(_0x1c7a7f[_0xeed9('0x91')]){for(var _0x48c61b=0x0;_0x48c61b<_0x1c7a7f[_0xeed9('0x91')][_0xeed9('0x39')];_0x48c61b++){var _0x18fef7=_0x1c7a7f[_0xeed9('0x91')][_0x48c61b];var _0x251eba=path['join'](_0x2b5ba2,_0x18fef7[_0xeed9('0x5e')]);if(fs[_0xeed9('0x95')](_0x251eba)){_0x2c64be[_0xeed9('0x5a')][_0xeed9('0x96')]({'name':_0x18fef7['name'],'contentType':_0x18fef7[_0xeed9('0x31')],'data':fs['readFileSync'](_0x251eba)});}}}emlformat[_0xeed9('0x97')](_0x2c64be,function(_0x2bae8a,_0x4e562e){if(_0x2bae8a)return _0x14d21a(_0x2bae8a);fs[_0xeed9('0x98')](path['join'](_0x4530c0,_0x8df298),_0x4e562e);return _0x3262d5(_0x4e562e);});});}})[_0xeed9('0x15')](function(_0x160c71){if(_0x160c71){return _0x40957c[_0xeed9('0x88')](path[_0xeed9('0x5b')](_0x4530c0,_0x8df298),_0x8df298,function(_0x733700){if(!_0x733700)fs[_0xeed9('0x99')](path[_0xeed9('0x5b')](_0x4530c0,_0x8df298));});}})[_0xeed9('0x1e')](handleError(_0x40957c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0a62148..f24ea9c 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 _0x2c12=['hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c12,0x65));var _0x22c1=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x2c12[_0xce93c];return _0x230720;};'use strict';var EventEmitter=require(_0x22c1('0x0'));var MailMessage=require(_0x22c1('0x1'))['db'][_0x22c1('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x22c1('0x3')](0x0);var events={'afterCreate':_0x22c1('0x4'),'afterUpdate':_0x22c1('0x5'),'afterDestroy':_0x22c1('0x6')};function emitEvent(_0x3b915f){return function(_0x5a840c,_0x2831ae,_0x289f23){MailMessageEvents[_0x22c1('0x7')](_0x3b915f+':'+_0x5a840c['id'],_0x5a840c);MailMessageEvents[_0x22c1('0x7')](_0x3b915f,_0x5a840c);_0x289f23(null);};}for(var e in events){if(events[_0x22c1('0x8')](e)){var event=events[e];MailMessage[_0x22c1('0x9')](e,emitEvent(event));}}module[_0x22c1('0xa')]=MailMessageEvents; \ No newline at end of file +var _0x5f98=['MailMessage','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4d9b80,_0x3deb54){var _0x3e6b70=function(_0x31e86f){while(--_0x31e86f){_0x4d9b80['push'](_0x4d9b80['shift']());}};_0x3e6b70(++_0x3deb54);}(_0x5f98,0xb5));var _0x85f9=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x5f98[_0x1a36a5];return _0x746243;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x85f9('0x0'))['db'][_0x85f9('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85f9('0x2'),'afterDestroy':'remove'};function emitEvent(_0x28ea92){return function(_0x267697,_0x197c7d,_0x372a09){MailMessageEvents[_0x85f9('0x3')](_0x28ea92+':'+_0x267697['id'],_0x267697);MailMessageEvents[_0x85f9('0x3')](_0x28ea92,_0x267697);_0x372a09(null);};}for(var e in events){if(events[_0x85f9('0x4')](e)){var event=events[e];MailMessage[_0x85f9('0x5')](e,emitEvent(event));}}module[_0x85f9('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 9497e6b..854f024 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 _0xc499=['rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','fti_mail_messages','subject','body','fromString','models','get','direction','toLowerCase','out','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','lodash','util','../../config/logger','api','moment','bluebird','html-to-text'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc499,0x1d9));var _0x9c49=function(_0x19921b,_0x5c0c2d){_0x19921b=_0x19921b-0x0;var _0x273545=_0xc499[_0x19921b];return _0x273545;};'use strict';var _=require(_0x9c49('0x0'));var util=require(_0x9c49('0x1'));var logger=require(_0x9c49('0x2'))(_0x9c49('0x3'));var moment=require(_0x9c49('0x4'));var BPromise=require(_0x9c49('0x5'));var rp=require('request-promise');var htmlToText=require(_0x9c49('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c49('0x7'));var config=require(_0x9c49('0x8'));var attributes=require(_0x9c49('0x9'));module[_0x9c49('0xa')]=function(_0x12c219,_0x154de7){return _0x12c219[_0x9c49('0xb')](_0x9c49('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x9c49('0xd'),'fields':['plainBody',_0x9c49('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x35f77,_0x5e3abb,_0x1de158){if(_0x35f77[_0x9c49('0xf')]){_0x35f77['plainBody']=htmlToText[_0x9c49('0x10')](_0x35f77[_0x9c49('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1de158(null,_0x5e3abb);},'afterCreate':function(_0x1a3ff2,_0x2d6724,_0x47d3e1){var _0x778052=_0x12c219[_0x9c49('0x11')];var _0x1820de=_0x1a3ff2[_0x9c49('0x12')]({'plain':!![]});if(_0x1820de[_0x9c49('0x13')]['toLowerCase']()==='in'||_0x1820de[_0x9c49('0x13')][_0x9c49('0x14')]()===_0x9c49('0x15')&&!_0x1820de['secret']&&!_['isNil'](_0x1820de[_0x9c49('0x16')])){_0x778052['MailInteraction'][_0x9c49('0x17')]({'where':{'id':_0x1820de[_0x9c49('0x18')]}})[_0x9c49('0x19')](function(_0x5d4a59){if(_0x5d4a59){_0x5d4a59[_0x9c49('0x1a')]({'lastMsgAt':_0x1820de[_0x9c49('0x1b')],'lastMsgDirection':_0x1820de[_0x9c49('0x13')][_0x9c49('0x14')]()});}})[_0x9c49('0x1c')](function(_0x5c7b9a){console[_0x9c49('0x1d')](_0x5c7b9a);});}_0x47d3e1();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd847=['then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','MailInteractionId'];(function(_0x4d8e5f,_0x1253e0){var _0xfde571=function(_0x104ec3){while(--_0x104ec3){_0x4d8e5f['push'](_0x4d8e5f['shift']());}};_0xfde571(++_0x1253e0);}(_0xd847,0x13b));var _0x7d84=function(_0x3010ff,_0x480d8e){_0x3010ff=_0x3010ff-0x0;var _0x1bd6e1=_0xd847[_0x3010ff];return _0x1bd6e1;};'use strict';var _=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var logger=require('../../config/logger')(_0x7d84('0x2'));var moment=require(_0x7d84('0x3'));var BPromise=require(_0x7d84('0x4'));var rp=require(_0x7d84('0x5'));var htmlToText=require(_0x7d84('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d84('0x7'));var config=require(_0x7d84('0x8'));var attributes=require(_0x7d84('0x9'));module[_0x7d84('0xa')]=function(_0x6632e3,_0x55554a){return _0x6632e3['define']('MailMessage',attributes,{'tableName':_0x7d84('0xb'),'paranoid':![],'indexes':[{'name':_0x7d84('0xc'),'fields':[_0x7d84('0xc')]},{'name':_0x7d84('0xd'),'fields':[_0x7d84('0xe'),_0x7d84('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1e09b9,_0x4cfd71,_0x4f294e){if(_0x1e09b9[_0x7d84('0x10')]){_0x1e09b9[_0x7d84('0xe')]=htmlToText[_0x7d84('0x11')](_0x1e09b9[_0x7d84('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4f294e(null,_0x4cfd71);},'afterCreate':function(_0x24b458,_0x191b31,_0x3080c0){var _0x8fcfeb=_0x6632e3['models'];var _0x44e727=_0x24b458[_0x7d84('0x12')]({'plain':!![]});if(_0x44e727[_0x7d84('0x13')][_0x7d84('0x14')]()==='in'||_0x44e727[_0x7d84('0x13')]['toLowerCase']()===_0x7d84('0x15')&&!_0x44e727['secret']&&!_[_0x7d84('0x16')](_0x44e727[_0x7d84('0x17')])){_0x8fcfeb[_0x7d84('0x18')]['findOne']({'where':{'id':_0x44e727[_0x7d84('0x19')]}})[_0x7d84('0x1a')](function(_0x38b0a2){if(_0x38b0a2){_0x38b0a2[_0x7d84('0x1b')]({'lastMsgAt':_0x44e727[_0x7d84('0x1c')],'lastMsgDirection':_0x44e727[_0x7d84('0x13')]['toLowerCase']()});}})[_0x7d84('0x1d')](function(_0x2e824b){console['error'](_0x2e824b);});}_0x3080c0();}},'charset':'utf8mb4','collate':_0x7d84('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 56b064b..6e59a8f 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 _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateMailMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x407a5b,_0x4a84fc){var _0x39bda9=function(_0x7b60e2){while(--_0x7b60e2){_0x407a5b['push'](_0x407a5b['shift']());}};_0x39bda9(++_0x4a84fc);}(_0x5eb8,0xb0));var _0x85eb=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x5eb8[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./mailMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateMailMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['MailMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateMailMessage',_0x24cf28);logger['debug']('CreateMailMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file +var _0xab40=['raw','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateMailMessage','MailMessage','create','options'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xab40,0xcd));var _0x0ab4=function(_0x3e881f,_0x1198a7){_0x3e881f=_0x3e881f-0x0;var _0x13011b=_0xab40[_0x3e881f];return _0x13011b;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});}exports[_0x0ab4('0x17')]=function(_0x4e7852){var _0x4ff836=this;return new Promise(function(_0xdb0797,_0x5b1ed5){return db[_0x0ab4('0x18')][_0x0ab4('0x19')](_0x4e7852['body'],{'raw':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![]})[_0x0ab4('0xd')](function(_0x12d06d){logger['info']('CreateMailMessage',_0x4e7852);logger[_0x0ab4('0xf')](_0x0ab4('0x17'),_0x4e7852,JSON[_0x0ab4('0x12')](_0x12d06d));_0xdb0797(_0x12d06d);})[_0x0ab4('0x1c')](function(_0x4e4b80){logger[_0x0ab4('0x13')](_0x0ab4('0x17'),_0x4e4b80[_0x0ab4('0x15')],_0x4e7852);_0x5b1ed5(_0x4ff836['error'](0x1f4,_0x4e4b80['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 6c827a3..8875f7d 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 _0x7985=['length','mailMessage:','./mailMessage.events','remove','update','emit','register'];(function(_0x2c6f1c,_0x18f248){var _0x3aa773=function(_0x4acec3){while(--_0x4acec3){_0x2c6f1c['push'](_0x2c6f1c['shift']());}};_0x3aa773(++_0x18f248);}(_0x7985,0x1de));var _0x5798=function(_0x21929f,_0xb96182){_0x21929f=_0x21929f-0x0;var _0x1a6077=_0x7985[_0x21929f];return _0x1a6077;};'use strict';var MailMessageEvents=require(_0x5798('0x0'));var events=['save',_0x5798('0x1'),_0x5798('0x2')];function createListener(_0x297f13,_0x5510ad){return function(_0x58b86c){_0x5510ad[_0x5798('0x3')](_0x297f13,_0x58b86c);};}function removeListener(_0x1bc556,_0x43cf82){return function(){MailMessageEvents['removeListener'](_0x1bc556,_0x43cf82);};}exports[_0x5798('0x4')]=function(_0x422990){for(var _0x28cf24=0x0,_0x5b18ae=events[_0x5798('0x5')];_0x28cf24<_0x5b18ae;_0x28cf24++){var _0x5f2e1f=events[_0x28cf24];var _0x440294=createListener(_0x5798('0x6')+_0x5f2e1f,_0x422990);MailMessageEvents['on'](_0x5f2e1f,_0x440294);}}; \ No newline at end of file +var _0x5b05=['update','emit','removeListener','length','save','remove'];(function(_0x5569f1,_0x5ee797){var _0x29214f=function(_0x1240f6){while(--_0x1240f6){_0x5569f1['push'](_0x5569f1['shift']());}};_0x29214f(++_0x5ee797);}(_0x5b05,0x190));var _0x55b0=function(_0x1ac495,_0x343f0a){_0x1ac495=_0x1ac495-0x0;var _0xa58131=_0x5b05[_0x1ac495];return _0xa58131;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x55b0('0x0'),_0x55b0('0x1'),_0x55b0('0x2')];function createListener(_0x4148d8,_0x28c785){return function(_0x2925fe){_0x28c785[_0x55b0('0x3')](_0x4148d8,_0x2925fe);};}function removeListener(_0x43a880,_0x2cbf51){return function(){MailMessageEvents[_0x55b0('0x4')](_0x43a880,_0x2cbf51);};}exports['register']=function(_0x569adf){for(var _0x129898=0x0,_0xe0c407=events[_0x55b0('0x5')];_0x129898<_0xe0c407;_0x129898++){var _0x355e20=events[_0x129898];var _0xdf375f=createListener('mailMessage:'+_0x355e20,_0x569adf);MailMessageEvents['on'](_0x355e20,_0xdf375f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index adfecec..6638cdb 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 _0x8409=['update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addAgents','put'];(function(_0x529b05,_0x130267){var _0x381832=function(_0x2cac68){while(--_0x2cac68){_0x529b05['push'](_0x529b05['shift']());}};_0x381832(++_0x130267);}(_0x8409,0x154));var _0x9840=function(_0x55cc6a,_0x5dbd65){_0x55cc6a=_0x55cc6a-0x0;var _0x26e2cd=_0x8409[_0x55cc6a];return _0x26e2cd;};'use strict';var multer=require(_0x9840('0x0'));var util=require(_0x9840('0x1'));var path=require(_0x9840('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9840('0x3')]();var fs_extra=require(_0x9840('0x4'));var auth=require(_0x9840('0x5'));var interaction=require(_0x9840('0x6'));var config=require(_0x9840('0x7'));var controller=require(_0x9840('0x8'));router['get']('/',auth[_0x9840('0x9')](),controller[_0x9840('0xa')]);router['get'](_0x9840('0xb'),auth[_0x9840('0x9')](),controller[_0x9840('0xc')]);router[_0x9840('0xd')](_0x9840('0xe'),auth['isAuthenticated'](),controller[_0x9840('0xf')]);router[_0x9840('0xd')](_0x9840('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9840('0xd')](_0x9840('0x11'),auth[_0x9840('0x9')](),controller['getTeams']);router[_0x9840('0xd')](_0x9840('0x12'),auth['isAuthenticated'](),controller[_0x9840('0x13')]);router[_0x9840('0x14')]('/',auth[_0x9840('0x9')](),controller[_0x9840('0x15')]);router[_0x9840('0x14')](_0x9840('0x11'),auth[_0x9840('0x9')](),controller['addTeams']);router['post'](_0x9840('0x12'),auth[_0x9840('0x9')](),controller[_0x9840('0x16')]);router[_0x9840('0x17')]('/:id',auth[_0x9840('0x9')](),controller[_0x9840('0x18')]);router[_0x9840('0x19')](_0x9840('0xe'),auth[_0x9840('0x9')](),controller[_0x9840('0x1a')]);router[_0x9840('0x19')](_0x9840('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x9840('0x19')](_0x9840('0x12'),auth[_0x9840('0x9')](),controller['removeAgents']);module[_0x9840('0x1b')]=router; \ No newline at end of file +var _0xdf40=['/:id/teams','getTeams','post','create','addAgents','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','getMembers'];(function(_0x1b4bdc,_0x11f92c){var _0x246255=function(_0x52ca0b){while(--_0x52ca0b){_0x1b4bdc['push'](_0x1b4bdc['shift']());}};_0x246255(++_0x11f92c);}(_0xdf40,0x168));var _0x0df4=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0xdf40[_0xdd0313];return _0x2bd7e8;};'use strict';var multer=require(_0x0df4('0x0'));var util=require(_0x0df4('0x1'));var path=require(_0x0df4('0x2'));var timeout=require(_0x0df4('0x3'));var express=require(_0x0df4('0x4'));var router=express[_0x0df4('0x5')]();var fs_extra=require(_0x0df4('0x6'));var auth=require(_0x0df4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0df4('0x8'));var controller=require(_0x0df4('0x9'));router[_0x0df4('0xa')]('/',auth[_0x0df4('0xb')](),controller[_0x0df4('0xc')]);router['get']('/describe',auth[_0x0df4('0xb')](),controller[_0x0df4('0xd')]);router['get'](_0x0df4('0xe'),auth['isAuthenticated'](),controller[_0x0df4('0xf')]);router[_0x0df4('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x0df4('0x10')]);router['get'](_0x0df4('0x11'),auth[_0x0df4('0xb')](),controller[_0x0df4('0x12')]);router[_0x0df4('0xa')]('/:id/users',auth[_0x0df4('0xb')](),controller['getAgents']);router[_0x0df4('0x13')]('/',auth[_0x0df4('0xb')](),controller[_0x0df4('0x14')]);router[_0x0df4('0x13')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x0df4('0x13')]('/:id/users',auth[_0x0df4('0xb')](),controller[_0x0df4('0x15')]);router['put']('/:id',auth[_0x0df4('0xb')](),controller[_0x0df4('0x16')]);router[_0x0df4('0x17')](_0x0df4('0xe'),auth[_0x0df4('0xb')](),controller[_0x0df4('0x18')]);router[_0x0df4('0x17')](_0x0df4('0x11'),auth['isAuthenticated'](),controller[_0x0df4('0x19')]);router[_0x0df4('0x17')](_0x0df4('0x1a'),auth[_0x0df4('0xb')](),controller[_0x0df4('0x1b')]);module[_0x0df4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 5ecd022..3b60f45 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 _0x4b49=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x4ef13e,_0x50dc3d){var _0x1791b2=function(_0x1502be){while(--_0x1502be){_0x4ef13e['push'](_0x4ef13e['shift']());}};_0x1791b2(++_0x50dc3d);}(_0x4b49,0x1c8));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x94b4('0x0'));module[_0x94b4('0x1')]={'name':{'type':Sequelize[_0x94b4('0x2')],'unique':_0x94b4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x94b4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x94b4('0x5')](_0x94b4('0x6'),'beepall',_0x94b4('0x7'))}}; \ No newline at end of file +var _0x089d=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3c9373,_0x4feb18){var _0x170f07=function(_0x136773){while(--_0x136773){_0x3c9373['push'](_0x3c9373['shift']());}};_0x170f07(++_0x4feb18);}(_0x089d,0x89));var _0xd089=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x089d[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require('sequelize');module[_0xd089('0x0')]={'name':{'type':Sequelize[_0xd089('0x1')],'unique':_0xd089('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd089('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd089('0x4')](_0xd089('0x5'),_0xd089('0x6'),_0xd089('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 7779b4c..1a5e6c2 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 _0x0e35=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserMailQueue','length','order','MailQueueId','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','userMailQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./mailQueue.socket','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','MailQueues','end','stack','name','send','index','map','MailQueue','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','find','create'];(function(_0x35e300,_0x5a661b){var _0x34ffa7=function(_0x31b18e){while(--_0x31b18e){_0x35e300['push'](_0x35e300['shift']());}};_0x34ffa7(++_0x5a661b);}(_0x0e35,0xc2));var _0x50e3=function(_0x1b263e,_0x34ab13){_0x1b263e=_0x1b263e-0x0;var _0x2ac691=_0x0e35[_0x1b263e];return _0x2ac691;};'use strict';var emlformat=require(_0x50e3('0x0'));var rimraf=require(_0x50e3('0x1'));var zipdir=require(_0x50e3('0x2'));var jsonpatch=require(_0x50e3('0x3'));var rp=require(_0x50e3('0x4'));var moment=require(_0x50e3('0x5'));var BPromise=require(_0x50e3('0x6'));var Mustache=require(_0x50e3('0x7'));var util=require(_0x50e3('0x8'));var path=require(_0x50e3('0x9'));var sox=require('sox');var csv=require(_0x50e3('0xa'));var ejs=require(_0x50e3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x50e3('0xc'));var crypto=require(_0x50e3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50e3('0xa'));var querystring=require(_0x50e3('0xe'));var Papa=require(_0x50e3('0xf'));var Redis=require(_0x50e3('0x10'));var authService=require(_0x50e3('0x11'));var qs=require(_0x50e3('0x12'));var as=require(_0x50e3('0x13'));var hardwareService=require(_0x50e3('0x14'));var logger=require(_0x50e3('0x15'))(_0x50e3('0x16'));var utils=require(_0x50e3('0x17'));var config=require(_0x50e3('0x18'));var licenseUtil=require(_0x50e3('0x19'));var db=require('../../mysqldb')['db'];config[_0x50e3('0x1a')]=_[_0x50e3('0x1b')](config[_0x50e3('0x1a')],{'host':_0x50e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50e3('0x1a')]));require(_0x50e3('0x1d'))['register'](socket);function respondWithStatusCode(_0x43bb4d,_0x3f7cfa){_0x3f7cfa=_0x3f7cfa||0xcc;return function(_0x4b5ed5){if(_0x4b5ed5){return _0x43bb4d[_0x50e3('0x1e')](_0x3f7cfa);}return _0x43bb4d[_0x50e3('0x1f')](_0x3f7cfa)['end']();};}function respondWithResult(_0x2aff1c,_0x5f44e1){_0x5f44e1=_0x5f44e1||0xc8;return function(_0x411267){if(_0x411267){return _0x2aff1c[_0x50e3('0x1f')](_0x5f44e1)[_0x50e3('0x20')](_0x411267);}};}function respondWithFilteredResult(_0x4b1b85,_0x447a60){return function(_0x2d25e6){if(_0x2d25e6){var _0x1b4279=typeof _0x447a60[_0x50e3('0x21')]==='undefined'&&typeof _0x447a60['limit']===_0x50e3('0x22');var _0x5d002b=_0x2d25e6[_0x50e3('0x23')];var _0xcab60a=_0x1b4279?0x0:_0x447a60['offset'];var _0x4d20b1=_0x1b4279?_0x2d25e6[_0x50e3('0x23')]:_0x447a60[_0x50e3('0x21')]+_0x447a60['limit'];var _0x3444e3;if(_0x4d20b1>=_0x5d002b){_0x4d20b1=_0x5d002b;_0x3444e3=0xc8;}else{_0x3444e3=0xce;}_0x4b1b85[_0x50e3('0x1f')](_0x3444e3);return _0x4b1b85[_0x50e3('0x24')](_0x50e3('0x25'),_0xcab60a+'-'+_0x4d20b1+'/'+_0x5d002b)[_0x50e3('0x20')](_0x2d25e6);}return null;};}function patchUpdates(_0x164e11){return function(_0x499b07){try{jsonpatch[_0x50e3('0x26')](_0x499b07,_0x164e11,!![]);}catch(_0x40a78c){return BPromise[_0x50e3('0x27')](_0x40a78c);}return _0x499b07[_0x50e3('0x28')]();};}function saveUpdates(_0x34c68c,_0x283459){return function(_0x3c2e05){if(_0x3c2e05){return _0x3c2e05[_0x50e3('0x29')](_0x34c68c)['then'](function(_0x1b5d10){return _0x1b5d10;});}return null;};}function removeEntity(_0x576c7c,_0x14c06c){return function(_0x15bf54){if(_0x15bf54){return _0x15bf54[_0x50e3('0x2a')]()[_0x50e3('0x2b')](function(){var _0x1162f1=_0x15bf54['get']({'plain':!![]});var _0x5af9a4=_0x50e3('0x2c');return db['UserProfileResource'][_0x50e3('0x2a')]({'where':{'type':_0x5af9a4,'resourceId':_0x1162f1['id']}})['then'](function(){return _0x15bf54;});})['then'](function(){_0x576c7c['status'](0xcc)[_0x50e3('0x2d')]();});}};}function handleEntityNotFound(_0x169fd7,_0x426b1d){return function(_0x131fa2){if(!_0x131fa2){_0x169fd7[_0x50e3('0x1e')](0x194);}return _0x131fa2;};}function handleError(_0x23a5f4,_0x8b7e30){_0x8b7e30=_0x8b7e30||0x1f4;return function(_0x2a028b){logger['error'](_0x2a028b[_0x50e3('0x2e')]);if(_0x2a028b[_0x50e3('0x2f')]){delete _0x2a028b[_0x50e3('0x2f')];}_0x23a5f4['status'](_0x8b7e30)[_0x50e3('0x30')](_0x2a028b);};}exports[_0x50e3('0x31')]=function(_0x412d48,_0x501574){var _0x21c561={},_0x1b34ca={},_0x5c602d={'count':0x0,'rows':[]};var _0x3ac5d0=_[_0x50e3('0x32')](db[_0x50e3('0x33')]['rawAttributes'],function(_0x27a272){return{'name':_0x27a272[_0x50e3('0x34')],'type':_0x27a272[_0x50e3('0x35')][_0x50e3('0x36')]};});_0x1b34ca[_0x50e3('0x37')]=_[_0x50e3('0x32')](_0x3ac5d0,'name');_0x1b34ca[_0x50e3('0x38')]=_[_0x50e3('0x39')](_0x412d48[_0x50e3('0x38')]);_0x1b34ca['filters']=_[_0x50e3('0x3a')](_0x1b34ca[_0x50e3('0x37')],_0x1b34ca['query']);_0x21c561[_0x50e3('0x3b')]=_['intersection'](_0x1b34ca[_0x50e3('0x37')],qs['fields'](_0x412d48[_0x50e3('0x38')]['fields']));_0x21c561[_0x50e3('0x3b')]=_0x21c561['attributes']['length']?_0x21c561[_0x50e3('0x3b')]:_0x1b34ca['model'];if(!_0x412d48[_0x50e3('0x38')][_0x50e3('0x3c')](_0x50e3('0x3d'))){_0x21c561[_0x50e3('0x3e')]=qs[_0x50e3('0x3e')](_0x412d48[_0x50e3('0x38')][_0x50e3('0x3e')]);_0x21c561[_0x50e3('0x21')]=qs['offset'](_0x412d48[_0x50e3('0x38')][_0x50e3('0x21')]);}_0x21c561['order']=qs[_0x50e3('0x3f')](_0x412d48[_0x50e3('0x38')]['sort']);_0x21c561[_0x50e3('0x40')]=qs[_0x50e3('0x41')](_[_0x50e3('0x42')](_0x412d48[_0x50e3('0x38')],_0x1b34ca['filters']),_0x3ac5d0);if(_0x412d48['query'][_0x50e3('0x43')]){_0x21c561['where']=_['merge'](_0x21c561[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0x3ac5d0,function(_0xae1d1d){if(_0xae1d1d['type']!==_0x50e3('0x44')){var _0x34c288={};_0x34c288[_0xae1d1d[_0x50e3('0x2f')]]={'$like':'%'+_0x412d48[_0x50e3('0x38')]['filter']+'%'};return _0x34c288;}})});}_0x21c561=_['merge']({},_0x21c561,_0x412d48[_0x50e3('0x45')]);var _0x1716de={'where':_0x21c561[_0x50e3('0x40')]};return db[_0x50e3('0x33')]['count'](_0x1716de)['then'](function(_0x959df6){_0x5c602d[_0x50e3('0x23')]=_0x959df6;if(_0x412d48[_0x50e3('0x38')][_0x50e3('0x46')]){_0x21c561[_0x50e3('0x47')]=[{'all':!![]}];}return db[_0x50e3('0x33')][_0x50e3('0x48')](_0x21c561);})[_0x50e3('0x2b')](function(_0x39258c){_0x5c602d[_0x50e3('0x49')]=_0x39258c;return _0x5c602d;})[_0x50e3('0x2b')](respondWithFilteredResult(_0x501574,_0x21c561))[_0x50e3('0x4a')](handleError(_0x501574,null));};exports[_0x50e3('0x4b')]=function(_0x521940,_0x45a1b3){var _0x3bdba3={'raw':!![],'where':{'id':_0x521940[_0x50e3('0x4c')]['id']}},_0x3850e2={};_0x3850e2['model']=_[_0x50e3('0x39')](db[_0x50e3('0x33')][_0x50e3('0x4d')]);_0x3850e2['query']=_[_0x50e3('0x39')](_0x521940[_0x50e3('0x38')]);_0x3850e2['filters']=_[_0x50e3('0x3a')](_0x3850e2[_0x50e3('0x37')],_0x3850e2[_0x50e3('0x38')]);_0x3bdba3[_0x50e3('0x3b')]=_[_0x50e3('0x3a')](_0x3850e2[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x521940[_0x50e3('0x38')][_0x50e3('0x4e')]));_0x3bdba3[_0x50e3('0x3b')]=_0x3bdba3[_0x50e3('0x3b')]['length']?_0x3bdba3[_0x50e3('0x3b')]:_0x3850e2[_0x50e3('0x37')];if(_0x521940[_0x50e3('0x38')][_0x50e3('0x46')]){_0x3bdba3[_0x50e3('0x47')]=[{'all':!![]}];}_0x3bdba3=_[_0x50e3('0x4f')]({},_0x3bdba3,_0x521940[_0x50e3('0x45')]);return db[_0x50e3('0x33')][_0x50e3('0x50')](_0x3bdba3)[_0x50e3('0x2b')](handleEntityNotFound(_0x45a1b3,null))['then'](respondWithResult(_0x45a1b3,null))[_0x50e3('0x4a')](handleError(_0x45a1b3,null));};exports[_0x50e3('0x51')]=function(_0x479a12,_0x2d9f33){return db['MailQueue'][_0x50e3('0x51')](_0x479a12[_0x50e3('0x52')],{})[_0x50e3('0x2b')](function(_0x22a12e){var _0x6a14cf=_0x479a12['user']['get']({'plain':!![]});if(!_0x6a14cf)throw new Error(_0x50e3('0x53'));if(_0x6a14cf[_0x50e3('0x54')]==='user'){var _0x125350=_0x22a12e[_0x50e3('0x55')]({'plain':!![]});var _0x77ae2=_0x50e3('0x2c');return db['UserProfileSection'][_0x50e3('0x50')]({'where':{'name':_0x77ae2,'userProfileId':_0x6a14cf['userProfileId']},'raw':!![]})[_0x50e3('0x2b')](function(_0x58a81a){if(_0x58a81a&&_0x58a81a[_0x50e3('0x56')]===0x0){return db[_0x50e3('0x57')][_0x50e3('0x51')]({'name':_0x125350[_0x50e3('0x2f')],'resourceId':_0x125350['id'],'type':_0x58a81a[_0x50e3('0x2f')],'sectionId':_0x58a81a['id']},{})[_0x50e3('0x2b')](function(){return _0x22a12e;});}else{return _0x22a12e;}})[_0x50e3('0x4a')](function(_0x469667){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x469667);throw _0x469667;});}return _0x22a12e;})[_0x50e3('0x2b')](respondWithResult(_0x2d9f33,0xc9))['catch'](handleError(_0x2d9f33,null));};exports[_0x50e3('0x29')]=function(_0x7d7c33,_0x3e8790){if(_0x7d7c33['body']['id']){delete _0x7d7c33[_0x50e3('0x52')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x7d7c33['params']['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x3e8790,null))[_0x50e3('0x2b')](saveUpdates(_0x7d7c33[_0x50e3('0x52')],null))['then'](respondWithResult(_0x3e8790,null))[_0x50e3('0x4a')](handleError(_0x3e8790,null));};exports['destroy']=function(_0x5c9a19,_0x180c25){return db[_0x50e3('0x33')]['find']({'where':{'id':_0x5c9a19[_0x50e3('0x4c')]['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x180c25,null))[_0x50e3('0x2b')](removeEntity(_0x180c25,null))[_0x50e3('0x4a')](handleError(_0x180c25,null));};exports[_0x50e3('0x58')]=function(_0xc17f69,_0x32186f){return db[_0x50e3('0x33')][_0x50e3('0x58')]()[_0x50e3('0x2b')](respondWithResult(_0x32186f,null))[_0x50e3('0x4a')](handleError(_0x32186f,null));};exports[_0x50e3('0x59')]=function(_0x48c947,_0x10ad46,_0x5090b8){var _0xe812={'raw':!![],'where':{}},_0x113800={},_0x4a90b8;return db[_0x50e3('0x33')][_0x50e3('0x5a')]({'where':{'id':_0x48c947[_0x50e3('0x4c')]['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x10ad46,null))[_0x50e3('0x2b')](function(_0x1c38f4){if(_0x1c38f4){_0x4a90b8=_0x1c38f4[_0x50e3('0x55')]({'plain':!![]});_0x113800[_0x50e3('0x37')]=_[_0x50e3('0x39')](db[_0x50e3('0x5b')]['rawAttributes']);_0x113800['query']=_[_0x50e3('0x39')](_0x48c947[_0x50e3('0x38')]);_0x113800[_0x50e3('0x41')]=_[_0x50e3('0x3a')](_0x113800[_0x50e3('0x37')],_0x113800['query']);_0xe812[_0x50e3('0x3b')]=_[_0x50e3('0x3a')](_0x113800[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x48c947[_0x50e3('0x38')][_0x50e3('0x4e')]));_0xe812[_0x50e3('0x3b')]=_0xe812[_0x50e3('0x3b')][_0x50e3('0x5c')]?_0xe812['attributes']:_0x113800[_0x50e3('0x37')];if(!_0x48c947['query']['hasOwnProperty'](_0x50e3('0x3d'))){_0xe812[_0x50e3('0x3e')]=qs[_0x50e3('0x3e')](_0x48c947[_0x50e3('0x38')][_0x50e3('0x3e')]);_0xe812[_0x50e3('0x21')]=qs[_0x50e3('0x21')](_0x48c947['query'][_0x50e3('0x21')]);}_0xe812[_0x50e3('0x5d')]=qs[_0x50e3('0x3f')](_0x48c947[_0x50e3('0x38')][_0x50e3('0x3f')]);_0xe812[_0x50e3('0x40')]=qs['filters'](_['pick'](_0x48c947[_0x50e3('0x38')],_0x113800['filters']));_0xe812[_0x50e3('0x40')][_0x50e3('0x5e')]=_0x1c38f4['id'];if(_0x48c947['query'][_0x50e3('0x43')]){_0xe812[_0x50e3('0x40')]=_['merge'](_0xe812[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0xe812['attributes'],function(_0x2e68f6){var _0x47d559={};_0x47d559[_0x2e68f6]={'$like':'%'+_0x48c947[_0x50e3('0x38')][_0x50e3('0x43')]+'%'};return _0x47d559;})});}_0xe812=_[_0x50e3('0x4f')]({},_0xe812,_0x48c947[_0x50e3('0x45')]);return db['UserMailQueue']['findAll'](_0xe812);}})['then'](function(_0xce5f5f){if(_0xce5f5f){return db[_0x50e3('0x5f')][_0x50e3('0x60')]({'where':{'id':_['map'](_0xce5f5f,_0x50e3('0x61')),'role':'agent'},'attributes':['id','name',_0x50e3('0x62'),_0x50e3('0x63'),_0x50e3('0x64')]});}})[_0x50e3('0x2b')](function(_0x581587){if(_0x581587){return{'count':_0x581587[_0x50e3('0x23')],'rows':_[_0x50e3('0x32')](_0x581587[_0x50e3('0x49')],function(_0x7b61af){return{'membername':_0x7b61af[_0x50e3('0x2f')],'UserId':_0x7b61af['id'],'queue_name':_0x4a90b8[_0x50e3('0x2f')],'MailQueueId':_0x4a90b8['id'],'interface':util[_0x50e3('0x65')]('%s/%s',_0x50e3('0x66'),_0x7b61af[_0x50e3('0x2f')]),'penalty':0x0,'paused':_0x7b61af['mailPause'],'createdAt':_0x7b61af[_0x50e3('0x64')],'updatedAt':_0x7b61af[_0x50e3('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x50e3('0x2b')](respondWithFilteredResult(_0x10ad46,_0xe812))['catch'](handleError(_0x10ad46,null));};exports[_0x50e3('0x67')]=function(_0x5aa1e8,_0x5d4db3,_0x47fd9c){var _0x98b346={};var _0x31689f={};var _0x4adf3d;var _0x14f57d;return db[_0x50e3('0x33')]['findOne']({'where':{'id':_0x5aa1e8['params']['id']}})['then'](handleEntityNotFound(_0x5d4db3,null))[_0x50e3('0x2b')](function(_0x3670dc){if(_0x3670dc){_0x4adf3d=_0x3670dc;_0x31689f['model']=_[_0x50e3('0x39')](db[_0x50e3('0x68')][_0x50e3('0x4d')]);_0x31689f[_0x50e3('0x38')]=_['keys'](_0x5aa1e8['query']);_0x31689f[_0x50e3('0x41')]=_['intersection'](_0x31689f[_0x50e3('0x37')],_0x31689f[_0x50e3('0x38')]);_0x98b346[_0x50e3('0x3b')]=_[_0x50e3('0x3a')](_0x31689f[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x5aa1e8[_0x50e3('0x38')]['fields']));_0x98b346['attributes']=_0x98b346[_0x50e3('0x3b')][_0x50e3('0x5c')]?_0x98b346[_0x50e3('0x3b')]:_0x31689f[_0x50e3('0x37')];_0x98b346[_0x50e3('0x5d')]=qs['sort'](_0x5aa1e8[_0x50e3('0x38')][_0x50e3('0x3f')]);_0x98b346[_0x50e3('0x40')]=qs['filters'](_['pick'](_0x5aa1e8[_0x50e3('0x38')],_0x31689f[_0x50e3('0x41')]));if(_0x5aa1e8['query'][_0x50e3('0x43')]){_0x98b346[_0x50e3('0x40')]=_[_0x50e3('0x4f')](_0x98b346[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0x98b346[_0x50e3('0x3b')],function(_0x4caf37){var _0x30808e={};_0x30808e[_0x4caf37]={'$like':'%'+_0x5aa1e8[_0x50e3('0x38')][_0x50e3('0x43')]+'%'};return _0x30808e;})});}_0x98b346=_['merge']({},_0x98b346,_0x5aa1e8['options']);return _0x4adf3d[_0x50e3('0x67')](_0x98b346);}})[_0x50e3('0x2b')](function(_0x254c2d){if(_0x254c2d){_0x14f57d=_0x254c2d[_0x50e3('0x5c')];if(!_0x5aa1e8[_0x50e3('0x38')][_0x50e3('0x3c')](_0x50e3('0x3d'))){_0x98b346['limit']=qs['limit'](_0x5aa1e8[_0x50e3('0x38')]['limit']);_0x98b346[_0x50e3('0x21')]=qs['offset'](_0x5aa1e8[_0x50e3('0x38')]['offset']);}return _0x4adf3d['getTeams'](_0x98b346);}})[_0x50e3('0x2b')](function(_0x4cdbcc){if(_0x4cdbcc){return _0x4cdbcc?{'count':_0x14f57d,'rows':_0x4cdbcc}:null;}})['then'](respondWithResult(_0x5d4db3,null))[_0x50e3('0x4a')](handleError(_0x5d4db3,null));};exports[_0x50e3('0x69')]=function(_0x1a2d96,_0x4d14f9,_0x5910fc){var _0x29b8d7=_0x1a2d96[_0x50e3('0x52')][_0x50e3('0x6a')];return db['Team'][_0x50e3('0x48')]({'where':{'id':_0x29b8d7},'attributes':['id'],'include':[{'model':db[_0x50e3('0x5f')],'as':'Agents','attributes':['id',_0x50e3('0x2f'),_0x50e3('0x6b'),_0x50e3('0x6c'),_0x50e3('0x6d')],'raw':!![]}]})['then'](function(_0x448140){if(_0x448140){var _0x800a41=_[_0x50e3('0x6e')](_0x448140,function(_0x2b8bda){var _0x13f2e7=_0x2b8bda[_0x50e3('0x55')]({'plain':!![]});return _0x13f2e7['Agents'];});return db[_0x50e3('0x33')][_0x50e3('0x50')]({'where':{'id':_0x1a2d96[_0x50e3('0x4c')]['id']}})['then'](function(_0x21da99){return db[_0x50e3('0x6f')][_0x50e3('0x70')](function(_0x461af0){return _0x21da99['addTeams'](_0x29b8d7,{'transaction':_0x461af0})[_0x50e3('0x2b')](function(){return BPromise[_0x50e3('0x71')](_0x800a41,function(_0x522b5d){return db[_0x50e3('0x5b')]['findOrCreate']({'where':{'UserId':_0x522b5d['id'],'MailQueueId':_0x1a2d96[_0x50e3('0x4c')]['id']},'transaction':_0x461af0});});})[_0x50e3('0x2b')](function(){_0x800a41[_0x50e3('0x72')](function(_0x2d1b04){socket[_0x50e3('0x73')]('userMailQueue:save',{'UserId':_0x2d1b04['id'],'MailQueueId':_0x21da99['id']});});});});});}})[_0x50e3('0x2b')](respondWithStatusCode(_0x4d14f9,null))[_0x50e3('0x4a')](handleError(_0x4d14f9,null));};exports[_0x50e3('0x74')]=function(_0x3b30e9,_0x411c40,_0x269eaf){return db[_0x50e3('0x68')][_0x50e3('0x48')]({'where':{'id':_0x3b30e9['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x50e3('0x75'),'attributes':['id'],'raw':!![]}]})[_0x50e3('0x2b')](handleEntityNotFound(_0x411c40,null))[_0x50e3('0x2b')](function(_0x271b1f){var _0x3f59bd=_[_0x50e3('0x32')](_0x271b1f,'id');var _0x56d0f7=[];var _0x510aa7=[];var _0x229885=squel[_0x50e3('0x76')]();_0x229885[_0x50e3('0x77')](_0x50e3('0x78'))[_0x50e3('0x79')](_0x50e3('0x7a'),'tq')['join'](_0x50e3('0x7b'),'ut',_0x50e3('0x7c'))[_0x50e3('0x40')]('MailQueueId\x20=\x20?',_0x3b30e9[_0x50e3('0x4c')]['id']);for(var _0x46e64b=0x0;_0x46e64b<_0x271b1f[_0x50e3('0x5c')];_0x46e64b+=0x1){let _0x35891a=_0x271b1f[_0x46e64b];for(var _0x3b298b=0x0;_0x3b298b<_0x35891a[_0x50e3('0x75')]['length'];_0x3b298b+=0x1){let _0xeb35b9=_0x35891a[_0x50e3('0x75')][_0x3b298b];var _0x487e87=_0x229885['clone']();_0x487e87[_0x50e3('0x40')]('ut.UserId\x20=\x20?',_0xeb35b9['id']);_0x510aa7[_0x50e3('0x7d')](db[_0x50e3('0x6f')]['query'](_0x487e87[_0x50e3('0x7e')](),{'type':db[_0x50e3('0x6f')]['QueryTypes'][_0x50e3('0x7f')]})[_0x50e3('0x2b')](function(_0x369cc8){if(_0x369cc8[_0x50e3('0x5c')]===0x1){return _0xeb35b9['id'];}else{var _0x101029=_['every'](_['map'](_0x369cc8,'TeamId'),function(_0x1b9404){return _['includes'](_0x3f59bd,_0x1b9404);});if(_0x101029){return _0xeb35b9['id'];}}}));}}return BPromise[_0x50e3('0x80')](_0x510aa7)[_0x50e3('0x2b')](function(_0x474b75){_0x56d0f7=_(_0x56d0f7)['union'](_0x474b75)[_0x50e3('0x81')]()[_0x50e3('0x82')]();return db[_0x50e3('0x33')][_0x50e3('0x50')]({'where':{'id':_0x3b30e9[_0x50e3('0x4c')]['id']}})[_0x50e3('0x2b')](function(_0x3f6d6c){return db[_0x50e3('0x6f')][_0x50e3('0x70')](function(_0x2e6be2){return _0x3f6d6c[_0x50e3('0x74')](_0x3b30e9['query'][_0x50e3('0x6a')],{'transaction':_0x2e6be2})[_0x50e3('0x2b')](function(){if(!_[_0x50e3('0x83')](_0x56d0f7)){return _0x3f6d6c[_0x50e3('0x84')](_0x56d0f7,{'transaction':_0x2e6be2});}})[_0x50e3('0x2b')](function(){_0x56d0f7[_0x50e3('0x72')](function(_0x534987){socket[_0x50e3('0x73')](_0x50e3('0x85'),{'UserId':_0x534987,'MailQueueId':_0x3f6d6c['id']});});});});});});})['then'](respondWithStatusCode(_0x411c40,null))[_0x50e3('0x4a')](handleError(_0x411c40,null));};exports['addAgents']=function(_0x569272,_0x37a43d,_0x195da5){return db[_0x50e3('0x33')][_0x50e3('0x50')]({'where':{'id':_0x569272['params']['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x37a43d,null))[_0x50e3('0x2b')](function(_0x41f6fe){if(_0x41f6fe){return _0x41f6fe[_0x50e3('0x86')](_0x569272[_0x50e3('0x52')]['ids'],_['omit'](_0x569272[_0x50e3('0x52')],[_0x50e3('0x6a'),'id'])||{})[_0x50e3('0x87')](function(_0x31d103){for(var _0xc49655=0x0;_0xc49655<_0x569272['body'][_0x50e3('0x6a')][_0x50e3('0x5c')];_0xc49655+=0x1){socket[_0x50e3('0x73')](_0x50e3('0x88'),{'UserId':Number(_0x569272['body'][_0x50e3('0x6a')][_0xc49655]),'MailQueueId':Number(_0x569272[_0x50e3('0x4c')]['id'])});}return _0x31d103;});}})[_0x50e3('0x2b')](respondWithResult(_0x37a43d,null))['catch'](handleError(_0x37a43d,null));};exports[_0x50e3('0x84')]=function(_0xc39894,_0x43414e,_0x33c1a4){return db['MailQueue'][_0x50e3('0x50')]({'where':{'id':_0xc39894[_0x50e3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43414e,null))[_0x50e3('0x2b')](function(_0x1af26c){if(_0x1af26c){return _0x1af26c[_0x50e3('0x84')](_0xc39894['query']['ids'])[_0x50e3('0x2b')](function(){if(_['isArray'](_0xc39894[_0x50e3('0x38')][_0x50e3('0x6a')])){for(var _0x302f06=0x0;_0x302f06<_0xc39894[_0x50e3('0x38')][_0x50e3('0x6a')][_0x50e3('0x5c')];_0x302f06+=0x1){socket[_0x50e3('0x73')](_0x50e3('0x85'),{'UserId':Number(_0xc39894[_0x50e3('0x38')][_0x50e3('0x6a')][_0x302f06]),'MailQueueId':Number(_0xc39894[_0x50e3('0x4c')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0xc39894['query']['ids']),'MailQueueId':Number(_0xc39894[_0x50e3('0x4c')]['id'])});}});}})[_0x50e3('0x2b')](respondWithStatusCode(_0x43414e,null))[_0x50e3('0x4a')](handleError(_0x43414e,null));};exports['getAgents']=function(_0x49c34b,_0x3879e4,_0x39cbc7){var _0x3ef60f={};var _0x13f0dd={};var _0x5c60e4;var _0x200cd9;return db[_0x50e3('0x33')]['findOne']({'where':{'id':_0x49c34b[_0x50e3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3879e4,null))[_0x50e3('0x2b')](function(_0x51d6eb){if(_0x51d6eb){_0x5c60e4=_0x51d6eb;_0x13f0dd['model']=_[_0x50e3('0x39')](db[_0x50e3('0x5f')]['rawAttributes']);_0x13f0dd['query']=_['keys'](_0x49c34b[_0x50e3('0x38')]);_0x13f0dd['filters']=_[_0x50e3('0x3a')](_0x13f0dd[_0x50e3('0x37')],_0x13f0dd[_0x50e3('0x38')]);_0x3ef60f['attributes']=_['intersection'](_0x13f0dd[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x49c34b['query'][_0x50e3('0x4e')]));_0x3ef60f[_0x50e3('0x3b')]=_0x3ef60f['attributes'][_0x50e3('0x5c')]?_0x3ef60f[_0x50e3('0x3b')]:_0x13f0dd[_0x50e3('0x37')];_0x3ef60f[_0x50e3('0x5d')]=qs[_0x50e3('0x3f')](_0x49c34b['query']['sort']);_0x3ef60f['where']=qs['filters'](_[_0x50e3('0x42')](_0x49c34b[_0x50e3('0x38')],_0x13f0dd[_0x50e3('0x41')]));if(_0x49c34b[_0x50e3('0x38')][_0x50e3('0x43')]){_0x3ef60f[_0x50e3('0x40')]=_[_0x50e3('0x4f')](_0x3ef60f[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0x3ef60f[_0x50e3('0x3b')],function(_0x28cbb9){var _0x13dd50={};_0x13dd50[_0x28cbb9]={'$like':'%'+_0x49c34b['query'][_0x50e3('0x43')]+'%'};return _0x13dd50;})});}_0x3ef60f=_[_0x50e3('0x4f')]({},_0x3ef60f,_0x49c34b[_0x50e3('0x45')]);return _0x5c60e4[_0x50e3('0x89')](_0x3ef60f);}})['then'](function(_0x146334){if(_0x146334){_0x200cd9=_0x146334[_0x50e3('0x5c')];if(!_0x49c34b[_0x50e3('0x38')][_0x50e3('0x3c')](_0x50e3('0x3d'))){_0x3ef60f[_0x50e3('0x3e')]=qs[_0x50e3('0x3e')](_0x49c34b[_0x50e3('0x38')][_0x50e3('0x3e')]);_0x3ef60f[_0x50e3('0x21')]=qs[_0x50e3('0x21')](_0x49c34b['query'][_0x50e3('0x21')]);}return _0x5c60e4[_0x50e3('0x89')](_0x3ef60f);}})[_0x50e3('0x2b')](function(_0x19a296){if(_0x19a296){return _0x19a296?{'count':_0x200cd9,'rows':_0x19a296}:null;}})[_0x50e3('0x2b')](respondWithResult(_0x3879e4,null))[_0x50e3('0x4a')](handleError(_0x3879e4,null));}; \ No newline at end of file +var _0xcf76=['squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','sort','where','filter','merge','VIRTUAL','count','includeAll','include','rows','show','params','fields','length','options','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserMailQueue','rawAttributes','hasOwnProperty','nolimit','order','pick','User','findAndCountAll','UserId','mailPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','findAll','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','field','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','TeamId','includes','union','compact','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x15f343,_0x31875c){var _0x37db9d=function(_0x12a58a){while(--_0x12a58a){_0x15f343['push'](_0x15f343['shift']());}};_0x37db9d(++_0x31875c);}(_0xcf76,0x10d));var _0x6cf7=function(_0x9eefd0,_0x40d55f){_0x9eefd0=_0x9eefd0-0x0;var _0x399fe3=_0xcf76[_0x9eefd0];return _0x399fe3;};'use strict';var emlformat=require(_0x6cf7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6cf7('0x1'));var jsonpatch=require(_0x6cf7('0x2'));var rp=require(_0x6cf7('0x3'));var moment=require(_0x6cf7('0x4'));var BPromise=require(_0x6cf7('0x5'));var Mustache=require(_0x6cf7('0x6'));var util=require(_0x6cf7('0x7'));var path=require(_0x6cf7('0x8'));var sox=require(_0x6cf7('0x9'));var csv=require(_0x6cf7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cf7('0xb'));var _=require(_0x6cf7('0xc'));var squel=require(_0x6cf7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6cf7('0xe'));var deskjs=require(_0x6cf7('0xf'));var toCsv=require(_0x6cf7('0xa'));var querystring=require(_0x6cf7('0x10'));var Papa=require(_0x6cf7('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf7('0x12'));var as=require(_0x6cf7('0x13'));var hardwareService=require(_0x6cf7('0x14'));var logger=require(_0x6cf7('0x15'))(_0x6cf7('0x16'));var utils=require('../../config/utils');var config=require(_0x6cf7('0x17'));var licenseUtil=require(_0x6cf7('0x18'));var db=require('../../mysqldb')['db'];config[_0x6cf7('0x19')]=_[_0x6cf7('0x1a')](config[_0x6cf7('0x19')],{'host':_0x6cf7('0x1b'),'port':0x18eb});var socket=require(_0x6cf7('0x1c'))(new Redis(config[_0x6cf7('0x19')]));require('./mailQueue.socket')[_0x6cf7('0x1d')](socket);function respondWithStatusCode(_0x332d8b,_0x18eb26){_0x18eb26=_0x18eb26||0xcc;return function(_0x1a7371){if(_0x1a7371){return _0x332d8b[_0x6cf7('0x1e')](_0x18eb26);}return _0x332d8b['status'](_0x18eb26)[_0x6cf7('0x1f')]();};}function respondWithResult(_0x464d70,_0x2830b3){_0x2830b3=_0x2830b3||0xc8;return function(_0x58c1b2){if(_0x58c1b2){return _0x464d70[_0x6cf7('0x20')](_0x2830b3)['json'](_0x58c1b2);}};}function respondWithFilteredResult(_0x32fffe,_0x7fed2b){return function(_0xd6b9c0){if(_0xd6b9c0){var _0x3b4a54=typeof _0x7fed2b[_0x6cf7('0x21')]==='undefined'&&typeof _0x7fed2b[_0x6cf7('0x22')]==='undefined';var _0x338b30=_0xd6b9c0['count'];var _0x11601b=_0x3b4a54?0x0:_0x7fed2b[_0x6cf7('0x21')];var _0x1ade3=_0x3b4a54?_0xd6b9c0['count']:_0x7fed2b[_0x6cf7('0x21')]+_0x7fed2b['limit'];var _0x52ce90;if(_0x1ade3>=_0x338b30){_0x1ade3=_0x338b30;_0x52ce90=0xc8;}else{_0x52ce90=0xce;}_0x32fffe['status'](_0x52ce90);return _0x32fffe[_0x6cf7('0x23')](_0x6cf7('0x24'),_0x11601b+'-'+_0x1ade3+'/'+_0x338b30)[_0x6cf7('0x25')](_0xd6b9c0);}return null;};}function patchUpdates(_0x155307){return function(_0x235745){try{jsonpatch[_0x6cf7('0x26')](_0x235745,_0x155307,!![]);}catch(_0x14eb05){return BPromise[_0x6cf7('0x27')](_0x14eb05);}return _0x235745[_0x6cf7('0x28')]();};}function saveUpdates(_0x43607a,_0x676090){return function(_0x222ed3){if(_0x222ed3){return _0x222ed3[_0x6cf7('0x29')](_0x43607a)[_0x6cf7('0x2a')](function(_0x29c840){return _0x29c840;});}return null;};}function removeEntity(_0x4b44f7,_0x59203c){return function(_0x2d8b64){if(_0x2d8b64){return _0x2d8b64[_0x6cf7('0x2b')]()['then'](function(){var _0x2f0507=_0x2d8b64[_0x6cf7('0x2c')]({'plain':!![]});var _0x3ff34f=_0x6cf7('0x2d');return db[_0x6cf7('0x2e')][_0x6cf7('0x2b')]({'where':{'type':_0x3ff34f,'resourceId':_0x2f0507['id']}})[_0x6cf7('0x2a')](function(){return _0x2d8b64;});})[_0x6cf7('0x2a')](function(){_0x4b44f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de623,_0x9256f8){return function(_0xcaab36){if(!_0xcaab36){_0x5de623[_0x6cf7('0x1e')](0x194);}return _0xcaab36;};}function handleError(_0x28a148,_0xdd870){_0xdd870=_0xdd870||0x1f4;return function(_0x1a7e0d){logger[_0x6cf7('0x2f')](_0x1a7e0d[_0x6cf7('0x30')]);if(_0x1a7e0d[_0x6cf7('0x31')]){delete _0x1a7e0d['name'];}_0x28a148[_0x6cf7('0x20')](_0xdd870)[_0x6cf7('0x32')](_0x1a7e0d);};}exports[_0x6cf7('0x33')]=function(_0x11e713,_0x31b4af){var _0xc7a2da={},_0x5bce87={},_0x590ea9={'count':0x0,'rows':[]};var _0x28c955=_[_0x6cf7('0x34')](db[_0x6cf7('0x35')]['rawAttributes'],function(_0x351a5b){return{'name':_0x351a5b[_0x6cf7('0x36')],'type':_0x351a5b[_0x6cf7('0x37')][_0x6cf7('0x38')]};});_0x5bce87[_0x6cf7('0x39')]=_[_0x6cf7('0x34')](_0x28c955,'name');_0x5bce87[_0x6cf7('0x3a')]=_[_0x6cf7('0x3b')](_0x11e713[_0x6cf7('0x3a')]);_0x5bce87[_0x6cf7('0x3c')]=_[_0x6cf7('0x3d')](_0x5bce87[_0x6cf7('0x39')],_0x5bce87[_0x6cf7('0x3a')]);_0xc7a2da[_0x6cf7('0x3e')]=_['intersection'](_0x5bce87['model'],qs['fields'](_0x11e713['query']['fields']));_0xc7a2da['attributes']=_0xc7a2da[_0x6cf7('0x3e')]['length']?_0xc7a2da[_0x6cf7('0x3e')]:_0x5bce87[_0x6cf7('0x39')];if(!_0x11e713[_0x6cf7('0x3a')]['hasOwnProperty']('nolimit')){_0xc7a2da[_0x6cf7('0x22')]=qs[_0x6cf7('0x22')](_0x11e713[_0x6cf7('0x3a')][_0x6cf7('0x22')]);_0xc7a2da[_0x6cf7('0x21')]=qs[_0x6cf7('0x21')](_0x11e713[_0x6cf7('0x3a')][_0x6cf7('0x21')]);}_0xc7a2da['order']=qs['sort'](_0x11e713['query'][_0x6cf7('0x3f')]);_0xc7a2da[_0x6cf7('0x40')]=qs[_0x6cf7('0x3c')](_['pick'](_0x11e713[_0x6cf7('0x3a')],_0x5bce87['filters']),_0x28c955);if(_0x11e713[_0x6cf7('0x3a')][_0x6cf7('0x41')]){_0xc7a2da[_0x6cf7('0x40')]=_[_0x6cf7('0x42')](_0xc7a2da['where'],{'$or':_[_0x6cf7('0x34')](_0x28c955,function(_0x527bc0){if(_0x527bc0[_0x6cf7('0x37')]!==_0x6cf7('0x43')){var _0x351d11={};_0x351d11[_0x527bc0[_0x6cf7('0x31')]]={'$like':'%'+_0x11e713['query']['filter']+'%'};return _0x351d11;}})});}_0xc7a2da=_[_0x6cf7('0x42')]({},_0xc7a2da,_0x11e713['options']);var _0x1e2cc2={'where':_0xc7a2da['where']};return db[_0x6cf7('0x35')][_0x6cf7('0x44')](_0x1e2cc2)[_0x6cf7('0x2a')](function(_0x4702d9){_0x590ea9['count']=_0x4702d9;if(_0x11e713[_0x6cf7('0x3a')][_0x6cf7('0x45')]){_0xc7a2da[_0x6cf7('0x46')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0xc7a2da);})[_0x6cf7('0x2a')](function(_0x4ba428){_0x590ea9[_0x6cf7('0x47')]=_0x4ba428;return _0x590ea9;})['then'](respondWithFilteredResult(_0x31b4af,_0xc7a2da))['catch'](handleError(_0x31b4af,null));};exports[_0x6cf7('0x48')]=function(_0x421dd9,_0x482002){var _0x45ac5a={'raw':!![],'where':{'id':_0x421dd9[_0x6cf7('0x49')]['id']}},_0x4b291c={};_0x4b291c['model']=_['keys'](db['MailQueue']['rawAttributes']);_0x4b291c['query']=_[_0x6cf7('0x3b')](_0x421dd9[_0x6cf7('0x3a')]);_0x4b291c[_0x6cf7('0x3c')]=_[_0x6cf7('0x3d')](_0x4b291c[_0x6cf7('0x39')],_0x4b291c[_0x6cf7('0x3a')]);_0x45ac5a[_0x6cf7('0x3e')]=_[_0x6cf7('0x3d')](_0x4b291c[_0x6cf7('0x39')],qs[_0x6cf7('0x4a')](_0x421dd9[_0x6cf7('0x3a')][_0x6cf7('0x4a')]));_0x45ac5a[_0x6cf7('0x3e')]=_0x45ac5a['attributes'][_0x6cf7('0x4b')]?_0x45ac5a['attributes']:_0x4b291c[_0x6cf7('0x39')];if(_0x421dd9[_0x6cf7('0x3a')][_0x6cf7('0x45')]){_0x45ac5a['include']=[{'all':!![]}];}_0x45ac5a=_[_0x6cf7('0x42')]({},_0x45ac5a,_0x421dd9[_0x6cf7('0x4c')]);return db[_0x6cf7('0x35')][_0x6cf7('0x4d')](_0x45ac5a)[_0x6cf7('0x2a')](handleEntityNotFound(_0x482002,null))[_0x6cf7('0x2a')](respondWithResult(_0x482002,null))['catch'](handleError(_0x482002,null));};exports[_0x6cf7('0x4e')]=function(_0x1724d7,_0xb8f1ee){return db[_0x6cf7('0x35')][_0x6cf7('0x4e')](_0x1724d7['body'],{})['then'](function(_0x49fee2){var _0x55ef74=_0x1724d7['user'][_0x6cf7('0x2c')]({'plain':!![]});if(!_0x55ef74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55ef74[_0x6cf7('0x4f')]===_0x6cf7('0x50')){var _0x216a23=_0x49fee2[_0x6cf7('0x2c')]({'plain':!![]});var _0x52ff27=_0x6cf7('0x2d');return db[_0x6cf7('0x51')][_0x6cf7('0x4d')]({'where':{'name':_0x52ff27,'userProfileId':_0x55ef74[_0x6cf7('0x52')]},'raw':!![]})[_0x6cf7('0x2a')](function(_0x1414e0){if(_0x1414e0&&_0x1414e0[_0x6cf7('0x53')]===0x0){return db[_0x6cf7('0x2e')][_0x6cf7('0x4e')]({'name':_0x216a23['name'],'resourceId':_0x216a23['id'],'type':_0x1414e0['name'],'sectionId':_0x1414e0['id']},{})[_0x6cf7('0x2a')](function(){return _0x49fee2;});}else{return _0x49fee2;}})[_0x6cf7('0x54')](function(_0x48cce3){logger[_0x6cf7('0x2f')](_0x6cf7('0x55'),_0x48cce3);throw _0x48cce3;});}return _0x49fee2;})[_0x6cf7('0x2a')](respondWithResult(_0xb8f1ee,0xc9))['catch'](handleError(_0xb8f1ee,null));};exports['update']=function(_0x559579,_0x15517c){if(_0x559579[_0x6cf7('0x56')]['id']){delete _0x559579[_0x6cf7('0x56')]['id'];}return db[_0x6cf7('0x35')][_0x6cf7('0x4d')]({'where':{'id':_0x559579[_0x6cf7('0x49')]['id']}})[_0x6cf7('0x2a')](handleEntityNotFound(_0x15517c,null))['then'](saveUpdates(_0x559579[_0x6cf7('0x56')],null))[_0x6cf7('0x2a')](respondWithResult(_0x15517c,null))[_0x6cf7('0x54')](handleError(_0x15517c,null));};exports[_0x6cf7('0x2b')]=function(_0xd612ee,_0x4d128a){return db['MailQueue'][_0x6cf7('0x4d')]({'where':{'id':_0xd612ee[_0x6cf7('0x49')]['id']}})[_0x6cf7('0x2a')](handleEntityNotFound(_0x4d128a,null))[_0x6cf7('0x2a')](removeEntity(_0x4d128a,null))[_0x6cf7('0x54')](handleError(_0x4d128a,null));};exports[_0x6cf7('0x57')]=function(_0x5b3bd3,_0x596f81){return db['MailQueue'][_0x6cf7('0x57')]()[_0x6cf7('0x2a')](respondWithResult(_0x596f81,null))[_0x6cf7('0x54')](handleError(_0x596f81,null));};exports['getMembers']=function(_0x481c6a,_0x2d2f16,_0x52a44e){var _0x2c9853={'raw':!![],'where':{}},_0x1f06e9={},_0x53aab8;return db['MailQueue'][_0x6cf7('0x58')]({'where':{'id':_0x481c6a['params']['id']}})[_0x6cf7('0x2a')](handleEntityNotFound(_0x2d2f16,null))[_0x6cf7('0x2a')](function(_0xafb8d3){if(_0xafb8d3){_0x53aab8=_0xafb8d3['get']({'plain':!![]});_0x1f06e9[_0x6cf7('0x39')]=_['keys'](db[_0x6cf7('0x59')][_0x6cf7('0x5a')]);_0x1f06e9[_0x6cf7('0x3a')]=_[_0x6cf7('0x3b')](_0x481c6a[_0x6cf7('0x3a')]);_0x1f06e9[_0x6cf7('0x3c')]=_[_0x6cf7('0x3d')](_0x1f06e9[_0x6cf7('0x39')],_0x1f06e9[_0x6cf7('0x3a')]);_0x2c9853['attributes']=_[_0x6cf7('0x3d')](_0x1f06e9[_0x6cf7('0x39')],qs['fields'](_0x481c6a['query'][_0x6cf7('0x4a')]));_0x2c9853[_0x6cf7('0x3e')]=_0x2c9853[_0x6cf7('0x3e')][_0x6cf7('0x4b')]?_0x2c9853['attributes']:_0x1f06e9['model'];if(!_0x481c6a[_0x6cf7('0x3a')][_0x6cf7('0x5b')](_0x6cf7('0x5c'))){_0x2c9853[_0x6cf7('0x22')]=qs[_0x6cf7('0x22')](_0x481c6a['query'][_0x6cf7('0x22')]);_0x2c9853[_0x6cf7('0x21')]=qs[_0x6cf7('0x21')](_0x481c6a[_0x6cf7('0x3a')][_0x6cf7('0x21')]);}_0x2c9853[_0x6cf7('0x5d')]=qs[_0x6cf7('0x3f')](_0x481c6a[_0x6cf7('0x3a')][_0x6cf7('0x3f')]);_0x2c9853['where']=qs[_0x6cf7('0x3c')](_[_0x6cf7('0x5e')](_0x481c6a['query'],_0x1f06e9[_0x6cf7('0x3c')]));_0x2c9853[_0x6cf7('0x40')]['MailQueueId']=_0xafb8d3['id'];if(_0x481c6a['query']['filter']){_0x2c9853[_0x6cf7('0x40')]=_[_0x6cf7('0x42')](_0x2c9853[_0x6cf7('0x40')],{'$or':_[_0x6cf7('0x34')](_0x2c9853[_0x6cf7('0x3e')],function(_0x382c93){var _0x2e9f70={};_0x2e9f70[_0x382c93]={'$like':'%'+_0x481c6a[_0x6cf7('0x3a')][_0x6cf7('0x41')]+'%'};return _0x2e9f70;})});}_0x2c9853=_[_0x6cf7('0x42')]({},_0x2c9853,_0x481c6a['options']);return db[_0x6cf7('0x59')]['findAll'](_0x2c9853);}})[_0x6cf7('0x2a')](function(_0x2a51ef){if(_0x2a51ef){return db[_0x6cf7('0x5f')][_0x6cf7('0x60')]({'where':{'id':_['map'](_0x2a51ef,_0x6cf7('0x61')),'role':'agent'},'attributes':['id','name',_0x6cf7('0x62'),'updatedAt',_0x6cf7('0x63')]});}})[_0x6cf7('0x2a')](function(_0x1c28ab){if(_0x1c28ab){return{'count':_0x1c28ab[_0x6cf7('0x44')],'rows':_[_0x6cf7('0x34')](_0x1c28ab[_0x6cf7('0x47')],function(_0x23de6){return{'membername':_0x23de6[_0x6cf7('0x31')],'UserId':_0x23de6['id'],'queue_name':_0x53aab8[_0x6cf7('0x31')],'MailQueueId':_0x53aab8['id'],'interface':util[_0x6cf7('0x64')](_0x6cf7('0x65'),_0x6cf7('0x66'),_0x23de6[_0x6cf7('0x31')]),'penalty':0x0,'paused':_0x23de6['mailPause'],'createdAt':_0x23de6['createdAt'],'updatedAt':_0x23de6[_0x6cf7('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6cf7('0x2a')](respondWithFilteredResult(_0x2d2f16,_0x2c9853))[_0x6cf7('0x54')](handleError(_0x2d2f16,null));};exports['getTeams']=function(_0x34e050,_0x3b668a,_0x12598a){var _0x21ebd3={};var _0x7b32fd={};var _0x6e7f19;var _0x505c6c;return db['MailQueue'][_0x6cf7('0x58')]({'where':{'id':_0x34e050[_0x6cf7('0x49')]['id']}})[_0x6cf7('0x2a')](handleEntityNotFound(_0x3b668a,null))[_0x6cf7('0x2a')](function(_0x30a47b){if(_0x30a47b){_0x6e7f19=_0x30a47b;_0x7b32fd[_0x6cf7('0x39')]=_[_0x6cf7('0x3b')](db[_0x6cf7('0x68')]['rawAttributes']);_0x7b32fd[_0x6cf7('0x3a')]=_[_0x6cf7('0x3b')](_0x34e050['query']);_0x7b32fd[_0x6cf7('0x3c')]=_[_0x6cf7('0x3d')](_0x7b32fd['model'],_0x7b32fd[_0x6cf7('0x3a')]);_0x21ebd3[_0x6cf7('0x3e')]=_['intersection'](_0x7b32fd[_0x6cf7('0x39')],qs[_0x6cf7('0x4a')](_0x34e050[_0x6cf7('0x3a')][_0x6cf7('0x4a')]));_0x21ebd3[_0x6cf7('0x3e')]=_0x21ebd3[_0x6cf7('0x3e')][_0x6cf7('0x4b')]?_0x21ebd3[_0x6cf7('0x3e')]:_0x7b32fd[_0x6cf7('0x39')];_0x21ebd3[_0x6cf7('0x5d')]=qs[_0x6cf7('0x3f')](_0x34e050['query'][_0x6cf7('0x3f')]);_0x21ebd3[_0x6cf7('0x40')]=qs[_0x6cf7('0x3c')](_['pick'](_0x34e050[_0x6cf7('0x3a')],_0x7b32fd[_0x6cf7('0x3c')]));if(_0x34e050[_0x6cf7('0x3a')]['filter']){_0x21ebd3[_0x6cf7('0x40')]=_[_0x6cf7('0x42')](_0x21ebd3[_0x6cf7('0x40')],{'$or':_[_0x6cf7('0x34')](_0x21ebd3[_0x6cf7('0x3e')],function(_0x4fa34a){var _0x4cb98a={};_0x4cb98a[_0x4fa34a]={'$like':'%'+_0x34e050[_0x6cf7('0x3a')][_0x6cf7('0x41')]+'%'};return _0x4cb98a;})});}_0x21ebd3=_[_0x6cf7('0x42')]({},_0x21ebd3,_0x34e050['options']);return _0x6e7f19[_0x6cf7('0x69')](_0x21ebd3);}})[_0x6cf7('0x2a')](function(_0x4fb96d){if(_0x4fb96d){_0x505c6c=_0x4fb96d['length'];if(!_0x34e050['query'][_0x6cf7('0x5b')]('nolimit')){_0x21ebd3['limit']=qs[_0x6cf7('0x22')](_0x34e050[_0x6cf7('0x3a')][_0x6cf7('0x22')]);_0x21ebd3['offset']=qs[_0x6cf7('0x21')](_0x34e050[_0x6cf7('0x3a')][_0x6cf7('0x21')]);}return _0x6e7f19['getTeams'](_0x21ebd3);}})['then'](function(_0x54b2bf){if(_0x54b2bf){return _0x54b2bf?{'count':_0x505c6c,'rows':_0x54b2bf}:null;}})[_0x6cf7('0x2a')](respondWithResult(_0x3b668a,null))[_0x6cf7('0x54')](handleError(_0x3b668a,null));};exports[_0x6cf7('0x6a')]=function(_0x933087,_0x1cdeed,_0x3d0fed){var _0x24d2ac=_0x933087[_0x6cf7('0x56')][_0x6cf7('0x6b')];return db[_0x6cf7('0x68')][_0x6cf7('0x6c')]({'where':{'id':_0x24d2ac},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6cf7('0x6d'),'attributes':['id','name','online',_0x6cf7('0x6e'),_0x6cf7('0x6f')],'raw':!![]}]})['then'](function(_0x36074e){if(_0x36074e){var _0x3ad890=_[_0x6cf7('0x70')](_0x36074e,function(_0x337cd0){var _0x458a47=_0x337cd0['get']({'plain':!![]});return _0x458a47[_0x6cf7('0x6d')];});return db[_0x6cf7('0x35')][_0x6cf7('0x4d')]({'where':{'id':_0x933087[_0x6cf7('0x49')]['id']}})['then'](function(_0x21375d){return db[_0x6cf7('0x71')]['transaction'](function(_0x11ef0e){return _0x21375d[_0x6cf7('0x6a')](_0x24d2ac,{'transaction':_0x11ef0e})['then'](function(){return BPromise[_0x6cf7('0x72')](_0x3ad890,function(_0x4f332b){return db[_0x6cf7('0x59')][_0x6cf7('0x73')]({'where':{'UserId':_0x4f332b['id'],'MailQueueId':_0x933087[_0x6cf7('0x49')]['id']},'transaction':_0x11ef0e});});})[_0x6cf7('0x2a')](function(){_0x3ad890[_0x6cf7('0x74')](function(_0x3098df){socket[_0x6cf7('0x75')](_0x6cf7('0x76'),{'UserId':_0x3098df['id'],'MailQueueId':_0x21375d['id']});});});});});}})['then'](respondWithStatusCode(_0x1cdeed,null))[_0x6cf7('0x54')](handleError(_0x1cdeed,null));};exports[_0x6cf7('0x77')]=function(_0x8f0ca9,_0x30d3aa,_0x25d7d3){return db[_0x6cf7('0x68')]['findAll']({'where':{'id':_0x8f0ca9[_0x6cf7('0x3a')][_0x6cf7('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6cf7('0x2a')](handleEntityNotFound(_0x30d3aa,null))['then'](function(_0xd3f34){var _0x24f2c6=_[_0x6cf7('0x34')](_0xd3f34,'id');var _0x5875ce=[];var _0x119477=[];var _0xcf1a64=squel['select']();_0xcf1a64[_0x6cf7('0x78')]('tq.TeamId')['from'](_0x6cf7('0x79'),'tq')['join'](_0x6cf7('0x7a'),'ut',_0x6cf7('0x7b'))[_0x6cf7('0x40')](_0x6cf7('0x7c'),_0x8f0ca9[_0x6cf7('0x49')]['id']);for(var _0x216395=0x0;_0x216395<_0xd3f34['length'];_0x216395+=0x1){let _0x8d9ec9=_0xd3f34[_0x216395];for(var _0x1def91=0x0;_0x1def91<_0x8d9ec9[_0x6cf7('0x6d')][_0x6cf7('0x4b')];_0x1def91+=0x1){let _0x55caec=_0x8d9ec9[_0x6cf7('0x6d')][_0x1def91];var _0x8d60e6=_0xcf1a64[_0x6cf7('0x7d')]();_0x8d60e6[_0x6cf7('0x40')](_0x6cf7('0x7e'),_0x55caec['id']);_0x119477[_0x6cf7('0x7f')](db[_0x6cf7('0x71')][_0x6cf7('0x3a')](_0x8d60e6['toString'](),{'type':db[_0x6cf7('0x71')]['QueryTypes'][_0x6cf7('0x80')]})['then'](function(_0x2ef440){if(_0x2ef440[_0x6cf7('0x4b')]===0x1){return _0x55caec['id'];}else{var _0x125bd9=_['every'](_[_0x6cf7('0x34')](_0x2ef440,_0x6cf7('0x81')),function(_0x1ab25d){return _[_0x6cf7('0x82')](_0x24f2c6,_0x1ab25d);});if(_0x125bd9){return _0x55caec['id'];}}}));}}return BPromise['all'](_0x119477)[_0x6cf7('0x2a')](function(_0x1ed703){_0x5875ce=_(_0x5875ce)[_0x6cf7('0x83')](_0x1ed703)[_0x6cf7('0x84')]()['value']();return db['MailQueue'][_0x6cf7('0x4d')]({'where':{'id':_0x8f0ca9['params']['id']}})[_0x6cf7('0x2a')](function(_0x4a9ec2){return db[_0x6cf7('0x71')][_0x6cf7('0x85')](function(_0x587b13){return _0x4a9ec2[_0x6cf7('0x77')](_0x8f0ca9['query'][_0x6cf7('0x6b')],{'transaction':_0x587b13})[_0x6cf7('0x2a')](function(){if(!_[_0x6cf7('0x86')](_0x5875ce)){return _0x4a9ec2[_0x6cf7('0x87')](_0x5875ce,{'transaction':_0x587b13});}})[_0x6cf7('0x2a')](function(){_0x5875ce[_0x6cf7('0x74')](function(_0x13b08e){socket[_0x6cf7('0x75')](_0x6cf7('0x88'),{'UserId':_0x13b08e,'MailQueueId':_0x4a9ec2['id']});});});});});});})[_0x6cf7('0x2a')](respondWithStatusCode(_0x30d3aa,null))[_0x6cf7('0x54')](handleError(_0x30d3aa,null));};exports['addAgents']=function(_0x19f28d,_0x4547b7,_0x39e09b){return db['MailQueue'][_0x6cf7('0x4d')]({'where':{'id':_0x19f28d[_0x6cf7('0x49')]['id']}})[_0x6cf7('0x2a')](handleEntityNotFound(_0x4547b7,null))[_0x6cf7('0x2a')](function(_0x5a2d9e){if(_0x5a2d9e){return _0x5a2d9e[_0x6cf7('0x89')](_0x19f28d[_0x6cf7('0x56')][_0x6cf7('0x6b')],_[_0x6cf7('0x8a')](_0x19f28d[_0x6cf7('0x56')],['ids','id'])||{})[_0x6cf7('0x8b')](function(_0x5eb599){for(var _0xab62bf=0x0;_0xab62bf<_0x19f28d[_0x6cf7('0x56')][_0x6cf7('0x6b')][_0x6cf7('0x4b')];_0xab62bf+=0x1){socket[_0x6cf7('0x75')](_0x6cf7('0x76'),{'UserId':Number(_0x19f28d[_0x6cf7('0x56')][_0x6cf7('0x6b')][_0xab62bf]),'MailQueueId':Number(_0x19f28d[_0x6cf7('0x49')]['id'])});}return _0x5eb599;});}})['then'](respondWithResult(_0x4547b7,null))[_0x6cf7('0x54')](handleError(_0x4547b7,null));};exports['removeAgents']=function(_0x29db43,_0x29f6ee,_0x3819cd){return db[_0x6cf7('0x35')][_0x6cf7('0x4d')]({'where':{'id':_0x29db43[_0x6cf7('0x49')]['id']}})[_0x6cf7('0x2a')](handleEntityNotFound(_0x29f6ee,null))[_0x6cf7('0x2a')](function(_0x30a1f0){if(_0x30a1f0){return _0x30a1f0['removeAgents'](_0x29db43['query'][_0x6cf7('0x6b')])['then'](function(){if(_['isArray'](_0x29db43[_0x6cf7('0x3a')][_0x6cf7('0x6b')])){for(var _0x25f740=0x0;_0x25f740<_0x29db43['query'][_0x6cf7('0x6b')][_0x6cf7('0x4b')];_0x25f740+=0x1){socket[_0x6cf7('0x75')]('userMailQueue:remove',{'UserId':Number(_0x29db43[_0x6cf7('0x3a')]['ids'][_0x25f740]),'MailQueueId':Number(_0x29db43[_0x6cf7('0x49')]['id'])});}}else{socket[_0x6cf7('0x75')](_0x6cf7('0x88'),{'UserId':Number(_0x29db43[_0x6cf7('0x3a')][_0x6cf7('0x6b')]),'MailQueueId':Number(_0x29db43[_0x6cf7('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x29f6ee,null))[_0x6cf7('0x54')](handleError(_0x29f6ee,null));};exports[_0x6cf7('0x8c')]=function(_0x2c991f,_0x21a81f,_0x56cac8){var _0x2491a2={};var _0x1a39ec={};var _0x195787;var _0x40959c;return db[_0x6cf7('0x35')][_0x6cf7('0x58')]({'where':{'id':_0x2c991f['params']['id']}})['then'](handleEntityNotFound(_0x21a81f,null))[_0x6cf7('0x2a')](function(_0x3c3cc0){if(_0x3c3cc0){_0x195787=_0x3c3cc0;_0x1a39ec['model']=_[_0x6cf7('0x3b')](db[_0x6cf7('0x5f')]['rawAttributes']);_0x1a39ec['query']=_[_0x6cf7('0x3b')](_0x2c991f['query']);_0x1a39ec[_0x6cf7('0x3c')]=_[_0x6cf7('0x3d')](_0x1a39ec[_0x6cf7('0x39')],_0x1a39ec['query']);_0x2491a2[_0x6cf7('0x3e')]=_['intersection'](_0x1a39ec['model'],qs[_0x6cf7('0x4a')](_0x2c991f['query'][_0x6cf7('0x4a')]));_0x2491a2[_0x6cf7('0x3e')]=_0x2491a2[_0x6cf7('0x3e')][_0x6cf7('0x4b')]?_0x2491a2[_0x6cf7('0x3e')]:_0x1a39ec[_0x6cf7('0x39')];_0x2491a2[_0x6cf7('0x5d')]=qs[_0x6cf7('0x3f')](_0x2c991f[_0x6cf7('0x3a')][_0x6cf7('0x3f')]);_0x2491a2[_0x6cf7('0x40')]=qs['filters'](_['pick'](_0x2c991f['query'],_0x1a39ec['filters']));if(_0x2c991f[_0x6cf7('0x3a')]['filter']){_0x2491a2[_0x6cf7('0x40')]=_['merge'](_0x2491a2['where'],{'$or':_[_0x6cf7('0x34')](_0x2491a2[_0x6cf7('0x3e')],function(_0x527570){var _0x17ae38={};_0x17ae38[_0x527570]={'$like':'%'+_0x2c991f[_0x6cf7('0x3a')][_0x6cf7('0x41')]+'%'};return _0x17ae38;})});}_0x2491a2=_[_0x6cf7('0x42')]({},_0x2491a2,_0x2c991f[_0x6cf7('0x4c')]);return _0x195787[_0x6cf7('0x8c')](_0x2491a2);}})[_0x6cf7('0x2a')](function(_0x31ceee){if(_0x31ceee){_0x40959c=_0x31ceee['length'];if(!_0x2c991f['query'][_0x6cf7('0x5b')]('nolimit')){_0x2491a2[_0x6cf7('0x22')]=qs[_0x6cf7('0x22')](_0x2c991f[_0x6cf7('0x3a')][_0x6cf7('0x22')]);_0x2491a2[_0x6cf7('0x21')]=qs[_0x6cf7('0x21')](_0x2c991f[_0x6cf7('0x3a')]['offset']);}return _0x195787[_0x6cf7('0x8c')](_0x2491a2);}})[_0x6cf7('0x2a')](function(_0x236505){if(_0x236505){return _0x236505?{'count':_0x40959c,'rows':_0x236505}:null;}})[_0x6cf7('0x2a')](respondWithResult(_0x21a81f,null))[_0x6cf7('0x54')](handleError(_0x21a81f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index a0c571c..449b8e7 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 _0xabe7=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','save','update'];(function(_0x2b7663,_0x17020d){var _0x13df95=function(_0x3e789e){while(--_0x3e789e){_0x2b7663['push'](_0x2b7663['shift']());}};_0x13df95(++_0x17020d);}(_0xabe7,0x190));var _0x7abe=function(_0x50b21c,_0x2696a5){_0x50b21c=_0x50b21c-0x0;var _0x48b899=_0xabe7[_0x50b21c];return _0x48b899;};'use strict';var EventEmitter=require(_0x7abe('0x0'));var MailQueue=require(_0x7abe('0x1'))['db'][_0x7abe('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7abe('0x3'),'afterUpdate':_0x7abe('0x4'),'afterDestroy':_0x7abe('0x5')};function emitEvent(_0x2fe582){return function(_0x511675,_0x4b4f92,_0x5331af){MailQueueEvents[_0x7abe('0x6')](_0x2fe582+':'+_0x511675['id'],_0x511675);MailQueueEvents[_0x7abe('0x6')](_0x2fe582,_0x511675);_0x5331af(null);};}for(var e in events){if(events[_0x7abe('0x7')](e)){var event=events[e];MailQueue[_0x7abe('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x02ca=['events','MailQueue','setMaxListeners','save','update','remove','emit','exports'];(function(_0x379e64,_0x348013){var _0x33992e=function(_0x2b1bc7){while(--_0x2b1bc7){_0x379e64['push'](_0x379e64['shift']());}};_0x33992e(++_0x348013);}(_0x02ca,0x78));var _0xa02c=function(_0x1fa6dd,_0x4b6663){_0x1fa6dd=_0x1fa6dd-0x0;var _0x175d2d=_0x02ca[_0x1fa6dd];return _0x175d2d;};'use strict';var EventEmitter=require(_0xa02c('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xa02c('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa02c('0x2')](0x0);var events={'afterCreate':_0xa02c('0x3'),'afterUpdate':_0xa02c('0x4'),'afterDestroy':_0xa02c('0x5')};function emitEvent(_0x46230c){return function(_0x2a9ed3,_0x3c8d63,_0xe1b365){MailQueueEvents[_0xa02c('0x6')](_0x46230c+':'+_0x2a9ed3['id'],_0x2a9ed3);MailQueueEvents[_0xa02c('0x6')](_0x46230c,_0x2a9ed3);_0xe1b365(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xa02c('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index eb1f395..72d407d 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 _0x66c3=['MailQueue','mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x66c3,0x16e));var _0x366c=function(_0x5e0827,_0x4ff108){_0x5e0827=_0x5e0827-0x0;var _0x1c7143=_0x66c3[_0x5e0827];return _0x1c7143;};'use strict';var _=require(_0x366c('0x0'));var util=require('util');var logger=require(_0x366c('0x1'))(_0x366c('0x2'));var moment=require(_0x366c('0x3'));var BPromise=require(_0x366c('0x4'));var rp=require(_0x366c('0x5'));var fs=require('fs');var path=require(_0x366c('0x6'));var rimraf=require('rimraf');var config=require(_0x366c('0x7'));var attributes=require(_0x366c('0x8'));module[_0x366c('0x9')]=function(_0x354611,_0x293cdf){return _0x354611[_0x366c('0xa')](_0x366c('0xb'),attributes,{'tableName':_0x366c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x050f=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','mail_queues','lodash','util','api','bluebird'];(function(_0x2b0af7,_0x4d41e2){var _0x35ed55=function(_0x3489d){while(--_0x3489d){_0x2b0af7['push'](_0x2b0af7['shift']());}};_0x35ed55(++_0x4d41e2);}(_0x050f,0x125));var _0xf050=function(_0x14807c,_0xddec5b){_0x14807c=_0x14807c-0x0;var _0x333d8d=_0x050f[_0x14807c];return _0x333d8d;};'use strict';var _=require(_0xf050('0x0'));var util=require(_0xf050('0x1'));var logger=require('../../config/logger')(_0xf050('0x2'));var moment=require('moment');var BPromise=require(_0xf050('0x3'));var rp=require(_0xf050('0x4'));var fs=require('fs');var path=require(_0xf050('0x5'));var rimraf=require(_0xf050('0x6'));var config=require(_0xf050('0x7'));var attributes=require(_0xf050('0x8'));module[_0xf050('0x9')]=function(_0x345284,_0x208638){return _0x345284['define']('MailQueue',attributes,{'tableName':_0xf050('0xa'),'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 733a8bf..16ebf6b 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 _0x588f=['ShowMailQueue','MailQueue','find','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug'];(function(_0x1a805b,_0xd1e4d1){var _0x3d6ffe=function(_0x51dc8f){while(--_0x51dc8f){_0x1a805b['push'](_0x1a805b['shift']());}};_0x3d6ffe(++_0xd1e4d1);}(_0x588f,0x194));var _0xf588=function(_0x46a197,_0xbab470){_0x46a197=_0x46a197-0x0;var _0x441b75=_0x588f[_0x46a197];return _0x441b75;};'use strict';var _=require(_0xf588('0x0'));var util=require(_0xf588('0x1'));var moment=require(_0xf588('0x2'));var BPromise=require('bluebird');var rs=require(_0xf588('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf588('0x4'))['db'];var utils=require(_0xf588('0x5'));var logger=require(_0xf588('0x6'))(_0xf588('0x7'));var config=require(_0xf588('0x8'));var jayson=require(_0xf588('0x9'));var client=jayson[_0xf588('0xa')]['http']({'port':0x232a});config[_0xf588('0xb')]=_[_0xf588('0xc')](config[_0xf588('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf588('0xb')]));require(_0xf588('0xd'))['register'](socket);function respondWithRpcPromise(_0x11d69d,_0x558d48,_0x1a1e9f){return new BPromise(function(_0xbc1b23,_0x3bbc90){return client[_0xf588('0xe')](_0x11d69d,_0x1a1e9f)[_0xf588('0xf')](function(_0x182923){logger[_0xf588('0x10')](_0xf588('0x11'),_0x558d48,_0xf588('0x12'));logger['debug'](_0xf588('0x13'),_0x558d48,_0xf588('0x12'),JSON['stringify'](_0x182923));if(_0x182923[_0xf588('0x14')]){if(_0x182923[_0xf588('0x14')][_0xf588('0x15')]===0x1f4){logger[_0xf588('0x14')](_0xf588('0x11'),_0x558d48,_0x182923[_0xf588('0x14')][_0xf588('0x16')]);return _0x3bbc90(_0x182923['error']['message']);}logger[_0xf588('0x14')]('MailQueue,\x20%s,\x20%s',_0x558d48,_0x182923['error'][_0xf588('0x16')]);return _0xbc1b23(_0x182923['error']['message']);}else{logger[_0xf588('0x10')]('MailQueue,\x20%s,\x20%s',_0x558d48,'request\x20sent');_0xbc1b23(_0x182923[_0xf588('0x17')][_0xf588('0x16')]);}})[_0xf588('0x18')](function(_0x1a6704){logger[_0xf588('0x14')](_0xf588('0x11'),_0x558d48,_0x1a6704);_0x3bbc90(_0x1a6704);});});}exports[_0xf588('0x19')]=function(_0x296c3e){var _0x204793=this;return new Promise(function(_0x38dbcc,_0x57431d){return db['MailQueue'][_0xf588('0x1a')]({'raw':_0x296c3e['options']?_0x296c3e[_0xf588('0x1b')][_0xf588('0x1c')]===undefined?!![]:![]:!![],'where':_0x296c3e[_0xf588('0x1b')]?_0x296c3e['options'][_0xf588('0x1d')]||null:null,'attributes':_0x296c3e[_0xf588('0x1b')]?_0x296c3e[_0xf588('0x1b')][_0xf588('0x1e')]||null:null,'limit':_0x296c3e[_0xf588('0x1b')]?_0x296c3e[_0xf588('0x1b')][_0xf588('0x1f')]||null:null,'include':_0x296c3e[_0xf588('0x1b')]?_0x296c3e[_0xf588('0x1b')][_0xf588('0x20')]?_[_0xf588('0x21')](_0x296c3e['options'][_0xf588('0x20')],function(_0x41eac5){return{'model':db[_0x41eac5[_0xf588('0x22')]],'as':_0x41eac5['as'],'attributes':_0x41eac5[_0xf588('0x1e')],'include':_0x41eac5['include']?_['map'](_0x41eac5[_0xf588('0x20')],function(_0x306559){return{'model':db[_0x306559[_0xf588('0x22')]],'as':_0x306559['as'],'attributes':_0x306559[_0xf588('0x1e')],'include':_0x306559['include']?_[_0xf588('0x21')](_0x306559[_0xf588('0x20')],function(_0x23c2fb){return{'model':db[_0x23c2fb[_0xf588('0x22')]],'as':_0x23c2fb['as'],'attributes':_0x23c2fb[_0xf588('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf588('0xf')](function(_0x2dfb10){logger[_0xf588('0x10')](_0xf588('0x19'),_0x296c3e);logger[_0xf588('0x23')](_0xf588('0x19'),_0x296c3e,JSON['stringify'](_0x2dfb10));_0x38dbcc(_0x2dfb10);})[_0xf588('0x18')](function(_0x419843){logger[_0xf588('0x14')](_0xf588('0x19'),_0x419843[_0xf588('0x16')],_0x296c3e);_0x57431d(_0x204793['error'](0x1f4,_0x419843['message']));});});};exports[_0xf588('0x24')]=function(_0x5e9fba){var _0x4673f2=this;return new Promise(function(_0xdf03b7,_0x29419e){return db[_0xf588('0x25')][_0xf588('0x26')]({'raw':_0x5e9fba[_0xf588('0x1b')]?_0x5e9fba[_0xf588('0x1b')][_0xf588('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e9fba[_0xf588('0x1b')]?_0x5e9fba[_0xf588('0x1b')][_0xf588('0x1d')]||null:null,'attributes':_0x5e9fba[_0xf588('0x1b')]?_0x5e9fba[_0xf588('0x1b')][_0xf588('0x1e')]||null:null,'include':_0x5e9fba['options']?_0x5e9fba[_0xf588('0x1b')]['include']?_['map'](_0x5e9fba['options']['include'],function(_0x220527){return{'model':db[_0x220527[_0xf588('0x22')]],'as':_0x220527['as'],'attributes':_0x220527[_0xf588('0x1e')],'include':_0x220527[_0xf588('0x20')]?_[_0xf588('0x21')](_0x220527[_0xf588('0x20')],function(_0x7fa423){return{'model':db[_0x7fa423[_0xf588('0x22')]],'as':_0x7fa423['as'],'attributes':_0x7fa423[_0xf588('0x1e')],'include':_0x7fa423[_0xf588('0x20')]?_['map'](_0x7fa423[_0xf588('0x20')],function(_0x40c9e1){return{'model':db[_0x40c9e1[_0xf588('0x22')]],'as':_0x40c9e1['as'],'attributes':_0x40c9e1[_0xf588('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf588('0xf')](function(_0xe9c4d6){logger[_0xf588('0x10')](_0xf588('0x24'),_0x5e9fba);logger[_0xf588('0x23')](_0xf588('0x24'),_0x5e9fba,JSON[_0xf588('0x27')](_0xe9c4d6));_0xdf03b7(_0xe9c4d6);})['catch'](function(_0x87bc83){logger[_0xf588('0x14')](_0xf588('0x24'),_0x87bc83['message'],_0x5e9fba);_0x29419e(_0x4673f2[_0xf588('0x14')](0x1f4,_0x87bc83['message']));});});}; \ No newline at end of file +var _0x8b88=['then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMailQueue','findAll','options','raw','attributes','include','map','model','info','stringify','catch','ShowMailQueue','MailQueue','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailQueue.socket','request'];(function(_0x32b8f7,_0x1d5f1c){var _0x50207d=function(_0x69f635){while(--_0x69f635){_0x32b8f7['push'](_0x32b8f7['shift']());}};_0x50207d(++_0x1d5f1c);}(_0x8b88,0x14f));var _0x88b8=function(_0x5c90cf,_0x1c5c30){_0x5c90cf=_0x5c90cf-0x0;var _0x49254d=_0x8b88[_0x5c90cf];return _0x49254d;};'use strict';var _=require('lodash');var util=require(_0x88b8('0x0'));var moment=require('moment');var BPromise=require(_0x88b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88b8('0x2'));var db=require(_0x88b8('0x3'))['db'];var utils=require(_0x88b8('0x4'));var logger=require(_0x88b8('0x5'))(_0x88b8('0x6'));var config=require(_0x88b8('0x7'));var jayson=require(_0x88b8('0x8'));var client=jayson[_0x88b8('0x9')][_0x88b8('0xa')]({'port':0x232a});config[_0x88b8('0xb')]=_[_0x88b8('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x88b8('0xd'))(new Redis(config[_0x88b8('0xb')]));require(_0x88b8('0xe'))['register'](socket);function respondWithRpcPromise(_0x2650c0,_0x301cb3,_0x1edf61){return new BPromise(function(_0x5559a4,_0x73bdd4){return client[_0x88b8('0xf')](_0x2650c0,_0x1edf61)[_0x88b8('0x10')](function(_0x51b6f2){logger['info'](_0x88b8('0x11'),_0x301cb3,_0x88b8('0x12'));logger[_0x88b8('0x13')](_0x88b8('0x14'),_0x301cb3,'request\x20sent',JSON['stringify'](_0x51b6f2));if(_0x51b6f2[_0x88b8('0x15')]){if(_0x51b6f2['error'][_0x88b8('0x16')]===0x1f4){logger[_0x88b8('0x15')]('MailQueue,\x20%s,\x20%s',_0x301cb3,_0x51b6f2[_0x88b8('0x15')][_0x88b8('0x17')]);return _0x73bdd4(_0x51b6f2[_0x88b8('0x15')]['message']);}logger['error'](_0x88b8('0x11'),_0x301cb3,_0x51b6f2['error'][_0x88b8('0x17')]);return _0x5559a4(_0x51b6f2[_0x88b8('0x15')][_0x88b8('0x17')]);}else{logger['info'](_0x88b8('0x11'),_0x301cb3,_0x88b8('0x12'));_0x5559a4(_0x51b6f2[_0x88b8('0x18')][_0x88b8('0x17')]);}})['catch'](function(_0x416633){logger[_0x88b8('0x15')](_0x88b8('0x11'),_0x301cb3,_0x416633);_0x73bdd4(_0x416633);});});}exports[_0x88b8('0x19')]=function(_0x3f412c){var _0x2cc7df=this;return new Promise(function(_0x2fc8f6,_0x4c38ef){return db['MailQueue'][_0x88b8('0x1a')]({'raw':_0x3f412c[_0x88b8('0x1b')]?_0x3f412c[_0x88b8('0x1b')][_0x88b8('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f412c[_0x88b8('0x1b')]?_0x3f412c[_0x88b8('0x1b')]['where']||null:null,'attributes':_0x3f412c[_0x88b8('0x1b')]?_0x3f412c[_0x88b8('0x1b')][_0x88b8('0x1d')]||null:null,'limit':_0x3f412c[_0x88b8('0x1b')]?_0x3f412c[_0x88b8('0x1b')]['limit']||null:null,'include':_0x3f412c[_0x88b8('0x1b')]?_0x3f412c['options'][_0x88b8('0x1e')]?_[_0x88b8('0x1f')](_0x3f412c['options'][_0x88b8('0x1e')],function(_0x4a90b2){return{'model':db[_0x4a90b2[_0x88b8('0x20')]],'as':_0x4a90b2['as'],'attributes':_0x4a90b2[_0x88b8('0x1d')],'include':_0x4a90b2[_0x88b8('0x1e')]?_[_0x88b8('0x1f')](_0x4a90b2[_0x88b8('0x1e')],function(_0x1139b9){return{'model':db[_0x1139b9['model']],'as':_0x1139b9['as'],'attributes':_0x1139b9['attributes'],'include':_0x1139b9['include']?_['map'](_0x1139b9['include'],function(_0x52f459){return{'model':db[_0x52f459[_0x88b8('0x20')]],'as':_0x52f459['as'],'attributes':_0x52f459[_0x88b8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x88b8('0x10')](function(_0x5e9585){logger[_0x88b8('0x21')](_0x88b8('0x19'),_0x3f412c);logger['debug'](_0x88b8('0x19'),_0x3f412c,JSON[_0x88b8('0x22')](_0x5e9585));_0x2fc8f6(_0x5e9585);})[_0x88b8('0x23')](function(_0x165235){logger[_0x88b8('0x15')](_0x88b8('0x19'),_0x165235[_0x88b8('0x17')],_0x3f412c);_0x4c38ef(_0x2cc7df[_0x88b8('0x15')](0x1f4,_0x165235[_0x88b8('0x17')]));});});};exports[_0x88b8('0x24')]=function(_0x4bc2b6){var _0x39030c=this;return new Promise(function(_0x13c800,_0x1a156a){return db[_0x88b8('0x25')][_0x88b8('0x26')]({'raw':_0x4bc2b6[_0x88b8('0x1b')]?_0x4bc2b6[_0x88b8('0x1b')][_0x88b8('0x1c')]===undefined?!![]:![]:!![],'where':_0x4bc2b6[_0x88b8('0x1b')]?_0x4bc2b6[_0x88b8('0x1b')]['where']||null:null,'attributes':_0x4bc2b6[_0x88b8('0x1b')]?_0x4bc2b6[_0x88b8('0x1b')]['attributes']||null:null,'include':_0x4bc2b6[_0x88b8('0x1b')]?_0x4bc2b6[_0x88b8('0x1b')][_0x88b8('0x1e')]?_['map'](_0x4bc2b6[_0x88b8('0x1b')]['include'],function(_0x56f034){return{'model':db[_0x56f034[_0x88b8('0x20')]],'as':_0x56f034['as'],'attributes':_0x56f034['attributes'],'include':_0x56f034[_0x88b8('0x1e')]?_[_0x88b8('0x1f')](_0x56f034[_0x88b8('0x1e')],function(_0x36be10){return{'model':db[_0x36be10[_0x88b8('0x20')]],'as':_0x36be10['as'],'attributes':_0x36be10[_0x88b8('0x1d')],'include':_0x36be10[_0x88b8('0x1e')]?_[_0x88b8('0x1f')](_0x36be10['include'],function(_0x9291c2){return{'model':db[_0x9291c2[_0x88b8('0x20')]],'as':_0x9291c2['as'],'attributes':_0x9291c2[_0x88b8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x407351){logger[_0x88b8('0x21')](_0x88b8('0x24'),_0x4bc2b6);logger[_0x88b8('0x13')](_0x88b8('0x24'),_0x4bc2b6,JSON['stringify'](_0x407351));_0x13c800(_0x407351);})[_0x88b8('0x23')](function(_0x545780){logger[_0x88b8('0x15')](_0x88b8('0x24'),_0x545780['message'],_0x4bc2b6);_0x1a156a(_0x39030c['error'](0x1f4,_0x545780[_0x88b8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index b08aa4c..0952344 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 _0x6718=['remove','update','emit','removeListener','register','length','./mailQueue.events','save'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x6718,0xde));var _0x8671=function(_0x5c6272,_0xd82df5){_0x5c6272=_0x5c6272-0x0;var _0x19c236=_0x6718[_0x5c6272];return _0x19c236;};'use strict';var MailQueueEvents=require(_0x8671('0x0'));var events=[_0x8671('0x1'),_0x8671('0x2'),_0x8671('0x3')];function createListener(_0x5d5a50,_0x15a094){return function(_0x5a2c6a){_0x15a094[_0x8671('0x4')](_0x5d5a50,_0x5a2c6a);};}function removeListener(_0x46baea,_0x26f0f2){return function(){MailQueueEvents[_0x8671('0x5')](_0x46baea,_0x26f0f2);};}exports[_0x8671('0x6')]=function(_0x3155bd){for(var _0x38a0d5=0x0,_0x2a00eb=events[_0x8671('0x7')];_0x38a0d5<_0x2a00eb;_0x38a0d5++){var _0x56a55e=events[_0x38a0d5];var _0x41986d=createListener('mailQueue:'+_0x56a55e,_0x3155bd);MailQueueEvents['on'](_0x56a55e,_0x41986d);}}; \ No newline at end of file +var _0x4a65=['register','length','mailQueue:','save','remove','update','removeListener'];(function(_0xc4f1f0,_0x1bfb65){var _0x1322a3=function(_0x2c346e){while(--_0x2c346e){_0xc4f1f0['push'](_0xc4f1f0['shift']());}};_0x1322a3(++_0x1bfb65);}(_0x4a65,0x16f));var _0x54a6=function(_0x497e59,_0x3347f0){_0x497e59=_0x497e59-0x0;var _0x52cad8=_0x4a65[_0x497e59];return _0x52cad8;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x54a6('0x0'),_0x54a6('0x1'),_0x54a6('0x2')];function createListener(_0x924cbf,_0x261317){return function(_0x21c48b){_0x261317['emit'](_0x924cbf,_0x21c48b);};}function removeListener(_0x10aeda,_0x1b9f30){return function(){MailQueueEvents[_0x54a6('0x3')](_0x10aeda,_0x1b9f30);};}exports[_0x54a6('0x4')]=function(_0x1ecc17){for(var _0xc9e68a=0x0,_0x2b6544=events[_0x54a6('0x5')];_0xc9e68a<_0x2b6544;_0xc9e68a++){var _0x40e769=events[_0xc9e68a];var _0xb61d06=createListener(_0x54a6('0x6')+_0x40e769,_0x1ecc17);MailQueueEvents['on'](_0x40e769,_0xb61d06);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 107143f..b292e81 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 _0xa6de=['show','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0xa6de,0x8a));var _0xea6d=function(_0x512550,_0x6a8b6f){_0x512550=_0x512550-0x0;var _0x19f661=_0xa6de[_0x512550];return _0x19f661;};'use strict';var multer=require('multer');var util=require(_0xea6d('0x0'));var path=require(_0xea6d('0x1'));var timeout=require(_0xea6d('0x2'));var express=require(_0xea6d('0x3'));var router=express[_0xea6d('0x4')]();var fs_extra=require(_0xea6d('0x5'));var auth=require(_0xea6d('0x6'));var interaction=require(_0xea6d('0x7'));var config=require(_0xea6d('0x8'));var controller=require(_0xea6d('0x9'));router[_0xea6d('0xa')]('/',auth[_0xea6d('0xb')](),controller[_0xea6d('0xc')]);router['get'](_0xea6d('0xd'),auth[_0xea6d('0xb')](),controller[_0xea6d('0xe')]);router[_0xea6d('0xa')](_0xea6d('0xf'),auth[_0xea6d('0xb')](),controller[_0xea6d('0x10')]);router[_0xea6d('0x11')]('/',auth[_0xea6d('0xb')](),controller[_0xea6d('0x12')]);router['put']('/:id',auth[_0xea6d('0xb')](),controller[_0xea6d('0x13')]);router['delete'](_0xea6d('0xf'),auth[_0xea6d('0xb')](),controller[_0xea6d('0x14')]);module[_0xea6d('0x15')]=router; \ No newline at end of file +var _0xe1e3=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout'];(function(_0x1ddbd0,_0x226a99){var _0x29cf60=function(_0x2f0e6d){while(--_0x2f0e6d){_0x1ddbd0['push'](_0x1ddbd0['shift']());}};_0x29cf60(++_0x226a99);}(_0xe1e3,0xba));var _0x3e1e=function(_0x406ce4,_0x559898){_0x406ce4=_0x406ce4-0x0;var _0x227ae3=_0xe1e3[_0x406ce4];return _0x227ae3;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require('util');var path=require(_0x3e1e('0x1'));var timeout=require(_0x3e1e('0x2'));var express=require(_0x3e1e('0x3'));var router=express[_0x3e1e('0x4')]();var fs_extra=require(_0x3e1e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1e('0x6'));var config=require(_0x3e1e('0x7'));var controller=require(_0x3e1e('0x8'));router['get']('/',auth[_0x3e1e('0x9')](),controller[_0x3e1e('0xa')]);router[_0x3e1e('0xb')](_0x3e1e('0xc'),auth[_0x3e1e('0x9')](),controller[_0x3e1e('0xd')]);router['get'](_0x3e1e('0xe'),auth[_0x3e1e('0x9')](),controller[_0x3e1e('0xf')]);router[_0x3e1e('0x10')]('/',auth[_0x3e1e('0x9')](),controller[_0x3e1e('0x11')]);router[_0x3e1e('0x12')](_0x3e1e('0xe'),auth[_0x3e1e('0x9')](),controller['update']);router[_0x3e1e('0x13')](_0x3e1e('0xe'),auth[_0x3e1e('0x9')](),controller[_0x3e1e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 0c1939b..22a612c 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 _0x50ff=['STRING','DATE','exports'];(function(_0x3e8dbd,_0x1126fd){var _0xff862f=function(_0x3db9cc){while(--_0x3db9cc){_0x3e8dbd['push'](_0x3e8dbd['shift']());}};_0xff862f(++_0x1126fd);}(_0x50ff,0x1c7));var _0xf50f=function(_0x358ad0,_0x3064e7){_0x358ad0=_0x358ad0-0x0;var _0x9957bf=_0x50ff[_0x358ad0];return _0x9957bf;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xf50f('0x0')]={'uniqueid':{'type':Sequelize[_0xf50f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xf50f('0x1')]},'joinAt':{'type':Sequelize[_0xf50f('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf50f('0x2')]},'exitAt':{'type':Sequelize[_0xf50f('0x2')]},'reason':{'type':Sequelize[_0xf50f('0x1')]}}; \ No newline at end of file +var _0x49d6=['sequelize','exports','DATE','STRING','moment'];(function(_0x51a58e,_0x29a792){var _0x709af6=function(_0x22506b){while(--_0x22506b){_0x51a58e['push'](_0x51a58e['shift']());}};_0x709af6(++_0x29a792);}(_0x49d6,0x108));var _0x649d=function(_0x240178,_0x228dc7){_0x240178=_0x240178-0x0;var _0x559bee=_0x49d6[_0x240178];return _0x559bee;};'use strict';var moment=require(_0x649d('0x0'));var Sequelize=require(_0x649d('0x1'));module[_0x649d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x649d('0x3')]},'leaveAt':{'type':Sequelize[_0x649d('0x3')]},'acceptAt':{'type':Sequelize[_0x649d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x649d('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 29da8de..deecedc 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 _0x627e=['limit','count','set','reject','save','then','destroy','error','stack','name','index','MailQueueReport','fieldName','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','rows','catch','params','fields','length','includeAll','include','find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x303eca,_0x2ec9f6){var _0x5e89c1=function(_0x5e59fe){while(--_0x5e59fe){_0x303eca['push'](_0x303eca['shift']());}};_0x5e89c1(++_0x2ec9f6);}(_0x627e,0x14a));var _0xe627=function(_0x541f6f,_0x2527c){_0x541f6f=_0x541f6f-0x0;var _0x1651f9=_0x627e[_0x541f6f];return _0x1651f9;};'use strict';var emlformat=require(_0xe627('0x0'));var rimraf=require(_0xe627('0x1'));var zipdir=require(_0xe627('0x2'));var jsonpatch=require(_0xe627('0x3'));var rp=require(_0xe627('0x4'));var moment=require('moment');var BPromise=require(_0xe627('0x5'));var Mustache=require(_0xe627('0x6'));var util=require(_0xe627('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe627('0x8'));var fs=require('fs');var fs_extra=require(_0xe627('0x9'));var _=require(_0xe627('0xa'));var squel=require(_0xe627('0xb'));var crypto=require(_0xe627('0xc'));var jsforce=require(_0xe627('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe627('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe627('0xf'));var authService=require(_0xe627('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe627('0x11'));var logger=require(_0xe627('0x12'))(_0xe627('0x13'));var utils=require(_0xe627('0x14'));var config=require(_0xe627('0x15'));var licenseUtil=require(_0xe627('0x16'));var db=require(_0xe627('0x17'))['db'];function respondWithStatusCode(_0x3919be,_0x1922f5){_0x1922f5=_0x1922f5||0xcc;return function(_0x582190){if(_0x582190){return _0x3919be[_0xe627('0x18')](_0x1922f5);}return _0x3919be[_0xe627('0x19')](_0x1922f5)[_0xe627('0x1a')]();};}function respondWithResult(_0x4be370,_0x42dd1c){_0x42dd1c=_0x42dd1c||0xc8;return function(_0x1e2e62){if(_0x1e2e62){return _0x4be370[_0xe627('0x19')](_0x42dd1c)[_0xe627('0x1b')](_0x1e2e62);}};}function respondWithFilteredResult(_0x62896f,_0x6a9a15){return function(_0x271325){if(_0x271325){var _0x54720a=typeof _0x6a9a15[_0xe627('0x1c')]===_0xe627('0x1d')&&typeof _0x6a9a15[_0xe627('0x1e')]===_0xe627('0x1d');var _0x403982=_0x271325[_0xe627('0x1f')];var _0x56559b=_0x54720a?0x0:_0x6a9a15[_0xe627('0x1c')];var _0x538b22=_0x54720a?_0x271325[_0xe627('0x1f')]:_0x6a9a15['offset']+_0x6a9a15[_0xe627('0x1e')];var _0x565213;if(_0x538b22>=_0x403982){_0x538b22=_0x403982;_0x565213=0xc8;}else{_0x565213=0xce;}_0x62896f['status'](_0x565213);return _0x62896f[_0xe627('0x20')]('Content-Range',_0x56559b+'-'+_0x538b22+'/'+_0x403982)[_0xe627('0x1b')](_0x271325);}return null;};}function patchUpdates(_0x3391ce){return function(_0x4adde7){try{jsonpatch['apply'](_0x4adde7,_0x3391ce,!![]);}catch(_0x4ecfa6){return BPromise[_0xe627('0x21')](_0x4ecfa6);}return _0x4adde7[_0xe627('0x22')]();};}function saveUpdates(_0x4e3338,_0x708a8a){return function(_0x33cb27){if(_0x33cb27){return _0x33cb27['update'](_0x4e3338)[_0xe627('0x23')](function(_0x29221b){return _0x29221b;});}return null;};}function removeEntity(_0x52d492,_0x42f3d1){return function(_0x19adbc){if(_0x19adbc){return _0x19adbc[_0xe627('0x24')]()['then'](function(){_0x52d492[_0xe627('0x19')](0xcc)[_0xe627('0x1a')]();});}};}function handleEntityNotFound(_0x1a5081,_0x3ddd8d){return function(_0x4b9ff9){if(!_0x4b9ff9){_0x1a5081[_0xe627('0x18')](0x194);}return _0x4b9ff9;};}function handleError(_0x1fe192,_0x1635a0){_0x1635a0=_0x1635a0||0x1f4;return function(_0x29eb8e){logger[_0xe627('0x25')](_0x29eb8e[_0xe627('0x26')]);if(_0x29eb8e[_0xe627('0x27')]){delete _0x29eb8e[_0xe627('0x27')];}_0x1fe192[_0xe627('0x19')](_0x1635a0)['send'](_0x29eb8e);};}exports[_0xe627('0x28')]=function(_0x5aeba1,_0x5cd7c8){var _0x1e0bd7={},_0xdf63c8={},_0x5799a3={'count':0x0,'rows':[]};var _0x39c23f=_['map'](db[_0xe627('0x29')]['rawAttributes'],function(_0x262253){return{'name':_0x262253[_0xe627('0x2a')],'type':_0x262253['type'][_0xe627('0x2b')]};});_0xdf63c8['model']=_[_0xe627('0x2c')](_0x39c23f,_0xe627('0x27'));_0xdf63c8[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x5aeba1[_0xe627('0x2d')]);_0xdf63c8[_0xe627('0x2f')]=_[_0xe627('0x30')](_0xdf63c8[_0xe627('0x31')],_0xdf63c8[_0xe627('0x2d')]);_0x1e0bd7[_0xe627('0x32')]=_[_0xe627('0x30')](_0xdf63c8['model'],qs['fields'](_0x5aeba1[_0xe627('0x2d')]['fields']));_0x1e0bd7[_0xe627('0x32')]=_0x1e0bd7['attributes']['length']?_0x1e0bd7[_0xe627('0x32')]:_0xdf63c8['model'];if(!_0x5aeba1['query'][_0xe627('0x33')](_0xe627('0x34'))){_0x1e0bd7[_0xe627('0x1e')]=qs['limit'](_0x5aeba1['query']['limit']);_0x1e0bd7[_0xe627('0x1c')]=qs['offset'](_0x5aeba1[_0xe627('0x2d')][_0xe627('0x1c')]);}_0x1e0bd7['order']=qs[_0xe627('0x35')](_0x5aeba1[_0xe627('0x2d')]['sort']);_0x1e0bd7[_0xe627('0x36')]=qs[_0xe627('0x2f')](_[_0xe627('0x37')](_0x5aeba1[_0xe627('0x2d')],_0xdf63c8[_0xe627('0x2f')]),_0x39c23f);if(_0x5aeba1[_0xe627('0x2d')]['filter']){_0x1e0bd7[_0xe627('0x36')]=_['merge'](_0x1e0bd7[_0xe627('0x36')],{'$or':_['map'](_0x39c23f,function(_0xe90eda){if(_0xe90eda[_0xe627('0x38')]!==_0xe627('0x39')){var _0x21a533={};_0x21a533[_0xe90eda[_0xe627('0x27')]]={'$like':'%'+_0x5aeba1[_0xe627('0x2d')][_0xe627('0x3a')]+'%'};return _0x21a533;}})});}_0x1e0bd7=_[_0xe627('0x3b')]({},_0x1e0bd7,_0x5aeba1[_0xe627('0x3c')]);var _0x415a25={'where':_0x1e0bd7[_0xe627('0x36')]};return db[_0xe627('0x29')][_0xe627('0x1f')](_0x415a25)['then'](function(_0x4ddff5){_0x5799a3['count']=_0x4ddff5;if(_0x5aeba1['query']['includeAll']){_0x1e0bd7['include']=[{'all':!![]}];}return db[_0xe627('0x29')]['findAll'](_0x1e0bd7);})[_0xe627('0x23')](function(_0x59cd6a){_0x5799a3[_0xe627('0x3d')]=_0x59cd6a;return _0x5799a3;})[_0xe627('0x23')](respondWithFilteredResult(_0x5cd7c8,_0x1e0bd7))[_0xe627('0x3e')](handleError(_0x5cd7c8,null));};exports['show']=function(_0x58e110,_0x26064c){var _0x5f3374={'raw':!![],'where':{'id':_0x58e110[_0xe627('0x3f')]['id']}},_0x5e352e={};_0x5e352e['model']=_[_0xe627('0x2e')](db['MailQueueReport']['rawAttributes']);_0x5e352e[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x58e110[_0xe627('0x2d')]);_0x5e352e['filters']=_['intersection'](_0x5e352e[_0xe627('0x31')],_0x5e352e['query']);_0x5f3374['attributes']=_[_0xe627('0x30')](_0x5e352e[_0xe627('0x31')],qs[_0xe627('0x40')](_0x58e110[_0xe627('0x2d')][_0xe627('0x40')]));_0x5f3374[_0xe627('0x32')]=_0x5f3374['attributes'][_0xe627('0x41')]?_0x5f3374[_0xe627('0x32')]:_0x5e352e['model'];if(_0x58e110['query'][_0xe627('0x42')]){_0x5f3374[_0xe627('0x43')]=[{'all':!![]}];}_0x5f3374=_[_0xe627('0x3b')]({},_0x5f3374,_0x58e110[_0xe627('0x3c')]);return db[_0xe627('0x29')][_0xe627('0x44')](_0x5f3374)[_0xe627('0x23')](handleEntityNotFound(_0x26064c,null))['then'](respondWithResult(_0x26064c,null))[_0xe627('0x3e')](handleError(_0x26064c,null));};exports['create']=function(_0x648456,_0xcd19f5){return db[_0xe627('0x29')]['create'](_0x648456[_0xe627('0x45')],{})['then'](respondWithResult(_0xcd19f5,0xc9))[_0xe627('0x3e')](handleError(_0xcd19f5,null));};exports[_0xe627('0x46')]=function(_0x375e05,_0x30e057){if(_0x375e05[_0xe627('0x45')]['id']){delete _0x375e05['body']['id'];}return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x375e05[_0xe627('0x3f')]['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x30e057,null))[_0xe627('0x23')](saveUpdates(_0x375e05[_0xe627('0x45')],null))[_0xe627('0x23')](respondWithResult(_0x30e057,null))[_0xe627('0x3e')](handleError(_0x30e057,null));};exports[_0xe627('0x24')]=function(_0x3824da,_0x550b74){return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x3824da['params']['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x550b74,null))[_0xe627('0x23')](removeEntity(_0x550b74,null))['catch'](handleError(_0x550b74,null));};exports[_0xe627('0x47')]=function(_0x3a827e,_0x542a4c){return db[_0xe627('0x29')][_0xe627('0x47')]()['then'](respondWithResult(_0x542a4c,null))[_0xe627('0x3e')](handleError(_0x542a4c,null));}; \ No newline at end of file +var _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','MailQueueReport','fieldName','type','key','model','query','keys'];(function(_0x1abbf4,_0x2f199d){var _0x4c28d9=function(_0x1c5316){while(--_0x1c5316){_0x1abbf4['push'](_0x1abbf4['shift']());}};_0x4c28d9(++_0x2f199d);}(_0xadb5,0xad));var _0x5adb=function(_0x1fc2f8,_0x5f19fc){_0x1fc2f8=_0x1fc2f8-0x0;var _0x3f6d74=_0xadb5[_0x1fc2f8];return _0x3f6d74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['MailQueueReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b5555ac..44bcb09 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 _0x31c2=['report_mail_queue','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','MailQueueReport'];(function(_0x1ae7c8,_0x274e1d){var _0x66aab0=function(_0x3dd2b0){while(--_0x3dd2b0){_0x1ae7c8['push'](_0x1ae7c8['shift']());}};_0x66aab0(++_0x274e1d);}(_0x31c2,0x70));var _0x231c=function(_0x2b965d,_0x347f79){_0x2b965d=_0x2b965d-0x0;var _0x469d83=_0x31c2[_0x2b965d];return _0x469d83;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var logger=require('../../config/logger')(_0x231c('0x2'));var moment=require(_0x231c('0x3'));var BPromise=require('bluebird');var rp=require(_0x231c('0x4'));var fs=require('fs');var path=require(_0x231c('0x5'));var rimraf=require(_0x231c('0x6'));var config=require(_0x231c('0x7'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x3f1118,_0x392af2){return _0x3f1118['define'](_0x231c('0x8'),attributes,{'tableName':_0x231c('0x9'),'paranoid':![],'indexes':[{'name':_0x231c('0xa'),'fields':[_0x231c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb27=['moment','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x49df47,_0x42b818){var _0xa635ef=function(_0x109070){while(--_0x109070){_0x49df47['push'](_0x49df47['shift']());}};_0xa635ef(++_0x42b818);}(_0xcb27,0x19d));var _0x7cb2=function(_0x507ccf,_0xef94c0){_0x507ccf=_0x507ccf-0x0;var _0x3261d1=_0xcb27[_0x507ccf];return _0x3261d1;};'use strict';var _=require(_0x7cb2('0x0'));var util=require('util');var logger=require(_0x7cb2('0x1'))(_0x7cb2('0x2'));var moment=require(_0x7cb2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cb2('0x4'));var rimraf=require(_0x7cb2('0x5'));var config=require(_0x7cb2('0x6'));var attributes=require(_0x7cb2('0x7'));module[_0x7cb2('0x8')]=function(_0x5ce213,_0x327c91){return _0x5ce213[_0x7cb2('0x9')](_0x7cb2('0xa'),attributes,{'tableName':_0x7cb2('0xb'),'paranoid':![],'indexes':[{'name':_0x7cb2('0xc'),'fields':[_0x7cb2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2e2af2a..03d456b 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x413ab1,_0x2a968e){var _0x47c2a8=function(_0x4a3002){while(--_0x4a3002){_0x413ab1['push'](_0x413ab1['shift']());}};_0x47c2a8(++_0x2a968e);}(_0x1261,0x144));var _0x1126=function(_0x135448,_0x4ca19f){_0x135448=_0x135448-0x0;var _0x28389e=_0x1261[_0x135448];return _0x28389e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x49a5c6,_0x1758e4){var _0x3f8dc2=function(_0x1ab3c4){while(--_0x1ab3c4){_0x49a5c6['push'](_0x49a5c6['shift']());}};_0x3f8dc2(++_0x1758e4);}(_0xdb28,0x106));var _0x8db2=function(_0x10a0ac,_0x14721f){_0x10a0ac=_0x10a0ac-0x0;var _0x530a36=_0xdb28[_0x10a0ac];return _0x530a36;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 1b0f899..c6851ce 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x374954,_0x18dc36){var _0x42073e=function(_0x1cb45f){while(--_0x1cb45f){_0x374954['push'](_0x374954['shift']());}};_0x42073e(++_0x18dc36);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x57a634,_0x266a81){var _0x4c47cb=function(_0x4ddfda){while(--_0x4ddfda){_0x57a634['push'](_0x57a634['shift']());}};_0x4c47cb(++_0x266a81);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 38fdef6..5dc4c4f 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 _0x668b=['INTEGER','BOOLEAN','INBOX','exports','STRING'];(function(_0x2f913b,_0x49ac46){var _0x3d8146=function(_0x876aee){while(--_0x876aee){_0x2f913b['push'](_0x2f913b['shift']());}};_0x3d8146(++_0x49ac46);}(_0x668b,0x99));var _0xb668=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x668b[_0x21b359];return _0x57b8e7;};'use strict';var Sequelize=require('sequelize');module[_0xb668('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xb668('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb668('0x2')]},'tls':{'type':Sequelize[_0xb668('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb668('0x1')],'defaultValue':_0xb668('0x4')},'connTimeout':{'type':Sequelize[_0xb668('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xb668('0x1')]},'modernAuthentication':{'type':Sequelize[_0xb668('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x244c=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x45e60e,_0x529bef){var _0x5717a5=function(_0x38d070){while(--_0x38d070){_0x45e60e['push'](_0x45e60e['shift']());}};_0x5717a5(++_0x529bef);}(_0x244c,0x1f0));var _0xc244=function(_0x133473,_0x2b4c9a){_0x133473=_0x133473-0x0;var _0x5bffe3=_0x244c[_0x133473];return _0x5bffe3;};'use strict';var Sequelize=require('sequelize');module[_0xc244('0x0')]={'description':{'type':Sequelize[_0xc244('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xc244('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc244('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xc244('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc244('0x1')],'defaultValue':_0xc244('0x4')},'connTimeout':{'type':Sequelize[_0xc244('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc244('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc244('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e556ec7..c4172aa 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 _0xd9bc=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','mail_servers_in'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xd9bc,0xb0));var _0xcd9b=function(_0x56a019,_0x932b8e){_0x56a019=_0x56a019-0x0;var _0x4ebe59=_0xd9bc[_0x56a019];return _0x4ebe59;};'use strict';var _=require(_0xcd9b('0x0'));var util=require(_0xcd9b('0x1'));var logger=require(_0xcd9b('0x2'))(_0xcd9b('0x3'));var moment=require('moment');var BPromise=require(_0xcd9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd9b('0x5'));var rimraf=require(_0xcd9b('0x6'));var config=require(_0xcd9b('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xcd9b('0x8')]=function(_0x53c685,_0xe1bb28){return _0x53c685[_0xcd9b('0x9')]('MailServerIn',attributes,{'tableName':_0xcd9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe65f=['define','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./mailServerIn.attributes'];(function(_0x2460a5,_0x25293f){var _0x3f1a96=function(_0x4c540d){while(--_0x4c540d){_0x2460a5['push'](_0x2460a5['shift']());}};_0x3f1a96(++_0x25293f);}(_0xe65f,0xe8));var _0xfe65=function(_0x5185c6,_0x4e7c65){_0x5185c6=_0x5185c6-0x0;var _0x1a9c19=_0xe65f[_0x5185c6];return _0x1a9c19;};'use strict';var _=require(_0xfe65('0x0'));var util=require('util');var logger=require(_0xfe65('0x1'))(_0xfe65('0x2'));var moment=require(_0xfe65('0x3'));var BPromise=require(_0xfe65('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe65('0x5'));var rimraf=require(_0xfe65('0x6'));var config=require('../../config/environment');var attributes=require(_0xfe65('0x7'));module['exports']=function(_0x5d2c82,_0x4a78e7){return _0x5d2c82[_0xfe65('0x8')]('MailServerIn',attributes,{'tableName':_0xfe65('0x9'),'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 d3eba8f..bacd0f3 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 _0x636f=['jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x4f441e,_0x31407b){var _0x3d58d1=function(_0x40f592){while(--_0x40f592){_0x4f441e['push'](_0x4f441e['shift']());}};_0x3d58d1(++_0x31407b);}(_0x636f,0x164));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf636('0x0'));var util=require(_0xf636('0x1'));var moment=require(_0xf636('0x2'));var BPromise=require(_0xf636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf636('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf636('0x5'));var logger=require(_0xf636('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf636('0x7'));var client=jayson[_0xf636('0x8')][_0xf636('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x82fad8,_0x1dbb4c,_0x2211dd){return new BPromise(function(_0x24243b,_0x1de521){return client[_0xf636('0xa')](_0x82fad8,_0x2211dd)['then'](function(_0x25bf2c){logger[_0xf636('0xb')](_0xf636('0xc'),_0x1dbb4c,_0xf636('0xd'));logger[_0xf636('0xe')](_0xf636('0xf'),_0x1dbb4c,_0xf636('0xd'),JSON[_0xf636('0x10')](_0x25bf2c));if(_0x25bf2c[_0xf636('0x11')]){if(_0x25bf2c['error'][_0xf636('0x12')]===0x1f4){logger[_0xf636('0x11')](_0xf636('0xc'),_0x1dbb4c,_0x25bf2c[_0xf636('0x11')][_0xf636('0x13')]);return _0x1de521(_0x25bf2c['error'][_0xf636('0x13')]);}logger[_0xf636('0x11')](_0xf636('0xc'),_0x1dbb4c,_0x25bf2c['error'][_0xf636('0x13')]);return _0x24243b(_0x25bf2c[_0xf636('0x11')][_0xf636('0x13')]);}else{logger[_0xf636('0xb')](_0xf636('0xc'),_0x1dbb4c,_0xf636('0xd'));_0x24243b(_0x25bf2c[_0xf636('0x14')][_0xf636('0x13')]);}})[_0xf636('0x15')](function(_0x29731e){logger[_0xf636('0x11')](_0xf636('0xc'),_0x1dbb4c,_0x29731e);_0x1de521(_0x29731e);});});}exports[_0xf636('0x16')]=function(_0x3e09fa){var _0x3e87ae=this;return new Promise(function(_0x567217,_0x543166){return db[_0xf636('0x17')]['findAll']({'raw':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x19')]===undefined?!![]:![]:!![],'where':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x1a')]||null:null,'attributes':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x1b')]||null:null,'limit':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x1c')]||null:null,'include':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa['options']['include']?_[_0xf636('0x1d')](_0x3e09fa[_0xf636('0x18')][_0xf636('0x1e')],function(_0xcd993a){return{'model':db[_0xcd993a[_0xf636('0x1f')]],'as':_0xcd993a['as'],'attributes':_0xcd993a[_0xf636('0x1b')],'include':_0xcd993a['include']?_[_0xf636('0x1d')](_0xcd993a[_0xf636('0x1e')],function(_0x4a49d5){return{'model':db[_0x4a49d5[_0xf636('0x1f')]],'as':_0x4a49d5['as'],'attributes':_0x4a49d5['attributes'],'include':_0x4a49d5[_0xf636('0x1e')]?_[_0xf636('0x1d')](_0x4a49d5[_0xf636('0x1e')],function(_0x5df730){return{'model':db[_0x5df730[_0xf636('0x1f')]],'as':_0x5df730['as'],'attributes':_0x5df730['attributes']};}):[]};}):[]};}):[]:[]})[_0xf636('0x20')](function(_0x3d27b5){logger[_0xf636('0xb')](_0xf636('0x16'),_0x3e09fa);logger[_0xf636('0xe')](_0xf636('0x16'),_0x3e09fa,JSON[_0xf636('0x10')](_0x3d27b5));_0x567217(_0x3d27b5);})['catch'](function(_0x2ec042){logger[_0xf636('0x11')](_0xf636('0x16'),_0x2ec042[_0xf636('0x13')],_0x3e09fa);_0x543166(_0x3e87ae[_0xf636('0x11')](0x1f4,_0x2ec042['message']));});});}; \ No newline at end of file +var _0xd420=['MailServerIn','findAll','options','raw','where','limit','include','map','attributes','model','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetMailServerIn'];(function(_0x5e2156,_0x1897a8){var _0x1c7d28=function(_0x52c4b3){while(--_0x52c4b3){_0x5e2156['push'](_0x5e2156['shift']());}};_0x1c7d28(++_0x1897a8);}(_0xd420,0x1d9));var _0x0d42=function(_0x38efc5,_0x7ce9ca){_0x38efc5=_0x38efc5-0x0;var _0x15754a=_0xd420[_0x38efc5];return _0x15754a;};'use strict';var _=require(_0x0d42('0x0'));var util=require(_0x0d42('0x1'));var moment=require('moment');var BPromise=require(_0x0d42('0x2'));var rs=require(_0x0d42('0x3'));var fs=require('fs');var Redis=require(_0x0d42('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d42('0x5'));var logger=require(_0x0d42('0x6'))(_0x0d42('0x7'));var config=require(_0x0d42('0x8'));var jayson=require(_0x0d42('0x9'));var client=jayson[_0x0d42('0xa')][_0x0d42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46be19,_0x2649d5,_0x494507){return new BPromise(function(_0x3fa332,_0x55063e){return client['request'](_0x46be19,_0x494507)['then'](function(_0x54ea8b){logger['info'](_0x0d42('0xc'),_0x2649d5,_0x0d42('0xd'));logger[_0x0d42('0xe')](_0x0d42('0xf'),_0x2649d5,_0x0d42('0xd'),JSON[_0x0d42('0x10')](_0x54ea8b));if(_0x54ea8b['error']){if(_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x12')]===0x1f4){logger[_0x0d42('0x11')](_0x0d42('0xc'),_0x2649d5,_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x13')]);return _0x55063e(_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x13')]);}logger[_0x0d42('0x11')](_0x0d42('0xc'),_0x2649d5,_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x13')]);return _0x3fa332(_0x54ea8b['error'][_0x0d42('0x13')]);}else{logger[_0x0d42('0x14')](_0x0d42('0xc'),_0x2649d5,_0x0d42('0xd'));_0x3fa332(_0x54ea8b['result'][_0x0d42('0x13')]);}})['catch'](function(_0x132c4e){logger[_0x0d42('0x11')]('MailServerIn,\x20%s,\x20%s',_0x2649d5,_0x132c4e);_0x55063e(_0x132c4e);});});}exports[_0x0d42('0x15')]=function(_0x28b5b8){var _0x20cda7=this;return new Promise(function(_0x3a51cc,_0xfc9e3b){return db[_0x0d42('0x16')][_0x0d42('0x17')]({'raw':_0x28b5b8[_0x0d42('0x18')]?_0x28b5b8[_0x0d42('0x18')][_0x0d42('0x19')]===undefined?!![]:![]:!![],'where':_0x28b5b8[_0x0d42('0x18')]?_0x28b5b8['options'][_0x0d42('0x1a')]||null:null,'attributes':_0x28b5b8[_0x0d42('0x18')]?_0x28b5b8[_0x0d42('0x18')]['attributes']||null:null,'limit':_0x28b5b8['options']?_0x28b5b8[_0x0d42('0x18')][_0x0d42('0x1b')]||null:null,'include':_0x28b5b8[_0x0d42('0x18')]?_0x28b5b8[_0x0d42('0x18')][_0x0d42('0x1c')]?_[_0x0d42('0x1d')](_0x28b5b8[_0x0d42('0x18')][_0x0d42('0x1c')],function(_0x5abfa9){return{'model':db[_0x5abfa9['model']],'as':_0x5abfa9['as'],'attributes':_0x5abfa9[_0x0d42('0x1e')],'include':_0x5abfa9[_0x0d42('0x1c')]?_[_0x0d42('0x1d')](_0x5abfa9[_0x0d42('0x1c')],function(_0x494982){return{'model':db[_0x494982[_0x0d42('0x1f')]],'as':_0x494982['as'],'attributes':_0x494982[_0x0d42('0x1e')],'include':_0x494982[_0x0d42('0x1c')]?_[_0x0d42('0x1d')](_0x494982['include'],function(_0x273387){return{'model':db[_0x273387[_0x0d42('0x1f')]],'as':_0x273387['as'],'attributes':_0x273387[_0x0d42('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d42('0x20')](function(_0x4ec447){logger[_0x0d42('0x14')](_0x0d42('0x15'),_0x28b5b8);logger[_0x0d42('0xe')](_0x0d42('0x15'),_0x28b5b8,JSON['stringify'](_0x4ec447));_0x3a51cc(_0x4ec447);})['catch'](function(_0x17978d){logger[_0x0d42('0x11')](_0x0d42('0x15'),_0x17978d[_0x0d42('0x13')],_0x28b5b8);_0xfc9e3b(_0x20cda7[_0x0d42('0x11')](0x1f4,_0x17978d[_0x0d42('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d0cd39b..bbf9a86 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 _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(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x41428a,_0x158e57){_0x41428a=_0x41428a-0x0;var _0x143c34=_0x7a54[_0x41428a];return _0x143c34;};'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 +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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index f236543..f33c22d 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 _0x1be1=['STRING','INTEGER','BOOLEAN'];(function(_0x4c4e5c,_0x2c9c8){var _0x1db97e=function(_0x4a6ea1){while(--_0x4a6ea1){_0x4c4e5c['push'](_0x4c4e5c['shift']());}};_0x1db97e(++_0x2c9c8);}(_0x1be1,0x192));var _0x11be=function(_0xf8ae4f,_0x4a89a9){_0xf8ae4f=_0xf8ae4f-0x0;var _0x23d381=_0x1be1[_0xf8ae4f];return _0x23d381;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x11be('0x0')]},'host':{'type':Sequelize[_0x11be('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x11be('0x0')]},'port':{'type':Sequelize[_0x11be('0x1')]},'secure':{'type':Sequelize[_0x11be('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x11be('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x11be('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf45e=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x1efd75,_0x1560d8){var _0x2b84b2=function(_0x2c3d43){while(--_0x2c3d43){_0x1efd75['push'](_0x1efd75['shift']());}};_0x2b84b2(++_0x1560d8);}(_0xf45e,0x115));var _0xef45=function(_0x290159,_0x5945a9){_0x290159=_0x290159-0x0;var _0x106e3d=_0xf45e[_0x290159];return _0x106e3d;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'description':{'type':Sequelize[_0xef45('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xef45('0x1')]},'pass':{'type':Sequelize[_0xef45('0x1')]},'port':{'type':Sequelize[_0xef45('0x2')]},'secure':{'type':Sequelize[_0xef45('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xef45('0x1')]},'authentication':{'type':Sequelize[_0xef45('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xef45('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 2747d04..e4ccf1c 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 _0xd87d=['mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','map','MailServerOut','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x226be1,_0x43af94){var _0x2abb6c=function(_0x123d05){while(--_0x123d05){_0x226be1['push'](_0x226be1['shift']());}};_0x2abb6c(++_0x43af94);}(_0xd87d,0x86));var _0xdd87=function(_0x36af4e,_0x1ac3d0){_0x36af4e=_0x36af4e-0x0;var _0x598ad3=_0xd87d[_0x36af4e];return _0x598ad3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd87('0x0'));var zipdir=require(_0xdd87('0x1'));var jsonpatch=require(_0xdd87('0x2'));var rp=require('request-promise');var moment=require(_0xdd87('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdd87('0x4'));var util=require(_0xdd87('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xdd87('0x6'));var ejs=require(_0xdd87('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd87('0x8'));var squel=require('squel');var crypto=require(_0xdd87('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xdd87('0xa'));var toCsv=require(_0xdd87('0x6'));var querystring=require(_0xdd87('0xb'));var Papa=require('papaparse');var Redis=require(_0xdd87('0xc'));var authService=require(_0xdd87('0xd'));var qs=require(_0xdd87('0xe'));var as=require(_0xdd87('0xf'));var hardwareService=require(_0xdd87('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdd87('0x11'));var licenseUtil=require(_0xdd87('0x12'));var db=require(_0xdd87('0x13'))['db'];function respondWithStatusCode(_0x3ede09,_0xaec724){_0xaec724=_0xaec724||0xcc;return function(_0x434751){if(_0x434751){return _0x3ede09['sendStatus'](_0xaec724);}return _0x3ede09[_0xdd87('0x14')](_0xaec724)[_0xdd87('0x15')]();};}function respondWithResult(_0x2539af,_0x4fb9ee){_0x4fb9ee=_0x4fb9ee||0xc8;return function(_0x5e61ed){if(_0x5e61ed){return _0x2539af[_0xdd87('0x14')](_0x4fb9ee)[_0xdd87('0x16')](_0x5e61ed);}};}function respondWithFilteredResult(_0x4925ec,_0x58eed3){return function(_0xebf891){if(_0xebf891){var _0xaa9774=typeof _0x58eed3[_0xdd87('0x17')]==='undefined'&&typeof _0x58eed3['limit']===_0xdd87('0x18');var _0x15986e=_0xebf891[_0xdd87('0x19')];var _0x570f4c=_0xaa9774?0x0:_0x58eed3['offset'];var _0x214b40=_0xaa9774?_0xebf891[_0xdd87('0x19')]:_0x58eed3[_0xdd87('0x17')]+_0x58eed3['limit'];var _0x5dc943;if(_0x214b40>=_0x15986e){_0x214b40=_0x15986e;_0x5dc943=0xc8;}else{_0x5dc943=0xce;}_0x4925ec[_0xdd87('0x14')](_0x5dc943);return _0x4925ec[_0xdd87('0x1a')](_0xdd87('0x1b'),_0x570f4c+'-'+_0x214b40+'/'+_0x15986e)[_0xdd87('0x16')](_0xebf891);}return null;};}function patchUpdates(_0x380f3d){return function(_0xfd28b7){try{jsonpatch[_0xdd87('0x1c')](_0xfd28b7,_0x380f3d,!![]);}catch(_0x52268a){return BPromise[_0xdd87('0x1d')](_0x52268a);}return _0xfd28b7[_0xdd87('0x1e')]();};}function saveUpdates(_0x4a433a,_0x1a13e0){return function(_0x55d2b3){if(_0x55d2b3){return _0x55d2b3[_0xdd87('0x1f')](_0x4a433a)[_0xdd87('0x20')](function(_0xf321f4){return _0xf321f4;});}return null;};}function removeEntity(_0x3e16b7,_0x44f53b){return function(_0x3691d6){if(_0x3691d6){return _0x3691d6[_0xdd87('0x21')]()[_0xdd87('0x20')](function(){_0x3e16b7['status'](0xcc)[_0xdd87('0x15')]();});}};}function handleEntityNotFound(_0x313fce,_0x209488){return function(_0x45502d){if(!_0x45502d){_0x313fce[_0xdd87('0x22')](0x194);}return _0x45502d;};}function handleError(_0x260a71,_0x40c4ce){_0x40c4ce=_0x40c4ce||0x1f4;return function(_0x42c646){logger[_0xdd87('0x23')](_0x42c646['stack']);if(_0x42c646[_0xdd87('0x24')]){delete _0x42c646[_0xdd87('0x24')];}_0x260a71['status'](_0x40c4ce)['send'](_0x42c646);};}exports['index']=function(_0x7bcec7,_0x17c2e7){var _0x5e5799={},_0x5ee6f3={},_0x4b26ba={'count':0x0,'rows':[]};var _0x8b2eb8=_[_0xdd87('0x25')](db[_0xdd87('0x26')][_0xdd87('0x27')],function(_0x347f89){return{'name':_0x347f89['fieldName'],'type':_0x347f89[_0xdd87('0x28')][_0xdd87('0x29')]};});_0x5ee6f3[_0xdd87('0x2a')]=_[_0xdd87('0x25')](_0x8b2eb8,_0xdd87('0x24'));_0x5ee6f3['query']=_[_0xdd87('0x2b')](_0x7bcec7[_0xdd87('0x2c')]);_0x5ee6f3[_0xdd87('0x2d')]=_['intersection'](_0x5ee6f3['model'],_0x5ee6f3[_0xdd87('0x2c')]);_0x5e5799[_0xdd87('0x2e')]=_[_0xdd87('0x2f')](_0x5ee6f3['model'],qs['fields'](_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x30')]));_0x5e5799[_0xdd87('0x2e')]=_0x5e5799['attributes']['length']?_0x5e5799[_0xdd87('0x2e')]:_0x5ee6f3[_0xdd87('0x2a')];if(!_0x7bcec7['query'][_0xdd87('0x31')](_0xdd87('0x32'))){_0x5e5799[_0xdd87('0x33')]=qs[_0xdd87('0x33')](_0x7bcec7[_0xdd87('0x2c')]['limit']);_0x5e5799[_0xdd87('0x17')]=qs[_0xdd87('0x17')](_0x7bcec7[_0xdd87('0x2c')]['offset']);}_0x5e5799[_0xdd87('0x34')]=qs[_0xdd87('0x35')](_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x35')]);_0x5e5799[_0xdd87('0x36')]=qs[_0xdd87('0x2d')](_['pick'](_0x7bcec7[_0xdd87('0x2c')],_0x5ee6f3['filters']),_0x8b2eb8);if(_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x37')]){_0x5e5799[_0xdd87('0x36')]=_[_0xdd87('0x38')](_0x5e5799['where'],{'$or':_[_0xdd87('0x25')](_0x8b2eb8,function(_0xe3d90a){if(_0xe3d90a[_0xdd87('0x28')]!==_0xdd87('0x39')){var _0x43b56b={};_0x43b56b[_0xe3d90a[_0xdd87('0x24')]]={'$like':'%'+_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x37')]+'%'};return _0x43b56b;}})});}_0x5e5799=_[_0xdd87('0x38')]({},_0x5e5799,_0x7bcec7['options']);var _0x282640={'where':_0x5e5799[_0xdd87('0x36')]};return db['MailServerOut'][_0xdd87('0x19')](_0x282640)[_0xdd87('0x20')](function(_0x56dc80){_0x4b26ba['count']=_0x56dc80;if(_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x3a')]){_0x5e5799[_0xdd87('0x3b')]=[{'all':!![]}];}return db[_0xdd87('0x26')][_0xdd87('0x3c')](_0x5e5799);})[_0xdd87('0x20')](function(_0x164337){_0x4b26ba[_0xdd87('0x3d')]=_0x164337;return _0x4b26ba;})[_0xdd87('0x20')](respondWithFilteredResult(_0x17c2e7,_0x5e5799))[_0xdd87('0x3e')](handleError(_0x17c2e7,null));};exports[_0xdd87('0x3f')]=function(_0x31ec2f,_0x3a47d4){var _0x907263={'raw':!![],'where':{'id':_0x31ec2f[_0xdd87('0x40')]['id']}},_0x29350d={};_0x29350d['model']=_[_0xdd87('0x2b')](db[_0xdd87('0x26')][_0xdd87('0x27')]);_0x29350d['query']=_[_0xdd87('0x2b')](_0x31ec2f[_0xdd87('0x2c')]);_0x29350d['filters']=_[_0xdd87('0x2f')](_0x29350d[_0xdd87('0x2a')],_0x29350d[_0xdd87('0x2c')]);_0x907263[_0xdd87('0x2e')]=_[_0xdd87('0x2f')](_0x29350d[_0xdd87('0x2a')],qs[_0xdd87('0x30')](_0x31ec2f[_0xdd87('0x2c')][_0xdd87('0x30')]));_0x907263[_0xdd87('0x2e')]=_0x907263[_0xdd87('0x2e')]['length']?_0x907263[_0xdd87('0x2e')]:_0x29350d['model'];if(_0x31ec2f[_0xdd87('0x2c')][_0xdd87('0x3a')]){_0x907263[_0xdd87('0x3b')]=[{'all':!![]}];}_0x907263=_[_0xdd87('0x38')]({},_0x907263,_0x31ec2f[_0xdd87('0x41')]);return db['MailServerOut'][_0xdd87('0x42')](_0x907263)['then'](handleEntityNotFound(_0x3a47d4,null))[_0xdd87('0x20')](respondWithResult(_0x3a47d4,null))[_0xdd87('0x3e')](handleError(_0x3a47d4,null));};exports[_0xdd87('0x43')]=function(_0x463ff4,_0x1ddfb0){return db['MailServerOut']['create'](_0x463ff4[_0xdd87('0x44')],{})[_0xdd87('0x20')](respondWithResult(_0x1ddfb0,0xc9))['catch'](handleError(_0x1ddfb0,null));};exports[_0xdd87('0x1f')]=function(_0x36e7c9,_0x43599d){if(_0x36e7c9[_0xdd87('0x44')]['id']){delete _0x36e7c9[_0xdd87('0x44')]['id'];}return db[_0xdd87('0x26')][_0xdd87('0x42')]({'where':{'id':_0x36e7c9[_0xdd87('0x40')]['id']}})[_0xdd87('0x20')](handleEntityNotFound(_0x43599d,null))[_0xdd87('0x20')](saveUpdates(_0x36e7c9[_0xdd87('0x44')],null))[_0xdd87('0x20')](respondWithResult(_0x43599d,null))[_0xdd87('0x3e')](handleError(_0x43599d,null));};exports[_0xdd87('0x21')]=function(_0x1f0537,_0x1086da){return db[_0xdd87('0x26')]['find']({'where':{'id':_0x1f0537[_0xdd87('0x40')]['id']}})[_0xdd87('0x20')](handleEntityNotFound(_0x1086da,null))[_0xdd87('0x20')](removeEntity(_0x1086da,null))[_0xdd87('0x3e')](handleError(_0x1086da,null));}; \ No newline at end of file +var _0x371c=['merge','map','type','VIRTUAL','options','count','includeAll','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','name','index','MailServerOut','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0x371c,0x199));var _0xc371=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x371c[_0x1b828b];return _0x98da1a;};'use strict';var emlformat=require(_0xc371('0x0'));var rimraf=require(_0xc371('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc371('0x2'));var rp=require(_0xc371('0x3'));var moment=require(_0xc371('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc371('0x5'));var util=require(_0xc371('0x6'));var path=require(_0xc371('0x7'));var sox=require(_0xc371('0x8'));var csv=require(_0xc371('0x9'));var ejs=require(_0xc371('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc371('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc371('0xc'));var deskjs=require(_0xc371('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc371('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc371('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc371('0x10'))(_0xc371('0x11'));var utils=require(_0xc371('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc371('0x13'));var db=require(_0xc371('0x14'))['db'];function respondWithStatusCode(_0x512327,_0x1468dc){_0x1468dc=_0x1468dc||0xcc;return function(_0x1b2066){if(_0x1b2066){return _0x512327[_0xc371('0x15')](_0x1468dc);}return _0x512327['status'](_0x1468dc)['end']();};}function respondWithResult(_0x28f4d2,_0x594d11){_0x594d11=_0x594d11||0xc8;return function(_0x34edcb){if(_0x34edcb){return _0x28f4d2[_0xc371('0x16')](_0x594d11)[_0xc371('0x17')](_0x34edcb);}};}function respondWithFilteredResult(_0x102958,_0x20fac1){return function(_0x19fba4){if(_0x19fba4){var _0x209b67=typeof _0x20fac1[_0xc371('0x18')]===_0xc371('0x19')&&typeof _0x20fac1['limit']===_0xc371('0x19');var _0x36d78d=_0x19fba4['count'];var _0x2d2d34=_0x209b67?0x0:_0x20fac1['offset'];var _0x26d650=_0x209b67?_0x19fba4['count']:_0x20fac1['offset']+_0x20fac1[_0xc371('0x1a')];var _0x196521;if(_0x26d650>=_0x36d78d){_0x26d650=_0x36d78d;_0x196521=0xc8;}else{_0x196521=0xce;}_0x102958[_0xc371('0x16')](_0x196521);return _0x102958[_0xc371('0x1b')](_0xc371('0x1c'),_0x2d2d34+'-'+_0x26d650+'/'+_0x36d78d)[_0xc371('0x17')](_0x19fba4);}return null;};}function patchUpdates(_0xd2180d){return function(_0x547ee6){try{jsonpatch[_0xc371('0x1d')](_0x547ee6,_0xd2180d,!![]);}catch(_0x3c37d1){return BPromise[_0xc371('0x1e')](_0x3c37d1);}return _0x547ee6['save']();};}function saveUpdates(_0x587632,_0x28ceb5){return function(_0x12c7bd){if(_0x12c7bd){return _0x12c7bd[_0xc371('0x1f')](_0x587632)[_0xc371('0x20')](function(_0x4adef5){return _0x4adef5;});}return null;};}function removeEntity(_0x26ae46,_0x5c7bfe){return function(_0xe3a3fe){if(_0xe3a3fe){return _0xe3a3fe[_0xc371('0x21')]()[_0xc371('0x20')](function(){_0x26ae46[_0xc371('0x16')](0xcc)[_0xc371('0x22')]();});}};}function handleEntityNotFound(_0x3145e4,_0x449606){return function(_0x1d1991){if(!_0x1d1991){_0x3145e4[_0xc371('0x15')](0x194);}return _0x1d1991;};}function handleError(_0x27ce35,_0x411da3){_0x411da3=_0x411da3||0x1f4;return function(_0x50913f){logger[_0xc371('0x23')](_0x50913f['stack']);if(_0x50913f['name']){delete _0x50913f[_0xc371('0x24')];}_0x27ce35[_0xc371('0x16')](_0x411da3)['send'](_0x50913f);};}exports[_0xc371('0x25')]=function(_0x402dd9,_0xeb5720){var _0x4d8b95={},_0x3d362e={},_0x114dfa={'count':0x0,'rows':[]};var _0x1e38a4=_['map'](db[_0xc371('0x26')][_0xc371('0x27')],function(_0x37c3b9){return{'name':_0x37c3b9['fieldName'],'type':_0x37c3b9['type']['key']};});_0x3d362e['model']=_['map'](_0x1e38a4,_0xc371('0x24'));_0x3d362e['query']=_[_0xc371('0x28')](_0x402dd9[_0xc371('0x29')]);_0x3d362e[_0xc371('0x2a')]=_[_0xc371('0x2b')](_0x3d362e[_0xc371('0x2c')],_0x3d362e[_0xc371('0x29')]);_0x4d8b95['attributes']=_[_0xc371('0x2b')](_0x3d362e['model'],qs['fields'](_0x402dd9[_0xc371('0x29')][_0xc371('0x2d')]));_0x4d8b95[_0xc371('0x2e')]=_0x4d8b95[_0xc371('0x2e')][_0xc371('0x2f')]?_0x4d8b95[_0xc371('0x2e')]:_0x3d362e[_0xc371('0x2c')];if(!_0x402dd9[_0xc371('0x29')]['hasOwnProperty'](_0xc371('0x30'))){_0x4d8b95['limit']=qs[_0xc371('0x1a')](_0x402dd9[_0xc371('0x29')][_0xc371('0x1a')]);_0x4d8b95[_0xc371('0x18')]=qs['offset'](_0x402dd9[_0xc371('0x29')][_0xc371('0x18')]);}_0x4d8b95['order']=qs[_0xc371('0x31')](_0x402dd9[_0xc371('0x29')][_0xc371('0x31')]);_0x4d8b95[_0xc371('0x32')]=qs[_0xc371('0x2a')](_[_0xc371('0x33')](_0x402dd9[_0xc371('0x29')],_0x3d362e[_0xc371('0x2a')]),_0x1e38a4);if(_0x402dd9[_0xc371('0x29')][_0xc371('0x34')]){_0x4d8b95[_0xc371('0x32')]=_[_0xc371('0x35')](_0x4d8b95[_0xc371('0x32')],{'$or':_[_0xc371('0x36')](_0x1e38a4,function(_0x517ddb){if(_0x517ddb[_0xc371('0x37')]!==_0xc371('0x38')){var _0x2a5b3a={};_0x2a5b3a[_0x517ddb[_0xc371('0x24')]]={'$like':'%'+_0x402dd9[_0xc371('0x29')][_0xc371('0x34')]+'%'};return _0x2a5b3a;}})});}_0x4d8b95=_['merge']({},_0x4d8b95,_0x402dd9[_0xc371('0x39')]);var _0x239a2c={'where':_0x4d8b95[_0xc371('0x32')]};return db[_0xc371('0x26')][_0xc371('0x3a')](_0x239a2c)[_0xc371('0x20')](function(_0x54df2a){_0x114dfa[_0xc371('0x3a')]=_0x54df2a;if(_0x402dd9[_0xc371('0x29')][_0xc371('0x3b')]){_0x4d8b95['include']=[{'all':!![]}];}return db[_0xc371('0x26')]['findAll'](_0x4d8b95);})[_0xc371('0x20')](function(_0xe3d936){_0x114dfa['rows']=_0xe3d936;return _0x114dfa;})['then'](respondWithFilteredResult(_0xeb5720,_0x4d8b95))[_0xc371('0x3c')](handleError(_0xeb5720,null));};exports[_0xc371('0x3d')]=function(_0x5d878d,_0x515c27){var _0x52a6a9={'raw':!![],'where':{'id':_0x5d878d[_0xc371('0x3e')]['id']}},_0x5c13b5={};_0x5c13b5['model']=_[_0xc371('0x28')](db[_0xc371('0x26')]['rawAttributes']);_0x5c13b5[_0xc371('0x29')]=_[_0xc371('0x28')](_0x5d878d[_0xc371('0x29')]);_0x5c13b5['filters']=_['intersection'](_0x5c13b5[_0xc371('0x2c')],_0x5c13b5[_0xc371('0x29')]);_0x52a6a9[_0xc371('0x2e')]=_[_0xc371('0x2b')](_0x5c13b5[_0xc371('0x2c')],qs[_0xc371('0x2d')](_0x5d878d[_0xc371('0x29')][_0xc371('0x2d')]));_0x52a6a9['attributes']=_0x52a6a9[_0xc371('0x2e')][_0xc371('0x2f')]?_0x52a6a9['attributes']:_0x5c13b5['model'];if(_0x5d878d[_0xc371('0x29')][_0xc371('0x3b')]){_0x52a6a9['include']=[{'all':!![]}];}_0x52a6a9=_[_0xc371('0x35')]({},_0x52a6a9,_0x5d878d['options']);return db[_0xc371('0x26')][_0xc371('0x3f')](_0x52a6a9)[_0xc371('0x20')](handleEntityNotFound(_0x515c27,null))[_0xc371('0x20')](respondWithResult(_0x515c27,null))['catch'](handleError(_0x515c27,null));};exports[_0xc371('0x40')]=function(_0x40d54e,_0x10cf32){return db[_0xc371('0x26')]['create'](_0x40d54e[_0xc371('0x41')],{})[_0xc371('0x20')](respondWithResult(_0x10cf32,0xc9))['catch'](handleError(_0x10cf32,null));};exports[_0xc371('0x1f')]=function(_0x399724,_0x4a2a96){if(_0x399724[_0xc371('0x41')]['id']){delete _0x399724[_0xc371('0x41')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x399724[_0xc371('0x3e')]['id']}})[_0xc371('0x20')](handleEntityNotFound(_0x4a2a96,null))[_0xc371('0x20')](saveUpdates(_0x399724[_0xc371('0x41')],null))[_0xc371('0x20')](respondWithResult(_0x4a2a96,null))['catch'](handleError(_0x4a2a96,null));};exports[_0xc371('0x21')]=function(_0x52d2fc,_0x3112fd){return db[_0xc371('0x26')]['find']({'where':{'id':_0x52d2fc['params']['id']}})[_0xc371('0x20')](handleEntityNotFound(_0x3112fd,null))[_0xc371('0x20')](removeEntity(_0x3112fd,null))[_0xc371('0x3c')](handleError(_0x3112fd,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index e6490f8..43e2fc8 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 _0x536b=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','util','../../config/logger'];(function(_0x3799cd,_0x131494){var _0x3410d3=function(_0x4a742b){while(--_0x4a742b){_0x3799cd['push'](_0x3799cd['shift']());}};_0x3410d3(++_0x131494);}(_0x536b,0x15e));var _0xb536=function(_0x305b49,_0x17ed26){_0x305b49=_0x305b49-0x0;var _0x364e28=_0x536b[_0x305b49];return _0x364e28;};'use strict';var _=require('lodash');var util=require(_0xb536('0x0'));var logger=require(_0xb536('0x1'))(_0xb536('0x2'));var moment=require('moment');var BPromise=require(_0xb536('0x3'));var rp=require(_0xb536('0x4'));var fs=require('fs');var path=require(_0xb536('0x5'));var rimraf=require(_0xb536('0x6'));var config=require(_0xb536('0x7'));var attributes=require(_0xb536('0x8'));module[_0xb536('0x9')]=function(_0x3bdc3a,_0x176048){return _0x3bdc3a[_0xb536('0xa')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9601=['./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','api','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9601,0xec));var _0x1960=function(_0x3978df,_0x53d738){_0x3978df=_0x3978df-0x0;var _0x136d20=_0x9601[_0x3978df];return _0x136d20;};'use strict';var _=require(_0x1960('0x0'));var util=require(_0x1960('0x1'));var logger=require('../../config/logger')(_0x1960('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1960('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1960('0x4'));module[_0x1960('0x5')]=function(_0x109e46,_0x2de109){return _0x109e46[_0x1960('0x6')](_0x1960('0x7'),attributes,{'tableName':'mail_servers_out','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 a33b77b..6a3a6f0 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x44471b,_0x43713a){var _0x52a9ba=function(_0x38186d){while(--_0x38186d){_0x44471b['push'](_0x44471b['shift']());}};_0x52a9ba(++_0x43713a);}(_0x1261,0x144));var _0x1126=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x1261[_0x2a5b3b];return _0xae665a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4af5d9,_0x1198c8){var _0xf6a1fd=function(_0x4db7a7){while(--_0x4db7a7){_0x4af5d9['push'](_0x4af5d9['shift']());}};_0xf6a1fd(++_0x1198c8);}(_0xadb5,0xad));var _0x5adb=function(_0x23bdea,_0x5c00ad){_0x23bdea=_0x23bdea-0x0;var _0x1fadf0=_0xadb5[_0x23bdea];return _0x1fadf0;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 563d927..0a5dc51 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 _0xa4f1=['get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0x33e375,_0x485a8d){var _0x4de504=function(_0x2c215a){while(--_0x2c215a){_0x33e375['push'](_0x33e375['shift']());}};_0x4de504(++_0x485a8d);}(_0xa4f1,0xf4));var _0x1a4f=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xa4f1[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x1a4f('0x0'));var util=require(_0x1a4f('0x1'));var path=require(_0x1a4f('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a4f('0x3'));var router=express['Router']();var fs_extra=require(_0x1a4f('0x4'));var auth=require(_0x1a4f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a4f('0x6'));var controller=require(_0x1a4f('0x7'));router[_0x1a4f('0x8')]('/',auth[_0x1a4f('0x9')](),controller[_0x1a4f('0xa')]);router[_0x1a4f('0x8')](_0x1a4f('0xb'),auth['isAuthenticated'](),controller[_0x1a4f('0xc')]);router[_0x1a4f('0x8')]('/:id',auth[_0x1a4f('0x9')](),controller['show']);router[_0x1a4f('0xd')]('/',auth[_0x1a4f('0x9')](),controller[_0x1a4f('0xe')]);router[_0x1a4f('0xf')](_0x1a4f('0x10'),auth[_0x1a4f('0x9')](),controller[_0x1a4f('0x11')]);router[_0x1a4f('0x12')](_0x1a4f('0x10'),auth[_0x1a4f('0x9')](),controller[_0x1a4f('0x13')]);module[_0x1a4f('0x14')]=router; \ No newline at end of file +var _0xc3f9=['destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','/:id','show','post','create','delete'];(function(_0x56b878,_0x4be9aa){var _0x32b9ec=function(_0x1511ea){while(--_0x1511ea){_0x56b878['push'](_0x56b878['shift']());}};_0x32b9ec(++_0x4be9aa);}(_0xc3f9,0x112));var _0x9c3f=function(_0x34b930,_0x4b5012){_0x34b930=_0x34b930-0x0;var _0x1cae80=_0xc3f9[_0x34b930];return _0x1cae80;};'use strict';var multer=require(_0x9c3f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9c3f('0x1'));var router=express[_0x9c3f('0x2')]();var fs_extra=require(_0x9c3f('0x3'));var auth=require(_0x9c3f('0x4'));var interaction=require(_0x9c3f('0x5'));var config=require(_0x9c3f('0x6'));var controller=require(_0x9c3f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x9c3f('0x8')](),controller['describe']);router['get'](_0x9c3f('0x9'),auth[_0x9c3f('0x8')](),controller[_0x9c3f('0xa')]);router[_0x9c3f('0xb')]('/',auth[_0x9c3f('0x8')](),controller[_0x9c3f('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9c3f('0xd')](_0x9c3f('0x9'),auth['isAuthenticated'](),controller[_0x9c3f('0xe')]);module[_0x9c3f('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 2a13f5a..df930c7 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 _0xc03e=['sequelize','name'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xc03e,0x15a));var _0xec03=function(_0x1d1854,_0x4a83b1){_0x1d1854=_0x1d1854-0x0;var _0x5b2acb=_0xc03e[_0x1d1854];return _0x5b2acb;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xec03('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x06f4=['name','STRING','sequelize','exports'];(function(_0x16afb4,_0x2806ff){var _0x8a53be=function(_0x13f5e2){while(--_0x13f5e2){_0x16afb4['push'](_0x16afb4['shift']());}};_0x8a53be(++_0x2806ff);}(_0x06f4,0x136));var _0x406f=function(_0x46beac,_0x126772){_0x46beac=_0x46beac-0x0;var _0x494b20=_0x06f4[_0x46beac];return _0x494b20;};'use strict';var Sequelize=require(_0x406f('0x0'));module[_0x406f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x406f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x406f('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index cd325c7..28339d2 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 _0x096a=['request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','params','keys','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x096a,0x121));var _0xa096=function(_0xf48431,_0x485b88){_0xf48431=_0xf48431-0x0;var _0x3ab7a3=_0x096a[_0xf48431];return _0x3ab7a3;};'use strict';var emlformat=require(_0xa096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa096('0x1'));var jsonpatch=require(_0xa096('0x2'));var rp=require(_0xa096('0x3'));var moment=require(_0xa096('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa096('0x5'));var util=require('util');var path=require(_0xa096('0x6'));var sox=require('sox');var csv=require(_0xa096('0x7'));var ejs=require(_0xa096('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa096('0x9'));var squel=require('squel');var crypto=require(_0xa096('0xa'));var jsforce=require(_0xa096('0xb'));var deskjs=require(_0xa096('0xc'));var toCsv=require(_0xa096('0x7'));var querystring=require(_0xa096('0xd'));var Papa=require(_0xa096('0xe'));var Redis=require('ioredis');var authService=require(_0xa096('0xf'));var qs=require(_0xa096('0x10'));var as=require(_0xa096('0x11'));var hardwareService=require(_0xa096('0x12'));var logger=require(_0xa096('0x13'))('api');var utils=require(_0xa096('0x14'));var config=require(_0xa096('0x15'));var licenseUtil=require(_0xa096('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218fac,_0x2898c4){_0x2898c4=_0x2898c4||0xcc;return function(_0xb10f4){if(_0xb10f4){return _0x218fac[_0xa096('0x17')](_0x2898c4);}return _0x218fac[_0xa096('0x18')](_0x2898c4)[_0xa096('0x19')]();};}function respondWithResult(_0x512723,_0x221969){_0x221969=_0x221969||0xc8;return function(_0x3c7fbd){if(_0x3c7fbd){return _0x512723[_0xa096('0x18')](_0x221969)['json'](_0x3c7fbd);}};}function respondWithFilteredResult(_0x3a7a7d,_0x59c04a){return function(_0x5b6b67){if(_0x5b6b67){var _0x100da7=typeof _0x59c04a[_0xa096('0x1a')]==='undefined'&&typeof _0x59c04a[_0xa096('0x1b')]==='undefined';var _0x572d48=_0x5b6b67[_0xa096('0x1c')];var _0x4453f9=_0x100da7?0x0:_0x59c04a['offset'];var _0x598aca=_0x100da7?_0x5b6b67['count']:_0x59c04a[_0xa096('0x1a')]+_0x59c04a[_0xa096('0x1b')];var _0x57d04a;if(_0x598aca>=_0x572d48){_0x598aca=_0x572d48;_0x57d04a=0xc8;}else{_0x57d04a=0xce;}_0x3a7a7d[_0xa096('0x18')](_0x57d04a);return _0x3a7a7d['set'](_0xa096('0x1d'),_0x4453f9+'-'+_0x598aca+'/'+_0x572d48)[_0xa096('0x1e')](_0x5b6b67);}return null;};}function patchUpdates(_0x2ba537){return function(_0x3c4173){try{jsonpatch[_0xa096('0x1f')](_0x3c4173,_0x2ba537,!![]);}catch(_0x198d60){return BPromise[_0xa096('0x20')](_0x198d60);}return _0x3c4173[_0xa096('0x21')]();};}function saveUpdates(_0x4a3714,_0x37ab55){return function(_0x101ddb){if(_0x101ddb){return _0x101ddb[_0xa096('0x22')](_0x4a3714)['then'](function(_0x161aaf){return _0x161aaf;});}return null;};}function removeEntity(_0x41c1c9,_0x173e96){return function(_0x1f77fa){if(_0x1f77fa){return _0x1f77fa[_0xa096('0x23')]()[_0xa096('0x24')](function(){_0x41c1c9[_0xa096('0x18')](0xcc)[_0xa096('0x19')]();});}};}function handleEntityNotFound(_0x114631,_0x2583e2){return function(_0x24d14e){if(!_0x24d14e){_0x114631[_0xa096('0x17')](0x194);}return _0x24d14e;};}function handleError(_0x5bab4f,_0x2b6b7b){_0x2b6b7b=_0x2b6b7b||0x1f4;return function(_0x25aa98){logger[_0xa096('0x25')](_0x25aa98[_0xa096('0x26')]);if(_0x25aa98[_0xa096('0x27')]){delete _0x25aa98[_0xa096('0x27')];}_0x5bab4f[_0xa096('0x18')](_0x2b6b7b)[_0xa096('0x28')](_0x25aa98);};}exports[_0xa096('0x29')]=function(_0x139e77,_0x4a09b4){var _0x2e8106={},_0x3342fe={},_0x1c155d={'count':0x0,'rows':[]};var _0x507612=_[_0xa096('0x2a')](db[_0xa096('0x2b')][_0xa096('0x2c')],function(_0x315cda){return{'name':_0x315cda[_0xa096('0x2d')],'type':_0x315cda[_0xa096('0x2e')]['key']};});_0x3342fe[_0xa096('0x2f')]=_['map'](_0x507612,_0xa096('0x27'));_0x3342fe[_0xa096('0x30')]=_['keys'](_0x139e77[_0xa096('0x30')]);_0x3342fe[_0xa096('0x31')]=_[_0xa096('0x32')](_0x3342fe[_0xa096('0x2f')],_0x3342fe['query']);_0x2e8106[_0xa096('0x33')]=_[_0xa096('0x32')](_0x3342fe[_0xa096('0x2f')],qs['fields'](_0x139e77[_0xa096('0x30')]['fields']));_0x2e8106[_0xa096('0x33')]=_0x2e8106[_0xa096('0x33')][_0xa096('0x34')]?_0x2e8106[_0xa096('0x33')]:_0x3342fe[_0xa096('0x2f')];if(!_0x139e77[_0xa096('0x30')]['hasOwnProperty'](_0xa096('0x35'))){_0x2e8106[_0xa096('0x1b')]=qs[_0xa096('0x1b')](_0x139e77['query'][_0xa096('0x1b')]);_0x2e8106[_0xa096('0x1a')]=qs[_0xa096('0x1a')](_0x139e77[_0xa096('0x30')]['offset']);}_0x2e8106[_0xa096('0x36')]=qs[_0xa096('0x37')](_0x139e77[_0xa096('0x30')]['sort']);_0x2e8106['where']=qs[_0xa096('0x31')](_[_0xa096('0x38')](_0x139e77[_0xa096('0x30')],_0x3342fe[_0xa096('0x31')]),_0x507612);if(_0x139e77[_0xa096('0x30')]['filter']){_0x2e8106[_0xa096('0x39')]=_[_0xa096('0x3a')](_0x2e8106[_0xa096('0x39')],{'$or':_[_0xa096('0x2a')](_0x507612,function(_0x1a91d7){if(_0x1a91d7[_0xa096('0x2e')]!==_0xa096('0x3b')){var _0x5edc22={};_0x5edc22[_0x1a91d7[_0xa096('0x27')]]={'$like':'%'+_0x139e77[_0xa096('0x30')][_0xa096('0x3c')]+'%'};return _0x5edc22;}})});}_0x2e8106=_[_0xa096('0x3a')]({},_0x2e8106,_0x139e77['options']);var _0xd52ce0={'where':_0x2e8106[_0xa096('0x39')]};return db[_0xa096('0x2b')][_0xa096('0x1c')](_0xd52ce0)[_0xa096('0x24')](function(_0x5c0c54){_0x1c155d[_0xa096('0x1c')]=_0x5c0c54;if(_0x139e77[_0xa096('0x30')][_0xa096('0x3d')]){_0x2e8106[_0xa096('0x3e')]=[{'all':!![]}];}return db[_0xa096('0x2b')]['findAll'](_0x2e8106);})[_0xa096('0x24')](function(_0x530e0e){_0x1c155d[_0xa096('0x3f')]=_0x530e0e;return _0x1c155d;})['then'](respondWithFilteredResult(_0x4a09b4,_0x2e8106))[_0xa096('0x40')](handleError(_0x4a09b4,null));};exports['show']=function(_0x4d56f0,_0x50157a){var _0x232641={'raw':!![],'where':{'id':_0x4d56f0[_0xa096('0x41')]['id']}},_0x4dcb64={};_0x4dcb64[_0xa096('0x2f')]=_[_0xa096('0x42')](db[_0xa096('0x2b')][_0xa096('0x2c')]);_0x4dcb64[_0xa096('0x30')]=_[_0xa096('0x42')](_0x4d56f0[_0xa096('0x30')]);_0x4dcb64[_0xa096('0x31')]=_[_0xa096('0x32')](_0x4dcb64[_0xa096('0x2f')],_0x4dcb64[_0xa096('0x30')]);_0x232641[_0xa096('0x33')]=_[_0xa096('0x32')](_0x4dcb64['model'],qs[_0xa096('0x43')](_0x4d56f0['query'][_0xa096('0x43')]));_0x232641[_0xa096('0x33')]=_0x232641[_0xa096('0x33')][_0xa096('0x34')]?_0x232641[_0xa096('0x33')]:_0x4dcb64[_0xa096('0x2f')];if(_0x4d56f0['query'][_0xa096('0x3d')]){_0x232641['include']=[{'all':!![]}];}_0x232641=_[_0xa096('0x3a')]({},_0x232641,_0x4d56f0[_0xa096('0x44')]);return db[_0xa096('0x2b')][_0xa096('0x45')](_0x232641)['then'](handleEntityNotFound(_0x50157a,null))[_0xa096('0x24')](respondWithResult(_0x50157a,null))[_0xa096('0x40')](handleError(_0x50157a,null));};exports[_0xa096('0x46')]=function(_0x3463e3,_0x5cc434){return db[_0xa096('0x2b')][_0xa096('0x46')](_0x3463e3['body'],{})['then'](respondWithResult(_0x5cc434,0xc9))[_0xa096('0x40')](handleError(_0x5cc434,null));};exports[_0xa096('0x22')]=function(_0x2ee0b1,_0x19c2cf){if(_0x2ee0b1[_0xa096('0x47')]['id']){delete _0x2ee0b1[_0xa096('0x47')]['id'];}return db[_0xa096('0x2b')][_0xa096('0x45')]({'where':{'id':_0x2ee0b1[_0xa096('0x41')]['id']}})[_0xa096('0x24')](handleEntityNotFound(_0x19c2cf,null))[_0xa096('0x24')](saveUpdates(_0x2ee0b1[_0xa096('0x47')],null))[_0xa096('0x24')](respondWithResult(_0x19c2cf,null))['catch'](handleError(_0x19c2cf,null));};exports[_0xa096('0x23')]=function(_0x4c529a,_0x3a0012){return db[_0xa096('0x2b')][_0xa096('0x45')]({'where':{'id':_0x4c529a[_0xa096('0x41')]['id']}})[_0xa096('0x24')](handleEntityNotFound(_0x3a0012,null))[_0xa096('0x24')](removeEntity(_0x3a0012,null))[_0xa096('0x40')](handleError(_0x3a0012,null));};exports['describe']=function(_0x5b802d,_0x49d6e4){return db[_0xa096('0x2b')][_0xa096('0x48')]()[_0xa096('0x24')](respondWithResult(_0x49d6e4,null))[_0xa096('0x40')](handleError(_0x49d6e4,null));}; \ No newline at end of file +var _0x1358=['model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','status','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1358,0x67));var _0x8135=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x1358[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0x8135('0x0'));var rimraf=require(_0x8135('0x1'));var zipdir=require(_0x8135('0x2'));var jsonpatch=require(_0x8135('0x3'));var rp=require('request-promise');var moment=require(_0x8135('0x4'));var BPromise=require(_0x8135('0x5'));var Mustache=require(_0x8135('0x6'));var util=require('util');var path=require(_0x8135('0x7'));var sox=require(_0x8135('0x8'));var csv=require(_0x8135('0x9'));var ejs=require(_0x8135('0xa'));var fs=require('fs');var fs_extra=require(_0x8135('0xb'));var _=require(_0x8135('0xc'));var squel=require(_0x8135('0xd'));var crypto=require(_0x8135('0xe'));var jsforce=require(_0x8135('0xf'));var deskjs=require(_0x8135('0x10'));var toCsv=require(_0x8135('0x9'));var querystring=require(_0x8135('0x11'));var Papa=require(_0x8135('0x12'));var Redis=require('ioredis');var authService=require(_0x8135('0x13'));var qs=require(_0x8135('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8135('0x15'));var logger=require(_0x8135('0x16'))(_0x8135('0x17'));var utils=require(_0x8135('0x18'));var config=require(_0x8135('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8135('0x1a'))['db'];function respondWithStatusCode(_0x25b827,_0x2ad7dc){_0x2ad7dc=_0x2ad7dc||0xcc;return function(_0x5bce10){if(_0x5bce10){return _0x25b827['sendStatus'](_0x2ad7dc);}return _0x25b827['status'](_0x2ad7dc)[_0x8135('0x1b')]();};}function respondWithResult(_0x2a56d8,_0x1362d9){_0x1362d9=_0x1362d9||0xc8;return function(_0x2d45aa){if(_0x2d45aa){return _0x2a56d8['status'](_0x1362d9)[_0x8135('0x1c')](_0x2d45aa);}};}function respondWithFilteredResult(_0x4eaabd,_0x26eb70){return function(_0xc9553c){if(_0xc9553c){var _0x443562=typeof _0x26eb70[_0x8135('0x1d')]==='undefined'&&typeof _0x26eb70[_0x8135('0x1e')]===_0x8135('0x1f');var _0x242fdf=_0xc9553c['count'];var _0x3b64be=_0x443562?0x0:_0x26eb70[_0x8135('0x1d')];var _0x50aa2e=_0x443562?_0xc9553c['count']:_0x26eb70[_0x8135('0x1d')]+_0x26eb70[_0x8135('0x1e')];var _0x149743;if(_0x50aa2e>=_0x242fdf){_0x50aa2e=_0x242fdf;_0x149743=0xc8;}else{_0x149743=0xce;}_0x4eaabd['status'](_0x149743);return _0x4eaabd[_0x8135('0x20')](_0x8135('0x21'),_0x3b64be+'-'+_0x50aa2e+'/'+_0x242fdf)['json'](_0xc9553c);}return null;};}function patchUpdates(_0xcac0e4){return function(_0xc6e5ad){try{jsonpatch['apply'](_0xc6e5ad,_0xcac0e4,!![]);}catch(_0x83f13e){return BPromise[_0x8135('0x22')](_0x83f13e);}return _0xc6e5ad[_0x8135('0x23')]();};}function saveUpdates(_0xe8a241,_0x5365a0){return function(_0x25426b){if(_0x25426b){return _0x25426b[_0x8135('0x24')](_0xe8a241)[_0x8135('0x25')](function(_0x337f63){return _0x337f63;});}return null;};}function removeEntity(_0x26244f,_0x2a5e8b){return function(_0x54d4d8){if(_0x54d4d8){return _0x54d4d8[_0x8135('0x26')]()['then'](function(){_0x26244f['status'](0xcc)[_0x8135('0x1b')]();});}};}function handleEntityNotFound(_0x361b81,_0x49335b){return function(_0xb25e92){if(!_0xb25e92){_0x361b81[_0x8135('0x27')](0x194);}return _0xb25e92;};}function handleError(_0x143df5,_0x2665da){_0x2665da=_0x2665da||0x1f4;return function(_0x88305b){logger[_0x8135('0x28')](_0x88305b['stack']);if(_0x88305b[_0x8135('0x29')]){delete _0x88305b[_0x8135('0x29')];}_0x143df5[_0x8135('0x2a')](_0x2665da)['send'](_0x88305b);};}exports[_0x8135('0x2b')]=function(_0x1b5f3e,_0x495421){var _0x59b7e0={},_0x21a6d6={},_0x423f6a={'count':0x0,'rows':[]};var _0x151a1e=_[_0x8135('0x2c')](db[_0x8135('0x2d')][_0x8135('0x2e')],function(_0xfc02b2){return{'name':_0xfc02b2[_0x8135('0x2f')],'type':_0xfc02b2[_0x8135('0x30')][_0x8135('0x31')]};});_0x21a6d6['model']=_[_0x8135('0x2c')](_0x151a1e,'name');_0x21a6d6[_0x8135('0x32')]=_[_0x8135('0x33')](_0x1b5f3e[_0x8135('0x32')]);_0x21a6d6[_0x8135('0x34')]=_['intersection'](_0x21a6d6[_0x8135('0x35')],_0x21a6d6[_0x8135('0x32')]);_0x59b7e0[_0x8135('0x36')]=_[_0x8135('0x37')](_0x21a6d6[_0x8135('0x35')],qs[_0x8135('0x38')](_0x1b5f3e[_0x8135('0x32')][_0x8135('0x38')]));_0x59b7e0[_0x8135('0x36')]=_0x59b7e0[_0x8135('0x36')][_0x8135('0x39')]?_0x59b7e0[_0x8135('0x36')]:_0x21a6d6[_0x8135('0x35')];if(!_0x1b5f3e[_0x8135('0x32')][_0x8135('0x3a')](_0x8135('0x3b'))){_0x59b7e0[_0x8135('0x1e')]=qs[_0x8135('0x1e')](_0x1b5f3e[_0x8135('0x32')][_0x8135('0x1e')]);_0x59b7e0[_0x8135('0x1d')]=qs['offset'](_0x1b5f3e[_0x8135('0x32')][_0x8135('0x1d')]);}_0x59b7e0['order']=qs[_0x8135('0x3c')](_0x1b5f3e[_0x8135('0x32')][_0x8135('0x3c')]);_0x59b7e0[_0x8135('0x3d')]=qs[_0x8135('0x34')](_['pick'](_0x1b5f3e[_0x8135('0x32')],_0x21a6d6['filters']),_0x151a1e);if(_0x1b5f3e[_0x8135('0x32')][_0x8135('0x3e')]){_0x59b7e0['where']=_[_0x8135('0x3f')](_0x59b7e0['where'],{'$or':_[_0x8135('0x2c')](_0x151a1e,function(_0x2f7ffb){if(_0x2f7ffb[_0x8135('0x30')]!==_0x8135('0x40')){var _0x73bf24={};_0x73bf24[_0x2f7ffb['name']]={'$like':'%'+_0x1b5f3e[_0x8135('0x32')]['filter']+'%'};return _0x73bf24;}})});}_0x59b7e0=_[_0x8135('0x3f')]({},_0x59b7e0,_0x1b5f3e['options']);var _0x2545e7={'where':_0x59b7e0['where']};return db[_0x8135('0x2d')]['count'](_0x2545e7)[_0x8135('0x25')](function(_0x398e84){_0x423f6a[_0x8135('0x41')]=_0x398e84;if(_0x1b5f3e[_0x8135('0x32')][_0x8135('0x42')]){_0x59b7e0[_0x8135('0x43')]=[{'all':!![]}];}return db['MailSubstatus'][_0x8135('0x44')](_0x59b7e0);})[_0x8135('0x25')](function(_0x437d37){_0x423f6a[_0x8135('0x45')]=_0x437d37;return _0x423f6a;})[_0x8135('0x25')](respondWithFilteredResult(_0x495421,_0x59b7e0))[_0x8135('0x46')](handleError(_0x495421,null));};exports[_0x8135('0x47')]=function(_0x47b5eb,_0x5899ed){var _0x4bd539={'raw':!![],'where':{'id':_0x47b5eb[_0x8135('0x48')]['id']}},_0x3f84a2={};_0x3f84a2[_0x8135('0x35')]=_[_0x8135('0x33')](db['MailSubstatus'][_0x8135('0x2e')]);_0x3f84a2[_0x8135('0x32')]=_[_0x8135('0x33')](_0x47b5eb[_0x8135('0x32')]);_0x3f84a2[_0x8135('0x34')]=_[_0x8135('0x37')](_0x3f84a2[_0x8135('0x35')],_0x3f84a2[_0x8135('0x32')]);_0x4bd539[_0x8135('0x36')]=_[_0x8135('0x37')](_0x3f84a2[_0x8135('0x35')],qs[_0x8135('0x38')](_0x47b5eb[_0x8135('0x32')][_0x8135('0x38')]));_0x4bd539[_0x8135('0x36')]=_0x4bd539[_0x8135('0x36')][_0x8135('0x39')]?_0x4bd539[_0x8135('0x36')]:_0x3f84a2[_0x8135('0x35')];if(_0x47b5eb['query']['includeAll']){_0x4bd539[_0x8135('0x43')]=[{'all':!![]}];}_0x4bd539=_[_0x8135('0x3f')]({},_0x4bd539,_0x47b5eb[_0x8135('0x49')]);return db[_0x8135('0x2d')][_0x8135('0x4a')](_0x4bd539)[_0x8135('0x25')](handleEntityNotFound(_0x5899ed,null))[_0x8135('0x25')](respondWithResult(_0x5899ed,null))[_0x8135('0x46')](handleError(_0x5899ed,null));};exports[_0x8135('0x4b')]=function(_0x3e2fd0,_0xa72a13){return db['MailSubstatus'][_0x8135('0x4b')](_0x3e2fd0[_0x8135('0x4c')],{})[_0x8135('0x25')](respondWithResult(_0xa72a13,0xc9))[_0x8135('0x46')](handleError(_0xa72a13,null));};exports['update']=function(_0x2852f8,_0x3f32ea){if(_0x2852f8[_0x8135('0x4c')]['id']){delete _0x2852f8[_0x8135('0x4c')]['id'];}return db[_0x8135('0x2d')][_0x8135('0x4a')]({'where':{'id':_0x2852f8[_0x8135('0x48')]['id']}})[_0x8135('0x25')](handleEntityNotFound(_0x3f32ea,null))['then'](saveUpdates(_0x2852f8[_0x8135('0x4c')],null))[_0x8135('0x25')](respondWithResult(_0x3f32ea,null))[_0x8135('0x46')](handleError(_0x3f32ea,null));};exports[_0x8135('0x26')]=function(_0x56c5ef,_0x3033b7){return db[_0x8135('0x2d')][_0x8135('0x4a')]({'where':{'id':_0x56c5ef[_0x8135('0x48')]['id']}})[_0x8135('0x25')](handleEntityNotFound(_0x3033b7,null))[_0x8135('0x25')](removeEntity(_0x3033b7,null))['catch'](handleError(_0x3033b7,null));};exports['describe']=function(_0x57c28a,_0x37e150){return db['MailSubstatus'][_0x8135('0x4d')]()[_0x8135('0x25')](respondWithResult(_0x37e150,null))[_0x8135('0x46')](handleError(_0x37e150,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b772e5c..cf9d06a 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca6f=['events','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xca6f,0x1b0));var _0xfca6=function(_0x51906f,_0x141a5d){_0x51906f=_0x51906f-0x0;var _0x16047d=_0xca6f[_0x51906f];return _0x16047d;};'use strict';var EventEmitter=require(_0xfca6('0x0'));var MailSubstatus=require(_0xfca6('0x1'))['db'][_0xfca6('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xfca6('0x3')};function emitEvent(_0x40da55){return function(_0xfb172b,_0x4e7602,_0x31e6ab){MailSubstatusEvents[_0xfca6('0x4')](_0x40da55+':'+_0xfb172b['id'],_0xfb172b);MailSubstatusEvents[_0xfca6('0x4')](_0x40da55,_0xfb172b);_0x31e6ab(null);};}for(var e in events){if(events[_0xfca6('0x5')](e)){var event=events[e];MailSubstatus[_0xfca6('0x6')](e,emitEvent(event));}}module[_0xfca6('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x4505=['emit','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x38fcc2,_0x5e8d76){var _0x10a6f1=function(_0x27f98f){while(--_0x27f98f){_0x38fcc2['push'](_0x38fcc2['shift']());}};_0x10a6f1(++_0x5e8d76);}(_0x4505,0x163));var _0x5450=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4505[_0x21549c];return _0x426cbd;};'use strict';var EventEmitter=require(_0x5450('0x0'));var MailSubstatus=require(_0x5450('0x1'))['db'][_0x5450('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5450('0x3')](0x0);var events={'afterUpdate':_0x5450('0x4')};function emitEvent(_0x52d133){return function(_0x20ca01,_0x5a994d,_0x594c8c){MailSubstatusEvents[_0x5450('0x5')](_0x52d133+':'+_0x20ca01['id'],_0x20ca01);MailSubstatusEvents[_0x5450('0x5')](_0x52d133,_0x20ca01);_0x594c8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x5450('0x6')](e,emitEvent(event));}}module[_0x5450('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 14a6a30..dbbd9fc 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 _0x38f9=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','name','mailSubstatus','_previousDataValues'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0x38f9,0x1af));var _0x938f=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x38f9[_0x2555d0];return _0x3bb486;};'use strict';var attributes=require(_0x938f('0x0'));module[_0x938f('0x1')]=function(_0x31df20){var _0x55dd2f=_0x31df20[_0x938f('0x2')];return _0x31df20[_0x938f('0x3')](_0x938f('0x4'),attributes,{'tableName':_0x938f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x501ca3,_0x4b68b8,_0x99fa62){return _0x55dd2f['Condition']['update']({'value':_0x501ca3[_0x938f('0x6')]},{'where':{'field':_0x938f('0x7'),'value':_0x501ca3[_0x938f('0x8')][_0x938f('0x6')]}})[_0x938f('0x9')](function(){_0x99fa62();})[_0x938f('0xa')](function(_0x5a934e){_0x99fa62(_0x5a934e);});}}});}; \ No newline at end of file +var _0x5f23=['mailSubstatus','name','then','catch','./mailSubstatus.attributes','exports','define','mail_substatuses','Condition','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f23,0x7c));var _0x35f2=function(_0x4260c2,_0x3c4ef9){_0x4260c2=_0x4260c2-0x0;var _0x482f90=_0x5f23[_0x4260c2];return _0x482f90;};'use strict';var attributes=require(_0x35f2('0x0'));module[_0x35f2('0x1')]=function(_0x2cd0f3){var _0xb8aaf=_0x2cd0f3['models'];return _0x2cd0f3[_0x35f2('0x2')]('MailSubstatus',attributes,{'tableName':_0x35f2('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x19e704,_0x404767,_0x2cc58a){return _0xb8aaf[_0x35f2('0x4')][_0x35f2('0x5')]({'value':_0x19e704['name']},{'where':{'field':_0x35f2('0x6'),'value':_0x19e704['_previousDataValues'][_0x35f2('0x7')]}})[_0x35f2('0x8')](function(){_0x2cc58a();})[_0x35f2('0x9')](function(_0xb2b4dc){_0x2cc58a(_0xb2b4dc);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e2b81a5..ea26c6a 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 _0xfa44=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xfa44,0xd6));var _0x4fa4=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0xfa44[_0xb47dc0];return _0x57f0b0;};'use strict';var _=require(_0x4fa4('0x0'));var util=require(_0x4fa4('0x1'));var moment=require(_0x4fa4('0x2'));var BPromise=require(_0x4fa4('0x3'));var rs=require(_0x4fa4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fa4('0x5'))['db'];var utils=require(_0x4fa4('0x6'));var logger=require(_0x4fa4('0x7'))('rpc');var config=require(_0x4fa4('0x8'));var jayson=require(_0x4fa4('0x9'));var client=jayson[_0x4fa4('0xa')][_0x4fa4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15a2f2,_0x2b65f3,_0x146f02){return new BPromise(function(_0x24ef9b,_0x3188f0){return client['request'](_0x15a2f2,_0x146f02)[_0x4fa4('0xc')](function(_0x4368c9){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x2b65f3,'request\x20sent');logger[_0x4fa4('0xd')](_0x4fa4('0xe'),_0x2b65f3,_0x4fa4('0xf'),JSON[_0x4fa4('0x10')](_0x4368c9));if(_0x4368c9[_0x4fa4('0x11')]){if(_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x12')]===0x1f4){logger[_0x4fa4('0x11')](_0x4fa4('0x13'),_0x2b65f3,_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x14')]);return _0x3188f0(_0x4368c9[_0x4fa4('0x11')]['message']);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2b65f3,_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x14')]);return _0x24ef9b(_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x14')]);}else{logger[_0x4fa4('0x15')](_0x4fa4('0x13'),_0x2b65f3,'request\x20sent');_0x24ef9b(_0x4368c9[_0x4fa4('0x16')][_0x4fa4('0x14')]);}})[_0x4fa4('0x17')](function(_0x3eacf3){logger['error'](_0x4fa4('0x13'),_0x2b65f3,_0x3eacf3);_0x3188f0(_0x3eacf3);});});} \ No newline at end of file +var _0xe0b1=['MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x34d131,_0x2503b2){var _0x25023f=function(_0x41bac7){while(--_0x41bac7){_0x34d131['push'](_0x34d131['shift']());}};_0x25023f(++_0x2503b2);}(_0xe0b1,0x10c));var _0x1e0b=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0xe0b1[_0x4d8789];return _0x404e41;};'use strict';var _=require(_0x1e0b('0x0'));var util=require(_0x1e0b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e0b('0x2'));var db=require(_0x1e0b('0x3'))['db'];var utils=require(_0x1e0b('0x4'));var logger=require('../../config/logger')(_0x1e0b('0x5'));var config=require(_0x1e0b('0x6'));var jayson=require(_0x1e0b('0x7'));var client=jayson['client'][_0x1e0b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a8b2c,_0x41dbcd,_0x18eb33){return new BPromise(function(_0x28f7fc,_0x301ed1){return client[_0x1e0b('0x9')](_0x4a8b2c,_0x18eb33)[_0x1e0b('0xa')](function(_0xf816a8){logger[_0x1e0b('0xb')](_0x1e0b('0xc'),_0x41dbcd,_0x1e0b('0xd'));logger['debug'](_0x1e0b('0xe'),_0x41dbcd,'request\x20sent',JSON[_0x1e0b('0xf')](_0xf816a8));if(_0xf816a8[_0x1e0b('0x10')]){if(_0xf816a8[_0x1e0b('0x10')]['code']===0x1f4){logger[_0x1e0b('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x41dbcd,_0xf816a8[_0x1e0b('0x10')]['message']);return _0x301ed1(_0xf816a8[_0x1e0b('0x10')][_0x1e0b('0x11')]);}logger[_0x1e0b('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x41dbcd,_0xf816a8[_0x1e0b('0x10')][_0x1e0b('0x11')]);return _0x28f7fc(_0xf816a8['error'][_0x1e0b('0x11')]);}else{logger[_0x1e0b('0xb')](_0x1e0b('0xc'),_0x41dbcd,_0x1e0b('0xd'));_0x28f7fc(_0xf816a8[_0x1e0b('0x12')][_0x1e0b('0x11')]);}})[_0x1e0b('0x13')](function(_0x10a480){logger[_0x1e0b('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x41dbcd,_0x10a480);_0x301ed1(_0x10a480);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index aa279bb..be29d91 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 _0x561b=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','index','describe','show','post','isAuthenticated','create','/:id','update','delete'];(function(_0x1f5ae2,_0x74a260){var _0x4bd843=function(_0x153ea6){while(--_0x153ea6){_0x1f5ae2['push'](_0x1f5ae2['shift']());}};_0x4bd843(++_0x74a260);}(_0x561b,0x95));var _0xb561=function(_0x37943c,_0x43c93e){_0x37943c=_0x37943c-0x0;var _0x5948e2=_0x561b[_0x37943c];return _0x5948e2;};'use strict';var multer=require(_0xb561('0x0'));var util=require('util');var path=require(_0xb561('0x1'));var timeout=require(_0xb561('0x2'));var express=require(_0xb561('0x3'));var router=express[_0xb561('0x4')]();var fs_extra=require(_0xb561('0x5'));var auth=require(_0xb561('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb561('0x7'));var controller=require(_0xb561('0x8'));router[_0xb561('0x9')]('/',auth['isAuthenticated'](),controller[_0xb561('0xa')]);router[_0xb561('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb561('0xb')]);router[_0xb561('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb561('0xc')]);router[_0xb561('0xd')]('/',auth[_0xb561('0xe')](),controller[_0xb561('0xf')]);router['put'](_0xb561('0x10'),auth[_0xb561('0xe')](),controller[_0xb561('0x11')]);router[_0xb561('0x12')](_0xb561('0x10'),auth[_0xb561('0xe')](),controller[_0xb561('0x13')]);module[_0xb561('0x14')]=router; \ No newline at end of file +var _0x712b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer','path'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x712b,0x116));var _0xb712=function(_0x79a6af,_0x38907f){_0x79a6af=_0x79a6af-0x0;var _0x5511e0=_0x712b[_0x79a6af];return _0x5511e0;};'use strict';var multer=require(_0xb712('0x0'));var util=require('util');var path=require(_0xb712('0x1'));var timeout=require(_0xb712('0x2'));var express=require(_0xb712('0x3'));var router=express[_0xb712('0x4')]();var fs_extra=require(_0xb712('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb712('0x6'));var config=require(_0xb712('0x7'));var controller=require('./mailTransferReport.controller');router[_0xb712('0x8')]('/',auth[_0xb712('0x9')](),controller[_0xb712('0xa')]);router[_0xb712('0x8')](_0xb712('0xb'),auth[_0xb712('0x9')](),controller[_0xb712('0xc')]);router['get'](_0xb712('0xd'),auth[_0xb712('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb712('0xe')]);router[_0xb712('0xf')](_0xb712('0xd'),auth[_0xb712('0x9')](),controller[_0xb712('0x10')]);router[_0xb712('0x11')]('/:id',auth[_0xb712('0x9')](),controller[_0xb712('0x12')]);module[_0xb712('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 11f7487..dc719ee 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x495a74,_0x426732){var _0x5aa75c=function(_0x25748e){while(--_0x25748e){_0x495a74['push'](_0x495a74['shift']());}};_0x5aa75c(++_0x426732);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x00bb[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4d9d1e,_0x3c2d20){var _0x1b9d54=function(_0x373c21){while(--_0x373c21){_0x4d9d1e['push'](_0x4d9d1e['shift']());}};_0x1b9d54(++_0x3c2d20);}(_0x34e8,0x12c));var _0x834e=function(_0x2cff0,_0x578279){_0x2cff0=_0x2cff0-0x0;var _0x541733=_0x34e8[_0x2cff0];return _0x541733;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index aa96f42..c729604 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 _0x75f7=['save','update','then','destroy','error','stack','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x1f535b,_0xc42523){var _0x5bb329=function(_0xcaa78d){while(--_0xcaa78d){_0x1f535b['push'](_0x1f535b['shift']());}};_0x5bb329(++_0xc42523);}(_0x75f7,0x1a3));var _0x775f=function(_0x1c87f4,_0x7501a5){_0x1c87f4=_0x1c87f4-0x0;var _0x331974=_0x75f7[_0x1c87f4];return _0x331974;};'use strict';var emlformat=require(_0x775f('0x0'));var rimraf=require(_0x775f('0x1'));var zipdir=require(_0x775f('0x2'));var jsonpatch=require(_0x775f('0x3'));var rp=require(_0x775f('0x4'));var moment=require('moment');var BPromise=require(_0x775f('0x5'));var Mustache=require(_0x775f('0x6'));var util=require('util');var path=require(_0x775f('0x7'));var sox=require(_0x775f('0x8'));var csv=require('to-csv');var ejs=require(_0x775f('0x9'));var fs=require('fs');var fs_extra=require(_0x775f('0xa'));var _=require('lodash');var squel=require(_0x775f('0xb'));var crypto=require(_0x775f('0xc'));var jsforce=require(_0x775f('0xd'));var deskjs=require(_0x775f('0xe'));var toCsv=require(_0x775f('0xf'));var querystring=require(_0x775f('0x10'));var Papa=require('papaparse');var Redis=require(_0x775f('0x11'));var authService=require(_0x775f('0x12'));var qs=require(_0x775f('0x13'));var as=require(_0x775f('0x14'));var hardwareService=require(_0x775f('0x15'));var logger=require(_0x775f('0x16'))('api');var utils=require(_0x775f('0x17'));var config=require(_0x775f('0x18'));var licenseUtil=require(_0x775f('0x19'));var db=require(_0x775f('0x1a'))['db'];function respondWithStatusCode(_0x4fec2d,_0xc3feb0){_0xc3feb0=_0xc3feb0||0xcc;return function(_0x3f4a9f){if(_0x3f4a9f){return _0x4fec2d[_0x775f('0x1b')](_0xc3feb0);}return _0x4fec2d[_0x775f('0x1c')](_0xc3feb0)[_0x775f('0x1d')]();};}function respondWithResult(_0x157876,_0x5e92f6){_0x5e92f6=_0x5e92f6||0xc8;return function(_0x18d279){if(_0x18d279){return _0x157876[_0x775f('0x1c')](_0x5e92f6)[_0x775f('0x1e')](_0x18d279);}};}function respondWithFilteredResult(_0x5d40a2,_0x4dd141){return function(_0x2ed9d5){if(_0x2ed9d5){var _0x58385d=typeof _0x4dd141[_0x775f('0x1f')]===_0x775f('0x20')&&typeof _0x4dd141[_0x775f('0x21')]==='undefined';var _0x3ac7d9=_0x2ed9d5[_0x775f('0x22')];var _0x2d0fd0=_0x58385d?0x0:_0x4dd141['offset'];var _0x8f3fd2=_0x58385d?_0x2ed9d5[_0x775f('0x22')]:_0x4dd141[_0x775f('0x1f')]+_0x4dd141[_0x775f('0x21')];var _0xa9f312;if(_0x8f3fd2>=_0x3ac7d9){_0x8f3fd2=_0x3ac7d9;_0xa9f312=0xc8;}else{_0xa9f312=0xce;}_0x5d40a2[_0x775f('0x1c')](_0xa9f312);return _0x5d40a2['set']('Content-Range',_0x2d0fd0+'-'+_0x8f3fd2+'/'+_0x3ac7d9)[_0x775f('0x1e')](_0x2ed9d5);}return null;};}function patchUpdates(_0x46f4cd){return function(_0x21153b){try{jsonpatch[_0x775f('0x23')](_0x21153b,_0x46f4cd,!![]);}catch(_0x1b7706){return BPromise[_0x775f('0x24')](_0x1b7706);}return _0x21153b[_0x775f('0x25')]();};}function saveUpdates(_0x1c1eb9,_0x295373){return function(_0x565043){if(_0x565043){return _0x565043[_0x775f('0x26')](_0x1c1eb9)[_0x775f('0x27')](function(_0x286479){return _0x286479;});}return null;};}function removeEntity(_0x5d84b5,_0x5b663b){return function(_0x1981f8){if(_0x1981f8){return _0x1981f8[_0x775f('0x28')]()[_0x775f('0x27')](function(){_0x5d84b5[_0x775f('0x1c')](0xcc)[_0x775f('0x1d')]();});}};}function handleEntityNotFound(_0x27dff3,_0x34b636){return function(_0x51f742){if(!_0x51f742){_0x27dff3['sendStatus'](0x194);}return _0x51f742;};}function handleError(_0x2549d2,_0x1f54a9){_0x1f54a9=_0x1f54a9||0x1f4;return function(_0x19d83f){logger[_0x775f('0x29')](_0x19d83f[_0x775f('0x2a')]);if(_0x19d83f['name']){delete _0x19d83f['name'];}_0x2549d2[_0x775f('0x1c')](_0x1f54a9)[_0x775f('0x2b')](_0x19d83f);};}exports['index']=function(_0x28031c,_0x2d14fc){var _0x3d3abb={},_0x2e3ea1={},_0x5e5e17={'count':0x0,'rows':[]};var _0x380414=_[_0x775f('0x2c')](db[_0x775f('0x2d')][_0x775f('0x2e')],function(_0x399fa5){return{'name':_0x399fa5[_0x775f('0x2f')],'type':_0x399fa5[_0x775f('0x30')][_0x775f('0x31')]};});_0x2e3ea1[_0x775f('0x32')]=_[_0x775f('0x2c')](_0x380414,_0x775f('0x33'));_0x2e3ea1[_0x775f('0x34')]=_['keys'](_0x28031c[_0x775f('0x34')]);_0x2e3ea1[_0x775f('0x35')]=_[_0x775f('0x36')](_0x2e3ea1['model'],_0x2e3ea1[_0x775f('0x34')]);_0x3d3abb[_0x775f('0x37')]=_[_0x775f('0x36')](_0x2e3ea1['model'],qs[_0x775f('0x38')](_0x28031c['query']['fields']));_0x3d3abb['attributes']=_0x3d3abb[_0x775f('0x37')][_0x775f('0x39')]?_0x3d3abb[_0x775f('0x37')]:_0x2e3ea1[_0x775f('0x32')];if(!_0x28031c['query'][_0x775f('0x3a')]('nolimit')){_0x3d3abb[_0x775f('0x21')]=qs[_0x775f('0x21')](_0x28031c[_0x775f('0x34')][_0x775f('0x21')]);_0x3d3abb[_0x775f('0x1f')]=qs[_0x775f('0x1f')](_0x28031c[_0x775f('0x34')][_0x775f('0x1f')]);}_0x3d3abb[_0x775f('0x3b')]=qs[_0x775f('0x3c')](_0x28031c[_0x775f('0x34')][_0x775f('0x3c')]);_0x3d3abb[_0x775f('0x3d')]=qs[_0x775f('0x35')](_[_0x775f('0x3e')](_0x28031c['query'],_0x2e3ea1['filters']),_0x380414);if(_0x28031c[_0x775f('0x34')][_0x775f('0x3f')]){_0x3d3abb[_0x775f('0x3d')]=_[_0x775f('0x40')](_0x3d3abb[_0x775f('0x3d')],{'$or':_[_0x775f('0x2c')](_0x380414,function(_0x2cc163){if(_0x2cc163['type']!==_0x775f('0x41')){var _0x1409a7={};_0x1409a7[_0x2cc163[_0x775f('0x33')]]={'$like':'%'+_0x28031c[_0x775f('0x34')][_0x775f('0x3f')]+'%'};return _0x1409a7;}})});}_0x3d3abb=_[_0x775f('0x40')]({},_0x3d3abb,_0x28031c[_0x775f('0x42')]);var _0x391b4d={'where':_0x3d3abb[_0x775f('0x3d')]};return db['MailTransferReport']['count'](_0x391b4d)[_0x775f('0x27')](function(_0x16e6ba){_0x5e5e17['count']=_0x16e6ba;if(_0x28031c[_0x775f('0x34')][_0x775f('0x43')]){_0x3d3abb[_0x775f('0x44')]=[{'all':!![]}];}return db[_0x775f('0x2d')]['findAll'](_0x3d3abb);})[_0x775f('0x27')](function(_0x4056dc){_0x5e5e17['rows']=_0x4056dc;return _0x5e5e17;})[_0x775f('0x27')](respondWithFilteredResult(_0x2d14fc,_0x3d3abb))[_0x775f('0x45')](handleError(_0x2d14fc,null));};exports['show']=function(_0x39685e,_0x31b3fe){var _0x5c34c7={'raw':!![],'where':{'id':_0x39685e[_0x775f('0x46')]['id']}},_0x2ed1c1={};_0x2ed1c1[_0x775f('0x32')]=_[_0x775f('0x47')](db['MailTransferReport']['rawAttributes']);_0x2ed1c1[_0x775f('0x34')]=_[_0x775f('0x47')](_0x39685e[_0x775f('0x34')]);_0x2ed1c1[_0x775f('0x35')]=_[_0x775f('0x36')](_0x2ed1c1[_0x775f('0x32')],_0x2ed1c1[_0x775f('0x34')]);_0x5c34c7[_0x775f('0x37')]=_[_0x775f('0x36')](_0x2ed1c1['model'],qs[_0x775f('0x38')](_0x39685e['query'][_0x775f('0x38')]));_0x5c34c7[_0x775f('0x37')]=_0x5c34c7[_0x775f('0x37')][_0x775f('0x39')]?_0x5c34c7[_0x775f('0x37')]:_0x2ed1c1[_0x775f('0x32')];if(_0x39685e[_0x775f('0x34')][_0x775f('0x43')]){_0x5c34c7['include']=[{'all':!![]}];}_0x5c34c7=_[_0x775f('0x40')]({},_0x5c34c7,_0x39685e[_0x775f('0x42')]);return db[_0x775f('0x2d')]['find'](_0x5c34c7)[_0x775f('0x27')](handleEntityNotFound(_0x31b3fe,null))['then'](respondWithResult(_0x31b3fe,null))[_0x775f('0x45')](handleError(_0x31b3fe,null));};exports[_0x775f('0x48')]=function(_0x373538,_0x34700c){return db[_0x775f('0x2d')][_0x775f('0x48')](_0x373538[_0x775f('0x49')],{})[_0x775f('0x27')](respondWithResult(_0x34700c,0xc9))[_0x775f('0x45')](handleError(_0x34700c,null));};exports[_0x775f('0x26')]=function(_0x122014,_0x3ff651){if(_0x122014[_0x775f('0x49')]['id']){delete _0x122014['body']['id'];}return db[_0x775f('0x2d')][_0x775f('0x4a')]({'where':{'id':_0x122014[_0x775f('0x46')]['id']}})[_0x775f('0x27')](handleEntityNotFound(_0x3ff651,null))[_0x775f('0x27')](saveUpdates(_0x122014[_0x775f('0x49')],null))[_0x775f('0x27')](respondWithResult(_0x3ff651,null))[_0x775f('0x45')](handleError(_0x3ff651,null));};exports['destroy']=function(_0x37c726,_0x40397f){return db[_0x775f('0x2d')]['find']({'where':{'id':_0x37c726[_0x775f('0x46')]['id']}})[_0x775f('0x27')](handleEntityNotFound(_0x40397f,null))[_0x775f('0x27')](removeEntity(_0x40397f,null))[_0x775f('0x45')](handleError(_0x40397f,null));};exports[_0x775f('0x4b')]=function(_0x4844e1,_0x41cb90){return db['MailTransferReport'][_0x775f('0x4b')]()['then'](respondWithResult(_0x41cb90,null))['catch'](handleError(_0x41cb90,null));}; \ No newline at end of file +var _0xaa8d=['type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','MailTransferReport','rawAttributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xaa8d,0x190));var _0xdaa8=function(_0x45ec02,_0x4dc118){_0x45ec02=_0x45ec02-0x0;var _0x5c5503=_0xaa8d[_0x45ec02];return _0x5c5503;};'use strict';var emlformat=require(_0xdaa8('0x0'));var rimraf=require(_0xdaa8('0x1'));var zipdir=require(_0xdaa8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdaa8('0x3'));var moment=require(_0xdaa8('0x4'));var BPromise=require(_0xdaa8('0x5'));var Mustache=require(_0xdaa8('0x6'));var util=require(_0xdaa8('0x7'));var path=require(_0xdaa8('0x8'));var sox=require(_0xdaa8('0x9'));var csv=require(_0xdaa8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdaa8('0xb'));var squel=require(_0xdaa8('0xc'));var crypto=require(_0xdaa8('0xd'));var jsforce=require(_0xdaa8('0xe'));var deskjs=require(_0xdaa8('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdaa8('0x10'));var Papa=require('papaparse');var Redis=require(_0xdaa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdaa8('0x12'));var as=require(_0xdaa8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdaa8('0x14'));var config=require(_0xdaa8('0x15'));var licenseUtil=require(_0xdaa8('0x16'));var db=require(_0xdaa8('0x17'))['db'];function respondWithStatusCode(_0x359cae,_0x4224e2){_0x4224e2=_0x4224e2||0xcc;return function(_0x1deb5c){if(_0x1deb5c){return _0x359cae['sendStatus'](_0x4224e2);}return _0x359cae['status'](_0x4224e2)[_0xdaa8('0x18')]();};}function respondWithResult(_0x407db0,_0x42384e){_0x42384e=_0x42384e||0xc8;return function(_0x22753e){if(_0x22753e){return _0x407db0[_0xdaa8('0x19')](_0x42384e)[_0xdaa8('0x1a')](_0x22753e);}};}function respondWithFilteredResult(_0x272c94,_0x3b3a72){return function(_0x3dd279){if(_0x3dd279){var _0x333ade=typeof _0x3b3a72['offset']===_0xdaa8('0x1b')&&typeof _0x3b3a72['limit']===_0xdaa8('0x1b');var _0x2ab224=_0x3dd279[_0xdaa8('0x1c')];var _0x3fcfa2=_0x333ade?0x0:_0x3b3a72[_0xdaa8('0x1d')];var _0x4b0d87=_0x333ade?_0x3dd279[_0xdaa8('0x1c')]:_0x3b3a72[_0xdaa8('0x1d')]+_0x3b3a72['limit'];var _0x42a02e;if(_0x4b0d87>=_0x2ab224){_0x4b0d87=_0x2ab224;_0x42a02e=0xc8;}else{_0x42a02e=0xce;}_0x272c94[_0xdaa8('0x19')](_0x42a02e);return _0x272c94['set'](_0xdaa8('0x1e'),_0x3fcfa2+'-'+_0x4b0d87+'/'+_0x2ab224)[_0xdaa8('0x1a')](_0x3dd279);}return null;};}function patchUpdates(_0xe7c324){return function(_0xfd3d32){try{jsonpatch[_0xdaa8('0x1f')](_0xfd3d32,_0xe7c324,!![]);}catch(_0x29a757){return BPromise[_0xdaa8('0x20')](_0x29a757);}return _0xfd3d32[_0xdaa8('0x21')]();};}function saveUpdates(_0x58716d,_0x4ea181){return function(_0x2554ac){if(_0x2554ac){return _0x2554ac[_0xdaa8('0x22')](_0x58716d)[_0xdaa8('0x23')](function(_0x455902){return _0x455902;});}return null;};}function removeEntity(_0x2bd8f0,_0x5c31b2){return function(_0xf2cb4e){if(_0xf2cb4e){return _0xf2cb4e[_0xdaa8('0x24')]()[_0xdaa8('0x23')](function(){_0x2bd8f0[_0xdaa8('0x19')](0xcc)[_0xdaa8('0x18')]();});}};}function handleEntityNotFound(_0x9171fb,_0x4303a0){return function(_0x377cbf){if(!_0x377cbf){_0x9171fb[_0xdaa8('0x25')](0x194);}return _0x377cbf;};}function handleError(_0x301813,_0x58c38e){_0x58c38e=_0x58c38e||0x1f4;return function(_0x55b4f8){logger['error'](_0x55b4f8[_0xdaa8('0x26')]);if(_0x55b4f8['name']){delete _0x55b4f8[_0xdaa8('0x27')];}_0x301813[_0xdaa8('0x19')](_0x58c38e)['send'](_0x55b4f8);};}exports[_0xdaa8('0x28')]=function(_0x3c756e,_0x44a999){var _0xcc17b0={},_0x3511ae={},_0x4eb586={'count':0x0,'rows':[]};var _0x2906e9=_[_0xdaa8('0x29')](db[_0xdaa8('0x2a')][_0xdaa8('0x2b')],function(_0x4d6c2d){return{'name':_0x4d6c2d['fieldName'],'type':_0x4d6c2d[_0xdaa8('0x2c')][_0xdaa8('0x2d')]};});_0x3511ae[_0xdaa8('0x2e')]=_[_0xdaa8('0x29')](_0x2906e9,_0xdaa8('0x27'));_0x3511ae[_0xdaa8('0x2f')]=_[_0xdaa8('0x30')](_0x3c756e[_0xdaa8('0x2f')]);_0x3511ae[_0xdaa8('0x31')]=_[_0xdaa8('0x32')](_0x3511ae[_0xdaa8('0x2e')],_0x3511ae[_0xdaa8('0x2f')]);_0xcc17b0[_0xdaa8('0x33')]=_[_0xdaa8('0x32')](_0x3511ae['model'],qs[_0xdaa8('0x34')](_0x3c756e['query']['fields']));_0xcc17b0[_0xdaa8('0x33')]=_0xcc17b0[_0xdaa8('0x33')]['length']?_0xcc17b0['attributes']:_0x3511ae[_0xdaa8('0x2e')];if(!_0x3c756e[_0xdaa8('0x2f')][_0xdaa8('0x35')]('nolimit')){_0xcc17b0['limit']=qs[_0xdaa8('0x36')](_0x3c756e[_0xdaa8('0x2f')][_0xdaa8('0x36')]);_0xcc17b0[_0xdaa8('0x1d')]=qs[_0xdaa8('0x1d')](_0x3c756e[_0xdaa8('0x2f')][_0xdaa8('0x1d')]);}_0xcc17b0['order']=qs[_0xdaa8('0x37')](_0x3c756e[_0xdaa8('0x2f')]['sort']);_0xcc17b0[_0xdaa8('0x38')]=qs[_0xdaa8('0x31')](_[_0xdaa8('0x39')](_0x3c756e['query'],_0x3511ae[_0xdaa8('0x31')]),_0x2906e9);if(_0x3c756e[_0xdaa8('0x2f')][_0xdaa8('0x3a')]){_0xcc17b0['where']=_['merge'](_0xcc17b0[_0xdaa8('0x38')],{'$or':_[_0xdaa8('0x29')](_0x2906e9,function(_0x2fd7c5){if(_0x2fd7c5[_0xdaa8('0x2c')]!==_0xdaa8('0x3b')){var _0x38c88a={};_0x38c88a[_0x2fd7c5[_0xdaa8('0x27')]]={'$like':'%'+_0x3c756e[_0xdaa8('0x2f')][_0xdaa8('0x3a')]+'%'};return _0x38c88a;}})});}_0xcc17b0=_[_0xdaa8('0x3c')]({},_0xcc17b0,_0x3c756e[_0xdaa8('0x3d')]);var _0x36b71e={'where':_0xcc17b0[_0xdaa8('0x38')]};return db[_0xdaa8('0x2a')][_0xdaa8('0x1c')](_0x36b71e)[_0xdaa8('0x23')](function(_0x102ba6){_0x4eb586[_0xdaa8('0x1c')]=_0x102ba6;if(_0x3c756e[_0xdaa8('0x2f')][_0xdaa8('0x3e')]){_0xcc17b0[_0xdaa8('0x3f')]=[{'all':!![]}];}return db[_0xdaa8('0x2a')][_0xdaa8('0x40')](_0xcc17b0);})[_0xdaa8('0x23')](function(_0x3199a9){_0x4eb586[_0xdaa8('0x41')]=_0x3199a9;return _0x4eb586;})['then'](respondWithFilteredResult(_0x44a999,_0xcc17b0))[_0xdaa8('0x42')](handleError(_0x44a999,null));};exports[_0xdaa8('0x43')]=function(_0x4fcaac,_0x297d31){var _0x5e35fe={'raw':!![],'where':{'id':_0x4fcaac[_0xdaa8('0x44')]['id']}},_0x54ca88={};_0x54ca88[_0xdaa8('0x2e')]=_[_0xdaa8('0x30')](db[_0xdaa8('0x2a')]['rawAttributes']);_0x54ca88[_0xdaa8('0x2f')]=_['keys'](_0x4fcaac[_0xdaa8('0x2f')]);_0x54ca88['filters']=_['intersection'](_0x54ca88['model'],_0x54ca88[_0xdaa8('0x2f')]);_0x5e35fe[_0xdaa8('0x33')]=_[_0xdaa8('0x32')](_0x54ca88[_0xdaa8('0x2e')],qs[_0xdaa8('0x34')](_0x4fcaac[_0xdaa8('0x2f')]['fields']));_0x5e35fe[_0xdaa8('0x33')]=_0x5e35fe[_0xdaa8('0x33')][_0xdaa8('0x45')]?_0x5e35fe['attributes']:_0x54ca88[_0xdaa8('0x2e')];if(_0x4fcaac[_0xdaa8('0x2f')][_0xdaa8('0x3e')]){_0x5e35fe[_0xdaa8('0x3f')]=[{'all':!![]}];}_0x5e35fe=_[_0xdaa8('0x3c')]({},_0x5e35fe,_0x4fcaac[_0xdaa8('0x3d')]);return db[_0xdaa8('0x2a')][_0xdaa8('0x46')](_0x5e35fe)[_0xdaa8('0x23')](handleEntityNotFound(_0x297d31,null))['then'](respondWithResult(_0x297d31,null))[_0xdaa8('0x42')](handleError(_0x297d31,null));};exports[_0xdaa8('0x47')]=function(_0x15c080,_0x57fc81){return db[_0xdaa8('0x2a')][_0xdaa8('0x47')](_0x15c080[_0xdaa8('0x48')],{})[_0xdaa8('0x23')](respondWithResult(_0x57fc81,0xc9))[_0xdaa8('0x42')](handleError(_0x57fc81,null));};exports['update']=function(_0x45ac3c,_0x365734){if(_0x45ac3c[_0xdaa8('0x48')]['id']){delete _0x45ac3c[_0xdaa8('0x48')]['id'];}return db[_0xdaa8('0x2a')][_0xdaa8('0x46')]({'where':{'id':_0x45ac3c[_0xdaa8('0x44')]['id']}})['then'](handleEntityNotFound(_0x365734,null))[_0xdaa8('0x23')](saveUpdates(_0x45ac3c[_0xdaa8('0x48')],null))[_0xdaa8('0x23')](respondWithResult(_0x365734,null))['catch'](handleError(_0x365734,null));};exports['destroy']=function(_0x3882c3,_0x1f5d91){return db[_0xdaa8('0x2a')][_0xdaa8('0x46')]({'where':{'id':_0x3882c3['params']['id']}})[_0xdaa8('0x23')](handleEntityNotFound(_0x1f5d91,null))[_0xdaa8('0x23')](removeEntity(_0x1f5d91,null))[_0xdaa8('0x42')](handleError(_0x1f5d91,null));};exports[_0xdaa8('0x49')]=function(_0x3b1c82,_0x15f32b){return db['MailTransferReport'][_0xdaa8('0x49')]()['then'](respondWithResult(_0x15f32b,null))[_0xdaa8('0x42')](handleError(_0x15f32b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 802693f..8e080c0 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 _0x3c2a=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x13b07a,_0x49cfc3){var _0xdcbe0=function(_0x45dee2){while(--_0x45dee2){_0x13b07a['push'](_0x13b07a['shift']());}};_0xdcbe0(++_0x49cfc3);}(_0x3c2a,0x1b2));var _0xa3c2=function(_0x254532,_0x41d920){_0x254532=_0x254532-0x0;var _0x3edec4=_0x3c2a[_0x254532];return _0x3edec4;};'use strict';var _=require(_0xa3c2('0x0'));var util=require(_0xa3c2('0x1'));var logger=require('../../config/logger')(_0xa3c2('0x2'));var moment=require('moment');var BPromise=require(_0xa3c2('0x3'));var rp=require(_0xa3c2('0x4'));var fs=require('fs');var path=require(_0xa3c2('0x5'));var rimraf=require(_0xa3c2('0x6'));var config=require(_0xa3c2('0x7'));var attributes=require(_0xa3c2('0x8'));module[_0xa3c2('0x9')]=function(_0x230a89,_0x45a0b6){return _0x230a89[_0xa3c2('0xa')](_0xa3c2('0xb'),attributes,{'tableName':_0xa3c2('0xc'),'paranoid':![],'indexes':[{'name':_0xa3c2('0xd'),'fields':[_0xa3c2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e92=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger'];(function(_0x100fb6,_0x447620){var _0x78101=function(_0x4caa04){while(--_0x4caa04){_0x100fb6['push'](_0x100fb6['shift']());}};_0x78101(++_0x447620);}(_0x1e92,0x1df));var _0x21e9=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x1e92[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x21e9('0x0'));var util=require('util');var logger=require(_0x21e9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x21e9('0x2'));var rp=require(_0x21e9('0x3'));var fs=require('fs');var path=require(_0x21e9('0x4'));var rimraf=require(_0x21e9('0x5'));var config=require(_0x21e9('0x6'));var attributes=require(_0x21e9('0x7'));module[_0x21e9('0x8')]=function(_0x3212cb,_0x54b40a){return _0x3212cb[_0x21e9('0x9')](_0x21e9('0xa'),attributes,{'tableName':_0x21e9('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x21e9('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 93e7d08..e20e647 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 _0xa70d=['../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa70d,0xec));var _0xda70=function(_0x2c5b0c,_0x1c1f86){_0x2c5b0c=_0x2c5b0c-0x0;var _0x2f52c7=_0xa70d[_0x2c5b0c];return _0x2f52c7;};'use strict';var _=require(_0xda70('0x0'));var util=require(_0xda70('0x1'));var moment=require(_0xda70('0x2'));var BPromise=require('bluebird');var rs=require(_0xda70('0x3'));var fs=require('fs');var Redis=require(_0xda70('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda70('0x5'));var config=require(_0xda70('0x6'));var jayson=require(_0xda70('0x7'));var client=jayson[_0xda70('0x8')][_0xda70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22f074,_0x24c6a6,_0x555c9b){return new BPromise(function(_0x714c26,_0x4a7375){return client[_0xda70('0xa')](_0x22f074,_0x555c9b)[_0xda70('0xb')](function(_0x42d48f){logger[_0xda70('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x24c6a6,'request\x20sent');logger['debug'](_0xda70('0xd'),_0x24c6a6,_0xda70('0xe'),JSON[_0xda70('0xf')](_0x42d48f));if(_0x42d48f[_0xda70('0x10')]){if(_0x42d48f[_0xda70('0x10')][_0xda70('0x11')]===0x1f4){logger['error'](_0xda70('0x12'),_0x24c6a6,_0x42d48f[_0xda70('0x10')][_0xda70('0x13')]);return _0x4a7375(_0x42d48f['error'][_0xda70('0x13')]);}logger[_0xda70('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x24c6a6,_0x42d48f['error'][_0xda70('0x13')]);return _0x714c26(_0x42d48f[_0xda70('0x10')][_0xda70('0x13')]);}else{logger[_0xda70('0xc')](_0xda70('0x12'),_0x24c6a6,_0xda70('0xe'));_0x714c26(_0x42d48f[_0xda70('0x14')][_0xda70('0x13')]);}})[_0xda70('0x15')](function(_0x434227){logger[_0xda70('0x10')](_0xda70('0x12'),_0x24c6a6,_0x434227);_0x4a7375(_0x434227);});});} \ No newline at end of file +var _0xa116=['http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xa116,0x12b));var _0x6a11=function(_0x2fbb8a,_0x2689b6){_0x2fbb8a=_0x2fbb8a-0x0;var _0x319ff4=_0xa116[_0x2fbb8a];return _0x319ff4;};'use strict';var _=require(_0x6a11('0x0'));var util=require(_0x6a11('0x1'));var moment=require(_0x6a11('0x2'));var BPromise=require(_0x6a11('0x3'));var rs=require(_0x6a11('0x4'));var fs=require('fs');var Redis=require(_0x6a11('0x5'));var db=require(_0x6a11('0x6'))['db'];var utils=require(_0x6a11('0x7'));var logger=require(_0x6a11('0x8'))(_0x6a11('0x9'));var config=require(_0x6a11('0xa'));var jayson=require(_0x6a11('0xb'));var client=jayson[_0x6a11('0xc')][_0x6a11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5ba639,_0x4371e0,_0x2d9597){return new BPromise(function(_0x7abe16,_0x359030){return client[_0x6a11('0xe')](_0x5ba639,_0x2d9597)[_0x6a11('0xf')](function(_0x31c9f6){logger['info'](_0x6a11('0x10'),_0x4371e0,_0x6a11('0x11'));logger[_0x6a11('0x12')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4371e0,_0x6a11('0x11'),JSON[_0x6a11('0x13')](_0x31c9f6));if(_0x31c9f6[_0x6a11('0x14')]){if(_0x31c9f6[_0x6a11('0x14')][_0x6a11('0x15')]===0x1f4){logger[_0x6a11('0x14')](_0x6a11('0x10'),_0x4371e0,_0x31c9f6[_0x6a11('0x14')][_0x6a11('0x16')]);return _0x359030(_0x31c9f6[_0x6a11('0x14')][_0x6a11('0x16')]);}logger[_0x6a11('0x14')](_0x6a11('0x10'),_0x4371e0,_0x31c9f6['error'][_0x6a11('0x16')]);return _0x7abe16(_0x31c9f6[_0x6a11('0x14')]['message']);}else{logger[_0x6a11('0x17')]('MailTransferReport,\x20%s,\x20%s',_0x4371e0,_0x6a11('0x11'));_0x7abe16(_0x31c9f6[_0x6a11('0x18')][_0x6a11('0x16')]);}})[_0x6a11('0x19')](function(_0x4ef093){logger['error'](_0x6a11('0x10'),_0x4371e0,_0x4ef093);_0x359030(_0x4ef093);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a10e287..dc0c719 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 _0x9405=['../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9405,0x19b));var _0x5940=function(_0x17ab07,_0x175fa0){_0x17ab07=_0x17ab07-0x0;var _0x5754d0=_0x9405[_0x17ab07];return _0x5754d0;};'use strict';var multer=require(_0x5940('0x0'));var util=require(_0x5940('0x1'));var path=require(_0x5940('0x2'));var timeout=require(_0x5940('0x3'));var express=require(_0x5940('0x4'));var router=express[_0x5940('0x5')]();var fs_extra=require(_0x5940('0x6'));var auth=require(_0x5940('0x7'));var interaction=require(_0x5940('0x8'));var config=require(_0x5940('0x9'));var controller=require(_0x5940('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x5940('0xb')]);router[_0x5940('0xc')](_0x5940('0xd'),auth[_0x5940('0xe')](),controller[_0x5940('0xf')]);router[_0x5940('0xc')](_0x5940('0x10'),auth[_0x5940('0xe')](),controller[_0x5940('0x11')]);router[_0x5940('0x12')]('/',auth[_0x5940('0xe')](),controller[_0x5940('0x13')]);router['put'](_0x5940('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x5940('0x14')](_0x5940('0x10'),auth[_0x5940('0xe')](),controller['destroy']);module[_0x5940('0x15')]=router; \ No newline at end of file +var _0xad75=['connect-timeout','express','../../components/auth/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0xad75,0x1a9));var _0x5ad7=function(_0x4128ce,_0x17ce36){_0x4128ce=_0x4128ce-0x0;var _0x1d3c9c=_0xad75[_0x4128ce];return _0x1d3c9c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5ad7('0x0'));var express=require(_0x5ad7('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ad7('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5ad7('0x3'));router[_0x5ad7('0x4')]('/',auth[_0x5ad7('0x5')](),controller[_0x5ad7('0x6')]);router[_0x5ad7('0x4')](_0x5ad7('0x7'),auth[_0x5ad7('0x5')](),controller[_0x5ad7('0x8')]);router['get'](_0x5ad7('0x9'),auth['isAuthenticated'](),controller[_0x5ad7('0xa')]);router['post']('/',auth[_0x5ad7('0x5')](),controller[_0x5ad7('0xb')]);router[_0x5ad7('0xc')]('/:id',auth[_0x5ad7('0x5')](),controller[_0x5ad7('0xd')]);router[_0x5ad7('0xe')]('/:id',auth[_0x5ad7('0x5')](),controller[_0x5ad7('0xf')]);module[_0x5ad7('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 8c68d05..ff7fc2b 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 _0xc2a2=['exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','enterAt','setDataValue'];(function(_0x63ecb6,_0x55eb9f){var _0x1fbff5=function(_0x4af13f){while(--_0x4af13f){_0x63ecb6['push'](_0x63ecb6['shift']());}};_0x1fbff5(++_0x55eb9f);}(_0xc2a2,0x170));var _0x2c2a=function(_0x281e03,_0x51786d){_0x281e03=_0x281e03-0x0;var _0x4511f0=_0xc2a2[_0x281e03];return _0x4511f0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2c2a('0x0'));module[_0x2c2a('0x1')]={'channel':{'type':Sequelize[_0x2c2a('0x2')]},'membername':{'type':Sequelize[_0x2c2a('0x2')]},'interface':{'type':Sequelize[_0x2c2a('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x2c2a('0x3'),'comment':_0x2c2a('0x4')},'duration':{'type':Sequelize[_0x2c2a('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x208bec){var _0x1de565=moment(_0x208bec);var _0x195785=moment(this[_0x2c2a('0x6')](_0x2c2a('0x7')));var _0x235f3c=_0x1de565['diff'](_0x195785,'seconds');this[_0x2c2a('0x8')](_0x2c2a('0x9'),_0x208bec);this[_0x2c2a('0x8')](_0x2c2a('0xa'),_0x235f3c>=0x0?_0x235f3c:null);}},'data1':{'type':Sequelize[_0x2c2a('0x2')],'comment':_0x2c2a('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x2c2a('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2c2a('0x2')],'comment':_0x2c2a('0xc')},'data5':{'type':Sequelize[_0x2c2a('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2c2a('0x2')]}}; \ No newline at end of file +var _0x66b5=['DEFAULT\x20PAUSE','INTEGER','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING'];(function(_0x3fd441,_0x577687){var _0x391f68=function(_0x3f0f28){while(--_0x3f0f28){_0x3fd441['push'](_0x3fd441['shift']());}};_0x391f68(++_0x577687);}(_0x66b5,0xcf));var _0x566b=function(_0x1cb887,_0x3b9569){_0x1cb887=_0x1cb887-0x0;var _0x50a440=_0x66b5[_0x1cb887];return _0x50a440;};'use strict';var Sequelize=require(_0x566b('0x0'));var moment=require('moment');module[_0x566b('0x1')]={'channel':{'type':Sequelize[_0x566b('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x566b('0x2')]},'type':{'type':Sequelize[_0x566b('0x2')],'defaultValue':_0x566b('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x566b('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0xfa9ab9){var _0x12a2b3=moment(_0xfa9ab9);var _0x1b3384=moment(this[_0x566b('0x5')]('enterAt'));var _0x2c412c=_0x12a2b3[_0x566b('0x6')](_0x1b3384,_0x566b('0x7'));this[_0x566b('0x8')](_0x566b('0x9'),_0xfa9ab9);this[_0x566b('0x8')](_0x566b('0xa'),_0x2c412c>=0x0?_0x2c412c:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x566b('0x2')],'comment':_0x566b('0xb')},'data4':{'type':Sequelize[_0x566b('0x2')],'comment':_0x566b('0xc')},'data5':{'type':Sequelize[_0x566b('0x2')],'comment':_0x566b('0xd')},'role':{'type':Sequelize[_0x566b('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x566b('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index d96af12..d7ede60 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x6c9205,_0x2154c2){var _0x22eecb=function(_0x1477fa){while(--_0x1477fa){_0x6c9205['push'](_0x6c9205['shift']());}};_0x22eecb(++_0x2154c2);}(_0x3e74,0x175));var _0x43e7=function(_0x5a4d1d,_0xd3596c){_0x5a4d1d=_0x5a4d1d-0x0;var _0x2ea962=_0x3e74[_0x5a4d1d];return _0x2ea962;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x9957=['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','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index de81d73..795fdd3 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 _0xb054=['membername_interface','membername','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xb054,0x128));var _0x4b05=function(_0x349cf1,_0x474e7c){_0x349cf1=_0x349cf1-0x0;var _0x5c4f28=_0xb054[_0x349cf1];return _0x5c4f28;};'use strict';var _=require(_0x4b05('0x0'));var util=require(_0x4b05('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4b05('0x2'));var rp=require(_0x4b05('0x3'));var fs=require('fs');var path=require(_0x4b05('0x4'));var rimraf=require(_0x4b05('0x5'));var config=require(_0x4b05('0x6'));var attributes=require(_0x4b05('0x7'));module[_0x4b05('0x8')]=function(_0x30f394,_0x5cef1e){return _0x30f394[_0x4b05('0x9')](_0x4b05('0xa'),attributes,{'tableName':_0x4b05('0xb'),'paranoid':![],'indexes':[{'name':_0x4b05('0xc'),'fields':[_0x4b05('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xef6a=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface'];(function(_0x58a5bf,_0x1f1483){var _0x4f7ac9=function(_0x5d9a17){while(--_0x5d9a17){_0x58a5bf['push'](_0x58a5bf['shift']());}};_0x4f7ac9(++_0x1f1483);}(_0xef6a,0x10e));var _0xaef6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xef6a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xaef6('0x0'));var util=require(_0xaef6('0x1'));var logger=require(_0xaef6('0x2'))(_0xaef6('0x3'));var moment=require(_0xaef6('0x4'));var BPromise=require('bluebird');var rp=require(_0xaef6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaef6('0x6'));var config=require(_0xaef6('0x7'));var attributes=require(_0xaef6('0x8'));module[_0xaef6('0x9')]=function(_0x2fc56b,_0x2b6d62){return _0x2fc56b[_0xaef6('0xa')](_0xaef6('0xb'),attributes,{'tableName':_0xaef6('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xaef6('0xd'),_0xaef6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 0fec7ff..75db01f 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 _0x86f4=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','CreateMemberReport','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2d912c,_0x53bfb9){var _0x208b06=function(_0x3d8758){while(--_0x3d8758){_0x2d912c['push'](_0x2d912c['shift']());}};_0x208b06(++_0x53bfb9);}(_0x86f4,0x18a));var _0x486f=function(_0x2bb883,_0x4dbe8f){_0x2bb883=_0x2bb883-0x0;var _0x22933a=_0x86f4[_0x2bb883];return _0x22933a;};'use strict';var _=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var moment=require(_0x486f('0x2'));var BPromise=require(_0x486f('0x3'));var rs=require(_0x486f('0x4'));var fs=require('fs');var Redis=require(_0x486f('0x5'));var db=require(_0x486f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x486f('0x7'))(_0x486f('0x8'));var config=require('../../config/environment');var jayson=require(_0x486f('0x9'));var client=jayson[_0x486f('0xa')][_0x486f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x207201,_0x3c6469,_0x3a0791){return new BPromise(function(_0x5bfabc,_0x33363d){return client[_0x486f('0xc')](_0x207201,_0x3a0791)[_0x486f('0xd')](function(_0x468a82){logger[_0x486f('0xe')](_0x486f('0xf'),_0x3c6469,_0x486f('0x10'));logger[_0x486f('0x11')](_0x486f('0x12'),_0x3c6469,_0x486f('0x10'),JSON[_0x486f('0x13')](_0x468a82));if(_0x468a82[_0x486f('0x14')]){if(_0x468a82[_0x486f('0x14')][_0x486f('0x15')]===0x1f4){logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x468a82[_0x486f('0x14')]['message']);return _0x33363d(_0x468a82[_0x486f('0x14')]['message']);}logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x468a82[_0x486f('0x14')]['message']);return _0x5bfabc(_0x468a82['error'][_0x486f('0x16')]);}else{logger[_0x486f('0xe')]('MemberReport,\x20%s,\x20%s',_0x3c6469,_0x486f('0x10'));_0x5bfabc(_0x468a82[_0x486f('0x17')][_0x486f('0x16')]);}})['catch'](function(_0x53561a){logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x53561a);_0x33363d(_0x53561a);});});}exports[_0x486f('0x18')]=function(_0x39bfac){var _0x4e68d1=this;return new Promise(function(_0x59deb8,_0x268eb9){return db[_0x486f('0x19')][_0x486f('0x1a')]({'raw':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1c')]===undefined?!![]:![]:!![],'where':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1d')]||null:null,'attributes':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1e')]||null:null,'limit':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1f')]||null:null,'include':_0x39bfac[_0x486f('0x1b')]?_0x39bfac['options'][_0x486f('0x20')]?_[_0x486f('0x21')](_0x39bfac[_0x486f('0x1b')][_0x486f('0x20')],function(_0x351f81){return{'model':db[_0x351f81[_0x486f('0x22')]],'as':_0x351f81['as'],'attributes':_0x351f81[_0x486f('0x1e')],'include':_0x351f81[_0x486f('0x20')]?_[_0x486f('0x21')](_0x351f81[_0x486f('0x20')],function(_0x2e983b){return{'model':db[_0x2e983b[_0x486f('0x22')]],'as':_0x2e983b['as'],'attributes':_0x2e983b[_0x486f('0x1e')],'include':_0x2e983b[_0x486f('0x20')]?_[_0x486f('0x21')](_0x2e983b[_0x486f('0x20')],function(_0x6f1e8e){return{'model':db[_0x6f1e8e[_0x486f('0x22')]],'as':_0x6f1e8e['as'],'attributes':_0x6f1e8e[_0x486f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x486f('0xd')](function(_0x3c2762){logger[_0x486f('0xe')]('GetMemberReport',_0x39bfac);logger['debug']('GetMemberReport',_0x39bfac,JSON['stringify'](_0x3c2762));_0x59deb8(_0x3c2762);})[_0x486f('0x23')](function(_0x5c994a){logger[_0x486f('0x14')](_0x486f('0x18'),_0x5c994a['message'],_0x39bfac);_0x268eb9(_0x4e68d1[_0x486f('0x14')](0x1f4,_0x5c994a['message']));});});};exports[_0x486f('0x24')]=function(_0x2f166c){var _0x1481c1=this;return new Promise(function(_0x604ec3,_0x1962c2){return db[_0x486f('0x19')]['create'](_0x2f166c[_0x486f('0x25')],{'raw':_0x2f166c[_0x486f('0x1b')]?_0x2f166c[_0x486f('0x1b')][_0x486f('0x1c')]===undefined?!![]:![]:!![]})[_0x486f('0xd')](function(_0x22d89c){logger[_0x486f('0xe')](_0x486f('0x24'),_0x2f166c);logger['debug'](_0x486f('0x24'),_0x2f166c,JSON[_0x486f('0x13')](_0x22d89c));_0x604ec3(_0x22d89c);})['catch'](function(_0x153a48){logger[_0x486f('0x14')](_0x486f('0x24'),_0x153a48[_0x486f('0x16')],_0x2f166c);_0x1962c2(_0x1481c1[_0x486f('0x14')](0x1f4,_0x153a48['message']));});});};exports[_0x486f('0x26')]=function(_0x40dd81){var _0x1be0da=this;return new Promise(function(_0x202ea8,_0x387939){return db[_0x486f('0x19')][_0x486f('0x27')](_0x40dd81['body'],{'raw':_0x40dd81[_0x486f('0x1b')]?_0x40dd81[_0x486f('0x1b')][_0x486f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40dd81['options']?_0x40dd81['options'][_0x486f('0x1d')]||null:null,'attributes':_0x40dd81[_0x486f('0x1b')]?_0x40dd81['options'][_0x486f('0x1e')]||null:null,'limit':_0x40dd81['options']?_0x40dd81[_0x486f('0x1b')][_0x486f('0x1f')]||null:null})['then'](function(_0x5a8eb2){logger[_0x486f('0xe')](_0x486f('0x26'),_0x40dd81);logger[_0x486f('0x11')](_0x486f('0x26'),_0x40dd81,JSON[_0x486f('0x13')](_0x5a8eb2));_0x202ea8(_0x5a8eb2);})[_0x486f('0x23')](function(_0x901b9){logger[_0x486f('0x14')](_0x486f('0x26'),_0x901b9[_0x486f('0x16')],_0x40dd81);_0x387939(_0x1be0da[_0x486f('0x14')](0x1f4,_0x901b9[_0x486f('0x16')]));});});}; \ No newline at end of file +var _0x0dee=['limit','include','map','model','GetMemberReport','create','CreateMemberReport','UpdateMemberReport','body','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','MemberReport','findAll','options','raw','where','attributes'];(function(_0x4e00df,_0x4d9e23){var _0x102179=function(_0x4c75ab){while(--_0x4c75ab){_0x4e00df['push'](_0x4e00df['shift']());}};_0x102179(++_0x4d9e23);}(_0x0dee,0xf7));var _0xe0de=function(_0x5161a4,_0x1a3b15){_0x5161a4=_0x5161a4-0x0;var _0x278b24=_0x0dee[_0x5161a4];return _0x278b24;};'use strict';var _=require(_0xe0de('0x0'));var util=require(_0xe0de('0x1'));var moment=require('moment');var BPromise=require(_0xe0de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0de('0x3'));var db=require(_0xe0de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0de('0x5'))(_0xe0de('0x6'));var config=require(_0xe0de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe0de('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe1fd9,_0x5e5250,_0x349fd2){return new BPromise(function(_0x5b644c,_0x25818f){return client['request'](_0xfe1fd9,_0x349fd2)[_0xe0de('0x9')](function(_0x4a5ecd){logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));logger[_0xe0de('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x5e5250,_0xe0de('0xc'),JSON[_0xe0de('0xe')](_0x4a5ecd));if(_0x4a5ecd[_0xe0de('0xf')]){if(_0x4a5ecd[_0xe0de('0xf')]['code']===0x1f4){logger['error'](_0xe0de('0xb'),_0x5e5250,_0x4a5ecd[_0xe0de('0xf')]['message']);return _0x25818f(_0x4a5ecd['error'][_0xe0de('0x10')]);}logger[_0xe0de('0xf')]('MemberReport,\x20%s,\x20%s',_0x5e5250,_0x4a5ecd['error']['message']);return _0x5b644c(_0x4a5ecd['error'][_0xe0de('0x10')]);}else{logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));_0x5b644c(_0x4a5ecd[_0xe0de('0x11')][_0xe0de('0x10')]);}})[_0xe0de('0x12')](function(_0x2d8c3d){logger[_0xe0de('0xf')](_0xe0de('0xb'),_0x5e5250,_0x2d8c3d);_0x25818f(_0x2d8c3d);});});}exports['GetMemberReport']=function(_0x45cecc){var _0x2f5a2b=this;return new Promise(function(_0xeb9581,_0x1f41d2){return db[_0xe0de('0x13')][_0xe0de('0x14')]({'raw':_0x45cecc[_0xe0de('0x15')]?_0x45cecc[_0xe0de('0x15')][_0xe0de('0x16')]===undefined?!![]:![]:!![],'where':_0x45cecc[_0xe0de('0x15')]?_0x45cecc['options'][_0xe0de('0x17')]||null:null,'attributes':_0x45cecc['options']?_0x45cecc[_0xe0de('0x15')][_0xe0de('0x18')]||null:null,'limit':_0x45cecc[_0xe0de('0x15')]?_0x45cecc['options'][_0xe0de('0x19')]||null:null,'include':_0x45cecc[_0xe0de('0x15')]?_0x45cecc[_0xe0de('0x15')][_0xe0de('0x1a')]?_[_0xe0de('0x1b')](_0x45cecc['options'][_0xe0de('0x1a')],function(_0x211e92){return{'model':db[_0x211e92['model']],'as':_0x211e92['as'],'attributes':_0x211e92[_0xe0de('0x18')],'include':_0x211e92[_0xe0de('0x1a')]?_[_0xe0de('0x1b')](_0x211e92['include'],function(_0x523891){return{'model':db[_0x523891['model']],'as':_0x523891['as'],'attributes':_0x523891[_0xe0de('0x18')],'include':_0x523891[_0xe0de('0x1a')]?_['map'](_0x523891[_0xe0de('0x1a')],function(_0x31bab4){return{'model':db[_0x31bab4[_0xe0de('0x1c')]],'as':_0x31bab4['as'],'attributes':_0x31bab4[_0xe0de('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x248fc4){logger[_0xe0de('0xa')]('GetMemberReport',_0x45cecc);logger[_0xe0de('0xd')](_0xe0de('0x1d'),_0x45cecc,JSON['stringify'](_0x248fc4));_0xeb9581(_0x248fc4);})['catch'](function(_0x48084f){logger['error'](_0xe0de('0x1d'),_0x48084f['message'],_0x45cecc);_0x1f41d2(_0x2f5a2b[_0xe0de('0xf')](0x1f4,_0x48084f[_0xe0de('0x10')]));});});};exports['CreateMemberReport']=function(_0x3f7d5b){var _0x497183=this;return new Promise(function(_0x4128d9,_0x378cd3){return db[_0xe0de('0x13')][_0xe0de('0x1e')](_0x3f7d5b['body'],{'raw':_0x3f7d5b['options']?_0x3f7d5b[_0xe0de('0x15')][_0xe0de('0x16')]===undefined?!![]:![]:!![]})[_0xe0de('0x9')](function(_0x4ed8c8){logger[_0xe0de('0xa')]('CreateMemberReport',_0x3f7d5b);logger[_0xe0de('0xd')](_0xe0de('0x1f'),_0x3f7d5b,JSON[_0xe0de('0xe')](_0x4ed8c8));_0x4128d9(_0x4ed8c8);})[_0xe0de('0x12')](function(_0x33ddb2){logger[_0xe0de('0xf')](_0xe0de('0x1f'),_0x33ddb2[_0xe0de('0x10')],_0x3f7d5b);_0x378cd3(_0x497183[_0xe0de('0xf')](0x1f4,_0x33ddb2[_0xe0de('0x10')]));});});};exports[_0xe0de('0x20')]=function(_0xb6265a){var _0x52dbd3=this;return new Promise(function(_0x22258a,_0x403a0c){return db[_0xe0de('0x13')]['update'](_0xb6265a[_0xe0de('0x21')],{'raw':_0xb6265a[_0xe0de('0x15')]?_0xb6265a['options'][_0xe0de('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb6265a['options']?_0xb6265a[_0xe0de('0x15')][_0xe0de('0x17')]||null:null,'attributes':_0xb6265a[_0xe0de('0x15')]?_0xb6265a[_0xe0de('0x15')]['attributes']||null:null,'limit':_0xb6265a[_0xe0de('0x15')]?_0xb6265a[_0xe0de('0x15')][_0xe0de('0x19')]||null:null})[_0xe0de('0x9')](function(_0x3c741d){logger[_0xe0de('0xa')](_0xe0de('0x20'),_0xb6265a);logger['debug'](_0xe0de('0x20'),_0xb6265a,JSON['stringify'](_0x3c741d));_0x22258a(_0x3c741d);})[_0xe0de('0x12')](function(_0xcd363d){logger[_0xe0de('0xf')]('UpdateMemberReport',_0xcd363d[_0xe0de('0x10')],_0xb6265a);_0x403a0c(_0x52dbd3[_0xe0de('0xf')](0x1f4,_0xcd363d['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 3240cfe..1637b2f 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 _0x0183=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports'];(function(_0x42c0c7,_0x10c2eb){var _0xd3bb5=function(_0x1d54c8){while(--_0x1d54c8){_0x42c0c7['push'](_0x42c0c7['shift']());}};_0xd3bb5(++_0x10c2eb);}(_0x0183,0x1e1));var _0x3018=function(_0x47f1ed,_0x27ebb9){_0x47f1ed=_0x47f1ed-0x0;var _0x52f25a=_0x0183[_0x47f1ed];return _0x52f25a;};'use strict';var multer=require(_0x3018('0x0'));var util=require(_0x3018('0x1'));var path=require(_0x3018('0x2'));var timeout=require(_0x3018('0x3'));var express=require(_0x3018('0x4'));var router=express[_0x3018('0x5')]();var fs_extra=require(_0x3018('0x6'));var auth=require(_0x3018('0x7'));var interaction=require(_0x3018('0x8'));var config=require(_0x3018('0x9'));var controller=require(_0x3018('0xa'));router['get']('/',controller[_0x3018('0xb')]);module[_0x3018('0xc')]=router; \ No newline at end of file +var _0x7d53=['get','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xe90e59,_0x15f85f){var _0x3c75c2=function(_0x519ecd){while(--_0x519ecd){_0xe90e59['push'](_0xe90e59['shift']());}};_0x3c75c2(++_0x15f85f);}(_0x7d53,0x1b9));var _0x37d5=function(_0x2fc5e4,_0x1f748a){_0x2fc5e4=_0x2fc5e4-0x0;var _0xd4a273=_0x7d53[_0x2fc5e4];return _0xd4a273;};'use strict';var multer=require(_0x37d5('0x0'));var util=require(_0x37d5('0x1'));var path=require(_0x37d5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x37d5('0x3')]();var fs_extra=require(_0x37d5('0x4'));var auth=require(_0x37d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x37d5('0x6'));var controller=require('./migration.controller');router[_0x37d5('0x7')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 921cbac..5fcaf73 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 _0x3c0f=['sequelize','STRING','version'];(function(_0x29dda1,_0x508e13){var _0x21b0ef=function(_0x118906){while(--_0x118906){_0x29dda1['push'](_0x29dda1['shift']());}};_0x21b0ef(++_0x508e13);}(_0x3c0f,0x159));var _0xf3c0=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x3c0f[_0x3bef2c];return _0x331503;};'use strict';var Sequelize=require(_0xf3c0('0x0'));module['exports']={'version':{'type':Sequelize[_0xf3c0('0x1')],'unique':_0xf3c0('0x2')}}; \ No newline at end of file +var _0x7a43=['exports','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a43,0x1c7));var _0x37a4=function(_0x5dc42e,_0x21075d){_0x5dc42e=_0x5dc42e-0x0;var _0x3e3a22=_0x7a43[_0x5dc42e];return _0x3e3a22;};'use strict';var Sequelize=require(_0x37a4('0x0'));module[_0x37a4('0x1')]={'version':{'type':Sequelize['STRING'],'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 0ed0a15..1b6d369 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 _0xc91c=['catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Migration','include','rows'];(function(_0x3968a8,_0x333b4e){var _0x3cf27d=function(_0x1d1026){while(--_0x1d1026){_0x3968a8['push'](_0x3968a8['shift']());}};_0x3cf27d(++_0x333b4e);}(_0xc91c,0x150));var _0xcc91=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xc91c[_0xacb1e2];return _0x463815;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc91('0x0'));var zipdir=require(_0xcc91('0x1'));var jsonpatch=require(_0xcc91('0x2'));var rp=require(_0xcc91('0x3'));var moment=require(_0xcc91('0x4'));var BPromise=require(_0xcc91('0x5'));var Mustache=require(_0xcc91('0x6'));var util=require(_0xcc91('0x7'));var path=require(_0xcc91('0x8'));var sox=require(_0xcc91('0x9'));var csv=require(_0xcc91('0xa'));var ejs=require(_0xcc91('0xb'));var fs=require('fs');var fs_extra=require(_0xcc91('0xc'));var _=require(_0xcc91('0xd'));var squel=require(_0xcc91('0xe'));var crypto=require(_0xcc91('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcc91('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcc91('0x11'));var Papa=require(_0xcc91('0x12'));var Redis=require(_0xcc91('0x13'));var authService=require(_0xcc91('0x14'));var qs=require(_0xcc91('0x15'));var as=require(_0xcc91('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc91('0x17'))('api');var utils=require(_0xcc91('0x18'));var config=require(_0xcc91('0x19'));var licenseUtil=require(_0xcc91('0x1a'));var db=require(_0xcc91('0x1b'))['db'];function respondWithStatusCode(_0x226c42,_0x40cba6){_0x40cba6=_0x40cba6||0xcc;return function(_0x2077cf){if(_0x2077cf){return _0x226c42['sendStatus'](_0x40cba6);}return _0x226c42[_0xcc91('0x1c')](_0x40cba6)['end']();};}function respondWithResult(_0x2f6419,_0x4120e1){_0x4120e1=_0x4120e1||0xc8;return function(_0x2fd82a){if(_0x2fd82a){return _0x2f6419['status'](_0x4120e1)[_0xcc91('0x1d')](_0x2fd82a);}};}function respondWithFilteredResult(_0x374f31,_0x58370e){return function(_0x2f6292){if(_0x2f6292){var _0x177d60=typeof _0x58370e[_0xcc91('0x1e')]==='undefined'&&typeof _0x58370e['limit']===_0xcc91('0x1f');var _0x4c92a6=_0x2f6292[_0xcc91('0x20')];var _0x3d21d4=_0x177d60?0x0:_0x58370e[_0xcc91('0x1e')];var _0x31ac6e=_0x177d60?_0x2f6292[_0xcc91('0x20')]:_0x58370e['offset']+_0x58370e[_0xcc91('0x21')];var _0x51b281;if(_0x31ac6e>=_0x4c92a6){_0x31ac6e=_0x4c92a6;_0x51b281=0xc8;}else{_0x51b281=0xce;}_0x374f31[_0xcc91('0x1c')](_0x51b281);return _0x374f31['set'](_0xcc91('0x22'),_0x3d21d4+'-'+_0x31ac6e+'/'+_0x4c92a6)['json'](_0x2f6292);}return null;};}function patchUpdates(_0x14e241){return function(_0x3c2ee6){try{jsonpatch[_0xcc91('0x23')](_0x3c2ee6,_0x14e241,!![]);}catch(_0x21f0f3){return BPromise[_0xcc91('0x24')](_0x21f0f3);}return _0x3c2ee6[_0xcc91('0x25')]();};}function saveUpdates(_0x305352,_0x166821){return function(_0x2cca4c){if(_0x2cca4c){return _0x2cca4c[_0xcc91('0x26')](_0x305352)[_0xcc91('0x27')](function(_0x1509cd){return _0x1509cd;});}return null;};}function removeEntity(_0x2f6e30,_0x52bc10){return function(_0x2fa9da){if(_0x2fa9da){return _0x2fa9da[_0xcc91('0x28')]()[_0xcc91('0x27')](function(){_0x2f6e30[_0xcc91('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cec66,_0x42e5a1){return function(_0x30906d){if(!_0x30906d){_0x1cec66[_0xcc91('0x29')](0x194);}return _0x30906d;};}function handleError(_0x6a0893,_0x20ae3d){_0x20ae3d=_0x20ae3d||0x1f4;return function(_0x3a72c0){logger[_0xcc91('0x2a')](_0x3a72c0[_0xcc91('0x2b')]);if(_0x3a72c0['name']){delete _0x3a72c0[_0xcc91('0x2c')];}_0x6a0893['status'](_0x20ae3d)['send'](_0x3a72c0);};}exports[_0xcc91('0x2d')]=function(_0x371f54,_0x2340cf){var _0x363260={},_0x19bf9f={},_0x4af8be={'count':0x0,'rows':[]};var _0x3379e4=_[_0xcc91('0x2e')](db['Migration']['rawAttributes'],function(_0x14821e){return{'name':_0x14821e['fieldName'],'type':_0x14821e[_0xcc91('0x2f')][_0xcc91('0x30')]};});_0x19bf9f['model']=_[_0xcc91('0x2e')](_0x3379e4,_0xcc91('0x2c'));_0x19bf9f[_0xcc91('0x31')]=_['keys'](_0x371f54[_0xcc91('0x31')]);_0x19bf9f[_0xcc91('0x32')]=_['intersection'](_0x19bf9f[_0xcc91('0x33')],_0x19bf9f[_0xcc91('0x31')]);_0x363260[_0xcc91('0x34')]=_[_0xcc91('0x35')](_0x19bf9f[_0xcc91('0x33')],qs[_0xcc91('0x36')](_0x371f54[_0xcc91('0x31')][_0xcc91('0x36')]));_0x363260[_0xcc91('0x34')]=_0x363260[_0xcc91('0x34')]['length']?_0x363260[_0xcc91('0x34')]:_0x19bf9f['model'];if(!_0x371f54[_0xcc91('0x31')][_0xcc91('0x37')]('nolimit')){_0x363260['limit']=qs[_0xcc91('0x21')](_0x371f54['query'][_0xcc91('0x21')]);_0x363260['offset']=qs[_0xcc91('0x1e')](_0x371f54[_0xcc91('0x31')][_0xcc91('0x1e')]);}_0x363260['order']=qs[_0xcc91('0x38')](_0x371f54[_0xcc91('0x31')][_0xcc91('0x38')]);_0x363260[_0xcc91('0x39')]=qs[_0xcc91('0x32')](_[_0xcc91('0x3a')](_0x371f54[_0xcc91('0x31')],_0x19bf9f[_0xcc91('0x32')]),_0x3379e4);if(_0x371f54[_0xcc91('0x31')][_0xcc91('0x3b')]){_0x363260[_0xcc91('0x39')]=_[_0xcc91('0x3c')](_0x363260[_0xcc91('0x39')],{'$or':_[_0xcc91('0x2e')](_0x3379e4,function(_0x4b60c9){if(_0x4b60c9[_0xcc91('0x2f')]!==_0xcc91('0x3d')){var _0x35fc5b={};_0x35fc5b[_0x4b60c9[_0xcc91('0x2c')]]={'$like':'%'+_0x371f54['query'][_0xcc91('0x3b')]+'%'};return _0x35fc5b;}})});}_0x363260=_[_0xcc91('0x3c')]({},_0x363260,_0x371f54[_0xcc91('0x3e')]);var _0x4a2c1f={'where':_0x363260[_0xcc91('0x39')]};return db[_0xcc91('0x3f')][_0xcc91('0x20')](_0x4a2c1f)[_0xcc91('0x27')](function(_0x507ccd){_0x4af8be['count']=_0x507ccd;if(_0x371f54[_0xcc91('0x31')]['includeAll']){_0x363260[_0xcc91('0x40')]=[{'all':!![]}];}return db[_0xcc91('0x3f')]['findAll'](_0x363260);})[_0xcc91('0x27')](function(_0x4a3ea5){_0x4af8be[_0xcc91('0x41')]=_0x4a3ea5;return _0x4af8be;})[_0xcc91('0x27')](respondWithFilteredResult(_0x2340cf,_0x363260))[_0xcc91('0x42')](handleError(_0x2340cf,null));}; \ No newline at end of file +var _0x0307=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','Migration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js'];(function(_0x1c0b17,_0x405ed6){var _0x4c689a=function(_0x407d27){while(--_0x407d27){_0x1c0b17['push'](_0x1c0b17['shift']());}};_0x4c689a(++_0x405ed6);}(_0x0307,0xb5));var _0x7030=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x0307[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0x7030('0x0'));var rimraf=require(_0x7030('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7030('0x2'));var rp=require('request-promise');var moment=require(_0x7030('0x3'));var BPromise=require(_0x7030('0x4'));var Mustache=require(_0x7030('0x5'));var util=require('util');var path=require(_0x7030('0x6'));var sox=require(_0x7030('0x7'));var csv=require(_0x7030('0x8'));var ejs=require(_0x7030('0x9'));var fs=require('fs');var fs_extra=require(_0x7030('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7030('0xb'));var jsforce=require(_0x7030('0xc'));var deskjs=require(_0x7030('0xd'));var toCsv=require(_0x7030('0x8'));var querystring=require(_0x7030('0xe'));var Papa=require('papaparse');var Redis=require(_0x7030('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7030('0x10'));var as=require(_0x7030('0x11'));var hardwareService=require(_0x7030('0x12'));var logger=require(_0x7030('0x13'))('api');var utils=require(_0x7030('0x14'));var config=require(_0x7030('0x15'));var licenseUtil=require(_0x7030('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x494327,_0x28ff6a){_0x28ff6a=_0x28ff6a||0xcc;return function(_0x200d32){if(_0x200d32){return _0x494327[_0x7030('0x17')](_0x28ff6a);}return _0x494327[_0x7030('0x18')](_0x28ff6a)[_0x7030('0x19')]();};}function respondWithResult(_0x20a26d,_0x4b19f8){_0x4b19f8=_0x4b19f8||0xc8;return function(_0x1a5e13){if(_0x1a5e13){return _0x20a26d[_0x7030('0x18')](_0x4b19f8)['json'](_0x1a5e13);}};}function respondWithFilteredResult(_0x325d7c,_0x775de9){return function(_0x5d5d1e){if(_0x5d5d1e){var _0x4cf48b=typeof _0x775de9[_0x7030('0x1a')]==='undefined'&&typeof _0x775de9[_0x7030('0x1b')]===_0x7030('0x1c');var _0x4e5699=_0x5d5d1e[_0x7030('0x1d')];var _0x90a7d1=_0x4cf48b?0x0:_0x775de9[_0x7030('0x1a')];var _0xd489c6=_0x4cf48b?_0x5d5d1e[_0x7030('0x1d')]:_0x775de9[_0x7030('0x1a')]+_0x775de9['limit'];var _0x30e5db;if(_0xd489c6>=_0x4e5699){_0xd489c6=_0x4e5699;_0x30e5db=0xc8;}else{_0x30e5db=0xce;}_0x325d7c[_0x7030('0x18')](_0x30e5db);return _0x325d7c[_0x7030('0x1e')](_0x7030('0x1f'),_0x90a7d1+'-'+_0xd489c6+'/'+_0x4e5699)['json'](_0x5d5d1e);}return null;};}function patchUpdates(_0x2a37e8){return function(_0x5b5c8c){try{jsonpatch[_0x7030('0x20')](_0x5b5c8c,_0x2a37e8,!![]);}catch(_0x215c29){return BPromise[_0x7030('0x21')](_0x215c29);}return _0x5b5c8c['save']();};}function saveUpdates(_0x448395,_0x40f80d){return function(_0x32c392){if(_0x32c392){return _0x32c392[_0x7030('0x22')](_0x448395)['then'](function(_0x5e1c3f){return _0x5e1c3f;});}return null;};}function removeEntity(_0x2eb923,_0x3a91a5){return function(_0x3837b8){if(_0x3837b8){return _0x3837b8[_0x7030('0x23')]()[_0x7030('0x24')](function(){_0x2eb923['status'](0xcc)[_0x7030('0x19')]();});}};}function handleEntityNotFound(_0x5a9e10,_0x4af865){return function(_0x433797){if(!_0x433797){_0x5a9e10[_0x7030('0x17')](0x194);}return _0x433797;};}function handleError(_0xd3b9dd,_0x19e83a){_0x19e83a=_0x19e83a||0x1f4;return function(_0x39beb2){logger[_0x7030('0x25')](_0x39beb2[_0x7030('0x26')]);if(_0x39beb2[_0x7030('0x27')]){delete _0x39beb2[_0x7030('0x27')];}_0xd3b9dd[_0x7030('0x18')](_0x19e83a)[_0x7030('0x28')](_0x39beb2);};}exports[_0x7030('0x29')]=function(_0x4e8f84,_0x1393f8){var _0x53f4e5={},_0x558bd5={},_0x143cb9={'count':0x0,'rows':[]};var _0x291366=_[_0x7030('0x2a')](db[_0x7030('0x2b')][_0x7030('0x2c')],function(_0x1b23d9){return{'name':_0x1b23d9['fieldName'],'type':_0x1b23d9['type']['key']};});_0x558bd5[_0x7030('0x2d')]=_[_0x7030('0x2a')](_0x291366,_0x7030('0x27'));_0x558bd5['query']=_[_0x7030('0x2e')](_0x4e8f84[_0x7030('0x2f')]);_0x558bd5[_0x7030('0x30')]=_['intersection'](_0x558bd5['model'],_0x558bd5[_0x7030('0x2f')]);_0x53f4e5[_0x7030('0x31')]=_[_0x7030('0x32')](_0x558bd5[_0x7030('0x2d')],qs['fields'](_0x4e8f84[_0x7030('0x2f')][_0x7030('0x33')]));_0x53f4e5[_0x7030('0x31')]=_0x53f4e5[_0x7030('0x31')]['length']?_0x53f4e5['attributes']:_0x558bd5[_0x7030('0x2d')];if(!_0x4e8f84['query'][_0x7030('0x34')](_0x7030('0x35'))){_0x53f4e5['limit']=qs['limit'](_0x4e8f84[_0x7030('0x2f')][_0x7030('0x1b')]);_0x53f4e5[_0x7030('0x1a')]=qs[_0x7030('0x1a')](_0x4e8f84[_0x7030('0x2f')]['offset']);}_0x53f4e5['order']=qs['sort'](_0x4e8f84['query'][_0x7030('0x36')]);_0x53f4e5[_0x7030('0x37')]=qs[_0x7030('0x30')](_[_0x7030('0x38')](_0x4e8f84[_0x7030('0x2f')],_0x558bd5[_0x7030('0x30')]),_0x291366);if(_0x4e8f84[_0x7030('0x2f')][_0x7030('0x39')]){_0x53f4e5[_0x7030('0x37')]=_[_0x7030('0x3a')](_0x53f4e5[_0x7030('0x37')],{'$or':_[_0x7030('0x2a')](_0x291366,function(_0x43ed54){if(_0x43ed54[_0x7030('0x3b')]!==_0x7030('0x3c')){var _0x5db6fb={};_0x5db6fb[_0x43ed54[_0x7030('0x27')]]={'$like':'%'+_0x4e8f84[_0x7030('0x2f')][_0x7030('0x39')]+'%'};return _0x5db6fb;}})});}_0x53f4e5=_[_0x7030('0x3a')]({},_0x53f4e5,_0x4e8f84[_0x7030('0x3d')]);var _0x23813c={'where':_0x53f4e5[_0x7030('0x37')]};return db[_0x7030('0x2b')]['count'](_0x23813c)[_0x7030('0x24')](function(_0x5c60c6){_0x143cb9[_0x7030('0x1d')]=_0x5c60c6;if(_0x4e8f84['query'][_0x7030('0x3e')]){_0x53f4e5[_0x7030('0x3f')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x53f4e5);})[_0x7030('0x24')](function(_0x2be2c8){_0x143cb9[_0x7030('0x40')]=_0x2be2c8;return _0x143cb9;})['then'](respondWithFilteredResult(_0x1393f8,_0x53f4e5))['catch'](handleError(_0x1393f8,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index dcf5ce9..a2867d5 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 _0x7e95=['exports','Migration','migrations','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes'];(function(_0x2ba262,_0x4f19fe){var _0x12aace=function(_0xe5d22){while(--_0xe5d22){_0x2ba262['push'](_0x2ba262['shift']());}};_0x12aace(++_0x4f19fe);}(_0x7e95,0x1f2));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x57e9('0x0'));var util=require(_0x57e9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x57e9('0x2'));var BPromise=require(_0x57e9('0x3'));var rp=require(_0x57e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57e9('0x5'));var config=require(_0x57e9('0x6'));var attributes=require(_0x57e9('0x7'));module[_0x57e9('0x8')]=function(_0x40604d,_0x46a0b0){return _0x40604d['define'](_0x57e9('0x9'),attributes,{'tableName':_0x57e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e6c=['rimraf','../../config/environment','./migration.attributes','define','Migration','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e6c,0x17b));var _0xc5e6=function(_0x17f5c5,_0x28196b){_0x17f5c5=_0x17f5c5-0x0;var _0x103af5=_0x5e6c[_0x17f5c5];return _0x103af5;};'use strict';var _=require('lodash');var util=require(_0xc5e6('0x0'));var logger=require(_0xc5e6('0x1'))(_0xc5e6('0x2'));var moment=require(_0xc5e6('0x3'));var BPromise=require(_0xc5e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5e6('0x5'));var rimraf=require(_0xc5e6('0x6'));var config=require(_0xc5e6('0x7'));var attributes=require(_0xc5e6('0x8'));module['exports']=function(_0x27dfa8,_0x4e31aa){return _0x27dfa8[_0xc5e6('0x9')](_0xc5e6('0xa'),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 e6cda98..924309c 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 _0x57f8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x47e2a3,_0x3fbb50){var _0x2d0bbd=function(_0x4fe1d3){while(--_0x4fe1d3){_0x47e2a3['push'](_0x47e2a3['shift']());}};_0x2d0bbd(++_0x3fbb50);}(_0x57f8,0x198));var _0x857f=function(_0x1e203a,_0x397111){_0x1e203a=_0x1e203a-0x0;var _0x2a5006=_0x57f8[_0x1e203a];return _0x2a5006;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('Migration,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('Migration,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});} \ No newline at end of file +var _0x8aa7=['client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4fb78c,_0x2e7081){var _0x336826=function(_0x441d3b){while(--_0x441d3b){_0x4fb78c['push'](_0x4fb78c['shift']());}};_0x336826(++_0x2e7081);}(_0x8aa7,0xb6));var _0x78aa=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x8aa7[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var util=require(_0x78aa('0x0'));var moment=require(_0x78aa('0x1'));var BPromise=require(_0x78aa('0x2'));var rs=require(_0x78aa('0x3'));var fs=require('fs');var Redis=require(_0x78aa('0x4'));var db=require(_0x78aa('0x5'))['db'];var utils=require(_0x78aa('0x6'));var logger=require('../../config/logger')(_0x78aa('0x7'));var config=require(_0x78aa('0x8'));var jayson=require(_0x78aa('0x9'));var client=jayson[_0x78aa('0xa')][_0x78aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369ee7,_0x462a9a,_0xa79008){return new BPromise(function(_0x2368ac,_0x460488){return client[_0x78aa('0xc')](_0x369ee7,_0xa79008)[_0x78aa('0xd')](function(_0x45d377){logger[_0x78aa('0xe')](_0x78aa('0xf'),_0x462a9a,_0x78aa('0x10'));logger[_0x78aa('0x11')](_0x78aa('0x12'),_0x462a9a,_0x78aa('0x10'),JSON['stringify'](_0x45d377));if(_0x45d377['error']){if(_0x45d377[_0x78aa('0x13')][_0x78aa('0x14')]===0x1f4){logger['error'](_0x78aa('0xf'),_0x462a9a,_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);return _0x460488(_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);}logger['error'](_0x78aa('0xf'),_0x462a9a,_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);return _0x2368ac(_0x45d377[_0x78aa('0x13')][_0x78aa('0x15')]);}else{logger['info'](_0x78aa('0xf'),_0x462a9a,_0x78aa('0x10'));_0x2368ac(_0x45d377[_0x78aa('0x16')][_0x78aa('0x15')]);}})[_0x78aa('0x17')](function(_0x2897f8){logger['error']('Migration,\x20%s,\x20%s',_0x462a9a,_0x2897f8);_0x460488(_0x2897f8);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 26e7a98..2c8be78 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 _0x046b=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0xcdfd00,_0x583d3c){var _0x44ae35=function(_0x183432){while(--_0x183432){_0xcdfd00['push'](_0xcdfd00['shift']());}};_0x44ae35(++_0x583d3c);}(_0x046b,0x1ba));var _0xb046=function(_0x34b018,_0x214f06){_0x34b018=_0x34b018-0x0;var _0x20989f=_0x046b[_0x34b018];return _0x20989f;};'use strict';var multer=require(_0xb046('0x0'));var util=require(_0xb046('0x1'));var path=require(_0xb046('0x2'));var timeout=require(_0xb046('0x3'));var express=require('express');var router=express[_0xb046('0x4')]();var fs_extra=require(_0xb046('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var controller=require(_0xb046('0x8'));router[_0xb046('0x9')]('/',auth[_0xb046('0xa')](),controller[_0xb046('0xb')]);router[_0xb046('0x9')](_0xb046('0xc'),auth[_0xb046('0xa')](),controller[_0xb046('0xd')]);router[_0xb046('0xe')]('/',auth[_0xb046('0xa')](),controller[_0xb046('0xf')]);router['put'](_0xb046('0xc'),auth[_0xb046('0xa')](),controller[_0xb046('0x10')]);router[_0xb046('0x11')](_0xb046('0xc'),auth['isAuthenticated'](),controller[_0xb046('0x12')]);module[_0xb046('0x13')]=router; \ No newline at end of file +var _0x6365=['put','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create'];(function(_0x44b0de,_0x213afa){var _0x21da2a=function(_0x264f30){while(--_0x264f30){_0x44b0de['push'](_0x44b0de['shift']());}};_0x21da2a(++_0x213afa);}(_0x6365,0x148));var _0x5636=function(_0x5f28f6,_0xc92684){_0x5f28f6=_0x5f28f6-0x0;var _0x2841f2=_0x6365[_0x5f28f6];return _0x2841f2;};'use strict';var multer=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var path=require(_0x5636('0x2'));var timeout=require(_0x5636('0x3'));var express=require('express');var router=express[_0x5636('0x4')]();var fs_extra=require(_0x5636('0x5'));var auth=require(_0x5636('0x6'));var interaction=require(_0x5636('0x7'));var config=require(_0x5636('0x8'));var controller=require('./network.controller');router[_0x5636('0x9')]('/',auth[_0x5636('0xa')](),controller[_0x5636('0xb')]);router[_0x5636('0x9')]('/:id',auth[_0x5636('0xa')](),controller[_0x5636('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5636('0xd')]);router[_0x5636('0xe')](_0x5636('0xf'),auth[_0x5636('0xa')](),controller['update']);router['delete'](_0x5636('0xf'),auth['isAuthenticated'](),controller[_0x5636('0x10')]);module[_0x5636('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 8d131d8..50d35aa 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 _0xd56f=['exports','ENUM','externip','STRING','sequelize'];(function(_0x3ebcab,_0x482df2){var _0x4074d3=function(_0x43ec1a){while(--_0x43ec1a){_0x3ebcab['push'](_0x3ebcab['shift']());}};_0x4074d3(++_0x482df2);}(_0xd56f,0xea));var _0xfd56=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0xd56f[_0x42ebba];return _0x3fd2af;};'use strict';var Sequelize=require(_0xfd56('0x0'));module[_0xfd56('0x1')]={'type':{'type':Sequelize[_0xfd56('0x2')]('localnet',_0xfd56('0x3'),'stun','turn')},'value':{'type':Sequelize[_0xfd56('0x4')]},'username':{'type':Sequelize[_0xfd56('0x4')]},'password':{'type':Sequelize[_0xfd56('0x4')]}}; \ No newline at end of file +var _0x2357=['sequelize','exports','ENUM','localnet','stun','turn','STRING'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0x2357,0x149));var _0x7235=function(_0x58d8f4,_0x8046d9){_0x58d8f4=_0x58d8f4-0x0;var _0x1e1e09=_0x2357[_0x58d8f4];return _0x1e1e09;};'use strict';var Sequelize=require(_0x7235('0x0'));module[_0x7235('0x1')]={'type':{'type':Sequelize[_0x7235('0x2')](_0x7235('0x3'),'externip',_0x7235('0x4'),_0x7235('0x5'))},'value':{'type':Sequelize[_0x7235('0x6')]},'username':{'type':Sequelize[_0x7235('0x6')]},'password':{'type':Sequelize[_0x7235('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d204848..c1ca2a2 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 _0x2a1a=['STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','TURN','render','res_stun_monitor.so','format','chan_sip.so','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','Network','type','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','merge','VIRTUAL','where','includeAll','include','findAll','show','params','rawAttributes','length','options','find','create','body','toUpperCase'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x2a1a,0x163));var _0xa2a1=function(_0x48132e,_0x3bbe71){_0x48132e=_0x48132e-0x0;var _0x354ca1=_0x2a1a[_0x48132e];return _0x354ca1;};'use strict';var util=require(_0xa2a1('0x0'));var path=require(_0xa2a1('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa2a1('0x2'));var qs=require(_0xa2a1('0x3'));var logger=require(_0xa2a1('0x4'))(_0xa2a1('0x5'));var config=require(_0xa2a1('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa2a1('0x7'));var client=jayson[_0xa2a1('0x8')][_0xa2a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37b0bb,_0x2a6b4d,_0x48661c,_0x2dbc55){return new Promise(function(_0x5e0336,_0x2923ae){var _0x599cb4=_0x2dbc55||client;return _0x599cb4[_0xa2a1('0xa')](_0x37b0bb,_0x48661c)[_0xa2a1('0xb')](function(_0x520f57){logger['info'](_0xa2a1('0xc'),_0x2a6b4d,_0xa2a1('0xd'));logger[_0xa2a1('0xe')](_0xa2a1('0xf'),_0x2a6b4d,_0xa2a1('0xd'),JSON[_0xa2a1('0x10')](_0x520f57));if(_0x520f57[_0xa2a1('0x11')]){if(_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x12')]===0x1f4){logger[_0xa2a1('0x11')](_0xa2a1('0xc'),_0x2a6b4d,_0x520f57['error'][_0xa2a1('0x13')]);return _0x2923ae(_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x13')]);}logger['error'](_0xa2a1('0xc'),_0x2a6b4d,_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x13')]);return _0x5e0336(_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x13')]);}else{logger[_0xa2a1('0x14')](_0xa2a1('0xc'),_0x2a6b4d,_0xa2a1('0xd'));_0x5e0336(_0x520f57['result'][_0xa2a1('0x13')]);}})[_0xa2a1('0x15')](function(_0x314591){logger[_0xa2a1('0x11')](_0xa2a1('0xc'),_0x2a6b4d,_0x314591);_0x2923ae(_0x314591);});});}function respondWithResult(_0x1d7499,_0x55381a){_0x55381a=_0x55381a||0xc8;return function(_0x559ca1){if(_0x559ca1){return _0x1d7499[_0xa2a1('0x16')](_0x55381a)[_0xa2a1('0x17')](_0x559ca1);}};}function respondWithFilteredResult(_0x5bd874,_0x59bc0e){return function(_0xc3bdb5){if(_0xc3bdb5){var _0xbbe235=typeof _0x59bc0e[_0xa2a1('0x18')]==='undefined'&&typeof _0x59bc0e[_0xa2a1('0x19')]===_0xa2a1('0x1a');var _0x1001c3=_0xc3bdb5[_0xa2a1('0x1b')];var _0x325c1a=_0xbbe235?0x0:_0x59bc0e[_0xa2a1('0x18')];var _0x28f09f=_0xbbe235?_0xc3bdb5[_0xa2a1('0x1b')]:_0x59bc0e[_0xa2a1('0x18')]+_0x59bc0e[_0xa2a1('0x19')];var _0xd66d8;if(_0x28f09f>=_0x1001c3){_0x28f09f=_0x1001c3;_0xd66d8=0xc8;}else{_0xd66d8=0xce;}_0x5bd874[_0xa2a1('0x16')](_0xd66d8);return _0x5bd874[_0xa2a1('0x1c')](_0xa2a1('0x1d'),_0x325c1a+'-'+_0x28f09f+'/'+_0x1001c3)[_0xa2a1('0x17')](_0xc3bdb5);}return null;};}function saveUpdates(_0x914560){return function(_0x1aeb50){if(_0x1aeb50){return _0x1aeb50[_0xa2a1('0x1e')](_0x914560)[_0xa2a1('0xb')](function(_0x1121f4){return _0x1121f4;});}return null;};}function removeEntity(_0x20dee8){return function(_0x270a7a){if(_0x270a7a){return _0x270a7a[_0xa2a1('0x1f')]()['then'](function(){_0x20dee8[_0xa2a1('0x16')](0xcc)[_0xa2a1('0x20')]();});}};}function handleEntityNotFound(_0x372366){return function(_0x4f9468){if(!_0x4f9468){_0x372366[_0xa2a1('0x21')](0x194);}return _0x4f9468;};}function handleError(_0x449d08,_0x42ff08){_0x42ff08=_0x42ff08||0x1f4;return function(_0x5d26f6){logger[_0xa2a1('0x11')](_0x5d26f6['stack']);if(_0x5d26f6[_0xa2a1('0x22')]){delete _0x5d26f6[_0xa2a1('0x22')];}_0x449d08['status'](_0x42ff08)[_0xa2a1('0x23')](_0x5d26f6);};}exports[_0xa2a1('0x24')]=function(_0x454131,_0x2e019f){var _0x484489={},_0x365963={},_0x38189b={'count':0x0,'rows':[]};var _0x20bcaa=_['map'](db[_0xa2a1('0x25')]['rawAttributes'],function(_0x21020a){return{'name':_0x21020a['fieldName'],'type':_0x21020a[_0xa2a1('0x26')]['key']};});_0x365963[_0xa2a1('0x27')]=_[_0xa2a1('0x28')](_0x20bcaa,'name');_0x365963[_0xa2a1('0x29')]=_[_0xa2a1('0x2a')](_0x454131['query']);_0x365963['filters']=_['intersection'](_0x365963[_0xa2a1('0x27')],_0x365963[_0xa2a1('0x29')]);_0x484489[_0xa2a1('0x2b')]=_[_0xa2a1('0x2c')](_0x365963[_0xa2a1('0x27')],qs['fields'](_0x454131[_0xa2a1('0x29')][_0xa2a1('0x2d')]));_0x484489['attributes']=_0x484489[_0xa2a1('0x2b')]['length']?_0x484489[_0xa2a1('0x2b')]:_0x365963[_0xa2a1('0x27')];if(!_0x454131[_0xa2a1('0x29')][_0xa2a1('0x2e')]('nolimit')){_0x484489[_0xa2a1('0x19')]=qs[_0xa2a1('0x19')](_0x454131[_0xa2a1('0x29')][_0xa2a1('0x19')]);_0x484489[_0xa2a1('0x18')]=qs[_0xa2a1('0x18')](_0x454131['query'][_0xa2a1('0x18')]);}_0x484489[_0xa2a1('0x2f')]=qs[_0xa2a1('0x30')](_0x454131['query'][_0xa2a1('0x30')]);_0x484489['where']=qs[_0xa2a1('0x31')](_['pick'](_0x454131['query'],_0x365963[_0xa2a1('0x31')]),_0x20bcaa);if(_0x454131[_0xa2a1('0x29')]['filter']){_0x484489['where']=_[_0xa2a1('0x32')](_0x484489['where'],{'$or':_['map'](_0x20bcaa,function(_0x1f77df){if(_0x1f77df['type']!==_0xa2a1('0x33')){var _0x210882={};_0x210882[_0x1f77df[_0xa2a1('0x22')]]={'$like':'%'+_0x454131[_0xa2a1('0x29')]['filter']+'%'};return _0x210882;}})});}_0x484489=_[_0xa2a1('0x32')]({},_0x484489,_0x454131['options']);var _0x146e25={'where':_0x484489[_0xa2a1('0x34')]};return db[_0xa2a1('0x25')][_0xa2a1('0x1b')](_0x146e25)[_0xa2a1('0xb')](function(_0xd95b4c){_0x38189b['count']=_0xd95b4c;if(_0x454131['query'][_0xa2a1('0x35')]){_0x484489[_0xa2a1('0x36')]=[{'all':!![]}];}return db['Network'][_0xa2a1('0x37')](_0x484489);})[_0xa2a1('0xb')](function(_0x122dbc){_0x38189b['rows']=_0x122dbc;return _0x38189b;})['then'](respondWithFilteredResult(_0x2e019f,_0x484489))[_0xa2a1('0x15')](handleError(_0x2e019f,null));};exports[_0xa2a1('0x38')]=function(_0x4f8ff2,_0x54593c){var _0x621717={'raw':!![],'where':{'id':_0x4f8ff2[_0xa2a1('0x39')]['id']}},_0x497555={};_0x497555['model']=_[_0xa2a1('0x2a')](db['Network'][_0xa2a1('0x3a')]);_0x497555[_0xa2a1('0x29')]=_[_0xa2a1('0x2a')](_0x4f8ff2[_0xa2a1('0x29')]);_0x497555['filters']=_['intersection'](_0x497555[_0xa2a1('0x27')],_0x497555['query']);_0x621717[_0xa2a1('0x2b')]=_[_0xa2a1('0x2c')](_0x497555[_0xa2a1('0x27')],qs['fields'](_0x4f8ff2[_0xa2a1('0x29')][_0xa2a1('0x2d')]));_0x621717['attributes']=_0x621717[_0xa2a1('0x2b')][_0xa2a1('0x3b')]?_0x621717[_0xa2a1('0x2b')]:_0x497555[_0xa2a1('0x27')];if(_0x4f8ff2[_0xa2a1('0x29')][_0xa2a1('0x35')]){_0x621717[_0xa2a1('0x36')]=[{'all':!![]}];}_0x621717=_[_0xa2a1('0x32')]({},_0x621717,_0x4f8ff2[_0xa2a1('0x3c')]);return db[_0xa2a1('0x25')][_0xa2a1('0x3d')](_0x621717)['then'](handleEntityNotFound(_0x54593c,null))[_0xa2a1('0xb')](respondWithResult(_0x54593c,null))['catch'](handleError(_0x54593c,null));};exports[_0xa2a1('0x3e')]=function(_0x52b0f7,_0x34ed08){var _0x35ae91;return db['Network'][_0xa2a1('0x3e')](_0x52b0f7['body'],{'raw':!![]})[_0xa2a1('0xb')](function(_0x33c1e0){_0x35ae91=_0x33c1e0;return db[_0xa2a1('0x25')]['findAll']({'where':{'type':_0x52b0f7[_0xa2a1('0x3f')]['type']},'raw':!![]});})['then'](function(_0xc538d){if(_0x35ae91['type'][_0xa2a1('0x40')]()==_0xa2a1('0x41')){var _0x1d80b1=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x45')),_0xa2a1('0x46'));var _0xe19ac5=ejs['render'](_0x1d80b1,{'networks':_0xc538d||[]});fs[_0xa2a1('0x47')]('/etc/asterisk/stun_xcally.conf',_0xe19ac5);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x3e'),{'module':'res_stun_monitor.so'});}else if(_0x35ae91[_0xa2a1('0x26')]['toUpperCase']()==_0xa2a1('0x49')){var _0x255d5c=fs['readFileSync'](path['join'](config[_0xa2a1('0x44')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x3d3361=ejs[_0xa2a1('0x4a')](_0x255d5c,{'networks':_0xc538d||[]});fs[_0xa2a1('0x47')]('/etc/asterisk/turn_xcally.conf',_0x3d3361);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x3e'),{'module':_0xa2a1('0x4b')});}else{var _0x2f0dac=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],'server/files/templates/network.ejs'),_0xa2a1('0x46'));var _0x355962=ejs[_0xa2a1('0x4a')](_0x2f0dac,{'networks':_0xc538d||[]});fs[_0xa2a1('0x47')](util[_0xa2a1('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x52b0f7[_0xa2a1('0x3f')][_0xa2a1('0x26')]['toLowerCase']()),_0x355962);return respondWithRpcPromise(_0xa2a1('0x48'),'create',{'module':_0xa2a1('0x4d')});}})[_0xa2a1('0xb')](function(){return _0x35ae91;})['then'](respondWithResult(_0x34ed08,0xc9))[_0xa2a1('0x15')](handleError(_0x34ed08,null));};exports[_0xa2a1('0x1e')]=function(_0x62fc7c,_0x4dc932){var _0xf7bf09;return db[_0xa2a1('0x25')][_0xa2a1('0x3d')]({'where':{'id':_0x62fc7c[_0xa2a1('0x39')]['id']}})[_0xa2a1('0xb')](handleEntityNotFound(_0x4dc932,null))['then'](saveUpdates(_0x62fc7c[_0xa2a1('0x3f')],null))[_0xa2a1('0xb')](function(_0x140df2){if(_0x140df2){_0xf7bf09=_0x140df2;return db['Network'][_0xa2a1('0x37')]({'where':{'type':_0xf7bf09[_0xa2a1('0x26')]},'raw':!![]});}return null;})[_0xa2a1('0xb')](function(_0x8c089f){if(_0xf7bf09[_0xa2a1('0x26')][_0xa2a1('0x40')]()==_0xa2a1('0x41')){var _0x1266fb=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x45')),_0xa2a1('0x46'));var _0x28a7e4=ejs[_0xa2a1('0x4a')](_0x1266fb,{'networks':_0x8c089f||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x28a7e4);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x1e'),{'module':'res_stun_monitor.so'});}else if(_0xf7bf09['type'][_0xa2a1('0x40')]()==_0xa2a1('0x49')){var _0x26252b=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xa2a1('0x46'));var _0x504a43=ejs[_0xa2a1('0x4a')](_0x26252b,{'networks':_0x8c089f||[]});fs['writeFileSync'](_0xa2a1('0x4e'),_0x504a43);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x46dc5a=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x4f')),_0xa2a1('0x46'));var _0x3e1bf6=ejs[_0xa2a1('0x4a')](_0x46dc5a,{'networks':_0x8c089f||[]});fs['writeFileSync'](util[_0xa2a1('0x4c')](_0xa2a1('0x50'),_0x62fc7c[_0xa2a1('0x3f')][_0xa2a1('0x26')][_0xa2a1('0x51')]()),_0x3e1bf6);return respondWithRpcPromise(_0xa2a1('0x48'),'update',{'module':_0xa2a1('0x4d')});}})[_0xa2a1('0xb')](function(_0x1c4624){if(_0x1c4624){return _0xf7bf09;}return null;})[_0xa2a1('0xb')](respondWithResult(_0x4dc932,null))[_0xa2a1('0x15')](handleError(_0x4dc932,null));};exports[_0xa2a1('0x1f')]=function(_0x3d1bda,_0x4ae272){var _0x5e1e74;return db[_0xa2a1('0x25')][_0xa2a1('0x3d')]({'where':{'id':_0x3d1bda[_0xa2a1('0x39')]['id']}})[_0xa2a1('0xb')](function(_0x4a334c){_0x5e1e74=_0x4a334c;return _0x4a334c;})[_0xa2a1('0xb')](handleEntityNotFound(_0x4ae272,null))[_0xa2a1('0xb')](removeEntity(_0x4ae272,null))[_0xa2a1('0xb')](function(){if(_0x5e1e74){return db[_0xa2a1('0x25')]['findAll']({'where':{'type':_0x5e1e74[_0xa2a1('0x26')]},'raw':!![]});}})[_0xa2a1('0xb')](function(_0x37a8cf){if(_0x5e1e74[_0xa2a1('0x26')][_0xa2a1('0x40')]()==_0xa2a1('0x41')){var _0x5242d0=fs['readFileSync'](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x45')),_0xa2a1('0x46'));var _0x438972=ejs[_0xa2a1('0x4a')](_0x5242d0,{'networks':_0x37a8cf||[]});fs[_0xa2a1('0x47')](_0xa2a1('0x52'),_0x438972);return respondWithRpcPromise('Reload','destroy',{'module':_0xa2a1('0x4b')});}else if(_0x5e1e74[_0xa2a1('0x26')][_0xa2a1('0x40')]()==_0xa2a1('0x49')){var _0x3a7d1a=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x53')),_0xa2a1('0x46'));var _0x54f772=ejs[_0xa2a1('0x4a')](_0x3a7d1a,{'networks':_0x37a8cf||[]});fs[_0xa2a1('0x47')](_0xa2a1('0x4e'),_0x54f772);return respondWithRpcPromise('Reload',_0xa2a1('0x1f'),{'module':_0xa2a1('0x4b')});}else{var _0x26a119=fs['readFileSync'](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x4f')),_0xa2a1('0x46'));var _0x589e0c=ejs['render'](_0x26a119,{'networks':_0x37a8cf||[]});fs[_0xa2a1('0x47')](util['format'](_0xa2a1('0x50'),_0x5e1e74['type'][_0xa2a1('0x51')]()),_0x589e0c);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x1f'),{'module':_0xa2a1('0x4d')});}})['catch'](handleError(_0x4ae272,null));}; \ No newline at end of file +var _0x964b=['find','create','body','findAll','type','readFileSync','join','root','render','writeFileSync','/etc/asterisk/stun_xcally.conf','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','/etc/asterisk/sip_xcally_%s.conf','STUN','server/files/templates/stun_multiple.ejs','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','destroy','util','path','ejs','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','offset','limit','undefined','count','set','Content-Range','json','update','sendStatus','stack','name','index','Network','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','params','keys'];(function(_0x1add6a,_0x5bf9bb){var _0x4f2de6=function(_0x3aa8bf){while(--_0x3aa8bf){_0x1add6a['push'](_0x1add6a['shift']());}};_0x4f2de6(++_0x5bf9bb);}(_0x964b,0x6e));var _0xb964=function(_0x2595a5,_0x3e8b79){_0x2595a5=_0x2595a5-0x0;var _0x270643=_0x964b[_0x2595a5];return _0x270643;};'use strict';var util=require(_0xb964('0x0'));var path=require(_0xb964('0x1'));var ejs=require(_0xb964('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0xb964('0x3'));var logger=require(_0xb964('0x4'))('api');var config=require(_0xb964('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb964('0x6'));var client=jayson['client'][_0xb964('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a2f07,_0x3a16c4,_0x87d8f9,_0x4dac3f){return new Promise(function(_0x1b452c,_0x13194d){var _0x9efeb3=_0x4dac3f||client;return _0x9efeb3[_0xb964('0x8')](_0x4a2f07,_0x87d8f9)[_0xb964('0x9')](function(_0xe680c0){logger['info'](_0xb964('0xa'),_0x3a16c4,_0xb964('0xb'));logger[_0xb964('0xc')](_0xb964('0xd'),_0x3a16c4,_0xb964('0xb'),JSON['stringify'](_0xe680c0));if(_0xe680c0[_0xb964('0xe')]){if(_0xe680c0[_0xb964('0xe')]['code']===0x1f4){logger['error'](_0xb964('0xa'),_0x3a16c4,_0xe680c0['error']['message']);return _0x13194d(_0xe680c0[_0xb964('0xe')][_0xb964('0xf')]);}logger['error'](_0xb964('0xa'),_0x3a16c4,_0xe680c0['error']['message']);return _0x1b452c(_0xe680c0[_0xb964('0xe')][_0xb964('0xf')]);}else{logger[_0xb964('0x10')](_0xb964('0xa'),_0x3a16c4,_0xb964('0xb'));_0x1b452c(_0xe680c0[_0xb964('0x11')][_0xb964('0xf')]);}})[_0xb964('0x12')](function(_0x1aeda1){logger[_0xb964('0xe')]('Network,\x20%s,\x20%s',_0x3a16c4,_0x1aeda1);_0x13194d(_0x1aeda1);});});}function respondWithResult(_0x233cc6,_0x58a230){_0x58a230=_0x58a230||0xc8;return function(_0x2cfc87){if(_0x2cfc87){return _0x233cc6[_0xb964('0x13')](_0x58a230)['json'](_0x2cfc87);}};}function respondWithFilteredResult(_0xbc940f,_0x2939ac){return function(_0x5d4e48){if(_0x5d4e48){var _0x285d62=typeof _0x2939ac[_0xb964('0x14')]==='undefined'&&typeof _0x2939ac[_0xb964('0x15')]===_0xb964('0x16');var _0x1bf105=_0x5d4e48[_0xb964('0x17')];var _0x3fe76f=_0x285d62?0x0:_0x2939ac[_0xb964('0x14')];var _0x1f2cc3=_0x285d62?_0x5d4e48[_0xb964('0x17')]:_0x2939ac[_0xb964('0x14')]+_0x2939ac[_0xb964('0x15')];var _0x11d29f;if(_0x1f2cc3>=_0x1bf105){_0x1f2cc3=_0x1bf105;_0x11d29f=0xc8;}else{_0x11d29f=0xce;}_0xbc940f[_0xb964('0x13')](_0x11d29f);return _0xbc940f[_0xb964('0x18')](_0xb964('0x19'),_0x3fe76f+'-'+_0x1f2cc3+'/'+_0x1bf105)[_0xb964('0x1a')](_0x5d4e48);}return null;};}function saveUpdates(_0x40cea1){return function(_0x58d659){if(_0x58d659){return _0x58d659[_0xb964('0x1b')](_0x40cea1)[_0xb964('0x9')](function(_0x3416cc){return _0x3416cc;});}return null;};}function removeEntity(_0x241fed){return function(_0x5a464b){if(_0x5a464b){return _0x5a464b['destroy']()[_0xb964('0x9')](function(){_0x241fed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x356dbb){return function(_0x1668cc){if(!_0x1668cc){_0x356dbb[_0xb964('0x1c')](0x194);}return _0x1668cc;};}function handleError(_0x534a6c,_0x4aca80){_0x4aca80=_0x4aca80||0x1f4;return function(_0x5873f2){logger['error'](_0x5873f2[_0xb964('0x1d')]);if(_0x5873f2[_0xb964('0x1e')]){delete _0x5873f2[_0xb964('0x1e')];}_0x534a6c[_0xb964('0x13')](_0x4aca80)['send'](_0x5873f2);};}exports[_0xb964('0x1f')]=function(_0x4ad5a7,_0x2f1e3e){var _0x3b50df={},_0x269fd7={},_0x15af53={'count':0x0,'rows':[]};var _0x2dafd2=_['map'](db[_0xb964('0x20')][_0xb964('0x21')],function(_0x42504d){return{'name':_0x42504d[_0xb964('0x22')],'type':_0x42504d['type'][_0xb964('0x23')]};});_0x269fd7['model']=_['map'](_0x2dafd2,_0xb964('0x1e'));_0x269fd7['query']=_['keys'](_0x4ad5a7[_0xb964('0x24')]);_0x269fd7['filters']=_[_0xb964('0x25')](_0x269fd7[_0xb964('0x26')],_0x269fd7[_0xb964('0x24')]);_0x3b50df[_0xb964('0x27')]=_['intersection'](_0x269fd7['model'],qs[_0xb964('0x28')](_0x4ad5a7['query'][_0xb964('0x28')]));_0x3b50df['attributes']=_0x3b50df[_0xb964('0x27')][_0xb964('0x29')]?_0x3b50df[_0xb964('0x27')]:_0x269fd7[_0xb964('0x26')];if(!_0x4ad5a7[_0xb964('0x24')][_0xb964('0x2a')](_0xb964('0x2b'))){_0x3b50df[_0xb964('0x15')]=qs[_0xb964('0x15')](_0x4ad5a7[_0xb964('0x24')][_0xb964('0x15')]);_0x3b50df['offset']=qs[_0xb964('0x14')](_0x4ad5a7[_0xb964('0x24')][_0xb964('0x14')]);}_0x3b50df[_0xb964('0x2c')]=qs[_0xb964('0x2d')](_0x4ad5a7[_0xb964('0x24')]['sort']);_0x3b50df['where']=qs[_0xb964('0x2e')](_[_0xb964('0x2f')](_0x4ad5a7[_0xb964('0x24')],_0x269fd7[_0xb964('0x2e')]),_0x2dafd2);if(_0x4ad5a7[_0xb964('0x24')][_0xb964('0x30')]){_0x3b50df[_0xb964('0x31')]=_[_0xb964('0x32')](_0x3b50df[_0xb964('0x31')],{'$or':_[_0xb964('0x33')](_0x2dafd2,function(_0x228031){if(_0x228031['type']!==_0xb964('0x34')){var _0x2ef1ba={};_0x2ef1ba[_0x228031[_0xb964('0x1e')]]={'$like':'%'+_0x4ad5a7[_0xb964('0x24')]['filter']+'%'};return _0x2ef1ba;}})});}_0x3b50df=_['merge']({},_0x3b50df,_0x4ad5a7[_0xb964('0x35')]);var _0x2426b6={'where':_0x3b50df[_0xb964('0x31')]};return db[_0xb964('0x20')]['count'](_0x2426b6)['then'](function(_0x19ad69){_0x15af53[_0xb964('0x17')]=_0x19ad69;if(_0x4ad5a7[_0xb964('0x24')][_0xb964('0x36')]){_0x3b50df[_0xb964('0x37')]=[{'all':!![]}];}return db[_0xb964('0x20')]['findAll'](_0x3b50df);})[_0xb964('0x9')](function(_0x39e75e){_0x15af53['rows']=_0x39e75e;return _0x15af53;})[_0xb964('0x9')](respondWithFilteredResult(_0x2f1e3e,_0x3b50df))[_0xb964('0x12')](handleError(_0x2f1e3e,null));};exports['show']=function(_0x5cc67c,_0x59d27d){var _0x320bc1={'raw':!![],'where':{'id':_0x5cc67c[_0xb964('0x38')]['id']}},_0x12a83b={};_0x12a83b[_0xb964('0x26')]=_['keys'](db[_0xb964('0x20')]['rawAttributes']);_0x12a83b[_0xb964('0x24')]=_[_0xb964('0x39')](_0x5cc67c[_0xb964('0x24')]);_0x12a83b[_0xb964('0x2e')]=_['intersection'](_0x12a83b[_0xb964('0x26')],_0x12a83b[_0xb964('0x24')]);_0x320bc1[_0xb964('0x27')]=_[_0xb964('0x25')](_0x12a83b[_0xb964('0x26')],qs['fields'](_0x5cc67c[_0xb964('0x24')][_0xb964('0x28')]));_0x320bc1['attributes']=_0x320bc1[_0xb964('0x27')][_0xb964('0x29')]?_0x320bc1[_0xb964('0x27')]:_0x12a83b[_0xb964('0x26')];if(_0x5cc67c[_0xb964('0x24')][_0xb964('0x36')]){_0x320bc1[_0xb964('0x37')]=[{'all':!![]}];}_0x320bc1=_[_0xb964('0x32')]({},_0x320bc1,_0x5cc67c[_0xb964('0x35')]);return db['Network'][_0xb964('0x3a')](_0x320bc1)[_0xb964('0x9')](handleEntityNotFound(_0x59d27d,null))['then'](respondWithResult(_0x59d27d,null))[_0xb964('0x12')](handleError(_0x59d27d,null));};exports[_0xb964('0x3b')]=function(_0x4e0742,_0x21cff1){var _0x4efb60;return db[_0xb964('0x20')][_0xb964('0x3b')](_0x4e0742[_0xb964('0x3c')],{'raw':!![]})[_0xb964('0x9')](function(_0x2f890b){_0x4efb60=_0x2f890b;return db[_0xb964('0x20')][_0xb964('0x3d')]({'where':{'type':_0x4e0742[_0xb964('0x3c')][_0xb964('0x3e')]},'raw':!![]});})['then'](function(_0x460314){if(_0x4efb60[_0xb964('0x3e')]['toUpperCase']()=='STUN'){var _0x4fd675=fs[_0xb964('0x3f')](path[_0xb964('0x40')](config[_0xb964('0x41')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x5ecdba=ejs[_0xb964('0x42')](_0x4fd675,{'networks':_0x460314||[]});fs[_0xb964('0x43')](_0xb964('0x44'),_0x5ecdba);return respondWithRpcPromise('Reload',_0xb964('0x3b'),{'module':'res_stun_monitor.so'});}else if(_0x4efb60[_0xb964('0x3e')][_0xb964('0x45')]()==_0xb964('0x46')){var _0x1b76e8=fs['readFileSync'](path[_0xb964('0x40')](config[_0xb964('0x41')],_0xb964('0x47')),_0xb964('0x48'));var _0x478aa1=ejs[_0xb964('0x42')](_0x1b76e8,{'networks':_0x460314||[]});fs[_0xb964('0x43')](_0xb964('0x49'),_0x478aa1);return respondWithRpcPromise(_0xb964('0x4a'),_0xb964('0x3b'),{'module':_0xb964('0x4b')});}else{var _0x405f9d=fs[_0xb964('0x3f')](path[_0xb964('0x40')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0xf3dd9a=ejs['render'](_0x405f9d,{'networks':_0x460314||[]});fs[_0xb964('0x43')](util['format'](_0xb964('0x4c'),_0x4e0742[_0xb964('0x3c')][_0xb964('0x3e')]['toLowerCase']()),_0xf3dd9a);return respondWithRpcPromise(_0xb964('0x4a'),_0xb964('0x3b'),{'module':'chan_sip.so'});}})[_0xb964('0x9')](function(){return _0x4efb60;})[_0xb964('0x9')](respondWithResult(_0x21cff1,0xc9))[_0xb964('0x12')](handleError(_0x21cff1,null));};exports['update']=function(_0x246f87,_0x3d328d){var _0x59fd15;return db[_0xb964('0x20')][_0xb964('0x3a')]({'where':{'id':_0x246f87[_0xb964('0x38')]['id']}})[_0xb964('0x9')](handleEntityNotFound(_0x3d328d,null))[_0xb964('0x9')](saveUpdates(_0x246f87[_0xb964('0x3c')],null))[_0xb964('0x9')](function(_0x51e857){if(_0x51e857){_0x59fd15=_0x51e857;return db['Network'][_0xb964('0x3d')]({'where':{'type':_0x59fd15[_0xb964('0x3e')]},'raw':!![]});}return null;})['then'](function(_0x405a67){if(_0x59fd15[_0xb964('0x3e')][_0xb964('0x45')]()==_0xb964('0x4d')){var _0x5e14b5=fs[_0xb964('0x3f')](path[_0xb964('0x40')](config[_0xb964('0x41')],_0xb964('0x4e')),_0xb964('0x48'));var _0x4404df=ejs['render'](_0x5e14b5,{'networks':_0x405a67||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4404df);return respondWithRpcPromise(_0xb964('0x4a'),_0xb964('0x1b'),{'module':_0xb964('0x4b')});}else if(_0x59fd15['type'][_0xb964('0x45')]()==_0xb964('0x46')){var _0x2703a4=fs['readFileSync'](path[_0xb964('0x40')](config[_0xb964('0x41')],_0xb964('0x47')),'utf8');var _0x3eb832=ejs[_0xb964('0x42')](_0x2703a4,{'networks':_0x405a67||[]});fs[_0xb964('0x43')](_0xb964('0x49'),_0x3eb832);return respondWithRpcPromise('Reload',_0xb964('0x1b'),{'module':_0xb964('0x4b')});}else{var _0x1db14f=fs[_0xb964('0x3f')](path[_0xb964('0x40')](config[_0xb964('0x41')],_0xb964('0x4f')),_0xb964('0x48'));var _0x2147b9=ejs['render'](_0x1db14f,{'networks':_0x405a67||[]});fs[_0xb964('0x43')](util[_0xb964('0x50')](_0xb964('0x4c'),_0x246f87[_0xb964('0x3c')]['type'][_0xb964('0x51')]()),_0x2147b9);return respondWithRpcPromise('Reload',_0xb964('0x1b'),{'module':_0xb964('0x52')});}})[_0xb964('0x9')](function(_0xa2678a){if(_0xa2678a){return _0x59fd15;}return null;})[_0xb964('0x9')](respondWithResult(_0x3d328d,null))[_0xb964('0x12')](handleError(_0x3d328d,null));};exports[_0xb964('0x53')]=function(_0x5e8acd,_0x293445){var _0x5bca91;return db['Network']['find']({'where':{'id':_0x5e8acd[_0xb964('0x38')]['id']}})[_0xb964('0x9')](function(_0x482ae1){_0x5bca91=_0x482ae1;return _0x482ae1;})[_0xb964('0x9')](handleEntityNotFound(_0x293445,null))['then'](removeEntity(_0x293445,null))[_0xb964('0x9')](function(){if(_0x5bca91){return db['Network'][_0xb964('0x3d')]({'where':{'type':_0x5bca91[_0xb964('0x3e')]},'raw':!![]});}})[_0xb964('0x9')](function(_0x58cdc1){if(_0x5bca91[_0xb964('0x3e')][_0xb964('0x45')]()=='STUN'){var _0x1f57bf=fs[_0xb964('0x3f')](path['join'](config[_0xb964('0x41')],_0xb964('0x4e')),_0xb964('0x48'));var _0x1fdaa3=ejs[_0xb964('0x42')](_0x1f57bf,{'networks':_0x58cdc1||[]});fs[_0xb964('0x43')](_0xb964('0x44'),_0x1fdaa3);return respondWithRpcPromise(_0xb964('0x4a'),_0xb964('0x53'),{'module':_0xb964('0x4b')});}else if(_0x5bca91[_0xb964('0x3e')][_0xb964('0x45')]()=='TURN'){var _0x4bf927=fs[_0xb964('0x3f')](path[_0xb964('0x40')](config[_0xb964('0x41')],_0xb964('0x47')),_0xb964('0x48'));var _0x20e558=ejs[_0xb964('0x42')](_0x4bf927,{'networks':_0x58cdc1||[]});fs[_0xb964('0x43')](_0xb964('0x49'),_0x20e558);return respondWithRpcPromise(_0xb964('0x4a'),_0xb964('0x53'),{'module':_0xb964('0x4b')});}else{var _0x85d9b8=fs[_0xb964('0x3f')](path[_0xb964('0x40')](config['root'],'server/files/templates/network.ejs'),_0xb964('0x48'));var _0xd56c59=ejs[_0xb964('0x42')](_0x85d9b8,{'networks':_0x58cdc1||[]});fs[_0xb964('0x43')](util[_0xb964('0x50')](_0xb964('0x4c'),_0x5bca91['type'][_0xb964('0x51')]()),_0xd56c59);return respondWithRpcPromise('Reload',_0xb964('0x53'),{'module':_0xb964('0x52')});}})[_0xb964('0x12')](handleError(_0x293445,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index ad61ac4..0aaecb8 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 _0x705f=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','../../config/logger','moment','bluebird'];(function(_0x33c84d,_0x507fe5){var _0x234bed=function(_0x5f2651){while(--_0x5f2651){_0x33c84d['push'](_0x33c84d['shift']());}};_0x234bed(++_0x507fe5);}(_0x705f,0x75));var _0xf705=function(_0x23266e,_0x3647e2){_0x23266e=_0x23266e-0x0;var _0x55c2b6=_0x705f[_0x23266e];return _0x55c2b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf705('0x0'))('api');var moment=require(_0xf705('0x1'));var BPromise=require(_0xf705('0x2'));var rp=require(_0xf705('0x3'));var fs=require('fs');var path=require(_0xf705('0x4'));var rimraf=require(_0xf705('0x5'));var config=require(_0xf705('0x6'));var attributes=require(_0xf705('0x7'));module[_0xf705('0x8')]=function(_0x10214c,_0x991602){return _0x10214c[_0xf705('0x9')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39cb=['network','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./network.attributes','exports','define','Network'];(function(_0x555d95,_0x313355){var _0x362fe2=function(_0x48b837){while(--_0x48b837){_0x555d95['push'](_0x555d95['shift']());}};_0x362fe2(++_0x313355);}(_0x39cb,0x1bd));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var moment=require(_0xb39c('0x2'));var BPromise=require(_0xb39c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb39c('0x4'));var rimraf=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var attributes=require(_0xb39c('0x7'));module[_0xb39c('0x8')]=function(_0x4ae4cf,_0x32cdcd){return _0x4ae4cf[_0xb39c('0x9')](_0xb39c('0xa'),attributes,{'tableName':_0xb39c('0xb'),'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 bc5450b..f44ff68 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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x8c906b,_0x26dd36){_0x8c906b=_0x8c906b-0x0;var _0x13118f=_0x7a54[_0x8c906b];return _0x13118f;};'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 _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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0xc9d894,_0x31eb01){_0xc9d894=_0xc9d894-0x0;var _0x2d525b=_0x7a54[_0xc9d894];return _0x2d525b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 70917a8..319d986 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 _0x86e4=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','show','/:id/canned_answers','getAnswers','/:id/interactions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions'];(function(_0x207e2a,_0x41653c){var _0x1cfb4e=function(_0x1402cb){while(--_0x1402cb){_0x207e2a['push'](_0x207e2a['shift']());}};_0x1cfb4e(++_0x41653c);}(_0x86e4,0x129));var _0x486e=function(_0x23884b,_0x50c307){_0x23884b=_0x23884b-0x0;var _0x28113b=_0x86e4[_0x23884b];return _0x28113b;};'use strict';var multer=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var path=require(_0x486e('0x2'));var timeout=require('connect-timeout');var express=require(_0x486e('0x3'));var router=express['Router']();var fs_extra=require(_0x486e('0x4'));var auth=require(_0x486e('0x5'));var interaction=require(_0x486e('0x6'));var config=require(_0x486e('0x7'));var controller=require(_0x486e('0x8'));router[_0x486e('0x9')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0xb')]);router[_0x486e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x486e('0xc')]);router[_0x486e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x486e('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x486e('0xe'),auth[_0x486e('0xa')](),controller[_0x486e('0xf')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x486e('0x9')](_0x486e('0x10'),auth[_0x486e('0xa')](),controller['getInteractions']);router[_0x486e('0x9')](_0x486e('0x11'),auth[_0x486e('0xa')](),controller[_0x486e('0x12')]);router[_0x486e('0x13')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0x14')]);router[_0x486e('0x13')](_0x486e('0x15'),auth['isAuthenticated'](),controller[_0x486e('0x16')]);router['post'](_0x486e('0xe'),auth[_0x486e('0xa')](),controller['addAnswer']);router['post'](_0x486e('0x17'),controller[_0x486e('0x18')]);router[_0x486e('0x13')](_0x486e('0x19'),auth[_0x486e('0xa')](),controller[_0x486e('0x1a')]);router[_0x486e('0x13')](_0x486e('0x11'),auth[_0x486e('0xa')](),controller[_0x486e('0x1b')]);router[_0x486e('0x13')](_0x486e('0x1c'),auth[_0x486e('0xa')](),controller[_0x486e('0x1d')]);router[_0x486e('0x1e')](_0x486e('0x1f'),auth['isAuthenticated'](),controller[_0x486e('0x20')]);router[_0x486e('0x21')](_0x486e('0x1f'),auth[_0x486e('0xa')](),controller[_0x486e('0x22')]);router[_0x486e('0x21')](_0x486e('0x15'),auth[_0x486e('0xa')](),controller[_0x486e('0x23')]);router['delete'](_0x486e('0xe'),auth[_0x486e('0xa')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x486e('0xa')](),controller['removeAgents']);module[_0x486e('0x24')]=router; \ No newline at end of file +var _0x9ce6=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions'];(function(_0xf268c9,_0x5c01cf){var _0x54551b=function(_0x8d2407){while(--_0x8d2407){_0xf268c9['push'](_0xf268c9['shift']());}};_0x54551b(++_0x5c01cf);}(_0x9ce6,0x1e8));var _0x69ce=function(_0x3303c0,_0x1eaa43){_0x3303c0=_0x3303c0-0x0;var _0x454848=_0x9ce6[_0x3303c0];return _0x454848;};'use strict';var multer=require(_0x69ce('0x0'));var util=require(_0x69ce('0x1'));var path=require(_0x69ce('0x2'));var timeout=require(_0x69ce('0x3'));var express=require(_0x69ce('0x4'));var router=express[_0x69ce('0x5')]();var fs_extra=require(_0x69ce('0x6'));var auth=require(_0x69ce('0x7'));var interaction=require(_0x69ce('0x8'));var config=require(_0x69ce('0x9'));var controller=require(_0x69ce('0xa'));router[_0x69ce('0xb')]('/',auth['isAuthenticated'](),controller[_0x69ce('0xc')]);router[_0x69ce('0xb')](_0x69ce('0xd'),auth[_0x69ce('0xe')](),controller['describe']);router[_0x69ce('0xb')](_0x69ce('0xf'),auth['isAuthenticated'](),controller[_0x69ce('0x10')]);router[_0x69ce('0xb')](_0x69ce('0x11'),auth[_0x69ce('0xe')](),controller[_0x69ce('0x12')]);router[_0x69ce('0xb')](_0x69ce('0x13'),auth['isAuthenticated'](),controller[_0x69ce('0x14')]);router[_0x69ce('0xb')](_0x69ce('0x15'),auth[_0x69ce('0xe')](),controller[_0x69ce('0x16')]);router[_0x69ce('0xb')](_0x69ce('0x17'),auth['isAuthenticated'](),controller[_0x69ce('0x18')]);router[_0x69ce('0xb')](_0x69ce('0x19'),auth['isAuthenticated'](),controller[_0x69ce('0x1a')]);router[_0x69ce('0x1b')]('/',auth['isAuthenticated'](),controller['create']);router[_0x69ce('0x1b')]('/:id/dispositions',auth[_0x69ce('0xe')](),controller[_0x69ce('0x1c')]);router['post'](_0x69ce('0x13'),auth[_0x69ce('0xe')](),controller[_0x69ce('0x1d')]);router[_0x69ce('0x1b')](_0x69ce('0x1e'),controller[_0x69ce('0x1f')]);router[_0x69ce('0x1b')](_0x69ce('0x15'),auth[_0x69ce('0xe')](),controller[_0x69ce('0x20')]);router[_0x69ce('0x1b')](_0x69ce('0x19'),auth[_0x69ce('0xe')](),controller[_0x69ce('0x21')]);router['post']('/:id/send',auth[_0x69ce('0xe')](),controller[_0x69ce('0x22')]);router[_0x69ce('0x23')](_0x69ce('0xf'),auth[_0x69ce('0xe')](),controller[_0x69ce('0x24')]);router[_0x69ce('0x25')]('/:id',auth[_0x69ce('0xe')](),controller[_0x69ce('0x26')]);router[_0x69ce('0x25')](_0x69ce('0x11'),auth[_0x69ce('0xe')](),controller['removeDispositions']);router[_0x69ce('0x25')]('/:id/canned_answers',auth[_0x69ce('0xe')](),controller['removeAnswers']);router[_0x69ce('0x25')]('/:id/users',auth[_0x69ce('0xe')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 99c7602..848fd66 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 _0x2a76=['sequelize','STRING','name','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','setDataValue'];(function(_0xece559,_0x114f74){var _0x28249b=function(_0x3b9c60){while(--_0x3b9c60){_0xece559['push'](_0xece559['shift']());}};_0x28249b(++_0x114f74);}(_0x2a76,0x134));var _0x62a7=function(_0x3d04db,_0x3f4a12){_0x3d04db=_0x3d04db-0x0;var _0x25e488=_0x2a76[_0x3d04db];return _0x25e488;};'use strict';var Sequelize=require(_0x62a7('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x62a7('0x1')],'unique':_0x62a7('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x62a7('0x1')],'defaultValue':function(){return rs[_0x62a7('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x62a7('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x62a7('0x4')],'defaultValue':function(){return _0x62a7('0x5');}},'notificationSound':{'type':Sequelize[_0x62a7('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x62a7('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x62a7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x62a7('0x1')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x62a7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x62a7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x62a7('0x6')],'defaultValue':![],'comment':_0x62a7('0x9'),'set':function(_0x34ce67){if(!_0x34ce67)this[_0x62a7('0xa')]('mandatoryDispositionPauseId',null);this[_0x62a7('0xa')]('mandatoryDisposition',_0x34ce67);}}}; \ No newline at end of file +var _0xdb14=['randomstring','exports','STRING','generate','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x261191,_0x4589a5){var _0x2345d1=function(_0x172619){while(--_0x172619){_0x261191['push'](_0x261191['shift']());}};_0x2345d1(++_0x4589a5);}(_0xdb14,0xbd));var _0x4db1=function(_0x549955,_0x176769){_0x549955=_0x549955-0x0;var _0x4f3213=_0xdb14[_0x549955];return _0x4f3213;};'use strict';var Sequelize=require(_0x4db1('0x0'));var rs=require(_0x4db1('0x1'));module[_0x4db1('0x2')]={'name':{'type':Sequelize[_0x4db1('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4db1('0x3')]},'token':{'type':Sequelize[_0x4db1('0x3')],'defaultValue':function(){return rs[_0x4db1('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4db1('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4db1('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4db1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x4db1('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4db1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4db1('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4db1('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4db1('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28bcd7){if(!_0x28bcd7)this[_0x4db1('0x7')](_0x4db1('0x8'),null);this[_0x4db1('0x7')](_0x4db1('0x9'),_0x28bcd7);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 5759396..6bd9c6d 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 _0x6e12=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','VIRTUAL','options','where','includeAll','include','OpenchannelAccount','findAll','rows','Pause','keys','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','pick','filter','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','Applications','List','account','applications','list','orderBy','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','*,*,*,*','Start','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','priority','stack','finally','send','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','addAgents','emit','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','client','http'];(function(_0x4066e1,_0x289436){var _0x3a178b=function(_0x3bb74a){while(--_0x3bb74a){_0x4066e1['push'](_0x4066e1['shift']());}};_0x3a178b(++_0x289436);}(_0x6e12,0x154));var _0x26e1=function(_0x236c8d,_0xd1f84b){_0x236c8d=_0x236c8d-0x0;var _0x15ec5c=_0x6e12[_0x236c8d];return _0x15ec5c;};'use strict';var emlformat=require(_0x26e1('0x0'));var rimraf=require(_0x26e1('0x1'));var zipdir=require(_0x26e1('0x2'));var jsonpatch=require(_0x26e1('0x3'));var rp=require('request-promise');var moment=require(_0x26e1('0x4'));var BPromise=require(_0x26e1('0x5'));var Mustache=require(_0x26e1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x26e1('0x7'));var csv=require(_0x26e1('0x8'));var ejs=require(_0x26e1('0x9'));var fs=require('fs');var fs_extra=require(_0x26e1('0xa'));var _=require(_0x26e1('0xb'));var squel=require('squel');var crypto=require(_0x26e1('0xc'));var jsforce=require(_0x26e1('0xd'));var deskjs=require(_0x26e1('0xe'));var toCsv=require(_0x26e1('0x8'));var querystring=require(_0x26e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x26e1('0x10'));var authService=require(_0x26e1('0x11'));var qs=require(_0x26e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e1('0x13'));var logger=require(_0x26e1('0x14'))(_0x26e1('0x15'));var utils=require(_0x26e1('0x16'));var config=require(_0x26e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x26e1('0x18'))['db'];config[_0x26e1('0x19')]=_[_0x26e1('0x1a')](config['redis'],{'host':_0x26e1('0x1b'),'port':0x18eb});var socket=require(_0x26e1('0x1c'))(new Redis(config[_0x26e1('0x19')]));require(_0x26e1('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x26e1('0x1e')][_0x26e1('0x1f')]({'port':0x232c});var client9002=jayson[_0x26e1('0x1e')][_0x26e1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x438eca,_0x5edd81,_0x28f87b,_0x411b9d){return new BPromise(function(_0x545727,_0x1f4d1f){var _0x1043e1=_0x411b9d||client;return _0x1043e1[_0x26e1('0x20')](_0x438eca,_0x28f87b)[_0x26e1('0x21')](function(_0x2bb105){logger[_0x26e1('0x22')](_0x26e1('0x23'),_0x5edd81,'request\x20sent');logger['debug'](_0x26e1('0x24'),_0x5edd81,_0x26e1('0x25'),JSON[_0x26e1('0x26')](_0x2bb105));if(_0x2bb105['error']){if(_0x2bb105[_0x26e1('0x27')]['code']===0x1f4){logger[_0x26e1('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x5edd81,_0x2bb105[_0x26e1('0x27')][_0x26e1('0x28')]);return _0x1f4d1f(_0x2bb105[_0x26e1('0x27')]['message']);}logger[_0x26e1('0x27')](_0x26e1('0x23'),_0x5edd81,_0x2bb105[_0x26e1('0x27')][_0x26e1('0x28')]);return _0x545727(_0x2bb105[_0x26e1('0x27')][_0x26e1('0x28')]);}else{logger[_0x26e1('0x22')](_0x26e1('0x23'),_0x5edd81,_0x26e1('0x25'));_0x545727(_0x2bb105['result'][_0x26e1('0x28')]);}})[_0x26e1('0x29')](function(_0x21ed95){logger[_0x26e1('0x27')](_0x26e1('0x23'),_0x5edd81,_0x21ed95);_0x1f4d1f(_0x21ed95);});});}function respondWithStatusCode(_0x1d166c,_0x112285){_0x112285=_0x112285||0xcc;return function(_0x5973c1){if(_0x5973c1){return _0x1d166c['sendStatus'](_0x112285);}return _0x1d166c['status'](_0x112285)[_0x26e1('0x2a')]();};}function respondWithResult(_0x28278d,_0x198d1f){_0x198d1f=_0x198d1f||0xc8;return function(_0x587113){if(_0x587113){return _0x28278d['status'](_0x198d1f)[_0x26e1('0x2b')](_0x587113);}};}function respondWithFilteredResult(_0xeed638,_0x385698){return function(_0x2abff3){if(_0x2abff3){var _0x2e4c78=typeof _0x385698['offset']==='undefined'&&typeof _0x385698['limit']===_0x26e1('0x2c');var _0x2d7f78=_0x2abff3[_0x26e1('0x2d')];var _0x412b2f=_0x2e4c78?0x0:_0x385698['offset'];var _0x51396d=_0x2e4c78?_0x2abff3[_0x26e1('0x2d')]:_0x385698[_0x26e1('0x2e')]+_0x385698[_0x26e1('0x2f')];var _0xe0a08d;if(_0x51396d>=_0x2d7f78){_0x51396d=_0x2d7f78;_0xe0a08d=0xc8;}else{_0xe0a08d=0xce;}_0xeed638[_0x26e1('0x30')](_0xe0a08d);return _0xeed638[_0x26e1('0x31')](_0x26e1('0x32'),_0x412b2f+'-'+_0x51396d+'/'+_0x2d7f78)['json'](_0x2abff3);}return null;};}function patchUpdates(_0x96e6da){return function(_0x3b3006){try{jsonpatch['apply'](_0x3b3006,_0x96e6da,!![]);}catch(_0x13eb0d){return BPromise[_0x26e1('0x33')](_0x13eb0d);}return _0x3b3006[_0x26e1('0x34')]();};}function saveUpdates(_0x4dbc94,_0x4ac6f0){return function(_0x2c2a1c){if(_0x2c2a1c){return _0x2c2a1c[_0x26e1('0x35')](_0x4dbc94)[_0x26e1('0x21')](function(_0x50700a){return _0x50700a;});}return null;};}function removeEntity(_0x1a91c6,_0x1e9265){return function(_0xd14d1c){if(_0xd14d1c){return _0xd14d1c[_0x26e1('0x36')]()[_0x26e1('0x21')](function(){var _0xe8cbc6=_0xd14d1c[_0x26e1('0x37')]({'plain':!![]});var _0x27c4fc=_0x26e1('0x38');return db[_0x26e1('0x39')][_0x26e1('0x36')]({'where':{'type':_0x27c4fc,'resourceId':_0xe8cbc6['id']}})['then'](function(){return _0xd14d1c;});})[_0x26e1('0x21')](function(){_0x1a91c6[_0x26e1('0x30')](0xcc)[_0x26e1('0x2a')]();});}};}function handleEntityNotFound(_0x5e2aa2,_0x4404d8){return function(_0x539b5d){if(!_0x539b5d){_0x5e2aa2[_0x26e1('0x3a')](0x194);}return _0x539b5d;};}function handleError(_0x200a63,_0x353737){_0x353737=_0x353737||0x1f4;return function(_0x395f56){logger[_0x26e1('0x27')](_0x395f56['stack']);if(_0x395f56[_0x26e1('0x3b')]){delete _0x395f56['name'];}_0x200a63[_0x26e1('0x30')](_0x353737)['send'](_0x395f56);};}exports[_0x26e1('0x3c')]=function(_0x3752ed,_0x81efc2){var _0x1ebd8c={'include':[{'model':db['Pause'],'as':_0x26e1('0x3d')}]},_0x2a5bc5={},_0x62f198={'count':0x0,'rows':[]};var _0x3bb8a5=_[_0x26e1('0x3e')](db['OpenchannelAccount'][_0x26e1('0x3f')],function(_0x3f38bb){return{'name':_0x3f38bb[_0x26e1('0x40')],'type':_0x3f38bb[_0x26e1('0x41')][_0x26e1('0x42')]};});_0x2a5bc5[_0x26e1('0x43')]=_[_0x26e1('0x3e')](_0x3bb8a5,_0x26e1('0x3b'));_0x2a5bc5['query']=_['keys'](_0x3752ed[_0x26e1('0x44')]);_0x2a5bc5[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x2a5bc5[_0x26e1('0x43')],_0x2a5bc5['query']);_0x1ebd8c[_0x26e1('0x47')]=_[_0x26e1('0x46')](_0x2a5bc5[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x3752ed[_0x26e1('0x44')][_0x26e1('0x48')]));_0x1ebd8c[_0x26e1('0x47')]=_0x1ebd8c[_0x26e1('0x47')][_0x26e1('0x49')]?_0x1ebd8c['attributes']:_0x2a5bc5[_0x26e1('0x43')];if(!_0x3752ed[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x1ebd8c[_0x26e1('0x2f')]=qs['limit'](_0x3752ed['query'][_0x26e1('0x2f')]);_0x1ebd8c['offset']=qs[_0x26e1('0x2e')](_0x3752ed['query']['offset']);}_0x1ebd8c[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x3752ed[_0x26e1('0x44')]['sort']);_0x1ebd8c['where']=qs['filters'](_['pick'](_0x3752ed['query'],_0x2a5bc5[_0x26e1('0x45')]),_0x3bb8a5);if(_0x3752ed[_0x26e1('0x44')]['filter']){_0x1ebd8c['where']=_[_0x26e1('0x4e')](_0x1ebd8c['where'],{'$or':_[_0x26e1('0x3e')](_0x3bb8a5,function(_0x3cc61f){if(_0x3cc61f[_0x26e1('0x41')]!==_0x26e1('0x4f')){var _0x44cf16={};_0x44cf16[_0x3cc61f[_0x26e1('0x3b')]]={'$like':'%'+_0x3752ed[_0x26e1('0x44')]['filter']+'%'};return _0x44cf16;}})});}_0x1ebd8c=_['merge']({},_0x1ebd8c,_0x3752ed[_0x26e1('0x50')]);var _0x489da2={'where':_0x1ebd8c[_0x26e1('0x51')]};return db['OpenchannelAccount'][_0x26e1('0x2d')](_0x489da2)['then'](function(_0x2ef970){_0x62f198['count']=_0x2ef970;if(_0x3752ed[_0x26e1('0x44')][_0x26e1('0x52')]){_0x1ebd8c[_0x26e1('0x53')]=[{'all':!![]}];}return db[_0x26e1('0x54')][_0x26e1('0x55')](_0x1ebd8c);})['then'](function(_0x8dafec){_0x62f198[_0x26e1('0x56')]=_0x8dafec;return _0x62f198;})[_0x26e1('0x21')](respondWithFilteredResult(_0x81efc2,_0x1ebd8c))['catch'](handleError(_0x81efc2,null));};exports['show']=function(_0x24e360,_0x2c3169){var _0xe5f598={'raw':![],'where':{'id':_0x24e360['params']['id']},'include':[{'model':db[_0x26e1('0x57')],'as':_0x26e1('0x3d')}]},_0x52608d={};_0x52608d[_0x26e1('0x43')]=_[_0x26e1('0x58')](db[_0x26e1('0x54')][_0x26e1('0x3f')]);_0x52608d['query']=_['keys'](_0x24e360[_0x26e1('0x44')]);_0x52608d[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x52608d[_0x26e1('0x43')],_0x52608d[_0x26e1('0x44')]);_0xe5f598[_0x26e1('0x47')]=_[_0x26e1('0x46')](_0x52608d[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x24e360[_0x26e1('0x44')][_0x26e1('0x48')]));_0xe5f598['attributes']=_0xe5f598[_0x26e1('0x47')][_0x26e1('0x49')]?_0xe5f598[_0x26e1('0x47')]:_0x52608d[_0x26e1('0x43')];if(_0x24e360[_0x26e1('0x44')][_0x26e1('0x52')]){_0xe5f598[_0x26e1('0x53')]=[{'all':!![]}];}_0xe5f598=_[_0x26e1('0x4e')]({},_0xe5f598,_0x24e360['options']);return db[_0x26e1('0x54')][_0x26e1('0x59')](_0xe5f598)[_0x26e1('0x21')](handleEntityNotFound(_0x2c3169,null))[_0x26e1('0x21')](respondWithResult(_0x2c3169,null))[_0x26e1('0x29')](handleError(_0x2c3169,null));};exports['create']=function(_0x58233b,_0x59211a){return db[_0x26e1('0x54')][_0x26e1('0x5a')](_0x58233b[_0x26e1('0x5b')],{})[_0x26e1('0x21')](function(_0x17043c){var _0x30eef3=_0x58233b[_0x26e1('0x5c')]['get']({'plain':!![]});if(!_0x30eef3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30eef3[_0x26e1('0x5d')]===_0x26e1('0x5c')){var _0x33c112=_0x17043c[_0x26e1('0x37')]({'plain':!![]});var _0xf364c0=_0x26e1('0x38');return db['UserProfileSection'][_0x26e1('0x59')]({'where':{'name':_0xf364c0,'userProfileId':_0x30eef3[_0x26e1('0x5e')]},'raw':!![]})[_0x26e1('0x21')](function(_0x476a91){if(_0x476a91&&_0x476a91['autoAssociation']===0x0){return db[_0x26e1('0x39')]['create']({'name':_0x33c112[_0x26e1('0x3b')],'resourceId':_0x33c112['id'],'type':_0x476a91[_0x26e1('0x3b')],'sectionId':_0x476a91['id']},{})[_0x26e1('0x21')](function(){return _0x17043c;});}else{return _0x17043c;}})['catch'](function(_0x299cc0){logger[_0x26e1('0x27')](_0x26e1('0x5f'),_0x299cc0);throw _0x299cc0;});}return _0x17043c;})[_0x26e1('0x21')](respondWithResult(_0x59211a,0xc9))[_0x26e1('0x29')](handleError(_0x59211a,null));};exports[_0x26e1('0x35')]=function(_0xd2b873,_0x4b12f8){if(_0xd2b873[_0x26e1('0x5b')]['id']){delete _0xd2b873[_0x26e1('0x5b')]['id'];}return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0xd2b873[_0x26e1('0x60')]['id']},'include':[{'model':db[_0x26e1('0x57')],'as':_0x26e1('0x3d')}]})[_0x26e1('0x21')](handleEntityNotFound(_0x4b12f8,null))[_0x26e1('0x21')](saveUpdates(_0xd2b873[_0x26e1('0x5b')],null))['then'](respondWithResult(_0x4b12f8,null))[_0x26e1('0x29')](handleError(_0x4b12f8,null));};exports[_0x26e1('0x36')]=function(_0x4d21c7,_0x13370c){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x4d21c7[_0x26e1('0x60')]['id']}})['then'](handleEntityNotFound(_0x13370c,null))[_0x26e1('0x21')](removeEntity(_0x13370c,null))[_0x26e1('0x29')](handleError(_0x13370c,null));};exports[_0x26e1('0x61')]=function(_0x306389,_0x2047fa){return db[_0x26e1('0x54')][_0x26e1('0x61')]()['then'](respondWithResult(_0x2047fa,null))[_0x26e1('0x29')](handleError(_0x2047fa,null));};exports[_0x26e1('0x62')]=function(_0x29c784,_0x42dde2,_0x4c12ef){if(_0x29c784[_0x26e1('0x5b')]['id']){delete _0x29c784['body']['id'];}return db['OpenchannelAccount'][_0x26e1('0x59')]({'where':{'id':_0x29c784[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x42dde2,null))['then'](function(_0x573636){if(_0x573636){_0x29c784[_0x26e1('0x5b')][_0x26e1('0x63')]=_0x573636['id'];return db['Disposition']['create'](_0x29c784['body']);}})['then'](respondWithResult(_0x42dde2,null))['catch'](handleError(_0x42dde2,null));};exports[_0x26e1('0x64')]=function(_0x52e820,_0x106d22,_0x5f39b7){var _0x46d3cc={'raw':![],'where':{}};var _0x7d4ce8={};var _0x4b4d04={'count':0x0,'rows':[]};return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x52e820['params']['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x106d22,null))[_0x26e1('0x21')](function(_0x11a48c){if(_0x11a48c){_0x7d4ce8['model']=_[_0x26e1('0x58')](db['Disposition'][_0x26e1('0x3f')]);_0x7d4ce8[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x52e820['query']);_0x7d4ce8['filters']=_[_0x26e1('0x46')](_0x7d4ce8['model'],_0x7d4ce8[_0x26e1('0x44')]);_0x46d3cc['attributes']=_[_0x26e1('0x46')](_0x7d4ce8[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x52e820[_0x26e1('0x44')][_0x26e1('0x48')]));_0x46d3cc[_0x26e1('0x47')]=_0x46d3cc['attributes'][_0x26e1('0x49')]?_0x46d3cc['attributes']:_0x7d4ce8[_0x26e1('0x43')];if(!_0x52e820[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x46d3cc[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x52e820[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x46d3cc['offset']=qs[_0x26e1('0x2e')](_0x52e820[_0x26e1('0x44')][_0x26e1('0x2e')]);}_0x46d3cc['order']=qs[_0x26e1('0x4d')](_0x52e820['query'][_0x26e1('0x4d')]);_0x46d3cc['where']=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x52e820[_0x26e1('0x44')],_0x7d4ce8[_0x26e1('0x45')]));_0x46d3cc[_0x26e1('0x51')]['OpenchannelAccountId']=_0x11a48c['id'];if(_0x52e820[_0x26e1('0x44')][_0x26e1('0x67')]){_0x46d3cc[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x46d3cc[_0x26e1('0x51')],{'$or':_['map'](_0x46d3cc[_0x26e1('0x47')],function(_0x592120){var _0x48e6b6={};_0x48e6b6[_0x592120]={'$like':'%'+_0x52e820['query']['filter']+'%'};return _0x48e6b6;})});}_0x46d3cc=_[_0x26e1('0x4e')]({},_0x46d3cc,_0x52e820[_0x26e1('0x50')]);return db[_0x26e1('0x68')][_0x26e1('0x2d')]({'where':_0x46d3cc[_0x26e1('0x51')]})[_0x26e1('0x21')](function(_0x40cb72){_0x4b4d04['count']=_0x40cb72;if(_0x52e820[_0x26e1('0x44')][_0x26e1('0x52')]){_0x46d3cc[_0x26e1('0x53')]=[{'all':!![]}];}return db[_0x26e1('0x68')][_0x26e1('0x55')](_0x46d3cc);})[_0x26e1('0x21')](function(_0x2f81ec){_0x4b4d04['rows']=_0x2f81ec;return _0x4b4d04;});}})['then'](respondWithFilteredResult(_0x106d22,_0x46d3cc))[_0x26e1('0x29')](handleError(_0x106d22,null));};exports[_0x26e1('0x69')]=function(_0x5ab4f1,_0x1e1129,_0xd9bba9){return db[_0x26e1('0x54')]['find']({'where':{'id':_0x5ab4f1[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x1e1129,null))[_0x26e1('0x21')](function(_0x395039){if(_0x395039){return _0x395039[_0x26e1('0x69')](_0x5ab4f1[_0x26e1('0x44')][_0x26e1('0x6a')]);}})[_0x26e1('0x21')](respondWithStatusCode(_0x1e1129,null))[_0x26e1('0x29')](handleError(_0x1e1129,null));};exports[_0x26e1('0x6b')]=function(_0x326678,_0xf2ffb4,_0x10d02f){if(_0x326678['body']['id']){delete _0x326678[_0x26e1('0x5b')]['id'];}return db[_0x26e1('0x54')]['find']({'where':{'id':_0x326678[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0xf2ffb4,null))[_0x26e1('0x21')](function(_0x504730){if(_0x504730){_0x326678[_0x26e1('0x5b')][_0x26e1('0x63')]=_0x504730['id'];return db[_0x26e1('0x6c')]['create'](_0x326678['body']);}})['then'](respondWithResult(_0xf2ffb4,null))['catch'](handleError(_0xf2ffb4,null));};exports[_0x26e1('0x6d')]=function(_0x576e09,_0x48413b,_0x18f42e){var _0x400e02={'raw':![],'where':{}};var _0x167239={};var _0x3677e2={'count':0x0,'rows':[]};return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x576e09['params']['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x48413b,null))['then'](function(_0x353a7e){if(_0x353a7e){_0x167239['model']=_[_0x26e1('0x58')](db[_0x26e1('0x6c')][_0x26e1('0x3f')]);_0x167239[_0x26e1('0x44')]=_['keys'](_0x576e09['query']);_0x167239[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x167239[_0x26e1('0x43')],_0x167239[_0x26e1('0x44')]);_0x400e02['attributes']=_['intersection'](_0x167239[_0x26e1('0x43')],qs['fields'](_0x576e09['query']['fields']));_0x400e02[_0x26e1('0x47')]=_0x400e02[_0x26e1('0x47')]['length']?_0x400e02[_0x26e1('0x47')]:_0x167239[_0x26e1('0x43')];if(!_0x576e09[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x400e02['limit']=qs[_0x26e1('0x2f')](_0x576e09[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x400e02['offset']=qs['offset'](_0x576e09[_0x26e1('0x44')][_0x26e1('0x2e')]);}_0x400e02[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x576e09[_0x26e1('0x44')][_0x26e1('0x4d')]);_0x400e02[_0x26e1('0x51')]=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x576e09[_0x26e1('0x44')],_0x167239[_0x26e1('0x45')]));_0x400e02[_0x26e1('0x51')][_0x26e1('0x63')]=_0x353a7e['id'];if(_0x576e09[_0x26e1('0x44')][_0x26e1('0x67')]){_0x400e02[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x400e02[_0x26e1('0x51')],{'$or':_['map'](_0x400e02[_0x26e1('0x47')],function(_0x5973ee){var _0x2e9b62={};_0x2e9b62[_0x5973ee]={'$like':'%'+_0x576e09[_0x26e1('0x44')][_0x26e1('0x67')]+'%'};return _0x2e9b62;})});}_0x400e02=_[_0x26e1('0x4e')]({},_0x400e02,_0x576e09[_0x26e1('0x50')]);return db[_0x26e1('0x6c')][_0x26e1('0x2d')]({'where':_0x400e02[_0x26e1('0x51')]})['then'](function(_0x3163e5){_0x3677e2['count']=_0x3163e5;if(_0x576e09[_0x26e1('0x44')][_0x26e1('0x52')]){_0x400e02[_0x26e1('0x53')]=[{'all':!![]}];}return db[_0x26e1('0x6c')][_0x26e1('0x55')](_0x400e02);})[_0x26e1('0x21')](function(_0x3ffafe){_0x3677e2[_0x26e1('0x56')]=_0x3ffafe;return _0x3677e2;});}})[_0x26e1('0x21')](respondWithFilteredResult(_0x48413b,_0x400e02))['catch'](handleError(_0x48413b,null));};exports['removeAnswers']=function(_0x27801a,_0xba8a46,_0x69ef04){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x27801a[_0x26e1('0x60')]['id']}})['then'](handleEntityNotFound(_0xba8a46,null))[_0x26e1('0x21')](function(_0x3f336f){if(_0x3f336f){return _0x3f336f[_0x26e1('0x6e')](_0x27801a[_0x26e1('0x44')]['ids']);}})['then'](respondWithStatusCode(_0xba8a46,null))[_0x26e1('0x29')](handleError(_0xba8a46,null));};exports['notify']=function(_0x50524f,_0x190d73,_0x548dc2){var _0xc6e690={'body':_0x50524f[_0x26e1('0x5b')],'channel':_0x26e1('0x6f')};var _0x4eb4df=[];var _0x4ef816=[];var _0x1861e8={};var _0x46f0ea=![];return db[_0x26e1('0x70')][_0x26e1('0x61')]()[_0x26e1('0x21')](function(_0x157f69){if(!_0x157f69){throw new db[(_0x26e1('0x71'))][(_0x26e1('0x72'))](_0x26e1('0x73'));}_0x4eb4df=_[_0x26e1('0x74')](_[_0x26e1('0x58')](_0x157f69),[_0x26e1('0x75'),_0x26e1('0x76')]);_0x4ef816=_['difference'](_['keys'](_0x157f69),['createdAt',_0x26e1('0x76'),_0x26e1('0x77'),_0x26e1('0x78')]);if(_0x50524f[_0x26e1('0x5b')]['id']){delete _0x50524f[_0x26e1('0x5b')]['id'];}if(_[_0x26e1('0x79')](_0x50524f[_0x26e1('0x5b')]['from'])){throw new db['Sequelize'][(_0x26e1('0x72'))](_0x26e1('0x7a'));}if(_[_0x26e1('0x79')](_0x50524f[_0x26e1('0x5b')]['body'])||_0x50524f[_0x26e1('0x5b')]['body']===''){throw new db['Sequelize'][(_0x26e1('0x72'))](_0x26e1('0x7b'));}if(_[_0x26e1('0x79')](_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7c')])){throw new db[(_0x26e1('0x71'))][(_0x26e1('0x72'))](_0x26e1('0x7d')+_0x4ef816);}if(!_['includes'](_0x4ef816,_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7c')])){throw new db[(_0x26e1('0x71'))][(_0x26e1('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ef816);}_0x1861e8[_0x50524f['body']['mapKey']]=_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7e')];})['then'](function(){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x50524f[_0x26e1('0x60')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x26e1('0x70')],'as':_0x26e1('0x7f'),'where':_0x1861e8,'limit':0x1,'order':[[_0x26e1('0x76'),_0x26e1('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':_0x26e1('0x81')}]});})['then'](handleEntityNotFound(_0x190d73,null))[_0x26e1('0x21')](function(_0x568d96){if(_0x568d96&&_0x568d96[_0x26e1('0x82')]){_0xc6e690[_0x26e1('0x83')]=_0x568d96;_0xc6e690[_0x26e1('0x84')]=_0x568d96[_0x26e1('0x81')];_0xc6e690[_0x26e1('0x85')]=_0x568d96[_0x26e1('0x82')];_0xc6e690[_0x26e1('0x84')]=_[_0x26e1('0x86')](_0xc6e690[_0x26e1('0x84')],['priority'],[_0x26e1('0x87')]);if(_0xc6e690[_0x26e1('0x83')]['Applications']){delete _0xc6e690[_0x26e1('0x83')][_0x26e1('0x81')];}if(_0xc6e690[_0x26e1('0x83')][_0x26e1('0x82')]&&_0xc6e690[_0x26e1('0x83')][_0x26e1('0x82')][_0x26e1('0x7f')][_0x26e1('0x49')]){return _0xc6e690[_0x26e1('0x83')]['List'][_0x26e1('0x7f')][0x0];}var _0x6dd8c=_[_0x26e1('0x1a')](_0x50524f[_0x26e1('0x5b')],{'firstName':_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7e')],'ListId':_0x568d96[_0x26e1('0x78')]});_0x6dd8c[_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7c')]]=_0x50524f[_0x26e1('0x5b')]['from'];return db['CmContact']['create'](_0x6dd8c,{'fields':_0x4eb4df,'raw':!![]});}})[_0x26e1('0x21')](handleEntityNotFound(_0x190d73,null))['then'](function(_0x5c5bc1){_0xc6e690[_0x26e1('0x88')]=_0x5c5bc1;if(_0x5c5bc1){var _0x30a3b4={'ContactId':_0x5c5bc1['id'],'OpenchannelAccountId':_0x50524f[_0x26e1('0x60')]['id'],'from':(_0x5c5bc1[_0x26e1('0x89')]||'')+'\x20'+(_0x5c5bc1[_0x26e1('0x8a')]||'')};var _0x45411b={'OpenchannelAccountId':_0x50524f[_0x26e1('0x60')]['id'],'closed':![]};if(_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8b')]){_0x45411b[_0x26e1('0x8b')]=_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8b')];return db['OpenchannelInteraction']['find']({'where':_0x45411b})[_0x26e1('0x21')](function(_0x3f4053){if(_0x3f4053){return[_0x3f4053,![]];}_0x30a3b4[_0x26e1('0x8b')]=_0x50524f['body'][_0x26e1('0x8b')];_0x30a3b4['externalUrl']=_0x50524f[_0x26e1('0x5b')]['externalUrl'];return db['OpenchannelInteraction'][_0x26e1('0x5a')](_0x30a3b4)[_0x26e1('0x21')](function(_0x2bbb3c){return[_0x2bbb3c,!![]];});});}else{_0x45411b[_0x26e1('0x8b')]=null;}_0x45411b['ContactId']=_0x5c5bc1['id'];return db[_0x26e1('0x8c')][_0x26e1('0x59')]({'where':_0x45411b})['then'](function(_0xbc812c){if(_0xbc812c){return[_0xbc812c,![]];}return db[_0x26e1('0x8c')][_0x26e1('0x5a')](_0x30a3b4)['then'](function(_0x2fba62){return[_0x2fba62,!![]];});});}})[_0x26e1('0x8d')](function(_0x4f2e5e,_0x6aa0a3){if(_0x4f2e5e){_0x46f0ea=_0x6aa0a3;if(!_0x6aa0a3){var _0x4b49e5={'from':(_0xc6e690['contact'][_0x26e1('0x89')]||'')+'\x20'+(_0xc6e690[_0x26e1('0x88')][_0x26e1('0x8a')]||'')};if(_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8b')]&&_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8e')]&&_0x50524f[_0x26e1('0x5b')]['threadId']!=_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8e')]){_0x4b49e5[_0x26e1('0x8b')]=_0x50524f['body'][_0x26e1('0x8e')];}return _0x4f2e5e[_0x26e1('0x35')](_0x4b49e5);}else{return _0x4f2e5e;}}})['then'](function(_0x7b3efa){_0xc6e690[_0x26e1('0x8f')]=_0x7b3efa[_0x26e1('0x37')]({'plain':!![]});_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x90')]=_0x46f0ea;if(_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x90')]){if(_0xc6e690[_0x26e1('0x83')][_0x26e1('0x91')]){_0xc6e690[_0x26e1('0x84')][_0x26e1('0x92')]({'id':0x0,'priority':_0xc6e690[_0x26e1('0x84')][_0x26e1('0x49')]+0x1,'app':_0x26e1('0x93'),'appdata':_0x26e1('0x94'),'interval':'*,*,*,*'});}}return db[_0x26e1('0x95')][_0x26e1('0x5a')]({'body':_0x50524f[_0x26e1('0x5b')][_0x26e1('0x5b')],'OpenchannelAccountId':_0x50524f[_0x26e1('0x60')]['id'],'OpenchannelInteractionId':_0x7b3efa['id'],'direction':'in','ContactId':_0xc6e690[_0x26e1('0x88')]['id'],'AttachmentId':_0x50524f[_0x26e1('0x5b')][_0x26e1('0x96')]});})[_0x26e1('0x21')](function(_0xd188fd){_0xc6e690[_0x26e1('0x28')]=_0xd188fd;if(_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x97')]){return db[_0x26e1('0x98')][_0x26e1('0x59')]({'attributes':['id',_0x26e1('0x3b')],'where':{'id':_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x97')]}})[_0x26e1('0x21')](function(_0x5b0727){if(_0x5b0727){_0xc6e690['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b0727[_0x26e1('0x3b')]+','+(_0xc6e690[_0x26e1('0x83')][_0x26e1('0x99')]||0xa),'interval':_0x26e1('0x9a')});_0xc6e690['forcedOwnership']=![];}return respondWithRpcPromise(_0x26e1('0x9b'),'startRouting',_0xc6e690);});}return respondWithRpcPromise('Start','startRouting',_0xc6e690);})[_0x26e1('0x21')](function(_0x47f45f){respondWithRpcPromise(_0x26e1('0x9c'),_0x26e1('0x9c'),{'event':_0x26e1('0x9d'),'message':_0x47f45f},client9002);return _0x47f45f;})['then'](respondWithResult(_0x190d73,null))[_0x26e1('0x29')](handleError(_0x190d73,null));};exports[_0x26e1('0x9e')]=function(_0x547479,_0x51b733){var _0x363ea6=_0x547479[_0x26e1('0x60')]['id'];var _0x28e1cb=_0x547479[_0x26e1('0x5b')];var _0x316337=0xc8;var _0x11f82d=null;return db[_0x26e1('0x9f')][_0x26e1('0xa0')]({'isolationLevel':db[_0x26e1('0x9f')][_0x26e1('0xa1')][_0x26e1('0xa2')][_0x26e1('0xa3')]},function(_0x5addf2){return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x363ea6},'transaction':_0x5addf2})[_0x26e1('0x21')](function(_0x308b91){if(_0x308b91){return db[_0x26e1('0xa4')][_0x26e1('0x36')]({'where':{'OpenchannelAccountId':_0x363ea6},'transaction':_0x5addf2})[_0x26e1('0x21')](function(){var _0x5491d5=_[_0x26e1('0x3e')](_0x28e1cb,function(_0x451f24){_0x451f24[_0x26e1('0x63')]=_0x363ea6;return _0x451f24;});return db[_0x26e1('0xa4')]['bulkCreate'](_0x5491d5,{'transaction':_0x5addf2});});}else{_0x316337=0x194;_0x11f82d=[];}});})['then'](function(){if(_0x316337!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x363ea6},'order':_0x26e1('0xa5')})[_0x26e1('0x21')](function(_0x431ce5){_0x11f82d=_0x431ce5;});}})[_0x26e1('0x29')](function(_0x3e0bcd){_0x316337=0x1f4;logger[_0x26e1('0x27')](_0x3e0bcd[_0x26e1('0xa6')]);if(_0x3e0bcd[_0x26e1('0x3b')]){delete _0x3e0bcd[_0x26e1('0x3b')];}_0x11f82d=_0x3e0bcd;})[_0x26e1('0xa7')](function(){if(_0x11f82d===null){_0x51b733[_0x26e1('0x3a')](_0x316337);}else{if(_0x316337===0x1f4){_0x51b733[_0x26e1('0x30')](_0x316337)[_0x26e1('0xa8')](_0x11f82d);}else{_0x51b733['status'](_0x316337)[_0x26e1('0x2b')](_0x11f82d);}}});};exports[_0x26e1('0xa9')]=function(_0x16aabf,_0x2b687c,_0x22a389){var _0x19bddd={};var _0xb60a5a={};var _0x3c99d5;var _0x4d7e26;return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x16aabf[_0x26e1('0x60')]['id']}})['then'](handleEntityNotFound(_0x2b687c,null))[_0x26e1('0x21')](function(_0x907c65){if(_0x907c65){_0x3c99d5=_0x907c65;_0xb60a5a[_0x26e1('0x43')]=_[_0x26e1('0x58')](db[_0x26e1('0xa4')][_0x26e1('0x3f')]);_0xb60a5a[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x16aabf[_0x26e1('0x44')]);_0xb60a5a['filters']=_['intersection'](_0xb60a5a[_0x26e1('0x43')],_0xb60a5a['query']);_0x19bddd[_0x26e1('0x47')]=_[_0x26e1('0x46')](_0xb60a5a[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x16aabf[_0x26e1('0x44')][_0x26e1('0x48')]));_0x19bddd[_0x26e1('0x47')]=_0x19bddd[_0x26e1('0x47')][_0x26e1('0x49')]?_0x19bddd['attributes']:_0xb60a5a[_0x26e1('0x43')];_0x19bddd[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x16aabf['query'][_0x26e1('0x4d')]);_0x19bddd['where']=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x16aabf[_0x26e1('0x44')],_0xb60a5a[_0x26e1('0x45')]));if(_0x16aabf[_0x26e1('0x44')]['filter']){_0x19bddd[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x19bddd[_0x26e1('0x51')],{'$or':_[_0x26e1('0x3e')](_0x19bddd['attributes'],function(_0x175ca3){var _0x325448={};_0x325448[_0x175ca3]={'$like':'%'+_0x16aabf['query'][_0x26e1('0x67')]+'%'};return _0x325448;})});}_0x19bddd=_['merge']({},_0x19bddd,_0x16aabf[_0x26e1('0x50')]);return _0x3c99d5[_0x26e1('0xa9')](_0x19bddd);}})['then'](function(_0x883218){if(_0x883218){_0x4d7e26=_0x883218[_0x26e1('0x49')];if(!_0x16aabf['query']['hasOwnProperty']('nolimit')){_0x19bddd[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x16aabf[_0x26e1('0x44')]['limit']);_0x19bddd[_0x26e1('0x2e')]=qs[_0x26e1('0x2e')](_0x16aabf['query'][_0x26e1('0x2e')]);}return _0x3c99d5[_0x26e1('0xa9')](_0x19bddd);}})['then'](function(_0x1fc599){if(_0x1fc599){return _0x1fc599?{'count':_0x4d7e26,'rows':_0x1fc599}:null;}})['then'](respondWithResult(_0x2b687c,null))[_0x26e1('0x29')](handleError(_0x2b687c,null));};exports[_0x26e1('0xaa')]=function(_0x72cfe4,_0xf52d05,_0x4c49e0){var _0x512db1={'raw':![],'where':{}};var _0x261b27={};var _0x26b53d={'count':0x0,'rows':[]};return db[_0x26e1('0x54')]['findOne']({'where':{'id':_0x72cfe4['params']['id']}})['then'](handleEntityNotFound(_0xf52d05,null))[_0x26e1('0x21')](function(_0x5223d3){if(_0x5223d3){_0x261b27[_0x26e1('0x43')]=_[_0x26e1('0x58')](db['OpenchannelInteraction'][_0x26e1('0x3f')]);_0x261b27[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x72cfe4[_0x26e1('0x44')]);_0x261b27[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x261b27['model'],_0x261b27[_0x26e1('0x44')]);_0x512db1[_0x26e1('0x47')]=_['intersection'](_0x261b27[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x48')]));_0x512db1[_0x26e1('0x47')]=_0x512db1['attributes'][_0x26e1('0x49')]?_0x512db1[_0x26e1('0x47')]:_0x261b27[_0x26e1('0x43')];if(!_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x512db1[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x512db1[_0x26e1('0x2e')]=qs[_0x26e1('0x2e')](_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x2e')]);}_0x512db1[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x72cfe4['query'][_0x26e1('0x4d')]);_0x512db1[_0x26e1('0x51')]=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x72cfe4[_0x26e1('0x44')],_0x261b27[_0x26e1('0x45')]));_0x512db1[_0x26e1('0x51')][_0x26e1('0x63')]=_0x5223d3['id'];if(_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x67')]){_0x512db1[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x512db1[_0x26e1('0x51')],{'$or':_['map'](_0x512db1[_0x26e1('0x47')],function(_0x195c4f){var _0x33dc81={};_0x33dc81[_0x195c4f]={'$like':'%'+_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x67')]+'%'};return _0x33dc81;})});}_0x512db1=_[_0x26e1('0x4e')]({},_0x512db1,_0x72cfe4['options']);return db[_0x26e1('0x8c')][_0x26e1('0x2d')]({'where':_0x512db1['where']})[_0x26e1('0x21')](function(_0x3210ca){_0x26b53d[_0x26e1('0x2d')]=_0x3210ca;if(_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x52')]){_0x512db1[_0x26e1('0x53')]=[{'model':db['CmContact'],'as':_0x26e1('0xab'),'required':![]},{'model':db[_0x26e1('0x98')],'as':'Owner','attributes':[_0x26e1('0x3b'),_0x26e1('0xac'),_0x26e1('0xad')],'required':![]},{'model':db[_0x26e1('0xae')],'as':_0x26e1('0xaf'),'attributes':['id',_0x26e1('0x3b'),'color'],'where':_0x72cfe4[_0x26e1('0x44')]['tag']?{'id':_0x72cfe4[_0x26e1('0x44')][_0x26e1('0xb0')]}:undefined,'required':_0x72cfe4[_0x26e1('0x44')][_0x26e1('0xb0')]?!![]:![]}];}return db[_0x26e1('0x8c')][_0x26e1('0x55')](_0x512db1);})[_0x26e1('0x21')](function(_0x3a3964){_0x26b53d[_0x26e1('0x56')]=_0x3a3964;return _0x26b53d;});}})[_0x26e1('0x21')](respondWithFilteredResult(_0xf52d05,_0x512db1))['catch'](handleError(_0xf52d05,null));};exports['addAgents']=function(_0xa3042,_0x336c45,_0x16d0ce){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0xa3042[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x336c45,null))['then'](function(_0x2ef313){if(_0x2ef313){return _0x2ef313[_0x26e1('0xb1')](_0xa3042[_0x26e1('0x5b')][_0x26e1('0x6a')],_['omit'](_0xa3042[_0x26e1('0x5b')],[_0x26e1('0x6a'),'id'])||{})[_0x26e1('0x8d')](function(_0x591d05){for(var _0x5872a2=0x0;_0x5872a2<_0xa3042[_0x26e1('0x5b')][_0x26e1('0x6a')][_0x26e1('0x49')];_0x5872a2+=0x1){socket[_0x26e1('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0xa3042[_0x26e1('0x5b')]['ids'][_0x5872a2]),'OpenchannelAccountId':Number(_0xa3042[_0x26e1('0x60')]['id'])});}return _0x591d05;});}})[_0x26e1('0x21')](respondWithResult(_0x336c45,null))['catch'](handleError(_0x336c45,null));};exports[_0x26e1('0xb3')]=function(_0x26a9dd,_0x3a5d2a,_0x1334e2){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x26a9dd[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x3a5d2a,null))[_0x26e1('0x21')](function(_0x4c73b0){if(_0x4c73b0){return _0x4c73b0[_0x26e1('0xb3')](_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')])[_0x26e1('0x21')](function(){if(_['isArray'](_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')])){for(var _0x269416=0x0;_0x269416<_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')]['length'];_0x269416+=0x1){socket['emit'](_0x26e1('0xb4'),{'UserId':Number(_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')][_0x269416]),'OpenchannelAccountId':Number(_0x26a9dd[_0x26e1('0x60')]['id'])});}}else{socket[_0x26e1('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x26a9dd['query'][_0x26e1('0x6a')]),'OpenchannelAccountId':Number(_0x26a9dd[_0x26e1('0x60')]['id'])});}});}})[_0x26e1('0x21')](respondWithStatusCode(_0x3a5d2a,null))[_0x26e1('0x29')](handleError(_0x3a5d2a,null));};exports['getAgents']=function(_0x320b6e,_0x29ec4a,_0x5ad465){var _0x4db5b2={};var _0x139411={};var _0x5d2e78;var _0x4d6edf;return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x320b6e[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x29ec4a,null))[_0x26e1('0x21')](function(_0xa40054){if(_0xa40054){_0x5d2e78=_0xa40054;_0x139411[_0x26e1('0x43')]=_[_0x26e1('0x58')](db[_0x26e1('0x98')][_0x26e1('0x3f')]);_0x139411[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x320b6e[_0x26e1('0x44')]);_0x139411[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x139411[_0x26e1('0x43')],_0x139411['query']);_0x4db5b2['attributes']=_[_0x26e1('0x46')](_0x139411[_0x26e1('0x43')],qs['fields'](_0x320b6e[_0x26e1('0x44')][_0x26e1('0x48')]));_0x4db5b2[_0x26e1('0x47')]=_0x4db5b2[_0x26e1('0x47')][_0x26e1('0x49')]?_0x4db5b2['attributes']:_0x139411['model'];_0x4db5b2['order']=qs[_0x26e1('0x4d')](_0x320b6e['query']['sort']);_0x4db5b2['where']=qs[_0x26e1('0x45')](_['pick'](_0x320b6e[_0x26e1('0x44')],_0x139411[_0x26e1('0x45')]));if(_0x320b6e['query']['filter']){_0x4db5b2[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x4db5b2['where'],{'$or':_[_0x26e1('0x3e')](_0x4db5b2[_0x26e1('0x47')],function(_0x55cbdf){var _0x1c31a5={};_0x1c31a5[_0x55cbdf]={'$like':'%'+_0x320b6e[_0x26e1('0x44')][_0x26e1('0x67')]+'%'};return _0x1c31a5;})});}_0x4db5b2=_[_0x26e1('0x4e')]({},_0x4db5b2,_0x320b6e[_0x26e1('0x50')]);return _0x5d2e78['getAgents'](_0x4db5b2);}})[_0x26e1('0x21')](function(_0x219dd3){if(_0x219dd3){_0x4d6edf=_0x219dd3[_0x26e1('0x49')];if(!_0x320b6e[_0x26e1('0x44')]['hasOwnProperty'](_0x26e1('0x4b'))){_0x4db5b2[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x320b6e[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x4db5b2['offset']=qs[_0x26e1('0x2e')](_0x320b6e[_0x26e1('0x44')]['offset']);}return _0x5d2e78[_0x26e1('0xb5')](_0x4db5b2);}})[_0x26e1('0x21')](function(_0x305dae){if(_0x305dae){return _0x305dae?{'count':_0x4d6edf,'rows':_0x305dae}:null;}})[_0x26e1('0x21')](respondWithResult(_0x29ec4a,null))[_0x26e1('0x29')](handleError(_0x29ec4a,null));};exports[_0x26e1('0xa8')]=function(_0x5ca4bb,_0x5f0f0c,_0x573b11){var _0x19fb2e,_0x4b4d51,_0x1f59ff;if(_[_0x26e1('0x79')](_0x5ca4bb[_0x26e1('0x5b')][_0x26e1('0x5b')])||_0x5ca4bb['body'][_0x26e1('0x5b')]===''){throw new db['Sequelize'][(_0x26e1('0x72'))](_0x26e1('0x7b'));}if(_[_0x26e1('0x79')](_0x5ca4bb[_0x26e1('0x5b')]['to'])){}_0x19fb2e=_0x5ca4bb[_0x26e1('0x5b')]['to'];return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x5ca4bb['params']['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x5f0f0c,null))[_0x26e1('0x21')](function(_0x5be42f){if(_0x5be42f){return db['OpenchannelAccount']['find']({'where':{'id':_0x5be42f['id']},'include':[{'model':db[_0x26e1('0xb6')],'as':_0x26e1('0x82'),'include':[{'model':db[_0x26e1('0x70')],'as':_0x26e1('0x7f'),'where':{[_0x5be42f[_0x26e1('0x7c')]]:_0x19fb2e},'limit':0x1,'order':[[_0x26e1('0x76'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5f0f0c,null))[_0x26e1('0x21')](function(_0xf632e1){if(_0xf632e1&&_0xf632e1['List']){_0x4b4d51=_0xf632e1['get']({'plain':!![]});if(_0x4b4d51[_0x26e1('0x82')]&&_0x4b4d51[_0x26e1('0x82')][_0x26e1('0x7f')][_0x26e1('0x49')]){return _0x4b4d51[_0x26e1('0x82')][_0x26e1('0x7f')][0x0];}return db[_0x26e1('0x70')]['create'](_['defaults'](_0x5ca4bb[_0x26e1('0x5b')],{'firstName':_0x19fb2e,[_0xf632e1[_0x26e1('0x7c')]]:_0x19fb2e,'phone':_0x19fb2e,'ListId':_0x4b4d51[_0x26e1('0x78')]}));}})[_0x26e1('0x21')](handleEntityNotFound(_0x5f0f0c,null))['then'](function(_0x315bda){if(_0x315bda){_0x1f59ff=_0x315bda;return db[_0x26e1('0x8c')][_0x26e1('0x59')]({'where':{'ContactId':_0x1f59ff['id'],'closed':![],'OpenchannelAccountId':_0x4b4d51['id']}})[_0x26e1('0x21')](function(_0x166100){if(_0x166100){return[_0x166100,![]];}return db['OpenchannelInteraction'][_0x26e1('0x5a')]({'UserId':_0x5ca4bb[_0x26e1('0x5c')]['id'],'ContactId':_0x1f59ff['id'],'OpenchannelAccountId':_0x4b4d51['id'],'lastMsgDirection':_0x26e1('0xb7'),'firstMsgDirection':_0x26e1('0xb7'),'Messages':[_[_0x26e1('0x4e')](_0x5ca4bb[_0x26e1('0x5b')],{'read':![],'body':_0x5ca4bb['body'][_0x26e1('0x5b')],'OpenchannelAccountId':_0x4b4d51['id'],'UserId':_0x5ca4bb[_0x26e1('0x5c')]['id'],'ContactId':_0x1f59ff['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x26e1('0xb8')}]})['then'](function(_0x176d1a){return[_0x176d1a,!![]];});});}})[_0x26e1('0x8d')](function(_0x47910b,_0x4ae455){if(_0x4ae455){return _0x47910b;}return db[_0x26e1('0x95')][_0x26e1('0x5a')](_[_0x26e1('0x4e')](_0x5ca4bb[_0x26e1('0x5b')],{'read':![],'body':_0x5ca4bb[_0x26e1('0x5b')][_0x26e1('0x5b')],'OpenchannelAccountId':_0x4b4d51['id'],'OpenchannelInteractionId':_0x47910b['id'],'UserId':_0x5ca4bb[_0x26e1('0x5c')]['id'],'ContactId':_0x1f59ff['id']}))[_0x26e1('0x21')](function(_0x4c6385){_0x47910b[_0x26e1('0xb9')][_0x26e1('0xb8')]=[];_0x47910b[_0x26e1('0xb9')][_0x26e1('0xb8')][_0x26e1('0x92')](_0x4c6385[_0x26e1('0xb9')]);return _0x47910b;});});}})[_0x26e1('0x21')](respondWithResult(_0x5f0f0c,null))[_0x26e1('0x29')](handleError(_0x5f0f0c,null));}; \ No newline at end of file +var _0x3378=['Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','get','OpenchannelAccounts','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','includeAll','create','body','user','role','find','userProfileId','autoAssociation','UserProfileResource','update','describe','addDisposition','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','Sequelize','ValidationError','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','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','priority','from','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','out'];(function(_0x2d6c83,_0x52c3e2){var _0x508c40=function(_0x580069){while(--_0x580069){_0x2d6c83['push'](_0x2d6c83['shift']());}};_0x508c40(++_0x52c3e2);}(_0x3378,0xc2));var _0x8337=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x3378[_0x1b3a5c];return _0x2ae8cb;};'use strict';var emlformat=require(_0x8337('0x0'));var rimraf=require(_0x8337('0x1'));var zipdir=require(_0x8337('0x2'));var jsonpatch=require(_0x8337('0x3'));var rp=require(_0x8337('0x4'));var moment=require(_0x8337('0x5'));var BPromise=require(_0x8337('0x6'));var Mustache=require(_0x8337('0x7'));var util=require(_0x8337('0x8'));var path=require(_0x8337('0x9'));var sox=require(_0x8337('0xa'));var csv=require(_0x8337('0xb'));var ejs=require(_0x8337('0xc'));var fs=require('fs');var fs_extra=require(_0x8337('0xd'));var _=require(_0x8337('0xe'));var squel=require(_0x8337('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8337('0xb'));var querystring=require('querystring');var Papa=require(_0x8337('0x10'));var Redis=require('ioredis');var authService=require(_0x8337('0x11'));var qs=require(_0x8337('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8337('0x13'));var logger=require(_0x8337('0x14'))(_0x8337('0x15'));var utils=require(_0x8337('0x16'));var config=require(_0x8337('0x17'));var licenseUtil=require(_0x8337('0x18'));var db=require(_0x8337('0x19'))['db'];config[_0x8337('0x1a')]=_[_0x8337('0x1b')](config[_0x8337('0x1a')],{'host':_0x8337('0x1c'),'port':0x18eb});var socket=require(_0x8337('0x1d'))(new Redis(config[_0x8337('0x1a')]));require(_0x8337('0x1e'))[_0x8337('0x1f')](socket);var jayson=require(_0x8337('0x20'));var client=jayson['client'][_0x8337('0x21')]({'port':0x232c});var client9002=jayson[_0x8337('0x22')][_0x8337('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x384d23,_0x32c858,_0x3e34ba,_0x53b6c5){return new BPromise(function(_0x42bdf0,_0x2ff9bb){var _0x4ceae0=_0x53b6c5||client;return _0x4ceae0['request'](_0x384d23,_0x3e34ba)[_0x8337('0x23')](function(_0x260104){logger[_0x8337('0x24')](_0x8337('0x25'),_0x32c858,_0x8337('0x26'));logger['debug'](_0x8337('0x27'),_0x32c858,_0x8337('0x26'),JSON[_0x8337('0x28')](_0x260104));if(_0x260104[_0x8337('0x29')]){if(_0x260104['error'][_0x8337('0x2a')]===0x1f4){logger[_0x8337('0x29')](_0x8337('0x25'),_0x32c858,_0x260104[_0x8337('0x29')][_0x8337('0x2b')]);return _0x2ff9bb(_0x260104[_0x8337('0x29')][_0x8337('0x2b')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x32c858,_0x260104['error'][_0x8337('0x2b')]);return _0x42bdf0(_0x260104['error'][_0x8337('0x2b')]);}else{logger[_0x8337('0x24')](_0x8337('0x25'),_0x32c858,'request\x20sent');_0x42bdf0(_0x260104[_0x8337('0x2c')][_0x8337('0x2b')]);}})[_0x8337('0x2d')](function(_0x27e2df){logger[_0x8337('0x29')](_0x8337('0x25'),_0x32c858,_0x27e2df);_0x2ff9bb(_0x27e2df);});});}function respondWithStatusCode(_0x4f3d2d,_0x33fb86){_0x33fb86=_0x33fb86||0xcc;return function(_0x34002f){if(_0x34002f){return _0x4f3d2d['sendStatus'](_0x33fb86);}return _0x4f3d2d[_0x8337('0x2e')](_0x33fb86)['end']();};}function respondWithResult(_0x1f4335,_0x4e4cad){_0x4e4cad=_0x4e4cad||0xc8;return function(_0x1145c5){if(_0x1145c5){return _0x1f4335[_0x8337('0x2e')](_0x4e4cad)[_0x8337('0x2f')](_0x1145c5);}};}function respondWithFilteredResult(_0x312a55,_0x46f034){return function(_0x26d62a){if(_0x26d62a){var _0x5041e1=typeof _0x46f034[_0x8337('0x30')]===_0x8337('0x31')&&typeof _0x46f034[_0x8337('0x32')]===_0x8337('0x31');var _0x3ea04e=_0x26d62a['count'];var _0x295c95=_0x5041e1?0x0:_0x46f034[_0x8337('0x30')];var _0x255caa=_0x5041e1?_0x26d62a[_0x8337('0x33')]:_0x46f034[_0x8337('0x30')]+_0x46f034[_0x8337('0x32')];var _0x280f15;if(_0x255caa>=_0x3ea04e){_0x255caa=_0x3ea04e;_0x280f15=0xc8;}else{_0x280f15=0xce;}_0x312a55[_0x8337('0x2e')](_0x280f15);return _0x312a55[_0x8337('0x34')](_0x8337('0x35'),_0x295c95+'-'+_0x255caa+'/'+_0x3ea04e)[_0x8337('0x2f')](_0x26d62a);}return null;};}function patchUpdates(_0x445f13){return function(_0x269e29){try{jsonpatch[_0x8337('0x36')](_0x269e29,_0x445f13,!![]);}catch(_0x1b5d79){return BPromise[_0x8337('0x37')](_0x1b5d79);}return _0x269e29['save']();};}function saveUpdates(_0x1ac124,_0x59a6a0){return function(_0x2bfc79){if(_0x2bfc79){return _0x2bfc79['update'](_0x1ac124)[_0x8337('0x23')](function(_0x26daed){return _0x26daed;});}return null;};}function removeEntity(_0x47d659,_0x398371){return function(_0x4509da){if(_0x4509da){return _0x4509da[_0x8337('0x38')]()[_0x8337('0x23')](function(){var _0xeec2b8=_0x4509da[_0x8337('0x39')]({'plain':!![]});var _0x1d820d=_0x8337('0x3a');return db['UserProfileResource'][_0x8337('0x38')]({'where':{'type':_0x1d820d,'resourceId':_0xeec2b8['id']}})['then'](function(){return _0x4509da;});})['then'](function(){_0x47d659[_0x8337('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dbdde,_0x2f7135){return function(_0x1fc840){if(!_0x1fc840){_0x1dbdde[_0x8337('0x3b')](0x194);}return _0x1fc840;};}function handleError(_0x5b6581,_0x4c5c0d){_0x4c5c0d=_0x4c5c0d||0x1f4;return function(_0x12ff25){logger[_0x8337('0x29')](_0x12ff25[_0x8337('0x3c')]);if(_0x12ff25[_0x8337('0x3d')]){delete _0x12ff25[_0x8337('0x3d')];}_0x5b6581['status'](_0x4c5c0d)[_0x8337('0x3e')](_0x12ff25);};}exports[_0x8337('0x3f')]=function(_0x5150ae,_0x1f4e5f){var _0x61fd09={'include':[{'model':db[_0x8337('0x40')],'as':_0x8337('0x41')}]},_0xa9eb34={},_0x321f0a={'count':0x0,'rows':[]};var _0x21dcf5=_['map'](db[_0x8337('0x42')][_0x8337('0x43')],function(_0x2c2c5e){return{'name':_0x2c2c5e[_0x8337('0x44')],'type':_0x2c2c5e[_0x8337('0x45')][_0x8337('0x46')]};});_0xa9eb34[_0x8337('0x47')]=_['map'](_0x21dcf5,_0x8337('0x3d'));_0xa9eb34[_0x8337('0x48')]=_['keys'](_0x5150ae[_0x8337('0x48')]);_0xa9eb34[_0x8337('0x49')]=_['intersection'](_0xa9eb34[_0x8337('0x47')],_0xa9eb34[_0x8337('0x48')]);_0x61fd09['attributes']=_[_0x8337('0x4a')](_0xa9eb34['model'],qs[_0x8337('0x4b')](_0x5150ae[_0x8337('0x48')][_0x8337('0x4b')]));_0x61fd09[_0x8337('0x4c')]=_0x61fd09[_0x8337('0x4c')][_0x8337('0x4d')]?_0x61fd09[_0x8337('0x4c')]:_0xa9eb34[_0x8337('0x47')];if(!_0x5150ae['query'][_0x8337('0x4e')](_0x8337('0x4f'))){_0x61fd09['limit']=qs[_0x8337('0x32')](_0x5150ae['query'][_0x8337('0x32')]);_0x61fd09[_0x8337('0x30')]=qs[_0x8337('0x30')](_0x5150ae[_0x8337('0x48')][_0x8337('0x30')]);}_0x61fd09[_0x8337('0x50')]=qs[_0x8337('0x51')](_0x5150ae['query'][_0x8337('0x51')]);_0x61fd09[_0x8337('0x52')]=qs[_0x8337('0x49')](_[_0x8337('0x53')](_0x5150ae[_0x8337('0x48')],_0xa9eb34[_0x8337('0x49')]),_0x21dcf5);if(_0x5150ae[_0x8337('0x48')]['filter']){_0x61fd09[_0x8337('0x52')]=_[_0x8337('0x54')](_0x61fd09[_0x8337('0x52')],{'$or':_[_0x8337('0x55')](_0x21dcf5,function(_0x10b89a){if(_0x10b89a['type']!==_0x8337('0x56')){var _0x10d371={};_0x10d371[_0x10b89a['name']]={'$like':'%'+_0x5150ae[_0x8337('0x48')][_0x8337('0x57')]+'%'};return _0x10d371;}})});}_0x61fd09=_[_0x8337('0x54')]({},_0x61fd09,_0x5150ae[_0x8337('0x58')]);var _0x22cb4c={'where':_0x61fd09[_0x8337('0x52')]};return db[_0x8337('0x42')][_0x8337('0x33')](_0x22cb4c)[_0x8337('0x23')](function(_0x1e19a5){_0x321f0a[_0x8337('0x33')]=_0x1e19a5;if(_0x5150ae[_0x8337('0x48')]['includeAll']){_0x61fd09[_0x8337('0x59')]=[{'all':!![]}];}return db[_0x8337('0x42')][_0x8337('0x5a')](_0x61fd09);})['then'](function(_0x414ef1){_0x321f0a[_0x8337('0x5b')]=_0x414ef1;return _0x321f0a;})[_0x8337('0x23')](respondWithFilteredResult(_0x1f4e5f,_0x61fd09))[_0x8337('0x2d')](handleError(_0x1f4e5f,null));};exports[_0x8337('0x5c')]=function(_0x35ea28,_0x332387){var _0x40b914={'raw':![],'where':{'id':_0x35ea28[_0x8337('0x5d')]['id']},'include':[{'model':db[_0x8337('0x40')],'as':'mandatoryDispositionPause'}]},_0xbf8d3b={};_0xbf8d3b[_0x8337('0x47')]=_['keys'](db[_0x8337('0x42')][_0x8337('0x43')]);_0xbf8d3b[_0x8337('0x48')]=_[_0x8337('0x5e')](_0x35ea28[_0x8337('0x48')]);_0xbf8d3b[_0x8337('0x49')]=_[_0x8337('0x4a')](_0xbf8d3b['model'],_0xbf8d3b[_0x8337('0x48')]);_0x40b914[_0x8337('0x4c')]=_[_0x8337('0x4a')](_0xbf8d3b[_0x8337('0x47')],qs[_0x8337('0x4b')](_0x35ea28[_0x8337('0x48')][_0x8337('0x4b')]));_0x40b914[_0x8337('0x4c')]=_0x40b914['attributes'][_0x8337('0x4d')]?_0x40b914[_0x8337('0x4c')]:_0xbf8d3b[_0x8337('0x47')];if(_0x35ea28[_0x8337('0x48')][_0x8337('0x5f')]){_0x40b914[_0x8337('0x59')]=[{'all':!![]}];}_0x40b914=_[_0x8337('0x54')]({},_0x40b914,_0x35ea28[_0x8337('0x58')]);return db[_0x8337('0x42')]['find'](_0x40b914)['then'](handleEntityNotFound(_0x332387,null))[_0x8337('0x23')](respondWithResult(_0x332387,null))[_0x8337('0x2d')](handleError(_0x332387,null));};exports[_0x8337('0x60')]=function(_0x1b1fc2,_0x5dc293){return db[_0x8337('0x42')][_0x8337('0x60')](_0x1b1fc2[_0x8337('0x61')],{})[_0x8337('0x23')](function(_0x2e4fd4){var _0x40e377=_0x1b1fc2[_0x8337('0x62')][_0x8337('0x39')]({'plain':!![]});if(!_0x40e377)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40e377[_0x8337('0x63')]==='user'){var _0x463933=_0x2e4fd4[_0x8337('0x39')]({'plain':!![]});var _0x3a5827='OpenchannelAccounts';return db['UserProfileSection'][_0x8337('0x64')]({'where':{'name':_0x3a5827,'userProfileId':_0x40e377[_0x8337('0x65')]},'raw':!![]})[_0x8337('0x23')](function(_0x384b6){if(_0x384b6&&_0x384b6[_0x8337('0x66')]===0x0){return db[_0x8337('0x67')]['create']({'name':_0x463933['name'],'resourceId':_0x463933['id'],'type':_0x384b6[_0x8337('0x3d')],'sectionId':_0x384b6['id']},{})[_0x8337('0x23')](function(){return _0x2e4fd4;});}else{return _0x2e4fd4;}})['catch'](function(_0x1d4d0a){logger[_0x8337('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d4d0a);throw _0x1d4d0a;});}return _0x2e4fd4;})[_0x8337('0x23')](respondWithResult(_0x5dc293,0xc9))[_0x8337('0x2d')](handleError(_0x5dc293,null));};exports[_0x8337('0x68')]=function(_0x55466f,_0x1d36cd){if(_0x55466f[_0x8337('0x61')]['id']){delete _0x55466f[_0x8337('0x61')]['id'];}return db[_0x8337('0x42')][_0x8337('0x64')]({'where':{'id':_0x55466f[_0x8337('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x8337('0x41')}]})[_0x8337('0x23')](handleEntityNotFound(_0x1d36cd,null))[_0x8337('0x23')](saveUpdates(_0x55466f[_0x8337('0x61')],null))[_0x8337('0x23')](respondWithResult(_0x1d36cd,null))[_0x8337('0x2d')](handleError(_0x1d36cd,null));};exports[_0x8337('0x38')]=function(_0x571a53,_0xf29ce9){return db['OpenchannelAccount'][_0x8337('0x64')]({'where':{'id':_0x571a53['params']['id']}})[_0x8337('0x23')](handleEntityNotFound(_0xf29ce9,null))[_0x8337('0x23')](removeEntity(_0xf29ce9,null))[_0x8337('0x2d')](handleError(_0xf29ce9,null));};exports['describe']=function(_0x504751,_0x283387){return db['OpenchannelAccount'][_0x8337('0x69')]()[_0x8337('0x23')](respondWithResult(_0x283387,null))['catch'](handleError(_0x283387,null));};exports[_0x8337('0x6a')]=function(_0x2439fc,_0x36fd20,_0x439630){if(_0x2439fc[_0x8337('0x61')]['id']){delete _0x2439fc[_0x8337('0x61')]['id'];}return db[_0x8337('0x42')][_0x8337('0x64')]({'where':{'id':_0x2439fc[_0x8337('0x5d')]['id']}})['then'](handleEntityNotFound(_0x36fd20,null))[_0x8337('0x23')](function(_0x38e82d){if(_0x38e82d){_0x2439fc[_0x8337('0x61')]['OpenchannelAccountId']=_0x38e82d['id'];return db[_0x8337('0x6b')][_0x8337('0x60')](_0x2439fc['body']);}})[_0x8337('0x23')](respondWithResult(_0x36fd20,null))['catch'](handleError(_0x36fd20,null));};exports[_0x8337('0x6c')]=function(_0x6038a1,_0x37105d,_0x1bb066){var _0x142bea={'raw':![],'where':{}};var _0x36f829={};var _0x17a8be={'count':0x0,'rows':[]};return db[_0x8337('0x42')][_0x8337('0x6d')]({'where':{'id':_0x6038a1['params']['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x37105d,null))[_0x8337('0x23')](function(_0x23921b){if(_0x23921b){_0x36f829[_0x8337('0x47')]=_[_0x8337('0x5e')](db[_0x8337('0x6b')][_0x8337('0x43')]);_0x36f829[_0x8337('0x48')]=_[_0x8337('0x5e')](_0x6038a1['query']);_0x36f829[_0x8337('0x49')]=_[_0x8337('0x4a')](_0x36f829[_0x8337('0x47')],_0x36f829[_0x8337('0x48')]);_0x142bea[_0x8337('0x4c')]=_[_0x8337('0x4a')](_0x36f829[_0x8337('0x47')],qs[_0x8337('0x4b')](_0x6038a1[_0x8337('0x48')][_0x8337('0x4b')]));_0x142bea['attributes']=_0x142bea[_0x8337('0x4c')][_0x8337('0x4d')]?_0x142bea[_0x8337('0x4c')]:_0x36f829[_0x8337('0x47')];if(!_0x6038a1[_0x8337('0x48')][_0x8337('0x4e')](_0x8337('0x4f'))){_0x142bea[_0x8337('0x32')]=qs[_0x8337('0x32')](_0x6038a1[_0x8337('0x48')][_0x8337('0x32')]);_0x142bea[_0x8337('0x30')]=qs[_0x8337('0x30')](_0x6038a1[_0x8337('0x48')][_0x8337('0x30')]);}_0x142bea[_0x8337('0x50')]=qs[_0x8337('0x51')](_0x6038a1[_0x8337('0x48')][_0x8337('0x51')]);_0x142bea[_0x8337('0x52')]=qs[_0x8337('0x49')](_[_0x8337('0x53')](_0x6038a1[_0x8337('0x48')],_0x36f829[_0x8337('0x49')]));_0x142bea[_0x8337('0x52')][_0x8337('0x6e')]=_0x23921b['id'];if(_0x6038a1[_0x8337('0x48')]['filter']){_0x142bea[_0x8337('0x52')]=_[_0x8337('0x54')](_0x142bea[_0x8337('0x52')],{'$or':_[_0x8337('0x55')](_0x142bea['attributes'],function(_0x4f25b6){var _0x2d52ab={};_0x2d52ab[_0x4f25b6]={'$like':'%'+_0x6038a1['query'][_0x8337('0x57')]+'%'};return _0x2d52ab;})});}_0x142bea=_[_0x8337('0x54')]({},_0x142bea,_0x6038a1[_0x8337('0x58')]);return db[_0x8337('0x6b')][_0x8337('0x33')]({'where':_0x142bea[_0x8337('0x52')]})[_0x8337('0x23')](function(_0x330f22){_0x17a8be[_0x8337('0x33')]=_0x330f22;if(_0x6038a1[_0x8337('0x48')]['includeAll']){_0x142bea['include']=[{'all':!![]}];}return db[_0x8337('0x6b')][_0x8337('0x5a')](_0x142bea);})['then'](function(_0x88e74d){_0x17a8be['rows']=_0x88e74d;return _0x17a8be;});}})[_0x8337('0x23')](respondWithFilteredResult(_0x37105d,_0x142bea))[_0x8337('0x2d')](handleError(_0x37105d,null));};exports[_0x8337('0x6f')]=function(_0x7db8b7,_0x5642e4,_0x19fb4e){return db[_0x8337('0x42')][_0x8337('0x64')]({'where':{'id':_0x7db8b7['params']['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x5642e4,null))['then'](function(_0x5ad3e8){if(_0x5ad3e8){return _0x5ad3e8[_0x8337('0x6f')](_0x7db8b7[_0x8337('0x48')][_0x8337('0x70')]);}})[_0x8337('0x23')](respondWithStatusCode(_0x5642e4,null))[_0x8337('0x2d')](handleError(_0x5642e4,null));};exports[_0x8337('0x71')]=function(_0x851beb,_0x44696e,_0x3b151e){if(_0x851beb[_0x8337('0x61')]['id']){delete _0x851beb['body']['id'];}return db[_0x8337('0x42')][_0x8337('0x64')]({'where':{'id':_0x851beb['params']['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x44696e,null))[_0x8337('0x23')](function(_0x372552){if(_0x372552){_0x851beb['body'][_0x8337('0x6e')]=_0x372552['id'];return db[_0x8337('0x72')][_0x8337('0x60')](_0x851beb[_0x8337('0x61')]);}})[_0x8337('0x23')](respondWithResult(_0x44696e,null))['catch'](handleError(_0x44696e,null));};exports[_0x8337('0x73')]=function(_0x289e4f,_0x411706,_0x259ad2){var _0x1fc9c5={'raw':![],'where':{}};var _0x5e88b1={};var _0x126fe4={'count':0x0,'rows':[]};return db[_0x8337('0x42')]['findOne']({'where':{'id':_0x289e4f[_0x8337('0x5d')]['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x411706,null))[_0x8337('0x23')](function(_0x582f3b){if(_0x582f3b){_0x5e88b1[_0x8337('0x47')]=_[_0x8337('0x5e')](db['CannedAnswer'][_0x8337('0x43')]);_0x5e88b1['query']=_[_0x8337('0x5e')](_0x289e4f[_0x8337('0x48')]);_0x5e88b1[_0x8337('0x49')]=_[_0x8337('0x4a')](_0x5e88b1['model'],_0x5e88b1[_0x8337('0x48')]);_0x1fc9c5[_0x8337('0x4c')]=_[_0x8337('0x4a')](_0x5e88b1[_0x8337('0x47')],qs['fields'](_0x289e4f[_0x8337('0x48')]['fields']));_0x1fc9c5[_0x8337('0x4c')]=_0x1fc9c5['attributes']['length']?_0x1fc9c5['attributes']:_0x5e88b1[_0x8337('0x47')];if(!_0x289e4f[_0x8337('0x48')][_0x8337('0x4e')](_0x8337('0x4f'))){_0x1fc9c5[_0x8337('0x32')]=qs[_0x8337('0x32')](_0x289e4f[_0x8337('0x48')][_0x8337('0x32')]);_0x1fc9c5[_0x8337('0x30')]=qs[_0x8337('0x30')](_0x289e4f['query']['offset']);}_0x1fc9c5[_0x8337('0x50')]=qs['sort'](_0x289e4f[_0x8337('0x48')]['sort']);_0x1fc9c5['where']=qs['filters'](_['pick'](_0x289e4f[_0x8337('0x48')],_0x5e88b1[_0x8337('0x49')]));_0x1fc9c5[_0x8337('0x52')][_0x8337('0x6e')]=_0x582f3b['id'];if(_0x289e4f[_0x8337('0x48')]['filter']){_0x1fc9c5[_0x8337('0x52')]=_[_0x8337('0x54')](_0x1fc9c5[_0x8337('0x52')],{'$or':_[_0x8337('0x55')](_0x1fc9c5[_0x8337('0x4c')],function(_0x455ea5){var _0x3f3137={};_0x3f3137[_0x455ea5]={'$like':'%'+_0x289e4f[_0x8337('0x48')][_0x8337('0x57')]+'%'};return _0x3f3137;})});}_0x1fc9c5=_[_0x8337('0x54')]({},_0x1fc9c5,_0x289e4f[_0x8337('0x58')]);return db['CannedAnswer'][_0x8337('0x33')]({'where':_0x1fc9c5['where']})['then'](function(_0x409feb){_0x126fe4[_0x8337('0x33')]=_0x409feb;if(_0x289e4f[_0x8337('0x48')]['includeAll']){_0x1fc9c5[_0x8337('0x59')]=[{'all':!![]}];}return db[_0x8337('0x72')][_0x8337('0x5a')](_0x1fc9c5);})[_0x8337('0x23')](function(_0x53522b){_0x126fe4[_0x8337('0x5b')]=_0x53522b;return _0x126fe4;});}})[_0x8337('0x23')](respondWithFilteredResult(_0x411706,_0x1fc9c5))[_0x8337('0x2d')](handleError(_0x411706,null));};exports['removeAnswers']=function(_0x4f51a0,_0x7e4f5c,_0x3a8042){return db[_0x8337('0x42')]['find']({'where':{'id':_0x4f51a0['params']['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x7e4f5c,null))['then'](function(_0x668142){if(_0x668142){return _0x668142[_0x8337('0x74')](_0x4f51a0[_0x8337('0x48')][_0x8337('0x70')]);}})['then'](respondWithStatusCode(_0x7e4f5c,null))[_0x8337('0x2d')](handleError(_0x7e4f5c,null));};exports[_0x8337('0x75')]=function(_0x53f8bf,_0x2499bb,_0x430d64){var _0x92f2ae={'body':_0x53f8bf[_0x8337('0x61')],'channel':_0x8337('0x76')};var _0x5b901c=[];var _0x4129b5=[];var _0x2f6860={};var _0x52c343=![];return db[_0x8337('0x77')]['describe']()[_0x8337('0x23')](function(_0x45d7a9){if(!_0x45d7a9){throw new db['Sequelize']['ValidationError'](_0x8337('0x78'));}_0x5b901c=_[_0x8337('0x79')](_[_0x8337('0x5e')](_0x45d7a9),[_0x8337('0x7a'),_0x8337('0x7b')]);_0x4129b5=_[_0x8337('0x79')](_[_0x8337('0x5e')](_0x45d7a9),[_0x8337('0x7a'),_0x8337('0x7b'),_0x8337('0x7c'),_0x8337('0x7d')]);if(_0x53f8bf[_0x8337('0x61')]['id']){delete _0x53f8bf[_0x8337('0x61')]['id'];}if(_[_0x8337('0x7e')](_0x53f8bf['body']['from'])){throw new db[(_0x8337('0x7f'))][(_0x8337('0x80'))](_0x8337('0x81'));}if(_[_0x8337('0x7e')](_0x53f8bf[_0x8337('0x61')][_0x8337('0x61')])||_0x53f8bf[_0x8337('0x61')][_0x8337('0x61')]===''){throw new db[(_0x8337('0x7f'))][(_0x8337('0x80'))](_0x8337('0x82'));}if(_[_0x8337('0x7e')](_0x53f8bf['body'][_0x8337('0x83')])){throw new db['Sequelize'][(_0x8337('0x80'))](_0x8337('0x84')+_0x4129b5);}if(!_[_0x8337('0x85')](_0x4129b5,_0x53f8bf[_0x8337('0x61')][_0x8337('0x83')])){throw new db[(_0x8337('0x7f'))][(_0x8337('0x80'))](_0x8337('0x86')+_0x4129b5);}_0x2f6860[_0x53f8bf['body'][_0x8337('0x83')]]=_0x53f8bf[_0x8337('0x61')]['from'];})['then'](function(){return db[_0x8337('0x42')][_0x8337('0x64')]({'where':{'id':_0x53f8bf[_0x8337('0x5d')]['id']},'include':[{'model':db[_0x8337('0x87')],'as':'List','include':[{'model':db[_0x8337('0x77')],'as':_0x8337('0x88'),'where':_0x2f6860,'limit':0x1,'order':[[_0x8337('0x7b'),_0x8337('0x89')]]}]},{'model':db[_0x8337('0x8a')],'as':_0x8337('0x8b')}]});})['then'](handleEntityNotFound(_0x2499bb,null))[_0x8337('0x23')](function(_0x2bdecd){if(_0x2bdecd&&_0x2bdecd[_0x8337('0x8c')]){_0x92f2ae[_0x8337('0x8d')]=_0x2bdecd;_0x92f2ae[_0x8337('0x8e')]=_0x2bdecd['Applications'];_0x92f2ae[_0x8337('0x8f')]=_0x2bdecd[_0x8337('0x8c')];_0x92f2ae[_0x8337('0x8e')]=_['orderBy'](_0x92f2ae[_0x8337('0x8e')],[_0x8337('0x90')],['asc']);if(_0x92f2ae[_0x8337('0x8d')][_0x8337('0x8b')]){delete _0x92f2ae[_0x8337('0x8d')][_0x8337('0x8b')];}if(_0x92f2ae[_0x8337('0x8d')][_0x8337('0x8c')]&&_0x92f2ae[_0x8337('0x8d')]['List'][_0x8337('0x88')][_0x8337('0x4d')]){return _0x92f2ae[_0x8337('0x8d')]['List'][_0x8337('0x88')][0x0];}var _0x3be5d1=_['defaults'](_0x53f8bf[_0x8337('0x61')],{'firstName':_0x53f8bf[_0x8337('0x61')]['from'],'ListId':_0x2bdecd[_0x8337('0x7d')]});_0x3be5d1[_0x53f8bf[_0x8337('0x61')]['mapKey']]=_0x53f8bf[_0x8337('0x61')][_0x8337('0x91')];return db[_0x8337('0x77')][_0x8337('0x60')](_0x3be5d1,{'fields':_0x5b901c,'raw':!![]});}})[_0x8337('0x23')](handleEntityNotFound(_0x2499bb,null))[_0x8337('0x23')](function(_0x2a4c77){_0x92f2ae[_0x8337('0x92')]=_0x2a4c77;if(_0x2a4c77){var _0x189f1c={'ContactId':_0x2a4c77['id'],'OpenchannelAccountId':_0x53f8bf[_0x8337('0x5d')]['id'],'from':(_0x2a4c77['firstName']||'')+'\x20'+(_0x2a4c77[_0x8337('0x93')]||'')};var _0x3c9b27={'OpenchannelAccountId':_0x53f8bf[_0x8337('0x5d')]['id'],'closed':![]};if(_0x53f8bf[_0x8337('0x61')]['threadId']){_0x3c9b27[_0x8337('0x94')]=_0x53f8bf[_0x8337('0x61')][_0x8337('0x94')];return db[_0x8337('0x95')][_0x8337('0x64')]({'where':_0x3c9b27})[_0x8337('0x23')](function(_0x1b4be2){if(_0x1b4be2){return[_0x1b4be2,![]];}_0x189f1c[_0x8337('0x94')]=_0x53f8bf[_0x8337('0x61')][_0x8337('0x94')];_0x189f1c[_0x8337('0x96')]=_0x53f8bf[_0x8337('0x61')][_0x8337('0x96')];return db[_0x8337('0x95')][_0x8337('0x60')](_0x189f1c)[_0x8337('0x23')](function(_0x2bb9c7){return[_0x2bb9c7,!![]];});});}else{_0x3c9b27[_0x8337('0x94')]=null;}_0x3c9b27[_0x8337('0x97')]=_0x2a4c77['id'];return db[_0x8337('0x95')][_0x8337('0x64')]({'where':_0x3c9b27})[_0x8337('0x23')](function(_0x8809d8){if(_0x8809d8){return[_0x8809d8,![]];}return db['OpenchannelInteraction'][_0x8337('0x60')](_0x189f1c)[_0x8337('0x23')](function(_0x3d5a1c){return[_0x3d5a1c,!![]];});});}})[_0x8337('0x98')](function(_0x30b22a,_0x4f8224){if(_0x30b22a){_0x52c343=_0x4f8224;if(!_0x4f8224){var _0x166b6f={'from':(_0x92f2ae['contact']['firstName']||'')+'\x20'+(_0x92f2ae[_0x8337('0x92')][_0x8337('0x93')]||'')};if(_0x53f8bf[_0x8337('0x61')]['threadId']&&_0x53f8bf[_0x8337('0x61')][_0x8337('0x99')]&&_0x53f8bf[_0x8337('0x61')][_0x8337('0x94')]!=_0x53f8bf['body'][_0x8337('0x99')]){_0x166b6f[_0x8337('0x94')]=_0x53f8bf[_0x8337('0x61')][_0x8337('0x99')];}return _0x30b22a[_0x8337('0x68')](_0x166b6f);}else{return _0x30b22a;}}})[_0x8337('0x23')](function(_0x38c36a){_0x92f2ae['interaction']=_0x38c36a[_0x8337('0x39')]({'plain':!![]});_0x92f2ae[_0x8337('0x9a')][_0x8337('0x9b')]=_0x52c343;if(_0x92f2ae[_0x8337('0x9a')][_0x8337('0x9b')]){if(_0x92f2ae['account'][_0x8337('0x9c')]){_0x92f2ae[_0x8337('0x8e')][_0x8337('0x9d')]({'id':0x0,'priority':_0x92f2ae[_0x8337('0x8e')]['length']+0x1,'app':_0x8337('0x9e'),'appdata':'unmanaged','interval':_0x8337('0x9f')});}}return db[_0x8337('0xa0')][_0x8337('0x60')]({'body':_0x53f8bf[_0x8337('0x61')][_0x8337('0x61')],'OpenchannelAccountId':_0x53f8bf[_0x8337('0x5d')]['id'],'OpenchannelInteractionId':_0x38c36a['id'],'direction':'in','ContactId':_0x92f2ae[_0x8337('0x92')]['id'],'AttachmentId':_0x53f8bf[_0x8337('0x61')][_0x8337('0xa1')]});})[_0x8337('0x23')](function(_0x24743d){_0x92f2ae[_0x8337('0x2b')]=_0x24743d;if(_0x92f2ae[_0x8337('0x9a')][_0x8337('0xa2')]){return db[_0x8337('0xa3')][_0x8337('0x64')]({'attributes':['id','name'],'where':{'id':_0x92f2ae[_0x8337('0x9a')][_0x8337('0xa2')]}})[_0x8337('0x23')](function(_0x415002){if(_0x415002){_0x92f2ae[_0x8337('0x8e')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x415002[_0x8337('0x3d')]+','+(_0x92f2ae[_0x8337('0x8d')][_0x8337('0xa4')]||0xa),'interval':_0x8337('0x9f')});_0x92f2ae[_0x8337('0xa5')]=![];}return respondWithRpcPromise(_0x8337('0xa6'),_0x8337('0xa7'),_0x92f2ae);});}return respondWithRpcPromise(_0x8337('0xa6'),_0x8337('0xa7'),_0x92f2ae);})[_0x8337('0x23')](function(_0x55fd5b){respondWithRpcPromise(_0x8337('0xa8'),'EventManager',{'event':'notify','message':_0x55fd5b},client9002);return _0x55fd5b;})['then'](respondWithResult(_0x2499bb,null))[_0x8337('0x2d')](handleError(_0x2499bb,null));};exports['addApplications']=function(_0x57a57e,_0x398ce6){var _0x1da431=_0x57a57e['params']['id'];var _0x17d9cb=_0x57a57e[_0x8337('0x61')];var _0x3e5cae=0xc8;var _0x2ec967=null;return db[_0x8337('0xa9')][_0x8337('0xaa')]({'isolationLevel':db[_0x8337('0xa9')][_0x8337('0xab')]['ISOLATION_LEVELS'][_0x8337('0xac')]},function(_0x59be52){return db['OpenchannelAccount'][_0x8337('0x6d')]({'where':{'id':_0x1da431},'transaction':_0x59be52})[_0x8337('0x23')](function(_0x2fb2d5){if(_0x2fb2d5){return db[_0x8337('0x8a')][_0x8337('0x38')]({'where':{'OpenchannelAccountId':_0x1da431},'transaction':_0x59be52})['then'](function(){var _0x44a4a0=_[_0x8337('0x55')](_0x17d9cb,function(_0x4b4a52){_0x4b4a52['OpenchannelAccountId']=_0x1da431;return _0x4b4a52;});return db[_0x8337('0x8a')]['bulkCreate'](_0x44a4a0,{'transaction':_0x59be52});});}else{_0x3e5cae=0x194;_0x2ec967=[];}});})[_0x8337('0x23')](function(){if(_0x3e5cae!==0x194){return db[_0x8337('0x8a')][_0x8337('0xad')]({'where':{'OpenchannelAccountId':_0x1da431},'order':'priority'})['then'](function(_0x3c67b6){_0x2ec967=_0x3c67b6;});}})[_0x8337('0x2d')](function(_0x5031d6){_0x3e5cae=0x1f4;logger[_0x8337('0x29')](_0x5031d6['stack']);if(_0x5031d6[_0x8337('0x3d')]){delete _0x5031d6[_0x8337('0x3d')];}_0x2ec967=_0x5031d6;})[_0x8337('0xae')](function(){if(_0x2ec967===null){_0x398ce6[_0x8337('0x3b')](_0x3e5cae);}else{if(_0x3e5cae===0x1f4){_0x398ce6[_0x8337('0x2e')](_0x3e5cae)['send'](_0x2ec967);}else{_0x398ce6[_0x8337('0x2e')](_0x3e5cae)[_0x8337('0x2f')](_0x2ec967);}}});};exports['getApplications']=function(_0x3daf90,_0x1d54fb,_0x13046d){var _0x17a72d={};var _0x290c69={};var _0x137a38;var _0x2091a8;return db[_0x8337('0x42')][_0x8337('0x6d')]({'where':{'id':_0x3daf90[_0x8337('0x5d')]['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x1d54fb,null))[_0x8337('0x23')](function(_0x494d15){if(_0x494d15){_0x137a38=_0x494d15;_0x290c69[_0x8337('0x47')]=_[_0x8337('0x5e')](db[_0x8337('0x8a')]['rawAttributes']);_0x290c69['query']=_['keys'](_0x3daf90['query']);_0x290c69[_0x8337('0x49')]=_[_0x8337('0x4a')](_0x290c69[_0x8337('0x47')],_0x290c69[_0x8337('0x48')]);_0x17a72d[_0x8337('0x4c')]=_['intersection'](_0x290c69[_0x8337('0x47')],qs[_0x8337('0x4b')](_0x3daf90[_0x8337('0x48')][_0x8337('0x4b')]));_0x17a72d[_0x8337('0x4c')]=_0x17a72d[_0x8337('0x4c')][_0x8337('0x4d')]?_0x17a72d[_0x8337('0x4c')]:_0x290c69[_0x8337('0x47')];_0x17a72d[_0x8337('0x50')]=qs[_0x8337('0x51')](_0x3daf90['query'][_0x8337('0x51')]);_0x17a72d[_0x8337('0x52')]=qs[_0x8337('0x49')](_['pick'](_0x3daf90[_0x8337('0x48')],_0x290c69['filters']));if(_0x3daf90[_0x8337('0x48')][_0x8337('0x57')]){_0x17a72d[_0x8337('0x52')]=_[_0x8337('0x54')](_0x17a72d['where'],{'$or':_[_0x8337('0x55')](_0x17a72d[_0x8337('0x4c')],function(_0x4444cb){var _0x28e803={};_0x28e803[_0x4444cb]={'$like':'%'+_0x3daf90['query']['filter']+'%'};return _0x28e803;})});}_0x17a72d=_[_0x8337('0x54')]({},_0x17a72d,_0x3daf90['options']);return _0x137a38[_0x8337('0xaf')](_0x17a72d);}})[_0x8337('0x23')](function(_0x296c15){if(_0x296c15){_0x2091a8=_0x296c15[_0x8337('0x4d')];if(!_0x3daf90['query'][_0x8337('0x4e')](_0x8337('0x4f'))){_0x17a72d[_0x8337('0x32')]=qs[_0x8337('0x32')](_0x3daf90[_0x8337('0x48')]['limit']);_0x17a72d['offset']=qs[_0x8337('0x30')](_0x3daf90[_0x8337('0x48')][_0x8337('0x30')]);}return _0x137a38[_0x8337('0xaf')](_0x17a72d);}})[_0x8337('0x23')](function(_0x10ce63){if(_0x10ce63){return _0x10ce63?{'count':_0x2091a8,'rows':_0x10ce63}:null;}})[_0x8337('0x23')](respondWithResult(_0x1d54fb,null))['catch'](handleError(_0x1d54fb,null));};exports[_0x8337('0xb0')]=function(_0x3808cc,_0x7044b0,_0x5138dd){var _0x2c6d01={'raw':![],'where':{}};var _0x2fbe99={};var _0x2f0667={'count':0x0,'rows':[]};return db[_0x8337('0x42')][_0x8337('0x6d')]({'where':{'id':_0x3808cc[_0x8337('0x5d')]['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x7044b0,null))[_0x8337('0x23')](function(_0x5dd7ed){if(_0x5dd7ed){_0x2fbe99[_0x8337('0x47')]=_[_0x8337('0x5e')](db['OpenchannelInteraction'][_0x8337('0x43')]);_0x2fbe99[_0x8337('0x48')]=_[_0x8337('0x5e')](_0x3808cc[_0x8337('0x48')]);_0x2fbe99[_0x8337('0x49')]=_[_0x8337('0x4a')](_0x2fbe99[_0x8337('0x47')],_0x2fbe99[_0x8337('0x48')]);_0x2c6d01[_0x8337('0x4c')]=_[_0x8337('0x4a')](_0x2fbe99['model'],qs[_0x8337('0x4b')](_0x3808cc[_0x8337('0x48')][_0x8337('0x4b')]));_0x2c6d01['attributes']=_0x2c6d01[_0x8337('0x4c')][_0x8337('0x4d')]?_0x2c6d01[_0x8337('0x4c')]:_0x2fbe99[_0x8337('0x47')];if(!_0x3808cc[_0x8337('0x48')][_0x8337('0x4e')](_0x8337('0x4f'))){_0x2c6d01['limit']=qs[_0x8337('0x32')](_0x3808cc[_0x8337('0x48')][_0x8337('0x32')]);_0x2c6d01['offset']=qs[_0x8337('0x30')](_0x3808cc[_0x8337('0x48')][_0x8337('0x30')]);}_0x2c6d01[_0x8337('0x50')]=qs[_0x8337('0x51')](_0x3808cc[_0x8337('0x48')][_0x8337('0x51')]);_0x2c6d01['where']=qs[_0x8337('0x49')](_['pick'](_0x3808cc['query'],_0x2fbe99[_0x8337('0x49')]));_0x2c6d01[_0x8337('0x52')][_0x8337('0x6e')]=_0x5dd7ed['id'];if(_0x3808cc[_0x8337('0x48')][_0x8337('0x57')]){_0x2c6d01[_0x8337('0x52')]=_['merge'](_0x2c6d01['where'],{'$or':_[_0x8337('0x55')](_0x2c6d01['attributes'],function(_0x3b962b){var _0x273fa7={};_0x273fa7[_0x3b962b]={'$like':'%'+_0x3808cc[_0x8337('0x48')][_0x8337('0x57')]+'%'};return _0x273fa7;})});}_0x2c6d01=_[_0x8337('0x54')]({},_0x2c6d01,_0x3808cc['options']);return db[_0x8337('0x95')][_0x8337('0x33')]({'where':_0x2c6d01[_0x8337('0x52')]})['then'](function(_0x20639f){_0x2f0667[_0x8337('0x33')]=_0x20639f;if(_0x3808cc['query'][_0x8337('0x5f')]){_0x2c6d01[_0x8337('0x59')]=[{'model':db['CmContact'],'as':_0x8337('0xb1'),'required':![]},{'model':db[_0x8337('0xa3')],'as':'Owner','attributes':[_0x8337('0x3d'),_0x8337('0xb2'),_0x8337('0xb3')],'required':![]},{'model':db['Tag'],'as':_0x8337('0xb4'),'attributes':['id',_0x8337('0x3d'),_0x8337('0xb5')],'where':_0x3808cc['query']['tag']?{'id':_0x3808cc['query']['tag']}:undefined,'required':_0x3808cc[_0x8337('0x48')][_0x8337('0xb6')]?!![]:![]}];}return db[_0x8337('0x95')][_0x8337('0x5a')](_0x2c6d01);})[_0x8337('0x23')](function(_0x20429e){_0x2f0667[_0x8337('0x5b')]=_0x20429e;return _0x2f0667;});}})['then'](respondWithFilteredResult(_0x7044b0,_0x2c6d01))['catch'](handleError(_0x7044b0,null));};exports[_0x8337('0xb7')]=function(_0x369d2f,_0x1693d2,_0x3d88cd){return db['OpenchannelAccount'][_0x8337('0x64')]({'where':{'id':_0x369d2f[_0x8337('0x5d')]['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x1693d2,null))[_0x8337('0x23')](function(_0xa402db){if(_0xa402db){return _0xa402db['addAgents'](_0x369d2f['body'][_0x8337('0x70')],_[_0x8337('0xb8')](_0x369d2f[_0x8337('0x61')],['ids','id'])||{})[_0x8337('0x98')](function(_0x4fc076){for(var _0x15feba=0x0;_0x15feba<_0x369d2f[_0x8337('0x61')]['ids'][_0x8337('0x4d')];_0x15feba+=0x1){socket[_0x8337('0xb9')]('userOpenchannelAccount:save',{'UserId':Number(_0x369d2f[_0x8337('0x61')]['ids'][_0x15feba]),'OpenchannelAccountId':Number(_0x369d2f[_0x8337('0x5d')]['id'])});}return _0x4fc076;});}})[_0x8337('0x23')](respondWithResult(_0x1693d2,null))[_0x8337('0x2d')](handleError(_0x1693d2,null));};exports[_0x8337('0xba')]=function(_0x24cf2a,_0x46771e,_0x5c4d36){return db[_0x8337('0x42')][_0x8337('0x64')]({'where':{'id':_0x24cf2a['params']['id']}})['then'](handleEntityNotFound(_0x46771e,null))[_0x8337('0x23')](function(_0x414842){if(_0x414842){return _0x414842[_0x8337('0xba')](_0x24cf2a[_0x8337('0x48')][_0x8337('0x70')])[_0x8337('0x23')](function(){if(_['isArray'](_0x24cf2a['query']['ids'])){for(var _0x342b7d=0x0;_0x342b7d<_0x24cf2a[_0x8337('0x48')]['ids'][_0x8337('0x4d')];_0x342b7d+=0x1){socket[_0x8337('0xb9')](_0x8337('0xbb'),{'UserId':Number(_0x24cf2a['query'][_0x8337('0x70')][_0x342b7d]),'OpenchannelAccountId':Number(_0x24cf2a[_0x8337('0x5d')]['id'])});}}else{socket[_0x8337('0xb9')](_0x8337('0xbb'),{'UserId':Number(_0x24cf2a[_0x8337('0x48')]['ids']),'OpenchannelAccountId':Number(_0x24cf2a['params']['id'])});}});}})[_0x8337('0x23')](respondWithStatusCode(_0x46771e,null))[_0x8337('0x2d')](handleError(_0x46771e,null));};exports[_0x8337('0xbc')]=function(_0x2fcef2,_0x3949ac,_0x25c523){var _0xd7800={};var _0x295a43={};var _0x2566a7;var _0x261c87;return db[_0x8337('0x42')][_0x8337('0x6d')]({'where':{'id':_0x2fcef2['params']['id']}})['then'](handleEntityNotFound(_0x3949ac,null))[_0x8337('0x23')](function(_0x297bf0){if(_0x297bf0){_0x2566a7=_0x297bf0;_0x295a43['model']=_[_0x8337('0x5e')](db[_0x8337('0xa3')][_0x8337('0x43')]);_0x295a43['query']=_['keys'](_0x2fcef2[_0x8337('0x48')]);_0x295a43['filters']=_[_0x8337('0x4a')](_0x295a43[_0x8337('0x47')],_0x295a43['query']);_0xd7800[_0x8337('0x4c')]=_[_0x8337('0x4a')](_0x295a43[_0x8337('0x47')],qs[_0x8337('0x4b')](_0x2fcef2[_0x8337('0x48')]['fields']));_0xd7800['attributes']=_0xd7800['attributes'][_0x8337('0x4d')]?_0xd7800[_0x8337('0x4c')]:_0x295a43[_0x8337('0x47')];_0xd7800['order']=qs[_0x8337('0x51')](_0x2fcef2[_0x8337('0x48')][_0x8337('0x51')]);_0xd7800[_0x8337('0x52')]=qs[_0x8337('0x49')](_[_0x8337('0x53')](_0x2fcef2[_0x8337('0x48')],_0x295a43[_0x8337('0x49')]));if(_0x2fcef2[_0x8337('0x48')][_0x8337('0x57')]){_0xd7800[_0x8337('0x52')]=_['merge'](_0xd7800[_0x8337('0x52')],{'$or':_[_0x8337('0x55')](_0xd7800[_0x8337('0x4c')],function(_0x444dd1){var _0x4edaa1={};_0x4edaa1[_0x444dd1]={'$like':'%'+_0x2fcef2[_0x8337('0x48')][_0x8337('0x57')]+'%'};return _0x4edaa1;})});}_0xd7800=_[_0x8337('0x54')]({},_0xd7800,_0x2fcef2[_0x8337('0x58')]);return _0x2566a7[_0x8337('0xbc')](_0xd7800);}})[_0x8337('0x23')](function(_0x5869e0){if(_0x5869e0){_0x261c87=_0x5869e0['length'];if(!_0x2fcef2[_0x8337('0x48')]['hasOwnProperty'](_0x8337('0x4f'))){_0xd7800[_0x8337('0x32')]=qs[_0x8337('0x32')](_0x2fcef2['query'][_0x8337('0x32')]);_0xd7800['offset']=qs[_0x8337('0x30')](_0x2fcef2[_0x8337('0x48')][_0x8337('0x30')]);}return _0x2566a7[_0x8337('0xbc')](_0xd7800);}})[_0x8337('0x23')](function(_0xd0600a){if(_0xd0600a){return _0xd0600a?{'count':_0x261c87,'rows':_0xd0600a}:null;}})[_0x8337('0x23')](respondWithResult(_0x3949ac,null))['catch'](handleError(_0x3949ac,null));};exports[_0x8337('0x3e')]=function(_0xd0dadd,_0x4be84d,_0x5bc836){var _0x1b8a87,_0xc757ce,_0x304d11;if(_[_0x8337('0x7e')](_0xd0dadd[_0x8337('0x61')][_0x8337('0x61')])||_0xd0dadd[_0x8337('0x61')][_0x8337('0x61')]===''){throw new db['Sequelize']['ValidationError'](_0x8337('0x82'));}if(_[_0x8337('0x7e')](_0xd0dadd[_0x8337('0x61')]['to'])){}_0x1b8a87=_0xd0dadd[_0x8337('0x61')]['to'];return db[_0x8337('0x42')][_0x8337('0x6d')]({'where':{'id':_0xd0dadd[_0x8337('0x5d')]['id']}})[_0x8337('0x23')](handleEntityNotFound(_0x4be84d,null))['then'](function(_0x570004){if(_0x570004){return db['OpenchannelAccount'][_0x8337('0x64')]({'where':{'id':_0x570004['id']},'include':[{'model':db[_0x8337('0x87')],'as':_0x8337('0x8c'),'include':[{'model':db[_0x8337('0x77')],'as':'Contacts','where':{[_0x570004['mapKey']]:_0x1b8a87},'limit':0x1,'order':[['updatedAt',_0x8337('0x89')]]}]}]})[_0x8337('0x23')](handleEntityNotFound(_0x4be84d,null))[_0x8337('0x23')](function(_0x5264f2){if(_0x5264f2&&_0x5264f2['List']){_0xc757ce=_0x5264f2['get']({'plain':!![]});if(_0xc757ce[_0x8337('0x8c')]&&_0xc757ce[_0x8337('0x8c')][_0x8337('0x88')]['length']){return _0xc757ce['List'][_0x8337('0x88')][0x0];}return db[_0x8337('0x77')]['create'](_[_0x8337('0x1b')](_0xd0dadd[_0x8337('0x61')],{'firstName':_0x1b8a87,[_0x5264f2[_0x8337('0x83')]]:_0x1b8a87,'phone':_0x1b8a87,'ListId':_0xc757ce['ListId']}));}})[_0x8337('0x23')](handleEntityNotFound(_0x4be84d,null))['then'](function(_0x19d03b){if(_0x19d03b){_0x304d11=_0x19d03b;return db[_0x8337('0x95')]['find']({'where':{'ContactId':_0x304d11['id'],'closed':![],'OpenchannelAccountId':_0xc757ce['id']}})[_0x8337('0x23')](function(_0xd2f82e){if(_0xd2f82e){return[_0xd2f82e,![]];}return db['OpenchannelInteraction'][_0x8337('0x60')]({'UserId':_0xd0dadd[_0x8337('0x62')]['id'],'ContactId':_0x304d11['id'],'OpenchannelAccountId':_0xc757ce['id'],'lastMsgDirection':_0x8337('0xbd'),'firstMsgDirection':_0x8337('0xbd'),'Messages':[_[_0x8337('0x54')](_0xd0dadd[_0x8337('0x61')],{'read':![],'body':_0xd0dadd[_0x8337('0x61')][_0x8337('0x61')],'OpenchannelAccountId':_0xc757ce['id'],'UserId':_0xd0dadd[_0x8337('0x62')]['id'],'ContactId':_0x304d11['id']})]},{'include':[{'model':db[_0x8337('0xa0')],'as':_0x8337('0xbe')}]})[_0x8337('0x23')](function(_0x3c5dba){return[_0x3c5dba,!![]];});});}})[_0x8337('0x98')](function(_0x1f297d,_0x25f7cc){if(_0x25f7cc){return _0x1f297d;}return db[_0x8337('0xa0')]['create'](_[_0x8337('0x54')](_0xd0dadd[_0x8337('0x61')],{'read':![],'body':_0xd0dadd[_0x8337('0x61')][_0x8337('0x61')],'OpenchannelAccountId':_0xc757ce['id'],'OpenchannelInteractionId':_0x1f297d['id'],'UserId':_0xd0dadd[_0x8337('0x62')]['id'],'ContactId':_0x304d11['id']}))[_0x8337('0x23')](function(_0x488b06){_0x1f297d['dataValues'][_0x8337('0xbe')]=[];_0x1f297d['dataValues'][_0x8337('0xbe')]['push'](_0x488b06[_0x8337('0xbf')]);return _0x1f297d;});});}})[_0x8337('0x23')](respondWithResult(_0x4be84d,null))[_0x8337('0x2d')](handleError(_0x4be84d,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index fe8be09..908f25f 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 _0x3c81=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x55c3d9,_0x3bf75c){var _0x19fd97=function(_0x2b0205){while(--_0x2b0205){_0x55c3d9['push'](_0x55c3d9['shift']());}};_0x19fd97(++_0x3bf75c);}(_0x3c81,0x102));var _0x13c8=function(_0x1b4a3c,_0x427ffb){_0x1b4a3c=_0x1b4a3c-0x0;var _0x7ce04=_0x3c81[_0x1b4a3c];return _0x7ce04;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var OpenchannelAccount=require(_0x13c8('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x13c8('0x2')](0x0);var events={'afterCreate':_0x13c8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c3ba4){return function(_0x548599,_0x101d4f,_0x3ec886){OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4+':'+_0x548599['id'],_0x548599);OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4,_0x548599);_0x3ec886(null);};}for(var e in events){if(events[_0x13c8('0x5')](e)){var event=events[e];OpenchannelAccount[_0x13c8('0x6')](e,emitEvent(event));}}module[_0x13c8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xf4eb=['hook','events','update','emit','hasOwnProperty'];(function(_0x1b5147,_0x328d3d){var _0x681b8c=function(_0x3041c6){while(--_0x3041c6){_0x1b5147['push'](_0x1b5147['shift']());}};_0x681b8c(++_0x328d3d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x7f407,_0x433539){_0x7f407=_0x7f407-0x0;var _0x2d82ca=_0xf4eb[_0x7f407];return _0x2d82ca;};'use strict';var EventEmitter=require(_0xbf4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf4e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4e7fa7){return function(_0x2e3070,_0x1c7606,_0x32d1d7){OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7+':'+_0x2e3070['id'],_0x2e3070);OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070);_0x32d1d7(null);};}for(var e in events){if(events[_0xbf4e('0x3')](e)){var event=events[e];OpenchannelAccount[_0xbf4e('0x4')](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 bd57824..4db67a8 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(_0x4677d1,_0xf2e220){var _0x29370a=function(_0x398fea){while(--_0x398fea){_0x4677d1['push'](_0x4677d1['shift']());}};_0x29370a(++_0xf2e220);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x495e49,_0x10d4c8){var _0x5815c1=function(_0x112774){while(--_0x112774){_0x495e49['push'](_0x495e49['shift']());}};_0x5815c1(++_0x10d4c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 77f0e04..dbaf116 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 _0xd139=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','register','request','then','request\x20sent'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0xd139,0x14e));var _0x9d13=function(_0x1dac40,_0x37c55c){_0x1dac40=_0x1dac40-0x0;var _0x400136=_0xd139[_0x1dac40];return _0x400136;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});config['redis']=_[_0x9d13('0xb')](config['redis'],{'host':_0x9d13('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x9d13('0xd')](socket);function respondWithRpcPromise(_0xba5caa,_0x41eef2,_0x51ac36){return new BPromise(function(_0x135232,_0x5aa0c8){return client[_0x9d13('0xe')](_0xba5caa,_0x51ac36)[_0x9d13('0xf')](function(_0x43a3cc){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x41eef2,_0x9d13('0x10'));logger[_0x9d13('0x11')](_0x9d13('0x12'),_0x41eef2,_0x9d13('0x10'),JSON[_0x9d13('0x13')](_0x43a3cc));if(_0x43a3cc['error']){if(_0x43a3cc['error'][_0x9d13('0x14')]===0x1f4){logger[_0x9d13('0x15')](_0x9d13('0x16'),_0x41eef2,_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);return _0x5aa0c8(_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);}logger['error'](_0x9d13('0x16'),_0x41eef2,_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);return _0x135232(_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);}else{logger[_0x9d13('0x18')](_0x9d13('0x16'),_0x41eef2,_0x9d13('0x10'));_0x135232(_0x43a3cc[_0x9d13('0x19')][_0x9d13('0x17')]);}})[_0x9d13('0x1a')](function(_0x38acaf){logger[_0x9d13('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x41eef2,_0x38acaf);_0x5aa0c8(_0x38acaf);});});} \ No newline at end of file +var _0x9d9b=['./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x6ec29c,_0x160f92){var _0xd0275b=function(_0x10800c){while(--_0x10800c){_0x6ec29c['push'](_0x6ec29c['shift']());}};_0xd0275b(++_0x160f92);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x5b2682,_0x24b4ce){_0x5b2682=_0x5b2682-0x0;var _0x30967f=_0x9d9b[_0x5b2682];return _0x30967f;};'use strict';var _=require('lodash');var util=require(_0xb9d9('0x0'));var moment=require(_0xb9d9('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9d9('0x3'))['db'];var utils=require(_0xb9d9('0x4'));var logger=require(_0xb9d9('0x5'))('rpc');var config=require(_0xb9d9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb9d9('0x7')][_0xb9d9('0x8')]({'port':0x232a});config['redis']=_[_0xb9d9('0x9')](config[_0xb9d9('0xa')],{'host':_0xb9d9('0xb'),'port':0x18eb});var socket=require(_0xb9d9('0xc'))(new Redis(config[_0xb9d9('0xa')]));require(_0xb9d9('0xd'))[_0xb9d9('0xe')](socket);function respondWithRpcPromise(_0x5a9c18,_0x5b591e,_0x5f14e7){return new BPromise(function(_0x4cde40,_0x45f507){return client[_0xb9d9('0xf')](_0x5a9c18,_0x5f14e7)[_0xb9d9('0x10')](function(_0x5e226e){logger[_0xb9d9('0x11')](_0xb9d9('0x12'),_0x5b591e,'request\x20sent');logger[_0xb9d9('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'),JSON[_0xb9d9('0x15')](_0x5e226e));if(_0x5e226e[_0xb9d9('0x16')]){if(_0x5e226e[_0xb9d9('0x16')][_0xb9d9('0x17')]===0x1f4){logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x45f507(_0x5e226e['error'][_0xb9d9('0x18')]);}logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x4cde40(_0x5e226e['error'][_0xb9d9('0x18')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'));_0x4cde40(_0x5e226e[_0xb9d9('0x19')][_0xb9d9('0x18')]);}})['catch'](function(_0x473b89){logger[_0xb9d9('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0x473b89);_0x45f507(_0x473b89);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 7353cef..ab143cf 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 _0xfa7c=['remove','update','emit','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x4e8401,_0x51b328){var _0x17269f=function(_0x35ac65){while(--_0x35ac65){_0x4e8401['push'](_0x4e8401['shift']());}};_0x17269f(++_0x51b328);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x4792d7,_0x1be61a){_0x4792d7=_0x4792d7-0x0;var _0x4c1c9f=_0xfa7c[_0x4792d7];return _0x4c1c9f;};'use strict';var OpenchannelAccountEvents=require(_0xcfa7('0x0'));var events=['save',_0xcfa7('0x1'),_0xcfa7('0x2')];function createListener(_0x252259,_0x1d6921){return function(_0x19beaf){_0x1d6921[_0xcfa7('0x3')](_0x252259,_0x19beaf);};}function removeListener(_0x45411c,_0x1f671b){return function(){OpenchannelAccountEvents['removeListener'](_0x45411c,_0x1f671b);};}exports[_0xcfa7('0x4')]=function(_0x3bf816){for(var _0x9d96a2=0x0,_0x1d5f85=events['length'];_0x9d96a2<_0x1d5f85;_0x9d96a2++){var _0x816590=events[_0x9d96a2];var _0x573432=createListener(_0xcfa7('0x5')+_0x816590,_0x3bf816);OpenchannelAccountEvents['on'](_0x816590,_0x573432);}}; \ No newline at end of file +var _0x885e=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit'];(function(_0x42e06a,_0x2f5fd1){var _0x3d3c90=function(_0xbd9403){while(--_0xbd9403){_0x42e06a['push'](_0x42e06a['shift']());}};_0x3d3c90(++_0x2f5fd1);}(_0x885e,0xe4));var _0xe885=function(_0x40b954,_0x59367b){_0x40b954=_0x40b954-0x0;var _0x4b6dd0=_0x885e[_0x40b954];return _0x4b6dd0;};'use strict';var OpenchannelAccountEvents=require(_0xe885('0x0'));var events=[_0xe885('0x1'),'remove',_0xe885('0x2')];function createListener(_0x1cd11a,_0x162982){return function(_0xfea0bc){_0x162982[_0xe885('0x3')](_0x1cd11a,_0xfea0bc);};}function removeListener(_0x4fcd9b,_0x499ab6){return function(){OpenchannelAccountEvents[_0xe885('0x4')](_0x4fcd9b,_0x499ab6);};}exports[_0xe885('0x5')]=function(_0x33286a){for(var _0x1a5fd6=0x0,_0x55d2b2=events[_0xe885('0x6')];_0x1a5fd6<_0x55d2b2;_0x1a5fd6++){var _0x597bdc=events[_0x1a5fd6];var _0x2e8fe0=createListener(_0xe885('0x7')+_0x597bdc,_0x33286a);OpenchannelAccountEvents['on'](_0x597bdc,_0x2e8fe0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index b6c8ae5..9563102 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 _0xecee=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x59056b,_0x4f5327){var _0x582465=function(_0x30233b){while(--_0x30233b){_0x59056b['push'](_0x59056b['shift']());}};_0x582465(++_0x4f5327);}(_0xecee,0x1f1));var _0xeece=function(_0x373e27,_0x1f1634){_0x373e27=_0x373e27-0x0;var _0x439431=_0xecee[_0x373e27];return _0x439431;};'use strict';var multer=require(_0xeece('0x0'));var util=require('util');var path=require(_0xeece('0x1'));var timeout=require(_0xeece('0x2'));var express=require(_0xeece('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeece('0x4'));var interaction=require(_0xeece('0x5'));var config=require(_0xeece('0x6'));var controller=require('./openchannelApplication.controller');router[_0xeece('0x7')]('/',auth[_0xeece('0x8')](),controller[_0xeece('0x9')]);router[_0xeece('0x7')](_0xeece('0xa'),auth[_0xeece('0x8')](),controller[_0xeece('0xb')]);router[_0xeece('0xc')]('/',auth[_0xeece('0x8')](),controller[_0xeece('0xd')]);router[_0xeece('0xe')](_0xeece('0xa'),auth[_0xeece('0x8')](),controller[_0xeece('0xf')]);router[_0xeece('0x10')](_0xeece('0xa'),auth[_0xeece('0x8')](),controller[_0xeece('0x11')]);module[_0xeece('0x12')]=router; \ No newline at end of file +var _0x8856=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','multer','util','path'];(function(_0xf6dd18,_0x4dbf7b){var _0x3ad2eb=function(_0x3ca093){while(--_0x3ca093){_0xf6dd18['push'](_0xf6dd18['shift']());}};_0x3ad2eb(++_0x4dbf7b);}(_0x8856,0x89));var _0x6885=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8856[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6885('0x0'));var util=require(_0x6885('0x1'));var path=require(_0x6885('0x2'));var timeout=require(_0x6885('0x3'));var express=require(_0x6885('0x4'));var router=express[_0x6885('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6885('0x6'));var interaction=require(_0x6885('0x7'));var config=require(_0x6885('0x8'));var controller=require(_0x6885('0x9'));router[_0x6885('0xa')]('/',auth[_0x6885('0xb')](),controller[_0x6885('0xc')]);router[_0x6885('0xa')]('/:id',auth[_0x6885('0xb')](),controller[_0x6885('0xd')]);router[_0x6885('0xe')]('/',auth['isAuthenticated'](),controller[_0x6885('0xf')]);router[_0x6885('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6885('0x11')](_0x6885('0x12'),auth['isAuthenticated'](),controller[_0x6885('0x13')]);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 7c3c3a8..34afc68 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 _0xc5e7=['INTEGER','STRING'];(function(_0x187cbd,_0x5ced7d){var _0x414e34=function(_0x137e72){while(--_0x137e72){_0x187cbd['push'](_0x187cbd['shift']());}};_0x414e34(++_0x5ced7d);}(_0xc5e7,0x1c0));var _0x7c5e=function(_0x379606,_0x203819){_0x379606=_0x379606-0x0;var _0x4f5f05=_0xc5e7[_0x379606];return _0x4f5f05;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x7c5e('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x7c5e('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7c5e('0x1')]},'interval':{'type':Sequelize[_0x7c5e('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1cd1=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x170cb3,_0x5b4003){var _0x223a44=function(_0x135e11){while(--_0x135e11){_0x170cb3['push'](_0x170cb3['shift']());}};_0x223a44(++_0x5b4003);}(_0x1cd1,0xa9));var _0x11cd=function(_0x5edfb6,_0x2279c4){_0x5edfb6=_0x5edfb6-0x0;var _0x3f909f=_0x1cd1[_0x5edfb6];return _0x3f909f;};'use strict';var Sequelize=require(_0x11cd('0x0'));module['exports']={'priority':{'type':Sequelize[_0x11cd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x11cd('0x2')],'allowNull':![],'defaultValue':_0x11cd('0x3')},'appdata':{'type':Sequelize[_0x11cd('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x11cd('0x2')],'defaultValue':_0x11cd('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 8b2adf8..2d304b0 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 _0x3c72=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x120a55,_0x4ad4b3){var _0x1b074c=function(_0x21ce44){while(--_0x21ce44){_0x120a55['push'](_0x120a55['shift']());}};_0x1b074c(++_0x4ad4b3);}(_0x3c72,0x1ab));var _0x23c7=function(_0x4ed90f,_0x1efc5f){_0x4ed90f=_0x4ed90f-0x0;var _0x232cbb=_0x3c72[_0x4ed90f];return _0x232cbb;};'use strict';var emlformat=require(_0x23c7('0x0'));var rimraf=require(_0x23c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23c7('0x2'));var rp=require(_0x23c7('0x3'));var moment=require('moment');var BPromise=require(_0x23c7('0x4'));var Mustache=require(_0x23c7('0x5'));var util=require(_0x23c7('0x6'));var path=require(_0x23c7('0x7'));var sox=require(_0x23c7('0x8'));var csv=require(_0x23c7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23c7('0xa'));var _=require(_0x23c7('0xb'));var squel=require(_0x23c7('0xc'));var crypto=require(_0x23c7('0xd'));var jsforce=require(_0x23c7('0xe'));var deskjs=require(_0x23c7('0xf'));var toCsv=require(_0x23c7('0x9'));var querystring=require(_0x23c7('0x10'));var Papa=require('papaparse');var Redis=require(_0x23c7('0x11'));var authService=require(_0x23c7('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23c7('0x13'));var logger=require('../../config/logger')(_0x23c7('0x14'));var utils=require(_0x23c7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x23c7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5443db,_0x2c68ac){_0x2c68ac=_0x2c68ac||0xcc;return function(_0x29035b){if(_0x29035b){return _0x5443db[_0x23c7('0x17')](_0x2c68ac);}return _0x5443db[_0x23c7('0x18')](_0x2c68ac)[_0x23c7('0x19')]();};}function respondWithResult(_0x298499,_0x4383fb){_0x4383fb=_0x4383fb||0xc8;return function(_0x3a164a){if(_0x3a164a){return _0x298499[_0x23c7('0x18')](_0x4383fb)['json'](_0x3a164a);}};}function respondWithFilteredResult(_0x1003a3,_0x482c5f){return function(_0x2cfd65){if(_0x2cfd65){var _0x4997ea=typeof _0x482c5f[_0x23c7('0x1a')]===_0x23c7('0x1b')&&typeof _0x482c5f[_0x23c7('0x1c')]===_0x23c7('0x1b');var _0x499e64=_0x2cfd65[_0x23c7('0x1d')];var _0x2a127a=_0x4997ea?0x0:_0x482c5f[_0x23c7('0x1a')];var _0x49c50a=_0x4997ea?_0x2cfd65['count']:_0x482c5f[_0x23c7('0x1a')]+_0x482c5f['limit'];var _0x2b4172;if(_0x49c50a>=_0x499e64){_0x49c50a=_0x499e64;_0x2b4172=0xc8;}else{_0x2b4172=0xce;}_0x1003a3[_0x23c7('0x18')](_0x2b4172);return _0x1003a3['set'](_0x23c7('0x1e'),_0x2a127a+'-'+_0x49c50a+'/'+_0x499e64)[_0x23c7('0x1f')](_0x2cfd65);}return null;};}function patchUpdates(_0x2a2276){return function(_0x216439){try{jsonpatch[_0x23c7('0x20')](_0x216439,_0x2a2276,!![]);}catch(_0x1d4a3a){return BPromise['reject'](_0x1d4a3a);}return _0x216439[_0x23c7('0x21')]();};}function saveUpdates(_0x299fea,_0x395fe7){return function(_0x14b871){if(_0x14b871){return _0x14b871['update'](_0x299fea)[_0x23c7('0x22')](function(_0x844168){return _0x844168;});}return null;};}function removeEntity(_0xb1a587,_0xa44a9a){return function(_0x2c5ddd){if(_0x2c5ddd){return _0x2c5ddd[_0x23c7('0x23')]()[_0x23c7('0x22')](function(){_0xb1a587[_0x23c7('0x18')](0xcc)[_0x23c7('0x19')]();});}};}function handleEntityNotFound(_0x466dea,_0x1bade6){return function(_0x4dbf32){if(!_0x4dbf32){_0x466dea[_0x23c7('0x17')](0x194);}return _0x4dbf32;};}function handleError(_0x5908e8,_0x5275c8){_0x5275c8=_0x5275c8||0x1f4;return function(_0x5325f0){logger[_0x23c7('0x24')](_0x5325f0[_0x23c7('0x25')]);if(_0x5325f0[_0x23c7('0x26')]){delete _0x5325f0['name'];}_0x5908e8[_0x23c7('0x18')](_0x5275c8)[_0x23c7('0x27')](_0x5325f0);};}exports[_0x23c7('0x28')]=function(_0x24fc38,_0x5d0554){var _0x25982b={},_0x4518b2={},_0x3be62c={'count':0x0,'rows':[]};var _0x38b674=_[_0x23c7('0x29')](db[_0x23c7('0x2a')][_0x23c7('0x2b')],function(_0x4a107f){return{'name':_0x4a107f[_0x23c7('0x2c')],'type':_0x4a107f[_0x23c7('0x2d')][_0x23c7('0x2e')]};});_0x4518b2[_0x23c7('0x2f')]=_[_0x23c7('0x29')](_0x38b674,'name');_0x4518b2['query']=_[_0x23c7('0x30')](_0x24fc38[_0x23c7('0x31')]);_0x4518b2[_0x23c7('0x32')]=_['intersection'](_0x4518b2[_0x23c7('0x2f')],_0x4518b2[_0x23c7('0x31')]);_0x25982b['attributes']=_['intersection'](_0x4518b2[_0x23c7('0x2f')],qs['fields'](_0x24fc38[_0x23c7('0x31')][_0x23c7('0x33')]));_0x25982b[_0x23c7('0x34')]=_0x25982b[_0x23c7('0x34')][_0x23c7('0x35')]?_0x25982b[_0x23c7('0x34')]:_0x4518b2[_0x23c7('0x2f')];if(!_0x24fc38['query'][_0x23c7('0x36')](_0x23c7('0x37'))){_0x25982b['limit']=qs[_0x23c7('0x1c')](_0x24fc38['query'][_0x23c7('0x1c')]);_0x25982b['offset']=qs['offset'](_0x24fc38[_0x23c7('0x31')][_0x23c7('0x1a')]);}_0x25982b[_0x23c7('0x38')]=qs['sort'](_0x24fc38[_0x23c7('0x31')][_0x23c7('0x39')]);_0x25982b[_0x23c7('0x3a')]=qs[_0x23c7('0x32')](_[_0x23c7('0x3b')](_0x24fc38['query'],_0x4518b2[_0x23c7('0x32')]),_0x38b674);if(_0x24fc38[_0x23c7('0x31')][_0x23c7('0x3c')]){_0x25982b['where']=_[_0x23c7('0x3d')](_0x25982b[_0x23c7('0x3a')],{'$or':_['map'](_0x38b674,function(_0x3c5273){if(_0x3c5273[_0x23c7('0x2d')]!==_0x23c7('0x3e')){var _0x5da745={};_0x5da745[_0x3c5273['name']]={'$like':'%'+_0x24fc38[_0x23c7('0x31')][_0x23c7('0x3c')]+'%'};return _0x5da745;}})});}_0x25982b=_[_0x23c7('0x3d')]({},_0x25982b,_0x24fc38[_0x23c7('0x3f')]);var _0x55afb9={'where':_0x25982b[_0x23c7('0x3a')]};return db[_0x23c7('0x2a')][_0x23c7('0x1d')](_0x55afb9)[_0x23c7('0x22')](function(_0xf96427){_0x3be62c[_0x23c7('0x1d')]=_0xf96427;if(_0x24fc38['query'][_0x23c7('0x40')]){_0x25982b[_0x23c7('0x41')]=[{'all':!![]}];}return db[_0x23c7('0x2a')][_0x23c7('0x42')](_0x25982b);})[_0x23c7('0x22')](function(_0x589d3e){_0x3be62c[_0x23c7('0x43')]=_0x589d3e;return _0x3be62c;})[_0x23c7('0x22')](respondWithFilteredResult(_0x5d0554,_0x25982b))[_0x23c7('0x44')](handleError(_0x5d0554,null));};exports[_0x23c7('0x45')]=function(_0x21f462,_0x366492){var _0x7b3137={'raw':!![],'where':{'id':_0x21f462[_0x23c7('0x46')]['id']}},_0xb00df2={};_0xb00df2[_0x23c7('0x2f')]=_[_0x23c7('0x30')](db[_0x23c7('0x2a')][_0x23c7('0x2b')]);_0xb00df2[_0x23c7('0x31')]=_[_0x23c7('0x30')](_0x21f462[_0x23c7('0x31')]);_0xb00df2[_0x23c7('0x32')]=_['intersection'](_0xb00df2[_0x23c7('0x2f')],_0xb00df2['query']);_0x7b3137['attributes']=_[_0x23c7('0x47')](_0xb00df2[_0x23c7('0x2f')],qs[_0x23c7('0x33')](_0x21f462[_0x23c7('0x31')][_0x23c7('0x33')]));_0x7b3137['attributes']=_0x7b3137[_0x23c7('0x34')][_0x23c7('0x35')]?_0x7b3137[_0x23c7('0x34')]:_0xb00df2[_0x23c7('0x2f')];if(_0x21f462[_0x23c7('0x31')][_0x23c7('0x40')]){_0x7b3137[_0x23c7('0x41')]=[{'all':!![]}];}_0x7b3137=_['merge']({},_0x7b3137,_0x21f462[_0x23c7('0x3f')]);return db[_0x23c7('0x2a')]['find'](_0x7b3137)[_0x23c7('0x22')](handleEntityNotFound(_0x366492,null))['then'](respondWithResult(_0x366492,null))[_0x23c7('0x44')](handleError(_0x366492,null));};exports['create']=function(_0x4a7066,_0x6a3b63){return db[_0x23c7('0x2a')][_0x23c7('0x48')](_0x4a7066['body'],{})['then'](respondWithResult(_0x6a3b63,0xc9))[_0x23c7('0x44')](handleError(_0x6a3b63,null));};exports[_0x23c7('0x49')]=function(_0x3ff2ec,_0x247d18){if(_0x3ff2ec['body']['id']){delete _0x3ff2ec['body']['id'];}return db[_0x23c7('0x2a')]['find']({'where':{'id':_0x3ff2ec[_0x23c7('0x46')]['id']}})[_0x23c7('0x22')](handleEntityNotFound(_0x247d18,null))[_0x23c7('0x22')](saveUpdates(_0x3ff2ec[_0x23c7('0x4a')],null))[_0x23c7('0x22')](respondWithResult(_0x247d18,null))[_0x23c7('0x44')](handleError(_0x247d18,null));};exports[_0x23c7('0x23')]=function(_0x24e373,_0xe25108){return db[_0x23c7('0x2a')]['find']({'where':{'id':_0x24e373[_0x23c7('0x46')]['id']}})['then'](handleEntityNotFound(_0xe25108,null))[_0x23c7('0x22')](removeEntity(_0xe25108,null))[_0x23c7('0x44')](handleError(_0xe25108,null));}; \ No newline at end of file +var _0x7b1f=['where','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelApplication','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order'];(function(_0x396fd1,_0x11aa4f){var _0x167c00=function(_0x5c9db9){while(--_0x5c9db9){_0x396fd1['push'](_0x396fd1['shift']());}};_0x167c00(++_0x11aa4f);}(_0x7b1f,0x1b9));var _0xf7b1=function(_0x2b7312,_0x599b03){_0x2b7312=_0x2b7312-0x0;var _0x2a72c9=_0x7b1f[_0x2b7312];return _0x2a72c9;};'use strict';var emlformat=require(_0xf7b1('0x0'));var rimraf=require(_0xf7b1('0x1'));var zipdir=require(_0xf7b1('0x2'));var jsonpatch=require(_0xf7b1('0x3'));var rp=require(_0xf7b1('0x4'));var moment=require('moment');var BPromise=require(_0xf7b1('0x5'));var Mustache=require(_0xf7b1('0x6'));var util=require('util');var path=require(_0xf7b1('0x7'));var sox=require(_0xf7b1('0x8'));var csv=require('to-csv');var ejs=require(_0xf7b1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7b1('0xa'));var squel=require('squel');var crypto=require(_0xf7b1('0xb'));var jsforce=require(_0xf7b1('0xc'));var deskjs=require(_0xf7b1('0xd'));var toCsv=require(_0xf7b1('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf7b1('0xf'));var authService=require(_0xf7b1('0x10'));var qs=require(_0xf7b1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7b1('0x12'));var logger=require('../../config/logger')(_0xf7b1('0x13'));var utils=require(_0xf7b1('0x14'));var config=require(_0xf7b1('0x15'));var licenseUtil=require(_0xf7b1('0x16'));var db=require(_0xf7b1('0x17'))['db'];function respondWithStatusCode(_0x28709e,_0x466187){_0x466187=_0x466187||0xcc;return function(_0x1e9508){if(_0x1e9508){return _0x28709e[_0xf7b1('0x18')](_0x466187);}return _0x28709e[_0xf7b1('0x19')](_0x466187)[_0xf7b1('0x1a')]();};}function respondWithResult(_0x8a43ee,_0x29f2e4){_0x29f2e4=_0x29f2e4||0xc8;return function(_0xe7d425){if(_0xe7d425){return _0x8a43ee['status'](_0x29f2e4)[_0xf7b1('0x1b')](_0xe7d425);}};}function respondWithFilteredResult(_0x59f66b,_0xe8a7bf){return function(_0x203aac){if(_0x203aac){var _0x5ed388=typeof _0xe8a7bf['offset']===_0xf7b1('0x1c')&&typeof _0xe8a7bf[_0xf7b1('0x1d')]===_0xf7b1('0x1c');var _0x5d190b=_0x203aac[_0xf7b1('0x1e')];var _0x1d12bd=_0x5ed388?0x0:_0xe8a7bf[_0xf7b1('0x1f')];var _0xf61e28=_0x5ed388?_0x203aac[_0xf7b1('0x1e')]:_0xe8a7bf[_0xf7b1('0x1f')]+_0xe8a7bf[_0xf7b1('0x1d')];var _0x78bd43;if(_0xf61e28>=_0x5d190b){_0xf61e28=_0x5d190b;_0x78bd43=0xc8;}else{_0x78bd43=0xce;}_0x59f66b[_0xf7b1('0x19')](_0x78bd43);return _0x59f66b[_0xf7b1('0x20')](_0xf7b1('0x21'),_0x1d12bd+'-'+_0xf61e28+'/'+_0x5d190b)['json'](_0x203aac);}return null;};}function patchUpdates(_0x10bed4){return function(_0x182eb3){try{jsonpatch['apply'](_0x182eb3,_0x10bed4,!![]);}catch(_0x90abf9){return BPromise[_0xf7b1('0x22')](_0x90abf9);}return _0x182eb3[_0xf7b1('0x23')]();};}function saveUpdates(_0x7af80d,_0x1afbf7){return function(_0x4cbd45){if(_0x4cbd45){return _0x4cbd45[_0xf7b1('0x24')](_0x7af80d)[_0xf7b1('0x25')](function(_0x29767e){return _0x29767e;});}return null;};}function removeEntity(_0x4eb9f8,_0x39094c){return function(_0x4bcfe0){if(_0x4bcfe0){return _0x4bcfe0[_0xf7b1('0x26')]()['then'](function(){_0x4eb9f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdee9c5,_0x5ed7ce){return function(_0x1fbc39){if(!_0x1fbc39){_0xdee9c5[_0xf7b1('0x18')](0x194);}return _0x1fbc39;};}function handleError(_0x3d3ea7,_0x25d69b){_0x25d69b=_0x25d69b||0x1f4;return function(_0x4b3510){logger['error'](_0x4b3510[_0xf7b1('0x27')]);if(_0x4b3510[_0xf7b1('0x28')]){delete _0x4b3510[_0xf7b1('0x28')];}_0x3d3ea7[_0xf7b1('0x19')](_0x25d69b)[_0xf7b1('0x29')](_0x4b3510);};}exports[_0xf7b1('0x2a')]=function(_0x24336b,_0x2b7cf6){var _0x235969={},_0x1aff5f={},_0x2c07da={'count':0x0,'rows':[]};var _0x2e43f7=_[_0xf7b1('0x2b')](db[_0xf7b1('0x2c')]['rawAttributes'],function(_0x2c1e3e){return{'name':_0x2c1e3e[_0xf7b1('0x2d')],'type':_0x2c1e3e['type'][_0xf7b1('0x2e')]};});_0x1aff5f[_0xf7b1('0x2f')]=_['map'](_0x2e43f7,_0xf7b1('0x28'));_0x1aff5f[_0xf7b1('0x30')]=_[_0xf7b1('0x31')](_0x24336b[_0xf7b1('0x30')]);_0x1aff5f[_0xf7b1('0x32')]=_[_0xf7b1('0x33')](_0x1aff5f['model'],_0x1aff5f['query']);_0x235969['attributes']=_[_0xf7b1('0x33')](_0x1aff5f[_0xf7b1('0x2f')],qs[_0xf7b1('0x34')](_0x24336b[_0xf7b1('0x30')][_0xf7b1('0x34')]));_0x235969[_0xf7b1('0x35')]=_0x235969[_0xf7b1('0x35')]['length']?_0x235969[_0xf7b1('0x35')]:_0x1aff5f[_0xf7b1('0x2f')];if(!_0x24336b[_0xf7b1('0x30')][_0xf7b1('0x36')]('nolimit')){_0x235969[_0xf7b1('0x1d')]=qs[_0xf7b1('0x1d')](_0x24336b['query'][_0xf7b1('0x1d')]);_0x235969[_0xf7b1('0x1f')]=qs['offset'](_0x24336b[_0xf7b1('0x30')]['offset']);}_0x235969[_0xf7b1('0x37')]=qs['sort'](_0x24336b[_0xf7b1('0x30')]['sort']);_0x235969[_0xf7b1('0x38')]=qs[_0xf7b1('0x32')](_['pick'](_0x24336b[_0xf7b1('0x30')],_0x1aff5f[_0xf7b1('0x32')]),_0x2e43f7);if(_0x24336b[_0xf7b1('0x30')][_0xf7b1('0x39')]){_0x235969[_0xf7b1('0x38')]=_[_0xf7b1('0x3a')](_0x235969[_0xf7b1('0x38')],{'$or':_[_0xf7b1('0x2b')](_0x2e43f7,function(_0x34760e){if(_0x34760e[_0xf7b1('0x3b')]!=='VIRTUAL'){var _0x29dd45={};_0x29dd45[_0x34760e['name']]={'$like':'%'+_0x24336b[_0xf7b1('0x30')][_0xf7b1('0x39')]+'%'};return _0x29dd45;}})});}_0x235969=_[_0xf7b1('0x3a')]({},_0x235969,_0x24336b[_0xf7b1('0x3c')]);var _0x292686={'where':_0x235969[_0xf7b1('0x38')]};return db[_0xf7b1('0x2c')][_0xf7b1('0x1e')](_0x292686)['then'](function(_0x2342f7){_0x2c07da[_0xf7b1('0x1e')]=_0x2342f7;if(_0x24336b[_0xf7b1('0x30')][_0xf7b1('0x3d')]){_0x235969[_0xf7b1('0x3e')]=[{'all':!![]}];}return db[_0xf7b1('0x2c')][_0xf7b1('0x3f')](_0x235969);})[_0xf7b1('0x25')](function(_0x69625f){_0x2c07da[_0xf7b1('0x40')]=_0x69625f;return _0x2c07da;})[_0xf7b1('0x25')](respondWithFilteredResult(_0x2b7cf6,_0x235969))[_0xf7b1('0x41')](handleError(_0x2b7cf6,null));};exports['show']=function(_0x207bfa,_0x3034bd){var _0x36bf9e={'raw':!![],'where':{'id':_0x207bfa[_0xf7b1('0x42')]['id']}},_0x14d3c4={};_0x14d3c4['model']=_[_0xf7b1('0x31')](db['OpenchannelApplication']['rawAttributes']);_0x14d3c4[_0xf7b1('0x30')]=_[_0xf7b1('0x31')](_0x207bfa['query']);_0x14d3c4[_0xf7b1('0x32')]=_['intersection'](_0x14d3c4['model'],_0x14d3c4[_0xf7b1('0x30')]);_0x36bf9e[_0xf7b1('0x35')]=_[_0xf7b1('0x33')](_0x14d3c4[_0xf7b1('0x2f')],qs['fields'](_0x207bfa['query']['fields']));_0x36bf9e[_0xf7b1('0x35')]=_0x36bf9e['attributes'][_0xf7b1('0x43')]?_0x36bf9e['attributes']:_0x14d3c4[_0xf7b1('0x2f')];if(_0x207bfa[_0xf7b1('0x30')][_0xf7b1('0x3d')]){_0x36bf9e[_0xf7b1('0x3e')]=[{'all':!![]}];}_0x36bf9e=_[_0xf7b1('0x3a')]({},_0x36bf9e,_0x207bfa[_0xf7b1('0x3c')]);return db[_0xf7b1('0x2c')][_0xf7b1('0x44')](_0x36bf9e)[_0xf7b1('0x25')](handleEntityNotFound(_0x3034bd,null))[_0xf7b1('0x25')](respondWithResult(_0x3034bd,null))['catch'](handleError(_0x3034bd,null));};exports['create']=function(_0x3ce25c,_0x17594e){return db[_0xf7b1('0x2c')][_0xf7b1('0x45')](_0x3ce25c[_0xf7b1('0x46')],{})[_0xf7b1('0x25')](respondWithResult(_0x17594e,0xc9))[_0xf7b1('0x41')](handleError(_0x17594e,null));};exports[_0xf7b1('0x24')]=function(_0x85a7f3,_0x3c966f){if(_0x85a7f3[_0xf7b1('0x46')]['id']){delete _0x85a7f3['body']['id'];}return db[_0xf7b1('0x2c')]['find']({'where':{'id':_0x85a7f3[_0xf7b1('0x42')]['id']}})[_0xf7b1('0x25')](handleEntityNotFound(_0x3c966f,null))['then'](saveUpdates(_0x85a7f3[_0xf7b1('0x46')],null))[_0xf7b1('0x25')](respondWithResult(_0x3c966f,null))[_0xf7b1('0x41')](handleError(_0x3c966f,null));};exports['destroy']=function(_0x4891c8,_0x50069f){return db[_0xf7b1('0x2c')][_0xf7b1('0x44')]({'where':{'id':_0x4891c8['params']['id']}})['then'](handleEntityNotFound(_0x50069f,null))[_0xf7b1('0x25')](removeEntity(_0x50069f,null))[_0xf7b1('0x41')](handleError(_0x50069f,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 5c5756d..aeabc63 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 _0x142b=['./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x489fe3,_0x5ebb81){var _0x592190=function(_0x1612a7){while(--_0x1612a7){_0x489fe3['push'](_0x489fe3['shift']());}};_0x592190(++_0x5ebb81);}(_0x142b,0xef));var _0xb142=function(_0x50ddfe,_0x14265d){_0x50ddfe=_0x50ddfe-0x0;var _0x1b1f89=_0x142b[_0x50ddfe];return _0x1b1f89;};'use strict';var _=require('lodash');var util=require(_0xb142('0x0'));var logger=require(_0xb142('0x1'))(_0xb142('0x2'));var moment=require(_0xb142('0x3'));var BPromise=require(_0xb142('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb142('0x5'));var rimraf=require(_0xb142('0x6'));var config=require(_0xb142('0x7'));var attributes=require(_0xb142('0x8'));module['exports']=function(_0x5e472e,_0x1370fa){return _0x5e472e['define'](_0xb142('0x9'),attributes,{'tableName':_0xb142('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb142('0xb'),'collate':_0xb142('0xc')});}; \ No newline at end of file +var _0x26a7=['../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x493e12,_0x572598){var _0x46cfd5=function(_0x1f74f4){while(--_0x1f74f4){_0x493e12['push'](_0x493e12['shift']());}};_0x46cfd5(++_0x572598);}(_0x26a7,0x16e));var _0x726a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x26a7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x726a('0x0'));var util=require(_0x726a('0x1'));var logger=require(_0x726a('0x2'))(_0x726a('0x3'));var moment=require(_0x726a('0x4'));var BPromise=require(_0x726a('0x5'));var rp=require(_0x726a('0x6'));var fs=require('fs');var path=require(_0x726a('0x7'));var rimraf=require(_0x726a('0x8'));var config=require(_0x726a('0x9'));var attributes=require(_0x726a('0xa'));module['exports']=function(_0x49c0f9,_0x5583a4){return _0x49c0f9[_0x726a('0xb')](_0x726a('0xc'),attributes,{'tableName':_0x726a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x726a('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fa0107c..658db51 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 _0x3897=['info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x24037a,_0x1ab4be){var _0x4784a4=function(_0x174444){while(--_0x174444){_0x24037a['push'](_0x24037a['shift']());}};_0x4784a4(++_0x1ab4be);}(_0x3897,0x112));var _0x7389=function(_0x2715cf,_0x517bb2){_0x2715cf=_0x2715cf-0x0;var _0x1bdcb8=_0x3897[_0x2715cf];return _0x1bdcb8;};'use strict';var _=require(_0x7389('0x0'));var util=require(_0x7389('0x1'));var moment=require(_0x7389('0x2'));var BPromise=require(_0x7389('0x3'));var rs=require(_0x7389('0x4'));var fs=require('fs');var Redis=require(_0x7389('0x5'));var db=require(_0x7389('0x6'))['db'];var utils=require(_0x7389('0x7'));var logger=require('../../config/logger')(_0x7389('0x8'));var config=require(_0x7389('0x9'));var jayson=require(_0x7389('0xa'));var client=jayson[_0x7389('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34705e,_0x5e645b,_0x511edd){return new BPromise(function(_0x16eb78,_0x5286e8){return client[_0x7389('0xc')](_0x34705e,_0x511edd)[_0x7389('0xd')](function(_0x5ad347){logger[_0x7389('0xe')](_0x7389('0xf'),_0x5e645b,_0x7389('0x10'));logger[_0x7389('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5e645b,'request\x20sent',JSON[_0x7389('0x12')](_0x5ad347));if(_0x5ad347[_0x7389('0x13')]){if(_0x5ad347[_0x7389('0x13')][_0x7389('0x14')]===0x1f4){logger[_0x7389('0x13')](_0x7389('0xf'),_0x5e645b,_0x5ad347['error'][_0x7389('0x15')]);return _0x5286e8(_0x5ad347['error']['message']);}logger[_0x7389('0x13')](_0x7389('0xf'),_0x5e645b,_0x5ad347['error']['message']);return _0x16eb78(_0x5ad347[_0x7389('0x13')][_0x7389('0x15')]);}else{logger[_0x7389('0xe')](_0x7389('0xf'),_0x5e645b,_0x7389('0x10'));_0x16eb78(_0x5ad347['result']['message']);}})[_0x7389('0x16')](function(_0x54918a){logger['error'](_0x7389('0xf'),_0x5e645b,_0x54918a);_0x5286e8(_0x54918a);});});}exports[_0x7389('0x17')]=function(_0x4fb33a){var _0x40bb0d=this;return new Promise(function(_0x1060aa,_0x2cd43a){return db[_0x7389('0x18')][_0x7389('0x19')](_0x4fb33a[_0x7389('0x1a')],{'raw':_0x4fb33a[_0x7389('0x1b')]?_0x4fb33a['options'][_0x7389('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fb33a['options']?_0x4fb33a[_0x7389('0x1b')][_0x7389('0x1d')]||null:null,'attributes':_0x4fb33a[_0x7389('0x1b')]?_0x4fb33a[_0x7389('0x1b')][_0x7389('0x1e')]||null:null,'limit':_0x4fb33a[_0x7389('0x1b')]?_0x4fb33a[_0x7389('0x1b')][_0x7389('0x1f')]||null:null})[_0x7389('0xd')](function(_0x2f9135){logger[_0x7389('0xe')](_0x7389('0x17'),_0x4fb33a);logger['debug']('UpdateOpenchannelApplication',_0x4fb33a,JSON[_0x7389('0x12')](_0x2f9135));_0x1060aa(_0x2f9135);})[_0x7389('0x16')](function(_0x5ef74c){logger[_0x7389('0x13')]('UpdateOpenchannelApplication',_0x5ef74c['message'],_0x4fb33a);_0x2cd43a(_0x40bb0d[_0x7389('0x13')](0x1f4,_0x5ef74c['message']));});});}; \ No newline at end of file +var _0x1e64=['request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','UpdateOpenchannelApplication','body','options','raw','where','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4186ae,_0x5548e5){var _0x31d4b0=function(_0xf394a9){while(--_0xf394a9){_0x4186ae['push'](_0x4186ae['shift']());}};_0x31d4b0(++_0x5548e5);}(_0x1e64,0x13f));var _0x41e6=function(_0x5aafc3,_0x53231a){_0x5aafc3=_0x5aafc3-0x0;var _0x306e29=_0x1e64[_0x5aafc3];return _0x306e29;};'use strict';var _=require(_0x41e6('0x0'));var util=require(_0x41e6('0x1'));var moment=require(_0x41e6('0x2'));var BPromise=require(_0x41e6('0x3'));var rs=require(_0x41e6('0x4'));var fs=require('fs');var Redis=require(_0x41e6('0x5'));var db=require(_0x41e6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x41e6('0x7'))('rpc');var config=require(_0x41e6('0x8'));var jayson=require(_0x41e6('0x9'));var client=jayson[_0x41e6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28450c,_0x208ab1,_0x327bd1){return new BPromise(function(_0x1ea341,_0x45126f){return client[_0x41e6('0xb')](_0x28450c,_0x327bd1)[_0x41e6('0xc')](function(_0x122981){logger['info'](_0x41e6('0xd'),_0x208ab1,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x208ab1,_0x41e6('0xe'),JSON['stringify'](_0x122981));if(_0x122981[_0x41e6('0xf')]){if(_0x122981[_0x41e6('0xf')][_0x41e6('0x10')]===0x1f4){logger[_0x41e6('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x208ab1,_0x122981['error'][_0x41e6('0x11')]);return _0x45126f(_0x122981[_0x41e6('0xf')][_0x41e6('0x11')]);}logger[_0x41e6('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x208ab1,_0x122981[_0x41e6('0xf')][_0x41e6('0x11')]);return _0x1ea341(_0x122981[_0x41e6('0xf')]['message']);}else{logger[_0x41e6('0x12')](_0x41e6('0xd'),_0x208ab1,_0x41e6('0xe'));_0x1ea341(_0x122981[_0x41e6('0x13')][_0x41e6('0x11')]);}})[_0x41e6('0x14')](function(_0x4fe7f4){logger[_0x41e6('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x208ab1,_0x4fe7f4);_0x45126f(_0x4fe7f4);});});}exports[_0x41e6('0x15')]=function(_0x3fefb5){var _0x31f64e=this;return new Promise(function(_0x5c82a4,_0x572705){return db['OpenchannelApplication']['update'](_0x3fefb5[_0x41e6('0x16')],{'raw':_0x3fefb5[_0x41e6('0x17')]?_0x3fefb5[_0x41e6('0x17')][_0x41e6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fefb5[_0x41e6('0x17')]?_0x3fefb5[_0x41e6('0x17')][_0x41e6('0x19')]||null:null,'attributes':_0x3fefb5[_0x41e6('0x17')]?_0x3fefb5[_0x41e6('0x17')][_0x41e6('0x1a')]||null:null,'limit':_0x3fefb5['options']?_0x3fefb5[_0x41e6('0x17')][_0x41e6('0x1b')]||null:null})[_0x41e6('0xc')](function(_0x3650d8){logger['info'](_0x41e6('0x15'),_0x3fefb5);logger[_0x41e6('0x1c')](_0x41e6('0x15'),_0x3fefb5,JSON[_0x41e6('0x1d')](_0x3650d8));_0x5c82a4(_0x3650d8);})['catch'](function(_0x19449e){logger[_0x41e6('0xf')](_0x41e6('0x15'),_0x19449e[_0x41e6('0x11')],_0x3fefb5);_0x572705(_0x31f64e['error'](0x1f4,_0x19449e[_0x41e6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 6f3c40f..4ae72cc 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 _0xe975=['addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages'];(function(_0x3de73d,_0x568980){var _0x2c17ab=function(_0x53595a){while(--_0x53595a){_0x3de73d['push'](_0x3de73d['shift']());}};_0x2c17ab(++_0x568980);}(_0xe975,0x1cd));var _0x5e97=function(_0x5c3c54,_0x143661){_0x5c3c54=_0x5c3c54-0x0;var _0x15b8ab=_0xe975[_0x5c3c54];return _0x15b8ab;};'use strict';var multer=require(_0x5e97('0x0'));var util=require('util');var path=require(_0x5e97('0x1'));var timeout=require(_0x5e97('0x2'));var express=require(_0x5e97('0x3'));var router=express[_0x5e97('0x4')]();var fs_extra=require(_0x5e97('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e97('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x5e97('0x7')]('/',auth[_0x5e97('0x8')](),controller[_0x5e97('0x9')]);router[_0x5e97('0x7')](_0x5e97('0xa'),auth[_0x5e97('0x8')](),controller[_0x5e97('0xb')]);router[_0x5e97('0x7')](_0x5e97('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x5e97('0x8')](),controller[_0x5e97('0xd')]);router[_0x5e97('0x7')](_0x5e97('0xe'),auth[_0x5e97('0x8')](),controller[_0x5e97('0xf')]);router[_0x5e97('0x10')]('/',auth[_0x5e97('0x8')](),controller[_0x5e97('0x11')]);router[_0x5e97('0x10')](_0x5e97('0x12'),auth[_0x5e97('0x8')](),controller[_0x5e97('0x13')]);router['post'](_0x5e97('0x14'),auth[_0x5e97('0x8')](),interaction[_0x5e97('0x15')](_0x5e97('0x16'),'openchannelinteraction:addtags'),controller[_0x5e97('0x17')]);router[_0x5e97('0x18')]('/:id',auth[_0x5e97('0x8')](),interaction[_0x5e97('0x15')](_0x5e97('0x16'),_0x5e97('0x19')),controller[_0x5e97('0x1a')]);router['delete'](_0x5e97('0xc'),auth[_0x5e97('0x8')](),interaction[_0x5e97('0x15')](_0x5e97('0x16'),_0x5e97('0x1b')),controller[_0x5e97('0x1c')]);router['delete'](_0x5e97('0x14'),auth[_0x5e97('0x8')](),controller[_0x5e97('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x726d=['multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','describe','/:id','show','/:id/messages','isAuthenticated','getMessages','download','create','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x726d,0xb4));var _0xd726=function(_0x2174d3,_0xd6d74d){_0x2174d3=_0x2174d3-0x0;var _0x1ae2d7=_0x726d[_0x2174d3];return _0x1ae2d7;};'use strict';var multer=require(_0xd726('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd726('0x1'));var express=require(_0xd726('0x2'));var router=express['Router']();var fs_extra=require(_0xd726('0x3'));var auth=require(_0xd726('0x4'));var interaction=require(_0xd726('0x5'));var config=require(_0xd726('0x6'));var controller=require(_0xd726('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd726('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd726('0x9')]);router[_0xd726('0x8')](_0xd726('0xa'),auth['isAuthenticated'](),controller[_0xd726('0xb')]);router[_0xd726('0x8')](_0xd726('0xc'),auth[_0xd726('0xd')](),controller[_0xd726('0xe')]);router[_0xd726('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xd726('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd726('0x10')]);router[_0xd726('0x11')](_0xd726('0xc'),auth[_0xd726('0xd')](),controller[_0xd726('0x12')]);router[_0xd726('0x11')](_0xd726('0x13'),auth[_0xd726('0xd')](),interaction[_0xd726('0x14')](_0xd726('0x15'),_0xd726('0x16')),controller[_0xd726('0x17')]);router[_0xd726('0x18')](_0xd726('0xa'),auth[_0xd726('0xd')](),interaction[_0xd726('0x14')]('openchannel',_0xd726('0x19')),controller[_0xd726('0x1a')]);router[_0xd726('0x1b')]('/:id',auth[_0xd726('0xd')](),interaction[_0xd726('0x14')](_0xd726('0x15'),_0xd726('0x1c')),controller['destroy']);router[_0xd726('0x1b')](_0xd726('0x13'),auth[_0xd726('0xd')](),controller['removeTags']);module[_0xd726('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 cfdb948..74bf46f 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 _0xe13e=['ENUM','out','BOOLEAN','DATE','STRING'];(function(_0x217b9b,_0x366b88){var _0x2fbc3b=function(_0x48fc51){while(--_0x48fc51){_0x217b9b['push'](_0x217b9b['shift']());}};_0x2fbc3b(++_0x366b88);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xee13('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xee13('0x1')]},'disposition':{'type':Sequelize[_0xee13('0x2')]},'secondDisposition':{'type':Sequelize[_0xee13('0x2')]},'thirdDisposition':{'type':Sequelize[_0xee13('0x2')]},'note':{'type':Sequelize[_0xee13('0x2')]},'read1stAt':{'type':Sequelize[_0xee13('0x1')]},'threadId':{'type':Sequelize[_0xee13('0x2')]},'externalUrl':{'type':Sequelize[_0xee13('0x2')]},'lastMsgAt':{'type':Sequelize[_0xee13('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xee13('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xee13('0x3')]('in',_0xee13('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xee13('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xee13('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0xd51f=['out','BOOLEAN','sequelize','exports','DATE','STRING','ENUM'];(function(_0x3aad61,_0x351442){var _0x37e8d5=function(_0x1cc7b0){while(--_0x1cc7b0){_0x3aad61['push'](_0x3aad61['shift']());}};_0x37e8d5(++_0x351442);}(_0xd51f,0xf0));var _0xfd51=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd51f[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xfd51('0x0'));module[_0xfd51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfd51('0x2')]},'disposition':{'type':Sequelize[_0xfd51('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfd51('0x3')]},'note':{'type':Sequelize[_0xfd51('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xfd51('0x3')]},'externalUrl':{'type':Sequelize[_0xfd51('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xfd51('0x4')]('in',_0xfd51('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfd51('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfd51('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xfd51('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0f50dda..946eef6 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 _0x1656=['emit','openchannelInteractionTags:save','removeTags','unix','toString','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','Public','Private','basename','existsSync','createReadStream','pipe','out','lastName','downloadInteraction.ejs','transcript-','.pdf','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','getOptions','findAll','query','user','show','from','params','model','keys','filters','intersection','attributes','fields','length','merge','options','OpenchannelInteraction','find','create','body','catch','describe','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','order','sort','where','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','omit','Tag','color'];(function(_0x97acee,_0x202957){var _0x16cc43=function(_0x22969b){while(--_0x22969b){_0x97acee['push'](_0x97acee['shift']());}};_0x16cc43(++_0x202957);}(_0x1656,0xa9));var _0x6165=function(_0x3779eb,_0xc19002){_0x3779eb=_0x3779eb-0x0;var _0x50423a=_0x1656[_0x3779eb];return _0x50423a;};'use strict';var rimraf=require(_0x6165('0x0'));var zipdir=require(_0x6165('0x1'));var moment=require('moment');var util=require(_0x6165('0x2'));var path=require(_0x6165('0x3'));var ejs=require(_0x6165('0x4'));var fs=require('fs');var _=require(_0x6165('0x5'));var Redis=require('ioredis');var interaction=require(_0x6165('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x6165('0x7'));var logger=require(_0x6165('0x8'))(_0x6165('0x9'));var config=require(_0x6165('0xa'));var db=require(_0x6165('0xb'))['db'];config[_0x6165('0xc')]=_[_0x6165('0xd')](config[_0x6165('0xc')],{'host':_0x6165('0xe'),'port':0x18eb});var socket=require(_0x6165('0xf'))(new Redis(config[_0x6165('0xc')]));require(_0x6165('0x10'))['register'](socket);function respondWithStatusCode(_0x50f481,_0x521476){_0x521476=_0x521476||0xcc;return function(_0x5a3c72){if(_0x5a3c72){return _0x50f481[_0x6165('0x11')](_0x521476);}return _0x50f481[_0x6165('0x12')](_0x521476)[_0x6165('0x13')]();};}function respondWithResult(_0x1c0893,_0xe8b18d){_0xe8b18d=_0xe8b18d||0xc8;return function(_0x241041){if(_0x241041){return _0x1c0893['status'](_0xe8b18d)[_0x6165('0x14')](_0x241041);}};}function respondWithFilteredResult(_0x52a322,_0x34f82b){return function(_0x2490dc){if(_0x2490dc){var _0x2078e7=typeof _0x34f82b[_0x6165('0x15')]===_0x6165('0x16')&&typeof _0x34f82b[_0x6165('0x17')]===_0x6165('0x16');var _0x2be69d=_0x2490dc[_0x6165('0x18')];var _0x458a00=_0x2078e7?0x0:_0x34f82b[_0x6165('0x15')];var _0x1bd7ca=_0x2078e7?_0x2490dc['count']:_0x34f82b[_0x6165('0x15')]+_0x34f82b['limit'];var _0x5065d3;if(_0x1bd7ca>=_0x2be69d){_0x1bd7ca=_0x2be69d;_0x5065d3=0xc8;}else{_0x5065d3=0xce;}_0x52a322[_0x6165('0x12')](_0x5065d3);return _0x52a322[_0x6165('0x19')](_0x6165('0x1a'),_0x458a00+'-'+_0x1bd7ca+'/'+_0x2be69d)[_0x6165('0x14')](_0x2490dc);}return null;};}function saveUpdates(_0x1d6430){return function(_0x7db6c6){if(_0x7db6c6){return _0x7db6c6[_0x6165('0x1b')](_0x1d6430)[_0x6165('0x1c')](function(_0x4ad931){return _0x4ad931;});}return null;};}function removeEntity(_0x3a34e6){return function(_0x563dc1){if(_0x563dc1){return _0x563dc1[_0x6165('0x1d')]()[_0x6165('0x1c')](function(){_0x3a34e6[_0x6165('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x260a93){return function(_0x2ecc4c){if(!_0x2ecc4c){_0x260a93['sendStatus'](0x194);}return _0x2ecc4c;};}function handleError(_0x2b3902,_0x350330){_0x350330=_0x350330||0x1f4;return function(_0x5da0f9){logger[_0x6165('0x1e')](_0x5da0f9[_0x6165('0x1f')]);if(_0x5da0f9[_0x6165('0x20')]){delete _0x5da0f9['name'];}_0x2b3902[_0x6165('0x12')](_0x350330)[_0x6165('0x21')](_0x5da0f9);};}exports[_0x6165('0x22')]=function(_0xe91f9e,_0x19a1c0){var _0x1c4a87={};var _0x3241a6=_['map'](db['OpenchannelInteraction'][_0x6165('0x23')],function(_0x2e2d91){return{'name':_0x2e2d91[_0x6165('0x24')],'type':_0x2e2d91[_0x6165('0x25')]['key']};});_0x1c4a87=qs[_0x6165('0x26')](_0x3241a6,_0xe91f9e);return interaction[_0x6165('0x27')]('openchannel',_0xe91f9e[_0x6165('0x28')],_0xe91f9e[_0x6165('0x29')],_0x1c4a87,_0x3241a6)[_0x6165('0x1c')](respondWithFilteredResult(_0x19a1c0,_0x1c4a87))['catch'](handleError(_0x19a1c0,null));};exports[_0x6165('0x2a')]=function(_0x3e9cd4,_0x3679b8){var _0x13428b={};if(_0x3e9cd4[_0x6165('0x28')][_0x6165('0x25')]&&_0x3e9cd4[_0x6165('0x28')][_0x6165('0x25')]===_0x6165('0x2b')){_0x13428b['from']=_0x3e9cd4[_0x6165('0x2c')]['id'];}else{_0x13428b['id']=_0x3e9cd4[_0x6165('0x2c')]['id'];}var _0x42f6d9={'raw':![],'where':_0x13428b},_0x1b0893={};_0x1b0893[_0x6165('0x2d')]=_[_0x6165('0x2e')](db['OpenchannelInteraction'][_0x6165('0x23')]);_0x1b0893[_0x6165('0x28')]=_[_0x6165('0x2e')](_0x3e9cd4[_0x6165('0x28')]);_0x1b0893[_0x6165('0x2f')]=_[_0x6165('0x30')](_0x1b0893['model'],_0x1b0893[_0x6165('0x28')]);_0x42f6d9[_0x6165('0x31')]=_[_0x6165('0x30')](_0x1b0893[_0x6165('0x2d')],qs[_0x6165('0x32')](_0x3e9cd4[_0x6165('0x28')]['fields']));_0x42f6d9[_0x6165('0x31')]=_0x42f6d9[_0x6165('0x31')][_0x6165('0x33')]?_0x42f6d9[_0x6165('0x31')]:_0x1b0893['model'];if(_0x3e9cd4[_0x6165('0x28')]['includeAll']){_0x42f6d9['include']=[{'all':!![]}];}_0x42f6d9=_[_0x6165('0x34')]({},_0x42f6d9,_0x3e9cd4[_0x6165('0x35')]);return db[_0x6165('0x36')][_0x6165('0x37')](_0x42f6d9)[_0x6165('0x1c')](handleEntityNotFound(_0x3679b8,null))[_0x6165('0x1c')](respondWithResult(_0x3679b8,null))['catch'](handleError(_0x3679b8,null));};exports[_0x6165('0x38')]=function(_0x1b3404,_0x111873){return db[_0x6165('0x36')][_0x6165('0x38')](_0x1b3404[_0x6165('0x39')],{})[_0x6165('0x1c')](respondWithResult(_0x111873,0xc9))[_0x6165('0x3a')](handleError(_0x111873,null));};exports[_0x6165('0x1b')]=function(_0x311d1d,_0x1049ef){if(_0x311d1d[_0x6165('0x39')]['id']){delete _0x311d1d['body']['id'];}return db[_0x6165('0x36')][_0x6165('0x37')]({'where':{'id':_0x311d1d[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1049ef,null))['then'](saveUpdates(_0x311d1d[_0x6165('0x39')],null))[_0x6165('0x1c')](respondWithResult(_0x1049ef,null))['catch'](handleError(_0x1049ef,null));};exports['destroy']=function(_0x228659,_0x35e954){return db['OpenchannelInteraction'][_0x6165('0x37')]({'where':{'id':_0x228659[_0x6165('0x2c')]['id']}})[_0x6165('0x1c')](handleEntityNotFound(_0x35e954,null))[_0x6165('0x1c')](removeEntity(_0x35e954,null))[_0x6165('0x3a')](handleError(_0x35e954,null));};exports[_0x6165('0x3b')]=function(_0x781b21,_0x1831e9){return db[_0x6165('0x36')]['describe']()[_0x6165('0x1c')](respondWithResult(_0x1831e9,null))['catch'](handleError(_0x1831e9,null));};exports['addMessage']=function(_0x52dac5,_0x3672d6){return db['OpenchannelMessage']['find']({'where':{'id':_0x52dac5[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3672d6,null))[_0x6165('0x1c')](function(_0x27d093){if(_0x27d093){return _0x27d093['addMessage'](_0x52dac5[_0x6165('0x39')][_0x6165('0x3c')],_['omit'](_0x52dac5['body'],[_0x6165('0x3c'),'id'])||{});}})[_0x6165('0x1c')](respondWithResult(_0x3672d6,null))[_0x6165('0x3a')](handleError(_0x3672d6,null));};exports[_0x6165('0x3d')]=function(_0x177f05,_0x288766){var _0x156450={'raw':![],'where':{}};var _0x5ade0a={};var _0x15ae09={'count':0x0,'rows':[]};return db[_0x6165('0x36')][_0x6165('0x3e')]({'where':{'id':_0x177f05[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x288766,null))[_0x6165('0x1c')](function(_0x10a0c8){if(_0x10a0c8){_0x5ade0a[_0x6165('0x2d')]=_['keys'](db[_0x6165('0x3f')][_0x6165('0x23')]);_0x5ade0a[_0x6165('0x28')]=_[_0x6165('0x2e')](_0x177f05[_0x6165('0x28')]);_0x5ade0a[_0x6165('0x2f')]=_['intersection'](_0x5ade0a[_0x6165('0x2d')],_0x5ade0a[_0x6165('0x28')]);_0x156450['attributes']=_[_0x6165('0x30')](_0x5ade0a[_0x6165('0x2d')],qs[_0x6165('0x32')](_0x177f05[_0x6165('0x28')]['fields']));_0x156450['attributes']=_0x156450[_0x6165('0x31')][_0x6165('0x33')]?_0x156450[_0x6165('0x31')]:_0x5ade0a[_0x6165('0x2d')];if(!_0x177f05[_0x6165('0x28')][_0x6165('0x40')]('nolimit')){_0x156450[_0x6165('0x17')]=qs[_0x6165('0x17')](_0x177f05['query'][_0x6165('0x17')]);_0x156450['offset']=qs[_0x6165('0x15')](_0x177f05[_0x6165('0x28')][_0x6165('0x15')]);}_0x156450[_0x6165('0x41')]=qs[_0x6165('0x42')](_0x177f05['query'][_0x6165('0x42')]);_0x156450[_0x6165('0x43')]=qs['filters'](_['pick'](_0x177f05['query'],_0x5ade0a[_0x6165('0x2f')]));_0x156450['where']['OpenchannelInteractionId']=_0x10a0c8['id'];if(_0x177f05[_0x6165('0x28')][_0x6165('0x44')]){_0x156450[_0x6165('0x43')]=_[_0x6165('0x34')](_0x156450[_0x6165('0x43')],{'$or':_[_0x6165('0x45')](_0x156450[_0x6165('0x31')],function(_0x154692){var _0xc8e962={};_0xc8e962[_0x154692]={'$like':'%'+_0x177f05[_0x6165('0x28')][_0x6165('0x44')]+'%'};return _0xc8e962;})});}if(_0x177f05[_0x6165('0x28')][_0x6165('0x46')]){var _0x24cc9b=_0x177f05[_0x6165('0x28')][_0x6165('0x46')]['split'](',');var _0x24539c={};_0x24539c[_0x24cc9b[0x0]]={'$gte':moment(_0x24cc9b[0x1])[_0x6165('0x47')](_0x6165('0x48'))};_0x156450['where']=_[_0x6165('0x34')](_0x156450[_0x6165('0x43')],_0x24539c);}_0x156450=_[_0x6165('0x34')]({},_0x156450,_0x177f05[_0x6165('0x35')]);return db[_0x6165('0x3f')][_0x6165('0x18')]({'where':_0x156450[_0x6165('0x43')]})[_0x6165('0x1c')](function(_0x4ce3d1){_0x15ae09[_0x6165('0x18')]=_0x4ce3d1;if(_0x177f05['query']['includeAll']){_0x156450[_0x6165('0x49')]=[{'all':!![]}];}return db[_0x6165('0x3f')][_0x6165('0x27')](_0x156450);})[_0x6165('0x1c')](function(_0x521360){_0x15ae09[_0x6165('0x4a')]=_0x521360;return _0x15ae09;});}})[_0x6165('0x1c')](respondWithFilteredResult(_0x288766,_0x156450))[_0x6165('0x3a')](handleError(_0x288766,null));};exports[_0x6165('0x4b')]=function(_0x26b1b6,_0x1a2366){return db['OpenchannelInteraction'][_0x6165('0x37')]({'where':{'id':_0x26b1b6[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1a2366,null))[_0x6165('0x1c')](function(_0x17b4cb){if(_0x17b4cb){return _0x17b4cb['setTags'](_0x26b1b6[_0x6165('0x39')][_0x6165('0x3c')],_[_0x6165('0x4c')](_0x26b1b6[_0x6165('0x39')],[_0x6165('0x3c'),'id'])||{})['spread'](function(){return db[_0x6165('0x4d')][_0x6165('0x27')]({'attributes':['id','name',_0x6165('0x4e')],'where':{'id':_0x26b1b6[_0x6165('0x39')]['ids']}});})[_0x6165('0x1c')](function(_0x46edb0){socket[_0x6165('0x4f')](_0x6165('0x50'),{'id':Number(_0x26b1b6['params']['id']),'tags':_0x46edb0||[]});return{'id':Number(_0x26b1b6[_0x6165('0x2c')]['id']),'tags':_0x46edb0||[]};});}})['then'](respondWithResult(_0x1a2366,null))[_0x6165('0x3a')](handleError(_0x1a2366,null));};exports[_0x6165('0x51')]=function(_0x467e96,_0x3eb85f){return db[_0x6165('0x36')][_0x6165('0x37')]({'where':{'id':_0x467e96[_0x6165('0x2c')]['id']}})[_0x6165('0x1c')](handleEntityNotFound(_0x3eb85f,null))['then'](function(_0x1d9953){if(_0x1d9953){return _0x1d9953['removeTags'](_0x467e96[_0x6165('0x28')][_0x6165('0x3c')]);}})[_0x6165('0x1c')](respondWithStatusCode(_0x3eb85f,null))[_0x6165('0x3a')](handleError(_0x3eb85f,null));};exports['download']=function(_0x7d21af,_0x120b73){var _0x59fc8c=moment()[_0x6165('0x52')]()[_0x6165('0x53')]();var _0xf27f3e=path['join'](config[_0x6165('0x54')],'server',_0x6165('0x55'),_0x6165('0x56'));var _0x485916=path[_0x6165('0x57')](config['root'],_0x6165('0x58'),_0x6165('0x55'),_0x6165('0x59'));var _0x51ec31=path[_0x6165('0x57')](_0xf27f3e,_0x59fc8c);var _0x3cd6f0=util[_0x6165('0x47')](_0x6165('0x5a'),_0x7d21af[_0x6165('0x2c')]['id'],_0x59fc8c);var _0x67cb87=path['join'](_0xf27f3e,_0x3cd6f0);var _0x5c0e35=[];_0x5c0e35[_0x6165('0x5b')]({'model':db[_0x6165('0x5c')],'as':_0x6165('0x5c'),'attributes':['id',_0x6165('0x5d')],'raw':!![]});_0x5c0e35[_0x6165('0x5b')]({'model':db[_0x6165('0x5e')],'as':_0x6165('0x5f'),'attributes':['id',_0x6165('0x60'),'lastName'],'raw':!![]});if(_0x7d21af[_0x6165('0x28')][_0x6165('0x59')]){_0x5c0e35[_0x6165('0x5b')]({'model':db[_0x6165('0x61')],'as':_0x6165('0x61'),'raw':!![]});}var _0x4beb64=[{'model':db[_0x6165('0x3f')],'as':_0x6165('0x62'),'attributes':['id',_0x6165('0x39'),_0x6165('0x63'),_0x6165('0x64'),_0x6165('0x65'),'read'],'include':_0x5c0e35}];_0x4beb64[_0x6165('0x5b')]({'model':db['OpenchannelAccount'],'as':_0x6165('0x66'),'attributes':['id',_0x6165('0x20')]});_0x4beb64[_0x6165('0x5b')]({'model':db[_0x6165('0x5c')],'as':_0x6165('0x67'),'attributes':['id',_0x6165('0x5d')]});return db[_0x6165('0x36')][_0x6165('0x37')]({'where':{'id':_0x7d21af[_0x6165('0x2c')]['id']},'include':_0x4beb64})['then'](handleEntityNotFound(_0x120b73,null))['then'](function(_0x57dfa0){if(_0x57dfa0){var _0x1d91b5=_0x57dfa0[_0x6165('0x68')]({'plain':!![]});fs[_0x6165('0x69')](_0x51ec31);var _0x42e20a={'channel':_0x6165('0x6a'),'account':_0x1d91b5['Account'][_0x6165('0x20')],'agent':_0x1d91b5[_0x6165('0x67')]?_0x1d91b5[_0x6165('0x67')][_0x6165('0x5d')]:_0x6165('0x6b'),'createdAt':moment(_0x1d91b5[_0x6165('0x63')])['format'](_0x6165('0x48'))[_0x6165('0x53')](),'closedAt':_0x1d91b5[_0x6165('0x6c')]?moment(_0x1d91b5[_0x6165('0x6d')])[_0x6165('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1d91b5['disposition'],'visibility':_0x1d91b5['threadId']?_0x6165('0x6e'):_0x6165('0x6f'),'messages':_(_0x1d91b5[_0x6165('0x62')])[_0x6165('0x44')]({'secret':![]})[_0x6165('0x45')](function(_0x5d337b){if(_0x5d337b[_0x6165('0x61')]){var _0x1e33ba=path['join'](_0x485916,_0x5d337b[_0x6165('0x61')][_0x6165('0x70')]);if(fs[_0x6165('0x71')](_0x1e33ba)){fs[_0x6165('0x72')](_0x1e33ba)[_0x6165('0x73')](fs['createWriteStream'](path['join'](_0x51ec31,_0x5d337b[_0x6165('0x61')]['basename'])));}}return{'date':moment(_0x5d337b[_0x6165('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6165('0x53')](),'sender':_0x5d337b['direction']===_0x6165('0x74')?_0x5d337b[_0x6165('0x5c')]?_0x5d337b['User'][_0x6165('0x5d')]:'System':_0x5d337b['Contact'][_0x6165('0x60')]+(_0x5d337b[_0x6165('0x5f')][_0x6165('0x75')]?'\x20'+_0x5d337b[_0x6165('0x5f')]['lastName']:''),'body':_0x5d337b[_0x6165('0x61')]?_0x5d337b[_0x6165('0x61')][_0x6165('0x70')]:_0x5d337b[_0x6165('0x39')],'direction':_0x5d337b[_0x6165('0x64')]===_0x6165('0x74')?'A':'C','secret':_0x5d337b['secret'],'read':_0x5d337b['read'],'attachment':_0x5d337b[_0x6165('0x61')]};})['value']()};return ejs['renderFile'](path[_0x6165('0x57')](config[_0x6165('0x54')],_0x6165('0x58'),'views',_0x6165('0x76')),{'interaction':_0x42e20a})[_0x6165('0x1c')](function(_0x57d9d9){var _0x44bf19=path['join'](_0x51ec31,_0x6165('0x77')+_0x1d91b5['id']+'-'+_0x59fc8c+_0x6165('0x78'));var _0x5d07aa={'path':_0x44bf19,'channel':_0x6165('0x6a'),'interactionId':_0x1d91b5['id']};return pdf['createPdfFromHTML'](_0x57d9d9,_0x5d07aa);})[_0x6165('0x1c')](function(){return new Promise(function(_0x2fcdd5,_0x500933){zipdir(_0x51ec31,{'saveTo':_0x67cb87},function(_0x5b44ca,_0x32c7c4){if(_0x5b44ca)return _0x500933(_0x5b44ca);return _0x2fcdd5(_0x32c7c4);});})[_0x6165('0x1c')](function(){return new Promise(function(_0x41556b,_0xbd01ef){rimraf(_0x51ec31,function(_0x1d015f){if(_0x1d015f)_0xbd01ef(_0x1d015f);return _0x41556b();});});})[_0x6165('0x1c')](function(){return _0x120b73[_0x6165('0x79')](_0x67cb87,_0x3cd6f0,function(_0x5399d4){if(_0x5399d4){logger[_0x6165('0x1e')](_0x6165('0x7a'),_0x5399d4);}else{fs[_0x6165('0x7b')](_0x67cb87);}});});});}else{return _0x120b73[_0x6165('0x11')](0xc8);}})[_0x6165('0x3a')](handleError(_0x120b73,null));}; \ No newline at end of file +var _0xda1b=['removeTags','unix','root','tmp','join','server','files','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','push','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','toString','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','System','out','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','getOptions','findAll','query','catch','type','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','OpenchannelInteraction','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','Tag','color','openchannelInteractionTags:save'];(function(_0x26d311,_0x3f7749){var _0x3894da=function(_0x11290d){while(--_0x11290d){_0x26d311['push'](_0x26d311['shift']());}};_0x3894da(++_0x3f7749);}(_0xda1b,0x137));var _0xbda1=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xda1b[_0x2e4e19];return _0x9ba20b;};'use strict';var rimraf=require(_0xbda1('0x0'));var zipdir=require(_0xbda1('0x1'));var moment=require(_0xbda1('0x2'));var util=require(_0xbda1('0x3'));var path=require('path');var ejs=require(_0xbda1('0x4'));var fs=require('fs');var _=require(_0xbda1('0x5'));var Redis=require(_0xbda1('0x6'));var interaction=require(_0xbda1('0x7'));var qs=require(_0xbda1('0x8'));var pdf=require(_0xbda1('0x9'));var logger=require(_0xbda1('0xa'))(_0xbda1('0xb'));var config=require(_0xbda1('0xc'));var db=require(_0xbda1('0xd'))['db'];config[_0xbda1('0xe')]=_[_0xbda1('0xf')](config[_0xbda1('0xe')],{'host':_0xbda1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbda1('0xe')]));require(_0xbda1('0x11'))[_0xbda1('0x12')](socket);function respondWithStatusCode(_0x33a12c,_0x55eca0){_0x55eca0=_0x55eca0||0xcc;return function(_0x4ea312){if(_0x4ea312){return _0x33a12c[_0xbda1('0x13')](_0x55eca0);}return _0x33a12c[_0xbda1('0x14')](_0x55eca0)[_0xbda1('0x15')]();};}function respondWithResult(_0x11f193,_0x5695c3){_0x5695c3=_0x5695c3||0xc8;return function(_0x11cbdc){if(_0x11cbdc){return _0x11f193[_0xbda1('0x14')](_0x5695c3)[_0xbda1('0x16')](_0x11cbdc);}};}function respondWithFilteredResult(_0x27df6d,_0x4083d1){return function(_0x3554cd){if(_0x3554cd){var _0x5322b9=typeof _0x4083d1[_0xbda1('0x17')]==='undefined'&&typeof _0x4083d1[_0xbda1('0x18')]===_0xbda1('0x19');var _0x3e038e=_0x3554cd[_0xbda1('0x1a')];var _0x2be4e1=_0x5322b9?0x0:_0x4083d1[_0xbda1('0x17')];var _0x22cc92=_0x5322b9?_0x3554cd[_0xbda1('0x1a')]:_0x4083d1[_0xbda1('0x17')]+_0x4083d1[_0xbda1('0x18')];var _0x107c56;if(_0x22cc92>=_0x3e038e){_0x22cc92=_0x3e038e;_0x107c56=0xc8;}else{_0x107c56=0xce;}_0x27df6d[_0xbda1('0x14')](_0x107c56);return _0x27df6d['set'](_0xbda1('0x1b'),_0x2be4e1+'-'+_0x22cc92+'/'+_0x3e038e)['json'](_0x3554cd);}return null;};}function saveUpdates(_0x5cdb22){return function(_0xd2db55){if(_0xd2db55){return _0xd2db55[_0xbda1('0x1c')](_0x5cdb22)[_0xbda1('0x1d')](function(_0x31d0ba){return _0x31d0ba;});}return null;};}function removeEntity(_0x3e5fee){return function(_0x59fadb){if(_0x59fadb){return _0x59fadb[_0xbda1('0x1e')]()['then'](function(){_0x3e5fee[_0xbda1('0x14')](0xcc)[_0xbda1('0x15')]();});}};}function handleEntityNotFound(_0x4d5c24){return function(_0x2cf0e5){if(!_0x2cf0e5){_0x4d5c24['sendStatus'](0x194);}return _0x2cf0e5;};}function handleError(_0x4dd942,_0x2ef0cb){_0x2ef0cb=_0x2ef0cb||0x1f4;return function(_0x4e8325){logger[_0xbda1('0x1f')](_0x4e8325[_0xbda1('0x20')]);if(_0x4e8325[_0xbda1('0x21')]){delete _0x4e8325[_0xbda1('0x21')];}_0x4dd942[_0xbda1('0x14')](_0x2ef0cb)[_0xbda1('0x22')](_0x4e8325);};}exports['index']=function(_0xb95d19,_0x5a80b5){var _0x4310c7={};var _0x5dcf3c=_['map'](db['OpenchannelInteraction'][_0xbda1('0x23')],function(_0x1e427c){return{'name':_0x1e427c[_0xbda1('0x24')],'type':_0x1e427c['type'][_0xbda1('0x25')]};});_0x4310c7=qs[_0xbda1('0x26')](_0x5dcf3c,_0xb95d19);return interaction[_0xbda1('0x27')]('openchannel',_0xb95d19[_0xbda1('0x28')],_0xb95d19['user'],_0x4310c7,_0x5dcf3c)[_0xbda1('0x1d')](respondWithFilteredResult(_0x5a80b5,_0x4310c7))[_0xbda1('0x29')](handleError(_0x5a80b5,null));};exports['show']=function(_0x27af70,_0x10d037){var _0x31b9b6={};if(_0x27af70[_0xbda1('0x28')][_0xbda1('0x2a')]&&_0x27af70[_0xbda1('0x28')]['type']==='from'){_0x31b9b6[_0xbda1('0x2b')]=_0x27af70[_0xbda1('0x2c')]['id'];}else{_0x31b9b6['id']=_0x27af70[_0xbda1('0x2c')]['id'];}var _0x5930c2={'raw':![],'where':_0x31b9b6},_0x13ee2f={};_0x13ee2f[_0xbda1('0x2d')]=_[_0xbda1('0x2e')](db['OpenchannelInteraction']['rawAttributes']);_0x13ee2f['query']=_[_0xbda1('0x2e')](_0x27af70[_0xbda1('0x28')]);_0x13ee2f[_0xbda1('0x2f')]=_[_0xbda1('0x30')](_0x13ee2f[_0xbda1('0x2d')],_0x13ee2f[_0xbda1('0x28')]);_0x5930c2[_0xbda1('0x31')]=_[_0xbda1('0x30')](_0x13ee2f[_0xbda1('0x2d')],qs[_0xbda1('0x32')](_0x27af70[_0xbda1('0x28')][_0xbda1('0x32')]));_0x5930c2[_0xbda1('0x31')]=_0x5930c2[_0xbda1('0x31')][_0xbda1('0x33')]?_0x5930c2[_0xbda1('0x31')]:_0x13ee2f['model'];if(_0x27af70['query'][_0xbda1('0x34')]){_0x5930c2[_0xbda1('0x35')]=[{'all':!![]}];}_0x5930c2=_[_0xbda1('0x36')]({},_0x5930c2,_0x27af70['options']);return db[_0xbda1('0x37')][_0xbda1('0x38')](_0x5930c2)['then'](handleEntityNotFound(_0x10d037,null))['then'](respondWithResult(_0x10d037,null))[_0xbda1('0x29')](handleError(_0x10d037,null));};exports[_0xbda1('0x39')]=function(_0x288cfb,_0x44b4c2){return db[_0xbda1('0x37')][_0xbda1('0x39')](_0x288cfb['body'],{})['then'](respondWithResult(_0x44b4c2,0xc9))[_0xbda1('0x29')](handleError(_0x44b4c2,null));};exports[_0xbda1('0x1c')]=function(_0x10470e,_0x39add5){if(_0x10470e[_0xbda1('0x3a')]['id']){delete _0x10470e[_0xbda1('0x3a')]['id'];}return db[_0xbda1('0x37')][_0xbda1('0x38')]({'where':{'id':_0x10470e['params']['id']}})[_0xbda1('0x1d')](handleEntityNotFound(_0x39add5,null))['then'](saveUpdates(_0x10470e[_0xbda1('0x3a')],null))[_0xbda1('0x1d')](respondWithResult(_0x39add5,null))['catch'](handleError(_0x39add5,null));};exports[_0xbda1('0x1e')]=function(_0x450050,_0x2d8c13){return db['OpenchannelInteraction']['find']({'where':{'id':_0x450050[_0xbda1('0x2c')]['id']}})[_0xbda1('0x1d')](handleEntityNotFound(_0x2d8c13,null))[_0xbda1('0x1d')](removeEntity(_0x2d8c13,null))[_0xbda1('0x29')](handleError(_0x2d8c13,null));};exports[_0xbda1('0x3b')]=function(_0x1c1bdd,_0x13fae2){return db['OpenchannelInteraction'][_0xbda1('0x3b')]()[_0xbda1('0x1d')](respondWithResult(_0x13fae2,null))[_0xbda1('0x29')](handleError(_0x13fae2,null));};exports[_0xbda1('0x3c')]=function(_0xba1b8,_0x3105c6){return db[_0xbda1('0x3d')][_0xbda1('0x38')]({'where':{'id':_0xba1b8['params']['id']}})[_0xbda1('0x1d')](handleEntityNotFound(_0x3105c6,null))[_0xbda1('0x1d')](function(_0x41bf86){if(_0x41bf86){return _0x41bf86[_0xbda1('0x3c')](_0xba1b8['body'][_0xbda1('0x3e')],_[_0xbda1('0x3f')](_0xba1b8['body'],['ids','id'])||{});}})[_0xbda1('0x1d')](respondWithResult(_0x3105c6,null))['catch'](handleError(_0x3105c6,null));};exports[_0xbda1('0x40')]=function(_0x151a4d,_0xeac3f3){var _0x13c29f={'raw':![],'where':{}};var _0x54ca34={};var _0x3e6dba={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xbda1('0x41')]({'where':{'id':_0x151a4d[_0xbda1('0x2c')]['id']}})[_0xbda1('0x1d')](handleEntityNotFound(_0xeac3f3,null))[_0xbda1('0x1d')](function(_0x482115){if(_0x482115){_0x54ca34[_0xbda1('0x2d')]=_[_0xbda1('0x2e')](db[_0xbda1('0x3d')][_0xbda1('0x23')]);_0x54ca34['query']=_['keys'](_0x151a4d[_0xbda1('0x28')]);_0x54ca34[_0xbda1('0x2f')]=_['intersection'](_0x54ca34[_0xbda1('0x2d')],_0x54ca34['query']);_0x13c29f[_0xbda1('0x31')]=_[_0xbda1('0x30')](_0x54ca34[_0xbda1('0x2d')],qs[_0xbda1('0x32')](_0x151a4d[_0xbda1('0x28')][_0xbda1('0x32')]));_0x13c29f['attributes']=_0x13c29f[_0xbda1('0x31')][_0xbda1('0x33')]?_0x13c29f[_0xbda1('0x31')]:_0x54ca34[_0xbda1('0x2d')];if(!_0x151a4d[_0xbda1('0x28')][_0xbda1('0x42')](_0xbda1('0x43'))){_0x13c29f[_0xbda1('0x18')]=qs['limit'](_0x151a4d[_0xbda1('0x28')][_0xbda1('0x18')]);_0x13c29f[_0xbda1('0x17')]=qs[_0xbda1('0x17')](_0x151a4d[_0xbda1('0x28')][_0xbda1('0x17')]);}_0x13c29f[_0xbda1('0x44')]=qs[_0xbda1('0x45')](_0x151a4d[_0xbda1('0x28')][_0xbda1('0x45')]);_0x13c29f[_0xbda1('0x46')]=qs[_0xbda1('0x2f')](_['pick'](_0x151a4d[_0xbda1('0x28')],_0x54ca34[_0xbda1('0x2f')]));_0x13c29f[_0xbda1('0x46')][_0xbda1('0x47')]=_0x482115['id'];if(_0x151a4d[_0xbda1('0x28')][_0xbda1('0x48')]){_0x13c29f[_0xbda1('0x46')]=_['merge'](_0x13c29f[_0xbda1('0x46')],{'$or':_['map'](_0x13c29f[_0xbda1('0x31')],function(_0x582f74){var _0x1f468f={};_0x1f468f[_0x582f74]={'$like':'%'+_0x151a4d[_0xbda1('0x28')][_0xbda1('0x48')]+'%'};return _0x1f468f;})});}if(_0x151a4d['query'][_0xbda1('0x49')]){var _0x838ff8=_0x151a4d[_0xbda1('0x28')][_0xbda1('0x49')][_0xbda1('0x4a')](',');var _0x662e23={};_0x662e23[_0x838ff8[0x0]]={'$gte':moment(_0x838ff8[0x1])[_0xbda1('0x4b')](_0xbda1('0x4c'))};_0x13c29f[_0xbda1('0x46')]=_[_0xbda1('0x36')](_0x13c29f[_0xbda1('0x46')],_0x662e23);}_0x13c29f=_['merge']({},_0x13c29f,_0x151a4d[_0xbda1('0x4d')]);return db[_0xbda1('0x3d')][_0xbda1('0x1a')]({'where':_0x13c29f['where']})['then'](function(_0x4acb0d){_0x3e6dba[_0xbda1('0x1a')]=_0x4acb0d;if(_0x151a4d['query'][_0xbda1('0x34')]){_0x13c29f[_0xbda1('0x35')]=[{'all':!![]}];}return db[_0xbda1('0x3d')][_0xbda1('0x27')](_0x13c29f);})[_0xbda1('0x1d')](function(_0x48eef3){_0x3e6dba[_0xbda1('0x4e')]=_0x48eef3;return _0x3e6dba;});}})[_0xbda1('0x1d')](respondWithFilteredResult(_0xeac3f3,_0x13c29f))[_0xbda1('0x29')](handleError(_0xeac3f3,null));};exports[_0xbda1('0x4f')]=function(_0x26b69b,_0x991767){return db[_0xbda1('0x37')][_0xbda1('0x38')]({'where':{'id':_0x26b69b['params']['id']}})['then'](handleEntityNotFound(_0x991767,null))['then'](function(_0x477199){if(_0x477199){return _0x477199[_0xbda1('0x50')](_0x26b69b[_0xbda1('0x3a')][_0xbda1('0x3e')],_[_0xbda1('0x3f')](_0x26b69b['body'],[_0xbda1('0x3e'),'id'])||{})[_0xbda1('0x51')](function(){return db[_0xbda1('0x52')][_0xbda1('0x27')]({'attributes':['id',_0xbda1('0x21'),_0xbda1('0x53')],'where':{'id':_0x26b69b['body']['ids']}});})[_0xbda1('0x1d')](function(_0x1f6cbe){socket['emit'](_0xbda1('0x54'),{'id':Number(_0x26b69b[_0xbda1('0x2c')]['id']),'tags':_0x1f6cbe||[]});return{'id':Number(_0x26b69b[_0xbda1('0x2c')]['id']),'tags':_0x1f6cbe||[]};});}})[_0xbda1('0x1d')](respondWithResult(_0x991767,null))['catch'](handleError(_0x991767,null));};exports[_0xbda1('0x55')]=function(_0x31ff51,_0x211083){return db[_0xbda1('0x37')]['find']({'where':{'id':_0x31ff51['params']['id']}})[_0xbda1('0x1d')](handleEntityNotFound(_0x211083,null))[_0xbda1('0x1d')](function(_0x416aba){if(_0x416aba){return _0x416aba[_0xbda1('0x55')](_0x31ff51[_0xbda1('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x211083,null))[_0xbda1('0x29')](handleError(_0x211083,null));};exports['download']=function(_0x1a0f71,_0x6ef9b2){var _0x4d8fb4=moment()[_0xbda1('0x56')]()['toString']();var _0x1b6f31=path['join'](config[_0xbda1('0x57')],'server','files',_0xbda1('0x58'));var _0x359458=path[_0xbda1('0x59')](config[_0xbda1('0x57')],_0xbda1('0x5a'),_0xbda1('0x5b'),_0xbda1('0x5c'));var _0x403287=path[_0xbda1('0x59')](_0x1b6f31,_0x4d8fb4);var _0xd93b61=util[_0xbda1('0x4b')](_0xbda1('0x5d'),_0x1a0f71[_0xbda1('0x2c')]['id'],_0x4d8fb4);var _0x487083=path[_0xbda1('0x59')](_0x1b6f31,_0xd93b61);var _0x539f71=[];_0x539f71['push']({'model':db[_0xbda1('0x5e')],'as':'User','attributes':['id',_0xbda1('0x5f')],'raw':!![]});_0x539f71['push']({'model':db['CmContact'],'as':_0xbda1('0x60'),'attributes':['id',_0xbda1('0x61'),_0xbda1('0x62')],'raw':!![]});if(_0x1a0f71[_0xbda1('0x28')][_0xbda1('0x5c')]){_0x539f71[_0xbda1('0x63')]({'model':db[_0xbda1('0x64')],'as':_0xbda1('0x64'),'raw':!![]});}var _0x571a19=[{'model':db['OpenchannelMessage'],'as':_0xbda1('0x65'),'attributes':['id',_0xbda1('0x3a'),_0xbda1('0x66'),_0xbda1('0x67'),'secret',_0xbda1('0x68')],'include':_0x539f71}];_0x571a19['push']({'model':db[_0xbda1('0x69')],'as':'Account','attributes':['id',_0xbda1('0x21')]});_0x571a19['push']({'model':db[_0xbda1('0x5e')],'as':_0xbda1('0x6a'),'attributes':['id','fullname']});return db[_0xbda1('0x37')][_0xbda1('0x38')]({'where':{'id':_0x1a0f71[_0xbda1('0x2c')]['id']},'include':_0x571a19})[_0xbda1('0x1d')](handleEntityNotFound(_0x6ef9b2,null))['then'](function(_0xe5c235){if(_0xe5c235){var _0x17f3c7=_0xe5c235['get']({'plain':!![]});fs[_0xbda1('0x6b')](_0x403287);var _0x274d91={'channel':_0xbda1('0x6c'),'account':_0x17f3c7[_0xbda1('0x6d')][_0xbda1('0x21')],'agent':_0x17f3c7[_0xbda1('0x6a')]?_0x17f3c7[_0xbda1('0x6a')][_0xbda1('0x5f')]:_0xbda1('0x6e'),'createdAt':moment(_0x17f3c7[_0xbda1('0x66')])['format'](_0xbda1('0x4c'))[_0xbda1('0x6f')](),'closedAt':_0x17f3c7[_0xbda1('0x70')]?moment(_0x17f3c7[_0xbda1('0x71')])[_0xbda1('0x4b')](_0xbda1('0x4c'))[_0xbda1('0x6f')]():'','disposition':_0x17f3c7[_0xbda1('0x72')],'visibility':_0x17f3c7[_0xbda1('0x73')]?'Public':_0xbda1('0x74'),'messages':_(_0x17f3c7[_0xbda1('0x65')])[_0xbda1('0x48')]({'secret':![]})['map'](function(_0x321456){if(_0x321456[_0xbda1('0x64')]){var _0x2a59c5=path[_0xbda1('0x59')](_0x359458,_0x321456['Attachment'][_0xbda1('0x75')]);if(fs[_0xbda1('0x76')](_0x2a59c5)){fs[_0xbda1('0x77')](_0x2a59c5)[_0xbda1('0x78')](fs['createWriteStream'](path['join'](_0x403287,_0x321456[_0xbda1('0x64')][_0xbda1('0x75')])));}}return{'date':moment(_0x321456['createdAt'])['format'](_0xbda1('0x4c'))[_0xbda1('0x6f')](),'sender':_0x321456['direction']==='out'?_0x321456[_0xbda1('0x5e')]?_0x321456[_0xbda1('0x5e')][_0xbda1('0x5f')]:_0xbda1('0x79'):_0x321456['Contact'][_0xbda1('0x61')]+(_0x321456[_0xbda1('0x60')][_0xbda1('0x62')]?'\x20'+_0x321456[_0xbda1('0x60')][_0xbda1('0x62')]:''),'body':_0x321456[_0xbda1('0x64')]?_0x321456[_0xbda1('0x64')]['basename']:_0x321456[_0xbda1('0x3a')],'direction':_0x321456[_0xbda1('0x67')]===_0xbda1('0x7a')?'A':'C','secret':_0x321456[_0xbda1('0x7b')],'read':_0x321456['read'],'attachment':_0x321456['Attachment']};})[_0xbda1('0x7c')]()};return ejs[_0xbda1('0x7d')](path['join'](config[_0xbda1('0x57')],_0xbda1('0x5a'),_0xbda1('0x7e'),_0xbda1('0x7f')),{'interaction':_0x274d91})['then'](function(_0x282d62){var _0x45778a=path['join'](_0x403287,_0xbda1('0x80')+_0x17f3c7['id']+'-'+_0x4d8fb4+_0xbda1('0x81'));var _0xc835b={'path':_0x45778a,'channel':_0xbda1('0x6c'),'interactionId':_0x17f3c7['id']};return pdf[_0xbda1('0x82')](_0x282d62,_0xc835b);})[_0xbda1('0x1d')](function(){return new Promise(function(_0x1b11ef,_0x401a16){zipdir(_0x403287,{'saveTo':_0x487083},function(_0x3a54f5,_0x28db0f){if(_0x3a54f5)return _0x401a16(_0x3a54f5);return _0x1b11ef(_0x28db0f);});})[_0xbda1('0x1d')](function(){return new Promise(function(_0x40b1d9,_0x23b6dc){rimraf(_0x403287,function(_0xc378a3){if(_0xc378a3)_0x23b6dc(_0xc378a3);return _0x40b1d9();});});})['then'](function(){return _0x6ef9b2['download'](_0x487083,_0xd93b61,function(_0x19bb6f){if(_0x19bb6f){logger[_0xbda1('0x1f')]('Unable\x20to\x20delete\x20zip\x20file',_0x19bb6f);}else{fs[_0xbda1('0x83')](_0x487083);}});});});}else{return _0x6ef9b2[_0xbda1('0x13')](0xc8);}})[_0xbda1('0x29')](handleError(_0x6ef9b2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 9906930..e034202 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 _0xf902=['getUsers','setDataValue','map','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x3b415c,_0x1dd4e0){var _0x212656=function(_0xfc8aa8){while(--_0xfc8aa8){_0x3b415c['push'](_0x3b415c['shift']());}};_0x212656(++_0x1dd4e0);}(_0xf902,0x71));var _0x2f90=function(_0x28920b,_0x3e6595){_0x28920b=_0x28920b-0x0;var _0x12fa39=_0xf902[_0x28920b];return _0x12fa39;};'use strict';var EventEmitter=require(_0x2f90('0x0'));var OpenchannelInteraction=require(_0x2f90('0x1'))['db'][_0x2f90('0x2')];var OpenchannelMessage=require(_0x2f90('0x1'))['db'][_0x2f90('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2f90('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2f90('0x5'),'afterDestroy':_0x2f90('0x6')};function emitEvent(_0x3909f8){return function(_0x210161,_0x49cc21,_0x37f6fc){_0x210161[_0x2f90('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x361ada){_0x210161[_0x2f90('0x8')]('Users',_0x361ada[_0x2f90('0x9')](function(_0x97096a){return{'id':_0x97096a['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x210161['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x42dddc){_0x210161[_0x2f90('0x8')]('unreadMessages',_0x42dddc[_0x2f90('0xa')]);OpenchannelInteractionEvents['emit'](_0x3909f8+':'+_0x210161['id'],_0x210161);OpenchannelInteractionEvents[_0x2f90('0xb')](_0x3909f8,_0x210161);_0x37f6fc(null);})[_0x2f90('0xc')](_0x37f6fc(null));};}for(var e in events){if(events[_0x2f90('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x2f90('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4178=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x4178,0xa0));var _0x8417=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4178[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x8417('0x0'));var OpenchannelInteraction=require(_0x8417('0x1'))['db'][_0x8417('0x2')];var OpenchannelMessage=require(_0x8417('0x1'))['db'][_0x8417('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8417('0x4')](0x0);var events={'afterCreate':_0x8417('0x5'),'afterUpdate':_0x8417('0x6'),'afterDestroy':_0x8417('0x7')};function emitEvent(_0x546c4e){return function(_0x1bddca,_0x56cb21,_0x438269){_0x1bddca['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x52df1c){_0x1bddca[_0x8417('0x8')](_0x8417('0x9'),_0x52df1c['map'](function(_0x1d7c35){return{'id':_0x1d7c35['id']};}));return OpenchannelMessage[_0x8417('0xa')]({'where':{'OpenchannelInteractionId':_0x1bddca['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8417('0xb')](function(_0x50217b){_0x1bddca[_0x8417('0x8')](_0x8417('0xc'),_0x50217b[_0x8417('0xd')]);OpenchannelInteractionEvents['emit'](_0x546c4e+':'+_0x1bddca['id'],_0x1bddca);OpenchannelInteractionEvents[_0x8417('0xe')](_0x546c4e,_0x1bddca);_0x438269(null);})[_0x8417('0xf')](_0x438269(null));};}for(var e in events){if(events[_0x8417('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x8417('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 1160b9c..bdfde23 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 _0x0c23=['bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x14090e,_0x30c2f7){var _0x554da7=function(_0x165d16){while(--_0x165d16){_0x14090e['push'](_0x14090e['shift']());}};_0x554da7(++_0x30c2f7);}(_0x0c23,0x13e));var _0x30c2=function(_0xe92683,_0x458c0c){_0xe92683=_0xe92683-0x0;var _0x1f948c=_0x0c23[_0xe92683];return _0x1f948c;};'use strict';var _=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var logger=require(_0x30c2('0x2'))(_0x30c2('0x3'));var moment=require(_0x30c2('0x4'));var BPromise=require(_0x30c2('0x5'));var rp=require(_0x30c2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30c2('0x7'));var config=require(_0x30c2('0x8'));var attributes=require(_0x30c2('0x9'));module[_0x30c2('0xa')]=function(_0x28630b,_0x166e7a){return _0x28630b['define'](_0x30c2('0xb'),attributes,{'tableName':_0x30c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x30c2('0xd'),'collate':_0x30c2('0xe'),'hooks':{'beforeUpdate':function(_0x405e1e,_0x508c12,_0x410fc0){if(_0x405e1e[_0x30c2('0xf')]('closed')){_0x405e1e[_0x30c2('0x10')]=moment()[_0x30c2('0x11')](_0x30c2('0x12'));}_0x410fc0(null,_0x405e1e);}}});}; \ No newline at end of file +var _0x368b=['define','OpenchannelInteraction','utf8mb4','changed','closedAt','format','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x2e839a,_0xad03e6){var _0x535ede=function(_0x1cffe5){while(--_0x1cffe5){_0x2e839a['push'](_0x2e839a['shift']());}};_0x535ede(++_0xad03e6);}(_0x368b,0x76));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb368('0x0'));var util=require(_0xb368('0x1'));var logger=require(_0xb368('0x2'))(_0xb368('0x3'));var moment=require('moment');var BPromise=require(_0xb368('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb368('0x5'));var rimraf=require(_0xb368('0x6'));var config=require(_0xb368('0x7'));var attributes=require(_0xb368('0x8'));module[_0xb368('0x9')]=function(_0xa250cb,_0x35233e){return _0xa250cb[_0xb368('0xa')](_0xb368('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb368('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x3be87f,_0x1ea0c0,_0x316b09){if(_0x3be87f[_0xb368('0xd')]('closed')){_0x3be87f[_0xb368('0xe')]=moment()[_0xb368('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x316b09(null,_0x3be87f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index b6cbe6a..084ef40 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 _0xeb35=['update','options','raw','attributes','limit','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','OpenchannelInteraction'];(function(_0x2353b3,_0x62f7cb){var _0x34aeeb=function(_0x20e406){while(--_0x20e406){_0x2353b3['push'](_0x2353b3['shift']());}};_0x34aeeb(++_0x62f7cb);}(_0xeb35,0xbb));var _0x5eb3=function(_0x392186,_0x61025a){_0x392186=_0x392186-0x0;var _0x6ac810=_0xeb35[_0x392186];return _0x6ac810;};'use strict';var _=require(_0x5eb3('0x0'));var util=require(_0x5eb3('0x1'));var moment=require('moment');var BPromise=require(_0x5eb3('0x2'));var rs=require(_0x5eb3('0x3'));var fs=require('fs');var Redis=require(_0x5eb3('0x4'));var db=require(_0x5eb3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5eb3('0x6'))(_0x5eb3('0x7'));var config=require(_0x5eb3('0x8'));var jayson=require(_0x5eb3('0x9'));var client=jayson[_0x5eb3('0xa')][_0x5eb3('0xb')]({'port':0x232a});config[_0x5eb3('0xc')]=_['defaults'](config['redis'],{'host':_0x5eb3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5eb3('0xc')]));require('./openchannelInteraction.socket')[_0x5eb3('0xe')](socket);function respondWithRpcPromise(_0x511cc8,_0x2e70a4,_0x119bbc){return new BPromise(function(_0x1e9859,_0x462f00){return client[_0x5eb3('0xf')](_0x511cc8,_0x119bbc)[_0x5eb3('0x10')](function(_0x565798){logger[_0x5eb3('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2e70a4,_0x5eb3('0x12'));logger['debug'](_0x5eb3('0x13'),_0x2e70a4,_0x5eb3('0x12'),JSON[_0x5eb3('0x14')](_0x565798));if(_0x565798[_0x5eb3('0x15')]){if(_0x565798['error'][_0x5eb3('0x16')]===0x1f4){logger['error'](_0x5eb3('0x17'),_0x2e70a4,_0x565798[_0x5eb3('0x15')]['message']);return _0x462f00(_0x565798[_0x5eb3('0x15')][_0x5eb3('0x18')]);}logger[_0x5eb3('0x15')](_0x5eb3('0x17'),_0x2e70a4,_0x565798[_0x5eb3('0x15')]['message']);return _0x1e9859(_0x565798[_0x5eb3('0x15')]['message']);}else{logger['info'](_0x5eb3('0x17'),_0x2e70a4,_0x5eb3('0x12'));_0x1e9859(_0x565798[_0x5eb3('0x19')]['message']);}})[_0x5eb3('0x1a')](function(_0x37f19b){logger[_0x5eb3('0x15')](_0x5eb3('0x17'),_0x2e70a4,_0x37f19b);_0x462f00(_0x37f19b);});});}exports['UpdateOpenchannelInteraction']=function(_0x3e5a27){var _0xdfcd12=this;return new Promise(function(_0x20e3f1,_0x19f88b){return db[_0x5eb3('0x1b')][_0x5eb3('0x1c')](_0x3e5a27['body'],{'raw':_0x3e5a27['options']?_0x3e5a27[_0x5eb3('0x1d')][_0x5eb3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e5a27['options']?_0x3e5a27['options']['where']||null:null,'attributes':_0x3e5a27['options']?_0x3e5a27['options'][_0x5eb3('0x1f')]||null:null,'limit':_0x3e5a27['options']?_0x3e5a27[_0x5eb3('0x1d')][_0x5eb3('0x20')]||null:null})['then'](function(_0x2b923a){logger[_0x5eb3('0x11')](_0x5eb3('0x21'),_0x3e5a27);logger[_0x5eb3('0x22')](_0x5eb3('0x21'),_0x3e5a27,JSON[_0x5eb3('0x14')](_0x2b923a));_0x20e3f1(_0x2b923a);})[_0x5eb3('0x1a')](function(_0x1b1e0a){logger['error']('UpdateOpenchannelInteraction',_0x1b1e0a[_0x5eb3('0x18')],_0x3e5a27);_0x19f88b(_0xdfcd12[_0x5eb3('0x15')](0x1f4,_0x1b1e0a[_0x5eb3('0x18')]));});});};exports[_0x5eb3('0x23')]=function(_0x3df965){return new Promise(function(_0x188820,_0x58de49){return db['OpenchannelInteraction'][_0x5eb3('0x24')]({'where':_0x3df965[_0x5eb3('0x1d')]?_0x3df965[_0x5eb3('0x1d')][_0x5eb3('0x25')]||null:null})[_0x5eb3('0x10')](function(_0x42f751){if(_0x42f751){return _0x42f751[_0x5eb3('0x26')](_0x3df965['body'][_0x5eb3('0x27')],_[_0x5eb3('0x28')](_0x3df965['body'],[_0x5eb3('0x27'),'id'])||{});}})[_0x5eb3('0x29')](function(_0xd9c1a7){logger[_0x5eb3('0x11')](_0x5eb3('0x2a'),_0x3df965);logger[_0x5eb3('0x22')](_0x5eb3('0x2a'),_0x3df965,JSON[_0x5eb3('0x14')](_0xd9c1a7));_0x188820(_0xd9c1a7);})['catch'](function(_0xf4018c){logger['error'](_0x5eb3('0x2a'),_0xf4018c[_0x5eb3('0x18')],_0x3df965);_0x58de49(_this[_0x5eb3('0x15')](0x1f4,_0xf4018c[_0x5eb3('0x18')]));});});}; \ No newline at end of file +var _0xdc97=['stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xdc97,0x116));var _0x7dc9=function(_0x49c4b0,_0x2843c6){_0x49c4b0=_0x49c4b0-0x0;var _0xf3c77b=_0xdc97[_0x49c4b0];return _0xf3c77b;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require(_0x7dc9('0x3'));var rs=require(_0x7dc9('0x4'));var fs=require('fs');var Redis=require(_0x7dc9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7dc9('0x6'));var logger=require(_0x7dc9('0x7'))('rpc');var config=require(_0x7dc9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7dc9('0x9')][_0x7dc9('0xa')]({'port':0x232a});config[_0x7dc9('0xb')]=_[_0x7dc9('0xc')](config[_0x7dc9('0xb')],{'host':_0x7dc9('0xd'),'port':0x18eb});var socket=require(_0x7dc9('0xe'))(new Redis(config[_0x7dc9('0xb')]));require(_0x7dc9('0xf'))[_0x7dc9('0x10')](socket);function respondWithRpcPromise(_0x38793e,_0xaabdad,_0x548885){return new BPromise(function(_0x3f3400,_0x292253){return client[_0x7dc9('0x11')](_0x38793e,_0x548885)[_0x7dc9('0x12')](function(_0xe12db9){logger[_0x7dc9('0x13')](_0x7dc9('0x14'),_0xaabdad,_0x7dc9('0x15'));logger[_0x7dc9('0x16')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xaabdad,'request\x20sent',JSON[_0x7dc9('0x17')](_0xe12db9));if(_0xe12db9[_0x7dc9('0x18')]){if(_0xe12db9['error']['code']===0x1f4){logger[_0x7dc9('0x18')](_0x7dc9('0x14'),_0xaabdad,_0xe12db9[_0x7dc9('0x18')]['message']);return _0x292253(_0xe12db9['error'][_0x7dc9('0x19')]);}logger[_0x7dc9('0x18')](_0x7dc9('0x14'),_0xaabdad,_0xe12db9['error'][_0x7dc9('0x19')]);return _0x3f3400(_0xe12db9[_0x7dc9('0x18')][_0x7dc9('0x19')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xaabdad,'request\x20sent');_0x3f3400(_0xe12db9[_0x7dc9('0x1a')]['message']);}})[_0x7dc9('0x1b')](function(_0x561652){logger[_0x7dc9('0x18')](_0x7dc9('0x14'),_0xaabdad,_0x561652);_0x292253(_0x561652);});});}exports[_0x7dc9('0x1c')]=function(_0x54f066){var _0x51901e=this;return new Promise(function(_0x2fd163,_0x58cf7b){return db[_0x7dc9('0x1d')][_0x7dc9('0x1e')](_0x54f066[_0x7dc9('0x1f')],{'raw':_0x54f066['options']?_0x54f066[_0x7dc9('0x20')][_0x7dc9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54f066[_0x7dc9('0x20')]?_0x54f066['options'][_0x7dc9('0x22')]||null:null,'attributes':_0x54f066[_0x7dc9('0x20')]?_0x54f066[_0x7dc9('0x20')][_0x7dc9('0x23')]||null:null,'limit':_0x54f066['options']?_0x54f066['options']['limit']||null:null})['then'](function(_0x3ce03a){logger['info'](_0x7dc9('0x1c'),_0x54f066);logger[_0x7dc9('0x16')](_0x7dc9('0x1c'),_0x54f066,JSON[_0x7dc9('0x17')](_0x3ce03a));_0x2fd163(_0x3ce03a);})['catch'](function(_0x3784a0){logger['error']('UpdateOpenchannelInteraction',_0x3784a0[_0x7dc9('0x19')],_0x54f066);_0x58cf7b(_0x51901e[_0x7dc9('0x18')](0x1f4,_0x3784a0[_0x7dc9('0x19')]));});});};exports[_0x7dc9('0x24')]=function(_0x50244e){return new Promise(function(_0x1fb13f,_0x2de360){return db[_0x7dc9('0x1d')][_0x7dc9('0x25')]({'where':_0x50244e[_0x7dc9('0x20')]?_0x50244e[_0x7dc9('0x20')][_0x7dc9('0x22')]||null:null})[_0x7dc9('0x12')](function(_0x3f3fdc){if(_0x3f3fdc){return _0x3f3fdc[_0x7dc9('0x26')](_0x50244e['body']['ids'],_[_0x7dc9('0x27')](_0x50244e[_0x7dc9('0x1f')],[_0x7dc9('0x28'),'id'])||{});}})[_0x7dc9('0x29')](function(_0x18b489){logger['info'](_0x7dc9('0x2a'),_0x50244e);logger[_0x7dc9('0x16')](_0x7dc9('0x2a'),_0x50244e,JSON[_0x7dc9('0x17')](_0x18b489));_0x1fb13f(_0x18b489);})[_0x7dc9('0x1b')](function(_0x613e13){logger[_0x7dc9('0x18')]('AddTags',_0x613e13[_0x7dc9('0x19')],_0x50244e);_0x2de360(_this[_0x7dc9('0x18')](0x1f4,_0x613e13[_0x7dc9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 57dec04..9dad81b 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 _0x9a2f=['save','remove','emit','register','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x5b2fa9,_0x373c61){var _0x3bc18f=function(_0x49eab3){while(--_0x49eab3){_0x5b2fa9['push'](_0x5b2fa9['shift']());}};_0x3bc18f(++_0x373c61);}(_0x9a2f,0xad));var _0xf9a2=function(_0x4376e5,_0x3f44b3){_0x4376e5=_0x4376e5-0x0;var _0x519846=_0x9a2f[_0x4376e5];return _0x519846;};'use strict';var OpenchannelInteractionEvents=require(_0xf9a2('0x0'));var events=[_0xf9a2('0x1'),_0xf9a2('0x2'),'update'];function createListener(_0xea2c2f,_0x2bd2be){return function(_0x32522f){_0x2bd2be[_0xf9a2('0x3')](_0xea2c2f,_0x32522f);};}function removeListener(_0x1cb27d,_0x2605f4){return function(){OpenchannelInteractionEvents['removeListener'](_0x1cb27d,_0x2605f4);};}exports[_0xf9a2('0x4')]=function(_0x4f1f33){for(var _0x1a349f=0x0,_0x3ed07f=events['length'];_0x1a349f<_0x3ed07f;_0x1a349f++){var _0x36321e=events[_0x1a349f];var _0x14eaa6=createListener(_0xf9a2('0x5')+_0x36321e,_0x4f1f33);OpenchannelInteractionEvents['on'](_0x36321e,_0x14eaa6);}}; \ No newline at end of file +var _0x121c=['register','length','openchannelInteraction:','./openchannelInteraction.events','save','update','removeListener'];(function(_0xf4702a,_0x1366b7){var _0x554c3a=function(_0x4f1204){while(--_0x4f1204){_0xf4702a['push'](_0xf4702a['shift']());}};_0x554c3a(++_0x1366b7);}(_0x121c,0x192));var _0xc121=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x121c[_0x2b4411];return _0x8e41ef;};'use strict';var OpenchannelInteractionEvents=require(_0xc121('0x0'));var events=[_0xc121('0x1'),'remove',_0xc121('0x2')];function createListener(_0x541a72,_0x139408){return function(_0x5b2ca2){_0x139408['emit'](_0x541a72,_0x5b2ca2);};}function removeListener(_0x123a7,_0x41ddca){return function(){OpenchannelInteractionEvents[_0xc121('0x3')](_0x123a7,_0x41ddca);};}exports[_0xc121('0x4')]=function(_0x26a052){for(var _0x393c9b=0x0,_0x4d8326=events[_0xc121('0x5')];_0x393c9b<_0x4d8326;_0x393c9b++){var _0x194fae=events[_0x393c9b];var _0x8383d3=createListener(_0xc121('0x6')+_0x194fae,_0x26a052);OpenchannelInteractionEvents['on'](_0x194fae,_0x8383d3);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 91eb9eb..9d812fa 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x236470,_0x752a84){var _0x2b858d=function(_0x40c5b2){while(--_0x40c5b2){_0x236470['push'](_0x236470['shift']());}};_0x2b858d(++_0x752a84);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index a71ae17..d965665 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 _0xaa1b=['BOOLEAN','ENUM','out','sequelize','exports','TEXT'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa1('0x0'));module[_0xbaa1('0x1')]={'body':{'type':Sequelize[_0xbaa1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbaa1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xbaa1('0x4')]('in',_0xbaa1('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbaa1('0x2')]}}; \ No newline at end of file +var _0x23a3=['out','DATE','STRING','TEXT','medium','BOOLEAN','ENUM'];(function(_0x384146,_0x45bebc){var _0x5c9510=function(_0x2435d0){while(--_0x2435d0){_0x384146['push'](_0x384146['shift']());}};_0x5c9510(++_0x45bebc);}(_0x23a3,0x131));var _0x323a=function(_0x31131c,_0x30e12b){_0x31131c=_0x31131c-0x0;var _0x199fcb=_0x23a3[_0x31131c];return _0x199fcb;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x323a('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x323a('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x323a('0x2')]('in',_0x323a('0x3')),'defaultValue':_0x323a('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x323a('0x4')]},'providerName':{'type':Sequelize[_0x323a('0x5')]},'providerResponse':{'type':Sequelize[_0x323a('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 300f44d..ee11d41 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 _0x3cd2=['null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel','RejectMessage','rejectMessage','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./openchannelMessage.socket','register','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','offset','limit','count','status','set','Content-Range','reject','update','then','destroy','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','includeAll','options','find','create','body','params','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify'];(function(_0x46131d,_0x4e701d){var _0x301c71=function(_0x1ce369){while(--_0x1ce369){_0x46131d['push'](_0x46131d['shift']());}};_0x301c71(++_0x4e701d);}(_0x3cd2,0x115));var _0x23cd=function(_0x1c0fa0,_0x43e1e7){_0x1c0fa0=_0x1c0fa0-0x0;var _0x47525f=_0x3cd2[_0x1c0fa0];return _0x47525f;};'use strict';var emlformat=require(_0x23cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x23cd('0x1'));var moment=require(_0x23cd('0x2'));var BPromise=require(_0x23cd('0x3'));var Mustache=require(_0x23cd('0x4'));var util=require('util');var path=require(_0x23cd('0x5'));var sox=require(_0x23cd('0x6'));var csv=require('to-csv');var ejs=require(_0x23cd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23cd('0x8'));var squel=require(_0x23cd('0x9'));var crypto=require('crypto');var jsforce=require(_0x23cd('0xa'));var deskjs=require(_0x23cd('0xb'));var toCsv=require(_0x23cd('0xc'));var querystring=require('querystring');var Papa=require(_0x23cd('0xd'));var Redis=require(_0x23cd('0xe'));var authService=require(_0x23cd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x23cd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x23cd('0x11'))('api');var utils=require(_0x23cd('0x12'));var config=require(_0x23cd('0x13'));var licenseUtil=require(_0x23cd('0x14'));var db=require(_0x23cd('0x15'))['db'];config[_0x23cd('0x16')]=_['defaults'](config[_0x23cd('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23cd('0x16')]));require(_0x23cd('0x17'))[_0x23cd('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x23cd('0x19')][_0x23cd('0x1a')]({'port':0x232c});var client9002=jayson[_0x23cd('0x19')][_0x23cd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x47ae59,_0x5d3928,_0x4d09cc,_0x20c0a1){return new BPromise(function(_0x5a12d1,_0x1b600a){var _0x30e951=_0x20c0a1||client;return _0x30e951[_0x23cd('0x1b')](_0x47ae59,_0x4d09cc)['then'](function(_0x59ff04){logger[_0x23cd('0x1c')](_0x23cd('0x1d'),_0x5d3928,_0x23cd('0x1e'));logger['debug'](_0x23cd('0x1f'),_0x5d3928,'request\x20sent',JSON['stringify'](_0x59ff04));if(_0x59ff04[_0x23cd('0x20')]){if(_0x59ff04[_0x23cd('0x20')][_0x23cd('0x21')]===0x1f4){logger[_0x23cd('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x5d3928,_0x59ff04[_0x23cd('0x20')]['message']);return _0x1b600a(_0x59ff04[_0x23cd('0x20')]['message']);}logger[_0x23cd('0x20')](_0x23cd('0x1d'),_0x5d3928,_0x59ff04['error'][_0x23cd('0x22')]);return _0x5a12d1(_0x59ff04['error'][_0x23cd('0x22')]);}else{logger[_0x23cd('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x5d3928,_0x23cd('0x1e'));_0x5a12d1(_0x59ff04['result'][_0x23cd('0x22')]);}})[_0x23cd('0x23')](function(_0x3db72e){logger[_0x23cd('0x20')](_0x23cd('0x1d'),_0x5d3928,_0x3db72e);_0x1b600a(_0x3db72e);});});}function respondWithStatusCode(_0xaab4dc,_0x1d480e){_0x1d480e=_0x1d480e||0xcc;return function(_0xcff3cc){if(_0xcff3cc){return _0xaab4dc[_0x23cd('0x24')](_0x1d480e);}return _0xaab4dc['status'](_0x1d480e)[_0x23cd('0x25')]();};}function respondWithResult(_0x30e4dc,_0x1b194c){_0x1b194c=_0x1b194c||0xc8;return function(_0x4f14ad){if(_0x4f14ad){return _0x30e4dc['status'](_0x1b194c)['json'](_0x4f14ad);}};}function respondWithFilteredResult(_0x18b68e,_0x26b02e){return function(_0x1ec2eb){if(_0x1ec2eb){var _0x33e30c=typeof _0x26b02e[_0x23cd('0x26')]==='undefined'&&typeof _0x26b02e[_0x23cd('0x27')]==='undefined';var _0x19de84=_0x1ec2eb['count'];var _0x538eca=_0x33e30c?0x0:_0x26b02e[_0x23cd('0x26')];var _0x5c9175=_0x33e30c?_0x1ec2eb[_0x23cd('0x28')]:_0x26b02e[_0x23cd('0x26')]+_0x26b02e[_0x23cd('0x27')];var _0x26f0d5;if(_0x5c9175>=_0x19de84){_0x5c9175=_0x19de84;_0x26f0d5=0xc8;}else{_0x26f0d5=0xce;}_0x18b68e[_0x23cd('0x29')](_0x26f0d5);return _0x18b68e[_0x23cd('0x2a')](_0x23cd('0x2b'),_0x538eca+'-'+_0x5c9175+'/'+_0x19de84)['json'](_0x1ec2eb);}return null;};}function patchUpdates(_0x55971d){return function(_0x3e150c){try{jsonpatch['apply'](_0x3e150c,_0x55971d,!![]);}catch(_0x1ce40e){return BPromise[_0x23cd('0x2c')](_0x1ce40e);}return _0x3e150c['save']();};}function saveUpdates(_0x24f7d5,_0x3ce113){return function(_0x2a82e2){if(_0x2a82e2){return _0x2a82e2[_0x23cd('0x2d')](_0x24f7d5)[_0x23cd('0x2e')](function(_0x48c1cc){return _0x48c1cc;});}return null;};}function removeEntity(_0x4a38f9,_0xb314ab){return function(_0x23cc05){if(_0x23cc05){return _0x23cc05[_0x23cd('0x2f')]()[_0x23cd('0x2e')](function(){_0x4a38f9[_0x23cd('0x29')](0xcc)[_0x23cd('0x25')]();});}};}function handleEntityNotFound(_0x23359a,_0x5f2431){return function(_0x4e6ee0){if(!_0x4e6ee0){_0x23359a[_0x23cd('0x24')](0x194);}return _0x4e6ee0;};}function handleError(_0x26dbda,_0x2f4bfb){_0x2f4bfb=_0x2f4bfb||0x1f4;return function(_0x4542df){logger[_0x23cd('0x20')](_0x4542df['stack']);if(_0x4542df[_0x23cd('0x30')]){delete _0x4542df[_0x23cd('0x30')];}_0x26dbda[_0x23cd('0x29')](_0x2f4bfb)[_0x23cd('0x31')](_0x4542df);};}exports[_0x23cd('0x32')]=function(_0x12fad5,_0x33b0da){var _0x43199b={},_0x7f9988={},_0x1fce51={'count':0x0,'rows':[]};var _0xc32191=_['map'](db[_0x23cd('0x33')][_0x23cd('0x34')],function(_0x3410ba){return{'name':_0x3410ba[_0x23cd('0x35')],'type':_0x3410ba[_0x23cd('0x36')][_0x23cd('0x37')]};});_0x7f9988['model']=_[_0x23cd('0x38')](_0xc32191,'name');_0x7f9988[_0x23cd('0x39')]=_[_0x23cd('0x3a')](_0x12fad5[_0x23cd('0x39')]);_0x7f9988[_0x23cd('0x3b')]=_[_0x23cd('0x3c')](_0x7f9988[_0x23cd('0x3d')],_0x7f9988['query']);_0x43199b[_0x23cd('0x3e')]=_[_0x23cd('0x3c')](_0x7f9988['model'],qs[_0x23cd('0x3f')](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x3f')]));_0x43199b[_0x23cd('0x3e')]=_0x43199b[_0x23cd('0x3e')][_0x23cd('0x40')]?_0x43199b[_0x23cd('0x3e')]:_0x7f9988[_0x23cd('0x3d')];if(!_0x12fad5[_0x23cd('0x39')][_0x23cd('0x41')](_0x23cd('0x42'))){_0x43199b[_0x23cd('0x27')]=qs[_0x23cd('0x27')](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x27')]);_0x43199b['offset']=qs['offset'](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x26')]);}_0x43199b[_0x23cd('0x43')]=qs[_0x23cd('0x44')](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x44')]);_0x43199b[_0x23cd('0x45')]=qs['filters'](_[_0x23cd('0x46')](_0x12fad5['query'],_0x7f9988[_0x23cd('0x3b')]),_0xc32191);if(_0x12fad5['query']['filter']){_0x43199b[_0x23cd('0x45')]=_[_0x23cd('0x47')](_0x43199b[_0x23cd('0x45')],{'$or':_[_0x23cd('0x38')](_0xc32191,function(_0x4e9a45){if(_0x4e9a45[_0x23cd('0x36')]!==_0x23cd('0x48')){var _0x28ec57={};_0x28ec57[_0x4e9a45[_0x23cd('0x30')]]={'$like':'%'+_0x12fad5['query'][_0x23cd('0x49')]+'%'};return _0x28ec57;}})});}_0x43199b=_[_0x23cd('0x47')]({},_0x43199b,_0x12fad5['options']);var _0x674ef4={'where':_0x43199b[_0x23cd('0x45')]};return db[_0x23cd('0x33')][_0x23cd('0x28')](_0x674ef4)[_0x23cd('0x2e')](function(_0x113515){_0x1fce51['count']=_0x113515;if(_0x12fad5[_0x23cd('0x39')]['includeAll']){_0x43199b[_0x23cd('0x4a')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x23cd('0x4b')](_0x43199b);})['then'](function(_0x5f110f){_0x1fce51[_0x23cd('0x4c')]=_0x5f110f;return _0x1fce51;})[_0x23cd('0x2e')](respondWithFilteredResult(_0x33b0da,_0x43199b))['catch'](handleError(_0x33b0da,null));};exports[_0x23cd('0x4d')]=function(_0x12f384,_0x4267d1){var _0x2cf781={'raw':!![],'where':{'id':_0x12f384['params']['id']}},_0x3c8621={};_0x3c8621[_0x23cd('0x3d')]=_[_0x23cd('0x3a')](db[_0x23cd('0x33')][_0x23cd('0x34')]);_0x3c8621[_0x23cd('0x39')]=_[_0x23cd('0x3a')](_0x12f384['query']);_0x3c8621[_0x23cd('0x3b')]=_[_0x23cd('0x3c')](_0x3c8621['model'],_0x3c8621[_0x23cd('0x39')]);_0x2cf781['attributes']=_['intersection'](_0x3c8621['model'],qs[_0x23cd('0x3f')](_0x12f384['query'][_0x23cd('0x3f')]));_0x2cf781[_0x23cd('0x3e')]=_0x2cf781[_0x23cd('0x3e')]['length']?_0x2cf781[_0x23cd('0x3e')]:_0x3c8621[_0x23cd('0x3d')];if(_0x12f384[_0x23cd('0x39')][_0x23cd('0x4e')]){_0x2cf781[_0x23cd('0x4a')]=[{'all':!![]}];}_0x2cf781=_[_0x23cd('0x47')]({},_0x2cf781,_0x12f384[_0x23cd('0x4f')]);return db[_0x23cd('0x33')][_0x23cd('0x50')](_0x2cf781)[_0x23cd('0x2e')](handleEntityNotFound(_0x4267d1,null))[_0x23cd('0x2e')](respondWithResult(_0x4267d1,null))[_0x23cd('0x23')](handleError(_0x4267d1,null));};exports['create']=function(_0x327520,_0x4bbd71){return db[_0x23cd('0x33')][_0x23cd('0x51')](_0x327520[_0x23cd('0x52')],{})[_0x23cd('0x2e')](respondWithResult(_0x4bbd71,0xc9))[_0x23cd('0x23')](handleError(_0x4bbd71,null));};exports[_0x23cd('0x2d')]=function(_0x30384d,_0x1b0a8e){if(_0x30384d['body']['id']){delete _0x30384d['body']['id'];}return db[_0x23cd('0x33')][_0x23cd('0x50')]({'where':{'id':_0x30384d[_0x23cd('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b0a8e,null))[_0x23cd('0x2e')](saveUpdates(_0x30384d[_0x23cd('0x52')],null))[_0x23cd('0x2e')](respondWithResult(_0x1b0a8e,null))[_0x23cd('0x23')](handleError(_0x1b0a8e,null));};exports['destroy']=function(_0x23eb42,_0x15901f){return db[_0x23cd('0x33')][_0x23cd('0x50')]({'where':{'id':_0x23eb42[_0x23cd('0x53')]['id']}})[_0x23cd('0x2e')](handleEntityNotFound(_0x15901f,null))[_0x23cd('0x2e')](removeEntity(_0x15901f,null))[_0x23cd('0x23')](handleError(_0x15901f,null));};exports[_0x23cd('0x54')]=function(_0xe5547e,_0x4752fc){return db[_0x23cd('0x33')]['describe']()[_0x23cd('0x2e')](respondWithResult(_0x4752fc,null))['catch'](handleError(_0x4752fc,null));};var interaction_log=require('../../config/logger')(_0x23cd('0x55'));exports[_0x23cd('0x56')]=function(_0x1aab42,_0x94a9c8,_0x444e2b){var _0x4373ba={'agent':{},'channel':'openchannel'};if(_0x1aab42[_0x23cd('0x52')]['id']){delete _0x1aab42[_0x23cd('0x52')]['id'];}_0x1aab42['body'][_0x23cd('0x57')]=!![];_0x1aab42[_0x23cd('0x52')][_0x23cd('0x58')]=moment()[_0x23cd('0x59')](_0x23cd('0x5a'));_0x1aab42[_0x23cd('0x52')][_0x23cd('0x5b')]=_0x1aab42['body'][_0x23cd('0x5b')]||_0x1aab42[_0x23cd('0x5c')]['id'];_0x4373ba[_0x23cd('0x5d')]['id']=_0x1aab42[_0x23cd('0x52')][_0x23cd('0x5b')];return db[_0x23cd('0x33')][_0x23cd('0x50')]({'where':{'id':_0x1aab42['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x94a9c8,null))[_0x23cd('0x2e')](saveUpdates(_0x1aab42[_0x23cd('0x52')],null))[_0x23cd('0x2e')](function(_0x15ab3e){if(_0x15ab3e){_0x4373ba[_0x23cd('0x22')]=_0x15ab3e[_0x23cd('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0x23cd('0x50')]({'where':{'id':_0x15ab3e[_0x23cd('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x94a9c8,null))[_0x23cd('0x2e')](function(_0x14f209){if(_0x14f209){return _0x14f209[_0x23cd('0x2d')]({'UserId':_0x1aab42[_0x23cd('0x52')]['UserId'],'read1stAt':_['isNil'](_0x14f209[_0x23cd('0x60')])?moment()['format'](_0x23cd('0x5a')):undefined});}return null;})[_0x23cd('0x2e')](function(_0xb3b855){if(_0xb3b855){_0x4373ba[_0x23cd('0x61')]=_0xb3b855[_0x23cd('0x5e')]({'plain':!![]});interaction_log[_0x23cd('0x1c')](_0x23cd('0x62'),_0x1aab42[_0x23cd('0x5c')]['id'],_0x1aab42['user'][_0x23cd('0x30')],_0x1aab42[_0x23cd('0x5c')][_0x23cd('0x63')],_0x4373ba[_0x23cd('0x61')]['id'],_0x1aab42[_0x23cd('0x52')]?JSON[_0x23cd('0x64')](_0x1aab42['body']):_0x23cd('0x65'));return respondWithRpcPromise(_0x23cd('0x66'),_0x23cd('0x67'),_0x4373ba);}return null;})[_0x23cd('0x2e')](function(_0x2787b5){var _0x8ffc18=_0x23cd('0x68')+_0x2787b5[_0x23cd('0x22')][_0x23cd('0x69')];return db[_0x23cd('0x6a')]['query'](_0x8ffc18,{'type':db[_0x23cd('0x6b')][_0x23cd('0x6c')][_0x23cd('0x6d')],'raw':!![]})['then'](function(_0x4ebfa3){return _0x4ebfa3;});})[_0x23cd('0x2e')](function(_0x239e24){if(_0x239e24){_0x4373ba['message'][_0x23cd('0x6e')]=_0x239e24[0x0];if(!_0x1aab42['body'][_0x23cd('0x5b')])return;return db[_0x23cd('0x6f')][_0x23cd('0x50')]({'where':{'id':_0x1aab42[_0x23cd('0x52')]['UserId'],'role':'agent'},'attributes':['id',_0x23cd('0x30'),_0x23cd('0x70'),_0x23cd('0x71'),_0x23cd('0x72')],'raw':!![]});}return null;})[_0x23cd('0x2e')](function(_0x4c6ff8){if(!_0x4c6ff8)return null;_0x4373ba[_0x23cd('0x22')][_0x23cd('0x5d')]=_0x4c6ff8;return _0x4373ba;})['then'](function(_0x2d0904){if(_0x2d0904){if(_0x1aab42[_0x23cd('0x52')][_0x23cd('0x73')]){_0x4373ba[_0x23cd('0x22')][_0x23cd('0x74')]=util[_0x23cd('0x59')](_0x23cd('0x75'),_0x1aab42['user'][_0x23cd('0x30')]);_0x4373ba[_0x23cd('0x22')][_0x23cd('0x76')]=_0x4373ba[_0x23cd('0x76')];_0x4373ba[_0x23cd('0x22')][_0x23cd('0x77')]=_0x4373ba['channel'];_0x4373ba[_0x23cd('0x22')][_0x23cd('0x78')]=_0x23cd('0x56');return respondWithRpcPromise(_0x23cd('0x79'),_0x23cd('0x79'),{'event':_0x23cd('0x7a'),'message':_0x4373ba[_0x23cd('0x22')]},client9002)[_0x23cd('0x2e')](function(){return _0x4373ba;});}return _0x4373ba;}return null;})[_0x23cd('0x2e')](respondWithResult(_0x94a9c8,null))[_0x23cd('0x23')](handleError(_0x94a9c8,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x23cd('0x2c')]=function(_0x389e62,_0x1bd6e8,_0x1b0c20){var _0x42f59e={'agent':{},'channel':_0x23cd('0x7b')};if(_0x389e62['body']['id']){delete _0x389e62[_0x23cd('0x52')]['id'];}_0x389e62[_0x23cd('0x52')][_0x23cd('0x5b')]=_0x389e62[_0x23cd('0x52')][_0x23cd('0x5b')]||_0x389e62[_0x23cd('0x5c')]['id'];_0x42f59e[_0x23cd('0x5d')]['id']=_0x389e62[_0x23cd('0x52')]['UserId'];return db['OpenchannelMessage'][_0x23cd('0x50')]({'where':{'id':_0x389e62['params']['id'],'UserId':null}})[_0x23cd('0x2e')](handleEntityNotFound(_0x1bd6e8,null))['then'](function(_0xf6b9be){if(_0xf6b9be){_0x42f59e[_0x23cd('0x22')]=_0xf6b9be[_0x23cd('0x5e')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0xf6b9be['OpenchannelInteractionId']}});}return null;})[_0x23cd('0x2e')](handleEntityNotFound(_0x1bd6e8,null))['then'](function(_0x1a9de9){if(_0x1a9de9){_0x42f59e[_0x23cd('0x61')]=_0x1a9de9[_0x23cd('0x5e')]({'plain':!![]});interaction_log[_0x23cd('0x1c')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x389e62[_0x23cd('0x5c')]['id'],_0x389e62['user'][_0x23cd('0x30')],_0x389e62['user'][_0x23cd('0x63')],_0x42f59e[_0x23cd('0x61')]['id'],_0x389e62[_0x23cd('0x52')]?JSON[_0x23cd('0x64')](_0x389e62[_0x23cd('0x52')]):_0x23cd('0x65'));return respondWithRpcPromise(_0x23cd('0x7c'),_0x23cd('0x7d'),_0x42f59e);}return null;})[_0x23cd('0x2e')](function(_0x20b886){var _0x1dfcae=_0x23cd('0x68')+_0x20b886['message'][_0x23cd('0x69')];return db[_0x23cd('0x6a')][_0x23cd('0x39')](_0x1dfcae,{'type':db['Sequelize'][_0x23cd('0x6c')][_0x23cd('0x6d')],'raw':!![]})[_0x23cd('0x2e')](function(_0x365aab){return _0x365aab;});})[_0x23cd('0x2e')](function(_0x4888e9){if(_0x4888e9){_0x42f59e[_0x23cd('0x22')][_0x23cd('0x6e')]=_0x4888e9[0x0];if(!_0x389e62['body'][_0x23cd('0x5b')])return;return db['User']['find']({'where':{'id':_0x389e62[_0x23cd('0x52')][_0x23cd('0x5b')],'role':_0x23cd('0x5d')},'attributes':['id',_0x23cd('0x30'),_0x23cd('0x70'),_0x23cd('0x71'),_0x23cd('0x72')],'raw':!![]});}return null;})['then'](function(_0x79533b){if(!_0x79533b)return null;_0x42f59e[_0x23cd('0x22')][_0x23cd('0x5d')]=_0x79533b;return _0x42f59e;})[_0x23cd('0x2e')](function(_0x2ab18e){if(_0x2ab18e){_0x2ab18e['message'][_0x23cd('0x74')]=util['format'](_0x23cd('0x75'),_0x389e62[_0x23cd('0x5c')][_0x23cd('0x30')]);_0x2ab18e['message'][_0x23cd('0x76')]=_0x42f59e[_0x23cd('0x76')];_0x2ab18e[_0x23cd('0x22')]['motionChannel']=_0x42f59e[_0x23cd('0x76')];_0x2ab18e[_0x23cd('0x22')][_0x23cd('0x78')]=_0x23cd('0x2c');respondWithRpcPromise(_0x23cd('0x79'),_0x23cd('0x79'),{'event':'rejectmessage','message':_0x2ab18e[_0x23cd('0x22')]},client9002);return _0x42f59e;}return null;})[_0x23cd('0x2e')](respondWithResult(_0x1bd6e8,null))[_0x23cd('0x23')](handleError(_0x1bd6e8,null));}; \ No newline at end of file +var _0x0e50=['reject','update','end','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','merge','VIRTUAL','filter','OpenchannelMessage','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','motionChannel','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','interface','SIP/%s','channel','event','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','defaults','redis','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','client','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','set','apply'];(function(_0x36e830,_0x165ec7){var _0x526512=function(_0x5babc9){while(--_0x5babc9){_0x36e830['push'](_0x36e830['shift']());}};_0x526512(++_0x165ec7);}(_0x0e50,0x1ce));var _0x00e5=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0e50[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00e5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00e5('0x1'));var rp=require(_0x00e5('0x2'));var moment=require(_0x00e5('0x3'));var BPromise=require(_0x00e5('0x4'));var Mustache=require(_0x00e5('0x5'));var util=require(_0x00e5('0x6'));var path=require(_0x00e5('0x7'));var sox=require('sox');var csv=require(_0x00e5('0x8'));var ejs=require(_0x00e5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x00e5('0xa'));var jsforce=require(_0x00e5('0xb'));var deskjs=require(_0x00e5('0xc'));var toCsv=require(_0x00e5('0x8'));var querystring=require(_0x00e5('0xd'));var Papa=require(_0x00e5('0xe'));var Redis=require(_0x00e5('0xf'));var authService=require(_0x00e5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x00e5('0x11'));var hardwareService=require(_0x00e5('0x12'));var logger=require(_0x00e5('0x13'))(_0x00e5('0x14'));var utils=require(_0x00e5('0x15'));var config=require(_0x00e5('0x16'));var licenseUtil=require(_0x00e5('0x17'));var db=require(_0x00e5('0x18'))['db'];config['redis']=_[_0x00e5('0x19')](config[_0x00e5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x00e5('0x1b'))(new Redis(config[_0x00e5('0x1a')]));require(_0x00e5('0x1c'))['register'](socket);var jayson=require(_0x00e5('0x1d'));var client=jayson['client'][_0x00e5('0x1e')]({'port':0x232c});var client9002=jayson[_0x00e5('0x1f')][_0x00e5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2a7900,_0x2e4b2d,_0x15e42c,_0x2face7){return new BPromise(function(_0x3bea20,_0x345b28){var _0x57ac99=_0x2face7||client;return _0x57ac99['request'](_0x2a7900,_0x15e42c)[_0x00e5('0x20')](function(_0x259e89){logger[_0x00e5('0x21')](_0x00e5('0x22'),_0x2e4b2d,_0x00e5('0x23'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2e4b2d,_0x00e5('0x23'),JSON[_0x00e5('0x24')](_0x259e89));if(_0x259e89[_0x00e5('0x25')]){if(_0x259e89['error'][_0x00e5('0x26')]===0x1f4){logger[_0x00e5('0x25')](_0x00e5('0x22'),_0x2e4b2d,_0x259e89[_0x00e5('0x25')][_0x00e5('0x27')]);return _0x345b28(_0x259e89[_0x00e5('0x25')][_0x00e5('0x27')]);}logger['error'](_0x00e5('0x22'),_0x2e4b2d,_0x259e89['error'][_0x00e5('0x27')]);return _0x3bea20(_0x259e89[_0x00e5('0x25')]['message']);}else{logger[_0x00e5('0x21')](_0x00e5('0x22'),_0x2e4b2d,_0x00e5('0x23'));_0x3bea20(_0x259e89[_0x00e5('0x28')][_0x00e5('0x27')]);}})['catch'](function(_0x7dc150){logger['error'](_0x00e5('0x22'),_0x2e4b2d,_0x7dc150);_0x345b28(_0x7dc150);});});}function respondWithStatusCode(_0x454f31,_0x466131){_0x466131=_0x466131||0xcc;return function(_0x400849){if(_0x400849){return _0x454f31[_0x00e5('0x29')](_0x466131);}return _0x454f31[_0x00e5('0x2a')](_0x466131)['end']();};}function respondWithResult(_0x3abb23,_0x43b572){_0x43b572=_0x43b572||0xc8;return function(_0x30191f){if(_0x30191f){return _0x3abb23[_0x00e5('0x2a')](_0x43b572)[_0x00e5('0x2b')](_0x30191f);}};}function respondWithFilteredResult(_0x1f58f6,_0x23a54b){return function(_0x321bbf){if(_0x321bbf){var _0x2a48c7=typeof _0x23a54b[_0x00e5('0x2c')]==='undefined'&&typeof _0x23a54b[_0x00e5('0x2d')]===_0x00e5('0x2e');var _0x3cb504=_0x321bbf[_0x00e5('0x2f')];var _0x42ed9f=_0x2a48c7?0x0:_0x23a54b[_0x00e5('0x2c')];var _0x226dab=_0x2a48c7?_0x321bbf[_0x00e5('0x2f')]:_0x23a54b[_0x00e5('0x2c')]+_0x23a54b[_0x00e5('0x2d')];var _0x1f32a1;if(_0x226dab>=_0x3cb504){_0x226dab=_0x3cb504;_0x1f32a1=0xc8;}else{_0x1f32a1=0xce;}_0x1f58f6['status'](_0x1f32a1);return _0x1f58f6[_0x00e5('0x30')]('Content-Range',_0x42ed9f+'-'+_0x226dab+'/'+_0x3cb504)['json'](_0x321bbf);}return null;};}function patchUpdates(_0x531f94){return function(_0x3a87b1){try{jsonpatch[_0x00e5('0x31')](_0x3a87b1,_0x531f94,!![]);}catch(_0x5dbc0b){return BPromise[_0x00e5('0x32')](_0x5dbc0b);}return _0x3a87b1['save']();};}function saveUpdates(_0x53090f,_0x39e28b){return function(_0x40a57f){if(_0x40a57f){return _0x40a57f[_0x00e5('0x33')](_0x53090f)[_0x00e5('0x20')](function(_0x33a3dd){return _0x33a3dd;});}return null;};}function removeEntity(_0x329166,_0x2f7926){return function(_0xf829b9){if(_0xf829b9){return _0xf829b9['destroy']()[_0x00e5('0x20')](function(){_0x329166[_0x00e5('0x2a')](0xcc)[_0x00e5('0x34')]();});}};}function handleEntityNotFound(_0x20da9b,_0x64a990){return function(_0x496311){if(!_0x496311){_0x20da9b['sendStatus'](0x194);}return _0x496311;};}function handleError(_0x17b72d,_0x39a15c){_0x39a15c=_0x39a15c||0x1f4;return function(_0x12397e){logger[_0x00e5('0x25')](_0x12397e['stack']);if(_0x12397e[_0x00e5('0x35')]){delete _0x12397e[_0x00e5('0x35')];}_0x17b72d[_0x00e5('0x2a')](_0x39a15c)['send'](_0x12397e);};}exports[_0x00e5('0x36')]=function(_0x220ff0,_0x33fdd0){var _0x264bba={},_0x6dc505={},_0x4b13a0={'count':0x0,'rows':[]};var _0x41a1b0=_[_0x00e5('0x37')](db['OpenchannelMessage'][_0x00e5('0x38')],function(_0x135f3d){return{'name':_0x135f3d[_0x00e5('0x39')],'type':_0x135f3d[_0x00e5('0x3a')][_0x00e5('0x3b')]};});_0x6dc505[_0x00e5('0x3c')]=_[_0x00e5('0x37')](_0x41a1b0,'name');_0x6dc505[_0x00e5('0x3d')]=_['keys'](_0x220ff0[_0x00e5('0x3d')]);_0x6dc505[_0x00e5('0x3e')]=_[_0x00e5('0x3f')](_0x6dc505[_0x00e5('0x3c')],_0x6dc505[_0x00e5('0x3d')]);_0x264bba[_0x00e5('0x40')]=_['intersection'](_0x6dc505[_0x00e5('0x3c')],qs[_0x00e5('0x41')](_0x220ff0[_0x00e5('0x3d')][_0x00e5('0x41')]));_0x264bba[_0x00e5('0x40')]=_0x264bba[_0x00e5('0x40')]['length']?_0x264bba[_0x00e5('0x40')]:_0x6dc505[_0x00e5('0x3c')];if(!_0x220ff0[_0x00e5('0x3d')]['hasOwnProperty']('nolimit')){_0x264bba['limit']=qs[_0x00e5('0x2d')](_0x220ff0[_0x00e5('0x3d')][_0x00e5('0x2d')]);_0x264bba[_0x00e5('0x2c')]=qs['offset'](_0x220ff0[_0x00e5('0x3d')]['offset']);}_0x264bba[_0x00e5('0x42')]=qs[_0x00e5('0x43')](_0x220ff0['query'][_0x00e5('0x43')]);_0x264bba[_0x00e5('0x44')]=qs['filters'](_['pick'](_0x220ff0[_0x00e5('0x3d')],_0x6dc505['filters']),_0x41a1b0);if(_0x220ff0['query']['filter']){_0x264bba[_0x00e5('0x44')]=_[_0x00e5('0x45')](_0x264bba[_0x00e5('0x44')],{'$or':_[_0x00e5('0x37')](_0x41a1b0,function(_0x4b1855){if(_0x4b1855[_0x00e5('0x3a')]!==_0x00e5('0x46')){var _0xafab3a={};_0xafab3a[_0x4b1855['name']]={'$like':'%'+_0x220ff0[_0x00e5('0x3d')][_0x00e5('0x47')]+'%'};return _0xafab3a;}})});}_0x264bba=_['merge']({},_0x264bba,_0x220ff0['options']);var _0x262fc3={'where':_0x264bba[_0x00e5('0x44')]};return db[_0x00e5('0x48')][_0x00e5('0x2f')](_0x262fc3)[_0x00e5('0x20')](function(_0x287d30){_0x4b13a0[_0x00e5('0x2f')]=_0x287d30;if(_0x220ff0[_0x00e5('0x3d')][_0x00e5('0x49')]){_0x264bba[_0x00e5('0x4a')]=[{'all':!![]}];}return db[_0x00e5('0x48')][_0x00e5('0x4b')](_0x264bba);})['then'](function(_0x5691ee){_0x4b13a0[_0x00e5('0x4c')]=_0x5691ee;return _0x4b13a0;})[_0x00e5('0x20')](respondWithFilteredResult(_0x33fdd0,_0x264bba))[_0x00e5('0x4d')](handleError(_0x33fdd0,null));};exports[_0x00e5('0x4e')]=function(_0x57d5db,_0x325602){var _0x7f93a9={'raw':!![],'where':{'id':_0x57d5db[_0x00e5('0x4f')]['id']}},_0x124be4={};_0x124be4[_0x00e5('0x3c')]=_[_0x00e5('0x50')](db[_0x00e5('0x48')][_0x00e5('0x38')]);_0x124be4[_0x00e5('0x3d')]=_['keys'](_0x57d5db['query']);_0x124be4[_0x00e5('0x3e')]=_['intersection'](_0x124be4[_0x00e5('0x3c')],_0x124be4[_0x00e5('0x3d')]);_0x7f93a9['attributes']=_[_0x00e5('0x3f')](_0x124be4[_0x00e5('0x3c')],qs[_0x00e5('0x41')](_0x57d5db[_0x00e5('0x3d')][_0x00e5('0x41')]));_0x7f93a9[_0x00e5('0x40')]=_0x7f93a9[_0x00e5('0x40')][_0x00e5('0x51')]?_0x7f93a9[_0x00e5('0x40')]:_0x124be4[_0x00e5('0x3c')];if(_0x57d5db[_0x00e5('0x3d')][_0x00e5('0x49')]){_0x7f93a9['include']=[{'all':!![]}];}_0x7f93a9=_[_0x00e5('0x45')]({},_0x7f93a9,_0x57d5db[_0x00e5('0x52')]);return db[_0x00e5('0x48')][_0x00e5('0x53')](_0x7f93a9)[_0x00e5('0x20')](handleEntityNotFound(_0x325602,null))[_0x00e5('0x20')](respondWithResult(_0x325602,null))['catch'](handleError(_0x325602,null));};exports[_0x00e5('0x54')]=function(_0x46ed74,_0x5bc3f0){return db['OpenchannelMessage'][_0x00e5('0x54')](_0x46ed74[_0x00e5('0x55')],{})['then'](respondWithResult(_0x5bc3f0,0xc9))[_0x00e5('0x4d')](handleError(_0x5bc3f0,null));};exports['update']=function(_0x4983eb,_0x24386c){if(_0x4983eb[_0x00e5('0x55')]['id']){delete _0x4983eb[_0x00e5('0x55')]['id'];}return db[_0x00e5('0x48')][_0x00e5('0x53')]({'where':{'id':_0x4983eb['params']['id']}})[_0x00e5('0x20')](handleEntityNotFound(_0x24386c,null))[_0x00e5('0x20')](saveUpdates(_0x4983eb[_0x00e5('0x55')],null))['then'](respondWithResult(_0x24386c,null))['catch'](handleError(_0x24386c,null));};exports['destroy']=function(_0x1d7608,_0x3e66cd){return db[_0x00e5('0x48')][_0x00e5('0x53')]({'where':{'id':_0x1d7608[_0x00e5('0x4f')]['id']}})[_0x00e5('0x20')](handleEntityNotFound(_0x3e66cd,null))[_0x00e5('0x20')](removeEntity(_0x3e66cd,null))[_0x00e5('0x4d')](handleError(_0x3e66cd,null));};exports['describe']=function(_0x3285c5,_0x15f1e1){return db[_0x00e5('0x48')][_0x00e5('0x56')]()[_0x00e5('0x20')](respondWithResult(_0x15f1e1,null))['catch'](handleError(_0x15f1e1,null));};var interaction_log=require('../../config/logger')(_0x00e5('0x57'));exports[_0x00e5('0x58')]=function(_0x6ba039,_0x205a54,_0x155de0){var _0x225f0a={'agent':{},'channel':_0x00e5('0x59')};if(_0x6ba039[_0x00e5('0x55')]['id']){delete _0x6ba039['body']['id'];}_0x6ba039[_0x00e5('0x55')][_0x00e5('0x5a')]=!![];_0x6ba039[_0x00e5('0x55')]['readAt']=moment()[_0x00e5('0x5b')](_0x00e5('0x5c'));_0x6ba039[_0x00e5('0x55')][_0x00e5('0x5d')]=_0x6ba039[_0x00e5('0x55')][_0x00e5('0x5d')]||_0x6ba039[_0x00e5('0x5e')]['id'];_0x225f0a[_0x00e5('0x5f')]['id']=_0x6ba039[_0x00e5('0x55')][_0x00e5('0x5d')];return db[_0x00e5('0x48')]['find']({'where':{'id':_0x6ba039[_0x00e5('0x4f')]['id'],'UserId':null}})[_0x00e5('0x20')](handleEntityNotFound(_0x205a54,null))[_0x00e5('0x20')](saveUpdates(_0x6ba039[_0x00e5('0x55')],null))[_0x00e5('0x20')](function(_0x48d18e){if(_0x48d18e){_0x225f0a[_0x00e5('0x27')]=_0x48d18e['get']({'plain':!![]});return db[_0x00e5('0x60')]['find']({'where':{'id':_0x48d18e[_0x00e5('0x61')]}});}return null;})[_0x00e5('0x20')](handleEntityNotFound(_0x205a54,null))['then'](function(_0x1ffb25){if(_0x1ffb25){return _0x1ffb25[_0x00e5('0x33')]({'UserId':_0x6ba039[_0x00e5('0x55')][_0x00e5('0x5d')],'read1stAt':_[_0x00e5('0x62')](_0x1ffb25[_0x00e5('0x63')])?moment()[_0x00e5('0x5b')](_0x00e5('0x5c')):undefined});}return null;})['then'](function(_0x331ee1){if(_0x331ee1){_0x225f0a[_0x00e5('0x64')]=_0x331ee1[_0x00e5('0x65')]({'plain':!![]});interaction_log[_0x00e5('0x21')](_0x00e5('0x66'),_0x6ba039['user']['id'],_0x6ba039['user'][_0x00e5('0x35')],_0x6ba039[_0x00e5('0x5e')][_0x00e5('0x67')],_0x225f0a[_0x00e5('0x64')]['id'],_0x6ba039[_0x00e5('0x55')]?JSON[_0x00e5('0x24')](_0x6ba039[_0x00e5('0x55')]):_0x00e5('0x68'));return respondWithRpcPromise(_0x00e5('0x69'),_0x00e5('0x6a'),_0x225f0a);}return null;})[_0x00e5('0x20')](function(_0x3d4c89){var _0x51458f=_0x00e5('0x6b')+_0x3d4c89['message'][_0x00e5('0x6c')];return db[_0x00e5('0x6d')][_0x00e5('0x3d')](_0x51458f,{'type':db[_0x00e5('0x6e')][_0x00e5('0x6f')][_0x00e5('0x70')],'raw':!![]})[_0x00e5('0x20')](function(_0x1ef659){return _0x1ef659;});})['then'](function(_0x310a75){if(_0x310a75){_0x225f0a[_0x00e5('0x27')][_0x00e5('0x71')]=_0x310a75[0x0];if(!_0x6ba039[_0x00e5('0x55')][_0x00e5('0x5d')])return;return db[_0x00e5('0x72')][_0x00e5('0x53')]({'where':{'id':_0x6ba039[_0x00e5('0x55')][_0x00e5('0x5d')],'role':_0x00e5('0x5f')},'attributes':['id',_0x00e5('0x35'),_0x00e5('0x73'),_0x00e5('0x74'),'internal'],'raw':!![]});}return null;})[_0x00e5('0x20')](function(_0x5e7e37){if(!_0x5e7e37)return null;_0x225f0a[_0x00e5('0x27')][_0x00e5('0x5f')]=_0x5e7e37;return _0x225f0a;})[_0x00e5('0x20')](function(_0x356f1e){if(_0x356f1e){if(_0x6ba039[_0x00e5('0x55')]['manual']){_0x225f0a[_0x00e5('0x27')]['interface']=util[_0x00e5('0x5b')]('SIP/%s',_0x6ba039['user'][_0x00e5('0x35')]);_0x225f0a[_0x00e5('0x27')]['channel']=_0x225f0a['channel'];_0x225f0a[_0x00e5('0x27')][_0x00e5('0x75')]=_0x225f0a['channel'];_0x225f0a['message']['event']=_0x00e5('0x58');return respondWithRpcPromise(_0x00e5('0x76'),_0x00e5('0x76'),{'event':_0x00e5('0x77'),'message':_0x225f0a[_0x00e5('0x27')]},client9002)[_0x00e5('0x20')](function(){return _0x225f0a;});}return _0x225f0a;}return null;})[_0x00e5('0x20')](respondWithResult(_0x205a54,null))[_0x00e5('0x4d')](handleError(_0x205a54,null));};var interaction_log=require(_0x00e5('0x13'))('openchannel-interactions');exports[_0x00e5('0x32')]=function(_0x2cf650,_0x22b44b,_0x2aa08d){var _0x2590f5={'agent':{},'channel':'openchannel'};if(_0x2cf650[_0x00e5('0x55')]['id']){delete _0x2cf650[_0x00e5('0x55')]['id'];}_0x2cf650[_0x00e5('0x55')][_0x00e5('0x5d')]=_0x2cf650[_0x00e5('0x55')]['UserId']||_0x2cf650[_0x00e5('0x5e')]['id'];_0x2590f5['agent']['id']=_0x2cf650[_0x00e5('0x55')][_0x00e5('0x5d')];return db[_0x00e5('0x48')][_0x00e5('0x53')]({'where':{'id':_0x2cf650['params']['id'],'UserId':null}})[_0x00e5('0x20')](handleEntityNotFound(_0x22b44b,null))[_0x00e5('0x20')](function(_0x3206a6){if(_0x3206a6){_0x2590f5[_0x00e5('0x27')]=_0x3206a6[_0x00e5('0x65')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x3206a6['OpenchannelInteractionId']}});}return null;})[_0x00e5('0x20')](handleEntityNotFound(_0x22b44b,null))[_0x00e5('0x20')](function(_0xd31ede){if(_0xd31ede){_0x2590f5['interaction']=_0xd31ede[_0x00e5('0x65')]({'plain':!![]});interaction_log[_0x00e5('0x21')](_0x00e5('0x78'),_0x2cf650[_0x00e5('0x5e')]['id'],_0x2cf650['user'][_0x00e5('0x35')],_0x2cf650['user']['role'],_0x2590f5[_0x00e5('0x64')]['id'],_0x2cf650[_0x00e5('0x55')]?JSON['stringify'](_0x2cf650[_0x00e5('0x55')]):_0x00e5('0x68'));return respondWithRpcPromise(_0x00e5('0x79'),_0x00e5('0x7a'),_0x2590f5);}return null;})[_0x00e5('0x20')](function(_0xf7d23e){var _0x1957a2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xf7d23e[_0x00e5('0x27')]['ContactId'];return db[_0x00e5('0x6d')]['query'](_0x1957a2,{'type':db[_0x00e5('0x6e')][_0x00e5('0x6f')][_0x00e5('0x70')],'raw':!![]})[_0x00e5('0x20')](function(_0x205b72){return _0x205b72;});})[_0x00e5('0x20')](function(_0x1df410){if(_0x1df410){_0x2590f5[_0x00e5('0x27')][_0x00e5('0x71')]=_0x1df410[0x0];if(!_0x2cf650[_0x00e5('0x55')][_0x00e5('0x5d')])return;return db[_0x00e5('0x72')][_0x00e5('0x53')]({'where':{'id':_0x2cf650[_0x00e5('0x55')][_0x00e5('0x5d')],'role':_0x00e5('0x5f')},'attributes':['id',_0x00e5('0x35'),_0x00e5('0x73'),'email',_0x00e5('0x7b')],'raw':!![]});}return null;})[_0x00e5('0x20')](function(_0x4bcf26){if(!_0x4bcf26)return null;_0x2590f5[_0x00e5('0x27')][_0x00e5('0x5f')]=_0x4bcf26;return _0x2590f5;})[_0x00e5('0x20')](function(_0x468d70){if(_0x468d70){_0x468d70[_0x00e5('0x27')][_0x00e5('0x7c')]=util[_0x00e5('0x5b')](_0x00e5('0x7d'),_0x2cf650[_0x00e5('0x5e')]['name']);_0x468d70[_0x00e5('0x27')]['channel']=_0x2590f5['channel'];_0x468d70[_0x00e5('0x27')][_0x00e5('0x75')]=_0x2590f5[_0x00e5('0x7e')];_0x468d70[_0x00e5('0x27')][_0x00e5('0x7f')]='reject';respondWithRpcPromise('EventManager',_0x00e5('0x76'),{'event':'rejectmessage','message':_0x468d70[_0x00e5('0x27')]},client9002);return _0x2590f5;}return null;})['then'](respondWithResult(_0x22b44b,null))[_0x00e5('0x4d')](handleError(_0x22b44b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 60844f9..46f8e6f 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 _0x0a1b=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x33331a,_0x5dd74d){var _0x264e26=function(_0xbd24fc){while(--_0xbd24fc){_0x33331a['push'](_0x33331a['shift']());}};_0x264e26(++_0x5dd74d);}(_0x0a1b,0x1b2));var _0xb0a1=function(_0x59df37,_0x2a3f2a){_0x59df37=_0x59df37-0x0;var _0x4feaf4=_0x0a1b[_0x59df37];return _0x4feaf4;};'use strict';var EventEmitter=require(_0xb0a1('0x0'));var OpenchannelMessage=require(_0xb0a1('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb0a1('0x2')](0x0);var events={'afterCreate':_0xb0a1('0x3'),'afterUpdate':'update','afterDestroy':_0xb0a1('0x4')};function emitEvent(_0x5bacc0){return function(_0x29ccca,_0x361bf8,_0xfb13ac){OpenchannelMessageEvents['emit'](_0x5bacc0+':'+_0x29ccca['id'],_0x29ccca);OpenchannelMessageEvents[_0xb0a1('0x5')](_0x5bacc0,_0x29ccca);_0xfb13ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xb0a1('0x6')](e,emitEvent(event));}}module[_0xb0a1('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0662=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage'];(function(_0x268f26,_0x1202fd){var _0x5cdbc0=function(_0x4c1524){while(--_0x4c1524){_0x268f26['push'](_0x268f26['shift']());}};_0x5cdbc0(++_0x1202fd);}(_0x0662,0x106));var _0x2066=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x0662[_0x1d9aa0];return _0x226868;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x2066('0x0'))['db'][_0x2066('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2066('0x2'),'afterUpdate':'update','afterDestroy':_0x2066('0x3')};function emitEvent(_0x591212){return function(_0x173017,_0x10c74c,_0x2ae953){OpenchannelMessageEvents[_0x2066('0x4')](_0x591212+':'+_0x173017['id'],_0x173017);OpenchannelMessageEvents[_0x2066('0x4')](_0x591212,_0x173017);_0x2ae953(null);};}for(var e in events){if(events[_0x2066('0x5')](e)){var event=events[e];OpenchannelMessage[_0x2066('0x6')](e,emitEvent(event));}}module[_0x2066('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 14057e1..d2d13e8 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 _0x8c7f=['error','secret','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','method','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','catch'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8c7f,0x18d));var _0xf8c7=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x8c7f[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xf8c7('0x0'));var util=require('util');var logger=require(_0xf8c7('0x1'))(_0xf8c7('0x2'));var moment=require(_0xf8c7('0x3'));var BPromise=require(_0xf8c7('0x4'));var rp=require(_0xf8c7('0x5'));var fs=require('fs');var path=require(_0xf8c7('0x6'));var rimraf=require(_0xf8c7('0x7'));var config=require(_0xf8c7('0x8'));var attributes=require(_0xf8c7('0x9'));module[_0xf8c7('0xa')]=function(_0x2f707c,_0x16bfdc){return _0x2f707c['define']('OpenchannelMessage',attributes,{'tableName':_0xf8c7('0xb'),'paranoid':![],'indexes':[{'name':_0xf8c7('0xc'),'fields':[_0xf8c7('0xd')],'type':_0xf8c7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e0567,_0xac6928,_0x686800){var _0x53db27=_0x2f707c[_0xf8c7('0xf')];var _0x17c851=_0x2e0567[_0xf8c7('0x10')]({'plain':!![]});if(_0x17c851[_0xf8c7('0x11')][_0xf8c7('0x12')]()==='in'||_0x17c851[_0xf8c7('0x11')][_0xf8c7('0x12')]()===_0xf8c7('0x13')&&!_0x17c851['secret']&&!_[_0xf8c7('0x14')](_0x17c851[_0xf8c7('0x15')])){_0x53db27[_0xf8c7('0x16')]['findOne']({'where':{'id':_0x17c851[_0xf8c7('0x17')]}})[_0xf8c7('0x18')](function(_0x1b7a78){if(_0x1b7a78){_0x1b7a78[_0xf8c7('0x19')]({'lastMsgAt':_0x17c851['createdAt'],'lastMsgDirection':_0x17c851[_0xf8c7('0x11')]['toLowerCase']()});}})[_0xf8c7('0x1a')](function(_0x43a9ca){console[_0xf8c7('0x1b')](_0x43a9ca);});}if(_0x17c851[_0xf8c7('0x11')]===_0xf8c7('0x13')&&!_0x17c851[_0xf8c7('0x1c')]){var _0x4bd31c;_0x53db27[_0xf8c7('0x1d')]['describe']()[_0xf8c7('0x18')](function(_0x124b77){return _0x53db27[_0xf8c7('0x1e')][_0xf8c7('0x1f')]({'where':{'id':_0x17c851[_0xf8c7('0x20')]},'include':[{'model':_0x53db27[_0xf8c7('0x16')],'as':_0xf8c7('0x21'),'where':{'id':_0x17c851[_0xf8c7('0x17')]},'limit':0x1,'include':[{'model':_0x53db27['CmContact'],'as':_0xf8c7('0x22'),'attributes':_[_0xf8c7('0x23')](_0x124b77)}]}]});})[_0xf8c7('0x18')](function(_0x8605d1){_0x4bd31c=_0x8605d1['get']({'plain':!![]});if(_0x4bd31c&&_0x4bd31c['replyUri']){logger[_0xf8c7('0x24')](_0xf8c7('0x25'),_0xf8c7('0x26'),util[_0xf8c7('0x27')](_0xf8c7('0x28'),_0x17c851['id'],_0x4bd31c[_0xf8c7('0x29')]));if(_0x4bd31c[_0xf8c7('0x21')]&&_0x4bd31c[_0xf8c7('0x21')][_0xf8c7('0x2a')]){_0x17c851[_0xf8c7('0x2b')]=_[_0xf8c7('0x2c')](_0x4bd31c[_0xf8c7('0x21')][0x0],_0xf8c7('0x22'));_0x17c851['Contact']=_0x4bd31c[_0xf8c7('0x21')][0x0][_0xf8c7('0x22')];}var _0xac6928={'method':_0xf8c7('0x2d'),'uri':encodeURI(_0x4bd31c[_0xf8c7('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xac6928[_0xf8c7('0x2e')]){case _0xf8c7('0x2f'):_0xac6928['qs']=_0x17c851;break;case _0xf8c7('0x2d'):_0xac6928['body']=_0x17c851;break;}return rp(_0xac6928)[_0xf8c7('0x18')](function(_0x2d870b){logger[_0xf8c7('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xf8c7('0x26'),util[_0xf8c7('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x17c851['id'],_0x4bd31c[_0xf8c7('0x29')]));if(_0x2d870b[_0xf8c7('0xd')][_0xf8c7('0x30')]&&_0x2d870b[_0xf8c7('0xd')][_0xf8c7('0x30')]!=_0x17c851[_0xf8c7('0x2b')][_0xf8c7('0x30')]){return _0x53db27[_0xf8c7('0x16')][_0xf8c7('0x19')]({'threadId':_0x2d870b['body'][_0xf8c7('0x30')]},{'where':{'id':_0x17c851[_0xf8c7('0x2b')]['id']}});}else{return;}})[_0xf8c7('0x18')](function(){return _0x2e0567['update']({'read':!![]});})[_0xf8c7('0x1a')](function(_0x3f9d8d){logger[_0xf8c7('0x1b')](_0xf8c7('0x25'),_0xf8c7('0x26'),util[_0xf8c7('0x31')](_0x3f9d8d,{'showHidden':![],'depth':null}));_0x686800();});}else{_0x686800();}})[_0xf8c7('0x32')](function(){_0x686800();});}else{_0x686800();}}},'charset':_0xf8c7('0x33'),'collate':_0xf8c7('0x34')});}; \ No newline at end of file +var _0xc664=['toLowerCase','out','secret','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','CmContact','describe','find','OpenchannelAccountId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','method','POST','body','threadId','update','catch','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','FULLTEXT','models','get','direction'];(function(_0x3162f6,_0x695de6){var _0xca3757=function(_0x31a4aa){while(--_0x31a4aa){_0x3162f6['push'](_0x3162f6['shift']());}};_0xca3757(++_0x695de6);}(_0xc664,0x88));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c66('0x0'));var util=require(_0x4c66('0x1'));var logger=require(_0x4c66('0x2'))(_0x4c66('0x3'));var moment=require(_0x4c66('0x4'));var BPromise=require('bluebird');var rp=require(_0x4c66('0x5'));var fs=require('fs');var path=require(_0x4c66('0x6'));var rimraf=require(_0x4c66('0x7'));var config=require(_0x4c66('0x8'));var attributes=require(_0x4c66('0x9'));module[_0x4c66('0xa')]=function(_0x33768b,_0x4ac75d){return _0x33768b[_0x4c66('0xb')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x4c66('0xc'),'fields':['body'],'type':_0x4c66('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x247370,_0x3046ac,_0x320eac){var _0x228874=_0x33768b[_0x4c66('0xe')];var _0x3b199a=_0x247370[_0x4c66('0xf')]({'plain':!![]});if(_0x3b199a[_0x4c66('0x10')][_0x4c66('0x11')]()==='in'||_0x3b199a[_0x4c66('0x10')][_0x4c66('0x11')]()===_0x4c66('0x12')&&!_0x3b199a[_0x4c66('0x13')]&&!_['isNil'](_0x3b199a[_0x4c66('0x14')])){_0x228874[_0x4c66('0x15')]['findOne']({'where':{'id':_0x3b199a[_0x4c66('0x16')]}})[_0x4c66('0x17')](function(_0x2f313b){if(_0x2f313b){_0x2f313b['update']({'lastMsgAt':_0x3b199a['createdAt'],'lastMsgDirection':_0x3b199a[_0x4c66('0x10')][_0x4c66('0x11')]()});}})['catch'](function(_0x552676){console['error'](_0x552676);});}if(_0x3b199a[_0x4c66('0x10')]===_0x4c66('0x12')&&!_0x3b199a['secret']){var _0x1b1b48;_0x228874[_0x4c66('0x18')][_0x4c66('0x19')]()['then'](function(_0xc06d86){return _0x228874['OpenchannelAccount'][_0x4c66('0x1a')]({'where':{'id':_0x3b199a[_0x4c66('0x1b')]},'include':[{'model':_0x228874[_0x4c66('0x15')],'as':'Interactions','where':{'id':_0x3b199a[_0x4c66('0x16')]},'limit':0x1,'include':[{'model':_0x228874[_0x4c66('0x18')],'as':_0x4c66('0x1c'),'attributes':_[_0x4c66('0x1d')](_0xc06d86)}]}]});})[_0x4c66('0x17')](function(_0x242129){_0x1b1b48=_0x242129[_0x4c66('0xf')]({'plain':!![]});if(_0x1b1b48&&_0x1b1b48[_0x4c66('0x1e')]){logger[_0x4c66('0x1f')](_0x4c66('0x20'),_0x4c66('0x21'),util[_0x4c66('0x22')](_0x4c66('0x23'),_0x3b199a['id'],_0x1b1b48['replyUri']));if(_0x1b1b48[_0x4c66('0x24')]&&_0x1b1b48[_0x4c66('0x24')][_0x4c66('0x25')]){_0x3b199a[_0x4c66('0x26')]=_[_0x4c66('0x27')](_0x1b1b48[_0x4c66('0x24')][0x0],_0x4c66('0x1c'));_0x3b199a[_0x4c66('0x1c')]=_0x1b1b48[_0x4c66('0x24')][0x0][_0x4c66('0x1c')];}var _0x3046ac={'method':'POST','uri':encodeURI(_0x1b1b48[_0x4c66('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3046ac[_0x4c66('0x28')]){case'GET':_0x3046ac['qs']=_0x3b199a;break;case _0x4c66('0x29'):_0x3046ac['body']=_0x3b199a;break;}return rp(_0x3046ac)[_0x4c66('0x17')](function(_0x1b50a8){logger[_0x4c66('0x1f')](_0x4c66('0x20'),_0x4c66('0x21'),util[_0x4c66('0x22')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x3b199a['id'],_0x1b1b48[_0x4c66('0x1e')]));if(_0x1b50a8[_0x4c66('0x2a')][_0x4c66('0x2b')]&&_0x1b50a8[_0x4c66('0x2a')][_0x4c66('0x2b')]!=_0x3b199a['Interaction']['threadId']){return _0x228874['OpenchannelInteraction'][_0x4c66('0x2c')]({'threadId':_0x1b50a8[_0x4c66('0x2a')]['threadId']},{'where':{'id':_0x3b199a[_0x4c66('0x26')]['id']}});}else{return;}})[_0x4c66('0x17')](function(){return _0x247370[_0x4c66('0x2c')]({'read':!![]});})[_0x4c66('0x2d')](function(_0x3b89d1){logger[_0x4c66('0x2e')](_0x4c66('0x20'),'afterCreate',util[_0x4c66('0x2f')](_0x3b89d1,{'showHidden':![],'depth':null}));_0x320eac();});}else{_0x320eac();}})[_0x4c66('0x30')](function(){_0x320eac();});}else{_0x320eac();}}},'charset':_0x4c66('0x31'),'collate':_0x4c66('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 7eaeb10..32b06e4 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xe01a45,_0x4ab55a){var _0x290f12=function(_0x5d1123){while(--_0x5d1123){_0xe01a45['push'](_0xe01a45['shift']());}};_0x290f12(++_0x4ab55a);}(_0x2ef3,0xba));var _0x32ef=function(_0x250c0b,_0x5025a1){_0x250c0b=_0x250c0b-0x0;var _0x458132=_0x2ef3[_0x250c0b];return _0x458132;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x1aecc5,_0x2ba839){var _0x3011f4=function(_0x57a029){while(--_0x57a029){_0x1aecc5['push'](_0x1aecc5['shift']());}};_0x3011f4(++_0x2ba839);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e44a3,_0x54c659){_0x5e44a3=_0x5e44a3-0x0;var _0x5b95c5=_0x2ef3[_0x5e44a3];return _0x5b95c5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 424fd22..a791f86 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 _0x934f=['register','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x42fb2a,_0x41bffd){var _0x2f2a7d=function(_0x5ceeb5){while(--_0x5ceeb5){_0x42fb2a['push'](_0x42fb2a['shift']());}};_0x2f2a7d(++_0x41bffd);}(_0x934f,0x1d2));var _0xf934=function(_0x2b37aa,_0x1d40dc){_0x2b37aa=_0x2b37aa-0x0;var _0x52b73d=_0x934f[_0x2b37aa];return _0x52b73d;};'use strict';var OpenchannelMessageEvents=require(_0xf934('0x0'));var events=[_0xf934('0x1'),_0xf934('0x2'),_0xf934('0x3')];function createListener(_0x332d9c,_0x30ff6c){return function(_0x24900e){_0x30ff6c[_0xf934('0x4')](_0x332d9c,_0x24900e);};}function removeListener(_0x225f54,_0x508239){return function(){OpenchannelMessageEvents[_0xf934('0x5')](_0x225f54,_0x508239);};}exports[_0xf934('0x6')]=function(_0x59dd08){for(var _0x4b9d6f=0x0,_0x3f380e=events['length'];_0x4b9d6f<_0x3f380e;_0x4b9d6f++){var _0x259bb7=events[_0x4b9d6f];var _0x4b413e=createListener(_0xf934('0x7')+_0x259bb7,_0x59dd08);OpenchannelMessageEvents['on'](_0x259bb7,_0x4b413e);}}; \ No newline at end of file +var _0x064e=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0x064e,0xd2));var _0xe064=function(_0x1ca945,_0x173383){_0x1ca945=_0x1ca945-0x0;var _0x9d4ff1=_0x064e[_0x1ca945];return _0x9d4ff1;};'use strict';var OpenchannelMessageEvents=require(_0xe064('0x0'));var events=[_0xe064('0x1'),_0xe064('0x2'),_0xe064('0x3')];function createListener(_0x4a19e7,_0x3b38c2){return function(_0x44b43c){_0x3b38c2[_0xe064('0x4')](_0x4a19e7,_0x44b43c);};}function removeListener(_0x53baee,_0xbc366b){return function(){OpenchannelMessageEvents[_0xe064('0x5')](_0x53baee,_0xbc366b);};}exports[_0xe064('0x6')]=function(_0x50b7d7){for(var _0x1382d5=0x0,_0x1bc692=events[_0xe064('0x7')];_0x1382d5<_0x1bc692;_0x1382d5++){var _0x5e6c86=events[_0x1382d5];var _0x1dd035=createListener(_0xe064('0x8')+_0x5e6c86,_0x50b7d7);OpenchannelMessageEvents['on'](_0x5e6c86,_0x1dd035);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 2a595dd..37b0e51 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 _0xd1b7=['../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd1b7,0x181));var _0x7d1b=function(_0x49a4e6,_0x1ffa3c){_0x49a4e6=_0x49a4e6-0x0;var _0x2a23a9=_0xd1b7[_0x49a4e6];return _0x2a23a9;};'use strict';var multer=require(_0x7d1b('0x0'));var util=require(_0x7d1b('0x1'));var path=require(_0x7d1b('0x2'));var timeout=require(_0x7d1b('0x3'));var express=require(_0x7d1b('0x4'));var router=express['Router']();var fs_extra=require(_0x7d1b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7d1b('0x6'));var config=require(_0x7d1b('0x7'));var controller=require(_0x7d1b('0x8'));router['get']('/',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0xa')]);router[_0x7d1b('0xb')](_0x7d1b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x7d1b('0xb')](_0x7d1b('0xd'),auth[_0x7d1b('0x9')](),controller[_0x7d1b('0xe')]);router[_0x7d1b('0xb')](_0x7d1b('0xf'),auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x10')]);router[_0x7d1b('0xb')]('/:id/teams',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x11')]);router[_0x7d1b('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x7d1b('0x12')]('/',auth['isAuthenticated'](),controller[_0x7d1b('0x13')]);router[_0x7d1b('0x12')]('/:id/teams',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x14')]);router[_0x7d1b('0x12')](_0x7d1b('0x15'),auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x16')]);router[_0x7d1b('0x17')]('/:id',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x18')]);router[_0x7d1b('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x7d1b('0x1a')]);router[_0x7d1b('0x19')]('/:id/teams',auth[_0x7d1b('0x9')](),controller['removeTeams']);router[_0x7d1b('0x19')]('/:id/users',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x1488=['./openchannelQueue.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e8d09,_0x290b78){var _0x145fcd=function(_0xcb521b){while(--_0xcb521b){_0x1e8d09['push'](_0x1e8d09['shift']());}};_0x145fcd(++_0x290b78);}(_0x1488,0x14d));var _0x8148=function(_0x2493f7,_0x49c670){_0x2493f7=_0x2493f7-0x0;var _0x594ab2=_0x1488[_0x2493f7];return _0x594ab2;};'use strict';var multer=require(_0x8148('0x0'));var util=require('util');var path=require(_0x8148('0x1'));var timeout=require('connect-timeout');var express=require(_0x8148('0x2'));var router=express[_0x8148('0x3')]();var fs_extra=require(_0x8148('0x4'));var auth=require(_0x8148('0x5'));var interaction=require(_0x8148('0x6'));var config=require(_0x8148('0x7'));var controller=require(_0x8148('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8148('0x9')]);router['get'](_0x8148('0xa'),auth[_0x8148('0xb')](),controller[_0x8148('0xc')]);router[_0x8148('0xd')](_0x8148('0xe'),auth[_0x8148('0xb')](),controller[_0x8148('0xf')]);router[_0x8148('0xd')](_0x8148('0x10'),auth[_0x8148('0xb')](),controller[_0x8148('0x11')]);router[_0x8148('0xd')](_0x8148('0x12'),auth[_0x8148('0xb')](),controller['getTeams']);router['get'](_0x8148('0x13'),auth['isAuthenticated'](),controller[_0x8148('0x14')]);router[_0x8148('0x15')]('/',auth[_0x8148('0xb')](),controller[_0x8148('0x16')]);router[_0x8148('0x15')]('/:id/teams',auth[_0x8148('0xb')](),controller[_0x8148('0x17')]);router['post'](_0x8148('0x13'),auth['isAuthenticated'](),controller[_0x8148('0x18')]);router[_0x8148('0x19')]('/:id',auth[_0x8148('0xb')](),controller[_0x8148('0x1a')]);router[_0x8148('0x1b')]('/:id',auth[_0x8148('0xb')](),controller['destroy']);router[_0x8148('0x1b')](_0x8148('0x12'),auth[_0x8148('0xb')](),controller[_0x8148('0x1c')]);router[_0x8148('0x1b')]('/:id/users',auth[_0x8148('0xb')](),controller[_0x8148('0x1d')]);module[_0x8148('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 279ec86..d61d328 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 _0x40c9=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x42e8e7,_0x34d2ee){var _0x1a99fc=function(_0x7b27c2){while(--_0x7b27c2){_0x42e8e7['push'](_0x42e8e7['shift']());}};_0x1a99fc(++_0x34d2ee);}(_0x40c9,0x195));var _0x940c=function(_0x17a128,_0x204b3a){_0x17a128=_0x17a128-0x0;var _0x5ac1e1=_0x40c9[_0x17a128];return _0x5ac1e1;};'use strict';var Sequelize=require(_0x940c('0x0'));module[_0x940c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x940c('0x2')]},'timeout':{'type':Sequelize[_0x940c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x940c('0x4')](_0x940c('0x5'),'beepall',_0x940c('0x6'))}}; \ No newline at end of file +var _0x7bb6=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0xc9bd13,_0x3ceab7){var _0x3e7481=function(_0x281b77){while(--_0x281b77){_0xc9bd13['push'](_0xc9bd13['shift']());}};_0x3e7481(++_0x3ceab7);}(_0x7bb6,0x10b));var _0x67bb=function(_0x3a7c78,_0x1b8b6b){_0x3a7c78=_0x3a7c78-0x0;var _0x5a7bb2=_0x7bb6[_0x3a7c78];return _0x5a7bb2;};'use strict';var Sequelize=require(_0x67bb('0x0'));module[_0x67bb('0x1')]={'name':{'type':Sequelize[_0x67bb('0x2')],'unique':_0x67bb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x67bb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x67bb('0x5')]('rrmemory',_0x67bb('0x6'),_0x67bb('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 9fdb618..99f4177 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 _0xd4d1=['forEach','emit','userOpenchannelQueue:save','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../mysqldb','defaults','socket.io-emitter','redis','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','then','OpenchannelQueues','end','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','filter','VIRTUAL','options','OpenchannelQueue','include','findAll','rows','includeAll','merge','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','nolimit','addTeams','ids','voicePause','flatMap','Agents','sequelize','transaction','findOrCreate'];(function(_0x4bcaf9,_0x334488){var _0x3a64e1=function(_0x2a1d45){while(--_0x2a1d45){_0x4bcaf9['push'](_0x4bcaf9['shift']());}};_0x3a64e1(++_0x334488);}(_0xd4d1,0x13a));var _0x1d4d=function(_0xc48740,_0x1d6061){_0xc48740=_0xc48740-0x0;var _0x2d19c1=_0xd4d1[_0xc48740];return _0x2d19c1;};'use strict';var emlformat=require(_0x1d4d('0x0'));var rimraf=require(_0x1d4d('0x1'));var zipdir=require(_0x1d4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d4d('0x3'));var BPromise=require(_0x1d4d('0x4'));var Mustache=require(_0x1d4d('0x5'));var util=require(_0x1d4d('0x6'));var path=require(_0x1d4d('0x7'));var sox=require(_0x1d4d('0x8'));var csv=require(_0x1d4d('0x9'));var ejs=require(_0x1d4d('0xa'));var fs=require('fs');var fs_extra=require(_0x1d4d('0xb'));var _=require('lodash');var squel=require(_0x1d4d('0xc'));var crypto=require(_0x1d4d('0xd'));var jsforce=require(_0x1d4d('0xe'));var deskjs=require(_0x1d4d('0xf'));var toCsv=require(_0x1d4d('0x9'));var querystring=require(_0x1d4d('0x10'));var Papa=require('papaparse');var Redis=require(_0x1d4d('0x11'));var authService=require(_0x1d4d('0x12'));var qs=require(_0x1d4d('0x13'));var as=require(_0x1d4d('0x14'));var hardwareService=require(_0x1d4d('0x15'));var logger=require(_0x1d4d('0x16'))(_0x1d4d('0x17'));var utils=require(_0x1d4d('0x18'));var config=require(_0x1d4d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d4d('0x1a'))['db'];config['redis']=_[_0x1d4d('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1d4d('0x1c'))(new Redis(config[_0x1d4d('0x1d')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4ccf7e,_0x475f5b){_0x475f5b=_0x475f5b||0xcc;return function(_0x443eb5){if(_0x443eb5){return _0x4ccf7e[_0x1d4d('0x1e')](_0x475f5b);}return _0x4ccf7e[_0x1d4d('0x1f')](_0x475f5b)['end']();};}function respondWithResult(_0x3c29db,_0x231f51){_0x231f51=_0x231f51||0xc8;return function(_0x3145ac){if(_0x3145ac){return _0x3c29db['status'](_0x231f51)[_0x1d4d('0x20')](_0x3145ac);}};}function respondWithFilteredResult(_0x53437a,_0x5e8ccf){return function(_0x4274d4){if(_0x4274d4){var _0x51e6f9=typeof _0x5e8ccf[_0x1d4d('0x21')]===_0x1d4d('0x22')&&typeof _0x5e8ccf['limit']==='undefined';var _0x5ac407=_0x4274d4['count'];var _0xfff05e=_0x51e6f9?0x0:_0x5e8ccf['offset'];var _0x26af3a=_0x51e6f9?_0x4274d4[_0x1d4d('0x23')]:_0x5e8ccf[_0x1d4d('0x21')]+_0x5e8ccf['limit'];var _0x68fd32;if(_0x26af3a>=_0x5ac407){_0x26af3a=_0x5ac407;_0x68fd32=0xc8;}else{_0x68fd32=0xce;}_0x53437a[_0x1d4d('0x1f')](_0x68fd32);return _0x53437a['set'](_0x1d4d('0x24'),_0xfff05e+'-'+_0x26af3a+'/'+_0x5ac407)[_0x1d4d('0x20')](_0x4274d4);}return null;};}function patchUpdates(_0x34fd1e){return function(_0x3c5e22){try{jsonpatch[_0x1d4d('0x25')](_0x3c5e22,_0x34fd1e,!![]);}catch(_0xff0487){return BPromise[_0x1d4d('0x26')](_0xff0487);}return _0x3c5e22[_0x1d4d('0x27')]();};}function saveUpdates(_0x3992ab,_0x59fa02){return function(_0x257575){if(_0x257575){return _0x257575[_0x1d4d('0x28')](_0x3992ab)['then'](function(_0xb1d3c4){return _0xb1d3c4;});}return null;};}function removeEntity(_0x2da4c8,_0x2af33f){return function(_0x35af03){if(_0x35af03){return _0x35af03[_0x1d4d('0x29')]()[_0x1d4d('0x2a')](function(){var _0x40f3a2=_0x35af03['get']({'plain':!![]});var _0x279883=_0x1d4d('0x2b');return db['UserProfileResource'][_0x1d4d('0x29')]({'where':{'type':_0x279883,'resourceId':_0x40f3a2['id']}})[_0x1d4d('0x2a')](function(){return _0x35af03;});})['then'](function(){_0x2da4c8[_0x1d4d('0x1f')](0xcc)[_0x1d4d('0x2c')]();});}};}function handleEntityNotFound(_0x517fdb,_0x19e1f4){return function(_0x172317){if(!_0x172317){_0x517fdb['sendStatus'](0x194);}return _0x172317;};}function handleError(_0x5c55ad,_0x3b327b){_0x3b327b=_0x3b327b||0x1f4;return function(_0x49a6ec){logger['error'](_0x49a6ec['stack']);if(_0x49a6ec[_0x1d4d('0x2d')]){delete _0x49a6ec[_0x1d4d('0x2d')];}_0x5c55ad[_0x1d4d('0x1f')](_0x3b327b)[_0x1d4d('0x2e')](_0x49a6ec);};}exports[_0x1d4d('0x2f')]=function(_0x16a7ae,_0x106240){var _0xf72a1a={},_0x27d43e={},_0xb33d4f={'count':0x0,'rows':[]};var _0x4c9e1e=_['map'](db['OpenchannelQueue'][_0x1d4d('0x30')],function(_0x739120){return{'name':_0x739120[_0x1d4d('0x31')],'type':_0x739120[_0x1d4d('0x32')][_0x1d4d('0x33')]};});_0x27d43e[_0x1d4d('0x34')]=_[_0x1d4d('0x35')](_0x4c9e1e,_0x1d4d('0x2d'));_0x27d43e['query']=_[_0x1d4d('0x36')](_0x16a7ae[_0x1d4d('0x37')]);_0x27d43e[_0x1d4d('0x38')]=_['intersection'](_0x27d43e[_0x1d4d('0x34')],_0x27d43e[_0x1d4d('0x37')]);_0xf72a1a['attributes']=_[_0x1d4d('0x39')](_0x27d43e['model'],qs['fields'](_0x16a7ae[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0xf72a1a[_0x1d4d('0x3b')]=_0xf72a1a[_0x1d4d('0x3b')][_0x1d4d('0x3c')]?_0xf72a1a[_0x1d4d('0x3b')]:_0x27d43e['model'];if(!_0x16a7ae['query']['hasOwnProperty']('nolimit')){_0xf72a1a[_0x1d4d('0x3d')]=qs[_0x1d4d('0x3d')](_0x16a7ae[_0x1d4d('0x37')][_0x1d4d('0x3d')]);_0xf72a1a[_0x1d4d('0x21')]=qs[_0x1d4d('0x21')](_0x16a7ae['query']['offset']);}_0xf72a1a[_0x1d4d('0x3e')]=qs[_0x1d4d('0x3f')](_0x16a7ae[_0x1d4d('0x37')][_0x1d4d('0x3f')]);_0xf72a1a[_0x1d4d('0x40')]=qs[_0x1d4d('0x38')](_[_0x1d4d('0x41')](_0x16a7ae['query'],_0x27d43e[_0x1d4d('0x38')]),_0x4c9e1e);if(_0x16a7ae['query'][_0x1d4d('0x42')]){_0xf72a1a[_0x1d4d('0x40')]=_['merge'](_0xf72a1a[_0x1d4d('0x40')],{'$or':_['map'](_0x4c9e1e,function(_0x1c3b21){if(_0x1c3b21[_0x1d4d('0x32')]!==_0x1d4d('0x43')){var _0x1397c9={};_0x1397c9[_0x1c3b21[_0x1d4d('0x2d')]]={'$like':'%'+_0x16a7ae[_0x1d4d('0x37')]['filter']+'%'};return _0x1397c9;}})});}_0xf72a1a=_['merge']({},_0xf72a1a,_0x16a7ae[_0x1d4d('0x44')]);var _0x41455a={'where':_0xf72a1a[_0x1d4d('0x40')]};return db[_0x1d4d('0x45')][_0x1d4d('0x23')](_0x41455a)[_0x1d4d('0x2a')](function(_0x38d590){_0xb33d4f['count']=_0x38d590;if(_0x16a7ae[_0x1d4d('0x37')]['includeAll']){_0xf72a1a[_0x1d4d('0x46')]=[{'all':!![]}];}return db[_0x1d4d('0x45')][_0x1d4d('0x47')](_0xf72a1a);})[_0x1d4d('0x2a')](function(_0x40ca2c){_0xb33d4f[_0x1d4d('0x48')]=_0x40ca2c;return _0xb33d4f;})[_0x1d4d('0x2a')](respondWithFilteredResult(_0x106240,_0xf72a1a))['catch'](handleError(_0x106240,null));};exports['show']=function(_0x4752e4,_0x4cf156){var _0xd885f7={'raw':!![],'where':{'id':_0x4752e4['params']['id']}},_0x976c59={};_0x976c59[_0x1d4d('0x34')]=_[_0x1d4d('0x36')](db[_0x1d4d('0x45')][_0x1d4d('0x30')]);_0x976c59[_0x1d4d('0x37')]=_[_0x1d4d('0x36')](_0x4752e4['query']);_0x976c59['filters']=_['intersection'](_0x976c59[_0x1d4d('0x34')],_0x976c59[_0x1d4d('0x37')]);_0xd885f7[_0x1d4d('0x3b')]=_[_0x1d4d('0x39')](_0x976c59[_0x1d4d('0x34')],qs['fields'](_0x4752e4[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0xd885f7[_0x1d4d('0x3b')]=_0xd885f7['attributes'][_0x1d4d('0x3c')]?_0xd885f7['attributes']:_0x976c59[_0x1d4d('0x34')];if(_0x4752e4[_0x1d4d('0x37')][_0x1d4d('0x49')]){_0xd885f7[_0x1d4d('0x46')]=[{'all':!![]}];}_0xd885f7=_[_0x1d4d('0x4a')]({},_0xd885f7,_0x4752e4[_0x1d4d('0x44')]);return db[_0x1d4d('0x45')]['find'](_0xd885f7)['then'](handleEntityNotFound(_0x4cf156,null))[_0x1d4d('0x2a')](respondWithResult(_0x4cf156,null))[_0x1d4d('0x4b')](handleError(_0x4cf156,null));};exports[_0x1d4d('0x4c')]=function(_0x4e204b,_0xbc00bb){return db[_0x1d4d('0x45')][_0x1d4d('0x4c')](_0x4e204b[_0x1d4d('0x4d')],{})['then'](function(_0x3fa76e){var _0x5eeafe=_0x4e204b['user'][_0x1d4d('0x4e')]({'plain':!![]});if(!_0x5eeafe)throw new Error(_0x1d4d('0x4f'));if(_0x5eeafe[_0x1d4d('0x50')]==='user'){var _0x1248e3=_0x3fa76e[_0x1d4d('0x4e')]({'plain':!![]});var _0x190947=_0x1d4d('0x2b');return db[_0x1d4d('0x51')][_0x1d4d('0x52')]({'where':{'name':_0x190947,'userProfileId':_0x5eeafe[_0x1d4d('0x53')]},'raw':!![]})['then'](function(_0x4efc20){if(_0x4efc20&&_0x4efc20[_0x1d4d('0x54')]===0x0){return db[_0x1d4d('0x55')][_0x1d4d('0x4c')]({'name':_0x1248e3[_0x1d4d('0x2d')],'resourceId':_0x1248e3['id'],'type':_0x4efc20[_0x1d4d('0x2d')],'sectionId':_0x4efc20['id']},{})[_0x1d4d('0x2a')](function(){return _0x3fa76e;});}else{return _0x3fa76e;}})[_0x1d4d('0x4b')](function(_0x5ed763){logger[_0x1d4d('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ed763);throw _0x5ed763;});}return _0x3fa76e;})[_0x1d4d('0x2a')](respondWithResult(_0xbc00bb,0xc9))[_0x1d4d('0x4b')](handleError(_0xbc00bb,null));};exports[_0x1d4d('0x28')]=function(_0x2d454f,_0x550649){if(_0x2d454f['body']['id']){delete _0x2d454f[_0x1d4d('0x4d')]['id'];}return db[_0x1d4d('0x45')]['find']({'where':{'id':_0x2d454f['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x550649,null))[_0x1d4d('0x2a')](saveUpdates(_0x2d454f[_0x1d4d('0x4d')],null))[_0x1d4d('0x2a')](respondWithResult(_0x550649,null))[_0x1d4d('0x4b')](handleError(_0x550649,null));};exports['destroy']=function(_0x4e6b2e,_0x14566f){return db[_0x1d4d('0x45')][_0x1d4d('0x52')]({'where':{'id':_0x4e6b2e[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x14566f,null))[_0x1d4d('0x2a')](removeEntity(_0x14566f,null))[_0x1d4d('0x4b')](handleError(_0x14566f,null));};exports[_0x1d4d('0x58')]=function(_0x59d7c0,_0x506eb7){return db['OpenchannelQueue'][_0x1d4d('0x58')]()[_0x1d4d('0x2a')](respondWithResult(_0x506eb7,null))[_0x1d4d('0x4b')](handleError(_0x506eb7,null));};exports[_0x1d4d('0x59')]=function(_0x216492,_0x1b6025,_0x50a227){var _0x14eb47={'raw':!![],'where':{}},_0x4a71f9={},_0x2094ec;return db['OpenchannelQueue'][_0x1d4d('0x5a')]({'where':{'id':_0x216492['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x1b6025,null))[_0x1d4d('0x2a')](function(_0x1e5dbe){if(_0x1e5dbe){_0x2094ec=_0x1e5dbe['get']({'plain':!![]});_0x4a71f9[_0x1d4d('0x34')]=_[_0x1d4d('0x36')](db[_0x1d4d('0x5b')][_0x1d4d('0x30')]);_0x4a71f9['query']=_[_0x1d4d('0x36')](_0x216492[_0x1d4d('0x37')]);_0x4a71f9['filters']=_[_0x1d4d('0x39')](_0x4a71f9[_0x1d4d('0x34')],_0x4a71f9['query']);_0x14eb47['attributes']=_[_0x1d4d('0x39')](_0x4a71f9[_0x1d4d('0x34')],qs['fields'](_0x216492[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0x14eb47[_0x1d4d('0x3b')]=_0x14eb47[_0x1d4d('0x3b')][_0x1d4d('0x3c')]?_0x14eb47['attributes']:_0x4a71f9[_0x1d4d('0x34')];if(!_0x216492['query'][_0x1d4d('0x5c')]('nolimit')){_0x14eb47[_0x1d4d('0x3d')]=qs[_0x1d4d('0x3d')](_0x216492[_0x1d4d('0x37')][_0x1d4d('0x3d')]);_0x14eb47[_0x1d4d('0x21')]=qs[_0x1d4d('0x21')](_0x216492[_0x1d4d('0x37')][_0x1d4d('0x21')]);}_0x14eb47[_0x1d4d('0x3e')]=qs['sort'](_0x216492[_0x1d4d('0x37')]['sort']);_0x14eb47['where']=qs[_0x1d4d('0x38')](_['pick'](_0x216492['query'],_0x4a71f9['filters']));_0x14eb47[_0x1d4d('0x40')][_0x1d4d('0x5d')]=_0x1e5dbe['id'];if(_0x216492['query'][_0x1d4d('0x42')]){_0x14eb47[_0x1d4d('0x40')]=_['merge'](_0x14eb47['where'],{'$or':_[_0x1d4d('0x35')](_0x14eb47['attributes'],function(_0x46161f){var _0x2cb718={};_0x2cb718[_0x46161f]={'$like':'%'+_0x216492[_0x1d4d('0x37')]['filter']+'%'};return _0x2cb718;})});}_0x14eb47=_[_0x1d4d('0x4a')]({},_0x14eb47,_0x216492[_0x1d4d('0x44')]);return db[_0x1d4d('0x5b')][_0x1d4d('0x47')](_0x14eb47);}})['then'](function(_0x502a7a){if(_0x502a7a){return db[_0x1d4d('0x5e')][_0x1d4d('0x5f')]({'where':{'id':_[_0x1d4d('0x35')](_0x502a7a,_0x1d4d('0x60')),'role':_0x1d4d('0x61')},'attributes':['id',_0x1d4d('0x2d'),_0x1d4d('0x62'),_0x1d4d('0x63'),'createdAt']});}})['then'](function(_0xe3e1f2){if(_0xe3e1f2){return{'count':_0xe3e1f2['count'],'rows':_[_0x1d4d('0x35')](_0xe3e1f2[_0x1d4d('0x48')],function(_0x2be4fe){return{'membername':_0x2be4fe[_0x1d4d('0x2d')],'UserId':_0x2be4fe['id'],'queue_name':_0x2094ec[_0x1d4d('0x2d')],'OpenchannelQueueId':_0x2094ec['id'],'interface':util[_0x1d4d('0x64')](_0x1d4d('0x65'),_0x1d4d('0x66'),_0x2be4fe[_0x1d4d('0x2d')]),'penalty':0x0,'paused':_0x2be4fe[_0x1d4d('0x62')],'createdAt':_0x2be4fe[_0x1d4d('0x67')],'updatedAt':_0x2be4fe[_0x1d4d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1d4d('0x2a')](respondWithFilteredResult(_0x1b6025,_0x14eb47))[_0x1d4d('0x4b')](handleError(_0x1b6025,null));};exports[_0x1d4d('0x68')]=function(_0x28f855,_0x31de42,_0x26c4ce){var _0x4471b8={};var _0x2820cc={};var _0x4da0d7;var _0x134ddd;return db['OpenchannelQueue'][_0x1d4d('0x5a')]({'where':{'id':_0x28f855['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x31de42,null))[_0x1d4d('0x2a')](function(_0x3223f7){if(_0x3223f7){_0x4da0d7=_0x3223f7;_0x2820cc[_0x1d4d('0x34')]=_['keys'](db[_0x1d4d('0x69')][_0x1d4d('0x30')]);_0x2820cc[_0x1d4d('0x37')]=_['keys'](_0x28f855[_0x1d4d('0x37')]);_0x2820cc[_0x1d4d('0x38')]=_[_0x1d4d('0x39')](_0x2820cc[_0x1d4d('0x34')],_0x2820cc['query']);_0x4471b8[_0x1d4d('0x3b')]=_[_0x1d4d('0x39')](_0x2820cc[_0x1d4d('0x34')],qs[_0x1d4d('0x3a')](_0x28f855[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0x4471b8[_0x1d4d('0x3b')]=_0x4471b8['attributes'][_0x1d4d('0x3c')]?_0x4471b8[_0x1d4d('0x3b')]:_0x2820cc[_0x1d4d('0x34')];_0x4471b8['order']=qs[_0x1d4d('0x3f')](_0x28f855[_0x1d4d('0x37')]['sort']);_0x4471b8[_0x1d4d('0x40')]=qs[_0x1d4d('0x38')](_[_0x1d4d('0x41')](_0x28f855[_0x1d4d('0x37')],_0x2820cc[_0x1d4d('0x38')]));if(_0x28f855['query'][_0x1d4d('0x42')]){_0x4471b8['where']=_[_0x1d4d('0x4a')](_0x4471b8[_0x1d4d('0x40')],{'$or':_['map'](_0x4471b8[_0x1d4d('0x3b')],function(_0xc09702){var _0x5e70d0={};_0x5e70d0[_0xc09702]={'$like':'%'+_0x28f855[_0x1d4d('0x37')]['filter']+'%'};return _0x5e70d0;})});}_0x4471b8=_['merge']({},_0x4471b8,_0x28f855['options']);return _0x4da0d7['getTeams'](_0x4471b8);}})['then'](function(_0x53b551){if(_0x53b551){_0x134ddd=_0x53b551[_0x1d4d('0x3c')];if(!_0x28f855[_0x1d4d('0x37')][_0x1d4d('0x5c')](_0x1d4d('0x6a'))){_0x4471b8[_0x1d4d('0x3d')]=qs['limit'](_0x28f855[_0x1d4d('0x37')]['limit']);_0x4471b8[_0x1d4d('0x21')]=qs[_0x1d4d('0x21')](_0x28f855[_0x1d4d('0x37')][_0x1d4d('0x21')]);}return _0x4da0d7[_0x1d4d('0x68')](_0x4471b8);}})[_0x1d4d('0x2a')](function(_0x62ba2){if(_0x62ba2){return _0x62ba2?{'count':_0x134ddd,'rows':_0x62ba2}:null;}})[_0x1d4d('0x2a')](respondWithResult(_0x31de42,null))[_0x1d4d('0x4b')](handleError(_0x31de42,null));};exports[_0x1d4d('0x6b')]=function(_0x1b79be,_0xb71841,_0x25d3f6){var _0x232f8d=_0x1b79be['body'][_0x1d4d('0x6c')];return db['Team']['findAll']({'where':{'id':_0x232f8d},'attributes':['id'],'include':[{'model':db[_0x1d4d('0x5e')],'as':'Agents','attributes':['id','name','online',_0x1d4d('0x6d'),'interface'],'raw':!![]}]})[_0x1d4d('0x2a')](function(_0x432715){if(_0x432715){var _0x43404e=_[_0x1d4d('0x6e')](_0x432715,function(_0x429421){var _0x14bc3d=_0x429421[_0x1d4d('0x4e')]({'plain':!![]});return _0x14bc3d[_0x1d4d('0x6f')];});return db[_0x1d4d('0x45')]['find']({'where':{'id':_0x1b79be[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](function(_0x388cdf){return db[_0x1d4d('0x70')][_0x1d4d('0x71')](function(_0x357226){return _0x388cdf[_0x1d4d('0x6b')](_0x232f8d,{'transaction':_0x357226})[_0x1d4d('0x2a')](function(){return BPromise['each'](_0x43404e,function(_0x5a7ce5){return db[_0x1d4d('0x5b')][_0x1d4d('0x72')]({'where':{'UserId':_0x5a7ce5['id'],'OpenchannelQueueId':_0x1b79be[_0x1d4d('0x57')]['id']},'transaction':_0x357226});});})[_0x1d4d('0x2a')](function(){_0x43404e[_0x1d4d('0x73')](function(_0xbe2a2){socket[_0x1d4d('0x74')](_0x1d4d('0x75'),{'UserId':_0xbe2a2['id'],'OpenchannelQueueId':_0x388cdf['id']});});});});});}})[_0x1d4d('0x2a')](respondWithStatusCode(_0xb71841,null))[_0x1d4d('0x4b')](handleError(_0xb71841,null));};exports[_0x1d4d('0x76')]=function(_0x3f614e,_0xb40408,_0x1923cc){return db['Team'][_0x1d4d('0x47')]({'where':{'id':_0x3f614e[_0x1d4d('0x37')][_0x1d4d('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x1d4d('0x5e')],'as':_0x1d4d('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1d4d('0x2a')](handleEntityNotFound(_0xb40408,null))[_0x1d4d('0x2a')](function(_0x52dd07){var _0x413b61=_[_0x1d4d('0x35')](_0x52dd07,'id');var _0x284904=[];var _0x3fc6f9=[];var _0x4350e4=squel['select']();_0x4350e4['field'](_0x1d4d('0x77'))[_0x1d4d('0x78')]('team_has_openchannel_queues','tq')[_0x1d4d('0x79')](_0x1d4d('0x7a'),'ut',_0x1d4d('0x7b'))['where'](_0x1d4d('0x7c'),_0x3f614e['params']['id']);for(var _0x5d8680=0x0;_0x5d8680<_0x52dd07[_0x1d4d('0x3c')];_0x5d8680+=0x1){let _0x191d92=_0x52dd07[_0x5d8680];for(var _0x280d48=0x0;_0x280d48<_0x191d92[_0x1d4d('0x6f')]['length'];_0x280d48+=0x1){let _0x517fa0=_0x191d92[_0x1d4d('0x6f')][_0x280d48];var _0x358c7f=_0x4350e4[_0x1d4d('0x7d')]();_0x358c7f['where']('ut.UserId\x20=\x20?',_0x517fa0['id']);_0x3fc6f9[_0x1d4d('0x7e')](db[_0x1d4d('0x70')][_0x1d4d('0x37')](_0x358c7f[_0x1d4d('0x7f')](),{'type':db[_0x1d4d('0x70')]['QueryTypes'][_0x1d4d('0x80')]})[_0x1d4d('0x2a')](function(_0x53d8e0){if(_0x53d8e0['length']===0x1){return _0x517fa0['id'];}else{var _0x3102bb=_[_0x1d4d('0x81')](_[_0x1d4d('0x35')](_0x53d8e0,_0x1d4d('0x82')),function(_0x1ffa05){return _['includes'](_0x413b61,_0x1ffa05);});if(_0x3102bb){return _0x517fa0['id'];}}}));}}return BPromise[_0x1d4d('0x83')](_0x3fc6f9)[_0x1d4d('0x2a')](function(_0x1e3810){_0x284904=_(_0x284904)[_0x1d4d('0x84')](_0x1e3810)[_0x1d4d('0x85')]()[_0x1d4d('0x86')]();return db[_0x1d4d('0x45')][_0x1d4d('0x52')]({'where':{'id':_0x3f614e[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](function(_0xeb5899){return db[_0x1d4d('0x70')][_0x1d4d('0x71')](function(_0x40b068){return _0xeb5899[_0x1d4d('0x76')](_0x3f614e['query'][_0x1d4d('0x6c')],{'transaction':_0x40b068})['then'](function(){if(!_[_0x1d4d('0x87')](_0x284904)){return _0xeb5899['removeAgents'](_0x284904,{'transaction':_0x40b068});}})['then'](function(){_0x284904[_0x1d4d('0x73')](function(_0x59a5a8){socket[_0x1d4d('0x74')](_0x1d4d('0x88'),{'UserId':_0x59a5a8,'OpenchannelQueueId':_0xeb5899['id']});});});});});});})[_0x1d4d('0x2a')](respondWithStatusCode(_0xb40408,null))[_0x1d4d('0x4b')](handleError(_0xb40408,null));};exports['addAgents']=function(_0x2919ce,_0x1f63aa,_0x1757a2){return db[_0x1d4d('0x45')]['find']({'where':{'id':_0x2919ce[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x1f63aa,null))[_0x1d4d('0x2a')](function(_0x35e185){if(_0x35e185){return _0x35e185[_0x1d4d('0x89')](_0x2919ce[_0x1d4d('0x4d')][_0x1d4d('0x6c')],_[_0x1d4d('0x8a')](_0x2919ce[_0x1d4d('0x4d')],[_0x1d4d('0x6c'),'id'])||{})[_0x1d4d('0x8b')](function(_0xd579c2){for(var _0x21f517=0x0;_0x21f517<_0x2919ce[_0x1d4d('0x4d')]['ids']['length'];_0x21f517+=0x1){socket[_0x1d4d('0x74')](_0x1d4d('0x75'),{'UserId':Number(_0x2919ce[_0x1d4d('0x4d')][_0x1d4d('0x6c')][_0x21f517]),'OpenchannelQueueId':Number(_0x2919ce[_0x1d4d('0x57')]['id'])});}return _0xd579c2;});}})[_0x1d4d('0x2a')](respondWithResult(_0x1f63aa,null))[_0x1d4d('0x4b')](handleError(_0x1f63aa,null));};exports[_0x1d4d('0x8c')]=function(_0x37a428,_0x5bc744,_0x4a43d5){return db[_0x1d4d('0x45')][_0x1d4d('0x52')]({'where':{'id':_0x37a428['params']['id']}})['then'](handleEntityNotFound(_0x5bc744,null))[_0x1d4d('0x2a')](function(_0x16dc8a){if(_0x16dc8a){return _0x16dc8a[_0x1d4d('0x8c')](_0x37a428[_0x1d4d('0x37')]['ids'])[_0x1d4d('0x2a')](function(){if(_[_0x1d4d('0x8d')](_0x37a428[_0x1d4d('0x37')]['ids'])){for(var _0x2cd38b=0x0;_0x2cd38b<_0x37a428['query'][_0x1d4d('0x6c')][_0x1d4d('0x3c')];_0x2cd38b+=0x1){socket[_0x1d4d('0x74')](_0x1d4d('0x88'),{'UserId':Number(_0x37a428['query'][_0x1d4d('0x6c')][_0x2cd38b]),'OpenchannelQueueId':Number(_0x37a428[_0x1d4d('0x57')]['id'])});}}else{socket['emit'](_0x1d4d('0x88'),{'UserId':Number(_0x37a428[_0x1d4d('0x37')][_0x1d4d('0x6c')]),'OpenchannelQueueId':Number(_0x37a428[_0x1d4d('0x57')]['id'])});}});}})[_0x1d4d('0x2a')](respondWithStatusCode(_0x5bc744,null))[_0x1d4d('0x4b')](handleError(_0x5bc744,null));};exports[_0x1d4d('0x8e')]=function(_0x66732a,_0x104001,_0x170254){var _0x39f011={};var _0x554289={};var _0x4db7f7;var _0x159c3c;return db[_0x1d4d('0x45')][_0x1d4d('0x5a')]({'where':{'id':_0x66732a['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x104001,null))[_0x1d4d('0x2a')](function(_0x55f235){if(_0x55f235){_0x4db7f7=_0x55f235;_0x554289[_0x1d4d('0x34')]=_['keys'](db['User'][_0x1d4d('0x30')]);_0x554289[_0x1d4d('0x37')]=_[_0x1d4d('0x36')](_0x66732a[_0x1d4d('0x37')]);_0x554289[_0x1d4d('0x38')]=_[_0x1d4d('0x39')](_0x554289[_0x1d4d('0x34')],_0x554289[_0x1d4d('0x37')]);_0x39f011[_0x1d4d('0x3b')]=_[_0x1d4d('0x39')](_0x554289['model'],qs[_0x1d4d('0x3a')](_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0x39f011[_0x1d4d('0x3b')]=_0x39f011[_0x1d4d('0x3b')][_0x1d4d('0x3c')]?_0x39f011[_0x1d4d('0x3b')]:_0x554289[_0x1d4d('0x34')];_0x39f011['order']=qs['sort'](_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x3f')]);_0x39f011[_0x1d4d('0x40')]=qs[_0x1d4d('0x38')](_['pick'](_0x66732a['query'],_0x554289[_0x1d4d('0x38')]));if(_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x42')]){_0x39f011[_0x1d4d('0x40')]=_[_0x1d4d('0x4a')](_0x39f011['where'],{'$or':_[_0x1d4d('0x35')](_0x39f011[_0x1d4d('0x3b')],function(_0x3e6960){var _0xdb33de={};_0xdb33de[_0x3e6960]={'$like':'%'+_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x42')]+'%'};return _0xdb33de;})});}_0x39f011=_[_0x1d4d('0x4a')]({},_0x39f011,_0x66732a[_0x1d4d('0x44')]);return _0x4db7f7['getAgents'](_0x39f011);}})['then'](function(_0x3d80d8){if(_0x3d80d8){_0x159c3c=_0x3d80d8['length'];if(!_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x5c')](_0x1d4d('0x6a'))){_0x39f011['limit']=qs[_0x1d4d('0x3d')](_0x66732a['query'][_0x1d4d('0x3d')]);_0x39f011['offset']=qs[_0x1d4d('0x21')](_0x66732a['query'][_0x1d4d('0x21')]);}return _0x4db7f7['getAgents'](_0x39f011);}})[_0x1d4d('0x2a')](function(_0x41bc9b){if(_0x41bc9b){return _0x41bc9b?{'count':_0x159c3c,'rows':_0x41bc9b}:null;}})['then'](respondWithResult(_0x104001,null))[_0x1d4d('0x4b')](handleError(_0x104001,null));}; \ No newline at end of file +var _0xf998=['type','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','order','User','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','userOpenchannelQueue:save','Team','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','includes','all','union','compact','value','removeTeams','removeAgents','forEach','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge'];(function(_0xdc2cb4,_0x4fe099){var _0x3ccca5=function(_0x53a66c){while(--_0x53a66c){_0xdc2cb4['push'](_0xdc2cb4['shift']());}};_0x3ccca5(++_0x4fe099);}(_0xf998,0xd7));var _0x8f99=function(_0x2e63e8,_0xed68f5){_0x2e63e8=_0x2e63e8-0x0;var _0x3fe904=_0xf998[_0x2e63e8];return _0x3fe904;};'use strict';var emlformat=require(_0x8f99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f99('0x1'));var jsonpatch=require(_0x8f99('0x2'));var rp=require('request-promise');var moment=require(_0x8f99('0x3'));var BPromise=require(_0x8f99('0x4'));var Mustache=require('mustache');var util=require(_0x8f99('0x5'));var path=require(_0x8f99('0x6'));var sox=require(_0x8f99('0x7'));var csv=require(_0x8f99('0x8'));var ejs=require(_0x8f99('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f99('0xa'));var squel=require(_0x8f99('0xb'));var crypto=require(_0x8f99('0xc'));var jsforce=require(_0x8f99('0xd'));var deskjs=require(_0x8f99('0xe'));var toCsv=require(_0x8f99('0x8'));var querystring=require(_0x8f99('0xf'));var Papa=require('papaparse');var Redis=require(_0x8f99('0x10'));var authService=require(_0x8f99('0x11'));var qs=require(_0x8f99('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f99('0x13'));var logger=require('../../config/logger')(_0x8f99('0x14'));var utils=require(_0x8f99('0x15'));var config=require(_0x8f99('0x16'));var licenseUtil=require(_0x8f99('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8f99('0x18')](config[_0x8f99('0x19')],{'host':_0x8f99('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f99('0x19')]));require(_0x8f99('0x1b'))[_0x8f99('0x1c')](socket);function respondWithStatusCode(_0x2a512d,_0x37d228){_0x37d228=_0x37d228||0xcc;return function(_0x22119d){if(_0x22119d){return _0x2a512d[_0x8f99('0x1d')](_0x37d228);}return _0x2a512d[_0x8f99('0x1e')](_0x37d228)[_0x8f99('0x1f')]();};}function respondWithResult(_0xd21000,_0x5b4d04){_0x5b4d04=_0x5b4d04||0xc8;return function(_0x3b785e){if(_0x3b785e){return _0xd21000['status'](_0x5b4d04)['json'](_0x3b785e);}};}function respondWithFilteredResult(_0xaed1bf,_0x5caace){return function(_0x42f9be){if(_0x42f9be){var _0x2b7adb=typeof _0x5caace[_0x8f99('0x20')]===_0x8f99('0x21')&&typeof _0x5caace[_0x8f99('0x22')]===_0x8f99('0x21');var _0x50b7c0=_0x42f9be[_0x8f99('0x23')];var _0x2ef375=_0x2b7adb?0x0:_0x5caace[_0x8f99('0x20')];var _0x1490b1=_0x2b7adb?_0x42f9be[_0x8f99('0x23')]:_0x5caace[_0x8f99('0x20')]+_0x5caace['limit'];var _0x4a420c;if(_0x1490b1>=_0x50b7c0){_0x1490b1=_0x50b7c0;_0x4a420c=0xc8;}else{_0x4a420c=0xce;}_0xaed1bf[_0x8f99('0x1e')](_0x4a420c);return _0xaed1bf['set']('Content-Range',_0x2ef375+'-'+_0x1490b1+'/'+_0x50b7c0)[_0x8f99('0x24')](_0x42f9be);}return null;};}function patchUpdates(_0xab5225){return function(_0x2a56f3){try{jsonpatch[_0x8f99('0x25')](_0x2a56f3,_0xab5225,!![]);}catch(_0x9f1b8f){return BPromise[_0x8f99('0x26')](_0x9f1b8f);}return _0x2a56f3['save']();};}function saveUpdates(_0x864619,_0xeb7188){return function(_0x33c8f8){if(_0x33c8f8){return _0x33c8f8[_0x8f99('0x27')](_0x864619)[_0x8f99('0x28')](function(_0x27be9a){return _0x27be9a;});}return null;};}function removeEntity(_0x1728dc,_0xba8f6f){return function(_0x2944eb){if(_0x2944eb){return _0x2944eb['destroy']()[_0x8f99('0x28')](function(){var _0x2bc37b=_0x2944eb[_0x8f99('0x29')]({'plain':!![]});var _0x3dd714=_0x8f99('0x2a');return db[_0x8f99('0x2b')][_0x8f99('0x2c')]({'where':{'type':_0x3dd714,'resourceId':_0x2bc37b['id']}})[_0x8f99('0x28')](function(){return _0x2944eb;});})[_0x8f99('0x28')](function(){_0x1728dc[_0x8f99('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bda8b,_0x68e461){return function(_0x4a2b9a){if(!_0x4a2b9a){_0x4bda8b[_0x8f99('0x1d')](0x194);}return _0x4a2b9a;};}function handleError(_0x150695,_0x5e8986){_0x5e8986=_0x5e8986||0x1f4;return function(_0x2f4d4a){logger[_0x8f99('0x2d')](_0x2f4d4a['stack']);if(_0x2f4d4a[_0x8f99('0x2e')]){delete _0x2f4d4a[_0x8f99('0x2e')];}_0x150695[_0x8f99('0x1e')](_0x5e8986)[_0x8f99('0x2f')](_0x2f4d4a);};}exports[_0x8f99('0x30')]=function(_0x274815,_0x2ad143){var _0x2931c4={},_0x355678={},_0x2d9d01={'count':0x0,'rows':[]};var _0x2e434b=_[_0x8f99('0x31')](db[_0x8f99('0x32')][_0x8f99('0x33')],function(_0x53d7df){return{'name':_0x53d7df[_0x8f99('0x34')],'type':_0x53d7df['type'][_0x8f99('0x35')]};});_0x355678[_0x8f99('0x36')]=_[_0x8f99('0x31')](_0x2e434b,'name');_0x355678[_0x8f99('0x37')]=_['keys'](_0x274815[_0x8f99('0x37')]);_0x355678['filters']=_[_0x8f99('0x38')](_0x355678['model'],_0x355678['query']);_0x2931c4[_0x8f99('0x39')]=_['intersection'](_0x355678[_0x8f99('0x36')],qs['fields'](_0x274815['query'][_0x8f99('0x3a')]));_0x2931c4[_0x8f99('0x39')]=_0x2931c4[_0x8f99('0x39')][_0x8f99('0x3b')]?_0x2931c4[_0x8f99('0x39')]:_0x355678[_0x8f99('0x36')];if(!_0x274815[_0x8f99('0x37')]['hasOwnProperty'](_0x8f99('0x3c'))){_0x2931c4[_0x8f99('0x22')]=qs[_0x8f99('0x22')](_0x274815['query'][_0x8f99('0x22')]);_0x2931c4['offset']=qs[_0x8f99('0x20')](_0x274815[_0x8f99('0x37')][_0x8f99('0x20')]);}_0x2931c4['order']=qs[_0x8f99('0x3d')](_0x274815[_0x8f99('0x37')][_0x8f99('0x3d')]);_0x2931c4[_0x8f99('0x3e')]=qs[_0x8f99('0x3f')](_[_0x8f99('0x40')](_0x274815[_0x8f99('0x37')],_0x355678['filters']),_0x2e434b);if(_0x274815[_0x8f99('0x37')][_0x8f99('0x41')]){_0x2931c4[_0x8f99('0x3e')]=_[_0x8f99('0x42')](_0x2931c4[_0x8f99('0x3e')],{'$or':_[_0x8f99('0x31')](_0x2e434b,function(_0x198b0c){if(_0x198b0c[_0x8f99('0x43')]!==_0x8f99('0x44')){var _0x4b8681={};_0x4b8681[_0x198b0c['name']]={'$like':'%'+_0x274815['query']['filter']+'%'};return _0x4b8681;}})});}_0x2931c4=_[_0x8f99('0x42')]({},_0x2931c4,_0x274815[_0x8f99('0x45')]);var _0x52cde3={'where':_0x2931c4[_0x8f99('0x3e')]};return db[_0x8f99('0x32')][_0x8f99('0x23')](_0x52cde3)['then'](function(_0x31dec9){_0x2d9d01[_0x8f99('0x23')]=_0x31dec9;if(_0x274815['query'][_0x8f99('0x46')]){_0x2931c4['include']=[{'all':!![]}];}return db[_0x8f99('0x32')][_0x8f99('0x47')](_0x2931c4);})[_0x8f99('0x28')](function(_0x3e0b99){_0x2d9d01[_0x8f99('0x48')]=_0x3e0b99;return _0x2d9d01;})[_0x8f99('0x28')](respondWithFilteredResult(_0x2ad143,_0x2931c4))[_0x8f99('0x49')](handleError(_0x2ad143,null));};exports[_0x8f99('0x4a')]=function(_0x11fce0,_0x1fc907){var _0x2d8575={'raw':!![],'where':{'id':_0x11fce0['params']['id']}},_0x37c432={};_0x37c432[_0x8f99('0x36')]=_[_0x8f99('0x4b')](db[_0x8f99('0x32')][_0x8f99('0x33')]);_0x37c432[_0x8f99('0x37')]=_['keys'](_0x11fce0[_0x8f99('0x37')]);_0x37c432[_0x8f99('0x3f')]=_[_0x8f99('0x38')](_0x37c432[_0x8f99('0x36')],_0x37c432[_0x8f99('0x37')]);_0x2d8575[_0x8f99('0x39')]=_['intersection'](_0x37c432['model'],qs[_0x8f99('0x3a')](_0x11fce0['query'][_0x8f99('0x3a')]));_0x2d8575[_0x8f99('0x39')]=_0x2d8575[_0x8f99('0x39')]['length']?_0x2d8575[_0x8f99('0x39')]:_0x37c432['model'];if(_0x11fce0[_0x8f99('0x37')][_0x8f99('0x46')]){_0x2d8575[_0x8f99('0x4c')]=[{'all':!![]}];}_0x2d8575=_[_0x8f99('0x42')]({},_0x2d8575,_0x11fce0['options']);return db['OpenchannelQueue'][_0x8f99('0x4d')](_0x2d8575)[_0x8f99('0x28')](handleEntityNotFound(_0x1fc907,null))[_0x8f99('0x28')](respondWithResult(_0x1fc907,null))[_0x8f99('0x49')](handleError(_0x1fc907,null));};exports[_0x8f99('0x4e')]=function(_0x55ff26,_0x2668a8){return db[_0x8f99('0x32')][_0x8f99('0x4e')](_0x55ff26[_0x8f99('0x4f')],{})['then'](function(_0x41081d){var _0x4d2b22=_0x55ff26[_0x8f99('0x50')][_0x8f99('0x29')]({'plain':!![]});if(!_0x4d2b22)throw new Error(_0x8f99('0x51'));if(_0x4d2b22[_0x8f99('0x52')]===_0x8f99('0x50')){var _0x1c18e9=_0x41081d['get']({'plain':!![]});var _0x174864='OpenchannelQueues';return db[_0x8f99('0x53')]['find']({'where':{'name':_0x174864,'userProfileId':_0x4d2b22[_0x8f99('0x54')]},'raw':!![]})[_0x8f99('0x28')](function(_0x22cf28){if(_0x22cf28&&_0x22cf28[_0x8f99('0x55')]===0x0){return db[_0x8f99('0x2b')][_0x8f99('0x4e')]({'name':_0x1c18e9[_0x8f99('0x2e')],'resourceId':_0x1c18e9['id'],'type':_0x22cf28[_0x8f99('0x2e')],'sectionId':_0x22cf28['id']},{})[_0x8f99('0x28')](function(){return _0x41081d;});}else{return _0x41081d;}})[_0x8f99('0x49')](function(_0x38a63a){logger[_0x8f99('0x2d')](_0x8f99('0x56'),_0x38a63a);throw _0x38a63a;});}return _0x41081d;})[_0x8f99('0x28')](respondWithResult(_0x2668a8,0xc9))[_0x8f99('0x49')](handleError(_0x2668a8,null));};exports['update']=function(_0x27397f,_0x362be5){if(_0x27397f[_0x8f99('0x4f')]['id']){delete _0x27397f['body']['id'];}return db[_0x8f99('0x32')][_0x8f99('0x4d')]({'where':{'id':_0x27397f[_0x8f99('0x57')]['id']}})['then'](handleEntityNotFound(_0x362be5,null))['then'](saveUpdates(_0x27397f[_0x8f99('0x4f')],null))[_0x8f99('0x28')](respondWithResult(_0x362be5,null))[_0x8f99('0x49')](handleError(_0x362be5,null));};exports[_0x8f99('0x2c')]=function(_0x23af50,_0x3ff10b){return db[_0x8f99('0x32')][_0x8f99('0x4d')]({'where':{'id':_0x23af50[_0x8f99('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ff10b,null))['then'](removeEntity(_0x3ff10b,null))[_0x8f99('0x49')](handleError(_0x3ff10b,null));};exports[_0x8f99('0x58')]=function(_0x2d8970,_0x37d608){return db[_0x8f99('0x32')]['describe']()[_0x8f99('0x28')](respondWithResult(_0x37d608,null))['catch'](handleError(_0x37d608,null));};exports[_0x8f99('0x59')]=function(_0x46420d,_0x266675,_0x24a5bb){var _0x438ee7={'raw':!![],'where':{}},_0x2635a9={},_0x2d60cc;return db[_0x8f99('0x32')][_0x8f99('0x5a')]({'where':{'id':_0x46420d[_0x8f99('0x57')]['id']}})['then'](handleEntityNotFound(_0x266675,null))[_0x8f99('0x28')](function(_0x5dfd10){if(_0x5dfd10){_0x2d60cc=_0x5dfd10['get']({'plain':!![]});_0x2635a9[_0x8f99('0x36')]=_[_0x8f99('0x4b')](db[_0x8f99('0x5b')]['rawAttributes']);_0x2635a9[_0x8f99('0x37')]=_[_0x8f99('0x4b')](_0x46420d['query']);_0x2635a9[_0x8f99('0x3f')]=_[_0x8f99('0x38')](_0x2635a9[_0x8f99('0x36')],_0x2635a9[_0x8f99('0x37')]);_0x438ee7['attributes']=_[_0x8f99('0x38')](_0x2635a9[_0x8f99('0x36')],qs[_0x8f99('0x3a')](_0x46420d[_0x8f99('0x37')][_0x8f99('0x3a')]));_0x438ee7['attributes']=_0x438ee7[_0x8f99('0x39')][_0x8f99('0x3b')]?_0x438ee7['attributes']:_0x2635a9[_0x8f99('0x36')];if(!_0x46420d[_0x8f99('0x37')][_0x8f99('0x5c')](_0x8f99('0x3c'))){_0x438ee7[_0x8f99('0x22')]=qs[_0x8f99('0x22')](_0x46420d[_0x8f99('0x37')][_0x8f99('0x22')]);_0x438ee7[_0x8f99('0x20')]=qs['offset'](_0x46420d[_0x8f99('0x37')][_0x8f99('0x20')]);}_0x438ee7[_0x8f99('0x5d')]=qs[_0x8f99('0x3d')](_0x46420d[_0x8f99('0x37')][_0x8f99('0x3d')]);_0x438ee7[_0x8f99('0x3e')]=qs['filters'](_['pick'](_0x46420d['query'],_0x2635a9[_0x8f99('0x3f')]));_0x438ee7[_0x8f99('0x3e')]['OpenchannelQueueId']=_0x5dfd10['id'];if(_0x46420d[_0x8f99('0x37')][_0x8f99('0x41')]){_0x438ee7[_0x8f99('0x3e')]=_['merge'](_0x438ee7[_0x8f99('0x3e')],{'$or':_['map'](_0x438ee7['attributes'],function(_0x254f30){var _0x328b47={};_0x328b47[_0x254f30]={'$like':'%'+_0x46420d[_0x8f99('0x37')][_0x8f99('0x41')]+'%'};return _0x328b47;})});}_0x438ee7=_[_0x8f99('0x42')]({},_0x438ee7,_0x46420d[_0x8f99('0x45')]);return db[_0x8f99('0x5b')][_0x8f99('0x47')](_0x438ee7);}})[_0x8f99('0x28')](function(_0x13ca6a){if(_0x13ca6a){return db[_0x8f99('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x13ca6a,_0x8f99('0x5f')),'role':_0x8f99('0x60')},'attributes':['id',_0x8f99('0x2e'),_0x8f99('0x61'),_0x8f99('0x62'),_0x8f99('0x63')]});}})[_0x8f99('0x28')](function(_0x4c651b){if(_0x4c651b){return{'count':_0x4c651b['count'],'rows':_[_0x8f99('0x31')](_0x4c651b[_0x8f99('0x48')],function(_0x15dfad){return{'membername':_0x15dfad[_0x8f99('0x2e')],'UserId':_0x15dfad['id'],'queue_name':_0x2d60cc[_0x8f99('0x2e')],'OpenchannelQueueId':_0x2d60cc['id'],'interface':util[_0x8f99('0x64')](_0x8f99('0x65'),'SIP',_0x15dfad[_0x8f99('0x2e')]),'penalty':0x0,'paused':_0x15dfad[_0x8f99('0x61')],'createdAt':_0x15dfad[_0x8f99('0x63')],'updatedAt':_0x15dfad[_0x8f99('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8f99('0x28')](respondWithFilteredResult(_0x266675,_0x438ee7))['catch'](handleError(_0x266675,null));};exports[_0x8f99('0x66')]=function(_0x1c23bc,_0x4e1c6d,_0x5af8c6){var _0x1fe38a={};var _0x4dbc83={};var _0x5e9e2f;var _0x3e9e46;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x1c23bc[_0x8f99('0x57')]['id']}})[_0x8f99('0x28')](handleEntityNotFound(_0x4e1c6d,null))[_0x8f99('0x28')](function(_0x5ab6a3){if(_0x5ab6a3){_0x5e9e2f=_0x5ab6a3;_0x4dbc83[_0x8f99('0x36')]=_['keys'](db['Team'][_0x8f99('0x33')]);_0x4dbc83[_0x8f99('0x37')]=_[_0x8f99('0x4b')](_0x1c23bc['query']);_0x4dbc83[_0x8f99('0x3f')]=_[_0x8f99('0x38')](_0x4dbc83[_0x8f99('0x36')],_0x4dbc83['query']);_0x1fe38a[_0x8f99('0x39')]=_[_0x8f99('0x38')](_0x4dbc83[_0x8f99('0x36')],qs['fields'](_0x1c23bc[_0x8f99('0x37')][_0x8f99('0x3a')]));_0x1fe38a[_0x8f99('0x39')]=_0x1fe38a[_0x8f99('0x39')]['length']?_0x1fe38a[_0x8f99('0x39')]:_0x4dbc83['model'];_0x1fe38a['order']=qs[_0x8f99('0x3d')](_0x1c23bc['query'][_0x8f99('0x3d')]);_0x1fe38a[_0x8f99('0x3e')]=qs['filters'](_[_0x8f99('0x40')](_0x1c23bc[_0x8f99('0x37')],_0x4dbc83[_0x8f99('0x3f')]));if(_0x1c23bc[_0x8f99('0x37')][_0x8f99('0x41')]){_0x1fe38a[_0x8f99('0x3e')]=_['merge'](_0x1fe38a['where'],{'$or':_[_0x8f99('0x31')](_0x1fe38a[_0x8f99('0x39')],function(_0x1bb6d7){var _0x27694e={};_0x27694e[_0x1bb6d7]={'$like':'%'+_0x1c23bc['query'][_0x8f99('0x41')]+'%'};return _0x27694e;})});}_0x1fe38a=_[_0x8f99('0x42')]({},_0x1fe38a,_0x1c23bc['options']);return _0x5e9e2f[_0x8f99('0x66')](_0x1fe38a);}})[_0x8f99('0x28')](function(_0x148cff){if(_0x148cff){_0x3e9e46=_0x148cff[_0x8f99('0x3b')];if(!_0x1c23bc[_0x8f99('0x37')][_0x8f99('0x5c')](_0x8f99('0x3c'))){_0x1fe38a[_0x8f99('0x22')]=qs[_0x8f99('0x22')](_0x1c23bc[_0x8f99('0x37')]['limit']);_0x1fe38a[_0x8f99('0x20')]=qs['offset'](_0x1c23bc[_0x8f99('0x37')]['offset']);}return _0x5e9e2f[_0x8f99('0x66')](_0x1fe38a);}})[_0x8f99('0x28')](function(_0x531469){if(_0x531469){return _0x531469?{'count':_0x3e9e46,'rows':_0x531469}:null;}})[_0x8f99('0x28')](respondWithResult(_0x4e1c6d,null))[_0x8f99('0x49')](handleError(_0x4e1c6d,null));};exports[_0x8f99('0x67')]=function(_0xca7462,_0x248151,_0x39780d){var _0x112725=_0xca7462['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x112725},'attributes':['id'],'include':[{'model':db[_0x8f99('0x5e')],'as':_0x8f99('0x68'),'attributes':['id',_0x8f99('0x2e'),_0x8f99('0x69'),_0x8f99('0x6a'),_0x8f99('0x6b')],'raw':!![]}]})[_0x8f99('0x28')](function(_0x452cf6){if(_0x452cf6){var _0x3ec733=_[_0x8f99('0x6c')](_0x452cf6,function(_0x1a19a5){var _0x2bc922=_0x1a19a5['get']({'plain':!![]});return _0x2bc922['Agents'];});return db['OpenchannelQueue']['find']({'where':{'id':_0xca7462[_0x8f99('0x57')]['id']}})[_0x8f99('0x28')](function(_0x122798){return db['sequelize'][_0x8f99('0x6d')](function(_0x48be20){return _0x122798[_0x8f99('0x67')](_0x112725,{'transaction':_0x48be20})[_0x8f99('0x28')](function(){return BPromise[_0x8f99('0x6e')](_0x3ec733,function(_0x2e67e6){return db[_0x8f99('0x5b')]['findOrCreate']({'where':{'UserId':_0x2e67e6['id'],'OpenchannelQueueId':_0xca7462[_0x8f99('0x57')]['id']},'transaction':_0x48be20});});})[_0x8f99('0x28')](function(){_0x3ec733['forEach'](function(_0x2f6ef4){socket['emit'](_0x8f99('0x6f'),{'UserId':_0x2f6ef4['id'],'OpenchannelQueueId':_0x122798['id']});});});});});}})['then'](respondWithStatusCode(_0x248151,null))[_0x8f99('0x49')](handleError(_0x248151,null));};exports['removeTeams']=function(_0xd9add1,_0x280e99,_0x1e5aa9){return db[_0x8f99('0x70')][_0x8f99('0x47')]({'where':{'id':_0xd9add1['query'][_0x8f99('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8f99('0x28')](handleEntityNotFound(_0x280e99,null))[_0x8f99('0x28')](function(_0x4652b7){var _0x17f4c1=_[_0x8f99('0x31')](_0x4652b7,'id');var _0x1f4df0=[];var _0xc6ca11=[];var _0x5bed97=squel[_0x8f99('0x72')]();_0x5bed97[_0x8f99('0x73')](_0x8f99('0x74'))[_0x8f99('0x75')](_0x8f99('0x76'),'tq')[_0x8f99('0x77')](_0x8f99('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8f99('0x3e')](_0x8f99('0x79'),_0xd9add1['params']['id']);for(var _0x3e9e4c=0x0;_0x3e9e4c<_0x4652b7[_0x8f99('0x3b')];_0x3e9e4c+=0x1){let _0x920180=_0x4652b7[_0x3e9e4c];for(var _0x39793d=0x0;_0x39793d<_0x920180[_0x8f99('0x68')][_0x8f99('0x3b')];_0x39793d+=0x1){let _0x88e07a=_0x920180['Agents'][_0x39793d];var _0x374412=_0x5bed97[_0x8f99('0x7a')]();_0x374412['where']('ut.UserId\x20=\x20?',_0x88e07a['id']);_0xc6ca11['push'](db[_0x8f99('0x7b')][_0x8f99('0x37')](_0x374412[_0x8f99('0x7c')](),{'type':db['sequelize'][_0x8f99('0x7d')]['SELECT']})['then'](function(_0x52f720){if(_0x52f720['length']===0x1){return _0x88e07a['id'];}else{var _0xe0be52=_['every'](_[_0x8f99('0x31')](_0x52f720,'TeamId'),function(_0xd8e729){return _[_0x8f99('0x7e')](_0x17f4c1,_0xd8e729);});if(_0xe0be52){return _0x88e07a['id'];}}}));}}return BPromise[_0x8f99('0x7f')](_0xc6ca11)[_0x8f99('0x28')](function(_0xcd983c){_0x1f4df0=_(_0x1f4df0)[_0x8f99('0x80')](_0xcd983c)[_0x8f99('0x81')]()[_0x8f99('0x82')]();return db['OpenchannelQueue']['find']({'where':{'id':_0xd9add1[_0x8f99('0x57')]['id']}})['then'](function(_0x1d67b8){return db['sequelize'][_0x8f99('0x6d')](function(_0x232ec9){return _0x1d67b8[_0x8f99('0x83')](_0xd9add1[_0x8f99('0x37')][_0x8f99('0x71')],{'transaction':_0x232ec9})['then'](function(){if(!_['isEmpty'](_0x1f4df0)){return _0x1d67b8[_0x8f99('0x84')](_0x1f4df0,{'transaction':_0x232ec9});}})['then'](function(){_0x1f4df0[_0x8f99('0x85')](function(_0x5c1faa){socket[_0x8f99('0x86')](_0x8f99('0x87'),{'UserId':_0x5c1faa,'OpenchannelQueueId':_0x1d67b8['id']});});});});});});})[_0x8f99('0x28')](respondWithStatusCode(_0x280e99,null))[_0x8f99('0x49')](handleError(_0x280e99,null));};exports[_0x8f99('0x88')]=function(_0x54e2d0,_0x2fb866,_0x7181f5){return db['OpenchannelQueue'][_0x8f99('0x4d')]({'where':{'id':_0x54e2d0[_0x8f99('0x57')]['id']}})['then'](handleEntityNotFound(_0x2fb866,null))['then'](function(_0x29d401){if(_0x29d401){return _0x29d401[_0x8f99('0x88')](_0x54e2d0['body'][_0x8f99('0x71')],_[_0x8f99('0x89')](_0x54e2d0[_0x8f99('0x4f')],[_0x8f99('0x71'),'id'])||{})[_0x8f99('0x8a')](function(_0x3e2d54){for(var _0x987d28=0x0;_0x987d28<_0x54e2d0[_0x8f99('0x4f')]['ids']['length'];_0x987d28+=0x1){socket[_0x8f99('0x86')](_0x8f99('0x6f'),{'UserId':Number(_0x54e2d0['body'][_0x8f99('0x71')][_0x987d28]),'OpenchannelQueueId':Number(_0x54e2d0[_0x8f99('0x57')]['id'])});}return _0x3e2d54;});}})['then'](respondWithResult(_0x2fb866,null))[_0x8f99('0x49')](handleError(_0x2fb866,null));};exports[_0x8f99('0x84')]=function(_0x212830,_0x1f3e54,_0x4590e8){return db[_0x8f99('0x32')]['find']({'where':{'id':_0x212830[_0x8f99('0x57')]['id']}})[_0x8f99('0x28')](handleEntityNotFound(_0x1f3e54,null))['then'](function(_0x4e6442){if(_0x4e6442){return _0x4e6442[_0x8f99('0x84')](_0x212830[_0x8f99('0x37')]['ids'])[_0x8f99('0x28')](function(){if(_[_0x8f99('0x8b')](_0x212830['query'][_0x8f99('0x71')])){for(var _0x192dee=0x0;_0x192dee<_0x212830[_0x8f99('0x37')][_0x8f99('0x71')]['length'];_0x192dee+=0x1){socket[_0x8f99('0x86')]('userOpenchannelQueue:remove',{'UserId':Number(_0x212830[_0x8f99('0x37')][_0x8f99('0x71')][_0x192dee]),'OpenchannelQueueId':Number(_0x212830[_0x8f99('0x57')]['id'])});}}else{socket[_0x8f99('0x86')](_0x8f99('0x87'),{'UserId':Number(_0x212830[_0x8f99('0x37')][_0x8f99('0x71')]),'OpenchannelQueueId':Number(_0x212830[_0x8f99('0x57')]['id'])});}});}})[_0x8f99('0x28')](respondWithStatusCode(_0x1f3e54,null))['catch'](handleError(_0x1f3e54,null));};exports['getAgents']=function(_0x5f2b58,_0x423d77,_0x5e30a8){var _0x1f32c3={};var _0x17b0ed={};var _0x563675;var _0x300c2c;return db[_0x8f99('0x32')][_0x8f99('0x5a')]({'where':{'id':_0x5f2b58['params']['id']}})[_0x8f99('0x28')](handleEntityNotFound(_0x423d77,null))['then'](function(_0x102831){if(_0x102831){_0x563675=_0x102831;_0x17b0ed[_0x8f99('0x36')]=_[_0x8f99('0x4b')](db['User'][_0x8f99('0x33')]);_0x17b0ed['query']=_['keys'](_0x5f2b58[_0x8f99('0x37')]);_0x17b0ed[_0x8f99('0x3f')]=_[_0x8f99('0x38')](_0x17b0ed['model'],_0x17b0ed[_0x8f99('0x37')]);_0x1f32c3[_0x8f99('0x39')]=_[_0x8f99('0x38')](_0x17b0ed[_0x8f99('0x36')],qs[_0x8f99('0x3a')](_0x5f2b58['query'][_0x8f99('0x3a')]));_0x1f32c3[_0x8f99('0x39')]=_0x1f32c3[_0x8f99('0x39')][_0x8f99('0x3b')]?_0x1f32c3['attributes']:_0x17b0ed[_0x8f99('0x36')];_0x1f32c3['order']=qs[_0x8f99('0x3d')](_0x5f2b58[_0x8f99('0x37')][_0x8f99('0x3d')]);_0x1f32c3[_0x8f99('0x3e')]=qs[_0x8f99('0x3f')](_[_0x8f99('0x40')](_0x5f2b58[_0x8f99('0x37')],_0x17b0ed[_0x8f99('0x3f')]));if(_0x5f2b58[_0x8f99('0x37')][_0x8f99('0x41')]){_0x1f32c3[_0x8f99('0x3e')]=_[_0x8f99('0x42')](_0x1f32c3[_0x8f99('0x3e')],{'$or':_[_0x8f99('0x31')](_0x1f32c3[_0x8f99('0x39')],function(_0x35beec){var _0xea258a={};_0xea258a[_0x35beec]={'$like':'%'+_0x5f2b58[_0x8f99('0x37')]['filter']+'%'};return _0xea258a;})});}_0x1f32c3=_['merge']({},_0x1f32c3,_0x5f2b58[_0x8f99('0x45')]);return _0x563675[_0x8f99('0x8c')](_0x1f32c3);}})[_0x8f99('0x28')](function(_0x4547d8){if(_0x4547d8){_0x300c2c=_0x4547d8['length'];if(!_0x5f2b58[_0x8f99('0x37')][_0x8f99('0x5c')]('nolimit')){_0x1f32c3['limit']=qs[_0x8f99('0x22')](_0x5f2b58[_0x8f99('0x37')][_0x8f99('0x22')]);_0x1f32c3['offset']=qs[_0x8f99('0x20')](_0x5f2b58[_0x8f99('0x37')][_0x8f99('0x20')]);}return _0x563675[_0x8f99('0x8c')](_0x1f32c3);}})[_0x8f99('0x28')](function(_0x28e3c6){if(_0x28e3c6){return _0x28e3c6?{'count':_0x300c2c,'rows':_0x28e3c6}:null;}})[_0x8f99('0x28')](respondWithResult(_0x423d77,null))['catch'](handleError(_0x423d77,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1fae285..498cb29 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 _0x6510=['save','update','emit','OpenchannelQueue','setMaxListeners'];(function(_0x7eda84,_0x23feed){var _0x190b93=function(_0x57af55){while(--_0x57af55){_0x7eda84['push'](_0x7eda84['shift']());}};_0x190b93(++_0x23feed);}(_0x6510,0xa3));var _0x0651=function(_0x2eb751,_0xe3afbb){_0x2eb751=_0x2eb751-0x0;var _0x296a71=_0x6510[_0x2eb751];return _0x296a71;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x0651('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0651('0x1')](0x0);var events={'afterCreate':_0x0651('0x2'),'afterUpdate':_0x0651('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16c32e){return function(_0x595f0f,_0x42b325,_0x1d1dcc){OpenchannelQueueEvents[_0x0651('0x4')](_0x16c32e+':'+_0x595f0f['id'],_0x595f0f);OpenchannelQueueEvents[_0x0651('0x4')](_0x16c32e,_0x595f0f);_0x1d1dcc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x5ffe=['remove','emit','hasOwnProperty','exports','events','OpenchannelQueue','update'];(function(_0x337c64,_0x481924){var _0x4b0b1a=function(_0x4a840f){while(--_0x4a840f){_0x337c64['push'](_0x337c64['shift']());}};_0x4b0b1a(++_0x481924);}(_0x5ffe,0x1cb));var _0xe5ff=function(_0x824626,_0x590cd4){_0x824626=_0x824626-0x0;var _0x7247cb=_0x5ffe[_0x824626];return _0x7247cb;};'use strict';var EventEmitter=require(_0xe5ff('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xe5ff('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe5ff('0x2'),'afterDestroy':_0xe5ff('0x3')};function emitEvent(_0x3b0a46){return function(_0x4d47f6,_0x427f44,_0x14c2f3){OpenchannelQueueEvents[_0xe5ff('0x4')](_0x3b0a46+':'+_0x4d47f6['id'],_0x4d47f6);OpenchannelQueueEvents[_0xe5ff('0x4')](_0x3b0a46,_0x4d47f6);_0x14c2f3(null);};}for(var e in events){if(events[_0xe5ff('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xe5ff('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 74bfc9c..24d9793 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 _0xff36=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','../../config/logger'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xff36,0xc1));var _0x6ff3=function(_0x5db96b,_0x612cae){_0x5db96b=_0x5db96b-0x0;var _0x22f779=_0xff36[_0x5db96b];return _0x22f779;};'use strict';var _=require(_0x6ff3('0x0'));var util=require(_0x6ff3('0x1'));var logger=require(_0x6ff3('0x2'))(_0x6ff3('0x3'));var moment=require(_0x6ff3('0x4'));var BPromise=require(_0x6ff3('0x5'));var rp=require(_0x6ff3('0x6'));var fs=require('fs');var path=require(_0x6ff3('0x7'));var rimraf=require(_0x6ff3('0x8'));var config=require(_0x6ff3('0x9'));var attributes=require(_0x6ff3('0xa'));module[_0x6ff3('0xb')]=function(_0xd01d0d,_0x388aa2){return _0xd01d0d[_0x6ff3('0xc')](_0x6ff3('0xd'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc8a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelQueue','openchannel_queues','util','api'];(function(_0x26d398,_0x22f9b0){var _0x3e65f2=function(_0x20c15f){while(--_0x20c15f){_0x26d398['push'](_0x26d398['shift']());}};_0x3e65f2(++_0x22f9b0);}(_0xdc8a,0x132));var _0xadc8=function(_0xc03bed,_0x3fa4d5){_0xc03bed=_0xc03bed-0x0;var _0x4e063d=_0xdc8a[_0xc03bed];return _0x4e063d;};'use strict';var _=require('lodash');var util=require(_0xadc8('0x0'));var logger=require('../../config/logger')(_0xadc8('0x1'));var moment=require(_0xadc8('0x2'));var BPromise=require(_0xadc8('0x3'));var rp=require(_0xadc8('0x4'));var fs=require('fs');var path=require(_0xadc8('0x5'));var rimraf=require(_0xadc8('0x6'));var config=require(_0xadc8('0x7'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x35e5c1,_0x29acba){return _0x35e5c1[_0xadc8('0x8')](_0xadc8('0x9'),attributes,{'tableName':_0xadc8('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 542e1b1..45a0cac 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 _0x7b7e=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetOpenchannelQueue','stringify','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x368fe6,_0x546333){var _0x51b70b=function(_0x3bfd7a){while(--_0x3bfd7a){_0x368fe6['push'](_0x368fe6['shift']());}};_0x51b70b(++_0x546333);}(_0x7b7e,0x17b));var _0xe7b7=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x7b7e[_0x9fb081];return _0x43f8b0;};'use strict';var _=require(_0xe7b7('0x0'));var util=require(_0xe7b7('0x1'));var moment=require(_0xe7b7('0x2'));var BPromise=require(_0xe7b7('0x3'));var rs=require(_0xe7b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7b7('0x5'));var logger=require(_0xe7b7('0x6'))(_0xe7b7('0x7'));var config=require(_0xe7b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe7b7('0x9')][_0xe7b7('0xa')]({'port':0x232a});config[_0xe7b7('0xb')]=_['defaults'](config[_0xe7b7('0xb')],{'host':_0xe7b7('0xc'),'port':0x18eb});var socket=require(_0xe7b7('0xd'))(new Redis(config[_0xe7b7('0xb')]));require(_0xe7b7('0xe'))[_0xe7b7('0xf')](socket);function respondWithRpcPromise(_0x1d131a,_0xda9f85,_0x23c6c4){return new BPromise(function(_0xd8b0bd,_0x573d47){return client['request'](_0x1d131a,_0x23c6c4)[_0xe7b7('0x10')](function(_0x1cc578){logger[_0xe7b7('0x11')](_0xe7b7('0x12'),_0xda9f85,_0xe7b7('0x13'));logger[_0xe7b7('0x14')](_0xe7b7('0x15'),_0xda9f85,_0xe7b7('0x13'),JSON['stringify'](_0x1cc578));if(_0x1cc578[_0xe7b7('0x16')]){if(_0x1cc578['error'][_0xe7b7('0x17')]===0x1f4){logger[_0xe7b7('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0xda9f85,_0x1cc578[_0xe7b7('0x16')][_0xe7b7('0x18')]);return _0x573d47(_0x1cc578[_0xe7b7('0x16')][_0xe7b7('0x18')]);}logger[_0xe7b7('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0xda9f85,_0x1cc578[_0xe7b7('0x16')][_0xe7b7('0x18')]);return _0xd8b0bd(_0x1cc578[_0xe7b7('0x16')]['message']);}else{logger[_0xe7b7('0x11')](_0xe7b7('0x12'),_0xda9f85,_0xe7b7('0x13'));_0xd8b0bd(_0x1cc578['result'][_0xe7b7('0x18')]);}})[_0xe7b7('0x19')](function(_0x4ebd2d){logger['error'](_0xe7b7('0x12'),_0xda9f85,_0x4ebd2d);_0x573d47(_0x4ebd2d);});});}exports['GetOpenchannelQueue']=function(_0x43a76b){var _0x12a792=this;return new Promise(function(_0x4d61cb,_0x138040){return db[_0xe7b7('0x1a')][_0xe7b7('0x1b')]({'raw':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x1d')]===undefined?!![]:![]:!![],'where':_0x43a76b['options']?_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x1e')]||null:null,'attributes':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x1f')]||null:null,'limit':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b['options'][_0xe7b7('0x20')]||null:null,'include':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b[_0xe7b7('0x1c')]['include']?_['map'](_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x21')],function(_0xaee122){return{'model':db[_0xaee122[_0xe7b7('0x22')]],'as':_0xaee122['as'],'attributes':_0xaee122[_0xe7b7('0x1f')],'include':_0xaee122[_0xe7b7('0x21')]?_[_0xe7b7('0x23')](_0xaee122[_0xe7b7('0x21')],function(_0x1085b1){return{'model':db[_0x1085b1['model']],'as':_0x1085b1['as'],'attributes':_0x1085b1[_0xe7b7('0x1f')],'include':_0x1085b1['include']?_[_0xe7b7('0x23')](_0x1085b1[_0xe7b7('0x21')],function(_0x47eed4){return{'model':db[_0x47eed4[_0xe7b7('0x22')]],'as':_0x47eed4['as'],'attributes':_0x47eed4[_0xe7b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0caa){logger[_0xe7b7('0x11')]('GetOpenchannelQueue',_0x43a76b);logger[_0xe7b7('0x14')](_0xe7b7('0x24'),_0x43a76b,JSON[_0xe7b7('0x25')](_0x2b0caa));_0x4d61cb(_0x2b0caa);})[_0xe7b7('0x19')](function(_0x3c272c){logger['error'](_0xe7b7('0x24'),_0x3c272c[_0xe7b7('0x18')],_0x43a76b);_0x138040(_0x12a792[_0xe7b7('0x16')](0x1f4,_0x3c272c[_0xe7b7('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x32de57){var _0x534d9d=this;return new Promise(function(_0x3a70fc,_0x3fad57){return db['OpenchannelQueue'][_0xe7b7('0x26')]({'raw':_0x32de57[_0xe7b7('0x1c')]?_0x32de57[_0xe7b7('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32de57[_0xe7b7('0x1c')]?_0x32de57[_0xe7b7('0x1c')][_0xe7b7('0x1e')]||null:null,'attributes':_0x32de57[_0xe7b7('0x1c')]?_0x32de57[_0xe7b7('0x1c')][_0xe7b7('0x1f')]||null:null,'include':_0x32de57[_0xe7b7('0x1c')]?_0x32de57['options']['include']?_[_0xe7b7('0x23')](_0x32de57['options']['include'],function(_0x63ab35){return{'model':db[_0x63ab35[_0xe7b7('0x22')]],'as':_0x63ab35['as'],'attributes':_0x63ab35['attributes'],'include':_0x63ab35[_0xe7b7('0x21')]?_[_0xe7b7('0x23')](_0x63ab35[_0xe7b7('0x21')],function(_0x1829d2){return{'model':db[_0x1829d2[_0xe7b7('0x22')]],'as':_0x1829d2['as'],'attributes':_0x1829d2['attributes'],'include':_0x1829d2['include']?_[_0xe7b7('0x23')](_0x1829d2[_0xe7b7('0x21')],function(_0x5a3ba3){return{'model':db[_0x5a3ba3['model']],'as':_0x5a3ba3['as'],'attributes':_0x5a3ba3['attributes']};}):[]};}):[]};}):[]:[]})[_0xe7b7('0x10')](function(_0x313d7c){logger[_0xe7b7('0x11')](_0xe7b7('0x27'),_0x32de57);logger[_0xe7b7('0x14')](_0xe7b7('0x27'),_0x32de57,JSON[_0xe7b7('0x25')](_0x313d7c));_0x3a70fc(_0x313d7c);})['catch'](function(_0x1b045b){logger['error']('ShowOpenchannelQueue',_0x1b045b['message'],_0x32de57);_0x3fad57(_0x534d9d['error'](0x1f4,_0x1b045b[_0xe7b7('0x18')]));});});}; \ No newline at end of file +var _0x933a=['./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','debug','stringify','ShowOpenchannelQueue','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x933a,0xb2));var _0xa933=function(_0x1fe355,_0xe414c){_0x1fe355=_0x1fe355-0x0;var _0x325d30=_0x933a[_0x1fe355];return _0x325d30;};'use strict';var _=require(_0xa933('0x0'));var util=require('util');var moment=require(_0xa933('0x1'));var BPromise=require(_0xa933('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa933('0x3'));var db=require(_0xa933('0x4'))['db'];var utils=require(_0xa933('0x5'));var logger=require(_0xa933('0x6'))(_0xa933('0x7'));var config=require(_0xa933('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa933('0x9')]['http']({'port':0x232a});config[_0xa933('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa933('0xb'))(new Redis(config[_0xa933('0xa')]));require(_0xa933('0xc'))[_0xa933('0xd')](socket);function respondWithRpcPromise(_0x4ffbe3,_0x255324,_0x2a43e3){return new BPromise(function(_0xa95de8,_0x4ce125){return client[_0xa933('0xe')](_0x4ffbe3,_0x2a43e3)[_0xa933('0xf')](function(_0x4f6b1c){logger['info'](_0xa933('0x10'),_0x255324,_0xa933('0x11'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x255324,_0xa933('0x11'),JSON['stringify'](_0x4f6b1c));if(_0x4f6b1c[_0xa933('0x12')]){if(_0x4f6b1c['error'][_0xa933('0x13')]===0x1f4){logger[_0xa933('0x12')](_0xa933('0x10'),_0x255324,_0x4f6b1c[_0xa933('0x12')][_0xa933('0x14')]);return _0x4ce125(_0x4f6b1c[_0xa933('0x12')][_0xa933('0x14')]);}logger[_0xa933('0x12')](_0xa933('0x10'),_0x255324,_0x4f6b1c['error'][_0xa933('0x14')]);return _0xa95de8(_0x4f6b1c['error'][_0xa933('0x14')]);}else{logger[_0xa933('0x15')](_0xa933('0x10'),_0x255324,_0xa933('0x11'));_0xa95de8(_0x4f6b1c['result'][_0xa933('0x14')]);}})[_0xa933('0x16')](function(_0x4423cb){logger[_0xa933('0x12')](_0xa933('0x10'),_0x255324,_0x4423cb);_0x4ce125(_0x4423cb);});});}exports[_0xa933('0x17')]=function(_0x21f87b){var _0x57dcd=this;return new Promise(function(_0x33a68f,_0x139092){return db[_0xa933('0x18')][_0xa933('0x19')]({'raw':_0x21f87b['options']?_0x21f87b[_0xa933('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x21f87b['options']?_0x21f87b['options'][_0xa933('0x1b')]||null:null,'attributes':_0x21f87b[_0xa933('0x1a')]?_0x21f87b[_0xa933('0x1a')][_0xa933('0x1c')]||null:null,'limit':_0x21f87b['options']?_0x21f87b['options'][_0xa933('0x1d')]||null:null,'include':_0x21f87b[_0xa933('0x1a')]?_0x21f87b['options'][_0xa933('0x1e')]?_[_0xa933('0x1f')](_0x21f87b[_0xa933('0x1a')][_0xa933('0x1e')],function(_0x5b5854){return{'model':db[_0x5b5854[_0xa933('0x20')]],'as':_0x5b5854['as'],'attributes':_0x5b5854[_0xa933('0x1c')],'include':_0x5b5854['include']?_['map'](_0x5b5854[_0xa933('0x1e')],function(_0x5d64aa){return{'model':db[_0x5d64aa['model']],'as':_0x5d64aa['as'],'attributes':_0x5d64aa[_0xa933('0x1c')],'include':_0x5d64aa[_0xa933('0x1e')]?_[_0xa933('0x1f')](_0x5d64aa[_0xa933('0x1e')],function(_0x1017cc){return{'model':db[_0x1017cc[_0xa933('0x20')]],'as':_0x1017cc['as'],'attributes':_0x1017cc[_0xa933('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa933('0xf')](function(_0x551291){logger[_0xa933('0x15')](_0xa933('0x17'),_0x21f87b);logger[_0xa933('0x21')](_0xa933('0x17'),_0x21f87b,JSON[_0xa933('0x22')](_0x551291));_0x33a68f(_0x551291);})['catch'](function(_0x34582c){logger[_0xa933('0x12')](_0xa933('0x17'),_0x34582c[_0xa933('0x14')],_0x21f87b);_0x139092(_0x57dcd[_0xa933('0x12')](0x1f4,_0x34582c['message']));});});};exports[_0xa933('0x23')]=function(_0x2d60f8){var _0x522c71=this;return new Promise(function(_0x2eae04,_0x56caea){return db[_0xa933('0x18')][_0xa933('0x24')]({'raw':_0x2d60f8[_0xa933('0x1a')]?_0x2d60f8[_0xa933('0x1a')][_0xa933('0x25')]===undefined?!![]:![]:!![],'where':_0x2d60f8[_0xa933('0x1a')]?_0x2d60f8[_0xa933('0x1a')]['where']||null:null,'attributes':_0x2d60f8['options']?_0x2d60f8[_0xa933('0x1a')]['attributes']||null:null,'include':_0x2d60f8['options']?_0x2d60f8['options'][_0xa933('0x1e')]?_['map'](_0x2d60f8[_0xa933('0x1a')]['include'],function(_0x357f02){return{'model':db[_0x357f02[_0xa933('0x20')]],'as':_0x357f02['as'],'attributes':_0x357f02[_0xa933('0x1c')],'include':_0x357f02['include']?_[_0xa933('0x1f')](_0x357f02[_0xa933('0x1e')],function(_0x5cf651){return{'model':db[_0x5cf651[_0xa933('0x20')]],'as':_0x5cf651['as'],'attributes':_0x5cf651[_0xa933('0x1c')],'include':_0x5cf651[_0xa933('0x1e')]?_[_0xa933('0x1f')](_0x5cf651[_0xa933('0x1e')],function(_0x10eeb5){return{'model':db[_0x10eeb5[_0xa933('0x20')]],'as':_0x10eeb5['as'],'attributes':_0x10eeb5[_0xa933('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e30df){logger[_0xa933('0x15')](_0xa933('0x23'),_0x2d60f8);logger[_0xa933('0x21')](_0xa933('0x23'),_0x2d60f8,JSON[_0xa933('0x22')](_0x1e30df));_0x2eae04(_0x1e30df);})[_0xa933('0x16')](function(_0x5328f5){logger[_0xa933('0x12')](_0xa933('0x23'),_0x5328f5[_0xa933('0x14')],_0x2d60f8);_0x56caea(_0x522c71[_0xa933('0x12')](0x1f4,_0x5328f5[_0xa933('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 83215ea..d7f1aea 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 _0x71db=['register','length','./openchannelQueue.events','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71db,0x146));var _0xb71d=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x71db[_0x5c6299];return _0x23b564;};'use strict';var OpenchannelQueueEvents=require(_0xb71d('0x0'));var events=['save',_0xb71d('0x1'),_0xb71d('0x2')];function createListener(_0x42dc24,_0xeecd8e){return function(_0x2fe836){_0xeecd8e[_0xb71d('0x3')](_0x42dc24,_0x2fe836);};}function removeListener(_0x2b0f6d,_0x425020){return function(){OpenchannelQueueEvents['removeListener'](_0x2b0f6d,_0x425020);};}exports[_0xb71d('0x4')]=function(_0x3e48e9){for(var _0x2b9701=0x0,_0x25c8e3=events[_0xb71d('0x5')];_0x2b9701<_0x25c8e3;_0x2b9701++){var _0x5b723f=events[_0x2b9701];var _0x368898=createListener('openchannelQueue:'+_0x5b723f,_0x3e48e9);OpenchannelQueueEvents['on'](_0x5b723f,_0x368898);}}; \ No newline at end of file +var _0x3ed4=['remove','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x283084,_0x37cb84){var _0x15ebc8=function(_0xc55605){while(--_0xc55605){_0x283084['push'](_0x283084['shift']());}};_0x15ebc8(++_0x37cb84);}(_0x3ed4,0xc5));var _0x43ed=function(_0x4d43ee,_0x55edfe){_0x4d43ee=_0x4d43ee-0x0;var _0x233903=_0x3ed4[_0x4d43ee];return _0x233903;};'use strict';var OpenchannelQueueEvents=require(_0x43ed('0x0'));var events=['save',_0x43ed('0x1'),'update'];function createListener(_0xc44379,_0x3a0d6c){return function(_0x365ab1){_0x3a0d6c[_0x43ed('0x2')](_0xc44379,_0x365ab1);};}function removeListener(_0x1bd649,_0x444e94){return function(){OpenchannelQueueEvents[_0x43ed('0x3')](_0x1bd649,_0x444e94);};}exports['register']=function(_0x3872f6){for(var _0x3b6a06=0x0,_0x5e5ccb=events[_0x43ed('0x4')];_0x3b6a06<_0x5e5ccb;_0x3b6a06++){var _0x43a7f3=events[_0x3b6a06];var _0x1f2171=createListener(_0x43ed('0x5')+_0x43a7f3,_0x3872f6);OpenchannelQueueEvents['on'](_0x43a7f3,_0x1f2171);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 65cec09..9c279ef 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 _0xa9c9=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xfdb6b4,_0xf85ff6){var _0x2f0bb9=function(_0x43e348){while(--_0x43e348){_0xfdb6b4['push'](_0xfdb6b4['shift']());}};_0x2f0bb9(++_0xf85ff6);}(_0xa9c9,0x185));var _0x9a9c=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xa9c9[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0x9a9c('0x0'));var util=require(_0x9a9c('0x1'));var path=require(_0x9a9c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a9c('0x3'));var router=express[_0x9a9c('0x4')]();var fs_extra=require(_0x9a9c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9a9c('0x6'));var config=require(_0x9a9c('0x7'));var controller=require(_0x9a9c('0x8'));router[_0x9a9c('0x9')]('/',auth['isAuthenticated'](),controller[_0x9a9c('0xa')]);router[_0x9a9c('0x9')](_0x9a9c('0xb'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0xd')]);router[_0x9a9c('0x9')](_0x9a9c('0xe'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0xf')]);router[_0x9a9c('0x10')]('/',auth[_0x9a9c('0xc')](),controller[_0x9a9c('0x11')]);router[_0x9a9c('0x12')](_0x9a9c('0xe'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0x13')]);router[_0x9a9c('0x14')](_0x9a9c('0xe'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0x15')]);module[_0x9a9c('0x16')]=router; \ No newline at end of file +var _0xb98f=['connect-timeout','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','show','post','put','delete','/:id','destroy','multer','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb98f,0x8a));var _0xfb98=function(_0x458789,_0x575547){_0x458789=_0x458789-0x0;var _0x330fb3=_0xb98f[_0x458789];return _0x330fb3;};'use strict';var multer=require(_0xfb98('0x0'));var util=require('util');var path=require(_0xfb98('0x1'));var timeout=require(_0xfb98('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb98('0x3'));router[_0xfb98('0x4')]('/',auth['isAuthenticated'](),controller[_0xfb98('0x5')]);router[_0xfb98('0x4')](_0xfb98('0x6'),auth[_0xfb98('0x7')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xfb98('0x8')]);router[_0xfb98('0x9')]('/',auth[_0xfb98('0x7')](),controller['create']);router[_0xfb98('0xa')]('/:id',auth[_0xfb98('0x7')](),controller['update']);router[_0xfb98('0xb')](_0xfb98('0xc'),auth[_0xfb98('0x7')](),controller[_0xfb98('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2cb5df7..49105ef 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 _0x9891=['STRING','DATE','exports'];(function(_0x40c98f,_0x538320){var _0x2380b5=function(_0xb737d2){while(--_0xb737d2){_0x40c98f['push'](_0x40c98f['shift']());}};_0x2380b5(++_0x538320);}(_0x9891,0x1ee));var _0x1989=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0x9891[_0x466a1a];return _0x577165;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1989('0x0')]={'uniqueid':{'type':Sequelize[_0x1989('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1989('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1989('0x2')]},'acceptAt':{'type':Sequelize[_0x1989('0x2')]},'exitAt':{'type':Sequelize[_0x1989('0x2')]},'reason':{'type':Sequelize[_0x1989('0x1')]}}; \ No newline at end of file +var _0xa789=['DATE','moment','sequelize','exports','STRING'];(function(_0x2d0d9f,_0x22c0d8){var _0x30243d=function(_0x29a92b){while(--_0x29a92b){_0x2d0d9f['push'](_0x2d0d9f['shift']());}};_0x30243d(++_0x22c0d8);}(_0xa789,0x8d));var _0x9a78=function(_0x558fae,_0x41d064){_0x558fae=_0x558fae-0x0;var _0x44713d=_0xa789[_0x558fae];return _0x44713d;};'use strict';var moment=require(_0x9a78('0x0'));var Sequelize=require(_0x9a78('0x1'));module[_0x9a78('0x2')]={'uniqueid':{'type':Sequelize[_0x9a78('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9a78('0x3')]},'joinAt':{'type':Sequelize[_0x9a78('0x4')]},'leaveAt':{'type':Sequelize[_0x9a78('0x4')]},'acceptAt':{'type':Sequelize[_0x9a78('0x4')]},'exitAt':{'type':Sequelize[_0x9a78('0x4')]},'reason':{'type':Sequelize[_0x9a78('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 8c7bb58..2a054b8 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 _0x9514=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','OpenchannelQueueReport','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x225a75,_0x43c1de){var _0xee995d=function(_0x31a816){while(--_0x31a816){_0x225a75['push'](_0x225a75['shift']());}};_0xee995d(++_0x43c1de);}(_0x9514,0xdc));var _0x4951=function(_0x2b9530,_0x29f882){_0x2b9530=_0x2b9530-0x0;var _0x55c5b3=_0x9514[_0x2b9530];return _0x55c5b3;};'use strict';var emlformat=require(_0x4951('0x0'));var rimraf=require(_0x4951('0x1'));var zipdir=require(_0x4951('0x2'));var jsonpatch=require(_0x4951('0x3'));var rp=require(_0x4951('0x4'));var moment=require(_0x4951('0x5'));var BPromise=require(_0x4951('0x6'));var Mustache=require('mustache');var util=require(_0x4951('0x7'));var path=require(_0x4951('0x8'));var sox=require(_0x4951('0x9'));var csv=require('to-csv');var ejs=require(_0x4951('0xa'));var fs=require('fs');var fs_extra=require(_0x4951('0xb'));var _=require(_0x4951('0xc'));var squel=require(_0x4951('0xd'));var crypto=require(_0x4951('0xe'));var jsforce=require(_0x4951('0xf'));var deskjs=require(_0x4951('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4951('0x11'));var Redis=require(_0x4951('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4951('0x13'));var as=require(_0x4951('0x14'));var hardwareService=require(_0x4951('0x15'));var logger=require('../../config/logger')(_0x4951('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4951('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a4464,_0x1707d6){_0x1707d6=_0x1707d6||0xcc;return function(_0x11d967){if(_0x11d967){return _0x4a4464[_0x4951('0x18')](_0x1707d6);}return _0x4a4464[_0x4951('0x19')](_0x1707d6)[_0x4951('0x1a')]();};}function respondWithResult(_0xac5c0f,_0x137e60){_0x137e60=_0x137e60||0xc8;return function(_0x4545d3){if(_0x4545d3){return _0xac5c0f[_0x4951('0x19')](_0x137e60)['json'](_0x4545d3);}};}function respondWithFilteredResult(_0x1e23a6,_0x15c80a){return function(_0x6e657f){if(_0x6e657f){var _0x5370e1=typeof _0x15c80a['offset']===_0x4951('0x1b')&&typeof _0x15c80a['limit']===_0x4951('0x1b');var _0x34a48b=_0x6e657f['count'];var _0x966185=_0x5370e1?0x0:_0x15c80a[_0x4951('0x1c')];var _0x3d94f9=_0x5370e1?_0x6e657f[_0x4951('0x1d')]:_0x15c80a[_0x4951('0x1c')]+_0x15c80a[_0x4951('0x1e')];var _0xdae97c;if(_0x3d94f9>=_0x34a48b){_0x3d94f9=_0x34a48b;_0xdae97c=0xc8;}else{_0xdae97c=0xce;}_0x1e23a6[_0x4951('0x19')](_0xdae97c);return _0x1e23a6[_0x4951('0x1f')](_0x4951('0x20'),_0x966185+'-'+_0x3d94f9+'/'+_0x34a48b)[_0x4951('0x21')](_0x6e657f);}return null;};}function patchUpdates(_0x3d59da){return function(_0x3adf62){try{jsonpatch[_0x4951('0x22')](_0x3adf62,_0x3d59da,!![]);}catch(_0x1fd206){return BPromise[_0x4951('0x23')](_0x1fd206);}return _0x3adf62[_0x4951('0x24')]();};}function saveUpdates(_0x326f9d,_0x342244){return function(_0x47f8e0){if(_0x47f8e0){return _0x47f8e0['update'](_0x326f9d)[_0x4951('0x25')](function(_0x3682fe){return _0x3682fe;});}return null;};}function removeEntity(_0x739eb,_0x1144e9){return function(_0x100072){if(_0x100072){return _0x100072[_0x4951('0x26')]()[_0x4951('0x25')](function(){_0x739eb[_0x4951('0x19')](0xcc)[_0x4951('0x1a')]();});}};}function handleEntityNotFound(_0x56f597,_0x30faf1){return function(_0x1a4f0b){if(!_0x1a4f0b){_0x56f597[_0x4951('0x18')](0x194);}return _0x1a4f0b;};}function handleError(_0x28c35d,_0x5db529){_0x5db529=_0x5db529||0x1f4;return function(_0x15b228){logger[_0x4951('0x27')](_0x15b228[_0x4951('0x28')]);if(_0x15b228[_0x4951('0x29')]){delete _0x15b228[_0x4951('0x29')];}_0x28c35d[_0x4951('0x19')](_0x5db529)['send'](_0x15b228);};}exports[_0x4951('0x2a')]=function(_0x2f038b,_0x46d950){var _0x289ece={},_0xab6cc3={},_0x23e6b6={'count':0x0,'rows':[]};var _0x584ea7=_[_0x4951('0x2b')](db[_0x4951('0x2c')]['rawAttributes'],function(_0x65e026){return{'name':_0x65e026[_0x4951('0x2d')],'type':_0x65e026['type'][_0x4951('0x2e')]};});_0xab6cc3[_0x4951('0x2f')]=_[_0x4951('0x2b')](_0x584ea7,_0x4951('0x29'));_0xab6cc3[_0x4951('0x30')]=_['keys'](_0x2f038b['query']);_0xab6cc3[_0x4951('0x31')]=_['intersection'](_0xab6cc3[_0x4951('0x2f')],_0xab6cc3[_0x4951('0x30')]);_0x289ece['attributes']=_[_0x4951('0x32')](_0xab6cc3[_0x4951('0x2f')],qs[_0x4951('0x33')](_0x2f038b[_0x4951('0x30')][_0x4951('0x33')]));_0x289ece['attributes']=_0x289ece[_0x4951('0x34')]['length']?_0x289ece['attributes']:_0xab6cc3[_0x4951('0x2f')];if(!_0x2f038b[_0x4951('0x30')][_0x4951('0x35')]('nolimit')){_0x289ece[_0x4951('0x1e')]=qs[_0x4951('0x1e')](_0x2f038b[_0x4951('0x30')][_0x4951('0x1e')]);_0x289ece['offset']=qs[_0x4951('0x1c')](_0x2f038b['query'][_0x4951('0x1c')]);}_0x289ece[_0x4951('0x36')]=qs[_0x4951('0x37')](_0x2f038b[_0x4951('0x30')]['sort']);_0x289ece[_0x4951('0x38')]=qs['filters'](_['pick'](_0x2f038b[_0x4951('0x30')],_0xab6cc3[_0x4951('0x31')]),_0x584ea7);if(_0x2f038b[_0x4951('0x30')][_0x4951('0x39')]){_0x289ece[_0x4951('0x38')]=_[_0x4951('0x3a')](_0x289ece[_0x4951('0x38')],{'$or':_[_0x4951('0x2b')](_0x584ea7,function(_0x481666){if(_0x481666[_0x4951('0x3b')]!==_0x4951('0x3c')){var _0x174e1c={};_0x174e1c[_0x481666[_0x4951('0x29')]]={'$like':'%'+_0x2f038b[_0x4951('0x30')][_0x4951('0x39')]+'%'};return _0x174e1c;}})});}_0x289ece=_['merge']({},_0x289ece,_0x2f038b[_0x4951('0x3d')]);var _0x371730={'where':_0x289ece[_0x4951('0x38')]};return db['OpenchannelQueueReport'][_0x4951('0x1d')](_0x371730)[_0x4951('0x25')](function(_0x4a50cb){_0x23e6b6[_0x4951('0x1d')]=_0x4a50cb;if(_0x2f038b[_0x4951('0x30')][_0x4951('0x3e')]){_0x289ece[_0x4951('0x3f')]=[{'all':!![]}];}return db[_0x4951('0x2c')][_0x4951('0x40')](_0x289ece);})['then'](function(_0x2b43b1){_0x23e6b6[_0x4951('0x41')]=_0x2b43b1;return _0x23e6b6;})[_0x4951('0x25')](respondWithFilteredResult(_0x46d950,_0x289ece))[_0x4951('0x42')](handleError(_0x46d950,null));};exports[_0x4951('0x43')]=function(_0x4b5f68,_0x376d96){var _0x5d65bf={'raw':!![],'where':{'id':_0x4b5f68['params']['id']}},_0x58b007={};_0x58b007[_0x4951('0x2f')]=_[_0x4951('0x44')](db[_0x4951('0x2c')][_0x4951('0x45')]);_0x58b007['query']=_[_0x4951('0x44')](_0x4b5f68[_0x4951('0x30')]);_0x58b007[_0x4951('0x31')]=_['intersection'](_0x58b007[_0x4951('0x2f')],_0x58b007[_0x4951('0x30')]);_0x5d65bf['attributes']=_[_0x4951('0x32')](_0x58b007['model'],qs[_0x4951('0x33')](_0x4b5f68[_0x4951('0x30')][_0x4951('0x33')]));_0x5d65bf[_0x4951('0x34')]=_0x5d65bf['attributes'][_0x4951('0x46')]?_0x5d65bf[_0x4951('0x34')]:_0x58b007[_0x4951('0x2f')];if(_0x4b5f68[_0x4951('0x30')][_0x4951('0x3e')]){_0x5d65bf['include']=[{'all':!![]}];}_0x5d65bf=_['merge']({},_0x5d65bf,_0x4b5f68['options']);return db[_0x4951('0x2c')][_0x4951('0x47')](_0x5d65bf)[_0x4951('0x25')](handleEntityNotFound(_0x376d96,null))[_0x4951('0x25')](respondWithResult(_0x376d96,null))[_0x4951('0x42')](handleError(_0x376d96,null));};exports[_0x4951('0x48')]=function(_0xef37b4,_0x17c18c){return db[_0x4951('0x2c')][_0x4951('0x48')](_0xef37b4[_0x4951('0x49')],{})[_0x4951('0x25')](respondWithResult(_0x17c18c,0xc9))[_0x4951('0x42')](handleError(_0x17c18c,null));};exports['update']=function(_0x3feaa0,_0x5c9d3d){if(_0x3feaa0[_0x4951('0x49')]['id']){delete _0x3feaa0[_0x4951('0x49')]['id'];}return db[_0x4951('0x2c')][_0x4951('0x47')]({'where':{'id':_0x3feaa0['params']['id']}})['then'](handleEntityNotFound(_0x5c9d3d,null))['then'](saveUpdates(_0x3feaa0[_0x4951('0x49')],null))['then'](respondWithResult(_0x5c9d3d,null))[_0x4951('0x42')](handleError(_0x5c9d3d,null));};exports[_0x4951('0x26')]=function(_0x16adc3,_0x3fdb58){return db['OpenchannelQueueReport'][_0x4951('0x47')]({'where':{'id':_0x16adc3[_0x4951('0x4a')]['id']}})[_0x4951('0x25')](handleEntityNotFound(_0x3fdb58,null))[_0x4951('0x25')](removeEntity(_0x3fdb58,null))[_0x4951('0x42')](handleError(_0x3fdb58,null));};exports[_0x4951('0x4b')]=function(_0x81105c,_0x41dfa1){return db[_0x4951('0x2c')][_0x4951('0x4b')]()[_0x4951('0x25')](respondWithResult(_0x41dfa1,null))[_0x4951('0x42')](handleError(_0x41dfa1,null));}; \ No newline at end of file +var _0x70c8=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','count','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x70c8,0x1ab));var _0x870c=function(_0x3ceedb,_0x30aee1){_0x3ceedb=_0x3ceedb-0x0;var _0x1484ec=_0x70c8[_0x3ceedb];return _0x1484ec;};'use strict';var emlformat=require(_0x870c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x870c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x870c('0x2'));var BPromise=require(_0x870c('0x3'));var Mustache=require(_0x870c('0x4'));var util=require(_0x870c('0x5'));var path=require(_0x870c('0x6'));var sox=require('sox');var csv=require(_0x870c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x870c('0x8'));var _=require(_0x870c('0x9'));var squel=require(_0x870c('0xa'));var crypto=require('crypto');var jsforce=require(_0x870c('0xb'));var deskjs=require(_0x870c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x870c('0xd'));var Redis=require('ioredis');var authService=require(_0x870c('0xe'));var qs=require(_0x870c('0xf'));var as=require(_0x870c('0x10'));var hardwareService=require(_0x870c('0x11'));var logger=require(_0x870c('0x12'))(_0x870c('0x13'));var utils=require(_0x870c('0x14'));var config=require(_0x870c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491919,_0x5e8549){_0x5e8549=_0x5e8549||0xcc;return function(_0x4067a4){if(_0x4067a4){return _0x491919[_0x870c('0x16')](_0x5e8549);}return _0x491919[_0x870c('0x17')](_0x5e8549)[_0x870c('0x18')]();};}function respondWithResult(_0x3a7438,_0x2f0f26){_0x2f0f26=_0x2f0f26||0xc8;return function(_0x1f6a0f){if(_0x1f6a0f){return _0x3a7438['status'](_0x2f0f26)[_0x870c('0x19')](_0x1f6a0f);}};}function respondWithFilteredResult(_0x3e94d0,_0x223e56){return function(_0x4cc37a){if(_0x4cc37a){var _0x144f6c=typeof _0x223e56[_0x870c('0x1a')]===_0x870c('0x1b')&&typeof _0x223e56['limit']===_0x870c('0x1b');var _0x10c662=_0x4cc37a['count'];var _0x3183ac=_0x144f6c?0x0:_0x223e56[_0x870c('0x1a')];var _0x5b1c75=_0x144f6c?_0x4cc37a['count']:_0x223e56[_0x870c('0x1a')]+_0x223e56[_0x870c('0x1c')];var _0x216799;if(_0x5b1c75>=_0x10c662){_0x5b1c75=_0x10c662;_0x216799=0xc8;}else{_0x216799=0xce;}_0x3e94d0[_0x870c('0x17')](_0x216799);return _0x3e94d0['set']('Content-Range',_0x3183ac+'-'+_0x5b1c75+'/'+_0x10c662)['json'](_0x4cc37a);}return null;};}function patchUpdates(_0x4fbe56){return function(_0x1db41b){try{jsonpatch['apply'](_0x1db41b,_0x4fbe56,!![]);}catch(_0xaaf8a9){return BPromise[_0x870c('0x1d')](_0xaaf8a9);}return _0x1db41b[_0x870c('0x1e')]();};}function saveUpdates(_0x563b2a,_0x143f95){return function(_0x551482){if(_0x551482){return _0x551482[_0x870c('0x1f')](_0x563b2a)[_0x870c('0x20')](function(_0x27d1fc){return _0x27d1fc;});}return null;};}function removeEntity(_0x433541,_0x28be45){return function(_0x494193){if(_0x494193){return _0x494193[_0x870c('0x21')]()['then'](function(){_0x433541[_0x870c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29332d,_0x3344b2){return function(_0x265899){if(!_0x265899){_0x29332d['sendStatus'](0x194);}return _0x265899;};}function handleError(_0x4afed2,_0x2d6736){_0x2d6736=_0x2d6736||0x1f4;return function(_0x334347){logger['error'](_0x334347[_0x870c('0x22')]);if(_0x334347[_0x870c('0x23')]){delete _0x334347[_0x870c('0x23')];}_0x4afed2[_0x870c('0x17')](_0x2d6736)[_0x870c('0x24')](_0x334347);};}exports[_0x870c('0x25')]=function(_0x493742,_0x2cef84){var _0x3f3e01={},_0x17e9f3={},_0x2cb347={'count':0x0,'rows':[]};var _0x392010=_[_0x870c('0x26')](db['OpenchannelQueueReport'][_0x870c('0x27')],function(_0x77b4f8){return{'name':_0x77b4f8[_0x870c('0x28')],'type':_0x77b4f8[_0x870c('0x29')][_0x870c('0x2a')]};});_0x17e9f3['model']=_[_0x870c('0x26')](_0x392010,_0x870c('0x23'));_0x17e9f3[_0x870c('0x2b')]=_['keys'](_0x493742['query']);_0x17e9f3[_0x870c('0x2c')]=_[_0x870c('0x2d')](_0x17e9f3['model'],_0x17e9f3['query']);_0x3f3e01[_0x870c('0x2e')]=_[_0x870c('0x2d')](_0x17e9f3[_0x870c('0x2f')],qs[_0x870c('0x30')](_0x493742[_0x870c('0x2b')]['fields']));_0x3f3e01[_0x870c('0x2e')]=_0x3f3e01[_0x870c('0x2e')][_0x870c('0x31')]?_0x3f3e01[_0x870c('0x2e')]:_0x17e9f3[_0x870c('0x2f')];if(!_0x493742[_0x870c('0x2b')][_0x870c('0x32')](_0x870c('0x33'))){_0x3f3e01['limit']=qs[_0x870c('0x1c')](_0x493742['query']['limit']);_0x3f3e01['offset']=qs['offset'](_0x493742[_0x870c('0x2b')][_0x870c('0x1a')]);}_0x3f3e01[_0x870c('0x34')]=qs[_0x870c('0x35')](_0x493742[_0x870c('0x2b')][_0x870c('0x35')]);_0x3f3e01[_0x870c('0x36')]=qs[_0x870c('0x2c')](_[_0x870c('0x37')](_0x493742[_0x870c('0x2b')],_0x17e9f3[_0x870c('0x2c')]),_0x392010);if(_0x493742['query'][_0x870c('0x38')]){_0x3f3e01[_0x870c('0x36')]=_[_0x870c('0x39')](_0x3f3e01[_0x870c('0x36')],{'$or':_[_0x870c('0x26')](_0x392010,function(_0x543506){if(_0x543506[_0x870c('0x29')]!==_0x870c('0x3a')){var _0x2d816d={};_0x2d816d[_0x543506[_0x870c('0x23')]]={'$like':'%'+_0x493742['query'][_0x870c('0x38')]+'%'};return _0x2d816d;}})});}_0x3f3e01=_[_0x870c('0x39')]({},_0x3f3e01,_0x493742[_0x870c('0x3b')]);var _0x1c9190={'where':_0x3f3e01[_0x870c('0x36')]};return db[_0x870c('0x3c')][_0x870c('0x3d')](_0x1c9190)[_0x870c('0x20')](function(_0x54a6af){_0x2cb347[_0x870c('0x3d')]=_0x54a6af;if(_0x493742[_0x870c('0x2b')][_0x870c('0x3e')]){_0x3f3e01[_0x870c('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x870c('0x40')](_0x3f3e01);})['then'](function(_0x5dadf5){_0x2cb347['rows']=_0x5dadf5;return _0x2cb347;})[_0x870c('0x20')](respondWithFilteredResult(_0x2cef84,_0x3f3e01))[_0x870c('0x41')](handleError(_0x2cef84,null));};exports[_0x870c('0x42')]=function(_0x51a8d1,_0x15aeff){var _0x3a5a2b={'raw':!![],'where':{'id':_0x51a8d1[_0x870c('0x43')]['id']}},_0x42f506={};_0x42f506[_0x870c('0x2f')]=_[_0x870c('0x44')](db[_0x870c('0x3c')][_0x870c('0x27')]);_0x42f506[_0x870c('0x2b')]=_[_0x870c('0x44')](_0x51a8d1['query']);_0x42f506[_0x870c('0x2c')]=_[_0x870c('0x2d')](_0x42f506[_0x870c('0x2f')],_0x42f506['query']);_0x3a5a2b[_0x870c('0x2e')]=_[_0x870c('0x2d')](_0x42f506[_0x870c('0x2f')],qs[_0x870c('0x30')](_0x51a8d1['query'][_0x870c('0x30')]));_0x3a5a2b[_0x870c('0x2e')]=_0x3a5a2b[_0x870c('0x2e')]['length']?_0x3a5a2b[_0x870c('0x2e')]:_0x42f506[_0x870c('0x2f')];if(_0x51a8d1[_0x870c('0x2b')][_0x870c('0x3e')]){_0x3a5a2b[_0x870c('0x3f')]=[{'all':!![]}];}_0x3a5a2b=_[_0x870c('0x39')]({},_0x3a5a2b,_0x51a8d1[_0x870c('0x3b')]);return db[_0x870c('0x3c')][_0x870c('0x45')](_0x3a5a2b)['then'](handleEntityNotFound(_0x15aeff,null))[_0x870c('0x20')](respondWithResult(_0x15aeff,null))['catch'](handleError(_0x15aeff,null));};exports['create']=function(_0x56d742,_0x17a42a){return db['OpenchannelQueueReport'][_0x870c('0x46')](_0x56d742[_0x870c('0x47')],{})[_0x870c('0x20')](respondWithResult(_0x17a42a,0xc9))[_0x870c('0x41')](handleError(_0x17a42a,null));};exports[_0x870c('0x1f')]=function(_0x4f0988,_0x2888e6){if(_0x4f0988[_0x870c('0x47')]['id']){delete _0x4f0988[_0x870c('0x47')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x4f0988['params']['id']}})[_0x870c('0x20')](handleEntityNotFound(_0x2888e6,null))[_0x870c('0x20')](saveUpdates(_0x4f0988[_0x870c('0x47')],null))['then'](respondWithResult(_0x2888e6,null))[_0x870c('0x41')](handleError(_0x2888e6,null));};exports['destroy']=function(_0x429ab8,_0x300007){return db['OpenchannelQueueReport'][_0x870c('0x45')]({'where':{'id':_0x429ab8['params']['id']}})['then'](handleEntityNotFound(_0x300007,null))[_0x870c('0x20')](removeEntity(_0x300007,null))[_0x870c('0x41')](handleError(_0x300007,null));};exports[_0x870c('0x48')]=function(_0x4ba66a,_0x2c1e5d){return db['OpenchannelQueueReport'][_0x870c('0x48')]()[_0x870c('0x20')](respondWithResult(_0x2c1e5d,null))[_0x870c('0x41')](handleError(_0x2c1e5d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 3a1e2cb..7a67057 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(_0x440845,_0x3eeadc){var _0x3248c3=function(_0x136de2){while(--_0x136de2){_0x440845['push'](_0x440845['shift']());}};_0x3248c3(++_0x3eeadc);}(_0x7a54,0x106));var _0x47a5=function(_0x47a6be,_0x1e6345){_0x47a6be=_0x47a6be-0x0;var _0x57879b=_0x7a54[_0x47a6be];return _0x57879b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x1ba26c,_0x48c00c){var _0x48d555=function(_0x2c0514){while(--_0x2c0514){_0x1ba26c['push'](_0x1ba26c['shift']());}};_0x48d555(++_0x48c00c);}(_0x1261,0x144));var _0x1126=function(_0x4c67b8,_0x571e13){_0x4c67b8=_0x4c67b8-0x0;var _0xbc26e=_0x1261[_0x4c67b8];return _0xbc26e;};'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')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 3854007..4b8f8d8 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 _0xd26f=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','update','body','attributes','limit','then','UpdateOpenchannelQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x42f666,_0x260dd3){var _0x500c39=function(_0xa88d60){while(--_0xa88d60){_0x42f666['push'](_0x42f666['shift']());}};_0x500c39(++_0x260dd3);}(_0xd26f,0x113));var _0xfd26=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xd26f[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd26('0x2'));var fs=require('fs');var Redis=require(_0xfd26('0x3'));var db=require(_0xfd26('0x4'))['db'];var utils=require(_0xfd26('0x5'));var logger=require(_0xfd26('0x6'))(_0xfd26('0x7'));var config=require(_0xfd26('0x8'));var jayson=require(_0xfd26('0x9'));var client=jayson[_0xfd26('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b353,_0x3c148d,_0x1905a2){return new BPromise(function(_0x3d405f,_0x3c9154){return client[_0xfd26('0xb')](_0x22b353,_0x1905a2)['then'](function(_0xcf2fdb){logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));logger[_0xfd26('0xf')](_0xfd26('0x10'),_0x3c148d,'request\x20sent',JSON[_0xfd26('0x11')](_0xcf2fdb));if(_0xcf2fdb['error']){if(_0xcf2fdb[_0xfd26('0x12')]['code']===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3c148d,_0xcf2fdb['error']['message']);return _0x3c9154(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}logger[_0xfd26('0x12')](_0xfd26('0xd'),_0x3c148d,_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);return _0x3d405f(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}else{logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));_0x3d405f(_0xcf2fdb[_0xfd26('0x14')][_0xfd26('0x13')]);}})[_0xfd26('0x15')](function(_0x2f9b37){logger['error'](_0xfd26('0xd'),_0x3c148d,_0x2f9b37);_0x3c9154(_0x2f9b37);});});}exports[_0xfd26('0x16')]=function(_0xeb7aeb){var _0x210dd4=this;return new Promise(function(_0x36a275,_0x5b3e8b){return db[_0xfd26('0x17')]['create'](_0xeb7aeb['body'],{'raw':_0xeb7aeb['options']?_0xeb7aeb[_0xfd26('0x18')][_0xfd26('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x523cbe){logger[_0xfd26('0xc')](_0xfd26('0x16'),_0xeb7aeb);logger['debug'](_0xfd26('0x16'),_0xeb7aeb,JSON['stringify'](_0x523cbe));_0x36a275(_0x523cbe);})[_0xfd26('0x15')](function(_0x531bf7){logger[_0xfd26('0x12')]('CreateOpenchannelQueueReport',_0x531bf7[_0xfd26('0x13')],_0xeb7aeb);_0x5b3e8b(_0x210dd4[_0xfd26('0x12')](0x1f4,_0x531bf7['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1194c2){var _0x4bc02c=this;return new Promise(function(_0x1d62c5,_0xebbab7){return db[_0xfd26('0x17')][_0xfd26('0x1a')](_0x1194c2[_0xfd26('0x1b')],{'raw':_0x1194c2['options']?_0x1194c2[_0xfd26('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')]['where']||null:null,'attributes':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')][_0xfd26('0x1c')]||null:null,'limit':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')][_0xfd26('0x1d')]||null:null})[_0xfd26('0x1e')](function(_0x565c0){logger[_0xfd26('0xc')]('UpdateOpenchannelQueueReport',_0x1194c2);logger['debug']('UpdateOpenchannelQueueReport',_0x1194c2,JSON['stringify'](_0x565c0));_0x1d62c5(_0x565c0);})[_0xfd26('0x15')](function(_0x5d0101){logger[_0xfd26('0x12')](_0xfd26('0x1f'),_0x5d0101['message'],_0x1194c2);_0xebbab7(_0x4bc02c['error'](0x1f4,_0x5d0101[_0xfd26('0x13')]));});});}; \ No newline at end of file +var _0x26f9=['rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','options','CreateOpenchannelQueueReport','update','body','where','attributes','UpdateOpenchannelQueueReport','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x192c68,_0x1071c9){var _0xf894bb=function(_0x450fe9){while(--_0x450fe9){_0x192c68['push'](_0x192c68['shift']());}};_0xf894bb(++_0x1071c9);}(_0x26f9,0x16f));var _0x926f=function(_0x3a5248,_0x34e201){_0x3a5248=_0x3a5248-0x0;var _0x4175a1=_0x26f9[_0x3a5248];return _0x4175a1;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var moment=require('moment');var BPromise=require(_0x926f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x926f('0x3'))['db'];var utils=require(_0x926f('0x4'));var logger=require('../../config/logger')(_0x926f('0x5'));var config=require(_0x926f('0x6'));var jayson=require(_0x926f('0x7'));var client=jayson[_0x926f('0x8')][_0x926f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2ded,_0xf56fcb,_0x1e455d){return new BPromise(function(_0x41a7ed,_0x2af11e){return client['request'](_0x3d2ded,_0x1e455d)[_0x926f('0xa')](function(_0x593c13){logger[_0x926f('0xb')](_0x926f('0xc'),_0xf56fcb,'request\x20sent');logger[_0x926f('0xd')](_0x926f('0xe'),_0xf56fcb,_0x926f('0xf'),JSON[_0x926f('0x10')](_0x593c13));if(_0x593c13[_0x926f('0x11')]){if(_0x593c13['error'][_0x926f('0x12')]===0x1f4){logger[_0x926f('0x11')](_0x926f('0xc'),_0xf56fcb,_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);return _0x2af11e(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x593c13['error'][_0x926f('0x13')]);return _0x41a7ed(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}else{logger[_0x926f('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x926f('0xf'));_0x41a7ed(_0x593c13[_0x926f('0x14')]['message']);}})[_0x926f('0x15')](function(_0x52865b){logger[_0x926f('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf56fcb,_0x52865b);_0x2af11e(_0x52865b);});});}exports['CreateOpenchannelQueueReport']=function(_0x36ead3){var _0xab29b3=this;return new Promise(function(_0x4f25e3,_0x3ed07d){return db[_0x926f('0x16')][_0x926f('0x17')](_0x36ead3['body'],{'raw':_0x36ead3[_0x926f('0x18')]?_0x36ead3[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x926f('0xa')](function(_0x4241ac){logger['info'](_0x926f('0x19'),_0x36ead3);logger[_0x926f('0xd')](_0x926f('0x19'),_0x36ead3,JSON[_0x926f('0x10')](_0x4241ac));_0x4f25e3(_0x4241ac);})[_0x926f('0x15')](function(_0x3b7179){logger[_0x926f('0x11')](_0x926f('0x19'),_0x3b7179[_0x926f('0x13')],_0x36ead3);_0x3ed07d(_0xab29b3[_0x926f('0x11')](0x1f4,_0x3b7179[_0x926f('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2d76eb){var _0x151f71=this;return new Promise(function(_0x53f10c,_0x640fe0){return db[_0x926f('0x16')][_0x926f('0x1a')](_0x2d76eb[_0x926f('0x1b')],{'raw':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb['options'][_0x926f('0x1c')]||null:null,'attributes':_0x2d76eb[_0x926f('0x18')]?_0x2d76eb[_0x926f('0x18')][_0x926f('0x1d')]||null:null,'limit':_0x2d76eb['options']?_0x2d76eb[_0x926f('0x18')]['limit']||null:null})[_0x926f('0xa')](function(_0x2556ce){logger['info']('UpdateOpenchannelQueueReport',_0x2d76eb);logger[_0x926f('0xd')](_0x926f('0x1e'),_0x2d76eb,JSON['stringify'](_0x2556ce));_0x53f10c(_0x2556ce);})[_0x926f('0x15')](function(_0xb6b509){logger['error']('UpdateOpenchannelQueueReport',_0xb6b509[_0x926f('0x13')],_0x2d76eb);_0x640fe0(_0x151f71[_0x926f('0x11')](0x1f4,_0xb6b509[_0x926f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index de9f2e0..fc8bf9c 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 _0x94c9=['/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index'];(function(_0x2be84b,_0x2d14f0){var _0x203c14=function(_0x45b983){while(--_0x45b983){_0x2be84b['push'](_0x2be84b['shift']());}};_0x203c14(++_0x2d14f0);}(_0x94c9,0x1ae));var _0x994c=function(_0x13ce7b,_0x56008a){_0x13ce7b=_0x13ce7b-0x0;var _0x2ac971=_0x94c9[_0x13ce7b];return _0x2ac971;};'use strict';var multer=require('multer');var util=require(_0x994c('0x0'));var path=require('path');var timeout=require(_0x994c('0x1'));var express=require(_0x994c('0x2'));var router=express[_0x994c('0x3')]();var fs_extra=require(_0x994c('0x4'));var auth=require(_0x994c('0x5'));var interaction=require(_0x994c('0x6'));var config=require(_0x994c('0x7'));var controller=require(_0x994c('0x8'));router[_0x994c('0x9')]('/',auth['isAuthenticated'](),controller[_0x994c('0xa')]);router[_0x994c('0x9')](_0x994c('0xb'),auth[_0x994c('0xc')](),controller[_0x994c('0xd')]);router[_0x994c('0x9')](_0x994c('0xe'),auth[_0x994c('0xc')](),controller[_0x994c('0xf')]);router[_0x994c('0x10')]('/',auth[_0x994c('0xc')](),controller['create']);router[_0x994c('0x11')](_0x994c('0xe'),auth[_0x994c('0xc')](),controller['update']);router[_0x994c('0x12')](_0x994c('0xe'),auth[_0x994c('0xc')](),controller[_0x994c('0x13')]);module[_0x994c('0x14')]=router; \ No newline at end of file +var _0x2aa4=['get','/describe','show','post','create','put','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index'];(function(_0x15e0e9,_0x205cc9){var _0x5f4888=function(_0x1c60da){while(--_0x1c60da){_0x15e0e9['push'](_0x15e0e9['shift']());}};_0x5f4888(++_0x205cc9);}(_0x2aa4,0x9a));var _0x42aa=function(_0x532a63,_0x4106f5){_0x532a63=_0x532a63-0x0;var _0x21615b=_0x2aa4[_0x532a63];return _0x21615b;};'use strict';var multer=require(_0x42aa('0x0'));var util=require('util');var path=require(_0x42aa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x42aa('0x2')]();var fs_extra=require(_0x42aa('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x42aa('0x4'));var controller=require(_0x42aa('0x5'));router['get']('/',auth[_0x42aa('0x6')](),controller[_0x42aa('0x7')]);router[_0x42aa('0x8')](_0x42aa('0x9'),auth[_0x42aa('0x6')](),controller['describe']);router[_0x42aa('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x42aa('0xa')]);router[_0x42aa('0xb')]('/',auth['isAuthenticated'](),controller[_0x42aa('0xc')]);router[_0x42aa('0xd')](_0x42aa('0xe'),auth[_0x42aa('0x6')](),controller['update']);router[_0x42aa('0xf')](_0x42aa('0xe'),auth[_0x42aa('0x6')](),controller[_0x42aa('0x10')]);module[_0x42aa('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6b77ee1..8c8edee 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1665be,_0x5e1f15){var _0x6ec3b6=function(_0x22580b){while(--_0x22580b){_0x1665be['push'](_0x1665be['shift']());}};_0x6ec3b6(++_0x5e1f15);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0xf3cd[_0x91ed5c];return _0x2387d8;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3ab313,_0x4d6b91){var _0x52e13f=function(_0x3e20e9){while(--_0x3e20e9){_0x3ab313['push'](_0x3ab313['shift']());}};_0x52e13f(++_0x4d6b91);}(_0x54ef,0x112));var _0xf54e=function(_0x5a3c5c,_0x34b1b2){_0x5a3c5c=_0x5a3c5c-0x0;var _0x29d980=_0x54ef[_0x5a3c5c];return _0x29d980;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 68690e0..1ee8778 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 _0x47de=['reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x5e28e6,_0x4201e4){var _0x595638=function(_0x48cee9){while(--_0x48cee9){_0x5e28e6['push'](_0x5e28e6['shift']());}};_0x595638(++_0x4201e4);}(_0x47de,0x73));var _0xe47d=function(_0x2b9767,_0x541f6c){_0x2b9767=_0x2b9767-0x0;var _0x5aeb0c=_0x47de[_0x2b9767];return _0x5aeb0c;};'use strict';var emlformat=require(_0xe47d('0x0'));var rimraf=require(_0xe47d('0x1'));var zipdir=require(_0xe47d('0x2'));var jsonpatch=require(_0xe47d('0x3'));var rp=require('request-promise');var moment=require(_0xe47d('0x4'));var BPromise=require(_0xe47d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe47d('0x6'));var csv=require(_0xe47d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe47d('0x8'));var _=require(_0xe47d('0x9'));var squel=require('squel');var crypto=require(_0xe47d('0xa'));var jsforce=require(_0xe47d('0xb'));var deskjs=require(_0xe47d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe47d('0xd'));var Papa=require(_0xe47d('0xe'));var Redis=require(_0xe47d('0xf'));var authService=require(_0xe47d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe47d('0x11'));var hardwareService=require(_0xe47d('0x12'));var logger=require(_0xe47d('0x13'))(_0xe47d('0x14'));var utils=require('../../config/utils');var config=require(_0xe47d('0x15'));var licenseUtil=require(_0xe47d('0x16'));var db=require(_0xe47d('0x17'))['db'];function respondWithStatusCode(_0xb1e3e7,_0xdeb562){_0xdeb562=_0xdeb562||0xcc;return function(_0xea1cbd){if(_0xea1cbd){return _0xb1e3e7[_0xe47d('0x18')](_0xdeb562);}return _0xb1e3e7[_0xe47d('0x19')](_0xdeb562)[_0xe47d('0x1a')]();};}function respondWithResult(_0x17ab05,_0x26480d){_0x26480d=_0x26480d||0xc8;return function(_0x449702){if(_0x449702){return _0x17ab05[_0xe47d('0x19')](_0x26480d)[_0xe47d('0x1b')](_0x449702);}};}function respondWithFilteredResult(_0x40e08b,_0x5b28bd){return function(_0x178eb0){if(_0x178eb0){var _0x416b36=typeof _0x5b28bd[_0xe47d('0x1c')]===_0xe47d('0x1d')&&typeof _0x5b28bd[_0xe47d('0x1e')]===_0xe47d('0x1d');var _0xfddbfb=_0x178eb0['count'];var _0x24be4d=_0x416b36?0x0:_0x5b28bd[_0xe47d('0x1c')];var _0x3ff9ec=_0x416b36?_0x178eb0[_0xe47d('0x1f')]:_0x5b28bd[_0xe47d('0x1c')]+_0x5b28bd['limit'];var _0x4892f9;if(_0x3ff9ec>=_0xfddbfb){_0x3ff9ec=_0xfddbfb;_0x4892f9=0xc8;}else{_0x4892f9=0xce;}_0x40e08b[_0xe47d('0x19')](_0x4892f9);return _0x40e08b[_0xe47d('0x20')](_0xe47d('0x21'),_0x24be4d+'-'+_0x3ff9ec+'/'+_0xfddbfb)[_0xe47d('0x1b')](_0x178eb0);}return null;};}function patchUpdates(_0x4f1092){return function(_0x37a291){try{jsonpatch[_0xe47d('0x22')](_0x37a291,_0x4f1092,!![]);}catch(_0x2d3681){return BPromise[_0xe47d('0x23')](_0x2d3681);}return _0x37a291['save']();};}function saveUpdates(_0x162fa8,_0x144b9f){return function(_0x3ffd1a){if(_0x3ffd1a){return _0x3ffd1a[_0xe47d('0x24')](_0x162fa8)[_0xe47d('0x25')](function(_0x3200f1){return _0x3200f1;});}return null;};}function removeEntity(_0x24e6c0,_0x481631){return function(_0x17e591){if(_0x17e591){return _0x17e591[_0xe47d('0x26')]()[_0xe47d('0x25')](function(){_0x24e6c0[_0xe47d('0x19')](0xcc)[_0xe47d('0x1a')]();});}};}function handleEntityNotFound(_0x51d03f,_0x4c7643){return function(_0x259fcb){if(!_0x259fcb){_0x51d03f['sendStatus'](0x194);}return _0x259fcb;};}function handleError(_0x39d7a2,_0x559c4d){_0x559c4d=_0x559c4d||0x1f4;return function(_0x78aae6){logger[_0xe47d('0x27')](_0x78aae6[_0xe47d('0x28')]);if(_0x78aae6[_0xe47d('0x29')]){delete _0x78aae6[_0xe47d('0x29')];}_0x39d7a2['status'](_0x559c4d)[_0xe47d('0x2a')](_0x78aae6);};}exports[_0xe47d('0x2b')]=function(_0x2621a0,_0x346ff3){var _0x1963a9={},_0x1c22fc={},_0x3c7a8f={'count':0x0,'rows':[]};var _0x4f1f10=_[_0xe47d('0x2c')](db[_0xe47d('0x2d')][_0xe47d('0x2e')],function(_0xd4564f){return{'name':_0xd4564f['fieldName'],'type':_0xd4564f[_0xe47d('0x2f')][_0xe47d('0x30')]};});_0x1c22fc[_0xe47d('0x31')]=_[_0xe47d('0x2c')](_0x4f1f10,_0xe47d('0x29'));_0x1c22fc[_0xe47d('0x32')]=_[_0xe47d('0x33')](_0x2621a0['query']);_0x1c22fc['filters']=_['intersection'](_0x1c22fc[_0xe47d('0x31')],_0x1c22fc[_0xe47d('0x32')]);_0x1963a9[_0xe47d('0x34')]=_[_0xe47d('0x35')](_0x1c22fc[_0xe47d('0x31')],qs[_0xe47d('0x36')](_0x2621a0['query']['fields']));_0x1963a9[_0xe47d('0x34')]=_0x1963a9['attributes']['length']?_0x1963a9[_0xe47d('0x34')]:_0x1c22fc['model'];if(!_0x2621a0[_0xe47d('0x32')][_0xe47d('0x37')](_0xe47d('0x38'))){_0x1963a9[_0xe47d('0x1e')]=qs[_0xe47d('0x1e')](_0x2621a0[_0xe47d('0x32')][_0xe47d('0x1e')]);_0x1963a9[_0xe47d('0x1c')]=qs[_0xe47d('0x1c')](_0x2621a0['query']['offset']);}_0x1963a9[_0xe47d('0x39')]=qs[_0xe47d('0x3a')](_0x2621a0[_0xe47d('0x32')][_0xe47d('0x3a')]);_0x1963a9[_0xe47d('0x3b')]=qs[_0xe47d('0x3c')](_[_0xe47d('0x3d')](_0x2621a0[_0xe47d('0x32')],_0x1c22fc[_0xe47d('0x3c')]),_0x4f1f10);if(_0x2621a0[_0xe47d('0x32')][_0xe47d('0x3e')]){_0x1963a9['where']=_[_0xe47d('0x3f')](_0x1963a9[_0xe47d('0x3b')],{'$or':_[_0xe47d('0x2c')](_0x4f1f10,function(_0x9ff91f){if(_0x9ff91f[_0xe47d('0x2f')]!=='VIRTUAL'){var _0x340144={};_0x340144[_0x9ff91f[_0xe47d('0x29')]]={'$like':'%'+_0x2621a0[_0xe47d('0x32')]['filter']+'%'};return _0x340144;}})});}_0x1963a9=_['merge']({},_0x1963a9,_0x2621a0[_0xe47d('0x40')]);var _0x20c433={'where':_0x1963a9['where']};return db[_0xe47d('0x2d')][_0xe47d('0x1f')](_0x20c433)[_0xe47d('0x25')](function(_0x2aa625){_0x3c7a8f['count']=_0x2aa625;if(_0x2621a0[_0xe47d('0x32')]['includeAll']){_0x1963a9[_0xe47d('0x41')]=[{'all':!![]}];}return db[_0xe47d('0x2d')][_0xe47d('0x42')](_0x1963a9);})[_0xe47d('0x25')](function(_0x25d7c6){_0x3c7a8f[_0xe47d('0x43')]=_0x25d7c6;return _0x3c7a8f;})[_0xe47d('0x25')](respondWithFilteredResult(_0x346ff3,_0x1963a9))[_0xe47d('0x44')](handleError(_0x346ff3,null));};exports['show']=function(_0x544b15,_0x4f8e89){var _0x19bb94={'raw':!![],'where':{'id':_0x544b15[_0xe47d('0x45')]['id']}},_0x546a06={};_0x546a06['model']=_['keys'](db[_0xe47d('0x2d')]['rawAttributes']);_0x546a06[_0xe47d('0x32')]=_[_0xe47d('0x33')](_0x544b15[_0xe47d('0x32')]);_0x546a06[_0xe47d('0x3c')]=_[_0xe47d('0x35')](_0x546a06[_0xe47d('0x31')],_0x546a06[_0xe47d('0x32')]);_0x19bb94[_0xe47d('0x34')]=_[_0xe47d('0x35')](_0x546a06['model'],qs['fields'](_0x544b15['query'][_0xe47d('0x36')]));_0x19bb94[_0xe47d('0x34')]=_0x19bb94[_0xe47d('0x34')][_0xe47d('0x46')]?_0x19bb94['attributes']:_0x546a06[_0xe47d('0x31')];if(_0x544b15[_0xe47d('0x32')]['includeAll']){_0x19bb94[_0xe47d('0x41')]=[{'all':!![]}];}_0x19bb94=_[_0xe47d('0x3f')]({},_0x19bb94,_0x544b15[_0xe47d('0x40')]);return db[_0xe47d('0x2d')]['find'](_0x19bb94)[_0xe47d('0x25')](handleEntityNotFound(_0x4f8e89,null))['then'](respondWithResult(_0x4f8e89,null))['catch'](handleError(_0x4f8e89,null));};exports[_0xe47d('0x47')]=function(_0x272f6a,_0x39fdbe){return db[_0xe47d('0x2d')][_0xe47d('0x47')](_0x272f6a[_0xe47d('0x48')],{})[_0xe47d('0x25')](respondWithResult(_0x39fdbe,0xc9))['catch'](handleError(_0x39fdbe,null));};exports[_0xe47d('0x24')]=function(_0x17205b,_0x1fe4f0){if(_0x17205b[_0xe47d('0x48')]['id']){delete _0x17205b[_0xe47d('0x48')]['id'];}return db[_0xe47d('0x2d')][_0xe47d('0x49')]({'where':{'id':_0x17205b[_0xe47d('0x45')]['id']}})[_0xe47d('0x25')](handleEntityNotFound(_0x1fe4f0,null))[_0xe47d('0x25')](saveUpdates(_0x17205b[_0xe47d('0x48')],null))['then'](respondWithResult(_0x1fe4f0,null))[_0xe47d('0x44')](handleError(_0x1fe4f0,null));};exports[_0xe47d('0x26')]=function(_0x142f4e,_0x2a63f6){return db[_0xe47d('0x2d')][_0xe47d('0x49')]({'where':{'id':_0x142f4e[_0xe47d('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a63f6,null))[_0xe47d('0x25')](removeEntity(_0x2a63f6,null))['catch'](handleError(_0x2a63f6,null));};exports[_0xe47d('0x4a')]=function(_0x4e25ec,_0x7c57f0){return db[_0xe47d('0x2d')][_0xe47d('0x4a')]()[_0xe47d('0x25')](respondWithResult(_0x7c57f0,null))[_0xe47d('0x44')](handleError(_0x7c57f0,null));}; \ No newline at end of file +var _0x9ccf=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','catch','show','params','include','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x226b04,_0x47b27e){var _0x2ede63=function(_0x1ab680){while(--_0x1ab680){_0x226b04['push'](_0x226b04['shift']());}};_0x2ede63(++_0x47b27e);}(_0x9ccf,0x15f));var _0xf9cc=function(_0x2ecb50,_0x271e20){_0x2ecb50=_0x2ecb50-0x0;var _0x2473c7=_0x9ccf[_0x2ecb50];return _0x2473c7;};'use strict';var emlformat=require(_0xf9cc('0x0'));var rimraf=require(_0xf9cc('0x1'));var zipdir=require(_0xf9cc('0x2'));var jsonpatch=require(_0xf9cc('0x3'));var rp=require(_0xf9cc('0x4'));var moment=require(_0xf9cc('0x5'));var BPromise=require(_0xf9cc('0x6'));var Mustache=require('mustache');var util=require(_0xf9cc('0x7'));var path=require(_0xf9cc('0x8'));var sox=require(_0xf9cc('0x9'));var csv=require('to-csv');var ejs=require(_0xf9cc('0xa'));var fs=require('fs');var fs_extra=require(_0xf9cc('0xb'));var _=require(_0xf9cc('0xc'));var squel=require(_0xf9cc('0xd'));var crypto=require('crypto');var jsforce=require(_0xf9cc('0xe'));var deskjs=require(_0xf9cc('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf9cc('0x10'));var Papa=require('papaparse');var Redis=require(_0xf9cc('0x11'));var authService=require(_0xf9cc('0x12'));var qs=require(_0xf9cc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9cc('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf9cc('0x15'));var config=require(_0xf9cc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf9cc('0x17'))['db'];function respondWithStatusCode(_0x3f879a,_0x270300){_0x270300=_0x270300||0xcc;return function(_0x3c3c88){if(_0x3c3c88){return _0x3f879a[_0xf9cc('0x18')](_0x270300);}return _0x3f879a[_0xf9cc('0x19')](_0x270300)[_0xf9cc('0x1a')]();};}function respondWithResult(_0x328520,_0x24555e){_0x24555e=_0x24555e||0xc8;return function(_0x436027){if(_0x436027){return _0x328520[_0xf9cc('0x19')](_0x24555e)['json'](_0x436027);}};}function respondWithFilteredResult(_0x42cca4,_0x19bdd9){return function(_0x478c01){if(_0x478c01){var _0x4803be=typeof _0x19bdd9[_0xf9cc('0x1b')]===_0xf9cc('0x1c')&&typeof _0x19bdd9['limit']==='undefined';var _0x2b9855=_0x478c01[_0xf9cc('0x1d')];var _0xf9d6c4=_0x4803be?0x0:_0x19bdd9[_0xf9cc('0x1b')];var _0x24427f=_0x4803be?_0x478c01['count']:_0x19bdd9[_0xf9cc('0x1b')]+_0x19bdd9[_0xf9cc('0x1e')];var _0xef49ed;if(_0x24427f>=_0x2b9855){_0x24427f=_0x2b9855;_0xef49ed=0xc8;}else{_0xef49ed=0xce;}_0x42cca4[_0xf9cc('0x19')](_0xef49ed);return _0x42cca4[_0xf9cc('0x1f')](_0xf9cc('0x20'),_0xf9d6c4+'-'+_0x24427f+'/'+_0x2b9855)[_0xf9cc('0x21')](_0x478c01);}return null;};}function patchUpdates(_0x161e79){return function(_0x13735c){try{jsonpatch[_0xf9cc('0x22')](_0x13735c,_0x161e79,!![]);}catch(_0x1d52b4){return BPromise['reject'](_0x1d52b4);}return _0x13735c[_0xf9cc('0x23')]();};}function saveUpdates(_0x12ef2d,_0x21c422){return function(_0xccf926){if(_0xccf926){return _0xccf926['update'](_0x12ef2d)[_0xf9cc('0x24')](function(_0x57687e){return _0x57687e;});}return null;};}function removeEntity(_0x4ec2d8,_0x118d52){return function(_0x35125c){if(_0x35125c){return _0x35125c[_0xf9cc('0x25')]()[_0xf9cc('0x24')](function(){_0x4ec2d8[_0xf9cc('0x19')](0xcc)[_0xf9cc('0x1a')]();});}};}function handleEntityNotFound(_0x3962e,_0x34c958){return function(_0x10ba55){if(!_0x10ba55){_0x3962e[_0xf9cc('0x18')](0x194);}return _0x10ba55;};}function handleError(_0x4f7802,_0x4a13c9){_0x4a13c9=_0x4a13c9||0x1f4;return function(_0x3805eb){logger[_0xf9cc('0x26')](_0x3805eb[_0xf9cc('0x27')]);if(_0x3805eb[_0xf9cc('0x28')]){delete _0x3805eb['name'];}_0x4f7802['status'](_0x4a13c9)[_0xf9cc('0x29')](_0x3805eb);};}exports[_0xf9cc('0x2a')]=function(_0x3b2152,_0x343257){var _0x4b24e7={},_0x261abb={},_0x469cd4={'count':0x0,'rows':[]};var _0x5e6d91=_[_0xf9cc('0x2b')](db[_0xf9cc('0x2c')][_0xf9cc('0x2d')],function(_0x2896f6){return{'name':_0x2896f6['fieldName'],'type':_0x2896f6['type']['key']};});_0x261abb[_0xf9cc('0x2e')]=_['map'](_0x5e6d91,_0xf9cc('0x28'));_0x261abb['query']=_[_0xf9cc('0x2f')](_0x3b2152[_0xf9cc('0x30')]);_0x261abb[_0xf9cc('0x31')]=_[_0xf9cc('0x32')](_0x261abb[_0xf9cc('0x2e')],_0x261abb[_0xf9cc('0x30')]);_0x4b24e7[_0xf9cc('0x33')]=_[_0xf9cc('0x32')](_0x261abb['model'],qs[_0xf9cc('0x34')](_0x3b2152[_0xf9cc('0x30')][_0xf9cc('0x34')]));_0x4b24e7['attributes']=_0x4b24e7[_0xf9cc('0x33')]['length']?_0x4b24e7[_0xf9cc('0x33')]:_0x261abb[_0xf9cc('0x2e')];if(!_0x3b2152[_0xf9cc('0x30')]['hasOwnProperty'](_0xf9cc('0x35'))){_0x4b24e7[_0xf9cc('0x1e')]=qs[_0xf9cc('0x1e')](_0x3b2152['query'][_0xf9cc('0x1e')]);_0x4b24e7[_0xf9cc('0x1b')]=qs[_0xf9cc('0x1b')](_0x3b2152[_0xf9cc('0x30')][_0xf9cc('0x1b')]);}_0x4b24e7[_0xf9cc('0x36')]=qs['sort'](_0x3b2152[_0xf9cc('0x30')][_0xf9cc('0x37')]);_0x4b24e7[_0xf9cc('0x38')]=qs[_0xf9cc('0x31')](_[_0xf9cc('0x39')](_0x3b2152['query'],_0x261abb[_0xf9cc('0x31')]),_0x5e6d91);if(_0x3b2152[_0xf9cc('0x30')][_0xf9cc('0x3a')]){_0x4b24e7['where']=_[_0xf9cc('0x3b')](_0x4b24e7[_0xf9cc('0x38')],{'$or':_['map'](_0x5e6d91,function(_0x10ff29){if(_0x10ff29[_0xf9cc('0x3c')]!=='VIRTUAL'){var _0x337ce1={};_0x337ce1[_0x10ff29[_0xf9cc('0x28')]]={'$like':'%'+_0x3b2152[_0xf9cc('0x30')][_0xf9cc('0x3a')]+'%'};return _0x337ce1;}})});}_0x4b24e7=_[_0xf9cc('0x3b')]({},_0x4b24e7,_0x3b2152[_0xf9cc('0x3d')]);var _0x2ef83f={'where':_0x4b24e7[_0xf9cc('0x38')]};return db['OpenchannelTransferReport'][_0xf9cc('0x1d')](_0x2ef83f)[_0xf9cc('0x24')](function(_0x4b2403){_0x469cd4['count']=_0x4b2403;if(_0x3b2152[_0xf9cc('0x30')][_0xf9cc('0x3e')]){_0x4b24e7['include']=[{'all':!![]}];}return db[_0xf9cc('0x2c')][_0xf9cc('0x3f')](_0x4b24e7);})[_0xf9cc('0x24')](function(_0x19e7ea){_0x469cd4['rows']=_0x19e7ea;return _0x469cd4;})[_0xf9cc('0x24')](respondWithFilteredResult(_0x343257,_0x4b24e7))[_0xf9cc('0x40')](handleError(_0x343257,null));};exports[_0xf9cc('0x41')]=function(_0x235ae,_0x496962){var _0x375cd6={'raw':!![],'where':{'id':_0x235ae[_0xf9cc('0x42')]['id']}},_0x5ad021={};_0x5ad021['model']=_[_0xf9cc('0x2f')](db[_0xf9cc('0x2c')]['rawAttributes']);_0x5ad021['query']=_[_0xf9cc('0x2f')](_0x235ae[_0xf9cc('0x30')]);_0x5ad021[_0xf9cc('0x31')]=_['intersection'](_0x5ad021[_0xf9cc('0x2e')],_0x5ad021['query']);_0x375cd6[_0xf9cc('0x33')]=_[_0xf9cc('0x32')](_0x5ad021[_0xf9cc('0x2e')],qs['fields'](_0x235ae[_0xf9cc('0x30')][_0xf9cc('0x34')]));_0x375cd6[_0xf9cc('0x33')]=_0x375cd6['attributes']['length']?_0x375cd6[_0xf9cc('0x33')]:_0x5ad021[_0xf9cc('0x2e')];if(_0x235ae['query']['includeAll']){_0x375cd6[_0xf9cc('0x43')]=[{'all':!![]}];}_0x375cd6=_[_0xf9cc('0x3b')]({},_0x375cd6,_0x235ae[_0xf9cc('0x3d')]);return db['OpenchannelTransferReport'][_0xf9cc('0x44')](_0x375cd6)[_0xf9cc('0x24')](handleEntityNotFound(_0x496962,null))[_0xf9cc('0x24')](respondWithResult(_0x496962,null))[_0xf9cc('0x40')](handleError(_0x496962,null));};exports[_0xf9cc('0x45')]=function(_0x185c6b,_0xa892fb){return db[_0xf9cc('0x2c')][_0xf9cc('0x45')](_0x185c6b['body'],{})['then'](respondWithResult(_0xa892fb,0xc9))[_0xf9cc('0x40')](handleError(_0xa892fb,null));};exports[_0xf9cc('0x46')]=function(_0x593c9b,_0x30a156){if(_0x593c9b[_0xf9cc('0x47')]['id']){delete _0x593c9b['body']['id'];}return db['OpenchannelTransferReport'][_0xf9cc('0x44')]({'where':{'id':_0x593c9b[_0xf9cc('0x42')]['id']}})[_0xf9cc('0x24')](handleEntityNotFound(_0x30a156,null))['then'](saveUpdates(_0x593c9b[_0xf9cc('0x47')],null))[_0xf9cc('0x24')](respondWithResult(_0x30a156,null))[_0xf9cc('0x40')](handleError(_0x30a156,null));};exports[_0xf9cc('0x25')]=function(_0x387bea,_0x3ee78f){return db['OpenchannelTransferReport'][_0xf9cc('0x44')]({'where':{'id':_0x387bea[_0xf9cc('0x42')]['id']}})[_0xf9cc('0x24')](handleEntityNotFound(_0x3ee78f,null))['then'](removeEntity(_0x3ee78f,null))[_0xf9cc('0x40')](handleError(_0x3ee78f,null));};exports[_0xf9cc('0x48')]=function(_0x294cdc,_0x44e1d7){return db[_0xf9cc('0x2c')][_0xf9cc('0x48')]()[_0xf9cc('0x24')](respondWithResult(_0x44e1d7,null))[_0xf9cc('0x40')](handleError(_0x44e1d7,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 39710e6..ea45142 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 _0x9e71=['report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','OpenchannelTransferReport'];(function(_0xf5f216,_0x1cd34){var _0x10e5b3=function(_0x52d73b){while(--_0x52d73b){_0xf5f216['push'](_0xf5f216['shift']());}};_0x10e5b3(++_0x1cd34);}(_0x9e71,0xda));var _0x19e7=function(_0x3227c4,_0x29b196){_0x3227c4=_0x3227c4-0x0;var _0x1cc1bf=_0x9e71[_0x3227c4];return _0x1cc1bf;};'use strict';var _=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var logger=require('../../config/logger')(_0x19e7('0x2'));var moment=require(_0x19e7('0x3'));var BPromise=require(_0x19e7('0x4'));var rp=require(_0x19e7('0x5'));var fs=require('fs');var path=require(_0x19e7('0x6'));var rimraf=require(_0x19e7('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x19e7('0x8')]=function(_0x505e88,_0x14bb11){return _0x505e88['define'](_0x19e7('0x9'),attributes,{'tableName':_0x19e7('0xa'),'paranoid':![],'indexes':[{'name':_0x19e7('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0fc4=['../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x300dbb,_0xd7fd5b){var _0x1a4120=function(_0x10d5d0){while(--_0x10d5d0){_0x300dbb['push'](_0x300dbb['shift']());}};_0x1a4120(++_0xd7fd5b);}(_0x0fc4,0x1c6));var _0x40fc=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x0fc4[_0x2f71f6];return _0x2b23ea;};'use strict';var _=require(_0x40fc('0x0'));var util=require(_0x40fc('0x1'));var logger=require(_0x40fc('0x2'))(_0x40fc('0x3'));var moment=require('moment');var BPromise=require(_0x40fc('0x4'));var rp=require(_0x40fc('0x5'));var fs=require('fs');var path=require(_0x40fc('0x6'));var rimraf=require(_0x40fc('0x7'));var config=require(_0x40fc('0x8'));var attributes=require(_0x40fc('0x9'));module[_0x40fc('0xa')]=function(_0x5cb109,_0x4b32ee){return _0x5cb109['define'](_0x40fc('0xb'),attributes,{'tableName':_0x40fc('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x40fc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index c6a0004..936fdab 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 _0x1501=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0xab7e7c,_0x4c8cfe){var _0x4c80f4=function(_0x286385){while(--_0x286385){_0xab7e7c['push'](_0xab7e7c['shift']());}};_0x4c80f4(++_0x4c8cfe);}(_0x1501,0x126));var _0x1150=function(_0x4706af,_0x24b450){_0x4706af=_0x4706af-0x0;var _0x2f75c4=_0x1501[_0x4706af];return _0x2f75c4;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var moment=require(_0x1150('0x1'));var BPromise=require(_0x1150('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1150('0x3'));var db=require(_0x1150('0x4'))['db'];var utils=require(_0x1150('0x5'));var logger=require(_0x1150('0x6'))('rpc');var config=require(_0x1150('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1150('0x8')][_0x1150('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc391,_0x131b49,_0x24340c){return new BPromise(function(_0x321d80,_0x2da67d){return client['request'](_0x2fc391,_0x24340c)['then'](function(_0x22d26c){logger[_0x1150('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x131b49,'request\x20sent');logger[_0x1150('0xb')](_0x1150('0xc'),_0x131b49,_0x1150('0xd'),JSON[_0x1150('0xe')](_0x22d26c));if(_0x22d26c['error']){if(_0x22d26c[_0x1150('0xf')][_0x1150('0x10')]===0x1f4){logger['error'](_0x1150('0x11'),_0x131b49,_0x22d26c['error'][_0x1150('0x12')]);return _0x2da67d(_0x22d26c[_0x1150('0xf')][_0x1150('0x12')]);}logger[_0x1150('0xf')](_0x1150('0x11'),_0x131b49,_0x22d26c[_0x1150('0xf')][_0x1150('0x12')]);return _0x321d80(_0x22d26c[_0x1150('0xf')]['message']);}else{logger['info'](_0x1150('0x11'),_0x131b49,_0x1150('0xd'));_0x321d80(_0x22d26c[_0x1150('0x13')][_0x1150('0x12')]);}})[_0x1150('0x14')](function(_0x1a8b62){logger[_0x1150('0xf')](_0x1150('0x11'),_0x131b49,_0x1a8b62);_0x2da67d(_0x1a8b62);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x530959,_0x39b1a9){var _0x111a19=function(_0x9c8a12){while(--_0x9c8a12){_0x530959['push'](_0x530959['shift']());}};_0x111a19(++_0x39b1a9);}(_0xabce,0x103));var _0xeabc=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xabce[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 70d2ed8..ed46e19 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 _0x8b59=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','/:id','show','create','put'];(function(_0x1aa613,_0x188134){var _0x4a3698=function(_0x25a8f2){while(--_0x25a8f2){_0x1aa613['push'](_0x1aa613['shift']());}};_0x4a3698(++_0x188134);}(_0x8b59,0x1d7));var _0x98b5=function(_0x2223e0,_0x876294){_0x2223e0=_0x2223e0-0x0;var _0x10a84b=_0x8b59[_0x2223e0];return _0x10a84b;};'use strict';var multer=require(_0x98b5('0x0'));var util=require(_0x98b5('0x1'));var path=require('path');var timeout=require(_0x98b5('0x2'));var express=require(_0x98b5('0x3'));var router=express[_0x98b5('0x4')]();var fs_extra=require(_0x98b5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x98b5('0x6'));var config=require(_0x98b5('0x7'));var controller=require(_0x98b5('0x8'));router['get']('/',auth[_0x98b5('0x9')](),controller[_0x98b5('0xa')]);router['get'](_0x98b5('0xb'),auth[_0x98b5('0x9')](),controller[_0x98b5('0xc')]);router['post']('/',auth[_0x98b5('0x9')](),controller[_0x98b5('0xd')]);router[_0x98b5('0xe')](_0x98b5('0xb'),auth[_0x98b5('0x9')](),controller[_0x98b5('0xf')]);router[_0x98b5('0x10')]('/:id',auth[_0x98b5('0x9')](),controller['destroy']);module[_0x98b5('0x11')]=router; \ No newline at end of file +var _0xcb11=['post','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show'];(function(_0x29416b,_0x59e95d){var _0x2f6e36=function(_0x189ea6){while(--_0x189ea6){_0x29416b['push'](_0x29416b['shift']());}};_0x2f6e36(++_0x59e95d);}(_0xcb11,0x1a4));var _0x1cb1=function(_0x4ada50,_0x54757b){_0x4ada50=_0x4ada50-0x0;var _0x3d85d5=_0xcb11[_0x4ada50];return _0x3d85d5;};'use strict';var multer=require(_0x1cb1('0x0'));var util=require(_0x1cb1('0x1'));var path=require(_0x1cb1('0x2'));var timeout=require(_0x1cb1('0x3'));var express=require(_0x1cb1('0x4'));var router=express['Router']();var fs_extra=require(_0x1cb1('0x5'));var auth=require(_0x1cb1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x1cb1('0x7')]('/',auth[_0x1cb1('0x8')](),controller[_0x1cb1('0x9')]);router[_0x1cb1('0x7')](_0x1cb1('0xa'),auth['isAuthenticated'](),controller[_0x1cb1('0xb')]);router[_0x1cb1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1cb1('0xa'),auth[_0x1cb1('0x8')](),controller[_0x1cb1('0xd')]);router[_0x1cb1('0xe')]('/:id',auth[_0x1cb1('0x8')](),controller['destroy']);module[_0x1cb1('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 67549d5..065e7af 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 _0x876c=['exports','STRING','name','sequelize'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x876c,0x1db));var _0xc876=function(_0x4965ce,_0x5e4fd4){_0x4965ce=_0x4965ce-0x0;var _0x41b7ad=_0x876c[_0x4965ce];return _0x41b7ad;};'use strict';var Sequelize=require(_0xc876('0x0'));module[_0xc876('0x1')]={'name':{'type':Sequelize[_0xc876('0x2')],'unique':_0xc876('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc876('0x2')]}}; \ No newline at end of file +var _0x920b=['STRING','exports'];(function(_0x107b64,_0x361992){var _0x2d5b13=function(_0x4e5166){while(--_0x4e5166){_0x107b64['push'](_0x107b64['shift']());}};_0x2d5b13(++_0x361992);}(_0x920b,0x10b));var _0xb920=function(_0x33ca09,_0x5053fd){_0x33ca09=_0x33ca09-0x0;var _0x4574e5=_0x920b[_0x33ca09];return _0x4574e5;};'use strict';var Sequelize=require('sequelize');module[_0xb920('0x0')]={'name':{'type':Sequelize[_0xb920('0x1')],'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 05ecb03..6283894 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 _0xbeb7=['merge','VIRTUAL','includeAll','rows','catch','params','rawAttributes','length','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','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Pauses','UserProfileResource','end','error','stack','name','send','index','Pause','type','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','where'];(function(_0x613385,_0x808baf){var _0x4ab7b5=function(_0x17305c){while(--_0x17305c){_0x613385['push'](_0x613385['shift']());}};_0x4ab7b5(++_0x808baf);}(_0xbeb7,0x189));var _0x7beb=function(_0x5466dd,_0x1dda96){_0x5466dd=_0x5466dd-0x0;var _0x5c03a7=_0xbeb7[_0x5466dd];return _0x5c03a7;};'use strict';var emlformat=require(_0x7beb('0x0'));var rimraf=require(_0x7beb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7beb('0x2'));var rp=require(_0x7beb('0x3'));var moment=require(_0x7beb('0x4'));var BPromise=require(_0x7beb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7beb('0x6'));var sox=require('sox');var csv=require(_0x7beb('0x7'));var ejs=require(_0x7beb('0x8'));var fs=require('fs');var fs_extra=require(_0x7beb('0x9'));var _=require(_0x7beb('0xa'));var squel=require('squel');var crypto=require(_0x7beb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7beb('0x7'));var querystring=require('querystring');var Papa=require(_0x7beb('0xc'));var Redis=require(_0x7beb('0xd'));var authService=require(_0x7beb('0xe'));var qs=require(_0x7beb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7beb('0x10'))(_0x7beb('0x11'));var utils=require('../../config/utils');var config=require(_0x7beb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7beb('0x13'))['db'];function respondWithStatusCode(_0x4935ef,_0x24b3ec){_0x24b3ec=_0x24b3ec||0xcc;return function(_0x4f1dd9){if(_0x4f1dd9){return _0x4935ef['sendStatus'](_0x24b3ec);}return _0x4935ef[_0x7beb('0x14')](_0x24b3ec)['end']();};}function respondWithResult(_0x41459c,_0x56b4fc){_0x56b4fc=_0x56b4fc||0xc8;return function(_0x422146){if(_0x422146){return _0x41459c[_0x7beb('0x14')](_0x56b4fc)[_0x7beb('0x15')](_0x422146);}};}function respondWithFilteredResult(_0x4e2528,_0x1078a5){return function(_0x4b1e81){if(_0x4b1e81){var _0x52684b=typeof _0x1078a5[_0x7beb('0x16')]===_0x7beb('0x17')&&typeof _0x1078a5[_0x7beb('0x18')]===_0x7beb('0x17');var _0x20d680=_0x4b1e81['count'];var _0x549783=_0x52684b?0x0:_0x1078a5[_0x7beb('0x16')];var _0x3ca533=_0x52684b?_0x4b1e81[_0x7beb('0x19')]:_0x1078a5[_0x7beb('0x16')]+_0x1078a5[_0x7beb('0x18')];var _0x26c756;if(_0x3ca533>=_0x20d680){_0x3ca533=_0x20d680;_0x26c756=0xc8;}else{_0x26c756=0xce;}_0x4e2528[_0x7beb('0x14')](_0x26c756);return _0x4e2528[_0x7beb('0x1a')](_0x7beb('0x1b'),_0x549783+'-'+_0x3ca533+'/'+_0x20d680)[_0x7beb('0x15')](_0x4b1e81);}return null;};}function patchUpdates(_0x4a0242){return function(_0x191927){try{jsonpatch[_0x7beb('0x1c')](_0x191927,_0x4a0242,!![]);}catch(_0x404aa3){return BPromise['reject'](_0x404aa3);}return _0x191927[_0x7beb('0x1d')]();};}function saveUpdates(_0x1c0a9c,_0x216d91){return function(_0x3d8406){if(_0x3d8406){return _0x3d8406[_0x7beb('0x1e')](_0x1c0a9c)['then'](function(_0x89673){return _0x89673;});}return null;};}function removeEntity(_0x19fec7,_0x18f53e){return function(_0x3a5bc2){if(_0x3a5bc2){return _0x3a5bc2[_0x7beb('0x1f')]()[_0x7beb('0x20')](function(){var _0xca6299=_0x3a5bc2[_0x7beb('0x21')]({'plain':!![]});var _0x6978d7=_0x7beb('0x22');return db[_0x7beb('0x23')][_0x7beb('0x1f')]({'where':{'type':_0x6978d7,'resourceId':_0xca6299['id']}})[_0x7beb('0x20')](function(){return _0x3a5bc2;});})['then'](function(){_0x19fec7[_0x7beb('0x14')](0xcc)[_0x7beb('0x24')]();});}};}function handleEntityNotFound(_0x3fafc4,_0x504173){return function(_0x72a80){if(!_0x72a80){_0x3fafc4['sendStatus'](0x194);}return _0x72a80;};}function handleError(_0x30c01d,_0xeab60b){_0xeab60b=_0xeab60b||0x1f4;return function(_0x3e0cb9){logger[_0x7beb('0x25')](_0x3e0cb9[_0x7beb('0x26')]);if(_0x3e0cb9['name']){delete _0x3e0cb9[_0x7beb('0x27')];}_0x30c01d[_0x7beb('0x14')](_0xeab60b)[_0x7beb('0x28')](_0x3e0cb9);};}exports[_0x7beb('0x29')]=function(_0x29c7e8,_0x62c276){var _0x2e108e={},_0x33d838={},_0x3d7c5f={'count':0x0,'rows':[]};var _0x392e50=_['map'](db[_0x7beb('0x2a')]['rawAttributes'],function(_0x10cc43){return{'name':_0x10cc43['fieldName'],'type':_0x10cc43[_0x7beb('0x2b')]['key']};});_0x33d838['model']=_[_0x7beb('0x2c')](_0x392e50,_0x7beb('0x27'));_0x33d838[_0x7beb('0x2d')]=_[_0x7beb('0x2e')](_0x29c7e8[_0x7beb('0x2d')]);_0x33d838[_0x7beb('0x2f')]=_[_0x7beb('0x30')](_0x33d838[_0x7beb('0x31')],_0x33d838[_0x7beb('0x2d')]);_0x2e108e['attributes']=_[_0x7beb('0x30')](_0x33d838[_0x7beb('0x31')],qs[_0x7beb('0x32')](_0x29c7e8['query'][_0x7beb('0x32')]));_0x2e108e[_0x7beb('0x33')]=_0x2e108e[_0x7beb('0x33')]['length']?_0x2e108e[_0x7beb('0x33')]:_0x33d838['model'];if(!_0x29c7e8['query'][_0x7beb('0x34')](_0x7beb('0x35'))){_0x2e108e[_0x7beb('0x18')]=qs[_0x7beb('0x18')](_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x18')]);_0x2e108e['offset']=qs[_0x7beb('0x16')](_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x16')]);}_0x2e108e['order']=qs[_0x7beb('0x36')](_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x36')]);_0x2e108e['where']=qs['filters'](_[_0x7beb('0x37')](_0x29c7e8[_0x7beb('0x2d')],_0x33d838[_0x7beb('0x2f')]),_0x392e50);if(_0x29c7e8['query']['filter']){_0x2e108e[_0x7beb('0x38')]=_[_0x7beb('0x39')](_0x2e108e['where'],{'$or':_[_0x7beb('0x2c')](_0x392e50,function(_0x35b18f){if(_0x35b18f[_0x7beb('0x2b')]!==_0x7beb('0x3a')){var _0x4474d6={};_0x4474d6[_0x35b18f[_0x7beb('0x27')]]={'$like':'%'+_0x29c7e8[_0x7beb('0x2d')]['filter']+'%'};return _0x4474d6;}})});}_0x2e108e=_[_0x7beb('0x39')]({},_0x2e108e,_0x29c7e8['options']);var _0x2ae609={'where':_0x2e108e[_0x7beb('0x38')]};return db[_0x7beb('0x2a')][_0x7beb('0x19')](_0x2ae609)[_0x7beb('0x20')](function(_0x362bde){_0x3d7c5f['count']=_0x362bde;if(_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x3b')]){_0x2e108e['include']=[{'all':!![]}];}return db['Pause']['findAll'](_0x2e108e);})[_0x7beb('0x20')](function(_0x599d34){_0x3d7c5f[_0x7beb('0x3c')]=_0x599d34;return _0x3d7c5f;})[_0x7beb('0x20')](respondWithFilteredResult(_0x62c276,_0x2e108e))[_0x7beb('0x3d')](handleError(_0x62c276,null));};exports['show']=function(_0x429f82,_0x411591){var _0x234bff={'raw':!![],'where':{'id':_0x429f82[_0x7beb('0x3e')]['id']}},_0x238462={};_0x238462['model']=_['keys'](db[_0x7beb('0x2a')][_0x7beb('0x3f')]);_0x238462[_0x7beb('0x2d')]=_[_0x7beb('0x2e')](_0x429f82[_0x7beb('0x2d')]);_0x238462[_0x7beb('0x2f')]=_[_0x7beb('0x30')](_0x238462['model'],_0x238462[_0x7beb('0x2d')]);_0x234bff[_0x7beb('0x33')]=_[_0x7beb('0x30')](_0x238462['model'],qs[_0x7beb('0x32')](_0x429f82[_0x7beb('0x2d')][_0x7beb('0x32')]));_0x234bff[_0x7beb('0x33')]=_0x234bff[_0x7beb('0x33')][_0x7beb('0x40')]?_0x234bff[_0x7beb('0x33')]:_0x238462[_0x7beb('0x31')];if(_0x429f82[_0x7beb('0x2d')][_0x7beb('0x3b')]){_0x234bff['include']=[{'all':!![]}];}_0x234bff=_[_0x7beb('0x39')]({},_0x234bff,_0x429f82[_0x7beb('0x41')]);return db[_0x7beb('0x2a')][_0x7beb('0x42')](_0x234bff)[_0x7beb('0x20')](handleEntityNotFound(_0x411591,null))['then'](respondWithResult(_0x411591,null))[_0x7beb('0x3d')](handleError(_0x411591,null));};exports[_0x7beb('0x43')]=function(_0x542076,_0x7a9956){return db['Pause'][_0x7beb('0x43')](_0x542076[_0x7beb('0x44')],{})['then'](function(_0x401ef1){var _0x1b558e=_0x542076[_0x7beb('0x45')][_0x7beb('0x21')]({'plain':!![]});if(!_0x1b558e)throw new Error(_0x7beb('0x46'));if(_0x1b558e['role']===_0x7beb('0x45')){var _0x3c5983=_0x401ef1[_0x7beb('0x21')]({'plain':!![]});var _0x117878=_0x7beb('0x22');return db[_0x7beb('0x47')][_0x7beb('0x42')]({'where':{'name':_0x117878,'userProfileId':_0x1b558e[_0x7beb('0x48')]},'raw':!![]})['then'](function(_0x376c18){if(_0x376c18&&_0x376c18[_0x7beb('0x49')]===0x0){return db[_0x7beb('0x23')][_0x7beb('0x43')]({'name':_0x3c5983[_0x7beb('0x27')],'resourceId':_0x3c5983['id'],'type':_0x376c18[_0x7beb('0x27')],'sectionId':_0x376c18['id']},{})[_0x7beb('0x20')](function(){return _0x401ef1;});}else{return _0x401ef1;}})['catch'](function(_0x587578){logger[_0x7beb('0x25')](_0x7beb('0x4a'),_0x587578);throw _0x587578;});}return _0x401ef1;})[_0x7beb('0x20')](respondWithResult(_0x7a9956,0xc9))[_0x7beb('0x3d')](handleError(_0x7a9956,null));};exports['update']=function(_0x48c074,_0x12203b){if(_0x48c074[_0x7beb('0x44')]['id']){delete _0x48c074['body']['id'];}return db[_0x7beb('0x2a')]['find']({'where':{'id':_0x48c074['params']['id']}})['then'](handleEntityNotFound(_0x12203b,null))[_0x7beb('0x20')](saveUpdates(_0x48c074['body'],null))[_0x7beb('0x20')](respondWithResult(_0x12203b,null))[_0x7beb('0x3d')](handleError(_0x12203b,null));};exports[_0x7beb('0x1f')]=function(_0x29dc83,_0x2d577e){return db[_0x7beb('0x2a')][_0x7beb('0x42')]({'where':{'id':_0x29dc83[_0x7beb('0x3e')]['id']}})[_0x7beb('0x20')](handleEntityNotFound(_0x2d577e,null))[_0x7beb('0x20')](removeEntity(_0x2d577e,null))[_0x7beb('0x3d')](handleError(_0x2d577e,null));}; \ No newline at end of file +var _0xcd8b=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','apply','save','then','destroy','UserProfileResource','error','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','Pause','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Pauses','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xcd8b,0x99));var _0xbcd8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcd8b[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xbcd8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcd8('0x1'));var jsonpatch=require(_0xbcd8('0x2'));var rp=require(_0xbcd8('0x3'));var moment=require('moment');var BPromise=require(_0xbcd8('0x4'));var Mustache=require(_0xbcd8('0x5'));var util=require(_0xbcd8('0x6'));var path=require(_0xbcd8('0x7'));var sox=require(_0xbcd8('0x8'));var csv=require(_0xbcd8('0x9'));var ejs=require(_0xbcd8('0xa'));var fs=require('fs');var fs_extra=require(_0xbcd8('0xb'));var _=require(_0xbcd8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbcd8('0xd'));var toCsv=require(_0xbcd8('0x9'));var querystring=require(_0xbcd8('0xe'));var Papa=require(_0xbcd8('0xf'));var Redis=require(_0xbcd8('0x10'));var authService=require(_0xbcd8('0x11'));var qs=require(_0xbcd8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcd8('0x13'));var logger=require(_0xbcd8('0x14'))('api');var utils=require(_0xbcd8('0x15'));var config=require(_0xbcd8('0x16'));var licenseUtil=require(_0xbcd8('0x17'));var db=require(_0xbcd8('0x18'))['db'];function respondWithStatusCode(_0x3cf39f,_0x3e05a9){_0x3e05a9=_0x3e05a9||0xcc;return function(_0x455997){if(_0x455997){return _0x3cf39f['sendStatus'](_0x3e05a9);}return _0x3cf39f['status'](_0x3e05a9)[_0xbcd8('0x19')]();};}function respondWithResult(_0x4966b2,_0xf7e238){_0xf7e238=_0xf7e238||0xc8;return function(_0x2c8980){if(_0x2c8980){return _0x4966b2[_0xbcd8('0x1a')](_0xf7e238)[_0xbcd8('0x1b')](_0x2c8980);}};}function respondWithFilteredResult(_0x508c84,_0x361e99){return function(_0x206a4a){if(_0x206a4a){var _0x45c7b0=typeof _0x361e99['offset']==='undefined'&&typeof _0x361e99['limit']===_0xbcd8('0x1c');var _0xbf92d3=_0x206a4a[_0xbcd8('0x1d')];var _0x2c65d4=_0x45c7b0?0x0:_0x361e99[_0xbcd8('0x1e')];var _0x2cf7ac=_0x45c7b0?_0x206a4a['count']:_0x361e99[_0xbcd8('0x1e')]+_0x361e99[_0xbcd8('0x1f')];var _0x2d1afa;if(_0x2cf7ac>=_0xbf92d3){_0x2cf7ac=_0xbf92d3;_0x2d1afa=0xc8;}else{_0x2d1afa=0xce;}_0x508c84[_0xbcd8('0x1a')](_0x2d1afa);return _0x508c84['set']('Content-Range',_0x2c65d4+'-'+_0x2cf7ac+'/'+_0xbf92d3)[_0xbcd8('0x1b')](_0x206a4a);}return null;};}function patchUpdates(_0x46a65e){return function(_0x2824e6){try{jsonpatch[_0xbcd8('0x20')](_0x2824e6,_0x46a65e,!![]);}catch(_0x5b3c58){return BPromise['reject'](_0x5b3c58);}return _0x2824e6[_0xbcd8('0x21')]();};}function saveUpdates(_0x111b4a,_0x3324f7){return function(_0x3b6546){if(_0x3b6546){return _0x3b6546['update'](_0x111b4a)[_0xbcd8('0x22')](function(_0xad397d){return _0xad397d;});}return null;};}function removeEntity(_0x464d4c,_0x521f89){return function(_0x346b0b){if(_0x346b0b){return _0x346b0b[_0xbcd8('0x23')]()['then'](function(){var _0x174fa5=_0x346b0b['get']({'plain':!![]});var _0x2c7464='Pauses';return db[_0xbcd8('0x24')]['destroy']({'where':{'type':_0x2c7464,'resourceId':_0x174fa5['id']}})['then'](function(){return _0x346b0b;});})[_0xbcd8('0x22')](function(){_0x464d4c['status'](0xcc)[_0xbcd8('0x19')]();});}};}function handleEntityNotFound(_0x17dacd,_0x276bc4){return function(_0x33c588){if(!_0x33c588){_0x17dacd['sendStatus'](0x194);}return _0x33c588;};}function handleError(_0x1b5b3c,_0x481e06){_0x481e06=_0x481e06||0x1f4;return function(_0x1c5a9f){logger[_0xbcd8('0x25')](_0x1c5a9f['stack']);if(_0x1c5a9f[_0xbcd8('0x26')]){delete _0x1c5a9f[_0xbcd8('0x26')];}_0x1b5b3c[_0xbcd8('0x1a')](_0x481e06)['send'](_0x1c5a9f);};}exports['index']=function(_0x14c6b4,_0x4ef1ba){var _0x2d8a56={},_0x4f753c={},_0x3d22a1={'count':0x0,'rows':[]};var _0x3103e6=_[_0xbcd8('0x27')](db['Pause'][_0xbcd8('0x28')],function(_0xc5972e){return{'name':_0xc5972e[_0xbcd8('0x29')],'type':_0xc5972e[_0xbcd8('0x2a')][_0xbcd8('0x2b')]};});_0x4f753c[_0xbcd8('0x2c')]=_[_0xbcd8('0x27')](_0x3103e6,_0xbcd8('0x26'));_0x4f753c[_0xbcd8('0x2d')]=_[_0xbcd8('0x2e')](_0x14c6b4[_0xbcd8('0x2d')]);_0x4f753c[_0xbcd8('0x2f')]=_[_0xbcd8('0x30')](_0x4f753c['model'],_0x4f753c[_0xbcd8('0x2d')]);_0x2d8a56[_0xbcd8('0x31')]=_[_0xbcd8('0x30')](_0x4f753c['model'],qs[_0xbcd8('0x32')](_0x14c6b4[_0xbcd8('0x2d')][_0xbcd8('0x32')]));_0x2d8a56[_0xbcd8('0x31')]=_0x2d8a56[_0xbcd8('0x31')][_0xbcd8('0x33')]?_0x2d8a56[_0xbcd8('0x31')]:_0x4f753c[_0xbcd8('0x2c')];if(!_0x14c6b4[_0xbcd8('0x2d')][_0xbcd8('0x34')](_0xbcd8('0x35'))){_0x2d8a56[_0xbcd8('0x1f')]=qs[_0xbcd8('0x1f')](_0x14c6b4[_0xbcd8('0x2d')][_0xbcd8('0x1f')]);_0x2d8a56[_0xbcd8('0x1e')]=qs[_0xbcd8('0x1e')](_0x14c6b4[_0xbcd8('0x2d')][_0xbcd8('0x1e')]);}_0x2d8a56['order']=qs[_0xbcd8('0x36')](_0x14c6b4[_0xbcd8('0x2d')][_0xbcd8('0x36')]);_0x2d8a56['where']=qs[_0xbcd8('0x2f')](_[_0xbcd8('0x37')](_0x14c6b4[_0xbcd8('0x2d')],_0x4f753c[_0xbcd8('0x2f')]),_0x3103e6);if(_0x14c6b4[_0xbcd8('0x2d')][_0xbcd8('0x38')]){_0x2d8a56[_0xbcd8('0x39')]=_[_0xbcd8('0x3a')](_0x2d8a56[_0xbcd8('0x39')],{'$or':_[_0xbcd8('0x27')](_0x3103e6,function(_0x1b9b41){if(_0x1b9b41[_0xbcd8('0x2a')]!=='VIRTUAL'){var _0x2905f9={};_0x2905f9[_0x1b9b41[_0xbcd8('0x26')]]={'$like':'%'+_0x14c6b4[_0xbcd8('0x2d')][_0xbcd8('0x38')]+'%'};return _0x2905f9;}})});}_0x2d8a56=_[_0xbcd8('0x3a')]({},_0x2d8a56,_0x14c6b4[_0xbcd8('0x3b')]);var _0x2052ae={'where':_0x2d8a56['where']};return db[_0xbcd8('0x3c')][_0xbcd8('0x1d')](_0x2052ae)[_0xbcd8('0x22')](function(_0x261a5d){_0x3d22a1['count']=_0x261a5d;if(_0x14c6b4['query']['includeAll']){_0x2d8a56[_0xbcd8('0x3d')]=[{'all':!![]}];}return db['Pause'][_0xbcd8('0x3e')](_0x2d8a56);})[_0xbcd8('0x22')](function(_0x1b38e3){_0x3d22a1[_0xbcd8('0x3f')]=_0x1b38e3;return _0x3d22a1;})[_0xbcd8('0x22')](respondWithFilteredResult(_0x4ef1ba,_0x2d8a56))[_0xbcd8('0x40')](handleError(_0x4ef1ba,null));};exports[_0xbcd8('0x41')]=function(_0x47963b,_0x1c8900){var _0x487339={'raw':!![],'where':{'id':_0x47963b[_0xbcd8('0x42')]['id']}},_0x127da6={};_0x127da6[_0xbcd8('0x2c')]=_[_0xbcd8('0x2e')](db[_0xbcd8('0x3c')][_0xbcd8('0x28')]);_0x127da6[_0xbcd8('0x2d')]=_[_0xbcd8('0x2e')](_0x47963b['query']);_0x127da6[_0xbcd8('0x2f')]=_['intersection'](_0x127da6[_0xbcd8('0x2c')],_0x127da6[_0xbcd8('0x2d')]);_0x487339[_0xbcd8('0x31')]=_['intersection'](_0x127da6[_0xbcd8('0x2c')],qs[_0xbcd8('0x32')](_0x47963b[_0xbcd8('0x2d')]['fields']));_0x487339[_0xbcd8('0x31')]=_0x487339[_0xbcd8('0x31')]['length']?_0x487339[_0xbcd8('0x31')]:_0x127da6[_0xbcd8('0x2c')];if(_0x47963b[_0xbcd8('0x2d')][_0xbcd8('0x43')]){_0x487339[_0xbcd8('0x3d')]=[{'all':!![]}];}_0x487339=_[_0xbcd8('0x3a')]({},_0x487339,_0x47963b[_0xbcd8('0x3b')]);return db[_0xbcd8('0x3c')][_0xbcd8('0x44')](_0x487339)[_0xbcd8('0x22')](handleEntityNotFound(_0x1c8900,null))[_0xbcd8('0x22')](respondWithResult(_0x1c8900,null))['catch'](handleError(_0x1c8900,null));};exports['create']=function(_0x395dd9,_0x2e8215){return db[_0xbcd8('0x3c')][_0xbcd8('0x45')](_0x395dd9[_0xbcd8('0x46')],{})['then'](function(_0x453b43){var _0x16600f=_0x395dd9[_0xbcd8('0x47')]['get']({'plain':!![]});if(!_0x16600f)throw new Error(_0xbcd8('0x48'));if(_0x16600f['role']===_0xbcd8('0x47')){var _0x256637=_0x453b43[_0xbcd8('0x49')]({'plain':!![]});var _0x4fb35f=_0xbcd8('0x4a');return db[_0xbcd8('0x4b')][_0xbcd8('0x44')]({'where':{'name':_0x4fb35f,'userProfileId':_0x16600f['userProfileId']},'raw':!![]})[_0xbcd8('0x22')](function(_0x20b593){if(_0x20b593&&_0x20b593['autoAssociation']===0x0){return db[_0xbcd8('0x24')]['create']({'name':_0x256637[_0xbcd8('0x26')],'resourceId':_0x256637['id'],'type':_0x20b593[_0xbcd8('0x26')],'sectionId':_0x20b593['id']},{})[_0xbcd8('0x22')](function(){return _0x453b43;});}else{return _0x453b43;}})[_0xbcd8('0x40')](function(_0x4753e1){logger[_0xbcd8('0x25')](_0xbcd8('0x4c'),_0x4753e1);throw _0x4753e1;});}return _0x453b43;})[_0xbcd8('0x22')](respondWithResult(_0x2e8215,0xc9))[_0xbcd8('0x40')](handleError(_0x2e8215,null));};exports[_0xbcd8('0x4d')]=function(_0x5f5954,_0x50a476){if(_0x5f5954['body']['id']){delete _0x5f5954[_0xbcd8('0x46')]['id'];}return db[_0xbcd8('0x3c')][_0xbcd8('0x44')]({'where':{'id':_0x5f5954[_0xbcd8('0x42')]['id']}})['then'](handleEntityNotFound(_0x50a476,null))['then'](saveUpdates(_0x5f5954[_0xbcd8('0x46')],null))[_0xbcd8('0x22')](respondWithResult(_0x50a476,null))[_0xbcd8('0x40')](handleError(_0x50a476,null));};exports['destroy']=function(_0x2e811c,_0x14d20c){return db[_0xbcd8('0x3c')][_0xbcd8('0x44')]({'where':{'id':_0x2e811c['params']['id']}})['then'](handleEntityNotFound(_0x14d20c,null))[_0xbcd8('0x22')](removeEntity(_0x14d20c,null))['catch'](handleError(_0x14d20c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 655f7f1..2f9b821 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 _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6aa7,0x178));var _0x76aa=function(_0x5bf042,_0x3a8eb7){_0x5bf042=_0x5bf042-0x0;var _0x4864cf=_0x6aa7[_0x5bf042];return _0x4864cf;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'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(_0x52d8b9,_0x30d959){var _0x5d1ac9=function(_0x430853){while(--_0x430853){_0x52d8b9['push'](_0x52d8b9['shift']());}};_0x5d1ac9(++_0x30d959);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x5fc3[_0x2dea24];return _0x309d58;};'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 f9e473b..8293555 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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x24f65e,_0x3ea9ac){var _0x3a1f0c=function(_0x425036){while(--_0x425036){_0x24f65e['push'](_0x24f65e['shift']());}};_0x3a1f0c(++_0x3ea9ac);}(_0x7a54,0x106));var _0x47a5=function(_0x23de5d,_0x56e8ad){_0x23de5d=_0x23de5d-0x0;var _0x12c79b=_0x7a54[_0x23de5d];return _0x12c79b;};'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')]('Pause,\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['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ 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(_0x1404a9,_0x5b8994){var _0x529967=function(_0x511e64){while(--_0x511e64){_0x1404a9['push'](_0x1404a9['shift']());}};_0x529967(++_0x5b8994);}(_0xb10b,0x12a));var _0xbb10=function(_0x143cfd,_0x1a336e){_0x143cfd=_0x143cfd-0x0;var _0x2cb5f5=_0xb10b[_0x143cfd];return _0x2cb5f5;};'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 44e4e9f..77c9fd5 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 _0x524a=['show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','basename','now','extname','post','single','file','/webhook','webhookPost','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./plugin.controller','get','isAuthenticated','webhookGet'];(function(_0x5c3b63,_0x85ed6f){var _0x3983c0=function(_0x54548b){while(--_0x54548b){_0x5c3b63['push'](_0x5c3b63['shift']());}};_0x3983c0(++_0x85ed6f);}(_0x524a,0xf5));var _0xa524=function(_0x540a23,_0x51b018){_0x540a23=_0x540a23-0x0;var _0x10547e=_0x524a[_0x540a23];return _0x10547e;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/webhook',controller[_0xa524('0xa')]);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xb')]);router[_0xa524('0x8')](_0xa524('0xc'),auth[_0xa524('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xa524('0xd')]({'destination':function(_0x2ebea2,_0x59660a,_0x565fab){_0x565fab(null,path[_0xa524('0xe')](config[_0xa524('0xf')],_0xa524('0x10')));},'filename':function(_0x4936fa,_0x55117f,_0x14a0d6){_0x55117f['originalname']=_0x55117f[_0xa524('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x14a0d6(null,util[_0xa524('0x12')]('%s-%s%s',path[_0xa524('0x13')](_0x55117f[_0xa524('0x11')],path['extname'](_0x55117f[_0xa524('0x11')])),Date[_0xa524('0x14')](),path[_0xa524('0x15')](_0x55117f[_0xa524('0x11')])));}})});router[_0xa524('0x16')]('/',upload[_0xa524('0x17')](_0xa524('0x18')),controller['upload']);router[_0xa524('0x16')](_0xa524('0x19'),controller[_0xa524('0x1a')]);router[_0xa524('0x1b')](_0xa524('0x1c'),auth[_0xa524('0x9')](),controller[_0xa524('0x1d')]);router[_0xa524('0x1e')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0x1e')]);module[_0xa524('0x1f')]=router; \ No newline at end of file +var _0xa41a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','webhookGet','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xa41a,0x6b));var _0xaa41=function(_0x13b6d7,_0x1dcf18){_0x13b6d7=_0x13b6d7-0x0;var _0x2b2815=_0xa41a[_0x13b6d7];return _0x2b2815;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/webhook',controller[_0xaa41('0xc')]);router[_0xaa41('0xd')]('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xd')](_0xaa41('0xf'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);var upload=multer({'storage':multer[_0xaa41('0x11')]({'destination':function(_0x423a19,_0x1c291e,_0x5c9fc7){_0x5c9fc7(null,path[_0xaa41('0x12')](config[_0xaa41('0x13')],'server/files/plugins'));},'filename':function(_0x54827c,_0x1d0a54,_0x518b5b){_0x1d0a54[_0xaa41('0x14')]=_0x1d0a54[_0xaa41('0x14')][_0xaa41('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x518b5b(null,util[_0xaa41('0x16')](_0xaa41('0x17'),path['basename'](_0x1d0a54[_0xaa41('0x14')],path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])),Date[_0xaa41('0x19')](),path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])));}})});router[_0xaa41('0x1a')]('/',upload['single'](_0xaa41('0x1b')),controller[_0xaa41('0x1c')]);router[_0xaa41('0x1a')](_0xaa41('0x1d'),controller[_0xaa41('0x1e')]);router[_0xaa41('0x1f')](_0xaa41('0x20'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x21')]);router['delete']('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0x22')]);module[_0xaa41('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index b5c9aca..3f323c0 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 _0xa277=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always'];(function(_0x2800d9,_0x5ad932){var _0x298a61=function(_0x19fcd5){while(--_0x19fcd5){_0x2800d9['push'](_0x2800d9['shift']());}};_0x298a61(++_0x5ad932);}(_0xa277,0x105));var _0x7a27=function(_0xdd4b1,_0x1a89a8){_0xdd4b1=_0xdd4b1-0x0;var _0x218a9a=_0xa277[_0xdd4b1];return _0x218a9a;};'use strict';var Sequelize=require(_0x7a27('0x0'));module[_0x7a27('0x1')]={'name':{'type':Sequelize[_0x7a27('0x2')]},'type':{'type':Sequelize['ENUM'](_0x7a27('0x3'),'script')},'description':{'type':Sequelize[_0x7a27('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x7a27('0x2')],'comment':_0x7a27('0x5')},'active':{'type':Sequelize[_0x7a27('0x6')],'defaultValue':0x0,'comment':_0x7a27('0x7')},'sidebar':{'type':Sequelize[_0x7a27('0x8')](_0x7a27('0x9'),_0x7a27('0xa'),_0x7a27('0xb'),'never'),'defaultValue':_0x7a27('0xb'),'comment':_0x7a27('0xc')},'icon':{'type':Sequelize[_0x7a27('0x2')]},'adminUrl':{'type':Sequelize[_0x7a27('0x2')]},'agentUrl':{'type':Sequelize[_0x7a27('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdadf=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script'];(function(_0xc2bf73,_0x117f9d){var _0x3a37fd=function(_0x2c5031){while(--_0x2c5031){_0xc2bf73['push'](_0xc2bf73['shift']());}};_0x3a37fd(++_0x117f9d);}(_0xdadf,0x13d));var _0xfdad=function(_0x211feb,_0x2ad482){_0x211feb=_0x211feb-0x0;var _0x3a54bb=_0xdadf[_0x211feb];return _0x3a54bb;};'use strict';var Sequelize=require('sequelize');module[_0xfdad('0x0')]={'name':{'type':Sequelize[_0xfdad('0x1')]},'type':{'type':Sequelize[_0xfdad('0x2')](_0xfdad('0x3'),_0xfdad('0x4'))},'description':{'type':Sequelize[_0xfdad('0x5')]},'version':{'type':Sequelize[_0xfdad('0x5')]},'path':{'type':Sequelize[_0xfdad('0x1')],'comment':_0xfdad('0x6')},'active':{'type':Sequelize[_0xfdad('0x7')],'defaultValue':0x0,'comment':_0xfdad('0x8')},'sidebar':{'type':Sequelize[_0xfdad('0x2')](_0xfdad('0x9'),_0xfdad('0xa'),'always',_0xfdad('0xb')),'defaultValue':_0xfdad('0xc'),'comment':_0xfdad('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xfdad('0x1')]},'agentUrl':{'type':Sequelize[_0xfdad('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xfdad('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 18531ef..04614b3 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 _0x6070=['role','UserProfileSection','userProfileId','UserProfileResource','Zip\x20archive\x20removed','delete','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','catch','show','params','model','find','download','join','root','server/files/plugins','format','%s.zip','path','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','node_modules/**/*','close','existsSync','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','scriptName','create','body'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x6070,0xbf));var _0x0607=function(_0x489ba1,_0x1f6526){_0x489ba1=_0x489ba1-0x0;var _0x2fef6b=_0x6070[_0x489ba1];return _0x2fef6b;};'use strict';var emlformat=require(_0x0607('0x0'));var rimraf=require(_0x0607('0x1'));var zipdir=require(_0x0607('0x2'));var jsonpatch=require(_0x0607('0x3'));var rp=require('request-promise');var moment=require(_0x0607('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0607('0x5'));var util=require(_0x0607('0x6'));var path=require('path');var sox=require(_0x0607('0x7'));var csv=require(_0x0607('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0607('0x9'));var squel=require(_0x0607('0xa'));var crypto=require(_0x0607('0xb'));var jsforce=require(_0x0607('0xc'));var deskjs=require(_0x0607('0xd'));var toCsv=require(_0x0607('0x8'));var querystring=require('querystring');var Papa=require(_0x0607('0xe'));var extract=require(_0x0607('0xf'));var rimraf=require(_0x0607('0x1'));var archiver=require(_0x0607('0x10'));var Redis=require(_0x0607('0x11'));var authService=require(_0x0607('0x12'));var qs=require(_0x0607('0x13'));var as=require(_0x0607('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0607('0x15'))('api');var utils=require(_0x0607('0x16'));var config=require(_0x0607('0x17'));var licenseUtil=require(_0x0607('0x18'));var db=require(_0x0607('0x19'))['db'];config[_0x0607('0x1a')]=_['defaults'](config[_0x0607('0x1a')],{'host':_0x0607('0x1b'),'port':0x18eb});var socket=require(_0x0607('0x1c'))(new Redis(config[_0x0607('0x1a')]));require(_0x0607('0x1d'))['register'](socket);function respondWithStatusCode(_0x31481f,_0x1005d1){_0x1005d1=_0x1005d1||0xcc;return function(_0x318b5f){if(_0x318b5f){return _0x31481f[_0x0607('0x1e')](_0x1005d1);}return _0x31481f[_0x0607('0x1f')](_0x1005d1)[_0x0607('0x20')]();};}function respondWithResult(_0x3026d5,_0xf32027){_0xf32027=_0xf32027||0xc8;return function(_0xe3567f){if(_0xe3567f){return _0x3026d5['status'](_0xf32027)['json'](_0xe3567f);}};}function respondWithFilteredResult(_0x161138,_0x3f33e6){return function(_0x2f02d2){if(_0x2f02d2){var _0x14aa6a=typeof _0x3f33e6[_0x0607('0x21')]===_0x0607('0x22')&&typeof _0x3f33e6[_0x0607('0x23')]===_0x0607('0x22');var _0x4355e2=_0x2f02d2[_0x0607('0x24')];var _0x5d57ad=_0x14aa6a?0x0:_0x3f33e6[_0x0607('0x21')];var _0x10bd1c=_0x14aa6a?_0x2f02d2[_0x0607('0x24')]:_0x3f33e6[_0x0607('0x21')]+_0x3f33e6[_0x0607('0x23')];var _0x2fc1a7;if(_0x10bd1c>=_0x4355e2){_0x10bd1c=_0x4355e2;_0x2fc1a7=0xc8;}else{_0x2fc1a7=0xce;}_0x161138[_0x0607('0x1f')](_0x2fc1a7);return _0x161138[_0x0607('0x25')](_0x0607('0x26'),_0x5d57ad+'-'+_0x10bd1c+'/'+_0x4355e2)['json'](_0x2f02d2);}return null;};}function patchUpdates(_0x4342b0){return function(_0x19dc66){try{jsonpatch[_0x0607('0x27')](_0x19dc66,_0x4342b0,!![]);}catch(_0x4f30e1){return BPromise[_0x0607('0x28')](_0x4f30e1);}return _0x19dc66[_0x0607('0x29')]();};}function saveUpdates(_0x525564,_0xb88078){return function(_0x189639){if(_0x189639){return _0x189639[_0x0607('0x2a')](_0x525564)[_0x0607('0x2b')](function(_0x781ad5){return _0x781ad5;});}return null;};}function removeEntity(_0x2cf95e,_0x21ddce){return function(_0x3a8317){if(_0x3a8317){return _0x3a8317[_0x0607('0x2c')]()[_0x0607('0x2b')](function(){var _0x23d287=_0x3a8317[_0x0607('0x2d')]({'plain':!![]});var _0xd59568=_0x0607('0x2e');return db['UserProfileResource'][_0x0607('0x2c')]({'where':{'type':_0xd59568,'resourceId':_0x23d287['id']}})[_0x0607('0x2b')](function(){return _0x3a8317;});})[_0x0607('0x2b')](function(){_0x2cf95e[_0x0607('0x1f')](0xcc)[_0x0607('0x20')]();});}};}function handleEntityNotFound(_0x2a4115,_0x359a3e){return function(_0x49b67d){if(!_0x49b67d){_0x2a4115[_0x0607('0x1e')](0x194);}return _0x49b67d;};}function handleError(_0x1d0d1e,_0x56078c){_0x56078c=_0x56078c||0x1f4;return function(_0x252e45){logger[_0x0607('0x2f')](_0x252e45[_0x0607('0x30')]);if(_0x252e45[_0x0607('0x31')]){delete _0x252e45[_0x0607('0x31')];}_0x1d0d1e[_0x0607('0x1f')](_0x56078c)[_0x0607('0x32')](_0x252e45);};}exports[_0x0607('0x33')]=function(_0x3e3d5f,_0x42a91f){var _0x10fc51={},_0x3e0ba7={},_0x4ff336={'count':0x0,'rows':[]};var _0xd064cf=_[_0x0607('0x34')](db['Plugin'][_0x0607('0x35')],function(_0x19ff0a){return{'name':_0x19ff0a[_0x0607('0x36')],'type':_0x19ff0a[_0x0607('0x37')][_0x0607('0x38')]};});_0x3e0ba7['model']=_[_0x0607('0x34')](_0xd064cf,'name');_0x3e0ba7['query']=_[_0x0607('0x39')](_0x3e3d5f[_0x0607('0x3a')]);_0x3e0ba7[_0x0607('0x3b')]=_[_0x0607('0x3c')](_0x3e0ba7['model'],_0x3e0ba7[_0x0607('0x3a')]);_0x10fc51[_0x0607('0x3d')]=_[_0x0607('0x3c')](_0x3e0ba7['model'],qs[_0x0607('0x3e')](_0x3e3d5f[_0x0607('0x3a')]['fields']));_0x10fc51['attributes']=_0x10fc51[_0x0607('0x3d')][_0x0607('0x3f')]?_0x10fc51[_0x0607('0x3d')]:_0x3e0ba7['model'];if(!_0x3e3d5f['query'][_0x0607('0x40')](_0x0607('0x41'))){_0x10fc51[_0x0607('0x23')]=qs[_0x0607('0x23')](_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x23')]);_0x10fc51[_0x0607('0x21')]=qs[_0x0607('0x21')](_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x21')]);}_0x10fc51['order']=qs[_0x0607('0x42')](_0x3e3d5f['query'][_0x0607('0x42')]);_0x10fc51[_0x0607('0x43')]=qs[_0x0607('0x3b')](_[_0x0607('0x44')](_0x3e3d5f[_0x0607('0x3a')],_0x3e0ba7['filters']),_0xd064cf);if(_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x45')]){_0x10fc51['where']=_[_0x0607('0x46')](_0x10fc51[_0x0607('0x43')],{'$or':_[_0x0607('0x34')](_0xd064cf,function(_0x1df2c2){if(_0x1df2c2[_0x0607('0x37')]!==_0x0607('0x47')){var _0x19994a={};_0x19994a[_0x1df2c2[_0x0607('0x31')]]={'$like':'%'+_0x3e3d5f['query'][_0x0607('0x45')]+'%'};return _0x19994a;}})});}_0x10fc51=_[_0x0607('0x46')]({},_0x10fc51,_0x3e3d5f[_0x0607('0x48')]);var _0x3cc549={'where':_0x10fc51[_0x0607('0x43')]};return db[_0x0607('0x49')]['count'](_0x3cc549)['then'](function(_0x393d2e){_0x4ff336[_0x0607('0x24')]=_0x393d2e;if(_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x4a')]){_0x10fc51[_0x0607('0x4b')]=[{'all':!![]}];}return db[_0x0607('0x49')]['findAll'](_0x10fc51);})[_0x0607('0x2b')](function(_0x501082){_0x4ff336['rows']=_0x501082;return _0x4ff336;})['then'](respondWithFilteredResult(_0x42a91f,_0x10fc51))[_0x0607('0x4c')](handleError(_0x42a91f,null));};exports[_0x0607('0x4d')]=function(_0x2f138a,_0x2d56c9){var _0x2beb69={'raw':!![],'where':{'id':_0x2f138a[_0x0607('0x4e')]['id']}},_0x236873={};_0x236873['model']=_[_0x0607('0x39')](db[_0x0607('0x49')]['rawAttributes']);_0x236873[_0x0607('0x3a')]=_[_0x0607('0x39')](_0x2f138a[_0x0607('0x3a')]);_0x236873[_0x0607('0x3b')]=_[_0x0607('0x3c')](_0x236873[_0x0607('0x4f')],_0x236873[_0x0607('0x3a')]);_0x2beb69[_0x0607('0x3d')]=_[_0x0607('0x3c')](_0x236873['model'],qs[_0x0607('0x3e')](_0x2f138a[_0x0607('0x3a')][_0x0607('0x3e')]));_0x2beb69[_0x0607('0x3d')]=_0x2beb69[_0x0607('0x3d')][_0x0607('0x3f')]?_0x2beb69['attributes']:_0x236873[_0x0607('0x4f')];if(_0x2f138a['query'][_0x0607('0x4a')]){_0x2beb69[_0x0607('0x4b')]=[{'all':!![]}];}_0x2beb69=_['merge']({},_0x2beb69,_0x2f138a[_0x0607('0x48')]);return db[_0x0607('0x49')][_0x0607('0x50')](_0x2beb69)['then'](handleEntityNotFound(_0x2d56c9,null))[_0x0607('0x2b')](respondWithResult(_0x2d56c9,null))[_0x0607('0x4c')](handleError(_0x2d56c9,null));};exports[_0x0607('0x51')]=function(_0x2cdb4e,_0x4b9fee,_0x5b2254){return db[_0x0607('0x49')][_0x0607('0x50')]({'where':{'id':_0x2cdb4e[_0x0607('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})[_0x0607('0x2b')](handleEntityNotFound(_0x4b9fee,null))[_0x0607('0x2b')](function(_0xf32953){if(_0xf32953){var _0x243a0=path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),util[_0x0607('0x55')](_0x0607('0x56'),path['basename'](_0xf32953[_0x0607('0x57')])));var _0x2085de=fs[_0x0607('0x58')](_0x243a0);var _0x457e33=archiver(_0x0607('0x59'),{'zlib':{'level':0x9}});_0x457e33['on'](_0x0607('0x5a'),function(_0x87db94){if(_0x87db94[_0x0607('0x5b')]===_0x0607('0x5c')){logger[_0x0607('0x2f')](_0x87db94);}else{throw new db[(_0x0607('0x5d'))]['Error'](_0x0607('0x5e'));}});_0x457e33['on'](_0x0607('0x2f'),function(_0x16058f){throw new db['Sequelize'][(_0x0607('0x5f'))](_0x0607('0x5e'));});_0x457e33[_0x0607('0x60')](_0x2085de);_0x457e33[_0x0607('0x61')](_0x0607('0x62'),{'cwd':path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),path[_0x0607('0x63')](_0xf32953[_0x0607('0x57')])),'ignore':[path['join'](path['basename'](_0xf32953[_0x0607('0x57')]),_0x0607('0x64')),path['join'](path['basename'](_0xf32953[_0x0607('0x57')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x2085de['on'](_0x0607('0x65'),function(){if(!fs[_0x0607('0x66')](_0x243a0)){throw new db[(_0x0607('0x5d'))][(_0x0607('0x5f'))]('Plugin\x20not\x20found');}return _0x4b9fee[_0x0607('0x51')](_0x243a0,util['format'](_0x0607('0x56'),path[_0x0607('0x67')](_0xf32953[_0x0607('0x57')])),function(_0x1a98df){if(_0x1a98df){throw new db[(_0x0607('0x5d'))][(_0x0607('0x5f'))](_0x0607('0x68'));}fs[_0x0607('0x69')](_0x243a0);logger[_0x0607('0x6a')](_0x0607('0x6b'));logger[_0x0607('0x6a')](_0x0607('0x6c'));});});}return null;})[_0x0607('0x4c')](handleError(_0x4b9fee,null));};exports['upload']=function(_0x48d782,_0x1fe4d5,_0xa1e767){var _0x2873b7=path[_0x0607('0x67')](_0x48d782[_0x0607('0x6d')][_0x0607('0x6e')],path[_0x0607('0x6f')](_0x48d782[_0x0607('0x6d')][_0x0607('0x6e')]));var _0x2f3a02=path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),_0x48d782[_0x0607('0x6d')][_0x0607('0x6e')]);var _0x5be7bd=path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),_0x2873b7);logger['info'](_0x0607('0x70'),_0x2f3a02);logger[_0x0607('0x6a')](_0x0607('0x71'),_0x5be7bd);try{fs['chmodSync'](_0x2f3a02,parseInt('0777',0x8));extract(_0x2f3a02,{'dir':_0x5be7bd},function(_0x210f0d){if(_0x210f0d){logger[_0x0607('0x2f')](_0x210f0d);handleError(_0x210f0d,!![]);};var _0x565110=fs[_0x0607('0x72')](_0x5be7bd);if(_0x565110[_0x0607('0x3f')]>0x1){removeReferences(_0x2f3a02,_0x5be7bd);logger[_0x0607('0x2f')](_0x0607('0x73'));return _0xa1e767(new Error(_0x0607('0x73')));}var _0x2a80be=fs[_0x0607('0x74')](path[_0x0607('0x52')](_0x5be7bd,_0x565110[0x0]));if(_0x2a80be[_0x0607('0x75')]()){removeReferences(_0x2f3a02,_0x5be7bd);logger[_0x0607('0x2f')](_0x0607('0x73'));return _0xa1e767(new Error(_0x0607('0x73')));}if(_0x2a80be[_0x0607('0x76')]()){var _0x3a9710=fs['readdirSync'](path[_0x0607('0x52')](_0x5be7bd,_0x565110[0x0]));if(_0x3a9710[_0x0607('0x3f')]===0x0){removeReferences(_0x2f3a02,_0x5be7bd);logger[_0x0607('0x2f')](_0x0607('0x73'));return _0xa1e767(new Error(_0x0607('0x73')));}var _0x35270d=_0x3a9710[_0x0607('0x77')](function(_0xd4dd02){return _0xd4dd02===_0x0607('0x78');});if(!_0x35270d){return _0xa1e767(new Error('Plugin\x20manifest\x20missing'));}var _0x4f9508=fs[_0x0607('0x79')](path[_0x0607('0x52')](_0x5be7bd,_0x565110[0x0],'manifest.json'));var _0x25899a=JSON[_0x0607('0x7a')](_0x4f9508);if('undefined'==typeof _0x25899a[_0x0607('0x31')]){return _0xa1e767(new Error(_0x0607('0x7b')));}if(_0x0607('0x22')==typeof _0x25899a[_0x0607('0x37')]){return _0xa1e767(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x0607('0x22')==typeof _0x25899a['version']){return _0xa1e767(new Error(_0x0607('0x7c')));}if('undefined'==typeof _0x25899a[_0x0607('0x7d')]){return _0xa1e767(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x25899a[_0x0607('0x37')]===_0x0607('0x7e')){if(_0x0607('0x22')==typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]){return _0xa1e767(new Error(_0x0607('0x80')));}if(_0x0607('0x22')==typeof _0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x81')]&&_0x0607('0x22')==typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')][_0x0607('0x82')]){return _0xa1e767(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x25899a[_0x0607('0x37')]===_0x0607('0x83')){if(_0x0607('0x22')==typeof _0x25899a[_0x0607('0x7d')]['scriptName']){return _0xa1e767(new Error(_0x0607('0x84')));}if('undefined'==typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x85')]){return _0xa1e767(new Error(_0x0607('0x86')));}}else{return _0xa1e767(new Error(_0x0607('0x87')));}var _0x3d1a7f=_0x25899a[_0x0607('0x31')];var _0x4dc514=_0x25899a[_0x0607('0x88')];var _0x5c086d=_0x25899a[_0x0607('0x37')];var _0xaca006=_0x25899a[_0x0607('0x89')]?_0x25899a[_0x0607('0x89')]:_0x0607('0x8a');var _0x55b7c4=_0x25899a[_0x0607('0x8b')]?_0x25899a[_0x0607('0x8b')]:_0x0607('0x8c');var _0x20aba2='';var _0x232f32='';var _0x4be89c='';var _0x412411='';var _0x521611=_0x25899a['version'];if(_0x5c086d==='html'){if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')]['views']['admin']){var _0x38db3b=_0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x38db3b)){_0x20aba2=path[_0x0607('0x52')](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x38db3b);}else{_0x20aba2=_0x38db3b;}}else{logger[_0x0607('0x6a')](_0x0607('0x8e'));}if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]['agent']){var _0x5bc10b=_0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x0607('0x8f')](_0x5bc10b)){_0x232f32=path['join'](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x5bc10b);}else{_0x232f32=_0x5bc10b;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5c086d==='script'){_0x4be89c=_0x25899a[_0x0607('0x7d')][_0x0607('0x90')];_0x412411=_0x25899a[_0x0607('0x7d')][_0x0607('0x85')];if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]){if('undefined'!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]['admin']){var _0x38db3b=_0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x0607('0x8f')](_0x38db3b)){_0x20aba2=path[_0x0607('0x52')](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x38db3b);}else{_0x20aba2=_0x38db3b;}}if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')][_0x0607('0x82')]){var _0x5bc10b=_0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x0607('0x8f')](_0x5bc10b)){_0x232f32=path[_0x0607('0x52')](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x5bc10b);}else{_0x232f32=_0x5bc10b;}}}}var _0x38fe2a={'name':_0x3d1a7f,'description':_0x4dc514,'path':path['join'](_0x2873b7,_0x565110[0x0]),'type':_0x5c086d,'sidebar':_0xaca006,'icon':_0x55b7c4,'adminUrl':_0x20aba2,'agentUrl':_0x232f32,'scriptName':_0x4be89c,'scriptPath':_0x412411,'version':_0x521611};removeReferences(_0x2f3a02,null);return db[_0x0607('0x49')][_0x0607('0x91')](_0x38fe2a)[_0x0607('0x2b')](function(_0x109ced){var _0x166efb={'role':_0x48d782[_0x0607('0x92')]['role'],'userProfileId':_0x48d782[_0x0607('0x92')]['userProfileId']};if(!_0x166efb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x166efb[_0x0607('0x93')]==='user'){var _0x3c344b=_0x109ced[_0x0607('0x2d')]({'plain':!![]});return db[_0x0607('0x94')][_0x0607('0x50')]({'where':{'name':_0x0607('0x2e'),'userProfileId':_0x166efb[_0x0607('0x95')]},'raw':!![]})[_0x0607('0x2b')](function(_0x260b4c){if(_0x260b4c&&_0x260b4c['autoAssociation']===0x0){return db[_0x0607('0x96')][_0x0607('0x91')]({'name':_0x3c344b[_0x0607('0x31')],'resourceId':_0x3c344b['id'],'type':_0x260b4c[_0x0607('0x31')],'sectionId':_0x260b4c['id']},{})[_0x0607('0x2b')](function(){return _0x109ced;});}else{return _0x109ced;}})['catch'](function(_0x5a148d){logger[_0x0607('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a148d);throw _0x5a148d;});}return _0x109ced;})['then'](respondWithResult(_0x1fe4d5,null))[_0x0607('0x4c')](handleError(_0x1fe4d5,null));}});}catch(_0x2206c3){_0x1fe4d5[_0x0607('0x1f')](0x1f4)[_0x0607('0x32')](_0x2206c3);}};function removeReferences(_0x42b276,_0x21328a){try{if(_0x42b276){fs[_0x0607('0x69')](_0x42b276);logger[_0x0607('0x6a')](_0x0607('0x97'));}if(_0x21328a){rimraf(_0x21328a,function(){});logger[_0x0607('0x6a')]('Extracted\x20folder\x20removed');}}catch(_0x1306bd){logger[_0x0607('0x2f')](_0x1306bd);}}exports[_0x0607('0x2a')]=function(_0x1a7eda,_0x2413bd,_0x54acec){return db[_0x0607('0x49')][_0x0607('0x50')]({'where':{'id':_0x1a7eda[_0x0607('0x4e')]['id']}})[_0x0607('0x2b')](handleEntityNotFound(_0x2413bd,null))[_0x0607('0x2b')](saveUpdates(_0x1a7eda[_0x0607('0x92')],null))[_0x0607('0x2b')](respondWithResult(_0x2413bd,null))['catch'](handleError(_0x2413bd,null));};exports[_0x0607('0x98')]=function(_0x4c4073,_0xdb7664,_0x74f56){return db['Plugin'][_0x0607('0x50')]({'where':{'id':_0x4c4073[_0x0607('0x4e')]['id']}})[_0x0607('0x2b')](function(_0x3de24c){if(_0x3de24c){return _0x3de24c['destroy']();}})[_0x0607('0x2b')](function(_0x4ed6d0){rimraf(path[_0x0607('0x52')](config[_0x0607('0x53')],'server/files/plugins',path[_0x0607('0x63')](_0x4ed6d0[_0x0607('0x57')])),function(){});return _0x4ed6d0;})['then'](handleEntityNotFound(_0xdb7664,null))[_0x0607('0x2b')](respondWithStatusCode(_0xdb7664,null))[_0x0607('0x4c')](handleError(_0xdb7664,null));};exports['webhookGet']=function(_0x40efda,_0x4545fe,_0x38cca3){return BPromise[_0x0607('0x99')]()[_0x0607('0x2b')](function(){if(!_0x40efda['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x40efda[_0x0607('0x3a')][_0x0607('0x9a')]){throw new Error(_0x0607('0x9b'));}var _0x88814=_0x40efda[_0x0607('0x3a')][_0x0607('0x9c')]?_0x40efda['query'][_0x0607('0x9c')]+':'+_0x40efda['query'][_0x0607('0x9a')]:_0x0607('0x9d')+_0x40efda['query'][_0x0607('0x9a')];var _0x30eb97=_0x40efda[_0x0607('0x3a')][_0x0607('0x9e')]?_0x40efda[_0x0607('0x3a')][_0x0607('0x9e')]:!![];var _0xbe0a42=_0x40efda[_0x0607('0x3a')][_0x0607('0x9f')]?_0x40efda[_0x0607('0x3a')][_0x0607('0x9f')]:null;var _0x128fbc={'method':_0x40efda['method'],'uri':util[_0x0607('0x55')](_0x0607('0xa0'),_0x88814,_0x40efda['query'][_0x0607('0x57')]),'json':_0x30eb97,'resolveWithFullResponse':!![],'encoding':_0xbe0a42,'qs':_0x40efda[_0x0607('0x3a')]};if(_0x40efda['headers']){_0x128fbc[_0x0607('0xa1')]=_0x40efda[_0x0607('0xa1')];if(_0x128fbc[_0x0607('0xa1')][_0x0607('0xa2')]){delete _0x128fbc['headers'][_0x0607('0xa2')];}}if(_0x128fbc[_0x0607('0xa1')]['content-type']){delete _0x128fbc[_0x0607('0xa1')][_0x0607('0xa3')];}return rp(_0x128fbc);})['then'](function(_0x1f0b38){if(_0x1f0b38){_0x4545fe[_0x0607('0x25')](_0x1f0b38['headers']);logger[_0x0607('0x6a')](_0x1f0b38[_0x0607('0x92')]);if(_[_0x0607('0xa4')](_0x40efda['query'][_0x0607('0x57')],'download')&&_0x1f0b38[_0x0607('0xa5')]==0x1f4){return _0x4545fe['sendStatus'](_0x1f0b38['statusCode']);}else{return _0x4545fe[_0x0607('0x1f')](_0x1f0b38[_0x0607('0xa5')])[_0x0607('0x32')](_0x1f0b38[_0x0607('0x92')]);}}else{return _0x4545fe[_0x0607('0x1e')](0xc8);}})[_0x0607('0x4c')](handleError(_0x4545fe,null));};exports[_0x0607('0xa6')]=function(_0x45fd1b,_0x58b099,_0x3d53d1){return BPromise['resolve']()[_0x0607('0x2b')](function(){if(!_0x45fd1b[_0x0607('0x3a')][_0x0607('0x57')]){throw new Error(_0x0607('0xa7'));}if(!_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3f3658=_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9c')]?_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9c')]+':'+_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9a')]:_0x0607('0x9d')+_0x45fd1b['query'][_0x0607('0x9a')];var _0x2110b1=_0x45fd1b['query'][_0x0607('0x9e')]?_0x45fd1b['query'][_0x0607('0x9e')]:!![];var _0x511e29=_0x45fd1b['query'][_0x0607('0x9f')]?_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9f')]:null;var _0x17e60b={'method':_0x45fd1b[_0x0607('0xa8')],'uri':util[_0x0607('0x55')](_0x0607('0xa0'),_0x3f3658,_0x45fd1b[_0x0607('0x3a')][_0x0607('0x57')]),'json':_0x2110b1,'resolveWithFullResponse':!![],'encoding':_0x511e29,'body':_0x45fd1b['body']};if(_0x45fd1b[_0x0607('0xa1')]){_0x17e60b[_0x0607('0xa1')]=_0x45fd1b[_0x0607('0xa1')];if(_0x17e60b['headers']['content-length']){delete _0x17e60b['headers'][_0x0607('0xa2')];}}if(_0x17e60b[_0x0607('0xa1')][_0x0607('0xa3')]){delete _0x17e60b[_0x0607('0xa1')][_0x0607('0xa3')];}return rp(_0x17e60b);})[_0x0607('0x2b')](function(_0x1247dd){if(_0x1247dd){_0x58b099[_0x0607('0x25')](_0x1247dd[_0x0607('0xa1')]);logger[_0x0607('0x6a')](_0x1247dd[_0x0607('0x92')]);return _0x58b099[_0x0607('0x1f')](_0x1247dd['statusCode'])[_0x0607('0x32')](_0x1247dd[_0x0607('0x92')]);}else{return _0x58b099[_0x0607('0x1e')](0xc8);}})[_0x0607('0x4c')](handleError(_0x58b099,null));}; \ No newline at end of file +var _0xd0d0=['localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','get','Plugins','UserProfileResource','then','name','map','Plugin','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','catch','show','params','include','download','join','root','server/files/plugins','%s.zip','createWriteStream','zip','warning','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','plugins','role','UserProfileSection','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','update','body','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis'];(function(_0x208cdd,_0x44b7e6){var _0x155287=function(_0x4713f4){while(--_0x4713f4){_0x208cdd['push'](_0x208cdd['shift']());}};_0x155287(++_0x44b7e6);}(_0xd0d0,0x133));var _0x0d0d=function(_0xa57213,_0x2eadde){_0xa57213=_0xa57213-0x0;var _0x328828=_0xd0d0[_0xa57213];return _0x328828;};'use strict';var emlformat=require(_0x0d0d('0x0'));var rimraf=require(_0x0d0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d0d('0x2'));var rp=require(_0x0d0d('0x3'));var moment=require('moment');var BPromise=require(_0x0d0d('0x4'));var Mustache=require(_0x0d0d('0x5'));var util=require(_0x0d0d('0x6'));var path=require(_0x0d0d('0x7'));var sox=require(_0x0d0d('0x8'));var csv=require('to-csv');var ejs=require(_0x0d0d('0x9'));var fs=require('fs');var fs_extra=require(_0x0d0d('0xa'));var _=require(_0x0d0d('0xb'));var squel=require(_0x0d0d('0xc'));var crypto=require(_0x0d0d('0xd'));var jsforce=require(_0x0d0d('0xe'));var deskjs=require(_0x0d0d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0d0d('0x10'));var Papa=require('papaparse');var extract=require(_0x0d0d('0x11'));var rimraf=require(_0x0d0d('0x1'));var archiver=require('archiver');var Redis=require(_0x0d0d('0x12'));var authService=require(_0x0d0d('0x13'));var qs=require(_0x0d0d('0x14'));var as=require(_0x0d0d('0x15'));var hardwareService=require(_0x0d0d('0x16'));var logger=require(_0x0d0d('0x17'))(_0x0d0d('0x18'));var utils=require(_0x0d0d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0d0d('0x1a'));var db=require(_0x0d0d('0x1b'))['db'];config[_0x0d0d('0x1c')]=_['defaults'](config[_0x0d0d('0x1c')],{'host':_0x0d0d('0x1d'),'port':0x18eb});var socket=require(_0x0d0d('0x1e'))(new Redis(config[_0x0d0d('0x1c')]));require('./plugin.socket')[_0x0d0d('0x1f')](socket);function respondWithStatusCode(_0x472f89,_0x542c52){_0x542c52=_0x542c52||0xcc;return function(_0x27ff97){if(_0x27ff97){return _0x472f89[_0x0d0d('0x20')](_0x542c52);}return _0x472f89[_0x0d0d('0x21')](_0x542c52)[_0x0d0d('0x22')]();};}function respondWithResult(_0x3f139b,_0x3daa37){_0x3daa37=_0x3daa37||0xc8;return function(_0x50f816){if(_0x50f816){return _0x3f139b[_0x0d0d('0x21')](_0x3daa37)[_0x0d0d('0x23')](_0x50f816);}};}function respondWithFilteredResult(_0xc5eb45,_0x559e78){return function(_0x33b80b){if(_0x33b80b){var _0x577535=typeof _0x559e78[_0x0d0d('0x24')]===_0x0d0d('0x25')&&typeof _0x559e78[_0x0d0d('0x26')]===_0x0d0d('0x25');var _0x4b261a=_0x33b80b[_0x0d0d('0x27')];var _0x40e5df=_0x577535?0x0:_0x559e78[_0x0d0d('0x24')];var _0x1bc4a6=_0x577535?_0x33b80b[_0x0d0d('0x27')]:_0x559e78[_0x0d0d('0x24')]+_0x559e78['limit'];var _0x36363c;if(_0x1bc4a6>=_0x4b261a){_0x1bc4a6=_0x4b261a;_0x36363c=0xc8;}else{_0x36363c=0xce;}_0xc5eb45[_0x0d0d('0x21')](_0x36363c);return _0xc5eb45[_0x0d0d('0x28')](_0x0d0d('0x29'),_0x40e5df+'-'+_0x1bc4a6+'/'+_0x4b261a)['json'](_0x33b80b);}return null;};}function patchUpdates(_0x348bf8){return function(_0x3fdda3){try{jsonpatch[_0x0d0d('0x2a')](_0x3fdda3,_0x348bf8,!![]);}catch(_0x1a1821){return BPromise[_0x0d0d('0x2b')](_0x1a1821);}return _0x3fdda3['save']();};}function saveUpdates(_0x58d4d9,_0x571090){return function(_0x4152d8){if(_0x4152d8){return _0x4152d8['update'](_0x58d4d9)['then'](function(_0xe7a94){return _0xe7a94;});}return null;};}function removeEntity(_0x2179c8,_0x443213){return function(_0x57cd93){if(_0x57cd93){return _0x57cd93[_0x0d0d('0x2c')]()['then'](function(){var _0x5ad98c=_0x57cd93[_0x0d0d('0x2d')]({'plain':!![]});var _0x428c1b=_0x0d0d('0x2e');return db[_0x0d0d('0x2f')][_0x0d0d('0x2c')]({'where':{'type':_0x428c1b,'resourceId':_0x5ad98c['id']}})[_0x0d0d('0x30')](function(){return _0x57cd93;});})[_0x0d0d('0x30')](function(){_0x2179c8[_0x0d0d('0x21')](0xcc)[_0x0d0d('0x22')]();});}};}function handleEntityNotFound(_0x2d68a5,_0x4523d8){return function(_0x23537c){if(!_0x23537c){_0x2d68a5[_0x0d0d('0x20')](0x194);}return _0x23537c;};}function handleError(_0x11ace3,_0x3e8a2e){_0x3e8a2e=_0x3e8a2e||0x1f4;return function(_0x1ad9ba){logger['error'](_0x1ad9ba['stack']);if(_0x1ad9ba[_0x0d0d('0x31')]){delete _0x1ad9ba[_0x0d0d('0x31')];}_0x11ace3[_0x0d0d('0x21')](_0x3e8a2e)['send'](_0x1ad9ba);};}exports['index']=function(_0x4feb26,_0x19bf37){var _0x2fc3c8={},_0x2845ea={},_0x135419={'count':0x0,'rows':[]};var _0x1852f4=_[_0x0d0d('0x32')](db[_0x0d0d('0x33')][_0x0d0d('0x34')],function(_0x1a3233){return{'name':_0x1a3233[_0x0d0d('0x35')],'type':_0x1a3233['type'][_0x0d0d('0x36')]};});_0x2845ea['model']=_[_0x0d0d('0x32')](_0x1852f4,_0x0d0d('0x31'));_0x2845ea[_0x0d0d('0x37')]=_[_0x0d0d('0x38')](_0x4feb26[_0x0d0d('0x37')]);_0x2845ea[_0x0d0d('0x39')]=_[_0x0d0d('0x3a')](_0x2845ea[_0x0d0d('0x3b')],_0x2845ea[_0x0d0d('0x37')]);_0x2fc3c8[_0x0d0d('0x3c')]=_[_0x0d0d('0x3a')](_0x2845ea[_0x0d0d('0x3b')],qs[_0x0d0d('0x3d')](_0x4feb26[_0x0d0d('0x37')][_0x0d0d('0x3d')]));_0x2fc3c8[_0x0d0d('0x3c')]=_0x2fc3c8['attributes'][_0x0d0d('0x3e')]?_0x2fc3c8['attributes']:_0x2845ea[_0x0d0d('0x3b')];if(!_0x4feb26[_0x0d0d('0x37')][_0x0d0d('0x3f')]('nolimit')){_0x2fc3c8[_0x0d0d('0x26')]=qs[_0x0d0d('0x26')](_0x4feb26[_0x0d0d('0x37')][_0x0d0d('0x26')]);_0x2fc3c8[_0x0d0d('0x24')]=qs[_0x0d0d('0x24')](_0x4feb26[_0x0d0d('0x37')][_0x0d0d('0x24')]);}_0x2fc3c8[_0x0d0d('0x40')]=qs['sort'](_0x4feb26['query'][_0x0d0d('0x41')]);_0x2fc3c8[_0x0d0d('0x42')]=qs[_0x0d0d('0x39')](_[_0x0d0d('0x43')](_0x4feb26[_0x0d0d('0x37')],_0x2845ea[_0x0d0d('0x39')]),_0x1852f4);if(_0x4feb26[_0x0d0d('0x37')][_0x0d0d('0x44')]){_0x2fc3c8[_0x0d0d('0x42')]=_['merge'](_0x2fc3c8['where'],{'$or':_[_0x0d0d('0x32')](_0x1852f4,function(_0x5a5acc){if(_0x5a5acc[_0x0d0d('0x45')]!==_0x0d0d('0x46')){var _0x4fd0e5={};_0x4fd0e5[_0x5a5acc[_0x0d0d('0x31')]]={'$like':'%'+_0x4feb26[_0x0d0d('0x37')][_0x0d0d('0x44')]+'%'};return _0x4fd0e5;}})});}_0x2fc3c8=_[_0x0d0d('0x47')]({},_0x2fc3c8,_0x4feb26[_0x0d0d('0x48')]);var _0x395255={'where':_0x2fc3c8[_0x0d0d('0x42')]};return db[_0x0d0d('0x33')]['count'](_0x395255)[_0x0d0d('0x30')](function(_0x2d32a2){_0x135419['count']=_0x2d32a2;if(_0x4feb26[_0x0d0d('0x37')]['includeAll']){_0x2fc3c8['include']=[{'all':!![]}];}return db[_0x0d0d('0x33')]['findAll'](_0x2fc3c8);})[_0x0d0d('0x30')](function(_0x446c9a){_0x135419['rows']=_0x446c9a;return _0x135419;})[_0x0d0d('0x30')](respondWithFilteredResult(_0x19bf37,_0x2fc3c8))[_0x0d0d('0x49')](handleError(_0x19bf37,null));};exports[_0x0d0d('0x4a')]=function(_0x5bfbb9,_0x5c0cdd){var _0x530e05={'raw':!![],'where':{'id':_0x5bfbb9[_0x0d0d('0x4b')]['id']}},_0x19dcd0={};_0x19dcd0[_0x0d0d('0x3b')]=_['keys'](db['Plugin'][_0x0d0d('0x34')]);_0x19dcd0[_0x0d0d('0x37')]=_[_0x0d0d('0x38')](_0x5bfbb9[_0x0d0d('0x37')]);_0x19dcd0['filters']=_['intersection'](_0x19dcd0[_0x0d0d('0x3b')],_0x19dcd0['query']);_0x530e05[_0x0d0d('0x3c')]=_[_0x0d0d('0x3a')](_0x19dcd0[_0x0d0d('0x3b')],qs[_0x0d0d('0x3d')](_0x5bfbb9[_0x0d0d('0x37')]['fields']));_0x530e05['attributes']=_0x530e05[_0x0d0d('0x3c')][_0x0d0d('0x3e')]?_0x530e05[_0x0d0d('0x3c')]:_0x19dcd0[_0x0d0d('0x3b')];if(_0x5bfbb9[_0x0d0d('0x37')]['includeAll']){_0x530e05[_0x0d0d('0x4c')]=[{'all':!![]}];}_0x530e05=_[_0x0d0d('0x47')]({},_0x530e05,_0x5bfbb9[_0x0d0d('0x48')]);return db[_0x0d0d('0x33')]['find'](_0x530e05)[_0x0d0d('0x30')](handleEntityNotFound(_0x5c0cdd,null))[_0x0d0d('0x30')](respondWithResult(_0x5c0cdd,null))[_0x0d0d('0x49')](handleError(_0x5c0cdd,null));};exports[_0x0d0d('0x4d')]=function(_0x5488e4,_0x9a35e7,_0x52681a){return db['Plugin']['find']({'where':{'id':_0x5488e4['params']['id']},'attributes':[_0x0d0d('0x31'),'path'],'raw':!![]})[_0x0d0d('0x30')](handleEntityNotFound(_0x9a35e7,null))[_0x0d0d('0x30')](function(_0x14b338){if(_0x14b338){var _0xbbffba=path[_0x0d0d('0x4e')](config[_0x0d0d('0x4f')],_0x0d0d('0x50'),util['format'](_0x0d0d('0x51'),path['basename'](_0x14b338[_0x0d0d('0x7')])));var _0x1aa8f1=fs[_0x0d0d('0x52')](_0xbbffba);var _0x52c2c6=archiver(_0x0d0d('0x53'),{'zlib':{'level':0x9}});_0x52c2c6['on'](_0x0d0d('0x54'),function(_0x3686c5){if(_0x3686c5[_0x0d0d('0x55')]==='ENOENT'){logger[_0x0d0d('0x56')](_0x3686c5);}else{throw new db[(_0x0d0d('0x57'))][(_0x0d0d('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x52c2c6['on'](_0x0d0d('0x56'),function(_0x50f0d1){throw new db[(_0x0d0d('0x57'))]['Error'](_0x0d0d('0x59'));});_0x52c2c6[_0x0d0d('0x5a')](_0x1aa8f1);_0x52c2c6[_0x0d0d('0x5b')](_0x0d0d('0x5c'),{'cwd':path[_0x0d0d('0x4e')](config[_0x0d0d('0x4f')],_0x0d0d('0x50'),path[_0x0d0d('0x5d')](_0x14b338['path'])),'ignore':[path[_0x0d0d('0x4e')](path[_0x0d0d('0x5e')](_0x14b338[_0x0d0d('0x7')]),_0x0d0d('0x5f')),path[_0x0d0d('0x4e')](path[_0x0d0d('0x5e')](_0x14b338[_0x0d0d('0x7')]),_0x0d0d('0x60'))],'nodir':!![]})[_0x0d0d('0x61')]();_0x1aa8f1['on'](_0x0d0d('0x62'),function(){if(!fs[_0x0d0d('0x63')](_0xbbffba)){throw new db[(_0x0d0d('0x57'))][(_0x0d0d('0x58'))](_0x0d0d('0x64'));}return _0x9a35e7[_0x0d0d('0x4d')](_0xbbffba,util[_0x0d0d('0x65')](_0x0d0d('0x51'),path[_0x0d0d('0x5e')](_0x14b338['path'])),function(_0x291909){if(_0x291909){throw new db[(_0x0d0d('0x57'))][(_0x0d0d('0x58'))](_0x0d0d('0x66'));}fs['unlinkSync'](_0xbbffba);logger['info'](_0x0d0d('0x67'));logger[_0x0d0d('0x68')](_0x0d0d('0x69'));});});}return null;})[_0x0d0d('0x49')](handleError(_0x9a35e7,null));};exports[_0x0d0d('0x6a')]=function(_0x52a9d1,_0x33b5b5,_0x4112a7){var _0x34d7cc=path['basename'](_0x52a9d1[_0x0d0d('0x6b')][_0x0d0d('0x6c')],path[_0x0d0d('0x6d')](_0x52a9d1[_0x0d0d('0x6b')][_0x0d0d('0x6c')]));var _0x156bfa=path[_0x0d0d('0x4e')](config[_0x0d0d('0x4f')],_0x0d0d('0x50'),_0x52a9d1['file']['filename']);var _0x37c941=path[_0x0d0d('0x4e')](config[_0x0d0d('0x4f')],'server/files/plugins',_0x34d7cc);logger[_0x0d0d('0x68')](_0x0d0d('0x6e'),_0x156bfa);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x37c941);try{fs[_0x0d0d('0x6f')](_0x156bfa,parseInt(_0x0d0d('0x70'),0x8));extract(_0x156bfa,{'dir':_0x37c941},function(_0x164f42){if(_0x164f42){logger[_0x0d0d('0x56')](_0x164f42);handleError(_0x164f42,!![]);};var _0x17a4a3=fs['readdirSync'](_0x37c941);if(_0x17a4a3[_0x0d0d('0x3e')]>0x1){removeReferences(_0x156bfa,_0x37c941);logger['error'](_0x0d0d('0x71'));return _0x4112a7(new Error(_0x0d0d('0x71')));}var _0x42f890=fs[_0x0d0d('0x72')](path[_0x0d0d('0x4e')](_0x37c941,_0x17a4a3[0x0]));if(_0x42f890[_0x0d0d('0x73')]()){removeReferences(_0x156bfa,_0x37c941);logger['error']('Invalid\x20plugin\x20structure');return _0x4112a7(new Error(_0x0d0d('0x71')));}if(_0x42f890[_0x0d0d('0x74')]()){var _0x462df7=fs[_0x0d0d('0x75')](path[_0x0d0d('0x4e')](_0x37c941,_0x17a4a3[0x0]));if(_0x462df7[_0x0d0d('0x3e')]===0x0){removeReferences(_0x156bfa,_0x37c941);logger[_0x0d0d('0x56')](_0x0d0d('0x71'));return _0x4112a7(new Error(_0x0d0d('0x71')));}var _0x3aa601=_0x462df7['some'](function(_0x3b0dd3){return _0x3b0dd3===_0x0d0d('0x76');});if(!_0x3aa601){return _0x4112a7(new Error('Plugin\x20manifest\x20missing'));}var _0x4b6dcf=fs['readFileSync'](path['join'](_0x37c941,_0x17a4a3[0x0],_0x0d0d('0x76')));var _0x370259=JSON['parse'](_0x4b6dcf);if(_0x0d0d('0x25')==typeof _0x370259[_0x0d0d('0x31')]){return _0x4112a7(new Error(_0x0d0d('0x77')));}if(_0x0d0d('0x25')==typeof _0x370259[_0x0d0d('0x45')]){return _0x4112a7(new Error(_0x0d0d('0x78')));}if(_0x0d0d('0x25')==typeof _0x370259[_0x0d0d('0x79')]){return _0x4112a7(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x370259['parameters']){return _0x4112a7(new Error(_0x0d0d('0x7a')));}if(_0x370259[_0x0d0d('0x45')]===_0x0d0d('0x7b')){if('undefined'==typeof _0x370259[_0x0d0d('0x7c')][_0x0d0d('0x7d')]){return _0x4112a7(new Error(_0x0d0d('0x7e')));}if(_0x0d0d('0x25')==typeof _0x370259[_0x0d0d('0x7c')][_0x0d0d('0x7d')][_0x0d0d('0x7f')]&&_0x0d0d('0x25')==typeof _0x370259[_0x0d0d('0x7c')][_0x0d0d('0x7d')]['agent']){return _0x4112a7(new Error(_0x0d0d('0x80')));}}else if(_0x370259[_0x0d0d('0x45')]==='script'){if(_0x0d0d('0x25')==typeof _0x370259[_0x0d0d('0x7c')][_0x0d0d('0x81')]){return _0x4112a7(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x370259['parameters'][_0x0d0d('0x82')]){return _0x4112a7(new Error(_0x0d0d('0x83')));}}else{return _0x4112a7(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x17b1b1=_0x370259['name'];var _0x2a1590=_0x370259[_0x0d0d('0x84')];var _0x2d5173=_0x370259[_0x0d0d('0x45')];var _0x41df35=_0x370259[_0x0d0d('0x85')]?_0x370259[_0x0d0d('0x85')]:'always';var _0xfee654=_0x370259[_0x0d0d('0x86')]?_0x370259[_0x0d0d('0x86')]:_0x0d0d('0x87');var _0x305f95='';var _0xeea2e3='';var _0xff902f='';var _0x35dc91='';var _0x19812c=_0x370259['version'];if(_0x2d5173===_0x0d0d('0x7b')){if(_0x0d0d('0x25')!=typeof _0x370259['parameters'][_0x0d0d('0x7d')][_0x0d0d('0x7f')]){var _0x358e58=_0x370259['parameters'][_0x0d0d('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x0d0d('0x88')](_0x358e58)){_0x305f95=path[_0x0d0d('0x4e')]('plugins',_0x34d7cc,_0x17a4a3[0x0],_0x358e58);}else{_0x305f95=_0x358e58;}}else{logger['info'](_0x0d0d('0x89'));}if('undefined'!=typeof _0x370259[_0x0d0d('0x7c')]['views']['agent']){var _0x21e1af=_0x370259[_0x0d0d('0x7c')][_0x0d0d('0x7d')][_0x0d0d('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x0d0d('0x88')](_0x21e1af)){_0xeea2e3=path[_0x0d0d('0x4e')]('plugins',_0x34d7cc,_0x17a4a3[0x0],_0x21e1af);}else{_0xeea2e3=_0x21e1af;}}else{logger['info'](_0x0d0d('0x8b'));}}else if(_0x2d5173==='script'){_0xff902f=_0x370259[_0x0d0d('0x7c')][_0x0d0d('0x81')];_0x35dc91=_0x370259['parameters'][_0x0d0d('0x82')];if(_0x0d0d('0x25')!=typeof _0x370259['parameters'][_0x0d0d('0x7d')]){if(_0x0d0d('0x25')!=typeof _0x370259[_0x0d0d('0x7c')][_0x0d0d('0x7d')]['admin']){var _0x358e58=_0x370259[_0x0d0d('0x7c')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x358e58)){_0x305f95=path[_0x0d0d('0x4e')](_0x0d0d('0x8c'),_0x34d7cc,_0x17a4a3[0x0],_0x358e58);}else{_0x305f95=_0x358e58;}}if(_0x0d0d('0x25')!=typeof _0x370259[_0x0d0d('0x7c')]['views'][_0x0d0d('0x8a')]){var _0x21e1af=_0x370259[_0x0d0d('0x7c')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x21e1af)){_0xeea2e3=path[_0x0d0d('0x4e')]('plugins',_0x34d7cc,_0x17a4a3[0x0],_0x21e1af);}else{_0xeea2e3=_0x21e1af;}}}}var _0x439446={'name':_0x17b1b1,'description':_0x2a1590,'path':path[_0x0d0d('0x4e')](_0x34d7cc,_0x17a4a3[0x0]),'type':_0x2d5173,'sidebar':_0x41df35,'icon':_0xfee654,'adminUrl':_0x305f95,'agentUrl':_0xeea2e3,'scriptName':_0xff902f,'scriptPath':_0x35dc91,'version':_0x19812c};removeReferences(_0x156bfa,null);return db[_0x0d0d('0x33')]['create'](_0x439446)['then'](function(_0x207b7a){var _0x279d82={'role':_0x52a9d1['body'][_0x0d0d('0x8d')],'userProfileId':_0x52a9d1['body']['userProfileId']};if(!_0x279d82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x279d82[_0x0d0d('0x8d')]==='user'){var _0x43d8c3=_0x207b7a['get']({'plain':!![]});return db[_0x0d0d('0x8e')][_0x0d0d('0x8f')]({'where':{'name':_0x0d0d('0x2e'),'userProfileId':_0x279d82[_0x0d0d('0x90')]},'raw':!![]})[_0x0d0d('0x30')](function(_0x93e754){if(_0x93e754&&_0x93e754['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d0d('0x91')]({'name':_0x43d8c3['name'],'resourceId':_0x43d8c3['id'],'type':_0x93e754[_0x0d0d('0x31')],'sectionId':_0x93e754['id']},{})[_0x0d0d('0x30')](function(){return _0x207b7a;});}else{return _0x207b7a;}})['catch'](function(_0x432b7e){logger['error'](_0x0d0d('0x92'),_0x432b7e);throw _0x432b7e;});}return _0x207b7a;})[_0x0d0d('0x30')](respondWithResult(_0x33b5b5,null))[_0x0d0d('0x49')](handleError(_0x33b5b5,null));}});}catch(_0x247786){_0x33b5b5[_0x0d0d('0x21')](0x1f4)[_0x0d0d('0x93')](_0x247786);}};function removeReferences(_0x3e60d7,_0x1cfcfc){try{if(_0x3e60d7){fs[_0x0d0d('0x94')](_0x3e60d7);logger['info'](_0x0d0d('0x95'));}if(_0x1cfcfc){rimraf(_0x1cfcfc,function(){});logger[_0x0d0d('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x524dfa){logger[_0x0d0d('0x56')](_0x524dfa);}}exports[_0x0d0d('0x96')]=function(_0xf51625,_0x13f779,_0x1db6fe){return db['Plugin'][_0x0d0d('0x8f')]({'where':{'id':_0xf51625['params']['id']}})['then'](handleEntityNotFound(_0x13f779,null))[_0x0d0d('0x30')](saveUpdates(_0xf51625[_0x0d0d('0x97')],null))['then'](respondWithResult(_0x13f779,null))[_0x0d0d('0x49')](handleError(_0x13f779,null));};exports[_0x0d0d('0x98')]=function(_0x223d11,_0x563287,_0x26a972){return db[_0x0d0d('0x33')]['find']({'where':{'id':_0x223d11['params']['id']}})[_0x0d0d('0x30')](function(_0x1ad91d){if(_0x1ad91d){return _0x1ad91d[_0x0d0d('0x2c')]();}})[_0x0d0d('0x30')](function(_0x37d395){rimraf(path[_0x0d0d('0x4e')](config[_0x0d0d('0x4f')],_0x0d0d('0x50'),path['dirname'](_0x37d395[_0x0d0d('0x7')])),function(){});return _0x37d395;})[_0x0d0d('0x30')](handleEntityNotFound(_0x563287,null))[_0x0d0d('0x30')](respondWithStatusCode(_0x563287,null))['catch'](handleError(_0x563287,null));};exports[_0x0d0d('0x99')]=function(_0x44520f,_0x458cae,_0x182f87){return BPromise[_0x0d0d('0x9a')]()[_0x0d0d('0x30')](function(){if(!_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x7')]){throw new Error(_0x0d0d('0x9b'));}if(!_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x9c')]){throw new Error(_0x0d0d('0x9d'));}var _0xc4a76f=_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x9e')]?_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x9e')]+':'+_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x9c')]:_0x0d0d('0x9f')+_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x9c')];var _0x101fe2=_0x44520f[_0x0d0d('0x37')]['json']?_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x23')]:!![];var _0x54d6cb=_0x44520f[_0x0d0d('0x37')][_0x0d0d('0xa0')]?_0x44520f['query'][_0x0d0d('0xa0')]:null;var _0x2f5c87={'method':_0x44520f['method'],'uri':util[_0x0d0d('0x65')](_0x0d0d('0xa1'),_0xc4a76f,_0x44520f[_0x0d0d('0x37')]['path']),'json':_0x101fe2,'resolveWithFullResponse':!![],'encoding':_0x54d6cb,'qs':_0x44520f[_0x0d0d('0x37')]};if(_0x44520f[_0x0d0d('0xa2')]){_0x2f5c87[_0x0d0d('0xa2')]=_0x44520f['headers'];if(_0x2f5c87[_0x0d0d('0xa2')][_0x0d0d('0xa3')]){delete _0x2f5c87['headers'][_0x0d0d('0xa3')];}}if(_0x2f5c87['headers'][_0x0d0d('0xa4')]){delete _0x2f5c87[_0x0d0d('0xa2')]['content-type'];}return rp(_0x2f5c87);})[_0x0d0d('0x30')](function(_0x547265){if(_0x547265){_0x458cae[_0x0d0d('0x28')](_0x547265[_0x0d0d('0xa2')]);logger[_0x0d0d('0x68')](_0x547265[_0x0d0d('0x97')]);if(_[_0x0d0d('0xa5')](_0x44520f[_0x0d0d('0x37')][_0x0d0d('0x7')],_0x0d0d('0x4d'))&&_0x547265[_0x0d0d('0xa6')]==0x1f4){return _0x458cae[_0x0d0d('0x20')](_0x547265[_0x0d0d('0xa6')]);}else{return _0x458cae[_0x0d0d('0x21')](_0x547265['statusCode'])[_0x0d0d('0x93')](_0x547265[_0x0d0d('0x97')]);}}else{return _0x458cae[_0x0d0d('0x20')](0xc8);}})['catch'](handleError(_0x458cae,null));};exports[_0x0d0d('0xa7')]=function(_0x3dfd9a,_0x3db1a2,_0xbe9c8b){return BPromise['resolve']()[_0x0d0d('0x30')](function(){if(!_0x3dfd9a[_0x0d0d('0x37')]['path']){throw new Error(_0x0d0d('0x9b'));}if(!_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0x9c')]){throw new Error(_0x0d0d('0x9d'));}var _0x9d68b4=_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0x9e')]?_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0x9e')]+':'+_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0x9c')]:_0x0d0d('0x9f')+_0x3dfd9a[_0x0d0d('0x37')]['port'];var _0x563a4c=_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0x23')]?_0x3dfd9a['query'][_0x0d0d('0x23')]:!![];var _0xf72a62=_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0xa0')]?_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0xa0')]:null;var _0x114d92={'method':_0x3dfd9a['method'],'uri':util[_0x0d0d('0x65')](_0x0d0d('0xa1'),_0x9d68b4,_0x3dfd9a[_0x0d0d('0x37')][_0x0d0d('0x7')]),'json':_0x563a4c,'resolveWithFullResponse':!![],'encoding':_0xf72a62,'body':_0x3dfd9a[_0x0d0d('0x97')]};if(_0x3dfd9a[_0x0d0d('0xa2')]){_0x114d92[_0x0d0d('0xa2')]=_0x3dfd9a['headers'];if(_0x114d92[_0x0d0d('0xa2')][_0x0d0d('0xa3')]){delete _0x114d92[_0x0d0d('0xa2')][_0x0d0d('0xa3')];}}if(_0x114d92['headers']['content-type']){delete _0x114d92[_0x0d0d('0xa2')][_0x0d0d('0xa4')];}return rp(_0x114d92);})[_0x0d0d('0x30')](function(_0x3c9ab0){if(_0x3c9ab0){_0x3db1a2[_0x0d0d('0x28')](_0x3c9ab0[_0x0d0d('0xa2')]);logger['info'](_0x3c9ab0[_0x0d0d('0x97')]);return _0x3db1a2[_0x0d0d('0x21')](_0x3c9ab0['statusCode'])[_0x0d0d('0x93')](_0x3c9ab0[_0x0d0d('0x97')]);}else{return _0x3db1a2[_0x0d0d('0x20')](0xc8);}})['catch'](handleError(_0x3db1a2,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 9d7d83a..1f96453 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 _0xf494=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','save','update'];(function(_0x2e0769,_0x416bea){var _0x356795=function(_0x5adbeb){while(--_0x5adbeb){_0x2e0769['push'](_0x2e0769['shift']());}};_0x356795(++_0x416bea);}(_0xf494,0x1c6));var _0x4f49=function(_0x52007e,_0x332a29){_0x52007e=_0x52007e-0x0;var _0x2de4bc=_0xf494[_0x52007e];return _0x2de4bc;};'use strict';var EventEmitter=require(_0x4f49('0x0'));var Plugin=require(_0x4f49('0x1'))['db'][_0x4f49('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f49('0x3'),'afterUpdate':_0x4f49('0x4'),'afterDestroy':_0x4f49('0x5')};function emitEvent(_0x25677c){return function(_0x20c0d7,_0x2a15fb,_0x3267c1){PluginEvents[_0x4f49('0x6')](_0x25677c+':'+_0x20c0d7['id'],_0x20c0d7);PluginEvents[_0x4f49('0x6')](_0x25677c,_0x20c0d7);_0x3267c1(null);};}for(var e in events){if(events[_0x4f49('0x7')](e)){var event=events[e];Plugin[_0x4f49('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x36c3=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x141055,_0x96d382){var _0x415757=function(_0x17e148){while(--_0x17e148){_0x141055['push'](_0x141055['shift']());}};_0x415757(++_0x96d382);}(_0x36c3,0x1a6));var _0x336c=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x36c3[_0x3a8db5];return _0x2c03cd;};'use strict';var EventEmitter=require(_0x336c('0x0'));var Plugin=require(_0x336c('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x336c('0x2')](0x0);var events={'afterCreate':_0x336c('0x3'),'afterUpdate':_0x336c('0x4'),'afterDestroy':_0x336c('0x5')};function emitEvent(_0x32aed2){return function(_0x2b1194,_0x39ed12,_0x4e4c07){PluginEvents[_0x336c('0x6')](_0x32aed2+':'+_0x2b1194['id'],_0x2b1194);PluginEvents[_0x336c('0x6')](_0x32aed2,_0x2b1194);_0x4e4c07(null);};}for(var e in events){if(events[_0x336c('0x7')](e)){var event=events[e];Plugin[_0x336c('0x8')](e,emitEvent(event));}}module[_0x336c('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 8f0e9ce..2563e5d 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 _0xd488=['rimraf','./plugin.attributes','exports','Plugin','plugins','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd488,0xe1));var _0x8d48=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0xd488[_0x5ff517];return _0x19a245;};'use strict';var _=require(_0x8d48('0x0'));var util=require('util');var logger=require(_0x8d48('0x1'))(_0x8d48('0x2'));var moment=require(_0x8d48('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d48('0x4'));var fs=require('fs');var path=require(_0x8d48('0x5'));var rimraf=require(_0x8d48('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d48('0x7'));module[_0x8d48('0x8')]=function(_0x5498ba,_0x49e2bc){return _0x5498ba['define'](_0x8d48('0x9'),attributes,{'tableName':_0x8d48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6ee=['path','../../config/environment','exports','Plugin','plugins','lodash','util','api','bluebird','request-promise'];(function(_0xde8111,_0x15702c){var _0x29af0b=function(_0x3d7873){while(--_0x3d7873){_0xde8111['push'](_0xde8111['shift']());}};_0x29af0b(++_0x15702c);}(_0xd6ee,0x109));var _0xed6e=function(_0x4a3554,_0x14f2fd){_0x4a3554=_0x4a3554-0x0;var _0x12e4cb=_0xd6ee[_0x4a3554];return _0x12e4cb;};'use strict';var _=require(_0xed6e('0x0'));var util=require(_0xed6e('0x1'));var logger=require('../../config/logger')(_0xed6e('0x2'));var moment=require('moment');var BPromise=require(_0xed6e('0x3'));var rp=require(_0xed6e('0x4'));var fs=require('fs');var path=require(_0xed6e('0x5'));var rimraf=require('rimraf');var config=require(_0xed6e('0x6'));var attributes=require('./plugin.attributes');module[_0xed6e('0x7')]=function(_0x124648,_0x266c6b){return _0x124648['define'](_0xed6e('0x8'),attributes,{'tableName':_0xed6e('0x9'),'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 1507972..582d72b 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 _0x6cfc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','options','raw','then','stringify'];(function(_0x1ba17a,_0x297e74){var _0x2e762b=function(_0x602095){while(--_0x602095){_0x1ba17a['push'](_0x1ba17a['shift']());}};_0x2e762b(++_0x297e74);}(_0x6cfc,0x14a));var _0xc6cf=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x6cfc[_0xc7348b];return _0x307cec;};'use strict';var _=require('lodash');var util=require(_0xc6cf('0x0'));var moment=require(_0xc6cf('0x1'));var BPromise=require(_0xc6cf('0x2'));var rs=require(_0xc6cf('0x3'));var fs=require('fs');var Redis=require(_0xc6cf('0x4'));var db=require(_0xc6cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6cf('0x6'))('rpc');var config=require(_0xc6cf('0x7'));var jayson=require(_0xc6cf('0x8'));var client=jayson[_0xc6cf('0x9')][_0xc6cf('0xa')]({'port':0x232a});config['redis']=_[_0xc6cf('0xb')](config[_0xc6cf('0xc')],{'host':_0xc6cf('0xd'),'port':0x18eb});var socket=require(_0xc6cf('0xe'))(new Redis(config[_0xc6cf('0xc')]));require(_0xc6cf('0xf'))[_0xc6cf('0x10')](socket);function respondWithRpcPromise(_0x5442bb,_0x31a397,_0x35acbe){return new BPromise(function(_0x36d188,_0x2c20dd){return client[_0xc6cf('0x11')](_0x5442bb,_0x35acbe)['then'](function(_0x58d3a4){logger[_0xc6cf('0x12')](_0xc6cf('0x13'),_0x31a397,_0xc6cf('0x14'));logger[_0xc6cf('0x15')](_0xc6cf('0x16'),_0x31a397,'request\x20sent',JSON['stringify'](_0x58d3a4));if(_0x58d3a4[_0xc6cf('0x17')]){if(_0x58d3a4[_0xc6cf('0x17')][_0xc6cf('0x18')]===0x1f4){logger[_0xc6cf('0x17')](_0xc6cf('0x13'),_0x31a397,_0x58d3a4[_0xc6cf('0x17')]['message']);return _0x2c20dd(_0x58d3a4[_0xc6cf('0x17')][_0xc6cf('0x19')]);}logger[_0xc6cf('0x17')](_0xc6cf('0x13'),_0x31a397,_0x58d3a4['error']['message']);return _0x36d188(_0x58d3a4[_0xc6cf('0x17')][_0xc6cf('0x19')]);}else{logger[_0xc6cf('0x12')]('Plugin,\x20%s,\x20%s',_0x31a397,_0xc6cf('0x14'));_0x36d188(_0x58d3a4[_0xc6cf('0x1a')][_0xc6cf('0x19')]);}})[_0xc6cf('0x1b')](function(_0x51e52e){logger[_0xc6cf('0x17')]('Plugin,\x20%s,\x20%s',_0x31a397,_0x51e52e);_0x2c20dd(_0x51e52e);});});}exports[_0xc6cf('0x1c')]=function(_0x50a243){var _0x7fec4a=this;return new Promise(function(_0x18e8c1,_0x134e43){return db['Plugin']['create'](_0x50a243['body'],{'raw':_0x50a243[_0xc6cf('0x1d')]?_0x50a243[_0xc6cf('0x1d')][_0xc6cf('0x1e')]===undefined?!![]:![]:!![]})[_0xc6cf('0x1f')](function(_0x3ad7df){logger['info'](_0xc6cf('0x1c'),_0x50a243);logger[_0xc6cf('0x15')](_0xc6cf('0x1c'),_0x50a243,JSON[_0xc6cf('0x20')](_0x3ad7df));_0x18e8c1(_0x3ad7df);})[_0xc6cf('0x1b')](function(_0x304fb1){logger[_0xc6cf('0x17')]('CreatePlugin',_0x304fb1[_0xc6cf('0x19')],_0x50a243);_0x134e43(_0x7fec4a[_0xc6cf('0x17')](0x1f4,_0x304fb1[_0xc6cf('0x19')]));});});}; \ No newline at end of file +var _0xb4ee=['body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xb4ee,0xa8));var _0xeb4e=function(_0x28ee82,_0x5c252f){_0x28ee82=_0x28ee82-0x0;var _0x13cd70=_0xb4ee[_0x28ee82];return _0x13cd70;};'use strict';var _=require(_0xeb4e('0x0'));var util=require('util');var moment=require(_0xeb4e('0x1'));var BPromise=require(_0xeb4e('0x2'));var rs=require(_0xeb4e('0x3'));var fs=require('fs');var Redis=require(_0xeb4e('0x4'));var db=require(_0xeb4e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb4e('0x6'))(_0xeb4e('0x7'));var config=require(_0xeb4e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeb4e('0x9')][_0xeb4e('0xa')]({'port':0x232a});config[_0xeb4e('0xb')]=_[_0xeb4e('0xc')](config['redis'],{'host':_0xeb4e('0xd'),'port':0x18eb});var socket=require(_0xeb4e('0xe'))(new Redis(config[_0xeb4e('0xb')]));require(_0xeb4e('0xf'))['register'](socket);function respondWithRpcPromise(_0x513f9c,_0x1cf7b2,_0x119032){return new BPromise(function(_0x2654b2,_0x319275){return client[_0xeb4e('0x10')](_0x513f9c,_0x119032)[_0xeb4e('0x11')](function(_0x2f50d6){logger[_0xeb4e('0x12')]('Plugin,\x20%s,\x20%s',_0x1cf7b2,_0xeb4e('0x13'));logger[_0xeb4e('0x14')](_0xeb4e('0x15'),_0x1cf7b2,'request\x20sent',JSON[_0xeb4e('0x16')](_0x2f50d6));if(_0x2f50d6['error']){if(_0x2f50d6[_0xeb4e('0x17')][_0xeb4e('0x18')]===0x1f4){logger[_0xeb4e('0x17')](_0xeb4e('0x19'),_0x1cf7b2,_0x2f50d6[_0xeb4e('0x17')][_0xeb4e('0x1a')]);return _0x319275(_0x2f50d6['error'][_0xeb4e('0x1a')]);}logger[_0xeb4e('0x17')](_0xeb4e('0x19'),_0x1cf7b2,_0x2f50d6[_0xeb4e('0x17')][_0xeb4e('0x1a')]);return _0x2654b2(_0x2f50d6[_0xeb4e('0x17')][_0xeb4e('0x1a')]);}else{logger[_0xeb4e('0x12')](_0xeb4e('0x19'),_0x1cf7b2,'request\x20sent');_0x2654b2(_0x2f50d6['result'][_0xeb4e('0x1a')]);}})[_0xeb4e('0x1b')](function(_0x12356a){logger[_0xeb4e('0x17')](_0xeb4e('0x19'),_0x1cf7b2,_0x12356a);_0x319275(_0x12356a);});});}exports[_0xeb4e('0x1c')]=function(_0x370a68){var _0x5562ec=this;return new Promise(function(_0x77efe2,_0x1ab6ff){return db[_0xeb4e('0x1d')]['create'](_0x370a68[_0xeb4e('0x1e')],{'raw':_0x370a68[_0xeb4e('0x1f')]?_0x370a68[_0xeb4e('0x1f')][_0xeb4e('0x20')]===undefined?!![]:![]:!![]})[_0xeb4e('0x11')](function(_0x10abe3){logger[_0xeb4e('0x12')]('CreatePlugin',_0x370a68);logger[_0xeb4e('0x14')]('CreatePlugin',_0x370a68,JSON[_0xeb4e('0x16')](_0x10abe3));_0x77efe2(_0x10abe3);})[_0xeb4e('0x1b')](function(_0x213f86){logger[_0xeb4e('0x17')]('CreatePlugin',_0x213f86[_0xeb4e('0x1a')],_0x370a68);_0x1ab6ff(_0x5562ec[_0xeb4e('0x17')](0x1f4,_0x213f86['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index b6cc6ce..83b98ae 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 _0xe06f=['removeListener','length','remove','emit'];(function(_0x9c150a,_0x268e0b){var _0x3f2f06=function(_0x2bcfd7){while(--_0x2bcfd7){_0x9c150a['push'](_0x9c150a['shift']());}};_0x3f2f06(++_0x268e0b);}(_0xe06f,0x8e));var _0xfe06=function(_0x57e15e,_0x270a91){_0x57e15e=_0x57e15e-0x0;var _0x325a9a=_0xe06f[_0x57e15e];return _0x325a9a;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0xfe06('0x0'),'update'];function createListener(_0x4ca64a,_0x5d2f55){return function(_0x33e47c){_0x5d2f55[_0xfe06('0x1')](_0x4ca64a,_0x33e47c);};}function removeListener(_0x1f35d5,_0x109322){return function(){PluginEvents[_0xfe06('0x2')](_0x1f35d5,_0x109322);};}exports['register']=function(_0x44d503){for(var _0x419c65=0x0,_0x5d2a6a=events[_0xfe06('0x3')];_0x419c65<_0x5d2a6a;_0x419c65++){var _0x405e76=events[_0x419c65];var _0xe9077b=createListener('plugin:'+_0x405e76,_0x44d503);PluginEvents['on'](_0x405e76,_0xe9077b);}}; \ No newline at end of file +var _0x8eab=['update','removeListener','register','length','plugin:','./plugin.events','save','remove'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x8eab,0x7d));var _0xb8ea=function(_0x1c670a,_0x52f088){_0x1c670a=_0x1c670a-0x0;var _0x4a16f5=_0x8eab[_0x1c670a];return _0x4a16f5;};'use strict';var PluginEvents=require(_0xb8ea('0x0'));var events=[_0xb8ea('0x1'),_0xb8ea('0x2'),_0xb8ea('0x3')];function createListener(_0x51eda9,_0x8ef5e5){return function(_0x534f0c){_0x8ef5e5['emit'](_0x51eda9,_0x534f0c);};}function removeListener(_0x5b2853,_0x5cb3eb){return function(){PluginEvents[_0xb8ea('0x4')](_0x5b2853,_0x5cb3eb);};}exports[_0xb8ea('0x5')]=function(_0x203a03){for(var _0x191540=0x0,_0x1af8ec=events[_0xb8ea('0x6')];_0x191540<_0x1af8ec;_0x191540++){var _0x245465=events[_0x191540];var _0x36a62b=createListener(_0xb8ea('0x7')+_0x245465,_0x203a03);PluginEvents['on'](_0x245465,_0x36a62b);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7f0e42d..9467ec9 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(_0x191c44,_0x20a896){var _0x1086cd=function(_0x2e2cac){while(--_0x2e2cac){_0x191c44['push'](_0x191c44['shift']());}};_0x1086cd(++_0x20a896);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x41f1e2,_0x221c3a){var _0x1e4ead=function(_0x3d0c18){while(--_0x3d0c18){_0x41f1e2['push'](_0x41f1e2['shift']());}};_0x1e4ead(++_0x221c3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 c37a7ab..86901ef 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 _0x91a7=['params','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','length','show','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','catch','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status'];(function(_0x5837e7,_0x35de4f){var _0x537783=function(_0x4cce5d){while(--_0x4cce5d){_0x5837e7['push'](_0x5837e7['shift']());}};_0x537783(++_0x35de4f);}(_0x91a7,0xe7));var _0x791a=function(_0x1cc849,_0x352841){_0x1cc849=_0x1cc849-0x0;var _0x55c1ca=_0x91a7[_0x1cc849];return _0x55c1ca;};'use strict';var _=require('lodash');var pm2=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var path=require('path');var exec=require(_0x791a('0x3'))['exec'];var BPromise=require(_0x791a('0x4'));function handleEntityNotFound(_0x535640,_0x50ab29){return function(_0x32fe2b){if(!_0x32fe2b){_0x535640[_0x791a('0x5')](0x194);;}return _0x32fe2b;};}function respondWithResult(_0x49a9b7,_0x361f53){_0x361f53=_0x361f53||0xc8;return function(_0x5db6db){if(_0x5db6db){return _0x49a9b7[_0x791a('0x6')](_0x361f53)[_0x791a('0x7')](_0x5db6db);}return null;};}function handleError(_0x5aa10a,_0x1a32b4){_0x1a32b4=_0x1a32b4||0x1f4;return function(_0x12884d){logger[_0x791a('0x8')](_0x12884d[_0x791a('0x9')]);if(_0x12884d[_0x791a('0xa')]){delete _0x12884d['name'];}_0x5aa10a[_0x791a('0x6')](_0x1a32b4)[_0x791a('0xb')](_0x12884d);};}function execChildProcess(){return new BPromise(function(_0x57e99c,_0x2bd26a){exec(_0x791a('0xc'),function(_0x167bc4,_0x17cf33,_0x2805c9){logger[_0x791a('0xd')](_0x17cf33);logger['info'](_0x2805c9);if(_0x167bc4){logger['error'](_0x167bc4);return _0x2bd26a(_0x167bc4);}return _0x57e99c(_0x17cf33);});});}exports[_0x791a('0xe')]=function(_0x2f2d8d,_0x4c56f0){return pm2[_0x791a('0xf')]()[_0x791a('0x10')](function(_0x5d5b11){if(_0x5d5b11){var _0x2887f0=_[_0x791a('0x11')](_0x5d5b11,function(_0x2ef5c5){return _0x2ef5c5[_0x791a('0xa')]==='express'||_0x2ef5c5[_0x791a('0xa')]==='motion2';});return{'rows':_0x2887f0,'count':_0x2887f0[_0x791a('0x12')]};}return null;})[_0x791a('0x10')](respondWithResult(_0x4c56f0,null))['catch'](handleError(_0x4c56f0,null));};exports[_0x791a('0x13')]=function(_0x5bea2e,_0x35fe48){return pm2['describe'](_0x5bea2e['params']['id'])['then'](respondWithResult(_0x35fe48,null))[_0x791a('0x10')](handleEntityNotFound(_0x35fe48,null))['catch'](handleError(_0x35fe48,null));};exports['create']=function(_0x39c60b,_0x5a702e){if(_0x39c60b[_0x791a('0x14')][_0x791a('0xa')]&&_0x39c60b['body'][_0x791a('0x15')]){var _0xcb5e66=path[_0x791a('0x16')](__dirname,_0x791a('0x17'),_0x39c60b['body'][_0x791a('0x15')]);var _0x2054c6=process[_0x791a('0x18')]();process[_0x791a('0x19')](path[_0x791a('0x1a')](_0xcb5e66));return execChildProcess()[_0x791a('0x10')](function(_0x2241a0){process[_0x791a('0x19')](_0x2054c6);return pm2[_0x791a('0x1b')]({'name':_0x39c60b[_0x791a('0x14')][_0x791a('0xa')],'script':_0xcb5e66});})['then'](function(_0x1102c9){pm2[_0x791a('0x1c')]();return _0x1102c9[0x0];})[_0x791a('0x10')](respondWithResult(_0x5a702e,0xc9))[_0x791a('0x1d')](handleError(_0x5a702e,null));}else{return _0x5a702e['status'](0x1f4)[_0x791a('0xb')]({'message':_0x791a('0x1e')});}};exports['update']=function(_0xdfa84f,_0x1785f5){if(_0xdfa84f[_0x791a('0x14')]['id']){delete _0xdfa84f['body']['id'];}var _0x29194d={'online':_0x791a('0x1f'),'stopped':_0x791a('0x20')};if(_0x29194d[_0x791a('0x21')](_0xdfa84f[_0x791a('0x14')][_0x791a('0x6')])){return pm2[_0x29194d[_0xdfa84f[_0x791a('0x14')][_0x791a('0x6')]]](_0xdfa84f['params']['id'])[_0x791a('0x10')](respondWithResult(_0x1785f5,0xc8))[_0x791a('0x1d')](handleError(_0x1785f5,null));}else{return _0x1785f5[_0x791a('0x6')](0x1f4)['send']({'message':_0x791a('0x22')});}};exports['destroy']=function(_0xc59f5e,_0x2e4ec8){if(_0xc59f5e[_0x791a('0x14')]['id']){delete _0xc59f5e[_0x791a('0x14')]['id'];}if(_0xc59f5e[_0x791a('0x23')]['id']){return pm2[_0x791a('0x24')](_0xc59f5e[_0x791a('0x23')]['id'])['then'](function(_0x3662c6){pm2[_0x791a('0x1c')]();return _0x3662c6[0x0];})[_0x791a('0x10')](respondWithResult(_0x2e4ec8,null))[_0x791a('0x1d')](handleError(_0x2e4ec8,null));}else{return _0x2e4ec8[_0x791a('0x6')](0x1f4)['send']({'message':_0x791a('0x25')});}}; \ No newline at end of file +var _0x579c=['express','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','send','npm\x20install','info','index','then'];(function(_0xeeba0c,_0x51284b){var _0x850a1b=function(_0x425922){while(--_0x425922){_0xeeba0c['push'](_0xeeba0c['shift']());}};_0x850a1b(++_0x51284b);}(_0x579c,0xda));var _0xc579=function(_0x1413c7,_0x338846){_0x1413c7=_0x1413c7-0x0;var _0x855596=_0x579c[_0x1413c7];return _0x855596;};'use strict';var _=require(_0xc579('0x0'));var pm2=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var path=require(_0xc579('0x4'));var exec=require('child_process')[_0xc579('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x21a0a2,_0x3b913c){return function(_0x1ce62b){if(!_0x1ce62b){_0x21a0a2[_0xc579('0x6')](0x194);;}return _0x1ce62b;};}function respondWithResult(_0x124ee5,_0x1bd276){_0x1bd276=_0x1bd276||0xc8;return function(_0x2e451b){if(_0x2e451b){return _0x124ee5['status'](_0x1bd276)[_0xc579('0x7')](_0x2e451b);}return null;};}function handleError(_0x293c4a,_0x2ce949){_0x2ce949=_0x2ce949||0x1f4;return function(_0x2361fc){logger[_0xc579('0x8')](_0x2361fc[_0xc579('0x9')]);if(_0x2361fc[_0xc579('0xa')]){delete _0x2361fc[_0xc579('0xa')];}_0x293c4a['status'](_0x2ce949)[_0xc579('0xb')](_0x2361fc);};}function execChildProcess(){return new BPromise(function(_0x2048bc,_0x17e37f){exec(_0xc579('0xc'),function(_0x9e3fd3,_0x4577a2,_0x2a8e70){logger[_0xc579('0xd')](_0x4577a2);logger[_0xc579('0xd')](_0x2a8e70);if(_0x9e3fd3){logger[_0xc579('0x8')](_0x9e3fd3);return _0x17e37f(_0x9e3fd3);}return _0x2048bc(_0x4577a2);});});}exports[_0xc579('0xe')]=function(_0x4ac675,_0x177314){return pm2['list']()[_0xc579('0xf')](function(_0x59243e){if(_0x59243e){var _0x424e15=_['reject'](_0x59243e,function(_0x44cd32){return _0x44cd32['name']===_0xc579('0x10')||_0x44cd32[_0xc579('0xa')]==='motion2';});return{'rows':_0x424e15,'count':_0x424e15['length']};}return null;})[_0xc579('0xf')](respondWithResult(_0x177314,null))[_0xc579('0x11')](handleError(_0x177314,null));};exports[_0xc579('0x12')]=function(_0x414ee7,_0x7d5865){return pm2[_0xc579('0x13')](_0x414ee7[_0xc579('0x14')]['id'])[_0xc579('0xf')](respondWithResult(_0x7d5865,null))[_0xc579('0xf')](handleEntityNotFound(_0x7d5865,null))[_0xc579('0x11')](handleError(_0x7d5865,null));};exports['create']=function(_0x463f5e,_0x2b7d74){if(_0x463f5e['body'][_0xc579('0xa')]&&_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]){var _0x6501bc=path[_0xc579('0x17')](__dirname,_0xc579('0x18'),_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]);var _0x55781e=process[_0xc579('0x19')]();process[_0xc579('0x1a')](path[_0xc579('0x1b')](_0x6501bc));return execChildProcess()[_0xc579('0xf')](function(_0x1da86e){process['chdir'](_0x55781e);return pm2[_0xc579('0x1c')]({'name':_0x463f5e[_0xc579('0x15')][_0xc579('0xa')],'script':_0x6501bc});})['then'](function(_0x45e1ac){pm2['dump']();return _0x45e1ac[0x0];})[_0xc579('0xf')](respondWithResult(_0x2b7d74,0xc9))[_0xc579('0x11')](handleError(_0x2b7d74,null));}else{return _0x2b7d74[_0xc579('0x1d')](0x1f4)['send']({'message':_0xc579('0x1e')});}};exports['update']=function(_0x532b33,_0x56439a){if(_0x532b33[_0xc579('0x15')]['id']){delete _0x532b33[_0xc579('0x15')]['id'];}var _0xfdbb73={'online':_0xc579('0x1f'),'stopped':_0xc579('0x20')};if(_0xfdbb73[_0xc579('0x21')](_0x532b33[_0xc579('0x15')]['status'])){return pm2[_0xfdbb73[_0x532b33['body'][_0xc579('0x1d')]]](_0x532b33['params']['id'])[_0xc579('0xf')](respondWithResult(_0x56439a,0xc8))[_0xc579('0x11')](handleError(_0x56439a,null));}else{return _0x56439a[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x22')});}};exports[_0xc579('0x23')]=function(_0x45e6a3,_0x133d08){if(_0x45e6a3['body']['id']){delete _0x45e6a3[_0xc579('0x15')]['id'];}if(_0x45e6a3[_0xc579('0x14')]['id']){return pm2[_0xc579('0x24')](_0x45e6a3[_0xc579('0x14')]['id'])['then'](function(_0x57299e){pm2[_0xc579('0x25')]();return _0x57299e[0x0];})['then'](respondWithResult(_0x133d08,null))[_0xc579('0x11')](handleError(_0x133d08,null));}else{return _0x133d08[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 5494227..5c8ad91 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 _0x05a9=['get','/agents','getAgents','getQueues','exports','express','Router','./realtime.controller'];(function(_0x5af9ba,_0x30adfb){var _0x488c7c=function(_0x558245){while(--_0x558245){_0x5af9ba['push'](_0x5af9ba['shift']());}};_0x488c7c(++_0x30adfb);}(_0x05a9,0x15d));var _0x905a=function(_0x2a74f5,_0x572a9d){_0x2a74f5=_0x2a74f5-0x0;var _0x2c9427=_0x05a9[_0x2a74f5];return _0x2c9427;};'use strict';var express=require(_0x905a('0x0'));var router=express[_0x905a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x905a('0x2'));router[_0x905a('0x3')](_0x905a('0x4'),auth['isAuthenticated'](),controller[_0x905a('0x5')]);router['get']('/queues',auth['isAuthenticated'](),controller[_0x905a('0x6')]);module[_0x905a('0x7')]=router; \ No newline at end of file +var _0x8beb=['/agents','isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','get'];(function(_0x2b5635,_0x2cf2e4){var _0x54b4d0=function(_0x463b8c){while(--_0x463b8c){_0x2b5635['push'](_0x2b5635['shift']());}};_0x54b4d0(++_0x2cf2e4);}(_0x8beb,0x84));var _0xb8be=function(_0xb1e1e1,_0x5baf84){_0xb1e1e1=_0xb1e1e1-0x0;var _0x57349b=_0x8beb[_0xb1e1e1];return _0x57349b;};'use strict';var express=require(_0xb8be('0x0'));var router=express[_0xb8be('0x1')]();var auth=require(_0xb8be('0x2'));var controller=require('./realtime.controller');router[_0xb8be('0x3')](_0xb8be('0x4'),auth[_0xb8be('0x5')](),controller['getAgents']);router[_0xb8be('0x3')]('/queues',auth['isAuthenticated'](),controller[_0xb8be('0x6')]);module[_0xb8be('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index e97a948..c429733 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 _0xde63=['getAgentStatus','Status','fields','pick','catch','getQueues','startCase','Queue','name','dialActive','outbound','QueueCampaigns','filter','UserProfile','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','pause','resolve','then','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','join','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','key','role','agent','online','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','where','user','userProfileId','Agents','extraQueryConditions','assign','findAndCountAll','find','filterAgentAttributes'];(function(_0x1f2019,_0x26065a){var _0x2c5de3=function(_0x5e7a0d){while(--_0x5e7a0d){_0x1f2019['push'](_0x1f2019['shift']());}};_0x2c5de3(++_0x26065a);}(_0xde63,0x1a0));var _0x3de6=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xde63[_0x3afe18];return _0x19ed1f;};'use strict';var _=require(_0x3de6('0x0'));var util=require(_0x3de6('0x1'));var rta=require(_0x3de6('0x2'));var rtq=require(_0x3de6('0x3'));var qs=require(_0x3de6('0x4'));var utils=require(_0x3de6('0x5'));var db=require(_0x3de6('0x6'))['db'];var APIBadRequestError=require(_0x3de6('0x7'))['APIBadRequestError'];var APIHandleError=require(_0x3de6('0x7'))[_0x3de6('0x8')];function respondWithFilteredResult(_0x16caaa,_0x58ba5a){return function(_0x5a7b48){if(_0x5a7b48){var _0x38f6fd=typeof _0x58ba5a[_0x3de6('0x9')]===_0x3de6('0xa')&&typeof _0x58ba5a['limit']===_0x3de6('0xa');var _0x2c349d=_0x5a7b48[_0x3de6('0xb')];var _0x354a97=_0x38f6fd?0x0:_0x58ba5a[_0x3de6('0x9')];var _0x1c76c2=_0x38f6fd?_0x5a7b48[_0x3de6('0xb')]:_0x58ba5a[_0x3de6('0x9')]+_0x58ba5a[_0x3de6('0xc')];var _0x166aa3;if(_0x1c76c2>=_0x2c349d){_0x1c76c2=_0x2c349d;_0x166aa3=0xc8;}else{_0x166aa3=0xce;}_0x16caaa[_0x3de6('0xd')](_0x166aa3);return _0x16caaa[_0x3de6('0xe')](_0x3de6('0xf'),_0x354a97+'-'+_0x1c76c2+'/'+_0x2c349d)[_0x3de6('0x10')](_0x5a7b48);}return null;};}exports[_0x3de6('0x11')]=function(_0x54238d,_0x519396){var _0x202e69={'count':0x0,'rows':[]};var _0x538951={};var _0x3d569e;var _0x1bb3b1=utils[_0x3de6('0x12')]();var _0x4b2e12;var _0x33d764;var _0x4b8293=_0x54238d[_0x3de6('0x13')][_0x3de6('0x14')];var _0x173bda=_0x54238d[_0x3de6('0x13')]['globalStatusFilter'];var _0x8f4e71=_0x54238d[_0x3de6('0x13')]['pauseTypeFilter'];var _0x103084=_0x173bda===_0x3de6('0x15')||_0x173bda==='*pause'?!![]:![];var _0x41da4e=[];var _0x48499f;var _0xd40b2c;Promise[_0x3de6('0x16')]()[_0x3de6('0x17')](function(){if(_0x54238d['query']['channel']){if(!utils[_0x3de6('0x18')](_0x54238d[_0x3de6('0x13')]['channel'])){throw new APIBadRequestError(util[_0x3de6('0x19')](_0x3de6('0x1a'),_0x54238d['query'][_0x3de6('0x1b')]));}_0x3d569e=_0x54238d[_0x3de6('0x13')]['channel']['toLowerCase']();}if(!_0x54238d[_0x3de6('0x13')]['sort']||!_0x54238d[_0x3de6('0x13')][_0x3de6('0x1c')][_0x3de6('0x1d')](_0x3de6('0x1e'))){_0x54238d[_0x3de6('0x13')][_0x3de6('0x1c')]=rta[_0x3de6('0x1f')](_0x54238d[_0x3de6('0x13')]['sort']);return;}var _0x10f2e7=rta[_0x3de6('0x20')](_0x54238d[_0x3de6('0x13')]['sort']);_0x54238d[_0x3de6('0x13')][_0x3de6('0x1c')]=_0x10f2e7['fields'][_0x3de6('0x21')](',');_0x48499f=_0x10f2e7['order'];})['then'](function(){if(!_0x4b8293){return[];}return rta['getAgentIdsByQueues'](_0x4b8293,_0x3d569e);})[_0x3de6('0x17')](function(_0x55ea8c){_0x41da4e=_0x55ea8c;return rta[_0x3de6('0x22')]();})[_0x3de6('0x17')](function(_0x47493c){_0x33d764=_0x47493c[_0x3de6('0x23')];if((!_0x173bda||_0x103084)&&!_0x48499f){return _0x41da4e;}if(_0x48499f&&!_0x173bda){return rta[_0x3de6('0x24')](_0x33d764,_0x41da4e,_0x48499f);}else{return rta[_0x3de6('0x25')](_0x33d764,_0x41da4e,_0x173bda);}})[_0x3de6('0x17')](function(_0x1d5d83){_0x41da4e=_0x1d5d83;var _0x38528c=![];if(_0x41da4e[_0x3de6('0x26')]===0x0){if(_0x4b8293||_0x173bda){_0x38528c=!![];}if(_0x103084){_0x38528c=![];}}if(_0x38528c){return _0x202e69;}var _0x4946ce=_[_0x3de6('0x27')](db['User'][_0x3de6('0x28')],function(_0x3d3c93){return{'name':_0x3d3c93[_0x3de6('0x29')],'type':_0x3d3c93[_0x3de6('0x2a')][_0x3de6('0x2b')]};});_0x54238d[_0x3de6('0x13')][_0x3de6('0x2c')]=_0x3de6('0x2d');_0x54238d[_0x3de6('0x13')][_0x3de6('0x2e')]=!![];_0x538951=qs[_0x3de6('0x2f')](_0x4946ce,_0x54238d);_0x538951[_0x3de6('0x30')]=!![];var _0x2852c1=[];if(_0x41da4e[_0x3de6('0x26')]>0x0){_0x2852c1[_0x3de6('0x31')]({'id':{'$in':_0x41da4e}});if(_0x48499f&&!_0x173bda){_0xd40b2c=[db['sequelize'][_0x3de6('0x32')](_0x3de6('0x33')+_0x41da4e+')')];_0x538951['order']=_0xd40b2c;}}if(_0x103084){_0x1bb3b1[_0x3de6('0x34')](function(_0x2eed14){var _0x321b94=!![];if(_0x173bda===_0x3de6('0x35')&&_0x3d569e!==_0x2eed14){_0x321b94=![];}_0x2852c1['push']({[_0x2eed14+_0x3de6('0x36')]:_0x321b94});});if(_0x8f4e71){_0x2852c1[_0x3de6('0x31')]({'pauseType':_0x8f4e71});}}else if(_0x173bda){_0x1bb3b1[_0x3de6('0x34')](function(_0x480cbd){_0x2852c1[_0x3de6('0x31')]({[_0x480cbd+_0x3de6('0x36')]:![]});});}_0x538951[_0x3de6('0x37')]=_['merge'](_0x538951[_0x3de6('0x37')],{'$and':_0x2852c1});if(_0x54238d['user'][_0x3de6('0x2c')]===_0x3de6('0x38')){var _0x2c05b2={'params':{'id':_0x54238d[_0x3de6('0x38')][_0x3de6('0x39')]},'query':{'section':_0x3de6('0x3a'),'role':_0x3de6('0x2d'),'online':!![],'raw':!![],'ids':_0x41da4e,'customSorting':_0xd40b2c}};if(_0x103084){_0x2c05b2[_0x3de6('0x13')][_0x3de6('0x3b')]=_0x2852c1;}_0x2c05b2['query']=Object[_0x3de6('0x3c')](_0x2c05b2[_0x3de6('0x13')],_0x54238d['query']);delete _0x2c05b2['query']['id'];return db['UserProfile']['getResources'](_0x2c05b2);}return db['User'][_0x3de6('0x3d')](_0x538951);})[_0x3de6('0x17')](function(_0x3ec4f){_0x202e69['count']=_0x3ec4f[_0x3de6('0xb')];_0x4b2e12=_0x3ec4f[_0x3de6('0x23')];return _0x4b2e12[_0x3de6('0x27')](function(_0x232677){var _0x5969c3=_[_0x3de6('0x3e')](_0x33d764,['id',_0x232677['id']]);if(_0x5969c3){var _0x27c949=rta[_0x3de6('0x3f')](_0x5969c3);_['merge'](_0x232677,_0x27c949);}_0x232677[_0x3de6('0x1e')]=rta[_0x3de6('0x40')](_0x232677);if(_0x232677[_0x3de6('0x1e')]['includes'](_0x3de6('0x15'))){_0x1bb3b1['forEach'](function(_0xd33d81){if(_0x232677[_0xd33d81+_0x3de6('0x36')]){_0x232677[_0xd33d81+_0x3de6('0x41')]=_0x3de6('0x15');}});}return _0x232677;});})['then'](function(_0x207e26){if(!_0x48499f||_0xd40b2c){return _0x207e26;}return rta['sortAgentsByStatus'](_0x207e26,_0x48499f);})[_0x3de6('0x17')](function(_0x534935){var _0x4cc89c=null;if(_0x54238d[_0x3de6('0x13')]['fields']){var _0xd6ad49=_0x54238d[_0x3de6('0x13')][_0x3de6('0x42')]['split'](',');_0x4cc89c=_0x534935[_0x3de6('0x27')](function(_0x4f5a2d){return _[_0x3de6('0x43')](_0x4f5a2d,_0xd6ad49);});}_0x202e69[_0x3de6('0x23')]=_0x4cc89c||_0x534935;return _0x202e69;})['then'](respondWithFilteredResult(_0x519396,_0x538951))[_0x3de6('0x44')](APIHandleError(_0x519396));};exports[_0x3de6('0x45')]=function(_0x319cb6,_0x4636fc){var _0x4870e0={'count':0x0,'rows':[]};var _0x56f14d={};var _0x423887;var _0x4dcea7;var _0x44bd84;Promise[_0x3de6('0x16')]()['then'](function(){if(_0x319cb6['query']['channel']){if(!utils[_0x3de6('0x18')](_0x319cb6[_0x3de6('0x13')][_0x3de6('0x1b')])){throw new APIBadRequestError(util[_0x3de6('0x19')](_0x3de6('0x1a'),_0x319cb6[_0x3de6('0x13')][_0x3de6('0x1b')]));}_0x423887=_0x319cb6['query'][_0x3de6('0x1b')]['toLowerCase']();}var _0x1d1a99=_[_0x3de6('0x46')](_0x423887)+_0x3de6('0x47');var _0x4ab4ef=_['map'](db[_0x1d1a99][_0x3de6('0x28')],function(_0x579e12){return{'name':_0x579e12[_0x3de6('0x29')],'type':_0x579e12[_0x3de6('0x2a')]['key']};});if(!_0x319cb6[_0x3de6('0x13')][_0x3de6('0x42')]){var _0x1d902b=['id',_0x3de6('0x48')];if(_0x423887==='voice'){_0x1d902b[_0x3de6('0x31')](_0x3de6('0x2a'));if(_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')]==='outbound'){_0x1d902b[_0x3de6('0x31')]([_0x3de6('0x49'),'dialMethod']);}}_0x319cb6[_0x3de6('0x13')][_0x3de6('0x42')]=_0x1d902b[_0x3de6('0x21')](',');}_0x56f14d=qs[_0x3de6('0x2f')](_0x4ab4ef,_0x319cb6);if(_0x319cb6[_0x3de6('0x38')][_0x3de6('0x2c')]===_0x3de6('0x38')){var _0x3263f7={'params':{'id':_0x319cb6[_0x3de6('0x38')][_0x3de6('0x39')]},'query':{'section':_0x423887==='voice'&&_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')]===_0x3de6('0x4a')?_0x3de6('0x4b'):_['startCase'](_0x423887)+'Queues','type':_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')],'nolimit':!![],'sort':_0x3de6('0x48'),'filter':_0x319cb6[_0x3de6('0x13')][_0x3de6('0x4c')]}};return db[_0x3de6('0x4d')]['getResources'](_0x3263f7);}return db[_0x1d1a99][_0x3de6('0x3d')](_0x56f14d);})[_0x3de6('0x17')](function(_0x22b3f3){_0x4870e0[_0x3de6('0xb')]=_0x22b3f3['count'];_0x4dcea7=_0x22b3f3[_0x3de6('0x23')];return rtq[_0x3de6('0x4e')](_0x319cb6,_0x423887);})[_0x3de6('0x17')](function(_0x593f65){_0x44bd84=_0x593f65[_0x3de6('0x23')];return rtq[_0x3de6('0x4f')](_0x4dcea7,_0x44bd84,_0x423887,_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')]);})[_0x3de6('0x17')](function(_0x41f5a8){_0x4870e0['rows']=_0x41f5a8;return _0x4870e0;})[_0x3de6('0x17')](respondWithFilteredResult(_0x4636fc,_0x56f14d))[_0x3de6('0x44')](APIHandleError(_0x4636fc));}; \ No newline at end of file +var _0xa6ba=['getQueues','startCase','Queue','key','name','voice','dialActive','dialMethod','getOptions','Queues','filter','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','fieldName','type','agent','online','sequelize','FIELD(id,','push','Pause','forEach','merge','where','role','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','getAgentStatus','Status','sortAgentsByStatus','fields','split','pick','catch'];(function(_0x2202d2,_0x529a53){var _0x55094b=function(_0x46d701){while(--_0x46d701){_0x2202d2['push'](_0x2202d2['shift']());}};_0x55094b(++_0x529a53);}(_0xa6ba,0x1ba));var _0xaa6b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa6ba[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xaa6b('0x0'));var util=require(_0xaa6b('0x1'));var rta=require(_0xaa6b('0x2'));var rtq=require(_0xaa6b('0x3'));var qs=require('../../components/parsers/qs');var utils=require(_0xaa6b('0x4'));var db=require(_0xaa6b('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0xaa6b('0x6')];var APIHandleError=require(_0xaa6b('0x7'))[_0xaa6b('0x8')];function respondWithFilteredResult(_0x55b241,_0x111e3e){return function(_0x26f610){if(_0x26f610){var _0x40129e=typeof _0x111e3e[_0xaa6b('0x9')]===_0xaa6b('0xa')&&typeof _0x111e3e[_0xaa6b('0xb')]==='undefined';var _0x28dd62=_0x26f610[_0xaa6b('0xc')];var _0x5edba2=_0x40129e?0x0:_0x111e3e[_0xaa6b('0x9')];var _0xe0b8bd=_0x40129e?_0x26f610[_0xaa6b('0xc')]:_0x111e3e[_0xaa6b('0x9')]+_0x111e3e['limit'];var _0x4bde89;if(_0xe0b8bd>=_0x28dd62){_0xe0b8bd=_0x28dd62;_0x4bde89=0xc8;}else{_0x4bde89=0xce;}_0x55b241[_0xaa6b('0xd')](_0x4bde89);return _0x55b241[_0xaa6b('0xe')](_0xaa6b('0xf'),_0x5edba2+'-'+_0xe0b8bd+'/'+_0x28dd62)[_0xaa6b('0x10')](_0x26f610);}return null;};}exports[_0xaa6b('0x11')]=function(_0x1b0871,_0x29a496){var _0x5094f0={'count':0x0,'rows':[]};var _0x4cd2b6={};var _0x26d982;var _0x82e6ba=utils[_0xaa6b('0x12')]();var _0x5c087a;var _0x48d089;var _0x408183=_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x14')];var _0xdbf08d=_0x1b0871['query'][_0xaa6b('0x15')];var _0x5021f3=_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x16')];var _0xf926f=_0xdbf08d===_0xaa6b('0x17')||_0xdbf08d===_0xaa6b('0x18')?!![]:![];var _0x29ee2d=[];var _0x291562;var _0x21be91;Promise[_0xaa6b('0x19')]()[_0xaa6b('0x1a')](function(){if(_0x1b0871['query'][_0xaa6b('0x1b')]){if(!utils[_0xaa6b('0x1c')](_0x1b0871['query'][_0xaa6b('0x1b')])){throw new APIBadRequestError(util[_0xaa6b('0x1d')](_0xaa6b('0x1e'),_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x1b')]));}_0x26d982=_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x1b')][_0xaa6b('0x1f')]();}if(!_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x20')]||!_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x20')][_0xaa6b('0x21')](_0xaa6b('0x22'))){_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x20')]=rta[_0xaa6b('0x23')](_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x20')]);return;}var _0x438fe6=rta['getUpdatedSortOptions'](_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x20')]);_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x20')]=_0x438fe6['fields'][_0xaa6b('0x24')](',');_0x291562=_0x438fe6[_0xaa6b('0x25')];})[_0xaa6b('0x1a')](function(){if(!_0x408183){return[];}return rta[_0xaa6b('0x26')](_0x408183,_0x26d982);})[_0xaa6b('0x1a')](function(_0x2955cb){_0x29ee2d=_0x2955cb;return rta[_0xaa6b('0x27')]();})[_0xaa6b('0x1a')](function(_0x129784){_0x48d089=_0x129784[_0xaa6b('0x28')];if((!_0xdbf08d||_0xf926f)&&!_0x291562){return _0x29ee2d;}if(_0x291562&&!_0xdbf08d){return rta[_0xaa6b('0x29')](_0x48d089,_0x29ee2d,_0x291562);}else{return rta[_0xaa6b('0x2a')](_0x48d089,_0x29ee2d,_0xdbf08d);}})[_0xaa6b('0x1a')](function(_0x3d80b8){_0x29ee2d=_0x3d80b8;var _0x5ad213=![];if(_0x29ee2d[_0xaa6b('0x2b')]===0x0){if(_0x408183||_0xdbf08d){_0x5ad213=!![];}if(_0xf926f){_0x5ad213=![];}}if(_0x5ad213){return _0x5094f0;}var _0x2e4ea8=_[_0xaa6b('0x2c')](db[_0xaa6b('0x2d')]['rawAttributes'],function(_0xd4eded){return{'name':_0xd4eded[_0xaa6b('0x2e')],'type':_0xd4eded[_0xaa6b('0x2f')]['key']};});_0x1b0871[_0xaa6b('0x13')]['role']=_0xaa6b('0x30');_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x31')]=!![];_0x4cd2b6=qs['getOptions'](_0x2e4ea8,_0x1b0871);_0x4cd2b6['raw']=!![];var _0x10ddf9=[];if(_0x29ee2d[_0xaa6b('0x2b')]>0x0){_0x10ddf9['push']({'id':{'$in':_0x29ee2d}});if(_0x291562&&!_0xdbf08d){_0x21be91=[db[_0xaa6b('0x32')]['literal'](_0xaa6b('0x33')+_0x29ee2d+')')];_0x4cd2b6[_0xaa6b('0x25')]=_0x21be91;}}if(_0xf926f){_0x82e6ba['forEach'](function(_0x5e4aa2){var _0x43554e=!![];if(_0xdbf08d===_0xaa6b('0x18')&&_0x26d982!==_0x5e4aa2){_0x43554e=![];}_0x10ddf9[_0xaa6b('0x34')]({[_0x5e4aa2+_0xaa6b('0x35')]:_0x43554e});});if(_0x5021f3){_0x10ddf9['push']({'pauseType':_0x5021f3});}}else if(_0xdbf08d){_0x82e6ba[_0xaa6b('0x36')](function(_0x30a106){_0x10ddf9[_0xaa6b('0x34')]({[_0x30a106+_0xaa6b('0x35')]:![]});});}_0x4cd2b6['where']=_[_0xaa6b('0x37')](_0x4cd2b6[_0xaa6b('0x38')],{'$and':_0x10ddf9});if(_0x1b0871['user'][_0xaa6b('0x39')]===_0xaa6b('0x3a')){var _0x2e850c={'params':{'id':_0x1b0871[_0xaa6b('0x3a')][_0xaa6b('0x3b')]},'query':{'section':_0xaa6b('0x3c'),'role':_0xaa6b('0x30'),'online':!![],'raw':!![],'ids':_0x29ee2d,'customSorting':_0x21be91}};if(_0xf926f){_0x2e850c[_0xaa6b('0x13')][_0xaa6b('0x3d')]=_0x10ddf9;}_0x2e850c[_0xaa6b('0x13')]=Object[_0xaa6b('0x3e')](_0x2e850c[_0xaa6b('0x13')],_0x1b0871[_0xaa6b('0x13')]);delete _0x2e850c['query']['id'];return db[_0xaa6b('0x3f')][_0xaa6b('0x40')](_0x2e850c);}return db[_0xaa6b('0x2d')][_0xaa6b('0x41')](_0x4cd2b6);})['then'](function(_0x17ed47){_0x5094f0['count']=_0x17ed47['count'];_0x5c087a=_0x17ed47[_0xaa6b('0x28')];return _0x5c087a[_0xaa6b('0x2c')](function(_0x19719d){var _0x37bea0=_[_0xaa6b('0x42')](_0x48d089,['id',_0x19719d['id']]);if(_0x37bea0){var _0x245bd4=rta['filterAgentAttributes'](_0x37bea0);_[_0xaa6b('0x37')](_0x19719d,_0x245bd4);}_0x19719d[_0xaa6b('0x22')]=rta[_0xaa6b('0x43')](_0x19719d);if(_0x19719d['globalStatus'][_0xaa6b('0x21')]('pause')){_0x82e6ba[_0xaa6b('0x36')](function(_0x35d37c){if(_0x19719d[_0x35d37c+_0xaa6b('0x35')]){_0x19719d[_0x35d37c+_0xaa6b('0x44')]=_0xaa6b('0x17');}});}return _0x19719d;});})['then'](function(_0x5952eb){if(!_0x291562||_0x21be91){return _0x5952eb;}return rta[_0xaa6b('0x45')](_0x5952eb,_0x291562);})[_0xaa6b('0x1a')](function(_0x5ebedc){var _0x2a8302=null;if(_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x46')]){var _0x55a84f=_0x1b0871[_0xaa6b('0x13')][_0xaa6b('0x46')][_0xaa6b('0x47')](',');_0x2a8302=_0x5ebedc['map'](function(_0x2dce65){return _[_0xaa6b('0x48')](_0x2dce65,_0x55a84f);});}_0x5094f0['rows']=_0x2a8302||_0x5ebedc;return _0x5094f0;})['then'](respondWithFilteredResult(_0x29a496,_0x4cd2b6))[_0xaa6b('0x49')](APIHandleError(_0x29a496));};exports[_0xaa6b('0x4a')]=function(_0x2594ca,_0x12fee3){var _0x41d958={'count':0x0,'rows':[]};var _0x308dd9={};var _0x12913c;var _0x444d29;var _0x2e6fb6;Promise['resolve']()[_0xaa6b('0x1a')](function(){if(_0x2594ca[_0xaa6b('0x13')][_0xaa6b('0x1b')]){if(!utils[_0xaa6b('0x1c')](_0x2594ca[_0xaa6b('0x13')][_0xaa6b('0x1b')])){throw new APIBadRequestError(util[_0xaa6b('0x1d')](_0xaa6b('0x1e'),_0x2594ca[_0xaa6b('0x13')][_0xaa6b('0x1b')]));}_0x12913c=_0x2594ca[_0xaa6b('0x13')][_0xaa6b('0x1b')][_0xaa6b('0x1f')]();}var _0x45fe8c=_[_0xaa6b('0x4b')](_0x12913c)+_0xaa6b('0x4c');var _0x36bc3f=_[_0xaa6b('0x2c')](db[_0x45fe8c]['rawAttributes'],function(_0x1afcb4){return{'name':_0x1afcb4[_0xaa6b('0x2e')],'type':_0x1afcb4[_0xaa6b('0x2f')][_0xaa6b('0x4d')]};});if(!_0x2594ca['query']['fields']){var _0x3ff32c=['id',_0xaa6b('0x4e')];if(_0x12913c===_0xaa6b('0x4f')){_0x3ff32c[_0xaa6b('0x34')]('type');if(_0x2594ca['query']['type']==='outbound'){_0x3ff32c['push']([_0xaa6b('0x50'),_0xaa6b('0x51')]);}}_0x2594ca['query'][_0xaa6b('0x46')]=_0x3ff32c[_0xaa6b('0x24')](',');}_0x308dd9=qs[_0xaa6b('0x52')](_0x36bc3f,_0x2594ca);if(_0x2594ca['user']['role']===_0xaa6b('0x3a')){var _0x4b7f7a={'params':{'id':_0x2594ca[_0xaa6b('0x3a')][_0xaa6b('0x3b')]},'query':{'section':_0x12913c===_0xaa6b('0x4f')&&_0x2594ca['query'][_0xaa6b('0x2f')]==='outbound'?'QueueCampaigns':_[_0xaa6b('0x4b')](_0x12913c)+_0xaa6b('0x53'),'type':_0x2594ca['query'][_0xaa6b('0x2f')],'nolimit':!![],'sort':_0xaa6b('0x4e'),'filter':_0x2594ca[_0xaa6b('0x13')][_0xaa6b('0x54')]}};return db['UserProfile'][_0xaa6b('0x40')](_0x4b7f7a);}return db[_0x45fe8c][_0xaa6b('0x41')](_0x308dd9);})[_0xaa6b('0x1a')](function(_0x3872bd){_0x41d958['count']=_0x3872bd['count'];_0x444d29=_0x3872bd[_0xaa6b('0x28')];return rtq['getRealtimeQueues'](_0x2594ca,_0x12913c);})[_0xaa6b('0x1a')](function(_0x3c3880){_0x2e6fb6=_0x3c3880[_0xaa6b('0x28')];return rtq[_0xaa6b('0x55')](_0x444d29,_0x2e6fb6,_0x12913c,_0x2594ca[_0xaa6b('0x13')]['type']);})[_0xaa6b('0x1a')](function(_0x12ed1f){_0x41d958[_0xaa6b('0x28')]=_0x12ed1f;return _0x41d958;})[_0xaa6b('0x1a')](respondWithFilteredResult(_0x12fee3,_0x308dd9))['catch'](APIHandleError(_0x12fee3));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 662c64a..e79d41d 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xcead4,_0x54dd56){var _0x3c3f91=function(_0xfe25cf){while(--_0xfe25cf){_0xcead4['push'](_0xcead4['shift']());}};_0x3c3f91(++_0x54dd56);}(_0xedd9,0xfc));var _0x9edd=function(_0x4692d7,_0x448d8e){_0x4692d7=_0x4692d7-0x0;var _0x26657a=_0xedd9[_0x4692d7];return _0x26657a;};'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(_0x133de8,_0xdde3d9){var _0x1861eb=function(_0x395f6b){while(--_0x395f6b){_0x133de8['push'](_0x133de8['shift']());}};_0x1861eb(++_0xdde3d9);}(_0xedd9,0xfc));var _0x9edd=function(_0x225a46,_0x224368){_0x225a46=_0x225a46-0x0;var _0x3a1797=_0xedd9[_0x225a46];return _0x3a1797;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 37300ad..6e5976f 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 _0xc7b3=['exports','STRING','DATE','INTEGER','sequelize'];(function(_0x539a53,_0x389971){var _0x233052=function(_0x1b9fa8){while(--_0x1b9fa8){_0x539a53['push'](_0x539a53['shift']());}};_0x233052(++_0x389971);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc7b3[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0x3c7b('0x0'));module[_0x3c7b('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3c7b('0x2')]},'scheduledat':{'type':Sequelize[_0x3c7b('0x3')]},'uniqueid':{'type':Sequelize[_0x3c7b('0x2')]},'starttime':{'type':Sequelize[_0x3c7b('0x3')]},'responsetime':{'type':Sequelize[_0x3c7b('0x3')]},'ringtime':{'type':Sequelize[_0x3c7b('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x3c7b('0x2')]},'membername':{'type':Sequelize[_0x3c7b('0x2')]}}; \ No newline at end of file +var _0x1939=['DATE','sequelize','INTEGER','STRING'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x1939,0x1d1));var _0x9193=function(_0x26a515,_0x286339){_0x26a515=_0x26a515-0x0;var _0x314682=_0x1939[_0x26a515];return _0x314682;};'use strict';var Sequelize=require(_0x9193('0x0'));module['exports']={'state':{'type':Sequelize[_0x9193('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9193('0x2')]},'scheduledat':{'type':Sequelize[_0x9193('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9193('0x3')]},'responsetime':{'type':Sequelize[_0x9193('0x3')]},'ringtime':{'type':Sequelize[_0x9193('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9193('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9193('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 2af6ca8..7ff56a9 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 _0xa881=['path','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x38a0e9,_0x3da515){var _0xb3472c=function(_0x388561){while(--_0x388561){_0x38a0e9['push'](_0x38a0e9['shift']());}};_0xb3472c(++_0x3da515);}(_0xa881,0x199));var _0x1a88=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa881[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1a88('0x0'));var util=require(_0x1a88('0x1'));var logger=require(_0x1a88('0x2'))(_0x1a88('0x3'));var moment=require(_0x1a88('0x4'));var BPromise=require(_0x1a88('0x5'));var rp=require(_0x1a88('0x6'));var fs=require('fs');var path=require(_0x1a88('0x7'));var rimraf=require('rimraf');var config=require(_0x1a88('0x8'));var attributes=require(_0x1a88('0x9'));module[_0x1a88('0xa')]=function(_0x5daf12,_0x501949){return _0x5daf12[_0x1a88('0xb')]('ReportAgentPreview',attributes,{'tableName':_0x1a88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x675e=['define','ReportAgentPreview','report_agent_preview','lodash','util','moment','request-promise','path','rimraf','./reportAgentPreview.attributes'];(function(_0x4f828c,_0x2f6cac){var _0x1fea4d=function(_0x3049f2){while(--_0x3049f2){_0x4f828c['push'](_0x4f828c['shift']());}};_0x1fea4d(++_0x2f6cac);}(_0x675e,0x1a7));var _0xe675=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0x675e[_0x3f6565];return _0x4abd23;};'use strict';var _=require(_0xe675('0x0'));var util=require(_0xe675('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe675('0x2'));var BPromise=require('bluebird');var rp=require(_0xe675('0x3'));var fs=require('fs');var path=require(_0xe675('0x4'));var rimraf=require(_0xe675('0x5'));var config=require('../../config/environment');var attributes=require(_0xe675('0x6'));module['exports']=function(_0x1ee97b,_0x3e36fd){return _0x1ee97b[_0xe675('0x7')](_0xe675('0x8'),attributes,{'tableName':_0xe675('0x9'),'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 18579fa..608fa64 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 _0x5fdd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','info','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','moment'];(function(_0x47db1e,_0x1345a2){var _0x12983f=function(_0x1c7e2d){while(--_0x1c7e2d){_0x47db1e['push'](_0x47db1e['shift']());}};_0x12983f(++_0x1345a2);}(_0x5fdd,0x16f));var _0xd5fd=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x5fdd[_0x547456];return _0xc1fd7b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd5fd('0x0'));var BPromise=require(_0xd5fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5fd('0x2'));var db=require(_0xd5fd('0x3'))['db'];var utils=require(_0xd5fd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd5fd('0x5'));var jayson=require(_0xd5fd('0x6'));var client=jayson[_0xd5fd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fda78,_0x3f02b1,_0x3a854f){return new BPromise(function(_0x87ca6c,_0x238700){return client['request'](_0x1fda78,_0x3a854f)[_0xd5fd('0x8')](function(_0x559dae){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0xd5fd('0x9'));logger[_0xd5fd('0xa')](_0xd5fd('0xb'),_0x3f02b1,_0xd5fd('0x9'),JSON[_0xd5fd('0xc')](_0x559dae));if(_0x559dae[_0xd5fd('0xd')]){if(_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xe')]===0x1f4){logger[_0xd5fd('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0x559dae['error'][_0xd5fd('0xf')]);return _0x238700(_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xf')]);}logger['error'](_0xd5fd('0x10'),_0x3f02b1,_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xf')]);return _0x87ca6c(_0x559dae['error'][_0xd5fd('0xf')]);}else{logger[_0xd5fd('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0xd5fd('0x9'));_0x87ca6c(_0x559dae['result'][_0xd5fd('0xf')]);}})[_0xd5fd('0x12')](function(_0x1b00c5){logger[_0xd5fd('0xd')](_0xd5fd('0x10'),_0x3f02b1,_0x1b00c5);_0x238700(_0x1b00c5);});});}exports[_0xd5fd('0x13')]=function(_0x50f12e){var _0x365829=this;return new Promise(function(_0x6873ae,_0x262c27){return db[_0xd5fd('0x14')]['create'](_0x50f12e[_0xd5fd('0x15')],{'raw':_0x50f12e[_0xd5fd('0x16')]?_0x50f12e[_0xd5fd('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd5fd('0x8')](function(_0xf4ed32){logger['info'](_0xd5fd('0x13'),_0x50f12e);logger['debug']('CreateReportAgentPreview',_0x50f12e,JSON[_0xd5fd('0xc')](_0xf4ed32));_0x6873ae(_0xf4ed32);})[_0xd5fd('0x12')](function(_0x21d4ad){logger['error'](_0xd5fd('0x13'),_0x21d4ad['message'],_0x50f12e);_0x262c27(_0x365829[_0xd5fd('0xd')](0x1f4,_0x21d4ad[_0xd5fd('0xf')]));});});}; \ No newline at end of file +var _0x30ff=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2044ec,_0x86721e){var _0x4472e3=function(_0x10972e){while(--_0x10972e){_0x2044ec['push'](_0x2044ec['shift']());}};_0x4472e3(++_0x86721e);}(_0x30ff,0x6a));var _0xf30f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x30ff[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xf30f('0x0'));var moment=require(_0xf30f('0x1'));var BPromise=require(_0xf30f('0x2'));var rs=require(_0xf30f('0x3'));var fs=require('fs');var Redis=require(_0xf30f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf30f('0x5'));var logger=require(_0xf30f('0x6'))('rpc');var config=require(_0xf30f('0x7'));var jayson=require(_0xf30f('0x8'));var client=jayson[_0xf30f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c95ba,_0x25c70a,_0x1a1fc0){return new BPromise(function(_0x398805,_0x5b4901){return client[_0xf30f('0xa')](_0x2c95ba,_0x1a1fc0)[_0xf30f('0xb')](function(_0x35cff8){logger[_0xf30f('0xc')](_0xf30f('0xd'),_0x25c70a,_0xf30f('0xe'));logger[_0xf30f('0xf')](_0xf30f('0x10'),_0x25c70a,_0xf30f('0xe'),JSON[_0xf30f('0x11')](_0x35cff8));if(_0x35cff8[_0xf30f('0x12')]){if(_0x35cff8[_0xf30f('0x12')]['code']===0x1f4){logger[_0xf30f('0x12')](_0xf30f('0xd'),_0x25c70a,_0x35cff8[_0xf30f('0x12')]['message']);return _0x5b4901(_0x35cff8[_0xf30f('0x12')][_0xf30f('0x13')]);}logger[_0xf30f('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x25c70a,_0x35cff8[_0xf30f('0x12')][_0xf30f('0x13')]);return _0x398805(_0x35cff8[_0xf30f('0x12')][_0xf30f('0x13')]);}else{logger[_0xf30f('0xc')](_0xf30f('0xd'),_0x25c70a,_0xf30f('0xe'));_0x398805(_0x35cff8[_0xf30f('0x14')][_0xf30f('0x13')]);}})['catch'](function(_0x3d1d77){logger[_0xf30f('0x12')](_0xf30f('0xd'),_0x25c70a,_0x3d1d77);_0x5b4901(_0x3d1d77);});});}exports[_0xf30f('0x15')]=function(_0xce8b1b){var _0x16c4ad=this;return new Promise(function(_0x532d98,_0x175e27){return db[_0xf30f('0x16')][_0xf30f('0x17')](_0xce8b1b[_0xf30f('0x18')],{'raw':_0xce8b1b['options']?_0xce8b1b[_0xf30f('0x19')][_0xf30f('0x1a')]===undefined?!![]:![]:!![]})[_0xf30f('0xb')](function(_0x47d75e){logger['info'](_0xf30f('0x15'),_0xce8b1b);logger[_0xf30f('0xf')](_0xf30f('0x15'),_0xce8b1b,JSON['stringify'](_0x47d75e));_0x532d98(_0x47d75e);})[_0xf30f('0x1b')](function(_0xca91e2){logger[_0xf30f('0x12')](_0xf30f('0x15'),_0xca91e2[_0xf30f('0x13')],_0xce8b1b);_0x175e27(_0x16c4ad['error'](0x1f4,_0xca91e2[_0xf30f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 7d52ccd..0fff548 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 _0x2c05=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/:id','put','/outbound','outbound','/outbound/channels','outboundChannels','agents','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id','post','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','Router','../../components/auth/service','./rpc.controller','get'];(function(_0x9b6d07,_0x2b840e){var _0x5b9c21=function(_0x31aa91){while(--_0x31aa91){_0x9b6d07['push'](_0x9b6d07['shift']());}};_0x5b9c21(++_0x2b840e);}(_0x2c05,0x143));var _0x52c0=function(_0x2b3dd3,_0x35a845){_0x2b3dd3=_0x2b3dd3-0x0;var _0x53436f=_0x2c05[_0x2b3dd3];return _0x53436f;};'use strict';var multer=require(_0x52c0('0x0'));var util=require(_0x52c0('0x1'));var path=require(_0x52c0('0x2'));var express=require('express');var router=express[_0x52c0('0x3')]();var auth=require(_0x52c0('0x4'));var controller=require(_0x52c0('0x5'));router[_0x52c0('0x6')](_0x52c0('0x7'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x9')]);router[_0x52c0('0x6')](_0x52c0('0xa'),auth['isAuthenticated'](),controller[_0x52c0('0xb')]);router['get'](_0x52c0('0xc'),auth[_0x52c0('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x52c0('0x6')](_0x52c0('0xd'),auth[_0x52c0('0x8')](),controller['voiceQueues']);router['get'](_0x52c0('0xe'),auth['isAuthenticated'](),controller[_0x52c0('0xf')]);router['get'](_0x52c0('0x10'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x11')]);router[_0x52c0('0x6')](_0x52c0('0x12'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x52c0('0x6')](_0x52c0('0x13'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x14')]);router[_0x52c0('0x6')](_0x52c0('0x15'),auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x52c0('0x16'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x17')]);router[_0x52c0('0x6')](_0x52c0('0x18'),auth[_0x52c0('0x8')](),controller['faxQueues']);router[_0x52c0('0x6')](_0x52c0('0x19'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x1a')]);router[_0x52c0('0x6')]('/voice/queues/channels',auth[_0x52c0('0x8')](),controller[_0x52c0('0x1b')]);router[_0x52c0('0x6')](_0x52c0('0x1c'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x1d')]);router[_0x52c0('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x52c0('0x8')](),controller['voiceQueuesChannelHangup']);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x52c0('0x6')](_0x52c0('0x1e'),auth[_0x52c0('0x8')](),controller['showVoiceQueues']);router[_0x52c0('0x1f')](_0x52c0('0x1e'),auth[_0x52c0('0x8')](),controller['updateVoiceQueue']);router[_0x52c0('0x6')](_0x52c0('0x20'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x21')]);router[_0x52c0('0x6')](_0x52c0('0x22'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x23')]);router['get']('/agents',auth[_0x52c0('0x8')](),controller[_0x52c0('0x24')]);router['put']('/agents/:id/capacity',auth[_0x52c0('0x8')](),controller['agentCapacity']);router[_0x52c0('0x6')]('/telephones',auth[_0x52c0('0x8')](),controller['telephones']);router[_0x52c0('0x6')]('/trunks',auth[_0x52c0('0x8')](),controller['trunks']);router['get'](_0x52c0('0x25'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x26')]);router[_0x52c0('0x6')](_0x52c0('0x27'),auth['isAuthenticated'](),controller[_0x52c0('0x28')]);router['get'](_0x52c0('0x29'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x2a')]);router['get']('/mail/queues/waitinginteractions',auth[_0x52c0('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0x52c0('0x6')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x52c0('0x2b')]);router[_0x52c0('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0x52c0('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x52c0('0x6')]('/sms/queues/waitinginteractions',auth[_0x52c0('0x8')](),controller[_0x52c0('0x2c')]);router[_0x52c0('0x6')](_0x52c0('0x2d'),auth[_0x52c0('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0x52c0('0x6')](_0x52c0('0x2e'),auth[_0x52c0('0x8')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x52c0('0x2f'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')](_0x52c0('0x31')));router['get'](_0x52c0('0x32'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x33')]);router['post']('/chat/queues/:id/notify',auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')]('chat'));router['get'](_0x52c0('0x34'),auth[_0x52c0('0x8')](),controller['showChatQueues']);router[_0x52c0('0x35')]('/fax/queues/:id/notify',auth[_0x52c0('0x8')](),controller['queueNotify']('fax'));router[_0x52c0('0x6')](_0x52c0('0x36'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x37')]);router[_0x52c0('0x35')](_0x52c0('0x38'),auth['isAuthenticated'](),controller[_0x52c0('0x30')]('openchannel'));router[_0x52c0('0x6')]('/openchannel/queues/:id',auth[_0x52c0('0x8')](),controller[_0x52c0('0x39')]);router[_0x52c0('0x35')](_0x52c0('0x3a'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')]('sms'));router[_0x52c0('0x35')](_0x52c0('0x3b'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')](_0x52c0('0x3c')));router['get'](_0x52c0('0x3d'),auth[_0x52c0('0x8')](),controller['showSmsQueues']);router[_0x52c0('0x6')](_0x52c0('0x3e'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x3f')]);router['post'](_0x52c0('0x40'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x41')]);module['exports']=router; \ No newline at end of file +var _0x7c70=['/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','chat','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','/telephones','telephones','trunks','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions'];(function(_0x4ede38,_0x4dc1e4){var _0x28119e=function(_0x3c6bb1){while(--_0x3c6bb1){_0x4ede38['push'](_0x4ede38['shift']());}};_0x28119e(++_0x4dc1e4);}(_0x7c70,0xfc));var _0x07c7=function(_0x2a4fa4,_0x20ff6c){_0x2a4fa4=_0x2a4fa4-0x0;var _0x20104a=_0x7c70[_0x2a4fa4];return _0x20104a;};'use strict';var multer=require(_0x07c7('0x0'));var util=require('util');var path=require(_0x07c7('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x07c7('0x2'));var controller=require(_0x07c7('0x3'));router[_0x07c7('0x4')](_0x07c7('0x5'),auth[_0x07c7('0x6')](),controller['voiceChannels']);router['get'](_0x07c7('0x7'),auth[_0x07c7('0x6')](),controller['voiceChannelMixMonitor']);router[_0x07c7('0x4')](_0x07c7('0x8'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x9')]);router['get'](_0x07c7('0xa'),auth[_0x07c7('0x6')](),controller[_0x07c7('0xb')]);router['get'](_0x07c7('0xc'),auth[_0x07c7('0x6')](),controller[_0x07c7('0xd')]);router[_0x07c7('0x4')](_0x07c7('0xe'),auth['isAuthenticated'](),controller[_0x07c7('0xf')]);router[_0x07c7('0x4')](_0x07c7('0x10'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x11')]);router[_0x07c7('0x4')](_0x07c7('0x12'),auth[_0x07c7('0x6')](),controller['openchannelQueues']);router[_0x07c7('0x4')]('/sms/queues',auth[_0x07c7('0x6')](),controller[_0x07c7('0x13')]);router['get'](_0x07c7('0x14'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x15')]);router['get']('/fax/queues',auth[_0x07c7('0x6')](),controller[_0x07c7('0x16')]);router['get'](_0x07c7('0x17'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x18')]);router[_0x07c7('0x4')](_0x07c7('0x19'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x1a')]);router[_0x07c7('0x4')](_0x07c7('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x07c7('0x4')](_0x07c7('0x1c'),auth[_0x07c7('0x6')](),controller['voiceQueuesChannelHangup']);router['get'](_0x07c7('0x1d'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x1e')]);router[_0x07c7('0x4')]('/voice/queues/:id',auth[_0x07c7('0x6')](),controller[_0x07c7('0x1f')]);router[_0x07c7('0x20')](_0x07c7('0x21'),auth[_0x07c7('0x6')](),controller['updateVoiceQueue']);router[_0x07c7('0x4')](_0x07c7('0x22'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x23')]);router[_0x07c7('0x4')](_0x07c7('0x24'),auth[_0x07c7('0x6')](),controller['outboundChannels']);router[_0x07c7('0x4')](_0x07c7('0x25'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x26')]);router[_0x07c7('0x20')](_0x07c7('0x27'),auth[_0x07c7('0x6')](),controller['agentCapacity']);router['get'](_0x07c7('0x28'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x29')]);router[_0x07c7('0x4')]('/trunks',auth[_0x07c7('0x6')](),controller[_0x07c7('0x2a')]);router[_0x07c7('0x4')]('/campaigns',auth[_0x07c7('0x6')](),controller[_0x07c7('0x2b')]);router['get'](_0x07c7('0x2c'),auth[_0x07c7('0x6')](),controller['faxAccounts']);router[_0x07c7('0x4')](_0x07c7('0x2d'),auth[_0x07c7('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x07c7('0x4')](_0x07c7('0x2e'),auth[_0x07c7('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x07c7('0x4')](_0x07c7('0x2f'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x30')]);router[_0x07c7('0x4')](_0x07c7('0x31'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x07c7('0x4')](_0x07c7('0x32'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x33')]);router[_0x07c7('0x4')](_0x07c7('0x34'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x35')]);router['get'](_0x07c7('0x36'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x37')]);router[_0x07c7('0x38')](_0x07c7('0x39'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x3a')]('mail'));router[_0x07c7('0x4')](_0x07c7('0x3b'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x3c')]);router[_0x07c7('0x38')]('/chat/queues/:id/notify',auth[_0x07c7('0x6')](),controller[_0x07c7('0x3a')](_0x07c7('0x3d')));router[_0x07c7('0x4')]('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router[_0x07c7('0x38')]('/fax/queues/:id/notify',auth[_0x07c7('0x6')](),controller[_0x07c7('0x3a')]('fax'));router['get'](_0x07c7('0x3e'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x3f')]);router[_0x07c7('0x38')](_0x07c7('0x40'),auth['isAuthenticated'](),controller[_0x07c7('0x3a')](_0x07c7('0x41')));router[_0x07c7('0x4')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x07c7('0x42')]);router[_0x07c7('0x38')](_0x07c7('0x43'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x3a')](_0x07c7('0x44')));router[_0x07c7('0x38')]('/whatsapp/queues/:id/notify',auth[_0x07c7('0x6')](),controller[_0x07c7('0x3a')](_0x07c7('0x45')));router[_0x07c7('0x4')](_0x07c7('0x46'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x47')]);router['get']('/whatsapp/queues/:id',auth[_0x07c7('0x6')](),controller[_0x07c7('0x48')]);router['post'](_0x07c7('0x49'),auth[_0x07c7('0x6')](),controller[_0x07c7('0x4a')]);module[_0x07c7('0x4b')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index c2f1ef0..2a58705 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 _0xe14b=['MessageId','InteractionId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Website','User','agent','Agent\x20not\x20found','Message','update','From','bluebird','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found'];(function(_0x38c80f,_0x9b0c12){var _0x3d8954=function(_0x45059c){while(--_0x45059c){_0x38c80f['push'](_0x38c80f['shift']());}};_0x3d8954(++_0x9b0c12);}(_0xe14b,0x93));var _0xbe14=function(_0x4765a7,_0x2e2248){_0x4765a7=_0x4765a7-0x0;var _0xd05e90=_0xe14b[_0x4765a7];return _0xd05e90;};'use strict';var BPromise=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var _=require('lodash');var util=require('util');var db=require(_0xbe14('0x2'))['db'];var logger=require(_0xbe14('0x3'))('api');var jayson=require(_0xbe14('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232b});var routingClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){var _0x496063=_0x196fca?_0x196fca:amiClient;return _0x496063[_0xbe14('0x7')](_0x1d9ade,_0x39387e)[_0xbe14('0x8')](function(_0xd68cd7){if(_0xd68cd7[_0xbe14('0x9')]){if(_0xd68cd7['error']['code']===0x1f4){return _0x50f909(_0xd68cd7[_0xbe14('0x9')][_0xbe14('0xa')]);}return _0x566ae7(_0xd68cd7['error'][_0xbe14('0xa')]);}else{_0x566ae7(_0xd68cd7[_0xbe14('0xb')]);}})[_0xbe14('0xc')](function(_0x3d38c2){_0x50f909(_0x3d38c2);});});}function respondWithResult(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xc8;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0xd')](_0x3b898d)[_0xbe14('0xe')](_0x23a730);}return _0x27792f[_0xbe14('0xf')](0x194);};}function handleError(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0x1f4;return function(_0x813399){logger['error'](_0x813399['stack']);if(_0x813399[_0xbe14('0x10')]){delete _0x813399[_0xbe14('0x10')];}_0x1e4826[_0xbe14('0xd')](_0x33fd54)[_0xbe14('0x11')](_0x813399);};}function findById(_0x4e8f34){return function(_0x21c789){if(!_[_0xbe14('0x12')](_0x4e8f34)&&!_[_0xbe14('0x12')](_0x21c789)&&!_[_0xbe14('0x12')](_0x21c789[_0xbe14('0x13')])){return _[_0xbe14('0x14')](_0x21c789[_0xbe14('0x13')],function(_0x5ea1f8){return _0x5ea1f8['id']==_0x4e8f34;});}return null;};}exports[_0xbe14('0x15')]=function(_0x456ca8,_0x329588){return respondWithRpcPromise(_0xbe14('0x16'),_0x456ca8[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x329588,null))['catch'](handleError(_0x329588,null));};exports[_0xbe14('0x18')]=function(_0x4a1bbd,_0x417c8d){return respondWithRpcPromise(_0xbe14('0x19'),_[_0xbe14('0x1a')](_0x4a1bbd['query'],_0x4a1bbd[_0xbe14('0x1b')]))['then'](respondWithResult(_0x417c8d,null))[_0xbe14('0xc')](handleError(_0x417c8d,null));};exports['voiceChannelStopMixMonitor']=function(_0x32e8eb,_0x4a25fa){return respondWithRpcPromise(_0xbe14('0x1c'),_[_0xbe14('0x1a')](_0x32e8eb['query'],_0x32e8eb[_0xbe14('0x1b')]))['then'](respondWithResult(_0x4a25fa,null))[_0xbe14('0xc')](handleError(_0x4a25fa,null));};exports['voiceQueues']=function(_0x36a21e,_0x5fa043){return respondWithRpcPromise(_0xbe14('0x1d'),_0x36a21e[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x5fa043,null))[_0xbe14('0xc')](handleError(_0x5fa043,null));};exports['showVoiceQueues']=function(_0x1822e0,_0x1ba46a){return respondWithRpcPromise(_0xbe14('0x1d'),_0x1822e0[_0xbe14('0x17')])['then'](findById(_0x1822e0[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x1ba46a,null))['catch'](handleError(_0x1ba46a,null));};exports[_0xbe14('0x1e')]=function(_0x3b3e84,_0x1c7cc7){return respondWithRpcPromise(_0xbe14('0x1f'),_[_0xbe14('0x1a')](_0x3b3e84[_0xbe14('0x20')],_0x3b3e84[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x1c7cc7,null))[_0xbe14('0xc')](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x21')]=function(_0x40538f,_0x3bf43c){return respondWithRpcPromise(_0xbe14('0x22'),_[_0xbe14('0x1a')](_0x40538f[_0xbe14('0x17')],_0x40538f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x3bf43c,null))[_0xbe14('0xc')](handleError(_0x3bf43c,null));};exports[_0xbe14('0x23')]=function(_0x14e7c4,_0x581e86){return respondWithRpcPromise(_0xbe14('0x24'),_0x14e7c4['query'])['then'](respondWithResult(_0x581e86,null))[_0xbe14('0xc')](handleError(_0x581e86,null));};exports['voiceQueuesChannel']=function(_0x243524,_0x345b0){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x243524['query'],_0x243524[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x345b0,null))['catch'](handleError(_0x345b0,null));};exports[_0xbe14('0x25')]=function(_0x1faf3e,_0x452635){return respondWithRpcPromise(_0xbe14('0x26'),_[_0xbe14('0x1a')](_0x1faf3e['query'],_0x1faf3e['params']))[_0xbe14('0x8')](respondWithResult(_0x452635,null))['catch'](handleError(_0x452635,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c5e9f,_0x163ef7){return respondWithRpcPromise(_0xbe14('0x27'),_[_0xbe14('0x1a')](_0x5c5e9f[_0xbe14('0x17')],_0x5c5e9f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x163ef7,null))[_0xbe14('0xc')](handleError(_0x163ef7,null));};exports[_0xbe14('0x28')]=function(_0x2d9c12,_0x2dfd5a){return respondWithRpcPromise(_0xbe14('0x29'),_0x2d9c12[_0xbe14('0x17')])['then'](respondWithResult(_0x2dfd5a,null))['catch'](handleError(_0x2dfd5a,null));};exports[_0xbe14('0x2a')]=function(_0x2951e1,_0x13bfcf){return respondWithRpcPromise('OutboundChannels',_0x2951e1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x13bfcf,null))[_0xbe14('0xc')](handleError(_0x13bfcf,null));};exports[_0xbe14('0x2b')]=function(_0x3bd454,_0x25ee1f){var _0x19fa30;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')])['then'](function(_0xe51424){_0x19fa30=_0xe51424;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')],routingClient);})[_0xbe14('0x8')](function(_0x3287b9){return _[_0xbe14('0x1a')]({},_0x3287b9,_0x19fa30);})['then'](respondWithResult(_0x25ee1f,null))[_0xbe14('0xc')](handleError(_0x25ee1f,null));};exports[_0xbe14('0x2d')]=function(_0x1220c9,_0x36263c){if(_0x1220c9['body']&&_0x1220c9['body'][_0xbe14('0x2e')]&&_0x1220c9[_0xbe14('0x2f')]&&_0x1220c9[_0xbe14('0x2f')]['name']){for(var _0x5d5318 in _0x1220c9[_0xbe14('0x20')]['interaction']){if(_0x1220c9['body'][_0xbe14('0x2e')][_0xbe14('0x30')](_0x5d5318)){db[_0xbe14('0x31')]['findAll']({'where':{'channel':_0x5d5318,'membername':_0x1220c9['user']['name'],'type':_0xbe14('0x32'),'exitAt':null,'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]&&_0x1220c9['body'][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')]?{'$notIn':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]}:{'$ne':null}}})['then'](function(_0x4a1a4b){var _0x3e2fd3=moment()[_0xbe14('0x34')](_0xbe14('0x35'));for(var _0xb2b285=0x0,_0x2550dc=_0x4a1a4b['length'];_0xb2b285<_0x2550dc;_0xb2b285+=0x1){_0x4a1a4b[_0xb2b285]['updateAttributes']({'exitAt':_0x3e2fd3});}});for(var _0x46af81=0x0;_0x46af81<_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')];_0x46af81+=0x1){db['MemberReport'][_0xbe14('0x36')]({'where':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'type':_0xbe14('0x32'),'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81],'exitAt':null},'defaults':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'interface':_['isNil'](_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')])?util['format']('SIP/%s',_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x10')]):_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')],'type':_0xbe14('0x32'),'enterAt':moment()[_0xbe14('0x34')](_0xbe14('0x35')),'role':'agent','internal':_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x38')],'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81]}});}}}}return respondWithRpcPromise(_0xbe14('0x39'),{'id':_0x1220c9['params']['id'],'capacity':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x3a')]},routingClient)[_0xbe14('0x8')](respondWithResult(_0x36263c,null))[_0xbe14('0xc')](handleError(_0x36263c,null));};exports[_0xbe14('0x3b')]=function(_0x2dbeb1,_0x505829){return respondWithRpcPromise('Telephones',_0x2dbeb1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x505829,null))[_0xbe14('0xc')](handleError(_0x505829,null));};exports['trunks']=function(_0x497b00,_0x44fe0d){return respondWithRpcPromise(_0xbe14('0x3c'),_0x497b00['query'])[_0xbe14('0x8')](respondWithResult(_0x44fe0d,null))[_0xbe14('0xc')](handleError(_0x44fe0d,null));};exports['campaigns']=function(_0x28f995,_0x4a40d2){return respondWithRpcPromise(_0xbe14('0x3d'),_0x28f995[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x4a40d2,null))['catch'](handleError(_0x4a40d2,null));};exports[_0xbe14('0x3e')]=function(_0x404212,_0x5dc78a){return respondWithRpcPromise(_0xbe14('0x3f'),_0x404212[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x5dc78a,null))[_0xbe14('0xc')](handleError(_0x5dc78a,null));};exports[_0xbe14('0x40')]=function(_0x4f06a3,_0x42a346){return respondWithRpcPromise(_0xbe14('0x3f'),_0x4f06a3[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x4f06a3[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x42a346,null))[_0xbe14('0xc')](handleError(_0x42a346,null));};exports['mailQueues']=function(_0x72c875,_0x1b47a4){return respondWithRpcPromise(_0xbe14('0x41'),_0x72c875[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1b47a4,null))[_0xbe14('0xc')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x42')]=function(_0x32df3c,_0x285b6e){return respondWithRpcPromise(_0xbe14('0x41'),_0x32df3c[_0xbe14('0x17')],routingClient)['then'](findById(_0x32df3c['params']['id']))['then'](respondWithResult(_0x285b6e,null))[_0xbe14('0xc')](handleError(_0x285b6e,null));};exports[_0xbe14('0x43')]=function(_0x2f4e52,_0xf79b21){return respondWithRpcPromise(_0xbe14('0x44'),_0x2f4e52[_0xbe14('0x17')],mailClient)[_0xbe14('0x8')](respondWithResult(_0xf79b21,null))[_0xbe14('0xc')](handleError(_0xf79b21,null));};exports[_0xbe14('0x45')]=function(_0x451b0b,_0x603816){return respondWithRpcPromise(_0xbe14('0x46'),_0x451b0b[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x603816,null))[_0xbe14('0xc')](handleError(_0x603816,null));};exports[_0xbe14('0x47')]=function(_0x179077,_0x2225d9){return respondWithRpcPromise(_0xbe14('0x46'),_0x179077[_0xbe14('0x17')],routingClient)['then'](findById(_0x179077[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x2225d9,null))[_0xbe14('0xc')](handleError(_0x2225d9,null));};exports[_0xbe14('0x48')]=function(_0x3ee6b7,_0x222944){return respondWithRpcPromise(_0xbe14('0x49'),_0x3ee6b7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x222944,null))[_0xbe14('0xc')](handleError(_0x222944,null));};exports['showSmsQueues']=function(_0x18be56,_0x442ec4){return respondWithRpcPromise(_0xbe14('0x49'),_0x18be56[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x18be56['params']['id']))[_0xbe14('0x8')](respondWithResult(_0x442ec4,null))[_0xbe14('0xc')](handleError(_0x442ec4,null));};exports[_0xbe14('0x4a')]=function(_0xd4e1c7,_0x46ac9c){return respondWithRpcPromise('WhatsappQueues',_0xd4e1c7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x46ac9c,null))[_0xbe14('0xc')](handleError(_0x46ac9c,null));};exports[_0xbe14('0x4b')]=function(_0xaebce8,_0x289c4d){return respondWithRpcPromise(_0xbe14('0x4c'),_0xaebce8[_0xbe14('0x17')],routingClient)['then'](findById(_0xaebce8[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x289c4d,null))[_0xbe14('0xc')](handleError(_0x289c4d,null));};exports[_0xbe14('0x4d')]=function(_0x5982b7,_0xa4b2a3){return respondWithRpcPromise(_0xbe14('0x4e'),_0x5982b7['query'],routingClient)['then'](respondWithResult(_0xa4b2a3,null))[_0xbe14('0xc')](handleError(_0xa4b2a3,null));};exports[_0xbe14('0x4f')]=function(_0x2d2643,_0x2510a0){return respondWithRpcPromise(_0xbe14('0x4e'),_0x2d2643[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x2d2643[_0xbe14('0x1b')]['id']))['then'](respondWithResult(_0x2510a0,null))['catch'](handleError(_0x2510a0,null));};exports[_0xbe14('0x50')]=function(_0x1c18b6,_0x29aa52){return respondWithRpcPromise('FaxAccounts',_0x1c18b6[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x29aa52,null))[_0xbe14('0xc')](handleError(_0x29aa52,null));};exports[_0xbe14('0x51')]=function(_0x468e9f,_0x1ef09b){return respondWithRpcPromise(_0xbe14('0x52'),_0x468e9f['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1ef09b,null))[_0xbe14('0xc')](handleError(_0x1ef09b,null));};exports[_0xbe14('0x53')]=function(_0x3afc5a,_0x469555){return respondWithRpcPromise(_0xbe14('0x54'),_0x3afc5a[_0xbe14('0x17')],routingClient)['then'](respondWithResult(_0x469555,null))[_0xbe14('0xc')](handleError(_0x469555,null));};exports[_0xbe14('0x55')]=function(_0x3cd17e,_0x1c0932){return respondWithRpcPromise(_0xbe14('0x56'),_0x3cd17e[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1c0932,null))[_0xbe14('0xc')](handleError(_0x1c0932,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x1e5ce1,_0x401968){return respondWithRpcPromise(_0xbe14('0x56'),_0x1e5ce1[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](function(_0x17576b){if(_0x1e5ce1['query'][_0xbe14('0x57')]!==undefined){var _0x175213=_(_0x17576b[_0xbe14('0x13')])[_0xbe14('0x58')]([_0x1e5ce1['query'][_0xbe14('0x57')],_0x1e5ce1[_0xbe14('0x1b')]['id']])[_0xbe14('0x59')](_0xbe14('0x5a'))[_0xbe14('0x5b')]()[_0xbe14('0x5c')]();return _0x17576b[_0xbe14('0x13')]['filter'](function(_0x70ed08){return _0x175213['indexOf'](_0x70ed08[_0xbe14('0x5a')])>-0x1;});}else{return _0x17576b['rows'][_0xbe14('0x58')](function(_0x21837c){return _0x21837c[_0xbe14('0x5a')]===parseInt(_0x1e5ce1['params']['id']);});}})[_0xbe14('0x8')](respondWithResult(_0x401968,null))[_0xbe14('0xc')](handleError(_0x401968,null));};exports[_0xbe14('0x5d')]=function(_0x546f22,_0x41a896){return respondWithRpcPromise(_0xbe14('0x5e'),_0x546f22[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x41a896,null))['catch'](handleError(_0x41a896,null));};exports[_0xbe14('0x5f')]=function(_0x39bc54,_0x34f90b){return respondWithRpcPromise(_0xbe14('0x60'),_0x39bc54[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x34f90b,null))[_0xbe14('0xc')](handleError(_0x34f90b,null));};exports['faxQueuesWaitingInteractions']=function(_0x2ff94c,_0x123f4f){return respondWithRpcPromise(_0xbe14('0x61'),_0x2ff94c['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x123f4f,null))[_0xbe14('0xc')](handleError(_0x123f4f,null));};exports[_0xbe14('0x62')]=function(_0x5bc52b){return function(_0xa53262,_0x1205d1){var _0x47d7bb,_0x2be969;var _0x49990b=_[_0xbe14('0x63')](_0x5bc52b);var _0x337073=_0x5bc52b==='chat'?'Website':_0xbe14('0x64');return db[_0x49990b+_0xbe14('0x65')][_0xbe14('0x66')]({'raw':!![],'where':{'id':_0xa53262['params']['id']}})[_0xbe14('0x8')](function(_0x30c03b){if(_[_0xbe14('0x12')](_0x30c03b)){throw new Error(_0x49990b+_0xbe14('0x67'));}_0x47d7bb=_0x30c03b;return db[_0x49990b+'Message']['findOne']({'where':{'id':_0xa53262[_0xbe14('0x20')][_0xbe14('0x68')]},'include':[{'model':db[_0x49990b+_0xbe14('0x69')],'as':_0xbe14('0x69')},{'model':db[_0x49990b+_0x337073],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x139aab){if(_['isNil'](_0x139aab)){throw new Error(_0x49990b+_0xbe14('0x6a'));}_0x2be969=_0x139aab;return _0x139aab['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x3a01bb={'uniqueid':_0x5bc52b+'.'+_0x2be969['id']+'.'+_0x2be969[_0xbe14('0x69')]['id'],'FromUserId':_0xa53262[_0xbe14('0x2f')]['id'],'type':'queue'};_0x3a01bb[_0x49990b+_0xbe14('0x6b')]=_0x2be969['id'];_0x3a01bb[_0x49990b+_0xbe14('0x6c')]=_0x2be969[_0xbe14('0x69')]['id'];_0x3a01bb['From'+_0x49990b+_0x337073+'Id']=_0x2be969[_0xbe14('0x64')]['id'];_0x3a01bb['To'+_0x49990b+_0xbe14('0x6d')]=_0x47d7bb['id'];return db[_0x49990b+_0xbe14('0x6e')][_0xbe14('0x6f')](_0x3a01bb);})[_0xbe14('0x8')](function(){return respondWithRpcPromise(_0xbe14('0x70'),{'channel':_0x5bc52b,'interaction':_0x2be969[_0xbe14('0x69')],'message':_0x2be969,'account':_0x2be969[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbe14('0x71'),'appdata':_0x47d7bb[_0xbe14('0x10')]+','+(_0x2be969[_0xbe14('0x64')][_0xbe14('0x72')]||0x12c),'interval':_0xbe14('0x73')}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x1205d1,null))[_0xbe14('0xc')](handleError(_0x1205d1,null));};};exports[_0xbe14('0x74')]=function(_0x1de70d,_0x30be9e){var _0x1679bd,_0x2ca6e6;if(_['isNil'](_0x1de70d[_0xbe14('0x20')]['channel'])){throw new Error(_0xbe14('0x75'));}var _0x1b8733=_0x1de70d[_0xbe14('0x20')][_0xbe14('0x76')];var _0x1d7b08=_['capitalize'](_0x1b8733);var _0x5868d7=_0x1b8733===_0xbe14('0x77')?_0xbe14('0x78'):_0xbe14('0x64');return db[_0xbe14('0x79')]['findOne']({'raw':!![],'where':{'id':_0x1de70d[_0xbe14('0x1b')]['id'],'role':_0xbe14('0x7a')}})['then'](function(_0x186225){if(_[_0xbe14('0x12')](_0x186225)){throw new Error(_0xbe14('0x7b'));}_0x1679bd=_0x186225;return db[_0x1d7b08+_0xbe14('0x7c')]['findOne']({'where':{'id':_0x1de70d[_0xbe14('0x20')]['messageId']},'include':[{'model':db[_0x1d7b08+'Interaction'],'as':_0xbe14('0x69')},{'model':db[_0x1d7b08+_0x5868d7],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x3d890b){if(_[_0xbe14('0x12')](_0x3d890b)){throw new Error(_0x1d7b08+'\x20Message\x20not\x20found');}_0x2ca6e6=_0x3d890b;return _0x3d890b[_0xbe14('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x5dc793={'uniqueid':_0x1b8733+'.'+_0x2ca6e6['id']+'.'+_0x2ca6e6['Interaction']['id'],'FromUserId':_0x1de70d[_0xbe14('0x2f')]['id'],'type':_0xbe14('0x71'),'ToUserId':_0x1679bd['id']};_0x5dc793[_0x1d7b08+'MessageId']=_0x2ca6e6['id'];_0x5dc793[_0x1d7b08+_0xbe14('0x6c')]=_0x2ca6e6['Interaction']['id'];_0x5dc793[_0xbe14('0x7e')+_0x1d7b08+_0x5868d7+'Id']=_0x2ca6e6['Account']['id'];return db[_0x1d7b08+_0xbe14('0x6e')]['create'](_0x5dc793);})[_0xbe14('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1b8733,'interaction':_0x2ca6e6[_0xbe14('0x69')],'message':_0x2ca6e6,'account':_0x2ca6e6[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1679bd['name']+','+(_0x2ca6e6[_0xbe14('0x64')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x30be9e,null))[_0xbe14('0xc')](handleError(_0x30be9e,null));}; \ No newline at end of file +var _0xee14=['telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','channel','Website','User','agent','Agent\x20not\x20found','\x20Message\x20not\x20found','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','user','interaction','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','INTERACTION','SIP/%s','AgentCapacity'];(function(_0x299e7a,_0x1122d1){var _0x4dd909=function(_0x5a27af){while(--_0x5a27af){_0x299e7a['push'](_0x299e7a['shift']());}};_0x4dd909(++_0x1122d1);}(_0xee14,0x13a));var _0x4ee1=function(_0x5e85b5,_0x201b4b){_0x5e85b5=_0x5e85b5-0x0;var _0x252f45=_0xee14[_0x5e85b5];return _0x252f45;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x4ee1('0x0'));var util=require(_0x4ee1('0x1'));var db=require(_0x4ee1('0x2'))['db'];var logger=require(_0x4ee1('0x3'))(_0x4ee1('0x4'));var jayson=require(_0x4ee1('0x5'));var amiClient=jayson[_0x4ee1('0x6')][_0x4ee1('0x7')]({'port':0x232a});var mailClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){var _0x1fd8c8=_0x187656?_0x187656:amiClient;return _0x1fd8c8['request'](_0x327c18,_0x3a45a3)[_0x4ee1('0x8')](function(_0x38be25){if(_0x38be25['error']){if(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xa')]===0x1f4){return _0xdfe9c1(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xb')]);}return _0x293d5f(_0x38be25['error'][_0x4ee1('0xb')]);}else{_0x293d5f(_0x38be25[_0x4ee1('0xc')]);}})[_0x4ee1('0xd')](function(_0x2d5d3c){_0xdfe9c1(_0x2d5d3c);});});}function respondWithResult(_0x2f864e,_0x174427){_0x174427=_0x174427||0xc8;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0xe')](_0x174427)[_0x4ee1('0xf')](_0x5616d6);}return _0x2f864e[_0x4ee1('0x10')](0x194);};}function handleError(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0x1f4;return function(_0x1c342a){logger[_0x4ee1('0x9')](_0x1c342a[_0x4ee1('0x11')]);if(_0x1c342a[_0x4ee1('0x12')]){delete _0x1c342a['name'];}_0x24a915[_0x4ee1('0xe')](_0x46d2c2)[_0x4ee1('0x13')](_0x1c342a);};}function findById(_0x34651b){return function(_0x1b1e0e){if(!_[_0x4ee1('0x14')](_0x34651b)&&!_[_0x4ee1('0x14')](_0x1b1e0e)&&!_[_0x4ee1('0x14')](_0x1b1e0e[_0x4ee1('0x15')])){return _[_0x4ee1('0x16')](_0x1b1e0e[_0x4ee1('0x15')],function(_0x274de5){return _0x274de5['id']==_0x34651b;});}return null;};}exports['voiceChannels']=function(_0x236215,_0x3db827){return respondWithRpcPromise(_0x4ee1('0x17'),_0x236215[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3db827,null))[_0x4ee1('0xd')](handleError(_0x3db827,null));};exports['voiceChannelMixMonitor']=function(_0x8a631f,_0x333e96){return respondWithRpcPromise(_0x4ee1('0x19'),_[_0x4ee1('0x1a')](_0x8a631f[_0x4ee1('0x18')],_0x8a631f[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x333e96,null))[_0x4ee1('0xd')](handleError(_0x333e96,null));};exports[_0x4ee1('0x1c')]=function(_0x3e5038,_0x4faaf6){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x4ee1('0x1a')](_0x3e5038[_0x4ee1('0x18')],_0x3e5038[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x4faaf6,null))[_0x4ee1('0xd')](handleError(_0x4faaf6,null));};exports[_0x4ee1('0x1d')]=function(_0x57d45d,_0x5cc0b5){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x57d45d[_0x4ee1('0x18')])['then'](respondWithResult(_0x5cc0b5,null))[_0x4ee1('0xd')](handleError(_0x5cc0b5,null));};exports[_0x4ee1('0x1f')]=function(_0x36654c,_0x215949){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x36654c[_0x4ee1('0x18')])[_0x4ee1('0x8')](findById(_0x36654c['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x215949,null))['catch'](handleError(_0x215949,null));};exports[_0x4ee1('0x20')]=function(_0x4ec408,_0x3dc870){return respondWithRpcPromise(_0x4ee1('0x21'),_[_0x4ee1('0x1a')](_0x4ec408[_0x4ee1('0x22')],_0x4ec408[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x3dc870,null))[_0x4ee1('0xd')](handleError(_0x3dc870,null));};exports['voiceQueuesPreview']=function(_0x121301,_0x3d5e6c){return respondWithRpcPromise(_0x4ee1('0x23'),_[_0x4ee1('0x1a')](_0x121301[_0x4ee1('0x18')],_0x121301['params']))[_0x4ee1('0x8')](respondWithResult(_0x3d5e6c,null))[_0x4ee1('0xd')](handleError(_0x3d5e6c,null));};exports[_0x4ee1('0x24')]=function(_0x2e37a3,_0x79f87c){return respondWithRpcPromise(_0x4ee1('0x25'),_0x2e37a3['query'])['then'](respondWithResult(_0x79f87c,null))[_0x4ee1('0xd')](handleError(_0x79f87c,null));};exports[_0x4ee1('0x26')]=function(_0x41ab60,_0x5a2f6f){return respondWithRpcPromise(_0x4ee1('0x27'),_[_0x4ee1('0x1a')](_0x41ab60[_0x4ee1('0x18')],_0x41ab60[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x5a2f6f,null))[_0x4ee1('0xd')](handleError(_0x5a2f6f,null));};exports[_0x4ee1('0x28')]=function(_0x199e11,_0x36898c){return respondWithRpcPromise(_0x4ee1('0x29'),_[_0x4ee1('0x1a')](_0x199e11[_0x4ee1('0x18')],_0x199e11[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x36898c,null))[_0x4ee1('0xd')](handleError(_0x36898c,null));};exports[_0x4ee1('0x2a')]=function(_0x882468,_0x50539f){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ee1('0x1a')](_0x882468[_0x4ee1('0x18')],_0x882468[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x50539f,null))['catch'](handleError(_0x50539f,null));};exports[_0x4ee1('0x2b')]=function(_0x2ed16f,_0x11721a){return respondWithRpcPromise(_0x4ee1('0x2c'),_0x2ed16f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x11721a,null))[_0x4ee1('0xd')](handleError(_0x11721a,null));};exports[_0x4ee1('0x2d')]=function(_0x59b5cc,_0x3b346e){return respondWithRpcPromise(_0x4ee1('0x2e'),_0x59b5cc[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3b346e,null))[_0x4ee1('0xd')](handleError(_0x3b346e,null));};exports[_0x4ee1('0x2f')]=function(_0x543b2e,_0x3e2ca7){var _0x37176a;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')])[_0x4ee1('0x8')](function(_0x352dc5){_0x37176a=_0x352dc5;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')],routingClient);})[_0x4ee1('0x8')](function(_0x29493d){return _[_0x4ee1('0x1a')]({},_0x29493d,_0x37176a);})[_0x4ee1('0x8')](respondWithResult(_0x3e2ca7,null))[_0x4ee1('0xd')](handleError(_0x3e2ca7,null));};exports['agentCapacity']=function(_0x3b3bed,_0x40a3e3){if(_0x3b3bed['body']&&_0x3b3bed[_0x4ee1('0x22')]['interaction']&&_0x3b3bed[_0x4ee1('0x31')]&&_0x3b3bed['user'][_0x4ee1('0x12')]){for(var _0xc7580c in _0x3b3bed['body'][_0x4ee1('0x32')]){if(_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0x4ee1('0x33')](_0xc7580c)){db['MemberReport'][_0x4ee1('0x34')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3b3bed['body'][_0x4ee1('0x32')][_0xc7580c]&&_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')]?{'$notIn':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c]}:{'$ne':null}}})['then'](function(_0xaa71d5){var _0x266add=moment()[_0x4ee1('0x36')](_0x4ee1('0x37'));for(var _0x5c5862=0x0,_0x3d6bf4=_0xaa71d5[_0x4ee1('0x35')];_0x5c5862<_0x3d6bf4;_0x5c5862+=0x1){_0xaa71d5[_0x5c5862]['updateAttributes']({'exitAt':_0x266add});}});for(var _0x21ebb8=0x0;_0x21ebb8<_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')];_0x21ebb8+=0x1){db[_0x4ee1('0x38')][_0x4ee1('0x39')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':_0x4ee1('0x3a'),'uniqueid':_0x3b3bed['body']['interaction'][_0xc7580c][_0x21ebb8],'exitAt':null},'defaults':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'interface':_[_0x4ee1('0x14')](_0x3b3bed[_0x4ee1('0x31')]['interface'])?util[_0x4ee1('0x36')](_0x4ee1('0x3b'),_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')]):_0x3b3bed[_0x4ee1('0x31')]['interface'],'type':_0x4ee1('0x3a'),'enterAt':moment()[_0x4ee1('0x36')](_0x4ee1('0x37')),'role':'agent','internal':_0x3b3bed[_0x4ee1('0x31')]['internal'],'uniqueid':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c][_0x21ebb8]}});}}}}return respondWithRpcPromise(_0x4ee1('0x3c'),{'id':_0x3b3bed['params']['id'],'capacity':_0x3b3bed[_0x4ee1('0x22')]['capacity']},routingClient)[_0x4ee1('0x8')](respondWithResult(_0x40a3e3,null))[_0x4ee1('0xd')](handleError(_0x40a3e3,null));};exports[_0x4ee1('0x3d')]=function(_0x5f4f78,_0x3368ed){return respondWithRpcPromise(_0x4ee1('0x3e'),_0x5f4f78[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3368ed,null))[_0x4ee1('0xd')](handleError(_0x3368ed,null));};exports[_0x4ee1('0x3f')]=function(_0x3f1c32,_0x517729){return respondWithRpcPromise('Trunks',_0x3f1c32[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x517729,null))[_0x4ee1('0xd')](handleError(_0x517729,null));};exports[_0x4ee1('0x40')]=function(_0x44e65f,_0x31e82d){return respondWithRpcPromise(_0x4ee1('0x41'),_0x44e65f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x31e82d,null))[_0x4ee1('0xd')](handleError(_0x31e82d,null));};exports[_0x4ee1('0x42')]=function(_0x2453ac,_0x3c2e42){return respondWithRpcPromise('ChatQueues',_0x2453ac[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x3c2e42,null))[_0x4ee1('0xd')](handleError(_0x3c2e42,null));};exports[_0x4ee1('0x43')]=function(_0x59bbca,_0x1e0aac){return respondWithRpcPromise(_0x4ee1('0x44'),_0x59bbca['query'],routingClient)['then'](findById(_0x59bbca[_0x4ee1('0x1b')]['id']))['then'](respondWithResult(_0x1e0aac,null))[_0x4ee1('0xd')](handleError(_0x1e0aac,null));};exports[_0x4ee1('0x45')]=function(_0x59ba70,_0x43489c){return respondWithRpcPromise(_0x4ee1('0x46'),_0x59ba70[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x43489c,null))[_0x4ee1('0xd')](handleError(_0x43489c,null));};exports[_0x4ee1('0x47')]=function(_0x11f619,_0x5f5694){return respondWithRpcPromise('MailQueues',_0x11f619[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x11f619['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x5f5694,null))[_0x4ee1('0xd')](handleError(_0x5f5694,null));};exports[_0x4ee1('0x48')]=function(_0x51e341,_0x1ad933){return respondWithRpcPromise('MailAccounts',_0x51e341[_0x4ee1('0x18')],mailClient)['then'](respondWithResult(_0x1ad933,null))['catch'](handleError(_0x1ad933,null));};exports[_0x4ee1('0x49')]=function(_0x16fcd0,_0x290451){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x16fcd0[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x290451,null))[_0x4ee1('0xd')](handleError(_0x290451,null));};exports[_0x4ee1('0x4b')]=function(_0x10f4e,_0x58eb1d){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x10f4e[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x10f4e[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x58eb1d,null))[_0x4ee1('0xd')](handleError(_0x58eb1d,null));};exports[_0x4ee1('0x4c')]=function(_0x20ca0b,_0x19fa31){return respondWithRpcPromise(_0x4ee1('0x4d'),_0x20ca0b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x19fa31,null))['catch'](handleError(_0x19fa31,null));};exports[_0x4ee1('0x4e')]=function(_0x5bf5e9,_0x25cfc3){return respondWithRpcPromise('SmsQueues',_0x5bf5e9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x5bf5e9[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x25cfc3,null))[_0x4ee1('0xd')](handleError(_0x25cfc3,null));};exports[_0x4ee1('0x4f')]=function(_0x342aa1,_0x447060){return respondWithRpcPromise(_0x4ee1('0x50'),_0x342aa1[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x447060,null))[_0x4ee1('0xd')](handleError(_0x447060,null));};exports['showWhatsappQueues']=function(_0x759888,_0x24308c){return respondWithRpcPromise(_0x4ee1('0x50'),_0x759888['query'],routingClient)['then'](findById(_0x759888[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x24308c,null))['catch'](handleError(_0x24308c,null));};exports[_0x4ee1('0x51')]=function(_0x431dfa,_0x3f8f94){return respondWithRpcPromise(_0x4ee1('0x52'),_0x431dfa[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x3f8f94,null))[_0x4ee1('0xd')](handleError(_0x3f8f94,null));};exports[_0x4ee1('0x53')]=function(_0x28e11c,_0x3824bf){return respondWithRpcPromise('FaxQueues',_0x28e11c[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x28e11c['params']['id']))['then'](respondWithResult(_0x3824bf,null))[_0x4ee1('0xd')](handleError(_0x3824bf,null));};exports[_0x4ee1('0x54')]=function(_0x19e095,_0x38e06){return respondWithRpcPromise(_0x4ee1('0x55'),_0x19e095[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x38e06,null))['catch'](handleError(_0x38e06,null));};exports[_0x4ee1('0x56')]=function(_0x39583b,_0x44af66){return respondWithRpcPromise(_0x4ee1('0x57'),_0x39583b[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x44af66,null))[_0x4ee1('0xd')](handleError(_0x44af66,null));};exports['mailQueuesWaitingInteractions']=function(_0x1d360f,_0x29371c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1d360f['query'],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x29371c,null))[_0x4ee1('0xd')](handleError(_0x29371c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2beb82,_0x5aacf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2beb82[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x5aacf1,null))[_0x4ee1('0xd')](handleError(_0x5aacf1,null));};exports[_0x4ee1('0x58')]=function(_0x37fa42,_0x38698a){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37fa42[_0x4ee1('0x18')],routingClient)['then'](function(_0x57f66c){if(_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')]!==undefined){var _0x411c99=_(_0x57f66c[_0x4ee1('0x15')])[_0x4ee1('0x5a')]([_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')],_0x37fa42[_0x4ee1('0x1b')]['id']])['map'](_0x4ee1('0x5b'))[_0x4ee1('0x5c')]()['value']();return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0xcd0dd9){return _0x411c99[_0x4ee1('0x5d')](_0xcd0dd9[_0x4ee1('0x5b')])>-0x1;});}else{return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0x4dee3a){return _0x4dee3a[_0x4ee1('0x5b')]===parseInt(_0x37fa42['params']['id']);});}})[_0x4ee1('0x8')](respondWithResult(_0x38698a,null))[_0x4ee1('0xd')](handleError(_0x38698a,null));};exports[_0x4ee1('0x5e')]=function(_0x35a719,_0x48c51c){return respondWithRpcPromise(_0x4ee1('0x5f'),_0x35a719[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x48c51c,null))['catch'](handleError(_0x48c51c,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2ef7c9,_0x4b4ad5){return respondWithRpcPromise(_0x4ee1('0x60'),_0x2ef7c9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x4b4ad5,null))['catch'](handleError(_0x4b4ad5,null));};exports['faxQueuesWaitingInteractions']=function(_0x27fd3b,_0x1e2360){return respondWithRpcPromise(_0x4ee1('0x61'),_0x27fd3b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x1e2360,null))[_0x4ee1('0xd')](handleError(_0x1e2360,null));};exports[_0x4ee1('0x62')]=function(_0x5727ef){return function(_0x4a3201,_0x50645b){var _0x3fba19,_0x3a75a7;var _0x33f5af=_[_0x4ee1('0x63')](_0x5727ef);var _0x4db801=_0x5727ef===_0x4ee1('0x64')?'Website':_0x4ee1('0x65');return db[_0x33f5af+_0x4ee1('0x66')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x4a3201[_0x4ee1('0x1b')]['id']}})[_0x4ee1('0x8')](function(_0x190f59){if(_['isNil'](_0x190f59)){throw new Error(_0x33f5af+_0x4ee1('0x68'));}_0x3fba19=_0x190f59;return db[_0x33f5af+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x4a3201[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0x33f5af+_0x4ee1('0x6b')],'as':_0x4ee1('0x6b')},{'model':db[_0x33f5af+_0x4db801],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x207758){if(_[_0x4ee1('0x14')](_0x207758)){throw new Error(_0x33f5af+'\x20Message\x20not\x20found');}_0x3a75a7=_0x207758;return _0x207758[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x646878={'uniqueid':_0x5727ef+'.'+_0x3a75a7['id']+'.'+_0x3a75a7[_0x4ee1('0x6b')]['id'],'FromUserId':_0x4a3201[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d')};_0x646878[_0x33f5af+_0x4ee1('0x6e')]=_0x3a75a7['id'];_0x646878[_0x33f5af+_0x4ee1('0x6f')]=_0x3a75a7[_0x4ee1('0x6b')]['id'];_0x646878[_0x4ee1('0x70')+_0x33f5af+_0x4db801+'Id']=_0x3a75a7[_0x4ee1('0x65')]['id'];_0x646878['To'+_0x33f5af+_0x4ee1('0x71')]=_0x3fba19['id'];return db[_0x33f5af+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x646878);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x5727ef,'interaction':_0x3a75a7['Interaction'],'message':_0x3a75a7,'account':_0x3a75a7[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x6d'),'appdata':_0x3fba19['name']+','+(_0x3a75a7[_0x4ee1('0x65')][_0x4ee1('0x75')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x50645b,null))[_0x4ee1('0xd')](handleError(_0x50645b,null));};};exports['agentNotify']=function(_0x13a755,_0x1a00a4){var _0x47b854,_0x1700c6;if(_[_0x4ee1('0x14')](_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x2bc05a=_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')];var _0xc07f75=_[_0x4ee1('0x63')](_0x2bc05a);var _0x4315e9=_0x2bc05a===_0x4ee1('0x64')?_0x4ee1('0x77'):'Account';return db[_0x4ee1('0x78')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x13a755['params']['id'],'role':_0x4ee1('0x79')}})['then'](function(_0x5cf7fb){if(_[_0x4ee1('0x14')](_0x5cf7fb)){throw new Error(_0x4ee1('0x7a'));}_0x47b854=_0x5cf7fb;return db[_0xc07f75+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0xc07f75+'Interaction'],'as':_0x4ee1('0x6b')},{'model':db[_0xc07f75+_0x4315e9],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x17ae2d){if(_[_0x4ee1('0x14')](_0x17ae2d)){throw new Error(_0xc07f75+_0x4ee1('0x7b'));}_0x1700c6=_0x17ae2d;return _0x17ae2d[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x5076c6={'uniqueid':_0x2bc05a+'.'+_0x1700c6['id']+'.'+_0x1700c6[_0x4ee1('0x6b')]['id'],'FromUserId':_0x13a755[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d'),'ToUserId':_0x47b854['id']};_0x5076c6[_0xc07f75+_0x4ee1('0x6e')]=_0x1700c6['id'];_0x5076c6[_0xc07f75+_0x4ee1('0x6f')]=_0x1700c6['Interaction']['id'];_0x5076c6[_0x4ee1('0x70')+_0xc07f75+_0x4315e9+'Id']=_0x1700c6['Account']['id'];return db[_0xc07f75+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x5076c6);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x2bc05a,'interaction':_0x1700c6['Interaction'],'message':_0x1700c6,'account':_0x1700c6[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x79'),'appdata':_0x47b854['name']+','+(_0x1700c6[_0x4ee1('0x65')]['agentTransferTimeout']||0x12c),'interval':_0x4ee1('0x7c')}]},routingClient);})[_0x4ee1('0x8')](respondWithResult(_0x1a00a4,null))['catch'](handleError(_0x1a00a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ef59b93..6c9e9ef 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 _0x86e4=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','create','put','delete','destroy','exports','multer'];(function(_0x1634d3,_0x565400){var _0x3c21b5=function(_0xecc7f6){while(--_0xecc7f6){_0x1634d3['push'](_0x1634d3['shift']());}};_0x3c21b5(++_0x565400);}(_0x86e4,0xe6));var _0x486e=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x86e4[_0x671369];return _0x33f2b4;};'use strict';var multer=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var path=require(_0x486e('0x2'));var timeout=require(_0x486e('0x3'));var express=require(_0x486e('0x4'));var router=express['Router']();var fs_extra=require(_0x486e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x486e('0x6'));var config=require(_0x486e('0x7'));var controller=require(_0x486e('0x8'));router[_0x486e('0x9')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0xb')]);router[_0x486e('0x9')](_0x486e('0xc'),auth['isAuthenticated'](),controller[_0x486e('0xd')]);router[_0x486e('0x9')](_0x486e('0xe'),auth[_0x486e('0xa')](),controller['run']);router[_0x486e('0xf')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0x10')]);router[_0x486e('0x11')](_0x486e('0xc'),auth[_0x486e('0xa')](),controller['update']);router[_0x486e('0x12')](_0x486e('0xc'),auth[_0x486e('0xa')](),controller[_0x486e('0x13')]);module[_0x486e('0x14')]=router; \ No newline at end of file +var _0xe74a=['create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','show','/:id/run','run','post'];(function(_0x2cf734,_0x3c4bf3){var _0x43775b=function(_0x292d42){while(--_0x292d42){_0x2cf734['push'](_0x2cf734['shift']());}};_0x43775b(++_0x3c4bf3);}(_0xe74a,0xb6));var _0xae74=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xe74a[_0x34bc6c];return _0x168820;};'use strict';var multer=require(_0xae74('0x0'));var util=require('util');var path=require(_0xae74('0x1'));var timeout=require(_0xae74('0x2'));var express=require(_0xae74('0x3'));var router=express[_0xae74('0x4')]();var fs_extra=require(_0xae74('0x5'));var auth=require(_0xae74('0x6'));var interaction=require(_0xae74('0x7'));var config=require('../../config/environment');var controller=require(_0xae74('0x8'));router[_0xae74('0x9')]('/',auth[_0xae74('0xa')](),controller[_0xae74('0xb')]);router[_0xae74('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xae74('0xc')]);router['get'](_0xae74('0xd'),auth[_0xae74('0xa')](),controller[_0xae74('0xe')]);router[_0xae74('0xf')]('/',auth[_0xae74('0xa')](),controller[_0xae74('0x10')]);router[_0xae74('0x11')](_0xae74('0x12'),auth[_0xae74('0xa')](),controller[_0xae74('0x13')]);router['delete'](_0xae74('0x12'),auth['isAuthenticated'](),controller[_0xae74('0x14')]);module[_0xae74('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 49cb62f..e485a22 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 _0x99f0=['xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks','hours','minutes','days','csv','pdf'];(function(_0x383368,_0xb2bbe){var _0x2762ca=function(_0x1ef4df){while(--_0x1ef4df){_0x383368['push'](_0x383368['shift']());}};_0x2762ca(++_0xb2bbe);}(_0x99f0,0x100));var _0x099f=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x99f0[_0x3cfb0d];return _0x3486b4;};'use strict';var Sequelize=require('sequelize');module[_0x099f('0x0')]={'name':{'type':Sequelize[_0x099f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x099f('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x099f('0x3')},'startAt':{'type':Sequelize[_0x099f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x099f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x099f('0x5')]('years',_0x099f('0x6'),_0x099f('0x7'),_0x099f('0x8'),'days',_0x099f('0x9'),_0x099f('0xa')),'allowNull':![],'defaultValue':_0x099f('0xb')},'output':{'type':Sequelize[_0x099f('0x5')](_0x099f('0xc'),_0x099f('0xd'),_0x099f('0xe')),'allowNull':![],'defaultValue':_0x099f('0xc')},'type':{'type':Sequelize[_0x099f('0x5')](_0x099f('0xf'),_0x099f('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x099f('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x099f('0x1')]},'cc':{'type':Sequelize[_0x099f('0x11')]},'bcc':{'type':Sequelize[_0x099f('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe1a0=['months','weeks','hours','minutes','days','csv','pdf','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters'];(function(_0x44e6e7,_0x170df1){var _0x32cd37=function(_0x3812c4){while(--_0x3812c4){_0x44e6e7['push'](_0x44e6e7['shift']());}};_0x32cd37(++_0x170df1);}(_0xe1a0,0x195));var _0x0e1a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe1a0[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x0e1a('0x0'));module[_0x0e1a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0e1a('0x2')]},'active':{'type':Sequelize[_0x0e1a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0e1a('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x0e1a('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0e1a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0e1a('0x6')](_0x0e1a('0x7'),_0x0e1a('0x8'),_0x0e1a('0x9'),_0x0e1a('0xa'),'days',_0x0e1a('0xb'),_0x0e1a('0xc')),'allowNull':![],'defaultValue':_0x0e1a('0xd')},'output':{'type':Sequelize[_0x0e1a('0x6')](_0x0e1a('0xe'),_0x0e1a('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0x0e1a('0xe')},'type':{'type':Sequelize[_0x0e1a('0x6')](_0x0e1a('0x10'),'default'),'allowNull':![],'defaultValue':_0x0e1a('0x10')},'sendMail':{'type':Sequelize[_0x0e1a('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x0e1a('0x2')]},'cc':{'type':Sequelize[_0x0e1a('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x0e1a('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index a35f8d3..6d8bb96 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 _0xdc08=['show','includeAll','create','body','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','send','index','map','Schedule','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','include','findAll','rows','catch'];(function(_0x42f840,_0x1aa32e){var _0x47539f=function(_0x390a4b){while(--_0x390a4b){_0x42f840['push'](_0x42f840['shift']());}};_0x47539f(++_0x1aa32e);}(_0xdc08,0x159));var _0x8dc0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xdc08[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dc0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8dc0('0x1'));var rp=require(_0x8dc0('0x2'));var moment=require(_0x8dc0('0x3'));var BPromise=require(_0x8dc0('0x4'));var Mustache=require(_0x8dc0('0x5'));var util=require(_0x8dc0('0x6'));var path=require(_0x8dc0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8dc0('0x8'));var fs=require('fs');var fs_extra=require(_0x8dc0('0x9'));var _=require(_0x8dc0('0xa'));var squel=require(_0x8dc0('0xb'));var crypto=require('crypto');var jsforce=require(_0x8dc0('0xc'));var deskjs=require(_0x8dc0('0xd'));var toCsv=require(_0x8dc0('0xe'));var querystring=require('querystring');var Papa=require(_0x8dc0('0xf'));var Redis=require('ioredis');var authService=require(_0x8dc0('0x10'));var qs=require(_0x8dc0('0x11'));var as=require(_0x8dc0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8dc0('0x13'));var utils=require(_0x8dc0('0x14'));var config=require(_0x8dc0('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226bd4,_0x1f999c){_0x1f999c=_0x1f999c||0xcc;return function(_0x57aba1){if(_0x57aba1){return _0x226bd4[_0x8dc0('0x16')](_0x1f999c);}return _0x226bd4['status'](_0x1f999c)[_0x8dc0('0x17')]();};}function respondWithResult(_0x1acc47,_0x52abe9){_0x52abe9=_0x52abe9||0xc8;return function(_0x8f0f77){if(_0x8f0f77){return _0x1acc47[_0x8dc0('0x18')](_0x52abe9)[_0x8dc0('0x19')](_0x8f0f77);}};}function respondWithFilteredResult(_0x8a4ff3,_0x48af2b){return function(_0x42602b){if(_0x42602b){var _0x9cffe=typeof _0x48af2b[_0x8dc0('0x1a')]===_0x8dc0('0x1b')&&typeof _0x48af2b[_0x8dc0('0x1c')]==='undefined';var _0x1c104e=_0x42602b['count'];var _0x3ee914=_0x9cffe?0x0:_0x48af2b[_0x8dc0('0x1a')];var _0x59d3d9=_0x9cffe?_0x42602b[_0x8dc0('0x1d')]:_0x48af2b[_0x8dc0('0x1a')]+_0x48af2b[_0x8dc0('0x1c')];var _0x262553;if(_0x59d3d9>=_0x1c104e){_0x59d3d9=_0x1c104e;_0x262553=0xc8;}else{_0x262553=0xce;}_0x8a4ff3[_0x8dc0('0x18')](_0x262553);return _0x8a4ff3[_0x8dc0('0x1e')](_0x8dc0('0x1f'),_0x3ee914+'-'+_0x59d3d9+'/'+_0x1c104e)['json'](_0x42602b);}return null;};}function patchUpdates(_0x582bf7){return function(_0x5df8bd){try{jsonpatch['apply'](_0x5df8bd,_0x582bf7,!![]);}catch(_0x238f5b){return BPromise[_0x8dc0('0x20')](_0x238f5b);}return _0x5df8bd[_0x8dc0('0x21')]();};}function saveUpdates(_0x3ae4f3,_0x59dad2){return function(_0x42fdc0){if(_0x42fdc0){return _0x42fdc0[_0x8dc0('0x22')](_0x3ae4f3)[_0x8dc0('0x23')](function(_0x483048){return _0x483048;});}return null;};}function removeEntity(_0x5a925b,_0x5763ce){return function(_0x631083){if(_0x631083){return _0x631083[_0x8dc0('0x24')]()[_0x8dc0('0x23')](function(){var _0x1a4428=_0x631083[_0x8dc0('0x25')]({'plain':!![]});var _0x293cf0=_0x8dc0('0x26');return db[_0x8dc0('0x27')][_0x8dc0('0x24')]({'where':{'type':_0x293cf0,'resourceId':_0x1a4428['id']}})[_0x8dc0('0x23')](function(){return _0x631083;});})[_0x8dc0('0x23')](function(){_0x5a925b[_0x8dc0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c9431,_0x57fde5){return function(_0x444aed){if(!_0x444aed){_0x5c9431[_0x8dc0('0x16')](0x194);}return _0x444aed;};}function handleError(_0x678993,_0x10dc38){_0x10dc38=_0x10dc38||0x1f4;return function(_0x36d17f){logger[_0x8dc0('0x28')](_0x36d17f[_0x8dc0('0x29')]);if(_0x36d17f['name']){delete _0x36d17f['name'];}_0x678993['status'](_0x10dc38)[_0x8dc0('0x2a')](_0x36d17f);};}exports[_0x8dc0('0x2b')]=function(_0x3238cd,_0x1d0841){var _0x3c1d63={},_0x2fa90f={},_0x3c4cd5={'count':0x0,'rows':[]};var _0x3b616e=_[_0x8dc0('0x2c')](db[_0x8dc0('0x2d')][_0x8dc0('0x2e')],function(_0x588351){return{'name':_0x588351['fieldName'],'type':_0x588351[_0x8dc0('0x2f')][_0x8dc0('0x30')]};});_0x2fa90f[_0x8dc0('0x31')]=_[_0x8dc0('0x2c')](_0x3b616e,'name');_0x2fa90f['query']=_[_0x8dc0('0x32')](_0x3238cd['query']);_0x2fa90f[_0x8dc0('0x33')]=_[_0x8dc0('0x34')](_0x2fa90f[_0x8dc0('0x31')],_0x2fa90f[_0x8dc0('0x35')]);_0x3c1d63[_0x8dc0('0x36')]=_[_0x8dc0('0x34')](_0x2fa90f[_0x8dc0('0x31')],qs[_0x8dc0('0x37')](_0x3238cd[_0x8dc0('0x35')]['fields']));_0x3c1d63[_0x8dc0('0x36')]=_0x3c1d63[_0x8dc0('0x36')][_0x8dc0('0x38')]?_0x3c1d63[_0x8dc0('0x36')]:_0x2fa90f[_0x8dc0('0x31')];if(!_0x3238cd[_0x8dc0('0x35')]['hasOwnProperty'](_0x8dc0('0x39'))){_0x3c1d63['limit']=qs[_0x8dc0('0x1c')](_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x1c')]);_0x3c1d63[_0x8dc0('0x1a')]=qs[_0x8dc0('0x1a')](_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x1a')]);}_0x3c1d63[_0x8dc0('0x3a')]=qs['sort'](_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x3b')]);_0x3c1d63[_0x8dc0('0x3c')]=qs[_0x8dc0('0x33')](_['pick'](_0x3238cd['query'],_0x2fa90f[_0x8dc0('0x33')]),_0x3b616e);if(_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x3d')]){_0x3c1d63[_0x8dc0('0x3c')]=_[_0x8dc0('0x3e')](_0x3c1d63[_0x8dc0('0x3c')],{'$or':_['map'](_0x3b616e,function(_0x336a3d){if(_0x336a3d[_0x8dc0('0x2f')]!==_0x8dc0('0x3f')){var _0x3ae1b6={};_0x3ae1b6[_0x336a3d[_0x8dc0('0x40')]]={'$like':'%'+_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x3d')]+'%'};return _0x3ae1b6;}})});}_0x3c1d63=_[_0x8dc0('0x3e')]({},_0x3c1d63,_0x3238cd[_0x8dc0('0x41')]);var _0x2e1a9e={'where':_0x3c1d63[_0x8dc0('0x3c')]};return db[_0x8dc0('0x2d')]['count'](_0x2e1a9e)[_0x8dc0('0x23')](function(_0x45f8a8){_0x3c4cd5['count']=_0x45f8a8;if(_0x3238cd[_0x8dc0('0x35')]['includeAll']){_0x3c1d63[_0x8dc0('0x42')]=[{'all':!![]}];}return db['Schedule'][_0x8dc0('0x43')](_0x3c1d63);})['then'](function(_0x37e7ab){_0x3c4cd5[_0x8dc0('0x44')]=_0x37e7ab;return _0x3c4cd5;})[_0x8dc0('0x23')](respondWithFilteredResult(_0x1d0841,_0x3c1d63))[_0x8dc0('0x45')](handleError(_0x1d0841,null));};exports[_0x8dc0('0x46')]=function(_0x20ff84,_0x28ec20){var _0x566090={'raw':![],'where':{'id':_0x20ff84['params']['id']}},_0x3627f2={};_0x3627f2['model']=_[_0x8dc0('0x32')](db['Schedule'][_0x8dc0('0x2e')]);_0x3627f2['query']=_['keys'](_0x20ff84['query']);_0x3627f2[_0x8dc0('0x33')]=_[_0x8dc0('0x34')](_0x3627f2[_0x8dc0('0x31')],_0x3627f2[_0x8dc0('0x35')]);_0x566090[_0x8dc0('0x36')]=_[_0x8dc0('0x34')](_0x3627f2['model'],qs[_0x8dc0('0x37')](_0x20ff84[_0x8dc0('0x35')][_0x8dc0('0x37')]));_0x566090[_0x8dc0('0x36')]=_0x566090['attributes']['length']?_0x566090[_0x8dc0('0x36')]:_0x3627f2[_0x8dc0('0x31')];if(_0x20ff84['query'][_0x8dc0('0x47')]){_0x566090['include']=[{'all':!![]}];}_0x566090=_[_0x8dc0('0x3e')]({},_0x566090,_0x20ff84[_0x8dc0('0x41')]);return db['Schedule']['find'](_0x566090)[_0x8dc0('0x23')](handleEntityNotFound(_0x28ec20,null))[_0x8dc0('0x23')](respondWithResult(_0x28ec20,null))[_0x8dc0('0x45')](handleError(_0x28ec20,null));};exports[_0x8dc0('0x48')]=function(_0x329356,_0x4c01d4){return db[_0x8dc0('0x2d')][_0x8dc0('0x48')](_0x329356[_0x8dc0('0x49')],{})[_0x8dc0('0x23')](function(_0x2e25e6){var _0x778432=_0x329356['user'][_0x8dc0('0x25')]({'plain':!![]});if(!_0x778432)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x778432[_0x8dc0('0x4a')]===_0x8dc0('0x4b')){var _0x586b32=_0x2e25e6[_0x8dc0('0x25')]({'plain':!![]});var _0x3045d9='Scheduler';return db['UserProfileSection'][_0x8dc0('0x4c')]({'where':{'name':_0x3045d9,'userProfileId':_0x778432[_0x8dc0('0x4d')]},'raw':!![]})[_0x8dc0('0x23')](function(_0x1364f5){if(_0x1364f5&&_0x1364f5[_0x8dc0('0x4e')]===0x0){return db[_0x8dc0('0x27')][_0x8dc0('0x48')]({'name':_0x586b32[_0x8dc0('0x40')],'resourceId':_0x586b32['id'],'type':_0x1364f5[_0x8dc0('0x40')],'sectionId':_0x1364f5['id']},{})['then'](function(){return _0x2e25e6;});}else{return _0x2e25e6;}})[_0x8dc0('0x45')](function(_0x300c28){logger['error'](_0x8dc0('0x4f'),_0x300c28);throw _0x300c28;});}return _0x2e25e6;})[_0x8dc0('0x23')](respondWithResult(_0x4c01d4,0xc9))[_0x8dc0('0x45')](handleError(_0x4c01d4,null));};exports[_0x8dc0('0x22')]=function(_0x29d78e,_0x19e574){if(_0x29d78e[_0x8dc0('0x49')]['id']){delete _0x29d78e[_0x8dc0('0x49')]['id'];}return db[_0x8dc0('0x2d')][_0x8dc0('0x4c')]({'where':{'id':_0x29d78e['params']['id']}})['then'](handleEntityNotFound(_0x19e574,null))[_0x8dc0('0x23')](saveUpdates(_0x29d78e[_0x8dc0('0x49')],null))['then'](respondWithResult(_0x19e574,null))['catch'](handleError(_0x19e574,null));};exports[_0x8dc0('0x24')]=function(_0x583ece,_0x2d6805){return db[_0x8dc0('0x2d')][_0x8dc0('0x4c')]({'where':{'id':_0x583ece['params']['id']}})[_0x8dc0('0x23')](handleEntityNotFound(_0x2d6805,null))[_0x8dc0('0x23')](removeEntity(_0x2d6805,null))[_0x8dc0('0x45')](handleError(_0x2d6805,null));};exports[_0x8dc0('0x50')]=function(_0x58fca0,_0x3b77ba,_0x41c059){var _0x1a21f8=require(_0x8dc0('0x51'));return db[_0x8dc0('0x2d')][_0x8dc0('0x4c')]({'where':{'id':_0x58fca0['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b77ba,null))['then'](function(){_0x1a21f8[_0x8dc0('0x50')](_0x58fca0[_0x8dc0('0x52')]['id']);})[_0x8dc0('0x23')](respondWithStatusCode(_0x3b77ba,null))[_0x8dc0('0x45')](handleError(_0x3b77ba,null));}; \ No newline at end of file +var _0x4fad=['Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','map','Schedule','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','run','../../config/schedule','eml-format','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/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4fad,0x8b));var _0xd4fa=function(_0x5aad95,_0x152c76){_0x5aad95=_0x5aad95-0x0;var _0x3bb6ae=_0x4fad[_0x5aad95];return _0x3bb6ae;};'use strict';var emlformat=require(_0xd4fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4fa('0x1'));var rp=require(_0xd4fa('0x2'));var moment=require(_0xd4fa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd4fa('0x4'));var util=require(_0xd4fa('0x5'));var path=require(_0xd4fa('0x6'));var sox=require(_0xd4fa('0x7'));var csv=require(_0xd4fa('0x8'));var ejs=require(_0xd4fa('0x9'));var fs=require('fs');var fs_extra=require(_0xd4fa('0xa'));var _=require(_0xd4fa('0xb'));var squel=require(_0xd4fa('0xc'));var crypto=require(_0xd4fa('0xd'));var jsforce=require(_0xd4fa('0xe'));var deskjs=require(_0xd4fa('0xf'));var toCsv=require(_0xd4fa('0x8'));var querystring=require(_0xd4fa('0x10'));var Papa=require(_0xd4fa('0x11'));var Redis=require(_0xd4fa('0x12'));var authService=require(_0xd4fa('0x13'));var qs=require(_0xd4fa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4fa('0x15'));var logger=require('../../config/logger')(_0xd4fa('0x16'));var utils=require(_0xd4fa('0x17'));var config=require(_0xd4fa('0x18'));var licenseUtil=require(_0xd4fa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55fec9,_0x27ac02){_0x27ac02=_0x27ac02||0xcc;return function(_0x43cf1d){if(_0x43cf1d){return _0x55fec9[_0xd4fa('0x1a')](_0x27ac02);}return _0x55fec9['status'](_0x27ac02)[_0xd4fa('0x1b')]();};}function respondWithResult(_0x110f52,_0x226c25){_0x226c25=_0x226c25||0xc8;return function(_0x57d3c6){if(_0x57d3c6){return _0x110f52[_0xd4fa('0x1c')](_0x226c25)[_0xd4fa('0x1d')](_0x57d3c6);}};}function respondWithFilteredResult(_0x86bb66,_0xb7d5c0){return function(_0x3af91a){if(_0x3af91a){var _0x4ca659=typeof _0xb7d5c0[_0xd4fa('0x1e')]===_0xd4fa('0x1f')&&typeof _0xb7d5c0[_0xd4fa('0x20')]===_0xd4fa('0x1f');var _0x2caaa4=_0x3af91a[_0xd4fa('0x21')];var _0x491434=_0x4ca659?0x0:_0xb7d5c0[_0xd4fa('0x1e')];var _0x42bb22=_0x4ca659?_0x3af91a[_0xd4fa('0x21')]:_0xb7d5c0['offset']+_0xb7d5c0['limit'];var _0x100baf;if(_0x42bb22>=_0x2caaa4){_0x42bb22=_0x2caaa4;_0x100baf=0xc8;}else{_0x100baf=0xce;}_0x86bb66[_0xd4fa('0x1c')](_0x100baf);return _0x86bb66[_0xd4fa('0x22')](_0xd4fa('0x23'),_0x491434+'-'+_0x42bb22+'/'+_0x2caaa4)['json'](_0x3af91a);}return null;};}function patchUpdates(_0x2fac78){return function(_0xcb7926){try{jsonpatch[_0xd4fa('0x24')](_0xcb7926,_0x2fac78,!![]);}catch(_0x17eb5b){return BPromise[_0xd4fa('0x25')](_0x17eb5b);}return _0xcb7926[_0xd4fa('0x26')]();};}function saveUpdates(_0x49ca73,_0x6b7443){return function(_0x400e37){if(_0x400e37){return _0x400e37[_0xd4fa('0x27')](_0x49ca73)[_0xd4fa('0x28')](function(_0x332622){return _0x332622;});}return null;};}function removeEntity(_0x67fcfd,_0x553b61){return function(_0x183be4){if(_0x183be4){return _0x183be4['destroy']()[_0xd4fa('0x28')](function(){var _0x4ac4c2=_0x183be4[_0xd4fa('0x29')]({'plain':!![]});var _0xe31bf=_0xd4fa('0x2a');return db[_0xd4fa('0x2b')][_0xd4fa('0x2c')]({'where':{'type':_0xe31bf,'resourceId':_0x4ac4c2['id']}})[_0xd4fa('0x28')](function(){return _0x183be4;});})[_0xd4fa('0x28')](function(){_0x67fcfd[_0xd4fa('0x1c')](0xcc)[_0xd4fa('0x1b')]();});}};}function handleEntityNotFound(_0x13d4ec,_0x19ff19){return function(_0x424d8a){if(!_0x424d8a){_0x13d4ec[_0xd4fa('0x1a')](0x194);}return _0x424d8a;};}function handleError(_0x102418,_0x506c5f){_0x506c5f=_0x506c5f||0x1f4;return function(_0x560893){logger[_0xd4fa('0x2d')](_0x560893[_0xd4fa('0x2e')]);if(_0x560893['name']){delete _0x560893[_0xd4fa('0x2f')];}_0x102418[_0xd4fa('0x1c')](_0x506c5f)[_0xd4fa('0x30')](_0x560893);};}exports['index']=function(_0x47011d,_0x409307){var _0x11c05e={},_0x50d513={},_0x28a843={'count':0x0,'rows':[]};var _0x3796eb=_[_0xd4fa('0x31')](db[_0xd4fa('0x32')]['rawAttributes'],function(_0x4aeaac){return{'name':_0x4aeaac[_0xd4fa('0x33')],'type':_0x4aeaac[_0xd4fa('0x34')][_0xd4fa('0x35')]};});_0x50d513[_0xd4fa('0x36')]=_['map'](_0x3796eb,_0xd4fa('0x2f'));_0x50d513[_0xd4fa('0x37')]=_[_0xd4fa('0x38')](_0x47011d[_0xd4fa('0x37')]);_0x50d513['filters']=_[_0xd4fa('0x39')](_0x50d513['model'],_0x50d513[_0xd4fa('0x37')]);_0x11c05e[_0xd4fa('0x3a')]=_[_0xd4fa('0x39')](_0x50d513[_0xd4fa('0x36')],qs['fields'](_0x47011d[_0xd4fa('0x37')][_0xd4fa('0x3b')]));_0x11c05e[_0xd4fa('0x3a')]=_0x11c05e[_0xd4fa('0x3a')][_0xd4fa('0x3c')]?_0x11c05e[_0xd4fa('0x3a')]:_0x50d513[_0xd4fa('0x36')];if(!_0x47011d[_0xd4fa('0x37')][_0xd4fa('0x3d')](_0xd4fa('0x3e'))){_0x11c05e['limit']=qs[_0xd4fa('0x20')](_0x47011d[_0xd4fa('0x37')][_0xd4fa('0x20')]);_0x11c05e[_0xd4fa('0x1e')]=qs['offset'](_0x47011d['query'][_0xd4fa('0x1e')]);}_0x11c05e['order']=qs['sort'](_0x47011d[_0xd4fa('0x37')][_0xd4fa('0x3f')]);_0x11c05e[_0xd4fa('0x40')]=qs[_0xd4fa('0x41')](_[_0xd4fa('0x42')](_0x47011d[_0xd4fa('0x37')],_0x50d513[_0xd4fa('0x41')]),_0x3796eb);if(_0x47011d[_0xd4fa('0x37')][_0xd4fa('0x43')]){_0x11c05e[_0xd4fa('0x40')]=_[_0xd4fa('0x44')](_0x11c05e[_0xd4fa('0x40')],{'$or':_[_0xd4fa('0x31')](_0x3796eb,function(_0xf613b4){if(_0xf613b4[_0xd4fa('0x34')]!==_0xd4fa('0x45')){var _0x26edb6={};_0x26edb6[_0xf613b4[_0xd4fa('0x2f')]]={'$like':'%'+_0x47011d['query']['filter']+'%'};return _0x26edb6;}})});}_0x11c05e=_[_0xd4fa('0x44')]({},_0x11c05e,_0x47011d[_0xd4fa('0x46')]);var _0x3e979e={'where':_0x11c05e['where']};return db[_0xd4fa('0x32')][_0xd4fa('0x21')](_0x3e979e)[_0xd4fa('0x28')](function(_0x5ca158){_0x28a843[_0xd4fa('0x21')]=_0x5ca158;if(_0x47011d[_0xd4fa('0x37')]['includeAll']){_0x11c05e[_0xd4fa('0x47')]=[{'all':!![]}];}return db[_0xd4fa('0x32')][_0xd4fa('0x48')](_0x11c05e);})['then'](function(_0x414fe1){_0x28a843[_0xd4fa('0x49')]=_0x414fe1;return _0x28a843;})[_0xd4fa('0x28')](respondWithFilteredResult(_0x409307,_0x11c05e))[_0xd4fa('0x4a')](handleError(_0x409307,null));};exports[_0xd4fa('0x4b')]=function(_0x32314f,_0x3add1a){var _0x22148b={'raw':![],'where':{'id':_0x32314f['params']['id']}},_0x3826f4={};_0x3826f4[_0xd4fa('0x36')]=_[_0xd4fa('0x38')](db[_0xd4fa('0x32')]['rawAttributes']);_0x3826f4[_0xd4fa('0x37')]=_['keys'](_0x32314f[_0xd4fa('0x37')]);_0x3826f4[_0xd4fa('0x41')]=_[_0xd4fa('0x39')](_0x3826f4[_0xd4fa('0x36')],_0x3826f4['query']);_0x22148b[_0xd4fa('0x3a')]=_[_0xd4fa('0x39')](_0x3826f4['model'],qs[_0xd4fa('0x3b')](_0x32314f[_0xd4fa('0x37')][_0xd4fa('0x3b')]));_0x22148b[_0xd4fa('0x3a')]=_0x22148b[_0xd4fa('0x3a')][_0xd4fa('0x3c')]?_0x22148b[_0xd4fa('0x3a')]:_0x3826f4['model'];if(_0x32314f[_0xd4fa('0x37')][_0xd4fa('0x4c')]){_0x22148b['include']=[{'all':!![]}];}_0x22148b=_[_0xd4fa('0x44')]({},_0x22148b,_0x32314f['options']);return db[_0xd4fa('0x32')][_0xd4fa('0x4d')](_0x22148b)[_0xd4fa('0x28')](handleEntityNotFound(_0x3add1a,null))[_0xd4fa('0x28')](respondWithResult(_0x3add1a,null))[_0xd4fa('0x4a')](handleError(_0x3add1a,null));};exports[_0xd4fa('0x4e')]=function(_0x2056a2,_0x4b229a){return db[_0xd4fa('0x32')][_0xd4fa('0x4e')](_0x2056a2[_0xd4fa('0x4f')],{})[_0xd4fa('0x28')](function(_0x2cfaa7){var _0x22c4ac=_0x2056a2[_0xd4fa('0x50')][_0xd4fa('0x29')]({'plain':!![]});if(!_0x22c4ac)throw new Error(_0xd4fa('0x51'));if(_0x22c4ac[_0xd4fa('0x52')]==='user'){var _0x11a1a2=_0x2cfaa7[_0xd4fa('0x29')]({'plain':!![]});var _0x33b700=_0xd4fa('0x2a');return db[_0xd4fa('0x53')][_0xd4fa('0x4d')]({'where':{'name':_0x33b700,'userProfileId':_0x22c4ac['userProfileId']},'raw':!![]})['then'](function(_0x1659e1){if(_0x1659e1&&_0x1659e1['autoAssociation']===0x0){return db[_0xd4fa('0x2b')][_0xd4fa('0x4e')]({'name':_0x11a1a2[_0xd4fa('0x2f')],'resourceId':_0x11a1a2['id'],'type':_0x1659e1[_0xd4fa('0x2f')],'sectionId':_0x1659e1['id']},{})[_0xd4fa('0x28')](function(){return _0x2cfaa7;});}else{return _0x2cfaa7;}})[_0xd4fa('0x4a')](function(_0x47ddfc){logger[_0xd4fa('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47ddfc);throw _0x47ddfc;});}return _0x2cfaa7;})[_0xd4fa('0x28')](respondWithResult(_0x4b229a,0xc9))[_0xd4fa('0x4a')](handleError(_0x4b229a,null));};exports[_0xd4fa('0x27')]=function(_0x2a979b,_0x3578ab){if(_0x2a979b[_0xd4fa('0x4f')]['id']){delete _0x2a979b[_0xd4fa('0x4f')]['id'];}return db[_0xd4fa('0x32')][_0xd4fa('0x4d')]({'where':{'id':_0x2a979b[_0xd4fa('0x54')]['id']}})['then'](handleEntityNotFound(_0x3578ab,null))[_0xd4fa('0x28')](saveUpdates(_0x2a979b[_0xd4fa('0x4f')],null))['then'](respondWithResult(_0x3578ab,null))[_0xd4fa('0x4a')](handleError(_0x3578ab,null));};exports[_0xd4fa('0x2c')]=function(_0x497cd7,_0x472b00){return db['Schedule'][_0xd4fa('0x4d')]({'where':{'id':_0x497cd7['params']['id']}})[_0xd4fa('0x28')](handleEntityNotFound(_0x472b00,null))[_0xd4fa('0x28')](removeEntity(_0x472b00,null))['catch'](handleError(_0x472b00,null));};exports[_0xd4fa('0x55')]=function(_0x1481b1,_0x56aa19,_0x3f80e7){var _0x5ec56e=require(_0xd4fa('0x56'));return db[_0xd4fa('0x32')][_0xd4fa('0x4d')]({'where':{'id':_0x1481b1[_0xd4fa('0x54')]['id']},'raw':!![]})[_0xd4fa('0x28')](handleEntityNotFound(_0x56aa19,null))[_0xd4fa('0x28')](function(){_0x5ec56e['run'](_0x1481b1[_0xd4fa('0x54')]['id']);})['then'](respondWithStatusCode(_0x56aa19,null))[_0xd4fa('0x4a')](handleError(_0x56aa19,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f73d48d..af35151 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 _0xebce=['./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0xebce,0xb8));var _0xeebc=function(_0x3032e2,_0x26a4e8){_0x3032e2=_0x3032e2-0x0;var _0x427aef=_0xebce[_0x3032e2];return _0x427aef;};'use strict';var _=require(_0xeebc('0x0'));var util=require(_0xeebc('0x1'));var logger=require(_0xeebc('0x2'))(_0xeebc('0x3'));var moment=require(_0xeebc('0x4'));var BPromise=require(_0xeebc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeebc('0x6'));var rimraf=require(_0xeebc('0x7'));var config=require('../../config/environment');var attributes=require(_0xeebc('0x8'));module[_0xeebc('0x9')]=function(_0x21de9e,_0x2e3ea1){return _0x21de9e[_0xeebc('0xa')](_0xeebc('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7239=['path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x7239,0xa3));var _0x9723=function(_0x4108c0,_0x5a1e36){_0x4108c0=_0x4108c0-0x0;var _0x56540a=_0x7239[_0x4108c0];return _0x56540a;};'use strict';var _=require(_0x9723('0x0'));var util=require(_0x9723('0x1'));var logger=require(_0x9723('0x2'))(_0x9723('0x3'));var moment=require(_0x9723('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9723('0x5'));var rimraf=require(_0x9723('0x6'));var config=require(_0x9723('0x7'));var attributes=require(_0x9723('0x8'));module['exports']=function(_0x232698,_0x59b2bc){return _0x232698[_0x9723('0x9')](_0x9723('0xa'),attributes,{'tableName':_0x9723('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8a61c9c..6589c3e 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 _0x6c31=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','jayson/promise','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x131232,_0x5e45f9){var _0x3a61dc=function(_0x3e89f9){while(--_0x3e89f9){_0x131232['push'](_0x131232['shift']());}};_0x3a61dc(++_0x5e45f9);}(_0x6c31,0x1cb));var _0x16c3=function(_0xfcfc35,_0x41125e){_0xfcfc35=_0xfcfc35-0x0;var _0x13a3c7=_0x6c31[_0xfcfc35];return _0x13a3c7;};'use strict';var _=require(_0x16c3('0x0'));var util=require(_0x16c3('0x1'));var moment=require(_0x16c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x16c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16c3('0x4'))['db'];var utils=require(_0x16c3('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x16c3('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0bf4,_0x3eb2be,_0x4e1902){return new BPromise(function(_0x20e2b6,_0x47e698){return client[_0x16c3('0x7')](_0x1f0bf4,_0x4e1902)[_0x16c3('0x8')](function(_0x452698){logger[_0x16c3('0x9')](_0x16c3('0xa'),_0x3eb2be,_0x16c3('0xb'));logger[_0x16c3('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x3eb2be,_0x16c3('0xb'),JSON[_0x16c3('0xd')](_0x452698));if(_0x452698[_0x16c3('0xe')]){if(_0x452698['error']['code']===0x1f4){logger[_0x16c3('0xe')](_0x16c3('0xa'),_0x3eb2be,_0x452698[_0x16c3('0xe')][_0x16c3('0xf')]);return _0x47e698(_0x452698[_0x16c3('0xe')][_0x16c3('0xf')]);}logger[_0x16c3('0xe')]('Schedule,\x20%s,\x20%s',_0x3eb2be,_0x452698['error'][_0x16c3('0xf')]);return _0x20e2b6(_0x452698['error'][_0x16c3('0xf')]);}else{logger[_0x16c3('0x9')](_0x16c3('0xa'),_0x3eb2be,_0x16c3('0xb'));_0x20e2b6(_0x452698['result'][_0x16c3('0xf')]);}})[_0x16c3('0x10')](function(_0x2851f8){logger[_0x16c3('0xe')](_0x16c3('0xa'),_0x3eb2be,_0x2851f8);_0x47e698(_0x2851f8);});});} \ No newline at end of file +var _0xdda5=['request\x20sent','debug','error','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s'];(function(_0x11a0b0,_0x13077c){var _0x1382e6=function(_0x562ed0){while(--_0x562ed0){_0x11a0b0['push'](_0x11a0b0['shift']());}};_0x1382e6(++_0x13077c);}(_0xdda5,0x1c0));var _0x5dda=function(_0x322452,_0x443700){_0x322452=_0x322452-0x0;var _0x26ed24=_0xdda5[_0x322452];return _0x26ed24;};'use strict';var _=require('lodash');var util=require(_0x5dda('0x0'));var moment=require(_0x5dda('0x1'));var BPromise=require(_0x5dda('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dda('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5dda('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5dda('0x5'));var client=jayson[_0x5dda('0x6')][_0x5dda('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4669d9,_0x33f80a,_0x24cdf2){return new BPromise(function(_0x262ecc,_0x2fcac0){return client[_0x5dda('0x8')](_0x4669d9,_0x24cdf2)['then'](function(_0x460337){logger[_0x5dda('0x9')](_0x5dda('0xa'),_0x33f80a,_0x5dda('0xb'));logger[_0x5dda('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x33f80a,'request\x20sent',JSON['stringify'](_0x460337));if(_0x460337[_0x5dda('0xd')]){if(_0x460337['error']['code']===0x1f4){logger[_0x5dda('0xd')](_0x5dda('0xa'),_0x33f80a,_0x460337[_0x5dda('0xd')][_0x5dda('0xe')]);return _0x2fcac0(_0x460337[_0x5dda('0xd')][_0x5dda('0xe')]);}logger[_0x5dda('0xd')]('Schedule,\x20%s,\x20%s',_0x33f80a,_0x460337[_0x5dda('0xd')][_0x5dda('0xe')]);return _0x262ecc(_0x460337['error'][_0x5dda('0xe')]);}else{logger[_0x5dda('0x9')](_0x5dda('0xa'),_0x33f80a,'request\x20sent');_0x262ecc(_0x460337[_0x5dda('0xf')][_0x5dda('0xe')]);}})[_0x5dda('0x10')](function(_0x1bc38b){logger[_0x5dda('0xd')]('Schedule,\x20%s,\x20%s',_0x33f80a,_0x1bc38b);_0x2fcac0(_0x1bc38b);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 54f1eb8..b9c98ac 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 _0x4bca=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x4c219c,_0x547d3b){var _0xf40c74=function(_0x46ad50){while(--_0x46ad50){_0x4c219c['push'](_0x4c219c['shift']());}};_0xf40c74(++_0x547d3b);}(_0x4bca,0xb3));var _0xa4bc=function(_0x5b337b,_0x467e71){_0x5b337b=_0x5b337b-0x0;var _0x1fc141=_0x4bca[_0x5b337b];return _0x1fc141;};'use strict';var multer=require(_0xa4bc('0x0'));var util=require(_0xa4bc('0x1'));var path=require(_0xa4bc('0x2'));var timeout=require(_0xa4bc('0x3'));var express=require(_0xa4bc('0x4'));var router=express[_0xa4bc('0x5')]();var fs_extra=require(_0xa4bc('0x6'));var auth=require(_0xa4bc('0x7'));var interaction=require(_0xa4bc('0x8'));var config=require(_0xa4bc('0x9'));var controller=require(_0xa4bc('0xa'));router[_0xa4bc('0xb')]('/',auth[_0xa4bc('0xc')](),controller[_0xa4bc('0xd')]);router[_0xa4bc('0xb')](_0xa4bc('0xe'),auth[_0xa4bc('0xc')](),controller['describe']);router['get'](_0xa4bc('0xf'),auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x10')]);router[_0xa4bc('0xb')]('/:id/download',auth[_0xa4bc('0xc')](),controller['download']);router[_0xa4bc('0x11')]('/',auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x12')]);router['put']('/:id',auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x13')]);router['delete'](_0xa4bc('0xf'),auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x14')]);module[_0xa4bc('0x15')]=router; \ No newline at end of file +var _0xb48c=['/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get'];(function(_0x3b00b4,_0x413db0){var _0x1f83a4=function(_0x5f1a3b){while(--_0x5f1a3b){_0x3b00b4['push'](_0x3b00b4['shift']());}};_0x1f83a4(++_0x413db0);}(_0xb48c,0x8a));var _0xcb48=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb48c[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xcb48('0x0'));var util=require(_0xcb48('0x1'));var path=require(_0xcb48('0x2'));var timeout=require(_0xcb48('0x3'));var express=require(_0xcb48('0x4'));var router=express[_0xcb48('0x5')]();var fs_extra=require(_0xcb48('0x6'));var auth=require(_0xcb48('0x7'));var interaction=require(_0xcb48('0x8'));var config=require(_0xcb48('0x9'));var controller=require(_0xcb48('0xa'));router[_0xcb48('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb48('0xb')](_0xcb48('0xc'),auth['isAuthenticated'](),controller[_0xcb48('0xd')]);router[_0xcb48('0xb')](_0xcb48('0xe'),auth[_0xcb48('0xf')](),controller[_0xcb48('0x10')]);router['get'](_0xcb48('0x11'),auth['isAuthenticated'](),controller[_0xcb48('0x12')]);router[_0xcb48('0x13')]('/',auth[_0xcb48('0xf')](),controller[_0xcb48('0x14')]);router[_0xcb48('0x15')](_0xcb48('0xe'),auth[_0xcb48('0xf')](),controller[_0xcb48('0x16')]);router[_0xcb48('0x17')](_0xcb48('0xe'),auth[_0xcb48('0xf')](),controller[_0xcb48('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 138e264..6c80ee6 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 _0x29b1=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','closedAt'];(function(_0x414308,_0x53b84f){var _0x26b37a=function(_0x105d39){while(--_0x105d39){_0x414308['push'](_0x414308['shift']());}};_0x26b37a(++_0x53b84f);}(_0x29b1,0x16d));var _0x129b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x29b1[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x129b('0x0'));var moment=require(_0x129b('0x1'));var path=require(_0x129b('0x2'));var config=require(_0x129b('0x3'));module[_0x129b('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x129b('0x5')](_0x129b('0x6'))?path[_0x129b('0x7')](this[_0x129b('0x5')](_0x129b('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x129b('0x8')]},'channel':{'type':Sequelize[_0x129b('0x8')]},'value':{'type':Sequelize[_0x129b('0x8')],'set':function(_0x5ce8f9){var _0x3ef769=_0x5ce8f9['replace'](/\\/g,'/');this[_0x129b('0x9')](_0x129b('0x6'),_0x3ef769);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x129b('0xa')],'set':function(_0x1abf45){this['setDataValue'](_0x129b('0xb'),moment()['subtract'](_0x1abf45,'ms'));this[_0x129b('0x9')](_0x129b('0xc'),moment());this[_0x129b('0x9')]('duration',_0x1abf45);}},'startedAt':{'type':Sequelize[_0x129b('0xd')],'get':function(){return moment(this[_0x129b('0x5')](_0x129b('0xb')))[_0x129b('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x129b('0x5')]('closedAt'))[_0x129b('0xe')](_0x129b('0xf'))[_0x129b('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x129b('0x5')]('createdAt'))[_0x129b('0xe')](_0x129b('0xf'))[_0x129b('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x129b('0x5')](_0x129b('0x11')))[_0x129b('0xe')](_0x129b('0xf'))[_0x129b('0x10')]();}}}; \ No newline at end of file +var _0xe1e8=['sequelize','path','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x20d503,_0x255a38){_0x20d503=_0x20d503-0x0;var _0xe51bef=_0xe1e8[_0x20d503];return _0xe51bef;};'use strict';var Sequelize=require(_0x8e1e('0x0'));var moment=require('moment');var path=require(_0x8e1e('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x8e1e('0x2')],'get':function(){return this[_0x8e1e('0x3')](_0x8e1e('0x4'))?path[_0x8e1e('0x5')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x8e1e('0x6')]},'channel':{'type':Sequelize[_0x8e1e('0x6')]},'value':{'type':Sequelize[_0x8e1e('0x6')],'set':function(_0x1861ce){var _0x4eb2b7=_0x1861ce[_0x8e1e('0x7')](/\\/g,'/');this[_0x8e1e('0x8')](_0x8e1e('0x4'),_0x4eb2b7);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4007f3){this[_0x8e1e('0x8')]('startedAt',moment()[_0x8e1e('0x9')](_0x4007f3,'ms'));this['setDataValue'](_0x8e1e('0xa'),moment());this[_0x8e1e('0x8')](_0x8e1e('0xb'),_0x4007f3);}},'startedAt':{'type':Sequelize[_0x8e1e('0xc')],'get':function(){return moment(this[_0x8e1e('0x3')]('startedAt'))[_0x8e1e('0xd')](_0x8e1e('0xe'))[_0x8e1e('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8e1e('0x3')](_0x8e1e('0xa')))[_0x8e1e('0xd')](_0x8e1e('0xe'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x8e1e('0x10')))[_0x8e1e('0xd')](_0x8e1e('0xe'))[_0x8e1e('0xf')]();}},'updatedAt':{'type':Sequelize[_0x8e1e('0xc')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x8e1e('0xd')](_0x8e1e('0xe'))[_0x8e1e('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 225528a..52dc475 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 _0x7fbe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','format','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','find','catch','create','body','duration','createdAt','closedAt','params','describe','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x597acf,_0x4dfb41){var _0x401de0=function(_0x389327){while(--_0x389327){_0x597acf['push'](_0x597acf['shift']());}};_0x401de0(++_0x4dfb41);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x508d16,_0x3e5c76){_0x508d16=_0x508d16-0x0;var _0x169e38=_0x7fbe[_0x508d16];return _0x169e38;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['differenceBy'](_[_0xe7fb('0x2c')](_0x219554,'name'),[_0xe7fb('0x32')]);_0xd3fffe[_0xe7fb('0x33')]=_[_0xe7fb('0x34')](_0x4fd290[_0xe7fb('0x33')]);_0xd3fffe['filters']=_[_0xe7fb('0x35')](_0xd3fffe[_0xe7fb('0x36')],_0xd3fffe[_0xe7fb('0x33')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xd3fffe['model'],qs[_0xe7fb('0x38')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x39')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x36')];if(!_0x4fd290[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x3a'))){_0x251807[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x4fd290['query'][_0xe7fb('0x20')]);_0x251807[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x4fd290[_0xe7fb('0x33')],_0xd3fffe[_0xe7fb('0x3e')]),_0x219554);if(_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x251807[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x251807[_0xe7fb('0x3d')],{'$or':_['map'](_0x219554,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x30')]!==_0xe7fb('0x42')){var _0x444f98={};_0x444f98[_0x261ec5['name']]={'$like':'%'+_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x444f98;}})});}_0x251807=_[_0xe7fb('0x41')]({},_0x251807,_0x4fd290[_0xe7fb('0x43')]);var _0x49fe9d={'where':_0x251807[_0xe7fb('0x3d')]};return db[_0xe7fb('0x2d')][_0xe7fb('0x21')](_0x49fe9d)[_0xe7fb('0x26')](function(_0x468d16){_0x5f265f[_0xe7fb('0x21')]=_0x468d16;if(_0x4fd290['query'][_0xe7fb('0x44')]){_0x251807[_0xe7fb('0x45')]=[{'all':!![]}];}return db[_0xe7fb('0x2d')]['findAll'](_0x251807);})[_0xe7fb('0x26')](function(_0x3a8c52){_0x5f265f['rows']=_0x3a8c52;return _0x5f265f;})['then'](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5e0153,_0x900d67){var _0x957ca3={'raw':![],'where':{'id':_0x5e0153['params']['id']}},_0xed62e9={};_0xed62e9[_0xe7fb('0x36')]=_['keys'](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')]);_0xed62e9['query']=_[_0xe7fb('0x34')](_0x5e0153[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x3e')]=_[_0xe7fb('0x35')](_0xed62e9['model'],_0xed62e9[_0xe7fb('0x33')]);_0x957ca3[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xed62e9['model'],qs[_0xe7fb('0x38')](_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x957ca3[_0xe7fb('0x37')]=_0x957ca3[_0xe7fb('0x37')]['length']?_0x957ca3[_0xe7fb('0x37')]:_0xed62e9['model'];if(_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x44')]){_0x957ca3[_0xe7fb('0x45')]=[{'all':!![]}];}_0x957ca3=_[_0xe7fb('0x41')]({},_0x957ca3,_0x5e0153[_0xe7fb('0x43')]);return db['ScreenRecording'][_0xe7fb('0x46')](_0x957ca3)['then'](handleEntityNotFound(_0x900d67,null))['then'](respondWithResult(_0x900d67,null))[_0xe7fb('0x47')](handleError(_0x900d67,null));};exports[_0xe7fb('0x48')]=function(_0x16327f,_0x589555){return db[_0xe7fb('0x2d')][_0xe7fb('0x48')](_0x16327f['body'],{})['then'](respondWithResult(_0x589555,0xc9))[_0xe7fb('0x47')](handleError(_0x589555,null));};exports[_0xe7fb('0x25')]=function(_0x1cbf34,_0x3dd6bf){if(_0x1cbf34[_0xe7fb('0x49')]['id']){delete _0x1cbf34[_0xe7fb('0x49')]['id'];}delete _0x1cbf34[_0xe7fb('0x49')][_0xe7fb('0x4a')];delete _0x1cbf34['body'][_0xe7fb('0x4b')];delete _0x1cbf34['body'][_0xe7fb('0x4c')];delete _0x1cbf34[_0xe7fb('0x49')]['value'];return db[_0xe7fb('0x2d')]['find']({'where':{'id':_0x1cbf34[_0xe7fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dd6bf,null))[_0xe7fb('0x26')](saveUpdates(_0x1cbf34['body'],null))[_0xe7fb('0x26')](respondWithResult(_0x3dd6bf,null))['catch'](handleError(_0x3dd6bf,null));};exports[_0xe7fb('0x4e')]=function(_0x1b6442,_0x41fcfb){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x41fcfb,null))[_0xe7fb('0x47')](handleError(_0x41fcfb,null));};exports['download']=function(_0x5d20dc,_0x20aa55,_0x4948a7){var _0x4f4240=require('../../components/encryptor');var _0x50b8df=![];var _0x539252={};if(_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]&&_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]==='uniqueid'){_0x539252[_0xe7fb('0x4f')]=_0x5d20dc[_0xe7fb('0x4d')]['id'];}else{_0x539252['id']=_0x5d20dc[_0xe7fb('0x4d')]['id'];}return db['ScreenRecording']['find']({'where':_0x539252,'attributes':['id',_0xe7fb('0x50')],'raw':!![]})[_0xe7fb('0x26')](handleEntityNotFound(_0x20aa55,null))[_0xe7fb('0x26')](function(_0x4f4ba3){if(_0x4f4ba3){var _0x27f860=path[_0xe7fb('0x51')](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x4f4ba3['value']);var _0x4b35f9=util[_0xe7fb('0x32')](_0xe7fb('0x54'),_0x27f860);if(fs[_0xe7fb('0x55')](_0x4b35f9)){_0x50b8df=!![];return _0x4f4240[_0xe7fb('0x56')](_0x4b35f9,_0x27f860,config[_0xe7fb('0x57')]['recording'])[_0xe7fb('0x26')](function(){return _0x4f4ba3;});}return _0x4f4ba3;}})[_0xe7fb('0x26')](function(_0x23755b){if(_0x23755b){var _0x590d7a=path['join'](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x23755b[_0xe7fb('0x50')]);if(!fs[_0xe7fb('0x55')](_0x590d7a)){throw new db[(_0xe7fb('0x58'))][(_0xe7fb('0x59'))]('ScreenRecording\x20not\x20found');}if(_0x23755b[_0xe7fb('0x5a')]){return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,_0x23755b[_0xe7fb('0x5a')]+path[_0xe7fb('0x5c')](_0x590d7a),function(){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}else{return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,function(_0x554092){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}}})['catch'](function(_0x1eda1d){if(_0x1eda1d[_0xe7fb('0x5e')]===_0xe7fb('0x5f')){_0x20aa55[_0xe7fb('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x20aa55,null);}});};exports[_0xe7fb('0x60')]=function(_0x11e15a,_0x25aeb2){return db[_0xe7fb('0x2d')][_0xe7fb('0x46')]({'where':{'id':_0x11e15a['params']['id']}})[_0xe7fb('0x26')](function(_0x58d4ec){if(_[_0xe7fb('0x61')](_0x58d4ec)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58d4ec;})['then'](function(_0xc13fac){var _0x203da3=path[_0xe7fb('0x51')](config['root'],_0xe7fb('0x53'),_0xc13fac[_0xe7fb('0x50')]);logger[_0xe7fb('0x62')](_0xe7fb('0x63'),_0x203da3);if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')]('File:\x20\x22'+_0x203da3+_0xe7fb('0x64'));fs[_0xe7fb('0x65')](_0x203da3);}_0x203da3=_0x203da3+'.cypher';if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')](_0xe7fb('0x66')+_0x203da3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7fb('0x65')](_0x203da3);}return _0xc13fac;})[_0xe7fb('0x26')](function(_0x2c558a){if(!_0x2c558a)throw new InternalError();return _0x2c558a[_0xe7fb('0x60')]();})[_0xe7fb('0x26')](function(){_0x25aeb2[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();})[_0xe7fb('0x47')](handleError(_0x25aeb2,null));}; \ No newline at end of file +var _0xac31=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','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','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','then','includeAll','findAll','rows','catch','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher'];(function(_0x537501,_0x1509e4){var _0x54bfc2=function(_0x29bd68){while(--_0x29bd68){_0x537501['push'](_0x537501['shift']());}};_0x54bfc2(++_0x1509e4);}(_0xac31,0xca));var _0x1ac3=function(_0x3e3527,_0x4f9a6c){_0x3e3527=_0x3e3527-0x0;var _0x2ed1ae=_0xac31[_0x3e3527];return _0x2ed1ae;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];function respondWithStatusCode(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xcc;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0x1a')](_0x2338b9);}return _0x2eeabf[_0x1ac3('0x1b')](_0x2338b9)[_0x1ac3('0x1c')]();};}function respondWithResult(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0xc8;return function(_0x24bb5e){if(_0x24bb5e){return _0x2def9f[_0x1ac3('0x1b')](_0x53cc35)['json'](_0x24bb5e);}};}function respondWithFilteredResult(_0x29a7b3,_0x1f9641){return function(_0x38b52a){if(_0x38b52a){var _0x51f1e4=typeof _0x1f9641[_0x1ac3('0x1d')]===_0x1ac3('0x1e')&&typeof _0x1f9641[_0x1ac3('0x1f')]==='undefined';var _0x195683=_0x38b52a['count'];var _0x291616=_0x51f1e4?0x0:_0x1f9641[_0x1ac3('0x1d')];var _0x20091d=_0x51f1e4?_0x38b52a[_0x1ac3('0x20')]:_0x1f9641[_0x1ac3('0x1d')]+_0x1f9641['limit'];var _0x136e73;if(_0x20091d>=_0x195683){_0x20091d=_0x195683;_0x136e73=0xc8;}else{_0x136e73=0xce;}_0x29a7b3[_0x1ac3('0x1b')](_0x136e73);return _0x29a7b3[_0x1ac3('0x21')](_0x1ac3('0x22'),_0x291616+'-'+_0x20091d+'/'+_0x195683)['json'](_0x38b52a);}return null;};}function patchUpdates(_0x48d18a){return function(_0x2879d8){try{jsonpatch[_0x1ac3('0x23')](_0x2879d8,_0x48d18a,!![]);}catch(_0x14070b){return BPromise[_0x1ac3('0x24')](_0x14070b);}return _0x2879d8[_0x1ac3('0x25')]();};}function saveUpdates(_0x319988,_0x23b767){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x1ac3('0x26')](_0x319988)['then'](function(_0x1e277f){return _0x1e277f;});}return null;};}function removeEntity(_0x231b7f,_0x4b19f2){return function(_0x2b5182){if(_0x2b5182){return _0x2b5182[_0x1ac3('0x27')]()['then'](function(){_0x231b7f[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();});}};}function handleEntityNotFound(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(!_0x10db3d){_0x145486['sendStatus'](0x194);}return _0x10db3d;};}function handleError(_0x5a2ab2,_0x503a64){_0x503a64=_0x503a64||0x1f4;return function(_0x528807){logger['error'](_0x528807[_0x1ac3('0x28')]);if(_0x528807['name']){delete _0x528807[_0x1ac3('0x29')];}_0x5a2ab2[_0x1ac3('0x1b')](_0x503a64)[_0x1ac3('0x2a')](_0x528807);};}exports[_0x1ac3('0x2b')]=function(_0x4b3d3c,_0x61441d){var _0x541da0={},_0x2ddd73={},_0x4000b0={'count':0x0,'rows':[]};var _0x440aed=_[_0x1ac3('0x2c')](db[_0x1ac3('0x2d')][_0x1ac3('0x2e')],function(_0x9c17c2){return{'name':_0x9c17c2['fieldName'],'type':_0x9c17c2[_0x1ac3('0x2f')][_0x1ac3('0x30')]};});_0x2ddd73[_0x1ac3('0x31')]=_[_0x1ac3('0x32')](_['map'](_0x440aed,_0x1ac3('0x29')),[_0x1ac3('0x33')]);_0x2ddd73[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x34')]);_0x2ddd73['filters']=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],_0x2ddd73[_0x1ac3('0x34')]);_0x541da0[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],qs['fields'](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x541da0[_0x1ac3('0x37')]=_0x541da0[_0x1ac3('0x37')]['length']?_0x541da0[_0x1ac3('0x37')]:_0x2ddd73[_0x1ac3('0x31')];if(!_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x39')](_0x1ac3('0x3a'))){_0x541da0[_0x1ac3('0x1f')]=qs[_0x1ac3('0x1f')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x1f')]);_0x541da0['offset']=qs[_0x1ac3('0x1d')](_0x4b3d3c[_0x1ac3('0x34')]['offset']);}_0x541da0[_0x1ac3('0x3b')]=qs[_0x1ac3('0x3c')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x3c')]);_0x541da0[_0x1ac3('0x3d')]=qs[_0x1ac3('0x3e')](_[_0x1ac3('0x3f')](_0x4b3d3c[_0x1ac3('0x34')],_0x2ddd73['filters']),_0x440aed);if(_0x4b3d3c[_0x1ac3('0x34')]['filter']){_0x541da0[_0x1ac3('0x3d')]=_[_0x1ac3('0x40')](_0x541da0[_0x1ac3('0x3d')],{'$or':_[_0x1ac3('0x2c')](_0x440aed,function(_0x3141ae){if(_0x3141ae[_0x1ac3('0x2f')]!=='VIRTUAL'){var _0x3b5c1c={};_0x3b5c1c[_0x3141ae[_0x1ac3('0x29')]]={'$like':'%'+_0x4b3d3c[_0x1ac3('0x34')]['filter']+'%'};return _0x3b5c1c;}})});}_0x541da0=_[_0x1ac3('0x40')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x41')]);var _0x5cec6b={'where':_0x541da0[_0x1ac3('0x3d')]};return db[_0x1ac3('0x2d')][_0x1ac3('0x20')](_0x5cec6b)[_0x1ac3('0x42')](function(_0x466a45){_0x4000b0[_0x1ac3('0x20')]=_0x466a45;if(_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x541da0['include']=[{'all':!![]}];}return db[_0x1ac3('0x2d')][_0x1ac3('0x44')](_0x541da0);})[_0x1ac3('0x42')](function(_0x254a77){_0x4000b0[_0x1ac3('0x45')]=_0x254a77;return _0x4000b0;})[_0x1ac3('0x42')](respondWithFilteredResult(_0x61441d,_0x541da0))[_0x1ac3('0x46')](handleError(_0x61441d,null));};exports['show']=function(_0x4edc4d,_0x2c2099){var _0x3f60ca={'raw':![],'where':{'id':_0x4edc4d[_0x1ac3('0x47')]['id']}},_0x4972d1={};_0x4972d1[_0x1ac3('0x31')]=_['keys'](db[_0x1ac3('0x2d')]['rawAttributes']);_0x4972d1[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4edc4d[_0x1ac3('0x34')]);_0x4972d1[_0x1ac3('0x3e')]=_['intersection'](_0x4972d1[_0x1ac3('0x31')],_0x4972d1[_0x1ac3('0x34')]);_0x3f60ca[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x4972d1[_0x1ac3('0x31')],qs['fields'](_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x3f60ca[_0x1ac3('0x37')]=_0x3f60ca[_0x1ac3('0x37')]['length']?_0x3f60ca[_0x1ac3('0x37')]:_0x4972d1[_0x1ac3('0x31')];if(_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x3f60ca['include']=[{'all':!![]}];}_0x3f60ca=_[_0x1ac3('0x40')]({},_0x3f60ca,_0x4edc4d[_0x1ac3('0x41')]);return db[_0x1ac3('0x2d')][_0x1ac3('0x48')](_0x3f60ca)['then'](handleEntityNotFound(_0x2c2099,null))[_0x1ac3('0x42')](respondWithResult(_0x2c2099,null))['catch'](handleError(_0x2c2099,null));};exports[_0x1ac3('0x49')]=function(_0x10bcaf,_0x2e3347){return db[_0x1ac3('0x2d')][_0x1ac3('0x49')](_0x10bcaf[_0x1ac3('0x4a')],{})[_0x1ac3('0x42')](respondWithResult(_0x2e3347,0xc9))['catch'](handleError(_0x2e3347,null));};exports['update']=function(_0xe8f33c,_0x249c2d){if(_0xe8f33c[_0x1ac3('0x4a')]['id']){delete _0xe8f33c['body']['id'];}delete _0xe8f33c['body']['duration'];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4b')];delete _0xe8f33c['body'][_0x1ac3('0x4c')];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4d')];return db[_0x1ac3('0x2d')]['find']({'where':{'id':_0xe8f33c['params']['id']}})[_0x1ac3('0x42')](handleEntityNotFound(_0x249c2d,null))[_0x1ac3('0x42')](saveUpdates(_0xe8f33c['body'],null))[_0x1ac3('0x42')](respondWithResult(_0x249c2d,null))['catch'](handleError(_0x249c2d,null));};exports['describe']=function(_0x2d628d,_0x220dd0){return db['ScreenRecording'][_0x1ac3('0x4e')]()['then'](respondWithResult(_0x220dd0,null))[_0x1ac3('0x46')](handleError(_0x220dd0,null));};exports[_0x1ac3('0x4f')]=function(_0x3586b9,_0x3a0320,_0x34ad43){var _0x40e9c7=require(_0x1ac3('0x50'));var _0x331374=![];var _0xeb7e49={};if(_0x3586b9[_0x1ac3('0x34')][_0x1ac3('0x2f')]&&_0x3586b9['query']['type']===_0x1ac3('0x51')){_0xeb7e49[_0x1ac3('0x51')]=_0x3586b9[_0x1ac3('0x47')]['id'];}else{_0xeb7e49['id']=_0x3586b9[_0x1ac3('0x47')]['id'];}return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':_0xeb7e49,'attributes':['id',_0x1ac3('0x4d')],'raw':!![]})[_0x1ac3('0x42')](handleEntityNotFound(_0x3a0320,null))[_0x1ac3('0x42')](function(_0x3149f6){if(_0x3149f6){var _0x541bba=path[_0x1ac3('0x52')](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x3149f6[_0x1ac3('0x4d')]);var _0x20c195=util['format'](_0x1ac3('0x55'),_0x541bba);if(fs[_0x1ac3('0x56')](_0x20c195)){_0x331374=!![];return _0x40e9c7['decryptFile'](_0x20c195,_0x541bba,config['secrets']['recording'])[_0x1ac3('0x42')](function(){return _0x3149f6;});}return _0x3149f6;}})[_0x1ac3('0x42')](function(_0x2a1f66){if(_0x2a1f66){var _0x5ad546=path[_0x1ac3('0x52')](config['root'],'server/files/screen_recordings',_0x2a1f66['value']);if(!fs['existsSync'](_0x5ad546)){throw new db[(_0x1ac3('0x57'))][(_0x1ac3('0x58'))](_0x1ac3('0x59'));}if(_0x2a1f66[_0x1ac3('0x5a')]){return _0x3a0320[_0x1ac3('0x4f')](_0x5ad546,_0x2a1f66['filename']+path[_0x1ac3('0x5b')](_0x5ad546),function(){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}else{return _0x3a0320['download'](_0x5ad546,function(_0x2bcb4b){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}}})[_0x1ac3('0x46')](function(_0x2e79b2){if(_0x2e79b2[_0x1ac3('0x5d')]==='ScreenRecording\x20not\x20found'){_0x3a0320[_0x1ac3('0x1b')](0x194)[_0x1ac3('0x2a')](_0x1ac3('0x5e'));}else{return handleError(_0x3a0320,null);}});};exports[_0x1ac3('0x27')]=function(_0x4cfa04,_0x19407a){return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':{'id':_0x4cfa04[_0x1ac3('0x47')]['id']}})[_0x1ac3('0x42')](function(_0x1ac283){if(_['isNil'](_0x1ac283)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ac283;})['then'](function(_0x582fe2){var _0x3b930b=path['join'](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x582fe2[_0x1ac3('0x4d')]);logger[_0x1ac3('0x5f')](_0x1ac3('0x60'),_0x3b930b);if(!_[_0x1ac3('0x61')](_0x582fe2['value'])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')](_0x1ac3('0x62')+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}_0x3b930b=_0x3b930b+_0x1ac3('0x64');if(!_[_0x1ac3('0x61')](_0x582fe2[_0x1ac3('0x4d')])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')]('File:\x20\x22'+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}return _0x582fe2;})['then'](function(_0x402507){if(!_0x402507)throw new InternalError();return _0x402507[_0x1ac3('0x27')]();})[_0x1ac3('0x42')](function(){_0x19407a[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();})[_0x1ac3('0x46')](handleError(_0x19407a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index c0e0880..7706cb4 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 _0x2094=['rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x285b5f,_0x207e93){var _0x4cf41d=function(_0x42e4fc){while(--_0x42e4fc){_0x285b5f['push'](_0x285b5f['shift']());}};_0x4cf41d(++_0x207e93);}(_0x2094,0x84));var _0x4209=function(_0xe46922,_0x8b20fc){_0xe46922=_0xe46922-0x0;var _0x3644db=_0x2094[_0xe46922];return _0x3644db;};'use strict';var _=require(_0x4209('0x0'));var util=require(_0x4209('0x1'));var logger=require(_0x4209('0x2'))(_0x4209('0x3'));var moment=require(_0x4209('0x4'));var BPromise=require(_0x4209('0x5'));var rp=require(_0x4209('0x6'));var fs=require('fs');var path=require(_0x4209('0x7'));var rimraf=require(_0x4209('0x8'));var config=require(_0x4209('0x9'));var attributes=require(_0x4209('0xa'));module['exports']=function(_0xadc0e6,_0x1027bd){return _0xadc0e6['define'](_0x4209('0xb'),attributes,{'tableName':_0x4209('0xc'),'paranoid':![],'indexes':[{'name':_0x4209('0xd'),'fields':[_0x4209('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3062=['path','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3062,0x11b));var _0x2306=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0x3062[_0x1c3370];return _0xa9b358;};'use strict';var _=require(_0x2306('0x0'));var util=require(_0x2306('0x1'));var logger=require(_0x2306('0x2'))('api');var moment=require(_0x2306('0x3'));var BPromise=require(_0x2306('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2306('0x5'));var rimraf=require('rimraf');var config=require(_0x2306('0x6'));var attributes=require(_0x2306('0x7'));module[_0x2306('0x8')]=function(_0x2a8603,_0xa1d393){return _0x2a8603[_0x2306('0x9')]('ScreenRecording',attributes,{'tableName':_0x2306('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x2306('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 267cdce..8691c2e 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 _0x611f=['stringify','error','code','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x611f,0xd7));var _0xf611=function(_0xe7dfc2,_0x59ef08){_0xe7dfc2=_0xe7dfc2-0x0;var _0x17aa52=_0x611f[_0xe7dfc2];return _0x17aa52;};'use strict';var _=require(_0xf611('0x0'));var util=require('util');var moment=require(_0xf611('0x1'));var BPromise=require(_0xf611('0x2'));var rs=require(_0xf611('0x3'));var fs=require('fs');var Redis=require(_0xf611('0x4'));var db=require(_0xf611('0x5'))['db'];var utils=require(_0xf611('0x6'));var logger=require(_0xf611('0x7'))(_0xf611('0x8'));var config=require(_0xf611('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf611('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dcb65,_0x726d05,_0x55382a){return new BPromise(function(_0x48d82a,_0x19e63a){return client[_0xf611('0xb')](_0x2dcb65,_0x55382a)[_0xf611('0xc')](function(_0x2a2362){logger['info'](_0xf611('0xd'),_0x726d05,_0xf611('0xe'));logger[_0xf611('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x726d05,_0xf611('0xe'),JSON[_0xf611('0x10')](_0x2a2362));if(_0x2a2362[_0xf611('0x11')]){if(_0x2a2362[_0xf611('0x11')][_0xf611('0x12')]===0x1f4){logger[_0xf611('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x726d05,_0x2a2362[_0xf611('0x11')][_0xf611('0x13')]);return _0x19e63a(_0x2a2362['error'][_0xf611('0x13')]);}logger[_0xf611('0x11')](_0xf611('0xd'),_0x726d05,_0x2a2362[_0xf611('0x11')][_0xf611('0x13')]);return _0x48d82a(_0x2a2362[_0xf611('0x11')][_0xf611('0x13')]);}else{logger[_0xf611('0x14')](_0xf611('0xd'),_0x726d05,'request\x20sent');_0x48d82a(_0x2a2362['result'][_0xf611('0x13')]);}})['catch'](function(_0x1dc088){logger['error'](_0xf611('0xd'),_0x726d05,_0x1dc088);_0x19e63a(_0x1dc088);});});} \ No newline at end of file +var _0x4984=['ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x2feb0c,_0x5635b4){var _0x13014e=function(_0x4b863f){while(--_0x4b863f){_0x2feb0c['push'](_0x2feb0c['shift']());}};_0x13014e(++_0x5635b4);}(_0x4984,0x1ae));var _0x4498=function(_0xc68e96,_0x15beea){_0xc68e96=_0xc68e96-0x0;var _0x47f8c5=_0x4984[_0xc68e96];return _0x47f8c5;};'use strict';var _=require(_0x4498('0x0'));var util=require(_0x4498('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4498('0x2'));var fs=require('fs');var Redis=require(_0x4498('0x3'));var db=require(_0x4498('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4498('0x5'))('rpc');var config=require(_0x4498('0x6'));var jayson=require(_0x4498('0x7'));var client=jayson[_0x4498('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2854fe,_0x5a5d6c,_0x13844d){return new BPromise(function(_0x1cbee3,_0x25cef8){return client[_0x4498('0x9')](_0x2854fe,_0x13844d)[_0x4498('0xa')](function(_0x22d358){logger['info'](_0x4498('0xb'),_0x5a5d6c,'request\x20sent');logger[_0x4498('0xc')](_0x4498('0xd'),_0x5a5d6c,_0x4498('0xe'),JSON[_0x4498('0xf')](_0x22d358));if(_0x22d358[_0x4498('0x10')]){if(_0x22d358['error'][_0x4498('0x11')]===0x1f4){logger[_0x4498('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x5a5d6c,_0x22d358[_0x4498('0x10')]['message']);return _0x25cef8(_0x22d358[_0x4498('0x10')][_0x4498('0x12')]);}logger[_0x4498('0x10')](_0x4498('0xb'),_0x5a5d6c,_0x22d358[_0x4498('0x10')][_0x4498('0x12')]);return _0x1cbee3(_0x22d358[_0x4498('0x10')][_0x4498('0x12')]);}else{logger['info'](_0x4498('0xb'),_0x5a5d6c,'request\x20sent');_0x1cbee3(_0x22d358[_0x4498('0x13')]['message']);}})[_0x4498('0x14')](function(_0x551423){logger['error'](_0x4498('0xb'),_0x5a5d6c,_0x551423);_0x25cef8(_0x551423);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index b9647f2..027f6bb 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 _0x3286=['addPreferred','addFavicon','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','diskStorage','root','%s%s','logo','originalname','single','addLogo','join','server/files/images/logos/','format','logologin','extname','post','file','addLogoLogin','/:id/preferred'];(function(_0x1e1a63,_0x2f2793){var _0xb4deb0=function(_0x26ffb5){while(--_0x26ffb5){_0x1e1a63['push'](_0x1e1a63['shift']());}};_0xb4deb0(++_0x2f2793);}(_0x3286,0x1b2));var _0x6328=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3286[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6328('0x0'));var util=require(_0x6328('0x1'));var path=require(_0x6328('0x2'));var timeout=require(_0x6328('0x3'));var express=require(_0x6328('0x4'));var router=express[_0x6328('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6328('0x6'));var interaction=require(_0x6328('0x7'));var config=require(_0x6328('0x8'));var controller=require(_0x6328('0x9'));router[_0x6328('0xa')]('/',auth[_0x6328('0xb')](),controller[_0x6328('0xc')]);router[_0x6328('0xa')](_0x6328('0xd'),controller['getDate']);router[_0x6328('0xa')](_0x6328('0xe'),controller[_0x6328('0xf')]);router[_0x6328('0xa')](_0x6328('0x10'),controller['getLogo']);router[_0x6328('0xa')](_0x6328('0x11'),controller[_0x6328('0x12')]);router['get'](_0x6328('0x13'),controller[_0x6328('0x14')]);router['get']('/:id/preferred',controller[_0x6328('0x15')]);router[_0x6328('0xa')](_0x6328('0x16'),controller['getFavicon']);var upload=multer({'storage':multer[_0x6328('0x17')]({'destination':function(_0xa472a1,_0x4da5ff,_0x2baacf){_0x2baacf(null,path['join'](config[_0x6328('0x18')],'server/files/images/logos/'));},'filename':function(_0x47c084,_0x56075b,_0x16baac){_0x16baac(null,util['format'](_0x6328('0x19'),_0x6328('0x1a'),path['extname'](_0x56075b[_0x6328('0x1b')])));}})});router['post'](_0x6328('0x10'),upload[_0x6328('0x1c')]('file'),controller[_0x6328('0x1d')]);var upload=multer({'storage':multer[_0x6328('0x17')]({'destination':function(_0x3ae938,_0x2b1ff5,_0x5b42c0){_0x5b42c0(null,path[_0x6328('0x1e')](config[_0x6328('0x18')],_0x6328('0x1f')));},'filename':function(_0xb8f200,_0x508b3f,_0x1233ad){_0x1233ad(null,util[_0x6328('0x20')]('%s%s',_0x6328('0x21'),path[_0x6328('0x22')](_0x508b3f['originalname'])));}})});router[_0x6328('0x23')](_0x6328('0x11'),upload[_0x6328('0x1c')](_0x6328('0x24')),controller[_0x6328('0x25')]);var upload=multer({'storage':multer[_0x6328('0x17')]({'destination':function(_0x517575,_0x5ed577,_0x2db21d){_0x2db21d(null,path[_0x6328('0x1e')](config['root'],_0x6328('0x1f')));},'filename':function(_0x24ceea,_0x487756,_0x141ccd){_0x141ccd(null,util[_0x6328('0x20')](_0x6328('0x19'),'preferred',path[_0x6328('0x22')](_0x487756[_0x6328('0x1b')])));}})});router[_0x6328('0x23')](_0x6328('0x26'),upload['single'](_0x6328('0x24')),controller[_0x6328('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bdb0e,_0x190dd6,_0x197803){_0x197803(null,path[_0x6328('0x1e')](config[_0x6328('0x18')],_0x6328('0x1f')));},'filename':function(_0xe1ef23,_0x25a58c,_0xbf1c17){_0xbf1c17(null,util[_0x6328('0x20')](_0x6328('0x19'),'favicon',path[_0x6328('0x22')](_0x25a58c['originalname'])));}})});router[_0x6328('0x23')](_0x6328('0x16'),upload['single'](_0x6328('0x24')),controller[_0x6328('0x28')]);router[_0x6328('0x29')]('/:id',auth['isAuthenticated'](),controller[_0x6328('0x2a')]);module['exports']=router; \ No newline at end of file +var _0x642d=['get','index','/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','/:id/logo','single','file','addLogo','%s%s','extname','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x642d,0x19e));var _0xd642=function(_0x35c571,_0x528a19){_0x35c571=_0x35c571-0x0;var _0x52c5a2=_0x642d[_0x35c571];return _0x52c5a2;};'use strict';var multer=require(_0xd642('0x0'));var util=require(_0xd642('0x1'));var path=require(_0xd642('0x2'));var timeout=require(_0xd642('0x3'));var express=require(_0xd642('0x4'));var router=express[_0xd642('0x5')]();var fs_extra=require(_0xd642('0x6'));var auth=require(_0xd642('0x7'));var interaction=require(_0xd642('0x8'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xd642('0x9')]('/',auth['isAuthenticated'](),controller[_0xd642('0xa')]);router['get'](_0xd642('0xb'),controller[_0xd642('0xc')]);router['get'](_0xd642('0xd'),controller[_0xd642('0xe')]);router[_0xd642('0x9')]('/:id/logo',controller[_0xd642('0xf')]);router[_0xd642('0x9')](_0xd642('0x10'),controller[_0xd642('0x11')]);router[_0xd642('0x9')](_0xd642('0x12'),controller[_0xd642('0x13')]);router[_0xd642('0x9')](_0xd642('0x14'),controller[_0xd642('0x15')]);router[_0xd642('0x9')](_0xd642('0x16'),controller[_0xd642('0x17')]);var upload=multer({'storage':multer[_0xd642('0x18')]({'destination':function(_0xdfa21,_0x2cf631,_0x5cfed8){_0x5cfed8(null,path[_0xd642('0x19')](config[_0xd642('0x1a')],_0xd642('0x1b')));},'filename':function(_0x44e256,_0x66ad34,_0x7976){_0x7976(null,util[_0xd642('0x1c')]('%s%s',_0xd642('0x1d'),path['extname'](_0x66ad34[_0xd642('0x1e')])));}})});router[_0xd642('0x1f')](_0xd642('0x20'),upload[_0xd642('0x21')](_0xd642('0x22')),controller[_0xd642('0x23')]);var upload=multer({'storage':multer[_0xd642('0x18')]({'destination':function(_0x522269,_0x427f62,_0x4afdcf){_0x4afdcf(null,path[_0xd642('0x19')](config[_0xd642('0x1a')],'server/files/images/logos/'));},'filename':function(_0x5690f9,_0x4fd64d,_0x150c0d){_0x150c0d(null,util['format'](_0xd642('0x24'),'logologin',path[_0xd642('0x25')](_0x4fd64d[_0xd642('0x1e')])));}})});router[_0xd642('0x1f')](_0xd642('0x10'),upload[_0xd642('0x21')](_0xd642('0x22')),controller[_0xd642('0x26')]);var upload=multer({'storage':multer[_0xd642('0x18')]({'destination':function(_0x33ade4,_0xf2dc22,_0x4722c7){_0x4722c7(null,path[_0xd642('0x19')](config[_0xd642('0x1a')],'server/files/images/logos/'));},'filename':function(_0x5904a4,_0x372115,_0x1b8f74){_0x1b8f74(null,util[_0xd642('0x1c')](_0xd642('0x24'),_0xd642('0x27'),path['extname'](_0x372115[_0xd642('0x1e')])));}})});router[_0xd642('0x1f')](_0xd642('0x14'),upload[_0xd642('0x21')](_0xd642('0x22')),controller[_0xd642('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51eae2,_0x2f986b,_0x4691f2){_0x4691f2(null,path[_0xd642('0x19')](config['root'],_0xd642('0x1b')));},'filename':function(_0x3d22ef,_0x5e076c,_0x5204fd){_0x5204fd(null,util[_0xd642('0x1c')]('%s%s',_0xd642('0x29'),path[_0xd642('0x25')](_0x5e076c[_0xd642('0x1e')])));}})});router['post']('/:id/favicon',upload['single']('file'),controller[_0xd642('0x2a')]);router[_0xd642('0x2b')](_0xd642('0xd'),auth[_0xd642('0x2c')](),controller[_0xd642('0x2d')]);module[_0xd642('0x2e')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index c8f11ea..0ef6a59 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x17cc05,_0x23e66a){var _0x56ba4e=function(_0x2f2646){while(--_0x2f2646){_0x17cc05['push'](_0x17cc05['shift']());}};_0x56ba4e(++_0x23e66a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3022b6,_0x5d0530){var _0x4b592=function(_0x261211){while(--_0x261211){_0x3022b6['push'](_0x3022b6['shift']());}};_0x4b592(++_0x5d0530);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 9448c73..7c65fde 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 _0xf3cc=['toLower','default_logo.svg','default','custom','Sequelize','ValidationError','download','default_loginLogo.svg','upperFirst','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','jayson/promise','client','request','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','findAll','rows','catch','show','rawAttributes','fields','body','find','params','addLogo','file','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','logo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root'];(function(_0x1150dc,_0x3e5a8a){var _0xdf8174=function(_0x305b56){while(--_0x305b56){_0x1150dc['push'](_0x1150dc['shift']());}};_0xdf8174(++_0x3e5a8a);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x31bbf7,_0x292c9a){_0x31bbf7=_0x31bbf7-0x0;var _0x1469f3=_0xf3cc[_0x31bbf7];return _0x1469f3;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require(_0xcf3c('0x5'));var Mustache=require(_0xcf3c('0x6'));var util=require('util');var path=require(_0xcf3c('0x7'));var sox=require(_0xcf3c('0x8'));var csv=require('to-csv');var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf3c('0xa'));var _=require(_0xcf3c('0xb'));var squel=require(_0xcf3c('0xc'));var crypto=require(_0xcf3c('0xd'));var jsforce=require(_0xcf3c('0xe'));var deskjs=require(_0xcf3c('0xf'));var toCsv=require(_0xcf3c('0x10'));var querystring=require(_0xcf3c('0x11'));var Papa=require(_0xcf3c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf3c('0x13'));var as=require(_0xcf3c('0x14'));var hardwareService=require(_0xcf3c('0x15'));var logger=require(_0xcf3c('0x16'))(_0xcf3c('0x17'));var utils=require(_0xcf3c('0x18'));var config=require(_0xcf3c('0x19'));var licenseUtil=require(_0xcf3c('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcf3c('0x1b'));var client=jayson[_0xcf3c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x60e424,_0x4e6c38,_0x55ef34,_0x56261f){return new BPromise(function(_0x3fd714,_0x598576){var _0x2f387b=_0x56261f||client;return _0x2f387b[_0xcf3c('0x1d')](_0x60e424,_0x55ef34)['then'](function(_0x3e759f){logger['info'](_0xcf3c('0x1e'),_0x4e6c38,_0xcf3c('0x1f'));logger[_0xcf3c('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x4e6c38,_0xcf3c('0x1f'),JSON[_0xcf3c('0x21')](_0x3e759f));if(_0x3e759f[_0xcf3c('0x22')]){if(_0x3e759f[_0xcf3c('0x22')]['code']===0x1f4){logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);return _0x598576(_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);}logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);return _0x3fd714(_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);}else{logger['info'](_0xcf3c('0x1e'),_0x4e6c38,'request\x20sent');_0x3fd714(_0x3e759f[_0xcf3c('0x24')][_0xcf3c('0x23')]);}})['catch'](function(_0x1bd0f2){logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x1bd0f2);_0x598576(_0x1bd0f2);});});}function respondWithStatusCode(_0x1d7e79,_0x32bbd5){_0x32bbd5=_0x32bbd5||0xcc;return function(_0x3f1771){if(_0x3f1771){return _0x1d7e79[_0xcf3c('0x25')](_0x32bbd5);}return _0x1d7e79[_0xcf3c('0x26')](_0x32bbd5)['end']();};}function respondWithResult(_0x771a9f,_0x4ce43c){_0x4ce43c=_0x4ce43c||0xc8;return function(_0x2281b6){if(_0x2281b6){return _0x771a9f[_0xcf3c('0x26')](_0x4ce43c)[_0xcf3c('0x27')](_0x2281b6);}};}function respondWithFilteredResult(_0x35e546,_0x181c90){return function(_0x43c912){if(_0x43c912){var _0x5631f1=typeof _0x181c90[_0xcf3c('0x28')]==='undefined'&&typeof _0x181c90[_0xcf3c('0x29')]===_0xcf3c('0x2a');var _0x3b253d=_0x43c912['count'];var _0x397996=_0x5631f1?0x0:_0x181c90['offset'];var _0x1d8223=_0x5631f1?_0x43c912[_0xcf3c('0x2b')]:_0x181c90[_0xcf3c('0x28')]+_0x181c90[_0xcf3c('0x29')];var _0x5835b2;if(_0x1d8223>=_0x3b253d){_0x1d8223=_0x3b253d;_0x5835b2=0xc8;}else{_0x5835b2=0xce;}_0x35e546[_0xcf3c('0x26')](_0x5835b2);return _0x35e546[_0xcf3c('0x2c')](_0xcf3c('0x2d'),_0x397996+'-'+_0x1d8223+'/'+_0x3b253d)[_0xcf3c('0x27')](_0x43c912);}return null;};}function patchUpdates(_0x502bca){return function(_0x1fae74){try{jsonpatch[_0xcf3c('0x2e')](_0x1fae74,_0x502bca,!![]);}catch(_0x2b2915){return BPromise['reject'](_0x2b2915);}return _0x1fae74[_0xcf3c('0x2f')]();};}function saveUpdates(_0x185868,_0x196b02){return function(_0x5f376e){if(_0x5f376e){return _0x5f376e[_0xcf3c('0x30')](_0x185868)[_0xcf3c('0x31')](function(_0x45a611){return _0x45a611;});}return null;};}function removeEntity(_0x2e7b19,_0x1b15cf){return function(_0x534f56){if(_0x534f56){return _0x534f56[_0xcf3c('0x32')]()['then'](function(){_0x2e7b19[_0xcf3c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a78f2,_0x1daba1){return function(_0x32b41d){if(!_0x32b41d){_0x2a78f2[_0xcf3c('0x25')](0x194);}return _0x32b41d;};}function handleError(_0x2a014a,_0x3a54bf){_0x3a54bf=_0x3a54bf||0x1f4;return function(_0x7933ca){logger[_0xcf3c('0x22')](_0x7933ca['stack']);if(_0x7933ca[_0xcf3c('0x33')]){delete _0x7933ca[_0xcf3c('0x33')];}_0x2a014a[_0xcf3c('0x26')](_0x3a54bf)[_0xcf3c('0x34')](_0x7933ca);};}exports[_0xcf3c('0x35')]=function(_0x161ef9,_0x9a64be){var _0xff382e={},_0x16f81d={},_0x22fed3={'count':0x0,'rows':[]};var _0x4ad15a=_[_0xcf3c('0x36')](db['Setting']['rawAttributes'],function(_0x517e98){return{'name':_0x517e98[_0xcf3c('0x37')],'type':_0x517e98[_0xcf3c('0x38')][_0xcf3c('0x39')]};});_0x16f81d[_0xcf3c('0x3a')]=_['map'](_0x4ad15a,'name');_0x16f81d[_0xcf3c('0x3b')]=_[_0xcf3c('0x3c')](_0x161ef9[_0xcf3c('0x3b')]);_0x16f81d[_0xcf3c('0x3d')]=_[_0xcf3c('0x3e')](_0x16f81d[_0xcf3c('0x3a')],_0x16f81d['query']);_0xff382e[_0xcf3c('0x3f')]=_[_0xcf3c('0x3e')](_0x16f81d[_0xcf3c('0x3a')],qs['fields'](_0x161ef9[_0xcf3c('0x3b')]['fields']));_0xff382e['attributes']=_0xff382e[_0xcf3c('0x3f')][_0xcf3c('0x40')]?_0xff382e[_0xcf3c('0x3f')]:_0x16f81d[_0xcf3c('0x3a')];if(!_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x41')](_0xcf3c('0x42'))){_0xff382e[_0xcf3c('0x29')]=qs[_0xcf3c('0x29')](_0x161ef9['query']['limit']);_0xff382e[_0xcf3c('0x28')]=qs[_0xcf3c('0x28')](_0x161ef9['query'][_0xcf3c('0x28')]);}_0xff382e['order']=qs[_0xcf3c('0x43')](_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x43')]);_0xff382e[_0xcf3c('0x44')]=qs[_0xcf3c('0x3d')](_[_0xcf3c('0x45')](_0x161ef9[_0xcf3c('0x3b')],_0x16f81d[_0xcf3c('0x3d')]),_0x4ad15a);if(_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x46')]){_0xff382e[_0xcf3c('0x44')]=_[_0xcf3c('0x47')](_0xff382e[_0xcf3c('0x44')],{'$or':_[_0xcf3c('0x36')](_0x4ad15a,function(_0x256e00){if(_0x256e00[_0xcf3c('0x38')]!==_0xcf3c('0x48')){var _0xf7b7a4={};_0xf7b7a4[_0x256e00['name']]={'$like':'%'+_0x161ef9['query'][_0xcf3c('0x46')]+'%'};return _0xf7b7a4;}})});}_0xff382e=_['merge']({},_0xff382e,_0x161ef9[_0xcf3c('0x49')]);var _0x3d9265={'where':_0xff382e[_0xcf3c('0x44')]};return db[_0xcf3c('0x4a')][_0xcf3c('0x2b')](_0x3d9265)['then'](function(_0x5b6802){_0x22fed3['count']=_0x5b6802;if(_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x4b')]){_0xff382e['include']=[{'all':!![]}];}return db[_0xcf3c('0x4a')][_0xcf3c('0x4c')](_0xff382e);})[_0xcf3c('0x31')](function(_0x2800d4){_0x22fed3[_0xcf3c('0x4d')]=_0x2800d4;return _0x22fed3;})[_0xcf3c('0x31')](respondWithFilteredResult(_0x9a64be,_0xff382e))[_0xcf3c('0x4e')](handleError(_0x9a64be,null));};exports[_0xcf3c('0x4f')]=function(_0x31124d,_0x2c8234){var _0x25d090={'raw':![],'where':{'id':_0x31124d['params']['id']}},_0x2cfc0b={};_0x2cfc0b[_0xcf3c('0x3a')]=_[_0xcf3c('0x3c')](db[_0xcf3c('0x4a')][_0xcf3c('0x50')]);_0x2cfc0b['query']=_[_0xcf3c('0x3c')](_0x31124d['query']);_0x2cfc0b[_0xcf3c('0x3d')]=_['intersection'](_0x2cfc0b['model'],_0x2cfc0b['query']);_0x25d090['attributes']=_[_0xcf3c('0x3e')](_0x2cfc0b[_0xcf3c('0x3a')],qs['fields'](_0x31124d[_0xcf3c('0x3b')][_0xcf3c('0x51')]));_0x25d090[_0xcf3c('0x3f')]=_0x25d090['attributes']['length']?_0x25d090[_0xcf3c('0x3f')]:_0x2cfc0b[_0xcf3c('0x3a')];if(_0x31124d['query']['includeAll']){_0x25d090['include']=[{'all':!![]}];}_0x25d090=_[_0xcf3c('0x47')]({},_0x25d090,_0x31124d['options']);return db[_0xcf3c('0x4a')]['find'](_0x25d090)[_0xcf3c('0x31')](handleEntityNotFound(_0x2c8234,null))[_0xcf3c('0x31')](respondWithResult(_0x2c8234,null))[_0xcf3c('0x4e')](handleError(_0x2c8234,null));};exports[_0xcf3c('0x30')]=function(_0x2d0710,_0x4cb19d){if(_0x2d0710[_0xcf3c('0x52')]['id']){delete _0x2d0710[_0xcf3c('0x52')]['id'];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x2d0710[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x4cb19d,null))[_0xcf3c('0x31')](saveUpdates(_0x2d0710['body'],null))['then'](respondWithResult(_0x4cb19d,null))['catch'](handleError(_0x4cb19d,null));};exports[_0xcf3c('0x55')]=function(_0x4b902b,_0x5a7c0f,_0x340b82){if(_0x4b902b[_0xcf3c('0x56')]&&_0x4b902b[_0xcf3c('0x56')]['filename']){_0x4b902b[_0xcf3c('0x52')]['logo']=_0x4b902b[_0xcf3c('0x56')][_0xcf3c('0x57')];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x4b902b[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x5a7c0f,null))[_0xcf3c('0x31')](saveUpdates(_0x4b902b[_0xcf3c('0x52')],null))[_0xcf3c('0x31')](respondWithResult(_0x5a7c0f,null))[_0xcf3c('0x4e')](handleError(_0x5a7c0f,null));};exports[_0xcf3c('0x58')]=function(_0x5578c4,_0x2bae67,_0x191cfb){if(_0x5578c4[_0xcf3c('0x56')]&&_0x5578c4[_0xcf3c('0x56')][_0xcf3c('0x57')]){_0x5578c4[_0xcf3c('0x52')]['loginLogo']=_0x5578c4[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')]['find']({'where':{'id':_0x5578c4['params']['id']}})['then'](handleEntityNotFound(_0x2bae67,null))[_0xcf3c('0x31')](saveUpdates(_0x5578c4[_0xcf3c('0x52')],null))['then'](respondWithResult(_0x2bae67,null))[_0xcf3c('0x4e')](handleError(_0x2bae67,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x59')]=function(_0x4084ac,_0x121907,_0x4518dd){var _0x4db5f8=_0xcf3c('0x5a');var _0x32cdec={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x4419e2){if(_0x4419e2){_0x32cdec=_0x4419e2;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x4084ac[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x5c'),_0xcf3c('0x5d'),_0xcf3c('0x5e'),_0xcf3c('0x5f'),_0xcf3c('0x60'),_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x121907,null))[_0xcf3c('0x31')](function(_0x50b802){if(_0x50b802){var _0x19680d=_0x50b802[_0xcf3c('0x5c')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x4db5f8,_[_0xcf3c('0x67')](_0x50b802[_0xcf3c('0x5c')])))?path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x4db5f8,_['toLower'](_0x50b802[_0xcf3c('0x5c')])):path['join'](config[_0xcf3c('0x66')],_0x4db5f8,_[_0xcf3c('0x67')](_0xcf3c('0x68')));var _0x295d39=_0xcf3c('0x69')+_['upperFirst']('logo');if(_0x50b802[_0x295d39]||!_0x32cdec[_0xcf3c('0x6a')]){_0x19680d=path['join'](config['root'],_0x4db5f8,_['toLower'](_0xcf3c('0x68')));}if(!fs[_0xcf3c('0x64')](_0x19680d)){throw new db[(_0xcf3c('0x6b'))][(_0xcf3c('0x6c'))](_['upperFirst'](_0xcf3c('0x5c'))+'\x20not\x20found');}return _0x121907[_0xcf3c('0x6d')](_0x19680d);}})[_0xcf3c('0x4e')](handleError(_0x121907,null));};var utilLicense=require(_0xcf3c('0x1a'));exports['getLogoLogin']=function(_0x29c7ab,_0xe2d51a,_0x3c940d){var _0x95ce18=_0xcf3c('0x5a');var _0x1f2ef2={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x219dc0){if(_0x219dc0){_0x1f2ef2=_0x219dc0;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x29c7ab[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x5c'),_0xcf3c('0x5d'),_0xcf3c('0x5e'),_0xcf3c('0x5f'),'defaultLogo',_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0xe2d51a,null))[_0xcf3c('0x31')](function(_0x381d5b){if(_0x381d5b){var _0xdfd54f=_0x381d5b[_0xcf3c('0x5d')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0x381d5b['loginLogo'])))?path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_['toLower'](_0x381d5b[_0xcf3c('0x5d')])):path['join'](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0xcf3c('0x6e')));var _0x3f9165='default'+_[_0xcf3c('0x6f')](_0xcf3c('0x5d'));if(_0x381d5b[_0x3f9165]||!_0x1f2ef2['custom']){_0xdfd54f=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0xcf3c('0x6e')));}if(!fs[_0xcf3c('0x64')](_0xdfd54f)){throw new db['Sequelize'][(_0xcf3c('0x6c'))](_[_0xcf3c('0x6f')](_0xcf3c('0x5d'))+_0xcf3c('0x70'));}return _0xe2d51a[_0xcf3c('0x6d')](_0xdfd54f);}})[_0xcf3c('0x4e')](handleError(_0xe2d51a,null));};exports[_0xcf3c('0x71')]=function(_0x43763c,_0x4e8ada){return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x43763c[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x72')]})[_0xcf3c('0x31')](respondWithResult(_0x4e8ada,null))['catch'](handleError(_0x4e8ada,null));};exports[_0xcf3c('0x73')]=function(_0x235263,_0x4db968,_0x59eb68){if(_0x235263[_0xcf3c('0x56')]&&_0x235263[_0xcf3c('0x56')][_0xcf3c('0x57')]){_0x235263[_0xcf3c('0x52')][_0xcf3c('0x5e')]=_0x235263[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')]['find']({'where':{'id':_0x235263['params']['id']}})['then'](handleEntityNotFound(_0x4db968,null))['then'](saveUpdates(_0x235263['body'],null))['then'](respondWithResult(_0x4db968,null))['catch'](handleError(_0x4db968,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x74')]=function(_0x21aecd,_0x509239,_0x45df41){var _0x20fb50=_0xcf3c('0x5a');var _0x2c6e5c={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x4994d9){if(_0x4994d9){_0x2c6e5c=_0x4994d9;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x21aecd['params']['id']},'attributes':[_0xcf3c('0x5c'),'loginLogo','preferred',_0xcf3c('0x5f'),_0xcf3c('0x60'),_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x509239,null))[_0xcf3c('0x31')](function(_0x473df3){if(_0x473df3){var _0x181fe0=_0x473df3[_0xcf3c('0x5e')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_['toLower'](_0x473df3[_0xcf3c('0x5e')])))?path['join'](config['root'],_0x20fb50,_[_0xcf3c('0x67')](_0x473df3[_0xcf3c('0x5e')])):path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_['toLower'](_0xcf3c('0x75')));var _0x17d364=_0xcf3c('0x69')+_[_0xcf3c('0x6f')](_0xcf3c('0x5e'));if(_0x473df3[_0x17d364]||!_0x2c6e5c[_0xcf3c('0x6a')]||!_0x2c6e5c[_0xcf3c('0x5e')]){_0x181fe0=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_[_0xcf3c('0x67')](_0xcf3c('0x75')));}if(!fs[_0xcf3c('0x64')](_0x181fe0)){throw new db[(_0xcf3c('0x6b'))][(_0xcf3c('0x6c'))](_[_0xcf3c('0x6f')](_0xcf3c('0x5e'))+_0xcf3c('0x70'));}return _0x509239['download'](_0x181fe0);}})[_0xcf3c('0x4e')](handleError(_0x509239,null));};exports[_0xcf3c('0x76')]=function(_0x501227,_0x36efdf,_0x4cfebf){if(_0x501227[_0xcf3c('0x56')]&&_0x501227['file'][_0xcf3c('0x57')]){_0x501227[_0xcf3c('0x52')][_0xcf3c('0x5f')]=_0x501227[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x501227[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x36efdf,null))[_0xcf3c('0x31')](saveUpdates(_0x501227[_0xcf3c('0x52')],null))['then'](respondWithResult(_0x36efdf,null))['catch'](handleError(_0x36efdf,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x77')]=function(_0x3412f4,_0x2b1153,_0x227087){var _0x23b1af=_0xcf3c('0x5a');var _0x581ead={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x303467){if(_0x303467){_0x581ead=_0x303467;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x3412f4[_0xcf3c('0x54')]['id']},'attributes':['logo','loginLogo',_0xcf3c('0x5e'),'favicon',_0xcf3c('0x60'),_0xcf3c('0x61'),'defaultPreferred',_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x2b1153,null))['then'](function(_0x38ce58){if(_0x38ce58){var _0x255bb4=_0x38ce58[_0xcf3c('0x5f')]&&fs[_0xcf3c('0x64')](path['join'](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0x38ce58['favicon'])))?path[_0xcf3c('0x65')](config['root'],_0x23b1af,_[_0xcf3c('0x67')](_0x38ce58[_0xcf3c('0x5f')])):path['join'](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0xcf3c('0x78')));var _0x36d9eb=_0xcf3c('0x69')+_[_0xcf3c('0x6f')]('favicon');if(_0x38ce58[_0x36d9eb]||!_0x581ead['custom']){_0x255bb4=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0xcf3c('0x78')));}if(!fs['existsSync'](_0x255bb4)){throw new db[(_0xcf3c('0x6b'))]['ValidationError'](_[_0xcf3c('0x6f')](_0xcf3c('0x5f'))+_0xcf3c('0x70'));}return _0x2b1153[_0xcf3c('0x6d')](_0x255bb4);}})['catch'](handleError(_0x2b1153,null));};exports[_0xcf3c('0x79')]=function(_0xf0a123,_0x35ec88){var _0x2a1d6d={'offset':moment()[_0xcf3c('0x7a')]()};_0x2a1d6d['now']=moment()[_0xcf3c('0x7a')](_0x2a1d6d['offset'])[_0xcf3c('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x35ec88[_0xcf3c('0x26')](0xc8)['send'](_0x2a1d6d);}; \ No newline at end of file +var _0xcb06=['fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','options','Setting','includeAll','include','findAll','rows','params','find','addLogo','file','filename','body','logo','addLogoLogin','getLogo','loginLogo','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','download','getLogoLogin','getLicense','preferred','defaultPreferred','default_loginLogo.svg','\x20not\x20found','addPreferred','getPreferred','server/files/images/logos','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','fast-json-patch','moment','mustache','path','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','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','sendStatus','stack','name','send','index','rawAttributes'];(function(_0x5ccffa,_0x372061){var _0x23c9f2=function(_0x237fb7){while(--_0x237fb7){_0x5ccffa['push'](_0x5ccffa['shift']());}};_0x23c9f2(++_0x372061);}(_0xcb06,0x127));var _0x6cb0=function(_0x1f55f3,_0xac0628){_0x1f55f3=_0x1f55f3-0x0;var _0x456d70=_0xcb06[_0x1f55f3];return _0x456d70;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6cb0('0x0'));var rp=require('request-promise');var moment=require(_0x6cb0('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6cb0('0x2'));var util=require('util');var path=require(_0x6cb0('0x3'));var sox=require('sox');var csv=require(_0x6cb0('0x4'));var ejs=require(_0x6cb0('0x5'));var fs=require('fs');var fs_extra=require(_0x6cb0('0x6'));var _=require(_0x6cb0('0x7'));var squel=require(_0x6cb0('0x8'));var crypto=require(_0x6cb0('0x9'));var jsforce=require(_0x6cb0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6cb0('0x4'));var querystring=require(_0x6cb0('0xb'));var Papa=require(_0x6cb0('0xc'));var Redis=require(_0x6cb0('0xd'));var authService=require(_0x6cb0('0xe'));var qs=require(_0x6cb0('0xf'));var as=require(_0x6cb0('0x10'));var hardwareService=require(_0x6cb0('0x11'));var logger=require(_0x6cb0('0x12'))(_0x6cb0('0x13'));var utils=require(_0x6cb0('0x14'));var config=require(_0x6cb0('0x15'));var licenseUtil=require(_0x6cb0('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6cb0('0x17'));var client=jayson[_0x6cb0('0x18')][_0x6cb0('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3c2c2a,_0x53a11d,_0x37409f,_0x3b2b85){return new BPromise(function(_0x362fd4,_0x308793){var _0x307d33=_0x3b2b85||client;return _0x307d33[_0x6cb0('0x1a')](_0x3c2c2a,_0x37409f)['then'](function(_0x7609a){logger[_0x6cb0('0x1b')](_0x6cb0('0x1c'),_0x53a11d,'request\x20sent');logger[_0x6cb0('0x1d')](_0x6cb0('0x1e'),_0x53a11d,_0x6cb0('0x1f'),JSON[_0x6cb0('0x20')](_0x7609a));if(_0x7609a[_0x6cb0('0x21')]){if(_0x7609a[_0x6cb0('0x21')]['code']===0x1f4){logger[_0x6cb0('0x21')](_0x6cb0('0x1c'),_0x53a11d,_0x7609a[_0x6cb0('0x21')][_0x6cb0('0x22')]);return _0x308793(_0x7609a[_0x6cb0('0x21')][_0x6cb0('0x22')]);}logger['error']('Setting,\x20%s,\x20%s',_0x53a11d,_0x7609a[_0x6cb0('0x21')][_0x6cb0('0x22')]);return _0x362fd4(_0x7609a['error']['message']);}else{logger[_0x6cb0('0x1b')](_0x6cb0('0x1c'),_0x53a11d,_0x6cb0('0x1f'));_0x362fd4(_0x7609a['result'][_0x6cb0('0x22')]);}})[_0x6cb0('0x23')](function(_0x3d673e){logger['error'](_0x6cb0('0x1c'),_0x53a11d,_0x3d673e);_0x308793(_0x3d673e);});});}function respondWithStatusCode(_0x3182c0,_0x412eea){_0x412eea=_0x412eea||0xcc;return function(_0x3402b3){if(_0x3402b3){return _0x3182c0['sendStatus'](_0x412eea);}return _0x3182c0[_0x6cb0('0x24')](_0x412eea)[_0x6cb0('0x25')]();};}function respondWithResult(_0x4302e0,_0x4dfe76){_0x4dfe76=_0x4dfe76||0xc8;return function(_0x2c5d78){if(_0x2c5d78){return _0x4302e0[_0x6cb0('0x24')](_0x4dfe76)[_0x6cb0('0x26')](_0x2c5d78);}};}function respondWithFilteredResult(_0x328afd,_0x10e780){return function(_0x23f25b){if(_0x23f25b){var _0x4953d5=typeof _0x10e780[_0x6cb0('0x27')]===_0x6cb0('0x28')&&typeof _0x10e780[_0x6cb0('0x29')]===_0x6cb0('0x28');var _0x5be66e=_0x23f25b[_0x6cb0('0x2a')];var _0x17e55a=_0x4953d5?0x0:_0x10e780['offset'];var _0x838416=_0x4953d5?_0x23f25b['count']:_0x10e780[_0x6cb0('0x27')]+_0x10e780[_0x6cb0('0x29')];var _0x3e1e17;if(_0x838416>=_0x5be66e){_0x838416=_0x5be66e;_0x3e1e17=0xc8;}else{_0x3e1e17=0xce;}_0x328afd[_0x6cb0('0x24')](_0x3e1e17);return _0x328afd[_0x6cb0('0x2b')](_0x6cb0('0x2c'),_0x17e55a+'-'+_0x838416+'/'+_0x5be66e)[_0x6cb0('0x26')](_0x23f25b);}return null;};}function patchUpdates(_0x57a44d){return function(_0x13e9fc){try{jsonpatch['apply'](_0x13e9fc,_0x57a44d,!![]);}catch(_0x4c797e){return BPromise[_0x6cb0('0x2d')](_0x4c797e);}return _0x13e9fc['save']();};}function saveUpdates(_0x37f724,_0x62c91b){return function(_0x3f4b65){if(_0x3f4b65){return _0x3f4b65['update'](_0x37f724)[_0x6cb0('0x2e')](function(_0x56d720){return _0x56d720;});}return null;};}function removeEntity(_0x23d05d,_0x22370d){return function(_0x4a46be){if(_0x4a46be){return _0x4a46be['destroy']()[_0x6cb0('0x2e')](function(){_0x23d05d[_0x6cb0('0x24')](0xcc)[_0x6cb0('0x25')]();});}};}function handleEntityNotFound(_0x5c9867,_0x546d51){return function(_0x24a2a7){if(!_0x24a2a7){_0x5c9867[_0x6cb0('0x2f')](0x194);}return _0x24a2a7;};}function handleError(_0x260260,_0xf78022){_0xf78022=_0xf78022||0x1f4;return function(_0x588ca0){logger[_0x6cb0('0x21')](_0x588ca0[_0x6cb0('0x30')]);if(_0x588ca0['name']){delete _0x588ca0[_0x6cb0('0x31')];}_0x260260[_0x6cb0('0x24')](_0xf78022)[_0x6cb0('0x32')](_0x588ca0);};}exports[_0x6cb0('0x33')]=function(_0x26f2e8,_0xd8bf6c){var _0x3bc191={},_0xb68de7={},_0x3076fc={'count':0x0,'rows':[]};var _0x1e7d28=_['map'](db['Setting'][_0x6cb0('0x34')],function(_0x447d3b){return{'name':_0x447d3b[_0x6cb0('0x35')],'type':_0x447d3b[_0x6cb0('0x36')][_0x6cb0('0x37')]};});_0xb68de7['model']=_[_0x6cb0('0x38')](_0x1e7d28,_0x6cb0('0x31'));_0xb68de7[_0x6cb0('0x39')]=_[_0x6cb0('0x3a')](_0x26f2e8[_0x6cb0('0x39')]);_0xb68de7[_0x6cb0('0x3b')]=_[_0x6cb0('0x3c')](_0xb68de7[_0x6cb0('0x3d')],_0xb68de7['query']);_0x3bc191[_0x6cb0('0x3e')]=_[_0x6cb0('0x3c')](_0xb68de7[_0x6cb0('0x3d')],qs[_0x6cb0('0x3f')](_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x3f')]));_0x3bc191[_0x6cb0('0x3e')]=_0x3bc191[_0x6cb0('0x3e')][_0x6cb0('0x40')]?_0x3bc191['attributes']:_0xb68de7[_0x6cb0('0x3d')];if(!_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x41')]('nolimit')){_0x3bc191[_0x6cb0('0x29')]=qs['limit'](_0x26f2e8['query'][_0x6cb0('0x29')]);_0x3bc191[_0x6cb0('0x27')]=qs[_0x6cb0('0x27')](_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x27')]);}_0x3bc191[_0x6cb0('0x42')]=qs['sort'](_0x26f2e8[_0x6cb0('0x39')]['sort']);_0x3bc191[_0x6cb0('0x43')]=qs['filters'](_[_0x6cb0('0x44')](_0x26f2e8['query'],_0xb68de7[_0x6cb0('0x3b')]),_0x1e7d28);if(_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x45')]){_0x3bc191[_0x6cb0('0x43')]=_[_0x6cb0('0x46')](_0x3bc191[_0x6cb0('0x43')],{'$or':_['map'](_0x1e7d28,function(_0x2c5f28){if(_0x2c5f28[_0x6cb0('0x36')]!=='VIRTUAL'){var _0x4a7886={};_0x4a7886[_0x2c5f28[_0x6cb0('0x31')]]={'$like':'%'+_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x45')]+'%'};return _0x4a7886;}})});}_0x3bc191=_['merge']({},_0x3bc191,_0x26f2e8[_0x6cb0('0x47')]);var _0x384cd6={'where':_0x3bc191[_0x6cb0('0x43')]};return db[_0x6cb0('0x48')][_0x6cb0('0x2a')](_0x384cd6)[_0x6cb0('0x2e')](function(_0x304bf3){_0x3076fc['count']=_0x304bf3;if(_0x26f2e8[_0x6cb0('0x39')][_0x6cb0('0x49')]){_0x3bc191[_0x6cb0('0x4a')]=[{'all':!![]}];}return db[_0x6cb0('0x48')][_0x6cb0('0x4b')](_0x3bc191);})[_0x6cb0('0x2e')](function(_0x495011){_0x3076fc[_0x6cb0('0x4c')]=_0x495011;return _0x3076fc;})[_0x6cb0('0x2e')](respondWithFilteredResult(_0xd8bf6c,_0x3bc191))[_0x6cb0('0x23')](handleError(_0xd8bf6c,null));};exports['show']=function(_0x5478e2,_0x10bf91){var _0xb3ff27={'raw':![],'where':{'id':_0x5478e2[_0x6cb0('0x4d')]['id']}},_0x5331c7={};_0x5331c7[_0x6cb0('0x3d')]=_[_0x6cb0('0x3a')](db[_0x6cb0('0x48')][_0x6cb0('0x34')]);_0x5331c7['query']=_[_0x6cb0('0x3a')](_0x5478e2[_0x6cb0('0x39')]);_0x5331c7[_0x6cb0('0x3b')]=_[_0x6cb0('0x3c')](_0x5331c7[_0x6cb0('0x3d')],_0x5331c7[_0x6cb0('0x39')]);_0xb3ff27[_0x6cb0('0x3e')]=_[_0x6cb0('0x3c')](_0x5331c7['model'],qs[_0x6cb0('0x3f')](_0x5478e2[_0x6cb0('0x39')][_0x6cb0('0x3f')]));_0xb3ff27[_0x6cb0('0x3e')]=_0xb3ff27[_0x6cb0('0x3e')][_0x6cb0('0x40')]?_0xb3ff27[_0x6cb0('0x3e')]:_0x5331c7[_0x6cb0('0x3d')];if(_0x5478e2[_0x6cb0('0x39')]['includeAll']){_0xb3ff27['include']=[{'all':!![]}];}_0xb3ff27=_[_0x6cb0('0x46')]({},_0xb3ff27,_0x5478e2[_0x6cb0('0x47')]);return db['Setting']['find'](_0xb3ff27)['then'](handleEntityNotFound(_0x10bf91,null))[_0x6cb0('0x2e')](respondWithResult(_0x10bf91,null))['catch'](handleError(_0x10bf91,null));};exports['update']=function(_0x480683,_0x8c8d0c){if(_0x480683['body']['id']){delete _0x480683['body']['id'];}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x480683[_0x6cb0('0x4d')]['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x8c8d0c,null))[_0x6cb0('0x2e')](saveUpdates(_0x480683['body'],null))[_0x6cb0('0x2e')](respondWithResult(_0x8c8d0c,null))[_0x6cb0('0x23')](handleError(_0x8c8d0c,null));};exports[_0x6cb0('0x4f')]=function(_0x31e754,_0x454238,_0x286ad9){if(_0x31e754[_0x6cb0('0x50')]&&_0x31e754[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x31e754[_0x6cb0('0x52')][_0x6cb0('0x53')]=_0x31e754[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db['Setting'][_0x6cb0('0x4e')]({'where':{'id':_0x31e754[_0x6cb0('0x4d')]['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x454238,null))[_0x6cb0('0x2e')](saveUpdates(_0x31e754['body'],null))[_0x6cb0('0x2e')](respondWithResult(_0x454238,null))[_0x6cb0('0x23')](handleError(_0x454238,null));};exports[_0x6cb0('0x54')]=function(_0x11283c,_0x3d5081,_0x255110){if(_0x11283c[_0x6cb0('0x50')]&&_0x11283c[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x11283c[_0x6cb0('0x52')]['loginLogo']=_0x11283c[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db['Setting']['find']({'where':{'id':_0x11283c['params']['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x3d5081,null))[_0x6cb0('0x2e')](saveUpdates(_0x11283c[_0x6cb0('0x52')],null))[_0x6cb0('0x2e')](respondWithResult(_0x3d5081,null))[_0x6cb0('0x23')](handleError(_0x3d5081,null));};var utilLicense=require(_0x6cb0('0x16'));exports[_0x6cb0('0x55')]=function(_0x5ec5aa,_0x455278,_0x3f0588){var _0x529395='server/files/images/logos';var _0x5736cd={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x563c63){if(_0x563c63){_0x5736cd=_0x563c63;}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x5ec5aa['params']['id']},'attributes':[_0x6cb0('0x53'),_0x6cb0('0x56'),'preferred',_0x6cb0('0x57'),_0x6cb0('0x58'),_0x6cb0('0x59'),'defaultPreferred',_0x6cb0('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x455278,null))[_0x6cb0('0x2e')](function(_0x1c70dd){if(_0x1c70dd){var _0x16e640=_0x1c70dd[_0x6cb0('0x53')]&&fs['existsSync'](path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x529395,_[_0x6cb0('0x5d')](_0x1c70dd['logo'])))?path['join'](config[_0x6cb0('0x5c')],_0x529395,_[_0x6cb0('0x5d')](_0x1c70dd[_0x6cb0('0x53')])):path['join'](config['root'],_0x529395,_[_0x6cb0('0x5d')](_0x6cb0('0x5e')));var _0x20d78f=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x53'));if(_0x1c70dd[_0x20d78f]||!_0x5736cd[_0x6cb0('0x61')]){_0x16e640=path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x529395,_['toLower']('default_logo.svg'));}if(!fs[_0x6cb0('0x62')](_0x16e640)){throw new db[(_0x6cb0('0x63'))][(_0x6cb0('0x64'))](_[_0x6cb0('0x60')](_0x6cb0('0x53'))+'\x20not\x20found');}return _0x455278[_0x6cb0('0x65')](_0x16e640);}})[_0x6cb0('0x23')](handleError(_0x455278,null));};var utilLicense=require(_0x6cb0('0x16'));exports[_0x6cb0('0x66')]=function(_0x250d3b,_0x386127,_0x3efe68){var _0x426003='server/files/images/logos';var _0x59390a={'custom':![]};return utilLicense[_0x6cb0('0x67')]()[_0x6cb0('0x2e')](function(_0x31b07a){if(_0x31b07a){_0x59390a=_0x31b07a;}return db['Setting']['find']({'where':{'id':_0x250d3b['params']['id']},'attributes':['logo','loginLogo',_0x6cb0('0x68'),_0x6cb0('0x57'),_0x6cb0('0x58'),'defaultLoginLogo',_0x6cb0('0x69'),_0x6cb0('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x386127,null))[_0x6cb0('0x2e')](function(_0x709772){if(_0x709772){var _0x35ecf9=_0x709772[_0x6cb0('0x56')]&&fs[_0x6cb0('0x62')](path[_0x6cb0('0x5b')](config['root'],_0x426003,_['toLower'](_0x709772['loginLogo'])))?path['join'](config[_0x6cb0('0x5c')],_0x426003,_['toLower'](_0x709772[_0x6cb0('0x56')])):path['join'](config[_0x6cb0('0x5c')],_0x426003,_[_0x6cb0('0x5d')](_0x6cb0('0x6a')));var _0x2462db=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x56'));if(_0x709772[_0x2462db]||!_0x59390a[_0x6cb0('0x61')]){_0x35ecf9=path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x426003,_[_0x6cb0('0x5d')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x35ecf9)){throw new db['Sequelize']['ValidationError'](_[_0x6cb0('0x60')]('loginLogo')+_0x6cb0('0x6b'));}return _0x386127[_0x6cb0('0x65')](_0x35ecf9);}})[_0x6cb0('0x23')](handleError(_0x386127,null));};exports['gdpr']=function(_0x18d748,_0x5e880a){return db[_0x6cb0('0x48')]['find']({'where':{'id':_0x18d748[_0x6cb0('0x4d')]['id']},'attributes':['securePassword']})[_0x6cb0('0x2e')](respondWithResult(_0x5e880a,null))[_0x6cb0('0x23')](handleError(_0x5e880a,null));};exports[_0x6cb0('0x6c')]=function(_0x28fb20,_0x2a07cd,_0x59e34f){if(_0x28fb20['file']&&_0x28fb20[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x28fb20[_0x6cb0('0x52')][_0x6cb0('0x68')]=_0x28fb20[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x28fb20['params']['id']}})[_0x6cb0('0x2e')](handleEntityNotFound(_0x2a07cd,null))['then'](saveUpdates(_0x28fb20['body'],null))['then'](respondWithResult(_0x2a07cd,null))[_0x6cb0('0x23')](handleError(_0x2a07cd,null));};var utilLicense=require(_0x6cb0('0x16'));exports[_0x6cb0('0x6d')]=function(_0x3acba1,_0x5b8026,_0x130e82){var _0x49f408=_0x6cb0('0x6e');var _0x522f8b={'custom':![]};return utilLicense[_0x6cb0('0x67')]()[_0x6cb0('0x2e')](function(_0x36cbf6){if(_0x36cbf6){_0x522f8b=_0x36cbf6;}return db['Setting'][_0x6cb0('0x4e')]({'where':{'id':_0x3acba1[_0x6cb0('0x4d')]['id']},'attributes':['logo',_0x6cb0('0x56'),'preferred',_0x6cb0('0x57'),'defaultLogo','defaultLoginLogo',_0x6cb0('0x69'),_0x6cb0('0x5a')],'raw':!![]});})[_0x6cb0('0x2e')](handleEntityNotFound(_0x5b8026,null))[_0x6cb0('0x2e')](function(_0x151597){if(_0x151597){var _0xb5d208=_0x151597[_0x6cb0('0x68')]&&fs[_0x6cb0('0x62')](path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x49f408,_[_0x6cb0('0x5d')](_0x151597[_0x6cb0('0x68')])))?path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x49f408,_[_0x6cb0('0x5d')](_0x151597[_0x6cb0('0x68')])):path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x49f408,_[_0x6cb0('0x5d')]('default_preferred.png'));var _0x4f1006=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x68'));if(_0x151597[_0x4f1006]||!_0x522f8b[_0x6cb0('0x61')]||!_0x522f8b[_0x6cb0('0x68')]){_0xb5d208=path[_0x6cb0('0x5b')](config['root'],_0x49f408,_['toLower']('default_preferred.png'));}if(!fs[_0x6cb0('0x62')](_0xb5d208)){throw new db[(_0x6cb0('0x63'))][(_0x6cb0('0x64'))](_[_0x6cb0('0x60')]('preferred')+'\x20not\x20found');}return _0x5b8026[_0x6cb0('0x65')](_0xb5d208);}})[_0x6cb0('0x23')](handleError(_0x5b8026,null));};exports['addFavicon']=function(_0x14effc,_0x229308,_0x107dd4){if(_0x14effc[_0x6cb0('0x50')]&&_0x14effc[_0x6cb0('0x50')][_0x6cb0('0x51')]){_0x14effc[_0x6cb0('0x52')][_0x6cb0('0x57')]=_0x14effc[_0x6cb0('0x50')][_0x6cb0('0x51')];}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x14effc[_0x6cb0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x229308,null))[_0x6cb0('0x2e')](saveUpdates(_0x14effc[_0x6cb0('0x52')],null))['then'](respondWithResult(_0x229308,null))[_0x6cb0('0x23')](handleError(_0x229308,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x1c5251,_0x1d95cd,_0x8f379){var _0x1919f3=_0x6cb0('0x6e');var _0x5f08a2={'custom':![]};return utilLicense[_0x6cb0('0x67')]()[_0x6cb0('0x2e')](function(_0x5188a2){if(_0x5188a2){_0x5f08a2=_0x5188a2;}return db[_0x6cb0('0x48')][_0x6cb0('0x4e')]({'where':{'id':_0x1c5251[_0x6cb0('0x4d')]['id']},'attributes':[_0x6cb0('0x53'),_0x6cb0('0x56'),'preferred','favicon',_0x6cb0('0x58'),'defaultLoginLogo',_0x6cb0('0x69'),_0x6cb0('0x5a')],'raw':!![]});})[_0x6cb0('0x2e')](handleEntityNotFound(_0x1d95cd,null))[_0x6cb0('0x2e')](function(_0x2215d4){if(_0x2215d4){var _0x21f67f=_0x2215d4['favicon']&&fs['existsSync'](path['join'](config['root'],_0x1919f3,_[_0x6cb0('0x5d')](_0x2215d4[_0x6cb0('0x57')])))?path['join'](config['root'],_0x1919f3,_['toLower'](_0x2215d4[_0x6cb0('0x57')])):path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x1919f3,_[_0x6cb0('0x5d')](_0x6cb0('0x6f')));var _0x1678d2=_0x6cb0('0x5f')+_[_0x6cb0('0x60')](_0x6cb0('0x57'));if(_0x2215d4[_0x1678d2]||!_0x5f08a2['custom']){_0x21f67f=path[_0x6cb0('0x5b')](config[_0x6cb0('0x5c')],_0x1919f3,_['toLower'](_0x6cb0('0x6f')));}if(!fs[_0x6cb0('0x62')](_0x21f67f)){throw new db[(_0x6cb0('0x63'))][(_0x6cb0('0x64'))](_[_0x6cb0('0x60')](_0x6cb0('0x57'))+'\x20not\x20found');}return _0x1d95cd[_0x6cb0('0x65')](_0x21f67f);}})['catch'](handleError(_0x1d95cd,null));};exports[_0x6cb0('0x70')]=function(_0x2c1e8c,_0x11384b){var _0x1952d4={'offset':moment()[_0x6cb0('0x71')]()};_0x1952d4['now']=moment()[_0x6cb0('0x71')](_0x1952d4[_0x6cb0('0x27')])[_0x6cb0('0x72')](_0x6cb0('0x73'));return _0x11384b[_0x6cb0('0x24')](0xc8)[_0x6cb0('0x32')](_0x1952d4);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 73ee057..91d534f 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x10b843,_0x2d080e){var _0x2e73b3=function(_0x16e740){while(--_0x16e740){_0x10b843['push'](_0x10b843['shift']());}};_0x2e73b3(++_0x2d080e);}(_0x34e8,0x12c));var _0x834e=function(_0x450e62,_0x1fee16){_0x450e62=_0x450e62-0x0;var _0xbce92a=_0x34e8[_0x450e62];return _0xbce92a;};'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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_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':'settings','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 3994ec5..f1f3466 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 _0xa3d1=['options','raw','where','attributes','include','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ShowSetting','Setting','find'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xa3d1,0x93));var _0x1a3d=function(_0x98a662,_0x764308){_0x98a662=_0x98a662-0x0;var _0x2a5962=_0xa3d1[_0x98a662];return _0x2a5962;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var moment=require(_0x1a3d('0x2'));var BPromise=require(_0x1a3d('0x3'));var rs=require(_0x1a3d('0x4'));var fs=require('fs');var Redis=require(_0x1a3d('0x5'));var db=require(_0x1a3d('0x6'))['db'];var utils=require(_0x1a3d('0x7'));var logger=require(_0x1a3d('0x8'))(_0x1a3d('0x9'));var config=require(_0x1a3d('0xa'));var jayson=require(_0x1a3d('0xb'));var client=jayson[_0x1a3d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x491c1c,_0x2559b0,_0x4b4494){return new BPromise(function(_0x16a59a,_0x41c436){return client[_0x1a3d('0xd')](_0x491c1c,_0x4b4494)[_0x1a3d('0xe')](function(_0x139931){logger['info'](_0x1a3d('0xf'),_0x2559b0,'request\x20sent');logger[_0x1a3d('0x10')](_0x1a3d('0x11'),_0x2559b0,_0x1a3d('0x12'),JSON[_0x1a3d('0x13')](_0x139931));if(_0x139931[_0x1a3d('0x14')]){if(_0x139931['error'][_0x1a3d('0x15')]===0x1f4){logger[_0x1a3d('0x14')](_0x1a3d('0xf'),_0x2559b0,_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);return _0x41c436(_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);}logger[_0x1a3d('0x14')](_0x1a3d('0xf'),_0x2559b0,_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);return _0x16a59a(_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);}else{logger[_0x1a3d('0x17')]('Setting,\x20%s,\x20%s',_0x2559b0,_0x1a3d('0x12'));_0x16a59a(_0x139931[_0x1a3d('0x18')][_0x1a3d('0x16')]);}})['catch'](function(_0x7652f1){logger[_0x1a3d('0x14')](_0x1a3d('0xf'),_0x2559b0,_0x7652f1);_0x41c436(_0x7652f1);});});}exports[_0x1a3d('0x19')]=function(_0x15ae3d){var _0x180a3f=this;return new Promise(function(_0x442c9a,_0x1e290f){return db[_0x1a3d('0x1a')][_0x1a3d('0x1b')]({'raw':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x1e')]||null:null,'attributes':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d['options'][_0x1a3d('0x1f')]||null:null,'include':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x20')]?_[_0x1a3d('0x21')](_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x20')],function(_0x3ea335){return{'model':db[_0x3ea335['model']],'as':_0x3ea335['as'],'attributes':_0x3ea335[_0x1a3d('0x1f')],'include':_0x3ea335[_0x1a3d('0x20')]?_[_0x1a3d('0x21')](_0x3ea335['include'],function(_0x238629){return{'model':db[_0x238629['model']],'as':_0x238629['as'],'attributes':_0x238629[_0x1a3d('0x1f')],'include':_0x238629[_0x1a3d('0x20')]?_[_0x1a3d('0x21')](_0x238629[_0x1a3d('0x20')],function(_0x2e826a){return{'model':db[_0x2e826a['model']],'as':_0x2e826a['as'],'attributes':_0x2e826a[_0x1a3d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24e07e){logger['info']('ShowSetting',_0x15ae3d);logger[_0x1a3d('0x10')](_0x1a3d('0x19'),_0x15ae3d,JSON[_0x1a3d('0x13')](_0x24e07e));_0x442c9a(_0x24e07e);})[_0x1a3d('0x22')](function(_0x29603f){logger[_0x1a3d('0x14')](_0x1a3d('0x19'),_0x29603f[_0x1a3d('0x16')],_0x15ae3d);_0x1e290f(_0x180a3f['error'](0x1f4,_0x29603f[_0x1a3d('0x16')]));});});}; \ No newline at end of file +var _0xaae9=['Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','options','raw','attributes','include','map','model','debug','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x578644,_0x38e061){var _0x2340ef=function(_0x8bab5){while(--_0x8bab5){_0x578644['push'](_0x578644['shift']());}};_0x2340ef(++_0x38e061);}(_0xaae9,0x6a));var _0x9aae=function(_0x1ee206,_0x4eca26){_0x1ee206=_0x1ee206-0x0;var _0x36c57b=_0xaae9[_0x1ee206];return _0x36c57b;};'use strict';var _=require(_0x9aae('0x0'));var util=require(_0x9aae('0x1'));var moment=require('moment');var BPromise=require(_0x9aae('0x2'));var rs=require(_0x9aae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9aae('0x4'))['db'];var utils=require(_0x9aae('0x5'));var logger=require(_0x9aae('0x6'))('rpc');var config=require(_0x9aae('0x7'));var jayson=require(_0x9aae('0x8'));var client=jayson[_0x9aae('0x9')][_0x9aae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1018b6,_0x105d4b,_0x1ecdcd){return new BPromise(function(_0x4bc225,_0x4747f3){return client[_0x9aae('0xb')](_0x1018b6,_0x1ecdcd)[_0x9aae('0xc')](function(_0x54ef73){logger[_0x9aae('0xd')]('Setting,\x20%s,\x20%s',_0x105d4b,_0x9aae('0xe'));logger['debug'](_0x9aae('0xf'),_0x105d4b,_0x9aae('0xe'),JSON[_0x9aae('0x10')](_0x54ef73));if(_0x54ef73[_0x9aae('0x11')]){if(_0x54ef73[_0x9aae('0x11')]['code']===0x1f4){logger[_0x9aae('0x11')](_0x9aae('0x12'),_0x105d4b,_0x54ef73['error'][_0x9aae('0x13')]);return _0x4747f3(_0x54ef73[_0x9aae('0x11')][_0x9aae('0x13')]);}logger['error'](_0x9aae('0x12'),_0x105d4b,_0x54ef73[_0x9aae('0x11')]['message']);return _0x4bc225(_0x54ef73['error'][_0x9aae('0x13')]);}else{logger[_0x9aae('0xd')](_0x9aae('0x12'),_0x105d4b,_0x9aae('0xe'));_0x4bc225(_0x54ef73[_0x9aae('0x14')]['message']);}})['catch'](function(_0x4272df){logger[_0x9aae('0x11')]('Setting,\x20%s,\x20%s',_0x105d4b,_0x4272df);_0x4747f3(_0x4272df);});});}exports[_0x9aae('0x15')]=function(_0x3ec155){var _0x4e55ad=this;return new Promise(function(_0x2da310,_0xbe2a99){return db[_0x9aae('0x16')]['find']({'raw':_0x3ec155[_0x9aae('0x17')]?_0x3ec155[_0x9aae('0x17')][_0x9aae('0x18')]===undefined?!![]:![]:!![],'where':_0x3ec155[_0x9aae('0x17')]?_0x3ec155[_0x9aae('0x17')]['where']||null:null,'attributes':_0x3ec155['options']?_0x3ec155[_0x9aae('0x17')][_0x9aae('0x19')]||null:null,'include':_0x3ec155[_0x9aae('0x17')]?_0x3ec155[_0x9aae('0x17')][_0x9aae('0x1a')]?_[_0x9aae('0x1b')](_0x3ec155[_0x9aae('0x17')][_0x9aae('0x1a')],function(_0x41932e){return{'model':db[_0x41932e[_0x9aae('0x1c')]],'as':_0x41932e['as'],'attributes':_0x41932e['attributes'],'include':_0x41932e[_0x9aae('0x1a')]?_['map'](_0x41932e[_0x9aae('0x1a')],function(_0x167aeb){return{'model':db[_0x167aeb[_0x9aae('0x1c')]],'as':_0x167aeb['as'],'attributes':_0x167aeb[_0x9aae('0x19')],'include':_0x167aeb['include']?_[_0x9aae('0x1b')](_0x167aeb['include'],function(_0x206c80){return{'model':db[_0x206c80[_0x9aae('0x1c')]],'as':_0x206c80['as'],'attributes':_0x206c80[_0x9aae('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9aae('0xc')](function(_0x483382){logger[_0x9aae('0xd')](_0x9aae('0x15'),_0x3ec155);logger[_0x9aae('0x1d')](_0x9aae('0x15'),_0x3ec155,JSON[_0x9aae('0x10')](_0x483382));_0x2da310(_0x483382);})[_0x9aae('0x1e')](function(_0x38a7c3){logger[_0x9aae('0x11')]('ShowSetting',_0x38a7c3[_0x9aae('0x13')],_0x3ec155);_0xbe2a99(_0x4e55ad[_0x9aae('0x11')](0x1f4,_0x38a7c3[_0x9aae('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b755be6..8df2c25 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 _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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x228805,_0x17a7b2){_0x228805=_0x228805-0x0;var _0x132673=_0x1cb9[_0x228805];return _0x132673;};'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 +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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1a75d0,_0x468c73){_0x1a75d0=_0x1a75d0-0x0;var _0x5f0cd1=_0x1cb9[_0x1a75d0];return _0x5f0cd1;};'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 2015416..c7a3c6d 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 _0xda49=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda49,0x149));var _0x9da4=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xda49[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x9da4('0x0'));var rs=require('randomstring');module[_0x9da4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9da4('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x9da4('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9da4('0x3')],'defaultValue':function(){return rs[_0x9da4('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9da4('0x5')](_0x9da4('0x6'),_0x9da4('0x7'),'connectel',_0x9da4('0x8'),_0x9da4('0x9'),_0x9da4('0xa'),_0x9da4('0xb'),_0x9da4('0xc'),'infobip',_0x9da4('0xd'))},'accountSid':{'type':Sequelize[_0x9da4('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x9da4('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9da4('0x3')]},'password':{'type':Sequelize[_0x9da4('0x3')]},'apiKey':{'type':Sequelize[_0x9da4('0x3')]},'applicationId':{'type':Sequelize[_0x9da4('0x3')]},'accountId':{'type':Sequelize[_0x9da4('0x3')]},'senderString':{'type':Sequelize[_0x9da4('0x3')]},'deliveryReport':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9da4('0xf')],'defaultValue':function(){return _0x9da4('0x10');}},'notificationSound':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9da4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9da4('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9da4('0x11')],'comment':_0x9da4('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![],'comment':_0x9da4('0x13'),'set':function(_0x2391f5){if(!_0x2391f5)this[_0x9da4('0x14')](_0x9da4('0x15'),null);this[_0x9da4('0x14')](_0x9da4('0x16'),_0x2391f5);}}}; \ No newline at end of file +var _0xcca0=['STRING','generate','ENUM','twilio','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0x10421f,_0x46f58d){var _0x356fa4=function(_0x4fdaf2){while(--_0x4fdaf2){_0x10421f['push'](_0x10421f['shift']());}};_0x356fa4(++_0x46f58d);}(_0xcca0,0x1b1));var _0x0cca=function(_0x46a085,_0x33fa72){_0x46a085=_0x46a085-0x0;var _0x57d64f=_0xcca0[_0x46a085];return _0x57d64f;};'use strict';var Sequelize=require(_0x0cca('0x0'));var rs=require(_0x0cca('0x1'));module[_0x0cca('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x0cca('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x0cca('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x0cca('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0cca('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0cca('0x6')](_0x0cca('0x7'),'skebby',_0x0cca('0x8'),_0x0cca('0x9'),_0x0cca('0xa'),'clickatell',_0x0cca('0xb'),_0x0cca('0xc'),_0x0cca('0xd'),_0x0cca('0xe'))},'accountSid':{'type':Sequelize[_0x0cca('0x4')]},'authId':{'type':Sequelize[_0x0cca('0x4')]},'authToken':{'type':Sequelize[_0x0cca('0x4')]},'smsMethod':{'type':Sequelize[_0x0cca('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0cca('0x4')]},'password':{'type':Sequelize[_0x0cca('0x4')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x0cca('0x4')]},'accountId':{'type':Sequelize[_0x0cca('0x4')]},'senderString':{'type':Sequelize[_0x0cca('0x4')]},'deliveryReport':{'type':Sequelize[_0x0cca('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x0cca('0x4')]},'notificationTemplate':{'type':Sequelize[_0x0cca('0x10')],'defaultValue':function(){return _0x0cca('0x11');}},'notificationSound':{'type':Sequelize[_0x0cca('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0cca('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0cca('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0cca('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0cca('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0cca('0x12')],'comment':_0x0cca('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x0cca('0xf')],'defaultValue':![],'comment':_0x0cca('0x14'),'set':function(_0x4c21ea){if(!_0x4c21ea)this[_0x0cca('0x15')]('mandatoryDispositionPauseId',null);this[_0x0cca('0x15')](_0x0cca('0x16'),_0x4c21ea);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5b06082..bf9e885 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 _0xce9a=['api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','get','SmsAccounts','UserProfileResource','destroy','stack','name','send','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','mandatoryDispositionPause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','sms','applications','Applications','priority','asc','account','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','From','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','messageId','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','refid','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','CmContact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','Start','startRouting','entity\x20found','twilio','Content-Type','text/xml','\x0a','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','finally','getApplications','Owner','fullname','internal','Tag','Tags','color','tag','CmList','List','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','message-id','state','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x47f0de,_0xe12c95){var _0x2fd5d2=function(_0x307ef9){while(--_0x307ef9){_0x47f0de['push'](_0x47f0de['shift']());}};_0x2fd5d2(++_0xe12c95);}(_0xce9a,0xc9));var _0xace9=function(_0x4bfb89,_0x1c03dd){_0x4bfb89=_0x4bfb89-0x0;var _0x341f09=_0xce9a[_0x4bfb89];return _0x341f09;};'use strict';var emlformat=require(_0xace9('0x0'));var rimraf=require(_0xace9('0x1'));var zipdir=require(_0xace9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xace9('0x3'));var BPromise=require(_0xace9('0x4'));var Mustache=require(_0xace9('0x5'));var util=require(_0xace9('0x6'));var path=require(_0xace9('0x7'));var sox=require('sox');var csv=require(_0xace9('0x8'));var ejs=require(_0xace9('0x9'));var fs=require('fs');var fs_extra=require(_0xace9('0xa'));var _=require(_0xace9('0xb'));var squel=require(_0xace9('0xc'));var crypto=require(_0xace9('0xd'));var jsforce=require(_0xace9('0xe'));var deskjs=require(_0xace9('0xf'));var toCsv=require(_0xace9('0x8'));var querystring=require(_0xace9('0x10'));var Papa=require('papaparse');var Redis=require(_0xace9('0x11'));var authService=require(_0xace9('0x12'));var qs=require(_0xace9('0x13'));var as=require(_0xace9('0x14'));var hardwareService=require(_0xace9('0x15'));var logger=require(_0xace9('0x16'))(_0xace9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace9('0x18'));var db=require(_0xace9('0x19'))['db'];config[_0xace9('0x1a')]=_[_0xace9('0x1b')](config[_0xace9('0x1a')],{'host':_0xace9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xace9('0x1a')]));require(_0xace9('0x1d'))[_0xace9('0x1e')](socket);var jayson=require(_0xace9('0x1f'));var client=jayson[_0xace9('0x20')][_0xace9('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2eb1e3,_0x19ffd7,_0x51f08b,_0x585f11){return new BPromise(function(_0x49e6b4,_0x1b5a29){var _0x32a7fa=_0x585f11||client;return _0x32a7fa[_0xace9('0x22')](_0x2eb1e3,_0x51f08b)[_0xace9('0x23')](function(_0x2d6adb){logger[_0xace9('0x24')](_0xace9('0x25'),_0x19ffd7,_0xace9('0x26'));logger[_0xace9('0x27')](_0xace9('0x28'),_0x19ffd7,_0xace9('0x26'),JSON[_0xace9('0x29')](_0x2d6adb));if(_0x2d6adb[_0xace9('0x2a')]){if(_0x2d6adb['error'][_0xace9('0x2b')]===0x1f4){logger[_0xace9('0x2a')](_0xace9('0x25'),_0x19ffd7,_0x2d6adb[_0xace9('0x2a')][_0xace9('0x2c')]);return _0x1b5a29(_0x2d6adb[_0xace9('0x2a')][_0xace9('0x2c')]);}logger[_0xace9('0x2a')](_0xace9('0x25'),_0x19ffd7,_0x2d6adb[_0xace9('0x2a')][_0xace9('0x2c')]);return _0x49e6b4(_0x2d6adb[_0xace9('0x2a')]['message']);}else{logger[_0xace9('0x24')](_0xace9('0x25'),_0x19ffd7,_0xace9('0x26'));_0x49e6b4(_0x2d6adb['result'][_0xace9('0x2c')]);}})[_0xace9('0x2d')](function(_0x33be70){logger[_0xace9('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x19ffd7,_0x33be70);_0x1b5a29(_0x33be70);});});}function respondWithStatusCode(_0x4f75d0,_0x5307fe){_0x5307fe=_0x5307fe||0xcc;return function(_0x2fb9ce){if(_0x2fb9ce){return _0x4f75d0[_0xace9('0x2e')](_0x5307fe);}return _0x4f75d0[_0xace9('0x2f')](_0x5307fe)[_0xace9('0x30')]();};}function respondWithResult(_0x252fca,_0x112697){_0x112697=_0x112697||0xc8;return function(_0x1b88ad){if(_0x1b88ad){return _0x252fca[_0xace9('0x2f')](_0x112697)[_0xace9('0x31')](_0x1b88ad);}};}function respondWithFilteredResult(_0x1b845f,_0xaa8f16){return function(_0x1bb789){if(_0x1bb789){var _0x554b0e=typeof _0xaa8f16[_0xace9('0x32')]===_0xace9('0x33')&&typeof _0xaa8f16[_0xace9('0x34')]===_0xace9('0x33');var _0x3be3cc=_0x1bb789[_0xace9('0x35')];var _0x442a73=_0x554b0e?0x0:_0xaa8f16['offset'];var _0x5261fb=_0x554b0e?_0x1bb789[_0xace9('0x35')]:_0xaa8f16[_0xace9('0x32')]+_0xaa8f16[_0xace9('0x34')];var _0x5cc746;if(_0x5261fb>=_0x3be3cc){_0x5261fb=_0x3be3cc;_0x5cc746=0xc8;}else{_0x5cc746=0xce;}_0x1b845f[_0xace9('0x2f')](_0x5cc746);return _0x1b845f[_0xace9('0x36')](_0xace9('0x37'),_0x442a73+'-'+_0x5261fb+'/'+_0x3be3cc)[_0xace9('0x31')](_0x1bb789);}return null;};}function patchUpdates(_0x42e983){return function(_0x163c66){try{jsonpatch['apply'](_0x163c66,_0x42e983,!![]);}catch(_0x396c60){return BPromise[_0xace9('0x38')](_0x396c60);}return _0x163c66['save']();};}function saveUpdates(_0x50ac3c,_0x3130fe){return function(_0x8408d2){if(_0x8408d2){return _0x8408d2[_0xace9('0x39')](_0x50ac3c)[_0xace9('0x23')](function(_0x237bcf){return _0x237bcf;});}return null;};}function removeEntity(_0x533f73,_0x2eedf7){return function(_0x27a7de){if(_0x27a7de){return _0x27a7de['destroy']()[_0xace9('0x23')](function(){var _0x427778=_0x27a7de[_0xace9('0x3a')]({'plain':!![]});var _0x5f37d4=_0xace9('0x3b');return db[_0xace9('0x3c')][_0xace9('0x3d')]({'where':{'type':_0x5f37d4,'resourceId':_0x427778['id']}})[_0xace9('0x23')](function(){return _0x27a7de;});})[_0xace9('0x23')](function(){_0x533f73[_0xace9('0x2f')](0xcc)[_0xace9('0x30')]();});}};}function handleEntityNotFound(_0x1c192d,_0x3ed35d){return function(_0x5bbe1f){if(!_0x5bbe1f){_0x1c192d[_0xace9('0x2e')](0x194);}return _0x5bbe1f;};}function handleError(_0x38205a,_0x50847e){_0x50847e=_0x50847e||0x1f4;return function(_0x223d8a){logger[_0xace9('0x2a')](_0x223d8a[_0xace9('0x3e')]);if(_0x223d8a[_0xace9('0x3f')]){delete _0x223d8a[_0xace9('0x3f')];}_0x38205a[_0xace9('0x2f')](_0x50847e)[_0xace9('0x40')](_0x223d8a);};}exports['index']=function(_0x2bce1b,_0x3d3d74){var _0x500530={'include':[{'model':db[_0xace9('0x41')],'as':'mandatoryDispositionPause'}]},_0x46168e={},_0x3fcc0e={'count':0x0,'rows':[]};var _0x469ad0=_[_0xace9('0x42')](db[_0xace9('0x43')][_0xace9('0x44')],function(_0x18da85){return{'name':_0x18da85[_0xace9('0x45')],'type':_0x18da85[_0xace9('0x46')][_0xace9('0x47')]};});_0x46168e[_0xace9('0x48')]=_['map'](_0x469ad0,'name');_0x46168e[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x2bce1b[_0xace9('0x49')]);_0x46168e[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x46168e[_0xace9('0x48')],_0x46168e['query']);_0x500530[_0xace9('0x4d')]=_['intersection'](_0x46168e[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x2bce1b[_0xace9('0x49')][_0xace9('0x4e')]));_0x500530[_0xace9('0x4d')]=_0x500530[_0xace9('0x4d')][_0xace9('0x4f')]?_0x500530['attributes']:_0x46168e[_0xace9('0x48')];if(!_0x2bce1b[_0xace9('0x49')][_0xace9('0x50')](_0xace9('0x51'))){_0x500530[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x2bce1b[_0xace9('0x49')][_0xace9('0x34')]);_0x500530[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x2bce1b[_0xace9('0x49')][_0xace9('0x32')]);}_0x500530[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x2bce1b['query'][_0xace9('0x53')]);_0x500530[_0xace9('0x54')]=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x2bce1b[_0xace9('0x49')],_0x46168e[_0xace9('0x4b')]),_0x469ad0);if(_0x2bce1b[_0xace9('0x49')]['filter']){_0x500530['where']=_[_0xace9('0x56')](_0x500530[_0xace9('0x54')],{'$or':_[_0xace9('0x42')](_0x469ad0,function(_0x1197f7){if(_0x1197f7[_0xace9('0x46')]!==_0xace9('0x57')){var _0x5565f8={};_0x5565f8[_0x1197f7[_0xace9('0x3f')]]={'$like':'%'+_0x2bce1b['query'][_0xace9('0x58')]+'%'};return _0x5565f8;}})});}_0x500530=_['merge']({},_0x500530,_0x2bce1b[_0xace9('0x59')]);var _0x270ecb={'where':_0x500530[_0xace9('0x54')]};return db[_0xace9('0x43')][_0xace9('0x35')](_0x270ecb)[_0xace9('0x23')](function(_0x59fa79){_0x3fcc0e[_0xace9('0x35')]=_0x59fa79;if(_0x2bce1b[_0xace9('0x49')][_0xace9('0x5a')]){_0x500530[_0xace9('0x5b')]=[{'all':!![]}];}return db[_0xace9('0x43')][_0xace9('0x5c')](_0x500530);})[_0xace9('0x23')](function(_0x2650ba){_0x3fcc0e[_0xace9('0x5d')]=_0x2650ba;return _0x3fcc0e;})[_0xace9('0x23')](respondWithFilteredResult(_0x3d3d74,_0x500530))[_0xace9('0x2d')](handleError(_0x3d3d74,null));};exports[_0xace9('0x5e')]=function(_0x3ff0b7,_0x278e57){var _0x3bcf8d={'raw':![],'where':{'id':_0x3ff0b7[_0xace9('0x5f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x59a3d1={};_0x59a3d1[_0xace9('0x48')]=_[_0xace9('0x4a')](db['SmsAccount'][_0xace9('0x44')]);_0x59a3d1[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x3ff0b7['query']);_0x59a3d1[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x59a3d1[_0xace9('0x48')],_0x59a3d1[_0xace9('0x49')]);_0x3bcf8d[_0xace9('0x4d')]=_[_0xace9('0x4c')](_0x59a3d1[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x3ff0b7[_0xace9('0x49')]['fields']));_0x3bcf8d[_0xace9('0x4d')]=_0x3bcf8d[_0xace9('0x4d')]['length']?_0x3bcf8d['attributes']:_0x59a3d1['model'];if(_0x3ff0b7[_0xace9('0x49')][_0xace9('0x5a')]){_0x3bcf8d[_0xace9('0x5b')]=[{'all':!![]}];}_0x3bcf8d=_[_0xace9('0x56')]({},_0x3bcf8d,_0x3ff0b7[_0xace9('0x59')]);return db[_0xace9('0x43')]['find'](_0x3bcf8d)[_0xace9('0x23')](handleEntityNotFound(_0x278e57,null))[_0xace9('0x23')](respondWithResult(_0x278e57,null))[_0xace9('0x2d')](handleError(_0x278e57,null));};exports[_0xace9('0x60')]=function(_0x3405f4,_0x57a283){return db[_0xace9('0x43')][_0xace9('0x60')](_0x3405f4[_0xace9('0x61')],{})['then'](function(_0x5a6b27){var _0x29ec7d=_0x3405f4[_0xace9('0x62')][_0xace9('0x3a')]({'plain':!![]});if(!_0x29ec7d)throw new Error(_0xace9('0x63'));if(_0x29ec7d[_0xace9('0x64')]===_0xace9('0x62')){var _0x455691=_0x5a6b27['get']({'plain':!![]});var _0x17adc7=_0xace9('0x3b');return db['UserProfileSection'][_0xace9('0x65')]({'where':{'name':_0x17adc7,'userProfileId':_0x29ec7d[_0xace9('0x66')]},'raw':!![]})[_0xace9('0x23')](function(_0x21a5b2){if(_0x21a5b2&&_0x21a5b2[_0xace9('0x67')]===0x0){return db[_0xace9('0x3c')][_0xace9('0x60')]({'name':_0x455691[_0xace9('0x3f')],'resourceId':_0x455691['id'],'type':_0x21a5b2[_0xace9('0x3f')],'sectionId':_0x21a5b2['id']},{})[_0xace9('0x23')](function(){return _0x5a6b27;});}else{return _0x5a6b27;}})[_0xace9('0x2d')](function(_0x41eba6){logger[_0xace9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41eba6);throw _0x41eba6;});}return _0x5a6b27;})[_0xace9('0x23')](respondWithResult(_0x57a283,0xc9))[_0xace9('0x2d')](handleError(_0x57a283,null));};exports[_0xace9('0x39')]=function(_0x2dcbd8,_0x557e98){if(_0x2dcbd8[_0xace9('0x61')]['id']){delete _0x2dcbd8[_0xace9('0x61')]['id'];}return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x2dcbd8['params']['id']},'include':[{'model':db[_0xace9('0x41')],'as':_0xace9('0x68')}]})[_0xace9('0x23')](handleEntityNotFound(_0x557e98,null))['then'](saveUpdates(_0x2dcbd8['body'],null))[_0xace9('0x23')](respondWithResult(_0x557e98,null))[_0xace9('0x2d')](handleError(_0x557e98,null));};exports[_0xace9('0x3d')]=function(_0x2abcb5,_0x5c2c94){return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x2abcb5[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x5c2c94,null))['then'](removeEntity(_0x5c2c94,null))['catch'](handleError(_0x5c2c94,null));};exports[_0xace9('0x69')]=function(_0x5798e4,_0xacd98e){return db[_0xace9('0x43')]['describe']()[_0xace9('0x23')](respondWithResult(_0xacd98e,null))[_0xace9('0x2d')](handleError(_0xacd98e,null));};exports[_0xace9('0x6a')]=function(_0x3790ca,_0x467a8c,_0xf10b2e){if(_0x3790ca[_0xace9('0x61')]['id']){delete _0x3790ca[_0xace9('0x61')]['id'];}return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x3790ca[_0xace9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x467a8c,null))[_0xace9('0x23')](function(_0x5aed51){if(_0x5aed51){_0x3790ca[_0xace9('0x61')][_0xace9('0x6b')]=_0x5aed51['id'];return db[_0xace9('0x6c')][_0xace9('0x60')](_0x3790ca['body']);}})['then'](respondWithResult(_0x467a8c,null))[_0xace9('0x2d')](handleError(_0x467a8c,null));};exports[_0xace9('0x6d')]=function(_0x35ca68,_0x3deb41,_0x51331c){var _0x3836e4={'raw':![],'where':{}};var _0x2ca760={};var _0x4b3f80={'count':0x0,'rows':[]};return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x35ca68['params']['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x3deb41,null))[_0xace9('0x23')](function(_0x36f0da){if(_0x36f0da){_0x2ca760['model']=_[_0xace9('0x4a')](db[_0xace9('0x6c')][_0xace9('0x44')]);_0x2ca760['query']=_['keys'](_0x35ca68[_0xace9('0x49')]);_0x2ca760[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x2ca760[_0xace9('0x48')],_0x2ca760[_0xace9('0x49')]);_0x3836e4[_0xace9('0x4d')]=_['intersection'](_0x2ca760[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x35ca68['query'][_0xace9('0x4e')]));_0x3836e4['attributes']=_0x3836e4['attributes'][_0xace9('0x4f')]?_0x3836e4[_0xace9('0x4d')]:_0x2ca760[_0xace9('0x48')];if(!_0x35ca68[_0xace9('0x49')][_0xace9('0x50')](_0xace9('0x51'))){_0x3836e4[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x35ca68[_0xace9('0x49')][_0xace9('0x34')]);_0x3836e4[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x35ca68[_0xace9('0x49')]['offset']);}_0x3836e4[_0xace9('0x52')]=qs['sort'](_0x35ca68[_0xace9('0x49')][_0xace9('0x53')]);_0x3836e4[_0xace9('0x54')]=qs['filters'](_['pick'](_0x35ca68[_0xace9('0x49')],_0x2ca760[_0xace9('0x4b')]));_0x3836e4['where'][_0xace9('0x6b')]=_0x36f0da['id'];if(_0x35ca68[_0xace9('0x49')][_0xace9('0x58')]){_0x3836e4[_0xace9('0x54')]=_[_0xace9('0x56')](_0x3836e4['where'],{'$or':_['map'](_0x3836e4[_0xace9('0x4d')],function(_0x5e55fa){var _0x337253={};_0x337253[_0x5e55fa]={'$like':'%'+_0x35ca68[_0xace9('0x49')][_0xace9('0x58')]+'%'};return _0x337253;})});}_0x3836e4=_[_0xace9('0x56')]({},_0x3836e4,_0x35ca68[_0xace9('0x59')]);return db[_0xace9('0x6c')]['count']({'where':_0x3836e4['where']})[_0xace9('0x23')](function(_0x43ccc4){_0x4b3f80[_0xace9('0x35')]=_0x43ccc4;if(_0x35ca68[_0xace9('0x49')][_0xace9('0x5a')]){_0x3836e4[_0xace9('0x5b')]=[{'all':!![]}];}return db[_0xace9('0x6c')][_0xace9('0x5c')](_0x3836e4);})[_0xace9('0x23')](function(_0x4bd14f){_0x4b3f80['rows']=_0x4bd14f;return _0x4b3f80;});}})[_0xace9('0x23')](respondWithFilteredResult(_0x3deb41,_0x3836e4))['catch'](handleError(_0x3deb41,null));};exports[_0xace9('0x6f')]=function(_0x41e6e6,_0x12d214,_0xd86e63){return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x41e6e6[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x12d214,null))[_0xace9('0x23')](function(_0x55385e){if(_0x55385e){return _0x55385e['removeDispositions'](_0x41e6e6['query']['ids']);}})[_0xace9('0x23')](respondWithStatusCode(_0x12d214,null))['catch'](handleError(_0x12d214,null));};exports[_0xace9('0x70')]=function(_0x419194,_0x3d1d4f,_0x523848){if(_0x419194['body']['id']){delete _0x419194[_0xace9('0x61')]['id'];}return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x419194[_0xace9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3d1d4f,null))[_0xace9('0x23')](function(_0x23b2e7){if(_0x23b2e7){_0x419194['body'][_0xace9('0x6b')]=_0x23b2e7['id'];return db[_0xace9('0x71')][_0xace9('0x60')](_0x419194[_0xace9('0x61')]);}})[_0xace9('0x23')](respondWithResult(_0x3d1d4f,null))[_0xace9('0x2d')](handleError(_0x3d1d4f,null));};exports[_0xace9('0x72')]=function(_0x452af7,_0x1cec7f,_0x298488){var _0x30606d={'raw':![],'where':{}};var _0x47b73f={};var _0x560944={'count':0x0,'rows':[]};return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x452af7[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x1cec7f,null))['then'](function(_0x459450){if(_0x459450){_0x47b73f[_0xace9('0x48')]=_[_0xace9('0x4a')](db[_0xace9('0x71')][_0xace9('0x44')]);_0x47b73f['query']=_['keys'](_0x452af7[_0xace9('0x49')]);_0x47b73f[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x47b73f[_0xace9('0x48')],_0x47b73f[_0xace9('0x49')]);_0x30606d[_0xace9('0x4d')]=_[_0xace9('0x4c')](_0x47b73f[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x452af7[_0xace9('0x49')]['fields']));_0x30606d[_0xace9('0x4d')]=_0x30606d['attributes'][_0xace9('0x4f')]?_0x30606d[_0xace9('0x4d')]:_0x47b73f['model'];if(!_0x452af7['query']['hasOwnProperty'](_0xace9('0x51'))){_0x30606d[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x452af7[_0xace9('0x49')]['limit']);_0x30606d[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x452af7[_0xace9('0x49')][_0xace9('0x32')]);}_0x30606d[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x452af7[_0xace9('0x49')][_0xace9('0x53')]);_0x30606d[_0xace9('0x54')]=qs['filters'](_[_0xace9('0x55')](_0x452af7[_0xace9('0x49')],_0x47b73f[_0xace9('0x4b')]));_0x30606d[_0xace9('0x54')]['SmsAccountId']=_0x459450['id'];if(_0x452af7[_0xace9('0x49')][_0xace9('0x58')]){_0x30606d[_0xace9('0x54')]=_[_0xace9('0x56')](_0x30606d[_0xace9('0x54')],{'$or':_[_0xace9('0x42')](_0x30606d['attributes'],function(_0x2adb19){var _0x240796={};_0x240796[_0x2adb19]={'$like':'%'+_0x452af7[_0xace9('0x49')][_0xace9('0x58')]+'%'};return _0x240796;})});}_0x30606d=_[_0xace9('0x56')]({},_0x30606d,_0x452af7[_0xace9('0x59')]);return db[_0xace9('0x71')][_0xace9('0x35')]({'where':_0x30606d['where']})[_0xace9('0x23')](function(_0x5d9b59){_0x560944[_0xace9('0x35')]=_0x5d9b59;if(_0x452af7[_0xace9('0x49')][_0xace9('0x5a')]){_0x30606d[_0xace9('0x5b')]=[{'all':!![]}];}return db[_0xace9('0x71')][_0xace9('0x5c')](_0x30606d);})['then'](function(_0x3cb16d){_0x560944['rows']=_0x3cb16d;return _0x560944;});}})[_0xace9('0x23')](respondWithFilteredResult(_0x1cec7f,_0x30606d))[_0xace9('0x2d')](handleError(_0x1cec7f,null));};exports['removeAnswers']=function(_0x4b4a18,_0x47aec6,_0x20042b){return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x4b4a18['params']['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x47aec6,null))[_0xace9('0x23')](function(_0x1f5602){if(_0x1f5602){return _0x1f5602['removeAnswers'](_0x4b4a18[_0xace9('0x49')][_0xace9('0x73')]);}})[_0xace9('0x23')](respondWithStatusCode(_0x47aec6,null))[_0xace9('0x2d')](handleError(_0x47aec6,null));};exports['notify']=function(_0x1a9133,_0x54effa,_0x27e6eb){var _0x4b8b8b={'channel':_0xace9('0x74')};var _0x402cb7=[];var _0x1e0e6e=[];var _0x2e13ca={};return db[_0xace9('0x43')]['find']({'where':{'id':_0x1a9133['params']['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x54effa,null))[_0xace9('0x23')](function(_0x5a9980){_0x4b8b8b['account']=_0x5a9980;_0x4b8b8b[_0xace9('0x75')]=_['orderBy'](_0x5a9980[_0xace9('0x76')],[_0xace9('0x77')],[_0xace9('0x78')]);if(_0x4b8b8b[_0xace9('0x79')][_0xace9('0x76')]){delete _0x4b8b8b[_0xace9('0x79')][_0xace9('0x76')];}return db['CmContact'][_0xace9('0x69')]();})[_0xace9('0x23')](function(_0x4c3a13){if(!_0x4c3a13){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))]('no\x20available\x20attributes');}_0x402cb7=_[_0xace9('0x7c')](_['keys'](_0x4c3a13),[_0xace9('0x7d'),_0xace9('0x7e')]);_0x1e0e6e=_[_0xace9('0x7c')](_[_0xace9('0x4a')](_0x4c3a13),[_0xace9('0x7d'),_0xace9('0x7e'),_0xace9('0x7f'),_0xace9('0x80')]);_0x4b8b8b['body']={'mapKey':'mobile'};if(_0x4b8b8b[_0xace9('0x79')]['type']){switch(_0x4b8b8b[_0xace9('0x79')][_0xace9('0x46')]){case'twilio':_0x4b8b8b[_0xace9('0x61')]['from']=_0x1a9133[_0xace9('0x61')][_0xace9('0x81')];_0x4b8b8b[_0xace9('0x61')]['body']=_0x1a9133[_0xace9('0x61')]['Body'];_0x4b8b8b[_0xace9('0x61')]['messageId']=_0x1a9133[_0xace9('0x61')]['MessageSid'];break;case _0xace9('0x82'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]='+'+_0x1a9133['body'][_0xace9('0x84')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133['body'][_0xace9('0x85')];break;case _0xace9('0x86'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')]['from'];_0x4b8b8b['body'][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x2c')];break;case _0xace9('0x87'):_0x4b8b8b['body'][_0xace9('0x83')]=_0x1a9133['body'][_0xace9('0x83')];_0x4b8b8b[_0xace9('0x61')]['body']=_0x1a9133['body'][_0xace9('0x61')];_0x4b8b8b[_0xace9('0x61')]['messageId']=_0x1a9133[_0xace9('0x61')][_0xace9('0x88')];break;case _0xace9('0x89'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x81')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x8a')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133['body'][_0xace9('0x8c')];break;case _0xace9('0x8d'):_0x4b8b8b['body'][_0xace9('0x83')]='+'+_0x1a9133['body'][_0xace9('0x8e')][0x0][_0xace9('0x83')];_0x4b8b8b['body'][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x8e')][0x0][_0xace9('0x85')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')]['results'][0x0][_0xace9('0x8b')];break;case _0xace9('0x8f'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x90')];_0x4b8b8b['body'][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')]['segmentedMessage']['message'];break;case _0xace9('0x91'):_0x4b8b8b[_0xace9('0x61')]['from']=_0x1a9133['body'][_0xace9('0x92')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x85')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x93')];break;case _0xace9('0x94'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')][0x0][_0xace9('0x2c')]['id'];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][0x0][_0xace9('0x2c')][_0xace9('0x83')];_0x4b8b8b[_0xace9('0x61')]['body']=_0x1a9133[_0xace9('0x61')][0x0]['message']['text'];break;case'intelepeer':_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x83')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x2c')];_0x4b8b8b['body'][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x95')];break;}}if(_0x4b8b8b[_0xace9('0x61')]['id']){delete _0x4b8b8b['body']['id'];}if(_['isNil'](_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')])){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))](_0xace9('0x96'));}if(_['isNil'](_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')])||_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]===''){throw new db['Sequelize'][(_0xace9('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xace9('0x97')](_0x4b8b8b['body'][_0xace9('0x98')])){throw new db[(_0xace9('0x7a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e0e6e);}if(!_[_0xace9('0x99')](_0x1e0e6e,_0x4b8b8b['body']['mapKey'])){throw new db[(_0xace9('0x7a'))]['ValidationError'](_0xace9('0x9a')+_0x1e0e6e);}_0x2e13ca[_0x4b8b8b['body'][_0xace9('0x98')]]=_0x4b8b8b['body'][_0xace9('0x83')];return db['CmList'][_0xace9('0x65')]({'where':{'id':_0x4b8b8b[_0xace9('0x79')][_0xace9('0x80')]},'include':[{'model':db['CmContact'],'as':_0xace9('0x9b'),'where':_0x2e13ca,'limit':0x1,'order':[[_0xace9('0x7e'),_0xace9('0x9c')]]}]});})['then'](handleEntityNotFound(_0x54effa,null))[_0xace9('0x23')](function(_0x5ed531){if(_0x5ed531){_0x4b8b8b[_0xace9('0x9d')]=_[_0xace9('0x9e')](_0x5ed531,[_0xace9('0x9b')]);if(_0x5ed531['Contacts']['length']){return _0x5ed531[_0xace9('0x9b')][0x0];}var _0x354794=_[_0xace9('0x1b')](_0x4b8b8b['body'],{'firstName':_0x4b8b8b['body'][_0xace9('0x83')],'ListId':_0x5ed531['id']});_0x354794[_0x4b8b8b[_0xace9('0x61')]['mapKey']]=_0x4b8b8b['body'][_0xace9('0x83')];return db[_0xace9('0x9f')][_0xace9('0x60')](_0x354794,{'fields':_0x402cb7,'raw':!![]});}})[_0xace9('0x23')](handleEntityNotFound(_0x54effa,null))['then'](function(_0x3c8379){if(_0x3c8379){_0x4b8b8b['contact']=_0x3c8379;var _0xa036ef={'ContactId':_0x3c8379['id'],'phone':_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')],'SmsAccountId':_0x1a9133[_0xace9('0x5f')]['id']};var _0x10a2cd={'ContactId':_0x3c8379['id'],'SmsAccountId':_0x1a9133[_0xace9('0x5f')]['id'],'closed':![]};return db[_0xace9('0xa0')][_0xace9('0x65')]({'where':_0x10a2cd})[_0xace9('0x23')](function(_0x3742b9){if(_0x3742b9){return[_0x3742b9,![]];}return db['SmsInteraction'][_0xace9('0x60')](_0xa036ef)[_0xace9('0x23')](function(_0x34bc00){return[_0x34bc00,!![]];});});}})[_0xace9('0xa1')](function(_0x30cb57,_0x1c2e1d){_0x4b8b8b[_0xace9('0xa2')]=_0x30cb57[_0xace9('0x3a')]({'plain':!![]});_0x4b8b8b[_0xace9('0xa2')][_0xace9('0xa3')]=![];if(_0x1c2e1d){if(_0x4b8b8b[_0xace9('0x79')][_0xace9('0xa4')]){_0x4b8b8b[_0xace9('0x75')][_0xace9('0xa5')]({'id':0x0,'priority':_0x4b8b8b[_0xace9('0x75')][_0xace9('0x4f')]+0x1,'app':_0xace9('0xa6'),'appdata':_0xace9('0xa7'),'interval':_0xace9('0xa8')});}_0x4b8b8b[_0xace9('0xa2')]['created']=!![];}return db['SmsMessage'][_0xace9('0x60')]({'phone':_0x4b8b8b['body'][_0xace9('0x83')],'messageId':_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')],'body':_0x4b8b8b[_0xace9('0x61')]['body'],'SmsAccountId':_0x1a9133[_0xace9('0x5f')]['id'],'SmsInteractionId':_0x30cb57['id'],'direction':'in','ContactId':_0x30cb57['ContactId'],'AttachmentId':_0x4b8b8b[_0xace9('0x61')][_0xace9('0xa9')]});})[_0xace9('0x23')](function(_0x1c312c){_0x4b8b8b[_0xace9('0x2c')]=_0x1c312c;if(_0x4b8b8b[_0xace9('0xa2')][_0xace9('0xaa')]){return db[_0xace9('0xab')][_0xace9('0x65')]({'attributes':['id',_0xace9('0x3f')],'where':{'id':_0x4b8b8b[_0xace9('0xa2')]['UserId']}})[_0xace9('0x23')](function(_0x58f50e){if(_0x58f50e){_0x4b8b8b[_0xace9('0x75')][_0xace9('0xac')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x58f50e[_0xace9('0x3f')]+','+(_0x4b8b8b[_0xace9('0x79')]['waitForTheAssignedAgent']||0xa),'interval':_0xace9('0xa8')});}return respondWithRpcPromise(_0xace9('0xad'),'startRouting',_0x4b8b8b);});}return respondWithRpcPromise(_0xace9('0xad'),_0xace9('0xae'),_0x4b8b8b);})[_0xace9('0x23')](function(_0x4eec54){if(_0x4eec54){var _0x3f5915=0xc8;var _0x304a8a='receiveMessage';logger[_0xace9('0x24')](_0xace9('0x28'),_0x304a8a,_0x3f5915,'entity\x20found');logger[_0xace9('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x304a8a,_0x3f5915,_0xace9('0xaf'),JSON['stringify'](_0x4eec54));if(_0x4b8b8b[_0xace9('0x79')]['type']===_0xace9('0xb0')){return _0x54effa[_0xace9('0x2f')](_0x3f5915)[_0xace9('0x36')](_0xace9('0xb1'),_0xace9('0xb2'))['send'](_0xace9('0xb3'));}else{return _0x54effa[_0xace9('0x2f')](_0x3f5915)[_0xace9('0x31')](_0x4eec54);}}})[_0xace9('0x2d')](handleError(_0x54effa,null));};exports['addApplications']=function(_0x28ad6c,_0xfdff48){var _0x271d27=_0x28ad6c['params']['id'];var _0x1b4e7d=_0x28ad6c[_0xace9('0x61')];var _0x5e4cc5=0xc8;var _0x3dac2c=null;return db[_0xace9('0xb4')][_0xace9('0xb5')]({'isolationLevel':db['sequelize'][_0xace9('0xb6')]['ISOLATION_LEVELS'][_0xace9('0xb7')]},function(_0x2a3a36){return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x271d27},'transaction':_0x2a3a36})[_0xace9('0x23')](function(_0x59e916){if(_0x59e916){return db[_0xace9('0xb8')][_0xace9('0x3d')]({'where':{'SmsAccountId':_0x271d27},'transaction':_0x2a3a36})[_0xace9('0x23')](function(){var _0x37076b=_[_0xace9('0x42')](_0x1b4e7d,function(_0x18fce8){_0x18fce8[_0xace9('0x6b')]=_0x271d27;return _0x18fce8;});return db[_0xace9('0xb8')][_0xace9('0xb9')](_0x37076b,{'transaction':_0x2a3a36});});}else{_0x5e4cc5=0x194;_0x3dac2c=[];}});})[_0xace9('0x23')](function(){if(_0x5e4cc5!==0x194){return db[_0xace9('0xb8')]['findAndCountAll']({'where':{'SmsAccountId':_0x271d27},'order':_0xace9('0x77')})['then'](function(_0x3a28ed){_0x3dac2c=_0x3a28ed;});}})[_0xace9('0x2d')](function(_0xec7933){_0x5e4cc5=0x1f4;logger[_0xace9('0x2a')](_0xec7933[_0xace9('0x3e')]);if(_0xec7933[_0xace9('0x3f')]){delete _0xec7933[_0xace9('0x3f')];}_0x3dac2c=_0xec7933;})[_0xace9('0xba')](function(){if(_0x3dac2c===null){_0xfdff48[_0xace9('0x2e')](_0x5e4cc5);}else{if(_0x5e4cc5===0x1f4){_0xfdff48[_0xace9('0x2f')](_0x5e4cc5)[_0xace9('0x40')](_0x3dac2c);}else{_0xfdff48[_0xace9('0x2f')](_0x5e4cc5)[_0xace9('0x31')](_0x3dac2c);}}});};exports[_0xace9('0xbb')]=function(_0x4dbb87,_0x1f3d29,_0x47735d){var _0x4e88cd={};var _0x4946ca={};var _0x42af45;var _0x3e7921;return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x4dbb87[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x1f3d29,null))[_0xace9('0x23')](function(_0x5a8bee){if(_0x5a8bee){_0x42af45=_0x5a8bee;_0x4946ca['model']=_[_0xace9('0x4a')](db[_0xace9('0xb8')][_0xace9('0x44')]);_0x4946ca[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x4dbb87[_0xace9('0x49')]);_0x4946ca[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x4946ca[_0xace9('0x48')],_0x4946ca[_0xace9('0x49')]);_0x4e88cd[_0xace9('0x4d')]=_['intersection'](_0x4946ca[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x4dbb87[_0xace9('0x49')][_0xace9('0x4e')]));_0x4e88cd[_0xace9('0x4d')]=_0x4e88cd[_0xace9('0x4d')][_0xace9('0x4f')]?_0x4e88cd[_0xace9('0x4d')]:_0x4946ca[_0xace9('0x48')];_0x4e88cd['order']=qs[_0xace9('0x53')](_0x4dbb87[_0xace9('0x49')][_0xace9('0x53')]);_0x4e88cd[_0xace9('0x54')]=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x4dbb87[_0xace9('0x49')],_0x4946ca[_0xace9('0x4b')]));if(_0x4dbb87[_0xace9('0x49')][_0xace9('0x58')]){_0x4e88cd[_0xace9('0x54')]=_[_0xace9('0x56')](_0x4e88cd[_0xace9('0x54')],{'$or':_['map'](_0x4e88cd[_0xace9('0x4d')],function(_0x15c9ed){var _0x282060={};_0x282060[_0x15c9ed]={'$like':'%'+_0x4dbb87[_0xace9('0x49')]['filter']+'%'};return _0x282060;})});}_0x4e88cd=_[_0xace9('0x56')]({},_0x4e88cd,_0x4dbb87[_0xace9('0x59')]);return _0x42af45[_0xace9('0xbb')](_0x4e88cd);}})[_0xace9('0x23')](function(_0xbfc4ff){if(_0xbfc4ff){_0x3e7921=_0xbfc4ff['length'];if(!_0x4dbb87['query'][_0xace9('0x50')](_0xace9('0x51'))){_0x4e88cd[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x4dbb87[_0xace9('0x49')][_0xace9('0x34')]);_0x4e88cd[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x4dbb87[_0xace9('0x49')]['offset']);}return _0x42af45[_0xace9('0xbb')](_0x4e88cd);}})[_0xace9('0x23')](function(_0x464a50){if(_0x464a50){return _0x464a50?{'count':_0x3e7921,'rows':_0x464a50}:null;}})[_0xace9('0x23')](respondWithResult(_0x1f3d29,null))[_0xace9('0x2d')](handleError(_0x1f3d29,null));};exports['getInteractions']=function(_0x14e710,_0x2764dc,_0x4c020e){var _0x3b5af5={'raw':![],'where':{}};var _0x1603e9={};var _0x21d4f0={'count':0x0,'rows':[]};return db['SmsAccount'][_0xace9('0x6e')]({'where':{'id':_0x14e710[_0xace9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2764dc,null))[_0xace9('0x23')](function(_0x4a4214){if(_0x4a4214){_0x1603e9[_0xace9('0x48')]=_['keys'](db[_0xace9('0xa0')][_0xace9('0x44')]);_0x1603e9[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x14e710[_0xace9('0x49')]);_0x1603e9[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x1603e9[_0xace9('0x48')],_0x1603e9['query']);_0x3b5af5[_0xace9('0x4d')]=_[_0xace9('0x4c')](_0x1603e9[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x14e710[_0xace9('0x49')][_0xace9('0x4e')]));_0x3b5af5['attributes']=_0x3b5af5[_0xace9('0x4d')][_0xace9('0x4f')]?_0x3b5af5['attributes']:_0x1603e9[_0xace9('0x48')];if(!_0x14e710[_0xace9('0x49')][_0xace9('0x50')](_0xace9('0x51'))){_0x3b5af5[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x14e710['query'][_0xace9('0x34')]);_0x3b5af5[_0xace9('0x32')]=qs['offset'](_0x14e710[_0xace9('0x49')]['offset']);}_0x3b5af5[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x14e710[_0xace9('0x49')][_0xace9('0x53')]);_0x3b5af5[_0xace9('0x54')]=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x14e710[_0xace9('0x49')],_0x1603e9[_0xace9('0x4b')]));_0x3b5af5[_0xace9('0x54')][_0xace9('0x6b')]=_0x4a4214['id'];if(_0x14e710['query'][_0xace9('0x58')]){_0x3b5af5[_0xace9('0x54')]=_[_0xace9('0x56')](_0x3b5af5[_0xace9('0x54')],{'$or':_['map'](_0x3b5af5[_0xace9('0x4d')],function(_0x7290a5){var _0x5a40a8={};_0x5a40a8[_0x7290a5]={'$like':'%'+_0x14e710[_0xace9('0x49')][_0xace9('0x58')]+'%'};return _0x5a40a8;})});}_0x3b5af5=_[_0xace9('0x56')]({},_0x3b5af5,_0x14e710[_0xace9('0x59')]);return db['SmsInteraction']['count']({'where':_0x3b5af5['where']})['then'](function(_0x1b49c9){_0x21d4f0[_0xace9('0x35')]=_0x1b49c9;if(_0x14e710['query']['includeAll']){_0x3b5af5[_0xace9('0x5b')]=[{'model':db[_0xace9('0x9f')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xace9('0xbc'),'attributes':[_0xace9('0x3f'),_0xace9('0xbd'),_0xace9('0xbe')],'required':![]},{'model':db[_0xace9('0xbf')],'as':_0xace9('0xc0'),'attributes':['id',_0xace9('0x3f'),_0xace9('0xc1')],'where':_0x14e710['query'][_0xace9('0xc2')]?{'id':_0x14e710[_0xace9('0x49')][_0xace9('0xc2')]}:undefined,'required':_0x14e710[_0xace9('0x49')]['tag']?!![]:![]}];}return db[_0xace9('0xa0')][_0xace9('0x5c')](_0x3b5af5);})[_0xace9('0x23')](function(_0x438133){_0x21d4f0['rows']=_0x438133;return _0x21d4f0;});}})[_0xace9('0x23')](respondWithFilteredResult(_0x2764dc,_0x3b5af5))[_0xace9('0x2d')](handleError(_0x2764dc,null));};exports[_0xace9('0x40')]=function(_0x39e4e4,_0x354dea,_0x38914a){var _0x5d8bc1,_0x21e55c,_0x589e9c;if(_['isNil'](_0x39e4e4['body'][_0xace9('0x61')])||_0x39e4e4[_0xace9('0x61')][_0xace9('0x61')]===''){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xace9('0x97')](_0x39e4e4['body']['to'])){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))]('to\x20is\x20mandatory');}_0x5d8bc1=_0x39e4e4[_0xace9('0x61')]['to'];return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x39e4e4['params']['id']},'include':[{'model':db[_0xace9('0xc3')],'as':_0xace9('0xc4'),'include':[{'model':db[_0xace9('0x9f')],'as':_0xace9('0x9b'),'where':{'mobile':_0x5d8bc1},'limit':0x1,'order':[[_0xace9('0x7e'),'DESC']]}]}]})[_0xace9('0x23')](handleEntityNotFound(_0x354dea,null))[_0xace9('0x23')](function(_0x421e49){if(_0x421e49&&_0x421e49[_0xace9('0xc4')]){_0x21e55c=_0x421e49[_0xace9('0x3a')]({'plain':!![]});if(_0x21e55c[_0xace9('0xc4')]&&_0x21e55c['List'][_0xace9('0x9b')][_0xace9('0x4f')]){return _0x21e55c[_0xace9('0xc4')]['Contacts'][0x0];}return db['CmContact'][_0xace9('0x60')](_[_0xace9('0x1b')](_0x39e4e4[_0xace9('0x61')],{'firstName':_0x5d8bc1,'mobile':_0x5d8bc1,'phone':_0x5d8bc1,'ListId':_0x21e55c[_0xace9('0x80')]}));}})[_0xace9('0x23')](handleEntityNotFound(_0x354dea,null))[_0xace9('0x23')](function(_0x5fddf){if(_0x5fddf){_0x589e9c=_0x5fddf;return db[_0xace9('0xa0')][_0xace9('0x65')]({'where':{'ContactId':_0x589e9c['id'],'closed':![],'SmsAccountId':_0x21e55c['id']}})['then'](function(_0x206a89){if(_0x206a89){return[_0x206a89,![]];}return db[_0xace9('0xa0')][_0xace9('0x60')]({'UserId':_0x39e4e4['user']['id'],'ContactId':_0x589e9c['id'],'SmsAccountId':_0x21e55c['id'],'phone':_0x5d8bc1,'firstMsgDirection':_0xace9('0xc5'),'Messages':[_['merge'](_0x39e4e4['body'],{'read':![],'body':_0x39e4e4[_0xace9('0x61')][_0xace9('0x61')],'phone':_0x5d8bc1,'SmsAccountId':_0x21e55c['id'],'UserId':_0x39e4e4[_0xace9('0x62')]['id'],'ContactId':_0x589e9c['id']})]},{'include':[{'model':db[_0xace9('0xc6')],'as':_0xace9('0xc7')}]})[_0xace9('0x23')](function(_0x1ffcd8){return[_0x1ffcd8,!![]];});});}})[_0xace9('0xa1')](function(_0x2be21a,_0x1087b2){if(_0x1087b2){return _0x2be21a;}return db[_0xace9('0xc6')][_0xace9('0x60')](_[_0xace9('0x56')](_0x39e4e4[_0xace9('0x61')],{'read':![],'body':_0x39e4e4[_0xace9('0x61')][_0xace9('0x61')],'phone':_0x5d8bc1,'SmsAccountId':_0x21e55c['id'],'SmsInteractionId':_0x2be21a['id'],'UserId':_0x39e4e4['user']['id'],'ContactId':_0x589e9c['id']}))[_0xace9('0x23')](function(_0x11e0be){_0x2be21a[_0xace9('0xc8')][_0xace9('0xc7')]=[];_0x2be21a[_0xace9('0xc8')]['Messages'][_0xace9('0xa5')](_0x11e0be[_0xace9('0xc8')]);return _0x2be21a;});})[_0xace9('0x23')](respondWithResult(_0x354dea,null))['catch'](handleError(_0x354dea,null));};exports['status']=function(_0x1d373f,_0x3c4f11,_0x4ab080){if(_0x1d373f[_0xace9('0x61')]['id']){delete _0x1d373f[_0xace9('0x61')]['id'];}var _0x335eb4,_0x2dd3bb,_0x2385cf;return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x1d373f[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x3c4f11,null))[_0xace9('0x23')](function(_0x54c693){if(_0x54c693){_0x2385cf=_0x54c693;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xace9('0x2f'),_0xace9('0xc9'),_0x54c693[_0xace9('0x46')],util[_0xace9('0xca')](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));switch(_0x54c693[_0xace9('0x46')]){case _0xace9('0x82'):if(_0x1d373f[_0xace9('0x61')][_0xace9('0xcb')]&&_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')]){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x1d373f[_0xace9('0x61')]['skebby_dispatch_id']}});}break;case _0xace9('0x86'):if(_0x1d373f['body'][_0xace9('0xcc')]&&_0x1d373f['body'][_0xace9('0xcd')]){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0xcd')];return db[_0xace9('0xc6')]['find']({'where':{'messageId':_0x1d373f[_0xace9('0x61')]['requestid']}});}break;case _0xace9('0x87'):if(_0x1d373f[_0xace9('0x61')][_0xace9('0x88')]&&_0x1d373f[_0xace9('0x61')]['status_code']){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0xce')];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x1d373f['body']['message_id']}});}break;case _0xace9('0x8d'):var _0x13b6ae=_0x1d373f[_0xace9('0x61')][_0xace9('0x8e')][0x0];if(_0x13b6ae[_0xace9('0x8b')]&&_0x13b6ae[_0xace9('0x2f')][_0xace9('0xcf')]===_0xace9('0xd0')){_0x2dd3bb=_0x13b6ae[_0xace9('0x2f')][_0xace9('0xcf')];return db[_0xace9('0xc6')]['find']({'where':{'messageId':_0x13b6ae[_0xace9('0x8b')]}});}break;case _0xace9('0x91'):if(_0x1d373f[_0xace9('0x61')][_0xace9('0x8b')]&&_0x1d373f['body'][_0xace9('0x2f')]){_0x2dd3bb=_0x1d373f['body'][_0xace9('0x2f')];return db['SmsMessage'][_0xace9('0x65')]({'where':{'messageId':_0x1d373f['body']['messageId']}});}break;case _0xace9('0x94'):if(_0x1d373f['body'][0x0][_0xace9('0x2c')]['id']){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][0x0]['type'];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x1d373f[_0xace9('0x61')][0x0][_0xace9('0x2c')]['id']}});}break;case _0xace9('0xd1'):if(_0x1d373f['body']['redif']&&_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')]){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')];return db[_0xace9('0xc6')]['find']({'where':{'messageId':_0x1d373f[_0xace9('0x61')][_0xace9('0xd2')]}});}break;}}})[_0xace9('0x23')](handleEntityNotFound(_0x3c4f11,null))['then'](function(_0x37a833){if(_0x37a833){_0x335eb4=_0x37a833;switch(_0x2385cf[_0xace9('0x46')]){case _0xace9('0x82'):if(_0x2dd3bb===_0xace9('0xd0')){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xace9('0x2f'),'skebby',util['inspect'](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;case _0xace9('0x86'):if(_0x2dd3bb==='1'){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0x82'),util[_0xace9('0xca')](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1d373f[_0xace9('0x61')][_0xace9('0xd3')]&&_0x2dd3bb>=0xc8&&_0x2dd3bb<=0xce){return _0x335eb4['update']({'read':!![]});}else{logger['error'](_0xace9('0x28'),_0xace9('0x2f'),'clicksend',util[_0xace9('0xca')](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));}break;case _0xace9('0x8d'):var _0x5bcb93=_0x1d373f[_0xace9('0x61')][_0xace9('0x8e')][0x0];if(_0x5bcb93[_0xace9('0x2f')][_0xace9('0xcf')]===_0xace9('0xd0')){return _0x335eb4['update']({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),'status',_0xace9('0x8d'),util['inspect'](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));}break;case _0xace9('0x91'):if(_0x2dd3bb==_0xace9('0xd4')||_0x2dd3bb==_0xace9('0xd5')){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),_0xace9('0x2f'),'clickatell',util[_0xace9('0xca')](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));}break;case _0xace9('0x94'):if(_0x2dd3bb=='message-delivered'){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xace9('0x94'),util[_0xace9('0xca')](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2dd3bb==='DELIVRD'||_0x2dd3bb===_0xace9('0xd6')){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0xd1'),util[_0xace9('0xca')](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;}return _0x335eb4;}})['then'](respondWithResult(_0x3c4f11,null))['catch'](handleError(_0x3c4f11,null));};exports[_0xace9('0xd7')]=function(_0x6286b4,_0x24f90a,_0x2fd9cb){var _0x3991e9,_0x4d08b2,_0x8c7922;return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x6286b4[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x24f90a,null))['then'](function(_0x377ed2){if(_0x377ed2){_0x8c7922=_0x377ed2;logger['debug'](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0xc9'),_0x377ed2[_0xace9('0x46')],util[_0xace9('0xca')](_0x6286b4[_0xace9('0x49')],{'showHidden':![],'depth':null}));switch(_0x377ed2[_0xace9('0x46')]){case _0xace9('0x8f'):if(_0x6286b4[_0xace9('0x49')][_0xace9('0xd8')]&&_0x6286b4['query'][_0xace9('0xd9')]){_0x4d08b2=_0x6286b4[_0xace9('0x49')][_0xace9('0xd9')];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x6286b4['query'][_0xace9('0xd8')]}});}break;}}})[_0xace9('0x23')](handleEntityNotFound(_0x24f90a,null))[_0xace9('0x23')](function(_0x3b9fd1){if(_0x3b9fd1){_0x3991e9=_0x3b9fd1;switch(_0x8c7922[_0xace9('0x46')]){case'csc':if(_0x4d08b2==='2'||_0x4d08b2==='6'){return _0x3991e9['update']({'read':!![]});}else{logger['error'](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0x8f'),util[_0xace9('0xca')](_0x6286b4[_0xace9('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x3991e9;}})[_0xace9('0x23')](respondWithResult(_0x24f90a,null))[_0xace9('0x2d')](handleError(_0x24f90a,null));};exports['addAgents']=function(_0x60df84,_0x388a05,_0x17a5cc){return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x60df84[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x388a05,null))[_0xace9('0x23')](function(_0x490411){if(_0x490411){return _0x490411['addAgents'](_0x60df84[_0xace9('0x61')][_0xace9('0x73')],_['omit'](_0x60df84[_0xace9('0x61')],[_0xace9('0x73'),'id'])||{})[_0xace9('0xa1')](function(_0x2f0395){for(var _0x1b5971=0x0;_0x1b5971<_0x60df84[_0xace9('0x61')][_0xace9('0x73')][_0xace9('0x4f')];_0x1b5971+=0x1){socket[_0xace9('0xda')](_0xace9('0xdb'),{'UserId':Number(_0x60df84['body'][_0xace9('0x73')][_0x1b5971]),'SmsAccountId':Number(_0x60df84['params']['id'])});}return _0x2f0395;});}})[_0xace9('0x23')](respondWithResult(_0x388a05,null))[_0xace9('0x2d')](handleError(_0x388a05,null));};exports['removeAgents']=function(_0x48bac7,_0x51a4d3,_0x10f392){return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x48bac7[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x51a4d3,null))[_0xace9('0x23')](function(_0x575a8e){if(_0x575a8e){return _0x575a8e[_0xace9('0xdc')](_0x48bac7[_0xace9('0x49')][_0xace9('0x73')])[_0xace9('0x23')](function(){if(_[_0xace9('0xdd')](_0x48bac7[_0xace9('0x49')][_0xace9('0x73')])){for(var _0x120dd5=0x0;_0x120dd5<_0x48bac7[_0xace9('0x49')][_0xace9('0x73')][_0xace9('0x4f')];_0x120dd5+=0x1){socket[_0xace9('0xda')](_0xace9('0xde'),{'UserId':Number(_0x48bac7['query'][_0xace9('0x73')][_0x120dd5]),'SmsAccountId':Number(_0x48bac7[_0xace9('0x5f')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x48bac7[_0xace9('0x49')][_0xace9('0x73')]),'SmsAccountId':Number(_0x48bac7[_0xace9('0x5f')]['id'])});}});}})[_0xace9('0x23')](respondWithStatusCode(_0x51a4d3,null))[_0xace9('0x2d')](handleError(_0x51a4d3,null));};exports[_0xace9('0xdf')]=function(_0x4685d0,_0x50c03e,_0x525354){var _0x409750={};var _0x2779fb={};var _0x22bf91;var _0x207d53;return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x4685d0['params']['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x50c03e,null))[_0xace9('0x23')](function(_0x256e5f){if(_0x256e5f){_0x22bf91=_0x256e5f;_0x2779fb[_0xace9('0x48')]=_[_0xace9('0x4a')](db[_0xace9('0xab')][_0xace9('0x44')]);_0x2779fb[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x4685d0[_0xace9('0x49')]);_0x2779fb[_0xace9('0x4b')]=_['intersection'](_0x2779fb[_0xace9('0x48')],_0x2779fb[_0xace9('0x49')]);_0x409750[_0xace9('0x4d')]=_['intersection'](_0x2779fb['model'],qs[_0xace9('0x4e')](_0x4685d0[_0xace9('0x49')][_0xace9('0x4e')]));_0x409750['attributes']=_0x409750[_0xace9('0x4d')]['length']?_0x409750[_0xace9('0x4d')]:_0x2779fb['model'];_0x409750[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x4685d0[_0xace9('0x49')][_0xace9('0x53')]);_0x409750['where']=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x4685d0[_0xace9('0x49')],_0x2779fb[_0xace9('0x4b')]));if(_0x4685d0[_0xace9('0x49')]['filter']){_0x409750['where']=_[_0xace9('0x56')](_0x409750[_0xace9('0x54')],{'$or':_[_0xace9('0x42')](_0x409750[_0xace9('0x4d')],function(_0x594ba6){var _0x5cd323={};_0x5cd323[_0x594ba6]={'$like':'%'+_0x4685d0['query'][_0xace9('0x58')]+'%'};return _0x5cd323;})});}_0x409750=_[_0xace9('0x56')]({},_0x409750,_0x4685d0[_0xace9('0x59')]);return _0x22bf91[_0xace9('0xdf')](_0x409750);}})['then'](function(_0x2cad41){if(_0x2cad41){_0x207d53=_0x2cad41[_0xace9('0x4f')];if(!_0x4685d0[_0xace9('0x49')]['hasOwnProperty'](_0xace9('0x51'))){_0x409750[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x4685d0[_0xace9('0x49')]['limit']);_0x409750[_0xace9('0x32')]=qs['offset'](_0x4685d0[_0xace9('0x49')][_0xace9('0x32')]);}return _0x22bf91[_0xace9('0xdf')](_0x409750);}})[_0xace9('0x23')](function(_0x159214){if(_0x159214){return _0x159214?{'count':_0x207d53,'rows':_0x159214}:null;}})[_0xace9('0x23')](respondWithResult(_0x50c03e,null))[_0xace9('0x2d')](handleError(_0x50c03e,null));}; \ No newline at end of file +var _0x4028=['result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','addDisposition','SmsAccountId','Disposition','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','messageId','MessageSid','skebby','from','sender','clicksend','message_id','plivo','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','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','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','send','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','dataValues','Messages','skebby_dispatch_id','connectel','statusInt','requestid','status_code','groupName','DELIVERED','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x41817b,_0x1b6ae4){var _0x70dd8=function(_0x7bbc4){while(--_0x7bbc4){_0x41817b['push'](_0x41817b['shift']());}};_0x70dd8(++_0x1b6ae4);}(_0x4028,0x1a4));var _0x8402=function(_0x59559d,_0x46bd3a){_0x59559d=_0x59559d-0x0;var _0x1202e9=_0x4028[_0x59559d];return _0x1202e9;};'use strict';var emlformat=require(_0x8402('0x0'));var rimraf=require(_0x8402('0x1'));var zipdir=require(_0x8402('0x2'));var jsonpatch=require(_0x8402('0x3'));var rp=require(_0x8402('0x4'));var moment=require('moment');var BPromise=require(_0x8402('0x5'));var Mustache=require('mustache');var util=require(_0x8402('0x6'));var path=require('path');var sox=require(_0x8402('0x7'));var csv=require(_0x8402('0x8'));var ejs=require(_0x8402('0x9'));var fs=require('fs');var fs_extra=require(_0x8402('0xa'));var _=require(_0x8402('0xb'));var squel=require(_0x8402('0xc'));var crypto=require('crypto');var jsforce=require(_0x8402('0xd'));var deskjs=require(_0x8402('0xe'));var toCsv=require(_0x8402('0x8'));var querystring=require(_0x8402('0xf'));var Papa=require(_0x8402('0x10'));var Redis=require(_0x8402('0x11'));var authService=require(_0x8402('0x12'));var qs=require(_0x8402('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8402('0x14'))(_0x8402('0x15'));var utils=require('../../config/utils');var config=require(_0x8402('0x16'));var licenseUtil=require(_0x8402('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8402('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8402('0x19'))(new Redis(config[_0x8402('0x1a')]));require(_0x8402('0x1b'))[_0x8402('0x1c')](socket);var jayson=require(_0x8402('0x1d'));var client=jayson[_0x8402('0x1e')][_0x8402('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x38c130,_0x3b7615,_0x54d550,_0x59a95b){return new BPromise(function(_0x4c635b,_0x34f96e){var _0x27e744=_0x59a95b||client;return _0x27e744[_0x8402('0x20')](_0x38c130,_0x54d550)[_0x8402('0x21')](function(_0x257f77){logger[_0x8402('0x22')](_0x8402('0x23'),_0x3b7615,_0x8402('0x24'));logger['debug'](_0x8402('0x25'),_0x3b7615,_0x8402('0x24'),JSON[_0x8402('0x26')](_0x257f77));if(_0x257f77[_0x8402('0x27')]){if(_0x257f77[_0x8402('0x27')][_0x8402('0x28')]===0x1f4){logger['error'](_0x8402('0x23'),_0x3b7615,_0x257f77[_0x8402('0x27')][_0x8402('0x29')]);return _0x34f96e(_0x257f77[_0x8402('0x27')]['message']);}logger[_0x8402('0x27')](_0x8402('0x23'),_0x3b7615,_0x257f77[_0x8402('0x27')]['message']);return _0x4c635b(_0x257f77[_0x8402('0x27')]['message']);}else{logger[_0x8402('0x22')](_0x8402('0x23'),_0x3b7615,_0x8402('0x24'));_0x4c635b(_0x257f77[_0x8402('0x2a')][_0x8402('0x29')]);}})[_0x8402('0x2b')](function(_0x18b8aa){logger[_0x8402('0x27')](_0x8402('0x23'),_0x3b7615,_0x18b8aa);_0x34f96e(_0x18b8aa);});});}function respondWithStatusCode(_0x4c76e2,_0x1930a3){_0x1930a3=_0x1930a3||0xcc;return function(_0x8d2df6){if(_0x8d2df6){return _0x4c76e2['sendStatus'](_0x1930a3);}return _0x4c76e2[_0x8402('0x2c')](_0x1930a3)[_0x8402('0x2d')]();};}function respondWithResult(_0x23147d,_0x21bdca){_0x21bdca=_0x21bdca||0xc8;return function(_0x4bb757){if(_0x4bb757){return _0x23147d[_0x8402('0x2c')](_0x21bdca)[_0x8402('0x2e')](_0x4bb757);}};}function respondWithFilteredResult(_0x16a821,_0x5f345b){return function(_0x4ee451){if(_0x4ee451){var _0xa5dd6b=typeof _0x5f345b['offset']===_0x8402('0x2f')&&typeof _0x5f345b[_0x8402('0x30')]===_0x8402('0x2f');var _0xf8fcc6=_0x4ee451[_0x8402('0x31')];var _0x41c5c4=_0xa5dd6b?0x0:_0x5f345b['offset'];var _0x17ba6f=_0xa5dd6b?_0x4ee451[_0x8402('0x31')]:_0x5f345b[_0x8402('0x32')]+_0x5f345b[_0x8402('0x30')];var _0xad3014;if(_0x17ba6f>=_0xf8fcc6){_0x17ba6f=_0xf8fcc6;_0xad3014=0xc8;}else{_0xad3014=0xce;}_0x16a821[_0x8402('0x2c')](_0xad3014);return _0x16a821[_0x8402('0x33')](_0x8402('0x34'),_0x41c5c4+'-'+_0x17ba6f+'/'+_0xf8fcc6)['json'](_0x4ee451);}return null;};}function patchUpdates(_0x588189){return function(_0x495009){try{jsonpatch[_0x8402('0x35')](_0x495009,_0x588189,!![]);}catch(_0x2969e5){return BPromise[_0x8402('0x36')](_0x2969e5);}return _0x495009[_0x8402('0x37')]();};}function saveUpdates(_0x34f0e3,_0x311adb){return function(_0x277d96){if(_0x277d96){return _0x277d96[_0x8402('0x38')](_0x34f0e3)['then'](function(_0x3467de){return _0x3467de;});}return null;};}function removeEntity(_0x5e134a,_0x45b5ba){return function(_0x1bcfb9){if(_0x1bcfb9){return _0x1bcfb9[_0x8402('0x39')]()[_0x8402('0x21')](function(){var _0x379e7f=_0x1bcfb9['get']({'plain':!![]});var _0x49d8fd=_0x8402('0x3a');return db[_0x8402('0x3b')][_0x8402('0x39')]({'where':{'type':_0x49d8fd,'resourceId':_0x379e7f['id']}})['then'](function(){return _0x1bcfb9;});})[_0x8402('0x21')](function(){_0x5e134a[_0x8402('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b633e,_0x5c5592){return function(_0x590aab){if(!_0x590aab){_0x1b633e[_0x8402('0x3c')](0x194);}return _0x590aab;};}function handleError(_0x374fb0,_0x3684b9){_0x3684b9=_0x3684b9||0x1f4;return function(_0x1739d7){logger['error'](_0x1739d7[_0x8402('0x3d')]);if(_0x1739d7['name']){delete _0x1739d7[_0x8402('0x3e')];}_0x374fb0[_0x8402('0x2c')](_0x3684b9)['send'](_0x1739d7);};}exports[_0x8402('0x3f')]=function(_0x5e5dbe,_0x4edcb0){var _0x1891a8={'include':[{'model':db[_0x8402('0x40')],'as':_0x8402('0x41')}]},_0x134dba={},_0x359615={'count':0x0,'rows':[]};var _0x4fe270=_['map'](db[_0x8402('0x42')][_0x8402('0x43')],function(_0x51d64a){return{'name':_0x51d64a['fieldName'],'type':_0x51d64a[_0x8402('0x44')][_0x8402('0x45')]};});_0x134dba[_0x8402('0x46')]=_[_0x8402('0x47')](_0x4fe270,_0x8402('0x3e'));_0x134dba['query']=_[_0x8402('0x48')](_0x5e5dbe[_0x8402('0x49')]);_0x134dba[_0x8402('0x4a')]=_[_0x8402('0x4b')](_0x134dba['model'],_0x134dba[_0x8402('0x49')]);_0x1891a8[_0x8402('0x4c')]=_[_0x8402('0x4b')](_0x134dba['model'],qs[_0x8402('0x4d')](_0x5e5dbe[_0x8402('0x49')]['fields']));_0x1891a8[_0x8402('0x4c')]=_0x1891a8[_0x8402('0x4c')][_0x8402('0x4e')]?_0x1891a8[_0x8402('0x4c')]:_0x134dba['model'];if(!_0x5e5dbe[_0x8402('0x49')][_0x8402('0x4f')]('nolimit')){_0x1891a8[_0x8402('0x30')]=qs['limit'](_0x5e5dbe[_0x8402('0x49')][_0x8402('0x30')]);_0x1891a8[_0x8402('0x32')]=qs['offset'](_0x5e5dbe['query'][_0x8402('0x32')]);}_0x1891a8[_0x8402('0x50')]=qs[_0x8402('0x51')](_0x5e5dbe[_0x8402('0x49')][_0x8402('0x51')]);_0x1891a8[_0x8402('0x52')]=qs[_0x8402('0x4a')](_[_0x8402('0x53')](_0x5e5dbe['query'],_0x134dba[_0x8402('0x4a')]),_0x4fe270);if(_0x5e5dbe[_0x8402('0x49')][_0x8402('0x54')]){_0x1891a8[_0x8402('0x52')]=_[_0x8402('0x55')](_0x1891a8[_0x8402('0x52')],{'$or':_[_0x8402('0x47')](_0x4fe270,function(_0x35450e){if(_0x35450e[_0x8402('0x44')]!==_0x8402('0x56')){var _0x124d34={};_0x124d34[_0x35450e['name']]={'$like':'%'+_0x5e5dbe[_0x8402('0x49')][_0x8402('0x54')]+'%'};return _0x124d34;}})});}_0x1891a8=_[_0x8402('0x55')]({},_0x1891a8,_0x5e5dbe[_0x8402('0x57')]);var _0x42d7b5={'where':_0x1891a8['where']};return db['SmsAccount'][_0x8402('0x31')](_0x42d7b5)[_0x8402('0x21')](function(_0x4e1105){_0x359615[_0x8402('0x31')]=_0x4e1105;if(_0x5e5dbe['query']['includeAll']){_0x1891a8[_0x8402('0x58')]=[{'all':!![]}];}return db[_0x8402('0x42')]['findAll'](_0x1891a8);})['then'](function(_0x2f51d1){_0x359615[_0x8402('0x59')]=_0x2f51d1;return _0x359615;})[_0x8402('0x21')](respondWithFilteredResult(_0x4edcb0,_0x1891a8))['catch'](handleError(_0x4edcb0,null));};exports[_0x8402('0x5a')]=function(_0x4e5d53,_0x59ab7d){var _0x36fd80={'raw':![],'where':{'id':_0x4e5d53[_0x8402('0x5b')]['id']},'include':[{'model':db[_0x8402('0x40')],'as':_0x8402('0x41')}]},_0x445a06={};_0x445a06[_0x8402('0x46')]=_[_0x8402('0x48')](db[_0x8402('0x42')][_0x8402('0x43')]);_0x445a06[_0x8402('0x49')]=_[_0x8402('0x48')](_0x4e5d53[_0x8402('0x49')]);_0x445a06[_0x8402('0x4a')]=_[_0x8402('0x4b')](_0x445a06['model'],_0x445a06[_0x8402('0x49')]);_0x36fd80['attributes']=_['intersection'](_0x445a06['model'],qs[_0x8402('0x4d')](_0x4e5d53['query']['fields']));_0x36fd80[_0x8402('0x4c')]=_0x36fd80[_0x8402('0x4c')][_0x8402('0x4e')]?_0x36fd80[_0x8402('0x4c')]:_0x445a06[_0x8402('0x46')];if(_0x4e5d53[_0x8402('0x49')][_0x8402('0x5c')]){_0x36fd80[_0x8402('0x58')]=[{'all':!![]}];}_0x36fd80=_[_0x8402('0x55')]({},_0x36fd80,_0x4e5d53['options']);return db[_0x8402('0x42')]['find'](_0x36fd80)['then'](handleEntityNotFound(_0x59ab7d,null))['then'](respondWithResult(_0x59ab7d,null))['catch'](handleError(_0x59ab7d,null));};exports[_0x8402('0x5d')]=function(_0x50c88c,_0xadec01){return db['SmsAccount'][_0x8402('0x5d')](_0x50c88c[_0x8402('0x5e')],{})['then'](function(_0x1c8841){var _0x55b3ad=_0x50c88c[_0x8402('0x5f')]['get']({'plain':!![]});if(!_0x55b3ad)throw new Error(_0x8402('0x60'));if(_0x55b3ad['role']==='user'){var _0x916a23=_0x1c8841[_0x8402('0x61')]({'plain':!![]});var _0x1ecfc6='SmsAccounts';return db[_0x8402('0x62')][_0x8402('0x63')]({'where':{'name':_0x1ecfc6,'userProfileId':_0x55b3ad[_0x8402('0x64')]},'raw':!![]})[_0x8402('0x21')](function(_0x5af2e5){if(_0x5af2e5&&_0x5af2e5[_0x8402('0x65')]===0x0){return db['UserProfileResource'][_0x8402('0x5d')]({'name':_0x916a23[_0x8402('0x3e')],'resourceId':_0x916a23['id'],'type':_0x5af2e5[_0x8402('0x3e')],'sectionId':_0x5af2e5['id']},{})['then'](function(){return _0x1c8841;});}else{return _0x1c8841;}})[_0x8402('0x2b')](function(_0x323661){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x323661);throw _0x323661;});}return _0x1c8841;})[_0x8402('0x21')](respondWithResult(_0xadec01,0xc9))['catch'](handleError(_0xadec01,null));};exports[_0x8402('0x38')]=function(_0x3bb932,_0x259ba5){if(_0x3bb932[_0x8402('0x5e')]['id']){delete _0x3bb932[_0x8402('0x5e')]['id'];}return db['SmsAccount'][_0x8402('0x63')]({'where':{'id':_0x3bb932['params']['id']},'include':[{'model':db[_0x8402('0x40')],'as':_0x8402('0x41')}]})[_0x8402('0x21')](handleEntityNotFound(_0x259ba5,null))[_0x8402('0x21')](saveUpdates(_0x3bb932['body'],null))['then'](respondWithResult(_0x259ba5,null))[_0x8402('0x2b')](handleError(_0x259ba5,null));};exports['destroy']=function(_0x2f6134,_0x142974){return db[_0x8402('0x42')]['find']({'where':{'id':_0x2f6134[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x142974,null))[_0x8402('0x21')](removeEntity(_0x142974,null))[_0x8402('0x2b')](handleError(_0x142974,null));};exports['describe']=function(_0x5e633b,_0x868fda){return db[_0x8402('0x42')]['describe']()[_0x8402('0x21')](respondWithResult(_0x868fda,null))[_0x8402('0x2b')](handleError(_0x868fda,null));};exports[_0x8402('0x66')]=function(_0xa06c63,_0x497614,_0xe6e2af){if(_0xa06c63[_0x8402('0x5e')]['id']){delete _0xa06c63['body']['id'];}return db[_0x8402('0x42')][_0x8402('0x63')]({'where':{'id':_0xa06c63[_0x8402('0x5b')]['id']}})['then'](handleEntityNotFound(_0x497614,null))[_0x8402('0x21')](function(_0x19d439){if(_0x19d439){_0xa06c63[_0x8402('0x5e')][_0x8402('0x67')]=_0x19d439['id'];return db[_0x8402('0x68')][_0x8402('0x5d')](_0xa06c63[_0x8402('0x5e')]);}})[_0x8402('0x21')](respondWithResult(_0x497614,null))[_0x8402('0x2b')](handleError(_0x497614,null));};exports['getDispositions']=function(_0x40f824,_0x4d01fd,_0x47c562){var _0x11382b={'raw':![],'where':{}};var _0x5941e1={};var _0x46d90f={'count':0x0,'rows':[]};return db[_0x8402('0x42')][_0x8402('0x69')]({'where':{'id':_0x40f824[_0x8402('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4d01fd,null))['then'](function(_0xd17d91){if(_0xd17d91){_0x5941e1[_0x8402('0x46')]=_[_0x8402('0x48')](db[_0x8402('0x68')][_0x8402('0x43')]);_0x5941e1[_0x8402('0x49')]=_[_0x8402('0x48')](_0x40f824[_0x8402('0x49')]);_0x5941e1['filters']=_[_0x8402('0x4b')](_0x5941e1['model'],_0x5941e1['query']);_0x11382b['attributes']=_[_0x8402('0x4b')](_0x5941e1['model'],qs['fields'](_0x40f824['query'][_0x8402('0x4d')]));_0x11382b[_0x8402('0x4c')]=_0x11382b[_0x8402('0x4c')]['length']?_0x11382b[_0x8402('0x4c')]:_0x5941e1['model'];if(!_0x40f824[_0x8402('0x49')][_0x8402('0x4f')](_0x8402('0x6a'))){_0x11382b[_0x8402('0x30')]=qs['limit'](_0x40f824['query']['limit']);_0x11382b['offset']=qs[_0x8402('0x32')](_0x40f824[_0x8402('0x49')][_0x8402('0x32')]);}_0x11382b[_0x8402('0x50')]=qs[_0x8402('0x51')](_0x40f824[_0x8402('0x49')][_0x8402('0x51')]);_0x11382b[_0x8402('0x52')]=qs[_0x8402('0x4a')](_['pick'](_0x40f824[_0x8402('0x49')],_0x5941e1[_0x8402('0x4a')]));_0x11382b[_0x8402('0x52')]['SmsAccountId']=_0xd17d91['id'];if(_0x40f824[_0x8402('0x49')][_0x8402('0x54')]){_0x11382b[_0x8402('0x52')]=_['merge'](_0x11382b[_0x8402('0x52')],{'$or':_[_0x8402('0x47')](_0x11382b[_0x8402('0x4c')],function(_0x579d71){var _0x5e49f8={};_0x5e49f8[_0x579d71]={'$like':'%'+_0x40f824['query'][_0x8402('0x54')]+'%'};return _0x5e49f8;})});}_0x11382b=_[_0x8402('0x55')]({},_0x11382b,_0x40f824['options']);return db[_0x8402('0x68')][_0x8402('0x31')]({'where':_0x11382b[_0x8402('0x52')]})[_0x8402('0x21')](function(_0x8f23ba){_0x46d90f[_0x8402('0x31')]=_0x8f23ba;if(_0x40f824[_0x8402('0x49')][_0x8402('0x5c')]){_0x11382b[_0x8402('0x58')]=[{'all':!![]}];}return db[_0x8402('0x68')][_0x8402('0x6b')](_0x11382b);})[_0x8402('0x21')](function(_0x1d0425){_0x46d90f[_0x8402('0x59')]=_0x1d0425;return _0x46d90f;});}})[_0x8402('0x21')](respondWithFilteredResult(_0x4d01fd,_0x11382b))['catch'](handleError(_0x4d01fd,null));};exports[_0x8402('0x6c')]=function(_0x38a7a6,_0x4fa88b,_0x22a58d){return db['SmsAccount'][_0x8402('0x63')]({'where':{'id':_0x38a7a6[_0x8402('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4fa88b,null))[_0x8402('0x21')](function(_0x2ff188){if(_0x2ff188){return _0x2ff188[_0x8402('0x6c')](_0x38a7a6[_0x8402('0x49')][_0x8402('0x6d')]);}})[_0x8402('0x21')](respondWithStatusCode(_0x4fa88b,null))[_0x8402('0x2b')](handleError(_0x4fa88b,null));};exports[_0x8402('0x6e')]=function(_0x276d23,_0x9785f3,_0x1e8bfe){if(_0x276d23[_0x8402('0x5e')]['id']){delete _0x276d23[_0x8402('0x5e')]['id'];}return db[_0x8402('0x42')][_0x8402('0x63')]({'where':{'id':_0x276d23[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x9785f3,null))[_0x8402('0x21')](function(_0x46b072){if(_0x46b072){_0x276d23['body'][_0x8402('0x67')]=_0x46b072['id'];return db[_0x8402('0x6f')][_0x8402('0x5d')](_0x276d23[_0x8402('0x5e')]);}})['then'](respondWithResult(_0x9785f3,null))[_0x8402('0x2b')](handleError(_0x9785f3,null));};exports[_0x8402('0x70')]=function(_0x3e91cb,_0x1576ee,_0x1935bd){var _0x1c3666={'raw':![],'where':{}};var _0x3fb6fd={};var _0x26e6b5={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8402('0x69')]({'where':{'id':_0x3e91cb[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x1576ee,null))[_0x8402('0x21')](function(_0x58919f){if(_0x58919f){_0x3fb6fd[_0x8402('0x46')]=_[_0x8402('0x48')](db[_0x8402('0x6f')][_0x8402('0x43')]);_0x3fb6fd['query']=_['keys'](_0x3e91cb[_0x8402('0x49')]);_0x3fb6fd[_0x8402('0x4a')]=_[_0x8402('0x4b')](_0x3fb6fd[_0x8402('0x46')],_0x3fb6fd[_0x8402('0x49')]);_0x1c3666[_0x8402('0x4c')]=_[_0x8402('0x4b')](_0x3fb6fd['model'],qs[_0x8402('0x4d')](_0x3e91cb[_0x8402('0x49')]['fields']));_0x1c3666['attributes']=_0x1c3666[_0x8402('0x4c')][_0x8402('0x4e')]?_0x1c3666['attributes']:_0x3fb6fd[_0x8402('0x46')];if(!_0x3e91cb[_0x8402('0x49')]['hasOwnProperty']('nolimit')){_0x1c3666['limit']=qs[_0x8402('0x30')](_0x3e91cb['query'][_0x8402('0x30')]);_0x1c3666[_0x8402('0x32')]=qs[_0x8402('0x32')](_0x3e91cb['query']['offset']);}_0x1c3666[_0x8402('0x50')]=qs[_0x8402('0x51')](_0x3e91cb[_0x8402('0x49')][_0x8402('0x51')]);_0x1c3666['where']=qs['filters'](_[_0x8402('0x53')](_0x3e91cb[_0x8402('0x49')],_0x3fb6fd[_0x8402('0x4a')]));_0x1c3666['where'][_0x8402('0x67')]=_0x58919f['id'];if(_0x3e91cb['query'][_0x8402('0x54')]){_0x1c3666[_0x8402('0x52')]=_['merge'](_0x1c3666[_0x8402('0x52')],{'$or':_[_0x8402('0x47')](_0x1c3666['attributes'],function(_0x29c697){var _0x3d9048={};_0x3d9048[_0x29c697]={'$like':'%'+_0x3e91cb[_0x8402('0x49')]['filter']+'%'};return _0x3d9048;})});}_0x1c3666=_[_0x8402('0x55')]({},_0x1c3666,_0x3e91cb[_0x8402('0x57')]);return db[_0x8402('0x6f')]['count']({'where':_0x1c3666[_0x8402('0x52')]})['then'](function(_0x17707b){_0x26e6b5[_0x8402('0x31')]=_0x17707b;if(_0x3e91cb[_0x8402('0x49')][_0x8402('0x5c')]){_0x1c3666[_0x8402('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8402('0x6b')](_0x1c3666);})[_0x8402('0x21')](function(_0x6cfc51){_0x26e6b5[_0x8402('0x59')]=_0x6cfc51;return _0x26e6b5;});}})['then'](respondWithFilteredResult(_0x1576ee,_0x1c3666))[_0x8402('0x2b')](handleError(_0x1576ee,null));};exports[_0x8402('0x71')]=function(_0x59d7ed,_0x5b8aee,_0x13ff3c){return db[_0x8402('0x42')]['find']({'where':{'id':_0x59d7ed[_0x8402('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5b8aee,null))[_0x8402('0x21')](function(_0x2642c9){if(_0x2642c9){return _0x2642c9[_0x8402('0x71')](_0x59d7ed['query'][_0x8402('0x6d')]);}})[_0x8402('0x21')](respondWithStatusCode(_0x5b8aee,null))[_0x8402('0x2b')](handleError(_0x5b8aee,null));};exports[_0x8402('0x72')]=function(_0x5d2a2c,_0x5a3a93,_0x4a36b5){var _0x42c20f={'channel':_0x8402('0x73')};var _0x2f7a03=[];var _0xfb129a=[];var _0xc09388={};return db[_0x8402('0x42')]['find']({'where':{'id':_0x5d2a2c['params']['id']},'include':[{'model':db[_0x8402('0x74')],'as':'Applications'}]})[_0x8402('0x21')](handleEntityNotFound(_0x5a3a93,null))['then'](function(_0x362b58){_0x42c20f[_0x8402('0x75')]=_0x362b58;_0x42c20f[_0x8402('0x76')]=_[_0x8402('0x77')](_0x362b58[_0x8402('0x78')],[_0x8402('0x79')],['asc']);if(_0x42c20f[_0x8402('0x75')][_0x8402('0x78')]){delete _0x42c20f['account'][_0x8402('0x78')];}return db[_0x8402('0x7a')]['describe']();})[_0x8402('0x21')](function(_0x310285){if(!_0x310285){throw new db[(_0x8402('0x7b'))][(_0x8402('0x7c'))](_0x8402('0x7d'));}_0x2f7a03=_[_0x8402('0x7e')](_['keys'](_0x310285),[_0x8402('0x7f'),_0x8402('0x80')]);_0xfb129a=_[_0x8402('0x7e')](_[_0x8402('0x48')](_0x310285),[_0x8402('0x7f'),'updatedAt',_0x8402('0x81'),_0x8402('0x82')]);_0x42c20f[_0x8402('0x5e')]={'mapKey':'mobile'};if(_0x42c20f[_0x8402('0x75')][_0x8402('0x44')]){switch(_0x42c20f[_0x8402('0x75')]['type']){case _0x8402('0x83'):_0x42c20f[_0x8402('0x5e')]['from']=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x84')];_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')]=_0x5d2a2c[_0x8402('0x5e')]['Body'];_0x42c20f[_0x8402('0x5e')][_0x8402('0x85')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x86')];break;case _0x8402('0x87'):_0x42c20f['body'][_0x8402('0x88')]='+'+_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x89')];_0x42c20f['body'][_0x8402('0x5e')]=_0x5d2a2c[_0x8402('0x5e')]['text'];break;case'connectel':_0x42c20f[_0x8402('0x5e')]['from']=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x88')];_0x42c20f['body'][_0x8402('0x5e')]=_0x5d2a2c[_0x8402('0x5e')]['message'];break;case _0x8402('0x8a'):_0x42c20f[_0x8402('0x5e')]['from']=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x88')];_0x42c20f[_0x8402('0x5e')]['body']=_0x5d2a2c[_0x8402('0x5e')]['body'];_0x42c20f[_0x8402('0x5e')][_0x8402('0x85')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x8b')];break;case _0x8402('0x8c'):_0x42c20f[_0x8402('0x5e')][_0x8402('0x88')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x84')];_0x42c20f[_0x8402('0x5e')]['body']=_0x5d2a2c[_0x8402('0x5e')]['Text'];_0x42c20f[_0x8402('0x5e')][_0x8402('0x85')]=_0x5d2a2c['body'][_0x8402('0x8d')];break;case _0x8402('0x8e'):_0x42c20f[_0x8402('0x5e')][_0x8402('0x88')]='+'+_0x5d2a2c[_0x8402('0x5e')]['results'][0x0][_0x8402('0x88')];_0x42c20f['body'][_0x8402('0x5e')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x8f')][0x0][_0x8402('0x90')];_0x42c20f['body'][_0x8402('0x85')]=_0x5d2a2c['body'][_0x8402('0x8f')][0x0][_0x8402('0x85')];break;case _0x8402('0x91'):_0x42c20f[_0x8402('0x5e')][_0x8402('0x88')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x92')];_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x93')][_0x8402('0x29')];break;case _0x8402('0x94'):_0x42c20f['body']['from']=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x95')];_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x90')];_0x42c20f[_0x8402('0x5e')][_0x8402('0x85')]=_0x5d2a2c[_0x8402('0x5e')][_0x8402('0x96')];break;case _0x8402('0x97'):_0x42c20f[_0x8402('0x5e')][_0x8402('0x85')]=_0x5d2a2c[_0x8402('0x5e')][0x0][_0x8402('0x29')]['id'];_0x42c20f['body'][_0x8402('0x88')]=_0x5d2a2c['body'][0x0][_0x8402('0x29')][_0x8402('0x88')];_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')]=_0x5d2a2c[_0x8402('0x5e')][0x0][_0x8402('0x29')][_0x8402('0x90')];break;case _0x8402('0x98'):_0x42c20f[_0x8402('0x5e')]['from']=_0x5d2a2c['body'][_0x8402('0x88')];_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')]=_0x5d2a2c['body'][_0x8402('0x29')];_0x42c20f[_0x8402('0x5e')][_0x8402('0x85')]=_0x5d2a2c[_0x8402('0x5e')]['refid'];break;}}if(_0x42c20f[_0x8402('0x5e')]['id']){delete _0x42c20f[_0x8402('0x5e')]['id'];}if(_[_0x8402('0x99')](_0x42c20f['body'][_0x8402('0x88')])){throw new db[(_0x8402('0x7b'))][(_0x8402('0x7c'))](_0x8402('0x9a'));}if(_[_0x8402('0x99')](_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')])||_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')]===''){throw new db[(_0x8402('0x7b'))][(_0x8402('0x7c'))](_0x8402('0x9b'));}if(_[_0x8402('0x99')](_0x42c20f[_0x8402('0x5e')][_0x8402('0x9c')])){throw new db[(_0x8402('0x7b'))][(_0x8402('0x7c'))](_0x8402('0x9d')+_0xfb129a);}if(!_[_0x8402('0x9e')](_0xfb129a,_0x42c20f[_0x8402('0x5e')][_0x8402('0x9c')])){throw new db['Sequelize'][(_0x8402('0x7c'))](_0x8402('0x9f')+_0xfb129a);}_0xc09388[_0x42c20f[_0x8402('0x5e')]['mapKey']]=_0x42c20f[_0x8402('0x5e')][_0x8402('0x88')];return db[_0x8402('0xa0')][_0x8402('0x63')]({'where':{'id':_0x42c20f['account'][_0x8402('0x82')]},'include':[{'model':db['CmContact'],'as':_0x8402('0xa1'),'where':_0xc09388,'limit':0x1,'order':[[_0x8402('0x80'),_0x8402('0xa2')]]}]});})['then'](handleEntityNotFound(_0x5a3a93,null))[_0x8402('0x21')](function(_0x4a31c5){if(_0x4a31c5){_0x42c20f[_0x8402('0xa3')]=_[_0x8402('0xa4')](_0x4a31c5,['Contacts']);if(_0x4a31c5[_0x8402('0xa1')][_0x8402('0x4e')]){return _0x4a31c5[_0x8402('0xa1')][0x0];}var _0x38ed91=_['defaults'](_0x42c20f[_0x8402('0x5e')],{'firstName':_0x42c20f['body'][_0x8402('0x88')],'ListId':_0x4a31c5['id']});_0x38ed91[_0x42c20f[_0x8402('0x5e')][_0x8402('0x9c')]]=_0x42c20f[_0x8402('0x5e')][_0x8402('0x88')];return db[_0x8402('0x7a')][_0x8402('0x5d')](_0x38ed91,{'fields':_0x2f7a03,'raw':!![]});}})[_0x8402('0x21')](handleEntityNotFound(_0x5a3a93,null))[_0x8402('0x21')](function(_0x4bf054){if(_0x4bf054){_0x42c20f['contact']=_0x4bf054;var _0xd0ba6e={'ContactId':_0x4bf054['id'],'phone':_0x42c20f[_0x8402('0x5e')][_0x8402('0x88')],'SmsAccountId':_0x5d2a2c['params']['id']};var _0x21fe24={'ContactId':_0x4bf054['id'],'SmsAccountId':_0x5d2a2c[_0x8402('0x5b')]['id'],'closed':![]};return db[_0x8402('0xa5')][_0x8402('0x63')]({'where':_0x21fe24})[_0x8402('0x21')](function(_0x1b3bff){if(_0x1b3bff){return[_0x1b3bff,![]];}return db['SmsInteraction']['create'](_0xd0ba6e)[_0x8402('0x21')](function(_0x5c58be){return[_0x5c58be,!![]];});});}})[_0x8402('0xa6')](function(_0x1e9e78,_0x187e34){_0x42c20f[_0x8402('0xa7')]=_0x1e9e78['get']({'plain':!![]});_0x42c20f[_0x8402('0xa7')][_0x8402('0xa8')]=![];if(_0x187e34){if(_0x42c20f[_0x8402('0x75')][_0x8402('0xa9')]){_0x42c20f[_0x8402('0x76')][_0x8402('0xaa')]({'id':0x0,'priority':_0x42c20f['applications']['length']+0x1,'app':_0x8402('0xab'),'appdata':_0x8402('0xac'),'interval':_0x8402('0xad')});}_0x42c20f[_0x8402('0xa7')][_0x8402('0xa8')]=!![];}return db[_0x8402('0xae')][_0x8402('0x5d')]({'phone':_0x42c20f[_0x8402('0x5e')][_0x8402('0x88')],'messageId':_0x42c20f[_0x8402('0x5e')]['messageId'],'body':_0x42c20f[_0x8402('0x5e')][_0x8402('0x5e')],'SmsAccountId':_0x5d2a2c['params']['id'],'SmsInteractionId':_0x1e9e78['id'],'direction':'in','ContactId':_0x1e9e78[_0x8402('0xaf')],'AttachmentId':_0x42c20f[_0x8402('0x5e')][_0x8402('0xb0')]});})['then'](function(_0x34ee9d){_0x42c20f[_0x8402('0x29')]=_0x34ee9d;if(_0x42c20f['interaction'][_0x8402('0xb1')]){return db[_0x8402('0xb2')]['find']({'attributes':['id',_0x8402('0x3e')],'where':{'id':_0x42c20f[_0x8402('0xa7')]['UserId']}})[_0x8402('0x21')](function(_0x1c2979){if(_0x1c2979){_0x42c20f[_0x8402('0x76')][_0x8402('0xb3')]({'id':0x0,'priority':0x0,'app':_0x8402('0xb4'),'appdata':_0x1c2979[_0x8402('0x3e')]+','+(_0x42c20f['account'][_0x8402('0xb5')]||0xa),'interval':_0x8402('0xad')});}return respondWithRpcPromise('Start',_0x8402('0xb6'),_0x42c20f);});}return respondWithRpcPromise('Start',_0x8402('0xb6'),_0x42c20f);})['then'](function(_0x194b2a){if(_0x194b2a){var _0x24de62=0xc8;var _0x462361=_0x8402('0xb7');logger[_0x8402('0x22')](_0x8402('0x25'),_0x462361,_0x24de62,'entity\x20found');logger[_0x8402('0xb8')](_0x8402('0xb9'),_0x462361,_0x24de62,'entity\x20found',JSON['stringify'](_0x194b2a));if(_0x42c20f[_0x8402('0x75')][_0x8402('0x44')]===_0x8402('0x83')){return _0x5a3a93['status'](_0x24de62)[_0x8402('0x33')](_0x8402('0xba'),'text/xml')['send'](_0x8402('0xbb'));}else{return _0x5a3a93[_0x8402('0x2c')](_0x24de62)[_0x8402('0x2e')](_0x194b2a);}}})['catch'](handleError(_0x5a3a93,null));};exports[_0x8402('0xbc')]=function(_0x24dac0,_0x7b6482){var _0x16401c=_0x24dac0[_0x8402('0x5b')]['id'];var _0xc503d8=_0x24dac0[_0x8402('0x5e')];var _0x3f04c8=0xc8;var _0x2fcdaf=null;return db[_0x8402('0xbd')][_0x8402('0xbe')]({'isolationLevel':db[_0x8402('0xbd')][_0x8402('0xbf')]['ISOLATION_LEVELS'][_0x8402('0xc0')]},function(_0x171a2c){return db[_0x8402('0x42')]['findOne']({'where':{'id':_0x16401c},'transaction':_0x171a2c})[_0x8402('0x21')](function(_0x106b29){if(_0x106b29){return db[_0x8402('0x74')][_0x8402('0x39')]({'where':{'SmsAccountId':_0x16401c},'transaction':_0x171a2c})['then'](function(){var _0x2e43cb=_['map'](_0xc503d8,function(_0x37622b){_0x37622b[_0x8402('0x67')]=_0x16401c;return _0x37622b;});return db[_0x8402('0x74')][_0x8402('0xc1')](_0x2e43cb,{'transaction':_0x171a2c});});}else{_0x3f04c8=0x194;_0x2fcdaf=[];}});})[_0x8402('0x21')](function(){if(_0x3f04c8!==0x194){return db[_0x8402('0x74')][_0x8402('0xc2')]({'where':{'SmsAccountId':_0x16401c},'order':'priority'})[_0x8402('0x21')](function(_0x122d74){_0x2fcdaf=_0x122d74;});}})[_0x8402('0x2b')](function(_0x64c45){_0x3f04c8=0x1f4;logger[_0x8402('0x27')](_0x64c45['stack']);if(_0x64c45[_0x8402('0x3e')]){delete _0x64c45[_0x8402('0x3e')];}_0x2fcdaf=_0x64c45;})['finally'](function(){if(_0x2fcdaf===null){_0x7b6482[_0x8402('0x3c')](_0x3f04c8);}else{if(_0x3f04c8===0x1f4){_0x7b6482[_0x8402('0x2c')](_0x3f04c8)[_0x8402('0xc3')](_0x2fcdaf);}else{_0x7b6482[_0x8402('0x2c')](_0x3f04c8)[_0x8402('0x2e')](_0x2fcdaf);}}});};exports[_0x8402('0xc4')]=function(_0x250398,_0x7374b1,_0x553d23){var _0x106c46={};var _0x704984={};var _0x3a7c50;var _0x53e40b;return db['SmsAccount'][_0x8402('0x69')]({'where':{'id':_0x250398[_0x8402('0x5b')]['id']}})['then'](handleEntityNotFound(_0x7374b1,null))[_0x8402('0x21')](function(_0x7cd633){if(_0x7cd633){_0x3a7c50=_0x7cd633;_0x704984[_0x8402('0x46')]=_[_0x8402('0x48')](db[_0x8402('0x74')][_0x8402('0x43')]);_0x704984[_0x8402('0x49')]=_[_0x8402('0x48')](_0x250398[_0x8402('0x49')]);_0x704984['filters']=_[_0x8402('0x4b')](_0x704984[_0x8402('0x46')],_0x704984[_0x8402('0x49')]);_0x106c46['attributes']=_[_0x8402('0x4b')](_0x704984[_0x8402('0x46')],qs[_0x8402('0x4d')](_0x250398['query'][_0x8402('0x4d')]));_0x106c46[_0x8402('0x4c')]=_0x106c46['attributes'][_0x8402('0x4e')]?_0x106c46[_0x8402('0x4c')]:_0x704984[_0x8402('0x46')];_0x106c46['order']=qs[_0x8402('0x51')](_0x250398[_0x8402('0x49')][_0x8402('0x51')]);_0x106c46['where']=qs[_0x8402('0x4a')](_['pick'](_0x250398['query'],_0x704984['filters']));if(_0x250398[_0x8402('0x49')][_0x8402('0x54')]){_0x106c46[_0x8402('0x52')]=_[_0x8402('0x55')](_0x106c46['where'],{'$or':_[_0x8402('0x47')](_0x106c46['attributes'],function(_0x5e16fd){var _0x223e15={};_0x223e15[_0x5e16fd]={'$like':'%'+_0x250398[_0x8402('0x49')][_0x8402('0x54')]+'%'};return _0x223e15;})});}_0x106c46=_[_0x8402('0x55')]({},_0x106c46,_0x250398[_0x8402('0x57')]);return _0x3a7c50[_0x8402('0xc4')](_0x106c46);}})[_0x8402('0x21')](function(_0x5b328f){if(_0x5b328f){_0x53e40b=_0x5b328f[_0x8402('0x4e')];if(!_0x250398[_0x8402('0x49')][_0x8402('0x4f')](_0x8402('0x6a'))){_0x106c46[_0x8402('0x30')]=qs[_0x8402('0x30')](_0x250398[_0x8402('0x49')][_0x8402('0x30')]);_0x106c46[_0x8402('0x32')]=qs['offset'](_0x250398[_0x8402('0x49')][_0x8402('0x32')]);}return _0x3a7c50[_0x8402('0xc4')](_0x106c46);}})[_0x8402('0x21')](function(_0x5f3eed){if(_0x5f3eed){return _0x5f3eed?{'count':_0x53e40b,'rows':_0x5f3eed}:null;}})[_0x8402('0x21')](respondWithResult(_0x7374b1,null))[_0x8402('0x2b')](handleError(_0x7374b1,null));};exports[_0x8402('0xc5')]=function(_0x18fa16,_0x59368b,_0x364f17){var _0xf605a7={'raw':![],'where':{}};var _0xc7f0be={};var _0x1492ae={'count':0x0,'rows':[]};return db[_0x8402('0x42')][_0x8402('0x69')]({'where':{'id':_0x18fa16[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x59368b,null))[_0x8402('0x21')](function(_0x390c3f){if(_0x390c3f){_0xc7f0be[_0x8402('0x46')]=_[_0x8402('0x48')](db[_0x8402('0xa5')][_0x8402('0x43')]);_0xc7f0be[_0x8402('0x49')]=_[_0x8402('0x48')](_0x18fa16[_0x8402('0x49')]);_0xc7f0be[_0x8402('0x4a')]=_[_0x8402('0x4b')](_0xc7f0be[_0x8402('0x46')],_0xc7f0be['query']);_0xf605a7['attributes']=_[_0x8402('0x4b')](_0xc7f0be[_0x8402('0x46')],qs[_0x8402('0x4d')](_0x18fa16[_0x8402('0x49')][_0x8402('0x4d')]));_0xf605a7['attributes']=_0xf605a7[_0x8402('0x4c')]['length']?_0xf605a7['attributes']:_0xc7f0be[_0x8402('0x46')];if(!_0x18fa16['query']['hasOwnProperty'](_0x8402('0x6a'))){_0xf605a7['limit']=qs[_0x8402('0x30')](_0x18fa16[_0x8402('0x49')][_0x8402('0x30')]);_0xf605a7[_0x8402('0x32')]=qs[_0x8402('0x32')](_0x18fa16['query'][_0x8402('0x32')]);}_0xf605a7[_0x8402('0x50')]=qs[_0x8402('0x51')](_0x18fa16[_0x8402('0x49')][_0x8402('0x51')]);_0xf605a7[_0x8402('0x52')]=qs[_0x8402('0x4a')](_['pick'](_0x18fa16['query'],_0xc7f0be[_0x8402('0x4a')]));_0xf605a7[_0x8402('0x52')][_0x8402('0x67')]=_0x390c3f['id'];if(_0x18fa16[_0x8402('0x49')][_0x8402('0x54')]){_0xf605a7[_0x8402('0x52')]=_[_0x8402('0x55')](_0xf605a7[_0x8402('0x52')],{'$or':_['map'](_0xf605a7['attributes'],function(_0x244eac){var _0x3b82f4={};_0x3b82f4[_0x244eac]={'$like':'%'+_0x18fa16[_0x8402('0x49')][_0x8402('0x54')]+'%'};return _0x3b82f4;})});}_0xf605a7=_[_0x8402('0x55')]({},_0xf605a7,_0x18fa16[_0x8402('0x57')]);return db[_0x8402('0xa5')][_0x8402('0x31')]({'where':_0xf605a7[_0x8402('0x52')]})[_0x8402('0x21')](function(_0x57823c){_0x1492ae['count']=_0x57823c;if(_0x18fa16[_0x8402('0x49')]['includeAll']){_0xf605a7[_0x8402('0x58')]=[{'model':db[_0x8402('0x7a')],'as':_0x8402('0xc6'),'required':![]},{'model':db[_0x8402('0xb2')],'as':'Owner','attributes':[_0x8402('0x3e'),_0x8402('0xc7'),_0x8402('0xc8')],'required':![]},{'model':db['Tag'],'as':_0x8402('0xc9'),'attributes':['id','name',_0x8402('0xca')],'where':_0x18fa16[_0x8402('0x49')]['tag']?{'id':_0x18fa16[_0x8402('0x49')][_0x8402('0xcb')]}:undefined,'required':_0x18fa16[_0x8402('0x49')][_0x8402('0xcb')]?!![]:![]}];}return db[_0x8402('0xa5')]['findAll'](_0xf605a7);})['then'](function(_0x54f693){_0x1492ae[_0x8402('0x59')]=_0x54f693;return _0x1492ae;});}})['then'](respondWithFilteredResult(_0x59368b,_0xf605a7))[_0x8402('0x2b')](handleError(_0x59368b,null));};exports[_0x8402('0xc3')]=function(_0xadf1b4,_0x565a5c,_0xcfe418){var _0x3fffc3,_0x4b9bfb,_0x12e113;if(_['isNil'](_0xadf1b4['body'][_0x8402('0x5e')])||_0xadf1b4[_0x8402('0x5e')][_0x8402('0x5e')]===''){throw new db[(_0x8402('0x7b'))][(_0x8402('0x7c'))](_0x8402('0x9b'));}if(_['isNil'](_0xadf1b4[_0x8402('0x5e')]['to'])){throw new db[(_0x8402('0x7b'))][(_0x8402('0x7c'))](_0x8402('0xcc'));}_0x3fffc3=_0xadf1b4['body']['to'];return db['SmsAccount'][_0x8402('0x63')]({'where':{'id':_0xadf1b4['params']['id']},'include':[{'model':db[_0x8402('0xa0')],'as':_0x8402('0xcd'),'include':[{'model':db[_0x8402('0x7a')],'as':'Contacts','where':{'mobile':_0x3fffc3},'limit':0x1,'order':[[_0x8402('0x80'),_0x8402('0xa2')]]}]}]})[_0x8402('0x21')](handleEntityNotFound(_0x565a5c,null))[_0x8402('0x21')](function(_0x57e7d2){if(_0x57e7d2&&_0x57e7d2[_0x8402('0xcd')]){_0x4b9bfb=_0x57e7d2[_0x8402('0x61')]({'plain':!![]});if(_0x4b9bfb[_0x8402('0xcd')]&&_0x4b9bfb[_0x8402('0xcd')][_0x8402('0xa1')][_0x8402('0x4e')]){return _0x4b9bfb[_0x8402('0xcd')]['Contacts'][0x0];}return db[_0x8402('0x7a')][_0x8402('0x5d')](_[_0x8402('0x18')](_0xadf1b4['body'],{'firstName':_0x3fffc3,'mobile':_0x3fffc3,'phone':_0x3fffc3,'ListId':_0x4b9bfb[_0x8402('0x82')]}));}})['then'](handleEntityNotFound(_0x565a5c,null))[_0x8402('0x21')](function(_0x3afad3){if(_0x3afad3){_0x12e113=_0x3afad3;return db[_0x8402('0xa5')]['find']({'where':{'ContactId':_0x12e113['id'],'closed':![],'SmsAccountId':_0x4b9bfb['id']}})['then'](function(_0x3c4dfa){if(_0x3c4dfa){return[_0x3c4dfa,![]];}return db[_0x8402('0xa5')][_0x8402('0x5d')]({'UserId':_0xadf1b4[_0x8402('0x5f')]['id'],'ContactId':_0x12e113['id'],'SmsAccountId':_0x4b9bfb['id'],'phone':_0x3fffc3,'firstMsgDirection':'out','Messages':[_[_0x8402('0x55')](_0xadf1b4['body'],{'read':![],'body':_0xadf1b4['body'][_0x8402('0x5e')],'phone':_0x3fffc3,'SmsAccountId':_0x4b9bfb['id'],'UserId':_0xadf1b4[_0x8402('0x5f')]['id'],'ContactId':_0x12e113['id']})]},{'include':[{'model':db[_0x8402('0xae')],'as':'Messages'}]})['then'](function(_0x42e94d){return[_0x42e94d,!![]];});});}})[_0x8402('0xa6')](function(_0x30b9d3,_0x45b163){if(_0x45b163){return _0x30b9d3;}return db['SmsMessage'][_0x8402('0x5d')](_[_0x8402('0x55')](_0xadf1b4['body'],{'read':![],'body':_0xadf1b4[_0x8402('0x5e')]['body'],'phone':_0x3fffc3,'SmsAccountId':_0x4b9bfb['id'],'SmsInteractionId':_0x30b9d3['id'],'UserId':_0xadf1b4[_0x8402('0x5f')]['id'],'ContactId':_0x12e113['id']}))['then'](function(_0x8b4241){_0x30b9d3[_0x8402('0xce')][_0x8402('0xcf')]=[];_0x30b9d3[_0x8402('0xce')]['Messages']['push'](_0x8b4241[_0x8402('0xce')]);return _0x30b9d3;});})[_0x8402('0x21')](respondWithResult(_0x565a5c,null))[_0x8402('0x2b')](handleError(_0x565a5c,null));};exports[_0x8402('0x2c')]=function(_0x52bd6f,_0x131bdb,_0x1607a0){if(_0x52bd6f[_0x8402('0x5e')]['id']){delete _0x52bd6f[_0x8402('0x5e')]['id'];}var _0xde203e,_0x120bd4,_0x3c3245;return db[_0x8402('0x42')][_0x8402('0x63')]({'where':{'id':_0x52bd6f[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x131bdb,null))[_0x8402('0x21')](function(_0x21a447){if(_0x21a447){_0x3c3245=_0x21a447;logger['debug'](_0x8402('0x25'),_0x8402('0x2c'),'received\x20delivery\x20report\x20from',_0x21a447['type'],util['inspect'](_0x52bd6f[_0x8402('0x5e')],{'showHidden':![],'depth':null}));switch(_0x21a447[_0x8402('0x44')]){case'skebby':if(_0x52bd6f[_0x8402('0x5e')][_0x8402('0xd0')]&&_0x52bd6f[_0x8402('0x5e')][_0x8402('0x2c')]){_0x120bd4=_0x52bd6f[_0x8402('0x5e')][_0x8402('0x2c')];return db[_0x8402('0xae')][_0x8402('0x63')]({'where':{'messageId':_0x52bd6f[_0x8402('0x5e')]['skebby_dispatch_id']}});}break;case _0x8402('0xd1'):if(_0x52bd6f[_0x8402('0x5e')]['requestid']&&_0x52bd6f[_0x8402('0x5e')][_0x8402('0xd2')]){_0x120bd4=_0x52bd6f[_0x8402('0x5e')]['statusInt'];return db[_0x8402('0xae')][_0x8402('0x63')]({'where':{'messageId':_0x52bd6f[_0x8402('0x5e')][_0x8402('0xd3')]}});}break;case _0x8402('0x8a'):if(_0x52bd6f['body']['message_id']&&_0x52bd6f[_0x8402('0x5e')][_0x8402('0xd4')]){_0x120bd4=_0x52bd6f['body'][_0x8402('0xd4')];return db[_0x8402('0xae')][_0x8402('0x63')]({'where':{'messageId':_0x52bd6f['body'][_0x8402('0x8b')]}});}break;case _0x8402('0x8e'):var _0xa301a3=_0x52bd6f[_0x8402('0x5e')][_0x8402('0x8f')][0x0];if(_0xa301a3[_0x8402('0x85')]&&_0xa301a3[_0x8402('0x2c')][_0x8402('0xd5')]===_0x8402('0xd6')){_0x120bd4=_0xa301a3[_0x8402('0x2c')]['groupName'];return db[_0x8402('0xae')][_0x8402('0x63')]({'where':{'messageId':_0xa301a3[_0x8402('0x85')]}});}break;case _0x8402('0x94'):if(_0x52bd6f[_0x8402('0x5e')][_0x8402('0x85')]&&_0x52bd6f[_0x8402('0x5e')][_0x8402('0x2c')]){_0x120bd4=_0x52bd6f[_0x8402('0x5e')][_0x8402('0x2c')];return db['SmsMessage'][_0x8402('0x63')]({'where':{'messageId':_0x52bd6f['body']['messageId']}});}break;case _0x8402('0x97'):if(_0x52bd6f[_0x8402('0x5e')][0x0][_0x8402('0x29')]['id']){_0x120bd4=_0x52bd6f[_0x8402('0x5e')][0x0][_0x8402('0x44')];return db[_0x8402('0xae')]['find']({'where':{'messageId':_0x52bd6f[_0x8402('0x5e')][0x0][_0x8402('0x29')]['id']}});}break;case _0x8402('0x98'):if(_0x52bd6f['body']['redif']&&_0x52bd6f[_0x8402('0x5e')][_0x8402('0x2c')]){_0x120bd4=_0x52bd6f['body'][_0x8402('0x2c')];return db[_0x8402('0xae')][_0x8402('0x63')]({'where':{'messageId':_0x52bd6f[_0x8402('0x5e')][_0x8402('0xd7')]}});}break;}}})[_0x8402('0x21')](handleEntityNotFound(_0x131bdb,null))[_0x8402('0x21')](function(_0x27e9ef){if(_0x27e9ef){_0xde203e=_0x27e9ef;switch(_0x3c3245[_0x8402('0x44')]){case _0x8402('0x87'):if(_0x120bd4===_0x8402('0xd6')){return _0xde203e[_0x8402('0x38')]({'read':!![]});}else{logger[_0x8402('0x27')](_0x8402('0x25'),_0x8402('0x2c'),_0x8402('0x87'),util[_0x8402('0xd8')](_0x52bd6f[_0x8402('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8402('0xd1'):if(_0x120bd4==='1'){return _0xde203e[_0x8402('0x38')]({'read':!![]});}else{logger[_0x8402('0x27')](_0x8402('0x25'),_0x8402('0x2c'),_0x8402('0x87'),util[_0x8402('0xd8')](_0x52bd6f[_0x8402('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8402('0x8a'):if(!_0x52bd6f[_0x8402('0x5e')][_0x8402('0xd9')]&&_0x120bd4>=0xc8&&_0x120bd4<=0xce){return _0xde203e[_0x8402('0x38')]({'read':!![]});}else{logger[_0x8402('0x27')](_0x8402('0x25'),'status',_0x8402('0x8a'),util[_0x8402('0xd8')](_0x52bd6f['body'],{'showHidden':![],'depth':null}));}break;case _0x8402('0x8e'):var _0x70a4c4=_0x52bd6f['body']['results'][0x0];if(_0x70a4c4[_0x8402('0x2c')][_0x8402('0xd5')]==='DELIVERED'){return _0xde203e[_0x8402('0x38')]({'read':!![]});}else{logger[_0x8402('0x27')](_0x8402('0x25'),'status','infobip',util[_0x8402('0xd8')](_0x52bd6f[_0x8402('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8402('0x94'):if(_0x120bd4=='DELIVERED_TO_GATEWAY'||_0x120bd4==_0x8402('0xda')){return _0xde203e['update']({'read':!![]});}else{logger[_0x8402('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8402('0x2c'),_0x8402('0x94'),util[_0x8402('0xd8')](_0x52bd6f[_0x8402('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8402('0x97'):if(_0x120bd4==_0x8402('0xdb')){return _0xde203e[_0x8402('0x38')]({'read':!![]});}else{logger[_0x8402('0x27')](_0x8402('0x25'),'status',_0x8402('0x97'),util[_0x8402('0xd8')](_0x52bd6f['body'],{'showHidden':![],'depth':null}));}break;case _0x8402('0x98'):if(_0x120bd4===_0x8402('0xdc')||_0x120bd4===_0x8402('0xdd')){return _0xde203e[_0x8402('0x38')]({'read':!![]});}else{logger['error'](_0x8402('0x25'),_0x8402('0x2c'),_0x8402('0x98'),util[_0x8402('0xd8')](_0x52bd6f['body'],{'showHidden':![],'depth':null}));}break;}return _0xde203e;}})[_0x8402('0x21')](respondWithResult(_0x131bdb,null))[_0x8402('0x2b')](handleError(_0x131bdb,null));};exports[_0x8402('0xde')]=function(_0x501f47,_0x189593,_0x762072){var _0x528fea,_0x7153c,_0x38c3e4;return db[_0x8402('0x42')][_0x8402('0x63')]({'where':{'id':_0x501f47[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x189593,null))['then'](function(_0x33abf9){if(_0x33abf9){_0x38c3e4=_0x33abf9;logger[_0x8402('0xb8')](_0x8402('0x25'),_0x8402('0x2c'),'received\x20delivery\x20report\x20from',_0x33abf9[_0x8402('0x44')],util[_0x8402('0xd8')](_0x501f47[_0x8402('0x49')],{'showHidden':![],'depth':null}));switch(_0x33abf9[_0x8402('0x44')]){case _0x8402('0x91'):if(_0x501f47[_0x8402('0x49')]['message-id']&&_0x501f47['query'][_0x8402('0xdf')]){_0x7153c=_0x501f47[_0x8402('0x49')][_0x8402('0xdf')];return db[_0x8402('0xae')][_0x8402('0x63')]({'where':{'messageId':_0x501f47[_0x8402('0x49')][_0x8402('0xe0')]}});}break;}}})['then'](handleEntityNotFound(_0x189593,null))[_0x8402('0x21')](function(_0x106874){if(_0x106874){_0x528fea=_0x106874;switch(_0x38c3e4[_0x8402('0x44')]){case _0x8402('0x91'):if(_0x7153c==='2'||_0x7153c==='6'){return _0x528fea['update']({'read':!![]});}else{logger[_0x8402('0x27')](_0x8402('0x25'),_0x8402('0x2c'),_0x8402('0x91'),util[_0x8402('0xd8')](_0x501f47[_0x8402('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x528fea;}})[_0x8402('0x21')](respondWithResult(_0x189593,null))[_0x8402('0x2b')](handleError(_0x189593,null));};exports[_0x8402('0xe1')]=function(_0x5ec097,_0x3cb7c6,_0x4fef74){return db['SmsAccount']['find']({'where':{'id':_0x5ec097[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x3cb7c6,null))[_0x8402('0x21')](function(_0x16f2ad){if(_0x16f2ad){return _0x16f2ad['addAgents'](_0x5ec097[_0x8402('0x5e')]['ids'],_[_0x8402('0xa4')](_0x5ec097[_0x8402('0x5e')],[_0x8402('0x6d'),'id'])||{})['spread'](function(_0x3110bd){for(var _0x2241a6=0x0;_0x2241a6<_0x5ec097[_0x8402('0x5e')]['ids'][_0x8402('0x4e')];_0x2241a6+=0x1){socket[_0x8402('0xe2')](_0x8402('0xe3'),{'UserId':Number(_0x5ec097[_0x8402('0x5e')][_0x8402('0x6d')][_0x2241a6]),'SmsAccountId':Number(_0x5ec097[_0x8402('0x5b')]['id'])});}return _0x3110bd;});}})[_0x8402('0x21')](respondWithResult(_0x3cb7c6,null))[_0x8402('0x2b')](handleError(_0x3cb7c6,null));};exports['removeAgents']=function(_0x59596a,_0x5f45b0,_0x34f0d5){return db[_0x8402('0x42')][_0x8402('0x63')]({'where':{'id':_0x59596a[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x5f45b0,null))[_0x8402('0x21')](function(_0x1c3cc4){if(_0x1c3cc4){return _0x1c3cc4[_0x8402('0xe4')](_0x59596a[_0x8402('0x49')][_0x8402('0x6d')])[_0x8402('0x21')](function(){if(_['isArray'](_0x59596a[_0x8402('0x49')][_0x8402('0x6d')])){for(var _0x5e08df=0x0;_0x5e08df<_0x59596a[_0x8402('0x49')]['ids'][_0x8402('0x4e')];_0x5e08df+=0x1){socket[_0x8402('0xe2')](_0x8402('0xe5'),{'UserId':Number(_0x59596a['query'][_0x8402('0x6d')][_0x5e08df]),'SmsAccountId':Number(_0x59596a[_0x8402('0x5b')]['id'])});}}else{socket[_0x8402('0xe2')](_0x8402('0xe5'),{'UserId':Number(_0x59596a[_0x8402('0x49')][_0x8402('0x6d')]),'SmsAccountId':Number(_0x59596a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5f45b0,null))[_0x8402('0x2b')](handleError(_0x5f45b0,null));};exports[_0x8402('0xe6')]=function(_0x159d91,_0x14d7e6,_0x4ffc9c){var _0x3c5189={};var _0x1b5e08={};var _0x1174a9;var _0x4bd43b;return db[_0x8402('0x42')][_0x8402('0x69')]({'where':{'id':_0x159d91[_0x8402('0x5b')]['id']}})[_0x8402('0x21')](handleEntityNotFound(_0x14d7e6,null))[_0x8402('0x21')](function(_0x5300bc){if(_0x5300bc){_0x1174a9=_0x5300bc;_0x1b5e08[_0x8402('0x46')]=_['keys'](db[_0x8402('0xb2')][_0x8402('0x43')]);_0x1b5e08[_0x8402('0x49')]=_[_0x8402('0x48')](_0x159d91[_0x8402('0x49')]);_0x1b5e08[_0x8402('0x4a')]=_[_0x8402('0x4b')](_0x1b5e08[_0x8402('0x46')],_0x1b5e08['query']);_0x3c5189['attributes']=_[_0x8402('0x4b')](_0x1b5e08[_0x8402('0x46')],qs[_0x8402('0x4d')](_0x159d91['query']['fields']));_0x3c5189[_0x8402('0x4c')]=_0x3c5189[_0x8402('0x4c')][_0x8402('0x4e')]?_0x3c5189[_0x8402('0x4c')]:_0x1b5e08[_0x8402('0x46')];_0x3c5189[_0x8402('0x50')]=qs['sort'](_0x159d91[_0x8402('0x49')]['sort']);_0x3c5189[_0x8402('0x52')]=qs[_0x8402('0x4a')](_['pick'](_0x159d91[_0x8402('0x49')],_0x1b5e08[_0x8402('0x4a')]));if(_0x159d91['query'][_0x8402('0x54')]){_0x3c5189['where']=_[_0x8402('0x55')](_0x3c5189[_0x8402('0x52')],{'$or':_[_0x8402('0x47')](_0x3c5189['attributes'],function(_0x2fc1e8){var _0x20234b={};_0x20234b[_0x2fc1e8]={'$like':'%'+_0x159d91['query'][_0x8402('0x54')]+'%'};return _0x20234b;})});}_0x3c5189=_[_0x8402('0x55')]({},_0x3c5189,_0x159d91[_0x8402('0x57')]);return _0x1174a9[_0x8402('0xe6')](_0x3c5189);}})[_0x8402('0x21')](function(_0x2f7ca6){if(_0x2f7ca6){_0x4bd43b=_0x2f7ca6['length'];if(!_0x159d91[_0x8402('0x49')][_0x8402('0x4f')]('nolimit')){_0x3c5189[_0x8402('0x30')]=qs[_0x8402('0x30')](_0x159d91[_0x8402('0x49')][_0x8402('0x30')]);_0x3c5189['offset']=qs[_0x8402('0x32')](_0x159d91[_0x8402('0x49')][_0x8402('0x32')]);}return _0x1174a9['getAgents'](_0x3c5189);}})['then'](function(_0xac3a82){if(_0xac3a82){return _0xac3a82?{'count':_0x4bd43b,'rows':_0xac3a82}:null;}})[_0x8402('0x21')](respondWithResult(_0x14d7e6,null))[_0x8402('0x2b')](handleError(_0x14d7e6,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 63bab69..5e6aa5b 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 _0x6bc8=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6bc8,0x150));var _0x86bc=function(_0x4b26f3,_0x2293ed){_0x4b26f3=_0x4b26f3-0x0;var _0x3f87d1=_0x6bc8[_0x4b26f3];return _0x3f87d1;};'use strict';var EventEmitter=require(_0x86bc('0x0'));var SmsAccount=require(_0x86bc('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x86bc('0x2')](0x0);var events={'afterCreate':_0x86bc('0x3'),'afterUpdate':_0x86bc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b663c){return function(_0x7afb4b,_0x22eb0e,_0x270fce){SmsAccountEvents['emit'](_0x2b663c+':'+_0x7afb4b['id'],_0x7afb4b);SmsAccountEvents[_0x86bc('0x5')](_0x2b663c,_0x7afb4b);_0x270fce(null);};}for(var e in events){if(events[_0x86bc('0x6')](e)){var event=events[e];SmsAccount[_0x86bc('0x7')](e,emitEvent(event));}}module[_0x86bc('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xa079=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xa079,0x10c));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x9a07('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9a07('0x1')](0x0);var events={'afterCreate':_0x9a07('0x2'),'afterUpdate':_0x9a07('0x3'),'afterDestroy':_0x9a07('0x4')};function emitEvent(_0x1cce9){return function(_0x3a55fc,_0x217638,_0x1d774a){SmsAccountEvents[_0x9a07('0x5')](_0x1cce9+':'+_0x3a55fc['id'],_0x3a55fc);SmsAccountEvents['emit'](_0x1cce9,_0x3a55fc);_0x1d774a(null);};}for(var e in events){if(events[_0x9a07('0x6')](e)){var event=events[e];SmsAccount[_0x9a07('0x7')](e,emitEvent(event));}}module[_0x9a07('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 f8fe7a4..e64abe0 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 _0xa12e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts'];(function(_0x46261b,_0xd68542){var _0x31e36f=function(_0xf5ed2b){while(--_0xf5ed2b){_0x46261b['push'](_0x46261b['shift']());}};_0x31e36f(++_0xd68542);}(_0xa12e,0x1c7));var _0xea12=function(_0x3658d1,_0x5b3437){_0x3658d1=_0x3658d1-0x0;var _0x3db9de=_0xa12e[_0x3658d1];return _0x3db9de;};'use strict';var _=require('lodash');var util=require(_0xea12('0x0'));var logger=require(_0xea12('0x1'))(_0xea12('0x2'));var moment=require(_0xea12('0x3'));var BPromise=require(_0xea12('0x4'));var rp=require(_0xea12('0x5'));var fs=require('fs');var path=require(_0xea12('0x6'));var rimraf=require(_0xea12('0x7'));var config=require(_0xea12('0x8'));var attributes=require(_0xea12('0x9'));module[_0xea12('0xa')]=function(_0x43fdf5,_0x5ad8e7){return _0x43fdf5[_0xea12('0xb')]('SmsAccount',attributes,{'tableName':_0xea12('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cf7=['request-promise','path','../../config/environment','./smsAccount.attributes','define','sms_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4af3b7,_0x30c116){var _0x24727c=function(_0x3ae9a0){while(--_0x3ae9a0){_0x4af3b7['push'](_0x4af3b7['shift']());}};_0x24727c(++_0x30c116);}(_0x4cf7,0x12f));var _0x74cf=function(_0x3b74a7,_0x145537){_0x3b74a7=_0x3b74a7-0x0;var _0xaa1fd4=_0x4cf7[_0x3b74a7];return _0xaa1fd4;};'use strict';var _=require(_0x74cf('0x0'));var util=require(_0x74cf('0x1'));var logger=require(_0x74cf('0x2'))('api');var moment=require(_0x74cf('0x3'));var BPromise=require(_0x74cf('0x4'));var rp=require(_0x74cf('0x5'));var fs=require('fs');var path=require(_0x74cf('0x6'));var rimraf=require('rimraf');var config=require(_0x74cf('0x7'));var attributes=require(_0x74cf('0x8'));module['exports']=function(_0x23194d,_0x53a576){return _0x23194d[_0x74cf('0x9')]('SmsAccount',attributes,{'tableName':_0x74cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index a32323f..20f11d0 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 _0xafbb=['http','redis','localhost','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','model','attributes','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x344778,_0x408156){var _0x13e6c4=function(_0x461647){while(--_0x461647){_0x344778['push'](_0x344778['shift']());}};_0x13e6c4(++_0x408156);}(_0xafbb,0x65));var _0xbafb=function(_0x130027,_0x110588){_0x130027=_0x130027-0x0;var _0x5ce5ae=_0xafbb[_0x130027];return _0x5ce5ae;};'use strict';var _=require(_0xbafb('0x0'));var util=require(_0xbafb('0x1'));var moment=require(_0xbafb('0x2'));var BPromise=require(_0xbafb('0x3'));var rs=require(_0xbafb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbafb('0x5'))['db'];var utils=require(_0xbafb('0x6'));var logger=require(_0xbafb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbafb('0x8'));var client=jayson[_0xbafb('0x9')][_0xbafb('0xa')]({'port':0x232a});config[_0xbafb('0xb')]=_['defaults'](config['redis'],{'host':_0xbafb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbafb('0xb')]));require('./smsAccount.socket')[_0xbafb('0xd')](socket);function respondWithRpcPromise(_0x4ca1ed,_0x503c99,_0x716df4){return new BPromise(function(_0x5d1538,_0x5d56b7){return client[_0xbafb('0xe')](_0x4ca1ed,_0x716df4)[_0xbafb('0xf')](function(_0x38d11b){logger['info'](_0xbafb('0x10'),_0x503c99,_0xbafb('0x11'));logger['debug'](_0xbafb('0x12'),_0x503c99,_0xbafb('0x11'),JSON[_0xbafb('0x13')](_0x38d11b));if(_0x38d11b[_0xbafb('0x14')]){if(_0x38d11b[_0xbafb('0x14')][_0xbafb('0x15')]===0x1f4){logger[_0xbafb('0x14')](_0xbafb('0x10'),_0x503c99,_0x38d11b[_0xbafb('0x14')][_0xbafb('0x16')]);return _0x5d56b7(_0x38d11b[_0xbafb('0x14')][_0xbafb('0x16')]);}logger[_0xbafb('0x14')](_0xbafb('0x10'),_0x503c99,_0x38d11b['error'][_0xbafb('0x16')]);return _0x5d1538(_0x38d11b[_0xbafb('0x14')][_0xbafb('0x16')]);}else{logger[_0xbafb('0x17')](_0xbafb('0x10'),_0x503c99,_0xbafb('0x11'));_0x5d1538(_0x38d11b[_0xbafb('0x18')][_0xbafb('0x16')]);}})[_0xbafb('0x19')](function(_0x177053){logger['error'](_0xbafb('0x10'),_0x503c99,_0x177053);_0x5d56b7(_0x177053);});});}exports[_0xbafb('0x1a')]=function(_0x52bd2e){var _0x45160e=this;return new Promise(function(_0x30a47b,_0x37ed9e){return db[_0xbafb('0x1b')][_0xbafb('0x1c')]({'raw':_0x52bd2e[_0xbafb('0x1d')]?_0x52bd2e[_0xbafb('0x1d')][_0xbafb('0x1e')]===undefined?!![]:![]:!![],'where':_0x52bd2e['options']?_0x52bd2e[_0xbafb('0x1d')][_0xbafb('0x1f')]||null:null,'attributes':_0x52bd2e[_0xbafb('0x1d')]?_0x52bd2e[_0xbafb('0x1d')]['attributes']||null:null,'include':_0x52bd2e[_0xbafb('0x1d')]?_0x52bd2e[_0xbafb('0x1d')][_0xbafb('0x20')]?_[_0xbafb('0x21')](_0x52bd2e[_0xbafb('0x1d')]['include'],function(_0x345391){return{'model':db[_0x345391[_0xbafb('0x22')]],'as':_0x345391['as'],'attributes':_0x345391[_0xbafb('0x23')],'include':_0x345391['include']?_[_0xbafb('0x21')](_0x345391[_0xbafb('0x20')],function(_0x47696b){return{'model':db[_0x47696b[_0xbafb('0x22')]],'as':_0x47696b['as'],'attributes':_0x47696b['attributes'],'include':_0x47696b[_0xbafb('0x20')]?_[_0xbafb('0x21')](_0x47696b[_0xbafb('0x20')],function(_0x46558f){return{'model':db[_0x46558f[_0xbafb('0x22')]],'as':_0x46558f['as'],'attributes':_0x46558f[_0xbafb('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbafb('0xf')](function(_0x2ff249){logger[_0xbafb('0x17')](_0xbafb('0x1a'),_0x52bd2e);logger[_0xbafb('0x24')](_0xbafb('0x1a'),_0x52bd2e,JSON[_0xbafb('0x13')](_0x2ff249));_0x30a47b(_0x2ff249);})[_0xbafb('0x19')](function(_0x342241){logger[_0xbafb('0x14')]('ShowSmsAccount',_0x342241[_0xbafb('0x16')],_0x52bd2e);_0x37ed9e(_0x45160e[_0xbafb('0x14')](0x1f4,_0x342241[_0xbafb('0x16')]));});});}; \ No newline at end of file +var _0xf797=['attributes','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','redis','localhost','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsAccount,\x20%s,\x20%s','result','ShowSmsAccount','SmsAccount','find','options','raw','where','include','model','map'];(function(_0x1746a6,_0x441a6f){var _0xa7115d=function(_0x228e97){while(--_0x228e97){_0x1746a6['push'](_0x1746a6['shift']());}};_0xa7115d(++_0x441a6f);}(_0xf797,0x82));var _0x7f79=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xf797[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x7f79('0x0'));var util=require(_0x7f79('0x1'));var moment=require(_0x7f79('0x2'));var BPromise=require(_0x7f79('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f79('0x4'));var db=require(_0x7f79('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7f79('0x6'));var jayson=require(_0x7f79('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7f79('0x8')],{'host':_0x7f79('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4e63e8,_0x2e7e96,_0x4733b2){return new BPromise(function(_0x43f535,_0x5d56a4){return client[_0x7f79('0xa')](_0x4e63e8,_0x4733b2)[_0x7f79('0xb')](function(_0x41a85f){logger[_0x7f79('0xc')]('SmsAccount,\x20%s,\x20%s',_0x2e7e96,_0x7f79('0xd'));logger[_0x7f79('0xe')](_0x7f79('0xf'),_0x2e7e96,'request\x20sent',JSON[_0x7f79('0x10')](_0x41a85f));if(_0x41a85f['error']){if(_0x41a85f[_0x7f79('0x11')]['code']===0x1f4){logger[_0x7f79('0x11')]('SmsAccount,\x20%s,\x20%s',_0x2e7e96,_0x41a85f[_0x7f79('0x11')]['message']);return _0x5d56a4(_0x41a85f[_0x7f79('0x11')][_0x7f79('0x12')]);}logger['error'](_0x7f79('0x13'),_0x2e7e96,_0x41a85f[_0x7f79('0x11')]['message']);return _0x43f535(_0x41a85f[_0x7f79('0x11')][_0x7f79('0x12')]);}else{logger[_0x7f79('0xc')]('SmsAccount,\x20%s,\x20%s',_0x2e7e96,'request\x20sent');_0x43f535(_0x41a85f[_0x7f79('0x14')][_0x7f79('0x12')]);}})['catch'](function(_0x565bee){logger[_0x7f79('0x11')](_0x7f79('0x13'),_0x2e7e96,_0x565bee);_0x5d56a4(_0x565bee);});});}exports[_0x7f79('0x15')]=function(_0x4ccaf0){var _0x3f9a87=this;return new Promise(function(_0x2217ee,_0x1bd592){return db[_0x7f79('0x16')][_0x7f79('0x17')]({'raw':_0x4ccaf0[_0x7f79('0x18')]?_0x4ccaf0[_0x7f79('0x18')][_0x7f79('0x19')]===undefined?!![]:![]:!![],'where':_0x4ccaf0['options']?_0x4ccaf0[_0x7f79('0x18')][_0x7f79('0x1a')]||null:null,'attributes':_0x4ccaf0[_0x7f79('0x18')]?_0x4ccaf0[_0x7f79('0x18')]['attributes']||null:null,'include':_0x4ccaf0[_0x7f79('0x18')]?_0x4ccaf0['options']['include']?_['map'](_0x4ccaf0[_0x7f79('0x18')][_0x7f79('0x1b')],function(_0x143c3f){return{'model':db[_0x143c3f[_0x7f79('0x1c')]],'as':_0x143c3f['as'],'attributes':_0x143c3f['attributes'],'include':_0x143c3f[_0x7f79('0x1b')]?_[_0x7f79('0x1d')](_0x143c3f[_0x7f79('0x1b')],function(_0x28f63f){return{'model':db[_0x28f63f[_0x7f79('0x1c')]],'as':_0x28f63f['as'],'attributes':_0x28f63f[_0x7f79('0x1e')],'include':_0x28f63f[_0x7f79('0x1b')]?_[_0x7f79('0x1d')](_0x28f63f['include'],function(_0x1b7849){return{'model':db[_0x1b7849[_0x7f79('0x1c')]],'as':_0x1b7849['as'],'attributes':_0x1b7849['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f79('0xb')](function(_0x127d0a){logger[_0x7f79('0xc')](_0x7f79('0x15'),_0x4ccaf0);logger[_0x7f79('0xe')]('ShowSmsAccount',_0x4ccaf0,JSON[_0x7f79('0x10')](_0x127d0a));_0x2217ee(_0x127d0a);})[_0x7f79('0x1f')](function(_0x149a0c){logger[_0x7f79('0x11')](_0x7f79('0x15'),_0x149a0c[_0x7f79('0x12')],_0x4ccaf0);_0x1bd592(_0x3f9a87[_0x7f79('0x11')](0x1f4,_0x149a0c[_0x7f79('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8d3687e..0218ef7 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 b41534e..285267b 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(_0x4b14cb,_0xce9a95){var _0x39ddbc=function(_0x1630a6){while(--_0x1630a6){_0x4b14cb['push'](_0x4b14cb['shift']());}};_0x39ddbc(++_0xce9a95);}(_0x34e8,0x12c));var _0x834e=function(_0x26c6a1,_0x2c0172){_0x26c6a1=_0x26c6a1-0x0;var _0x2ef996=_0x34e8[_0x26c6a1];return _0x2ef996;};'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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x2e9550,_0x2197bd){var _0xa4fee3=function(_0x13a4fa){while(--_0x13a4fa){_0x2e9550['push'](_0x2e9550['shift']());}};_0xa4fee3(++_0x2197bd);}(_0x008c,0x188));var _0xc008=function(_0x5ec896,_0x4c06cc){_0x5ec896=_0x5ec896-0x0;var _0x5b553b=_0x008c[_0x5ec896];return _0x5b553b;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 6923a7d..ea5814f 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 _0x8e73=['TEXT','*,*,*,*','STRING','noop'];(function(_0xd097a7,_0x4e81b4){var _0x411b55=function(_0x3088e6){while(--_0x3088e6){_0xd097a7['push'](_0xd097a7['shift']());}};_0x411b55(++_0x4e81b4);}(_0x8e73,0xb6));var _0x38e7=function(_0x2fb06b,_0x5b7164){_0x2fb06b=_0x2fb06b-0x0;var _0xdc88b4=_0x8e73[_0x2fb06b];return _0xdc88b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x38e7('0x0')],'allowNull':![],'defaultValue':_0x38e7('0x1')},'appdata':{'type':Sequelize[_0x38e7('0x2')]()},'description':{'type':Sequelize[_0x38e7('0x0')]},'interval':{'type':Sequelize[_0x38e7('0x0')],'defaultValue':_0x38e7('0x3')}}; \ No newline at end of file +var _0xe783=['noop','TEXT','*,*,*,*','sequelize','STRING'];(function(_0x343042,_0x12f667){var _0x4a42d8=function(_0x23b601){while(--_0x23b601){_0x343042['push'](_0x343042['shift']());}};_0x4a42d8(++_0x12f667);}(_0xe783,0x1de));var _0x3e78=function(_0x4fd6e4,_0x37c100){_0x4fd6e4=_0x4fd6e4-0x0;var _0x589559=_0xe783[_0x4fd6e4];return _0x589559;};'use strict';var Sequelize=require(_0x3e78('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3e78('0x1')],'allowNull':![],'defaultValue':_0x3e78('0x2')},'appdata':{'type':Sequelize[_0x3e78('0x3')]()},'description':{'type':Sequelize[_0x3e78('0x1')]},'interval':{'type':Sequelize[_0x3e78('0x1')],'defaultValue':_0x3e78('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a98bada..7421de0 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 _0x805e=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','json','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','SmsApplication','include','findAll','rows','catch','show','params','length','find','create','body','zip-dir','fast-json-patch'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x805e,0xcd));var _0xe805=function(_0x3ab862,_0x584207){_0x3ab862=_0x3ab862-0x0;var _0xfd3898=_0x805e[_0x3ab862];return _0xfd3898;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe805('0x0'));var jsonpatch=require(_0xe805('0x1'));var rp=require('request-promise');var moment=require(_0xe805('0x2'));var BPromise=require(_0xe805('0x3'));var Mustache=require(_0xe805('0x4'));var util=require(_0xe805('0x5'));var path=require(_0xe805('0x6'));var sox=require(_0xe805('0x7'));var csv=require(_0xe805('0x8'));var ejs=require(_0xe805('0x9'));var fs=require('fs');var fs_extra=require(_0xe805('0xa'));var _=require(_0xe805('0xb'));var squel=require(_0xe805('0xc'));var crypto=require(_0xe805('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe805('0xe'));var toCsv=require(_0xe805('0x8'));var querystring=require('querystring');var Papa=require(_0xe805('0xf'));var Redis=require(_0xe805('0x10'));var authService=require(_0xe805('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe805('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe805('0x13'));var utils=require(_0xe805('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe805('0x15'));var db=require(_0xe805('0x16'))['db'];function respondWithStatusCode(_0x502ace,_0x4f60ef){_0x4f60ef=_0x4f60ef||0xcc;return function(_0x43b317){if(_0x43b317){return _0x502ace[_0xe805('0x17')](_0x4f60ef);}return _0x502ace[_0xe805('0x18')](_0x4f60ef)[_0xe805('0x19')]();};}function respondWithResult(_0x61f0a1,_0x314cb3){_0x314cb3=_0x314cb3||0xc8;return function(_0x7601ca){if(_0x7601ca){return _0x61f0a1['status'](_0x314cb3)['json'](_0x7601ca);}};}function respondWithFilteredResult(_0x53e1aa,_0x4b1da5){return function(_0x36dac2){if(_0x36dac2){var _0x2827b4=typeof _0x4b1da5[_0xe805('0x1a')]===_0xe805('0x1b')&&typeof _0x4b1da5[_0xe805('0x1c')]==='undefined';var _0x1bd100=_0x36dac2['count'];var _0x585313=_0x2827b4?0x0:_0x4b1da5[_0xe805('0x1a')];var _0x568535=_0x2827b4?_0x36dac2['count']:_0x4b1da5[_0xe805('0x1a')]+_0x4b1da5[_0xe805('0x1c')];var _0xe9f652;if(_0x568535>=_0x1bd100){_0x568535=_0x1bd100;_0xe9f652=0xc8;}else{_0xe9f652=0xce;}_0x53e1aa[_0xe805('0x18')](_0xe9f652);return _0x53e1aa['set']('Content-Range',_0x585313+'-'+_0x568535+'/'+_0x1bd100)[_0xe805('0x1d')](_0x36dac2);}return null;};}function patchUpdates(_0x434b63){return function(_0x39edb6){try{jsonpatch['apply'](_0x39edb6,_0x434b63,!![]);}catch(_0x53b1dd){return BPromise['reject'](_0x53b1dd);}return _0x39edb6[_0xe805('0x1e')]();};}function saveUpdates(_0x397b74,_0x177a8e){return function(_0x17bd91){if(_0x17bd91){return _0x17bd91[_0xe805('0x1f')](_0x397b74)[_0xe805('0x20')](function(_0x6147f3){return _0x6147f3;});}return null;};}function removeEntity(_0x59c27e,_0x425f6e){return function(_0x2bc50d){if(_0x2bc50d){return _0x2bc50d[_0xe805('0x21')]()[_0xe805('0x20')](function(){_0x59c27e[_0xe805('0x18')](0xcc)[_0xe805('0x19')]();});}};}function handleEntityNotFound(_0xc8478f,_0x9b3c4b){return function(_0x54bcb6){if(!_0x54bcb6){_0xc8478f[_0xe805('0x17')](0x194);}return _0x54bcb6;};}function handleError(_0x326b5e,_0x48103b){_0x48103b=_0x48103b||0x1f4;return function(_0x2eb517){logger[_0xe805('0x22')](_0x2eb517[_0xe805('0x23')]);if(_0x2eb517['name']){delete _0x2eb517[_0xe805('0x24')];}_0x326b5e['status'](_0x48103b)['send'](_0x2eb517);};}exports['index']=function(_0x10b953,_0x25ebf7){var _0x2b4a9c={},_0x4cd12a={},_0x259b58={'count':0x0,'rows':[]};var _0x41de4d=_[_0xe805('0x25')](db['SmsApplication'][_0xe805('0x26')],function(_0x4d8ab3){return{'name':_0x4d8ab3[_0xe805('0x27')],'type':_0x4d8ab3[_0xe805('0x28')][_0xe805('0x29')]};});_0x4cd12a[_0xe805('0x2a')]=_[_0xe805('0x25')](_0x41de4d,_0xe805('0x24'));_0x4cd12a[_0xe805('0x2b')]=_[_0xe805('0x2c')](_0x10b953[_0xe805('0x2b')]);_0x4cd12a[_0xe805('0x2d')]=_[_0xe805('0x2e')](_0x4cd12a[_0xe805('0x2a')],_0x4cd12a[_0xe805('0x2b')]);_0x2b4a9c[_0xe805('0x2f')]=_[_0xe805('0x2e')](_0x4cd12a[_0xe805('0x2a')],qs[_0xe805('0x30')](_0x10b953['query'][_0xe805('0x30')]));_0x2b4a9c[_0xe805('0x2f')]=_0x2b4a9c[_0xe805('0x2f')]['length']?_0x2b4a9c[_0xe805('0x2f')]:_0x4cd12a[_0xe805('0x2a')];if(!_0x10b953[_0xe805('0x2b')][_0xe805('0x31')](_0xe805('0x32'))){_0x2b4a9c[_0xe805('0x1c')]=qs[_0xe805('0x1c')](_0x10b953[_0xe805('0x2b')][_0xe805('0x1c')]);_0x2b4a9c[_0xe805('0x1a')]=qs[_0xe805('0x1a')](_0x10b953[_0xe805('0x2b')]['offset']);}_0x2b4a9c[_0xe805('0x33')]=qs['sort'](_0x10b953['query'][_0xe805('0x34')]);_0x2b4a9c[_0xe805('0x35')]=qs[_0xe805('0x2d')](_[_0xe805('0x36')](_0x10b953['query'],_0x4cd12a[_0xe805('0x2d')]),_0x41de4d);if(_0x10b953[_0xe805('0x2b')]['filter']){_0x2b4a9c[_0xe805('0x35')]=_[_0xe805('0x37')](_0x2b4a9c[_0xe805('0x35')],{'$or':_[_0xe805('0x25')](_0x41de4d,function(_0xa884b8){if(_0xa884b8[_0xe805('0x28')]!==_0xe805('0x38')){var _0x221247={};_0x221247[_0xa884b8['name']]={'$like':'%'+_0x10b953[_0xe805('0x2b')]['filter']+'%'};return _0x221247;}})});}_0x2b4a9c=_['merge']({},_0x2b4a9c,_0x10b953[_0xe805('0x39')]);var _0x58de3e={'where':_0x2b4a9c[_0xe805('0x35')]};return db[_0xe805('0x3a')]['count'](_0x58de3e)[_0xe805('0x20')](function(_0x77fdec){_0x259b58['count']=_0x77fdec;if(_0x10b953[_0xe805('0x2b')]['includeAll']){_0x2b4a9c[_0xe805('0x3b')]=[{'all':!![]}];}return db[_0xe805('0x3a')][_0xe805('0x3c')](_0x2b4a9c);})[_0xe805('0x20')](function(_0x1d86e6){_0x259b58[_0xe805('0x3d')]=_0x1d86e6;return _0x259b58;})[_0xe805('0x20')](respondWithFilteredResult(_0x25ebf7,_0x2b4a9c))[_0xe805('0x3e')](handleError(_0x25ebf7,null));};exports[_0xe805('0x3f')]=function(_0x1c2c77,_0x4988dc){var _0x1068b8={'raw':!![],'where':{'id':_0x1c2c77[_0xe805('0x40')]['id']}},_0x1a07f7={};_0x1a07f7[_0xe805('0x2a')]=_[_0xe805('0x2c')](db[_0xe805('0x3a')]['rawAttributes']);_0x1a07f7[_0xe805('0x2b')]=_[_0xe805('0x2c')](_0x1c2c77[_0xe805('0x2b')]);_0x1a07f7[_0xe805('0x2d')]=_['intersection'](_0x1a07f7[_0xe805('0x2a')],_0x1a07f7[_0xe805('0x2b')]);_0x1068b8[_0xe805('0x2f')]=_['intersection'](_0x1a07f7[_0xe805('0x2a')],qs[_0xe805('0x30')](_0x1c2c77['query'][_0xe805('0x30')]));_0x1068b8[_0xe805('0x2f')]=_0x1068b8[_0xe805('0x2f')][_0xe805('0x41')]?_0x1068b8['attributes']:_0x1a07f7[_0xe805('0x2a')];if(_0x1c2c77[_0xe805('0x2b')]['includeAll']){_0x1068b8[_0xe805('0x3b')]=[{'all':!![]}];}_0x1068b8=_[_0xe805('0x37')]({},_0x1068b8,_0x1c2c77[_0xe805('0x39')]);return db[_0xe805('0x3a')][_0xe805('0x42')](_0x1068b8)[_0xe805('0x20')](handleEntityNotFound(_0x4988dc,null))['then'](respondWithResult(_0x4988dc,null))['catch'](handleError(_0x4988dc,null));};exports[_0xe805('0x43')]=function(_0x27f690,_0x56d576){return db['SmsApplication'][_0xe805('0x43')](_0x27f690[_0xe805('0x44')],{})[_0xe805('0x20')](respondWithResult(_0x56d576,0xc9))['catch'](handleError(_0x56d576,null));};exports[_0xe805('0x1f')]=function(_0x4c3c9d,_0x25956b){if(_0x4c3c9d[_0xe805('0x44')]['id']){delete _0x4c3c9d['body']['id'];}return db[_0xe805('0x3a')][_0xe805('0x42')]({'where':{'id':_0x4c3c9d[_0xe805('0x40')]['id']}})[_0xe805('0x20')](handleEntityNotFound(_0x25956b,null))[_0xe805('0x20')](saveUpdates(_0x4c3c9d[_0xe805('0x44')],null))[_0xe805('0x20')](respondWithResult(_0x25956b,null))[_0xe805('0x3e')](handleError(_0x25956b,null));};exports[_0xe805('0x21')]=function(_0x6bafa2,_0x2cff48){return db[_0xe805('0x3a')][_0xe805('0x42')]({'where':{'id':_0x6bafa2[_0xe805('0x40')]['id']}})['then'](handleEntityNotFound(_0x2cff48,null))['then'](removeEntity(_0x2cff48,null))[_0xe805('0x3e')](handleError(_0x2cff48,null));}; \ No newline at end of file +var _0x1b3d=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','find','body','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x1b3d,0x161));var _0xd1b3=function(_0x4391b6,_0x438a42){_0x4391b6=_0x4391b6-0x0;var _0xe70c96=_0x1b3d[_0x4391b6];return _0xe70c96;};'use strict';var emlformat=require(_0xd1b3('0x0'));var rimraf=require(_0xd1b3('0x1'));var zipdir=require(_0xd1b3('0x2'));var jsonpatch=require(_0xd1b3('0x3'));var rp=require('request-promise');var moment=require(_0xd1b3('0x4'));var BPromise=require(_0xd1b3('0x5'));var Mustache=require(_0xd1b3('0x6'));var util=require('util');var path=require(_0xd1b3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd1b3('0x8'));var fs=require('fs');var fs_extra=require(_0xd1b3('0x9'));var _=require(_0xd1b3('0xa'));var squel=require(_0xd1b3('0xb'));var crypto=require(_0xd1b3('0xc'));var jsforce=require(_0xd1b3('0xd'));var deskjs=require(_0xd1b3('0xe'));var toCsv=require(_0xd1b3('0xf'));var querystring=require(_0xd1b3('0x10'));var Papa=require(_0xd1b3('0x11'));var Redis=require(_0xd1b3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd1b3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd1b3('0x14'));var logger=require(_0xd1b3('0x15'))('api');var utils=require(_0xd1b3('0x16'));var config=require(_0xd1b3('0x17'));var licenseUtil=require(_0xd1b3('0x18'));var db=require(_0xd1b3('0x19'))['db'];function respondWithStatusCode(_0x1226ef,_0x2e5b83){_0x2e5b83=_0x2e5b83||0xcc;return function(_0x2e6b97){if(_0x2e6b97){return _0x1226ef[_0xd1b3('0x1a')](_0x2e5b83);}return _0x1226ef[_0xd1b3('0x1b')](_0x2e5b83)[_0xd1b3('0x1c')]();};}function respondWithResult(_0x2a7588,_0x1c22df){_0x1c22df=_0x1c22df||0xc8;return function(_0x53593f){if(_0x53593f){return _0x2a7588[_0xd1b3('0x1b')](_0x1c22df)[_0xd1b3('0x1d')](_0x53593f);}};}function respondWithFilteredResult(_0x5d86ef,_0x130b0b){return function(_0x28bda3){if(_0x28bda3){var _0x214262=typeof _0x130b0b[_0xd1b3('0x1e')]==='undefined'&&typeof _0x130b0b[_0xd1b3('0x1f')]==='undefined';var _0x4c9fd9=_0x28bda3[_0xd1b3('0x20')];var _0x4c90e1=_0x214262?0x0:_0x130b0b['offset'];var _0x4a800d=_0x214262?_0x28bda3[_0xd1b3('0x20')]:_0x130b0b['offset']+_0x130b0b['limit'];var _0x16a3e6;if(_0x4a800d>=_0x4c9fd9){_0x4a800d=_0x4c9fd9;_0x16a3e6=0xc8;}else{_0x16a3e6=0xce;}_0x5d86ef[_0xd1b3('0x1b')](_0x16a3e6);return _0x5d86ef['set'](_0xd1b3('0x21'),_0x4c90e1+'-'+_0x4a800d+'/'+_0x4c9fd9)[_0xd1b3('0x1d')](_0x28bda3);}return null;};}function patchUpdates(_0x721484){return function(_0x533e29){try{jsonpatch[_0xd1b3('0x22')](_0x533e29,_0x721484,!![]);}catch(_0x43fa1b){return BPromise['reject'](_0x43fa1b);}return _0x533e29[_0xd1b3('0x23')]();};}function saveUpdates(_0x433371,_0x474655){return function(_0x2438a5){if(_0x2438a5){return _0x2438a5[_0xd1b3('0x24')](_0x433371)[_0xd1b3('0x25')](function(_0x3dcb36){return _0x3dcb36;});}return null;};}function removeEntity(_0x325619,_0x20d126){return function(_0x51990b){if(_0x51990b){return _0x51990b['destroy']()['then'](function(){_0x325619[_0xd1b3('0x1b')](0xcc)[_0xd1b3('0x1c')]();});}};}function handleEntityNotFound(_0x132396,_0x19f78c){return function(_0x317d8c){if(!_0x317d8c){_0x132396['sendStatus'](0x194);}return _0x317d8c;};}function handleError(_0x14a773,_0x24f7bc){_0x24f7bc=_0x24f7bc||0x1f4;return function(_0x98b055){logger[_0xd1b3('0x26')](_0x98b055[_0xd1b3('0x27')]);if(_0x98b055[_0xd1b3('0x28')]){delete _0x98b055['name'];}_0x14a773[_0xd1b3('0x1b')](_0x24f7bc)[_0xd1b3('0x29')](_0x98b055);};}exports[_0xd1b3('0x2a')]=function(_0x215819,_0x39f752){var _0x72ba70={},_0x14c588={},_0x494569={'count':0x0,'rows':[]};var _0x500092=_[_0xd1b3('0x2b')](db[_0xd1b3('0x2c')][_0xd1b3('0x2d')],function(_0x52621d){return{'name':_0x52621d[_0xd1b3('0x2e')],'type':_0x52621d[_0xd1b3('0x2f')][_0xd1b3('0x30')]};});_0x14c588['model']=_[_0xd1b3('0x2b')](_0x500092,_0xd1b3('0x28'));_0x14c588[_0xd1b3('0x31')]=_[_0xd1b3('0x32')](_0x215819[_0xd1b3('0x31')]);_0x14c588['filters']=_[_0xd1b3('0x33')](_0x14c588[_0xd1b3('0x34')],_0x14c588[_0xd1b3('0x31')]);_0x72ba70[_0xd1b3('0x35')]=_[_0xd1b3('0x33')](_0x14c588[_0xd1b3('0x34')],qs['fields'](_0x215819[_0xd1b3('0x31')][_0xd1b3('0x36')]));_0x72ba70[_0xd1b3('0x35')]=_0x72ba70['attributes'][_0xd1b3('0x37')]?_0x72ba70['attributes']:_0x14c588['model'];if(!_0x215819[_0xd1b3('0x31')][_0xd1b3('0x38')]('nolimit')){_0x72ba70[_0xd1b3('0x1f')]=qs['limit'](_0x215819[_0xd1b3('0x31')][_0xd1b3('0x1f')]);_0x72ba70[_0xd1b3('0x1e')]=qs[_0xd1b3('0x1e')](_0x215819['query'][_0xd1b3('0x1e')]);}_0x72ba70['order']=qs[_0xd1b3('0x39')](_0x215819[_0xd1b3('0x31')][_0xd1b3('0x39')]);_0x72ba70[_0xd1b3('0x3a')]=qs[_0xd1b3('0x3b')](_['pick'](_0x215819['query'],_0x14c588['filters']),_0x500092);if(_0x215819[_0xd1b3('0x31')][_0xd1b3('0x3c')]){_0x72ba70['where']=_[_0xd1b3('0x3d')](_0x72ba70[_0xd1b3('0x3a')],{'$or':_[_0xd1b3('0x2b')](_0x500092,function(_0x15b721){if(_0x15b721[_0xd1b3('0x2f')]!=='VIRTUAL'){var _0x5d0af4={};_0x5d0af4[_0x15b721[_0xd1b3('0x28')]]={'$like':'%'+_0x215819[_0xd1b3('0x31')]['filter']+'%'};return _0x5d0af4;}})});}_0x72ba70=_[_0xd1b3('0x3d')]({},_0x72ba70,_0x215819[_0xd1b3('0x3e')]);var _0x592713={'where':_0x72ba70[_0xd1b3('0x3a')]};return db[_0xd1b3('0x2c')][_0xd1b3('0x20')](_0x592713)[_0xd1b3('0x25')](function(_0xbed5c5){_0x494569[_0xd1b3('0x20')]=_0xbed5c5;if(_0x215819['query'][_0xd1b3('0x3f')]){_0x72ba70[_0xd1b3('0x40')]=[{'all':!![]}];}return db['SmsApplication'][_0xd1b3('0x41')](_0x72ba70);})[_0xd1b3('0x25')](function(_0x18eb89){_0x494569[_0xd1b3('0x42')]=_0x18eb89;return _0x494569;})[_0xd1b3('0x25')](respondWithFilteredResult(_0x39f752,_0x72ba70))['catch'](handleError(_0x39f752,null));};exports[_0xd1b3('0x43')]=function(_0x29eb47,_0x46c244){var _0x10c132={'raw':!![],'where':{'id':_0x29eb47[_0xd1b3('0x44')]['id']}},_0x115246={};_0x115246['model']=_[_0xd1b3('0x32')](db[_0xd1b3('0x2c')][_0xd1b3('0x2d')]);_0x115246[_0xd1b3('0x31')]=_['keys'](_0x29eb47[_0xd1b3('0x31')]);_0x115246[_0xd1b3('0x3b')]=_[_0xd1b3('0x33')](_0x115246[_0xd1b3('0x34')],_0x115246[_0xd1b3('0x31')]);_0x10c132['attributes']=_['intersection'](_0x115246[_0xd1b3('0x34')],qs['fields'](_0x29eb47[_0xd1b3('0x31')][_0xd1b3('0x36')]));_0x10c132['attributes']=_0x10c132[_0xd1b3('0x35')][_0xd1b3('0x37')]?_0x10c132[_0xd1b3('0x35')]:_0x115246['model'];if(_0x29eb47[_0xd1b3('0x31')]['includeAll']){_0x10c132[_0xd1b3('0x40')]=[{'all':!![]}];}_0x10c132=_[_0xd1b3('0x3d')]({},_0x10c132,_0x29eb47[_0xd1b3('0x3e')]);return db[_0xd1b3('0x2c')][_0xd1b3('0x45')](_0x10c132)[_0xd1b3('0x25')](handleEntityNotFound(_0x46c244,null))[_0xd1b3('0x25')](respondWithResult(_0x46c244,null))['catch'](handleError(_0x46c244,null));};exports['create']=function(_0x2ca204,_0xf48b2b){return db[_0xd1b3('0x2c')]['create'](_0x2ca204[_0xd1b3('0x46')],{})[_0xd1b3('0x25')](respondWithResult(_0xf48b2b,0xc9))['catch'](handleError(_0xf48b2b,null));};exports[_0xd1b3('0x24')]=function(_0x448489,_0x2bea01){if(_0x448489[_0xd1b3('0x46')]['id']){delete _0x448489[_0xd1b3('0x46')]['id'];}return db[_0xd1b3('0x2c')][_0xd1b3('0x45')]({'where':{'id':_0x448489[_0xd1b3('0x44')]['id']}})[_0xd1b3('0x25')](handleEntityNotFound(_0x2bea01,null))[_0xd1b3('0x25')](saveUpdates(_0x448489[_0xd1b3('0x46')],null))[_0xd1b3('0x25')](respondWithResult(_0x2bea01,null))['catch'](handleError(_0x2bea01,null));};exports[_0xd1b3('0x47')]=function(_0x10555b,_0x3e279f){return db[_0xd1b3('0x2c')][_0xd1b3('0x45')]({'where':{'id':_0x10555b[_0xd1b3('0x44')]['id']}})[_0xd1b3('0x25')](handleEntityNotFound(_0x3e279f,null))[_0xd1b3('0x25')](removeEntity(_0x3e279f,null))[_0xd1b3('0x48')](handleError(_0x3e279f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3e401af..6738f80 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 _0xee8b=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird'];(function(_0x153157,_0x40d467){var _0x3a4899=function(_0x2b755e){while(--_0x2b755e){_0x153157['push'](_0x153157['shift']());}};_0x3a4899(++_0x40d467);}(_0xee8b,0x14c));var _0xbee8=function(_0x3cc23e,_0x5518d8){_0x3cc23e=_0x3cc23e-0x0;var _0x43eb86=_0xee8b[_0x3cc23e];return _0x43eb86;};'use strict';var _=require(_0xbee8('0x0'));var util=require(_0xbee8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbee8('0x2'));var BPromise=require(_0xbee8('0x3'));var rp=require(_0xbee8('0x4'));var fs=require('fs');var path=require(_0xbee8('0x5'));var rimraf=require(_0xbee8('0x6'));var config=require(_0xbee8('0x7'));var attributes=require(_0xbee8('0x8'));module['exports']=function(_0x31acd7,_0xc608ab){return _0x31acd7[_0xbee8('0x9')](_0xbee8('0xa'),attributes,{'tableName':_0xbee8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbee8('0xc'),'collate':_0xbee8('0xd')});}; \ No newline at end of file +var _0xf12b=['path','rimraf','../../config/environment','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0xa5aec7,_0x1dc1f7){var _0x3dc3bd=function(_0x192ca5){while(--_0x192ca5){_0xa5aec7['push'](_0xa5aec7['shift']());}};_0x3dc3bd(++_0x1dc1f7);}(_0xf12b,0x133));var _0xbf12=function(_0x8b0f6a,_0x39fa7d){_0x8b0f6a=_0x8b0f6a-0x0;var _0x2842bc=_0xf12b[_0x8b0f6a];return _0x2842bc;};'use strict';var _=require(_0xbf12('0x0'));var util=require(_0xbf12('0x1'));var logger=require('../../config/logger')(_0xbf12('0x2'));var moment=require(_0xbf12('0x3'));var BPromise=require(_0xbf12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf12('0x5'));var rimraf=require(_0xbf12('0x6'));var config=require(_0xbf12('0x7'));var attributes=require(_0xbf12('0x8'));module['exports']=function(_0x2853ad,_0x45d4ee){return _0x2853ad['define'](_0xbf12('0x9'),attributes,{'tableName':_0xbf12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf12('0xb'),'collate':_0xbf12('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 7a628a7..45360e2 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 _0xa3e8=['SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info'];(function(_0x3bede6,_0x7f5cfb){var _0x30b8e9=function(_0x14d6e6){while(--_0x14d6e6){_0x3bede6['push'](_0x3bede6['shift']());}};_0x30b8e9(++_0x7f5cfb);}(_0xa3e8,0x127));var _0x8a3e=function(_0x41f92c,_0x57e922){_0x41f92c=_0x41f92c-0x0;var _0x2c3dbf=_0xa3e8[_0x41f92c];return _0x2c3dbf;};'use strict';var _=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var moment=require(_0x8a3e('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a3e('0x3'));var fs=require('fs');var Redis=require(_0x8a3e('0x4'));var db=require(_0x8a3e('0x5'))['db'];var utils=require(_0x8a3e('0x6'));var logger=require(_0x8a3e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a3e('0x8')][_0x8a3e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2052a8,_0x5a2a25,_0x27f08d){return new BPromise(function(_0x4c7f41,_0x437cde){return client[_0x8a3e('0xa')](_0x2052a8,_0x27f08d)[_0x8a3e('0xb')](function(_0x402a96){logger[_0x8a3e('0xc')](_0x8a3e('0xd'),_0x5a2a25,_0x8a3e('0xe'));logger['debug'](_0x8a3e('0xf'),_0x5a2a25,_0x8a3e('0xe'),JSON[_0x8a3e('0x10')](_0x402a96));if(_0x402a96['error']){if(_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x12')]===0x1f4){logger[_0x8a3e('0x11')](_0x8a3e('0xd'),_0x5a2a25,_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x13')]);return _0x437cde(_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x13')]);}logger[_0x8a3e('0x11')](_0x8a3e('0xd'),_0x5a2a25,_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x13')]);return _0x4c7f41(_0x402a96[_0x8a3e('0x11')]['message']);}else{logger[_0x8a3e('0xc')](_0x8a3e('0xd'),_0x5a2a25,_0x8a3e('0xe'));_0x4c7f41(_0x402a96[_0x8a3e('0x14')][_0x8a3e('0x13')]);}})[_0x8a3e('0x15')](function(_0x48e5a8){logger[_0x8a3e('0x11')]('SmsApplication,\x20%s,\x20%s',_0x5a2a25,_0x48e5a8);_0x437cde(_0x48e5a8);});});} \ No newline at end of file +var _0x6ca3=['bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x6ca3,0xba));var _0x36ca=function(_0x2f4ee6,_0x24a540){_0x2f4ee6=_0x2f4ee6-0x0;var _0x28f20e=_0x6ca3[_0x2f4ee6];return _0x28f20e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x36ca('0x0'));var BPromise=require(_0x36ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36ca('0x2'));var db=require(_0x36ca('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x36ca('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x36ca('0x5'));var client=jayson[_0x36ca('0x6')][_0x36ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4453c2,_0x5996df,_0x5e70ee){return new BPromise(function(_0x1a160c,_0x3c43be){return client['request'](_0x4453c2,_0x5e70ee)['then'](function(_0x14e486){logger[_0x36ca('0x8')](_0x36ca('0x9'),_0x5996df,_0x36ca('0xa'));logger['debug'](_0x36ca('0xb'),_0x5996df,'request\x20sent',JSON[_0x36ca('0xc')](_0x14e486));if(_0x14e486[_0x36ca('0xd')]){if(_0x14e486[_0x36ca('0xd')][_0x36ca('0xe')]===0x1f4){logger[_0x36ca('0xd')]('SmsApplication,\x20%s,\x20%s',_0x5996df,_0x14e486[_0x36ca('0xd')][_0x36ca('0xf')]);return _0x3c43be(_0x14e486[_0x36ca('0xd')]['message']);}logger[_0x36ca('0xd')](_0x36ca('0x9'),_0x5996df,_0x14e486[_0x36ca('0xd')][_0x36ca('0xf')]);return _0x1a160c(_0x14e486[_0x36ca('0xd')][_0x36ca('0xf')]);}else{logger[_0x36ca('0x8')](_0x36ca('0x9'),_0x5996df,_0x36ca('0xa'));_0x1a160c(_0x14e486['result'][_0x36ca('0xf')]);}})[_0x36ca('0x10')](function(_0x212cb2){logger[_0x36ca('0xd')](_0x36ca('0x9'),_0x5996df,_0x212cb2);_0x3c43be(_0x212cb2);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b26942b..edeaae4 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 _0xed3c=['sms','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x3b875b,_0x4f648d){var _0x1ae967=function(_0x42633c){while(--_0x42633c){_0x3b875b['push'](_0x3b875b['shift']());}};_0x1ae967(++_0x4f648d);}(_0xed3c,0x1a6));var _0xced3=function(_0x56899b,_0x80fce){_0x56899b=_0x56899b-0x0;var _0x47d591=_0xed3c[_0x56899b];return _0x47d591;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var fs_extra=require(_0xced3('0x5'));var auth=require(_0xced3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xced3('0x7'));router[_0xced3('0x8')]('/',auth[_0xced3('0x9')](),controller[_0xced3('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xced3('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xced3('0xc')]);router[_0xced3('0x8')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0xe')]);router['get'](_0xced3('0xf'),auth[_0xced3('0x9')](),controller[_0xced3('0x10')]);router['post']('/',auth[_0xced3('0x9')](),controller[_0xced3('0x11')]);router[_0xced3('0x12')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0x13')]);router[_0xced3('0x12')]('/:id/tags',auth[_0xced3('0x9')](),interaction['tracked'](_0xced3('0x14'),_0xced3('0x15')),controller[_0xced3('0x16')]);router[_0xced3('0x17')]('/:id',auth[_0xced3('0x9')](),interaction[_0xced3('0x18')]('sms',_0xced3('0x19')),controller[_0xced3('0x1a')]);router[_0xced3('0x1b')](_0xced3('0x1c'),auth['isAuthenticated'](),interaction[_0xced3('0x18')]('sms',_0xced3('0x1d')),controller[_0xced3('0x1e')]);router[_0xced3('0x1b')](_0xced3('0x1f'),auth[_0xced3('0x9')](),controller[_0xced3('0x20')]);module[_0xced3('0x21')]=router; \ No newline at end of file +var _0xda3f=['/:id/tags','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','sms','smsinteraction:addtags','tracked','smsinteraction:update','update','delete','destroy'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xda3f,0xec));var _0xfda3=function(_0x2a0f91,_0x25937f){_0x2a0f91=_0x2a0f91-0x0;var _0x27b53b=_0xda3f[_0x2a0f91];return _0x27b53b;};'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('./smsInteraction.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/download',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0xe')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xf')]);router['post'](_0xfda3('0xb'),auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xe')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xfda3('0x11'),_0xfda3('0x12')),controller['addTags']);router['put']('/:id',auth[_0xfda3('0x6')](),interaction[_0xfda3('0x13')](_0xfda3('0x11'),_0xfda3('0x14')),controller[_0xfda3('0x15')]);router[_0xfda3('0x16')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),interaction[_0xfda3('0x13')](_0xfda3('0x11'),'smsinteraction:destroy'),controller[_0xfda3('0x17')]);router[_0xfda3('0x16')](_0xfda3('0x18'),auth[_0xfda3('0x6')](),controller['removeTags']);module[_0xfda3('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b9123c3..ee5107f 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 _0x6379=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x511b0b,_0x4c6ec4){var _0x115078=function(_0x45dfaf){while(--_0x45dfaf){_0x511b0b['push'](_0x511b0b['shift']());}};_0x115078(++_0x4c6ec4);}(_0x6379,0x84));var _0x9637=function(_0x68dc02,_0x587379){_0x68dc02=_0x68dc02-0x0;var _0x57524a=_0x6379[_0x68dc02];return _0x57524a;};'use strict';var Sequelize=require(_0x9637('0x0'));var moment=require(_0x9637('0x1'));module[_0x9637('0x2')]={'closed':{'type':Sequelize[_0x9637('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9637('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9637('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9637('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9637('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in',_0x9637('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9637('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x05bc=['moment','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x3d1807,_0x4fabc2){var _0x2b15c0=function(_0x15311e){while(--_0x15311e){_0x3d1807['push'](_0x3d1807['shift']());}};_0x2b15c0(++_0x4fabc2);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc05b('0x0'));module['exports']={'closed':{'type':Sequelize[_0xc05b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc05b('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc05b('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc05b('0x3')]},'note':{'type':Sequelize[_0xc05b('0x3')]},'phone':{'type':Sequelize[_0xc05b('0x3')]},'read1stAt':{'type':Sequelize[_0xc05b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xc05b('0x4')]('in',_0xc05b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc05b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc05b('0x4')]('in',_0xc05b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc05b('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 2dc9852..0e2ee0a 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 _0xfc70=['ids','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','Contact','lastName','Messages','createdAt','secret','read','SmsAccount','Account','fullname','get','Sms','Owner','N.A.','toString','closedAt','firstName','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','map','SmsInteraction','key','getOptions','query','user','catch','model','keys','filters','intersection','attributes','fields','length','merge','options','find','create','body','destroy','params','describe','addMessage','SmsMessage','omit','getMessages','hasOwnProperty','order','sort','pick','SmsInteractionId','filter','where','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','setTags'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0xfc70,0x108));var _0x0fc7=function(_0x298367,_0x45012a){_0x298367=_0x298367-0x0;var _0x28d491=_0xfc70[_0x298367];return _0x28d491;};'use strict';var rimraf=require(_0x0fc7('0x0'));var zipdir=require(_0x0fc7('0x1'));var moment=require('moment');var BPromise=require(_0x0fc7('0x2'));var util=require(_0x0fc7('0x3'));var path=require(_0x0fc7('0x4'));var ejs=require(_0x0fc7('0x5'));var fs=require('fs');var _=require(_0x0fc7('0x6'));var Redis=require(_0x0fc7('0x7'));var interaction=require(_0x0fc7('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x0fc7('0x9'));var logger=require(_0x0fc7('0xa'))(_0x0fc7('0xb'));var config=require('../../config/environment');var db=require(_0x0fc7('0xc'))['db'];config['redis']=_[_0x0fc7('0xd')](config[_0x0fc7('0xe')],{'host':_0x0fc7('0xf'),'port':0x18eb});var socket=require(_0x0fc7('0x10'))(new Redis(config['redis']));require(_0x0fc7('0x11'))['register'](socket);function respondWithStatusCode(_0x441db8,_0x382465){_0x382465=_0x382465||0xcc;return function(_0xd569d9){if(_0xd569d9){return _0x441db8[_0x0fc7('0x12')](_0x382465);}return _0x441db8[_0x0fc7('0x13')](_0x382465)[_0x0fc7('0x14')]();};}function respondWithResult(_0x30a9c5,_0x1c2dd9){_0x1c2dd9=_0x1c2dd9||0xc8;return function(_0x147e0c){if(_0x147e0c){return _0x30a9c5[_0x0fc7('0x13')](_0x1c2dd9)[_0x0fc7('0x15')](_0x147e0c);}};}function respondWithFilteredResult(_0x57f233,_0x1e2309){return function(_0x38ca79){if(_0x38ca79){var _0x5dce66=typeof _0x1e2309[_0x0fc7('0x16')]==='undefined'&&typeof _0x1e2309[_0x0fc7('0x17')]===_0x0fc7('0x18');var _0x5bd6b1=_0x38ca79[_0x0fc7('0x19')];var _0x37f864=_0x5dce66?0x0:_0x1e2309[_0x0fc7('0x16')];var _0x35aeac=_0x5dce66?_0x38ca79[_0x0fc7('0x19')]:_0x1e2309['offset']+_0x1e2309[_0x0fc7('0x17')];var _0x3e7679;if(_0x35aeac>=_0x5bd6b1){_0x35aeac=_0x5bd6b1;_0x3e7679=0xc8;}else{_0x3e7679=0xce;}_0x57f233[_0x0fc7('0x13')](_0x3e7679);return _0x57f233[_0x0fc7('0x1a')](_0x0fc7('0x1b'),_0x37f864+'-'+_0x35aeac+'/'+_0x5bd6b1)[_0x0fc7('0x15')](_0x38ca79);}return null;};}function saveUpdates(_0x3fd244){return function(_0x267ebb){if(_0x267ebb){return _0x267ebb[_0x0fc7('0x1c')](_0x3fd244)[_0x0fc7('0x1d')](function(_0x3369bc){return _0x3369bc;});}return null;};}function removeEntity(_0x487744){return function(_0x21e476){if(_0x21e476){return _0x21e476['destroy']()[_0x0fc7('0x1d')](function(){_0x487744[_0x0fc7('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6254){return function(_0x129f27){if(!_0x129f27){_0x1e6254[_0x0fc7('0x12')](0x194);}return _0x129f27;};}function handleError(_0x49e016,_0x1728da){_0x1728da=_0x1728da||0x1f4;return function(_0x650ef2){logger[_0x0fc7('0x1e')](_0x650ef2[_0x0fc7('0x1f')]);if(_0x650ef2[_0x0fc7('0x20')]){delete _0x650ef2[_0x0fc7('0x20')];}_0x49e016[_0x0fc7('0x13')](_0x1728da)[_0x0fc7('0x21')](_0x650ef2);};}exports['index']=function(_0x11904d,_0x16fd66){var _0x4bbe40={};var _0x3084bc=_[_0x0fc7('0x22')](db[_0x0fc7('0x23')]['rawAttributes'],function(_0x47627c){return{'name':_0x47627c['fieldName'],'type':_0x47627c['type'][_0x0fc7('0x24')]};});_0x4bbe40=qs[_0x0fc7('0x25')](_0x3084bc,_0x11904d);return interaction['findAll']('sms',_0x11904d[_0x0fc7('0x26')],_0x11904d[_0x0fc7('0x27')],_0x4bbe40,_0x3084bc)['then'](respondWithFilteredResult(_0x16fd66,_0x4bbe40))[_0x0fc7('0x28')](handleError(_0x16fd66,null));};exports['show']=function(_0x1ae78f,_0x2b021f){var _0x48568c={'raw':![],'where':{'id':_0x1ae78f['params']['id']}},_0x355fb7={};_0x355fb7[_0x0fc7('0x29')]=_[_0x0fc7('0x2a')](db['SmsInteraction']['rawAttributes']);_0x355fb7[_0x0fc7('0x26')]=_[_0x0fc7('0x2a')](_0x1ae78f[_0x0fc7('0x26')]);_0x355fb7[_0x0fc7('0x2b')]=_[_0x0fc7('0x2c')](_0x355fb7[_0x0fc7('0x29')],_0x355fb7[_0x0fc7('0x26')]);_0x48568c[_0x0fc7('0x2d')]=_[_0x0fc7('0x2c')](_0x355fb7[_0x0fc7('0x29')],qs[_0x0fc7('0x2e')](_0x1ae78f[_0x0fc7('0x26')]['fields']));_0x48568c[_0x0fc7('0x2d')]=_0x48568c[_0x0fc7('0x2d')][_0x0fc7('0x2f')]?_0x48568c[_0x0fc7('0x2d')]:_0x355fb7[_0x0fc7('0x29')];if(_0x1ae78f[_0x0fc7('0x26')]['includeAll']){_0x48568c['include']=[{'all':!![]}];}_0x48568c=_[_0x0fc7('0x30')]({},_0x48568c,_0x1ae78f[_0x0fc7('0x31')]);return db['SmsInteraction'][_0x0fc7('0x32')](_0x48568c)[_0x0fc7('0x1d')](handleEntityNotFound(_0x2b021f,null))['then'](respondWithResult(_0x2b021f,null))['catch'](handleError(_0x2b021f,null));};exports[_0x0fc7('0x33')]=function(_0xc552aa,_0x45191b){return db['SmsInteraction']['create'](_0xc552aa[_0x0fc7('0x34')],{})[_0x0fc7('0x1d')](respondWithResult(_0x45191b,0xc9))['catch'](handleError(_0x45191b,null));};exports[_0x0fc7('0x1c')]=function(_0x43f8fa,_0x2e87de){if(_0x43f8fa[_0x0fc7('0x34')]['id']){delete _0x43f8fa[_0x0fc7('0x34')]['id'];}return db[_0x0fc7('0x23')][_0x0fc7('0x32')]({'where':{'id':_0x43f8fa['params']['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x2e87de,null))[_0x0fc7('0x1d')](saveUpdates(_0x43f8fa[_0x0fc7('0x34')],null))[_0x0fc7('0x1d')](respondWithResult(_0x2e87de,null))['catch'](handleError(_0x2e87de,null));};exports[_0x0fc7('0x35')]=function(_0x37af72,_0x59dc9e){return db['SmsInteraction'][_0x0fc7('0x32')]({'where':{'id':_0x37af72[_0x0fc7('0x36')]['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x59dc9e,null))[_0x0fc7('0x1d')](removeEntity(_0x59dc9e,null))['catch'](handleError(_0x59dc9e,null));};exports[_0x0fc7('0x37')]=function(_0x5ab747,_0x2026ca){return db[_0x0fc7('0x23')][_0x0fc7('0x37')]()[_0x0fc7('0x1d')](respondWithResult(_0x2026ca,null))[_0x0fc7('0x28')](handleError(_0x2026ca,null));};exports[_0x0fc7('0x38')]=function(_0x55956a,_0x3ea9c6){return db[_0x0fc7('0x39')][_0x0fc7('0x32')]({'where':{'id':_0x55956a[_0x0fc7('0x36')]['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x3ea9c6,null))[_0x0fc7('0x1d')](function(_0x341959){if(_0x341959){return _0x341959[_0x0fc7('0x38')](_0x55956a[_0x0fc7('0x34')]['ids'],_[_0x0fc7('0x3a')](_0x55956a[_0x0fc7('0x34')],['ids','id'])||{});}})[_0x0fc7('0x1d')](respondWithResult(_0x3ea9c6,null))['catch'](handleError(_0x3ea9c6,null));};exports[_0x0fc7('0x3b')]=function(_0x4197cf,_0x2d7f06){var _0x580792={'raw':![],'where':{}};var _0xf1e27c={};var _0x50c30a={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x4197cf['params']['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x2d7f06,null))['then'](function(_0x2bd964){if(_0x2bd964){_0xf1e27c['model']=_[_0x0fc7('0x2a')](db[_0x0fc7('0x39')]['rawAttributes']);_0xf1e27c[_0x0fc7('0x26')]=_['keys'](_0x4197cf[_0x0fc7('0x26')]);_0xf1e27c[_0x0fc7('0x2b')]=_['intersection'](_0xf1e27c['model'],_0xf1e27c[_0x0fc7('0x26')]);_0x580792[_0x0fc7('0x2d')]=_['intersection'](_0xf1e27c[_0x0fc7('0x29')],qs[_0x0fc7('0x2e')](_0x4197cf[_0x0fc7('0x26')]['fields']));_0x580792[_0x0fc7('0x2d')]=_0x580792[_0x0fc7('0x2d')][_0x0fc7('0x2f')]?_0x580792['attributes']:_0xf1e27c['model'];if(!_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x3c')]('nolimit')){_0x580792[_0x0fc7('0x17')]=qs[_0x0fc7('0x17')](_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x17')]);_0x580792[_0x0fc7('0x16')]=qs[_0x0fc7('0x16')](_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x16')]);}_0x580792[_0x0fc7('0x3d')]=qs[_0x0fc7('0x3e')](_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x3e')]);_0x580792['where']=qs[_0x0fc7('0x2b')](_[_0x0fc7('0x3f')](_0x4197cf[_0x0fc7('0x26')],_0xf1e27c['filters']));_0x580792['where'][_0x0fc7('0x40')]=_0x2bd964['id'];if(_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x41')]){_0x580792[_0x0fc7('0x42')]=_[_0x0fc7('0x30')](_0x580792[_0x0fc7('0x42')],{'$or':_[_0x0fc7('0x22')](_0x580792[_0x0fc7('0x2d')],function(_0x2b7a7a){var _0x397449={};_0x397449[_0x2b7a7a]={'$like':'%'+_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x41')]+'%'};return _0x397449;})});}if(_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x43')]){var _0xea7af9=_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x43')][_0x0fc7('0x44')](',');var _0x14afa6={};_0x14afa6[_0xea7af9[0x0]]={'$gte':moment(_0xea7af9[0x1])[_0x0fc7('0x45')](_0x0fc7('0x46'))};_0x580792['where']=_[_0x0fc7('0x30')](_0x580792[_0x0fc7('0x42')],_0x14afa6);}_0x580792=_['merge']({},_0x580792,_0x4197cf['options']);return db[_0x0fc7('0x39')][_0x0fc7('0x19')]({'where':_0x580792[_0x0fc7('0x42')]})[_0x0fc7('0x1d')](function(_0x559f4b){_0x50c30a[_0x0fc7('0x19')]=_0x559f4b;if(_0x4197cf['query'][_0x0fc7('0x47')]){_0x580792['include']=[{'all':!![]}];}return db[_0x0fc7('0x39')][_0x0fc7('0x48')](_0x580792);})[_0x0fc7('0x1d')](function(_0x38b4){_0x50c30a[_0x0fc7('0x49')]=_0x38b4;return _0x50c30a;});}})[_0x0fc7('0x1d')](respondWithFilteredResult(_0x2d7f06,_0x580792))[_0x0fc7('0x28')](handleError(_0x2d7f06,null));};exports['addTags']=function(_0x1bd147,_0x4f5faa){return db['SmsInteraction']['find']({'where':{'id':_0x1bd147[_0x0fc7('0x36')]['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x4f5faa,null))[_0x0fc7('0x1d')](function(_0x3dafd1){if(_0x3dafd1){return _0x3dafd1[_0x0fc7('0x4a')](_0x1bd147[_0x0fc7('0x34')][_0x0fc7('0x4b')],_[_0x0fc7('0x3a')](_0x1bd147['body'],[_0x0fc7('0x4b'),'id'])||{})[_0x0fc7('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x0fc7('0x4d')],'where':{'id':_0x1bd147[_0x0fc7('0x34')][_0x0fc7('0x4b')]}});})[_0x0fc7('0x1d')](function(_0x1cb169){socket[_0x0fc7('0x4e')](_0x0fc7('0x4f'),{'id':Number(_0x1bd147['params']['id']),'tags':_0x1cb169||[]});return{'id':Number(_0x1bd147['params']['id']),'tags':_0x1cb169||[]};});}})[_0x0fc7('0x1d')](respondWithResult(_0x4f5faa,null))['catch'](handleError(_0x4f5faa,null));};exports[_0x0fc7('0x50')]=function(_0x1fc4e4,_0x39fa40){return db[_0x0fc7('0x23')][_0x0fc7('0x32')]({'where':{'id':_0x1fc4e4['params']['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x39fa40,null))[_0x0fc7('0x1d')](function(_0x56b7cc){if(_0x56b7cc){return _0x56b7cc[_0x0fc7('0x50')](_0x1fc4e4['query'][_0x0fc7('0x4b')]);}})[_0x0fc7('0x1d')](respondWithStatusCode(_0x39fa40,null))[_0x0fc7('0x28')](handleError(_0x39fa40,null));};exports[_0x0fc7('0x51')]=function(_0x930d14,_0x26a020){var _0xe98305=moment()[_0x0fc7('0x52')]()['toString']();var _0x228f28=path[_0x0fc7('0x53')](config[_0x0fc7('0x54')],_0x0fc7('0x55'),_0x0fc7('0x56'),_0x0fc7('0x57'));var _0x611903=path['join'](_0x228f28,_0xe98305);var _0x258a75=util['format'](_0x0fc7('0x58'),_0x930d14[_0x0fc7('0x36')]['id'],_0xe98305);var _0x44290f=path['join'](_0x228f28,_0x258a75);var _0x199cf9=[];_0x199cf9[_0x0fc7('0x59')]({'model':db[_0x0fc7('0x5a')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x199cf9[_0x0fc7('0x59')]({'model':db['CmContact'],'as':_0x0fc7('0x5b'),'attributes':['id','firstName',_0x0fc7('0x5c')],'raw':!![]});var _0x162715=[{'model':db[_0x0fc7('0x39')],'as':_0x0fc7('0x5d'),'attributes':['id','body',_0x0fc7('0x5e'),'direction',_0x0fc7('0x5f'),_0x0fc7('0x60')],'include':_0x199cf9}];_0x162715[_0x0fc7('0x59')]({'model':db[_0x0fc7('0x61')],'as':_0x0fc7('0x62'),'attributes':['id',_0x0fc7('0x20')]});_0x162715[_0x0fc7('0x59')]({'model':db[_0x0fc7('0x5a')],'as':'Owner','attributes':['id',_0x0fc7('0x63')]});return db[_0x0fc7('0x23')][_0x0fc7('0x32')]({'where':{'id':_0x930d14['params']['id']},'include':_0x162715})['then'](handleEntityNotFound(_0x26a020,null))[_0x0fc7('0x1d')](function(_0x3c7371){if(_0x3c7371){var _0x4441fb=_0x3c7371[_0x0fc7('0x64')]({'plain':!![]});fs['mkdirSync'](_0x611903);var _0x484890={'channel':_0x0fc7('0x65'),'account':_0x4441fb[_0x0fc7('0x62')][_0x0fc7('0x20')],'agent':_0x4441fb[_0x0fc7('0x66')]?_0x4441fb[_0x0fc7('0x66')][_0x0fc7('0x63')]:_0x0fc7('0x67'),'createdAt':moment(_0x4441fb[_0x0fc7('0x5e')])['format'](_0x0fc7('0x46'))[_0x0fc7('0x68')](),'closedAt':_0x4441fb['closed']?moment(_0x4441fb[_0x0fc7('0x69')])[_0x0fc7('0x45')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4441fb['disposition'],'messages':_(_0x4441fb[_0x0fc7('0x5d')])['filter']({'secret':![]})[_0x0fc7('0x22')](function(_0x9ec55e){return{'date':moment(_0x9ec55e[_0x0fc7('0x5e')])[_0x0fc7('0x45')](_0x0fc7('0x46'))[_0x0fc7('0x68')](),'sender':_0x9ec55e['direction']==='out'?_0x9ec55e[_0x0fc7('0x5a')]?_0x9ec55e[_0x0fc7('0x5a')][_0x0fc7('0x63')]:'System':_0x9ec55e[_0x0fc7('0x5b')][_0x0fc7('0x6a')]+(_0x9ec55e[_0x0fc7('0x5b')][_0x0fc7('0x5c')]?'\x20'+_0x9ec55e[_0x0fc7('0x5b')]['lastName']:''),'body':_0x9ec55e[_0x0fc7('0x34')],'direction':_0x9ec55e[_0x0fc7('0x6b')]==='out'?'A':'C','secret':_0x9ec55e['secret'],'read':_0x9ec55e[_0x0fc7('0x60')]};})['value']()};return ejs[_0x0fc7('0x6c')](path[_0x0fc7('0x53')](config[_0x0fc7('0x54')],_0x0fc7('0x55'),'views',_0x0fc7('0x6d')),{'interaction':_0x484890})[_0x0fc7('0x1d')](function(_0x19e6b1){var _0x275e74=path['join'](_0x611903,_0x0fc7('0x6e')+_0x4441fb['id']+'-'+_0xe98305+_0x0fc7('0x6f'));var _0x1f312e={'path':_0x275e74,'channel':'Sms','interactionId':_0x4441fb['id']};return pdf['createPdfFromHTML'](_0x19e6b1,_0x1f312e);})[_0x0fc7('0x1d')](function(){return new BPromise(function(_0x2f29cc,_0x332d1b){zipdir(_0x611903,{'saveTo':_0x44290f},function(_0x353de6,_0x3949d3){if(_0x353de6)return _0x332d1b(_0x353de6);return _0x2f29cc(_0x3949d3);});})[_0x0fc7('0x1d')](function(){return new BPromise(function(_0x251f36,_0x3e9626){rimraf(_0x611903,function(_0x4d2a3e){if(_0x4d2a3e)_0x3e9626(_0x4d2a3e);return _0x251f36();});});})[_0x0fc7('0x1d')](function(){return _0x26a020[_0x0fc7('0x51')](_0x44290f,_0x258a75,function(_0x57abb3){if(_0x57abb3){console[_0x0fc7('0x70')]('err',_0x57abb3);}else{fs['unlinkSync'](_0x44290f);}});});});}else{return _0x26a020[_0x0fc7('0x12')](0xc8);}})[_0x0fc7('0x28')](handleError(_0x26a020,null));}; \ No newline at end of file +var _0x2675=['mkdirSync','Account','N.A.','closedAt','disposition','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','sms','query','user','catch','show','params','keys','filters','model','attributes','intersection','fields','includeAll','merge','options','create','body','find','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Owner','get'];(function(_0x251cec,_0x105364){var _0x51636b=function(_0x5326ed){while(--_0x5326ed){_0x251cec['push'](_0x251cec['shift']());}};_0x51636b(++_0x105364);}(_0x2675,0x91));var _0x5267=function(_0x16d2ae,_0x51822d){_0x16d2ae=_0x16d2ae-0x0;var _0x36be4b=_0x2675[_0x16d2ae];return _0x36be4b;};'use strict';var rimraf=require(_0x5267('0x0'));var zipdir=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require(_0x5267('0x5'));var ejs=require(_0x5267('0x6'));var fs=require('fs');var _=require(_0x5267('0x7'));var Redis=require(_0x5267('0x8'));var interaction=require(_0x5267('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x5267('0xa'));var logger=require('../../config/logger')(_0x5267('0xb'));var config=require(_0x5267('0xc'));var db=require(_0x5267('0xd'))['db'];config[_0x5267('0xe')]=_[_0x5267('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5267('0x10'))(new Redis(config[_0x5267('0xe')]));require(_0x5267('0x11'))[_0x5267('0x12')](socket);function respondWithStatusCode(_0x16b4f1,_0x22271c){_0x22271c=_0x22271c||0xcc;return function(_0x2fa95f){if(_0x2fa95f){return _0x16b4f1[_0x5267('0x13')](_0x22271c);}return _0x16b4f1[_0x5267('0x14')](_0x22271c)[_0x5267('0x15')]();};}function respondWithResult(_0x1ba9df,_0x1ebf62){_0x1ebf62=_0x1ebf62||0xc8;return function(_0x3cd481){if(_0x3cd481){return _0x1ba9df[_0x5267('0x14')](_0x1ebf62)['json'](_0x3cd481);}};}function respondWithFilteredResult(_0x37d294,_0x27b52c){return function(_0x576ee4){if(_0x576ee4){var _0x33063a=typeof _0x27b52c[_0x5267('0x16')]===_0x5267('0x17')&&typeof _0x27b52c[_0x5267('0x18')]===_0x5267('0x17');var _0x18cc26=_0x576ee4[_0x5267('0x19')];var _0x48eb67=_0x33063a?0x0:_0x27b52c[_0x5267('0x16')];var _0x3020a6=_0x33063a?_0x576ee4['count']:_0x27b52c['offset']+_0x27b52c[_0x5267('0x18')];var _0x4622ef;if(_0x3020a6>=_0x18cc26){_0x3020a6=_0x18cc26;_0x4622ef=0xc8;}else{_0x4622ef=0xce;}_0x37d294[_0x5267('0x14')](_0x4622ef);return _0x37d294[_0x5267('0x1a')](_0x5267('0x1b'),_0x48eb67+'-'+_0x3020a6+'/'+_0x18cc26)[_0x5267('0x1c')](_0x576ee4);}return null;};}function saveUpdates(_0x30f9b6){return function(_0x493eee){if(_0x493eee){return _0x493eee[_0x5267('0x1d')](_0x30f9b6)[_0x5267('0x1e')](function(_0xea826e){return _0xea826e;});}return null;};}function removeEntity(_0x4706ac){return function(_0xb1d956){if(_0xb1d956){return _0xb1d956[_0x5267('0x1f')]()[_0x5267('0x1e')](function(){_0x4706ac['status'](0xcc)[_0x5267('0x15')]();});}};}function handleEntityNotFound(_0x8021d7){return function(_0x4096cd){if(!_0x4096cd){_0x8021d7[_0x5267('0x13')](0x194);}return _0x4096cd;};}function handleError(_0x95029c,_0x1a05f3){_0x1a05f3=_0x1a05f3||0x1f4;return function(_0x363a4c){logger[_0x5267('0x20')](_0x363a4c[_0x5267('0x21')]);if(_0x363a4c[_0x5267('0x22')]){delete _0x363a4c[_0x5267('0x22')];}_0x95029c['status'](_0x1a05f3)[_0x5267('0x23')](_0x363a4c);};}exports['index']=function(_0xc7e826,_0x23a449){var _0x2f3118={};var _0x4ff7fb=_[_0x5267('0x24')](db[_0x5267('0x25')][_0x5267('0x26')],function(_0x4c28d8){return{'name':_0x4c28d8[_0x5267('0x27')],'type':_0x4c28d8[_0x5267('0x28')][_0x5267('0x29')]};});_0x2f3118=qs[_0x5267('0x2a')](_0x4ff7fb,_0xc7e826);return interaction['findAll'](_0x5267('0x2b'),_0xc7e826[_0x5267('0x2c')],_0xc7e826[_0x5267('0x2d')],_0x2f3118,_0x4ff7fb)['then'](respondWithFilteredResult(_0x23a449,_0x2f3118))[_0x5267('0x2e')](handleError(_0x23a449,null));};exports[_0x5267('0x2f')]=function(_0x491162,_0x76e9c5){var _0x36ad53={'raw':![],'where':{'id':_0x491162[_0x5267('0x30')]['id']}},_0x455ef7={};_0x455ef7['model']=_[_0x5267('0x31')](db['SmsInteraction'][_0x5267('0x26')]);_0x455ef7[_0x5267('0x2c')]=_[_0x5267('0x31')](_0x491162[_0x5267('0x2c')]);_0x455ef7[_0x5267('0x32')]=_['intersection'](_0x455ef7[_0x5267('0x33')],_0x455ef7[_0x5267('0x2c')]);_0x36ad53[_0x5267('0x34')]=_[_0x5267('0x35')](_0x455ef7['model'],qs[_0x5267('0x36')](_0x491162[_0x5267('0x2c')][_0x5267('0x36')]));_0x36ad53[_0x5267('0x34')]=_0x36ad53['attributes']['length']?_0x36ad53[_0x5267('0x34')]:_0x455ef7[_0x5267('0x33')];if(_0x491162['query'][_0x5267('0x37')]){_0x36ad53['include']=[{'all':!![]}];}_0x36ad53=_[_0x5267('0x38')]({},_0x36ad53,_0x491162[_0x5267('0x39')]);return db[_0x5267('0x25')]['find'](_0x36ad53)[_0x5267('0x1e')](handleEntityNotFound(_0x76e9c5,null))[_0x5267('0x1e')](respondWithResult(_0x76e9c5,null))['catch'](handleError(_0x76e9c5,null));};exports[_0x5267('0x3a')]=function(_0x141598,_0x3b787e){return db['SmsInteraction'][_0x5267('0x3a')](_0x141598[_0x5267('0x3b')],{})['then'](respondWithResult(_0x3b787e,0xc9))[_0x5267('0x2e')](handleError(_0x3b787e,null));};exports[_0x5267('0x1d')]=function(_0x2a2d3c,_0xaa81e7){if(_0x2a2d3c[_0x5267('0x3b')]['id']){delete _0x2a2d3c[_0x5267('0x3b')]['id'];}return db[_0x5267('0x25')][_0x5267('0x3c')]({'where':{'id':_0x2a2d3c[_0x5267('0x30')]['id']}})[_0x5267('0x1e')](handleEntityNotFound(_0xaa81e7,null))[_0x5267('0x1e')](saveUpdates(_0x2a2d3c[_0x5267('0x3b')],null))['then'](respondWithResult(_0xaa81e7,null))['catch'](handleError(_0xaa81e7,null));};exports[_0x5267('0x1f')]=function(_0x2fcf99,_0x44ef0d){return db[_0x5267('0x25')][_0x5267('0x3c')]({'where':{'id':_0x2fcf99[_0x5267('0x30')]['id']}})['then'](handleEntityNotFound(_0x44ef0d,null))[_0x5267('0x1e')](removeEntity(_0x44ef0d,null))[_0x5267('0x2e')](handleError(_0x44ef0d,null));};exports[_0x5267('0x3d')]=function(_0x465517,_0x30dd3f){return db[_0x5267('0x25')][_0x5267('0x3d')]()[_0x5267('0x1e')](respondWithResult(_0x30dd3f,null))[_0x5267('0x2e')](handleError(_0x30dd3f,null));};exports[_0x5267('0x3e')]=function(_0x1dbd8c,_0x47be92){return db[_0x5267('0x3f')][_0x5267('0x3c')]({'where':{'id':_0x1dbd8c[_0x5267('0x30')]['id']}})[_0x5267('0x1e')](handleEntityNotFound(_0x47be92,null))['then'](function(_0x79338f){if(_0x79338f){return _0x79338f['addMessage'](_0x1dbd8c[_0x5267('0x3b')][_0x5267('0x40')],_[_0x5267('0x41')](_0x1dbd8c[_0x5267('0x3b')],[_0x5267('0x40'),'id'])||{});}})['then'](respondWithResult(_0x47be92,null))['catch'](handleError(_0x47be92,null));};exports[_0x5267('0x42')]=function(_0x2db7bb,_0x5a88c9){var _0x3d76e9={'raw':![],'where':{}};var _0x457b09={};var _0x5dccbb={'count':0x0,'rows':[]};return db[_0x5267('0x25')][_0x5267('0x43')]({'where':{'id':_0x2db7bb[_0x5267('0x30')]['id']}})[_0x5267('0x1e')](handleEntityNotFound(_0x5a88c9,null))['then'](function(_0x1f9a78){if(_0x1f9a78){_0x457b09[_0x5267('0x33')]=_[_0x5267('0x31')](db['SmsMessage'][_0x5267('0x26')]);_0x457b09[_0x5267('0x2c')]=_['keys'](_0x2db7bb[_0x5267('0x2c')]);_0x457b09[_0x5267('0x32')]=_[_0x5267('0x35')](_0x457b09[_0x5267('0x33')],_0x457b09[_0x5267('0x2c')]);_0x3d76e9[_0x5267('0x34')]=_[_0x5267('0x35')](_0x457b09[_0x5267('0x33')],qs['fields'](_0x2db7bb[_0x5267('0x2c')][_0x5267('0x36')]));_0x3d76e9[_0x5267('0x34')]=_0x3d76e9[_0x5267('0x34')]['length']?_0x3d76e9[_0x5267('0x34')]:_0x457b09[_0x5267('0x33')];if(!_0x2db7bb[_0x5267('0x2c')][_0x5267('0x44')]('nolimit')){_0x3d76e9[_0x5267('0x18')]=qs[_0x5267('0x18')](_0x2db7bb[_0x5267('0x2c')][_0x5267('0x18')]);_0x3d76e9['offset']=qs[_0x5267('0x16')](_0x2db7bb[_0x5267('0x2c')][_0x5267('0x16')]);}_0x3d76e9[_0x5267('0x45')]=qs[_0x5267('0x46')](_0x2db7bb[_0x5267('0x2c')]['sort']);_0x3d76e9[_0x5267('0x47')]=qs[_0x5267('0x32')](_[_0x5267('0x48')](_0x2db7bb['query'],_0x457b09['filters']));_0x3d76e9['where'][_0x5267('0x49')]=_0x1f9a78['id'];if(_0x2db7bb[_0x5267('0x2c')][_0x5267('0x4a')]){_0x3d76e9[_0x5267('0x47')]=_[_0x5267('0x38')](_0x3d76e9[_0x5267('0x47')],{'$or':_[_0x5267('0x24')](_0x3d76e9['attributes'],function(_0x251c29){var _0x48589d={};_0x48589d[_0x251c29]={'$like':'%'+_0x2db7bb[_0x5267('0x2c')][_0x5267('0x4a')]+'%'};return _0x48589d;})});}if(_0x2db7bb['query'][_0x5267('0x4b')]){var _0x534f4a=_0x2db7bb[_0x5267('0x2c')][_0x5267('0x4b')][_0x5267('0x4c')](',');var _0x1f5024={};_0x1f5024[_0x534f4a[0x0]]={'$gte':moment(_0x534f4a[0x1])[_0x5267('0x4d')](_0x5267('0x4e'))};_0x3d76e9['where']=_[_0x5267('0x38')](_0x3d76e9[_0x5267('0x47')],_0x1f5024);}_0x3d76e9=_[_0x5267('0x38')]({},_0x3d76e9,_0x2db7bb[_0x5267('0x39')]);return db[_0x5267('0x3f')][_0x5267('0x19')]({'where':_0x3d76e9['where']})[_0x5267('0x1e')](function(_0x880647){_0x5dccbb[_0x5267('0x19')]=_0x880647;if(_0x2db7bb['query'][_0x5267('0x37')]){_0x3d76e9['include']=[{'all':!![]}];}return db[_0x5267('0x3f')][_0x5267('0x4f')](_0x3d76e9);})[_0x5267('0x1e')](function(_0x28d455){_0x5dccbb['rows']=_0x28d455;return _0x5dccbb;});}})[_0x5267('0x1e')](respondWithFilteredResult(_0x5a88c9,_0x3d76e9))[_0x5267('0x2e')](handleError(_0x5a88c9,null));};exports[_0x5267('0x50')]=function(_0x178cba,_0x48e7d6){return db[_0x5267('0x25')]['find']({'where':{'id':_0x178cba[_0x5267('0x30')]['id']}})[_0x5267('0x1e')](handleEntityNotFound(_0x48e7d6,null))[_0x5267('0x1e')](function(_0x25e40f){if(_0x25e40f){return _0x25e40f[_0x5267('0x51')](_0x178cba[_0x5267('0x3b')][_0x5267('0x40')],_[_0x5267('0x41')](_0x178cba[_0x5267('0x3b')],[_0x5267('0x40'),'id'])||{})[_0x5267('0x52')](function(){return db['Tag'][_0x5267('0x4f')]({'attributes':['id','name',_0x5267('0x53')],'where':{'id':_0x178cba['body']['ids']}});})[_0x5267('0x1e')](function(_0x543ab2){socket[_0x5267('0x54')](_0x5267('0x55'),{'id':Number(_0x178cba[_0x5267('0x30')]['id']),'tags':_0x543ab2||[]});return{'id':Number(_0x178cba[_0x5267('0x30')]['id']),'tags':_0x543ab2||[]};});}})[_0x5267('0x1e')](respondWithResult(_0x48e7d6,null))[_0x5267('0x2e')](handleError(_0x48e7d6,null));};exports[_0x5267('0x56')]=function(_0x6b1599,_0x75d575){return db[_0x5267('0x25')]['find']({'where':{'id':_0x6b1599[_0x5267('0x30')]['id']}})[_0x5267('0x1e')](handleEntityNotFound(_0x75d575,null))[_0x5267('0x1e')](function(_0x5c3d97){if(_0x5c3d97){return _0x5c3d97[_0x5267('0x56')](_0x6b1599[_0x5267('0x2c')]['ids']);}})[_0x5267('0x1e')](respondWithStatusCode(_0x75d575,null))[_0x5267('0x2e')](handleError(_0x75d575,null));};exports['download']=function(_0x140f62,_0x9564bc){var _0x423ec3=moment()[_0x5267('0x57')]()[_0x5267('0x58')]();var _0x399d9f=path[_0x5267('0x59')](config[_0x5267('0x5a')],_0x5267('0x5b'),_0x5267('0x5c'),'tmp');var _0x317200=path['join'](_0x399d9f,_0x423ec3);var _0x8f85e7=util[_0x5267('0x4d')](_0x5267('0x5d'),_0x140f62[_0x5267('0x30')]['id'],_0x423ec3);var _0x5c7dfc=path['join'](_0x399d9f,_0x8f85e7);var _0x7ded27=[];_0x7ded27[_0x5267('0x5e')]({'model':db[_0x5267('0x5f')],'as':'User','attributes':['id',_0x5267('0x60')],'raw':!![]});_0x7ded27['push']({'model':db[_0x5267('0x61')],'as':_0x5267('0x62'),'attributes':['id',_0x5267('0x63'),_0x5267('0x64')],'raw':!![]});var _0x106906=[{'model':db[_0x5267('0x3f')],'as':_0x5267('0x65'),'attributes':['id',_0x5267('0x3b'),_0x5267('0x66'),_0x5267('0x67'),_0x5267('0x68'),_0x5267('0x69')],'include':_0x7ded27}];_0x106906[_0x5267('0x5e')]({'model':db[_0x5267('0x6a')],'as':'Account','attributes':['id',_0x5267('0x22')]});_0x106906['push']({'model':db['User'],'as':_0x5267('0x6b'),'attributes':['id','fullname']});return db[_0x5267('0x25')][_0x5267('0x3c')]({'where':{'id':_0x140f62[_0x5267('0x30')]['id']},'include':_0x106906})[_0x5267('0x1e')](handleEntityNotFound(_0x9564bc,null))[_0x5267('0x1e')](function(_0x3f39b4){if(_0x3f39b4){var _0x1b36a1=_0x3f39b4[_0x5267('0x6c')]({'plain':!![]});fs[_0x5267('0x6d')](_0x317200);var _0x43a09e={'channel':'Sms','account':_0x1b36a1[_0x5267('0x6e')][_0x5267('0x22')],'agent':_0x1b36a1[_0x5267('0x6b')]?_0x1b36a1['Owner'][_0x5267('0x60')]:_0x5267('0x6f'),'createdAt':moment(_0x1b36a1[_0x5267('0x66')])[_0x5267('0x4d')](_0x5267('0x4e'))[_0x5267('0x58')](),'closedAt':_0x1b36a1['closed']?moment(_0x1b36a1[_0x5267('0x70')])[_0x5267('0x4d')](_0x5267('0x4e'))[_0x5267('0x58')]():'','disposition':_0x1b36a1[_0x5267('0x71')],'messages':_(_0x1b36a1[_0x5267('0x65')])['filter']({'secret':![]})[_0x5267('0x24')](function(_0x25b93d){return{'date':moment(_0x25b93d[_0x5267('0x66')])[_0x5267('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5267('0x58')](),'sender':_0x25b93d[_0x5267('0x67')]===_0x5267('0x72')?_0x25b93d[_0x5267('0x5f')]?_0x25b93d[_0x5267('0x5f')][_0x5267('0x60')]:_0x5267('0x73'):_0x25b93d[_0x5267('0x62')]['firstName']+(_0x25b93d[_0x5267('0x62')][_0x5267('0x64')]?'\x20'+_0x25b93d[_0x5267('0x62')][_0x5267('0x64')]:''),'body':_0x25b93d[_0x5267('0x3b')],'direction':_0x25b93d['direction']===_0x5267('0x72')?'A':'C','secret':_0x25b93d[_0x5267('0x68')],'read':_0x25b93d[_0x5267('0x69')]};})[_0x5267('0x74')]()};return ejs[_0x5267('0x75')](path[_0x5267('0x59')](config[_0x5267('0x5a')],'server',_0x5267('0x76'),_0x5267('0x77')),{'interaction':_0x43a09e})[_0x5267('0x1e')](function(_0x4b42b0){var _0x214ba7=path['join'](_0x317200,_0x5267('0x78')+_0x1b36a1['id']+'-'+_0x423ec3+_0x5267('0x79'));var _0x384c95={'path':_0x214ba7,'channel':_0x5267('0x7a'),'interactionId':_0x1b36a1['id']};return pdf['createPdfFromHTML'](_0x4b42b0,_0x384c95);})['then'](function(){return new BPromise(function(_0x21115a,_0x3215f0){zipdir(_0x317200,{'saveTo':_0x5c7dfc},function(_0x380807,_0x7c91d9){if(_0x380807)return _0x3215f0(_0x380807);return _0x21115a(_0x7c91d9);});})['then'](function(){return new BPromise(function(_0x3825ae,_0x5e308d){rimraf(_0x317200,function(_0x282133){if(_0x282133)_0x5e308d(_0x282133);return _0x3825ae();});});})[_0x5267('0x1e')](function(){return _0x9564bc[_0x5267('0x7b')](_0x5c7dfc,_0x8f85e7,function(_0x33f6d6){if(_0x33f6d6){console[_0x5267('0x7c')](_0x5267('0x7d'),_0x33f6d6);}else{fs[_0x5267('0x7e')](_0x5c7dfc);}});});});}else{return _0x9564bc[_0x5267('0x13')](0xc8);}})['catch'](handleError(_0x9564bc,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 7507d04..d17cada 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 _0xc2c7=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then'];(function(_0x555155,_0xaa307a){var _0x1095f4=function(_0x47686e){while(--_0x47686e){_0x555155['push'](_0x555155['shift']());}};_0x1095f4(++_0xaa307a);}(_0xc2c7,0x134));var _0x7c2c=function(_0x17f360,_0xf394d5){_0x17f360=_0x17f360-0x0;var _0x3df335=_0xc2c7[_0x17f360];return _0x3df335;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x1')];var SmsMessage=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7c2c('0x3')](0x0);var events={'afterCreate':_0x7c2c('0x4'),'afterUpdate':_0x7c2c('0x5'),'afterDestroy':_0x7c2c('0x6')};function emitEvent(_0x4bbc14){return function(_0x59f346,_0x31dc4e,_0x42ecc9){_0x59f346[_0x7c2c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4abe93){_0x59f346['setDataValue'](_0x7c2c('0x8'),_0x4abe93[_0x7c2c('0x9')](function(_0x3e668f){return{'id':_0x3e668f['id']};}));return SmsMessage[_0x7c2c('0xa')]({'where':{'SmsInteractionId':_0x59f346['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c2c('0xb')](function(_0x57b107){_0x59f346[_0x7c2c('0xc')](_0x7c2c('0xd'),_0x57b107[_0x7c2c('0xe')]);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14+':'+_0x59f346['id'],_0x59f346);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14,_0x59f346);_0x42ecc9(null);})[_0x7c2c('0x10')](_0x42ecc9(null));};}for(var e in events){if(events[_0x7c2c('0x11')](e)){var event=events[e];SmsInteraction[_0x7c2c('0x12')](e,emitEvent(event));}}module[_0x7c2c('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0xb78e=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook'];(function(_0xe25e9d,_0x5f124d){var _0x3e1a2f=function(_0x2fa2f0){while(--_0x2fa2f0){_0xe25e9d['push'](_0xe25e9d['shift']());}};_0x3e1a2f(++_0x5f124d);}(_0xb78e,0x1c9));var _0xeb78=function(_0x45f528,_0x239200){_0x45f528=_0x45f528-0x0;var _0x1393b3=_0xb78e[_0x45f528];return _0x1393b3;};'use strict';var EventEmitter=require(_0xeb78('0x0'));var SmsInteraction=require(_0xeb78('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xeb78('0x1'))['db'][_0xeb78('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xeb78('0x3')](0x0);var events={'afterCreate':_0xeb78('0x4'),'afterUpdate':_0xeb78('0x5'),'afterDestroy':_0xeb78('0x6')};function emitEvent(_0x13ef9d){return function(_0x1bdf83,_0x57ec6b,_0x3c35e7){_0x1bdf83[_0xeb78('0x7')]({'attributes':['id'],'raw':!![]})[_0xeb78('0x8')](function(_0x30c884){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xa'),_0x30c884[_0xeb78('0xb')](function(_0x573406){return{'id':_0x573406['id']};}));return SmsMessage[_0xeb78('0xc')]({'where':{'SmsInteractionId':_0x1bdf83['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb78('0x8')](function(_0xa1ca82){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xd'),_0xa1ca82[_0xeb78('0xe')]);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d+':'+_0x1bdf83['id'],_0x1bdf83);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d,_0x1bdf83);_0x3c35e7(null);})[_0xeb78('0x10')](_0x3c35e7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xeb78('0x11')](e,emitEvent(event));}}module[_0xeb78('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index f97b66d..17b0917 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 _0xff02=['util','api','bluebird','request-promise','path','../../config/environment','define','SmsInteraction','sms_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2a0733,_0x290d2b){var _0x15dc3b=function(_0x5265){while(--_0x5265){_0x2a0733['push'](_0x2a0733['shift']());}};_0x15dc3b(++_0x290d2b);}(_0xff02,0x103));var _0x2ff0=function(_0x582513,_0xe38251){_0x582513=_0x582513-0x0;var _0x4ed247=_0xff02[_0x582513];return _0x4ed247;};'use strict';var _=require(_0x2ff0('0x0'));var util=require(_0x2ff0('0x1'));var logger=require('../../config/logger')(_0x2ff0('0x2'));var moment=require('moment');var BPromise=require(_0x2ff0('0x3'));var rp=require(_0x2ff0('0x4'));var fs=require('fs');var path=require(_0x2ff0('0x5'));var rimraf=require('rimraf');var config=require(_0x2ff0('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x29d77d,_0x30643c){return _0x29d77d[_0x2ff0('0x7')](_0x2ff0('0x8'),attributes,{'tableName':_0x2ff0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x172cf5,_0x578768,_0x2efbcd){if(_0x172cf5['changed']('closed')){_0x172cf5[_0x2ff0('0xa')]=moment()[_0x2ff0('0xb')](_0x2ff0('0xc'));}_0x2efbcd(null,_0x172cf5);}}});}; \ No newline at end of file +var _0xcf31=['moment','bluebird','rimraf','./smsInteraction.attributes','define','sms_interactions','changed','closed','format','util','../../config/logger','api'];(function(_0x18398f,_0x3dbe75){var _0x4714f1=function(_0x94963d){while(--_0x94963d){_0x18398f['push'](_0x18398f['shift']());}};_0x4714f1(++_0x3dbe75);}(_0xcf31,0x1ad));var _0x1cf3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcf31[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1cf3('0x0'));var logger=require(_0x1cf3('0x1'))(_0x1cf3('0x2'));var moment=require(_0x1cf3('0x3'));var BPromise=require(_0x1cf3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1cf3('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cf3('0x6'));module['exports']=function(_0x53e70c,_0x3197c4){return _0x53e70c[_0x1cf3('0x7')]('SmsInteraction',attributes,{'tableName':_0x1cf3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc6cd74,_0x4be4b3,_0x1baf35){if(_0xc6cd74[_0x1cf3('0x9')](_0x1cf3('0xa'))){_0xc6cd74['closedAt']=moment()[_0x1cf3('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1baf35(null,_0xc6cd74);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index bd3823e..ae3ed0d 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 _0xb663=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','SmsInteraction','update','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','addTags','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring'];(function(_0x3afbdf,_0x9e463b){var _0x5b6861=function(_0x31d287){while(--_0x31d287){_0x3afbdf['push'](_0x3afbdf['shift']());}};_0x5b6861(++_0x9e463b);}(_0xb663,0x1dc));var _0x3b66=function(_0x18ebea,_0x4042f1){_0x18ebea=_0x18ebea-0x0;var _0x21bd52=_0xb663[_0x18ebea];return _0x21bd52;};'use strict';var _=require(_0x3b66('0x0'));var util=require('util');var moment=require(_0x3b66('0x1'));var BPromise=require(_0x3b66('0x2'));var rs=require(_0x3b66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b66('0x4'))['db'];var utils=require(_0x3b66('0x5'));var logger=require(_0x3b66('0x6'))(_0x3b66('0x7'));var config=require(_0x3b66('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3b66('0x9')]({'port':0x232a});config[_0x3b66('0xa')]=_[_0x3b66('0xb')](config[_0x3b66('0xa')],{'host':_0x3b66('0xc'),'port':0x18eb});var socket=require(_0x3b66('0xd'))(new Redis(config[_0x3b66('0xa')]));require('./smsInteraction.socket')[_0x3b66('0xe')](socket);function respondWithRpcPromise(_0x3d176a,_0x4da194,_0x1ba541){return new BPromise(function(_0x28c79f,_0x24e6e9){return client[_0x3b66('0xf')](_0x3d176a,_0x1ba541)[_0x3b66('0x10')](function(_0x24639b){logger[_0x3b66('0x11')](_0x3b66('0x12'),_0x4da194,_0x3b66('0x13'));logger[_0x3b66('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x4da194,'request\x20sent',JSON[_0x3b66('0x15')](_0x24639b));if(_0x24639b['error']){if(_0x24639b[_0x3b66('0x16')][_0x3b66('0x17')]===0x1f4){logger[_0x3b66('0x16')](_0x3b66('0x12'),_0x4da194,_0x24639b[_0x3b66('0x16')]['message']);return _0x24e6e9(_0x24639b[_0x3b66('0x16')]['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x4da194,_0x24639b['error'][_0x3b66('0x18')]);return _0x28c79f(_0x24639b[_0x3b66('0x16')][_0x3b66('0x18')]);}else{logger['info'](_0x3b66('0x12'),_0x4da194,_0x3b66('0x13'));_0x28c79f(_0x24639b['result'][_0x3b66('0x18')]);}})[_0x3b66('0x19')](function(_0x28258e){logger[_0x3b66('0x16')](_0x3b66('0x12'),_0x4da194,_0x28258e);_0x24e6e9(_0x28258e);});});}exports['UpdateSmsInteraction']=function(_0x5a0488){var _0x54c75c=this;return new Promise(function(_0xcc333a,_0x37ccc8){return db[_0x3b66('0x1a')][_0x3b66('0x1b')](_0x5a0488['body'],{'raw':_0x5a0488[_0x3b66('0x1c')]?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a0488['options']?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x1e')]||null:null,'attributes':_0x5a0488[_0x3b66('0x1c')]?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x1f')]||null:null,'limit':_0x5a0488[_0x3b66('0x1c')]?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x20')]||null:null})['then'](function(_0x431946){logger[_0x3b66('0x11')](_0x3b66('0x21'),_0x5a0488);logger[_0x3b66('0x14')](_0x3b66('0x21'),_0x5a0488,JSON[_0x3b66('0x15')](_0x431946));_0xcc333a(_0x431946);})[_0x3b66('0x19')](function(_0x23ad55){logger[_0x3b66('0x16')]('UpdateSmsInteraction',_0x23ad55['message'],_0x5a0488);_0x37ccc8(_0x54c75c[_0x3b66('0x16')](0x1f4,_0x23ad55[_0x3b66('0x18')]));});});};exports[_0x3b66('0x22')]=function(_0x5099d6){return new Promise(function(_0x5a8c16,_0x4f8491){return db[_0x3b66('0x1a')]['find']({'where':_0x5099d6['options']?_0x5099d6[_0x3b66('0x1c')][_0x3b66('0x1e')]||null:null})[_0x3b66('0x10')](function(_0x5e62fb){if(_0x5e62fb){return _0x5e62fb[_0x3b66('0x23')](_0x5099d6[_0x3b66('0x24')][_0x3b66('0x25')],_['omit'](_0x5099d6[_0x3b66('0x24')],['ids','id'])||{});}})[_0x3b66('0x26')](function(_0x143979){logger[_0x3b66('0x11')](_0x3b66('0x27'),_0x5099d6);logger[_0x3b66('0x14')](_0x3b66('0x27'),_0x5099d6,JSON[_0x3b66('0x15')](_0x143979));_0x5a8c16(_0x143979);})[_0x3b66('0x19')](function(_0x3a7d21){logger[_0x3b66('0x16')](_0x3b66('0x27'),_0x3a7d21[_0x3b66('0x18')],_0x5099d6);_0x4f8491(_this['error'](0x1f4,_0x3a7d21[_0x3b66('0x18')]));});});}; \ No newline at end of file +var _0x27b7=['AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','options','where','attributes','limit','then','find','addTags','body','ids','omit'];(function(_0x5672ee,_0x77ff50){var _0x37d1cb=function(_0x17db3f){while(--_0x17db3f){_0x5672ee['push'](_0x5672ee['shift']());}};_0x37d1cb(++_0x77ff50);}(_0x27b7,0xdf));var _0x727b=function(_0x2173d2,_0x4013cc){_0x2173d2=_0x2173d2-0x0;var _0x177637=_0x27b7[_0x2173d2];return _0x177637;};'use strict';var _=require(_0x727b('0x0'));var util=require(_0x727b('0x1'));var moment=require('moment');var BPromise=require(_0x727b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x727b('0x3'));var db=require(_0x727b('0x4'))['db'];var utils=require(_0x727b('0x5'));var logger=require(_0x727b('0x6'))('rpc');var config=require(_0x727b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x727b('0x8')]['http']({'port':0x232a});config[_0x727b('0x9')]=_['defaults'](config['redis'],{'host':_0x727b('0xa'),'port':0x18eb});var socket=require(_0x727b('0xb'))(new Redis(config[_0x727b('0x9')]));require(_0x727b('0xc'))[_0x727b('0xd')](socket);function respondWithRpcPromise(_0x329394,_0x473e79,_0x4b3c09){return new BPromise(function(_0x3d0f4c,_0x15865d){return client[_0x727b('0xe')](_0x329394,_0x4b3c09)['then'](function(_0x135bb0){logger[_0x727b('0xf')](_0x727b('0x10'),_0x473e79,'request\x20sent');logger[_0x727b('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x473e79,_0x727b('0x12'),JSON[_0x727b('0x13')](_0x135bb0));if(_0x135bb0[_0x727b('0x14')]){if(_0x135bb0[_0x727b('0x14')][_0x727b('0x15')]===0x1f4){logger[_0x727b('0x14')](_0x727b('0x10'),_0x473e79,_0x135bb0[_0x727b('0x14')][_0x727b('0x16')]);return _0x15865d(_0x135bb0[_0x727b('0x14')]['message']);}logger[_0x727b('0x14')](_0x727b('0x10'),_0x473e79,_0x135bb0[_0x727b('0x14')][_0x727b('0x16')]);return _0x3d0f4c(_0x135bb0[_0x727b('0x14')]['message']);}else{logger[_0x727b('0xf')](_0x727b('0x10'),_0x473e79,_0x727b('0x12'));_0x3d0f4c(_0x135bb0[_0x727b('0x17')][_0x727b('0x16')]);}})['catch'](function(_0x1fdc55){logger[_0x727b('0x14')](_0x727b('0x10'),_0x473e79,_0x1fdc55);_0x15865d(_0x1fdc55);});});}exports[_0x727b('0x18')]=function(_0x50ea9b){var _0x5cc345=this;return new Promise(function(_0x4a8adb,_0x13516c){return db[_0x727b('0x19')]['update'](_0x50ea9b['body'],{'raw':_0x50ea9b[_0x727b('0x1a')]?_0x50ea9b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50ea9b['options']?_0x50ea9b['options'][_0x727b('0x1b')]||null:null,'attributes':_0x50ea9b[_0x727b('0x1a')]?_0x50ea9b['options'][_0x727b('0x1c')]||null:null,'limit':_0x50ea9b[_0x727b('0x1a')]?_0x50ea9b['options'][_0x727b('0x1d')]||null:null})[_0x727b('0x1e')](function(_0x5294b5){logger[_0x727b('0xf')]('UpdateSmsInteraction',_0x50ea9b);logger[_0x727b('0x11')]('UpdateSmsInteraction',_0x50ea9b,JSON['stringify'](_0x5294b5));_0x4a8adb(_0x5294b5);})['catch'](function(_0x2085f9){logger['error'](_0x727b('0x18'),_0x2085f9[_0x727b('0x16')],_0x50ea9b);_0x13516c(_0x5cc345[_0x727b('0x14')](0x1f4,_0x2085f9[_0x727b('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x109fda){return new Promise(function(_0x13129f,_0x41d44f){return db[_0x727b('0x19')][_0x727b('0x1f')]({'where':_0x109fda[_0x727b('0x1a')]?_0x109fda[_0x727b('0x1a')][_0x727b('0x1b')]||null:null})['then'](function(_0x5a2989){if(_0x5a2989){return _0x5a2989[_0x727b('0x20')](_0x109fda[_0x727b('0x21')][_0x727b('0x22')],_[_0x727b('0x23')](_0x109fda['body'],[_0x727b('0x22'),'id'])||{});}})['spread'](function(_0x1bf3b4){logger[_0x727b('0xf')](_0x727b('0x24'),_0x109fda);logger['debug']('AddTags',_0x109fda,JSON['stringify'](_0x1bf3b4));_0x13129f(_0x1bf3b4);})['catch'](function(_0x2debcf){logger[_0x727b('0x14')](_0x727b('0x24'),_0x2debcf[_0x727b('0x16')],_0x109fda);_0x41d44f(_this[_0x727b('0x14')](0x1f4,_0x2debcf[_0x727b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0356b79..b5f13ee 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 _0x8155=['emit','removeListener','register','length','./smsInteraction.events','save'];(function(_0x52b9d2,_0x4bb0a9){var _0x4c6570=function(_0xb9768e){while(--_0xb9768e){_0x52b9d2['push'](_0x52b9d2['shift']());}};_0x4c6570(++_0x4bb0a9);}(_0x8155,0x160));var _0x5815=function(_0x25df48,_0x2d1c65){_0x25df48=_0x25df48-0x0;var _0x3a1461=_0x8155[_0x25df48];return _0x3a1461;};'use strict';var SmsInteractionEvents=require(_0x5815('0x0'));var events=[_0x5815('0x1'),'remove','update'];function createListener(_0xbe04b4,_0x22e020){return function(_0x2dc242){_0x22e020[_0x5815('0x2')](_0xbe04b4,_0x2dc242);};}function removeListener(_0x1980f7,_0x8d6852){return function(){SmsInteractionEvents[_0x5815('0x3')](_0x1980f7,_0x8d6852);};}exports[_0x5815('0x4')]=function(_0x5789ed){for(var _0x4ce21e=0x0,_0x28962b=events[_0x5815('0x5')];_0x4ce21e<_0x28962b;_0x4ce21e++){var _0x3b8f6c=events[_0x4ce21e];var _0x5378be=createListener('smsInteraction:'+_0x3b8f6c,_0x5789ed);SmsInteractionEvents['on'](_0x3b8f6c,_0x5378be);}}; \ No newline at end of file +var _0x3a36=['update','emit','removeListener','register','smsInteraction:','save','remove'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0x3a36,0x186));var _0x63a3=function(_0x4309b5,_0x2717c8){_0x4309b5=_0x4309b5-0x0;var _0xaddc65=_0x3a36[_0x4309b5];return _0xaddc65;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x63a3('0x0'),_0x63a3('0x1'),_0x63a3('0x2')];function createListener(_0x5730d0,_0x3c92a9){return function(_0x1a5c38){_0x3c92a9[_0x63a3('0x3')](_0x5730d0,_0x1a5c38);};}function removeListener(_0x3ed8de,_0x633fa9){return function(){SmsInteractionEvents[_0x63a3('0x4')](_0x3ed8de,_0x633fa9);};}exports[_0x63a3('0x5')]=function(_0x3070aa){for(var _0x20d303=0x0,_0x164a08=events['length'];_0x20d303<_0x164a08;_0x20d303++){var _0x26b5a4=events[_0x20d303];var _0x76566f=createListener(_0x63a3('0x6')+_0x26b5a4,_0x3070aa);SmsInteractionEvents['on'](_0x26b5a4,_0x76566f);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 12a958e..e16f7eb 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 _0xf891=['tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/reject','multer','util','express','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x9c000,_0x320650){var _0x10b93b=function(_0x14b185){while(--_0x14b185){_0x9c000['push'](_0x9c000['shift']());}};_0x10b93b(++_0x320650);}(_0xf891,0x93));var _0x1f89=function(_0x1d4315,_0x57dee3){_0x1d4315=_0x1d4315-0x0;var _0xa9ccf2=_0xf891[_0x1d4315];return _0xa9ccf2;};'use strict';var multer=require(_0x1f89('0x0'));var util=require(_0x1f89('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1f89('0x2'));var router=express[_0x1f89('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f89('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f89('0x5'));var controller=require(_0x1f89('0x6'));router[_0x1f89('0x7')]('/',auth['isAuthenticated'](),controller[_0x1f89('0x8')]);router[_0x1f89('0x7')]('/describe',auth[_0x1f89('0x9')](),controller[_0x1f89('0xa')]);router[_0x1f89('0x7')](_0x1f89('0xb'),auth[_0x1f89('0x9')](),controller[_0x1f89('0xc')]);router[_0x1f89('0xd')]('/',auth['isAuthenticated'](),interaction[_0x1f89('0xe')](_0x1f89('0xf'),_0x1f89('0x10')),controller[_0x1f89('0x11')]);router[_0x1f89('0xd')](_0x1f89('0x12'),controller[_0x1f89('0x13')]);router[_0x1f89('0x14')]('/:id',auth[_0x1f89('0x9')](),controller[_0x1f89('0x15')]);router[_0x1f89('0x14')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1f89('0x14')](_0x1f89('0x16'),auth[_0x1f89('0x9')](),controller['reject']);router['delete'](_0x1f89('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc97e=['get','isAuthenticated','index','/:id','show','tracked','smsmessage:create','post','/:id/status','status','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller'];(function(_0x497af6,_0x474cee){var _0x24bce4=function(_0xea888e){while(--_0xea888e){_0x497af6['push'](_0x497af6['shift']());}};_0x24bce4(++_0x474cee);}(_0xc97e,0x148));var _0xec97=function(_0x1a0a63,_0x4b736e){_0x1a0a63=_0x1a0a63-0x0;var _0x4a68dc=_0xc97e[_0x1a0a63];return _0x4a68dc;};'use strict';var multer=require(_0xec97('0x0'));var util=require('util');var path=require(_0xec97('0x1'));var timeout=require(_0xec97('0x2'));var express=require(_0xec97('0x3'));var router=express['Router']();var fs_extra=require(_0xec97('0x4'));var auth=require(_0xec97('0x5'));var interaction=require(_0xec97('0x6'));var config=require('../../config/environment');var controller=require(_0xec97('0x7'));router[_0xec97('0x8')]('/',auth[_0xec97('0x9')](),controller[_0xec97('0xa')]);router[_0xec97('0x8')]('/describe',auth[_0xec97('0x9')](),controller['describe']);router[_0xec97('0x8')](_0xec97('0xb'),auth[_0xec97('0x9')](),controller[_0xec97('0xc')]);router['post']('/',auth[_0xec97('0x9')](),interaction[_0xec97('0xd')]('sms',_0xec97('0xe')),controller['create']);router[_0xec97('0xf')](_0xec97('0x10'),controller[_0xec97('0x11')]);router[_0xec97('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xec97('0x12')](_0xec97('0x13'),auth[_0xec97('0x9')](),controller['accept']);router[_0xec97('0x12')](_0xec97('0x14'),auth[_0xec97('0x9')](),controller[_0xec97('0x15')]);router['delete']('/:id',auth[_0xec97('0x9')](),controller[_0xec97('0x16')]);module[_0xec97('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index b2f7c4e..1bd6ef4 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 _0x8a86=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','exports','medium'];(function(_0x250c9b,_0x4b8cc8){var _0xc09774=function(_0x5117d2){while(--_0x5117d2){_0x250c9b['push'](_0x250c9b['shift']());}};_0xc09774(++_0x4b8cc8);}(_0x8a86,0xd6));var _0x68a8=function(_0x2fd8ba,_0x4f9882){_0x2fd8ba=_0x2fd8ba-0x0;var _0x2ece64=_0x8a86[_0x2fd8ba];return _0x2ece64;};'use strict';var Sequelize=require('sequelize');module[_0x68a8('0x0')]={'body':{'type':Sequelize['TEXT'](_0x68a8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x68a8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x68a8('0x3')]('in',_0x68a8('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x68a8('0x5')](0xbe)},'phone':{'type':Sequelize[_0x68a8('0x5')]},'readAt':{'type':Sequelize[_0x68a8('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x68a8('0x7')]}}; \ No newline at end of file +var _0xb079=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x5e36f8,_0x13a981){var _0x3de0fe=function(_0x491b61){while(--_0x491b61){_0x5e36f8['push'](_0x5e36f8['shift']());}};_0x3de0fe(++_0x13a981);}(_0xb079,0x1c9));var _0x9b07=function(_0xaeca75,_0x487ce5){_0xaeca75=_0xaeca75-0x0;var _0x50e0b0=_0xb079[_0xaeca75];return _0x50e0b0;};'use strict';var Sequelize=require('sequelize');module[_0x9b07('0x0')]={'body':{'type':Sequelize[_0x9b07('0x1')](_0x9b07('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9b07('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9b07('0x4')]('in',_0x9b07('0x5')),'defaultValue':_0x9b07('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9b07('0x6')](0xbe)},'phone':{'type':Sequelize[_0x9b07('0x6')]},'readAt':{'type':Sequelize[_0x9b07('0x7')]},'secret':{'type':Sequelize[_0x9b07('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9b07('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 4667695..e14da83 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 _0x793b=['send','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','SmsMessage','include','find','body','update','destroy','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','sms-interactions','sms','get','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','motionChannel','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','type','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','stack','name'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x793b,0x189));var _0xb793=function(_0x2c71fb,_0x13128f){_0x2c71fb=_0x2c71fb-0x0;var _0x581033=_0x793b[_0x2c71fb];return _0x581033;};'use strict';var emlformat=require(_0xb793('0x0'));var rimraf=require(_0xb793('0x1'));var zipdir=require(_0xb793('0x2'));var jsonpatch=require(_0xb793('0x3'));var rp=require(_0xb793('0x4'));var moment=require('moment');var BPromise=require(_0xb793('0x5'));var Mustache=require(_0xb793('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb793('0x7'));var csv=require(_0xb793('0x8'));var ejs=require(_0xb793('0x9'));var fs=require('fs');var fs_extra=require(_0xb793('0xa'));var _=require(_0xb793('0xb'));var squel=require(_0xb793('0xc'));var crypto=require(_0xb793('0xd'));var jsforce=require(_0xb793('0xe'));var deskjs=require(_0xb793('0xf'));var toCsv=require(_0xb793('0x8'));var querystring=require(_0xb793('0x10'));var Papa=require(_0xb793('0x11'));var Redis=require(_0xb793('0x12'));var authService=require(_0xb793('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb793('0x14'));var hardwareService=require(_0xb793('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xb793('0x16'));var config=require(_0xb793('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb793('0x18'))['db'];config[_0xb793('0x19')]=_['defaults'](config[_0xb793('0x19')],{'host':_0xb793('0x1a'),'port':0x18eb});var socket=require(_0xb793('0x1b'))(new Redis(config[_0xb793('0x19')]));require(_0xb793('0x1c'))[_0xb793('0x1d')](socket);var jayson=require(_0xb793('0x1e'));var client=jayson['client'][_0xb793('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20ab1e,_0x18fb18,_0x115165,_0x1ff6cb){return new BPromise(function(_0x38d9f2,_0x32e9e7){var _0x18c005=_0x1ff6cb||client;return _0x18c005[_0xb793('0x20')](_0x20ab1e,_0x115165)[_0xb793('0x21')](function(_0x2914a2){logger[_0xb793('0x22')](_0xb793('0x23'),_0x18fb18,_0xb793('0x24'));logger[_0xb793('0x25')](_0xb793('0x26'),_0x18fb18,_0xb793('0x24'),JSON['stringify'](_0x2914a2));if(_0x2914a2[_0xb793('0x27')]){if(_0x2914a2[_0xb793('0x27')]['code']===0x1f4){logger[_0xb793('0x27')](_0xb793('0x23'),_0x18fb18,_0x2914a2[_0xb793('0x27')][_0xb793('0x28')]);return _0x32e9e7(_0x2914a2[_0xb793('0x27')]['message']);}logger['error'](_0xb793('0x23'),_0x18fb18,_0x2914a2[_0xb793('0x27')][_0xb793('0x28')]);return _0x38d9f2(_0x2914a2[_0xb793('0x27')][_0xb793('0x28')]);}else{logger[_0xb793('0x22')](_0xb793('0x23'),_0x18fb18,_0xb793('0x24'));_0x38d9f2(_0x2914a2['result'][_0xb793('0x28')]);}})[_0xb793('0x29')](function(_0x14ecb0){logger[_0xb793('0x27')](_0xb793('0x23'),_0x18fb18,_0x14ecb0);_0x32e9e7(_0x14ecb0);});});}function respondWithStatusCode(_0x164107,_0x66263f){_0x66263f=_0x66263f||0xcc;return function(_0x484788){if(_0x484788){return _0x164107[_0xb793('0x2a')](_0x66263f);}return _0x164107[_0xb793('0x2b')](_0x66263f)[_0xb793('0x2c')]();};}function respondWithResult(_0x2d5444,_0x35cd9d){_0x35cd9d=_0x35cd9d||0xc8;return function(_0x2afea2){if(_0x2afea2){return _0x2d5444['status'](_0x35cd9d)[_0xb793('0x2d')](_0x2afea2);}};}function respondWithFilteredResult(_0x249acf,_0x107d78){return function(_0x4ec642){if(_0x4ec642){var _0x89d007=typeof _0x107d78[_0xb793('0x2e')]===_0xb793('0x2f')&&typeof _0x107d78[_0xb793('0x30')]==='undefined';var _0x493a8c=_0x4ec642[_0xb793('0x31')];var _0x4b0297=_0x89d007?0x0:_0x107d78['offset'];var _0x8a0bed=_0x89d007?_0x4ec642[_0xb793('0x31')]:_0x107d78[_0xb793('0x2e')]+_0x107d78[_0xb793('0x30')];var _0x52956a;if(_0x8a0bed>=_0x493a8c){_0x8a0bed=_0x493a8c;_0x52956a=0xc8;}else{_0x52956a=0xce;}_0x249acf[_0xb793('0x2b')](_0x52956a);return _0x249acf[_0xb793('0x32')](_0xb793('0x33'),_0x4b0297+'-'+_0x8a0bed+'/'+_0x493a8c)[_0xb793('0x2d')](_0x4ec642);}return null;};}function patchUpdates(_0x500cf5){return function(_0x17a941){try{jsonpatch[_0xb793('0x34')](_0x17a941,_0x500cf5,!![]);}catch(_0x13075b){return BPromise[_0xb793('0x35')](_0x13075b);}return _0x17a941[_0xb793('0x36')]();};}function saveUpdates(_0x37ceaa,_0x23e439){return function(_0x31439b){if(_0x31439b){return _0x31439b['update'](_0x37ceaa)['then'](function(_0x447ede){return _0x447ede;});}return null;};}function removeEntity(_0x38fb94,_0xa4b7c1){return function(_0x2308e6){if(_0x2308e6){return _0x2308e6['destroy']()[_0xb793('0x21')](function(){_0x38fb94[_0xb793('0x2b')](0xcc)[_0xb793('0x2c')]();});}};}function handleEntityNotFound(_0x1e7eae,_0x4237d7){return function(_0x588645){if(!_0x588645){_0x1e7eae[_0xb793('0x2a')](0x194);}return _0x588645;};}function handleError(_0x417484,_0x6d836f){_0x6d836f=_0x6d836f||0x1f4;return function(_0x432720){logger[_0xb793('0x27')](_0x432720[_0xb793('0x37')]);if(_0x432720[_0xb793('0x38')]){delete _0x432720['name'];}_0x417484[_0xb793('0x2b')](_0x6d836f)[_0xb793('0x39')](_0x432720);};}exports['index']=function(_0x3127f1,_0x17a91c){var _0x497568={},_0x10a5a1={},_0x4a1aee={'count':0x0,'rows':[]};var _0x3c2f60=_[_0xb793('0x3a')](db['SmsMessage'][_0xb793('0x3b')],function(_0x1ee631){return{'name':_0x1ee631['fieldName'],'type':_0x1ee631['type'][_0xb793('0x3c')]};});_0x10a5a1[_0xb793('0x3d')]=_[_0xb793('0x3a')](_0x3c2f60,_0xb793('0x38'));_0x10a5a1[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x3127f1[_0xb793('0x3e')]);_0x10a5a1['filters']=_[_0xb793('0x40')](_0x10a5a1['model'],_0x10a5a1[_0xb793('0x3e')]);_0x497568[_0xb793('0x41')]=_[_0xb793('0x40')](_0x10a5a1[_0xb793('0x3d')],qs[_0xb793('0x42')](_0x3127f1['query']['fields']));_0x497568[_0xb793('0x41')]=_0x497568['attributes'][_0xb793('0x43')]?_0x497568[_0xb793('0x41')]:_0x10a5a1[_0xb793('0x3d')];if(!_0x3127f1['query'][_0xb793('0x44')](_0xb793('0x45'))){_0x497568['limit']=qs[_0xb793('0x30')](_0x3127f1[_0xb793('0x3e')][_0xb793('0x30')]);_0x497568[_0xb793('0x2e')]=qs['offset'](_0x3127f1[_0xb793('0x3e')][_0xb793('0x2e')]);}_0x497568[_0xb793('0x46')]=qs['sort'](_0x3127f1[_0xb793('0x3e')][_0xb793('0x47')]);_0x497568[_0xb793('0x48')]=qs['filters'](_[_0xb793('0x49')](_0x3127f1[_0xb793('0x3e')],_0x10a5a1['filters']),_0x3c2f60);if(_0x3127f1[_0xb793('0x3e')][_0xb793('0x4a')]){_0x497568['where']=_[_0xb793('0x4b')](_0x497568['where'],{'$or':_['map'](_0x3c2f60,function(_0x278c6f){if(_0x278c6f['type']!==_0xb793('0x4c')){var _0x221bd8={};_0x221bd8[_0x278c6f[_0xb793('0x38')]]={'$like':'%'+_0x3127f1['query'][_0xb793('0x4a')]+'%'};return _0x221bd8;}})});}_0x497568=_[_0xb793('0x4b')]({},_0x497568,_0x3127f1[_0xb793('0x4d')]);var _0xead97={'where':_0x497568[_0xb793('0x48')]};return db['SmsMessage'][_0xb793('0x31')](_0xead97)[_0xb793('0x21')](function(_0x30209a){_0x4a1aee[_0xb793('0x31')]=_0x30209a;if(_0x3127f1['query'][_0xb793('0x4e')]){_0x497568['include']=[{'all':!![]}];}return db['SmsMessage'][_0xb793('0x4f')](_0x497568);})[_0xb793('0x21')](function(_0x338011){_0x4a1aee[_0xb793('0x50')]=_0x338011;return _0x4a1aee;})[_0xb793('0x21')](respondWithFilteredResult(_0x17a91c,_0x497568))[_0xb793('0x29')](handleError(_0x17a91c,null));};exports[_0xb793('0x51')]=function(_0x583fd8,_0x3addc2){var _0x34bc7e={'raw':!![],'where':{'id':_0x583fd8[_0xb793('0x52')]['id']}},_0x4612be={};_0x4612be[_0xb793('0x3d')]=_[_0xb793('0x3f')](db[_0xb793('0x53')][_0xb793('0x3b')]);_0x4612be[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x583fd8['query']);_0x4612be['filters']=_[_0xb793('0x40')](_0x4612be[_0xb793('0x3d')],_0x4612be[_0xb793('0x3e')]);_0x34bc7e[_0xb793('0x41')]=_['intersection'](_0x4612be[_0xb793('0x3d')],qs[_0xb793('0x42')](_0x583fd8[_0xb793('0x3e')][_0xb793('0x42')]));_0x34bc7e[_0xb793('0x41')]=_0x34bc7e['attributes'][_0xb793('0x43')]?_0x34bc7e[_0xb793('0x41')]:_0x4612be['model'];if(_0x583fd8[_0xb793('0x3e')][_0xb793('0x4e')]){_0x34bc7e[_0xb793('0x54')]=[{'all':!![]}];}_0x34bc7e=_[_0xb793('0x4b')]({},_0x34bc7e,_0x583fd8[_0xb793('0x4d')]);return db['SmsMessage'][_0xb793('0x55')](_0x34bc7e)[_0xb793('0x21')](handleEntityNotFound(_0x3addc2,null))[_0xb793('0x21')](respondWithResult(_0x3addc2,null))[_0xb793('0x29')](handleError(_0x3addc2,null));};exports['create']=function(_0x4586ab,_0x20543a){return db['SmsMessage']['create'](_0x4586ab[_0xb793('0x56')],{})['then'](respondWithResult(_0x20543a,0xc9))['catch'](handleError(_0x20543a,null));};exports[_0xb793('0x57')]=function(_0x468077,_0x46e111){if(_0x468077[_0xb793('0x56')]['id']){delete _0x468077[_0xb793('0x56')]['id'];}return db['SmsMessage'][_0xb793('0x55')]({'where':{'id':_0x468077['params']['id']}})[_0xb793('0x21')](handleEntityNotFound(_0x46e111,null))['then'](saveUpdates(_0x468077[_0xb793('0x56')],null))[_0xb793('0x21')](respondWithResult(_0x46e111,null))[_0xb793('0x29')](handleError(_0x46e111,null));};exports[_0xb793('0x58')]=function(_0x43831e,_0x55e176){return db['SmsMessage'][_0xb793('0x55')]({'where':{'id':_0x43831e[_0xb793('0x52')]['id']}})[_0xb793('0x21')](handleEntityNotFound(_0x55e176,null))[_0xb793('0x21')](removeEntity(_0x55e176,null))['catch'](handleError(_0x55e176,null));};exports[_0xb793('0x59')]=function(_0x1672e9,_0x5c9bed){return db['SmsMessage']['describe']()[_0xb793('0x21')](respondWithResult(_0x5c9bed,null))[_0xb793('0x29')](handleError(_0x5c9bed,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xb793('0x5a')]=function(_0xf9a4b4,_0x256c74,_0x46f734){var _0x385bb9={'agent':{},'channel':'sms'};if(_0xf9a4b4[_0xb793('0x56')]['id']){delete _0xf9a4b4[_0xb793('0x56')]['id'];}_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5b')]=!![];_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5c')]=moment()['format'](_0xb793('0x5d'));_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')]=_0xf9a4b4[_0xb793('0x56')]['UserId']||_0xf9a4b4[_0xb793('0x5f')]['id'];_0x385bb9[_0xb793('0x60')]['id']=_0xf9a4b4['body'][_0xb793('0x5e')];return db[_0xb793('0x53')][_0xb793('0x55')]({'where':{'id':_0xf9a4b4['params']['id'],'UserId':null}})[_0xb793('0x21')](handleEntityNotFound(_0x256c74,null))[_0xb793('0x21')](saveUpdates(_0xf9a4b4[_0xb793('0x56')],null))[_0xb793('0x21')](function(_0x5b7bce){if(_0x5b7bce){_0x385bb9[_0xb793('0x28')]=_0x5b7bce['get']({'plain':!![]});return db[_0xb793('0x61')][_0xb793('0x55')]({'where':{'id':_0x5b7bce['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x256c74,null))[_0xb793('0x21')](function(_0x445c00){if(_0x445c00){return _0x445c00[_0xb793('0x57')]({'UserId':_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')],'read1stAt':_['isNil'](_0x445c00[_0xb793('0x62')])?moment()['format'](_0xb793('0x5d')):undefined});}return null;})[_0xb793('0x21')](function(_0x48f08f){if(_0x48f08f){_0x385bb9[_0xb793('0x63')]=_0x48f08f['get']({'plain':!![]});interaction_log[_0xb793('0x22')](_0xb793('0x64'),_0xf9a4b4['user']['id'],_0xf9a4b4[_0xb793('0x5f')]['name'],_0xf9a4b4[_0xb793('0x5f')][_0xb793('0x65')],_0x385bb9[_0xb793('0x63')]['id'],_0xf9a4b4[_0xb793('0x56')]?JSON[_0xb793('0x66')](_0xf9a4b4[_0xb793('0x56')]):_0xb793('0x67'));return respondWithRpcPromise(_0xb793('0x68'),_0xb793('0x69'),_0x385bb9);}return null;})['then'](function(_0x491f66){var _0x56d0df='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x491f66['message'][_0xb793('0x6a')];return db[_0xb793('0x6b')][_0xb793('0x3e')](_0x56d0df,{'type':db['Sequelize'][_0xb793('0x6c')][_0xb793('0x6d')],'raw':!![]})[_0xb793('0x21')](function(_0x3fa570){return _0x3fa570;});})[_0xb793('0x21')](function(_0x39ec49){if(_0x39ec49){_0x385bb9[_0xb793('0x28')][_0xb793('0x6e')]=_0x39ec49[0x0];if(!_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')])return;return db[_0xb793('0x6f')][_0xb793('0x55')]({'where':{'id':_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')],'role':_0xb793('0x60')},'attributes':['id',_0xb793('0x38'),'fullname',_0xb793('0x70'),_0xb793('0x71')],'raw':!![]});}return null;})[_0xb793('0x21')](function(_0x4b06a7){if(!_0x4b06a7)return null;_0x385bb9[_0xb793('0x28')]['agent']=_0x4b06a7;return _0x385bb9;})['then'](function(_0x15b06b){if(_0x15b06b){if(_0xf9a4b4[_0xb793('0x56')][_0xb793('0x72')]){_0x385bb9['message'][_0xb793('0x73')]=util[_0xb793('0x74')](_0xb793('0x75'),_0xf9a4b4['user']['name']);_0x385bb9[_0xb793('0x28')]['channel']=_0x385bb9[_0xb793('0x76')];_0x385bb9[_0xb793('0x28')]['motionChannel']=_0x385bb9[_0xb793('0x76')];_0x385bb9[_0xb793('0x28')][_0xb793('0x77')]=_0xb793('0x5a');return respondWithRpcPromise(_0xb793('0x78'),_0xb793('0x78'),{'event':_0xb793('0x79'),'message':_0x385bb9[_0xb793('0x28')]},client9002)[_0xb793('0x21')](function(){return _0x385bb9;});}return _0x385bb9;}return null;})[_0xb793('0x21')](respondWithResult(_0x256c74,null))[_0xb793('0x29')](handleError(_0x256c74,null));};var interaction_log=require(_0xb793('0x7a'))(_0xb793('0x7b'));exports['reject']=function(_0x3a809b,_0x55e67d,_0x532d70){var _0x24f9b3={'agent':{},'channel':_0xb793('0x7c')};if(_0x3a809b[_0xb793('0x56')]['id']){delete _0x3a809b[_0xb793('0x56')]['id'];}_0x3a809b['body'][_0xb793('0x5e')]=_0x3a809b[_0xb793('0x56')]['UserId']||_0x3a809b[_0xb793('0x5f')]['id'];_0x24f9b3[_0xb793('0x60')]['id']=_0x3a809b[_0xb793('0x56')]['UserId'];return db[_0xb793('0x53')][_0xb793('0x55')]({'where':{'id':_0x3a809b['params']['id'],'UserId':null}})[_0xb793('0x21')](handleEntityNotFound(_0x55e67d,null))[_0xb793('0x21')](function(_0x262b9b){if(_0x262b9b){_0x24f9b3[_0xb793('0x28')]=_0x262b9b[_0xb793('0x7d')]({'plain':!![]});return db['SmsInteraction'][_0xb793('0x55')]({'where':{'id':_0x262b9b[_0xb793('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x55e67d,null))[_0xb793('0x21')](function(_0x342840){if(_0x342840){_0x24f9b3['interaction']=_0x342840[_0xb793('0x7d')]({'plain':!![]});interaction_log[_0xb793('0x22')](_0xb793('0x7f'),_0x3a809b[_0xb793('0x5f')]['id'],_0x3a809b[_0xb793('0x5f')][_0xb793('0x38')],_0x3a809b[_0xb793('0x5f')]['role'],_0x24f9b3[_0xb793('0x63')]['id'],_0x3a809b['body']?JSON[_0xb793('0x66')](_0x3a809b[_0xb793('0x56')]):_0xb793('0x67'));return respondWithRpcPromise(_0xb793('0x80'),'rejectMessage',_0x24f9b3);}return null;})['then'](function(_0x2f3a7b){var _0x1b5138=_0xb793('0x81')+_0x2f3a7b[_0xb793('0x28')][_0xb793('0x6a')];return db[_0xb793('0x6b')][_0xb793('0x3e')](_0x1b5138,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xb793('0x21')](function(_0x294764){return _0x294764;});})[_0xb793('0x21')](function(_0x434615){if(_0x434615){_0x24f9b3[_0xb793('0x28')][_0xb793('0x6e')]=_0x434615[0x0];if(!_0x3a809b[_0xb793('0x56')]['UserId'])return;return db[_0xb793('0x6f')][_0xb793('0x55')]({'where':{'id':_0x3a809b['body']['UserId'],'role':_0xb793('0x60')},'attributes':['id',_0xb793('0x38'),_0xb793('0x82'),'email',_0xb793('0x71')],'raw':!![]});}return null;})['then'](function(_0x52b765){if(!_0x52b765)return null;_0x24f9b3[_0xb793('0x28')][_0xb793('0x60')]=_0x52b765;return _0x24f9b3;})[_0xb793('0x21')](function(_0x2e547f){if(_0x2e547f){_0x2e547f[_0xb793('0x28')]['interface']=util['format'](_0xb793('0x75'),_0x3a809b[_0xb793('0x5f')][_0xb793('0x38')]);_0x2e547f[_0xb793('0x28')][_0xb793('0x76')]=_0x24f9b3[_0xb793('0x76')];_0x2e547f[_0xb793('0x28')][_0xb793('0x83')]=_0x24f9b3[_0xb793('0x76')];_0x2e547f[_0xb793('0x28')][_0xb793('0x77')]=_0xb793('0x35');respondWithRpcPromise('EventManager',_0xb793('0x78'),{'event':_0xb793('0x84'),'message':_0x2e547f[_0xb793('0x28')]},client9002);return _0x24f9b3;}return null;})[_0xb793('0x21')](respondWithResult(_0x55e67d,null))[_0xb793('0x29')](handleError(_0x55e67d,null));};exports[_0xb793('0x2b')]=function(_0x11c61d,_0x3a3b41,_0x344eb4){if(_0x11c61d['body']['id']){delete _0x11c61d[_0xb793('0x56')]['id'];}var _0x2d024f;return db['SmsMessage'][_0xb793('0x55')]({'where':{'id':_0x11c61d[_0xb793('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a3b41,null))[_0xb793('0x21')](function(_0x16230f){if(_0x16230f){_0x2d024f=_0x16230f;return db[_0xb793('0x85')]['find']({'where':{'id':_0x16230f['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x3a3b41,null))[_0xb793('0x21')](function(_0x557602){if(_0x557602){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb793('0x2b'),_0xb793('0x86'),_0x557602[_0xb793('0x87')],util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));switch(_0x557602[_0xb793('0x87')]){case'twilio':if(_0x11c61d[_0xb793('0x56')][_0xb793('0x89')]&&_0x11c61d[_0xb793('0x56')][_0xb793('0x89')]===_0x2d024f[_0xb793('0x8a')]){return _0x2d024f[_0xb793('0x57')]({'read':!![]});}else{logger['error'](_0xb793('0x8b'),'status','twilio',util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));}break;case _0xb793('0x8c'):if(_0x11c61d[_0xb793('0x56')][_0xb793('0x8d')]&&_0x11c61d[_0xb793('0x56')][_0xb793('0x8d')]===_0x2d024f['messageId']&&_[_0xb793('0x8e')]([_0xb793('0x8f'),_0xb793('0x90')],_0x11c61d[_0xb793('0x56')]['Status'])>=0x0){return _0x2d024f[_0xb793('0x57')]({'read':!![]});}else{logger[_0xb793('0x27')](_0xb793('0x8b'),'status',_0xb793('0x91'),util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4f02e8=_0x11c61d[_0xb793('0x56')][_0xb793('0x92')][0x0];if(_0x4f02e8[_0xb793('0x2b')][_0xb793('0x93')]===_0xb793('0x94')){return _0x2d024f[_0xb793('0x57')]({'read':!![]});}else{logger[_0xb793('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xb793('0x95'),util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x2d024f;}})[_0xb793('0x21')](respondWithResult(_0x3a3b41,null))[_0xb793('0x29')](handleError(_0x3a3b41,null));}; \ No newline at end of file +var _0xfb93=['../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','then','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SmsMessage','includeAll','include','findAll','rows','show','create','body','find','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','EventManager','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x5c86a9,_0x245d13){var _0x18c48f=function(_0x140e5e){while(--_0x140e5e){_0x5c86a9['push'](_0x5c86a9['shift']());}};_0x18c48f(++_0x245d13);}(_0xfb93,0x111));var _0x3fb9=function(_0x52e978,_0x49de10){_0x52e978=_0x52e978-0x0;var _0x4f6afc=_0xfb93[_0x52e978];return _0x4f6afc;};'use strict';var emlformat=require(_0x3fb9('0x0'));var rimraf=require(_0x3fb9('0x1'));var zipdir=require(_0x3fb9('0x2'));var jsonpatch=require(_0x3fb9('0x3'));var rp=require('request-promise');var moment=require(_0x3fb9('0x4'));var BPromise=require(_0x3fb9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3fb9('0x6'));var csv=require(_0x3fb9('0x7'));var ejs=require(_0x3fb9('0x8'));var fs=require('fs');var fs_extra=require(_0x3fb9('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3fb9('0xa'));var jsforce=require(_0x3fb9('0xb'));var deskjs=require(_0x3fb9('0xc'));var toCsv=require(_0x3fb9('0x7'));var querystring=require(_0x3fb9('0xd'));var Papa=require(_0x3fb9('0xe'));var Redis=require(_0x3fb9('0xf'));var authService=require(_0x3fb9('0x10'));var qs=require(_0x3fb9('0x11'));var as=require(_0x3fb9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fb9('0x13'))(_0x3fb9('0x14'));var utils=require('../../config/utils');var config=require(_0x3fb9('0x15'));var licenseUtil=require(_0x3fb9('0x16'));var db=require(_0x3fb9('0x17'))['db'];config[_0x3fb9('0x18')]=_['defaults'](config[_0x3fb9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fb9('0x19'))(new Redis(config['redis']));require(_0x3fb9('0x1a'))[_0x3fb9('0x1b')](socket);var jayson=require(_0x3fb9('0x1c'));var client=jayson[_0x3fb9('0x1d')][_0x3fb9('0x1e')]({'port':0x232c});var client9002=jayson[_0x3fb9('0x1d')][_0x3fb9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4f0add,_0x42afd2,_0x1f7be7,_0x48dd1d){return new BPromise(function(_0x1720fc,_0xd0528f){var _0x1726e9=_0x48dd1d||client;return _0x1726e9[_0x3fb9('0x1f')](_0x4f0add,_0x1f7be7)['then'](function(_0x3c7e15){logger[_0x3fb9('0x20')](_0x3fb9('0x21'),_0x42afd2,'request\x20sent');logger['debug'](_0x3fb9('0x22'),_0x42afd2,_0x3fb9('0x23'),JSON['stringify'](_0x3c7e15));if(_0x3c7e15[_0x3fb9('0x24')]){if(_0x3c7e15[_0x3fb9('0x24')][_0x3fb9('0x25')]===0x1f4){logger[_0x3fb9('0x24')](_0x3fb9('0x21'),_0x42afd2,_0x3c7e15[_0x3fb9('0x24')][_0x3fb9('0x26')]);return _0xd0528f(_0x3c7e15[_0x3fb9('0x24')][_0x3fb9('0x26')]);}logger[_0x3fb9('0x24')](_0x3fb9('0x21'),_0x42afd2,_0x3c7e15[_0x3fb9('0x24')][_0x3fb9('0x26')]);return _0x1720fc(_0x3c7e15[_0x3fb9('0x24')][_0x3fb9('0x26')]);}else{logger[_0x3fb9('0x20')](_0x3fb9('0x21'),_0x42afd2,_0x3fb9('0x23'));_0x1720fc(_0x3c7e15[_0x3fb9('0x27')]['message']);}})[_0x3fb9('0x28')](function(_0x17d284){logger[_0x3fb9('0x24')]('SmsMessage,\x20%s,\x20%s',_0x42afd2,_0x17d284);_0xd0528f(_0x17d284);});});}function respondWithStatusCode(_0x3158fd,_0x11c47b){_0x11c47b=_0x11c47b||0xcc;return function(_0x27fe8c){if(_0x27fe8c){return _0x3158fd[_0x3fb9('0x29')](_0x11c47b);}return _0x3158fd[_0x3fb9('0x2a')](_0x11c47b)[_0x3fb9('0x2b')]();};}function respondWithResult(_0x303094,_0x3a9fe9){_0x3a9fe9=_0x3a9fe9||0xc8;return function(_0x978155){if(_0x978155){return _0x303094[_0x3fb9('0x2a')](_0x3a9fe9)[_0x3fb9('0x2c')](_0x978155);}};}function respondWithFilteredResult(_0x1c2ea5,_0x4d8118){return function(_0x1ed4f5){if(_0x1ed4f5){var _0x3835f2=typeof _0x4d8118[_0x3fb9('0x2d')]==='undefined'&&typeof _0x4d8118[_0x3fb9('0x2e')]===_0x3fb9('0x2f');var _0x92ba51=_0x1ed4f5[_0x3fb9('0x30')];var _0x17fe99=_0x3835f2?0x0:_0x4d8118[_0x3fb9('0x2d')];var _0x3f6aaa=_0x3835f2?_0x1ed4f5[_0x3fb9('0x30')]:_0x4d8118[_0x3fb9('0x2d')]+_0x4d8118['limit'];var _0x816a6a;if(_0x3f6aaa>=_0x92ba51){_0x3f6aaa=_0x92ba51;_0x816a6a=0xc8;}else{_0x816a6a=0xce;}_0x1c2ea5['status'](_0x816a6a);return _0x1c2ea5['set'](_0x3fb9('0x31'),_0x17fe99+'-'+_0x3f6aaa+'/'+_0x92ba51)[_0x3fb9('0x2c')](_0x1ed4f5);}return null;};}function patchUpdates(_0x292f6f){return function(_0x459d0c){try{jsonpatch['apply'](_0x459d0c,_0x292f6f,!![]);}catch(_0x20be7a){return BPromise['reject'](_0x20be7a);}return _0x459d0c['save']();};}function saveUpdates(_0x11746b,_0xdf277){return function(_0x38fd30){if(_0x38fd30){return _0x38fd30[_0x3fb9('0x32')](_0x11746b)['then'](function(_0x51fb15){return _0x51fb15;});}return null;};}function removeEntity(_0x339f84,_0xb05499){return function(_0x1367c1){if(_0x1367c1){return _0x1367c1[_0x3fb9('0x33')]()[_0x3fb9('0x34')](function(){_0x339f84[_0x3fb9('0x2a')](0xcc)[_0x3fb9('0x2b')]();});}};}function handleEntityNotFound(_0x18b91c,_0x68f72b){return function(_0x5d2b21){if(!_0x5d2b21){_0x18b91c[_0x3fb9('0x29')](0x194);}return _0x5d2b21;};}function handleError(_0x30cbfa,_0x1c1bd7){_0x1c1bd7=_0x1c1bd7||0x1f4;return function(_0x13e6bc){logger[_0x3fb9('0x24')](_0x13e6bc['stack']);if(_0x13e6bc[_0x3fb9('0x35')]){delete _0x13e6bc[_0x3fb9('0x35')];}_0x30cbfa[_0x3fb9('0x2a')](_0x1c1bd7)[_0x3fb9('0x36')](_0x13e6bc);};}exports['index']=function(_0x29b312,_0x6db531){var _0x35da61={},_0x382b4b={},_0x14781c={'count':0x0,'rows':[]};var _0x4ccdff=_[_0x3fb9('0x37')](db['SmsMessage'][_0x3fb9('0x38')],function(_0x31e068){return{'name':_0x31e068[_0x3fb9('0x39')],'type':_0x31e068[_0x3fb9('0x3a')][_0x3fb9('0x3b')]};});_0x382b4b[_0x3fb9('0x3c')]=_[_0x3fb9('0x37')](_0x4ccdff,_0x3fb9('0x35'));_0x382b4b[_0x3fb9('0x3d')]=_[_0x3fb9('0x3e')](_0x29b312[_0x3fb9('0x3d')]);_0x382b4b[_0x3fb9('0x3f')]=_[_0x3fb9('0x40')](_0x382b4b[_0x3fb9('0x3c')],_0x382b4b[_0x3fb9('0x3d')]);_0x35da61[_0x3fb9('0x41')]=_[_0x3fb9('0x40')](_0x382b4b[_0x3fb9('0x3c')],qs[_0x3fb9('0x42')](_0x29b312['query'][_0x3fb9('0x42')]));_0x35da61[_0x3fb9('0x41')]=_0x35da61[_0x3fb9('0x41')][_0x3fb9('0x43')]?_0x35da61[_0x3fb9('0x41')]:_0x382b4b[_0x3fb9('0x3c')];if(!_0x29b312['query'][_0x3fb9('0x44')](_0x3fb9('0x45'))){_0x35da61[_0x3fb9('0x2e')]=qs[_0x3fb9('0x2e')](_0x29b312['query'][_0x3fb9('0x2e')]);_0x35da61[_0x3fb9('0x2d')]=qs['offset'](_0x29b312[_0x3fb9('0x3d')][_0x3fb9('0x2d')]);}_0x35da61[_0x3fb9('0x46')]=qs[_0x3fb9('0x47')](_0x29b312[_0x3fb9('0x3d')][_0x3fb9('0x47')]);_0x35da61[_0x3fb9('0x48')]=qs['filters'](_['pick'](_0x29b312[_0x3fb9('0x3d')],_0x382b4b[_0x3fb9('0x3f')]),_0x4ccdff);if(_0x29b312[_0x3fb9('0x3d')][_0x3fb9('0x49')]){_0x35da61[_0x3fb9('0x48')]=_[_0x3fb9('0x4a')](_0x35da61[_0x3fb9('0x48')],{'$or':_[_0x3fb9('0x37')](_0x4ccdff,function(_0x522a23){if(_0x522a23[_0x3fb9('0x3a')]!==_0x3fb9('0x4b')){var _0x46415e={};_0x46415e[_0x522a23[_0x3fb9('0x35')]]={'$like':'%'+_0x29b312[_0x3fb9('0x3d')][_0x3fb9('0x49')]+'%'};return _0x46415e;}})});}_0x35da61=_[_0x3fb9('0x4a')]({},_0x35da61,_0x29b312[_0x3fb9('0x4c')]);var _0x470a1b={'where':_0x35da61[_0x3fb9('0x48')]};return db[_0x3fb9('0x4d')][_0x3fb9('0x30')](_0x470a1b)[_0x3fb9('0x34')](function(_0x28d10f){_0x14781c[_0x3fb9('0x30')]=_0x28d10f;if(_0x29b312[_0x3fb9('0x3d')][_0x3fb9('0x4e')]){_0x35da61[_0x3fb9('0x4f')]=[{'all':!![]}];}return db[_0x3fb9('0x4d')][_0x3fb9('0x50')](_0x35da61);})[_0x3fb9('0x34')](function(_0x3ba8d7){_0x14781c[_0x3fb9('0x51')]=_0x3ba8d7;return _0x14781c;})['then'](respondWithFilteredResult(_0x6db531,_0x35da61))['catch'](handleError(_0x6db531,null));};exports[_0x3fb9('0x52')]=function(_0x2bfe52,_0x3cec1f){var _0x7fffcc={'raw':!![],'where':{'id':_0x2bfe52['params']['id']}},_0x326674={};_0x326674['model']=_[_0x3fb9('0x3e')](db[_0x3fb9('0x4d')][_0x3fb9('0x38')]);_0x326674[_0x3fb9('0x3d')]=_[_0x3fb9('0x3e')](_0x2bfe52[_0x3fb9('0x3d')]);_0x326674[_0x3fb9('0x3f')]=_[_0x3fb9('0x40')](_0x326674[_0x3fb9('0x3c')],_0x326674[_0x3fb9('0x3d')]);_0x7fffcc['attributes']=_['intersection'](_0x326674[_0x3fb9('0x3c')],qs[_0x3fb9('0x42')](_0x2bfe52[_0x3fb9('0x3d')][_0x3fb9('0x42')]));_0x7fffcc['attributes']=_0x7fffcc['attributes'][_0x3fb9('0x43')]?_0x7fffcc[_0x3fb9('0x41')]:_0x326674['model'];if(_0x2bfe52[_0x3fb9('0x3d')][_0x3fb9('0x4e')]){_0x7fffcc[_0x3fb9('0x4f')]=[{'all':!![]}];}_0x7fffcc=_['merge']({},_0x7fffcc,_0x2bfe52['options']);return db[_0x3fb9('0x4d')]['find'](_0x7fffcc)[_0x3fb9('0x34')](handleEntityNotFound(_0x3cec1f,null))[_0x3fb9('0x34')](respondWithResult(_0x3cec1f,null))[_0x3fb9('0x28')](handleError(_0x3cec1f,null));};exports[_0x3fb9('0x53')]=function(_0x4cd2a1,_0x4828bb){return db[_0x3fb9('0x4d')][_0x3fb9('0x53')](_0x4cd2a1[_0x3fb9('0x54')],{})[_0x3fb9('0x34')](respondWithResult(_0x4828bb,0xc9))[_0x3fb9('0x28')](handleError(_0x4828bb,null));};exports[_0x3fb9('0x32')]=function(_0x52b873,_0x489557){if(_0x52b873[_0x3fb9('0x54')]['id']){delete _0x52b873['body']['id'];}return db[_0x3fb9('0x4d')][_0x3fb9('0x55')]({'where':{'id':_0x52b873[_0x3fb9('0x56')]['id']}})[_0x3fb9('0x34')](handleEntityNotFound(_0x489557,null))[_0x3fb9('0x34')](saveUpdates(_0x52b873[_0x3fb9('0x54')],null))[_0x3fb9('0x34')](respondWithResult(_0x489557,null))[_0x3fb9('0x28')](handleError(_0x489557,null));};exports[_0x3fb9('0x33')]=function(_0x4c5c16,_0x4aae19){return db[_0x3fb9('0x4d')]['find']({'where':{'id':_0x4c5c16[_0x3fb9('0x56')]['id']}})['then'](handleEntityNotFound(_0x4aae19,null))[_0x3fb9('0x34')](removeEntity(_0x4aae19,null))[_0x3fb9('0x28')](handleError(_0x4aae19,null));};exports[_0x3fb9('0x57')]=function(_0x1f62cd,_0x52e53e){return db[_0x3fb9('0x4d')][_0x3fb9('0x57')]()[_0x3fb9('0x34')](respondWithResult(_0x52e53e,null))[_0x3fb9('0x28')](handleError(_0x52e53e,null));};var interaction_log=require('../../config/logger')(_0x3fb9('0x58'));exports[_0x3fb9('0x59')]=function(_0x1d57c4,_0x4d1ac6,_0x5137f8){var _0x61bca8={'agent':{},'channel':_0x3fb9('0x5a')};if(_0x1d57c4[_0x3fb9('0x54')]['id']){delete _0x1d57c4[_0x3fb9('0x54')]['id'];}_0x1d57c4[_0x3fb9('0x54')][_0x3fb9('0x5b')]=!![];_0x1d57c4[_0x3fb9('0x54')][_0x3fb9('0x5c')]=moment()[_0x3fb9('0x5d')](_0x3fb9('0x5e'));_0x1d57c4['body'][_0x3fb9('0x5f')]=_0x1d57c4[_0x3fb9('0x54')][_0x3fb9('0x5f')]||_0x1d57c4[_0x3fb9('0x60')]['id'];_0x61bca8[_0x3fb9('0x61')]['id']=_0x1d57c4[_0x3fb9('0x54')][_0x3fb9('0x5f')];return db[_0x3fb9('0x4d')][_0x3fb9('0x55')]({'where':{'id':_0x1d57c4[_0x3fb9('0x56')]['id'],'UserId':null}})[_0x3fb9('0x34')](handleEntityNotFound(_0x4d1ac6,null))[_0x3fb9('0x34')](saveUpdates(_0x1d57c4['body'],null))['then'](function(_0x2d559e){if(_0x2d559e){_0x61bca8[_0x3fb9('0x26')]=_0x2d559e[_0x3fb9('0x62')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2d559e['SmsInteractionId']}});}return null;})[_0x3fb9('0x34')](handleEntityNotFound(_0x4d1ac6,null))[_0x3fb9('0x34')](function(_0x4331eb){if(_0x4331eb){return _0x4331eb['update']({'UserId':_0x1d57c4[_0x3fb9('0x54')][_0x3fb9('0x5f')],'read1stAt':_['isNil'](_0x4331eb[_0x3fb9('0x63')])?moment()[_0x3fb9('0x5d')](_0x3fb9('0x5e')):undefined});}return null;})['then'](function(_0x4ccd1f){if(_0x4ccd1f){_0x61bca8['interaction']=_0x4ccd1f[_0x3fb9('0x62')]({'plain':!![]});interaction_log[_0x3fb9('0x20')](_0x3fb9('0x64'),_0x1d57c4[_0x3fb9('0x60')]['id'],_0x1d57c4[_0x3fb9('0x60')][_0x3fb9('0x35')],_0x1d57c4[_0x3fb9('0x60')]['role'],_0x61bca8[_0x3fb9('0x65')]['id'],_0x1d57c4['body']?JSON[_0x3fb9('0x66')](_0x1d57c4[_0x3fb9('0x54')]):_0x3fb9('0x67'));return respondWithRpcPromise(_0x3fb9('0x68'),_0x3fb9('0x69'),_0x61bca8);}return null;})[_0x3fb9('0x34')](function(_0x4dbd1e){var _0x1027c6=_0x3fb9('0x6a')+_0x4dbd1e[_0x3fb9('0x26')][_0x3fb9('0x6b')];return db['sequelize'][_0x3fb9('0x3d')](_0x1027c6,{'type':db[_0x3fb9('0x6c')][_0x3fb9('0x6d')][_0x3fb9('0x6e')],'raw':!![]})[_0x3fb9('0x34')](function(_0x24bac7){return _0x24bac7;});})[_0x3fb9('0x34')](function(_0x342ec8){if(_0x342ec8){_0x61bca8[_0x3fb9('0x26')][_0x3fb9('0x6f')]=_0x342ec8[0x0];if(!_0x1d57c4[_0x3fb9('0x54')]['UserId'])return;return db[_0x3fb9('0x70')][_0x3fb9('0x55')]({'where':{'id':_0x1d57c4[_0x3fb9('0x54')]['UserId'],'role':_0x3fb9('0x61')},'attributes':['id',_0x3fb9('0x35'),_0x3fb9('0x71'),_0x3fb9('0x72'),_0x3fb9('0x73')],'raw':!![]});}return null;})[_0x3fb9('0x34')](function(_0xe2c1ae){if(!_0xe2c1ae)return null;_0x61bca8[_0x3fb9('0x26')][_0x3fb9('0x61')]=_0xe2c1ae;return _0x61bca8;})[_0x3fb9('0x34')](function(_0x38d107){if(_0x38d107){if(_0x1d57c4[_0x3fb9('0x54')][_0x3fb9('0x74')]){_0x61bca8['message'][_0x3fb9('0x75')]=util[_0x3fb9('0x5d')](_0x3fb9('0x76'),_0x1d57c4['user'][_0x3fb9('0x35')]);_0x61bca8[_0x3fb9('0x26')]['channel']=_0x61bca8[_0x3fb9('0x77')];_0x61bca8[_0x3fb9('0x26')][_0x3fb9('0x78')]=_0x61bca8[_0x3fb9('0x77')];_0x61bca8['message'][_0x3fb9('0x79')]=_0x3fb9('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x61bca8[_0x3fb9('0x26')]},client9002)['then'](function(){return _0x61bca8;});}return _0x61bca8;}return null;})[_0x3fb9('0x34')](respondWithResult(_0x4d1ac6,null))[_0x3fb9('0x28')](handleError(_0x4d1ac6,null));};var interaction_log=require('../../config/logger')(_0x3fb9('0x58'));exports[_0x3fb9('0x7a')]=function(_0x4fb62f,_0x527dec,_0x169743){var _0x3e1303={'agent':{},'channel':'sms'};if(_0x4fb62f[_0x3fb9('0x54')]['id']){delete _0x4fb62f[_0x3fb9('0x54')]['id'];}_0x4fb62f['body'][_0x3fb9('0x5f')]=_0x4fb62f[_0x3fb9('0x54')][_0x3fb9('0x5f')]||_0x4fb62f['user']['id'];_0x3e1303['agent']['id']=_0x4fb62f['body'][_0x3fb9('0x5f')];return db['SmsMessage'][_0x3fb9('0x55')]({'where':{'id':_0x4fb62f['params']['id'],'UserId':null}})[_0x3fb9('0x34')](handleEntityNotFound(_0x527dec,null))[_0x3fb9('0x34')](function(_0x29f659){if(_0x29f659){_0x3e1303[_0x3fb9('0x26')]=_0x29f659[_0x3fb9('0x62')]({'plain':!![]});return db[_0x3fb9('0x7b')][_0x3fb9('0x55')]({'where':{'id':_0x29f659['SmsInteractionId']}});}return null;})[_0x3fb9('0x34')](handleEntityNotFound(_0x527dec,null))[_0x3fb9('0x34')](function(_0x9ac6a9){if(_0x9ac6a9){_0x3e1303[_0x3fb9('0x65')]=_0x9ac6a9[_0x3fb9('0x62')]({'plain':!![]});interaction_log['info'](_0x3fb9('0x7c'),_0x4fb62f[_0x3fb9('0x60')]['id'],_0x4fb62f['user']['name'],_0x4fb62f[_0x3fb9('0x60')][_0x3fb9('0x7d')],_0x3e1303[_0x3fb9('0x65')]['id'],_0x4fb62f[_0x3fb9('0x54')]?JSON['stringify'](_0x4fb62f[_0x3fb9('0x54')]):'null');return respondWithRpcPromise(_0x3fb9('0x7e'),_0x3fb9('0x7f'),_0x3e1303);}return null;})[_0x3fb9('0x34')](function(_0x4d0050){var _0x309c0d=_0x3fb9('0x6a')+_0x4d0050[_0x3fb9('0x26')][_0x3fb9('0x6b')];return db[_0x3fb9('0x80')]['query'](_0x309c0d,{'type':db[_0x3fb9('0x6c')][_0x3fb9('0x6d')][_0x3fb9('0x6e')],'raw':!![]})['then'](function(_0x2c48f6){return _0x2c48f6;});})[_0x3fb9('0x34')](function(_0x241bea){if(_0x241bea){_0x3e1303[_0x3fb9('0x26')][_0x3fb9('0x6f')]=_0x241bea[0x0];if(!_0x4fb62f[_0x3fb9('0x54')]['UserId'])return;return db['User']['find']({'where':{'id':_0x4fb62f[_0x3fb9('0x54')][_0x3fb9('0x5f')],'role':_0x3fb9('0x61')},'attributes':['id',_0x3fb9('0x35'),'fullname',_0x3fb9('0x72'),_0x3fb9('0x73')],'raw':!![]});}return null;})[_0x3fb9('0x34')](function(_0x16fe7f){if(!_0x16fe7f)return null;_0x3e1303[_0x3fb9('0x26')][_0x3fb9('0x61')]=_0x16fe7f;return _0x3e1303;})[_0x3fb9('0x34')](function(_0x52921d){if(_0x52921d){_0x52921d['message']['interface']=util[_0x3fb9('0x5d')](_0x3fb9('0x76'),_0x4fb62f[_0x3fb9('0x60')]['name']);_0x52921d['message'][_0x3fb9('0x77')]=_0x3e1303[_0x3fb9('0x77')];_0x52921d[_0x3fb9('0x26')]['motionChannel']=_0x3e1303[_0x3fb9('0x77')];_0x52921d[_0x3fb9('0x26')]['event']=_0x3fb9('0x7a');respondWithRpcPromise('EventManager',_0x3fb9('0x81'),{'event':_0x3fb9('0x82'),'message':_0x52921d['message']},client9002);return _0x3e1303;}return null;})[_0x3fb9('0x34')](respondWithResult(_0x527dec,null))[_0x3fb9('0x28')](handleError(_0x527dec,null));};exports[_0x3fb9('0x2a')]=function(_0x569dc7,_0x3d0d6a,_0xb7b4f5){if(_0x569dc7[_0x3fb9('0x54')]['id']){delete _0x569dc7['body']['id'];}var _0x4f1ee0;return db[_0x3fb9('0x4d')]['find']({'where':{'id':_0x569dc7[_0x3fb9('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d0d6a,null))[_0x3fb9('0x34')](function(_0x1de9ce){if(_0x1de9ce){_0x4f1ee0=_0x1de9ce;return db[_0x3fb9('0x83')][_0x3fb9('0x55')]({'where':{'id':_0x1de9ce[_0x3fb9('0x84')]}});}})[_0x3fb9('0x34')](handleEntityNotFound(_0x3d0d6a,null))[_0x3fb9('0x34')](function(_0x246e1c){if(_0x246e1c){logger[_0x3fb9('0x85')](_0x3fb9('0x22'),_0x3fb9('0x2a'),_0x3fb9('0x86'),_0x246e1c['type'],util['inspect'](_0x569dc7[_0x3fb9('0x54')],{'showHidden':![],'depth':null}));switch(_0x246e1c['type']){case _0x3fb9('0x87'):if(_0x569dc7[_0x3fb9('0x54')][_0x3fb9('0x88')]&&_0x569dc7[_0x3fb9('0x54')][_0x3fb9('0x88')]===_0x4f1ee0[_0x3fb9('0x89')]){return _0x4f1ee0['update']({'read':!![]});}else{logger[_0x3fb9('0x24')](_0x3fb9('0x8a'),'status','twilio',util[_0x3fb9('0x8b')](_0x569dc7[_0x3fb9('0x54')],{'showHidden':![],'depth':null}));}break;case _0x3fb9('0x8c'):if(_0x569dc7[_0x3fb9('0x54')]['MessageUUID']&&_0x569dc7[_0x3fb9('0x54')]['MessageUUID']===_0x4f1ee0[_0x3fb9('0x89')]&&_['indexOf']([_0x3fb9('0x8d'),_0x3fb9('0x8e')],_0x569dc7['body'][_0x3fb9('0x8f')])>=0x0){return _0x4f1ee0[_0x3fb9('0x32')]({'read':!![]});}else{logger[_0x3fb9('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fb9('0x2a'),_0x3fb9('0x90'),util[_0x3fb9('0x8b')](_0x569dc7[_0x3fb9('0x54')],{'showHidden':![],'depth':null}));}break;case _0x3fb9('0x91'):var _0x3ef5d2=_0x569dc7['body'][_0x3fb9('0x92')][0x0];if(_0x3ef5d2[_0x3fb9('0x2a')][_0x3fb9('0x93')]==='DELIVERED'){return _0x4f1ee0[_0x3fb9('0x32')]({'read':!![]});}else{logger[_0x3fb9('0x24')](_0x3fb9('0x8a'),_0x3fb9('0x2a'),'infobip',util['inspect'](_0x569dc7[_0x3fb9('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x4f1ee0;}})[_0x3fb9('0x34')](respondWithResult(_0x3d0d6a,null))[_0x3fb9('0x28')](handleError(_0x3d0d6a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 7ed992b..c545661 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 _0x755f=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x329473,_0x3af48b){var _0x27394f=function(_0x4b94be){while(--_0x4b94be){_0x329473['push'](_0x329473['shift']());}};_0x27394f(++_0x3af48b);}(_0x755f,0x16e));var _0xf755=function(_0x52a9fa,_0x13f364){_0x52a9fa=_0x52a9fa-0x0;var _0x13280b=_0x755f[_0x52a9fa];return _0x13280b;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xf755('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf755('0x1')](0x0);var events={'afterCreate':_0xf755('0x2'),'afterUpdate':_0xf755('0x3'),'afterDestroy':_0xf755('0x4')};function emitEvent(_0x39d03e){return function(_0x434b33,_0x42b633,_0x2ee9e0){SmsMessageEvents['emit'](_0x39d03e+':'+_0x434b33['id'],_0x434b33);SmsMessageEvents[_0xf755('0x5')](_0x39d03e,_0x434b33);_0x2ee9e0(null);};}for(var e in events){if(events[_0xf755('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xf755('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x21c6=['hook','exports','events','../../mysqldb','SmsMessage','save','update','remove','emit'];(function(_0x75618f,_0x20d707){var _0x48c1c4=function(_0x10b048){while(--_0x10b048){_0x75618f['push'](_0x75618f['shift']());}};_0x48c1c4(++_0x20d707);}(_0x21c6,0xad));var _0x621c=function(_0x47b57d,_0x4645a0){_0x47b57d=_0x47b57d-0x0;var _0x92ca2c=_0x21c6[_0x47b57d];return _0x92ca2c;};'use strict';var EventEmitter=require(_0x621c('0x0'));var SmsMessage=require(_0x621c('0x1'))['db'][_0x621c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x621c('0x3'),'afterUpdate':_0x621c('0x4'),'afterDestroy':_0x621c('0x5')};function emitEvent(_0x57d79c){return function(_0x352b9b,_0x5dcbf6,_0x1eeb23){SmsMessageEvents[_0x621c('0x6')](_0x57d79c+':'+_0x352b9b['id'],_0x352b9b);SmsMessageEvents[_0x621c('0x6')](_0x57d79c,_0x352b9b);_0x1eeb23(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x621c('0x7')](e,emitEvent(event));}}module[_0x621c('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index e7cdc99..c227c09 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 _0x0c61=['username','password','smsMethod','sender','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','messages','message_id','catch','clickSend','plivo','/status?token=','%s:%s','authId','Basic\x20%s','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20username,\x20password','crypto','apiKey','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','createdAt','toLowerCase','error','SmsAccount','find','type','twilio','phone','authToken','body','remote','/api/sms/messages/','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby'];(function(_0x4f8e52,_0x2d0050){var _0x55f89c=function(_0x5b6af0){while(--_0x5b6af0){_0x4f8e52['push'](_0x4f8e52['shift']());}};_0x55f89c(++_0x2d0050);}(_0x0c61,0x13c));var _0x10c6=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x0c61[_0x337748];return _0x3bb03f;};'use strict';var _=require(_0x10c6('0x0'));var util=require('util');var logger=require(_0x10c6('0x1'))('api');var moment=require(_0x10c6('0x2'));var BPromise=require('bluebird');var rp=require(_0x10c6('0x3'));var fs=require('fs');var path=require(_0x10c6('0x4'));var rimraf=require(_0x10c6('0x5'));var config=require(_0x10c6('0x6'));var attributes=require('./smsMessage.attributes');module[_0x10c6('0x7')]=function(_0x15a088,_0xe2acac){return _0x15a088['define'](_0x10c6('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x10c6('0x9'),'fields':[_0x10c6('0x9')]},{'name':_0x10c6('0xa'),'fields':['body'],'type':_0x10c6('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a8fc6,_0x32fb63,_0xd2e6cb){var _0x118703=_0x15a088[_0x10c6('0xc')];var _0x354066=_0x1a8fc6[_0x10c6('0xd')]({'plain':!![]});if(_0x354066[_0x10c6('0xe')]['toLowerCase']()==='in'||_0x354066[_0x10c6('0xe')]['toLowerCase']()==='out'&&!_0x354066[_0x10c6('0xf')]&&!_[_0x10c6('0x10')](_0x354066['UserId'])&&!_[_0x10c6('0x10')](_0x354066[_0x10c6('0x11')])){_0x118703[_0x10c6('0x12')][_0x10c6('0x13')]({'where':{'id':_0x354066[_0x10c6('0x11')]}})[_0x10c6('0x14')](function(_0x778a6d){if(_0x778a6d){_0x778a6d['update']({'lastMsgAt':_0x354066[_0x10c6('0x15')],'lastMsgDirection':_0x354066[_0x10c6('0xe')][_0x10c6('0x16')]()});}})['catch'](function(_0x1db54a){console[_0x10c6('0x17')](_0x1db54a);});}if(_0x354066[_0x10c6('0xe')]==='out'&&!_0x354066[_0x10c6('0xf')]){var _0x39447e;_0x118703[_0x10c6('0x18')][_0x10c6('0x19')]({'where':{'id':_0x354066['SmsAccountId']},'raw':!![]})[_0x10c6('0x14')](function(_0x539c24){_0x39447e=_0x539c24;if(_0x39447e&&_0x39447e[_0x10c6('0x1a')]){switch(_0x39447e[_0x10c6('0x1a')]){case'twilio':var _0x17c9fc=require(_0x10c6('0x1b'));if(_0x39447e['accountSid']&&_0x39447e['authToken']&&_0x39447e[_0x10c6('0x1c')]){var _0x44463d=new _0x17c9fc(_0x39447e['accountSid'],_0x39447e[_0x10c6('0x1d')]);_0x44463d['messages']['create']({'body':_0x354066[_0x10c6('0x1e')],'to':_0x354066[_0x10c6('0x1c')],'from':_0x39447e[_0x10c6('0x1c')],'statusCallback':_0x39447e[_0x10c6('0x1f')]+_0x10c6('0x20')+_0x354066['id']+'/status?token='+_0x39447e[_0x10c6('0x21')]})[_0x10c6('0x14')](function(_0x23dae7){if(_0x23dae7[_0x10c6('0x22')]){return _0x1a8fc6[_0x10c6('0x23')]({'messageId':_0x23dae7['sid']});}})['catch'](function(_0x307d32){logger[_0x10c6('0x17')](_0x10c6('0x24'),'afterCreate',_0x10c6('0x1b'),util[_0x10c6('0x25')](_0x307d32,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),'twilio',_0x10c6('0x27'));}break;case _0x10c6('0x28'):var _0x535f47='https://api.skebby.it/API/v1.0/REST/';if(_0x39447e[_0x10c6('0x29')]&&_0x39447e[_0x10c6('0x2a')]){var _0x9926fb={'recipient':[_0x354066['phone']],'message':_0x354066[_0x10c6('0x1e')],'message_type':_0x39447e[_0x10c6('0x2b')]};if(_0x39447e[_0x10c6('0x2b')]&&_0x39447e[_0x10c6('0x2b')]!=='SI'){_0x9926fb[_0x10c6('0x2c')]=_0x39447e[_0x10c6('0x1c')];}var _0x248f72={'url':_0x535f47+'login?username='+_0x39447e[_0x10c6('0x29')]+_0x10c6('0x2d')+_0x39447e[_0x10c6('0x2a')],'method':_0x10c6('0x2e')};rp(_0x248f72)[_0x10c6('0x14')](function(_0x2424e7){var _0x117abf=_0x2424e7[_0x10c6('0x2f')](';');var _0x1a1b3e={'user_key':_0x117abf[0x0],'session_key':_0x117abf[0x1]};_0x248f72={'url':_0x535f47+_0x10c6('0x30'),'method':_0x10c6('0x31'),'headers':{'user_key':_0x1a1b3e[_0x10c6('0x32')],'Session_key':_0x1a1b3e['session_key']},'json':!![],'body':_0x9926fb};return rp(_0x248f72);})[_0x10c6('0x14')](function(_0x11c3ae){if(_0x11c3ae[_0x10c6('0x33')]>=0x1){var _0x518851={'messageId':_0x11c3ae[_0x10c6('0x34')]};if(_0x39447e['smsMethod']!=='GP'||!_0x39447e[_0x10c6('0x35')]){_0x518851[_0x10c6('0x36')]=!![];}return _0x1a8fc6['update'](_0x518851);}else{return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'skebby',util[_0x10c6('0x25')](_0x11c3ae,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5dca2d){return logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x28'),util[_0x10c6('0x25')](_0x5dca2d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x28'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x10c6('0x37'):if(_0x39447e['authToken']){var _0x5e6e4a={'recipient':_0x354066[_0x10c6('0x1c')],'message':_0x354066[_0x10c6('0x1e')],'sender':_0x39447e[_0x10c6('0x38')]||_0x39447e[_0x10c6('0x1c')],'authorization':_0x39447e[_0x10c6('0x1d')]};var _0x32fb63={'method':_0x10c6('0x31'),'uri':_0x10c6('0x39'),'body':_0x5e6e4a,'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x499441){var _0x4ad07f={'messageId':_0x499441['requestid']};if(!_0x39447e[_0x10c6('0x35')]){_0x4ad07f['read']=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x4ad07f);})['catch'](function(_0x538021){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x37'),util[_0x10c6('0x25')](_0x538021,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x37'),_0x10c6('0x3a'));}break;case _0x10c6('0x3b'):if(_0x39447e['username']&&_0x39447e['password']){var _0x5e6e4a={'messages':[{'source':_0x10c6('0x3c'),'to':_0x354066[_0x10c6('0x1c')],'body':_0x354066['body'],'from':_0x39447e[_0x10c6('0x38')]||_0x39447e['phone']}]};var _0x4a093a=util[_0x10c6('0x3d')]('%s:%s',_0x39447e[_0x10c6('0x29')],_0x39447e[_0x10c6('0x2a')]);var _0x32fb63={'method':_0x10c6('0x31'),'uri':_0x10c6('0x3e'),'body':_0x5e6e4a,'headers':{'Authorization':util[_0x10c6('0x3d')]('Basic\x20%s',new Buffer(_0x4a093a)[_0x10c6('0x3f')](_0x10c6('0x40')))},'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x5cc6b4){if(_0x5cc6b4[_0x10c6('0x41')]>=0xc8&&_0x5cc6b4[_0x10c6('0x41')]<=0xce){if(_0x5cc6b4[_0x10c6('0x42')]&&_0x5cc6b4['data'][_0x10c6('0x43')]>0x0){var _0x1d8de9=_[_0x10c6('0x44')](_0x5cc6b4[_0x10c6('0x42')][_0x10c6('0x45')]);var _0x2bdaf4={'messageId':_0x1d8de9[_0x10c6('0x46')]};if(!_0x39447e[_0x10c6('0x35')]){_0x2bdaf4[_0x10c6('0x36')]=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x2bdaf4);}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),'clickSend',util[_0x10c6('0x25')](_0x5cc6b4,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),'clickSend',util[_0x10c6('0x25')](_0x5cc6b4,{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x2e3b3f){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'clickSend',util[_0x10c6('0x25')](_0x2e3b3f,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10c6('0x26'),_0x10c6('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x10c6('0x49'):if(_0x39447e['authId']&&_0x39447e[_0x10c6('0x1d')]){var _0x5e6e4a={'dst':_0x354066['phone'],'text':_0x354066[_0x10c6('0x1e')],'src':_0x39447e[_0x10c6('0x38')]||_0x39447e[_0x10c6('0x1c')],'url':_0x39447e[_0x10c6('0x1f')]+_0x10c6('0x20')+_0x354066['id']+_0x10c6('0x4a')+_0x39447e[_0x10c6('0x21')]};var _0x4a093a=util[_0x10c6('0x3d')](_0x10c6('0x4b'),_0x39447e[_0x10c6('0x4c')],_0x39447e[_0x10c6('0x1d')]);var _0x32fb63={'method':_0x10c6('0x31'),'uri':util[_0x10c6('0x3d')]('https://api.plivo.com/v1/Account/%s/Message/',_0x39447e[_0x10c6('0x4c')]),'body':_0x5e6e4a,'headers':{'Authorization':util[_0x10c6('0x3d')](_0x10c6('0x4d'),new Buffer(_0x4a093a)[_0x10c6('0x3f')](_0x10c6('0x40')))},'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x23fef6){var _0x2658cd={'messageId':_0x23fef6['message_uuid'][0x0]};return _0x1a8fc6[_0x10c6('0x23')](_0x2658cd);})['catch'](function(_0x21c577){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'plivo',util[_0x10c6('0x25')](_0x21c577,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10c6('0x26'),'plivo',_0x10c6('0x4e'));}break;case _0x10c6('0x4f'):if(_0x39447e['username']&&_0x39447e[_0x10c6('0x2a')]){if(_0x39447e['baseUrl']){var _0x22bc98={'method':_0x10c6('0x31'),'uri':_0x39447e[_0x10c6('0x50')]+_0x10c6('0x51'),'body':{'username':_0x39447e[_0x10c6('0x29')],'password':_0x39447e[_0x10c6('0x2a')]},'json':!![]};return rp(_0x22bc98)['then'](function(_0x3bd314){var _0x5236c6={'method':_0x10c6('0x31'),'uri':_0x39447e[_0x10c6('0x50')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x39447e['phone'],'destinations':[{'to':_0x354066['phone']}],'text':_0x354066[_0x10c6('0x1e')],'notifyUrl':_0x39447e[_0x10c6('0x1f')]+_0x10c6('0x20')+_0x354066['id']+_0x10c6('0x4a')+_0x39447e[_0x10c6('0x21')],'notifyContentType':_0x10c6('0x52'),'callbackData':_0x39447e[_0x10c6('0x1c')]+';'+_0x354066[_0x10c6('0x1e')]}]},'headers':{'Authorization':_0x10c6('0x53')+_0x3bd314[_0x10c6('0x21')]},'json':!![]};return rp(_0x5236c6)[_0x10c6('0x14')](function(_0x32720a){if(_0x32720a[_0x10c6('0x45')]){var _0x1ea6b0={'messageId':_0x32720a[_0x10c6('0x45')][0x0][_0x10c6('0x9')]};if(!_0x39447e[_0x10c6('0x35')]){_0x1ea6b0[_0x10c6('0x36')]=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x1ea6b0);}else{return logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x4f'),util[_0x10c6('0x25')](_0x32720a,{'showHidden':![],'depth':null}));}});})[_0x10c6('0x47')](function(_0x3373e6){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x4f'),util[_0x10c6('0x25')](_0x3373e6,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10c6('0x26'),'infobip',_0x10c6('0x54'));}break;case'csc':var _0x566ec4=require(_0x10c6('0x55'));if(_0x39447e[_0x10c6('0x56')]){var _0x4b982a={};_0x4b982a['login']=_0x39447e[_0x10c6('0x29')];_0x4b982a[_0x10c6('0x1c')]=_0x354066[_0x10c6('0x1c')];_0x4b982a['sender']=_0x39447e[_0x10c6('0x1c')];_0x4b982a[_0x10c6('0x57')]=_0x354066[_0x10c6('0x1e')];_0x4b982a[_0x10c6('0x58')]=+new Date();var _0x290049='';var _0x459dce='';var _0x27f65f=Object['keys'](_0x4b982a);_0x27f65f[_0x10c6('0x59')]();for(var _0x4d9318=0x0;_0x4d9318<_0x27f65f[_0x10c6('0x5a')];_0x4d9318++){if(_0x290049!=''){_0x290049+='&';}_0x290049+=_0x27f65f[_0x4d9318]+'='+encodeURIComponent(_0x4b982a[_0x27f65f[_0x4d9318]]);_0x459dce+=_0x4b982a[_0x27f65f[_0x4d9318]];}_0x459dce+=_0x39447e['apiKey'];_0x459dce=_0x566ec4[_0x10c6('0x5b')](_0x10c6('0x5c'))['update'](_0x459dce)[_0x10c6('0x5d')](_0x10c6('0x5e'));if(_0x290049!==''){_0x290049+='&';}_0x290049+=_0x10c6('0x5f')+_0x459dce;var _0x248f72={'method':_0x10c6('0x2e'),'uri':_0x39447e[_0x10c6('0x50')]+_0x10c6('0x60')+_0x290049,'json':!![]};return rp(_0x248f72)['then'](function(_0x4bdb40){var _0x35e175=Object[_0x10c6('0x61')](_0x4bdb40);if(_0x4bdb40[_0x35e175[0x0]]['error']&&parseInt(_0x4bdb40[_0x35e175[0x0]]['error'])===0x0){var _0x1fe02f={'messageId':_0x4bdb40[_0x35e175[0x0]][_0x10c6('0x62')]};if(!_0x39447e['deliveryReport']){_0x1fe02f[_0x10c6('0x36')]=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x1fe02f);}else{return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x63'),util[_0x10c6('0x25')](_0x4bdb40[_0x10c6('0x17')],{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x15702c){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x63'),util[_0x10c6('0x25')](_0x15702c,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),'afterCreate',_0x10c6('0x63'),'Missing\x20parameters:\x20apiKey');}break;case _0x10c6('0x64'):if(_0x39447e['apiKey']){var _0x509853={'method':_0x10c6('0x31'),'uri':_0x10c6('0x65'),'headers':{'Authorization':_0x39447e[_0x10c6('0x56')]},'body':{'content':_0x354066[_0x10c6('0x1e')],'to':[_0x354066[_0x10c6('0x1c')]],'from':_0x39447e[_0x10c6('0x1c')],'binary':![],'clientMessageId':_0x10c6('0x66'),'charset':'UTF-8'},'json':!![]};rp(_0x509853)[_0x10c6('0x14')](function(_0x2ed41c){if(!_0x2ed41c['error']){var _0x671e47={'messageId':_0x2ed41c['messages'][0x0][_0x10c6('0x67')]};if(!_0x39447e[_0x10c6('0x35')]){_0x671e47[_0x10c6('0x36')]=!![];}return _0x1a8fc6['update'](_0x671e47);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0x10c6('0x25')](_0x2ed41c[_0x10c6('0x17')],{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x1d8550){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x64'),util[_0x10c6('0x25')](_0x1d8550,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),'afterCreate',_0x10c6('0x64'),_0x10c6('0x68'));}break;case _0x10c6('0x69'):if(_0x39447e[_0x10c6('0x29')]&&_0x39447e[_0x10c6('0x2a')]){var _0x4a093a=util['format'](_0x10c6('0x4b'),_0x39447e[_0x10c6('0x29')],_0x39447e[_0x10c6('0x2a')]);var _0x32fb63={'method':_0x10c6('0x31'),'uri':_0x10c6('0x6a')+_0x39447e[_0x10c6('0x6b')]+_0x10c6('0x6c'),'body':{'to':[_0x354066[_0x10c6('0x1c')]],'text':_0x354066[_0x10c6('0x1e')],'from':_0x39447e[_0x10c6('0x1c')],'applicationId':_0x39447e[_0x10c6('0x6d')]},'headers':{'Authorization':util[_0x10c6('0x3d')](_0x10c6('0x4d'),new Buffer(_0x4a093a)[_0x10c6('0x3f')]('base64'))},'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x594054){if(_0x594054['id']){var _0x23e597={'messageId':_0x594054['id']};return _0x1a8fc6[_0x10c6('0x23')](_0x23e597);}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x69'),util[_0x10c6('0x25')](_0x594054,{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x513dc2){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x69'),util['inspect'](_0x513dc2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x69'),_0x10c6('0x54'));}break;case _0x10c6('0x6e'):if(_0x39447e[_0x10c6('0x56')]){var _0x5a965b={};var _0x248f72={'method':_0x10c6('0x31'),'uri':_0x10c6('0x6f'),'headers':{'Authorization':_0x10c6('0x70')+_0x39447e['apiKey'],'Content-Type':_0x10c6('0x52')},'body':{'from':_0x39447e[_0x10c6('0x1c')],'to':_0x354066[_0x10c6('0x1c')],'text':_0x354066[_0x10c6('0x1e')]},'json':!![]};return rp(_0x248f72)['then'](function(_0x398ded){if(_0x398ded['code']==0xca){_0x5a965b['message']=_0x398ded;var _0xe4c411={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x39447e['apiKey'],'Content-Type':_0x10c6('0x52')},'body':{'refid':_0x5a965b[_0x10c6('0x71')]['refid']},'json':!![]};return rp(_0xe4c411)['then'](function(_0x4223b9){_0x5a965b['status']=_0x4223b9;var _0x562fb3={'messageId':_0x5a965b[_0x10c6('0x71')][_0x10c6('0x72')],'read':!![]};return _0x1a8fc6[_0x10c6('0x23')](_0x562fb3);});}else{return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x6e'),util[_0x10c6('0x25')](_0x398ded,{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x304f16){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x6e'),util['inspect'](_0x304f16,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x6e'),_0x10c6('0x73'));}break;}}})[_0x10c6('0x74')](function(){_0xd2e6cb();});}else{_0xd2e6cb();}}},'charset':_0x10c6('0x75'),'collate':_0x10c6('0x76')});}; \ No newline at end of file +var _0x97e7=['models','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','authToken','accountSid','messages','create','phone','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','/status?token=','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','keys','length','apiKey','createHash','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','finally','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT'];(function(_0x5a559c,_0xb34e0b){var _0x1a4bd9=function(_0x3178e7){while(--_0x3178e7){_0x5a559c['push'](_0x5a559c['shift']());}};_0x1a4bd9(++_0xb34e0b);}(_0x97e7,0x6f));var _0x797e=function(_0x1d5874,_0x118e9a){_0x1d5874=_0x1d5874-0x0;var _0x10608f=_0x97e7[_0x1d5874];return _0x10608f;};'use strict';var _=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var logger=require(_0x797e('0x2'))(_0x797e('0x3'));var moment=require('moment');var BPromise=require(_0x797e('0x4'));var rp=require(_0x797e('0x5'));var fs=require('fs');var path=require(_0x797e('0x6'));var rimraf=require('rimraf');var config=require(_0x797e('0x7'));var attributes=require(_0x797e('0x8'));module['exports']=function(_0x27360a,_0xd2c48){return _0x27360a[_0x797e('0x9')](_0x797e('0xa'),attributes,{'tableName':_0x797e('0xb'),'paranoid':![],'indexes':[{'name':_0x797e('0xc'),'fields':[_0x797e('0xc')]},{'name':_0x797e('0xd'),'fields':[_0x797e('0xe')],'type':_0x797e('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21b014,_0x47efa7,_0x43c91c){var _0xeee94=_0x27360a[_0x797e('0x10')];var _0x352166=_0x21b014['get']({'plain':!![]});if(_0x352166['direction'][_0x797e('0x11')]()==='in'||_0x352166[_0x797e('0x12')]['toLowerCase']()===_0x797e('0x13')&&!_0x352166[_0x797e('0x14')]&&!_[_0x797e('0x15')](_0x352166[_0x797e('0x16')])&&!_['isNil'](_0x352166[_0x797e('0x17')])){_0xeee94[_0x797e('0x18')]['findOne']({'where':{'id':_0x352166[_0x797e('0x17')]}})[_0x797e('0x19')](function(_0x3d15d9){if(_0x3d15d9){_0x3d15d9[_0x797e('0x1a')]({'lastMsgAt':_0x352166[_0x797e('0x1b')],'lastMsgDirection':_0x352166[_0x797e('0x12')][_0x797e('0x11')]()});}})[_0x797e('0x1c')](function(_0x519287){console[_0x797e('0x1d')](_0x519287);});}if(_0x352166[_0x797e('0x12')]===_0x797e('0x13')&&!_0x352166[_0x797e('0x14')]){var _0x367a5a;_0xeee94[_0x797e('0x1e')][_0x797e('0x1f')]({'where':{'id':_0x352166[_0x797e('0x20')]},'raw':!![]})['then'](function(_0x3b8a74){_0x367a5a=_0x3b8a74;if(_0x367a5a&&_0x367a5a[_0x797e('0x21')]){switch(_0x367a5a[_0x797e('0x21')]){case'twilio':var _0x4d1989=require('twilio');if(_0x367a5a['accountSid']&&_0x367a5a[_0x797e('0x22')]&&_0x367a5a['phone']){var _0x36576e=new _0x4d1989(_0x367a5a[_0x797e('0x23')],_0x367a5a[_0x797e('0x22')]);_0x36576e[_0x797e('0x24')][_0x797e('0x25')]({'body':_0x352166[_0x797e('0xe')],'to':_0x352166['phone'],'from':_0x367a5a[_0x797e('0x26')],'statusCallback':_0x367a5a[_0x797e('0x27')]+_0x797e('0x28')+_0x352166['id']+'/status?token='+_0x367a5a[_0x797e('0x29')]})[_0x797e('0x19')](function(_0x2f201c){if(_0x2f201c[_0x797e('0x2a')]){return _0x21b014[_0x797e('0x1a')]({'messageId':_0x2f201c[_0x797e('0x2a')]});}})[_0x797e('0x1c')](function(_0x51eb73){logger[_0x797e('0x1d')](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x2d'),util[_0x797e('0x2e')](_0x51eb73,{'showHidden':![],'depth':null}));});}else{logger[_0x797e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x797e('0x2d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x1c2217=_0x797e('0x2f');if(_0x367a5a[_0x797e('0x30')]&&_0x367a5a[_0x797e('0x31')]){var _0x408bc5={'recipient':[_0x352166[_0x797e('0x26')]],'message':_0x352166['body'],'message_type':_0x367a5a[_0x797e('0x32')]};if(_0x367a5a[_0x797e('0x32')]&&_0x367a5a[_0x797e('0x32')]!=='SI'){_0x408bc5[_0x797e('0x33')]=_0x367a5a[_0x797e('0x26')];}var _0x48612b={'url':_0x1c2217+_0x797e('0x34')+_0x367a5a[_0x797e('0x30')]+_0x797e('0x35')+_0x367a5a[_0x797e('0x31')],'method':_0x797e('0x36')};rp(_0x48612b)[_0x797e('0x19')](function(_0x105650){var _0x3c3c6b=_0x105650[_0x797e('0x37')](';');var _0x85feb5={'user_key':_0x3c3c6b[0x0],'session_key':_0x3c3c6b[0x1]};_0x48612b={'url':_0x1c2217+_0x797e('0x38'),'method':_0x797e('0x39'),'headers':{'user_key':_0x85feb5['user_key'],'Session_key':_0x85feb5[_0x797e('0x3a')]},'json':!![],'body':_0x408bc5};return rp(_0x48612b);})[_0x797e('0x19')](function(_0x5e77e1){if(_0x5e77e1[_0x797e('0x3b')]>=0x1){var _0x1edbc4={'messageId':_0x5e77e1[_0x797e('0x3c')]};if(_0x367a5a[_0x797e('0x32')]!=='GP'||!_0x367a5a[_0x797e('0x3d')]){_0x1edbc4['read']=!![];}return _0x21b014[_0x797e('0x1a')](_0x1edbc4);}else{return logger[_0x797e('0x1d')](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x3e'),util[_0x797e('0x2e')](_0x5e77e1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x25b80e){return logger[_0x797e('0x1d')](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x3e'),util['inspect'](_0x25b80e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x3e'),_0x797e('0x3f'));}break;case _0x797e('0x40'):if(_0x367a5a[_0x797e('0x22')]){var _0x404a34={'recipient':_0x352166[_0x797e('0x26')],'message':_0x352166['body'],'sender':_0x367a5a[_0x797e('0x41')]||_0x367a5a[_0x797e('0x26')],'authorization':_0x367a5a['authToken']};var _0x47efa7={'method':_0x797e('0x39'),'uri':_0x797e('0x42'),'body':_0x404a34,'json':!![]};rp(_0x47efa7)[_0x797e('0x19')](function(_0x37705a){var _0xaf3bb1={'messageId':_0x37705a[_0x797e('0x43')]};if(!_0x367a5a[_0x797e('0x3d')]){_0xaf3bb1[_0x797e('0x44')]=!![];}return _0x21b014[_0x797e('0x1a')](_0xaf3bb1);})[_0x797e('0x1c')](function(_0x7c5894){logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x40'),util[_0x797e('0x2e')](_0x7c5894,{'showHidden':![],'depth':null}));});}else{logger[_0x797e('0x1d')](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x40'),_0x797e('0x45'));}break;case _0x797e('0x46'):if(_0x367a5a[_0x797e('0x30')]&&_0x367a5a[_0x797e('0x31')]){var _0x404a34={'messages':[{'source':_0x797e('0x47'),'to':_0x352166[_0x797e('0x26')],'body':_0x352166[_0x797e('0xe')],'from':_0x367a5a[_0x797e('0x41')]||_0x367a5a['phone']}]};var _0x1d95c1=util[_0x797e('0x48')](_0x797e('0x49'),_0x367a5a[_0x797e('0x30')],_0x367a5a[_0x797e('0x31')]);var _0x47efa7={'method':'POST','uri':_0x797e('0x4a'),'body':_0x404a34,'headers':{'Authorization':util['format'](_0x797e('0x4b'),new Buffer(_0x1d95c1)[_0x797e('0x4c')](_0x797e('0x4d')))},'json':!![]};rp(_0x47efa7)[_0x797e('0x19')](function(_0x81e211){if(_0x81e211['http_code']>=0xc8&&_0x81e211[_0x797e('0x4e')]<=0xce){if(_0x81e211[_0x797e('0x4f')]&&_0x81e211[_0x797e('0x4f')][_0x797e('0x50')]>0x0){var _0x3e57f7=_[_0x797e('0x51')](_0x81e211[_0x797e('0x4f')][_0x797e('0x24')]);var _0x50a59c={'messageId':_0x3e57f7[_0x797e('0x52')]};if(!_0x367a5a['deliveryReport']){_0x50a59c[_0x797e('0x44')]=!![];}return _0x21b014[_0x797e('0x1a')](_0x50a59c);}else{logger[_0x797e('0x1d')](_0x797e('0x2b'),'afterCreate','clickSend',util[_0x797e('0x2e')](_0x81e211,{'showHidden':![],'depth':null}));}}else{logger[_0x797e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x797e('0x2c'),_0x797e('0x53'),util[_0x797e('0x2e')](_0x81e211,{'showHidden':![],'depth':null}));}})[_0x797e('0x1c')](function(_0x426333){logger[_0x797e('0x1d')](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x53'),util[_0x797e('0x2e')](_0x426333,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x797e('0x2c'),_0x797e('0x53'),_0x797e('0x3f'));}break;case'plivo':if(_0x367a5a[_0x797e('0x54')]&&_0x367a5a[_0x797e('0x22')]){var _0x404a34={'dst':_0x352166[_0x797e('0x26')],'text':_0x352166['body'],'src':_0x367a5a[_0x797e('0x41')]||_0x367a5a[_0x797e('0x26')],'url':_0x367a5a[_0x797e('0x27')]+_0x797e('0x28')+_0x352166['id']+_0x797e('0x55')+_0x367a5a[_0x797e('0x29')]};var _0x1d95c1=util[_0x797e('0x48')]('%s:%s',_0x367a5a['authId'],_0x367a5a[_0x797e('0x22')]);var _0x47efa7={'method':_0x797e('0x39'),'uri':util[_0x797e('0x48')]('https://api.plivo.com/v1/Account/%s/Message/',_0x367a5a[_0x797e('0x54')]),'body':_0x404a34,'headers':{'Authorization':util[_0x797e('0x48')](_0x797e('0x4b'),new Buffer(_0x1d95c1)[_0x797e('0x4c')](_0x797e('0x4d')))},'json':!![]};rp(_0x47efa7)[_0x797e('0x19')](function(_0x1cf55a){var _0x54ea9d={'messageId':_0x1cf55a[_0x797e('0x56')][0x0]};return _0x21b014[_0x797e('0x1a')](_0x54ea9d);})[_0x797e('0x1c')](function(_0x5cffe7){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x797e('0x57'),util[_0x797e('0x2e')](_0x5cffe7,{'showHidden':![],'depth':null}));});}else{logger[_0x797e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x797e('0x2c'),'plivo',_0x797e('0x58'));}break;case _0x797e('0x59'):if(_0x367a5a[_0x797e('0x30')]&&_0x367a5a[_0x797e('0x31')]){if(_0x367a5a[_0x797e('0x5a')]){var _0x12bb1d={'method':_0x797e('0x39'),'uri':_0x367a5a[_0x797e('0x5a')]+'/auth/1/session','body':{'username':_0x367a5a['username'],'password':_0x367a5a[_0x797e('0x31')]},'json':!![]};return rp(_0x12bb1d)[_0x797e('0x19')](function(_0x466185){var _0x1b3817={'method':_0x797e('0x39'),'uri':_0x367a5a[_0x797e('0x5a')]+_0x797e('0x5b'),'body':{'messages':[{'from':_0x367a5a['phone'],'destinations':[{'to':_0x352166[_0x797e('0x26')]}],'text':_0x352166['body'],'notifyUrl':_0x367a5a[_0x797e('0x27')]+_0x797e('0x28')+_0x352166['id']+'/status?token='+_0x367a5a['token'],'notifyContentType':'application/json','callbackData':_0x367a5a[_0x797e('0x26')]+';'+_0x352166[_0x797e('0xe')]}]},'headers':{'Authorization':_0x797e('0x5c')+_0x466185[_0x797e('0x29')]},'json':!![]};return rp(_0x1b3817)['then'](function(_0x4a282c){if(_0x4a282c['messages']){var _0x300cfc={'messageId':_0x4a282c[_0x797e('0x24')][0x0]['messageId']};if(!_0x367a5a[_0x797e('0x3d')]){_0x300cfc[_0x797e('0x44')]=!![];}return _0x21b014['update'](_0x300cfc);}else{return logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x59'),util['inspect'](_0x4a282c,{'showHidden':![],'depth':null}));}});})[_0x797e('0x1c')](function(_0x79435f){return logger[_0x797e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x797e('0x59'),util[_0x797e('0x2e')](_0x79435f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x59'),_0x797e('0x5d'));}}else{logger[_0x797e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x797e('0x2c'),_0x797e('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x797e('0x5e'):var _0x3e49ce=require(_0x797e('0x5f'));if(_0x367a5a['apiKey']){var _0xdb3062={};_0xdb3062[_0x797e('0x60')]=_0x367a5a[_0x797e('0x30')];_0xdb3062['phone']=_0x352166[_0x797e('0x26')];_0xdb3062[_0x797e('0x33')]=_0x367a5a[_0x797e('0x26')];_0xdb3062['text']=_0x352166[_0x797e('0xe')];_0xdb3062[_0x797e('0x61')]=+new Date();var _0x253229='';var _0x326667='';var _0x283fe5=Object[_0x797e('0x62')](_0xdb3062);_0x283fe5['sort']();for(var _0x3a0c7a=0x0;_0x3a0c7a<_0x283fe5[_0x797e('0x63')];_0x3a0c7a++){if(_0x253229!=''){_0x253229+='&';}_0x253229+=_0x283fe5[_0x3a0c7a]+'='+encodeURIComponent(_0xdb3062[_0x283fe5[_0x3a0c7a]]);_0x326667+=_0xdb3062[_0x283fe5[_0x3a0c7a]];}_0x326667+=_0x367a5a[_0x797e('0x64')];_0x326667=_0x3e49ce[_0x797e('0x65')](_0x797e('0x66'))[_0x797e('0x1a')](_0x326667)[_0x797e('0x67')](_0x797e('0x68'));if(_0x253229!==''){_0x253229+='&';}_0x253229+=_0x797e('0x69')+_0x326667;var _0x48612b={'method':_0x797e('0x36'),'uri':_0x367a5a[_0x797e('0x5a')]+'/external/get/send.php?'+_0x253229,'json':!![]};return rp(_0x48612b)[_0x797e('0x19')](function(_0x798fdb){var _0x35ef4d=Object[_0x797e('0x62')](_0x798fdb);if(_0x798fdb[_0x35ef4d[0x0]][_0x797e('0x1d')]&&parseInt(_0x798fdb[_0x35ef4d[0x0]][_0x797e('0x1d')])===0x0){var _0x205634={'messageId':_0x798fdb[_0x35ef4d[0x0]][_0x797e('0x6a')]};if(!_0x367a5a[_0x797e('0x3d')]){_0x205634[_0x797e('0x44')]=!![];}return _0x21b014[_0x797e('0x1a')](_0x205634);}else{return logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x5e'),util[_0x797e('0x2e')](_0x798fdb[_0x797e('0x1d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1f0d89){return logger[_0x797e('0x1d')](_0x797e('0x2b'),'afterCreate',_0x797e('0x5e'),util[_0x797e('0x2e')](_0x1f0d89,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),'csc',_0x797e('0x6b'));}break;case'clickatell':if(_0x367a5a[_0x797e('0x64')]){var _0x4d8089={'method':_0x797e('0x39'),'uri':_0x797e('0x6c'),'headers':{'Authorization':_0x367a5a[_0x797e('0x64')]},'body':{'content':_0x352166['body'],'to':[_0x352166[_0x797e('0x26')]],'from':_0x367a5a[_0x797e('0x26')],'binary':![],'clientMessageId':_0x797e('0x6d'),'charset':'UTF-8'},'json':!![]};rp(_0x4d8089)[_0x797e('0x19')](function(_0x551e67){if(!_0x551e67[_0x797e('0x1d')]){var _0x2ad572={'messageId':_0x551e67[_0x797e('0x24')][0x0][_0x797e('0x6e')]};if(!_0x367a5a['deliveryReport']){_0x2ad572[_0x797e('0x44')]=!![];}return _0x21b014[_0x797e('0x1a')](_0x2ad572);}else{return logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x6f'),util[_0x797e('0x2e')](_0x551e67[_0x797e('0x1d')],{'showHidden':![],'depth':null}));}})[_0x797e('0x1c')](function(_0x15ea5a){return logger[_0x797e('0x1d')](_0x797e('0x2b'),'afterCreate',_0x797e('0x6f'),util[_0x797e('0x2e')](_0x15ea5a,{'showHidden':![],'depth':null}));});}else{logger[_0x797e('0x1d')](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x6f'),_0x797e('0x6b'));}break;case _0x797e('0x70'):if(_0x367a5a['username']&&_0x367a5a['password']){var _0x1d95c1=util[_0x797e('0x48')](_0x797e('0x49'),_0x367a5a[_0x797e('0x30')],_0x367a5a['password']);var _0x47efa7={'method':_0x797e('0x39'),'uri':_0x797e('0x71')+_0x367a5a[_0x797e('0x72')]+_0x797e('0x73'),'body':{'to':[_0x352166[_0x797e('0x26')]],'text':_0x352166['body'],'from':_0x367a5a['phone'],'applicationId':_0x367a5a[_0x797e('0x74')]},'headers':{'Authorization':util[_0x797e('0x48')](_0x797e('0x4b'),new Buffer(_0x1d95c1)['toString'](_0x797e('0x4d')))},'json':!![]};rp(_0x47efa7)['then'](function(_0x1881f0){if(_0x1881f0['id']){var _0xc0e9c8={'messageId':_0x1881f0['id']};return _0x21b014[_0x797e('0x1a')](_0xc0e9c8);}else{logger['error'](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x70'),util[_0x797e('0x2e')](_0x1881f0,{'showHidden':![],'depth':null}));}})[_0x797e('0x1c')](function(_0x32bea7){logger['error'](_0x797e('0x2b'),'afterCreate',_0x797e('0x70'),util[_0x797e('0x2e')](_0x32bea7,{'showHidden':![],'depth':null}));});}else{logger[_0x797e('0x1d')](_0x797e('0x2b'),_0x797e('0x2c'),_0x797e('0x70'),_0x797e('0x3f'));}break;case _0x797e('0x75'):if(_0x367a5a['apiKey']){var _0x5b5f76={};var _0x48612b={'method':'POST','uri':_0x797e('0x76'),'headers':{'Authorization':_0x797e('0x77')+_0x367a5a[_0x797e('0x64')],'Content-Type':_0x797e('0x78')},'body':{'from':_0x367a5a['phone'],'to':_0x352166[_0x797e('0x26')],'text':_0x352166[_0x797e('0xe')]},'json':!![]};return rp(_0x48612b)[_0x797e('0x19')](function(_0x5a4cbb){if(_0x5a4cbb[_0x797e('0x79')]==0xca){_0x5b5f76[_0x797e('0x7a')]=_0x5a4cbb;var _0x48b5bd={'method':_0x797e('0x39'),'uri':_0x797e('0x7b'),'headers':{'Authorization':'Bearer\x20'+_0x367a5a[_0x797e('0x64')],'Content-Type':'application/json'},'body':{'refid':_0x5b5f76[_0x797e('0x7a')]['refid']},'json':!![]};return rp(_0x48b5bd)[_0x797e('0x19')](function(_0x5a15e2){_0x5b5f76[_0x797e('0x7c')]=_0x5a15e2;var _0x4b5b0b={'messageId':_0x5b5f76[_0x797e('0x7a')][_0x797e('0x7d')],'read':!![]};return _0x21b014['update'](_0x4b5b0b);});}else{return logger[_0x797e('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x797e('0x2c'),_0x797e('0x75'),util[_0x797e('0x2e')](_0x5a4cbb,{'showHidden':![],'depth':null}));}})[_0x797e('0x1c')](function(_0x5918cf){return logger[_0x797e('0x1d')](_0x797e('0x2b'),'afterCreate',_0x797e('0x75'),util[_0x797e('0x2e')](_0x5918cf,{'showHidden':![],'depth':null}));});}else{return logger[_0x797e('0x1d')](_0x797e('0x2b'),'afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0x797e('0x7e')](function(){_0x43c91c();});}else{_0x43c91c();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fd6f768..9186db4 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 _0xd006=['error','code','message','result','create','body','options','raw','CreateSmsMessage','debug','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3f5a40,_0x113dc4){var _0x5c6f32=function(_0x584e2b){while(--_0x584e2b){_0x3f5a40['push'](_0x3f5a40['shift']());}};_0x5c6f32(++_0x113dc4);}(_0xd006,0xeb));var _0x6d00=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xd006[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x6d00('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6d00('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d00('0x2'));var db=require(_0x6d00('0x3'))['db'];var utils=require(_0x6d00('0x4'));var logger=require(_0x6d00('0x5'))(_0x6d00('0x6'));var config=require(_0x6d00('0x7'));var jayson=require(_0x6d00('0x8'));var client=jayson[_0x6d00('0x9')][_0x6d00('0xa')]({'port':0x232a});config[_0x6d00('0xb')]=_['defaults'](config[_0x6d00('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d00('0xc'))(new Redis(config[_0x6d00('0xb')]));require(_0x6d00('0xd'))[_0x6d00('0xe')](socket);function respondWithRpcPromise(_0x4fa0a4,_0x4458a8,_0x79ff29){return new BPromise(function(_0x54a188,_0xdb89c6){return client[_0x6d00('0xf')](_0x4fa0a4,_0x79ff29)[_0x6d00('0x10')](function(_0x272b30){logger[_0x6d00('0x11')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x6d00('0x12'));logger['debug'](_0x6d00('0x13'),_0x4458a8,_0x6d00('0x12'),JSON[_0x6d00('0x14')](_0x272b30));if(_0x272b30['error']){if(_0x272b30[_0x6d00('0x15')][_0x6d00('0x16')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x272b30['error']['message']);return _0xdb89c6(_0x272b30[_0x6d00('0x15')][_0x6d00('0x17')]);}logger[_0x6d00('0x15')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x272b30[_0x6d00('0x15')]['message']);return _0x54a188(_0x272b30[_0x6d00('0x15')][_0x6d00('0x17')]);}else{logger[_0x6d00('0x11')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x6d00('0x12'));_0x54a188(_0x272b30[_0x6d00('0x18')][_0x6d00('0x17')]);}})['catch'](function(_0x96351d){logger[_0x6d00('0x15')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x96351d);_0xdb89c6(_0x96351d);});});}exports['CreateSmsMessage']=function(_0x5c91f5){var _0x57498b=this;return new Promise(function(_0x2bb4ff,_0x17ea37){return db['SmsMessage'][_0x6d00('0x19')](_0x5c91f5[_0x6d00('0x1a')],{'raw':_0x5c91f5['options']?_0x5c91f5[_0x6d00('0x1b')][_0x6d00('0x1c')]===undefined?!![]:![]:!![]})[_0x6d00('0x10')](function(_0x2f462d){logger['info'](_0x6d00('0x1d'),_0x5c91f5);logger[_0x6d00('0x1e')]('CreateSmsMessage',_0x5c91f5,JSON['stringify'](_0x2f462d));_0x2bb4ff(_0x2f462d);})[_0x6d00('0x1f')](function(_0x1a32b7){logger[_0x6d00('0x15')]('CreateSmsMessage',_0x1a32b7[_0x6d00('0x17')],_0x5c91f5);_0x17ea37(_0x57498b['error'](0x1f4,_0x1a32b7[_0x6d00('0x17')]));});});}; \ No newline at end of file +var _0xa363=['./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xa363,0x9b));var _0x3a36=function(_0x6490c4,_0x2b2190){_0x6490c4=_0x6490c4-0x0;var _0x1cccdc=_0xa363[_0x6490c4];return _0x1cccdc;};'use strict';var _=require(_0x3a36('0x0'));var util=require(_0x3a36('0x1'));var moment=require(_0x3a36('0x2'));var BPromise=require(_0x3a36('0x3'));var rs=require(_0x3a36('0x4'));var fs=require('fs');var Redis=require(_0x3a36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a36('0x6'));var logger=require(_0x3a36('0x7'))('rpc');var config=require(_0x3a36('0x8'));var jayson=require(_0x3a36('0x9'));var client=jayson[_0x3a36('0xa')][_0x3a36('0xb')]({'port':0x232a});config[_0x3a36('0xc')]=_[_0x3a36('0xd')](config[_0x3a36('0xc')],{'host':_0x3a36('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a36('0xc')]));require(_0x3a36('0xf'))[_0x3a36('0x10')](socket);function respondWithRpcPromise(_0x1bfbe2,_0xc83a34,_0x530bfa){return new BPromise(function(_0x207819,_0x47dc48){return client[_0x3a36('0x11')](_0x1bfbe2,_0x530bfa)[_0x3a36('0x12')](function(_0x409a19){logger['info'](_0x3a36('0x13'),_0xc83a34,_0x3a36('0x14'));logger['debug'](_0x3a36('0x15'),_0xc83a34,'request\x20sent',JSON[_0x3a36('0x16')](_0x409a19));if(_0x409a19['error']){if(_0x409a19[_0x3a36('0x17')]['code']===0x1f4){logger[_0x3a36('0x17')](_0x3a36('0x13'),_0xc83a34,_0x409a19[_0x3a36('0x17')][_0x3a36('0x18')]);return _0x47dc48(_0x409a19[_0x3a36('0x17')][_0x3a36('0x18')]);}logger[_0x3a36('0x17')]('SmsMessage,\x20%s,\x20%s',_0xc83a34,_0x409a19[_0x3a36('0x17')][_0x3a36('0x18')]);return _0x207819(_0x409a19[_0x3a36('0x17')][_0x3a36('0x18')]);}else{logger['info'](_0x3a36('0x13'),_0xc83a34,_0x3a36('0x14'));_0x207819(_0x409a19[_0x3a36('0x19')]['message']);}})[_0x3a36('0x1a')](function(_0x4c7147){logger[_0x3a36('0x17')](_0x3a36('0x13'),_0xc83a34,_0x4c7147);_0x47dc48(_0x4c7147);});});}exports['CreateSmsMessage']=function(_0x35bcf7){var _0xb64771=this;return new Promise(function(_0x1cc933,_0x5e9f73){return db[_0x3a36('0x1b')][_0x3a36('0x1c')](_0x35bcf7[_0x3a36('0x1d')],{'raw':_0x35bcf7[_0x3a36('0x1e')]?_0x35bcf7[_0x3a36('0x1e')][_0x3a36('0x1f')]===undefined?!![]:![]:!![]})[_0x3a36('0x12')](function(_0x565a8e){logger['info'](_0x3a36('0x20'),_0x35bcf7);logger[_0x3a36('0x21')](_0x3a36('0x20'),_0x35bcf7,JSON['stringify'](_0x565a8e));_0x1cc933(_0x565a8e);})['catch'](function(_0x21a137){logger[_0x3a36('0x17')](_0x3a36('0x20'),_0x21a137[_0x3a36('0x18')],_0x35bcf7);_0x5e9f73(_0xb64771[_0x3a36('0x17')](0x1f4,_0x21a137[_0x3a36('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index afe028f..6e96643 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 _0x433b=['save','remove','update','emit','removeListener','length','./smsMessage.events'];(function(_0x405a51,_0x487278){var _0x395328=function(_0x19ffad){while(--_0x19ffad){_0x405a51['push'](_0x405a51['shift']());}};_0x395328(++_0x487278);}(_0x433b,0xc3));var _0xb433=function(_0x7c3553,_0x58020e){_0x7c3553=_0x7c3553-0x0;var _0x3d2fc5=_0x433b[_0x7c3553];return _0x3d2fc5;};'use strict';var SmsMessageEvents=require(_0xb433('0x0'));var events=[_0xb433('0x1'),_0xb433('0x2'),_0xb433('0x3')];function createListener(_0x44ff16,_0x412eb5){return function(_0x304dbb){_0x412eb5[_0xb433('0x4')](_0x44ff16,_0x304dbb);};}function removeListener(_0xaccdc6,_0x24a7eb){return function(){SmsMessageEvents[_0xb433('0x5')](_0xaccdc6,_0x24a7eb);};}exports['register']=function(_0x358835){for(var _0x2281b7=0x0,_0x537105=events[_0xb433('0x6')];_0x2281b7<_0x537105;_0x2281b7++){var _0x296a4c=events[_0x2281b7];var _0x511f54=createListener('smsMessage:'+_0x296a4c,_0x358835);SmsMessageEvents['on'](_0x296a4c,_0x511f54);}}; \ No newline at end of file +var _0xe244=['removeListener','register','length','smsMessage:','./smsMessage.events','save','remove','emit'];(function(_0x5ba3c1,_0x48983e){var _0x42d088=function(_0x1cd160){while(--_0x1cd160){_0x5ba3c1['push'](_0x5ba3c1['shift']());}};_0x42d088(++_0x48983e);}(_0xe244,0x1ec));var _0x4e24=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xe244[_0x5c351c];return _0x26f3b3;};'use strict';var SmsMessageEvents=require(_0x4e24('0x0'));var events=[_0x4e24('0x1'),_0x4e24('0x2'),'update'];function createListener(_0x4e1c19,_0x2de46d){return function(_0x1b83c3){_0x2de46d[_0x4e24('0x3')](_0x4e1c19,_0x1b83c3);};}function removeListener(_0x2a2875,_0x1f09b6){return function(){SmsMessageEvents[_0x4e24('0x4')](_0x2a2875,_0x1f09b6);};}exports[_0x4e24('0x5')]=function(_0x552ef2){for(var _0x17843f=0x0,_0x19240b=events[_0x4e24('0x6')];_0x17843f<_0x19240b;_0x17843f++){var _0x5bd8e1=events[_0x17843f];var _0x4a893c=createListener(_0x4e24('0x7')+_0x5bd8e1,_0x552ef2);SmsMessageEvents['on'](_0x5bd8e1,_0x4a893c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index d38fa45..5b7c431 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 _0xb550=['removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb550,0x9d));var _0x0b55=function(_0xcdd9bf,_0x2ff687){_0xcdd9bf=_0xcdd9bf-0x0;var _0x3bf701=_0xb550[_0xcdd9bf];return _0x3bf701;};'use strict';var multer=require('multer');var util=require(_0x0b55('0x0'));var path=require(_0x0b55('0x1'));var timeout=require(_0x0b55('0x2'));var express=require(_0x0b55('0x3'));var router=express['Router']();var fs_extra=require(_0x0b55('0x4'));var auth=require(_0x0b55('0x5'));var interaction=require(_0x0b55('0x6'));var config=require(_0x0b55('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x0b55('0x8')](),controller[_0x0b55('0x9')]);router['get'](_0x0b55('0xa'),auth[_0x0b55('0x8')](),controller[_0x0b55('0xb')]);router[_0x0b55('0xc')](_0x0b55('0xd'),auth['isAuthenticated'](),controller[_0x0b55('0xe')]);router[_0x0b55('0xc')](_0x0b55('0xf'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x10')]);router[_0x0b55('0xc')](_0x0b55('0x11'),auth['isAuthenticated'](),controller[_0x0b55('0x12')]);router[_0x0b55('0xc')](_0x0b55('0x13'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x14')]);router['post']('/',auth[_0x0b55('0x8')](),controller['create']);router[_0x0b55('0x15')]('/:id/teams',auth[_0x0b55('0x8')](),controller[_0x0b55('0x16')]);router[_0x0b55('0x15')](_0x0b55('0x13'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x17')]);router[_0x0b55('0x18')]('/:id',auth[_0x0b55('0x8')](),controller[_0x0b55('0x19')]);router[_0x0b55('0x1a')](_0x0b55('0xd'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x1b')]);router[_0x0b55('0x1a')](_0x0b55('0x11'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x1c')]);router['delete'](_0x0b55('0x13'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x1d')]);module[_0x0b55('0x1e')]=router; \ No newline at end of file +var _0x20c7=['post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id/members','getMembers','/:id/teams','/:id/users','getAgents'];(function(_0x489083,_0x2abcf1){var _0x3cd31b=function(_0x49705d){while(--_0x49705d){_0x489083['push'](_0x489083['shift']());}};_0x3cd31b(++_0x2abcf1);}(_0x20c7,0x183));var _0x720c=function(_0x5e7f18,_0x5c4411){_0x5e7f18=_0x5e7f18-0x0;var _0x41b0f6=_0x20c7[_0x5e7f18];return _0x41b0f6;};'use strict';var multer=require(_0x720c('0x0'));var util=require(_0x720c('0x1'));var path=require(_0x720c('0x2'));var timeout=require('connect-timeout');var express=require(_0x720c('0x3'));var router=express[_0x720c('0x4')]();var fs_extra=require(_0x720c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x720c('0x6'));var config=require(_0x720c('0x7'));var controller=require(_0x720c('0x8'));router[_0x720c('0x9')]('/',auth['isAuthenticated'](),controller[_0x720c('0xa')]);router[_0x720c('0x9')](_0x720c('0xb'),auth[_0x720c('0xc')](),controller[_0x720c('0xd')]);router[_0x720c('0x9')]('/:id',auth[_0x720c('0xc')](),controller['show']);router['get'](_0x720c('0xe'),auth['isAuthenticated'](),controller[_0x720c('0xf')]);router[_0x720c('0x9')](_0x720c('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0x720c('0x9')](_0x720c('0x11'),auth[_0x720c('0xc')](),controller[_0x720c('0x12')]);router[_0x720c('0x13')]('/',auth[_0x720c('0xc')](),controller[_0x720c('0x14')]);router[_0x720c('0x13')]('/:id/teams',auth[_0x720c('0xc')](),controller[_0x720c('0x15')]);router['post'](_0x720c('0x11'),auth[_0x720c('0xc')](),controller[_0x720c('0x16')]);router[_0x720c('0x17')](_0x720c('0x18'),auth['isAuthenticated'](),controller[_0x720c('0x19')]);router[_0x720c('0x1a')](_0x720c('0x18'),auth[_0x720c('0xc')](),controller[_0x720c('0x1b')]);router[_0x720c('0x1a')](_0x720c('0x10'),auth['isAuthenticated'](),controller[_0x720c('0x1c')]);router[_0x720c('0x1a')](_0x720c('0x11'),auth[_0x720c('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 4a8577b..aebec6e 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 _0x1892=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0xaf94e4,_0x278780){var _0x39bfa0=function(_0x23b23d){while(--_0x23b23d){_0xaf94e4['push'](_0xaf94e4['shift']());}};_0x39bfa0(++_0x278780);}(_0x1892,0x9d));var _0x2189=function(_0x111170,_0x12bcea){_0x111170=_0x111170-0x0;var _0x4c6bea=_0x1892[_0x111170];return _0x4c6bea;};'use strict';var Sequelize=require(_0x2189('0x0'));module[_0x2189('0x1')]={'name':{'type':Sequelize[_0x2189('0x2')],'unique':_0x2189('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2189('0x2')]},'timeout':{'type':Sequelize[_0x2189('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2189('0x5')](_0x2189('0x6'),_0x2189('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xdfcc=['ENUM','rrmemory','roundrobin','exports','STRING','name'];(function(_0x18c8b7,_0x2178e7){var _0x53b194=function(_0x4f1ab3){while(--_0x4f1ab3){_0x18c8b7['push'](_0x18c8b7['shift']());}};_0x53b194(++_0x2178e7);}(_0xdfcc,0x7b));var _0xcdfc=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xdfcc[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require('sequelize');module[_0xcdfc('0x0')]={'name':{'type':Sequelize[_0xcdfc('0x1')],'unique':_0xcdfc('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[_0xcdfc('0x3')](_0xcdfc('0x4'),'beepall',_0xcdfc('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2bb025c..5951544 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 _0xe0a8=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','map','SmsQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','role','SmsQueues','UserProfileSection','find'];(function(_0x1a9c07,_0x197774){var _0x43ab79=function(_0x4e6c6b){while(--_0x4e6c6b){_0x1a9c07['push'](_0x1a9c07['shift']());}};_0x43ab79(++_0x197774);}(_0xe0a8,0x161));var _0x8e0a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe0a8[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e0a('0x0'));var zipdir=require(_0x8e0a('0x1'));var jsonpatch=require(_0x8e0a('0x2'));var rp=require(_0x8e0a('0x3'));var moment=require(_0x8e0a('0x4'));var BPromise=require(_0x8e0a('0x5'));var Mustache=require(_0x8e0a('0x6'));var util=require(_0x8e0a('0x7'));var path=require(_0x8e0a('0x8'));var sox=require(_0x8e0a('0x9'));var csv=require('to-csv');var ejs=require(_0x8e0a('0xa'));var fs=require('fs');var fs_extra=require(_0x8e0a('0xb'));var _=require(_0x8e0a('0xc'));var squel=require('squel');var crypto=require(_0x8e0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e0a('0xe'));var toCsv=require(_0x8e0a('0xf'));var querystring=require(_0x8e0a('0x10'));var Papa=require(_0x8e0a('0x11'));var Redis=require(_0x8e0a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e0a('0x13'));var as=require(_0x8e0a('0x14'));var hardwareService=require(_0x8e0a('0x15'));var logger=require(_0x8e0a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8e0a('0x17'));var licenseUtil=require(_0x8e0a('0x18'));var db=require(_0x8e0a('0x19'))['db'];config[_0x8e0a('0x1a')]=_[_0x8e0a('0x1b')](config['redis'],{'host':_0x8e0a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8e0a('0x1d'))[_0x8e0a('0x1e')](socket);function respondWithStatusCode(_0x5a2df7,_0x481617){_0x481617=_0x481617||0xcc;return function(_0x4cc4f7){if(_0x4cc4f7){return _0x5a2df7[_0x8e0a('0x1f')](_0x481617);}return _0x5a2df7[_0x8e0a('0x20')](_0x481617)['end']();};}function respondWithResult(_0x5eb144,_0x38dd37){_0x38dd37=_0x38dd37||0xc8;return function(_0x635f4b){if(_0x635f4b){return _0x5eb144[_0x8e0a('0x20')](_0x38dd37)[_0x8e0a('0x21')](_0x635f4b);}};}function respondWithFilteredResult(_0x2b2007,_0x36aee7){return function(_0x5d1b00){if(_0x5d1b00){var _0x1c71ad=typeof _0x36aee7[_0x8e0a('0x22')]==='undefined'&&typeof _0x36aee7[_0x8e0a('0x23')]===_0x8e0a('0x24');var _0x190c13=_0x5d1b00[_0x8e0a('0x25')];var _0x339e3b=_0x1c71ad?0x0:_0x36aee7[_0x8e0a('0x22')];var _0x102415=_0x1c71ad?_0x5d1b00['count']:_0x36aee7[_0x8e0a('0x22')]+_0x36aee7[_0x8e0a('0x23')];var _0x4f2703;if(_0x102415>=_0x190c13){_0x102415=_0x190c13;_0x4f2703=0xc8;}else{_0x4f2703=0xce;}_0x2b2007['status'](_0x4f2703);return _0x2b2007['set']('Content-Range',_0x339e3b+'-'+_0x102415+'/'+_0x190c13)['json'](_0x5d1b00);}return null;};}function patchUpdates(_0x29625a){return function(_0x3c1527){try{jsonpatch[_0x8e0a('0x26')](_0x3c1527,_0x29625a,!![]);}catch(_0x3095b9){return BPromise[_0x8e0a('0x27')](_0x3095b9);}return _0x3c1527[_0x8e0a('0x28')]();};}function saveUpdates(_0x4a29c5,_0xcff72d){return function(_0x45edc4){if(_0x45edc4){return _0x45edc4[_0x8e0a('0x29')](_0x4a29c5)[_0x8e0a('0x2a')](function(_0x1feba5){return _0x1feba5;});}return null;};}function removeEntity(_0x418e19,_0x11895b){return function(_0x209518){if(_0x209518){return _0x209518['destroy']()[_0x8e0a('0x2a')](function(){var _0x43dad9=_0x209518[_0x8e0a('0x2b')]({'plain':!![]});var _0x22fcbe='SmsQueues';return db[_0x8e0a('0x2c')][_0x8e0a('0x2d')]({'where':{'type':_0x22fcbe,'resourceId':_0x43dad9['id']}})[_0x8e0a('0x2a')](function(){return _0x209518;});})[_0x8e0a('0x2a')](function(){_0x418e19[_0x8e0a('0x20')](0xcc)[_0x8e0a('0x2e')]();});}};}function handleEntityNotFound(_0x3e6b24,_0x554e24){return function(_0x2230f9){if(!_0x2230f9){_0x3e6b24[_0x8e0a('0x1f')](0x194);}return _0x2230f9;};}function handleError(_0x4b6c4c,_0x4d0d11){_0x4d0d11=_0x4d0d11||0x1f4;return function(_0x416eed){logger['error'](_0x416eed['stack']);if(_0x416eed[_0x8e0a('0x2f')]){delete _0x416eed[_0x8e0a('0x2f')];}_0x4b6c4c[_0x8e0a('0x20')](_0x4d0d11)['send'](_0x416eed);};}exports['index']=function(_0x2daa94,_0x26d7b2){var _0x4b8a9d={},_0x46d810={},_0x589005={'count':0x0,'rows':[]};var _0x2ce503=_[_0x8e0a('0x30')](db[_0x8e0a('0x31')][_0x8e0a('0x32')],function(_0x303a0c){return{'name':_0x303a0c['fieldName'],'type':_0x303a0c[_0x8e0a('0x33')][_0x8e0a('0x34')]};});_0x46d810['model']=_[_0x8e0a('0x30')](_0x2ce503,_0x8e0a('0x2f'));_0x46d810[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x2daa94[_0x8e0a('0x35')]);_0x46d810[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],_0x46d810[_0x8e0a('0x35')]);_0x4b8a9d[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x4b8a9d['attributes']=_0x4b8a9d[_0x8e0a('0x3a')][_0x8e0a('0x3c')]?_0x4b8a9d[_0x8e0a('0x3a')]:_0x46d810[_0x8e0a('0x39')];if(!_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3d')](_0x8e0a('0x3e'))){_0x4b8a9d[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x4b8a9d[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x2daa94['query'][_0x8e0a('0x22')]);}_0x4b8a9d[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x4b8a9d[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x2daa94['query'],_0x46d810[_0x8e0a('0x37')]),_0x2ce503);if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x4b8a9d[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x4b8a9d['where'],{'$or':_[_0x8e0a('0x30')](_0x2ce503,function(_0x35d4dc){if(_0x35d4dc[_0x8e0a('0x33')]!==_0x8e0a('0x45')){var _0x4d3749={};_0x4d3749[_0x35d4dc[_0x8e0a('0x2f')]]={'$like':'%'+_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x4d3749;}})});}_0x4b8a9d=_[_0x8e0a('0x44')]({},_0x4b8a9d,_0x2daa94[_0x8e0a('0x46')]);var _0x28a02e={'where':_0x4b8a9d['where']};return db[_0x8e0a('0x31')][_0x8e0a('0x25')](_0x28a02e)['then'](function(_0xb2a7c7){_0x589005[_0x8e0a('0x25')]=_0xb2a7c7;if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x4b8a9d['include']=[{'all':!![]}];}return db[_0x8e0a('0x31')][_0x8e0a('0x48')](_0x4b8a9d);})[_0x8e0a('0x2a')](function(_0x4c6ef0){_0x589005[_0x8e0a('0x49')]=_0x4c6ef0;return _0x589005;})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x26d7b2,_0x4b8a9d))[_0x8e0a('0x4a')](handleError(_0x26d7b2,null));};exports[_0x8e0a('0x4b')]=function(_0x51bf04,_0x4431c9){var _0x2f2d86={'raw':!![],'where':{'id':_0x51bf04[_0x8e0a('0x4c')]['id']}},_0xaa831a={};_0xaa831a[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x31')][_0x8e0a('0x32')]);_0xaa831a[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x51bf04[_0x8e0a('0x35')]);_0xaa831a[_0x8e0a('0x37')]=_['intersection'](_0xaa831a['model'],_0xaa831a[_0x8e0a('0x35')]);_0x2f2d86[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0xaa831a[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x51bf04['query']['fields']));_0x2f2d86['attributes']=_0x2f2d86[_0x8e0a('0x3a')]['length']?_0x2f2d86['attributes']:_0xaa831a['model'];if(_0x51bf04[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x2f2d86[_0x8e0a('0x4d')]=[{'all':!![]}];}_0x2f2d86=_['merge']({},_0x2f2d86,_0x51bf04[_0x8e0a('0x46')]);return db[_0x8e0a('0x31')]['find'](_0x2f2d86)[_0x8e0a('0x2a')](handleEntityNotFound(_0x4431c9,null))[_0x8e0a('0x2a')](respondWithResult(_0x4431c9,null))[_0x8e0a('0x4a')](handleError(_0x4431c9,null));};exports[_0x8e0a('0x4e')]=function(_0xe37838,_0x1674b8){return db['SmsQueue'][_0x8e0a('0x4e')](_0xe37838[_0x8e0a('0x4f')],{})[_0x8e0a('0x2a')](function(_0x704770){var _0x55795b=_0xe37838[_0x8e0a('0x50')]['get']({'plain':!![]});if(!_0x55795b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55795b[_0x8e0a('0x51')]==='user'){var _0x6ba9d0=_0x704770[_0x8e0a('0x2b')]({'plain':!![]});var _0x92d311=_0x8e0a('0x52');return db[_0x8e0a('0x53')][_0x8e0a('0x54')]({'where':{'name':_0x92d311,'userProfileId':_0x55795b[_0x8e0a('0x55')]},'raw':!![]})[_0x8e0a('0x2a')](function(_0x51c8d3){if(_0x51c8d3&&_0x51c8d3[_0x8e0a('0x56')]===0x0){return db[_0x8e0a('0x2c')][_0x8e0a('0x4e')]({'name':_0x6ba9d0['name'],'resourceId':_0x6ba9d0['id'],'type':_0x51c8d3['name'],'sectionId':_0x51c8d3['id']},{})[_0x8e0a('0x2a')](function(){return _0x704770;});}else{return _0x704770;}})[_0x8e0a('0x4a')](function(_0x11abef){logger[_0x8e0a('0x57')](_0x8e0a('0x58'),_0x11abef);throw _0x11abef;});}return _0x704770;})[_0x8e0a('0x2a')](respondWithResult(_0x1674b8,0xc9))[_0x8e0a('0x4a')](handleError(_0x1674b8,null));};exports['update']=function(_0x3f3b46,_0x1f6930){if(_0x3f3b46[_0x8e0a('0x4f')]['id']){delete _0x3f3b46['body']['id'];}return db[_0x8e0a('0x31')]['find']({'where':{'id':_0x3f3b46[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1f6930,null))[_0x8e0a('0x2a')](saveUpdates(_0x3f3b46['body'],null))[_0x8e0a('0x2a')](respondWithResult(_0x1f6930,null))[_0x8e0a('0x4a')](handleError(_0x1f6930,null));};exports[_0x8e0a('0x2d')]=function(_0x8d34a3,_0x1d6a58){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x8d34a3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1d6a58,null))[_0x8e0a('0x2a')](removeEntity(_0x1d6a58,null))[_0x8e0a('0x4a')](handleError(_0x1d6a58,null));};exports['describe']=function(_0x1362ce,_0x5e775d){return db['SmsQueue'][_0x8e0a('0x59')]()['then'](respondWithResult(_0x5e775d,null))[_0x8e0a('0x4a')](handleError(_0x5e775d,null));};exports[_0x8e0a('0x5a')]=function(_0x1e4446,_0x350538,_0x28e868){var _0x46ce59={'raw':!![],'where':{}},_0x4549eb={},_0x56e466;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x1e4446[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x350538,null))['then'](function(_0x52f10d){if(_0x52f10d){_0x56e466=_0x52f10d['get']({'plain':!![]});_0x4549eb['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5c')][_0x8e0a('0x32')]);_0x4549eb['query']=_['keys'](_0x1e4446[_0x8e0a('0x35')]);_0x4549eb[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x4549eb[_0x8e0a('0x39')],_0x4549eb[_0x8e0a('0x35')]);_0x46ce59[_0x8e0a('0x3a')]=_['intersection'](_0x4549eb[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x1e4446['query'][_0x8e0a('0x3b')]));_0x46ce59[_0x8e0a('0x3a')]=_0x46ce59['attributes'][_0x8e0a('0x3c')]?_0x46ce59[_0x8e0a('0x3a')]:_0x4549eb[_0x8e0a('0x39')];if(!_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x3d')]('nolimit')){_0x46ce59[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x46ce59[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x1e4446['query'][_0x8e0a('0x22')]);}_0x46ce59[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x46ce59[_0x8e0a('0x41')]=qs[_0x8e0a('0x37')](_[_0x8e0a('0x42')](_0x1e4446[_0x8e0a('0x35')],_0x4549eb[_0x8e0a('0x37')]));_0x46ce59[_0x8e0a('0x41')][_0x8e0a('0x5d')]=_0x52f10d['id'];if(_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x46ce59[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x46ce59[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x46ce59['attributes'],function(_0x4f2b51){var _0x50bbc0={};_0x50bbc0[_0x4f2b51]={'$like':'%'+_0x1e4446['query'][_0x8e0a('0x43')]+'%'};return _0x50bbc0;})});}_0x46ce59=_[_0x8e0a('0x44')]({},_0x46ce59,_0x1e4446[_0x8e0a('0x46')]);return db[_0x8e0a('0x5c')]['findAll'](_0x46ce59);}})[_0x8e0a('0x2a')](function(_0x5de647){if(_0x5de647){return db[_0x8e0a('0x5e')][_0x8e0a('0x5f')]({'where':{'id':_[_0x8e0a('0x30')](_0x5de647,'UserId'),'role':_0x8e0a('0x60')},'attributes':['id',_0x8e0a('0x2f'),_0x8e0a('0x61'),_0x8e0a('0x62'),'createdAt']});}})[_0x8e0a('0x2a')](function(_0x2e775d){if(_0x2e775d){return{'count':_0x2e775d[_0x8e0a('0x25')],'rows':_['map'](_0x2e775d['rows'],function(_0x1cb48e){return{'membername':_0x1cb48e[_0x8e0a('0x2f')],'UserId':_0x1cb48e['id'],'queue_name':_0x56e466[_0x8e0a('0x2f')],'SmsQueueId':_0x56e466['id'],'interface':util[_0x8e0a('0x63')](_0x8e0a('0x64'),'SIP',_0x1cb48e[_0x8e0a('0x2f')]),'penalty':0x0,'paused':_0x1cb48e[_0x8e0a('0x61')],'createdAt':_0x1cb48e[_0x8e0a('0x65')],'updatedAt':_0x1cb48e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x350538,_0x46ce59))[_0x8e0a('0x4a')](handleError(_0x350538,null));};exports[_0x8e0a('0x66')]=function(_0x223e25,_0x6b5d90,_0x4ca2ad){var _0x2d1a2a={};var _0x200912={};var _0x56d3c1;var _0x2981dc;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x223e25['params']['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x6b5d90,null))[_0x8e0a('0x2a')](function(_0x7e3227){if(_0x7e3227){_0x56d3c1=_0x7e3227;_0x200912[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x67')][_0x8e0a('0x32')]);_0x200912[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x223e25[_0x8e0a('0x35')]);_0x200912['filters']=_[_0x8e0a('0x38')](_0x200912['model'],_0x200912[_0x8e0a('0x35')]);_0x2d1a2a[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x200912[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x223e25[_0x8e0a('0x35')]['fields']));_0x2d1a2a['attributes']=_0x2d1a2a['attributes']['length']?_0x2d1a2a[_0x8e0a('0x3a')]:_0x200912['model'];_0x2d1a2a[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x223e25['query'][_0x8e0a('0x40')]);_0x2d1a2a[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x223e25[_0x8e0a('0x35')],_0x200912['filters']));if(_0x223e25[_0x8e0a('0x35')]['filter']){_0x2d1a2a[_0x8e0a('0x41')]=_['merge'](_0x2d1a2a['where'],{'$or':_['map'](_0x2d1a2a[_0x8e0a('0x3a')],function(_0x549b56){var _0xf0ffd2={};_0xf0ffd2[_0x549b56]={'$like':'%'+_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0xf0ffd2;})});}_0x2d1a2a=_['merge']({},_0x2d1a2a,_0x223e25[_0x8e0a('0x46')]);return _0x56d3c1[_0x8e0a('0x66')](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x4b75d1){if(_0x4b75d1){_0x2981dc=_0x4b75d1[_0x8e0a('0x3c')];if(!_0x223e25[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x2d1a2a[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x223e25[_0x8e0a('0x35')]['limit']);_0x2d1a2a[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x56d3c1['getTeams'](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x5eb7f7){if(_0x5eb7f7){return _0x5eb7f7?{'count':_0x2981dc,'rows':_0x5eb7f7}:null;}})['then'](respondWithResult(_0x6b5d90,null))[_0x8e0a('0x4a')](handleError(_0x6b5d90,null));};exports[_0x8e0a('0x68')]=function(_0x1e0c64,_0x828ce4,_0x3e4fb4){var _0x54d1a6=_0x1e0c64[_0x8e0a('0x4f')][_0x8e0a('0x69')];return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x54d1a6},'attributes':['id'],'include':[{'model':db[_0x8e0a('0x5e')],'as':_0x8e0a('0x6a'),'attributes':['id','name',_0x8e0a('0x6b'),_0x8e0a('0x6c'),_0x8e0a('0x6d')],'raw':!![]}]})['then'](function(_0x259f66){if(_0x259f66){var _0x25da85=_[_0x8e0a('0x6e')](_0x259f66,function(_0x1682dc){var _0x756692=_0x1682dc[_0x8e0a('0x2b')]({'plain':!![]});return _0x756692['Agents'];});return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x1e0c64[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](function(_0x544fe5){return db[_0x8e0a('0x6f')][_0x8e0a('0x70')](function(_0x35ecad){return _0x544fe5[_0x8e0a('0x68')](_0x54d1a6,{'transaction':_0x35ecad})[_0x8e0a('0x2a')](function(){return BPromise[_0x8e0a('0x71')](_0x25da85,function(_0xeb6faa){return db['UserSmsQueue'][_0x8e0a('0x72')]({'where':{'UserId':_0xeb6faa['id'],'SmsQueueId':_0x1e0c64['params']['id']},'transaction':_0x35ecad});});})[_0x8e0a('0x2a')](function(){_0x25da85[_0x8e0a('0x73')](function(_0x870906){socket[_0x8e0a('0x74')]('userSmsQueue:save',{'UserId':_0x870906['id'],'SmsQueueId':_0x544fe5['id']});});});});});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x828ce4,null))[_0x8e0a('0x4a')](handleError(_0x828ce4,null));};exports['removeTeams']=function(_0x751214,_0x268ed2,_0x3ad0bf){return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x751214[_0x8e0a('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8e0a('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x8e0a('0x2a')](handleEntityNotFound(_0x268ed2,null))[_0x8e0a('0x2a')](function(_0x282e79){var _0x264c7a=_['map'](_0x282e79,'id');var _0x465cdc=[];var _0x432efa=[];var _0x2d2ca5=squel[_0x8e0a('0x75')]();_0x2d2ca5[_0x8e0a('0x76')](_0x8e0a('0x77'))[_0x8e0a('0x78')](_0x8e0a('0x79'),'tq')[_0x8e0a('0x7a')](_0x8e0a('0x7b'),'ut',_0x8e0a('0x7c'))[_0x8e0a('0x41')](_0x8e0a('0x7d'),_0x751214[_0x8e0a('0x4c')]['id']);for(var _0x15a792=0x0;_0x15a792<_0x282e79[_0x8e0a('0x3c')];_0x15a792+=0x1){let _0x3e7d30=_0x282e79[_0x15a792];for(var _0x20566c=0x0;_0x20566c<_0x3e7d30[_0x8e0a('0x6a')][_0x8e0a('0x3c')];_0x20566c+=0x1){let _0x1cc944=_0x3e7d30[_0x8e0a('0x6a')][_0x20566c];var _0x43df3c=_0x2d2ca5[_0x8e0a('0x7e')]();_0x43df3c['where']('ut.UserId\x20=\x20?',_0x1cc944['id']);_0x432efa[_0x8e0a('0x7f')](db['sequelize'][_0x8e0a('0x35')](_0x43df3c[_0x8e0a('0x80')](),{'type':db[_0x8e0a('0x6f')]['QueryTypes'][_0x8e0a('0x81')]})[_0x8e0a('0x2a')](function(_0x50c855){if(_0x50c855[_0x8e0a('0x3c')]===0x1){return _0x1cc944['id'];}else{var _0x52775a=_[_0x8e0a('0x82')](_['map'](_0x50c855,_0x8e0a('0x83')),function(_0x4131e1){return _[_0x8e0a('0x84')](_0x264c7a,_0x4131e1);});if(_0x52775a){return _0x1cc944['id'];}}}));}}return BPromise['all'](_0x432efa)['then'](function(_0x3c5639){_0x465cdc=_(_0x465cdc)[_0x8e0a('0x85')](_0x3c5639)[_0x8e0a('0x86')]()[_0x8e0a('0x87')]();return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x751214[_0x8e0a('0x4c')]['id']}})['then'](function(_0x1ee98e){return db['sequelize'][_0x8e0a('0x70')](function(_0x3beb00){return _0x1ee98e[_0x8e0a('0x88')](_0x751214[_0x8e0a('0x35')][_0x8e0a('0x69')],{'transaction':_0x3beb00})['then'](function(){if(!_[_0x8e0a('0x89')](_0x465cdc)){return _0x1ee98e['removeAgents'](_0x465cdc,{'transaction':_0x3beb00});}})[_0x8e0a('0x2a')](function(){_0x465cdc[_0x8e0a('0x73')](function(_0x4863bd){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':_0x4863bd,'SmsQueueId':_0x1ee98e['id']});});});});});});})[_0x8e0a('0x2a')](respondWithStatusCode(_0x268ed2,null))[_0x8e0a('0x4a')](handleError(_0x268ed2,null));};exports[_0x8e0a('0x8b')]=function(_0x5f05e3,_0x8498f7,_0x451d23){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x5f05e3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x8498f7,null))['then'](function(_0x4ed2c5){if(_0x4ed2c5){return _0x4ed2c5['addAgents'](_0x5f05e3[_0x8e0a('0x4f')]['ids'],_[_0x8e0a('0x8c')](_0x5f05e3['body'],[_0x8e0a('0x69'),'id'])||{})[_0x8e0a('0x8d')](function(_0x15037a){for(var _0x5af85f=0x0;_0x5af85f<_0x5f05e3['body'][_0x8e0a('0x69')]['length'];_0x5af85f+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8e'),{'UserId':Number(_0x5f05e3[_0x8e0a('0x4f')]['ids'][_0x5af85f]),'SmsQueueId':Number(_0x5f05e3[_0x8e0a('0x4c')]['id'])});}return _0x15037a;});}})[_0x8e0a('0x2a')](respondWithResult(_0x8498f7,null))['catch'](handleError(_0x8498f7,null));};exports[_0x8e0a('0x8f')]=function(_0xecff65,_0x4b274b,_0x440f6d){return db['SmsQueue']['find']({'where':{'id':_0xecff65[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x4b274b,null))['then'](function(_0x2ea517){if(_0x2ea517){return _0x2ea517['removeAgents'](_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')])[_0x8e0a('0x2a')](function(){if(_[_0x8e0a('0x90')](_0xecff65['query'][_0x8e0a('0x69')])){for(var _0xb25ec=0x0;_0xb25ec<_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0x8e0a('0x3c')];_0xb25ec+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0xb25ec]),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}}else{socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65['query']['ids']),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x4b274b,null))[_0x8e0a('0x4a')](handleError(_0x4b274b,null));};exports[_0x8e0a('0x91')]=function(_0x12ca1b,_0x1763a2,_0x489d4f){var _0x261eef={};var _0x542f84={};var _0x152155;var _0x8842;return db[_0x8e0a('0x31')]['findOne']({'where':{'id':_0x12ca1b[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1763a2,null))[_0x8e0a('0x2a')](function(_0x20bd26){if(_0x20bd26){_0x152155=_0x20bd26;_0x542f84['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5e')][_0x8e0a('0x32')]);_0x542f84[_0x8e0a('0x35')]=_['keys'](_0x12ca1b['query']);_0x542f84[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x542f84[_0x8e0a('0x39')],_0x542f84['query']);_0x261eef[_0x8e0a('0x3a')]=_['intersection'](_0x542f84[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x261eef[_0x8e0a('0x3a')]=_0x261eef['attributes']['length']?_0x261eef[_0x8e0a('0x3a')]:_0x542f84[_0x8e0a('0x39')];_0x261eef[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x12ca1b['query'][_0x8e0a('0x40')]);_0x261eef[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x12ca1b[_0x8e0a('0x35')],_0x542f84[_0x8e0a('0x37')]));if(_0x12ca1b[_0x8e0a('0x35')]['filter']){_0x261eef[_0x8e0a('0x41')]=_['merge'](_0x261eef[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x261eef[_0x8e0a('0x3a')],function(_0x580caa){var _0x10927c={};_0x10927c[_0x580caa]={'$like':'%'+_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x10927c;})});}_0x261eef=_['merge']({},_0x261eef,_0x12ca1b[_0x8e0a('0x46')]);return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0x47065a){if(_0x47065a){_0x8842=_0x47065a[_0x8e0a('0x3c')];if(!_0x12ca1b[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x261eef[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x261eef[_0x8e0a('0x22')]=qs['offset'](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0xa6bf8c){if(_0xa6bf8c){return _0xa6bf8c?{'count':_0x8842,'rows':_0xa6bf8c}:null;}})[_0x8e0a('0x2a')](respondWithResult(_0x1763a2,null))[_0x8e0a('0x4a')](handleError(_0x1763a2,null));}; \ No newline at end of file +var _0x840f=['UserProfileResource','describe','findOne','UserSmsQueue','length','pick','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','select','field','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','transaction','removeTeams','isEmpty','removeAgents','addAgents','omit','userSmsQueue:save','userSmsQueue:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','save','update','then','destroy','get','SmsQueues','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId'];(function(_0x4526cf,_0x31e7d5){var _0x210a01=function(_0x168515){while(--_0x168515){_0x4526cf['push'](_0x4526cf['shift']());}};_0x210a01(++_0x31e7d5);}(_0x840f,0xb5));var _0xf840=function(_0x500aa7,_0x350ad6){_0x500aa7=_0x500aa7-0x0;var _0x5aca36=_0x840f[_0x500aa7];return _0x5aca36;};'use strict';var emlformat=require(_0xf840('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf840('0x1'));var rp=require('request-promise');var moment=require(_0xf840('0x2'));var BPromise=require(_0xf840('0x3'));var Mustache=require(_0xf840('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf840('0x5'));var csv=require(_0xf840('0x6'));var ejs=require(_0xf840('0x7'));var fs=require('fs');var fs_extra=require(_0xf840('0x8'));var _=require(_0xf840('0x9'));var squel=require('squel');var crypto=require(_0xf840('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf840('0xb'));var toCsv=require(_0xf840('0x6'));var querystring=require(_0xf840('0xc'));var Papa=require(_0xf840('0xd'));var Redis=require(_0xf840('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf840('0xf'));var utils=require(_0xf840('0x10'));var config=require(_0xf840('0x11'));var licenseUtil=require(_0xf840('0x12'));var db=require(_0xf840('0x13'))['db'];config['redis']=_[_0xf840('0x14')](config[_0xf840('0x15')],{'host':_0xf840('0x16'),'port':0x18eb});var socket=require(_0xf840('0x17'))(new Redis(config[_0xf840('0x15')]));require('./smsQueue.socket')[_0xf840('0x18')](socket);function respondWithStatusCode(_0xe9aaf2,_0x31e211){_0x31e211=_0x31e211||0xcc;return function(_0x3166ce){if(_0x3166ce){return _0xe9aaf2[_0xf840('0x19')](_0x31e211);}return _0xe9aaf2[_0xf840('0x1a')](_0x31e211)[_0xf840('0x1b')]();};}function respondWithResult(_0x57a0a0,_0x1a71c3){_0x1a71c3=_0x1a71c3||0xc8;return function(_0xf434f5){if(_0xf434f5){return _0x57a0a0['status'](_0x1a71c3)['json'](_0xf434f5);}};}function respondWithFilteredResult(_0x20cdb7,_0x55744d){return function(_0x3922f7){if(_0x3922f7){var _0x32b2df=typeof _0x55744d[_0xf840('0x1c')]===_0xf840('0x1d')&&typeof _0x55744d[_0xf840('0x1e')]===_0xf840('0x1d');var _0x25001a=_0x3922f7[_0xf840('0x1f')];var _0x1a2fc7=_0x32b2df?0x0:_0x55744d['offset'];var _0x27a8b1=_0x32b2df?_0x3922f7['count']:_0x55744d[_0xf840('0x1c')]+_0x55744d[_0xf840('0x1e')];var _0x144e5c;if(_0x27a8b1>=_0x25001a){_0x27a8b1=_0x25001a;_0x144e5c=0xc8;}else{_0x144e5c=0xce;}_0x20cdb7[_0xf840('0x1a')](_0x144e5c);return _0x20cdb7['set'](_0xf840('0x20'),_0x1a2fc7+'-'+_0x27a8b1+'/'+_0x25001a)[_0xf840('0x21')](_0x3922f7);}return null;};}function patchUpdates(_0x310e59){return function(_0xd19a80){try{jsonpatch['apply'](_0xd19a80,_0x310e59,!![]);}catch(_0x4932f4){return BPromise['reject'](_0x4932f4);}return _0xd19a80[_0xf840('0x22')]();};}function saveUpdates(_0x5be433,_0x1c9d31){return function(_0x4d4a8b){if(_0x4d4a8b){return _0x4d4a8b[_0xf840('0x23')](_0x5be433)[_0xf840('0x24')](function(_0x67d2b1){return _0x67d2b1;});}return null;};}function removeEntity(_0x4659a4,_0x252fc7){return function(_0x5ac473){if(_0x5ac473){return _0x5ac473[_0xf840('0x25')]()[_0xf840('0x24')](function(){var _0x3c870f=_0x5ac473[_0xf840('0x26')]({'plain':!![]});var _0x58dfcf=_0xf840('0x27');return db['UserProfileResource'][_0xf840('0x25')]({'where':{'type':_0x58dfcf,'resourceId':_0x3c870f['id']}})[_0xf840('0x24')](function(){return _0x5ac473;});})[_0xf840('0x24')](function(){_0x4659a4[_0xf840('0x1a')](0xcc)[_0xf840('0x1b')]();});}};}function handleEntityNotFound(_0x1eb5df,_0x20484e){return function(_0x4b6a6c){if(!_0x4b6a6c){_0x1eb5df[_0xf840('0x19')](0x194);}return _0x4b6a6c;};}function handleError(_0x15c1ea,_0x1a68a6){_0x1a68a6=_0x1a68a6||0x1f4;return function(_0x398b56){logger[_0xf840('0x28')](_0x398b56[_0xf840('0x29')]);if(_0x398b56[_0xf840('0x2a')]){delete _0x398b56[_0xf840('0x2a')];}_0x15c1ea[_0xf840('0x1a')](_0x1a68a6)['send'](_0x398b56);};}exports[_0xf840('0x2b')]=function(_0x20d13d,_0x47f7e7){var _0x2a000a={},_0x3b73ba={},_0x2456c8={'count':0x0,'rows':[]};var _0x1af738=_[_0xf840('0x2c')](db[_0xf840('0x2d')][_0xf840('0x2e')],function(_0x2ed26a){return{'name':_0x2ed26a[_0xf840('0x2f')],'type':_0x2ed26a[_0xf840('0x30')][_0xf840('0x31')]};});_0x3b73ba['model']=_[_0xf840('0x2c')](_0x1af738,_0xf840('0x2a'));_0x3b73ba[_0xf840('0x32')]=_[_0xf840('0x33')](_0x20d13d[_0xf840('0x32')]);_0x3b73ba['filters']=_['intersection'](_0x3b73ba['model'],_0x3b73ba['query']);_0x2a000a[_0xf840('0x34')]=_[_0xf840('0x35')](_0x3b73ba[_0xf840('0x36')],qs[_0xf840('0x37')](_0x20d13d[_0xf840('0x32')]['fields']));_0x2a000a[_0xf840('0x34')]=_0x2a000a[_0xf840('0x34')]['length']?_0x2a000a[_0xf840('0x34')]:_0x3b73ba[_0xf840('0x36')];if(!_0x20d13d[_0xf840('0x32')][_0xf840('0x38')](_0xf840('0x39'))){_0x2a000a['limit']=qs[_0xf840('0x1e')](_0x20d13d['query'][_0xf840('0x1e')]);_0x2a000a[_0xf840('0x1c')]=qs['offset'](_0x20d13d['query'][_0xf840('0x1c')]);}_0x2a000a[_0xf840('0x3a')]=qs[_0xf840('0x3b')](_0x20d13d[_0xf840('0x32')]['sort']);_0x2a000a[_0xf840('0x3c')]=qs[_0xf840('0x3d')](_['pick'](_0x20d13d[_0xf840('0x32')],_0x3b73ba[_0xf840('0x3d')]),_0x1af738);if(_0x20d13d[_0xf840('0x32')][_0xf840('0x3e')]){_0x2a000a['where']=_[_0xf840('0x3f')](_0x2a000a['where'],{'$or':_['map'](_0x1af738,function(_0x3e08b8){if(_0x3e08b8[_0xf840('0x30')]!=='VIRTUAL'){var _0xad9c31={};_0xad9c31[_0x3e08b8[_0xf840('0x2a')]]={'$like':'%'+_0x20d13d[_0xf840('0x32')]['filter']+'%'};return _0xad9c31;}})});}_0x2a000a=_['merge']({},_0x2a000a,_0x20d13d[_0xf840('0x40')]);var _0x4d4311={'where':_0x2a000a[_0xf840('0x3c')]};return db[_0xf840('0x2d')][_0xf840('0x1f')](_0x4d4311)[_0xf840('0x24')](function(_0x15fdc5){_0x2456c8['count']=_0x15fdc5;if(_0x20d13d['query']['includeAll']){_0x2a000a[_0xf840('0x41')]=[{'all':!![]}];}return db[_0xf840('0x2d')][_0xf840('0x42')](_0x2a000a);})['then'](function(_0x257918){_0x2456c8[_0xf840('0x43')]=_0x257918;return _0x2456c8;})[_0xf840('0x24')](respondWithFilteredResult(_0x47f7e7,_0x2a000a))[_0xf840('0x44')](handleError(_0x47f7e7,null));};exports[_0xf840('0x45')]=function(_0x16e765,_0x3aba0f){var _0x48620c={'raw':!![],'where':{'id':_0x16e765[_0xf840('0x46')]['id']}},_0x284ebf={};_0x284ebf[_0xf840('0x36')]=_[_0xf840('0x33')](db[_0xf840('0x2d')][_0xf840('0x2e')]);_0x284ebf[_0xf840('0x32')]=_[_0xf840('0x33')](_0x16e765[_0xf840('0x32')]);_0x284ebf[_0xf840('0x3d')]=_[_0xf840('0x35')](_0x284ebf[_0xf840('0x36')],_0x284ebf[_0xf840('0x32')]);_0x48620c[_0xf840('0x34')]=_[_0xf840('0x35')](_0x284ebf[_0xf840('0x36')],qs[_0xf840('0x37')](_0x16e765[_0xf840('0x32')]['fields']));_0x48620c[_0xf840('0x34')]=_0x48620c['attributes']['length']?_0x48620c[_0xf840('0x34')]:_0x284ebf[_0xf840('0x36')];if(_0x16e765[_0xf840('0x32')][_0xf840('0x47')]){_0x48620c['include']=[{'all':!![]}];}_0x48620c=_[_0xf840('0x3f')]({},_0x48620c,_0x16e765[_0xf840('0x40')]);return db['SmsQueue'][_0xf840('0x48')](_0x48620c)[_0xf840('0x24')](handleEntityNotFound(_0x3aba0f,null))['then'](respondWithResult(_0x3aba0f,null))[_0xf840('0x44')](handleError(_0x3aba0f,null));};exports[_0xf840('0x49')]=function(_0x104753,_0x46d274){return db['SmsQueue'][_0xf840('0x49')](_0x104753[_0xf840('0x4a')],{})[_0xf840('0x24')](function(_0x3b8ada){var _0x2a6757=_0x104753['user'][_0xf840('0x26')]({'plain':!![]});if(!_0x2a6757)throw new Error(_0xf840('0x4b'));if(_0x2a6757['role']===_0xf840('0x4c')){var _0x269d83=_0x3b8ada[_0xf840('0x26')]({'plain':!![]});var _0x1e72be=_0xf840('0x27');return db[_0xf840('0x4d')][_0xf840('0x48')]({'where':{'name':_0x1e72be,'userProfileId':_0x2a6757[_0xf840('0x4e')]},'raw':!![]})['then'](function(_0x156097){if(_0x156097&&_0x156097['autoAssociation']===0x0){return db[_0xf840('0x4f')]['create']({'name':_0x269d83[_0xf840('0x2a')],'resourceId':_0x269d83['id'],'type':_0x156097[_0xf840('0x2a')],'sectionId':_0x156097['id']},{})[_0xf840('0x24')](function(){return _0x3b8ada;});}else{return _0x3b8ada;}})[_0xf840('0x44')](function(_0x336769){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x336769);throw _0x336769;});}return _0x3b8ada;})[_0xf840('0x24')](respondWithResult(_0x46d274,0xc9))[_0xf840('0x44')](handleError(_0x46d274,null));};exports['update']=function(_0x5d9fe9,_0x1f7102){if(_0x5d9fe9[_0xf840('0x4a')]['id']){delete _0x5d9fe9[_0xf840('0x4a')]['id'];}return db[_0xf840('0x2d')][_0xf840('0x48')]({'where':{'id':_0x5d9fe9[_0xf840('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f7102,null))[_0xf840('0x24')](saveUpdates(_0x5d9fe9['body'],null))[_0xf840('0x24')](respondWithResult(_0x1f7102,null))['catch'](handleError(_0x1f7102,null));};exports[_0xf840('0x25')]=function(_0x586cb1,_0x5a2379){return db[_0xf840('0x2d')]['find']({'where':{'id':_0x586cb1[_0xf840('0x46')]['id']}})[_0xf840('0x24')](handleEntityNotFound(_0x5a2379,null))[_0xf840('0x24')](removeEntity(_0x5a2379,null))[_0xf840('0x44')](handleError(_0x5a2379,null));};exports['describe']=function(_0x4cf2ab,_0x3a6e4a){return db[_0xf840('0x2d')][_0xf840('0x50')]()['then'](respondWithResult(_0x3a6e4a,null))['catch'](handleError(_0x3a6e4a,null));};exports['getMembers']=function(_0x322e1d,_0x2fc0dc,_0x1132d8){var _0x44096b={'raw':!![],'where':{}},_0x441f99={},_0x51b1aa;return db[_0xf840('0x2d')][_0xf840('0x51')]({'where':{'id':_0x322e1d[_0xf840('0x46')]['id']}})[_0xf840('0x24')](handleEntityNotFound(_0x2fc0dc,null))[_0xf840('0x24')](function(_0x9a9548){if(_0x9a9548){_0x51b1aa=_0x9a9548['get']({'plain':!![]});_0x441f99[_0xf840('0x36')]=_[_0xf840('0x33')](db[_0xf840('0x52')][_0xf840('0x2e')]);_0x441f99[_0xf840('0x32')]=_[_0xf840('0x33')](_0x322e1d['query']);_0x441f99[_0xf840('0x3d')]=_['intersection'](_0x441f99['model'],_0x441f99[_0xf840('0x32')]);_0x44096b['attributes']=_['intersection'](_0x441f99['model'],qs['fields'](_0x322e1d[_0xf840('0x32')][_0xf840('0x37')]));_0x44096b[_0xf840('0x34')]=_0x44096b['attributes'][_0xf840('0x53')]?_0x44096b[_0xf840('0x34')]:_0x441f99[_0xf840('0x36')];if(!_0x322e1d[_0xf840('0x32')]['hasOwnProperty'](_0xf840('0x39'))){_0x44096b['limit']=qs['limit'](_0x322e1d[_0xf840('0x32')][_0xf840('0x1e')]);_0x44096b[_0xf840('0x1c')]=qs[_0xf840('0x1c')](_0x322e1d['query'][_0xf840('0x1c')]);}_0x44096b[_0xf840('0x3a')]=qs[_0xf840('0x3b')](_0x322e1d[_0xf840('0x32')][_0xf840('0x3b')]);_0x44096b[_0xf840('0x3c')]=qs[_0xf840('0x3d')](_[_0xf840('0x54')](_0x322e1d['query'],_0x441f99[_0xf840('0x3d')]));_0x44096b[_0xf840('0x3c')][_0xf840('0x55')]=_0x9a9548['id'];if(_0x322e1d['query'][_0xf840('0x3e')]){_0x44096b[_0xf840('0x3c')]=_[_0xf840('0x3f')](_0x44096b[_0xf840('0x3c')],{'$or':_[_0xf840('0x2c')](_0x44096b[_0xf840('0x34')],function(_0x4c134e){var _0x287dad={};_0x287dad[_0x4c134e]={'$like':'%'+_0x322e1d[_0xf840('0x32')][_0xf840('0x3e')]+'%'};return _0x287dad;})});}_0x44096b=_['merge']({},_0x44096b,_0x322e1d[_0xf840('0x40')]);return db[_0xf840('0x52')][_0xf840('0x42')](_0x44096b);}})[_0xf840('0x24')](function(_0x44448c){if(_0x44448c){return db[_0xf840('0x56')][_0xf840('0x57')]({'where':{'id':_[_0xf840('0x2c')](_0x44448c,'UserId'),'role':_0xf840('0x58')},'attributes':['id','name',_0xf840('0x59'),_0xf840('0x5a'),_0xf840('0x5b')]});}})['then'](function(_0x324642){if(_0x324642){return{'count':_0x324642['count'],'rows':_[_0xf840('0x2c')](_0x324642['rows'],function(_0x1194df){return{'membername':_0x1194df[_0xf840('0x2a')],'UserId':_0x1194df['id'],'queue_name':_0x51b1aa[_0xf840('0x2a')],'SmsQueueId':_0x51b1aa['id'],'interface':util[_0xf840('0x5c')](_0xf840('0x5d'),_0xf840('0x5e'),_0x1194df['name']),'penalty':0x0,'paused':_0x1194df[_0xf840('0x59')],'createdAt':_0x1194df['createdAt'],'updatedAt':_0x1194df[_0xf840('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2fc0dc,_0x44096b))['catch'](handleError(_0x2fc0dc,null));};exports[_0xf840('0x5f')]=function(_0x467ba6,_0x4537e7,_0x361990){var _0x3a0e23={};var _0x108fc3={};var _0x2de22c;var _0x547cbc;return db[_0xf840('0x2d')][_0xf840('0x51')]({'where':{'id':_0x467ba6[_0xf840('0x46')]['id']}})[_0xf840('0x24')](handleEntityNotFound(_0x4537e7,null))[_0xf840('0x24')](function(_0x2490f7){if(_0x2490f7){_0x2de22c=_0x2490f7;_0x108fc3[_0xf840('0x36')]=_['keys'](db[_0xf840('0x60')][_0xf840('0x2e')]);_0x108fc3[_0xf840('0x32')]=_[_0xf840('0x33')](_0x467ba6[_0xf840('0x32')]);_0x108fc3[_0xf840('0x3d')]=_[_0xf840('0x35')](_0x108fc3['model'],_0x108fc3[_0xf840('0x32')]);_0x3a0e23['attributes']=_[_0xf840('0x35')](_0x108fc3['model'],qs['fields'](_0x467ba6[_0xf840('0x32')][_0xf840('0x37')]));_0x3a0e23[_0xf840('0x34')]=_0x3a0e23[_0xf840('0x34')][_0xf840('0x53')]?_0x3a0e23[_0xf840('0x34')]:_0x108fc3['model'];_0x3a0e23['order']=qs[_0xf840('0x3b')](_0x467ba6[_0xf840('0x32')]['sort']);_0x3a0e23['where']=qs[_0xf840('0x3d')](_[_0xf840('0x54')](_0x467ba6[_0xf840('0x32')],_0x108fc3[_0xf840('0x3d')]));if(_0x467ba6[_0xf840('0x32')][_0xf840('0x3e')]){_0x3a0e23[_0xf840('0x3c')]=_[_0xf840('0x3f')](_0x3a0e23[_0xf840('0x3c')],{'$or':_[_0xf840('0x2c')](_0x3a0e23[_0xf840('0x34')],function(_0x1c7bb3){var _0x1a72fe={};_0x1a72fe[_0x1c7bb3]={'$like':'%'+_0x467ba6['query'][_0xf840('0x3e')]+'%'};return _0x1a72fe;})});}_0x3a0e23=_[_0xf840('0x3f')]({},_0x3a0e23,_0x467ba6[_0xf840('0x40')]);return _0x2de22c['getTeams'](_0x3a0e23);}})[_0xf840('0x24')](function(_0x1a76aa){if(_0x1a76aa){_0x547cbc=_0x1a76aa[_0xf840('0x53')];if(!_0x467ba6[_0xf840('0x32')][_0xf840('0x38')](_0xf840('0x39'))){_0x3a0e23[_0xf840('0x1e')]=qs['limit'](_0x467ba6[_0xf840('0x32')][_0xf840('0x1e')]);_0x3a0e23[_0xf840('0x1c')]=qs[_0xf840('0x1c')](_0x467ba6[_0xf840('0x32')]['offset']);}return _0x2de22c[_0xf840('0x5f')](_0x3a0e23);}})[_0xf840('0x24')](function(_0x12b755){if(_0x12b755){return _0x12b755?{'count':_0x547cbc,'rows':_0x12b755}:null;}})[_0xf840('0x24')](respondWithResult(_0x4537e7,null))['catch'](handleError(_0x4537e7,null));};exports[_0xf840('0x61')]=function(_0x398857,_0x50d8af,_0x33ccd4){var _0x256ad3=_0x398857['body'][_0xf840('0x62')];return db[_0xf840('0x60')][_0xf840('0x42')]({'where':{'id':_0x256ad3},'attributes':['id'],'include':[{'model':db[_0xf840('0x56')],'as':_0xf840('0x63'),'attributes':['id',_0xf840('0x2a'),'online',_0xf840('0x64'),_0xf840('0x65')],'raw':!![]}]})[_0xf840('0x24')](function(_0x3d95f7){if(_0x3d95f7){var _0x5a7c29=_[_0xf840('0x66')](_0x3d95f7,function(_0x2e1019){var _0xfc2c9d=_0x2e1019[_0xf840('0x26')]({'plain':!![]});return _0xfc2c9d[_0xf840('0x63')];});return db[_0xf840('0x2d')][_0xf840('0x48')]({'where':{'id':_0x398857[_0xf840('0x46')]['id']}})['then'](function(_0x28ed7d){return db[_0xf840('0x67')]['transaction'](function(_0x506b06){return _0x28ed7d[_0xf840('0x61')](_0x256ad3,{'transaction':_0x506b06})[_0xf840('0x24')](function(){return BPromise['each'](_0x5a7c29,function(_0x1238b9){return db[_0xf840('0x52')][_0xf840('0x68')]({'where':{'UserId':_0x1238b9['id'],'SmsQueueId':_0x398857['params']['id']},'transaction':_0x506b06});});})[_0xf840('0x24')](function(){_0x5a7c29[_0xf840('0x69')](function(_0x1b4d8f){socket[_0xf840('0x6a')]('userSmsQueue:save',{'UserId':_0x1b4d8f['id'],'SmsQueueId':_0x28ed7d['id']});});});});});}})[_0xf840('0x24')](respondWithStatusCode(_0x50d8af,null))[_0xf840('0x44')](handleError(_0x50d8af,null));};exports['removeTeams']=function(_0x5a5ab1,_0x3de176,_0x346613){return db['Team'][_0xf840('0x42')]({'where':{'id':_0x5a5ab1[_0xf840('0x32')][_0xf840('0x62')]},'attributes':['id'],'include':[{'model':db[_0xf840('0x56')],'as':_0xf840('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3de176,null))[_0xf840('0x24')](function(_0x3573c0){var _0x448980=_[_0xf840('0x2c')](_0x3573c0,'id');var _0x5c7f4e=[];var _0x5e5819=[];var _0x4b619f=squel[_0xf840('0x6b')]();_0x4b619f[_0xf840('0x6c')]('tq.TeamId')['from'](_0xf840('0x6d'),'tq')[_0xf840('0x6e')](_0xf840('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf840('0x3c')]('SmsQueueId\x20=\x20?',_0x5a5ab1['params']['id']);for(var _0x6cc2f8=0x0;_0x6cc2f8<_0x3573c0[_0xf840('0x53')];_0x6cc2f8+=0x1){let _0x4b878b=_0x3573c0[_0x6cc2f8];for(var _0x44ffb7=0x0;_0x44ffb7<_0x4b878b[_0xf840('0x63')][_0xf840('0x53')];_0x44ffb7+=0x1){let _0x2e462c=_0x4b878b[_0xf840('0x63')][_0x44ffb7];var _0x4bc435=_0x4b619f[_0xf840('0x70')]();_0x4bc435[_0xf840('0x3c')](_0xf840('0x71'),_0x2e462c['id']);_0x5e5819[_0xf840('0x72')](db[_0xf840('0x67')][_0xf840('0x32')](_0x4bc435[_0xf840('0x73')](),{'type':db[_0xf840('0x67')]['QueryTypes'][_0xf840('0x74')]})['then'](function(_0x43f0dc){if(_0x43f0dc[_0xf840('0x53')]===0x1){return _0x2e462c['id'];}else{var _0x21e989=_['every'](_[_0xf840('0x2c')](_0x43f0dc,_0xf840('0x75')),function(_0x90ab45){return _[_0xf840('0x76')](_0x448980,_0x90ab45);});if(_0x21e989){return _0x2e462c['id'];}}}));}}return BPromise[_0xf840('0x77')](_0x5e5819)[_0xf840('0x24')](function(_0x2f39ef){_0x5c7f4e=_(_0x5c7f4e)[_0xf840('0x78')](_0x2f39ef)['compact']()['value']();return db[_0xf840('0x2d')][_0xf840('0x48')]({'where':{'id':_0x5a5ab1['params']['id']}})['then'](function(_0x25179f){return db[_0xf840('0x67')][_0xf840('0x79')](function(_0x2fc4ab){return _0x25179f[_0xf840('0x7a')](_0x5a5ab1['query'][_0xf840('0x62')],{'transaction':_0x2fc4ab})[_0xf840('0x24')](function(){if(!_[_0xf840('0x7b')](_0x5c7f4e)){return _0x25179f[_0xf840('0x7c')](_0x5c7f4e,{'transaction':_0x2fc4ab});}})[_0xf840('0x24')](function(){_0x5c7f4e[_0xf840('0x69')](function(_0xde09a4){socket[_0xf840('0x6a')]('userSmsQueue:remove',{'UserId':_0xde09a4,'SmsQueueId':_0x25179f['id']});});});});});});})[_0xf840('0x24')](respondWithStatusCode(_0x3de176,null))[_0xf840('0x44')](handleError(_0x3de176,null));};exports['addAgents']=function(_0x1aac0d,_0x5d6d1b,_0x50a50f){return db[_0xf840('0x2d')][_0xf840('0x48')]({'where':{'id':_0x1aac0d[_0xf840('0x46')]['id']}})[_0xf840('0x24')](handleEntityNotFound(_0x5d6d1b,null))['then'](function(_0x1c6e94){if(_0x1c6e94){return _0x1c6e94[_0xf840('0x7d')](_0x1aac0d[_0xf840('0x4a')][_0xf840('0x62')],_[_0xf840('0x7e')](_0x1aac0d['body'],[_0xf840('0x62'),'id'])||{})['spread'](function(_0x16996d){for(var _0x56c840=0x0;_0x56c840<_0x1aac0d[_0xf840('0x4a')][_0xf840('0x62')][_0xf840('0x53')];_0x56c840+=0x1){socket[_0xf840('0x6a')](_0xf840('0x7f'),{'UserId':Number(_0x1aac0d[_0xf840('0x4a')]['ids'][_0x56c840]),'SmsQueueId':Number(_0x1aac0d[_0xf840('0x46')]['id'])});}return _0x16996d;});}})[_0xf840('0x24')](respondWithResult(_0x5d6d1b,null))[_0xf840('0x44')](handleError(_0x5d6d1b,null));};exports[_0xf840('0x7c')]=function(_0x231b15,_0x1ba316,_0x5c1a91){return db[_0xf840('0x2d')]['find']({'where':{'id':_0x231b15['params']['id']}})[_0xf840('0x24')](handleEntityNotFound(_0x1ba316,null))['then'](function(_0x3495ec){if(_0x3495ec){return _0x3495ec[_0xf840('0x7c')](_0x231b15['query'][_0xf840('0x62')])[_0xf840('0x24')](function(){if(_['isArray'](_0x231b15[_0xf840('0x32')][_0xf840('0x62')])){for(var _0x3a5e31=0x0;_0x3a5e31<_0x231b15[_0xf840('0x32')][_0xf840('0x62')][_0xf840('0x53')];_0x3a5e31+=0x1){socket['emit'](_0xf840('0x80'),{'UserId':Number(_0x231b15[_0xf840('0x32')][_0xf840('0x62')][_0x3a5e31]),'SmsQueueId':Number(_0x231b15[_0xf840('0x46')]['id'])});}}else{socket[_0xf840('0x6a')](_0xf840('0x80'),{'UserId':Number(_0x231b15[_0xf840('0x32')]['ids']),'SmsQueueId':Number(_0x231b15[_0xf840('0x46')]['id'])});}});}})[_0xf840('0x24')](respondWithStatusCode(_0x1ba316,null))[_0xf840('0x44')](handleError(_0x1ba316,null));};exports['getAgents']=function(_0xb3ef5e,_0x1240c8,_0x4ffae6){var _0x4568c8={};var _0xbe12b9={};var _0x5eb5f5;var _0x45d8c0;return db[_0xf840('0x2d')][_0xf840('0x51')]({'where':{'id':_0xb3ef5e['params']['id']}})[_0xf840('0x24')](handleEntityNotFound(_0x1240c8,null))[_0xf840('0x24')](function(_0x1074f6){if(_0x1074f6){_0x5eb5f5=_0x1074f6;_0xbe12b9[_0xf840('0x36')]=_[_0xf840('0x33')](db['User'][_0xf840('0x2e')]);_0xbe12b9[_0xf840('0x32')]=_[_0xf840('0x33')](_0xb3ef5e[_0xf840('0x32')]);_0xbe12b9[_0xf840('0x3d')]=_['intersection'](_0xbe12b9[_0xf840('0x36')],_0xbe12b9[_0xf840('0x32')]);_0x4568c8[_0xf840('0x34')]=_[_0xf840('0x35')](_0xbe12b9['model'],qs[_0xf840('0x37')](_0xb3ef5e[_0xf840('0x32')][_0xf840('0x37')]));_0x4568c8[_0xf840('0x34')]=_0x4568c8[_0xf840('0x34')][_0xf840('0x53')]?_0x4568c8[_0xf840('0x34')]:_0xbe12b9[_0xf840('0x36')];_0x4568c8['order']=qs[_0xf840('0x3b')](_0xb3ef5e[_0xf840('0x32')][_0xf840('0x3b')]);_0x4568c8[_0xf840('0x3c')]=qs[_0xf840('0x3d')](_[_0xf840('0x54')](_0xb3ef5e[_0xf840('0x32')],_0xbe12b9['filters']));if(_0xb3ef5e['query']['filter']){_0x4568c8[_0xf840('0x3c')]=_['merge'](_0x4568c8[_0xf840('0x3c')],{'$or':_[_0xf840('0x2c')](_0x4568c8[_0xf840('0x34')],function(_0x4c8f1b){var _0x26dc4d={};_0x26dc4d[_0x4c8f1b]={'$like':'%'+_0xb3ef5e[_0xf840('0x32')][_0xf840('0x3e')]+'%'};return _0x26dc4d;})});}_0x4568c8=_['merge']({},_0x4568c8,_0xb3ef5e['options']);return _0x5eb5f5[_0xf840('0x81')](_0x4568c8);}})[_0xf840('0x24')](function(_0x3f45d9){if(_0x3f45d9){_0x45d8c0=_0x3f45d9['length'];if(!_0xb3ef5e[_0xf840('0x32')][_0xf840('0x38')](_0xf840('0x39'))){_0x4568c8['limit']=qs[_0xf840('0x1e')](_0xb3ef5e[_0xf840('0x32')][_0xf840('0x1e')]);_0x4568c8[_0xf840('0x1c')]=qs[_0xf840('0x1c')](_0xb3ef5e[_0xf840('0x32')][_0xf840('0x1c')]);}return _0x5eb5f5['getAgents'](_0x4568c8);}})[_0xf840('0x24')](function(_0x436bde){if(_0x436bde){return _0x436bde?{'count':_0x45d8c0,'rows':_0x436bde}:null;}})[_0xf840('0x24')](respondWithResult(_0x1240c8,null))[_0xf840('0x44')](handleError(_0x1240c8,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 9234911..1119b80 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 _0xdccd=['events','../../mysqldb','SmsQueue','update','emit','hook','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xdccd,0x126));var _0xddcc=function(_0x51f471,_0xdbc0ba){_0x51f471=_0x51f471-0x0;var _0x5a0d53=_0xdccd[_0x51f471];return _0x5a0d53;};'use strict';var EventEmitter=require(_0xddcc('0x0'));var SmsQueue=require(_0xddcc('0x1'))['db'][_0xddcc('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xddcc('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1fbfb5){return function(_0x2e6d0,_0x48a1ae,_0x23eafd){SmsQueueEvents[_0xddcc('0x4')](_0x1fbfb5+':'+_0x2e6d0['id'],_0x2e6d0);SmsQueueEvents[_0xddcc('0x4')](_0x1fbfb5,_0x2e6d0);_0x23eafd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xddcc('0x5')](e,emitEvent(event));}}module[_0xddcc('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x3656=['hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x439ba5,_0x689abc){var _0x59ee86=function(_0x45c695){while(--_0x45c695){_0x439ba5['push'](_0x439ba5['shift']());}};_0x59ee86(++_0x689abc);}(_0x3656,0x133));var _0x6365=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3656[_0x2be8c2];return _0x97f531;};'use strict';var EventEmitter=require(_0x6365('0x0'));var SmsQueue=require(_0x6365('0x1'))['db'][_0x6365('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6365('0x3')](0x0);var events={'afterCreate':_0x6365('0x4'),'afterUpdate':'update','afterDestroy':_0x6365('0x5')};function emitEvent(_0x2691f8){return function(_0x51f822,_0x29b0d7,_0x57323c){SmsQueueEvents[_0x6365('0x6')](_0x2691f8+':'+_0x51f822['id'],_0x51f822);SmsQueueEvents[_0x6365('0x6')](_0x2691f8,_0x51f822);_0x57323c(null);};}for(var e in events){if(events[_0x6365('0x7')](e)){var event=events[e];SmsQueue[_0x6365('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 3d8c8f8..1c26dfe 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 _0xb058=['exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsQueue.attributes'];(function(_0x9a0c2,_0x48a029){var _0x5d0fad=function(_0x41dee2){while(--_0x41dee2){_0x9a0c2['push'](_0x9a0c2['shift']());}};_0x5d0fad(++_0x48a029);}(_0xb058,0xa0));var _0x8b05=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb058[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x8b05('0x0'));var util=require(_0x8b05('0x1'));var logger=require(_0x8b05('0x2'))(_0x8b05('0x3'));var moment=require(_0x8b05('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b05('0x5'));var fs=require('fs');var path=require(_0x8b05('0x6'));var rimraf=require('rimraf');var config=require(_0x8b05('0x7'));var attributes=require(_0x8b05('0x8'));module[_0x8b05('0x9')]=function(_0x2f3c8e,_0x3a3919){return _0x2f3c8e[_0x8b05('0xa')](_0x8b05('0xb'),attributes,{'tableName':_0x8b05('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3344=['request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0x3344,0x190));var _0x4334=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3344[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4334('0x0'));var util=require(_0x4334('0x1'));var logger=require(_0x4334('0x2'))(_0x4334('0x3'));var moment=require(_0x4334('0x4'));var BPromise=require(_0x4334('0x5'));var rp=require(_0x4334('0x6'));var fs=require('fs');var path=require(_0x4334('0x7'));var rimraf=require(_0x4334('0x8'));var config=require(_0x4334('0x9'));var attributes=require(_0x4334('0xa'));module[_0x4334('0xb')]=function(_0x1f31b3,_0x32873c){return _0x1f31b3['define'](_0x4334('0xc'),attributes,{'tableName':_0x4334('0xd'),'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 8857963..d72af3c 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 _0x35f6=['socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','SmsQueue','options','where','attributes','limit','map','model','include','GetSmsQueue','stringify','catch','ShowSmsQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x491a8e,_0x1578a6){var _0x1f03ca=function(_0x595b81){while(--_0x595b81){_0x491a8e['push'](_0x491a8e['shift']());}};_0x1f03ca(++_0x1578a6);}(_0x35f6,0x1ea));var _0x635f=function(_0x791d77,_0x2d5801){_0x791d77=_0x791d77-0x0;var _0xf40e61=_0x35f6[_0x791d77];return _0xf40e61;};'use strict';var _=require('lodash');var util=require(_0x635f('0x0'));var moment=require(_0x635f('0x1'));var BPromise=require(_0x635f('0x2'));var rs=require(_0x635f('0x3'));var fs=require('fs');var Redis=require(_0x635f('0x4'));var db=require(_0x635f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x635f('0x6'))(_0x635f('0x7'));var config=require(_0x635f('0x8'));var jayson=require(_0x635f('0x9'));var client=jayson['client'][_0x635f('0xa')]({'port':0x232a});config[_0x635f('0xb')]=_[_0x635f('0xc')](config[_0x635f('0xb')],{'host':_0x635f('0xd'),'port':0x18eb});var socket=require(_0x635f('0xe'))(new Redis(config[_0x635f('0xb')]));require(_0x635f('0xf'))[_0x635f('0x10')](socket);function respondWithRpcPromise(_0x438d6b,_0x5d290a,_0x4f0f43){return new BPromise(function(_0x3c5c15,_0x265ea6){return client[_0x635f('0x11')](_0x438d6b,_0x4f0f43)[_0x635f('0x12')](function(_0x3e3cf4){logger['info'](_0x635f('0x13'),_0x5d290a,_0x635f('0x14'));logger[_0x635f('0x15')](_0x635f('0x16'),_0x5d290a,_0x635f('0x14'),JSON['stringify'](_0x3e3cf4));if(_0x3e3cf4['error']){if(_0x3e3cf4[_0x635f('0x17')][_0x635f('0x18')]===0x1f4){logger[_0x635f('0x17')](_0x635f('0x13'),_0x5d290a,_0x3e3cf4[_0x635f('0x17')]['message']);return _0x265ea6(_0x3e3cf4[_0x635f('0x17')][_0x635f('0x19')]);}logger['error'](_0x635f('0x13'),_0x5d290a,_0x3e3cf4[_0x635f('0x17')][_0x635f('0x19')]);return _0x3c5c15(_0x3e3cf4[_0x635f('0x17')][_0x635f('0x19')]);}else{logger[_0x635f('0x1a')](_0x635f('0x13'),_0x5d290a,_0x635f('0x14'));_0x3c5c15(_0x3e3cf4[_0x635f('0x1b')][_0x635f('0x19')]);}})['catch'](function(_0x395721){logger['error'](_0x635f('0x13'),_0x5d290a,_0x395721);_0x265ea6(_0x395721);});});}exports['GetSmsQueue']=function(_0x18598c){var _0x1b4729=this;return new Promise(function(_0x583cf5,_0x2911a7){return db[_0x635f('0x1c')]['findAll']({'raw':_0x18598c[_0x635f('0x1d')]?_0x18598c['options']['raw']===undefined?!![]:![]:!![],'where':_0x18598c[_0x635f('0x1d')]?_0x18598c[_0x635f('0x1d')][_0x635f('0x1e')]||null:null,'attributes':_0x18598c[_0x635f('0x1d')]?_0x18598c['options'][_0x635f('0x1f')]||null:null,'limit':_0x18598c[_0x635f('0x1d')]?_0x18598c[_0x635f('0x1d')][_0x635f('0x20')]||null:null,'include':_0x18598c[_0x635f('0x1d')]?_0x18598c['options']['include']?_[_0x635f('0x21')](_0x18598c[_0x635f('0x1d')]['include'],function(_0x29e94e){return{'model':db[_0x29e94e[_0x635f('0x22')]],'as':_0x29e94e['as'],'attributes':_0x29e94e['attributes'],'include':_0x29e94e['include']?_[_0x635f('0x21')](_0x29e94e[_0x635f('0x23')],function(_0x2b8acd){return{'model':db[_0x2b8acd['model']],'as':_0x2b8acd['as'],'attributes':_0x2b8acd['attributes'],'include':_0x2b8acd[_0x635f('0x23')]?_[_0x635f('0x21')](_0x2b8acd[_0x635f('0x23')],function(_0x598024){return{'model':db[_0x598024['model']],'as':_0x598024['as'],'attributes':_0x598024[_0x635f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x635f('0x12')](function(_0x5ac19f){logger[_0x635f('0x1a')](_0x635f('0x24'),_0x18598c);logger[_0x635f('0x15')](_0x635f('0x24'),_0x18598c,JSON[_0x635f('0x25')](_0x5ac19f));_0x583cf5(_0x5ac19f);})[_0x635f('0x26')](function(_0x5a1325){logger[_0x635f('0x17')]('GetSmsQueue',_0x5a1325[_0x635f('0x19')],_0x18598c);_0x2911a7(_0x1b4729[_0x635f('0x17')](0x1f4,_0x5a1325[_0x635f('0x19')]));});});};exports[_0x635f('0x27')]=function(_0x5624e0){var _0x4b1926=this;return new Promise(function(_0x33c23c,_0x21be00){return db[_0x635f('0x1c')][_0x635f('0x28')]({'raw':_0x5624e0['options']?_0x5624e0[_0x635f('0x1d')][_0x635f('0x29')]===undefined?!![]:![]:!![],'where':_0x5624e0[_0x635f('0x1d')]?_0x5624e0[_0x635f('0x1d')][_0x635f('0x1e')]||null:null,'attributes':_0x5624e0['options']?_0x5624e0[_0x635f('0x1d')]['attributes']||null:null,'include':_0x5624e0[_0x635f('0x1d')]?_0x5624e0[_0x635f('0x1d')][_0x635f('0x23')]?_[_0x635f('0x21')](_0x5624e0[_0x635f('0x1d')][_0x635f('0x23')],function(_0x2d9b8f){return{'model':db[_0x2d9b8f[_0x635f('0x22')]],'as':_0x2d9b8f['as'],'attributes':_0x2d9b8f['attributes'],'include':_0x2d9b8f[_0x635f('0x23')]?_[_0x635f('0x21')](_0x2d9b8f[_0x635f('0x23')],function(_0x4f35c2){return{'model':db[_0x4f35c2[_0x635f('0x22')]],'as':_0x4f35c2['as'],'attributes':_0x4f35c2[_0x635f('0x1f')],'include':_0x4f35c2[_0x635f('0x23')]?_[_0x635f('0x21')](_0x4f35c2[_0x635f('0x23')],function(_0xaa4f8c){return{'model':db[_0xaa4f8c[_0x635f('0x22')]],'as':_0xaa4f8c['as'],'attributes':_0xaa4f8c['attributes']};}):[]};}):[]};}):[]:[]})[_0x635f('0x12')](function(_0x4a9c28){logger[_0x635f('0x1a')](_0x635f('0x27'),_0x5624e0);logger['debug']('ShowSmsQueue',_0x5624e0,JSON['stringify'](_0x4a9c28));_0x33c23c(_0x4a9c28);})[_0x635f('0x26')](function(_0x2ee6cc){logger[_0x635f('0x17')](_0x635f('0x27'),_0x2ee6cc['message'],_0x5624e0);_0x21be00(_0x4b1926[_0x635f('0x17')](0x1f4,_0x2ee6cc[_0x635f('0x19')]));});});}; \ No newline at end of file +var _0x1430=['catch','GetSmsQueue','SmsQueue','options','where','attributes','limit','include','model','map','then','stringify','ShowSmsQueue','find','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsQueue.socket','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x482a85,_0x2cb8ca){var _0x5ececb=function(_0x4c203a){while(--_0x4c203a){_0x482a85['push'](_0x482a85['shift']());}};_0x5ececb(++_0x2cb8ca);}(_0x1430,0x120));var _0x0143=function(_0x217751,_0x5a0349){_0x217751=_0x217751-0x0;var _0x66446b=_0x1430[_0x217751];return _0x66446b;};'use strict';var _=require(_0x0143('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0143('0x1'));var rs=require(_0x0143('0x2'));var fs=require('fs');var Redis=require(_0x0143('0x3'));var db=require(_0x0143('0x4'))['db'];var utils=require(_0x0143('0x5'));var logger=require(_0x0143('0x6'))('rpc');var config=require(_0x0143('0x7'));var jayson=require(_0x0143('0x8'));var client=jayson[_0x0143('0x9')][_0x0143('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0143('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0143('0xc'))(new Redis(config[_0x0143('0xb')]));require(_0x0143('0xd'))[_0x0143('0xe')](socket);function respondWithRpcPromise(_0x12b6fd,_0x326948,_0x5791e3){return new BPromise(function(_0x14c928,_0x2d8a52){return client[_0x0143('0xf')](_0x12b6fd,_0x5791e3)['then'](function(_0x5b54e3){logger['info'](_0x0143('0x10'),_0x326948,_0x0143('0x11'));logger[_0x0143('0x12')](_0x0143('0x13'),_0x326948,_0x0143('0x11'),JSON['stringify'](_0x5b54e3));if(_0x5b54e3[_0x0143('0x14')]){if(_0x5b54e3[_0x0143('0x14')][_0x0143('0x15')]===0x1f4){logger[_0x0143('0x14')](_0x0143('0x10'),_0x326948,_0x5b54e3['error'][_0x0143('0x16')]);return _0x2d8a52(_0x5b54e3['error'][_0x0143('0x16')]);}logger[_0x0143('0x14')]('SmsQueue,\x20%s,\x20%s',_0x326948,_0x5b54e3['error'][_0x0143('0x16')]);return _0x14c928(_0x5b54e3['error'][_0x0143('0x16')]);}else{logger[_0x0143('0x17')](_0x0143('0x10'),_0x326948,'request\x20sent');_0x14c928(_0x5b54e3['result']['message']);}})[_0x0143('0x18')](function(_0x185454){logger['error'](_0x0143('0x10'),_0x326948,_0x185454);_0x2d8a52(_0x185454);});});}exports[_0x0143('0x19')]=function(_0x55c14d){var _0x4e4772=this;return new Promise(function(_0x56adc0,_0x902dd3){return db[_0x0143('0x1a')]['findAll']({'raw':_0x55c14d[_0x0143('0x1b')]?_0x55c14d[_0x0143('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x55c14d[_0x0143('0x1b')]?_0x55c14d[_0x0143('0x1b')][_0x0143('0x1c')]||null:null,'attributes':_0x55c14d[_0x0143('0x1b')]?_0x55c14d['options'][_0x0143('0x1d')]||null:null,'limit':_0x55c14d[_0x0143('0x1b')]?_0x55c14d[_0x0143('0x1b')][_0x0143('0x1e')]||null:null,'include':_0x55c14d[_0x0143('0x1b')]?_0x55c14d[_0x0143('0x1b')][_0x0143('0x1f')]?_['map'](_0x55c14d[_0x0143('0x1b')][_0x0143('0x1f')],function(_0x48b1ce){return{'model':db[_0x48b1ce[_0x0143('0x20')]],'as':_0x48b1ce['as'],'attributes':_0x48b1ce[_0x0143('0x1d')],'include':_0x48b1ce[_0x0143('0x1f')]?_[_0x0143('0x21')](_0x48b1ce['include'],function(_0x3d8542){return{'model':db[_0x3d8542[_0x0143('0x20')]],'as':_0x3d8542['as'],'attributes':_0x3d8542[_0x0143('0x1d')],'include':_0x3d8542['include']?_['map'](_0x3d8542[_0x0143('0x1f')],function(_0x44cd66){return{'model':db[_0x44cd66[_0x0143('0x20')]],'as':_0x44cd66['as'],'attributes':_0x44cd66['attributes']};}):[]};}):[]};}):[]:[]})[_0x0143('0x22')](function(_0x247318){logger[_0x0143('0x17')]('GetSmsQueue',_0x55c14d);logger['debug'](_0x0143('0x19'),_0x55c14d,JSON[_0x0143('0x23')](_0x247318));_0x56adc0(_0x247318);})[_0x0143('0x18')](function(_0x3d83d5){logger[_0x0143('0x14')](_0x0143('0x19'),_0x3d83d5[_0x0143('0x16')],_0x55c14d);_0x902dd3(_0x4e4772[_0x0143('0x14')](0x1f4,_0x3d83d5['message']));});});};exports[_0x0143('0x24')]=function(_0x1171e4){var _0x36f779=this;return new Promise(function(_0x23fe0d,_0x1045dd){return db[_0x0143('0x1a')][_0x0143('0x25')]({'raw':_0x1171e4[_0x0143('0x1b')]?_0x1171e4['options'][_0x0143('0x26')]===undefined?!![]:![]:!![],'where':_0x1171e4['options']?_0x1171e4[_0x0143('0x1b')][_0x0143('0x1c')]||null:null,'attributes':_0x1171e4[_0x0143('0x1b')]?_0x1171e4['options'][_0x0143('0x1d')]||null:null,'include':_0x1171e4[_0x0143('0x1b')]?_0x1171e4['options'][_0x0143('0x1f')]?_[_0x0143('0x21')](_0x1171e4['options'][_0x0143('0x1f')],function(_0x10a5ee){return{'model':db[_0x10a5ee['model']],'as':_0x10a5ee['as'],'attributes':_0x10a5ee[_0x0143('0x1d')],'include':_0x10a5ee[_0x0143('0x1f')]?_[_0x0143('0x21')](_0x10a5ee[_0x0143('0x1f')],function(_0x158efc){return{'model':db[_0x158efc[_0x0143('0x20')]],'as':_0x158efc['as'],'attributes':_0x158efc[_0x0143('0x1d')],'include':_0x158efc['include']?_[_0x0143('0x21')](_0x158efc[_0x0143('0x1f')],function(_0x56b570){return{'model':db[_0x56b570[_0x0143('0x20')]],'as':_0x56b570['as'],'attributes':_0x56b570[_0x0143('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e6b83){logger['info']('ShowSmsQueue',_0x1171e4);logger[_0x0143('0x12')](_0x0143('0x24'),_0x1171e4,JSON[_0x0143('0x23')](_0x4e6b83));_0x23fe0d(_0x4e6b83);})['catch'](function(_0x39277e){logger[_0x0143('0x14')]('ShowSmsQueue',_0x39277e[_0x0143('0x16')],_0x1171e4);_0x1045dd(_0x36f779[_0x0143('0x14')](0x1f4,_0x39277e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 05e8371..73f849b 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 _0x28ae=['removeListener','register','length','smsQueue:','./smsQueue.events','remove'];(function(_0x14090e,_0x30c2f7){var _0x554da7=function(_0x165d16){while(--_0x165d16){_0x14090e['push'](_0x14090e['shift']());}};_0x554da7(++_0x30c2f7);}(_0x28ae,0x190));var _0xe28a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28ae[_0x3dd15e];return _0x231fd0;};'use strict';var SmsQueueEvents=require(_0xe28a('0x0'));var events=['save',_0xe28a('0x1'),'update'];function createListener(_0x555629,_0x1d8f6d){return function(_0x104e98){_0x1d8f6d['emit'](_0x555629,_0x104e98);};}function removeListener(_0x266c2a,_0x192087){return function(){SmsQueueEvents[_0xe28a('0x2')](_0x266c2a,_0x192087);};}exports[_0xe28a('0x3')]=function(_0x320872){for(var _0x11dc18=0x0,_0x38c3a6=events[_0xe28a('0x4')];_0x11dc18<_0x38c3a6;_0x11dc18++){var _0x15e131=events[_0x11dc18];var _0x2574a1=createListener(_0xe28a('0x5')+_0x15e131,_0x320872);SmsQueueEvents['on'](_0x15e131,_0x2574a1);}}; \ No newline at end of file +var _0xebfa=['remove','removeListener','register','length','./smsQueue.events'];(function(_0x30ddd6,_0x1e3c7b){var _0x3ba7c7=function(_0x312e55){while(--_0x312e55){_0x30ddd6['push'](_0x30ddd6['shift']());}};_0x3ba7c7(++_0x1e3c7b);}(_0xebfa,0x121));var _0xaebf=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xebfa[_0x266618];return _0x54dbf5;};'use strict';var SmsQueueEvents=require(_0xaebf('0x0'));var events=['save',_0xaebf('0x1'),'update'];function createListener(_0x5b0f61,_0x3fa08b){return function(_0x1787fd){_0x3fa08b['emit'](_0x5b0f61,_0x1787fd);};}function removeListener(_0x4a68d3,_0xac4c4b){return function(){SmsQueueEvents[_0xaebf('0x2')](_0x4a68d3,_0xac4c4b);};}exports[_0xaebf('0x3')]=function(_0xdf89d3){for(var _0x278002=0x0,_0x2aefd4=events[_0xaebf('0x4')];_0x278002<_0x2aefd4;_0x278002++){var _0xb03f4b=events[_0x278002];var _0x571f6f=createListener('smsQueue:'+_0xb03f4b,_0xdf89d3);SmsQueueEvents['on'](_0xb03f4b,_0x571f6f);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 4320c4d..a84f941 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 _0xdbce=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./smsQueueReport.controller'];(function(_0x56046c,_0x48f853){var _0xfa490d=function(_0x593cf5){while(--_0x593cf5){_0x56046c['push'](_0x56046c['shift']());}};_0xfa490d(++_0x48f853);}(_0xdbce,0x1f1));var _0xedbc=function(_0x1ecd92,_0x3160e5){_0x1ecd92=_0x1ecd92-0x0;var _0x252421=_0xdbce[_0x1ecd92];return _0x252421;};'use strict';var multer=require(_0xedbc('0x0'));var util=require('util');var path=require(_0xedbc('0x1'));var timeout=require('connect-timeout');var express=require(_0xedbc('0x2'));var router=express[_0xedbc('0x3')]();var fs_extra=require(_0xedbc('0x4'));var auth=require(_0xedbc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xedbc('0x6'));router[_0xedbc('0x7')]('/',auth[_0xedbc('0x8')](),controller[_0xedbc('0x9')]);router[_0xedbc('0x7')](_0xedbc('0xa'),auth[_0xedbc('0x8')](),controller[_0xedbc('0xb')]);router['get'](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0xd')]);router[_0xedbc('0xe')]('/',auth[_0xedbc('0x8')](),controller[_0xedbc('0xf')]);router[_0xedbc('0x10')](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0x11')]);router[_0xedbc('0x12')](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0x13')]);module[_0xedbc('0x14')]=router; \ No newline at end of file +var _0xa969=['isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa969,0x114));var _0x9a96=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0xa969[_0x35b18a];return _0x4db1bd;};'use strict';var multer=require(_0x9a96('0x0'));var util=require(_0x9a96('0x1'));var path=require(_0x9a96('0x2'));var timeout=require(_0x9a96('0x3'));var express=require(_0x9a96('0x4'));var router=express[_0x9a96('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9a96('0x6'));var interaction=require(_0x9a96('0x7'));var config=require(_0x9a96('0x8'));var controller=require(_0x9a96('0x9'));router['get']('/',auth[_0x9a96('0xa')](),controller[_0x9a96('0xb')]);router[_0x9a96('0xc')](_0x9a96('0xd'),auth[_0x9a96('0xa')](),controller[_0x9a96('0xe')]);router[_0x9a96('0xc')](_0x9a96('0xf'),auth[_0x9a96('0xa')](),controller['show']);router[_0x9a96('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9a96('0x11')](_0x9a96('0xf'),auth[_0x9a96('0xa')](),controller[_0x9a96('0x12')]);router[_0x9a96('0x13')](_0x9a96('0xf'),auth['isAuthenticated'](),controller[_0x9a96('0x14')]);module[_0x9a96('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 07ac400..c1039a9 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 _0xf4f5=['STRING','DATE'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0xf4f5,0x1dc));var _0x5f4f=function(_0x283379,_0x51e897){_0x283379=_0x283379-0x0;var _0x4ce67d=_0xf4f5[_0x283379];return _0x4ce67d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5f4f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x5f4f('0x0')]},'joinAt':{'type':Sequelize[_0x5f4f('0x1')]},'leaveAt':{'type':Sequelize[_0x5f4f('0x1')]},'acceptAt':{'type':Sequelize[_0x5f4f('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5f4f('0x0')]}}; \ No newline at end of file +var _0x28d1=['DATE','moment','sequelize','exports','STRING'];(function(_0xee4200,_0x816075){var _0x226399=function(_0x5d51fa){while(--_0x5d51fa){_0xee4200['push'](_0xee4200['shift']());}};_0x226399(++_0x816075);}(_0x28d1,0x1d2));var _0x128d=function(_0x3dfaa3,_0xbdb7eb){_0x3dfaa3=_0x3dfaa3-0x0;var _0x4f4078=_0x28d1[_0x3dfaa3];return _0x4f4078;};'use strict';var moment=require(_0x128d('0x0'));var Sequelize=require(_0x128d('0x1'));module[_0x128d('0x2')]={'uniqueid':{'type':Sequelize[_0x128d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x128d('0x3')]},'joinAt':{'type':Sequelize[_0x128d('0x4')]},'leaveAt':{'type':Sequelize[_0x128d('0x4')]},'acceptAt':{'type':Sequelize[_0x128d('0x4')]},'exitAt':{'type':Sequelize[_0x128d('0x4')]},'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 dd16bd6..71a91a5 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 _0xce2a=['merge','include','findAll','rows','catch','params','includeAll','options','create','body','find','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL'];(function(_0xd1190e,_0x356b17){var _0x36d815=function(_0x8a2442){while(--_0x8a2442){_0xd1190e['push'](_0xd1190e['shift']());}};_0x36d815(++_0x356b17);}(_0xce2a,0x135));var _0xace2=function(_0x5c189f,_0x156d25){_0x5c189f=_0x5c189f-0x0;var _0x3dadb3=_0xce2a[_0x5c189f];return _0x3dadb3;};'use strict';var emlformat=require(_0xace2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xace2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xace2('0x2'));var moment=require(_0xace2('0x3'));var BPromise=require(_0xace2('0x4'));var Mustache=require('mustache');var util=require(_0xace2('0x5'));var path=require('path');var sox=require(_0xace2('0x6'));var csv=require(_0xace2('0x7'));var ejs=require(_0xace2('0x8'));var fs=require('fs');var fs_extra=require(_0xace2('0x9'));var _=require('lodash');var squel=require(_0xace2('0xa'));var crypto=require('crypto');var jsforce=require(_0xace2('0xb'));var deskjs=require(_0xace2('0xc'));var toCsv=require(_0xace2('0x7'));var querystring=require(_0xace2('0xd'));var Papa=require(_0xace2('0xe'));var Redis=require(_0xace2('0xf'));var authService=require(_0xace2('0x10'));var qs=require(_0xace2('0x11'));var as=require(_0xace2('0x12'));var hardwareService=require(_0xace2('0x13'));var logger=require('../../config/logger')(_0xace2('0x14'));var utils=require(_0xace2('0x15'));var config=require(_0xace2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xace2('0x17'))['db'];function respondWithStatusCode(_0x4cea14,_0x45a1dd){_0x45a1dd=_0x45a1dd||0xcc;return function(_0x5d65db){if(_0x5d65db){return _0x4cea14[_0xace2('0x18')](_0x45a1dd);}return _0x4cea14['status'](_0x45a1dd)[_0xace2('0x19')]();};}function respondWithResult(_0x4b4e3a,_0x176cea){_0x176cea=_0x176cea||0xc8;return function(_0x321149){if(_0x321149){return _0x4b4e3a[_0xace2('0x1a')](_0x176cea)['json'](_0x321149);}};}function respondWithFilteredResult(_0x3a06cd,_0x358f19){return function(_0x1c08b8){if(_0x1c08b8){var _0x521201=typeof _0x358f19['offset']===_0xace2('0x1b')&&typeof _0x358f19[_0xace2('0x1c')]===_0xace2('0x1b');var _0x265c1d=_0x1c08b8[_0xace2('0x1d')];var _0x12d187=_0x521201?0x0:_0x358f19[_0xace2('0x1e')];var _0x151f7a=_0x521201?_0x1c08b8[_0xace2('0x1d')]:_0x358f19[_0xace2('0x1e')]+_0x358f19[_0xace2('0x1c')];var _0x194660;if(_0x151f7a>=_0x265c1d){_0x151f7a=_0x265c1d;_0x194660=0xc8;}else{_0x194660=0xce;}_0x3a06cd[_0xace2('0x1a')](_0x194660);return _0x3a06cd[_0xace2('0x1f')](_0xace2('0x20'),_0x12d187+'-'+_0x151f7a+'/'+_0x265c1d)['json'](_0x1c08b8);}return null;};}function patchUpdates(_0x563fc0){return function(_0x49f0bd){try{jsonpatch['apply'](_0x49f0bd,_0x563fc0,!![]);}catch(_0x1adc26){return BPromise[_0xace2('0x21')](_0x1adc26);}return _0x49f0bd[_0xace2('0x22')]();};}function saveUpdates(_0xb99dfc,_0x2a791f){return function(_0x51f52a){if(_0x51f52a){return _0x51f52a[_0xace2('0x23')](_0xb99dfc)[_0xace2('0x24')](function(_0x50d283){return _0x50d283;});}return null;};}function removeEntity(_0x41344a,_0x5f2f85){return function(_0x232dd1){if(_0x232dd1){return _0x232dd1['destroy']()['then'](function(){_0x41344a['status'](0xcc)[_0xace2('0x19')]();});}};}function handleEntityNotFound(_0x498c76,_0x47bddb){return function(_0x49a1b6){if(!_0x49a1b6){_0x498c76['sendStatus'](0x194);}return _0x49a1b6;};}function handleError(_0x344cae,_0x433284){_0x433284=_0x433284||0x1f4;return function(_0x238b9a){logger[_0xace2('0x25')](_0x238b9a[_0xace2('0x26')]);if(_0x238b9a[_0xace2('0x27')]){delete _0x238b9a['name'];}_0x344cae[_0xace2('0x1a')](_0x433284)['send'](_0x238b9a);};}exports['index']=function(_0x4f0efc,_0x211e70){var _0x1fbdc9={},_0x2db3ed={},_0x460a72={'count':0x0,'rows':[]};var _0x28e464=_[_0xace2('0x28')](db[_0xace2('0x29')][_0xace2('0x2a')],function(_0xe8c66e){return{'name':_0xe8c66e[_0xace2('0x2b')],'type':_0xe8c66e[_0xace2('0x2c')][_0xace2('0x2d')]};});_0x2db3ed[_0xace2('0x2e')]=_[_0xace2('0x28')](_0x28e464,_0xace2('0x27'));_0x2db3ed[_0xace2('0x2f')]=_[_0xace2('0x30')](_0x4f0efc[_0xace2('0x2f')]);_0x2db3ed[_0xace2('0x31')]=_[_0xace2('0x32')](_0x2db3ed[_0xace2('0x2e')],_0x2db3ed[_0xace2('0x2f')]);_0x1fbdc9[_0xace2('0x33')]=_[_0xace2('0x32')](_0x2db3ed[_0xace2('0x2e')],qs['fields'](_0x4f0efc[_0xace2('0x2f')][_0xace2('0x34')]));_0x1fbdc9[_0xace2('0x33')]=_0x1fbdc9[_0xace2('0x33')][_0xace2('0x35')]?_0x1fbdc9[_0xace2('0x33')]:_0x2db3ed[_0xace2('0x2e')];if(!_0x4f0efc[_0xace2('0x2f')][_0xace2('0x36')](_0xace2('0x37'))){_0x1fbdc9[_0xace2('0x1c')]=qs[_0xace2('0x1c')](_0x4f0efc[_0xace2('0x2f')]['limit']);_0x1fbdc9[_0xace2('0x1e')]=qs[_0xace2('0x1e')](_0x4f0efc[_0xace2('0x2f')][_0xace2('0x1e')]);}_0x1fbdc9[_0xace2('0x38')]=qs[_0xace2('0x39')](_0x4f0efc[_0xace2('0x2f')]['sort']);_0x1fbdc9['where']=qs[_0xace2('0x31')](_['pick'](_0x4f0efc[_0xace2('0x2f')],_0x2db3ed[_0xace2('0x31')]),_0x28e464);if(_0x4f0efc[_0xace2('0x2f')][_0xace2('0x3a')]){_0x1fbdc9['where']=_['merge'](_0x1fbdc9[_0xace2('0x3b')],{'$or':_[_0xace2('0x28')](_0x28e464,function(_0x40ccac){if(_0x40ccac[_0xace2('0x2c')]!==_0xace2('0x3c')){var _0x65398b={};_0x65398b[_0x40ccac[_0xace2('0x27')]]={'$like':'%'+_0x4f0efc[_0xace2('0x2f')][_0xace2('0x3a')]+'%'};return _0x65398b;}})});}_0x1fbdc9=_[_0xace2('0x3d')]({},_0x1fbdc9,_0x4f0efc['options']);var _0x386db1={'where':_0x1fbdc9[_0xace2('0x3b')]};return db['SmsQueueReport'][_0xace2('0x1d')](_0x386db1)[_0xace2('0x24')](function(_0x19f8af){_0x460a72[_0xace2('0x1d')]=_0x19f8af;if(_0x4f0efc['query']['includeAll']){_0x1fbdc9[_0xace2('0x3e')]=[{'all':!![]}];}return db[_0xace2('0x29')][_0xace2('0x3f')](_0x1fbdc9);})[_0xace2('0x24')](function(_0x4c27b5){_0x460a72[_0xace2('0x40')]=_0x4c27b5;return _0x460a72;})[_0xace2('0x24')](respondWithFilteredResult(_0x211e70,_0x1fbdc9))[_0xace2('0x41')](handleError(_0x211e70,null));};exports['show']=function(_0x240d5b,_0x4e036a){var _0x7ec8f5={'raw':!![],'where':{'id':_0x240d5b[_0xace2('0x42')]['id']}},_0x1e8e7c={};_0x1e8e7c[_0xace2('0x2e')]=_[_0xace2('0x30')](db[_0xace2('0x29')]['rawAttributes']);_0x1e8e7c[_0xace2('0x2f')]=_[_0xace2('0x30')](_0x240d5b['query']);_0x1e8e7c['filters']=_['intersection'](_0x1e8e7c[_0xace2('0x2e')],_0x1e8e7c[_0xace2('0x2f')]);_0x7ec8f5[_0xace2('0x33')]=_[_0xace2('0x32')](_0x1e8e7c[_0xace2('0x2e')],qs[_0xace2('0x34')](_0x240d5b['query'][_0xace2('0x34')]));_0x7ec8f5[_0xace2('0x33')]=_0x7ec8f5['attributes']['length']?_0x7ec8f5['attributes']:_0x1e8e7c['model'];if(_0x240d5b[_0xace2('0x2f')][_0xace2('0x43')]){_0x7ec8f5[_0xace2('0x3e')]=[{'all':!![]}];}_0x7ec8f5=_[_0xace2('0x3d')]({},_0x7ec8f5,_0x240d5b[_0xace2('0x44')]);return db[_0xace2('0x29')]['find'](_0x7ec8f5)[_0xace2('0x24')](handleEntityNotFound(_0x4e036a,null))[_0xace2('0x24')](respondWithResult(_0x4e036a,null))[_0xace2('0x41')](handleError(_0x4e036a,null));};exports[_0xace2('0x45')]=function(_0x592a58,_0x1d280d){return db[_0xace2('0x29')][_0xace2('0x45')](_0x592a58[_0xace2('0x46')],{})[_0xace2('0x24')](respondWithResult(_0x1d280d,0xc9))[_0xace2('0x41')](handleError(_0x1d280d,null));};exports[_0xace2('0x23')]=function(_0x7431a5,_0x15c9e5){if(_0x7431a5[_0xace2('0x46')]['id']){delete _0x7431a5[_0xace2('0x46')]['id'];}return db[_0xace2('0x29')][_0xace2('0x47')]({'where':{'id':_0x7431a5[_0xace2('0x42')]['id']}})[_0xace2('0x24')](handleEntityNotFound(_0x15c9e5,null))[_0xace2('0x24')](saveUpdates(_0x7431a5[_0xace2('0x46')],null))[_0xace2('0x24')](respondWithResult(_0x15c9e5,null))[_0xace2('0x41')](handleError(_0x15c9e5,null));};exports[_0xace2('0x48')]=function(_0x267773,_0x649a7c){return db[_0xace2('0x29')]['find']({'where':{'id':_0x267773[_0xace2('0x42')]['id']}})['then'](handleEntityNotFound(_0x649a7c,null))['then'](removeEntity(_0x649a7c,null))['catch'](handleError(_0x649a7c,null));};exports[_0xace2('0x49')]=function(_0x424964,_0x1e225f){return db['SmsQueueReport'][_0xace2('0x49')]()[_0xace2('0x24')](respondWithResult(_0x1e225f,null))[_0xace2('0x41')](handleError(_0x1e225f,null));}; \ No newline at end of file +var _0xef7f=['body','describe','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','options','include','SmsQueueReport','findAll','rows','catch','show','params','length','includeAll','find','create'];(function(_0x4d187c,_0x5b5995){var _0x1d266e=function(_0x5785f0){while(--_0x5785f0){_0x4d187c['push'](_0x4d187c['shift']());}};_0x1d266e(++_0x5b5995);}(_0xef7f,0x179));var _0xfef7=function(_0x96f03d,_0x3c73c2){_0x96f03d=_0x96f03d-0x0;var _0x48e81e=_0xef7f[_0x96f03d];return _0x48e81e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfef7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfef7('0x1'));var rp=require(_0xfef7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfef7('0x3'));var util=require(_0xfef7('0x4'));var path=require('path');var sox=require(_0xfef7('0x5'));var csv=require(_0xfef7('0x6'));var ejs=require(_0xfef7('0x7'));var fs=require('fs');var fs_extra=require(_0xfef7('0x8'));var _=require(_0xfef7('0x9'));var squel=require('squel');var crypto=require(_0xfef7('0xa'));var jsforce=require(_0xfef7('0xb'));var deskjs=require(_0xfef7('0xc'));var toCsv=require(_0xfef7('0x6'));var querystring=require(_0xfef7('0xd'));var Papa=require(_0xfef7('0xe'));var Redis=require(_0xfef7('0xf'));var authService=require(_0xfef7('0x10'));var qs=require(_0xfef7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfef7('0x12'));var logger=require(_0xfef7('0x13'))('api');var utils=require(_0xfef7('0x14'));var config=require(_0xfef7('0x15'));var licenseUtil=require(_0xfef7('0x16'));var db=require(_0xfef7('0x17'))['db'];function respondWithStatusCode(_0x1fd26c,_0x4eb4e8){_0x4eb4e8=_0x4eb4e8||0xcc;return function(_0x2d6c2e){if(_0x2d6c2e){return _0x1fd26c[_0xfef7('0x18')](_0x4eb4e8);}return _0x1fd26c[_0xfef7('0x19')](_0x4eb4e8)[_0xfef7('0x1a')]();};}function respondWithResult(_0x406609,_0x3ab13e){_0x3ab13e=_0x3ab13e||0xc8;return function(_0x35d87c){if(_0x35d87c){return _0x406609[_0xfef7('0x19')](_0x3ab13e)['json'](_0x35d87c);}};}function respondWithFilteredResult(_0x8bda7b,_0x10d5ef){return function(_0x3788b4){if(_0x3788b4){var _0x4f237c=typeof _0x10d5ef[_0xfef7('0x1b')]===_0xfef7('0x1c')&&typeof _0x10d5ef[_0xfef7('0x1d')]===_0xfef7('0x1c');var _0x496713=_0x3788b4[_0xfef7('0x1e')];var _0x4ee2e5=_0x4f237c?0x0:_0x10d5ef[_0xfef7('0x1b')];var _0x44f090=_0x4f237c?_0x3788b4['count']:_0x10d5ef['offset']+_0x10d5ef['limit'];var _0x418050;if(_0x44f090>=_0x496713){_0x44f090=_0x496713;_0x418050=0xc8;}else{_0x418050=0xce;}_0x8bda7b[_0xfef7('0x19')](_0x418050);return _0x8bda7b[_0xfef7('0x1f')](_0xfef7('0x20'),_0x4ee2e5+'-'+_0x44f090+'/'+_0x496713)['json'](_0x3788b4);}return null;};}function patchUpdates(_0x178a90){return function(_0x140d92){try{jsonpatch[_0xfef7('0x21')](_0x140d92,_0x178a90,!![]);}catch(_0x595cc7){return BPromise['reject'](_0x595cc7);}return _0x140d92[_0xfef7('0x22')]();};}function saveUpdates(_0x5aa4ca,_0x544c60){return function(_0x4fbe08){if(_0x4fbe08){return _0x4fbe08[_0xfef7('0x23')](_0x5aa4ca)[_0xfef7('0x24')](function(_0x28cc8b){return _0x28cc8b;});}return null;};}function removeEntity(_0x4251d8,_0x4426c7){return function(_0x14371e){if(_0x14371e){return _0x14371e[_0xfef7('0x25')]()[_0xfef7('0x24')](function(){_0x4251d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x394979,_0x16087a){return function(_0x40ac29){if(!_0x40ac29){_0x394979[_0xfef7('0x18')](0x194);}return _0x40ac29;};}function handleError(_0x525223,_0x342a8d){_0x342a8d=_0x342a8d||0x1f4;return function(_0x5122ee){logger[_0xfef7('0x26')](_0x5122ee[_0xfef7('0x27')]);if(_0x5122ee['name']){delete _0x5122ee[_0xfef7('0x28')];}_0x525223['status'](_0x342a8d)[_0xfef7('0x29')](_0x5122ee);};}exports[_0xfef7('0x2a')]=function(_0x44f1f4,_0x5baeea){var _0x2ce9a9={},_0x1835b3={},_0x41d05e={'count':0x0,'rows':[]};var _0x356354=_['map'](db['SmsQueueReport'][_0xfef7('0x2b')],function(_0x213c41){return{'name':_0x213c41[_0xfef7('0x2c')],'type':_0x213c41[_0xfef7('0x2d')][_0xfef7('0x2e')]};});_0x1835b3['model']=_['map'](_0x356354,'name');_0x1835b3[_0xfef7('0x2f')]=_[_0xfef7('0x30')](_0x44f1f4[_0xfef7('0x2f')]);_0x1835b3['filters']=_[_0xfef7('0x31')](_0x1835b3[_0xfef7('0x32')],_0x1835b3[_0xfef7('0x2f')]);_0x2ce9a9[_0xfef7('0x33')]=_['intersection'](_0x1835b3[_0xfef7('0x32')],qs[_0xfef7('0x34')](_0x44f1f4[_0xfef7('0x2f')]['fields']));_0x2ce9a9[_0xfef7('0x33')]=_0x2ce9a9['attributes']['length']?_0x2ce9a9[_0xfef7('0x33')]:_0x1835b3[_0xfef7('0x32')];if(!_0x44f1f4[_0xfef7('0x2f')][_0xfef7('0x35')]('nolimit')){_0x2ce9a9[_0xfef7('0x1d')]=qs[_0xfef7('0x1d')](_0x44f1f4['query'][_0xfef7('0x1d')]);_0x2ce9a9['offset']=qs['offset'](_0x44f1f4[_0xfef7('0x2f')]['offset']);}_0x2ce9a9[_0xfef7('0x36')]=qs[_0xfef7('0x37')](_0x44f1f4[_0xfef7('0x2f')][_0xfef7('0x37')]);_0x2ce9a9[_0xfef7('0x38')]=qs[_0xfef7('0x39')](_[_0xfef7('0x3a')](_0x44f1f4['query'],_0x1835b3[_0xfef7('0x39')]),_0x356354);if(_0x44f1f4[_0xfef7('0x2f')]['filter']){_0x2ce9a9[_0xfef7('0x38')]=_['merge'](_0x2ce9a9[_0xfef7('0x38')],{'$or':_['map'](_0x356354,function(_0x2fb787){if(_0x2fb787[_0xfef7('0x2d')]!==_0xfef7('0x3b')){var _0x3fc2de={};_0x3fc2de[_0x2fb787[_0xfef7('0x28')]]={'$like':'%'+_0x44f1f4[_0xfef7('0x2f')][_0xfef7('0x3c')]+'%'};return _0x3fc2de;}})});}_0x2ce9a9=_['merge']({},_0x2ce9a9,_0x44f1f4[_0xfef7('0x3d')]);var _0x33c62b={'where':_0x2ce9a9[_0xfef7('0x38')]};return db['SmsQueueReport'][_0xfef7('0x1e')](_0x33c62b)[_0xfef7('0x24')](function(_0x1d4d73){_0x41d05e['count']=_0x1d4d73;if(_0x44f1f4[_0xfef7('0x2f')]['includeAll']){_0x2ce9a9[_0xfef7('0x3e')]=[{'all':!![]}];}return db[_0xfef7('0x3f')][_0xfef7('0x40')](_0x2ce9a9);})[_0xfef7('0x24')](function(_0x33ebc4){_0x41d05e[_0xfef7('0x41')]=_0x33ebc4;return _0x41d05e;})[_0xfef7('0x24')](respondWithFilteredResult(_0x5baeea,_0x2ce9a9))[_0xfef7('0x42')](handleError(_0x5baeea,null));};exports[_0xfef7('0x43')]=function(_0xa140e6,_0x3a330f){var _0x5c14c1={'raw':!![],'where':{'id':_0xa140e6[_0xfef7('0x44')]['id']}},_0x4048f7={};_0x4048f7[_0xfef7('0x32')]=_[_0xfef7('0x30')](db[_0xfef7('0x3f')][_0xfef7('0x2b')]);_0x4048f7[_0xfef7('0x2f')]=_[_0xfef7('0x30')](_0xa140e6[_0xfef7('0x2f')]);_0x4048f7[_0xfef7('0x39')]=_[_0xfef7('0x31')](_0x4048f7[_0xfef7('0x32')],_0x4048f7[_0xfef7('0x2f')]);_0x5c14c1[_0xfef7('0x33')]=_[_0xfef7('0x31')](_0x4048f7['model'],qs[_0xfef7('0x34')](_0xa140e6[_0xfef7('0x2f')][_0xfef7('0x34')]));_0x5c14c1[_0xfef7('0x33')]=_0x5c14c1[_0xfef7('0x33')][_0xfef7('0x45')]?_0x5c14c1[_0xfef7('0x33')]:_0x4048f7[_0xfef7('0x32')];if(_0xa140e6[_0xfef7('0x2f')][_0xfef7('0x46')]){_0x5c14c1[_0xfef7('0x3e')]=[{'all':!![]}];}_0x5c14c1=_['merge']({},_0x5c14c1,_0xa140e6[_0xfef7('0x3d')]);return db[_0xfef7('0x3f')][_0xfef7('0x47')](_0x5c14c1)[_0xfef7('0x24')](handleEntityNotFound(_0x3a330f,null))[_0xfef7('0x24')](respondWithResult(_0x3a330f,null))[_0xfef7('0x42')](handleError(_0x3a330f,null));};exports[_0xfef7('0x48')]=function(_0x231930,_0x58df70){return db[_0xfef7('0x3f')][_0xfef7('0x48')](_0x231930[_0xfef7('0x49')],{})[_0xfef7('0x24')](respondWithResult(_0x58df70,0xc9))[_0xfef7('0x42')](handleError(_0x58df70,null));};exports[_0xfef7('0x23')]=function(_0x28a980,_0x54423a){if(_0x28a980[_0xfef7('0x49')]['id']){delete _0x28a980[_0xfef7('0x49')]['id'];}return db[_0xfef7('0x3f')][_0xfef7('0x47')]({'where':{'id':_0x28a980[_0xfef7('0x44')]['id']}})[_0xfef7('0x24')](handleEntityNotFound(_0x54423a,null))[_0xfef7('0x24')](saveUpdates(_0x28a980[_0xfef7('0x49')],null))[_0xfef7('0x24')](respondWithResult(_0x54423a,null))[_0xfef7('0x42')](handleError(_0x54423a,null));};exports[_0xfef7('0x25')]=function(_0x438e72,_0x4f8e2c){return db['SmsQueueReport'][_0xfef7('0x47')]({'where':{'id':_0x438e72[_0xfef7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f8e2c,null))[_0xfef7('0x24')](removeEntity(_0x4f8e2c,null))[_0xfef7('0x42')](handleError(_0x4f8e2c,null));};exports[_0xfef7('0x4a')]=function(_0x45a6ee,_0x21b660){return db[_0xfef7('0x3f')][_0xfef7('0x4a')]()[_0xfef7('0x24')](respondWithResult(_0x21b660,null))[_0xfef7('0x42')](handleError(_0x21b660,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1ad4d19..7e2654e 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(_0x55dfbc,_0x155b9c){var _0x3ff2f9=function(_0x1e6fde){while(--_0x1e6fde){_0x55dfbc['push'](_0x55dfbc['shift']());}};_0x3ff2f9(++_0x155b9c);}(_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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ede970a..23618d5 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 _0xa4b5=['result','catch','SmsQueueReport','create','body','options','CreateSmsQueueReport','debug','UpdateSmsQueueReport','raw','where','attributes','limit','util','moment','ioredis','../../config/utils','rpc','client','http','request','then','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xa4b5,0x9e));var _0x5a4b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa4b5[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0x5a4b('0x0'));var moment=require(_0x5a4b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a4b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a4b('0x3'));var logger=require('../../config/logger')(_0x5a4b('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a4b('0x5')][_0x5a4b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3b15cf,_0x49d877,_0x4c0505){return new BPromise(function(_0x315d96,_0x36904b){return client[_0x5a4b('0x7')](_0x3b15cf,_0x4c0505)[_0x5a4b('0x8')](function(_0x3ada68){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x49d877,_0x5a4b('0x9'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x49d877,_0x5a4b('0x9'),JSON[_0x5a4b('0xa')](_0x3ada68));if(_0x3ada68[_0x5a4b('0xb')]){if(_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xc')]===0x1f4){logger[_0x5a4b('0xb')](_0x5a4b('0xd'),_0x49d877,_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);return _0x36904b(_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);}logger[_0x5a4b('0xb')](_0x5a4b('0xd'),_0x49d877,_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);return _0x315d96(_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);}else{logger[_0x5a4b('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x49d877,_0x5a4b('0x9'));_0x315d96(_0x3ada68[_0x5a4b('0x10')][_0x5a4b('0xe')]);}})[_0x5a4b('0x11')](function(_0x1a568f){logger[_0x5a4b('0xb')](_0x5a4b('0xd'),_0x49d877,_0x1a568f);_0x36904b(_0x1a568f);});});}exports['CreateSmsQueueReport']=function(_0x3ea908){var _0x379f80=this;return new Promise(function(_0x418b91,_0x22934d){return db[_0x5a4b('0x12')][_0x5a4b('0x13')](_0x3ea908[_0x5a4b('0x14')],{'raw':_0x3ea908[_0x5a4b('0x15')]?_0x3ea908[_0x5a4b('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xce88d5){logger[_0x5a4b('0xf')](_0x5a4b('0x16'),_0x3ea908);logger[_0x5a4b('0x17')]('CreateSmsQueueReport',_0x3ea908,JSON[_0x5a4b('0xa')](_0xce88d5));_0x418b91(_0xce88d5);})[_0x5a4b('0x11')](function(_0x26d6e6){logger[_0x5a4b('0xb')](_0x5a4b('0x16'),_0x26d6e6[_0x5a4b('0xe')],_0x3ea908);_0x22934d(_0x379f80[_0x5a4b('0xb')](0x1f4,_0x26d6e6['message']));});});};exports[_0x5a4b('0x18')]=function(_0x38e984){var _0x524c1b=this;return new Promise(function(_0x4f3e72,_0x519246){return db[_0x5a4b('0x12')]['update'](_0x38e984[_0x5a4b('0x14')],{'raw':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x1a')]||null:null,'attributes':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x1b')]||null:null,'limit':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x1c')]||null:null})[_0x5a4b('0x8')](function(_0x74b215){logger[_0x5a4b('0xf')](_0x5a4b('0x18'),_0x38e984);logger[_0x5a4b('0x17')](_0x5a4b('0x18'),_0x38e984,JSON['stringify'](_0x74b215));_0x4f3e72(_0x74b215);})[_0x5a4b('0x11')](function(_0x47518b){logger[_0x5a4b('0xb')](_0x5a4b('0x18'),_0x47518b[_0x5a4b('0xe')],_0x38e984);_0x519246(_0x524c1b[_0x5a4b('0xb')](0x1f4,_0x47518b['message']));});});}; \ No newline at end of file +var _0x93be=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSmsQueueReport','SmsQueueReport','body','options','debug','UpdateSmsQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0x93be,0x1c7));var _0xe93b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x93be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe93b('0x0'));var util=require(_0xe93b('0x1'));var moment=require(_0xe93b('0x2'));var BPromise=require(_0xe93b('0x3'));var rs=require(_0xe93b('0x4'));var fs=require('fs');var Redis=require(_0xe93b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe93b('0x6'))('rpc');var config=require(_0xe93b('0x7'));var jayson=require(_0xe93b('0x8'));var client=jayson['client'][_0xe93b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43cfa2,_0x34600a,_0x259739){return new BPromise(function(_0x50509c,_0x124fb3){return client[_0xe93b('0xa')](_0x43cfa2,_0x259739)[_0xe93b('0xb')](function(_0x332b82){logger[_0xe93b('0xc')](_0xe93b('0xd'),_0x34600a,_0xe93b('0xe'));logger['debug'](_0xe93b('0xf'),_0x34600a,_0xe93b('0xe'),JSON[_0xe93b('0x10')](_0x332b82));if(_0x332b82[_0xe93b('0x11')]){if(_0x332b82['error']['code']===0x1f4){logger[_0xe93b('0x11')](_0xe93b('0xd'),_0x34600a,_0x332b82['error']['message']);return _0x124fb3(_0x332b82['error'][_0xe93b('0x12')]);}logger[_0xe93b('0x11')](_0xe93b('0xd'),_0x34600a,_0x332b82[_0xe93b('0x11')][_0xe93b('0x12')]);return _0x50509c(_0x332b82[_0xe93b('0x11')][_0xe93b('0x12')]);}else{logger[_0xe93b('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x34600a,'request\x20sent');_0x50509c(_0x332b82[_0xe93b('0x13')][_0xe93b('0x12')]);}})['catch'](function(_0x4d0f9c){logger[_0xe93b('0x11')](_0xe93b('0xd'),_0x34600a,_0x4d0f9c);_0x124fb3(_0x4d0f9c);});});}exports[_0xe93b('0x14')]=function(_0x3ac557){var _0x255e5b=this;return new Promise(function(_0x373b12,_0x1e5a2f){return db[_0xe93b('0x15')]['create'](_0x3ac557[_0xe93b('0x16')],{'raw':_0x3ac557[_0xe93b('0x17')]?_0x3ac557['options']['raw']===undefined?!![]:![]:!![]})[_0xe93b('0xb')](function(_0x412368){logger['info'](_0xe93b('0x14'),_0x3ac557);logger[_0xe93b('0x18')](_0xe93b('0x14'),_0x3ac557,JSON[_0xe93b('0x10')](_0x412368));_0x373b12(_0x412368);})['catch'](function(_0x3fc01d){logger[_0xe93b('0x11')](_0xe93b('0x14'),_0x3fc01d[_0xe93b('0x12')],_0x3ac557);_0x1e5a2f(_0x255e5b['error'](0x1f4,_0x3fc01d['message']));});});};exports[_0xe93b('0x19')]=function(_0x4fd539){var _0x3aba9f=this;return new Promise(function(_0x2beb12,_0x60fd91){return db[_0xe93b('0x15')]['update'](_0x4fd539[_0xe93b('0x16')],{'raw':_0x4fd539[_0xe93b('0x17')]?_0x4fd539[_0xe93b('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fd539['options']?_0x4fd539[_0xe93b('0x17')][_0xe93b('0x1a')]||null:null,'attributes':_0x4fd539[_0xe93b('0x17')]?_0x4fd539['options'][_0xe93b('0x1b')]||null:null,'limit':_0x4fd539[_0xe93b('0x17')]?_0x4fd539['options'][_0xe93b('0x1c')]||null:null})[_0xe93b('0xb')](function(_0x267266){logger[_0xe93b('0xc')]('UpdateSmsQueueReport',_0x4fd539);logger[_0xe93b('0x18')]('UpdateSmsQueueReport',_0x4fd539,JSON[_0xe93b('0x10')](_0x267266));_0x2beb12(_0x267266);})['catch'](function(_0x456a23){logger[_0xe93b('0x11')](_0xe93b('0x19'),_0x456a23['message'],_0x4fd539);_0x60fd91(_0x3aba9f['error'](0x1f4,_0x456a23[_0xe93b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index e4c6776..4bf5d11 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 _0x25fa=['isAuthenticated','index','get','/describe','describe','/:id','post','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x25fa,0x109));var _0xa25f=function(_0x17fabd,_0x40830e){_0x17fabd=_0x17fabd-0x0;var _0x3965fb=_0x25fa[_0x17fabd];return _0x3965fb;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25f('0x6'));router['get']('/',auth[_0xa25f('0x7')](),controller[_0xa25f('0x8')]);router[_0xa25f('0x9')](_0xa25f('0xa'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xb')]);router[_0xa25f('0x9')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['show']);router[_0xa25f('0xd')]('/',auth[_0xa25f('0x7')](),controller['create']);router[_0xa25f('0xe')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xf')]);router['delete'](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['destroy']);module[_0xa25f('0x10')]=router; \ No newline at end of file +var _0x2fed=['path','connect-timeout','express','fs-extra','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2b0cbb,_0x1e08f3){var _0x47e9ad=function(_0x306f3f){while(--_0x306f3f){_0x2b0cbb['push'](_0x2b0cbb['shift']());}};_0x47e9ad(++_0x1e08f3);}(_0x2fed,0x7c));var _0xd2fe=function(_0x24dd3f,_0x4632bb){_0x24dd3f=_0x24dd3f-0x0;var _0x56c79c=_0x2fed[_0x24dd3f];return _0x56c79c;};'use strict';var multer=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var path=require(_0xd2fe('0x2'));var timeout=require(_0xd2fe('0x3'));var express=require(_0xd2fe('0x4'));var router=express['Router']();var fs_extra=require(_0xd2fe('0x5'));var auth=require(_0xd2fe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2fe('0x7'));router[_0xd2fe('0x8')]('/',auth[_0xd2fe('0x9')](),controller['index']);router[_0xd2fe('0x8')](_0xd2fe('0xa'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xb')]);router['get'](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xd')]);router[_0xd2fe('0xe')]('/',auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xf')]);router[_0xd2fe('0x10')](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x11')]);router[_0xd2fe('0x12')](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x13')]);module[_0xd2fe('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4891a58..1c08b06 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x9bde,0xe1));var _0xe9bd=function(_0x117282,_0x4b98d2){_0x117282=_0x117282-0x0;var _0x546b46=_0x9bde[_0x117282];return _0x546b46;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x6bfe16,_0x4c6b4a){var _0x195da8=function(_0x1e5607){while(--_0x1e5607){_0x6bfe16['push'](_0x6bfe16['shift']());}};_0x195da8(++_0x4c6b4a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0xf3cd[_0x28b0a1];return _0x21470c;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index bd024b4..1933e87 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 _0xc85c=['send','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x1a6f6b,_0x423c2c){var _0x18c73c=function(_0x4d2f9c){while(--_0x4d2f9c){_0x1a6f6b['push'](_0x1a6f6b['shift']());}};_0x18c73c(++_0x423c2c);}(_0xc85c,0x155));var _0xcc85=function(_0x5c6a78,_0x5c0503){_0x5c6a78=_0x5c6a78-0x0;var _0x236c5e=_0xc85c[_0x5c6a78];return _0x236c5e;};'use strict';var emlformat=require(_0xcc85('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc85('0x1'));var jsonpatch=require(_0xcc85('0x2'));var rp=require(_0xcc85('0x3'));var moment=require(_0xcc85('0x4'));var BPromise=require(_0xcc85('0x5'));var Mustache=require(_0xcc85('0x6'));var util=require('util');var path=require(_0xcc85('0x7'));var sox=require(_0xcc85('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc85('0x9'));var _=require(_0xcc85('0xa'));var squel=require(_0xcc85('0xb'));var crypto=require(_0xcc85('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcc85('0xd'));var toCsv=require(_0xcc85('0xe'));var querystring=require(_0xcc85('0xf'));var Papa=require(_0xcc85('0x10'));var Redis=require(_0xcc85('0x11'));var authService=require(_0xcc85('0x12'));var qs=require(_0xcc85('0x13'));var as=require(_0xcc85('0x14'));var hardwareService=require(_0xcc85('0x15'));var logger=require(_0xcc85('0x16'))(_0xcc85('0x17'));var utils=require('../../config/utils');var config=require(_0xcc85('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc85('0x19'))['db'];function respondWithStatusCode(_0x38d7b0,_0x3eb9fb){_0x3eb9fb=_0x3eb9fb||0xcc;return function(_0x3c37e4){if(_0x3c37e4){return _0x38d7b0[_0xcc85('0x1a')](_0x3eb9fb);}return _0x38d7b0[_0xcc85('0x1b')](_0x3eb9fb)[_0xcc85('0x1c')]();};}function respondWithResult(_0x2dbccd,_0x3934b4){_0x3934b4=_0x3934b4||0xc8;return function(_0x323a41){if(_0x323a41){return _0x2dbccd['status'](_0x3934b4)[_0xcc85('0x1d')](_0x323a41);}};}function respondWithFilteredResult(_0x5187cf,_0x1421d8){return function(_0x52d123){if(_0x52d123){var _0x13c507=typeof _0x1421d8[_0xcc85('0x1e')]===_0xcc85('0x1f')&&typeof _0x1421d8[_0xcc85('0x20')]===_0xcc85('0x1f');var _0x3b5de6=_0x52d123[_0xcc85('0x21')];var _0x321bd2=_0x13c507?0x0:_0x1421d8[_0xcc85('0x1e')];var _0x2a57d0=_0x13c507?_0x52d123[_0xcc85('0x21')]:_0x1421d8['offset']+_0x1421d8[_0xcc85('0x20')];var _0x31565d;if(_0x2a57d0>=_0x3b5de6){_0x2a57d0=_0x3b5de6;_0x31565d=0xc8;}else{_0x31565d=0xce;}_0x5187cf['status'](_0x31565d);return _0x5187cf[_0xcc85('0x22')](_0xcc85('0x23'),_0x321bd2+'-'+_0x2a57d0+'/'+_0x3b5de6)[_0xcc85('0x1d')](_0x52d123);}return null;};}function patchUpdates(_0x3b7b67){return function(_0x2ebb8a){try{jsonpatch['apply'](_0x2ebb8a,_0x3b7b67,!![]);}catch(_0x4e7ed8){return BPromise[_0xcc85('0x24')](_0x4e7ed8);}return _0x2ebb8a[_0xcc85('0x25')]();};}function saveUpdates(_0x516252,_0x529ec8){return function(_0x56391a){if(_0x56391a){return _0x56391a[_0xcc85('0x26')](_0x516252)[_0xcc85('0x27')](function(_0x2be892){return _0x2be892;});}return null;};}function removeEntity(_0x1109c3,_0x52539f){return function(_0x14df17){if(_0x14df17){return _0x14df17[_0xcc85('0x28')]()[_0xcc85('0x27')](function(){_0x1109c3['status'](0xcc)[_0xcc85('0x1c')]();});}};}function handleEntityNotFound(_0xaaff66,_0x1cc652){return function(_0x4e595d){if(!_0x4e595d){_0xaaff66[_0xcc85('0x1a')](0x194);}return _0x4e595d;};}function handleError(_0xd1f3c1,_0x8af74c){_0x8af74c=_0x8af74c||0x1f4;return function(_0x4aba04){logger[_0xcc85('0x29')](_0x4aba04[_0xcc85('0x2a')]);if(_0x4aba04[_0xcc85('0x2b')]){delete _0x4aba04[_0xcc85('0x2b')];}_0xd1f3c1[_0xcc85('0x1b')](_0x8af74c)[_0xcc85('0x2c')](_0x4aba04);};}exports['index']=function(_0x213266,_0x525375){var _0x1f1d23={},_0x4004f5={},_0x579eb7={'count':0x0,'rows':[]};var _0x2f16f1=_['map'](db[_0xcc85('0x2d')][_0xcc85('0x2e')],function(_0x2884df){return{'name':_0x2884df['fieldName'],'type':_0x2884df[_0xcc85('0x2f')][_0xcc85('0x30')]};});_0x4004f5[_0xcc85('0x31')]=_['map'](_0x2f16f1,'name');_0x4004f5[_0xcc85('0x32')]=_[_0xcc85('0x33')](_0x213266[_0xcc85('0x32')]);_0x4004f5[_0xcc85('0x34')]=_[_0xcc85('0x35')](_0x4004f5[_0xcc85('0x31')],_0x4004f5[_0xcc85('0x32')]);_0x1f1d23['attributes']=_[_0xcc85('0x35')](_0x4004f5['model'],qs['fields'](_0x213266[_0xcc85('0x32')][_0xcc85('0x36')]));_0x1f1d23['attributes']=_0x1f1d23[_0xcc85('0x37')][_0xcc85('0x38')]?_0x1f1d23[_0xcc85('0x37')]:_0x4004f5[_0xcc85('0x31')];if(!_0x213266[_0xcc85('0x32')][_0xcc85('0x39')](_0xcc85('0x3a'))){_0x1f1d23[_0xcc85('0x20')]=qs[_0xcc85('0x20')](_0x213266[_0xcc85('0x32')]['limit']);_0x1f1d23['offset']=qs['offset'](_0x213266[_0xcc85('0x32')][_0xcc85('0x1e')]);}_0x1f1d23['order']=qs[_0xcc85('0x3b')](_0x213266[_0xcc85('0x32')][_0xcc85('0x3b')]);_0x1f1d23[_0xcc85('0x3c')]=qs[_0xcc85('0x34')](_[_0xcc85('0x3d')](_0x213266[_0xcc85('0x32')],_0x4004f5[_0xcc85('0x34')]),_0x2f16f1);if(_0x213266['query']['filter']){_0x1f1d23[_0xcc85('0x3c')]=_[_0xcc85('0x3e')](_0x1f1d23['where'],{'$or':_[_0xcc85('0x3f')](_0x2f16f1,function(_0x605959){if(_0x605959[_0xcc85('0x2f')]!=='VIRTUAL'){var _0x5d4900={};_0x5d4900[_0x605959['name']]={'$like':'%'+_0x213266['query'][_0xcc85('0x40')]+'%'};return _0x5d4900;}})});}_0x1f1d23=_['merge']({},_0x1f1d23,_0x213266['options']);var _0x58ad39={'where':_0x1f1d23[_0xcc85('0x3c')]};return db['SmsTransferReport'][_0xcc85('0x21')](_0x58ad39)['then'](function(_0x2502e2){_0x579eb7[_0xcc85('0x21')]=_0x2502e2;if(_0x213266['query'][_0xcc85('0x41')]){_0x1f1d23['include']=[{'all':!![]}];}return db[_0xcc85('0x2d')][_0xcc85('0x42')](_0x1f1d23);})[_0xcc85('0x27')](function(_0x54df1d){_0x579eb7[_0xcc85('0x43')]=_0x54df1d;return _0x579eb7;})[_0xcc85('0x27')](respondWithFilteredResult(_0x525375,_0x1f1d23))[_0xcc85('0x44')](handleError(_0x525375,null));};exports[_0xcc85('0x45')]=function(_0x35f6e4,_0x616047){var _0x5df4c1={'raw':!![],'where':{'id':_0x35f6e4[_0xcc85('0x46')]['id']}},_0x570af3={};_0x570af3[_0xcc85('0x31')]=_[_0xcc85('0x33')](db['SmsTransferReport']['rawAttributes']);_0x570af3[_0xcc85('0x32')]=_['keys'](_0x35f6e4['query']);_0x570af3[_0xcc85('0x34')]=_[_0xcc85('0x35')](_0x570af3['model'],_0x570af3[_0xcc85('0x32')]);_0x5df4c1[_0xcc85('0x37')]=_[_0xcc85('0x35')](_0x570af3[_0xcc85('0x31')],qs[_0xcc85('0x36')](_0x35f6e4['query']['fields']));_0x5df4c1[_0xcc85('0x37')]=_0x5df4c1[_0xcc85('0x37')][_0xcc85('0x38')]?_0x5df4c1[_0xcc85('0x37')]:_0x570af3[_0xcc85('0x31')];if(_0x35f6e4[_0xcc85('0x32')][_0xcc85('0x41')]){_0x5df4c1[_0xcc85('0x47')]=[{'all':!![]}];}_0x5df4c1=_[_0xcc85('0x3e')]({},_0x5df4c1,_0x35f6e4[_0xcc85('0x48')]);return db[_0xcc85('0x2d')][_0xcc85('0x49')](_0x5df4c1)[_0xcc85('0x27')](handleEntityNotFound(_0x616047,null))[_0xcc85('0x27')](respondWithResult(_0x616047,null))[_0xcc85('0x44')](handleError(_0x616047,null));};exports[_0xcc85('0x4a')]=function(_0x15ded8,_0x423558){return db[_0xcc85('0x2d')][_0xcc85('0x4a')](_0x15ded8[_0xcc85('0x4b')],{})[_0xcc85('0x27')](respondWithResult(_0x423558,0xc9))[_0xcc85('0x44')](handleError(_0x423558,null));};exports[_0xcc85('0x26')]=function(_0x4dff94,_0x30d30e){if(_0x4dff94[_0xcc85('0x4b')]['id']){delete _0x4dff94['body']['id'];}return db[_0xcc85('0x2d')]['find']({'where':{'id':_0x4dff94[_0xcc85('0x46')]['id']}})[_0xcc85('0x27')](handleEntityNotFound(_0x30d30e,null))[_0xcc85('0x27')](saveUpdates(_0x4dff94[_0xcc85('0x4b')],null))[_0xcc85('0x27')](respondWithResult(_0x30d30e,null))['catch'](handleError(_0x30d30e,null));};exports[_0xcc85('0x28')]=function(_0x3382f8,_0x469f7a){return db[_0xcc85('0x2d')][_0xcc85('0x49')]({'where':{'id':_0x3382f8[_0xcc85('0x46')]['id']}})[_0xcc85('0x27')](handleEntityNotFound(_0x469f7a,null))[_0xcc85('0x27')](removeEntity(_0x469f7a,null))['catch'](handleError(_0x469f7a,null));};exports['describe']=function(_0x159771,_0x26c0d8){return db[_0xcc85('0x2d')][_0xcc85('0x4c')]()['then'](respondWithResult(_0x26c0d8,null))[_0xcc85('0x44')](handleError(_0x26c0d8,null));}; \ No newline at end of file +var _0xf7f6=['keys','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','pick','merge','filter','options','includeAll','include','SmsTransferReport','findAll','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query'];(function(_0x35f46d,_0x1887ef){var _0x3409b5=function(_0x5f52b7){while(--_0x5f52b7){_0x35f46d['push'](_0x35f46d['shift']());}};_0x3409b5(++_0x1887ef);}(_0xf7f6,0x147));var _0x6f7f=function(_0x56b274,_0x3614f5){_0x56b274=_0x56b274-0x0;var _0x3edc9f=_0xf7f6[_0x56b274];return _0x3edc9f;};'use strict';var emlformat=require(_0x6f7f('0x0'));var rimraf=require(_0x6f7f('0x1'));var zipdir=require(_0x6f7f('0x2'));var jsonpatch=require(_0x6f7f('0x3'));var rp=require(_0x6f7f('0x4'));var moment=require(_0x6f7f('0x5'));var BPromise=require(_0x6f7f('0x6'));var Mustache=require(_0x6f7f('0x7'));var util=require('util');var path=require(_0x6f7f('0x8'));var sox=require(_0x6f7f('0x9'));var csv=require(_0x6f7f('0xa'));var ejs=require(_0x6f7f('0xb'));var fs=require('fs');var fs_extra=require(_0x6f7f('0xc'));var _=require(_0x6f7f('0xd'));var squel=require(_0x6f7f('0xe'));var crypto=require(_0x6f7f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6f7f('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6f7f('0x11'));var Redis=require(_0x6f7f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6f7f('0x13'));var as=require(_0x6f7f('0x14'));var hardwareService=require(_0x6f7f('0x15'));var logger=require(_0x6f7f('0x16'))(_0x6f7f('0x17'));var utils=require(_0x6f7f('0x18'));var config=require(_0x6f7f('0x19'));var licenseUtil=require(_0x6f7f('0x1a'));var db=require(_0x6f7f('0x1b'))['db'];function respondWithStatusCode(_0xfb4c91,_0x1fa981){_0x1fa981=_0x1fa981||0xcc;return function(_0x13bc50){if(_0x13bc50){return _0xfb4c91[_0x6f7f('0x1c')](_0x1fa981);}return _0xfb4c91[_0x6f7f('0x1d')](_0x1fa981)[_0x6f7f('0x1e')]();};}function respondWithResult(_0x28bdc8,_0x1f34ea){_0x1f34ea=_0x1f34ea||0xc8;return function(_0x7c9f79){if(_0x7c9f79){return _0x28bdc8[_0x6f7f('0x1d')](_0x1f34ea)[_0x6f7f('0x1f')](_0x7c9f79);}};}function respondWithFilteredResult(_0x572781,_0x553455){return function(_0x59dadc){if(_0x59dadc){var _0x2c8de1=typeof _0x553455[_0x6f7f('0x20')]==='undefined'&&typeof _0x553455['limit']===_0x6f7f('0x21');var _0x54e8cb=_0x59dadc[_0x6f7f('0x22')];var _0x13326d=_0x2c8de1?0x0:_0x553455[_0x6f7f('0x20')];var _0x371c4c=_0x2c8de1?_0x59dadc['count']:_0x553455[_0x6f7f('0x20')]+_0x553455[_0x6f7f('0x23')];var _0x80028a;if(_0x371c4c>=_0x54e8cb){_0x371c4c=_0x54e8cb;_0x80028a=0xc8;}else{_0x80028a=0xce;}_0x572781[_0x6f7f('0x1d')](_0x80028a);return _0x572781[_0x6f7f('0x24')](_0x6f7f('0x25'),_0x13326d+'-'+_0x371c4c+'/'+_0x54e8cb)[_0x6f7f('0x1f')](_0x59dadc);}return null;};}function patchUpdates(_0x2b5016){return function(_0x266611){try{jsonpatch['apply'](_0x266611,_0x2b5016,!![]);}catch(_0x164d96){return BPromise[_0x6f7f('0x26')](_0x164d96);}return _0x266611[_0x6f7f('0x27')]();};}function saveUpdates(_0x32a0ce,_0x290d5f){return function(_0x551b50){if(_0x551b50){return _0x551b50[_0x6f7f('0x28')](_0x32a0ce)[_0x6f7f('0x29')](function(_0x21fc21){return _0x21fc21;});}return null;};}function removeEntity(_0x79646d,_0x41cb4a){return function(_0xb87a3c){if(_0xb87a3c){return _0xb87a3c[_0x6f7f('0x2a')]()[_0x6f7f('0x29')](function(){_0x79646d[_0x6f7f('0x1d')](0xcc)[_0x6f7f('0x1e')]();});}};}function handleEntityNotFound(_0x21ae48,_0x4e0d0c){return function(_0x24337a){if(!_0x24337a){_0x21ae48[_0x6f7f('0x1c')](0x194);}return _0x24337a;};}function handleError(_0x23981f,_0x186205){_0x186205=_0x186205||0x1f4;return function(_0x42fd97){logger[_0x6f7f('0x2b')](_0x42fd97[_0x6f7f('0x2c')]);if(_0x42fd97[_0x6f7f('0x2d')]){delete _0x42fd97[_0x6f7f('0x2d')];}_0x23981f[_0x6f7f('0x1d')](_0x186205)[_0x6f7f('0x2e')](_0x42fd97);};}exports[_0x6f7f('0x2f')]=function(_0x45672e,_0x4f8e32){var _0x13d352={},_0x1e5c22={},_0x78037b={'count':0x0,'rows':[]};var _0x405322=_[_0x6f7f('0x30')](db['SmsTransferReport']['rawAttributes'],function(_0x4a4e24){return{'name':_0x4a4e24[_0x6f7f('0x31')],'type':_0x4a4e24[_0x6f7f('0x32')]['key']};});_0x1e5c22[_0x6f7f('0x33')]=_[_0x6f7f('0x30')](_0x405322,_0x6f7f('0x2d'));_0x1e5c22[_0x6f7f('0x34')]=_[_0x6f7f('0x35')](_0x45672e['query']);_0x1e5c22['filters']=_[_0x6f7f('0x36')](_0x1e5c22[_0x6f7f('0x33')],_0x1e5c22[_0x6f7f('0x34')]);_0x13d352['attributes']=_[_0x6f7f('0x36')](_0x1e5c22[_0x6f7f('0x33')],qs[_0x6f7f('0x37')](_0x45672e[_0x6f7f('0x34')]['fields']));_0x13d352['attributes']=_0x13d352[_0x6f7f('0x38')][_0x6f7f('0x39')]?_0x13d352[_0x6f7f('0x38')]:_0x1e5c22[_0x6f7f('0x33')];if(!_0x45672e[_0x6f7f('0x34')][_0x6f7f('0x3a')]('nolimit')){_0x13d352['limit']=qs[_0x6f7f('0x23')](_0x45672e[_0x6f7f('0x34')][_0x6f7f('0x23')]);_0x13d352[_0x6f7f('0x20')]=qs['offset'](_0x45672e['query']['offset']);}_0x13d352[_0x6f7f('0x3b')]=qs['sort'](_0x45672e[_0x6f7f('0x34')]['sort']);_0x13d352[_0x6f7f('0x3c')]=qs[_0x6f7f('0x3d')](_[_0x6f7f('0x3e')](_0x45672e['query'],_0x1e5c22[_0x6f7f('0x3d')]),_0x405322);if(_0x45672e[_0x6f7f('0x34')]['filter']){_0x13d352[_0x6f7f('0x3c')]=_[_0x6f7f('0x3f')](_0x13d352[_0x6f7f('0x3c')],{'$or':_[_0x6f7f('0x30')](_0x405322,function(_0x1a9577){if(_0x1a9577['type']!=='VIRTUAL'){var _0x13c5f9={};_0x13c5f9[_0x1a9577[_0x6f7f('0x2d')]]={'$like':'%'+_0x45672e['query'][_0x6f7f('0x40')]+'%'};return _0x13c5f9;}})});}_0x13d352=_['merge']({},_0x13d352,_0x45672e[_0x6f7f('0x41')]);var _0x326b71={'where':_0x13d352[_0x6f7f('0x3c')]};return db['SmsTransferReport'][_0x6f7f('0x22')](_0x326b71)[_0x6f7f('0x29')](function(_0x3b4ef4){_0x78037b[_0x6f7f('0x22')]=_0x3b4ef4;if(_0x45672e[_0x6f7f('0x34')][_0x6f7f('0x42')]){_0x13d352[_0x6f7f('0x43')]=[{'all':!![]}];}return db[_0x6f7f('0x44')][_0x6f7f('0x45')](_0x13d352);})[_0x6f7f('0x29')](function(_0x5799b7){_0x78037b['rows']=_0x5799b7;return _0x78037b;})[_0x6f7f('0x29')](respondWithFilteredResult(_0x4f8e32,_0x13d352))['catch'](handleError(_0x4f8e32,null));};exports['show']=function(_0x50021a,_0x5cbe40){var _0xefbb27={'raw':!![],'where':{'id':_0x50021a[_0x6f7f('0x46')]['id']}},_0x4e93de={};_0x4e93de[_0x6f7f('0x33')]=_[_0x6f7f('0x35')](db[_0x6f7f('0x44')]['rawAttributes']);_0x4e93de[_0x6f7f('0x34')]=_[_0x6f7f('0x35')](_0x50021a['query']);_0x4e93de[_0x6f7f('0x3d')]=_[_0x6f7f('0x36')](_0x4e93de[_0x6f7f('0x33')],_0x4e93de[_0x6f7f('0x34')]);_0xefbb27['attributes']=_[_0x6f7f('0x36')](_0x4e93de[_0x6f7f('0x33')],qs[_0x6f7f('0x37')](_0x50021a['query'][_0x6f7f('0x37')]));_0xefbb27[_0x6f7f('0x38')]=_0xefbb27[_0x6f7f('0x38')][_0x6f7f('0x39')]?_0xefbb27[_0x6f7f('0x38')]:_0x4e93de[_0x6f7f('0x33')];if(_0x50021a[_0x6f7f('0x34')]['includeAll']){_0xefbb27[_0x6f7f('0x43')]=[{'all':!![]}];}_0xefbb27=_[_0x6f7f('0x3f')]({},_0xefbb27,_0x50021a[_0x6f7f('0x41')]);return db[_0x6f7f('0x44')][_0x6f7f('0x47')](_0xefbb27)[_0x6f7f('0x29')](handleEntityNotFound(_0x5cbe40,null))[_0x6f7f('0x29')](respondWithResult(_0x5cbe40,null))[_0x6f7f('0x48')](handleError(_0x5cbe40,null));};exports[_0x6f7f('0x49')]=function(_0x38c049,_0x1b32c5){return db[_0x6f7f('0x44')][_0x6f7f('0x49')](_0x38c049[_0x6f7f('0x4a')],{})[_0x6f7f('0x29')](respondWithResult(_0x1b32c5,0xc9))[_0x6f7f('0x48')](handleError(_0x1b32c5,null));};exports[_0x6f7f('0x28')]=function(_0x54e0f2,_0x2e38af){if(_0x54e0f2['body']['id']){delete _0x54e0f2[_0x6f7f('0x4a')]['id'];}return db[_0x6f7f('0x44')][_0x6f7f('0x47')]({'where':{'id':_0x54e0f2[_0x6f7f('0x46')]['id']}})[_0x6f7f('0x29')](handleEntityNotFound(_0x2e38af,null))[_0x6f7f('0x29')](saveUpdates(_0x54e0f2[_0x6f7f('0x4a')],null))['then'](respondWithResult(_0x2e38af,null))[_0x6f7f('0x48')](handleError(_0x2e38af,null));};exports['destroy']=function(_0x42bc01,_0x5e1f30){return db['SmsTransferReport'][_0x6f7f('0x47')]({'where':{'id':_0x42bc01[_0x6f7f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e1f30,null))[_0x6f7f('0x29')](removeEntity(_0x5e1f30,null))[_0x6f7f('0x48')](handleError(_0x5e1f30,null));};exports[_0x6f7f('0x4b')]=function(_0x38eb2f,_0x59fb23){return db[_0x6f7f('0x44')][_0x6f7f('0x4b')]()[_0x6f7f('0x29')](respondWithResult(_0x59fb23,null))['catch'](handleError(_0x59fb23,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e73211b..9da82cb 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 _0x9a3b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','SmsTransferReport','report_sms_transfer','lodash'];(function(_0x78a8f4,_0x259809){var _0x2b3291=function(_0x5e64ca){while(--_0x5e64ca){_0x78a8f4['push'](_0x78a8f4['shift']());}};_0x2b3291(++_0x259809);}(_0x9a3b,0x83));var _0xb9a3=function(_0xfebe8f,_0x54af65){_0xfebe8f=_0xfebe8f-0x0;var _0x4c33a5=_0x9a3b[_0xfebe8f];return _0x4c33a5;};'use strict';var _=require(_0xb9a3('0x0'));var util=require('util');var logger=require(_0xb9a3('0x1'))(_0xb9a3('0x2'));var moment=require(_0xb9a3('0x3'));var BPromise=require(_0xb9a3('0x4'));var rp=require(_0xb9a3('0x5'));var fs=require('fs');var path=require(_0xb9a3('0x6'));var rimraf=require('rimraf');var config=require(_0xb9a3('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xb9a3('0x8')]=function(_0xcd65fa,_0x3093c0){return _0xcd65fa['define'](_0xb9a3('0x9'),attributes,{'tableName':_0xb9a3('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa459=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xa459,0x1d8));var _0x9a45=function(_0x31a65,_0x7eb34b){_0x31a65=_0x31a65-0x0;var _0x1f4c96=_0xa459[_0x31a65];return _0x1f4c96;};'use strict';var _=require(_0x9a45('0x0'));var util=require(_0x9a45('0x1'));var logger=require(_0x9a45('0x2'))(_0x9a45('0x3'));var moment=require(_0x9a45('0x4'));var BPromise=require(_0x9a45('0x5'));var rp=require(_0x9a45('0x6'));var fs=require('fs');var path=require(_0x9a45('0x7'));var rimraf=require(_0x9a45('0x8'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x257f0a,_0x5bab55){return _0x257f0a[_0x9a45('0x9')](_0x9a45('0xa'),attributes,{'tableName':_0x9a45('0xb'),'paranoid':![],'indexes':[{'name':_0x9a45('0xc'),'fields':[_0x9a45('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index c7b7d14..c05c9f0 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 _0x75a2=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','then'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x75a2,0x187));var _0x275a=function(_0x2e0510,_0x3189fe){_0x2e0510=_0x2e0510-0x0;var _0x3a6cd6=_0x75a2[_0x2e0510];return _0x3a6cd6;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require('bluebird');var rs=require(_0x275a('0x3'));var fs=require('fs');var Redis=require(_0x275a('0x4'));var db=require(_0x275a('0x5'))['db'];var utils=require(_0x275a('0x6'));var logger=require('../../config/logger')(_0x275a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32f0cb,_0x12cad9,_0x17ad5e){return new BPromise(function(_0x38b303,_0x525950){return client['request'](_0x32f0cb,_0x17ad5e)[_0x275a('0x8')](function(_0x46f9c7){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x12cad9,'request\x20sent');logger[_0x275a('0x9')](_0x275a('0xa'),_0x12cad9,_0x275a('0xb'),JSON[_0x275a('0xc')](_0x46f9c7));if(_0x46f9c7[_0x275a('0xd')]){if(_0x46f9c7[_0x275a('0xd')][_0x275a('0xe')]===0x1f4){logger[_0x275a('0xd')](_0x275a('0xf'),_0x12cad9,_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);return _0x525950(_0x46f9c7['error'][_0x275a('0x10')]);}logger[_0x275a('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x12cad9,_0x46f9c7['error'][_0x275a('0x10')]);return _0x38b303(_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);}else{logger[_0x275a('0x11')](_0x275a('0xf'),_0x12cad9,_0x275a('0xb'));_0x38b303(_0x46f9c7[_0x275a('0x12')][_0x275a('0x10')]);}})[_0x275a('0x13')](function(_0x58e54d){logger['error'](_0x275a('0xf'),_0x12cad9,_0x58e54d);_0x525950(_0x58e54d);});});} \ No newline at end of file +var _0x06f4=['error','message','info','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4718d9,_0x15a308){var _0x31fc60=function(_0x8b85ad){while(--_0x8b85ad){_0x4718d9['push'](_0x4718d9['shift']());}};_0x31fc60(++_0x15a308);}(_0x06f4,0x136));var _0x406f=function(_0x335bad,_0x53bc49){_0x335bad=_0x335bad-0x0;var _0x522dcb=_0x06f4[_0x335bad];return _0x522dcb;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var moment=require('moment');var BPromise=require(_0x406f('0x2'));var rs=require(_0x406f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x406f('0x4'));var logger=require('../../config/logger')(_0x406f('0x5'));var config=require(_0x406f('0x6'));var jayson=require(_0x406f('0x7'));var client=jayson[_0x406f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d2886,_0x5bec4f,_0x1afec4){return new BPromise(function(_0x1c39ce,_0xc2f682){return client['request'](_0x1d2886,_0x1afec4)[_0x406f('0x9')](function(_0x52bad2){logger['info'](_0x406f('0xa'),_0x5bec4f,'request\x20sent');logger[_0x406f('0xb')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5bec4f,_0x406f('0xc'),JSON['stringify'](_0x52bad2));if(_0x52bad2[_0x406f('0xd')]){if(_0x52bad2[_0x406f('0xd')]['code']===0x1f4){logger[_0x406f('0xd')](_0x406f('0xa'),_0x5bec4f,_0x52bad2[_0x406f('0xd')][_0x406f('0xe')]);return _0xc2f682(_0x52bad2[_0x406f('0xd')][_0x406f('0xe')]);}logger[_0x406f('0xd')](_0x406f('0xa'),_0x5bec4f,_0x52bad2[_0x406f('0xd')][_0x406f('0xe')]);return _0x1c39ce(_0x52bad2[_0x406f('0xd')]['message']);}else{logger[_0x406f('0xf')](_0x406f('0xa'),_0x5bec4f,_0x406f('0xc'));_0x1c39ce(_0x52bad2['result'][_0x406f('0xe')]);}})[_0x406f('0x10')](function(_0x4dfbc1){logger['error'](_0x406f('0xa'),_0x5bec4f,_0x4dfbc1);_0xc2f682(_0x4dfbc1);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9a61e73..471bbf5 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 _0x4244=['get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./sound.controller'];(function(_0x53ebc7,_0x4550cd){var _0x3af577=function(_0x4c0306){while(--_0x4c0306){_0x53ebc7['push'](_0x53ebc7['shift']());}};_0x3af577(++_0x4550cd);}(_0x4244,0xc3));var _0x4424=function(_0x1611f9,_0xddc39c){_0x1611f9=_0x1611f9-0x0;var _0x1d066d=_0x4244[_0x1611f9];return _0x1d066d;};'use strict';var multer=require(_0x4424('0x0'));var util=require(_0x4424('0x1'));var path=require(_0x4424('0x2'));var timeout=require('connect-timeout');var express=require(_0x4424('0x3'));var router=express[_0x4424('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4424('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4424('0x6'));var controller=require(_0x4424('0x7'));router[_0x4424('0x8')]('/',auth[_0x4424('0x9')](),controller['index']);router[_0x4424('0x8')](_0x4424('0xa'),auth[_0x4424('0x9')](),controller[_0x4424('0xb')]);router[_0x4424('0x8')](_0x4424('0xc'),auth[_0x4424('0x9')](),controller[_0x4424('0xd')]);var upload=multer({'storage':multer[_0x4424('0xe')]({'destination':function(_0x498a08,_0xdfbef5,_0x142663){_0x142663(null,path[_0x4424('0xf')](config[_0x4424('0x10')],_0x4424('0x11')));},'filename':function(_0x315c18,_0x41649d,_0x5a841c){_0x41649d['originalname']=_0x41649d[_0x4424('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a841c(null,util[_0x4424('0x13')](_0x4424('0x14'),path[_0x4424('0x15')](_0x41649d[_0x4424('0x12')],path[_0x4424('0x16')](_0x41649d['originalname'])),Date[_0x4424('0x17')](),path[_0x4424('0x16')](_0x41649d['originalname'])));}})});router['post']('/',upload['single']('file'),controller[_0x4424('0x18')]);router[_0x4424('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x4424('0x1a')]);router['delete']('/:id',auth[_0x4424('0x9')](),controller[_0x4424('0x1b')]);module[_0x4424('0x1c')]=router; \ No newline at end of file +var _0x9c8a=['/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','file','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get'];(function(_0x4700a6,_0x1892a1){var _0x4975a5=function(_0x297412){while(--_0x297412){_0x4700a6['push'](_0x4700a6['shift']());}};_0x4975a5(++_0x1892a1);}(_0x9c8a,0x1a6));var _0xa9c8=function(_0x1e3bc7,_0x229dcf){_0x1e3bc7=_0x1e3bc7-0x0;var _0x43051a=_0x9c8a[_0x1e3bc7];return _0x43051a;};'use strict';var multer=require(_0xa9c8('0x0'));var util=require(_0xa9c8('0x1'));var path=require(_0xa9c8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa9c8('0x3')]();var fs_extra=require(_0xa9c8('0x4'));var auth=require(_0xa9c8('0x5'));var interaction=require(_0xa9c8('0x6'));var config=require(_0xa9c8('0x7'));var controller=require(_0xa9c8('0x8'));router['get']('/',auth[_0xa9c8('0x9')](),controller[_0xa9c8('0xa')]);router[_0xa9c8('0xb')](_0xa9c8('0xc'),auth['isAuthenticated'](),controller[_0xa9c8('0xd')]);router[_0xa9c8('0xb')](_0xa9c8('0xe'),auth[_0xa9c8('0x9')](),controller[_0xa9c8('0xf')]);var upload=multer({'storage':multer[_0xa9c8('0x10')]({'destination':function(_0x416c3,_0x451ad9,_0x269345){_0x269345(null,path[_0xa9c8('0x11')](config[_0xa9c8('0x12')],_0xa9c8('0x13')));},'filename':function(_0x370c9d,_0x2dde25,_0x1642ca){_0x2dde25[_0xa9c8('0x14')]=_0x2dde25[_0xa9c8('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1642ca(null,util[_0xa9c8('0x15')](_0xa9c8('0x16'),path[_0xa9c8('0x17')](_0x2dde25[_0xa9c8('0x14')],path[_0xa9c8('0x18')](_0x2dde25['originalname'])),Date[_0xa9c8('0x19')](),path['extname'](_0x2dde25[_0xa9c8('0x14')])));}})});router['post']('/',upload['single'](_0xa9c8('0x1a')),controller['create']);router[_0xa9c8('0x1b')](_0xa9c8('0xc'),auth[_0xa9c8('0x9')](),controller[_0xa9c8('0x1c')]);router[_0xa9c8('0x1d')](_0xa9c8('0xc'),auth[_0xa9c8('0x9')](),controller[_0xa9c8('0x1d')]);module[_0xa9c8('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 4ad302f..577b019 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 _0xef7c=['FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x42724f,_0x41ca00){var _0x355cd9=function(_0x829949){while(--_0x829949){_0x42724f['push'](_0x42724f['shift']());}};_0x355cd9(++_0x41ca00);}(_0xef7c,0x1e8));var _0xcef7=function(_0x206567,_0x33d93c){_0x206567=_0x206567-0x0;var _0x4fedbb=_0xef7c[_0x206567];return _0x4fedbb;};'use strict';var Sequelize=require(_0xcef7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xcef7('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xcef7('0x1')]},'original_format':{'type':Sequelize[_0xcef7('0x1')]},'original_duration':{'type':Sequelize[_0xcef7('0x2')]},'original_sampleCount':{'type':Sequelize[_0xcef7('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xcef7('0x4')]},'converted_format':{'type':Sequelize[_0xcef7('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xcef7('0x3')]},'converted_channelCount':{'type':Sequelize[_0xcef7('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xcef7('0x4')]}}; \ No newline at end of file +var _0xd0c1=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x1a10d4,_0x3161d9){var _0x5d0cec=function(_0x171073){while(--_0x171073){_0x1a10d4['push'](_0x1a10d4['shift']());}};_0x5d0cec(++_0x3161d9);}(_0xd0c1,0x144));var _0x1d0c=function(_0x404a41,_0x3204e2){_0x404a41=_0x404a41-0x0;var _0x4479ad=_0xd0c1[_0x404a41];return _0x4479ad;};'use strict';var Sequelize=require(_0x1d0c('0x0'));module[_0x1d0c('0x1')]={'name':{'type':Sequelize[_0x1d0c('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x1d0c('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x1d0c('0x2')]},'original_format':{'type':Sequelize[_0x1d0c('0x2')]},'original_duration':{'type':Sequelize[_0x1d0c('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x1d0c('0x4')]},'original_sampleRate':{'type':Sequelize[_0x1d0c('0x5')]},'converted_format':{'type':Sequelize[_0x1d0c('0x2')]},'converted_duration':{'type':Sequelize[_0x1d0c('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x1d0c('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1d0c('0x5')]},'converted_bitRate':{'type':Sequelize[_0x1d0c('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1d0c('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index bede6ca..ac30895 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 _0x7cd3=['delete','server/files/sounds/original','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','Sound','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','download','save_name','join','Sequelize','root','server/files/sounds/converted','format','converted_format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','UserProfileSection','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick'];(function(_0xfde474,_0x602e9a){var _0x2b1b28=function(_0x127c0c){while(--_0x127c0c){_0xfde474['push'](_0xfde474['shift']());}};_0x2b1b28(++_0x602e9a);}(_0x7cd3,0x7b));var _0x37cd=function(_0x5689dc,_0x227782){_0x5689dc=_0x5689dc-0x0;var _0x2635ac=_0x7cd3[_0x5689dc];return _0x2635ac;};'use strict';var emlformat=require(_0x37cd('0x0'));var rimraf=require(_0x37cd('0x1'));var zipdir=require(_0x37cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37cd('0x3'));var moment=require(_0x37cd('0x4'));var BPromise=require(_0x37cd('0x5'));var Mustache=require(_0x37cd('0x6'));var util=require(_0x37cd('0x7'));var path=require(_0x37cd('0x8'));var sox=require('sox');var csv=require(_0x37cd('0x9'));var ejs=require(_0x37cd('0xa'));var fs=require('fs');var fs_extra=require(_0x37cd('0xb'));var _=require(_0x37cd('0xc'));var squel=require(_0x37cd('0xd'));var crypto=require(_0x37cd('0xe'));var jsforce=require(_0x37cd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x37cd('0x9'));var querystring=require(_0x37cd('0x10'));var Papa=require('papaparse');var Redis=require(_0x37cd('0x11'));var authService=require(_0x37cd('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37cd('0x13'));var logger=require(_0x37cd('0x14'))(_0x37cd('0x15'));var utils=require(_0x37cd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x37cd('0x17'));var db=require(_0x37cd('0x18'))['db'];function respondWithStatusCode(_0x98af6a,_0x330df7){_0x330df7=_0x330df7||0xcc;return function(_0x426f9e){if(_0x426f9e){return _0x98af6a[_0x37cd('0x19')](_0x330df7);}return _0x98af6a['status'](_0x330df7)['end']();};}function respondWithResult(_0x3491f3,_0x21d1d1){_0x21d1d1=_0x21d1d1||0xc8;return function(_0x25e5e3){if(_0x25e5e3){return _0x3491f3['status'](_0x21d1d1)['json'](_0x25e5e3);}};}function respondWithFilteredResult(_0x4275da,_0x192332){return function(_0x1c41f){if(_0x1c41f){var _0x1f804f=typeof _0x192332[_0x37cd('0x1a')]===_0x37cd('0x1b')&&typeof _0x192332['limit']==='undefined';var _0x905700=_0x1c41f[_0x37cd('0x1c')];var _0x5c0b05=_0x1f804f?0x0:_0x192332[_0x37cd('0x1a')];var _0x3c785d=_0x1f804f?_0x1c41f[_0x37cd('0x1c')]:_0x192332[_0x37cd('0x1a')]+_0x192332[_0x37cd('0x1d')];var _0x135684;if(_0x3c785d>=_0x905700){_0x3c785d=_0x905700;_0x135684=0xc8;}else{_0x135684=0xce;}_0x4275da[_0x37cd('0x1e')](_0x135684);return _0x4275da[_0x37cd('0x1f')](_0x37cd('0x20'),_0x5c0b05+'-'+_0x3c785d+'/'+_0x905700)['json'](_0x1c41f);}return null;};}function patchUpdates(_0x3eedf7){return function(_0x3a02ca){try{jsonpatch[_0x37cd('0x21')](_0x3a02ca,_0x3eedf7,!![]);}catch(_0x36453c){return BPromise[_0x37cd('0x22')](_0x36453c);}return _0x3a02ca['save']();};}function saveUpdates(_0x1e292f,_0x16b750){return function(_0x3602af){if(_0x3602af){return _0x3602af[_0x37cd('0x23')](_0x1e292f)[_0x37cd('0x24')](function(_0xcb5127){return _0xcb5127;});}return null;};}function removeEntity(_0x3de422,_0x3658b9){return function(_0x3f5827){if(_0x3f5827){return _0x3f5827[_0x37cd('0x25')]()['then'](function(){var _0x2363de=_0x3f5827[_0x37cd('0x26')]({'plain':!![]});var _0x4d2b28='Sounds';return db[_0x37cd('0x27')]['destroy']({'where':{'type':_0x4d2b28,'resourceId':_0x2363de['id']}})[_0x37cd('0x24')](function(){return _0x3f5827;});})[_0x37cd('0x24')](function(){_0x3de422[_0x37cd('0x1e')](0xcc)[_0x37cd('0x28')]();});}};}function handleEntityNotFound(_0x4fde30,_0x26067d){return function(_0x21c095){if(!_0x21c095){_0x4fde30[_0x37cd('0x19')](0x194);}return _0x21c095;};}function handleError(_0x22a41a,_0x488e3c){_0x488e3c=_0x488e3c||0x1f4;return function(_0x36603){logger[_0x37cd('0x29')](_0x36603[_0x37cd('0x2a')]);if(_0x36603[_0x37cd('0x2b')]){delete _0x36603[_0x37cd('0x2b')];}_0x22a41a['status'](_0x488e3c)[_0x37cd('0x2c')](_0x36603);};}exports['index']=function(_0x110e9b,_0x23e9df){var _0x3c5734={},_0xb76d1e={},_0x1accb4={'count':0x0,'rows':[]};var _0x4782eb=_['map'](db[_0x37cd('0x2d')][_0x37cd('0x2e')],function(_0x58cca2){return{'name':_0x58cca2[_0x37cd('0x2f')],'type':_0x58cca2[_0x37cd('0x30')][_0x37cd('0x31')]};});_0xb76d1e['model']=_[_0x37cd('0x32')](_0x4782eb,_0x37cd('0x2b'));_0xb76d1e[_0x37cd('0x33')]=_[_0x37cd('0x34')](_0x110e9b[_0x37cd('0x33')]);_0xb76d1e[_0x37cd('0x35')]=_[_0x37cd('0x36')](_0xb76d1e['model'],_0xb76d1e['query']);_0x3c5734[_0x37cd('0x37')]=_[_0x37cd('0x36')](_0xb76d1e[_0x37cd('0x38')],qs[_0x37cd('0x39')](_0x110e9b['query'][_0x37cd('0x39')]));_0x3c5734[_0x37cd('0x37')]=_0x3c5734[_0x37cd('0x37')][_0x37cd('0x3a')]?_0x3c5734[_0x37cd('0x37')]:_0xb76d1e['model'];if(!_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3b')](_0x37cd('0x3c'))){_0x3c5734[_0x37cd('0x1d')]=qs[_0x37cd('0x1d')](_0x110e9b[_0x37cd('0x33')][_0x37cd('0x1d')]);_0x3c5734[_0x37cd('0x1a')]=qs[_0x37cd('0x1a')](_0x110e9b[_0x37cd('0x33')][_0x37cd('0x1a')]);}_0x3c5734['order']=qs[_0x37cd('0x3d')](_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3d')]);_0x3c5734[_0x37cd('0x3e')]=qs[_0x37cd('0x35')](_['pick'](_0x110e9b['query'],_0xb76d1e['filters']),_0x4782eb);if(_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3f')]){_0x3c5734['where']=_['merge'](_0x3c5734[_0x37cd('0x3e')],{'$or':_['map'](_0x4782eb,function(_0x4f7c8f){if(_0x4f7c8f[_0x37cd('0x30')]!==_0x37cd('0x40')){var _0x38b613={};_0x38b613[_0x4f7c8f[_0x37cd('0x2b')]]={'$like':'%'+_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3f')]+'%'};return _0x38b613;}})});}_0x3c5734=_[_0x37cd('0x41')]({},_0x3c5734,_0x110e9b[_0x37cd('0x42')]);var _0x5efdc4={'where':_0x3c5734[_0x37cd('0x3e')]};return db['Sound']['count'](_0x5efdc4)['then'](function(_0x4cc622){_0x1accb4[_0x37cd('0x1c')]=_0x4cc622;if(_0x110e9b[_0x37cd('0x33')][_0x37cd('0x43')]){_0x3c5734[_0x37cd('0x44')]=[{'all':!![]}];}return db[_0x37cd('0x2d')][_0x37cd('0x45')](_0x3c5734);})[_0x37cd('0x24')](function(_0x5c1b34){_0x1accb4['rows']=_0x5c1b34;return _0x1accb4;})[_0x37cd('0x24')](respondWithFilteredResult(_0x23e9df,_0x3c5734))[_0x37cd('0x46')](handleError(_0x23e9df,null));};exports[_0x37cd('0x47')]=function(_0x495906,_0x369da7){var _0x5aaab2={'raw':!![],'where':{'id':_0x495906[_0x37cd('0x48')]['id']}},_0x3829f4={};_0x3829f4[_0x37cd('0x38')]=_[_0x37cd('0x34')](db[_0x37cd('0x2d')]['rawAttributes']);_0x3829f4[_0x37cd('0x33')]=_[_0x37cd('0x34')](_0x495906[_0x37cd('0x33')]);_0x3829f4[_0x37cd('0x35')]=_['intersection'](_0x3829f4['model'],_0x3829f4[_0x37cd('0x33')]);_0x5aaab2['attributes']=_[_0x37cd('0x36')](_0x3829f4[_0x37cd('0x38')],qs[_0x37cd('0x39')](_0x495906[_0x37cd('0x33')][_0x37cd('0x39')]));_0x5aaab2['attributes']=_0x5aaab2[_0x37cd('0x37')][_0x37cd('0x3a')]?_0x5aaab2[_0x37cd('0x37')]:_0x3829f4[_0x37cd('0x38')];if(_0x495906[_0x37cd('0x33')][_0x37cd('0x43')]){_0x5aaab2[_0x37cd('0x44')]=[{'all':!![]}];}_0x5aaab2=_[_0x37cd('0x41')]({},_0x5aaab2,_0x495906[_0x37cd('0x42')]);return db['Sound'][_0x37cd('0x49')](_0x5aaab2)[_0x37cd('0x24')](handleEntityNotFound(_0x369da7,null))[_0x37cd('0x24')](respondWithResult(_0x369da7,null))['catch'](handleError(_0x369da7,null));};exports[_0x37cd('0x4a')]=function(_0x5c138d,_0x4c2227,_0x3cad35){return db[_0x37cd('0x2d')][_0x37cd('0x49')]({'where':{'id':_0x5c138d[_0x37cd('0x48')]['id']},'attributes':[_0x37cd('0x2b'),_0x37cd('0x4b'),'converted_format'],'raw':!![]})[_0x37cd('0x24')](handleEntityNotFound(_0x4c2227,null))[_0x37cd('0x24')](function(_0x1cc82a){if(_0x1cc82a){if(!fs['existsSync'](path[_0x37cd('0x4c')](config['root'],'server/files/sounds/converted',_0x1cc82a[_0x37cd('0x4b')]+'.'+_0x1cc82a['converted_format']))){throw new db[(_0x37cd('0x4d'))]['ValidationError']('Sound\x20not\x20found');}return _0x4c2227[_0x37cd('0x4a')](path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],_0x37cd('0x4f'),util[_0x37cd('0x50')]('%s.%s',_0x1cc82a[_0x37cd('0x4b')],_0x1cc82a[_0x37cd('0x51')])),util['format'](_0x37cd('0x52'),_0x1cc82a[_0x37cd('0x2b')],_0x1cc82a['converted_format']));}return null;})[_0x37cd('0x46')](handleError(_0x4c2227,null));};exports[_0x37cd('0x53')]=function(_0x3e3885,_0x3e3176,_0x3dde94){var _0x5f0313={'name':path[_0x37cd('0x54')](_0x3e3885['file']['originalname'],path[_0x37cd('0x55')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x57')])),'save_name':path['basename'](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x58')],path[_0x37cd('0x55')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x58')])),'original_format':path[_0x37cd('0x55')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x57')])[_0x37cd('0x59')](0x1),'converted_format':_0x37cd('0x5a')};var _0x554182=path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],'server/files/sounds/original',_0x3e3885[_0x37cd('0x56')]['filename']);var _0x5e47e5=path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],_0x37cd('0x4f'),util[_0x37cd('0x50')](_0x37cd('0x52'),path[_0x37cd('0x54')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x58')],path[_0x37cd('0x55')](_0x3e3885['file'][_0x37cd('0x58')])),_0x5f0313[_0x37cd('0x51')]));logger[_0x37cd('0x5b')](_0x37cd('0x5c'),_0x554182);logger[_0x37cd('0x5b')](_0x37cd('0x5d'),_0x5e47e5);try{fs['chmodSync'](_0x554182,parseInt('0777',0x8));var _0x56169c=sox['transcode'](_0x554182,_0x5e47e5,{'sampleRate':0x1f40,'format':_0x37cd('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56169c['on'](_0x37cd('0x29'),function(_0x343b92){fs[_0x37cd('0x5e')](_0x554182);_0x3e3176['status'](0x1f4)[_0x37cd('0x2c')](_0x343b92);});_0x56169c['on'](_0x37cd('0x5f'),function(_0x384958){_0x5f0313['original_duration']=isNaN(_0x384958['duration'])?null:_0x384958[_0x37cd('0x60')]*0x3e8;_0x5f0313[_0x37cd('0x61')]=isNaN(_0x384958[_0x37cd('0x62')])?null:_0x384958[_0x37cd('0x62')];_0x5f0313[_0x37cd('0x63')]=isNaN(_0x384958[_0x37cd('0x64')])?null:_0x384958[_0x37cd('0x64')];_0x5f0313[_0x37cd('0x65')]=isNaN(_0x384958[_0x37cd('0x66')])?null:_0x384958[_0x37cd('0x66')];_0x5f0313[_0x37cd('0x67')]=isNaN(_0x384958['sampleRate'])?null:_0x384958[_0x37cd('0x68')];});_0x56169c['on']('dest',function(_0x3bb411){_0x5f0313[_0x37cd('0x69')]=isNaN(_0x3bb411['duration'])?null:_0x3bb411['duration']*0x3e8;_0x5f0313[_0x37cd('0x6a')]=isNaN(_0x3bb411['sampleCount'])?null:_0x3bb411[_0x37cd('0x62')];_0x5f0313[_0x37cd('0x6b')]=isNaN(_0x3bb411['channelCount'])?null:_0x3bb411[_0x37cd('0x64')];_0x5f0313[_0x37cd('0x6c')]=isNaN(_0x3bb411[_0x37cd('0x66')])?null:_0x3bb411[_0x37cd('0x66')];_0x5f0313[_0x37cd('0x6d')]=isNaN(_0x3bb411[_0x37cd('0x68')])?null:_0x3bb411['sampleRate'];});_0x56169c['on']('end',function(){fs[_0x37cd('0x6e')](_0x5e47e5,parseInt('0777',0x8));return db[_0x37cd('0x2d')][_0x37cd('0x53')](_0x5f0313)[_0x37cd('0x24')](function(_0xb081fa){var _0x5e1a03={'role':_0x3e3885[_0x37cd('0x6f')][_0x37cd('0x70')],'userProfileId':_0x3e3885[_0x37cd('0x6f')][_0x37cd('0x71')]};if(!_0x5e1a03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e1a03[_0x37cd('0x70')]==='user'){var _0x334d53=_0xb081fa['get']({'plain':!![]});return db[_0x37cd('0x72')][_0x37cd('0x49')]({'where':{'name':_0x37cd('0x73'),'userProfileId':_0x5e1a03['userProfileId']},'raw':!![]})[_0x37cd('0x24')](function(_0x4b7f66){if(_0x4b7f66&&_0x4b7f66['autoAssociation']===0x0){return db[_0x37cd('0x27')][_0x37cd('0x53')]({'name':_0x334d53[_0x37cd('0x2b')],'resourceId':_0x334d53['id'],'type':_0x4b7f66[_0x37cd('0x2b')],'sectionId':_0x4b7f66['id']},{})['then'](function(){return _0xb081fa;});}else{return _0xb081fa;}})['catch'](function(_0x2520ed){logger['error'](_0x37cd('0x74'),_0x2520ed);throw _0x2520ed;});}return _0xb081fa;})[_0x37cd('0x24')](respondWithResult(_0x3e3176,null))['catch'](handleError(_0x3e3176,null));});_0x56169c[_0x37cd('0x75')]();}catch(_0x101759){_0x3e3176['status'](0x1f4)[_0x37cd('0x2c')](_0x101759);}};exports[_0x37cd('0x23')]=function(_0x307ac5,_0x19bc77,_0x552027){return db[_0x37cd('0x2d')][_0x37cd('0x49')]({'where':{'id':_0x307ac5[_0x37cd('0x48')]['id']}})[_0x37cd('0x24')](handleEntityNotFound(_0x19bc77,null))[_0x37cd('0x24')](saveUpdates(_[_0x37cd('0x76')](_0x307ac5[_0x37cd('0x6f')],[_0x37cd('0x2b'),'description']),null))[_0x37cd('0x24')](respondWithResult(_0x19bc77,null))[_0x37cd('0x46')](handleError(_0x19bc77,null));};exports[_0x37cd('0x77')]=function(_0x3e7864,_0x4ebd67,_0x26e29c){return db[_0x37cd('0x2d')][_0x37cd('0x49')]({'where':{'id':_0x3e7864[_0x37cd('0x48')]['id']}})[_0x37cd('0x24')](function(_0x4aff17){if(_0x4aff17){return _0x4aff17[_0x37cd('0x25')]();}})[_0x37cd('0x24')](function(_0x11b12a){var _0x27e3bb=path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],_0x37cd('0x78'),util[_0x37cd('0x50')]('%s.%s',_0x11b12a[_0x37cd('0x4b')],_0x11b12a['original_format']));var _0x2431ab=path['join'](config[_0x37cd('0x4e')],_0x37cd('0x4f'),util[_0x37cd('0x50')](_0x37cd('0x52'),_0x11b12a[_0x37cd('0x4b')],_0x11b12a[_0x37cd('0x51')]));fs[_0x37cd('0x5e')](_0x27e3bb);fs[_0x37cd('0x5e')](_0x2431ab);return _0x11b12a;})[_0x37cd('0x24')](function(_0x2912d4){if(_0x2912d4){return _0x4ebd67[_0x37cd('0x1e')](0xcc)['end']();}})[_0x37cd('0x24')](handleEntityNotFound(_0x4ebd67,null))[_0x37cd('0x46')](handleError(_0x4ebd67,null));}; \ No newline at end of file +var _0x90d2=['UserProfileResource','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','fields','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','format','%s.%s','catch','create','basename','file','originalname','extname','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','Sounds'];(function(_0x37cd00,_0x501df6){var _0x4cb283=function(_0x51aa67){while(--_0x51aa67){_0x37cd00['push'](_0x37cd00['shift']());}};_0x4cb283(++_0x501df6);}(_0x90d2,0x1cb));var _0x290d=function(_0x124b6f,_0x22f98c){_0x124b6f=_0x124b6f-0x0;var _0x2e40fd=_0x90d2[_0x124b6f];return _0x2e40fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x290d('0x0'));var zipdir=require(_0x290d('0x1'));var jsonpatch=require(_0x290d('0x2'));var rp=require(_0x290d('0x3'));var moment=require(_0x290d('0x4'));var BPromise=require(_0x290d('0x5'));var Mustache=require(_0x290d('0x6'));var util=require(_0x290d('0x7'));var path=require(_0x290d('0x8'));var sox=require(_0x290d('0x9'));var csv=require(_0x290d('0xa'));var ejs=require(_0x290d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x290d('0xc'));var squel=require(_0x290d('0xd'));var crypto=require(_0x290d('0xe'));var jsforce=require(_0x290d('0xf'));var deskjs=require(_0x290d('0x10'));var toCsv=require(_0x290d('0xa'));var querystring=require('querystring');var Papa=require(_0x290d('0x11'));var Redis=require(_0x290d('0x12'));var authService=require(_0x290d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x290d('0x14'));var hardwareService=require(_0x290d('0x15'));var logger=require(_0x290d('0x16'))('api');var utils=require(_0x290d('0x17'));var config=require(_0x290d('0x18'));var licenseUtil=require(_0x290d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e0366,_0x2a0780){_0x2a0780=_0x2a0780||0xcc;return function(_0x377f7e){if(_0x377f7e){return _0x4e0366[_0x290d('0x1a')](_0x2a0780);}return _0x4e0366[_0x290d('0x1b')](_0x2a0780)[_0x290d('0x1c')]();};}function respondWithResult(_0x340b93,_0x416585){_0x416585=_0x416585||0xc8;return function(_0xfec9ee){if(_0xfec9ee){return _0x340b93['status'](_0x416585)[_0x290d('0x1d')](_0xfec9ee);}};}function respondWithFilteredResult(_0x38923a,_0x213ded){return function(_0x3d5d08){if(_0x3d5d08){var _0x4bc4c4=typeof _0x213ded[_0x290d('0x1e')]===_0x290d('0x1f')&&typeof _0x213ded[_0x290d('0x20')]==='undefined';var _0x46fb9d=_0x3d5d08[_0x290d('0x21')];var _0x14bbf9=_0x4bc4c4?0x0:_0x213ded[_0x290d('0x1e')];var _0x4d1cb1=_0x4bc4c4?_0x3d5d08['count']:_0x213ded[_0x290d('0x1e')]+_0x213ded[_0x290d('0x20')];var _0x39e83e;if(_0x4d1cb1>=_0x46fb9d){_0x4d1cb1=_0x46fb9d;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x38923a[_0x290d('0x1b')](_0x39e83e);return _0x38923a[_0x290d('0x22')](_0x290d('0x23'),_0x14bbf9+'-'+_0x4d1cb1+'/'+_0x46fb9d)[_0x290d('0x1d')](_0x3d5d08);}return null;};}function patchUpdates(_0x15d757){return function(_0x32eb8d){try{jsonpatch[_0x290d('0x24')](_0x32eb8d,_0x15d757,!![]);}catch(_0x41915c){return BPromise['reject'](_0x41915c);}return _0x32eb8d['save']();};}function saveUpdates(_0x16b7c6,_0x2e1f42){return function(_0x37bcc4){if(_0x37bcc4){return _0x37bcc4['update'](_0x16b7c6)[_0x290d('0x25')](function(_0x4efa82){return _0x4efa82;});}return null;};}function removeEntity(_0x4f5fa1,_0x13f26f){return function(_0x777e5d){if(_0x777e5d){return _0x777e5d[_0x290d('0x26')]()[_0x290d('0x25')](function(){var _0x947009=_0x777e5d[_0x290d('0x27')]({'plain':!![]});var _0x3131b9=_0x290d('0x28');return db[_0x290d('0x29')][_0x290d('0x26')]({'where':{'type':_0x3131b9,'resourceId':_0x947009['id']}})[_0x290d('0x25')](function(){return _0x777e5d;});})[_0x290d('0x25')](function(){_0x4f5fa1[_0x290d('0x1b')](0xcc)[_0x290d('0x1c')]();});}};}function handleEntityNotFound(_0x45574f,_0x1c423d){return function(_0x3efd7b){if(!_0x3efd7b){_0x45574f['sendStatus'](0x194);}return _0x3efd7b;};}function handleError(_0x4fd19d,_0x244306){_0x244306=_0x244306||0x1f4;return function(_0x31238c){logger['error'](_0x31238c[_0x290d('0x2a')]);if(_0x31238c[_0x290d('0x2b')]){delete _0x31238c[_0x290d('0x2b')];}_0x4fd19d[_0x290d('0x1b')](_0x244306)[_0x290d('0x2c')](_0x31238c);};}exports['index']=function(_0x46e9aa,_0x18f451){var _0x476b08={},_0x51fd21={},_0x111a0a={'count':0x0,'rows':[]};var _0x3e3438=_[_0x290d('0x2d')](db[_0x290d('0x2e')][_0x290d('0x2f')],function(_0x2f04bc){return{'name':_0x2f04bc[_0x290d('0x30')],'type':_0x2f04bc[_0x290d('0x31')][_0x290d('0x32')]};});_0x51fd21['model']=_[_0x290d('0x2d')](_0x3e3438,'name');_0x51fd21[_0x290d('0x33')]=_[_0x290d('0x34')](_0x46e9aa[_0x290d('0x33')]);_0x51fd21[_0x290d('0x35')]=_[_0x290d('0x36')](_0x51fd21[_0x290d('0x37')],_0x51fd21[_0x290d('0x33')]);_0x476b08[_0x290d('0x38')]=_[_0x290d('0x36')](_0x51fd21['model'],qs['fields'](_0x46e9aa[_0x290d('0x33')]['fields']));_0x476b08['attributes']=_0x476b08[_0x290d('0x38')][_0x290d('0x39')]?_0x476b08['attributes']:_0x51fd21['model'];if(!_0x46e9aa[_0x290d('0x33')][_0x290d('0x3a')](_0x290d('0x3b'))){_0x476b08[_0x290d('0x20')]=qs['limit'](_0x46e9aa[_0x290d('0x33')][_0x290d('0x20')]);_0x476b08['offset']=qs[_0x290d('0x1e')](_0x46e9aa['query'][_0x290d('0x1e')]);}_0x476b08[_0x290d('0x3c')]=qs[_0x290d('0x3d')](_0x46e9aa['query'][_0x290d('0x3d')]);_0x476b08[_0x290d('0x3e')]=qs[_0x290d('0x35')](_[_0x290d('0x3f')](_0x46e9aa['query'],_0x51fd21['filters']),_0x3e3438);if(_0x46e9aa['query'][_0x290d('0x40')]){_0x476b08[_0x290d('0x3e')]=_[_0x290d('0x41')](_0x476b08[_0x290d('0x3e')],{'$or':_[_0x290d('0x2d')](_0x3e3438,function(_0x1c11b9){if(_0x1c11b9[_0x290d('0x31')]!==_0x290d('0x42')){var _0x1be9f8={};_0x1be9f8[_0x1c11b9[_0x290d('0x2b')]]={'$like':'%'+_0x46e9aa[_0x290d('0x33')][_0x290d('0x40')]+'%'};return _0x1be9f8;}})});}_0x476b08=_[_0x290d('0x41')]({},_0x476b08,_0x46e9aa[_0x290d('0x43')]);var _0x4a4f30={'where':_0x476b08['where']};return db[_0x290d('0x2e')][_0x290d('0x21')](_0x4a4f30)[_0x290d('0x25')](function(_0x9597f7){_0x111a0a[_0x290d('0x21')]=_0x9597f7;if(_0x46e9aa['query'][_0x290d('0x44')]){_0x476b08[_0x290d('0x45')]=[{'all':!![]}];}return db['Sound'][_0x290d('0x46')](_0x476b08);})[_0x290d('0x25')](function(_0x5b3c01){_0x111a0a['rows']=_0x5b3c01;return _0x111a0a;})['then'](respondWithFilteredResult(_0x18f451,_0x476b08))['catch'](handleError(_0x18f451,null));};exports['show']=function(_0x574208,_0x27ad05){var _0x1a92bc={'raw':!![],'where':{'id':_0x574208[_0x290d('0x47')]['id']}},_0x34bcae={};_0x34bcae['model']=_[_0x290d('0x34')](db['Sound'][_0x290d('0x2f')]);_0x34bcae[_0x290d('0x33')]=_[_0x290d('0x34')](_0x574208[_0x290d('0x33')]);_0x34bcae[_0x290d('0x35')]=_[_0x290d('0x36')](_0x34bcae[_0x290d('0x37')],_0x34bcae[_0x290d('0x33')]);_0x1a92bc[_0x290d('0x38')]=_[_0x290d('0x36')](_0x34bcae[_0x290d('0x37')],qs[_0x290d('0x48')](_0x574208[_0x290d('0x33')][_0x290d('0x48')]));_0x1a92bc[_0x290d('0x38')]=_0x1a92bc[_0x290d('0x38')]['length']?_0x1a92bc[_0x290d('0x38')]:_0x34bcae[_0x290d('0x37')];if(_0x574208['query'][_0x290d('0x44')]){_0x1a92bc[_0x290d('0x45')]=[{'all':!![]}];}_0x1a92bc=_['merge']({},_0x1a92bc,_0x574208[_0x290d('0x43')]);return db[_0x290d('0x2e')][_0x290d('0x49')](_0x1a92bc)[_0x290d('0x25')](handleEntityNotFound(_0x27ad05,null))['then'](respondWithResult(_0x27ad05,null))['catch'](handleError(_0x27ad05,null));};exports[_0x290d('0x4a')]=function(_0x172fff,_0x27d740,_0x3e4351){return db[_0x290d('0x2e')][_0x290d('0x49')]({'where':{'id':_0x172fff[_0x290d('0x47')]['id']},'attributes':[_0x290d('0x2b'),_0x290d('0x4b'),'converted_format'],'raw':!![]})[_0x290d('0x25')](handleEntityNotFound(_0x27d740,null))[_0x290d('0x25')](function(_0x29447d){if(_0x29447d){if(!fs[_0x290d('0x4c')](path[_0x290d('0x4d')](config[_0x290d('0x4e')],_0x290d('0x4f'),_0x29447d['save_name']+'.'+_0x29447d[_0x290d('0x50')]))){throw new db[(_0x290d('0x51'))][(_0x290d('0x52'))]('Sound\x20not\x20found');}return _0x27d740[_0x290d('0x4a')](path[_0x290d('0x4d')](config[_0x290d('0x4e')],_0x290d('0x4f'),util[_0x290d('0x53')](_0x290d('0x54'),_0x29447d[_0x290d('0x4b')],_0x29447d[_0x290d('0x50')])),util[_0x290d('0x53')](_0x290d('0x54'),_0x29447d[_0x290d('0x2b')],_0x29447d[_0x290d('0x50')]));}return null;})[_0x290d('0x55')](handleError(_0x27d740,null));};exports[_0x290d('0x56')]=function(_0x3d25b9,_0x248c43,_0x50dda7){var _0x3e6583={'name':path[_0x290d('0x57')](_0x3d25b9[_0x290d('0x58')][_0x290d('0x59')],path[_0x290d('0x5a')](_0x3d25b9[_0x290d('0x58')][_0x290d('0x59')])),'save_name':path['basename'](_0x3d25b9[_0x290d('0x58')]['filename'],path[_0x290d('0x5a')](_0x3d25b9[_0x290d('0x58')]['filename'])),'original_format':path['extname'](_0x3d25b9[_0x290d('0x58')][_0x290d('0x59')])['substring'](0x1),'converted_format':_0x290d('0x5b')};var _0x2071d5=path[_0x290d('0x4d')](config['root'],_0x290d('0x5c'),_0x3d25b9[_0x290d('0x58')][_0x290d('0x5d')]);var _0x11b5cc=path[_0x290d('0x4d')](config[_0x290d('0x4e')],_0x290d('0x4f'),util[_0x290d('0x53')]('%s.%s',path[_0x290d('0x57')](_0x3d25b9[_0x290d('0x58')][_0x290d('0x5d')],path['extname'](_0x3d25b9[_0x290d('0x58')]['filename'])),_0x3e6583[_0x290d('0x50')]));logger[_0x290d('0x5e')](_0x290d('0x5f'),_0x2071d5);logger[_0x290d('0x5e')]('Sound\x20upload\x20destination:\x20%s',_0x11b5cc);try{fs[_0x290d('0x60')](_0x2071d5,parseInt(_0x290d('0x61'),0x8));var _0x50f838=sox['transcode'](_0x2071d5,_0x11b5cc,{'sampleRate':0x1f40,'format':_0x290d('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x50f838['on'](_0x290d('0x62'),function(_0x322c70){fs[_0x290d('0x63')](_0x2071d5);_0x248c43[_0x290d('0x1b')](0x1f4)[_0x290d('0x2c')](_0x322c70);});_0x50f838['on'](_0x290d('0x64'),function(_0x4788e0){_0x3e6583[_0x290d('0x65')]=isNaN(_0x4788e0[_0x290d('0x66')])?null:_0x4788e0[_0x290d('0x66')]*0x3e8;_0x3e6583[_0x290d('0x67')]=isNaN(_0x4788e0[_0x290d('0x68')])?null:_0x4788e0['sampleCount'];_0x3e6583[_0x290d('0x69')]=isNaN(_0x4788e0['channelCount'])?null:_0x4788e0['channelCount'];_0x3e6583[_0x290d('0x6a')]=isNaN(_0x4788e0[_0x290d('0x6b')])?null:_0x4788e0[_0x290d('0x6b')];_0x3e6583[_0x290d('0x6c')]=isNaN(_0x4788e0[_0x290d('0x6d')])?null:_0x4788e0[_0x290d('0x6d')];});_0x50f838['on'](_0x290d('0x6e'),function(_0x51d1f){_0x3e6583[_0x290d('0x6f')]=isNaN(_0x51d1f['duration'])?null:_0x51d1f[_0x290d('0x66')]*0x3e8;_0x3e6583[_0x290d('0x70')]=isNaN(_0x51d1f[_0x290d('0x68')])?null:_0x51d1f[_0x290d('0x68')];_0x3e6583['converted_channelCount']=isNaN(_0x51d1f[_0x290d('0x71')])?null:_0x51d1f[_0x290d('0x71')];_0x3e6583[_0x290d('0x72')]=isNaN(_0x51d1f[_0x290d('0x6b')])?null:_0x51d1f['bitRate'];_0x3e6583[_0x290d('0x73')]=isNaN(_0x51d1f[_0x290d('0x6d')])?null:_0x51d1f[_0x290d('0x6d')];});_0x50f838['on'](_0x290d('0x1c'),function(){fs[_0x290d('0x60')](_0x11b5cc,parseInt(_0x290d('0x61'),0x8));return db[_0x290d('0x2e')][_0x290d('0x56')](_0x3e6583)[_0x290d('0x25')](function(_0x451f93){var _0x5a5d04={'role':_0x3d25b9[_0x290d('0x74')][_0x290d('0x75')],'userProfileId':_0x3d25b9[_0x290d('0x74')][_0x290d('0x76')]};if(!_0x5a5d04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a5d04[_0x290d('0x75')]==='user'){var _0x3e53af=_0x451f93[_0x290d('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x290d('0x49')]({'where':{'name':_0x290d('0x28'),'userProfileId':_0x5a5d04[_0x290d('0x76')]},'raw':!![]})['then'](function(_0x80c3df){if(_0x80c3df&&_0x80c3df[_0x290d('0x77')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e53af[_0x290d('0x2b')],'resourceId':_0x3e53af['id'],'type':_0x80c3df['name'],'sectionId':_0x80c3df['id']},{})[_0x290d('0x25')](function(){return _0x451f93;});}else{return _0x451f93;}})[_0x290d('0x55')](function(_0x185bc5){logger['error'](_0x290d('0x78'),_0x185bc5);throw _0x185bc5;});}return _0x451f93;})[_0x290d('0x25')](respondWithResult(_0x248c43,null))[_0x290d('0x55')](handleError(_0x248c43,null));});_0x50f838[_0x290d('0x79')]();}catch(_0x1560e2){_0x248c43[_0x290d('0x1b')](0x1f4)[_0x290d('0x2c')](_0x1560e2);}};exports['update']=function(_0x5ddc5f,_0x4ba8ff,_0x54f4b9){return db[_0x290d('0x2e')][_0x290d('0x49')]({'where':{'id':_0x5ddc5f[_0x290d('0x47')]['id']}})[_0x290d('0x25')](handleEntityNotFound(_0x4ba8ff,null))[_0x290d('0x25')](saveUpdates(_[_0x290d('0x3f')](_0x5ddc5f[_0x290d('0x74')],['name',_0x290d('0x7a')]),null))[_0x290d('0x25')](respondWithResult(_0x4ba8ff,null))[_0x290d('0x55')](handleError(_0x4ba8ff,null));};exports[_0x290d('0x7b')]=function(_0x10b744,_0x28887e,_0x1e0a9c){return db['Sound'][_0x290d('0x49')]({'where':{'id':_0x10b744['params']['id']}})['then'](function(_0x984aa3){if(_0x984aa3){return _0x984aa3[_0x290d('0x26')]();}})[_0x290d('0x25')](function(_0x8bd268){var _0x387a21=path['join'](config[_0x290d('0x4e')],_0x290d('0x5c'),util[_0x290d('0x53')](_0x290d('0x54'),_0x8bd268[_0x290d('0x4b')],_0x8bd268[_0x290d('0x7c')]));var _0x4d02c2=path[_0x290d('0x4d')](config[_0x290d('0x4e')],'server/files/sounds/converted',util[_0x290d('0x53')]('%s.%s',_0x8bd268[_0x290d('0x4b')],_0x8bd268[_0x290d('0x50')]));fs[_0x290d('0x63')](_0x387a21);fs[_0x290d('0x63')](_0x4d02c2);return _0x8bd268;})[_0x290d('0x25')](function(_0x29bb88){if(_0x29bb88){return _0x28887e['status'](0xcc)[_0x290d('0x1c')]();}})['then'](handleEntityNotFound(_0x28887e,null))['catch'](handleError(_0x28887e,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 26a27d4..9593c04 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 _0x5904=['request-promise','../../config/environment','exports','define','Sound','tools_sounds','util','api','moment','bluebird'];(function(_0x5adb68,_0x484cd){var _0x433c3c=function(_0x50905c){while(--_0x50905c){_0x5adb68['push'](_0x5adb68['shift']());}};_0x433c3c(++_0x484cd);}(_0x5904,0x16e));var _0x4590=function(_0x18c126,_0x3a12fe){_0x18c126=_0x18c126-0x0;var _0x1be598=_0x5904[_0x18c126];return _0x1be598;};'use strict';var _=require('lodash');var util=require(_0x4590('0x0'));var logger=require('../../config/logger')(_0x4590('0x1'));var moment=require(_0x4590('0x2'));var BPromise=require(_0x4590('0x3'));var rp=require(_0x4590('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4590('0x5'));var attributes=require('./sound.attributes');module[_0x4590('0x6')]=function(_0x697390,_0x597fc3){return _0x697390[_0x4590('0x7')](_0x4590('0x8'),attributes,{'tableName':_0x4590('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec9c=['../../config/logger','bluebird','request-promise','path','rimraf','./sound.attributes','exports','Sound','tools_sounds','lodash','util'];(function(_0x14b767,_0x577e84){var _0x22267a=function(_0xa87ebc){while(--_0xa87ebc){_0x14b767['push'](_0x14b767['shift']());}};_0x22267a(++_0x577e84);}(_0xec9c,0x15e));var _0xcec9=function(_0x53d97d,_0x5267e7){_0x53d97d=_0x53d97d-0x0;var _0x381d0e=_0xec9c[_0x53d97d];return _0x381d0e;};'use strict';var _=require(_0xcec9('0x0'));var util=require(_0xcec9('0x1'));var logger=require(_0xcec9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcec9('0x3'));var rp=require(_0xcec9('0x4'));var fs=require('fs');var path=require(_0xcec9('0x5'));var rimraf=require(_0xcec9('0x6'));var config=require('../../config/environment');var attributes=require(_0xcec9('0x7'));module[_0xcec9('0x8')]=function(_0x4c4f33,_0x556eba){return _0x4c4f33['define'](_0xcec9('0x9'),attributes,{'tableName':_0xcec9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index fa2d8a2..421b302 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 _0xe2de=['request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x3adc57,_0x4ccf9b){var _0x42ddb1=function(_0x4d7589){while(--_0x4d7589){_0x3adc57['push'](_0x3adc57['shift']());}};_0x42ddb1(++_0x4ccf9b);}(_0xe2de,0x1d6));var _0xee2d=function(_0xa8fb97,_0x2ce4b4){_0xa8fb97=_0xa8fb97-0x0;var _0x57cdf7=_0xe2de[_0xa8fb97];return _0x57cdf7;};'use strict';var _=require(_0xee2d('0x0'));var util=require(_0xee2d('0x1'));var moment=require(_0xee2d('0x2'));var BPromise=require('bluebird');var rs=require(_0xee2d('0x3'));var fs=require('fs');var Redis=require(_0xee2d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xee2d('0x5'));var logger=require(_0xee2d('0x6'))(_0xee2d('0x7'));var config=require('../../config/environment');var jayson=require(_0xee2d('0x8'));var client=jayson['client'][_0xee2d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5421a7,_0xca2290,_0x2a56b8){return new BPromise(function(_0x57a02d,_0x65c2b7){return client[_0xee2d('0xa')](_0x5421a7,_0x2a56b8)[_0xee2d('0xb')](function(_0x20cfa4){logger[_0xee2d('0xc')](_0xee2d('0xd'),_0xca2290,_0xee2d('0xe'));logger[_0xee2d('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0xca2290,_0xee2d('0xe'),JSON[_0xee2d('0x10')](_0x20cfa4));if(_0x20cfa4['error']){if(_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x12')]===0x1f4){logger[_0xee2d('0x11')](_0xee2d('0xd'),_0xca2290,_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x13')]);return _0x65c2b7(_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x13')]);}logger[_0xee2d('0x11')](_0xee2d('0xd'),_0xca2290,_0x20cfa4[_0xee2d('0x11')]['message']);return _0x57a02d(_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x13')]);}else{logger[_0xee2d('0xc')](_0xee2d('0xd'),_0xca2290,_0xee2d('0xe'));_0x57a02d(_0x20cfa4[_0xee2d('0x14')][_0xee2d('0x13')]);}})[_0xee2d('0x15')](function(_0x1fe759){logger[_0xee2d('0x11')](_0xee2d('0xd'),_0xca2290,_0x1fe759);_0x65c2b7(_0x1fe759);});});}exports[_0xee2d('0x16')]=function(_0x504673){var _0x42ac39=this;return new Promise(function(_0x31f926,_0x4740f2){return db[_0xee2d('0x17')][_0xee2d('0x18')]({'raw':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')][_0xee2d('0x1a')]===undefined?!![]:![]:!![],'where':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')][_0xee2d('0x1b')]||null:null,'attributes':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')][_0xee2d('0x1c')]||null:null,'include':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')]['include']?_[_0xee2d('0x1d')](_0x504673[_0xee2d('0x19')][_0xee2d('0x1e')],function(_0x1fef00){return{'model':db[_0x1fef00[_0xee2d('0x1f')]],'as':_0x1fef00['as'],'attributes':_0x1fef00[_0xee2d('0x1c')],'include':_0x1fef00[_0xee2d('0x1e')]?_['map'](_0x1fef00['include'],function(_0x126210){return{'model':db[_0x126210[_0xee2d('0x1f')]],'as':_0x126210['as'],'attributes':_0x126210[_0xee2d('0x1c')],'include':_0x126210[_0xee2d('0x1e')]?_[_0xee2d('0x1d')](_0x126210[_0xee2d('0x1e')],function(_0x34d6c2){return{'model':db[_0x34d6c2[_0xee2d('0x1f')]],'as':_0x34d6c2['as'],'attributes':_0x34d6c2[_0xee2d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xee2d('0xb')](function(_0x352053){logger[_0xee2d('0xc')]('ShowSound',_0x504673);logger[_0xee2d('0xf')](_0xee2d('0x16'),_0x504673,JSON['stringify'](_0x352053));_0x31f926(_0x352053);})[_0xee2d('0x15')](function(_0x5bb93f){logger[_0xee2d('0x11')](_0xee2d('0x16'),_0x5bb93f[_0xee2d('0x13')],_0x504673);_0x4740f2(_0x42ac39[_0xee2d('0x11')](0x1f4,_0x5bb93f[_0xee2d('0x13')]));});});}; \ No newline at end of file +var _0xda16=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','catch','Sound','options','attributes','model','include','map','then','ShowSound','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xda16,0x17a));var _0x6da1=function(_0x1283ad,_0x33c0e0){_0x1283ad=_0x1283ad-0x0;var _0x12afe0=_0xda16[_0x1283ad];return _0x12afe0;};'use strict';var _=require(_0x6da1('0x0'));var util=require('util');var moment=require(_0x6da1('0x1'));var BPromise=require(_0x6da1('0x2'));var rs=require(_0x6da1('0x3'));var fs=require('fs');var Redis=require(_0x6da1('0x4'));var db=require(_0x6da1('0x5'))['db'];var utils=require(_0x6da1('0x6'));var logger=require(_0x6da1('0x7'))(_0x6da1('0x8'));var config=require(_0x6da1('0x9'));var jayson=require(_0x6da1('0xa'));var client=jayson[_0x6da1('0xb')][_0x6da1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x339c0e,_0x1eb623,_0x58a7ef){return new BPromise(function(_0x34c8dd,_0x4d92d8){return client[_0x6da1('0xd')](_0x339c0e,_0x58a7ef)['then'](function(_0x1ac781){logger[_0x6da1('0xe')](_0x6da1('0xf'),_0x1eb623,_0x6da1('0x10'));logger[_0x6da1('0x11')](_0x6da1('0x12'),_0x1eb623,_0x6da1('0x10'),JSON['stringify'](_0x1ac781));if(_0x1ac781['error']){if(_0x1ac781[_0x6da1('0x13')][_0x6da1('0x14')]===0x1f4){logger[_0x6da1('0x13')](_0x6da1('0xf'),_0x1eb623,_0x1ac781[_0x6da1('0x13')][_0x6da1('0x15')]);return _0x4d92d8(_0x1ac781[_0x6da1('0x13')]['message']);}logger[_0x6da1('0x13')](_0x6da1('0xf'),_0x1eb623,_0x1ac781[_0x6da1('0x13')][_0x6da1('0x15')]);return _0x34c8dd(_0x1ac781[_0x6da1('0x13')]['message']);}else{logger[_0x6da1('0xe')](_0x6da1('0xf'),_0x1eb623,_0x6da1('0x10'));_0x34c8dd(_0x1ac781['result'][_0x6da1('0x15')]);}})[_0x6da1('0x16')](function(_0xb44a19){logger[_0x6da1('0x13')](_0x6da1('0xf'),_0x1eb623,_0xb44a19);_0x4d92d8(_0xb44a19);});});}exports['ShowSound']=function(_0x633d39){var _0x1907c1=this;return new Promise(function(_0x5bd591,_0x251595){return db[_0x6da1('0x17')]['find']({'raw':_0x633d39[_0x6da1('0x18')]?_0x633d39[_0x6da1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x633d39[_0x6da1('0x18')]?_0x633d39[_0x6da1('0x18')]['where']||null:null,'attributes':_0x633d39[_0x6da1('0x18')]?_0x633d39[_0x6da1('0x18')][_0x6da1('0x19')]||null:null,'include':_0x633d39['options']?_0x633d39[_0x6da1('0x18')]['include']?_['map'](_0x633d39[_0x6da1('0x18')]['include'],function(_0x1aee47){return{'model':db[_0x1aee47[_0x6da1('0x1a')]],'as':_0x1aee47['as'],'attributes':_0x1aee47['attributes'],'include':_0x1aee47[_0x6da1('0x1b')]?_[_0x6da1('0x1c')](_0x1aee47[_0x6da1('0x1b')],function(_0x4d211c){return{'model':db[_0x4d211c['model']],'as':_0x4d211c['as'],'attributes':_0x4d211c[_0x6da1('0x19')],'include':_0x4d211c[_0x6da1('0x1b')]?_[_0x6da1('0x1c')](_0x4d211c[_0x6da1('0x1b')],function(_0x1eec8c){return{'model':db[_0x1eec8c['model']],'as':_0x1eec8c['as'],'attributes':_0x1eec8c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6da1('0x1d')](function(_0x508062){logger[_0x6da1('0xe')]('ShowSound',_0x633d39);logger[_0x6da1('0x11')](_0x6da1('0x1e'),_0x633d39,JSON[_0x6da1('0x1f')](_0x508062));_0x5bd591(_0x508062);})['catch'](function(_0x39b497){logger[_0x6da1('0x13')](_0x6da1('0x1e'),_0x39b497[_0x6da1('0x15')],_0x633d39);_0x251595(_0x1907c1[_0x6da1('0x13')](0x1f4,_0x39b497['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d5fdc1a..060cd50 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0xda2d,0x102));var _0xdda2=function(_0x2babc3,_0x3762a8){_0x2babc3=_0x2babc3-0x0;var _0x420ec1=_0xda2d[_0x2babc3];return _0x420ec1;};'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('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x3b9d79,_0x42f721){var _0x16d93e=function(_0x15d370){while(--_0x15d370){_0x3b9d79['push'](_0x3b9d79['shift']());}};_0x16d93e(++_0x42f721);}(_0xda2d,0x102));var _0xdda2=function(_0x13b7c7,_0x3ad9d4){_0x13b7c7=_0x13b7c7-0x0;var _0x4f41c3=_0xda2d[_0x13b7c7];return _0x4f41c3;};'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('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 846e9bd..4e3432a 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 _0x819b=['out','exports','STRING','TEXT','ENUM'];(function(_0x2ca147,_0x379da5){var _0x18c16d=function(_0x442a5a){while(--_0x442a5a){_0x2ca147['push'](_0x2ca147['shift']());}};_0x18c16d(++_0x379da5);}(_0x819b,0xb0));var _0xb819=function(_0x150199,_0x5d8234){_0x150199=_0x150199-0x0;var _0x50fa5c=_0x819b[_0x150199];return _0x50fa5c;};'use strict';var Sequelize=require('sequelize');module[_0xb819('0x0')]={'uniqueid':{'type':Sequelize[_0xb819('0x1')]},'body':{'type':Sequelize[_0xb819('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xb819('0x3')]('in','out'),'defaultValue':_0xb819('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb819('0x2')]}}; \ No newline at end of file +var _0x2d15=['TEXT','exports','STRING','medium','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d15,0x85));var _0x52d1=function(_0x52ec73,_0x219fec){_0x52ec73=_0x52ec73-0x0;var _0x2f5a30=_0x2d15[_0x52ec73];return _0x2f5a30;};'use strict';var Sequelize=require('sequelize');module[_0x52d1('0x0')]={'uniqueid':{'type':Sequelize[_0x52d1('0x1')]},'body':{'type':Sequelize['TEXT'](_0x52d1('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x52d1('0x3')]('in',_0x52d1('0x4')),'defaultValue':_0x52d1('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x52d1('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index f5436c5..63ea04c 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 _0x9264=['rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','show','params','keys','includeAll','include','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','SquareMessage'];(function(_0x2f04a4,_0x1be47e){var _0x5dde34=function(_0x2aac62){while(--_0x2aac62){_0x2f04a4['push'](_0x2f04a4['shift']());}};_0x5dde34(++_0x1be47e);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4926('0x0'));var rimraf=require(_0x4926('0x1'));var zipdir=require(_0x4926('0x2'));var jsonpatch=require(_0x4926('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4926('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4926('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4926('0x6'));var _=require(_0x4926('0x7'));var squel=require('squel');var crypto=require(_0x4926('0x8'));var jsforce=require(_0x4926('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4926('0xa'));var querystring=require(_0x4926('0xb'));var Papa=require(_0x4926('0xc'));var Redis=require('ioredis');var authService=require(_0x4926('0xd'));var qs=require(_0x4926('0xe'));var as=require(_0x4926('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4926('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4926('0x11'));var licenseUtil=require(_0x4926('0x12'));var db=require(_0x4926('0x13'))['db'];function respondWithStatusCode(_0x5423a3,_0xd3cbc){_0xd3cbc=_0xd3cbc||0xcc;return function(_0x21eae1){if(_0x21eae1){return _0x5423a3[_0x4926('0x14')](_0xd3cbc);}return _0x5423a3[_0x4926('0x15')](_0xd3cbc)[_0x4926('0x16')]();};}function respondWithResult(_0x2a2105,_0x2f466b){_0x2f466b=_0x2f466b||0xc8;return function(_0x1a280b){if(_0x1a280b){return _0x2a2105[_0x4926('0x15')](_0x2f466b)[_0x4926('0x17')](_0x1a280b);}};}function respondWithFilteredResult(_0xac0db7,_0x1fbb5d){return function(_0x3018cb){if(_0x3018cb){var _0x1ac74f=typeof _0x1fbb5d['offset']===_0x4926('0x18')&&typeof _0x1fbb5d[_0x4926('0x19')]===_0x4926('0x18');var _0x5736dd=_0x3018cb['count'];var _0x1dd78e=_0x1ac74f?0x0:_0x1fbb5d['offset'];var _0x214e36=_0x1ac74f?_0x3018cb[_0x4926('0x1a')]:_0x1fbb5d['offset']+_0x1fbb5d[_0x4926('0x19')];var _0x49461e;if(_0x214e36>=_0x5736dd){_0x214e36=_0x5736dd;_0x49461e=0xc8;}else{_0x49461e=0xce;}_0xac0db7[_0x4926('0x15')](_0x49461e);return _0xac0db7[_0x4926('0x1b')](_0x4926('0x1c'),_0x1dd78e+'-'+_0x214e36+'/'+_0x5736dd)[_0x4926('0x17')](_0x3018cb);}return null;};}function patchUpdates(_0x5b7588){return function(_0x59dc6a){try{jsonpatch[_0x4926('0x1d')](_0x59dc6a,_0x5b7588,!![]);}catch(_0x588c7a){return BPromise['reject'](_0x588c7a);}return _0x59dc6a[_0x4926('0x1e')]();};}function saveUpdates(_0x309c71,_0x55d055){return function(_0xfd1095){if(_0xfd1095){return _0xfd1095['update'](_0x309c71)[_0x4926('0x1f')](function(_0x55e459){return _0x55e459;});}return null;};}function removeEntity(_0x10d0b2,_0x34d600){return function(_0x2df18c){if(_0x2df18c){return _0x2df18c[_0x4926('0x20')]()['then'](function(){_0x10d0b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c02e7,_0xbfbe1b){return function(_0x43c077){if(!_0x43c077){_0x1c02e7[_0x4926('0x14')](0x194);}return _0x43c077;};}function handleError(_0x51be4f,_0x508dea){_0x508dea=_0x508dea||0x1f4;return function(_0x55413a){logger[_0x4926('0x21')](_0x55413a[_0x4926('0x22')]);if(_0x55413a[_0x4926('0x23')]){delete _0x55413a['name'];}_0x51be4f['status'](_0x508dea)['send'](_0x55413a);};}exports[_0x4926('0x24')]=function(_0x3f06a3,_0xbfe28d){var _0x4bd08d={},_0x180421={},_0x9d610c={'count':0x0,'rows':[]};var _0x3f4a69=_[_0x4926('0x25')](db[_0x4926('0x26')][_0x4926('0x27')],function(_0x5a44a9){return{'name':_0x5a44a9[_0x4926('0x28')],'type':_0x5a44a9[_0x4926('0x29')][_0x4926('0x2a')]};});_0x180421[_0x4926('0x2b')]=_[_0x4926('0x25')](_0x3f4a69,_0x4926('0x23'));_0x180421[_0x4926('0x2c')]=_['keys'](_0x3f06a3[_0x4926('0x2c')]);_0x180421[_0x4926('0x2d')]=_['intersection'](_0x180421[_0x4926('0x2b')],_0x180421[_0x4926('0x2c')]);_0x4bd08d[_0x4926('0x2e')]=_[_0x4926('0x2f')](_0x180421[_0x4926('0x2b')],qs[_0x4926('0x30')](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x30')]));_0x4bd08d[_0x4926('0x2e')]=_0x4bd08d[_0x4926('0x2e')][_0x4926('0x31')]?_0x4bd08d[_0x4926('0x2e')]:_0x180421[_0x4926('0x2b')];if(!_0x3f06a3[_0x4926('0x2c')]['hasOwnProperty'](_0x4926('0x32'))){_0x4bd08d[_0x4926('0x19')]=qs[_0x4926('0x19')](_0x3f06a3[_0x4926('0x2c')]['limit']);_0x4bd08d[_0x4926('0x33')]=qs[_0x4926('0x33')](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x33')]);}_0x4bd08d[_0x4926('0x34')]=qs['sort'](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x35')]);_0x4bd08d[_0x4926('0x36')]=qs['filters'](_[_0x4926('0x37')](_0x3f06a3[_0x4926('0x2c')],_0x180421[_0x4926('0x2d')]),_0x3f4a69);if(_0x3f06a3[_0x4926('0x2c')][_0x4926('0x38')]){_0x4bd08d[_0x4926('0x36')]=_['merge'](_0x4bd08d[_0x4926('0x36')],{'$or':_[_0x4926('0x25')](_0x3f4a69,function(_0x3c5595){if(_0x3c5595[_0x4926('0x29')]!==_0x4926('0x39')){var _0x5237f4={};_0x5237f4[_0x3c5595[_0x4926('0x23')]]={'$like':'%'+_0x3f06a3[_0x4926('0x2c')][_0x4926('0x38')]+'%'};return _0x5237f4;}})});}_0x4bd08d=_[_0x4926('0x3a')]({},_0x4bd08d,_0x3f06a3['options']);var _0x505de3={'where':_0x4bd08d['where']};return db[_0x4926('0x26')][_0x4926('0x1a')](_0x505de3)[_0x4926('0x1f')](function(_0x1d97db){_0x9d610c[_0x4926('0x1a')]=_0x1d97db;if(_0x3f06a3['query']['includeAll']){_0x4bd08d['include']=[{'all':!![]}];}return db['SquareMessage'][_0x4926('0x3b')](_0x4bd08d);})[_0x4926('0x1f')](function(_0x4380da){_0x9d610c[_0x4926('0x3c')]=_0x4380da;return _0x9d610c;})[_0x4926('0x1f')](respondWithFilteredResult(_0xbfe28d,_0x4bd08d))['catch'](handleError(_0xbfe28d,null));};exports[_0x4926('0x3d')]=function(_0x203f24,_0x218631){var _0x9dc879={'raw':!![],'where':{'id':_0x203f24[_0x4926('0x3e')]['id']}},_0x437800={};_0x437800[_0x4926('0x2b')]=_[_0x4926('0x3f')](db[_0x4926('0x26')][_0x4926('0x27')]);_0x437800['query']=_['keys'](_0x203f24[_0x4926('0x2c')]);_0x437800['filters']=_[_0x4926('0x2f')](_0x437800[_0x4926('0x2b')],_0x437800[_0x4926('0x2c')]);_0x9dc879['attributes']=_[_0x4926('0x2f')](_0x437800[_0x4926('0x2b')],qs[_0x4926('0x30')](_0x203f24[_0x4926('0x2c')][_0x4926('0x30')]));_0x9dc879[_0x4926('0x2e')]=_0x9dc879[_0x4926('0x2e')][_0x4926('0x31')]?_0x9dc879[_0x4926('0x2e')]:_0x437800[_0x4926('0x2b')];if(_0x203f24[_0x4926('0x2c')][_0x4926('0x40')]){_0x9dc879[_0x4926('0x41')]=[{'all':!![]}];}_0x9dc879=_[_0x4926('0x3a')]({},_0x9dc879,_0x203f24[_0x4926('0x42')]);return db['SquareMessage'][_0x4926('0x43')](_0x9dc879)[_0x4926('0x1f')](handleEntityNotFound(_0x218631,null))['then'](respondWithResult(_0x218631,null))[_0x4926('0x44')](handleError(_0x218631,null));};exports[_0x4926('0x45')]=function(_0x416968,_0x572c91){return db[_0x4926('0x26')][_0x4926('0x45')](_0x416968[_0x4926('0x46')],{})[_0x4926('0x1f')](respondWithResult(_0x572c91,0xc9))[_0x4926('0x44')](handleError(_0x572c91,null));};exports[_0x4926('0x47')]=function(_0x43764f,_0x12a89b){if(_0x43764f['body']['id']){delete _0x43764f[_0x4926('0x46')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x43764f[_0x4926('0x3e')]['id']}})[_0x4926('0x1f')](handleEntityNotFound(_0x12a89b,null))['then'](saveUpdates(_0x43764f[_0x4926('0x46')],null))[_0x4926('0x1f')](respondWithResult(_0x12a89b,null))[_0x4926('0x44')](handleError(_0x12a89b,null));};exports[_0x4926('0x20')]=function(_0x15d338,_0x84f5b0){return db['SquareMessage']['find']({'where':{'id':_0x15d338['params']['id']}})['then'](handleEntityNotFound(_0x84f5b0,null))[_0x4926('0x1f')](removeEntity(_0x84f5b0,null))[_0x4926('0x44')](handleError(_0x84f5b0,null));}; \ No newline at end of file +var _0xd8a2=['path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd8a2,0x128));var _0x2d8a=function(_0x147bc8,_0x1c6991){_0x147bc8=_0x147bc8-0x0;var _0x22e6a8=_0xd8a2[_0x147bc8];return _0x22e6a8;};'use strict';var emlformat=require(_0x2d8a('0x0'));var rimraf=require(_0x2d8a('0x1'));var zipdir=require(_0x2d8a('0x2'));var jsonpatch=require(_0x2d8a('0x3'));var rp=require(_0x2d8a('0x4'));var moment=require(_0x2d8a('0x5'));var BPromise=require(_0x2d8a('0x6'));var Mustache=require('mustache');var util=require(_0x2d8a('0x7'));var path=require(_0x2d8a('0x8'));var sox=require('sox');var csv=require(_0x2d8a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d8a('0xa'));var _=require('lodash');var squel=require(_0x2d8a('0xb'));var crypto=require(_0x2d8a('0xc'));var jsforce=require(_0x2d8a('0xd'));var deskjs=require(_0x2d8a('0xe'));var toCsv=require(_0x2d8a('0x9'));var querystring=require(_0x2d8a('0xf'));var Papa=require(_0x2d8a('0x10'));var Redis=require(_0x2d8a('0x11'));var authService=require(_0x2d8a('0x12'));var qs=require(_0x2d8a('0x13'));var as=require(_0x2d8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d8a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2d8a('0x16'));var licenseUtil=require(_0x2d8a('0x17'));var db=require(_0x2d8a('0x18'))['db'];function respondWithStatusCode(_0x406eb2,_0x2c698b){_0x2c698b=_0x2c698b||0xcc;return function(_0x12f819){if(_0x12f819){return _0x406eb2[_0x2d8a('0x19')](_0x2c698b);}return _0x406eb2[_0x2d8a('0x1a')](_0x2c698b)[_0x2d8a('0x1b')]();};}function respondWithResult(_0xdac34c,_0x63f53){_0x63f53=_0x63f53||0xc8;return function(_0x2c6e94){if(_0x2c6e94){return _0xdac34c['status'](_0x63f53)[_0x2d8a('0x1c')](_0x2c6e94);}};}function respondWithFilteredResult(_0x1763d6,_0x5bc042){return function(_0x5c7f74){if(_0x5c7f74){var _0x45218a=typeof _0x5bc042[_0x2d8a('0x1d')]===_0x2d8a('0x1e')&&typeof _0x5bc042[_0x2d8a('0x1f')]==='undefined';var _0x2aa33d=_0x5c7f74['count'];var _0x3147b9=_0x45218a?0x0:_0x5bc042['offset'];var _0x2b0291=_0x45218a?_0x5c7f74[_0x2d8a('0x20')]:_0x5bc042[_0x2d8a('0x1d')]+_0x5bc042[_0x2d8a('0x1f')];var _0xab6753;if(_0x2b0291>=_0x2aa33d){_0x2b0291=_0x2aa33d;_0xab6753=0xc8;}else{_0xab6753=0xce;}_0x1763d6['status'](_0xab6753);return _0x1763d6[_0x2d8a('0x21')](_0x2d8a('0x22'),_0x3147b9+'-'+_0x2b0291+'/'+_0x2aa33d)[_0x2d8a('0x1c')](_0x5c7f74);}return null;};}function patchUpdates(_0x2d5830){return function(_0x10e836){try{jsonpatch[_0x2d8a('0x23')](_0x10e836,_0x2d5830,!![]);}catch(_0x45f97b){return BPromise[_0x2d8a('0x24')](_0x45f97b);}return _0x10e836[_0x2d8a('0x25')]();};}function saveUpdates(_0x333298,_0x3b8e0e){return function(_0x15567f){if(_0x15567f){return _0x15567f[_0x2d8a('0x26')](_0x333298)[_0x2d8a('0x27')](function(_0x463774){return _0x463774;});}return null;};}function removeEntity(_0x5c622b,_0x137c4d){return function(_0x31a036){if(_0x31a036){return _0x31a036[_0x2d8a('0x28')]()['then'](function(){_0x5c622b[_0x2d8a('0x1a')](0xcc)[_0x2d8a('0x1b')]();});}};}function handleEntityNotFound(_0x3574e0,_0x2c47c1){return function(_0x3400bf){if(!_0x3400bf){_0x3574e0['sendStatus'](0x194);}return _0x3400bf;};}function handleError(_0x9c97bf,_0x28a22b){_0x28a22b=_0x28a22b||0x1f4;return function(_0x1ac19d){logger['error'](_0x1ac19d[_0x2d8a('0x29')]);if(_0x1ac19d[_0x2d8a('0x2a')]){delete _0x1ac19d[_0x2d8a('0x2a')];}_0x9c97bf[_0x2d8a('0x1a')](_0x28a22b)[_0x2d8a('0x2b')](_0x1ac19d);};}exports[_0x2d8a('0x2c')]=function(_0x1a4750,_0x504841){var _0x1d787d={},_0x3a5b2b={},_0x182148={'count':0x0,'rows':[]};var _0x16bd5a=_['map'](db[_0x2d8a('0x2d')][_0x2d8a('0x2e')],function(_0x5beac0){return{'name':_0x5beac0[_0x2d8a('0x2f')],'type':_0x5beac0[_0x2d8a('0x30')][_0x2d8a('0x31')]};});_0x3a5b2b[_0x2d8a('0x32')]=_['map'](_0x16bd5a,'name');_0x3a5b2b[_0x2d8a('0x33')]=_[_0x2d8a('0x34')](_0x1a4750['query']);_0x3a5b2b[_0x2d8a('0x35')]=_[_0x2d8a('0x36')](_0x3a5b2b[_0x2d8a('0x32')],_0x3a5b2b['query']);_0x1d787d[_0x2d8a('0x37')]=_['intersection'](_0x3a5b2b[_0x2d8a('0x32')],qs[_0x2d8a('0x38')](_0x1a4750[_0x2d8a('0x33')][_0x2d8a('0x38')]));_0x1d787d[_0x2d8a('0x37')]=_0x1d787d[_0x2d8a('0x37')][_0x2d8a('0x39')]?_0x1d787d[_0x2d8a('0x37')]:_0x3a5b2b['model'];if(!_0x1a4750[_0x2d8a('0x33')]['hasOwnProperty'](_0x2d8a('0x3a'))){_0x1d787d[_0x2d8a('0x1f')]=qs[_0x2d8a('0x1f')](_0x1a4750[_0x2d8a('0x33')][_0x2d8a('0x1f')]);_0x1d787d[_0x2d8a('0x1d')]=qs['offset'](_0x1a4750[_0x2d8a('0x33')]['offset']);}_0x1d787d[_0x2d8a('0x3b')]=qs[_0x2d8a('0x3c')](_0x1a4750[_0x2d8a('0x33')][_0x2d8a('0x3c')]);_0x1d787d[_0x2d8a('0x3d')]=qs[_0x2d8a('0x35')](_[_0x2d8a('0x3e')](_0x1a4750[_0x2d8a('0x33')],_0x3a5b2b['filters']),_0x16bd5a);if(_0x1a4750[_0x2d8a('0x33')][_0x2d8a('0x3f')]){_0x1d787d[_0x2d8a('0x3d')]=_[_0x2d8a('0x40')](_0x1d787d[_0x2d8a('0x3d')],{'$or':_[_0x2d8a('0x41')](_0x16bd5a,function(_0x3abf6d){if(_0x3abf6d['type']!=='VIRTUAL'){var _0x1e299f={};_0x1e299f[_0x3abf6d[_0x2d8a('0x2a')]]={'$like':'%'+_0x1a4750[_0x2d8a('0x33')][_0x2d8a('0x3f')]+'%'};return _0x1e299f;}})});}_0x1d787d=_[_0x2d8a('0x40')]({},_0x1d787d,_0x1a4750[_0x2d8a('0x42')]);var _0x29b44e={'where':_0x1d787d[_0x2d8a('0x3d')]};return db['SquareMessage']['count'](_0x29b44e)[_0x2d8a('0x27')](function(_0x92ee8a){_0x182148['count']=_0x92ee8a;if(_0x1a4750[_0x2d8a('0x33')][_0x2d8a('0x43')]){_0x1d787d[_0x2d8a('0x44')]=[{'all':!![]}];}return db[_0x2d8a('0x2d')][_0x2d8a('0x45')](_0x1d787d);})[_0x2d8a('0x27')](function(_0xcbb2ef){_0x182148[_0x2d8a('0x46')]=_0xcbb2ef;return _0x182148;})[_0x2d8a('0x27')](respondWithFilteredResult(_0x504841,_0x1d787d))[_0x2d8a('0x47')](handleError(_0x504841,null));};exports['show']=function(_0x1605ad,_0x5bded4){var _0x44d9e6={'raw':!![],'where':{'id':_0x1605ad[_0x2d8a('0x48')]['id']}},_0x3107b3={};_0x3107b3[_0x2d8a('0x32')]=_['keys'](db[_0x2d8a('0x2d')][_0x2d8a('0x2e')]);_0x3107b3[_0x2d8a('0x33')]=_[_0x2d8a('0x34')](_0x1605ad['query']);_0x3107b3['filters']=_[_0x2d8a('0x36')](_0x3107b3[_0x2d8a('0x32')],_0x3107b3[_0x2d8a('0x33')]);_0x44d9e6[_0x2d8a('0x37')]=_['intersection'](_0x3107b3['model'],qs['fields'](_0x1605ad[_0x2d8a('0x33')][_0x2d8a('0x38')]));_0x44d9e6[_0x2d8a('0x37')]=_0x44d9e6[_0x2d8a('0x37')]['length']?_0x44d9e6[_0x2d8a('0x37')]:_0x3107b3[_0x2d8a('0x32')];if(_0x1605ad[_0x2d8a('0x33')][_0x2d8a('0x43')]){_0x44d9e6[_0x2d8a('0x44')]=[{'all':!![]}];}_0x44d9e6=_[_0x2d8a('0x40')]({},_0x44d9e6,_0x1605ad['options']);return db[_0x2d8a('0x2d')][_0x2d8a('0x49')](_0x44d9e6)['then'](handleEntityNotFound(_0x5bded4,null))['then'](respondWithResult(_0x5bded4,null))[_0x2d8a('0x47')](handleError(_0x5bded4,null));};exports[_0x2d8a('0x4a')]=function(_0x51fe6e,_0x53ad24){return db[_0x2d8a('0x2d')]['create'](_0x51fe6e[_0x2d8a('0x4b')],{})[_0x2d8a('0x27')](respondWithResult(_0x53ad24,0xc9))[_0x2d8a('0x47')](handleError(_0x53ad24,null));};exports[_0x2d8a('0x26')]=function(_0x4a3732,_0x426205){if(_0x4a3732[_0x2d8a('0x4b')]['id']){delete _0x4a3732[_0x2d8a('0x4b')]['id'];}return db['SquareMessage'][_0x2d8a('0x49')]({'where':{'id':_0x4a3732[_0x2d8a('0x48')]['id']}})[_0x2d8a('0x27')](handleEntityNotFound(_0x426205,null))[_0x2d8a('0x27')](saveUpdates(_0x4a3732[_0x2d8a('0x4b')],null))[_0x2d8a('0x27')](respondWithResult(_0x426205,null))['catch'](handleError(_0x426205,null));};exports[_0x2d8a('0x28')]=function(_0x3b5324,_0x3f1cb9){return db[_0x2d8a('0x2d')][_0x2d8a('0x49')]({'where':{'id':_0x3b5324['params']['id']}})[_0x2d8a('0x27')](handleEntityNotFound(_0x3f1cb9,null))[_0x2d8a('0x27')](removeEntity(_0x3f1cb9,null))[_0x2d8a('0x47')](handleError(_0x3f1cb9,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 70b6f1c..3c4cfd3 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 _0x87a7=['request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x535b74,_0x53da59){var _0x5b56f8=function(_0x916056){while(--_0x916056){_0x535b74['push'](_0x535b74['shift']());}};_0x5b56f8(++_0x53da59);}(_0x87a7,0x1ac));var _0x787a=function(_0x5f2c63,_0x1ea8e4){_0x5f2c63=_0x5f2c63-0x0;var _0x403728=_0x87a7[_0x5f2c63];return _0x403728;};'use strict';var _=require(_0x787a('0x0'));var util=require(_0x787a('0x1'));var logger=require(_0x787a('0x2'))(_0x787a('0x3'));var moment=require(_0x787a('0x4'));var BPromise=require(_0x787a('0x5'));var rp=require(_0x787a('0x6'));var fs=require('fs');var path=require(_0x787a('0x7'));var rimraf=require(_0x787a('0x8'));var config=require(_0x787a('0x9'));var attributes=require(_0x787a('0xa'));module[_0x787a('0xb')]=function(_0x4e612b,_0xb0233f){return _0x4e612b[_0x787a('0xc')]('SquareMessage',attributes,{'tableName':_0x787a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dd6=['api','bluebird','request-promise','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2dd6,0x81));var _0x62dd=function(_0x4f04a6,_0x2d4a50){_0x4f04a6=_0x4f04a6-0x0;var _0x5aea1e=_0x2dd6[_0x4f04a6];return _0x5aea1e;};'use strict';var _=require(_0x62dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x62dd('0x1'));var moment=require('moment');var BPromise=require(_0x62dd('0x2'));var rp=require(_0x62dd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x62dd('0x4'));var attributes=require(_0x62dd('0x5'));module[_0x62dd('0x6')]=function(_0x5e9325,_0x50b4c4){return _0x5e9325[_0x62dd('0x7')](_0x62dd('0x8'),attributes,{'tableName':_0x62dd('0x9'),'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 0e3a144..67a946e 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 _0xe59a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','create','body','options','raw','CreateSquareMessage','debug','stringify','catch','moment','bluebird','ioredis'];(function(_0x3316d0,_0x239485){var _0x11193d=function(_0x4fdea7){while(--_0x4fdea7){_0x3316d0['push'](_0x3316d0['shift']());}};_0x11193d(++_0x239485);}(_0xe59a,0x131));var _0xae59=function(_0x5901d3,_0x43a6fd){_0x5901d3=_0x5901d3-0x0;var _0xc37489=_0xe59a[_0x5901d3];return _0xc37489;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae59('0x0'));var BPromise=require(_0xae59('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae59('0x2'));var db=require(_0xae59('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae59('0x4'))(_0xae59('0x5'));var config=require(_0xae59('0x6'));var jayson=require(_0xae59('0x7'));var client=jayson[_0xae59('0x8')][_0xae59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6d07e4,_0x3704c4,_0x58cc7d){return new BPromise(function(_0xcf0f6a,_0x5342cf){return client[_0xae59('0xa')](_0x6d07e4,_0x58cc7d)[_0xae59('0xb')](function(_0x1b0e42){logger[_0xae59('0xc')](_0xae59('0xd'),_0x3704c4,'request\x20sent');logger['debug'](_0xae59('0xe'),_0x3704c4,_0xae59('0xf'),JSON['stringify'](_0x1b0e42));if(_0x1b0e42[_0xae59('0x10')]){if(_0x1b0e42[_0xae59('0x10')][_0xae59('0x11')]===0x1f4){logger['error'](_0xae59('0xd'),_0x3704c4,_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);return _0x5342cf(_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);}logger[_0xae59('0x10')](_0xae59('0xd'),_0x3704c4,_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);return _0xcf0f6a(_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);}else{logger['info'](_0xae59('0xd'),_0x3704c4,_0xae59('0xf'));_0xcf0f6a(_0x1b0e42[_0xae59('0x13')]['message']);}})['catch'](function(_0x2c1553){logger[_0xae59('0x10')](_0xae59('0xd'),_0x3704c4,_0x2c1553);_0x5342cf(_0x2c1553);});});}exports['CreateSquareMessage']=function(_0x250400){var _0x150036=this;return new Promise(function(_0x2b73c2,_0x178d13){return db['SquareMessage'][_0xae59('0x14')](_0x250400[_0xae59('0x15')],{'raw':_0x250400[_0xae59('0x16')]?_0x250400[_0xae59('0x16')][_0xae59('0x17')]===undefined?!![]:![]:!![]})[_0xae59('0xb')](function(_0x140db8){logger[_0xae59('0xc')](_0xae59('0x18'),_0x250400);logger[_0xae59('0x19')](_0xae59('0x18'),_0x250400,JSON[_0xae59('0x1a')](_0x140db8));_0x2b73c2(_0x140db8);})[_0xae59('0x1b')](function(_0x4bb665){logger[_0xae59('0x10')](_0xae59('0x18'),_0x4bb665[_0xae59('0x12')],_0x250400);_0x178d13(_0x150036['error'](0x1f4,_0x4bb665[_0xae59('0x12')]));});});}; \ No newline at end of file +var _0xfc26=['SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','raw','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f882c,_0x260c16){var _0x255a0d=function(_0x2e8bf0){while(--_0x2e8bf0){_0x4f882c['push'](_0x4f882c['shift']());}};_0x255a0d(++_0x260c16);}(_0xfc26,0x12f));var _0x6fc2=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xfc26[_0x280f4a];return _0x1bb157;};'use strict';var _=require('lodash');var util=require(_0x6fc2('0x0'));var moment=require(_0x6fc2('0x1'));var BPromise=require(_0x6fc2('0x2'));var rs=require(_0x6fc2('0x3'));var fs=require('fs');var Redis=require(_0x6fc2('0x4'));var db=require(_0x6fc2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fc2('0x6'))(_0x6fc2('0x7'));var config=require(_0x6fc2('0x8'));var jayson=require(_0x6fc2('0x9'));var client=jayson[_0x6fc2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1143d7,_0x15adaf,_0x538c39){return new BPromise(function(_0x113691,_0x20208f){return client[_0x6fc2('0xb')](_0x1143d7,_0x538c39)['then'](function(_0x1a36c8){logger[_0x6fc2('0xc')](_0x6fc2('0xd'),_0x15adaf,_0x6fc2('0xe'));logger[_0x6fc2('0xf')](_0x6fc2('0x10'),_0x15adaf,_0x6fc2('0xe'),JSON['stringify'](_0x1a36c8));if(_0x1a36c8['error']){if(_0x1a36c8[_0x6fc2('0x11')][_0x6fc2('0x12')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x15adaf,_0x1a36c8[_0x6fc2('0x11')][_0x6fc2('0x13')]);return _0x20208f(_0x1a36c8[_0x6fc2('0x11')][_0x6fc2('0x13')]);}logger[_0x6fc2('0x11')](_0x6fc2('0xd'),_0x15adaf,_0x1a36c8[_0x6fc2('0x11')][_0x6fc2('0x13')]);return _0x113691(_0x1a36c8[_0x6fc2('0x11')]['message']);}else{logger[_0x6fc2('0xc')](_0x6fc2('0xd'),_0x15adaf,_0x6fc2('0xe'));_0x113691(_0x1a36c8[_0x6fc2('0x14')][_0x6fc2('0x13')]);}})[_0x6fc2('0x15')](function(_0x384cc5){logger[_0x6fc2('0x11')](_0x6fc2('0xd'),_0x15adaf,_0x384cc5);_0x20208f(_0x384cc5);});});}exports[_0x6fc2('0x16')]=function(_0x9c6be4){var _0x3404cc=this;return new Promise(function(_0x2f07c2,_0x528204){return db[_0x6fc2('0x17')][_0x6fc2('0x18')](_0x9c6be4[_0x6fc2('0x19')],{'raw':_0x9c6be4['options']?_0x9c6be4['options'][_0x6fc2('0x1a')]===undefined?!![]:![]:!![]})[_0x6fc2('0x1b')](function(_0x5ebdac){logger[_0x6fc2('0xc')](_0x6fc2('0x16'),_0x9c6be4);logger[_0x6fc2('0xf')]('CreateSquareMessage',_0x9c6be4,JSON[_0x6fc2('0x1c')](_0x5ebdac));_0x2f07c2(_0x5ebdac);})[_0x6fc2('0x15')](function(_0x1df672){logger[_0x6fc2('0x11')]('CreateSquareMessage',_0x1df672['message'],_0x9c6be4);_0x528204(_0x3404cc[_0x6fc2('0x11')](0x1f4,_0x1df672[_0x6fc2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9608520..03ca354 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 _0xb574=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','delete'];(function(_0x4dc307,_0x59e8bc){var _0x1f7a19=function(_0x1c8d14){while(--_0x1c8d14){_0x4dc307['push'](_0x4dc307['shift']());}};_0x1f7a19(++_0x59e8bc);}(_0xb574,0xff));var _0x4b57=function(_0x574da8,_0x50754f){_0x574da8=_0x574da8-0x0;var _0x4edc7b=_0xb574[_0x574da8];return _0x4edc7b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b57('0x0'));var timeout=require(_0x4b57('0x1'));var express=require(_0x4b57('0x2'));var router=express['Router']();var fs_extra=require(_0x4b57('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4b57('0x4'));var config=require(_0x4b57('0x5'));var controller=require(_0x4b57('0x6'));router[_0x4b57('0x7')]('/',auth[_0x4b57('0x8')](),controller[_0x4b57('0x9')]);router[_0x4b57('0x7')](_0x4b57('0xa'),auth['isAuthenticated'](),controller[_0x4b57('0xb')]);router['get'](_0x4b57('0xc'),auth[_0x4b57('0x8')](),timeout(_0x4b57('0xd')),controller[_0x4b57('0xe')]);router[_0x4b57('0xf')]('/',auth[_0x4b57('0x8')](),controller['create']);router['put'](_0x4b57('0xa'),auth[_0x4b57('0x8')](),controller['update']);router[_0x4b57('0x10')](_0x4b57('0xa'),auth[_0x4b57('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3eb1=['/:id/test','test','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1b4aac,_0x107091){var _0x2a627c=function(_0x273a8f){while(--_0x273a8f){_0x1b4aac['push'](_0x1b4aac['shift']());}};_0x2a627c(++_0x107091);}(_0x3eb1,0x127));var _0x13eb=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0x3eb1[_0x12b8ec];return _0x21af77;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x13eb('0x0'));var express=require(_0x13eb('0x1'));var router=express[_0x13eb('0x2')]();var fs_extra=require(_0x13eb('0x3'));var auth=require(_0x13eb('0x4'));var interaction=require(_0x13eb('0x5'));var config=require(_0x13eb('0x6'));var controller=require(_0x13eb('0x7'));router[_0x13eb('0x8')]('/',auth[_0x13eb('0x9')](),controller[_0x13eb('0xa')]);router['get'](_0x13eb('0xb'),auth[_0x13eb('0x9')](),controller[_0x13eb('0xc')]);router[_0x13eb('0x8')](_0x13eb('0xd'),auth[_0x13eb('0x9')](),timeout('15s'),controller[_0x13eb('0xe')]);router[_0x13eb('0xf')]('/',auth[_0x13eb('0x9')](),controller[_0x13eb('0x10')]);router[_0x13eb('0x11')](_0x13eb('0xb'),auth[_0x13eb('0x9')](),controller[_0x13eb('0x12')]);router[_0x13eb('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x13eb('0x14')]);module[_0x13eb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index f79465e..93c40c1 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 _0x9e99=['exports','STRING','name','sequelize'];(function(_0x44a736,_0xe931c){var _0x32f8fb=function(_0x62f2cf){while(--_0x62f2cf){_0x44a736['push'](_0x44a736['shift']());}};_0x32f8fb(++_0xe931c);}(_0x9e99,0x9b));var _0x99e9=function(_0x489fe3,_0x5ebb81){_0x489fe3=_0x489fe3-0x0;var _0x592190=_0x9e99[_0x489fe3];return _0x592190;};'use strict';var Sequelize=require(_0x99e9('0x0'));module[_0x99e9('0x1')]={'name':{'type':Sequelize[_0x99e9('0x2')],'unique':_0x99e9('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4802=['STRING','name','sequelize','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4802,0x18a));var _0x2480=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4802[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x2480('0x0'));module[_0x2480('0x1')]={'name':{'type':Sequelize[_0x2480('0x2')],'unique':_0x2480('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2480('0x2')]},'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 031d7ca..d72f8d5 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 _0xd9ca=['params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','openSync','closeSync','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','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x252ebc,_0x47b093){var _0x181ea9=function(_0x334571){while(--_0x334571){_0x252ebc['push'](_0x252ebc['shift']());}};_0x181ea9(++_0x47b093);}(_0xd9ca,0x116));var _0xad9c=function(_0x1ac4a2,_0x5d9182){_0x1ac4a2=_0x1ac4a2-0x0;var _0x508d77=_0xd9ca[_0x1ac4a2];return _0x508d77;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xad9c('0x0'));var rp=require('request-promise');var moment=require(_0xad9c('0x1'));var BPromise=require(_0xad9c('0x2'));var Mustache=require(_0xad9c('0x3'));var util=require(_0xad9c('0x4'));var path=require(_0xad9c('0x5'));var sox=require(_0xad9c('0x6'));var csv=require(_0xad9c('0x7'));var ejs=require(_0xad9c('0x8'));var fs=require('fs');var fs_extra=require(_0xad9c('0x9'));var _=require(_0xad9c('0xa'));var squel=require(_0xad9c('0xb'));var crypto=require(_0xad9c('0xc'));var jsforce=require(_0xad9c('0xd'));var deskjs=require(_0xad9c('0xe'));var toCsv=require(_0xad9c('0x7'));var querystring=require(_0xad9c('0xf'));var Papa=require('papaparse');var Redis=require(_0xad9c('0x10'));var authService=require(_0xad9c('0x11'));var qs=require(_0xad9c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xad9c('0x13'))(_0xad9c('0x14'));var utils=require(_0xad9c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bde9,_0x192f07){_0x192f07=_0x192f07||0xcc;return function(_0x410671){if(_0x410671){return _0x54bde9[_0xad9c('0x16')](_0x192f07);}return _0x54bde9[_0xad9c('0x17')](_0x192f07)[_0xad9c('0x18')]();};}function respondWithResult(_0x405d61,_0x251176){_0x251176=_0x251176||0xc8;return function(_0x308a65){if(_0x308a65){return _0x405d61[_0xad9c('0x17')](_0x251176)[_0xad9c('0x19')](_0x308a65);}};}function respondWithFilteredResult(_0x2a304b,_0x5c2ccf){return function(_0x523c7f){if(_0x523c7f){var _0x384c2e=typeof _0x5c2ccf[_0xad9c('0x1a')]==='undefined'&&typeof _0x5c2ccf[_0xad9c('0x1b')]==='undefined';var _0x463188=_0x523c7f[_0xad9c('0x1c')];var _0x1e277f=_0x384c2e?0x0:_0x5c2ccf[_0xad9c('0x1a')];var _0x15674c=_0x384c2e?_0x523c7f[_0xad9c('0x1c')]:_0x5c2ccf[_0xad9c('0x1a')]+_0x5c2ccf[_0xad9c('0x1b')];var _0x1e6b97;if(_0x15674c>=_0x463188){_0x15674c=_0x463188;_0x1e6b97=0xc8;}else{_0x1e6b97=0xce;}_0x2a304b[_0xad9c('0x17')](_0x1e6b97);return _0x2a304b[_0xad9c('0x1d')](_0xad9c('0x1e'),_0x1e277f+'-'+_0x15674c+'/'+_0x463188)[_0xad9c('0x19')](_0x523c7f);}return null;};}function patchUpdates(_0x1e0455){return function(_0x29aef2){try{jsonpatch[_0xad9c('0x1f')](_0x29aef2,_0x1e0455,!![]);}catch(_0x459393){return BPromise[_0xad9c('0x20')](_0x459393);}return _0x29aef2[_0xad9c('0x21')]();};}function saveUpdates(_0x623e36,_0x30fa36){return function(_0x42d451){if(_0x42d451){return _0x42d451['update'](_0x623e36)[_0xad9c('0x22')](function(_0x3bb2f2){return _0x3bb2f2;});}return null;};}function removeEntity(_0x5f2839,_0x5346f8){return function(_0x471f06){if(_0x471f06){return _0x471f06[_0xad9c('0x23')]()['then'](function(){var _0xfa478a=_0x471f06[_0xad9c('0x24')]({'plain':!![]});var _0x366fa7=_0xad9c('0x25');return db[_0xad9c('0x26')]['destroy']({'where':{'type':_0x366fa7,'resourceId':_0xfa478a['id']}})['then'](function(){return _0x471f06;});})[_0xad9c('0x22')](function(){_0x5f2839[_0xad9c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f9433,_0x1e711d){return function(_0x5dbbcf){if(!_0x5dbbcf){_0x4f9433[_0xad9c('0x16')](0x194);}return _0x5dbbcf;};}function handleError(_0x4d92bd,_0x4a2f0d){_0x4a2f0d=_0x4a2f0d||0x1f4;return function(_0x178ab7){logger[_0xad9c('0x27')](_0x178ab7[_0xad9c('0x28')]);if(_0x178ab7['name']){delete _0x178ab7[_0xad9c('0x29')];}_0x4d92bd[_0xad9c('0x17')](_0x4a2f0d)[_0xad9c('0x2a')](_0x178ab7);};}exports['index']=function(_0x193b56,_0x23aa74){var _0x378259={},_0x348f2e={},_0x340a55={'count':0x0,'rows':[]};var _0x565e9f=_[_0xad9c('0x2b')](db[_0xad9c('0x2c')][_0xad9c('0x2d')],function(_0x1613ec){return{'name':_0x1613ec[_0xad9c('0x2e')],'type':_0x1613ec[_0xad9c('0x2f')]['key']};});_0x348f2e['model']=_[_0xad9c('0x2b')](_0x565e9f,'name');_0x348f2e[_0xad9c('0x30')]=_['keys'](_0x193b56[_0xad9c('0x30')]);_0x348f2e[_0xad9c('0x31')]=_['intersection'](_0x348f2e['model'],_0x348f2e[_0xad9c('0x30')]);_0x378259[_0xad9c('0x32')]=_[_0xad9c('0x33')](_0x348f2e[_0xad9c('0x34')],qs['fields'](_0x193b56['query'][_0xad9c('0x35')]));_0x378259[_0xad9c('0x32')]=_0x378259[_0xad9c('0x32')][_0xad9c('0x36')]?_0x378259['attributes']:_0x348f2e['model'];if(!_0x193b56[_0xad9c('0x30')][_0xad9c('0x37')](_0xad9c('0x38'))){_0x378259['limit']=qs[_0xad9c('0x1b')](_0x193b56['query'][_0xad9c('0x1b')]);_0x378259[_0xad9c('0x1a')]=qs['offset'](_0x193b56[_0xad9c('0x30')][_0xad9c('0x1a')]);}_0x378259[_0xad9c('0x39')]=qs[_0xad9c('0x3a')](_0x193b56[_0xad9c('0x30')][_0xad9c('0x3a')]);_0x378259[_0xad9c('0x3b')]=qs['filters'](_[_0xad9c('0x3c')](_0x193b56[_0xad9c('0x30')],_0x348f2e[_0xad9c('0x31')]),_0x565e9f);if(_0x193b56['query'][_0xad9c('0x3d')]){_0x378259[_0xad9c('0x3b')]=_[_0xad9c('0x3e')](_0x378259[_0xad9c('0x3b')],{'$or':_[_0xad9c('0x2b')](_0x565e9f,function(_0x81337f){if(_0x81337f[_0xad9c('0x2f')]!==_0xad9c('0x3f')){var _0x14383b={};_0x14383b[_0x81337f[_0xad9c('0x29')]]={'$like':'%'+_0x193b56[_0xad9c('0x30')][_0xad9c('0x3d')]+'%'};return _0x14383b;}})});}_0x378259=_[_0xad9c('0x3e')]({},_0x378259,_0x193b56[_0xad9c('0x40')]);var _0x3d7905={'where':_0x378259[_0xad9c('0x3b')]};return db[_0xad9c('0x2c')][_0xad9c('0x1c')](_0x3d7905)[_0xad9c('0x22')](function(_0x317cfc){_0x340a55[_0xad9c('0x1c')]=_0x317cfc;if(_0x193b56[_0xad9c('0x30')][_0xad9c('0x41')]){_0x378259[_0xad9c('0x42')]=[{'all':!![]}];}return db[_0xad9c('0x2c')][_0xad9c('0x43')](_0x378259);})[_0xad9c('0x22')](function(_0x5d8566){_0x340a55[_0xad9c('0x44')]=_0x5d8566;return _0x340a55;})['then'](respondWithFilteredResult(_0x23aa74,_0x378259))[_0xad9c('0x45')](handleError(_0x23aa74,null));};exports['show']=function(_0x1de629,_0xd3652f){var _0x1d3863={'raw':!![],'where':{'id':_0x1de629[_0xad9c('0x46')]['id']}},_0x31fa19={};_0x31fa19[_0xad9c('0x34')]=_[_0xad9c('0x47')](db['SquareOdbc'][_0xad9c('0x2d')]);_0x31fa19[_0xad9c('0x30')]=_[_0xad9c('0x47')](_0x1de629[_0xad9c('0x30')]);_0x31fa19[_0xad9c('0x31')]=_['intersection'](_0x31fa19[_0xad9c('0x34')],_0x31fa19[_0xad9c('0x30')]);_0x1d3863['attributes']=_[_0xad9c('0x33')](_0x31fa19[_0xad9c('0x34')],qs[_0xad9c('0x35')](_0x1de629[_0xad9c('0x30')]['fields']));_0x1d3863[_0xad9c('0x32')]=_0x1d3863[_0xad9c('0x32')]['length']?_0x1d3863[_0xad9c('0x32')]:_0x31fa19[_0xad9c('0x34')];if(_0x1de629[_0xad9c('0x30')]['includeAll']){_0x1d3863['include']=[{'all':!![]}];}_0x1d3863=_[_0xad9c('0x3e')]({},_0x1d3863,_0x1de629['options']);return db[_0xad9c('0x2c')][_0xad9c('0x48')](_0x1d3863)[_0xad9c('0x22')](handleEntityNotFound(_0xd3652f,null))[_0xad9c('0x22')](respondWithResult(_0xd3652f,null))['catch'](handleError(_0xd3652f,null));};exports[_0xad9c('0x49')]=function(_0x30b938,_0x2a002c){return db[_0xad9c('0x2c')]['create'](_0x30b938[_0xad9c('0x4a')],{})['then'](function(_0x55dc23){var _0x4f3bd1=_0x30b938[_0xad9c('0x4b')][_0xad9c('0x24')]({'plain':!![]});if(!_0x4f3bd1)throw new Error(_0xad9c('0x4c'));if(_0x4f3bd1['role']===_0xad9c('0x4b')){var _0x124e41=_0x55dc23[_0xad9c('0x24')]({'plain':!![]});var _0x391cc6=_0xad9c('0x25');return db[_0xad9c('0x4d')][_0xad9c('0x48')]({'where':{'name':_0x391cc6,'userProfileId':_0x4f3bd1[_0xad9c('0x4e')]},'raw':!![]})['then'](function(_0x9d4abe){if(_0x9d4abe&&_0x9d4abe[_0xad9c('0x4f')]===0x0){return db[_0xad9c('0x26')]['create']({'name':_0x124e41[_0xad9c('0x29')],'resourceId':_0x124e41['id'],'type':_0x9d4abe[_0xad9c('0x29')],'sectionId':_0x9d4abe['id']},{})[_0xad9c('0x22')](function(){return _0x55dc23;});}else{return _0x55dc23;}})[_0xad9c('0x45')](function(_0x1680ad){logger['error'](_0xad9c('0x50'),_0x1680ad);throw _0x1680ad;});}return _0x55dc23;})['then'](respondWithResult(_0x2a002c,0xc9))[_0xad9c('0x45')](handleError(_0x2a002c,null));};exports[_0xad9c('0x51')]=function(_0x313a9b,_0x24fdbf){if(_0x313a9b[_0xad9c('0x4a')]['id']){delete _0x313a9b[_0xad9c('0x4a')]['id'];}return db[_0xad9c('0x2c')][_0xad9c('0x48')]({'where':{'id':_0x313a9b[_0xad9c('0x46')]['id']}})[_0xad9c('0x22')](handleEntityNotFound(_0x24fdbf,null))[_0xad9c('0x22')](saveUpdates(_0x313a9b['body'],null))[_0xad9c('0x22')](respondWithResult(_0x24fdbf,null))[_0xad9c('0x45')](handleError(_0x24fdbf,null));};exports[_0xad9c('0x23')]=function(_0x18d1be,_0x233505){return db[_0xad9c('0x2c')]['find']({'where':{'id':_0x18d1be[_0xad9c('0x46')]['id']}})[_0xad9c('0x22')](handleEntityNotFound(_0x233505,null))[_0xad9c('0x22')](removeEntity(_0x233505,null))[_0xad9c('0x45')](handleError(_0x233505,null));};exports[_0xad9c('0x52')]=function(_0x280089,_0x141018,_0x4d7d09){var _0x5bac8a;return db[_0xad9c('0x2c')]['find']({'where':{'id':_0x280089[_0xad9c('0x46')]['id']},'attributes':['id',_0xad9c('0x53')]})[_0xad9c('0x22')](handleEntityNotFound(_0x141018,null))['then'](function(_0x13c5a0){if(_0x13c5a0){var _0x1f8b1c=require(_0xad9c('0x54'))();_0x1f8b1c[_0xad9c('0x55')](_0x13c5a0[_0xad9c('0x53')]);_0x1f8b1c[_0xad9c('0x56')]();return _0x13c5a0;}})[_0xad9c('0x22')](respondWithResult(_0x141018,null))[_0xad9c('0x45')](handleError(_0x141018,null));}; \ No newline at end of file +var _0xb5c1=['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','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','SquareOdbc','include','catch','show','params','includeAll','find','create','user','role','UserProfileSection','autoAssociation','body','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x37a65b,_0x20f100){var _0x2c38c0=function(_0x3b2f1c){while(--_0x3b2f1c){_0x37a65b['push'](_0x37a65b['shift']());}};_0x2c38c0(++_0x20f100);}(_0xb5c1,0x1ea));var _0x1b5c=function(_0x3edb6d,_0x324624){_0x3edb6d=_0x3edb6d-0x0;var _0x59a15e=_0xb5c1[_0x3edb6d];return _0x59a15e;};'use strict';var emlformat=require(_0x1b5c('0x0'));var rimraf=require(_0x1b5c('0x1'));var zipdir=require(_0x1b5c('0x2'));var jsonpatch=require(_0x1b5c('0x3'));var rp=require(_0x1b5c('0x4'));var moment=require(_0x1b5c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b5c('0x6'));var util=require(_0x1b5c('0x7'));var path=require(_0x1b5c('0x8'));var sox=require(_0x1b5c('0x9'));var csv=require(_0x1b5c('0xa'));var ejs=require(_0x1b5c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b5c('0xc'));var squel=require(_0x1b5c('0xd'));var crypto=require('crypto');var jsforce=require(_0x1b5c('0xe'));var deskjs=require(_0x1b5c('0xf'));var toCsv=require(_0x1b5c('0xa'));var querystring=require('querystring');var Papa=require(_0x1b5c('0x10'));var Redis=require('ioredis');var authService=require(_0x1b5c('0x11'));var qs=require(_0x1b5c('0x12'));var as=require(_0x1b5c('0x13'));var hardwareService=require(_0x1b5c('0x14'));var logger=require(_0x1b5c('0x15'))('api');var utils=require(_0x1b5c('0x16'));var config=require(_0x1b5c('0x17'));var licenseUtil=require(_0x1b5c('0x18'));var db=require(_0x1b5c('0x19'))['db'];function respondWithStatusCode(_0x16df1e,_0x22b879){_0x22b879=_0x22b879||0xcc;return function(_0x47927f){if(_0x47927f){return _0x16df1e[_0x1b5c('0x1a')](_0x22b879);}return _0x16df1e['status'](_0x22b879)[_0x1b5c('0x1b')]();};}function respondWithResult(_0x275879,_0x309842){_0x309842=_0x309842||0xc8;return function(_0x1c33ea){if(_0x1c33ea){return _0x275879[_0x1b5c('0x1c')](_0x309842)[_0x1b5c('0x1d')](_0x1c33ea);}};}function respondWithFilteredResult(_0x1e980d,_0x54e3bf){return function(_0x1e0c61){if(_0x1e0c61){var _0x2725a0=typeof _0x54e3bf[_0x1b5c('0x1e')]===_0x1b5c('0x1f')&&typeof _0x54e3bf[_0x1b5c('0x20')]===_0x1b5c('0x1f');var _0x120782=_0x1e0c61[_0x1b5c('0x21')];var _0xa642af=_0x2725a0?0x0:_0x54e3bf[_0x1b5c('0x1e')];var _0x204612=_0x2725a0?_0x1e0c61['count']:_0x54e3bf[_0x1b5c('0x1e')]+_0x54e3bf[_0x1b5c('0x20')];var _0xd3a1a;if(_0x204612>=_0x120782){_0x204612=_0x120782;_0xd3a1a=0xc8;}else{_0xd3a1a=0xce;}_0x1e980d[_0x1b5c('0x1c')](_0xd3a1a);return _0x1e980d[_0x1b5c('0x22')](_0x1b5c('0x23'),_0xa642af+'-'+_0x204612+'/'+_0x120782)[_0x1b5c('0x1d')](_0x1e0c61);}return null;};}function patchUpdates(_0x19717d){return function(_0x4c9d9f){try{jsonpatch['apply'](_0x4c9d9f,_0x19717d,!![]);}catch(_0x560d28){return BPromise[_0x1b5c('0x24')](_0x560d28);}return _0x4c9d9f['save']();};}function saveUpdates(_0xc17dba,_0x3967a0){return function(_0x13a340){if(_0x13a340){return _0x13a340[_0x1b5c('0x25')](_0xc17dba)[_0x1b5c('0x26')](function(_0xffc452){return _0xffc452;});}return null;};}function removeEntity(_0x3ba1c3,_0x1be063){return function(_0x2669dd){if(_0x2669dd){return _0x2669dd[_0x1b5c('0x27')]()[_0x1b5c('0x26')](function(){var _0xea7d86=_0x2669dd[_0x1b5c('0x28')]({'plain':!![]});var _0x354fe8=_0x1b5c('0x29');return db[_0x1b5c('0x2a')][_0x1b5c('0x27')]({'where':{'type':_0x354fe8,'resourceId':_0xea7d86['id']}})[_0x1b5c('0x26')](function(){return _0x2669dd;});})['then'](function(){_0x3ba1c3['status'](0xcc)[_0x1b5c('0x1b')]();});}};}function handleEntityNotFound(_0xa7814,_0x200192){return function(_0x2251ef){if(!_0x2251ef){_0xa7814[_0x1b5c('0x1a')](0x194);}return _0x2251ef;};}function handleError(_0x13447a,_0x226492){_0x226492=_0x226492||0x1f4;return function(_0x13b08c){logger[_0x1b5c('0x2b')](_0x13b08c[_0x1b5c('0x2c')]);if(_0x13b08c[_0x1b5c('0x2d')]){delete _0x13b08c[_0x1b5c('0x2d')];}_0x13447a[_0x1b5c('0x1c')](_0x226492)[_0x1b5c('0x2e')](_0x13b08c);};}exports['index']=function(_0x174761,_0x253802){var _0x4f2196={},_0x213cbc={},_0x3dd1cc={'count':0x0,'rows':[]};var _0x44315d=_['map'](db['SquareOdbc'][_0x1b5c('0x2f')],function(_0x56e00c){return{'name':_0x56e00c[_0x1b5c('0x30')],'type':_0x56e00c[_0x1b5c('0x31')]['key']};});_0x213cbc['model']=_[_0x1b5c('0x32')](_0x44315d,'name');_0x213cbc[_0x1b5c('0x33')]=_[_0x1b5c('0x34')](_0x174761['query']);_0x213cbc[_0x1b5c('0x35')]=_[_0x1b5c('0x36')](_0x213cbc[_0x1b5c('0x37')],_0x213cbc[_0x1b5c('0x33')]);_0x4f2196['attributes']=_[_0x1b5c('0x36')](_0x213cbc[_0x1b5c('0x37')],qs[_0x1b5c('0x38')](_0x174761[_0x1b5c('0x33')][_0x1b5c('0x38')]));_0x4f2196['attributes']=_0x4f2196[_0x1b5c('0x39')][_0x1b5c('0x3a')]?_0x4f2196['attributes']:_0x213cbc[_0x1b5c('0x37')];if(!_0x174761[_0x1b5c('0x33')]['hasOwnProperty']('nolimit')){_0x4f2196['limit']=qs[_0x1b5c('0x20')](_0x174761[_0x1b5c('0x33')][_0x1b5c('0x20')]);_0x4f2196['offset']=qs[_0x1b5c('0x1e')](_0x174761[_0x1b5c('0x33')][_0x1b5c('0x1e')]);}_0x4f2196[_0x1b5c('0x3b')]=qs[_0x1b5c('0x3c')](_0x174761[_0x1b5c('0x33')]['sort']);_0x4f2196[_0x1b5c('0x3d')]=qs['filters'](_[_0x1b5c('0x3e')](_0x174761[_0x1b5c('0x33')],_0x213cbc['filters']),_0x44315d);if(_0x174761[_0x1b5c('0x33')]['filter']){_0x4f2196[_0x1b5c('0x3d')]=_['merge'](_0x4f2196[_0x1b5c('0x3d')],{'$or':_[_0x1b5c('0x32')](_0x44315d,function(_0x3be255){if(_0x3be255[_0x1b5c('0x31')]!=='VIRTUAL'){var _0x562baf={};_0x562baf[_0x3be255[_0x1b5c('0x2d')]]={'$like':'%'+_0x174761[_0x1b5c('0x33')][_0x1b5c('0x3f')]+'%'};return _0x562baf;}})});}_0x4f2196=_[_0x1b5c('0x40')]({},_0x4f2196,_0x174761[_0x1b5c('0x41')]);var _0xb46350={'where':_0x4f2196[_0x1b5c('0x3d')]};return db[_0x1b5c('0x42')][_0x1b5c('0x21')](_0xb46350)[_0x1b5c('0x26')](function(_0x185ae1){_0x3dd1cc['count']=_0x185ae1;if(_0x174761['query']['includeAll']){_0x4f2196[_0x1b5c('0x43')]=[{'all':!![]}];}return db[_0x1b5c('0x42')]['findAll'](_0x4f2196);})[_0x1b5c('0x26')](function(_0xbc679f){_0x3dd1cc['rows']=_0xbc679f;return _0x3dd1cc;})[_0x1b5c('0x26')](respondWithFilteredResult(_0x253802,_0x4f2196))[_0x1b5c('0x44')](handleError(_0x253802,null));};exports[_0x1b5c('0x45')]=function(_0x45dbb7,_0x15c568){var _0x542525={'raw':!![],'where':{'id':_0x45dbb7[_0x1b5c('0x46')]['id']}},_0x27ac19={};_0x27ac19[_0x1b5c('0x37')]=_['keys'](db[_0x1b5c('0x42')][_0x1b5c('0x2f')]);_0x27ac19[_0x1b5c('0x33')]=_[_0x1b5c('0x34')](_0x45dbb7['query']);_0x27ac19[_0x1b5c('0x35')]=_[_0x1b5c('0x36')](_0x27ac19['model'],_0x27ac19[_0x1b5c('0x33')]);_0x542525['attributes']=_['intersection'](_0x27ac19[_0x1b5c('0x37')],qs[_0x1b5c('0x38')](_0x45dbb7['query'][_0x1b5c('0x38')]));_0x542525[_0x1b5c('0x39')]=_0x542525[_0x1b5c('0x39')]['length']?_0x542525[_0x1b5c('0x39')]:_0x27ac19[_0x1b5c('0x37')];if(_0x45dbb7[_0x1b5c('0x33')][_0x1b5c('0x47')]){_0x542525[_0x1b5c('0x43')]=[{'all':!![]}];}_0x542525=_[_0x1b5c('0x40')]({},_0x542525,_0x45dbb7[_0x1b5c('0x41')]);return db[_0x1b5c('0x42')][_0x1b5c('0x48')](_0x542525)[_0x1b5c('0x26')](handleEntityNotFound(_0x15c568,null))[_0x1b5c('0x26')](respondWithResult(_0x15c568,null))[_0x1b5c('0x44')](handleError(_0x15c568,null));};exports[_0x1b5c('0x49')]=function(_0xda3021,_0x3f70ed){return db[_0x1b5c('0x42')][_0x1b5c('0x49')](_0xda3021['body'],{})[_0x1b5c('0x26')](function(_0x2e9599){var _0x6e52ed=_0xda3021[_0x1b5c('0x4a')][_0x1b5c('0x28')]({'plain':!![]});if(!_0x6e52ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6e52ed[_0x1b5c('0x4b')]===_0x1b5c('0x4a')){var _0x453e86=_0x2e9599[_0x1b5c('0x28')]({'plain':!![]});var _0x203ae5=_0x1b5c('0x29');return db[_0x1b5c('0x4c')]['find']({'where':{'name':_0x203ae5,'userProfileId':_0x6e52ed['userProfileId']},'raw':!![]})[_0x1b5c('0x26')](function(_0x49e959){if(_0x49e959&&_0x49e959[_0x1b5c('0x4d')]===0x0){return db[_0x1b5c('0x2a')][_0x1b5c('0x49')]({'name':_0x453e86[_0x1b5c('0x2d')],'resourceId':_0x453e86['id'],'type':_0x49e959['name'],'sectionId':_0x49e959['id']},{})[_0x1b5c('0x26')](function(){return _0x2e9599;});}else{return _0x2e9599;}})['catch'](function(_0x497cd5){logger[_0x1b5c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x497cd5);throw _0x497cd5;});}return _0x2e9599;})[_0x1b5c('0x26')](respondWithResult(_0x3f70ed,0xc9))[_0x1b5c('0x44')](handleError(_0x3f70ed,null));};exports[_0x1b5c('0x25')]=function(_0x55d03a,_0x1572ea){if(_0x55d03a[_0x1b5c('0x4e')]['id']){delete _0x55d03a[_0x1b5c('0x4e')]['id'];}return db[_0x1b5c('0x42')][_0x1b5c('0x48')]({'where':{'id':_0x55d03a[_0x1b5c('0x46')]['id']}})[_0x1b5c('0x26')](handleEntityNotFound(_0x1572ea,null))[_0x1b5c('0x26')](saveUpdates(_0x55d03a[_0x1b5c('0x4e')],null))[_0x1b5c('0x26')](respondWithResult(_0x1572ea,null))[_0x1b5c('0x44')](handleError(_0x1572ea,null));};exports['destroy']=function(_0x444bf1,_0x1ed9db){return db['SquareOdbc'][_0x1b5c('0x48')]({'where':{'id':_0x444bf1['params']['id']}})['then'](handleEntityNotFound(_0x1ed9db,null))['then'](removeEntity(_0x1ed9db,null))[_0x1b5c('0x44')](handleError(_0x1ed9db,null));};exports[_0x1b5c('0x4f')]=function(_0x43802b,_0x134fe7,_0x32e481){var _0x328315;return db[_0x1b5c('0x42')][_0x1b5c('0x48')]({'where':{'id':_0x43802b['params']['id']},'attributes':['id',_0x1b5c('0x50')]})['then'](handleEntityNotFound(_0x134fe7,null))['then'](function(_0x442fa0){if(_0x442fa0){var _0x9e306a=require(_0x1b5c('0x51'))();_0x9e306a[_0x1b5c('0x52')](_0x442fa0[_0x1b5c('0x50')]);_0x9e306a[_0x1b5c('0x53')]();return _0x442fa0;}})[_0x1b5c('0x26')](respondWithResult(_0x134fe7,null))[_0x1b5c('0x44')](handleError(_0x134fe7,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 59c4f93..71492b4 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 _0x8876=['square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x1ae449,_0x2fe441){var _0x5c7cee=function(_0x442301){while(--_0x442301){_0x1ae449['push'](_0x1ae449['shift']());}};_0x5c7cee(++_0x2fe441);}(_0x8876,0x1a3));var _0x6887=function(_0x222c4c,_0x44d3b2){_0x222c4c=_0x222c4c-0x0;var _0x54c2c0=_0x8876[_0x222c4c];return _0x54c2c0;};'use strict';var _=require(_0x6887('0x0'));var util=require('util');var logger=require(_0x6887('0x1'))(_0x6887('0x2'));var moment=require(_0x6887('0x3'));var BPromise=require(_0x6887('0x4'));var rp=require(_0x6887('0x5'));var fs=require('fs');var path=require(_0x6887('0x6'));var rimraf=require(_0x6887('0x7'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x6887('0x8')]=function(_0x499ae8,_0x223eff){return _0x499ae8[_0x6887('0x9')]('SquareOdbc',attributes,{'tableName':_0x6887('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe64c=['path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3493d5,_0x3ababa){var _0x173f5a=function(_0x1edb96){while(--_0x1edb96){_0x3493d5['push'](_0x3493d5['shift']());}};_0x173f5a(++_0x3ababa);}(_0xe64c,0xc9));var _0xce64=function(_0x40a110,_0x4bad90){_0x40a110=_0x40a110-0x0;var _0x1418c9=_0xe64c[_0x40a110];return _0x1418c9;};'use strict';var _=require(_0xce64('0x0'));var util=require(_0xce64('0x1'));var logger=require(_0xce64('0x2'))(_0xce64('0x3'));var moment=require(_0xce64('0x4'));var BPromise=require(_0xce64('0x5'));var rp=require(_0xce64('0x6'));var fs=require('fs');var path=require(_0xce64('0x7'));var rimraf=require(_0xce64('0x8'));var config=require(_0xce64('0x9'));var attributes=require(_0xce64('0xa'));module['exports']=function(_0x1e9953,_0x1c0884){return _0x1e9953['define'](_0xce64('0xb'),attributes,{'tableName':_0xce64('0xc'),'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 f6f2428..a3da7d9 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 _0xc698=['error','code','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','attributes','include','model','map','then','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xc698,0x1a4));var _0x8c69=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xc698[_0x37b3e5];return _0x207f20;};'use strict';var _=require(_0x8c69('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8c69('0x1'));var rs=require(_0x8c69('0x2'));var fs=require('fs');var Redis=require(_0x8c69('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c69('0x4'));var logger=require(_0x8c69('0x5'))('rpc');var config=require(_0x8c69('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8c69('0x7')][_0x8c69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x389af0,_0x35a720,_0x2602b2){return new BPromise(function(_0x59e1f0,_0x4185e9){return client[_0x8c69('0x9')](_0x389af0,_0x2602b2)['then'](function(_0x2a6efa){logger['info'](_0x8c69('0xa'),_0x35a720,_0x8c69('0xb'));logger[_0x8c69('0xc')](_0x8c69('0xd'),_0x35a720,_0x8c69('0xb'),JSON[_0x8c69('0xe')](_0x2a6efa));if(_0x2a6efa[_0x8c69('0xf')]){if(_0x2a6efa['error'][_0x8c69('0x10')]===0x1f4){logger[_0x8c69('0xf')](_0x8c69('0xa'),_0x35a720,_0x2a6efa['error'][_0x8c69('0x11')]);return _0x4185e9(_0x2a6efa[_0x8c69('0xf')]['message']);}logger[_0x8c69('0xf')](_0x8c69('0xa'),_0x35a720,_0x2a6efa['error'][_0x8c69('0x11')]);return _0x59e1f0(_0x2a6efa[_0x8c69('0xf')]['message']);}else{logger[_0x8c69('0x12')](_0x8c69('0xa'),_0x35a720,_0x8c69('0xb'));_0x59e1f0(_0x2a6efa['result'][_0x8c69('0x11')]);}})[_0x8c69('0x13')](function(_0x347677){logger[_0x8c69('0xf')](_0x8c69('0xa'),_0x35a720,_0x347677);_0x4185e9(_0x347677);});});}exports[_0x8c69('0x14')]=function(_0x39bc8d){var _0x10b80f=this;return new Promise(function(_0x5d1136,_0x114aaa){return db[_0x8c69('0x15')][_0x8c69('0x16')]({'raw':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d[_0x8c69('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d['options']['where']||null:null,'attributes':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d[_0x8c69('0x17')][_0x8c69('0x18')]||null:null,'include':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d[_0x8c69('0x17')][_0x8c69('0x19')]?_['map'](_0x39bc8d[_0x8c69('0x17')][_0x8c69('0x19')],function(_0x42b4a7){return{'model':db[_0x42b4a7[_0x8c69('0x1a')]],'as':_0x42b4a7['as'],'attributes':_0x42b4a7[_0x8c69('0x18')],'include':_0x42b4a7[_0x8c69('0x19')]?_['map'](_0x42b4a7[_0x8c69('0x19')],function(_0x39935c){return{'model':db[_0x39935c[_0x8c69('0x1a')]],'as':_0x39935c['as'],'attributes':_0x39935c['attributes'],'include':_0x39935c['include']?_[_0x8c69('0x1b')](_0x39935c['include'],function(_0x518960){return{'model':db[_0x518960[_0x8c69('0x1a')]],'as':_0x518960['as'],'attributes':_0x518960['attributes']};}):[]};}):[]};}):[]:[]})[_0x8c69('0x1c')](function(_0x573a03){logger[_0x8c69('0x12')](_0x8c69('0x14'),_0x39bc8d);logger[_0x8c69('0xc')]('ShowSquareOdbc',_0x39bc8d,JSON[_0x8c69('0xe')](_0x573a03));_0x5d1136(_0x573a03);})['catch'](function(_0x58b391){logger[_0x8c69('0xf')](_0x8c69('0x14'),_0x58b391['message'],_0x39bc8d);_0x114aaa(_0x10b80f[_0x8c69('0xf')](0x1f4,_0x58b391[_0x8c69('0x11')]));});});}; \ No newline at end of file +var _0x93e9=['message','result','catch','ShowSquareOdbc','find','options','raw','where','include','map','model','attributes','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','SquareOdbc,\x20%s,\x20%s'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x93e9,0x1a0));var _0x993e=function(_0x4890df,_0x4f9aa0){_0x4890df=_0x4890df-0x0;var _0x23f6be=_0x93e9[_0x4890df];return _0x23f6be;};'use strict';var _=require('lodash');var util=require(_0x993e('0x0'));var moment=require(_0x993e('0x1'));var BPromise=require('bluebird');var rs=require(_0x993e('0x2'));var fs=require('fs');var Redis=require(_0x993e('0x3'));var db=require(_0x993e('0x4'))['db'];var utils=require(_0x993e('0x5'));var logger=require('../../config/logger')(_0x993e('0x6'));var config=require(_0x993e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x993e('0x8')][_0x993e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1337b4,_0x36c4ad,_0x33ace1){return new BPromise(function(_0x30d4c2,_0x586d16){return client[_0x993e('0xa')](_0x1337b4,_0x33ace1)[_0x993e('0xb')](function(_0x39aa7b){logger[_0x993e('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x36c4ad,_0x993e('0xd'));logger[_0x993e('0xe')](_0x993e('0xf'),_0x36c4ad,_0x993e('0xd'),JSON['stringify'](_0x39aa7b));if(_0x39aa7b[_0x993e('0x10')]){if(_0x39aa7b[_0x993e('0x10')]['code']===0x1f4){logger[_0x993e('0x10')](_0x993e('0x11'),_0x36c4ad,_0x39aa7b[_0x993e('0x10')][_0x993e('0x12')]);return _0x586d16(_0x39aa7b[_0x993e('0x10')]['message']);}logger['error'](_0x993e('0x11'),_0x36c4ad,_0x39aa7b['error'][_0x993e('0x12')]);return _0x30d4c2(_0x39aa7b[_0x993e('0x10')]['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x36c4ad,'request\x20sent');_0x30d4c2(_0x39aa7b[_0x993e('0x13')][_0x993e('0x12')]);}})[_0x993e('0x14')](function(_0x3a8187){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x36c4ad,_0x3a8187);_0x586d16(_0x3a8187);});});}exports[_0x993e('0x15')]=function(_0x4f1ecb){var _0x3fda31=this;return new Promise(function(_0x2bdd47,_0x109328){return db['SquareOdbc'][_0x993e('0x16')]({'raw':_0x4f1ecb[_0x993e('0x17')]?_0x4f1ecb['options'][_0x993e('0x18')]===undefined?!![]:![]:!![],'where':_0x4f1ecb[_0x993e('0x17')]?_0x4f1ecb['options'][_0x993e('0x19')]||null:null,'attributes':_0x4f1ecb[_0x993e('0x17')]?_0x4f1ecb['options']['attributes']||null:null,'include':_0x4f1ecb[_0x993e('0x17')]?_0x4f1ecb[_0x993e('0x17')][_0x993e('0x1a')]?_[_0x993e('0x1b')](_0x4f1ecb[_0x993e('0x17')][_0x993e('0x1a')],function(_0x304450){return{'model':db[_0x304450[_0x993e('0x1c')]],'as':_0x304450['as'],'attributes':_0x304450['attributes'],'include':_0x304450[_0x993e('0x1a')]?_[_0x993e('0x1b')](_0x304450[_0x993e('0x1a')],function(_0x8fd211){return{'model':db[_0x8fd211[_0x993e('0x1c')]],'as':_0x8fd211['as'],'attributes':_0x8fd211['attributes'],'include':_0x8fd211[_0x993e('0x1a')]?_['map'](_0x8fd211[_0x993e('0x1a')],function(_0x4366ca){return{'model':db[_0x4366ca[_0x993e('0x1c')]],'as':_0x4366ca['as'],'attributes':_0x4366ca[_0x993e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b9682){logger[_0x993e('0xc')](_0x993e('0x15'),_0x4f1ecb);logger['debug'](_0x993e('0x15'),_0x4f1ecb,JSON[_0x993e('0x1e')](_0x5b9682));_0x2bdd47(_0x5b9682);})[_0x993e('0x14')](function(_0x28ad28){logger['error'](_0x993e('0x15'),_0x28ad28['message'],_0x4f1ecb);_0x109328(_0x3fda31[_0x993e('0x10')](0x1f4,_0x28ad28[_0x993e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3523b99..d23187f 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 _0x0d2c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x194016,_0x12572a){var _0x5aae35=function(_0x578ab3){while(--_0x578ab3){_0x194016['push'](_0x194016['shift']());}};_0x5aae35(++_0x12572a);}(_0x0d2c,0x1f4));var _0xc0d2=function(_0x2e586b,_0x3a5429){_0x2e586b=_0x2e586b-0x0;var _0x3474a1=_0x0d2c[_0x2e586b];return _0x3474a1;};'use strict';var multer=require(_0xc0d2('0x0'));var util=require(_0xc0d2('0x1'));var path=require(_0xc0d2('0x2'));var timeout=require(_0xc0d2('0x3'));var express=require(_0xc0d2('0x4'));var router=express[_0xc0d2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc0d2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc0d2('0x7'));var controller=require(_0xc0d2('0x8'));router[_0xc0d2('0x9')]('/',auth[_0xc0d2('0xa')](),controller[_0xc0d2('0xb')]);router[_0xc0d2('0x9')](_0xc0d2('0xc'),auth[_0xc0d2('0xa')](),controller[_0xc0d2('0xd')]);router[_0xc0d2('0xe')]('/',auth['isAuthenticated'](),controller[_0xc0d2('0xf')]);router[_0xc0d2('0x10')](_0xc0d2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc0d2('0x11')](_0xc0d2('0xc'),auth[_0xc0d2('0xa')](),controller[_0xc0d2('0x12')]);module[_0xc0d2('0x13')]=router; \ No newline at end of file +var _0xc7ba=['create','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','post'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xc7ba,0x155));var _0xac7b=function(_0x556e2e,_0x5381d8){_0x556e2e=_0x556e2e-0x0;var _0x1564ec=_0xc7ba[_0x556e2e];return _0x1564ec;};'use strict';var multer=require(_0xac7b('0x0'));var util=require(_0xac7b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac7b('0x2'));var router=express[_0xac7b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xac7b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xac7b('0x5'));var controller=require(_0xac7b('0x6'));router[_0xac7b('0x7')]('/',auth[_0xac7b('0x8')](),controller[_0xac7b('0x9')]);router['get']('/:id',auth[_0xac7b('0x8')](),controller['show']);router[_0xac7b('0xa')]('/',auth[_0xac7b('0x8')](),controller[_0xac7b('0xb')]);router['put']('/:id',auth[_0xac7b('0x8')](),controller[_0xac7b('0xc')]);router[_0xac7b('0xd')]('/:id',auth[_0xac7b('0x8')](),controller[_0xac7b('0xe')]);module[_0xac7b('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 4e68179..a494f3e 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 _0xbc5a=['BLOB','production','DATE','exports','STRING','name','long','preproduction','getDataValue','toString'];(function(_0x98db33,_0x397f20){var _0x5ae63a=function(_0x411f1c){while(--_0x411f1c){_0x98db33['push'](_0x98db33['shift']());}};_0x5ae63a(++_0x397f20);}(_0xbc5a,0x193));var _0xabc5=function(_0x2be67f,_0x238c6d){_0x2be67f=_0x2be67f-0x0;var _0x1d94b4=_0xbc5a[_0x2be67f];return _0x1d94b4;};'use strict';var Sequelize=require('sequelize');module[_0xabc5('0x0')]={'name':{'type':Sequelize[_0xabc5('0x1')],'unique':_0xabc5('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0xabc5('0x3')),'get':function(){if(this['getDataValue'](_0xabc5('0x4'))){return this[_0xabc5('0x5')](_0xabc5('0x4'))[_0xabc5('0x6')]('utf8');}}},'production':{'type':Sequelize[_0xabc5('0x7')](_0xabc5('0x3')),'get':function(){if(this['getDataValue']('production')){return this[_0xabc5('0x5')](_0xabc5('0x8'))[_0xabc5('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0xabc5('0x9')]},'publishedAt':{'type':Sequelize[_0xabc5('0x9')]}}; \ No newline at end of file +var _0xc177=['production','DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xc177,0x1b2));var _0x7c17=function(_0x1e648e,_0x28f54e){_0x1e648e=_0x1e648e-0x0;var _0xfe9991=_0xc177[_0x1e648e];return _0xfe9991;};'use strict';var Sequelize=require(_0x7c17('0x0'));module[_0x7c17('0x1')]={'name':{'type':Sequelize[_0x7c17('0x2')],'unique':_0x7c17('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7c17('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x7c17('0x4')](_0x7c17('0x5')),'get':function(){if(this[_0x7c17('0x6')](_0x7c17('0x7'))){return this['getDataValue'](_0x7c17('0x7'))[_0x7c17('0x8')](_0x7c17('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x7c17('0x5')),'get':function(){if(this[_0x7c17('0x6')](_0x7c17('0xa'))){return this[_0x7c17('0x6')](_0x7c17('0xa'))[_0x7c17('0x8')](_0x7c17('0x9'));}}},'savedAt':{'type':Sequelize[_0x7c17('0xb')]},'publishedAt':{'type':Sequelize[_0x7c17('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ca02842..de63256 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 _0xbb17=['where','pick','merge','map','SquareProject','include','catch','show','params','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','production','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','limit','undefined','count','Content-Range','then','get','SquareProjects','UserProfileResource','destroy','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x1c94bd,_0x474057){var _0x3744ca=function(_0xd9bbc2){while(--_0xd9bbc2){_0x1c94bd['push'](_0x1c94bd['shift']());}};_0x3744ca(++_0x474057);}(_0xbb17,0x176));var _0x7bb1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbb17[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7bb1('0x0'));var Redis=require('ioredis');var qs=require(_0x7bb1('0x1'));var logger=require(_0x7bb1('0x2'))(_0x7bb1('0x3'));var config=require(_0x7bb1('0x4'));var db=require(_0x7bb1('0x5'))['db'];config[_0x7bb1('0x6')]=_[_0x7bb1('0x7')](config[_0x7bb1('0x6')],{'host':_0x7bb1('0x8'),'port':0x18eb});var socket=require(_0x7bb1('0x9'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x186eb7,_0x22bf6e){_0x22bf6e=_0x22bf6e||0xc8;return function(_0x3a4b0f){if(_0x3a4b0f){return _0x186eb7[_0x7bb1('0xa')](_0x22bf6e)[_0x7bb1('0xb')](_0x3a4b0f);}};}function respondWithFilteredResult(_0x1ea6aa,_0x1b6a50){return function(_0x192b95){if(_0x192b95){var _0x4bc8c5=typeof _0x1b6a50[_0x7bb1('0xc')]==='undefined'&&typeof _0x1b6a50[_0x7bb1('0xd')]===_0x7bb1('0xe');var _0x5582f0=_0x192b95[_0x7bb1('0xf')];var _0x802eff=_0x4bc8c5?0x0:_0x1b6a50['offset'];var _0xc9fb3d=_0x4bc8c5?_0x192b95[_0x7bb1('0xf')]:_0x1b6a50[_0x7bb1('0xc')]+_0x1b6a50[_0x7bb1('0xd')];var _0x7d306a;if(_0xc9fb3d>=_0x5582f0){_0xc9fb3d=_0x5582f0;_0x7d306a=0xc8;}else{_0x7d306a=0xce;}_0x1ea6aa[_0x7bb1('0xa')](_0x7d306a);return _0x1ea6aa['set'](_0x7bb1('0x10'),_0x802eff+'-'+_0xc9fb3d+'/'+_0x5582f0)['json'](_0x192b95);}return null;};}function saveUpdates(_0x1bdc94){return function(_0x25e8ad){if(_0x25e8ad){return _0x25e8ad['update'](_0x1bdc94)[_0x7bb1('0x11')](function(_0x4eebc3){return _0x4eebc3;});}return null;};}function removeEntity(_0x4bf69e){return function(_0x2d0a2b){if(_0x2d0a2b){return _0x2d0a2b['destroy']()[_0x7bb1('0x11')](function(){var _0x9e701=_0x2d0a2b[_0x7bb1('0x12')]({'plain':!![]});var _0x2f8af8=_0x7bb1('0x13');return db[_0x7bb1('0x14')][_0x7bb1('0x15')]({'where':{'type':_0x2f8af8,'resourceId':_0x9e701['id']}})['then'](function(){return _0x2d0a2b;});})[_0x7bb1('0x11')](function(){var _0x168b5c=new Redis(config[_0x7bb1('0x6')]);_0x168b5c[_0x7bb1('0x16')](_0x7bb1('0x17'),JSON[_0x7bb1('0x18')]({'id':_0x2d0a2b['id'],'deleted':!![]}));})[_0x7bb1('0x11')](function(){_0x4bf69e[_0x7bb1('0xa')](0xcc)[_0x7bb1('0x19')]();});}};}function handleEntityNotFound(_0x40535d){return function(_0xf48dde){if(!_0xf48dde){_0x40535d[_0x7bb1('0x1a')](0x194);}return _0xf48dde;};}function handleError(_0x6f5a22,_0x45e5d7){_0x45e5d7=_0x45e5d7||0x1f4;return function(_0x151344){logger[_0x7bb1('0x1b')](_0x151344[_0x7bb1('0x1c')]);if(_0x151344[_0x7bb1('0x1d')]){delete _0x151344[_0x7bb1('0x1d')];}_0x6f5a22[_0x7bb1('0xa')](_0x45e5d7)[_0x7bb1('0x1e')](_0x151344);};}exports[_0x7bb1('0x1f')]=function(_0x1191d1,_0x3708ed){var _0x4ca8bc={},_0x2be3d4={},_0x596a28={'count':0x0,'rows':[]};var _0x5c500c=_['map'](db['SquareProject'][_0x7bb1('0x20')],function(_0x49a145){return{'name':_0x49a145[_0x7bb1('0x21')],'type':_0x49a145[_0x7bb1('0x22')][_0x7bb1('0x23')]};});_0x2be3d4['model']=_['map'](_0x5c500c,_0x7bb1('0x1d'));_0x2be3d4['query']=_['keys'](_0x1191d1[_0x7bb1('0x24')]);_0x2be3d4[_0x7bb1('0x25')]=_[_0x7bb1('0x26')](_0x2be3d4[_0x7bb1('0x27')],_0x2be3d4[_0x7bb1('0x24')]);_0x4ca8bc['attributes']=_['intersection'](_0x2be3d4['model'],qs[_0x7bb1('0x28')](_0x1191d1[_0x7bb1('0x24')][_0x7bb1('0x28')]));_0x4ca8bc[_0x7bb1('0x29')]=_0x4ca8bc[_0x7bb1('0x29')][_0x7bb1('0x2a')]?_0x4ca8bc[_0x7bb1('0x29')]:_0x2be3d4[_0x7bb1('0x27')];if(!_0x1191d1['query'][_0x7bb1('0x2b')](_0x7bb1('0x2c'))){_0x4ca8bc[_0x7bb1('0xd')]=qs['limit'](_0x1191d1[_0x7bb1('0x24')][_0x7bb1('0xd')]);_0x4ca8bc[_0x7bb1('0xc')]=qs[_0x7bb1('0xc')](_0x1191d1['query'][_0x7bb1('0xc')]);}_0x4ca8bc['order']=qs['sort'](_0x1191d1[_0x7bb1('0x24')][_0x7bb1('0x2d')]);_0x4ca8bc[_0x7bb1('0x2e')]=qs[_0x7bb1('0x25')](_[_0x7bb1('0x2f')](_0x1191d1[_0x7bb1('0x24')],_0x2be3d4[_0x7bb1('0x25')]),_0x5c500c);if(_0x1191d1[_0x7bb1('0x24')]['filter']){_0x4ca8bc[_0x7bb1('0x2e')]=_[_0x7bb1('0x30')](_0x4ca8bc['where'],{'$or':_[_0x7bb1('0x31')](_0x5c500c,function(_0x483837){if(_0x483837[_0x7bb1('0x22')]!=='VIRTUAL'){var _0x4ffbac={};_0x4ffbac[_0x483837[_0x7bb1('0x1d')]]={'$like':'%'+_0x1191d1[_0x7bb1('0x24')]['filter']+'%'};return _0x4ffbac;}})});}_0x4ca8bc=_[_0x7bb1('0x30')]({},_0x4ca8bc,_0x1191d1['options']);var _0x5a8f3b={'where':_0x4ca8bc['where']};return db[_0x7bb1('0x32')][_0x7bb1('0xf')](_0x5a8f3b)[_0x7bb1('0x11')](function(_0x12761c){_0x596a28['count']=_0x12761c;if(_0x1191d1[_0x7bb1('0x24')]['includeAll']){_0x4ca8bc[_0x7bb1('0x33')]=[{'all':!![]}];}return db[_0x7bb1('0x32')]['findAll'](_0x4ca8bc);})[_0x7bb1('0x11')](function(_0x4cc396){_0x596a28['rows']=_0x4cc396;return _0x596a28;})[_0x7bb1('0x11')](respondWithFilteredResult(_0x3708ed,_0x4ca8bc))[_0x7bb1('0x34')](handleError(_0x3708ed,null));};exports[_0x7bb1('0x35')]=function(_0x3024ed,_0x13e9db){var _0x10803c={'raw':![],'where':{'id':_0x3024ed[_0x7bb1('0x36')]['id']}},_0x4c7e24={};_0x4c7e24[_0x7bb1('0x27')]=_['keys'](db[_0x7bb1('0x32')][_0x7bb1('0x20')]);_0x4c7e24[_0x7bb1('0x24')]=_[_0x7bb1('0x37')](_0x3024ed[_0x7bb1('0x24')]);_0x4c7e24[_0x7bb1('0x25')]=_[_0x7bb1('0x26')](_0x4c7e24[_0x7bb1('0x27')],_0x4c7e24[_0x7bb1('0x24')]);_0x10803c[_0x7bb1('0x29')]=_[_0x7bb1('0x26')](_0x4c7e24['model'],qs['fields'](_0x3024ed[_0x7bb1('0x24')][_0x7bb1('0x28')]));_0x10803c[_0x7bb1('0x29')]=_0x10803c[_0x7bb1('0x29')][_0x7bb1('0x2a')]?_0x10803c[_0x7bb1('0x29')]:_0x4c7e24[_0x7bb1('0x27')];if(_0x3024ed[_0x7bb1('0x24')][_0x7bb1('0x38')]){_0x10803c[_0x7bb1('0x33')]=[{'all':!![]}];}_0x10803c=_['merge']({},_0x10803c,_0x3024ed[_0x7bb1('0x39')]);return db[_0x7bb1('0x32')][_0x7bb1('0x3a')](_0x10803c)[_0x7bb1('0x11')](handleEntityNotFound(_0x13e9db,null))[_0x7bb1('0x11')](respondWithResult(_0x13e9db,null))[_0x7bb1('0x34')](handleError(_0x13e9db,null));};exports[_0x7bb1('0x3b')]=function(_0x106a2d,_0x3a00f4){return db[_0x7bb1('0x32')][_0x7bb1('0x3b')](_0x106a2d[_0x7bb1('0x3c')],{})[_0x7bb1('0x11')](function(_0x3ad260){var _0x4af3f5=_0x106a2d['user'][_0x7bb1('0x12')]({'plain':!![]});if(!_0x4af3f5)throw new Error(_0x7bb1('0x3d'));if(_0x4af3f5[_0x7bb1('0x3e')]===_0x7bb1('0x3f')){var _0x501c40=_0x3ad260[_0x7bb1('0x12')]({'plain':!![]});var _0x1aaac6=_0x7bb1('0x13');return db[_0x7bb1('0x40')][_0x7bb1('0x3a')]({'where':{'name':_0x1aaac6,'userProfileId':_0x4af3f5[_0x7bb1('0x41')]},'raw':!![]})[_0x7bb1('0x11')](function(_0x2f6be5){if(_0x2f6be5&&_0x2f6be5[_0x7bb1('0x42')]===0x0){return db[_0x7bb1('0x14')][_0x7bb1('0x3b')]({'name':_0x501c40['name'],'resourceId':_0x501c40['id'],'type':_0x2f6be5[_0x7bb1('0x1d')],'sectionId':_0x2f6be5['id']},{})['then'](function(){return _0x3ad260;});}else{return _0x3ad260;}})[_0x7bb1('0x34')](function(_0x104cbc){logger[_0x7bb1('0x1b')](_0x7bb1('0x43'),_0x104cbc);throw _0x104cbc;});}return _0x3ad260;})[_0x7bb1('0x11')](respondWithResult(_0x3a00f4,0xc9))[_0x7bb1('0x34')](handleError(_0x3a00f4,null));};exports[_0x7bb1('0x44')]=function(_0x35f296,_0x3f4a47){if(_0x35f296[_0x7bb1('0x3c')]['id']){delete _0x35f296[_0x7bb1('0x3c')]['id'];}return db[_0x7bb1('0x32')][_0x7bb1('0x3a')]({'where':{'id':_0x35f296[_0x7bb1('0x36')]['id']}})[_0x7bb1('0x11')](handleEntityNotFound(_0x3f4a47,null))['then'](saveUpdates(_0x35f296[_0x7bb1('0x3c')],null))['then'](function(_0xbefa0b){if(!_0xbefa0b)return;var _0x1fffe6=_0xbefa0b[_0x7bb1('0x12')]({'plain':!![]});return _0x1fffe6;})[_0x7bb1('0x11')](function(_0x5740f5){var _0x353788=new Redis(config[_0x7bb1('0x6')]);_0x353788[_0x7bb1('0x16')](_0x7bb1('0x17'),JSON['stringify'](_[_0x7bb1('0x2f')](_0x5740f5,['id','name',_0x7bb1('0x45')])));return _0x5740f5;})[_0x7bb1('0x11')](respondWithResult(_0x3f4a47,null))['catch'](handleError(_0x3f4a47,null));};exports['destroy']=function(_0x436fe9,_0x1d1b54){return db[_0x7bb1('0x32')]['find']({'where':{'id':_0x436fe9[_0x7bb1('0x36')]['id']}})[_0x7bb1('0x11')](handleEntityNotFound(_0x1d1b54,null))['then'](removeEntity(_0x1d1b54,null))[_0x7bb1('0x34')](handleError(_0x1d1b54,null));}; \ No newline at end of file +var _0x3b3c=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','merge','includeAll','include','rows','catch','params','intersection','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','production','lodash','ioredis','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','register','status','json','offset','undefined','limit','count','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','end','error','name','index','SquareProject','rawAttributes','fieldName','type','keys','query','filters','model'];(function(_0x504575,_0x1ad9e0){var _0x4484cc=function(_0xc4c2ea){while(--_0xc4c2ea){_0x504575['push'](_0x504575['shift']());}};_0x4484cc(++_0x1ad9e0);}(_0x3b3c,0x17b));var _0xc3b3=function(_0x4a232c,_0x4db76b){_0x4a232c=_0x4a232c-0x0;var _0xb5807f=_0x3b3c[_0x4a232c];return _0xb5807f;};'use strict';var _=require(_0xc3b3('0x0'));var Redis=require(_0xc3b3('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xc3b3('0x2'))('api');var config=require(_0xc3b3('0x3'));var db=require('../../mysqldb')['db'];config[_0xc3b3('0x4')]=_[_0xc3b3('0x5')](config[_0xc3b3('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xc3b3('0x6'))(new Redis(config['redis']));require('./squareProject.socket')[_0xc3b3('0x7')](socket);function respondWithResult(_0x111344,_0x57807a){_0x57807a=_0x57807a||0xc8;return function(_0x53013a){if(_0x53013a){return _0x111344[_0xc3b3('0x8')](_0x57807a)[_0xc3b3('0x9')](_0x53013a);}};}function respondWithFilteredResult(_0x409994,_0x451502){return function(_0x33692d){if(_0x33692d){var _0x4bd984=typeof _0x451502[_0xc3b3('0xa')]===_0xc3b3('0xb')&&typeof _0x451502[_0xc3b3('0xc')]===_0xc3b3('0xb');var _0x1af4e0=_0x33692d[_0xc3b3('0xd')];var _0x2034da=_0x4bd984?0x0:_0x451502[_0xc3b3('0xa')];var _0x281ab1=_0x4bd984?_0x33692d[_0xc3b3('0xd')]:_0x451502[_0xc3b3('0xa')]+_0x451502[_0xc3b3('0xc')];var _0xf77049;if(_0x281ab1>=_0x1af4e0){_0x281ab1=_0x1af4e0;_0xf77049=0xc8;}else{_0xf77049=0xce;}_0x409994[_0xc3b3('0x8')](_0xf77049);return _0x409994['set']('Content-Range',_0x2034da+'-'+_0x281ab1+'/'+_0x1af4e0)[_0xc3b3('0x9')](_0x33692d);}return null;};}function saveUpdates(_0x2f9bad){return function(_0x378c06){if(_0x378c06){return _0x378c06[_0xc3b3('0xe')](_0x2f9bad)[_0xc3b3('0xf')](function(_0x22b386){return _0x22b386;});}return null;};}function removeEntity(_0x3f26ca){return function(_0x314c40){if(_0x314c40){return _0x314c40[_0xc3b3('0x10')]()[_0xc3b3('0xf')](function(){var _0x34ffc5=_0x314c40[_0xc3b3('0x11')]({'plain':!![]});var _0x347cc6=_0xc3b3('0x12');return db[_0xc3b3('0x13')][_0xc3b3('0x10')]({'where':{'type':_0x347cc6,'resourceId':_0x34ffc5['id']}})[_0xc3b3('0xf')](function(){return _0x314c40;});})[_0xc3b3('0xf')](function(){var _0x13f5df=new Redis(config[_0xc3b3('0x4')]);_0x13f5df[_0xc3b3('0x14')](_0xc3b3('0x15'),JSON['stringify']({'id':_0x314c40['id'],'deleted':!![]}));})[_0xc3b3('0xf')](function(){_0x3f26ca[_0xc3b3('0x8')](0xcc)[_0xc3b3('0x16')]();});}};}function handleEntityNotFound(_0x553b2d){return function(_0x2f3876){if(!_0x2f3876){_0x553b2d['sendStatus'](0x194);}return _0x2f3876;};}function handleError(_0x43bfa4,_0x491e13){_0x491e13=_0x491e13||0x1f4;return function(_0x59df2f){logger[_0xc3b3('0x17')](_0x59df2f['stack']);if(_0x59df2f[_0xc3b3('0x18')]){delete _0x59df2f[_0xc3b3('0x18')];}_0x43bfa4[_0xc3b3('0x8')](_0x491e13)['send'](_0x59df2f);};}exports[_0xc3b3('0x19')]=function(_0x5f2867,_0x3743e3){var _0x2e0808={},_0x4b39f5={},_0x4b1b7={'count':0x0,'rows':[]};var _0x33c3ab=_['map'](db[_0xc3b3('0x1a')][_0xc3b3('0x1b')],function(_0xdd45d7){return{'name':_0xdd45d7[_0xc3b3('0x1c')],'type':_0xdd45d7[_0xc3b3('0x1d')]['key']};});_0x4b39f5['model']=_['map'](_0x33c3ab,'name');_0x4b39f5['query']=_[_0xc3b3('0x1e')](_0x5f2867[_0xc3b3('0x1f')]);_0x4b39f5[_0xc3b3('0x20')]=_['intersection'](_0x4b39f5[_0xc3b3('0x21')],_0x4b39f5['query']);_0x2e0808[_0xc3b3('0x22')]=_['intersection'](_0x4b39f5['model'],qs[_0xc3b3('0x23')](_0x5f2867['query'][_0xc3b3('0x23')]));_0x2e0808[_0xc3b3('0x22')]=_0x2e0808[_0xc3b3('0x22')][_0xc3b3('0x24')]?_0x2e0808[_0xc3b3('0x22')]:_0x4b39f5['model'];if(!_0x5f2867[_0xc3b3('0x1f')][_0xc3b3('0x25')]('nolimit')){_0x2e0808[_0xc3b3('0xc')]=qs[_0xc3b3('0xc')](_0x5f2867[_0xc3b3('0x1f')][_0xc3b3('0xc')]);_0x2e0808['offset']=qs[_0xc3b3('0xa')](_0x5f2867['query'][_0xc3b3('0xa')]);}_0x2e0808[_0xc3b3('0x26')]=qs[_0xc3b3('0x27')](_0x5f2867['query'][_0xc3b3('0x27')]);_0x2e0808[_0xc3b3('0x28')]=qs['filters'](_[_0xc3b3('0x29')](_0x5f2867[_0xc3b3('0x1f')],_0x4b39f5[_0xc3b3('0x20')]),_0x33c3ab);if(_0x5f2867['query']['filter']){_0x2e0808[_0xc3b3('0x28')]=_['merge'](_0x2e0808['where'],{'$or':_[_0xc3b3('0x2a')](_0x33c3ab,function(_0xa76789){if(_0xa76789['type']!==_0xc3b3('0x2b')){var _0x5cf43c={};_0x5cf43c[_0xa76789['name']]={'$like':'%'+_0x5f2867[_0xc3b3('0x1f')]['filter']+'%'};return _0x5cf43c;}})});}_0x2e0808=_[_0xc3b3('0x2c')]({},_0x2e0808,_0x5f2867['options']);var _0x2356d2={'where':_0x2e0808['where']};return db['SquareProject'][_0xc3b3('0xd')](_0x2356d2)[_0xc3b3('0xf')](function(_0x34ac50){_0x4b1b7['count']=_0x34ac50;if(_0x5f2867[_0xc3b3('0x1f')][_0xc3b3('0x2d')]){_0x2e0808[_0xc3b3('0x2e')]=[{'all':!![]}];}return db[_0xc3b3('0x1a')]['findAll'](_0x2e0808);})[_0xc3b3('0xf')](function(_0x58cfd7){_0x4b1b7[_0xc3b3('0x2f')]=_0x58cfd7;return _0x4b1b7;})[_0xc3b3('0xf')](respondWithFilteredResult(_0x3743e3,_0x2e0808))[_0xc3b3('0x30')](handleError(_0x3743e3,null));};exports['show']=function(_0x1b1026,_0x3154b8){var _0x381d50={'raw':![],'where':{'id':_0x1b1026[_0xc3b3('0x31')]['id']}},_0x3578cf={};_0x3578cf[_0xc3b3('0x21')]=_[_0xc3b3('0x1e')](db[_0xc3b3('0x1a')][_0xc3b3('0x1b')]);_0x3578cf['query']=_[_0xc3b3('0x1e')](_0x1b1026[_0xc3b3('0x1f')]);_0x3578cf['filters']=_[_0xc3b3('0x32')](_0x3578cf[_0xc3b3('0x21')],_0x3578cf[_0xc3b3('0x1f')]);_0x381d50['attributes']=_['intersection'](_0x3578cf[_0xc3b3('0x21')],qs[_0xc3b3('0x23')](_0x1b1026[_0xc3b3('0x1f')][_0xc3b3('0x23')]));_0x381d50[_0xc3b3('0x22')]=_0x381d50[_0xc3b3('0x22')][_0xc3b3('0x24')]?_0x381d50['attributes']:_0x3578cf[_0xc3b3('0x21')];if(_0x1b1026['query']['includeAll']){_0x381d50[_0xc3b3('0x2e')]=[{'all':!![]}];}_0x381d50=_[_0xc3b3('0x2c')]({},_0x381d50,_0x1b1026['options']);return db[_0xc3b3('0x1a')][_0xc3b3('0x33')](_0x381d50)['then'](handleEntityNotFound(_0x3154b8,null))[_0xc3b3('0xf')](respondWithResult(_0x3154b8,null))['catch'](handleError(_0x3154b8,null));};exports[_0xc3b3('0x34')]=function(_0x131163,_0xf6a9ea){return db['SquareProject'][_0xc3b3('0x34')](_0x131163[_0xc3b3('0x35')],{})[_0xc3b3('0xf')](function(_0x5f56ba){var _0x1b2087=_0x131163[_0xc3b3('0x36')][_0xc3b3('0x11')]({'plain':!![]});if(!_0x1b2087)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b2087['role']==='user'){var _0xa05d9c=_0x5f56ba[_0xc3b3('0x11')]({'plain':!![]});var _0x5102d6='SquareProjects';return db[_0xc3b3('0x37')]['find']({'where':{'name':_0x5102d6,'userProfileId':_0x1b2087[_0xc3b3('0x38')]},'raw':!![]})['then'](function(_0x41437a){if(_0x41437a&&_0x41437a[_0xc3b3('0x39')]===0x0){return db[_0xc3b3('0x13')][_0xc3b3('0x34')]({'name':_0xa05d9c[_0xc3b3('0x18')],'resourceId':_0xa05d9c['id'],'type':_0x41437a[_0xc3b3('0x18')],'sectionId':_0x41437a['id']},{})[_0xc3b3('0xf')](function(){return _0x5f56ba;});}else{return _0x5f56ba;}})[_0xc3b3('0x30')](function(_0x107f42){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x107f42);throw _0x107f42;});}return _0x5f56ba;})[_0xc3b3('0xf')](respondWithResult(_0xf6a9ea,0xc9))[_0xc3b3('0x30')](handleError(_0xf6a9ea,null));};exports[_0xc3b3('0xe')]=function(_0x280b78,_0x86b84f){if(_0x280b78[_0xc3b3('0x35')]['id']){delete _0x280b78[_0xc3b3('0x35')]['id'];}return db['SquareProject'][_0xc3b3('0x33')]({'where':{'id':_0x280b78[_0xc3b3('0x31')]['id']}})[_0xc3b3('0xf')](handleEntityNotFound(_0x86b84f,null))[_0xc3b3('0xf')](saveUpdates(_0x280b78[_0xc3b3('0x35')],null))[_0xc3b3('0xf')](function(_0x53cab7){if(!_0x53cab7)return;var _0x58d671=_0x53cab7[_0xc3b3('0x11')]({'plain':!![]});return _0x58d671;})[_0xc3b3('0xf')](function(_0x4f980a){var _0x1692b0=new Redis(config[_0xc3b3('0x4')]);_0x1692b0[_0xc3b3('0x14')](_0xc3b3('0x15'),JSON['stringify'](_['pick'](_0x4f980a,['id',_0xc3b3('0x18'),_0xc3b3('0x3a')])));return _0x4f980a;})['then'](respondWithResult(_0x86b84f,null))[_0xc3b3('0x30')](handleError(_0x86b84f,null));};exports[_0xc3b3('0x10')]=function(_0x233a01,_0x37e823){return db[_0xc3b3('0x1a')][_0xc3b3('0x33')]({'where':{'id':_0x233a01['params']['id']}})[_0xc3b3('0xf')](handleEntityNotFound(_0x37e823,null))[_0xc3b3('0xf')](removeEntity(_0x37e823,null))[_0xc3b3('0x30')](handleError(_0x37e823,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index b6005f2..3a2ebe0 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 _0x1b38=['hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x39d89b,_0x413243){var _0x477b21=function(_0x5ea8bf){while(--_0x5ea8bf){_0x39d89b['push'](_0x39d89b['shift']());}};_0x477b21(++_0x413243);}(_0x1b38,0xd4));var _0x81b3=function(_0x2356e6,_0x130b1f){_0x2356e6=_0x2356e6-0x0;var _0x31094e=_0x1b38[_0x2356e6];return _0x31094e;};'use strict';var EventEmitter=require(_0x81b3('0x0'));var SquareProject=require(_0x81b3('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x81b3('0x2'),'afterUpdate':'update','afterDestroy':_0x81b3('0x3')};function emitEvent(_0x36c947){return function(_0x2984c8,_0x3ea254,_0x50f439){SquareProjectEvents[_0x81b3('0x4')](_0x36c947+':'+_0x2984c8['id'],_0x2984c8);SquareProjectEvents['emit'](_0x36c947,_0x2984c8);_0x50f439(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x81b3('0x5')](e,emitEvent(event));}}module[_0x81b3('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0xd248=['save','update','remove','emit','exports','events','SquareProject','setMaxListeners'];(function(_0x38e1c3,_0x421148){var _0x451552=function(_0x42f872){while(--_0x42f872){_0x38e1c3['push'](_0x38e1c3['shift']());}};_0x451552(++_0x421148);}(_0xd248,0x7d));var _0x8d24=function(_0xf2931a,_0x2d490b){_0xf2931a=_0xf2931a-0x0;var _0x45c15d=_0xd248[_0xf2931a];return _0x45c15d;};'use strict';var EventEmitter=require(_0x8d24('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x8d24('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8d24('0x2')](0x0);var events={'afterCreate':_0x8d24('0x3'),'afterUpdate':_0x8d24('0x4'),'afterDestroy':_0x8d24('0x5')};function emitEvent(_0x14456b){return function(_0x110e27,_0x16ab53,_0x3a5783){SquareProjectEvents[_0x8d24('0x6')](_0x14456b+':'+_0x110e27['id'],_0x110e27);SquareProjectEvents['emit'](_0x14456b,_0x110e27);_0x3a5783(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x8d24('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 6787b70..45b4b81 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 _0x96b1=['bluebird','request-promise','path','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api'];(function(_0x10be19,_0x363045){var _0x3ced5f=function(_0xbf888c){while(--_0xbf888c){_0x10be19['push'](_0x10be19['shift']());}};_0x3ced5f(++_0x363045);}(_0x96b1,0xbd));var _0x196b=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0x96b1[_0x3d38ae];return _0x3757ee;};'use strict';var _=require(_0x196b('0x0'));var util=require(_0x196b('0x1'));var logger=require('../../config/logger')(_0x196b('0x2'));var moment=require('moment');var BPromise=require(_0x196b('0x3'));var rp=require(_0x196b('0x4'));var fs=require('fs');var path=require(_0x196b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x196b('0x6')]=function(_0x4b3ee0,_0x7c5354){return _0x4b3ee0[_0x196b('0x7')](_0x196b('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x165337,_0x793c8c,_0x2df6a1){if(_0x165337[_0x196b('0x9')](_0x196b('0xa'))){_0x165337[_0x196b('0xb')]=moment()[_0x196b('0xc')](_0x196b('0xd'));}if(_0x165337[_0x196b('0x9')](_0x196b('0xe'))){_0x165337[_0x196b('0xf')]=moment()[_0x196b('0xc')](_0x196b('0xd'));}_0x2df6a1(null,_0x165337);}}});}; \ No newline at end of file +var _0xf59f=['api','moment','path','rimraf','../../config/environment','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util'];(function(_0x535c4a,_0xba5232){var _0x900f1b=function(_0x5b4ca8){while(--_0x5b4ca8){_0x535c4a['push'](_0x535c4a['shift']());}};_0x900f1b(++_0xba5232);}(_0xf59f,0x77));var _0xff59=function(_0x160959,_0x40a945){_0x160959=_0x160959-0x0;var _0x2e0b6c=_0xf59f[_0x160959];return _0x2e0b6c;};'use strict';var _=require('lodash');var util=require(_0xff59('0x0'));var logger=require('../../config/logger')(_0xff59('0x1'));var moment=require(_0xff59('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xff59('0x3'));var rimraf=require(_0xff59('0x4'));var config=require(_0xff59('0x5'));var attributes=require('./squareProject.attributes');module[_0xff59('0x6')]=function(_0x275c9f,_0x501907){return _0x275c9f[_0xff59('0x7')](_0xff59('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57961c,_0x18cac0,_0x3e0f4d){if(_0x57961c[_0xff59('0x9')](_0xff59('0xa'))){_0x57961c[_0xff59('0xb')]=moment()[_0xff59('0xc')](_0xff59('0xd'));}if(_0x57961c[_0xff59('0x9')]('production')){_0x57961c[_0xff59('0xe')]=moment()[_0xff59('0xc')](_0xff59('0xd'));}_0x3e0f4d(null,_0x57961c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 8f4158a..432a90f 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 _0x6e0a=['defaults','localhost','./squareProject.socket','register','GetSquareProjects','findAll','options','attributes','limit','map','model','include','then','info','debug','stringify','catch','error','message','SquareProject','find','raw','where','ShowSquareProject','ioredis','../../mysqldb','redis'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x6e0a,0x1c8));var _0xa6e0=function(_0x32e33c,_0x2c4cf7){_0x32e33c=_0x32e33c-0x0;var _0x1805a2=_0x6e0a[_0x32e33c];return _0x1805a2;};'use strict';var _=require('lodash');var Redis=require(_0xa6e0('0x0'));var db=require(_0xa6e0('0x1'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');config[_0xa6e0('0x2')]=_[_0xa6e0('0x3')](config[_0xa6e0('0x2')],{'host':_0xa6e0('0x4'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6e0('0x2')]));require(_0xa6e0('0x5'))[_0xa6e0('0x6')](socket);exports[_0xa6e0('0x7')]=function(_0x4a3089){var _0x1de8f7=this;return new Promise(function(_0x49b887,_0x2a026e){return db['SquareProject'][_0xa6e0('0x8')]({'raw':_0x4a3089[_0xa6e0('0x9')]?_0x4a3089[_0xa6e0('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4a3089[_0xa6e0('0x9')]?_0x4a3089[_0xa6e0('0x9')]['where']||null:null,'attributes':_0x4a3089['options']?_0x4a3089[_0xa6e0('0x9')][_0xa6e0('0xa')]||null:null,'limit':_0x4a3089[_0xa6e0('0x9')]?_0x4a3089[_0xa6e0('0x9')][_0xa6e0('0xb')]||null:null,'include':_0x4a3089['options']?_0x4a3089[_0xa6e0('0x9')]['include']?_[_0xa6e0('0xc')](_0x4a3089[_0xa6e0('0x9')]['include'],function(_0x2b0a94){return{'model':db[_0x2b0a94[_0xa6e0('0xd')]],'as':_0x2b0a94['as'],'attributes':_0x2b0a94[_0xa6e0('0xa')],'include':_0x2b0a94['include']?_[_0xa6e0('0xc')](_0x2b0a94['include'],function(_0x2ec28e){return{'model':db[_0x2ec28e[_0xa6e0('0xd')]],'as':_0x2ec28e['as'],'attributes':_0x2ec28e[_0xa6e0('0xa')],'include':_0x2ec28e['include']?_['map'](_0x2ec28e[_0xa6e0('0xe')],function(_0x1b46fb){return{'model':db[_0x1b46fb[_0xa6e0('0xd')]],'as':_0x1b46fb['as'],'attributes':_0x1b46fb[_0xa6e0('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa6e0('0xf')](function(_0x12f79c){logger[_0xa6e0('0x10')](_0xa6e0('0x7'),_0x4a3089);logger[_0xa6e0('0x11')]('GetSquareProjects',_0x4a3089,JSON[_0xa6e0('0x12')](_0x12f79c));_0x49b887(_0x12f79c);})[_0xa6e0('0x13')](function(_0x410c50){logger[_0xa6e0('0x14')](_0xa6e0('0x7'),_0x410c50[_0xa6e0('0x15')],_0x4a3089);_0x2a026e(_0x1de8f7[_0xa6e0('0x14')](0x1f4,_0x410c50['message']));});});};exports['ShowSquareProject']=function(_0x214d43){var _0x29f544=this;return new Promise(function(_0x46a96d,_0x5a7110){return db[_0xa6e0('0x16')][_0xa6e0('0x17')]({'raw':_0x214d43['options']?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0x18')]===undefined?!![]:![]:!![],'where':_0x214d43[_0xa6e0('0x9')]?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0x19')]||null:null,'attributes':_0x214d43['options']?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0xa')]||null:null,'include':_0x214d43[_0xa6e0('0x9')]?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0xe')]?_[_0xa6e0('0xc')](_0x214d43[_0xa6e0('0x9')][_0xa6e0('0xe')],function(_0x56c642){return{'model':db[_0x56c642[_0xa6e0('0xd')]],'as':_0x56c642['as'],'attributes':_0x56c642[_0xa6e0('0xa')],'include':_0x56c642[_0xa6e0('0xe')]?_[_0xa6e0('0xc')](_0x56c642[_0xa6e0('0xe')],function(_0x22aa03){return{'model':db[_0x22aa03['model']],'as':_0x22aa03['as'],'attributes':_0x22aa03[_0xa6e0('0xa')],'include':_0x22aa03['include']?_[_0xa6e0('0xc')](_0x22aa03[_0xa6e0('0xe')],function(_0x56e73c){return{'model':db[_0x56e73c[_0xa6e0('0xd')]],'as':_0x56e73c['as'],'attributes':_0x56e73c[_0xa6e0('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa6e0('0xf')](function(_0x442c77){logger[_0xa6e0('0x10')](_0xa6e0('0x1a'),_0x214d43);logger[_0xa6e0('0x11')](_0xa6e0('0x1a'),_0x214d43,JSON[_0xa6e0('0x12')](_0x442c77));_0x46a96d(_0x442c77);})[_0xa6e0('0x13')](function(_0x416d57){logger[_0xa6e0('0x14')](_0xa6e0('0x1a'),_0x416d57[_0xa6e0('0x15')],_0x214d43);_0x5a7110(_0x29f544[_0xa6e0('0x14')](0x1f4,_0x416d57[_0xa6e0('0x15')]));});});}; \ No newline at end of file +var _0xb6fb=['ioredis','../../config/logger','rpc','defaults','localhost','GetSquareProjects','findAll','options','raw','where','attributes','include','map','model','info','stringify','error','message','ShowSquareProject','then','debug','catch','lodash'];(function(_0x1b2477,_0x368cc0){var _0x38b837=function(_0x353499){while(--_0x353499){_0x1b2477['push'](_0x1b2477['shift']());}};_0x38b837(++_0x368cc0);}(_0xb6fb,0x141));var _0xbb6f=function(_0x46797c,_0x2f5cba){_0x46797c=_0x46797c-0x0;var _0x334197=_0xb6fb[_0x46797c];return _0x334197;};'use strict';var _=require(_0xbb6f('0x0'));var Redis=require(_0xbb6f('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xbb6f('0x2'))(_0xbb6f('0x3'));var config=require('../../config/environment');config['redis']=_[_0xbb6f('0x4')](config['redis'],{'host':_0xbb6f('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);exports[_0xbb6f('0x6')]=function(_0x532a90){var _0x183243=this;return new Promise(function(_0x5bc006,_0x125739){return db['SquareProject'][_0xbb6f('0x7')]({'raw':_0x532a90[_0xbb6f('0x8')]?_0x532a90[_0xbb6f('0x8')][_0xbb6f('0x9')]===undefined?!![]:![]:!![],'where':_0x532a90[_0xbb6f('0x8')]?_0x532a90[_0xbb6f('0x8')][_0xbb6f('0xa')]||null:null,'attributes':_0x532a90[_0xbb6f('0x8')]?_0x532a90[_0xbb6f('0x8')][_0xbb6f('0xb')]||null:null,'limit':_0x532a90[_0xbb6f('0x8')]?_0x532a90[_0xbb6f('0x8')]['limit']||null:null,'include':_0x532a90['options']?_0x532a90['options'][_0xbb6f('0xc')]?_[_0xbb6f('0xd')](_0x532a90['options']['include'],function(_0x6a4e8){return{'model':db[_0x6a4e8[_0xbb6f('0xe')]],'as':_0x6a4e8['as'],'attributes':_0x6a4e8[_0xbb6f('0xb')],'include':_0x6a4e8[_0xbb6f('0xc')]?_[_0xbb6f('0xd')](_0x6a4e8[_0xbb6f('0xc')],function(_0x3e517d){return{'model':db[_0x3e517d[_0xbb6f('0xe')]],'as':_0x3e517d['as'],'attributes':_0x3e517d[_0xbb6f('0xb')],'include':_0x3e517d['include']?_[_0xbb6f('0xd')](_0x3e517d[_0xbb6f('0xc')],function(_0x2a2da6){return{'model':db[_0x2a2da6[_0xbb6f('0xe')]],'as':_0x2a2da6['as'],'attributes':_0x2a2da6[_0xbb6f('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44dbf8){logger[_0xbb6f('0xf')]('GetSquareProjects',_0x532a90);logger['debug']('GetSquareProjects',_0x532a90,JSON[_0xbb6f('0x10')](_0x44dbf8));_0x5bc006(_0x44dbf8);})['catch'](function(_0x18e03c){logger[_0xbb6f('0x11')](_0xbb6f('0x6'),_0x18e03c[_0xbb6f('0x12')],_0x532a90);_0x125739(_0x183243[_0xbb6f('0x11')](0x1f4,_0x18e03c['message']));});});};exports[_0xbb6f('0x13')]=function(_0xabc1d4){var _0x3a9a40=this;return new Promise(function(_0x4dbfc5,_0x2251e9){return db['SquareProject']['find']({'raw':_0xabc1d4[_0xbb6f('0x8')]?_0xabc1d4[_0xbb6f('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0xabc1d4[_0xbb6f('0x8')]?_0xabc1d4['options'][_0xbb6f('0xa')]||null:null,'attributes':_0xabc1d4[_0xbb6f('0x8')]?_0xabc1d4[_0xbb6f('0x8')][_0xbb6f('0xb')]||null:null,'include':_0xabc1d4[_0xbb6f('0x8')]?_0xabc1d4[_0xbb6f('0x8')][_0xbb6f('0xc')]?_[_0xbb6f('0xd')](_0xabc1d4[_0xbb6f('0x8')][_0xbb6f('0xc')],function(_0x3e332e){return{'model':db[_0x3e332e[_0xbb6f('0xe')]],'as':_0x3e332e['as'],'attributes':_0x3e332e['attributes'],'include':_0x3e332e['include']?_[_0xbb6f('0xd')](_0x3e332e[_0xbb6f('0xc')],function(_0x53adaf){return{'model':db[_0x53adaf[_0xbb6f('0xe')]],'as':_0x53adaf['as'],'attributes':_0x53adaf[_0xbb6f('0xb')],'include':_0x53adaf[_0xbb6f('0xc')]?_[_0xbb6f('0xd')](_0x53adaf['include'],function(_0x503f29){return{'model':db[_0x503f29['model']],'as':_0x503f29['as'],'attributes':_0x503f29['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb6f('0x14')](function(_0x387d54){logger[_0xbb6f('0xf')](_0xbb6f('0x13'),_0xabc1d4);logger[_0xbb6f('0x15')](_0xbb6f('0x13'),_0xabc1d4,JSON[_0xbb6f('0x10')](_0x387d54));_0x4dbfc5(_0x387d54);})[_0xbb6f('0x16')](function(_0x62b73c){logger['error']('ShowSquareProject',_0x62b73c[_0xbb6f('0x12')],_0xabc1d4);_0x2251e9(_0x3a9a40['error'](0x1f4,_0x62b73c[_0xbb6f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index f6ac51f..9f838bb 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 _0x402b=['emit','removeListener','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x114bf0,_0x29f2f1){var _0x53e038=function(_0x2fb664){while(--_0x2fb664){_0x114bf0['push'](_0x114bf0['shift']());}};_0x53e038(++_0x29f2f1);}(_0x402b,0xd4));var _0xb402=function(_0xd38d53,_0x17d20e){_0xd38d53=_0xd38d53-0x0;var _0x2ceeda=_0x402b[_0xd38d53];return _0x2ceeda;};'use strict';var SquareProjectEvents=require(_0xb402('0x0'));var events=[_0xb402('0x1'),_0xb402('0x2'),_0xb402('0x3')];function createListener(_0x357263,_0x3cfdf0){return function(_0x7ec299){_0x3cfdf0[_0xb402('0x4')](_0x357263,_0x7ec299);};}function removeListener(_0x2d3b1a,_0x440603){return function(){SquareProjectEvents[_0xb402('0x5')](_0x2d3b1a,_0x440603);};}exports['register']=function(_0x21a7f2){for(var _0x4066c4=0x0,_0x27d4ce=events[_0xb402('0x6')];_0x4066c4<_0x27d4ce;_0x4066c4++){var _0x59490d=events[_0x4066c4];var _0xeae811=createListener(_0xb402('0x7')+_0x59490d,_0x21a7f2);SquareProjectEvents['on'](_0x59490d,_0xeae811);}}; \ No newline at end of file +var _0xfd36=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x597025,_0x305ea4){var _0x1ae12f=function(_0x22ea02){while(--_0x22ea02){_0x597025['push'](_0x597025['shift']());}};_0x1ae12f(++_0x305ea4);}(_0xfd36,0xa7));var _0x6fd3=function(_0x1df0bb,_0x251c51){_0x1df0bb=_0x1df0bb-0x0;var _0x41a310=_0xfd36[_0x1df0bb];return _0x41a310;};'use strict';var SquareProjectEvents=require(_0x6fd3('0x0'));var events=[_0x6fd3('0x1'),_0x6fd3('0x2'),_0x6fd3('0x3')];function createListener(_0x428488,_0x1109db){return function(_0x731917){_0x1109db[_0x6fd3('0x4')](_0x428488,_0x731917);};}function removeListener(_0x21ee3e,_0x5abcca){return function(){SquareProjectEvents[_0x6fd3('0x5')](_0x21ee3e,_0x5abcca);};}exports[_0x6fd3('0x6')]=function(_0x26b0a4){for(var _0x49bad0=0x0,_0x30f12f=events[_0x6fd3('0x7')];_0x49bad0<_0x30f12f;_0x49bad0++){var _0x560b8e=events[_0x49bad0];var _0x4fc0e6=createListener(_0x6fd3('0x8')+_0x560b8e,_0x26b0a4);SquareProjectEvents['on'](_0x560b8e,_0x4fc0e6);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index d51c39d..ae2fe23 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(_0xc1b0fc,_0x1265b3){var _0x55c682=function(_0x163ea3){while(--_0x163ea3){_0xc1b0fc['push'](_0xc1b0fc['shift']());}};_0x55c682(++_0x1265b3);}(_0x7a54,0x106));var _0x47a5=function(_0x2a5c65,_0x5ea07d){_0x2a5c65=_0x2a5c65-0x0;var _0x5dc615=_0x7a54[_0x2a5c65];return _0x5dc615;};'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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x2dcf67,_0x22dc95){var _0x516ee2=function(_0x562035){while(--_0x562035){_0x2dcf67['push'](_0x2dcf67['shift']());}};_0x516ee2(++_0x22dc95);}(_0x5fc3,0xa8));var _0x35fc=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x5fc3[_0x31a576];return _0x30b1d3;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index e11fa50..3b3fea8 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 _0x1cb9=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x4d941d,_0x24c568){var _0x4a7778=function(_0x13d938){while(--_0x13d938){_0x4d941d['push'](_0x4d941d['shift']());}};_0x4a7778(++_0x24c568);}(_0x1cb9,0x14e));var _0x91cb=function(_0x59f1a4,_0x372644){_0x59f1a4=_0x59f1a4-0x0;var _0x443009=_0x1cb9[_0x59f1a4];return _0x443009;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x91cb('0x1')]},'callerid':{'type':Sequelize[_0x91cb('0x1')]},'calleridname':{'type':Sequelize[_0x91cb('0x1')]},'context':{'type':Sequelize[_0x91cb('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x91cb('0x1')]},'accountcode':{'type':Sequelize[_0x91cb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x91cb('0x1')]},'saveName':{'type':Sequelize[_0x91cb('0x1')]},'filename':{'type':Sequelize[_0x91cb('0x1')]},'savePath':{'type':Sequelize[_0x91cb('0x1')]},'format':{'type':Sequelize[_0x91cb('0x2')],'get':function(){var _0x8f8a3b='';var _0x4c1f56=this[_0x91cb('0x3')]('savePath');if(_0x4c1f56){_0x8f8a3b=_0x4c1f56[_0x91cb('0x4')](_0x4c1f56['lastIndexOf']('.'));}return _0x8f8a3b;}}}; \ No newline at end of file +var _0x5fd1=['STRING','VIRTUAL','getDataValue','savePath','substring','sequelize'];(function(_0x1e4957,_0xdf5686){var _0x319245=function(_0x3ac09d){while(--_0x3ac09d){_0x1e4957['push'](_0x1e4957['shift']());}};_0x319245(++_0xdf5686);}(_0x5fd1,0x155));var _0x15fd=function(_0x323e14,_0x52a272){_0x323e14=_0x323e14-0x0;var _0x5ee537=_0x5fd1[_0x323e14];return _0x5ee537;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x15fd('0x1')]},'callerid':{'type':Sequelize[_0x15fd('0x1')]},'calleridname':{'type':Sequelize[_0x15fd('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x15fd('0x1')]},'accountcode':{'type':Sequelize[_0x15fd('0x1')]},'dnid':{'type':Sequelize[_0x15fd('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x15fd('0x1')]},'filename':{'type':Sequelize[_0x15fd('0x1')]},'savePath':{'type':Sequelize[_0x15fd('0x1')]},'format':{'type':Sequelize[_0x15fd('0x2')],'get':function(){var _0x225728='';var _0x534e63=this[_0x15fd('0x3')](_0x15fd('0x4'));if(_0x534e63){_0x225728=_0x534e63[_0x15fd('0x5')](_0x534e63['lastIndexOf']('.'));}return _0x225728;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index b79d7e3..4ebd2ea 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 _0x7263=['SquareRecording','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','map','type','includeAll','include','findAll','rows','catch','params','options','find','create','body','download','../../components/encryptor','uniqueid','savePath','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','index'];(function(_0x24a7c9,_0x157c78){var _0x451a81=function(_0x4bdc76){while(--_0x4bdc76){_0x24a7c9['push'](_0x24a7c9['shift']());}};_0x451a81(++_0x157c78);}(_0x7263,0x93));var _0x3726=function(_0x4c74b0,_0x5bdd7f){_0x4c74b0=_0x4c74b0-0x0;var _0x681540=_0x7263[_0x4c74b0];return _0x681540;};'use strict';var emlformat=require(_0x3726('0x0'));var rimraf=require(_0x3726('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3726('0x2'));var rp=require(_0x3726('0x3'));var moment=require('moment');var BPromise=require(_0x3726('0x4'));var Mustache=require(_0x3726('0x5'));var util=require(_0x3726('0x6'));var path=require(_0x3726('0x7'));var sox=require(_0x3726('0x8'));var csv=require(_0x3726('0x9'));var ejs=require(_0x3726('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3726('0xb'));var squel=require(_0x3726('0xc'));var crypto=require(_0x3726('0xd'));var jsforce=require(_0x3726('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3726('0x9'));var querystring=require(_0x3726('0xf'));var Papa=require(_0x3726('0x10'));var Redis=require(_0x3726('0x11'));var authService=require(_0x3726('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3726('0x13'));var hardwareService=require(_0x3726('0x14'));var logger=require(_0x3726('0x15'))(_0x3726('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3726('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fe7a7,_0x3534f7){_0x3534f7=_0x3534f7||0xcc;return function(_0x2d2a8e){if(_0x2d2a8e){return _0x2fe7a7[_0x3726('0x18')](_0x3534f7);}return _0x2fe7a7[_0x3726('0x19')](_0x3534f7)['end']();};}function respondWithResult(_0x46fda4,_0x565d21){_0x565d21=_0x565d21||0xc8;return function(_0x1fa642){if(_0x1fa642){return _0x46fda4[_0x3726('0x19')](_0x565d21)['json'](_0x1fa642);}};}function respondWithFilteredResult(_0xea15be,_0x408331){return function(_0x337380){if(_0x337380){var _0x5f4a48=typeof _0x408331[_0x3726('0x1a')]==='undefined'&&typeof _0x408331['limit']===_0x3726('0x1b');var _0x29563f=_0x337380[_0x3726('0x1c')];var _0x47e0d6=_0x5f4a48?0x0:_0x408331[_0x3726('0x1a')];var _0x187a5d=_0x5f4a48?_0x337380[_0x3726('0x1c')]:_0x408331[_0x3726('0x1a')]+_0x408331[_0x3726('0x1d')];var _0x121426;if(_0x187a5d>=_0x29563f){_0x187a5d=_0x29563f;_0x121426=0xc8;}else{_0x121426=0xce;}_0xea15be[_0x3726('0x19')](_0x121426);return _0xea15be[_0x3726('0x1e')](_0x3726('0x1f'),_0x47e0d6+'-'+_0x187a5d+'/'+_0x29563f)[_0x3726('0x20')](_0x337380);}return null;};}function patchUpdates(_0x5cb1eb){return function(_0x25cdfe){try{jsonpatch[_0x3726('0x21')](_0x25cdfe,_0x5cb1eb,!![]);}catch(_0x411b78){return BPromise[_0x3726('0x22')](_0x411b78);}return _0x25cdfe[_0x3726('0x23')]();};}function saveUpdates(_0x100020,_0x53dd5f){return function(_0x5b56e0){if(_0x5b56e0){return _0x5b56e0[_0x3726('0x24')](_0x100020)[_0x3726('0x25')](function(_0x1bf963){return _0x1bf963;});}return null;};}function removeEntity(_0x3f5a86,_0x2e1876){return function(_0x1220b4){if(_0x1220b4){return _0x1220b4[_0x3726('0x26')]()[_0x3726('0x25')](function(){_0x3f5a86[_0x3726('0x19')](0xcc)[_0x3726('0x27')]();});}};}function handleEntityNotFound(_0x1c946f,_0x4cbf48){return function(_0x17cb4d){if(!_0x17cb4d){_0x1c946f[_0x3726('0x18')](0x194);}return _0x17cb4d;};}function handleError(_0xc68aba,_0x1f4481){_0x1f4481=_0x1f4481||0x1f4;return function(_0x4a4d7d){logger[_0x3726('0x28')](_0x4a4d7d['stack']);if(_0x4a4d7d[_0x3726('0x29')]){delete _0x4a4d7d[_0x3726('0x29')];}_0xc68aba[_0x3726('0x19')](_0x1f4481)['send'](_0x4a4d7d);};}exports[_0x3726('0x2a')]=function(_0x6c1530,_0x4fea09){var _0x241fd5={},_0x459632={},_0x31d4d9={'count':0x0,'rows':[]};var _0x3178ed=_['map'](db[_0x3726('0x2b')][_0x3726('0x2c')],function(_0x18c84b){return{'name':_0x18c84b['fieldName'],'type':_0x18c84b['type'][_0x3726('0x2d')]};});_0x459632[_0x3726('0x2e')]=_['map'](_0x3178ed,_0x3726('0x29'));_0x459632[_0x3726('0x2f')]=_[_0x3726('0x30')](_0x6c1530['query']);_0x459632[_0x3726('0x31')]=_[_0x3726('0x32')](_0x459632[_0x3726('0x2e')],_0x459632[_0x3726('0x2f')]);_0x241fd5[_0x3726('0x33')]=_[_0x3726('0x32')](_0x459632[_0x3726('0x2e')],qs[_0x3726('0x34')](_0x6c1530[_0x3726('0x2f')][_0x3726('0x34')]));_0x241fd5[_0x3726('0x33')]=_0x241fd5[_0x3726('0x33')][_0x3726('0x35')]?_0x241fd5['attributes']:_0x459632[_0x3726('0x2e')];if(!_0x6c1530[_0x3726('0x2f')]['hasOwnProperty'](_0x3726('0x36'))){_0x241fd5[_0x3726('0x1d')]=qs['limit'](_0x6c1530[_0x3726('0x2f')][_0x3726('0x1d')]);_0x241fd5[_0x3726('0x1a')]=qs[_0x3726('0x1a')](_0x6c1530[_0x3726('0x2f')][_0x3726('0x1a')]);}_0x241fd5[_0x3726('0x37')]=qs['sort'](_0x6c1530[_0x3726('0x2f')]['sort']);_0x241fd5[_0x3726('0x38')]=qs[_0x3726('0x31')](_[_0x3726('0x39')](_0x6c1530[_0x3726('0x2f')],_0x459632[_0x3726('0x31')]),_0x3178ed);if(_0x6c1530['query'][_0x3726('0x3a')]){_0x241fd5[_0x3726('0x38')]=_[_0x3726('0x3b')](_0x241fd5[_0x3726('0x38')],{'$or':_[_0x3726('0x3c')](_0x3178ed,function(_0x33d273){if(_0x33d273[_0x3726('0x3d')]!=='VIRTUAL'){var _0x238d24={};_0x238d24[_0x33d273[_0x3726('0x29')]]={'$like':'%'+_0x6c1530['query']['filter']+'%'};return _0x238d24;}})});}_0x241fd5=_[_0x3726('0x3b')]({},_0x241fd5,_0x6c1530['options']);var _0x381c1f={'where':_0x241fd5[_0x3726('0x38')]};return db['SquareRecording']['count'](_0x381c1f)[_0x3726('0x25')](function(_0x4adee3){_0x31d4d9['count']=_0x4adee3;if(_0x6c1530[_0x3726('0x2f')][_0x3726('0x3e')]){_0x241fd5[_0x3726('0x3f')]=[{'all':!![]}];}return db[_0x3726('0x2b')][_0x3726('0x40')](_0x241fd5);})[_0x3726('0x25')](function(_0x36df9a){_0x31d4d9[_0x3726('0x41')]=_0x36df9a;return _0x31d4d9;})['then'](respondWithFilteredResult(_0x4fea09,_0x241fd5))[_0x3726('0x42')](handleError(_0x4fea09,null));};exports['show']=function(_0x3ce1d2,_0x3e1142){var _0x534639={'raw':!![],'where':{'id':_0x3ce1d2[_0x3726('0x43')]['id']}},_0x5c8e94={};_0x5c8e94[_0x3726('0x2e')]=_[_0x3726('0x30')](db['SquareRecording']['rawAttributes']);_0x5c8e94[_0x3726('0x2f')]=_[_0x3726('0x30')](_0x3ce1d2[_0x3726('0x2f')]);_0x5c8e94['filters']=_[_0x3726('0x32')](_0x5c8e94[_0x3726('0x2e')],_0x5c8e94[_0x3726('0x2f')]);_0x534639[_0x3726('0x33')]=_[_0x3726('0x32')](_0x5c8e94[_0x3726('0x2e')],qs[_0x3726('0x34')](_0x3ce1d2[_0x3726('0x2f')][_0x3726('0x34')]));_0x534639['attributes']=_0x534639[_0x3726('0x33')][_0x3726('0x35')]?_0x534639[_0x3726('0x33')]:_0x5c8e94['model'];if(_0x3ce1d2['query'][_0x3726('0x3e')]){_0x534639['include']=[{'all':!![]}];}_0x534639=_[_0x3726('0x3b')]({},_0x534639,_0x3ce1d2[_0x3726('0x44')]);return db['SquareRecording'][_0x3726('0x45')](_0x534639)[_0x3726('0x25')](handleEntityNotFound(_0x3e1142,null))[_0x3726('0x25')](respondWithResult(_0x3e1142,null))[_0x3726('0x42')](handleError(_0x3e1142,null));};exports[_0x3726('0x46')]=function(_0x34c2f4,_0x54ddec){return db[_0x3726('0x2b')][_0x3726('0x46')](_0x34c2f4[_0x3726('0x47')],{})[_0x3726('0x25')](respondWithResult(_0x54ddec,0xc9))['catch'](handleError(_0x54ddec,null));};exports[_0x3726('0x24')]=function(_0x625700,_0x15461){if(_0x625700[_0x3726('0x47')]['id']){delete _0x625700[_0x3726('0x47')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x625700['params']['id']}})[_0x3726('0x25')](handleEntityNotFound(_0x15461,null))[_0x3726('0x25')](saveUpdates(_0x625700['body'],null))[_0x3726('0x25')](respondWithResult(_0x15461,null))[_0x3726('0x42')](handleError(_0x15461,null));};exports[_0x3726('0x48')]=function(_0x33db68,_0x199c97,_0x1d9cab){var _0x25fc83=require(_0x3726('0x49'));var _0x5a67d7=![];var _0x4b29a1={};if(_0x33db68[_0x3726('0x2f')]['type']&&_0x33db68['query'][_0x3726('0x3d')]===_0x3726('0x4a')){_0x4b29a1[_0x3726('0x4a')]=_0x33db68[_0x3726('0x43')]['id'];}else{_0x4b29a1['id']=_0x33db68[_0x3726('0x43')]['id'];}return db[_0x3726('0x2b')][_0x3726('0x45')]({'where':_0x4b29a1,'attributes':['id',_0x3726('0x4b'),'filename'],'raw':!![]})[_0x3726('0x25')](handleEntityNotFound(_0x199c97,null))['then'](function(_0x2bb61f){if(_0x2bb61f){var _0x136fdb=_0x2bb61f[_0x3726('0x4b')];var _0x2f0c69=util['format'](_0x3726('0x4c'),_0x136fdb);if(fs['existsSync'](_0x2f0c69)){_0x5a67d7=!![];return _0x25fc83[_0x3726('0x4d')](_0x2f0c69,_0x136fdb,config['secrets'][_0x3726('0x4e')])[_0x3726('0x25')](function(){return _0x2bb61f;});}return _0x2bb61f;}})['then'](function(_0x1614e8){if(_0x1614e8){var _0x375a9c=_0x1614e8[_0x3726('0x4b')];if(!fs[_0x3726('0x4f')](_0x375a9c)){throw new db[(_0x3726('0x50'))][(_0x3726('0x51'))](_0x3726('0x52'));}if(_0x1614e8[_0x3726('0x53')]){return _0x199c97['download'](_0x375a9c,_0x1614e8['filename']+path['extname'](_0x375a9c),function(){if(_0x5a67d7){fs[_0x3726('0x54')](_0x375a9c);}});}else{return _0x199c97[_0x3726('0x48')](_0x375a9c,function(_0x2365a3){if(_0x5a67d7){fs[_0x3726('0x54')](_0x375a9c);}});}}})[_0x3726('0x42')](function(_0x59e10c){if(_0x59e10c['message']===_0x3726('0x52')){_0x199c97['status'](0x194)[_0x3726('0x55')](_0x3726('0x56'));}else{return handleError(_0x199c97,null);}});};exports['destroy']=function(_0x25cb6f,_0x5945c7){return db['SquareRecording'][_0x3726('0x45')]({'where':{'id':_0x25cb6f[_0x3726('0x43')]['id']}})[_0x3726('0x25')](function(_0x1b6fc3){if(_[_0x3726('0x57')](_0x1b6fc3)){throw new ReferenceError(_0x3726('0x58'));}return _0x1b6fc3;})[_0x3726('0x25')](function(_0x36f835){var _0xc46e2b=_0x36f835['savePath'];logger[_0x3726('0x59')](_0x3726('0x5a'),_0xc46e2b);if(!_[_0x3726('0x57')](_0x36f835['savePath'])&&fs[_0x3726('0x4f')](_0xc46e2b)){logger[_0x3726('0x59')](_0x3726('0x5b')+_0xc46e2b+_0x3726('0x5c'));fs[_0x3726('0x5d')](_0xc46e2b);}_0xc46e2b=_0xc46e2b+_0x3726('0x5e');if(!_[_0x3726('0x57')](_0x36f835[_0x3726('0x4b')])&&fs[_0x3726('0x4f')](_0xc46e2b)){logger[_0x3726('0x59')]('File:\x20\x22'+_0xc46e2b+_0x3726('0x5c'));fs[_0x3726('0x5d')](_0xc46e2b);}return _0x36f835;})['then'](function(_0x999587){if(!_0x999587)throw new InternalError();return _0x999587[_0x3726('0x26')]();})[_0x3726('0x25')](function(){_0x5945c7[_0x3726('0x19')](0xcc)[_0x3726('0x27')]();})[_0x3726('0x42')](handleError(_0x5945c7,null));}; \ No newline at end of file +var _0x7c0f=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','SquareRecording','count','includeAll','rows','catch','params','include','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22'];(function(_0x270243,_0x2a7a79){var _0x1dd094=function(_0x2df7a2){while(--_0x2df7a2){_0x270243['push'](_0x270243['shift']());}};_0x1dd094(++_0x2a7a79);}(_0x7c0f,0x1db));var _0xf7c0=function(_0x35e641,_0x4b5f7e){_0x35e641=_0x35e641-0x0;var _0x24c608=_0x7c0f[_0x35e641];return _0x24c608;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7c0('0x0'));var zipdir=require(_0xf7c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7c0('0x2'));var moment=require(_0xf7c0('0x3'));var BPromise=require(_0xf7c0('0x4'));var Mustache=require(_0xf7c0('0x5'));var util=require(_0xf7c0('0x6'));var path=require(_0xf7c0('0x7'));var sox=require(_0xf7c0('0x8'));var csv=require(_0xf7c0('0x9'));var ejs=require(_0xf7c0('0xa'));var fs=require('fs');var fs_extra=require(_0xf7c0('0xb'));var _=require(_0xf7c0('0xc'));var squel=require(_0xf7c0('0xd'));var crypto=require(_0xf7c0('0xe'));var jsforce=require(_0xf7c0('0xf'));var deskjs=require(_0xf7c0('0x10'));var toCsv=require(_0xf7c0('0x9'));var querystring=require(_0xf7c0('0x11'));var Papa=require('papaparse');var Redis=require(_0xf7c0('0x12'));var authService=require(_0xf7c0('0x13'));var qs=require(_0xf7c0('0x14'));var as=require(_0xf7c0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7c0('0x16'))('api');var utils=require(_0xf7c0('0x17'));var config=require(_0xf7c0('0x18'));var licenseUtil=require(_0xf7c0('0x19'));var db=require(_0xf7c0('0x1a'))['db'];function respondWithStatusCode(_0x3cdb08,_0x1ae79c){_0x1ae79c=_0x1ae79c||0xcc;return function(_0x5af45c){if(_0x5af45c){return _0x3cdb08['sendStatus'](_0x1ae79c);}return _0x3cdb08[_0xf7c0('0x1b')](_0x1ae79c)[_0xf7c0('0x1c')]();};}function respondWithResult(_0x5e9539,_0x1231f3){_0x1231f3=_0x1231f3||0xc8;return function(_0x568624){if(_0x568624){return _0x5e9539['status'](_0x1231f3)[_0xf7c0('0x1d')](_0x568624);}};}function respondWithFilteredResult(_0x10ea52,_0x51733a){return function(_0x2490ef){if(_0x2490ef){var _0x56d4aa=typeof _0x51733a[_0xf7c0('0x1e')]===_0xf7c0('0x1f')&&typeof _0x51733a[_0xf7c0('0x20')]==='undefined';var _0x385d29=_0x2490ef['count'];var _0x59a553=_0x56d4aa?0x0:_0x51733a[_0xf7c0('0x1e')];var _0x305e1b=_0x56d4aa?_0x2490ef['count']:_0x51733a[_0xf7c0('0x1e')]+_0x51733a['limit'];var _0x5b28cc;if(_0x305e1b>=_0x385d29){_0x305e1b=_0x385d29;_0x5b28cc=0xc8;}else{_0x5b28cc=0xce;}_0x10ea52[_0xf7c0('0x1b')](_0x5b28cc);return _0x10ea52[_0xf7c0('0x21')](_0xf7c0('0x22'),_0x59a553+'-'+_0x305e1b+'/'+_0x385d29)['json'](_0x2490ef);}return null;};}function patchUpdates(_0x221013){return function(_0x821954){try{jsonpatch[_0xf7c0('0x23')](_0x821954,_0x221013,!![]);}catch(_0x2f41ca){return BPromise[_0xf7c0('0x24')](_0x2f41ca);}return _0x821954['save']();};}function saveUpdates(_0x47121c,_0x3dd061){return function(_0x45fbe8){if(_0x45fbe8){return _0x45fbe8[_0xf7c0('0x25')](_0x47121c)['then'](function(_0x177c90){return _0x177c90;});}return null;};}function removeEntity(_0xec6c74,_0x1c6582){return function(_0x5782d6){if(_0x5782d6){return _0x5782d6[_0xf7c0('0x26')]()[_0xf7c0('0x27')](function(){_0xec6c74[_0xf7c0('0x1b')](0xcc)[_0xf7c0('0x1c')]();});}};}function handleEntityNotFound(_0x253fb2,_0x2cc0c4){return function(_0x1ed768){if(!_0x1ed768){_0x253fb2['sendStatus'](0x194);}return _0x1ed768;};}function handleError(_0x1dcefe,_0x5cdaaa){_0x5cdaaa=_0x5cdaaa||0x1f4;return function(_0x4cf900){logger[_0xf7c0('0x28')](_0x4cf900['stack']);if(_0x4cf900['name']){delete _0x4cf900[_0xf7c0('0x29')];}_0x1dcefe[_0xf7c0('0x1b')](_0x5cdaaa)[_0xf7c0('0x2a')](_0x4cf900);};}exports['index']=function(_0x593b29,_0x429759){var _0x3bfcd8={},_0x4a3326={},_0x1321ab={'count':0x0,'rows':[]};var _0x56727a=_[_0xf7c0('0x2b')](db['SquareRecording'][_0xf7c0('0x2c')],function(_0x28dfdb){return{'name':_0x28dfdb['fieldName'],'type':_0x28dfdb[_0xf7c0('0x2d')][_0xf7c0('0x2e')]};});_0x4a3326[_0xf7c0('0x2f')]=_[_0xf7c0('0x2b')](_0x56727a,'name');_0x4a3326[_0xf7c0('0x30')]=_[_0xf7c0('0x31')](_0x593b29[_0xf7c0('0x30')]);_0x4a3326['filters']=_[_0xf7c0('0x32')](_0x4a3326['model'],_0x4a3326[_0xf7c0('0x30')]);_0x3bfcd8[_0xf7c0('0x33')]=_['intersection'](_0x4a3326[_0xf7c0('0x2f')],qs['fields'](_0x593b29[_0xf7c0('0x30')][_0xf7c0('0x34')]));_0x3bfcd8['attributes']=_0x3bfcd8[_0xf7c0('0x33')]['length']?_0x3bfcd8['attributes']:_0x4a3326[_0xf7c0('0x2f')];if(!_0x593b29[_0xf7c0('0x30')][_0xf7c0('0x35')](_0xf7c0('0x36'))){_0x3bfcd8[_0xf7c0('0x20')]=qs[_0xf7c0('0x20')](_0x593b29[_0xf7c0('0x30')][_0xf7c0('0x20')]);_0x3bfcd8[_0xf7c0('0x1e')]=qs[_0xf7c0('0x1e')](_0x593b29[_0xf7c0('0x30')][_0xf7c0('0x1e')]);}_0x3bfcd8['order']=qs[_0xf7c0('0x37')](_0x593b29[_0xf7c0('0x30')]['sort']);_0x3bfcd8[_0xf7c0('0x38')]=qs['filters'](_[_0xf7c0('0x39')](_0x593b29[_0xf7c0('0x30')],_0x4a3326[_0xf7c0('0x3a')]),_0x56727a);if(_0x593b29[_0xf7c0('0x30')][_0xf7c0('0x3b')]){_0x3bfcd8[_0xf7c0('0x38')]=_[_0xf7c0('0x3c')](_0x3bfcd8[_0xf7c0('0x38')],{'$or':_[_0xf7c0('0x2b')](_0x56727a,function(_0x13fa5e){if(_0x13fa5e[_0xf7c0('0x2d')]!=='VIRTUAL'){var _0x47f7ef={};_0x47f7ef[_0x13fa5e[_0xf7c0('0x29')]]={'$like':'%'+_0x593b29['query']['filter']+'%'};return _0x47f7ef;}})});}_0x3bfcd8=_[_0xf7c0('0x3c')]({},_0x3bfcd8,_0x593b29[_0xf7c0('0x3d')]);var _0x1ac16b={'where':_0x3bfcd8['where']};return db[_0xf7c0('0x3e')][_0xf7c0('0x3f')](_0x1ac16b)[_0xf7c0('0x27')](function(_0x389280){_0x1321ab[_0xf7c0('0x3f')]=_0x389280;if(_0x593b29[_0xf7c0('0x30')][_0xf7c0('0x40')]){_0x3bfcd8['include']=[{'all':!![]}];}return db[_0xf7c0('0x3e')]['findAll'](_0x3bfcd8);})[_0xf7c0('0x27')](function(_0x30b776){_0x1321ab[_0xf7c0('0x41')]=_0x30b776;return _0x1321ab;})[_0xf7c0('0x27')](respondWithFilteredResult(_0x429759,_0x3bfcd8))[_0xf7c0('0x42')](handleError(_0x429759,null));};exports['show']=function(_0x5effa2,_0x11b2a4){var _0x1168ff={'raw':!![],'where':{'id':_0x5effa2[_0xf7c0('0x43')]['id']}},_0x896db6={};_0x896db6['model']=_[_0xf7c0('0x31')](db[_0xf7c0('0x3e')]['rawAttributes']);_0x896db6[_0xf7c0('0x30')]=_[_0xf7c0('0x31')](_0x5effa2[_0xf7c0('0x30')]);_0x896db6[_0xf7c0('0x3a')]=_[_0xf7c0('0x32')](_0x896db6[_0xf7c0('0x2f')],_0x896db6[_0xf7c0('0x30')]);_0x1168ff[_0xf7c0('0x33')]=_[_0xf7c0('0x32')](_0x896db6[_0xf7c0('0x2f')],qs[_0xf7c0('0x34')](_0x5effa2[_0xf7c0('0x30')][_0xf7c0('0x34')]));_0x1168ff[_0xf7c0('0x33')]=_0x1168ff[_0xf7c0('0x33')]['length']?_0x1168ff[_0xf7c0('0x33')]:_0x896db6[_0xf7c0('0x2f')];if(_0x5effa2[_0xf7c0('0x30')][_0xf7c0('0x40')]){_0x1168ff[_0xf7c0('0x44')]=[{'all':!![]}];}_0x1168ff=_['merge']({},_0x1168ff,_0x5effa2['options']);return db[_0xf7c0('0x3e')]['find'](_0x1168ff)[_0xf7c0('0x27')](handleEntityNotFound(_0x11b2a4,null))[_0xf7c0('0x27')](respondWithResult(_0x11b2a4,null))['catch'](handleError(_0x11b2a4,null));};exports[_0xf7c0('0x45')]=function(_0xa833bc,_0x3f35d7){return db[_0xf7c0('0x3e')]['create'](_0xa833bc['body'],{})['then'](respondWithResult(_0x3f35d7,0xc9))['catch'](handleError(_0x3f35d7,null));};exports[_0xf7c0('0x25')]=function(_0x221db3,_0x398fa5){if(_0x221db3['body']['id']){delete _0x221db3[_0xf7c0('0x46')]['id'];}return db[_0xf7c0('0x3e')][_0xf7c0('0x47')]({'where':{'id':_0x221db3[_0xf7c0('0x43')]['id']}})[_0xf7c0('0x27')](handleEntityNotFound(_0x398fa5,null))[_0xf7c0('0x27')](saveUpdates(_0x221db3[_0xf7c0('0x46')],null))[_0xf7c0('0x27')](respondWithResult(_0x398fa5,null))[_0xf7c0('0x42')](handleError(_0x398fa5,null));};exports[_0xf7c0('0x48')]=function(_0x1a6811,_0x3dd128,_0x2251f8){var _0x41ca0c=require(_0xf7c0('0x49'));var _0x218b40=![];var _0x1c9100={};if(_0x1a6811[_0xf7c0('0x30')][_0xf7c0('0x2d')]&&_0x1a6811[_0xf7c0('0x30')]['type']==='uniqueid'){_0x1c9100[_0xf7c0('0x4a')]=_0x1a6811[_0xf7c0('0x43')]['id'];}else{_0x1c9100['id']=_0x1a6811[_0xf7c0('0x43')]['id'];}return db[_0xf7c0('0x3e')][_0xf7c0('0x47')]({'where':_0x1c9100,'attributes':['id',_0xf7c0('0x4b'),_0xf7c0('0x4c')],'raw':!![]})[_0xf7c0('0x27')](handleEntityNotFound(_0x3dd128,null))[_0xf7c0('0x27')](function(_0x3a4f81){if(_0x3a4f81){var _0x5ae4fd=_0x3a4f81['savePath'];var _0x369fbb=util[_0xf7c0('0x4d')]('%s.cypher',_0x5ae4fd);if(fs[_0xf7c0('0x4e')](_0x369fbb)){_0x218b40=!![];return _0x41ca0c[_0xf7c0('0x4f')](_0x369fbb,_0x5ae4fd,config['secrets'][_0xf7c0('0x50')])['then'](function(){return _0x3a4f81;});}return _0x3a4f81;}})[_0xf7c0('0x27')](function(_0x397fed){if(_0x397fed){var _0x400087=_0x397fed[_0xf7c0('0x4b')];if(!fs[_0xf7c0('0x4e')](_0x400087)){throw new db[(_0xf7c0('0x51'))][(_0xf7c0('0x52'))](_0xf7c0('0x53'));}if(_0x397fed[_0xf7c0('0x4c')]){return _0x3dd128[_0xf7c0('0x48')](_0x400087,_0x397fed[_0xf7c0('0x4c')]+path[_0xf7c0('0x54')](_0x400087),function(){if(_0x218b40){fs['unlink'](_0x400087);}});}else{return _0x3dd128[_0xf7c0('0x48')](_0x400087,function(_0x3db92a){if(_0x218b40){fs['unlink'](_0x400087);}});}}})[_0xf7c0('0x42')](function(_0xea3efe){if(_0xea3efe[_0xf7c0('0x55')]==='SquareRecording\x20not\x20found'){_0x3dd128[_0xf7c0('0x1b')](0x194)[_0xf7c0('0x2a')](_0xf7c0('0x56'));}else{return handleError(_0x3dd128,null);}});};exports[_0xf7c0('0x26')]=function(_0x342f5d,_0x417dd2){return db[_0xf7c0('0x3e')][_0xf7c0('0x47')]({'where':{'id':_0x342f5d['params']['id']}})[_0xf7c0('0x27')](function(_0x36eefa){if(_[_0xf7c0('0x57')](_0x36eefa)){throw new ReferenceError(_0xf7c0('0x58'));}return _0x36eefa;})[_0xf7c0('0x27')](function(_0x3ae93a){var _0x4a772b=_0x3ae93a['savePath'];logger[_0xf7c0('0x59')](_0xf7c0('0x5a'),_0x4a772b);if(!_[_0xf7c0('0x57')](_0x3ae93a[_0xf7c0('0x4b')])&&fs[_0xf7c0('0x4e')](_0x4a772b)){logger[_0xf7c0('0x59')]('File:\x20\x22'+_0x4a772b+_0xf7c0('0x5b'));fs[_0xf7c0('0x5c')](_0x4a772b);}_0x4a772b=_0x4a772b+_0xf7c0('0x5d');if(!_[_0xf7c0('0x57')](_0x3ae93a['savePath'])&&fs[_0xf7c0('0x4e')](_0x4a772b)){logger['info'](_0xf7c0('0x5e')+_0x4a772b+_0xf7c0('0x5b'));fs[_0xf7c0('0x5c')](_0x4a772b);}return _0x3ae93a;})[_0xf7c0('0x27')](function(_0x3a44ab){if(!_0x3a44ab)throw new InternalError();return _0x3a44ab[_0xf7c0('0x26')]();})[_0xf7c0('0x27')](function(){_0x417dd2['status'](0xcc)[_0xf7c0('0x1c')]();})[_0xf7c0('0x42')](handleError(_0x417dd2,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 8b12f56..500d22f 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 _0x8fcd=['moment','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','lodash','util','../../config/logger','api'];(function(_0x2487cb,_0x3c3231){var _0x12a831=function(_0x20c596){while(--_0x20c596){_0x2487cb['push'](_0x2487cb['shift']());}};_0x12a831(++_0x3c3231);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x1e40e9,_0x16cc7a){_0x1e40e9=_0x1e40e9-0x0;var _0x3d3cbc=_0x8fcd[_0x1e40e9];return _0x3d3cbc;};'use strict';var _=require(_0xd8fc('0x0'));var util=require(_0xd8fc('0x1'));var logger=require(_0xd8fc('0x2'))(_0xd8fc('0x3'));var moment=require(_0xd8fc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8fc('0x5'));var rimraf=require(_0xd8fc('0x6'));var config=require(_0xd8fc('0x7'));var attributes=require(_0xd8fc('0x8'));module[_0xd8fc('0x9')]=function(_0x127911,_0x5d9c8e){return _0x127911['define'](_0xd8fc('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2faf=['bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util','../../config/logger','moment'];(function(_0x55dd01,_0xac4207){var _0xf38a3e=function(_0x47e32e){while(--_0x47e32e){_0x55dd01['push'](_0x55dd01['shift']());}};_0xf38a3e(++_0xac4207);}(_0x2faf,0xb0));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf2fa('0x0'));var util=require(_0xf2fa('0x1'));var logger=require(_0xf2fa('0x2'))('api');var moment=require(_0xf2fa('0x3'));var BPromise=require(_0xf2fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2fa('0x5'));var rimraf=require(_0xf2fa('0x6'));var config=require(_0xf2fa('0x7'));var attributes=require(_0xf2fa('0x8'));module[_0xf2fa('0x9')]=function(_0x33c832,_0x44d406){return _0x33c832['define'](_0xf2fa('0xa'),attributes,{'tableName':_0xf2fa('0xb'),'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 bb44d01..3c499f0 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 _0xf4d9=['options','raw','then','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','SquareRecording','body'];(function(_0x5f6d3d,_0x5b6c3f){var _0x1d4252=function(_0x19603e){while(--_0x19603e){_0x5f6d3d['push'](_0x5f6d3d['shift']());}};_0x1d4252(++_0x5b6c3f);}(_0xf4d9,0xc1));var _0x9f4d=function(_0x193281,_0x5cd64f){_0x193281=_0x193281-0x0;var _0x575553=_0xf4d9[_0x193281];return _0x575553;};'use strict';var _=require(_0x9f4d('0x0'));var util=require(_0x9f4d('0x1'));var moment=require(_0x9f4d('0x2'));var BPromise=require(_0x9f4d('0x3'));var rs=require(_0x9f4d('0x4'));var fs=require('fs');var Redis=require(_0x9f4d('0x5'));var db=require(_0x9f4d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f4d('0x7'))(_0x9f4d('0x8'));var config=require(_0x9f4d('0x9'));var jayson=require(_0x9f4d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6f56,_0x3c8a15,_0x1ad440){return new BPromise(function(_0x1ae6fc,_0x467256){return client[_0x9f4d('0xb')](_0x4c6f56,_0x1ad440)['then'](function(_0x488c91){logger[_0x9f4d('0xc')](_0x9f4d('0xd'),_0x3c8a15,_0x9f4d('0xe'));logger[_0x9f4d('0xf')](_0x9f4d('0x10'),_0x3c8a15,_0x9f4d('0xe'),JSON['stringify'](_0x488c91));if(_0x488c91[_0x9f4d('0x11')]){if(_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x12')]===0x1f4){logger[_0x9f4d('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x13')]);return _0x467256(_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x13')]);}logger[_0x9f4d('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x13')]);return _0x1ae6fc(_0x488c91['error']['message']);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x9f4d('0xe'));_0x1ae6fc(_0x488c91['result']['message']);}})[_0x9f4d('0x14')](function(_0x4f5aaf){logger[_0x9f4d('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x4f5aaf);_0x467256(_0x4f5aaf);});});}exports['CreateSquareRecording']=function(_0x2f7b7d){var _0x87caa0=this;return new Promise(function(_0x257178,_0x583758){return db[_0x9f4d('0x15')]['create'](_0x2f7b7d[_0x9f4d('0x16')],{'raw':_0x2f7b7d[_0x9f4d('0x17')]?_0x2f7b7d['options'][_0x9f4d('0x18')]===undefined?!![]:![]:!![]})[_0x9f4d('0x19')](function(_0x50c3c8){logger[_0x9f4d('0xc')](_0x9f4d('0x1a'),_0x2f7b7d);logger[_0x9f4d('0xf')](_0x9f4d('0x1a'),_0x2f7b7d,JSON['stringify'](_0x50c3c8));_0x257178(_0x50c3c8);})[_0x9f4d('0x14')](function(_0xd16967){logger[_0x9f4d('0x11')](_0x9f4d('0x1a'),_0xd16967[_0x9f4d('0x13')],_0x2f7b7d);_0x583758(_0x87caa0['error'](0x1f4,_0xd16967['message']));});});}; \ No newline at end of file +var _0x6a45=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','CreateSquareRecording','SquareRecording','create','body','stringify','catch'];(function(_0x2010f7,_0x3b1a0e){var _0x19c064=function(_0x3f21ce){while(--_0x3f21ce){_0x2010f7['push'](_0x2010f7['shift']());}};_0x19c064(++_0x3b1a0e);}(_0x6a45,0x11e));var _0x56a4=function(_0xf58b80,_0x1bfe1f){_0xf58b80=_0xf58b80-0x0;var _0x51651c=_0x6a45[_0xf58b80];return _0x51651c;};'use strict';var _=require(_0x56a4('0x0'));var util=require(_0x56a4('0x1'));var moment=require(_0x56a4('0x2'));var BPromise=require(_0x56a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56a4('0x4'));var db=require(_0x56a4('0x5'))['db'];var utils=require(_0x56a4('0x6'));var logger=require(_0x56a4('0x7'))('rpc');var config=require(_0x56a4('0x8'));var jayson=require(_0x56a4('0x9'));var client=jayson['client'][_0x56a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fa3b9,_0x16e9d3,_0x5a523a){return new BPromise(function(_0x11e3dc,_0x14d531){return client[_0x56a4('0xb')](_0x4fa3b9,_0x5a523a)[_0x56a4('0xc')](function(_0xe09a27){logger[_0x56a4('0xd')](_0x56a4('0xe'),_0x16e9d3,'request\x20sent');logger[_0x56a4('0xf')](_0x56a4('0x10'),_0x16e9d3,'request\x20sent',JSON['stringify'](_0xe09a27));if(_0xe09a27[_0x56a4('0x11')]){if(_0xe09a27['error']['code']===0x1f4){logger[_0x56a4('0x11')](_0x56a4('0xe'),_0x16e9d3,_0xe09a27[_0x56a4('0x11')][_0x56a4('0x12')]);return _0x14d531(_0xe09a27[_0x56a4('0x11')]['message']);}logger[_0x56a4('0x11')](_0x56a4('0xe'),_0x16e9d3,_0xe09a27[_0x56a4('0x11')]['message']);return _0x11e3dc(_0xe09a27[_0x56a4('0x11')][_0x56a4('0x12')]);}else{logger[_0x56a4('0xd')](_0x56a4('0xe'),_0x16e9d3,_0x56a4('0x13'));_0x11e3dc(_0xe09a27['result'][_0x56a4('0x12')]);}})['catch'](function(_0x343cfa){logger[_0x56a4('0x11')]('SquareRecording,\x20%s,\x20%s',_0x16e9d3,_0x343cfa);_0x14d531(_0x343cfa);});});}exports[_0x56a4('0x14')]=function(_0x5ac07c){var _0x2038b2=this;return new Promise(function(_0x13d569,_0x557d57){return db[_0x56a4('0x15')][_0x56a4('0x16')](_0x5ac07c[_0x56a4('0x17')],{'raw':_0x5ac07c['options']?_0x5ac07c['options']['raw']===undefined?!![]:![]:!![]})[_0x56a4('0xc')](function(_0x525f60){logger[_0x56a4('0xd')](_0x56a4('0x14'),_0x5ac07c);logger['debug']('CreateSquareRecording',_0x5ac07c,JSON[_0x56a4('0x18')](_0x525f60));_0x13d569(_0x525f60);})[_0x56a4('0x19')](function(_0x42652c){logger[_0x56a4('0x11')]('CreateSquareRecording',_0x42652c[_0x56a4('0x12')],_0x5ac07c);_0x557d57(_0x2038b2[_0x56a4('0x11')](0x1f4,_0x42652c[_0x56a4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b253a3e..0118a7d 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(_0xbd2347,_0x21809a){var _0x2b1212=function(_0x2fc2cd){while(--_0x2fc2cd){_0xbd2347['push'](_0xbd2347['shift']());}};_0x2b1212(++_0x21809a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 63d8518..1dc500b 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 _0xce60=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x137077,_0x575634){var _0x18a2b3=function(_0x576c4d){while(--_0x576c4d){_0x137077['push'](_0x137077['shift']());}};_0x18a2b3(++_0x575634);}(_0xce60,0xca));var _0x0ce6=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0xce60[_0x3050ca];return _0x1eed1d;};'use strict';var Sequelize=require(_0x0ce6('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x0ce6('0x1')]},'channel':{'type':Sequelize[_0x0ce6('0x1')]},'language':{'type':Sequelize[_0x0ce6('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0ce6('0x1')]},'version':{'type':Sequelize[_0x0ce6('0x1')]},'callerid':{'type':Sequelize[_0x0ce6('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x0ce6('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x0ce6('0x1')]},'callingtns':{'type':Sequelize[_0x0ce6('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x0ce6('0x1')]},'context':{'type':Sequelize[_0x0ce6('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0ce6('0x1')]},'enhanced':{'type':Sequelize[_0x0ce6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0ce6('0x1')]},'project_name':{'type':Sequelize[_0x0ce6('0x1')]},'joinAt':{'type':Sequelize[_0x0ce6('0x2')]},'leaveAt':{'type':Sequelize[_0x0ce6('0x2')]},'bot':{'type':Sequelize[_0x0ce6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xffc0=['exports','STRING','DATE','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x5789c2,_0x1fb5c0){_0x5789c2=_0x5789c2-0x0;var _0x43e604=_0xffc0[_0x5789c2];return _0x43e604;};'use strict';var Sequelize=require('sequelize');module[_0x0ffc('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x0ffc('0x1')]},'request':{'type':Sequelize[_0x0ffc('0x1')]},'channel':{'type':Sequelize[_0x0ffc('0x1')]},'language':{'type':Sequelize[_0x0ffc('0x1')]},'type':{'type':Sequelize[_0x0ffc('0x1')]},'uniqueid':{'type':Sequelize[_0x0ffc('0x1')]},'version':{'type':Sequelize[_0x0ffc('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0ffc('0x1')]},'callingpres':{'type':Sequelize[_0x0ffc('0x1')]},'callingani2':{'type':Sequelize[_0x0ffc('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x0ffc('0x1')]},'rdnis':{'type':Sequelize[_0x0ffc('0x1')]},'context':{'type':Sequelize[_0x0ffc('0x1')]},'extension':{'type':Sequelize[_0x0ffc('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x0ffc('0x1')]},'accountcode':{'type':Sequelize[_0x0ffc('0x1')]},'threadid':{'type':Sequelize[_0x0ffc('0x1')]},'project_name':{'type':Sequelize[_0x0ffc('0x1')]},'joinAt':{'type':Sequelize[_0x0ffc('0x2')]},'leaveAt':{'type':Sequelize[_0x0ffc('0x2')]},'bot':{'type':Sequelize[_0x0ffc('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index ed8c993..35ccafe 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 _0x8576=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','catch'];(function(_0x228c21,_0x9f0166){var _0x3bb84b=function(_0x5541b2){while(--_0x5541b2){_0x228c21['push'](_0x228c21['shift']());}};_0x3bb84b(++_0x9f0166);}(_0x8576,0x131));var _0x6857=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x8576[_0x5ddaac];return _0x2a9c58;};'use strict';var emlformat=require(_0x6857('0x0'));var rimraf=require(_0x6857('0x1'));var zipdir=require(_0x6857('0x2'));var jsonpatch=require(_0x6857('0x3'));var rp=require(_0x6857('0x4'));var moment=require(_0x6857('0x5'));var BPromise=require(_0x6857('0x6'));var Mustache=require(_0x6857('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6857('0x8'));var csv=require('to-csv');var ejs=require(_0x6857('0x9'));var fs=require('fs');var fs_extra=require(_0x6857('0xa'));var _=require(_0x6857('0xb'));var squel=require(_0x6857('0xc'));var crypto=require(_0x6857('0xd'));var jsforce=require(_0x6857('0xe'));var deskjs=require(_0x6857('0xf'));var toCsv=require(_0x6857('0x10'));var querystring=require(_0x6857('0x11'));var Papa=require(_0x6857('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6857('0x13'));var logger=require(_0x6857('0x14'))(_0x6857('0x15'));var utils=require(_0x6857('0x16'));var config=require(_0x6857('0x17'));var licenseUtil=require(_0x6857('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xda62d7,_0x41ff38){_0x41ff38=_0x41ff38||0xcc;return function(_0x25fa6c){if(_0x25fa6c){return _0xda62d7[_0x6857('0x19')](_0x41ff38);}return _0xda62d7['status'](_0x41ff38)[_0x6857('0x1a')]();};}function respondWithResult(_0x59c62e,_0x5c7d1c){_0x5c7d1c=_0x5c7d1c||0xc8;return function(_0x2c2c16){if(_0x2c2c16){return _0x59c62e[_0x6857('0x1b')](_0x5c7d1c)['json'](_0x2c2c16);}};}function respondWithFilteredResult(_0x1d01d9,_0xe311d2){return function(_0x171c9b){if(_0x171c9b){var _0x4e1861=typeof _0xe311d2['offset']===_0x6857('0x1c')&&typeof _0xe311d2[_0x6857('0x1d')]===_0x6857('0x1c');var _0x20054d=_0x171c9b[_0x6857('0x1e')];var _0x58adc3=_0x4e1861?0x0:_0xe311d2[_0x6857('0x1f')];var _0x7fab7b=_0x4e1861?_0x171c9b[_0x6857('0x1e')]:_0xe311d2['offset']+_0xe311d2[_0x6857('0x1d')];var _0x59fb16;if(_0x7fab7b>=_0x20054d){_0x7fab7b=_0x20054d;_0x59fb16=0xc8;}else{_0x59fb16=0xce;}_0x1d01d9[_0x6857('0x1b')](_0x59fb16);return _0x1d01d9[_0x6857('0x20')](_0x6857('0x21'),_0x58adc3+'-'+_0x7fab7b+'/'+_0x20054d)['json'](_0x171c9b);}return null;};}function patchUpdates(_0x27314a){return function(_0x5db0bc){try{jsonpatch[_0x6857('0x22')](_0x5db0bc,_0x27314a,!![]);}catch(_0x1180cd){return BPromise[_0x6857('0x23')](_0x1180cd);}return _0x5db0bc[_0x6857('0x24')]();};}function saveUpdates(_0x1624ff,_0x13ed4f){return function(_0x49c21d){if(_0x49c21d){return _0x49c21d[_0x6857('0x25')](_0x1624ff)[_0x6857('0x26')](function(_0x29f0f6){return _0x29f0f6;});}return null;};}function removeEntity(_0x4a854c,_0xa24382){return function(_0x502149){if(_0x502149){return _0x502149[_0x6857('0x27')]()['then'](function(){_0x4a854c[_0x6857('0x1b')](0xcc)[_0x6857('0x1a')]();});}};}function handleEntityNotFound(_0xa63c68,_0x847fa8){return function(_0x2a0c69){if(!_0x2a0c69){_0xa63c68[_0x6857('0x19')](0x194);}return _0x2a0c69;};}function handleError(_0x41322f,_0x397343){_0x397343=_0x397343||0x1f4;return function(_0x241c1d){logger[_0x6857('0x28')](_0x241c1d[_0x6857('0x29')]);if(_0x241c1d['name']){delete _0x241c1d[_0x6857('0x2a')];}_0x41322f['status'](_0x397343)[_0x6857('0x2b')](_0x241c1d);};}exports[_0x6857('0x2c')]=function(_0xca637c,_0x6d2fa0){var _0x13a535={},_0x56e8e6={},_0x927b69={'count':0x0,'rows':[]};var _0x2bbe4b=_['map'](db[_0x6857('0x2d')][_0x6857('0x2e')],function(_0x4bc4f8){return{'name':_0x4bc4f8[_0x6857('0x2f')],'type':_0x4bc4f8[_0x6857('0x30')][_0x6857('0x31')]};});_0x56e8e6[_0x6857('0x32')]=_['map'](_0x2bbe4b,_0x6857('0x2a'));_0x56e8e6['query']=_[_0x6857('0x33')](_0xca637c[_0x6857('0x34')]);_0x56e8e6[_0x6857('0x35')]=_[_0x6857('0x36')](_0x56e8e6[_0x6857('0x32')],_0x56e8e6['query']);_0x13a535['attributes']=_['intersection'](_0x56e8e6[_0x6857('0x32')],qs[_0x6857('0x37')](_0xca637c[_0x6857('0x34')][_0x6857('0x37')]));_0x13a535[_0x6857('0x38')]=_0x13a535[_0x6857('0x38')][_0x6857('0x39')]?_0x13a535['attributes']:_0x56e8e6[_0x6857('0x32')];if(!_0xca637c[_0x6857('0x34')]['hasOwnProperty']('nolimit')){_0x13a535[_0x6857('0x1d')]=qs[_0x6857('0x1d')](_0xca637c['query']['limit']);_0x13a535['offset']=qs['offset'](_0xca637c['query']['offset']);}_0x13a535[_0x6857('0x3a')]=qs[_0x6857('0x3b')](_0xca637c['query'][_0x6857('0x3b')]);_0x13a535[_0x6857('0x3c')]=qs[_0x6857('0x35')](_['pick'](_0xca637c['query'],_0x56e8e6[_0x6857('0x35')]),_0x2bbe4b);if(_0xca637c[_0x6857('0x34')][_0x6857('0x3d')]){_0x13a535[_0x6857('0x3c')]=_['merge'](_0x13a535[_0x6857('0x3c')],{'$or':_[_0x6857('0x3e')](_0x2bbe4b,function(_0x5251c8){if(_0x5251c8[_0x6857('0x30')]!==_0x6857('0x3f')){var _0x215f12={};_0x215f12[_0x5251c8[_0x6857('0x2a')]]={'$like':'%'+_0xca637c['query'][_0x6857('0x3d')]+'%'};return _0x215f12;}})});}_0x13a535=_[_0x6857('0x40')]({},_0x13a535,_0xca637c[_0x6857('0x41')]);var _0x1f8106={'where':_0x13a535[_0x6857('0x3c')]};return db[_0x6857('0x2d')][_0x6857('0x1e')](_0x1f8106)['then'](function(_0x21c832){_0x927b69[_0x6857('0x1e')]=_0x21c832;if(_0xca637c[_0x6857('0x34')][_0x6857('0x42')]){_0x13a535[_0x6857('0x43')]=[{'all':!![]}];}return db['SquareReport'][_0x6857('0x44')](_0x13a535);})[_0x6857('0x26')](function(_0x40982e){_0x927b69['rows']=_0x40982e;return _0x927b69;})[_0x6857('0x26')](respondWithFilteredResult(_0x6d2fa0,_0x13a535))['catch'](handleError(_0x6d2fa0,null));};exports[_0x6857('0x45')]=function(_0x5e2780,_0x2fb6f2){var _0x20da9d={'raw':!![],'where':{'id':_0x5e2780[_0x6857('0x46')]['id']}},_0x3b2da3={};_0x3b2da3['model']=_[_0x6857('0x33')](db[_0x6857('0x2d')][_0x6857('0x2e')]);_0x3b2da3['query']=_[_0x6857('0x33')](_0x5e2780[_0x6857('0x34')]);_0x3b2da3[_0x6857('0x35')]=_[_0x6857('0x36')](_0x3b2da3[_0x6857('0x32')],_0x3b2da3['query']);_0x20da9d[_0x6857('0x38')]=_[_0x6857('0x36')](_0x3b2da3[_0x6857('0x32')],qs[_0x6857('0x37')](_0x5e2780['query'][_0x6857('0x37')]));_0x20da9d['attributes']=_0x20da9d[_0x6857('0x38')][_0x6857('0x39')]?_0x20da9d[_0x6857('0x38')]:_0x3b2da3[_0x6857('0x32')];if(_0x5e2780['query']['includeAll']){_0x20da9d[_0x6857('0x43')]=[{'all':!![]}];}_0x20da9d=_['merge']({},_0x20da9d,_0x5e2780['options']);return db[_0x6857('0x2d')][_0x6857('0x47')](_0x20da9d)[_0x6857('0x26')](handleEntityNotFound(_0x2fb6f2,null))['then'](respondWithResult(_0x2fb6f2,null))['catch'](handleError(_0x2fb6f2,null));};exports[_0x6857('0x48')]=function(_0x8462e2,_0x1f9db9){return db['SquareReport'][_0x6857('0x48')](_0x8462e2[_0x6857('0x49')],{})[_0x6857('0x26')](respondWithResult(_0x1f9db9,0xc9))[_0x6857('0x4a')](handleError(_0x1f9db9,null));};exports[_0x6857('0x25')]=function(_0x387de9,_0x4c709d){if(_0x387de9['body']['id']){delete _0x387de9[_0x6857('0x49')]['id'];}return db[_0x6857('0x2d')][_0x6857('0x47')]({'where':{'id':_0x387de9[_0x6857('0x46')]['id']}})[_0x6857('0x26')](handleEntityNotFound(_0x4c709d,null))[_0x6857('0x26')](saveUpdates(_0x387de9[_0x6857('0x49')],null))[_0x6857('0x26')](respondWithResult(_0x4c709d,null))[_0x6857('0x4a')](handleError(_0x4c709d,null));};exports[_0x6857('0x27')]=function(_0x1f99b6,_0xb83071){return db[_0x6857('0x2d')][_0x6857('0x47')]({'where':{'id':_0x1f99b6[_0x6857('0x46')]['id']}})[_0x6857('0x26')](handleEntityNotFound(_0xb83071,null))[_0x6857('0x26')](removeEntity(_0xb83071,null))[_0x6857('0x4a')](handleError(_0xb83071,null));};exports['describe']=function(_0x5d5443,_0x39142e){return db[_0x6857('0x2d')][_0x6857('0x4b')]()['then'](respondWithResult(_0x39142e,null))[_0x6857('0x4a')](handleError(_0x39142e,null));}; \ No newline at end of file +var _0xa47f=['fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../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','reject','save','update','then','destroy','error','name','send','map','SquareReport','fieldName','type','key','keys','filters','model','query','attributes','intersection'];(function(_0x1662e8,_0x23f431){var _0x3ca0a1=function(_0x20f625){while(--_0x20f625){_0x1662e8['push'](_0x1662e8['shift']());}};_0x3ca0a1(++_0x23f431);}(_0xa47f,0xfa));var _0xfa47=function(_0xfdc515,_0x4585bc){_0xfdc515=_0xfdc515-0x0;var _0x1e9e02=_0xa47f[_0xfdc515];return _0x1e9e02;};'use strict';var emlformat=require(_0xfa47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa47('0x1'));var jsonpatch=require(_0xfa47('0x2'));var rp=require(_0xfa47('0x3'));var moment=require('moment');var BPromise=require(_0xfa47('0x4'));var Mustache=require(_0xfa47('0x5'));var util=require(_0xfa47('0x6'));var path=require(_0xfa47('0x7'));var sox=require(_0xfa47('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa47('0x9'));var _=require(_0xfa47('0xa'));var squel=require(_0xfa47('0xb'));var crypto=require(_0xfa47('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfa47('0xd'));var toCsv=require(_0xfa47('0xe'));var querystring=require(_0xfa47('0xf'));var Papa=require(_0xfa47('0x10'));var Redis=require('ioredis');var authService=require(_0xfa47('0x11'));var qs=require(_0xfa47('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfa47('0x13'));var utils=require(_0xfa47('0x14'));var config=require(_0xfa47('0x15'));var licenseUtil=require(_0xfa47('0x16'));var db=require(_0xfa47('0x17'))['db'];function respondWithStatusCode(_0x151dfa,_0x2f6868){_0x2f6868=_0x2f6868||0xcc;return function(_0x395ab3){if(_0x395ab3){return _0x151dfa[_0xfa47('0x18')](_0x2f6868);}return _0x151dfa[_0xfa47('0x19')](_0x2f6868)[_0xfa47('0x1a')]();};}function respondWithResult(_0x1887dd,_0x1f9812){_0x1f9812=_0x1f9812||0xc8;return function(_0x1165c8){if(_0x1165c8){return _0x1887dd[_0xfa47('0x19')](_0x1f9812)[_0xfa47('0x1b')](_0x1165c8);}};}function respondWithFilteredResult(_0x53e69c,_0x412fad){return function(_0x5318d0){if(_0x5318d0){var _0x43d30f=typeof _0x412fad[_0xfa47('0x1c')]===_0xfa47('0x1d')&&typeof _0x412fad[_0xfa47('0x1e')]==='undefined';var _0x59d3c3=_0x5318d0[_0xfa47('0x1f')];var _0x5e929f=_0x43d30f?0x0:_0x412fad[_0xfa47('0x1c')];var _0x1cf95f=_0x43d30f?_0x5318d0[_0xfa47('0x1f')]:_0x412fad[_0xfa47('0x1c')]+_0x412fad['limit'];var _0x5ab5ff;if(_0x1cf95f>=_0x59d3c3){_0x1cf95f=_0x59d3c3;_0x5ab5ff=0xc8;}else{_0x5ab5ff=0xce;}_0x53e69c[_0xfa47('0x19')](_0x5ab5ff);return _0x53e69c[_0xfa47('0x20')](_0xfa47('0x21'),_0x5e929f+'-'+_0x1cf95f+'/'+_0x59d3c3)[_0xfa47('0x1b')](_0x5318d0);}return null;};}function patchUpdates(_0x4e30ca){return function(_0x1dcde9){try{jsonpatch[_0xfa47('0x22')](_0x1dcde9,_0x4e30ca,!![]);}catch(_0x511896){return BPromise[_0xfa47('0x23')](_0x511896);}return _0x1dcde9[_0xfa47('0x24')]();};}function saveUpdates(_0x409295,_0x5b3965){return function(_0x26c638){if(_0x26c638){return _0x26c638[_0xfa47('0x25')](_0x409295)[_0xfa47('0x26')](function(_0x2f88c8){return _0x2f88c8;});}return null;};}function removeEntity(_0x6c669f,_0x484db4){return function(_0x2653d5){if(_0x2653d5){return _0x2653d5[_0xfa47('0x27')]()[_0xfa47('0x26')](function(){_0x6c669f[_0xfa47('0x19')](0xcc)[_0xfa47('0x1a')]();});}};}function handleEntityNotFound(_0x349665,_0x25d8ec){return function(_0x1a404f){if(!_0x1a404f){_0x349665['sendStatus'](0x194);}return _0x1a404f;};}function handleError(_0x41869b,_0x2d0447){_0x2d0447=_0x2d0447||0x1f4;return function(_0x4a820a){logger[_0xfa47('0x28')](_0x4a820a['stack']);if(_0x4a820a[_0xfa47('0x29')]){delete _0x4a820a['name'];}_0x41869b[_0xfa47('0x19')](_0x2d0447)[_0xfa47('0x2a')](_0x4a820a);};}exports['index']=function(_0x15456c,_0x528117){var _0xcea59b={},_0xbbb49f={},_0x5f1da6={'count':0x0,'rows':[]};var _0x14c7a2=_[_0xfa47('0x2b')](db[_0xfa47('0x2c')]['rawAttributes'],function(_0x37999d){return{'name':_0x37999d[_0xfa47('0x2d')],'type':_0x37999d[_0xfa47('0x2e')][_0xfa47('0x2f')]};});_0xbbb49f['model']=_[_0xfa47('0x2b')](_0x14c7a2,_0xfa47('0x29'));_0xbbb49f['query']=_[_0xfa47('0x30')](_0x15456c['query']);_0xbbb49f[_0xfa47('0x31')]=_['intersection'](_0xbbb49f[_0xfa47('0x32')],_0xbbb49f[_0xfa47('0x33')]);_0xcea59b[_0xfa47('0x34')]=_[_0xfa47('0x35')](_0xbbb49f[_0xfa47('0x32')],qs[_0xfa47('0x36')](_0x15456c['query']['fields']));_0xcea59b[_0xfa47('0x34')]=_0xcea59b['attributes'][_0xfa47('0x37')]?_0xcea59b[_0xfa47('0x34')]:_0xbbb49f[_0xfa47('0x32')];if(!_0x15456c[_0xfa47('0x33')][_0xfa47('0x38')]('nolimit')){_0xcea59b[_0xfa47('0x1e')]=qs[_0xfa47('0x1e')](_0x15456c[_0xfa47('0x33')][_0xfa47('0x1e')]);_0xcea59b[_0xfa47('0x1c')]=qs[_0xfa47('0x1c')](_0x15456c[_0xfa47('0x33')][_0xfa47('0x1c')]);}_0xcea59b['order']=qs[_0xfa47('0x39')](_0x15456c[_0xfa47('0x33')][_0xfa47('0x39')]);_0xcea59b[_0xfa47('0x3a')]=qs[_0xfa47('0x31')](_[_0xfa47('0x3b')](_0x15456c[_0xfa47('0x33')],_0xbbb49f[_0xfa47('0x31')]),_0x14c7a2);if(_0x15456c[_0xfa47('0x33')][_0xfa47('0x3c')]){_0xcea59b[_0xfa47('0x3a')]=_[_0xfa47('0x3d')](_0xcea59b[_0xfa47('0x3a')],{'$or':_[_0xfa47('0x2b')](_0x14c7a2,function(_0x1f8b1b){if(_0x1f8b1b[_0xfa47('0x2e')]!==_0xfa47('0x3e')){var _0x11fab2={};_0x11fab2[_0x1f8b1b['name']]={'$like':'%'+_0x15456c[_0xfa47('0x33')]['filter']+'%'};return _0x11fab2;}})});}_0xcea59b=_['merge']({},_0xcea59b,_0x15456c[_0xfa47('0x3f')]);var _0x518db0={'where':_0xcea59b[_0xfa47('0x3a')]};return db[_0xfa47('0x2c')][_0xfa47('0x1f')](_0x518db0)['then'](function(_0x543ab1){_0x5f1da6['count']=_0x543ab1;if(_0x15456c[_0xfa47('0x33')][_0xfa47('0x40')]){_0xcea59b[_0xfa47('0x41')]=[{'all':!![]}];}return db[_0xfa47('0x2c')][_0xfa47('0x42')](_0xcea59b);})[_0xfa47('0x26')](function(_0x54c85f){_0x5f1da6[_0xfa47('0x43')]=_0x54c85f;return _0x5f1da6;})[_0xfa47('0x26')](respondWithFilteredResult(_0x528117,_0xcea59b))[_0xfa47('0x44')](handleError(_0x528117,null));};exports[_0xfa47('0x45')]=function(_0x17f6c0,_0x1f49ae){var _0x570590={'raw':!![],'where':{'id':_0x17f6c0['params']['id']}},_0xe61574={};_0xe61574[_0xfa47('0x32')]=_[_0xfa47('0x30')](db['SquareReport'][_0xfa47('0x46')]);_0xe61574['query']=_['keys'](_0x17f6c0[_0xfa47('0x33')]);_0xe61574[_0xfa47('0x31')]=_[_0xfa47('0x35')](_0xe61574['model'],_0xe61574[_0xfa47('0x33')]);_0x570590['attributes']=_[_0xfa47('0x35')](_0xe61574[_0xfa47('0x32')],qs[_0xfa47('0x36')](_0x17f6c0[_0xfa47('0x33')][_0xfa47('0x36')]));_0x570590['attributes']=_0x570590[_0xfa47('0x34')][_0xfa47('0x37')]?_0x570590[_0xfa47('0x34')]:_0xe61574['model'];if(_0x17f6c0[_0xfa47('0x33')]['includeAll']){_0x570590['include']=[{'all':!![]}];}_0x570590=_[_0xfa47('0x3d')]({},_0x570590,_0x17f6c0[_0xfa47('0x3f')]);return db[_0xfa47('0x2c')][_0xfa47('0x47')](_0x570590)[_0xfa47('0x26')](handleEntityNotFound(_0x1f49ae,null))[_0xfa47('0x26')](respondWithResult(_0x1f49ae,null))[_0xfa47('0x44')](handleError(_0x1f49ae,null));};exports[_0xfa47('0x48')]=function(_0x567729,_0x433d8a){return db[_0xfa47('0x2c')][_0xfa47('0x48')](_0x567729[_0xfa47('0x49')],{})[_0xfa47('0x26')](respondWithResult(_0x433d8a,0xc9))[_0xfa47('0x44')](handleError(_0x433d8a,null));};exports['update']=function(_0x1e40b2,_0x6804c1){if(_0x1e40b2[_0xfa47('0x49')]['id']){delete _0x1e40b2[_0xfa47('0x49')]['id'];}return db[_0xfa47('0x2c')][_0xfa47('0x47')]({'where':{'id':_0x1e40b2['params']['id']}})[_0xfa47('0x26')](handleEntityNotFound(_0x6804c1,null))[_0xfa47('0x26')](saveUpdates(_0x1e40b2[_0xfa47('0x49')],null))[_0xfa47('0x26')](respondWithResult(_0x6804c1,null))[_0xfa47('0x44')](handleError(_0x6804c1,null));};exports[_0xfa47('0x27')]=function(_0x1340da,_0x2d7938){return db[_0xfa47('0x2c')][_0xfa47('0x47')]({'where':{'id':_0x1340da[_0xfa47('0x4a')]['id']}})[_0xfa47('0x26')](handleEntityNotFound(_0x2d7938,null))[_0xfa47('0x26')](removeEntity(_0x2d7938,null))[_0xfa47('0x44')](handleError(_0x2d7938,null));};exports[_0xfa47('0x4b')]=function(_0x1895cf,_0x4f09d9){return db[_0xfa47('0x2c')][_0xfa47('0x4b')]()[_0xfa47('0x26')](respondWithResult(_0x4f09d9,null))[_0xfa47('0x44')](handleError(_0x4f09d9,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 190eaed..dcaeb74 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 _0x4a65=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','SquareReport','uid_pname','project_name','leaveAt','lodash','util'];(function(_0x151d92,_0x3d500a){var _0x1cd3f7=function(_0x173029){while(--_0x173029){_0x151d92['push'](_0x151d92['shift']());}};_0x1cd3f7(++_0x3d500a);}(_0x4a65,0x15c));var _0x54a6=function(_0x25f663,_0x80a7a5){_0x25f663=_0x25f663-0x0;var _0x105f44=_0x4a65[_0x25f663];return _0x105f44;};'use strict';var _=require(_0x54a6('0x0'));var util=require(_0x54a6('0x1'));var logger=require('../../config/logger')(_0x54a6('0x2'));var moment=require(_0x54a6('0x3'));var BPromise=require(_0x54a6('0x4'));var rp=require(_0x54a6('0x5'));var fs=require('fs');var path=require(_0x54a6('0x6'));var rimraf=require(_0x54a6('0x7'));var config=require(_0x54a6('0x8'));var attributes=require(_0x54a6('0x9'));module['exports']=function(_0x312d91,_0x8166a8){return _0x312d91['define'](_0x54a6('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x54a6('0xb'),'fields':['uniqueid',_0x54a6('0xc')]},{'name':'leaveAt','fields':[_0x54a6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf06c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square','project_name','leaveAt'];(function(_0x57f6ad,_0x4795b6){var _0x425c09=function(_0xac3ba6){while(--_0xac3ba6){_0x57f6ad['push'](_0x57f6ad['shift']());}};_0x425c09(++_0x4795b6);}(_0xf06c,0xff));var _0xcf06=function(_0x130a42,_0x50c832){_0x130a42=_0x130a42-0x0;var _0x49801e=_0xf06c[_0x130a42];return _0x49801e;};'use strict';var _=require(_0xcf06('0x0'));var util=require(_0xcf06('0x1'));var logger=require(_0xcf06('0x2'))(_0xcf06('0x3'));var moment=require(_0xcf06('0x4'));var BPromise=require(_0xcf06('0x5'));var rp=require(_0xcf06('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf06('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf06('0x8'));module[_0xcf06('0x9')]=function(_0xfb7443,_0x30ed7a){return _0xfb7443[_0xcf06('0xa')](_0xcf06('0xb'),attributes,{'tableName':_0xcf06('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xcf06('0xd')]},{'name':'leaveAt','fields':[_0xcf06('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 0a8dcf6..4d0af40 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 _0x16ec=['UpdateSquareReport','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x16ec,0x17a));var _0xc16e=function(_0x3b0355,_0x48fccf){_0x3b0355=_0x3b0355-0x0;var _0x53d10e=_0x16ec[_0x3b0355];return _0x53d10e;};'use strict';var _=require(_0xc16e('0x0'));var util=require(_0xc16e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc16e('0x2'));var fs=require('fs');var Redis=require(_0xc16e('0x3'));var db=require(_0xc16e('0x4'))['db'];var utils=require(_0xc16e('0x5'));var logger=require(_0xc16e('0x6'))(_0xc16e('0x7'));var config=require(_0xc16e('0x8'));var jayson=require(_0xc16e('0x9'));var client=jayson[_0xc16e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42a9ea,_0x70612d,_0x1cb64a){return new BPromise(function(_0x19fa4e,_0x2ecce6){return client[_0xc16e('0xb')](_0x42a9ea,_0x1cb64a)[_0xc16e('0xc')](function(_0x1af574){logger[_0xc16e('0xd')](_0xc16e('0xe'),_0x70612d,'request\x20sent');logger[_0xc16e('0xf')](_0xc16e('0x10'),_0x70612d,_0xc16e('0x11'),JSON['stringify'](_0x1af574));if(_0x1af574[_0xc16e('0x12')]){if(_0x1af574['error'][_0xc16e('0x13')]===0x1f4){logger[_0xc16e('0x12')](_0xc16e('0xe'),_0x70612d,_0x1af574['error'][_0xc16e('0x14')]);return _0x2ecce6(_0x1af574['error'][_0xc16e('0x14')]);}logger['error'](_0xc16e('0xe'),_0x70612d,_0x1af574[_0xc16e('0x12')][_0xc16e('0x14')]);return _0x19fa4e(_0x1af574['error'][_0xc16e('0x14')]);}else{logger[_0xc16e('0xd')](_0xc16e('0xe'),_0x70612d,'request\x20sent');_0x19fa4e(_0x1af574[_0xc16e('0x15')][_0xc16e('0x14')]);}})[_0xc16e('0x16')](function(_0x1233ff){logger['error'](_0xc16e('0xe'),_0x70612d,_0x1233ff);_0x2ecce6(_0x1233ff);});});}exports[_0xc16e('0x17')]=function(_0x522c86){var _0x274546=this;return new Promise(function(_0x1fed58,_0x351756){return db[_0xc16e('0x18')][_0xc16e('0x19')](_0x522c86[_0xc16e('0x1a')],{'raw':_0x522c86[_0xc16e('0x1b')]?_0x522c86[_0xc16e('0x1b')][_0xc16e('0x1c')]===undefined?!![]:![]:!![]})[_0xc16e('0xc')](function(_0x30bc2a){logger[_0xc16e('0xd')](_0xc16e('0x17'),_0x522c86);logger[_0xc16e('0xf')](_0xc16e('0x17'),_0x522c86,JSON[_0xc16e('0x1d')](_0x30bc2a));_0x1fed58(_0x30bc2a);})[_0xc16e('0x16')](function(_0x347e4c){logger[_0xc16e('0x12')](_0xc16e('0x17'),_0x347e4c[_0xc16e('0x14')],_0x522c86);_0x351756(_0x274546[_0xc16e('0x12')](0x1f4,_0x347e4c['message']));});});};exports[_0xc16e('0x1e')]=function(_0x41d84f){var _0x181d45=this;return new Promise(function(_0x45d2a9,_0x155ff0){return db[_0xc16e('0x18')]['update'](_0x41d84f[_0xc16e('0x1a')],{'raw':_0x41d84f[_0xc16e('0x1b')]?_0x41d84f[_0xc16e('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41d84f['options']?_0x41d84f[_0xc16e('0x1b')][_0xc16e('0x1f')]||null:null,'attributes':_0x41d84f[_0xc16e('0x1b')]?_0x41d84f[_0xc16e('0x1b')][_0xc16e('0x20')]||null:null,'limit':_0x41d84f[_0xc16e('0x1b')]?_0x41d84f[_0xc16e('0x1b')][_0xc16e('0x21')]||null:null})[_0xc16e('0xc')](function(_0x1ca8de){logger[_0xc16e('0xd')]('UpdateSquareReport',_0x41d84f);logger[_0xc16e('0xf')](_0xc16e('0x1e'),_0x41d84f,JSON['stringify'](_0x1ca8de));_0x45d2a9(_0x1ca8de);})[_0xc16e('0x16')](function(_0x1dd5ad){logger[_0xc16e('0x12')](_0xc16e('0x1e'),_0x1dd5ad[_0xc16e('0x14')],_0x41d84f);_0x155ff0(_0x181d45[_0xc16e('0x12')](0x1f4,_0x1dd5ad[_0xc16e('0x14')]));});});}; \ No newline at end of file +var _0x7a0d=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','update','where','attributes','limit','UpdateSquareReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a0d,0xed));var _0xd7a0=function(_0x4f3e5a,_0x1ee150){_0x4f3e5a=_0x4f3e5a-0x0;var _0x452880=_0x7a0d[_0x4f3e5a];return _0x452880;};'use strict';var _=require(_0xd7a0('0x0'));var util=require('util');var moment=require(_0xd7a0('0x1'));var BPromise=require(_0xd7a0('0x2'));var rs=require(_0xd7a0('0x3'));var fs=require('fs');var Redis=require(_0xd7a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7a0('0x5'));var logger=require(_0xd7a0('0x6'))(_0xd7a0('0x7'));var config=require(_0xd7a0('0x8'));var jayson=require(_0xd7a0('0x9'));var client=jayson[_0xd7a0('0xa')][_0xd7a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a7c1f,_0x197786,_0x4fbad4){return new BPromise(function(_0xfed59a,_0x5effcb){return client[_0xd7a0('0xc')](_0x5a7c1f,_0x4fbad4)[_0xd7a0('0xd')](function(_0x177cd3){logger[_0xd7a0('0xe')](_0xd7a0('0xf'),_0x197786,_0xd7a0('0x10'));logger[_0xd7a0('0x11')](_0xd7a0('0x12'),_0x197786,'request\x20sent',JSON[_0xd7a0('0x13')](_0x177cd3));if(_0x177cd3[_0xd7a0('0x14')]){if(_0x177cd3[_0xd7a0('0x14')][_0xd7a0('0x15')]===0x1f4){logger[_0xd7a0('0x14')]('SquareReport,\x20%s,\x20%s',_0x197786,_0x177cd3[_0xd7a0('0x14')][_0xd7a0('0x16')]);return _0x5effcb(_0x177cd3['error'][_0xd7a0('0x16')]);}logger[_0xd7a0('0x14')]('SquareReport,\x20%s,\x20%s',_0x197786,_0x177cd3['error'][_0xd7a0('0x16')]);return _0xfed59a(_0x177cd3[_0xd7a0('0x14')][_0xd7a0('0x16')]);}else{logger[_0xd7a0('0xe')]('SquareReport,\x20%s,\x20%s',_0x197786,_0xd7a0('0x10'));_0xfed59a(_0x177cd3[_0xd7a0('0x17')][_0xd7a0('0x16')]);}})[_0xd7a0('0x18')](function(_0x43b78c){logger[_0xd7a0('0x14')]('SquareReport,\x20%s,\x20%s',_0x197786,_0x43b78c);_0x5effcb(_0x43b78c);});});}exports[_0xd7a0('0x19')]=function(_0x13f38a){var _0x2c5e4d=this;return new Promise(function(_0xf51e87,_0x33c2e4){return db[_0xd7a0('0x1a')][_0xd7a0('0x1b')](_0x13f38a[_0xd7a0('0x1c')],{'raw':_0x13f38a[_0xd7a0('0x1d')]?_0x13f38a[_0xd7a0('0x1d')][_0xd7a0('0x1e')]===undefined?!![]:![]:!![]})[_0xd7a0('0xd')](function(_0x3263cc){logger[_0xd7a0('0xe')](_0xd7a0('0x19'),_0x13f38a);logger[_0xd7a0('0x11')](_0xd7a0('0x19'),_0x13f38a,JSON[_0xd7a0('0x13')](_0x3263cc));_0xf51e87(_0x3263cc);})['catch'](function(_0x27257b){logger[_0xd7a0('0x14')](_0xd7a0('0x19'),_0x27257b[_0xd7a0('0x16')],_0x13f38a);_0x33c2e4(_0x2c5e4d[_0xd7a0('0x14')](0x1f4,_0x27257b[_0xd7a0('0x16')]));});});};exports['UpdateSquareReport']=function(_0x24b94e){var _0x2ab6be=this;return new Promise(function(_0x1aec6a,_0x4a73e2){return db['SquareReport'][_0xd7a0('0x1f')](_0x24b94e[_0xd7a0('0x1c')],{'raw':_0x24b94e[_0xd7a0('0x1d')]?_0x24b94e[_0xd7a0('0x1d')][_0xd7a0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24b94e[_0xd7a0('0x1d')]?_0x24b94e['options'][_0xd7a0('0x20')]||null:null,'attributes':_0x24b94e['options']?_0x24b94e[_0xd7a0('0x1d')][_0xd7a0('0x21')]||null:null,'limit':_0x24b94e['options']?_0x24b94e[_0xd7a0('0x1d')][_0xd7a0('0x22')]||null:null})[_0xd7a0('0xd')](function(_0x1c95de){logger['info'](_0xd7a0('0x23'),_0x24b94e);logger['debug'](_0xd7a0('0x23'),_0x24b94e,JSON[_0xd7a0('0x13')](_0x1c95de));_0x1aec6a(_0x1c95de);})[_0xd7a0('0x18')](function(_0x1c528d){logger[_0xd7a0('0x14')]('UpdateSquareReport',_0x1c528d[_0xd7a0('0x16')],_0x24b94e);_0x4a73e2(_0x2ab6be[_0xd7a0('0x14')](0x1f4,_0x1c528d[_0xd7a0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b538afe..952fb40 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 _0x30fb=['../../config/environment','./squareReportDetail.controller','get','index','isAuthenticated','show','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30fb,0x65));var _0xb30f=function(_0x3c8679,_0x2faea3){_0x3c8679=_0x3c8679-0x0;var _0x2791f8=_0x30fb[_0x3c8679];return _0x2791f8;};'use strict';var multer=require(_0xb30f('0x0'));var util=require(_0xb30f('0x1'));var path=require(_0xb30f('0x2'));var timeout=require(_0xb30f('0x3'));var express=require(_0xb30f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb30f('0x5'));var interaction=require(_0xb30f('0x6'));var config=require(_0xb30f('0x7'));var controller=require(_0xb30f('0x8'));router[_0xb30f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb30f('0xa')]);router[_0xb30f('0x9')]('/describe',auth[_0xb30f('0xb')](),controller['describe']);router[_0xb30f('0x9')]('/:id',auth[_0xb30f('0xb')](),controller[_0xb30f('0xc')]);router['post']('/',auth[_0xb30f('0xb')](),controller[_0xb30f('0xd')]);router[_0xb30f('0xe')](_0xb30f('0xf'),auth[_0xb30f('0xb')](),controller[_0xb30f('0x10')]);router['delete'](_0xb30f('0xf'),auth[_0xb30f('0xb')](),controller[_0xb30f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd7e8=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd7e8,0x154));var _0x8d7e=function(_0x196be3,_0x1df3ef){_0x196be3=_0x196be3-0x0;var _0x400a51=_0xd7e8[_0x196be3];return _0x400a51;};'use strict';var multer=require(_0x8d7e('0x0'));var util=require(_0x8d7e('0x1'));var path=require(_0x8d7e('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d7e('0x3'));var router=express[_0x8d7e('0x4')]();var fs_extra=require(_0x8d7e('0x5'));var auth=require(_0x8d7e('0x6'));var interaction=require(_0x8d7e('0x7'));var config=require('../../config/environment');var controller=require(_0x8d7e('0x8'));router[_0x8d7e('0x9')]('/',auth[_0x8d7e('0xa')](),controller[_0x8d7e('0xb')]);router[_0x8d7e('0x9')](_0x8d7e('0xc'),auth[_0x8d7e('0xa')](),controller[_0x8d7e('0xd')]);router[_0x8d7e('0x9')](_0x8d7e('0xe'),auth[_0x8d7e('0xa')](),controller[_0x8d7e('0xf')]);router[_0x8d7e('0x10')]('/',auth[_0x8d7e('0xa')](),controller[_0x8d7e('0x11')]);router['put'](_0x8d7e('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x8d7e('0x12')](_0x8d7e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x8d7e('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ad0ab22..fb29a3a 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 _0x8d29=['sequelize','exports','STRING','TEXT'];(function(_0x13c135,_0xe7393){var _0x456d59=function(_0x5056b7){while(--_0x5056b7){_0x13c135['push'](_0x13c135['shift']());}};_0x456d59(++_0xe7393);}(_0x8d29,0x130));var _0x98d2=function(_0x102215,_0x42ea07){_0x102215=_0x102215-0x0;var _0x37810a=_0x8d29[_0x102215];return _0x37810a;};'use strict';var Sequelize=require(_0x98d2('0x0'));module[_0x98d2('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x98d2('0x2')]},'application':{'type':Sequelize[_0x98d2('0x2')]},'data':{'type':Sequelize[_0x98d2('0x3')]},'project_name':{'type':Sequelize[_0x98d2('0x2')]},'callerid':{'type':Sequelize[_0x98d2('0x2')]}}; \ No newline at end of file +var _0x2ae8=['TEXT','sequelize','exports','STRING'];(function(_0xf5a8e4,_0x4b7e54){var _0x58ac23=function(_0x391b4c){while(--_0x391b4c){_0xf5a8e4['push'](_0xf5a8e4['shift']());}};_0x58ac23(++_0x4b7e54);}(_0x2ae8,0x101));var _0x82ae=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2ae8[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x82ae('0x0'));module[_0x82ae('0x1')]={'uniqueid':{'type':Sequelize[_0x82ae('0x2')]},'node':{'type':Sequelize[_0x82ae('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x82ae('0x3')]},'project_name':{'type':Sequelize[_0x82ae('0x2')]},'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 7f74de6..49800b5 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 _0x0de9=['options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','SquareDetailsReport','includeAll','include','findAll','then','show','params'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x0de9,0x13e));var _0x90de=function(_0x647584,_0x406759){_0x647584=_0x647584-0x0;var _0x1a33a8=_0x0de9[_0x647584];return _0x1a33a8;};'use strict';var emlformat=require(_0x90de('0x0'));var rimraf=require(_0x90de('0x1'));var zipdir=require(_0x90de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90de('0x3'));var moment=require(_0x90de('0x4'));var BPromise=require(_0x90de('0x5'));var Mustache=require('mustache');var util=require(_0x90de('0x6'));var path=require(_0x90de('0x7'));var sox=require(_0x90de('0x8'));var csv=require(_0x90de('0x9'));var ejs=require(_0x90de('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90de('0xb'));var squel=require(_0x90de('0xc'));var crypto=require(_0x90de('0xd'));var jsforce=require(_0x90de('0xe'));var deskjs=require(_0x90de('0xf'));var toCsv=require(_0x90de('0x9'));var querystring=require(_0x90de('0x10'));var Papa=require(_0x90de('0x11'));var Redis=require(_0x90de('0x12'));var authService=require(_0x90de('0x13'));var qs=require(_0x90de('0x14'));var as=require(_0x90de('0x15'));var hardwareService=require(_0x90de('0x16'));var logger=require('../../config/logger')(_0x90de('0x17'));var utils=require(_0x90de('0x18'));var config=require(_0x90de('0x19'));var licenseUtil=require(_0x90de('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x66e6a5,_0x37875c){_0x37875c=_0x37875c||0xcc;return function(_0x5b44e9){if(_0x5b44e9){return _0x66e6a5[_0x90de('0x1b')](_0x37875c);}return _0x66e6a5[_0x90de('0x1c')](_0x37875c)[_0x90de('0x1d')]();};}function respondWithResult(_0x57af15,_0x4f748b){_0x4f748b=_0x4f748b||0xc8;return function(_0x497ac9){if(_0x497ac9){return _0x57af15[_0x90de('0x1c')](_0x4f748b)[_0x90de('0x1e')](_0x497ac9);}};}function respondWithFilteredResult(_0x4f0dc5,_0x2760f0){return function(_0x1b1094){if(_0x1b1094){var _0x49d529=typeof _0x2760f0[_0x90de('0x1f')]==='undefined'&&typeof _0x2760f0[_0x90de('0x20')]===_0x90de('0x21');var _0x4e8430=_0x1b1094[_0x90de('0x22')];var _0x5bb85b=_0x49d529?0x0:_0x2760f0[_0x90de('0x1f')];var _0x50ed1a=_0x49d529?_0x1b1094['count']:_0x2760f0[_0x90de('0x1f')]+_0x2760f0[_0x90de('0x20')];var _0x4775f7;if(_0x50ed1a>=_0x4e8430){_0x50ed1a=_0x4e8430;_0x4775f7=0xc8;}else{_0x4775f7=0xce;}_0x4f0dc5['status'](_0x4775f7);return _0x4f0dc5['set']('Content-Range',_0x5bb85b+'-'+_0x50ed1a+'/'+_0x4e8430)[_0x90de('0x1e')](_0x1b1094);}return null;};}function patchUpdates(_0x4feb16){return function(_0x5b327a){try{jsonpatch[_0x90de('0x23')](_0x5b327a,_0x4feb16,!![]);}catch(_0x47d1bc){return BPromise[_0x90de('0x24')](_0x47d1bc);}return _0x5b327a['save']();};}function saveUpdates(_0x34a056,_0x374b98){return function(_0x3d5976){if(_0x3d5976){return _0x3d5976[_0x90de('0x25')](_0x34a056)['then'](function(_0x26ae55){return _0x26ae55;});}return null;};}function removeEntity(_0x5054c2,_0x38544a){return function(_0x42ce33){if(_0x42ce33){return _0x42ce33[_0x90de('0x26')]()['then'](function(){_0x5054c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x218446,_0x24b066){return function(_0x32d9d6){if(!_0x32d9d6){_0x218446[_0x90de('0x1b')](0x194);}return _0x32d9d6;};}function handleError(_0x19354b,_0x38d661){_0x38d661=_0x38d661||0x1f4;return function(_0x300d7a){logger[_0x90de('0x27')](_0x300d7a[_0x90de('0x28')]);if(_0x300d7a[_0x90de('0x29')]){delete _0x300d7a[_0x90de('0x29')];}_0x19354b[_0x90de('0x1c')](_0x38d661)[_0x90de('0x2a')](_0x300d7a);};}exports[_0x90de('0x2b')]=function(_0x1bcd88,_0x29ed3d){var _0xe2687e={},_0x546b30={},_0x32eca3={'count':0x0,'rows':[]};var _0x493d9d=_[_0x90de('0x2c')](db['SquareDetailsReport'][_0x90de('0x2d')],function(_0xf1b73){return{'name':_0xf1b73[_0x90de('0x2e')],'type':_0xf1b73[_0x90de('0x2f')][_0x90de('0x30')]};});_0x546b30['model']=_[_0x90de('0x2c')](_0x493d9d,_0x90de('0x29'));_0x546b30[_0x90de('0x31')]=_[_0x90de('0x32')](_0x1bcd88[_0x90de('0x31')]);_0x546b30[_0x90de('0x33')]=_[_0x90de('0x34')](_0x546b30['model'],_0x546b30[_0x90de('0x31')]);_0xe2687e[_0x90de('0x35')]=_[_0x90de('0x34')](_0x546b30[_0x90de('0x36')],qs[_0x90de('0x37')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x37')]));_0xe2687e[_0x90de('0x35')]=_0xe2687e[_0x90de('0x35')][_0x90de('0x38')]?_0xe2687e[_0x90de('0x35')]:_0x546b30[_0x90de('0x36')];if(!_0x1bcd88[_0x90de('0x31')][_0x90de('0x39')](_0x90de('0x3a'))){_0xe2687e[_0x90de('0x20')]=qs[_0x90de('0x20')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x20')]);_0xe2687e['offset']=qs[_0x90de('0x1f')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x1f')]);}_0xe2687e[_0x90de('0x3b')]=qs[_0x90de('0x3c')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x3c')]);_0xe2687e[_0x90de('0x3d')]=qs['filters'](_[_0x90de('0x3e')](_0x1bcd88[_0x90de('0x31')],_0x546b30[_0x90de('0x33')]),_0x493d9d);if(_0x1bcd88[_0x90de('0x31')]['filter']){_0xe2687e[_0x90de('0x3d')]=_[_0x90de('0x3f')](_0xe2687e[_0x90de('0x3d')],{'$or':_['map'](_0x493d9d,function(_0x4860b1){if(_0x4860b1[_0x90de('0x2f')]!=='VIRTUAL'){var _0x528487={};_0x528487[_0x4860b1[_0x90de('0x29')]]={'$like':'%'+_0x1bcd88[_0x90de('0x31')][_0x90de('0x40')]+'%'};return _0x528487;}})});}_0xe2687e=_[_0x90de('0x3f')]({},_0xe2687e,_0x1bcd88['options']);var _0x3eb960={'where':_0xe2687e[_0x90de('0x3d')]};return db[_0x90de('0x41')][_0x90de('0x22')](_0x3eb960)['then'](function(_0x284da9){_0x32eca3[_0x90de('0x22')]=_0x284da9;if(_0x1bcd88[_0x90de('0x31')][_0x90de('0x42')]){_0xe2687e[_0x90de('0x43')]=[{'all':!![]}];}return db[_0x90de('0x41')][_0x90de('0x44')](_0xe2687e);})['then'](function(_0x2f2369){_0x32eca3['rows']=_0x2f2369;return _0x32eca3;})[_0x90de('0x45')](respondWithFilteredResult(_0x29ed3d,_0xe2687e))['catch'](handleError(_0x29ed3d,null));};exports[_0x90de('0x46')]=function(_0x547729,_0x5558d6){var _0x458b1a={'raw':!![],'where':{'id':_0x547729[_0x90de('0x47')]['id']}},_0x16400e={};_0x16400e['model']=_['keys'](db[_0x90de('0x41')][_0x90de('0x2d')]);_0x16400e[_0x90de('0x31')]=_[_0x90de('0x32')](_0x547729[_0x90de('0x31')]);_0x16400e['filters']=_[_0x90de('0x34')](_0x16400e[_0x90de('0x36')],_0x16400e[_0x90de('0x31')]);_0x458b1a[_0x90de('0x35')]=_[_0x90de('0x34')](_0x16400e['model'],qs[_0x90de('0x37')](_0x547729['query'][_0x90de('0x37')]));_0x458b1a['attributes']=_0x458b1a[_0x90de('0x35')][_0x90de('0x38')]?_0x458b1a[_0x90de('0x35')]:_0x16400e['model'];if(_0x547729[_0x90de('0x31')][_0x90de('0x42')]){_0x458b1a[_0x90de('0x43')]=[{'all':!![]}];}_0x458b1a=_['merge']({},_0x458b1a,_0x547729[_0x90de('0x48')]);return db['SquareDetailsReport'][_0x90de('0x49')](_0x458b1a)[_0x90de('0x45')](handleEntityNotFound(_0x5558d6,null))[_0x90de('0x45')](respondWithResult(_0x5558d6,null))[_0x90de('0x4a')](handleError(_0x5558d6,null));};exports[_0x90de('0x4b')]=function(_0x49b88e,_0x5a004f){return db['SquareDetailsReport'][_0x90de('0x4b')](_0x49b88e[_0x90de('0x4c')],{})[_0x90de('0x45')](respondWithResult(_0x5a004f,0xc9))[_0x90de('0x4a')](handleError(_0x5a004f,null));};exports[_0x90de('0x25')]=function(_0x2ccce0,_0xaff0b3){if(_0x2ccce0[_0x90de('0x4c')]['id']){delete _0x2ccce0[_0x90de('0x4c')]['id'];}return db[_0x90de('0x41')]['find']({'where':{'id':_0x2ccce0[_0x90de('0x47')]['id']}})[_0x90de('0x45')](handleEntityNotFound(_0xaff0b3,null))['then'](saveUpdates(_0x2ccce0[_0x90de('0x4c')],null))[_0x90de('0x45')](respondWithResult(_0xaff0b3,null))[_0x90de('0x4a')](handleError(_0xaff0b3,null));};exports[_0x90de('0x26')]=function(_0x5ca674,_0x489454){return db['SquareDetailsReport'][_0x90de('0x49')]({'where':{'id':_0x5ca674[_0x90de('0x47')]['id']}})[_0x90de('0x45')](handleEntityNotFound(_0x489454,null))['then'](removeEntity(_0x489454,null))[_0x90de('0x4a')](handleError(_0x489454,null));};exports[_0x90de('0x4d')]=function(_0x537b58,_0x1b2838){return db[_0x90de('0x41')][_0x90de('0x4d')]()[_0x90de('0x45')](respondWithResult(_0x1b2838,null))['catch'](handleError(_0x1b2838,null));}; \ No newline at end of file +var _0x614f=['desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','end','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce'];(function(_0x5009a2,_0x528e60){var _0x26f74d=function(_0x2b1bf0){while(--_0x2b1bf0){_0x5009a2['push'](_0x5009a2['shift']());}};_0x26f74d(++_0x528e60);}(_0x614f,0x1c5));var _0xf614=function(_0xe769be,_0x5898cb){_0xe769be=_0xe769be-0x0;var _0x487ffc=_0x614f[_0xe769be];return _0x487ffc;};'use strict';var emlformat=require(_0xf614('0x0'));var rimraf=require(_0xf614('0x1'));var zipdir=require(_0xf614('0x2'));var jsonpatch=require(_0xf614('0x3'));var rp=require(_0xf614('0x4'));var moment=require(_0xf614('0x5'));var BPromise=require(_0xf614('0x6'));var Mustache=require(_0xf614('0x7'));var util=require(_0xf614('0x8'));var path=require(_0xf614('0x9'));var sox=require(_0xf614('0xa'));var csv=require('to-csv');var ejs=require(_0xf614('0xb'));var fs=require('fs');var fs_extra=require(_0xf614('0xc'));var _=require(_0xf614('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf614('0xe'));var deskjs=require(_0xf614('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf614('0x10'));var Papa=require(_0xf614('0x11'));var Redis=require(_0xf614('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf614('0x13'));var hardwareService=require(_0xf614('0x14'));var logger=require('../../config/logger')(_0xf614('0x15'));var utils=require(_0xf614('0x16'));var config=require(_0xf614('0x17'));var licenseUtil=require(_0xf614('0x18'));var db=require(_0xf614('0x19'))['db'];function respondWithStatusCode(_0x512286,_0x3969dc){_0x3969dc=_0x3969dc||0xcc;return function(_0x50e054){if(_0x50e054){return _0x512286[_0xf614('0x1a')](_0x3969dc);}return _0x512286['status'](_0x3969dc)['end']();};}function respondWithResult(_0xeccf5f,_0x41bd29){_0x41bd29=_0x41bd29||0xc8;return function(_0x16a789){if(_0x16a789){return _0xeccf5f[_0xf614('0x1b')](_0x41bd29)['json'](_0x16a789);}};}function respondWithFilteredResult(_0x2a3283,_0x5d9550){return function(_0x53149f){if(_0x53149f){var _0x25a863=typeof _0x5d9550[_0xf614('0x1c')]===_0xf614('0x1d')&&typeof _0x5d9550[_0xf614('0x1e')]==='undefined';var _0x16a5be=_0x53149f[_0xf614('0x1f')];var _0x285e9a=_0x25a863?0x0:_0x5d9550[_0xf614('0x1c')];var _0x46f116=_0x25a863?_0x53149f['count']:_0x5d9550[_0xf614('0x1c')]+_0x5d9550['limit'];var _0x50267b;if(_0x46f116>=_0x16a5be){_0x46f116=_0x16a5be;_0x50267b=0xc8;}else{_0x50267b=0xce;}_0x2a3283[_0xf614('0x1b')](_0x50267b);return _0x2a3283[_0xf614('0x20')](_0xf614('0x21'),_0x285e9a+'-'+_0x46f116+'/'+_0x16a5be)['json'](_0x53149f);}return null;};}function patchUpdates(_0x13323e){return function(_0x15df74){try{jsonpatch[_0xf614('0x22')](_0x15df74,_0x13323e,!![]);}catch(_0x5ab06c){return BPromise['reject'](_0x5ab06c);}return _0x15df74['save']();};}function saveUpdates(_0x3a8037,_0x16403d){return function(_0x38810e){if(_0x38810e){return _0x38810e[_0xf614('0x23')](_0x3a8037)['then'](function(_0x4e7e14){return _0x4e7e14;});}return null;};}function removeEntity(_0x2b3f23,_0x298d5b){return function(_0x3cbf98){if(_0x3cbf98){return _0x3cbf98[_0xf614('0x24')]()[_0xf614('0x25')](function(){_0x2b3f23[_0xf614('0x1b')](0xcc)[_0xf614('0x26')]();});}};}function handleEntityNotFound(_0x470b01,_0x4ad250){return function(_0x4147c9){if(!_0x4147c9){_0x470b01[_0xf614('0x1a')](0x194);}return _0x4147c9;};}function handleError(_0x15f0bb,_0x9b48fb){_0x9b48fb=_0x9b48fb||0x1f4;return function(_0x16b609){logger[_0xf614('0x27')](_0x16b609[_0xf614('0x28')]);if(_0x16b609[_0xf614('0x29')]){delete _0x16b609[_0xf614('0x29')];}_0x15f0bb[_0xf614('0x1b')](_0x9b48fb)[_0xf614('0x2a')](_0x16b609);};}exports[_0xf614('0x2b')]=function(_0x246edd,_0x4bbbbd){var _0x14825c={},_0x436663={},_0x3d3c2b={'count':0x0,'rows':[]};var _0x918e57=_[_0xf614('0x2c')](db[_0xf614('0x2d')][_0xf614('0x2e')],function(_0x16e825){return{'name':_0x16e825[_0xf614('0x2f')],'type':_0x16e825['type'][_0xf614('0x30')]};});_0x436663[_0xf614('0x31')]=_[_0xf614('0x2c')](_0x918e57,_0xf614('0x29'));_0x436663[_0xf614('0x32')]=_[_0xf614('0x33')](_0x246edd[_0xf614('0x32')]);_0x436663[_0xf614('0x34')]=_['intersection'](_0x436663[_0xf614('0x31')],_0x436663[_0xf614('0x32')]);_0x14825c[_0xf614('0x35')]=_[_0xf614('0x36')](_0x436663[_0xf614('0x31')],qs[_0xf614('0x37')](_0x246edd[_0xf614('0x32')]['fields']));_0x14825c[_0xf614('0x35')]=_0x14825c[_0xf614('0x35')][_0xf614('0x38')]?_0x14825c[_0xf614('0x35')]:_0x436663[_0xf614('0x31')];if(!_0x246edd['query'][_0xf614('0x39')](_0xf614('0x3a'))){_0x14825c[_0xf614('0x1e')]=qs[_0xf614('0x1e')](_0x246edd[_0xf614('0x32')][_0xf614('0x1e')]);_0x14825c['offset']=qs[_0xf614('0x1c')](_0x246edd[_0xf614('0x32')][_0xf614('0x1c')]);}_0x14825c[_0xf614('0x3b')]=qs[_0xf614('0x3c')](_0x246edd[_0xf614('0x32')]['sort']);_0x14825c[_0xf614('0x3d')]=qs[_0xf614('0x34')](_['pick'](_0x246edd['query'],_0x436663[_0xf614('0x34')]),_0x918e57);if(_0x246edd[_0xf614('0x32')][_0xf614('0x3e')]){_0x14825c['where']=_[_0xf614('0x3f')](_0x14825c[_0xf614('0x3d')],{'$or':_[_0xf614('0x2c')](_0x918e57,function(_0x3a54b5){if(_0x3a54b5[_0xf614('0x40')]!==_0xf614('0x41')){var _0x201c16={};_0x201c16[_0x3a54b5[_0xf614('0x29')]]={'$like':'%'+_0x246edd['query'][_0xf614('0x3e')]+'%'};return _0x201c16;}})});}_0x14825c=_[_0xf614('0x3f')]({},_0x14825c,_0x246edd[_0xf614('0x42')]);var _0x372e36={'where':_0x14825c[_0xf614('0x3d')]};return db[_0xf614('0x2d')][_0xf614('0x1f')](_0x372e36)[_0xf614('0x25')](function(_0x389b5c){_0x3d3c2b[_0xf614('0x1f')]=_0x389b5c;if(_0x246edd[_0xf614('0x32')]['includeAll']){_0x14825c[_0xf614('0x43')]=[{'all':!![]}];}return db[_0xf614('0x2d')][_0xf614('0x44')](_0x14825c);})[_0xf614('0x25')](function(_0x1f4bc2){_0x3d3c2b[_0xf614('0x45')]=_0x1f4bc2;return _0x3d3c2b;})['then'](respondWithFilteredResult(_0x4bbbbd,_0x14825c))[_0xf614('0x46')](handleError(_0x4bbbbd,null));};exports[_0xf614('0x47')]=function(_0x5bb85f,_0x3da3fe){var _0x3947c2={'raw':!![],'where':{'id':_0x5bb85f['params']['id']}},_0x36cea3={};_0x36cea3['model']=_[_0xf614('0x33')](db['SquareDetailsReport'][_0xf614('0x2e')]);_0x36cea3[_0xf614('0x32')]=_[_0xf614('0x33')](_0x5bb85f['query']);_0x36cea3[_0xf614('0x34')]=_[_0xf614('0x36')](_0x36cea3[_0xf614('0x31')],_0x36cea3[_0xf614('0x32')]);_0x3947c2[_0xf614('0x35')]=_['intersection'](_0x36cea3[_0xf614('0x31')],qs[_0xf614('0x37')](_0x5bb85f[_0xf614('0x32')][_0xf614('0x37')]));_0x3947c2[_0xf614('0x35')]=_0x3947c2[_0xf614('0x35')][_0xf614('0x38')]?_0x3947c2[_0xf614('0x35')]:_0x36cea3['model'];if(_0x5bb85f[_0xf614('0x32')][_0xf614('0x48')]){_0x3947c2['include']=[{'all':!![]}];}_0x3947c2=_[_0xf614('0x3f')]({},_0x3947c2,_0x5bb85f[_0xf614('0x42')]);return db[_0xf614('0x2d')][_0xf614('0x49')](_0x3947c2)[_0xf614('0x25')](handleEntityNotFound(_0x3da3fe,null))[_0xf614('0x25')](respondWithResult(_0x3da3fe,null))[_0xf614('0x46')](handleError(_0x3da3fe,null));};exports[_0xf614('0x4a')]=function(_0x548b86,_0x74ce18){return db[_0xf614('0x2d')]['create'](_0x548b86['body'],{})['then'](respondWithResult(_0x74ce18,0xc9))[_0xf614('0x46')](handleError(_0x74ce18,null));};exports['update']=function(_0x2447ce,_0x2e8bf3){if(_0x2447ce[_0xf614('0x4b')]['id']){delete _0x2447ce[_0xf614('0x4b')]['id'];}return db[_0xf614('0x2d')][_0xf614('0x49')]({'where':{'id':_0x2447ce[_0xf614('0x4c')]['id']}})[_0xf614('0x25')](handleEntityNotFound(_0x2e8bf3,null))[_0xf614('0x25')](saveUpdates(_0x2447ce[_0xf614('0x4b')],null))[_0xf614('0x25')](respondWithResult(_0x2e8bf3,null))[_0xf614('0x46')](handleError(_0x2e8bf3,null));};exports[_0xf614('0x24')]=function(_0x51bcfb,_0x230474){return db[_0xf614('0x2d')]['find']({'where':{'id':_0x51bcfb[_0xf614('0x4c')]['id']}})[_0xf614('0x25')](handleEntityNotFound(_0x230474,null))[_0xf614('0x25')](removeEntity(_0x230474,null))[_0xf614('0x46')](handleError(_0x230474,null));};exports[_0xf614('0x4d')]=function(_0xd90f2e,_0x26f807){return db[_0xf614('0x2d')][_0xf614('0x4d')]()[_0xf614('0x25')](respondWithResult(_0x26f807,null))[_0xf614('0x46')](handleError(_0x26f807,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index e523804..c36be37 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 _0xf43a=['../../config/logger','moment','bluebird','path','rimraf','exports','SquareDetailsReport','report_square_details','lodash'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0xf43a,0xa1));var _0xaf43=function(_0x2d36b0,_0x3c3282){_0x2d36b0=_0x2d36b0-0x0;var _0x132b95=_0xf43a[_0x2d36b0];return _0x132b95;};'use strict';var _=require(_0xaf43('0x0'));var util=require('util');var logger=require(_0xaf43('0x1'))('api');var moment=require(_0xaf43('0x2'));var BPromise=require(_0xaf43('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf43('0x4'));var rimraf=require(_0xaf43('0x5'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xaf43('0x6')]=function(_0x2219b5,_0x2592c3){return _0x2219b5['define'](_0xaf43('0x7'),attributes,{'tableName':_0xaf43('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93f3=['SquareDetailsReport','report_square_details','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x93f3,0x112));var _0x393f=function(_0x3b036c,_0x1e7390){_0x3b036c=_0x3b036c-0x0;var _0x28369a=_0x93f3[_0x3b036c];return _0x28369a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x393f('0x0'));var rp=require(_0x393f('0x1'));var fs=require('fs');var path=require(_0x393f('0x2'));var rimraf=require(_0x393f('0x3'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x393f('0x4')]=function(_0x3ce4d3,_0x4a94b6){return _0x3ce4d3[_0x393f('0x5')](_0x393f('0x6'),attributes,{'tableName':_0x393f('0x7'),'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 f967a21..6bd95bc 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 _0x34b7=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0xbf1875,_0x34b144){var _0x2e598b=function(_0xd104ec){while(--_0xd104ec){_0xbf1875['push'](_0xbf1875['shift']());}};_0x2e598b(++_0x34b144);}(_0x34b7,0x196));var _0x734b=function(_0x1a2581,_0x44dab6){_0x1a2581=_0x1a2581-0x0;var _0x21ef3e=_0x34b7[_0x1a2581];return _0x21ef3e;};'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')]('SquareDetailsReport,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')](_0x5edbe9[_0x734b('0x18')],{'raw':_0x5edbe9[_0x734b('0x19')]?_0x5edbe9[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![]})[_0x734b('0x1b')](function(_0x67eed){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x67eed));_0x56a95c(_0x67eed);})['catch'](function(_0x1e4dcc){logger[_0x734b('0xf')]('CreateSquareDetailsReport',_0x1e4dcc[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1e4dcc[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0x5eb8=['CreateSquareDetailsReport','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','catch','SquareDetailsReport','create','body','options','raw','then'];(function(_0x16eeb7,_0x57dc34){var _0x1d6c43=function(_0x32f507){while(--_0x32f507){_0x16eeb7['push'](_0x16eeb7['shift']());}};_0x1d6c43(++_0x57dc34);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x5eb8[_0x4f4c2a];return _0xd15be6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateSquareDetailsReport']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateSquareDetailsReport',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3e067ec..3862378 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 _0x7b22=['/process/:pid/kill','killProcess','exports','./system.controller','isAuthenticated','get'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x7b22,0x93));var _0x27b2=function(_0xca1091,_0x539dbf){_0xca1091=_0xca1091-0x0;var _0xd3019c=_0x7b22[_0xca1091];return _0xd3019c;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x27b2('0x0'));router['get']('/',auth[_0x27b2('0x1')](),controller['index']);router[_0x27b2('0x2')](_0x27b2('0x3'),auth[_0x27b2('0x1')](),controller[_0x27b2('0x4')]);module[_0x27b2('0x5')]=router; \ No newline at end of file +var _0xd314=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess','exports','express'];(function(_0x53fed7,_0x3873be){var _0x29714f=function(_0xd248b0){while(--_0xd248b0){_0x53fed7['push'](_0x53fed7['shift']());}};_0x29714f(++_0x3873be);}(_0xd314,0x13a));var _0x4d31=function(_0xc36879,_0x33e511){_0xc36879=_0xc36879-0x0;var _0x4daeaa=_0xd314[_0xc36879];return _0x4daeaa;};'use strict';var express=require(_0x4d31('0x0'));var router=express[_0x4d31('0x1')]();var auth=require(_0x4d31('0x2'));var controller=require(_0x4d31('0x3'));router[_0x4d31('0x4')]('/',auth[_0x4d31('0x5')](),controller[_0x4d31('0x6')]);router[_0x4d31('0x4')]('/process/:pid/kill',auth[_0x4d31('0x5')](),controller[_0x4d31('0x7')]);module[_0x4d31('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a0bfe44..6974e6a 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 _0x554b=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','index','getAllData','then','status','json','killProcess'];(function(_0x527ebf,_0x3bb310){var _0x5bb3a1=function(_0x49482e){while(--_0x49482e){_0x527ebf['push'](_0x527ebf['shift']());}};_0x5bb3a1(++_0x3bb310);}(_0x554b,0x72));var _0xb554=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x554b[_0x48999d];return _0x1ad0d1;};'use strict';var info=require(_0xb554('0x0'));var exec=require(_0xb554('0x1'))[_0xb554('0x2')];var logger=require('../../config/logger')(_0xb554('0x3'));var util=require('util');var BPromise=require(_0xb554('0x4'));var _=require(_0xb554('0x5'));function handleError(_0x35b2dd,_0x8190c0,_0x450be8){_0x8190c0=_0x8190c0||0x1f4;return function(_0x57153c){logger[_0xb554('0x6')](_0xb554('0x7'),_0x450be8,_0x8190c0,util['inspect'](_0x57153c,{'showHidden':![],'depth':null}));delete _0x57153c[_0xb554('0x8')];_0x35b2dd['status'](_0x8190c0)[_0xb554('0x9')](_0x57153c);};}exports[_0xb554('0xa')]=function(_0x20986a,_0x575ed5){return info[_0xb554('0xb')]()[_0xb554('0xc')](function(_0x307d28){return _0x575ed5[_0xb554('0xd')](0xc8)['json'](_0x307d28);})['catch'](function(_0x172144){return _0x575ed5[_0xb554('0xd')](0x1f4)[_0xb554('0xe')](_0x172144);});};exports[_0xb554('0xf')]=function(_0x31c6ce,_0x2ab9ca){var _0xd44fc2=['components/import/cm'];return new BPromise(function(_0x58fa99,_0x40378a){return exec(util[_0xb554('0x10')](_0xb554('0x11'),_0x31c6ce['params'][_0xb554('0x12')]),function(_0x505ee9,_0x3acbc7,_0x4c4779){if(_0x505ee9){return _0x40378a(_0x505ee9);}return _0x58fa99(_0x3acbc7);});})[_0xb554('0xc')](function(_0x294f7c){var _0x326f69=![];var _0x920dd3=_0x294f7c['split'](/\n/);for(var _0x437d89=0x0,_0x453022=_0xd44fc2[_0xb554('0x13')];_0x437d89<_0x453022,_0x326f69===![];_0x437d89+=0x1){if(_0x294f7c['indexOf'](_0xd44fc2[_0x437d89])>=0x0){_0x326f69=!![];}}if(!_0x326f69){throw new Error(util[_0xb554('0x10')](_0xb554('0x14'),_0x31c6ce[_0xb554('0x15')][_0xb554('0x12')]));}process[_0xb554('0x16')](_0x31c6ce['params']['pid'],_0xb554('0x17'));return _0x2ab9ca[_0xb554('0xd')](0xc8)[_0xb554('0xe')]({'message':util[_0xb554('0x10')](_0xb554('0x18'),_0x31c6ce['params']['pid'])});})[_0xb554('0x19')](handleError(_0x2ab9ca,null,_0xb554('0xf')));}; \ No newline at end of file +var _0x80ef=['kill','SIGINT','killProcess','systeminformation','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','getAllData','then','catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x80ef,0xd3));var _0xf80e=function(_0x1eb3a9,_0x1bc3d2){_0x1eb3a9=_0x1eb3a9-0x0;var _0x588a71=_0x80ef[_0x1eb3a9];return _0x588a71;};'use strict';var info=require(_0xf80e('0x0'));var exec=require('child_process')[_0xf80e('0x1')];var logger=require(_0xf80e('0x2'))(_0xf80e('0x3'));var util=require('util');var BPromise=require(_0xf80e('0x4'));var _=require(_0xf80e('0x5'));function handleError(_0x30ac81,_0x2b730b,_0x3fef2a){_0x2b730b=_0x2b730b||0x1f4;return function(_0x345fb9){logger[_0xf80e('0x6')](_0xf80e('0x7'),_0x3fef2a,_0x2b730b,util['inspect'](_0x345fb9,{'showHidden':![],'depth':null}));delete _0x345fb9['name'];_0x30ac81[_0xf80e('0x8')](_0x2b730b)[_0xf80e('0x9')](_0x345fb9);};}exports[_0xf80e('0xa')]=function(_0x354b3f,_0x19ecb2){return info[_0xf80e('0xb')]()[_0xf80e('0xc')](function(_0x2f7ffc){return _0x19ecb2['status'](0xc8)['json'](_0x2f7ffc);})[_0xf80e('0xd')](function(_0x4a3b9b){return _0x19ecb2[_0xf80e('0x8')](0x1f4)[_0xf80e('0xe')](_0x4a3b9b);});};exports['killProcess']=function(_0x4539c4,_0x2be415){var _0x3cc649=[_0xf80e('0xf')];return new BPromise(function(_0x1169c8,_0x185227){return exec(util[_0xf80e('0x10')](_0xf80e('0x11'),_0x4539c4[_0xf80e('0x12')][_0xf80e('0x13')]),function(_0x1fdb40,_0x1dc80b,_0xc89b7c){if(_0x1fdb40){return _0x185227(_0x1fdb40);}return _0x1169c8(_0x1dc80b);});})['then'](function(_0x811c3f){var _0x3db540=![];var _0x144700=_0x811c3f[_0xf80e('0x14')](/\n/);for(var _0x1510c4=0x0,_0x17157c=_0x3cc649[_0xf80e('0x15')];_0x1510c4<_0x17157c,_0x3db540===![];_0x1510c4+=0x1){if(_0x811c3f[_0xf80e('0x16')](_0x3cc649[_0x1510c4])>=0x0){_0x3db540=!![];}}if(!_0x3db540){throw new Error(util[_0xf80e('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x4539c4[_0xf80e('0x12')][_0xf80e('0x13')]));}process[_0xf80e('0x17')](_0x4539c4[_0xf80e('0x12')][_0xf80e('0x13')],_0xf80e('0x18'));return _0x2be415[_0xf80e('0x8')](0xc8)['json']({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x4539c4[_0xf80e('0x12')][_0xf80e('0x13')])});})[_0xf80e('0xd')](handleError(_0x2be415,null,_0xf80e('0x19')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 110a9b3..322b101 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 _0x1675=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x3abf9a,_0x3d71df){var _0x1de11b=function(_0x593c77){while(--_0x593c77){_0x3abf9a['push'](_0x3abf9a['shift']());}};_0x1de11b(++_0x3d71df);}(_0x1675,0x1a4));var _0x5167=function(_0x59291b,_0x5e7125){_0x59291b=_0x59291b-0x0;var _0x3ff71e=_0x1675[_0x59291b];return _0x3ff71e;};'use strict';var multer=require(_0x5167('0x0'));var util=require(_0x5167('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5167('0x2')]();var fs_extra=require(_0x5167('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5167('0x4'));var config=require(_0x5167('0x5'));var controller=require('./tag.controller');router[_0x5167('0x6')]('/',auth[_0x5167('0x7')](),controller[_0x5167('0x8')]);router['get'](_0x5167('0x9'),auth[_0x5167('0x7')](),controller[_0x5167('0xa')]);router[_0x5167('0xb')]('/',auth[_0x5167('0x7')](),controller[_0x5167('0xc')]);router[_0x5167('0xd')](_0x5167('0x9'),auth[_0x5167('0x7')](),controller[_0x5167('0xe')]);router[_0x5167('0xf')](_0x5167('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x5167('0x10')]=router; \ No newline at end of file +var _0xdbcd=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','delete','destroy'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0xdbcd,0x67));var _0xddbc=function(_0x4a884c,_0x150644){_0x4a884c=_0x4a884c-0x0;var _0x17ba1c=_0xdbcd[_0x4a884c];return _0x17ba1c;};'use strict';var multer=require('multer');var util=require(_0xddbc('0x0'));var path=require(_0xddbc('0x1'));var timeout=require(_0xddbc('0x2'));var express=require('express');var router=express[_0xddbc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xddbc('0x4'));var interaction=require(_0xddbc('0x5'));var config=require(_0xddbc('0x6'));var controller=require(_0xddbc('0x7'));router[_0xddbc('0x8')]('/',auth[_0xddbc('0x9')](),controller['index']);router[_0xddbc('0x8')](_0xddbc('0xa'),auth['isAuthenticated'](),controller[_0xddbc('0xb')]);router[_0xddbc('0xc')]('/',auth[_0xddbc('0x9')](),controller[_0xddbc('0xd')]);router['put']('/:id',auth[_0xddbc('0x9')](),controller['update']);router[_0xddbc('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xddbc('0xf')]);module[_0xddbc('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 592eb39..734ae6f 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 _0xc686=['STRING'];(function(_0x314328,_0x235c73){var _0x5001de=function(_0x3daab3){while(--_0x3daab3){_0x314328['push'](_0x314328['shift']());}};_0x5001de(++_0x235c73);}(_0xc686,0x148));var _0x6c68=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xc686[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6c68('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6c68('0x0')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x6c68('0x0')]}}; \ No newline at end of file +var _0xb9a7=['exports','#0091EA'];(function(_0x36aa9b,_0x3cc441){var _0x2d4825=function(_0x2b3d10){while(--_0x2b3d10){_0x36aa9b['push'](_0x36aa9b['shift']());}};_0x2d4825(++_0x3cc441);}(_0xb9a7,0x112));var _0x7b9a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xb9a7[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x7b9a('0x1')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 2996d39..8d0c0cc 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 _0xadb8=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Tags','UserProfileResource','end','sendStatus','error','stack','name','send','Tag','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','params','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x2ffccf,_0x50010b){var _0x246666=function(_0x39f658){while(--_0x39f658){_0x2ffccf['push'](_0x2ffccf['shift']());}};_0x246666(++_0x50010b);}(_0xadb8,0x1d0));var _0x8adb=function(_0x332a78,_0x4d38b3){_0x332a78=_0x332a78-0x0;var _0x537ac5=_0xadb8[_0x332a78];return _0x537ac5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8adb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8adb('0x1'));var moment=require(_0x8adb('0x2'));var BPromise=require(_0x8adb('0x3'));var Mustache=require(_0x8adb('0x4'));var util=require(_0x8adb('0x5'));var path=require(_0x8adb('0x6'));var sox=require(_0x8adb('0x7'));var csv=require('to-csv');var ejs=require(_0x8adb('0x8'));var fs=require('fs');var fs_extra=require(_0x8adb('0x9'));var _=require(_0x8adb('0xa'));var squel=require(_0x8adb('0xb'));var crypto=require(_0x8adb('0xc'));var jsforce=require(_0x8adb('0xd'));var deskjs=require(_0x8adb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8adb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8adb('0x10'));var logger=require(_0x8adb('0x11'))(_0x8adb('0x12'));var utils=require(_0x8adb('0x13'));var config=require(_0x8adb('0x14'));var licenseUtil=require(_0x8adb('0x15'));var db=require(_0x8adb('0x16'))['db'];function respondWithStatusCode(_0x2828f1,_0x2d6b55){_0x2d6b55=_0x2d6b55||0xcc;return function(_0x8c6c39){if(_0x8c6c39){return _0x2828f1['sendStatus'](_0x2d6b55);}return _0x2828f1['status'](_0x2d6b55)['end']();};}function respondWithResult(_0x122b37,_0x4ff3c3){_0x4ff3c3=_0x4ff3c3||0xc8;return function(_0xe9280c){if(_0xe9280c){return _0x122b37[_0x8adb('0x17')](_0x4ff3c3)[_0x8adb('0x18')](_0xe9280c);}};}function respondWithFilteredResult(_0x52e1d9,_0x20add0){return function(_0x117054){if(_0x117054){var _0x1096fb=typeof _0x20add0[_0x8adb('0x19')]===_0x8adb('0x1a')&&typeof _0x20add0[_0x8adb('0x1b')]==='undefined';var _0xc01052=_0x117054[_0x8adb('0x1c')];var _0x4ba298=_0x1096fb?0x0:_0x20add0['offset'];var _0x18897e=_0x1096fb?_0x117054[_0x8adb('0x1c')]:_0x20add0[_0x8adb('0x19')]+_0x20add0[_0x8adb('0x1b')];var _0x46bce0;if(_0x18897e>=_0xc01052){_0x18897e=_0xc01052;_0x46bce0=0xc8;}else{_0x46bce0=0xce;}_0x52e1d9[_0x8adb('0x17')](_0x46bce0);return _0x52e1d9[_0x8adb('0x1d')](_0x8adb('0x1e'),_0x4ba298+'-'+_0x18897e+'/'+_0xc01052)[_0x8adb('0x18')](_0x117054);}return null;};}function patchUpdates(_0x2a322d){return function(_0x36c62a){try{jsonpatch[_0x8adb('0x1f')](_0x36c62a,_0x2a322d,!![]);}catch(_0x4a1a84){return BPromise['reject'](_0x4a1a84);}return _0x36c62a[_0x8adb('0x20')]();};}function saveUpdates(_0x3d37db,_0x4f33e7){return function(_0x37b0a4){if(_0x37b0a4){return _0x37b0a4[_0x8adb('0x21')](_0x3d37db)[_0x8adb('0x22')](function(_0x184c2a){return _0x184c2a;});}return null;};}function removeEntity(_0x11c2e8,_0x28d5cd){return function(_0x542156){if(_0x542156){return _0x542156[_0x8adb('0x23')]()[_0x8adb('0x22')](function(){var _0x234ef2=_0x542156['get']({'plain':!![]});var _0x5c8c18=_0x8adb('0x24');return db[_0x8adb('0x25')][_0x8adb('0x23')]({'where':{'type':_0x5c8c18,'resourceId':_0x234ef2['id']}})[_0x8adb('0x22')](function(){return _0x542156;});})[_0x8adb('0x22')](function(){_0x11c2e8['status'](0xcc)[_0x8adb('0x26')]();});}};}function handleEntityNotFound(_0x16f724,_0x18f94e){return function(_0x44f242){if(!_0x44f242){_0x16f724[_0x8adb('0x27')](0x194);}return _0x44f242;};}function handleError(_0x4aca77,_0x3faee9){_0x3faee9=_0x3faee9||0x1f4;return function(_0x5c5a7b){logger[_0x8adb('0x28')](_0x5c5a7b[_0x8adb('0x29')]);if(_0x5c5a7b[_0x8adb('0x2a')]){delete _0x5c5a7b[_0x8adb('0x2a')];}_0x4aca77['status'](_0x3faee9)[_0x8adb('0x2b')](_0x5c5a7b);};}exports['index']=function(_0x2c582b,_0x1ac23e){var _0x12f552={},_0x13a887={},_0x56f8a4={'count':0x0,'rows':[]};var _0x279cd8=_['map'](db[_0x8adb('0x2c')]['rawAttributes'],function(_0x1d4962){return{'name':_0x1d4962[_0x8adb('0x2d')],'type':_0x1d4962[_0x8adb('0x2e')][_0x8adb('0x2f')]};});_0x13a887[_0x8adb('0x30')]=_[_0x8adb('0x31')](_0x279cd8,'name');_0x13a887['query']=_[_0x8adb('0x32')](_0x2c582b[_0x8adb('0x33')]);_0x13a887[_0x8adb('0x34')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],_0x13a887[_0x8adb('0x33')]);_0x12f552[_0x8adb('0x36')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x37')]));_0x12f552[_0x8adb('0x36')]=_0x12f552['attributes'][_0x8adb('0x38')]?_0x12f552[_0x8adb('0x36')]:_0x13a887['model'];if(!_0x2c582b[_0x8adb('0x33')]['hasOwnProperty'](_0x8adb('0x39'))){_0x12f552[_0x8adb('0x1b')]=qs[_0x8adb('0x1b')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x1b')]);_0x12f552['offset']=qs[_0x8adb('0x19')](_0x2c582b['query'][_0x8adb('0x19')]);}_0x12f552[_0x8adb('0x3a')]=qs['sort'](_0x2c582b[_0x8adb('0x33')]['sort']);_0x12f552[_0x8adb('0x3b')]=qs['filters'](_[_0x8adb('0x3c')](_0x2c582b[_0x8adb('0x33')],_0x13a887[_0x8adb('0x34')]),_0x279cd8);if(_0x2c582b['query']['filter']){_0x12f552[_0x8adb('0x3b')]=_[_0x8adb('0x3d')](_0x12f552['where'],{'$or':_[_0x8adb('0x31')](_0x279cd8,function(_0x13589b){if(_0x13589b[_0x8adb('0x2e')]!==_0x8adb('0x3e')){var _0x922b58={};_0x922b58[_0x13589b[_0x8adb('0x2a')]]={'$like':'%'+_0x2c582b[_0x8adb('0x33')][_0x8adb('0x3f')]+'%'};return _0x922b58;}})});}_0x12f552=_['merge']({},_0x12f552,_0x2c582b['options']);var _0x3f69b3={'where':_0x12f552[_0x8adb('0x3b')]};return db[_0x8adb('0x2c')][_0x8adb('0x1c')](_0x3f69b3)['then'](function(_0x29d16d){_0x56f8a4['count']=_0x29d16d;if(_0x2c582b[_0x8adb('0x33')][_0x8adb('0x40')]){_0x12f552[_0x8adb('0x41')]=[{'all':!![]}];}return db[_0x8adb('0x2c')]['findAll'](_0x12f552);})['then'](function(_0x213c23){_0x56f8a4['rows']=_0x213c23;return _0x56f8a4;})[_0x8adb('0x22')](respondWithFilteredResult(_0x1ac23e,_0x12f552))['catch'](handleError(_0x1ac23e,null));};exports['show']=function(_0x18984a,_0x24feeb){var _0x5061d9={'raw':!![],'where':{'id':_0x18984a[_0x8adb('0x42')]['id']}},_0x3fb9e0={};_0x3fb9e0[_0x8adb('0x30')]=_[_0x8adb('0x32')](db[_0x8adb('0x2c')]['rawAttributes']);_0x3fb9e0[_0x8adb('0x33')]=_['keys'](_0x18984a[_0x8adb('0x33')]);_0x3fb9e0[_0x8adb('0x34')]=_['intersection'](_0x3fb9e0['model'],_0x3fb9e0[_0x8adb('0x33')]);_0x5061d9['attributes']=_[_0x8adb('0x35')](_0x3fb9e0[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x18984a[_0x8adb('0x33')]['fields']));_0x5061d9[_0x8adb('0x36')]=_0x5061d9[_0x8adb('0x36')]['length']?_0x5061d9['attributes']:_0x3fb9e0[_0x8adb('0x30')];if(_0x18984a[_0x8adb('0x33')][_0x8adb('0x40')]){_0x5061d9['include']=[{'all':!![]}];}_0x5061d9=_[_0x8adb('0x3d')]({},_0x5061d9,_0x18984a[_0x8adb('0x43')]);return db[_0x8adb('0x2c')][_0x8adb('0x44')](_0x5061d9)[_0x8adb('0x22')](handleEntityNotFound(_0x24feeb,null))[_0x8adb('0x22')](respondWithResult(_0x24feeb,null))[_0x8adb('0x45')](handleError(_0x24feeb,null));};exports[_0x8adb('0x46')]=function(_0xc2861b,_0xe725e9){return db[_0x8adb('0x2c')][_0x8adb('0x46')](_0xc2861b['body'],{})[_0x8adb('0x22')](function(_0x33c28c){var _0x35ef9d=_0xc2861b[_0x8adb('0x47')][_0x8adb('0x48')]({'plain':!![]});if(!_0x35ef9d)throw new Error(_0x8adb('0x49'));if(_0x35ef9d[_0x8adb('0x4a')]===_0x8adb('0x47')){var _0x276af8=_0x33c28c[_0x8adb('0x48')]({'plain':!![]});var _0x52daa7=_0x8adb('0x24');return db[_0x8adb('0x4b')][_0x8adb('0x44')]({'where':{'name':_0x52daa7,'userProfileId':_0x35ef9d[_0x8adb('0x4c')]},'raw':!![]})[_0x8adb('0x22')](function(_0x12b242){if(_0x12b242&&_0x12b242[_0x8adb('0x4d')]===0x0){return db[_0x8adb('0x25')]['create']({'name':_0x276af8[_0x8adb('0x2a')],'resourceId':_0x276af8['id'],'type':_0x12b242[_0x8adb('0x2a')],'sectionId':_0x12b242['id']},{})[_0x8adb('0x22')](function(){return _0x33c28c;});}else{return _0x33c28c;}})[_0x8adb('0x45')](function(_0x4bba0e){logger[_0x8adb('0x28')](_0x8adb('0x4e'),_0x4bba0e);throw _0x4bba0e;});}return _0x33c28c;})[_0x8adb('0x22')](respondWithResult(_0xe725e9,0xc9))[_0x8adb('0x45')](handleError(_0xe725e9,null));};exports['update']=function(_0x415dc0,_0x34eb4d){if(_0x415dc0[_0x8adb('0x4f')]['id']){delete _0x415dc0[_0x8adb('0x4f')]['id'];}return db[_0x8adb('0x2c')][_0x8adb('0x44')]({'where':{'id':_0x415dc0[_0x8adb('0x42')]['id']}})[_0x8adb('0x22')](handleEntityNotFound(_0x34eb4d,null))[_0x8adb('0x22')](saveUpdates(_0x415dc0[_0x8adb('0x4f')],null))[_0x8adb('0x22')](respondWithResult(_0x34eb4d,null))[_0x8adb('0x45')](handleError(_0x34eb4d,null));};exports['destroy']=function(_0x4329b0,_0x492a60){return db['Tag'][_0x8adb('0x44')]({'where':{'id':_0x4329b0[_0x8adb('0x42')]['id']}})['then'](handleEntityNotFound(_0x492a60,null))[_0x8adb('0x22')](removeEntity(_0x492a60,null))[_0x8adb('0x45')](handleError(_0x492a60,null));}; \ No newline at end of file +var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','destroy','error','stack','name','send','index','map','Tag','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0xc88ec5,_0x1a52fe){var _0x229d5e=function(_0x58d101){while(--_0x58d101){_0xc88ec5['push'](_0xc88ec5['shift']());}};_0x229d5e(++_0x1a52fe);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2ab31c,_0x586896){_0x2ab31c=_0x2ab31c-0x0;var _0x2d86e6=_0xe5b3[_0x2ab31c];return _0x2d86e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['Tag'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['Tag'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['Tag'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ec55961..bfc0b31 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 _0x8d84=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','tools_tags','lodash','util','../../config/logger','api'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x8d84,0x64));var _0x48d8=function(_0x18a896,_0x37f73c){_0x18a896=_0x18a896-0x0;var _0x70f96c=_0x8d84[_0x18a896];return _0x70f96c;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var logger=require(_0x48d8('0x2'))(_0x48d8('0x3'));var moment=require(_0x48d8('0x4'));var BPromise=require(_0x48d8('0x5'));var rp=require(_0x48d8('0x6'));var fs=require('fs');var path=require(_0x48d8('0x7'));var rimraf=require(_0x48d8('0x8'));var config=require(_0x48d8('0x9'));var attributes=require(_0x48d8('0xa'));module[_0x48d8('0xb')]=function(_0x46cd76,_0x248654){return _0x46cd76['define']('Tag',attributes,{'tableName':_0x48d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75fd=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash'];(function(_0x10bf2a,_0x242442){var _0x1a6127=function(_0x48a7c9){while(--_0x48a7c9){_0x10bf2a['push'](_0x10bf2a['shift']());}};_0x1a6127(++_0x242442);}(_0x75fd,0x197));var _0xd75f=function(_0x4befbc,_0x4b4ff9){_0x4befbc=_0x4befbc-0x0;var _0x58bdad=_0x75fd[_0x4befbc];return _0x58bdad;};'use strict';var _=require(_0xd75f('0x0'));var util=require('util');var logger=require(_0xd75f('0x1'))(_0xd75f('0x2'));var moment=require('moment');var BPromise=require(_0xd75f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd75f('0x4'));var rimraf=require(_0xd75f('0x5'));var config=require(_0xd75f('0x6'));var attributes=require(_0xd75f('0x7'));module[_0xd75f('0x8')]=function(_0x16776b,_0x5b96b0){return _0x16776b[_0xd75f('0x9')](_0xd75f('0xa'),attributes,{'tableName':_0xd75f('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 d249bae..9486617 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 _0xc368=['client','request','then','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1a5e30,_0x49a2bd){var _0x4343ca=function(_0x2f523c){while(--_0x2f523c){_0x1a5e30['push'](_0x1a5e30['shift']());}};_0x4343ca(++_0x49a2bd);}(_0xc368,0x7b));var _0x8c36=function(_0x1e2fdb,_0x1cc2e3){_0x1e2fdb=_0x1e2fdb-0x0;var _0x1d3bee=_0xc368[_0x1e2fdb];return _0x1d3bee;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var moment=require('moment');var BPromise=require(_0x8c36('0x1'));var rs=require(_0x8c36('0x2'));var fs=require('fs');var Redis=require(_0x8c36('0x3'));var db=require(_0x8c36('0x4'))['db'];var utils=require(_0x8c36('0x5'));var logger=require('../../config/logger')(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var jayson=require(_0x8c36('0x8'));var client=jayson[_0x8c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554022,_0x8ed437,_0x384867){return new BPromise(function(_0x3e76be,_0x26bad1){return client[_0x8c36('0xa')](_0x554022,_0x384867)[_0x8c36('0xb')](function(_0x569f29){logger['info']('Tag,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});} \ No newline at end of file +var _0xb205=['../../config/environment','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xb205,0xf0));var _0x5b20=function(_0x2b1ebf,_0x3bd1ad){_0x2b1ebf=_0x2b1ebf-0x0;var _0x5e3742=_0xb205[_0x2b1ebf];return _0x5e3742;};'use strict';var _=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var moment=require(_0x5b20('0x2'));var BPromise=require(_0x5b20('0x3'));var rs=require(_0x5b20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b20('0x5'));var logger=require('../../config/logger')(_0x5b20('0x6'));var config=require(_0x5b20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b20('0x8')][_0x5b20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x364e48,_0x5c1ff9,_0x32b467){return new BPromise(function(_0x13fb27,_0x528c54){return client['request'](_0x364e48,_0x32b467)[_0x5b20('0xa')](function(_0xb77426){logger[_0x5b20('0xb')](_0x5b20('0xc'),_0x5c1ff9,_0x5b20('0xd'));logger[_0x5b20('0xe')](_0x5b20('0xf'),_0x5c1ff9,'request\x20sent',JSON[_0x5b20('0x10')](_0xb77426));if(_0xb77426[_0x5b20('0x11')]){if(_0xb77426[_0x5b20('0x11')]['code']===0x1f4){logger['error'](_0x5b20('0xc'),_0x5c1ff9,_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);return _0x528c54(_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);}logger['error'](_0x5b20('0xc'),_0x5c1ff9,_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);return _0x13fb27(_0xb77426[_0x5b20('0x11')]['message']);}else{logger['info'](_0x5b20('0xc'),_0x5c1ff9,'request\x20sent');_0x13fb27(_0xb77426['result'][_0x5b20('0x12')]);}})['catch'](function(_0x43b7b0){logger[_0x5b20('0x11')](_0x5b20('0xc'),_0x5c1ff9,_0x43b7b0);_0x528c54(_0x43b7b0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e78de5f..fedde7f 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 52503c2..125a133 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 _0xd8b0=['exports','sequelize'];(function(_0x3da71f,_0x47875d){var _0x4b1bda=function(_0x5cf99b){while(--_0x5cf99b){_0x3da71f['push'](_0x3da71f['shift']());}};_0x4b1bda(++_0x47875d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0xcd001d,_0x4529e0){var _0x4a79a1=function(_0x1702da){while(--_0x1702da){_0xcd001d['push'](_0xcd001d['shift']());}};_0x4a79a1(++_0x4529e0);}(_0x757a,0xde));var _0xa757=function(_0x2d4c63,_0x434522){_0x2d4c63=_0x2d4c63-0x0;var _0x46dad3=_0x757a[_0x2d4c63];return _0x46dad3;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 26d5fa0..bbf3a11 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 _0xc829=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','Team','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','Teams','getQueues','findOne','channel','ValidationError','toLowerCase','rawAttributes','Queues','addQueues','Unknown\x20channel','add','capitalize','ids','removeQueues','isValidChannel','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','UserVoicePrefix','Openchannel','Whatsapp','removeAgents','getAgents','nolimit','eml-format','zip-dir'];(function(_0x339d45,_0x5b91d4){var _0x5e4a60=function(_0x4de526){while(--_0x4de526){_0x339d45['push'](_0x339d45['shift']());}};_0x5e4a60(++_0x5b91d4);}(_0xc829,0x9f));var _0x9c82=function(_0x697425,_0x142de8){_0x697425=_0x697425-0x0;var _0xf49eef=_0xc829[_0x697425];return _0xf49eef;};'use strict';var emlformat=require(_0x9c82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c82('0x1'));var jsonpatch=require(_0x9c82('0x2'));var rp=require(_0x9c82('0x3'));var moment=require('moment');var BPromise=require(_0x9c82('0x4'));var Mustache=require(_0x9c82('0x5'));var util=require(_0x9c82('0x6'));var path=require(_0x9c82('0x7'));var sox=require(_0x9c82('0x8'));var csv=require(_0x9c82('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c82('0xa'));var _=require(_0x9c82('0xb'));var squel=require(_0x9c82('0xc'));var crypto=require(_0x9c82('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9c82('0xe'));var toCsv=require(_0x9c82('0x9'));var querystring=require(_0x9c82('0xf'));var Papa=require(_0x9c82('0x10'));var Redis=require(_0x9c82('0x11'));var authService=require(_0x9c82('0x12'));var qs=require(_0x9c82('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c82('0x14'));var logger=require(_0x9c82('0x15'))(_0x9c82('0x16'));var utils=require(_0x9c82('0x17'));var config=require(_0x9c82('0x18'));var licenseUtil=require(_0x9c82('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9c82('0x1a')](config[_0x9c82('0x1b')],{'host':_0x9c82('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c82('0x1b')]));require(_0x9c82('0x1d'))[_0x9c82('0x1e')](socket);function respondWithStatusCode(_0x283cac,_0x2c564c){_0x2c564c=_0x2c564c||0xcc;return function(_0x17c5fa){if(_0x17c5fa){return _0x283cac[_0x9c82('0x1f')](_0x2c564c);}return _0x283cac[_0x9c82('0x20')](_0x2c564c)[_0x9c82('0x21')]();};}function respondWithResult(_0x956c73,_0x2ba863){_0x2ba863=_0x2ba863||0xc8;return function(_0x5a44e2){if(_0x5a44e2){return _0x956c73[_0x9c82('0x20')](_0x2ba863)['json'](_0x5a44e2);}};}function respondWithFilteredResult(_0x3ee97e,_0x2fb0ee){return function(_0x258a36){if(_0x258a36){var _0x313a95=typeof _0x2fb0ee[_0x9c82('0x22')]===_0x9c82('0x23')&&typeof _0x2fb0ee[_0x9c82('0x24')]===_0x9c82('0x23');var _0x3e4d4f=_0x258a36[_0x9c82('0x25')];var _0x58ed68=_0x313a95?0x0:_0x2fb0ee['offset'];var _0x2ef1ed=_0x313a95?_0x258a36[_0x9c82('0x25')]:_0x2fb0ee[_0x9c82('0x22')]+_0x2fb0ee['limit'];var _0xb934f4;if(_0x2ef1ed>=_0x3e4d4f){_0x2ef1ed=_0x3e4d4f;_0xb934f4=0xc8;}else{_0xb934f4=0xce;}_0x3ee97e[_0x9c82('0x20')](_0xb934f4);return _0x3ee97e[_0x9c82('0x26')](_0x9c82('0x27'),_0x58ed68+'-'+_0x2ef1ed+'/'+_0x3e4d4f)[_0x9c82('0x28')](_0x258a36);}return null;};}function patchUpdates(_0x3c6d15){return function(_0x5ae914){try{jsonpatch[_0x9c82('0x29')](_0x5ae914,_0x3c6d15,!![]);}catch(_0x48bedb){return BPromise[_0x9c82('0x2a')](_0x48bedb);}return _0x5ae914[_0x9c82('0x2b')]();};}function saveUpdates(_0x420bc8,_0x22f0f9){return function(_0x23c1b7){if(_0x23c1b7){return _0x23c1b7['update'](_0x420bc8)[_0x9c82('0x2c')](function(_0x2f9af0){return _0x2f9af0;});}return null;};}function handleEntityNotFound(_0x572ba7,_0x3c8981){return function(_0x4a05f5){if(!_0x4a05f5){_0x572ba7['sendStatus'](0x194);}return _0x4a05f5;};}function handleError(_0x1b7b93,_0x4ff06b){_0x4ff06b=_0x4ff06b||0x1f4;return function(_0x3f626a){logger[_0x9c82('0x2d')](_0x3f626a[_0x9c82('0x2e')]);if(_0x3f626a['name']){delete _0x3f626a[_0x9c82('0x2f')];}_0x1b7b93[_0x9c82('0x20')](_0x4ff06b)[_0x9c82('0x30')](_0x3f626a);};}exports[_0x9c82('0x31')]=function(_0x2f166a,_0xacb740){var _0x5878b1={},_0x1fe27e={},_0x43f9a0={'count':0x0,'rows':[]};var _0x43109d=_[_0x9c82('0x32')](db[_0x9c82('0x33')]['rawAttributes'],function(_0x39e3ac){return{'name':_0x39e3ac[_0x9c82('0x34')],'type':_0x39e3ac['type'][_0x9c82('0x35')]};});_0x1fe27e[_0x9c82('0x36')]=_[_0x9c82('0x32')](_0x43109d,'name');_0x1fe27e[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x2f166a[_0x9c82('0x37')]);_0x1fe27e['filters']=_[_0x9c82('0x39')](_0x1fe27e['model'],_0x1fe27e['query']);_0x5878b1[_0x9c82('0x3a')]=_['intersection'](_0x1fe27e['model'],qs[_0x9c82('0x3b')](_0x2f166a[_0x9c82('0x37')][_0x9c82('0x3b')]));_0x5878b1[_0x9c82('0x3a')]=_0x5878b1[_0x9c82('0x3a')][_0x9c82('0x3c')]?_0x5878b1[_0x9c82('0x3a')]:_0x1fe27e[_0x9c82('0x36')];if(!_0x2f166a[_0x9c82('0x37')][_0x9c82('0x3d')]('nolimit')){_0x5878b1[_0x9c82('0x24')]=qs[_0x9c82('0x24')](_0x2f166a[_0x9c82('0x37')]['limit']);_0x5878b1[_0x9c82('0x22')]=qs[_0x9c82('0x22')](_0x2f166a[_0x9c82('0x37')][_0x9c82('0x22')]);}_0x5878b1[_0x9c82('0x3e')]=qs[_0x9c82('0x3f')](_0x2f166a[_0x9c82('0x37')][_0x9c82('0x3f')]);_0x5878b1[_0x9c82('0x40')]=qs[_0x9c82('0x41')](_[_0x9c82('0x42')](_0x2f166a[_0x9c82('0x37')],_0x1fe27e[_0x9c82('0x41')]),_0x43109d);if(_0x2f166a[_0x9c82('0x37')][_0x9c82('0x43')]){_0x5878b1[_0x9c82('0x40')]=_[_0x9c82('0x44')](_0x5878b1['where'],{'$or':_[_0x9c82('0x32')](_0x43109d,function(_0x371048){if(_0x371048['type']!==_0x9c82('0x45')){var _0x17b3f6={};_0x17b3f6[_0x371048['name']]={'$like':'%'+_0x2f166a['query'][_0x9c82('0x43')]+'%'};return _0x17b3f6;}})});}_0x5878b1=_[_0x9c82('0x44')]({},_0x5878b1,_0x2f166a[_0x9c82('0x46')]);var _0xb85d38={'where':_0x5878b1[_0x9c82('0x40')]};return db[_0x9c82('0x33')][_0x9c82('0x25')](_0xb85d38)['then'](function(_0x65d9fb){_0x43f9a0[_0x9c82('0x25')]=_0x65d9fb;if(_0x2f166a[_0x9c82('0x37')]['includeAll']){_0x5878b1[_0x9c82('0x47')]=[{'all':!![]}];}return db[_0x9c82('0x33')]['findAll'](_0x5878b1);})['then'](function(_0x13d65b){_0x43f9a0[_0x9c82('0x48')]=_0x13d65b;return _0x43f9a0;})['then'](respondWithFilteredResult(_0xacb740,_0x5878b1))['catch'](handleError(_0xacb740,null));};exports[_0x9c82('0x49')]=function(_0x300dfc,_0x2693ac){var _0x5a079a={'raw':![],'where':{'id':_0x300dfc[_0x9c82('0x4a')]['id']}},_0x5ee7da={};_0x5ee7da[_0x9c82('0x36')]=_['keys'](db[_0x9c82('0x33')]['rawAttributes']);_0x5ee7da[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x300dfc[_0x9c82('0x37')]);_0x5ee7da[_0x9c82('0x41')]=_[_0x9c82('0x39')](_0x5ee7da[_0x9c82('0x36')],_0x5ee7da[_0x9c82('0x37')]);_0x5a079a[_0x9c82('0x3a')]=_['intersection'](_0x5ee7da['model'],qs['fields'](_0x300dfc[_0x9c82('0x37')][_0x9c82('0x3b')]));_0x5a079a[_0x9c82('0x3a')]=_0x5a079a[_0x9c82('0x3a')]['length']?_0x5a079a[_0x9c82('0x3a')]:_0x5ee7da[_0x9c82('0x36')];if(_0x300dfc[_0x9c82('0x37')][_0x9c82('0x4b')]){_0x5a079a[_0x9c82('0x47')]=[{'all':!![]}];}_0x5a079a=_[_0x9c82('0x44')]({},_0x5a079a,_0x300dfc[_0x9c82('0x46')]);return db[_0x9c82('0x33')][_0x9c82('0x4c')](_0x5a079a)['then'](handleEntityNotFound(_0x2693ac,null))[_0x9c82('0x2c')](respondWithResult(_0x2693ac,null))[_0x9c82('0x4d')](handleError(_0x2693ac,null));};exports[_0x9c82('0x4e')]=function(_0x1d2b2c,_0x36f0e0){return db[_0x9c82('0x33')][_0x9c82('0x4e')](_0x1d2b2c['body'],{})['then'](function(_0x2b450d){var _0x317af8=_0x1d2b2c['user'][_0x9c82('0x4f')]({'plain':!![]});if(!_0x317af8)throw new Error(_0x9c82('0x50'));if(_0x317af8[_0x9c82('0x51')]===_0x9c82('0x52')){var _0x1cea47=_0x2b450d[_0x9c82('0x4f')]({'plain':!![]});var _0xe5e448='Teams';return db[_0x9c82('0x53')]['find']({'where':{'name':_0xe5e448,'userProfileId':_0x317af8[_0x9c82('0x54')]},'raw':!![]})[_0x9c82('0x2c')](function(_0x5f5a28){if(_0x5f5a28&&_0x5f5a28['autoAssociation']===0x0){return db['UserProfileResource'][_0x9c82('0x4e')]({'name':_0x1cea47['name'],'resourceId':_0x1cea47['id'],'type':_0x5f5a28[_0x9c82('0x2f')],'sectionId':_0x5f5a28['id']},{})[_0x9c82('0x2c')](function(){return _0x2b450d;});}else{return _0x2b450d;}})[_0x9c82('0x4d')](function(_0x50c315){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50c315);throw _0x50c315;});}return _0x2b450d;})[_0x9c82('0x2c')](respondWithResult(_0x36f0e0,0xc9))[_0x9c82('0x4d')](handleError(_0x36f0e0,null));};exports['update']=function(_0x266e15,_0x1e78c2){if(_0x266e15[_0x9c82('0x55')]['id']){delete _0x266e15[_0x9c82('0x55')]['id'];}return db[_0x9c82('0x33')][_0x9c82('0x4c')]({'where':{'id':_0x266e15[_0x9c82('0x4a')]['id']}})[_0x9c82('0x2c')](handleEntityNotFound(_0x1e78c2,null))[_0x9c82('0x2c')](saveUpdates(_0x266e15[_0x9c82('0x55')],null))[_0x9c82('0x2c')](respondWithResult(_0x1e78c2,null))[_0x9c82('0x4d')](handleError(_0x1e78c2,null));};exports[_0x9c82('0x56')]=function(_0x459789,_0x2a3fd9){var _0x1529af=_0x459789[_0x9c82('0x4a')]['id'];var _0x1346e0=[];return db[_0x9c82('0x57')][_0x9c82('0x58')](function(_0x21ab73){var _0x52808e=_0x9c82('0x59')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x52808e,{'type':db[_0x9c82('0x5a')]['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73})[_0x9c82('0x2c')](function(_0xf313b8){_0x1346e0=_[_0x9c82('0x32')](_0xf313b8,function(_0x5769f9){return Number(_0x5769f9[_0x9c82('0x5c')]);});})[_0x9c82('0x2c')](function(){var _0x5a24fc=_0x9c82('0x5d')+_0x1529af;return db['sequelize']['query'](_0x5a24fc,{'type':db[_0x9c82('0x5a')][_0x9c82('0x5e')][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x568c1b){var _0x163161=_[_0x9c82('0x32')](_0x568c1b,function(_0x5b0aee){return Number(_0x5b0aee['VoiceQueueId']);});return db[_0x9c82('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x1346e0},'VoiceQueueId':{'$in':_0x163161}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x53be16=_0x9c82('0x60')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x53be16,{'type':db[_0x9c82('0x5a')][_0x9c82('0x5e')][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0xf4d2f){var _0x42355e=_[_0x9c82('0x32')](_0xf4d2f,function(_0x4897b2){return Number(_0x4897b2['MailQueueId']);});return db[_0x9c82('0x61')][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'MailQueueId':{'$in':_0x42355e}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x92832e=_0x9c82('0x62')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x92832e,{'type':db[_0x9c82('0x5a')]['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})['then'](function(_0x24304d){var _0x2b577b=_[_0x9c82('0x32')](_0x24304d,function(_0x45a0c4){return Number(_0x45a0c4[_0x9c82('0x63')]);});return db['UserSmsQueue'][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'SmsQueueId':{'$in':_0x2b577b}},'transaction':_0x21ab73});})['then'](function(){var _0x36dddc=_0x9c82('0x64')+_0x1529af;return db[_0x9c82('0x57')]['query'](_0x36dddc,{'type':db[_0x9c82('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x46a52c){var _0x7fca6d=_['map'](_0x46a52c,function(_0x49fc68){return Number(_0x49fc68[_0x9c82('0x65')]);});return db[_0x9c82('0x66')][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'ChatQueueId':{'$in':_0x7fca6d}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x2e7bbc=_0x9c82('0x67')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x2e7bbc,{'type':db['Sequelize'][_0x9c82('0x5e')]['SELECT'],'raw':!![],'transaction':_0x21ab73});})['then'](function(_0x219b68){var _0x3305bb=_[_0x9c82('0x32')](_0x219b68,function(_0xbef456){return Number(_0xbef456[_0x9c82('0x68')]);});return db[_0x9c82('0x69')]['destroy']({'where':{'UserId':{'$in':_0x1346e0},'FaxQueueId':{'$in':_0x3305bb}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x633ed2=_0x9c82('0x6a')+_0x1529af;return db[_0x9c82('0x57')]['query'](_0x633ed2,{'type':db['Sequelize']['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x1efee7){var _0x3e673a=_[_0x9c82('0x32')](_0x1efee7,function(_0x526231){return Number(_0x526231[_0x9c82('0x6b')]);});return db[_0x9c82('0x6c')][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'OpenchannelQueueId':{'$in':_0x3e673a}},'transaction':_0x21ab73});})['then'](function(){var _0x3362f3=_0x9c82('0x6d')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x3362f3,{'type':db[_0x9c82('0x5a')]['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x4daad8){var _0x5d5c07=_[_0x9c82('0x32')](_0x4daad8,function(_0x32710b){return Number(_0x32710b[_0x9c82('0x6e')]);});return db[_0x9c82('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x1346e0},'WhatsappQueueId':{'$in':_0x5d5c07}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){return db[_0x9c82('0x70')]['find']({'where':{'TeamId':_0x1529af}});})[_0x9c82('0x2c')](function(_0x5d8a3d){if(_0x5d8a3d===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x1346e0},'VoicePrefixId':_0x5d8a3d[_0x9c82('0x71')]},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){return db['Team'][_0x9c82('0x56')]({'where':{'id':_0x1529af},'cascade':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x49ce5b){if(_0x49ce5b===0x0){_0x2a3fd9[_0x9c82('0x1f')](0x194);}else{return db[_0x9c82('0x72')][_0x9c82('0x56')]({'where':{'type':_0x9c82('0x73'),'resourceId':_0x1529af},'cascade':!![],'transaction':_0x21ab73})['then'](function(){_0x2a3fd9[_0x9c82('0x20')](0xcc)['end']();});}})[_0x9c82('0x4d')](function(_0x154bd5){_0x2a3fd9[_0x9c82('0x20')](0x1f4)[_0x9c82('0x30')](_0x154bd5);});});};exports[_0x9c82('0x74')]=function(_0x41fd99,_0x20e5ae,_0x43916d){return db[_0x9c82('0x33')][_0x9c82('0x75')]({'where':{'id':_0x41fd99[_0x9c82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20e5ae,null))[_0x9c82('0x2c')](function(_0x56f340){if(!_0x41fd99[_0x9c82('0x37')][_0x9c82('0x76')]||!utils['isValidChannel'](_0x41fd99[_0x9c82('0x37')][_0x9c82('0x76')])){throw new db[(_0x9c82('0x5a'))][(_0x9c82('0x77'))]('Unknown\x20channel');}var _0x19eb9e={};var _0x2d5f2a={};_0x2d5f2a[_0x9c82('0x36')]=_[_0x9c82('0x38')](db[_['capitalize'](_0x41fd99[_0x9c82('0x37')]['channel'][_0x9c82('0x78')]())+'Queue'][_0x9c82('0x79')]);_0x2d5f2a[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x41fd99['query']);_0x2d5f2a[_0x9c82('0x41')]=_[_0x9c82('0x39')](_0x2d5f2a[_0x9c82('0x36')],_0x2d5f2a[_0x9c82('0x37')]);_0x19eb9e[_0x9c82('0x3a')]=_[_0x9c82('0x39')](_0x2d5f2a['model'],qs[_0x9c82('0x3b')](_0x41fd99['query'][_0x9c82('0x3b')]));_0x19eb9e[_0x9c82('0x3a')]=_0x19eb9e[_0x9c82('0x3a')][_0x9c82('0x3c')]?_0x19eb9e[_0x9c82('0x3a')]:_0x2d5f2a['model'];_0x19eb9e[_0x9c82('0x24')]=qs[_0x9c82('0x24')](_0x41fd99[_0x9c82('0x37')][_0x9c82('0x24')]);_0x19eb9e[_0x9c82('0x22')]=qs[_0x9c82('0x22')](_0x41fd99[_0x9c82('0x37')]['offset']);_0x19eb9e[_0x9c82('0x3e')]=qs[_0x9c82('0x3f')](_0x41fd99[_0x9c82('0x37')][_0x9c82('0x3f')]);_0x19eb9e['where']=qs['filters'](_['pick'](_0x41fd99['query'],_0x2d5f2a[_0x9c82('0x41')]));_0x19eb9e=_[_0x9c82('0x44')]({},_0x19eb9e,_0x41fd99['options']);return _0x56f340[_0x9c82('0x4f')+_['capitalize'](_0x41fd99[_0x9c82('0x37')]['channel'][_0x9c82('0x78')]())+_0x9c82('0x7a')](_0x19eb9e);})[_0x9c82('0x2c')](respondWithResult(_0x20e5ae,null))[_0x9c82('0x4d')](handleError(_0x20e5ae,null));};exports[_0x9c82('0x7b')]=function(_0x14d224,_0x5ed631,_0x5c06c1){return db['Team']['findOne']({'where':{'id':_0x14d224[_0x9c82('0x4a')]['id']}})['then'](function(_0x5a533e){if(_0x5a533e){if(!_0x14d224[_0x9c82('0x55')][_0x9c82('0x76')]||!utils['isValidChannel'](_0x14d224[_0x9c82('0x55')][_0x9c82('0x76')])){throw new db[(_0x9c82('0x5a'))][(_0x9c82('0x77'))](_0x9c82('0x7c'));}return _0x5a533e[_0x9c82('0x7d')+_[_0x9c82('0x7e')](_0x14d224[_0x9c82('0x55')]['channel'][_0x9c82('0x78')]())+_0x9c82('0x7a')](_0x14d224[_0x9c82('0x55')][_0x9c82('0x7f')]);}return null;})[_0x9c82('0x2c')](handleEntityNotFound(_0x5ed631,null))[_0x9c82('0x2c')](respondWithStatusCode(_0x5ed631,null))['catch'](handleError(_0x5ed631,null));};exports[_0x9c82('0x80')]=function(_0x33cb30,_0x1e5d47,_0x21f6d1){return db[_0x9c82('0x33')][_0x9c82('0x75')]({'where':{'id':_0x33cb30['params']['id']}})[_0x9c82('0x2c')](function(_0x4a20c3){if(_0x4a20c3){if(!_0x33cb30[_0x9c82('0x37')][_0x9c82('0x76')]||!utils[_0x9c82('0x81')](_0x33cb30[_0x9c82('0x37')][_0x9c82('0x76')])){throw new db[(_0x9c82('0x5a'))][(_0x9c82('0x77'))](_0x9c82('0x7c'));}return _0x4a20c3[_0x9c82('0x82')+_[_0x9c82('0x7e')](_0x33cb30[_0x9c82('0x37')][_0x9c82('0x76')][_0x9c82('0x78')]())+_0x9c82('0x7a')](_0x33cb30[_0x9c82('0x37')]['ids']);}return null;})[_0x9c82('0x2c')](handleEntityNotFound(_0x1e5d47,null))[_0x9c82('0x2c')](respondWithStatusCode(_0x1e5d47,null))[_0x9c82('0x4d')](handleError(_0x1e5d47,null));};exports[_0x9c82('0x83')]=function(_0x1147d7,_0x50435a){var _0x1ca903=_[_0x9c82('0x84')](_0x1147d7[_0x9c82('0x55')][_0x9c82('0x7f')])?_0x1147d7[_0x9c82('0x55')][_0x9c82('0x7f')]:[_0x1147d7[_0x9c82('0x55')][_0x9c82('0x7f')]];var _0x390fe4=_0x1147d7[_0x9c82('0x4a')]['id'];return db[_0x9c82('0x33')][_0x9c82('0x4c')]({'where':{'id':_0x390fe4}})[_0x9c82('0x2c')](handleEntityNotFound(_0x50435a,null))['then'](function(_0x58f323){if(_0x58f323){var _0xcf642c=[_0x9c82('0x85'),_0x9c82('0x86'),_0x9c82('0x87'),_0x9c82('0x88'),_0x9c82('0x89'),'Openchannel','Whatsapp'];return db['sequelize']['transaction'](function(_0x1b264b){var _0xd04030=_[_0x9c82('0x32')](_0xcf642c,function(_0x2b9c1f){var _0x42ad2a={'attributes':['id',_0x9c82('0x2f')]};if(_0x2b9c1f===_0x9c82('0x85')){_0x42ad2a['through']={'attributes':[_0x9c82('0x8a')]};}return _0x58f323['get'+_0x2b9c1f+_0x9c82('0x7a')](_0x42ad2a)[_0x9c82('0x2c')](function(_0x265a84){var _0xd687f=_[_0x9c82('0x32')](_0x265a84,function(_0x379fdc){var _0x250081=_[_0x9c82('0x32')](_0x1ca903,function(_0x3e38f3){var _0x45b3fa={'where':{'UserId':_0x3e38f3,[_0x2b9c1f+_0x9c82('0x8b')]:_0x379fdc['id']},'transaction':_0x1b264b};if(_0x2b9c1f===_0x9c82('0x85')){_0x45b3fa[_0x9c82('0x1a')]={'penalty':_0x379fdc[_0x9c82('0x8c')][_0x9c82('0x8a')]};}return db[_0x9c82('0x8d')+_0x2b9c1f+_0x9c82('0x8e')][_0x9c82('0x8f')](_0x45b3fa)['then'](function(){socket[_0x9c82('0x90')](_0x9c82('0x52')+_0x2b9c1f+_0x9c82('0x91'),{'UserId':_0x3e38f3,[_0x2b9c1f+_0x9c82('0x8b')]:_0x379fdc['id']});if(_0x2b9c1f!=='Voice'){return;}return db['User'][_0x9c82('0x92')]({'where':{'id':_0x1ca903,'online':0x1},'attributes':['id',_0x9c82('0x2f'),_0x9c82('0x93'),_0x9c82('0x94'),_0x9c82('0x95')],'raw':!![]})[_0x9c82('0x2c')](function(_0x4e4f69){var _0x2c32db=_[_0x9c82('0x32')](_0x4e4f69,function(_0x2951a9){return db[_0x9c82('0x96')]['upsert']({'membername':_0x2951a9[_0x9c82('0x2f')],'UserId':_0x2951a9['id'],'queue_name':_0x379fdc[_0x9c82('0x2f')],'VoiceQueueId':_0x379fdc['id'],'interface':_[_0x9c82('0x97')](_0x2951a9['interface'])?util[_0x9c82('0x98')](_0x9c82('0x99'),_0x2951a9[_0x9c82('0x2f')]):_0x2951a9[_0x9c82('0x95')],'paused':_0x2951a9[_0x9c82('0x94')]||![],'penalty':_0x379fdc[_0x9c82('0x8c')][_0x9c82('0x8a')]},{'transaction':_0x1b264b});});return Promise[_0x9c82('0x9a')](_0x2c32db);});});});return Promise['all'](_0x250081);});return Promise[_0x9c82('0x9a')](_0xd687f);})[_0x9c82('0x2c')](function(){return db[_0x9c82('0x70')][_0x9c82('0x75')]({'where':{'teamId':_0x390fe4}})[_0x9c82('0x2c')](function(_0x2a071c){if(_0x2a071c){var _0x15b51b=_[_0x9c82('0x32')](_0x1ca903,function(_0x174364){db[_0x9c82('0x9b')]['upsert']({'UserId':_0x174364,'VoicePrefixId':_0x2a071c[_0x9c82('0x71')]});});return Promise[_0x9c82('0x9a')](_0x15b51b);}});});});return Promise[_0x9c82('0x9a')](_0xd04030)['then'](function(){return _0x58f323[_0x9c82('0x83')](_0x1ca903,{'transaction':_0x1b264b})['spread'](function(_0x3195d8){return _0x3195d8;});});});}})[_0x9c82('0x2c')](respondWithResult(_0x50435a,null))[_0x9c82('0x4d')](handleError(_0x50435a,null));};exports['removeAgents']=function(_0x450e80,_0x39b849){var _0x45a002=_[_0x9c82('0x84')](_0x450e80[_0x9c82('0x37')]['ids'])?_0x450e80[_0x9c82('0x37')]['ids']:[_0x450e80[_0x9c82('0x37')][_0x9c82('0x7f')]];var _0x3e0cae=_0x450e80['params']['id'];return db[_0x9c82('0x33')]['find']({'where':{'id':_0x3e0cae}})[_0x9c82('0x2c')](handleEntityNotFound(_0x39b849,null))[_0x9c82('0x2c')](function(_0x32850b){if(_0x32850b){var _0x574970=[_0x9c82('0x85'),_0x9c82('0x86'),_0x9c82('0x87'),_0x9c82('0x88'),'Fax',_0x9c82('0x9c'),_0x9c82('0x9d')];return db[_0x9c82('0x57')]['transaction'](function(_0x40a033){var _0x392069=_[_0x9c82('0x32')](_0x574970,function(_0x1f3d21){var _0x185a37={'attributes':['id',_0x9c82('0x2f')]};return _0x32850b[_0x9c82('0x4f')+_0x1f3d21+_0x9c82('0x7a')](_0x185a37)['then'](function(_0x10e1cd){var _0x441458=_['map'](_0x10e1cd,function(_0x881ee){return _0x881ee[_0x9c82('0x9e')](_0x45a002,{'transaction':_0x40a033})[_0x9c82('0x2c')](function(){var _0x113223=_[_0x9c82('0x32')](_0x45a002,function(_0x23702b){socket['emit'](_0x9c82('0x52')+_0x1f3d21+'Queue:remove',{'UserId':Number(_0x23702b),[_0x1f3d21+_0x9c82('0x8b')]:_0x881ee['id']});if(_0x1f3d21!==_0x9c82('0x85')){return;}return db[_0x9c82('0x96')][_0x9c82('0x56')]({'where':{'VoiceQueueId':_0x881ee['id'],'UserId':_0x23702b},'transaction':_0x40a033});});return Promise['all'](_0x113223);});});return Promise[_0x9c82('0x9a')](_0x441458);});});return Promise[_0x9c82('0x9a')](_0x392069)[_0x9c82('0x2c')](function(){return _0x32850b[_0x9c82('0x9e')](_0x45a002,{'transaction':_0x40a033});})[_0x9c82('0x2c')](function(){return db[_0x9c82('0x70')][_0x9c82('0x75')]({'where':{'teamId':_0x3e0cae}})[_0x9c82('0x2c')](function(_0x422519){if(_0x422519){var _0x11e789=_[_0x9c82('0x32')](_0x45a002,function(_0xb2beff){db[_0x9c82('0x9b')][_0x9c82('0x56')]({'where':{'UserId':_0xb2beff,'VoicePrefixId':_0x422519[_0x9c82('0x71')]}});});return Promise[_0x9c82('0x9a')](_0x11e789);}});});});}})[_0x9c82('0x2c')](respondWithStatusCode(_0x39b849,null))[_0x9c82('0x4d')](handleError(_0x39b849,null));};exports[_0x9c82('0x9f')]=function(_0x549b03,_0x182290,_0x1465bd){var _0xa25cd5={};var _0x5e3308={};var _0x4532ca;var _0x265e32;return db[_0x9c82('0x33')][_0x9c82('0x75')]({'where':{'id':_0x549b03[_0x9c82('0x4a')]['id']}})[_0x9c82('0x2c')](handleEntityNotFound(_0x182290,null))['then'](function(_0x18924b){if(_0x18924b){_0x4532ca=_0x18924b;_0x5e3308['model']=_[_0x9c82('0x38')](db['User'][_0x9c82('0x79')]);_0x5e3308[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x549b03[_0x9c82('0x37')]);_0x5e3308['filters']=_[_0x9c82('0x39')](_0x5e3308[_0x9c82('0x36')],_0x5e3308[_0x9c82('0x37')]);_0xa25cd5[_0x9c82('0x3a')]=_[_0x9c82('0x39')](_0x5e3308['model'],qs['fields'](_0x549b03['query']['fields']));_0xa25cd5['attributes']=_0xa25cd5[_0x9c82('0x3a')]['length']?_0xa25cd5[_0x9c82('0x3a')]:_0x5e3308[_0x9c82('0x36')];_0xa25cd5['order']=qs['sort'](_0x549b03['query'][_0x9c82('0x3f')]);_0xa25cd5['where']=qs[_0x9c82('0x41')](_[_0x9c82('0x42')](_0x549b03[_0x9c82('0x37')],_0x5e3308[_0x9c82('0x41')]));if(_0x549b03['query'][_0x9c82('0x43')]){_0xa25cd5['where']=_[_0x9c82('0x44')](_0xa25cd5[_0x9c82('0x40')],{'$or':_['map'](_0xa25cd5[_0x9c82('0x3a')],function(_0x4b87d0){var _0x4dbb1f={};_0x4dbb1f[_0x4b87d0]={'$like':'%'+_0x549b03[_0x9c82('0x37')]['filter']+'%'};return _0x4dbb1f;})});}_0xa25cd5=_[_0x9c82('0x44')]({},_0xa25cd5,_0x549b03[_0x9c82('0x46')]);return _0x4532ca[_0x9c82('0x9f')](_0xa25cd5);}})[_0x9c82('0x2c')](function(_0x1a78e7){if(_0x1a78e7){_0x265e32=_0x1a78e7[_0x9c82('0x3c')];if(!_0x549b03[_0x9c82('0x37')][_0x9c82('0x3d')](_0x9c82('0xa0'))){_0xa25cd5[_0x9c82('0x24')]=qs['limit'](_0x549b03['query'][_0x9c82('0x24')]);_0xa25cd5['offset']=qs[_0x9c82('0x22')](_0x549b03[_0x9c82('0x37')][_0x9c82('0x22')]);}return _0x4532ca[_0x9c82('0x9f')](_0xa25cd5);}})[_0x9c82('0x2c')](function(_0x397073){if(_0x397073){return _0x397073?{'count':_0x265e32,'rows':_0x397073}:null;}})[_0x9c82('0x2c')](respondWithResult(_0x182290,null))[_0x9c82('0x4d')](handleError(_0x182290,null));}; \ No newline at end of file +var _0x4069=['redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','name','send','index','map','Team','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','transaction','sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Teams','end','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','toLowerCase','sort','capitalize','Queues','addQueues','ValidationError','add','ids','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','through','penalty','QueueId','defaults','TeamVoiceQueue','findOrCreate','Queue:save','User','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','spread','removeAgents','isArray','Whatsapp','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1b9124,_0x563548){var _0x128a98=function(_0xf219b){while(--_0xf219b){_0x1b9124['push'](_0x1b9124['shift']());}};_0x128a98(++_0x563548);}(_0x4069,0x1ba));var _0x9406=function(_0x1159e2,_0x20baf7){_0x1159e2=_0x1159e2-0x0;var _0x58d938=_0x4069[_0x1159e2];return _0x58d938;};'use strict';var emlformat=require(_0x9406('0x0'));var rimraf=require(_0x9406('0x1'));var zipdir=require(_0x9406('0x2'));var jsonpatch=require(_0x9406('0x3'));var rp=require(_0x9406('0x4'));var moment=require('moment');var BPromise=require(_0x9406('0x5'));var Mustache=require(_0x9406('0x6'));var util=require(_0x9406('0x7'));var path=require(_0x9406('0x8'));var sox=require(_0x9406('0x9'));var csv=require('to-csv');var ejs=require(_0x9406('0xa'));var fs=require('fs');var fs_extra=require(_0x9406('0xb'));var _=require(_0x9406('0xc'));var squel=require(_0x9406('0xd'));var crypto=require(_0x9406('0xe'));var jsforce=require(_0x9406('0xf'));var deskjs=require(_0x9406('0x10'));var toCsv=require(_0x9406('0x11'));var querystring=require(_0x9406('0x12'));var Papa=require(_0x9406('0x13'));var Redis=require(_0x9406('0x14'));var authService=require(_0x9406('0x15'));var qs=require(_0x9406('0x16'));var as=require(_0x9406('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9406('0x18'))(_0x9406('0x19'));var utils=require(_0x9406('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x9406('0x1b'));var db=require(_0x9406('0x1c'))['db'];config[_0x9406('0x1d')]=_['defaults'](config[_0x9406('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x9406('0x1e'))(new Redis(config[_0x9406('0x1d')]));require('./team.socket')[_0x9406('0x1f')](socket);function respondWithStatusCode(_0x171202,_0x1a56e1){_0x1a56e1=_0x1a56e1||0xcc;return function(_0x391027){if(_0x391027){return _0x171202[_0x9406('0x20')](_0x1a56e1);}return _0x171202[_0x9406('0x21')](_0x1a56e1)['end']();};}function respondWithResult(_0x385445,_0x4d03cd){_0x4d03cd=_0x4d03cd||0xc8;return function(_0x4c5961){if(_0x4c5961){return _0x385445[_0x9406('0x21')](_0x4d03cd)[_0x9406('0x22')](_0x4c5961);}};}function respondWithFilteredResult(_0x13bc38,_0x326c03){return function(_0x28f480){if(_0x28f480){var _0x527813=typeof _0x326c03[_0x9406('0x23')]===_0x9406('0x24')&&typeof _0x326c03['limit']===_0x9406('0x24');var _0x427be6=_0x28f480[_0x9406('0x25')];var _0x53d84b=_0x527813?0x0:_0x326c03[_0x9406('0x23')];var _0x5d0db8=_0x527813?_0x28f480[_0x9406('0x25')]:_0x326c03[_0x9406('0x23')]+_0x326c03[_0x9406('0x26')];var _0x30ae0c;if(_0x5d0db8>=_0x427be6){_0x5d0db8=_0x427be6;_0x30ae0c=0xc8;}else{_0x30ae0c=0xce;}_0x13bc38['status'](_0x30ae0c);return _0x13bc38[_0x9406('0x27')]('Content-Range',_0x53d84b+'-'+_0x5d0db8+'/'+_0x427be6)['json'](_0x28f480);}return null;};}function patchUpdates(_0xc5b561){return function(_0x420dbc){try{jsonpatch[_0x9406('0x28')](_0x420dbc,_0xc5b561,!![]);}catch(_0x2def62){return BPromise[_0x9406('0x29')](_0x2def62);}return _0x420dbc[_0x9406('0x2a')]();};}function saveUpdates(_0x139a11,_0x3bb8c0){return function(_0x583f27){if(_0x583f27){return _0x583f27[_0x9406('0x2b')](_0x139a11)['then'](function(_0x2bfbe6){return _0x2bfbe6;});}return null;};}function handleEntityNotFound(_0x216fc5,_0xb5654e){return function(_0x22b3f0){if(!_0x22b3f0){_0x216fc5['sendStatus'](0x194);}return _0x22b3f0;};}function handleError(_0x43129d,_0x3df8a0){_0x3df8a0=_0x3df8a0||0x1f4;return function(_0x373829){logger['error'](_0x373829['stack']);if(_0x373829[_0x9406('0x2c')]){delete _0x373829['name'];}_0x43129d[_0x9406('0x21')](_0x3df8a0)[_0x9406('0x2d')](_0x373829);};}exports[_0x9406('0x2e')]=function(_0x592e83,_0x31717c){var _0x458674={},_0x3d1013={},_0x365dfc={'count':0x0,'rows':[]};var _0x120f8f=_[_0x9406('0x2f')](db[_0x9406('0x30')][_0x9406('0x31')],function(_0x4c913d){return{'name':_0x4c913d['fieldName'],'type':_0x4c913d[_0x9406('0x32')][_0x9406('0x33')]};});_0x3d1013[_0x9406('0x34')]=_['map'](_0x120f8f,_0x9406('0x2c'));_0x3d1013[_0x9406('0x35')]=_[_0x9406('0x36')](_0x592e83[_0x9406('0x35')]);_0x3d1013[_0x9406('0x37')]=_[_0x9406('0x38')](_0x3d1013[_0x9406('0x34')],_0x3d1013['query']);_0x458674[_0x9406('0x39')]=_[_0x9406('0x38')](_0x3d1013[_0x9406('0x34')],qs[_0x9406('0x3a')](_0x592e83[_0x9406('0x35')][_0x9406('0x3a')]));_0x458674[_0x9406('0x39')]=_0x458674[_0x9406('0x39')][_0x9406('0x3b')]?_0x458674['attributes']:_0x3d1013[_0x9406('0x34')];if(!_0x592e83['query'][_0x9406('0x3c')](_0x9406('0x3d'))){_0x458674['limit']=qs['limit'](_0x592e83[_0x9406('0x35')]['limit']);_0x458674[_0x9406('0x23')]=qs[_0x9406('0x23')](_0x592e83[_0x9406('0x35')]['offset']);}_0x458674[_0x9406('0x3e')]=qs['sort'](_0x592e83[_0x9406('0x35')]['sort']);_0x458674[_0x9406('0x3f')]=qs['filters'](_[_0x9406('0x40')](_0x592e83[_0x9406('0x35')],_0x3d1013[_0x9406('0x37')]),_0x120f8f);if(_0x592e83[_0x9406('0x35')][_0x9406('0x41')]){_0x458674[_0x9406('0x3f')]=_[_0x9406('0x42')](_0x458674[_0x9406('0x3f')],{'$or':_[_0x9406('0x2f')](_0x120f8f,function(_0x30d720){if(_0x30d720[_0x9406('0x32')]!==_0x9406('0x43')){var _0x2a73ac={};_0x2a73ac[_0x30d720['name']]={'$like':'%'+_0x592e83[_0x9406('0x35')][_0x9406('0x41')]+'%'};return _0x2a73ac;}})});}_0x458674=_[_0x9406('0x42')]({},_0x458674,_0x592e83['options']);var _0x116de2={'where':_0x458674[_0x9406('0x3f')]};return db[_0x9406('0x30')][_0x9406('0x25')](_0x116de2)[_0x9406('0x44')](function(_0x53f5ea){_0x365dfc[_0x9406('0x25')]=_0x53f5ea;if(_0x592e83[_0x9406('0x35')][_0x9406('0x45')]){_0x458674[_0x9406('0x46')]=[{'all':!![]}];}return db[_0x9406('0x30')][_0x9406('0x47')](_0x458674);})[_0x9406('0x44')](function(_0x5ad8a8){_0x365dfc[_0x9406('0x48')]=_0x5ad8a8;return _0x365dfc;})[_0x9406('0x44')](respondWithFilteredResult(_0x31717c,_0x458674))[_0x9406('0x49')](handleError(_0x31717c,null));};exports[_0x9406('0x4a')]=function(_0x2e6667,_0x405605){var _0x35739c={'raw':![],'where':{'id':_0x2e6667['params']['id']}},_0x144692={};_0x144692[_0x9406('0x34')]=_[_0x9406('0x36')](db['Team'][_0x9406('0x31')]);_0x144692[_0x9406('0x35')]=_[_0x9406('0x36')](_0x2e6667['query']);_0x144692[_0x9406('0x37')]=_['intersection'](_0x144692['model'],_0x144692[_0x9406('0x35')]);_0x35739c['attributes']=_['intersection'](_0x144692[_0x9406('0x34')],qs[_0x9406('0x3a')](_0x2e6667['query'][_0x9406('0x3a')]));_0x35739c[_0x9406('0x39')]=_0x35739c[_0x9406('0x39')][_0x9406('0x3b')]?_0x35739c[_0x9406('0x39')]:_0x144692[_0x9406('0x34')];if(_0x2e6667['query'][_0x9406('0x45')]){_0x35739c[_0x9406('0x46')]=[{'all':!![]}];}_0x35739c=_[_0x9406('0x42')]({},_0x35739c,_0x2e6667[_0x9406('0x4b')]);return db[_0x9406('0x30')][_0x9406('0x4c')](_0x35739c)['then'](handleEntityNotFound(_0x405605,null))[_0x9406('0x44')](respondWithResult(_0x405605,null))[_0x9406('0x49')](handleError(_0x405605,null));};exports['create']=function(_0x3db0af,_0x32cff8){return db[_0x9406('0x30')][_0x9406('0x4d')](_0x3db0af[_0x9406('0x4e')],{})[_0x9406('0x44')](function(_0x5ad579){var _0x23c663=_0x3db0af[_0x9406('0x4f')][_0x9406('0x50')]({'plain':!![]});if(!_0x23c663)throw new Error(_0x9406('0x51'));if(_0x23c663[_0x9406('0x52')]===_0x9406('0x4f')){var _0x314adc=_0x5ad579[_0x9406('0x50')]({'plain':!![]});var _0x1cdfd9='Teams';return db['UserProfileSection'][_0x9406('0x4c')]({'where':{'name':_0x1cdfd9,'userProfileId':_0x23c663[_0x9406('0x53')]},'raw':!![]})['then'](function(_0x2718e9){if(_0x2718e9&&_0x2718e9[_0x9406('0x54')]===0x0){return db['UserProfileResource'][_0x9406('0x4d')]({'name':_0x314adc['name'],'resourceId':_0x314adc['id'],'type':_0x2718e9['name'],'sectionId':_0x2718e9['id']},{})[_0x9406('0x44')](function(){return _0x5ad579;});}else{return _0x5ad579;}})[_0x9406('0x49')](function(_0x1247a7){logger[_0x9406('0x55')](_0x9406('0x56'),_0x1247a7);throw _0x1247a7;});}return _0x5ad579;})[_0x9406('0x44')](respondWithResult(_0x32cff8,0xc9))[_0x9406('0x49')](handleError(_0x32cff8,null));};exports[_0x9406('0x2b')]=function(_0x228750,_0x390c17){if(_0x228750[_0x9406('0x4e')]['id']){delete _0x228750[_0x9406('0x4e')]['id'];}return db[_0x9406('0x30')][_0x9406('0x4c')]({'where':{'id':_0x228750[_0x9406('0x57')]['id']}})[_0x9406('0x44')](handleEntityNotFound(_0x390c17,null))[_0x9406('0x44')](saveUpdates(_0x228750['body'],null))['then'](respondWithResult(_0x390c17,null))[_0x9406('0x49')](handleError(_0x390c17,null));};exports[_0x9406('0x58')]=function(_0x137ed9,_0x52992f){var _0xb69d1e=_0x137ed9[_0x9406('0x57')]['id'];var _0x23a04f=[];return db['sequelize'][_0x9406('0x59')](function(_0x4e7185){var _0x1704d5='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0xb69d1e;return db[_0x9406('0x5a')][_0x9406('0x35')](_0x1704d5,{'type':db['Sequelize'][_0x9406('0x5b')][_0x9406('0x5c')],'raw':!![],'transaction':_0x4e7185})[_0x9406('0x44')](function(_0x53ccae){_0x23a04f=_[_0x9406('0x2f')](_0x53ccae,function(_0x1cad48){return Number(_0x1cad48['UserId']);});})[_0x9406('0x44')](function(){var _0x31b68d=_0x9406('0x5d')+_0xb69d1e;return db[_0x9406('0x5a')][_0x9406('0x35')](_0x31b68d,{'type':db[_0x9406('0x5e')][_0x9406('0x5b')]['SELECT'],'raw':!![],'transaction':_0x4e7185});})[_0x9406('0x44')](function(_0x112a47){var _0x332b06=_[_0x9406('0x2f')](_0x112a47,function(_0x569ea0){return Number(_0x569ea0[_0x9406('0x5f')]);});return db['UserVoiceQueue'][_0x9406('0x58')]({'where':{'UserId':{'$in':_0x23a04f},'VoiceQueueId':{'$in':_0x332b06}},'transaction':_0x4e7185});})[_0x9406('0x44')](function(){var _0xfeec83=_0x9406('0x60')+_0xb69d1e;return db['sequelize'][_0x9406('0x35')](_0xfeec83,{'type':db[_0x9406('0x5e')][_0x9406('0x5b')][_0x9406('0x5c')],'raw':!![],'transaction':_0x4e7185});})[_0x9406('0x44')](function(_0x36b7cf){var _0x24ffc5=_[_0x9406('0x2f')](_0x36b7cf,function(_0x4ba6c7){return Number(_0x4ba6c7[_0x9406('0x61')]);});return db['UserMailQueue'][_0x9406('0x58')]({'where':{'UserId':{'$in':_0x23a04f},'MailQueueId':{'$in':_0x24ffc5}},'transaction':_0x4e7185});})[_0x9406('0x44')](function(){var _0x3c8a76='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0xb69d1e;return db[_0x9406('0x5a')][_0x9406('0x35')](_0x3c8a76,{'type':db[_0x9406('0x5e')][_0x9406('0x5b')][_0x9406('0x5c')],'raw':!![],'transaction':_0x4e7185});})[_0x9406('0x44')](function(_0x2cd34b){var _0x14ebf4=_['map'](_0x2cd34b,function(_0x31f5dd){return Number(_0x31f5dd[_0x9406('0x62')]);});return db[_0x9406('0x63')][_0x9406('0x58')]({'where':{'UserId':{'$in':_0x23a04f},'SmsQueueId':{'$in':_0x14ebf4}},'transaction':_0x4e7185});})[_0x9406('0x44')](function(){var _0x29b484=_0x9406('0x64')+_0xb69d1e;return db[_0x9406('0x5a')][_0x9406('0x35')](_0x29b484,{'type':db[_0x9406('0x5e')][_0x9406('0x5b')]['SELECT'],'raw':!![],'transaction':_0x4e7185});})[_0x9406('0x44')](function(_0x1e31ae){var _0x4a8201=_[_0x9406('0x2f')](_0x1e31ae,function(_0x2c2c60){return Number(_0x2c2c60[_0x9406('0x65')]);});return db[_0x9406('0x66')][_0x9406('0x58')]({'where':{'UserId':{'$in':_0x23a04f},'ChatQueueId':{'$in':_0x4a8201}},'transaction':_0x4e7185});})[_0x9406('0x44')](function(){var _0xbd0fac='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0xb69d1e;return db[_0x9406('0x5a')][_0x9406('0x35')](_0xbd0fac,{'type':db[_0x9406('0x5e')]['QueryTypes'][_0x9406('0x5c')],'raw':!![],'transaction':_0x4e7185});})[_0x9406('0x44')](function(_0x34b160){var _0x4ba50d=_[_0x9406('0x2f')](_0x34b160,function(_0x239018){return Number(_0x239018[_0x9406('0x67')]);});return db[_0x9406('0x68')][_0x9406('0x58')]({'where':{'UserId':{'$in':_0x23a04f},'FaxQueueId':{'$in':_0x4ba50d}},'transaction':_0x4e7185});})['then'](function(){var _0x5430cd=_0x9406('0x69')+_0xb69d1e;return db[_0x9406('0x5a')][_0x9406('0x35')](_0x5430cd,{'type':db[_0x9406('0x5e')]['QueryTypes'][_0x9406('0x5c')],'raw':!![],'transaction':_0x4e7185});})[_0x9406('0x44')](function(_0x2e4fd6){var _0x4ac481=_[_0x9406('0x2f')](_0x2e4fd6,function(_0x42c00c){return Number(_0x42c00c[_0x9406('0x6a')]);});return db[_0x9406('0x6b')][_0x9406('0x58')]({'where':{'UserId':{'$in':_0x23a04f},'OpenchannelQueueId':{'$in':_0x4ac481}},'transaction':_0x4e7185});})[_0x9406('0x44')](function(){var _0x387724='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0xb69d1e;return db[_0x9406('0x5a')][_0x9406('0x35')](_0x387724,{'type':db['Sequelize'][_0x9406('0x5b')][_0x9406('0x5c')],'raw':!![],'transaction':_0x4e7185});})[_0x9406('0x44')](function(_0x2732cc){var _0x46b9fc=_[_0x9406('0x2f')](_0x2732cc,function(_0x5105e5){return Number(_0x5105e5['WhatsappQueueId']);});return db[_0x9406('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x23a04f},'WhatsappQueueId':{'$in':_0x46b9fc}},'transaction':_0x4e7185});})[_0x9406('0x44')](function(){return db[_0x9406('0x6d')][_0x9406('0x4c')]({'where':{'TeamId':_0xb69d1e}});})[_0x9406('0x44')](function(_0x5a0aae){if(_0x5a0aae===null){return;}return db[_0x9406('0x6e')][_0x9406('0x58')]({'where':{'UserId':{'$in':_0x23a04f},'VoicePrefixId':_0x5a0aae[_0x9406('0x6f')]},'transaction':_0x4e7185});})['then'](function(){return db[_0x9406('0x30')][_0x9406('0x58')]({'where':{'id':_0xb69d1e},'cascade':!![],'transaction':_0x4e7185});})['then'](function(_0x1aa225){if(_0x1aa225===0x0){_0x52992f[_0x9406('0x20')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':_0x9406('0x70'),'resourceId':_0xb69d1e},'cascade':!![],'transaction':_0x4e7185})[_0x9406('0x44')](function(){_0x52992f[_0x9406('0x21')](0xcc)[_0x9406('0x71')]();});}})[_0x9406('0x49')](function(_0x5ec856){_0x52992f[_0x9406('0x21')](0x1f4)[_0x9406('0x2d')](_0x5ec856);});});};exports[_0x9406('0x72')]=function(_0x702c72,_0x353cc0,_0x58b521){return db[_0x9406('0x30')][_0x9406('0x73')]({'where':{'id':_0x702c72[_0x9406('0x57')]['id']}})[_0x9406('0x44')](handleEntityNotFound(_0x353cc0,null))[_0x9406('0x44')](function(_0xf69c96){if(!_0x702c72[_0x9406('0x35')][_0x9406('0x74')]||!utils[_0x9406('0x75')](_0x702c72['query'][_0x9406('0x74')])){throw new db[(_0x9406('0x5e'))]['ValidationError'](_0x9406('0x76'));}var _0x682e4f={};var _0x37a3d6={};_0x37a3d6[_0x9406('0x34')]=_[_0x9406('0x36')](db[_['capitalize'](_0x702c72[_0x9406('0x35')][_0x9406('0x74')][_0x9406('0x77')]())+'Queue'][_0x9406('0x31')]);_0x37a3d6['query']=_[_0x9406('0x36')](_0x702c72[_0x9406('0x35')]);_0x37a3d6[_0x9406('0x37')]=_[_0x9406('0x38')](_0x37a3d6['model'],_0x37a3d6[_0x9406('0x35')]);_0x682e4f[_0x9406('0x39')]=_[_0x9406('0x38')](_0x37a3d6[_0x9406('0x34')],qs[_0x9406('0x3a')](_0x702c72['query'][_0x9406('0x3a')]));_0x682e4f[_0x9406('0x39')]=_0x682e4f[_0x9406('0x39')][_0x9406('0x3b')]?_0x682e4f[_0x9406('0x39')]:_0x37a3d6[_0x9406('0x34')];_0x682e4f['limit']=qs[_0x9406('0x26')](_0x702c72[_0x9406('0x35')]['limit']);_0x682e4f['offset']=qs[_0x9406('0x23')](_0x702c72[_0x9406('0x35')][_0x9406('0x23')]);_0x682e4f[_0x9406('0x3e')]=qs['sort'](_0x702c72[_0x9406('0x35')][_0x9406('0x78')]);_0x682e4f[_0x9406('0x3f')]=qs[_0x9406('0x37')](_['pick'](_0x702c72[_0x9406('0x35')],_0x37a3d6['filters']));_0x682e4f=_['merge']({},_0x682e4f,_0x702c72['options']);return _0xf69c96[_0x9406('0x50')+_[_0x9406('0x79')](_0x702c72[_0x9406('0x35')][_0x9406('0x74')][_0x9406('0x77')]())+_0x9406('0x7a')](_0x682e4f);})['then'](respondWithResult(_0x353cc0,null))[_0x9406('0x49')](handleError(_0x353cc0,null));};exports[_0x9406('0x7b')]=function(_0x41b5b2,_0x564dfb,_0x5107b9){return db['Team']['findOne']({'where':{'id':_0x41b5b2[_0x9406('0x57')]['id']}})[_0x9406('0x44')](function(_0x1c506d){if(_0x1c506d){if(!_0x41b5b2[_0x9406('0x4e')]['channel']||!utils['isValidChannel'](_0x41b5b2['body'][_0x9406('0x74')])){throw new db[(_0x9406('0x5e'))][(_0x9406('0x7c'))](_0x9406('0x76'));}return _0x1c506d[_0x9406('0x7d')+_[_0x9406('0x79')](_0x41b5b2[_0x9406('0x4e')][_0x9406('0x74')][_0x9406('0x77')]())+'Queues'](_0x41b5b2[_0x9406('0x4e')][_0x9406('0x7e')]);}return null;})[_0x9406('0x44')](handleEntityNotFound(_0x564dfb,null))[_0x9406('0x44')](respondWithStatusCode(_0x564dfb,null))[_0x9406('0x49')](handleError(_0x564dfb,null));};exports['removeQueues']=function(_0xc296df,_0x43cea8,_0x2057a6){return db[_0x9406('0x30')]['findOne']({'where':{'id':_0xc296df[_0x9406('0x57')]['id']}})[_0x9406('0x44')](function(_0x1518ab){if(_0x1518ab){if(!_0xc296df[_0x9406('0x35')][_0x9406('0x74')]||!utils['isValidChannel'](_0xc296df['query']['channel'])){throw new db['Sequelize'][(_0x9406('0x7c'))](_0x9406('0x76'));}return _0x1518ab[_0x9406('0x7f')+_[_0x9406('0x79')](_0xc296df['query'][_0x9406('0x74')][_0x9406('0x77')]())+_0x9406('0x7a')](_0xc296df[_0x9406('0x35')]['ids']);}return null;})[_0x9406('0x44')](handleEntityNotFound(_0x43cea8,null))[_0x9406('0x44')](respondWithStatusCode(_0x43cea8,null))[_0x9406('0x49')](handleError(_0x43cea8,null));};exports[_0x9406('0x80')]=function(_0x508e6b,_0x46eefb){var _0x20bb9f=_['isArray'](_0x508e6b['body'][_0x9406('0x7e')])?_0x508e6b[_0x9406('0x4e')][_0x9406('0x7e')]:[_0x508e6b['body'][_0x9406('0x7e')]];var _0x59f6b0=_0x508e6b[_0x9406('0x57')]['id'];return db[_0x9406('0x30')][_0x9406('0x4c')]({'where':{'id':_0x59f6b0}})[_0x9406('0x44')](handleEntityNotFound(_0x46eefb,null))[_0x9406('0x44')](function(_0x43cab8){if(_0x43cab8){var _0x7e371f=[_0x9406('0x81'),_0x9406('0x82'),_0x9406('0x83'),_0x9406('0x84'),_0x9406('0x85'),_0x9406('0x86'),'Whatsapp'];return db[_0x9406('0x5a')][_0x9406('0x59')](function(_0x5b26ac){var _0xb132b7=_['map'](_0x7e371f,function(_0x4bf478){var _0x5b309a={'attributes':['id',_0x9406('0x2c')]};if(_0x4bf478==='Voice'){_0x5b309a[_0x9406('0x87')]={'attributes':[_0x9406('0x88')]};}return _0x43cab8[_0x9406('0x50')+_0x4bf478+_0x9406('0x7a')](_0x5b309a)[_0x9406('0x44')](function(_0x48ddc4){var _0x13bd53=_['map'](_0x48ddc4,function(_0x1c9bd3){var _0x20e88f=_[_0x9406('0x2f')](_0x20bb9f,function(_0x3b626b){var _0x5029be={'where':{'UserId':_0x3b626b,[_0x4bf478+_0x9406('0x89')]:_0x1c9bd3['id']},'transaction':_0x5b26ac};if(_0x4bf478===_0x9406('0x81')){_0x5029be[_0x9406('0x8a')]={'penalty':_0x1c9bd3[_0x9406('0x8b')][_0x9406('0x88')]};}return db['User'+_0x4bf478+'Queue'][_0x9406('0x8c')](_0x5029be)[_0x9406('0x44')](function(){socket['emit'](_0x9406('0x4f')+_0x4bf478+_0x9406('0x8d'),{'UserId':_0x3b626b,[_0x4bf478+_0x9406('0x89')]:_0x1c9bd3['id']});if(_0x4bf478!==_0x9406('0x81')){return;}return db[_0x9406('0x8e')][_0x9406('0x47')]({'where':{'id':_0x20bb9f,'online':0x1},'attributes':['id',_0x9406('0x2c'),'online','voicePause',_0x9406('0x8f')],'raw':!![]})[_0x9406('0x44')](function(_0x454d58){var _0x38398b=_[_0x9406('0x2f')](_0x454d58,function(_0x205a74){return db[_0x9406('0x90')][_0x9406('0x91')]({'membername':_0x205a74[_0x9406('0x2c')],'UserId':_0x205a74['id'],'queue_name':_0x1c9bd3[_0x9406('0x2c')],'VoiceQueueId':_0x1c9bd3['id'],'interface':_[_0x9406('0x92')](_0x205a74[_0x9406('0x8f')])?util[_0x9406('0x93')](_0x9406('0x94'),_0x205a74[_0x9406('0x2c')]):_0x205a74['interface'],'paused':_0x205a74[_0x9406('0x95')]||![],'penalty':_0x1c9bd3[_0x9406('0x8b')][_0x9406('0x88')]},{'transaction':_0x5b26ac});});return Promise[_0x9406('0x96')](_0x38398b);});});});return Promise[_0x9406('0x96')](_0x20e88f);});return Promise[_0x9406('0x96')](_0x13bd53);})['then'](function(){return db[_0x9406('0x6d')][_0x9406('0x73')]({'where':{'teamId':_0x59f6b0}})[_0x9406('0x44')](function(_0x2029da){if(_0x2029da){var _0x2492c3=_[_0x9406('0x2f')](_0x20bb9f,function(_0x327ba2){db[_0x9406('0x6e')]['upsert']({'UserId':_0x327ba2,'VoicePrefixId':_0x2029da[_0x9406('0x6f')]});});return Promise['all'](_0x2492c3);}});});});return Promise[_0x9406('0x96')](_0xb132b7)[_0x9406('0x44')](function(){return _0x43cab8[_0x9406('0x80')](_0x20bb9f,{'transaction':_0x5b26ac})[_0x9406('0x97')](function(_0x5621f1){return _0x5621f1;});});});}})[_0x9406('0x44')](respondWithResult(_0x46eefb,null))[_0x9406('0x49')](handleError(_0x46eefb,null));};exports[_0x9406('0x98')]=function(_0x102db8,_0x2751df){var _0x3c1f7e=_[_0x9406('0x99')](_0x102db8[_0x9406('0x35')][_0x9406('0x7e')])?_0x102db8['query'][_0x9406('0x7e')]:[_0x102db8['query']['ids']];var _0x27b70b=_0x102db8[_0x9406('0x57')]['id'];return db[_0x9406('0x30')]['find']({'where':{'id':_0x27b70b}})[_0x9406('0x44')](handleEntityNotFound(_0x2751df,null))[_0x9406('0x44')](function(_0x5c7c46){if(_0x5c7c46){var _0x2f608d=[_0x9406('0x81'),_0x9406('0x82'),_0x9406('0x83'),_0x9406('0x84'),'Fax',_0x9406('0x86'),_0x9406('0x9a')];return db[_0x9406('0x5a')][_0x9406('0x59')](function(_0x40a67e){var _0xa007e8=_[_0x9406('0x2f')](_0x2f608d,function(_0x2005cf){var _0x4c223c={'attributes':['id',_0x9406('0x2c')]};return _0x5c7c46[_0x9406('0x50')+_0x2005cf+_0x9406('0x7a')](_0x4c223c)[_0x9406('0x44')](function(_0x3ca46e){var _0x14f083=_[_0x9406('0x2f')](_0x3ca46e,function(_0x4d16d4){return _0x4d16d4['removeAgents'](_0x3c1f7e,{'transaction':_0x40a67e})[_0x9406('0x44')](function(){var _0x377dda=_['map'](_0x3c1f7e,function(_0x5639fd){socket[_0x9406('0x9b')]('user'+_0x2005cf+'Queue:remove',{'UserId':Number(_0x5639fd),[_0x2005cf+'QueueId']:_0x4d16d4['id']});if(_0x2005cf!==_0x9406('0x81')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4d16d4['id'],'UserId':_0x5639fd},'transaction':_0x40a67e});});return Promise['all'](_0x377dda);});});return Promise[_0x9406('0x96')](_0x14f083);});});return Promise[_0x9406('0x96')](_0xa007e8)[_0x9406('0x44')](function(){return _0x5c7c46[_0x9406('0x98')](_0x3c1f7e,{'transaction':_0x40a67e});})[_0x9406('0x44')](function(){return db[_0x9406('0x6d')][_0x9406('0x73')]({'where':{'teamId':_0x27b70b}})[_0x9406('0x44')](function(_0x53004e){if(_0x53004e){var _0x479d0e=_[_0x9406('0x2f')](_0x3c1f7e,function(_0x54854b){db[_0x9406('0x6e')][_0x9406('0x58')]({'where':{'UserId':_0x54854b,'VoicePrefixId':_0x53004e[_0x9406('0x6f')]}});});return Promise[_0x9406('0x96')](_0x479d0e);}});});});}})['then'](respondWithStatusCode(_0x2751df,null))[_0x9406('0x49')](handleError(_0x2751df,null));};exports[_0x9406('0x9c')]=function(_0x231360,_0x5b2aa3,_0x3d77b8){var _0xabf5ba={};var _0x14cdc2={};var _0x5a2038;var _0x2a3fca;return db[_0x9406('0x30')][_0x9406('0x73')]({'where':{'id':_0x231360[_0x9406('0x57')]['id']}})[_0x9406('0x44')](handleEntityNotFound(_0x5b2aa3,null))[_0x9406('0x44')](function(_0x30575f){if(_0x30575f){_0x5a2038=_0x30575f;_0x14cdc2['model']=_[_0x9406('0x36')](db[_0x9406('0x8e')][_0x9406('0x31')]);_0x14cdc2[_0x9406('0x35')]=_[_0x9406('0x36')](_0x231360[_0x9406('0x35')]);_0x14cdc2[_0x9406('0x37')]=_[_0x9406('0x38')](_0x14cdc2['model'],_0x14cdc2[_0x9406('0x35')]);_0xabf5ba[_0x9406('0x39')]=_[_0x9406('0x38')](_0x14cdc2[_0x9406('0x34')],qs[_0x9406('0x3a')](_0x231360[_0x9406('0x35')]['fields']));_0xabf5ba[_0x9406('0x39')]=_0xabf5ba['attributes'][_0x9406('0x3b')]?_0xabf5ba[_0x9406('0x39')]:_0x14cdc2['model'];_0xabf5ba[_0x9406('0x3e')]=qs[_0x9406('0x78')](_0x231360[_0x9406('0x35')][_0x9406('0x78')]);_0xabf5ba[_0x9406('0x3f')]=qs[_0x9406('0x37')](_[_0x9406('0x40')](_0x231360['query'],_0x14cdc2['filters']));if(_0x231360[_0x9406('0x35')][_0x9406('0x41')]){_0xabf5ba[_0x9406('0x3f')]=_[_0x9406('0x42')](_0xabf5ba['where'],{'$or':_[_0x9406('0x2f')](_0xabf5ba[_0x9406('0x39')],function(_0x57a771){var _0x35819b={};_0x35819b[_0x57a771]={'$like':'%'+_0x231360['query'][_0x9406('0x41')]+'%'};return _0x35819b;})});}_0xabf5ba=_[_0x9406('0x42')]({},_0xabf5ba,_0x231360['options']);return _0x5a2038[_0x9406('0x9c')](_0xabf5ba);}})[_0x9406('0x44')](function(_0x3904c){if(_0x3904c){_0x2a3fca=_0x3904c[_0x9406('0x3b')];if(!_0x231360[_0x9406('0x35')][_0x9406('0x3c')](_0x9406('0x3d'))){_0xabf5ba['limit']=qs['limit'](_0x231360['query'][_0x9406('0x26')]);_0xabf5ba['offset']=qs[_0x9406('0x23')](_0x231360[_0x9406('0x35')]['offset']);}return _0x5a2038['getAgents'](_0xabf5ba);}})[_0x9406('0x44')](function(_0x3bb433){if(_0x3bb433){return _0x3bb433?{'count':_0x2a3fca,'rows':_0x3bb433}:null;}})[_0x9406('0x44')](respondWithResult(_0x5b2aa3,null))[_0x9406('0x49')](handleError(_0x5b2aa3,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 750e708..c269e71 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 _0xfd39=['Team','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x272973,_0x3a8224){var _0x1c95b1=function(_0x397bae){while(--_0x397bae){_0x272973['push'](_0x272973['shift']());}};_0x1c95b1(++_0x3a8224);}(_0xfd39,0x115));var _0x9fd3=function(_0x5d5004,_0x5418ca){_0x5d5004=_0x5d5004-0x0;var _0x117e4d=_0xfd39[_0x5d5004];return _0x117e4d;};'use strict';var EventEmitter=require(_0x9fd3('0x0'));var Team=require(_0x9fd3('0x1'))['db'][_0x9fd3('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9fd3('0x3')](0x0);var events={'afterCreate':_0x9fd3('0x4'),'afterUpdate':_0x9fd3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d1bf3){return function(_0x1b15fa,_0x28e8da,_0x39fa2f){TeamEvents[_0x9fd3('0x6')](_0x4d1bf3+':'+_0x1b15fa['id'],_0x1b15fa);TeamEvents[_0x9fd3('0x6')](_0x4d1bf3,_0x1b15fa);_0x39fa2f(null);};}for(var e in events){if(events[_0x9fd3('0x7')](e)){var event=events[e];Team[_0x9fd3('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xfdf4=['setMaxListeners','update','remove','hasOwnProperty','exports','events','Team'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfdf4,0x83));var _0x4fdf=function(_0x2b2200,_0x2bcc71){_0x2b2200=_0x2b2200-0x0;var _0x3bdc34=_0xfdf4[_0x2b2200];return _0x3bdc34;};'use strict';var EventEmitter=require(_0x4fdf('0x0'));var Team=require('../../mysqldb')['db'][_0x4fdf('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x4fdf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4fdf('0x3'),'afterDestroy':_0x4fdf('0x4')};function emitEvent(_0x420f5f){return function(_0x3ae869,_0x409cd4,_0x436fc5){TeamEvents['emit'](_0x420f5f+':'+_0x3ae869['id'],_0x3ae869);TeamEvents['emit'](_0x420f5f,_0x3ae869);_0x436fc5(null);};}for(var e in events){if(events[_0x4fdf('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x4fdf('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index be9669d..5c11dc0 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 _0xab30=['exports','define','Team','Mail','Openchannel','Voice','Whatsapp','all','lodash','./team.attributes','get','Queues','then','map','channel','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab30,0xe8));var _0x0ab3=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xab30[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x0ab3('0x0'));var attributes=require(_0x0ab3('0x1'));function getQueuesByChannel(_0x4aebd8,_0x1d66ad){var _0x743d78=_0x0ab3('0x2')+_0x1d66ad+_0x0ab3('0x3');return _0x4aebd8[_0x743d78]()[_0x0ab3('0x4')](function(_0xec93df){return _[_0x0ab3('0x5')](_0xec93df,function(_0x44748f){_0x44748f['setDataValue'](_0x0ab3('0x6'),_0x1d66ad);return _0x44748f;});})[_0x0ab3('0x7')](function(_0xef768c){throw _0xef768c;});}module[_0x0ab3('0x8')]=function(_0x26956e){return _0x26956e[_0x0ab3('0x9')](_0x0ab3('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xb15535=this;var _0x17d8d0=['Chat','Fax',_0x0ab3('0xb'),_0x0ab3('0xc'),'Sms',_0x0ab3('0xd'),_0x0ab3('0xe')];return Promise['resolve']()[_0x0ab3('0x4')](function(){var _0x2e8324=_[_0x0ab3('0x5')](_0x17d8d0,function(_0x196484){return getQueuesByChannel(_0xb15535,_0x196484);});return Promise[_0x0ab3('0xf')](_0x2e8324);})['catch'](function(_0x3c2296){throw _0x3c2296;});}}});}; \ No newline at end of file +var _0xd341=['Openchannel','Sms','Voice','Whatsapp','all','lodash','./team.attributes','get','Queues','then','map','channel','catch','Team','teams','Chat','Fax','Mail'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xd341,0xa7));var _0x1d34=function(_0x74c77a,_0x89628e){_0x74c77a=_0x74c77a-0x0;var _0x51d12c=_0xd341[_0x74c77a];return _0x51d12c;};'use strict';var _=require(_0x1d34('0x0'));var attributes=require(_0x1d34('0x1'));function getQueuesByChannel(_0x2b71f0,_0x185055){var _0x48f4df=_0x1d34('0x2')+_0x185055+_0x1d34('0x3');return _0x2b71f0[_0x48f4df]()[_0x1d34('0x4')](function(_0x411316){return _[_0x1d34('0x5')](_0x411316,function(_0xc90c1a){_0xc90c1a['setDataValue'](_0x1d34('0x6'),_0x185055);return _0xc90c1a;});})[_0x1d34('0x7')](function(_0x393faf){throw _0x393faf;});}module['exports']=function(_0x54e273){return _0x54e273['define'](_0x1d34('0x8'),attributes,{'tableName':_0x1d34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x10ae2e=this;var _0x359c11=[_0x1d34('0xa'),_0x1d34('0xb'),_0x1d34('0xc'),_0x1d34('0xd'),_0x1d34('0xe'),_0x1d34('0xf'),_0x1d34('0x10')];return Promise['resolve']()[_0x1d34('0x4')](function(){var _0x37e9f7=_[_0x1d34('0x5')](_0x359c11,function(_0x2a4b89){return getQueuesByChannel(_0x10ae2e,_0x2a4b89);});return Promise[_0x1d34('0x11')](_0x37e9f7);})[_0x1d34('0x7')](function(_0x2d5f53){throw _0x2d5f53;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9cab383..95472da 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 _0x4290=['result','catch','lodash','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','localhost','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3ca115,_0x286520){var _0x1538bc=function(_0x2f891b){while(--_0x2f891b){_0x3ca115['push'](_0x3ca115['shift']());}};_0x1538bc(++_0x286520);}(_0x4290,0xf2));var _0x0429=function(_0x3bc231,_0x12dfd6){_0x3bc231=_0x3bc231-0x0;var _0x3c301c=_0x4290[_0x3bc231];return _0x3c301c;};'use strict';var _=require(_0x0429('0x0'));var util=require('util');var moment=require(_0x0429('0x1'));var BPromise=require('bluebird');var rs=require(_0x0429('0x2'));var fs=require('fs');var Redis=require(_0x0429('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0429('0x4'));var config=require(_0x0429('0x5'));var jayson=require(_0x0429('0x6'));var client=jayson[_0x0429('0x7')]['http']({'port':0x232a});config[_0x0429('0x8')]=_['defaults'](config[_0x0429('0x8')],{'host':_0x0429('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0429('0x8')]));require(_0x0429('0xa'))[_0x0429('0xb')](socket);function respondWithRpcPromise(_0x6cd787,_0x1895a2,_0x3102c0){return new BPromise(function(_0x6b28ed,_0x1f21bc){return client[_0x0429('0xc')](_0x6cd787,_0x3102c0)[_0x0429('0xd')](function(_0x3d4dd6){logger['info'](_0x0429('0xe'),_0x1895a2,_0x0429('0xf'));logger[_0x0429('0x10')](_0x0429('0x11'),_0x1895a2,_0x0429('0xf'),JSON[_0x0429('0x12')](_0x3d4dd6));if(_0x3d4dd6[_0x0429('0x13')]){if(_0x3d4dd6[_0x0429('0x13')]['code']===0x1f4){logger[_0x0429('0x13')]('Team,\x20%s,\x20%s',_0x1895a2,_0x3d4dd6[_0x0429('0x13')][_0x0429('0x14')]);return _0x1f21bc(_0x3d4dd6[_0x0429('0x13')][_0x0429('0x14')]);}logger[_0x0429('0x13')](_0x0429('0xe'),_0x1895a2,_0x3d4dd6[_0x0429('0x13')][_0x0429('0x14')]);return _0x6b28ed(_0x3d4dd6['error'][_0x0429('0x14')]);}else{logger[_0x0429('0x15')](_0x0429('0xe'),_0x1895a2,_0x0429('0xf'));_0x6b28ed(_0x3d4dd6[_0x0429('0x16')][_0x0429('0x14')]);}})[_0x0429('0x17')](function(_0xf17bff){logger[_0x0429('0x13')]('Team,\x20%s,\x20%s',_0x1895a2,_0xf17bff);_0x1f21bc(_0xf17bff);});});} \ No newline at end of file +var _0x2873=['request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Team,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./team.socket','register'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x2873,0x1f2));var _0x3287=function(_0x591fbb,_0x1f4133){_0x591fbb=_0x591fbb-0x0;var _0x11e944=_0x2873[_0x591fbb];return _0x11e944;};'use strict';var _=require(_0x3287('0x0'));var util=require(_0x3287('0x1'));var moment=require(_0x3287('0x2'));var BPromise=require(_0x3287('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3287('0x4'));var db=require(_0x3287('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3287('0x6'))(_0x3287('0x7'));var config=require('../../config/environment');var jayson=require(_0x3287('0x8'));var client=jayson[_0x3287('0x9')]['http']({'port':0x232a});config[_0x3287('0xa')]=_['defaults'](config[_0x3287('0xa')],{'host':_0x3287('0xb'),'port':0x18eb});var socket=require(_0x3287('0xc'))(new Redis(config[_0x3287('0xa')]));require(_0x3287('0xd'))[_0x3287('0xe')](socket);function respondWithRpcPromise(_0x3333d5,_0x5d0ec9,_0x29ecc6){return new BPromise(function(_0x1c342a,_0x22f28c){return client[_0x3287('0xf')](_0x3333d5,_0x29ecc6)[_0x3287('0x10')](function(_0x36081b){logger[_0x3287('0x11')]('Team,\x20%s,\x20%s',_0x5d0ec9,'request\x20sent');logger[_0x3287('0x12')](_0x3287('0x13'),_0x5d0ec9,_0x3287('0x14'),JSON[_0x3287('0x15')](_0x36081b));if(_0x36081b[_0x3287('0x16')]){if(_0x36081b['error'][_0x3287('0x17')]===0x1f4){logger[_0x3287('0x16')](_0x3287('0x18'),_0x5d0ec9,_0x36081b[_0x3287('0x16')]['message']);return _0x22f28c(_0x36081b[_0x3287('0x16')]['message']);}logger[_0x3287('0x16')](_0x3287('0x18'),_0x5d0ec9,_0x36081b[_0x3287('0x16')]['message']);return _0x1c342a(_0x36081b[_0x3287('0x16')][_0x3287('0x19')]);}else{logger[_0x3287('0x11')](_0x3287('0x18'),_0x5d0ec9,_0x3287('0x14'));_0x1c342a(_0x36081b['result']['message']);}})[_0x3287('0x1a')](function(_0x48b024){logger[_0x3287('0x16')]('Team,\x20%s,\x20%s',_0x5d0ec9,_0x48b024);_0x22f28c(_0x48b024);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2321bf7..151978a 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 _0x60a5=['update','emit','removeListener','register','team:','./team.events'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x60a5,0x83));var _0x560a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x60a5[_0x2dafbe];return _0x58a45a;};'use strict';var TeamEvents=require(_0x560a('0x0'));var events=['save','remove',_0x560a('0x1')];function createListener(_0x58528d,_0x4ebe35){return function(_0xc047a6){_0x4ebe35[_0x560a('0x2')](_0x58528d,_0xc047a6);};}function removeListener(_0xe97b87,_0x5f1104){return function(){TeamEvents[_0x560a('0x3')](_0xe97b87,_0x5f1104);};}exports[_0x560a('0x4')]=function(_0x3856ae){for(var _0x5aaec6=0x0,_0x52fa23=events['length'];_0x5aaec6<_0x52fa23;_0x5aaec6++){var _0x53a664=events[_0x5aaec6];var _0x3ac39e=createListener(_0x560a('0x5')+_0x53a664,_0x3856ae);TeamEvents['on'](_0x53a664,_0x3ac39e);}}; \ No newline at end of file +var _0xfcc8=['remove','update','removeListener','length','team:','./team.events','save'];(function(_0x41a797,_0x4378ae){var _0x297b7c=function(_0x4419b5){while(--_0x4419b5){_0x41a797['push'](_0x41a797['shift']());}};_0x297b7c(++_0x4378ae);}(_0xfcc8,0xb4));var _0x8fcc=function(_0xe5252b,_0x3377e8){_0xe5252b=_0xe5252b-0x0;var _0x17b964=_0xfcc8[_0xe5252b];return _0x17b964;};'use strict';var TeamEvents=require(_0x8fcc('0x0'));var events=[_0x8fcc('0x1'),_0x8fcc('0x2'),_0x8fcc('0x3')];function createListener(_0x5e3eb2,_0x39681c){return function(_0x5bed54){_0x39681c['emit'](_0x5e3eb2,_0x5bed54);};}function removeListener(_0x464bda,_0x5915c5){return function(){TeamEvents[_0x8fcc('0x4')](_0x464bda,_0x5915c5);};}exports['register']=function(_0x423ef8){for(var _0x22dec9=0x0,_0xd44c17=events[_0x8fcc('0x5')];_0x22dec9<_0xd44c17;_0x22dec9++){var _0x310cad=events[_0x22dec9];var _0x1c8b19=createListener(_0x8fcc('0x6')+_0x310cad,_0x423ef8);TeamEvents['on'](_0x310cad,_0x1c8b19);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 165c85e..35599c5 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d19=['sequelize','INTEGER'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7d19,0x9e));var _0x97d1=function(_0x2cd8a4,_0x51fb40){_0x2cd8a4=_0x2cd8a4-0x0;var _0x375630=_0x7d19[_0x2cd8a4];return _0x375630;};'use strict';var Sequelize=require(_0x97d1('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x97d1('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x97d1('0x1')]}}; \ No newline at end of file +var _0x2e78=['sequelize','exports','INTEGER'];(function(_0x4ea44b,_0x546b89){var _0x418cc9=function(_0x1eb1e5){while(--_0x1eb1e5){_0x4ea44b['push'](_0x4ea44b['shift']());}};_0x418cc9(++_0x546b89);}(_0x2e78,0xab));var _0x82e7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2e78[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x82e7('0x0'));module[_0x82e7('0x1')]={'TeamId':{'type':Sequelize[_0x82e7('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 6fe2f7c..42386bb 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x608a=['path','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4f653f,_0x6a5fb1){var _0x4ce5bd=function(_0x4ebcf8){while(--_0x4ebcf8){_0x4f653f['push'](_0x4f653f['shift']());}};_0x4ce5bd(++_0x6a5fb1);}(_0x608a,0xff));var _0xa608=function(_0x43b0d6,_0x565f5e){_0x43b0d6=_0x43b0d6-0x0;var _0xb62482=_0x608a[_0x43b0d6];return _0xb62482;};'use strict';var _=require('lodash');var util=require(_0xa608('0x0'));var logger=require(_0xa608('0x1'))('api');var moment=require(_0xa608('0x2'));var BPromise=require(_0xa608('0x3'));var rp=require(_0xa608('0x4'));var fs=require('fs');var path=require(_0xa608('0x5'));var rimraf=require('rimraf');var config=require(_0xa608('0x6'));var attributes=require(_0xa608('0x7'));module['exports']=function(_0x4e24d6,_0x3b0f4e){return _0x4e24d6['define'](_0xa608('0x8'),attributes,{'tableName':_0xa608('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa71a=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x4c9100,_0x37622e){var _0x276fc6=function(_0x102b72){while(--_0x102b72){_0x4c9100['push'](_0x4c9100['shift']());}};_0x276fc6(++_0x37622e);}(_0xa71a,0xf1));var _0xaa71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa71a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaa71('0x0'));var util=require(_0xaa71('0x1'));var logger=require(_0xaa71('0x2'))(_0xaa71('0x3'));var moment=require('moment');var BPromise=require(_0xaa71('0x4'));var rp=require(_0xaa71('0x5'));var fs=require('fs');var path=require(_0xaa71('0x6'));var rimraf=require('rimraf');var config=require(_0xaa71('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0xaa71('0x8')]=function(_0x2f476b,_0x1f07bd){return _0x2f476b['define'](_0xaa71('0x9'),attributes,{'tableName':_0xaa71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index e8ce8cf..f504840 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x253ed4,_0x342aca){var _0x22df23=function(_0x5ebbfa){while(--_0x5ebbfa){_0x253ed4['push'](_0x253ed4['shift']());}};_0x22df23(++_0x342aca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1feefe,_0x2018ad){var _0x56471a=function(_0x8745df){while(--_0x8745df){_0x1feefe['push'](_0x1feefe['shift']());}};_0x56471a(++_0x2018ad);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index d75bed5..9006424 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 _0x89ca=['sequelize'];(function(_0x4c3296,_0x262566){var _0x5260de=function(_0x2543c6){while(--_0x2543c6){_0x4c3296['push'](_0x4c3296['shift']());}};_0x5260de(++_0x262566);}(_0x89ca,0xe3));var _0xa89c=function(_0x285a0e,_0x13b8e5){_0x285a0e=_0x285a0e-0x0;var _0x39018f=_0x89ca[_0x285a0e];return _0x39018f;};'use strict';var Sequelize=require(_0xa89c('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 bd448b2..6da4be0 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 _0xefbf=['./teamVoiceQueue.attributes','define','TeamVoiceQueue','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5f0c67,_0xc0e2c8){var _0x119e60=function(_0x260054){while(--_0x260054){_0x5f0c67['push'](_0x5f0c67['shift']());}};_0x119e60(++_0xc0e2c8);}(_0xefbf,0xa3));var _0xfefb=function(_0x33bd66,_0x656d68){_0x33bd66=_0x33bd66-0x0;var _0x55987b=_0xefbf[_0x33bd66];return _0x55987b;};'use strict';var _=require(_0xfefb('0x0'));var util=require(_0xfefb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfefb('0x2'));var rp=require(_0xfefb('0x3'));var fs=require('fs');var path=require(_0xfefb('0x4'));var rimraf=require(_0xfefb('0x5'));var config=require(_0xfefb('0x6'));var attributes=require(_0xfefb('0x7'));module['exports']=function(_0xaac208,_0x58c767){return _0xaac208[_0xfefb('0x8')](_0xfefb('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfaec=['./teamVoiceQueue.attributes','define','team_has_voice_queues','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x4eb269,_0x3cd1b6){var _0x1597b8=function(_0x527f9d){while(--_0x527f9d){_0x4eb269['push'](_0x4eb269['shift']());}};_0x1597b8(++_0x3cd1b6);}(_0xfaec,0x12f));var _0xcfae=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfaec[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcfae('0x0'));var util=require(_0xcfae('0x1'));var logger=require(_0xcfae('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcfae('0x3'));var fs=require('fs');var path=require(_0xcfae('0x4'));var rimraf=require(_0xcfae('0x5'));var config=require(_0xcfae('0x6'));var attributes=require(_0xcfae('0x7'));module['exports']=function(_0x5dcf1e,_0x31e193){return _0x5dcf1e[_0xcfae('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0xcfae('0x9'),'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 6ea5502..9dd69e2 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 _0xea10=['error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4a3971,_0x3fe958){var _0x1db582=function(_0x1377cb){while(--_0x1377cb){_0x4a3971['push'](_0x4a3971['shift']());}};_0x1db582(++_0x3fe958);}(_0xea10,0x1d2));var _0x0ea1=function(_0x533b7d,_0x38dc92){_0x533b7d=_0x533b7d-0x0;var _0x2fc804=_0xea10[_0x533b7d];return _0x2fc804;};'use strict';var _=require(_0x0ea1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0ea1('0x1'));var rs=require(_0x0ea1('0x2'));var fs=require('fs');var Redis=require(_0x0ea1('0x3'));var db=require(_0x0ea1('0x4'))['db'];var utils=require(_0x0ea1('0x5'));var logger=require('../../config/logger')(_0x0ea1('0x6'));var config=require(_0x0ea1('0x7'));var jayson=require(_0x0ea1('0x8'));var client=jayson[_0x0ea1('0x9')][_0x0ea1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e5679,_0x374af5,_0x5cd631){return new BPromise(function(_0x3cc085,_0x571eec){return client[_0x0ea1('0xb')](_0x2e5679,_0x5cd631)['then'](function(_0xb65d0a){logger[_0x0ea1('0xc')](_0x0ea1('0xd'),_0x374af5,_0x0ea1('0xe'));logger[_0x0ea1('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x374af5,_0x0ea1('0xe'),JSON[_0x0ea1('0x10')](_0xb65d0a));if(_0xb65d0a[_0x0ea1('0x11')]){if(_0xb65d0a[_0x0ea1('0x11')]['code']===0x1f4){logger[_0x0ea1('0x11')](_0x0ea1('0xd'),_0x374af5,_0xb65d0a[_0x0ea1('0x11')][_0x0ea1('0x12')]);return _0x571eec(_0xb65d0a[_0x0ea1('0x11')]['message']);}logger[_0x0ea1('0x11')](_0x0ea1('0xd'),_0x374af5,_0xb65d0a[_0x0ea1('0x11')][_0x0ea1('0x12')]);return _0x3cc085(_0xb65d0a[_0x0ea1('0x11')][_0x0ea1('0x12')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x374af5,_0x0ea1('0xe'));_0x3cc085(_0xb65d0a[_0x0ea1('0x13')]['message']);}})[_0x0ea1('0x14')](function(_0x3ffdfd){logger[_0x0ea1('0x11')](_0x0ea1('0xd'),_0x374af5,_0x3ffdfd);_0x571eec(_0x3ffdfd);});});} \ No newline at end of file +var _0xbe7c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','util'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xbe7c,0x108));var _0xcbe7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe7c[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xcbe7('0x0'));var util=require(_0xcbe7('0x1'));var moment=require(_0xcbe7('0x2'));var BPromise=require(_0xcbe7('0x3'));var rs=require(_0xcbe7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbe7('0x5'))['db'];var utils=require(_0xcbe7('0x6'));var logger=require('../../config/logger')(_0xcbe7('0x7'));var config=require(_0xcbe7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcbe7('0x9')][_0xcbe7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x466b19,_0x4b7021,_0x673d55){return new BPromise(function(_0x1e1bff,_0x246aad){return client['request'](_0x466b19,_0x673d55)[_0xcbe7('0xb')](function(_0x47820a){logger[_0xcbe7('0xc')](_0xcbe7('0xd'),_0x4b7021,_0xcbe7('0xe'));logger[_0xcbe7('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4b7021,_0xcbe7('0xe'),JSON['stringify'](_0x47820a));if(_0x47820a['error']){if(_0x47820a[_0xcbe7('0x10')][_0xcbe7('0x11')]===0x1f4){logger[_0xcbe7('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4b7021,_0x47820a[_0xcbe7('0x10')]['message']);return _0x246aad(_0x47820a[_0xcbe7('0x10')][_0xcbe7('0x12')]);}logger[_0xcbe7('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4b7021,_0x47820a[_0xcbe7('0x10')][_0xcbe7('0x12')]);return _0x1e1bff(_0x47820a['error'][_0xcbe7('0x12')]);}else{logger[_0xcbe7('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4b7021,_0xcbe7('0xe'));_0x1e1bff(_0x47820a['result'][_0xcbe7('0x12')]);}})['catch'](function(_0x391d35){logger['error'](_0xcbe7('0xd'),_0x4b7021,_0x391d35);_0x246aad(_0x391d35);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 692a37f..bd1fbbb 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 _0xd9eb=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x17349c,_0x53c5db){var _0x37044a=function(_0x366404){while(--_0x366404){_0x17349c['push'](_0x17349c['shift']());}};_0x37044a(++_0x53c5db);}(_0xd9eb,0xca));var _0xbd9e=function(_0x5d10c2,_0x4b0a49){_0x5d10c2=_0x5d10c2-0x0;var _0x57c7c4=_0xd9eb[_0x5d10c2];return _0x57c7c4;};'use strict';var multer=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var path=require(_0xbd9e('0x2'));var timeout=require(_0xbd9e('0x3'));var express=require(_0xbd9e('0x4'));var router=express[_0xbd9e('0x5')]();var fs_extra=require(_0xbd9e('0x6'));var auth=require(_0xbd9e('0x7'));var interaction=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var controller=require(_0xbd9e('0xa'));router[_0xbd9e('0xb')]('/',auth[_0xbd9e('0xc')](),controller['index']);router[_0xbd9e('0xb')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0xe')]);router[_0xbd9e('0xf')]('/',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x10')]);router[_0xbd9e('0x11')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x12')]);router[_0xbd9e('0x13')]('/:id',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0a1c=['show','post','create','put','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x1ec92b,_0x2adfc3){var _0x3e9ac2=function(_0x55d289){while(--_0x55d289){_0x1ec92b['push'](_0x1ec92b['shift']());}};_0x3e9ac2(++_0x2adfc3);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x0a1c[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc0a1('0x0'));var timeout=require(_0xc0a1('0x1'));var express=require(_0xc0a1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc0a1('0x3'));var interaction=require(_0xc0a1('0x4'));var config=require(_0xc0a1('0x5'));var controller=require(_0xc0a1('0x6'));router[_0xc0a1('0x7')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0x9')]);router[_0xc0a1('0x7')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xb')]);router[_0xc0a1('0xc')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xd')]);router[_0xc0a1('0xe')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['update']);router[_0xc0a1('0xf')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['destroy']);module[_0xc0a1('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index a61353d..23aa864 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 _0xd8c9=['sequelize','STRING','TEXT'];(function(_0x15821d,_0x3d3029){var _0x5e443c=function(_0x23bc30){while(--_0x23bc30){_0x15821d['push'](_0x15821d['shift']());}};_0x5e443c(++_0x3d3029);}(_0xd8c9,0x132));var _0x9d8c=function(_0x27b73d,_0x4e13c6){_0x27b73d=_0x27b73d-0x0;var _0x7d30c3=_0xd8c9[_0x27b73d];return _0x7d30c3;};'use strict';var Sequelize=require(_0x9d8c('0x0'));module['exports']={'name':{'type':Sequelize[_0x9d8c('0x1')]},'description':{'type':Sequelize[_0x9d8c('0x1')]},'html':{'type':Sequelize[_0x9d8c('0x2')]}}; \ No newline at end of file +var _0x8d98=['sequelize','STRING','TEXT'];(function(_0x23f0e1,_0x11d94b){var _0x257f0d=function(_0xab63c7){while(--_0xab63c7){_0x23f0e1['push'](_0x23f0e1['shift']());}};_0x257f0d(++_0x11d94b);}(_0x8d98,0xd5));var _0x88d9=function(_0x3f5389,_0x55588e){_0x3f5389=_0x3f5389-0x0;var _0x1734a4=_0x8d98[_0x3f5389];return _0x1734a4;};'use strict';var Sequelize=require(_0x88d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x88d9('0x1')]},'description':{'type':Sequelize[_0x88d9('0x1')]},'html':{'type':Sequelize[_0x88d9('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 3845655..670320c 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 _0x909d=['options','then','includeAll','rows','show','params','include','find','create','body','user','role','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Templates','stack','name','map','Template','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL'];(function(_0x5dfacb,_0x112487){var _0x367f33=function(_0x28b8d8){while(--_0x28b8d8){_0x5dfacb['push'](_0x5dfacb['shift']());}};_0x367f33(++_0x112487);}(_0x909d,0x194));var _0xd909=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x909d[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xd909('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd909('0x1'));var jsonpatch=require(_0xd909('0x2'));var rp=require(_0xd909('0x3'));var moment=require(_0xd909('0x4'));var BPromise=require(_0xd909('0x5'));var Mustache=require(_0xd909('0x6'));var util=require(_0xd909('0x7'));var path=require(_0xd909('0x8'));var sox=require(_0xd909('0x9'));var csv=require('to-csv');var ejs=require(_0xd909('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd909('0xb'));var squel=require(_0xd909('0xc'));var crypto=require(_0xd909('0xd'));var jsforce=require(_0xd909('0xe'));var deskjs=require(_0xd909('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd909('0x10'));var Redis=require(_0xd909('0x11'));var authService=require(_0xd909('0x12'));var qs=require(_0xd909('0x13'));var as=require(_0xd909('0x14'));var hardwareService=require(_0xd909('0x15'));var logger=require(_0xd909('0x16'))(_0xd909('0x17'));var utils=require(_0xd909('0x18'));var config=require(_0xd909('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd909('0x1a'))['db'];function respondWithStatusCode(_0x1d1b1f,_0x4421b4){_0x4421b4=_0x4421b4||0xcc;return function(_0x16bf06){if(_0x16bf06){return _0x1d1b1f[_0xd909('0x1b')](_0x4421b4);}return _0x1d1b1f[_0xd909('0x1c')](_0x4421b4)['end']();};}function respondWithResult(_0x537e15,_0x2153e0){_0x2153e0=_0x2153e0||0xc8;return function(_0x55b6ff){if(_0x55b6ff){return _0x537e15['status'](_0x2153e0)[_0xd909('0x1d')](_0x55b6ff);}};}function respondWithFilteredResult(_0x910f88,_0x1f86eb){return function(_0x16ae54){if(_0x16ae54){var _0x26ad13=typeof _0x1f86eb[_0xd909('0x1e')]===_0xd909('0x1f')&&typeof _0x1f86eb[_0xd909('0x20')]==='undefined';var _0x1e16b4=_0x16ae54[_0xd909('0x21')];var _0x10746a=_0x26ad13?0x0:_0x1f86eb[_0xd909('0x1e')];var _0x35e96d=_0x26ad13?_0x16ae54[_0xd909('0x21')]:_0x1f86eb[_0xd909('0x1e')]+_0x1f86eb[_0xd909('0x20')];var _0x160694;if(_0x35e96d>=_0x1e16b4){_0x35e96d=_0x1e16b4;_0x160694=0xc8;}else{_0x160694=0xce;}_0x910f88[_0xd909('0x1c')](_0x160694);return _0x910f88[_0xd909('0x22')](_0xd909('0x23'),_0x10746a+'-'+_0x35e96d+'/'+_0x1e16b4)[_0xd909('0x1d')](_0x16ae54);}return null;};}function patchUpdates(_0x3fc99d){return function(_0x1138c6){try{jsonpatch[_0xd909('0x24')](_0x1138c6,_0x3fc99d,!![]);}catch(_0x2b49cd){return BPromise[_0xd909('0x25')](_0x2b49cd);}return _0x1138c6[_0xd909('0x26')]();};}function saveUpdates(_0x391829,_0x200a0){return function(_0x32af1c){if(_0x32af1c){return _0x32af1c[_0xd909('0x27')](_0x391829)['then'](function(_0x3a1684){return _0x3a1684;});}return null;};}function removeEntity(_0x1d6ec1,_0x2e84bf){return function(_0x1b1c0a){if(_0x1b1c0a){return _0x1b1c0a['destroy']()['then'](function(){var _0xc709db=_0x1b1c0a[_0xd909('0x28')]({'plain':!![]});var _0x28d2a3=_0xd909('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x28d2a3,'resourceId':_0xc709db['id']}})['then'](function(){return _0x1b1c0a;});})['then'](function(){_0x1d6ec1[_0xd909('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b9396,_0x2951a8){return function(_0x754a5e){if(!_0x754a5e){_0x4b9396[_0xd909('0x1b')](0x194);}return _0x754a5e;};}function handleError(_0x3e010b,_0x26227f){_0x26227f=_0x26227f||0x1f4;return function(_0x5aa07b){logger['error'](_0x5aa07b[_0xd909('0x2a')]);if(_0x5aa07b[_0xd909('0x2b')]){delete _0x5aa07b[_0xd909('0x2b')];}_0x3e010b['status'](_0x26227f)['send'](_0x5aa07b);};}exports['index']=function(_0x37c19b,_0x355975){var _0x44d9dc={},_0x363135={},_0x4c70d3={'count':0x0,'rows':[]};var _0x1d63fe=_[_0xd909('0x2c')](db[_0xd909('0x2d')][_0xd909('0x2e')],function(_0x2272b4){return{'name':_0x2272b4[_0xd909('0x2f')],'type':_0x2272b4['type']['key']};});_0x363135[_0xd909('0x30')]=_[_0xd909('0x2c')](_0x1d63fe,'name');_0x363135['query']=_[_0xd909('0x31')](_0x37c19b[_0xd909('0x32')]);_0x363135['filters']=_['intersection'](_0x363135[_0xd909('0x30')],_0x363135[_0xd909('0x32')]);_0x44d9dc[_0xd909('0x33')]=_[_0xd909('0x34')](_0x363135[_0xd909('0x30')],qs['fields'](_0x37c19b['query'][_0xd909('0x35')]));_0x44d9dc[_0xd909('0x33')]=_0x44d9dc[_0xd909('0x33')][_0xd909('0x36')]?_0x44d9dc[_0xd909('0x33')]:_0x363135[_0xd909('0x30')];if(!_0x37c19b[_0xd909('0x32')]['hasOwnProperty'](_0xd909('0x37'))){_0x44d9dc[_0xd909('0x20')]=qs[_0xd909('0x20')](_0x37c19b['query'][_0xd909('0x20')]);_0x44d9dc['offset']=qs[_0xd909('0x1e')](_0x37c19b['query'][_0xd909('0x1e')]);}_0x44d9dc[_0xd909('0x38')]=qs['sort'](_0x37c19b[_0xd909('0x32')][_0xd909('0x39')]);_0x44d9dc[_0xd909('0x3a')]=qs[_0xd909('0x3b')](_['pick'](_0x37c19b['query'],_0x363135['filters']),_0x1d63fe);if(_0x37c19b['query'][_0xd909('0x3c')]){_0x44d9dc['where']=_[_0xd909('0x3d')](_0x44d9dc[_0xd909('0x3a')],{'$or':_[_0xd909('0x2c')](_0x1d63fe,function(_0x2af6e6){if(_0x2af6e6[_0xd909('0x3e')]!==_0xd909('0x3f')){var _0x490f01={};_0x490f01[_0x2af6e6[_0xd909('0x2b')]]={'$like':'%'+_0x37c19b[_0xd909('0x32')][_0xd909('0x3c')]+'%'};return _0x490f01;}})});}_0x44d9dc=_['merge']({},_0x44d9dc,_0x37c19b[_0xd909('0x40')]);var _0x232961={'where':_0x44d9dc[_0xd909('0x3a')]};return db[_0xd909('0x2d')]['count'](_0x232961)[_0xd909('0x41')](function(_0x43cf90){_0x4c70d3[_0xd909('0x21')]=_0x43cf90;if(_0x37c19b['query'][_0xd909('0x42')]){_0x44d9dc['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x44d9dc);})['then'](function(_0x5379d4){_0x4c70d3[_0xd909('0x43')]=_0x5379d4;return _0x4c70d3;})[_0xd909('0x41')](respondWithFilteredResult(_0x355975,_0x44d9dc))['catch'](handleError(_0x355975,null));};exports[_0xd909('0x44')]=function(_0x3d0954,_0x14f43e){var _0x2d05e6={'raw':!![],'where':{'id':_0x3d0954[_0xd909('0x45')]['id']}},_0x82aa1={};_0x82aa1[_0xd909('0x30')]=_['keys'](db[_0xd909('0x2d')][_0xd909('0x2e')]);_0x82aa1[_0xd909('0x32')]=_[_0xd909('0x31')](_0x3d0954[_0xd909('0x32')]);_0x82aa1[_0xd909('0x3b')]=_[_0xd909('0x34')](_0x82aa1['model'],_0x82aa1[_0xd909('0x32')]);_0x2d05e6[_0xd909('0x33')]=_[_0xd909('0x34')](_0x82aa1[_0xd909('0x30')],qs['fields'](_0x3d0954[_0xd909('0x32')]['fields']));_0x2d05e6[_0xd909('0x33')]=_0x2d05e6['attributes']['length']?_0x2d05e6[_0xd909('0x33')]:_0x82aa1[_0xd909('0x30')];if(_0x3d0954[_0xd909('0x32')]['includeAll']){_0x2d05e6[_0xd909('0x46')]=[{'all':!![]}];}_0x2d05e6=_[_0xd909('0x3d')]({},_0x2d05e6,_0x3d0954['options']);return db[_0xd909('0x2d')][_0xd909('0x47')](_0x2d05e6)[_0xd909('0x41')](handleEntityNotFound(_0x14f43e,null))[_0xd909('0x41')](respondWithResult(_0x14f43e,null))['catch'](handleError(_0x14f43e,null));};exports[_0xd909('0x48')]=function(_0x20f1dd,_0x3c0a65){return db[_0xd909('0x2d')]['create'](_0x20f1dd[_0xd909('0x49')],{})[_0xd909('0x41')](function(_0x103ee9){var _0x3e9ece=_0x20f1dd[_0xd909('0x4a')][_0xd909('0x28')]({'plain':!![]});if(!_0x3e9ece)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9ece[_0xd909('0x4b')]===_0xd909('0x4a')){var _0x292760=_0x103ee9[_0xd909('0x28')]({'plain':!![]});var _0x5b2941=_0xd909('0x29');return db['UserProfileSection'][_0xd909('0x47')]({'where':{'name':_0x5b2941,'userProfileId':_0x3e9ece['userProfileId']},'raw':!![]})['then'](function(_0x26a7ef){if(_0x26a7ef&&_0x26a7ef['autoAssociation']===0x0){return db['UserProfileResource'][_0xd909('0x48')]({'name':_0x292760['name'],'resourceId':_0x292760['id'],'type':_0x26a7ef[_0xd909('0x2b')],'sectionId':_0x26a7ef['id']},{})[_0xd909('0x41')](function(){return _0x103ee9;});}else{return _0x103ee9;}})[_0xd909('0x4c')](function(_0x33f148){logger['error'](_0xd909('0x4d'),_0x33f148);throw _0x33f148;});}return _0x103ee9;})[_0xd909('0x41')](respondWithResult(_0x3c0a65,0xc9))[_0xd909('0x4c')](handleError(_0x3c0a65,null));};exports[_0xd909('0x27')]=function(_0x50ee07,_0x159e9e){if(_0x50ee07[_0xd909('0x49')]['id']){delete _0x50ee07[_0xd909('0x49')]['id'];}return db[_0xd909('0x2d')]['find']({'where':{'id':_0x50ee07[_0xd909('0x45')]['id']}})[_0xd909('0x41')](handleEntityNotFound(_0x159e9e,null))[_0xd909('0x41')](saveUpdates(_0x50ee07[_0xd909('0x49')],null))[_0xd909('0x41')](respondWithResult(_0x159e9e,null))['catch'](handleError(_0x159e9e,null));};exports['destroy']=function(_0x1938f1,_0x5c08e2){return db['Template']['find']({'where':{'id':_0x1938f1[_0xd909('0x45')]['id']}})[_0xd909('0x41')](handleEntityNotFound(_0x5c08e2,null))[_0xd909('0x41')](removeEntity(_0x5c08e2,null))['catch'](handleError(_0x5c08e2,null));}; \ No newline at end of file +var _0xbee9=['filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Templates','UserProfileResource','error','name','send','index','map','Template','fieldName','type','key','model','query','keys'];(function(_0x150762,_0xd8e082){var _0x232767=function(_0x570e88){while(--_0x570e88){_0x150762['push'](_0x150762['shift']());}};_0x232767(++_0xd8e082);}(_0xbee9,0x145));var _0x9bee=function(_0x3f5fc8,_0x4f4379){_0x3f5fc8=_0x3f5fc8-0x0;var _0x529645=_0xbee9[_0x3f5fc8];return _0x529645;};'use strict';var emlformat=require(_0x9bee('0x0'));var rimraf=require(_0x9bee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bee('0x2'));var rp=require('request-promise');var moment=require(_0x9bee('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9bee('0x4'));var path=require('path');var sox=require(_0x9bee('0x5'));var csv=require(_0x9bee('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bee('0x7'));var _=require(_0x9bee('0x8'));var squel=require(_0x9bee('0x9'));var crypto=require(_0x9bee('0xa'));var jsforce=require(_0x9bee('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9bee('0xc'));var Redis=require('ioredis');var authService=require(_0x9bee('0xd'));var qs=require(_0x9bee('0xe'));var as=require(_0x9bee('0xf'));var hardwareService=require(_0x9bee('0x10'));var logger=require('../../config/logger')(_0x9bee('0x11'));var utils=require(_0x9bee('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9bee('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71668f,_0x2b8e50){_0x2b8e50=_0x2b8e50||0xcc;return function(_0x497716){if(_0x497716){return _0x71668f[_0x9bee('0x14')](_0x2b8e50);}return _0x71668f['status'](_0x2b8e50)[_0x9bee('0x15')]();};}function respondWithResult(_0x6adcdf,_0x37c366){_0x37c366=_0x37c366||0xc8;return function(_0x5fddbc){if(_0x5fddbc){return _0x6adcdf[_0x9bee('0x16')](_0x37c366)[_0x9bee('0x17')](_0x5fddbc);}};}function respondWithFilteredResult(_0x364505,_0x43011a){return function(_0x5a3a4d){if(_0x5a3a4d){var _0x5bec85=typeof _0x43011a[_0x9bee('0x18')]===_0x9bee('0x19')&&typeof _0x43011a['limit']===_0x9bee('0x19');var _0x4eb669=_0x5a3a4d[_0x9bee('0x1a')];var _0x1d870d=_0x5bec85?0x0:_0x43011a[_0x9bee('0x18')];var _0x13d0eb=_0x5bec85?_0x5a3a4d[_0x9bee('0x1a')]:_0x43011a[_0x9bee('0x18')]+_0x43011a[_0x9bee('0x1b')];var _0x3f5fad;if(_0x13d0eb>=_0x4eb669){_0x13d0eb=_0x4eb669;_0x3f5fad=0xc8;}else{_0x3f5fad=0xce;}_0x364505['status'](_0x3f5fad);return _0x364505[_0x9bee('0x1c')](_0x9bee('0x1d'),_0x1d870d+'-'+_0x13d0eb+'/'+_0x4eb669)[_0x9bee('0x17')](_0x5a3a4d);}return null;};}function patchUpdates(_0x2df288){return function(_0x12f135){try{jsonpatch[_0x9bee('0x1e')](_0x12f135,_0x2df288,!![]);}catch(_0x38c470){return BPromise[_0x9bee('0x1f')](_0x38c470);}return _0x12f135[_0x9bee('0x20')]();};}function saveUpdates(_0x20195a,_0x5be9c4){return function(_0x1dfc61){if(_0x1dfc61){return _0x1dfc61['update'](_0x20195a)[_0x9bee('0x21')](function(_0x568630){return _0x568630;});}return null;};}function removeEntity(_0x27ef5c,_0x2e6d0b){return function(_0x81f101){if(_0x81f101){return _0x81f101[_0x9bee('0x22')]()[_0x9bee('0x21')](function(){var _0x40abaa=_0x81f101[_0x9bee('0x23')]({'plain':!![]});var _0x334a24=_0x9bee('0x24');return db[_0x9bee('0x25')]['destroy']({'where':{'type':_0x334a24,'resourceId':_0x40abaa['id']}})['then'](function(){return _0x81f101;});})['then'](function(){_0x27ef5c[_0x9bee('0x16')](0xcc)[_0x9bee('0x15')]();});}};}function handleEntityNotFound(_0x587062,_0x1ee81a){return function(_0xf08176){if(!_0xf08176){_0x587062[_0x9bee('0x14')](0x194);}return _0xf08176;};}function handleError(_0x4dc28e,_0x1eff8c){_0x1eff8c=_0x1eff8c||0x1f4;return function(_0x48867e){logger[_0x9bee('0x26')](_0x48867e['stack']);if(_0x48867e[_0x9bee('0x27')]){delete _0x48867e[_0x9bee('0x27')];}_0x4dc28e['status'](_0x1eff8c)[_0x9bee('0x28')](_0x48867e);};}exports[_0x9bee('0x29')]=function(_0x513f8b,_0x13386d){var _0x4336d6={},_0x5d2ef3={},_0xceb708={'count':0x0,'rows':[]};var _0x31cb21=_[_0x9bee('0x2a')](db[_0x9bee('0x2b')]['rawAttributes'],function(_0x3b7833){return{'name':_0x3b7833[_0x9bee('0x2c')],'type':_0x3b7833[_0x9bee('0x2d')][_0x9bee('0x2e')]};});_0x5d2ef3[_0x9bee('0x2f')]=_[_0x9bee('0x2a')](_0x31cb21,_0x9bee('0x27'));_0x5d2ef3[_0x9bee('0x30')]=_[_0x9bee('0x31')](_0x513f8b[_0x9bee('0x30')]);_0x5d2ef3[_0x9bee('0x32')]=_[_0x9bee('0x33')](_0x5d2ef3[_0x9bee('0x2f')],_0x5d2ef3[_0x9bee('0x30')]);_0x4336d6[_0x9bee('0x34')]=_['intersection'](_0x5d2ef3[_0x9bee('0x2f')],qs[_0x9bee('0x35')](_0x513f8b[_0x9bee('0x30')]['fields']));_0x4336d6[_0x9bee('0x34')]=_0x4336d6[_0x9bee('0x34')][_0x9bee('0x36')]?_0x4336d6[_0x9bee('0x34')]:_0x5d2ef3[_0x9bee('0x2f')];if(!_0x513f8b[_0x9bee('0x30')]['hasOwnProperty']('nolimit')){_0x4336d6[_0x9bee('0x1b')]=qs[_0x9bee('0x1b')](_0x513f8b[_0x9bee('0x30')][_0x9bee('0x1b')]);_0x4336d6[_0x9bee('0x18')]=qs[_0x9bee('0x18')](_0x513f8b[_0x9bee('0x30')][_0x9bee('0x18')]);}_0x4336d6[_0x9bee('0x37')]=qs[_0x9bee('0x38')](_0x513f8b['query'][_0x9bee('0x38')]);_0x4336d6[_0x9bee('0x39')]=qs['filters'](_[_0x9bee('0x3a')](_0x513f8b['query'],_0x5d2ef3[_0x9bee('0x32')]),_0x31cb21);if(_0x513f8b[_0x9bee('0x30')][_0x9bee('0x3b')]){_0x4336d6[_0x9bee('0x39')]=_[_0x9bee('0x3c')](_0x4336d6[_0x9bee('0x39')],{'$or':_[_0x9bee('0x2a')](_0x31cb21,function(_0x2a21ed){if(_0x2a21ed[_0x9bee('0x2d')]!=='VIRTUAL'){var _0x46cc9a={};_0x46cc9a[_0x2a21ed[_0x9bee('0x27')]]={'$like':'%'+_0x513f8b[_0x9bee('0x30')][_0x9bee('0x3b')]+'%'};return _0x46cc9a;}})});}_0x4336d6=_['merge']({},_0x4336d6,_0x513f8b['options']);var _0x218d21={'where':_0x4336d6[_0x9bee('0x39')]};return db[_0x9bee('0x2b')][_0x9bee('0x1a')](_0x218d21)[_0x9bee('0x21')](function(_0x524f4d){_0xceb708['count']=_0x524f4d;if(_0x513f8b[_0x9bee('0x30')]['includeAll']){_0x4336d6['include']=[{'all':!![]}];}return db[_0x9bee('0x2b')]['findAll'](_0x4336d6);})[_0x9bee('0x21')](function(_0x2d8ea0){_0xceb708[_0x9bee('0x3d')]=_0x2d8ea0;return _0xceb708;})[_0x9bee('0x21')](respondWithFilteredResult(_0x13386d,_0x4336d6))[_0x9bee('0x3e')](handleError(_0x13386d,null));};exports[_0x9bee('0x3f')]=function(_0x5765bf,_0x555756){var _0x3c86e8={'raw':!![],'where':{'id':_0x5765bf[_0x9bee('0x40')]['id']}},_0x510ca7={};_0x510ca7[_0x9bee('0x2f')]=_[_0x9bee('0x31')](db[_0x9bee('0x2b')]['rawAttributes']);_0x510ca7[_0x9bee('0x30')]=_[_0x9bee('0x31')](_0x5765bf[_0x9bee('0x30')]);_0x510ca7['filters']=_[_0x9bee('0x33')](_0x510ca7[_0x9bee('0x2f')],_0x510ca7[_0x9bee('0x30')]);_0x3c86e8[_0x9bee('0x34')]=_[_0x9bee('0x33')](_0x510ca7[_0x9bee('0x2f')],qs['fields'](_0x5765bf['query'][_0x9bee('0x35')]));_0x3c86e8[_0x9bee('0x34')]=_0x3c86e8[_0x9bee('0x34')][_0x9bee('0x36')]?_0x3c86e8[_0x9bee('0x34')]:_0x510ca7[_0x9bee('0x2f')];if(_0x5765bf[_0x9bee('0x30')][_0x9bee('0x41')]){_0x3c86e8[_0x9bee('0x42')]=[{'all':!![]}];}_0x3c86e8=_['merge']({},_0x3c86e8,_0x5765bf['options']);return db[_0x9bee('0x2b')][_0x9bee('0x43')](_0x3c86e8)[_0x9bee('0x21')](handleEntityNotFound(_0x555756,null))[_0x9bee('0x21')](respondWithResult(_0x555756,null))[_0x9bee('0x3e')](handleError(_0x555756,null));};exports[_0x9bee('0x44')]=function(_0x1769f6,_0x1b106f){return db[_0x9bee('0x2b')][_0x9bee('0x44')](_0x1769f6[_0x9bee('0x45')],{})[_0x9bee('0x21')](function(_0x2b9227){var _0x2c0eec=_0x1769f6[_0x9bee('0x46')][_0x9bee('0x23')]({'plain':!![]});if(!_0x2c0eec)throw new Error(_0x9bee('0x47'));if(_0x2c0eec['role']===_0x9bee('0x46')){var _0x366a88=_0x2b9227[_0x9bee('0x23')]({'plain':!![]});var _0x263463=_0x9bee('0x24');return db['UserProfileSection'][_0x9bee('0x43')]({'where':{'name':_0x263463,'userProfileId':_0x2c0eec[_0x9bee('0x48')]},'raw':!![]})['then'](function(_0x43e284){if(_0x43e284&&_0x43e284[_0x9bee('0x49')]===0x0){return db[_0x9bee('0x25')][_0x9bee('0x44')]({'name':_0x366a88[_0x9bee('0x27')],'resourceId':_0x366a88['id'],'type':_0x43e284['name'],'sectionId':_0x43e284['id']},{})[_0x9bee('0x21')](function(){return _0x2b9227;});}else{return _0x2b9227;}})[_0x9bee('0x3e')](function(_0x3135ce){logger[_0x9bee('0x26')](_0x9bee('0x4a'),_0x3135ce);throw _0x3135ce;});}return _0x2b9227;})['then'](respondWithResult(_0x1b106f,0xc9))['catch'](handleError(_0x1b106f,null));};exports['update']=function(_0x405f8a,_0x529aa7){if(_0x405f8a['body']['id']){delete _0x405f8a['body']['id'];}return db[_0x9bee('0x2b')][_0x9bee('0x43')]({'where':{'id':_0x405f8a[_0x9bee('0x40')]['id']}})[_0x9bee('0x21')](handleEntityNotFound(_0x529aa7,null))[_0x9bee('0x21')](saveUpdates(_0x405f8a['body'],null))['then'](respondWithResult(_0x529aa7,null))['catch'](handleError(_0x529aa7,null));};exports[_0x9bee('0x22')]=function(_0x17fdf5,_0x35c61e){return db['Template'][_0x9bee('0x43')]({'where':{'id':_0x17fdf5[_0x9bee('0x40')]['id']}})[_0x9bee('0x21')](handleEntityNotFound(_0x35c61e,null))[_0x9bee('0x21')](removeEntity(_0x35c61e,null))['catch'](handleError(_0x35c61e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c4e893a..737f7b3 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 _0x8d25=['request-promise','path','exports','define','Template','tools_templates','lodash','util','api','moment','bluebird'];(function(_0x2cc8bb,_0x5f2607){var _0x140e40=function(_0x80d96d){while(--_0x80d96d){_0x2cc8bb['push'](_0x2cc8bb['shift']());}};_0x140e40(++_0x5f2607);}(_0x8d25,0xd7));var _0x58d2=function(_0x25134a,_0x347ce7){_0x25134a=_0x25134a-0x0;var _0x559d35=_0x8d25[_0x25134a];return _0x559d35;};'use strict';var _=require(_0x58d2('0x0'));var util=require(_0x58d2('0x1'));var logger=require('../../config/logger')(_0x58d2('0x2'));var moment=require(_0x58d2('0x3'));var BPromise=require(_0x58d2('0x4'));var rp=require(_0x58d2('0x5'));var fs=require('fs');var path=require(_0x58d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x58d2('0x7')]=function(_0x21d7bb,_0x5392a9){return _0x21d7bb[_0x58d2('0x8')](_0x58d2('0x9'),attributes,{'tableName':_0x58d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ab7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ab7,0xb2));var _0x75ab=function(_0x9230a2,_0x255d18){_0x9230a2=_0x9230a2-0x0;var _0x5c00dd=_0x5ab7[_0x9230a2];return _0x5c00dd;};'use strict';var _=require(_0x75ab('0x0'));var util=require(_0x75ab('0x1'));var logger=require(_0x75ab('0x2'))(_0x75ab('0x3'));var moment=require(_0x75ab('0x4'));var BPromise=require(_0x75ab('0x5'));var rp=require(_0x75ab('0x6'));var fs=require('fs');var path=require(_0x75ab('0x7'));var rimraf=require(_0x75ab('0x8'));var config=require(_0x75ab('0x9'));var attributes=require(_0x75ab('0xa'));module[_0x75ab('0xb')]=function(_0x1c5184,_0x1fead0){return _0x1c5184[_0x75ab('0xc')](_0x75ab('0xd'),attributes,{'tableName':_0x75ab('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 9d1eb96..aa6df0d 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 _0xc68f=['attributes','include','model','GetTemplate','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','catch','Template','findAll','options','raw','where'];(function(_0x1042c3,_0x3a025f){var _0x1cabbf=function(_0x15d24a){while(--_0x15d24a){_0x1042c3['push'](_0x1042c3['shift']());}};_0x1cabbf(++_0x3a025f);}(_0xc68f,0xfe));var _0xfc68=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc68f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xfc68('0x0'));var util=require(_0xfc68('0x1'));var moment=require(_0xfc68('0x2'));var BPromise=require(_0xfc68('0x3'));var rs=require(_0xfc68('0x4'));var fs=require('fs');var Redis=require(_0xfc68('0x5'));var db=require(_0xfc68('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfc68('0x7'));var jayson=require(_0xfc68('0x8'));var client=jayson[_0xfc68('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb3d066,_0x2b4198,_0x440e65){return new BPromise(function(_0x4a83fa,_0x224464){return client[_0xfc68('0xa')](_0xb3d066,_0x440e65)[_0xfc68('0xb')](function(_0x400bac){logger[_0xfc68('0xc')]('Template,\x20%s,\x20%s',_0x2b4198,_0xfc68('0xd'));logger['debug'](_0xfc68('0xe'),_0x2b4198,_0xfc68('0xd'),JSON['stringify'](_0x400bac));if(_0x400bac[_0xfc68('0xf')]){if(_0x400bac[_0xfc68('0xf')][_0xfc68('0x10')]===0x1f4){logger[_0xfc68('0xf')](_0xfc68('0x11'),_0x2b4198,_0x400bac[_0xfc68('0xf')][_0xfc68('0x12')]);return _0x224464(_0x400bac[_0xfc68('0xf')]['message']);}logger[_0xfc68('0xf')]('Template,\x20%s,\x20%s',_0x2b4198,_0x400bac['error'][_0xfc68('0x12')]);return _0x4a83fa(_0x400bac[_0xfc68('0xf')][_0xfc68('0x12')]);}else{logger['info'](_0xfc68('0x11'),_0x2b4198,_0xfc68('0xd'));_0x4a83fa(_0x400bac['result'][_0xfc68('0x12')]);}})[_0xfc68('0x13')](function(_0x40bb4f){logger[_0xfc68('0xf')](_0xfc68('0x11'),_0x2b4198,_0x40bb4f);_0x224464(_0x40bb4f);});});}exports['GetTemplate']=function(_0x24cf09){var _0x39a5aa=this;return new Promise(function(_0x5721ee,_0x2ca744){return db[_0xfc68('0x14')][_0xfc68('0x15')]({'raw':_0x24cf09[_0xfc68('0x16')]?_0x24cf09[_0xfc68('0x16')][_0xfc68('0x17')]===undefined?!![]:![]:!![],'where':_0x24cf09[_0xfc68('0x16')]?_0x24cf09['options'][_0xfc68('0x18')]||null:null,'attributes':_0x24cf09['options']?_0x24cf09[_0xfc68('0x16')][_0xfc68('0x19')]||null:null,'limit':_0x24cf09[_0xfc68('0x16')]?_0x24cf09[_0xfc68('0x16')]['limit']||null:null,'include':_0x24cf09['options']?_0x24cf09['options'][_0xfc68('0x1a')]?_['map'](_0x24cf09[_0xfc68('0x16')][_0xfc68('0x1a')],function(_0x1721fc){return{'model':db[_0x1721fc[_0xfc68('0x1b')]],'as':_0x1721fc['as'],'attributes':_0x1721fc['attributes'],'include':_0x1721fc[_0xfc68('0x1a')]?_['map'](_0x1721fc[_0xfc68('0x1a')],function(_0x8d99dd){return{'model':db[_0x8d99dd['model']],'as':_0x8d99dd['as'],'attributes':_0x8d99dd[_0xfc68('0x19')],'include':_0x8d99dd[_0xfc68('0x1a')]?_['map'](_0x8d99dd['include'],function(_0x274199){return{'model':db[_0x274199['model']],'as':_0x274199['as'],'attributes':_0x274199[_0xfc68('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15b693){logger[_0xfc68('0xc')](_0xfc68('0x1c'),_0x24cf09);logger[_0xfc68('0x1d')](_0xfc68('0x1c'),_0x24cf09,JSON[_0xfc68('0x1e')](_0x15b693));_0x5721ee(_0x15b693);})[_0xfc68('0x13')](function(_0x1ef0b5){logger['error'](_0xfc68('0x1c'),_0x1ef0b5[_0xfc68('0x12')],_0x24cf09);_0x2ca744(_0x39a5aa[_0xfc68('0xf')](0x1f4,_0x1ef0b5[_0xfc68('0x12')]));});});}; \ No newline at end of file +var _0x60e1=['rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','raw','limit','map','attributes','model','include','GetTemplate','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2fd249,_0xd0fdd6){var _0xfa0151=function(_0x144542){while(--_0x144542){_0x2fd249['push'](_0x2fd249['shift']());}};_0xfa0151(++_0xd0fdd6);}(_0x60e1,0x14c));var _0x160e=function(_0x264bea,_0x2a6529){_0x264bea=_0x264bea-0x0;var _0x4981a8=_0x60e1[_0x264bea];return _0x4981a8;};'use strict';var _=require(_0x160e('0x0'));var util=require('util');var moment=require(_0x160e('0x1'));var BPromise=require(_0x160e('0x2'));var rs=require(_0x160e('0x3'));var fs=require('fs');var Redis=require(_0x160e('0x4'));var db=require(_0x160e('0x5'))['db'];var utils=require(_0x160e('0x6'));var logger=require(_0x160e('0x7'))(_0x160e('0x8'));var config=require(_0x160e('0x9'));var jayson=require(_0x160e('0xa'));var client=jayson['client'][_0x160e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4da502,_0x3b58ca,_0x195a22){return new BPromise(function(_0xbc9baa,_0x5cc74f){return client[_0x160e('0xc')](_0x4da502,_0x195a22)[_0x160e('0xd')](function(_0x2b90da){logger[_0x160e('0xe')](_0x160e('0xf'),_0x3b58ca,_0x160e('0x10'));logger['debug'](_0x160e('0x11'),_0x3b58ca,_0x160e('0x10'),JSON[_0x160e('0x12')](_0x2b90da));if(_0x2b90da[_0x160e('0x13')]){if(_0x2b90da[_0x160e('0x13')][_0x160e('0x14')]===0x1f4){logger[_0x160e('0x13')]('Template,\x20%s,\x20%s',_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0x5cc74f(_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);}logger['error'](_0x160e('0xf'),_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0xbc9baa(_0x2b90da[_0x160e('0x13')]['message']);}else{logger['info']('Template,\x20%s,\x20%s',_0x3b58ca,'request\x20sent');_0xbc9baa(_0x2b90da[_0x160e('0x16')][_0x160e('0x15')]);}})[_0x160e('0x17')](function(_0x2a5ec5){logger[_0x160e('0x13')](_0x160e('0xf'),_0x3b58ca,_0x2a5ec5);_0x5cc74f(_0x2a5ec5);});});}exports['GetTemplate']=function(_0x37d722){var _0x1edeff=this;return new Promise(function(_0x5c7bde,_0x38561b){return db[_0x160e('0x18')][_0x160e('0x19')]({'raw':_0x37d722[_0x160e('0x1a')]?_0x37d722[_0x160e('0x1a')][_0x160e('0x1b')]===undefined?!![]:![]:!![],'where':_0x37d722['options']?_0x37d722[_0x160e('0x1a')]['where']||null:null,'attributes':_0x37d722[_0x160e('0x1a')]?_0x37d722[_0x160e('0x1a')]['attributes']||null:null,'limit':_0x37d722[_0x160e('0x1a')]?_0x37d722['options'][_0x160e('0x1c')]||null:null,'include':_0x37d722['options']?_0x37d722[_0x160e('0x1a')]['include']?_[_0x160e('0x1d')](_0x37d722[_0x160e('0x1a')]['include'],function(_0x280763){return{'model':db[_0x280763['model']],'as':_0x280763['as'],'attributes':_0x280763[_0x160e('0x1e')],'include':_0x280763['include']?_[_0x160e('0x1d')](_0x280763['include'],function(_0x5e8d17){return{'model':db[_0x5e8d17[_0x160e('0x1f')]],'as':_0x5e8d17['as'],'attributes':_0x5e8d17[_0x160e('0x1e')],'include':_0x5e8d17[_0x160e('0x20')]?_[_0x160e('0x1d')](_0x5e8d17[_0x160e('0x20')],function(_0x34979d){return{'model':db[_0x34979d[_0x160e('0x1f')]],'as':_0x34979d['as'],'attributes':_0x34979d[_0x160e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x160e('0xd')](function(_0x1ce68f){logger[_0x160e('0xe')](_0x160e('0x21'),_0x37d722);logger['debug'](_0x160e('0x21'),_0x37d722,JSON['stringify'](_0x1ce68f));_0x5c7bde(_0x1ce68f);})[_0x160e('0x17')](function(_0x4468ec){logger[_0x160e('0x13')](_0x160e('0x21'),_0x4468ec[_0x160e('0x15')],_0x37d722);_0x38561b(_0x1edeff[_0x160e('0x13')](0x1f4,_0x4468ec[_0x160e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 5d015ab..bba1007 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 _0x347d=['show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAllCondition','/:id/actions','addAction','put','/:id','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','isAuthenticated'];(function(_0x4e557d,_0x4d533b){var _0x393f57=function(_0x56d1a2){while(--_0x56d1a2){_0x4e557d['push'](_0x4e557d['shift']());}};_0x393f57(++_0x4d533b);}(_0x347d,0x17a));var _0xd347=function(_0x3e92b9,_0x4d9792){_0x3e92b9=_0x3e92b9-0x0;var _0xd5e6=_0x347d[_0x3e92b9];return _0xd5e6;};'use strict';var multer=require(_0xd347('0x0'));var util=require(_0xd347('0x1'));var path=require(_0xd347('0x2'));var timeout=require(_0xd347('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd347('0x4'));var auth=require(_0xd347('0x5'));var interaction=require(_0xd347('0x6'));var config=require(_0xd347('0x7'));var controller=require(_0xd347('0x8'));router[_0xd347('0x9')]('/',auth['isAuthenticated'](),controller[_0xd347('0xa')]);router[_0xd347('0x9')]('/:id',auth[_0xd347('0xb')](),controller[_0xd347('0xc')]);router['get'](_0xd347('0xd'),auth[_0xd347('0xb')](),controller[_0xd347('0xe')]);router[_0xd347('0x9')](_0xd347('0xf'),auth[_0xd347('0xb')](),controller[_0xd347('0x10')]);router[_0xd347('0x9')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0xd347('0x11')]('/',auth[_0xd347('0xb')](),controller[_0xd347('0x12')]);router[_0xd347('0x11')](_0xd347('0xd'),auth[_0xd347('0xb')](),controller[_0xd347('0x13')]);router[_0xd347('0x11')](_0xd347('0xf'),auth[_0xd347('0xb')](),controller['addAnyCondition']);router['post'](_0xd347('0x14'),auth[_0xd347('0xb')](),controller[_0xd347('0x15')]);router[_0xd347('0x16')](_0xd347('0x17'),auth[_0xd347('0xb')](),controller[_0xd347('0x18')]);router['delete'](_0xd347('0x17'),auth[_0xd347('0xb')](),controller[_0xd347('0x19')]);module['exports']=router; \ No newline at end of file +var _0xd0f5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','/:id','show','get','getAllConditions','getAnyConditions','/:id/actions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x34992e,_0x4ef4e6){var _0x340418=function(_0x590adc){while(--_0x590adc){_0x34992e['push'](_0x34992e['shift']());}};_0x340418(++_0x4ef4e6);}(_0xd0f5,0xda));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5d0f('0x0'));var util=require(_0x5d0f('0x1'));var path=require('path');var timeout=require(_0x5d0f('0x2'));var express=require(_0x5d0f('0x3'));var router=express[_0x5d0f('0x4')]();var fs_extra=require(_0x5d0f('0x5'));var auth=require(_0x5d0f('0x6'));var interaction=require(_0x5d0f('0x7'));var config=require(_0x5d0f('0x8'));var controller=require(_0x5d0f('0x9'));router['get']('/',auth[_0x5d0f('0xa')](),controller[_0x5d0f('0xb')]);router['get'](_0x5d0f('0xc'),auth[_0x5d0f('0xa')](),controller[_0x5d0f('0xd')]);router[_0x5d0f('0xe')]('/:id/all_conditions',auth[_0x5d0f('0xa')](),controller[_0x5d0f('0xf')]);router[_0x5d0f('0xe')]('/:id/any_conditions',auth[_0x5d0f('0xa')](),controller[_0x5d0f('0x10')]);router['get'](_0x5d0f('0x11'),auth[_0x5d0f('0xa')](),controller['getActions']);router[_0x5d0f('0x12')]('/',auth[_0x5d0f('0xa')](),controller[_0x5d0f('0x13')]);router[_0x5d0f('0x12')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x5d0f('0x14')]);router['post'](_0x5d0f('0x15'),auth[_0x5d0f('0xa')](),controller[_0x5d0f('0x16')]);router[_0x5d0f('0x12')](_0x5d0f('0x11'),auth[_0x5d0f('0xa')](),controller[_0x5d0f('0x17')]);router[_0x5d0f('0x18')](_0x5d0f('0xc'),auth[_0x5d0f('0xa')](),controller[_0x5d0f('0x19')]);router['delete']('/:id',auth[_0x5d0f('0xa')](),controller[_0x5d0f('0x1a')]);module[_0x5d0f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 923fbbf..ea80c42 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 _0xac39=['sequelize','exports','STRING','BOOLEAN'];(function(_0xfa2086,_0x398fcf){var _0x5c7118=function(_0x5b7a09){while(--_0x5b7a09){_0xfa2086['push'](_0xfa2086['shift']());}};_0x5c7118(++_0x398fcf);}(_0xac39,0x11c));var _0x9ac3=function(_0x9f0365,_0x375ba5){_0x9f0365=_0x9f0365-0x0;var _0x3aab1d=_0xac39[_0x9f0365];return _0x3aab1d;};'use strict';var Sequelize=require(_0x9ac3('0x0'));module[_0x9ac3('0x1')]={'name':{'type':Sequelize[_0x9ac3('0x2')]},'channel':{'type':Sequelize[_0x9ac3('0x2')]},'description':{'type':Sequelize[_0x9ac3('0x2')]},'status':{'type':Sequelize[_0x9ac3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdbcf=['sequelize','exports','STRING','BOOLEAN'];(function(_0x289713,_0x116e64){var _0x37f991=function(_0x118696){while(--_0x118696){_0x289713['push'](_0x289713['shift']());}};_0x37f991(++_0x116e64);}(_0xdbcf,0x158));var _0xfdbc=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdbcf[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xfdbc('0x0'));module[_0xfdbc('0x1')]={'name':{'type':Sequelize[_0xfdbc('0x2')]},'channel':{'type':Sequelize[_0xfdbc('0x2')]},'description':{'type':Sequelize[_0xfdbc('0x2')]},'status':{'type':Sequelize[_0xfdbc('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 1d1c388..c61683e 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 _0xada1=['sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','Triggers','UserProfileResource','destroy','then','stack','name','index','map','Trigger','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','keys','rawAttributes','options','find','catch','create','body','user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','addAnyCondition','getAllConditions','findOne','Condition','getAnyConditions','addAction','TriggerId','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xada1,0x1ce));var _0x1ada=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xada1[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require(_0x1ada('0x0'));var rimraf=require(_0x1ada('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1ada('0x2'));var moment=require(_0x1ada('0x3'));var BPromise=require(_0x1ada('0x4'));var Mustache=require(_0x1ada('0x5'));var util=require(_0x1ada('0x6'));var path=require(_0x1ada('0x7'));var sox=require(_0x1ada('0x8'));var csv=require(_0x1ada('0x9'));var ejs=require(_0x1ada('0xa'));var fs=require('fs');var fs_extra=require(_0x1ada('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ada('0xc'));var jsforce=require(_0x1ada('0xd'));var deskjs=require(_0x1ada('0xe'));var toCsv=require(_0x1ada('0x9'));var querystring=require(_0x1ada('0xf'));var Papa=require(_0x1ada('0x10'));var Redis=require(_0x1ada('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ada('0x12'));var as=require(_0x1ada('0x13'));var hardwareService=require(_0x1ada('0x14'));var logger=require(_0x1ada('0x15'))(_0x1ada('0x16'));var utils=require(_0x1ada('0x17'));var config=require(_0x1ada('0x18'));var licenseUtil=require(_0x1ada('0x19'));var db=require(_0x1ada('0x1a'))['db'];function respondWithStatusCode(_0x5c8295,_0x282c4e){_0x282c4e=_0x282c4e||0xcc;return function(_0x556e41){if(_0x556e41){return _0x5c8295[_0x1ada('0x1b')](_0x282c4e);}return _0x5c8295[_0x1ada('0x1c')](_0x282c4e)[_0x1ada('0x1d')]();};}function respondWithResult(_0x45487c,_0x28b9af){_0x28b9af=_0x28b9af||0xc8;return function(_0x23d8ae){if(_0x23d8ae){return _0x45487c['status'](_0x28b9af)['json'](_0x23d8ae);}};}function respondWithFilteredResult(_0x37e9e6,_0x2bbf86){return function(_0x371e87){if(_0x371e87){var _0x3e3e20=typeof _0x2bbf86[_0x1ada('0x1e')]===_0x1ada('0x1f')&&typeof _0x2bbf86['limit']===_0x1ada('0x1f');var _0x5d2970=_0x371e87['count'];var _0x4249af=_0x3e3e20?0x0:_0x2bbf86[_0x1ada('0x1e')];var _0x128408=_0x3e3e20?_0x371e87[_0x1ada('0x20')]:_0x2bbf86[_0x1ada('0x1e')]+_0x2bbf86[_0x1ada('0x21')];var _0x1fe31a;if(_0x128408>=_0x5d2970){_0x128408=_0x5d2970;_0x1fe31a=0xc8;}else{_0x1fe31a=0xce;}_0x37e9e6[_0x1ada('0x1c')](_0x1fe31a);return _0x37e9e6[_0x1ada('0x22')](_0x1ada('0x23'),_0x4249af+'-'+_0x128408+'/'+_0x5d2970)['json'](_0x371e87);}return null;};}function patchUpdates(_0x309b4d){return function(_0x2f38ef){try{jsonpatch['apply'](_0x2f38ef,_0x309b4d,!![]);}catch(_0x5dd320){return BPromise[_0x1ada('0x24')](_0x5dd320);}return _0x2f38ef[_0x1ada('0x25')]();};}function saveUpdates(_0x150e6d,_0x54d919){return function(_0x18ea77){if(_0x18ea77){return _0x18ea77['update'](_0x150e6d)['then'](function(_0x5be550){return _0x5be550;});}return null;};}function removeEntity(_0x5939a8,_0x303778){return function(_0x2d9840){if(_0x2d9840){return _0x2d9840['destroy']()['then'](function(){var _0x5cb643=_0x2d9840['get']({'plain':!![]});var _0x4c9944=_0x1ada('0x26');return db[_0x1ada('0x27')][_0x1ada('0x28')]({'where':{'type':_0x4c9944,'resourceId':_0x5cb643['id']}})['then'](function(){return _0x2d9840;});})[_0x1ada('0x29')](function(){_0x5939a8['status'](0xcc)[_0x1ada('0x1d')]();});}};}function handleEntityNotFound(_0x48f146,_0x365f1b){return function(_0x7a8fd4){if(!_0x7a8fd4){_0x48f146[_0x1ada('0x1b')](0x194);}return _0x7a8fd4;};}function handleError(_0x2f475b,_0x1663db){_0x1663db=_0x1663db||0x1f4;return function(_0x8cb232){logger['error'](_0x8cb232[_0x1ada('0x2a')]);if(_0x8cb232['name']){delete _0x8cb232[_0x1ada('0x2b')];}_0x2f475b[_0x1ada('0x1c')](_0x1663db)['send'](_0x8cb232);};}exports[_0x1ada('0x2c')]=function(_0x31ce51,_0x50d505){var _0xbe698={},_0x47c832={},_0x415d6c={'count':0x0,'rows':[]};var _0x5f530f=_[_0x1ada('0x2d')](db[_0x1ada('0x2e')]['rawAttributes'],function(_0x5a637c){return{'name':_0x5a637c[_0x1ada('0x2f')],'type':_0x5a637c[_0x1ada('0x30')][_0x1ada('0x31')]};});_0x47c832[_0x1ada('0x32')]=_[_0x1ada('0x2d')](_0x5f530f,'name');_0x47c832[_0x1ada('0x33')]=_['keys'](_0x31ce51[_0x1ada('0x33')]);_0x47c832[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0x47c832[_0x1ada('0x32')],_0x47c832[_0x1ada('0x33')]);_0xbe698[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0x47c832[_0x1ada('0x32')],qs[_0x1ada('0x37')](_0x31ce51[_0x1ada('0x33')]['fields']));_0xbe698[_0x1ada('0x36')]=_0xbe698[_0x1ada('0x36')][_0x1ada('0x38')]?_0xbe698[_0x1ada('0x36')]:_0x47c832[_0x1ada('0x32')];if(!_0x31ce51[_0x1ada('0x33')][_0x1ada('0x39')](_0x1ada('0x3a'))){_0xbe698[_0x1ada('0x21')]=qs[_0x1ada('0x21')](_0x31ce51[_0x1ada('0x33')][_0x1ada('0x21')]);_0xbe698[_0x1ada('0x1e')]=qs[_0x1ada('0x1e')](_0x31ce51['query'][_0x1ada('0x1e')]);}_0xbe698[_0x1ada('0x3b')]=qs[_0x1ada('0x3c')](_0x31ce51[_0x1ada('0x33')][_0x1ada('0x3c')]);_0xbe698[_0x1ada('0x3d')]=qs[_0x1ada('0x34')](_[_0x1ada('0x3e')](_0x31ce51[_0x1ada('0x33')],_0x47c832['filters']),_0x5f530f);if(_0x31ce51[_0x1ada('0x33')][_0x1ada('0x3f')]){_0xbe698[_0x1ada('0x3d')]=_['merge'](_0xbe698[_0x1ada('0x3d')],{'$or':_['map'](_0x5f530f,function(_0x1d28b3){if(_0x1d28b3['type']!==_0x1ada('0x40')){var _0x146319={};_0x146319[_0x1d28b3[_0x1ada('0x2b')]]={'$like':'%'+_0x31ce51[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0x146319;}})});}_0xbe698=_[_0x1ada('0x41')]({},_0xbe698,_0x31ce51['options']);var _0x32e874={'where':_0xbe698[_0x1ada('0x3d')]};return db[_0x1ada('0x2e')][_0x1ada('0x20')](_0x32e874)[_0x1ada('0x29')](function(_0x40e25f){_0x415d6c[_0x1ada('0x20')]=_0x40e25f;if(_0x31ce51['query'][_0x1ada('0x42')]){_0xbe698[_0x1ada('0x43')]=[{'all':!![]}];}return db[_0x1ada('0x2e')][_0x1ada('0x44')](_0xbe698);})[_0x1ada('0x29')](function(_0x51cfd6){_0x415d6c[_0x1ada('0x45')]=_0x51cfd6;return _0x415d6c;})[_0x1ada('0x29')](respondWithFilteredResult(_0x50d505,_0xbe698))['catch'](handleError(_0x50d505,null));};exports['show']=function(_0x26ffe5,_0x3f15a4){var _0x528bbf={'raw':![],'where':{'id':_0x26ffe5['params']['id']}},_0xa55999={};_0xa55999[_0x1ada('0x32')]=_[_0x1ada('0x46')](db[_0x1ada('0x2e')][_0x1ada('0x47')]);_0xa55999['query']=_[_0x1ada('0x46')](_0x26ffe5[_0x1ada('0x33')]);_0xa55999[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0xa55999[_0x1ada('0x32')],_0xa55999[_0x1ada('0x33')]);_0x528bbf[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0xa55999[_0x1ada('0x32')],qs[_0x1ada('0x37')](_0x26ffe5[_0x1ada('0x33')][_0x1ada('0x37')]));_0x528bbf[_0x1ada('0x36')]=_0x528bbf[_0x1ada('0x36')]['length']?_0x528bbf[_0x1ada('0x36')]:_0xa55999[_0x1ada('0x32')];if(_0x26ffe5[_0x1ada('0x33')]['includeAll']){_0x528bbf['include']=[{'all':!![]}];}_0x528bbf=_[_0x1ada('0x41')]({},_0x528bbf,_0x26ffe5[_0x1ada('0x48')]);return db[_0x1ada('0x2e')][_0x1ada('0x49')](_0x528bbf)[_0x1ada('0x29')](handleEntityNotFound(_0x3f15a4,null))[_0x1ada('0x29')](respondWithResult(_0x3f15a4,null))[_0x1ada('0x4a')](handleError(_0x3f15a4,null));};exports[_0x1ada('0x4b')]=function(_0x3ac5f1,_0x279e2b){return db[_0x1ada('0x2e')]['create'](_0x3ac5f1[_0x1ada('0x4c')],{})[_0x1ada('0x29')](function(_0x51ebd7){var _0x3d01c7=_0x3ac5f1[_0x1ada('0x4d')]['get']({'plain':!![]});if(!_0x3d01c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d01c7[_0x1ada('0x4e')]===_0x1ada('0x4d')){var _0xf9f702=_0x51ebd7['get']({'plain':!![]});var _0x547a29=_0x1ada('0x26');return db['UserProfileSection'][_0x1ada('0x49')]({'where':{'name':_0x547a29,'userProfileId':_0x3d01c7['userProfileId']},'raw':!![]})[_0x1ada('0x29')](function(_0x5abf52){if(_0x5abf52&&_0x5abf52[_0x1ada('0x4f')]===0x0){return db[_0x1ada('0x27')][_0x1ada('0x4b')]({'name':_0xf9f702[_0x1ada('0x2b')],'resourceId':_0xf9f702['id'],'type':_0x5abf52[_0x1ada('0x2b')],'sectionId':_0x5abf52['id']},{})[_0x1ada('0x29')](function(){return _0x51ebd7;});}else{return _0x51ebd7;}})[_0x1ada('0x4a')](function(_0x540c33){logger[_0x1ada('0x50')](_0x1ada('0x51'),_0x540c33);throw _0x540c33;});}return _0x51ebd7;})['then'](respondWithResult(_0x279e2b,0xc9))[_0x1ada('0x4a')](handleError(_0x279e2b,null));};exports[_0x1ada('0x52')]=function(_0x4afa3d,_0x9cdbdd){if(_0x4afa3d['body']['id']){delete _0x4afa3d[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')][_0x1ada('0x49')]({'where':{'id':_0x4afa3d['params']['id']}})['then'](handleEntityNotFound(_0x9cdbdd,null))[_0x1ada('0x29')](saveUpdates(_0x4afa3d['body'],null))[_0x1ada('0x29')](respondWithResult(_0x9cdbdd,null))[_0x1ada('0x4a')](handleError(_0x9cdbdd,null));};exports[_0x1ada('0x28')]=function(_0x8f518d,_0x36e608){return db['Trigger'][_0x1ada('0x49')]({'where':{'id':_0x8f518d[_0x1ada('0x53')]['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x36e608,null))[_0x1ada('0x29')](removeEntity(_0x36e608,null))[_0x1ada('0x4a')](handleError(_0x36e608,null));};exports[_0x1ada('0x54')]=function(_0x309696,_0xd09e91,_0x509510){if(_0x309696['body']['id']){delete _0x309696[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')]['find']({'where':{'id':_0x309696['params']['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0xd09e91,null))[_0x1ada('0x29')](function(_0x54c8ca){if(_0x54c8ca){_0x309696[_0x1ada('0x4c')][_0x1ada('0x55')]=_0x54c8ca['id'];return db['Condition'][_0x1ada('0x4b')](_0x309696[_0x1ada('0x4c')]);}})[_0x1ada('0x29')](respondWithResult(_0xd09e91,null))[_0x1ada('0x4a')](handleError(_0xd09e91,null));};exports[_0x1ada('0x56')]=function(_0x26f3cf,_0x216d19,_0x11e890){if(_0x26f3cf[_0x1ada('0x4c')]['id']){delete _0x26f3cf[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')]['find']({'where':{'id':_0x26f3cf[_0x1ada('0x53')]['id']}})['then'](handleEntityNotFound(_0x216d19,null))[_0x1ada('0x29')](function(_0x1b051f){if(_0x1b051f){_0x26f3cf[_0x1ada('0x4c')]['TriggerAnyId']=_0x1b051f['id'];return db['Condition'][_0x1ada('0x4b')](_0x26f3cf[_0x1ada('0x4c')]);}})['then'](respondWithResult(_0x216d19,null))[_0x1ada('0x4a')](handleError(_0x216d19,null));};exports[_0x1ada('0x57')]=function(_0x332dd0,_0x4b7706,_0x18d6f9){var _0x180319={};var _0x37288d={};var _0x4d0ff6;var _0x2c0b4d;return db[_0x1ada('0x2e')][_0x1ada('0x58')]({'where':{'id':_0x332dd0['params']['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x4b7706,null))['then'](function(_0x45518b){if(_0x45518b){_0x4d0ff6=_0x45518b;_0x37288d[_0x1ada('0x32')]=_[_0x1ada('0x46')](db[_0x1ada('0x59')]['rawAttributes']);_0x37288d[_0x1ada('0x33')]=_[_0x1ada('0x46')](_0x332dd0['query']);_0x37288d[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0x37288d[_0x1ada('0x32')],_0x37288d[_0x1ada('0x33')]);_0x180319['attributes']=_[_0x1ada('0x35')](_0x37288d[_0x1ada('0x32')],qs['fields'](_0x332dd0[_0x1ada('0x33')][_0x1ada('0x37')]));_0x180319[_0x1ada('0x36')]=_0x180319['attributes'][_0x1ada('0x38')]?_0x180319[_0x1ada('0x36')]:_0x37288d[_0x1ada('0x32')];_0x180319['order']=qs[_0x1ada('0x3c')](_0x332dd0['query'][_0x1ada('0x3c')]);_0x180319[_0x1ada('0x3d')]=qs[_0x1ada('0x34')](_[_0x1ada('0x3e')](_0x332dd0[_0x1ada('0x33')],_0x37288d[_0x1ada('0x34')]));if(_0x332dd0[_0x1ada('0x33')]['filter']){_0x180319[_0x1ada('0x3d')]=_[_0x1ada('0x41')](_0x180319[_0x1ada('0x3d')],{'$or':_['map'](_0x180319[_0x1ada('0x36')],function(_0x34205e){var _0x4aa25f={};_0x4aa25f[_0x34205e]={'$like':'%'+_0x332dd0[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0x4aa25f;})});}_0x180319=_[_0x1ada('0x41')]({},_0x180319,_0x332dd0[_0x1ada('0x48')]);return _0x4d0ff6[_0x1ada('0x57')](_0x180319);}})[_0x1ada('0x29')](function(_0x2e3dc3){if(_0x2e3dc3){_0x2c0b4d=_0x2e3dc3[_0x1ada('0x38')];if(!_0x332dd0[_0x1ada('0x33')]['hasOwnProperty']('nolimit')){_0x180319[_0x1ada('0x21')]=qs['limit'](_0x332dd0[_0x1ada('0x33')][_0x1ada('0x21')]);_0x180319[_0x1ada('0x1e')]=qs[_0x1ada('0x1e')](_0x332dd0[_0x1ada('0x33')][_0x1ada('0x1e')]);}return _0x4d0ff6[_0x1ada('0x57')](_0x180319);}})['then'](function(_0x1839b4){if(_0x1839b4){return _0x1839b4?{'count':_0x2c0b4d,'rows':_0x1839b4}:null;}})[_0x1ada('0x29')](respondWithResult(_0x4b7706,null))[_0x1ada('0x4a')](handleError(_0x4b7706,null));};exports['getAnyConditions']=function(_0x3e5662,_0x1fa1a7,_0x20d4d0){var _0x46bd97={};var _0x268131={};var _0x498f6b;var _0x1f1dc1;return db[_0x1ada('0x2e')][_0x1ada('0x58')]({'where':{'id':_0x3e5662[_0x1ada('0x53')]['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x1fa1a7,null))['then'](function(_0x599826){if(_0x599826){_0x498f6b=_0x599826;_0x268131['model']=_['keys'](db[_0x1ada('0x59')][_0x1ada('0x47')]);_0x268131[_0x1ada('0x33')]=_['keys'](_0x3e5662[_0x1ada('0x33')]);_0x268131[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0x268131[_0x1ada('0x32')],_0x268131[_0x1ada('0x33')]);_0x46bd97[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0x268131[_0x1ada('0x32')],qs[_0x1ada('0x37')](_0x3e5662[_0x1ada('0x33')][_0x1ada('0x37')]));_0x46bd97['attributes']=_0x46bd97[_0x1ada('0x36')][_0x1ada('0x38')]?_0x46bd97[_0x1ada('0x36')]:_0x268131[_0x1ada('0x32')];_0x46bd97[_0x1ada('0x3b')]=qs[_0x1ada('0x3c')](_0x3e5662['query'][_0x1ada('0x3c')]);_0x46bd97[_0x1ada('0x3d')]=qs[_0x1ada('0x34')](_[_0x1ada('0x3e')](_0x3e5662[_0x1ada('0x33')],_0x268131[_0x1ada('0x34')]));if(_0x3e5662['query']['filter']){_0x46bd97[_0x1ada('0x3d')]=_[_0x1ada('0x41')](_0x46bd97[_0x1ada('0x3d')],{'$or':_[_0x1ada('0x2d')](_0x46bd97['attributes'],function(_0x26c45d){var _0xfaf7fe={};_0xfaf7fe[_0x26c45d]={'$like':'%'+_0x3e5662[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0xfaf7fe;})});}_0x46bd97=_[_0x1ada('0x41')]({},_0x46bd97,_0x3e5662['options']);return _0x498f6b[_0x1ada('0x5a')](_0x46bd97);}})[_0x1ada('0x29')](function(_0x2d43b1){if(_0x2d43b1){_0x1f1dc1=_0x2d43b1['length'];if(!_0x3e5662['query'][_0x1ada('0x39')](_0x1ada('0x3a'))){_0x46bd97[_0x1ada('0x21')]=qs[_0x1ada('0x21')](_0x3e5662['query'][_0x1ada('0x21')]);_0x46bd97[_0x1ada('0x1e')]=qs[_0x1ada('0x1e')](_0x3e5662[_0x1ada('0x33')][_0x1ada('0x1e')]);}return _0x498f6b[_0x1ada('0x5a')](_0x46bd97);}})[_0x1ada('0x29')](function(_0x208fd3){if(_0x208fd3){return _0x208fd3?{'count':_0x1f1dc1,'rows':_0x208fd3}:null;}})[_0x1ada('0x29')](respondWithResult(_0x1fa1a7,null))[_0x1ada('0x4a')](handleError(_0x1fa1a7,null));};exports[_0x1ada('0x5b')]=function(_0x828c76,_0x2bbf0b,_0x4edb29){if(_0x828c76[_0x1ada('0x4c')]['id']){delete _0x828c76[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')][_0x1ada('0x49')]({'where':{'id':_0x828c76[_0x1ada('0x53')]['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x2bbf0b,null))[_0x1ada('0x29')](function(_0x11ada6){if(_0x11ada6){_0x828c76[_0x1ada('0x4c')][_0x1ada('0x5c')]=_0x11ada6['id'];return db['Action'][_0x1ada('0x4b')](_0x828c76[_0x1ada('0x4c')]);}})['then'](respondWithResult(_0x2bbf0b,null))[_0x1ada('0x4a')](handleError(_0x2bbf0b,null));};exports[_0x1ada('0x5d')]=function(_0x48f2ab,_0x95e09d,_0x2b6d5d){var _0x283527={};var _0x680424={};var _0x376090;var _0x4825d9;return db[_0x1ada('0x2e')][_0x1ada('0x58')]({'where':{'id':_0x48f2ab['params']['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x95e09d,null))['then'](function(_0x3ed545){if(_0x3ed545){_0x376090=_0x3ed545;_0x680424[_0x1ada('0x32')]=_[_0x1ada('0x46')](db['Action'][_0x1ada('0x47')]);_0x680424[_0x1ada('0x33')]=_[_0x1ada('0x46')](_0x48f2ab[_0x1ada('0x33')]);_0x680424['filters']=_[_0x1ada('0x35')](_0x680424[_0x1ada('0x32')],_0x680424[_0x1ada('0x33')]);_0x283527[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0x680424[_0x1ada('0x32')],qs['fields'](_0x48f2ab['query']['fields']));_0x283527[_0x1ada('0x36')]=_0x283527['attributes'][_0x1ada('0x38')]?_0x283527[_0x1ada('0x36')]:_0x680424[_0x1ada('0x32')];_0x283527['order']=qs[_0x1ada('0x3c')](_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x3c')]);_0x283527[_0x1ada('0x3d')]=qs['filters'](_[_0x1ada('0x3e')](_0x48f2ab[_0x1ada('0x33')],_0x680424['filters']));if(_0x48f2ab[_0x1ada('0x33')]['filter']){_0x283527[_0x1ada('0x3d')]=_['merge'](_0x283527['where'],{'$or':_['map'](_0x283527['attributes'],function(_0x26bf45){var _0x4559db={};_0x4559db[_0x26bf45]={'$like':'%'+_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0x4559db;})});}_0x283527=_[_0x1ada('0x41')]({},_0x283527,_0x48f2ab['options']);return _0x376090[_0x1ada('0x5d')](_0x283527);}})[_0x1ada('0x29')](function(_0x312930){if(_0x312930){_0x4825d9=_0x312930['length'];if(!_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x39')](_0x1ada('0x3a'))){_0x283527[_0x1ada('0x21')]=qs[_0x1ada('0x21')](_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x21')]);_0x283527['offset']=qs[_0x1ada('0x1e')](_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x1e')]);}return _0x376090[_0x1ada('0x5d')](_0x283527);}})['then'](function(_0x5062c7){if(_0x5062c7){return _0x5062c7?{'count':_0x4825d9,'rows':_0x5062c7}:null;}})[_0x1ada('0x29')](respondWithResult(_0x95e09d,null))[_0x1ada('0x4a')](handleError(_0x95e09d,null));}; \ No newline at end of file +var _0x35f5=['json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','sendStatus','error','stack','name','index','map','Trigger','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','include','rows','catch','show','keys','length','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','rawAttributes','hasOwnProperty','getAnyConditions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','end','status'];(function(_0x3da72b,_0x4fd809){var _0xc64ac4=function(_0x387e50){while(--_0x387e50){_0x3da72b['push'](_0x3da72b['shift']());}};_0xc64ac4(++_0x4fd809);}(_0x35f5,0x103));var _0x535f=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0x35f5[_0x484cac];return _0x1d6e77;};'use strict';var emlformat=require(_0x535f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x535f('0x1'));var jsonpatch=require(_0x535f('0x2'));var rp=require(_0x535f('0x3'));var moment=require(_0x535f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x535f('0x5'));var util=require(_0x535f('0x6'));var path=require(_0x535f('0x7'));var sox=require(_0x535f('0x8'));var csv=require(_0x535f('0x9'));var ejs=require(_0x535f('0xa'));var fs=require('fs');var fs_extra=require(_0x535f('0xb'));var _=require('lodash');var squel=require(_0x535f('0xc'));var crypto=require(_0x535f('0xd'));var jsforce=require(_0x535f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x535f('0x9'));var querystring=require(_0x535f('0xf'));var Papa=require(_0x535f('0x10'));var Redis=require('ioredis');var authService=require(_0x535f('0x11'));var qs=require(_0x535f('0x12'));var as=require(_0x535f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x535f('0x14'))(_0x535f('0x15'));var utils=require(_0x535f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x535f('0x17'))['db'];function respondWithStatusCode(_0x58e8e9,_0x11c367){_0x11c367=_0x11c367||0xcc;return function(_0x1d4352){if(_0x1d4352){return _0x58e8e9['sendStatus'](_0x11c367);}return _0x58e8e9['status'](_0x11c367)[_0x535f('0x18')]();};}function respondWithResult(_0x14458e,_0x5ada12){_0x5ada12=_0x5ada12||0xc8;return function(_0x35ec0b){if(_0x35ec0b){return _0x14458e[_0x535f('0x19')](_0x5ada12)[_0x535f('0x1a')](_0x35ec0b);}};}function respondWithFilteredResult(_0x38dc97,_0x585341){return function(_0x3b657d){if(_0x3b657d){var _0x807d8b=typeof _0x585341[_0x535f('0x1b')]==='undefined'&&typeof _0x585341[_0x535f('0x1c')]===_0x535f('0x1d');var _0x3d0464=_0x3b657d[_0x535f('0x1e')];var _0x368651=_0x807d8b?0x0:_0x585341[_0x535f('0x1b')];var _0x31ebb9=_0x807d8b?_0x3b657d['count']:_0x585341[_0x535f('0x1b')]+_0x585341[_0x535f('0x1c')];var _0x4c9e3e;if(_0x31ebb9>=_0x3d0464){_0x31ebb9=_0x3d0464;_0x4c9e3e=0xc8;}else{_0x4c9e3e=0xce;}_0x38dc97[_0x535f('0x19')](_0x4c9e3e);return _0x38dc97[_0x535f('0x1f')]('Content-Range',_0x368651+'-'+_0x31ebb9+'/'+_0x3d0464)[_0x535f('0x1a')](_0x3b657d);}return null;};}function patchUpdates(_0x4c6671){return function(_0x194fac){try{jsonpatch[_0x535f('0x20')](_0x194fac,_0x4c6671,!![]);}catch(_0x33de81){return BPromise[_0x535f('0x21')](_0x33de81);}return _0x194fac[_0x535f('0x22')]();};}function saveUpdates(_0x388eac,_0x1cec6b){return function(_0x18baa0){if(_0x18baa0){return _0x18baa0[_0x535f('0x23')](_0x388eac)[_0x535f('0x24')](function(_0x56caa9){return _0x56caa9;});}return null;};}function removeEntity(_0x42ef96,_0x5cac07){return function(_0x334209){if(_0x334209){return _0x334209[_0x535f('0x25')]()[_0x535f('0x24')](function(){var _0x59ac5c=_0x334209['get']({'plain':!![]});var _0x187af1=_0x535f('0x26');return db[_0x535f('0x27')]['destroy']({'where':{'type':_0x187af1,'resourceId':_0x59ac5c['id']}})[_0x535f('0x24')](function(){return _0x334209;});})[_0x535f('0x24')](function(){_0x42ef96[_0x535f('0x19')](0xcc)[_0x535f('0x18')]();});}};}function handleEntityNotFound(_0x17dbdd,_0xfb1d3d){return function(_0x531fed){if(!_0x531fed){_0x17dbdd[_0x535f('0x28')](0x194);}return _0x531fed;};}function handleError(_0x3632dd,_0x31c8b7){_0x31c8b7=_0x31c8b7||0x1f4;return function(_0x1bb188){logger[_0x535f('0x29')](_0x1bb188[_0x535f('0x2a')]);if(_0x1bb188[_0x535f('0x2b')]){delete _0x1bb188[_0x535f('0x2b')];}_0x3632dd['status'](_0x31c8b7)['send'](_0x1bb188);};}exports[_0x535f('0x2c')]=function(_0x24c768,_0x14bc54){var _0x3466c8={},_0x4a10fb={},_0x4b7cee={'count':0x0,'rows':[]};var _0x30e7db=_[_0x535f('0x2d')](db[_0x535f('0x2e')]['rawAttributes'],function(_0xf68a0c){return{'name':_0xf68a0c[_0x535f('0x2f')],'type':_0xf68a0c[_0x535f('0x30')][_0x535f('0x31')]};});_0x4a10fb[_0x535f('0x32')]=_['map'](_0x30e7db,_0x535f('0x2b'));_0x4a10fb[_0x535f('0x33')]=_['keys'](_0x24c768[_0x535f('0x33')]);_0x4a10fb['filters']=_[_0x535f('0x34')](_0x4a10fb[_0x535f('0x32')],_0x4a10fb[_0x535f('0x33')]);_0x3466c8[_0x535f('0x35')]=_[_0x535f('0x34')](_0x4a10fb['model'],qs[_0x535f('0x36')](_0x24c768['query'][_0x535f('0x36')]));_0x3466c8[_0x535f('0x35')]=_0x3466c8[_0x535f('0x35')]['length']?_0x3466c8['attributes']:_0x4a10fb[_0x535f('0x32')];if(!_0x24c768[_0x535f('0x33')]['hasOwnProperty'](_0x535f('0x37'))){_0x3466c8[_0x535f('0x1c')]=qs[_0x535f('0x1c')](_0x24c768[_0x535f('0x33')][_0x535f('0x1c')]);_0x3466c8[_0x535f('0x1b')]=qs[_0x535f('0x1b')](_0x24c768['query'][_0x535f('0x1b')]);}_0x3466c8[_0x535f('0x38')]=qs[_0x535f('0x39')](_0x24c768[_0x535f('0x33')][_0x535f('0x39')]);_0x3466c8[_0x535f('0x3a')]=qs[_0x535f('0x3b')](_[_0x535f('0x3c')](_0x24c768[_0x535f('0x33')],_0x4a10fb[_0x535f('0x3b')]),_0x30e7db);if(_0x24c768[_0x535f('0x33')][_0x535f('0x3d')]){_0x3466c8[_0x535f('0x3a')]=_[_0x535f('0x3e')](_0x3466c8[_0x535f('0x3a')],{'$or':_['map'](_0x30e7db,function(_0xc9d403){if(_0xc9d403[_0x535f('0x30')]!=='VIRTUAL'){var _0x585cc6={};_0x585cc6[_0xc9d403[_0x535f('0x2b')]]={'$like':'%'+_0x24c768[_0x535f('0x33')][_0x535f('0x3d')]+'%'};return _0x585cc6;}})});}_0x3466c8=_['merge']({},_0x3466c8,_0x24c768['options']);var _0x250573={'where':_0x3466c8[_0x535f('0x3a')]};return db[_0x535f('0x2e')][_0x535f('0x1e')](_0x250573)['then'](function(_0x21a302){_0x4b7cee[_0x535f('0x1e')]=_0x21a302;if(_0x24c768[_0x535f('0x33')]['includeAll']){_0x3466c8[_0x535f('0x3f')]=[{'all':!![]}];}return db[_0x535f('0x2e')]['findAll'](_0x3466c8);})['then'](function(_0x15d170){_0x4b7cee[_0x535f('0x40')]=_0x15d170;return _0x4b7cee;})[_0x535f('0x24')](respondWithFilteredResult(_0x14bc54,_0x3466c8))[_0x535f('0x41')](handleError(_0x14bc54,null));};exports[_0x535f('0x42')]=function(_0x1783ec,_0x24e4c3){var _0x3cdcb1={'raw':![],'where':{'id':_0x1783ec['params']['id']}},_0x34ebfc={};_0x34ebfc[_0x535f('0x32')]=_['keys'](db[_0x535f('0x2e')]['rawAttributes']);_0x34ebfc[_0x535f('0x33')]=_[_0x535f('0x43')](_0x1783ec[_0x535f('0x33')]);_0x34ebfc[_0x535f('0x3b')]=_[_0x535f('0x34')](_0x34ebfc[_0x535f('0x32')],_0x34ebfc[_0x535f('0x33')]);_0x3cdcb1[_0x535f('0x35')]=_[_0x535f('0x34')](_0x34ebfc[_0x535f('0x32')],qs[_0x535f('0x36')](_0x1783ec['query'][_0x535f('0x36')]));_0x3cdcb1[_0x535f('0x35')]=_0x3cdcb1[_0x535f('0x35')][_0x535f('0x44')]?_0x3cdcb1[_0x535f('0x35')]:_0x34ebfc['model'];if(_0x1783ec[_0x535f('0x33')][_0x535f('0x45')]){_0x3cdcb1[_0x535f('0x3f')]=[{'all':!![]}];}_0x3cdcb1=_[_0x535f('0x3e')]({},_0x3cdcb1,_0x1783ec[_0x535f('0x46')]);return db[_0x535f('0x2e')][_0x535f('0x47')](_0x3cdcb1)[_0x535f('0x24')](handleEntityNotFound(_0x24e4c3,null))[_0x535f('0x24')](respondWithResult(_0x24e4c3,null))['catch'](handleError(_0x24e4c3,null));};exports[_0x535f('0x48')]=function(_0x19fc51,_0x79e121){return db[_0x535f('0x2e')][_0x535f('0x48')](_0x19fc51[_0x535f('0x49')],{})[_0x535f('0x24')](function(_0x28075a){var _0x2e7244=_0x19fc51[_0x535f('0x4a')][_0x535f('0x4b')]({'plain':!![]});if(!_0x2e7244)throw new Error(_0x535f('0x4c'));if(_0x2e7244[_0x535f('0x4d')]===_0x535f('0x4a')){var _0x7bac53=_0x28075a[_0x535f('0x4b')]({'plain':!![]});var _0x196706=_0x535f('0x26');return db[_0x535f('0x4e')]['find']({'where':{'name':_0x196706,'userProfileId':_0x2e7244[_0x535f('0x4f')]},'raw':!![]})[_0x535f('0x24')](function(_0x1fc1fe){if(_0x1fc1fe&&_0x1fc1fe[_0x535f('0x50')]===0x0){return db[_0x535f('0x27')][_0x535f('0x48')]({'name':_0x7bac53['name'],'resourceId':_0x7bac53['id'],'type':_0x1fc1fe[_0x535f('0x2b')],'sectionId':_0x1fc1fe['id']},{})['then'](function(){return _0x28075a;});}else{return _0x28075a;}})[_0x535f('0x41')](function(_0xd2c4dc){logger[_0x535f('0x29')](_0x535f('0x51'),_0xd2c4dc);throw _0xd2c4dc;});}return _0x28075a;})['then'](respondWithResult(_0x79e121,0xc9))[_0x535f('0x41')](handleError(_0x79e121,null));};exports[_0x535f('0x23')]=function(_0x2dae0d,_0x336247){if(_0x2dae0d['body']['id']){delete _0x2dae0d['body']['id'];}return db[_0x535f('0x2e')][_0x535f('0x47')]({'where':{'id':_0x2dae0d[_0x535f('0x52')]['id']}})[_0x535f('0x24')](handleEntityNotFound(_0x336247,null))[_0x535f('0x24')](saveUpdates(_0x2dae0d[_0x535f('0x49')],null))[_0x535f('0x24')](respondWithResult(_0x336247,null))[_0x535f('0x41')](handleError(_0x336247,null));};exports[_0x535f('0x25')]=function(_0x9583f6,_0x4f7f11){return db[_0x535f('0x2e')][_0x535f('0x47')]({'where':{'id':_0x9583f6[_0x535f('0x52')]['id']}})['then'](handleEntityNotFound(_0x4f7f11,null))[_0x535f('0x24')](removeEntity(_0x4f7f11,null))[_0x535f('0x41')](handleError(_0x4f7f11,null));};exports[_0x535f('0x53')]=function(_0x2675dc,_0x44eb79,_0x1b2a8e){if(_0x2675dc[_0x535f('0x49')]['id']){delete _0x2675dc[_0x535f('0x49')]['id'];}return db['Trigger'][_0x535f('0x47')]({'where':{'id':_0x2675dc['params']['id']}})[_0x535f('0x24')](handleEntityNotFound(_0x44eb79,null))['then'](function(_0x29031c){if(_0x29031c){_0x2675dc['body'][_0x535f('0x54')]=_0x29031c['id'];return db['Condition'][_0x535f('0x48')](_0x2675dc[_0x535f('0x49')]);}})[_0x535f('0x24')](respondWithResult(_0x44eb79,null))[_0x535f('0x41')](handleError(_0x44eb79,null));};exports[_0x535f('0x55')]=function(_0x340809,_0x30e617,_0x41b722){if(_0x340809[_0x535f('0x49')]['id']){delete _0x340809[_0x535f('0x49')]['id'];}return db[_0x535f('0x2e')][_0x535f('0x47')]({'where':{'id':_0x340809[_0x535f('0x52')]['id']}})[_0x535f('0x24')](handleEntityNotFound(_0x30e617,null))[_0x535f('0x24')](function(_0x348ca5){if(_0x348ca5){_0x340809['body'][_0x535f('0x56')]=_0x348ca5['id'];return db[_0x535f('0x57')][_0x535f('0x48')](_0x340809[_0x535f('0x49')]);}})[_0x535f('0x24')](respondWithResult(_0x30e617,null))[_0x535f('0x41')](handleError(_0x30e617,null));};exports[_0x535f('0x58')]=function(_0x573c09,_0x47205d,_0x431d66){var _0x214090={};var _0xaf2cf7={};var _0x1217dd;var _0x8389e;return db[_0x535f('0x2e')][_0x535f('0x59')]({'where':{'id':_0x573c09['params']['id']}})[_0x535f('0x24')](handleEntityNotFound(_0x47205d,null))[_0x535f('0x24')](function(_0x4757d5){if(_0x4757d5){_0x1217dd=_0x4757d5;_0xaf2cf7[_0x535f('0x32')]=_[_0x535f('0x43')](db[_0x535f('0x57')][_0x535f('0x5a')]);_0xaf2cf7[_0x535f('0x33')]=_[_0x535f('0x43')](_0x573c09[_0x535f('0x33')]);_0xaf2cf7[_0x535f('0x3b')]=_[_0x535f('0x34')](_0xaf2cf7['model'],_0xaf2cf7[_0x535f('0x33')]);_0x214090[_0x535f('0x35')]=_[_0x535f('0x34')](_0xaf2cf7['model'],qs[_0x535f('0x36')](_0x573c09[_0x535f('0x33')]['fields']));_0x214090[_0x535f('0x35')]=_0x214090[_0x535f('0x35')][_0x535f('0x44')]?_0x214090[_0x535f('0x35')]:_0xaf2cf7[_0x535f('0x32')];_0x214090[_0x535f('0x38')]=qs[_0x535f('0x39')](_0x573c09['query']['sort']);_0x214090[_0x535f('0x3a')]=qs['filters'](_[_0x535f('0x3c')](_0x573c09[_0x535f('0x33')],_0xaf2cf7[_0x535f('0x3b')]));if(_0x573c09[_0x535f('0x33')][_0x535f('0x3d')]){_0x214090[_0x535f('0x3a')]=_[_0x535f('0x3e')](_0x214090[_0x535f('0x3a')],{'$or':_[_0x535f('0x2d')](_0x214090['attributes'],function(_0x1ab5a9){var _0x13e0a3={};_0x13e0a3[_0x1ab5a9]={'$like':'%'+_0x573c09[_0x535f('0x33')][_0x535f('0x3d')]+'%'};return _0x13e0a3;})});}_0x214090=_[_0x535f('0x3e')]({},_0x214090,_0x573c09[_0x535f('0x46')]);return _0x1217dd[_0x535f('0x58')](_0x214090);}})[_0x535f('0x24')](function(_0x29e808){if(_0x29e808){_0x8389e=_0x29e808[_0x535f('0x44')];if(!_0x573c09[_0x535f('0x33')][_0x535f('0x5b')](_0x535f('0x37'))){_0x214090[_0x535f('0x1c')]=qs[_0x535f('0x1c')](_0x573c09['query']['limit']);_0x214090['offset']=qs['offset'](_0x573c09['query'][_0x535f('0x1b')]);}return _0x1217dd[_0x535f('0x58')](_0x214090);}})['then'](function(_0x13aae4){if(_0x13aae4){return _0x13aae4?{'count':_0x8389e,'rows':_0x13aae4}:null;}})[_0x535f('0x24')](respondWithResult(_0x47205d,null))[_0x535f('0x41')](handleError(_0x47205d,null));};exports[_0x535f('0x5c')]=function(_0x2ceae5,_0x1c4467,_0x1225f5){var _0x20ce4e={};var _0x509264={};var _0x33128f;var _0x1a8e4f;return db[_0x535f('0x2e')][_0x535f('0x59')]({'where':{'id':_0x2ceae5[_0x535f('0x52')]['id']}})[_0x535f('0x24')](handleEntityNotFound(_0x1c4467,null))[_0x535f('0x24')](function(_0x3c1971){if(_0x3c1971){_0x33128f=_0x3c1971;_0x509264[_0x535f('0x32')]=_[_0x535f('0x43')](db[_0x535f('0x57')][_0x535f('0x5a')]);_0x509264[_0x535f('0x33')]=_['keys'](_0x2ceae5[_0x535f('0x33')]);_0x509264[_0x535f('0x3b')]=_[_0x535f('0x34')](_0x509264[_0x535f('0x32')],_0x509264[_0x535f('0x33')]);_0x20ce4e[_0x535f('0x35')]=_['intersection'](_0x509264[_0x535f('0x32')],qs[_0x535f('0x36')](_0x2ceae5['query'][_0x535f('0x36')]));_0x20ce4e['attributes']=_0x20ce4e[_0x535f('0x35')][_0x535f('0x44')]?_0x20ce4e[_0x535f('0x35')]:_0x509264[_0x535f('0x32')];_0x20ce4e['order']=qs[_0x535f('0x39')](_0x2ceae5[_0x535f('0x33')][_0x535f('0x39')]);_0x20ce4e[_0x535f('0x3a')]=qs['filters'](_['pick'](_0x2ceae5[_0x535f('0x33')],_0x509264[_0x535f('0x3b')]));if(_0x2ceae5[_0x535f('0x33')]['filter']){_0x20ce4e[_0x535f('0x3a')]=_[_0x535f('0x3e')](_0x20ce4e[_0x535f('0x3a')],{'$or':_[_0x535f('0x2d')](_0x20ce4e[_0x535f('0x35')],function(_0x25bd50){var _0x3801df={};_0x3801df[_0x25bd50]={'$like':'%'+_0x2ceae5[_0x535f('0x33')][_0x535f('0x3d')]+'%'};return _0x3801df;})});}_0x20ce4e=_[_0x535f('0x3e')]({},_0x20ce4e,_0x2ceae5[_0x535f('0x46')]);return _0x33128f['getAnyConditions'](_0x20ce4e);}})[_0x535f('0x24')](function(_0x3b52c1){if(_0x3b52c1){_0x1a8e4f=_0x3b52c1[_0x535f('0x44')];if(!_0x2ceae5[_0x535f('0x33')][_0x535f('0x5b')](_0x535f('0x37'))){_0x20ce4e['limit']=qs[_0x535f('0x1c')](_0x2ceae5['query'][_0x535f('0x1c')]);_0x20ce4e[_0x535f('0x1b')]=qs[_0x535f('0x1b')](_0x2ceae5[_0x535f('0x33')]['offset']);}return _0x33128f['getAnyConditions'](_0x20ce4e);}})[_0x535f('0x24')](function(_0x159412){if(_0x159412){return _0x159412?{'count':_0x1a8e4f,'rows':_0x159412}:null;}})[_0x535f('0x24')](respondWithResult(_0x1c4467,null))['catch'](handleError(_0x1c4467,null));};exports['addAction']=function(_0x43f955,_0x11ff1a,_0x538af4){if(_0x43f955[_0x535f('0x49')]['id']){delete _0x43f955[_0x535f('0x49')]['id'];}return db[_0x535f('0x2e')][_0x535f('0x47')]({'where':{'id':_0x43f955[_0x535f('0x52')]['id']}})['then'](handleEntityNotFound(_0x11ff1a,null))['then'](function(_0x5d4fa0){if(_0x5d4fa0){_0x43f955[_0x535f('0x49')]['TriggerId']=_0x5d4fa0['id'];return db['Action'][_0x535f('0x48')](_0x43f955[_0x535f('0x49')]);}})[_0x535f('0x24')](respondWithResult(_0x11ff1a,null))[_0x535f('0x41')](handleError(_0x11ff1a,null));};exports['getActions']=function(_0x1ed67e,_0xdfd625,_0x5e646e){var _0x5c7236={};var _0x21cc31={};var _0x255808;var _0x3c52d4;return db[_0x535f('0x2e')]['findOne']({'where':{'id':_0x1ed67e[_0x535f('0x52')]['id']}})['then'](handleEntityNotFound(_0xdfd625,null))[_0x535f('0x24')](function(_0x47ffca){if(_0x47ffca){_0x255808=_0x47ffca;_0x21cc31['model']=_['keys'](db[_0x535f('0x5d')][_0x535f('0x5a')]);_0x21cc31[_0x535f('0x33')]=_[_0x535f('0x43')](_0x1ed67e[_0x535f('0x33')]);_0x21cc31['filters']=_[_0x535f('0x34')](_0x21cc31['model'],_0x21cc31['query']);_0x5c7236[_0x535f('0x35')]=_['intersection'](_0x21cc31[_0x535f('0x32')],qs[_0x535f('0x36')](_0x1ed67e[_0x535f('0x33')][_0x535f('0x36')]));_0x5c7236[_0x535f('0x35')]=_0x5c7236['attributes'][_0x535f('0x44')]?_0x5c7236['attributes']:_0x21cc31[_0x535f('0x32')];_0x5c7236[_0x535f('0x38')]=qs['sort'](_0x1ed67e[_0x535f('0x33')]['sort']);_0x5c7236[_0x535f('0x3a')]=qs[_0x535f('0x3b')](_[_0x535f('0x3c')](_0x1ed67e[_0x535f('0x33')],_0x21cc31[_0x535f('0x3b')]));if(_0x1ed67e[_0x535f('0x33')][_0x535f('0x3d')]){_0x5c7236[_0x535f('0x3a')]=_['merge'](_0x5c7236[_0x535f('0x3a')],{'$or':_['map'](_0x5c7236[_0x535f('0x35')],function(_0x2c1446){var _0x519eb6={};_0x519eb6[_0x2c1446]={'$like':'%'+_0x1ed67e[_0x535f('0x33')]['filter']+'%'};return _0x519eb6;})});}_0x5c7236=_[_0x535f('0x3e')]({},_0x5c7236,_0x1ed67e[_0x535f('0x46')]);return _0x255808[_0x535f('0x5e')](_0x5c7236);}})['then'](function(_0x5f143f){if(_0x5f143f){_0x3c52d4=_0x5f143f[_0x535f('0x44')];if(!_0x1ed67e[_0x535f('0x33')][_0x535f('0x5b')](_0x535f('0x37'))){_0x5c7236[_0x535f('0x1c')]=qs[_0x535f('0x1c')](_0x1ed67e['query'][_0x535f('0x1c')]);_0x5c7236[_0x535f('0x1b')]=qs['offset'](_0x1ed67e['query'][_0x535f('0x1b')]);}return _0x255808['getActions'](_0x5c7236);}})[_0x535f('0x24')](function(_0x50f74a){if(_0x50f74a){return _0x50f74a?{'count':_0x3c52d4,'rows':_0x50f74a}:null;}})['then'](respondWithResult(_0xdfd625,null))[_0x535f('0x41')](handleError(_0xdfd625,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index c89866b..102dd6c 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 _0xe0b2=['bluebird','request-promise','path','../../config/environment','./trigger.attributes','exports','define','tools_triggers','util','../../config/logger','api','moment'];(function(_0x1dd034,_0x5f5a76){var _0x4ecb48=function(_0x18ee58){while(--_0x18ee58){_0x1dd034['push'](_0x1dd034['shift']());}};_0x4ecb48(++_0x5f5a76);}(_0xe0b2,0xec));var _0x2e0b=function(_0x3e6575,_0x26ddbe){_0x3e6575=_0x3e6575-0x0;var _0x4c0253=_0xe0b2[_0x3e6575];return _0x4c0253;};'use strict';var _=require('lodash');var util=require(_0x2e0b('0x0'));var logger=require(_0x2e0b('0x1'))(_0x2e0b('0x2'));var moment=require(_0x2e0b('0x3'));var BPromise=require(_0x2e0b('0x4'));var rp=require(_0x2e0b('0x5'));var fs=require('fs');var path=require(_0x2e0b('0x6'));var rimraf=require('rimraf');var config=require(_0x2e0b('0x7'));var attributes=require(_0x2e0b('0x8'));module[_0x2e0b('0x9')]=function(_0x2a3a82,_0x1b8455){return _0x2a3a82[_0x2e0b('0xa')]('Trigger',attributes,{'tableName':_0x2e0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3edc=['tools_triggers','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x4da279,_0x287048){_0x4da279=_0x4da279-0x0;var _0xca923f=_0x3edc[_0x4da279];return _0xca923f;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var logger=require(_0xc3ed('0x2'))(_0xc3ed('0x3'));var moment=require(_0xc3ed('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ed('0x6'));var config=require(_0xc3ed('0x7'));var attributes=require(_0xc3ed('0x8'));module[_0xc3ed('0x9')]=function(_0x3f8468,_0x50b95c){return _0x3f8468[_0xc3ed('0xa')](_0xc3ed('0xb'),attributes,{'tableName':_0xc3ed('0xc'),'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 daa1107..ecc34ba 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 _0x7b7b=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trigger','findAll','options','limit','include','attributes','map','GetTrigger','ShowTrigger','find','raw','model','debug','util','bluebird'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0x7b7b,0xe5));var _0xb7b7=function(_0x7dfb59,_0x2db32f){_0x7dfb59=_0x7dfb59-0x0;var _0x326c4a=_0x7b7b[_0x7dfb59];return _0x326c4a;};'use strict';var _=require('lodash');var util=require(_0xb7b7('0x0'));var moment=require('moment');var BPromise=require(_0xb7b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7b7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7b7('0x3'));var logger=require(_0xb7b7('0x4'))('rpc');var config=require(_0xb7b7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb7b7('0x6')][_0xb7b7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48cef4,_0x3eba08,_0x5d240d){return new BPromise(function(_0x46c8c2,_0x1df5ab){return client[_0xb7b7('0x8')](_0x48cef4,_0x5d240d)[_0xb7b7('0x9')](function(_0x38b657){logger[_0xb7b7('0xa')](_0xb7b7('0xb'),_0x3eba08,_0xb7b7('0xc'));logger['debug'](_0xb7b7('0xd'),_0x3eba08,_0xb7b7('0xc'),JSON[_0xb7b7('0xe')](_0x38b657));if(_0x38b657[_0xb7b7('0xf')]){if(_0x38b657[_0xb7b7('0xf')][_0xb7b7('0x10')]===0x1f4){logger[_0xb7b7('0xf')](_0xb7b7('0xb'),_0x3eba08,_0x38b657[_0xb7b7('0xf')]['message']);return _0x1df5ab(_0x38b657[_0xb7b7('0xf')][_0xb7b7('0x11')]);}logger[_0xb7b7('0xf')](_0xb7b7('0xb'),_0x3eba08,_0x38b657[_0xb7b7('0xf')]['message']);return _0x46c8c2(_0x38b657[_0xb7b7('0xf')][_0xb7b7('0x11')]);}else{logger[_0xb7b7('0xa')](_0xb7b7('0xb'),_0x3eba08,'request\x20sent');_0x46c8c2(_0x38b657[_0xb7b7('0x12')][_0xb7b7('0x11')]);}})[_0xb7b7('0x13')](function(_0x5373b4){logger[_0xb7b7('0xf')](_0xb7b7('0xb'),_0x3eba08,_0x5373b4);_0x1df5ab(_0x5373b4);});});}exports['GetTrigger']=function(_0x37eba2){var _0x3fece7=this;return new Promise(function(_0x492553,_0x3a0d3d){return db[_0xb7b7('0x14')][_0xb7b7('0x15')]({'raw':_0x37eba2['options']?_0x37eba2[_0xb7b7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x37eba2[_0xb7b7('0x16')]?_0x37eba2[_0xb7b7('0x16')]['where']||null:null,'attributes':_0x37eba2['options']?_0x37eba2[_0xb7b7('0x16')]['attributes']||null:null,'limit':_0x37eba2['options']?_0x37eba2[_0xb7b7('0x16')][_0xb7b7('0x17')]||null:null,'include':_0x37eba2[_0xb7b7('0x16')]?_0x37eba2[_0xb7b7('0x16')][_0xb7b7('0x18')]?_['map'](_0x37eba2['options'][_0xb7b7('0x18')],function(_0x31f374){return{'model':db[_0x31f374['model']],'as':_0x31f374['as'],'attributes':_0x31f374[_0xb7b7('0x19')],'include':_0x31f374['include']?_[_0xb7b7('0x1a')](_0x31f374['include'],function(_0x318f12){return{'model':db[_0x318f12['model']],'as':_0x318f12['as'],'attributes':_0x318f12[_0xb7b7('0x19')],'include':_0x318f12[_0xb7b7('0x18')]?_[_0xb7b7('0x1a')](_0x318f12[_0xb7b7('0x18')],function(_0x3dd46e){return{'model':db[_0x3dd46e['model']],'as':_0x3dd46e['as'],'attributes':_0x3dd46e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7b7('0x9')](function(_0x49f5aa){logger[_0xb7b7('0xa')](_0xb7b7('0x1b'),_0x37eba2);logger['debug'](_0xb7b7('0x1b'),_0x37eba2,JSON[_0xb7b7('0xe')](_0x49f5aa));_0x492553(_0x49f5aa);})['catch'](function(_0x162372){logger[_0xb7b7('0xf')]('GetTrigger',_0x162372['message'],_0x37eba2);_0x3a0d3d(_0x3fece7[_0xb7b7('0xf')](0x1f4,_0x162372[_0xb7b7('0x11')]));});});};exports[_0xb7b7('0x1c')]=function(_0x455f2f){var _0x5dbddf=this;return new Promise(function(_0x4dfca5,_0x6d6b9e){return db[_0xb7b7('0x14')][_0xb7b7('0x1d')]({'raw':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x1e')]===undefined?!![]:![]:!![],'where':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')]['where']||null:null,'attributes':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x19')]||null:null,'include':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x18')]?_[_0xb7b7('0x1a')](_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x18')],function(_0x11fa76){return{'model':db[_0x11fa76[_0xb7b7('0x1f')]],'as':_0x11fa76['as'],'attributes':_0x11fa76['attributes'],'include':_0x11fa76[_0xb7b7('0x18')]?_['map'](_0x11fa76[_0xb7b7('0x18')],function(_0xff9a81){return{'model':db[_0xff9a81[_0xb7b7('0x1f')]],'as':_0xff9a81['as'],'attributes':_0xff9a81[_0xb7b7('0x19')],'include':_0xff9a81[_0xb7b7('0x18')]?_[_0xb7b7('0x1a')](_0xff9a81['include'],function(_0x4f3be8){return{'model':db[_0x4f3be8['model']],'as':_0x4f3be8['as'],'attributes':_0x4f3be8[_0xb7b7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb7b7('0x9')](function(_0xc43f70){logger[_0xb7b7('0xa')](_0xb7b7('0x1c'),_0x455f2f);logger[_0xb7b7('0x20')]('ShowTrigger',_0x455f2f,JSON[_0xb7b7('0xe')](_0xc43f70));_0x4dfca5(_0xc43f70);})[_0xb7b7('0x13')](function(_0xa694b){logger[_0xb7b7('0xf')](_0xb7b7('0x1c'),_0xa694b['message'],_0x455f2f);_0x6d6b9e(_0x5dbddf[_0xb7b7('0xf')](0x1f4,_0xa694b[_0xb7b7('0x11')]));});});}; \ No newline at end of file +var _0x1327=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrigger','Trigger','findAll','options','limit','include','map','model','attributes','ShowTrigger','find','raw','where','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x1327,0xba));var _0x7132=function(_0x48bc67,_0x3b2b80){_0x48bc67=_0x48bc67-0x0;var _0x5f0651=_0x1327[_0x48bc67];return _0x5f0651;};'use strict';var _=require('lodash');var util=require(_0x7132('0x0'));var moment=require('moment');var BPromise=require(_0x7132('0x1'));var rs=require(_0x7132('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7132('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7132('0x4'))(_0x7132('0x5'));var config=require('../../config/environment');var jayson=require(_0x7132('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27460e,_0x481db3,_0x1577a){return new BPromise(function(_0x573554,_0x57a73b){return client[_0x7132('0x7')](_0x27460e,_0x1577a)[_0x7132('0x8')](function(_0x5e8d1e){logger['info'](_0x7132('0x9'),_0x481db3,_0x7132('0xa'));logger[_0x7132('0xb')](_0x7132('0xc'),_0x481db3,_0x7132('0xa'),JSON[_0x7132('0xd')](_0x5e8d1e));if(_0x5e8d1e['error']){if(_0x5e8d1e[_0x7132('0xe')][_0x7132('0xf')]===0x1f4){logger[_0x7132('0xe')](_0x7132('0x9'),_0x481db3,_0x5e8d1e[_0x7132('0xe')][_0x7132('0x10')]);return _0x57a73b(_0x5e8d1e['error'][_0x7132('0x10')]);}logger['error'](_0x7132('0x9'),_0x481db3,_0x5e8d1e[_0x7132('0xe')][_0x7132('0x10')]);return _0x573554(_0x5e8d1e['error'][_0x7132('0x10')]);}else{logger[_0x7132('0x11')](_0x7132('0x9'),_0x481db3,_0x7132('0xa'));_0x573554(_0x5e8d1e[_0x7132('0x12')][_0x7132('0x10')]);}})[_0x7132('0x13')](function(_0x335edb){logger[_0x7132('0xe')](_0x7132('0x9'),_0x481db3,_0x335edb);_0x57a73b(_0x335edb);});});}exports[_0x7132('0x14')]=function(_0xb1fe2c){var _0x53afab=this;return new Promise(function(_0x4d0dc2,_0x593c49){return db[_0x7132('0x15')][_0x7132('0x16')]({'raw':_0xb1fe2c[_0x7132('0x17')]?_0xb1fe2c['options']['raw']===undefined?!![]:![]:!![],'where':_0xb1fe2c[_0x7132('0x17')]?_0xb1fe2c['options']['where']||null:null,'attributes':_0xb1fe2c[_0x7132('0x17')]?_0xb1fe2c['options']['attributes']||null:null,'limit':_0xb1fe2c[_0x7132('0x17')]?_0xb1fe2c[_0x7132('0x17')][_0x7132('0x18')]||null:null,'include':_0xb1fe2c[_0x7132('0x17')]?_0xb1fe2c[_0x7132('0x17')][_0x7132('0x19')]?_[_0x7132('0x1a')](_0xb1fe2c[_0x7132('0x17')]['include'],function(_0x41a4cf){return{'model':db[_0x41a4cf[_0x7132('0x1b')]],'as':_0x41a4cf['as'],'attributes':_0x41a4cf[_0x7132('0x1c')],'include':_0x41a4cf[_0x7132('0x19')]?_[_0x7132('0x1a')](_0x41a4cf[_0x7132('0x19')],function(_0x4b4ea5){return{'model':db[_0x4b4ea5[_0x7132('0x1b')]],'as':_0x4b4ea5['as'],'attributes':_0x4b4ea5[_0x7132('0x1c')],'include':_0x4b4ea5[_0x7132('0x19')]?_['map'](_0x4b4ea5[_0x7132('0x19')],function(_0x257e56){return{'model':db[_0x257e56['model']],'as':_0x257e56['as'],'attributes':_0x257e56[_0x7132('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7132('0x8')](function(_0x236c7e){logger[_0x7132('0x11')](_0x7132('0x14'),_0xb1fe2c);logger['debug'](_0x7132('0x14'),_0xb1fe2c,JSON['stringify'](_0x236c7e));_0x4d0dc2(_0x236c7e);})[_0x7132('0x13')](function(_0x5970f4){logger[_0x7132('0xe')](_0x7132('0x14'),_0x5970f4[_0x7132('0x10')],_0xb1fe2c);_0x593c49(_0x53afab[_0x7132('0xe')](0x1f4,_0x5970f4[_0x7132('0x10')]));});});};exports[_0x7132('0x1d')]=function(_0x4e054e){var _0x12e549=this;return new Promise(function(_0x22b099,_0x2e2c90){return db[_0x7132('0x15')][_0x7132('0x1e')]({'raw':_0x4e054e[_0x7132('0x17')]?_0x4e054e[_0x7132('0x17')][_0x7132('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e054e[_0x7132('0x17')]?_0x4e054e[_0x7132('0x17')][_0x7132('0x20')]||null:null,'attributes':_0x4e054e[_0x7132('0x17')]?_0x4e054e['options'][_0x7132('0x1c')]||null:null,'include':_0x4e054e['options']?_0x4e054e[_0x7132('0x17')][_0x7132('0x19')]?_[_0x7132('0x1a')](_0x4e054e[_0x7132('0x17')][_0x7132('0x19')],function(_0x2ea038){return{'model':db[_0x2ea038[_0x7132('0x1b')]],'as':_0x2ea038['as'],'attributes':_0x2ea038['attributes'],'include':_0x2ea038[_0x7132('0x19')]?_[_0x7132('0x1a')](_0x2ea038[_0x7132('0x19')],function(_0x2fab99){return{'model':db[_0x2fab99[_0x7132('0x1b')]],'as':_0x2fab99['as'],'attributes':_0x2fab99[_0x7132('0x1c')],'include':_0x2fab99[_0x7132('0x19')]?_[_0x7132('0x1a')](_0x2fab99['include'],function(_0x385e4c){return{'model':db[_0x385e4c['model']],'as':_0x385e4c['as'],'attributes':_0x385e4c[_0x7132('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5591a3){logger['info']('ShowTrigger',_0x4e054e);logger[_0x7132('0xb')]('ShowTrigger',_0x4e054e,JSON[_0x7132('0xd')](_0x5591a3));_0x22b099(_0x5591a3);})['catch'](function(_0x118fa4){logger[_0x7132('0xe')](_0x7132('0x1d'),_0x118fa4[_0x7132('0x10')],_0x4e054e);_0x2e2c90(_0x12e549[_0x7132('0xe')](0x1f4,_0x118fa4[_0x7132('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 98b95bf..76863dd 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 _0xe863=['update','delete','/:id','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','isAuthenticated','show','/:id/clone','clone','create'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xe863,0x136));var _0x3e86=function(_0x465643,_0x44dc4e){_0x465643=_0x465643-0x0;var _0x38ab86=_0xe863[_0x465643];return _0x38ab86;};'use strict';var multer=require(_0x3e86('0x0'));var util=require(_0x3e86('0x1'));var path=require(_0x3e86('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e86('0x3'));var router=express[_0x3e86('0x4')]();var fs_extra=require(_0x3e86('0x5'));var auth=require(_0x3e86('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3e86('0x7'));var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3e86('0x8')]);router['get']('/:id',auth[_0x3e86('0x9')](),controller[_0x3e86('0xa')]);router['post'](_0x3e86('0xb'),auth[_0x3e86('0x9')](),controller[_0x3e86('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3e86('0xd')]);router['put']('/:id',auth[_0x3e86('0x9')](),controller[_0x3e86('0xe')]);router[_0x3e86('0xf')](_0x3e86('0x10'),auth['isAuthenticated'](),controller[_0x3e86('0x11')]);module['exports']=router; \ No newline at end of file +var _0x217c=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x484c21,_0x1a3d1a){var _0x2fb5dc=function(_0x43f3aa){while(--_0x43f3aa){_0x484c21['push'](_0x484c21['shift']());}};_0x2fb5dc(++_0x1a3d1a);}(_0x217c,0x108));var _0xc217=function(_0x39aa53,_0x55f102){_0x39aa53=_0x39aa53-0x0;var _0x6e0987=_0x217c[_0x39aa53];return _0x6e0987;};'use strict';var multer=require(_0xc217('0x0'));var util=require(_0xc217('0x1'));var path=require(_0xc217('0x2'));var timeout=require(_0xc217('0x3'));var express=require(_0xc217('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc217('0x5'));var interaction=require(_0xc217('0x6'));var config=require('../../config/environment');var controller=require(_0xc217('0x7'));router[_0xc217('0x8')]('/',auth[_0xc217('0x9')](),controller[_0xc217('0xa')]);router[_0xc217('0x8')](_0xc217('0xb'),auth[_0xc217('0x9')](),controller[_0xc217('0xc')]);router['post']('/:id/clone',auth[_0xc217('0x9')](),controller['clone']);router[_0xc217('0xd')]('/',auth['isAuthenticated'](),controller[_0xc217('0xe')]);router[_0xc217('0xf')](_0xc217('0xb'),auth[_0xc217('0x9')](),controller['update']);router[_0xc217('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc217('0x11')]);module[_0xc217('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index cf31249..82f0b84 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 _0x3197=['insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','INTEGER','always','accept','uac','uas','pai','fingerprint','certificate','active','dynamic','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite'];(function(_0x275165,_0x17d6dc){var _0x54cb25=function(_0x554a55){while(--_0x554a55){_0x275165['push'](_0x275165['shift']());}};_0x54cb25(++_0x17d6dc);}(_0x3197,0x18e));var _0x7319=function(_0x3f3407,_0x163493){_0x3f3407=_0x3f3407-0x0;var _0x554169=_0x3197[_0x3f3407];return _0x554169;};'use strict';var Sequelize=require(_0x7319('0x0'));module['exports']={'name':{'type':Sequelize[_0x7319('0x1')],'allowNull':![],'unique':_0x7319('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x4'),_0x7319('0x5'),_0x7319('0x6')),'allowNull':![],'defaultValue':_0x7319('0x4')},'context':{'type':Sequelize[_0x7319('0x1')],'allowNull':![],'defaultValue':_0x7319('0x7')},'callingpres':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x8'),_0x7319('0x9'),'ALLOWED_FAILED_SCREEN',_0x7319('0xa'),_0x7319('0xb'),_0x7319('0xc'),_0x7319('0xd'),_0x7319('0xe'))},'deny':{'type':Sequelize[_0x7319('0x1')]},'permit':{'type':Sequelize[_0x7319('0x1')]},'secret':{'type':Sequelize[_0x7319('0x1')]},'md5secret':{'type':Sequelize[_0x7319('0x1')]},'remotesecret':{'type':Sequelize[_0x7319('0x1')]},'transport':{'type':Sequelize[_0x7319('0x1')],'defaultValue':'udp','set':function(_0x49cb08){this[_0x7319('0xf')](_0x7319('0x10'),_0x49cb08?_0x49cb08[_0x7319('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x7319('0x10'))?this[_0x7319('0x12')]('transport')['split'](','):null;},'comment':_0x7319('0x13')},'dtmfmode':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x14'),'info','shortinfo',_0x7319('0x15'),_0x7319('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x7319('0x3')]('yes','no',_0x7319('0x17'),_0x7319('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7319('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7319('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x7319('0x1')],'defaultValue':_0x7319('0x19'),'set':function(_0x2e97fc){this[_0x7319('0xf')]('nat',_0x2e97fc?_0x2e97fc[_0x7319('0x11')](','):null);},'get':function(){return this[_0x7319('0x12')]('nat')?this['getDataValue'](_0x7319('0x1a'))[_0x7319('0x1b')](','):null;},'comment':_0x7319('0x1c')},'callgroup':{'type':Sequelize[_0x7319('0x1')]},'namedcallgroup':{'type':Sequelize[_0x7319('0x1')]},'pickupgroup':{'type':Sequelize[_0x7319('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x7319('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7319('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7319('0x1')],'defaultValue':_0x7319('0x1d')},'allow':{'type':Sequelize[_0x7319('0x1')],'allowNull':![],'defaultValue':_0x7319('0x1e'),'set':function(_0x35d86b){this[_0x7319('0xf')](_0x7319('0x1f'),_0x35d86b?_0x35d86b[_0x7319('0x11')](';'):_0x7319('0x1e'));},'get':function(){return this['getDataValue'](_0x7319('0x1f'))?this[_0x7319('0x12')](_0x7319('0x1f'))[_0x7319('0x1b')](';'):null;},'comment':_0x7319('0x20')},'autoframing':{'type':Sequelize[_0x7319('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x7319('0x1')],'defaultValue':_0x7319('0x21'),'set':function(_0x5825f8){this['setDataValue'](_0x7319('0x22'),_0x5825f8?_0x5825f8[_0x7319('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x7319('0x22'))?this['getDataValue'](_0x7319('0x22'))[_0x7319('0x1b')](','):null;},'comment':_0x7319('0x23')},'trustrpid':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7319('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x7319('0x24'),'no')},'useclientcode':{'type':Sequelize[_0x7319('0x3')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x7319('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7319('0x1')]},'callcounter':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x7319('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'allowsubscribe':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'allowtransfer':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7319('0x24'),'no')},'subscribecontext':{'type':Sequelize[_0x7319('0x1')]},'template':{'type':Sequelize[_0x7319('0x1')]},'videosupport':{'type':Sequelize[_0x7319('0x3')]('yes','no',_0x7319('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7319('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'mailbox':{'type':Sequelize[_0x7319('0x1')]},'session_timers':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x27'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x7319('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x7319('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x28'),_0x7319('0x29')),'defaultValue':_0x7319('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x7319('0x1')]},'regexten':{'type':Sequelize[_0x7319('0x1')]},'fromdomain':{'type':Sequelize[_0x7319('0x1')]},'fromuser':{'type':Sequelize[_0x7319('0x1')]},'port':{'type':Sequelize[_0x7319('0x25')](0x5)},'qualify':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7319('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x7319('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x7319('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7319('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7319('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no',_0x7319('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7319('0x1')]},'callbackextension':{'type':Sequelize[_0x7319('0x1')]},'timert1':{'type':Sequelize[_0x7319('0x25')](0xb)},'timerb':{'type':Sequelize[_0x7319('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x7319('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x7319('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x7319('0x1')]},'use_q850_reason':{'type':Sequelize[_0x7319('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'icesupport':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'dtlsenable':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'dtlsverify':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no',_0x7319('0x2b'),_0x7319('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x7319('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x7319('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x7319('0x1')]},'dtlscapath':{'type':Sequelize[_0x7319('0x1')]},'dtlssetup':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x2d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7319('0x1')]},'usereqphone':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7319('0x1')]},'recordofffeature':{'type':Sequelize[_0x7319('0x1')]},'call_limit':{'type':Sequelize[_0x7319('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7319('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'vmexten':{'type':Sequelize[_0x7319('0x1')]},'mohinterpret':{'type':Sequelize[_0x7319('0x1')]},'mohsuggest':{'type':Sequelize[_0x7319('0x1')]},'parkinglot':{'type':Sequelize[_0x7319('0x1')]},'description':{'type':Sequelize[_0x7319('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x7319('0x2e')},'canreinvite':{'type':Sequelize['ENUM'](_0x7319('0x24'),'no',_0x7319('0x17'),_0x7319('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7319('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7319('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7319('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xf25f=['join','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','active','passive','nonat','update,nonat','BOOLEAN','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','update','force_rport,comedia','nat'];(function(_0x24ea89,_0x426346){var _0x441f37=function(_0x49b6d9){while(--_0x49b6d9){_0x24ea89['push'](_0x24ea89['shift']());}};_0x441f37(++_0x426346);}(_0xf25f,0xac));var _0xff25=function(_0x4f58e9,_0x4a22a9){_0x4f58e9=_0x4f58e9-0x0;var _0x140a90=_0xf25f[_0x4f58e9];return _0x140a90;};'use strict';var Sequelize=require('sequelize');module[_0xff25('0x0')]={'name':{'type':Sequelize[_0xff25('0x1')],'allowNull':![],'unique':_0xff25('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xff25('0x3')]('friend',_0xff25('0x4'),_0xff25('0x5')),'allowNull':![],'defaultValue':_0xff25('0x6')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xff25('0x7')},'callingpres':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x8'),_0xff25('0x9'),_0xff25('0xa'),'ALLOWED',_0xff25('0xb'),_0xff25('0xc'),_0xff25('0xd'),_0xff25('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xff25('0x1')]},'remotesecret':{'type':Sequelize[_0xff25('0x1')]},'transport':{'type':Sequelize[_0xff25('0x1')],'defaultValue':_0xff25('0xf'),'set':function(_0x1e9360){this[_0xff25('0x10')]('transport',_0x1e9360?_0x1e9360['join'](','):null);},'get':function(){return this[_0xff25('0x11')]('transport')?this[_0xff25('0x11')](_0xff25('0x12'))['split'](','):null;},'comment':_0xff25('0x13')},'dtmfmode':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x14'),_0xff25('0x15'),'shortinfo',_0xff25('0x16'),_0xff25('0x17')),'defaultValue':_0xff25('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0xff25('0x18'),'no','nonat',_0xff25('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xff25('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xff25('0x1a'),'set':function(_0x415d9d){this[_0xff25('0x10')](_0xff25('0x1b'),_0x415d9d?_0x415d9d[_0xff25('0x1c')](','):null);},'get':function(){return this[_0xff25('0x11')](_0xff25('0x1b'))?this[_0xff25('0x11')](_0xff25('0x1b'))[_0xff25('0x1d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xff25('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xff25('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xff25('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xff25('0x1')],'defaultValue':_0xff25('0x1e')},'allow':{'type':Sequelize[_0xff25('0x1')],'allowNull':![],'defaultValue':_0xff25('0x1f'),'set':function(_0x384790){this[_0xff25('0x10')](_0xff25('0x20'),_0x384790?_0x384790[_0xff25('0x1c')](';'):_0xff25('0x1f'));},'get':function(){return this['getDataValue'](_0xff25('0x20'))?this['getDataValue'](_0xff25('0x20'))[_0xff25('0x1d')](';'):null;},'comment':_0xff25('0x21')},'autoframing':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'insecure':{'type':Sequelize[_0xff25('0x1')],'defaultValue':'port,invite','set':function(_0x4ada1f){this[_0xff25('0x10')](_0xff25('0x22'),_0x4ada1f?_0x4ada1f[_0xff25('0x1c')](','):null);},'get':function(){return this[_0xff25('0x11')](_0xff25('0x22'))?this[_0xff25('0x11')]('insecure')[_0xff25('0x1d')](','):null;},'comment':_0xff25('0x23')},'trustrpid':{'type':Sequelize[_0xff25('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xff25('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'accountcode':{'type':Sequelize[_0xff25('0x24')](0xb)},'setvar':{'type':Sequelize[_0xff25('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xff25('0x25')},'amaflags':{'type':Sequelize[_0xff25('0x1')]},'callcounter':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xff25('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xff25('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xff25('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xff25('0x1')]},'template':{'type':Sequelize[_0xff25('0x1')]},'videosupport':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no',_0xff25('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'mailbox':{'type':Sequelize[_0xff25('0x1')]},'session_timers':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x27'),_0xff25('0x28'),_0xff25('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xff25('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xff25('0x3')]('uac',_0xff25('0x2a')),'defaultValue':_0xff25('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xff25('0x1')]},'regexten':{'type':Sequelize[_0xff25('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xff25('0x1')]},'port':{'type':Sequelize[_0xff25('0x24')](0x5)},'qualify':{'type':Sequelize[_0xff25('0x3')]('yes','no'),'defaultValue':_0xff25('0x18')},'keepalive':{'type':Sequelize[_0xff25('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xff25('0x1')]},'rtptimeout':{'type':Sequelize[_0xff25('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xff25('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xff25('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xff25('0x3')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xff25('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xff25('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xff25('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xff25('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xff25('0x1')]},'maxforwards':{'type':Sequelize[_0xff25('0x24')](0xb)},'encryption':{'type':Sequelize[_0xff25('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'force_avp':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xff25('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0xff25('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no',_0xff25('0x2b'),_0xff25('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xff25('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xff25('0x1')]},'dtlscipher':{'type':Sequelize[_0xff25('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xff25('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xff25('0x2d'),_0xff25('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xff25('0x1')]},'usereqphone':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xff25('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xff25('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xff25('0x1')]},'mohinterpret':{'type':Sequelize[_0xff25('0x1')]},'mohsuggest':{'type':Sequelize[_0xff25('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xff25('0x1')]},'host':{'type':Sequelize[_0xff25('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xff25('0x3')](_0xff25('0x18'),'no',_0xff25('0x2f'),_0xff25('0x19'),_0xff25('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xff25('0x1')]},'otherFields':{'type':Sequelize[_0xff25('0x1')]},'active':{'type':Sequelize[_0xff25('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 3ae7cda..8a2608d 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 _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x21cd14,_0xc37f17){var _0x21cc6a=function(_0x16f658){while(--_0x16f658){_0x21cd14['push'](_0x21cd14['shift']());}};_0x21cc6a(++_0xc37f17);}(_0x98a8,0x12c));var _0x898a=function(_0x284355,_0x3d323f){_0x284355=_0x284355-0x0;var _0x14ada3=_0x98a8[_0x284355];return _0x14ada3;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file +var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x52ece0,_0xa385f){var _0x1fa339=function(_0x3d1b96){while(--_0x3d1b96){_0x52ece0['push'](_0x52ece0['shift']());}};_0x1fa339(++_0xa385f);}(_0xe14d,0x1ee));var _0xde14=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xe14d[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 33931f8..792206a 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 _0xe9b8=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','lodash'];(function(_0x332f44,_0x33ded1){var _0x318b5e=function(_0x1af4d0){while(--_0x1af4d0){_0x332f44['push'](_0x332f44['shift']());}};_0x318b5e(++_0x33ded1);}(_0xe9b8,0x1a3));var _0x8e9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe9b8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e9b('0x0'));var util=require(_0x8e9b('0x1'));var logger=require(_0x8e9b('0x2'))('api');var moment=require(_0x8e9b('0x3'));var BPromise=require(_0x8e9b('0x4'));var rp=require(_0x8e9b('0x5'));var fs=require('fs');var path=require(_0x8e9b('0x6'));var rimraf=require(_0x8e9b('0x7'));var config=require(_0x8e9b('0x8'));var attributes=require(_0x8e9b('0x9'));module['exports']=function(_0x231867,_0x3fa317){return _0x231867[_0x8e9b('0xa')](_0x8e9b('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0dbb=['lodash','util','api','moment','request-promise','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x30652d,_0x3518b6){var _0x1db397=function(_0x28f481){while(--_0x28f481){_0x30652d['push'](_0x30652d['shift']());}};_0x1db397(++_0x3518b6);}(_0x0dbb,0x6e));var _0xb0db=function(_0x33bf72,_0x2a0651){_0x33bf72=_0x33bf72-0x0;var _0x49fe01=_0x0dbb[_0x33bf72];return _0x49fe01;};'use strict';var _=require(_0xb0db('0x0'));var util=require(_0xb0db('0x1'));var logger=require('../../config/logger')(_0xb0db('0x2'));var moment=require(_0xb0db('0x3'));var BPromise=require('bluebird');var rp=require(_0xb0db('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb0db('0x5'));var attributes=require(_0xb0db('0x6'));module[_0xb0db('0x7')]=function(_0x35239e,_0x58b369){return _0x35239e[_0xb0db('0x8')](_0xb0db('0x9'),attributes,{'tableName':_0xb0db('0xa'),'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 778d494..f22a640 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 _0xd50a=['where','attributes','limit','include','map','model','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','findAll','options','raw'];(function(_0x26fbe1,_0xd9fa2c){var _0x41f9be=function(_0x3b8504){while(--_0x3b8504){_0x26fbe1['push'](_0x26fbe1['shift']());}};_0x41f9be(++_0xd9fa2c);}(_0xd50a,0x188));var _0xad50=function(_0x1b656b,_0x35013f){_0x1b656b=_0x1b656b-0x0;var _0xabcce7=_0xd50a[_0x1b656b];return _0xabcce7;};'use strict';var _=require(_0xad50('0x0'));var util=require(_0xad50('0x1'));var moment=require(_0xad50('0x2'));var BPromise=require(_0xad50('0x3'));var rs=require(_0xad50('0x4'));var fs=require('fs');var Redis=require(_0xad50('0x5'));var db=require(_0xad50('0x6'))['db'];var utils=require(_0xad50('0x7'));var logger=require(_0xad50('0x8'))('rpc');var config=require(_0xad50('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xad50('0xa')][_0xad50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x376075,_0x31513c,_0x140300){return new BPromise(function(_0x1ccd87,_0x421fb0){return client[_0xad50('0xc')](_0x376075,_0x140300)[_0xad50('0xd')](function(_0xa9b24e){logger[_0xad50('0xe')](_0xad50('0xf'),_0x31513c,_0xad50('0x10'));logger[_0xad50('0x11')](_0xad50('0x12'),_0x31513c,_0xad50('0x10'),JSON[_0xad50('0x13')](_0xa9b24e));if(_0xa9b24e[_0xad50('0x14')]){if(_0xa9b24e[_0xad50('0x14')]['code']===0x1f4){logger[_0xad50('0x14')](_0xad50('0xf'),_0x31513c,_0xa9b24e[_0xad50('0x14')]['message']);return _0x421fb0(_0xa9b24e[_0xad50('0x14')][_0xad50('0x15')]);}logger[_0xad50('0x14')](_0xad50('0xf'),_0x31513c,_0xa9b24e[_0xad50('0x14')][_0xad50('0x15')]);return _0x1ccd87(_0xa9b24e[_0xad50('0x14')][_0xad50('0x15')]);}else{logger[_0xad50('0xe')](_0xad50('0xf'),_0x31513c,_0xad50('0x10'));_0x1ccd87(_0xa9b24e[_0xad50('0x16')]['message']);}})[_0xad50('0x17')](function(_0x49410e){logger[_0xad50('0x14')](_0xad50('0xf'),_0x31513c,_0x49410e);_0x421fb0(_0x49410e);});});}exports[_0xad50('0x18')]=function(_0x518c60){var _0x18563b=this;return new Promise(function(_0x6d1023,_0x2e709e){return db['Trunk'][_0xad50('0x19')]({'raw':_0x518c60['options']?_0x518c60[_0xad50('0x1a')][_0xad50('0x1b')]===undefined?!![]:![]:!![],'where':_0x518c60[_0xad50('0x1a')]?_0x518c60['options'][_0xad50('0x1c')]||null:null,'attributes':_0x518c60['options']?_0x518c60[_0xad50('0x1a')][_0xad50('0x1d')]||null:null,'limit':_0x518c60[_0xad50('0x1a')]?_0x518c60[_0xad50('0x1a')][_0xad50('0x1e')]||null:null,'include':_0x518c60['options']?_0x518c60[_0xad50('0x1a')][_0xad50('0x1f')]?_[_0xad50('0x20')](_0x518c60[_0xad50('0x1a')]['include'],function(_0x187af5){return{'model':db[_0x187af5[_0xad50('0x21')]],'as':_0x187af5['as'],'attributes':_0x187af5[_0xad50('0x1d')],'include':_0x187af5[_0xad50('0x1f')]?_['map'](_0x187af5[_0xad50('0x1f')],function(_0x108ea4){return{'model':db[_0x108ea4[_0xad50('0x21')]],'as':_0x108ea4['as'],'attributes':_0x108ea4[_0xad50('0x1d')],'include':_0x108ea4[_0xad50('0x1f')]?_['map'](_0x108ea4[_0xad50('0x1f')],function(_0x3155e0){return{'model':db[_0x3155e0['model']],'as':_0x3155e0['as'],'attributes':_0x3155e0[_0xad50('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xad50('0xd')](function(_0x43cd8b){logger[_0xad50('0xe')](_0xad50('0x18'),_0x518c60);logger[_0xad50('0x11')](_0xad50('0x18'),_0x518c60,JSON['stringify'](_0x43cd8b));_0x6d1023(_0x43cd8b);})[_0xad50('0x17')](function(_0x2de651){logger[_0xad50('0x14')]('GetTrunk',_0x2de651[_0xad50('0x15')],_0x518c60);_0x2e709e(_0x18563b[_0xad50('0x14')](0x1f4,_0x2de651['message']));});});};exports[_0xad50('0x22')]=function(_0x134bbc){var _0x396290=this;return new Promise(function(_0x17d6fb,_0x2f5fd9){return db['Trunk']['find']({'raw':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')][_0xad50('0x1b')]===undefined?!![]:![]:!![],'where':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')][_0xad50('0x1c')]||null:null,'attributes':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')][_0xad50('0x1d')]||null:null,'include':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')]['include']?_[_0xad50('0x20')](_0x134bbc[_0xad50('0x1a')]['include'],function(_0x5ec73c){return{'model':db[_0x5ec73c[_0xad50('0x21')]],'as':_0x5ec73c['as'],'attributes':_0x5ec73c['attributes'],'include':_0x5ec73c[_0xad50('0x1f')]?_[_0xad50('0x20')](_0x5ec73c[_0xad50('0x1f')],function(_0x425180){return{'model':db[_0x425180[_0xad50('0x21')]],'as':_0x425180['as'],'attributes':_0x425180[_0xad50('0x1d')],'include':_0x425180['include']?_['map'](_0x425180[_0xad50('0x1f')],function(_0x38b322){return{'model':db[_0x38b322[_0xad50('0x21')]],'as':_0x38b322['as'],'attributes':_0x38b322[_0xad50('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xad50('0xd')](function(_0x166fae){logger['info'](_0xad50('0x22'),_0x134bbc);logger['debug']('ShowTrunk',_0x134bbc,JSON[_0xad50('0x13')](_0x166fae));_0x17d6fb(_0x166fae);})['catch'](function(_0x28f1c2){logger[_0xad50('0x14')]('ShowTrunk',_0x28f1c2[_0xad50('0x15')],_0x134bbc);_0x2f5fd9(_0x396290[_0xad50('0x14')](0x1f4,_0x28f1c2['message']));});});}; \ No newline at end of file +var _0x4ab6=['include','map','model','attributes','GetTrunk','debug','stringify','ShowTrunk','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','options','raw','where','limit'];(function(_0x432732,_0x435e7b){var _0x45350a=function(_0x1b026a){while(--_0x1b026a){_0x432732['push'](_0x432732['shift']());}};_0x45350a(++_0x435e7b);}(_0x4ab6,0x1e5));var _0x64ab=function(_0x1dd2ca,_0x2652a4){_0x1dd2ca=_0x1dd2ca-0x0;var _0x223b68=_0x4ab6[_0x1dd2ca];return _0x223b68;};'use strict';var _=require('lodash');var util=require(_0x64ab('0x0'));var moment=require(_0x64ab('0x1'));var BPromise=require(_0x64ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64ab('0x3'));var db=require(_0x64ab('0x4'))['db'];var utils=require(_0x64ab('0x5'));var logger=require(_0x64ab('0x6'))('rpc');var config=require(_0x64ab('0x7'));var jayson=require(_0x64ab('0x8'));var client=jayson[_0x64ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x246546,_0x2e3bfd,_0xc103cd){return new BPromise(function(_0x28d76f,_0x2d4271){return client[_0x64ab('0xa')](_0x246546,_0xc103cd)[_0x64ab('0xb')](function(_0x208eed){logger[_0x64ab('0xc')](_0x64ab('0xd'),_0x2e3bfd,_0x64ab('0xe'));logger['debug'](_0x64ab('0xf'),_0x2e3bfd,_0x64ab('0xe'),JSON['stringify'](_0x208eed));if(_0x208eed['error']){if(_0x208eed['error'][_0x64ab('0x10')]===0x1f4){logger[_0x64ab('0x11')](_0x64ab('0xd'),_0x2e3bfd,_0x208eed[_0x64ab('0x11')][_0x64ab('0x12')]);return _0x2d4271(_0x208eed[_0x64ab('0x11')][_0x64ab('0x12')]);}logger[_0x64ab('0x11')](_0x64ab('0xd'),_0x2e3bfd,_0x208eed[_0x64ab('0x11')][_0x64ab('0x12')]);return _0x28d76f(_0x208eed[_0x64ab('0x11')][_0x64ab('0x12')]);}else{logger[_0x64ab('0xc')](_0x64ab('0xd'),_0x2e3bfd,_0x64ab('0xe'));_0x28d76f(_0x208eed[_0x64ab('0x13')][_0x64ab('0x12')]);}})[_0x64ab('0x14')](function(_0x29df25){logger['error'](_0x64ab('0xd'),_0x2e3bfd,_0x29df25);_0x2d4271(_0x29df25);});});}exports['GetTrunk']=function(_0x4adbbc){var _0x39c689=this;return new Promise(function(_0x4b5d1e,_0x206f0b){return db['Trunk']['findAll']({'raw':_0x4adbbc['options']?_0x4adbbc[_0x64ab('0x15')][_0x64ab('0x16')]===undefined?!![]:![]:!![],'where':_0x4adbbc[_0x64ab('0x15')]?_0x4adbbc['options'][_0x64ab('0x17')]||null:null,'attributes':_0x4adbbc['options']?_0x4adbbc[_0x64ab('0x15')]['attributes']||null:null,'limit':_0x4adbbc[_0x64ab('0x15')]?_0x4adbbc[_0x64ab('0x15')][_0x64ab('0x18')]||null:null,'include':_0x4adbbc['options']?_0x4adbbc[_0x64ab('0x15')][_0x64ab('0x19')]?_[_0x64ab('0x1a')](_0x4adbbc[_0x64ab('0x15')]['include'],function(_0x4d415c){return{'model':db[_0x4d415c[_0x64ab('0x1b')]],'as':_0x4d415c['as'],'attributes':_0x4d415c[_0x64ab('0x1c')],'include':_0x4d415c[_0x64ab('0x19')]?_[_0x64ab('0x1a')](_0x4d415c['include'],function(_0x5adf51){return{'model':db[_0x5adf51['model']],'as':_0x5adf51['as'],'attributes':_0x5adf51[_0x64ab('0x1c')],'include':_0x5adf51[_0x64ab('0x19')]?_[_0x64ab('0x1a')](_0x5adf51[_0x64ab('0x19')],function(_0x44119e){return{'model':db[_0x44119e[_0x64ab('0x1b')]],'as':_0x44119e['as'],'attributes':_0x44119e[_0x64ab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x64ab('0xb')](function(_0x4b8737){logger[_0x64ab('0xc')](_0x64ab('0x1d'),_0x4adbbc);logger[_0x64ab('0x1e')]('GetTrunk',_0x4adbbc,JSON[_0x64ab('0x1f')](_0x4b8737));_0x4b5d1e(_0x4b8737);})[_0x64ab('0x14')](function(_0x961f8e){logger[_0x64ab('0x11')](_0x64ab('0x1d'),_0x961f8e[_0x64ab('0x12')],_0x4adbbc);_0x206f0b(_0x39c689[_0x64ab('0x11')](0x1f4,_0x961f8e[_0x64ab('0x12')]));});});};exports[_0x64ab('0x20')]=function(_0x40ad74){var _0x2b2bef=this;return new Promise(function(_0x32a2bb,_0x522e8b){return db['Trunk'][_0x64ab('0x21')]({'raw':_0x40ad74['options']?_0x40ad74['options'][_0x64ab('0x16')]===undefined?!![]:![]:!![],'where':_0x40ad74[_0x64ab('0x15')]?_0x40ad74['options']['where']||null:null,'attributes':_0x40ad74['options']?_0x40ad74['options'][_0x64ab('0x1c')]||null:null,'include':_0x40ad74['options']?_0x40ad74['options']['include']?_[_0x64ab('0x1a')](_0x40ad74[_0x64ab('0x15')][_0x64ab('0x19')],function(_0x2b7ff3){return{'model':db[_0x2b7ff3[_0x64ab('0x1b')]],'as':_0x2b7ff3['as'],'attributes':_0x2b7ff3[_0x64ab('0x1c')],'include':_0x2b7ff3[_0x64ab('0x19')]?_[_0x64ab('0x1a')](_0x2b7ff3[_0x64ab('0x19')],function(_0x1981ab){return{'model':db[_0x1981ab[_0x64ab('0x1b')]],'as':_0x1981ab['as'],'attributes':_0x1981ab['attributes'],'include':_0x1981ab['include']?_['map'](_0x1981ab[_0x64ab('0x19')],function(_0x465a97){return{'model':db[_0x465a97[_0x64ab('0x1b')]],'as':_0x465a97['as'],'attributes':_0x465a97['attributes']};}):[]};}):[]};}):[]:[]})[_0x64ab('0xb')](function(_0x320a2a){logger[_0x64ab('0xc')](_0x64ab('0x20'),_0x40ad74);logger[_0x64ab('0x1e')](_0x64ab('0x20'),_0x40ad74,JSON['stringify'](_0x320a2a));_0x32a2bb(_0x320a2a);})[_0x64ab('0x14')](function(_0x302cec){logger[_0x64ab('0x11')](_0x64ab('0x20'),_0x302cec[_0x64ab('0x12')],_0x40ad74);_0x522e8b(_0x2b2bef[_0x64ab('0x11')](0x1f4,_0x302cec['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 9726d60..89bf211 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff78=['put','/:id','isAuthenticated','express','Router','../../components/auth/service'];(function(_0x397a0b,_0x1a9fe7){var _0x5f3b98=function(_0x424a69){while(--_0x424a69){_0x397a0b['push'](_0x397a0b['shift']());}};_0x5f3b98(++_0x1a9fe7);}(_0xff78,0x159));var _0x8ff7=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0xff78[_0x148879];return _0x4f7027;};'use strict';var express=require(_0x8ff7('0x0'));var router=express[_0x8ff7('0x1')]();var auth=require(_0x8ff7('0x2'));var controller=require('./user-setting.controller');router[_0x8ff7('0x3')](_0x8ff7('0x4'),auth[_0x8ff7('0x5')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xbb1c=['update','exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbb1c,0x173));var _0xcbb1=function(_0x9ea8c2,_0xc86974){_0x9ea8c2=_0x9ea8c2-0x0;var _0x56cf27=_0xbb1c[_0x9ea8c2];return _0x56cf27;};'use strict';var express=require(_0xcbb1('0x0'));var router=express[_0xcbb1('0x1')]();var auth=require(_0xcbb1('0x2'));var controller=require(_0xcbb1('0x3'));router[_0xcbb1('0x4')](_0xcbb1('0x5'),auth[_0xcbb1('0x6')](),controller[_0xcbb1('0x7')]);module[_0xcbb1('0x8')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index b6f636e..84a5a29 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b7f=['debug','exports','ENUM','error','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x6b7f,0x171));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6b7('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning','info',_0xf6b7('0x1')];module[_0xf6b7('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf6b7('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf6b7('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf6b7('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf6b7('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf6b7('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf6b7('0x8')],'unique':_0xf6b7('0x9')}}; \ No newline at end of file +var _0xbf8b=['INTEGER','UserId','error','warning','info','debug','exports','BOOLEAN','TEXT','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf8b,0x1b0));var _0xbbf8=function(_0x3b5b3d,_0x724a61){_0x3b5b3d=_0x3b5b3d-0x0;var _0x124686=_0xbf8b[_0x3b5b3d];return _0x124686;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xbbf8('0x0'),_0xbbf8('0x1'),_0xbbf8('0x2'),_0xbbf8('0x3')];module[_0xbbf8('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xbbf8('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xbbf8('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xbbf8('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xbbf8('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xbbf8('0x8')],'unique':_0xbbf8('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index bf0a97a..6fb9dc4 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63bb=['../../mysqldb','socket.io-emitter','register','redis','defaults','json','update','then','name','status','send','user','role','admin','Unauthorized','params','UserSetting','body','lodash','ioredis','../../config/logger','api','../../config/environment'];(function(_0x5b638d,_0x19c25d){var _0x2fc633=function(_0x19c392){while(--_0x19c392){_0x5b638d['push'](_0x5b638d['shift']());}};_0x2fc633(++_0x19c25d);}(_0x63bb,0xf8));var _0xb63b=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x63bb[_0xf26c2e];return _0x46ecb4;};'use strict';var _=require(_0xb63b('0x0'));var Redis=require(_0xb63b('0x1'));var logger=require(_0xb63b('0x2'))(_0xb63b('0x3'));var config=require(_0xb63b('0x4'));var db=require(_0xb63b('0x5'))['db'];var socket=require(_0xb63b('0x6'))(new Redis(config['redis']));require('./user-setting.socket')[_0xb63b('0x7')](socket);config[_0xb63b('0x8')]=_[_0xb63b('0x9')](config[_0xb63b('0x8')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3eb1be,_0x2a27f9){_0x2a27f9=_0x2a27f9||0xc8;return function(_0x2aa873){if(_0x2aa873){return _0x3eb1be['status'](_0x2a27f9)[_0xb63b('0xa')](_0x2aa873);}};}function saveUpdates(_0x46a6ea){return function(_0x4df157){if(_0x4df157){return _0x4df157[_0xb63b('0xb')](_0x46a6ea)[_0xb63b('0xc')](function(_0x254e59){return _0x254e59;});}return null;};}function handleEntityNotFound(_0x40a21e){return function(_0x2b2574){if(!_0x2b2574){_0x40a21e['sendStatus'](0x194);}return _0x2b2574;};}function handleError(_0x5255ad,_0x3a22a6){_0x3a22a6=_0x3a22a6||0x1f4;return function(_0xac9d51){logger['error'](_0xac9d51['stack']);if(_0xac9d51[_0xb63b('0xd')]){delete _0xac9d51[_0xb63b('0xd')];}_0x5255ad[_0xb63b('0xe')](_0x3a22a6)[_0xb63b('0xf')](_0xac9d51);};}exports['update']=function(_0x33fa77,_0x16c594){if(_0x33fa77[_0xb63b('0x10')][_0xb63b('0x11')]!==_0xb63b('0x12'))throw new Error(_0xb63b('0x13'));if(isNaN(Number(_0x33fa77[_0xb63b('0x14')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xb63b('0x15')]['find']({'where':{'id':_0x33fa77[_0xb63b('0x14')]['id']}})[_0xb63b('0xc')](handleEntityNotFound(_0x16c594,null))[_0xb63b('0xc')](saveUpdates(_0x33fa77[_0xb63b('0x16')],null))[_0xb63b('0xc')](respondWithResult(_0x16c594,null))['catch'](handleError(_0x16c594,null));}; \ No newline at end of file +var _0x0bde=['ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','status','json','update','then','stack','name','user','role','admin','Unauthorized','params','body'];(function(_0xd8fba6,_0x363e6){var _0x3fcfd9=function(_0x984298){while(--_0x984298){_0xd8fba6['push'](_0xd8fba6['shift']());}};_0x3fcfd9(++_0x363e6);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var Redis=require(_0xe0bd('0x0'));var logger=require('../../config/logger')(_0xe0bd('0x1'));var config=require(_0xe0bd('0x2'));var db=require(_0xe0bd('0x3'))['db'];var socket=require(_0xe0bd('0x4'))(new Redis(config[_0xe0bd('0x5')]));require('./user-setting.socket')[_0xe0bd('0x6')](socket);config[_0xe0bd('0x5')]=_[_0xe0bd('0x7')](config[_0xe0bd('0x5')],{'host':_0xe0bd('0x8'),'port':0x18eb});function respondWithResult(_0x26393f,_0x217145){_0x217145=_0x217145||0xc8;return function(_0x491dc7){if(_0x491dc7){return _0x26393f[_0xe0bd('0x9')](_0x217145)[_0xe0bd('0xa')](_0x491dc7);}};}function saveUpdates(_0xb17265){return function(_0x2d32c6){if(_0x2d32c6){return _0x2d32c6[_0xe0bd('0xb')](_0xb17265)[_0xe0bd('0xc')](function(_0x475265){return _0x475265;});}return null;};}function handleEntityNotFound(_0x58d892){return function(_0x561b74){if(!_0x561b74){_0x58d892['sendStatus'](0x194);}return _0x561b74;};}function handleError(_0x47f96d,_0x44ffa9){_0x44ffa9=_0x44ffa9||0x1f4;return function(_0x5e2a24){logger['error'](_0x5e2a24[_0xe0bd('0xd')]);if(_0x5e2a24[_0xe0bd('0xe')]){delete _0x5e2a24['name'];}_0x47f96d[_0xe0bd('0x9')](_0x44ffa9)['send'](_0x5e2a24);};}exports[_0xe0bd('0xb')]=function(_0x436535,_0x3b2fb1){if(_0x436535[_0xe0bd('0xf')][_0xe0bd('0x10')]!==_0xe0bd('0x11'))throw new Error(_0xe0bd('0x12'));if(isNaN(Number(_0x436535[_0xe0bd('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting']['find']({'where':{'id':_0x436535[_0xe0bd('0x13')]['id']}})[_0xe0bd('0xc')](handleEntityNotFound(_0x3b2fb1,null))[_0xe0bd('0xc')](saveUpdates(_0x436535[_0xe0bd('0x14')],null))[_0xe0bd('0xc')](respondWithResult(_0x3b2fb1,null))['catch'](handleError(_0x3b2fb1,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 26a507a..0628cf1 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb744=['hook','exports','../../mysqldb','UserSetting','save','update','emit','hasOwnProperty'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xb744,0x12a));var _0x4b74=function(_0x9adffe,_0x49b8ac){_0x9adffe=_0x9adffe-0x0;var _0x73da4=_0xb744[_0x9adffe];return _0x73da4;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x4b74('0x0'))['db'][_0x4b74('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b74('0x2'),'afterUpdate':_0x4b74('0x3'),'afterDestroy':'remove'};function emitEvent(_0x42f0fe){return function(_0x12a51d,_0x441074,_0x2702cb){UserSettingEvents[_0x4b74('0x4')](_0x42f0fe+':'+_0x12a51d['id'],_0x12a51d);UserSettingEvents[_0x4b74('0x4')](_0x42f0fe,_0x12a51d);_0x2702cb(null);};}for(var e in events){if(events[_0x4b74('0x5')](e)){var event=events[e];UserSetting[_0x4b74('0x6')](e,emitEvent(event));}}module[_0x4b74('0x7')]=UserSettingEvents; \ No newline at end of file +var _0xdbdf=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','update'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xdbdf,0x87));var _0xfdbd=function(_0x5e69f5,_0x52fbf3){_0x5e69f5=_0x5e69f5-0x0;var _0x237a73=_0xdbdf[_0x5e69f5];return _0x237a73;};'use strict';var EventEmitter=require(_0xfdbd('0x0'));var UserSetting=require(_0xfdbd('0x1'))['db'][_0xfdbd('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xfdbd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfdbd('0x4'),'afterDestroy':_0xfdbd('0x5')};function emitEvent(_0x420a45){return function(_0x13a27a,_0x594fcc,_0x568364){UserSettingEvents[_0xfdbd('0x6')](_0x420a45+':'+_0x13a27a['id'],_0x13a27a);UserSettingEvents[_0xfdbd('0x6')](_0x420a45,_0x13a27a);_0x568364(null);};}for(var e in events){if(events[_0xfdbd('0x7')](e)){var event=events[e];UserSetting[_0xfdbd('0x8')](e,emitEvent(event));}}module[_0xfdbd('0x9')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 88dbeff..9ae2dcc 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4227=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x4227,0x89));var _0x7422=function(_0x2812b7,_0x1b9dd2){_0x2812b7=_0x2812b7-0x0;var _0x4e4a48=_0x4227[_0x2812b7];return _0x4e4a48;};'use strict';var attributes=require(_0x7422('0x0'));module['exports']=function(_0x4f6e48){return _0x4f6e48[_0x7422('0x1')]('UserSetting',attributes,{'tableName':_0x7422('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17e787){if(!_0x17e787[_0x7422('0x3')])_0x17e787['clientSideLoggingEnabledSince']=null;else if(_0x17e787[_0x7422('0x4')]===null)_0x17e787[_0x7422('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xd3f5=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x579220,_0x185a18){var _0x533780=function(_0xc60d33){while(--_0xc60d33){_0x579220['push'](_0x579220['shift']());}};_0x533780(++_0x185a18);}(_0xd3f5,0x147));var _0x5d3f=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xd3f5[_0x618414];return _0x21c19a;};'use strict';var attributes=require(_0x5d3f('0x0'));module[_0x5d3f('0x1')]=function(_0x590291){return _0x590291[_0x5d3f('0x2')](_0x5d3f('0x3'),attributes,{'tableName':_0x5d3f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x432ba1){if(!_0x432ba1[_0x5d3f('0x5')])_0x432ba1[_0x5d3f('0x6')]=null;else if(_0x432ba1[_0x5d3f('0x6')]===null)_0x432ba1[_0x5d3f('0x6')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 819e81b..01c0e07 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf54e=['user-setting:update:user-','UserId','register','length','user-setting:','save','remove','update','user-setting:update','emit'];(function(_0x1e5d56,_0x8a4924){var _0x37f85b=function(_0x250679){while(--_0x250679){_0x1e5d56['push'](_0x1e5d56['shift']());}};_0x37f85b(++_0x8a4924);}(_0xf54e,0xf5));var _0xef54=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0xf54e[_0x44039a];return _0x525de5;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xef54('0x0'),_0xef54('0x1'),_0xef54('0x2')];function createListener(_0x4eddb9,_0x1d5f2a){return function(_0x19cb20){_0x1d5f2a['emit'](_0x4eddb9,_0x19cb20);if(_0x4eddb9===_0xef54('0x3')){_0x1d5f2a[_0xef54('0x4')](_0xef54('0x5')+_0x19cb20[_0xef54('0x6')],_0x19cb20);}};}exports[_0xef54('0x7')]=function(_0x30adec){for(var _0xc8e6d0=0x0,_0x2ce9eb=events[_0xef54('0x8')];_0xc8e6d0<_0x2ce9eb;_0xc8e6d0++){var _0x23560c=events[_0xc8e6d0];var _0x3fbbda=createListener(_0xef54('0x9')+_0x23560c,_0x30adec);UserSettingEvents['on'](_0x23560c,_0x3fbbda);}}; \ No newline at end of file +var _0x0a6d=['user-setting:update:user-','UserId','length','user-setting:','./user-setting.events','remove','update','emit'];(function(_0x29e871,_0x330b98){var _0x3380e3=function(_0x26eeae){while(--_0x26eeae){_0x29e871['push'](_0x29e871['shift']());}};_0x3380e3(++_0x330b98);}(_0x0a6d,0x1dc));var _0xd0a6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0a6d[_0x4b369d];return _0x571a98;};'use strict';var UserSettingEvents=require(_0xd0a6('0x0'));var events=['save',_0xd0a6('0x1'),_0xd0a6('0x2')];function createListener(_0x167a5d,_0x155da8){return function(_0x1df777){_0x155da8['emit'](_0x167a5d,_0x1df777);if(_0x167a5d==='user-setting:update'){_0x155da8[_0xd0a6('0x3')](_0xd0a6('0x4')+_0x1df777[_0xd0a6('0x5')],_0x1df777);}};}exports['register']=function(_0x4b5722){for(var _0x593b39=0x0,_0x56bcd7=events[_0xd0a6('0x6')];_0x593b39<_0x56bcd7;_0x593b39++){var _0x5cb915=events[_0x593b39];var _0x25e4ad=createListener(_0xd0a6('0x7')+_0x5cb915,_0x4b5722);UserSettingEvents['on'](_0x5cb915,_0x25e4ad);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 255a3f9..22935f4 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 _0xae60=['isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0xae60,0x1c7));var _0x0ae6=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xae60[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var path=require(_0x0ae6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var fs_extra=require(_0x0ae6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var controller=require('./user.controller');router[_0x0ae6('0x8')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xa')]);router[_0x0ae6('0x8')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0x8')]('/whoami',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xd')]);router[_0x0ae6('0x8')](_0x0ae6('0xe'),auth['isAuthenticated'](),controller[_0x0ae6('0xf')]);router[_0x0ae6('0x8')](_0x0ae6('0x10'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x11')]);router[_0x0ae6('0x8')](_0x0ae6('0x12'),controller[_0x0ae6('0x13')]);router[_0x0ae6('0x8')](_0x0ae6('0x14'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x15')]);router[_0x0ae6('0x8')](_0x0ae6('0x16'),auth['isAuthenticated'](),controller[_0x0ae6('0x17')]);router[_0x0ae6('0x8')](_0x0ae6('0x18'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x19')]);router[_0x0ae6('0x8')](_0x0ae6('0x1a'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1b')]);router[_0x0ae6('0x8')](_0x0ae6('0x1c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1d')]);router[_0x0ae6('0x8')](_0x0ae6('0x1e'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1f')]);router[_0x0ae6('0x8')](_0x0ae6('0x20'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x21')]);router[_0x0ae6('0x8')]('/:id/chat/interactions',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x22')]);router[_0x0ae6('0x8')](_0x0ae6('0x23'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x24')]);router[_0x0ae6('0x8')](_0x0ae6('0x25'),auth['isAuthenticated'](),controller[_0x0ae6('0x26')]);router[_0x0ae6('0x8')](_0x0ae6('0x27'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x28')]);router['get'](_0x0ae6('0x29'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x2a')]);router[_0x0ae6('0x8')](_0x0ae6('0x2b'),auth[_0x0ae6('0x9')](),controller['getWhatsappInteractions']);router[_0x0ae6('0x8')](_0x0ae6('0x2c'),auth['isAuthenticated'](),controller['getTeams']);router[_0x0ae6('0x8')](_0x0ae6('0x2d'),auth[_0x0ae6('0x9')](),controller['getLists']);router[_0x0ae6('0x8')](_0x0ae6('0x2e'),auth[_0x0ae6('0x9')](),controller['getAgents']);router[_0x0ae6('0x8')](_0x0ae6('0x2f'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x30')]);router[_0x0ae6('0x8')](_0x0ae6('0x31'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x0ae6('0x8')](_0x0ae6('0x32'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0x0ae6('0x8')](_0x0ae6('0x33'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x34')]);router['get'](_0x0ae6('0x35'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x36')]);router['get'](_0x0ae6('0x37'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x38')]);router[_0x0ae6('0x8')](_0x0ae6('0x39'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x3a')]);router[_0x0ae6('0x8')](_0x0ae6('0x3b'),auth[_0x0ae6('0x9')](),controller['getScheduledCalls']);router[_0x0ae6('0x8')](_0x0ae6('0x3c'),auth['isAuthenticated'](),controller[_0x0ae6('0x3d')]);router[_0x0ae6('0x3e')](_0x0ae6('0x16'),auth['isAuthenticated'](),controller[_0x0ae6('0x3f')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0ae6('0x40')]);router[_0x0ae6('0x3e')](_0x0ae6('0x41'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x42')]);router['post']('/:id/queues',auth[_0x0ae6('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x0ae6('0x43')]({'destination':function(_0x4a8a5c,_0xf669e1,_0x5232be){_0x5232be(null,path[_0x0ae6('0x44')](config[_0x0ae6('0x45')],_0x0ae6('0x46')));},'filename':function(_0x2204e5,_0x5be17f,_0x4a9c75){_0x4a9c75(null,util[_0x0ae6('0x47')](_0x0ae6('0x48'),Date[_0x0ae6('0x49')](),_0x5be17f['originalname']));}})});router[_0x0ae6('0x3e')]('/:id/avatar',upload[_0x0ae6('0x4a')](_0x0ae6('0x4b')),controller[_0x0ae6('0x4c')]);router[_0x0ae6('0x3e')](_0x0ae6('0x4d'),auth[_0x0ae6('0x9')](),controller['login']);router[_0x0ae6('0x3e')](_0x0ae6('0x4e'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x4f')]);router[_0x0ae6('0x3e')](_0x0ae6('0x50'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x51')]);router['post'](_0x0ae6('0x52'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x53')]);router[_0x0ae6('0x3e')](_0x0ae6('0x2c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x54')]);router[_0x0ae6('0x3e')](_0x0ae6('0x55'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x56')]);router[_0x0ae6('0x3e')](_0x0ae6('0x57'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x58')]);router[_0x0ae6('0x3e')](_0x0ae6('0x59'),auth[_0x0ae6('0x9')](),controller['addFaxInteractions']);router[_0x0ae6('0x3e')](_0x0ae6('0x5a'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x5b')]);router[_0x0ae6('0x3e')](_0x0ae6('0x5c'),auth['isAuthenticated'](),controller[_0x0ae6('0x5d')]);router[_0x0ae6('0x3e')](_0x0ae6('0x5e'),auth[_0x0ae6('0x9')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x5f')]);router[_0x0ae6('0x3e')]('/:id/mail_accounts',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x60')]);router['post'](_0x0ae6('0x33'),auth[_0x0ae6('0x9')](),controller['addOpenchannelAccounts']);router[_0x0ae6('0x3e')](_0x0ae6('0x35'),auth['isAuthenticated'](),controller[_0x0ae6('0x61')]);router[_0x0ae6('0x3e')](_0x0ae6('0x37'),auth['isAuthenticated'](),controller[_0x0ae6('0x62')]);router[_0x0ae6('0x3e')](_0x0ae6('0x39'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x63')]);router[_0x0ae6('0x3e')](_0x0ae6('0x3c'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x0ae6('0x64')](_0x0ae6('0x10'),auth[_0x0ae6('0x9')](),controller['update']);router[_0x0ae6('0x64')]('/:id/password',auth['isAuthenticated'](),controller[_0x0ae6('0x65')]);router[_0x0ae6('0x66')](_0x0ae6('0x18'),auth['isAuthenticated'](),controller[_0x0ae6('0x67')]);router[_0x0ae6('0x66')](_0x0ae6('0x2c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x68')]);router[_0x0ae6('0x66')](_0x0ae6('0x10'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x69')]);router[_0x0ae6('0x66')](_0x0ae6('0x55'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6a')]);router[_0x0ae6('0x66')](_0x0ae6('0x57'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x0ae6('0x66')](_0x0ae6('0x59'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6b')]);router[_0x0ae6('0x66')](_0x0ae6('0x5a'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6c')]);router[_0x0ae6('0x66')](_0x0ae6('0x5c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6d')]);router[_0x0ae6('0x66')](_0x0ae6('0x5e'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6e')]);router[_0x0ae6('0x66')](_0x0ae6('0x31'),auth['isAuthenticated'](),controller[_0x0ae6('0x6f')]);router[_0x0ae6('0x66')](_0x0ae6('0x32'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x70')]);router[_0x0ae6('0x66')](_0x0ae6('0x33'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x71')]);router[_0x0ae6('0x66')]('/:id/sms_accounts',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x72')]);router[_0x0ae6('0x66')](_0x0ae6('0x37'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x73')]);router[_0x0ae6('0x66')](_0x0ae6('0x39'),auth[_0x0ae6('0x9')](),controller['removeWhatsappAccounts']);router['delete'](_0x0ae6('0x3c'),auth[_0x0ae6('0x9')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file +var _0x1948=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami','/presence','getPresence','show','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','/:id/mail_accounts','/:id/sms_accounts','getSmsAccounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','file','addAvatar','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','/:id','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1948,0x145));var _0x8194=function(_0x3d695c,_0x2ea4f8){_0x3d695c=_0x3d695c-0x0;var _0x5b8a39=_0x1948[_0x3d695c];return _0x5b8a39;};'use strict';var multer=require(_0x8194('0x0'));var util=require(_0x8194('0x1'));var path=require(_0x8194('0x2'));var timeout=require(_0x8194('0x3'));var express=require(_0x8194('0x4'));var router=express['Router']();var fs_extra=require(_0x8194('0x5'));var auth=require(_0x8194('0x6'));var interaction=require(_0x8194('0x7'));var config=require(_0x8194('0x8'));var controller=require(_0x8194('0x9'));router[_0x8194('0xa')]('/',auth[_0x8194('0xb')](),controller[_0x8194('0xc')]);router['get'](_0x8194('0xd'),auth[_0x8194('0xb')](),controller['describe']);router[_0x8194('0xa')](_0x8194('0xe'),auth['isAuthenticated'](),controller['whoami']);router[_0x8194('0xa')](_0x8194('0xf'),auth[_0x8194('0xb')](),controller[_0x8194('0x10')]);router[_0x8194('0xa')]('/:id',auth[_0x8194('0xb')](),controller[_0x8194('0x11')]);router[_0x8194('0xa')]('/:id/avatar',controller[_0x8194('0x12')]);router[_0x8194('0xa')](_0x8194('0x13'),auth[_0x8194('0xb')](),controller[_0x8194('0x14')]);router[_0x8194('0xa')]('/:id/contacts',auth[_0x8194('0xb')](),controller[_0x8194('0x15')]);router[_0x8194('0xa')](_0x8194('0x16'),auth[_0x8194('0xb')](),controller[_0x8194('0x17')]);router[_0x8194('0xa')](_0x8194('0x18'),auth[_0x8194('0xb')](),controller['getVoiceQueuesRt']);router[_0x8194('0xa')](_0x8194('0x19'),auth['isAuthenticated'](),controller[_0x8194('0x1a')]);router['get']('/:id/recordings',auth['isAuthenticated'](),controller[_0x8194('0x1b')]);router[_0x8194('0xa')](_0x8194('0x1c'),auth[_0x8194('0xb')](),controller[_0x8194('0x1d')]);router[_0x8194('0xa')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x8194('0x1e')]);router['get'](_0x8194('0x1f'),auth[_0x8194('0xb')](),controller[_0x8194('0x20')]);router['get'](_0x8194('0x21'),auth[_0x8194('0xb')](),controller[_0x8194('0x22')]);router[_0x8194('0xa')](_0x8194('0x23'),auth[_0x8194('0xb')](),controller[_0x8194('0x24')]);router[_0x8194('0xa')](_0x8194('0x25'),auth[_0x8194('0xb')](),controller[_0x8194('0x26')]);router[_0x8194('0xa')]('/:id/whatsapp/interactions',auth[_0x8194('0xb')](),controller[_0x8194('0x27')]);router[_0x8194('0xa')](_0x8194('0x28'),auth['isAuthenticated'](),controller[_0x8194('0x29')]);router[_0x8194('0xa')](_0x8194('0x2a'),auth[_0x8194('0xb')](),controller[_0x8194('0x2b')]);router['get']('/:id/agents',auth[_0x8194('0xb')](),controller[_0x8194('0x2c')]);router[_0x8194('0xa')](_0x8194('0x2d'),auth[_0x8194('0xb')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth[_0x8194('0xb')](),controller['getFaxAccounts']);router['get'](_0x8194('0x2e'),auth[_0x8194('0xb')](),controller['getMailAccounts']);router[_0x8194('0xa')]('/:id/openchannel_accounts',auth[_0x8194('0xb')](),controller['getOpenchannelAccounts']);router[_0x8194('0xa')](_0x8194('0x2f'),auth[_0x8194('0xb')](),controller[_0x8194('0x30')]);router[_0x8194('0xa')]('/:id/chat_websites',auth[_0x8194('0xb')](),controller['getChatWebsites']);router[_0x8194('0xa')]('/:id/whatsapp_accounts',auth[_0x8194('0xb')](),controller[_0x8194('0x31')]);router[_0x8194('0xa')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x8194('0x32')]);router[_0x8194('0xa')](_0x8194('0x33'),auth[_0x8194('0xb')](),controller['getApiKey']);router['post']('/:id/contacts',auth[_0x8194('0xb')](),controller[_0x8194('0x34')]);router[_0x8194('0x35')]('/',auth[_0x8194('0xb')](),controller[_0x8194('0x36')]);router[_0x8194('0x35')]('/create_many',auth[_0x8194('0xb')](),controller[_0x8194('0x37')]);router[_0x8194('0x35')](_0x8194('0x16'),auth[_0x8194('0xb')](),controller[_0x8194('0x38')]);var upload=multer({'storage':multer[_0x8194('0x39')]({'destination':function(_0x44c8e6,_0x3627ec,_0x3965ff){_0x3965ff(null,path[_0x8194('0x3a')](config[_0x8194('0x3b')],'server/files/images/'));},'filename':function(_0x1be49d,_0x48a8ee,_0x542768){_0x542768(null,util[_0x8194('0x3c')](_0x8194('0x3d'),Date['now'](),_0x48a8ee['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0x8194('0x3e')),controller[_0x8194('0x3f')]);router[_0x8194('0x35')]('/:id/login',auth['isAuthenticated'](),controller['login']);router[_0x8194('0x35')](_0x8194('0x40'),auth[_0x8194('0xb')](),controller[_0x8194('0x41')]);router['post'](_0x8194('0x42'),auth[_0x8194('0xb')](),controller[_0x8194('0x43')]);router[_0x8194('0x35')](_0x8194('0x44'),auth['isAuthenticated'](),controller[_0x8194('0x45')]);router[_0x8194('0x35')](_0x8194('0x28'),auth[_0x8194('0xb')](),controller[_0x8194('0x46')]);router[_0x8194('0x35')](_0x8194('0x47'),auth['isAuthenticated'](),controller[_0x8194('0x48')]);router[_0x8194('0x35')](_0x8194('0x49'),auth[_0x8194('0xb')](),controller['addMailInteractions']);router['post'](_0x8194('0x4a'),auth['isAuthenticated'](),controller[_0x8194('0x4b')]);router['post'](_0x8194('0x4c'),auth['isAuthenticated'](),controller[_0x8194('0x4d')]);router[_0x8194('0x35')](_0x8194('0x4e'),auth[_0x8194('0xb')](),controller['addOpenchannelInteractions']);router[_0x8194('0x35')](_0x8194('0x4f'),auth[_0x8194('0xb')](),controller['addWhatsappInteractions']);router[_0x8194('0x35')](_0x8194('0x50'),auth[_0x8194('0xb')](),controller[_0x8194('0x51')]);router[_0x8194('0x35')]('/:id/mail_accounts',auth[_0x8194('0xb')](),controller['addMailAccounts']);router[_0x8194('0x35')](_0x8194('0x52'),auth[_0x8194('0xb')](),controller[_0x8194('0x53')]);router[_0x8194('0x35')](_0x8194('0x2f'),auth[_0x8194('0xb')](),controller[_0x8194('0x54')]);router[_0x8194('0x35')](_0x8194('0x55'),auth[_0x8194('0xb')](),controller[_0x8194('0x56')]);router[_0x8194('0x35')](_0x8194('0x57'),auth[_0x8194('0xb')](),controller[_0x8194('0x58')]);router[_0x8194('0x35')](_0x8194('0x33'),auth['isAuthenticated'](),controller[_0x8194('0x59')]);router[_0x8194('0x5a')]('/:id',auth['isAuthenticated'](),controller[_0x8194('0x5b')]);router[_0x8194('0x5a')](_0x8194('0x5c'),auth[_0x8194('0xb')](),controller[_0x8194('0x5d')]);router[_0x8194('0x5e')](_0x8194('0x16'),auth[_0x8194('0xb')](),controller[_0x8194('0x5f')]);router[_0x8194('0x5e')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x8194('0x60'),auth[_0x8194('0xb')](),controller[_0x8194('0x61')]);router[_0x8194('0x5e')](_0x8194('0x47'),auth[_0x8194('0xb')](),controller[_0x8194('0x62')]);router[_0x8194('0x5e')](_0x8194('0x49'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x8194('0x5e')](_0x8194('0x4a'),auth[_0x8194('0xb')](),controller[_0x8194('0x63')]);router[_0x8194('0x5e')](_0x8194('0x4c'),auth['isAuthenticated'](),controller[_0x8194('0x64')]);router[_0x8194('0x5e')](_0x8194('0x4e'),auth[_0x8194('0xb')](),controller[_0x8194('0x65')]);router[_0x8194('0x5e')](_0x8194('0x4f'),auth[_0x8194('0xb')](),controller['removeWhatsappInteractions']);router[_0x8194('0x5e')](_0x8194('0x50'),auth[_0x8194('0xb')](),controller[_0x8194('0x66')]);router[_0x8194('0x5e')](_0x8194('0x2e'),auth[_0x8194('0xb')](),controller[_0x8194('0x67')]);router[_0x8194('0x5e')](_0x8194('0x52'),auth[_0x8194('0xb')](),controller['removeOpenchannelAccounts']);router[_0x8194('0x5e')](_0x8194('0x2f'),auth[_0x8194('0xb')](),controller[_0x8194('0x68')]);router['delete']('/:id/chat_websites',auth[_0x8194('0xb')](),controller[_0x8194('0x69')]);router[_0x8194('0x5e')](_0x8194('0x57'),auth[_0x8194('0xb')](),controller['removeWhatsappAccounts']);router[_0x8194('0x5e')](_0x8194('0x33'),auth[_0x8194('0xb')](),controller[_0x8194('0x6a')]);module[_0x8194('0x6b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c10466c..6ad21a7 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x41d413,_0x670662){var _0x2d55c6=function(_0x28dc41){while(--_0x28dc41){_0x41d413['push'](_0x41d413['shift']());}};_0x2d55c6(++_0x670662);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xcb91[_0x231dda];return _0x3f88cb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x56888a,_0x37e91b){var _0x449a5c=function(_0x54d247){while(--_0x54d247){_0x56888a['push'](_0x56888a['shift']());}};_0x449a5c(++_0x37e91b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0xcb91[_0x5d8631];return _0x34c15e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 587fd5c..36e3686 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 _0x3bb3=['toString','desc','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','util','lodash','squel','jayson/promise','../../components/auth/service','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','register','localhost','client','http','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','update','emit','userNotification:recalc:','destroy','get','role','admin','Users','user','filter','ignore','map','value','find','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','type','key','includes','salt','getOptions','where','query','includeAll','include','true','UserSetting','userSetting','attributes','push','findAll','rows','openTabs','length','chat','sms','dataValues','fax','mail','whatsapp','params','model','differenceBy','keys','password','intersection','fields','merge','options','openchannel','all','body','addContacts','ids','internal','Setting','securePassword','validatePasswordPattern','max','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)','QueryTypes','SELECT','from','voicemail','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','106','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','Agents','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','agent','some','checkUserLimits','telephone','changePassword','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','format','removeQueues','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','concat','getContacts','hasOwnProperty','color','tag','getQueues','filters','order','sort','pick','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','lastPauseAt','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','sequelize','getAssociatedQueues','flattenDeep','addAgent','Voice','UserVoicePrefix','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','TeamVoicePrefix','VoicePrefixId','getLists','CmList','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','omit','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','lastName','CmContact','Contact','getApiKey','retrieveApiKey','token','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','queues','teams','isEmpty','inbound','flatten','getAgents','col'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3bb3,0x1b0));var _0x33bb=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x3bb3[_0x2d7f0e];return _0x110b07;};'use strict';var moment=require('moment');var util=require(_0x33bb('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x33bb('0x1'));var squel=require(_0x33bb('0x2'));var jayson=require(_0x33bb('0x3'));var Redis=require('ioredis');var authService=require(_0x33bb('0x4'));var contacts=require(_0x33bb('0x5'));var qs=require(_0x33bb('0x6'));var logger=require('../../config/logger')(_0x33bb('0x7'));var utils=require('../../config/utils');var config=require(_0x33bb('0x8'));var licenseUtil=require(_0x33bb('0x9'));var APIBadRequestError=require('../../errors/api')[_0x33bb('0xa')];var APINotFoundError=require(_0x33bb('0xb'))[_0x33bb('0xc')];var APIHandleError=require('../../errors/api')[_0x33bb('0xd')];var db=require(_0x33bb('0xe'))['db'];var socket=require(_0x33bb('0xf'))(new Redis(config[_0x33bb('0x10')]));require('./user.socket')[_0x33bb('0x11')](socket);config[_0x33bb('0x10')]=_['defaults'](config[_0x33bb('0x10')],{'host':_0x33bb('0x12'),'port':0x18eb});var amiClient=jayson[_0x33bb('0x13')][_0x33bb('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x46bd0b,_0x4f5499,_0x486f98,_0x576eab){return new Promise(function(_0x2e8710,_0x2be5c8){var _0x4da60d=_0x576eab||amiClient;return _0x4da60d['request'](_0x46bd0b,_0x486f98)[_0x33bb('0x15')](function(_0x23e19b){logger[_0x33bb('0x16')](_0x33bb('0x17'),_0x4f5499,_0x33bb('0x18'));logger[_0x33bb('0x19')](_0x33bb('0x1a'),_0x4f5499,'request\x20sent',JSON[_0x33bb('0x1b')](_0x23e19b));if(_0x23e19b[_0x33bb('0x1c')]){if(_0x23e19b[_0x33bb('0x1c')][_0x33bb('0x1d')]===0x1f4){logger[_0x33bb('0x1c')]('User,\x20%s,\x20%s',_0x4f5499,_0x23e19b['error'][_0x33bb('0x1e')]);return _0x2be5c8(_0x23e19b[_0x33bb('0x1c')][_0x33bb('0x1e')]);}logger['error'](_0x33bb('0x17'),_0x4f5499,_0x23e19b[_0x33bb('0x1c')]['message']);return _0x2e8710(_0x23e19b['error']['message']);}else{logger['info']('User,\x20%s,\x20%s',_0x4f5499,'request\x20sent');_0x2e8710(_0x23e19b['result'][_0x33bb('0x1e')]);}})[_0x33bb('0x1f')](function(_0x3dd214){logger[_0x33bb('0x1c')](_0x33bb('0x17'),_0x4f5499,_0x3dd214);_0x2be5c8(_0x3dd214);});});}function respondWithStatusCode(_0x242c5b,_0x5c0cf5){_0x5c0cf5=_0x5c0cf5||0xcc;return function(_0x513f6f){if(_0x513f6f){return _0x242c5b[_0x33bb('0x20')](_0x5c0cf5);}return _0x242c5b[_0x33bb('0x21')](_0x5c0cf5)[_0x33bb('0x22')]();};}function respondWithResult(_0x592e3d,_0x14d3d1){_0x14d3d1=_0x14d3d1||0xc8;return function(_0x498d76){if(_0x498d76){return _0x592e3d[_0x33bb('0x21')](_0x14d3d1)['json'](_0x498d76);}};}function respondWithFilteredResult(_0x5d4053,_0x3caf20){return function(_0x62114f){if(_0x62114f){var _0xe78e5a=typeof _0x3caf20[_0x33bb('0x23')]==='undefined'&&typeof _0x3caf20['limit']===_0x33bb('0x24');var _0x24ea43=_0x62114f[_0x33bb('0x25')];var _0x433d9e=_0xe78e5a?0x0:_0x3caf20[_0x33bb('0x23')];var _0x5691ed=_0xe78e5a?_0x62114f[_0x33bb('0x25')]:_0x3caf20['offset']+_0x3caf20[_0x33bb('0x26')];var _0x111e83;if(_0x5691ed>=_0x24ea43){_0x5691ed=_0x24ea43;_0x111e83=0xc8;}else{_0x111e83=0xce;}_0x5d4053[_0x33bb('0x21')](_0x111e83);return _0x5d4053[_0x33bb('0x27')]('Content-Range',_0x433d9e+'-'+_0x5691ed+'/'+_0x24ea43)[_0x33bb('0x28')](_0x62114f);}return null;};}function saveUpdates(_0x1e1ff2){return function(_0x3d18fc){if(_0x3d18fc){return _0x3d18fc[_0x33bb('0x29')](_0x1e1ff2)[_0x33bb('0x15')](function(_0x4c352f){if(_0x4c352f['role']==='agent'){socket[_0x33bb('0x2a')](_0x33bb('0x2b')+_0x4c352f['id'],_0x4c352f);}return _0x4c352f;});}return null;};}function removeEntity(_0x4cf8ed){return function(_0x3a9568){if(_0x3a9568){return _0x3a9568[_0x33bb('0x2c')]()[_0x33bb('0x15')](function(){var _0xd593=_0x3a9568[_0x33bb('0x2d')]({'plain':!![]});if(_0xd593[_0x33bb('0x2e')]===_0x33bb('0x2f'))return;var _0x5948ba=[{'name':_0x33bb('0x30'),'value':_0x33bb('0x31'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x10140b=_(_0x5948ba)[_0x33bb('0x32')](_0x33bb('0x33'))[_0x33bb('0x34')]('value')[_0x33bb('0x35')]();if(_['includes'](_0x10140b,_0xd593[_0x33bb('0x2e')])){return;}var _0x3e2051=_[_0x33bb('0x36')](_0x5948ba,['value',_0xd593['role']])[_0x33bb('0x37')];return db[_0x33bb('0x38')][_0x33bb('0x2c')]({'where':{'type':_0x3e2051,'resourceId':_0xd593['id']}})[_0x33bb('0x15')](function(){return _0x3a9568;});})[_0x33bb('0x15')](function(){_0x4cf8ed[_0x33bb('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5db134){return function(_0xfed055){if(!_0xfed055){_0x5db134[_0x33bb('0x20')](0x194);}return _0xfed055;};}function handleError(_0x3e70ed,_0x27a90e){_0x27a90e=_0x27a90e||0x1f4;return function(_0x1bf598){logger['error'](_0x1bf598[_0x33bb('0x39')]);if(_0x1bf598[_0x33bb('0x37')]){delete _0x1bf598[_0x33bb('0x37')];}_0x3e70ed[_0x33bb('0x21')](_0x27a90e)[_0x33bb('0x3a')](_0x1bf598);};}exports[_0x33bb('0x3b')]=function(_0x2cb59d,_0x389cbc){var _0x118e3d={},_0x559a3b={'count':0x0,'rows':[]};var _0x1bebfd=_(db[_0x33bb('0x3c')][_0x33bb('0x3d')])[_0x33bb('0x34')](function(_0x17d9b3){return{'name':_0x17d9b3[_0x33bb('0x3e')],'type':_0x17d9b3[_0x33bb('0x3f')][_0x33bb('0x40')]};})['filter'](function(_0x347575){return!_[_0x33bb('0x41')](['password',_0x33bb('0x42')],_0x347575[_0x33bb('0x37')]);})[_0x33bb('0x35')]();_0x118e3d=qs[_0x33bb('0x43')](_0x1bebfd,_0x2cb59d);var _0x313dfd={'where':_0x118e3d[_0x33bb('0x44')]};return db[_0x33bb('0x3c')][_0x33bb('0x25')](_0x313dfd)['then'](function(_0x2807af){_0x559a3b['count']=_0x2807af;if(_0x2cb59d[_0x33bb('0x45')][_0x33bb('0x46')]){_0x118e3d[_0x33bb('0x47')]=[{'all':!![]}];}if(_0x2cb59d[_0x33bb('0x45')]['userSetting']===_0x33bb('0x48')){_0x118e3d[_0x33bb('0x47')]=[{'model':db[_0x33bb('0x49')],'as':_0x33bb('0x4a')}];}if(!_[_0x33bb('0x41')](_0x118e3d[_0x33bb('0x4b')],'id')){_0x118e3d[_0x33bb('0x4b')][_0x33bb('0x4c')]('id');}return db['User'][_0x33bb('0x4d')](_0x118e3d);})[_0x33bb('0x15')](function(_0x3c48e8){_0x559a3b[_0x33bb('0x4e')]=_0x3c48e8;if(_0x2cb59d[_0x33bb('0x45')][_0x33bb('0x4f')]===_0x33bb('0x48')){var _0x246e92=[];for(var _0x4454f4=0x0;_0x4454f4<_0x559a3b[_0x33bb('0x4e')][_0x33bb('0x50')];_0x4454f4++){_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x51'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4]['dataValues']));_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x52'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x54'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92['push'](get_open_tabs(_0x33bb('0x55'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92[_0x33bb('0x4c')](get_open_tabs('openchannel',_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x56'),_0x559a3b['rows'][_0x4454f4][_0x33bb('0x53')]));}return Promise['all'](_0x246e92)[_0x33bb('0x15')](function(){return _0x559a3b;});}else{return _0x559a3b;}})[_0x33bb('0x15')](respondWithFilteredResult(_0x389cbc,_0x118e3d))['catch'](handleError(_0x389cbc,null));};exports['show']=function(_0x12e116,_0x5eb2e8){var _0x1746f8={'raw':![],'where':{'id':_0x12e116[_0x33bb('0x57')]['id']}},_0x4fe931={};_0x4fe931[_0x33bb('0x58')]=_[_0x33bb('0x59')](_[_0x33bb('0x5a')](db[_0x33bb('0x3c')][_0x33bb('0x3d')]),[_0x33bb('0x5b'),_0x33bb('0x42')]);_0x4fe931[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x12e116['query']);_0x4fe931['filters']=_['intersection'](_0x4fe931[_0x33bb('0x58')],_0x4fe931['query']);_0x1746f8['attributes']=_[_0x33bb('0x5c')](_0x4fe931['model'],qs[_0x33bb('0x5d')](_0x12e116['query'][_0x33bb('0x5d')]));_0x1746f8[_0x33bb('0x4b')]=_0x1746f8[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x1746f8[_0x33bb('0x4b')]:_0x4fe931[_0x33bb('0x58')];if(_0x12e116['query']['includeAll']){_0x1746f8[_0x33bb('0x47')]=[{'all':!![]}];}if(_0x12e116[_0x33bb('0x45')][_0x33bb('0x4a')]===_0x33bb('0x48')){_0x1746f8[_0x33bb('0x47')]=[{'model':db[_0x33bb('0x49')],'as':_0x33bb('0x4a')}];}_0x1746f8=_[_0x33bb('0x5e')]({},_0x1746f8,_0x12e116[_0x33bb('0x5f')]);if(!_[_0x33bb('0x41')](_0x1746f8[_0x33bb('0x4b')],'id')){_0x1746f8[_0x33bb('0x4b')][_0x33bb('0x4c')]('id');}return db[_0x33bb('0x3c')][_0x33bb('0x36')](_0x1746f8)[_0x33bb('0x15')](handleEntityNotFound(_0x5eb2e8,null))['then'](function(_0x2a7299){var _0xba2ab3=[];values=_0x2a7299;if(_0x12e116[_0x33bb('0x45')][_0x33bb('0x4f')]==='true'){_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x51'),_0x2a7299['dataValues']));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x52'),_0x2a7299[_0x33bb('0x53')]));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x60'),_0x2a7299[_0x33bb('0x53')]));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x56'),_0x2a7299['dataValues']));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x54'),_0x2a7299[_0x33bb('0x53')]));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x55'),_0x2a7299[_0x33bb('0x53')]));return Promise[_0x33bb('0x61')](_0xba2ab3);}else{return values;}})[_0x33bb('0x15')](function(){return values;})[_0x33bb('0x15')](respondWithResult(_0x5eb2e8,null))[_0x33bb('0x1f')](handleError(_0x5eb2e8,null));};exports[_0x33bb('0x29')]=function(_0x50f390,_0x5ddd80){if(_0x50f390['body']['id']){delete _0x50f390[_0x33bb('0x62')]['id'];}delete _0x50f390[_0x33bb('0x62')][_0x33bb('0x2e')];return db['User'][_0x33bb('0x36')]({'where':{'id':_0x50f390['params']['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x5ddd80,null))['then'](saveUpdates(_0x50f390[_0x33bb('0x62')],null))[_0x33bb('0x15')](respondWithResult(_0x5ddd80,null))[_0x33bb('0x1f')](handleError(_0x5ddd80,null));};exports['describe']=function(_0x1c8420,_0x324f39){return db['User']['describe']()[_0x33bb('0x15')](respondWithResult(_0x324f39,null))[_0x33bb('0x1f')](handleError(_0x324f39,null));};exports[_0x33bb('0x63')]=function(_0x2d03b4,_0x4d586d){return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x2d03b4[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x4d586d,null))[_0x33bb('0x15')](function(_0x5cf250){if(_0x5cf250){return _0x5cf250[_0x33bb('0x63')](_0x2d03b4[_0x33bb('0x62')][_0x33bb('0x64')],_['omit'](_0x2d03b4[_0x33bb('0x62')],[_0x33bb('0x64'),'id'])||{});}})[_0x33bb('0x15')](respondWithResult(_0x4d586d,null))['catch'](handleError(_0x4d586d,null));};function validateUser(_0x27cee7){return new Promise(function(_0x2eaf80,_0x3d36c4){if(_0x27cee7[_0x33bb('0x65')])return _0x2eaf80(_0x27cee7);return db[_0x33bb('0x66')]['findById'](0x1)[_0x33bb('0x15')](function(_0x90a5fb){if(_0x90a5fb[_0x33bb('0x67')])authService[_0x33bb('0x68')](_0x27cee7[_0x33bb('0x5b')]);db[_0x33bb('0x3c')][_0x33bb('0x69')]('internal')['then'](function(_0xf059a2){if(_[_0x33bb('0x6a')](_0xf059a2)){_0x27cee7[_0x33bb('0x65')]=_0x90a5fb['min_internal']||0x1;return;}if(_[_0x33bb('0x6a')](_0x90a5fb[_0x33bb('0x6b')])||_0x90a5fb['min_internal']===_0xf059a2){_0x27cee7[_0x33bb('0x65')]=_0xf059a2+0x1;return;}if(_0x90a5fb[_0x33bb('0x6b')]>_0xf059a2){_0x27cee7['internal']=_0x90a5fb['min_internal'];return;}return db['sequelize'][_0x33bb('0x45')](_0x33bb('0x6c'),{'type':db['sequelize'][_0x33bb('0x6d')][_0x33bb('0x6e')]})[_0x33bb('0x15')](function(_0x1a364b){if(_0x1a364b&&_0x1a364b[_0x33bb('0x50')]){for(var _0x31c9b8=0x0,_0x3b129d=_0x1a364b[_0x33bb('0x50')];_0x31c9b8<_0x3b129d&&_[_0x33bb('0x6a')](_0x27cee7[_0x33bb('0x65')]);_0x31c9b8++){if(_0x90a5fb[_0x33bb('0x6b')]<=_0x1a364b[_0x31c9b8][_0x33bb('0x6f')]){_0x27cee7[_0x33bb('0x65')]=_0x1a364b[_0x31c9b8]['from'];}else if(_0x90a5fb[_0x33bb('0x6b')]>_0x1a364b[_0x31c9b8][_0x33bb('0x6f')]&&_0x90a5fb[_0x33bb('0x6b')]<=_0x1a364b[_0x31c9b8]['to']){_0x27cee7[_0x33bb('0x65')]=_0x90a5fb[_0x33bb('0x6b')];}}}if(_[_0x33bb('0x6a')](_0x27cee7[_0x33bb('0x65')])){_0x27cee7['internal']=_0xf059a2+0x1;}return _0x2eaf80(_0x27cee7);});});})[_0x33bb('0x1f')](function(_0x3e7067){_0x3d36c4(_0x3e7067);});});}function updateUser(_0x4821a9){return new Promise(function(_0x4bdc91,_0x2fcae0){try{if(_0x4821a9[_0x33bb('0x70')]){_0x4821a9['mailbox']=_0x4821a9[_0x33bb('0x65')];_0x4821a9[_0x33bb('0x71')]={'mailbox':_0x4821a9[_0x33bb('0x65')],'password':_0x4821a9[_0x33bb('0x5b')],'fullname':_0x4821a9[_0x33bb('0x72')],'email':_0x4821a9[_0x33bb('0x73')]};}if(_0x4821a9['role']==='agent'){if(!_0x4821a9[_0x33bb('0x74')])_0x4821a9[_0x33bb('0x74')]=[_0x33bb('0x75'),_0x33bb('0x76'),_0x33bb('0x77'),_0x33bb('0x78'),_0x33bb('0x79'),_0x33bb('0x7a'),_0x33bb('0x7b'),_0x33bb('0x7c'),_0x33bb('0x7d'),_0x33bb('0x7e'),_0x33bb('0x7f'),_0x33bb('0x80'),_0x33bb('0x81'),_0x33bb('0x82'),_0x33bb('0x83')];}_0x4bdc91(_0x4821a9);}catch(_0x282640){_0x2fcae0(_0x282640);}});}exports[_0x33bb('0x84')]=function(_0x19ac1b,_0x35736d){if(_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x2e')]==='agent')throw new Error(_0x33bb('0x85'));if(_0x19ac1b[_0x33bb('0x62')][_0x33bb('0x2e')]===_0x33bb('0x31')&&_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error(_0x33bb('0x86'));}if(_0x19ac1b[_0x33bb('0x62')][_0x33bb('0x2e')]===_0x33bb('0x2f')&&_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error(_0x33bb('0x87'));}return licenseUtil['checkUserLimits']([_0x19ac1b[_0x33bb('0x62')]])[_0x33bb('0x15')](function(){return validateUser(_0x19ac1b[_0x33bb('0x62')]);})[_0x33bb('0x15')](function(_0x2df6e7){return updateUser(_0x2df6e7)[_0x33bb('0x15')](function(_0x16c4dc){if(_0x16c4dc[_0x33bb('0x2e')]===_0x33bb('0x2f')){_0x16c4dc[_0x33bb('0x88')]=_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x88')];delete _0x16c4dc[_0x33bb('0x89')];}return _0x16c4dc;});})[_0x33bb('0x15')](function(_0x2c8294){return db[_0x33bb('0x3c')][_0x33bb('0x84')](_0x2c8294,{'include':[{'model':db[_0x33bb('0x71')],'as':'VoiceMail'}]});})['then'](function(_0x49449b){if(_0x19ac1b[_0x33bb('0x62')][_0x33bb('0x2e')]==='user')return _0x49449b;if(_0x19ac1b[_0x33bb('0x31')]['role']!==_0x33bb('0x31'))return _0x49449b;return db[_0x33bb('0x8a')]['find']({'where':{'name':_0x49449b[_0x33bb('0x2e')]==='agent'?_0x33bb('0x8b'):_0x33bb('0x8c'),'userProfileId':_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x89')]},'raw':!![]})[_0x33bb('0x15')](function(_0x571b58){if(!_0x571b58||_0x571b58[_0x33bb('0x8d')]!=0x0)return _0x49449b;return db['UserProfileResource'][_0x33bb('0x84')]({'name':_0x49449b[_0x33bb('0x37')],'resourceId':_0x49449b['id'],'type':_0x571b58[_0x33bb('0x37')],'sectionId':_0x571b58['id']},{})[_0x33bb('0x15')](function(){return _0x49449b;});})['catch'](function(_0x3e5bfc){logger[_0x33bb('0x1c')](_0x33bb('0x8e'),_0x3e5bfc);throw _0x3e5bfc;});})[_0x33bb('0x15')](respondWithResult(_0x35736d,0xc9))['catch'](handleError(_0x35736d,null));};exports[_0x33bb('0x8f')]=function(_0x5026b1,_0x4a8748){var _0x406be1=_0x5026b1['body'];var _0x5c7368=[];if(_0x5026b1[_0x33bb('0x31')]['role']===_0x33bb('0x90'))throw new Error(_0x33bb('0x85'));if(_['some'](_0x406be1,['role',_0x33bb('0x31')])&&_0x5026b1[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error(_0x33bb('0x86'));}if(_[_0x33bb('0x91')](_0x406be1,[_0x33bb('0x2e'),_0x33bb('0x2f')])&&_0x5026b1[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x33bb('0x92')](_0x406be1)[_0x33bb('0x15')](function(){return validateUser(_0x406be1[0x0]);})[_0x33bb('0x15')](function(){for(var _0x17745b=0x1;_0x17745b<_0x406be1[_0x33bb('0x50')];_0x17745b++){var _0x28083b=_0x406be1[_0x17745b-0x1][_0x33bb('0x65')];if(!_0x406be1[_0x17745b][_0x33bb('0x65')])_0x406be1[_0x17745b][_0x33bb('0x65')]=_0x28083b+0x1;_0x5c7368['push'](validateUser(_0x406be1[_0x17745b]));}return Promise[_0x33bb('0x61')](_0x5c7368);})['then'](function(){_0x5c7368=[];for(var _0xa971e1=0x0;_0xa971e1<_0x406be1[_0x33bb('0x50')];_0xa971e1++){_0x5c7368['push'](updateUser(_0x406be1[_0xa971e1]));}return Promise[_0x33bb('0x61')](_0x5c7368);})[_0x33bb('0x15')](function(){_0x5c7368=_0x406be1['map'](function(_0x18d6dd){return db[_0x33bb('0x3c')][_0x33bb('0x84')](_0x18d6dd,{'include':[{'model':db[_0x33bb('0x71')],'as':_0x33bb('0x71')}]})[_0x33bb('0x15')](function(_0x119179){_0x18d6dd['id']=_0x119179['id'];return _0x18d6dd;});});return Promise[_0x33bb('0x61')](_0x5c7368);})['then'](function(_0x38c218){if(_0x5026b1[_0x33bb('0x62')][_0x33bb('0x2e')]===_0x33bb('0x31'))return _0x38c218;if(_0x5026b1['user']['role']!==_0x33bb('0x31'))return _0x38c218;var _0x580dca=_[_0x33bb('0x91')](_0x38c218,function(_0x395ea7){return _0x395ea7['role']==='agent'||_0x395ea7[_0x33bb('0x2e')]==='telephone';});if(!_0x580dca)return _0x38c218;return db[_0x33bb('0x8a')][_0x33bb('0x4d')]({'where':{'name':{'$or':[_0x33bb('0x8b'),_0x33bb('0x8c')]},'userProfileId':_0x5026b1[_0x33bb('0x31')]['userProfileId']},'raw':!![]})[_0x33bb('0x15')](function(_0x5549d2){if(_['isEmpty'](_0x5549d2)||!_[_0x33bb('0x91')](_0x5549d2,['autoAssociation',0x0]))return _0x38c218;_0x5c7368=[];var _0x19eaf6=_(_0x5549d2)[_0x33bb('0x34')](function(_0x5794c7){if(_0x5794c7[_0x33bb('0x8d')]===0x1)return;return _0x5794c7[_0x33bb('0x37')]===_0x33bb('0x8b')?_0x33bb('0x90'):_0x33bb('0x93');})['compact']()[_0x33bb('0x35')]();for(var _0x369627=0x0;_0x369627<_0x38c218['length'];_0x369627++){if(!_['includes'](_0x19eaf6,_0x38c218[_0x369627][_0x33bb('0x2e')]))return;var _0xdee4e1=_0x38c218[_0x369627][_0x33bb('0x2e')]==='agent'?_0x33bb('0x8b'):_0x33bb('0x8c');_0x5c7368[_0x33bb('0x4c')](db[_0x33bb('0x38')][_0x33bb('0x84')]({'name':_0x38c218[_0x369627]['name'],'resourceId':_0x38c218[_0x369627]['id'],'type':_0xdee4e1,'sectionId':_[_0x33bb('0x36')](_0x5549d2,[_0x33bb('0x37'),_0xdee4e1])['id']},{}));}return Promise['all'](_0x5c7368);});})[_0x33bb('0x15')](respondWithResult(_0x4a8748,0xc9))['catch'](handleError(_0x4a8748,null));};exports[_0x33bb('0x94')]=function(_0xd2cd85,_0x1baeaa){if(_0xd2cd85[_0x33bb('0x62')]['id']){delete _0xd2cd85[_0x33bb('0x62')]['id'];}return db[_0x33bb('0x3c')]['find']({'where':{'id':_0xd2cd85[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](function(_0x251d5d){if(!_0x251d5d)return null;if(_0x251d5d['id']===_0xd2cd85[_0x33bb('0x31')]['id']){if(!_0xd2cd85[_0x33bb('0x62')][_0x33bb('0x95')]||!_0xd2cd85[_0x33bb('0x62')]['newPassword']){throw new db['Sequelize'][(_0x33bb('0x96'))](_0x33bb('0x97'));}if(!_0x251d5d['authenticate'](_0xd2cd85['body'][_0x33bb('0x95')])){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))]('Wrong\x20credentials');}if(_0xd2cd85[_0x33bb('0x62')][_0x33bb('0x95')]===_0xd2cd85[_0x33bb('0x62')][_0x33bb('0x99')]){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0x9a'));}}else if(_0xd2cd85[_0x33bb('0x31')]['role']===_0x33bb('0x2f')){if(!_0xd2cd85['body']['newPassword']){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xd2cd85[_0x33bb('0x31')][_0x33bb('0x2e')]===_0x33bb('0x31')){if(!_0xd2cd85['body']['newPassword']){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x251d5d[_0x33bb('0x2e')]!=='agent'){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0x85'));}}else{throw new db['Sequelize'][(_0x33bb('0x96'))](_0x33bb('0x85'));}return _0x251d5d;})[_0x33bb('0x15')](handleEntityNotFound(_0x1baeaa,null))[_0x33bb('0x15')](function(_0x993595){return db['Setting'][_0x33bb('0x9b')]({'attributes':['id',_0x33bb('0x67'),'enforcePasswordHistory',_0x33bb('0x9c')]})[_0x33bb('0x15')](function(_0x8487e7){if(_0x8487e7[_0x33bb('0x67')])authService[_0x33bb('0x68')](_0xd2cd85['body'][_0x33bb('0x99')]);if(!_0x8487e7[_0x33bb('0x9d')]||!_0x993595[_0x33bb('0x9e')])return _0x993595;authService[_0x33bb('0x9f')](_0xd2cd85['body']['newPassword'],_0x993595[_0x33bb('0x9e')],_0x8487e7[_0x33bb('0x9c')]);return _0x993595;})[_0x33bb('0x15')](saveUpdates({'password':_0xd2cd85[_0x33bb('0x62')]['newPassword'],'passwordResetAt':_0xd2cd85[_0x33bb('0x31')]['id']==_0xd2cd85[_0x33bb('0x57')]['id']?moment():null,'previousPasswords':authService[_0x33bb('0xa0')](_0xd2cd85[_0x33bb('0x62')]['newPassword'],_0x993595[_0x33bb('0x9e')])},null));})[_0x33bb('0x15')](respondWithResult(_0x1baeaa,null))[_0x33bb('0x1f')](handleError(_0x1baeaa,null));};exports['addQueues']=function(_0x354557,_0x3e17f7){var _0x3eec26=_0x354557[_0x33bb('0x62')][_0x33bb('0xa1')];return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x354557['params']['id']},'attributes':['id',_0x33bb('0x37'),_0x33bb('0x2e'),_0x33bb('0xa2'),_0x33bb('0xa3'),_0x33bb('0xa4'),_0x33bb('0xa5')]})[_0x33bb('0x15')](handleEntityNotFound(_0x3e17f7,null))[_0x33bb('0x15')](function(_0x5e4cf1){if(_0x5e4cf1){if(!utils[_0x33bb('0xa6')](_0x3eec26)){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0xa7'));}return _0x5e4cf1[_0x33bb('0xa8')+_[_0x33bb('0xa9')](_0x3eec26[_0x33bb('0xaa')]())+_0x33bb('0xab')](_0x354557['body'][_0x33bb('0x64')],{'penalty':_0x354557[_0x33bb('0x62')][_0x33bb('0xac')]||0x0})[_0x33bb('0xad')](function(_0x4796fe){for(var _0x49bcdd=0x0;_0x49bcdd<_0x354557[_0x33bb('0x62')][_0x33bb('0x64')][_0x33bb('0x50')];_0x49bcdd+=0x1){var _0x456e7a={'UserId':Number(_0x354557[_0x33bb('0x57')]['id'])};_0x456e7a[_['capitalize'](_0x3eec26['toLowerCase']())+_0x33bb('0xae')]=Number(_0x354557['body'][_0x33bb('0x64')][_0x49bcdd]);socket['emit']('user'+_['capitalize'](_0x3eec26[_0x33bb('0xaa')]())+_0x33bb('0xaf'),_0x456e7a);}return _0x4796fe;})['then'](function(){if(_0x3eec26===_0x33bb('0xb0')){return db[_0x33bb('0xb1')][_0x33bb('0x4d')]({'where':{'id':_0x354557[_0x33bb('0x62')][_0x33bb('0x64')]||[]},'raw':!![],'attributes':['id',_0x33bb('0x37')]});}})['then'](function(_0x3e72d8){var _0x5bf78c=_0x5e4cf1[_0x33bb('0x2d')]({'plain':!![]});var _0x458b06=[];if(_0x3eec26===_0x33bb('0xb0')&&_0x5bf78c['role']===_0x33bb('0x90')&&_0x5bf78c[_0x33bb('0xa2')]){for(let _0x4658b7=0x0;_0x4658b7<_0x3e72d8[_0x33bb('0x50')];_0x4658b7+=0x1){_0x458b06[_0x33bb('0x4c')]({'membername':_0x5bf78c[_0x33bb('0x37')],'UserId':_0x5bf78c['id'],'queue_name':_0x3e72d8[_0x4658b7][_0x33bb('0x37')],'VoiceQueueId':_0x3e72d8[_0x4658b7]['id'],'interface':_['isNil'](_0x5bf78c['interface'])?util[_0x33bb('0xb2')]('SIP/%s',_0x5bf78c[_0x33bb('0x37')]):_0x5bf78c[_0x33bb('0xa5')],'paused':_0x5bf78c[_0x33bb('0xa4')]||![],'penalty':_0x354557['body'][_0x33bb('0xac')]||0x0});}return Promise['all'](_0x458b06['map'](function(_0x36ba6f){return db['UserVoiceQueueRt']['upsert'](_0x36ba6f);}));}return _0x5e4cf1;});}})[_0x33bb('0x15')](respondWithStatusCode(_0x3e17f7,null))[_0x33bb('0x1f')](handleError(_0x3e17f7,null));};exports[_0x33bb('0xb3')]=function(_0x8660da,_0x581bec){var _0x2d4549,_0x1eff8f;return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x8660da[_0x33bb('0x57')]['id']},'attributes':['id','name',_0x33bb('0x2e')]})[_0x33bb('0x15')](handleEntityNotFound(_0x581bec,null))[_0x33bb('0x15')](function(_0x287130){if(_0x287130){_0x2d4549=_0x287130;if(!_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')]||!utils[_0x33bb('0xa6')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')])){throw new db[(_0x33bb('0x98'))]['ValidationError'](_0x33bb('0xa7'));}return _0x287130['remove'+_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+'Queues'](_0x8660da[_0x33bb('0x45')]['ids']);}})[_0x33bb('0x15')](function(_0x1059ae){if(_[_0x33bb('0xb4')](_0x8660da[_0x33bb('0x45')][_0x33bb('0x64')])){for(var _0x7d7c3=0x0;_0x7d7c3<_0x8660da[_0x33bb('0x45')]['ids'][_0x33bb('0x50')];_0x7d7c3+=0x1){_0x1eff8f={'UserId':Number(_0x8660da['params']['id'])};_0x1eff8f[_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+_0x33bb('0xae')]=Number(_0x8660da[_0x33bb('0x45')][_0x33bb('0x64')][_0x7d7c3]);socket[_0x33bb('0x2a')](_0x33bb('0x31')+_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+_0x33bb('0xb5'),_0x1eff8f);}}else{_0x1eff8f={'UserId':Number(_0x8660da[_0x33bb('0x57')]['id'])};_0x1eff8f[_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')]['channel'][_0x33bb('0xaa')]())+_0x33bb('0xae')]=Number(_0x8660da[_0x33bb('0x45')][_0x33bb('0x64')]);socket[_0x33bb('0x2a')]('user'+_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+'Queue:remove',_0x1eff8f);}return _0x1059ae;})[_0x33bb('0x15')](function(){if(_0x8660da['query']['channel']===_0x33bb('0xb0')){return db[_0x33bb('0xb6')][_0x33bb('0x2c')]({'where':{'UserId':_0x8660da[_0x33bb('0x57')]['id'],'VoiceQueueId':_0x8660da['query'][_0x33bb('0x64')]},'individualHooks':!![]})[_0x33bb('0x15')](function(){return _0x2d4549;});}return _0x2d4549;})['then'](respondWithStatusCode(_0x581bec,null))[_0x33bb('0x1f')](handleError(_0x581bec,null));};exports[_0x33bb('0xb7')]=function(_0x297066,_0xf0114b){_0x297066['body'][_0x33bb('0xb8')]=_0x297066['file'][_0x33bb('0xb9')];return db['User'][_0x33bb('0x36')]({'where':{'id':_0x297066[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0xf0114b,null))[_0x33bb('0x15')](saveUpdates(_0x297066[_0x33bb('0x62')],null))[_0x33bb('0x15')](respondWithResult(_0xf0114b,null))[_0x33bb('0x1f')](handleError(_0xf0114b,null));};exports[_0x33bb('0xba')]=function(_0x41cf88,_0x3ea9cf){var _0x4ed90e=path[_0x33bb('0xbb')](config[_0x33bb('0xbc')],_0x33bb('0xbd'));return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x41cf88[_0x33bb('0x57')]['id']},'attributes':['id',_0x33bb('0xb8')],'raw':!![]})['then'](handleEntityNotFound(_0x3ea9cf,null))[_0x33bb('0x15')](function(_0xd04925){if(_0xd04925){if(_[_0x33bb('0x6a')](_0xd04925['userpic'])){return _0x3ea9cf[_0x33bb('0xbe')](_0x4ed90e);}else{if(!fs[_0x33bb('0xbf')](path[_0x33bb('0xbb')](config[_0x33bb('0xbc')],_0x33bb('0xc0'),_0xd04925[_0x33bb('0xb8')]))){return _0x3ea9cf[_0x33bb('0xbe')](_0x4ed90e);}return _0x3ea9cf[_0x33bb('0xbe')](path[_0x33bb('0xbb')](config[_0x33bb('0xbc')],'server/files/images/',_0xd04925[_0x33bb('0xb8')]));}}})['catch'](handleError(_0x3ea9cf,null));};exports[_0x33bb('0xc1')]=function(_0x5b983b,_0x31958d){return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x5b983b[_0x33bb('0x57')]['id']},'attributes':['id']})[_0x33bb('0x15')](handleEntityNotFound(_0x31958d,null))[_0x33bb('0x15')](function(_0x586e39){var _0x24be80=[];values=_0x586e39[_0x33bb('0x53')];_0x24be80[_0x33bb('0x4c')](get_open_tabs('chat',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('sms',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('openchannel',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('whatsapp',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('fax',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x55'),_0x586e39[_0x33bb('0x53')]));return Promise[_0x33bb('0x61')](_0x24be80);})[_0x33bb('0x15')](function(_0x490412){if(_0x490412){var _0x51acf1=_['map'](values[_0x33bb('0xc2')],function(_0x1def77){return{'channel':_0x33bb('0xc3'),'id':_0x1def77['id'],'createdAt':_0x1def77[_0x33bb('0xc4')]};});var _0x2da44d=_['map'](values[_0x33bb('0xc5')],function(_0x250dfa){return{'channel':'FAX','id':_0x250dfa['id'],'createdAt':_0x250dfa[_0x33bb('0xc4')]};});var _0x183c08=_[_0x33bb('0x34')](values[_0x33bb('0xc6')],function(_0x50612f){return{'channel':_0x33bb('0xc7'),'id':_0x50612f['id'],'createdAt':_0x50612f[_0x33bb('0xc4')]};});var _0x27410a=_[_0x33bb('0x34')](values[_0x33bb('0xc8')],function(_0x1d8c43){return{'channel':_0x33bb('0xc9'),'id':_0x1d8c43['id'],'createdAt':_0x1d8c43[_0x33bb('0xc4')]};});var _0x51cf52=_['map'](values[_0x33bb('0xca')],function(_0x35a3fe){return{'channel':'SMS','id':_0x35a3fe['id'],'createdAt':_0x35a3fe['createdAt']};});var _0x100068=_['map'](values[_0x33bb('0xcb')],function(_0x260437){return{'channel':_0x33bb('0xcc'),'id':_0x260437['id'],'createdAt':_0x260437['createdAt']};});var _0x62e38e=_[_0x33bb('0xcd')](_0x51acf1,_0x2da44d,_0x183c08,_0x27410a,_0x51cf52,_0x100068);var _0x30725a={'count':_0x62e38e[_0x33bb('0x50')],'rows':_0x62e38e};return _0x30725a;}else return null;})[_0x33bb('0x15')](respondWithResult(_0x31958d,null))['catch'](handleError(_0x31958d,null));};exports[_0x33bb('0xce')]=function(_0x7a23b2,_0x10dcdc){var _0x32d706={};return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x7a23b2[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](function(_0x5428a8){if(!_0x5428a8){throw new APINotFoundError(util[_0x33bb('0xb2')]('User\x20with\x20id\x20%s\x20not\x20found',_0x7a23b2[_0x33bb('0x57')]['id']));}return contacts['describe']();})[_0x33bb('0x15')](function(_0x280d8d){_0x7a23b2['query'][_0x33bb('0x3c')]=_0x7a23b2[_0x33bb('0x57')]['id'];_0x32d706=qs[_0x33bb('0x43')](_0x280d8d,_0x7a23b2);if(_0x7a23b2[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0x46'))){_0x32d706[_0x33bb('0x47')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x33bb('0x37'),_0x33bb('0xd0')],'where':_0x7a23b2['query'][_0x33bb('0xd1')]?{'id':_0x7a23b2[_0x33bb('0x45')]['tag']}:undefined,'required':_0x7a23b2[_0x33bb('0x45')]['tag']?!![]:![]}];}return contacts[_0x33bb('0x4d')](_0x7a23b2[_0x33bb('0x45')],_0x7a23b2['user'],_0x32d706,_0x280d8d);})['then'](respondWithFilteredResult(_0x10dcdc,_0x32d706))[_0x33bb('0x1f')](APIHandleError(_0x10dcdc));};exports[_0x33bb('0xd2')]=function(_0x4fe4a4,_0x19a6de){var _0x46fb8f;var _0x148d75={};var _0x289171;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x4fe4a4[_0x33bb('0x57')]['id']},'attributes':['id',_0x33bb('0x37'),'role']})[_0x33bb('0x15')](handleEntityNotFound(_0x19a6de,null))['then'](function(_0x34123a){if(!utils[_0x33bb('0xa6')](_0x4fe4a4[_0x33bb('0x45')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x33bb('0xa7'));}_0x46fb8f=_0x34123a;var _0x3541b3={};_0x3541b3['model']=_[_0x33bb('0x5a')](db[_['capitalize'](_0x4fe4a4['query'][_0x33bb('0xa1')])+'Queue'][_0x33bb('0x3d')]);_0x3541b3[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x4fe4a4[_0x33bb('0x45')]);_0x3541b3[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x3541b3['model'],_0x3541b3[_0x33bb('0x45')]);_0x148d75[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x3541b3[_0x33bb('0x58')],qs['fields'](_0x4fe4a4['query']['fields']));_0x148d75[_0x33bb('0x4b')]=_0x148d75[_0x33bb('0x4b')]['length']?_0x148d75['attributes']:_0x3541b3[_0x33bb('0x58')];_0x148d75[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x4fe4a4[_0x33bb('0x45')]['sort']);_0x148d75[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x4fe4a4[_0x33bb('0x45')],_0x3541b3[_0x33bb('0xd3')]));if(_0x4fe4a4[_0x33bb('0x45')]['filter']){_0x148d75[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x148d75['where'],{'$or':_[_0x33bb('0x34')](_0x148d75[_0x33bb('0x4b')],function(_0xd0b91d){var _0x42f023={};_0x42f023[_0xd0b91d]={'$like':'%'+_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x42f023;})});}_0x148d75=_['merge']({},_0x148d75,_0x4fe4a4['options']);switch(_0x46fb8f[_0x33bb('0x2e')]){case _0x33bb('0x2f'):return db[_[_0x33bb('0xa9')](_0x4fe4a4['query'][_0x33bb('0xa1')])+_0x33bb('0xd7')][_0x33bb('0x4d')](_0x148d75);case _0x33bb('0x31'):case _0x33bb('0x90'):return _0x46fb8f[_0x33bb('0x2d')+_[_0x33bb('0xa9')](_0x4fe4a4[_0x33bb('0x45')]['channel'])+_0x33bb('0xab')](_0x148d75);default:throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0xd8'));}})[_0x33bb('0x15')](function(_0x4759e1){_0x289171=_0x4759e1[_0x33bb('0x50')];if(!_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x148d75[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0x26')]);_0x148d75[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x4fe4a4[_0x33bb('0x45')]['offset']);}switch(_0x46fb8f[_0x33bb('0x2e')]){case _0x33bb('0x2f'):return db[_[_0x33bb('0xa9')](_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0xa1')])+_0x33bb('0xd7')][_0x33bb('0x4d')](_0x148d75);case _0x33bb('0x31'):case _0x33bb('0x90'):return _0x46fb8f[_0x33bb('0x2d')+_[_0x33bb('0xa9')](_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0xa1')])+_0x33bb('0xab')](_0x148d75);}})['then'](function(_0x25f457){return{'count':_0x289171,'rows':_0x25f457};})['then'](respondWithResult(_0x19a6de,null))[_0x33bb('0x1f')](handleError(_0x19a6de,null));};exports['getVoiceQueuesRt']=function(_0x34d6c7,_0x170911){var _0x7101d7={};var _0x142915={};var _0x369ee4;var _0x128b24;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x34d6c7[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x170911,null))[_0x33bb('0x15')](function(_0x1574b6){if(_0x1574b6){_0x369ee4=_0x1574b6;_0x142915[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db['UserVoiceQueueRt'][_0x33bb('0x3d')]);_0x142915[_0x33bb('0x45')]=_['keys'](_0x34d6c7[_0x33bb('0x45')]);_0x142915[_0x33bb('0xd3')]=_['intersection'](_0x142915[_0x33bb('0x58')],_0x142915[_0x33bb('0x45')]);_0x7101d7[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x142915[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x7101d7['attributes']=_0x7101d7[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x7101d7[_0x33bb('0x4b')]:_0x142915[_0x33bb('0x58')];_0x7101d7[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x7101d7[_0x33bb('0x44')]=qs['filters'](_[_0x33bb('0xd6')](_0x34d6c7[_0x33bb('0x45')],_0x142915['filters']));if(_0x34d6c7['query'][_0x33bb('0x32')]){_0x7101d7['where']=_[_0x33bb('0x5e')](_0x7101d7['where'],{'$or':_[_0x33bb('0x34')](_0x7101d7[_0x33bb('0x4b')],function(_0x236da8){var _0x4cc461={};_0x4cc461[_0x236da8]={'$like':'%'+_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x4cc461;})});}_0x7101d7=_[_0x33bb('0x5e')]({},_0x7101d7,_0x34d6c7[_0x33bb('0x5f')]);return _0x369ee4[_0x33bb('0xda')](_0x7101d7);}})[_0x33bb('0x15')](function(_0x34b63c){if(_0x34b63c){_0x128b24=_0x34b63c[_0x33bb('0x50')];if(!_0x34d6c7['query']['hasOwnProperty'](_0x33bb('0xd9'))){_0x7101d7[_0x33bb('0x26')]=qs['limit'](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x26')]);_0x7101d7['offset']=qs[_0x33bb('0x23')](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x369ee4[_0x33bb('0xda')](_0x7101d7);}})[_0x33bb('0x15')](function(_0x1f5772){if(_0x1f5772){return _0x1f5772?{'count':_0x128b24,'rows':_0x1f5772}:null;}})['then'](respondWithResult(_0x170911,null))['catch'](handleError(_0x170911,null));};exports[_0x33bb('0xdb')]=function(_0x25df54,_0x4e1b48){var _0xcb3e76={};var _0x583e4b={};var _0x587089;var _0x3dcd48;return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x25df54[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x4e1b48,null))[_0x33bb('0x15')](function(_0x1b5beb){if(_0x1b5beb){_0x587089=_0x1b5beb;_0x583e4b[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xdc')]['rawAttributes']);_0x583e4b[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x25df54[_0x33bb('0x45')]);_0x583e4b[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x583e4b[_0x33bb('0x58')],_0x583e4b[_0x33bb('0x45')]);_0xcb3e76['attributes']=_[_0x33bb('0x5c')](_0x583e4b[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x25df54[_0x33bb('0x45')][_0x33bb('0x5d')]));_0xcb3e76[_0x33bb('0x4b')]=_0xcb3e76[_0x33bb('0x4b')]['length']?_0xcb3e76[_0x33bb('0x4b')]:_0x583e4b[_0x33bb('0x58')];_0xcb3e76[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x25df54['query']['sort']);_0xcb3e76[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x25df54['query'],_0x583e4b[_0x33bb('0xd3')]));if(_0x25df54['query'][_0x33bb('0x32')]){_0xcb3e76[_0x33bb('0x44')]=_['merge'](_0xcb3e76[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0xcb3e76['attributes'],function(_0x2d564f){var _0x398b82={};_0x398b82[_0x2d564f]={'$like':'%'+_0x25df54[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x398b82;})});}_0xcb3e76=_[_0x33bb('0x5e')]({},_0xcb3e76,_0x25df54[_0x33bb('0x5f')]);return _0x587089['getGroups'](_0xcb3e76);}})[_0x33bb('0x15')](function(_0x515594){if(_0x515594){_0x3dcd48=_0x515594['length'];if(!_0x25df54[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0xcb3e76[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x25df54[_0x33bb('0x45')][_0x33bb('0x26')]);_0xcb3e76[_0x33bb('0x23')]=qs['offset'](_0x25df54[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x587089[_0x33bb('0xdb')](_0xcb3e76);}})['then'](function(_0x1ad86f){if(_0x1ad86f){return _0x1ad86f?{'count':_0x3dcd48,'rows':_0x1ad86f}:null;}})[_0x33bb('0x15')](respondWithResult(_0x4e1b48,null))[_0x33bb('0x1f')](handleError(_0x4e1b48,null));};exports['getRecordings']=function(_0x343d5f,_0x33900e){var _0x2aa787={'raw':!![],'where':{}};var _0x20ab16={};var _0x4da635={'count':0x0,'rows':[]};return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x343d5f[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x33900e,null))[_0x33bb('0x15')](function(_0x42a5f3){if(_0x42a5f3){_0x20ab16[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xdd')]['rawAttributes']);_0x20ab16['query']=_['keys'](_0x343d5f['query']);_0x20ab16[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x20ab16[_0x33bb('0x58')],_0x20ab16['query']);_0x2aa787[_0x33bb('0x4b')]=_['intersection'](_0x20ab16[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x343d5f[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x2aa787['attributes']=_0x2aa787[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x2aa787[_0x33bb('0x4b')]:_0x20ab16[_0x33bb('0x58')];if(!_0x343d5f[_0x33bb('0x45')][_0x33bb('0xcf')]('nolimit')){_0x2aa787[_0x33bb('0x26')]=qs['limit'](_0x343d5f[_0x33bb('0x45')]['limit']);_0x2aa787['offset']=qs[_0x33bb('0x23')](_0x343d5f[_0x33bb('0x45')]['offset']);}_0x2aa787[_0x33bb('0xd4')]=qs['sort'](_0x343d5f[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x2aa787[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x343d5f[_0x33bb('0x45')],_0x20ab16[_0x33bb('0xd3')]));_0x2aa787[_0x33bb('0x44')][_0x33bb('0xde')]=_0x42a5f3['id'];if(_0x343d5f['query']['filter']){_0x2aa787[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x2aa787[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x2aa787['attributes'],function(_0x147bfa){var _0x28d370={};_0x28d370[_0x147bfa]={'$like':'%'+_0x343d5f[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x28d370;})});}_0x2aa787=_[_0x33bb('0x5e')]({},_0x2aa787,_0x343d5f[_0x33bb('0x5f')]);return db[_0x33bb('0xdd')][_0x33bb('0x25')]({'where':_0x2aa787[_0x33bb('0x44')]})[_0x33bb('0x15')](function(_0x1dc85f){_0x4da635['count']=_0x1dc85f;if(_0x343d5f['query']['includeAll']){_0x2aa787[_0x33bb('0x47')]=[{'all':!![]}];}return db[_0x33bb('0xdd')]['findAll'](_0x2aa787);})[_0x33bb('0x15')](function(_0x3dbbcb){_0x4da635[_0x33bb('0x4e')]=_0x3dbbcb;return _0x4da635;});}})[_0x33bb('0x15')](respondWithFilteredResult(_0x33900e,_0x2aa787))[_0x33bb('0x1f')](handleError(_0x33900e,null));};exports[_0x33bb('0xdf')]=function(_0x5a90f0,_0xfdf667){var _0x2c8132={'raw':!![],'where':{}};var _0x32004d={};var _0x46d74b={'count':0x0,'rows':[]};return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x5a90f0[_0x33bb('0x57')]['id']}})['then'](handleEntityNotFound(_0xfdf667,null))[_0x33bb('0x15')](function(_0x47743f){if(_0x47743f){_0x32004d['model']=_['keys'](db[_0x33bb('0xe0')][_0x33bb('0x3d')]);_0x32004d['query']=_['keys'](_0x5a90f0[_0x33bb('0x45')]);_0x32004d[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x32004d[_0x33bb('0x58')],_0x32004d[_0x33bb('0x45')]);_0x2c8132['attributes']=_[_0x33bb('0x5c')](_0x32004d[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x2c8132[_0x33bb('0x4b')]=_0x2c8132['attributes'][_0x33bb('0x50')]?_0x2c8132[_0x33bb('0x4b')]:_0x32004d[_0x33bb('0x58')];if(!_0x5a90f0[_0x33bb('0x45')][_0x33bb('0xcf')]('nolimit')){_0x2c8132[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x26')]);_0x2c8132['offset']=qs[_0x33bb('0x23')](_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x23')]);}_0x2c8132['order']=qs[_0x33bb('0xd5')](_0x5a90f0['query']['sort']);_0x2c8132[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_['pick'](_0x5a90f0[_0x33bb('0x45')],_0x32004d[_0x33bb('0xd3')]));_0x2c8132[_0x33bb('0x44')]['UserId']=_0x47743f['id'];if(_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x32')]){_0x2c8132[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x2c8132[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x2c8132[_0x33bb('0x4b')],function(_0x325b7a){var _0x53fc4a={};_0x53fc4a[_0x325b7a]={'$like':'%'+_0x5a90f0['query'][_0x33bb('0x32')]+'%'};return _0x53fc4a;})});}_0x2c8132=_[_0x33bb('0x5e')]({},_0x2c8132,_0x5a90f0['options']);return db[_0x33bb('0xe0')][_0x33bb('0x25')]({'where':_0x2c8132[_0x33bb('0x44')]})[_0x33bb('0x15')](function(_0x5b57dd){_0x46d74b[_0x33bb('0x25')]=_0x5b57dd;if(_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x46')]){_0x2c8132[_0x33bb('0x47')]=[{'all':!![]}];}return db[_0x33bb('0xe0')][_0x33bb('0x4d')](_0x2c8132);})[_0x33bb('0x15')](function(_0x17aa57){_0x46d74b[_0x33bb('0x4e')]=_0x17aa57;return _0x46d74b;});}})['then'](respondWithFilteredResult(_0xfdf667,_0x2c8132))[_0x33bb('0x1f')](handleError(_0xfdf667,null));};exports[_0x33bb('0xe1')]=function(_0x4c5fb6,_0x7313a0){var _0x49fc3c={};var _0x26e1a1={};var _0x1ebc9a;var _0x4269e1;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x4c5fb6[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x7313a0,null))[_0x33bb('0x15')](function(_0x2aaa4e){if(_0x2aaa4e){_0x1ebc9a=_0x2aaa4e;_0x26e1a1[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe2')][_0x33bb('0x3d')]);_0x26e1a1[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x4c5fb6['query']);_0x26e1a1[_0x33bb('0xd3')]=_['intersection'](_0x26e1a1[_0x33bb('0x58')],_0x26e1a1[_0x33bb('0x45')]);_0x49fc3c['attributes']=_[_0x33bb('0x5c')](_0x26e1a1[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x49fc3c['attributes']=_0x49fc3c['attributes'][_0x33bb('0x50')]?_0x49fc3c[_0x33bb('0x4b')]:_0x26e1a1['model'];_0x49fc3c[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x49fc3c[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x4c5fb6[_0x33bb('0x45')],_0x26e1a1[_0x33bb('0xd3')]));if(_0x4c5fb6[_0x33bb('0x45')]['filter']){_0x49fc3c[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x49fc3c[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x49fc3c[_0x33bb('0x4b')],function(_0x4cf0cd){var _0x329b81={};_0x329b81[_0x4cf0cd]={'$like':'%'+_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x329b81;})});}_0x49fc3c=_[_0x33bb('0x5e')]({},_0x49fc3c,_0x4c5fb6['options']);return _0x1ebc9a['getChatInteractions'](_0x49fc3c);}})[_0x33bb('0x15')](function(_0x498a1b){if(_0x498a1b){_0x4269e1=_0x498a1b[_0x33bb('0x50')];if(!_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x49fc3c['limit']=qs[_0x33bb('0x26')](_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0x26')]);_0x49fc3c['offset']=qs['offset'](_0x4c5fb6['query'][_0x33bb('0x23')]);}return _0x1ebc9a[_0x33bb('0xe1')](_0x49fc3c);}})['then'](function(_0x1c5902){if(_0x1c5902){return _0x1c5902?{'count':_0x4269e1,'rows':_0x1c5902}:null;}})[_0x33bb('0x15')](respondWithResult(_0x7313a0,null))[_0x33bb('0x1f')](handleError(_0x7313a0,null));};exports[_0x33bb('0xe3')]=function(_0x16f398,_0x342999){var _0xa4cbbe={};var _0x49e500={};var _0x225f2f;var _0x541906;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x16f398['params']['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x342999,null))['then'](function(_0x355fd6){if(_0x355fd6){_0x225f2f=_0x355fd6;_0x49e500[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe4')][_0x33bb('0x3d')]);_0x49e500[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x16f398[_0x33bb('0x45')]);_0x49e500[_0x33bb('0xd3')]=_['intersection'](_0x49e500['model'],_0x49e500[_0x33bb('0x45')]);_0xa4cbbe[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x49e500['model'],qs[_0x33bb('0x5d')](_0x16f398[_0x33bb('0x45')][_0x33bb('0x5d')]));_0xa4cbbe[_0x33bb('0x4b')]=_0xa4cbbe[_0x33bb('0x4b')][_0x33bb('0x50')]?_0xa4cbbe[_0x33bb('0x4b')]:_0x49e500[_0x33bb('0x58')];_0xa4cbbe[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x16f398[_0x33bb('0x45')][_0x33bb('0xd5')]);_0xa4cbbe[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x16f398[_0x33bb('0x45')],_0x49e500['filters']));if(_0x16f398[_0x33bb('0x45')]['filter']){_0xa4cbbe['where']=_['merge'](_0xa4cbbe[_0x33bb('0x44')],{'$or':_['map'](_0xa4cbbe['attributes'],function(_0x4ac6ab){var _0x311bdc={};_0x311bdc[_0x4ac6ab]={'$like':'%'+_0x16f398[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x311bdc;})});}_0xa4cbbe=_[_0x33bb('0x5e')]({},_0xa4cbbe,_0x16f398['options']);return _0x225f2f['getOpenchannelInteractions'](_0xa4cbbe);}})[_0x33bb('0x15')](function(_0x2d3e4d){if(_0x2d3e4d){_0x541906=_0x2d3e4d[_0x33bb('0x50')];if(!_0x16f398[_0x33bb('0x45')]['hasOwnProperty']('nolimit')){_0xa4cbbe['limit']=qs['limit'](_0x16f398['query'][_0x33bb('0x26')]);_0xa4cbbe[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x16f398['query'][_0x33bb('0x23')]);}return _0x225f2f[_0x33bb('0xe3')](_0xa4cbbe);}})[_0x33bb('0x15')](function(_0x59117b){if(_0x59117b){return _0x59117b?{'count':_0x541906,'rows':_0x59117b}:null;}})['then'](respondWithResult(_0x342999,null))[_0x33bb('0x1f')](handleError(_0x342999,null));};exports[_0x33bb('0xe5')]=function(_0x597be5,_0x26d8d1){var _0x2b0b7c={'raw':!![],'where':{}};var _0x41b06f={};var _0x1e7bc1={'count':0x0,'rows':[]};return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x597be5[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x26d8d1,null))[_0x33bb('0x15')](function(_0x36faae){if(_0x36faae){_0x41b06f[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe6')][_0x33bb('0x3d')]);_0x41b06f['query']=_['keys'](_0x597be5[_0x33bb('0x45')]);_0x41b06f[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x41b06f['model'],_0x41b06f['query']);_0x2b0b7c['attributes']=_[_0x33bb('0x5c')](_0x41b06f[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x597be5[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x2b0b7c[_0x33bb('0x4b')]=_0x2b0b7c[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x2b0b7c[_0x33bb('0x4b')]:_0x41b06f[_0x33bb('0x58')];if(!_0x597be5[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x2b0b7c['limit']=qs[_0x33bb('0x26')](_0x597be5[_0x33bb('0x45')][_0x33bb('0x26')]);_0x2b0b7c[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x597be5['query'][_0x33bb('0x23')]);}_0x2b0b7c['order']=qs['sort'](_0x597be5[_0x33bb('0x45')]['sort']);_0x2b0b7c[_0x33bb('0x44')]=qs['filters'](_[_0x33bb('0xd6')](_0x597be5[_0x33bb('0x45')],_0x41b06f['filters']));_0x2b0b7c[_0x33bb('0x44')][_0x33bb('0xde')]=_0x36faae['id'];if(_0x597be5[_0x33bb('0x45')][_0x33bb('0x32')]){_0x2b0b7c[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x2b0b7c[_0x33bb('0x44')],{'$or':_['map'](_0x2b0b7c[_0x33bb('0x4b')],function(_0x8345af){var _0x1327b5={};_0x1327b5[_0x8345af]={'$like':'%'+_0x597be5[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x1327b5;})});}_0x2b0b7c=_[_0x33bb('0x5e')]({},_0x2b0b7c,_0x597be5[_0x33bb('0x5f')]);return db[_0x33bb('0xe6')][_0x33bb('0x25')]({'where':_0x2b0b7c[_0x33bb('0x44')]})[_0x33bb('0x15')](function(_0x30a73f){_0x1e7bc1[_0x33bb('0x25')]=_0x30a73f;if(_0x597be5[_0x33bb('0x45')][_0x33bb('0x46')]){_0x2b0b7c[_0x33bb('0x47')]=[{'all':!![]}];}return db[_0x33bb('0xe6')][_0x33bb('0x4d')](_0x2b0b7c);})[_0x33bb('0x15')](function(_0x37b1f3){_0x1e7bc1[_0x33bb('0x4e')]=_0x37b1f3;return _0x1e7bc1;});}})[_0x33bb('0x15')](respondWithFilteredResult(_0x26d8d1,_0x2b0b7c))['catch'](handleError(_0x26d8d1,null));};exports[_0x33bb('0xe7')]=function(_0x20a450,_0x50c803){var _0x321c98={};var _0x2cea6b={};var _0x102874;var _0x3736b4;return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x20a450[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x50c803,null))['then'](function(_0x1a9dc2){if(_0x1a9dc2){_0x102874=_0x1a9dc2;_0x2cea6b[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe8')][_0x33bb('0x3d')]);_0x2cea6b[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x20a450[_0x33bb('0x45')]);_0x2cea6b[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x2cea6b[_0x33bb('0x58')],_0x2cea6b[_0x33bb('0x45')]);_0x321c98[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x2cea6b[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x20a450[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x321c98['attributes']=_0x321c98['attributes']['length']?_0x321c98[_0x33bb('0x4b')]:_0x2cea6b[_0x33bb('0x58')];_0x321c98[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x20a450['query'][_0x33bb('0xd5')]);_0x321c98['where']=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x20a450['query'],_0x2cea6b['filters']));if(_0x20a450['query'][_0x33bb('0x32')]){_0x321c98[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x321c98[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x321c98[_0x33bb('0x4b')],function(_0x27f674){var _0x25e107={};_0x25e107[_0x27f674]={'$like':'%'+_0x20a450[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x25e107;})});}_0x321c98=_[_0x33bb('0x5e')]({},_0x321c98,_0x20a450[_0x33bb('0x5f')]);return _0x102874[_0x33bb('0xe7')](_0x321c98);}})[_0x33bb('0x15')](function(_0x856ad0){if(_0x856ad0){_0x3736b4=_0x856ad0[_0x33bb('0x50')];if(!_0x20a450['query'][_0x33bb('0xcf')]('nolimit')){_0x321c98['limit']=qs['limit'](_0x20a450[_0x33bb('0x45')][_0x33bb('0x26')]);_0x321c98[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x20a450[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x102874[_0x33bb('0xe7')](_0x321c98);}})['then'](function(_0x5915b0){if(_0x5915b0){return _0x5915b0?{'count':_0x3736b4,'rows':_0x5915b0}:null;}})['then'](respondWithResult(_0x50c803,null))[_0x33bb('0x1f')](handleError(_0x50c803,null));};exports['getFaxInteractions']=function(_0x3666d7,_0xe55e46){var _0x56a560={};var _0x3ea7b8={};var _0x266fd7;var _0x5fc823;return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x3666d7[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0xe55e46,null))[_0x33bb('0x15')](function(_0x331724){if(_0x331724){_0x266fd7=_0x331724;_0x3ea7b8[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe9')][_0x33bb('0x3d')]);_0x3ea7b8[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x3666d7[_0x33bb('0x45')]);_0x3ea7b8[_0x33bb('0xd3')]=_['intersection'](_0x3ea7b8[_0x33bb('0x58')],_0x3ea7b8['query']);_0x56a560[_0x33bb('0x4b')]=_['intersection'](_0x3ea7b8[_0x33bb('0x58')],qs['fields'](_0x3666d7[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x56a560[_0x33bb('0x4b')]=_0x56a560[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x56a560[_0x33bb('0x4b')]:_0x3ea7b8[_0x33bb('0x58')];_0x56a560['order']=qs[_0x33bb('0xd5')](_0x3666d7[_0x33bb('0x45')]['sort']);_0x56a560[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_['pick'](_0x3666d7[_0x33bb('0x45')],_0x3ea7b8[_0x33bb('0xd3')]));if(_0x3666d7[_0x33bb('0x45')][_0x33bb('0x32')]){_0x56a560[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x56a560[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x56a560[_0x33bb('0x4b')],function(_0x5f4218){var _0x1d306d={};_0x1d306d[_0x5f4218]={'$like':'%'+_0x3666d7[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x1d306d;})});}_0x56a560=_[_0x33bb('0x5e')]({},_0x56a560,_0x3666d7[_0x33bb('0x5f')]);return _0x266fd7['getFaxInteractions'](_0x56a560);}})['then'](function(_0x4659eb){if(_0x4659eb){_0x5fc823=_0x4659eb[_0x33bb('0x50')];if(!_0x3666d7['query']['hasOwnProperty'](_0x33bb('0xd9'))){_0x56a560['limit']=qs[_0x33bb('0x26')](_0x3666d7[_0x33bb('0x45')][_0x33bb('0x26')]);_0x56a560[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x3666d7[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x266fd7[_0x33bb('0xea')](_0x56a560);}})[_0x33bb('0x15')](function(_0x2aa03c){if(_0x2aa03c){return _0x2aa03c?{'count':_0x5fc823,'rows':_0x2aa03c}:null;}})[_0x33bb('0x15')](respondWithResult(_0xe55e46,null))[_0x33bb('0x1f')](handleError(_0xe55e46,null));};exports[_0x33bb('0xeb')]=function(_0x339b64,_0x59ccce){var _0x5ce6f6={};var _0x4ec19c={};var _0x3af239;var _0x19055d;return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x339b64[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x59ccce,null))[_0x33bb('0x15')](function(_0x46a801){if(_0x46a801){_0x3af239=_0x46a801;_0x4ec19c[_0x33bb('0x58')]=_['keys'](db[_0x33bb('0xec')][_0x33bb('0x3d')]);_0x4ec19c[_0x33bb('0x45')]=_['keys'](_0x339b64[_0x33bb('0x45')]);_0x4ec19c['filters']=_[_0x33bb('0x5c')](_0x4ec19c[_0x33bb('0x58')],_0x4ec19c[_0x33bb('0x45')]);_0x5ce6f6['attributes']=_[_0x33bb('0x5c')](_0x4ec19c['model'],qs[_0x33bb('0x5d')](_0x339b64['query'][_0x33bb('0x5d')]));_0x5ce6f6[_0x33bb('0x4b')]=_0x5ce6f6[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x5ce6f6['attributes']:_0x4ec19c[_0x33bb('0x58')];_0x5ce6f6[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x339b64[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x5ce6f6[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x339b64[_0x33bb('0x45')],_0x4ec19c[_0x33bb('0xd3')]));if(_0x339b64[_0x33bb('0x45')]['filter']){_0x5ce6f6[_0x33bb('0x44')]=_['merge'](_0x5ce6f6[_0x33bb('0x44')],{'$or':_['map'](_0x5ce6f6['attributes'],function(_0x528de6){var _0x2177fe={};_0x2177fe[_0x528de6]={'$like':'%'+_0x339b64[_0x33bb('0x45')]['filter']+'%'};return _0x2177fe;})});}_0x5ce6f6=_[_0x33bb('0x5e')]({},_0x5ce6f6,_0x339b64[_0x33bb('0x5f')]);return _0x3af239[_0x33bb('0xeb')](_0x5ce6f6);}})['then'](function(_0x1eaf36){if(_0x1eaf36){_0x19055d=_0x1eaf36[_0x33bb('0x50')];if(!_0x339b64[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x5ce6f6[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x339b64[_0x33bb('0x45')][_0x33bb('0x26')]);_0x5ce6f6['offset']=qs[_0x33bb('0x23')](_0x339b64['query'][_0x33bb('0x23')]);}return _0x3af239[_0x33bb('0xeb')](_0x5ce6f6);}})[_0x33bb('0x15')](function(_0x38865e){if(_0x38865e){return _0x38865e?{'count':_0x19055d,'rows':_0x38865e}:null;}})[_0x33bb('0x15')](respondWithResult(_0x59ccce,null))[_0x33bb('0x1f')](handleError(_0x59ccce,null));};exports[_0x33bb('0xed')]=function(_0x25f861,_0xca5ea9,_0x392ee2){var _0x2eb1cf;var _0x4b680c;var _0xc35bdb;var _0x3c2eb7=!_['isNil'](_0x25f861[_0x33bb('0x57')]['id'])?_0x25f861[_0x33bb('0x57')]['id']:!_[_0x33bb('0x6a')](_0x25f861['user']['id'])?_0x25f861[_0x33bb('0x31')]['id']:null;return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x3c2eb7,'role':{'$or':[_0x33bb('0x2f'),_0x33bb('0x31'),_0x33bb('0x90')]}},'attributes':['id',_0x33bb('0x37'),_0x33bb('0xee'),'mobile',_0x33bb('0x2e'),_0x33bb('0x65'),_0x33bb('0xa3')]})['then'](function(_0x343ad0){if(_0x343ad0){if(_0x343ad0['role']==='agent'){_0x2eb1cf=_0x343ad0;if(_0x25f861[_0x33bb('0x62')]['interface']){_0xc35bdb=util[_0x33bb('0xb2')](_0x33bb('0xef'),_0x2eb1cf[_0x25f861['body'][_0x33bb('0xa5')]]);}else if(_0x25f861['body'][_0x33bb('0xf0')]){_0xc35bdb=util['format'](_0x33bb('0xf1'),_0x25f861[_0x33bb('0x62')][_0x33bb('0xf0')]);}else{_0xc35bdb=util['format'](_0x33bb('0xf1'),_0x2eb1cf[_0x33bb('0x37')]);}socket['to'](util[_0x33bb('0xb2')](_0x33bb('0xf2'),_0x2eb1cf[_0x33bb('0x37')]))[_0x33bb('0x2a')](_0x33bb('0xf3'),{'user':{'id':_0x2eb1cf['id'],'name':_0x2eb1cf['name']},'ip':_0x25f861[_0x33bb('0xf4')][_0x33bb('0xf5')]||_0x25f861['connection'][_0x33bb('0xf6')]||_0x25f861[_0x33bb('0xf7')]['remoteAddress']||_0x25f861[_0x33bb('0xf8')][_0x33bb('0xf7')]['remoteAddress']});return db[_0x33bb('0xb6')][_0x33bb('0x2c')]({'where':{'membername':_0x2eb1cf[_0x33bb('0x37')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x33bb('0x96'))](_0x33bb('0xf9'));}})[_0x33bb('0x15')](function(){if(_0x2eb1cf){return _0x2eb1cf[_0x33bb('0xfa')]({'raw':!![]});}})[_0x33bb('0x15')](function(_0x441d5f){if(_0x2eb1cf){if(_0x441d5f){_0x4b680c=_0x441d5f;if(_0x4b680c[_0x33bb('0x50')]){var _0x13a840=_0x4b680c[_0x33bb('0x34')](function(_0x4a5a29){var _0x230bb9={'membername':_0x2eb1cf[_0x33bb('0x37')],'UserId':_0x2eb1cf['id'],'queue_name':_0x4a5a29['name'],'VoiceQueueId':_0x4a5a29['id'],'interface':_0xc35bdb,'paused':_0x2eb1cf[_0x33bb('0xa3')]||![],'penalty':_0x4a5a29['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0x33bb('0xfb')](_0x230bb9);});return Promise[_0x33bb('0x61')](_0x13a840);}}}})['then'](function(){if(_0x2eb1cf){return db[_0x33bb('0xfc')][_0x33bb('0x4d')]({'where':{'membername':_0x2eb1cf['name'],'exitAt':null}});}})['then'](function(_0x3498b2){if(_0x2eb1cf){var _0x5b519d=[];_0x3498b2[_0x33bb('0xfd')](function(_0x2c2664){_0x5b519d[_0x33bb('0x4c')](_0x2c2664[_0x33bb('0x29')]({'exitAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))}));});return Promise[_0x33bb('0x61')](_0x5b519d);}})[_0x33bb('0x15')](function(){if(_0x2eb1cf){var _0x1a9551=[];var _0x1623a9=[];var _0x4b99af=utils[_0x33bb('0xff')]();var _0x34663a={'membername':_0x2eb1cf[_0x33bb('0x37')],'interface':_0xc35bdb,'enterAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe')),'role':_0x2eb1cf[_0x33bb('0x2e')],'internal':_0x2eb1cf['internal']};_0x4b99af['forEach'](function(_0x4130d0){_0x1a9551[_0x33bb('0x4c')](_[_0x33bb('0x5e')]({'channel':_0x4130d0,'type':_0x33bb('0x100'),'data1':_0x25f861[_0x33bb('0x62')][_0x33bb('0x101')],'data2':_0xc35bdb},_0x34663a));if(_0x2eb1cf['loginInPause']){_0x1623a9[_0x33bb('0x4c')](_[_0x33bb('0x5e')]({'channel':_0x4130d0,'type':_0x33bb('0x102'),'data1':_0x33bb('0x103')},_0x34663a));}});return db[_0x33bb('0xfc')][_0x33bb('0x8f')](_0x1a9551['concat'](_0x1623a9),{'individualHooks':!![]});}})[_0x33bb('0x15')](function(){if(_0x2eb1cf){return _0x2eb1cf[_0x33bb('0x29')]({'online':!![],'lastLoginAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe')),'voicePause':_0x2eb1cf['loginInPause']||![],'mailPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'chatPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'faxPause':_0x2eb1cf['loginInPause']||![],'smsPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'openchannelPause':_0x2eb1cf['loginInPause']||![],'whatsappPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'pauseType':_0x2eb1cf[_0x33bb('0xa3')]?_0x33bb('0x103'):null,'interface':_0xc35bdb,'lastPauseAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))});}})[_0x33bb('0x15')](function(_0x3de7d7){if(_0x25f861['isMiddleware']){return _0x392ee2();}else{return Promise[_0x33bb('0x104')](_0x3de7d7)['then'](respondWithResult(_0xca5ea9,null));}})['catch'](handleError(_0xca5ea9,null));};exports[_0x33bb('0x105')]=function(_0x2e7e80,_0x2991b6){var _0x18c7e6;return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x2e7e80[_0x33bb('0x57')]['id'],'role':_0x33bb('0x90')},'attributes':['id',_0x33bb('0x37'),'role']})[_0x33bb('0x15')](handleEntityNotFound(_0x2991b6,null))[_0x33bb('0x15')](function(_0xd77f83){if(_0xd77f83){_0x18c7e6=_0xd77f83;return db[_0x33bb('0xb6')][_0x33bb('0x2c')]({'where':{'membername':_0x18c7e6[_0x33bb('0x37')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0x33bb('0x4d')]({'where':{'membername':_0x18c7e6[_0x33bb('0x37')],'exitAt':null}});})[_0x33bb('0x15')](function(_0x54c987){var _0x35b366=[];_0x54c987['forEach'](function(_0x1c5954){_0x35b366[_0x33bb('0x4c')](_0x1c5954[_0x33bb('0x29')]({'exitAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))}));});return Promise[_0x33bb('0x61')](_0x35b366);})[_0x33bb('0x15')](function(){return _0x18c7e6[_0x33bb('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x33bb('0x15')](respondWithResult(_0x2991b6,null))[_0x33bb('0x1f')](handleError(_0x2991b6,null));};exports[_0x33bb('0x106')]=function(_0x3e881d,_0x518938){var _0x5d6539;return db[_0x33bb('0xb6')][_0x33bb('0x29')]({'paused':0x1},{'where':{'UserId':_0x3e881d[_0x33bb('0x57')]['id']},'individualHooks':!![]})[_0x33bb('0x15')](function(){return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x3e881d[_0x33bb('0x57')]['id'],'role':_0x33bb('0x90')},'attributes':['id',_0x33bb('0x37'),_0x33bb('0x2e'),_0x33bb('0x65'),_0x33bb('0xa5'),'online']});})[_0x33bb('0x15')](handleEntityNotFound(_0x518938,null))[_0x33bb('0x15')](function(_0x276852){if(_0x276852){_0x5d6539=_0x276852;return respondWithRpcPromise(_0x33bb('0x107'),_0x33bb('0x106'),{'id':_0x5d6539['id'],'name':_0x5d6539[_0x33bb('0x37')],'pause':!![]});}})[_0x33bb('0x15')](function(){if(_0x5d6539){return db[_0x33bb('0xfc')][_0x33bb('0x4d')]({'where':{'membername':_0x5d6539[_0x33bb('0x37')],'type':_0x33bb('0x102'),'exitAt':null}});}})[_0x33bb('0x15')](function(_0x5b0bd3){if(_0x5b0bd3['length']){var _0x439242=moment()[_0x33bb('0xb2')](_0x33bb('0xfe'));for(var _0x50fe6a=0x0,_0x51db53=_0x5b0bd3[_0x33bb('0x50')];_0x50fe6a<_0x51db53;_0x50fe6a++){_0x5b0bd3[_0x50fe6a]['updateAttributes']({'exitAt':_0x439242});}}})[_0x33bb('0x15')](function(){var _0x133c8a=[];var _0x2038af=utils['getChannels']();_0x2038af[_0x33bb('0xfd')](function(_0x30f478){_0x133c8a[_0x33bb('0x4c')]({'channel':_0x30f478,'membername':_0x5d6539[_0x33bb('0x37')],'interface':_[_0x33bb('0x6a')](_0x5d6539['interface'])?util[_0x33bb('0xb2')](_0x33bb('0xf1'),_0x5d6539['name']):_0x5d6539[_0x33bb('0xa5')],'type':_0x33bb('0x102'),'enterAt':moment()['format'](_0x33bb('0xfe')),'data1':_0x3e881d[_0x33bb('0x62')]['type']||_0x33bb('0x108'),'role':_0x5d6539[_0x33bb('0x2e')],'internal':_0x5d6539[_0x33bb('0x65')]});});return db[_0x33bb('0xfc')][_0x33bb('0x8f')](_0x133c8a,{'individualHooks':!![]});})[_0x33bb('0x15')](function(){return _0x5d6539[_0x33bb('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3e881d['body'][_0x33bb('0x3f')]||_0x33bb('0x108'),'lastPauseAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))});})[_0x33bb('0x15')](respondWithResult(_0x518938,null))[_0x33bb('0x1f')](handleError(_0x518938,null));};exports[_0x33bb('0x109')]=function(_0x3706ae,_0x559846){if(_0x3706ae[_0x33bb('0x62')]['channel']&&!utils[_0x33bb('0xa6')](_0x3706ae['body'][_0x33bb('0xa1')])){throw new APIBadRequestError(util['format'](_0x33bb('0x10a'),_0x3706ae[_0x33bb('0x62')]['channel']));}return db[_0x33bb('0x3c')]['find']({'where':{'id':_0x3706ae[_0x33bb('0x57')]['id']},'attributes':['id',_0x33bb('0x37'),_0x33bb('0x2e'),_0x33bb('0x65'),_0x33bb('0xa5'),_0x33bb('0xa2'),_0x33bb('0xa4'),_0x33bb('0x10b'),_0x33bb('0x10c'),_0x33bb('0x10d'),_0x33bb('0x10e'),_0x33bb('0x10f'),'whatsappPause','pauseType',_0x33bb('0x110')]})['then'](function(_0x58d00f){if(!_0x58d00f){throw new APINotFoundError(util[_0x33bb('0xb2')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3706ae[_0x33bb('0x57')]['id']));}return _0x58d00f[_0x33bb('0x109')](_0x3706ae[_0x33bb('0x62')][_0x33bb('0xa1')]);})['then'](respondWithResult(_0x559846,null))['catch'](APIHandleError(_0x559846));};exports[_0x33bb('0x111')]=function(_0x3d563b,_0x4f1c05){var _0xb8af06={};var _0x1f075c={};var _0x1da88f;var _0x20b456;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x3d563b[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x4f1c05,null))[_0x33bb('0x15')](function(_0x5510ac){if(_0x5510ac){_0x1da88f=_0x5510ac;_0x1f075c['model']=_['keys'](db[_0x33bb('0x112')][_0x33bb('0x3d')]);_0x1f075c[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x3d563b['query']);_0x1f075c[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x1f075c[_0x33bb('0x58')],_0x1f075c['query']);_0xb8af06[_0x33bb('0x4b')]=_['intersection'](_0x1f075c['model'],qs[_0x33bb('0x5d')](_0x3d563b[_0x33bb('0x45')][_0x33bb('0x5d')]));_0xb8af06['attributes']=_0xb8af06[_0x33bb('0x4b')][_0x33bb('0x50')]?_0xb8af06[_0x33bb('0x4b')]:_0x1f075c[_0x33bb('0x58')];_0xb8af06['order']=qs['sort'](_0x3d563b[_0x33bb('0x45')][_0x33bb('0xd5')]);_0xb8af06['where']=qs['filters'](_['pick'](_0x3d563b[_0x33bb('0x45')],_0x1f075c[_0x33bb('0xd3')]));if(_0x3d563b[_0x33bb('0x45')][_0x33bb('0x32')]){_0xb8af06[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0xb8af06['where'],{'$or':_[_0x33bb('0x34')](_0xb8af06[_0x33bb('0x4b')],function(_0x3b3041){var _0x13133e={};_0x13133e[_0x3b3041]={'$like':'%'+_0x3d563b['query']['filter']+'%'};return _0x13133e;})});}_0xb8af06=_[_0x33bb('0x5e')]({},_0xb8af06,_0x3d563b[_0x33bb('0x5f')]);return _0x1da88f[_0x33bb('0x111')](_0xb8af06);}})[_0x33bb('0x15')](function(_0x532289){if(_0x532289){_0x20b456=_0x532289['length'];if(!_0x3d563b[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0xb8af06[_0x33bb('0x26')]=qs['limit'](_0x3d563b[_0x33bb('0x45')]['limit']);_0xb8af06[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x3d563b[_0x33bb('0x45')]['offset']);}return _0x1da88f['getTeams'](_0xb8af06);}})[_0x33bb('0x15')](function(_0x597b62){if(_0x597b62){return _0x597b62?{'count':_0x20b456,'rows':_0x597b62}:null;}})[_0x33bb('0x15')](respondWithResult(_0x4f1c05,null))[_0x33bb('0x1f')](handleError(_0x4f1c05,null));};exports[_0x33bb('0x113')]=function(_0x45936c,_0x528015){var _0x48febe=_0x45936c[_0x33bb('0x57')]['id'];var _0x5789f9=_0x45936c[_0x33bb('0x62')]?_0x45936c[_0x33bb('0x62')]['ids']:null;var _0x58e70c=[];return Promise['resolve']()[_0x33bb('0x15')](function(){if(!_0x5789f9)throw new APIBadRequestError(_0x33bb('0x114'));})[_0x33bb('0x15')](function(){return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x48febe}});})['then'](function(_0x58be1f){if(!_0x58be1f)throw new APINotFoundError(util[_0x33bb('0xb2')](_0x33bb('0x115'),_0x45936c[_0x33bb('0x57')]['id']));return db[_0x33bb('0x116')]['transaction'](function(_0xb76073){return _0x58be1f['addTeams'](_0x5789f9,{'transaction':_0xb76073})[_0x33bb('0x15')](function(){return db[_0x33bb('0x112')]['findAll']({'where':{'id':{'$in':_0x5789f9}}});})[_0x33bb('0x15')](function(_0x39e354){var _0x2bee8c=_['map'](_0x39e354,function(_0x5d21c5){return _0x5d21c5[_0x33bb('0x117')]();});return Promise[_0x33bb('0x61')](_0x2bee8c);})[_0x33bb('0x15')](function(_0x497411){_0x58e70c=_[_0x33bb('0x118')](_0x497411);var _0x48098e=_[_0x33bb('0x34')](_0x58e70c,function(_0x1d2fdf){return _0x1d2fdf[_0x33bb('0x119')](_0x58be1f['id'],{'transaction':_0xb76073});});return Promise['all'](_0x48098e);})[_0x33bb('0x15')](function(){if(!_0x58be1f[_0x33bb('0xa2')])return;var _0x50af64=_[_0x33bb('0x32')](_0x58e70c,function(_0x41945e){return _0x41945e['getDataValue'](_0x33bb('0xa1'))===_0x33bb('0x11a');});var _0x4d6b15=_[_0x33bb('0x34')](_0x50af64,function(_0x279ab9){return db[_0x33bb('0xb6')]['upsert']({'membername':_0x58be1f[_0x33bb('0x37')],'UserId':_0x58be1f['id'],'queue_name':_0x279ab9[_0x33bb('0x37')],'VoiceQueueId':_0x279ab9['id'],'interface':_[_0x33bb('0x6a')](_0x58be1f[_0x33bb('0xa5')])?util[_0x33bb('0xb2')](_0x33bb('0xf1'),_0x58be1f[_0x33bb('0x37')]):_0x58be1f[_0x33bb('0xa5')],'paused':_0x58be1f[_0x33bb('0xa4')]||![],'penalty':_0x58be1f['penalty']},{'transaction':_0xb76073});});return Promise[_0x33bb('0x61')](_0x4d6b15);})[_0x33bb('0x15')](function(){return db['TeamVoicePrefix'][_0x33bb('0x4d')]({'where':{'teamId':{'$in':_0x5789f9}}});})[_0x33bb('0x15')](function(_0xbdeae8){var _0x491f1e=_[_0x33bb('0x34')](_0xbdeae8,function(_0x49a729){return db[_0x33bb('0x11b')]['create']({'UserId':_0x58be1f['id'],'VoicePrefixId':_0x49a729['VoicePrefixId']},{'transaction':_0xb76073});});return Promise[_0x33bb('0x61')](_0x491f1e);});});})[_0x33bb('0x15')](function(){for(var _0x2e00f0=0x0;_0x2e00f0<_0x58e70c[_0x33bb('0x50')];_0x2e00f0++){var _0x470bb2=_0x58e70c[_0x2e00f0][_0x33bb('0x11c')](_0x33bb('0xa1'));var _0x425b2a=_0x470bb2+'QueueId';socket[_0x33bb('0x2a')]('user'+_0x470bb2+_0x33bb('0xaf'),{'UserId':_0x48febe,['queueField']:_0x58e70c[_0x2e00f0]['id']});}})[_0x33bb('0x15')](respondWithStatusCode(_0x528015,null))['catch'](APIHandleError(_0x528015));};exports[_0x33bb('0x11d')]=function(_0xe159,_0x5b23fb){var _0x3dfb19=_0xe159[_0x33bb('0x57')]['id'];var _0x2d8179=null;if(_0xe159[_0x33bb('0x45')][_0x33bb('0x64')]){_0x2d8179=_[_0x33bb('0xb4')](_0xe159['query']['ids'])?_0xe159[_0x33bb('0x45')][_0x33bb('0x64')]:[_0xe159['query']['ids']];}var _0x3740e6=[];return Promise[_0x33bb('0x104')]()[_0x33bb('0x15')](function(){if(!_0x2d8179)throw new APIBadRequestError(_0x33bb('0x11e'));})[_0x33bb('0x15')](function(){return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x3dfb19}});})['then'](function(_0x42f4e7){if(!_0x42f4e7)throw new APINotFoundError(util['format'](_0x33bb('0x115'),_0xe159[_0x33bb('0x57')]['id']));return db['sequelize'][_0x33bb('0x11f')](function(_0x30bd61){return _0x42f4e7[_0x33bb('0x11d')](_0x2d8179,{'transaction':_0x30bd61})[_0x33bb('0x15')](function(){return db[_0x33bb('0x112')][_0x33bb('0x4d')]({'where':{'id':{'$in':_0x2d8179}}});})['then'](function(_0x144542){var _0x267f39=_[_0x33bb('0x34')](_0x144542,function(_0x1d4728){return _0x1d4728['getAssociatedQueues']();});return Promise['all'](_0x267f39);})[_0x33bb('0x15')](function(_0x3b4fed){_0x3740e6=_[_0x33bb('0x118')](_0x3b4fed);var _0x590647=_[_0x33bb('0x34')](_0x3740e6,function(_0x57eea6){return _0x57eea6[_0x33bb('0x120')](_0x42f4e7['id'],{'transaction':_0x30bd61});});return Promise[_0x33bb('0x61')](_0x590647);})[_0x33bb('0x15')](function(){if(!_0x42f4e7[_0x33bb('0xa2')])return;var _0x42e9e4=_['filter'](_0x3740e6,function(_0x146f6e){return _0x146f6e[_0x33bb('0x11c')](_0x33bb('0xa1'))===_0x33bb('0x11a');});var _0x5e167b=_[_0x33bb('0x34')](_0x42e9e4,function(_0xebe97){return db[_0x33bb('0xb6')]['destroy']({'where':{'VoiceQueueId':_0xebe97['id'],'UserId':_0x42f4e7['id']},'transaction':_0x30bd61});});return Promise[_0x33bb('0x61')](_0x5e167b);})['then'](function(){return db[_0x33bb('0x121')][_0x33bb('0x4d')]({'where':{'teamId':{'$in':_0x2d8179}}});})[_0x33bb('0x15')](function(_0xca22d2){var _0xc896c3=_[_0x33bb('0x34')](_0xca22d2,function(_0xd15d5d){return db[_0x33bb('0x11b')][_0x33bb('0x2c')]({'where':{'UserId':_0x42f4e7['id'],'VoicePrefixId':_0xd15d5d[_0x33bb('0x122')]}},{'transaction':_0x30bd61});});return Promise[_0x33bb('0x61')](_0xc896c3);});});})['then'](function(){for(var _0x1e1273=0x0;_0x1e1273<_0x3740e6[_0x33bb('0x50')];_0x1e1273++){var _0x14dbec=_0x3740e6[_0x1e1273][_0x33bb('0x11c')](_0x33bb('0xa1'));var _0x3395fc=_0x14dbec+_0x33bb('0xae');socket[_0x33bb('0x2a')](_0x33bb('0x31')+_0x14dbec+_0x33bb('0xb5'),{'UserId':_0x3dfb19,['queueField']:_0x3740e6[_0x1e1273]['id']});}})[_0x33bb('0x15')](respondWithStatusCode(_0x5b23fb,null))[_0x33bb('0x1f')](APIHandleError(_0x5b23fb));};exports[_0x33bb('0x123')]=function(_0x2c697c,_0x16c854){var _0x3109b2={};var _0x2ba5f1={};var _0x2453cb;var _0x1ba896;return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x2c697c[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x16c854,null))[_0x33bb('0x15')](function(_0x17dcfe){if(_0x17dcfe){_0x2453cb=_0x17dcfe;_0x2ba5f1[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0x124')][_0x33bb('0x3d')]);_0x2ba5f1[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x2c697c['query']);_0x2ba5f1['filters']=_[_0x33bb('0x5c')](_0x2ba5f1[_0x33bb('0x58')],_0x2ba5f1['query']);_0x3109b2[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x2ba5f1['model'],qs[_0x33bb('0x5d')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x3109b2[_0x33bb('0x4b')]=_0x3109b2[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x3109b2['attributes']:_0x2ba5f1[_0x33bb('0x58')];_0x3109b2[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x3109b2[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x2c697c[_0x33bb('0x45')],_0x2ba5f1[_0x33bb('0xd3')]));if(_0x2c697c['query'][_0x33bb('0x32')]){_0x3109b2[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x3109b2[_0x33bb('0x44')],{'$or':_['map'](_0x3109b2[_0x33bb('0x4b')],function(_0x4ea7e8){var _0x5936a1={};_0x5936a1[_0x4ea7e8]={'$like':'%'+_0x2c697c[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x5936a1;})});}_0x3109b2=_[_0x33bb('0x5e')]({},_0x3109b2,_0x2c697c[_0x33bb('0x5f')]);return _0x2453cb[_0x33bb('0x123')](_0x3109b2);}})[_0x33bb('0x15')](function(_0x115d30){if(_0x115d30){_0x1ba896=_0x115d30[_0x33bb('0x50')];if(!_0x2c697c['query'][_0x33bb('0xcf')]('nolimit')){_0x3109b2[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0x26')]);_0x3109b2['offset']=qs[_0x33bb('0x23')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x2453cb[_0x33bb('0x123')](_0x3109b2);}})[_0x33bb('0x15')](function(_0x7f950){if(_0x7f950){return _0x7f950?{'count':_0x1ba896,'rows':_0x7f950}:null;}})[_0x33bb('0x15')](respondWithResult(_0x16c854,null))[_0x33bb('0x1f')](handleError(_0x16c854,null));};exports['getAgents']=function(_0x5e5f68,_0x451982){var _0x362475={};var _0x3b0974={};var _0x24353c;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x5e5f68[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x451982,null))[_0x33bb('0x15')](function(_0x46db8a){if(_0x46db8a){_0x24353c=_0x46db8a;_0x3b0974['model']=_['keys'](db[_0x33bb('0x3c')]['rawAttributes']);_0x3b0974[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x5e5f68[_0x33bb('0x45')]);_0x3b0974[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x3b0974[_0x33bb('0x58')],_0x3b0974['query']);_0x362475[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x3b0974[_0x33bb('0x58')],qs['fields'](_0x5e5f68[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x362475[_0x33bb('0x4b')]=_0x362475['attributes']['length']?_0x362475[_0x33bb('0x4b')]:_0x3b0974[_0x33bb('0x58')];_0x362475[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x5e5f68[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x362475[_0x33bb('0x44')]=qs['filters'](_[_0x33bb('0xd6')](_0x5e5f68[_0x33bb('0x45')],_0x3b0974[_0x33bb('0xd3')]));if(_0x5e5f68[_0x33bb('0x45')]['filter']){_0x362475[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x362475[_0x33bb('0x44')],{'$or':_['map'](_0x362475[_0x33bb('0x4b')],function(_0x2b39b1){var _0x592dec={};_0x592dec[_0x2b39b1]={'$like':'%'+_0x5e5f68[_0x33bb('0x45')]['filter']+'%'};return _0x592dec;})});}_0x362475[_0x33bb('0x58')]=db[_0x33bb('0x3c')];_0x362475['as']='Agents';_0x362475=_[_0x33bb('0x5e')]({},_0x362475,_0x5e5f68[_0x33bb('0x5f')]);return _0x24353c[_0x33bb('0xfa')]({'include':[_0x362475]});}})['then'](function(_0x1c7921){if(_0x1c7921){var _0x3b70d3={},_0x37d9ca=[];for(var _0x142ace=0x0;_0x142ace<_0x1c7921[_0x33bb('0x50')];_0x142ace+=0x1){for(var _0x4625c8=0x0,_0x52cf18;_0x4625c8<_0x1c7921[_0x142ace][_0x33bb('0x8b')][_0x33bb('0x50')];_0x4625c8+=0x1){_0x52cf18=_0x1c7921[_0x142ace][_0x33bb('0x8b')][_0x4625c8][_0x33bb('0x2d')]({'plain':!![]});_0x3b70d3[_0x52cf18['id']]=_0x52cf18;}}_0x3b70d3=_[_0x33bb('0x125')](_0x3b70d3);for(var _0x501d0b=qs[_0x33bb('0x23')](_0x5e5f68[_0x33bb('0x45')][_0x33bb('0x23')]);_0x501d0b<_0x3b70d3[_0x33bb('0x50')]&&_0x37d9ca[_0x33bb('0x50')]=_0x4442af){_0x466b6d=_0x4442af;_0x44385b=0xc8;}else{_0x44385b=0xce;}_0x19251f[_0x6ec6('0x22')](_0x44385b);return _0x19251f[_0x6ec6('0x29')](_0x6ec6('0x2a'),_0x4a0be2+'-'+_0x466b6d+'/'+_0x4442af)[_0x6ec6('0x24')](_0xc75250);}return null;};}function saveUpdates(_0x46f5ea){return function(_0x45bf80){if(_0x45bf80){return _0x45bf80[_0x6ec6('0x2b')](_0x46f5ea)[_0x6ec6('0x15')](function(_0x5f4576){if(_0x5f4576[_0x6ec6('0x2c')]==='agent'){socket[_0x6ec6('0x2d')](_0x6ec6('0x2e')+_0x5f4576['id'],_0x5f4576);}return _0x5f4576;});}return null;};}function removeEntity(_0x4e0d52){return function(_0x14e5e9){if(_0x14e5e9){return _0x14e5e9['destroy']()[_0x6ec6('0x15')](function(){var _0x4ebc01=_0x14e5e9[_0x6ec6('0x2f')]({'plain':!![]});if(_0x4ebc01[_0x6ec6('0x2c')]===_0x6ec6('0x30'))return;var _0xf31b41=[{'name':'Users','value':_0x6ec6('0x31'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x6ec6('0x32'),'value':_0x6ec6('0x33'),'ignore':![]}];var _0x1eb9c0=_(_0xf31b41)[_0x6ec6('0x34')]('ignore')[_0x6ec6('0x35')](_0x6ec6('0x36'))['value']();if(_[_0x6ec6('0x37')](_0x1eb9c0,_0x4ebc01[_0x6ec6('0x2c')])){return;}var _0x48c146=_[_0x6ec6('0x38')](_0xf31b41,['value',_0x4ebc01[_0x6ec6('0x2c')]])['name'];return db['UserProfileResource'][_0x6ec6('0x39')]({'where':{'type':_0x48c146,'resourceId':_0x4ebc01['id']}})['then'](function(){return _0x14e5e9;});})[_0x6ec6('0x15')](function(){_0x4e0d52['status'](0xcc)[_0x6ec6('0x23')]();});}};}function handleEntityNotFound(_0x19443c){return function(_0x4f3e5d){if(!_0x4f3e5d){_0x19443c['sendStatus'](0x194);}return _0x4f3e5d;};}function handleError(_0x23ffe9,_0x26e165){_0x26e165=_0x26e165||0x1f4;return function(_0x25d6d0){logger[_0x6ec6('0x1c')](_0x25d6d0[_0x6ec6('0x3a')]);if(_0x25d6d0[_0x6ec6('0x3b')]){delete _0x25d6d0[_0x6ec6('0x3b')];}_0x23ffe9[_0x6ec6('0x22')](_0x26e165)['send'](_0x25d6d0);};}exports[_0x6ec6('0x3c')]=function(_0x4b4f0c,_0x22b4c){var _0x3b0eff={},_0x29fd1c={'count':0x0,'rows':[]};var _0x53327d=_(db['User']['rawAttributes'])[_0x6ec6('0x35')](function(_0x2b387f){return{'name':_0x2b387f[_0x6ec6('0x3d')],'type':_0x2b387f[_0x6ec6('0x3e')][_0x6ec6('0x3f')]};})['filter'](function(_0x5ee672){return!_[_0x6ec6('0x37')](['password',_0x6ec6('0x40')],_0x5ee672['name']);})['value']();_0x3b0eff=qs[_0x6ec6('0x41')](_0x53327d,_0x4b4f0c);var _0x446b58={'where':_0x3b0eff['where']};return db[_0x6ec6('0x42')][_0x6ec6('0x28')](_0x446b58)[_0x6ec6('0x15')](function(_0x1479a7){_0x29fd1c[_0x6ec6('0x28')]=_0x1479a7;if(_0x4b4f0c['query'][_0x6ec6('0x43')]){_0x3b0eff[_0x6ec6('0x44')]=[{'all':!![]}];}if(_0x4b4f0c[_0x6ec6('0x45')]['userSetting']===_0x6ec6('0x46')){_0x3b0eff[_0x6ec6('0x44')]=[{'model':db[_0x6ec6('0x47')],'as':_0x6ec6('0x48')}];}if(!_[_0x6ec6('0x37')](_0x3b0eff[_0x6ec6('0x49')],'id')){_0x3b0eff[_0x6ec6('0x49')][_0x6ec6('0x4a')]('id');}return db[_0x6ec6('0x42')]['findAll'](_0x3b0eff);})[_0x6ec6('0x15')](function(_0x35f8a4){_0x29fd1c[_0x6ec6('0x4b')]=_0x35f8a4;if(_0x4b4f0c[_0x6ec6('0x45')][_0x6ec6('0x4c')]===_0x6ec6('0x46')){var _0x4d58bf=[];for(var _0x6fb6a0=0x0;_0x6fb6a0<_0x29fd1c[_0x6ec6('0x4b')][_0x6ec6('0x4d')];_0x6fb6a0++){_0x4d58bf[_0x6ec6('0x4a')](get_open_tabs('chat',_0x29fd1c[_0x6ec6('0x4b')][_0x6fb6a0][_0x6ec6('0x4e')]));_0x4d58bf['push'](get_open_tabs(_0x6ec6('0x4f'),_0x29fd1c['rows'][_0x6fb6a0][_0x6ec6('0x4e')]));_0x4d58bf[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x50'),_0x29fd1c['rows'][_0x6fb6a0][_0x6ec6('0x4e')]));_0x4d58bf[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x51'),_0x29fd1c[_0x6ec6('0x4b')][_0x6fb6a0][_0x6ec6('0x4e')]));_0x4d58bf[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x52'),_0x29fd1c[_0x6ec6('0x4b')][_0x6fb6a0][_0x6ec6('0x4e')]));_0x4d58bf['push'](get_open_tabs('whatsapp',_0x29fd1c[_0x6ec6('0x4b')][_0x6fb6a0][_0x6ec6('0x4e')]));}return Promise[_0x6ec6('0x53')](_0x4d58bf)['then'](function(){return _0x29fd1c;});}else{return _0x29fd1c;}})[_0x6ec6('0x15')](respondWithFilteredResult(_0x22b4c,_0x3b0eff))[_0x6ec6('0x20')](handleError(_0x22b4c,null));};exports[_0x6ec6('0x54')]=function(_0x163a07,_0x12e66){var _0x218183={'raw':![],'where':{'id':_0x163a07['params']['id']}},_0x891691={};_0x891691[_0x6ec6('0x55')]=_[_0x6ec6('0x56')](_['keys'](db[_0x6ec6('0x42')]['rawAttributes']),[_0x6ec6('0x57'),_0x6ec6('0x40')]);_0x891691['query']=_[_0x6ec6('0x58')](_0x163a07['query']);_0x891691[_0x6ec6('0x59')]=_['intersection'](_0x891691[_0x6ec6('0x55')],_0x891691['query']);_0x218183[_0x6ec6('0x49')]=_[_0x6ec6('0x5a')](_0x891691[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x163a07[_0x6ec6('0x45')]['fields']));_0x218183['attributes']=_0x218183['attributes'][_0x6ec6('0x4d')]?_0x218183[_0x6ec6('0x49')]:_0x891691[_0x6ec6('0x55')];if(_0x163a07['query'][_0x6ec6('0x43')]){_0x218183['include']=[{'all':!![]}];}if(_0x163a07[_0x6ec6('0x45')][_0x6ec6('0x48')]==='true'){_0x218183[_0x6ec6('0x44')]=[{'model':db[_0x6ec6('0x47')],'as':'userSetting'}];}_0x218183=_[_0x6ec6('0x5c')]({},_0x218183,_0x163a07[_0x6ec6('0x5d')]);if(!_['includes'](_0x218183[_0x6ec6('0x49')],'id')){_0x218183[_0x6ec6('0x49')][_0x6ec6('0x4a')]('id');}return db['User'][_0x6ec6('0x38')](_0x218183)[_0x6ec6('0x15')](handleEntityNotFound(_0x12e66,null))[_0x6ec6('0x15')](function(_0x3cb49f){var _0x5b9540=[];values=_0x3cb49f;if(_0x163a07[_0x6ec6('0x45')][_0x6ec6('0x4c')]==='true'){_0x5b9540[_0x6ec6('0x4a')](get_open_tabs('chat',_0x3cb49f[_0x6ec6('0x4e')]));_0x5b9540[_0x6ec6('0x4a')](get_open_tabs('sms',_0x3cb49f[_0x6ec6('0x4e')]));_0x5b9540[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x52'),_0x3cb49f[_0x6ec6('0x4e')]));_0x5b9540[_0x6ec6('0x4a')](get_open_tabs('whatsapp',_0x3cb49f['dataValues']));_0x5b9540['push'](get_open_tabs(_0x6ec6('0x50'),_0x3cb49f[_0x6ec6('0x4e')]));_0x5b9540[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x51'),_0x3cb49f[_0x6ec6('0x4e')]));return Promise[_0x6ec6('0x53')](_0x5b9540);}else{return values;}})['then'](function(){return values;})[_0x6ec6('0x15')](respondWithResult(_0x12e66,null))[_0x6ec6('0x20')](handleError(_0x12e66,null));};exports[_0x6ec6('0x2b')]=function(_0x366e2e,_0x4917e7){if(_0x366e2e['body']['id']){delete _0x366e2e[_0x6ec6('0x5e')]['id'];}delete _0x366e2e[_0x6ec6('0x5e')][_0x6ec6('0x2c')];return db['User'][_0x6ec6('0x38')]({'where':{'id':_0x366e2e[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x4917e7,null))[_0x6ec6('0x15')](saveUpdates(_0x366e2e[_0x6ec6('0x5e')],null))[_0x6ec6('0x15')](respondWithResult(_0x4917e7,null))['catch'](handleError(_0x4917e7,null));};exports[_0x6ec6('0x60')]=function(_0x5c2d6a,_0x3217aa){return db[_0x6ec6('0x42')][_0x6ec6('0x60')]()['then'](respondWithResult(_0x3217aa,null))['catch'](handleError(_0x3217aa,null));};exports[_0x6ec6('0x61')]=function(_0x4ca8a0,_0x6e7014){return db['User'][_0x6ec6('0x38')]({'where':{'id':_0x4ca8a0['params']['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x6e7014,null))[_0x6ec6('0x15')](function(_0x5c0174){if(_0x5c0174){return _0x5c0174[_0x6ec6('0x61')](_0x4ca8a0[_0x6ec6('0x5e')]['ids'],_[_0x6ec6('0x62')](_0x4ca8a0[_0x6ec6('0x5e')],['ids','id'])||{});}})['then'](respondWithResult(_0x6e7014,null))[_0x6ec6('0x20')](handleError(_0x6e7014,null));};function validateUser(_0x74ec14){return new Promise(function(_0x3a6df7,_0x1bdac6){if(_0x74ec14[_0x6ec6('0x63')])return _0x3a6df7(_0x74ec14);return db['Setting'][_0x6ec6('0x64')](0x1)[_0x6ec6('0x15')](function(_0x53eaa1){if(_0x53eaa1['securePassword'])authService['validatePasswordPattern'](_0x74ec14[_0x6ec6('0x57')]);db[_0x6ec6('0x42')][_0x6ec6('0x65')](_0x6ec6('0x63'))['then'](function(_0x2f1d82){if(_[_0x6ec6('0x66')](_0x2f1d82)){_0x74ec14['internal']=_0x53eaa1[_0x6ec6('0x67')]||0x1;return;}if(_[_0x6ec6('0x66')](_0x53eaa1[_0x6ec6('0x67')])||_0x53eaa1['min_internal']===_0x2f1d82){_0x74ec14[_0x6ec6('0x63')]=_0x2f1d82+0x1;return;}if(_0x53eaa1['min_internal']>_0x2f1d82){_0x74ec14[_0x6ec6('0x63')]=_0x53eaa1[_0x6ec6('0x67')];return;}return db['sequelize']['query'](_0x6ec6('0x68'),{'type':db[_0x6ec6('0x69')][_0x6ec6('0x6a')][_0x6ec6('0x6b')]})[_0x6ec6('0x15')](function(_0x1f3849){if(_0x1f3849&&_0x1f3849[_0x6ec6('0x4d')]){for(var _0x5ab263=0x0,_0x2cae53=_0x1f3849[_0x6ec6('0x4d')];_0x5ab263<_0x2cae53&&_['isNil'](_0x74ec14[_0x6ec6('0x63')]);_0x5ab263++){if(_0x53eaa1[_0x6ec6('0x67')]<=_0x1f3849[_0x5ab263][_0x6ec6('0x6c')]){_0x74ec14['internal']=_0x1f3849[_0x5ab263][_0x6ec6('0x6c')];}else if(_0x53eaa1[_0x6ec6('0x67')]>_0x1f3849[_0x5ab263][_0x6ec6('0x6c')]&&_0x53eaa1['min_internal']<=_0x1f3849[_0x5ab263]['to']){_0x74ec14['internal']=_0x53eaa1[_0x6ec6('0x67')];}}}if(_[_0x6ec6('0x66')](_0x74ec14[_0x6ec6('0x63')])){_0x74ec14[_0x6ec6('0x63')]=_0x2f1d82+0x1;}return _0x3a6df7(_0x74ec14);});});})[_0x6ec6('0x20')](function(_0x4e75e5){_0x1bdac6(_0x4e75e5);});});}function updateUser(_0x4ebed7){return new Promise(function(_0x4baacf,_0x2b215f){try{if(_0x4ebed7['voicemail']){_0x4ebed7[_0x6ec6('0x6d')]=_0x4ebed7[_0x6ec6('0x63')];_0x4ebed7[_0x6ec6('0x6e')]={'mailbox':_0x4ebed7[_0x6ec6('0x63')],'password':_0x4ebed7[_0x6ec6('0x57')],'fullname':_0x4ebed7[_0x6ec6('0x6f')],'email':_0x4ebed7['email']};}if(_0x4ebed7['role']===_0x6ec6('0x70')){if(!_0x4ebed7['permissions'])_0x4ebed7['permissions']=[_0x6ec6('0x71'),'102',_0x6ec6('0x72'),'113','110',_0x6ec6('0x73'),_0x6ec6('0x74'),_0x6ec6('0x75'),_0x6ec6('0x76'),_0x6ec6('0x77'),_0x6ec6('0x78'),_0x6ec6('0x79'),_0x6ec6('0x7a'),_0x6ec6('0x7b'),_0x6ec6('0x7c')];}_0x4baacf(_0x4ebed7);}catch(_0x32084b){_0x2b215f(_0x32084b);}});}exports[_0x6ec6('0x7d')]=function(_0x3b36a4,_0x581872){if(_0x3b36a4['user']['role']==='agent')throw new Error('Unauthorized');if(_0x3b36a4[_0x6ec6('0x5e')][_0x6ec6('0x2c')]===_0x6ec6('0x31')&&_0x3b36a4[_0x6ec6('0x31')]['role']!==_0x6ec6('0x30')){throw new Error(_0x6ec6('0x7e'));}if(_0x3b36a4[_0x6ec6('0x5e')][_0x6ec6('0x2c')]===_0x6ec6('0x30')&&_0x3b36a4[_0x6ec6('0x31')]['role']!==_0x6ec6('0x30')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x6ec6('0x7f')]([_0x3b36a4['body']])[_0x6ec6('0x15')](function(){return validateUser(_0x3b36a4[_0x6ec6('0x5e')]);})['then'](function(_0x37fa84){return updateUser(_0x37fa84)[_0x6ec6('0x15')](function(_0x38e67c){if(_0x38e67c[_0x6ec6('0x2c')]===_0x6ec6('0x30')){_0x38e67c[_0x6ec6('0x80')]=_0x3b36a4[_0x6ec6('0x31')][_0x6ec6('0x80')];delete _0x38e67c[_0x6ec6('0x81')];}return _0x38e67c;});})[_0x6ec6('0x15')](function(_0x4c4b4c){return db[_0x6ec6('0x42')]['create'](_0x4c4b4c,{'include':[{'model':db[_0x6ec6('0x6e')],'as':_0x6ec6('0x6e')}]});})[_0x6ec6('0x15')](function(_0x1d3eb9){if(_0x3b36a4[_0x6ec6('0x5e')][_0x6ec6('0x2c')]==='user')return _0x1d3eb9;if(_0x3b36a4[_0x6ec6('0x31')][_0x6ec6('0x2c')]!=='user')return _0x1d3eb9;return db[_0x6ec6('0x82')][_0x6ec6('0x38')]({'where':{'name':_0x1d3eb9[_0x6ec6('0x2c')]===_0x6ec6('0x70')?'Agents':_0x6ec6('0x32'),'userProfileId':_0x3b36a4['user'][_0x6ec6('0x81')]},'raw':!![]})[_0x6ec6('0x15')](function(_0x85f912){if(!_0x85f912||_0x85f912['autoAssociation']!=0x0)return _0x1d3eb9;return db['UserProfileResource'][_0x6ec6('0x7d')]({'name':_0x1d3eb9['name'],'resourceId':_0x1d3eb9['id'],'type':_0x85f912[_0x6ec6('0x3b')],'sectionId':_0x85f912['id']},{})[_0x6ec6('0x15')](function(){return _0x1d3eb9;});})[_0x6ec6('0x20')](function(_0x41f8b4){logger[_0x6ec6('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41f8b4);throw _0x41f8b4;});})[_0x6ec6('0x15')](respondWithResult(_0x581872,0xc9))[_0x6ec6('0x20')](handleError(_0x581872,null));};exports['bulkCreate']=function(_0x2642c5,_0x4cba83){var _0x39294c=_0x2642c5['body'];var _0x32da8f=[];if(_0x2642c5[_0x6ec6('0x31')][_0x6ec6('0x2c')]===_0x6ec6('0x70'))throw new Error('Unauthorized');if(_[_0x6ec6('0x83')](_0x39294c,[_0x6ec6('0x2c'),'user'])&&_0x2642c5[_0x6ec6('0x31')][_0x6ec6('0x2c')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6ec6('0x83')](_0x39294c,[_0x6ec6('0x2c'),'admin'])&&_0x2642c5['user'][_0x6ec6('0x2c')]!==_0x6ec6('0x30')){throw new Error(_0x6ec6('0x84'));}return licenseUtil[_0x6ec6('0x7f')](_0x39294c)[_0x6ec6('0x15')](function(){return validateUser(_0x39294c[0x0]);})[_0x6ec6('0x15')](function(){for(var _0x398e41=0x1;_0x398e41<_0x39294c[_0x6ec6('0x4d')];_0x398e41++){var _0x116845=_0x39294c[_0x398e41-0x1][_0x6ec6('0x63')];if(!_0x39294c[_0x398e41][_0x6ec6('0x63')])_0x39294c[_0x398e41]['internal']=_0x116845+0x1;_0x32da8f[_0x6ec6('0x4a')](validateUser(_0x39294c[_0x398e41]));}return Promise[_0x6ec6('0x53')](_0x32da8f);})[_0x6ec6('0x15')](function(){_0x32da8f=[];for(var _0x290f58=0x0;_0x290f58<_0x39294c[_0x6ec6('0x4d')];_0x290f58++){_0x32da8f[_0x6ec6('0x4a')](updateUser(_0x39294c[_0x290f58]));}return Promise['all'](_0x32da8f);})[_0x6ec6('0x15')](function(){_0x32da8f=_0x39294c[_0x6ec6('0x35')](function(_0x12b362){return db[_0x6ec6('0x42')][_0x6ec6('0x7d')](_0x12b362,{'include':[{'model':db['VoiceMail'],'as':_0x6ec6('0x6e')}]})[_0x6ec6('0x15')](function(_0x2f45fc){_0x12b362['id']=_0x2f45fc['id'];return _0x12b362;});});return Promise['all'](_0x32da8f);})[_0x6ec6('0x15')](function(_0x1e370b){if(_0x2642c5['body']['role']==='user')return _0x1e370b;if(_0x2642c5['user'][_0x6ec6('0x2c')]!==_0x6ec6('0x31'))return _0x1e370b;var _0x167059=_[_0x6ec6('0x83')](_0x1e370b,function(_0x335157){return _0x335157[_0x6ec6('0x2c')]===_0x6ec6('0x70')||_0x335157['role']===_0x6ec6('0x33');});if(!_0x167059)return _0x1e370b;return db[_0x6ec6('0x82')]['findAll']({'where':{'name':{'$or':[_0x6ec6('0x85'),'Telephones']},'userProfileId':_0x2642c5[_0x6ec6('0x31')]['userProfileId']},'raw':!![]})['then'](function(_0x5e59dd){if(_[_0x6ec6('0x86')](_0x5e59dd)||!_[_0x6ec6('0x83')](_0x5e59dd,[_0x6ec6('0x87'),0x0]))return _0x1e370b;_0x32da8f=[];var _0x5363ab=_(_0x5e59dd)[_0x6ec6('0x35')](function(_0x2c4faf){if(_0x2c4faf[_0x6ec6('0x87')]===0x1)return;return _0x2c4faf[_0x6ec6('0x3b')]===_0x6ec6('0x85')?_0x6ec6('0x70'):_0x6ec6('0x33');})[_0x6ec6('0x88')]()['value']();for(var _0x31068d=0x0;_0x31068d<_0x1e370b[_0x6ec6('0x4d')];_0x31068d++){if(!_[_0x6ec6('0x37')](_0x5363ab,_0x1e370b[_0x31068d][_0x6ec6('0x2c')]))return;var _0x50e2f5=_0x1e370b[_0x31068d][_0x6ec6('0x2c')]==='agent'?_0x6ec6('0x85'):_0x6ec6('0x32');_0x32da8f[_0x6ec6('0x4a')](db[_0x6ec6('0x89')][_0x6ec6('0x7d')]({'name':_0x1e370b[_0x31068d][_0x6ec6('0x3b')],'resourceId':_0x1e370b[_0x31068d]['id'],'type':_0x50e2f5,'sectionId':_[_0x6ec6('0x38')](_0x5e59dd,[_0x6ec6('0x3b'),_0x50e2f5])['id']},{}));}return Promise[_0x6ec6('0x53')](_0x32da8f);});})[_0x6ec6('0x15')](respondWithResult(_0x4cba83,0xc9))[_0x6ec6('0x20')](handleError(_0x4cba83,null));};exports[_0x6ec6('0x8a')]=function(_0x4ef3b5,_0x49a1d3){if(_0x4ef3b5[_0x6ec6('0x5e')]['id']){delete _0x4ef3b5[_0x6ec6('0x5e')]['id'];}return db['User'][_0x6ec6('0x38')]({'where':{'id':_0x4ef3b5[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](function(_0x32848e){if(!_0x32848e)return null;if(_0x32848e['id']===_0x4ef3b5['user']['id']){if(!_0x4ef3b5[_0x6ec6('0x5e')][_0x6ec6('0x8b')]||!_0x4ef3b5[_0x6ec6('0x5e')][_0x6ec6('0x8c')]){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x32848e[_0x6ec6('0x8f')](_0x4ef3b5[_0x6ec6('0x5e')][_0x6ec6('0x8b')])){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))](_0x6ec6('0x90'));}if(_0x4ef3b5['body'][_0x6ec6('0x8b')]===_0x4ef3b5['body'][_0x6ec6('0x8c')]){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))](_0x6ec6('0x91'));}}else if(_0x4ef3b5[_0x6ec6('0x31')][_0x6ec6('0x2c')]==='admin'){if(!_0x4ef3b5[_0x6ec6('0x5e')][_0x6ec6('0x8c')]){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))](_0x6ec6('0x92'));}}else if(_0x4ef3b5['user']['role']===_0x6ec6('0x31')){if(!_0x4ef3b5[_0x6ec6('0x5e')]['newPassword']){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x32848e[_0x6ec6('0x2c')]!==_0x6ec6('0x70')){throw new db['Sequelize'][(_0x6ec6('0x8e'))](_0x6ec6('0x93'));}}else{throw new db['Sequelize'][(_0x6ec6('0x8e'))]('Unauthorized');}return _0x32848e;})[_0x6ec6('0x15')](handleEntityNotFound(_0x49a1d3,null))[_0x6ec6('0x15')](function(_0x369efb){return db['Setting'][_0x6ec6('0x94')]({'attributes':['id',_0x6ec6('0x95'),_0x6ec6('0x96'),'passwordHistoryLimit']})[_0x6ec6('0x15')](function(_0x4d248f){if(_0x4d248f[_0x6ec6('0x95')])authService[_0x6ec6('0x97')](_0x4ef3b5[_0x6ec6('0x5e')][_0x6ec6('0x8c')]);if(!_0x4d248f[_0x6ec6('0x96')]||!_0x369efb['previousPasswords'])return _0x369efb;authService[_0x6ec6('0x98')](_0x4ef3b5['body'][_0x6ec6('0x8c')],_0x369efb[_0x6ec6('0x99')],_0x4d248f[_0x6ec6('0x9a')]);return _0x369efb;})[_0x6ec6('0x15')](saveUpdates({'password':_0x4ef3b5['body'][_0x6ec6('0x8c')],'passwordResetAt':_0x4ef3b5[_0x6ec6('0x31')]['id']==_0x4ef3b5[_0x6ec6('0x5f')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4ef3b5['body'][_0x6ec6('0x8c')],_0x369efb[_0x6ec6('0x99')])},null));})[_0x6ec6('0x15')](respondWithResult(_0x49a1d3,null))[_0x6ec6('0x20')](handleError(_0x49a1d3,null));};exports['addQueues']=function(_0x57752f,_0x586b2c){var _0x45fc58=_0x57752f[_0x6ec6('0x5e')][_0x6ec6('0x9b')];return db['User'][_0x6ec6('0x38')]({'where':{'id':_0x57752f['params']['id']},'attributes':['id',_0x6ec6('0x3b'),_0x6ec6('0x2c'),_0x6ec6('0x9c'),_0x6ec6('0x9d'),_0x6ec6('0x9e'),_0x6ec6('0x9f')]})['then'](handleEntityNotFound(_0x586b2c,null))[_0x6ec6('0x15')](function(_0x5d8948){if(_0x5d8948){if(!utils[_0x6ec6('0xa0')](_0x45fc58)){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))](_0x6ec6('0xa1'));}return _0x5d8948[_0x6ec6('0xa2')+_[_0x6ec6('0xa3')](_0x45fc58['toLowerCase']())+'Queues'](_0x57752f[_0x6ec6('0x5e')][_0x6ec6('0xa4')],{'penalty':_0x57752f[_0x6ec6('0x5e')][_0x6ec6('0xa5')]||0x0})['spread'](function(_0x594d64){for(var _0x2421a2=0x0;_0x2421a2<_0x57752f[_0x6ec6('0x5e')][_0x6ec6('0xa4')][_0x6ec6('0x4d')];_0x2421a2+=0x1){var _0x4c97fc={'UserId':Number(_0x57752f[_0x6ec6('0x5f')]['id'])};_0x4c97fc[_['capitalize'](_0x45fc58[_0x6ec6('0xa6')]())+_0x6ec6('0xa7')]=Number(_0x57752f['body'][_0x6ec6('0xa4')][_0x2421a2]);socket[_0x6ec6('0x2d')]('user'+_['capitalize'](_0x45fc58[_0x6ec6('0xa6')]())+_0x6ec6('0xa8'),_0x4c97fc);}return _0x594d64;})[_0x6ec6('0x15')](function(){if(_0x45fc58===_0x6ec6('0xa9')){return db[_0x6ec6('0xaa')]['findAll']({'where':{'id':_0x57752f[_0x6ec6('0x5e')][_0x6ec6('0xa4')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x6ec6('0x15')](function(_0x571bd6){var _0xc088b9=_0x5d8948['get']({'plain':!![]});var _0x149339=[];if(_0x45fc58===_0x6ec6('0xa9')&&_0xc088b9[_0x6ec6('0x2c')]===_0x6ec6('0x70')&&_0xc088b9[_0x6ec6('0x9c')]){for(let _0xfe0cd2=0x0;_0xfe0cd2<_0x571bd6[_0x6ec6('0x4d')];_0xfe0cd2+=0x1){_0x149339[_0x6ec6('0x4a')]({'membername':_0xc088b9[_0x6ec6('0x3b')],'UserId':_0xc088b9['id'],'queue_name':_0x571bd6[_0xfe0cd2][_0x6ec6('0x3b')],'VoiceQueueId':_0x571bd6[_0xfe0cd2]['id'],'interface':_[_0x6ec6('0x66')](_0xc088b9['interface'])?util[_0x6ec6('0xab')]('SIP/%s',_0xc088b9[_0x6ec6('0x3b')]):_0xc088b9[_0x6ec6('0x9f')],'paused':_0xc088b9[_0x6ec6('0x9e')]||![],'penalty':_0x57752f[_0x6ec6('0x5e')]['penalty']||0x0});}return Promise['all'](_0x149339[_0x6ec6('0x35')](function(_0x371cd8){return db[_0x6ec6('0xac')]['upsert'](_0x371cd8);}));}return _0x5d8948;});}})[_0x6ec6('0x15')](respondWithStatusCode(_0x586b2c,null))['catch'](handleError(_0x586b2c,null));};exports[_0x6ec6('0xad')]=function(_0x337721,_0x1fa306){var _0x3c6ddc,_0x2801dc;return db[_0x6ec6('0x42')]['find']({'where':{'id':_0x337721['params']['id']},'attributes':['id',_0x6ec6('0x3b'),_0x6ec6('0x2c')]})[_0x6ec6('0x15')](handleEntityNotFound(_0x1fa306,null))[_0x6ec6('0x15')](function(_0x4cc7c8){if(_0x4cc7c8){_0x3c6ddc=_0x4cc7c8;if(!_0x337721[_0x6ec6('0x45')][_0x6ec6('0x9b')]||!utils[_0x6ec6('0xa0')](_0x337721[_0x6ec6('0x45')]['channel'])){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))]('Unknown\x20channel');}return _0x4cc7c8[_0x6ec6('0xae')+_[_0x6ec6('0xa3')](_0x337721[_0x6ec6('0x45')][_0x6ec6('0x9b')]['toLowerCase']())+_0x6ec6('0xaf')](_0x337721['query'][_0x6ec6('0xa4')]);}})[_0x6ec6('0x15')](function(_0x13e451){if(_[_0x6ec6('0xb0')](_0x337721[_0x6ec6('0x45')][_0x6ec6('0xa4')])){for(var _0x3392c7=0x0;_0x3392c7<_0x337721[_0x6ec6('0x45')][_0x6ec6('0xa4')][_0x6ec6('0x4d')];_0x3392c7+=0x1){_0x2801dc={'UserId':Number(_0x337721[_0x6ec6('0x5f')]['id'])};_0x2801dc[_[_0x6ec6('0xa3')](_0x337721['query'][_0x6ec6('0x9b')]['toLowerCase']())+_0x6ec6('0xa7')]=Number(_0x337721[_0x6ec6('0x45')]['ids'][_0x3392c7]);socket[_0x6ec6('0x2d')](_0x6ec6('0x31')+_['capitalize'](_0x337721[_0x6ec6('0x45')][_0x6ec6('0x9b')]['toLowerCase']())+_0x6ec6('0xb1'),_0x2801dc);}}else{_0x2801dc={'UserId':Number(_0x337721[_0x6ec6('0x5f')]['id'])};_0x2801dc[_['capitalize'](_0x337721['query'][_0x6ec6('0x9b')][_0x6ec6('0xa6')]())+_0x6ec6('0xa7')]=Number(_0x337721['query']['ids']);socket[_0x6ec6('0x2d')]('user'+_[_0x6ec6('0xa3')](_0x337721['query']['channel'][_0x6ec6('0xa6')]())+'Queue:remove',_0x2801dc);}return _0x13e451;})['then'](function(){if(_0x337721[_0x6ec6('0x45')][_0x6ec6('0x9b')]===_0x6ec6('0xa9')){return db[_0x6ec6('0xac')][_0x6ec6('0x39')]({'where':{'UserId':_0x337721['params']['id'],'VoiceQueueId':_0x337721[_0x6ec6('0x45')][_0x6ec6('0xa4')]},'individualHooks':!![]})[_0x6ec6('0x15')](function(){return _0x3c6ddc;});}return _0x3c6ddc;})[_0x6ec6('0x15')](respondWithStatusCode(_0x1fa306,null))[_0x6ec6('0x20')](handleError(_0x1fa306,null));};exports[_0x6ec6('0xb2')]=function(_0x5a7d03,_0x21424a){_0x5a7d03[_0x6ec6('0x5e')][_0x6ec6('0xb3')]=_0x5a7d03[_0x6ec6('0xb4')][_0x6ec6('0xb5')];return db[_0x6ec6('0x42')][_0x6ec6('0x38')]({'where':{'id':_0x5a7d03[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x21424a,null))[_0x6ec6('0x15')](saveUpdates(_0x5a7d03[_0x6ec6('0x5e')],null))[_0x6ec6('0x15')](respondWithResult(_0x21424a,null))[_0x6ec6('0x20')](handleError(_0x21424a,null));};exports[_0x6ec6('0xb6')]=function(_0x113872,_0x25ce1f){var _0x5ab730=path[_0x6ec6('0xb7')](config[_0x6ec6('0xb8')],_0x6ec6('0xb9'));return db[_0x6ec6('0x42')][_0x6ec6('0x38')]({'where':{'id':_0x113872[_0x6ec6('0x5f')]['id']},'attributes':['id',_0x6ec6('0xb3')],'raw':!![]})['then'](handleEntityNotFound(_0x25ce1f,null))[_0x6ec6('0x15')](function(_0x3a0a34){if(_0x3a0a34){if(_[_0x6ec6('0x66')](_0x3a0a34[_0x6ec6('0xb3')])){return _0x25ce1f['download'](_0x5ab730);}else{if(!fs[_0x6ec6('0xba')](path['join'](config[_0x6ec6('0xb8')],_0x6ec6('0xbb'),_0x3a0a34[_0x6ec6('0xb3')]))){return _0x25ce1f[_0x6ec6('0xbc')](_0x5ab730);}return _0x25ce1f['download'](path[_0x6ec6('0xb7')](config[_0x6ec6('0xb8')],'server/files/images/',_0x3a0a34[_0x6ec6('0xb3')]));}}})[_0x6ec6('0x20')](handleError(_0x25ce1f,null));};exports['getOpenTabs']=function(_0xdfcce1,_0x438015){return db[_0x6ec6('0x42')][_0x6ec6('0x38')]({'where':{'id':_0xdfcce1['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x438015,null))[_0x6ec6('0x15')](function(_0x5d2573){var _0x730486=[];values=_0x5d2573[_0x6ec6('0x4e')];_0x730486['push'](get_open_tabs('chat',_0x5d2573['dataValues']));_0x730486[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x4f'),_0x5d2573[_0x6ec6('0x4e')]));_0x730486[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x52'),_0x5d2573[_0x6ec6('0x4e')]));_0x730486[_0x6ec6('0x4a')](get_open_tabs('whatsapp',_0x5d2573['dataValues']));_0x730486[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x50'),_0x5d2573['dataValues']));_0x730486[_0x6ec6('0x4a')](get_open_tabs(_0x6ec6('0x51'),_0x5d2573['dataValues']));return Promise['all'](_0x730486);})[_0x6ec6('0x15')](function(_0x45c3e8){if(_0x45c3e8){var _0x1789d6=_[_0x6ec6('0x35')](values[_0x6ec6('0xbd')],function(_0x2017d6){return{'channel':_0x6ec6('0xbe'),'id':_0x2017d6['id'],'createdAt':_0x2017d6[_0x6ec6('0xbf')]};});var _0x3397b9=_['map'](values[_0x6ec6('0xc0')],function(_0x49457e){return{'channel':_0x6ec6('0xc1'),'id':_0x49457e['id'],'createdAt':_0x49457e['createdAt']};});var _0x534a82=_[_0x6ec6('0x35')](values[_0x6ec6('0xc2')],function(_0x56badf){return{'channel':_0x6ec6('0xc3'),'id':_0x56badf['id'],'createdAt':_0x56badf['createdAt']};});var _0x332bf3=_[_0x6ec6('0x35')](values['MailOpenTabs'],function(_0x41c1e2){return{'channel':_0x6ec6('0xc4'),'id':_0x41c1e2['id'],'createdAt':_0x41c1e2[_0x6ec6('0xbf')]};});var _0xa66f4b=_[_0x6ec6('0x35')](values[_0x6ec6('0xc5')],function(_0x523071){return{'channel':'SMS','id':_0x523071['id'],'createdAt':_0x523071[_0x6ec6('0xbf')]};});var _0x58771a=_['map'](values['WhatsappOpenTabs'],function(_0xc517d8){return{'channel':'WHATSAPP','id':_0xc517d8['id'],'createdAt':_0xc517d8[_0x6ec6('0xbf')]};});var _0x2fdbc5=_[_0x6ec6('0xc6')](_0x1789d6,_0x3397b9,_0x534a82,_0x332bf3,_0xa66f4b,_0x58771a);var _0xd5e835={'count':_0x2fdbc5['length'],'rows':_0x2fdbc5};return _0xd5e835;}else return null;})[_0x6ec6('0x15')](respondWithResult(_0x438015,null))['catch'](handleError(_0x438015,null));};exports[_0x6ec6('0xc7')]=function(_0x1be352,_0x3cbe13){var _0x5ad36b={};return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0x1be352[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](function(_0x1aac27){if(!_0x1aac27){throw new APINotFoundError(util[_0x6ec6('0xab')](_0x6ec6('0xc8'),_0x1be352[_0x6ec6('0x5f')]['id']));}return contacts['describe']();})[_0x6ec6('0x15')](function(_0x101ccc){_0x1be352[_0x6ec6('0x45')]['User']=_0x1be352[_0x6ec6('0x5f')]['id'];_0x5ad36b=qs[_0x6ec6('0x41')](_0x101ccc,_0x1be352);if(_0x1be352['query']['hasOwnProperty']('includeAll')){_0x5ad36b[_0x6ec6('0x44')]=[{'model':db[_0x6ec6('0xc9')],'as':_0x6ec6('0xca'),'required':![]},{'model':db[_0x6ec6('0xcb')],'as':_0x6ec6('0xcc'),'attributes':['id',_0x6ec6('0x3b'),_0x6ec6('0xcd')],'where':_0x1be352[_0x6ec6('0x45')][_0x6ec6('0xce')]?{'id':_0x1be352[_0x6ec6('0x45')]['tag']}:undefined,'required':_0x1be352[_0x6ec6('0x45')][_0x6ec6('0xce')]?!![]:![]}];}return contacts[_0x6ec6('0xcf')](_0x1be352[_0x6ec6('0x45')],_0x1be352[_0x6ec6('0x31')],_0x5ad36b,_0x101ccc);})[_0x6ec6('0x15')](respondWithFilteredResult(_0x3cbe13,_0x5ad36b))[_0x6ec6('0x20')](APIHandleError(_0x3cbe13));};exports[_0x6ec6('0xd0')]=function(_0x3db4b2,_0x3bf843){var _0x2775bd;var _0x12b97c={};var _0x1fe23a;return db['User'][_0x6ec6('0x94')]({'where':{'id':_0x3db4b2[_0x6ec6('0x5f')]['id']},'attributes':['id',_0x6ec6('0x3b'),_0x6ec6('0x2c')]})[_0x6ec6('0x15')](handleEntityNotFound(_0x3bf843,null))['then'](function(_0x648ca4){if(!utils[_0x6ec6('0xa0')](_0x3db4b2['query'][_0x6ec6('0x9b')])){throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))](_0x6ec6('0xa1'));}_0x2775bd=_0x648ca4;var _0x46c94e={};_0x46c94e['model']=_[_0x6ec6('0x58')](db[_[_0x6ec6('0xa3')](_0x3db4b2[_0x6ec6('0x45')][_0x6ec6('0x9b')])+_0x6ec6('0xd1')][_0x6ec6('0xd2')]);_0x46c94e['query']=_[_0x6ec6('0x58')](_0x3db4b2[_0x6ec6('0x45')]);_0x46c94e['filters']=_[_0x6ec6('0x5a')](_0x46c94e[_0x6ec6('0x55')],_0x46c94e[_0x6ec6('0x45')]);_0x12b97c[_0x6ec6('0x49')]=_[_0x6ec6('0x5a')](_0x46c94e[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x3db4b2[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x12b97c[_0x6ec6('0x49')]=_0x12b97c[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x12b97c[_0x6ec6('0x49')]:_0x46c94e[_0x6ec6('0x55')];_0x12b97c[_0x6ec6('0xd3')]=qs[_0x6ec6('0xd4')](_0x3db4b2[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x12b97c[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x3db4b2[_0x6ec6('0x45')],_0x46c94e[_0x6ec6('0x59')]));if(_0x3db4b2[_0x6ec6('0x45')]['filter']){_0x12b97c[_0x6ec6('0xd5')]=_['merge'](_0x12b97c['where'],{'$or':_[_0x6ec6('0x35')](_0x12b97c[_0x6ec6('0x49')],function(_0x285811){var _0xda32d={};_0xda32d[_0x285811]={'$like':'%'+_0x3db4b2[_0x6ec6('0x45')]['filter']+'%'};return _0xda32d;})});}_0x12b97c=_[_0x6ec6('0x5c')]({},_0x12b97c,_0x3db4b2[_0x6ec6('0x5d')]);switch(_0x2775bd[_0x6ec6('0x2c')]){case _0x6ec6('0x30'):return db[_[_0x6ec6('0xa3')](_0x3db4b2[_0x6ec6('0x45')]['channel'])+_0x6ec6('0xd1')][_0x6ec6('0xcf')](_0x12b97c);case _0x6ec6('0x31'):case'agent':return _0x2775bd['get'+_[_0x6ec6('0xa3')](_0x3db4b2[_0x6ec6('0x45')][_0x6ec6('0x9b')])+_0x6ec6('0xaf')](_0x12b97c);default:throw new db[(_0x6ec6('0x8d'))]['ValidationError'](_0x6ec6('0xd7'));}})[_0x6ec6('0x15')](function(_0x189e59){_0x1fe23a=_0x189e59[_0x6ec6('0x4d')];if(!_0x3db4b2['query'][_0x6ec6('0xd8')](_0x6ec6('0xd9'))){_0x12b97c[_0x6ec6('0x27')]=qs['limit'](_0x3db4b2[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x12b97c[_0x6ec6('0x25')]=qs[_0x6ec6('0x25')](_0x3db4b2['query'][_0x6ec6('0x25')]);}switch(_0x2775bd['role']){case _0x6ec6('0x30'):return db[_[_0x6ec6('0xa3')](_0x3db4b2[_0x6ec6('0x45')][_0x6ec6('0x9b')])+_0x6ec6('0xd1')][_0x6ec6('0xcf')](_0x12b97c);case _0x6ec6('0x31'):case'agent':return _0x2775bd['get'+_[_0x6ec6('0xa3')](_0x3db4b2[_0x6ec6('0x45')][_0x6ec6('0x9b')])+'Queues'](_0x12b97c);}})[_0x6ec6('0x15')](function(_0x282d98){return{'count':_0x1fe23a,'rows':_0x282d98};})[_0x6ec6('0x15')](respondWithResult(_0x3bf843,null))[_0x6ec6('0x20')](handleError(_0x3bf843,null));};exports[_0x6ec6('0xda')]=function(_0x253304,_0x5eb2a0){var _0x2459e0={};var _0x50d50a={};var _0x370334;var _0x149b83;return db[_0x6ec6('0x42')]['findOne']({'where':{'id':_0x253304[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x5eb2a0,null))[_0x6ec6('0x15')](function(_0x4ccffb){if(_0x4ccffb){_0x370334=_0x4ccffb;_0x50d50a[_0x6ec6('0x55')]=_['keys'](db['UserVoiceQueueRt'][_0x6ec6('0xd2')]);_0x50d50a[_0x6ec6('0x45')]=_[_0x6ec6('0x58')](_0x253304[_0x6ec6('0x45')]);_0x50d50a['filters']=_[_0x6ec6('0x5a')](_0x50d50a[_0x6ec6('0x55')],_0x50d50a['query']);_0x2459e0[_0x6ec6('0x49')]=_['intersection'](_0x50d50a[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x253304[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x2459e0[_0x6ec6('0x49')]=_0x2459e0[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x2459e0[_0x6ec6('0x49')]:_0x50d50a[_0x6ec6('0x55')];_0x2459e0[_0x6ec6('0xd3')]=qs[_0x6ec6('0xd4')](_0x253304[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x2459e0[_0x6ec6('0xd5')]=qs['filters'](_[_0x6ec6('0xd6')](_0x253304[_0x6ec6('0x45')],_0x50d50a[_0x6ec6('0x59')]));if(_0x253304[_0x6ec6('0x45')][_0x6ec6('0x34')]){_0x2459e0['where']=_[_0x6ec6('0x5c')](_0x2459e0[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x2459e0['attributes'],function(_0x55d877){var _0xbf35a9={};_0xbf35a9[_0x55d877]={'$like':'%'+_0x253304['query'][_0x6ec6('0x34')]+'%'};return _0xbf35a9;})});}_0x2459e0=_['merge']({},_0x2459e0,_0x253304[_0x6ec6('0x5d')]);return _0x370334[_0x6ec6('0xda')](_0x2459e0);}})[_0x6ec6('0x15')](function(_0x4eb326){if(_0x4eb326){_0x149b83=_0x4eb326[_0x6ec6('0x4d')];if(!_0x253304[_0x6ec6('0x45')][_0x6ec6('0xd8')]('nolimit')){_0x2459e0[_0x6ec6('0x27')]=qs[_0x6ec6('0x27')](_0x253304[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x2459e0['offset']=qs[_0x6ec6('0x25')](_0x253304[_0x6ec6('0x45')][_0x6ec6('0x25')]);}return _0x370334[_0x6ec6('0xda')](_0x2459e0);}})[_0x6ec6('0x15')](function(_0xc1c81c){if(_0xc1c81c){return _0xc1c81c?{'count':_0x149b83,'rows':_0xc1c81c}:null;}})['then'](respondWithResult(_0x5eb2a0,null))[_0x6ec6('0x20')](handleError(_0x5eb2a0,null));};exports[_0x6ec6('0xdb')]=function(_0x1f5212,_0x5ee55a){var _0x5f44d8={};var _0x23e4bf={};var _0x188464;var _0x3f186f;return db[_0x6ec6('0x42')]['findOne']({'where':{'id':_0x1f5212[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x5ee55a,null))[_0x6ec6('0x15')](function(_0x2211aa){if(_0x2211aa){_0x188464=_0x2211aa;_0x23e4bf[_0x6ec6('0x55')]=_[_0x6ec6('0x58')](db[_0x6ec6('0xdc')][_0x6ec6('0xd2')]);_0x23e4bf[_0x6ec6('0x45')]=_['keys'](_0x1f5212[_0x6ec6('0x45')]);_0x23e4bf[_0x6ec6('0x59')]=_[_0x6ec6('0x5a')](_0x23e4bf['model'],_0x23e4bf[_0x6ec6('0x45')]);_0x5f44d8[_0x6ec6('0x49')]=_['intersection'](_0x23e4bf[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x1f5212[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x5f44d8[_0x6ec6('0x49')]=_0x5f44d8[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x5f44d8[_0x6ec6('0x49')]:_0x23e4bf['model'];_0x5f44d8[_0x6ec6('0xd3')]=qs[_0x6ec6('0xd4')](_0x1f5212[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x5f44d8['where']=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x1f5212['query'],_0x23e4bf[_0x6ec6('0x59')]));if(_0x1f5212[_0x6ec6('0x45')]['filter']){_0x5f44d8[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x5f44d8[_0x6ec6('0xd5')],{'$or':_['map'](_0x5f44d8['attributes'],function(_0x37ddeb){var _0x9084c={};_0x9084c[_0x37ddeb]={'$like':'%'+_0x1f5212['query']['filter']+'%'};return _0x9084c;})});}_0x5f44d8=_[_0x6ec6('0x5c')]({},_0x5f44d8,_0x1f5212['options']);return _0x188464[_0x6ec6('0xdb')](_0x5f44d8);}})[_0x6ec6('0x15')](function(_0xfd0968){if(_0xfd0968){_0x3f186f=_0xfd0968['length'];if(!_0x1f5212[_0x6ec6('0x45')]['hasOwnProperty'](_0x6ec6('0xd9'))){_0x5f44d8['limit']=qs[_0x6ec6('0x27')](_0x1f5212[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x5f44d8[_0x6ec6('0x25')]=qs[_0x6ec6('0x25')](_0x1f5212['query'][_0x6ec6('0x25')]);}return _0x188464[_0x6ec6('0xdb')](_0x5f44d8);}})['then'](function(_0x4aead9){if(_0x4aead9){return _0x4aead9?{'count':_0x3f186f,'rows':_0x4aead9}:null;}})[_0x6ec6('0x15')](respondWithResult(_0x5ee55a,null))['catch'](handleError(_0x5ee55a,null));};exports[_0x6ec6('0xdd')]=function(_0x1c6d2c,_0x42f1ab){var _0x455b3c={'raw':!![],'where':{}};var _0x4cb75d={};var _0x26491={'count':0x0,'rows':[]};return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0x1c6d2c[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x42f1ab,null))[_0x6ec6('0x15')](function(_0x5458ac){if(_0x5458ac){_0x4cb75d['model']=_[_0x6ec6('0x58')](db['VoiceRecording'][_0x6ec6('0xd2')]);_0x4cb75d[_0x6ec6('0x45')]=_[_0x6ec6('0x58')](_0x1c6d2c['query']);_0x4cb75d[_0x6ec6('0x59')]=_['intersection'](_0x4cb75d[_0x6ec6('0x55')],_0x4cb75d['query']);_0x455b3c[_0x6ec6('0x49')]=_[_0x6ec6('0x5a')](_0x4cb75d['model'],qs['fields'](_0x1c6d2c[_0x6ec6('0x45')]['fields']));_0x455b3c[_0x6ec6('0x49')]=_0x455b3c[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x455b3c['attributes']:_0x4cb75d[_0x6ec6('0x55')];if(!_0x1c6d2c[_0x6ec6('0x45')]['hasOwnProperty'](_0x6ec6('0xd9'))){_0x455b3c['limit']=qs[_0x6ec6('0x27')](_0x1c6d2c[_0x6ec6('0x45')]['limit']);_0x455b3c[_0x6ec6('0x25')]=qs[_0x6ec6('0x25')](_0x1c6d2c['query'][_0x6ec6('0x25')]);}_0x455b3c['order']=qs[_0x6ec6('0xd4')](_0x1c6d2c['query']['sort']);_0x455b3c[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_['pick'](_0x1c6d2c[_0x6ec6('0x45')],_0x4cb75d['filters']));_0x455b3c[_0x6ec6('0xd5')][_0x6ec6('0xde')]=_0x5458ac['id'];if(_0x1c6d2c['query'][_0x6ec6('0x34')]){_0x455b3c[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x455b3c[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x455b3c[_0x6ec6('0x49')],function(_0x38c7f3){var _0x13e15f={};_0x13e15f[_0x38c7f3]={'$like':'%'+_0x1c6d2c['query'][_0x6ec6('0x34')]+'%'};return _0x13e15f;})});}_0x455b3c=_[_0x6ec6('0x5c')]({},_0x455b3c,_0x1c6d2c[_0x6ec6('0x5d')]);return db[_0x6ec6('0xdf')]['count']({'where':_0x455b3c[_0x6ec6('0xd5')]})[_0x6ec6('0x15')](function(_0x4aa9b6){_0x26491[_0x6ec6('0x28')]=_0x4aa9b6;if(_0x1c6d2c['query'][_0x6ec6('0x43')]){_0x455b3c['include']=[{'all':!![]}];}return db[_0x6ec6('0xdf')][_0x6ec6('0xcf')](_0x455b3c);})[_0x6ec6('0x15')](function(_0x510598){_0x26491[_0x6ec6('0x4b')]=_0x510598;return _0x26491;});}})[_0x6ec6('0x15')](respondWithFilteredResult(_0x42f1ab,_0x455b3c))[_0x6ec6('0x20')](handleError(_0x42f1ab,null));};exports[_0x6ec6('0xe0')]=function(_0x3b87b3,_0x20db5f){var _0x4b6a4c={'raw':!![],'where':{}};var _0x50cf3d={};var _0x5b4f55={'count':0x0,'rows':[]};return db[_0x6ec6('0x42')]['findOne']({'where':{'id':_0x3b87b3[_0x6ec6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x20db5f,null))['then'](function(_0x465745){if(_0x465745){_0x50cf3d[_0x6ec6('0x55')]=_['keys'](db[_0x6ec6('0xe1')][_0x6ec6('0xd2')]);_0x50cf3d[_0x6ec6('0x45')]=_[_0x6ec6('0x58')](_0x3b87b3[_0x6ec6('0x45')]);_0x50cf3d[_0x6ec6('0x59')]=_[_0x6ec6('0x5a')](_0x50cf3d[_0x6ec6('0x55')],_0x50cf3d[_0x6ec6('0x45')]);_0x4b6a4c[_0x6ec6('0x49')]=_['intersection'](_0x50cf3d['model'],qs['fields'](_0x3b87b3[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x4b6a4c['attributes']=_0x4b6a4c[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x4b6a4c[_0x6ec6('0x49')]:_0x50cf3d[_0x6ec6('0x55')];if(!_0x3b87b3[_0x6ec6('0x45')]['hasOwnProperty'](_0x6ec6('0xd9'))){_0x4b6a4c['limit']=qs[_0x6ec6('0x27')](_0x3b87b3[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x4b6a4c[_0x6ec6('0x25')]=qs['offset'](_0x3b87b3[_0x6ec6('0x45')][_0x6ec6('0x25')]);}_0x4b6a4c['order']=qs['sort'](_0x3b87b3['query'][_0x6ec6('0xd4')]);_0x4b6a4c[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x3b87b3[_0x6ec6('0x45')],_0x50cf3d[_0x6ec6('0x59')]));_0x4b6a4c[_0x6ec6('0xd5')][_0x6ec6('0xde')]=_0x465745['id'];if(_0x3b87b3['query'][_0x6ec6('0x34')]){_0x4b6a4c[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x4b6a4c[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x4b6a4c[_0x6ec6('0x49')],function(_0x4d6a56){var _0x459819={};_0x459819[_0x4d6a56]={'$like':'%'+_0x3b87b3['query'][_0x6ec6('0x34')]+'%'};return _0x459819;})});}_0x4b6a4c=_[_0x6ec6('0x5c')]({},_0x4b6a4c,_0x3b87b3[_0x6ec6('0x5d')]);return db[_0x6ec6('0xe1')][_0x6ec6('0x28')]({'where':_0x4b6a4c[_0x6ec6('0xd5')]})[_0x6ec6('0x15')](function(_0x5819de){_0x5b4f55[_0x6ec6('0x28')]=_0x5819de;if(_0x3b87b3[_0x6ec6('0x45')][_0x6ec6('0x43')]){_0x4b6a4c[_0x6ec6('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0x6ec6('0xcf')](_0x4b6a4c);})[_0x6ec6('0x15')](function(_0x12687d){_0x5b4f55[_0x6ec6('0x4b')]=_0x12687d;return _0x5b4f55;});}})[_0x6ec6('0x15')](respondWithFilteredResult(_0x20db5f,_0x4b6a4c))[_0x6ec6('0x20')](handleError(_0x20db5f,null));};exports['getChatInteractions']=function(_0x2b0adb,_0x5e9cfd){var _0x46e343={};var _0x443e23={};var _0x41d4f0;var _0x5a714d;return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0x2b0adb['params']['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x5e9cfd,null))[_0x6ec6('0x15')](function(_0x208ce1){if(_0x208ce1){_0x41d4f0=_0x208ce1;_0x443e23[_0x6ec6('0x55')]=_['keys'](db[_0x6ec6('0xe2')][_0x6ec6('0xd2')]);_0x443e23[_0x6ec6('0x45')]=_['keys'](_0x2b0adb[_0x6ec6('0x45')]);_0x443e23['filters']=_[_0x6ec6('0x5a')](_0x443e23[_0x6ec6('0x55')],_0x443e23[_0x6ec6('0x45')]);_0x46e343['attributes']=_[_0x6ec6('0x5a')](_0x443e23[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x2b0adb[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x46e343[_0x6ec6('0x49')]=_0x46e343[_0x6ec6('0x49')]['length']?_0x46e343[_0x6ec6('0x49')]:_0x443e23[_0x6ec6('0x55')];_0x46e343['order']=qs['sort'](_0x2b0adb[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x46e343[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x2b0adb[_0x6ec6('0x45')],_0x443e23[_0x6ec6('0x59')]));if(_0x2b0adb['query'][_0x6ec6('0x34')]){_0x46e343['where']=_[_0x6ec6('0x5c')](_0x46e343[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x46e343[_0x6ec6('0x49')],function(_0x6fab98){var _0x11e566={};_0x11e566[_0x6fab98]={'$like':'%'+_0x2b0adb[_0x6ec6('0x45')][_0x6ec6('0x34')]+'%'};return _0x11e566;})});}_0x46e343=_['merge']({},_0x46e343,_0x2b0adb[_0x6ec6('0x5d')]);return _0x41d4f0['getChatInteractions'](_0x46e343);}})['then'](function(_0x3587ac){if(_0x3587ac){_0x5a714d=_0x3587ac[_0x6ec6('0x4d')];if(!_0x2b0adb[_0x6ec6('0x45')][_0x6ec6('0xd8')](_0x6ec6('0xd9'))){_0x46e343[_0x6ec6('0x27')]=qs[_0x6ec6('0x27')](_0x2b0adb[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x46e343[_0x6ec6('0x25')]=qs['offset'](_0x2b0adb[_0x6ec6('0x45')]['offset']);}return _0x41d4f0[_0x6ec6('0xe3')](_0x46e343);}})[_0x6ec6('0x15')](function(_0x562343){if(_0x562343){return _0x562343?{'count':_0x5a714d,'rows':_0x562343}:null;}})['then'](respondWithResult(_0x5e9cfd,null))[_0x6ec6('0x20')](handleError(_0x5e9cfd,null));};exports[_0x6ec6('0xe4')]=function(_0x3cf6e8,_0x230599){var _0x43d8b5={};var _0x2fcae2={};var _0x38215e;var _0x26aab2;return db['User'][_0x6ec6('0x94')]({'where':{'id':_0x3cf6e8['params']['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x230599,null))[_0x6ec6('0x15')](function(_0x44dbbe){if(_0x44dbbe){_0x38215e=_0x44dbbe;_0x2fcae2['model']=_[_0x6ec6('0x58')](db[_0x6ec6('0xe5')][_0x6ec6('0xd2')]);_0x2fcae2[_0x6ec6('0x45')]=_[_0x6ec6('0x58')](_0x3cf6e8[_0x6ec6('0x45')]);_0x2fcae2['filters']=_['intersection'](_0x2fcae2[_0x6ec6('0x55')],_0x2fcae2[_0x6ec6('0x45')]);_0x43d8b5[_0x6ec6('0x49')]=_[_0x6ec6('0x5a')](_0x2fcae2[_0x6ec6('0x55')],qs['fields'](_0x3cf6e8[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x43d8b5['attributes']=_0x43d8b5[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x43d8b5[_0x6ec6('0x49')]:_0x2fcae2[_0x6ec6('0x55')];_0x43d8b5['order']=qs[_0x6ec6('0xd4')](_0x3cf6e8[_0x6ec6('0x45')]['sort']);_0x43d8b5[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x3cf6e8[_0x6ec6('0x45')],_0x2fcae2[_0x6ec6('0x59')]));if(_0x3cf6e8[_0x6ec6('0x45')][_0x6ec6('0x34')]){_0x43d8b5[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x43d8b5[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x43d8b5[_0x6ec6('0x49')],function(_0x541a4d){var _0x5b05c4={};_0x5b05c4[_0x541a4d]={'$like':'%'+_0x3cf6e8[_0x6ec6('0x45')][_0x6ec6('0x34')]+'%'};return _0x5b05c4;})});}_0x43d8b5=_[_0x6ec6('0x5c')]({},_0x43d8b5,_0x3cf6e8[_0x6ec6('0x5d')]);return _0x38215e[_0x6ec6('0xe4')](_0x43d8b5);}})[_0x6ec6('0x15')](function(_0xfd4a4e){if(_0xfd4a4e){_0x26aab2=_0xfd4a4e[_0x6ec6('0x4d')];if(!_0x3cf6e8[_0x6ec6('0x45')][_0x6ec6('0xd8')](_0x6ec6('0xd9'))){_0x43d8b5['limit']=qs[_0x6ec6('0x27')](_0x3cf6e8['query'][_0x6ec6('0x27')]);_0x43d8b5[_0x6ec6('0x25')]=qs[_0x6ec6('0x25')](_0x3cf6e8['query'][_0x6ec6('0x25')]);}return _0x38215e['getOpenchannelInteractions'](_0x43d8b5);}})['then'](function(_0x16f91e){if(_0x16f91e){return _0x16f91e?{'count':_0x26aab2,'rows':_0x16f91e}:null;}})[_0x6ec6('0x15')](respondWithResult(_0x230599,null))[_0x6ec6('0x20')](handleError(_0x230599,null));};exports['getMailInteractions']=function(_0xbc56cc,_0x180a98){var _0x4e84b1={'raw':!![],'where':{}};var _0x598b5d={};var _0x575ef1={'count':0x0,'rows':[]};return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0xbc56cc['params']['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x180a98,null))[_0x6ec6('0x15')](function(_0x440a0f){if(_0x440a0f){_0x598b5d[_0x6ec6('0x55')]=_[_0x6ec6('0x58')](db[_0x6ec6('0xe6')][_0x6ec6('0xd2')]);_0x598b5d[_0x6ec6('0x45')]=_[_0x6ec6('0x58')](_0xbc56cc[_0x6ec6('0x45')]);_0x598b5d[_0x6ec6('0x59')]=_[_0x6ec6('0x5a')](_0x598b5d[_0x6ec6('0x55')],_0x598b5d[_0x6ec6('0x45')]);_0x4e84b1[_0x6ec6('0x49')]=_['intersection'](_0x598b5d[_0x6ec6('0x55')],qs['fields'](_0xbc56cc['query'][_0x6ec6('0x5b')]));_0x4e84b1[_0x6ec6('0x49')]=_0x4e84b1[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x4e84b1[_0x6ec6('0x49')]:_0x598b5d[_0x6ec6('0x55')];if(!_0xbc56cc[_0x6ec6('0x45')]['hasOwnProperty'](_0x6ec6('0xd9'))){_0x4e84b1[_0x6ec6('0x27')]=qs[_0x6ec6('0x27')](_0xbc56cc[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x4e84b1['offset']=qs[_0x6ec6('0x25')](_0xbc56cc[_0x6ec6('0x45')][_0x6ec6('0x25')]);}_0x4e84b1[_0x6ec6('0xd3')]=qs['sort'](_0xbc56cc[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x4e84b1[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0xbc56cc['query'],_0x598b5d['filters']));_0x4e84b1[_0x6ec6('0xd5')][_0x6ec6('0xde')]=_0x440a0f['id'];if(_0xbc56cc['query'][_0x6ec6('0x34')]){_0x4e84b1['where']=_[_0x6ec6('0x5c')](_0x4e84b1[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x4e84b1['attributes'],function(_0x3214f8){var _0x1b0c6a={};_0x1b0c6a[_0x3214f8]={'$like':'%'+_0xbc56cc['query']['filter']+'%'};return _0x1b0c6a;})});}_0x4e84b1=_['merge']({},_0x4e84b1,_0xbc56cc[_0x6ec6('0x5d')]);return db[_0x6ec6('0xe6')][_0x6ec6('0x28')]({'where':_0x4e84b1[_0x6ec6('0xd5')]})[_0x6ec6('0x15')](function(_0x429ced){_0x575ef1[_0x6ec6('0x28')]=_0x429ced;if(_0xbc56cc['query']['includeAll']){_0x4e84b1[_0x6ec6('0x44')]=[{'all':!![]}];}return db[_0x6ec6('0xe6')][_0x6ec6('0xcf')](_0x4e84b1);})[_0x6ec6('0x15')](function(_0x3c3a2a){_0x575ef1[_0x6ec6('0x4b')]=_0x3c3a2a;return _0x575ef1;});}})[_0x6ec6('0x15')](respondWithFilteredResult(_0x180a98,_0x4e84b1))[_0x6ec6('0x20')](handleError(_0x180a98,null));};exports[_0x6ec6('0xe7')]=function(_0x5505c9,_0x1947ed){var _0x17bc70={};var _0x4ad89e={};var _0x2f35ce;var _0x132a9b;return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0x5505c9['params']['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x1947ed,null))[_0x6ec6('0x15')](function(_0x35fa61){if(_0x35fa61){_0x2f35ce=_0x35fa61;_0x4ad89e[_0x6ec6('0x55')]=_[_0x6ec6('0x58')](db[_0x6ec6('0xe8')]['rawAttributes']);_0x4ad89e['query']=_[_0x6ec6('0x58')](_0x5505c9[_0x6ec6('0x45')]);_0x4ad89e['filters']=_['intersection'](_0x4ad89e['model'],_0x4ad89e[_0x6ec6('0x45')]);_0x17bc70[_0x6ec6('0x49')]=_['intersection'](_0x4ad89e[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x5505c9[_0x6ec6('0x45')]['fields']));_0x17bc70[_0x6ec6('0x49')]=_0x17bc70[_0x6ec6('0x49')]['length']?_0x17bc70[_0x6ec6('0x49')]:_0x4ad89e[_0x6ec6('0x55')];_0x17bc70[_0x6ec6('0xd3')]=qs[_0x6ec6('0xd4')](_0x5505c9[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x17bc70['where']=qs[_0x6ec6('0x59')](_['pick'](_0x5505c9[_0x6ec6('0x45')],_0x4ad89e[_0x6ec6('0x59')]));if(_0x5505c9['query']['filter']){_0x17bc70[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x17bc70[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x17bc70[_0x6ec6('0x49')],function(_0x4bb69e){var _0x50836b={};_0x50836b[_0x4bb69e]={'$like':'%'+_0x5505c9[_0x6ec6('0x45')][_0x6ec6('0x34')]+'%'};return _0x50836b;})});}_0x17bc70=_[_0x6ec6('0x5c')]({},_0x17bc70,_0x5505c9[_0x6ec6('0x5d')]);return _0x2f35ce[_0x6ec6('0xe7')](_0x17bc70);}})[_0x6ec6('0x15')](function(_0x82de23){if(_0x82de23){_0x132a9b=_0x82de23[_0x6ec6('0x4d')];if(!_0x5505c9[_0x6ec6('0x45')][_0x6ec6('0xd8')]('nolimit')){_0x17bc70[_0x6ec6('0x27')]=qs['limit'](_0x5505c9[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x17bc70['offset']=qs[_0x6ec6('0x25')](_0x5505c9['query'][_0x6ec6('0x25')]);}return _0x2f35ce[_0x6ec6('0xe7')](_0x17bc70);}})[_0x6ec6('0x15')](function(_0x38cb14){if(_0x38cb14){return _0x38cb14?{'count':_0x132a9b,'rows':_0x38cb14}:null;}})[_0x6ec6('0x15')](respondWithResult(_0x1947ed,null))['catch'](handleError(_0x1947ed,null));};exports[_0x6ec6('0xe9')]=function(_0x4e11a0,_0x128b6e){var _0x5ce512={};var _0x493d82={};var _0x589867;var _0x1e46e1;return db[_0x6ec6('0x42')]['findOne']({'where':{'id':_0x4e11a0[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x128b6e,null))[_0x6ec6('0x15')](function(_0x522220){if(_0x522220){_0x589867=_0x522220;_0x493d82[_0x6ec6('0x55')]=_[_0x6ec6('0x58')](db[_0x6ec6('0xea')]['rawAttributes']);_0x493d82['query']=_[_0x6ec6('0x58')](_0x4e11a0[_0x6ec6('0x45')]);_0x493d82['filters']=_[_0x6ec6('0x5a')](_0x493d82['model'],_0x493d82[_0x6ec6('0x45')]);_0x5ce512['attributes']=_[_0x6ec6('0x5a')](_0x493d82[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x4e11a0[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x5ce512[_0x6ec6('0x49')]=_0x5ce512['attributes']['length']?_0x5ce512[_0x6ec6('0x49')]:_0x493d82[_0x6ec6('0x55')];_0x5ce512[_0x6ec6('0xd3')]=qs[_0x6ec6('0xd4')](_0x4e11a0[_0x6ec6('0x45')]['sort']);_0x5ce512['where']=qs['filters'](_[_0x6ec6('0xd6')](_0x4e11a0[_0x6ec6('0x45')],_0x493d82[_0x6ec6('0x59')]));if(_0x4e11a0[_0x6ec6('0x45')][_0x6ec6('0x34')]){_0x5ce512[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x5ce512['where'],{'$or':_[_0x6ec6('0x35')](_0x5ce512['attributes'],function(_0x1d7628){var _0x5b5ffb={};_0x5b5ffb[_0x1d7628]={'$like':'%'+_0x4e11a0['query'][_0x6ec6('0x34')]+'%'};return _0x5b5ffb;})});}_0x5ce512=_[_0x6ec6('0x5c')]({},_0x5ce512,_0x4e11a0[_0x6ec6('0x5d')]);return _0x589867['getFaxInteractions'](_0x5ce512);}})[_0x6ec6('0x15')](function(_0x5d191c){if(_0x5d191c){_0x1e46e1=_0x5d191c[_0x6ec6('0x4d')];if(!_0x4e11a0[_0x6ec6('0x45')][_0x6ec6('0xd8')](_0x6ec6('0xd9'))){_0x5ce512[_0x6ec6('0x27')]=qs[_0x6ec6('0x27')](_0x4e11a0[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x5ce512[_0x6ec6('0x25')]=qs[_0x6ec6('0x25')](_0x4e11a0[_0x6ec6('0x45')]['offset']);}return _0x589867[_0x6ec6('0xe9')](_0x5ce512);}})[_0x6ec6('0x15')](function(_0x255d9b){if(_0x255d9b){return _0x255d9b?{'count':_0x1e46e1,'rows':_0x255d9b}:null;}})[_0x6ec6('0x15')](respondWithResult(_0x128b6e,null))[_0x6ec6('0x20')](handleError(_0x128b6e,null));};exports[_0x6ec6('0xeb')]=function(_0x490d98,_0x372ead){var _0x232cb2={};var _0x5b5150={};var _0x4d3563;var _0xd04ce;return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0x490d98[_0x6ec6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x372ead,null))['then'](function(_0xa96d83){if(_0xa96d83){_0x4d3563=_0xa96d83;_0x5b5150[_0x6ec6('0x55')]=_['keys'](db[_0x6ec6('0xec')][_0x6ec6('0xd2')]);_0x5b5150[_0x6ec6('0x45')]=_['keys'](_0x490d98['query']);_0x5b5150[_0x6ec6('0x59')]=_[_0x6ec6('0x5a')](_0x5b5150['model'],_0x5b5150[_0x6ec6('0x45')]);_0x232cb2[_0x6ec6('0x49')]=_[_0x6ec6('0x5a')](_0x5b5150[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x490d98[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x232cb2['attributes']=_0x232cb2[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x232cb2[_0x6ec6('0x49')]:_0x5b5150['model'];_0x232cb2[_0x6ec6('0xd3')]=qs[_0x6ec6('0xd4')](_0x490d98[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x232cb2[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x490d98[_0x6ec6('0x45')],_0x5b5150['filters']));if(_0x490d98[_0x6ec6('0x45')][_0x6ec6('0x34')]){_0x232cb2[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x232cb2['where'],{'$or':_[_0x6ec6('0x35')](_0x232cb2[_0x6ec6('0x49')],function(_0x1c31ab){var _0x20bacf={};_0x20bacf[_0x1c31ab]={'$like':'%'+_0x490d98['query'][_0x6ec6('0x34')]+'%'};return _0x20bacf;})});}_0x232cb2=_[_0x6ec6('0x5c')]({},_0x232cb2,_0x490d98[_0x6ec6('0x5d')]);return _0x4d3563[_0x6ec6('0xeb')](_0x232cb2);}})['then'](function(_0x24fe33){if(_0x24fe33){_0xd04ce=_0x24fe33[_0x6ec6('0x4d')];if(!_0x490d98[_0x6ec6('0x45')][_0x6ec6('0xd8')]('nolimit')){_0x232cb2[_0x6ec6('0x27')]=qs[_0x6ec6('0x27')](_0x490d98[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x232cb2[_0x6ec6('0x25')]=qs['offset'](_0x490d98['query']['offset']);}return _0x4d3563[_0x6ec6('0xeb')](_0x232cb2);}})['then'](function(_0x53f75f){if(_0x53f75f){return _0x53f75f?{'count':_0xd04ce,'rows':_0x53f75f}:null;}})[_0x6ec6('0x15')](respondWithResult(_0x372ead,null))[_0x6ec6('0x20')](handleError(_0x372ead,null));};exports[_0x6ec6('0xed')]=function(_0x17aca4,_0x2c5167,_0x26e925){var _0x6009c3;var _0x2cde7d;var _0xceae5d;var _0x3e8ac6=!_['isNil'](_0x17aca4[_0x6ec6('0x5f')]['id'])?_0x17aca4[_0x6ec6('0x5f')]['id']:!_[_0x6ec6('0x66')](_0x17aca4['user']['id'])?_0x17aca4[_0x6ec6('0x31')]['id']:null;return db[_0x6ec6('0x42')][_0x6ec6('0x38')]({'where':{'id':_0x3e8ac6,'role':{'$or':[_0x6ec6('0x30'),_0x6ec6('0x31'),'agent']}},'attributes':['id','name',_0x6ec6('0xee'),_0x6ec6('0xef'),_0x6ec6('0x2c'),_0x6ec6('0x63'),_0x6ec6('0x9d')]})[_0x6ec6('0x15')](function(_0x58e263){if(_0x58e263){if(_0x58e263[_0x6ec6('0x2c')]===_0x6ec6('0x70')){_0x6009c3=_0x58e263;if(_0x17aca4['body']['interface']){_0xceae5d=util['format'](_0x6ec6('0xf0'),_0x6009c3[_0x17aca4[_0x6ec6('0x5e')][_0x6ec6('0x9f')]]);}else if(_0x17aca4[_0x6ec6('0x5e')][_0x6ec6('0xf1')]){_0xceae5d=util['format'](_0x6ec6('0xf2'),_0x17aca4[_0x6ec6('0x5e')][_0x6ec6('0xf1')]);}else{_0xceae5d=util[_0x6ec6('0xab')](_0x6ec6('0xf2'),_0x6009c3[_0x6ec6('0x3b')]);}socket['to'](util[_0x6ec6('0xab')](_0x6ec6('0xf3'),_0x6009c3['name']))[_0x6ec6('0x2d')](_0x6ec6('0xf4'),{'user':{'id':_0x6009c3['id'],'name':_0x6009c3[_0x6ec6('0x3b')]},'ip':_0x17aca4[_0x6ec6('0xf5')][_0x6ec6('0xf6')]||_0x17aca4['connection'][_0x6ec6('0xf7')]||_0x17aca4[_0x6ec6('0xf8')]['remoteAddress']||_0x17aca4[_0x6ec6('0xf9')][_0x6ec6('0xf8')]['remoteAddress']});return db[_0x6ec6('0xac')]['destroy']({'where':{'membername':_0x6009c3[_0x6ec6('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0x6ec6('0x8d'))][(_0x6ec6('0x8e'))](_0x6ec6('0xfa'));}})[_0x6ec6('0x15')](function(){if(_0x6009c3){return _0x6009c3[_0x6ec6('0xfb')]({'raw':!![]});}})[_0x6ec6('0x15')](function(_0xfbd040){if(_0x6009c3){if(_0xfbd040){_0x2cde7d=_0xfbd040;if(_0x2cde7d['length']){var _0x1c7d85=_0x2cde7d['map'](function(_0x5a449c){var _0xdc8bbb={'membername':_0x6009c3[_0x6ec6('0x3b')],'UserId':_0x6009c3['id'],'queue_name':_0x5a449c[_0x6ec6('0x3b')],'VoiceQueueId':_0x5a449c['id'],'interface':_0xceae5d,'paused':_0x6009c3[_0x6ec6('0x9d')]||![],'penalty':_0x5a449c['UserVoiceQueue.penalty']||0x0};return db[_0x6ec6('0xac')][_0x6ec6('0xfc')](_0xdc8bbb);});return Promise[_0x6ec6('0x53')](_0x1c7d85);}}}})[_0x6ec6('0x15')](function(){if(_0x6009c3){return db['MemberReport'][_0x6ec6('0xcf')]({'where':{'membername':_0x6009c3[_0x6ec6('0x3b')],'exitAt':null}});}})['then'](function(_0x56eddc){if(_0x6009c3){var _0xd867b5=[];_0x56eddc[_0x6ec6('0xfd')](function(_0x7318f3){_0xd867b5[_0x6ec6('0x4a')](_0x7318f3[_0x6ec6('0x2b')]({'exitAt':moment()['format'](_0x6ec6('0xfe'))}));});return Promise[_0x6ec6('0x53')](_0xd867b5);}})['then'](function(){if(_0x6009c3){var _0x162c9f=[];var _0x1a1207=[];var _0x20ad02=utils[_0x6ec6('0xff')]();var _0x1953a2={'membername':_0x6009c3[_0x6ec6('0x3b')],'interface':_0xceae5d,'enterAt':moment()[_0x6ec6('0xab')](_0x6ec6('0xfe')),'role':_0x6009c3[_0x6ec6('0x2c')],'internal':_0x6009c3[_0x6ec6('0x63')]};_0x20ad02['forEach'](function(_0x4df5bd){_0x162c9f[_0x6ec6('0x4a')](_[_0x6ec6('0x5c')]({'channel':_0x4df5bd,'type':_0x6ec6('0x100'),'data1':_0x17aca4[_0x6ec6('0x5e')][_0x6ec6('0x101')],'data2':_0xceae5d},_0x1953a2));if(_0x6009c3[_0x6ec6('0x9d')]){_0x1a1207[_0x6ec6('0x4a')](_['merge']({'channel':_0x4df5bd,'type':_0x6ec6('0x102'),'data1':'LOGININPAUSE'},_0x1953a2));}});return db['MemberReport'][_0x6ec6('0x103')](_0x162c9f[_0x6ec6('0xc6')](_0x1a1207),{'individualHooks':!![]});}})['then'](function(){if(_0x6009c3){return _0x6009c3[_0x6ec6('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x6ec6('0xab')](_0x6ec6('0xfe')),'voicePause':_0x6009c3[_0x6ec6('0x9d')]||![],'mailPause':_0x6009c3[_0x6ec6('0x9d')]||![],'chatPause':_0x6009c3['loginInPause']||![],'faxPause':_0x6009c3[_0x6ec6('0x9d')]||![],'smsPause':_0x6009c3[_0x6ec6('0x9d')]||![],'openchannelPause':_0x6009c3[_0x6ec6('0x9d')]||![],'whatsappPause':_0x6009c3[_0x6ec6('0x9d')]||![],'pauseType':_0x6009c3['loginInPause']?_0x6ec6('0x104'):null,'interface':_0xceae5d,'lastPauseAt':moment()[_0x6ec6('0xab')](_0x6ec6('0xfe'))});}})[_0x6ec6('0x15')](function(_0x166588){if(_0x17aca4[_0x6ec6('0x105')]){return _0x26e925();}else{return Promise[_0x6ec6('0x106')](_0x166588)[_0x6ec6('0x15')](respondWithResult(_0x2c5167,null));}})[_0x6ec6('0x20')](handleError(_0x2c5167,null));};exports[_0x6ec6('0x107')]=function(_0x4cbe2f,_0x4faa3c){var _0x1636f3;return db[_0x6ec6('0x42')][_0x6ec6('0x38')]({'where':{'id':_0x4cbe2f[_0x6ec6('0x5f')]['id'],'role':_0x6ec6('0x70')},'attributes':['id','name',_0x6ec6('0x2c')]})[_0x6ec6('0x15')](handleEntityNotFound(_0x4faa3c,null))[_0x6ec6('0x15')](function(_0x519304){if(_0x519304){_0x1636f3=_0x519304;return db[_0x6ec6('0xac')]['destroy']({'where':{'membername':_0x1636f3['name']},'individualHooks':!![]});}})[_0x6ec6('0x15')](function(){return db[_0x6ec6('0x108')][_0x6ec6('0xcf')]({'where':{'membername':_0x1636f3['name'],'exitAt':null}});})[_0x6ec6('0x15')](function(_0x4afa6b){var _0x212fd3=[];_0x4afa6b[_0x6ec6('0xfd')](function(_0x44c7c5){_0x212fd3[_0x6ec6('0x4a')](_0x44c7c5[_0x6ec6('0x2b')]({'exitAt':moment()[_0x6ec6('0xab')](_0x6ec6('0xfe'))}));});return Promise[_0x6ec6('0x53')](_0x212fd3);})[_0x6ec6('0x15')](function(){return _0x1636f3[_0x6ec6('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6ec6('0x15')](respondWithResult(_0x4faa3c,null))[_0x6ec6('0x20')](handleError(_0x4faa3c,null));};exports[_0x6ec6('0x109')]=function(_0x10d8d1,_0x1df12a){var _0x1520da;return db[_0x6ec6('0xac')]['update']({'paused':0x1},{'where':{'UserId':_0x10d8d1[_0x6ec6('0x5f')]['id']},'individualHooks':!![]})[_0x6ec6('0x15')](function(){return db['User'][_0x6ec6('0x38')]({'where':{'id':_0x10d8d1[_0x6ec6('0x5f')]['id'],'role':_0x6ec6('0x70')},'attributes':['id',_0x6ec6('0x3b'),_0x6ec6('0x2c'),_0x6ec6('0x63'),_0x6ec6('0x9f'),_0x6ec6('0x9c')]});})[_0x6ec6('0x15')](handleEntityNotFound(_0x1df12a,null))[_0x6ec6('0x15')](function(_0x35ea24){if(_0x35ea24){_0x1520da=_0x35ea24;return respondWithRpcPromise(_0x6ec6('0x10a'),_0x6ec6('0x109'),{'id':_0x1520da['id'],'name':_0x1520da[_0x6ec6('0x3b')],'pause':!![]});}})[_0x6ec6('0x15')](function(){if(_0x1520da){return db[_0x6ec6('0x108')][_0x6ec6('0xcf')]({'where':{'membername':_0x1520da[_0x6ec6('0x3b')],'type':'PAUSE','exitAt':null}});}})[_0x6ec6('0x15')](function(_0x195067){if(_0x195067[_0x6ec6('0x4d')]){var _0x138d7a=moment()[_0x6ec6('0xab')](_0x6ec6('0xfe'));for(var _0x15aced=0x0,_0x150ef7=_0x195067[_0x6ec6('0x4d')];_0x15aced<_0x150ef7;_0x15aced++){_0x195067[_0x15aced]['updateAttributes']({'exitAt':_0x138d7a});}}})[_0x6ec6('0x15')](function(){var _0x3c3dcf=[];var _0x2c234f=utils['getChannels']();_0x2c234f[_0x6ec6('0xfd')](function(_0x597f5f){_0x3c3dcf[_0x6ec6('0x4a')]({'channel':_0x597f5f,'membername':_0x1520da[_0x6ec6('0x3b')],'interface':_[_0x6ec6('0x66')](_0x1520da['interface'])?util['format']('SIP/%s',_0x1520da[_0x6ec6('0x3b')]):_0x1520da['interface'],'type':_0x6ec6('0x102'),'enterAt':moment()[_0x6ec6('0xab')](_0x6ec6('0xfe')),'data1':_0x10d8d1[_0x6ec6('0x5e')][_0x6ec6('0x3e')]||_0x6ec6('0x10b'),'role':_0x1520da[_0x6ec6('0x2c')],'internal':_0x1520da[_0x6ec6('0x63')]});});return db['MemberReport']['bulkCreate'](_0x3c3dcf,{'individualHooks':!![]});})[_0x6ec6('0x15')](function(){return _0x1520da[_0x6ec6('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x10d8d1[_0x6ec6('0x5e')][_0x6ec6('0x3e')]||_0x6ec6('0x10b'),'lastPauseAt':moment()[_0x6ec6('0xab')](_0x6ec6('0xfe'))});})[_0x6ec6('0x15')](respondWithResult(_0x1df12a,null))['catch'](handleError(_0x1df12a,null));};exports[_0x6ec6('0x10c')]=function(_0x388a99,_0x57fa21){if(_0x388a99[_0x6ec6('0x5e')][_0x6ec6('0x9b')]&&!utils[_0x6ec6('0xa0')](_0x388a99['body']['channel'])){throw new APIBadRequestError(util[_0x6ec6('0xab')](_0x6ec6('0x10d'),_0x388a99['body'][_0x6ec6('0x9b')]));}return db[_0x6ec6('0x42')]['find']({'where':{'id':_0x388a99['params']['id']},'attributes':['id',_0x6ec6('0x3b'),_0x6ec6('0x2c'),_0x6ec6('0x63'),_0x6ec6('0x9f'),'online',_0x6ec6('0x9e'),'mailPause',_0x6ec6('0x10e'),_0x6ec6('0x10f'),_0x6ec6('0x110'),_0x6ec6('0x111'),_0x6ec6('0x112'),_0x6ec6('0x113'),'lastPauseAt']})[_0x6ec6('0x15')](function(_0x435ace){if(!_0x435ace){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x388a99[_0x6ec6('0x5f')]['id']));}return _0x435ace[_0x6ec6('0x10c')](_0x388a99[_0x6ec6('0x5e')][_0x6ec6('0x9b')]);})[_0x6ec6('0x15')](respondWithResult(_0x57fa21,null))[_0x6ec6('0x20')](APIHandleError(_0x57fa21));};exports['getTeams']=function(_0x1af111,_0x329bc3){var _0x13eb15={};var _0x15c6c3={};var _0x4f4735;var _0x18d047;return db['User']['findOne']({'where':{'id':_0x1af111[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x329bc3,null))[_0x6ec6('0x15')](function(_0x41f00b){if(_0x41f00b){_0x4f4735=_0x41f00b;_0x15c6c3[_0x6ec6('0x55')]=_[_0x6ec6('0x58')](db[_0x6ec6('0x114')][_0x6ec6('0xd2')]);_0x15c6c3['query']=_[_0x6ec6('0x58')](_0x1af111['query']);_0x15c6c3['filters']=_[_0x6ec6('0x5a')](_0x15c6c3[_0x6ec6('0x55')],_0x15c6c3['query']);_0x13eb15['attributes']=_['intersection'](_0x15c6c3[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x1af111[_0x6ec6('0x45')]['fields']));_0x13eb15[_0x6ec6('0x49')]=_0x13eb15['attributes'][_0x6ec6('0x4d')]?_0x13eb15['attributes']:_0x15c6c3[_0x6ec6('0x55')];_0x13eb15[_0x6ec6('0xd3')]=qs['sort'](_0x1af111[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x13eb15[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x1af111[_0x6ec6('0x45')],_0x15c6c3[_0x6ec6('0x59')]));if(_0x1af111['query'][_0x6ec6('0x34')]){_0x13eb15[_0x6ec6('0xd5')]=_[_0x6ec6('0x5c')](_0x13eb15[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x13eb15[_0x6ec6('0x49')],function(_0x3e4fb5){var _0x5f07a9={};_0x5f07a9[_0x3e4fb5]={'$like':'%'+_0x1af111[_0x6ec6('0x45')][_0x6ec6('0x34')]+'%'};return _0x5f07a9;})});}_0x13eb15=_['merge']({},_0x13eb15,_0x1af111['options']);return _0x4f4735['getTeams'](_0x13eb15);}})[_0x6ec6('0x15')](function(_0x53e92e){if(_0x53e92e){_0x18d047=_0x53e92e['length'];if(!_0x1af111['query'][_0x6ec6('0xd8')]('nolimit')){_0x13eb15[_0x6ec6('0x27')]=qs['limit'](_0x1af111[_0x6ec6('0x45')][_0x6ec6('0x27')]);_0x13eb15[_0x6ec6('0x25')]=qs['offset'](_0x1af111[_0x6ec6('0x45')][_0x6ec6('0x25')]);}return _0x4f4735['getTeams'](_0x13eb15);}})[_0x6ec6('0x15')](function(_0x4c2cd4){if(_0x4c2cd4){return _0x4c2cd4?{'count':_0x18d047,'rows':_0x4c2cd4}:null;}})[_0x6ec6('0x15')](respondWithResult(_0x329bc3,null))[_0x6ec6('0x20')](handleError(_0x329bc3,null));};exports[_0x6ec6('0x115')]=function(_0x503e7a,_0x3a0ec7){var _0x218e65=_0x503e7a[_0x6ec6('0x5f')]['id'];var _0x495fd9=_0x503e7a[_0x6ec6('0x5e')]?_0x503e7a['body'][_0x6ec6('0xa4')]:null;var _0x263959=[];return Promise[_0x6ec6('0x106')]()['then'](function(){if(!_0x495fd9)throw new APIBadRequestError(_0x6ec6('0x116'));})[_0x6ec6('0x15')](function(){return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0x218e65}});})[_0x6ec6('0x15')](function(_0x5e09c5){if(!_0x5e09c5)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x503e7a[_0x6ec6('0x5f')]['id']));return db['sequelize'][_0x6ec6('0x117')](function(_0x49d174){return _0x5e09c5['addTeams'](_0x495fd9,{'transaction':_0x49d174})['then'](function(){return db[_0x6ec6('0x114')][_0x6ec6('0xcf')]({'where':{'id':{'$in':_0x495fd9}}});})[_0x6ec6('0x15')](function(_0x358b88){var _0x26f4b8=_[_0x6ec6('0x35')](_0x358b88,function(_0x6aca81){return _0x6aca81[_0x6ec6('0x118')]();});return Promise['all'](_0x26f4b8);})[_0x6ec6('0x15')](function(_0x2c193a){_0x263959=_[_0x6ec6('0x119')](_0x2c193a);var _0xa20711=_[_0x6ec6('0x35')](_0x263959,function(_0x5ccc48){return _0x5ccc48[_0x6ec6('0x11a')](_0x5e09c5['id'],{'transaction':_0x49d174});});return Promise[_0x6ec6('0x53')](_0xa20711);})[_0x6ec6('0x15')](function(){if(!_0x5e09c5['online'])return;var _0x1b1900=_['filter'](_0x263959,function(_0x87ca53){return _0x87ca53['getDataValue'](_0x6ec6('0x9b'))===_0x6ec6('0x11b');});var _0x34c98a=_[_0x6ec6('0x35')](_0x1b1900,function(_0x50c518){return db['UserVoiceQueueRt'][_0x6ec6('0xfc')]({'membername':_0x5e09c5[_0x6ec6('0x3b')],'UserId':_0x5e09c5['id'],'queue_name':_0x50c518['name'],'VoiceQueueId':_0x50c518['id'],'interface':_[_0x6ec6('0x66')](_0x5e09c5[_0x6ec6('0x9f')])?util[_0x6ec6('0xab')](_0x6ec6('0xf2'),_0x5e09c5[_0x6ec6('0x3b')]):_0x5e09c5[_0x6ec6('0x9f')],'paused':_0x5e09c5[_0x6ec6('0x9e')]||![],'penalty':_0x5e09c5['penalty']},{'transaction':_0x49d174});});return Promise[_0x6ec6('0x53')](_0x34c98a);})['then'](function(){return db[_0x6ec6('0x11c')][_0x6ec6('0xcf')]({'where':{'teamId':{'$in':_0x495fd9}}});})[_0x6ec6('0x15')](function(_0xc70333){var _0x3592ff=_[_0x6ec6('0x35')](_0xc70333,function(_0x9821ae){return db[_0x6ec6('0x11d')][_0x6ec6('0x7d')]({'UserId':_0x5e09c5['id'],'VoicePrefixId':_0x9821ae[_0x6ec6('0x11e')]},{'transaction':_0x49d174});});return Promise['all'](_0x3592ff);});});})[_0x6ec6('0x15')](function(){for(var _0x1bc843=0x0;_0x1bc843<_0x263959[_0x6ec6('0x4d')];_0x1bc843++){var _0x11af2e=_0x263959[_0x1bc843][_0x6ec6('0x11f')]('channel');var _0x197063=_0x11af2e+_0x6ec6('0xa7');socket['emit']('user'+_0x11af2e+_0x6ec6('0xa8'),{'UserId':_0x218e65,['queueField']:_0x263959[_0x1bc843]['id']});}})['then'](respondWithStatusCode(_0x3a0ec7,null))[_0x6ec6('0x20')](APIHandleError(_0x3a0ec7));};exports[_0x6ec6('0x120')]=function(_0x31081d,_0x48af7c){var _0x17e675=_0x31081d['params']['id'];var _0x182006=null;if(_0x31081d['query']['ids']){_0x182006=_[_0x6ec6('0xb0')](_0x31081d['query'][_0x6ec6('0xa4')])?_0x31081d[_0x6ec6('0x45')][_0x6ec6('0xa4')]:[_0x31081d['query']['ids']];}var _0x2c392f=[];return Promise['resolve']()[_0x6ec6('0x15')](function(){if(!_0x182006)throw new APIBadRequestError(_0x6ec6('0x121'));})[_0x6ec6('0x15')](function(){return db['User'][_0x6ec6('0x94')]({'where':{'id':_0x17e675}});})[_0x6ec6('0x15')](function(_0x567dab){if(!_0x567dab)throw new APINotFoundError(util[_0x6ec6('0xab')](_0x6ec6('0xc8'),_0x31081d[_0x6ec6('0x5f')]['id']));return db[_0x6ec6('0x69')]['transaction'](function(_0x5913c0){return _0x567dab[_0x6ec6('0x120')](_0x182006,{'transaction':_0x5913c0})['then'](function(){return db[_0x6ec6('0x114')][_0x6ec6('0xcf')]({'where':{'id':{'$in':_0x182006}}});})['then'](function(_0x2b979c){var _0x2ea516=_['map'](_0x2b979c,function(_0x1bb610){return _0x1bb610[_0x6ec6('0x118')]();});return Promise['all'](_0x2ea516);})['then'](function(_0x4aea1a){_0x2c392f=_[_0x6ec6('0x119')](_0x4aea1a);var _0x44358b=_[_0x6ec6('0x35')](_0x2c392f,function(_0x38ae79){return _0x38ae79['removeAgent'](_0x567dab['id'],{'transaction':_0x5913c0});});return Promise[_0x6ec6('0x53')](_0x44358b);})[_0x6ec6('0x15')](function(){if(!_0x567dab[_0x6ec6('0x9c')])return;var _0x1ec538=_[_0x6ec6('0x34')](_0x2c392f,function(_0x1eabcc){return _0x1eabcc[_0x6ec6('0x11f')]('channel')===_0x6ec6('0x11b');});var _0x4688dc=_[_0x6ec6('0x35')](_0x1ec538,function(_0x398f44){return db[_0x6ec6('0xac')][_0x6ec6('0x39')]({'where':{'VoiceQueueId':_0x398f44['id'],'UserId':_0x567dab['id']},'transaction':_0x5913c0});});return Promise[_0x6ec6('0x53')](_0x4688dc);})[_0x6ec6('0x15')](function(){return db[_0x6ec6('0x11c')][_0x6ec6('0xcf')]({'where':{'teamId':{'$in':_0x182006}}});})['then'](function(_0x4434e2){var _0x4416fc=_[_0x6ec6('0x35')](_0x4434e2,function(_0x32ba85){return db[_0x6ec6('0x11d')][_0x6ec6('0x39')]({'where':{'UserId':_0x567dab['id'],'VoicePrefixId':_0x32ba85[_0x6ec6('0x11e')]}},{'transaction':_0x5913c0});});return Promise[_0x6ec6('0x53')](_0x4416fc);});});})[_0x6ec6('0x15')](function(){for(var _0x367bb9=0x0;_0x367bb9<_0x2c392f[_0x6ec6('0x4d')];_0x367bb9++){var _0x50c583=_0x2c392f[_0x367bb9][_0x6ec6('0x11f')](_0x6ec6('0x9b'));var _0x41454a=_0x50c583+_0x6ec6('0xa7');socket[_0x6ec6('0x2d')](_0x6ec6('0x31')+_0x50c583+'Queue:remove',{'UserId':_0x17e675,['queueField']:_0x2c392f[_0x367bb9]['id']});}})[_0x6ec6('0x15')](respondWithStatusCode(_0x48af7c,null))[_0x6ec6('0x20')](APIHandleError(_0x48af7c));};exports['getLists']=function(_0x5d2594,_0x570edb){var _0x7f9bb3={};var _0x1e19a5={};var _0x5a2ad2;var _0x3076fd;return db[_0x6ec6('0x42')]['findOne']({'where':{'id':_0x5d2594[_0x6ec6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x570edb,null))[_0x6ec6('0x15')](function(_0xf725f4){if(_0xf725f4){_0x5a2ad2=_0xf725f4;_0x1e19a5[_0x6ec6('0x55')]=_[_0x6ec6('0x58')](db[_0x6ec6('0xc9')][_0x6ec6('0xd2')]);_0x1e19a5[_0x6ec6('0x45')]=_[_0x6ec6('0x58')](_0x5d2594[_0x6ec6('0x45')]);_0x1e19a5[_0x6ec6('0x59')]=_[_0x6ec6('0x5a')](_0x1e19a5[_0x6ec6('0x55')],_0x1e19a5[_0x6ec6('0x45')]);_0x7f9bb3[_0x6ec6('0x49')]=_[_0x6ec6('0x5a')](_0x1e19a5['model'],qs[_0x6ec6('0x5b')](_0x5d2594[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x7f9bb3[_0x6ec6('0x49')]=_0x7f9bb3['attributes'][_0x6ec6('0x4d')]?_0x7f9bb3['attributes']:_0x1e19a5[_0x6ec6('0x55')];_0x7f9bb3['order']=qs[_0x6ec6('0xd4')](_0x5d2594[_0x6ec6('0x45')][_0x6ec6('0xd4')]);_0x7f9bb3[_0x6ec6('0xd5')]=qs[_0x6ec6('0x59')](_[_0x6ec6('0xd6')](_0x5d2594[_0x6ec6('0x45')],_0x1e19a5['filters']));if(_0x5d2594['query'][_0x6ec6('0x34')]){_0x7f9bb3[_0x6ec6('0xd5')]=_['merge'](_0x7f9bb3['where'],{'$or':_[_0x6ec6('0x35')](_0x7f9bb3[_0x6ec6('0x49')],function(_0x2a1123){var _0x97c0dd={};_0x97c0dd[_0x2a1123]={'$like':'%'+_0x5d2594[_0x6ec6('0x45')][_0x6ec6('0x34')]+'%'};return _0x97c0dd;})});}_0x7f9bb3=_[_0x6ec6('0x5c')]({},_0x7f9bb3,_0x5d2594[_0x6ec6('0x5d')]);return _0x5a2ad2[_0x6ec6('0x122')](_0x7f9bb3);}})['then'](function(_0x4980b2){if(_0x4980b2){_0x3076fd=_0x4980b2[_0x6ec6('0x4d')];if(!_0x5d2594[_0x6ec6('0x45')]['hasOwnProperty'](_0x6ec6('0xd9'))){_0x7f9bb3['limit']=qs[_0x6ec6('0x27')](_0x5d2594['query'][_0x6ec6('0x27')]);_0x7f9bb3[_0x6ec6('0x25')]=qs[_0x6ec6('0x25')](_0x5d2594['query'][_0x6ec6('0x25')]);}return _0x5a2ad2['getLists'](_0x7f9bb3);}})['then'](function(_0x7c9f37){if(_0x7c9f37){return _0x7c9f37?{'count':_0x3076fd,'rows':_0x7c9f37}:null;}})[_0x6ec6('0x15')](respondWithResult(_0x570edb,null))[_0x6ec6('0x20')](handleError(_0x570edb,null));};exports[_0x6ec6('0x123')]=function(_0x4e26a2,_0x261c98){var _0x53383c={};var _0x39971a={};var _0x32f1c3;return db[_0x6ec6('0x42')][_0x6ec6('0x94')]({'where':{'id':_0x4e26a2[_0x6ec6('0x5f')]['id']}})[_0x6ec6('0x15')](handleEntityNotFound(_0x261c98,null))[_0x6ec6('0x15')](function(_0x2acf93){if(_0x2acf93){_0x32f1c3=_0x2acf93;_0x39971a['model']=_[_0x6ec6('0x58')](db['User']['rawAttributes']);_0x39971a[_0x6ec6('0x45')]=_['keys'](_0x4e26a2[_0x6ec6('0x45')]);_0x39971a[_0x6ec6('0x59')]=_[_0x6ec6('0x5a')](_0x39971a[_0x6ec6('0x55')],_0x39971a[_0x6ec6('0x45')]);_0x53383c[_0x6ec6('0x49')]=_['intersection'](_0x39971a[_0x6ec6('0x55')],qs[_0x6ec6('0x5b')](_0x4e26a2[_0x6ec6('0x45')][_0x6ec6('0x5b')]));_0x53383c[_0x6ec6('0x49')]=_0x53383c[_0x6ec6('0x49')][_0x6ec6('0x4d')]?_0x53383c[_0x6ec6('0x49')]:_0x39971a['model'];_0x53383c[_0x6ec6('0xd3')]=qs['sort'](_0x4e26a2[_0x6ec6('0x45')]['sort']);_0x53383c[_0x6ec6('0xd5')]=qs['filters'](_['pick'](_0x4e26a2['query'],_0x39971a[_0x6ec6('0x59')]));if(_0x4e26a2['query'][_0x6ec6('0x34')]){_0x53383c['where']=_['merge'](_0x53383c[_0x6ec6('0xd5')],{'$or':_[_0x6ec6('0x35')](_0x53383c['attributes'],function(_0x3b0caa){var _0x5cb9aa={};_0x5cb9aa[_0x3b0caa]={'$like':'%'+_0x4e26a2['query'][_0x6ec6('0x34')]+'%'};return _0x5cb9aa;})});}_0x53383c[_0x6ec6('0x55')]=db['User'];_0x53383c['as']=_0x6ec6('0x85');_0x53383c=_[_0x6ec6('0x5c')]({},_0x53383c,_0x4e26a2[_0x6ec6('0x5d')]);return _0x32f1c3[_0x6ec6('0xfb')]({'include':[_0x53383c]});}})['then'](function(_0x503ab2){if(_0x503ab2){var _0x5e75dd={},_0x3d3a13=[];for(var _0x5222f6=0x0;_0x5222f6<_0x503ab2[_0x6ec6('0x4d')];_0x5222f6+=0x1){for(var _0x4b1818=0x0,_0x2fac43;_0x4b1818<_0x503ab2[_0x5222f6]['Agents'][_0x6ec6('0x4d')];_0x4b1818+=0x1){_0x2fac43=_0x503ab2[_0x5222f6][_0x6ec6('0x85')][_0x4b1818][_0x6ec6('0x2f')]({'plain':!![]});_0x5e75dd[_0x2fac43['id']]=_0x2fac43;}}_0x5e75dd=_[_0x6ec6('0x124')](_0x5e75dd);for(var _0x5abdf9=qs[_0x6ec6('0x25')](_0x4e26a2[_0x6ec6('0x45')]['offset']);_0x5abdf9<_0x5e75dd[_0x6ec6('0x4d')]&&_0x3d3a13[_0x6ec6('0x4d')]=_0x1e851d[_0x9633('0x4f')]){throw new Error(_0x9633('0x50'));}})['then'](function(){if(_0xec6a80){return db[_0x9633('0x27')][_0x9633('0x44')]({'where':{'membername':_0xec6a80[_0x9633('0x21')]},'individualHooks':!![]});}})[_0x9633('0x1f')](function(){if(_0xec6a80){return _0xec6a80[_0x9633('0x51')]({'raw':!![]});}})[_0x9633('0x1f')](function(_0x22ed26){if(_0xec6a80){if(_0x22ed26){var _0x22737a=[];_0x1fac2d=_0x22ed26;if(_0x1fac2d[_0x9633('0x2b')]){for(var _0x2bdffe=0x0;_0x2bdffe<_0x1fac2d[_0x9633('0x2b')];_0x2bdffe++){_0x22737a[_0x9633('0x45')](db[_0x9633('0x27')][_0x9633('0x52')]({'membername':_0xec6a80[_0x9633('0x21')],'UserId':_0xec6a80['id'],'queue_name':_0x1fac2d[_0x2bdffe]['name'],'VoiceQueueId':_0x1fac2d[_0x2bdffe]['id'],'interface':_0x1a8f3f,'paused':_0xec6a80[_0x9633('0x49')]||![],'penalty':_0x1fac2d[_0x2bdffe][_0x9633('0x53')]||0x0}));}return BPromise[_0x9633('0x46')](_0x22737a);}}}})[_0x9633('0x1f')](function(){if(_0xec6a80){return db[_0x9633('0x29')][_0x9633('0xe')]({'where':{'membername':_0xec6a80['name'],'exitAt':null}});}})[_0x9633('0x1f')](function(_0x476a15){if(_0xec6a80){if(_0x476a15&&_0x476a15['length']){var _0x2b54e5=[];_0x476a15[_0x9633('0x2e')](function(_0x5e1d2a){_0x2b54e5[_0x9633('0x45')](_0x5e1d2a[_0x9633('0x28')]({'exitAt':moment()[_0x9633('0x25')](_0x9633('0x30'))}));});return BPromise[_0x9633('0x46')](_0x2b54e5);}}})['then'](function(){if(_0xec6a80){var _0x54f344=[];var _0x2b03cc=[];var _0x3da88d=utils['getChannels']();var _0x40789d={'membername':_0xec6a80[_0x9633('0x21')],'interface':_0x1a8f3f,'enterAt':moment()[_0x9633('0x25')](_0x9633('0x30')),'role':_0xec6a80[_0x9633('0x22')],'internal':_0xec6a80[_0x9633('0x23')]};_0x3da88d['forEach'](function(_0x3d55b0){_0x54f344[_0x9633('0x45')](_[_0x9633('0x54')]({'channel':_0x3d55b0,'type':'LOGIN','data1':_0x9633('0x55'),'data2':_0x1a8f3f},_0x40789d));if(_0xec6a80[_0x9633('0x49')]){_0x2b03cc[_0x9633('0x45')](_['merge']({'channel':_0x3d55b0,'type':'PAUSE','data1':_0x9633('0x56')},_0x40789d));}});return db[_0x9633('0x29')]['bulkCreate'](_0x54f344[_0x9633('0x57')](_0x2b03cc),{'individualHooks':!![]});}})[_0x9633('0x1f')](function(){if(_0xec6a80){return _0xec6a80[_0x9633('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0x9633('0x30')),'voicePause':_0xec6a80[_0x9633('0x49')]||![],'mailPause':_0xec6a80['loginInPause']||![],'chatPause':_0xec6a80['loginInPause']||![],'faxPause':_0xec6a80[_0x9633('0x49')]||![],'smsPause':_0xec6a80[_0x9633('0x49')]||![],'openchannelPause':_0xec6a80['loginInPause']||![],'pauseType':_0xec6a80['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x9633('0x25')](_0x9633('0x30')),'interface':_0x1a8f3f});}})['then'](function(_0x5d4a45){_0x278cbb(_0x5d4a45);})['catch'](function(_0x248a72){_0x3ce7e2(_0x4b3823[_0x9633('0x1a')](0x1f4,_0x248a72[_0x9633('0x1b')]));});});}; \ No newline at end of file +var _0xc4c8=['isNil','format','SIP/%s','body','type','uniqueid','MemberReport','bulkCreate','update','DEFAULT\x20PAUSE','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','smsPause','lastPauseAt','params','unpause','LogoutUser','destroy','push','all','LoginUser','mobile','loginInPause','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','bluebird','ioredis','rpc','redis','defaults','localhost','socket.io-emitter','./user.socket','register','User','findAll','options','raw','where','attributes','limit','include','map','model','then','GetUser','debug','stringify','catch','error','find','ShowUser','message','PauseUser','name','role','internal','interface','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','PAUSE','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach'];(function(_0xf80645,_0x581348){var _0x4f6cdc=function(_0x1d8929){while(--_0x1d8929){_0xf80645['push'](_0xf80645['shift']());}};_0x4f6cdc(++_0x581348);}(_0xc4c8,0x1ce));var _0x8c4c=function(_0xc114cf,_0x6ac0ca){_0xc114cf=_0xc114cf-0x0;var _0x54727b=_0xc4c8[_0xc114cf];return _0x54727b;};'use strict';var _=require('lodash');var util=require(_0x8c4c('0x0'));var moment=require('moment');var BPromise=require(_0x8c4c('0x1'));var Redis=require(_0x8c4c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c4c('0x3'));var config=require('../../config/environment');config[_0x8c4c('0x4')]=_[_0x8c4c('0x5')](config[_0x8c4c('0x4')],{'host':_0x8c4c('0x6'),'port':0x18eb});var socket=require(_0x8c4c('0x7'))(new Redis(config[_0x8c4c('0x4')]));require(_0x8c4c('0x8'))[_0x8c4c('0x9')](socket);exports['GetUser']=function(_0x52f9aa){var _0x570b42=this;return new Promise(function(_0x10fba7,_0x2de272){return db[_0x8c4c('0xa')][_0x8c4c('0xb')]({'raw':_0x52f9aa[_0x8c4c('0xc')]?_0x52f9aa['options'][_0x8c4c('0xd')]===undefined?!![]:![]:!![],'where':_0x52f9aa[_0x8c4c('0xc')]?_0x52f9aa['options'][_0x8c4c('0xe')]||null:null,'attributes':_0x52f9aa[_0x8c4c('0xc')]?_0x52f9aa['options'][_0x8c4c('0xf')]||null:null,'limit':_0x52f9aa[_0x8c4c('0xc')]?_0x52f9aa[_0x8c4c('0xc')][_0x8c4c('0x10')]||null:null,'include':_0x52f9aa[_0x8c4c('0xc')]?_0x52f9aa[_0x8c4c('0xc')][_0x8c4c('0x11')]?_[_0x8c4c('0x12')](_0x52f9aa[_0x8c4c('0xc')][_0x8c4c('0x11')],function(_0x4bae5a){return{'model':db[_0x4bae5a[_0x8c4c('0x13')]],'as':_0x4bae5a['as'],'attributes':_0x4bae5a['attributes'],'include':_0x4bae5a[_0x8c4c('0x11')]?_[_0x8c4c('0x12')](_0x4bae5a[_0x8c4c('0x11')],function(_0x1a0e11){return{'model':db[_0x1a0e11['model']],'as':_0x1a0e11['as'],'attributes':_0x1a0e11[_0x8c4c('0xf')],'include':_0x1a0e11[_0x8c4c('0x11')]?_['map'](_0x1a0e11[_0x8c4c('0x11')],function(_0x465775){return{'model':db[_0x465775[_0x8c4c('0x13')]],'as':_0x465775['as'],'attributes':_0x465775[_0x8c4c('0xf')]};}):[]};}):[]};}):[]:[]})[_0x8c4c('0x14')](function(_0x5ec011){logger['info'](_0x8c4c('0x15'),_0x52f9aa);logger[_0x8c4c('0x16')](_0x8c4c('0x15'),_0x52f9aa,JSON[_0x8c4c('0x17')](_0x5ec011));_0x10fba7(_0x5ec011);})[_0x8c4c('0x18')](function(_0xa7adcd){logger[_0x8c4c('0x19')](_0x8c4c('0x15'),_0xa7adcd['message'],_0x52f9aa);_0x2de272(_0x570b42['error'](0x1f4,_0xa7adcd['message']));});});};exports['ShowUser']=function(_0xd3ff6c){var _0x43bcb1=this;return new Promise(function(_0x55bb03,_0x40078b){return db['User'][_0x8c4c('0x1a')]({'raw':_0xd3ff6c[_0x8c4c('0xc')]?_0xd3ff6c['options'][_0x8c4c('0xd')]===undefined?!![]:![]:!![],'where':_0xd3ff6c[_0x8c4c('0xc')]?_0xd3ff6c[_0x8c4c('0xc')][_0x8c4c('0xe')]||null:null,'attributes':_0xd3ff6c[_0x8c4c('0xc')]?_0xd3ff6c[_0x8c4c('0xc')][_0x8c4c('0xf')]||null:null,'include':_0xd3ff6c['options']?_0xd3ff6c[_0x8c4c('0xc')][_0x8c4c('0x11')]?_[_0x8c4c('0x12')](_0xd3ff6c['options'][_0x8c4c('0x11')],function(_0x67466a){return{'model':db[_0x67466a[_0x8c4c('0x13')]],'as':_0x67466a['as'],'attributes':_0x67466a['attributes'],'include':_0x67466a[_0x8c4c('0x11')]?_[_0x8c4c('0x12')](_0x67466a[_0x8c4c('0x11')],function(_0x321d66){return{'model':db[_0x321d66['model']],'as':_0x321d66['as'],'attributes':_0x321d66[_0x8c4c('0xf')],'include':_0x321d66[_0x8c4c('0x11')]?_['map'](_0x321d66['include'],function(_0x19eb1d){return{'model':db[_0x19eb1d['model']],'as':_0x19eb1d['as'],'attributes':_0x19eb1d[_0x8c4c('0xf')]};}):[]};}):[]};}):[]:[]})[_0x8c4c('0x14')](function(_0x4254a9){logger['info'](_0x8c4c('0x1b'),_0xd3ff6c);logger[_0x8c4c('0x16')](_0x8c4c('0x1b'),_0xd3ff6c,JSON[_0x8c4c('0x17')](_0x4254a9));_0x55bb03(_0x4254a9);})['catch'](function(_0x5804db){logger[_0x8c4c('0x19')](_0x8c4c('0x1b'),_0x5804db[_0x8c4c('0x1c')],_0xd3ff6c);_0x40078b(_0x43bcb1[_0x8c4c('0x19')](0x1f4,_0x5804db[_0x8c4c('0x1c')]));});});};exports[_0x8c4c('0x1d')]=function(_0x13e27c){var _0x2a1eeb;return db[_0x8c4c('0xa')][_0x8c4c('0x1a')]({'where':_0x13e27c[_0x8c4c('0xc')][_0x8c4c('0xe')]||{},'attributes':['id',_0x8c4c('0x1e'),_0x8c4c('0x1f'),_0x8c4c('0x20'),_0x8c4c('0x21')]})[_0x8c4c('0x14')](function(_0x1b9f7f){if(!_0x1b9f7f){throw new Error(util['format'](_0x8c4c('0x22'),_0x13e27c['params']['id']));}_0x2a1eeb=_0x1b9f7f;return db[_0x8c4c('0x23')]['update']({'paused':0x1},{'where':{'UserId':_0x2a1eeb['id']},'individualHooks':!![]});})[_0x8c4c('0x14')](function(){return db['MemberReport'][_0x8c4c('0xb')]({'where':{'membername':_0x2a1eeb['name'],'type':_0x8c4c('0x24'),'exitAt':null}});})['then'](function(_0x46801c){if(_0x46801c&&_0x46801c['length']){var _0x32b072=moment()['format'](_0x8c4c('0x25'));for(var _0x20bb90=0x0,_0x1a8a04=_0x46801c[_0x8c4c('0x26')];_0x20bb90<_0x1a8a04;_0x20bb90++){_0x46801c[_0x20bb90][_0x8c4c('0x27')]({'exitAt':_0x32b072});}}})[_0x8c4c('0x14')](function(){var _0xc9eb26=[];var _0x10fb35=utils[_0x8c4c('0x28')]();_0x10fb35[_0x8c4c('0x29')](function(_0x3d9f2b){_0xc9eb26['push']({'channel':_0x3d9f2b,'membername':_0x2a1eeb[_0x8c4c('0x1e')],'interface':_[_0x8c4c('0x2a')](_0x2a1eeb[_0x8c4c('0x21')])?util[_0x8c4c('0x2b')](_0x8c4c('0x2c'),_0x2a1eeb[_0x8c4c('0x1e')]):_0x2a1eeb[_0x8c4c('0x21')],'type':_0x8c4c('0x24'),'enterAt':moment()[_0x8c4c('0x2b')](_0x8c4c('0x25')),'data1':_0x13e27c[_0x8c4c('0x2d')][_0x8c4c('0x2e')]||'DEFAULT\x20PAUSE','role':_0x2a1eeb[_0x8c4c('0x1f')],'internal':_0x2a1eeb[_0x8c4c('0x20')],'uniqueid':_0x13e27c[_0x8c4c('0x2d')][_0x8c4c('0x2f')]||null});});return db[_0x8c4c('0x30')][_0x8c4c('0x31')](_0xc9eb26,{'individualHooks':!![]});})[_0x8c4c('0x14')](function(){return _0x2a1eeb[_0x8c4c('0x32')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x13e27c[_0x8c4c('0x2d')][_0x8c4c('0x2e')]||_0x8c4c('0x33'),'lastPauseAt':moment()[_0x8c4c('0x2b')](_0x8c4c('0x25'))});})[_0x8c4c('0x18')](function(_0x55c89b){throw _0x55c89b;});};exports['UnpauseUser']=function(_0x17d63f){return Promise[_0x8c4c('0x34')]()['then'](function(){if(_0x17d63f[_0x8c4c('0x2d')][_0x8c4c('0x35')]&&!utils[_0x8c4c('0x36')](_0x17d63f[_0x8c4c('0x2d')]['channel'])){throw new Error(util[_0x8c4c('0x2b')](_0x8c4c('0x37'),_0x17d63f[_0x8c4c('0x2d')]['channel']));}return db[_0x8c4c('0xa')][_0x8c4c('0x38')]({'where':_0x17d63f[_0x8c4c('0xc')][_0x8c4c('0xe')]||{},'attributes':['id',_0x8c4c('0x1e'),_0x8c4c('0x1f'),_0x8c4c('0x20'),_0x8c4c('0x21'),_0x8c4c('0x39'),_0x8c4c('0x3a'),_0x8c4c('0x3b'),_0x8c4c('0x3c'),'faxPause','openchannelPause',_0x8c4c('0x3d'),'whatsappPause','pauseType',_0x8c4c('0x3e')]});})[_0x8c4c('0x14')](function(_0x5658cd){if(!_0x5658cd){throw new Error(util[_0x8c4c('0x2b')](_0x8c4c('0x22'),_0x17d63f[_0x8c4c('0x3f')]['id']));}return _0x5658cd[_0x8c4c('0x40')](_0x17d63f['body'][_0x8c4c('0x35')],'system');})[_0x8c4c('0x18')](function(_0x53a21c){throw _0x53a21c;});};exports[_0x8c4c('0x41')]=function(_0xd31792){var _0x3bcf0d=this;return new Promise(function(_0x1c295b,_0x169511){var _0x228876;return db[_0x8c4c('0xa')][_0x8c4c('0x38')]({'where':_0xd31792[_0x8c4c('0xc')][_0x8c4c('0xe')]||{},'attributes':['id',_0x8c4c('0x1e')]})[_0x8c4c('0x14')](function(_0x5e5a57){if(_0x5e5a57){_0x228876=_0x5e5a57;return db[_0x8c4c('0x23')][_0x8c4c('0x42')]({'where':{'membername':_0x228876[_0x8c4c('0x1e')]},'individualHooks':!![]});}})[_0x8c4c('0x14')](function(){if(_0x228876){return db[_0x8c4c('0x30')][_0x8c4c('0xb')]({'where':{'membername':_0x228876[_0x8c4c('0x1e')],'exitAt':null}});}})[_0x8c4c('0x14')](function(_0x5cc2af){if(_0x228876){if(_0x5cc2af&&_0x5cc2af['length']){var _0x437279=[];_0x5cc2af[_0x8c4c('0x29')](function(_0x45cf98){_0x437279[_0x8c4c('0x43')](_0x45cf98[_0x8c4c('0x32')]({'exitAt':moment()[_0x8c4c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8c4c('0x44')](_0x437279);}}})['then'](function(){if(_0x228876){return _0x228876[_0x8c4c('0x32')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x573fed){_0x1c295b(_0x573fed);})[_0x8c4c('0x18')](function(_0x514b6e){_0x169511(_0x3bcf0d[_0x8c4c('0x19')](0x1f4,_0x514b6e[_0x8c4c('0x1c')]));});});};exports[_0x8c4c('0x45')]=function(_0x27bcfd){var _0x238358=this;return new Promise(function(_0x3e5ff6,_0xfe47e5){var _0x3f068b;var _0x1f6368;var _0x2492a7;var _0x312cb4;return db[_0x8c4c('0xa')][_0x8c4c('0x38')]({'where':_0x27bcfd[_0x8c4c('0xc')][_0x8c4c('0xe')]||{},'attributes':['id','name','role',_0x8c4c('0x46'),'phone',_0x8c4c('0x20'),_0x8c4c('0x47'),_0x8c4c('0x21')]})[_0x8c4c('0x14')](function(_0x52e619){if(_0x52e619){_0x3f068b=_0x52e619;_0x312cb4=_0x27bcfd[_0x8c4c('0x2d')][_0x8c4c('0x21')]?_0x27bcfd[_0x8c4c('0x2d')]['interface']:util['format'](_0x8c4c('0x2c'),_0x3f068b['name']);return db[_0x8c4c('0xa')]['count']({'where':{'role':_0x8c4c('0x48'),'online':!![],'id':{'$ne':_0x3f068b['id']}}});}})[_0x8c4c('0x14')](function(_0x5cf361){if(_0x5cf361){_0x2492a7=_0x5cf361;return require(_0x8c4c('0x49'))[_0x8c4c('0x4a')]();}})[_0x8c4c('0x14')](function(_0x34dbe2){if(_0x34dbe2&&_0x34dbe2[_0x8c4c('0x4b')]&&_0x2492a7>=_0x34dbe2['agents']){throw new Error(_0x8c4c('0x4c'));}})['then'](function(){if(_0x3f068b){return db['UserVoiceQueueRt'][_0x8c4c('0x42')]({'where':{'membername':_0x3f068b['name']},'individualHooks':!![]});}})[_0x8c4c('0x14')](function(){if(_0x3f068b){return _0x3f068b['getVoiceQueues']({'raw':!![]});}})[_0x8c4c('0x14')](function(_0x56f204){if(_0x3f068b){if(_0x56f204){var _0x451d7a=[];_0x1f6368=_0x56f204;if(_0x1f6368[_0x8c4c('0x26')]){for(var _0x2f05fd=0x0;_0x2f05fd<_0x1f6368[_0x8c4c('0x26')];_0x2f05fd++){_0x451d7a[_0x8c4c('0x43')](db[_0x8c4c('0x23')][_0x8c4c('0x4d')]({'membername':_0x3f068b[_0x8c4c('0x1e')],'UserId':_0x3f068b['id'],'queue_name':_0x1f6368[_0x2f05fd][_0x8c4c('0x1e')],'VoiceQueueId':_0x1f6368[_0x2f05fd]['id'],'interface':_0x312cb4,'paused':_0x3f068b[_0x8c4c('0x47')]||![],'penalty':_0x1f6368[_0x2f05fd][_0x8c4c('0x4e')]||0x0}));}return BPromise['all'](_0x451d7a);}}}})[_0x8c4c('0x14')](function(){if(_0x3f068b){return db[_0x8c4c('0x30')][_0x8c4c('0xb')]({'where':{'membername':_0x3f068b['name'],'exitAt':null}});}})[_0x8c4c('0x14')](function(_0x40b5a1){if(_0x3f068b){if(_0x40b5a1&&_0x40b5a1[_0x8c4c('0x26')]){var _0x1b0b2f=[];_0x40b5a1[_0x8c4c('0x29')](function(_0x23c992){_0x1b0b2f[_0x8c4c('0x43')](_0x23c992[_0x8c4c('0x32')]({'exitAt':moment()[_0x8c4c('0x2b')](_0x8c4c('0x25'))}));});return BPromise[_0x8c4c('0x44')](_0x1b0b2f);}}})[_0x8c4c('0x14')](function(){if(_0x3f068b){var _0x4e615c=[];var _0x5989d6=[];var _0x5a45e0=utils[_0x8c4c('0x28')]();var _0x491633={'membername':_0x3f068b[_0x8c4c('0x1e')],'interface':_0x312cb4,'enterAt':moment()[_0x8c4c('0x2b')](_0x8c4c('0x25')),'role':_0x3f068b['role'],'internal':_0x3f068b['internal']};_0x5a45e0[_0x8c4c('0x29')](function(_0x2e826f){_0x4e615c['push'](_[_0x8c4c('0x4f')]({'channel':_0x2e826f,'type':_0x8c4c('0x50'),'data1':_0x8c4c('0x51'),'data2':_0x312cb4},_0x491633));if(_0x3f068b['loginInPause']){_0x5989d6[_0x8c4c('0x43')](_[_0x8c4c('0x4f')]({'channel':_0x2e826f,'type':_0x8c4c('0x24'),'data1':_0x8c4c('0x52')},_0x491633));}});return db[_0x8c4c('0x30')][_0x8c4c('0x31')](_0x4e615c[_0x8c4c('0x53')](_0x5989d6),{'individualHooks':!![]});}})[_0x8c4c('0x14')](function(){if(_0x3f068b){return _0x3f068b[_0x8c4c('0x32')]({'online':!![],'lastLoginAt':moment()[_0x8c4c('0x2b')](_0x8c4c('0x25')),'voicePause':_0x3f068b['loginInPause']||![],'mailPause':_0x3f068b[_0x8c4c('0x47')]||![],'chatPause':_0x3f068b[_0x8c4c('0x47')]||![],'faxPause':_0x3f068b[_0x8c4c('0x47')]||![],'smsPause':_0x3f068b[_0x8c4c('0x47')]||![],'openchannelPause':_0x3f068b[_0x8c4c('0x47')]||![],'pauseType':_0x3f068b[_0x8c4c('0x47')]?_0x8c4c('0x52'):null,'lastPauseAt':moment()[_0x8c4c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x312cb4});}})[_0x8c4c('0x14')](function(_0x243129){_0x3e5ff6(_0x243129);})['catch'](function(_0x4550fd){_0xfe47e5(_0x238358[_0x8c4c('0x19')](0x1f4,_0x4550fd[_0x8c4c('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b0aff96..734226b 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 _0xcaf1=['user:','./user.events','remove','update','emit','removeListener','register'];(function(_0x153d86,_0x4ec9f8){var _0xb44a8a=function(_0x283ca2){while(--_0x283ca2){_0x153d86['push'](_0x153d86['shift']());}};_0xb44a8a(++_0x4ec9f8);}(_0xcaf1,0xb0));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0x1caf('0x0'));var events=['save',_0x1caf('0x1'),_0x1caf('0x2')];function createListener(_0x47d020,_0x223f49){return function(_0x4ca558){_0x223f49[_0x1caf('0x3')](_0x47d020,_0x4ca558);};}function removeListener(_0x428a05,_0x33d23d){return function(){UserEvents[_0x1caf('0x4')](_0x428a05,_0x33d23d);};}exports[_0x1caf('0x5')]=function(_0x5b09cb){for(var _0x6a07df=0x0,_0x49d5ad=events['length'];_0x6a07df<_0x49d5ad;_0x6a07df++){var _0x32996c=events[_0x6a07df];var _0x55dc80=createListener(_0x1caf('0x6')+_0x32996c,_0x5b09cb);UserEvents['on'](_0x32996c,_0x55dc80);}}; \ No newline at end of file +var _0x4ef9=['emit','removeListener','register','length','user:','remove','update'];(function(_0x1a800c,_0x37b923){var _0x2e41f4=function(_0x91398a){while(--_0x91398a){_0x1a800c['push'](_0x1a800c['shift']());}};_0x2e41f4(++_0x37b923);}(_0x4ef9,0xc2));var _0x94ef=function(_0x42276c,_0x141d47){_0x42276c=_0x42276c-0x0;var _0x1b5009=_0x4ef9[_0x42276c];return _0x1b5009;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x94ef('0x0'),_0x94ef('0x1')];function createListener(_0x37b314,_0x2b2ba4){return function(_0x102b0e){_0x2b2ba4[_0x94ef('0x2')](_0x37b314,_0x102b0e);};}function removeListener(_0x1805c0,_0x47e4dd){return function(){UserEvents[_0x94ef('0x3')](_0x1805c0,_0x47e4dd);};}exports[_0x94ef('0x4')]=function(_0x2d1233){for(var _0x4c7571=0x0,_0x48b1d7=events[_0x94ef('0x5')];_0x4c7571<_0x48b1d7;_0x4c7571++){var _0x164083=events[_0x4c7571];var _0x5454a9=createListener(_0x94ef('0x6')+_0x164083,_0x2d1233);UserEvents['on'](_0x164083,_0x5454a9);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b40b982..1e924b6 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1ab3da,_0x2d321d){var _0x3ffd4e=function(_0x1c49f2){while(--_0x1c49f2){_0x1ab3da['push'](_0x1ab3da['shift']());}};_0x3ffd4e(++_0x2d321d);}(_0x70e0,0x17b));var _0x070e=function(_0x2d94b0,_0x10d2d9){_0x2d94b0=_0x2d94b0-0x0;var _0x1a41f7=_0x70e0[_0x2d94b0];return _0x1a41f7;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x42e988,_0xd8abe0){var _0x5ce1fb=function(_0x2531bc){while(--_0x2531bc){_0x42e988['push'](_0x42e988['shift']());}};_0x5ce1fb(++_0xd8abe0);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 096b9e2..b6dbef1 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 _0xb04c=['INTEGER','exports'];(function(_0x484b50,_0x271400){var _0x37165d=function(_0x3043e5){while(--_0x3043e5){_0x484b50['push'](_0x484b50['shift']());}};_0x37165d(++_0x271400);}(_0xb04c,0x1b7));var _0xcb04=function(_0x9fea9c,_0x30b8e8){_0x9fea9c=_0x9fea9c-0x0;var _0x58945f=_0xb04c[_0x9fea9c];return _0x58945f;};'use strict';var Sequelize=require('sequelize');module[_0xcb04('0x0')]={'penalty':{'type':Sequelize[_0xcb04('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8f4e=['INTEGER','sequelize'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x8f4e,0x149));var _0xe8f4=function(_0x182e58,_0x4fe60d){_0x182e58=_0x182e58-0x0;var _0x49763f=_0x8f4e[_0x182e58];return _0x49763f;};'use strict';var Sequelize=require(_0xe8f4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe8f4('0x1')],'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 e5982d2..d54afeb 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 _0x4e44=['exports','util','../../config/logger','moment','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4e44,0xe9));var _0x44e4=function(_0x21e96,_0x43a55b){_0x21e96=_0x21e96-0x0;var _0x25273f=_0x4e44[_0x21e96];return _0x25273f;};'use strict';var _=require('lodash');var util=require(_0x44e4('0x0'));var logger=require(_0x44e4('0x1'))('api');var moment=require(_0x44e4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44e4('0x3'));var rimraf=require(_0x44e4('0x4'));var config=require(_0x44e4('0x5'));var attributes=require(_0x44e4('0x6'));module[_0x44e4('0x7')]=function(_0x27c175,_0x375acd){return _0x27c175['define']('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x412a=['bluebird','rimraf','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','api','moment'];(function(_0x1eba45,_0x407d7c){var _0x2b809c=function(_0x2d386f){while(--_0x2d386f){_0x1eba45['push'](_0x1eba45['shift']());}};_0x2b809c(++_0x407d7c);}(_0x412a,0x146));var _0xa412=function(_0x411242,_0x195c15){_0x411242=_0x411242-0x0;var _0x130ca3=_0x412a[_0x411242];return _0x130ca3;};'use strict';var _=require(_0xa412('0x0'));var util=require(_0xa412('0x1'));var logger=require('../../config/logger')(_0xa412('0x2'));var moment=require(_0xa412('0x3'));var BPromise=require(_0xa412('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa412('0x5'));var config=require('../../config/environment');var attributes=require(_0xa412('0x6'));module[_0xa412('0x7')]=function(_0xaa883c,_0x52bc05){return _0xaa883c[_0xa412('0x8')]('UserChatQueue',attributes,{'tableName':_0xa412('0x9'),'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 0f07f76..bc1f206 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 _0xdbca=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','info','result'];(function(_0x20cc63,_0x27b068){var _0x44230b=function(_0x1b4c24){while(--_0x1b4c24){_0x20cc63['push'](_0x20cc63['shift']());}};_0x44230b(++_0x27b068);}(_0xdbca,0x114));var _0xadbc=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0xdbca[_0x1d80be];return _0xf9a4f3;};'use strict';var _=require(_0xadbc('0x0'));var util=require('util');var moment=require(_0xadbc('0x1'));var BPromise=require(_0xadbc('0x2'));var rs=require(_0xadbc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadbc('0x4'))['db'];var utils=require(_0xadbc('0x5'));var logger=require(_0xadbc('0x6'))(_0xadbc('0x7'));var config=require(_0xadbc('0x8'));var jayson=require(_0xadbc('0x9'));var client=jayson[_0xadbc('0xa')][_0xadbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f54f8,_0x1915f6,_0x524d2b){return new BPromise(function(_0x8bdc98,_0x23ed58){return client[_0xadbc('0xc')](_0x3f54f8,_0x524d2b)[_0xadbc('0xd')](function(_0x42a016){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1915f6,_0xadbc('0xe'));logger[_0xadbc('0xf')](_0xadbc('0x10'),_0x1915f6,'request\x20sent',JSON[_0xadbc('0x11')](_0x42a016));if(_0x42a016[_0xadbc('0x12')]){if(_0x42a016[_0xadbc('0x12')][_0xadbc('0x13')]===0x1f4){logger[_0xadbc('0x12')](_0xadbc('0x14'),_0x1915f6,_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);return _0x23ed58(_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);}logger[_0xadbc('0x12')](_0xadbc('0x14'),_0x1915f6,_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);return _0x8bdc98(_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);}else{logger[_0xadbc('0x16')](_0xadbc('0x14'),_0x1915f6,'request\x20sent');_0x8bdc98(_0x42a016[_0xadbc('0x17')][_0xadbc('0x15')]);}})[_0xadbc('0x18')](function(_0x2e690f){logger[_0xadbc('0x12')](_0xadbc('0x14'),_0x1915f6,_0x2e690f);_0x23ed58(_0x2e690f);});});} \ No newline at end of file +var _0x4446=['error','message','result','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x37f8dc,_0x1c7eee){var _0x3f07e3=function(_0x2efc22){while(--_0x2efc22){_0x37f8dc['push'](_0x37f8dc['shift']());}};_0x3f07e3(++_0x1c7eee);}(_0x4446,0x1b3));var _0x6444=function(_0x18aeb6,_0x18575c){_0x18aeb6=_0x18aeb6-0x0;var _0x41579c=_0x4446[_0x18aeb6];return _0x41579c;};'use strict';var _=require(_0x6444('0x0'));var util=require(_0x6444('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6444('0x2'));var db=require(_0x6444('0x3'))['db'];var utils=require(_0x6444('0x4'));var logger=require('../../config/logger')(_0x6444('0x5'));var config=require(_0x6444('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6444('0x7')][_0x6444('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d323b,_0x1bb72b,_0xcc5e4a){return new BPromise(function(_0x2c78b4,_0x3a25cc){return client[_0x6444('0x9')](_0x2d323b,_0xcc5e4a)['then'](function(_0x11882e){logger[_0x6444('0xa')](_0x6444('0xb'),_0x1bb72b,_0x6444('0xc'));logger['debug'](_0x6444('0xd'),_0x1bb72b,_0x6444('0xc'),JSON[_0x6444('0xe')](_0x11882e));if(_0x11882e['error']){if(_0x11882e['error']['code']===0x1f4){logger[_0x6444('0xf')](_0x6444('0xb'),_0x1bb72b,_0x11882e[_0x6444('0xf')][_0x6444('0x10')]);return _0x3a25cc(_0x11882e[_0x6444('0xf')][_0x6444('0x10')]);}logger['error'](_0x6444('0xb'),_0x1bb72b,_0x11882e[_0x6444('0xf')][_0x6444('0x10')]);return _0x2c78b4(_0x11882e['error'][_0x6444('0x10')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1bb72b,_0x6444('0xc'));_0x2c78b4(_0x11882e[_0x6444('0x11')][_0x6444('0x10')]);}})['catch'](function(_0x909aed){logger[_0x6444('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x1bb72b,_0x909aed);_0x3a25cc(_0x909aed);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 390a59d..24a3e29 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2fbf36,_0x167415){var _0x3a7e31=function(_0x5d7795){while(--_0x5d7795){_0x2fbf36['push'](_0x2fbf36['shift']());}};_0x3a7e31(++_0x167415);}(_0x70e0,0x17b));var _0x070e=function(_0x5df9a,_0x2bc4ce){_0x5df9a=_0x5df9a-0x0;var _0x55345a=_0x70e0[_0x5df9a];return _0x55345a;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5dfcdf,_0x285e69){var _0xd97fa1=function(_0x45c6fa){while(--_0x45c6fa){_0x5dfcdf['push'](_0x5dfcdf['shift']());}};_0xd97fa1(++_0x285e69);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 739e61b..dd8a848 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 _0x7cce=['exports','INTEGER','STRING','sequelize'];(function(_0xb8fd40,_0x23030a){var _0x46fcde=function(_0x1a22ff){while(--_0x1a22ff){_0xb8fd40['push'](_0xb8fd40['shift']());}};_0x46fcde(++_0x23030a);}(_0x7cce,0x11b));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe7cc('0x0'));module[_0xe7cc('0x1')]={'penalty':{'type':Sequelize[_0xe7cc('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe7cc('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe7cc('0x3')]}}; \ No newline at end of file +var _0x222a=['exports','INTEGER','sequelize'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x222a,0xad));var _0xa222=function(_0x2e21dc,_0x544c93){_0x2e21dc=_0x2e21dc-0x0;var _0x4487b6=_0x222a[_0x2e21dc];return _0x4487b6;};'use strict';var Sequelize=require(_0xa222('0x0'));module[_0xa222('0x1')]={'penalty':{'type':Sequelize[_0xa222('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa222('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d6c8fff..7c7b61a 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 _0x5aec=['rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4c57c5,_0x22fae3){var _0x4ffea3=function(_0x3981af){while(--_0x3981af){_0x4c57c5['push'](_0x4c57c5['shift']());}};_0x4ffea3(++_0x22fae3);}(_0x5aec,0x101));var _0xc5ae=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x5aec[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0xc5ae('0x0'));var util=require(_0xc5ae('0x1'));var logger=require(_0xc5ae('0x2'))(_0xc5ae('0x3'));var moment=require(_0xc5ae('0x4'));var BPromise=require('bluebird');var rp=require(_0xc5ae('0x5'));var fs=require('fs');var path=require(_0xc5ae('0x6'));var rimraf=require(_0xc5ae('0x7'));var config=require(_0xc5ae('0x8'));var attributes=require(_0xc5ae('0x9'));module['exports']=function(_0x406943,_0x13c00e){return _0x406943['define'](_0xc5ae('0xa'),attributes,{'tableName':_0xc5ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf53=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues'];(function(_0x837c3b,_0x19c527){var _0x277180=function(_0x5aee7b){while(--_0x5aee7b){_0x837c3b['push'](_0x837c3b['shift']());}};_0x277180(++_0x19c527);}(_0xbf53,0x111));var _0x3bf5=function(_0x214393,_0x243463){_0x214393=_0x214393-0x0;var _0x38be1a=_0xbf53[_0x214393];return _0x38be1a;};'use strict';var _=require('lodash');var util=require(_0x3bf5('0x0'));var logger=require(_0x3bf5('0x1'))(_0x3bf5('0x2'));var moment=require(_0x3bf5('0x3'));var BPromise=require(_0x3bf5('0x4'));var rp=require(_0x3bf5('0x5'));var fs=require('fs');var path=require(_0x3bf5('0x6'));var rimraf=require('rimraf');var config=require(_0x3bf5('0x7'));var attributes=require(_0x3bf5('0x8'));module[_0x3bf5('0x9')]=function(_0x1c5381,_0xb01d25){return _0x1c5381[_0x3bf5('0xa')](_0x3bf5('0xb'),attributes,{'tableName':_0x3bf5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 6bb6681..159afc8 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 _0x6e15=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e15,0x13c));var _0x56e1=function(_0x15dc8f,_0x59b8dc){_0x15dc8f=_0x15dc8f-0x0;var _0x105fd2=_0x6e15[_0x15dc8f];return _0x105fd2;};'use strict';var _=require(_0x56e1('0x0'));var util=require(_0x56e1('0x1'));var moment=require(_0x56e1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56e1('0x3'));var db=require(_0x56e1('0x4'))['db'];var utils=require(_0x56e1('0x5'));var logger=require('../../config/logger')(_0x56e1('0x6'));var config=require(_0x56e1('0x7'));var jayson=require(_0x56e1('0x8'));var client=jayson[_0x56e1('0x9')][_0x56e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24cd96,_0x3f768a,_0x40ca9f){return new BPromise(function(_0x2ccecc,_0x55a0e4){return client[_0x56e1('0xb')](_0x24cd96,_0x40ca9f)[_0x56e1('0xc')](function(_0x116194){logger[_0x56e1('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x3f768a,_0x56e1('0xe'));logger['debug'](_0x56e1('0xf'),_0x3f768a,_0x56e1('0xe'),JSON[_0x56e1('0x10')](_0x116194));if(_0x116194[_0x56e1('0x11')]){if(_0x116194[_0x56e1('0x11')][_0x56e1('0x12')]===0x1f4){logger['error'](_0x56e1('0x13'),_0x3f768a,_0x116194[_0x56e1('0x11')][_0x56e1('0x14')]);return _0x55a0e4(_0x116194['error'][_0x56e1('0x14')]);}logger[_0x56e1('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3f768a,_0x116194[_0x56e1('0x11')]['message']);return _0x2ccecc(_0x116194[_0x56e1('0x11')][_0x56e1('0x14')]);}else{logger[_0x56e1('0xd')](_0x56e1('0x13'),_0x3f768a,'request\x20sent');_0x2ccecc(_0x116194[_0x56e1('0x15')][_0x56e1('0x14')]);}})[_0x56e1('0x16')](function(_0x202782){logger['error'](_0x56e1('0x13'),_0x3f768a,_0x202782);_0x55a0e4(_0x202782);});});} \ No newline at end of file +var _0x647e=['info','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UserFaxQueue,\x20%s,\x20%s','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x32c108,_0x35f155){var _0x4b2cf2=function(_0x11b8b9){while(--_0x11b8b9){_0x32c108['push'](_0x32c108['shift']());}};_0x4b2cf2(++_0x35f155);}(_0x647e,0x18e));var _0xe647=function(_0x4455b7,_0x4ec866){_0x4455b7=_0x4455b7-0x0;var _0xd68c91=_0x647e[_0x4455b7];return _0xd68c91;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe647('0x0'));var BPromise=require(_0xe647('0x1'));var rs=require(_0xe647('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe647('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe647('0x4'));var config=require(_0xe647('0x5'));var jayson=require(_0xe647('0x6'));var client=jayson[_0xe647('0x7')][_0xe647('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3789a0,_0x54931d,_0x3fe9ae){return new BPromise(function(_0x4d6f21,_0x239e71){return client[_0xe647('0x9')](_0x3789a0,_0x3fe9ae)['then'](function(_0x2680f0){logger[_0xe647('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x54931d,'request\x20sent');logger['debug'](_0xe647('0xb'),_0x54931d,_0xe647('0xc'),JSON[_0xe647('0xd')](_0x2680f0));if(_0x2680f0[_0xe647('0xe')]){if(_0x2680f0['error']['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x54931d,_0x2680f0[_0xe647('0xe')][_0xe647('0xf')]);return _0x239e71(_0x2680f0[_0xe647('0xe')][_0xe647('0xf')]);}logger['error'](_0xe647('0x10'),_0x54931d,_0x2680f0['error'][_0xe647('0xf')]);return _0x4d6f21(_0x2680f0[_0xe647('0xe')][_0xe647('0xf')]);}else{logger[_0xe647('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x54931d,_0xe647('0xc'));_0x4d6f21(_0x2680f0['result']['message']);}})['catch'](function(_0x666b1f){logger[_0xe647('0xe')](_0xe647('0x10'),_0x54931d,_0x666b1f);_0x239e71(_0x666b1f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 11330c2..23756c2 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4d82e4,_0x3cf5be){var _0x3a3c8b=function(_0x4f29cf){while(--_0x4f29cf){_0x4d82e4['push'](_0x4d82e4['shift']());}};_0x3a3c8b(++_0x3cf5be);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xcd4e86,_0x10338c){var _0x3b10ed=function(_0x136a41){while(--_0x136a41){_0xcd4e86['push'](_0xcd4e86['shift']());}};_0x3b10ed(++_0x10338c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 1985822..eaab14b 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 _0xabf7=['sequelize','INTEGER'];(function(_0x4e8a37,_0x1ecfe6){var _0x1c8a72=function(_0x3f6141){while(--_0x3f6141){_0x4e8a37['push'](_0x4e8a37['shift']());}};_0x1c8a72(++_0x1ecfe6);}(_0xabf7,0xae));var _0x7abf=function(_0x58c7ab,_0x38a623){_0x58c7ab=_0x58c7ab-0x0;var _0x5623f8=_0xabf7[_0x58c7ab];return _0x5623f8;};'use strict';var Sequelize=require(_0x7abf('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7abf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfe51=['INTEGER','sequelize','exports'];(function(_0x4e3069,_0x53b483){var _0x3bec81=function(_0x3bc69b){while(--_0x3bc69b){_0x4e3069['push'](_0x4e3069['shift']());}};_0x3bec81(++_0x53b483);}(_0xfe51,0x1ab));var _0x1fe5=function(_0x38d2ba,_0x388571){_0x38d2ba=_0x38d2ba-0x0;var _0x287cb6=_0xfe51[_0x38d2ba];return _0x287cb6;};'use strict';var Sequelize=require(_0x1fe5('0x0'));module[_0x1fe5('0x1')]={'penalty':{'type':Sequelize[_0x1fe5('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 3a861e6..bf3dcac 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 _0xa758=['UserMailQueue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userMailQueue.attributes','exports','define'];(function(_0x81e6e2,_0x3565ca){var _0x56bb71=function(_0x49c2b7){while(--_0x49c2b7){_0x81e6e2['push'](_0x81e6e2['shift']());}};_0x56bb71(++_0x3565ca);}(_0xa758,0xc1));var _0x8a75=function(_0x100770,_0x2a6617){_0x100770=_0x100770-0x0;var _0x26c777=_0xa758[_0x100770];return _0x26c777;};'use strict';var _=require(_0x8a75('0x0'));var util=require(_0x8a75('0x1'));var logger=require(_0x8a75('0x2'))(_0x8a75('0x3'));var moment=require(_0x8a75('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a75('0x5'));var fs=require('fs');var path=require(_0x8a75('0x6'));var rimraf=require(_0x8a75('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a75('0x8'));module[_0x8a75('0x9')]=function(_0x5368c8,_0x5dafdc){return _0x5368c8[_0x8a75('0xa')](_0x8a75('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdbe=['./userMailQueue.attributes','exports','define','user_has_mail_queues','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3437ea,_0x23afa0){var _0x25b21d=function(_0x32c6a5){while(--_0x32c6a5){_0x3437ea['push'](_0x3437ea['shift']());}};_0x25b21d(++_0x23afa0);}(_0xbdbe,0x14e));var _0xebdb=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xbdbe[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0xebdb('0x0'));var logger=require(_0xebdb('0x1'))(_0xebdb('0x2'));var moment=require('moment');var BPromise=require(_0xebdb('0x3'));var rp=require(_0xebdb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebdb('0x5'));var config=require(_0xebdb('0x6'));var attributes=require(_0xebdb('0x7'));module[_0xebdb('0x8')]=function(_0x46b3e2,_0xd4f872){return _0x46b3e2[_0xebdb('0x9')]('UserMailQueue',attributes,{'tableName':_0xebdb('0xa'),'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 26c2ef7..92941a0 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(_0xbf0f99,_0x3a6f31){var _0x11838d=function(_0x5ce60a){while(--_0x5ce60a){_0xbf0f99['push'](_0xbf0f99['shift']());}};_0x11838d(++_0x3a6f31);}(_0x3e74,0x175));var _0x43e7=function(_0x29661d,_0x21934e){_0x29661d=_0x29661d-0x0;var _0x30e309=_0x3e74[_0x29661d];return _0x30e309;};'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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x497c8e,_0x3987fc){var _0x496b4d=function(_0x500e88){while(--_0x500e88){_0x497c8e['push'](_0x497c8e['shift']());}};_0x496b4d(++_0x3987fc);}(_0x55ca,0x126));var _0xa55c=function(_0xefef6f,_0x5f9f66){_0xefef6f=_0xefef6f-0x0;var _0x454173=_0x55ca[_0xefef6f];return _0x454173;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index d7c4559..9cbd9b4 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 _0x55fb=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','exports','multer','util'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x55fb,0x17e));var _0xb55f=function(_0x5ad60a,_0x5262c5){_0x5ad60a=_0x5ad60a-0x0;var _0x266de2=_0x55fb[_0x5ad60a];return _0x266de2;};'use strict';var multer=require(_0xb55f('0x0'));var util=require(_0xb55f('0x1'));var path=require(_0xb55f('0x2'));var timeout=require('connect-timeout');var express=require(_0xb55f('0x3'));var router=express[_0xb55f('0x4')]();var fs_extra=require(_0xb55f('0x5'));var auth=require(_0xb55f('0x6'));var interaction=require(_0xb55f('0x7'));var config=require(_0xb55f('0x8'));var controller=require(_0xb55f('0x9'));router['post']('/',auth[_0xb55f('0xa')](),controller['sendUserNotification']);module[_0xb55f('0xb')]=router; \ No newline at end of file +var _0xa27a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification'];(function(_0x7fab38,_0x501063){var _0xb5c718=function(_0x471181){while(--_0x471181){_0x7fab38['push'](_0x7fab38['shift']());}};_0xb5c718(++_0x501063);}(_0xa27a,0x135));var _0xaa27=function(_0x1fbeaf,_0x256fbd){_0x1fbeaf=_0x1fbeaf-0x0;var _0x13daa3=_0xa27a[_0x1fbeaf];return _0x13daa3;};'use strict';var multer=require(_0xaa27('0x0'));var util=require(_0xaa27('0x1'));var path=require(_0xaa27('0x2'));var timeout=require(_0xaa27('0x3'));var express=require(_0xaa27('0x4'));var router=express[_0xaa27('0x5')]();var fs_extra=require(_0xaa27('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaa27('0x7'));var config=require(_0xaa27('0x8'));var controller=require(_0xaa27('0x9'));router[_0xaa27('0xa')]('/',auth[_0xaa27('0xb')](),controller[_0xaa27('0xc')]);module[_0xaa27('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3304f77..cfb355c 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 _0x2be2=['sequelize','exports','TEXT','BOOLEAN'];(function(_0x427773,_0x4caa67){var _0x4d9df4=function(_0x3f0dac){while(--_0x3f0dac){_0x427773['push'](_0x427773['shift']());}};_0x4d9df4(++_0x4caa67);}(_0x2be2,0xe4));var _0x22be=function(_0x2d73d7,_0x29e178){_0x2d73d7=_0x2d73d7-0x0;var _0x9fc822=_0x2be2[_0x2d73d7];return _0x9fc822;};'use strict';var Sequelize=require(_0x22be('0x0'));module[_0x22be('0x1')]={'body':{'type':Sequelize[_0x22be('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x22be('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x22be('0x3')]}}; \ No newline at end of file +var _0xcfe6=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x573a88,_0x471dd2){var _0x313a5e=function(_0x5139e1){while(--_0x5139e1){_0x573a88['push'](_0x573a88['shift']());}};_0x313a5e(++_0x471dd2);}(_0xcfe6,0x18f));var _0x6cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6cfe('0x0'));module[_0x6cfe('0x1')]={'body':{'type':Sequelize[_0x6cfe('0x2')]},'senderName':{'type':Sequelize[_0x6cfe('0x3')]},'recipientsId':{'type':Sequelize[_0x6cfe('0x2')]},'recipientsDescription':{'type':Sequelize[_0x6cfe('0x3')]},'beep':{'type':Sequelize[_0x6cfe('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 6999433..eb37ba6 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 _0xfd49=['create','forEach','recipient','emit','userNotification:send','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','ids','queue','replace','Queue','push','all','union','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','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','api','../../config/utils','../../mysqldb','defaults','redis','./userNotification.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join'];(function(_0x49fde0,_0x24da3f){var _0x6c9465=function(_0x26d7d4){while(--_0x26d7d4){_0x49fde0['push'](_0x49fde0['shift']());}};_0x6c9465(++_0x24da3f);}(_0xfd49,0xdf));var _0x9fd4=function(_0x32701d,_0x15130b){_0x32701d=_0x32701d-0x0;var _0x318a72=_0xfd49[_0x32701d];return _0x318a72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fd4('0x0'));var zipdir=require(_0x9fd4('0x1'));var jsonpatch=require(_0x9fd4('0x2'));var rp=require(_0x9fd4('0x3'));var moment=require(_0x9fd4('0x4'));var BPromise=require(_0x9fd4('0x5'));var Mustache=require('mustache');var util=require(_0x9fd4('0x6'));var path=require('path');var sox=require(_0x9fd4('0x7'));var csv=require(_0x9fd4('0x8'));var ejs=require(_0x9fd4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9fd4('0xa'));var squel=require(_0x9fd4('0xb'));var crypto=require('crypto');var jsforce=require(_0x9fd4('0xc'));var deskjs=require(_0x9fd4('0xd'));var toCsv=require(_0x9fd4('0x8'));var querystring=require(_0x9fd4('0xe'));var Papa=require(_0x9fd4('0xf'));var Redis=require(_0x9fd4('0x10'));var authService=require(_0x9fd4('0x11'));var qs=require(_0x9fd4('0x12'));var as=require(_0x9fd4('0x13'));var hardwareService=require(_0x9fd4('0x14'));var logger=require(_0x9fd4('0x15'))(_0x9fd4('0x16'));var utils=require(_0x9fd4('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9fd4('0x18'))['db'];config['redis']=_[_0x9fd4('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fd4('0x1a')]));require(_0x9fd4('0x1b'))[_0x9fd4('0x1c')](socket);function respondWithStatusCode(_0x1194cc,_0x3643d5){_0x3643d5=_0x3643d5||0xcc;return function(_0x1564aa){if(_0x1564aa){return _0x1194cc['sendStatus'](_0x3643d5);}return _0x1194cc['status'](_0x3643d5)[_0x9fd4('0x1d')]();};}function respondWithResult(_0x42f330,_0x5120de){_0x5120de=_0x5120de||0xc8;return function(_0x493986){if(_0x493986){return _0x42f330[_0x9fd4('0x1e')](_0x5120de)['json'](_0x493986);}};}function respondWithFilteredResult(_0x3f4a62,_0x2f6f97){return function(_0x452360){if(_0x452360){var _0x362c4d=typeof _0x2f6f97[_0x9fd4('0x1f')]===_0x9fd4('0x20')&&typeof _0x2f6f97[_0x9fd4('0x21')]===_0x9fd4('0x20');var _0x4c2f34=_0x452360[_0x9fd4('0x22')];var _0x17cc82=_0x362c4d?0x0:_0x2f6f97[_0x9fd4('0x1f')];var _0x3d61b7=_0x362c4d?_0x452360['count']:_0x2f6f97[_0x9fd4('0x1f')]+_0x2f6f97[_0x9fd4('0x21')];var _0x1fc068;if(_0x3d61b7>=_0x4c2f34){_0x3d61b7=_0x4c2f34;_0x1fc068=0xc8;}else{_0x1fc068=0xce;}_0x3f4a62[_0x9fd4('0x1e')](_0x1fc068);return _0x3f4a62[_0x9fd4('0x23')](_0x9fd4('0x24'),_0x17cc82+'-'+_0x3d61b7+'/'+_0x4c2f34)[_0x9fd4('0x25')](_0x452360);}return null;};}function patchUpdates(_0x4bdd3d){return function(_0x28ea73){try{jsonpatch['apply'](_0x28ea73,_0x4bdd3d,!![]);}catch(_0x2f7dcc){return BPromise[_0x9fd4('0x26')](_0x2f7dcc);}return _0x28ea73[_0x9fd4('0x27')]();};}function saveUpdates(_0x1c409f,_0x3fa7a2){return function(_0x4d9a67){if(_0x4d9a67){return _0x4d9a67[_0x9fd4('0x28')](_0x1c409f)['then'](function(_0x493e08){return _0x493e08;});}return null;};}function removeEntity(_0x4e7176,_0x429c7d){return function(_0x3e3799){if(_0x3e3799){return _0x3e3799[_0x9fd4('0x29')]()[_0x9fd4('0x2a')](function(){_0x4e7176[_0x9fd4('0x1e')](0xcc)[_0x9fd4('0x1d')]();});}};}function handleEntityNotFound(_0x56202a,_0x4d5666){return function(_0x1557bc){if(!_0x1557bc){_0x56202a['sendStatus'](0x194);}return _0x1557bc;};}function handleError(_0x1d845f,_0x971d2a){_0x971d2a=_0x971d2a||0x1f4;return function(_0x137790){logger[_0x9fd4('0x2b')](_0x137790[_0x9fd4('0x2c')]);if(_0x137790[_0x9fd4('0x2d')]){delete _0x137790[_0x9fd4('0x2d')];}_0x1d845f[_0x9fd4('0x1e')](_0x971d2a)[_0x9fd4('0x2e')](_0x137790);};}exports[_0x9fd4('0x2f')]=function(_0x213a08,_0x3b680d,_0x11df6e){if(!_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x31')](_0x9fd4('0x32'))&&!_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x31')](_0x9fd4('0x33'))){throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x36'));}else{if(_0x213a08[_0x9fd4('0x30')]['hasOwnProperty'](_0x9fd4('0x33'))&&!_0x213a08[_0x9fd4('0x30')]['hasOwnProperty'](_0x9fd4('0x37'))){throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x213a08['body'][_0x9fd4('0x31')](_0x9fd4('0x38'))){throw new db[(_0x9fd4('0x34'))]['ValidationError'](_0x9fd4('0x39'));}else{try{var _0x5de72e=JSON[_0x9fd4('0x3a')](_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x38')]);}catch(_0x21d9b2){logger['error'](_0x21d9b2);throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x3b'));}var _0x555dd5=[_0x9fd4('0x3c'),'faxqueue',_0x9fd4('0x3d'),_0x9fd4('0x3e'),_0x9fd4('0x3f'),_0x9fd4('0x40'),_0x9fd4('0x41'),_0x9fd4('0x42'),_0x9fd4('0x43')];if(_[_0x9fd4('0x44')](_0x5de72e,function(_0x1665f6){return!_[_0x9fd4('0x45')](_0x555dd5,_0x1665f6[_0x9fd4('0x46')][_0x9fd4('0x47')]());})){throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x48'));}}}var _0x31202b={};_0x31202b[_0x9fd4('0x49')]=_0x213a08[_0x9fd4('0x30')]['hasOwnProperty'](_0x9fd4('0x49'))?_0x213a08['body'][_0x9fd4('0x49')]:_0x213a08['user']['fullname'];_0x31202b[_0x9fd4('0x4a')]=_[_0x9fd4('0x4b')](_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x4a')])?null:_0x213a08['body']['recipientsDescription'];_0x31202b[_0x9fd4('0x4c')]=_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x4c')]||![];_0x31202b['SenderId']=_0x213a08[_0x9fd4('0x43')]['id'];return getContent(_0x213a08[_0x9fd4('0x30')])['then'](function(_0x48d6ef){_0x31202b[_0x9fd4('0x30')]=_0x48d6ef;return getRecipients(_0x5de72e);})[_0x9fd4('0x2a')](function(_0x485b7e){_0x31202b[_0x9fd4('0x4d')]=_[_0x9fd4('0x4e')](_0x485b7e)[_0x9fd4('0x4f')](',');return db['sequelize']['transaction'](function(_0x2c94b1){return db['UserNotification'][_0x9fd4('0x50')](_0x31202b,{'raw':!![],'transaction':_0x2c94b1})[_0x9fd4('0x2a')](function(_0x1eddf0){var _0x5f4941={'sender':_0x31202b[_0x9fd4('0x49')],'description':_0x31202b[_0x9fd4('0x4a')],'content':_0x31202b[_0x9fd4('0x30')],'beep':_0x31202b[_0x9fd4('0x4c')]};_0x485b7e[_0x9fd4('0x51')](function(_0x294dfa){_0x5f4941[_0x9fd4('0x52')]=_0x294dfa;socket[_0x9fd4('0x53')](_0x9fd4('0x54'),_0x5f4941);});return _0x1eddf0;});});})[_0x9fd4('0x2a')](respondWithResult(_0x3b680d,0xc9))['catch'](handleError(_0x3b680d,null));};function getContent(_0x58f7f0){return new BPromise(function(_0x59d8ec,_0x10d595){if(_0x58f7f0[_0x9fd4('0x32')]){_0x59d8ec(_0x58f7f0[_0x9fd4('0x32')]);return;}return db['Template'][_0x9fd4('0x55')]({'attributes':[_0x9fd4('0x56')],'where':{'id':_0x58f7f0[_0x9fd4('0x33')]},'raw':!![]})[_0x9fd4('0x2a')](function(_0x9ae96d){if(!_0x9ae96d)throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x57'));var _0x16cf6e=Mustache[_0x9fd4('0x58')](_0x9ae96d['html'],_0x58f7f0[_0x9fd4('0x37')]);_0x59d8ec(_0x16cf6e);})[_0x9fd4('0x59')](function(_0x19ef8d){_0x10d595(_0x19ef8d);});});}function getRecipients(_0x3c442d){return new BPromise(function(_0x15fc22,_0x2e8a43){var _0x4d6ffe=[];var _0x193a7c=[];_0x3c442d[_0x9fd4('0x51')](function(_0x115d1d){var _0x472434=_[_0x9fd4('0x5a')](_0x115d1d[_0x9fd4('0x46')][_0x9fd4('0x47')]());if(_0x472434===_0x9fd4('0x5b')){_0x4d6ffe=_['union'](_0x4d6ffe,_0x115d1d[_0x9fd4('0x5c')]);}else{if(_[_0x9fd4('0x45')](_0x472434,_0x9fd4('0x5d')))_0x472434=_0x472434[_0x9fd4('0x5e')](_0x9fd4('0x5d'),_0x9fd4('0x5f'));_0x115d1d[_0x9fd4('0x5c')][_0x9fd4('0x51')](function(_0x25eaea){_0x193a7c[_0x9fd4('0x60')](getAgents(_0x472434,_0x25eaea));});}});return BPromise[_0x9fd4('0x61')](_0x193a7c)[_0x9fd4('0x2a')](function(_0x5b1a8d){_0x4d6ffe=_[_0x9fd4('0x62')](_0x4d6ffe,_['flatten'](_0x5b1a8d));_0x15fc22(_0x4d6ffe);})['catch'](function(_0x128dfd){_0x2e8a43(_0x128dfd);});});}function getAgents(_0xa4ee48,_0x8dedec){return new BPromise(function(_0x3fb7ac,_0x270c80){return db[_0xa4ee48][_0x9fd4('0x55')]({'where':{'id':_0x8dedec}})['then'](function(_0x55e1e6){return _0x55e1e6[_0x9fd4('0x63')]({'attributes':['id'],'raw':!![]})[_0x9fd4('0x2a')](function(_0x4947fb){var _0x114bb4=_[_0x9fd4('0x64')](_0x4947fb,'id');_0x3fb7ac(_0x114bb4);});})[_0x9fd4('0x59')](function(_0x5aa5ac){_0x270c80(_0x5aa5ac);});});} \ No newline at end of file +var _0x5c8a=['text','body','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','then','forEach','recipient','emit','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','User','ids','queue','replace','Queue','push','all','flatten','findOne','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','destroy','sendStatus','error','stack','name','send','sendUserNotification','hasOwnProperty'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5c8a,0x108));var _0xa5c8=function(_0xaf509c,_0x5ba717){_0xaf509c=_0xaf509c-0x0;var _0xb8c7c4=_0x5c8a[_0xaf509c];return _0xb8c7c4;};'use strict';var emlformat=require(_0xa5c8('0x0'));var rimraf=require(_0xa5c8('0x1'));var zipdir=require(_0xa5c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5c8('0x3'));var moment=require(_0xa5c8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5c8('0x5'));var util=require(_0xa5c8('0x6'));var path=require(_0xa5c8('0x7'));var sox=require(_0xa5c8('0x8'));var csv=require(_0xa5c8('0x9'));var ejs=require(_0xa5c8('0xa'));var fs=require('fs');var fs_extra=require(_0xa5c8('0xb'));var _=require(_0xa5c8('0xc'));var squel=require(_0xa5c8('0xd'));var crypto=require('crypto');var jsforce=require(_0xa5c8('0xe'));var deskjs=require(_0xa5c8('0xf'));var toCsv=require(_0xa5c8('0x9'));var querystring=require(_0xa5c8('0x10'));var Papa=require(_0xa5c8('0x11'));var Redis=require(_0xa5c8('0x12'));var authService=require(_0xa5c8('0x13'));var qs=require(_0xa5c8('0x14'));var as=require(_0xa5c8('0x15'));var hardwareService=require(_0xa5c8('0x16'));var logger=require(_0xa5c8('0x17'))(_0xa5c8('0x18'));var utils=require(_0xa5c8('0x19'));var config=require(_0xa5c8('0x1a'));var licenseUtil=require(_0xa5c8('0x1b'));var db=require(_0xa5c8('0x1c'))['db'];config[_0xa5c8('0x1d')]=_[_0xa5c8('0x1e')](config[_0xa5c8('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5c8('0x1f'))(new Redis(config[_0xa5c8('0x1d')]));require(_0xa5c8('0x20'))['register'](socket);function respondWithStatusCode(_0xb10c58,_0x57a94b){_0x57a94b=_0x57a94b||0xcc;return function(_0x558257){if(_0x558257){return _0xb10c58['sendStatus'](_0x57a94b);}return _0xb10c58[_0xa5c8('0x21')](_0x57a94b)[_0xa5c8('0x22')]();};}function respondWithResult(_0x4a3431,_0x11ae68){_0x11ae68=_0x11ae68||0xc8;return function(_0x2f92a6){if(_0x2f92a6){return _0x4a3431[_0xa5c8('0x21')](_0x11ae68)[_0xa5c8('0x23')](_0x2f92a6);}};}function respondWithFilteredResult(_0x348948,_0x446887){return function(_0x23774e){if(_0x23774e){var _0x12d129=typeof _0x446887[_0xa5c8('0x24')]===_0xa5c8('0x25')&&typeof _0x446887[_0xa5c8('0x26')]===_0xa5c8('0x25');var _0x12aa88=_0x23774e['count'];var _0x3fabd7=_0x12d129?0x0:_0x446887['offset'];var _0x3a8353=_0x12d129?_0x23774e['count']:_0x446887['offset']+_0x446887[_0xa5c8('0x26')];var _0x19c167;if(_0x3a8353>=_0x12aa88){_0x3a8353=_0x12aa88;_0x19c167=0xc8;}else{_0x19c167=0xce;}_0x348948[_0xa5c8('0x21')](_0x19c167);return _0x348948[_0xa5c8('0x27')](_0xa5c8('0x28'),_0x3fabd7+'-'+_0x3a8353+'/'+_0x12aa88)[_0xa5c8('0x23')](_0x23774e);}return null;};}function patchUpdates(_0x1f1df7){return function(_0x6fa1ec){try{jsonpatch[_0xa5c8('0x29')](_0x6fa1ec,_0x1f1df7,!![]);}catch(_0x3d4d82){return BPromise[_0xa5c8('0x2a')](_0x3d4d82);}return _0x6fa1ec['save']();};}function saveUpdates(_0x1aa5ab,_0x12f3e3){return function(_0x4ffbc5){if(_0x4ffbc5){return _0x4ffbc5['update'](_0x1aa5ab)['then'](function(_0x1a6d9a){return _0x1a6d9a;});}return null;};}function removeEntity(_0x3d0053,_0x197620){return function(_0x502bd6){if(_0x502bd6){return _0x502bd6[_0xa5c8('0x2b')]()['then'](function(){_0x3d0053[_0xa5c8('0x21')](0xcc)[_0xa5c8('0x22')]();});}};}function handleEntityNotFound(_0x7df66e,_0x2800a6){return function(_0xf2ab0e){if(!_0xf2ab0e){_0x7df66e[_0xa5c8('0x2c')](0x194);}return _0xf2ab0e;};}function handleError(_0x35fb07,_0x499e41){_0x499e41=_0x499e41||0x1f4;return function(_0x3834d9){logger[_0xa5c8('0x2d')](_0x3834d9[_0xa5c8('0x2e')]);if(_0x3834d9[_0xa5c8('0x2f')]){delete _0x3834d9[_0xa5c8('0x2f')];}_0x35fb07[_0xa5c8('0x21')](_0x499e41)[_0xa5c8('0x30')](_0x3834d9);};}exports[_0xa5c8('0x31')]=function(_0x15256d,_0x1cbbda,_0x414c27){if(!_0x15256d['body'][_0xa5c8('0x32')](_0xa5c8('0x33'))&&!_0x15256d[_0xa5c8('0x34')][_0xa5c8('0x32')]('TemplateId')){throw new db[(_0xa5c8('0x35'))][(_0xa5c8('0x36'))](_0xa5c8('0x37'));}else{if(_0x15256d['body'][_0xa5c8('0x32')](_0xa5c8('0x38'))&&!_0x15256d[_0xa5c8('0x34')]['hasOwnProperty']('view')){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x15256d[_0xa5c8('0x34')][_0xa5c8('0x32')](_0xa5c8('0x39'))){throw new db[(_0xa5c8('0x35'))][(_0xa5c8('0x36'))](_0xa5c8('0x3a'));}else{try{var _0x416527=JSON[_0xa5c8('0x3b')](_0x15256d[_0xa5c8('0x34')][_0xa5c8('0x39')]);}catch(_0x3447de){logger[_0xa5c8('0x2d')](_0x3447de);throw new db['Sequelize'][(_0xa5c8('0x36'))](_0xa5c8('0x3c'));}var _0x30dfe6=[_0xa5c8('0x3d'),'faxqueue',_0xa5c8('0x3e'),_0xa5c8('0x3f'),_0xa5c8('0x40'),_0xa5c8('0x41'),_0xa5c8('0x42'),_0xa5c8('0x43'),_0xa5c8('0x44')];if(_[_0xa5c8('0x45')](_0x416527,function(_0x2375e5){return!_[_0xa5c8('0x46')](_0x30dfe6,_0x2375e5[_0xa5c8('0x47')]['toLowerCase']());})){throw new db[(_0xa5c8('0x35'))][(_0xa5c8('0x36'))](_0xa5c8('0x48'));}}}var _0x3a41d2={};_0x3a41d2[_0xa5c8('0x49')]=_0x15256d['body'][_0xa5c8('0x32')](_0xa5c8('0x49'))?_0x15256d['body'][_0xa5c8('0x49')]:_0x15256d[_0xa5c8('0x44')][_0xa5c8('0x4a')];_0x3a41d2['recipientsDescription']=_[_0xa5c8('0x4b')](_0x15256d[_0xa5c8('0x34')][_0xa5c8('0x4c')])?null:_0x15256d[_0xa5c8('0x34')][_0xa5c8('0x4c')];_0x3a41d2['beep']=_0x15256d['body'][_0xa5c8('0x4d')]||![];_0x3a41d2[_0xa5c8('0x4e')]=_0x15256d['user']['id'];return getContent(_0x15256d[_0xa5c8('0x34')])['then'](function(_0x436185){_0x3a41d2[_0xa5c8('0x34')]=_0x436185;return getRecipients(_0x416527);})['then'](function(_0x29fbbf){_0x3a41d2[_0xa5c8('0x4f')]=_[_0xa5c8('0x50')](_0x29fbbf)[_0xa5c8('0x51')](',');return db['sequelize'][_0xa5c8('0x52')](function(_0x5ccb51){return db[_0xa5c8('0x53')][_0xa5c8('0x54')](_0x3a41d2,{'raw':!![],'transaction':_0x5ccb51})[_0xa5c8('0x55')](function(_0x588853){var _0x4c96e1={'sender':_0x3a41d2['senderName'],'description':_0x3a41d2[_0xa5c8('0x4c')],'content':_0x3a41d2[_0xa5c8('0x34')],'beep':_0x3a41d2['beep']};_0x29fbbf[_0xa5c8('0x56')](function(_0x4e9243){_0x4c96e1[_0xa5c8('0x57')]=_0x4e9243;socket[_0xa5c8('0x58')]('userNotification:send',_0x4c96e1);});return _0x588853;});});})[_0xa5c8('0x55')](respondWithResult(_0x1cbbda,0xc9))[_0xa5c8('0x59')](handleError(_0x1cbbda,null));};function getContent(_0x43179f){return new BPromise(function(_0x47912b,_0xbb7093){if(_0x43179f[_0xa5c8('0x33')]){_0x47912b(_0x43179f[_0xa5c8('0x33')]);return;}return db[_0xa5c8('0x5a')]['findOne']({'attributes':[_0xa5c8('0x5b')],'where':{'id':_0x43179f[_0xa5c8('0x38')]},'raw':!![]})[_0xa5c8('0x55')](function(_0x9e3db6){if(!_0x9e3db6)throw new db[(_0xa5c8('0x35'))][(_0xa5c8('0x36'))](_0xa5c8('0x5c'));var _0x126717=Mustache[_0xa5c8('0x5d')](_0x9e3db6['html'],_0x43179f[_0xa5c8('0x5e')]);_0x47912b(_0x126717);})[_0xa5c8('0x59')](function(_0x4eddbd){_0xbb7093(_0x4eddbd);});});}function getRecipients(_0x4d3fb2){return new BPromise(function(_0x234f7c,_0x109db0){var _0x2df0ad=[];var _0x516188=[];_0x4d3fb2[_0xa5c8('0x56')](function(_0x3c7e27){var _0x14c84d=_['startCase'](_0x3c7e27[_0xa5c8('0x47')]['toLowerCase']());if(_0x14c84d===_0xa5c8('0x5f')){_0x2df0ad=_['union'](_0x2df0ad,_0x3c7e27[_0xa5c8('0x60')]);}else{if(_[_0xa5c8('0x46')](_0x14c84d,_0xa5c8('0x61')))_0x14c84d=_0x14c84d[_0xa5c8('0x62')](_0xa5c8('0x61'),_0xa5c8('0x63'));_0x3c7e27['ids'][_0xa5c8('0x56')](function(_0x220e5b){_0x516188[_0xa5c8('0x64')](getAgents(_0x14c84d,_0x220e5b));});}});return BPromise[_0xa5c8('0x65')](_0x516188)['then'](function(_0x21358a){_0x2df0ad=_['union'](_0x2df0ad,_[_0xa5c8('0x66')](_0x21358a));_0x234f7c(_0x2df0ad);})[_0xa5c8('0x59')](function(_0x22c0dd){_0x109db0(_0x22c0dd);});});}function getAgents(_0x1064de,_0x344f82){return new BPromise(function(_0x17a85f,_0x144c53){return db[_0x1064de][_0xa5c8('0x67')]({'where':{'id':_0x344f82}})[_0xa5c8('0x55')](function(_0x2ec8fe){return _0x2ec8fe[_0xa5c8('0x68')]({'attributes':['id'],'raw':!![]})[_0xa5c8('0x55')](function(_0x1bb0ed){var _0xb7c5ec=_['map'](_0x1bb0ed,'id');_0x17a85f(_0xb7c5ec);});})['catch'](function(_0x570a02){_0x144c53(_0x570a02);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index c77efdb..44f9051 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 _0x6d36=['events','../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x17b6ba,_0x53a9bb){var _0x34186a=function(_0x11de73){while(--_0x11de73){_0x17b6ba['push'](_0x17b6ba['shift']());}};_0x34186a(++_0x53a9bb);}(_0x6d36,0xab));var _0x66d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d36[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x66d3('0x0'));var UserNotification=require(_0x66d3('0x1'))['db'][_0x66d3('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x66d3('0x3')](0x0);var events={'afterCreate':_0x66d3('0x4'),'afterUpdate':'update','afterDestroy':_0x66d3('0x5')};function emitEvent(_0x2dfd6f){return function(_0x2af8a8,_0x3286c6,_0x1cf8f1){UserNotificationEvents[_0x66d3('0x6')](_0x2dfd6f+':'+_0x2af8a8['id'],_0x2af8a8);UserNotificationEvents[_0x66d3('0x6')](_0x2dfd6f,_0x2af8a8);_0x1cf8f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x66d3('0x7')](e,emitEvent(event));}}module[_0x66d3('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x6c05=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x6c05,0xc4));var _0x56c0=function(_0xbceaff,_0x49d1e5){_0xbceaff=_0xbceaff-0x0;var _0x78716f=_0x6c05[_0xbceaff];return _0x78716f;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x56c0('0x0'))['db'][_0x56c0('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x56c0('0x2')](0x0);var events={'afterCreate':_0x56c0('0x3'),'afterUpdate':'update','afterDestroy':_0x56c0('0x4')};function emitEvent(_0x254301){return function(_0x2dacf4,_0x222db3,_0x5d0481){UserNotificationEvents[_0x56c0('0x5')](_0x254301+':'+_0x2dacf4['id'],_0x2dacf4);UserNotificationEvents[_0x56c0('0x5')](_0x254301,_0x2dacf4);_0x5d0481(null);};}for(var e in events){if(events[_0x56c0('0x6')](e)){var event=events[e];UserNotification[_0x56c0('0x7')](e,emitEvent(event));}}module[_0x56c0('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index ca66fa0..b03918a 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 _0xeda3=['api','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4b34ba,_0x4e4757){var _0x541d00=function(_0x3bb310){while(--_0x3bb310){_0x4b34ba['push'](_0x4b34ba['shift']());}};_0x541d00(++_0x4e4757);}(_0xeda3,0x17f));var _0x3eda=function(_0x778eae,_0x1b6ba0){_0x778eae=_0x778eae-0x0;var _0x262771=_0xeda3[_0x778eae];return _0x262771;};'use strict';var _=require(_0x3eda('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3eda('0x1'));var moment=require('moment');var BPromise=require(_0x3eda('0x2'));var rp=require(_0x3eda('0x3'));var fs=require('fs');var path=require(_0x3eda('0x4'));var rimraf=require(_0x3eda('0x5'));var config=require('../../config/environment');var attributes=require(_0x3eda('0x6'));module[_0x3eda('0x7')]=function(_0x4141d9,_0x79e166){return _0x4141d9[_0x3eda('0x8')]('UserNotification',attributes,{'tableName':_0x3eda('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3eda('0xa'),'collate':_0x3eda('0xb')});}; \ No newline at end of file +var _0x1806=['util','moment','bluebird','request-promise','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x18a1aa,_0x3c4466){var _0x4b273e=function(_0x4d1d62){while(--_0x4d1d62){_0x18a1aa['push'](_0x18a1aa['shift']());}};_0x4b273e(++_0x3c4466);}(_0x1806,0x8f));var _0x6180=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1806[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x6180('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6180('0x1'));var BPromise=require(_0x6180('0x2'));var rp=require(_0x6180('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6180('0x4'));module[_0x6180('0x5')]=function(_0x4b3f8a,_0x547f18){return _0x4b3f8a[_0x6180('0x6')](_0x6180('0x7'),attributes,{'tableName':_0x6180('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6180('0x9'),'collate':_0x6180('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index f283de7..9ebe3e2 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 _0xe30c=['debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x26acc2,_0x16a76d){var _0x4eec8f=function(_0xd58f2d){while(--_0xd58f2d){_0x26acc2['push'](_0x26acc2['shift']());}};_0x4eec8f(++_0x16a76d);}(_0xe30c,0x1aa));var _0xce30=function(_0x4f5959,_0x3f40fd){_0x4f5959=_0x4f5959-0x0;var _0x135ef2=_0xe30c[_0x4f5959];return _0x135ef2;};'use strict';var _=require(_0xce30('0x0'));var util=require(_0xce30('0x1'));var moment=require(_0xce30('0x2'));var BPromise=require(_0xce30('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce30('0x4'));var db=require(_0xce30('0x5'))['db'];var utils=require(_0xce30('0x6'));var logger=require(_0xce30('0x7'))('rpc');var config=require(_0xce30('0x8'));var jayson=require(_0xce30('0x9'));var client=jayson[_0xce30('0xa')][_0xce30('0xb')]({'port':0x232a});config[_0xce30('0xc')]=_[_0xce30('0xd')](config[_0xce30('0xc')],{'host':_0xce30('0xe'),'port':0x18eb});var socket=require(_0xce30('0xf'))(new Redis(config[_0xce30('0xc')]));require(_0xce30('0x10'))[_0xce30('0x11')](socket);function respondWithRpcPromise(_0x2c1a61,_0xa685f4,_0x4fc2d2){return new BPromise(function(_0x356a0e,_0xb26515){return client[_0xce30('0x12')](_0x2c1a61,_0x4fc2d2)['then'](function(_0x107301){logger[_0xce30('0x13')](_0xce30('0x14'),_0xa685f4,_0xce30('0x15'));logger[_0xce30('0x16')](_0xce30('0x17'),_0xa685f4,_0xce30('0x15'),JSON['stringify'](_0x107301));if(_0x107301[_0xce30('0x18')]){if(_0x107301[_0xce30('0x18')][_0xce30('0x19')]===0x1f4){logger[_0xce30('0x18')](_0xce30('0x14'),_0xa685f4,_0x107301['error'][_0xce30('0x1a')]);return _0xb26515(_0x107301[_0xce30('0x18')][_0xce30('0x1a')]);}logger[_0xce30('0x18')](_0xce30('0x14'),_0xa685f4,_0x107301[_0xce30('0x18')][_0xce30('0x1a')]);return _0x356a0e(_0x107301['error']['message']);}else{logger[_0xce30('0x13')](_0xce30('0x14'),_0xa685f4,_0xce30('0x15'));_0x356a0e(_0x107301[_0xce30('0x1b')][_0xce30('0x1a')]);}})['catch'](function(_0x7cbe06){logger[_0xce30('0x18')](_0xce30('0x14'),_0xa685f4,_0x7cbe06);_0xb26515(_0x7cbe06);});});} \ No newline at end of file +var _0xf892=['then','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request'];(function(_0xafd652,_0x2780ee){var _0x217596=function(_0x78dcd8){while(--_0x78dcd8){_0xafd652['push'](_0xafd652['shift']());}};_0x217596(++_0x2780ee);}(_0xf892,0x1bd));var _0x2f89=function(_0x299d43,_0x4ebe75){_0x299d43=_0x299d43-0x0;var _0x2173b6=_0xf892[_0x299d43];return _0x2173b6;};'use strict';var _=require(_0x2f89('0x0'));var util=require(_0x2f89('0x1'));var moment=require(_0x2f89('0x2'));var BPromise=require(_0x2f89('0x3'));var rs=require(_0x2f89('0x4'));var fs=require('fs');var Redis=require(_0x2f89('0x5'));var db=require(_0x2f89('0x6'))['db'];var utils=require(_0x2f89('0x7'));var logger=require('../../config/logger')(_0x2f89('0x8'));var config=require(_0x2f89('0x9'));var jayson=require(_0x2f89('0xa'));var client=jayson['client'][_0x2f89('0xb')]({'port':0x232a});config[_0x2f89('0xc')]=_[_0x2f89('0xd')](config[_0x2f89('0xc')],{'host':_0x2f89('0xe'),'port':0x18eb});var socket=require(_0x2f89('0xf'))(new Redis(config[_0x2f89('0xc')]));require(_0x2f89('0x10'))[_0x2f89('0x11')](socket);function respondWithRpcPromise(_0x358fbd,_0x45ab97,_0x310d51){return new BPromise(function(_0x432554,_0x4c7c1e){return client[_0x2f89('0x12')](_0x358fbd,_0x310d51)[_0x2f89('0x13')](function(_0x869f39){logger['info']('UserNotification,\x20%s,\x20%s',_0x45ab97,_0x2f89('0x14'));logger['debug'](_0x2f89('0x15'),_0x45ab97,_0x2f89('0x14'),JSON['stringify'](_0x869f39));if(_0x869f39['error']){if(_0x869f39[_0x2f89('0x16')][_0x2f89('0x17')]===0x1f4){logger[_0x2f89('0x16')](_0x2f89('0x18'),_0x45ab97,_0x869f39[_0x2f89('0x16')][_0x2f89('0x19')]);return _0x4c7c1e(_0x869f39['error'][_0x2f89('0x19')]);}logger['error'](_0x2f89('0x18'),_0x45ab97,_0x869f39[_0x2f89('0x16')]['message']);return _0x432554(_0x869f39[_0x2f89('0x16')][_0x2f89('0x19')]);}else{logger[_0x2f89('0x1a')](_0x2f89('0x18'),_0x45ab97,_0x2f89('0x14'));_0x432554(_0x869f39[_0x2f89('0x1b')][_0x2f89('0x19')]);}})[_0x2f89('0x1c')](function(_0x351719){logger[_0x2f89('0x16')](_0x2f89('0x18'),_0x45ab97,_0x351719);_0x4c7c1e(_0x351719);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 2ea38e7..2b022d5 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 _0xc87a=['register','userNotification:','./userNotification.events','save','remove','emit','removeListener'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc87a,0x136));var _0xac87=function(_0x32809a,_0x2a7e5){_0x32809a=_0x32809a-0x0;var _0x5eff3d=_0xc87a[_0x32809a];return _0x5eff3d;};'use strict';var UserNotificationEvents=require(_0xac87('0x0'));var events=[_0xac87('0x1'),_0xac87('0x2'),'update'];function createListener(_0x3135d8,_0x1cf4fc){return function(_0x915834){_0x1cf4fc[_0xac87('0x3')](_0x3135d8,_0x915834);};}function removeListener(_0x4f4ee3,_0xfaebae){return function(){UserNotificationEvents[_0xac87('0x4')](_0x4f4ee3,_0xfaebae);};}exports[_0xac87('0x5')]=function(_0x304761){for(var _0x4fd280=0x0,_0x59e6aa=events['length'];_0x4fd280<_0x59e6aa;_0x4fd280++){var _0x1a44f6=events[_0x4fd280];var _0x58e3e0=createListener(_0xac87('0x6')+_0x1a44f6,_0x304761);UserNotificationEvents['on'](_0x1a44f6,_0x58e3e0);}}; \ No newline at end of file +var _0xcb00=['remove','update','emit','removeListener','length','userNotification:','./userNotification.events','save'];(function(_0x55176d,_0x198e17){var _0x41ac66=function(_0x4d5fc2){while(--_0x4d5fc2){_0x55176d['push'](_0x55176d['shift']());}};_0x41ac66(++_0x198e17);}(_0xcb00,0x19e));var _0x0cb0=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0xcb00[_0x59616b];return _0x5c4523;};'use strict';var UserNotificationEvents=require(_0x0cb0('0x0'));var events=[_0x0cb0('0x1'),_0x0cb0('0x2'),_0x0cb0('0x3')];function createListener(_0x5fbf35,_0x423b9e){return function(_0x179628){_0x423b9e[_0x0cb0('0x4')](_0x5fbf35,_0x179628);};}function removeListener(_0x22d45c,_0x1ff3c4){return function(){UserNotificationEvents[_0x0cb0('0x5')](_0x22d45c,_0x1ff3c4);};}exports['register']=function(_0x2097da){for(var _0x37f589=0x0,_0x2ec0cc=events[_0x0cb0('0x6')];_0x37f589<_0x2ec0cc;_0x37f589++){var _0x4e0eb7=events[_0x37f589];var _0x30a05c=createListener(_0x0cb0('0x7')+_0x4e0eb7,_0x2097da);UserNotificationEvents['on'](_0x4e0eb7,_0x30a05c);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 3aaeb46..26924b0 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3fb560,_0x1e301f){var _0x4999b3=function(_0x4ad22e){while(--_0x4ad22e){_0x3fb560['push'](_0x3fb560['shift']());}};_0x4999b3(++_0x1e301f);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1d9ad6,_0x4316c0){var _0x353c2a=function(_0x2b19d6){while(--_0x2b19d6){_0x1d9ad6['push'](_0x1d9ad6['shift']());}};_0x353c2a(++_0x4316c0);}(_0x70e0,0x17b));var _0x070e=function(_0x463951,_0x349b44){_0x463951=_0x463951-0x0;var _0xc11a43=_0x70e0[_0x463951];return _0xc11a43;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d915b38..3d27ee5 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 _0x3ff5=['INTEGER','sequelize','exports'];(function(_0x246555,_0x4d9844){var _0x3918b5=function(_0x3dffae){while(--_0x3dffae){_0x246555['push'](_0x246555['shift']());}};_0x3918b5(++_0x4d9844);}(_0x3ff5,0x1e1));var _0x53ff=function(_0x26b25,_0x1c51d5){_0x26b25=_0x26b25-0x0;var _0x27f9ff=_0x3ff5[_0x26b25];return _0x27f9ff;};'use strict';var Sequelize=require(_0x53ff('0x0'));module[_0x53ff('0x1')]={'penalty':{'type':Sequelize[_0x53ff('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd40a=['exports'];(function(_0x5291a9,_0x49f153){var _0x31103c=function(_0x178140){while(--_0x178140){_0x5291a9['push'](_0x5291a9['shift']());}};_0x31103c(++_0x49f153);}(_0xd40a,0x17d));var _0xad40=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd40a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xad40('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 619e818..3b90d44 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 _0x438f=['rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xde12cd,_0x269a1f){var _0x93a6e2=function(_0x4b5236){while(--_0x4b5236){_0xde12cd['push'](_0xde12cd['shift']());}};_0x93a6e2(++_0x269a1f);}(_0x438f,0x17f));var _0xf438=function(_0x21b44e,_0x4e602e){_0x21b44e=_0x21b44e-0x0;var _0x225277=_0x438f[_0x21b44e];return _0x225277;};'use strict';var _=require(_0xf438('0x0'));var util=require(_0xf438('0x1'));var logger=require(_0xf438('0x2'))(_0xf438('0x3'));var moment=require('moment');var BPromise=require(_0xf438('0x4'));var rp=require(_0xf438('0x5'));var fs=require('fs');var path=require(_0xf438('0x6'));var rimraf=require(_0xf438('0x7'));var config=require('../../config/environment');var attributes=require(_0xf438('0x8'));module[_0xf438('0x9')]=function(_0x3b7d32,_0x3c7066){return _0x3b7d32[_0xf438('0xa')](_0xf438('0xb'),attributes,{'tableName':_0xf438('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2e3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x21d129,_0x5ccf2a){var _0x3c5086=function(_0x55f507){while(--_0x55f507){_0x21d129['push'](_0x21d129['shift']());}};_0x3c5086(++_0x5ccf2a);}(_0xe2e3,0x145));var _0x3e2e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xe2e3[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x3e2e('0x0'));var util=require(_0x3e2e('0x1'));var logger=require(_0x3e2e('0x2'))(_0x3e2e('0x3'));var moment=require(_0x3e2e('0x4'));var BPromise=require(_0x3e2e('0x5'));var rp=require(_0x3e2e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e2e('0x7'));var config=require(_0x3e2e('0x8'));var attributes=require(_0x3e2e('0x9'));module[_0x3e2e('0xa')]=function(_0xe92085,_0x2fb962){return _0xe92085['define'](_0x3e2e('0xb'),attributes,{'tableName':_0x3e2e('0xc'),'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 7d817e9..0d30f1f 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 _0x65cb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x18843c,_0x6bc7a9){var _0x1acd40=function(_0x4f32b6){while(--_0x4f32b6){_0x18843c['push'](_0x18843c['shift']());}};_0x1acd40(++_0x6bc7a9);}(_0x65cb,0xa4));var _0xb65c=function(_0x477500,_0x13549a){_0x477500=_0x477500-0x0;var _0x52b4ff=_0x65cb[_0x477500];return _0x52b4ff;};'use strict';var _=require(_0xb65c('0x0'));var util=require('util');var moment=require(_0xb65c('0x1'));var BPromise=require(_0xb65c('0x2'));var rs=require(_0xb65c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb65c('0x4'))['db'];var utils=require(_0xb65c('0x5'));var logger=require(_0xb65c('0x6'))(_0xb65c('0x7'));var config=require(_0xb65c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb65c('0x9')][_0xb65c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25087d,_0xacb77d,_0x112f07){return new BPromise(function(_0x23dffb,_0x22b6a3){return client[_0xb65c('0xb')](_0x25087d,_0x112f07)['then'](function(_0x43e68f){logger[_0xb65c('0xc')](_0xb65c('0xd'),_0xacb77d,_0xb65c('0xe'));logger['debug'](_0xb65c('0xf'),_0xacb77d,'request\x20sent',JSON[_0xb65c('0x10')](_0x43e68f));if(_0x43e68f[_0xb65c('0x11')]){if(_0x43e68f[_0xb65c('0x11')][_0xb65c('0x12')]===0x1f4){logger[_0xb65c('0x11')](_0xb65c('0xd'),_0xacb77d,_0x43e68f['error'][_0xb65c('0x13')]);return _0x22b6a3(_0x43e68f[_0xb65c('0x11')][_0xb65c('0x13')]);}logger[_0xb65c('0x11')](_0xb65c('0xd'),_0xacb77d,_0x43e68f[_0xb65c('0x11')][_0xb65c('0x13')]);return _0x23dffb(_0x43e68f['error'][_0xb65c('0x13')]);}else{logger[_0xb65c('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xacb77d,_0xb65c('0xe'));_0x23dffb(_0x43e68f['result'][_0xb65c('0x13')]);}})[_0xb65c('0x14')](function(_0x2666e4){logger[_0xb65c('0x11')](_0xb65c('0xd'),_0xacb77d,_0x2666e4);_0x22b6a3(_0x2666e4);});});} \ No newline at end of file +var _0xfbd3=['http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfbd3,0x1b0));var _0x3fbd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfbd3[_0x432682];return _0x463d05;};'use strict';var _=require(_0x3fbd('0x0'));var util=require(_0x3fbd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3fbd('0x2'));var fs=require('fs');var Redis=require(_0x3fbd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fbd('0x4'));var logger=require(_0x3fbd('0x5'))(_0x3fbd('0x6'));var config=require(_0x3fbd('0x7'));var jayson=require(_0x3fbd('0x8'));var client=jayson['client'][_0x3fbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f46d2,_0x34b2cd,_0x4b8c75){return new BPromise(function(_0x315528,_0x2c5bad){return client[_0x3fbd('0xa')](_0x3f46d2,_0x4b8c75)[_0x3fbd('0xb')](function(_0x5896ba){logger[_0x3fbd('0xc')](_0x3fbd('0xd'),_0x34b2cd,'request\x20sent');logger[_0x3fbd('0xe')](_0x3fbd('0xf'),_0x34b2cd,'request\x20sent',JSON[_0x3fbd('0x10')](_0x5896ba));if(_0x5896ba[_0x3fbd('0x11')]){if(_0x5896ba[_0x3fbd('0x11')][_0x3fbd('0x12')]===0x1f4){logger[_0x3fbd('0x11')](_0x3fbd('0xd'),_0x34b2cd,_0x5896ba[_0x3fbd('0x11')][_0x3fbd('0x13')]);return _0x2c5bad(_0x5896ba[_0x3fbd('0x11')][_0x3fbd('0x13')]);}logger[_0x3fbd('0x11')](_0x3fbd('0xd'),_0x34b2cd,_0x5896ba[_0x3fbd('0x11')][_0x3fbd('0x13')]);return _0x315528(_0x5896ba[_0x3fbd('0x11')][_0x3fbd('0x13')]);}else{logger[_0x3fbd('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x34b2cd,'request\x20sent');_0x315528(_0x5896ba[_0x3fbd('0x14')]['message']);}})['catch'](function(_0x128b17){logger[_0x3fbd('0x11')](_0x3fbd('0xd'),_0x34b2cd,_0x128b17);_0x2c5bad(_0x128b17);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7e45ca5..39115c2 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 _0x28c8=['clone','addSections','addResources','update','delete','/:id','destroy','removeSections','removeResources','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/sections','getSections','/:id/resources','getResources','post','create'];(function(_0x2376d1,_0x38eec4){var _0x443759=function(_0x73c733){while(--_0x73c733){_0x2376d1['push'](_0x2376d1['shift']());}};_0x443759(++_0x38eec4);}(_0x28c8,0xac));var _0x828c=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x28c8[_0x102ff9];return _0x24fa97;};'use strict';var multer=require(_0x828c('0x0'));var util=require(_0x828c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x828c('0x2')]();var fs_extra=require(_0x828c('0x3'));var auth=require(_0x828c('0x4'));var interaction=require(_0x828c('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x828c('0x6')]('/',auth[_0x828c('0x7')](),controller[_0x828c('0x8')]);router[_0x828c('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x828c('0x9')]);router['get']('/:id',auth[_0x828c('0x7')](),controller[_0x828c('0xa')]);router[_0x828c('0x6')](_0x828c('0xb'),auth[_0x828c('0x7')](),controller[_0x828c('0xc')]);router['get'](_0x828c('0xd'),auth[_0x828c('0x7')](),controller[_0x828c('0xe')]);router[_0x828c('0xf')]('/',auth['isAuthenticated'](),controller[_0x828c('0x10')]);router[_0x828c('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x828c('0x11')]);router[_0x828c('0xf')](_0x828c('0xb'),auth['isAuthenticated'](),controller[_0x828c('0x12')]);router['post'](_0x828c('0xd'),auth['isAuthenticated'](),controller[_0x828c('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x828c('0x14')]);router[_0x828c('0x15')](_0x828c('0x16'),auth[_0x828c('0x7')](),controller[_0x828c('0x17')]);router[_0x828c('0x15')](_0x828c('0xb'),auth[_0x828c('0x7')](),controller[_0x828c('0x18')]);router['delete']('/:id/resources',auth[_0x828c('0x7')](),controller[_0x828c('0x19')]);module[_0x828c('0x1a')]=router; \ No newline at end of file +var _0xb2be=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','getSections','/:id/resources','getResources','clone','post','addSections','addResources','delete','destroy','removeSections','removeResources','exports','multer','util'];(function(_0x59be39,_0x38558d){var _0x136795=function(_0x5e499f){while(--_0x5e499f){_0x59be39['push'](_0x59be39['shift']());}};_0x136795(++_0x38558d);}(_0xb2be,0x1da));var _0xeb2b=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0xb2be[_0x5fa520];return _0x1bf6c4;};'use strict';var multer=require(_0xeb2b('0x0'));var util=require(_0xeb2b('0x1'));var path=require(_0xeb2b('0x2'));var timeout=require('connect-timeout');var express=require(_0xeb2b('0x3'));var router=express[_0xeb2b('0x4')]();var fs_extra=require(_0xeb2b('0x5'));var auth=require(_0xeb2b('0x6'));var interaction=require(_0xeb2b('0x7'));var config=require(_0xeb2b('0x8'));var controller=require(_0xeb2b('0x9'));router[_0xeb2b('0xa')]('/',auth[_0xeb2b('0xb')](),controller['index']);router[_0xeb2b('0xa')](_0xeb2b('0xc'),auth[_0xeb2b('0xb')](),controller[_0xeb2b('0xd')]);router['get'](_0xeb2b('0xe'),auth[_0xeb2b('0xb')](),controller[_0xeb2b('0xf')]);router[_0xeb2b('0xa')]('/:id/sections',auth[_0xeb2b('0xb')](),controller[_0xeb2b('0x10')]);router[_0xeb2b('0xa')](_0xeb2b('0x11'),auth[_0xeb2b('0xb')](),controller[_0xeb2b('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/clone',auth[_0xeb2b('0xb')](),controller[_0xeb2b('0x13')]);router[_0xeb2b('0x14')]('/:id/sections',auth[_0xeb2b('0xb')](),controller[_0xeb2b('0x15')]);router[_0xeb2b('0x14')](_0xeb2b('0x11'),auth[_0xeb2b('0xb')](),controller[_0xeb2b('0x16')]);router['put'](_0xeb2b('0xe'),auth[_0xeb2b('0xb')](),controller['update']);router[_0xeb2b('0x17')](_0xeb2b('0xe'),auth['isAuthenticated'](),controller[_0xeb2b('0x18')]);router['delete']('/:id/sections',auth['isAuthenticated'](),controller[_0xeb2b('0x19')]);router[_0xeb2b('0x17')](_0xeb2b('0x11'),auth[_0xeb2b('0xb')](),controller[_0xeb2b('0x1a')]);module[_0xeb2b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 94033dc..fe8bbf3 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 _0x6181=['STRING','crudPermissions','getDataValue','BOOLEAN','sequelize','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6181,0xa6));var _0x1618=function(_0x587dc0,_0x2a409f){_0x587dc0=_0x587dc0-0x0;var _0x4abb3e=_0x6181[_0x587dc0];return _0x4abb3e;};'use strict';var Sequelize=require(_0x1618('0x0'));module[_0x1618('0x1')]={'name':{'type':Sequelize[_0x1618('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x1618('0x2')],'set':function(_0x510b08){this['setDataValue'](_0x1618('0x3'),_0x510b08?_0x510b08['join'](''):[]);},'get':function(){return this[_0x1618('0x4')](_0x1618('0x3'))?this[_0x1618('0x4')](_0x1618('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x1618('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8b12=['sequelize','STRING','name','join','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x4e584c,_0x292d9f){var _0xe71a6f=function(_0x2bea05){while(--_0x2bea05){_0x4e584c['push'](_0x4e584c['shift']());}};_0xe71a6f(++_0x292d9f);}(_0x8b12,0xb0));var _0x28b1=function(_0x17d229,_0x265a8f){_0x17d229=_0x17d229-0x0;var _0x2318da=_0x8b12[_0x17d229];return _0x2318da;};'use strict';var Sequelize=require(_0x28b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x28b1('0x1')],'allowNull':![],'unique':_0x28b1('0x2')},'crudPermissions':{'type':Sequelize[_0x28b1('0x1')],'set':function(_0x28c6d5){this['setDataValue']('crudPermissions',_0x28c6d5?_0x28c6d5[_0x28b1('0x3')](''):[]);},'get':function(){return this[_0x28b1('0x4')](_0x28b1('0x5'))?this[_0x28b1('0x4')]('crudPermissions')[_0x28b1('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x28b1('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x28b1('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x28b1('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x28b1('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 7139f6c..02878d3 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 _0x332d=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./userProfile.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','sendStatus','error','stack','name','send','index','UserProfile','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','then','rows','catch','show','params','rawAttributes','length','include','find','create','body','clone','get','omit','createdAt','updatedAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','update','describe','addSections','map','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0xf9cdbe,_0x1a692c){var _0x47b102=function(_0x5db4f9){while(--_0x5db4f9){_0xf9cdbe['push'](_0xf9cdbe['shift']());}};_0x47b102(++_0x1a692c);}(_0x332d,0x1c4));var _0xd332=function(_0x4b3720,_0x6b7238){_0x4b3720=_0x4b3720-0x0;var _0x3f7e7d=_0x332d[_0x4b3720];return _0x3f7e7d;};'use strict';var emlformat=require(_0xd332('0x0'));var rimraf=require(_0xd332('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd332('0x2'));var rp=require('request-promise');var moment=require(_0xd332('0x3'));var BPromise=require(_0xd332('0x4'));var Mustache=require(_0xd332('0x5'));var util=require(_0xd332('0x6'));var path=require(_0xd332('0x7'));var sox=require(_0xd332('0x8'));var csv=require('to-csv');var ejs=require(_0xd332('0x9'));var fs=require('fs');var fs_extra=require(_0xd332('0xa'));var _=require(_0xd332('0xb'));var squel=require(_0xd332('0xc'));var crypto=require(_0xd332('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd332('0xe'));var toCsv=require(_0xd332('0xf'));var querystring=require(_0xd332('0x10'));var Papa=require('papaparse');var Redis=require(_0xd332('0x11'));var authService=require(_0xd332('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd332('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd332('0x14'))(_0xd332('0x15'));var utils=require(_0xd332('0x16'));var config=require(_0xd332('0x17'));var licenseUtil=require(_0xd332('0x18'));var db=require(_0xd332('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd332('0x1a'),'port':0x18eb});var socket=require(_0xd332('0x1b'))(new Redis(config[_0xd332('0x1c')]));require(_0xd332('0x1d'))[_0xd332('0x1e')](socket);function respondWithStatusCode(_0x25a536,_0x48aeee){_0x48aeee=_0x48aeee||0xcc;return function(_0x5573ca){if(_0x5573ca){return _0x25a536['sendStatus'](_0x48aeee);}return _0x25a536[_0xd332('0x1f')](_0x48aeee)[_0xd332('0x20')]();};}function respondWithResult(_0x586aba,_0x23ce04){_0x23ce04=_0x23ce04||0xc8;return function(_0x4d29c3){if(_0x4d29c3){return _0x586aba[_0xd332('0x1f')](_0x23ce04)[_0xd332('0x21')](_0x4d29c3);}};}function respondWithFilteredResult(_0x5bd5c3,_0x5f3aca){return function(_0x3b0412){if(_0x3b0412){var _0xba7843=typeof _0x5f3aca[_0xd332('0x22')]===_0xd332('0x23')&&typeof _0x5f3aca['limit']===_0xd332('0x23');var _0x53ba53=_0x3b0412[_0xd332('0x24')];var _0x4f3437=_0xba7843?0x0:_0x5f3aca[_0xd332('0x22')];var _0x11e67c=_0xba7843?_0x3b0412[_0xd332('0x24')]:_0x5f3aca[_0xd332('0x22')]+_0x5f3aca[_0xd332('0x25')];var _0x19a7c3;if(_0x11e67c>=_0x53ba53){_0x11e67c=_0x53ba53;_0x19a7c3=0xc8;}else{_0x19a7c3=0xce;}_0x5bd5c3[_0xd332('0x1f')](_0x19a7c3);return _0x5bd5c3[_0xd332('0x26')](_0xd332('0x27'),_0x4f3437+'-'+_0x11e67c+'/'+_0x53ba53)[_0xd332('0x21')](_0x3b0412);}return null;};}function patchUpdates(_0x150baa){return function(_0xa5ef3){try{jsonpatch[_0xd332('0x28')](_0xa5ef3,_0x150baa,!![]);}catch(_0x5b1302){return BPromise[_0xd332('0x29')](_0x5b1302);}return _0xa5ef3['save']();};}function saveUpdates(_0xce8947,_0x1e03a4){return function(_0x12d4e0){if(_0x12d4e0){return _0x12d4e0['update'](_0xce8947)['then'](function(_0xa2024d){return _0xa2024d;});}return null;};}function removeEntity(_0xdc2bc4,_0x17399e){return function(_0x12b795){if(_0x12b795){return _0x12b795[_0xd332('0x2a')]()['then'](function(){_0xdc2bc4[_0xd332('0x1f')](0xcc)[_0xd332('0x20')]();});}};}function handleEntityNotFound(_0x4f13c2,_0x16fad8){return function(_0x262d3b){if(!_0x262d3b){_0x4f13c2[_0xd332('0x2b')](0x194);}return _0x262d3b;};}function handleError(_0x2799ba,_0x16d437){_0x16d437=_0x16d437||0x1f4;return function(_0x31fba7){logger[_0xd332('0x2c')](_0x31fba7[_0xd332('0x2d')]);if(_0x31fba7[_0xd332('0x2e')]){delete _0x31fba7[_0xd332('0x2e')];}_0x2799ba[_0xd332('0x1f')](_0x16d437)[_0xd332('0x2f')](_0x31fba7);};}exports[_0xd332('0x30')]=function(_0x342f0c,_0x516bcf){var _0x4ec0ec={},_0x356b8b={},_0x282152={'count':0x0,'rows':[]};var _0x360ca2=_['map'](db[_0xd332('0x31')]['rawAttributes'],function(_0x410638){return{'name':_0x410638[_0xd332('0x32')],'type':_0x410638['type'][_0xd332('0x33')]};});_0x356b8b[_0xd332('0x34')]=_['map'](_0x360ca2,_0xd332('0x2e'));_0x356b8b[_0xd332('0x35')]=_[_0xd332('0x36')](_0x342f0c[_0xd332('0x35')]);_0x356b8b[_0xd332('0x37')]=_[_0xd332('0x38')](_0x356b8b[_0xd332('0x34')],_0x356b8b[_0xd332('0x35')]);_0x4ec0ec[_0xd332('0x39')]=_[_0xd332('0x38')](_0x356b8b[_0xd332('0x34')],qs[_0xd332('0x3a')](_0x342f0c[_0xd332('0x35')][_0xd332('0x3a')]));_0x4ec0ec[_0xd332('0x39')]=_0x4ec0ec[_0xd332('0x39')]['length']?_0x4ec0ec[_0xd332('0x39')]:_0x356b8b[_0xd332('0x34')];if(!_0x342f0c[_0xd332('0x35')]['hasOwnProperty']('nolimit')){_0x4ec0ec[_0xd332('0x25')]=qs[_0xd332('0x25')](_0x342f0c[_0xd332('0x35')][_0xd332('0x25')]);_0x4ec0ec['offset']=qs[_0xd332('0x22')](_0x342f0c[_0xd332('0x35')][_0xd332('0x22')]);}_0x4ec0ec[_0xd332('0x3b')]=qs[_0xd332('0x3c')](_0x342f0c['query'][_0xd332('0x3c')]);_0x4ec0ec[_0xd332('0x3d')]=qs[_0xd332('0x37')](_[_0xd332('0x3e')](_0x342f0c[_0xd332('0x35')],_0x356b8b[_0xd332('0x37')]),_0x360ca2);if(_0x342f0c['query']['filter']){_0x4ec0ec[_0xd332('0x3d')]=_['merge'](_0x4ec0ec[_0xd332('0x3d')],{'$or':_['map'](_0x360ca2,function(_0x57a6c2){if(_0x57a6c2['type']!==_0xd332('0x3f')){var _0x37b7aa={};_0x37b7aa[_0x57a6c2['name']]={'$like':'%'+_0x342f0c['query'][_0xd332('0x40')]+'%'};return _0x37b7aa;}})});}_0x4ec0ec=_[_0xd332('0x41')]({},_0x4ec0ec,_0x342f0c[_0xd332('0x42')]);var _0x54daf4={'where':_0x4ec0ec[_0xd332('0x3d')]};return db[_0xd332('0x31')]['count'](_0x54daf4)['then'](function(_0xb23ad){_0x282152[_0xd332('0x24')]=_0xb23ad;if(_0x342f0c[_0xd332('0x35')][_0xd332('0x43')]){_0x4ec0ec['include']=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x4ec0ec);})[_0xd332('0x44')](function(_0x3c9f0a){_0x282152[_0xd332('0x45')]=_0x3c9f0a;return _0x282152;})['then'](respondWithFilteredResult(_0x516bcf,_0x4ec0ec))[_0xd332('0x46')](handleError(_0x516bcf,null));};exports[_0xd332('0x47')]=function(_0x1c1ac5,_0x259b47){var _0x430726={'raw':![],'where':{'id':_0x1c1ac5[_0xd332('0x48')]['id']}},_0x3afc21={};_0x3afc21['model']=_[_0xd332('0x36')](db['UserProfile'][_0xd332('0x49')]);_0x3afc21[_0xd332('0x35')]=_[_0xd332('0x36')](_0x1c1ac5[_0xd332('0x35')]);_0x3afc21[_0xd332('0x37')]=_[_0xd332('0x38')](_0x3afc21[_0xd332('0x34')],_0x3afc21['query']);_0x430726[_0xd332('0x39')]=_[_0xd332('0x38')](_0x3afc21[_0xd332('0x34')],qs['fields'](_0x1c1ac5[_0xd332('0x35')]['fields']));_0x430726[_0xd332('0x39')]=_0x430726[_0xd332('0x39')][_0xd332('0x4a')]?_0x430726['attributes']:_0x3afc21[_0xd332('0x34')];if(_0x1c1ac5[_0xd332('0x35')]['includeAll']){_0x430726[_0xd332('0x4b')]=[{'all':!![]}];}_0x430726=_[_0xd332('0x41')]({},_0x430726,_0x1c1ac5[_0xd332('0x42')]);return db[_0xd332('0x31')][_0xd332('0x4c')](_0x430726)[_0xd332('0x44')](handleEntityNotFound(_0x259b47,null))['then'](respondWithResult(_0x259b47,null))['catch'](handleError(_0x259b47,null));};exports['create']=function(_0x1bebec,_0x38e3b8){return db[_0xd332('0x31')][_0xd332('0x4d')](_0x1bebec[_0xd332('0x4e')],{})[_0xd332('0x44')](respondWithResult(_0x38e3b8,0xc9))[_0xd332('0x46')](handleError(_0x38e3b8,null));};exports[_0xd332('0x4f')]=function(_0x26881e,_0x4c0ebd){var _0x45e71d={'where':{'id':_0x26881e[_0xd332('0x48')]['id']}},_0x165338={};_0x165338[_0xd332('0x34')]=_[_0xd332('0x36')](db[_0xd332('0x31')]['rawAttributes']);_0x45e71d['attributes']=_[_0xd332('0x38')](_0x165338[_0xd332('0x34')],qs['fields'](_0x26881e[_0xd332('0x35')]['fields']));_0x45e71d['attributes']=_0x45e71d['attributes'][_0xd332('0x4a')]?_0x45e71d[_0xd332('0x39')]:_0x165338[_0xd332('0x34')];if(_0x26881e['query'][_0xd332('0x43')]){_0x45e71d['include']=[{'all':!![]}];}_0x45e71d=_['merge']({},_0x45e71d,_0x26881e['options']);return db[_0xd332('0x31')][_0xd332('0x4c')](_0x45e71d)[_0xd332('0x44')](handleEntityNotFound(_0x4c0ebd,null))[_0xd332('0x44')](function(_0x4c535e){if(_0x4c535e){var _0x3af939=_0x4c535e[_0xd332('0x50')]({'plain':!![]});_0x3af939=qs[_0xd332('0x51')](_0x3af939,['id',_0xd332('0x52'),_0xd332('0x53'),'crudPermissions']);_0x26881e['body']=_[_0xd332('0x51')](_0x26881e[_0xd332('0x4e')],['id',_0xd332('0x52'),_0xd332('0x53')]);return db[_0xd332('0x54')][_0xd332('0x55')](function(_0x5b6531){return db[_0xd332('0x31')][_0xd332('0x4d')](_['merge'](_0x3af939,_0x26881e[_0xd332('0x4e')]),{'include':_0x26881e[_0xd332('0x35')][_0xd332('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x5b6531})['then'](function(_0x37b478){var _0x5537b7=_0x37b478[_0xd332('0x50')]({'plain':!![]});return db[_0xd332('0x56')][_0xd332('0x57')]({'where':{'userProfileId':_0x26881e[_0xd332('0x48')]['id']},'raw':!![]})['then'](function(_0x87aa24){if(_0x87aa24){return BPromise[_0xd332('0x58')](_0x87aa24,function(_0x3f7d8a){return new BPromise(function(_0x41e081,_0xcb86de){if(_0x3f7d8a[_0xd332('0x59')]===null||_0x3f7d8a['autoAssociation']===0x1)_0x41e081(null);return db[_0xd332('0x5a')]['findAll']({'where':{'sectionId':_0x3f7d8a['id']},'raw':!![]})[_0xd332('0x44')](function(_0x32e92b){var _0x4fd034=_['map'](_0x32e92b,function(_0x4caa8c){return qs[_0xd332('0x51')](_0x4caa8c,['id',_0xd332('0x52'),'updatedAt','sectionId']);});_0x41e081(_0x4fd034);})[_0xd332('0x46')](function(_0x208336){_0xcb86de(_0x208336);});})[_0xd332('0x44')](function(_0x1806df){var _0x42ec45=qs['omit'](_0x3f7d8a,['id',_0xd332('0x52'),_0xd332('0x53')]);_0x42ec45[_0xd332('0x5b')]=_0x5537b7['id'];if(_0x1806df)_0x42ec45[_0xd332('0x5c')]=_0x1806df;return _0x42ec45;})[_0xd332('0x44')](function(_0x4c9074){return db['UserProfileSection']['create'](_0x4c9074,{'include':[{'model':db[_0xd332('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x5b6531});});})[_0xd332('0x44')](function(){return _0x5537b7;});}});});});}})[_0xd332('0x44')](respondWithResult(_0x4c0ebd,0xc9))['catch'](handleError(_0x4c0ebd,null));};exports[_0xd332('0x5d')]=function(_0x5d70a3,_0x3f773f){if(_0x5d70a3[_0xd332('0x4e')]['id']){delete _0x5d70a3[_0xd332('0x4e')]['id'];}return db['UserProfile'][_0xd332('0x4c')]({'where':{'id':_0x5d70a3[_0xd332('0x48')]['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x3f773f,null))['then'](saveUpdates(_0x5d70a3[_0xd332('0x4e')],null))['then'](respondWithResult(_0x3f773f,null))[_0xd332('0x46')](handleError(_0x3f773f,null));};exports[_0xd332('0x2a')]=function(_0x27e8c1,_0x4e9209){return db[_0xd332('0x31')][_0xd332('0x4c')]({'where':{'id':_0x27e8c1['params']['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x4e9209,null))[_0xd332('0x44')](removeEntity(_0x4e9209,null))[_0xd332('0x46')](handleError(_0x4e9209,null));};exports[_0xd332('0x5e')]=function(_0x101864,_0x3f18eb){return db['UserProfile'][_0xd332('0x5e')]()['then'](respondWithResult(_0x3f18eb,null))[_0xd332('0x46')](handleError(_0x3f18eb,null));};exports[_0xd332('0x5f')]=function(_0x4c8554,_0x2a3d32){var _0x4c6dc5=_0x4c8554['body'];return db[_0xd332('0x31')]['find']({'where':{'id':_0x4c8554[_0xd332('0x48')]['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x2a3d32,null))[_0xd332('0x44')](function(_0x5b53d5){if(_0x5b53d5){return db[_0xd332('0x54')]['transaction'](function(_0x3d10d9){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x4c8554[_0xd332('0x48')]['id'],'sectionId':_[_0xd332('0x60')](_0x4c6dc5,function(_0x423892){return _0x423892[_0xd332('0x61')];})},'transaction':_0x3d10d9})[_0xd332('0x44')](function(){var _0x4ced6a=_[_0xd332('0x60')](_0x4c6dc5,function(_0x30a9ed){_0x30a9ed[_0xd332('0x5b')]=_0x4c8554[_0xd332('0x48')]['id'];return _0x30a9ed;});var _0x45f1e2=[];return BPromise[_0xd332('0x58')](_0x4ced6a,function(_0x3bb90a){return db['UserProfileSection'][_0xd332('0x4d')](_0x3bb90a,{'include':[{'model':db[_0xd332('0x5a')],'as':_0xd332('0x5c')}],'raw':!![],'transaction':_0x3d10d9})[_0xd332('0x44')](function(_0x415308){_0x45f1e2[_0xd332('0x62')](_0x415308[_0xd332('0x50')]({'plain':!![]}));});})[_0xd332('0x44')](function(){return _0x45f1e2;});});});}})['then'](function(_0x5f0bc2){return _0x5f0bc2;})[_0xd332('0x44')](respondWithResult(_0x2a3d32,null))[_0xd332('0x46')](handleError(_0x2a3d32,null));};exports[_0xd332('0x63')]=function(_0x52ee2f,_0x22694d){var _0x3409de;return db[_0xd332('0x31')]['find']({'where':{'id':_0x52ee2f[_0xd332('0x48')]['id']},'attributes':['id',_0xd332('0x2e')]})['then'](handleEntityNotFound(_0x22694d,null))[_0xd332('0x44')](function(_0x27e9cc){if(_0x27e9cc){_0x3409de=_0x27e9cc;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x52ee2f[_0xd332('0x48')]['id'],'sectionId':_0x52ee2f[_0xd332('0x35')][_0xd332('0x64')]}});}})[_0xd332('0x44')](function(){return _0x3409de;})[_0xd332('0x44')](respondWithStatusCode(_0x22694d,null))[_0xd332('0x46')](handleError(_0x22694d,null));};exports[_0xd332('0x65')]=function(_0x21ccc4,_0x3d3b03){var _0x5616f3=[];var _0x456309=[];return db['UserProfileSection'][_0xd332('0x57')]({'where':{'userProfileId':_0x21ccc4['params']['id']},'raw':!![]})[_0xd332('0x44')](function(_0x3e8fb1){_0x5616f3=_[_0xd332('0x40')](_0x3e8fb1,function(_0x38ecd9){return _0x38ecd9[_0xd332('0x66')]===0x1||_[_0xd332('0x67')]([0x3eb,0x709],_0x38ecd9[_0xd332('0x61')]);});if(!_[_0xd332('0x68')](_0x5616f3)){return _[_0xd332('0x60')](_0x5616f3,function(_0x410b0f){return _0x410b0f[_0xd332('0x61')];});}else{return;}})['then'](function(_0x3e37b5){if(_0x3e37b5)_0x456309=_0x3e37b5;if(_[_0xd332('0x67')](_0x456309,0x64)){var _0x36843a=_[_0xd332('0x4c')](_0x5616f3,{'sectionId':0x64});return hasDefaultDashboard(_0x36843a)[_0xd332('0x44')](function(_0x149478){return _[_0xd332('0x60')](_0x5616f3,function(_0x15d366){if(_0x15d366[_0xd332('0x61')]===0x64){_0x15d366[_0xd332('0x69')]=_0x149478;}return _0x15d366;});});}else{return;}})['then'](function(_0x1f53ee){if(_0x1f53ee)_0x5616f3=_0x1f53ee;if(_[_0xd332('0x67')](_0x456309,0x3eb)){var _0x19db86=_[_0xd332('0x4c')](_0x5616f3,{'sectionId':0x3eb});return getCustomDashboards(_0x19db86)['then'](function(_0x3b9378){return _[_0xd332('0x60')](_0x5616f3,function(_0x45f7cb){if(_0x19db86[_0xd332('0x66')]){if(_0x45f7cb[_0xd332('0x61')]===0x3eb){_0x45f7cb['subsections']=_0x3b9378;}}else{if(_0x45f7cb[_0xd332('0x61')]===0x64){if(!_0x45f7cb['subsections']){_0x45f7cb['subsections']=[];}_0x45f7cb['subsections']=_0x45f7cb['subsections']['concat'](_0x3b9378);}}return _0x45f7cb;});});}else{return;}})[_0xd332('0x44')](function(_0x1e1393){if(_0x1e1393)_0x5616f3=_0x1e1393;if(_['includes'](_0x456309,0x709)){var _0x28f0ed=_[_0xd332('0x4c')](_0x5616f3,{'sectionId':0x709});return getPlugins(_0x28f0ed)[_0xd332('0x44')](function(_0x2fd874){if(_0x28f0ed[_0xd332('0x66')]){return _['map'](_0x5616f3,function(_0x1fb956){if(_0x1fb956[_0xd332('0x61')]===0x709){_0x1fb956[_0xd332('0x69')]=_0x2fd874;}return _0x1fb956;});}else{var _0x44a014={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2fd874};var _0x83c3cd=_[_0xd332('0x60')](_0x5616f3);_0x83c3cd[_0xd332('0x62')](_0x44a014);return _0x83c3cd;}});}else{return;}})[_0xd332('0x44')](function(_0x518ba6){if(_0x518ba6)_0x5616f3=_0x518ba6;return _['filter'](_0x5616f3,[_0xd332('0x66'),0x1]);})[_0xd332('0x44')](respondWithResult(_0x3d3b03,null))[_0xd332('0x46')](handleError(_0x3d3b03,null));};function hasDefaultDashboard(_0x3ff198){var _0x24c12f=[0x65];return new BPromise(function(_0xdf8ba1,_0x3b7179){try{if(_0x3ff198[_0xd332('0x59')]){_0xdf8ba1(_0x24c12f);}else{return db['UserProfileResource'][_0xd332('0x6a')]({'where':{'sectionId':_0x3ff198['id']},'raw':!![]})['then'](function(_0x23b1da){_0x23b1da?_0xdf8ba1(_0x24c12f):_0xdf8ba1();});}}catch(_0x22af0b){_0x3b7179(_0x22af0b);}});}function getCustomDashboards(_0x247afa){var _0x398f5b=[];return new BPromise(function(_0x417c35,_0x50f771){try{if(_0x247afa[_0xd332('0x59')]){return db['Dashboard']['findAll']({'raw':!![]})['then'](function(_0x67de1a){_0x67de1a[_0xd332('0x6b')](function(_0xe9d63a){_0x398f5b['push'](_0xe9d63a['id']+0x1869f);});_0x417c35(_0x398f5b);});}else{return db[_0xd332('0x5a')][_0xd332('0x57')]({'where':{'sectionId':_0x247afa['id']},'raw':!![]})['then'](function(_0x216c53){_0x216c53[_0xd332('0x6b')](function(_0x3c0f9d){_0x398f5b[_0xd332('0x62')](_0x3c0f9d['resourceId']+0x1869f);});_0x417c35(_0x398f5b);});}}catch(_0x1010e4){_0x50f771(_0x1010e4);}});}function getPlugins(_0x5c4522){var _0x3c6f74=[];return new BPromise(function(_0x27fdd1,_0x19575e){try{if(_0x5c4522[_0xd332('0x59')]){return db[_0xd332('0x6c')]['findAll']({'raw':!![]})[_0xd332('0x44')](function(_0x35d455){_0x35d455['forEach'](function(_0x144a20){_0x3c6f74['push'](_0x144a20['id']+0x15b38);});_0x27fdd1(_0x3c6f74);});}else{return db[_0xd332('0x5a')][_0xd332('0x57')]({'where':{'sectionId':_0x5c4522['id']},'raw':!![]})['then'](function(_0x5b6e21){_0x5b6e21[_0xd332('0x6b')](function(_0x3d9125){_0x3c6f74[_0xd332('0x62')](_0x3d9125['resourceId']+0x15b38);});_0x27fdd1(_0x3c6f74);});}}catch(_0x4ca96b){_0x19575e(_0x4ca96b);}});}exports[_0xd332('0x6d')]=function(_0x33dcb7,_0x167ded){return db[_0xd332('0x31')][_0xd332('0x4c')]({'where':{'id':_0x33dcb7[_0xd332('0x48')]['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x167ded,null))[_0xd332('0x44')](function(_0x35dbc3){if(_0x35dbc3){return db[_0xd332('0x54')][_0xd332('0x55')](function(_0x37ab15){return db[_0xd332('0x56')][_0xd332('0x57')]({'where':{'userProfileId':_0x33dcb7[_0xd332('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0xd332('0x44')](function(_0xe04d8){if(_0xe04d8){return db[_0xd332('0x56')][_0xd332('0x2a')]({'where':{'userProfileId':_0x33dcb7[_0xd332('0x48')]['id'],'id':_[_0xd332('0x60')](_0xe04d8,function(_0x1492f5){return _0x1492f5['id'];})},'transaction':_0x37ab15});}})['then'](function(_0x509dde){var _0x155201=_[_0xd332('0x60')](_0x33dcb7[_0xd332('0x4e')],function(_0x40ebeb){_0x40ebeb[_0xd332('0x5b')]=_0x33dcb7['params']['id'];return _0x40ebeb;});return db[_0xd332('0x56')]['bulkCreate'](_0x155201,{'raw':!![],'transaction':_0x37ab15});})[_0xd332('0x44')](function(_0x3671e0){var _0x12df65=_['filter'](_['map'](_0x3671e0,function(_0xb7d0a9){return _0xb7d0a9[_0xd332('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x12df65){return db[_0xd332('0x56')][_0xd332('0x57')]({'where':{'userProfileId':_0x33dcb7[_0xd332('0x48')]['id'],'sectionId':_[_0xd332('0x60')](_0x12df65,function(_0x17eca9){return _0x17eca9[_0xd332('0x61')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd332('0x44')](function(_0x4c6cef){var _0x457587=_[_0xd332('0x60')](_0x33dcb7[_0xd332('0x4e')],function(_0x2e2b00){_0x2e2b00[_0xd332('0x5b')]=_0x33dcb7[_0xd332('0x48')]['id'];return _0x2e2b00;});return db[_0xd332('0x5a')][_0xd332('0x6e')](_0x457587,{'raw':!![],'transaction':_0x37ab15});});}})['catch'](handleError(_0x167ded,null));});}})[_0xd332('0x44')](function(_0x219d5a){var _0x37aae4=_[_0xd332('0x60')](_0x219d5a,function(_0x54a348){return _0x54a348['get']({'plain':!![]});});})['then'](respondWithResult(_0x167ded,null))[_0xd332('0x46')](handleError(_0x167ded,null));};exports[_0xd332('0x6f')]=function(_0x278672,_0x340b7b,_0x47914a){return db['UserProfile'][_0xd332('0x4c')]({'where':{'id':_0x278672['params']['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x340b7b,null))[_0xd332('0x44')](function(_0x1cdb7e){if(_0x1cdb7e){return _0x1cdb7e['removeResources'](_0x278672['query'][_0xd332('0x64')]);}})[_0xd332('0x44')](respondWithStatusCode(_0x340b7b,null))[_0xd332('0x46')](handleError(_0x340b7b,null));};exports[_0xd332('0x70')]=function(_0x760d2f,_0x2462bf){var _0x2d425b={};if(!_0x760d2f['query']['section'])throw new Error(_0xd332('0x71'));if(!_0x760d2f[_0xd332('0x35')][_0xd332('0x72')](_0xd332('0x73'))){_0x2d425b[_0xd332('0x25')]=qs[_0xd332('0x25')](_0x760d2f[_0xd332('0x35')][_0xd332('0x25')]);_0x2d425b['offset']=qs[_0xd332('0x22')](_0x760d2f[_0xd332('0x35')][_0xd332('0x22')]);}return db[_0xd332('0x31')][_0xd332('0x4c')]({'where':{'id':_0x760d2f[_0xd332('0x48')]['id']}})[_0xd332('0x44')](function(_0x32bee7){if(!_0x32bee7)throw new Error(_0xd332('0x74')+_0x760d2f['params']['id']);return db[_0xd332('0x31')][_0xd332('0x70')](_0x760d2f);})[_0xd332('0x44')](respondWithFilteredResult(_0x2462bf,_0x2d425b))[_0xd332('0x46')](handleError(_0x2462bf,null));}; \ No newline at end of file +var _0x8fe2=['query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','filter','merge','includeAll','findAll','rows','show','params','keys','length','options','find','catch','create','body','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','name'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8fe2,0x194));var _0x28fe=function(_0x31cc0e,_0x24ba4c){_0x31cc0e=_0x31cc0e-0x0;var _0x144862=_0x8fe2[_0x31cc0e];return _0x144862;};'use strict';var emlformat=require(_0x28fe('0x0'));var rimraf=require(_0x28fe('0x1'));var zipdir=require(_0x28fe('0x2'));var jsonpatch=require(_0x28fe('0x3'));var rp=require(_0x28fe('0x4'));var moment=require(_0x28fe('0x5'));var BPromise=require(_0x28fe('0x6'));var Mustache=require(_0x28fe('0x7'));var util=require(_0x28fe('0x8'));var path=require('path');var sox=require(_0x28fe('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28fe('0xa'));var _=require(_0x28fe('0xb'));var squel=require(_0x28fe('0xc'));var crypto=require(_0x28fe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x28fe('0xe'));var toCsv=require(_0x28fe('0xf'));var querystring=require(_0x28fe('0x10'));var Papa=require('papaparse');var Redis=require(_0x28fe('0x11'));var authService=require(_0x28fe('0x12'));var qs=require(_0x28fe('0x13'));var as=require(_0x28fe('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28fe('0x15'))(_0x28fe('0x16'));var utils=require(_0x28fe('0x17'));var config=require(_0x28fe('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x28fe('0x19'))['db'];config[_0x28fe('0x1a')]=_['defaults'](config[_0x28fe('0x1a')],{'host':_0x28fe('0x1b'),'port':0x18eb});var socket=require(_0x28fe('0x1c'))(new Redis(config[_0x28fe('0x1a')]));require('./userProfile.socket')[_0x28fe('0x1d')](socket);function respondWithStatusCode(_0x547531,_0x20557f){_0x20557f=_0x20557f||0xcc;return function(_0x20d2fc){if(_0x20d2fc){return _0x547531[_0x28fe('0x1e')](_0x20557f);}return _0x547531[_0x28fe('0x1f')](_0x20557f)['end']();};}function respondWithResult(_0x3f71a1,_0x48ce8e){_0x48ce8e=_0x48ce8e||0xc8;return function(_0x2517d6){if(_0x2517d6){return _0x3f71a1[_0x28fe('0x1f')](_0x48ce8e)[_0x28fe('0x20')](_0x2517d6);}};}function respondWithFilteredResult(_0x503463,_0x422eee){return function(_0x48ed45){if(_0x48ed45){var _0x3bce82=typeof _0x422eee['offset']==='undefined'&&typeof _0x422eee[_0x28fe('0x21')]===_0x28fe('0x22');var _0x3be6b1=_0x48ed45[_0x28fe('0x23')];var _0x14db4f=_0x3bce82?0x0:_0x422eee[_0x28fe('0x24')];var _0x5d6787=_0x3bce82?_0x48ed45[_0x28fe('0x23')]:_0x422eee[_0x28fe('0x24')]+_0x422eee['limit'];var _0x3bd6b0;if(_0x5d6787>=_0x3be6b1){_0x5d6787=_0x3be6b1;_0x3bd6b0=0xc8;}else{_0x3bd6b0=0xce;}_0x503463[_0x28fe('0x1f')](_0x3bd6b0);return _0x503463[_0x28fe('0x25')](_0x28fe('0x26'),_0x14db4f+'-'+_0x5d6787+'/'+_0x3be6b1)['json'](_0x48ed45);}return null;};}function patchUpdates(_0xe5efc9){return function(_0x362f67){try{jsonpatch[_0x28fe('0x27')](_0x362f67,_0xe5efc9,!![]);}catch(_0x16f571){return BPromise[_0x28fe('0x28')](_0x16f571);}return _0x362f67['save']();};}function saveUpdates(_0x176da8,_0x597613){return function(_0x296e6b){if(_0x296e6b){return _0x296e6b[_0x28fe('0x29')](_0x176da8)[_0x28fe('0x2a')](function(_0x3e05a2){return _0x3e05a2;});}return null;};}function removeEntity(_0x248dd5,_0x45385b){return function(_0x3fd67c){if(_0x3fd67c){return _0x3fd67c[_0x28fe('0x2b')]()[_0x28fe('0x2a')](function(){_0x248dd5[_0x28fe('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25228f,_0x34feed){return function(_0x335cdb){if(!_0x335cdb){_0x25228f[_0x28fe('0x1e')](0x194);}return _0x335cdb;};}function handleError(_0x378cf1,_0x1275cc){_0x1275cc=_0x1275cc||0x1f4;return function(_0x3547b4){logger[_0x28fe('0x2c')](_0x3547b4[_0x28fe('0x2d')]);if(_0x3547b4['name']){delete _0x3547b4['name'];}_0x378cf1['status'](_0x1275cc)[_0x28fe('0x2e')](_0x3547b4);};}exports[_0x28fe('0x2f')]=function(_0xc842fa,_0xeb91b){var _0x2cfaa7={},_0x238707={},_0x379cf5={'count':0x0,'rows':[]};var _0xa70277=_['map'](db[_0x28fe('0x30')][_0x28fe('0x31')],function(_0x2ee0da){return{'name':_0x2ee0da[_0x28fe('0x32')],'type':_0x2ee0da[_0x28fe('0x33')][_0x28fe('0x34')]};});_0x238707[_0x28fe('0x35')]=_[_0x28fe('0x36')](_0xa70277,_0x28fe('0x37'));_0x238707[_0x28fe('0x38')]=_['keys'](_0xc842fa[_0x28fe('0x38')]);_0x238707['filters']=_[_0x28fe('0x39')](_0x238707[_0x28fe('0x35')],_0x238707[_0x28fe('0x38')]);_0x2cfaa7[_0x28fe('0x3a')]=_[_0x28fe('0x39')](_0x238707[_0x28fe('0x35')],qs[_0x28fe('0x3b')](_0xc842fa['query'][_0x28fe('0x3b')]));_0x2cfaa7['attributes']=_0x2cfaa7[_0x28fe('0x3a')]['length']?_0x2cfaa7['attributes']:_0x238707[_0x28fe('0x35')];if(!_0xc842fa['query'][_0x28fe('0x3c')]('nolimit')){_0x2cfaa7[_0x28fe('0x21')]=qs['limit'](_0xc842fa[_0x28fe('0x38')]['limit']);_0x2cfaa7['offset']=qs[_0x28fe('0x24')](_0xc842fa[_0x28fe('0x38')][_0x28fe('0x24')]);}_0x2cfaa7[_0x28fe('0x3d')]=qs['sort'](_0xc842fa[_0x28fe('0x38')][_0x28fe('0x3e')]);_0x2cfaa7['where']=qs[_0x28fe('0x3f')](_[_0x28fe('0x40')](_0xc842fa[_0x28fe('0x38')],_0x238707[_0x28fe('0x3f')]),_0xa70277);if(_0xc842fa[_0x28fe('0x38')]['filter']){_0x2cfaa7[_0x28fe('0x41')]=_['merge'](_0x2cfaa7[_0x28fe('0x41')],{'$or':_['map'](_0xa70277,function(_0x10105d){if(_0x10105d['type']!=='VIRTUAL'){var _0x399aba={};_0x399aba[_0x10105d[_0x28fe('0x37')]]={'$like':'%'+_0xc842fa[_0x28fe('0x38')][_0x28fe('0x42')]+'%'};return _0x399aba;}})});}_0x2cfaa7=_[_0x28fe('0x43')]({},_0x2cfaa7,_0xc842fa['options']);var _0x1ed987={'where':_0x2cfaa7[_0x28fe('0x41')]};return db[_0x28fe('0x30')][_0x28fe('0x23')](_0x1ed987)[_0x28fe('0x2a')](function(_0x57e08e){_0x379cf5[_0x28fe('0x23')]=_0x57e08e;if(_0xc842fa['query'][_0x28fe('0x44')]){_0x2cfaa7['include']=[{'all':!![]}];}return db['UserProfile'][_0x28fe('0x45')](_0x2cfaa7);})[_0x28fe('0x2a')](function(_0x2ec36f){_0x379cf5[_0x28fe('0x46')]=_0x2ec36f;return _0x379cf5;})[_0x28fe('0x2a')](respondWithFilteredResult(_0xeb91b,_0x2cfaa7))['catch'](handleError(_0xeb91b,null));};exports[_0x28fe('0x47')]=function(_0x1c33cf,_0x9b4695){var _0x4e953b={'raw':![],'where':{'id':_0x1c33cf[_0x28fe('0x48')]['id']}},_0x284d58={};_0x284d58[_0x28fe('0x35')]=_[_0x28fe('0x49')](db['UserProfile'][_0x28fe('0x31')]);_0x284d58['query']=_[_0x28fe('0x49')](_0x1c33cf[_0x28fe('0x38')]);_0x284d58['filters']=_[_0x28fe('0x39')](_0x284d58[_0x28fe('0x35')],_0x284d58['query']);_0x4e953b[_0x28fe('0x3a')]=_['intersection'](_0x284d58[_0x28fe('0x35')],qs[_0x28fe('0x3b')](_0x1c33cf['query'][_0x28fe('0x3b')]));_0x4e953b[_0x28fe('0x3a')]=_0x4e953b[_0x28fe('0x3a')][_0x28fe('0x4a')]?_0x4e953b[_0x28fe('0x3a')]:_0x284d58['model'];if(_0x1c33cf[_0x28fe('0x38')][_0x28fe('0x44')]){_0x4e953b['include']=[{'all':!![]}];}_0x4e953b=_[_0x28fe('0x43')]({},_0x4e953b,_0x1c33cf[_0x28fe('0x4b')]);return db[_0x28fe('0x30')][_0x28fe('0x4c')](_0x4e953b)['then'](handleEntityNotFound(_0x9b4695,null))['then'](respondWithResult(_0x9b4695,null))[_0x28fe('0x4d')](handleError(_0x9b4695,null));};exports[_0x28fe('0x4e')]=function(_0x232770,_0x292387){return db['UserProfile'][_0x28fe('0x4e')](_0x232770[_0x28fe('0x4f')],{})[_0x28fe('0x2a')](respondWithResult(_0x292387,0xc9))[_0x28fe('0x4d')](handleError(_0x292387,null));};exports['clone']=function(_0x128abb,_0x2f5ad3){var _0x4d4f18={'where':{'id':_0x128abb[_0x28fe('0x48')]['id']}},_0x4718d0={};_0x4718d0[_0x28fe('0x35')]=_['keys'](db['UserProfile']['rawAttributes']);_0x4d4f18[_0x28fe('0x3a')]=_[_0x28fe('0x39')](_0x4718d0[_0x28fe('0x35')],qs[_0x28fe('0x3b')](_0x128abb['query'][_0x28fe('0x3b')]));_0x4d4f18[_0x28fe('0x3a')]=_0x4d4f18['attributes'][_0x28fe('0x4a')]?_0x4d4f18[_0x28fe('0x3a')]:_0x4718d0[_0x28fe('0x35')];if(_0x128abb[_0x28fe('0x38')][_0x28fe('0x44')]){_0x4d4f18['include']=[{'all':!![]}];}_0x4d4f18=_[_0x28fe('0x43')]({},_0x4d4f18,_0x128abb['options']);return db[_0x28fe('0x30')][_0x28fe('0x4c')](_0x4d4f18)[_0x28fe('0x2a')](handleEntityNotFound(_0x2f5ad3,null))[_0x28fe('0x2a')](function(_0x3d5875){if(_0x3d5875){var _0x15e2eb=_0x3d5875[_0x28fe('0x50')]({'plain':!![]});_0x15e2eb=qs[_0x28fe('0x51')](_0x15e2eb,['id',_0x28fe('0x52'),_0x28fe('0x53'),_0x28fe('0x54')]);_0x128abb['body']=_[_0x28fe('0x51')](_0x128abb[_0x28fe('0x4f')],['id','createdAt',_0x28fe('0x53')]);return db[_0x28fe('0x55')][_0x28fe('0x56')](function(_0x38d241){return db['UserProfile']['create'](_[_0x28fe('0x43')](_0x15e2eb,_0x128abb[_0x28fe('0x4f')]),{'include':_0x128abb[_0x28fe('0x38')][_0x28fe('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x38d241})[_0x28fe('0x2a')](function(_0x426b0a){var _0x510578=_0x426b0a[_0x28fe('0x50')]({'plain':!![]});return db[_0x28fe('0x57')]['findAll']({'where':{'userProfileId':_0x128abb[_0x28fe('0x48')]['id']},'raw':!![]})['then'](function(_0x51d7b1){if(_0x51d7b1){return BPromise['each'](_0x51d7b1,function(_0x834915){return new BPromise(function(_0x1a7469,_0x312b6a){if(_0x834915[_0x28fe('0x58')]===null||_0x834915['autoAssociation']===0x1)_0x1a7469(null);return db['UserProfileResource'][_0x28fe('0x45')]({'where':{'sectionId':_0x834915['id']},'raw':!![]})['then'](function(_0x28068f){var _0x5154fc=_[_0x28fe('0x36')](_0x28068f,function(_0x637741){return qs[_0x28fe('0x51')](_0x637741,['id',_0x28fe('0x52'),_0x28fe('0x53'),_0x28fe('0x59')]);});_0x1a7469(_0x5154fc);})[_0x28fe('0x4d')](function(_0x4e135b){_0x312b6a(_0x4e135b);});})['then'](function(_0x933118){var _0x4c90e5=qs['omit'](_0x834915,['id',_0x28fe('0x52'),_0x28fe('0x53')]);_0x4c90e5[_0x28fe('0x5a')]=_0x510578['id'];if(_0x933118)_0x4c90e5[_0x28fe('0x5b')]=_0x933118;return _0x4c90e5;})[_0x28fe('0x2a')](function(_0x57ea7c){return db[_0x28fe('0x57')]['create'](_0x57ea7c,{'include':[{'model':db[_0x28fe('0x5c')],'as':_0x28fe('0x5b')}],'raw':!![],'transaction':_0x38d241});});})[_0x28fe('0x2a')](function(){return _0x510578;});}});});});}})[_0x28fe('0x2a')](respondWithResult(_0x2f5ad3,0xc9))[_0x28fe('0x4d')](handleError(_0x2f5ad3,null));};exports['update']=function(_0x393906,_0x333ee1){if(_0x393906[_0x28fe('0x4f')]['id']){delete _0x393906['body']['id'];}return db[_0x28fe('0x30')]['find']({'where':{'id':_0x393906[_0x28fe('0x48')]['id']}})[_0x28fe('0x2a')](handleEntityNotFound(_0x333ee1,null))['then'](saveUpdates(_0x393906[_0x28fe('0x4f')],null))['then'](respondWithResult(_0x333ee1,null))[_0x28fe('0x4d')](handleError(_0x333ee1,null));};exports['destroy']=function(_0x55d2e8,_0x64e1ba){return db[_0x28fe('0x30')][_0x28fe('0x4c')]({'where':{'id':_0x55d2e8['params']['id']}})[_0x28fe('0x2a')](handleEntityNotFound(_0x64e1ba,null))['then'](removeEntity(_0x64e1ba,null))[_0x28fe('0x4d')](handleError(_0x64e1ba,null));};exports[_0x28fe('0x5d')]=function(_0x51d29b,_0x316471){return db[_0x28fe('0x30')][_0x28fe('0x5d')]()['then'](respondWithResult(_0x316471,null))[_0x28fe('0x4d')](handleError(_0x316471,null));};exports[_0x28fe('0x5e')]=function(_0x4f3afe,_0x41e0b2){var _0x110aed=_0x4f3afe[_0x28fe('0x4f')];return db[_0x28fe('0x30')][_0x28fe('0x4c')]({'where':{'id':_0x4f3afe[_0x28fe('0x48')]['id']}})[_0x28fe('0x2a')](handleEntityNotFound(_0x41e0b2,null))['then'](function(_0x59dbaa){if(_0x59dbaa){return db[_0x28fe('0x55')][_0x28fe('0x56')](function(_0x23712c){return db['UserProfileSection'][_0x28fe('0x2b')]({'where':{'userProfileId':_0x4f3afe[_0x28fe('0x48')]['id'],'sectionId':_['map'](_0x110aed,function(_0x3bedce){return _0x3bedce[_0x28fe('0x59')];})},'transaction':_0x23712c})[_0x28fe('0x2a')](function(){var _0x43d4c1=_[_0x28fe('0x36')](_0x110aed,function(_0xcab2b2){_0xcab2b2[_0x28fe('0x5a')]=_0x4f3afe[_0x28fe('0x48')]['id'];return _0xcab2b2;});var _0x2539ea=[];return BPromise[_0x28fe('0x5f')](_0x43d4c1,function(_0xdd8d39){return db[_0x28fe('0x57')][_0x28fe('0x4e')](_0xdd8d39,{'include':[{'model':db[_0x28fe('0x5c')],'as':_0x28fe('0x5b')}],'raw':!![],'transaction':_0x23712c})[_0x28fe('0x2a')](function(_0x2da5c3){_0x2539ea[_0x28fe('0x60')](_0x2da5c3[_0x28fe('0x50')]({'plain':!![]}));});})[_0x28fe('0x2a')](function(){return _0x2539ea;});});});}})['then'](function(_0x568467){return _0x568467;})['then'](respondWithResult(_0x41e0b2,null))[_0x28fe('0x4d')](handleError(_0x41e0b2,null));};exports[_0x28fe('0x61')]=function(_0x164b52,_0x576282){var _0x5e357c;return db[_0x28fe('0x30')][_0x28fe('0x4c')]({'where':{'id':_0x164b52['params']['id']},'attributes':['id',_0x28fe('0x37')]})[_0x28fe('0x2a')](handleEntityNotFound(_0x576282,null))[_0x28fe('0x2a')](function(_0x4139e7){if(_0x4139e7){_0x5e357c=_0x4139e7;return db['UserProfileSection'][_0x28fe('0x2b')]({'where':{'userProfileId':_0x164b52['params']['id'],'sectionId':_0x164b52[_0x28fe('0x38')][_0x28fe('0x62')]}});}})['then'](function(){return _0x5e357c;})[_0x28fe('0x2a')](respondWithStatusCode(_0x576282,null))[_0x28fe('0x4d')](handleError(_0x576282,null));};exports[_0x28fe('0x63')]=function(_0x54fb31,_0x5089d4){var _0x177a8d=[];var _0x55cd3a=[];return db['UserProfileSection'][_0x28fe('0x45')]({'where':{'userProfileId':_0x54fb31[_0x28fe('0x48')]['id']},'raw':!![]})['then'](function(_0x4626e7){_0x177a8d=_['filter'](_0x4626e7,function(_0x681ff1){return _0x681ff1[_0x28fe('0x64')]===0x1||_[_0x28fe('0x65')]([0x3eb,0x709],_0x681ff1[_0x28fe('0x59')]);});if(!_[_0x28fe('0x66')](_0x177a8d)){return _['map'](_0x177a8d,function(_0x13650b){return _0x13650b[_0x28fe('0x59')];});}else{return;}})[_0x28fe('0x2a')](function(_0x36faff){if(_0x36faff)_0x55cd3a=_0x36faff;if(_[_0x28fe('0x65')](_0x55cd3a,0x64)){var _0x5c064a=_[_0x28fe('0x4c')](_0x177a8d,{'sectionId':0x64});return hasDefaultDashboard(_0x5c064a)[_0x28fe('0x2a')](function(_0x1620c3){return _['map'](_0x177a8d,function(_0x66bc8f){if(_0x66bc8f[_0x28fe('0x59')]===0x64){_0x66bc8f[_0x28fe('0x67')]=_0x1620c3;}return _0x66bc8f;});});}else{return;}})[_0x28fe('0x2a')](function(_0xf3bbb8){if(_0xf3bbb8)_0x177a8d=_0xf3bbb8;if(_[_0x28fe('0x65')](_0x55cd3a,0x3eb)){var _0x27c5e6=_['find'](_0x177a8d,{'sectionId':0x3eb});return getCustomDashboards(_0x27c5e6)[_0x28fe('0x2a')](function(_0x212b39){return _[_0x28fe('0x36')](_0x177a8d,function(_0x1568ed){if(_0x27c5e6['enabled']){if(_0x1568ed[_0x28fe('0x59')]===0x3eb){_0x1568ed[_0x28fe('0x67')]=_0x212b39;}}else{if(_0x1568ed[_0x28fe('0x59')]===0x64){if(!_0x1568ed['subsections']){_0x1568ed['subsections']=[];}_0x1568ed['subsections']=_0x1568ed[_0x28fe('0x67')][_0x28fe('0x68')](_0x212b39);}}return _0x1568ed;});});}else{return;}})[_0x28fe('0x2a')](function(_0x102467){if(_0x102467)_0x177a8d=_0x102467;if(_[_0x28fe('0x65')](_0x55cd3a,0x709)){var _0x39f5cd=_[_0x28fe('0x4c')](_0x177a8d,{'sectionId':0x709});return getPlugins(_0x39f5cd)[_0x28fe('0x2a')](function(_0x420584){if(_0x39f5cd['enabled']){return _['map'](_0x177a8d,function(_0x4c33a6){if(_0x4c33a6[_0x28fe('0x59')]===0x709){_0x4c33a6['subsections']=_0x420584;}return _0x4c33a6;});}else{var _0x3eddf3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x420584};var _0x2edaaa=_[_0x28fe('0x36')](_0x177a8d);_0x2edaaa['push'](_0x3eddf3);return _0x2edaaa;}});}else{return;}})[_0x28fe('0x2a')](function(_0x3491e5){if(_0x3491e5)_0x177a8d=_0x3491e5;return _[_0x28fe('0x42')](_0x177a8d,[_0x28fe('0x64'),0x1]);})['then'](respondWithResult(_0x5089d4,null))[_0x28fe('0x4d')](handleError(_0x5089d4,null));};function hasDefaultDashboard(_0x228f6c){var _0x49419d=[0x65];return new BPromise(function(_0x28e7ce,_0x5ad2be){try{if(_0x228f6c['autoAssociation']){_0x28e7ce(_0x49419d);}else{return db[_0x28fe('0x5c')]['findOne']({'where':{'sectionId':_0x228f6c['id']},'raw':!![]})[_0x28fe('0x2a')](function(_0x359169){_0x359169?_0x28e7ce(_0x49419d):_0x28e7ce();});}}catch(_0xbb9415){_0x5ad2be(_0xbb9415);}});}function getCustomDashboards(_0x3dde05){var _0x442deb=[];return new BPromise(function(_0x138789,_0x2f3fa3){try{if(_0x3dde05['autoAssociation']){return db[_0x28fe('0x69')][_0x28fe('0x45')]({'raw':!![]})[_0x28fe('0x2a')](function(_0x23dcc7){_0x23dcc7[_0x28fe('0x6a')](function(_0x5ec569){_0x442deb[_0x28fe('0x60')](_0x5ec569['id']+0x1869f);});_0x138789(_0x442deb);});}else{return db[_0x28fe('0x5c')][_0x28fe('0x45')]({'where':{'sectionId':_0x3dde05['id']},'raw':!![]})[_0x28fe('0x2a')](function(_0x56aa5c){_0x56aa5c[_0x28fe('0x6a')](function(_0x395314){_0x442deb[_0x28fe('0x60')](_0x395314[_0x28fe('0x6b')]+0x1869f);});_0x138789(_0x442deb);});}}catch(_0x41f7c0){_0x2f3fa3(_0x41f7c0);}});}function getPlugins(_0x183a5b){var _0x141b81=[];return new BPromise(function(_0x22f220,_0x565d24){try{if(_0x183a5b[_0x28fe('0x58')]){return db[_0x28fe('0x6c')][_0x28fe('0x45')]({'raw':!![]})[_0x28fe('0x2a')](function(_0x459675){_0x459675['forEach'](function(_0x4d4bf9){_0x141b81['push'](_0x4d4bf9['id']+0x15b38);});_0x22f220(_0x141b81);});}else{return db[_0x28fe('0x5c')][_0x28fe('0x45')]({'where':{'sectionId':_0x183a5b['id']},'raw':!![]})[_0x28fe('0x2a')](function(_0x5dd1c7){_0x5dd1c7['forEach'](function(_0x2d83b9){_0x141b81[_0x28fe('0x60')](_0x2d83b9[_0x28fe('0x6b')]+0x15b38);});_0x22f220(_0x141b81);});}}catch(_0xd62951){_0x565d24(_0xd62951);}});}exports[_0x28fe('0x6d')]=function(_0x455ad8,_0x553597){return db['UserProfile'][_0x28fe('0x4c')]({'where':{'id':_0x455ad8[_0x28fe('0x48')]['id']}})[_0x28fe('0x2a')](handleEntityNotFound(_0x553597,null))['then'](function(_0x287b48){if(_0x287b48){return db[_0x28fe('0x55')][_0x28fe('0x56')](function(_0x5e2477){return db[_0x28fe('0x57')][_0x28fe('0x45')]({'where':{'userProfileId':_0x455ad8['params']['id']},'attributes':['id'],'raw':!![]})[_0x28fe('0x2a')](function(_0x433814){if(_0x433814){return db['UserProfileSection'][_0x28fe('0x2b')]({'where':{'userProfileId':_0x455ad8[_0x28fe('0x48')]['id'],'id':_['map'](_0x433814,function(_0x388f02){return _0x388f02['id'];})},'transaction':_0x5e2477});}})[_0x28fe('0x2a')](function(_0x2baf11){var _0x4ee49b=_[_0x28fe('0x36')](_0x455ad8[_0x28fe('0x4f')],function(_0x1775da){_0x1775da['userProfileId']=_0x455ad8['params']['id'];return _0x1775da;});return db[_0x28fe('0x57')]['bulkCreate'](_0x4ee49b,{'raw':!![],'transaction':_0x5e2477});})['then'](function(_0x48bca3){var _0x1cee7d=_['filter'](_[_0x28fe('0x36')](_0x48bca3,function(_0x124887){return _0x124887[_0x28fe('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x1cee7d){return db[_0x28fe('0x57')][_0x28fe('0x45')]({'where':{'userProfileId':_0x455ad8[_0x28fe('0x48')]['id'],'sectionId':_['map'](_0x1cee7d,function(_0x54a039){return _0x54a039['sectionId'];})},'attributes':['id',_0x28fe('0x59')],'raw':!![]})['then'](function(_0x9438d1){var _0x501a1b=_[_0x28fe('0x36')](_0x455ad8[_0x28fe('0x4f')],function(_0x317c03){_0x317c03[_0x28fe('0x5a')]=_0x455ad8[_0x28fe('0x48')]['id'];return _0x317c03;});return db['UserProfileResource']['bulkCreate'](_0x501a1b,{'raw':!![],'transaction':_0x5e2477});});}})[_0x28fe('0x4d')](handleError(_0x553597,null));});}})['then'](function(_0x193978){var _0x53ec3b=_[_0x28fe('0x36')](_0x193978,function(_0x4c7ec3){return _0x4c7ec3[_0x28fe('0x50')]({'plain':!![]});});})[_0x28fe('0x2a')](respondWithResult(_0x553597,null))[_0x28fe('0x4d')](handleError(_0x553597,null));};exports[_0x28fe('0x6e')]=function(_0x2bcf31,_0x23df64,_0x41af61){return db[_0x28fe('0x30')][_0x28fe('0x4c')]({'where':{'id':_0x2bcf31[_0x28fe('0x48')]['id']}})['then'](handleEntityNotFound(_0x23df64,null))[_0x28fe('0x2a')](function(_0x8042dc){if(_0x8042dc){return _0x8042dc[_0x28fe('0x6e')](_0x2bcf31['query'][_0x28fe('0x62')]);}})[_0x28fe('0x2a')](respondWithStatusCode(_0x23df64,null))[_0x28fe('0x4d')](handleError(_0x23df64,null));};exports[_0x28fe('0x6f')]=function(_0x74f9b4,_0x369a10){var _0x3fa13b={};if(!_0x74f9b4['query'][_0x28fe('0x70')])throw new Error(_0x28fe('0x71'));if(!_0x74f9b4[_0x28fe('0x38')][_0x28fe('0x3c')](_0x28fe('0x72'))){_0x3fa13b['limit']=qs[_0x28fe('0x21')](_0x74f9b4[_0x28fe('0x38')][_0x28fe('0x21')]);_0x3fa13b[_0x28fe('0x24')]=qs['offset'](_0x74f9b4[_0x28fe('0x38')][_0x28fe('0x24')]);}return db['UserProfile'][_0x28fe('0x4c')]({'where':{'id':_0x74f9b4[_0x28fe('0x48')]['id']}})[_0x28fe('0x2a')](function(_0x261c4e){if(!_0x261c4e)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x74f9b4[_0x28fe('0x48')]['id']);return db['UserProfile']['getResources'](_0x74f9b4);})[_0x28fe('0x2a')](respondWithFilteredResult(_0x369a10,_0x3fa13b))['catch'](handleError(_0x369a10,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 66ed6fa..7d693d6 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 _0x9582=['../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x234fec,_0x5f51bf){var _0x449cd8=function(_0x51b9e2){while(--_0x51b9e2){_0x234fec['push'](_0x234fec['shift']());}};_0x449cd8(++_0x5f51bf);}(_0x9582,0x95));var _0x2958=function(_0x170e7e,_0x48f71e){_0x170e7e=_0x170e7e-0x0;var _0x50e30a=_0x9582[_0x170e7e];return _0x50e30a;};'use strict';var EventEmitter=require(_0x2958('0x0'));var UserProfile=require(_0x2958('0x1'))['db'][_0x2958('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2958('0x3')](0x0);var events={'afterCreate':_0x2958('0x4'),'afterUpdate':_0x2958('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a44fa){return function(_0x3b907e,_0x136c77,_0x195138){UserProfileEvents[_0x2958('0x6')](_0x2a44fa+':'+_0x3b907e['id'],_0x3b907e);UserProfileEvents[_0x2958('0x6')](_0x2a44fa,_0x3b907e);_0x195138(null);};}for(var e in events){if(events[_0x2958('0x7')](e)){var event=events[e];UserProfile[_0x2958('0x8')](e,emitEvent(event));}}module[_0x2958('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x8b8e=['save','emit','hasOwnProperty','hook','exports','events','UserProfile'];(function(_0x1035eb,_0x4023d7){var _0x35a2db=function(_0x3af4cf){while(--_0x3af4cf){_0x1035eb['push'](_0x1035eb['shift']());}};_0x35a2db(++_0x4023d7);}(_0x8b8e,0x108));var _0xe8b8=function(_0x54f270,_0x5116ba){_0x54f270=_0x54f270-0x0;var _0x2fee7d=_0x8b8e[_0x54f270];return _0x2fee7d;};'use strict';var EventEmitter=require(_0xe8b8('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xe8b8('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe8b8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb409fe){return function(_0x472a91,_0x13a865,_0x221ccc){UserProfileEvents[_0xe8b8('0x3')](_0xb409fe+':'+_0x472a91['id'],_0x472a91);UserProfileEvents[_0xe8b8('0x3')](_0xb409fe,_0x472a91);_0x221ccc(null);};}for(var e in events){if(events[_0xe8b8('0x4')](e)){var event=events[e];UserProfile[_0xe8b8('0x5')](e,emitEvent(event));}}module[_0xe8b8('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 69b33fb..e4a0e67 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 _0x13da=['ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','scheduler','Sound','tags','Tag','templates','triggers','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','toString','define','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','ignore','union','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','options','include','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','includeAll','Tags','color','tag','ThroughTags','openTabs','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','then','associatedResources','catch','model','findAll','map','name','UserProfileResource','AnalyticExtractedReport','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','voicemails','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','inbound','VoiceQueue','outbound','musiconholds','voiceprefixes','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','user','zendeskaccounts'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x13da,0x67));var _0xa13d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13da[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa13d('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xa13d('0x1'));var squel=require(_0xa13d('0x2'));module[_0xa13d('0x3')]=function(_0x463e1a){var _0x267a43=_0x463e1a[_0xa13d('0x4')];function _0x2fafa6(_0x9619a0,_0x5f2ce2){return new Promise(function(_0x284255,_0x3d1545){if(!_0x5f2ce2)return _0x284255(null);var _0x114008=_0x5f2ce2['filter']?{[_0x5f2ce2[_0xa13d('0x5')][_0xa13d('0x6')]]:_0x5f2ce2[_0xa13d('0x5')][_0xa13d('0x7')]}:undefined;return _0x267a43[_0x9619a0]['findAll']({'where':_0x114008,'raw':!![]})[_0xa13d('0x8')](function(_0x4b2b78){_0x5f2ce2[_0xa13d('0x9')]=_['map'](_0x4b2b78,'id');_0x284255(_0x5f2ce2);})[_0xa13d('0xa')](function(_0x26de4e){_0x3d1545(_0x26de4e);});});}function _0x44b819(_0x11557b,_0x3447bf){return new Promise(function(_0x2f6580,_0x2feb10){var _0x2d8b37=_0x11557b[_0xa13d('0x5')]?{[_0x11557b['filter']['field']]:_0x11557b['filter'][_0xa13d('0x7')]}:undefined;return _0x267a43[_0x11557b[_0xa13d('0xb')]][_0xa13d('0xc')]({'where':_0x2d8b37,'raw':!![]})[_0xa13d('0x8')](function(_0x5f4795){_0x3447bf['associatedResources']=_[_0xa13d('0xd')](_0x5f4795,function(_0xe9ec6a){return _0xe9ec6a[_0xa13d('0xe')];});_0x2f6580(_0x3447bf);})[_0xa13d('0xa')](function(_0x1e0b6f){_0x2feb10(_0x1e0b6f);});});}function _0x2a3701(_0x308ae5,_0xe4f5ca,_0x89aa40){if(!_0xe4f5ca)return Promise['resolve'](null);return new Promise(function(_0x31a8db,_0x3c7195){return _0x267a43[_0xa13d('0xf')][_0xa13d('0xc')]({'where':{'sectionId':_0xe4f5ca['id']},'raw':!![]})[_0xa13d('0x8')](function(_0x48620a){if(_0x308ae5['field']&&_0x308ae5[_0xa13d('0x6')]!=='id'){_0xe4f5ca[_0xa13d('0x9')]=_['map'](_0x48620a,function(_0x173c0e){return _0x173c0e[_0x308ae5['field']];});}else{if(_0x89aa40===_0xa13d('0x10')){_0xe4f5ca[_0xa13d('0x9')]=_['map'](_0x48620a,function(_0x1069bc){return{'id':_0x1069bc['resourceId'],'type':_0x1069bc[_0xa13d('0x11')]};});}else{_0xe4f5ca[_0xa13d('0x9')]=_[_0xa13d('0xd')](_0x48620a,function(_0x178457){return _0x178457['resourceId'];});}}_0x31a8db(_0xe4f5ca);})['catch'](function(_0xa2a09a){_0x3c7195(_0xa2a09a);});});}function _0x24aabf(_0x4b0547,_0x2da16d){var _0x366fb9={'parentSections':[]};switch(_0x4b0547[_0xa13d('0x12')]()){case _0xa13d('0x13'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x15');break;case _0xa13d('0x16'):_0x366fb9[_0xa13d('0x14')]='SquareOdbc';break;case _0xa13d('0x17'):_0x366fb9['childModel']=_0xa13d('0x18');_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x1a'),'field':'name','foreignKey':_0xa13d('0x1b')}];break;case _0xa13d('0x1c'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x1d');break;case _0xa13d('0x1e'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x1f');_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x20'),'field':'id','foreignKey':_0xa13d('0x21')}];break;case'lists':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x22');break;case _0xa13d('0x23'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x24');break;case _0xa13d('0x25'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x26');break;case _0xa13d('0x27'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x28');break;case _0xa13d('0x29'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x2a');break;case _0xa13d('0x2b'):_0x366fb9['childModel']=_0xa13d('0x2c');break;case _0xa13d('0x2d'):_0x366fb9['childModel']=_0xa13d('0x2e');break;case _0xa13d('0x2f'):case _0xa13d('0x30'):case'outboundroutes':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x31');break;case _0xa13d('0x32'):_0x366fb9[_0xa13d('0x14')]='VoiceContext';break;case _0xa13d('0x33'):_0x366fb9['childModel']='VoiceMail';break;case'voicerecordings':_0x366fb9[_0xa13d('0x14')]='VoiceRecording';_0x366fb9['parentSections']=[{'name':_0xa13d('0x34'),'field':_0xa13d('0xe'),'foreignKey':'membername','model':_0xa13d('0x35'),'filter':{'field':_0xa13d('0x36'),'value':[_0xa13d('0x37')]}},{'name':_0xa13d('0x38'),'field':'name','foreignKey':_0xa13d('0x39'),'model':_0xa13d('0x35'),'filter':{'field':_0xa13d('0x36'),'value':[_0xa13d('0x3a')]}},{'name':_0xa13d('0x3b'),'field':_0xa13d('0xe'),'foreignKey':_0xa13d('0x3c'),'model':'VoiceQueue','filter':{'field':_0xa13d('0x11'),'value':[_0xa13d('0x3d')]}},{'name':'QueueCampaigns','field':_0xa13d('0xe'),'foreignKey':'queue','model':_0xa13d('0x3e'),'filter':{'field':'type','value':[_0xa13d('0x3f')]}}];break;case _0xa13d('0x40'):_0x366fb9[_0xa13d('0x14')]='VoiceMusicOnHold';break;case'chanspies':_0x366fb9[_0xa13d('0x14')]='VoiceChanSpy';break;case _0xa13d('0x41'):_0x366fb9['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x366fb9[_0xa13d('0x14')]='Campaign';break;case _0xa13d('0x42'):_0x366fb9[_0xa13d('0x14')]='MailQueue';break;case _0xa13d('0x43'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x44');break;case _0xa13d('0x45'):_0x366fb9[_0xa13d('0x14')]='MailSubstatus';break;case _0xa13d('0x46'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x47');break;case _0xa13d('0x48'):_0x366fb9['childModel']=_0xa13d('0x49');break;case'smsqueues':_0x366fb9[_0xa13d('0x14')]='SmsQueue';break;case'smsaccounts':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x4a');break;case'whatsappqueues':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x4b');break;case _0xa13d('0x4c'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x4d');break;case _0xa13d('0x4e'):_0x366fb9['childModel']='Team';break;case _0xa13d('0x4f'):case _0xa13d('0x50'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x3e');if(_0x2da16d){_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x3b')},{'name':_0xa13d('0x51')}];}break;case _0xa13d('0x52'):case _0xa13d('0x53'):case _0xa13d('0x54'):_0x366fb9['childModel']=_0xa13d('0x35');if(_0x2da16d){_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x55'),'filter':{'field':_0xa13d('0x36'),'value':['admin',_0xa13d('0x56')]},'ignore':!![]},{'name':_0xa13d('0x34')},{'name':_0xa13d('0x38')}];}break;case _0xa13d('0x57'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x58');break;case _0xa13d('0x59'):_0x366fb9[_0xa13d('0x14')]='SalesforceAccount';break;case _0xa13d('0x5a'):_0x366fb9['childModel']=_0xa13d('0x5b');break;case _0xa13d('0x5c'):_0x366fb9[_0xa13d('0x14')]='SugarcrmAccount';break;case _0xa13d('0x5d'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x5e');break;case'zohoaccounts':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x5f');break;case _0xa13d('0x60'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x35');break;case _0xa13d('0x61'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x62');break;case _0xa13d('0x63'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x64');break;case _0xa13d('0x65'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x66');break;case _0xa13d('0x67'):_0x366fb9[_0xa13d('0x14')]='Interval';break;case _0xa13d('0x68'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x69');break;case _0xa13d('0x6a'):_0x366fb9[_0xa13d('0x14')]='Schedule';break;case'sounds':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x6b');break;case _0xa13d('0x6c'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x6d');break;case _0xa13d('0x6e'):_0x366fb9[_0xa13d('0x14')]='Template';break;case _0xa13d('0x6f'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x70');break;case _0xa13d('0x71'):_0x366fb9[_0xa13d('0x14')]='Trunk';break;case _0xa13d('0x72'):_0x366fb9['childModel']=_0xa13d('0x73');break;case'plugins':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x74');break;case _0xa13d('0x75'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x10');_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x76'),'field':'id','foreignKey':_0xa13d('0x77')}];break;case'metrics':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x78');break;}return _0x366fb9;}function _0xd910c6(_0x362e38,_0x15d491){var _0x5588b8=_0x362e38[_0xa13d('0x79')](0x0)[_0xa13d('0x7a')]()+_0x362e38[_0xa13d('0x7b')](0x1);var _0x52a8ab={'type':_0x267a43[_0xa13d('0x7c')][_0xa13d('0x7d')][_0xa13d('0x7e')],'raw':!![]};return new Promise(function(_0xdc83f6,_0x3903a3){var _0xe45c75=squel[_0xa13d('0x7f')]()[_0xa13d('0x6')](_0xa13d('0x80')+_0x5588b8+_0xa13d('0x81'),'id')[_0xa13d('0x6')](_0xa13d('0x82'))[_0xa13d('0x83')](_0xa13d('0x84')+_0x362e38+_0xa13d('0x85'),'ui')[_0xa13d('0x86')]('ui.UserId\x20=\x20?',_0x15d491['id']);return _0x267a43['sequelize']['query'](_0xe45c75[_0xa13d('0x87')](),_0x52a8ab)[_0xa13d('0x8')](function(_0x387ab7){_0x15d491[_0x5588b8+'OpenTabs']=_0x387ab7;_0xdc83f6(_0x387ab7);})[_0xa13d('0xa')](function(_0x28849c){_0x3903a3(_0x28849c);});});}return _0x463e1a[_0xa13d('0x88')]('UserProfile',attributes,{'tableName':_0xa13d('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2ace95){var _0xbb260f={'raw':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x8b')],'where':{}};var _0x16b0cb={};var _0xfa08ad={'count':0x0,'rows':[]};var _0x97b2c2=_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x8c')];var _0x3c0bdd=_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x8d')]||![];var _0x2a5a06=_0x24aabf(_0x97b2c2,_0x3c0bdd);if(!_0x2a5a06[_0xa13d('0x14')])throw new Error(_0xa13d('0x8e')+_0x97b2c2+'\x27');var _0x49941e=[{'name':_0x97b2c2}];if(!_[_0xa13d('0x8f')](_0x2a5a06['parentSections']))_0x49941e=_0x2a5a06[_0xa13d('0x19')];var _0x4d3eb5=[];for(var _0x30eed9=0x0;_0x30eed9<_0x49941e[_0xa13d('0x90')];_0x30eed9++){_0x4d3eb5[_0xa13d('0x91')](_0x267a43['UserProfileSection'][_0xa13d('0x92')]({'where':{'userProfileId':_0x2ace95[_0xa13d('0x93')]['id'],'name':_0x49941e[_0x30eed9][_0xa13d('0xe')]},'raw':!![]}));}return Promise['all'](_0x4d3eb5)[_0xa13d('0x8')](function(_0x16d44e){var _0x3e3b4a=_[_0xa13d('0x5')](_0x16d44e,function(_0x53e4f1){return _0x53e4f1?_0x53e4f1:undefined;});var _0x2139ca=_[_0xa13d('0x5')](_0x49941e,[_0xa13d('0x94'),!![]]);var _0x359806=_[_0xa13d('0x8f')](_0x3e3b4a)&&_['isEmpty'](_0x2139ca)?null:_[_0xa13d('0x95')](_0x2139ca,_0x3e3b4a);if(!_0x359806)return null;var _0x3261bf=[];for(var _0x2805fe=0x0;_0x2805fe<_0x359806['length'];_0x2805fe++){var _0x5bfaf1=_['find'](_0x49941e,function(_0x59c53e){return _0x359806[_0x2805fe]?_0x59c53e['name']===_0x359806[_0x2805fe][_0xa13d('0xe')]:null;});if(_0x5bfaf1){if(_0x359806[_0x2805fe][_0xa13d('0x94')]){_0x3261bf[_0xa13d('0x91')](_0x2fafa6(_0x2a5a06[_0xa13d('0x14')],_0x359806[_0x2805fe]));}else{if(!_0x359806[_0x2805fe][_0xa13d('0x96')]){_0x3261bf['push'](_0x2a3701(_0x5bfaf1,_0x359806[_0x2805fe],_0x2a5a06[_0xa13d('0x14')]));}else{if(_0x5bfaf1[_0xa13d('0xb')]){_0x3261bf[_0xa13d('0x91')](_0x44b819(_0x5bfaf1,_0x359806[_0x2805fe]));}}}}}return Promise[_0xa13d('0x97')](_0x3261bf);})['then'](function(_0xf33335){var _0x179ba7=_0xf33335;var _0x580f2d=null;if(_0x179ba7){_0x580f2d=_0x179ba7[_0xa13d('0x90')]===0x1?_0x179ba7[0x0]:null;}if(!_0x580f2d&&!_0x179ba7)return _0xfa08ad;var _0x25a45f=_0x267a43[_0x2a5a06[_0xa13d('0x14')]][_0xa13d('0x98')];_0x16b0cb['model']=_[_0xa13d('0x99')](_0x25a45f);_0x16b0cb['query']=_[_0xa13d('0x99')](_0x2ace95[_0xa13d('0x8a')]);_0x16b0cb[_0xa13d('0x9a')]=_[_0xa13d('0x9b')](_0x16b0cb[_0xa13d('0xb')],_0x16b0cb[_0xa13d('0x8a')]);_0xbb260f[_0xa13d('0x9c')]=_['intersection'](_0x16b0cb['model'],qs[_0xa13d('0x9d')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x9d')]));_0xbb260f['attributes']=_0xbb260f[_0xa13d('0x9c')][_0xa13d('0x90')]?_0xbb260f[_0xa13d('0x9c')]:_0x16b0cb[_0xa13d('0xb')];if(!_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x9e')](_0xa13d('0x9f'))){_0xbb260f[_0xa13d('0xa0')]=qs['limit'](_0x2ace95[_0xa13d('0x8a')]['limit']);_0xbb260f[_0xa13d('0xa1')]=qs[_0xa13d('0xa1')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xa1')]);}_0xbb260f[_0xa13d('0xa2')]=qs[_0xa13d('0xa3')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xa3')]);_0xbb260f[_0xa13d('0x86')]=qs['filters'](_['pick'](_0x2ace95[_0xa13d('0x8a')],_0x16b0cb[_0xa13d('0x9a')]));if(_0x2ace95['query'][_0xa13d('0x5')]){_0xbb260f[_0xa13d('0x86')]=_[_0xa13d('0xa4')](_0xbb260f['where'],{'$or':_[_0xa13d('0xd')](_0x25a45f,function(_0xf22312){if(_0xf22312['type']['key']!==_0xa13d('0xa5')){var _0x1f7eba={};_0x1f7eba[_0xf22312['field']]={'$like':'%'+_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x5')]+'%'};return _0x1f7eba;}})});}var _0x37ef89=[];var _0x5ad4cc=null;var _0x23f93a={};if(_0x580f2d){_0x5ad4cc=_[_0xa13d('0x92')](_0x49941e,['name',_0x580f2d[_0xa13d('0xe')]]);if(_0x5ad4cc[_0xa13d('0x6')]){_0x23f93a={};if(_0x2a5a06['childModel']==='AnalyticExtractedReport'){_0x23f93a[_0x5ad4cc[_0xa13d('0xa6')]]=_[_0xa13d('0xd')](_0x580f2d[_0xa13d('0x9')],'id');}else{_0x23f93a[_0x5ad4cc[_0xa13d('0xa6')]]=_0x580f2d[_0xa13d('0x9')];}_0x37ef89[_0xa13d('0x91')](_0x23f93a);}else{_0xbb260f[_0xa13d('0x86')]['id']=_0x580f2d['associatedResources'];}}else{for(var _0x5f0208=0x0;_0x5f0208<_0x179ba7[_0xa13d('0x90')];_0x5f0208++){_0x5ad4cc=_[_0xa13d('0x92')](_0x49941e,[_0xa13d('0xe'),_0x179ba7[_0x5f0208][_0xa13d('0xe')]]);if(_0x5ad4cc[_0xa13d('0x6')]){_0x23f93a={};_0x23f93a[_0x5ad4cc[_0xa13d('0xa6')]]=_0x179ba7[_0x5f0208]['associatedResources'];_0x37ef89[_0xa13d('0x91')](_0x23f93a);}else{if(!_0xbb260f[_0xa13d('0x86')]['id'])_0xbb260f[_0xa13d('0x86')]['id']=[];_0x179ba7[_0x5f0208]['associatedResources'][_0xa13d('0xa7')](function(_0x1c9690){_0xbb260f[_0xa13d('0x86')]['id'][_0xa13d('0x91')](_0x1c9690);});}}}if(!_[_0xa13d('0x8f')](_0x37ef89)){_0xbb260f['where']=_[_0xa13d('0xa4')](_0xbb260f['where'],{'$and':{'$or':_0x37ef89}});}_0xbb260f=_[_0xa13d('0xa4')]({},_0xbb260f,_0x2ace95[_0xa13d('0xa8')]);if(_0x580f2d&&!_0x580f2d[_0xa13d('0x96')]&&_0x2a5a06['childModel']===_0xa13d('0x10')){if(_0x2ace95['query']['includeAll']){_0xbb260f[_0xa13d('0xa9')]=[{'all':!![]}];}return _0x267a43[_0x2a5a06['childModel']][_0xa13d('0xc')](_0xbb260f)[_0xa13d('0x8')](function(_0x2509b3){var _0x2eeb92=[];_0x2509b3['forEach'](function(_0x50519b){var _0x80f8c;switch(_0x50519b[_0xa13d('0xaa')]){case _0xa13d('0xab'):_0x80f8c=_['find'](_0x580f2d['associatedResources'],function(_0x33c302){return _0x33c302['id']===_0x50519b[_0xa13d('0x77')]&&_0x33c302['type']===_0xa13d('0xac');});break;case _0xa13d('0xad'):_0x80f8c=_[_0xa13d('0x92')](_0x580f2d[_0xa13d('0x9')],function(_0x449913){return _0x449913['id']===_0x50519b[_0xa13d('0x77')]&&_0x449913[_0xa13d('0x11')]===_0xa13d('0xae');});break;}if(_0x80f8c)_0x2eeb92[_0xa13d('0x91')](_0x50519b);});_0xfa08ad['count']=_0x2eeb92[_0xa13d('0x90')];_0xfa08ad[_0xa13d('0xaf')]=_0x2eeb92;return _0xfa08ad;});}else{if(!_[_0xa13d('0x8f')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb0')])){_0xbb260f[_0xa13d('0x86')]['id']=_0xbb260f[_0xa13d('0x86')]['id']?_['intersection'](_0xbb260f['where']['id'],_0x2ace95[_0xa13d('0x8a')]['ids']):_0x2ace95[_0xa13d('0x8a')]['ids'];if(_0x2ace95['query'][_0xa13d('0xb1')]){_0xbb260f[_0xa13d('0xa2')]=_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb1')];}}if(_0x2ace95['query'][_0xa13d('0xb2')]){_0xbb260f[_0xa13d('0x86')]=_['merge'](_0xbb260f[_0xa13d('0x86')],{'$and':_0x2ace95['query'][_0xa13d('0xb2')]});}return _0x267a43[_0x2a5a06[_0xa13d('0x14')]]['count']({'where':_0xbb260f[_0xa13d('0x86')]})[_0xa13d('0x8')](function(_0x350945){_0xfa08ad[_0xa13d('0xb3')]=_0x350945;if(_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb4')]){if(_0x2a5a06[_0xa13d('0x14')]===_0xa13d('0x1f')){_0xbb260f[_0xa13d('0xa9')]=[{'model':_0x267a43['Tag'],'as':_0xa13d('0xb5'),'attributes':['id',_0xa13d('0xe'),_0xa13d('0xb6')],'required':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb7')]?!![]:![]},{'model':_0x267a43['Tag'],'as':_0xa13d('0xb8'),'attributes':['id',_0xa13d('0xe'),'color'],'through':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb7')]?{'attributes':[],'where':{'TagId':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb7')]||undefined}}:{},'required':_0x2ace95[_0xa13d('0x8a')]['tag']?!![]:![]}];}else{_0xbb260f[_0xa13d('0xa9')]=[{'all':!![]}];}}return _0x267a43[_0x2a5a06[_0xa13d('0x14')]]['findAll'](_0xbb260f);})['then'](function(_0x435e1a){_0xfa08ad['rows']=_0x435e1a;if(_0x97b2c2===_0xa13d('0x34')&&_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb9')]==='true'){var _0x54c0aa=[];for(var _0x5c84cb=0x0;_0x5c84cb<_0xfa08ad['rows'][_0xa13d('0x90')];_0x5c84cb++){_0x54c0aa[_0xa13d('0x91')](_0xd910c6('chat',_0xfa08ad['rows'][_0x5c84cb][_0xa13d('0xba')]));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbb'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb][_0xa13d('0xba')]));_0x54c0aa[_0xa13d('0x91')](_0xd910c6('fax',_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb]['dataValues']));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbc'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb][_0xa13d('0xba')]));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbd'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb]['dataValues']));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbe'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb]['dataValues']));}return Promise[_0xa13d('0x97')](_0x54c0aa)[_0xa13d('0x8')](function(){return _0xfa08ad;});}return _0xfa08ad;});}});}}});}; \ No newline at end of file +var _0xd4b9=['VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','value','findAll','then','associatedResources','map','catch','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','CmContact','parentSections','ListId','CmList','companies','CmCustomField','chatqueues','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceMail','voicerecordings','Agents','membername','User','agent','Telephones','name','telephone','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','Campaign','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','QueueCampaigns','agents','telephones','Users','role','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','Pause','scheduler','sounds','tags','Tag','templates','Template','Trigger','trunks','variables','Variable','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','union','autoAssociation','rawAttributes','model','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','key'];(function(_0x3a4a9b,_0x29315d){var _0x58454b=function(_0x5b0be4){while(--_0x5b0be4){_0x3a4a9b['push'](_0x3a4a9b['shift']());}};_0x58454b(++_0x29315d);}(_0xd4b9,0x19d));var _0x9d4b=function(_0x2e01e9,_0x44558e){_0x2e01e9=_0x2e01e9-0x0;var _0x547b4a=_0xd4b9[_0x2e01e9];return _0x547b4a;};'use strict';var _=require(_0x9d4b('0x0'));var attributes=require(_0x9d4b('0x1'));var qs=require(_0x9d4b('0x2'));var squel=require('squel');module[_0x9d4b('0x3')]=function(_0x548ac8){var _0x4c20d9=_0x548ac8['models'];function _0x1a618b(_0x54aba8,_0x4a915f){return new Promise(function(_0x4caf9e,_0x1bfaff){if(!_0x4a915f)return _0x4caf9e(null);var _0x4c9a6a=_0x4a915f[_0x9d4b('0x4')]?{[_0x4a915f['filter'][_0x9d4b('0x5')]]:_0x4a915f[_0x9d4b('0x4')][_0x9d4b('0x6')]}:undefined;return _0x4c20d9[_0x54aba8][_0x9d4b('0x7')]({'where':_0x4c9a6a,'raw':!![]})[_0x9d4b('0x8')](function(_0x35fec2){_0x4a915f[_0x9d4b('0x9')]=_[_0x9d4b('0xa')](_0x35fec2,'id');_0x4caf9e(_0x4a915f);})[_0x9d4b('0xb')](function(_0x3cb44d){_0x1bfaff(_0x3cb44d);});});}function _0x4d2df0(_0x165292,_0x5eea11){return new Promise(function(_0x2763d6,_0x29a4e1){var _0x4d148e=_0x165292[_0x9d4b('0x4')]?{[_0x165292['filter'][_0x9d4b('0x5')]]:_0x165292[_0x9d4b('0x4')][_0x9d4b('0x6')]}:undefined;return _0x4c20d9[_0x165292['model']][_0x9d4b('0x7')]({'where':_0x4d148e,'raw':!![]})['then'](function(_0x38082f){_0x5eea11[_0x9d4b('0x9')]=_[_0x9d4b('0xa')](_0x38082f,function(_0x4bebe0){return _0x4bebe0['name'];});_0x2763d6(_0x5eea11);})[_0x9d4b('0xb')](function(_0x3395be){_0x29a4e1(_0x3395be);});});}function _0x110d52(_0x4416d7,_0x153710,_0x5cb428){if(!_0x153710)return Promise['resolve'](null);return new Promise(function(_0x35db65,_0x3e8240){return _0x4c20d9[_0x9d4b('0xc')][_0x9d4b('0x7')]({'where':{'sectionId':_0x153710['id']},'raw':!![]})[_0x9d4b('0x8')](function(_0xb455){if(_0x4416d7[_0x9d4b('0x5')]&&_0x4416d7[_0x9d4b('0x5')]!=='id'){_0x153710[_0x9d4b('0x9')]=_[_0x9d4b('0xa')](_0xb455,function(_0x1a5ab3){return _0x1a5ab3[_0x4416d7[_0x9d4b('0x5')]];});}else{if(_0x5cb428===_0x9d4b('0xd')){_0x153710['associatedResources']=_[_0x9d4b('0xa')](_0xb455,function(_0x42e748){return{'id':_0x42e748[_0x9d4b('0xe')],'type':_0x42e748[_0x9d4b('0xf')]};});}else{_0x153710[_0x9d4b('0x9')]=_[_0x9d4b('0xa')](_0xb455,function(_0x38b11b){return _0x38b11b[_0x9d4b('0xe')];});}}_0x35db65(_0x153710);})['catch'](function(_0x5dfc69){_0x3e8240(_0x5dfc69);});});}function _0x48d2ae(_0x342e98,_0x2fba5a){var _0x5218b6={'parentSections':[]};switch(_0x342e98[_0x9d4b('0x10')]()){case _0x9d4b('0x11'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x13');break;case _0x9d4b('0x14'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x15');break;case'squarerecordings':_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x16');_0x5218b6['parentSections']=[{'name':_0x9d4b('0x17'),'field':'name','foreignKey':_0x9d4b('0x18')}];break;case _0x9d4b('0x19'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x1a');break;case'contacts':_0x5218b6['childModel']=_0x9d4b('0x1b');_0x5218b6[_0x9d4b('0x1c')]=[{'name':'Lists','field':'id','foreignKey':_0x9d4b('0x1d')}];break;case'lists':_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x1e');break;case _0x9d4b('0x1f'):_0x5218b6[_0x9d4b('0x12')]='CmCompany';break;case'globalcustomfields':_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x20');break;case _0x9d4b('0x21'):_0x5218b6['childModel']='ChatQueue';break;case _0x9d4b('0x22'):_0x5218b6['childModel']='ChatWebsite';break;case _0x9d4b('0x23'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x24');break;case _0x9d4b('0x25'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x26');break;case _0x9d4b('0x27'):case _0x9d4b('0x28'):case _0x9d4b('0x29'):_0x5218b6[_0x9d4b('0x12')]='VoiceExtension';break;case _0x9d4b('0x2a'):_0x5218b6['childModel']='VoiceContext';break;case'voicemails':_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x2b');break;case _0x9d4b('0x2c'):_0x5218b6[_0x9d4b('0x12')]='VoiceRecording';_0x5218b6[_0x9d4b('0x1c')]=[{'name':_0x9d4b('0x2d'),'field':'name','foreignKey':_0x9d4b('0x2e'),'model':_0x9d4b('0x2f'),'filter':{'field':'role','value':[_0x9d4b('0x30')]}},{'name':_0x9d4b('0x31'),'field':_0x9d4b('0x32'),'foreignKey':'membername','model':_0x9d4b('0x2f'),'filter':{'field':'role','value':[_0x9d4b('0x33')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x9d4b('0x34'),'model':_0x9d4b('0x35'),'filter':{'field':_0x9d4b('0xf'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0x9d4b('0x32'),'foreignKey':_0x9d4b('0x34'),'model':'VoiceQueue','filter':{'field':_0x9d4b('0xf'),'value':[_0x9d4b('0x36')]}}];break;case _0x9d4b('0x37'):_0x5218b6['childModel']=_0x9d4b('0x38');break;case _0x9d4b('0x39'):_0x5218b6[_0x9d4b('0x12')]='VoiceChanSpy';break;case _0x9d4b('0x3a'):_0x5218b6[_0x9d4b('0x12')]='VoicePrefix';break;case _0x9d4b('0x3b'):_0x5218b6['childModel']=_0x9d4b('0x3c');break;case'mailqueues':_0x5218b6[_0x9d4b('0x12')]='MailQueue';break;case _0x9d4b('0x3d'):_0x5218b6['childModel']='MailAccount';break;case _0x9d4b('0x3e'):_0x5218b6[_0x9d4b('0x12')]='MailSubstatus';break;case _0x9d4b('0x3f'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x40');break;case _0x9d4b('0x41'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x42');break;case _0x9d4b('0x43'):_0x5218b6['childModel']='SmsQueue';break;case _0x9d4b('0x44'):_0x5218b6['childModel']='SmsAccount';break;case _0x9d4b('0x45'):_0x5218b6['childModel']='WhatsappQueue';break;case _0x9d4b('0x46'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x47');break;case _0x9d4b('0x48'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x49');break;case _0x9d4b('0x4a'):case'queuecampaigns':_0x5218b6['childModel']='VoiceQueue';if(_0x2fba5a){_0x5218b6[_0x9d4b('0x1c')]=[{'name':'VoiceQueues'},{'name':_0x9d4b('0x4b')}];}break;case'users':case _0x9d4b('0x4c'):case _0x9d4b('0x4d'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x2f');if(_0x2fba5a){_0x5218b6[_0x9d4b('0x1c')]=[{'name':_0x9d4b('0x4e'),'filter':{'field':_0x9d4b('0x4f'),'value':[_0x9d4b('0x50'),_0x9d4b('0x51')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x9d4b('0x52'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x53');break;case _0x9d4b('0x54'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x55');break;case _0x9d4b('0x56'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x57');break;case _0x9d4b('0x58'):_0x5218b6[_0x9d4b('0x12')]='SugarcrmAccount';break;case'deskaccounts':_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x59');break;case _0x9d4b('0x5a'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x5b');break;case _0x9d4b('0x5c'):_0x5218b6['childModel']=_0x9d4b('0x2f');break;case'cannedanswers':_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x5d');break;case _0x9d4b('0x5e'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x5f');break;case _0x9d4b('0x60'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x61');break;case'intervals':_0x5218b6['childModel']=_0x9d4b('0x62');break;case'pauses':_0x5218b6['childModel']=_0x9d4b('0x63');break;case _0x9d4b('0x64'):_0x5218b6['childModel']='Schedule';break;case _0x9d4b('0x65'):_0x5218b6[_0x9d4b('0x12')]='Sound';break;case _0x9d4b('0x66'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x67');break;case _0x9d4b('0x68'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x69');break;case'triggers':_0x5218b6['childModel']=_0x9d4b('0x6a');break;case _0x9d4b('0x6b'):_0x5218b6[_0x9d4b('0x12')]='Trunk';break;case _0x9d4b('0x6c'):_0x5218b6['childModel']=_0x9d4b('0x6d');break;case _0x9d4b('0x6e'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x6f');break;case'extractedreports':_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0xd');_0x5218b6['parentSections']=[{'name':_0x9d4b('0x70'),'field':'id','foreignKey':_0x9d4b('0x71')}];break;case _0x9d4b('0x72'):_0x5218b6[_0x9d4b('0x12')]=_0x9d4b('0x73');break;}return _0x5218b6;}function _0x194dc8(_0x302611,_0x52fb87){var _0x291aa2=_0x302611[_0x9d4b('0x74')](0x0)[_0x9d4b('0x75')]()+_0x302611[_0x9d4b('0x76')](0x1);var _0xf1382c={'type':_0x4c20d9[_0x9d4b('0x77')][_0x9d4b('0x78')][_0x9d4b('0x79')],'raw':!![]};return new Promise(function(_0x4f8481,_0x1e2224){var _0x1241e0=squel[_0x9d4b('0x7a')]()[_0x9d4b('0x5')]('ui.'+_0x291aa2+_0x9d4b('0x7b'),'id')[_0x9d4b('0x5')]('ui.createdAt')[_0x9d4b('0x7c')](_0x9d4b('0x7d')+_0x302611+_0x9d4b('0x7e'),'ui')[_0x9d4b('0x7f')](_0x9d4b('0x80'),_0x52fb87['id']);return _0x4c20d9[_0x9d4b('0x81')][_0x9d4b('0x82')](_0x1241e0[_0x9d4b('0x83')](),_0xf1382c)[_0x9d4b('0x8')](function(_0x401be6){_0x52fb87[_0x291aa2+'OpenTabs']=_0x401be6;_0x4f8481(_0x401be6);})[_0x9d4b('0xb')](function(_0xb8fd7c){_0x1e2224(_0xb8fd7c);});});}return _0x548ac8['define'](_0x9d4b('0x84'),attributes,{'tableName':_0x9d4b('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1f108e){var _0x49a160={'raw':_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0x86')],'where':{}};var _0x4cbeda={};var _0x247ae7={'count':0x0,'rows':[]};var _0x19e01a=_0x1f108e['query'][_0x9d4b('0x87')];var _0x532c34=_0x1f108e['query'][_0x9d4b('0x88')]||![];var _0x9720d4=_0x48d2ae(_0x19e01a,_0x532c34);if(!_0x9720d4[_0x9d4b('0x12')])throw new Error(_0x9d4b('0x89')+_0x19e01a+'\x27');var _0x452f69=[{'name':_0x19e01a}];if(!_[_0x9d4b('0x8a')](_0x9720d4[_0x9d4b('0x1c')]))_0x452f69=_0x9720d4[_0x9d4b('0x1c')];var _0x2411ab=[];for(var _0x44542f=0x0;_0x44542f<_0x452f69[_0x9d4b('0x8b')];_0x44542f++){_0x2411ab[_0x9d4b('0x8c')](_0x4c20d9[_0x9d4b('0x8d')][_0x9d4b('0x8e')]({'where':{'userProfileId':_0x1f108e[_0x9d4b('0x8f')]['id'],'name':_0x452f69[_0x44542f][_0x9d4b('0x32')]},'raw':!![]}));}return Promise['all'](_0x2411ab)['then'](function(_0x42981e){var _0x4569f6=_[_0x9d4b('0x4')](_0x42981e,function(_0x30c4b2){return _0x30c4b2?_0x30c4b2:undefined;});var _0x4c294f=_[_0x9d4b('0x4')](_0x452f69,[_0x9d4b('0x90'),!![]]);var _0x4b594d=_[_0x9d4b('0x8a')](_0x4569f6)&&_[_0x9d4b('0x8a')](_0x4c294f)?null:_[_0x9d4b('0x91')](_0x4c294f,_0x4569f6);if(!_0x4b594d)return null;var _0x4de1a8=[];for(var _0x43256a=0x0;_0x43256a<_0x4b594d[_0x9d4b('0x8b')];_0x43256a++){var _0x58173d=_[_0x9d4b('0x8e')](_0x452f69,function(_0x4810de){return _0x4b594d[_0x43256a]?_0x4810de[_0x9d4b('0x32')]===_0x4b594d[_0x43256a][_0x9d4b('0x32')]:null;});if(_0x58173d){if(_0x4b594d[_0x43256a]['ignore']){_0x4de1a8[_0x9d4b('0x8c')](_0x1a618b(_0x9720d4[_0x9d4b('0x12')],_0x4b594d[_0x43256a]));}else{if(!_0x4b594d[_0x43256a][_0x9d4b('0x92')]){_0x4de1a8['push'](_0x110d52(_0x58173d,_0x4b594d[_0x43256a],_0x9720d4[_0x9d4b('0x12')]));}else{if(_0x58173d['model']){_0x4de1a8['push'](_0x4d2df0(_0x58173d,_0x4b594d[_0x43256a]));}}}}}return Promise['all'](_0x4de1a8);})['then'](function(_0x5a02e0){var _0x3210a8=_0x5a02e0;var _0x289a74=null;if(_0x3210a8){_0x289a74=_0x3210a8[_0x9d4b('0x8b')]===0x1?_0x3210a8[0x0]:null;}if(!_0x289a74&&!_0x3210a8)return _0x247ae7;var _0x28f009=_0x4c20d9[_0x9720d4[_0x9d4b('0x12')]][_0x9d4b('0x93')];_0x4cbeda[_0x9d4b('0x94')]=_[_0x9d4b('0x95')](_0x28f009);_0x4cbeda[_0x9d4b('0x82')]=_[_0x9d4b('0x95')](_0x1f108e[_0x9d4b('0x82')]);_0x4cbeda['filters']=_['intersection'](_0x4cbeda['model'],_0x4cbeda['query']);_0x49a160[_0x9d4b('0x96')]=_[_0x9d4b('0x97')](_0x4cbeda[_0x9d4b('0x94')],qs[_0x9d4b('0x98')](_0x1f108e[_0x9d4b('0x82')]['fields']));_0x49a160[_0x9d4b('0x96')]=_0x49a160[_0x9d4b('0x96')][_0x9d4b('0x8b')]?_0x49a160['attributes']:_0x4cbeda[_0x9d4b('0x94')];if(!_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0x99')](_0x9d4b('0x9a'))){_0x49a160['limit']=qs[_0x9d4b('0x9b')](_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0x9b')]);_0x49a160[_0x9d4b('0x9c')]=qs['offset'](_0x1f108e[_0x9d4b('0x82')]['offset']);}_0x49a160[_0x9d4b('0x9d')]=qs[_0x9d4b('0x9e')](_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0x9e')]);_0x49a160[_0x9d4b('0x7f')]=qs[_0x9d4b('0x9f')](_[_0x9d4b('0xa0')](_0x1f108e['query'],_0x4cbeda['filters']));if(_0x1f108e['query'][_0x9d4b('0x4')]){_0x49a160['where']=_[_0x9d4b('0xa1')](_0x49a160[_0x9d4b('0x7f')],{'$or':_['map'](_0x28f009,function(_0xad3c7d){if(_0xad3c7d[_0x9d4b('0xf')][_0x9d4b('0xa2')]!==_0x9d4b('0xa3')){var _0x33380f={};_0x33380f[_0xad3c7d[_0x9d4b('0x5')]]={'$like':'%'+_0x1f108e['query'][_0x9d4b('0x4')]+'%'};return _0x33380f;}})});}var _0x101a6e=[];var _0x455a26=null;var _0x5c917c={};if(_0x289a74){_0x455a26=_[_0x9d4b('0x8e')](_0x452f69,['name',_0x289a74[_0x9d4b('0x32')]]);if(_0x455a26[_0x9d4b('0x5')]){_0x5c917c={};if(_0x9720d4[_0x9d4b('0x12')]==='AnalyticExtractedReport'){_0x5c917c[_0x455a26[_0x9d4b('0xa4')]]=_['map'](_0x289a74['associatedResources'],'id');}else{_0x5c917c[_0x455a26['foreignKey']]=_0x289a74['associatedResources'];}_0x101a6e[_0x9d4b('0x8c')](_0x5c917c);}else{_0x49a160[_0x9d4b('0x7f')]['id']=_0x289a74[_0x9d4b('0x9')];}}else{for(var _0x11083f=0x0;_0x11083f<_0x3210a8['length'];_0x11083f++){_0x455a26=_[_0x9d4b('0x8e')](_0x452f69,['name',_0x3210a8[_0x11083f][_0x9d4b('0x32')]]);if(_0x455a26['field']){_0x5c917c={};_0x5c917c[_0x455a26[_0x9d4b('0xa4')]]=_0x3210a8[_0x11083f]['associatedResources'];_0x101a6e[_0x9d4b('0x8c')](_0x5c917c);}else{if(!_0x49a160['where']['id'])_0x49a160[_0x9d4b('0x7f')]['id']=[];_0x3210a8[_0x11083f][_0x9d4b('0x9')][_0x9d4b('0xa5')](function(_0x305f14){_0x49a160[_0x9d4b('0x7f')]['id'][_0x9d4b('0x8c')](_0x305f14);});}}}if(!_[_0x9d4b('0x8a')](_0x101a6e)){_0x49a160[_0x9d4b('0x7f')]=_[_0x9d4b('0xa1')](_0x49a160[_0x9d4b('0x7f')],{'$and':{'$or':_0x101a6e}});}_0x49a160=_[_0x9d4b('0xa1')]({},_0x49a160,_0x1f108e[_0x9d4b('0xa6')]);if(_0x289a74&&!_0x289a74[_0x9d4b('0x92')]&&_0x9720d4[_0x9d4b('0x12')]===_0x9d4b('0xd')){if(_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xa7')]){_0x49a160[_0x9d4b('0xa8')]=[{'all':!![]}];}return _0x4c20d9[_0x9720d4['childModel']][_0x9d4b('0x7')](_0x49a160)['then'](function(_0x351f08){var _0x123c99=[];_0x351f08[_0x9d4b('0xa5')](function(_0x20ec41){var _0x25ad11;switch(_0x20ec41[_0x9d4b('0xa9')]){case _0x9d4b('0xaa'):_0x25ad11=_[_0x9d4b('0x8e')](_0x289a74[_0x9d4b('0x9')],function(_0x1ec8e5){return _0x1ec8e5['id']===_0x20ec41['reportId']&&_0x1ec8e5[_0x9d4b('0xf')]===_0x9d4b('0xab');});break;case _0x9d4b('0xac'):_0x25ad11=_[_0x9d4b('0x8e')](_0x289a74[_0x9d4b('0x9')],function(_0x16f3ce){return _0x16f3ce['id']===_0x20ec41[_0x9d4b('0x71')]&&_0x16f3ce[_0x9d4b('0xf')]===_0x9d4b('0xad');});break;}if(_0x25ad11)_0x123c99[_0x9d4b('0x8c')](_0x20ec41);});_0x247ae7[_0x9d4b('0xae')]=_0x123c99[_0x9d4b('0x8b')];_0x247ae7[_0x9d4b('0xaf')]=_0x123c99;return _0x247ae7;});}else{if(!_[_0x9d4b('0x8a')](_0x1f108e['query']['ids'])){_0x49a160[_0x9d4b('0x7f')]['id']=_0x49a160['where']['id']?_[_0x9d4b('0x97')](_0x49a160['where']['id'],_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb0')]):_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb0')];if(_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb1')]){_0x49a160[_0x9d4b('0x9d')]=_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb1')];}}if(_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb2')]){_0x49a160[_0x9d4b('0x7f')]=_[_0x9d4b('0xa1')](_0x49a160[_0x9d4b('0x7f')],{'$and':_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb2')]});}return _0x4c20d9[_0x9720d4[_0x9d4b('0x12')]][_0x9d4b('0xae')]({'where':_0x49a160[_0x9d4b('0x7f')]})['then'](function(_0x35c9ef){_0x247ae7[_0x9d4b('0xae')]=_0x35c9ef;if(_0x1f108e[_0x9d4b('0x82')]['includeAll']){if(_0x9720d4[_0x9d4b('0x12')]===_0x9d4b('0x1b')){_0x49a160[_0x9d4b('0xa8')]=[{'model':_0x4c20d9[_0x9d4b('0x67')],'as':_0x9d4b('0xb3'),'attributes':['id','name',_0x9d4b('0xb4')],'required':_0x1f108e['query']['tag']?!![]:![]},{'model':_0x4c20d9['Tag'],'as':_0x9d4b('0xb5'),'attributes':['id',_0x9d4b('0x32'),_0x9d4b('0xb4')],'through':_0x1f108e['query'][_0x9d4b('0xb6')]?{'attributes':[],'where':{'TagId':_0x1f108e['query'][_0x9d4b('0xb6')]||undefined}}:{},'required':_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb6')]?!![]:![]}];}else{_0x49a160[_0x9d4b('0xa8')]=[{'all':!![]}];}}return _0x4c20d9[_0x9720d4['childModel']]['findAll'](_0x49a160);})['then'](function(_0x34207f){_0x247ae7[_0x9d4b('0xaf')]=_0x34207f;if(_0x19e01a===_0x9d4b('0x2d')&&_0x1f108e[_0x9d4b('0x82')][_0x9d4b('0xb7')]===_0x9d4b('0xb8')){var _0x233404=[];for(var _0x290063=0x0;_0x290063<_0x247ae7[_0x9d4b('0xaf')][_0x9d4b('0x8b')];_0x290063++){_0x233404[_0x9d4b('0x8c')](_0x194dc8(_0x9d4b('0xb9'),_0x247ae7[_0x9d4b('0xaf')][_0x290063][_0x9d4b('0xba')]));_0x233404[_0x9d4b('0x8c')](_0x194dc8(_0x9d4b('0xbb'),_0x247ae7[_0x9d4b('0xaf')][_0x290063][_0x9d4b('0xba')]));_0x233404[_0x9d4b('0x8c')](_0x194dc8(_0x9d4b('0xbc'),_0x247ae7[_0x9d4b('0xaf')][_0x290063][_0x9d4b('0xba')]));_0x233404[_0x9d4b('0x8c')](_0x194dc8(_0x9d4b('0xbd'),_0x247ae7[_0x9d4b('0xaf')][_0x290063][_0x9d4b('0xba')]));_0x233404['push'](_0x194dc8(_0x9d4b('0xbe'),_0x247ae7[_0x9d4b('0xaf')][_0x290063][_0x9d4b('0xba')]));_0x233404['push'](_0x194dc8(_0x9d4b('0xbf'),_0x247ae7[_0x9d4b('0xaf')][_0x290063]['dataValues']));}return Promise['all'](_0x233404)[_0x9d4b('0x8')](function(){return _0x247ae7;});}return _0x247ae7;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index ab55057..1152dc4 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 _0x22e3=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x516bcf,_0x154b52){var _0x405746=function(_0x53e1d9){while(--_0x53e1d9){_0x516bcf['push'](_0x516bcf['shift']());}};_0x405746(++_0x154b52);}(_0x22e3,0xf3));var _0x322e=function(_0x18d9aa,_0x560c05){_0x18d9aa=_0x18d9aa-0x0;var _0x1ff1c0=_0x22e3[_0x18d9aa];return _0x1ff1c0;};'use strict';var _=require(_0x322e('0x0'));var util=require(_0x322e('0x1'));var moment=require(_0x322e('0x2'));var BPromise=require('bluebird');var rs=require(_0x322e('0x3'));var fs=require('fs');var Redis=require(_0x322e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x322e('0x5'));var logger=require(_0x322e('0x6'))(_0x322e('0x7'));var config=require(_0x322e('0x8'));var jayson=require(_0x322e('0x9'));var client=jayson['client'][_0x322e('0xa')]({'port':0x232a});config[_0x322e('0xb')]=_[_0x322e('0xc')](config[_0x322e('0xb')],{'host':_0x322e('0xd'),'port':0x18eb});var socket=require(_0x322e('0xe'))(new Redis(config[_0x322e('0xb')]));require(_0x322e('0xf'))[_0x322e('0x10')](socket);function respondWithRpcPromise(_0x4c03ba,_0x4efb79,_0x311486){return new BPromise(function(_0x503f20,_0x35625d){return client['request'](_0x4c03ba,_0x311486)['then'](function(_0x4c9c99){logger[_0x322e('0x11')](_0x322e('0x12'),_0x4efb79,'request\x20sent');logger[_0x322e('0x13')](_0x322e('0x14'),_0x4efb79,_0x322e('0x15'),JSON['stringify'](_0x4c9c99));if(_0x4c9c99[_0x322e('0x16')]){if(_0x4c9c99[_0x322e('0x16')][_0x322e('0x17')]===0x1f4){logger[_0x322e('0x16')]('UserProfile,\x20%s,\x20%s',_0x4efb79,_0x4c9c99['error'][_0x322e('0x18')]);return _0x35625d(_0x4c9c99[_0x322e('0x16')]['message']);}logger[_0x322e('0x16')](_0x322e('0x12'),_0x4efb79,_0x4c9c99[_0x322e('0x16')][_0x322e('0x18')]);return _0x503f20(_0x4c9c99[_0x322e('0x16')]['message']);}else{logger[_0x322e('0x11')](_0x322e('0x12'),_0x4efb79,_0x322e('0x15'));_0x503f20(_0x4c9c99[_0x322e('0x19')]['message']);}})[_0x322e('0x1a')](function(_0x1f0771){logger[_0x322e('0x16')](_0x322e('0x12'),_0x4efb79,_0x1f0771);_0x35625d(_0x1f0771);});});} \ No newline at end of file +var _0x33af=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5233c1,_0x155089){var _0x54faef=function(_0x3b4912){while(--_0x3b4912){_0x5233c1['push'](_0x5233c1['shift']());}};_0x54faef(++_0x155089);}(_0x33af,0xec));var _0xf33a=function(_0x567f0e,_0x2be7a0){_0x567f0e=_0x567f0e-0x0;var _0x15aca8=_0x33af[_0x567f0e];return _0x15aca8;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});config[_0xf33a('0xa')]=_[_0xf33a('0xb')](config[_0xf33a('0xa')],{'host':_0xf33a('0xc'),'port':0x18eb});var socket=require(_0xf33a('0xd'))(new Redis(config['redis']));require(_0xf33a('0xe'))[_0xf33a('0xf')](socket);function respondWithRpcPromise(_0x115e08,_0x457b3b,_0x44ee7f){return new BPromise(function(_0x27f30a,_0x5074a2){return client['request'](_0x115e08,_0x44ee7f)[_0xf33a('0x10')](function(_0xb47cde){logger[_0xf33a('0x11')](_0xf33a('0x12'),_0x457b3b,_0xf33a('0x13'));logger['debug'](_0xf33a('0x14'),_0x457b3b,_0xf33a('0x13'),JSON['stringify'](_0xb47cde));if(_0xb47cde['error']){if(_0xb47cde[_0xf33a('0x15')][_0xf33a('0x16')]===0x1f4){logger[_0xf33a('0x15')](_0xf33a('0x12'),_0x457b3b,_0xb47cde[_0xf33a('0x15')][_0xf33a('0x17')]);return _0x5074a2(_0xb47cde[_0xf33a('0x15')][_0xf33a('0x17')]);}logger['error'](_0xf33a('0x12'),_0x457b3b,_0xb47cde['error'][_0xf33a('0x17')]);return _0x27f30a(_0xb47cde[_0xf33a('0x15')]['message']);}else{logger[_0xf33a('0x11')](_0xf33a('0x12'),_0x457b3b,'request\x20sent');_0x27f30a(_0xb47cde[_0xf33a('0x18')][_0xf33a('0x17')]);}})[_0xf33a('0x19')](function(_0x2a9f0e){logger['error'](_0xf33a('0x12'),_0x457b3b,_0x2a9f0e);_0x5074a2(_0x2a9f0e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 7ee3a79..6da66af 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 _0xb149=['remove','update','emit','length','./userProfile.events','save'];(function(_0x239e01,_0x1217d3){var _0x4619c9=function(_0x7a9326){while(--_0x7a9326){_0x239e01['push'](_0x239e01['shift']());}};_0x4619c9(++_0x1217d3);}(_0xb149,0x130));var _0x9b14=function(_0x1ca882,_0x14f6e6){_0x1ca882=_0x1ca882-0x0;var _0x357d7e=_0xb149[_0x1ca882];return _0x357d7e;};'use strict';var UserProfileEvents=require(_0x9b14('0x0'));var events=[_0x9b14('0x1'),_0x9b14('0x2'),_0x9b14('0x3')];function createListener(_0x1f8dd7,_0x5c7d59){return function(_0x273e33){_0x5c7d59[_0x9b14('0x4')](_0x1f8dd7,_0x273e33);};}function removeListener(_0x5079cc,_0x2c9027){return function(){UserProfileEvents['removeListener'](_0x5079cc,_0x2c9027);};}exports['register']=function(_0x70ab78){for(var _0x3e0689=0x0,_0x1374ab=events[_0x9b14('0x5')];_0x3e0689<_0x1374ab;_0x3e0689++){var _0x38944b=events[_0x3e0689];var _0x24cdeb=createListener('userProfile:'+_0x38944b,_0x70ab78);UserProfileEvents['on'](_0x38944b,_0x24cdeb);}}; \ No newline at end of file +var _0xb68e=['remove','update','removeListener','register','length','./userProfile.events','save'];(function(_0x4e662c,_0x56d8e2){var _0x33a35d=function(_0x2e3721){while(--_0x2e3721){_0x4e662c['push'](_0x4e662c['shift']());}};_0x33a35d(++_0x56d8e2);}(_0xb68e,0x15c));var _0xeb68=function(_0x3c8149,_0x19b47a){_0x3c8149=_0x3c8149-0x0;var _0x186c9f=_0xb68e[_0x3c8149];return _0x186c9f;};'use strict';var UserProfileEvents=require(_0xeb68('0x0'));var events=[_0xeb68('0x1'),_0xeb68('0x2'),_0xeb68('0x3')];function createListener(_0x3f8d40,_0x1307fa){return function(_0x56eca3){_0x1307fa['emit'](_0x3f8d40,_0x56eca3);};}function removeListener(_0x4abf94,_0x4bebe0){return function(){UserProfileEvents[_0xeb68('0x4')](_0x4abf94,_0x4bebe0);};}exports[_0xeb68('0x5')]=function(_0xfcf4d7){for(var _0x483eef=0x0,_0x403825=events[_0xeb68('0x6')];_0x483eef<_0x403825;_0x483eef++){var _0x221987=events[_0x483eef];var _0x2a601f=createListener('userProfile:'+_0x221987,_0xfcf4d7);UserProfileEvents['on'](_0x221987,_0x2a601f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index bb0e229..ac9fa3e 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 _0x2a4b=['show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x17a112,_0x29bb37){_0x17a112=_0x17a112-0x0;var _0x1bbe7b=_0x2a4b[_0x17a112];return _0x1bbe7b;};'use strict';var multer=require('multer');var util=require(_0xb2a4('0x0'));var path=require('path');var timeout=require(_0xb2a4('0x1'));var express=require(_0xb2a4('0x2'));var router=express[_0xb2a4('0x3')]();var fs_extra=require(_0xb2a4('0x4'));var auth=require(_0xb2a4('0x5'));var interaction=require(_0xb2a4('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x8')]);router[_0xb2a4('0x9')](_0xb2a4('0xa'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xb')]);router['get'](_0xb2a4('0xc'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xd')]);router[_0xb2a4('0xe')]('/',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xf')]);router['put'](_0xb2a4('0xc'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x10')]);router[_0xb2a4('0x11')](_0xb2a4('0xc'),auth['isAuthenticated'](),controller[_0xb2a4('0x12')]);module[_0xb2a4('0x13')]=router; \ No newline at end of file +var _0x96cb=['fs-extra','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x160ea0,_0x112f92){var _0x504a0a=function(_0x519b9c){while(--_0x519b9c){_0x160ea0['push'](_0x160ea0['shift']());}};_0x504a0a(++_0x112f92);}(_0x96cb,0x184));var _0xb96c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x96cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb96c('0x0'));var timeout=require(_0xb96c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb96c('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb96c('0x3'));var controller=require(_0xb96c('0x4'));router[_0xb96c('0x5')]('/',auth[_0xb96c('0x6')](),controller[_0xb96c('0x7')]);router[_0xb96c('0x5')]('/describe',auth[_0xb96c('0x6')](),controller['describe']);router[_0xb96c('0x5')](_0xb96c('0x8'),auth[_0xb96c('0x6')](),controller[_0xb96c('0x9')]);router['post']('/',auth[_0xb96c('0x6')](),controller['create']);router[_0xb96c('0xa')](_0xb96c('0x8'),auth[_0xb96c('0x6')](),controller[_0xb96c('0xb')]);router[_0xb96c('0xc')]('/:id',auth[_0xb96c('0x6')](),controller[_0xb96c('0xd')]);module[_0xb96c('0xe')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 36e930f..90310d8 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 _0xa429=['STRING','INTEGER','sequelize','exports'];(function(_0x546f1b,_0x20e863){var _0x4b34bd=function(_0x3af9a2){while(--_0x3af9a2){_0x546f1b['push'](_0x546f1b['shift']());}};_0x4b34bd(++_0x20e863);}(_0xa429,0x17a));var _0x9a42=function(_0x45451b,_0x283140){_0x45451b=_0x45451b-0x0;var _0x48cfd8=_0xa429[_0x45451b];return _0x48cfd8;};'use strict';var Sequelize=require(_0x9a42('0x0'));module[_0x9a42('0x1')]={'name':{'type':Sequelize[_0x9a42('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a42('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9a42('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x111c=['STRING','INTEGER','sequelize','exports'];(function(_0x426fea,_0x599858){var _0x20ef42=function(_0x1ef482){while(--_0x1ef482){_0x426fea['push'](_0x426fea['shift']());}};_0x20ef42(++_0x599858);}(_0x111c,0xf6));var _0xc111=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x111c[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xc111('0x0'));module[_0xc111('0x1')]={'name':{'type':Sequelize[_0xc111('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc111('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc111('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 f910be5..f03bf2e 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 _0x01d9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','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','../../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','apply','save','update','then','destroy','error','name','send','index','map','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['UserProfileResource'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['UserProfileResource'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));};exports[_0x901d('0x4d')]=function(_0x52aa2d,_0x3a3ea6){return db[_0x901d('0x2f')][_0x901d('0x4d')]()[_0x901d('0x28')](respondWithResult(_0x3a3ea6,null))[_0x901d('0x46')](handleError(_0x3a3ea6,null));}; \ No newline at end of file +var _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0xffb079,_0x2d5dc0){var _0x4ed0ee=function(_0x1d445f){while(--_0x1d445f){_0xffb079['push'](_0xffb079['shift']());}};_0x4ed0ee(++_0x2d5dc0);}(_0xafc4,0x69));var _0x4afc=function(_0x25d74c,_0x280743){_0x25d74c=_0x25d74c-0x0;var _0x4189ac=_0xafc4[_0x25d74c];return _0x4189ac;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 178ea69..0c21cf8 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 _0xd2b7=['UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd2b7,0x1d8));var _0x7d2b=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0xd2b7[_0x369a98];return _0x29565c;};'use strict';var _=require(_0x7d2b('0x0'));var util=require(_0x7d2b('0x1'));var logger=require(_0x7d2b('0x2'))(_0x7d2b('0x3'));var moment=require(_0x7d2b('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d2b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d2b('0x6'));var config=require(_0x7d2b('0x7'));var attributes=require(_0x7d2b('0x8'));module['exports']=function(_0x40345d,_0x11262d){return _0x40345d['define'](_0x7d2b('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x7d2b('0xa'),'fields':[_0x7d2b('0xb'),_0x7d2b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08a3=['rimraf','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2251fb,_0x415089){var _0xb2db68=function(_0x531773){while(--_0x531773){_0x2251fb['push'](_0x2251fb['shift']());}};_0xb2db68(++_0x415089);}(_0x08a3,0x13d));var _0x308a=function(_0x3100ac,_0x412d80){_0x3100ac=_0x3100ac-0x0;var _0x4b8a3d=_0x08a3[_0x3100ac];return _0x4b8a3d;};'use strict';var _=require(_0x308a('0x0'));var util=require(_0x308a('0x1'));var logger=require(_0x308a('0x2'))(_0x308a('0x3'));var moment=require(_0x308a('0x4'));var BPromise=require(_0x308a('0x5'));var rp=require(_0x308a('0x6'));var fs=require('fs');var path=require(_0x308a('0x7'));var rimraf=require(_0x308a('0x8'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x4c2635,_0x1b24a3){return _0x4c2635['define'](_0x308a('0x9'),attributes,{'tableName':_0x308a('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x308a('0xb'),_0x308a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 5e3da03..9317134 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 _0xfcfc=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x59107b,_0x1df703){var _0x393f6f=function(_0x3bbf94){while(--_0x3bbf94){_0x59107b['push'](_0x59107b['shift']());}};_0x393f6f(++_0x1df703);}(_0xfcfc,0x150));var _0xcfcf=function(_0x148061,_0x12979e){_0x148061=_0x148061-0x0;var _0x2cc3e0=_0xfcfc[_0x148061];return _0x2cc3e0;};'use strict';var _=require(_0xcfcf('0x0'));var util=require(_0xcfcf('0x1'));var moment=require(_0xcfcf('0x2'));var BPromise=require(_0xcfcf('0x3'));var rs=require(_0xcfcf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfcf('0x5'))['db'];var utils=require(_0xcfcf('0x6'));var logger=require(_0xcfcf('0x7'))(_0xcfcf('0x8'));var config=require('../../config/environment');var jayson=require(_0xcfcf('0x9'));var client=jayson[_0xcfcf('0xa')][_0xcfcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x396d64,_0x386dc5,_0x3b6ac0){return new BPromise(function(_0x22d1f4,_0x1c8b00){return client[_0xcfcf('0xc')](_0x396d64,_0x3b6ac0)[_0xcfcf('0xd')](function(_0x4f5a7e){logger[_0xcfcf('0xe')](_0xcfcf('0xf'),_0x386dc5,_0xcfcf('0x10'));logger[_0xcfcf('0x11')](_0xcfcf('0x12'),_0x386dc5,'request\x20sent',JSON[_0xcfcf('0x13')](_0x4f5a7e));if(_0x4f5a7e[_0xcfcf('0x14')]){if(_0x4f5a7e[_0xcfcf('0x14')][_0xcfcf('0x15')]===0x1f4){logger[_0xcfcf('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x386dc5,_0x4f5a7e[_0xcfcf('0x14')][_0xcfcf('0x16')]);return _0x1c8b00(_0x4f5a7e['error']['message']);}logger['error'](_0xcfcf('0xf'),_0x386dc5,_0x4f5a7e['error'][_0xcfcf('0x16')]);return _0x22d1f4(_0x4f5a7e[_0xcfcf('0x14')][_0xcfcf('0x16')]);}else{logger['info'](_0xcfcf('0xf'),_0x386dc5,_0xcfcf('0x10'));_0x22d1f4(_0x4f5a7e[_0xcfcf('0x17')][_0xcfcf('0x16')]);}})[_0xcfcf('0x18')](function(_0xefa269){logger['error'](_0xcfcf('0xf'),_0x386dc5,_0xefa269);_0x1c8b00(_0xefa269);});});} \ No newline at end of file +var _0x4066=['../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','UserProfileResource,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils'];(function(_0x167c1b,_0xdec0c7){var _0x1020bf=function(_0xa5d8ea){while(--_0xa5d8ea){_0x167c1b['push'](_0x167c1b['shift']());}};_0x1020bf(++_0xdec0c7);}(_0x4066,0x1b3));var _0x6406=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4066[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6406('0x0'));var util=require('util');var moment=require(_0x6406('0x1'));var BPromise=require('bluebird');var rs=require(_0x6406('0x2'));var fs=require('fs');var Redis=require(_0x6406('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6406('0x4'));var logger=require(_0x6406('0x5'))(_0x6406('0x6'));var config=require('../../config/environment');var jayson=require(_0x6406('0x7'));var client=jayson['client'][_0x6406('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ccdd4,_0x3e4d1f,_0x14ff13){return new BPromise(function(_0x10c0a2,_0x3f1c64){return client[_0x6406('0x9')](_0x2ccdd4,_0x14ff13)[_0x6406('0xa')](function(_0x580967){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x3e4d1f,_0x6406('0xb'));logger[_0x6406('0xc')](_0x6406('0xd'),_0x3e4d1f,_0x6406('0xb'),JSON[_0x6406('0xe')](_0x580967));if(_0x580967['error']){if(_0x580967['error'][_0x6406('0xf')]===0x1f4){logger['error'](_0x6406('0x10'),_0x3e4d1f,_0x580967[_0x6406('0x11')][_0x6406('0x12')]);return _0x3f1c64(_0x580967[_0x6406('0x11')][_0x6406('0x12')]);}logger[_0x6406('0x11')](_0x6406('0x10'),_0x3e4d1f,_0x580967[_0x6406('0x11')]['message']);return _0x10c0a2(_0x580967[_0x6406('0x11')]['message']);}else{logger[_0x6406('0x13')](_0x6406('0x10'),_0x3e4d1f,_0x6406('0xb'));_0x10c0a2(_0x580967[_0x6406('0x14')][_0x6406('0x12')]);}})[_0x6406('0x15')](function(_0x17f196){logger[_0x6406('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3e4d1f,_0x17f196);_0x3f1c64(_0x17f196);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 4de6704..174d996 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 _0x3b4b=['isAuthenticated','index','describe','/:id','show','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x455ebc,_0xaa565e){var _0x156d98=function(_0x1ad93b){while(--_0x1ad93b){_0x455ebc['push'](_0x455ebc['shift']());}};_0x156d98(++_0xaa565e);}(_0x3b4b,0xe6));var _0xb3b4=function(_0x54bbdd,_0x42ec26){_0x54bbdd=_0x54bbdd-0x0;var _0x5a4bfa=_0x3b4b[_0x54bbdd];return _0x5a4bfa;};'use strict';var multer=require('multer');var util=require(_0xb3b4('0x0'));var path=require(_0xb3b4('0x1'));var timeout=require('connect-timeout');var express=require(_0xb3b4('0x2'));var router=express[_0xb3b4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb3b4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb3b4('0x5'));var controller=require(_0xb3b4('0x6'));router[_0xb3b4('0x7')]('/',auth[_0xb3b4('0x8')](),controller[_0xb3b4('0x9')]);router[_0xb3b4('0x7')]('/describe',auth[_0xb3b4('0x8')](),controller[_0xb3b4('0xa')]);router[_0xb3b4('0x7')](_0xb3b4('0xb'),auth['isAuthenticated'](),controller[_0xb3b4('0xc')]);router['post']('/',auth[_0xb3b4('0x8')](),controller['create']);router['put'](_0xb3b4('0xb'),auth['isAuthenticated'](),controller[_0xb3b4('0xd')]);router[_0xb3b4('0xe')]('/:id',auth[_0xb3b4('0x8')](),controller[_0xb3b4('0xf')]);module[_0xb3b4('0x10')]=router; \ No newline at end of file +var _0xa8d8=['index','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller'];(function(_0x2a6e00,_0x3c61c9){var _0x33c472=function(_0x41d73e){while(--_0x41d73e){_0x2a6e00['push'](_0x2a6e00['shift']());}};_0x33c472(++_0x3c61c9);}(_0xa8d8,0x13c));var _0x8a8d=function(_0x4b1d34,_0x585dfa){_0x4b1d34=_0x4b1d34-0x0;var _0x136e33=_0xa8d8[_0x4b1d34];return _0x136e33;};'use strict';var multer=require(_0x8a8d('0x0'));var util=require(_0x8a8d('0x1'));var path=require(_0x8a8d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a8d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8a8d('0x4'));var config=require(_0x8a8d('0x5'));var controller=require(_0x8a8d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a8d('0x7')]);router[_0x8a8d('0x8')](_0x8a8d('0x9'),auth[_0x8a8d('0xa')](),controller[_0x8a8d('0xb')]);router[_0x8a8d('0x8')](_0x8a8d('0xc'),auth[_0x8a8d('0xa')](),controller[_0x8a8d('0xd')]);router[_0x8a8d('0xe')]('/',auth[_0x8a8d('0xa')](),controller[_0x8a8d('0xf')]);router['put'](_0x8a8d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8a8d('0x10')]('/:id',auth[_0x8a8d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 9e62de9..376bbe1 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 _0x1c7c=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','BOOLEAN'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0x1c7c,0x164));var _0xc1c7=function(_0x3c2141,_0x4b49ce){_0x3c2141=_0x3c2141-0x0;var _0x3b23db=_0x1c7c[_0x3c2141];return _0x3b23db;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'name':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xc1c7('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc1c7('0x2')],'set':function(_0x20dad3){this[_0xc1c7('0x4')](_0xc1c7('0x5'),_0x20dad3?_0x20dad3[_0xc1c7('0x6')](''):[]);},'get':function(){return this[_0xc1c7('0x7')](_0xc1c7('0x5'))?this[_0xc1c7('0x7')](_0xc1c7('0x5'))[_0xc1c7('0x8')](''):[];}}}; \ No newline at end of file +var _0xa30a=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa30('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa30('0x2')],'set':function(_0x2a9b06){this[_0xaa30('0x5')](_0xaa30('0x6'),_0x2a9b06?_0x2a9b06['join'](''):[]);},'get':function(){return this[_0xaa30('0x7')]('crudPermissions')?this[_0xaa30('0x7')](_0xaa30('0x6'))[_0xaa30('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c9582b5..f65ca1b 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 _0x100a=['show','length','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','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','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','catch'];(function(_0x38905e,_0xd979c7){var _0x1846e5=function(_0x5479c1){while(--_0x5479c1){_0x38905e['push'](_0x38905e['shift']());}};_0x1846e5(++_0xd979c7);}(_0x100a,0x9f));var _0xa100=function(_0x4ab986,_0x6de6fc){_0x4ab986=_0x4ab986-0x0;var _0x55181e=_0x100a[_0x4ab986];return _0x55181e;};'use strict';var emlformat=require(_0xa100('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa100('0x1'));var jsonpatch=require(_0xa100('0x2'));var rp=require(_0xa100('0x3'));var moment=require(_0xa100('0x4'));var BPromise=require(_0xa100('0x5'));var Mustache=require('mustache');var util=require(_0xa100('0x6'));var path=require('path');var sox=require(_0xa100('0x7'));var csv=require(_0xa100('0x8'));var ejs=require(_0xa100('0x9'));var fs=require('fs');var fs_extra=require(_0xa100('0xa'));var _=require('lodash');var squel=require(_0xa100('0xb'));var crypto=require(_0xa100('0xc'));var jsforce=require(_0xa100('0xd'));var deskjs=require(_0xa100('0xe'));var toCsv=require(_0xa100('0x8'));var querystring=require(_0xa100('0xf'));var Papa=require(_0xa100('0x10'));var Redis=require(_0xa100('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa100('0x12'));var as=require(_0xa100('0x13'));var hardwareService=require(_0xa100('0x14'));var logger=require('../../config/logger')(_0xa100('0x15'));var utils=require(_0xa100('0x16'));var config=require(_0xa100('0x17'));var licenseUtil=require(_0xa100('0x18'));var db=require(_0xa100('0x19'))['db'];function respondWithStatusCode(_0x4ab943,_0x131b14){_0x131b14=_0x131b14||0xcc;return function(_0xfc8a5c){if(_0xfc8a5c){return _0x4ab943[_0xa100('0x1a')](_0x131b14);}return _0x4ab943['status'](_0x131b14)[_0xa100('0x1b')]();};}function respondWithResult(_0x54186f,_0x50993e){_0x50993e=_0x50993e||0xc8;return function(_0x39bd50){if(_0x39bd50){return _0x54186f[_0xa100('0x1c')](_0x50993e)[_0xa100('0x1d')](_0x39bd50);}};}function respondWithFilteredResult(_0x61bdd0,_0x1f527c){return function(_0x47ecfb){if(_0x47ecfb){var _0x24815f=typeof _0x1f527c[_0xa100('0x1e')]===_0xa100('0x1f')&&typeof _0x1f527c[_0xa100('0x20')]==='undefined';var _0x2f0f62=_0x47ecfb[_0xa100('0x21')];var _0x1cf4b8=_0x24815f?0x0:_0x1f527c[_0xa100('0x1e')];var _0x38a67b=_0x24815f?_0x47ecfb[_0xa100('0x21')]:_0x1f527c[_0xa100('0x1e')]+_0x1f527c[_0xa100('0x20')];var _0x5151ef;if(_0x38a67b>=_0x2f0f62){_0x38a67b=_0x2f0f62;_0x5151ef=0xc8;}else{_0x5151ef=0xce;}_0x61bdd0[_0xa100('0x1c')](_0x5151ef);return _0x61bdd0[_0xa100('0x22')](_0xa100('0x23'),_0x1cf4b8+'-'+_0x38a67b+'/'+_0x2f0f62)[_0xa100('0x1d')](_0x47ecfb);}return null;};}function patchUpdates(_0x1061d6){return function(_0x5dd189){try{jsonpatch[_0xa100('0x24')](_0x5dd189,_0x1061d6,!![]);}catch(_0x179c73){return BPromise[_0xa100('0x25')](_0x179c73);}return _0x5dd189[_0xa100('0x26')]();};}function saveUpdates(_0x197da9,_0x5d514c){return function(_0xda36b8){if(_0xda36b8){return _0xda36b8[_0xa100('0x27')](_0x197da9)[_0xa100('0x28')](function(_0xc6f37e){return _0xc6f37e;});}return null;};}function removeEntity(_0x385580,_0xc41ed0){return function(_0x44252f){if(_0x44252f){return _0x44252f['destroy']()[_0xa100('0x28')](function(){_0x385580['status'](0xcc)[_0xa100('0x1b')]();});}};}function handleEntityNotFound(_0x580831,_0x3ed0dc){return function(_0x55190e){if(!_0x55190e){_0x580831['sendStatus'](0x194);}return _0x55190e;};}function handleError(_0x3361f9,_0xd837ea){_0xd837ea=_0xd837ea||0x1f4;return function(_0x5c454b){logger[_0xa100('0x29')](_0x5c454b[_0xa100('0x2a')]);if(_0x5c454b['name']){delete _0x5c454b[_0xa100('0x2b')];}_0x3361f9[_0xa100('0x1c')](_0xd837ea)[_0xa100('0x2c')](_0x5c454b);};}exports[_0xa100('0x2d')]=function(_0x429400,_0x52016a){var _0xe00279={},_0x1b4735={},_0x121843={'count':0x0,'rows':[]};var _0x4b3188=_[_0xa100('0x2e')](db[_0xa100('0x2f')][_0xa100('0x30')],function(_0x2c94b2){return{'name':_0x2c94b2[_0xa100('0x31')],'type':_0x2c94b2[_0xa100('0x32')]['key']};});_0x1b4735['model']=_[_0xa100('0x2e')](_0x4b3188,_0xa100('0x2b'));_0x1b4735[_0xa100('0x33')]=_[_0xa100('0x34')](_0x429400[_0xa100('0x33')]);_0x1b4735[_0xa100('0x35')]=_[_0xa100('0x36')](_0x1b4735['model'],_0x1b4735[_0xa100('0x33')]);_0xe00279[_0xa100('0x37')]=_[_0xa100('0x36')](_0x1b4735[_0xa100('0x38')],qs[_0xa100('0x39')](_0x429400['query'][_0xa100('0x39')]));_0xe00279[_0xa100('0x37')]=_0xe00279[_0xa100('0x37')]['length']?_0xe00279[_0xa100('0x37')]:_0x1b4735['model'];if(!_0x429400[_0xa100('0x33')]['hasOwnProperty'](_0xa100('0x3a'))){_0xe00279['limit']=qs['limit'](_0x429400[_0xa100('0x33')][_0xa100('0x20')]);_0xe00279['offset']=qs[_0xa100('0x1e')](_0x429400[_0xa100('0x33')][_0xa100('0x1e')]);}_0xe00279[_0xa100('0x3b')]=qs[_0xa100('0x3c')](_0x429400[_0xa100('0x33')][_0xa100('0x3c')]);_0xe00279[_0xa100('0x3d')]=qs[_0xa100('0x35')](_[_0xa100('0x3e')](_0x429400['query'],_0x1b4735['filters']),_0x4b3188);if(_0x429400[_0xa100('0x33')]['filter']){_0xe00279[_0xa100('0x3d')]=_[_0xa100('0x3f')](_0xe00279[_0xa100('0x3d')],{'$or':_[_0xa100('0x2e')](_0x4b3188,function(_0x1545af){if(_0x1545af['type']!=='VIRTUAL'){var _0x65d99a={};_0x65d99a[_0x1545af[_0xa100('0x2b')]]={'$like':'%'+_0x429400[_0xa100('0x33')]['filter']+'%'};return _0x65d99a;}})});}_0xe00279=_[_0xa100('0x3f')]({},_0xe00279,_0x429400[_0xa100('0x40')]);var _0x19dcd2={'where':_0xe00279['where']};return db[_0xa100('0x2f')][_0xa100('0x21')](_0x19dcd2)[_0xa100('0x28')](function(_0x22f338){_0x121843[_0xa100('0x21')]=_0x22f338;if(_0x429400[_0xa100('0x33')][_0xa100('0x41')]){_0xe00279[_0xa100('0x42')]=[{'all':!![]}];}return db[_0xa100('0x2f')]['findAll'](_0xe00279);})['then'](function(_0x368b12){_0x121843[_0xa100('0x43')]=_0x368b12;return _0x121843;})['then'](respondWithFilteredResult(_0x52016a,_0xe00279))[_0xa100('0x44')](handleError(_0x52016a,null));};exports[_0xa100('0x45')]=function(_0x47b99b,_0xda0764){var _0x351d24={'raw':![],'where':{'id':_0x47b99b['params']['id']}},_0x5097d3={};_0x5097d3['model']=_['keys'](db[_0xa100('0x2f')]['rawAttributes']);_0x5097d3[_0xa100('0x33')]=_[_0xa100('0x34')](_0x47b99b[_0xa100('0x33')]);_0x5097d3[_0xa100('0x35')]=_['intersection'](_0x5097d3[_0xa100('0x38')],_0x5097d3[_0xa100('0x33')]);_0x351d24[_0xa100('0x37')]=_['intersection'](_0x5097d3[_0xa100('0x38')],qs[_0xa100('0x39')](_0x47b99b[_0xa100('0x33')][_0xa100('0x39')]));_0x351d24[_0xa100('0x37')]=_0x351d24['attributes'][_0xa100('0x46')]?_0x351d24[_0xa100('0x37')]:_0x5097d3[_0xa100('0x38')];if(_0x47b99b[_0xa100('0x33')][_0xa100('0x41')]){_0x351d24[_0xa100('0x42')]=[{'all':!![]}];}_0x351d24=_[_0xa100('0x3f')]({},_0x351d24,_0x47b99b['options']);return db['UserProfileSection']['find'](_0x351d24)[_0xa100('0x28')](handleEntityNotFound(_0xda0764,null))[_0xa100('0x28')](respondWithResult(_0xda0764,null))[_0xa100('0x44')](handleError(_0xda0764,null));};exports[_0xa100('0x47')]=function(_0x397e44,_0x149a2e){return db[_0xa100('0x2f')][_0xa100('0x47')](_0x397e44[_0xa100('0x48')],{})[_0xa100('0x28')](respondWithResult(_0x149a2e,0xc9))[_0xa100('0x44')](handleError(_0x149a2e,null));};exports[_0xa100('0x27')]=function(_0x51f6dd,_0x22a467){if(_0x51f6dd[_0xa100('0x48')]['id']){delete _0x51f6dd['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x51f6dd[_0xa100('0x49')]['id']}})[_0xa100('0x28')](handleEntityNotFound(_0x22a467,null))[_0xa100('0x28')](saveUpdates(_0x51f6dd['body'],null))['then'](respondWithResult(_0x22a467,null))['catch'](handleError(_0x22a467,null));};exports['destroy']=function(_0x19e009,_0x5e949f){return db[_0xa100('0x2f')][_0xa100('0x4a')]({'where':{'id':_0x19e009['params']['id']}})[_0xa100('0x28')](handleEntityNotFound(_0x5e949f,null))[_0xa100('0x28')](removeEntity(_0x5e949f,null))[_0xa100('0x44')](handleError(_0x5e949f,null));};exports[_0xa100('0x4b')]=function(_0x1a6d8d,_0x3329fb){return db[_0xa100('0x2f')]['describe']()['then'](respondWithResult(_0x3329fb,null))['catch'](handleError(_0x3329fb,null));}; \ No newline at end of file +var _0x4aeb=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','error','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','attributes','query','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','intersection','length','find','create','body','update','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x4aeb,0x138));var _0xb4ae=function(_0x1982c4,_0x1f46e6){_0x1982c4=_0x1982c4-0x0;var _0x5dce03=_0x4aeb[_0x1982c4];return _0x5dce03;};'use strict';var emlformat=require(_0xb4ae('0x0'));var rimraf=require(_0xb4ae('0x1'));var zipdir=require(_0xb4ae('0x2'));var jsonpatch=require(_0xb4ae('0x3'));var rp=require(_0xb4ae('0x4'));var moment=require(_0xb4ae('0x5'));var BPromise=require(_0xb4ae('0x6'));var Mustache=require(_0xb4ae('0x7'));var util=require(_0xb4ae('0x8'));var path=require(_0xb4ae('0x9'));var sox=require(_0xb4ae('0xa'));var csv=require(_0xb4ae('0xb'));var ejs=require(_0xb4ae('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4ae('0xd'));var squel=require('squel');var crypto=require(_0xb4ae('0xe'));var jsforce=require(_0xb4ae('0xf'));var deskjs=require(_0xb4ae('0x10'));var toCsv=require(_0xb4ae('0xb'));var querystring=require(_0xb4ae('0x11'));var Papa=require(_0xb4ae('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb4ae('0x13'));var as=require(_0xb4ae('0x14'));var hardwareService=require(_0xb4ae('0x15'));var logger=require(_0xb4ae('0x16'))(_0xb4ae('0x17'));var utils=require(_0xb4ae('0x18'));var config=require(_0xb4ae('0x19'));var licenseUtil=require(_0xb4ae('0x1a'));var db=require(_0xb4ae('0x1b'))['db'];function respondWithStatusCode(_0x4febfe,_0x2d9319){_0x2d9319=_0x2d9319||0xcc;return function(_0x3ac2cb){if(_0x3ac2cb){return _0x4febfe[_0xb4ae('0x1c')](_0x2d9319);}return _0x4febfe[_0xb4ae('0x1d')](_0x2d9319)[_0xb4ae('0x1e')]();};}function respondWithResult(_0x52391e,_0x1ef96b){_0x1ef96b=_0x1ef96b||0xc8;return function(_0x33c55c){if(_0x33c55c){return _0x52391e[_0xb4ae('0x1d')](_0x1ef96b)[_0xb4ae('0x1f')](_0x33c55c);}};}function respondWithFilteredResult(_0x19a55d,_0x2f0d4c){return function(_0x5851ad){if(_0x5851ad){var _0x2760ef=typeof _0x2f0d4c[_0xb4ae('0x20')]==='undefined'&&typeof _0x2f0d4c[_0xb4ae('0x21')]==='undefined';var _0xf16968=_0x5851ad['count'];var _0x5c5c62=_0x2760ef?0x0:_0x2f0d4c[_0xb4ae('0x20')];var _0x51433d=_0x2760ef?_0x5851ad['count']:_0x2f0d4c['offset']+_0x2f0d4c[_0xb4ae('0x21')];var _0x2cda86;if(_0x51433d>=_0xf16968){_0x51433d=_0xf16968;_0x2cda86=0xc8;}else{_0x2cda86=0xce;}_0x19a55d['status'](_0x2cda86);return _0x19a55d[_0xb4ae('0x22')](_0xb4ae('0x23'),_0x5c5c62+'-'+_0x51433d+'/'+_0xf16968)[_0xb4ae('0x1f')](_0x5851ad);}return null;};}function patchUpdates(_0x4be3ec){return function(_0x3edec9){try{jsonpatch[_0xb4ae('0x24')](_0x3edec9,_0x4be3ec,!![]);}catch(_0x3123a0){return BPromise[_0xb4ae('0x25')](_0x3123a0);}return _0x3edec9[_0xb4ae('0x26')]();};}function saveUpdates(_0x36595f,_0x570d34){return function(_0x19eb84){if(_0x19eb84){return _0x19eb84['update'](_0x36595f)[_0xb4ae('0x27')](function(_0x374450){return _0x374450;});}return null;};}function removeEntity(_0x36cc5c,_0x147e0b){return function(_0x45abf9){if(_0x45abf9){return _0x45abf9['destroy']()[_0xb4ae('0x27')](function(){_0x36cc5c[_0xb4ae('0x1d')](0xcc)[_0xb4ae('0x1e')]();});}};}function handleEntityNotFound(_0xa59217,_0x39b6d7){return function(_0x52b7f3){if(!_0x52b7f3){_0xa59217['sendStatus'](0x194);}return _0x52b7f3;};}function handleError(_0x3c896a,_0x5070ec){_0x5070ec=_0x5070ec||0x1f4;return function(_0x2e2765){logger[_0xb4ae('0x28')](_0x2e2765['stack']);if(_0x2e2765['name']){delete _0x2e2765[_0xb4ae('0x29')];}_0x3c896a[_0xb4ae('0x1d')](_0x5070ec)[_0xb4ae('0x2a')](_0x2e2765);};}exports['index']=function(_0x27d313,_0x27ddce){var _0x13ff6f={},_0x54ddaf={},_0x4eae49={'count':0x0,'rows':[]};var _0x17955c=_[_0xb4ae('0x2b')](db[_0xb4ae('0x2c')][_0xb4ae('0x2d')],function(_0x4bc5ba){return{'name':_0x4bc5ba[_0xb4ae('0x2e')],'type':_0x4bc5ba[_0xb4ae('0x2f')][_0xb4ae('0x30')]};});_0x54ddaf['model']=_[_0xb4ae('0x2b')](_0x17955c,'name');_0x54ddaf['query']=_['keys'](_0x27d313['query']);_0x54ddaf['filters']=_['intersection'](_0x54ddaf[_0xb4ae('0x31')],_0x54ddaf['query']);_0x13ff6f[_0xb4ae('0x32')]=_['intersection'](_0x54ddaf['model'],qs['fields'](_0x27d313[_0xb4ae('0x33')][_0xb4ae('0x34')]));_0x13ff6f[_0xb4ae('0x32')]=_0x13ff6f['attributes']['length']?_0x13ff6f['attributes']:_0x54ddaf[_0xb4ae('0x31')];if(!_0x27d313[_0xb4ae('0x33')][_0xb4ae('0x35')](_0xb4ae('0x36'))){_0x13ff6f[_0xb4ae('0x21')]=qs[_0xb4ae('0x21')](_0x27d313['query']['limit']);_0x13ff6f[_0xb4ae('0x20')]=qs[_0xb4ae('0x20')](_0x27d313[_0xb4ae('0x33')][_0xb4ae('0x20')]);}_0x13ff6f[_0xb4ae('0x37')]=qs[_0xb4ae('0x38')](_0x27d313[_0xb4ae('0x33')][_0xb4ae('0x38')]);_0x13ff6f[_0xb4ae('0x39')]=qs[_0xb4ae('0x3a')](_[_0xb4ae('0x3b')](_0x27d313[_0xb4ae('0x33')],_0x54ddaf['filters']),_0x17955c);if(_0x27d313[_0xb4ae('0x33')][_0xb4ae('0x3c')]){_0x13ff6f['where']=_[_0xb4ae('0x3d')](_0x13ff6f['where'],{'$or':_[_0xb4ae('0x2b')](_0x17955c,function(_0x4fcac5){if(_0x4fcac5['type']!==_0xb4ae('0x3e')){var _0x2bebee={};_0x2bebee[_0x4fcac5[_0xb4ae('0x29')]]={'$like':'%'+_0x27d313[_0xb4ae('0x33')][_0xb4ae('0x3c')]+'%'};return _0x2bebee;}})});}_0x13ff6f=_['merge']({},_0x13ff6f,_0x27d313[_0xb4ae('0x3f')]);var _0x1b2043={'where':_0x13ff6f['where']};return db[_0xb4ae('0x2c')]['count'](_0x1b2043)[_0xb4ae('0x27')](function(_0x218ede){_0x4eae49[_0xb4ae('0x40')]=_0x218ede;if(_0x27d313['query'][_0xb4ae('0x41')]){_0x13ff6f[_0xb4ae('0x42')]=[{'all':!![]}];}return db[_0xb4ae('0x2c')][_0xb4ae('0x43')](_0x13ff6f);})['then'](function(_0x62ffc3){_0x4eae49[_0xb4ae('0x44')]=_0x62ffc3;return _0x4eae49;})[_0xb4ae('0x27')](respondWithFilteredResult(_0x27ddce,_0x13ff6f))[_0xb4ae('0x45')](handleError(_0x27ddce,null));};exports['show']=function(_0x1a2002,_0x1f8b14){var _0x26224d={'raw':![],'where':{'id':_0x1a2002['params']['id']}},_0x153b18={};_0x153b18[_0xb4ae('0x31')]=_['keys'](db[_0xb4ae('0x2c')][_0xb4ae('0x2d')]);_0x153b18[_0xb4ae('0x33')]=_['keys'](_0x1a2002[_0xb4ae('0x33')]);_0x153b18[_0xb4ae('0x3a')]=_[_0xb4ae('0x46')](_0x153b18['model'],_0x153b18[_0xb4ae('0x33')]);_0x26224d[_0xb4ae('0x32')]=_[_0xb4ae('0x46')](_0x153b18[_0xb4ae('0x31')],qs[_0xb4ae('0x34')](_0x1a2002[_0xb4ae('0x33')][_0xb4ae('0x34')]));_0x26224d['attributes']=_0x26224d[_0xb4ae('0x32')][_0xb4ae('0x47')]?_0x26224d[_0xb4ae('0x32')]:_0x153b18[_0xb4ae('0x31')];if(_0x1a2002[_0xb4ae('0x33')][_0xb4ae('0x41')]){_0x26224d[_0xb4ae('0x42')]=[{'all':!![]}];}_0x26224d=_[_0xb4ae('0x3d')]({},_0x26224d,_0x1a2002[_0xb4ae('0x3f')]);return db['UserProfileSection'][_0xb4ae('0x48')](_0x26224d)['then'](handleEntityNotFound(_0x1f8b14,null))[_0xb4ae('0x27')](respondWithResult(_0x1f8b14,null))[_0xb4ae('0x45')](handleError(_0x1f8b14,null));};exports['create']=function(_0x44f7dd,_0x2ac5f1){return db['UserProfileSection'][_0xb4ae('0x49')](_0x44f7dd[_0xb4ae('0x4a')],{})[_0xb4ae('0x27')](respondWithResult(_0x2ac5f1,0xc9))[_0xb4ae('0x45')](handleError(_0x2ac5f1,null));};exports[_0xb4ae('0x4b')]=function(_0x3da0f5,_0xd844f2){if(_0x3da0f5[_0xb4ae('0x4a')]['id']){delete _0x3da0f5[_0xb4ae('0x4a')]['id'];}return db[_0xb4ae('0x2c')][_0xb4ae('0x48')]({'where':{'id':_0x3da0f5[_0xb4ae('0x4c')]['id']}})[_0xb4ae('0x27')](handleEntityNotFound(_0xd844f2,null))[_0xb4ae('0x27')](saveUpdates(_0x3da0f5[_0xb4ae('0x4a')],null))['then'](respondWithResult(_0xd844f2,null))['catch'](handleError(_0xd844f2,null));};exports[_0xb4ae('0x4d')]=function(_0x20ee45,_0x54d622){return db[_0xb4ae('0x2c')]['find']({'where':{'id':_0x20ee45['params']['id']}})[_0xb4ae('0x27')](handleEntityNotFound(_0x54d622,null))['then'](removeEntity(_0x54d622,null))[_0xb4ae('0x45')](handleError(_0x54d622,null));};exports[_0xb4ae('0x4e')]=function(_0xb8b695,_0x2596d9){return db[_0xb4ae('0x2c')][_0xb4ae('0x4e')]()[_0xb4ae('0x27')](respondWithResult(_0x2596d9,null))['catch'](handleError(_0x2596d9,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 0311016..995a856 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 _0x6b19=['bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','lodash','../../config/logger','api'];(function(_0x4d8f88,_0x535b00){var _0x99c796=function(_0x2001b7){while(--_0x2001b7){_0x4d8f88['push'](_0x4d8f88['shift']());}};_0x99c796(++_0x535b00);}(_0x6b19,0xf4));var _0x96b1=function(_0x3bb996,_0x1fbe79){_0x3bb996=_0x3bb996-0x0;var _0x10bc1c=_0x6b19[_0x3bb996];return _0x10bc1c;};'use strict';var _=require(_0x96b1('0x0'));var util=require('util');var logger=require(_0x96b1('0x1'))(_0x96b1('0x2'));var moment=require('moment');var BPromise=require(_0x96b1('0x3'));var rp=require(_0x96b1('0x4'));var fs=require('fs');var path=require(_0x96b1('0x5'));var rimraf=require(_0x96b1('0x6'));var config=require('../../config/environment');var attributes=require(_0x96b1('0x7'));module[_0x96b1('0x8')]=function(_0x4c6d60,_0x5e55b7){return _0x4c6d60[_0x96b1('0x9')](_0x96b1('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x96b1('0xb'),'fields':[_0x96b1('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x30f0=['rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','api','moment','path'];(function(_0x312ef1,_0x1c1c6d){var _0x3e6fb8=function(_0xc256a9){while(--_0xc256a9){_0x312ef1['push'](_0x312ef1['shift']());}};_0x3e6fb8(++_0x1c1c6d);}(_0x30f0,0xcd));var _0x030f=function(_0x5be375,_0x5ca360){_0x5be375=_0x5be375-0x0;var _0x308ae9=_0x30f0[_0x5be375];return _0x308ae9;};'use strict';var _=require(_0x030f('0x0'));var util=require(_0x030f('0x1'));var logger=require('../../config/logger')(_0x030f('0x2'));var moment=require(_0x030f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x030f('0x4'));var rimraf=require(_0x030f('0x5'));var config=require(_0x030f('0x6'));var attributes=require(_0x030f('0x7'));module[_0x030f('0x8')]=function(_0x3e57c7,_0x4545ae){return _0x3e57c7['define'](_0x030f('0x9'),attributes,{'tableName':_0x030f('0xa'),'paranoid':![],'indexes':[{'name':_0x030f('0xb'),'fields':[_0x030f('0xc'),_0x030f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d19f23a..9351e43 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 _0x0842=['info','UserProfileSection,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4bbee2,_0x23b07f){var _0x330051=function(_0xcbc479){while(--_0xcbc479){_0x4bbee2['push'](_0x4bbee2['shift']());}};_0x330051(++_0x23b07f);}(_0x0842,0xeb));var _0x2084=function(_0x25700a,_0x2c5dd4){_0x25700a=_0x25700a-0x0;var _0x23639a=_0x0842[_0x25700a];return _0x23639a;};'use strict';var _=require(_0x2084('0x0'));var util=require('util');var moment=require(_0x2084('0x1'));var BPromise=require(_0x2084('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2084('0x3'))['db'];var utils=require(_0x2084('0x4'));var logger=require(_0x2084('0x5'))('rpc');var config=require(_0x2084('0x6'));var jayson=require(_0x2084('0x7'));var client=jayson[_0x2084('0x8')][_0x2084('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7bfe05,_0x444bd3,_0x1d79f5){return new BPromise(function(_0x10045a,_0x1d5aaa){return client[_0x2084('0xa')](_0x7bfe05,_0x1d79f5)[_0x2084('0xb')](function(_0x25663f){logger[_0x2084('0xc')](_0x2084('0xd'),_0x444bd3,_0x2084('0xe'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x444bd3,_0x2084('0xe'),JSON['stringify'](_0x25663f));if(_0x25663f['error']){if(_0x25663f[_0x2084('0xf')][_0x2084('0x10')]===0x1f4){logger[_0x2084('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x444bd3,_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);return _0x1d5aaa(_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);}logger[_0x2084('0xf')](_0x2084('0xd'),_0x444bd3,_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);return _0x10045a(_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);}else{logger[_0x2084('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x444bd3,_0x2084('0xe'));_0x10045a(_0x25663f[_0x2084('0x12')]['message']);}})['catch'](function(_0x570cc9){logger['error'](_0x2084('0xd'),_0x444bd3,_0x570cc9);_0x1d5aaa(_0x570cc9);});});} \ No newline at end of file +var _0x8cf1=['../../config/environment','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x8cf1,0xea));var _0x18cf=function(_0x35dcf4,_0x868e7e){_0x35dcf4=_0x35dcf4-0x0;var _0x1fa5b5=_0x8cf1[_0x35dcf4];return _0x1fa5b5;};'use strict';var _=require('lodash');var util=require(_0x18cf('0x0'));var moment=require(_0x18cf('0x1'));var BPromise=require(_0x18cf('0x2'));var rs=require(_0x18cf('0x3'));var fs=require('fs');var Redis=require(_0x18cf('0x4'));var db=require(_0x18cf('0x5'))['db'];var utils=require(_0x18cf('0x6'));var logger=require(_0x18cf('0x7'))('rpc');var config=require(_0x18cf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x18cf('0x9')][_0x18cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa828,_0xdbc3e9,_0x38b542){return new BPromise(function(_0x43c89e,_0x26210c){return client[_0x18cf('0xb')](_0x5aa828,_0x38b542)['then'](function(_0x403973){logger[_0x18cf('0xc')](_0x18cf('0xd'),_0xdbc3e9,_0x18cf('0xe'));logger[_0x18cf('0xf')](_0x18cf('0x10'),_0xdbc3e9,_0x18cf('0xe'),JSON[_0x18cf('0x11')](_0x403973));if(_0x403973[_0x18cf('0x12')]){if(_0x403973[_0x18cf('0x12')][_0x18cf('0x13')]===0x1f4){logger[_0x18cf('0x12')](_0x18cf('0xd'),_0xdbc3e9,_0x403973[_0x18cf('0x12')][_0x18cf('0x14')]);return _0x26210c(_0x403973['error']['message']);}logger[_0x18cf('0x12')](_0x18cf('0xd'),_0xdbc3e9,_0x403973[_0x18cf('0x12')][_0x18cf('0x14')]);return _0x43c89e(_0x403973[_0x18cf('0x12')][_0x18cf('0x14')]);}else{logger[_0x18cf('0xc')](_0x18cf('0xd'),_0xdbc3e9,'request\x20sent');_0x43c89e(_0x403973[_0x18cf('0x15')][_0x18cf('0x14')]);}})['catch'](function(_0x134250){logger[_0x18cf('0x12')]('UserProfileSection,\x20%s,\x20%s',_0xdbc3e9,_0x134250);_0x26210c(_0x134250);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0493d54..82303ab 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf97ab0,_0xf989eb){var _0x5bd077=function(_0x3e5653){while(--_0x3e5653){_0xf97ab0['push'](_0xf97ab0['shift']());}};_0x5bd077(++_0xf989eb);}(_0xe706,0xa3));var _0x6e70=function(_0x1446fc,_0x13d287){_0x1446fc=_0x1446fc-0x0;var _0x184ce1=_0xe706[_0x1446fc];return _0x184ce1;};'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(_0x3249aa,_0x5db8ac){var _0x3892ea=function(_0x36cb5f){while(--_0x36cb5f){_0x3249aa['push'](_0x3249aa['shift']());}};_0x3892ea(++_0x5db8ac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2b9cf5,_0x2a7804){_0x2b9cf5=_0x2b9cf5-0x0;var _0xd0cf15=_0xcb91[_0x2b9cf5];return _0xd0cf15;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 8899ba0..83779de 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 _0x02e2=['sequelize'];(function(_0x5b8608,_0x527731){var _0x3f8d3d=function(_0x131b70){while(--_0x131b70){_0x5b8608['push'](_0x5b8608['shift']());}};_0x3f8d3d(++_0x527731);}(_0x02e2,0x155));var _0x202e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02e2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x202e('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcdce=['exports','INTEGER','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcdce,0xad));var _0xecdc=function(_0xf87067,_0x1f8bc3){_0xf87067=_0xf87067-0x0;var _0x852bc9=_0xcdce[_0xf87067];return _0x852bc9;};'use strict';var Sequelize=require(_0xecdc('0x0'));module[_0xecdc('0x1')]={'penalty':{'type':Sequelize[_0xecdc('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 7c6a512..4e30153 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 _0x4ccb=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x3dc328,_0x242926){var _0xd3135d=function(_0x2e82dd){while(--_0x2e82dd){_0x3dc328['push'](_0x3dc328['shift']());}};_0xd3135d(++_0x242926);}(_0x4ccb,0x196));var _0xb4cc=function(_0x24c375,_0x3c8ae6){_0x24c375=_0x24c375-0x0;var _0x37a06d=_0x4ccb[_0x24c375];return _0x37a06d;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1893=['rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b87b8,_0x4050d9){var _0x1ffeae=function(_0x5bf7bb){while(--_0x5bf7bb){_0x2b87b8['push'](_0x2b87b8['shift']());}};_0x1ffeae(++_0x4050d9);}(_0x1893,0xa2));var _0x3189=function(_0xbe6d5d,_0x308a41){_0xbe6d5d=_0xbe6d5d-0x0;var _0x2cb584=_0x1893[_0xbe6d5d];return _0x2cb584;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));module[_0x3189('0x8')]=function(_0x2333e6,_0x4080a9){return _0x2333e6[_0x3189('0x9')](_0x3189('0xa'),attributes,{'tableName':_0x3189('0xb'),'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 f4fe0b8..42e0e3e 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 _0x70d9=['client','http','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5624ad,_0x44c3f7){var _0x542602=function(_0x2cb7fb){while(--_0x2cb7fb){_0x5624ad['push'](_0x5624ad['shift']());}};_0x542602(++_0x44c3f7);}(_0x70d9,0xfc));var _0x970d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x70d9[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x970d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x970d('0x1'));var fs=require('fs');var Redis=require(_0x970d('0x2'));var db=require(_0x970d('0x3'))['db'];var utils=require(_0x970d('0x4'));var logger=require(_0x970d('0x5'))(_0x970d('0x6'));var config=require(_0x970d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x970d('0x8')][_0x970d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3febf3,_0x4ba94a,_0x550097){return new BPromise(function(_0x4cdedf,_0x50658a){return client['request'](_0x3febf3,_0x550097)[_0x970d('0xa')](function(_0x32685a){logger[_0x970d('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x4ba94a,_0x970d('0xc'));logger['debug'](_0x970d('0xd'),_0x4ba94a,_0x970d('0xc'),JSON['stringify'](_0x32685a));if(_0x32685a[_0x970d('0xe')]){if(_0x32685a[_0x970d('0xe')][_0x970d('0xf')]===0x1f4){logger[_0x970d('0xe')](_0x970d('0x10'),_0x4ba94a,_0x32685a[_0x970d('0xe')][_0x970d('0x11')]);return _0x50658a(_0x32685a[_0x970d('0xe')][_0x970d('0x11')]);}logger[_0x970d('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x4ba94a,_0x32685a[_0x970d('0xe')][_0x970d('0x11')]);return _0x4cdedf(_0x32685a['error'][_0x970d('0x11')]);}else{logger['info'](_0x970d('0x10'),_0x4ba94a,_0x970d('0xc'));_0x4cdedf(_0x32685a[_0x970d('0x12')][_0x970d('0x11')]);}})[_0x970d('0x13')](function(_0x32cd90){logger[_0x970d('0xe')](_0x970d('0x10'),_0x4ba94a,_0x32cd90);_0x50658a(_0x32cd90);});});} \ No newline at end of file +var _0x7ec0=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x38863d,_0x1fb4c0){var _0x184fbb=function(_0x34e14b){while(--_0x34e14b){_0x38863d['push'](_0x38863d['shift']());}};_0x184fbb(++_0x1fb4c0);}(_0x7ec0,0xb4));var _0x07ec=function(_0x32f082,_0x53840d){_0x32f082=_0x32f082-0x0;var _0x15f638=_0x7ec0[_0x32f082];return _0x15f638;};'use strict';var _=require(_0x07ec('0x0'));var util=require('util');var moment=require(_0x07ec('0x1'));var BPromise=require(_0x07ec('0x2'));var rs=require(_0x07ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x07ec('0x4'))(_0x07ec('0x5'));var config=require('../../config/environment');var jayson=require(_0x07ec('0x6'));var client=jayson[_0x07ec('0x7')][_0x07ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x570165,_0x28cfcf,_0x37b247){return new BPromise(function(_0x399c83,_0x5751a3){return client['request'](_0x570165,_0x37b247)[_0x07ec('0x9')](function(_0x179adb){logger[_0x07ec('0xa')](_0x07ec('0xb'),_0x28cfcf,_0x07ec('0xc'));logger[_0x07ec('0xd')](_0x07ec('0xe'),_0x28cfcf,_0x07ec('0xc'),JSON['stringify'](_0x179adb));if(_0x179adb[_0x07ec('0xf')]){if(_0x179adb[_0x07ec('0xf')]['code']===0x1f4){logger[_0x07ec('0xf')](_0x07ec('0xb'),_0x28cfcf,_0x179adb[_0x07ec('0xf')][_0x07ec('0x10')]);return _0x5751a3(_0x179adb[_0x07ec('0xf')][_0x07ec('0x10')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x28cfcf,_0x179adb['error'][_0x07ec('0x10')]);return _0x399c83(_0x179adb[_0x07ec('0xf')][_0x07ec('0x10')]);}else{logger[_0x07ec('0xa')](_0x07ec('0xb'),_0x28cfcf,_0x07ec('0xc'));_0x399c83(_0x179adb[_0x07ec('0x11')][_0x07ec('0x10')]);}})[_0x07ec('0x12')](function(_0x1f4093){logger[_0x07ec('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x28cfcf,_0x1f4093);_0x5751a3(_0x1f4093);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index da84f94..46c09b4 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f6f=['exports','INTEGER','sequelize'];(function(_0x4391e0,_0x5170bb){var _0x388986=function(_0x67f020){while(--_0x67f020){_0x4391e0['push'](_0x4391e0['shift']());}};_0x388986(++_0x5170bb);}(_0x9f6f,0x137));var _0xf9f6=function(_0x350408,_0x5b5948){_0x350408=_0x350408-0x0;var _0x243444=_0x9f6f[_0x350408];return _0x243444;};'use strict';var Sequelize=require(_0xf9f6('0x0'));module[_0xf9f6('0x1')]={'UserId':{'type':Sequelize[_0xf9f6('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe20e=['INTEGER','sequelize','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe20e,0x1c9));var _0xee20=function(_0x31ee6c,_0x3c4217){_0x31ee6c=_0x31ee6c-0x0;var _0x8fae3a=_0xe20e[_0x31ee6c];return _0x8fae3a;};'use strict';var Sequelize=require(_0xee20('0x0'));module[_0xee20('0x1')]={'UserId':{'type':Sequelize[_0xee20('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xee20('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 20f6048..66138ae 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2dfee7,_0x4979b3){var _0xdeeb0c=function(_0x18cfff){while(--_0x18cfff){_0x2dfee7['push'](_0x2dfee7['shift']());}};_0xdeeb0c(++_0x4979b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x426458,_0x24b507){var _0x5ee4e3=function(_0x474cd4){while(--_0x474cd4){_0x426458['push'](_0x426458['shift']());}};_0x5ee4e3(++_0x24b507);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 2622ed4..7f838e0 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x22b5d2,_0x255b74){var _0x1ddf08=function(_0xb8e1ac){while(--_0xb8e1ac){_0x22b5d2['push'](_0x22b5d2['shift']());}};_0x1ddf08(++_0x255b74);}(_0xe706,0xa3));var _0x6e70=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xe706[_0x22663b];return _0x310d0a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x192cec,_0x4c6090){var _0x14355a=function(_0x3cbb5a){while(--_0x3cbb5a){_0x192cec['push'](_0x192cec['shift']());}};_0x14355a(++_0x4c6090);}(_0x70e0,0x17b));var _0x070e=function(_0x22dac5,_0x1d08b0){_0x22dac5=_0x22dac5-0x0;var _0x165566=_0x70e0[_0x22dac5];return _0x165566;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 60d9a8a..d48d036 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 _0x160d=['exports','sequelize'];(function(_0x5cf3a8,_0x4455db){var _0x1ecdcb=function(_0x3efdee){while(--_0x3efdee){_0x5cf3a8['push'](_0x5cf3a8['shift']());}};_0x1ecdcb(++_0x4455db);}(_0x160d,0x16f));var _0xd160=function(_0x41ac22,_0x46c1a9){_0x41ac22=_0x41ac22-0x0;var _0x337267=_0x160d[_0x41ac22];return _0x337267;};'use strict';var Sequelize=require(_0xd160('0x0'));module[_0xd160('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf858=['sequelize'];(function(_0x4f2bd7,_0x16354b){var _0xd3d3f5=function(_0x1dbc27){while(--_0x1dbc27){_0x4f2bd7['push'](_0x4f2bd7['shift']());}};_0xd3d3f5(++_0x16354b);}(_0xf858,0x93));var _0x8f85=function(_0x13d268,_0x46ea56){_0x13d268=_0x13d268-0x0;var _0x3eaa3d=_0xf858[_0x13d268];return _0x3eaa3d;};'use strict';var Sequelize=require(_0x8f85('0x0'));module['exports']={'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 2515d04..0582af8 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 _0x95bc=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x574097,_0x1f2194){var _0x1e0e4a=function(_0x1f408f){while(--_0x1f408f){_0x574097['push'](_0x574097['shift']());}};_0x1e0e4a(++_0x1f2194);}(_0x95bc,0x19e));var _0xc95b=function(_0x43c151,_0x1a5ac1){_0x43c151=_0x43c151-0x0;var _0x8213e3=_0x95bc[_0x43c151];return _0x8213e3;};'use strict';var _=require(_0xc95b('0x0'));var util=require(_0xc95b('0x1'));var logger=require('../../config/logger')(_0xc95b('0x2'));var moment=require('moment');var BPromise=require(_0xc95b('0x3'));var rp=require(_0xc95b('0x4'));var fs=require('fs');var path=require(_0xc95b('0x5'));var rimraf=require(_0xc95b('0x6'));var config=require(_0xc95b('0x7'));var attributes=require(_0xc95b('0x8'));module[_0xc95b('0x9')]=function(_0x59d615,_0x183676){return _0x59d615['define'](_0xc95b('0xa'),attributes,{'tableName':_0xc95b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1da0=['user_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes'];(function(_0x3b3295,_0x5d28d9){var _0x28f5e6=function(_0x4403ec){while(--_0x4403ec){_0x3b3295['push'](_0x3b3295['shift']());}};_0x28f5e6(++_0x5d28d9);}(_0x1da0,0xb5));var _0x01da=function(_0x5bce33,_0x4a4b06){_0x5bce33=_0x5bce33-0x0;var _0x15bc20=_0x1da0[_0x5bce33];return _0x15bc20;};'use strict';var _=require('lodash');var util=require(_0x01da('0x0'));var logger=require(_0x01da('0x1'))(_0x01da('0x2'));var moment=require(_0x01da('0x3'));var BPromise=require(_0x01da('0x4'));var rp=require(_0x01da('0x5'));var fs=require('fs');var path=require(_0x01da('0x6'));var rimraf=require('rimraf');var config=require(_0x01da('0x7'));var attributes=require(_0x01da('0x8'));module['exports']=function(_0x1e0442,_0x426502){return _0x1e0442['define']('UserVoiceQueue',attributes,{'tableName':_0x01da('0x9'),'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 40fbd69..4c9bea7 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 _0x8b31=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x5bdab7,_0x2f0eb6){var _0x1d3b5b=function(_0x27afb3){while(--_0x27afb3){_0x5bdab7['push'](_0x5bdab7['shift']());}};_0x1d3b5b(++_0x2f0eb6);}(_0x8b31,0x129));var _0x18b3=function(_0x2e1391,_0xe54900){_0x2e1391=_0x2e1391-0x0;var _0xab79db=_0x8b31[_0x2e1391];return _0xab79db;};'use strict';var _=require('lodash');var util=require(_0x18b3('0x0'));var moment=require(_0x18b3('0x1'));var BPromise=require(_0x18b3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x18b3('0x4'));var logger=require(_0x18b3('0x5'))(_0x18b3('0x6'));var config=require(_0x18b3('0x7'));var jayson=require(_0x18b3('0x8'));var client=jayson[_0x18b3('0x9')][_0x18b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444f0c,_0x30f0db,_0x4736a1){return new BPromise(function(_0x54f9b5,_0x476a5e){return client[_0x18b3('0xb')](_0x444f0c,_0x4736a1)[_0x18b3('0xc')](function(_0x2f6e90){logger['info'](_0x18b3('0xd'),_0x30f0db,'request\x20sent');logger[_0x18b3('0xe')](_0x18b3('0xf'),_0x30f0db,_0x18b3('0x10'),JSON[_0x18b3('0x11')](_0x2f6e90));if(_0x2f6e90[_0x18b3('0x12')]){if(_0x2f6e90[_0x18b3('0x12')][_0x18b3('0x13')]===0x1f4){logger[_0x18b3('0x12')](_0x18b3('0xd'),_0x30f0db,_0x2f6e90['error']['message']);return _0x476a5e(_0x2f6e90['error'][_0x18b3('0x14')]);}logger[_0x18b3('0x12')](_0x18b3('0xd'),_0x30f0db,_0x2f6e90[_0x18b3('0x12')][_0x18b3('0x14')]);return _0x54f9b5(_0x2f6e90[_0x18b3('0x12')][_0x18b3('0x14')]);}else{logger[_0x18b3('0x15')](_0x18b3('0xd'),_0x30f0db,'request\x20sent');_0x54f9b5(_0x2f6e90[_0x18b3('0x16')][_0x18b3('0x14')]);}})[_0x18b3('0x17')](function(_0x25dbe4){logger[_0x18b3('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x30f0db,_0x25dbe4);_0x476a5e(_0x25dbe4);});});} \ No newline at end of file +var _0x1502=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x454ba9,_0x547713){var _0x5b9251=function(_0x4d7bc5){while(--_0x4d7bc5){_0x454ba9['push'](_0x454ba9['shift']());}};_0x5b9251(++_0x547713);}(_0x1502,0x163));var _0x2150=function(_0x4d227f,_0x27383c){_0x4d227f=_0x4d227f-0x0;var _0x750771=_0x1502[_0x4d227f];return _0x750771;};'use strict';var _=require(_0x2150('0x0'));var util=require(_0x2150('0x1'));var moment=require('moment');var BPromise=require(_0x2150('0x2'));var rs=require(_0x2150('0x3'));var fs=require('fs');var Redis=require(_0x2150('0x4'));var db=require(_0x2150('0x5'))['db'];var utils=require(_0x2150('0x6'));var logger=require(_0x2150('0x7'))(_0x2150('0x8'));var config=require(_0x2150('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2150('0xa')][_0x2150('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29ceab,_0xf70303,_0x2bd25d){return new BPromise(function(_0x31d866,_0x4104d9){return client['request'](_0x29ceab,_0x2bd25d)['then'](function(_0x548d03){logger[_0x2150('0xc')](_0x2150('0xd'),_0xf70303,_0x2150('0xe'));logger['debug'](_0x2150('0xf'),_0xf70303,'request\x20sent',JSON['stringify'](_0x548d03));if(_0x548d03[_0x2150('0x10')]){if(_0x548d03[_0x2150('0x10')]['code']===0x1f4){logger[_0x2150('0x10')](_0x2150('0xd'),_0xf70303,_0x548d03[_0x2150('0x10')][_0x2150('0x11')]);return _0x4104d9(_0x548d03[_0x2150('0x10')][_0x2150('0x11')]);}logger[_0x2150('0x10')](_0x2150('0xd'),_0xf70303,_0x548d03[_0x2150('0x10')][_0x2150('0x11')]);return _0x31d866(_0x548d03[_0x2150('0x10')][_0x2150('0x11')]);}else{logger[_0x2150('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0xf70303,'request\x20sent');_0x31d866(_0x548d03[_0x2150('0x12')][_0x2150('0x11')]);}})[_0x2150('0x13')](function(_0x5a93d2){logger[_0x2150('0x10')](_0x2150('0xd'),_0xf70303,_0x5a93d2);_0x4104d9(_0x5a93d2);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 42530c8..14de82a 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x449938,_0x396dae){var _0x1f8ce2=function(_0x3d1a8c){while(--_0x3d1a8c){_0x449938['push'](_0x449938['shift']());}};_0x1f8ce2(++_0x396dae);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xcb91[_0x79b649];return _0x1af9b1;};'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 +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x19e075,_0x1bc5c3){var _0x2d7219=function(_0x1e44c3){while(--_0x1e44c3){_0x19e075['push'](_0x19e075['shift']());}};_0x2d7219(++_0x1bc5c3);}(_0x70e0,0x17b));var _0x070e=function(_0x377eea,_0x3b92c7){_0x377eea=_0x377eea-0x0;var _0x235819=_0x70e0[_0x377eea];return _0x235819;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index f2d4972..56d0bef 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 _0x2e09=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x2e09,0xc8));var _0x92e0=function(_0x3d7134,_0x96e720){_0x3d7134=_0x3d7134-0x0;var _0x19422b=_0x2e09[_0x3d7134];return _0x19422b;};'use strict';var Sequelize=require(_0x92e0('0x0'));module[_0x92e0('0x1')]={'uniqueid':{'type':Sequelize[_0x92e0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x92e0('0x3')},'membername':{'type':Sequelize[_0x92e0('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x92e0('0x4')],'allowNull':![],'unique':_0x92e0('0x5'),'comment':_0x92e0('0x3')},'VoiceQueueId':{'type':Sequelize[_0x92e0('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x92e0('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x92e0('0x2')](0xb),'defaultValue':0x0,'comment':_0x92e0('0x3')},'paused':{'type':Sequelize[_0x92e0('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x57e3=['STRING','queue_interface','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x2d0286,_0x7bf4af){var _0x2d09d0=function(_0x5eaa93){while(--_0x5eaa93){_0x2d0286['push'](_0x2d0286['shift']());}};_0x2d09d0(++_0x7bf4af);}(_0x57e3,0x1b0));var _0x357e=function(_0x235229,_0x32493d){_0x235229=_0x235229-0x0;var _0x48e512=_0x57e3[_0x235229];return _0x48e512;};'use strict';var Sequelize=require('sequelize');module[_0x357e('0x0')]={'uniqueid':{'type':Sequelize[_0x357e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x357e('0x2')},'membername':{'type':Sequelize[_0x357e('0x3')],'allowNull':![],'comment':_0x357e('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x357e('0x3')],'allowNull':![],'unique':_0x357e('0x4'),'comment':_0x357e('0x2')},'VoiceQueueId':{'type':Sequelize[_0x357e('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x357e('0x3')],'allowNull':![],'unique':_0x357e('0x4'),'comment':_0x357e('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x357e('0x1')](0xb),'defaultValue':0x0,'comment':_0x357e('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ad4537d..ccd7f7e 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 _0x7034=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserVoiceQueueRt'];(function(_0x524516,_0x820c3a){var _0x236654=function(_0x6126cd){while(--_0x6126cd){_0x524516['push'](_0x524516['shift']());}};_0x236654(++_0x820c3a);}(_0x7034,0x1be));var _0x4703=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x7034[_0x2e4aa2];return _0x5e6092;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4703('0x0'))['db'][_0x4703('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4703('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4703('0x3'),'afterDestroy':_0x4703('0x4')};function emitEvent(_0xe964e5){return function(_0xa23e17,_0x96ae4c,_0x39642f){UserVoiceQueueRtEvents[_0x4703('0x5')](_0xe964e5+':'+_0xa23e17['id'],_0xa23e17);UserVoiceQueueRtEvents[_0x4703('0x5')](_0xe964e5,_0xa23e17);_0x39642f(null);};}for(var e in events){if(events[_0x4703('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4703('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1773=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0x1773,0x112));var _0x3177=function(_0xa5807d,_0x19fcb6){_0xa5807d=_0xa5807d-0x0;var _0x3591e1=_0x1773[_0xa5807d];return _0x3591e1;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x3177('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3177('0x1')](0x0);var events={'afterCreate':_0x3177('0x2'),'afterUpdate':_0x3177('0x3'),'afterDestroy':_0x3177('0x4')};function emitEvent(_0x55e403){return function(_0x243c00,_0x11735b,_0x33463f){UserVoiceQueueRtEvents[_0x3177('0x5')](_0x55e403+':'+_0x243c00['id'],_0x243c00);UserVoiceQueueRtEvents[_0x3177('0x5')](_0x55e403,_0x243c00);_0x33463f(null);};}for(var e in events){if(events[_0x3177('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x3177('0x7')](e,emitEvent(event));}}module[_0x3177('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 d1056fa..d68eced 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 _0x766a=['../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x766a,0x116));var _0xa766=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0x766a[_0x9db5d3];return _0x477a81;};'use strict';var _=require(_0xa766('0x0'));var util=require(_0xa766('0x1'));var logger=require(_0xa766('0x2'))(_0xa766('0x3'));var moment=require(_0xa766('0x4'));var BPromise=require(_0xa766('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa766('0x6'));var rimraf=require(_0xa766('0x7'));var config=require(_0xa766('0x8'));var attributes=require(_0xa766('0x9'));module[_0xa766('0xa')]=function(_0x59eb4a,_0xc14a80){return _0x59eb4a['define'](_0xa766('0xb'),attributes,{'tableName':_0xa766('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8f3=['moment','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger'];(function(_0x42a64f,_0x4e119d){var _0x214e6d=function(_0x3bb688){while(--_0x3bb688){_0x42a64f['push'](_0x42a64f['shift']());}};_0x214e6d(++_0x4e119d);}(_0xb8f3,0x152));var _0x3b8f=function(_0x51ab33,_0x71a8a8){_0x51ab33=_0x51ab33-0x0;var _0x5e1298=_0xb8f3[_0x51ab33];return _0x5e1298;};'use strict';var _=require(_0x3b8f('0x0'));var util=require('util');var logger=require(_0x3b8f('0x1'))('api');var moment=require(_0x3b8f('0x2'));var BPromise=require(_0x3b8f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b8f('0x4'));var rimraf=require('rimraf');var config=require(_0x3b8f('0x5'));var attributes=require(_0x3b8f('0x6'));module['exports']=function(_0x343520,_0x52a687){return _0x343520[_0x3b8f('0x7')](_0x3b8f('0x8'),attributes,{'tableName':_0x3b8f('0x9'),'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 b2fe5ce..b7ca900 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 _0x5cb1=['localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults'];(function(_0x338499,_0x316c5c){var _0x90491d=function(_0x403387){while(--_0x403387){_0x338499['push'](_0x338499['shift']());}};_0x90491d(++_0x316c5c);}(_0x5cb1,0x1ed));var _0x15cb=function(_0x43ee7e,_0x78e09b){_0x43ee7e=_0x43ee7e-0x0;var _0x22d326=_0x5cb1[_0x43ee7e];return _0x22d326;};'use strict';var _=require(_0x15cb('0x0'));var util=require(_0x15cb('0x1'));var moment=require(_0x15cb('0x2'));var BPromise=require(_0x15cb('0x3'));var rs=require(_0x15cb('0x4'));var fs=require('fs');var Redis=require(_0x15cb('0x5'));var db=require(_0x15cb('0x6'))['db'];var utils=require(_0x15cb('0x7'));var logger=require(_0x15cb('0x8'))(_0x15cb('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15cb('0xa')][_0x15cb('0xb')]({'port':0x232a});config[_0x15cb('0xc')]=_[_0x15cb('0xd')](config[_0x15cb('0xc')],{'host':_0x15cb('0xe'),'port':0x18eb});var socket=require(_0x15cb('0xf'))(new Redis(config[_0x15cb('0xc')]));require(_0x15cb('0x10'))[_0x15cb('0x11')](socket);function respondWithRpcPromise(_0x475f95,_0x4b3dc7,_0x462207){return new BPromise(function(_0x445c8b,_0x326960){return client[_0x15cb('0x12')](_0x475f95,_0x462207)[_0x15cb('0x13')](function(_0xf45883){logger['info'](_0x15cb('0x14'),_0x4b3dc7,_0x15cb('0x15'));logger[_0x15cb('0x16')](_0x15cb('0x17'),_0x4b3dc7,_0x15cb('0x15'),JSON[_0x15cb('0x18')](_0xf45883));if(_0xf45883[_0x15cb('0x19')]){if(_0xf45883[_0x15cb('0x19')][_0x15cb('0x1a')]===0x1f4){logger[_0x15cb('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4b3dc7,_0xf45883[_0x15cb('0x19')]['message']);return _0x326960(_0xf45883[_0x15cb('0x19')]['message']);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4b3dc7,_0xf45883[_0x15cb('0x19')][_0x15cb('0x1b')]);return _0x445c8b(_0xf45883[_0x15cb('0x19')]['message']);}else{logger[_0x15cb('0x1c')](_0x15cb('0x14'),_0x4b3dc7,_0x15cb('0x15'));_0x445c8b(_0xf45883[_0x15cb('0x1d')][_0x15cb('0x1b')]);}})[_0x15cb('0x1e')](function(_0x359adc){logger[_0x15cb('0x19')](_0x15cb('0x14'),_0x4b3dc7,_0x359adc);_0x326960(_0x359adc);});});}exports['GetVoiceQueueRtPauses']=function(_0x2b18e4){var _0x5a3be2=this;return new Promise(function(_0x3f8d8f,_0x2c5fda){return db['UserVoiceQueueRt'][_0x15cb('0x1f')]({'raw':_0x2b18e4['options']?_0x2b18e4[_0x15cb('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2b18e4[_0x15cb('0x20')]?_0x2b18e4[_0x15cb('0x20')][_0x15cb('0x21')]||null:null,'attributes':[[db[_0x15cb('0x22')]['fn']('COUNT',db[_0x15cb('0x22')]['fn']('IF',db[_0x15cb('0x22')][_0x15cb('0x23')](_0x15cb('0x24')))),_0x15cb('0x25')]]})['then'](function(_0x1e8797){logger[_0x15cb('0x1c')](_0x15cb('0x26'),_0x2b18e4);logger[_0x15cb('0x16')](_0x15cb('0x26'),_0x2b18e4,JSON[_0x15cb('0x18')](_0x1e8797));_0x3f8d8f(_0x1e8797);})[_0x15cb('0x1e')](function(_0x5d6ee3){logger['error'](_0x15cb('0x26'),_0x5d6ee3[_0x15cb('0x1b')],_0x2b18e4);_0x2c5fda(_0x5a3be2['error'](0x1f4,_0x5d6ee3[_0x15cb('0x1b')]));});});}; \ No newline at end of file +var _0x70d7=['jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4ae056,_0x4e5e14){var _0x53fc64=function(_0xfb4c48){while(--_0xfb4c48){_0x4ae056['push'](_0x4ae056['shift']());}};_0x53fc64(++_0x4e5e14);}(_0x70d7,0x1f2));var _0x770d=function(_0x28b9fa,_0x25f40a){_0x28b9fa=_0x28b9fa-0x0;var _0x1beb5d=_0x70d7[_0x28b9fa];return _0x1beb5d;};'use strict';var _=require('lodash');var util=require(_0x770d('0x0'));var moment=require(_0x770d('0x1'));var BPromise=require(_0x770d('0x2'));var rs=require(_0x770d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x770d('0x4'))['db'];var utils=require(_0x770d('0x5'));var logger=require(_0x770d('0x6'))(_0x770d('0x7'));var config=require(_0x770d('0x8'));var jayson=require(_0x770d('0x9'));var client=jayson[_0x770d('0xa')][_0x770d('0xb')]({'port':0x232a});config[_0x770d('0xc')]=_[_0x770d('0xd')](config[_0x770d('0xc')],{'host':_0x770d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x770d('0xc')]));require(_0x770d('0xf'))[_0x770d('0x10')](socket);function respondWithRpcPromise(_0x322c57,_0x56d81a,_0x1f71cc){return new BPromise(function(_0x17757a,_0x43f94b){return client[_0x770d('0x11')](_0x322c57,_0x1f71cc)[_0x770d('0x12')](function(_0x59c675){logger[_0x770d('0x13')](_0x770d('0x14'),_0x56d81a,_0x770d('0x15'));logger[_0x770d('0x16')](_0x770d('0x17'),_0x56d81a,_0x770d('0x15'),JSON[_0x770d('0x18')](_0x59c675));if(_0x59c675['error']){if(_0x59c675[_0x770d('0x19')][_0x770d('0x1a')]===0x1f4){logger[_0x770d('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x56d81a,_0x59c675[_0x770d('0x19')][_0x770d('0x1b')]);return _0x43f94b(_0x59c675[_0x770d('0x19')]['message']);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x56d81a,_0x59c675[_0x770d('0x19')][_0x770d('0x1b')]);return _0x17757a(_0x59c675[_0x770d('0x19')][_0x770d('0x1b')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x56d81a,'request\x20sent');_0x17757a(_0x59c675[_0x770d('0x1c')][_0x770d('0x1b')]);}})['catch'](function(_0x4b055c){logger[_0x770d('0x19')](_0x770d('0x14'),_0x56d81a,_0x4b055c);_0x43f94b(_0x4b055c);});});}exports[_0x770d('0x1d')]=function(_0x9429cc){var _0x3a0830=this;return new Promise(function(_0x547238,_0x197241){return db[_0x770d('0x1e')][_0x770d('0x1f')]({'raw':_0x9429cc['options']?_0x9429cc['options']['raw']===undefined?!![]:![]:!![],'where':_0x9429cc[_0x770d('0x20')]?_0x9429cc['options'][_0x770d('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0x770d('0x22'),db['sequelize']['fn']('IF',db[_0x770d('0x23')][_0x770d('0x24')](_0x770d('0x25')))),_0x770d('0x26')]]})['then'](function(_0x266b3a){logger['info'](_0x770d('0x1d'),_0x9429cc);logger[_0x770d('0x16')](_0x770d('0x1d'),_0x9429cc,JSON['stringify'](_0x266b3a));_0x547238(_0x266b3a);})['catch'](function(_0x3b9c4a){logger[_0x770d('0x19')](_0x770d('0x1d'),_0x3b9c4a[_0x770d('0x1b')],_0x9429cc);_0x197241(_0x3a0830['error'](0x1f4,_0x3b9c4a['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1de2899..a2766a3 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 _0xc9b9=['remove','update','length'];(function(_0x70f4ee,_0x44afc1){var _0x2387fa=function(_0x4fd7c3){while(--_0x4fd7c3){_0x70f4ee['push'](_0x70f4ee['shift']());}};_0x2387fa(++_0x44afc1);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0xc9b9[_0x503cd5];return _0x1fdf1e;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x9c9b('0x0'),_0x9c9b('0x1')];function createListener(_0x3418ab,_0x4e2e8d){return function(_0x5ee8f8){_0x4e2e8d['emit'](_0x3418ab,_0x5ee8f8);};}function removeListener(_0x497d53,_0x38a64b){return function(){UserVoiceQueueRtEvents['removeListener'](_0x497d53,_0x38a64b);};}exports['register']=function(_0x51abae){for(var _0x1f29f3=0x0,_0x15d94b=events[_0x9c9b('0x2')];_0x1f29f3<_0x15d94b;_0x1f29f3++){var _0x193305=events[_0x1f29f3];var _0xbbd998=createListener('userVoiceQueueRt:'+_0x193305,_0x51abae);UserVoiceQueueRtEvents['on'](_0x193305,_0xbbd998);}}; \ No newline at end of file +var _0x4f5a=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','register'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4f5a,0xaa));var _0xa4f5=function(_0xdf2565,_0xbaad04){_0xdf2565=_0xdf2565-0x0;var _0x23a522=_0x4f5a[_0xdf2565];return _0x23a522;};'use strict';var UserVoiceQueueRtEvents=require(_0xa4f5('0x0'));var events=[_0xa4f5('0x1'),'remove',_0xa4f5('0x2')];function createListener(_0x4aef62,_0x5f4bb4){return function(_0x4802d5){_0x5f4bb4['emit'](_0x4aef62,_0x4802d5);};}function removeListener(_0x230b40,_0x200782){return function(){UserVoiceQueueRtEvents['removeListener'](_0x230b40,_0x200782);};}exports[_0xa4f5('0x3')]=function(_0x5155b6){for(var _0x4effa5=0x0,_0x595188=events[_0xa4f5('0x4')];_0x4effa5<_0x595188;_0x4effa5++){var _0x27b613=events[_0x4effa5];var _0xa92ceb=createListener(_0xa4f5('0x5')+_0x27b613,_0x5155b6);UserVoiceQueueRtEvents['on'](_0x27b613,_0xa92ceb);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 142337e..72025e4 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x313868,_0x3310f1){var _0x51ea1c=function(_0x170fcf){while(--_0x170fcf){_0x313868['push'](_0x313868['shift']());}};_0x51ea1c(++_0x3310f1);}(_0xe706,0xa3));var _0x6e70=function(_0xfcc0e,_0x1da886){_0xfcc0e=_0xfcc0e-0x0;var _0x32bb2e=_0xe706[_0xfcc0e];return _0x32bb2e;};'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(_0x2e9110,_0x55a4e9){var _0x5a2ef6=function(_0x562b43){while(--_0x562b43){_0x2e9110['push'](_0x2e9110['shift']());}};_0x5a2ef6(++_0x55a4e9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5712f8,_0x17156b){_0x5712f8=_0x5712f8-0x0;var _0x14a364=_0xcb91[_0x5712f8];return _0x14a364;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 7e4c765..f7a8e9a 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 _0x015d=['sequelize'];(function(_0x3976ea,_0x2abd4b){var _0x1725de=function(_0x8c95cf){while(--_0x8c95cf){_0x3976ea['push'](_0x3976ea['shift']());}};_0x1725de(++_0x2abd4b);}(_0x015d,0x78));var _0xd015=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x015d[_0x59616b];return _0x5c4523;};'use strict';var Sequelize=require(_0xd015('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2364=['INTEGER'];(function(_0x3e9767,_0x2a23f5){var _0x57cff0=function(_0xd320a9){while(--_0xd320a9){_0x3e9767['push'](_0x3e9767['shift']());}};_0x57cff0(++_0x2a23f5);}(_0x2364,0x169));var _0x4236=function(_0x142536,_0x394913){_0x142536=_0x142536-0x0;var _0xe07af6=_0x2364[_0x142536];return _0xe07af6;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x4236('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 9e9469f..20f8b0b 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 _0x4d57=['user_has_whatsapp_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x4d57,0xe8));var _0x74d5=function(_0x4867e3,_0x419a6b){_0x4867e3=_0x4867e3-0x0;var _0x32f0fd=_0x4d57[_0x4867e3];return _0x32f0fd;};'use strict';var _=require('lodash');var util=require(_0x74d5('0x0'));var logger=require(_0x74d5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x74d5('0x2'));var rp=require(_0x74d5('0x3'));var fs=require('fs');var path=require(_0x74d5('0x4'));var rimraf=require(_0x74d5('0x5'));var config=require('../../config/environment');var attributes=require(_0x74d5('0x6'));module[_0x74d5('0x7')]=function(_0x5c6a85,_0x24ed92){return _0x5c6a85[_0x74d5('0x8')](_0x74d5('0x9'),attributes,{'tableName':_0x74d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0a5=['./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa0a5,0x19a));var _0x5a0a=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0xa0a5[_0x1e381c];return _0x9b5ea9;};'use strict';var _=require(_0x5a0a('0x0'));var util=require(_0x5a0a('0x1'));var logger=require(_0x5a0a('0x2'))(_0x5a0a('0x3'));var moment=require(_0x5a0a('0x4'));var BPromise=require(_0x5a0a('0x5'));var rp=require(_0x5a0a('0x6'));var fs=require('fs');var path=require(_0x5a0a('0x7'));var rimraf=require(_0x5a0a('0x8'));var config=require(_0x5a0a('0x9'));var attributes=require(_0x5a0a('0xa'));module[_0x5a0a('0xb')]=function(_0x4c76ac,_0x516c57){return _0x4c76ac[_0x5a0a('0xc')](_0x5a0a('0xd'),attributes,{'tableName':_0x5a0a('0xe'),'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 d9c01e0..cb826ec 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 _0xbe02=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0xf65715,_0x5ddf59){var _0x10d168=function(_0x3d19e1){while(--_0x3d19e1){_0xf65715['push'](_0xf65715['shift']());}};_0x10d168(++_0x5ddf59);}(_0xbe02,0xdb));var _0x2be0=function(_0x2292d9,_0x3398c9){_0x2292d9=_0x2292d9-0x0;var _0x103edc=_0xbe02[_0x2292d9];return _0x103edc;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var moment=require(_0x2be0('0x2'));var BPromise=require(_0x2be0('0x3'));var rs=require(_0x2be0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2be0('0x5'))['db'];var utils=require(_0x2be0('0x6'));var logger=require(_0x2be0('0x7'))(_0x2be0('0x8'));var config=require(_0x2be0('0x9'));var jayson=require(_0x2be0('0xa'));var client=jayson['client'][_0x2be0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d77f9,_0x1a03fa,_0x1dc5b7){return new BPromise(function(_0x6e1c86,_0x1ee684){return client[_0x2be0('0xc')](_0x1d77f9,_0x1dc5b7)['then'](function(_0x5f0b4c){logger['info'](_0x2be0('0xd'),_0x1a03fa,'request\x20sent');logger[_0x2be0('0xe')](_0x2be0('0xf'),_0x1a03fa,_0x2be0('0x10'),JSON[_0x2be0('0x11')](_0x5f0b4c));if(_0x5f0b4c['error']){if(_0x5f0b4c['error'][_0x2be0('0x12')]===0x1f4){logger[_0x2be0('0x13')](_0x2be0('0xd'),_0x1a03fa,_0x5f0b4c['error'][_0x2be0('0x14')]);return _0x1ee684(_0x5f0b4c['error']['message']);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x1a03fa,_0x5f0b4c['error'][_0x2be0('0x14')]);return _0x6e1c86(_0x5f0b4c[_0x2be0('0x13')][_0x2be0('0x14')]);}else{logger[_0x2be0('0x15')](_0x2be0('0xd'),_0x1a03fa,_0x2be0('0x10'));_0x6e1c86(_0x5f0b4c[_0x2be0('0x16')][_0x2be0('0x14')]);}})[_0x2be0('0x17')](function(_0x2d9754){logger[_0x2be0('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1a03fa,_0x2d9754);_0x1ee684(_0x2d9754);});});} \ No newline at end of file +var _0x9b42=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x1ca764,_0x86c89){var _0x3df6e1=function(_0x25a2e6){while(--_0x25a2e6){_0x1ca764['push'](_0x1ca764['shift']());}};_0x3df6e1(++_0x86c89);}(_0x9b42,0xb0));var _0x29b4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9b42[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x29b4('0x0'));var util=require(_0x29b4('0x1'));var moment=require(_0x29b4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29b4('0x3'));var db=require(_0x29b4('0x4'))['db'];var utils=require(_0x29b4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x29b4('0x6'));var jayson=require(_0x29b4('0x7'));var client=jayson[_0x29b4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29f90b,_0x56da58,_0x3a395e){return new BPromise(function(_0x2f41b9,_0x5ec698){return client[_0x29b4('0x9')](_0x29f90b,_0x3a395e)[_0x29b4('0xa')](function(_0x13bda5){logger[_0x29b4('0xb')](_0x29b4('0xc'),_0x56da58,_0x29b4('0xd'));logger[_0x29b4('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x56da58,_0x29b4('0xd'),JSON['stringify'](_0x13bda5));if(_0x13bda5['error']){if(_0x13bda5[_0x29b4('0xf')][_0x29b4('0x10')]===0x1f4){logger[_0x29b4('0xf')](_0x29b4('0xc'),_0x56da58,_0x13bda5['error'][_0x29b4('0x11')]);return _0x5ec698(_0x13bda5[_0x29b4('0xf')]['message']);}logger['error'](_0x29b4('0xc'),_0x56da58,_0x13bda5[_0x29b4('0xf')][_0x29b4('0x11')]);return _0x2f41b9(_0x13bda5['error'][_0x29b4('0x11')]);}else{logger['info'](_0x29b4('0xc'),_0x56da58,_0x29b4('0xd'));_0x2f41b9(_0x13bda5[_0x29b4('0x12')]['message']);}})[_0x29b4('0x13')](function(_0x2e2257){logger[_0x29b4('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x56da58,_0x2e2257);_0x5ec698(_0x2e2257);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 419cdfe..ce51ace 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 _0xb647=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','exports','multer','util'];(function(_0x2dbe37,_0xf018cf){var _0x73a2bc=function(_0x35db31){while(--_0x35db31){_0x2dbe37['push'](_0x2dbe37['shift']());}};_0x73a2bc(++_0xf018cf);}(_0xb647,0xdb));var _0x7b64=function(_0x5da1f0,_0x262a6d){_0x5da1f0=_0x5da1f0-0x0;var _0x37d646=_0xb647[_0x5da1f0];return _0x37d646;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x8'));var controller=require('./variable.controller');router[_0x7b64('0x9')]('/',auth[_0x7b64('0xa')](),controller[_0x7b64('0xb')]);router[_0x7b64('0x9')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0xd')]);router[_0x7b64('0xe')]('/',auth[_0x7b64('0xa')](),controller['create']);router[_0x7b64('0xf')]('/:id',auth[_0x7b64('0xa')](),controller['update']);router['delete'](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller['destroy']);module[_0x7b64('0x10')]=router; \ No newline at end of file +var _0x48ea=['put','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x4f32ca,_0x48292a){var _0x55f959=function(_0x2c962f){while(--_0x2c962f){_0x4f32ca['push'](_0x4f32ca['shift']());}};_0x55f959(++_0x48292a);}(_0x48ea,0x9c));var _0xa48e=function(_0x42f190,_0x2a4f34){_0x42f190=_0x42f190-0x0;var _0x4ddfce=_0x48ea[_0x42f190];return _0x4ddfce;};'use strict';var multer=require(_0xa48e('0x0'));var util=require('util');var path=require(_0xa48e('0x1'));var timeout=require(_0xa48e('0x2'));var express=require(_0xa48e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa48e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa48e('0x5'));var controller=require(_0xa48e('0x6'));router[_0xa48e('0x7')]('/',auth[_0xa48e('0x8')](),controller[_0xa48e('0x9')]);router[_0xa48e('0x7')](_0xa48e('0xa'),auth[_0xa48e('0x8')](),controller[_0xa48e('0xb')]);router[_0xa48e('0xc')]('/',auth[_0xa48e('0x8')](),controller[_0xa48e('0xd')]);router[_0xa48e('0xe')](_0xa48e('0xa'),auth[_0xa48e('0x8')](),controller['update']);router[_0xa48e('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa48e('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 730af9a..fe06d3b 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 _0x80d0=['STRING','name','sequelize'];(function(_0x33b656,_0x5ecb2c){var _0x2e6687=function(_0x3d364b){while(--_0x3d364b){_0x33b656['push'](_0x33b656['shift']());}};_0x2e6687(++_0x5ecb2c);}(_0x80d0,0x1b5));var _0x080d=function(_0x54a8b8,_0x1358af){_0x54a8b8=_0x54a8b8-0x0;var _0x577ed1=_0x80d0[_0x54a8b8];return _0x577ed1;};'use strict';var Sequelize=require(_0x080d('0x0'));module['exports']={'name':{'type':Sequelize[_0x080d('0x1')],'unique':_0x080d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x080d('0x1')]}}; \ No newline at end of file +var _0xb379=['sequelize','STRING','name'];(function(_0x3311f8,_0x47c8ab){var _0x42e6c1=function(_0x3915ac){while(--_0x3915ac){_0x3311f8['push'](_0x3311f8['shift']());}};_0x42e6c1(++_0x47c8ab);}(_0xb379,0x16b));var _0x9b37=function(_0x20cdce,_0x5cb26b){_0x20cdce=_0x20cdce-0x0;var _0x468bef=_0xb379[_0x20cdce];return _0x468bef;};'use strict';var Sequelize=require(_0x9b37('0x0'));module['exports']={'name':{'type':Sequelize[_0x9b37('0x1')],'unique':_0x9b37('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9b37('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 81cdc74..f7d9b1c 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 _0x966e=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','Variable','rawAttributes','fieldName','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','length'];(function(_0x270fe8,_0x5505a9){var _0x2b28e2=function(_0x52aa7f){while(--_0x52aa7f){_0x270fe8['push'](_0x270fe8['shift']());}};_0x2b28e2(++_0x5505a9);}(_0x966e,0x1af));var _0xe966=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x966e[_0x136619];return _0x38c4a5;};'use strict';var emlformat=require(_0xe966('0x0'));var rimraf=require(_0xe966('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe966('0x2'));var rp=require('request-promise');var moment=require(_0xe966('0x3'));var BPromise=require(_0xe966('0x4'));var Mustache=require('mustache');var util=require(_0xe966('0x5'));var path=require(_0xe966('0x6'));var sox=require(_0xe966('0x7'));var csv=require(_0xe966('0x8'));var ejs=require(_0xe966('0x9'));var fs=require('fs');var fs_extra=require(_0xe966('0xa'));var _=require(_0xe966('0xb'));var squel=require('squel');var crypto=require(_0xe966('0xc'));var jsforce=require(_0xe966('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe966('0x8'));var querystring=require('querystring');var Papa=require(_0xe966('0xe'));var Redis=require(_0xe966('0xf'));var authService=require(_0xe966('0x10'));var qs=require(_0xe966('0x11'));var as=require(_0xe966('0x12'));var hardwareService=require(_0xe966('0x13'));var logger=require('../../config/logger')(_0xe966('0x14'));var utils=require(_0xe966('0x15'));var config=require(_0xe966('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe966('0x17'))['db'];function respondWithStatusCode(_0x484fb4,_0x1ab37c){_0x1ab37c=_0x1ab37c||0xcc;return function(_0x7ea9d9){if(_0x7ea9d9){return _0x484fb4[_0xe966('0x18')](_0x1ab37c);}return _0x484fb4[_0xe966('0x19')](_0x1ab37c)[_0xe966('0x1a')]();};}function respondWithResult(_0x36e6c7,_0x5bce43){_0x5bce43=_0x5bce43||0xc8;return function(_0x1dd59c){if(_0x1dd59c){return _0x36e6c7['status'](_0x5bce43)[_0xe966('0x1b')](_0x1dd59c);}};}function respondWithFilteredResult(_0x46421a,_0x1b42f1){return function(_0x1a836b){if(_0x1a836b){var _0x33c603=typeof _0x1b42f1['offset']===_0xe966('0x1c')&&typeof _0x1b42f1[_0xe966('0x1d')]==='undefined';var _0xba523f=_0x1a836b[_0xe966('0x1e')];var _0x1434cb=_0x33c603?0x0:_0x1b42f1[_0xe966('0x1f')];var _0x10c6f1=_0x33c603?_0x1a836b[_0xe966('0x1e')]:_0x1b42f1[_0xe966('0x1f')]+_0x1b42f1['limit'];var _0x456e07;if(_0x10c6f1>=_0xba523f){_0x10c6f1=_0xba523f;_0x456e07=0xc8;}else{_0x456e07=0xce;}_0x46421a[_0xe966('0x19')](_0x456e07);return _0x46421a['set'](_0xe966('0x20'),_0x1434cb+'-'+_0x10c6f1+'/'+_0xba523f)[_0xe966('0x1b')](_0x1a836b);}return null;};}function patchUpdates(_0x30f9bb){return function(_0x5de752){try{jsonpatch[_0xe966('0x21')](_0x5de752,_0x30f9bb,!![]);}catch(_0x21c587){return BPromise['reject'](_0x21c587);}return _0x5de752[_0xe966('0x22')]();};}function saveUpdates(_0x58f614,_0x3839f3){return function(_0x28f219){if(_0x28f219){return _0x28f219[_0xe966('0x23')](_0x58f614)[_0xe966('0x24')](function(_0x5ac7ae){return _0x5ac7ae;});}return null;};}function removeEntity(_0x1a5f7a,_0xa7e7ef){return function(_0xd3cfe6){if(_0xd3cfe6){return _0xd3cfe6[_0xe966('0x25')]()['then'](function(){var _0x5cf943=_0xd3cfe6[_0xe966('0x26')]({'plain':!![]});var _0x521180=_0xe966('0x27');return db[_0xe966('0x28')][_0xe966('0x25')]({'where':{'type':_0x521180,'resourceId':_0x5cf943['id']}})[_0xe966('0x24')](function(){return _0xd3cfe6;});})[_0xe966('0x24')](function(){_0x1a5f7a[_0xe966('0x19')](0xcc)[_0xe966('0x1a')]();});}};}function handleEntityNotFound(_0x220c07,_0x53dff9){return function(_0x268dcd){if(!_0x268dcd){_0x220c07[_0xe966('0x18')](0x194);}return _0x268dcd;};}function handleError(_0x449b67,_0x357cd1){_0x357cd1=_0x357cd1||0x1f4;return function(_0x3c3974){logger['error'](_0x3c3974[_0xe966('0x29')]);if(_0x3c3974[_0xe966('0x2a')]){delete _0x3c3974['name'];}_0x449b67[_0xe966('0x19')](_0x357cd1)[_0xe966('0x2b')](_0x3c3974);};}exports[_0xe966('0x2c')]=function(_0x4a0f31,_0x2edc73){var _0x15b709={},_0x345ba2={},_0x3b74fe={'count':0x0,'rows':[]};var _0x179a34=_['map'](db[_0xe966('0x2d')][_0xe966('0x2e')],function(_0x43580e){return{'name':_0x43580e[_0xe966('0x2f')],'type':_0x43580e['type']['key']};});_0x345ba2[_0xe966('0x30')]=_[_0xe966('0x31')](_0x179a34,_0xe966('0x2a'));_0x345ba2['query']=_['keys'](_0x4a0f31[_0xe966('0x32')]);_0x345ba2['filters']=_[_0xe966('0x33')](_0x345ba2[_0xe966('0x30')],_0x345ba2['query']);_0x15b709['attributes']=_['intersection'](_0x345ba2[_0xe966('0x30')],qs['fields'](_0x4a0f31['query'][_0xe966('0x34')]));_0x15b709['attributes']=_0x15b709[_0xe966('0x35')]['length']?_0x15b709[_0xe966('0x35')]:_0x345ba2[_0xe966('0x30')];if(!_0x4a0f31[_0xe966('0x32')][_0xe966('0x36')](_0xe966('0x37'))){_0x15b709['limit']=qs[_0xe966('0x1d')](_0x4a0f31[_0xe966('0x32')][_0xe966('0x1d')]);_0x15b709['offset']=qs[_0xe966('0x1f')](_0x4a0f31[_0xe966('0x32')][_0xe966('0x1f')]);}_0x15b709[_0xe966('0x38')]=qs[_0xe966('0x39')](_0x4a0f31[_0xe966('0x32')][_0xe966('0x39')]);_0x15b709['where']=qs[_0xe966('0x3a')](_[_0xe966('0x3b')](_0x4a0f31[_0xe966('0x32')],_0x345ba2[_0xe966('0x3a')]),_0x179a34);if(_0x4a0f31[_0xe966('0x32')]['filter']){_0x15b709[_0xe966('0x3c')]=_[_0xe966('0x3d')](_0x15b709[_0xe966('0x3c')],{'$or':_['map'](_0x179a34,function(_0x563f2f){if(_0x563f2f['type']!==_0xe966('0x3e')){var _0x24ce80={};_0x24ce80[_0x563f2f[_0xe966('0x2a')]]={'$like':'%'+_0x4a0f31[_0xe966('0x32')][_0xe966('0x3f')]+'%'};return _0x24ce80;}})});}_0x15b709=_[_0xe966('0x3d')]({},_0x15b709,_0x4a0f31[_0xe966('0x40')]);var _0x14f5f5={'where':_0x15b709[_0xe966('0x3c')]};return db[_0xe966('0x2d')][_0xe966('0x1e')](_0x14f5f5)[_0xe966('0x24')](function(_0x5104a3){_0x3b74fe[_0xe966('0x1e')]=_0x5104a3;if(_0x4a0f31[_0xe966('0x32')][_0xe966('0x41')]){_0x15b709[_0xe966('0x42')]=[{'all':!![]}];}return db[_0xe966('0x2d')][_0xe966('0x43')](_0x15b709);})[_0xe966('0x24')](function(_0x4e4fcb){_0x3b74fe[_0xe966('0x44')]=_0x4e4fcb;return _0x3b74fe;})['then'](respondWithFilteredResult(_0x2edc73,_0x15b709))['catch'](handleError(_0x2edc73,null));};exports[_0xe966('0x45')]=function(_0x48cd66,_0x23119c){var _0x510b59={'raw':!![],'where':{'id':_0x48cd66[_0xe966('0x46')]['id']}},_0x374ec6={};_0x374ec6[_0xe966('0x30')]=_[_0xe966('0x47')](db[_0xe966('0x2d')][_0xe966('0x2e')]);_0x374ec6[_0xe966('0x32')]=_[_0xe966('0x47')](_0x48cd66['query']);_0x374ec6['filters']=_[_0xe966('0x33')](_0x374ec6[_0xe966('0x30')],_0x374ec6[_0xe966('0x32')]);_0x510b59['attributes']=_['intersection'](_0x374ec6[_0xe966('0x30')],qs[_0xe966('0x34')](_0x48cd66['query'][_0xe966('0x34')]));_0x510b59['attributes']=_0x510b59['attributes'][_0xe966('0x48')]?_0x510b59['attributes']:_0x374ec6[_0xe966('0x30')];if(_0x48cd66[_0xe966('0x32')][_0xe966('0x41')]){_0x510b59['include']=[{'all':!![]}];}_0x510b59=_[_0xe966('0x3d')]({},_0x510b59,_0x48cd66[_0xe966('0x40')]);return db[_0xe966('0x2d')][_0xe966('0x49')](_0x510b59)[_0xe966('0x24')](handleEntityNotFound(_0x23119c,null))[_0xe966('0x24')](respondWithResult(_0x23119c,null))['catch'](handleError(_0x23119c,null));};exports[_0xe966('0x4a')]=function(_0x1833c9,_0x57a115){return db[_0xe966('0x2d')][_0xe966('0x4a')](_0x1833c9[_0xe966('0x4b')],{})[_0xe966('0x24')](function(_0x4b4e2e){var _0x49219d=_0x1833c9['user'][_0xe966('0x26')]({'plain':!![]});if(!_0x49219d)throw new Error(_0xe966('0x4c'));if(_0x49219d[_0xe966('0x4d')]===_0xe966('0x4e')){var _0x25760d=_0x4b4e2e[_0xe966('0x26')]({'plain':!![]});var _0x15fa6e=_0xe966('0x27');return db[_0xe966('0x4f')]['find']({'where':{'name':_0x15fa6e,'userProfileId':_0x49219d[_0xe966('0x50')]},'raw':!![]})[_0xe966('0x24')](function(_0x1b82cb){if(_0x1b82cb&&_0x1b82cb['autoAssociation']===0x0){return db[_0xe966('0x28')]['create']({'name':_0x25760d[_0xe966('0x2a')],'resourceId':_0x25760d['id'],'type':_0x1b82cb['name'],'sectionId':_0x1b82cb['id']},{})[_0xe966('0x24')](function(){return _0x4b4e2e;});}else{return _0x4b4e2e;}})[_0xe966('0x51')](function(_0x5da4b0){logger[_0xe966('0x52')](_0xe966('0x53'),_0x5da4b0);throw _0x5da4b0;});}return _0x4b4e2e;})[_0xe966('0x24')](respondWithResult(_0x57a115,0xc9))[_0xe966('0x51')](handleError(_0x57a115,null));};exports[_0xe966('0x23')]=function(_0x1c753e,_0x209828){if(_0x1c753e['body']['id']){delete _0x1c753e[_0xe966('0x4b')]['id'];}return db['Variable'][_0xe966('0x49')]({'where':{'id':_0x1c753e[_0xe966('0x46')]['id']}})[_0xe966('0x24')](handleEntityNotFound(_0x209828,null))['then'](saveUpdates(_0x1c753e['body'],null))[_0xe966('0x24')](respondWithResult(_0x209828,null))[_0xe966('0x51')](handleError(_0x209828,null));};exports['destroy']=function(_0x2423a1,_0xfbb6ef){return db[_0xe966('0x2d')][_0xe966('0x49')]({'where':{'id':_0x2423a1['params']['id']}})[_0xe966('0x24')](handleEntityNotFound(_0xfbb6ef,null))[_0xe966('0x24')](removeEntity(_0xfbb6ef,null))[_0xe966('0x51')](handleError(_0xfbb6ef,null));}; \ No newline at end of file +var _0x34c5=['Variable','includeAll','include','findAll','catch','params','fields','create','body','user','role','Variables','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x34c5,0x1bb));var _0x534c=function(_0x455b5f,_0x4e978d){_0x455b5f=_0x455b5f-0x0;var _0x21bee7=_0x34c5[_0x455b5f];return _0x21bee7;};'use strict';var emlformat=require(_0x534c('0x0'));var rimraf=require(_0x534c('0x1'));var zipdir=require(_0x534c('0x2'));var jsonpatch=require(_0x534c('0x3'));var rp=require(_0x534c('0x4'));var moment=require(_0x534c('0x5'));var BPromise=require(_0x534c('0x6'));var Mustache=require(_0x534c('0x7'));var util=require('util');var path=require(_0x534c('0x8'));var sox=require(_0x534c('0x9'));var csv=require(_0x534c('0xa'));var ejs=require(_0x534c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x534c('0xc'));var squel=require('squel');var crypto=require(_0x534c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x534c('0xa'));var querystring=require(_0x534c('0xe'));var Papa=require('papaparse');var Redis=require(_0x534c('0xf'));var authService=require(_0x534c('0x10'));var qs=require(_0x534c('0x11'));var as=require(_0x534c('0x12'));var hardwareService=require(_0x534c('0x13'));var logger=require(_0x534c('0x14'))(_0x534c('0x15'));var utils=require(_0x534c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x534c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ade60,_0x2cfebb){_0x2cfebb=_0x2cfebb||0xcc;return function(_0x115054){if(_0x115054){return _0x4ade60['sendStatus'](_0x2cfebb);}return _0x4ade60['status'](_0x2cfebb)['end']();};}function respondWithResult(_0x2314b3,_0x116944){_0x116944=_0x116944||0xc8;return function(_0x4a35ff){if(_0x4a35ff){return _0x2314b3[_0x534c('0x18')](_0x116944)[_0x534c('0x19')](_0x4a35ff);}};}function respondWithFilteredResult(_0x442375,_0x9ce6db){return function(_0x6399a1){if(_0x6399a1){var _0x4aebbc=typeof _0x9ce6db[_0x534c('0x1a')]===_0x534c('0x1b')&&typeof _0x9ce6db['limit']===_0x534c('0x1b');var _0x4e55ea=_0x6399a1[_0x534c('0x1c')];var _0x16287c=_0x4aebbc?0x0:_0x9ce6db['offset'];var _0x377445=_0x4aebbc?_0x6399a1[_0x534c('0x1c')]:_0x9ce6db[_0x534c('0x1a')]+_0x9ce6db['limit'];var _0xfb89b8;if(_0x377445>=_0x4e55ea){_0x377445=_0x4e55ea;_0xfb89b8=0xc8;}else{_0xfb89b8=0xce;}_0x442375[_0x534c('0x18')](_0xfb89b8);return _0x442375[_0x534c('0x1d')](_0x534c('0x1e'),_0x16287c+'-'+_0x377445+'/'+_0x4e55ea)[_0x534c('0x19')](_0x6399a1);}return null;};}function patchUpdates(_0x52775b){return function(_0xe17b47){try{jsonpatch[_0x534c('0x1f')](_0xe17b47,_0x52775b,!![]);}catch(_0x13e9ce){return BPromise[_0x534c('0x20')](_0x13e9ce);}return _0xe17b47[_0x534c('0x21')]();};}function saveUpdates(_0x33e749,_0x436ac2){return function(_0x51d0ae){if(_0x51d0ae){return _0x51d0ae[_0x534c('0x22')](_0x33e749)['then'](function(_0x41cafe){return _0x41cafe;});}return null;};}function removeEntity(_0x17d4f3,_0x659fb3){return function(_0x1be740){if(_0x1be740){return _0x1be740[_0x534c('0x23')]()[_0x534c('0x24')](function(){var _0x256035=_0x1be740[_0x534c('0x25')]({'plain':!![]});var _0x16c064='Variables';return db['UserProfileResource'][_0x534c('0x23')]({'where':{'type':_0x16c064,'resourceId':_0x256035['id']}})[_0x534c('0x24')](function(){return _0x1be740;});})[_0x534c('0x24')](function(){_0x17d4f3[_0x534c('0x18')](0xcc)[_0x534c('0x26')]();});}};}function handleEntityNotFound(_0x2d6563,_0x302e11){return function(_0x589139){if(!_0x589139){_0x2d6563[_0x534c('0x27')](0x194);}return _0x589139;};}function handleError(_0x32b201,_0xea0bc1){_0xea0bc1=_0xea0bc1||0x1f4;return function(_0x370065){logger[_0x534c('0x28')](_0x370065[_0x534c('0x29')]);if(_0x370065['name']){delete _0x370065[_0x534c('0x2a')];}_0x32b201[_0x534c('0x18')](_0xea0bc1)[_0x534c('0x2b')](_0x370065);};}exports[_0x534c('0x2c')]=function(_0xc90b0e,_0x4c6834){var _0x3544e1={},_0x5c319c={},_0x4df275={'count':0x0,'rows':[]};var _0x5eb6b9=_[_0x534c('0x2d')](db['Variable'][_0x534c('0x2e')],function(_0x2534f0){return{'name':_0x2534f0[_0x534c('0x2f')],'type':_0x2534f0[_0x534c('0x30')]['key']};});_0x5c319c[_0x534c('0x31')]=_[_0x534c('0x2d')](_0x5eb6b9,_0x534c('0x2a'));_0x5c319c[_0x534c('0x32')]=_[_0x534c('0x33')](_0xc90b0e[_0x534c('0x32')]);_0x5c319c[_0x534c('0x34')]=_['intersection'](_0x5c319c[_0x534c('0x31')],_0x5c319c[_0x534c('0x32')]);_0x3544e1[_0x534c('0x35')]=_[_0x534c('0x36')](_0x5c319c[_0x534c('0x31')],qs['fields'](_0xc90b0e[_0x534c('0x32')]['fields']));_0x3544e1[_0x534c('0x35')]=_0x3544e1[_0x534c('0x35')][_0x534c('0x37')]?_0x3544e1[_0x534c('0x35')]:_0x5c319c['model'];if(!_0xc90b0e[_0x534c('0x32')][_0x534c('0x38')](_0x534c('0x39'))){_0x3544e1['limit']=qs[_0x534c('0x3a')](_0xc90b0e['query'][_0x534c('0x3a')]);_0x3544e1[_0x534c('0x1a')]=qs['offset'](_0xc90b0e[_0x534c('0x32')][_0x534c('0x1a')]);}_0x3544e1[_0x534c('0x3b')]=qs[_0x534c('0x3c')](_0xc90b0e[_0x534c('0x32')][_0x534c('0x3c')]);_0x3544e1[_0x534c('0x3d')]=qs['filters'](_[_0x534c('0x3e')](_0xc90b0e[_0x534c('0x32')],_0x5c319c[_0x534c('0x34')]),_0x5eb6b9);if(_0xc90b0e['query']['filter']){_0x3544e1[_0x534c('0x3d')]=_['merge'](_0x3544e1['where'],{'$or':_[_0x534c('0x2d')](_0x5eb6b9,function(_0x16357a){if(_0x16357a['type']!==_0x534c('0x3f')){var _0x30e29e={};_0x30e29e[_0x16357a[_0x534c('0x2a')]]={'$like':'%'+_0xc90b0e['query'][_0x534c('0x40')]+'%'};return _0x30e29e;}})});}_0x3544e1=_[_0x534c('0x41')]({},_0x3544e1,_0xc90b0e[_0x534c('0x42')]);var _0x582809={'where':_0x3544e1['where']};return db[_0x534c('0x43')][_0x534c('0x1c')](_0x582809)[_0x534c('0x24')](function(_0x1c5550){_0x4df275[_0x534c('0x1c')]=_0x1c5550;if(_0xc90b0e[_0x534c('0x32')][_0x534c('0x44')]){_0x3544e1[_0x534c('0x45')]=[{'all':!![]}];}return db[_0x534c('0x43')][_0x534c('0x46')](_0x3544e1);})[_0x534c('0x24')](function(_0x10f097){_0x4df275['rows']=_0x10f097;return _0x4df275;})['then'](respondWithFilteredResult(_0x4c6834,_0x3544e1))[_0x534c('0x47')](handleError(_0x4c6834,null));};exports['show']=function(_0x55fe3c,_0x2b7da6){var _0x11aa49={'raw':!![],'where':{'id':_0x55fe3c[_0x534c('0x48')]['id']}},_0x38bee8={};_0x38bee8[_0x534c('0x31')]=_['keys'](db[_0x534c('0x43')][_0x534c('0x2e')]);_0x38bee8[_0x534c('0x32')]=_[_0x534c('0x33')](_0x55fe3c['query']);_0x38bee8[_0x534c('0x34')]=_[_0x534c('0x36')](_0x38bee8[_0x534c('0x31')],_0x38bee8[_0x534c('0x32')]);_0x11aa49['attributes']=_[_0x534c('0x36')](_0x38bee8['model'],qs[_0x534c('0x49')](_0x55fe3c[_0x534c('0x32')][_0x534c('0x49')]));_0x11aa49[_0x534c('0x35')]=_0x11aa49[_0x534c('0x35')][_0x534c('0x37')]?_0x11aa49[_0x534c('0x35')]:_0x38bee8['model'];if(_0x55fe3c[_0x534c('0x32')][_0x534c('0x44')]){_0x11aa49[_0x534c('0x45')]=[{'all':!![]}];}_0x11aa49=_[_0x534c('0x41')]({},_0x11aa49,_0x55fe3c[_0x534c('0x42')]);return db[_0x534c('0x43')]['find'](_0x11aa49)[_0x534c('0x24')](handleEntityNotFound(_0x2b7da6,null))[_0x534c('0x24')](respondWithResult(_0x2b7da6,null))[_0x534c('0x47')](handleError(_0x2b7da6,null));};exports[_0x534c('0x4a')]=function(_0x1cb903,_0x77c098){return db[_0x534c('0x43')][_0x534c('0x4a')](_0x1cb903[_0x534c('0x4b')],{})[_0x534c('0x24')](function(_0x2a86e9){var _0x3855b6=_0x1cb903[_0x534c('0x4c')]['get']({'plain':!![]});if(!_0x3855b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3855b6[_0x534c('0x4d')]===_0x534c('0x4c')){var _0x41f6e5=_0x2a86e9[_0x534c('0x25')]({'plain':!![]});var _0x3fa2d3=_0x534c('0x4e');return db[_0x534c('0x4f')][_0x534c('0x50')]({'where':{'name':_0x3fa2d3,'userProfileId':_0x3855b6[_0x534c('0x51')]},'raw':!![]})[_0x534c('0x24')](function(_0x137e14){if(_0x137e14&&_0x137e14[_0x534c('0x52')]===0x0){return db[_0x534c('0x53')][_0x534c('0x4a')]({'name':_0x41f6e5[_0x534c('0x2a')],'resourceId':_0x41f6e5['id'],'type':_0x137e14[_0x534c('0x2a')],'sectionId':_0x137e14['id']},{})[_0x534c('0x24')](function(){return _0x2a86e9;});}else{return _0x2a86e9;}})[_0x534c('0x47')](function(_0x1f9721){logger['error'](_0x534c('0x54'),_0x1f9721);throw _0x1f9721;});}return _0x2a86e9;})[_0x534c('0x24')](respondWithResult(_0x77c098,0xc9))[_0x534c('0x47')](handleError(_0x77c098,null));};exports['update']=function(_0x2871e8,_0x4b1c91){if(_0x2871e8[_0x534c('0x4b')]['id']){delete _0x2871e8[_0x534c('0x4b')]['id'];}return db[_0x534c('0x43')][_0x534c('0x50')]({'where':{'id':_0x2871e8[_0x534c('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b1c91,null))['then'](saveUpdates(_0x2871e8[_0x534c('0x4b')],null))['then'](respondWithResult(_0x4b1c91,null))[_0x534c('0x47')](handleError(_0x4b1c91,null));};exports[_0x534c('0x23')]=function(_0xcf31f4,_0x2087e9){return db[_0x534c('0x43')][_0x534c('0x50')]({'where':{'id':_0xcf31f4[_0x534c('0x48')]['id']}})[_0x534c('0x24')](handleEntityNotFound(_0x2087e9,null))[_0x534c('0x24')](removeEntity(_0x2087e9,null))[_0x534c('0x47')](handleError(_0x2087e9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index e85e423..3a19efb 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 _0x47dd=['Variable','tools_variables','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','define'];(function(_0x13c744,_0x25b355){var _0x317c3c=function(_0x71c4d8){while(--_0x71c4d8){_0x13c744['push'](_0x13c744['shift']());}};_0x317c3c(++_0x25b355);}(_0x47dd,0x7b));var _0xd47d=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x47dd[_0x1e1965];return _0x1a2e96;};'use strict';var _=require(_0xd47d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd47d('0x1'));var moment=require(_0xd47d('0x2'));var BPromise=require(_0xd47d('0x3'));var rp=require(_0xd47d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd47d('0x5'));var config=require(_0xd47d('0x6'));var attributes=require(_0xd47d('0x7'));module['exports']=function(_0x4d70c4,_0x3b8b1b){return _0x4d70c4[_0xd47d('0x8')](_0xd47d('0x9'),attributes,{'tableName':_0xd47d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd502=['../../config/environment','./variable.attributes','exports','define','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x3bf42b,_0x4b766c){var _0x261133=function(_0x490e48){while(--_0x490e48){_0x3bf42b['push'](_0x3bf42b['shift']());}};_0x261133(++_0x4b766c);}(_0xd502,0x1b2));var _0x2d50=function(_0x5820df,_0x24240a){_0x5820df=_0x5820df-0x0;var _0x7a47f1=_0xd502[_0x5820df];return _0x7a47f1;};'use strict';var _=require(_0x2d50('0x0'));var util=require(_0x2d50('0x1'));var logger=require(_0x2d50('0x2'))(_0x2d50('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d50('0x4'));var rimraf=require(_0x2d50('0x5'));var config=require(_0x2d50('0x6'));var attributes=require(_0x2d50('0x7'));module[_0x2d50('0x8')]=function(_0x158e93,_0x41c8b2){return _0x158e93[_0x2d50('0x9')]('Variable',attributes,{'tableName':'tools_variables','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 44c7be5..876b40b 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 _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x550417,_0x36a845){var _0x324704=function(_0x1faa0f){while(--_0x1faa0f){_0x550417['push'](_0x550417['shift']());}};_0x324704(++_0x36a845);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'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')]('Variable,\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']('Variable,\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);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa41a,0x6b));var _0xaa41=function(_0x2138d5,_0x203cf9){_0x2138d5=_0x2138d5-0x0;var _0x26f39c=_0xa41a[_0x2138d5];return _0x26f39c;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index dd06761..fb427e7 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 _0x9543=['express','Router','../../components/auth/service','get','index','/fetch','canUpdate','isAuthenticated','reset','/pull','pull','restart','migrations','exports'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x9543,0x188));var _0x3954=function(_0x4e3974,_0x41a63b){_0x4e3974=_0x4e3974-0x0;var _0x7162d5=_0x9543[_0x4e3974];return _0x7162d5;};'use strict';var express=require(_0x3954('0x0'));var router=express[_0x3954('0x1')]();var auth=require(_0x3954('0x2'));var controller=require('./version.controller');router[_0x3954('0x3')]('/',controller[_0x3954('0x4')]);router[_0x3954('0x3')](_0x3954('0x5'),auth['isAuthenticated'](),auth[_0x3954('0x6')](),controller['fetch']);router['get']('/reset',auth[_0x3954('0x7')](),auth[_0x3954('0x6')](),controller[_0x3954('0x8')]);router[_0x3954('0x3')](_0x3954('0x9'),auth[_0x3954('0x7')](),auth[_0x3954('0x6')](),controller[_0x3954('0xa')]);router[_0x3954('0x3')]('/restart',auth[_0x3954('0x7')](),controller[_0x3954('0xb')]);router['get']('/migrations',controller[_0x3954('0xc')]);module[_0x3954('0xd')]=router; \ No newline at end of file +var _0xf8fd=['exports','express','Router','./version.controller','get','isAuthenticated','fetch','canUpdate','reset','/pull','pull','/restart','/migrations','migrations'];(function(_0x18419a,_0x3d5790){var _0x1f1ab2=function(_0x3002b4){while(--_0x3002b4){_0x18419a['push'](_0x18419a['shift']());}};_0x1f1ab2(++_0x3d5790);}(_0xf8fd,0x197));var _0xdf8f=function(_0x5e1858,_0xaeb272){_0x5e1858=_0x5e1858-0x0;var _0x4dd027=_0xf8fd[_0x5e1858];return _0x4dd027;};'use strict';var express=require(_0xdf8f('0x0'));var router=express[_0xdf8f('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xdf8f('0x2'));router[_0xdf8f('0x3')]('/',controller['index']);router[_0xdf8f('0x3')]('/fetch',auth[_0xdf8f('0x4')](),auth['canUpdate'](),controller[_0xdf8f('0x5')]);router[_0xdf8f('0x3')]('/reset',auth[_0xdf8f('0x4')](),auth[_0xdf8f('0x6')](),controller[_0xdf8f('0x7')]);router['get'](_0xdf8f('0x8'),auth[_0xdf8f('0x4')](),auth['canUpdate'](),controller[_0xdf8f('0x9')]);router[_0xdf8f('0x3')](_0xdf8f('0xa'),auth['isAuthenticated'](),controller['restart']);router[_0xdf8f('0x3')](_0xdf8f('0xb'),controller[_0xdf8f('0xc')]);module[_0xdf8f('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4b8ef42..f1a8986 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 _0x482b=['query','latest','tags','2.0.0','status','json','fetch','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','.js','push','sequelize','Migration','getQueryInterface','constructor','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','index','exports'];(function(_0x29ce10,_0xd29f22){var _0x15f171=function(_0x3a8144){while(--_0x3a8144){_0x29ce10['push'](_0x29ce10['shift']());}};_0x15f171(++_0xd29f22);}(_0x482b,0x18b));var _0xb482=function(_0x206c75,_0x31b28c){_0x206c75=_0x206c75-0x0;var _0x207949=_0x482b[_0x206c75];return _0x207949;};'use strict';var Umzug=require('umzug');var path=require(_0xb482('0x0'));var fs=require('fs');var _=require(_0xb482('0x1'));var pkginfo=require(_0xb482('0x2'))(module,_0xb482('0x3'));var compareVersions=require('compare-versions');var exec=require(_0xb482('0x4'))[_0xb482('0x5')];var db=require(_0xb482('0x6'))['db'];var config=require(_0xb482('0x7'));var pm2=require(_0xb482('0x8'));var logger=require(_0xb482('0x9'))('update');var git=require('simple-git')(config[_0xb482('0xa')]);exports[_0xb482('0xb')]=function(_0x38bb42,_0x49fc37){var _0x2da70d={'current':module[_0xb482('0xc')][_0xb482('0x3')],'phonebar':0x2};if(_0x38bb42['query']&&_0x38bb42[_0xb482('0xd')][_0xb482('0xe')]){return git['fetch']()[_0xb482('0xf')](function(_0xc2f979,_0x64234d){_0x2da70d[_0xb482('0xe')]=(_0xc2f979?module[_0xb482('0xc')][_0xb482('0x3')]:_0x64234d[_0xb482('0xe')])||_0xb482('0x10');return _0x49fc37[_0xb482('0x11')](0xc8)[_0xb482('0x12')](_0x2da70d);});}else{return _0x49fc37[_0xb482('0x11')](0xc8)[_0xb482('0x12')](_0x2da70d);}};exports['fetch']=function(_0x30342b,_0x360908){return git[_0xb482('0x13')]([_0xb482('0x14'),_0xb482('0x15')],function(_0xc4a184){if(_0xc4a184){logger['error'](_0xc4a184);return _0x360908[_0xb482('0x11')](0x1f4)[_0xb482('0x12')](_0xc4a184);}logger[_0xb482('0x16')]('git\x20fetch');return _0x360908[_0xb482('0x11')](0xc8)['json']({'output':_0xb482('0x17')});});};exports[_0xb482('0x18')]=function(_0x48f467,_0x2db97e){return git['reset']([_0xb482('0x19'),_0xb482('0x1a')],function(_0x24f78f){if(_0x24f78f){logger['error'](_0x24f78f);return _0x2db97e[_0xb482('0x11')](0x1f4)[_0xb482('0x12')](_0x24f78f);}logger[_0xb482('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2db97e['status'](0xc8)[_0xb482('0x12')]({'output':_0xb482('0x1b')});});};exports[_0xb482('0x1c')]=function(_0x48d559,_0x55ed66){exec(_0xb482('0x1d'),function(_0x5d774a,_0x386ac3,_0x39657f){logger['info'](_0x386ac3);logger['info'](_0x39657f);if(_0x5d774a){logger[_0xb482('0x1e')](_0x5d774a);return _0x55ed66[_0xb482('0x11')](0x1f4)['json'](_0x5d774a);}return _0x55ed66['status'](0xc8)[_0xb482('0x12')]({'output':_0x386ac3});});};exports['restart']=function(_0x4275ed,_0x1b60ab){return pm2[_0xb482('0x1f')](_0xb482('0x20'))[_0xb482('0x21')](function(_0x2b08c4){logger[_0xb482('0x16')](_0xb482('0x22'),_0x2b08c4);return _0x1b60ab['status'](0xc8)[_0xb482('0x12')]({'output':_0xb482('0x23')});})[_0xb482('0x24')](function(_0xaa4a7f){logger[_0xb482('0x1e')](_0xaa4a7f);return _0x1b60ab[_0xb482('0x11')](0x1f4)['json'](_0xaa4a7f);});};exports['migrations']=function(_0xc9808e,_0x4eb57f){var _0x1d48c0=fs[_0xb482('0x25')](path[_0xb482('0x26')](config[_0xb482('0xa')],_0xb482('0x27'),_0xb482('0x28')));var _0x1a9886=[];for(var _0x4e1ec6=0x0;_0x4e1ec6<_0x1d48c0[_0xb482('0x29')];_0x4e1ec6++){var _0x37cc72=_0x1d48c0[_0x4e1ec6]['replace'](_0xb482('0x2a'),'');if(compareVersions(module[_0xb482('0xc')][_0xb482('0x3')],_0x37cc72)===-0x1){_0x1a9886[_0xb482('0x2b')](_0x37cc72);}}if(_0x1a9886[_0xb482('0x29')]){var _0xf884c2=_0x1a9886['sort'](compareVersions);var _0x36ee9a=new Umzug({'storage':_0xb482('0x2c'),'storageOptions':{'model':db[_0xb482('0x2d')],'modelName':_0xb482('0x2d'),'columnName':_0xb482('0x3')},'migrations':{'params':[db[_0xb482('0x2c')][_0xb482('0x2e')](),db['sequelize'][_0xb482('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[_0xb482('0x26')](config[_0xb482('0xa')],_0xb482('0x27'),_0xb482('0x28')),'pattern':/\.js$/}});_0x36ee9a['up']({'migrations':_['map'](_0xf884c2,function(_0x42224c){return _0x42224c+_0xb482('0x2a');})})[_0xb482('0x21')](function(){return _0x4eb57f[_0xb482('0x11')](0xc8)['json']({'output':_0xb482('0x30')+module[_0xb482('0xc')][_0xb482('0x3')]+_0xb482('0x31')+_['last'](_0xf884c2),'migrations':_[_0xb482('0x26')](_0xf884c2)});})[_0xb482('0x24')](function(_0x3acb99){if(_0x3acb99 instanceof db[_0xb482('0x2c')]['UniqueConstraintError']){return _0x4eb57f['status'](0xc8)[_0xb482('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x4eb57f['status'](0x1f4)[_0xb482('0x12')](_0x3acb99);}});}else{return _0x4eb57f[_0xb482('0x11')](0xc8)[_0xb482('0x12')]({'output':_0xb482('0x32')});}}; \ No newline at end of file +var _0x391c=['constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','update','simple-git','root','index','exports','query','latest','tags','2.0.0','status','json','fetch','origin','info','git\x20fetch','reset','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0x391c,0x196));var _0xc391=function(_0x107ab0,_0x37df6c){_0x107ab0=_0x107ab0-0x0;var _0x439ed6=_0x391c[_0x107ab0];return _0x439ed6;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0xc391('0x0'));var pkginfo=require(_0xc391('0x1'))(module,_0xc391('0x2'));var compareVersions=require(_0xc391('0x3'));var exec=require(_0xc391('0x4'))[_0xc391('0x5')];var db=require(_0xc391('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xc391('0x7'));var logger=require('../../config/logger')(_0xc391('0x8'));var git=require(_0xc391('0x9'))(config[_0xc391('0xa')]);exports[_0xc391('0xb')]=function(_0x3d051e,_0x3eb15d){var _0x163c31={'current':module[_0xc391('0xc')][_0xc391('0x2')],'phonebar':0x2};if(_0x3d051e[_0xc391('0xd')]&&_0x3d051e[_0xc391('0xd')][_0xc391('0xe')]){return git['fetch']()[_0xc391('0xf')](function(_0xd0484e,_0x4c89fa){_0x163c31[_0xc391('0xe')]=(_0xd0484e?module[_0xc391('0xc')]['version']:_0x4c89fa[_0xc391('0xe')])||_0xc391('0x10');return _0x3eb15d[_0xc391('0x11')](0xc8)['json'](_0x163c31);});}else{return _0x3eb15d[_0xc391('0x11')](0xc8)[_0xc391('0x12')](_0x163c31);}};exports[_0xc391('0x13')]=function(_0x1a9d6d,_0x394782){return git[_0xc391('0x13')]([_0xc391('0x14'),'master'],function(_0x20f7c6){if(_0x20f7c6){logger['error'](_0x20f7c6);return _0x394782['status'](0x1f4)['json'](_0x20f7c6);}logger[_0xc391('0x15')](_0xc391('0x16'));return _0x394782[_0xc391('0x11')](0xc8)[_0xc391('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc391('0x17')]=function(_0x3dccca,_0x51a3f2){return git[_0xc391('0x17')]([_0xc391('0x18'),'FETCH_HEAD'],function(_0x2807b1){if(_0x2807b1){logger[_0xc391('0x19')](_0x2807b1);return _0x51a3f2[_0xc391('0x11')](0x1f4)[_0xc391('0x12')](_0x2807b1);}logger['info'](_0xc391('0x1a'));return _0x51a3f2['status'](0xc8)[_0xc391('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0xc391('0x1b')]=function(_0x41c814,_0x524ac6){exec(_0xc391('0x1c'),function(_0x1ac7ca,_0x2f1649,_0x29ed97){logger['info'](_0x2f1649);logger['info'](_0x29ed97);if(_0x1ac7ca){logger['error'](_0x1ac7ca);return _0x524ac6[_0xc391('0x11')](0x1f4)[_0xc391('0x12')](_0x1ac7ca);}return _0x524ac6[_0xc391('0x11')](0xc8)['json']({'output':_0x2f1649});});};exports['restart']=function(_0x21b1a4,_0x13b5a8){return pm2[_0xc391('0x1d')]('motion2')[_0xc391('0x1e')](function(_0x1985b2){logger[_0xc391('0x15')](_0xc391('0x1f'),_0x1985b2);return _0x13b5a8[_0xc391('0x11')](0xc8)[_0xc391('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xc391('0x20')](function(_0xce6729){logger['error'](_0xce6729);return _0x13b5a8[_0xc391('0x11')](0x1f4)['json'](_0xce6729);});};exports[_0xc391('0x21')]=function(_0x380f13,_0x4b83c2){var _0x348b65=fs[_0xc391('0x22')](path[_0xc391('0x23')](config[_0xc391('0xa')],_0xc391('0x24'),_0xc391('0x21')));var _0xfa2e3e=[];for(var _0x30f5a8=0x0;_0x30f5a8<_0x348b65[_0xc391('0x25')];_0x30f5a8++){var _0x36e1f2=_0x348b65[_0x30f5a8][_0xc391('0x26')](_0xc391('0x27'),'');if(compareVersions(module[_0xc391('0xc')][_0xc391('0x2')],_0x36e1f2)===-0x1){_0xfa2e3e[_0xc391('0x28')](_0x36e1f2);}}if(_0xfa2e3e[_0xc391('0x25')]){var _0x4cc93b=_0xfa2e3e[_0xc391('0x29')](compareVersions);var _0x2f559b=new Umzug({'storage':_0xc391('0x2a'),'storageOptions':{'model':db[_0xc391('0x2b')],'modelName':_0xc391('0x2b'),'columnName':_0xc391('0x2')},'migrations':{'params':[db[_0xc391('0x2a')]['getQueryInterface'](),db['sequelize'][_0xc391('0x2c')],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[_0xc391('0x23')](config[_0xc391('0xa')],_0xc391('0x24'),_0xc391('0x21')),'pattern':/\.js$/}});_0x2f559b['up']({'migrations':_[_0xc391('0x2d')](_0x4cc93b,function(_0x13c950){return _0x13c950+'.js';})})['then'](function(){return _0x4b83c2[_0xc391('0x11')](0xc8)[_0xc391('0x12')]({'output':_0xc391('0x2e')+module[_0xc391('0xc')][_0xc391('0x2')]+_0xc391('0x2f')+_[_0xc391('0x30')](_0x4cc93b),'migrations':_['join'](_0x4cc93b)});})[_0xc391('0x20')](function(_0x4f5a42){if(_0x4f5a42 instanceof db[_0xc391('0x2a')]['UniqueConstraintError']){return _0x4b83c2[_0xc391('0x11')](0xc8)[_0xc391('0x12')]({'output':_0xc391('0x31')});}else{return _0x4b83c2[_0xc391('0x11')](0x1f4)[_0xc391('0x12')](_0x4f5a42);}});}else{return _0x4b83c2['status'](0xc8)['json']({'output':_0xc391('0x31')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 56c4afc..20eb16a 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 _0xdb92=['../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d38da,_0x4791a9){var _0x2dda65=function(_0xd75a9e){while(--_0xd75a9e){_0x1d38da['push'](_0x1d38da['shift']());}};_0x2dda65(++_0x4791a9);}(_0xdb92,0x19b));var _0x2db9=function(_0x4febd4,_0xad6972){_0x4febd4=_0x4febd4-0x0;var _0x35ac11=_0xdb92[_0x4febd4];return _0x35ac11;};'use strict';var multer=require(_0x2db9('0x0'));var util=require(_0x2db9('0x1'));var path=require('path');var timeout=require(_0x2db9('0x2'));var express=require('express');var router=express[_0x2db9('0x3')]();var fs_extra=require(_0x2db9('0x4'));var auth=require(_0x2db9('0x5'));var interaction=require(_0x2db9('0x6'));var config=require(_0x2db9('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x2db9('0x8')](),controller['index']);router[_0x2db9('0x9')](_0x2db9('0xa'),auth[_0x2db9('0x8')](),controller[_0x2db9('0xb')]);router[_0x2db9('0x9')](_0x2db9('0xc'),auth[_0x2db9('0x8')](),controller[_0x2db9('0xd')]);router[_0x2db9('0xe')]('/',auth[_0x2db9('0x8')](),controller[_0x2db9('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2db9('0x10')]('/:id',auth[_0x2db9('0x8')](),controller[_0x2db9('0x11')]);module[_0x2db9('0x12')]=router; \ No newline at end of file +var _0x394e=['index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x394e,0x1c3));var _0xe394=function(_0x2de84b,_0x32bd82){_0x2de84b=_0x2de84b-0x0;var _0x3d5943=_0x394e[_0x2de84b];return _0x3d5943;};'use strict';var multer=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var path=require(_0xe394('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe394('0x3')]();var fs_extra=require(_0xe394('0x4'));var auth=require(_0xe394('0x5'));var interaction=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var controller=require(_0xe394('0x8'));router[_0xe394('0x9')]('/',auth[_0xe394('0xa')](),controller[_0xe394('0xb')]);router[_0xe394('0x9')](_0xe394('0xc'),auth[_0xe394('0xa')](),controller[_0xe394('0xd')]);router[_0xe394('0x9')](_0xe394('0xe'),auth[_0xe394('0xa')](),controller[_0xe394('0xf')]);router[_0xe394('0x10')]('/',auth[_0xe394('0xa')](),controller['create']);router[_0xe394('0x11')](_0xe394('0xe'),auth[_0xe394('0xa')](),controller[_0xe394('0x12')]);router[_0xe394('0x13')](_0xe394('0xe'),auth[_0xe394('0xa')](),controller['destroy']);module[_0xe394('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index b0b89da..7f24f90 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 _0xb62e=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5453d6,_0x4ffa9a){var _0x4dd4c2=function(_0x5c95dd){while(--_0x5c95dd){_0x5453d6['push'](_0x5453d6['shift']());}};_0x4dd4c2(++_0x4ffa9a);}(_0xb62e,0x1de));var _0xeb62=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb62e[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'type':{'type':Sequelize[_0xeb62('0x2')]},'uniqueid':{'type':Sequelize[_0xeb62('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xeb62('0x2')]},'queue':{'type':Sequelize[_0xeb62('0x2')]},'interface':{'type':Sequelize[_0xeb62('0x2')]},'membername':{'type':Sequelize[_0xeb62('0x2')]},'agentcalledAt':{'type':Sequelize[_0xeb62('0x3')]},'agentconnectAt':{'type':Sequelize[_0xeb62('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xeb62('0x3')]},'agentdumpAt':{'type':Sequelize[_0xeb62('0x3')]},'holdtime':{'type':Sequelize[_0xeb62('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xeb62('0x4')]},'agentacw':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xeb62('0x2')]},'channel':{'type':Sequelize[_0xeb62('0x2')]},'channelstate':{'type':Sequelize[_0xeb62('0x4')]},'channelstatedesc':{'type':Sequelize[_0xeb62('0x2')]},'connectedlinenum':{'type':Sequelize[_0xeb62('0x2')]},'connectedlinename':{'type':Sequelize[_0xeb62('0x2')]},'language':{'type':Sequelize[_0xeb62('0x2')]},'accountcode':{'type':Sequelize[_0xeb62('0x2')]},'context':{'type':Sequelize[_0xeb62('0x2')]},'exten':{'type':Sequelize[_0xeb62('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xeb62('0x2')]},'destchannelstate':{'type':Sequelize[_0xeb62('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xeb62('0x2')]},'destcalleridnum':{'type':Sequelize[_0xeb62('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xeb62('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xeb62('0x2')]},'destlanguage':{'type':Sequelize[_0xeb62('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xeb62('0x2')]},'destexten':{'type':Sequelize[_0xeb62('0x2')]},'destpriority':{'type':Sequelize[_0xeb62('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xeb62('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xeb62('0x2')]},'transfer':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xeb62('0x2')],'comment':_0xeb62('0x6')},'transferexten':{'type':Sequelize[_0xeb62('0x2')]},'transferuniqueid':{'type':Sequelize[_0xeb62('0x2')]},'agententerreason':{'type':Sequelize[_0xeb62('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdeb3=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x2c2244,_0x197be1){var _0x1e3b27=function(_0x2b8e83){while(--_0x2b8e83){_0x2c2244['push'](_0x2c2244['shift']());}};_0x1e3b27(++_0x197be1);}(_0xdeb3,0xb7));var _0x3deb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdeb3[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x3deb('0x0')]={'type':{'type':Sequelize[_0x3deb('0x1')]},'uniqueid':{'type':Sequelize[_0x3deb('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3deb('0x1')]},'interface':{'type':Sequelize[_0x3deb('0x1')]},'membername':{'type':Sequelize[_0x3deb('0x1')]},'agentcalledAt':{'type':Sequelize[_0x3deb('0x2')]},'agentconnectAt':{'type':Sequelize[_0x3deb('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x3deb('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x3deb('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3deb('0x3')]},'agentacw':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3deb('0x3')]},'reason':{'type':Sequelize[_0x3deb('0x1')]},'lastevent':{'type':Sequelize[_0x3deb('0x1')]},'channel':{'type':Sequelize[_0x3deb('0x1')]},'channelstate':{'type':Sequelize[_0x3deb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3deb('0x1')]},'language':{'type':Sequelize[_0x3deb('0x1')]},'accountcode':{'type':Sequelize[_0x3deb('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3deb('0x1')]},'priority':{'type':Sequelize[_0x3deb('0x1')]},'destchannel':{'type':Sequelize[_0x3deb('0x1')]},'destchannelstate':{'type':Sequelize[_0x3deb('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3deb('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3deb('0x1')]},'destlanguage':{'type':Sequelize[_0x3deb('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x3deb('0x1')]},'destexten':{'type':Sequelize[_0x3deb('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x3deb('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3deb('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3deb('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x3deb('0x3')],'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 da060c9..78c23d2 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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 ec00927..e7a2475 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 _0x72b1=['path','rimraf','./voiceAgentReport.attributes','exports','VoiceAgentReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x72b1,0x16e));var _0x172b=function(_0x408b8f,_0x44093c){_0x408b8f=_0x408b8f-0x0;var _0x4dda23=_0x72b1[_0x408b8f];return _0x4dda23;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var BPromise=require(_0x172b('0x4'));var rp=require(_0x172b('0x5'));var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require(_0x172b('0x7'));var config=require('../../config/environment');var attributes=require(_0x172b('0x8'));module[_0x172b('0x9')]=function(_0x475fd6,_0x222624){return _0x475fd6['define'](_0x172b('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x172b('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdcc4=['path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xdcc4,0xea));var _0x4dcc=function(_0x15a957,_0x124084){_0x15a957=_0x15a957-0x0;var _0x15264e=_0xdcc4[_0x15a957];return _0x15264e;};'use strict';var _=require(_0x4dcc('0x0'));var util=require(_0x4dcc('0x1'));var logger=require(_0x4dcc('0x2'))(_0x4dcc('0x3'));var moment=require(_0x4dcc('0x4'));var BPromise=require('bluebird');var rp=require(_0x4dcc('0x5'));var fs=require('fs');var path=require(_0x4dcc('0x6'));var rimraf=require(_0x4dcc('0x7'));var config=require(_0x4dcc('0x8'));var attributes=require(_0x4dcc('0x9'));module[_0x4dcc('0xa')]=function(_0x5ce6e6,_0x1f8ef7){return _0x5ce6e6['define'](_0x4dcc('0xb'),attributes,{'tableName':_0x4dcc('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4dcc('0xd'),_0x4dcc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2e6d43f..3223550 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 _0xa33b=['error','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','UpdateVoiceAgentReport','options','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a1c49,_0x16920a){var _0x4ba92d=function(_0x36dfe0){while(--_0x36dfe0){_0x4a1c49['push'](_0x4a1c49['shift']());}};_0x4ba92d(++_0x16920a);}(_0xa33b,0xae));var _0xba33=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xa33b[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xba33('0x0'));var util=require('util');var moment=require(_0xba33('0x1'));var BPromise=require(_0xba33('0x2'));var rs=require(_0xba33('0x3'));var fs=require('fs');var Redis=require(_0xba33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xba33('0x5'));var logger=require(_0xba33('0x6'))(_0xba33('0x7'));var config=require(_0xba33('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xba33('0x9')][_0xba33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a7078,_0x5b8c62,_0x485d27){return new BPromise(function(_0x5ac69e,_0x1425da){return client[_0xba33('0xb')](_0x2a7078,_0x485d27)[_0xba33('0xc')](function(_0x425501){logger['info'](_0xba33('0xd'),_0x5b8c62,_0xba33('0xe'));logger[_0xba33('0xf')](_0xba33('0x10'),_0x5b8c62,_0xba33('0xe'),JSON[_0xba33('0x11')](_0x425501));if(_0x425501['error']){if(_0x425501[_0xba33('0x12')]['code']===0x1f4){logger[_0xba33('0x12')](_0xba33('0xd'),_0x5b8c62,_0x425501['error'][_0xba33('0x13')]);return _0x1425da(_0x425501[_0xba33('0x12')][_0xba33('0x13')]);}logger[_0xba33('0x12')](_0xba33('0xd'),_0x5b8c62,_0x425501[_0xba33('0x12')]['message']);return _0x5ac69e(_0x425501[_0xba33('0x12')][_0xba33('0x13')]);}else{logger[_0xba33('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x5b8c62,_0xba33('0xe'));_0x5ac69e(_0x425501[_0xba33('0x15')]['message']);}})[_0xba33('0x16')](function(_0x1959ab){logger[_0xba33('0x12')](_0xba33('0xd'),_0x5b8c62,_0x1959ab);_0x1425da(_0x1959ab);});});}exports[_0xba33('0x17')]=function(_0x2de4b4){var _0x48fe2f=this;return new Promise(function(_0xd6ed4a,_0x4d5da1){return db[_0xba33('0x18')][_0xba33('0x19')](_0x2de4b4[_0xba33('0x1a')],{'raw':_0x2de4b4['options']?_0x2de4b4['options'][_0xba33('0x1b')]===undefined?!![]:![]:!![]})[_0xba33('0xc')](function(_0x114244){logger[_0xba33('0x14')](_0xba33('0x17'),_0x2de4b4);logger[_0xba33('0xf')]('CreateVoiceAgentReport',_0x2de4b4,JSON['stringify'](_0x114244));_0xd6ed4a(_0x114244);})[_0xba33('0x16')](function(_0x14f24d){logger[_0xba33('0x12')](_0xba33('0x17'),_0x14f24d[_0xba33('0x13')],_0x2de4b4);_0x4d5da1(_0x48fe2f[_0xba33('0x12')](0x1f4,_0x14f24d[_0xba33('0x13')]));});});};exports[_0xba33('0x1c')]=function(_0x1a7a4b){var _0x3baae6=this;return new Promise(function(_0x4e38c9,_0x2e884a){return db[_0xba33('0x18')]['update'](_0x1a7a4b[_0xba33('0x1a')],{'raw':_0x1a7a4b['options']?_0x1a7a4b[_0xba33('0x1d')][_0xba33('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7a4b['options']?_0x1a7a4b[_0xba33('0x1d')][_0xba33('0x1e')]||null:null,'attributes':_0x1a7a4b['options']?_0x1a7a4b[_0xba33('0x1d')][_0xba33('0x1f')]||null:null,'limit':_0x1a7a4b['options']?_0x1a7a4b['options']['limit']||null:null})[_0xba33('0xc')](function(_0x577afc){logger[_0xba33('0x14')](_0xba33('0x1c'),_0x1a7a4b);logger['debug'](_0xba33('0x1c'),_0x1a7a4b,JSON[_0xba33('0x11')](_0x577afc));_0x4e38c9(_0x577afc);})['catch'](function(_0x464fd5){logger[_0xba33('0x12')](_0xba33('0x1c'),_0x464fd5[_0xba33('0x13')],_0x1a7a4b);_0x2e884a(_0x3baae6[_0xba33('0x12')](0x1f4,_0x464fd5[_0xba33('0x13')]));});});}; \ No newline at end of file +var _0xe8d1=['../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','debug','update','where','attributes','limit','UpdateVoiceAgentReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3c7f1f,_0x234583){var _0x33ee9c=function(_0x5a6c2a){while(--_0x5a6c2a){_0x3c7f1f['push'](_0x3c7f1f['shift']());}};_0x33ee9c(++_0x234583);}(_0xe8d1,0x1d8));var _0x1e8d=function(_0x5206fc,_0x2eec61){_0x5206fc=_0x5206fc-0x0;var _0x12acf6=_0xe8d1[_0x5206fc];return _0x12acf6;};'use strict';var _=require(_0x1e8d('0x0'));var util=require(_0x1e8d('0x1'));var moment=require(_0x1e8d('0x2'));var BPromise=require(_0x1e8d('0x3'));var rs=require(_0x1e8d('0x4'));var fs=require('fs');var Redis=require(_0x1e8d('0x5'));var db=require(_0x1e8d('0x6'))['db'];var utils=require(_0x1e8d('0x7'));var logger=require(_0x1e8d('0x8'))('rpc');var config=require(_0x1e8d('0x9'));var jayson=require(_0x1e8d('0xa'));var client=jayson[_0x1e8d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229074,_0x9187f4,_0x1e98ac){return new BPromise(function(_0x503fa7,_0x424945){return client['request'](_0x229074,_0x1e98ac)[_0x1e8d('0xc')](function(_0x2bcd45){logger[_0x1e8d('0xd')](_0x1e8d('0xe'),_0x9187f4,_0x1e8d('0xf'));logger['debug'](_0x1e8d('0x10'),_0x9187f4,_0x1e8d('0xf'),JSON[_0x1e8d('0x11')](_0x2bcd45));if(_0x2bcd45['error']){if(_0x2bcd45['error']['code']===0x1f4){logger[_0x1e8d('0x12')](_0x1e8d('0xe'),_0x9187f4,_0x2bcd45[_0x1e8d('0x12')][_0x1e8d('0x13')]);return _0x424945(_0x2bcd45[_0x1e8d('0x12')][_0x1e8d('0x13')]);}logger[_0x1e8d('0x12')](_0x1e8d('0xe'),_0x9187f4,_0x2bcd45['error']['message']);return _0x503fa7(_0x2bcd45['error'][_0x1e8d('0x13')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x9187f4,_0x1e8d('0xf'));_0x503fa7(_0x2bcd45['result']['message']);}})['catch'](function(_0x2dc3c0){logger[_0x1e8d('0x12')](_0x1e8d('0xe'),_0x9187f4,_0x2dc3c0);_0x424945(_0x2dc3c0);});});}exports[_0x1e8d('0x14')]=function(_0x532859){var _0x3cd904=this;return new Promise(function(_0x2800d9,_0x5a851f){return db[_0x1e8d('0x15')]['create'](_0x532859[_0x1e8d('0x16')],{'raw':_0x532859[_0x1e8d('0x17')]?_0x532859[_0x1e8d('0x17')][_0x1e8d('0x18')]===undefined?!![]:![]:!![]})[_0x1e8d('0xc')](function(_0x1d5702){logger[_0x1e8d('0xd')](_0x1e8d('0x14'),_0x532859);logger[_0x1e8d('0x19')]('CreateVoiceAgentReport',_0x532859,JSON[_0x1e8d('0x11')](_0x1d5702));_0x2800d9(_0x1d5702);})['catch'](function(_0x129e39){logger[_0x1e8d('0x12')]('CreateVoiceAgentReport',_0x129e39[_0x1e8d('0x13')],_0x532859);_0x5a851f(_0x3cd904[_0x1e8d('0x12')](0x1f4,_0x129e39[_0x1e8d('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x146775){var _0x23ba67=this;return new Promise(function(_0x589eba,_0x2a0211){return db['VoiceAgentReport'][_0x1e8d('0x1a')](_0x146775[_0x1e8d('0x16')],{'raw':_0x146775[_0x1e8d('0x17')]?_0x146775[_0x1e8d('0x17')][_0x1e8d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x146775[_0x1e8d('0x17')]?_0x146775['options'][_0x1e8d('0x1b')]||null:null,'attributes':_0x146775['options']?_0x146775[_0x1e8d('0x17')][_0x1e8d('0x1c')]||null:null,'limit':_0x146775['options']?_0x146775['options'][_0x1e8d('0x1d')]||null:null})[_0x1e8d('0xc')](function(_0x5dae99){logger[_0x1e8d('0xd')](_0x1e8d('0x1e'),_0x146775);logger['debug']('UpdateVoiceAgentReport',_0x146775,JSON[_0x1e8d('0x11')](_0x5dae99));_0x589eba(_0x5dae99);})[_0x1e8d('0x1f')](function(_0x6032ab){logger[_0x1e8d('0x12')](_0x1e8d('0x1e'),_0x6032ab['message'],_0x146775);_0x2a0211(_0x23ba67[_0x1e8d('0x12')](0x1f4,_0x6032ab[_0x1e8d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 27868de..56bf5ea 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 _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x3e3737,_0x2bf85d){var _0x5a0f97=function(_0x3bd15d){while(--_0x3bd15d){_0x3e3737['push'](_0x3e3737['shift']());}};_0x5a0f97(++_0x2bf85d);}(_0x4bc3,0x16e));var _0x34bc=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4bc3[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file +var _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x277c,0x153));var _0xc277=function(_0x554722,_0x355b91){_0x554722=_0x554722-0x0;var _0xfab058=_0x277c[_0x554722];return _0xfab058;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xe')]('/',auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['put']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')](_0xc277('0xc'),auth['isAuthenticated'](),controller[_0xc277('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 6bad8d1..0a613c2 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 _0x9173=['inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x9173,0x7e));var _0x3917=function(_0x2a7202,_0x1b57ed){_0x2a7202=_0x2a7202-0x0;var _0x4a6394=_0x9173[_0x2a7202];return _0x4a6394;};'use strict';var Sequelize=require(_0x3917('0x0'));module[_0x3917('0x1')]={'uniqueid':{'type':Sequelize[_0x3917('0x2')]},'type':{'type':Sequelize[_0x3917('0x3')](_0x3917('0x4'),'internal',_0x3917('0x5'),_0x3917('0x6'),'outbound-fax',_0x3917('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3917('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x3917('0x2')]},'destinationcontext':{'type':Sequelize[_0x3917('0x2')]},'callerid':{'type':Sequelize[_0x3917('0x2')]},'channel':{'type':Sequelize[_0x3917('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x3917('0x2')]},'lastdata':{'type':Sequelize[_0x3917('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x3917('0x9')]},'answertime':{'type':Sequelize[_0x3917('0x9')]},'endtime':{'type':Sequelize[_0x3917('0x9')]},'duration':{'type':Sequelize[_0x3917('0xa')]},'billableseconds':{'type':Sequelize[_0x3917('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3917('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x3917('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3917('0x2')]},'prefix':{'type':Sequelize[_0x3917('0x2')]},'routeid':{'type':Sequelize[_0x3917('0xa')]},'sipcallid':{'type':Sequelize[_0x3917('0x2')]}}; \ No newline at end of file +var _0x9036=['inbound','internal','outbound','inbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x192099,_0x38a593){var _0x3d6ccc=function(_0x541fff){while(--_0x541fff){_0x192099['push'](_0x192099['shift']());}};_0x3d6ccc(++_0x38a593);}(_0x9036,0x151));var _0x6903=function(_0x28cb75,_0x3f187c){_0x28cb75=_0x28cb75-0x0;var _0x4c0f9e=_0x9036[_0x28cb75];return _0x4c0f9e;};'use strict';var Sequelize=require(_0x6903('0x0'));module[_0x6903('0x1')]={'uniqueid':{'type':Sequelize[_0x6903('0x2')]},'type':{'type':Sequelize['ENUM'](_0x6903('0x3'),_0x6903('0x4'),_0x6903('0x5'),_0x6903('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x6903('0x2')]},'accountcode':{'type':Sequelize[_0x6903('0x2')]},'source':{'type':Sequelize[_0x6903('0x2')]},'destination':{'type':Sequelize[_0x6903('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6903('0x2')]},'channel':{'type':Sequelize[_0x6903('0x2')]},'destinationchannel':{'type':Sequelize[_0x6903('0x2')]},'lastapplication':{'type':Sequelize[_0x6903('0x2')]},'lastdata':{'type':Sequelize[_0x6903('0x7')]},'starttime':{'type':Sequelize[_0x6903('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6903('0x8')]},'endtime':{'type':Sequelize[_0x6903('0x8')]},'duration':{'type':Sequelize[_0x6903('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6903('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6903('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x6903('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x6903('0x2')]},'note':{'type':Sequelize[_0x6903('0x2')]},'prefix':{'type':Sequelize[_0x6903('0x2')]},'routeid':{'type':Sequelize[_0x6903('0x9')]},'sipcallid':{'type':Sequelize[_0x6903('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 1ff4142..0842514 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5adcee,_0xfdda97){_0x5adcee=_0x5adcee-0x0;var _0x1beaa3=_0x5f2f[_0x5adcee];return _0x1beaa3;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','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','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x4c5220,_0x5ddd98){var _0x36211c=function(_0x8cd22e){while(--_0x8cd22e){_0x4c5220['push'](_0x4c5220['shift']());}};_0x36211c(++_0x5ddd98);}(_0xdb28,0x106));var _0x8db2=function(_0x443edc,_0x335ccc){_0x443edc=_0x443edc-0x0;var _0x365356=_0xdb28[_0x443edc];return _0x365356;};'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']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c79a399..06672da 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 _0x0962=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid'];(function(_0x7ca8a2,_0x565d13){var _0x572603=function(_0x2939d3){while(--_0x2939d3){_0x7ca8a2['push'](_0x7ca8a2['shift']());}};_0x572603(++_0x565d13);}(_0x0962,0x198));var _0x2096=function(_0x5a436d,_0x1403d5){_0x5a436d=_0x5a436d-0x0;var _0x98389b=_0x0962[_0x5a436d];return _0x98389b;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var logger=require(_0x2096('0x2'))(_0x2096('0x3'));var moment=require('moment');var BPromise=require(_0x2096('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2096('0x5'));var config=require(_0x2096('0x6'));var attributes=require(_0x2096('0x7'));module[_0x2096('0x8')]=function(_0x1ce10d,_0x462564){return _0x1ce10d[_0x2096('0x9')](_0x2096('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x2096('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb04=['./voiceCallReport.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xf41fb7,_0x2bb7d7){var _0x4a3d94=function(_0x1c0bb7){while(--_0x1c0bb7){_0xf41fb7['push'](_0xf41fb7['shift']());}};_0x4a3d94(++_0x2bb7d7);}(_0xcb04,0x7c));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var logger=require('../../config/logger')(_0x4cb0('0x2'));var moment=require(_0x4cb0('0x3'));var BPromise=require(_0x4cb0('0x4'));var rp=require(_0x4cb0('0x5'));var fs=require('fs');var path=require(_0x4cb0('0x6'));var rimraf=require('rimraf');var config=require(_0x4cb0('0x7'));var attributes=require(_0x4cb0('0x8'));module[_0x4cb0('0x9')]=function(_0x265733,_0x24dc32){return _0x265733[_0x4cb0('0xa')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index ec8ded2..274a8b5 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 _0x126c=['request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','model','include','CreateVoiceCallReport','create','info','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','VoiceCallReport,\x20%s,\x20%s','debug'];(function(_0x125071,_0x489596){var _0x4b6523=function(_0x2776df){while(--_0x2776df){_0x125071['push'](_0x125071['shift']());}};_0x4b6523(++_0x489596);}(_0x126c,0xed));var _0xc126=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x126c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc126('0x0'));var util=require(_0xc126('0x1'));var moment=require(_0xc126('0x2'));var BPromise=require(_0xc126('0x3'));var rs=require(_0xc126('0x4'));var fs=require('fs');var Redis=require(_0xc126('0x5'));var db=require(_0xc126('0x6'))['db'];var utils=require(_0xc126('0x7'));var logger=require('../../config/logger')(_0xc126('0x8'));var config=require(_0xc126('0x9'));var jayson=require(_0xc126('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f91bb,_0x1e15b8,_0xc12d50){return new BPromise(function(_0x5c7486,_0x4947e2){return client[_0xc126('0xb')](_0x2f91bb,_0xc12d50)[_0xc126('0xc')](function(_0x5dda7e){logger['info'](_0xc126('0xd'),_0x1e15b8,'request\x20sent');logger[_0xc126('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1e15b8,_0xc126('0xf'),JSON[_0xc126('0x10')](_0x5dda7e));if(_0x5dda7e[_0xc126('0x11')]){if(_0x5dda7e['error']['code']===0x1f4){logger[_0xc126('0x11')](_0xc126('0xd'),_0x1e15b8,_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);return _0x4947e2(_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);}logger[_0xc126('0x11')](_0xc126('0xd'),_0x1e15b8,_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);return _0x5c7486(_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);}else{logger['info'](_0xc126('0xd'),_0x1e15b8,'request\x20sent');_0x5c7486(_0x5dda7e[_0xc126('0x13')]['message']);}})[_0xc126('0x14')](function(_0x37a5a1){logger[_0xc126('0x11')](_0xc126('0xd'),_0x1e15b8,_0x37a5a1);_0x4947e2(_0x37a5a1);});});}exports[_0xc126('0x15')]=function(_0x57bc4d){var _0x3cf7dd=this;return new Promise(function(_0x5ed307,_0x12bd6c){return db[_0xc126('0x16')][_0xc126('0x17')]({'raw':_0x57bc4d['options']?_0x57bc4d[_0xc126('0x18')][_0xc126('0x19')]===undefined?!![]:![]:!![],'where':_0x57bc4d['options']?_0x57bc4d[_0xc126('0x18')][_0xc126('0x1a')]||null:null,'attributes':_0x57bc4d['options']?_0x57bc4d['options'][_0xc126('0x1b')]||null:null,'limit':_0x57bc4d['options']?_0x57bc4d['options'][_0xc126('0x1c')]||null:null,'include':_0x57bc4d['options']?_0x57bc4d[_0xc126('0x18')]['include']?_[_0xc126('0x1d')](_0x57bc4d[_0xc126('0x18')]['include'],function(_0x6f90e6){return{'model':db[_0x6f90e6[_0xc126('0x1e')]],'as':_0x6f90e6['as'],'attributes':_0x6f90e6['attributes'],'include':_0x6f90e6[_0xc126('0x1f')]?_['map'](_0x6f90e6[_0xc126('0x1f')],function(_0x1dfd42){return{'model':db[_0x1dfd42[_0xc126('0x1e')]],'as':_0x1dfd42['as'],'attributes':_0x1dfd42[_0xc126('0x1b')],'include':_0x1dfd42[_0xc126('0x1f')]?_['map'](_0x1dfd42[_0xc126('0x1f')],function(_0x284884){return{'model':db[_0x284884[_0xc126('0x1e')]],'as':_0x284884['as'],'attributes':_0x284884[_0xc126('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x523b1d){logger['info'](_0xc126('0x15'),_0x57bc4d);logger[_0xc126('0xe')](_0xc126('0x15'),_0x57bc4d,JSON['stringify'](_0x523b1d));_0x5ed307(_0x523b1d);})['catch'](function(_0x4bd454){logger[_0xc126('0x11')]('GetVoiceCallReport',_0x4bd454[_0xc126('0x12')],_0x57bc4d);_0x12bd6c(_0x3cf7dd[_0xc126('0x11')](0x1f4,_0x4bd454[_0xc126('0x12')]));});});};exports[_0xc126('0x20')]=function(_0x352142){var _0x19be0a=this;return new Promise(function(_0x4d9320,_0x5d0ac0){return db[_0xc126('0x16')][_0xc126('0x21')](_0x352142['body'],{'raw':_0x352142[_0xc126('0x18')]?_0x352142[_0xc126('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc126('0xc')](function(_0x3a9684){logger[_0xc126('0x22')](_0xc126('0x20'),_0x352142);logger[_0xc126('0xe')](_0xc126('0x20'),_0x352142,JSON['stringify'](_0x3a9684));_0x4d9320(_0x3a9684);})[_0xc126('0x14')](function(_0x83b160){logger[_0xc126('0x11')]('CreateVoiceCallReport',_0x83b160[_0xc126('0x12')],_0x352142);_0x5d0ac0(_0x19be0a['error'](0x1f4,_0x83b160[_0xc126('0x12')]));});});};exports[_0xc126('0x23')]=function(_0x5f477b){var _0x1c37a5=this;return new Promise(function(_0x351732,_0x2564c4){return db[_0xc126('0x16')]['update'](_0x5f477b['body'],{'raw':_0x5f477b[_0xc126('0x18')]?_0x5f477b[_0xc126('0x18')][_0xc126('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f477b['options']?_0x5f477b[_0xc126('0x18')][_0xc126('0x1a')]||null:null,'attributes':_0x5f477b[_0xc126('0x18')]?_0x5f477b['options'][_0xc126('0x1b')]||null:null,'limit':_0x5f477b[_0xc126('0x18')]?_0x5f477b[_0xc126('0x18')]['limit']||null:null})[_0xc126('0xc')](function(_0x5c56f2){logger[_0xc126('0x22')](_0xc126('0x23'),_0x5f477b);logger[_0xc126('0xe')](_0xc126('0x23'),_0x5f477b,JSON[_0xc126('0x10')](_0x5c56f2));_0x351732(_0x5c56f2);})[_0xc126('0x14')](function(_0xc20e02){logger[_0xc126('0x11')](_0xc126('0x23'),_0xc20e02[_0xc126('0x12')],_0x5f477b);_0x2564c4(_0x1c37a5[_0xc126('0x11')](0x1f4,_0xc20e02[_0xc126('0x12')]));});});}; \ No newline at end of file +var _0x19d4=['update','UpdateVoiceCallReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','map','include','model','attributes','CreateVoiceCallReport','create','body','catch'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x19d4,0x121));var _0x419d=function(_0x32b96c,_0xe55520){_0x32b96c=_0x32b96c-0x0;var _0x36b76f=_0x19d4[_0x32b96c];return _0x36b76f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x419d('0x0'));var BPromise=require(_0x419d('0x1'));var rs=require(_0x419d('0x2'));var fs=require('fs');var Redis=require(_0x419d('0x3'));var db=require(_0x419d('0x4'))['db'];var utils=require(_0x419d('0x5'));var logger=require(_0x419d('0x6'))(_0x419d('0x7'));var config=require(_0x419d('0x8'));var jayson=require(_0x419d('0x9'));var client=jayson[_0x419d('0xa')][_0x419d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x206f52,_0x55afe4,_0x1d70a0){return new BPromise(function(_0x3772aa,_0x3548c2){return client[_0x419d('0xc')](_0x206f52,_0x1d70a0)[_0x419d('0xd')](function(_0x85993d){logger[_0x419d('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x55afe4,_0x419d('0xf'));logger[_0x419d('0x10')](_0x419d('0x11'),_0x55afe4,'request\x20sent',JSON[_0x419d('0x12')](_0x85993d));if(_0x85993d['error']){if(_0x85993d[_0x419d('0x13')][_0x419d('0x14')]===0x1f4){logger[_0x419d('0x13')](_0x419d('0x15'),_0x55afe4,_0x85993d[_0x419d('0x13')][_0x419d('0x16')]);return _0x3548c2(_0x85993d[_0x419d('0x13')][_0x419d('0x16')]);}logger[_0x419d('0x13')](_0x419d('0x15'),_0x55afe4,_0x85993d[_0x419d('0x13')][_0x419d('0x16')]);return _0x3772aa(_0x85993d[_0x419d('0x13')]['message']);}else{logger[_0x419d('0xe')](_0x419d('0x15'),_0x55afe4,'request\x20sent');_0x3772aa(_0x85993d[_0x419d('0x17')]['message']);}})['catch'](function(_0x3f743f){logger[_0x419d('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x55afe4,_0x3f743f);_0x3548c2(_0x3f743f);});});}exports[_0x419d('0x18')]=function(_0x587c88){var _0x59c39=this;return new Promise(function(_0x17d91e,_0x1b302c){return db[_0x419d('0x19')][_0x419d('0x1a')]({'raw':_0x587c88[_0x419d('0x1b')]?_0x587c88[_0x419d('0x1b')][_0x419d('0x1c')]===undefined?!![]:![]:!![],'where':_0x587c88[_0x419d('0x1b')]?_0x587c88[_0x419d('0x1b')][_0x419d('0x1d')]||null:null,'attributes':_0x587c88[_0x419d('0x1b')]?_0x587c88[_0x419d('0x1b')]['attributes']||null:null,'limit':_0x587c88[_0x419d('0x1b')]?_0x587c88[_0x419d('0x1b')][_0x419d('0x1e')]||null:null,'include':_0x587c88[_0x419d('0x1b')]?_0x587c88['options']['include']?_[_0x419d('0x1f')](_0x587c88[_0x419d('0x1b')][_0x419d('0x20')],function(_0x1a9c91){return{'model':db[_0x1a9c91[_0x419d('0x21')]],'as':_0x1a9c91['as'],'attributes':_0x1a9c91['attributes'],'include':_0x1a9c91[_0x419d('0x20')]?_[_0x419d('0x1f')](_0x1a9c91['include'],function(_0xfc508d){return{'model':db[_0xfc508d['model']],'as':_0xfc508d['as'],'attributes':_0xfc508d[_0x419d('0x22')],'include':_0xfc508d['include']?_[_0x419d('0x1f')](_0xfc508d[_0x419d('0x20')],function(_0x3f9990){return{'model':db[_0x3f9990[_0x419d('0x21')]],'as':_0x3f9990['as'],'attributes':_0x3f9990[_0x419d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x419d('0xd')](function(_0x240ab6){logger['info']('GetVoiceCallReport',_0x587c88);logger[_0x419d('0x10')](_0x419d('0x18'),_0x587c88,JSON['stringify'](_0x240ab6));_0x17d91e(_0x240ab6);})['catch'](function(_0x39eb85){logger[_0x419d('0x13')]('GetVoiceCallReport',_0x39eb85['message'],_0x587c88);_0x1b302c(_0x59c39[_0x419d('0x13')](0x1f4,_0x39eb85['message']));});});};exports[_0x419d('0x23')]=function(_0x43a757){var _0x310455=this;return new Promise(function(_0x4ff42b,_0xd91f1b){return db['VoiceCallReport'][_0x419d('0x24')](_0x43a757[_0x419d('0x25')],{'raw':_0x43a757[_0x419d('0x1b')]?_0x43a757[_0x419d('0x1b')][_0x419d('0x1c')]===undefined?!![]:![]:!![]})[_0x419d('0xd')](function(_0x51345b){logger['info'](_0x419d('0x23'),_0x43a757);logger[_0x419d('0x10')](_0x419d('0x23'),_0x43a757,JSON['stringify'](_0x51345b));_0x4ff42b(_0x51345b);})[_0x419d('0x26')](function(_0x21950b){logger['error'](_0x419d('0x23'),_0x21950b[_0x419d('0x16')],_0x43a757);_0xd91f1b(_0x310455[_0x419d('0x13')](0x1f4,_0x21950b[_0x419d('0x16')]));});});};exports['UpdateVoiceCallReport']=function(_0x44c92c){var _0x1dd03=this;return new Promise(function(_0x2e8306,_0xfa0242){return db[_0x419d('0x19')][_0x419d('0x27')](_0x44c92c[_0x419d('0x25')],{'raw':_0x44c92c['options']?_0x44c92c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44c92c[_0x419d('0x1b')]?_0x44c92c[_0x419d('0x1b')][_0x419d('0x1d')]||null:null,'attributes':_0x44c92c[_0x419d('0x1b')]?_0x44c92c[_0x419d('0x1b')][_0x419d('0x22')]||null:null,'limit':_0x44c92c[_0x419d('0x1b')]?_0x44c92c[_0x419d('0x1b')]['limit']||null:null})[_0x419d('0xd')](function(_0x513685){logger['info'](_0x419d('0x28'),_0x44c92c);logger['debug'](_0x419d('0x28'),_0x44c92c,JSON[_0x419d('0x12')](_0x513685));_0x2e8306(_0x513685);})[_0x419d('0x26')](function(_0x223991){logger[_0x419d('0x13')](_0x419d('0x28'),_0x223991['message'],_0x44c92c);_0xfa0242(_0x1dd03[_0x419d('0x13')](0x1f4,_0x223991[_0x419d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 171a486..a122bcc 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 _0x8913=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','index','get','show','post','isAuthenticated','create','put','/:id','update'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x8913,0x7f));var _0x3891=function(_0x4e227b,_0x560195){_0x4e227b=_0x4e227b-0x0;var _0x584427=_0x8913[_0x4e227b];return _0x584427;};'use strict';var multer=require(_0x3891('0x0'));var util=require('util');var path=require(_0x3891('0x1'));var timeout=require(_0x3891('0x2'));var express=require(_0x3891('0x3'));var router=express[_0x3891('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3891('0x5'));var interaction=require(_0x3891('0x6'));var config=require('../../config/environment');var controller=require(_0x3891('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3891('0x8')]);router[_0x3891('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3891('0xa')]);router[_0x3891('0xb')]('/',auth[_0x3891('0xc')](),controller[_0x3891('0xd')]);router[_0x3891('0xe')](_0x3891('0xf'),auth[_0x3891('0xc')](),controller[_0x3891('0x10')]);router['delete'](_0x3891('0xf'),auth[_0x3891('0xc')](),controller['destroy']);module[_0x3891('0x11')]=router; \ No newline at end of file +var _0x5b0e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5b0e,0x12e));var _0xe5b0=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x5b0e[_0x18cac4];return _0x2227c6;};'use strict';var multer=require(_0xe5b0('0x0'));var util=require('util');var path=require(_0xe5b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe5b0('0x2'));var router=express['Router']();var fs_extra=require(_0xe5b0('0x3'));var auth=require(_0xe5b0('0x4'));var interaction=require(_0xe5b0('0x5'));var config=require(_0xe5b0('0x6'));var controller=require('./voiceChanSpy.controller');router[_0xe5b0('0x7')]('/',auth[_0xe5b0('0x8')](),controller[_0xe5b0('0x9')]);router[_0xe5b0('0x7')](_0xe5b0('0xa'),auth[_0xe5b0('0x8')](),controller['show']);router[_0xe5b0('0xb')]('/',auth[_0xe5b0('0x8')](),controller[_0xe5b0('0xc')]);router[_0xe5b0('0xd')]('/:id',auth[_0xe5b0('0x8')](),controller[_0xe5b0('0xe')]);router[_0xe5b0('0xf')]('/:id',auth[_0xe5b0('0x8')](),controller[_0xe5b0('0x10')]);module[_0xe5b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index e6ab757..869e585 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 _0x37a4=['name','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x54c608,_0x2e25ba){var _0x14aed7=function(_0x2f7095){while(--_0x2f7095){_0x54c608['push'](_0x54c608['shift']());}};_0x14aed7(++_0x2e25ba);}(_0x37a4,0x13d));var _0x437a=function(_0x27d967,_0x5e429d){_0x27d967=_0x27d967-0x0;var _0x7d38c3=_0x37a4[_0x27d967];return _0x7d38c3;};'use strict';var Sequelize=require(_0x437a('0x0'));module[_0x437a('0x1')]={'name':{'type':Sequelize[_0x437a('0x2')]},'prefix':{'type':Sequelize[_0x437a('0x2')],'unique':_0x437a('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x437a('0x2')],'set':function(_0x289a0d){this['setDataValue']('options',_0x289a0d?_0x289a0d['join'](''):[]);},'get':function(){return this[_0x437a('0x4')](_0x437a('0x5'))?this[_0x437a('0x4')]('options')[_0x437a('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x437a('0x2')]},'record':{'type':Sequelize[_0x437a('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0097=['name','setDataValue','options','join','BOOLEAN','exports','STRING'];(function(_0x5f3cb2,_0x141f34){var _0x4da262=function(_0x3b558f){while(--_0x3b558f){_0x5f3cb2['push'](_0x5f3cb2['shift']());}};_0x4da262(++_0x141f34);}(_0x0097,0xe5));var _0x7009=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0097[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7009('0x0')]={'name':{'type':Sequelize[_0x7009('0x1')]},'prefix':{'type':Sequelize[_0x7009('0x1')],'unique':_0x7009('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x2f9d62){this[_0x7009('0x3')](_0x7009('0x4'),_0x2f9d62?_0x2f9d62[_0x7009('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x7009('0x4'))?this['getDataValue'](_0x7009('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x7009('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x7009('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7009('0x1')]},'description':{'type':Sequelize[_0x7009('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 06dc865..76195ce 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 _0x559a=['order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','get','ChanSpies','then','end','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0xefd81c,_0x5b2089){var _0x19ec2b=function(_0x55d1e3){while(--_0x55d1e3){_0xefd81c['push'](_0xefd81c['shift']());}};_0x19ec2b(++_0x5b2089);}(_0x559a,0xb3));var _0xa559=function(_0x330617,_0x32444d){_0x330617=_0x330617-0x0;var _0x5cbe6c=_0x559a[_0x330617];return _0x5cbe6c;};'use strict';var emlformat=require(_0xa559('0x0'));var rimraf=require(_0xa559('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa559('0x2'));var rp=require(_0xa559('0x3'));var moment=require(_0xa559('0x4'));var BPromise=require(_0xa559('0x5'));var Mustache=require(_0xa559('0x6'));var util=require(_0xa559('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa559('0x8'));var ejs=require(_0xa559('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa559('0xa'));var squel=require(_0xa559('0xb'));var crypto=require('crypto');var jsforce=require(_0xa559('0xc'));var deskjs=require(_0xa559('0xd'));var toCsv=require(_0xa559('0x8'));var querystring=require(_0xa559('0xe'));var Papa=require('papaparse');var Redis=require(_0xa559('0xf'));var authService=require(_0xa559('0x10'));var qs=require(_0xa559('0x11'));var as=require(_0xa559('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa559('0x13'));var utils=require(_0xa559('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa559('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442e26,_0x5f0463){_0x5f0463=_0x5f0463||0xcc;return function(_0x2a646e){if(_0x2a646e){return _0x442e26[_0xa559('0x16')](_0x5f0463);}return _0x442e26[_0xa559('0x17')](_0x5f0463)['end']();};}function respondWithResult(_0xe93c61,_0x3853fd){_0x3853fd=_0x3853fd||0xc8;return function(_0x5ed915){if(_0x5ed915){return _0xe93c61[_0xa559('0x17')](_0x3853fd)[_0xa559('0x18')](_0x5ed915);}};}function respondWithFilteredResult(_0x369d26,_0x1e48b3){return function(_0x539a4b){if(_0x539a4b){var _0x309c27=typeof _0x1e48b3['offset']===_0xa559('0x19')&&typeof _0x1e48b3[_0xa559('0x1a')]==='undefined';var _0x2c6993=_0x539a4b[_0xa559('0x1b')];var _0x163405=_0x309c27?0x0:_0x1e48b3[_0xa559('0x1c')];var _0x1a4c42=_0x309c27?_0x539a4b[_0xa559('0x1b')]:_0x1e48b3[_0xa559('0x1c')]+_0x1e48b3[_0xa559('0x1a')];var _0x329d59;if(_0x1a4c42>=_0x2c6993){_0x1a4c42=_0x2c6993;_0x329d59=0xc8;}else{_0x329d59=0xce;}_0x369d26[_0xa559('0x17')](_0x329d59);return _0x369d26['set']('Content-Range',_0x163405+'-'+_0x1a4c42+'/'+_0x2c6993)[_0xa559('0x18')](_0x539a4b);}return null;};}function patchUpdates(_0x3aa532){return function(_0x47cb65){try{jsonpatch[_0xa559('0x1d')](_0x47cb65,_0x3aa532,!![]);}catch(_0x190a9e){return BPromise[_0xa559('0x1e')](_0x190a9e);}return _0x47cb65[_0xa559('0x1f')]();};}function saveUpdates(_0x1812ef,_0x2dd8cf){return function(_0x572046){if(_0x572046){return _0x572046[_0xa559('0x20')](_0x1812ef)['then'](function(_0x1d4370){return _0x1d4370;});}return null;};}function removeEntity(_0x396fe9,_0x314fef){return function(_0x487a60){if(_0x487a60){return _0x487a60[_0xa559('0x21')]()['then'](function(){var _0xad00b0=_0x487a60[_0xa559('0x22')]({'plain':!![]});var _0x5834c6=_0xa559('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x5834c6,'resourceId':_0xad00b0['id']}})[_0xa559('0x24')](function(){return _0x487a60;});})[_0xa559('0x24')](function(){_0x396fe9[_0xa559('0x17')](0xcc)[_0xa559('0x25')]();});}};}function handleEntityNotFound(_0x4311db,_0x16a1e3){return function(_0x31e24b){if(!_0x31e24b){_0x4311db[_0xa559('0x16')](0x194);}return _0x31e24b;};}function handleError(_0x48f385,_0x11a3d2){_0x11a3d2=_0x11a3d2||0x1f4;return function(_0x30a781){logger[_0xa559('0x26')](_0x30a781[_0xa559('0x27')]);if(_0x30a781['name']){delete _0x30a781[_0xa559('0x28')];}_0x48f385[_0xa559('0x17')](_0x11a3d2)[_0xa559('0x29')](_0x30a781);};}exports['index']=function(_0x854bd,_0x224a3a){var _0xd0481e={},_0x469a4e={},_0x15a3ed={'count':0x0,'rows':[]};var _0x189267=_[_0xa559('0x2a')](db[_0xa559('0x2b')][_0xa559('0x2c')],function(_0x5a9f8d){return{'name':_0x5a9f8d[_0xa559('0x2d')],'type':_0x5a9f8d[_0xa559('0x2e')][_0xa559('0x2f')]};});_0x469a4e[_0xa559('0x30')]=_['map'](_0x189267,_0xa559('0x28'));_0x469a4e['query']=_[_0xa559('0x31')](_0x854bd[_0xa559('0x32')]);_0x469a4e[_0xa559('0x33')]=_[_0xa559('0x34')](_0x469a4e[_0xa559('0x30')],_0x469a4e[_0xa559('0x32')]);_0xd0481e['attributes']=_[_0xa559('0x34')](_0x469a4e[_0xa559('0x30')],qs[_0xa559('0x35')](_0x854bd[_0xa559('0x32')][_0xa559('0x35')]));_0xd0481e[_0xa559('0x36')]=_0xd0481e[_0xa559('0x36')][_0xa559('0x37')]?_0xd0481e['attributes']:_0x469a4e[_0xa559('0x30')];if(!_0x854bd[_0xa559('0x32')][_0xa559('0x38')](_0xa559('0x39'))){_0xd0481e[_0xa559('0x1a')]=qs[_0xa559('0x1a')](_0x854bd[_0xa559('0x32')]['limit']);_0xd0481e[_0xa559('0x1c')]=qs[_0xa559('0x1c')](_0x854bd[_0xa559('0x32')][_0xa559('0x1c')]);}_0xd0481e[_0xa559('0x3a')]=qs[_0xa559('0x3b')](_0x854bd[_0xa559('0x32')][_0xa559('0x3b')]);_0xd0481e[_0xa559('0x3c')]=qs[_0xa559('0x33')](_[_0xa559('0x3d')](_0x854bd[_0xa559('0x32')],_0x469a4e[_0xa559('0x33')]),_0x189267);if(_0x854bd['query'][_0xa559('0x3e')]){_0xd0481e['where']=_[_0xa559('0x3f')](_0xd0481e['where'],{'$or':_[_0xa559('0x2a')](_0x189267,function(_0x4be2c9){if(_0x4be2c9[_0xa559('0x2e')]!==_0xa559('0x40')){var _0x1ba33c={};_0x1ba33c[_0x4be2c9[_0xa559('0x28')]]={'$like':'%'+_0x854bd[_0xa559('0x32')][_0xa559('0x3e')]+'%'};return _0x1ba33c;}})});}_0xd0481e=_[_0xa559('0x3f')]({},_0xd0481e,_0x854bd['options']);var _0x34caf4={'where':_0xd0481e[_0xa559('0x3c')]};return db[_0xa559('0x2b')][_0xa559('0x1b')](_0x34caf4)[_0xa559('0x24')](function(_0x278f31){_0x15a3ed['count']=_0x278f31;if(_0x854bd[_0xa559('0x32')][_0xa559('0x41')]){_0xd0481e[_0xa559('0x42')]=[{'all':!![]}];}return db[_0xa559('0x2b')]['findAll'](_0xd0481e);})[_0xa559('0x24')](function(_0x2af622){_0x15a3ed[_0xa559('0x43')]=_0x2af622;return _0x15a3ed;})[_0xa559('0x24')](respondWithFilteredResult(_0x224a3a,_0xd0481e))[_0xa559('0x44')](handleError(_0x224a3a,null));};exports['show']=function(_0xdd0241,_0x41ee5d){var _0xfea9db={'raw':![],'where':{'id':_0xdd0241[_0xa559('0x45')]['id']}},_0x105f94={};_0x105f94[_0xa559('0x30')]=_[_0xa559('0x31')](db['VoiceChanSpy'][_0xa559('0x2c')]);_0x105f94[_0xa559('0x32')]=_[_0xa559('0x31')](_0xdd0241[_0xa559('0x32')]);_0x105f94[_0xa559('0x33')]=_[_0xa559('0x34')](_0x105f94[_0xa559('0x30')],_0x105f94[_0xa559('0x32')]);_0xfea9db[_0xa559('0x36')]=_['intersection'](_0x105f94[_0xa559('0x30')],qs[_0xa559('0x35')](_0xdd0241[_0xa559('0x32')][_0xa559('0x35')]));_0xfea9db[_0xa559('0x36')]=_0xfea9db[_0xa559('0x36')][_0xa559('0x37')]?_0xfea9db['attributes']:_0x105f94[_0xa559('0x30')];if(_0xdd0241[_0xa559('0x32')][_0xa559('0x41')]){_0xfea9db[_0xa559('0x42')]=[{'all':!![]}];}_0xfea9db=_[_0xa559('0x3f')]({},_0xfea9db,_0xdd0241['options']);return db[_0xa559('0x2b')][_0xa559('0x46')](_0xfea9db)['then'](handleEntityNotFound(_0x41ee5d,null))[_0xa559('0x24')](respondWithResult(_0x41ee5d,null))[_0xa559('0x44')](handleError(_0x41ee5d,null));};exports['create']=function(_0x56a722,_0x140490){return db[_0xa559('0x2b')][_0xa559('0x47')](_0x56a722[_0xa559('0x48')],{})[_0xa559('0x24')](function(_0x166d1b){var _0x4f3eb7=_0x56a722[_0xa559('0x49')]['get']({'plain':!![]});if(!_0x4f3eb7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f3eb7['role']===_0xa559('0x49')){var _0x2c200e=_0x166d1b[_0xa559('0x22')]({'plain':!![]});var _0xad03d0=_0xa559('0x23');return db[_0xa559('0x4a')][_0xa559('0x46')]({'where':{'name':_0xad03d0,'userProfileId':_0x4f3eb7[_0xa559('0x4b')]},'raw':!![]})[_0xa559('0x24')](function(_0x3ede86){if(_0x3ede86&&_0x3ede86[_0xa559('0x4c')]===0x0){return db[_0xa559('0x4d')][_0xa559('0x47')]({'name':_0x2c200e[_0xa559('0x28')],'resourceId':_0x2c200e['id'],'type':_0x3ede86[_0xa559('0x28')],'sectionId':_0x3ede86['id']},{})[_0xa559('0x24')](function(){return _0x166d1b;});}else{return _0x166d1b;}})[_0xa559('0x44')](function(_0x5da1aa){logger[_0xa559('0x26')](_0xa559('0x4e'),_0x5da1aa);throw _0x5da1aa;});}return _0x166d1b;})[_0xa559('0x24')](respondWithResult(_0x140490,0xc9))[_0xa559('0x44')](handleError(_0x140490,null));};exports[_0xa559('0x20')]=function(_0x3b0fdb,_0x39648c){if(_0x3b0fdb[_0xa559('0x48')]['id']){delete _0x3b0fdb['body']['id'];}return db[_0xa559('0x2b')][_0xa559('0x46')]({'where':{'id':_0x3b0fdb[_0xa559('0x45')]['id']}})['then'](handleEntityNotFound(_0x39648c,null))['then'](saveUpdates(_0x3b0fdb[_0xa559('0x48')],null))[_0xa559('0x24')](respondWithResult(_0x39648c,null))['catch'](handleError(_0x39648c,null));};exports[_0xa559('0x21')]=function(_0x103fba,_0x2c8e60){return db['VoiceChanSpy'][_0xa559('0x46')]({'where':{'id':_0x103fba[_0xa559('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c8e60,null))['then'](removeEntity(_0x2c8e60,null))['catch'](handleError(_0x2c8e60,null));}; \ No newline at end of file +var _0x7341=['status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','ChanSpies','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','sendStatus'];(function(_0x2e4edb,_0x43fb89){var _0x42f6a9=function(_0x2701c8){while(--_0x2701c8){_0x2e4edb['push'](_0x2e4edb['shift']());}};_0x42f6a9(++_0x43fb89);}(_0x7341,0xe4));var _0x1734=function(_0x24946b,_0x82a605){_0x24946b=_0x24946b-0x0;var _0x56a39f=_0x7341[_0x24946b];return _0x56a39f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1734('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1734('0x1'));var moment=require(_0x1734('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1734('0x3'));var util=require(_0x1734('0x4'));var path=require(_0x1734('0x5'));var sox=require(_0x1734('0x6'));var csv=require(_0x1734('0x7'));var ejs=require(_0x1734('0x8'));var fs=require('fs');var fs_extra=require(_0x1734('0x9'));var _=require('lodash');var squel=require(_0x1734('0xa'));var crypto=require(_0x1734('0xb'));var jsforce=require(_0x1734('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1734('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1734('0xd'));var authService=require(_0x1734('0xe'));var qs=require(_0x1734('0xf'));var as=require(_0x1734('0x10'));var hardwareService=require(_0x1734('0x11'));var logger=require(_0x1734('0x12'))(_0x1734('0x13'));var utils=require(_0x1734('0x14'));var config=require(_0x1734('0x15'));var licenseUtil=require(_0x1734('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4391a1,_0x449ab1){_0x449ab1=_0x449ab1||0xcc;return function(_0x44de07){if(_0x44de07){return _0x4391a1[_0x1734('0x17')](_0x449ab1);}return _0x4391a1[_0x1734('0x18')](_0x449ab1)[_0x1734('0x19')]();};}function respondWithResult(_0x9e7cf5,_0xd2f288){_0xd2f288=_0xd2f288||0xc8;return function(_0xb90c22){if(_0xb90c22){return _0x9e7cf5[_0x1734('0x18')](_0xd2f288)[_0x1734('0x1a')](_0xb90c22);}};}function respondWithFilteredResult(_0x27679e,_0x2162c9){return function(_0x2dd53c){if(_0x2dd53c){var _0x3989a6=typeof _0x2162c9[_0x1734('0x1b')]===_0x1734('0x1c')&&typeof _0x2162c9[_0x1734('0x1d')]===_0x1734('0x1c');var _0x56756c=_0x2dd53c['count'];var _0x1fa9c0=_0x3989a6?0x0:_0x2162c9[_0x1734('0x1b')];var _0x4a86d1=_0x3989a6?_0x2dd53c[_0x1734('0x1e')]:_0x2162c9['offset']+_0x2162c9['limit'];var _0x5b2789;if(_0x4a86d1>=_0x56756c){_0x4a86d1=_0x56756c;_0x5b2789=0xc8;}else{_0x5b2789=0xce;}_0x27679e[_0x1734('0x18')](_0x5b2789);return _0x27679e['set'](_0x1734('0x1f'),_0x1fa9c0+'-'+_0x4a86d1+'/'+_0x56756c)[_0x1734('0x1a')](_0x2dd53c);}return null;};}function patchUpdates(_0x4fc4ed){return function(_0x54b1bd){try{jsonpatch['apply'](_0x54b1bd,_0x4fc4ed,!![]);}catch(_0x1e7401){return BPromise['reject'](_0x1e7401);}return _0x54b1bd[_0x1734('0x20')]();};}function saveUpdates(_0x5ad801,_0x215ae4){return function(_0x42485f){if(_0x42485f){return _0x42485f[_0x1734('0x21')](_0x5ad801)[_0x1734('0x22')](function(_0x29bb2c){return _0x29bb2c;});}return null;};}function removeEntity(_0x45593e,_0x4285ee){return function(_0x44e420){if(_0x44e420){return _0x44e420[_0x1734('0x23')]()['then'](function(){var _0x34ac29=_0x44e420['get']({'plain':!![]});var _0x5e0023=_0x1734('0x24');return db[_0x1734('0x25')][_0x1734('0x23')]({'where':{'type':_0x5e0023,'resourceId':_0x34ac29['id']}})[_0x1734('0x22')](function(){return _0x44e420;});})[_0x1734('0x22')](function(){_0x45593e[_0x1734('0x18')](0xcc)[_0x1734('0x19')]();});}};}function handleEntityNotFound(_0x27d6e5,_0x4a670a){return function(_0x381960){if(!_0x381960){_0x27d6e5['sendStatus'](0x194);}return _0x381960;};}function handleError(_0x17e068,_0x16a35f){_0x16a35f=_0x16a35f||0x1f4;return function(_0xfca2ad){logger['error'](_0xfca2ad[_0x1734('0x26')]);if(_0xfca2ad[_0x1734('0x27')]){delete _0xfca2ad[_0x1734('0x27')];}_0x17e068['status'](_0x16a35f)[_0x1734('0x28')](_0xfca2ad);};}exports[_0x1734('0x29')]=function(_0x5594c0,_0x1bd659){var _0x419e75={},_0x1b2d85={},_0xf3d22e={'count':0x0,'rows':[]};var _0x4f4d92=_[_0x1734('0x2a')](db[_0x1734('0x2b')]['rawAttributes'],function(_0x4dd04a){return{'name':_0x4dd04a[_0x1734('0x2c')],'type':_0x4dd04a[_0x1734('0x2d')][_0x1734('0x2e')]};});_0x1b2d85[_0x1734('0x2f')]=_[_0x1734('0x2a')](_0x4f4d92,_0x1734('0x27'));_0x1b2d85[_0x1734('0x30')]=_[_0x1734('0x31')](_0x5594c0[_0x1734('0x30')]);_0x1b2d85[_0x1734('0x32')]=_[_0x1734('0x33')](_0x1b2d85[_0x1734('0x2f')],_0x1b2d85[_0x1734('0x30')]);_0x419e75[_0x1734('0x34')]=_[_0x1734('0x33')](_0x1b2d85[_0x1734('0x2f')],qs[_0x1734('0x35')](_0x5594c0['query'][_0x1734('0x35')]));_0x419e75['attributes']=_0x419e75[_0x1734('0x34')][_0x1734('0x36')]?_0x419e75[_0x1734('0x34')]:_0x1b2d85[_0x1734('0x2f')];if(!_0x5594c0[_0x1734('0x30')][_0x1734('0x37')](_0x1734('0x38'))){_0x419e75[_0x1734('0x1d')]=qs['limit'](_0x5594c0[_0x1734('0x30')][_0x1734('0x1d')]);_0x419e75[_0x1734('0x1b')]=qs[_0x1734('0x1b')](_0x5594c0[_0x1734('0x30')][_0x1734('0x1b')]);}_0x419e75[_0x1734('0x39')]=qs['sort'](_0x5594c0[_0x1734('0x30')][_0x1734('0x3a')]);_0x419e75[_0x1734('0x3b')]=qs[_0x1734('0x32')](_[_0x1734('0x3c')](_0x5594c0[_0x1734('0x30')],_0x1b2d85[_0x1734('0x32')]),_0x4f4d92);if(_0x5594c0[_0x1734('0x30')]['filter']){_0x419e75[_0x1734('0x3b')]=_['merge'](_0x419e75[_0x1734('0x3b')],{'$or':_[_0x1734('0x2a')](_0x4f4d92,function(_0x4ee569){if(_0x4ee569[_0x1734('0x2d')]!==_0x1734('0x3d')){var _0x169db8={};_0x169db8[_0x4ee569[_0x1734('0x27')]]={'$like':'%'+_0x5594c0[_0x1734('0x30')][_0x1734('0x3e')]+'%'};return _0x169db8;}})});}_0x419e75=_[_0x1734('0x3f')]({},_0x419e75,_0x5594c0[_0x1734('0x40')]);var _0x55d67c={'where':_0x419e75[_0x1734('0x3b')]};return db[_0x1734('0x2b')][_0x1734('0x1e')](_0x55d67c)[_0x1734('0x22')](function(_0x5f34e1){_0xf3d22e[_0x1734('0x1e')]=_0x5f34e1;if(_0x5594c0['query']['includeAll']){_0x419e75[_0x1734('0x41')]=[{'all':!![]}];}return db[_0x1734('0x2b')][_0x1734('0x42')](_0x419e75);})[_0x1734('0x22')](function(_0x4fc418){_0xf3d22e[_0x1734('0x43')]=_0x4fc418;return _0xf3d22e;})[_0x1734('0x22')](respondWithFilteredResult(_0x1bd659,_0x419e75))['catch'](handleError(_0x1bd659,null));};exports[_0x1734('0x44')]=function(_0x1b104a,_0x55954e){var _0x17f282={'raw':![],'where':{'id':_0x1b104a[_0x1734('0x45')]['id']}},_0x4bfc67={};_0x4bfc67[_0x1734('0x2f')]=_[_0x1734('0x31')](db[_0x1734('0x2b')][_0x1734('0x46')]);_0x4bfc67[_0x1734('0x30')]=_[_0x1734('0x31')](_0x1b104a['query']);_0x4bfc67[_0x1734('0x32')]=_[_0x1734('0x33')](_0x4bfc67['model'],_0x4bfc67[_0x1734('0x30')]);_0x17f282[_0x1734('0x34')]=_[_0x1734('0x33')](_0x4bfc67[_0x1734('0x2f')],qs['fields'](_0x1b104a[_0x1734('0x30')][_0x1734('0x35')]));_0x17f282[_0x1734('0x34')]=_0x17f282['attributes'][_0x1734('0x36')]?_0x17f282[_0x1734('0x34')]:_0x4bfc67[_0x1734('0x2f')];if(_0x1b104a[_0x1734('0x30')][_0x1734('0x47')]){_0x17f282[_0x1734('0x41')]=[{'all':!![]}];}_0x17f282=_[_0x1734('0x3f')]({},_0x17f282,_0x1b104a[_0x1734('0x40')]);return db[_0x1734('0x2b')][_0x1734('0x48')](_0x17f282)[_0x1734('0x22')](handleEntityNotFound(_0x55954e,null))[_0x1734('0x22')](respondWithResult(_0x55954e,null))[_0x1734('0x49')](handleError(_0x55954e,null));};exports[_0x1734('0x4a')]=function(_0x470110,_0x121c8c){return db[_0x1734('0x2b')][_0x1734('0x4a')](_0x470110['body'],{})[_0x1734('0x22')](function(_0x50e12d){var _0xfc42f3=_0x470110[_0x1734('0x4b')][_0x1734('0x4c')]({'plain':!![]});if(!_0xfc42f3)throw new Error(_0x1734('0x4d'));if(_0xfc42f3['role']==='user'){var _0x294097=_0x50e12d[_0x1734('0x4c')]({'plain':!![]});var _0x518ef4=_0x1734('0x24');return db[_0x1734('0x4e')][_0x1734('0x48')]({'where':{'name':_0x518ef4,'userProfileId':_0xfc42f3[_0x1734('0x4f')]},'raw':!![]})[_0x1734('0x22')](function(_0x1394bd){if(_0x1394bd&&_0x1394bd[_0x1734('0x50')]===0x0){return db['UserProfileResource'][_0x1734('0x4a')]({'name':_0x294097[_0x1734('0x27')],'resourceId':_0x294097['id'],'type':_0x1394bd[_0x1734('0x27')],'sectionId':_0x1394bd['id']},{})['then'](function(){return _0x50e12d;});}else{return _0x50e12d;}})[_0x1734('0x49')](function(_0x6b6fef){logger[_0x1734('0x51')](_0x1734('0x52'),_0x6b6fef);throw _0x6b6fef;});}return _0x50e12d;})['then'](respondWithResult(_0x121c8c,0xc9))[_0x1734('0x49')](handleError(_0x121c8c,null));};exports[_0x1734('0x21')]=function(_0x19ceed,_0xac0441){if(_0x19ceed[_0x1734('0x53')]['id']){delete _0x19ceed['body']['id'];}return db[_0x1734('0x2b')]['find']({'where':{'id':_0x19ceed['params']['id']}})[_0x1734('0x22')](handleEntityNotFound(_0xac0441,null))[_0x1734('0x22')](saveUpdates(_0x19ceed['body'],null))['then'](respondWithResult(_0xac0441,null))[_0x1734('0x49')](handleError(_0xac0441,null));};exports[_0x1734('0x23')]=function(_0x553fc0,_0x515e39){return db['VoiceChanSpy'][_0x1734('0x48')]({'where':{'id':_0x553fc0[_0x1734('0x45')]['id']}})[_0x1734('0x22')](handleEntityNotFound(_0x515e39,null))[_0x1734('0x22')](removeEntity(_0x515e39,null))['catch'](handleError(_0x515e39,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index aee7b35..2037202 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 _0xa982=['voice_chanspy','bulkCreate','VoiceExtension','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','User','internal','agent','then','catch','exports','define'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xa982,0xb3));var _0x2a98=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xa982[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x2a98('0x0'));var attributes=require(_0x2a98('0x1'));var getUserApplications=function(_0x5d92f8,_0x10e879,_0x16a2bc){var _0x260937=0x1;var _0x4f4ecf=[];var _0x348a9d={'context':_0x10e879[_0x2a98('0x2')]||_0x2a98('0x3'),'exten':util[_0x2a98('0x4')](_0x2a98('0x5'),_0x5d92f8[_0x2a98('0x6')],_0x16a2bc),'type':_0x2a98('0x7'),'isApp':![],'ChanSpyId':_0x5d92f8['id'],'UserId':_0x10e879['id']};_0x4f4ecf[_0x2a98('0x8')](_[_0x2a98('0x9')]({'app':'Set','appdata':util['format'](_0x2a98('0xa'),'chanspy'),'priority':_0x260937++},_0x348a9d));if(_0x5d92f8[_0x2a98('0xb')]){_0x4f4ecf['push'](_[_0x2a98('0x9')]({'app':'MixMonitor','appdata':util['format'](_0x2a98('0xc'),_0x5d92f8[_0x2a98('0xd')]),'priority':_0x260937++},_0x348a9d));}if(_0x5d92f8[_0x2a98('0xe')]){_0x4f4ecf[_0x2a98('0x8')](_[_0x2a98('0x9')]({'app':_0x2a98('0xf'),'appdata':_0x5d92f8[_0x2a98('0x10')],'priority':_0x260937++},_0x348a9d));}_0x4f4ecf[_0x2a98('0x8')](_[_0x2a98('0x9')]({'app':'ChanSpy','appdata':util[_0x2a98('0x4')](_0x2a98('0x11'),_0x10e879[_0x2a98('0x12')],_0x5d92f8[_0x2a98('0x13')]?_0x5d92f8[_0x2a98('0x13')][_0x2a98('0x14')](''):''),'priority':_0x260937++},_0x348a9d));if(_0x5d92f8[_0x2a98('0xb')]){_0x4f4ecf['push'](_[_0x2a98('0x9')]({'app':_0x2a98('0x15'),'priority':_0x260937++},_0x348a9d));}return _0x4f4ecf;};var getChanSpyApplications=function(_0x8310e8,_0xfb21c2){var _0x447a3d=[];for(var _0x5def6c=0x0,_0x101e2f=0x1;_0x5def6c<_0xfb21c2[_0x2a98('0x16')];_0x5def6c++,_0x101e2f=0x1){_0x447a3d=_0x447a3d[_0x2a98('0x17')](getUserApplications(_0x8310e8,_0xfb21c2[_0x5def6c],_0xfb21c2[_0x5def6c]['internal']));if(_0xfb21c2[_0x5def6c]['internal']!=_0xfb21c2[_0x5def6c][_0x2a98('0x12')]){_0x447a3d=_0x447a3d[_0x2a98('0x17')](getUserApplications(_0x8310e8,_0xfb21c2[_0x5def6c],_0xfb21c2[_0x5def6c]['name']));}}return _0x447a3d;};var getChanSpyPromise=function(_0x535da3,_0x3fb5fc){return new BPromise(function(_0x3d293f,_0x28c0c7){return _0x535da3[_0x2a98('0x18')]['findAll']({'attributes':['id','name',_0x2a98('0x19')],'where':{'role':_0x2a98('0x1a'),'chanspy':!![]},'raw':!![]})[_0x2a98('0x1b')](function(_0x2f5939){if(_0x2f5939){return _0x3d293f(getChanSpyApplications(_0x3fb5fc,_0x2f5939));}return _0x3d293f([]);})[_0x2a98('0x1c')](function(_0x431e81){_0x28c0c7(_0x431e81);});});};module[_0x2a98('0x1d')]=function(_0x1fb85f,_0x407d14){var _0x52cd13=_0x1fb85f['models'];return _0x1fb85f[_0x2a98('0x1e')]('VoiceChanSpy',attributes,{'tableName':_0x2a98('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b0f00,_0x170fe9,_0x4511d4){return getChanSpyPromise(_0x52cd13,_0x3b0f00)[_0x2a98('0x1b')](function(_0x2ccf1d){if(_0x2ccf1d&&_0x2ccf1d[_0x2a98('0x16')]){return _0x52cd13['VoiceExtension'][_0x2a98('0x20')](_0x2ccf1d);}})[_0x2a98('0x1b')](function(){_0x4511d4();})[_0x2a98('0x1c')](function(_0x51687d){_0x4511d4(_0x51687d);});},'afterUpdate':function(_0x5eeca1,_0x28472a,_0x50db69){return _0x52cd13[_0x2a98('0x21')][_0x2a98('0x22')]({'where':{'ChanSpyId':_0x5eeca1['id']}})[_0x2a98('0x1b')](function(){return getChanSpyPromise(_0x52cd13,_0x5eeca1);})['then'](function(_0x1f201b){if(_0x1f201b&&_0x1f201b[_0x2a98('0x16')]){return _0x52cd13[_0x2a98('0x21')][_0x2a98('0x20')](_0x1f201b);}})[_0x2a98('0x1b')](function(){_0x50db69();})['catch'](function(_0x56a519){_0x50db69(_0x56a519);});},'afterDestroy':function(_0xb34d12,_0x3f4f9c,_0x1033f8){return _0x52cd13[_0x2a98('0x21')][_0x2a98('0x22')]({'where':{'ChanSpyId':_0xb34d12['id']}})[_0x2a98('0x1b')](function(){_0x1033f8();})[_0x2a98('0x1c')](function(_0x5139a2){_0x1033f8(_0x5139a2);});}}});}; \ No newline at end of file +var _0xe291=['then','VoiceExtension','bulkCreate','catch','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','format','prefix','system','merge','Set','CDR(type)=%s','chanspy','push','MixMonitor','${UNIQUEID}.%s,a','auth','password','name','options','record','length','concat','internal','User','findAll','agent','exports','define','VoiceChanSpy','voice_chanspy'];(function(_0x27a5a0,_0x21ebaf){var _0x3b6b17=function(_0x57e25d){while(--_0x57e25d){_0x27a5a0['push'](_0x27a5a0['shift']());}};_0x3b6b17(++_0x21ebaf);}(_0xe291,0x19d));var _0x1e29=function(_0x374d9d,_0x3c3b7a){_0x374d9d=_0x374d9d-0x0;var _0x21d878=_0xe291[_0x374d9d];return _0x21d878;};'use strict';var _=require('lodash');var util=require(_0x1e29('0x0'));var BPromise=require(_0x1e29('0x1'));var attributes=require(_0x1e29('0x2'));var getUserApplications=function(_0x5c01b8,_0x109323,_0x2e974c){var _0x54a913=0x1;var _0x26e574=[];var _0x599987={'context':_0x109323['context']||_0x1e29('0x3'),'exten':util[_0x1e29('0x4')]('%s%s',_0x5c01b8[_0x1e29('0x5')],_0x2e974c),'type':_0x1e29('0x6'),'isApp':![],'ChanSpyId':_0x5c01b8['id'],'UserId':_0x109323['id']};_0x26e574['push'](_[_0x1e29('0x7')]({'app':_0x1e29('0x8'),'appdata':util[_0x1e29('0x4')](_0x1e29('0x9'),_0x1e29('0xa')),'priority':_0x54a913++},_0x599987));if(_0x5c01b8['record']){_0x26e574[_0x1e29('0xb')](_[_0x1e29('0x7')]({'app':_0x1e29('0xc'),'appdata':util[_0x1e29('0x4')](_0x1e29('0xd'),_0x5c01b8['recordingFormat']),'priority':_0x54a913++},_0x599987));}if(_0x5c01b8[_0x1e29('0xe')]){_0x26e574[_0x1e29('0xb')](_[_0x1e29('0x7')]({'app':'Authenticate','appdata':_0x5c01b8[_0x1e29('0xf')],'priority':_0x54a913++},_0x599987));}_0x26e574[_0x1e29('0xb')](_[_0x1e29('0x7')]({'app':'ChanSpy','appdata':util['format']('SIP/%s,%s',_0x109323[_0x1e29('0x10')],_0x5c01b8['options']?_0x5c01b8[_0x1e29('0x11')]['join'](''):''),'priority':_0x54a913++},_0x599987));if(_0x5c01b8[_0x1e29('0x12')]){_0x26e574[_0x1e29('0xb')](_['merge']({'app':'StopMixMonitor','priority':_0x54a913++},_0x599987));}return _0x26e574;};var getChanSpyApplications=function(_0x534b98,_0x326090){var _0x4785e7=[];for(var _0x7e781a=0x0,_0x36c31b=0x1;_0x7e781a<_0x326090[_0x1e29('0x13')];_0x7e781a++,_0x36c31b=0x1){_0x4785e7=_0x4785e7[_0x1e29('0x14')](getUserApplications(_0x534b98,_0x326090[_0x7e781a],_0x326090[_0x7e781a][_0x1e29('0x15')]));if(_0x326090[_0x7e781a]['internal']!=_0x326090[_0x7e781a][_0x1e29('0x10')]){_0x4785e7=_0x4785e7['concat'](getUserApplications(_0x534b98,_0x326090[_0x7e781a],_0x326090[_0x7e781a][_0x1e29('0x10')]));}}return _0x4785e7;};var getChanSpyPromise=function(_0x494579,_0x494961){return new BPromise(function(_0x155b58,_0x3f714c){return _0x494579[_0x1e29('0x16')][_0x1e29('0x17')]({'attributes':['id',_0x1e29('0x10'),_0x1e29('0x15')],'where':{'role':_0x1e29('0x18'),'chanspy':!![]},'raw':!![]})['then'](function(_0x507357){if(_0x507357){return _0x155b58(getChanSpyApplications(_0x494961,_0x507357));}return _0x155b58([]);})['catch'](function(_0x47b58e){_0x3f714c(_0x47b58e);});});};module[_0x1e29('0x19')]=function(_0x390da1,_0x733e85){var _0x475a53=_0x390da1['models'];return _0x390da1[_0x1e29('0x1a')](_0x1e29('0x1b'),attributes,{'tableName':_0x1e29('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x529e9e,_0x7b5a39,_0x32d661){return getChanSpyPromise(_0x475a53,_0x529e9e)[_0x1e29('0x1d')](function(_0x4e64c9){if(_0x4e64c9&&_0x4e64c9['length']){return _0x475a53[_0x1e29('0x1e')][_0x1e29('0x1f')](_0x4e64c9);}})[_0x1e29('0x1d')](function(){_0x32d661();})[_0x1e29('0x20')](function(_0x18335f){_0x32d661(_0x18335f);});},'afterUpdate':function(_0x764bde,_0x153556,_0x24bf14){return _0x475a53[_0x1e29('0x1e')]['destroy']({'where':{'ChanSpyId':_0x764bde['id']}})['then'](function(){return getChanSpyPromise(_0x475a53,_0x764bde);})[_0x1e29('0x1d')](function(_0x106875){if(_0x106875&&_0x106875[_0x1e29('0x13')]){return _0x475a53['VoiceExtension'][_0x1e29('0x1f')](_0x106875);}})['then'](function(){_0x24bf14();})[_0x1e29('0x20')](function(_0xfcb863){_0x24bf14(_0xfcb863);});},'afterDestroy':function(_0x321c84,_0x380682,_0x4aefdf){return _0x475a53[_0x1e29('0x1e')][_0x1e29('0x21')]({'where':{'ChanSpyId':_0x321c84['id']}})[_0x1e29('0x1d')](function(){_0x4aefdf();})['catch'](function(_0x5f7881){_0x4aefdf(_0x5f7881);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index f2893f4..1450013 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 _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a8310,_0x524cb4){var _0x43e09f=function(_0x5e8445){while(--_0x5e8445){_0x4a8310['push'](_0x4a8310['shift']());}};_0x43e09f(++_0x524cb4);}(_0x68fc,0xa5));var _0xc68f=function(_0x480942,_0x5f0aad){_0x480942=_0x480942-0x0;var _0x494bdd=_0x68fc[_0x480942];return _0x494bdd;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file +var _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x457fac,_0x3e5839){var _0x4019c2=function(_0x426ef3){while(--_0x426ef3){_0x457fac['push'](_0x457fac['shift']());}};_0x4019c2(++_0x3e5839);}(_0x668b,0x140));var _0xb668=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0x668b[_0x466247];return _0x4b352e;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index a26f7c1..d2578b5 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 _0x884b=['../../config/environment','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x239515,_0x491d9f){var _0x4a6efc=function(_0x432134){while(--_0x432134){_0x239515['push'](_0x239515['shift']());}};_0x4a6efc(++_0x491d9f);}(_0x884b,0x93));var _0xb884=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x884b[_0x2ade6c];return _0x2cb372;};'use strict';var multer=require('multer');var util=require(_0xb884('0x0'));var path=require(_0xb884('0x1'));var timeout=require('connect-timeout');var express=require(_0xb884('0x2'));var router=express[_0xb884('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb884('0x4'));var interaction=require(_0xb884('0x5'));var config=require(_0xb884('0x6'));var controller=require('./voiceContext.controller');router[_0xb884('0x7')]('/',auth[_0xb884('0x8')](),controller[_0xb884('0x9')]);router[_0xb884('0x7')](_0xb884('0xa'),auth[_0xb884('0x8')](),controller[_0xb884('0xb')]);router['post']('/',auth[_0xb884('0x8')](),controller['create']);router[_0xb884('0xc')](_0xb884('0xa'),auth['isAuthenticated'](),controller[_0xb884('0xd')]);router[_0xb884('0xe')]('/:id',auth[_0xb884('0x8')](),controller[_0xb884('0xf')]);module[_0xb884('0x10')]=router; \ No newline at end of file +var _0xe0d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','update','delete','multer','util','path','express','Router','fs-extra'];(function(_0x1d2fb7,_0x46f357){var _0x4fadd9=function(_0x54b557){while(--_0x54b557){_0x1d2fb7['push'](_0x1d2fb7['shift']());}};_0x4fadd9(++_0x46f357);}(_0xe0d4,0x1e0));var _0x4e0d=function(_0x164e59,_0x269425){_0x164e59=_0x164e59-0x0;var _0x405ed2=_0xe0d4[_0x164e59];return _0x405ed2;};'use strict';var multer=require(_0x4e0d('0x0'));var util=require(_0x4e0d('0x1'));var path=require(_0x4e0d('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e0d('0x3'));var router=express[_0x4e0d('0x4')]();var fs_extra=require(_0x4e0d('0x5'));var auth=require(_0x4e0d('0x6'));var interaction=require(_0x4e0d('0x7'));var config=require(_0x4e0d('0x8'));var controller=require(_0x4e0d('0x9'));router[_0x4e0d('0xa')]('/',auth[_0x4e0d('0xb')](),controller['index']);router[_0x4e0d('0xa')](_0x4e0d('0xc'),auth[_0x4e0d('0xb')](),controller[_0x4e0d('0xd')]);router[_0x4e0d('0xe')]('/',auth[_0x4e0d('0xb')](),controller[_0x4e0d('0xf')]);router['put']('/:id',auth[_0x4e0d('0xb')](),controller[_0x4e0d('0x10')]);router[_0x4e0d('0x11')](_0x4e0d('0xc'),auth[_0x4e0d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7557e47..2e2fdde 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 _0xdeec=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x20e277,_0x1c59f1){var _0x34d0e1=function(_0x143fb7){while(--_0x143fb7){_0x20e277['push'](_0x20e277['shift']());}};_0x34d0e1(++_0x1c59f1);}(_0xdeec,0x146));var _0xcdee=function(_0x496624,_0x124404){_0x496624=_0x496624-0x0;var _0x2e6357=_0xdeec[_0x496624];return _0x2e6357;};'use strict';var Sequelize=require(_0xcdee('0x0'));module[_0xcdee('0x1')]={'name':{'type':Sequelize[_0xcdee('0x2')],'unique':_0xcdee('0x3')},'description':{'type':Sequelize[_0xcdee('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xcdee('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ef3=['sequelize','STRING','name','BOOLEAN'];(function(_0x678dda,_0x4bd7a9){var _0x430464=function(_0x1da5b1){while(--_0x1da5b1){_0x678dda['push'](_0x678dda['shift']());}};_0x430464(++_0x4bd7a9);}(_0x7ef3,0x178));var _0x37ef=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x7ef3[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require(_0x37ef('0x0'));module['exports']={'name':{'type':Sequelize[_0x37ef('0x1')],'unique':_0x37ef('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x37ef('0x3')],'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 08a7e3a..9284609 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 _0x8cd8=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','find','create','readFileSync','join','root','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','Reload','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/environment','../../mysqldb','jayson/promise','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','Contexts','UserProfileResource','destroy','end','stack','send','index','map','VoiceContext','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x8cd8,0xfa));var _0x88cd=function(_0x304411,_0x2abbe3){_0x304411=_0x304411-0x0;var _0x35228d=_0x8cd8[_0x304411];return _0x35228d;};'use strict';var emlformat=require(_0x88cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88cd('0x1'));var jsonpatch=require(_0x88cd('0x2'));var rp=require(_0x88cd('0x3'));var moment=require('moment');var BPromise=require(_0x88cd('0x4'));var Mustache=require(_0x88cd('0x5'));var util=require(_0x88cd('0x6'));var path=require('path');var sox=require(_0x88cd('0x7'));var csv=require('to-csv');var ejs=require(_0x88cd('0x8'));var fs=require('fs');var fs_extra=require(_0x88cd('0x9'));var _=require(_0x88cd('0xa'));var squel=require(_0x88cd('0xb'));var crypto=require(_0x88cd('0xc'));var jsforce=require(_0x88cd('0xd'));var deskjs=require(_0x88cd('0xe'));var toCsv=require(_0x88cd('0xf'));var querystring=require(_0x88cd('0x10'));var Papa=require(_0x88cd('0x11'));var Redis=require(_0x88cd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x88cd('0x13'));var as=require(_0x88cd('0x14'));var hardwareService=require(_0x88cd('0x15'));var logger=require(_0x88cd('0x16'))(_0x88cd('0x17'));var utils=require('../../config/utils');var config=require(_0x88cd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x88cd('0x19'))['db'];var jayson=require(_0x88cd('0x1a'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16eae1,_0x516c3d,_0x206ff8,_0x105736){return new BPromise(function(_0x18fb8a,_0x17669f){var _0x5a033e=_0x105736||client;return _0x5a033e['request'](_0x16eae1,_0x206ff8)['then'](function(_0x103ca7){logger[_0x88cd('0x1b')](_0x88cd('0x1c'),_0x516c3d,_0x88cd('0x1d'));logger[_0x88cd('0x1e')](_0x88cd('0x1f'),_0x516c3d,_0x88cd('0x1d'),JSON[_0x88cd('0x20')](_0x103ca7));if(_0x103ca7[_0x88cd('0x21')]){if(_0x103ca7[_0x88cd('0x21')][_0x88cd('0x22')]===0x1f4){logger['error'](_0x88cd('0x1c'),_0x516c3d,_0x103ca7[_0x88cd('0x21')]['message']);return _0x17669f(_0x103ca7[_0x88cd('0x21')][_0x88cd('0x23')]);}logger[_0x88cd('0x21')]('VoiceContext,\x20%s,\x20%s',_0x516c3d,_0x103ca7['error'][_0x88cd('0x23')]);return _0x18fb8a(_0x103ca7['error'][_0x88cd('0x23')]);}else{logger[_0x88cd('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x516c3d,'request\x20sent');_0x18fb8a(_0x103ca7[_0x88cd('0x24')]['message']);}})['catch'](function(_0x3b3a95){logger['error'](_0x88cd('0x1c'),_0x516c3d,_0x3b3a95);_0x17669f(_0x3b3a95);});});}function respondWithStatusCode(_0x555e8a,_0xbe2841){_0xbe2841=_0xbe2841||0xcc;return function(_0x5234c7){if(_0x5234c7){return _0x555e8a[_0x88cd('0x25')](_0xbe2841);}return _0x555e8a[_0x88cd('0x26')](_0xbe2841)['end']();};}function respondWithResult(_0x3b4601,_0x13cb98){_0x13cb98=_0x13cb98||0xc8;return function(_0x12ebc2){if(_0x12ebc2){return _0x3b4601['status'](_0x13cb98)[_0x88cd('0x27')](_0x12ebc2);}};}function respondWithFilteredResult(_0x21c489,_0x3376e8){return function(_0x29c405){if(_0x29c405){var _0x452e2c=typeof _0x3376e8[_0x88cd('0x28')]==='undefined'&&typeof _0x3376e8[_0x88cd('0x29')]===_0x88cd('0x2a');var _0x5b68cb=_0x29c405[_0x88cd('0x2b')];var _0x38d794=_0x452e2c?0x0:_0x3376e8[_0x88cd('0x28')];var _0x3fc32a=_0x452e2c?_0x29c405['count']:_0x3376e8[_0x88cd('0x28')]+_0x3376e8[_0x88cd('0x29')];var _0x2fee57;if(_0x3fc32a>=_0x5b68cb){_0x3fc32a=_0x5b68cb;_0x2fee57=0xc8;}else{_0x2fee57=0xce;}_0x21c489['status'](_0x2fee57);return _0x21c489[_0x88cd('0x2c')]('Content-Range',_0x38d794+'-'+_0x3fc32a+'/'+_0x5b68cb)[_0x88cd('0x27')](_0x29c405);}return null;};}function patchUpdates(_0xe7f72d){return function(_0x7205f2){try{jsonpatch[_0x88cd('0x2d')](_0x7205f2,_0xe7f72d,!![]);}catch(_0xc221cb){return BPromise[_0x88cd('0x2e')](_0xc221cb);}return _0x7205f2[_0x88cd('0x2f')]();};}function saveUpdates(_0x33ea6f,_0xf8e10f){return function(_0x20a8f5){if(_0x20a8f5){return _0x20a8f5[_0x88cd('0x30')](_0x33ea6f)[_0x88cd('0x31')](function(_0x1d9d2c){return _0x1d9d2c;});}return null;};}function removeEntity(_0x5335b3,_0x272959){return function(_0x57dfb7){if(_0x57dfb7){return _0x57dfb7['destroy']()[_0x88cd('0x31')](function(){var _0x34b905=_0x57dfb7['get']({'plain':!![]});var _0x3f78ef=_0x88cd('0x32');return db[_0x88cd('0x33')][_0x88cd('0x34')]({'where':{'type':_0x3f78ef,'resourceId':_0x34b905['id']}})[_0x88cd('0x31')](function(){return _0x57dfb7;});})[_0x88cd('0x31')](function(){_0x5335b3[_0x88cd('0x26')](0xcc)[_0x88cd('0x35')]();});}};}function handleEntityNotFound(_0x5dc19f,_0x3ecd64){return function(_0xa01bdf){if(!_0xa01bdf){_0x5dc19f[_0x88cd('0x25')](0x194);}return _0xa01bdf;};}function handleError(_0x4afee0,_0xd883b){_0xd883b=_0xd883b||0x1f4;return function(_0x4f6cba){logger['error'](_0x4f6cba[_0x88cd('0x36')]);if(_0x4f6cba['name']){delete _0x4f6cba['name'];}_0x4afee0[_0x88cd('0x26')](_0xd883b)[_0x88cd('0x37')](_0x4f6cba);};}exports[_0x88cd('0x38')]=function(_0x347ce4,_0x87cdc5){var _0x1304d3={},_0x44d6e7={},_0x1dbed5={'count':0x0,'rows':[]};var _0x2027df=_[_0x88cd('0x39')](db[_0x88cd('0x3a')][_0x88cd('0x3b')],function(_0x1d13e5){return{'name':_0x1d13e5[_0x88cd('0x3c')],'type':_0x1d13e5['type'][_0x88cd('0x3d')]};});_0x44d6e7[_0x88cd('0x3e')]=_[_0x88cd('0x39')](_0x2027df,_0x88cd('0x3f'));_0x44d6e7[_0x88cd('0x40')]=_[_0x88cd('0x41')](_0x347ce4[_0x88cd('0x40')]);_0x44d6e7[_0x88cd('0x42')]=_[_0x88cd('0x43')](_0x44d6e7[_0x88cd('0x3e')],_0x44d6e7[_0x88cd('0x40')]);_0x1304d3[_0x88cd('0x44')]=_[_0x88cd('0x43')](_0x44d6e7[_0x88cd('0x3e')],qs[_0x88cd('0x45')](_0x347ce4[_0x88cd('0x40')]['fields']));_0x1304d3[_0x88cd('0x44')]=_0x1304d3[_0x88cd('0x44')][_0x88cd('0x46')]?_0x1304d3['attributes']:_0x44d6e7[_0x88cd('0x3e')];if(!_0x347ce4[_0x88cd('0x40')][_0x88cd('0x47')](_0x88cd('0x48'))){_0x1304d3[_0x88cd('0x29')]=qs['limit'](_0x347ce4[_0x88cd('0x40')][_0x88cd('0x29')]);_0x1304d3[_0x88cd('0x28')]=qs[_0x88cd('0x28')](_0x347ce4[_0x88cd('0x40')]['offset']);}_0x1304d3[_0x88cd('0x49')]=qs[_0x88cd('0x4a')](_0x347ce4[_0x88cd('0x40')]['sort']);_0x1304d3[_0x88cd('0x4b')]=qs[_0x88cd('0x42')](_[_0x88cd('0x4c')](_0x347ce4[_0x88cd('0x40')],_0x44d6e7['filters']),_0x2027df);if(_0x347ce4[_0x88cd('0x40')][_0x88cd('0x4d')]){_0x1304d3['where']=_[_0x88cd('0x4e')](_0x1304d3[_0x88cd('0x4b')],{'$or':_['map'](_0x2027df,function(_0x28333a){if(_0x28333a[_0x88cd('0x4f')]!==_0x88cd('0x50')){var _0x211477={};_0x211477[_0x28333a[_0x88cd('0x3f')]]={'$like':'%'+_0x347ce4[_0x88cd('0x40')][_0x88cd('0x4d')]+'%'};return _0x211477;}})});}_0x1304d3=_['merge']({},_0x1304d3,_0x347ce4[_0x88cd('0x51')]);var _0x1560d8={'where':_0x1304d3[_0x88cd('0x4b')]};return db[_0x88cd('0x3a')][_0x88cd('0x2b')](_0x1560d8)[_0x88cd('0x31')](function(_0x373c36){_0x1dbed5[_0x88cd('0x2b')]=_0x373c36;if(_0x347ce4[_0x88cd('0x40')][_0x88cd('0x52')]){_0x1304d3['include']=[{'all':!![]}];}return db['VoiceContext'][_0x88cd('0x53')](_0x1304d3);})[_0x88cd('0x31')](function(_0x458a62){_0x1dbed5[_0x88cd('0x54')]=_0x458a62;return _0x1dbed5;})['then'](respondWithFilteredResult(_0x87cdc5,_0x1304d3))[_0x88cd('0x55')](handleError(_0x87cdc5,null));};exports[_0x88cd('0x56')]=function(_0x367175,_0x86da01){var _0x3735b6={'raw':![],'where':{'id':_0x367175['params']['id']}},_0x2d0d80={};_0x2d0d80[_0x88cd('0x3e')]=_['keys'](db[_0x88cd('0x3a')]['rawAttributes']);_0x2d0d80[_0x88cd('0x40')]=_[_0x88cd('0x41')](_0x367175[_0x88cd('0x40')]);_0x2d0d80[_0x88cd('0x42')]=_[_0x88cd('0x43')](_0x2d0d80[_0x88cd('0x3e')],_0x2d0d80[_0x88cd('0x40')]);_0x3735b6['attributes']=_[_0x88cd('0x43')](_0x2d0d80[_0x88cd('0x3e')],qs['fields'](_0x367175['query'][_0x88cd('0x45')]));_0x3735b6[_0x88cd('0x44')]=_0x3735b6[_0x88cd('0x44')][_0x88cd('0x46')]?_0x3735b6[_0x88cd('0x44')]:_0x2d0d80['model'];if(_0x367175['query']['includeAll']){_0x3735b6['include']=[{'all':!![]}];}_0x3735b6=_['merge']({},_0x3735b6,_0x367175[_0x88cd('0x51')]);return db[_0x88cd('0x3a')][_0x88cd('0x57')](_0x3735b6)[_0x88cd('0x31')](handleEntityNotFound(_0x86da01,null))[_0x88cd('0x31')](respondWithResult(_0x86da01,null))[_0x88cd('0x55')](handleError(_0x86da01,null));};exports[_0x88cd('0x58')]=function(_0x39db02,_0x5af35c,_0x439b80){var _0x30c857;return db[_0x88cd('0x3a')][_0x88cd('0x58')](_0x39db02['body'],{'raw':!![]})[_0x88cd('0x31')](function(_0x5a55d9){_0x30c857=_0x5a55d9;return db[_0x88cd('0x3a')][_0x88cd('0x53')]({'raw':!![]});})[_0x88cd('0x31')](function(_0x9cfa17){var _0x22e95e=fs[_0x88cd('0x59')](path[_0x88cd('0x5a')](config[_0x88cd('0x5b')],_0x88cd('0x5c')),'utf8');var _0x1baaa0=ejs[_0x88cd('0x5d')](_0x22e95e,{'contexts':_0x9cfa17||[]});fs['writeFileSync'](_0x88cd('0x5e'),_0x1baaa0);})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x88cd('0x5f')});})['then'](function(){var _0x46d125=_0x39db02['user'][_0x88cd('0x60')]({'plain':!![]});if(!_0x46d125)throw new Error(_0x88cd('0x61'));if(_0x46d125[_0x88cd('0x62')]===_0x88cd('0x63')){var _0x2cfb43=_0x30c857[_0x88cd('0x60')]({'plain':!![]});return db[_0x88cd('0x64')][_0x88cd('0x57')]({'where':{'name':_0x88cd('0x32'),'userProfileId':_0x46d125['userProfileId']},'raw':!![]})[_0x88cd('0x31')](function(_0x3bee11){if(_0x3bee11&&_0x3bee11[_0x88cd('0x65')]===0x0){return db[_0x88cd('0x33')][_0x88cd('0x58')]({'name':_0x2cfb43[_0x88cd('0x3f')],'resourceId':_0x2cfb43['id'],'type':_0x3bee11[_0x88cd('0x3f')],'sectionId':_0x3bee11['id']},{})['then'](function(){return _0x30c857;});}else{return _0x30c857;}})[_0x88cd('0x55')](function(_0x57b2a2){logger['error'](_0x88cd('0x66'),_0x57b2a2);throw _0x57b2a2;});}return _0x30c857;})[_0x88cd('0x31')](respondWithResult(_0x5af35c,0xc9))[_0x88cd('0x55')](handleError(_0x5af35c,null));};exports[_0x88cd('0x30')]=function(_0x16c7a4,_0x20fba8,_0x35d14c){var _0x2a2543;return db[_0x88cd('0x3a')][_0x88cd('0x57')]({'where':{'id':_0x16c7a4[_0x88cd('0x67')]['id']}})[_0x88cd('0x31')](handleEntityNotFound(_0x20fba8,null))[_0x88cd('0x31')](saveUpdates(_0x16c7a4['body'],null))['then'](function(_0x21687d){if(_0x21687d){_0x2a2543=_0x21687d;return db[_0x88cd('0x3a')][_0x88cd('0x53')]({'raw':!![]});}})[_0x88cd('0x31')](function(_0x59398d){var _0x1c45fb=fs[_0x88cd('0x59')](path[_0x88cd('0x5a')](config[_0x88cd('0x5b')],_0x88cd('0x5c')),_0x88cd('0x68'));var _0x12b4d6=ejs[_0x88cd('0x5d')](_0x1c45fb,{'contexts':_0x59398d||[]});fs['writeFileSync'](_0x88cd('0x5e'),_0x12b4d6);})[_0x88cd('0x31')](function(){return respondWithRpcPromise(_0x88cd('0x69'),'update',{'module':_0x88cd('0x5f')});})['then'](function(){return _0x2a2543;})['then'](respondWithResult(_0x20fba8,null))[_0x88cd('0x55')](handleError(_0x20fba8,null));};exports[_0x88cd('0x34')]=function(_0x438609,_0x176d79,_0x2131ca){var _0x5a82fe;return db[_0x88cd('0x3a')][_0x88cd('0x57')]({'where':{'id':_0x438609[_0x88cd('0x67')]['id']}})[_0x88cd('0x31')](handleEntityNotFound(_0x176d79,null))[_0x88cd('0x31')](removeEntity(_0x176d79,null))['then'](function(){return db[_0x88cd('0x3a')][_0x88cd('0x53')]({'raw':!![]});})[_0x88cd('0x31')](function(_0x5b7d83){var _0x503240=fs[_0x88cd('0x59')](path['join'](config[_0x88cd('0x5b')],_0x88cd('0x5c')),_0x88cd('0x68'));var _0x5d30d8=ejs[_0x88cd('0x5d')](_0x503240,{'contexts':_0x5b7d83});fs['writeFileSync'](_0x88cd('0x5e'),_0x5d30d8);return respondWithRpcPromise(_0x88cd('0x69'),_0x88cd('0x34'),{'module':_0x88cd('0x5f')});})[_0x88cd('0x55')](handleError(_0x176d79,null));}; \ No newline at end of file +var _0x395f=['fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','writeFileSync','Reload','chan_sip.so','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x16ca4a,_0x1ed3e7){var _0x48f844=function(_0x161e91){while(--_0x161e91){_0x16ca4a['push'](_0x16ca4a['shift']());}};_0x48f844(++_0x1ed3e7);}(_0x395f,0xc8));var _0xf395=function(_0x2d4317,_0x33b780){_0x2d4317=_0x2d4317-0x0;var _0x537d80=_0x395f[_0x2d4317];return _0x537d80;};'use strict';var emlformat=require(_0xf395('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf395('0x1'));var jsonpatch=require(_0xf395('0x2'));var rp=require(_0xf395('0x3'));var moment=require(_0xf395('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf395('0x5'));var util=require(_0xf395('0x6'));var path=require(_0xf395('0x7'));var sox=require(_0xf395('0x8'));var csv=require('to-csv');var ejs=require(_0xf395('0x9'));var fs=require('fs');var fs_extra=require(_0xf395('0xa'));var _=require(_0xf395('0xb'));var squel=require('squel');var crypto=require(_0xf395('0xc'));var jsforce=require(_0xf395('0xd'));var deskjs=require(_0xf395('0xe'));var toCsv=require(_0xf395('0xf'));var querystring=require(_0xf395('0x10'));var Papa=require('papaparse');var Redis=require(_0xf395('0x11'));var authService=require(_0xf395('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf395('0x13'));var logger=require(_0xf395('0x14'))(_0xf395('0x15'));var utils=require(_0xf395('0x16'));var config=require(_0xf395('0x17'));var licenseUtil=require(_0xf395('0x18'));var db=require(_0xf395('0x19'))['db'];var jayson=require(_0xf395('0x1a'));var client=jayson['client'][_0xf395('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf44db1,_0xff909,_0x4b1fa1,_0x38968a){return new BPromise(function(_0x5b13ae,_0x199090){var _0x570a34=_0x38968a||client;return _0x570a34[_0xf395('0x1c')](_0xf44db1,_0x4b1fa1)[_0xf395('0x1d')](function(_0x5d1daf){logger[_0xf395('0x1e')](_0xf395('0x1f'),_0xff909,_0xf395('0x20'));logger[_0xf395('0x21')](_0xf395('0x22'),_0xff909,'request\x20sent',JSON['stringify'](_0x5d1daf));if(_0x5d1daf[_0xf395('0x23')]){if(_0x5d1daf[_0xf395('0x23')][_0xf395('0x24')]===0x1f4){logger[_0xf395('0x23')](_0xf395('0x1f'),_0xff909,_0x5d1daf[_0xf395('0x23')][_0xf395('0x25')]);return _0x199090(_0x5d1daf[_0xf395('0x23')]['message']);}logger['error'](_0xf395('0x1f'),_0xff909,_0x5d1daf[_0xf395('0x23')]['message']);return _0x5b13ae(_0x5d1daf[_0xf395('0x23')][_0xf395('0x25')]);}else{logger[_0xf395('0x1e')](_0xf395('0x1f'),_0xff909,_0xf395('0x20'));_0x5b13ae(_0x5d1daf[_0xf395('0x26')][_0xf395('0x25')]);}})[_0xf395('0x27')](function(_0x2bcf18){logger[_0xf395('0x23')](_0xf395('0x1f'),_0xff909,_0x2bcf18);_0x199090(_0x2bcf18);});});}function respondWithStatusCode(_0x5deaa6,_0x526e89){_0x526e89=_0x526e89||0xcc;return function(_0x42e534){if(_0x42e534){return _0x5deaa6['sendStatus'](_0x526e89);}return _0x5deaa6[_0xf395('0x28')](_0x526e89)[_0xf395('0x29')]();};}function respondWithResult(_0x2cd95d,_0x233d54){_0x233d54=_0x233d54||0xc8;return function(_0x2432aa){if(_0x2432aa){return _0x2cd95d['status'](_0x233d54)[_0xf395('0x2a')](_0x2432aa);}};}function respondWithFilteredResult(_0x86b24f,_0x5a33fd){return function(_0x5ef08f){if(_0x5ef08f){var _0x542d63=typeof _0x5a33fd['offset']==='undefined'&&typeof _0x5a33fd[_0xf395('0x2b')]===_0xf395('0x2c');var _0x2368a3=_0x5ef08f['count'];var _0x253e49=_0x542d63?0x0:_0x5a33fd[_0xf395('0x2d')];var _0xfee329=_0x542d63?_0x5ef08f[_0xf395('0x2e')]:_0x5a33fd['offset']+_0x5a33fd[_0xf395('0x2b')];var _0x884d43;if(_0xfee329>=_0x2368a3){_0xfee329=_0x2368a3;_0x884d43=0xc8;}else{_0x884d43=0xce;}_0x86b24f[_0xf395('0x28')](_0x884d43);return _0x86b24f[_0xf395('0x2f')](_0xf395('0x30'),_0x253e49+'-'+_0xfee329+'/'+_0x2368a3)[_0xf395('0x2a')](_0x5ef08f);}return null;};}function patchUpdates(_0x409c60){return function(_0x2c683f){try{jsonpatch[_0xf395('0x31')](_0x2c683f,_0x409c60,!![]);}catch(_0x3c286c){return BPromise[_0xf395('0x32')](_0x3c286c);}return _0x2c683f['save']();};}function saveUpdates(_0x94f7cf,_0x1915ba){return function(_0x15f219){if(_0x15f219){return _0x15f219['update'](_0x94f7cf)['then'](function(_0x54f51c){return _0x54f51c;});}return null;};}function removeEntity(_0x5dc43a,_0x1f230d){return function(_0x505d11){if(_0x505d11){return _0x505d11[_0xf395('0x33')]()[_0xf395('0x1d')](function(){var _0x58f7f2=_0x505d11[_0xf395('0x34')]({'plain':!![]});var _0x359686=_0xf395('0x35');return db[_0xf395('0x36')][_0xf395('0x33')]({'where':{'type':_0x359686,'resourceId':_0x58f7f2['id']}})[_0xf395('0x1d')](function(){return _0x505d11;});})[_0xf395('0x1d')](function(){_0x5dc43a[_0xf395('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4186,_0x4e1fb5){return function(_0x2457d6){if(!_0x2457d6){_0x2a4186[_0xf395('0x37')](0x194);}return _0x2457d6;};}function handleError(_0x387241,_0x57c239){_0x57c239=_0x57c239||0x1f4;return function(_0x18e4ad){logger['error'](_0x18e4ad[_0xf395('0x38')]);if(_0x18e4ad[_0xf395('0x39')]){delete _0x18e4ad[_0xf395('0x39')];}_0x387241[_0xf395('0x28')](_0x57c239)[_0xf395('0x3a')](_0x18e4ad);};}exports[_0xf395('0x3b')]=function(_0x257a64,_0x2cec29){var _0x16c2e9={},_0x311d45={},_0x4430ba={'count':0x0,'rows':[]};var _0x151669=_[_0xf395('0x3c')](db[_0xf395('0x3d')][_0xf395('0x3e')],function(_0x5eb2cd){return{'name':_0x5eb2cd[_0xf395('0x3f')],'type':_0x5eb2cd[_0xf395('0x40')][_0xf395('0x41')]};});_0x311d45['model']=_[_0xf395('0x3c')](_0x151669,_0xf395('0x39'));_0x311d45['query']=_[_0xf395('0x42')](_0x257a64[_0xf395('0x43')]);_0x311d45[_0xf395('0x44')]=_[_0xf395('0x45')](_0x311d45[_0xf395('0x46')],_0x311d45[_0xf395('0x43')]);_0x16c2e9['attributes']=_[_0xf395('0x45')](_0x311d45[_0xf395('0x46')],qs[_0xf395('0x47')](_0x257a64[_0xf395('0x43')][_0xf395('0x47')]));_0x16c2e9[_0xf395('0x48')]=_0x16c2e9[_0xf395('0x48')][_0xf395('0x49')]?_0x16c2e9['attributes']:_0x311d45[_0xf395('0x46')];if(!_0x257a64[_0xf395('0x43')][_0xf395('0x4a')]('nolimit')){_0x16c2e9[_0xf395('0x2b')]=qs[_0xf395('0x2b')](_0x257a64[_0xf395('0x43')]['limit']);_0x16c2e9[_0xf395('0x2d')]=qs[_0xf395('0x2d')](_0x257a64[_0xf395('0x43')][_0xf395('0x2d')]);}_0x16c2e9['order']=qs[_0xf395('0x4b')](_0x257a64[_0xf395('0x43')][_0xf395('0x4b')]);_0x16c2e9[_0xf395('0x4c')]=qs['filters'](_[_0xf395('0x4d')](_0x257a64['query'],_0x311d45[_0xf395('0x44')]),_0x151669);if(_0x257a64[_0xf395('0x43')][_0xf395('0x4e')]){_0x16c2e9[_0xf395('0x4c')]=_[_0xf395('0x4f')](_0x16c2e9[_0xf395('0x4c')],{'$or':_[_0xf395('0x3c')](_0x151669,function(_0x702ccc){if(_0x702ccc[_0xf395('0x40')]!==_0xf395('0x50')){var _0x4f5a7d={};_0x4f5a7d[_0x702ccc['name']]={'$like':'%'+_0x257a64[_0xf395('0x43')]['filter']+'%'};return _0x4f5a7d;}})});}_0x16c2e9=_['merge']({},_0x16c2e9,_0x257a64['options']);var _0x583c2f={'where':_0x16c2e9[_0xf395('0x4c')]};return db[_0xf395('0x3d')]['count'](_0x583c2f)[_0xf395('0x1d')](function(_0xeea83a){_0x4430ba['count']=_0xeea83a;if(_0x257a64[_0xf395('0x43')][_0xf395('0x51')]){_0x16c2e9[_0xf395('0x52')]=[{'all':!![]}];}return db['VoiceContext'][_0xf395('0x53')](_0x16c2e9);})['then'](function(_0x444b6a){_0x4430ba['rows']=_0x444b6a;return _0x4430ba;})[_0xf395('0x1d')](respondWithFilteredResult(_0x2cec29,_0x16c2e9))['catch'](handleError(_0x2cec29,null));};exports[_0xf395('0x54')]=function(_0x2716be,_0x8fed91){var _0x40194e={'raw':![],'where':{'id':_0x2716be[_0xf395('0x55')]['id']}},_0x5435d6={};_0x5435d6[_0xf395('0x46')]=_['keys'](db['VoiceContext'][_0xf395('0x3e')]);_0x5435d6['query']=_[_0xf395('0x42')](_0x2716be['query']);_0x5435d6['filters']=_[_0xf395('0x45')](_0x5435d6[_0xf395('0x46')],_0x5435d6[_0xf395('0x43')]);_0x40194e[_0xf395('0x48')]=_[_0xf395('0x45')](_0x5435d6[_0xf395('0x46')],qs[_0xf395('0x47')](_0x2716be[_0xf395('0x43')][_0xf395('0x47')]));_0x40194e[_0xf395('0x48')]=_0x40194e['attributes']['length']?_0x40194e['attributes']:_0x5435d6[_0xf395('0x46')];if(_0x2716be[_0xf395('0x43')][_0xf395('0x51')]){_0x40194e[_0xf395('0x52')]=[{'all':!![]}];}_0x40194e=_[_0xf395('0x4f')]({},_0x40194e,_0x2716be['options']);return db[_0xf395('0x3d')][_0xf395('0x56')](_0x40194e)[_0xf395('0x1d')](handleEntityNotFound(_0x8fed91,null))['then'](respondWithResult(_0x8fed91,null))[_0xf395('0x27')](handleError(_0x8fed91,null));};exports[_0xf395('0x57')]=function(_0xa51317,_0x390ab5,_0x56351c){var _0x525822;return db['VoiceContext'][_0xf395('0x57')](_0xa51317[_0xf395('0x58')],{'raw':!![]})['then'](function(_0x342335){_0x525822=_0x342335;return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x2a9b2d){var _0x35e734=fs[_0xf395('0x59')](path[_0xf395('0x5a')](config[_0xf395('0x5b')],_0xf395('0x5c')),_0xf395('0x5d'));var _0x588e20=ejs['render'](_0x35e734,{'contexts':_0x2a9b2d||[]});fs['writeFileSync'](_0xf395('0x5e'),_0x588e20);})[_0xf395('0x1d')](function(){return respondWithRpcPromise('Reload',_0xf395('0x57'),{'module':'chan_sip.so'});})[_0xf395('0x1d')](function(){var _0x341789=_0xa51317[_0xf395('0x5f')]['get']({'plain':!![]});if(!_0x341789)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x341789[_0xf395('0x60')]==='user'){var _0xc328ec=_0x525822[_0xf395('0x34')]({'plain':!![]});return db[_0xf395('0x61')][_0xf395('0x56')]({'where':{'name':_0xf395('0x35'),'userProfileId':_0x341789[_0xf395('0x62')]},'raw':!![]})['then'](function(_0x4d0062){if(_0x4d0062&&_0x4d0062[_0xf395('0x63')]===0x0){return db[_0xf395('0x36')]['create']({'name':_0xc328ec[_0xf395('0x39')],'resourceId':_0xc328ec['id'],'type':_0x4d0062[_0xf395('0x39')],'sectionId':_0x4d0062['id']},{})[_0xf395('0x1d')](function(){return _0x525822;});}else{return _0x525822;}})['catch'](function(_0x1c4ebd){logger['error'](_0xf395('0x64'),_0x1c4ebd);throw _0x1c4ebd;});}return _0x525822;})['then'](respondWithResult(_0x390ab5,0xc9))[_0xf395('0x27')](handleError(_0x390ab5,null));};exports[_0xf395('0x65')]=function(_0x42ec1b,_0x1ecc7a,_0x709f5b){var _0x306398;return db[_0xf395('0x3d')]['find']({'where':{'id':_0x42ec1b[_0xf395('0x55')]['id']}})[_0xf395('0x1d')](handleEntityNotFound(_0x1ecc7a,null))[_0xf395('0x1d')](saveUpdates(_0x42ec1b[_0xf395('0x58')],null))[_0xf395('0x1d')](function(_0x50b92a){if(_0x50b92a){_0x306398=_0x50b92a;return db[_0xf395('0x3d')][_0xf395('0x53')]({'raw':!![]});}})[_0xf395('0x1d')](function(_0x3aeaec){var _0x507777=fs['readFileSync'](path[_0xf395('0x5a')](config[_0xf395('0x5b')],_0xf395('0x5c')),'utf8');var _0x207027=ejs['render'](_0x507777,{'contexts':_0x3aeaec||[]});fs[_0xf395('0x66')](_0xf395('0x5e'),_0x207027);})[_0xf395('0x1d')](function(){return respondWithRpcPromise(_0xf395('0x67'),_0xf395('0x65'),{'module':_0xf395('0x68')});})['then'](function(){return _0x306398;})[_0xf395('0x1d')](respondWithResult(_0x1ecc7a,null))['catch'](handleError(_0x1ecc7a,null));};exports[_0xf395('0x33')]=function(_0x17851a,_0x2ee246,_0x125e81){var _0x408030;return db[_0xf395('0x3d')]['find']({'where':{'id':_0x17851a[_0xf395('0x55')]['id']}})[_0xf395('0x1d')](handleEntityNotFound(_0x2ee246,null))['then'](removeEntity(_0x2ee246,null))[_0xf395('0x1d')](function(){return db[_0xf395('0x3d')][_0xf395('0x53')]({'raw':!![]});})['then'](function(_0x325942){var _0x20c9de=fs[_0xf395('0x59')](path[_0xf395('0x5a')](config['root'],_0xf395('0x5c')),_0xf395('0x5d'));var _0x1d6ded=ejs['render'](_0x20c9de,{'contexts':_0x325942});fs[_0xf395('0x66')](_0xf395('0x5e'),_0x1d6ded);return respondWithRpcPromise(_0xf395('0x67'),_0xf395('0x33'),{'module':_0xf395('0x68')});})[_0xf395('0x27')](handleError(_0x2ee246,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index a8c75b7..072e35e 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 _0xadf9=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash'];(function(_0x50f1aa,_0x498596){var _0x48a2f4=function(_0x525ad6){while(--_0x525ad6){_0x50f1aa['push'](_0x50f1aa['shift']());}};_0x48a2f4(++_0x498596);}(_0xadf9,0xa4));var _0x9adf=function(_0x189a72,_0x4ac342){_0x189a72=_0x189a72-0x0;var _0x2b457a=_0xadf9[_0x189a72];return _0x2b457a;};'use strict';var _=require(_0x9adf('0x0'));var util=require(_0x9adf('0x1'));var logger=require(_0x9adf('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9adf('0x3'));var rp=require(_0x9adf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9adf('0x5'));var config=require(_0x9adf('0x6'));var attributes=require(_0x9adf('0x7'));module['exports']=function(_0x7e7e36,_0xd7b808){return _0x7e7e36[_0x9adf('0x8')](_0x9adf('0x9'),attributes,{'tableName':_0x9adf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x117e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','VoiceContext','voice_contexts','lodash'];(function(_0x78ac8e,_0x34f635){var _0x242d93=function(_0x1660b0){while(--_0x1660b0){_0x78ac8e['push'](_0x78ac8e['shift']());}};_0x242d93(++_0x34f635);}(_0x117e,0xc5));var _0xe117=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x117e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe117('0x0'));var util=require(_0xe117('0x1'));var logger=require(_0xe117('0x2'))(_0xe117('0x3'));var moment=require('moment');var BPromise=require(_0xe117('0x4'));var rp=require(_0xe117('0x5'));var fs=require('fs');var path=require(_0xe117('0x6'));var rimraf=require(_0xe117('0x7'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module['exports']=function(_0x2eb08d,_0x80a325){return _0x2eb08d[_0xe117('0x8')](_0xe117('0x9'),attributes,{'tableName':_0xe117('0xa'),'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 32a301c..ada5853 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 _0x8580=['../../config/environment','client','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x3c32e8,_0x1a9eca){var _0x38ae06=function(_0x9d470a){while(--_0x9d470a){_0x3c32e8['push'](_0x3c32e8['shift']());}};_0x38ae06(++_0x1a9eca);}(_0x8580,0x1c7));var _0x0858=function(_0x2e28b4,_0x35042d){_0x2e28b4=_0x2e28b4-0x0;var _0xc722eb=_0x8580[_0x2e28b4];return _0xc722eb;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3515b4,_0x38e3f7,_0x4981a7){return new BPromise(function(_0x9c611c,_0x3ae92b){return client[_0x0858('0x8')](_0x3515b4,_0x4981a7)['then'](function(_0x4ceffb){logger[_0x0858('0x9')]('VoiceContext,\x20%s,\x20%s',_0x38e3f7,_0x0858('0xa'));logger[_0x0858('0xb')](_0x0858('0xc'),_0x38e3f7,_0x0858('0xa'),JSON[_0x0858('0xd')](_0x4ceffb));if(_0x4ceffb[_0x0858('0xe')]){if(_0x4ceffb[_0x0858('0xe')][_0x0858('0xf')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x38e3f7,_0x4ceffb[_0x0858('0xe')]['message']);return _0x3ae92b(_0x4ceffb['error']['message']);}logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x4ceffb['error'][_0x0858('0x11')]);return _0x9c611c(_0x4ceffb[_0x0858('0xe')][_0x0858('0x11')]);}else{logger[_0x0858('0x9')](_0x0858('0x10'),_0x38e3f7,_0x0858('0xa'));_0x9c611c(_0x4ceffb[_0x0858('0x12')][_0x0858('0x11')]);}})[_0x0858('0x13')](function(_0x39e967){logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x39e967);_0x3ae92b(_0x39e967);});});} \ No newline at end of file +var _0x20df=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x361ab9,_0x54e6b9){var _0x51d018=function(_0x598c8a){while(--_0x598c8a){_0x361ab9['push'](_0x361ab9['shift']());}};_0x51d018(++_0x54e6b9);}(_0x20df,0x7c));var _0xf20d=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x20df[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var moment=require(_0xf20d('0x2'));var BPromise=require(_0xf20d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf20d('0x4'));var db=require(_0xf20d('0x5'))['db'];var utils=require(_0xf20d('0x6'));var logger=require(_0xf20d('0x7'))(_0xf20d('0x8'));var config=require('../../config/environment');var jayson=require(_0xf20d('0x9'));var client=jayson['client'][_0xf20d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41d0da,_0x53a7b5,_0x184c8d){return new BPromise(function(_0x5f0353,_0x4f36d1){return client['request'](_0x41d0da,_0x184c8d)[_0xf20d('0xb')](function(_0x22b427){logger[_0xf20d('0xc')](_0xf20d('0xd'),_0x53a7b5,'request\x20sent');logger[_0xf20d('0xe')](_0xf20d('0xf'),_0x53a7b5,_0xf20d('0x10'),JSON[_0xf20d('0x11')](_0x22b427));if(_0x22b427[_0xf20d('0x12')]){if(_0x22b427[_0xf20d('0x12')][_0xf20d('0x13')]===0x1f4){logger[_0xf20d('0x12')]('VoiceContext,\x20%s,\x20%s',_0x53a7b5,_0x22b427[_0xf20d('0x12')]['message']);return _0x4f36d1(_0x22b427[_0xf20d('0x12')][_0xf20d('0x14')]);}logger['error'](_0xf20d('0xd'),_0x53a7b5,_0x22b427[_0xf20d('0x12')][_0xf20d('0x14')]);return _0x5f0353(_0x22b427[_0xf20d('0x12')][_0xf20d('0x14')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x53a7b5,_0xf20d('0x10'));_0x5f0353(_0x22b427[_0xf20d('0x15')][_0xf20d('0x14')]);}})[_0xf20d('0x16')](function(_0x53c164){logger[_0xf20d('0x12')]('VoiceContext,\x20%s,\x20%s',_0x53a7b5,_0x53c164);_0x4f36d1(_0x53c164);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 74aaec6..56e1b9f 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 _0x5f42=['exports','multer','util','path','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','create','update'];(function(_0x124535,_0x4ad3e4){var _0x5ce2be=function(_0x5bd57d){while(--_0x5bd57d){_0x124535['push'](_0x124535['shift']());}};_0x5ce2be(++_0x4ad3e4);}(_0x5f42,0x10f));var _0x25f4=function(_0x3f70d5,_0x1dd533){_0x3f70d5=_0x3f70d5-0x0;var _0x5efc57=_0x5f42[_0x3f70d5];return _0x5efc57;};'use strict';var multer=require(_0x25f4('0x0'));var util=require(_0x25f4('0x1'));var path=require(_0x25f4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x25f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x25f4('0x4'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x25f4('0x5')]('/',auth[_0x25f4('0x6')](),controller['index']);router[_0x25f4('0x5')](_0x25f4('0x7'),auth[_0x25f4('0x6')](),controller[_0x25f4('0x8')]);router['get'](_0x25f4('0x9'),auth['isAuthenticated'](),controller[_0x25f4('0xa')]);router[_0x25f4('0xb')]('/',auth[_0x25f4('0x6')](),controller[_0x25f4('0xc')]);router['put'](_0x25f4('0x9'),auth[_0x25f4('0x6')](),controller[_0x25f4('0xd')]);router['delete']('/:id',auth[_0x25f4('0x6')](),controller['destroy']);module[_0x25f4('0xe')]=router; \ No newline at end of file +var _0xe617=['../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xe617,0x13f));var _0x7e61=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe617[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x7e61('0x0'));var util=require(_0x7e61('0x1'));var path=require('path');var timeout=require(_0x7e61('0x2'));var express=require('express');var router=express[_0x7e61('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7e61('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7e61('0x5'));var controller=require(_0x7e61('0x6'));router[_0x7e61('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e61('0x7')](_0x7e61('0x8'),auth[_0x7e61('0x9')](),controller[_0x7e61('0xa')]);router[_0x7e61('0x7')](_0x7e61('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7e61('0xc')]('/',auth[_0x7e61('0x9')](),controller[_0x7e61('0xd')]);router['put'](_0x7e61('0xb'),auth[_0x7e61('0x9')](),controller[_0x7e61('0xe')]);router[_0x7e61('0xf')](_0x7e61('0xb'),auth[_0x7e61('0x9')](),controller['destroy']);module[_0x7e61('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 184ee62..8115203 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 _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x57d077,_0x569ffe){var _0x26c2ea=function(_0x36b00b){while(--_0x36b00b){_0x57d077['push'](_0x57d077['shift']());}};_0x26c2ea(++_0x569ffe);}(_0x55ca,0x126));var _0xa55c=function(_0x252d7e,_0x20a71c){_0x252d7e=_0x252d7e-0x0;var _0x2afaba=_0x55ca[_0x252d7e];return _0x2afaba;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file +var _0xbec5=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x9fa8c3,_0x2e59b2){var _0x79b768=function(_0x39a132){while(--_0x39a132){_0x9fa8c3['push'](_0x9fa8c3['shift']());}};_0x79b768(++_0x2e59b2);}(_0xbec5,0xe5));var _0x5bec=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xbec5[_0x48ec91];return _0x22766c;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5bec('0x2')]},'channelstate':{'type':Sequelize[_0x5bec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'calleridnum':{'type':Sequelize[_0x5bec('0x2')]},'calleridname':{'type':Sequelize[_0x5bec('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5bec('0x2')]},'language':{'type':Sequelize[_0x5bec('0x2')]},'accountcode':{'type':Sequelize[_0x5bec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5bec('0x2')]},'priority':{'type':Sequelize[_0x5bec('0x3')]},'uniqueid':{'type':Sequelize[_0x5bec('0x2')]},'linkedid':{'type':Sequelize[_0x5bec('0x2')]},'destchannel':{'type':Sequelize[_0x5bec('0x2')]},'destchannelstate':{'type':Sequelize[_0x5bec('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5bec('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5bec('0x2')]},'destaccountcode':{'type':Sequelize[_0x5bec('0x2')]},'destcontext':{'type':Sequelize[_0x5bec('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5bec('0x3')]},'destuniqueid':{'type':Sequelize[_0x5bec('0x2')]},'destlinkedid':{'type':Sequelize[_0x5bec('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x5bec('0x2')]},'starttime':{'type':Sequelize[_0x5bec('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5bec('0x4')]},'lastevent':{'type':Sequelize[_0x5bec('0x2')],'comment':_0x5bec('0x5')},'routeId':{'type':Sequelize[_0x5bec('0x3')]},'duration':{'type':Sequelize[_0x5bec('0x3')]},'holdtime':{'type':Sequelize[_0x5bec('0x3')]},'billableseconds':{'type':Sequelize[_0x5bec('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 59421ec..dd7e300 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 _0x9538=['nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x2ee822,_0x4c15ab){var _0x3df987=function(_0x29e89a){while(--_0x29e89a){_0x2ee822['push'](_0x2ee822['shift']());}};_0x3df987(++_0x4c15ab);}(_0x9538,0xa0));var _0x8953=function(_0x55cadb,_0xe4cb2b){_0x55cadb=_0x55cadb-0x0;var _0x29cf21=_0x9538[_0x55cadb];return _0x29cf21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8953('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8953('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8953('0x2'));var Mustache=require(_0x8953('0x3'));var util=require(_0x8953('0x4'));var path=require('path');var sox=require(_0x8953('0x5'));var csv=require(_0x8953('0x6'));var ejs=require(_0x8953('0x7'));var fs=require('fs');var fs_extra=require(_0x8953('0x8'));var _=require(_0x8953('0x9'));var squel=require('squel');var crypto=require(_0x8953('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8953('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8953('0xc'));var Papa=require(_0x8953('0xd'));var Redis=require(_0x8953('0xe'));var authService=require(_0x8953('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8953('0x10'));var hardwareService=require(_0x8953('0x11'));var logger=require(_0x8953('0x12'))(_0x8953('0x13'));var utils=require(_0x8953('0x14'));var config=require(_0x8953('0x15'));var licenseUtil=require(_0x8953('0x16'));var db=require(_0x8953('0x17'))['db'];function respondWithStatusCode(_0x24426b,_0x4dd7a5){_0x4dd7a5=_0x4dd7a5||0xcc;return function(_0x2bca3b){if(_0x2bca3b){return _0x24426b[_0x8953('0x18')](_0x4dd7a5);}return _0x24426b[_0x8953('0x19')](_0x4dd7a5)[_0x8953('0x1a')]();};}function respondWithResult(_0x34eadb,_0x1e04fa){_0x1e04fa=_0x1e04fa||0xc8;return function(_0x3837ce){if(_0x3837ce){return _0x34eadb[_0x8953('0x19')](_0x1e04fa)['json'](_0x3837ce);}};}function respondWithFilteredResult(_0x3303b3,_0x3ec4f3){return function(_0x2b1235){if(_0x2b1235){var _0x382003=typeof _0x3ec4f3['offset']===_0x8953('0x1b')&&typeof _0x3ec4f3[_0x8953('0x1c')]===_0x8953('0x1b');var _0x31a831=_0x2b1235[_0x8953('0x1d')];var _0x19374d=_0x382003?0x0:_0x3ec4f3[_0x8953('0x1e')];var _0x55f7dc=_0x382003?_0x2b1235[_0x8953('0x1d')]:_0x3ec4f3[_0x8953('0x1e')]+_0x3ec4f3[_0x8953('0x1c')];var _0x3cd937;if(_0x55f7dc>=_0x31a831){_0x55f7dc=_0x31a831;_0x3cd937=0xc8;}else{_0x3cd937=0xce;}_0x3303b3['status'](_0x3cd937);return _0x3303b3[_0x8953('0x1f')](_0x8953('0x20'),_0x19374d+'-'+_0x55f7dc+'/'+_0x31a831)[_0x8953('0x21')](_0x2b1235);}return null;};}function patchUpdates(_0x290e6d){return function(_0x5bf806){try{jsonpatch['apply'](_0x5bf806,_0x290e6d,!![]);}catch(_0xc249ae){return BPromise[_0x8953('0x22')](_0xc249ae);}return _0x5bf806[_0x8953('0x23')]();};}function saveUpdates(_0x484c4c,_0x120c22){return function(_0xe2fc96){if(_0xe2fc96){return _0xe2fc96[_0x8953('0x24')](_0x484c4c)['then'](function(_0x3dba5a){return _0x3dba5a;});}return null;};}function removeEntity(_0x437e12,_0x8e59b7){return function(_0x5c0093){if(_0x5c0093){return _0x5c0093[_0x8953('0x25')]()[_0x8953('0x26')](function(){_0x437e12['status'](0xcc)[_0x8953('0x1a')]();});}};}function handleEntityNotFound(_0x38369e,_0xda5929){return function(_0x5176c9){if(!_0x5176c9){_0x38369e['sendStatus'](0x194);}return _0x5176c9;};}function handleError(_0x35c6e8,_0x37af8d){_0x37af8d=_0x37af8d||0x1f4;return function(_0x165edf){logger[_0x8953('0x27')](_0x165edf[_0x8953('0x28')]);if(_0x165edf[_0x8953('0x29')]){delete _0x165edf[_0x8953('0x29')];}_0x35c6e8[_0x8953('0x19')](_0x37af8d)[_0x8953('0x2a')](_0x165edf);};}exports[_0x8953('0x2b')]=function(_0x50d714,_0x421306){var _0x53a1cf={},_0x29d831={},_0x473d78={'count':0x0,'rows':[]};var _0x3ab22d=_[_0x8953('0x2c')](db[_0x8953('0x2d')][_0x8953('0x2e')],function(_0x32c3e1){return{'name':_0x32c3e1['fieldName'],'type':_0x32c3e1[_0x8953('0x2f')][_0x8953('0x30')]};});_0x29d831[_0x8953('0x31')]=_[_0x8953('0x2c')](_0x3ab22d,_0x8953('0x29'));_0x29d831['query']=_[_0x8953('0x32')](_0x50d714[_0x8953('0x33')]);_0x29d831[_0x8953('0x34')]=_[_0x8953('0x35')](_0x29d831[_0x8953('0x31')],_0x29d831[_0x8953('0x33')]);_0x53a1cf[_0x8953('0x36')]=_[_0x8953('0x35')](_0x29d831['model'],qs[_0x8953('0x37')](_0x50d714[_0x8953('0x33')][_0x8953('0x37')]));_0x53a1cf[_0x8953('0x36')]=_0x53a1cf[_0x8953('0x36')]['length']?_0x53a1cf[_0x8953('0x36')]:_0x29d831[_0x8953('0x31')];if(!_0x50d714[_0x8953('0x33')]['hasOwnProperty'](_0x8953('0x38'))){_0x53a1cf[_0x8953('0x1c')]=qs[_0x8953('0x1c')](_0x50d714[_0x8953('0x33')]['limit']);_0x53a1cf[_0x8953('0x1e')]=qs[_0x8953('0x1e')](_0x50d714[_0x8953('0x33')]['offset']);}_0x53a1cf['order']=qs[_0x8953('0x39')](_0x50d714[_0x8953('0x33')][_0x8953('0x39')]);_0x53a1cf[_0x8953('0x3a')]=qs[_0x8953('0x34')](_['pick'](_0x50d714[_0x8953('0x33')],_0x29d831[_0x8953('0x34')]),_0x3ab22d);if(_0x50d714[_0x8953('0x33')][_0x8953('0x3b')]){_0x53a1cf['where']=_[_0x8953('0x3c')](_0x53a1cf[_0x8953('0x3a')],{'$or':_['map'](_0x3ab22d,function(_0x393a70){if(_0x393a70[_0x8953('0x2f')]!=='VIRTUAL'){var _0x580c7b={};_0x580c7b[_0x393a70[_0x8953('0x29')]]={'$like':'%'+_0x50d714[_0x8953('0x33')][_0x8953('0x3b')]+'%'};return _0x580c7b;}})});}_0x53a1cf=_[_0x8953('0x3c')]({},_0x53a1cf,_0x50d714[_0x8953('0x3d')]);var _0x5ddc75={'where':_0x53a1cf[_0x8953('0x3a')]};return db[_0x8953('0x2d')][_0x8953('0x1d')](_0x5ddc75)[_0x8953('0x26')](function(_0x4f78ac){_0x473d78[_0x8953('0x1d')]=_0x4f78ac;if(_0x50d714[_0x8953('0x33')][_0x8953('0x3e')]){_0x53a1cf[_0x8953('0x3f')]=[{'all':!![]}];}return db[_0x8953('0x2d')][_0x8953('0x40')](_0x53a1cf);})[_0x8953('0x26')](function(_0x46445c){_0x473d78['rows']=_0x46445c;return _0x473d78;})[_0x8953('0x26')](respondWithFilteredResult(_0x421306,_0x53a1cf))[_0x8953('0x41')](handleError(_0x421306,null));};exports[_0x8953('0x42')]=function(_0x39789a,_0x5ae634){var _0x470a48={'raw':!![],'where':{'id':_0x39789a['params']['id']}},_0x164dde={};_0x164dde['model']=_[_0x8953('0x32')](db['VoiceDialReport'][_0x8953('0x2e')]);_0x164dde[_0x8953('0x33')]=_['keys'](_0x39789a[_0x8953('0x33')]);_0x164dde[_0x8953('0x34')]=_['intersection'](_0x164dde[_0x8953('0x31')],_0x164dde[_0x8953('0x33')]);_0x470a48['attributes']=_[_0x8953('0x35')](_0x164dde[_0x8953('0x31')],qs['fields'](_0x39789a[_0x8953('0x33')][_0x8953('0x37')]));_0x470a48['attributes']=_0x470a48['attributes'][_0x8953('0x43')]?_0x470a48[_0x8953('0x36')]:_0x164dde[_0x8953('0x31')];if(_0x39789a['query'][_0x8953('0x3e')]){_0x470a48['include']=[{'all':!![]}];}_0x470a48=_['merge']({},_0x470a48,_0x39789a[_0x8953('0x3d')]);return db[_0x8953('0x2d')][_0x8953('0x44')](_0x470a48)[_0x8953('0x26')](handleEntityNotFound(_0x5ae634,null))[_0x8953('0x26')](respondWithResult(_0x5ae634,null))[_0x8953('0x41')](handleError(_0x5ae634,null));};exports[_0x8953('0x45')]=function(_0x35df90,_0x6bb2df){return db['VoiceDialReport'][_0x8953('0x45')](_0x35df90[_0x8953('0x46')],{})[_0x8953('0x26')](respondWithResult(_0x6bb2df,0xc9))[_0x8953('0x41')](handleError(_0x6bb2df,null));};exports[_0x8953('0x24')]=function(_0x2c848b,_0x16247d){if(_0x2c848b[_0x8953('0x46')]['id']){delete _0x2c848b[_0x8953('0x46')]['id'];}return db[_0x8953('0x2d')][_0x8953('0x44')]({'where':{'id':_0x2c848b['params']['id']}})[_0x8953('0x26')](handleEntityNotFound(_0x16247d,null))[_0x8953('0x26')](saveUpdates(_0x2c848b[_0x8953('0x46')],null))[_0x8953('0x26')](respondWithResult(_0x16247d,null))[_0x8953('0x41')](handleError(_0x16247d,null));};exports[_0x8953('0x25')]=function(_0x49732c,_0x13e154){return db[_0x8953('0x2d')][_0x8953('0x44')]({'where':{'id':_0x49732c['params']['id']}})[_0x8953('0x26')](handleEntityNotFound(_0x13e154,null))[_0x8953('0x26')](removeEntity(_0x13e154,null))[_0x8953('0x41')](handleError(_0x13e154,null));};exports[_0x8953('0x47')]=function(_0x2a6f83,_0x44ab0d){return db[_0x8953('0x2d')][_0x8953('0x47')]()['then'](respondWithResult(_0x44ab0d,null))[_0x8953('0x41')](handleError(_0x44ab0d,null));}; \ No newline at end of file +var _0x425e=['../../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','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','fieldName','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','filter','merge','where','type','VoiceDialReport','includeAll','include','findAll','show','params','rawAttributes','intersection','length','options','find','create','body','catch','describe','eml-format','rimraf','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x425e,0x11e));var _0xe425=function(_0x29bc2e,_0xf94885){_0x29bc2e=_0x29bc2e-0x0;var _0x19b2c6=_0x425e[_0x29bc2e];return _0x19b2c6;};'use strict';var emlformat=require(_0xe425('0x0'));var rimraf=require(_0xe425('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe425('0x2'));var Mustache=require('mustache');var util=require(_0xe425('0x3'));var path=require(_0xe425('0x4'));var sox=require(_0xe425('0x5'));var csv=require(_0xe425('0x6'));var ejs=require(_0xe425('0x7'));var fs=require('fs');var fs_extra=require(_0xe425('0x8'));var _=require(_0xe425('0x9'));var squel=require(_0xe425('0xa'));var crypto=require(_0xe425('0xb'));var jsforce=require(_0xe425('0xc'));var deskjs=require(_0xe425('0xd'));var toCsv=require(_0xe425('0x6'));var querystring=require(_0xe425('0xe'));var Papa=require(_0xe425('0xf'));var Redis=require(_0xe425('0x10'));var authService=require(_0xe425('0x11'));var qs=require(_0xe425('0x12'));var as=require(_0xe425('0x13'));var hardwareService=require(_0xe425('0x14'));var logger=require(_0xe425('0x15'))(_0xe425('0x16'));var utils=require(_0xe425('0x17'));var config=require(_0xe425('0x18'));var licenseUtil=require(_0xe425('0x19'));var db=require(_0xe425('0x1a'))['db'];function respondWithStatusCode(_0x166c1f,_0x4c481b){_0x4c481b=_0x4c481b||0xcc;return function(_0x14f919){if(_0x14f919){return _0x166c1f[_0xe425('0x1b')](_0x4c481b);}return _0x166c1f[_0xe425('0x1c')](_0x4c481b)[_0xe425('0x1d')]();};}function respondWithResult(_0x211482,_0x10ee8d){_0x10ee8d=_0x10ee8d||0xc8;return function(_0x386e87){if(_0x386e87){return _0x211482[_0xe425('0x1c')](_0x10ee8d)[_0xe425('0x1e')](_0x386e87);}};}function respondWithFilteredResult(_0x4a700e,_0x38a50f){return function(_0x3eef30){if(_0x3eef30){var _0x56e8d7=typeof _0x38a50f['offset']===_0xe425('0x1f')&&typeof _0x38a50f[_0xe425('0x20')]===_0xe425('0x1f');var _0x11ee48=_0x3eef30[_0xe425('0x21')];var _0x5bcc66=_0x56e8d7?0x0:_0x38a50f[_0xe425('0x22')];var _0x269d10=_0x56e8d7?_0x3eef30[_0xe425('0x21')]:_0x38a50f[_0xe425('0x22')]+_0x38a50f['limit'];var _0x48c94f;if(_0x269d10>=_0x11ee48){_0x269d10=_0x11ee48;_0x48c94f=0xc8;}else{_0x48c94f=0xce;}_0x4a700e[_0xe425('0x1c')](_0x48c94f);return _0x4a700e[_0xe425('0x23')](_0xe425('0x24'),_0x5bcc66+'-'+_0x269d10+'/'+_0x11ee48)['json'](_0x3eef30);}return null;};}function patchUpdates(_0xead687){return function(_0x4d4127){try{jsonpatch[_0xe425('0x25')](_0x4d4127,_0xead687,!![]);}catch(_0xd036cc){return BPromise[_0xe425('0x26')](_0xd036cc);}return _0x4d4127['save']();};}function saveUpdates(_0x502dd9,_0xd29dfe){return function(_0x3e2872){if(_0x3e2872){return _0x3e2872[_0xe425('0x27')](_0x502dd9)[_0xe425('0x28')](function(_0x4fa726){return _0x4fa726;});}return null;};}function removeEntity(_0x83e28,_0x4c9d52){return function(_0x535ba1){if(_0x535ba1){return _0x535ba1[_0xe425('0x29')]()[_0xe425('0x28')](function(){_0x83e28[_0xe425('0x1c')](0xcc)[_0xe425('0x1d')]();});}};}function handleEntityNotFound(_0x197985,_0x1d163e){return function(_0x148220){if(!_0x148220){_0x197985[_0xe425('0x1b')](0x194);}return _0x148220;};}function handleError(_0x559224,_0x2b690d){_0x2b690d=_0x2b690d||0x1f4;return function(_0x290a74){logger[_0xe425('0x2a')](_0x290a74['stack']);if(_0x290a74['name']){delete _0x290a74[_0xe425('0x2b')];}_0x559224['status'](_0x2b690d)['send'](_0x290a74);};}exports[_0xe425('0x2c')]=function(_0x51f5c8,_0x3443d4){var _0x26418b={},_0x14838b={},_0x2d312b={'count':0x0,'rows':[]};var _0x4a8622=_[_0xe425('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x4ded2d){return{'name':_0x4ded2d[_0xe425('0x2e')],'type':_0x4ded2d['type'][_0xe425('0x2f')]};});_0x14838b[_0xe425('0x30')]=_['map'](_0x4a8622,_0xe425('0x2b'));_0x14838b[_0xe425('0x31')]=_[_0xe425('0x32')](_0x51f5c8[_0xe425('0x31')]);_0x14838b[_0xe425('0x33')]=_['intersection'](_0x14838b['model'],_0x14838b['query']);_0x26418b[_0xe425('0x34')]=_['intersection'](_0x14838b[_0xe425('0x30')],qs[_0xe425('0x35')](_0x51f5c8['query'][_0xe425('0x35')]));_0x26418b['attributes']=_0x26418b[_0xe425('0x34')]['length']?_0x26418b[_0xe425('0x34')]:_0x14838b[_0xe425('0x30')];if(!_0x51f5c8['query']['hasOwnProperty'](_0xe425('0x36'))){_0x26418b[_0xe425('0x20')]=qs[_0xe425('0x20')](_0x51f5c8[_0xe425('0x31')][_0xe425('0x20')]);_0x26418b['offset']=qs['offset'](_0x51f5c8[_0xe425('0x31')][_0xe425('0x22')]);}_0x26418b[_0xe425('0x37')]=qs[_0xe425('0x38')](_0x51f5c8[_0xe425('0x31')][_0xe425('0x38')]);_0x26418b['where']=qs['filters'](_['pick'](_0x51f5c8[_0xe425('0x31')],_0x14838b[_0xe425('0x33')]),_0x4a8622);if(_0x51f5c8[_0xe425('0x31')][_0xe425('0x39')]){_0x26418b['where']=_[_0xe425('0x3a')](_0x26418b[_0xe425('0x3b')],{'$or':_[_0xe425('0x2d')](_0x4a8622,function(_0x10ec08){if(_0x10ec08[_0xe425('0x3c')]!=='VIRTUAL'){var _0x14e58b={};_0x14e58b[_0x10ec08[_0xe425('0x2b')]]={'$like':'%'+_0x51f5c8[_0xe425('0x31')][_0xe425('0x39')]+'%'};return _0x14e58b;}})});}_0x26418b=_[_0xe425('0x3a')]({},_0x26418b,_0x51f5c8['options']);var _0x9751ad={'where':_0x26418b['where']};return db[_0xe425('0x3d')][_0xe425('0x21')](_0x9751ad)['then'](function(_0x4221ea){_0x2d312b['count']=_0x4221ea;if(_0x51f5c8['query'][_0xe425('0x3e')]){_0x26418b[_0xe425('0x3f')]=[{'all':!![]}];}return db[_0xe425('0x3d')][_0xe425('0x40')](_0x26418b);})[_0xe425('0x28')](function(_0x9968ae){_0x2d312b['rows']=_0x9968ae;return _0x2d312b;})['then'](respondWithFilteredResult(_0x3443d4,_0x26418b))['catch'](handleError(_0x3443d4,null));};exports[_0xe425('0x41')]=function(_0x33aa38,_0x41100c){var _0x59effe={'raw':!![],'where':{'id':_0x33aa38[_0xe425('0x42')]['id']}},_0x502a25={};_0x502a25[_0xe425('0x30')]=_['keys'](db[_0xe425('0x3d')][_0xe425('0x43')]);_0x502a25['query']=_['keys'](_0x33aa38[_0xe425('0x31')]);_0x502a25['filters']=_[_0xe425('0x44')](_0x502a25[_0xe425('0x30')],_0x502a25[_0xe425('0x31')]);_0x59effe['attributes']=_[_0xe425('0x44')](_0x502a25[_0xe425('0x30')],qs[_0xe425('0x35')](_0x33aa38[_0xe425('0x31')][_0xe425('0x35')]));_0x59effe[_0xe425('0x34')]=_0x59effe[_0xe425('0x34')][_0xe425('0x45')]?_0x59effe[_0xe425('0x34')]:_0x502a25[_0xe425('0x30')];if(_0x33aa38['query'][_0xe425('0x3e')]){_0x59effe[_0xe425('0x3f')]=[{'all':!![]}];}_0x59effe=_['merge']({},_0x59effe,_0x33aa38[_0xe425('0x46')]);return db[_0xe425('0x3d')][_0xe425('0x47')](_0x59effe)['then'](handleEntityNotFound(_0x41100c,null))['then'](respondWithResult(_0x41100c,null))['catch'](handleError(_0x41100c,null));};exports['create']=function(_0x31f214,_0x5da6f5){return db['VoiceDialReport'][_0xe425('0x48')](_0x31f214[_0xe425('0x49')],{})[_0xe425('0x28')](respondWithResult(_0x5da6f5,0xc9))['catch'](handleError(_0x5da6f5,null));};exports['update']=function(_0x17bbdf,_0x34e304){if(_0x17bbdf['body']['id']){delete _0x17bbdf[_0xe425('0x49')]['id'];}return db['VoiceDialReport'][_0xe425('0x47')]({'where':{'id':_0x17bbdf[_0xe425('0x42')]['id']}})['then'](handleEntityNotFound(_0x34e304,null))[_0xe425('0x28')](saveUpdates(_0x17bbdf[_0xe425('0x49')],null))[_0xe425('0x28')](respondWithResult(_0x34e304,null))[_0xe425('0x4a')](handleError(_0x34e304,null));};exports['destroy']=function(_0x46aa32,_0x4d41e0){return db[_0xe425('0x3d')][_0xe425('0x47')]({'where':{'id':_0x46aa32[_0xe425('0x42')]['id']}})[_0xe425('0x28')](handleEntityNotFound(_0x4d41e0,null))[_0xe425('0x28')](removeEntity(_0x4d41e0,null))[_0xe425('0x4a')](handleError(_0x4d41e0,null));};exports[_0xe425('0x4b')]=function(_0x1d80e4,_0x1c8df9){return db[_0xe425('0x3d')][_0xe425('0x4b')]()[_0xe425('0x28')](respondWithResult(_0x1c8df9,null))[_0xe425('0x4a')](handleError(_0x1c8df9,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 71e54ff..3a53b56 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 _0x5912=['./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2b44c9,_0x3e7bc0){var _0x418250=function(_0x3159df){while(--_0x3159df){_0x2b44c9['push'](_0x2b44c9['shift']());}};_0x418250(++_0x3e7bc0);}(_0x5912,0x18b));var _0x2591=function(_0x17fd27,_0x52f3f3){_0x17fd27=_0x17fd27-0x0;var _0x4239ad=_0x5912[_0x17fd27];return _0x4239ad;};'use strict';var _=require('lodash');var util=require(_0x2591('0x0'));var logger=require(_0x2591('0x1'))(_0x2591('0x2'));var moment=require(_0x2591('0x3'));var BPromise=require(_0x2591('0x4'));var rp=require(_0x2591('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2591('0x6'));var config=require(_0x2591('0x7'));var attributes=require(_0x2591('0x8'));module['exports']=function(_0x28d189,_0x37f3e2){return _0x28d189[_0x2591('0x9')](_0x2591('0xa'),attributes,{'tableName':_0x2591('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2591('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b5b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','../../config/logger'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x8b5b,0x137));var _0xb8b5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8b5b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb8b5('0x0'))(_0xb8b5('0x1'));var moment=require(_0xb8b5('0x2'));var BPromise=require(_0xb8b5('0x3'));var rp=require(_0xb8b5('0x4'));var fs=require('fs');var path=require(_0xb8b5('0x5'));var rimraf=require(_0xb8b5('0x6'));var config=require(_0xb8b5('0x7'));var attributes=require(_0xb8b5('0x8'));module[_0xb8b5('0x9')]=function(_0x2a02e9,_0xb474f8){return _0x2a02e9['define'](_0xb8b5('0xa'),attributes,{'tableName':_0xb8b5('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 924dc90..83b53a7 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 _0xe01e=['CreateVoiceDialReport','create','options','raw','VoiceDialReport','update','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x478970,_0x5df032){var _0x1759f1=function(_0x58579d){while(--_0x58579d){_0x478970['push'](_0x478970['shift']());}};_0x1759f1(++_0x5df032);}(_0xe01e,0x1d8));var _0xee01=function(_0x21d11f,_0xbba38a){_0x21d11f=_0x21d11f-0x0;var _0x4cba6b=_0xe01e[_0x21d11f];return _0x4cba6b;};'use strict';var _=require(_0xee01('0x0'));var util=require(_0xee01('0x1'));var moment=require(_0xee01('0x2'));var BPromise=require(_0xee01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee01('0x4'));var db=require(_0xee01('0x5'))['db'];var utils=require(_0xee01('0x6'));var logger=require(_0xee01('0x7'))(_0xee01('0x8'));var config=require('../../config/environment');var jayson=require(_0xee01('0x9'));var client=jayson['client'][_0xee01('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e87d3,_0x579703,_0x429f52){return new BPromise(function(_0x55bf78,_0x2b72e6){return client[_0xee01('0xb')](_0x5e87d3,_0x429f52)[_0xee01('0xc')](function(_0x3f7025){logger[_0xee01('0xd')](_0xee01('0xe'),_0x579703,'request\x20sent');logger[_0xee01('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x579703,_0xee01('0x10'),JSON[_0xee01('0x11')](_0x3f7025));if(_0x3f7025[_0xee01('0x12')]){if(_0x3f7025[_0xee01('0x12')][_0xee01('0x13')]===0x1f4){logger[_0xee01('0x12')](_0xee01('0xe'),_0x579703,_0x3f7025[_0xee01('0x12')]['message']);return _0x2b72e6(_0x3f7025[_0xee01('0x12')][_0xee01('0x14')]);}logger[_0xee01('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x579703,_0x3f7025[_0xee01('0x12')][_0xee01('0x14')]);return _0x55bf78(_0x3f7025[_0xee01('0x12')][_0xee01('0x14')]);}else{logger['info'](_0xee01('0xe'),_0x579703,'request\x20sent');_0x55bf78(_0x3f7025[_0xee01('0x15')]['message']);}})[_0xee01('0x16')](function(_0x1c0922){logger[_0xee01('0x12')](_0xee01('0xe'),_0x579703,_0x1c0922);_0x2b72e6(_0x1c0922);});});}exports[_0xee01('0x17')]=function(_0x402868){var _0x27a60e=this;return new Promise(function(_0x558709,_0x56404e){return db['VoiceDialReport'][_0xee01('0x18')](_0x402868['body'],{'raw':_0x402868['options']?_0x402868[_0xee01('0x19')][_0xee01('0x1a')]===undefined?!![]:![]:!![]})[_0xee01('0xc')](function(_0x4506ba){logger['info'](_0xee01('0x17'),_0x402868);logger[_0xee01('0xf')](_0xee01('0x17'),_0x402868,JSON[_0xee01('0x11')](_0x4506ba));_0x558709(_0x4506ba);})[_0xee01('0x16')](function(_0x500bc0){logger[_0xee01('0x12')](_0xee01('0x17'),_0x500bc0[_0xee01('0x14')],_0x402868);_0x56404e(_0x27a60e[_0xee01('0x12')](0x1f4,_0x500bc0[_0xee01('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x22992c){var _0x19457e=this;return new Promise(function(_0x4d91bb,_0xcac55c){return db[_0xee01('0x1b')][_0xee01('0x1c')](_0x22992c['body'],{'raw':_0x22992c[_0xee01('0x19')]?_0x22992c[_0xee01('0x19')][_0xee01('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22992c[_0xee01('0x19')]?_0x22992c['options'][_0xee01('0x1d')]||null:null,'attributes':_0x22992c[_0xee01('0x19')]?_0x22992c[_0xee01('0x19')][_0xee01('0x1e')]||null:null,'limit':_0x22992c[_0xee01('0x19')]?_0x22992c[_0xee01('0x19')][_0xee01('0x1f')]||null:null})[_0xee01('0xc')](function(_0x87d1ba){logger[_0xee01('0xd')](_0xee01('0x20'),_0x22992c);logger[_0xee01('0xf')](_0xee01('0x20'),_0x22992c,JSON[_0xee01('0x11')](_0x87d1ba));_0x4d91bb(_0x87d1ba);})['catch'](function(_0x494a86){logger[_0xee01('0x12')]('UpdateVoiceDialReport',_0x494a86['message'],_0x22992c);_0xcac55c(_0x19457e[_0xee01('0x12')](0x1f4,_0x494a86[_0xee01('0x14')]));});});}; \ No newline at end of file +var _0xeebd=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','VoiceDialReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3beae2,_0x43241e){var _0x3cf8cd=function(_0x26af4f){while(--_0x26af4f){_0x3beae2['push'](_0x3beae2['shift']());}};_0x3cf8cd(++_0x43241e);}(_0xeebd,0x12d));var _0xdeeb=function(_0x499e90,_0x2d9c45){_0x499e90=_0x499e90-0x0;var _0xaf1c7e=_0xeebd[_0x499e90];return _0xaf1c7e;};'use strict';var _=require(_0xdeeb('0x0'));var util=require(_0xdeeb('0x1'));var moment=require(_0xdeeb('0x2'));var BPromise=require(_0xdeeb('0x3'));var rs=require(_0xdeeb('0x4'));var fs=require('fs');var Redis=require(_0xdeeb('0x5'));var db=require(_0xdeeb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdeeb('0x7'))(_0xdeeb('0x8'));var config=require(_0xdeeb('0x9'));var jayson=require(_0xdeeb('0xa'));var client=jayson[_0xdeeb('0xb')][_0xdeeb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21cf52,_0x409561,_0x256d9b){return new BPromise(function(_0x18930c,_0xaa6e1d){return client['request'](_0x21cf52,_0x256d9b)[_0xdeeb('0xd')](function(_0x12d414){logger[_0xdeeb('0xe')](_0xdeeb('0xf'),_0x409561,_0xdeeb('0x10'));logger[_0xdeeb('0x11')](_0xdeeb('0x12'),_0x409561,_0xdeeb('0x10'),JSON['stringify'](_0x12d414));if(_0x12d414[_0xdeeb('0x13')]){if(_0x12d414['error'][_0xdeeb('0x14')]===0x1f4){logger[_0xdeeb('0x13')](_0xdeeb('0xf'),_0x409561,_0x12d414['error'][_0xdeeb('0x15')]);return _0xaa6e1d(_0x12d414[_0xdeeb('0x13')]['message']);}logger[_0xdeeb('0x13')](_0xdeeb('0xf'),_0x409561,_0x12d414[_0xdeeb('0x13')][_0xdeeb('0x15')]);return _0x18930c(_0x12d414[_0xdeeb('0x13')]['message']);}else{logger['info'](_0xdeeb('0xf'),_0x409561,_0xdeeb('0x10'));_0x18930c(_0x12d414[_0xdeeb('0x16')][_0xdeeb('0x15')]);}})[_0xdeeb('0x17')](function(_0x923440){logger[_0xdeeb('0x13')](_0xdeeb('0xf'),_0x409561,_0x923440);_0xaa6e1d(_0x923440);});});}exports[_0xdeeb('0x18')]=function(_0x1d0461){var _0x2b19d5=this;return new Promise(function(_0x35e174,_0x5000b6){return db['VoiceDialReport'][_0xdeeb('0x19')](_0x1d0461[_0xdeeb('0x1a')],{'raw':_0x1d0461[_0xdeeb('0x1b')]?_0x1d0461[_0xdeeb('0x1b')][_0xdeeb('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x183d23){logger[_0xdeeb('0xe')](_0xdeeb('0x18'),_0x1d0461);logger[_0xdeeb('0x11')](_0xdeeb('0x18'),_0x1d0461,JSON[_0xdeeb('0x1d')](_0x183d23));_0x35e174(_0x183d23);})[_0xdeeb('0x17')](function(_0x2c3c18){logger[_0xdeeb('0x13')]('CreateVoiceDialReport',_0x2c3c18[_0xdeeb('0x15')],_0x1d0461);_0x5000b6(_0x2b19d5[_0xdeeb('0x13')](0x1f4,_0x2c3c18['message']));});});};exports[_0xdeeb('0x1e')]=function(_0x5d5a6c){var _0x4d090=this;return new Promise(function(_0x7cf900,_0x1309ad){return db[_0xdeeb('0x1f')][_0xdeeb('0x20')](_0x5d5a6c[_0xdeeb('0x1a')],{'raw':_0x5d5a6c['options']?_0x5d5a6c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d5a6c[_0xdeeb('0x1b')]?_0x5d5a6c[_0xdeeb('0x1b')][_0xdeeb('0x21')]||null:null,'attributes':_0x5d5a6c['options']?_0x5d5a6c[_0xdeeb('0x1b')]['attributes']||null:null,'limit':_0x5d5a6c[_0xdeeb('0x1b')]?_0x5d5a6c['options'][_0xdeeb('0x22')]||null:null})[_0xdeeb('0xd')](function(_0x33c34b){logger['info'](_0xdeeb('0x1e'),_0x5d5a6c);logger[_0xdeeb('0x11')](_0xdeeb('0x1e'),_0x5d5a6c,JSON['stringify'](_0x33c34b));_0x7cf900(_0x33c34b);})['catch'](function(_0x4e8bb8){logger[_0xdeeb('0x13')](_0xdeeb('0x1e'),_0x4e8bb8[_0xdeeb('0x15')],_0x5d5a6c);_0x1309ad(_0x4d090[_0xdeeb('0x13')](0x1f4,_0x4e8bb8[_0xdeeb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 67381aa..5c19c04 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 _0x4e64=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','post','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e64,0x1c5));var _0x44e6=function(_0x51500b,_0x48aba5){_0x51500b=_0x51500b-0x0;var _0x3f2648=_0x4e64[_0x51500b];return _0x3f2648;};'use strict';var multer=require(_0x44e6('0x0'));var util=require(_0x44e6('0x1'));var path=require(_0x44e6('0x2'));var timeout=require(_0x44e6('0x3'));var express=require(_0x44e6('0x4'));var router=express['Router']();var fs_extra=require(_0x44e6('0x5'));var auth=require(_0x44e6('0x6'));var interaction=require(_0x44e6('0x7'));var config=require(_0x44e6('0x8'));var controller=require(_0x44e6('0x9'));router[_0x44e6('0xa')]('/',auth[_0x44e6('0xb')](),controller[_0x44e6('0xc')]);router['get'](_0x44e6('0xd'),auth['isAuthenticated'](),controller[_0x44e6('0xe')]);router['post']('/',auth[_0x44e6('0xb')](),controller[_0x44e6('0xf')]);router[_0x44e6('0x10')](_0x44e6('0x11'),auth[_0x44e6('0xb')](),controller[_0x44e6('0x12')]);router[_0x44e6('0x13')](_0x44e6('0xd'),auth[_0x44e6('0xb')](),controller[_0x44e6('0x14')]);router[_0x44e6('0x15')](_0x44e6('0xd'),auth[_0x44e6('0xb')](),controller[_0x44e6('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd9c1=['../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','post','/:id/applications','addApplications','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x26fb2b,_0x52deea){var _0x4afd06=function(_0x3f5c1d){while(--_0x3f5c1d){_0x26fb2b['push'](_0x26fb2b['shift']());}};_0x4afd06(++_0x52deea);}(_0xd9c1,0x1a4));var _0x1d9c=function(_0x43695c,_0x33355c){_0x43695c=_0x43695c-0x0;var _0xbab647=_0xd9c1[_0x43695c];return _0xbab647;};'use strict';var multer=require(_0x1d9c('0x0'));var util=require(_0x1d9c('0x1'));var path=require('path');var timeout=require(_0x1d9c('0x2'));var express=require(_0x1d9c('0x3'));var router=express[_0x1d9c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d9c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1d9c('0x6'));var controller=require('./voiceExtension.controller');router[_0x1d9c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1d9c('0x8'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0xa')]);router[_0x1d9c('0xb')]('/',auth[_0x1d9c('0x9')](),controller['create']);router[_0x1d9c('0xb')](_0x1d9c('0xc'),auth['isAuthenticated'](),controller[_0x1d9c('0xd')]);router['put']('/:id',auth[_0x1d9c('0x9')](),controller[_0x1d9c('0xe')]);router['delete'](_0x1d9c('0x8'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0xf')]);module[_0x1d9c('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d308b39..c70742a 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 _0xf09d=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0xb9f7f6,_0xd6efae){var _0xb4edcd=function(_0x1a2ae1){while(--_0x1a2ae1){_0xb9f7f6['push'](_0xb9f7f6['shift']());}};_0xb4edcd(++_0xd6efae);}(_0xf09d,0xde));var _0xdf09=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xf09d[_0x2d994d];return _0xd54be4;};'use strict';var Sequelize=require('sequelize');module[_0xdf09('0x0')]={'context':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'unique':_0xdf09('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'unique':_0xdf09('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xdf09('0x2')},'tag':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'defaultValue':_0xdf09('0x3')},'appdata':{'type':Sequelize[_0xdf09('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xdf09('0x4')](_0xdf09('0x5'),_0xdf09('0x6'),_0xdf09('0x7'),_0xdf09('0x8'),_0xdf09('0x9'),_0xdf09('0xa'),_0xdf09('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xdf09('0x1')]},'interval':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'defaultValue':_0xdf09('0xc')},'IntervalId':{'type':Sequelize[_0xdf09('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xdf09('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xdf09('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xdf09('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xdf09('0xd')]},'recordingFormat':{'type':Sequelize[_0xdf09('0x1')],'defaultValue':_0xdf09('0xf')},'answer':{'type':Sequelize[_0xdf09('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xdf09('0x10')],'get':function(_0x16ae6c){return this[_0xdf09('0x11')]('exten');}},'alias':{'type':Sequelize[_0xdf09('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x7a38=['outbound','internal','inbound-fax','system','any','*,*,*,*','wav','getDataValue','exten','exports','STRING','compositeIndex','ENUM','inbound'];(function(_0x53ee43,_0x2a63ec){var _0x58b2ca=function(_0x35e8a0){while(--_0x35e8a0){_0x53ee43['push'](_0x53ee43['shift']());}};_0x58b2ca(++_0x2a63ec);}(_0x7a38,0x14b));var _0x87a3=function(_0x2fe37c,_0x106dcf){_0x2fe37c=_0x2fe37c-0x0;var _0xac935e=_0x7a38[_0x2fe37c];return _0xac935e;};'use strict';var Sequelize=require('sequelize');module[_0x87a3('0x0')]={'context':{'type':Sequelize[_0x87a3('0x1')],'allowNull':![],'unique':_0x87a3('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x87a3('0x1')],'allowNull':![],'unique':_0x87a3('0x2')},'priority':{'type':Sequelize[_0x87a3('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x87a3('0x2')},'tag':{'type':Sequelize[_0x87a3('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x87a3('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x87a3('0x3')](_0x87a3('0x4'),_0x87a3('0x5'),_0x87a3('0x6'),_0x87a3('0x7'),'outbound-fax',_0x87a3('0x8'),_0x87a3('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x87a3('0x1')]},'interval':{'type':Sequelize[_0x87a3('0x1')],'allowNull':![],'defaultValue':_0x87a3('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x87a3('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x87a3('0x1')],'defaultValue':_0x87a3('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3d453a){return this[_0x87a3('0xc')](_0x87a3('0xd'));}},'alias':{'type':Sequelize[_0x87a3('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 0f781a8..7151f25 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 _0x4d2f=['filters','filter','merge','VIRTUAL','includeAll','include','VoiceExtension','findAll','rows','catch','show','params','find','destroy','create','body','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','createRouting','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','type','name','status','error','send','index','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5786f9,_0x59a148){var _0x22c3cf=function(_0x360be2){while(--_0x360be2){_0x5786f9['push'](_0x5786f9['shift']());}};_0x22c3cf(++_0x59a148);}(_0x4d2f,0xda));var _0xf4d2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4d2f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf4d2('0x0'));var Redis=require(_0xf4d2('0x1'));var qs=require(_0xf4d2('0x2'));var logger=require(_0xf4d2('0x3'))(_0xf4d2('0x4'));var config=require(_0xf4d2('0x5'));var db=require(_0xf4d2('0x6'))['db'];config[_0xf4d2('0x7')]=_[_0xf4d2('0x8')](config[_0xf4d2('0x7')],{'host':_0xf4d2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf4d2('0x7')]));require(_0xf4d2('0xa'))[_0xf4d2('0xb')](socket);function respondWithStatusCode(_0x2324c9,_0x4000fb){_0x4000fb=_0x4000fb||0xcc;return function(_0x3cc97a){if(_0x3cc97a){return _0x2324c9[_0xf4d2('0xc')](_0x4000fb);}return _0x2324c9['status'](_0x4000fb)[_0xf4d2('0xd')]();};}function respondWithResult(_0x125638,_0x2cbf71){_0x2cbf71=_0x2cbf71||0xc8;return function(_0x57f500){if(_0x57f500){return _0x125638['status'](_0x2cbf71)['json'](_0x57f500);}};}function respondWithFilteredResult(_0x4b8fed,_0x4f3e0b){return function(_0x47cec6){if(_0x47cec6){var _0x4422cd=typeof _0x4f3e0b[_0xf4d2('0xe')]===_0xf4d2('0xf')&&typeof _0x4f3e0b[_0xf4d2('0x10')]===_0xf4d2('0xf');var _0x2c473b=_0x47cec6['count'];var _0x259615=_0x4422cd?0x0:_0x4f3e0b['offset'];var _0x7982fb=_0x4422cd?_0x47cec6[_0xf4d2('0x11')]:_0x4f3e0b[_0xf4d2('0xe')]+_0x4f3e0b[_0xf4d2('0x10')];var _0x443ed0;if(_0x7982fb>=_0x2c473b){_0x7982fb=_0x2c473b;_0x443ed0=0xc8;}else{_0x443ed0=0xce;}_0x4b8fed['status'](_0x443ed0);return _0x4b8fed[_0xf4d2('0x12')](_0xf4d2('0x13'),_0x259615+'-'+_0x7982fb+'/'+_0x2c473b)[_0xf4d2('0x14')](_0x47cec6);}return null;};}function removeEntity(_0x1e33f7){return function(_0x475112){if(_0x475112){return _0x475112['destroy']()[_0xf4d2('0x15')](function(){var _0x1b100f=_0x475112['get']({'plain':!![]});var _0xa06cf6=[{'name':_0xf4d2('0x16'),'value':_0xf4d2('0x17'),'ignore':![]},{'name':_0xf4d2('0x18'),'value':_0xf4d2('0x19'),'ignore':![]},{'name':_0xf4d2('0x1a'),'value':_0xf4d2('0x1b'),'ignore':![]}];var _0x5794dd=_(_0xa06cf6)['filter']('ignore')[_0xf4d2('0x1c')](_0xf4d2('0x1d'))[_0xf4d2('0x1d')]();if(_[_0xf4d2('0x1e')](_0x5794dd,_0x1b100f[_0xf4d2('0x1f')])){return;}var _0x12f735=_['find'](_0xa06cf6,[_0xf4d2('0x1d'),_0x1b100f['type']])[_0xf4d2('0x20')];return db['UserProfileResource']['destroy']({'where':{'type':_0x12f735,'resourceId':_0x1b100f['id']}})[_0xf4d2('0x15')](function(){return _0x475112;});})[_0xf4d2('0x15')](function(){_0x1e33f7[_0xf4d2('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe53789){return function(_0x588e5a){if(!_0x588e5a){_0xe53789[_0xf4d2('0xc')](0x194);}return _0x588e5a;};}function handleError(_0x145378,_0x3d78c6){_0x3d78c6=_0x3d78c6||0x1f4;return function(_0x42fcc8){logger[_0xf4d2('0x22')](_0x42fcc8['stack']);if(_0x42fcc8[_0xf4d2('0x20')]){delete _0x42fcc8[_0xf4d2('0x20')];}_0x145378[_0xf4d2('0x21')](_0x3d78c6)[_0xf4d2('0x23')](_0x42fcc8);};}exports[_0xf4d2('0x24')]=function(_0x3e8896,_0x2214d5){var _0x7eb6ec={},_0x3ab8ea={},_0x176d3e={'count':0x0,'rows':[]};var _0x4aae6f=_[_0xf4d2('0x1c')](db['VoiceExtension'][_0xf4d2('0x25')],function(_0x5353c7){return{'name':_0x5353c7[_0xf4d2('0x26')],'type':_0x5353c7[_0xf4d2('0x1f')][_0xf4d2('0x27')]};});_0x3ab8ea[_0xf4d2('0x28')]=_['map'](_0x4aae6f,_0xf4d2('0x20'));_0x3ab8ea[_0xf4d2('0x29')]=_[_0xf4d2('0x2a')](_0x3e8896[_0xf4d2('0x29')]);_0x3ab8ea['filters']=_[_0xf4d2('0x2b')](_0x3ab8ea[_0xf4d2('0x28')],_0x3ab8ea[_0xf4d2('0x29')]);_0x7eb6ec[_0xf4d2('0x2c')]=_[_0xf4d2('0x2b')](_0x3ab8ea[_0xf4d2('0x28')],qs[_0xf4d2('0x2d')](_0x3e8896['query'][_0xf4d2('0x2d')]));_0x7eb6ec['attributes']=_0x7eb6ec[_0xf4d2('0x2c')][_0xf4d2('0x2e')]?_0x7eb6ec[_0xf4d2('0x2c')]:_0x3ab8ea[_0xf4d2('0x28')];if(!_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x2f')](_0xf4d2('0x30'))){_0x7eb6ec[_0xf4d2('0x10')]=qs[_0xf4d2('0x10')](_0x3e8896[_0xf4d2('0x29')]['limit']);_0x7eb6ec[_0xf4d2('0xe')]=qs[_0xf4d2('0xe')](_0x3e8896['query']['offset']);}_0x7eb6ec['order']=qs[_0xf4d2('0x31')](_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x31')]);_0x7eb6ec[_0xf4d2('0x32')]=qs['filters'](_[_0xf4d2('0x33')](_0x3e8896['query'],_0x3ab8ea[_0xf4d2('0x34')]),_0x4aae6f);if(_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x35')]){_0x7eb6ec[_0xf4d2('0x32')]=_[_0xf4d2('0x36')](_0x7eb6ec[_0xf4d2('0x32')],{'$or':_[_0xf4d2('0x1c')](_0x4aae6f,function(_0x4905c7){if(_0x4905c7['type']!==_0xf4d2('0x37')){var _0x4221c7={};_0x4221c7[_0x4905c7['name']]={'$like':'%'+_0x3e8896[_0xf4d2('0x29')]['filter']+'%'};return _0x4221c7;}})});}_0x7eb6ec=_['merge']({},_0x7eb6ec,_0x3e8896['options']);var _0x208d79={'where':_0x7eb6ec[_0xf4d2('0x32')]};return db['VoiceExtension']['count'](_0x208d79)[_0xf4d2('0x15')](function(_0x5b7a5f){_0x176d3e[_0xf4d2('0x11')]=_0x5b7a5f;if(_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x38')]){_0x7eb6ec[_0xf4d2('0x39')]=[{'all':!![]}];}return db[_0xf4d2('0x3a')][_0xf4d2('0x3b')](_0x7eb6ec);})[_0xf4d2('0x15')](function(_0x5785a1){_0x176d3e[_0xf4d2('0x3c')]=_0x5785a1;return _0x176d3e;})['then'](respondWithFilteredResult(_0x2214d5,_0x7eb6ec))[_0xf4d2('0x3d')](handleError(_0x2214d5,null));};exports[_0xf4d2('0x3e')]=function(_0x4e6405,_0x182143){var _0x25cfb8={'raw':![],'where':{'id':_0x4e6405[_0xf4d2('0x3f')]['id']}},_0x3cd2d6={};_0x3cd2d6['model']=_[_0xf4d2('0x2a')](db[_0xf4d2('0x3a')]['rawAttributes']);_0x3cd2d6[_0xf4d2('0x29')]=_[_0xf4d2('0x2a')](_0x4e6405[_0xf4d2('0x29')]);_0x3cd2d6['filters']=_[_0xf4d2('0x2b')](_0x3cd2d6[_0xf4d2('0x28')],_0x3cd2d6[_0xf4d2('0x29')]);_0x25cfb8[_0xf4d2('0x2c')]=_[_0xf4d2('0x2b')](_0x3cd2d6[_0xf4d2('0x28')],qs[_0xf4d2('0x2d')](_0x4e6405[_0xf4d2('0x29')][_0xf4d2('0x2d')]));_0x25cfb8[_0xf4d2('0x2c')]=_0x25cfb8[_0xf4d2('0x2c')]['length']?_0x25cfb8['attributes']:_0x3cd2d6['model'];if(_0x4e6405[_0xf4d2('0x29')][_0xf4d2('0x38')]){_0x25cfb8['include']=[{'all':!![]}];}_0x25cfb8=_[_0xf4d2('0x36')]({},_0x25cfb8,_0x4e6405['options']);return db[_0xf4d2('0x3a')][_0xf4d2('0x40')](_0x25cfb8)[_0xf4d2('0x15')](handleEntityNotFound(_0x182143,null))[_0xf4d2('0x15')](respondWithResult(_0x182143,null))[_0xf4d2('0x3d')](handleError(_0x182143,null));};exports[_0xf4d2('0x41')]=function(_0x2efe70,_0x138114){return db[_0xf4d2('0x3a')]['find']({'where':{'id':_0x2efe70[_0xf4d2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x138114,null))[_0xf4d2('0x15')](removeEntity(_0x138114,null))[_0xf4d2('0x3d')](handleError(_0x138114,null));};exports[_0xf4d2('0x42')]=function(_0x39006d,_0x376c21){if(_0x39006d[_0xf4d2('0x43')][_0xf4d2('0x1f')]==='outbound'&&!_['startsWith'](_0x39006d[_0xf4d2('0x43')]['exten'],'_')){_0x39006d[_0xf4d2('0x43')][_0xf4d2('0x44')]='_'[_0xf4d2('0x45')](_0x39006d[_0xf4d2('0x43')]['exten']);}return db[_0xf4d2('0x3a')][_0xf4d2('0x42')](_0x39006d[_0xf4d2('0x43')],{'raw':![]})['then'](function(_0x509663){var _0x4d8082=_0x39006d['user'][_0xf4d2('0x46')]({'plain':!![]});if(!_0x4d8082)throw new Error(_0xf4d2('0x47'));if(_0x4d8082['role']===_0xf4d2('0x48')){var _0x3c5502=_0x509663[_0xf4d2('0x46')]({'plain':!![]});var _0x4653be=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xf4d2('0x18'),'value':_0xf4d2('0x19')},{'name':'InternalRoutes','value':_0xf4d2('0x1b')}];var _0x46fd00=_[_0xf4d2('0x40')](_0x4653be,[_0xf4d2('0x1d'),_0x3c5502[_0xf4d2('0x1f')]])[_0xf4d2('0x20')];return db[_0xf4d2('0x49')][_0xf4d2('0x40')]({'where':{'name':_0x46fd00,'userProfileId':_0x4d8082['userProfileId']},'raw':!![]})['then'](function(_0x39925c){if(_0x39925c&&_0x39925c['autoAssociation']===0x0){return db['UserProfileResource'][_0xf4d2('0x42')]({'name':_0x3c5502[_0xf4d2('0x20')],'resourceId':_0x3c5502['id'],'type':_0x39925c[_0xf4d2('0x20')],'sectionId':_0x39925c['id']},{})[_0xf4d2('0x15')](function(){return _0x509663;});}else{return _0x509663;}})[_0xf4d2('0x3d')](function(_0x46f0b5){logger[_0xf4d2('0x22')](_0xf4d2('0x4a'),_0x46f0b5);throw _0x46f0b5;});}return _0x509663;})[_0xf4d2('0x15')](respondWithResult(_0x376c21,0xc9))['catch'](handleError(_0x376c21,null));};exports[_0xf4d2('0x4b')]=function(_0x588c99,_0xe305c6){if(_0x588c99[_0xf4d2('0x43')]['id']){delete _0x588c99[_0xf4d2('0x43')]['id'];}return db[_0xf4d2('0x3a')][_0xf4d2('0x40')]({'where':{'id':_0x588c99[_0xf4d2('0x3f')]['id']}})[_0xf4d2('0x15')](handleEntityNotFound(_0xe305c6,null))[_0xf4d2('0x15')](function(_0xd9383a){if(_0xd9383a){return db['VoiceExtension'][_0xf4d2('0x4b')](_[_0xf4d2('0x33')](_0x588c99[_0xf4d2('0x43')],['exten','context',_0xf4d2('0x4c'),_0xf4d2('0x4d'),'cutdigits',_0xf4d2('0x4e'),_0xf4d2('0x4f')]),{'where':{'context':_0xd9383a[_0xf4d2('0x50')],'exten':_0xd9383a['exten']},'individualHooks':!![]})[_0xf4d2('0x15')](function(_0x53afaa){return _0x53afaa;});}return null;})[_0xf4d2('0x15')](respondWithStatusCode(_0xe305c6,null))[_0xf4d2('0x3d')](handleError(_0xe305c6,null));};exports[_0xf4d2('0x51')]=function(_0x404261,_0x55f25f){var _0x4dbae8=_0x404261[_0xf4d2('0x3f')]['id'];var _0x3fc8c6=_0x404261[_0xf4d2('0x43')];var _0x2ea762=0xc8;var _0x35ec80=null;return db[_0xf4d2('0x52')][_0xf4d2('0x53')]({'isolationLevel':db[_0xf4d2('0x52')][_0xf4d2('0x54')][_0xf4d2('0x55')]['READ_COMMITTED']},function(_0x2011b2){return db[_0xf4d2('0x3a')][_0xf4d2('0x56')]({'where':{'id':_0x4dbae8},'transaction':_0x2011b2})[_0xf4d2('0x15')](function(_0xf5dc33){if(_0xf5dc33){return db[_0xf4d2('0x3a')][_0xf4d2('0x41')]({'where':{'VoiceExtensionId':_0x4dbae8},'transaction':_0x2011b2})[_0xf4d2('0x15')](function(){var _0x4bfa00=_['map'](_0x3fc8c6,function(_0x188408){_0x188408['VoiceExtensionId']=_0x4dbae8;_0x188408['isApp']=!![];return _0x188408;});return _0xf5dc33[_0xf4d2('0x57')](_0x4bfa00);})[_0xf4d2('0x15')](function(_0x562145){return db[_0xf4d2('0x3a')]['bulkCreate'](_0x562145,{'transaction':_0x2011b2});});}else{_0x2ea762=0x194;_0x35ec80=[];}});})[_0xf4d2('0x15')](function(){if(_0x2ea762!==0x194){return db[_0xf4d2('0x3a')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4dbae8},'order':'cast(priority\x20as\x20unsigned)'})[_0xf4d2('0x15')](function(_0x2f51fe){_0x35ec80=_0x2f51fe;});}})[_0xf4d2('0x3d')](function(_0x151d00){_0x2ea762=0x1f4;logger[_0xf4d2('0x22')](_0x151d00[_0xf4d2('0x58')]);if(_0x151d00[_0xf4d2('0x20')]){delete _0x151d00[_0xf4d2('0x20')];}_0x35ec80=_0x151d00;})[_0xf4d2('0x59')](function(){if(_0x35ec80===null){_0x55f25f[_0xf4d2('0xc')](_0x2ea762);}else{if(_0x2ea762===0x1f4){_0x55f25f[_0xf4d2('0x21')](_0x2ea762)[_0xf4d2('0x23')](_0x35ec80);}else{_0x55f25f[_0xf4d2('0x21')](_0x2ea762)[_0xf4d2('0x14')](_0x35ec80);}}});}; \ No newline at end of file +var _0x2ec4=['includes','type','find','name','then','error','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','VoiceExtension','includeAll','findAll','rows','catch','show','include','destroy','params','create','body','startsWith','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','InternalRoutes','internal','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','findAndCountAll','stack','finally','send','json','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','InboundRoutes','inbound','outbound','filter','ignore','map','value'];(function(_0x204b83,_0x1bc369){var _0x24df77=function(_0x58b355){while(--_0x58b355){_0x204b83['push'](_0x204b83['shift']());}};_0x24df77(++_0x1bc369);}(_0x2ec4,0xa3));var _0x42ec=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x2ec4[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x42ec('0x0'));var Redis=require(_0x42ec('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x42ec('0x2'));var config=require(_0x42ec('0x3'));var db=require(_0x42ec('0x4'))['db'];config[_0x42ec('0x5')]=_[_0x42ec('0x6')](config['redis'],{'host':_0x42ec('0x7'),'port':0x18eb});var socket=require(_0x42ec('0x8'))(new Redis(config[_0x42ec('0x5')]));require('./voiceExtension.socket')[_0x42ec('0x9')](socket);function respondWithStatusCode(_0x5dcbce,_0x57bdf2){_0x57bdf2=_0x57bdf2||0xcc;return function(_0x5b0e0c){if(_0x5b0e0c){return _0x5dcbce[_0x42ec('0xa')](_0x57bdf2);}return _0x5dcbce[_0x42ec('0xb')](_0x57bdf2)[_0x42ec('0xc')]();};}function respondWithResult(_0xd10718,_0x23e763){_0x23e763=_0x23e763||0xc8;return function(_0x2c6827){if(_0x2c6827){return _0xd10718[_0x42ec('0xb')](_0x23e763)['json'](_0x2c6827);}};}function respondWithFilteredResult(_0xf4f04e,_0x452193){return function(_0x38ad53){if(_0x38ad53){var _0x5daef0=typeof _0x452193[_0x42ec('0xd')]===_0x42ec('0xe')&&typeof _0x452193[_0x42ec('0xf')]===_0x42ec('0xe');var _0x599b45=_0x38ad53[_0x42ec('0x10')];var _0x4d9147=_0x5daef0?0x0:_0x452193[_0x42ec('0xd')];var _0x48e17d=_0x5daef0?_0x38ad53[_0x42ec('0x10')]:_0x452193[_0x42ec('0xd')]+_0x452193[_0x42ec('0xf')];var _0x49d84b;if(_0x48e17d>=_0x599b45){_0x48e17d=_0x599b45;_0x49d84b=0xc8;}else{_0x49d84b=0xce;}_0xf4f04e[_0x42ec('0xb')](_0x49d84b);return _0xf4f04e['set'](_0x42ec('0x11'),_0x4d9147+'-'+_0x48e17d+'/'+_0x599b45)['json'](_0x38ad53);}return null;};}function removeEntity(_0xd1ad83){return function(_0x42bb0d){if(_0x42bb0d){return _0x42bb0d['destroy']()['then'](function(){var _0x57612c=_0x42bb0d['get']({'plain':!![]});var _0x33c89a=[{'name':_0x42ec('0x12'),'value':_0x42ec('0x13'),'ignore':![]},{'name':'OutboundRoutes','value':_0x42ec('0x14'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x3e1d0d=_(_0x33c89a)[_0x42ec('0x15')](_0x42ec('0x16'))[_0x42ec('0x17')](_0x42ec('0x18'))['value']();if(_[_0x42ec('0x19')](_0x3e1d0d,_0x57612c[_0x42ec('0x1a')])){return;}var _0x5de099=_[_0x42ec('0x1b')](_0x33c89a,[_0x42ec('0x18'),_0x57612c[_0x42ec('0x1a')]])[_0x42ec('0x1c')];return db['UserProfileResource']['destroy']({'where':{'type':_0x5de099,'resourceId':_0x57612c['id']}})[_0x42ec('0x1d')](function(){return _0x42bb0d;});})[_0x42ec('0x1d')](function(){_0xd1ad83['status'](0xcc)[_0x42ec('0xc')]();});}};}function handleEntityNotFound(_0x28e899){return function(_0x27b7dc){if(!_0x27b7dc){_0x28e899[_0x42ec('0xa')](0x194);}return _0x27b7dc;};}function handleError(_0x42bac6,_0x336e5f){_0x336e5f=_0x336e5f||0x1f4;return function(_0x54de5d){logger[_0x42ec('0x1e')](_0x54de5d['stack']);if(_0x54de5d[_0x42ec('0x1c')]){delete _0x54de5d[_0x42ec('0x1c')];}_0x42bac6[_0x42ec('0xb')](_0x336e5f)['send'](_0x54de5d);};}exports['index']=function(_0x30e6b5,_0x993ec8){var _0x25b40e={},_0x589d3d={},_0x2c8759={'count':0x0,'rows':[]};var _0x540caf=_[_0x42ec('0x17')](db['VoiceExtension'][_0x42ec('0x1f')],function(_0x374c46){return{'name':_0x374c46[_0x42ec('0x20')],'type':_0x374c46[_0x42ec('0x1a')][_0x42ec('0x21')]};});_0x589d3d['model']=_['map'](_0x540caf,_0x42ec('0x1c'));_0x589d3d['query']=_[_0x42ec('0x22')](_0x30e6b5['query']);_0x589d3d[_0x42ec('0x23')]=_[_0x42ec('0x24')](_0x589d3d[_0x42ec('0x25')],_0x589d3d['query']);_0x25b40e[_0x42ec('0x26')]=_[_0x42ec('0x24')](_0x589d3d[_0x42ec('0x25')],qs[_0x42ec('0x27')](_0x30e6b5['query'][_0x42ec('0x27')]));_0x25b40e['attributes']=_0x25b40e[_0x42ec('0x26')][_0x42ec('0x28')]?_0x25b40e[_0x42ec('0x26')]:_0x589d3d['model'];if(!_0x30e6b5[_0x42ec('0x29')][_0x42ec('0x2a')](_0x42ec('0x2b'))){_0x25b40e[_0x42ec('0xf')]=qs[_0x42ec('0xf')](_0x30e6b5[_0x42ec('0x29')][_0x42ec('0xf')]);_0x25b40e[_0x42ec('0xd')]=qs[_0x42ec('0xd')](_0x30e6b5[_0x42ec('0x29')][_0x42ec('0xd')]);}_0x25b40e[_0x42ec('0x2c')]=qs[_0x42ec('0x2d')](_0x30e6b5[_0x42ec('0x29')]['sort']);_0x25b40e[_0x42ec('0x2e')]=qs['filters'](_['pick'](_0x30e6b5[_0x42ec('0x29')],_0x589d3d[_0x42ec('0x23')]),_0x540caf);if(_0x30e6b5[_0x42ec('0x29')][_0x42ec('0x15')]){_0x25b40e[_0x42ec('0x2e')]=_[_0x42ec('0x2f')](_0x25b40e[_0x42ec('0x2e')],{'$or':_[_0x42ec('0x17')](_0x540caf,function(_0x42544c){if(_0x42544c[_0x42ec('0x1a')]!==_0x42ec('0x30')){var _0x52b9f7={};_0x52b9f7[_0x42544c[_0x42ec('0x1c')]]={'$like':'%'+_0x30e6b5[_0x42ec('0x29')][_0x42ec('0x15')]+'%'};return _0x52b9f7;}})});}_0x25b40e=_[_0x42ec('0x2f')]({},_0x25b40e,_0x30e6b5[_0x42ec('0x31')]);var _0x3a029d={'where':_0x25b40e[_0x42ec('0x2e')]};return db[_0x42ec('0x32')][_0x42ec('0x10')](_0x3a029d)[_0x42ec('0x1d')](function(_0x17d55e){_0x2c8759[_0x42ec('0x10')]=_0x17d55e;if(_0x30e6b5[_0x42ec('0x29')][_0x42ec('0x33')]){_0x25b40e['include']=[{'all':!![]}];}return db[_0x42ec('0x32')][_0x42ec('0x34')](_0x25b40e);})['then'](function(_0x11bf7c){_0x2c8759[_0x42ec('0x35')]=_0x11bf7c;return _0x2c8759;})[_0x42ec('0x1d')](respondWithFilteredResult(_0x993ec8,_0x25b40e))[_0x42ec('0x36')](handleError(_0x993ec8,null));};exports[_0x42ec('0x37')]=function(_0x53f686,_0x35f17f){var _0x1f9d7={'raw':![],'where':{'id':_0x53f686['params']['id']}},_0x1eeaf7={};_0x1eeaf7[_0x42ec('0x25')]=_[_0x42ec('0x22')](db[_0x42ec('0x32')][_0x42ec('0x1f')]);_0x1eeaf7[_0x42ec('0x29')]=_[_0x42ec('0x22')](_0x53f686[_0x42ec('0x29')]);_0x1eeaf7['filters']=_['intersection'](_0x1eeaf7[_0x42ec('0x25')],_0x1eeaf7[_0x42ec('0x29')]);_0x1f9d7[_0x42ec('0x26')]=_[_0x42ec('0x24')](_0x1eeaf7[_0x42ec('0x25')],qs[_0x42ec('0x27')](_0x53f686[_0x42ec('0x29')]['fields']));_0x1f9d7[_0x42ec('0x26')]=_0x1f9d7[_0x42ec('0x26')][_0x42ec('0x28')]?_0x1f9d7[_0x42ec('0x26')]:_0x1eeaf7['model'];if(_0x53f686[_0x42ec('0x29')][_0x42ec('0x33')]){_0x1f9d7[_0x42ec('0x38')]=[{'all':!![]}];}_0x1f9d7=_[_0x42ec('0x2f')]({},_0x1f9d7,_0x53f686[_0x42ec('0x31')]);return db[_0x42ec('0x32')][_0x42ec('0x1b')](_0x1f9d7)[_0x42ec('0x1d')](handleEntityNotFound(_0x35f17f,null))[_0x42ec('0x1d')](respondWithResult(_0x35f17f,null))[_0x42ec('0x36')](handleError(_0x35f17f,null));};exports[_0x42ec('0x39')]=function(_0x3aba3d,_0x475a78){return db[_0x42ec('0x32')][_0x42ec('0x1b')]({'where':{'id':_0x3aba3d[_0x42ec('0x3a')]['id']}})[_0x42ec('0x1d')](handleEntityNotFound(_0x475a78,null))[_0x42ec('0x1d')](removeEntity(_0x475a78,null))[_0x42ec('0x36')](handleError(_0x475a78,null));};exports[_0x42ec('0x3b')]=function(_0x5747c5,_0x4540b3){if(_0x5747c5[_0x42ec('0x3c')][_0x42ec('0x1a')]===_0x42ec('0x14')&&!_[_0x42ec('0x3d')](_0x5747c5['body'][_0x42ec('0x3e')],'_')){_0x5747c5['body'][_0x42ec('0x3e')]='_'[_0x42ec('0x3f')](_0x5747c5[_0x42ec('0x3c')][_0x42ec('0x3e')]);}return db[_0x42ec('0x32')][_0x42ec('0x3b')](_0x5747c5[_0x42ec('0x3c')],{'raw':![]})['then'](function(_0xfb8b83){var _0x5e8f95=_0x5747c5[_0x42ec('0x40')][_0x42ec('0x41')]({'plain':!![]});if(!_0x5e8f95)throw new Error(_0x42ec('0x42'));if(_0x5e8f95[_0x42ec('0x43')]===_0x42ec('0x40')){var _0x4283f2=_0xfb8b83[_0x42ec('0x41')]({'plain':!![]});var _0x3eb40b=[{'name':_0x42ec('0x12'),'value':_0x42ec('0x13')},{'name':_0x42ec('0x44'),'value':'outbound'},{'name':_0x42ec('0x45'),'value':_0x42ec('0x46')}];var _0x1cf6bf=_[_0x42ec('0x1b')](_0x3eb40b,[_0x42ec('0x18'),_0x4283f2['type']])[_0x42ec('0x1c')];return db[_0x42ec('0x47')][_0x42ec('0x1b')]({'where':{'name':_0x1cf6bf,'userProfileId':_0x5e8f95[_0x42ec('0x48')]},'raw':!![]})[_0x42ec('0x1d')](function(_0x4662ac){if(_0x4662ac&&_0x4662ac['autoAssociation']===0x0){return db[_0x42ec('0x49')][_0x42ec('0x3b')]({'name':_0x4283f2['name'],'resourceId':_0x4283f2['id'],'type':_0x4662ac[_0x42ec('0x1c')],'sectionId':_0x4662ac['id']},{})[_0x42ec('0x1d')](function(){return _0xfb8b83;});}else{return _0xfb8b83;}})[_0x42ec('0x36')](function(_0x6f3585){logger[_0x42ec('0x1e')](_0x42ec('0x4a'),_0x6f3585);throw _0x6f3585;});}return _0xfb8b83;})[_0x42ec('0x1d')](respondWithResult(_0x4540b3,0xc9))[_0x42ec('0x36')](handleError(_0x4540b3,null));};exports[_0x42ec('0x4b')]=function(_0x22c5cd,_0x1e6cc7){if(_0x22c5cd[_0x42ec('0x3c')]['id']){delete _0x22c5cd[_0x42ec('0x3c')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x22c5cd[_0x42ec('0x3a')]['id']}})[_0x42ec('0x1d')](handleEntityNotFound(_0x1e6cc7,null))[_0x42ec('0x1d')](function(_0x207e33){if(_0x207e33){return db['VoiceExtension'][_0x42ec('0x4b')](_['pick'](_0x22c5cd[_0x42ec('0x3c')],[_0x42ec('0x3e'),_0x42ec('0x4c'),_0x42ec('0x4d'),_0x42ec('0x4e'),_0x42ec('0x4f'),_0x42ec('0x50'),'alias']),{'where':{'context':_0x207e33[_0x42ec('0x4c')],'exten':_0x207e33[_0x42ec('0x3e')]},'individualHooks':!![]})['then'](function(_0x4bf152){return _0x4bf152;});}return null;})[_0x42ec('0x1d')](respondWithStatusCode(_0x1e6cc7,null))[_0x42ec('0x36')](handleError(_0x1e6cc7,null));};exports[_0x42ec('0x51')]=function(_0x4d2e56,_0x114900){var _0x232fc2=_0x4d2e56['params']['id'];var _0x558809=_0x4d2e56[_0x42ec('0x3c')];var _0x2b8f55=0xc8;var _0x795e97=null;return db[_0x42ec('0x52')][_0x42ec('0x53')]({'isolationLevel':db[_0x42ec('0x52')]['Transaction'][_0x42ec('0x54')][_0x42ec('0x55')]},function(_0x107e18){return db['VoiceExtension'][_0x42ec('0x56')]({'where':{'id':_0x232fc2},'transaction':_0x107e18})[_0x42ec('0x1d')](function(_0x2cf851){if(_0x2cf851){return db['VoiceExtension'][_0x42ec('0x39')]({'where':{'VoiceExtensionId':_0x232fc2},'transaction':_0x107e18})['then'](function(){var _0x4402d6=_[_0x42ec('0x17')](_0x558809,function(_0x2a2df3){_0x2a2df3[_0x42ec('0x57')]=_0x232fc2;_0x2a2df3['isApp']=!![];return _0x2a2df3;});return _0x2cf851[_0x42ec('0x58')](_0x4402d6);})[_0x42ec('0x1d')](function(_0x21eb23){return db['VoiceExtension']['bulkCreate'](_0x21eb23,{'transaction':_0x107e18});});}else{_0x2b8f55=0x194;_0x795e97=[];}});})[_0x42ec('0x1d')](function(){if(_0x2b8f55!==0x194){return db[_0x42ec('0x32')][_0x42ec('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x232fc2},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x41364e){_0x795e97=_0x41364e;});}})[_0x42ec('0x36')](function(_0x303a64){_0x2b8f55=0x1f4;logger[_0x42ec('0x1e')](_0x303a64[_0x42ec('0x5a')]);if(_0x303a64[_0x42ec('0x1c')]){delete _0x303a64['name'];}_0x795e97=_0x303a64;})[_0x42ec('0x5b')](function(){if(_0x795e97===null){_0x114900['sendStatus'](_0x2b8f55);}else{if(_0x2b8f55===0x1f4){_0x114900[_0x42ec('0xb')](_0x2b8f55)[_0x42ec('0x5c')](_0x795e97);}else{_0x114900['status'](_0x2b8f55)[_0x42ec('0x5d')](_0x795e97);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 56b7f9b..678fba7 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 _0x998a=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x998a,0xa8));var _0xa998=function(_0x3c1dae,_0xf40459){_0x3c1dae=_0x3c1dae-0x0;var _0x29e521=_0x998a[_0x3c1dae];return _0x29e521;};'use strict';var EventEmitter=require(_0xa998('0x0'));var VoiceExtension=require(_0xa998('0x1'))['db'][_0xa998('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa998('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa998('0x4'),'afterDestroy':_0xa998('0x5')};function emitEvent(_0x2a17a0){return function(_0x18731a,_0x1cb2e7,_0x5f0510){VoiceExtensionEvents[_0xa998('0x6')](_0x2a17a0+':'+_0x18731a['id'],_0x18731a);VoiceExtensionEvents[_0xa998('0x6')](_0x2a17a0,_0x18731a);_0x5f0510(null);};}for(var e in events){if(events[_0xa998('0x7')](e)){var event=events[e];VoiceExtension[_0xa998('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x590c=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit'];(function(_0x54bdb6,_0x14407d){var _0x14bf58=function(_0xd72317){while(--_0xd72317){_0x54bdb6['push'](_0x54bdb6['shift']());}};_0x14bf58(++_0x14407d);}(_0x590c,0xb6));var _0xc590=function(_0x14a041,_0x502e4a){_0x14a041=_0x14a041-0x0;var _0x29ff01=_0x590c[_0x14a041];return _0x29ff01;};'use strict';var EventEmitter=require(_0xc590('0x0'));var VoiceExtension=require(_0xc590('0x1'))['db'][_0xc590('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc590('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc590('0x4'),'afterDestroy':_0xc590('0x5')};function emitEvent(_0x55eabd){return function(_0x108dc3,_0x36e2aa,_0x3778f0){VoiceExtensionEvents[_0xc590('0x6')](_0x55eabd+':'+_0x108dc3['id'],_0x108dc3);VoiceExtensionEvents[_0xc590('0x6')](_0x55eabd,_0x108dc3);_0x3778f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xc590('0x7')](e,emitEvent(event));}}module[_0xc590('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 785a15a..892604f 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 _0x661e=['url','split','name','phone','param','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','intervals','map','filter','toLowerCase','tag','CDR(tag)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','concat','priority','catch','define','get','then','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout'];(function(_0x343bdd,_0x486e08){var _0x33bd12=function(_0xc51289){while(--_0xc51289){_0x343bdd['push'](_0x343bdd['shift']());}};_0x33bd12(++_0x486e08);}(_0x661e,0x7d));var _0xe661=function(_0x3af7d2,_0x19121c){_0x3af7d2=_0x3af7d2-0x0;var _0x41a40c=_0x661e[_0x3af7d2];return _0x41a40c;};'use strict';var _=require('lodash');var attributes=require(_0xe661('0x0'));module[_0xe661('0x1')]=function(_0x514e17){var _0x5a9a94=_0x514e17[_0xe661('0x2')];function _0x2ac6c5(_0x29caa1){var _0x5d412b=0x2;var _0x42cd8f=[{'type':_0x29caa1[_0xe661('0x3')],'app':_0xe661('0x4'),'appdata':'CDR(type)='+_0x29caa1['type'],'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1[_0xe661('0x6')],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']},{'type':_0x29caa1[_0xe661('0x3')],'app':_0x29caa1[_0xe661('0x7')]?_0xe661('0x4'):_0xe661('0x8'),'appdata':_0x29caa1[_0xe661('0x7')]?_0xe661('0x9')+_0x29caa1[_0xe661('0x7')]:_0xe661('0xa'),'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1[_0xe661('0x6')],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']}];if(_0x29caa1['type']===_0xe661('0xb')){_0x42cd8f['push']({'type':_0xe661('0xb'),'app':_0xe661('0x4'),'appdata':_0xe661('0xc')+_0x29caa1['id'],'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1['exten'],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']});}_0x42cd8f[_0xe661('0xd')]({'type':_0x29caa1[_0xe661('0x3')],'app':_0xe661('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x29caa1['context'],'exten':_0x29caa1['exten'],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']},{'type':_0x29caa1['type'],'app':_0xe661('0x4'),'appdata':_0xe661('0xe'),'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1['exten'],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']},{'type':_0x29caa1[_0xe661('0x3')],'app':_0xe661('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1[_0xe661('0x6')],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']});return _0x42cd8f;}function _0x16364d(_0x34cf6d){var _0x124fa0=0x2;var _0x1c8400=[{'type':_0xe661('0xf'),'app':'Set','appdata':_0xe661('0x10'),'context':_0x34cf6d['context'],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':_0x34cf6d[_0xe661('0x7')]?_0xe661('0x4'):'NoOp','appdata':_0x34cf6d[_0xe661('0x7')]?_0xe661('0x9')+_0x34cf6d[_0xe661('0x7')]:_0xe661('0xa'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d['exten'],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':'Set','appdata':'CDR(destination)='+(_0x34cf6d[_0xe661('0x11')]?_0xe661('0x12')+_0x34cf6d[_0xe661('0x11')]+'}':'${EXTEN}'),'context':_0x34cf6d['context'],'exten':_0x34cf6d['exten'],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':_0xe661('0x4'),'appdata':'CDR(routeid)='+_0x34cf6d['id'],'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':_0xe661('0x13'),'appdata':_0xe661('0x14')+(_0x124fa0+0x2)+'):Goto('+(_0x124fa0+0x1)+')','context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':_0xe661('0x4'),'appdata':_0x34cf6d[_0xe661('0x11')]?_0xe661('0x15')+_0x34cf6d[_0xe661('0x11')]+'}':_0xe661('0x16'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':'Set','appdata':_0xe661('0x17'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':_0xe661('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':_0xe661('0x4'),'appdata':_0xe661('0x18'),'context':_0x34cf6d['context'],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':'Set','appdata':_0xe661('0x19')+_0x34cf6d['id'],'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']}];if(_0x34cf6d[_0xe661('0x1a')](_0xe661('0x1b'))&&_0x34cf6d[_0xe661('0x1b')]!==_0xe661('0x1c')){_0x1c8400[_0xe661('0xd')]({'type':'outbound','app':_0xe661('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':'Set','appdata':_0xe661('0x1d')+_0x34cf6d['recordingFormat']||_0xe661('0x1e'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']});}return _0x1c8400;}function _0x13cc59(_0x5eb5e4,_0x5f197a){var _0xa4e1e=[{'name':_0xe661('0x1f'),'param':0x0},{'name':_0xe661('0x20'),'param':0x1},{'name':'options','param':0x2},{'name':_0xe661('0x21'),'param':0x3}];var _0x25e036={};var _0x3d7ee4=_0x5f197a[_0xe661('0x22')](',');var _0x567e7c=[];for(var _0x273115=0x0;_0x273115<_0xa4e1e['length'];_0x273115++){switch(_0xa4e1e[_0x273115][_0xe661('0x23')]){case _0xe661('0x1f'):_0x25e036[_0xe661('0x1f')]=_0x3d7ee4[_0xa4e1e[_0x273115]['param']][_0xe661('0x22')]('/')[0x1];_0x25e036[_0xe661('0x24')]=_0x3d7ee4[_0xa4e1e[_0x273115][_0xe661('0x25')]][_0xe661('0x22')]('/')[0x2];_0x25e036[_0xe661('0x26')]=_0x25e036[_0xe661('0x24')]?_0x25e036[_0xe661('0x24')][_0xe661('0x22')]('$')[0x0]:undefined;_0x25e036[_0xe661('0x24')]=_0x5eb5e4[_0xe661('0x11')]?(_0x25e036['prefix']||'')+_0xe661('0x12')+_0x5eb5e4['cutdigits']+'}':(_0x25e036[_0xe661('0x26')]||'')+'${EXTEN}';_0x567e7c[_0xa4e1e[_0x273115]['param']]=['SIP',_0x25e036[_0xe661('0x1f')],_0x25e036[_0xe661('0x24')]][_0xe661('0x27')]('/');break;case'options':_0x25e036[_0xe661('0x28')]=_0x3d7ee4[_0xa4e1e[_0x273115]['param']];if(_0x5eb5e4[_0xe661('0x1b')]!=='none'){if(_0x25e036[_0xe661('0x28')][_0xe661('0x29')](_0xe661('0x2a'))<0x0){_0x25e036[_0xe661('0x28')]+=_0xe661('0x2a');}}else{_0x25e036[_0xe661('0x28')]=_0x25e036['options'][_0xe661('0x2b')](_0xe661('0x2a'),'');}_0x567e7c[_0xa4e1e[_0x273115][_0xe661('0x25')]]=_0x25e036[_0xe661('0x28')];break;default:_0x567e7c[_0xa4e1e[_0x273115][_0xe661('0x25')]]=_0x3d7ee4[_0xa4e1e[_0x273115][_0xe661('0x25')]];}}return _0x567e7c[_0xe661('0x27')](',');}function _0x55f0ee(_0x5b9fd1,_0x41abdd,_0x4c2370){return new Promise(function(_0x48c221,_0x52f29f){var _0x18d4da=[];if(_['isEmpty'](_0x41abdd))return _0x48c221(_0x18d4da);_0x5a9a94[_0xe661('0x2c')]['findAll']({'attributes':['id',_0xe661('0x2d'),_0xe661('0x2e')],'raw':!![]})['then'](function(_0xdd02ce){for(var _0x1f3d4e=0x0,_0x229b1f=0x0;_0x1f3d4e<_0x41abdd['length'];_0x1f3d4e++,_0x229b1f=0x0){var _0x18c2b9=_0x41abdd[_0x1f3d4e];var _0x5cd903=[];var _0x5bb0a3=[];delete _0x18c2b9['id'];if(_0x18c2b9[_0xe661('0x2d')]!=='*,*,*,*'){_0x18c2b9[_0xe661('0x2f')]=[_0x18c2b9[_0xe661('0x2d')]];}else{_0x18c2b9[_0xe661('0x2f')]=_0x18c2b9[_0xe661('0x2e')]?_[_0xe661('0x30')](_[_0xe661('0x31')](_0xdd02ce,{'IntervalId':_0x18c2b9[_0xe661('0x2e')]}),'interval'):[];}_0x18c2b9[_0xe661('0x5')]=_0x5b9fd1['context'];_0x18c2b9['exten']=_0x5b9fd1[_0xe661('0x6')];if(_0x18c2b9['type'])_0x18c2b9[_0xe661('0x3')]=_0x18c2b9[_0xe661('0x3')][_0xe661('0x32')]();if(_0x5b9fd1['type']===_0xe661('0xf')){if(_0x18c2b9[_0xe661('0x1a')](_0xe661('0x33'))&&_0x18c2b9[_0xe661('0x33')]&&_0x18c2b9[_0xe661('0x33')]!=='--'){_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9['type']['toLowerCase'](),'app':_0xe661('0x4'),'appdata':_0xe661('0x34')+_0x18c2b9['tag'],'context':_0x5b9fd1['context'],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9['intervals'][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9[_0xe661('0x3')][_0xe661('0x32')](),'app':_0xe661('0x13'),'appdata':_0xe661('0x36')+(_0x18c2b9['callerID']?'Set(CALLERID(all)='+_0x18c2b9[_0xe661('0x37')]+')':'NoOp(No\x20number\x20available)'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9[_0xe661('0x2f')]['length']+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}else{if(_0x18c2b9['hasOwnProperty']('answer')){if([_0xe661('0x38'),_0xe661('0x39')][_0xe661('0x3a')](_0x18c2b9[_0xe661('0x3b')][_0xe661('0x32')]())&&_0x18c2b9[_0xe661('0x3c')]!==_0xe661('0x3d')){if(_0x18c2b9[_0xe661('0x3e')]){_0x5cd903['push']({'type':_0x18c2b9[_0xe661('0x3')][_0xe661('0x32')](),'app':_0xe661('0x13'),'appdata':_0xe661('0x3f'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9[_0xe661('0x2f')]['length']+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9['type'][_0xe661('0x32')](),'app':_0xe661('0x4'),'appdata':_0xe661('0x40'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}else{_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9[_0xe661('0x3')]['toLowerCase'](),'app':_0xe661('0x13'),'appdata':_0xe661('0x41'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1['exten'],'priority':_0x18c2b9['intervals'][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});_0x5cd903['push']({'type':_0x18c2b9[_0xe661('0x3')]['toLowerCase'](),'app':_0xe661('0x4'),'appdata':_0xe661('0x42'),'context':_0x5b9fd1['context'],'exten':_0x5b9fd1['exten'],'priority':_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}}}}for(var _0x25be48=0x0;_0x25be48<_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')];_0x25be48++){var _0x38eaab=_0x4c2370+_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')];var _0x5ef4a1=_0x25be48===_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')]-0x1?_0x4c2370+_0x5cd903['length']+_0x5bb0a3['length']+0x2:_0x4c2370+_0x25be48+0x1;_0x5cd903[_0xe661('0x43')](_0x25be48,0x0,{'type':_0x5b9fd1[_0xe661('0x3')],'app':_0xe661('0x44'),'appdata':_0x18c2b9['intervals'][_0x25be48]+'?'+_0x5b9fd1[_0xe661('0x5')]+_0xe661('0x45')+_0x38eaab+':'+_0x5b9fd1[_0xe661('0x5')]+_0xe661('0x45')+_0x5ef4a1,'exten':_0x5b9fd1[_0xe661('0x6')],'context':_0x5b9fd1['context'],'priority':_0x4c2370+_0x25be48,'VoiceExtensionId':_0x5b9fd1['id']});}if(_0x18c2b9[_0xe661('0x3c')]===_0xe661('0x46'))_0x18c2b9[_0xe661('0x47')]=_0x13cc59(_0x5b9fd1,_0x18c2b9['appdata']);_0x18c2b9['priority']=_0x5cd903[_0xe661('0x35')]?_[_0xe661('0x48')](_0x5cd903)['priority']+0x1:_0x4c2370;_0x18d4da=_[_0xe661('0x49')](_0x18d4da,_0x5cd903,[_0x18c2b9],_0x5bb0a3);_0x4c2370=_[_0xe661('0x48')](_0x18d4da)[_0xe661('0x4a')]+0x1;}return _0x48c221(_0x18d4da);})[_0xe661('0x4b')](function(_0xf18686){_0x52f29f(_0xf18686);});});}return _0x514e17[_0xe661('0x4c')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x52801a){var _0x26df44=this[_0xe661('0x4d')]({'plain':!![]});var _0x537346=_0x26df44[_0xe661('0x3')]===_0xe661('0xf')?_0x16364d(_0x26df44):_0x2ac6c5(_0x26df44);return _0x55f0ee(_0x26df44,_0x52801a,_[_0xe661('0x48')](_0x537346)[_0xe661('0x4a')]+0x1)[_0xe661('0x4e')](function(_0x17e1c6){var _0x288227=_['concat'](_0x537346,_0x17e1c6);_0x288227['push']({'type':_0x26df44[_0xe661('0x3')],'app':'Hangup','exten':_0x26df44['exten'],'context':_0x26df44[_0xe661('0x5')],'priority':_[_0xe661('0x48')](_0x288227)[_0xe661('0x4a')]+0x1,'VoiceExtensionId':_0x26df44['id']});return _0x288227;});}}});}; \ No newline at end of file +var _0x556b=['CDR(routeAlias)=','inbound','CDR(routeid)=','push','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','split','name','trunk','phone','prefix','param','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','length','*,*,*,*','intervals','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','playback','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','catch','define','VoiceExtension','voice_extensions','get','last','then','Hangup','lodash','./voiceExtension.attributes','exports','type','context','exten','alias','Set','NoOp'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0x556b,0x1d7));var _0xb556=function(_0x555fc4,_0x20e669){_0x555fc4=_0x555fc4-0x0;var _0x1c74c0=_0x556b[_0x555fc4];return _0x1c74c0;};'use strict';var _=require(_0xb556('0x0'));var attributes=require(_0xb556('0x1'));module[_0xb556('0x2')]=function(_0x3a96e6){var _0x3589ec=_0x3a96e6['models'];function _0xdc5b69(_0x23c794){var _0x4202e0=0x2;var _0x30214e=[{'type':_0x23c794[_0xb556('0x3')],'app':'Set','appdata':'CDR(type)='+_0x23c794['type'],'context':_0x23c794[_0xb556('0x4')],'exten':_0x23c794[_0xb556('0x5')],'priority':_0x4202e0++,'VoiceExtensionId':_0x23c794['id']},{'type':_0x23c794[_0xb556('0x3')],'app':_0x23c794[_0xb556('0x6')]?_0xb556('0x7'):_0xb556('0x8'),'appdata':_0x23c794[_0xb556('0x6')]?_0xb556('0x9')+_0x23c794['alias']:'No\x20alias\x20set','context':_0x23c794[_0xb556('0x4')],'exten':_0x23c794['exten'],'priority':_0x4202e0++,'VoiceExtensionId':_0x23c794['id']}];if(_0x23c794[_0xb556('0x3')]===_0xb556('0xa')){_0x30214e['push']({'type':'inbound','app':_0xb556('0x7'),'appdata':_0xb556('0xb')+_0x23c794['id'],'context':_0x23c794[_0xb556('0x4')],'exten':_0x23c794[_0xb556('0x5')],'priority':_0x4202e0++,'VoiceExtensionId':_0x23c794['id']});}_0x30214e[_0xb556('0xc')]({'type':_0x23c794[_0xb556('0x3')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x23c794[_0xb556('0x4')],'exten':_0x23c794['exten'],'priority':_0x4202e0++,'VoiceExtensionId':_0x23c794['id']},{'type':_0x23c794[_0xb556('0x3')],'app':_0xb556('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x23c794['context'],'exten':_0x23c794[_0xb556('0x5')],'priority':_0x4202e0++,'VoiceExtensionId':_0x23c794['id']},{'type':_0x23c794[_0xb556('0x3')],'app':_0xb556('0x7'),'appdata':_0xb556('0xd'),'context':_0x23c794[_0xb556('0x4')],'exten':_0x23c794[_0xb556('0x5')],'priority':_0x4202e0++,'VoiceExtensionId':_0x23c794['id']});return _0x30214e;}function _0x13677c(_0x81e473){var _0xcfaa19=0x2;var _0x485187=[{'type':_0xb556('0xe'),'app':_0xb556('0x7'),'appdata':_0xb556('0xf'),'context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473['exten'],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':_0xb556('0xe'),'app':_0x81e473[_0xb556('0x6')]?_0xb556('0x7'):_0xb556('0x8'),'appdata':_0x81e473['alias']?_0xb556('0x9')+_0x81e473[_0xb556('0x6')]:_0xb556('0x10'),'context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473['exten'],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':_0xb556('0xe'),'app':_0xb556('0x7'),'appdata':_0xb556('0x11')+(_0x81e473[_0xb556('0x12')]?_0xb556('0x13')+_0x81e473[_0xb556('0x12')]+'}':_0xb556('0x14')),'context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':_0xb556('0xe'),'app':_0xb556('0x7'),'appdata':_0xb556('0xb')+_0x81e473['id'],'context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':_0xb556('0xe'),'app':_0xb556('0x15'),'appdata':_0xb556('0x16')+(_0xcfaa19+0x2)+_0xb556('0x17')+(_0xcfaa19+0x1)+')','context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':_0xb556('0xe'),'app':_0xb556('0x7'),'appdata':_0x81e473['cutdigits']?_0xb556('0x18')+_0x81e473['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x81e473['context'],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':_0xb556('0xe'),'app':_0xb556('0x7'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':'outbound','app':'Set','appdata':_0xb556('0xd'),'context':_0x81e473['context'],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':'outbound','app':_0xb556('0x7'),'appdata':'outboundrouteid='+_0x81e473['id'],'context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']}];if(_0x81e473['hasOwnProperty']('recordingFormat')&&_0x81e473[_0xb556('0x19')]!==_0xb556('0x1a')){_0x485187[_0xb556('0xc')]({'type':'outbound','app':_0xb556('0x7'),'appdata':_0xb556('0x1b'),'context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']},{'type':'outbound','app':_0xb556('0x7'),'appdata':_0xb556('0x1c')+_0x81e473['recordingFormat']||'wav','context':_0x81e473[_0xb556('0x4')],'exten':_0x81e473[_0xb556('0x5')],'priority':_0xcfaa19++,'VoiceExtensionId':_0x81e473['id']});}return _0x485187;}function _0x3a4547(_0x5bdf7b,_0x272ffe){var _0x2af3fa=[{'name':'trunk','param':0x0},{'name':_0xb556('0x1d'),'param':0x1},{'name':_0xb556('0x1e'),'param':0x2},{'name':_0xb556('0x1f'),'param':0x3}];var _0x5e2a69={};var _0x5ace4c=_0x272ffe[_0xb556('0x20')](',');var _0x2db02e=[];for(var _0x28f349=0x0;_0x28f349<_0x2af3fa['length'];_0x28f349++){switch(_0x2af3fa[_0x28f349][_0xb556('0x21')]){case _0xb556('0x22'):_0x5e2a69['trunk']=_0x5ace4c[_0x2af3fa[_0x28f349]['param']][_0xb556('0x20')]('/')[0x1];_0x5e2a69[_0xb556('0x23')]=_0x5ace4c[_0x2af3fa[_0x28f349]['param']]['split']('/')[0x2];_0x5e2a69[_0xb556('0x24')]=_0x5e2a69[_0xb556('0x23')]?_0x5e2a69[_0xb556('0x23')][_0xb556('0x20')]('$')[0x0]:undefined;_0x5e2a69['phone']=_0x5bdf7b[_0xb556('0x12')]?(_0x5e2a69['prefix']||'')+'${EXTEN:'+_0x5bdf7b[_0xb556('0x12')]+'}':(_0x5e2a69[_0xb556('0x24')]||'')+_0xb556('0x14');_0x2db02e[_0x2af3fa[_0x28f349][_0xb556('0x25')]]=[_0xb556('0x26'),_0x5e2a69[_0xb556('0x22')],_0x5e2a69['phone']][_0xb556('0x27')]('/');break;case _0xb556('0x1e'):_0x5e2a69[_0xb556('0x1e')]=_0x5ace4c[_0x2af3fa[_0x28f349][_0xb556('0x25')]];if(_0x5bdf7b[_0xb556('0x19')]!=='none'){if(_0x5e2a69[_0xb556('0x1e')][_0xb556('0x28')]('U(xcally-mixmonitor-context)')<0x0){_0x5e2a69[_0xb556('0x1e')]+=_0xb556('0x29');}}else{_0x5e2a69[_0xb556('0x1e')]=_0x5e2a69[_0xb556('0x1e')][_0xb556('0x2a')](_0xb556('0x29'),'');}_0x2db02e[_0x2af3fa[_0x28f349][_0xb556('0x25')]]=_0x5e2a69['options'];break;default:_0x2db02e[_0x2af3fa[_0x28f349]['param']]=_0x5ace4c[_0x2af3fa[_0x28f349][_0xb556('0x25')]];}}return _0x2db02e[_0xb556('0x27')](',');}function _0x56e797(_0x513ba4,_0x145452,_0xca9189){return new Promise(function(_0x357e75,_0x5934c4){var _0x3dc492=[];if(_['isEmpty'](_0x145452))return _0x357e75(_0x3dc492);_0x3589ec[_0xb556('0x2b')][_0xb556('0x2c')]({'attributes':['id',_0xb556('0x2d'),_0xb556('0x2e')],'raw':!![]})['then'](function(_0x711602){for(var _0x141b73=0x0,_0x4c042f=0x0;_0x141b73<_0x145452[_0xb556('0x2f')];_0x141b73++,_0x4c042f=0x0){var _0xb7f578=_0x145452[_0x141b73];var _0x9737c0=[];var _0x2d23cc=[];delete _0xb7f578['id'];if(_0xb7f578['interval']!==_0xb556('0x30')){_0xb7f578[_0xb556('0x31')]=[_0xb7f578[_0xb556('0x2d')]];}else{_0xb7f578[_0xb556('0x31')]=_0xb7f578['IntervalId']?_['map'](_[_0xb556('0x32')](_0x711602,{'IntervalId':_0xb7f578[_0xb556('0x2e')]}),'interval'):[];}_0xb7f578[_0xb556('0x4')]=_0x513ba4[_0xb556('0x4')];_0xb7f578['exten']=_0x513ba4[_0xb556('0x5')];if(_0xb7f578[_0xb556('0x3')])_0xb7f578[_0xb556('0x3')]=_0xb7f578[_0xb556('0x3')][_0xb556('0x33')]();if(_0x513ba4[_0xb556('0x3')]===_0xb556('0xe')){if(_0xb7f578[_0xb556('0x34')](_0xb556('0x35'))&&_0xb7f578[_0xb556('0x35')]&&_0xb7f578[_0xb556('0x35')]!=='--'){_0x9737c0[_0xb556('0xc')]({'type':_0xb7f578[_0xb556('0x3')][_0xb556('0x33')](),'app':_0xb556('0x7'),'appdata':_0xb556('0x36')+_0xb7f578['tag'],'context':_0x513ba4[_0xb556('0x4')],'exten':_0x513ba4[_0xb556('0x5')],'priority':_0xb7f578['intervals']['length']+_0xca9189+_0x4c042f++,'VoiceExtensionId':_0x513ba4['id']});}_0x9737c0[_0xb556('0xc')]({'type':_0xb7f578[_0xb556('0x3')][_0xb556('0x33')](),'app':_0xb556('0x15'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0xb7f578['callerID']?_0xb556('0x37')+_0xb7f578[_0xb556('0x38')]+')':_0xb556('0x39')),'context':_0x513ba4[_0xb556('0x4')],'exten':_0x513ba4[_0xb556('0x5')],'priority':_0xb7f578[_0xb556('0x31')][_0xb556('0x2f')]+_0xca9189+_0x4c042f++,'VoiceExtensionId':_0x513ba4['id']});}else{if(_0xb7f578[_0xb556('0x34')](_0xb556('0x3a'))){if(['queue',_0xb556('0x3b')]['includes'](_0xb7f578['app'][_0xb556('0x33')]())&&_0xb7f578[_0xb556('0x3c')]!==_0xb556('0x3d')){if(_0xb7f578[_0xb556('0x3a')]){_0x9737c0['push']({'type':_0xb7f578[_0xb556('0x3')][_0xb556('0x33')](),'app':_0xb556('0x15'),'appdata':_0xb556('0x3e'),'context':_0x513ba4[_0xb556('0x4')],'exten':_0x513ba4[_0xb556('0x5')],'priority':_0xb7f578['intervals'][_0xb556('0x2f')]+_0xca9189+_0x4c042f++,'VoiceExtensionId':_0x513ba4['id']});_0x9737c0[_0xb556('0xc')]({'type':_0xb7f578[_0xb556('0x3')]['toLowerCase'](),'app':'Set','appdata':_0xb556('0x3f'),'context':_0x513ba4[_0xb556('0x4')],'exten':_0x513ba4['exten'],'priority':_0xb7f578[_0xb556('0x31')][_0xb556('0x2f')]+_0xca9189+_0x4c042f++,'VoiceExtensionId':_0x513ba4['id']});}else{_0x9737c0[_0xb556('0xc')]({'type':_0xb7f578[_0xb556('0x3')]['toLowerCase'](),'app':_0xb556('0x15'),'appdata':_0xb556('0x40'),'context':_0x513ba4['context'],'exten':_0x513ba4[_0xb556('0x5')],'priority':_0xb7f578[_0xb556('0x31')]['length']+_0xca9189+_0x4c042f++,'VoiceExtensionId':_0x513ba4['id']});_0x9737c0[_0xb556('0xc')]({'type':_0xb7f578[_0xb556('0x3')][_0xb556('0x33')](),'app':_0xb556('0x7'),'appdata':_0xb556('0x41'),'context':_0x513ba4[_0xb556('0x4')],'exten':_0x513ba4['exten'],'priority':_0xb7f578[_0xb556('0x31')]['length']+_0xca9189+_0x4c042f++,'VoiceExtensionId':_0x513ba4['id']});}}}}for(var _0x21c84e=0x0;_0x21c84e<_0xb7f578['intervals'][_0xb556('0x2f')];_0x21c84e++){var _0x14380a=_0xca9189+_0xb7f578[_0xb556('0x31')]['length'];var _0x3e9218=_0x21c84e===_0xb7f578[_0xb556('0x31')][_0xb556('0x2f')]-0x1?_0xca9189+_0x9737c0[_0xb556('0x2f')]+_0x2d23cc['length']+0x2:_0xca9189+_0x21c84e+0x1;_0x9737c0[_0xb556('0x42')](_0x21c84e,0x0,{'type':_0x513ba4[_0xb556('0x3')],'app':_0xb556('0x43'),'appdata':_0xb7f578[_0xb556('0x31')][_0x21c84e]+'?'+_0x513ba4[_0xb556('0x4')]+_0xb556('0x44')+_0x14380a+':'+_0x513ba4['context']+_0xb556('0x44')+_0x3e9218,'exten':_0x513ba4['exten'],'context':_0x513ba4[_0xb556('0x4')],'priority':_0xca9189+_0x21c84e,'VoiceExtensionId':_0x513ba4['id']});}if(_0xb7f578['appType']===_0xb556('0x45'))_0xb7f578[_0xb556('0x46')]=_0x3a4547(_0x513ba4,_0xb7f578[_0xb556('0x46')]);_0xb7f578[_0xb556('0x47')]=_0x9737c0[_0xb556('0x2f')]?_['last'](_0x9737c0)[_0xb556('0x47')]+0x1:_0xca9189;_0x3dc492=_['concat'](_0x3dc492,_0x9737c0,[_0xb7f578],_0x2d23cc);_0xca9189=_['last'](_0x3dc492)[_0xb556('0x47')]+0x1;}return _0x357e75(_0x3dc492);})[_0xb556('0x48')](function(_0x5924c6){_0x5934c4(_0x5924c6);});});}return _0x3a96e6[_0xb556('0x49')](_0xb556('0x4a'),attributes,{'tableName':_0xb556('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4ac0e3){var _0x9d9c16=this[_0xb556('0x4c')]({'plain':!![]});var _0xde8760=_0x9d9c16[_0xb556('0x3')]==='outbound'?_0x13677c(_0x9d9c16):_0xdc5b69(_0x9d9c16);return _0x56e797(_0x9d9c16,_0x4ac0e3,_[_0xb556('0x4d')](_0xde8760)[_0xb556('0x47')]+0x1)[_0xb556('0x4e')](function(_0x260db6){var _0x46deb2=_['concat'](_0xde8760,_0x260db6);_0x46deb2[_0xb556('0xc')]({'type':_0x9d9c16[_0xb556('0x3')],'app':_0xb556('0x4f'),'exten':_0x9d9c16[_0xb556('0x5')],'context':_0x9d9c16['context'],'priority':_[_0xb556('0x4d')](_0x46deb2)[_0xb556('0x47')]+0x1,'VoiceExtensionId':_0x9d9c16['id']});return _0x46deb2;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index be2c8bb..695403d 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 _0xdc97=['GetVoiceExtension','VoiceExtension','findAll','options','limit','include','map','model','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceExtension,\x20%s,\x20%s','message','info','catch'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x33837b,_0x5d0951){_0x33837b=_0x33837b-0x0;var _0x1b50c4=_0xdc97[_0x33837b];return _0x1b50c4;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});config[_0x7dc9('0xa')]=_['defaults'](config['redis'],{'host':_0x7dc9('0xb'),'port':0x18eb});var socket=require(_0x7dc9('0xc'))(new Redis(config[_0x7dc9('0xa')]));require(_0x7dc9('0xd'))[_0x7dc9('0xe')](socket);function respondWithRpcPromise(_0x5ca05b,_0xb2fa2a,_0x44fe24){return new BPromise(function(_0x37dfc,_0x1dc3f7){return client[_0x7dc9('0xf')](_0x5ca05b,_0x44fe24)[_0x7dc9('0x10')](function(_0x1e336a){logger['info']('VoiceExtension,\x20%s,\x20%s',_0xb2fa2a,'request\x20sent');logger['debug'](_0x7dc9('0x11'),_0xb2fa2a,_0x7dc9('0x12'),JSON['stringify'](_0x1e336a));if(_0x1e336a[_0x7dc9('0x13')]){if(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x14')]===0x1f4){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')]['message']);return _0x1dc3f7(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);return _0x37dfc(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}else{logger[_0x7dc9('0x17')]('VoiceExtension,\x20%s,\x20%s',_0xb2fa2a,_0x7dc9('0x12'));_0x37dfc(_0x1e336a['result'][_0x7dc9('0x16')]);}})[_0x7dc9('0x18')](function(_0x5d61d7){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x5d61d7);_0x1dc3f7(_0x5d61d7);});});}exports[_0x7dc9('0x19')]=function(_0x4b2703){var _0x43ec33=this;return new Promise(function(_0x184bfd,_0x2dad65){return db[_0x7dc9('0x1a')][_0x7dc9('0x1b')]({'raw':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703[_0x7dc9('0x1c')]['where']||null:null,'attributes':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703[_0x7dc9('0x1c')]['attributes']||null:null,'limit':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703[_0x7dc9('0x1c')][_0x7dc9('0x1d')]||null:null,'include':_0x4b2703['options']?_0x4b2703[_0x7dc9('0x1c')][_0x7dc9('0x1e')]?_[_0x7dc9('0x1f')](_0x4b2703['options']['include'],function(_0x4b9ba6){return{'model':db[_0x4b9ba6[_0x7dc9('0x20')]],'as':_0x4b9ba6['as'],'attributes':_0x4b9ba6[_0x7dc9('0x21')],'include':_0x4b9ba6['include']?_['map'](_0x4b9ba6[_0x7dc9('0x1e')],function(_0x5afb7d){return{'model':db[_0x5afb7d[_0x7dc9('0x20')]],'as':_0x5afb7d['as'],'attributes':_0x5afb7d[_0x7dc9('0x21')],'include':_0x5afb7d[_0x7dc9('0x1e')]?_[_0x7dc9('0x1f')](_0x5afb7d[_0x7dc9('0x1e')],function(_0x450124){return{'model':db[_0x450124[_0x7dc9('0x20')]],'as':_0x450124['as'],'attributes':_0x450124[_0x7dc9('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7dc9('0x10')](function(_0x3c4379){logger[_0x7dc9('0x17')](_0x7dc9('0x19'),_0x4b2703);logger['debug']('GetVoiceExtension',_0x4b2703,JSON['stringify'](_0x3c4379));_0x184bfd(_0x3c4379);})['catch'](function(_0x4a68f0){logger['error']('GetVoiceExtension',_0x4a68f0['message'],_0x4b2703);_0x2dad65(_0x43ec33[_0x7dc9('0x13')](0x1f4,_0x4a68f0[_0x7dc9('0x16')]));});});}; \ No newline at end of file +var _0xe2bc=['../../config/environment','jayson/promise','client','http','redis','localhost','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceExtension','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xe2bc[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xce2b('0x0'));var util=require('util');var moment=require(_0xce2b('0x1'));var BPromise=require('bluebird');var rs=require(_0xce2b('0x2'));var fs=require('fs');var Redis=require(_0xce2b('0x3'));var db=require(_0xce2b('0x4'))['db'];var utils=require(_0xce2b('0x5'));var logger=require(_0xce2b('0x6'))('rpc');var config=require(_0xce2b('0x7'));var jayson=require(_0xce2b('0x8'));var client=jayson[_0xce2b('0x9')][_0xce2b('0xa')]({'port':0x232a});config[_0xce2b('0xb')]=_['defaults'](config[_0xce2b('0xb')],{'host':_0xce2b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce2b('0xb')]));require(_0xce2b('0xd'))[_0xce2b('0xe')](socket);function respondWithRpcPromise(_0x3786aa,_0x1e5036,_0xc6cdb){return new BPromise(function(_0x3eae6d,_0xa7941){return client[_0xce2b('0xf')](_0x3786aa,_0xc6cdb)[_0xce2b('0x10')](function(_0x47a597){logger[_0xce2b('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x1e5036,_0xce2b('0x12'));logger[_0xce2b('0x13')](_0xce2b('0x14'),_0x1e5036,_0xce2b('0x12'),JSON[_0xce2b('0x15')](_0x47a597));if(_0x47a597[_0xce2b('0x16')]){if(_0x47a597[_0xce2b('0x16')][_0xce2b('0x17')]===0x1f4){logger['error'](_0xce2b('0x18'),_0x1e5036,_0x47a597[_0xce2b('0x16')]['message']);return _0xa7941(_0x47a597['error']['message']);}logger[_0xce2b('0x16')](_0xce2b('0x18'),_0x1e5036,_0x47a597[_0xce2b('0x16')]['message']);return _0x3eae6d(_0x47a597['error'][_0xce2b('0x19')]);}else{logger[_0xce2b('0x11')](_0xce2b('0x18'),_0x1e5036,_0xce2b('0x12'));_0x3eae6d(_0x47a597[_0xce2b('0x1a')][_0xce2b('0x19')]);}})[_0xce2b('0x1b')](function(_0x31316d){logger[_0xce2b('0x16')](_0xce2b('0x18'),_0x1e5036,_0x31316d);_0xa7941(_0x31316d);});});}exports['GetVoiceExtension']=function(_0x192002){var _0x1d888c=this;return new Promise(function(_0x167e55,_0x44c2af){return db[_0xce2b('0x1c')][_0xce2b('0x1d')]({'raw':_0x192002[_0xce2b('0x1e')]?_0x192002[_0xce2b('0x1e')][_0xce2b('0x1f')]===undefined?!![]:![]:!![],'where':_0x192002[_0xce2b('0x1e')]?_0x192002['options'][_0xce2b('0x20')]||null:null,'attributes':_0x192002[_0xce2b('0x1e')]?_0x192002[_0xce2b('0x1e')][_0xce2b('0x21')]||null:null,'limit':_0x192002[_0xce2b('0x1e')]?_0x192002[_0xce2b('0x1e')][_0xce2b('0x22')]||null:null,'include':_0x192002[_0xce2b('0x1e')]?_0x192002[_0xce2b('0x1e')][_0xce2b('0x23')]?_[_0xce2b('0x24')](_0x192002['options']['include'],function(_0x527b03){return{'model':db[_0x527b03[_0xce2b('0x25')]],'as':_0x527b03['as'],'attributes':_0x527b03['attributes'],'include':_0x527b03[_0xce2b('0x23')]?_[_0xce2b('0x24')](_0x527b03['include'],function(_0x60eca0){return{'model':db[_0x60eca0[_0xce2b('0x25')]],'as':_0x60eca0['as'],'attributes':_0x60eca0['attributes'],'include':_0x60eca0[_0xce2b('0x23')]?_[_0xce2b('0x24')](_0x60eca0[_0xce2b('0x23')],function(_0x50a62f){return{'model':db[_0x50a62f['model']],'as':_0x50a62f['as'],'attributes':_0x50a62f[_0xce2b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xce2b('0x10')](function(_0x211b88){logger['info']('GetVoiceExtension',_0x192002);logger[_0xce2b('0x13')](_0xce2b('0x26'),_0x192002,JSON[_0xce2b('0x15')](_0x211b88));_0x167e55(_0x211b88);})['catch'](function(_0x3a8c00){logger[_0xce2b('0x16')](_0xce2b('0x26'),_0x3a8c00[_0xce2b('0x19')],_0x192002);_0x44c2af(_0x1d888c[_0xce2b('0x16')](0x1f4,_0x3a8c00[_0xce2b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 13a7d6f..c97b589 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4e71da,_0x345f22){_0x4e71da=_0x4e71da-0x0;var _0x4190ca=_0x1cb9[_0x4e71da];return _0x4190ca;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x267ecc,_0x184cbd){var _0x240e1e=function(_0x4efdd1){while(--_0x4efdd1){_0x267ecc['push'](_0x267ecc['shift']());}};_0x240e1e(++_0x184cbd);}(_0x0295,0x1f0));var _0x5029=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x0295[_0x5e6bec];return _0x5dc5cf;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index e4f4b9f..df5e153 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 _0x66fa=['isAuthenticated','index','get','/:id','post','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x487d0a,_0x1b7cb4){var _0x3d740c=function(_0xa714f2){while(--_0xa714f2){_0x487d0a['push'](_0x487d0a['shift']());}};_0x3d740c(++_0x1b7cb4);}(_0x66fa,0x117));var _0xa66f=function(_0x44d500,_0x38c8ab){_0x44d500=_0x44d500-0x0;var _0x42c3e3=_0x66fa[_0x44d500];return _0x42c3e3;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./voiceMail.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/messages',auth[_0xa66f('0x9')](),controller['getMessages']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xe')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0xf')]=router; \ No newline at end of file +var _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x57cc24,_0x489aaf){var _0x4ccc33=function(_0x538f68){while(--_0x538f68){_0x57cc24['push'](_0x57cc24['shift']());}};_0x4ccc33(++_0x489aaf);}(_0x4bd3,0x174));var _0x34bd=function(_0x20c612,_0x4599e8){_0x20c612=_0x20c612-0x0;var _0x24dcaa=_0x4bd3[_0x20c612];return _0x24dcaa;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6289ca2..ac0d500 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 _0x6cae=['yes','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','central','ENUM'];(function(_0x16d3e8,_0x3141c4){var _0x212402=function(_0x28ac2c){while(--_0x28ac2c){_0x16d3e8['push'](_0x16d3e8['shift']());}};_0x212402(++_0x3141c4);}(_0x6cae,0x106));var _0xe6ca=function(_0x32fcc6,_0x3fc921){_0x32fcc6=_0x32fcc6-0x0;var _0xa0c08e=_0x6cae[_0x32fcc6];return _0xa0c08e;};'use strict';var Sequelize=require(_0xe6ca('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe6ca('0x1')],'defaultValue':_0xe6ca('0x2'),'unique':_0xe6ca('0x3')},'mailbox':{'type':Sequelize[_0xe6ca('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xe6ca('0x1')]},'fullname':{'type':Sequelize[_0xe6ca('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x30328f){this['setDataValue'](_0xe6ca('0x4'),typeof _0x30328f===_0xe6ca('0x5')&&_0x30328f['trim']()?_0x30328f['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xe6ca('0x1')],'defaultValue':_0xe6ca('0x6')},'attach':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':_0xe6ca('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':_0xe6ca('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe6ca('0x1')]},'callback':{'type':Sequelize[_0xe6ca('0x1')]},'review':{'type':Sequelize['ENUM'](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe6ca('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':_0xe6ca('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xe6ca('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xe6ca('0x1')]},'maxsecs':{'type':Sequelize[_0xe6ca('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe6ca('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe6ca('0xb')](_0xe6ca('0xc'))+_0xe6ca('0xd')+this[_0xe6ca('0xb')](_0xe6ca('0xe'));}}}; \ No newline at end of file +var _0xef6c=['VIRTUAL','fullname','\x20-\x20','exports','STRING','from-voicemail','setDataValue','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x33bc93,_0xcf2d7c){var _0x2bfa36=function(_0x77b0d){while(--_0x77b0d){_0x33bc93['push'](_0x33bc93['shift']());}};_0x2bfa36(++_0xcf2d7c);}(_0xef6c,0x81));var _0xcef6=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xef6c[_0x469a3c];return _0x968f4;};'use strict';var Sequelize=require('sequelize');module[_0xcef6('0x0')]={'customer_id':{'type':Sequelize[_0xcef6('0x1')]},'context':{'type':Sequelize[_0xcef6('0x1')],'defaultValue':_0xcef6('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xcef6('0x1')]},'fullname':{'type':Sequelize[_0xcef6('0x1')]},'email':{'type':Sequelize[_0xcef6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1763de){this[_0xcef6('0x3')]('email',typeof _0x1763de===_0xcef6('0x4')&&_0x1763de[_0xcef6('0x5')]()?_0x1763de[_0xcef6('0x5')]():null);}},'pager':{'type':Sequelize[_0xcef6('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':_0xcef6('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':_0xcef6('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0xcef6('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xcef6('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xcef6('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xcef6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xcef6('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xcef6('0x6')](_0xcef6('0x7'),'no'),'defaultValue':_0xcef6('0x7'),'allowNull':![]},'stamp':{'type':_0xcef6('0x9')},'emailsubject':{'type':Sequelize[_0xcef6('0x1')]},'emailbody':{'type':Sequelize[_0xcef6('0x1')]},'maxsecs':{'type':Sequelize[_0xcef6('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xcef6('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xcef6('0xb')],'get':function(){return this['getDataValue'](_0xcef6('0xc'))+_0xcef6('0xd')+this['getDataValue']('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 033e691..e6252d3 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 _0x4024=['limit','count','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xf5dbed,_0x28884b){var _0x1b102f=function(_0x198396){while(--_0x198396){_0xf5dbed['push'](_0xf5dbed['shift']());}};_0x1b102f(++_0x28884b);}(_0x4024,0x89));var _0x4402=function(_0x30a916,_0x3e2140){_0x30a916=_0x30a916-0x0;var _0x443edd=_0x4024[_0x30a916];return _0x443edd;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['VoiceMail'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['VoiceMail'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':!![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['VoiceMail'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['update']=function(_0xe8a8e9,_0x642ab4){if(_0xe8a8e9[_0x4402('0x44')]['id']){delete _0xe8a8e9[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x642ab4,null))['then'](saveUpdates(_0xe8a8e9[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x642ab4,null))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['destroy']=function(_0x5a076a,_0x258926){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x5a076a[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x258926,null))[_0x4402('0x1f')](removeEntity(_0x258926,null))[_0x4402('0x3c')](handleError(_0x258926,null));};exports[_0x4402('0x4a')]=function(_0x394ac9,_0x3f2599,_0x353679){return db[_0x4402('0x28')][_0x4402('0x4b')]({'where':{'id':_0x394ac9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x3f2599,null))['then'](function(_0xe4530a){var _0x55922e;var _0x3fb9f0={},_0x1e5891={};_0x1e5891[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x4c')][_0x4402('0x29')]);_0x1e5891['query']=_[_0x4402('0x2d')](_0x394ac9[_0x4402('0x2c')]);_0x1e5891[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],_0x1e5891['query']);_0x3fb9f0[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x394ac9[_0x4402('0x2c')][_0x4402('0x30')]));_0x3fb9f0[_0x4402('0x2f')]=_0x3fb9f0[_0x4402('0x2f')]['length']?_0x3fb9f0[_0x4402('0x2f')]:_0x1e5891[_0x4402('0x2b')];if(!_0x394ac9['query'][_0x4402('0x32')](_0x4402('0x33'))){_0x3fb9f0['limit']=qs['limit'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x19')]);_0x3fb9f0[_0x4402('0x17')]=qs['offset'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3fb9f0[_0x4402('0x4d')]=qs['sort'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x34')]);_0x3fb9f0[_0x4402('0x35')]=qs['filters'](_[_0x4402('0x4e')](_0x394ac9[_0x4402('0x2c')],_0x1e5891['filters']));if(_0x394ac9['query'][_0x4402('0x36')]){_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'$or':_['map'](_0x3fb9f0['attributes'],function(_0x432c2e){var _0x42cdd6={};_0x42cdd6[_0x432c2e]={'$like':'%'+_0x394ac9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x42cdd6;})});}_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'mailboxuser':_0xe4530a[_0x4402('0x4f')]});_0x3fb9f0=_[_0x4402('0x38')]({},_0x3fb9f0,_0x394ac9[_0x4402('0x41')]);return db[_0x4402('0x4c')][_0x4402('0x50')](_0x3fb9f0)['then'](respondWithFilteredResult(_0x3f2599,_0x3fb9f0));})[_0x4402('0x3c')](handleError(_0x3f2599,null));}; \ No newline at end of file +var _0xf4eb=['fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','getMessages','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','eml-format','moment','util','path','sox','to-csv','ejs'];(function(_0x128241,_0x277491){var _0x27cbc5=function(_0x3074d5){while(--_0x3074d5){_0x128241['push'](_0x128241['shift']());}};_0x27cbc5(++_0x277491);}(_0xf4eb,0xec));var _0xbf4e=function(_0x29c90d,_0x50cc96){_0x29c90d=_0x29c90d-0x0;var _0x2495c6=_0xf4eb[_0x29c90d];return _0x2495c6;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x21');return db[_0xbf4e('0x22')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1f')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x13')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=_[_0xbf4e('0x28')](db[_0xbf4e('0x29')]['rawAttributes'],function(_0x35c82d){return{'name':_0x35c82d[_0xbf4e('0x2a')],'type':_0x35c82d['type'][_0xbf4e('0x2b')]};});_0x362716[_0xbf4e('0x2c')]=_['map'](_0xc7ca87,_0xbf4e('0x25'));_0x362716['query']=_[_0xbf4e('0x2d')](_0xb8b58e['query']);_0x362716[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],qs[_0xbf4e('0x31')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x1d12e2['attributes']=_0x1d12e2[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x1d12e2[_0xbf4e('0x30')]:_0x362716[_0xbf4e('0x2c')];if(!_0xb8b58e[_0xbf4e('0x32')]['hasOwnProperty']('nolimit')){_0x1d12e2['limit']=qs['limit'](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x18')]);_0x1d12e2[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x32')]['sort']);_0x1d12e2['where']=qs[_0xbf4e('0x2e')](_[_0xbf4e('0x36')](_0xb8b58e[_0xbf4e('0x32')],_0x362716['filters']),_0xc7ca87);if(_0xb8b58e[_0xbf4e('0x32')]['filter']){_0x1d12e2[_0xbf4e('0x37')]=_[_0xbf4e('0x38')](_0x1d12e2[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0xc7ca87,function(_0x5ce339){if(_0x5ce339[_0xbf4e('0x39')]!==_0xbf4e('0x3a')){var _0x3aa308={};_0x3aa308[_0x5ce339[_0xbf4e('0x25')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3b')]+'%'};return _0x3aa308;}})});}_0x1d12e2=_[_0xbf4e('0x38')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3c')]);var _0x29fe9d={'where':_0x1d12e2[_0xbf4e('0x37')]};return db[_0xbf4e('0x29')][_0xbf4e('0x19')](_0x29fe9d)['then'](function(_0x176166){_0x2f3cf8[_0xbf4e('0x19')]=_0x176166;if(_0xb8b58e['query']['includeAll']){_0x1d12e2[_0xbf4e('0x3d')]=[{'all':!![]}];}return db[_0xbf4e('0x29')]['findAll'](_0x1d12e2);})['then'](function(_0x2b1bf4){_0x2f3cf8[_0xbf4e('0x3e')]=_0x2b1bf4;return _0x2f3cf8;})[_0xbf4e('0x1f')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))[_0xbf4e('0x3f')](handleError(_0x498dbd,null));};exports[_0xbf4e('0x40')]=function(_0x3ad0a4,_0x5a03c6){var _0x3ecc15={'raw':!![],'where':{'id':_0x3ad0a4['params']['id']}},_0x7bd91={};_0x7bd91['model']=_['keys'](db['VoiceMail'][_0xbf4e('0x41')]);_0x7bd91['query']=_[_0xbf4e('0x2d')](_0x3ad0a4[_0xbf4e('0x32')]);_0x7bd91['filters']=_['intersection'](_0x7bd91[_0xbf4e('0x2c')],_0x7bd91[_0xbf4e('0x32')]);_0x3ecc15[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x7bd91[_0xbf4e('0x2c')],qs['fields'](_0x3ad0a4[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x3ecc15[_0xbf4e('0x30')]=_0x3ecc15[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x3ecc15[_0xbf4e('0x30')]:_0x7bd91[_0xbf4e('0x2c')];if(_0x3ad0a4[_0xbf4e('0x32')]['includeAll']){_0x3ecc15[_0xbf4e('0x3d')]=[{'all':!![]}];}_0x3ecc15=_[_0xbf4e('0x38')]({},_0x3ecc15,_0x3ad0a4[_0xbf4e('0x3c')]);return db[_0xbf4e('0x29')][_0xbf4e('0x42')](_0x3ecc15)[_0xbf4e('0x1f')](handleEntityNotFound(_0x5a03c6,null))[_0xbf4e('0x1f')](respondWithResult(_0x5a03c6,null))[_0xbf4e('0x3f')](handleError(_0x5a03c6,null));};exports[_0xbf4e('0x43')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x29')][_0xbf4e('0x43')](_0x3447ab[_0xbf4e('0x44')],{})[_0xbf4e('0x1f')](function(_0x2892ce){var _0x10bc23=_0x3447ab['user'][_0xbf4e('0x45')]({'plain':!![]});if(!_0x10bc23)throw new Error(_0xbf4e('0x46'));if(_0x10bc23[_0xbf4e('0x47')]==='user'){var _0x33ab9a=_0x2892ce['get']({'plain':!![]});var _0x4a050e=_0xbf4e('0x21');return db[_0xbf4e('0x48')]['find']({'where':{'name':_0x4a050e,'userProfileId':_0x10bc23[_0xbf4e('0x49')]},'raw':!![]})[_0xbf4e('0x1f')](function(_0x31d779){if(_0x31d779&&_0x31d779[_0xbf4e('0x4a')]===0x0){return db[_0xbf4e('0x22')][_0xbf4e('0x43')]({'name':_0x33ab9a[_0xbf4e('0x25')],'resourceId':_0x33ab9a['id'],'type':_0x31d779[_0xbf4e('0x25')],'sectionId':_0x31d779['id']},{})[_0xbf4e('0x1f')](function(){return _0x2892ce;});}else{return _0x2892ce;}})[_0xbf4e('0x3f')](function(_0x271ad2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271ad2);throw _0x271ad2;});}return _0x2892ce;})[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,0xc9))[_0xbf4e('0x3f')](handleError(_0x2fdba9,null));};exports[_0xbf4e('0x4b')]=function(_0x586f5d,_0x339ce6){if(_0x586f5d[_0xbf4e('0x44')]['id']){delete _0x586f5d['body']['id'];}return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x586f5d['params']['id']}})['then'](handleEntityNotFound(_0x339ce6,null))[_0xbf4e('0x1f')](saveUpdates(_0x586f5d[_0xbf4e('0x44')],null))[_0xbf4e('0x1f')](respondWithResult(_0x339ce6,null))[_0xbf4e('0x3f')](handleError(_0x339ce6,null));};exports[_0xbf4e('0x20')]=function(_0x5ec2d9,_0x242a75){return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x5ec2d9['params']['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x242a75,null))['then'](removeEntity(_0x242a75,null))[_0xbf4e('0x3f')](handleError(_0x242a75,null));};exports[_0xbf4e('0x4c')]=function(_0x3e60e7,_0x16592f,_0xfd54c){return db['VoiceMail']['findOne']({'where':{'id':_0x3e60e7['params']['id']}})['then'](handleEntityNotFound(_0x16592f,null))[_0xbf4e('0x1f')](function(_0x453411){var _0x5cfc26;var _0x200096={},_0x23c335={};_0x23c335[_0xbf4e('0x2c')]=_[_0xbf4e('0x2d')](db[_0xbf4e('0x4d')][_0xbf4e('0x41')]);_0x23c335[_0xbf4e('0x32')]=_['keys'](_0x3e60e7[_0xbf4e('0x32')]);_0x23c335[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x23c335['model'],_0x23c335['query']);_0x200096[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x23c335[_0xbf4e('0x2c')],qs['fields'](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x200096[_0xbf4e('0x30')]=_0x200096[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x200096[_0xbf4e('0x30')]:_0x23c335[_0xbf4e('0x2c')];if(!_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x4e')](_0xbf4e('0x4f'))){_0x200096[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x3e60e7['query'][_0xbf4e('0x18')]);_0x200096['offset']=qs[_0xbf4e('0x16')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x200096[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x35')]);_0x200096[_0xbf4e('0x37')]=qs['filters'](_[_0xbf4e('0x36')](_0x3e60e7[_0xbf4e('0x32')],_0x23c335[_0xbf4e('0x2e')]));if(_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x3b')]){_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0x200096[_0xbf4e('0x30')],function(_0x12f19f){var _0x2c606b={};_0x2c606b[_0x12f19f]={'$like':'%'+_0x3e60e7['query'][_0xbf4e('0x3b')]+'%'};return _0x2c606b;})});}_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'mailboxuser':_0x453411[_0xbf4e('0x50')]});_0x200096=_[_0xbf4e('0x38')]({},_0x200096,_0x3e60e7['options']);return db[_0xbf4e('0x4d')]['findAndCountAll'](_0x200096)['then'](respondWithFilteredResult(_0x16592f,_0x200096));})[_0xbf4e('0x3f')](handleError(_0x16592f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 6fae16d..b0b4bb3 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 _0x7c87=['voice_voicemail','mailbox_context','context','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail'];(function(_0x95dc95,_0x3002fe){var _0x66cc35=function(_0x35355f){while(--_0x35355f){_0x95dc95['push'](_0x95dc95['shift']());}};_0x66cc35(++_0x3002fe);}(_0x7c87,0x78));var _0x77c8=function(_0x12b77c,_0x6bc6a1){_0x12b77c=_0x12b77c-0x0;var _0x47e93e=_0x7c87[_0x12b77c];return _0x47e93e;};'use strict';var _=require(_0x77c8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x77c8('0x1'));var moment=require(_0x77c8('0x2'));var BPromise=require('bluebird');var rp=require(_0x77c8('0x3'));var fs=require('fs');var path=require(_0x77c8('0x4'));var rimraf=require(_0x77c8('0x5'));var config=require(_0x77c8('0x6'));var attributes=require('./voiceMail.attributes');module[_0x77c8('0x7')]=function(_0x5f3b67,_0x212c0d){return _0x5f3b67[_0x77c8('0x8')](_0x77c8('0x9'),attributes,{'tableName':_0x77c8('0xa'),'paranoid':![],'indexes':[{'name':_0x77c8('0xb'),'fields':['mailbox',_0x77c8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ea2=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x21d717,_0x57342b){var _0xfdde90=function(_0x2994d9){while(--_0x2994d9){_0x21d717['push'](_0x21d717['shift']());}};_0xfdde90(++_0x57342b);}(_0x3ea2,0x1c2));var _0x23ea=function(_0x10eb38,_0x2086bd){_0x10eb38=_0x10eb38-0x0;var _0x5af9b5=_0x3ea2[_0x10eb38];return _0x5af9b5;};'use strict';var _=require(_0x23ea('0x0'));var util=require('util');var logger=require(_0x23ea('0x1'))(_0x23ea('0x2'));var moment=require('moment');var BPromise=require(_0x23ea('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x23ea('0x4'));var config=require(_0x23ea('0x5'));var attributes=require(_0x23ea('0x6'));module[_0x23ea('0x7')]=function(_0x4dabc3,_0x4225a9){return _0x4dabc3[_0x23ea('0x8')](_0x23ea('0x9'),attributes,{'tableName':_0x23ea('0xa'),'paranoid':![],'indexes':[{'name':_0x23ea('0xb'),'fields':['mailbox',_0x23ea('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 20a852a..ea80e92 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 _0x6d8f=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x4ecd70,_0x562d3d){var _0x53c2b6=function(_0x75cbec){while(--_0x75cbec){_0x4ecd70['push'](_0x4ecd70['shift']());}};_0x53c2b6(++_0x562d3d);}(_0x6d8f,0x79));var _0xf6d8=function(_0x2174fd,_0x259235){_0x2174fd=_0x2174fd-0x0;var _0x3bfd50=_0x6d8f[_0x2174fd];return _0x3bfd50;};'use strict';var _=require(_0xf6d8('0x0'));var util=require(_0xf6d8('0x1'));var moment=require(_0xf6d8('0x2'));var BPromise=require(_0xf6d8('0x3'));var rs=require(_0xf6d8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6d8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6d8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf6d8('0x7'));var client=jayson[_0xf6d8('0x8')][_0xf6d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aa738,_0xd5ad26,_0x596bdf){return new BPromise(function(_0x4664c2,_0x5a226a){return client[_0xf6d8('0xa')](_0x1aa738,_0x596bdf)[_0xf6d8('0xb')](function(_0x136d3e){logger[_0xf6d8('0xc')](_0xf6d8('0xd'),_0xd5ad26,_0xf6d8('0xe'));logger[_0xf6d8('0xf')](_0xf6d8('0x10'),_0xd5ad26,_0xf6d8('0xe'),JSON[_0xf6d8('0x11')](_0x136d3e));if(_0x136d3e[_0xf6d8('0x12')]){if(_0x136d3e[_0xf6d8('0x12')][_0xf6d8('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0xd5ad26,_0x136d3e[_0xf6d8('0x12')][_0xf6d8('0x14')]);return _0x5a226a(_0x136d3e['error'][_0xf6d8('0x14')]);}logger[_0xf6d8('0x12')](_0xf6d8('0xd'),_0xd5ad26,_0x136d3e[_0xf6d8('0x12')][_0xf6d8('0x14')]);return _0x4664c2(_0x136d3e[_0xf6d8('0x12')]['message']);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0xd5ad26,_0xf6d8('0xe'));_0x4664c2(_0x136d3e[_0xf6d8('0x15')][_0xf6d8('0x14')]);}})[_0xf6d8('0x16')](function(_0x33a2ce){logger[_0xf6d8('0x12')](_0xf6d8('0xd'),_0xd5ad26,_0x33a2ce);_0x5a226a(_0x33a2ce);});});} \ No newline at end of file +var _0xf298=['VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x392bcc,_0x4610b4){var _0x5cf7da=function(_0x5981ac){while(--_0x5981ac){_0x392bcc['push'](_0x392bcc['shift']());}};_0x5cf7da(++_0x4610b4);}(_0xf298,0xf8));var _0x8f29=function(_0x94fb7f,_0x16310b){_0x94fb7f=_0x94fb7f-0x0;var _0x30eb5e=_0xf298[_0x94fb7f];return _0x30eb5e;};'use strict';var _=require(_0x8f29('0x0'));var util=require(_0x8f29('0x1'));var moment=require(_0x8f29('0x2'));var BPromise=require(_0x8f29('0x3'));var rs=require(_0x8f29('0x4'));var fs=require('fs');var Redis=require(_0x8f29('0x5'));var db=require(_0x8f29('0x6'))['db'];var utils=require(_0x8f29('0x7'));var logger=require(_0x8f29('0x8'))(_0x8f29('0x9'));var config=require(_0x8f29('0xa'));var jayson=require(_0x8f29('0xb'));var client=jayson['client'][_0x8f29('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a69c7,_0x314018,_0x1920c8){return new BPromise(function(_0x584fd2,_0x4930d0){return client['request'](_0x4a69c7,_0x1920c8)[_0x8f29('0xd')](function(_0x59630a){logger['info'](_0x8f29('0xe'),_0x314018,_0x8f29('0xf'));logger['debug'](_0x8f29('0x10'),_0x314018,_0x8f29('0xf'),JSON['stringify'](_0x59630a));if(_0x59630a['error']){if(_0x59630a[_0x8f29('0x11')][_0x8f29('0x12')]===0x1f4){logger[_0x8f29('0x11')]('VoiceMail,\x20%s,\x20%s',_0x314018,_0x59630a[_0x8f29('0x11')]['message']);return _0x4930d0(_0x59630a[_0x8f29('0x11')][_0x8f29('0x13')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x314018,_0x59630a[_0x8f29('0x11')][_0x8f29('0x13')]);return _0x584fd2(_0x59630a[_0x8f29('0x11')]['message']);}else{logger[_0x8f29('0x14')](_0x8f29('0xe'),_0x314018,_0x8f29('0xf'));_0x584fd2(_0x59630a['result'][_0x8f29('0x13')]);}})[_0x8f29('0x15')](function(_0x4d1a6c){logger[_0x8f29('0x11')](_0x8f29('0xe'),_0x314018,_0x4d1a6c);_0x4930d0(_0x4d1a6c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index bcb04c9..b27c13d 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 _0x4de0=['index','get','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated'];(function(_0x438150,_0x115ac5){var _0x346964=function(_0x261d14){while(--_0x261d14){_0x438150['push'](_0x438150['shift']());}};_0x346964(++_0x115ac5);}(_0x4de0,0x1c1));var _0x04de=function(_0x5376ea,_0x2c4d7d){_0x5376ea=_0x5376ea-0x0;var _0xee86bb=_0x4de0[_0x5376ea];return _0xee86bb;};'use strict';var multer=require('multer');var util=require(_0x04de('0x0'));var path=require(_0x04de('0x1'));var timeout=require(_0x04de('0x2'));var express=require(_0x04de('0x3'));var router=express[_0x04de('0x4')]();var fs_extra=require(_0x04de('0x5'));var auth=require(_0x04de('0x6'));var interaction=require(_0x04de('0x7'));var config=require(_0x04de('0x8'));var controller=require(_0x04de('0x9'));router['get']('/',auth[_0x04de('0xa')](),controller[_0x04de('0xb')]);router[_0x04de('0xc')](_0x04de('0xd'),auth['isAuthenticated'](),controller[_0x04de('0xe')]);router[_0x04de('0xc')](_0x04de('0xf'),auth[_0x04de('0xa')](),controller[_0x04de('0x10')]);router['post']('/',auth[_0x04de('0xa')](),controller[_0x04de('0x11')]);router[_0x04de('0x12')](_0x04de('0xd'),auth[_0x04de('0xa')](),controller[_0x04de('0x13')]);router[_0x04de('0x14')](_0x04de('0xd'),auth[_0x04de('0xa')](),controller[_0x04de('0x15')]);module[_0x04de('0x16')]=router; \ No newline at end of file +var _0xad42=['put','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','post'];(function(_0x3a5df2,_0x2b5517){var _0x3a65b6=function(_0x4e14db){while(--_0x4e14db){_0x3a5df2['push'](_0x3a5df2['shift']());}};_0x3a65b6(++_0x2b5517);}(_0xad42,0x168));var _0x2ad4=function(_0x1a800e,_0x3bfb01){_0x1a800e=_0x1a800e-0x0;var _0x4eb91e=_0xad42[_0x1a800e];return _0x4eb91e;};'use strict';var multer=require('multer');var util=require(_0x2ad4('0x0'));var path=require('path');var timeout=require(_0x2ad4('0x1'));var express=require(_0x2ad4('0x2'));var router=express[_0x2ad4('0x3')]();var fs_extra=require(_0x2ad4('0x4'));var auth=require(_0x2ad4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2ad4('0x6'));router[_0x2ad4('0x7')]('/',auth[_0x2ad4('0x8')](),controller['index']);router[_0x2ad4('0x7')](_0x2ad4('0x9'),auth[_0x2ad4('0x8')](),controller[_0x2ad4('0xa')]);router[_0x2ad4('0x7')](_0x2ad4('0xb'),auth[_0x2ad4('0x8')](),controller[_0x2ad4('0xc')]);router[_0x2ad4('0xd')]('/',auth[_0x2ad4('0x8')](),controller['create']);router[_0x2ad4('0xe')](_0x2ad4('0x9'),auth[_0x2ad4('0x8')](),controller[_0x2ad4('0xf')]);router['delete']('/:id',auth[_0x2ad4('0x8')](),controller[_0x2ad4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 5974d0a..928ded9 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 _0xd51e=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x1feb91,_0x2d6c7f){var _0x41de30=function(_0x1263df){while(--_0x1263df){_0x1feb91['push'](_0x1feb91['shift']());}};_0x41de30(++_0x2d6c7f);}(_0xd51e,0x1ec));var _0xed51=function(_0x38bf64,_0x1ba17f){_0x38bf64=_0x38bf64-0x0;var _0x417f34=_0xd51e[_0x38bf64];return _0x417f34;};'use strict';var Sequelize=require(_0xed51('0x0'));module['exports']={'name':{'type':Sequelize[_0xed51('0x1')],'get':function(_0x5416cb){return this[_0xed51('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xed51('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xed51('0x5')](_0xed51('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'stamp':{'type':_0xed51('0x7'),'defaultValue':Sequelize[_0xed51('0x8')](_0xed51('0x9'))}}; \ No newline at end of file +var _0x5926=['literal','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5926,0x1cc));var _0x6592=function(_0x147ad9,_0x4719dd){_0x147ad9=_0x147ad9-0x0;var _0x207783=_0x5926[_0x147ad9];return _0x207783;};'use strict';var Sequelize=require('sequelize');module[_0x6592('0x0')]={'name':{'type':Sequelize[_0x6592('0x1')],'get':function(_0x45613e){return this[_0x6592('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x6592('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6592('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x6592('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6592('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6592('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x6592('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6592('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x6592('0x5')](_0x6592('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x6592('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x6592('0x7'),'defaultValue':Sequelize[_0x6592('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 15205b1..f08b975 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 _0x8a3f=['attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','VoiceMailMessage','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav'];(function(_0x59bac2,_0x298ff5){var _0x1c9eae=function(_0xbb9fa1){while(--_0xbb9fa1){_0x59bac2['push'](_0x59bac2['shift']());}};_0x1c9eae(++_0x298ff5);}(_0x8a3f,0xfd));var _0xf8a3=function(_0x2276ea,_0x3c20b7){_0x2276ea=_0x2276ea-0x0;var _0x239c5d=_0x8a3f[_0x2276ea];return _0x239c5d;};'use strict';var emlformat=require(_0xf8a3('0x0'));var rimraf=require(_0xf8a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8a3('0x2'));var rp=require(_0xf8a3('0x3'));var moment=require('moment');var BPromise=require(_0xf8a3('0x4'));var Mustache=require(_0xf8a3('0x5'));var util=require(_0xf8a3('0x6'));var path=require(_0xf8a3('0x7'));var sox=require('sox');var csv=require(_0xf8a3('0x8'));var ejs=require(_0xf8a3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8a3('0xa'));var _=require('lodash');var squel=require(_0xf8a3('0xb'));var crypto=require(_0xf8a3('0xc'));var jsforce=require(_0xf8a3('0xd'));var deskjs=require(_0xf8a3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8a3('0xf'));var Papa=require(_0xf8a3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8a3('0x11'))(_0xf8a3('0x12'));var utils=require(_0xf8a3('0x13'));var config=require(_0xf8a3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8a3('0x15'))['db'];function respondWithStatusCode(_0x5802de,_0x3624bc){_0x3624bc=_0x3624bc||0xcc;return function(_0x201db2){if(_0x201db2){return _0x5802de[_0xf8a3('0x16')](_0x3624bc);}return _0x5802de[_0xf8a3('0x17')](_0x3624bc)[_0xf8a3('0x18')]();};}function respondWithResult(_0x595f3b,_0x565812){_0x565812=_0x565812||0xc8;return function(_0x3c11a7){if(_0x3c11a7){return _0x595f3b['status'](_0x565812)[_0xf8a3('0x19')](_0x3c11a7);}};}function respondWithFilteredResult(_0x5388c1,_0x77be87){return function(_0x5081ea){if(_0x5081ea){var _0x48cf31=typeof _0x77be87['offset']===_0xf8a3('0x1a')&&typeof _0x77be87[_0xf8a3('0x1b')]==='undefined';var _0x17a658=_0x5081ea['count'];var _0x168244=_0x48cf31?0x0:_0x77be87['offset'];var _0x274eed=_0x48cf31?_0x5081ea[_0xf8a3('0x1c')]:_0x77be87[_0xf8a3('0x1d')]+_0x77be87[_0xf8a3('0x1b')];var _0x20bac;if(_0x274eed>=_0x17a658){_0x274eed=_0x17a658;_0x20bac=0xc8;}else{_0x20bac=0xce;}_0x5388c1[_0xf8a3('0x17')](_0x20bac);return _0x5388c1[_0xf8a3('0x1e')](_0xf8a3('0x1f'),_0x168244+'-'+_0x274eed+'/'+_0x17a658)[_0xf8a3('0x19')](_0x5081ea);}return null;};}function patchUpdates(_0x36910d){return function(_0x3c0e5f){try{jsonpatch[_0xf8a3('0x20')](_0x3c0e5f,_0x36910d,!![]);}catch(_0x37a604){return BPromise[_0xf8a3('0x21')](_0x37a604);}return _0x3c0e5f[_0xf8a3('0x22')]();};}function saveUpdates(_0xa8dee4,_0xb21465){return function(_0x269230){if(_0x269230){return _0x269230[_0xf8a3('0x23')](_0xa8dee4)[_0xf8a3('0x24')](function(_0x4ea29d){return _0x4ea29d;});}return null;};}function removeEntity(_0x2d5109,_0x3df1e3){return function(_0x38ef39){if(_0x38ef39){return _0x38ef39[_0xf8a3('0x25')]()['then'](function(){_0x2d5109['status'](0xcc)[_0xf8a3('0x18')]();});}};}function handleEntityNotFound(_0x42746e,_0x3d03d8){return function(_0x146a96){if(!_0x146a96){_0x42746e[_0xf8a3('0x16')](0x194);}return _0x146a96;};}function handleError(_0x401169,_0x620801){_0x620801=_0x620801||0x1f4;return function(_0x415bc8){logger['error'](_0x415bc8['stack']);if(_0x415bc8['name']){delete _0x415bc8[_0xf8a3('0x26')];}_0x401169[_0xf8a3('0x17')](_0x620801)[_0xf8a3('0x27')](_0x415bc8);};}exports[_0xf8a3('0x28')]=function(_0x4672b5,_0x934192){var _0x32f247={},_0x3dd9b2={},_0x40eb07={'count':0x0,'rows':[]};var _0x1b181f=_[_0xf8a3('0x29')](db[_0xf8a3('0x2a')]['rawAttributes'],function(_0x10c017){return{'name':_0x10c017['fieldName'],'type':_0x10c017[_0xf8a3('0x2b')][_0xf8a3('0x2c')]};});_0x3dd9b2[_0xf8a3('0x2d')]=_[_0xf8a3('0x2e')](_[_0xf8a3('0x29')](_0x1b181f,_0xf8a3('0x26')),[_0xf8a3('0x26')]);_0x3dd9b2['query']=_[_0xf8a3('0x2f')](_0x4672b5[_0xf8a3('0x30')]);_0x3dd9b2[_0xf8a3('0x31')]=_[_0xf8a3('0x32')](_0x3dd9b2[_0xf8a3('0x2d')],_0x3dd9b2['query']);_0x32f247['attributes']=_[_0xf8a3('0x32')](_0x3dd9b2['model'],qs[_0xf8a3('0x33')](_0x4672b5[_0xf8a3('0x30')]['fields']));_0x32f247['attributes']=_0x32f247[_0xf8a3('0x34')][_0xf8a3('0x35')]?_0x32f247[_0xf8a3('0x34')]:_0x3dd9b2[_0xf8a3('0x2d')];if(!_0x4672b5[_0xf8a3('0x30')]['hasOwnProperty']('nolimit')){_0x32f247[_0xf8a3('0x1b')]=qs[_0xf8a3('0x1b')](_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x1b')]);_0x32f247[_0xf8a3('0x1d')]=qs['offset'](_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x1d')]);}_0x32f247[_0xf8a3('0x36')]=qs[_0xf8a3('0x37')](_0x4672b5['query']['sort']);_0x32f247[_0xf8a3('0x38')]=qs['filters'](_[_0xf8a3('0x39')](_0x4672b5['query'],_0x3dd9b2[_0xf8a3('0x31')]),_0x1b181f);if(_0x4672b5[_0xf8a3('0x30')]['filter']){_0x32f247[_0xf8a3('0x38')]=_[_0xf8a3('0x3a')](_0x32f247[_0xf8a3('0x38')],{'$or':_[_0xf8a3('0x29')](_0x1b181f,function(_0x4820ba){if(_0x4820ba[_0xf8a3('0x2b')]!=='VIRTUAL'){var _0x46a7ed={};_0x46a7ed[_0x4820ba[_0xf8a3('0x26')]]={'$like':'%'+_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x3b')]+'%'};return _0x46a7ed;}})});}_0x32f247=_['merge']({},_0x32f247,_0x4672b5[_0xf8a3('0x3c')]);var _0x1e6bfd={'where':_0x32f247[_0xf8a3('0x38')]};return db[_0xf8a3('0x2a')][_0xf8a3('0x1c')](_0x1e6bfd)['then'](function(_0x3affde){_0x40eb07[_0xf8a3('0x1c')]=_0x3affde;if(_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x3d')]){_0x32f247[_0xf8a3('0x3e')]=[{'all':!![]}];}return db[_0xf8a3('0x2a')][_0xf8a3('0x3f')](_0x32f247);})[_0xf8a3('0x24')](function(_0x416d9b){_0x40eb07[_0xf8a3('0x40')]=_0x416d9b;return _0x40eb07;})[_0xf8a3('0x24')](respondWithFilteredResult(_0x934192,_0x32f247))[_0xf8a3('0x41')](handleError(_0x934192,null));};exports[_0xf8a3('0x42')]=function(_0x6fff99,_0x4b54c5){var _0x31646d={'raw':!![],'where':{'id':_0x6fff99[_0xf8a3('0x43')]['id']}},_0x5934ca={};_0x5934ca[_0xf8a3('0x2d')]=_[_0xf8a3('0x2f')](db[_0xf8a3('0x2a')][_0xf8a3('0x44')]);_0x5934ca[_0xf8a3('0x30')]=_['keys'](_0x6fff99['query']);_0x5934ca[_0xf8a3('0x31')]=_[_0xf8a3('0x32')](_0x5934ca[_0xf8a3('0x2d')],_0x5934ca[_0xf8a3('0x30')]);_0x31646d[_0xf8a3('0x34')]=_[_0xf8a3('0x32')](_0x5934ca['model'],qs[_0xf8a3('0x33')](_0x6fff99[_0xf8a3('0x30')][_0xf8a3('0x33')]));_0x31646d[_0xf8a3('0x34')]=_0x31646d[_0xf8a3('0x34')][_0xf8a3('0x35')]?_0x31646d[_0xf8a3('0x34')]:_0x5934ca[_0xf8a3('0x2d')];if(_0x6fff99[_0xf8a3('0x30')][_0xf8a3('0x3d')]){_0x31646d[_0xf8a3('0x3e')]=[{'all':!![]}];}_0x31646d=_[_0xf8a3('0x3a')]({},_0x31646d,_0x6fff99[_0xf8a3('0x3c')]);return db['VoiceMailMessage'][_0xf8a3('0x45')](_0x31646d)[_0xf8a3('0x24')](handleEntityNotFound(_0x4b54c5,null))[_0xf8a3('0x24')](respondWithResult(_0x4b54c5,null))[_0xf8a3('0x41')](handleError(_0x4b54c5,null));};exports['create']=function(_0x58df3c,_0x43a4bc){return db[_0xf8a3('0x2a')][_0xf8a3('0x46')](_0x58df3c[_0xf8a3('0x47')],{})[_0xf8a3('0x24')](respondWithResult(_0x43a4bc,0xc9))[_0xf8a3('0x41')](handleError(_0x43a4bc,null));};exports['update']=function(_0x1adc52,_0x1253b5){if(_0x1adc52[_0xf8a3('0x47')]['id']){delete _0x1adc52[_0xf8a3('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x1adc52[_0xf8a3('0x43')]['id']}})['then'](handleEntityNotFound(_0x1253b5,null))[_0xf8a3('0x24')](saveUpdates(_0x1adc52[_0xf8a3('0x47')],null))[_0xf8a3('0x24')](respondWithResult(_0x1253b5,null))[_0xf8a3('0x41')](handleError(_0x1253b5,null));};exports[_0xf8a3('0x25')]=function(_0x1cf038,_0x84e279){return db[_0xf8a3('0x2a')][_0xf8a3('0x45')]({'where':{'id':_0x1cf038['params']['id']}})[_0xf8a3('0x24')](handleEntityNotFound(_0x84e279,null))[_0xf8a3('0x24')](removeEntity(_0x84e279,null))[_0xf8a3('0x41')](handleError(_0x84e279,null));};exports[_0xf8a3('0x48')]=function(_0xe9d239,_0x35ab85,_0x2e7d12){return db[_0xf8a3('0x2a')][_0xf8a3('0x45')]({'where':{'id':_0xe9d239[_0xf8a3('0x43')]['id']},'attributes':['id',_0xf8a3('0x49'),_0xf8a3('0x4a')]})[_0xf8a3('0x24')](handleEntityNotFound(_0x35ab85,null))['then'](function(_0xb47b6){if(_0xb47b6){if(!_0xb47b6[_0xf8a3('0x49')]){throw new db[(_0xf8a3('0x4b'))][(_0xf8a3('0x4c'))](_0xf8a3('0x4d'));}var _0x4ce969={'Content-Type':_0xf8a3('0x4e'),'Content-Disposition':_0xf8a3('0x4f')};if(_0xb47b6[_0xf8a3('0x4a')]){_0x4ce969[_0xf8a3('0x50')]=_0xf8a3('0x51')+_0xb47b6['msg_id']+_0xf8a3('0x52');}_0x35ab85[_0xf8a3('0x1e')](_0x4ce969);return _0x35ab85[_0xf8a3('0x27')](new Buffer(_0xb47b6[_0xf8a3('0x49')]));}})[_0xf8a3('0x41')](handleError(_0x35ab85,null));}; \ No newline at end of file +var _0x4962=['fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','find','create','body','params','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes'];(function(_0x3fc6fd,_0x3f9081){var _0x1387c9=function(_0x2dc72b){while(--_0x2dc72b){_0x3fc6fd['push'](_0x3fc6fd['shift']());}};_0x1387c9(++_0x3f9081);}(_0x4962,0x1a9));var _0x2496=function(_0xef1e4c,_0x5cb9ae){_0xef1e4c=_0xef1e4c-0x0;var _0x203904=_0x4962[_0xef1e4c];return _0x203904;};'use strict';var emlformat=require(_0x2496('0x0'));var rimraf=require(_0x2496('0x1'));var zipdir=require(_0x2496('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2496('0x3'));var path=require(_0x2496('0x4'));var sox=require(_0x2496('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2496('0x6'));var _=require(_0x2496('0x7'));var squel=require(_0x2496('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2496('0x9'));var toCsv=require(_0x2496('0xa'));var querystring=require(_0x2496('0xb'));var Papa=require(_0x2496('0xc'));var Redis=require(_0x2496('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2496('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2496('0xf'));var logger=require(_0x2496('0x10'))(_0x2496('0x11'));var utils=require('../../config/utils');var config=require(_0x2496('0x12'));var licenseUtil=require(_0x2496('0x13'));var db=require(_0x2496('0x14'))['db'];function respondWithStatusCode(_0x52d3fe,_0x24b39c){_0x24b39c=_0x24b39c||0xcc;return function(_0x4abea7){if(_0x4abea7){return _0x52d3fe[_0x2496('0x15')](_0x24b39c);}return _0x52d3fe[_0x2496('0x16')](_0x24b39c)[_0x2496('0x17')]();};}function respondWithResult(_0x409b5d,_0x1349fe){_0x1349fe=_0x1349fe||0xc8;return function(_0x30898d){if(_0x30898d){return _0x409b5d[_0x2496('0x16')](_0x1349fe)[_0x2496('0x18')](_0x30898d);}};}function respondWithFilteredResult(_0x18577a,_0x4822da){return function(_0x4d98f6){if(_0x4d98f6){var _0x2a715c=typeof _0x4822da[_0x2496('0x19')]==='undefined'&&typeof _0x4822da['limit']==='undefined';var _0x40787c=_0x4d98f6[_0x2496('0x1a')];var _0x1686d5=_0x2a715c?0x0:_0x4822da['offset'];var _0x55b61f=_0x2a715c?_0x4d98f6['count']:_0x4822da['offset']+_0x4822da['limit'];var _0x75adde;if(_0x55b61f>=_0x40787c){_0x55b61f=_0x40787c;_0x75adde=0xc8;}else{_0x75adde=0xce;}_0x18577a[_0x2496('0x16')](_0x75adde);return _0x18577a[_0x2496('0x1b')](_0x2496('0x1c'),_0x1686d5+'-'+_0x55b61f+'/'+_0x40787c)[_0x2496('0x18')](_0x4d98f6);}return null;};}function patchUpdates(_0x1738fd){return function(_0x5e46ef){try{jsonpatch['apply'](_0x5e46ef,_0x1738fd,!![]);}catch(_0x368224){return BPromise[_0x2496('0x1d')](_0x368224);}return _0x5e46ef[_0x2496('0x1e')]();};}function saveUpdates(_0x3f54fe,_0x4aea83){return function(_0x4644c6){if(_0x4644c6){return _0x4644c6[_0x2496('0x1f')](_0x3f54fe)[_0x2496('0x20')](function(_0x263ae8){return _0x263ae8;});}return null;};}function removeEntity(_0x113e52,_0x132959){return function(_0x366c98){if(_0x366c98){return _0x366c98[_0x2496('0x21')]()[_0x2496('0x20')](function(){_0x113e52[_0x2496('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8dff4e,_0x47aa88){return function(_0x5526c3){if(!_0x5526c3){_0x8dff4e[_0x2496('0x15')](0x194);}return _0x5526c3;};}function handleError(_0x64022c,_0x3c0f65){_0x3c0f65=_0x3c0f65||0x1f4;return function(_0x39cd9b){logger['error'](_0x39cd9b[_0x2496('0x22')]);if(_0x39cd9b[_0x2496('0x23')]){delete _0x39cd9b[_0x2496('0x23')];}_0x64022c[_0x2496('0x16')](_0x3c0f65)['send'](_0x39cd9b);};}exports['index']=function(_0x4c0786,_0x5bb836){var _0x3d6b69={},_0x4fdf8b={},_0x4a675b={'count':0x0,'rows':[]};var _0x3ab7fc=_[_0x2496('0x24')](db[_0x2496('0x25')][_0x2496('0x26')],function(_0x5187b5){return{'name':_0x5187b5[_0x2496('0x27')],'type':_0x5187b5[_0x2496('0x28')][_0x2496('0x29')]};});_0x4fdf8b[_0x2496('0x2a')]=_[_0x2496('0x2b')](_[_0x2496('0x24')](_0x3ab7fc,'name'),[_0x2496('0x23')]);_0x4fdf8b[_0x2496('0x2c')]=_[_0x2496('0x2d')](_0x4c0786[_0x2496('0x2c')]);_0x4fdf8b[_0x2496('0x2e')]=_[_0x2496('0x2f')](_0x4fdf8b[_0x2496('0x2a')],_0x4fdf8b[_0x2496('0x2c')]);_0x3d6b69[_0x2496('0x30')]=_[_0x2496('0x2f')](_0x4fdf8b[_0x2496('0x2a')],qs[_0x2496('0x31')](_0x4c0786[_0x2496('0x2c')][_0x2496('0x31')]));_0x3d6b69[_0x2496('0x30')]=_0x3d6b69[_0x2496('0x30')][_0x2496('0x32')]?_0x3d6b69[_0x2496('0x30')]:_0x4fdf8b[_0x2496('0x2a')];if(!_0x4c0786[_0x2496('0x2c')][_0x2496('0x33')](_0x2496('0x34'))){_0x3d6b69[_0x2496('0x35')]=qs[_0x2496('0x35')](_0x4c0786[_0x2496('0x2c')][_0x2496('0x35')]);_0x3d6b69['offset']=qs[_0x2496('0x19')](_0x4c0786[_0x2496('0x2c')][_0x2496('0x19')]);}_0x3d6b69[_0x2496('0x36')]=qs[_0x2496('0x37')](_0x4c0786[_0x2496('0x2c')]['sort']);_0x3d6b69[_0x2496('0x38')]=qs[_0x2496('0x2e')](_[_0x2496('0x39')](_0x4c0786['query'],_0x4fdf8b['filters']),_0x3ab7fc);if(_0x4c0786[_0x2496('0x2c')]['filter']){_0x3d6b69[_0x2496('0x38')]=_[_0x2496('0x3a')](_0x3d6b69[_0x2496('0x38')],{'$or':_[_0x2496('0x24')](_0x3ab7fc,function(_0x1ee1e6){if(_0x1ee1e6[_0x2496('0x28')]!=='VIRTUAL'){var _0x26b911={};_0x26b911[_0x1ee1e6['name']]={'$like':'%'+_0x4c0786[_0x2496('0x2c')][_0x2496('0x3b')]+'%'};return _0x26b911;}})});}_0x3d6b69=_[_0x2496('0x3a')]({},_0x3d6b69,_0x4c0786[_0x2496('0x3c')]);var _0x12e288={'where':_0x3d6b69[_0x2496('0x38')]};return db[_0x2496('0x25')][_0x2496('0x1a')](_0x12e288)[_0x2496('0x20')](function(_0x54e263){_0x4a675b[_0x2496('0x1a')]=_0x54e263;if(_0x4c0786['query'][_0x2496('0x3d')]){_0x3d6b69[_0x2496('0x3e')]=[{'all':!![]}];}return db[_0x2496('0x25')][_0x2496('0x3f')](_0x3d6b69);})['then'](function(_0x1d6a3e){_0x4a675b[_0x2496('0x40')]=_0x1d6a3e;return _0x4a675b;})[_0x2496('0x20')](respondWithFilteredResult(_0x5bb836,_0x3d6b69))[_0x2496('0x41')](handleError(_0x5bb836,null));};exports['show']=function(_0x2637c6,_0x4b58f9){var _0x5cd5b6={'raw':!![],'where':{'id':_0x2637c6['params']['id']}},_0x5155d6={};_0x5155d6[_0x2496('0x2a')]=_[_0x2496('0x2d')](db[_0x2496('0x25')][_0x2496('0x26')]);_0x5155d6[_0x2496('0x2c')]=_[_0x2496('0x2d')](_0x2637c6[_0x2496('0x2c')]);_0x5155d6[_0x2496('0x2e')]=_['intersection'](_0x5155d6[_0x2496('0x2a')],_0x5155d6[_0x2496('0x2c')]);_0x5cd5b6[_0x2496('0x30')]=_[_0x2496('0x2f')](_0x5155d6[_0x2496('0x2a')],qs[_0x2496('0x31')](_0x2637c6['query'][_0x2496('0x31')]));_0x5cd5b6[_0x2496('0x30')]=_0x5cd5b6[_0x2496('0x30')][_0x2496('0x32')]?_0x5cd5b6['attributes']:_0x5155d6[_0x2496('0x2a')];if(_0x2637c6[_0x2496('0x2c')][_0x2496('0x3d')]){_0x5cd5b6[_0x2496('0x3e')]=[{'all':!![]}];}_0x5cd5b6=_['merge']({},_0x5cd5b6,_0x2637c6[_0x2496('0x3c')]);return db[_0x2496('0x25')][_0x2496('0x42')](_0x5cd5b6)[_0x2496('0x20')](handleEntityNotFound(_0x4b58f9,null))[_0x2496('0x20')](respondWithResult(_0x4b58f9,null))[_0x2496('0x41')](handleError(_0x4b58f9,null));};exports[_0x2496('0x43')]=function(_0x4496b6,_0x3a88a7){return db[_0x2496('0x25')][_0x2496('0x43')](_0x4496b6[_0x2496('0x44')],{})['then'](respondWithResult(_0x3a88a7,0xc9))[_0x2496('0x41')](handleError(_0x3a88a7,null));};exports[_0x2496('0x1f')]=function(_0x7cfde3,_0x51d586){if(_0x7cfde3[_0x2496('0x44')]['id']){delete _0x7cfde3[_0x2496('0x44')]['id'];}return db[_0x2496('0x25')][_0x2496('0x42')]({'where':{'id':_0x7cfde3[_0x2496('0x45')]['id']}})[_0x2496('0x20')](handleEntityNotFound(_0x51d586,null))[_0x2496('0x20')](saveUpdates(_0x7cfde3[_0x2496('0x44')],null))['then'](respondWithResult(_0x51d586,null))[_0x2496('0x41')](handleError(_0x51d586,null));};exports[_0x2496('0x21')]=function(_0x12d2ba,_0x433b71){return db[_0x2496('0x25')]['find']({'where':{'id':_0x12d2ba[_0x2496('0x45')]['id']}})[_0x2496('0x20')](handleEntityNotFound(_0x433b71,null))[_0x2496('0x20')](removeEntity(_0x433b71,null))['catch'](handleError(_0x433b71,null));};exports['download']=function(_0x2210c9,_0x80f56,_0x52e3bc){return db[_0x2496('0x25')][_0x2496('0x42')]({'where':{'id':_0x2210c9[_0x2496('0x45')]['id']},'attributes':['id',_0x2496('0x46'),'msg_id']})[_0x2496('0x20')](handleEntityNotFound(_0x80f56,null))[_0x2496('0x20')](function(_0x2fac5b){if(_0x2fac5b){if(!_0x2fac5b[_0x2496('0x46')]){throw new db['Sequelize'][(_0x2496('0x47'))](_0x2496('0x48'));}var _0x33b387={'Content-Type':_0x2496('0x49'),'Content-Disposition':_0x2496('0x4a')};if(_0x2fac5b[_0x2496('0x4b')]){_0x33b387['Content-Disposition']=_0x2496('0x4c')+_0x2fac5b[_0x2496('0x4b')]+_0x2496('0x4d');}_0x80f56[_0x2496('0x1b')](_0x33b387);return _0x80f56[_0x2496('0x4e')](new Buffer(_0x2fac5b[_0x2496('0x46')]));}})[_0x2496('0x41')](handleError(_0x80f56,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 22a4795..6a83fe6 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 _0x3cb7=['voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceMailMessage'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0x3cb7,0x1f0));var _0x73cb=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x3cb7[_0x2d982d];return _0x4f36b0;};'use strict';var _=require('lodash');var util=require(_0x73cb('0x0'));var logger=require(_0x73cb('0x1'))(_0x73cb('0x2'));var moment=require(_0x73cb('0x3'));var BPromise=require(_0x73cb('0x4'));var rp=require(_0x73cb('0x5'));var fs=require('fs');var path=require(_0x73cb('0x6'));var rimraf=require(_0x73cb('0x7'));var config=require(_0x73cb('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x73cb('0x9')]=function(_0x36a4f2,_0x17e1a2){return _0x36a4f2['define'](_0x73cb('0xa'),attributes,{'tableName':_0x73cb('0xb'),'paranoid':![],'indexes':[{'name':_0x73cb('0xc'),'fields':[_0x73cb('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7cde=['api','bluebird','request-promise','./voiceMailMessage.attributes','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x5346ca,_0x3c7aea){var _0x527679=function(_0xd7cde1){while(--_0xd7cde1){_0x5346ca['push'](_0x5346ca['shift']());}};_0x527679(++_0x3c7aea);}(_0x7cde,0x1c9));var _0xe7cd=function(_0x4cead9,_0x5be9fd){_0x4cead9=_0x4cead9-0x0;var _0x4e935e=_0x7cde[_0x4cead9];return _0x4e935e;};'use strict';var _=require(_0xe7cd('0x0'));var util=require(_0xe7cd('0x1'));var logger=require('../../config/logger')(_0xe7cd('0x2'));var moment=require('moment');var BPromise=require(_0xe7cd('0x3'));var rp=require(_0xe7cd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7cd('0x5'));module['exports']=function(_0x4557a2,_0x4601a7){return _0x4557a2['define'](_0xe7cd('0x6'),attributes,{'tableName':_0xe7cd('0x7'),'paranoid':![],'indexes':[{'name':_0xe7cd('0x8'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 8266a2f..6982152 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 _0x4e65=['../../config/environment','jayson/promise','client','http','request','then','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceMailMessage,\x20%s,\x20%s','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5a5c6b,_0x5baa12){var _0x5e24fc=function(_0x436b7a){while(--_0x436b7a){_0x5a5c6b['push'](_0x5a5c6b['shift']());}};_0x5e24fc(++_0x5baa12);}(_0x4e65,0x64));var _0x54e6=function(_0x3c05f3,_0x3f3ddf){_0x3c05f3=_0x3c05f3-0x0;var _0x13cacb=_0x4e65[_0x3c05f3];return _0x13cacb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x54e6('0x0'));var BPromise=require(_0x54e6('0x1'));var rs=require(_0x54e6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54e6('0x3'))['db'];var utils=require(_0x54e6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x54e6('0x5'));var jayson=require(_0x54e6('0x6'));var client=jayson[_0x54e6('0x7')][_0x54e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8ac4f5,_0x1735ff,_0x40007c){return new BPromise(function(_0x41180c,_0x47f6dc){return client[_0x54e6('0x9')](_0x8ac4f5,_0x40007c)[_0x54e6('0xa')](function(_0x34cf64){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x1735ff,'request\x20sent');logger[_0x54e6('0xb')](_0x54e6('0xc'),_0x1735ff,_0x54e6('0xd'),JSON[_0x54e6('0xe')](_0x34cf64));if(_0x34cf64[_0x54e6('0xf')]){if(_0x34cf64[_0x54e6('0xf')]['code']===0x1f4){logger[_0x54e6('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1735ff,_0x34cf64[_0x54e6('0xf')][_0x54e6('0x10')]);return _0x47f6dc(_0x34cf64[_0x54e6('0xf')][_0x54e6('0x10')]);}logger['error'](_0x54e6('0x11'),_0x1735ff,_0x34cf64['error']['message']);return _0x41180c(_0x34cf64[_0x54e6('0xf')][_0x54e6('0x10')]);}else{logger[_0x54e6('0x12')](_0x54e6('0x11'),_0x1735ff,_0x54e6('0xd'));_0x41180c(_0x34cf64[_0x54e6('0x13')][_0x54e6('0x10')]);}})[_0x54e6('0x14')](function(_0x3e107e){logger['error'](_0x54e6('0x11'),_0x1735ff,_0x3e107e);_0x47f6dc(_0x3e107e);});});} \ No newline at end of file +var _0xe4fd=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0xe4fd,0x169));var _0xde4f=function(_0x3fb39c,_0x13b9fd){_0x3fb39c=_0x3fb39c-0x0;var _0x1215f1=_0xe4fd[_0x3fb39c];return _0x1215f1;};'use strict';var _=require(_0xde4f('0x0'));var util=require('util');var moment=require(_0xde4f('0x1'));var BPromise=require(_0xde4f('0x2'));var rs=require(_0xde4f('0x3'));var fs=require('fs');var Redis=require(_0xde4f('0x4'));var db=require(_0xde4f('0x5'))['db'];var utils=require(_0xde4f('0x6'));var logger=require(_0xde4f('0x7'))(_0xde4f('0x8'));var config=require(_0xde4f('0x9'));var jayson=require(_0xde4f('0xa'));var client=jayson[_0xde4f('0xb')][_0xde4f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x658497,_0x3da5de,_0x518680){return new BPromise(function(_0x360242,_0x243154){return client[_0xde4f('0xd')](_0x658497,_0x518680)[_0xde4f('0xe')](function(_0x35371e){logger[_0xde4f('0xf')](_0xde4f('0x10'),_0x3da5de,_0xde4f('0x11'));logger[_0xde4f('0x12')](_0xde4f('0x13'),_0x3da5de,_0xde4f('0x11'),JSON[_0xde4f('0x14')](_0x35371e));if(_0x35371e[_0xde4f('0x15')]){if(_0x35371e[_0xde4f('0x15')][_0xde4f('0x16')]===0x1f4){logger[_0xde4f('0x15')](_0xde4f('0x10'),_0x3da5de,_0x35371e[_0xde4f('0x15')][_0xde4f('0x17')]);return _0x243154(_0x35371e[_0xde4f('0x15')]['message']);}logger[_0xde4f('0x15')](_0xde4f('0x10'),_0x3da5de,_0x35371e[_0xde4f('0x15')][_0xde4f('0x17')]);return _0x360242(_0x35371e['error'][_0xde4f('0x17')]);}else{logger[_0xde4f('0xf')](_0xde4f('0x10'),_0x3da5de,_0xde4f('0x11'));_0x360242(_0x35371e[_0xde4f('0x18')][_0xde4f('0x17')]);}})[_0xde4f('0x19')](function(_0x290e49){logger['error'](_0xde4f('0x10'),_0x3da5de,_0x290e49);_0x243154(_0x290e49);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 6fe1617..3a11131 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 _0x17c5=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/sounds','getSounds','post','create','addSound','put','update'];(function(_0x2484be,_0x12368d){var _0x2953f1=function(_0x550863){while(--_0x550863){_0x2484be['push'](_0x2484be['shift']());}};_0x2953f1(++_0x12368d);}(_0x17c5,0xc3));var _0x517c=function(_0x5a0d6c,_0x180ba4){_0x5a0d6c=_0x5a0d6c-0x0;var _0x1b9fc1=_0x17c5[_0x5a0d6c];return _0x1b9fc1;};'use strict';var multer=require(_0x517c('0x0'));var util=require(_0x517c('0x1'));var path=require(_0x517c('0x2'));var timeout=require(_0x517c('0x3'));var express=require('express');var router=express[_0x517c('0x4')]();var fs_extra=require(_0x517c('0x5'));var auth=require(_0x517c('0x6'));var interaction=require(_0x517c('0x7'));var config=require(_0x517c('0x8'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x517c('0x9')](),controller[_0x517c('0xa')]);router['get'](_0x517c('0xb'),auth[_0x517c('0x9')](),controller[_0x517c('0xc')]);router[_0x517c('0xd')](_0x517c('0xe'),auth['isAuthenticated'](),controller[_0x517c('0xf')]);router[_0x517c('0x10')]('/',auth['isAuthenticated'](),controller[_0x517c('0x11')]);router[_0x517c('0x10')]('/:id/sounds',auth[_0x517c('0x9')](),controller[_0x517c('0x12')]);router[_0x517c('0x13')]('/:id',auth[_0x517c('0x9')](),controller[_0x517c('0x14')]);router[_0x517c('0x15')](_0x517c('0xb'),auth[_0x517c('0x9')](),controller[_0x517c('0x16')]);router[_0x517c('0x15')]('/:id/sounds/:id2',auth[_0x517c('0x9')](),controller['removeSound']);module[_0x517c('0x17')]=router; \ No newline at end of file +var _0x2651=['update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id/sounds','getSounds','post','create','addSound','put','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2651,0x117));var _0x1265=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x2651[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x1265('0x0'));var util=require('util');var path=require(_0x1265('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1265('0x2')]();var fs_extra=require(_0x1265('0x3'));var auth=require(_0x1265('0x4'));var interaction=require(_0x1265('0x5'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0x1265('0x6')]('/',auth[_0x1265('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1265('0x6')](_0x1265('0x8'),auth[_0x1265('0x7')](),controller[_0x1265('0x9')]);router[_0x1265('0xa')]('/',auth[_0x1265('0x7')](),controller[_0x1265('0xb')]);router['post'](_0x1265('0x8'),auth[_0x1265('0x7')](),controller[_0x1265('0xc')]);router[_0x1265('0xd')](_0x1265('0xe'),auth[_0x1265('0x7')](),controller[_0x1265('0xf')]);router[_0x1265('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1265('0x11')]);router[_0x1265('0x10')](_0x1265('0x12'),auth[_0x1265('0x7')](),controller[_0x1265('0x13')]);module[_0x1265('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 99b5b86..a257e19 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 _0xd981=['ENUM','custom','mp3nb','quietmp3nb','mp3','files','TIMESTAMP','STRING','name'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd981,0x85));var _0x1d98=function(_0x80a2cd,_0x88c072){_0x80a2cd=_0x80a2cd-0x0;var _0x24915d=_0xd981[_0x80a2cd];return _0x24915d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1d98('0x0')],'allowNull':![],'unique':_0x1d98('0x1')},'mode':{'type':Sequelize[_0x1d98('0x2')](_0x1d98('0x3'),'files',_0x1d98('0x4'),_0x1d98('0x5'),'quietmp3',_0x1d98('0x6')),'allowNull':!![],'defaultValue':_0x1d98('0x7')},'directory':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![]},'stamp':{'type':_0x1d98('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xad62=['sequelize','ENUM','custom','files','mp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN'];(function(_0x32a2a5,_0x42b27d){var _0x1b0185=function(_0x480536){while(--_0x480536){_0x32a2a5['push'](_0x32a2a5['shift']());}};_0x1b0185(++_0x42b27d);}(_0xad62,0xdc));var _0x2ad6=function(_0x3412e0,_0x5c4e4f){_0x3412e0=_0x3412e0-0x0;var _0x479b68=_0xad62[_0x3412e0];return _0x479b68;};'use strict';var Sequelize=require(_0x2ad6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x2ad6('0x1')](_0x2ad6('0x2'),_0x2ad6('0x3'),_0x2ad6('0x4'),'quietmp3nb',_0x2ad6('0x5'),_0x2ad6('0x6')),'allowNull':!![],'defaultValue':_0x2ad6('0x3')},'directory':{'type':Sequelize[_0x2ad6('0x7')],'allowNull':!![]},'application':{'type':Sequelize[_0x2ad6('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2ad6('0x7')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2ad6('0x8')},'format':{'type':Sequelize[_0x2ad6('0x7')],'allowNull':!![]},'stamp':{'type':_0x2ad6('0x9')},'defaultEntry':{'type':Sequelize[_0x2ad6('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 0c146cb..54765c3 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 _0x0556=['extname','%s.%s','symlinkSync','Sequelize','removeSound','id2','unlinkSync','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','MusicOnHolds','name','send','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','create','sequelize','mode','files','directory','server/files/moh','mkdirSync','role','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','join','root','format','basename'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0556,0x1d8));var _0x6055=function(_0xf61586,_0x56b0c4){_0xf61586=_0xf61586-0x0;var _0x2b6eb3=_0x0556[_0xf61586];return _0x2b6eb3;};'use strict';var emlformat=require(_0x6055('0x0'));var rimraf=require(_0x6055('0x1'));var zipdir=require(_0x6055('0x2'));var jsonpatch=require(_0x6055('0x3'));var rp=require(_0x6055('0x4'));var moment=require(_0x6055('0x5'));var BPromise=require(_0x6055('0x6'));var Mustache=require(_0x6055('0x7'));var util=require(_0x6055('0x8'));var path=require(_0x6055('0x9'));var sox=require(_0x6055('0xa'));var csv=require(_0x6055('0xb'));var ejs=require(_0x6055('0xc'));var fs=require('fs');var fs_extra=require(_0x6055('0xd'));var _=require(_0x6055('0xe'));var squel=require('squel');var crypto=require(_0x6055('0xf'));var jsforce=require(_0x6055('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6055('0xb'));var querystring=require(_0x6055('0x11'));var Papa=require(_0x6055('0x12'));var Redis=require(_0x6055('0x13'));var authService=require(_0x6055('0x14'));var qs=require(_0x6055('0x15'));var as=require(_0x6055('0x16'));var hardwareService=require(_0x6055('0x17'));var logger=require(_0x6055('0x18'))(_0x6055('0x19'));var utils=require(_0x6055('0x1a'));var config=require(_0x6055('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x6055('0x1c'))['db'];function respondWithStatusCode(_0x2ea43d,_0x1c6683){_0x1c6683=_0x1c6683||0xcc;return function(_0x2f270e){if(_0x2f270e){return _0x2ea43d[_0x6055('0x1d')](_0x1c6683);}return _0x2ea43d[_0x6055('0x1e')](_0x1c6683)[_0x6055('0x1f')]();};}function respondWithResult(_0x1e262b,_0x5d2bac){_0x5d2bac=_0x5d2bac||0xc8;return function(_0x4a12f3){if(_0x4a12f3){return _0x1e262b['status'](_0x5d2bac)[_0x6055('0x20')](_0x4a12f3);}};}function respondWithFilteredResult(_0x11eb96,_0x35345d){return function(_0x42cf3f){if(_0x42cf3f){var _0x2ebd57=typeof _0x35345d['offset']===_0x6055('0x21')&&typeof _0x35345d['limit']==='undefined';var _0x33e521=_0x42cf3f[_0x6055('0x22')];var _0x1b47a0=_0x2ebd57?0x0:_0x35345d['offset'];var _0x5ef26b=_0x2ebd57?_0x42cf3f['count']:_0x35345d[_0x6055('0x23')]+_0x35345d[_0x6055('0x24')];var _0x467286;if(_0x5ef26b>=_0x33e521){_0x5ef26b=_0x33e521;_0x467286=0xc8;}else{_0x467286=0xce;}_0x11eb96['status'](_0x467286);return _0x11eb96[_0x6055('0x25')](_0x6055('0x26'),_0x1b47a0+'-'+_0x5ef26b+'/'+_0x33e521)['json'](_0x42cf3f);}return null;};}function patchUpdates(_0x11ceab){return function(_0x4ea721){try{jsonpatch[_0x6055('0x27')](_0x4ea721,_0x11ceab,!![]);}catch(_0x3be8d5){return BPromise[_0x6055('0x28')](_0x3be8d5);}return _0x4ea721['save']();};}function saveUpdates(_0x27c48a,_0x31898b){return function(_0xa25c29){if(_0xa25c29){return _0xa25c29[_0x6055('0x29')](_0x27c48a)[_0x6055('0x2a')](function(_0xd8b529){return _0xd8b529;});}return null;};}function removeEntity(_0xeef4c6,_0x1df9af){return function(_0x531643){if(_0x531643){return _0x531643[_0x6055('0x2b')]()[_0x6055('0x2a')](function(){var _0x374fb5=_0x531643['get']({'plain':!![]});var _0xf98736=_0x6055('0x2c');return db['UserProfileResource'][_0x6055('0x2b')]({'where':{'type':_0xf98736,'resourceId':_0x374fb5['id']}})['then'](function(){return _0x531643;});})[_0x6055('0x2a')](function(){_0xeef4c6[_0x6055('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21b452,_0x3635f3){return function(_0x5266bc){if(!_0x5266bc){_0x21b452[_0x6055('0x1d')](0x194);}return _0x5266bc;};}function handleError(_0x331d53,_0x5c8273){_0x5c8273=_0x5c8273||0x1f4;return function(_0x19dd84){logger['error'](_0x19dd84['stack']);if(_0x19dd84[_0x6055('0x2d')]){delete _0x19dd84['name'];}_0x331d53[_0x6055('0x1e')](_0x5c8273)[_0x6055('0x2e')](_0x19dd84);};}exports['index']=function(_0x47c11f,_0x44d69a){var _0x5b1ddc={},_0x536a13={},_0x26baee={'count':0x0,'rows':[]};var _0x596e05=_[_0x6055('0x2f')](db[_0x6055('0x30')]['rawAttributes'],function(_0x350534){return{'name':_0x350534[_0x6055('0x31')],'type':_0x350534[_0x6055('0x32')][_0x6055('0x33')]};});_0x536a13[_0x6055('0x34')]=_[_0x6055('0x2f')](_0x596e05,_0x6055('0x2d'));_0x536a13[_0x6055('0x35')]=_[_0x6055('0x36')](_0x47c11f['query']);_0x536a13[_0x6055('0x37')]=_[_0x6055('0x38')](_0x536a13[_0x6055('0x34')],_0x536a13[_0x6055('0x35')]);_0x5b1ddc['attributes']=_[_0x6055('0x38')](_0x536a13[_0x6055('0x34')],qs[_0x6055('0x39')](_0x47c11f[_0x6055('0x35')][_0x6055('0x39')]));_0x5b1ddc[_0x6055('0x3a')]=_0x5b1ddc[_0x6055('0x3a')]['length']?_0x5b1ddc[_0x6055('0x3a')]:_0x536a13[_0x6055('0x34')];if(!_0x47c11f[_0x6055('0x35')][_0x6055('0x3b')](_0x6055('0x3c'))){_0x5b1ddc[_0x6055('0x24')]=qs[_0x6055('0x24')](_0x47c11f[_0x6055('0x35')][_0x6055('0x24')]);_0x5b1ddc['offset']=qs[_0x6055('0x23')](_0x47c11f[_0x6055('0x35')][_0x6055('0x23')]);}_0x5b1ddc[_0x6055('0x3d')]=qs['sort'](_0x47c11f[_0x6055('0x35')]['sort']);delete _0x47c11f[_0x6055('0x35')][_0x6055('0x3e')];_0x5b1ddc[_0x6055('0x3f')]=qs[_0x6055('0x37')](_[_0x6055('0x40')](_0x47c11f['query'],_0x536a13[_0x6055('0x37')]),_0x596e05);if(_0x47c11f[_0x6055('0x35')][_0x6055('0x41')]){_0x5b1ddc[_0x6055('0x3f')]=_[_0x6055('0x42')](_0x5b1ddc[_0x6055('0x3f')],{'$or':_['map'](_0x596e05,function(_0x103813){if(_0x103813[_0x6055('0x32')]!==_0x6055('0x43')){var _0x5c09df={};_0x5c09df[_0x103813[_0x6055('0x2d')]]={'$like':'%'+_0x47c11f[_0x6055('0x35')][_0x6055('0x41')]+'%'};return _0x5c09df;}})});}_0x5b1ddc=_[_0x6055('0x42')]({},_0x5b1ddc,_0x47c11f[_0x6055('0x44')]);var _0x12063b={'where':_0x5b1ddc[_0x6055('0x3f')]};return db[_0x6055('0x30')][_0x6055('0x22')](_0x12063b)['then'](function(_0x4c2f32){_0x26baee[_0x6055('0x22')]=_0x4c2f32;if(_0x47c11f[_0x6055('0x35')][_0x6055('0x45')]){_0x5b1ddc[_0x6055('0x46')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x6055('0x47')](_0x5b1ddc);})['then'](function(_0x15d1df){_0x26baee[_0x6055('0x48')]=_0x15d1df;return _0x26baee;})[_0x6055('0x2a')](respondWithFilteredResult(_0x44d69a,_0x5b1ddc))[_0x6055('0x49')](handleError(_0x44d69a,null));};exports[_0x6055('0x4a')]=function(_0x407aac,_0x313327){var _0x1e3973={'raw':![],'where':{'id':_0x407aac[_0x6055('0x4b')]['id']}},_0x1f494f={};_0x1f494f['model']=_[_0x6055('0x36')](db[_0x6055('0x30')][_0x6055('0x4c')]);_0x1f494f[_0x6055('0x35')]=_[_0x6055('0x36')](_0x407aac['query']);_0x1f494f['filters']=_['intersection'](_0x1f494f[_0x6055('0x34')],_0x1f494f[_0x6055('0x35')]);_0x1e3973[_0x6055('0x3a')]=_[_0x6055('0x38')](_0x1f494f[_0x6055('0x34')],qs[_0x6055('0x39')](_0x407aac['query'][_0x6055('0x39')]));_0x1e3973[_0x6055('0x3a')]=_0x1e3973[_0x6055('0x3a')][_0x6055('0x4d')]?_0x1e3973[_0x6055('0x3a')]:_0x1f494f['model'];if(_0x407aac['query']['includeAll']){_0x1e3973['include']=[{'all':!![]}];}_0x1e3973=_[_0x6055('0x42')]({},_0x1e3973,_0x407aac[_0x6055('0x44')]);return db[_0x6055('0x30')][_0x6055('0x4e')](_0x1e3973)[_0x6055('0x2a')](handleEntityNotFound(_0x313327,null))['then'](respondWithResult(_0x313327,null))[_0x6055('0x49')](handleError(_0x313327,null));};exports['update']=function(_0x404191,_0x1dcf78){if(_0x404191[_0x6055('0x4f')]['id']){delete _0x404191[_0x6055('0x4f')]['id'];}return db['VoiceMusicOnHold'][_0x6055('0x4e')]({'where':{'id':_0x404191[_0x6055('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1dcf78,null))[_0x6055('0x2a')](saveUpdates(_0x404191['body'],null))[_0x6055('0x2a')](respondWithResult(_0x1dcf78,null))['catch'](handleError(_0x1dcf78,null));};exports[_0x6055('0x50')]=function(_0x4965cf,_0x3381ff,_0x3ad6d7){return db[_0x6055('0x51')]['transaction'](function(_0x41e807){if(_0x4965cf[_0x6055('0x4f')][_0x6055('0x52')]===_0x6055('0x53')){_0x4965cf[_0x6055('0x4f')][_0x6055('0x54')]=path['join'](config['root'],_0x6055('0x55'),_0x4965cf['body'][_0x6055('0x2d')]);}return db[_0x6055('0x30')][_0x6055('0x50')](_0x4965cf[_0x6055('0x4f')],{'transaction':_0x41e807})[_0x6055('0x2a')](function(_0x3eee51){if(_0x4965cf['body'][_0x6055('0x52')]===_0x6055('0x53')){fs[_0x6055('0x56')](_0x3eee51[_0x6055('0x54')],parseInt('0777',0x8));}var _0x4fcfb5=_0x4965cf['user']['get']({'plain':!![]});if(!_0x4fcfb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fcfb5[_0x6055('0x57')]===_0x6055('0x58')){var _0x3f575e=_0x3eee51[_0x6055('0x59')]({'plain':!![]});return db[_0x6055('0x5a')][_0x6055('0x4e')]({'where':{'name':_0x6055('0x2c'),'userProfileId':_0x4fcfb5[_0x6055('0x5b')]},'raw':!![]})['then'](function(_0xe74bcc){if(_0xe74bcc&&_0xe74bcc['autoAssociation']===0x0){return db['UserProfileResource'][_0x6055('0x50')]({'name':_0x3f575e['name'],'resourceId':_0x3f575e['id'],'type':_0xe74bcc[_0x6055('0x2d')],'sectionId':_0xe74bcc['id']},{})[_0x6055('0x2a')](function(){return _0x3eee51;});}else{return _0x3eee51;}})[_0x6055('0x49')](function(_0x416efe){logger['error'](_0x6055('0x5c'),_0x416efe);});}return _0x3eee51;});})[_0x6055('0x2a')](respondWithResult(_0x3381ff,0xc9))['catch'](handleError(_0x3381ff,null));};exports[_0x6055('0x2b')]=function(_0x538bdb,_0x51cac3,_0x31954f){var _0x27e62d;return db['VoiceMusicOnHold'][_0x6055('0x4e')]({'where':{'id':_0x538bdb[_0x6055('0x4b')]['id']}})[_0x6055('0x2a')](function(_0x1625c5){if(_0x1625c5){return db[_0x6055('0x51')][_0x6055('0x5d')](function(_0x28cb03){return _0x1625c5[_0x6055('0x2b')]({'transaction':_0x28cb03,'raw':!![]})[_0x6055('0x2a')](function(_0x5019b7){if(_0x5019b7[_0x6055('0x54')]){fs[_0x6055('0x5e')](_0x5019b7['directory'])[_0x6055('0x5f')](function(_0x5dc307){fs['unlinkSync'](path['join'](_0x5019b7[_0x6055('0x54')],_0x5dc307));});fs['rmdirSync'](_0x5019b7[_0x6055('0x54')]);}return _0x5019b7;});})[_0x6055('0x49')](function(_0x464862){throw new db['Sequelize'][(_0x6055('0x60'))](_0x464862[_0x6055('0x61')]);});}})[_0x6055('0x2a')](handleEntityNotFound(_0x51cac3,null))['then'](removeEntity(_0x51cac3,null))[_0x6055('0x49')](handleError(_0x51cac3,null));};exports[_0x6055('0x62')]=function(_0x21ca69,_0x2b88c8,_0x5cd282){return db['sequelize'][_0x6055('0x5d')](function(_0x275d50){var _0x105658;return db[_0x6055('0x30')][_0x6055('0x4e')]({'where':{'id':_0x21ca69['params']['id']}})['then'](function(_0x55ad7f){if(_0x55ad7f){_0x105658=_0x55ad7f;return _0x55ad7f['addSound'](_0x21ca69['body']['id'],{'transaction':_0x275d50});}})[_0x6055('0x2a')](function(_0x2a076f){if(_0x2a076f){return db[_0x6055('0x63')][_0x6055('0x64')]({'where':{'id':_0x21ca69[_0x6055('0x4f')]['id']},'attributes':['id',_0x6055('0x2d'),_0x6055('0x65'),_0x6055('0x66'),_0x6055('0x67')],'raw':!![]});}})[_0x6055('0x2a')](function(_0x5b1987){if(_0x5b1987){var _0x42eada=path[_0x6055('0x68')](config[_0x6055('0x69')],'server/files/sounds/converted',util[_0x6055('0x6a')]('%s.%s',path[_0x6055('0x6b')](_0x5b1987[_0x6055('0x65')],path[_0x6055('0x6c')](_0x5b1987[_0x6055('0x65')])),_0x5b1987[_0x6055('0x66')]));var _0x27ada2=path[_0x6055('0x68')](config[_0x6055('0x69')],_0x6055('0x55'),_0x105658[_0x6055('0x2d')],util['format'](_0x6055('0x6d'),_0x5b1987[_0x6055('0x2d')],_0x5b1987[_0x6055('0x66')]));fs[_0x6055('0x6e')](_0x42eada,_0x27ada2);return _0x5b1987;}})[_0x6055('0x49')](function(_0x4a6f6c){throw new db[(_0x6055('0x6f'))]['ValidationError'](_0x4a6f6c[_0x6055('0x61')]);});})[_0x6055('0x2a')](handleEntityNotFound(_0x2b88c8,null))[_0x6055('0x2a')](respondWithResult(_0x2b88c8,0xc9))[_0x6055('0x49')](handleError(_0x2b88c8,null));};exports[_0x6055('0x70')]=function(_0x130dcc,_0x56dbc3,_0x390328){return db[_0x6055('0x51')]['transaction'](function(_0x35d996){var _0x319154;return db[_0x6055('0x30')]['findOne']({'where':{'id':_0x130dcc['params']['id']}})[_0x6055('0x2a')](handleEntityNotFound(_0x56dbc3,null))[_0x6055('0x2a')](function(_0xc1c127){if(_0xc1c127){_0x319154=_0xc1c127;return _0xc1c127[_0x6055('0x70')](_0x130dcc[_0x6055('0x4b')][_0x6055('0x71')]);}})[_0x6055('0x2a')](function(_0x5dfe25){if(_0x5dfe25){return db['Sound'][_0x6055('0x64')]({'where':{'id':_0x130dcc[_0x6055('0x4b')]['id2']},'attributes':['id','name',_0x6055('0x65'),_0x6055('0x66'),_0x6055('0x67')],'raw':!![]});}})['then'](function(_0x5dd48a){if(_0x5dd48a){fs[_0x6055('0x72')](path[_0x6055('0x68')](_0x319154[_0x6055('0x54')],util[_0x6055('0x6a')]('%s.%s',_0x5dd48a[_0x6055('0x2d')],_0x5dd48a[_0x6055('0x66')])));return _0x5dd48a;}})[_0x6055('0x49')](function(_0x1d8f78){throw new db['Sequelize'][(_0x6055('0x60'))](_0x1d8f78[_0x6055('0x61')]);});})[_0x6055('0x2a')](handleEntityNotFound(_0x56dbc3,null))[_0x6055('0x2a')](respondWithStatusCode(_0x56dbc3,0xcc))[_0x6055('0x49')](handleError(_0x56dbc3,null));};exports['getSounds']=function(_0x4efa27,_0x2c16d4,_0x12a349){var _0x4aeed4={};var _0x2b80df={};var _0x425294;var _0x32eb3c;return db[_0x6055('0x30')][_0x6055('0x64')]({'where':{'id':_0x4efa27[_0x6055('0x4b')]['id']}})[_0x6055('0x2a')](handleEntityNotFound(_0x2c16d4,null))[_0x6055('0x2a')](function(_0x1e5aec){if(_0x1e5aec){_0x425294=_0x1e5aec;_0x2b80df[_0x6055('0x34')]=_['keys'](db[_0x6055('0x63')]['rawAttributes']);_0x2b80df['query']=_[_0x6055('0x36')](_0x4efa27[_0x6055('0x35')]);_0x2b80df[_0x6055('0x37')]=_[_0x6055('0x38')](_0x2b80df[_0x6055('0x34')],_0x2b80df[_0x6055('0x35')]);_0x4aeed4[_0x6055('0x3a')]=_[_0x6055('0x38')](_0x2b80df[_0x6055('0x34')],qs['fields'](_0x4efa27['query'][_0x6055('0x39')]));_0x4aeed4[_0x6055('0x3a')]=_0x4aeed4[_0x6055('0x3a')][_0x6055('0x4d')]?_0x4aeed4['attributes']:_0x2b80df[_0x6055('0x34')];_0x4aeed4['order']=qs[_0x6055('0x3e')](_0x4efa27[_0x6055('0x35')][_0x6055('0x3e')]);_0x4aeed4[_0x6055('0x3f')]=qs[_0x6055('0x37')](_[_0x6055('0x40')](_0x4efa27['query'],_0x2b80df[_0x6055('0x37')]));if(_0x4efa27[_0x6055('0x35')]['filter']){_0x4aeed4[_0x6055('0x3f')]=_['merge'](_0x4aeed4['where'],{'$or':_['map'](_0x4aeed4[_0x6055('0x3a')],function(_0x5bb8d1){var _0x2e4c2b={};_0x2e4c2b[_0x5bb8d1]={'$like':'%'+_0x4efa27[_0x6055('0x35')]['filter']+'%'};return _0x2e4c2b;})});}_0x4aeed4=_[_0x6055('0x42')]({},_0x4aeed4,_0x4efa27[_0x6055('0x44')]);return _0x425294['getSounds'](_0x4aeed4);}})[_0x6055('0x2a')](function(_0x4430c8){if(_0x4430c8){_0x32eb3c=_0x4430c8[_0x6055('0x4d')];if(!_0x4efa27['query'][_0x6055('0x3b')](_0x6055('0x3c'))){_0x4aeed4[_0x6055('0x24')]=qs[_0x6055('0x24')](_0x4efa27[_0x6055('0x35')][_0x6055('0x24')]);_0x4aeed4[_0x6055('0x23')]=qs['offset'](_0x4efa27['query'][_0x6055('0x23')]);}return _0x425294[_0x6055('0x73')](_0x4aeed4);}})[_0x6055('0x2a')](function(_0x23a17e){if(_0x23a17e){return _0x23a17e?{'count':_0x32eb3c,'rows':_0x23a17e}:null;}})[_0x6055('0x2a')](respondWithResult(_0x2c16d4,null))['catch'](handleError(_0x2c16d4,null));}; \ No newline at end of file +var _0x8628=['forEach','join','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','%s.%s','root','format','removeSound','id2','getSounds','Sound','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../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','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','body','transaction','mode','files','directory','server/files/moh','create','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','destroy','readdirSync'];(function(_0x1723cd,_0x2c1dc8){var _0x2c06ec=function(_0x68c4b){while(--_0x68c4b){_0x1723cd['push'](_0x1723cd['shift']());}};_0x2c06ec(++_0x2c1dc8);}(_0x8628,0x171));var _0x8862=function(_0x495ec6,_0x4c9d90){_0x495ec6=_0x495ec6-0x0;var _0x5210f1=_0x8628[_0x495ec6];return _0x5210f1;};'use strict';var emlformat=require(_0x8862('0x0'));var rimraf=require(_0x8862('0x1'));var zipdir=require(_0x8862('0x2'));var jsonpatch=require(_0x8862('0x3'));var rp=require(_0x8862('0x4'));var moment=require(_0x8862('0x5'));var BPromise=require(_0x8862('0x6'));var Mustache=require(_0x8862('0x7'));var util=require(_0x8862('0x8'));var path=require(_0x8862('0x9'));var sox=require('sox');var csv=require(_0x8862('0xa'));var ejs=require(_0x8862('0xb'));var fs=require('fs');var fs_extra=require(_0x8862('0xc'));var _=require(_0x8862('0xd'));var squel=require(_0x8862('0xe'));var crypto=require(_0x8862('0xf'));var jsforce=require(_0x8862('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8862('0xa'));var querystring=require('querystring');var Papa=require(_0x8862('0x11'));var Redis=require('ioredis');var authService=require(_0x8862('0x12'));var qs=require(_0x8862('0x13'));var as=require(_0x8862('0x14'));var hardwareService=require(_0x8862('0x15'));var logger=require(_0x8862('0x16'))(_0x8862('0x17'));var utils=require(_0x8862('0x18'));var config=require(_0x8862('0x19'));var licenseUtil=require(_0x8862('0x1a'));var db=require(_0x8862('0x1b'))['db'];function respondWithStatusCode(_0x5b0926,_0x766206){_0x766206=_0x766206||0xcc;return function(_0xc69cba){if(_0xc69cba){return _0x5b0926['sendStatus'](_0x766206);}return _0x5b0926['status'](_0x766206)[_0x8862('0x1c')]();};}function respondWithResult(_0x27c35e,_0xcbb57d){_0xcbb57d=_0xcbb57d||0xc8;return function(_0x442c9d){if(_0x442c9d){return _0x27c35e[_0x8862('0x1d')](_0xcbb57d)['json'](_0x442c9d);}};}function respondWithFilteredResult(_0x3ea33a,_0x1b0595){return function(_0x2d98ae){if(_0x2d98ae){var _0xace04d=typeof _0x1b0595[_0x8862('0x1e')]===_0x8862('0x1f')&&typeof _0x1b0595['limit']===_0x8862('0x1f');var _0x16d0eb=_0x2d98ae[_0x8862('0x20')];var _0x10d10d=_0xace04d?0x0:_0x1b0595[_0x8862('0x1e')];var _0x377258=_0xace04d?_0x2d98ae[_0x8862('0x20')]:_0x1b0595[_0x8862('0x1e')]+_0x1b0595[_0x8862('0x21')];var _0x34e76d;if(_0x377258>=_0x16d0eb){_0x377258=_0x16d0eb;_0x34e76d=0xc8;}else{_0x34e76d=0xce;}_0x3ea33a[_0x8862('0x1d')](_0x34e76d);return _0x3ea33a[_0x8862('0x22')](_0x8862('0x23'),_0x10d10d+'-'+_0x377258+'/'+_0x16d0eb)[_0x8862('0x24')](_0x2d98ae);}return null;};}function patchUpdates(_0x4d6994){return function(_0x21ed68){try{jsonpatch[_0x8862('0x25')](_0x21ed68,_0x4d6994,!![]);}catch(_0x3321c3){return BPromise[_0x8862('0x26')](_0x3321c3);}return _0x21ed68[_0x8862('0x27')]();};}function saveUpdates(_0x1f6f48,_0x16714e){return function(_0x3877bc){if(_0x3877bc){return _0x3877bc[_0x8862('0x28')](_0x1f6f48)[_0x8862('0x29')](function(_0x5073c3){return _0x5073c3;});}return null;};}function removeEntity(_0x2a4e9a,_0x184026){return function(_0x7718c2){if(_0x7718c2){return _0x7718c2['destroy']()[_0x8862('0x29')](function(){var _0x5e620d=_0x7718c2['get']({'plain':!![]});var _0x257357=_0x8862('0x2a');return db[_0x8862('0x2b')]['destroy']({'where':{'type':_0x257357,'resourceId':_0x5e620d['id']}})[_0x8862('0x29')](function(){return _0x7718c2;});})['then'](function(){_0x2a4e9a[_0x8862('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a58a3,_0x2bd2f1){return function(_0x40c345){if(!_0x40c345){_0x3a58a3[_0x8862('0x2c')](0x194);}return _0x40c345;};}function handleError(_0xaa1d16,_0x16c8fd){_0x16c8fd=_0x16c8fd||0x1f4;return function(_0x69e3dc){logger[_0x8862('0x2d')](_0x69e3dc[_0x8862('0x2e')]);if(_0x69e3dc[_0x8862('0x2f')]){delete _0x69e3dc['name'];}_0xaa1d16[_0x8862('0x1d')](_0x16c8fd)[_0x8862('0x30')](_0x69e3dc);};}exports[_0x8862('0x31')]=function(_0x52359e,_0x2d858b){var _0x514a4c={},_0x27414d={},_0x7730bc={'count':0x0,'rows':[]};var _0xd0a53d=_[_0x8862('0x32')](db[_0x8862('0x33')][_0x8862('0x34')],function(_0x55fa9d){return{'name':_0x55fa9d[_0x8862('0x35')],'type':_0x55fa9d['type'][_0x8862('0x36')]};});_0x27414d[_0x8862('0x37')]=_[_0x8862('0x32')](_0xd0a53d,_0x8862('0x2f'));_0x27414d['query']=_[_0x8862('0x38')](_0x52359e[_0x8862('0x39')]);_0x27414d[_0x8862('0x3a')]=_[_0x8862('0x3b')](_0x27414d['model'],_0x27414d[_0x8862('0x39')]);_0x514a4c[_0x8862('0x3c')]=_[_0x8862('0x3b')](_0x27414d['model'],qs['fields'](_0x52359e[_0x8862('0x39')][_0x8862('0x3d')]));_0x514a4c[_0x8862('0x3c')]=_0x514a4c[_0x8862('0x3c')][_0x8862('0x3e')]?_0x514a4c[_0x8862('0x3c')]:_0x27414d['model'];if(!_0x52359e[_0x8862('0x39')][_0x8862('0x3f')](_0x8862('0x40'))){_0x514a4c[_0x8862('0x21')]=qs[_0x8862('0x21')](_0x52359e[_0x8862('0x39')][_0x8862('0x21')]);_0x514a4c[_0x8862('0x1e')]=qs[_0x8862('0x1e')](_0x52359e[_0x8862('0x39')]['offset']);}_0x514a4c[_0x8862('0x41')]=qs['sort'](_0x52359e[_0x8862('0x39')][_0x8862('0x42')]);delete _0x52359e[_0x8862('0x39')][_0x8862('0x42')];_0x514a4c[_0x8862('0x43')]=qs[_0x8862('0x3a')](_[_0x8862('0x44')](_0x52359e[_0x8862('0x39')],_0x27414d[_0x8862('0x3a')]),_0xd0a53d);if(_0x52359e[_0x8862('0x39')][_0x8862('0x45')]){_0x514a4c[_0x8862('0x43')]=_[_0x8862('0x46')](_0x514a4c[_0x8862('0x43')],{'$or':_[_0x8862('0x32')](_0xd0a53d,function(_0x1d5afb){if(_0x1d5afb[_0x8862('0x47')]!==_0x8862('0x48')){var _0x5d4049={};_0x5d4049[_0x1d5afb[_0x8862('0x2f')]]={'$like':'%'+_0x52359e[_0x8862('0x39')][_0x8862('0x45')]+'%'};return _0x5d4049;}})});}_0x514a4c=_[_0x8862('0x46')]({},_0x514a4c,_0x52359e[_0x8862('0x49')]);var _0x3ae94c={'where':_0x514a4c[_0x8862('0x43')]};return db[_0x8862('0x33')][_0x8862('0x20')](_0x3ae94c)[_0x8862('0x29')](function(_0x7db342){_0x7730bc[_0x8862('0x20')]=_0x7db342;if(_0x52359e[_0x8862('0x39')][_0x8862('0x4a')]){_0x514a4c['include']=[{'all':!![]}];}return db[_0x8862('0x33')][_0x8862('0x4b')](_0x514a4c);})[_0x8862('0x29')](function(_0x1c003e){_0x7730bc['rows']=_0x1c003e;return _0x7730bc;})[_0x8862('0x29')](respondWithFilteredResult(_0x2d858b,_0x514a4c))[_0x8862('0x4c')](handleError(_0x2d858b,null));};exports[_0x8862('0x4d')]=function(_0x1b3ba1,_0x3ac490){var _0x5cf300={'raw':![],'where':{'id':_0x1b3ba1[_0x8862('0x4e')]['id']}},_0x436747={};_0x436747[_0x8862('0x37')]=_['keys'](db[_0x8862('0x33')][_0x8862('0x34')]);_0x436747['query']=_['keys'](_0x1b3ba1[_0x8862('0x39')]);_0x436747[_0x8862('0x3a')]=_['intersection'](_0x436747[_0x8862('0x37')],_0x436747[_0x8862('0x39')]);_0x5cf300['attributes']=_[_0x8862('0x3b')](_0x436747[_0x8862('0x37')],qs[_0x8862('0x3d')](_0x1b3ba1['query'][_0x8862('0x3d')]));_0x5cf300[_0x8862('0x3c')]=_0x5cf300[_0x8862('0x3c')]['length']?_0x5cf300[_0x8862('0x3c')]:_0x436747[_0x8862('0x37')];if(_0x1b3ba1['query'][_0x8862('0x4a')]){_0x5cf300[_0x8862('0x4f')]=[{'all':!![]}];}_0x5cf300=_[_0x8862('0x46')]({},_0x5cf300,_0x1b3ba1['options']);return db[_0x8862('0x33')][_0x8862('0x50')](_0x5cf300)[_0x8862('0x29')](handleEntityNotFound(_0x3ac490,null))[_0x8862('0x29')](respondWithResult(_0x3ac490,null))['catch'](handleError(_0x3ac490,null));};exports[_0x8862('0x28')]=function(_0x4c4c7a,_0x34e70b){if(_0x4c4c7a[_0x8862('0x51')]['id']){delete _0x4c4c7a[_0x8862('0x51')]['id'];}return db[_0x8862('0x33')][_0x8862('0x50')]({'where':{'id':_0x4c4c7a[_0x8862('0x4e')]['id']}})[_0x8862('0x29')](handleEntityNotFound(_0x34e70b,null))['then'](saveUpdates(_0x4c4c7a[_0x8862('0x51')],null))[_0x8862('0x29')](respondWithResult(_0x34e70b,null))[_0x8862('0x4c')](handleError(_0x34e70b,null));};exports['create']=function(_0x414134,_0x3be7a6,_0x7b182f){return db['sequelize'][_0x8862('0x52')](function(_0x486a4e){if(_0x414134['body'][_0x8862('0x53')]===_0x8862('0x54')){_0x414134[_0x8862('0x51')][_0x8862('0x55')]=path['join'](config['root'],_0x8862('0x56'),_0x414134[_0x8862('0x51')][_0x8862('0x2f')]);}return db[_0x8862('0x33')][_0x8862('0x57')](_0x414134[_0x8862('0x51')],{'transaction':_0x486a4e})[_0x8862('0x29')](function(_0x379b2b){if(_0x414134[_0x8862('0x51')]['mode']===_0x8862('0x54')){fs[_0x8862('0x58')](_0x379b2b[_0x8862('0x55')],parseInt(_0x8862('0x59'),0x8));}var _0x45c69e=_0x414134[_0x8862('0x5a')][_0x8862('0x5b')]({'plain':!![]});if(!_0x45c69e)throw new Error(_0x8862('0x5c'));if(_0x45c69e[_0x8862('0x5d')]==='user'){var _0x221adc=_0x379b2b['get']({'plain':!![]});return db['UserProfileSection'][_0x8862('0x50')]({'where':{'name':'MusicOnHolds','userProfileId':_0x45c69e[_0x8862('0x5e')]},'raw':!![]})[_0x8862('0x29')](function(_0x4f6bb1){if(_0x4f6bb1&&_0x4f6bb1['autoAssociation']===0x0){return db[_0x8862('0x2b')][_0x8862('0x57')]({'name':_0x221adc['name'],'resourceId':_0x221adc['id'],'type':_0x4f6bb1['name'],'sectionId':_0x4f6bb1['id']},{})[_0x8862('0x29')](function(){return _0x379b2b;});}else{return _0x379b2b;}})[_0x8862('0x4c')](function(_0xb03b9){logger['error'](_0x8862('0x5f'),_0xb03b9);});}return _0x379b2b;});})[_0x8862('0x29')](respondWithResult(_0x3be7a6,0xc9))[_0x8862('0x4c')](handleError(_0x3be7a6,null));};exports['destroy']=function(_0x148853,_0x494739,_0x5dfe15){var _0x6c28e2;return db[_0x8862('0x33')][_0x8862('0x50')]({'where':{'id':_0x148853['params']['id']}})[_0x8862('0x29')](function(_0x499a68){if(_0x499a68){return db[_0x8862('0x60')]['transaction'](function(_0x4f90a4){return _0x499a68[_0x8862('0x61')]({'transaction':_0x4f90a4,'raw':!![]})[_0x8862('0x29')](function(_0x4a691e){if(_0x4a691e[_0x8862('0x55')]){fs[_0x8862('0x62')](_0x4a691e[_0x8862('0x55')])[_0x8862('0x63')](function(_0x23551c){fs['unlinkSync'](path[_0x8862('0x64')](_0x4a691e[_0x8862('0x55')],_0x23551c));});fs[_0x8862('0x65')](_0x4a691e[_0x8862('0x55')]);}return _0x4a691e;});})[_0x8862('0x4c')](function(_0xcb43f9){throw new db[(_0x8862('0x66'))][(_0x8862('0x67'))](_0xcb43f9[_0x8862('0x68')]);});}})[_0x8862('0x29')](handleEntityNotFound(_0x494739,null))[_0x8862('0x29')](removeEntity(_0x494739,null))[_0x8862('0x4c')](handleError(_0x494739,null));};exports['addSound']=function(_0x54a843,_0x2804e4,_0x1e8f9f){return db[_0x8862('0x60')][_0x8862('0x52')](function(_0x274a3b){var _0x3ac153;return db[_0x8862('0x33')]['find']({'where':{'id':_0x54a843[_0x8862('0x4e')]['id']}})[_0x8862('0x29')](function(_0x172e4e){if(_0x172e4e){_0x3ac153=_0x172e4e;return _0x172e4e[_0x8862('0x69')](_0x54a843[_0x8862('0x51')]['id'],{'transaction':_0x274a3b});}})[_0x8862('0x29')](function(_0x58672b){if(_0x58672b){return db['Sound'][_0x8862('0x6a')]({'where':{'id':_0x54a843[_0x8862('0x51')]['id']},'attributes':['id',_0x8862('0x2f'),_0x8862('0x6b'),_0x8862('0x6c'),_0x8862('0x6d')],'raw':!![]});}})[_0x8862('0x29')](function(_0x19f7e3){if(_0x19f7e3){var _0x359fff=path[_0x8862('0x64')](config['root'],'server/files/sounds/converted',util['format'](_0x8862('0x6e'),path['basename'](_0x19f7e3[_0x8862('0x6b')],path['extname'](_0x19f7e3['save_name'])),_0x19f7e3['converted_format']));var _0x3357bf=path[_0x8862('0x64')](config[_0x8862('0x6f')],_0x8862('0x56'),_0x3ac153['name'],util[_0x8862('0x70')](_0x8862('0x6e'),_0x19f7e3[_0x8862('0x2f')],_0x19f7e3[_0x8862('0x6c')]));fs['symlinkSync'](_0x359fff,_0x3357bf);return _0x19f7e3;}})['catch'](function(_0x1fc0fe){throw new db[(_0x8862('0x66'))][(_0x8862('0x67'))](_0x1fc0fe['message']);});})[_0x8862('0x29')](handleEntityNotFound(_0x2804e4,null))[_0x8862('0x29')](respondWithResult(_0x2804e4,0xc9))[_0x8862('0x4c')](handleError(_0x2804e4,null));};exports['removeSound']=function(_0x4295fd,_0x176a9e,_0xbbbdce){return db[_0x8862('0x60')]['transaction'](function(_0x1a361e){var _0x3c9cbc;return db[_0x8862('0x33')]['findOne']({'where':{'id':_0x4295fd[_0x8862('0x4e')]['id']}})[_0x8862('0x29')](handleEntityNotFound(_0x176a9e,null))[_0x8862('0x29')](function(_0x209199){if(_0x209199){_0x3c9cbc=_0x209199;return _0x209199[_0x8862('0x71')](_0x4295fd[_0x8862('0x4e')][_0x8862('0x72')]);}})[_0x8862('0x29')](function(_0x2e985b){if(_0x2e985b){return db['Sound'][_0x8862('0x6a')]({'where':{'id':_0x4295fd[_0x8862('0x4e')][_0x8862('0x72')]},'attributes':['id',_0x8862('0x2f'),_0x8862('0x6b'),_0x8862('0x6c'),_0x8862('0x6d')],'raw':!![]});}})[_0x8862('0x29')](function(_0x120f43){if(_0x120f43){fs['unlinkSync'](path[_0x8862('0x64')](_0x3c9cbc[_0x8862('0x55')],util[_0x8862('0x70')](_0x8862('0x6e'),_0x120f43['name'],_0x120f43[_0x8862('0x6c')])));return _0x120f43;}})[_0x8862('0x4c')](function(_0xb0fb26){throw new db['Sequelize']['ValidationError'](_0xb0fb26[_0x8862('0x68')]);});})['then'](handleEntityNotFound(_0x176a9e,null))['then'](respondWithStatusCode(_0x176a9e,0xcc))[_0x8862('0x4c')](handleError(_0x176a9e,null));};exports[_0x8862('0x73')]=function(_0x5c4fb6,_0x3ed530,_0x528b17){var _0x5b376b={};var _0x43904b={};var _0x14af0a;var _0x5f496d;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5c4fb6[_0x8862('0x4e')]['id']}})[_0x8862('0x29')](handleEntityNotFound(_0x3ed530,null))[_0x8862('0x29')](function(_0x5f567a){if(_0x5f567a){_0x14af0a=_0x5f567a;_0x43904b[_0x8862('0x37')]=_[_0x8862('0x38')](db[_0x8862('0x74')]['rawAttributes']);_0x43904b['query']=_[_0x8862('0x38')](_0x5c4fb6[_0x8862('0x39')]);_0x43904b['filters']=_[_0x8862('0x3b')](_0x43904b[_0x8862('0x37')],_0x43904b[_0x8862('0x39')]);_0x5b376b[_0x8862('0x3c')]=_['intersection'](_0x43904b['model'],qs['fields'](_0x5c4fb6[_0x8862('0x39')][_0x8862('0x3d')]));_0x5b376b['attributes']=_0x5b376b[_0x8862('0x3c')][_0x8862('0x3e')]?_0x5b376b[_0x8862('0x3c')]:_0x43904b['model'];_0x5b376b['order']=qs[_0x8862('0x42')](_0x5c4fb6['query'][_0x8862('0x42')]);_0x5b376b[_0x8862('0x43')]=qs[_0x8862('0x3a')](_['pick'](_0x5c4fb6[_0x8862('0x39')],_0x43904b[_0x8862('0x3a')]));if(_0x5c4fb6[_0x8862('0x39')][_0x8862('0x45')]){_0x5b376b[_0x8862('0x43')]=_[_0x8862('0x46')](_0x5b376b[_0x8862('0x43')],{'$or':_[_0x8862('0x32')](_0x5b376b[_0x8862('0x3c')],function(_0x5db6f4){var _0x4ed342={};_0x4ed342[_0x5db6f4]={'$like':'%'+_0x5c4fb6[_0x8862('0x39')][_0x8862('0x45')]+'%'};return _0x4ed342;})});}_0x5b376b=_['merge']({},_0x5b376b,_0x5c4fb6[_0x8862('0x49')]);return _0x14af0a[_0x8862('0x73')](_0x5b376b);}})[_0x8862('0x29')](function(_0x4ff0ca){if(_0x4ff0ca){_0x5f496d=_0x4ff0ca[_0x8862('0x3e')];if(!_0x5c4fb6[_0x8862('0x39')]['hasOwnProperty']('nolimit')){_0x5b376b[_0x8862('0x21')]=qs['limit'](_0x5c4fb6[_0x8862('0x39')][_0x8862('0x21')]);_0x5b376b[_0x8862('0x1e')]=qs['offset'](_0x5c4fb6['query'][_0x8862('0x1e')]);}return _0x14af0a['getSounds'](_0x5b376b);}})['then'](function(_0x3bd965){if(_0x3bd965){return _0x3bd965?{'count':_0x5f496d,'rows':_0x3bd965}:null;}})[_0x8862('0x29')](respondWithResult(_0x3ed530,null))[_0x8862('0x4c')](handleError(_0x3ed530,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index bd161f5..8f32c08 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 _0xd4bc=['api','moment','bluebird','request-promise','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','../../config/logger'];(function(_0x86bed5,_0xa2634d){var _0x252d3a=function(_0x204248){while(--_0x204248){_0x86bed5['push'](_0x86bed5['shift']());}};_0x252d3a(++_0xa2634d);}(_0xd4bc,0x1d4));var _0xcd4b=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0xd4bc[_0x2b9e8a];return _0x520e67;};'use strict';var _=require(_0xcd4b('0x0'));var util=require('util');var logger=require(_0xcd4b('0x1'))(_0xcd4b('0x2'));var moment=require(_0xcd4b('0x3'));var BPromise=require(_0xcd4b('0x4'));var rp=require(_0xcd4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd4b('0x6'));module[_0xcd4b('0x7')]=function(_0x31899e,_0x234635){return _0x31899e[_0xcd4b('0x8')](_0xcd4b('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc38=['moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','util','api'];(function(_0x3126a7,_0xeab7ee){var _0x359314=function(_0x2b4f2e){while(--_0x2b4f2e){_0x3126a7['push'](_0x3126a7['shift']());}};_0x359314(++_0xeab7ee);}(_0xfc38,0x98));var _0x8fc3=function(_0x36e35b,_0x3a75c6){_0x36e35b=_0x36e35b-0x0;var _0x1aed7d=_0xfc38[_0x36e35b];return _0x1aed7d;};'use strict';var _=require('lodash');var util=require(_0x8fc3('0x0'));var logger=require('../../config/logger')(_0x8fc3('0x1'));var moment=require(_0x8fc3('0x2'));var BPromise=require(_0x8fc3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fc3('0x4'));var rimraf=require(_0x8fc3('0x5'));var config=require(_0x8fc3('0x6'));var attributes=require(_0x8fc3('0x7'));module[_0x8fc3('0x8')]=function(_0x4cdb8c,_0x5e0f12){return _0x4cdb8c[_0x8fc3('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x8fc3('0xa'),'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 60318e3..09eea74 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xbe4d20,_0x3506eb){var _0xda7ffc=function(_0x38bd44){while(--_0x38bd44){_0xbe4d20['push'](_0xbe4d20['shift']());}};_0xda7ffc(++_0x3506eb);}(_0x70e0,0x17b));var _0x070e=function(_0x42bf24,_0x160ab4){_0x42bf24=_0x42bf24-0x0;var _0x382efc=_0x70e0[_0x42bf24];return _0x382efc;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4d0087,_0x579749){var _0x208bbd=function(_0x50a43d){while(--_0x50a43d){_0x4d0087['push'](_0x4d0087['shift']());}};_0x208bbd(++_0x579749);}(_0x34e8,0x12c));var _0x834e=function(_0x422bc1,_0x38366d){_0x422bc1=_0x422bc1-0x0;var _0x2044ab=_0x34e8[_0x422bc1];return _0x2044ab;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 8a7f519..420652f 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 _0x0d4d=['../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','show','getAgents','/:id/teams','getTeams','create','post','/:id/users','addAgents','addTeams','update','/:id','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0d4d,0x132));var _0xd0d4=function(_0x535903,_0x2c9af1){_0x535903=_0x535903-0x0;var _0x5ef770=_0x0d4d[_0x535903];return _0x5ef770;};'use strict';var multer=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var path=require(_0xd0d4('0x2'));var timeout=require(_0xd0d4('0x3'));var express=require(_0xd0d4('0x4'));var router=express[_0xd0d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd0d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0d4('0x7'));var controller=require(_0xd0d4('0x8'));router['get']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xa')]);router[_0xd0d4('0xb')]('/describe',auth[_0xd0d4('0x9')](),controller['describe']);router[_0xd0d4('0xb')]('/:id',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xc')]);router[_0xd0d4('0xb')]('/:id/users',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xd')]);router[_0xd0d4('0xb')](_0xd0d4('0xe'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xf')]);router['post']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x10')]);router[_0xd0d4('0x11')](_0xd0d4('0x12'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x13')]);router['post'](_0xd0d4('0xe'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x14')]);router['put']('/:id',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x15')]);router['delete'](_0xd0d4('0x16'),auth[_0xd0d4('0x9')](),controller['destroy']);router['delete'](_0xd0d4('0x12'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x17')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xd0d4('0x18')]);module[_0xd0d4('0x19')]=router; \ No newline at end of file +var _0x6dd1=['show','/:id/users','getAgents','getTeams','create','post','addAgents','/:id/teams','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/:id'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x6dd1,0x111));var _0x16dd=function(_0x22a991,_0x5524ef){_0x22a991=_0x22a991-0x0;var _0x16eb51=_0x6dd1[_0x22a991];return _0x16eb51;};'use strict';var multer=require(_0x16dd('0x0'));var util=require('util');var path=require(_0x16dd('0x1'));var timeout=require(_0x16dd('0x2'));var express=require('express');var router=express[_0x16dd('0x3')]();var fs_extra=require(_0x16dd('0x4'));var auth=require(_0x16dd('0x5'));var interaction=require(_0x16dd('0x6'));var config=require(_0x16dd('0x7'));var controller=require(_0x16dd('0x8'));router[_0x16dd('0x9')]('/',auth[_0x16dd('0xa')](),controller[_0x16dd('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x16dd('0x9')](_0x16dd('0xc'),auth[_0x16dd('0xa')](),controller[_0x16dd('0xd')]);router['get'](_0x16dd('0xe'),auth['isAuthenticated'](),controller[_0x16dd('0xf')]);router['get']('/:id/teams',auth[_0x16dd('0xa')](),controller[_0x16dd('0x10')]);router['post']('/',auth[_0x16dd('0xa')](),controller[_0x16dd('0x11')]);router[_0x16dd('0x12')]('/:id/users',auth[_0x16dd('0xa')](),controller[_0x16dd('0x13')]);router[_0x16dd('0x12')](_0x16dd('0x14'),auth[_0x16dd('0xa')](),controller['addTeams']);router['put'](_0x16dd('0xc'),auth['isAuthenticated'](),controller[_0x16dd('0x15')]);router[_0x16dd('0x16')](_0x16dd('0xc'),auth[_0x16dd('0xa')](),controller[_0x16dd('0x17')]);router[_0x16dd('0x16')](_0x16dd('0xe'),auth[_0x16dd('0xa')](),controller['removeAgents']);router[_0x16dd('0x16')](_0x16dd('0x14'),auth[_0x16dd('0xa')](),controller[_0x16dd('0x18')]);module[_0x16dd('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index eb14170..415d45a 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 _0x9a08=['sequelize','name','VIRTUAL','system-','STRING'];(function(_0x263e2e,_0x47a7e9){var _0x4c0fec=function(_0x20ebb5){while(--_0x20ebb5){_0x263e2e['push'](_0x263e2e['shift']());}};_0x4c0fec(++_0x47a7e9);}(_0x9a08,0x122));var _0x89a0=function(_0x2e846f,_0x57929a){_0x2e846f=_0x2e846f-0x0;var _0x42f147=_0x9a08[_0x2e846f];return _0x42f147;};'use strict';var Sequelize=require(_0x89a0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x89a0('0x1')},'prefix':{'type':Sequelize[_0x89a0('0x2')],'get':function(_0xfa54eb){return _0x89a0('0x3')+this['getDataValue'](_0x89a0('0x1'))+'-';}},'description':{'type':Sequelize[_0x89a0('0x4')]},'callerIdAll':{'type':Sequelize[_0x89a0('0x4')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1eb5=['VIRTUAL','getDataValue','name','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eb5,0x148));var _0x51eb=function(_0xb40105,_0x8fd16b){_0xb40105=_0xb40105-0x0;var _0x14aa8b=_0x1eb5[_0xb40105];return _0x14aa8b;};'use strict';var Sequelize=require(_0x51eb('0x0'));module[_0x51eb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x51eb('0x2')],'get':function(_0x293399){return'system-'+this[_0x51eb('0x3')](_0x51eb('0x4'))+'-';}},'description':{'type':Sequelize[_0x51eb('0x5')]},'callerIdAll':{'type':Sequelize[_0x51eb('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 c3d10b3..9599be6 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 _0xc900=['voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VoicePrefix','includeAll','include','findAll','show','params','options','catch','destroy','find','describe','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','context','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','update','system-','sequelize','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','Team','getTeams','addTeams','Agents'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xc900,0xb3));var _0x0c90=function(_0x159683,_0x2a8ca9){_0x159683=_0x159683-0x0;var _0x4ed2c0=_0xc900[_0x159683];return _0x4ed2c0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];config['redis']=_[_0x0c90('0x19')](config[_0x0c90('0x1a')],{'host':_0x0c90('0x1b'),'port':0x18eb});var socket=require(_0x0c90('0x1c'))(new Redis(config[_0x0c90('0x1a')]));require('./voicePrefix.socket')[_0x0c90('0x1d')](socket);function respondWithStatusCode(_0x4451e0,_0x4f35f4){_0x4f35f4=_0x4f35f4||0xcc;return function(_0x2c82a4){if(_0x2c82a4){return _0x4451e0[_0x0c90('0x1e')](_0x4f35f4);}return _0x4451e0[_0x0c90('0x1f')](_0x4f35f4)['end']();};}function respondWithResult(_0x5daeb7,_0x412635){_0x412635=_0x412635||0xc8;return function(_0x15ca42){if(_0x15ca42){return _0x5daeb7[_0x0c90('0x1f')](_0x412635)[_0x0c90('0x20')](_0x15ca42);}};}function respondWithFilteredResult(_0x276b92,_0x2cab22){return function(_0x42321a){if(_0x42321a){var _0x57b9a6=typeof _0x2cab22[_0x0c90('0x21')]===_0x0c90('0x22')&&typeof _0x2cab22[_0x0c90('0x23')]===_0x0c90('0x22');var _0x594267=_0x42321a[_0x0c90('0x24')];var _0xd129ca=_0x57b9a6?0x0:_0x2cab22[_0x0c90('0x21')];var _0x1241a9=_0x57b9a6?_0x42321a[_0x0c90('0x24')]:_0x2cab22[_0x0c90('0x21')]+_0x2cab22['limit'];var _0x365a42;if(_0x1241a9>=_0x594267){_0x1241a9=_0x594267;_0x365a42=0xc8;}else{_0x365a42=0xce;}_0x276b92['status'](_0x365a42);return _0x276b92[_0x0c90('0x25')](_0x0c90('0x26'),_0xd129ca+'-'+_0x1241a9+'/'+_0x594267)['json'](_0x42321a);}return null;};}function patchUpdates(_0x2a053a){return function(_0x43ddc3){try{jsonpatch[_0x0c90('0x27')](_0x43ddc3,_0x2a053a,!![]);}catch(_0x86dee){return BPromise[_0x0c90('0x28')](_0x86dee);}return _0x43ddc3[_0x0c90('0x29')]();};}function saveUpdates(_0x4dfbc3,_0x26f0a3){return function(_0x12f22c){if(_0x12f22c){return _0x12f22c['update'](_0x4dfbc3)['then'](function(_0x28d005){return _0x28d005;});}return null;};}function removeEntity(_0x3ea861,_0x35c243){return function(_0x109a5f){if(_0x109a5f){return _0x109a5f['destroy']()[_0x0c90('0x2a')](function(){var _0x438652=_0x109a5f[_0x0c90('0x2b')]({'plain':!![]});var _0x277d4a=_0x0c90('0x2c');return db[_0x0c90('0x2d')]['destroy']({'where':{'type':_0x277d4a,'resourceId':_0x438652['id']}})[_0x0c90('0x2a')](function(){return _0x109a5f;});})[_0x0c90('0x2a')](function(){_0x3ea861[_0x0c90('0x1f')](0xcc)[_0x0c90('0x2e')]();});}};}function handleEntityNotFound(_0x52d28d,_0x4c8603){return function(_0x1f27f1){if(!_0x1f27f1){_0x52d28d[_0x0c90('0x1e')](0x194);}return _0x1f27f1;};}function handleError(_0x3bff04,_0x122a4f){_0x122a4f=_0x122a4f||0x1f4;return function(_0x119e09){logger['error'](_0x119e09[_0x0c90('0x2f')]);if(_0x119e09[_0x0c90('0x30')]){delete _0x119e09[_0x0c90('0x30')];}_0x3bff04['status'](_0x122a4f)[_0x0c90('0x31')](_0x119e09);};}exports['index']=function(_0x54a3f5,_0x886634){var _0x5071b={},_0x2f0835={},_0x41189f={'count':0x0,'rows':[]};var _0x58c01a=_[_0x0c90('0x32')](db['VoicePrefix'][_0x0c90('0x33')],function(_0x5a0e75){return{'name':_0x5a0e75[_0x0c90('0x34')],'type':_0x5a0e75[_0x0c90('0x35')]['key']};});_0x2f0835[_0x0c90('0x36')]=_[_0x0c90('0x32')](_0x58c01a,_0x0c90('0x30'));_0x2f0835[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x54a3f5[_0x0c90('0x37')]);_0x2f0835[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x2f0835['model'],_0x2f0835[_0x0c90('0x37')]);_0x5071b[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x2f0835[_0x0c90('0x36')],qs['fields'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x5071b[_0x0c90('0x3b')]=_0x5071b[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x5071b[_0x0c90('0x3b')]:_0x2f0835[_0x0c90('0x36')];if(!_0x54a3f5[_0x0c90('0x37')]['hasOwnProperty'](_0x0c90('0x3e'))){_0x5071b[_0x0c90('0x23')]=qs['limit'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x23')]);_0x5071b[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x54a3f5[_0x0c90('0x37')]['offset']);}_0x5071b[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x40')]);_0x5071b[_0x0c90('0x41')]=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x54a3f5[_0x0c90('0x37')],_0x2f0835[_0x0c90('0x39')]),_0x58c01a);if(_0x54a3f5['query'][_0x0c90('0x43')]){_0x5071b['where']=_[_0x0c90('0x44')](_0x5071b['where'],{'$or':_[_0x0c90('0x32')](_0x58c01a,function(_0x62e316){if(_0x62e316['type']!=='VIRTUAL'){var _0x27ef6f={};_0x27ef6f[_0x62e316['name']]={'$like':'%'+_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x27ef6f;}})});}_0x5071b=_[_0x0c90('0x44')]({},_0x5071b,_0x54a3f5['options']);var _0x2ad8eb={'where':_0x5071b[_0x0c90('0x41')]};return db[_0x0c90('0x45')][_0x0c90('0x24')](_0x2ad8eb)[_0x0c90('0x2a')](function(_0x1184c4){_0x41189f['count']=_0x1184c4;if(_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x46')]){_0x5071b[_0x0c90('0x47')]=[{'all':!![]}];}return db[_0x0c90('0x45')][_0x0c90('0x48')](_0x5071b);})[_0x0c90('0x2a')](function(_0x30b9df){_0x41189f['rows']=_0x30b9df;return _0x41189f;})[_0x0c90('0x2a')](respondWithFilteredResult(_0x886634,_0x5071b))['catch'](handleError(_0x886634,null));};exports[_0x0c90('0x49')]=function(_0x2470ce,_0x1a7a36){var _0x1179b0={'raw':![],'where':{'id':_0x2470ce[_0x0c90('0x4a')]['id']}},_0x38842c={};_0x38842c[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x45')][_0x0c90('0x33')]);_0x38842c[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2470ce[_0x0c90('0x37')]);_0x38842c[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x38842c['model'],_0x38842c[_0x0c90('0x37')]);_0x1179b0[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x38842c[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x2470ce[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x1179b0[_0x0c90('0x3b')]=_0x1179b0[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x1179b0[_0x0c90('0x3b')]:_0x38842c[_0x0c90('0x36')];if(_0x2470ce[_0x0c90('0x37')][_0x0c90('0x46')]){_0x1179b0['include']=[{'all':!![]}];}_0x1179b0=_[_0x0c90('0x44')]({},_0x1179b0,_0x2470ce[_0x0c90('0x4b')]);return db['VoicePrefix']['find'](_0x1179b0)['then'](handleEntityNotFound(_0x1a7a36,null))[_0x0c90('0x2a')](respondWithResult(_0x1a7a36,null))[_0x0c90('0x4c')](handleError(_0x1a7a36,null));};exports[_0x0c90('0x4d')]=function(_0x3fbdfc,_0x11d2de){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x3fbdfc[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x11d2de,null))['then'](removeEntity(_0x11d2de,null))[_0x0c90('0x4c')](handleError(_0x11d2de,null));};exports[_0x0c90('0x4f')]=function(_0xd639a1,_0xb483e7){return db[_0x0c90('0x45')][_0x0c90('0x4f')]()[_0x0c90('0x2a')](respondWithResult(_0xb483e7,null))[_0x0c90('0x4c')](handleError(_0xb483e7,null));};exports[_0x0c90('0x50')]=function(_0xeeee3b,_0x5e288e){var _0xac80b2;return db['sequelize'][_0x0c90('0x51')](function(_0x67539d){return db[_0x0c90('0x45')][_0x0c90('0x50')](_0xeeee3b[_0x0c90('0x52')],{'transaction':_0x67539d})[_0x0c90('0x2a')](function(_0x58dcfc){_0xac80b2=_0x58dcfc['get']({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xac80b2[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x3bf5de){return createVoicePrefixExtensions(_0xac80b2,_0x3bf5de,_0x67539d);});});})['then'](function(){var _0x202666=_0xeeee3b[_0x0c90('0x54')]['get']({'plain':!![]});if(!_0x202666)throw new Error(_0x0c90('0x55'));if(_0x202666['role']===_0x0c90('0x54')){var _0x8951f2=_0xac80b2;return db[_0x0c90('0x56')][_0x0c90('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x202666[_0x0c90('0x57')]},'raw':!![]})['then'](function(_0x344613){if(_0x344613&&_0x344613[_0x0c90('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x8951f2['name'],'resourceId':_0x8951f2['id'],'type':_0x344613[_0x0c90('0x30')],'sectionId':_0x344613['id']},{})[_0x0c90('0x2a')](function(){return _0xac80b2;});}else{return _0xac80b2;}})[_0x0c90('0x4c')](function(_0x2f61cb){logger[_0x0c90('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f61cb);throw _0x2f61cb;});}return _0xac80b2;})[_0x0c90('0x2a')](respondWithResult(_0x5e288e,null))[_0x0c90('0x4c')](handleError(_0x5e288e,null));};function Extension(_0x5ee971,_0x3eb725,_0x5a11e5,_0x24326b){this[_0x0c90('0x5a')]='from-sip';this[_0x0c90('0x5b')]=_0x5ee971;this['app']=_0x5a11e5;this['type']='system';this[_0x0c90('0x5c')]=_0x0c90('0x5d');this[_0x0c90('0x5e')]=_0x3eb725;this[_0x0c90('0x5f')]=_0x24326b;}function createVoicePrefixExtensions(_0x536a26,_0x5b385b,_0x426f65){return new BPromise(function(_0xd982c5,_0x120b88){var _0x4c4e5a=new Extension(formatPrefixName(_0x536a26[_0x0c90('0x60')]),0x1,_0x0c90('0x61'),_0x0c90('0x62'));_0x4c4e5a['VoicePrefixId']=_0x536a26['id'];return db[_0x0c90('0x63')][_0x0c90('0x50')](_0x4c4e5a,{'transaction':_0x426f65})[_0x0c90('0x2a')](function(_0x521436){var _0x31343b=_0x521436[_0x0c90('0x2b')]({'plain':!![]});var _0x1a198b=_[_0x0c90('0x32')](addVoicePrefixExtensions(_0x536a26,_0x5b385b),function(_0xf58a25){_0xf58a25[_0x0c90('0x53')]=_0x31343b['id'];_0xf58a25[_0x0c90('0x64')]=_0x536a26['id'];return _0xf58a25;});return db[_0x0c90('0x63')][_0x0c90('0x65')](_0x1a198b,{'transaction':_0x426f65})['then'](function(_0x530bbe){if(!_0x530bbe){return _0x120b88(_0x0c90('0x66'));}else{return _0xd982c5(_0x530bbe);}})[_0x0c90('0x4c')](function(_0x3a44df){return _0x120b88(_0x3a44df);});});;});};function addVoicePrefixExtensions(_0x2faf14,_0x19dae5){var _0x2dad30=[];var _0x2f1459=formatPrefixName(_0x2faf14[_0x0c90('0x60')]);_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x2,_0x0c90('0x68'),_0x0c90('0x69')+_0x2faf14[_0x0c90('0x30')]));if(_0x2faf14[_0x0c90('0x6a')]){_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x68'),'PREFIX-CALLERIDALL='+_0x2faf14[_0x0c90('0x6a')]));}else{_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x61'),'No\x20callerid\x20available'));}_0x2dad30['push'](new Extension(_0x2f1459,0x4,_0x0c90('0x6b'),_0x19dae5['context']+','+_0x0c90('0x6c')+(0x8+_0x2faf14[_0x0c90('0x30')]['length'])+'}'+','+0x1));return _0x2dad30;}function formatPrefixName(_0x2c64e0){var _0x3f4819='_';for(var _0x25ef97=0x0;_0x25ef97<_0x2c64e0[_0x0c90('0x3d')];_0x25ef97++){if(_0x2c64e0['charAt'](_0x25ef97)=='-'){_0x3f4819+=_0x2c64e0['charAt'](_0x25ef97);}else{_0x3f4819+='['+_0x2c64e0['charAt'](_0x25ef97)+']';}}_0x3f4819+='.';return _0x3f4819;}exports[_0x0c90('0x6d')]=function(_0x2d3287,_0x3bc90d,_0x2d5fe3){var _0x4a801f=_0x2d3287[_0x0c90('0x52')];_0x4a801f['prefix']=_0x0c90('0x6e')+_0x4a801f[_0x0c90('0x30')]+'-';return db[_0x0c90('0x6f')]['transaction'](function(_0x10f686){return db[_0x0c90('0x45')][_0x0c90('0x6d')](_0x4a801f,{'where':{'id':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension'][_0x0c90('0x4e')]({'where':{'id':_0x4a801f[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x4a59b5){return createVoicePrefixExtensions(_0x4a801f,_0x4a59b5,_0x10f686);});});});})[_0x0c90('0x2a')](function(){return db[_0x0c90('0x45')][_0x0c90('0x70')](_0x4a801f['id']);})[_0x0c90('0x2a')](respondWithResult(_0x3bc90d,null))[_0x0c90('0x4c')](handleError(_0x3bc90d,null));};exports[_0x0c90('0x71')]=function(_0x53779b,_0x28a2f0,_0x431828){return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x53779b[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x28a2f0,null))[_0x0c90('0x2a')](function(_0x1777ac){if(_0x1777ac){return _0x1777ac[_0x0c90('0x71')](_0x53779b[_0x0c90('0x52')]['ids'],_[_0x0c90('0x72')](_0x53779b[_0x0c90('0x52')],[_0x0c90('0x73'),'id'])||{})[_0x0c90('0x74')](function(_0x4e8330){for(var _0x2e68ea=0x0;_0x2e68ea<_0x53779b[_0x0c90('0x52')][_0x0c90('0x73')]['length'];_0x2e68ea+=0x1){socket[_0x0c90('0x75')](_0x0c90('0x76'),{'UserId':Number(_0x53779b['body'][_0x0c90('0x73')][_0x2e68ea]),'VoicePrefixId':Number(_0x53779b['params']['id'])});}return _0x4e8330;});}})[_0x0c90('0x2a')](respondWithResult(_0x28a2f0,null))['catch'](handleError(_0x28a2f0,null));};exports['removeAgents']=function(_0x42e76a,_0x137c30,_0x56a38b){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x42e76a[_0x0c90('0x4a')]['id']}})['then'](handleEntityNotFound(_0x137c30,null))['then'](function(_0x250d41){if(_0x250d41){return _0x250d41['removeAgents'](_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')])[_0x0c90('0x2a')](function(){if(_[_0x0c90('0x77')](_0x42e76a[_0x0c90('0x37')]['ids'])){for(var _0x471caa=0x0;_0x471caa<_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')]['length'];_0x471caa+=0x1){socket['emit'](_0x0c90('0x78'),{'UserId':Number(_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')][_0x471caa]),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x42e76a[_0x0c90('0x37')]['ids']),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x137c30,null))['catch'](handleError(_0x137c30,null));};exports[_0x0c90('0x79')]=function(_0x2ca017,_0x1bf6e0,_0x29ede1){var _0x16c383={};var _0x56a3bc={};var _0x5562cc;var _0x57eab8;return db[_0x0c90('0x45')][_0x0c90('0x7a')]({'where':{'id':_0x2ca017[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x1bf6e0,null))[_0x0c90('0x2a')](function(_0x3d5521){if(_0x3d5521){_0x5562cc=_0x3d5521;_0x56a3bc['model']=_[_0x0c90('0x38')](db[_0x0c90('0x7b')][_0x0c90('0x33')]);_0x56a3bc[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2ca017[_0x0c90('0x37')]);_0x56a3bc[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x56a3bc[_0x0c90('0x36')],_0x56a3bc[_0x0c90('0x37')]);_0x16c383[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x56a3bc['model'],qs[_0x0c90('0x3c')](_0x2ca017['query'][_0x0c90('0x3c')]));_0x16c383['attributes']=_0x16c383[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x16c383[_0x0c90('0x3b')]:_0x56a3bc[_0x0c90('0x36')];_0x16c383['order']=qs['sort'](_0x2ca017[_0x0c90('0x37')][_0x0c90('0x40')]);_0x16c383['where']=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x2ca017['query'],_0x56a3bc[_0x0c90('0x39')]));if(_0x2ca017[_0x0c90('0x37')]['filter']){_0x16c383[_0x0c90('0x41')]=_['merge'](_0x16c383[_0x0c90('0x41')],{'$or':_[_0x0c90('0x32')](_0x16c383[_0x0c90('0x3b')],function(_0x1b95db){var _0x519f74={};_0x519f74[_0x1b95db]={'$like':'%'+_0x2ca017[_0x0c90('0x37')]['filter']+'%'};return _0x519f74;})});}_0x16c383=_[_0x0c90('0x44')]({},_0x16c383,_0x2ca017[_0x0c90('0x4b')]);return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})[_0x0c90('0x2a')](function(_0x1306bb){if(_0x1306bb){_0x57eab8=_0x1306bb['length'];if(!_0x2ca017[_0x0c90('0x37')][_0x0c90('0x7c')](_0x0c90('0x3e'))){_0x16c383[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x2ca017[_0x0c90('0x37')]['limit']);_0x16c383[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x2ca017['query'][_0x0c90('0x21')]);}return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})['then'](function(_0x199d05){if(_0x199d05){return _0x199d05?{'count':_0x57eab8,'rows':_0x199d05}:null;}})[_0x0c90('0x2a')](respondWithResult(_0x1bf6e0,null))['catch'](handleError(_0x1bf6e0,null));};exports['getTeams']=function(_0x13c69c,_0x407c6e,_0x4859e9){var _0x391e3f={};var _0x4fee0e={};var _0x37d1d5;var _0x4c142b;return db['VoicePrefix'][_0x0c90('0x7a')]({'where':{'id':_0x13c69c[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x407c6e,null))['then'](function(_0x54846c){if(_0x54846c){_0x37d1d5=_0x54846c;_0x4fee0e[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x7d')][_0x0c90('0x33')]);_0x4fee0e[_0x0c90('0x37')]=_['keys'](_0x13c69c[_0x0c90('0x37')]);_0x4fee0e['filters']=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],_0x4fee0e[_0x0c90('0x37')]);_0x391e3f[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x13c69c['query']['fields']));_0x391e3f[_0x0c90('0x3b')]=_0x391e3f[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x391e3f[_0x0c90('0x3b')]:_0x4fee0e[_0x0c90('0x36')];_0x391e3f[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x13c69c[_0x0c90('0x37')]['sort']);_0x391e3f[_0x0c90('0x41')]=qs['filters'](_[_0x0c90('0x42')](_0x13c69c[_0x0c90('0x37')],_0x4fee0e[_0x0c90('0x39')]));if(_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]){_0x391e3f[_0x0c90('0x41')]=_[_0x0c90('0x44')](_0x391e3f['where'],{'$or':_['map'](_0x391e3f[_0x0c90('0x3b')],function(_0x4a001d){var _0x2204fe={};_0x2204fe[_0x4a001d]={'$like':'%'+_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x2204fe;})});}_0x391e3f=_['merge']({},_0x391e3f,_0x13c69c[_0x0c90('0x4b')]);return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x30be13){if(_0x30be13){_0x4c142b=_0x30be13[_0x0c90('0x3d')];if(!_0x13c69c['query']['hasOwnProperty'](_0x0c90('0x3e'))){_0x391e3f[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x23')]);_0x391e3f[_0x0c90('0x21')]=qs['offset'](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x21')]);}return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x5103ae){if(_0x5103ae){return _0x5103ae?{'count':_0x4c142b,'rows':_0x5103ae}:null;}})['then'](respondWithResult(_0x407c6e,null))[_0x0c90('0x4c')](handleError(_0x407c6e,null));};exports[_0x0c90('0x7f')]=function(_0x59e8d9,_0x9bed36,_0x379a0e){var _0x19a144=_0x59e8d9[_0x0c90('0x52')][_0x0c90('0x73')];var _0x5379bc;return db[_0x0c90('0x7d')]['findAll']({'where':{'id':_0x19a144},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id',_0x0c90('0x30'),'online',_0x0c90('0x81'),_0x0c90('0x82')],'raw':!![]}]})[_0x0c90('0x2a')](function(_0x5f295e){if(_0x5f295e){_0x5379bc=_0x5f295e;var _0x5a2961=_['flatMap'](_0x5f295e,function(_0x4930cd){var _0x2858a9=_0x4930cd[_0x0c90('0x2b')]({'plain':!![]});return _0x2858a9['Agents'];});return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x59e8d9['params']['id']}})[_0x0c90('0x2a')](function(_0x13c0f2){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x1091fb){return _0x13c0f2['addTeams'](_0x19a144,{'transaction':_0x1091fb})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5379bc,function(_0x35ee25){return db[_0x0c90('0x84')][_0x0c90('0x85')]({'TeamId':_0x35ee25['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},{'transaction':_0x1091fb});});})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5a2961,function(_0x3614d1){return db[_0x0c90('0x86')]['findOrCreate']({'where':{'UserId':_0x3614d1['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},'transaction':_0x1091fb});});})['then'](function(){_0x5a2961[_0x0c90('0x87')](function(_0x40dd25){socket[_0x0c90('0x75')]('userVoicePrefix:save',{'UserId':_0x40dd25['id'],'VoicePrefixId':_0x13c0f2['id']});});});});});}})[_0x0c90('0x2a')](respondWithStatusCode(_0x9bed36,null))['catch'](handleError(_0x9bed36,null));};exports[_0x0c90('0x88')]=function(_0x1c2814,_0x2f542b,_0x3f3787){return db[_0x0c90('0x7d')][_0x0c90('0x48')]({'where':{'id':_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')]},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f542b,null))[_0x0c90('0x2a')](function(_0x31dde9){var _0x37acdc=_['map'](_0x31dde9,'id');var _0x5f431d=[];var _0x2dabe6=[];var _0x28736e=squel['select']();_0x28736e['field'](_0x0c90('0x89'))[_0x0c90('0x8a')]('team_has_voice_prefixes','tq')[_0x0c90('0x8b')](_0x0c90('0x8c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0c90('0x41')](_0x0c90('0x8d'),_0x1c2814['params']['id']);for(var _0x1fb55a=0x0;_0x1fb55a<_0x31dde9['length'];_0x1fb55a+=0x1){let _0x5aa532=_0x31dde9[_0x1fb55a];for(var _0x8e8e30=0x0;_0x8e8e30<_0x5aa532[_0x0c90('0x80')]['length'];_0x8e8e30+=0x1){let _0x5c942d=_0x5aa532[_0x0c90('0x80')][_0x8e8e30];var _0x155915=_0x28736e[_0x0c90('0x8e')]();_0x155915[_0x0c90('0x41')](_0x0c90('0x8f'),_0x5c942d['id']);_0x2dabe6['push'](db[_0x0c90('0x6f')][_0x0c90('0x37')](_0x155915[_0x0c90('0x90')](),{'type':db[_0x0c90('0x6f')][_0x0c90('0x91')][_0x0c90('0x92')]})['then'](function(_0x18cc89){if(_0x18cc89['length']===0x1){return _0x5c942d['id'];}else{var _0x5e6e8f=_['every'](_[_0x0c90('0x32')](_0x18cc89,_0x0c90('0x93')),function(_0x53c760){return _[_0x0c90('0x94')](_0x37acdc,_0x53c760);});if(_0x5e6e8f){return _0x5c942d['id'];}}}));}}return BPromise['all'](_0x2dabe6)['then'](function(_0x22b3df){_0x5f431d=_(_0x5f431d)[_0x0c90('0x95')](_0x22b3df)[_0x0c90('0x96')]()[_0x0c90('0x97')]();return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x1c2814[_0x0c90('0x4a')]['id']}})['then'](function(_0x2eece9){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x3817a4){return _0x2eece9[_0x0c90('0x88')](_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')],{'transaction':_0x3817a4})[_0x0c90('0x2a')](function(){if(!_[_0x0c90('0x98')](_0x5f431d)){return _0x2eece9[_0x0c90('0x99')](_0x5f431d,{'transaction':_0x3817a4});}})[_0x0c90('0x2a')](function(){_0x5f431d[_0x0c90('0x87')](function(_0x9187af){socket[_0x0c90('0x75')]('userVoicePrefix:remove',{'UserId':_0x9187af,'VoicePrefixId':_0x2eece9['id']});});});});});});})[_0x0c90('0x2a')](respondWithStatusCode(_0x2f542b,null))[_0x0c90('0x4c')](handleError(_0x2f542b,null));}; \ No newline at end of file +var _0xd4f4=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voicePrefix.socket','register','sendStatus','end','status','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','options','includeAll','include','VoicePrefix','rows','catch','show','keys','find','params','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','priority','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','length','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','Team','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x58039c,_0x2058c6){var _0x5a6f44=function(_0x50a5c0){while(--_0x50a5c0){_0x58039c['push'](_0x58039c['shift']());}};_0x5a6f44(++_0x2058c6);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x58cb55,_0x17428a){_0x58cb55=_0x58cb55-0x0;var _0x2c9474=_0xd4f4[_0x58cb55];return _0x2c9474;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x4d4f('0x1d')],{'host':_0x4d4f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d4f('0x1d')]));require(_0x4d4f('0x1f'))[_0x4d4f('0x20')](socket);function respondWithStatusCode(_0x59252c,_0x145804){_0x145804=_0x145804||0xcc;return function(_0x2e736b){if(_0x2e736b){return _0x59252c[_0x4d4f('0x21')](_0x145804);}return _0x59252c['status'](_0x145804)[_0x4d4f('0x22')]();};}function respondWithResult(_0x5e4ff5,_0x18a528){_0x18a528=_0x18a528||0xc8;return function(_0x16f8e7){if(_0x16f8e7){return _0x5e4ff5[_0x4d4f('0x23')](_0x18a528)['json'](_0x16f8e7);}};}function respondWithFilteredResult(_0x30b6b1,_0x17a437){return function(_0x51dcf1){if(_0x51dcf1){var _0x5dbbeb=typeof _0x17a437['offset']==='undefined'&&typeof _0x17a437['limit']===_0x4d4f('0x24');var _0x15100a=_0x51dcf1[_0x4d4f('0x25')];var _0x3566a5=_0x5dbbeb?0x0:_0x17a437['offset'];var _0x5b2863=_0x5dbbeb?_0x51dcf1[_0x4d4f('0x25')]:_0x17a437['offset']+_0x17a437[_0x4d4f('0x26')];var _0x1e3e9a;if(_0x5b2863>=_0x15100a){_0x5b2863=_0x15100a;_0x1e3e9a=0xc8;}else{_0x1e3e9a=0xce;}_0x30b6b1[_0x4d4f('0x23')](_0x1e3e9a);return _0x30b6b1[_0x4d4f('0x27')](_0x4d4f('0x28'),_0x3566a5+'-'+_0x5b2863+'/'+_0x15100a)['json'](_0x51dcf1);}return null;};}function patchUpdates(_0x570520){return function(_0x4043f2){try{jsonpatch['apply'](_0x4043f2,_0x570520,!![]);}catch(_0x247077){return BPromise[_0x4d4f('0x29')](_0x247077);}return _0x4043f2[_0x4d4f('0x2a')]();};}function saveUpdates(_0x3f4a55,_0xf3f7a4){return function(_0x497cec){if(_0x497cec){return _0x497cec[_0x4d4f('0x2b')](_0x3f4a55)[_0x4d4f('0x2c')](function(_0x1cf365){return _0x1cf365;});}return null;};}function removeEntity(_0x28443b,_0x5cf9e7){return function(_0x51a7c5){if(_0x51a7c5){return _0x51a7c5[_0x4d4f('0x2d')]()[_0x4d4f('0x2c')](function(){var _0xa2492c=_0x51a7c5[_0x4d4f('0x2e')]({'plain':!![]});var _0x58acbe=_0x4d4f('0x2f');return db[_0x4d4f('0x30')][_0x4d4f('0x2d')]({'where':{'type':_0x58acbe,'resourceId':_0xa2492c['id']}})[_0x4d4f('0x2c')](function(){return _0x51a7c5;});})['then'](function(){_0x28443b[_0x4d4f('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1688bb,_0x333a40){return function(_0x550040){if(!_0x550040){_0x1688bb[_0x4d4f('0x21')](0x194);}return _0x550040;};}function handleError(_0x123383,_0x287a09){_0x287a09=_0x287a09||0x1f4;return function(_0x3d7f14){logger[_0x4d4f('0x31')](_0x3d7f14[_0x4d4f('0x32')]);if(_0x3d7f14['name']){delete _0x3d7f14[_0x4d4f('0x33')];}_0x123383[_0x4d4f('0x23')](_0x287a09)[_0x4d4f('0x34')](_0x3d7f14);};}exports[_0x4d4f('0x35')]=function(_0x104104,_0x4e47e5){var _0x2d6565={},_0x486e33={},_0x35f9e2={'count':0x0,'rows':[]};var _0x537a47=_['map'](db['VoicePrefix'][_0x4d4f('0x36')],function(_0x57fc2b){return{'name':_0x57fc2b[_0x4d4f('0x37')],'type':_0x57fc2b[_0x4d4f('0x38')][_0x4d4f('0x39')]};});_0x486e33['model']=_[_0x4d4f('0x3a')](_0x537a47,_0x4d4f('0x33'));_0x486e33[_0x4d4f('0x3b')]=_['keys'](_0x104104[_0x4d4f('0x3b')]);_0x486e33['filters']=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],_0x486e33[_0x4d4f('0x3b')]);_0x2d6565[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x104104[_0x4d4f('0x3b')]['fields']));_0x2d6565['attributes']=_0x2d6565[_0x4d4f('0x3e')]['length']?_0x2d6565['attributes']:_0x486e33[_0x4d4f('0x3d')];if(!_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x40')](_0x4d4f('0x41'))){_0x2d6565[_0x4d4f('0x26')]=qs['limit'](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2d6565['offset']=qs[_0x4d4f('0x42')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}_0x2d6565[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x44')]);_0x2d6565[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_['pick'](_0x104104['query'],_0x486e33[_0x4d4f('0x46')]),_0x537a47);if(_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x47')]){_0x2d6565[_0x4d4f('0x45')]=_['merge'](_0x2d6565['where'],{'$or':_[_0x4d4f('0x3a')](_0x537a47,function(_0x3c34bd){if(_0x3c34bd['type']!=='VIRTUAL'){var _0x3591b7={};_0x3591b7[_0x3c34bd[_0x4d4f('0x33')]]={'$like':'%'+_0x104104['query'][_0x4d4f('0x47')]+'%'};return _0x3591b7;}})});}_0x2d6565=_[_0x4d4f('0x48')]({},_0x2d6565,_0x104104[_0x4d4f('0x49')]);var _0x32c6ff={'where':_0x2d6565[_0x4d4f('0x45')]};return db['VoicePrefix'][_0x4d4f('0x25')](_0x32c6ff)['then'](function(_0x45a0c1){_0x35f9e2[_0x4d4f('0x25')]=_0x45a0c1;if(_0x104104['query'][_0x4d4f('0x4a')]){_0x2d6565[_0x4d4f('0x4b')]=[{'all':!![]}];}return db[_0x4d4f('0x4c')]['findAll'](_0x2d6565);})[_0x4d4f('0x2c')](function(_0x48caa2){_0x35f9e2[_0x4d4f('0x4d')]=_0x48caa2;return _0x35f9e2;})['then'](respondWithFilteredResult(_0x4e47e5,_0x2d6565))[_0x4d4f('0x4e')](handleError(_0x4e47e5,null));};exports[_0x4d4f('0x4f')]=function(_0x231134,_0x2939cb){var _0x198c3a={'raw':![],'where':{'id':_0x231134['params']['id']}},_0x4a53e4={};_0x4a53e4[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x4c')][_0x4d4f('0x36')]);_0x4a53e4['query']=_['keys'](_0x231134['query']);_0x4a53e4[_0x4d4f('0x46')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],_0x4a53e4[_0x4d4f('0x3b')]);_0x198c3a[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x231134[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x198c3a[_0x4d4f('0x3e')]=_0x198c3a[_0x4d4f('0x3e')]['length']?_0x198c3a[_0x4d4f('0x3e')]:_0x4a53e4[_0x4d4f('0x3d')];if(_0x231134['query'][_0x4d4f('0x4a')]){_0x198c3a['include']=[{'all':!![]}];}_0x198c3a=_[_0x4d4f('0x48')]({},_0x198c3a,_0x231134[_0x4d4f('0x49')]);return db['VoicePrefix'][_0x4d4f('0x51')](_0x198c3a)[_0x4d4f('0x2c')](handleEntityNotFound(_0x2939cb,null))[_0x4d4f('0x2c')](respondWithResult(_0x2939cb,null))[_0x4d4f('0x4e')](handleError(_0x2939cb,null));};exports[_0x4d4f('0x2d')]=function(_0x3eae74,_0x11a63e){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x3eae74[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x11a63e,null))[_0x4d4f('0x2c')](removeEntity(_0x11a63e,null))['catch'](handleError(_0x11a63e,null));};exports[_0x4d4f('0x53')]=function(_0x539088,_0x59d245){return db['VoicePrefix'][_0x4d4f('0x53')]()[_0x4d4f('0x2c')](respondWithResult(_0x59d245,null))['catch'](handleError(_0x59d245,null));};exports['create']=function(_0x2a3bc4,_0x4c80c4){var _0x5adc7b;return db[_0x4d4f('0x54')]['transaction'](function(_0x17b59e){return db[_0x4d4f('0x4c')][_0x4d4f('0x55')](_0x2a3bc4[_0x4d4f('0x56')],{'transaction':_0x17b59e})['then'](function(_0x224b83){_0x5adc7b=_0x224b83[_0x4d4f('0x2e')]({'plain':!![]});return db[_0x4d4f('0x57')][_0x4d4f('0x51')]({'where':{'id':_0x5adc7b[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x10f94e){return createVoicePrefixExtensions(_0x5adc7b,_0x10f94e,_0x17b59e);});});})['then'](function(){var _0x32cba6=_0x2a3bc4['user'][_0x4d4f('0x2e')]({'plain':!![]});if(!_0x32cba6)throw new Error(_0x4d4f('0x59'));if(_0x32cba6['role']===_0x4d4f('0x5a')){var _0x1d8ae6=_0x5adc7b;return db['UserProfileSection'][_0x4d4f('0x51')]({'where':{'name':'VoicePrefixes','userProfileId':_0x32cba6[_0x4d4f('0x5b')]},'raw':!![]})['then'](function(_0x48ad06){if(_0x48ad06&&_0x48ad06[_0x4d4f('0x5c')]===0x0){return db[_0x4d4f('0x30')][_0x4d4f('0x55')]({'name':_0x1d8ae6[_0x4d4f('0x33')],'resourceId':_0x1d8ae6['id'],'type':_0x48ad06[_0x4d4f('0x33')],'sectionId':_0x48ad06['id']},{})['then'](function(){return _0x5adc7b;});}else{return _0x5adc7b;}})['catch'](function(_0xeaccdd){logger['error'](_0x4d4f('0x5d'),_0xeaccdd);throw _0xeaccdd;});}return _0x5adc7b;})[_0x4d4f('0x2c')](respondWithResult(_0x4c80c4,null))[_0x4d4f('0x4e')](handleError(_0x4c80c4,null));};function Extension(_0x4585b5,_0x31aba3,_0x39ae15,_0x585764){this[_0x4d4f('0x5e')]=_0x4d4f('0x5f');this[_0x4d4f('0x60')]=_0x4585b5;this['app']=_0x39ae15;this[_0x4d4f('0x38')]=_0x4d4f('0x61');this[_0x4d4f('0x62')]='Voice\x20Prefix\x20Extension';this[_0x4d4f('0x63')]=_0x31aba3;this['appdata']=_0x585764;}function createVoicePrefixExtensions(_0xcdab8b,_0x2145ca,_0x1fe5ca){return new BPromise(function(_0xe8d3e2,_0x1edb3d){var _0x2e55f5=new Extension(formatPrefixName(_0xcdab8b[_0x4d4f('0x64')]),0x1,_0x4d4f('0x65'),_0x4d4f('0x66'));_0x2e55f5['VoicePrefixId']=_0xcdab8b['id'];return db[_0x4d4f('0x57')][_0x4d4f('0x55')](_0x2e55f5,{'transaction':_0x1fe5ca})['then'](function(_0x1bd4b1){var _0x2a3738=_0x1bd4b1[_0x4d4f('0x2e')]({'plain':!![]});var _0xae8fe=_['map'](addVoicePrefixExtensions(_0xcdab8b,_0x2145ca),function(_0x4013a9){_0x4013a9[_0x4d4f('0x58')]=_0x2a3738['id'];_0x4013a9['VoicePrefixId']=_0xcdab8b['id'];return _0x4013a9;});return db['VoiceExtension'][_0x4d4f('0x67')](_0xae8fe,{'transaction':_0x1fe5ca})[_0x4d4f('0x2c')](function(_0x53b2db){if(!_0x53b2db){return _0x1edb3d('Extensions\x20creation\x20failed');}else{return _0xe8d3e2(_0x53b2db);}})['catch'](function(_0x4752bd){return _0x1edb3d(_0x4752bd);});});;});};function addVoicePrefixExtensions(_0x351fb5,_0x5e0ead){var _0x347bb1=[];var _0xc596ea=formatPrefixName(_0x351fb5[_0x4d4f('0x64')]);_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x2,_0x4d4f('0x69'),_0x4d4f('0x6a')+_0x351fb5[_0x4d4f('0x33')]));if(_0x351fb5[_0x4d4f('0x6b')]){_0x347bb1['push'](new Extension(_0xc596ea,0x3,_0x4d4f('0x69'),'PREFIX-CALLERIDALL='+_0x351fb5[_0x4d4f('0x6b')]));}else{_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x3,_0x4d4f('0x65'),'No\x20callerid\x20available'));}_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x4,_0x4d4f('0x6c'),_0x5e0ead[_0x4d4f('0x5e')]+','+_0x4d4f('0x6d')+(0x8+_0x351fb5['name'][_0x4d4f('0x6e')])+'}'+','+0x1));return _0x347bb1;}function formatPrefixName(_0x4bf7bd){var _0x268b34='_';for(var _0x50d0da=0x0;_0x50d0da<_0x4bf7bd['length'];_0x50d0da++){if(_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da)=='-'){_0x268b34+=_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da);}else{_0x268b34+='['+_0x4bf7bd['charAt'](_0x50d0da)+']';}}_0x268b34+='.';return _0x268b34;}exports[_0x4d4f('0x2b')]=function(_0x53a18b,_0x41ffe7,_0x4420f0){var _0x111c01=_0x53a18b[_0x4d4f('0x56')];_0x111c01['prefix']=_0x4d4f('0x70')+_0x111c01[_0x4d4f('0x33')]+'-';return db[_0x4d4f('0x54')]['transaction'](function(_0x781877){return db[_0x4d4f('0x4c')][_0x4d4f('0x2b')](_0x111c01,{'where':{'id':_0x111c01['id']},'transaction':_0x781877})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x57')][_0x4d4f('0x2d')]({'where':{'VoicePrefixId':_0x111c01['id']},'transaction':_0x781877})['then'](function(){return db['VoiceExtension'][_0x4d4f('0x51')]({'where':{'id':_0x111c01[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x26ed6f){return createVoicePrefixExtensions(_0x111c01,_0x26ed6f,_0x781877);});});});})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x4c')][_0x4d4f('0x71')](_0x111c01['id']);})[_0x4d4f('0x2c')](respondWithResult(_0x41ffe7,null))[_0x4d4f('0x4e')](handleError(_0x41ffe7,null));};exports[_0x4d4f('0x72')]=function(_0x1c764b,_0x302cde,_0x44f0c2){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x1c764b[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x302cde,null))[_0x4d4f('0x2c')](function(_0x518252){if(_0x518252){return _0x518252[_0x4d4f('0x72')](_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')],_[_0x4d4f('0x74')](_0x1c764b['body'],['ids','id'])||{})[_0x4d4f('0x75')](function(_0x3c8a64){for(var _0x4736db=0x0;_0x4736db<_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x4736db+=0x1){socket[_0x4d4f('0x76')](_0x4d4f('0x77'),{'UserId':Number(_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4736db]),'VoicePrefixId':Number(_0x1c764b['params']['id'])});}return _0x3c8a64;});}})[_0x4d4f('0x2c')](respondWithResult(_0x302cde,null))[_0x4d4f('0x4e')](handleError(_0x302cde,null));};exports[_0x4d4f('0x78')]=function(_0x2c8c79,_0x584c53,_0x5240be){return db['VoicePrefix'][_0x4d4f('0x51')]({'where':{'id':_0x2c8c79['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x584c53,null))[_0x4d4f('0x2c')](function(_0xa63721){if(_0xa63721){return _0xa63721[_0x4d4f('0x78')](_0x2c8c79[_0x4d4f('0x3b')][_0x4d4f('0x73')])[_0x4d4f('0x2c')](function(){if(_[_0x4d4f('0x79')](_0x2c8c79['query']['ids'])){for(var _0x42c66c=0x0;_0x42c66c<_0x2c8c79['query'][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x42c66c+=0x1){socket[_0x4d4f('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x2c8c79['query']['ids'][_0x42c66c]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}}else{socket['emit'](_0x4d4f('0x7a'),{'UserId':Number(_0x2c8c79['query'][_0x4d4f('0x73')]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x584c53,null))[_0x4d4f('0x4e')](handleError(_0x584c53,null));};exports[_0x4d4f('0x7b')]=function(_0x1670fd,_0x548709,_0x18274e){var _0x3beacf={};var _0x4691b7={};var _0x1f62e0;var _0x328528;return db['VoicePrefix'][_0x4d4f('0x7c')]({'where':{'id':_0x1670fd['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x548709,null))[_0x4d4f('0x2c')](function(_0x2511c8){if(_0x2511c8){_0x1f62e0=_0x2511c8;_0x4691b7[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x7d')][_0x4d4f('0x36')]);_0x4691b7['query']=_[_0x4d4f('0x50')](_0x1670fd[_0x4d4f('0x3b')]);_0x4691b7[_0x4d4f('0x46')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],_0x4691b7['query']);_0x3beacf[_0x4d4f('0x3e')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x1670fd[_0x4d4f('0x3b')]['fields']));_0x3beacf[_0x4d4f('0x3e')]=_0x3beacf[_0x4d4f('0x3e')][_0x4d4f('0x6e')]?_0x3beacf[_0x4d4f('0x3e')]:_0x4691b7['model'];_0x3beacf[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x1670fd['query'][_0x4d4f('0x44')]);_0x3beacf[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x1670fd[_0x4d4f('0x3b')],_0x4691b7[_0x4d4f('0x46')]));if(_0x1670fd['query'][_0x4d4f('0x47')]){_0x3beacf[_0x4d4f('0x45')]=_['merge'](_0x3beacf[_0x4d4f('0x45')],{'$or':_[_0x4d4f('0x3a')](_0x3beacf[_0x4d4f('0x3e')],function(_0x4686b9){var _0x16d1f7={};_0x16d1f7[_0x4686b9]={'$like':'%'+_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x16d1f7;})});}_0x3beacf=_[_0x4d4f('0x48')]({},_0x3beacf,_0x1670fd['options']);return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x4dd3f6){if(_0x4dd3f6){_0x328528=_0x4dd3f6[_0x4d4f('0x6e')];if(!_0x1670fd['query'][_0x4d4f('0x40')]('nolimit')){_0x3beacf[_0x4d4f('0x26')]=qs[_0x4d4f('0x26')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x3beacf[_0x4d4f('0x42')]=qs[_0x4d4f('0x42')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x10f882){if(_0x10f882){return _0x10f882?{'count':_0x328528,'rows':_0x10f882}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x548709,null))['catch'](handleError(_0x548709,null));};exports['getTeams']=function(_0x41c81d,_0x5d6abf,_0x2208d8){var _0x2b096e={};var _0x4e6da6={};var _0x53817f;var _0x10955f;return db[_0x4d4f('0x4c')][_0x4d4f('0x7c')]({'where':{'id':_0x41c81d['params']['id']}})['then'](handleEntityNotFound(_0x5d6abf,null))[_0x4d4f('0x2c')](function(_0x274ff2){if(_0x274ff2){_0x53817f=_0x274ff2;_0x4e6da6[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db['Team'][_0x4d4f('0x36')]);_0x4e6da6[_0x4d4f('0x3b')]=_[_0x4d4f('0x50')](_0x41c81d['query']);_0x4e6da6['filters']=_[_0x4d4f('0x3c')](_0x4e6da6[_0x4d4f('0x3d')],_0x4e6da6[_0x4d4f('0x3b')]);_0x2b096e[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4e6da6['model'],qs[_0x4d4f('0x3f')](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x2b096e['attributes']=_0x2b096e[_0x4d4f('0x3e')]['length']?_0x2b096e[_0x4d4f('0x3e')]:_0x4e6da6[_0x4d4f('0x3d')];_0x2b096e[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x41c81d[_0x4d4f('0x3b')]['sort']);_0x2b096e[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x41c81d[_0x4d4f('0x3b')],_0x4e6da6['filters']));if(_0x41c81d[_0x4d4f('0x3b')]['filter']){_0x2b096e['where']=_[_0x4d4f('0x48')](_0x2b096e[_0x4d4f('0x45')],{'$or':_['map'](_0x2b096e[_0x4d4f('0x3e')],function(_0x50b0a3){var _0x1177a3={};_0x1177a3[_0x50b0a3]={'$like':'%'+_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x1177a3;})});}_0x2b096e=_[_0x4d4f('0x48')]({},_0x2b096e,_0x41c81d[_0x4d4f('0x49')]);return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})[_0x4d4f('0x2c')](function(_0x3fe348){if(_0x3fe348){_0x10955f=_0x3fe348['length'];if(!_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x40')]('nolimit')){_0x2b096e[_0x4d4f('0x26')]=qs['limit'](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2b096e[_0x4d4f('0x42')]=qs['offset'](_0x41c81d['query']['offset']);}return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})['then'](function(_0xb5d71b){if(_0xb5d71b){return _0xb5d71b?{'count':_0x10955f,'rows':_0xb5d71b}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x5d6abf,null))[_0x4d4f('0x4e')](handleError(_0x5d6abf,null));};exports['addTeams']=function(_0x5b6061,_0x230ff0,_0x28ae80){var _0x42be25=_0x5b6061[_0x4d4f('0x56')][_0x4d4f('0x73')];var _0x13279e;return db['Team'][_0x4d4f('0x80')]({'where':{'id':_0x42be25},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id',_0x4d4f('0x33'),_0x4d4f('0x82'),_0x4d4f('0x83'),_0x4d4f('0x84')],'raw':!![]}]})[_0x4d4f('0x2c')](function(_0x1a1e6f){if(_0x1a1e6f){_0x13279e=_0x1a1e6f;var _0x152400=_[_0x4d4f('0x85')](_0x1a1e6f,function(_0x3c6f1b){var _0x25e63c=_0x3c6f1b[_0x4d4f('0x2e')]({'plain':!![]});return _0x25e63c['Agents'];});return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x5b6061[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0xc01ac4){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x472938){return _0xc01ac4[_0x4d4f('0x87')](_0x42be25,{'transaction':_0x472938})['then'](function(){return BPromise[_0x4d4f('0x88')](_0x13279e,function(_0x72d583){return db[_0x4d4f('0x89')][_0x4d4f('0x8a')]({'TeamId':_0x72d583['id'],'VoicePrefixId':_0x5b6061[_0x4d4f('0x52')]['id']},{'transaction':_0x472938});});})[_0x4d4f('0x2c')](function(){return BPromise[_0x4d4f('0x88')](_0x152400,function(_0x28fd35){return db[_0x4d4f('0x8b')][_0x4d4f('0x8c')]({'where':{'UserId':_0x28fd35['id'],'VoicePrefixId':_0x5b6061['params']['id']},'transaction':_0x472938});});})['then'](function(){_0x152400[_0x4d4f('0x8d')](function(_0x8850a4){socket['emit'](_0x4d4f('0x77'),{'UserId':_0x8850a4['id'],'VoicePrefixId':_0xc01ac4['id']});});});});});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x230ff0,null))[_0x4d4f('0x4e')](handleError(_0x230ff0,null));};exports[_0x4d4f('0x8e')]=function(_0x15028c,_0x1659f6,_0x77dac1){return db[_0x4d4f('0x8f')][_0x4d4f('0x80')]({'where':{'id':_0x15028c[_0x4d4f('0x3b')][_0x4d4f('0x73')]},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id'],'raw':!![]}]})[_0x4d4f('0x2c')](handleEntityNotFound(_0x1659f6,null))['then'](function(_0x342b63){var _0x524ed0=_[_0x4d4f('0x3a')](_0x342b63,'id');var _0x3fd499=[];var _0x17a39f=[];var _0x27b4d6=squel['select']();_0x27b4d6[_0x4d4f('0x90')](_0x4d4f('0x91'))[_0x4d4f('0x92')](_0x4d4f('0x93'),'tq')[_0x4d4f('0x94')](_0x4d4f('0x95'),'ut',_0x4d4f('0x96'))['where'](_0x4d4f('0x97'),_0x15028c[_0x4d4f('0x52')]['id']);for(var _0x2f4bad=0x0;_0x2f4bad<_0x342b63[_0x4d4f('0x6e')];_0x2f4bad+=0x1){let _0x4501b5=_0x342b63[_0x2f4bad];for(var _0x12eda1=0x0;_0x12eda1<_0x4501b5['Agents']['length'];_0x12eda1+=0x1){let _0x11ee76=_0x4501b5['Agents'][_0x12eda1];var _0x2ea6b4=_0x27b4d6[_0x4d4f('0x98')]();_0x2ea6b4['where'](_0x4d4f('0x99'),_0x11ee76['id']);_0x17a39f[_0x4d4f('0x68')](db[_0x4d4f('0x54')][_0x4d4f('0x3b')](_0x2ea6b4[_0x4d4f('0x9a')](),{'type':db[_0x4d4f('0x54')][_0x4d4f('0x9b')]['SELECT']})[_0x4d4f('0x2c')](function(_0x5d05cb){if(_0x5d05cb[_0x4d4f('0x6e')]===0x1){return _0x11ee76['id'];}else{var _0x2d1337=_['every'](_['map'](_0x5d05cb,_0x4d4f('0x9c')),function(_0x17894c){return _[_0x4d4f('0x9d')](_0x524ed0,_0x17894c);});if(_0x2d1337){return _0x11ee76['id'];}}}));}}return BPromise['all'](_0x17a39f)[_0x4d4f('0x2c')](function(_0x118642){_0x3fd499=_(_0x3fd499)[_0x4d4f('0x9e')](_0x118642)[_0x4d4f('0x9f')]()[_0x4d4f('0xa0')]();return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x15028c[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0x51e70f){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x23485f){return _0x51e70f[_0x4d4f('0x8e')](_0x15028c['query'][_0x4d4f('0x73')],{'transaction':_0x23485f})['then'](function(){if(!_['isEmpty'](_0x3fd499)){return _0x51e70f[_0x4d4f('0x78')](_0x3fd499,{'transaction':_0x23485f});}})[_0x4d4f('0x2c')](function(){_0x3fd499[_0x4d4f('0x8d')](function(_0x3de9b3){socket[_0x4d4f('0x76')](_0x4d4f('0x7a'),{'UserId':_0x3de9b3,'VoicePrefixId':_0x51e70f['id']});});});});});});})[_0x4d4f('0x2c')](respondWithStatusCode(_0x1659f6,null))[_0x4d4f('0x4e')](handleError(_0x1659f6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 6a154c7..a025dbe 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 _0x6d74=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0xf0c4b6,_0x48163b){var _0x7e5152=function(_0x4672ef){while(--_0x4672ef){_0xf0c4b6['push'](_0xf0c4b6['shift']());}};_0x7e5152(++_0x48163b);}(_0x6d74,0x18d));var _0x46d7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6d74[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x46d7('0x0'));var VoicePrefix=require(_0x46d7('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x46d7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x46d7('0x3'),'afterDestroy':_0x46d7('0x4')};function emitEvent(_0x33ca44){return function(_0x1f0fe5,_0x3fe40c,_0xcd8353){VoicePrefixEvents[_0x46d7('0x5')](_0x33ca44+':'+_0x1f0fe5['id'],_0x1f0fe5);VoicePrefixEvents[_0x46d7('0x5')](_0x33ca44,_0x1f0fe5);_0xcd8353(null);};}for(var e in events){if(events[_0x46d7('0x6')](e)){var event=events[e];VoicePrefix[_0x46d7('0x7')](e,emitEvent(event));}}module[_0x46d7('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xb335=['events','../../mysqldb','VoicePrefix','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x3a825d,_0x10734e){var _0x6214b=function(_0x21f65c){while(--_0x21f65c){_0x3a825d['push'](_0x3a825d['shift']());}};_0x6214b(++_0x10734e);}(_0xb335,0x99));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5b33('0x0'));var VoicePrefix=require(_0x5b33('0x1'))['db'][_0x5b33('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5b33('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b33('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4760ff){return function(_0x56702a,_0x17ec52,_0x134b8d){VoicePrefixEvents[_0x5b33('0x5')](_0x4760ff+':'+_0x56702a['id'],_0x56702a);VoicePrefixEvents['emit'](_0x4760ff,_0x56702a);_0x134b8d(null);};}for(var e in events){if(events[_0x5b33('0x6')](e)){var event=events[e];VoicePrefix[_0x5b33('0x7')](e,emitEvent(event));}}module[_0x5b33('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index fc81939..d6cf9aa 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 _0xc289=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util'];(function(_0x22303a,_0x5f3cb9){var _0x5c485e=function(_0x1f9f2a){while(--_0x1f9f2a){_0x22303a['push'](_0x22303a['shift']());}};_0x5c485e(++_0x5f3cb9);}(_0xc289,0x1a3));var _0x9c28=function(_0x28abf0,_0x37f9e5){_0x28abf0=_0x28abf0-0x0;var _0x4e63aa=_0xc289[_0x28abf0];return _0x4e63aa;};'use strict';var _=require('lodash');var util=require(_0x9c28('0x0'));var logger=require(_0x9c28('0x1'))('api');var moment=require(_0x9c28('0x2'));var BPromise=require(_0x9c28('0x3'));var rp=require(_0x9c28('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c28('0x5'));var config=require(_0x9c28('0x6'));var attributes=require(_0x9c28('0x7'));module[_0x9c28('0x8')]=function(_0x10e9af,_0x507122){return _0x10e9af['define'](_0x9c28('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7a4=['bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','api'];(function(_0x25dd0b,_0xe3f968){var _0x110177=function(_0x165810){while(--_0x165810){_0x25dd0b['push'](_0x25dd0b['shift']());}};_0x110177(++_0xe3f968);}(_0xd7a4,0x101));var _0x4d7a=function(_0x5ce767,_0x592a43){_0x5ce767=_0x5ce767-0x0;var _0x398665=_0xd7a4[_0x5ce767];return _0x398665;};'use strict';var _=require(_0x4d7a('0x0'));var util=require(_0x4d7a('0x1'));var logger=require('../../config/logger')(_0x4d7a('0x2'));var moment=require('moment');var BPromise=require(_0x4d7a('0x3'));var rp=require(_0x4d7a('0x4'));var fs=require('fs');var path=require(_0x4d7a('0x5'));var rimraf=require(_0x4d7a('0x6'));var config=require(_0x4d7a('0x7'));var attributes=require(_0x4d7a('0x8'));module[_0x4d7a('0x9')]=function(_0x354374,_0x53375e){return _0x354374[_0x4d7a('0xa')](_0x4d7a('0xb'),attributes,{'tableName':_0x4d7a('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 d7fd571..7634212 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 _0x3974=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x293edb,_0x51b106){var _0x50e2ff=function(_0x5c1cee){while(--_0x5c1cee){_0x293edb['push'](_0x293edb['shift']());}};_0x50e2ff(++_0x51b106);}(_0x3974,0xbc));var _0x4397=function(_0x2868cc,_0x36c6da){_0x2868cc=_0x2868cc-0x0;var _0xc2eba1=_0x3974[_0x2868cc];return _0xc2eba1;};'use strict';var _=require(_0x4397('0x0'));var util=require(_0x4397('0x1'));var moment=require(_0x4397('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4397('0x3'));var db=require(_0x4397('0x4'))['db'];var utils=require(_0x4397('0x5'));var logger=require(_0x4397('0x6'))(_0x4397('0x7'));var config=require('../../config/environment');var jayson=require(_0x4397('0x8'));var client=jayson[_0x4397('0x9')][_0x4397('0xa')]({'port':0x232a});config[_0x4397('0xb')]=_['defaults'](config[_0x4397('0xb')],{'host':_0x4397('0xc'),'port':0x18eb});var socket=require(_0x4397('0xd'))(new Redis(config[_0x4397('0xb')]));require('./voicePrefix.socket')[_0x4397('0xe')](socket);function respondWithRpcPromise(_0x26f0ab,_0x13a0e8,_0x54419f){return new BPromise(function(_0x47e207,_0x41d0da){return client[_0x4397('0xf')](_0x26f0ab,_0x54419f)[_0x4397('0x10')](function(_0x4afa76){logger[_0x4397('0x11')](_0x4397('0x12'),_0x13a0e8,_0x4397('0x13'));logger['debug'](_0x4397('0x14'),_0x13a0e8,_0x4397('0x13'),JSON[_0x4397('0x15')](_0x4afa76));if(_0x4afa76['error']){if(_0x4afa76[_0x4397('0x16')]['code']===0x1f4){logger[_0x4397('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x13a0e8,_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);return _0x41d0da(_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);}logger[_0x4397('0x16')](_0x4397('0x12'),_0x13a0e8,_0x4afa76['error'][_0x4397('0x17')]);return _0x47e207(_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);}else{logger[_0x4397('0x11')](_0x4397('0x12'),_0x13a0e8,_0x4397('0x13'));_0x47e207(_0x4afa76[_0x4397('0x18')][_0x4397('0x17')]);}})[_0x4397('0x19')](function(_0x5270d7){logger['error'](_0x4397('0x12'),_0x13a0e8,_0x5270d7);_0x41d0da(_0x5270d7);});});} \ No newline at end of file +var _0x8aad=['socket.io-emitter','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','redis','localhost'];(function(_0x45b8be,_0x5e17e0){var _0x510327=function(_0x1ef616){while(--_0x1ef616){_0x45b8be['push'](_0x45b8be['shift']());}};_0x510327(++_0x5e17e0);}(_0x8aad,0x146));var _0xd8aa=function(_0x5714ac,_0xf99d53){_0x5714ac=_0x5714ac-0x0;var _0x59902e=_0x8aad[_0x5714ac];return _0x59902e;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});config[_0xd8aa('0x8')]=_['defaults'](config[_0xd8aa('0x8')],{'host':_0xd8aa('0x9'),'port':0x18eb});var socket=require(_0xd8aa('0xa'))(new Redis(config[_0xd8aa('0x8')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x24f3f1,_0x1d4cf6,_0x152c0a){return new BPromise(function(_0x228fda,_0x2c7edb){return client['request'](_0x24f3f1,_0x152c0a)[_0xd8aa('0xb')](function(_0x1619c6){logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x1d4cf6,_0xd8aa('0xe'));logger[_0xd8aa('0xf')](_0xd8aa('0x10'),_0x1d4cf6,_0xd8aa('0xe'),JSON[_0xd8aa('0x11')](_0x1619c6));if(_0x1619c6[_0xd8aa('0x12')]){if(_0x1619c6['error']['code']===0x1f4){logger[_0xd8aa('0x12')](_0xd8aa('0xd'),_0x1d4cf6,_0x1619c6[_0xd8aa('0x12')]['message']);return _0x2c7edb(_0x1619c6[_0xd8aa('0x12')][_0xd8aa('0x13')]);}logger[_0xd8aa('0x12')](_0xd8aa('0xd'),_0x1d4cf6,_0x1619c6['error'][_0xd8aa('0x13')]);return _0x228fda(_0x1619c6[_0xd8aa('0x12')]['message']);}else{logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x1d4cf6,_0xd8aa('0xe'));_0x228fda(_0x1619c6[_0xd8aa('0x14')][_0xd8aa('0x13')]);}})['catch'](function(_0x43d3fa){logger[_0xd8aa('0x12')](_0xd8aa('0xd'),_0x1d4cf6,_0x43d3fa);_0x2c7edb(_0x43d3fa);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 89aa8ce..7fcbad5 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 _0xbf83=['remove','update','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0xbf83,0x11e));var _0x3bf8=function(_0xbd2dc5,_0x181bdd){_0xbd2dc5=_0xbd2dc5-0x0;var _0x40a997=_0xbf83[_0xbd2dc5];return _0x40a997;};'use strict';var VoicePrefixEvents=require(_0x3bf8('0x0'));var events=['save',_0x3bf8('0x1'),_0x3bf8('0x2')];function createListener(_0x3cbf10,_0x21c4ac){return function(_0x2b1141){_0x21c4ac['emit'](_0x3cbf10,_0x2b1141);};}function removeListener(_0x565784,_0x459aef){return function(){VoicePrefixEvents[_0x3bf8('0x3')](_0x565784,_0x459aef);};}exports[_0x3bf8('0x4')]=function(_0x251445){for(var _0x5be89b=0x0,_0x5b0c12=events[_0x3bf8('0x5')];_0x5be89b<_0x5b0c12;_0x5be89b++){var _0x2df7c9=events[_0x5be89b];var _0x4adc52=createListener(_0x3bf8('0x6')+_0x2df7c9,_0x251445);VoicePrefixEvents['on'](_0x2df7c9,_0x4adc52);}}; \ No newline at end of file +var _0xeebe=['register','length','voicePrefix:','./voicePrefix.events','remove','emit','removeListener'];(function(_0xd6fc2c,_0x4a415c){var _0x1531e0=function(_0x24fd15){while(--_0x24fd15){_0xd6fc2c['push'](_0xd6fc2c['shift']());}};_0x1531e0(++_0x4a415c);}(_0xeebe,0xff));var _0xeeeb=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xeebe[_0x2ec461];return _0x28603d;};'use strict';var VoicePrefixEvents=require(_0xeeeb('0x0'));var events=['save',_0xeeeb('0x1'),'update'];function createListener(_0x2794b0,_0x1a1a35){return function(_0xb434b3){_0x1a1a35[_0xeeeb('0x2')](_0x2794b0,_0xb434b3);};}function removeListener(_0x147b13,_0x33801b){return function(){VoicePrefixEvents[_0xeeeb('0x3')](_0x147b13,_0x33801b);};}exports[_0xeeeb('0x4')]=function(_0x2b23eb){for(var _0x39573a=0x0,_0x46c645=events[_0xeeeb('0x5')];_0x39573a<_0x46c645;_0x39573a++){var _0x41847e=events[_0x39573a];var _0x1f88ea=createListener(_0xeeeb('0x6')+_0x41847e,_0x2b23eb);VoicePrefixEvents['on'](_0x41847e,_0x1f88ea);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bd7ebd9..2ff63aa 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0xb10b,0x12a));var _0xbb10=function(_0x21ae22,_0x54911f){_0x21ae22=_0x21ae22-0x0;var _0x1e610a=_0xb10b[_0x21ae22];return _0x1e610a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x17976c,_0x1e7a52){var _0xf83a5e=function(_0x4efbae){while(--_0x4efbae){_0x17976c['push'](_0x17976c['shift']());}};_0xf83a5e(++_0x1e7a52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 986a831..0665fc1 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 _0xc339=['leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','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','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#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\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','rrordered','strategy','getDataValue','type','dialMethod','roundrobin','setDataValue','INTEGER','yes','all','once','TEXT','periodic_announce','split','join','joinempty'];(function(_0x4158d7,_0x592c8e){var _0x369b83=function(_0x435ff4){while(--_0x435ff4){_0x4158d7['push'](_0x4158d7['shift']());}};_0x369b83(++_0x592c8e);}(_0xc339,0x173));var _0x9c33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc339[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9c33('0x0'));module[_0x9c33('0x1')]={'name':{'type':Sequelize[_0x9c33('0x2')],'allowNull':![],'unique':_0x9c33('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x5'),_0x9c33('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':_0x9c33('0x7')},'announce':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9c33('0x4')]('rr',_0x9c33('0x8'),_0x9c33('0x9'),_0x9c33('0xa'),_0x9c33('0xb'),_0x9c33('0xc'),'linear','wrandom',_0x9c33('0xd')),'allowNull':![],'defaultValue':_0x9c33('0x8'),'set':function(_0x1f23b0){this['setDataValue'](_0x9c33('0xe'),_0x1f23b0?_0x1f23b0:_0x9c33('0xc'));},'get':function(){var _0x984005=this[_0x9c33('0xf')](_0x9c33('0x10'));var _0x371c94=this[_0x9c33('0xf')](_0x9c33('0x11'));var _0x3ae655=this['getDataValue'](_0x9c33('0xe'));if(_0x984005===_0x9c33('0x6')){if(_0x371c94==='preview'){return null;}if(_0x371c94==='booked'&&![_0x9c33('0xc'),_0x9c33('0x12')]['includes'](_0x3ae655)){this[_0x9c33('0x13')](_0x9c33('0xe'),_0x9c33('0xc'));}}return _0x3ae655;}},'servicelevel':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9c33('0x14')](0xb)},'timeout':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9c33('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':_0x9c33('0x15')},'autopause':{'type':Sequelize[_0x9c33('0x4')]('yes','no',_0x9c33('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9c33('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x9c33('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9c33('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9c33('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9c33('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9c33('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x9c33('0x15'),'no'),'defaultValue':_0x9c33('0x15')},'announce_holdtime':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no',_0x9c33('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9c33('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x9c33('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9c33('0x2')]},'queue_youarenext':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9c33('0x2')]},'queue_quantity1':{'type':Sequelize[_0x9c33('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x9c33('0x2')]},'queue_less_than':{'type':Sequelize[_0x9c33('0x2')]},'periodic_announce':{'type':Sequelize[_0x9c33('0x18')],'set':function(_0x56949c){this['setDataValue'](_0x9c33('0x19'),_0x56949c?_0x56949c['join'](','):[]);},'get':function(){return this[_0x9c33('0xf')](_0x9c33('0x19'))?this[_0x9c33('0xf')]('periodic_announce')[_0x9c33('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':_0x9c33('0x15'),'set':function(_0x36f60f){this[_0x9c33('0x13')]('joinempty',_0x36f60f?_0x36f60f[_0x9c33('0x1b')](','):undefined);},'get':function(){return this[_0x9c33('0xf')]('joinempty')?this['getDataValue'](_0x9c33('0x1c'))[_0x9c33('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':'no','set':function(_0x35cd8e){this[_0x9c33('0x13')](_0x9c33('0x1d'),_0x35cd8e?_0x35cd8e[_0x9c33('0x1b')](','):undefined);},'get':function(){return this[_0x9c33('0xf')](_0x9c33('0x1d'))?this['getDataValue']('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9c33('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':0x0,'set':function(_0x234879){this[_0x9c33('0x13')](_0x9c33('0x1f'),_0x234879);if(_0x234879){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x9c33('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9c33('0x21')},'dialMethod':{'type':Sequelize[_0x9c33('0x4')]('preview',_0x9c33('0x22'),_0x9c33('0x23'),'predictive',_0x9c33('0x24')),'defaultValue':_0x9c33('0x22'),'comment':_0x9c33('0x25')},'dialLimitChannel':{'type':Sequelize[_0x9c33('0x14')](0x4)[_0x9c33('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9c33('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x9c33('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9c33('0x28')},'dialPowerLevel':{'type':Sequelize[_0x9c33('0x29')](0x2)[_0x9c33('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x9c33('0x2a'),_0x9c33('0x2b')),'defaultValue':_0x9c33('0x2b'),'comment':_0x9c33('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9c33('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9c33('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9c33('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9c33('0x30'),'comment':_0x9c33('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x9c33('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c33('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x36')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'comment':_0x9c33('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c33('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9c33('0x39')},'dialTimezone':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9c33('0x3a')},'dialPrefix':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x3b'),_0x9c33('0x3c'),_0x9c33('0x3d')),'defaultValue':_0x9c33('0x3b')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9c33('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9c33('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9c33('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x9c33('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9c33('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9c33('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9c33('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x9c33('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9c33('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9c33('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x9c33('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':0x0,'comment':_0x9c33('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x9c33('0x45'),_0x9c33('0x46')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x9c33('0x2')],'comment':_0x9c33('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9c33('0x47')},'dialCutDigit':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x49')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c33('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9c33('0x14')],'allowNull':!![],'comment':_0x9c33('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':![],'comment':_0x9c33('0x4f'),'set':function(_0x2db2dd){if(!_0x2db2dd)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x2db2dd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0x4688=['agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','STRING','name','inbound','outbound','default','ENUM','ringall','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','type','getDataValue','dialMethod','booked','roundrobin','includes','INTEGER','yes','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x4688,0x163));var _0x8468=function(_0x44e4e1,_0x5637b2){_0x44e4e1=_0x44e4e1-0x0;var _0x300cd2=_0x4688[_0x44e4e1];return _0x300cd2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8468('0x0')],'allowNull':![],'unique':_0x8468('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x8468('0x2'),_0x8468('0x3')),'allowNull':![],'defaultValue':_0x8468('0x2')},'musiconhold':{'type':Sequelize[_0x8468('0x0')],'defaultValue':_0x8468('0x4')},'announce':{'type':Sequelize[_0x8468('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8468('0x5')]('rr',_0x8468('0x6'),'leastrecent',_0x8468('0x7'),_0x8468('0x8'),_0x8468('0x9'),_0x8468('0xa'),_0x8468('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0x8468('0x6'),'set':function(_0x564864){this[_0x8468('0xc')](_0x8468('0xd'),_0x564864?_0x564864:'rrmemory');},'get':function(){var _0xf1ba50=this['getDataValue'](_0x8468('0xe'));var _0x410e89=this[_0x8468('0xf')](_0x8468('0x10'));var _0x310daa=this[_0x8468('0xf')](_0x8468('0xd'));if(_0xf1ba50===_0x8468('0x3')){if(_0x410e89==='preview'){return null;}if(_0x410e89===_0x8468('0x11')&&![_0x8468('0x9'),_0x8468('0x12')][_0x8468('0x13')](_0x310daa)){this['setDataValue'](_0x8468('0xd'),_0x8468('0x9'));}}return _0x310daa;}},'servicelevel':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8468('0x14')](0xb)},'timeout':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8468('0x0')]},'weight':{'type':Sequelize[_0x8468('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x8468('0x15'),'no'),'defaultValue':_0x8468('0x15')},'autopause':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8468('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8468('0x5')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8468('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8468('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x8468('0x15'),'no'),'defaultValue':_0x8468('0x15')},'announce_holdtime':{'type':Sequelize[_0x8468('0x5')]('yes','no',_0x8468('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x8468('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x8468('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8468('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8468('0x0')]},'queue_youarenext':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8468('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8468('0x0')]},'queue_quantity1':{'type':Sequelize[_0x8468('0x0')]},'queue_quantity2':{'type':Sequelize[_0x8468('0x0')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x8468('0x17')],'set':function(_0x2976d8){this['setDataValue']('periodic_announce',_0x2976d8?_0x2976d8['join'](','):[]);},'get':function(){return this[_0x8468('0xf')](_0x8468('0x18'))?this[_0x8468('0xf')](_0x8468('0x18'))[_0x8468('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x8468('0x0')],'defaultValue':_0x8468('0x15'),'set':function(_0xeb04b){this[_0x8468('0xc')](_0x8468('0x1a'),_0xeb04b?_0xeb04b[_0x8468('0x1b')](','):undefined);},'get':function(){return this[_0x8468('0xf')](_0x8468('0x1a'))?this[_0x8468('0xf')](_0x8468('0x1a'))[_0x8468('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8468('0x0')],'defaultValue':'no','set':function(_0x3e2968){this[_0x8468('0xc')](_0x8468('0x1c'),_0x3e2968?_0x3e2968[_0x8468('0x1b')](','):undefined);},'get':function(){return this[_0x8468('0xf')](_0x8468('0x1c'))?this[_0x8468('0xf')](_0x8468('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x8468('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8468('0x5')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8468('0x0')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':0x0,'set':function(_0x476f42){this['setDataValue']('acw',_0x476f42);if(_0x476f42){if(this[_0x8468('0xf')](_0x8468('0x1e'))<0x2){this[_0x8468('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8468('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':0x0,'comment':_0x8468('0x1f')},'dialMethod':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x20'),_0x8468('0x21'),_0x8468('0x22'),'predictive',_0x8468('0x11')),'defaultValue':_0x8468('0x21'),'comment':_0x8468('0x23')},'dialLimitChannel':{'type':Sequelize[_0x8468('0x14')](0x4)[_0x8468('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8468('0x25')},'dialLimitQueue':{'type':Sequelize[_0x8468('0x14')](0x4)[_0x8468('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8468('0x26')},'dialPowerLevel':{'type':Sequelize[_0x8468('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x28'),_0x8468('0x29')),'defaultValue':'dropRate','comment':_0x8468('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8468('0x27')](0x2)[_0x8468('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x8468('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8468('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8468('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8468('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x8468('0x2d'),'comment':_0x8468('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x8468('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x2f')},'dialQueueProject':{'type':Sequelize[_0x8468('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8468('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8468('0x24')],'defaultValue':0x3,'comment':_0x8468('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8468('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8468('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8468('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x8468('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8468('0x35'),_0x8468('0x36'),_0x8468('0x37')),'defaultValue':_0x8468('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8468('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x8468('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x8468('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8468('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8468('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8468('0x14')](0x9)[_0x8468('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x8468('0x14')](0x9)[_0x8468('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8468('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8468('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8468('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8468('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8468('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8468('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8468('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x8468('0x14')](0x5)[_0x8468('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8468('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x8468('0x5')](_0x8468('0x40'),_0x8468('0x41')),'defaultValue':_0x8468('0x40')},'dialQueueProject2':{'type':Sequelize[_0x8468('0x0')],'comment':_0x8468('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8468('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8468('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8468('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x8468('0x14')](0x5)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8468('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8468('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8468('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8468('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8468('0x14')](0x5)[_0x8468('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8468('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x8468('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':![],'comment':_0x8468('0x4d'),'set':function(_0x9caebb){if(!_0x9caebb)this[_0x8468('0xc')]('mandatoryDispositionPauseId',null);this[_0x8468('0xc')](_0x8468('0x4e'),_0x9caebb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8468('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8468('0x14')](0x3)[_0x8468('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8468('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 432083b..cf034d4 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 _0xc599=['removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','emit','push','SIP/%s','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','into','cm_hopper','fromQuery','ListId','phone','scheduledAt','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ContactId','all','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','h.ContactId=ci.CmContactId','PHONE','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','register','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','value','includes','type','find','name','sendStatus','error','index','VoiceQueue','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','options','includeAll','include','findAll','rows','show','params','keys','create','user','role','outbound','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','updatedAt','omit','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','userVoiceQueue:save'];(function(_0x2bd70f,_0xd51d8a){var _0x19aeea=function(_0x5a2fbe){while(--_0x5a2fbe){_0x2bd70f['push'](_0x2bd70f['shift']());}};_0x19aeea(++_0xd51d8a);}(_0xc599,0x1b2));var _0x9c59=function(_0x536851,_0x2302b2){_0x536851=_0x536851-0x0;var _0x30e3bf=_0xc599[_0x536851];return _0x30e3bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c59('0x1'));var rp=require(_0x9c59('0x2'));var moment=require(_0x9c59('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c59('0x4'));var util=require(_0x9c59('0x5'));var path=require(_0x9c59('0x6'));var sox=require(_0x9c59('0x7'));var csv=require(_0x9c59('0x8'));var ejs=require(_0x9c59('0x9'));var fs=require('fs');var fs_extra=require(_0x9c59('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c59('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9c59('0xd'));var Papa=require(_0x9c59('0xe'));var Redis=require(_0x9c59('0xf'));var authService=require(_0x9c59('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c59('0x11'));var logger=require('../../config/logger')(_0x9c59('0x12'));var utils=require('../../config/utils');var config=require(_0x9c59('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c59('0x14'))['db'];config[_0x9c59('0x15')]=_[_0x9c59('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0x9c59('0x17')](socket);function respondWithStatusCode(_0xdfa957,_0x1b0f0d){_0x1b0f0d=_0x1b0f0d||0xcc;return function(_0xaa3cbe){if(_0xaa3cbe){return _0xdfa957['sendStatus'](_0x1b0f0d);}return _0xdfa957[_0x9c59('0x18')](_0x1b0f0d)[_0x9c59('0x19')]();};}function respondWithResult(_0x1d07fd,_0x562069){_0x562069=_0x562069||0xc8;return function(_0x5792d3){if(_0x5792d3){return _0x1d07fd['status'](_0x562069)[_0x9c59('0x1a')](_0x5792d3);}};}function respondWithFilteredResult(_0x36983f,_0x2081bd){return function(_0x19f372){if(_0x19f372){var _0x3faae5=typeof _0x2081bd[_0x9c59('0x1b')]===_0x9c59('0x1c')&&typeof _0x2081bd[_0x9c59('0x1d')]==='undefined';var _0x4eb316=_0x19f372['count'];var _0x43371d=_0x3faae5?0x0:_0x2081bd[_0x9c59('0x1b')];var _0x12402e=_0x3faae5?_0x19f372[_0x9c59('0x1e')]:_0x2081bd['offset']+_0x2081bd[_0x9c59('0x1d')];var _0x523dff;if(_0x12402e>=_0x4eb316){_0x12402e=_0x4eb316;_0x523dff=0xc8;}else{_0x523dff=0xce;}_0x36983f[_0x9c59('0x18')](_0x523dff);return _0x36983f[_0x9c59('0x1f')]('Content-Range',_0x43371d+'-'+_0x12402e+'/'+_0x4eb316)[_0x9c59('0x1a')](_0x19f372);}return null;};}function patchUpdates(_0x3611ca){return function(_0x1f5938){try{jsonpatch[_0x9c59('0x20')](_0x1f5938,_0x3611ca,!![]);}catch(_0x1e5853){return BPromise['reject'](_0x1e5853);}return _0x1f5938[_0x9c59('0x21')]();};}function saveUpdates(_0x2eb93e,_0x2405d2){return function(_0x5e1146){if(_0x5e1146){return _0x5e1146[_0x9c59('0x22')](_0x2eb93e)[_0x9c59('0x23')](function(_0x335e36){return _0x335e36;});}return null;};}function removeEntity(_0x20ad5c,_0x4f5542){return function(_0x41e458){if(_0x41e458){return _0x41e458[_0x9c59('0x24')]()[_0x9c59('0x23')](function(){var _0x597ffc=_0x41e458[_0x9c59('0x25')]({'plain':!![]});var _0x27e6b2=[{'name':_0x9c59('0x26'),'value':_0x9c59('0x27'),'ignore':![]},{'name':_0x9c59('0x28'),'value':'outbound','ignore':![]}];var _0x1e2a4b=_(_0x27e6b2)[_0x9c59('0x29')]('ignore')['map'](_0x9c59('0x2a'))[_0x9c59('0x2a')]();if(_[_0x9c59('0x2b')](_0x1e2a4b,_0x597ffc[_0x9c59('0x2c')])){return;}var _0x4a0e32=_[_0x9c59('0x2d')](_0x27e6b2,[_0x9c59('0x2a'),_0x597ffc[_0x9c59('0x2c')]])[_0x9c59('0x2e')];return db['UserProfileResource'][_0x9c59('0x24')]({'where':{'type':_0x4a0e32,'resourceId':_0x597ffc['id']}})[_0x9c59('0x23')](function(){return _0x41e458;});})[_0x9c59('0x23')](function(){_0x20ad5c[_0x9c59('0x18')](0xcc)[_0x9c59('0x19')]();});}};}function handleEntityNotFound(_0x450588,_0x1bad5f){return function(_0x29825e){if(!_0x29825e){_0x450588[_0x9c59('0x2f')](0x194);}return _0x29825e;};}function handleError(_0x41726e,_0x24b223){_0x24b223=_0x24b223||0x1f4;return function(_0xedf388){logger[_0x9c59('0x30')](_0xedf388['stack']);if(_0xedf388[_0x9c59('0x2e')]){delete _0xedf388[_0x9c59('0x2e')];}_0x41726e['status'](_0x24b223)['send'](_0xedf388);};}exports[_0x9c59('0x31')]=function(_0x288f12,_0x2c4d54){var _0x3b9aa5={},_0x56434e={},_0x2b244d={'count':0x0,'rows':[]};var _0x4407d7=_['map'](db[_0x9c59('0x32')][_0x9c59('0x33')],function(_0x47c725){return{'name':_0x47c725[_0x9c59('0x34')],'type':_0x47c725['type'][_0x9c59('0x35')]};});_0x56434e[_0x9c59('0x36')]=_['map'](_0x4407d7,_0x9c59('0x2e'));_0x56434e['query']=_['keys'](_0x288f12[_0x9c59('0x37')]);_0x56434e['filters']=_[_0x9c59('0x38')](_0x56434e['model'],_0x56434e['query']);_0x3b9aa5['attributes']=_[_0x9c59('0x38')](_0x56434e[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x288f12[_0x9c59('0x37')][_0x9c59('0x39')]));_0x3b9aa5[_0x9c59('0x3a')]=_0x3b9aa5['attributes'][_0x9c59('0x3b')]?_0x3b9aa5['attributes']:_0x56434e[_0x9c59('0x36')];if(!_0x288f12[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x3b9aa5[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x288f12['query'][_0x9c59('0x1d')]);_0x3b9aa5[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x288f12[_0x9c59('0x37')][_0x9c59('0x1b')]);}_0x3b9aa5[_0x9c59('0x3e')]=qs['sort'](_0x288f12[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x3b9aa5[_0x9c59('0x40')]=qs['filters'](_[_0x9c59('0x41')](_0x288f12[_0x9c59('0x37')],_0x56434e[_0x9c59('0x42')]),_0x4407d7);if(_0x288f12[_0x9c59('0x37')]['filter']){_0x3b9aa5[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x3b9aa5[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x4407d7,function(_0x1397aa){if(_0x1397aa[_0x9c59('0x2c')]!=='VIRTUAL'){var _0x593ccf={};_0x593ccf[_0x1397aa['name']]={'$like':'%'+_0x288f12['query'][_0x9c59('0x29')]+'%'};return _0x593ccf;}})});}_0x3b9aa5=_[_0x9c59('0x43')]({},_0x3b9aa5,_0x288f12[_0x9c59('0x45')]);var _0x470c5e={'where':_0x3b9aa5[_0x9c59('0x40')]};return db['VoiceQueue']['count'](_0x470c5e)[_0x9c59('0x23')](function(_0x1fd06b){_0x2b244d[_0x9c59('0x1e')]=_0x1fd06b;if(_0x288f12[_0x9c59('0x37')][_0x9c59('0x46')]){_0x3b9aa5[_0x9c59('0x47')]=[{'all':!![]}];}return db[_0x9c59('0x32')][_0x9c59('0x48')](_0x3b9aa5);})[_0x9c59('0x23')](function(_0x169ded){_0x2b244d[_0x9c59('0x49')]=_0x169ded;return _0x2b244d;})[_0x9c59('0x23')](respondWithFilteredResult(_0x2c4d54,_0x3b9aa5))['catch'](handleError(_0x2c4d54,null));};exports[_0x9c59('0x4a')]=function(_0x2c10c9,_0x4b2d14){var _0x2db0ba={'raw':![],'where':{'id':_0x2c10c9[_0x9c59('0x4b')]['id']}},_0x23affc={};_0x23affc[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x32')][_0x9c59('0x33')]);_0x23affc[_0x9c59('0x37')]=_['keys'](_0x2c10c9[_0x9c59('0x37')]);_0x23affc['filters']=_[_0x9c59('0x38')](_0x23affc[_0x9c59('0x36')],_0x23affc[_0x9c59('0x37')]);_0x2db0ba[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x23affc[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x2c10c9[_0x9c59('0x37')]['fields']));_0x2db0ba[_0x9c59('0x3a')]=_0x2db0ba[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x2db0ba[_0x9c59('0x3a')]:_0x23affc[_0x9c59('0x36')];if(_0x2c10c9[_0x9c59('0x37')][_0x9c59('0x46')]){_0x2db0ba[_0x9c59('0x47')]=[{'all':!![]}];}_0x2db0ba=_[_0x9c59('0x43')]({},_0x2db0ba,_0x2c10c9['options']);return db[_0x9c59('0x32')][_0x9c59('0x2d')](_0x2db0ba)[_0x9c59('0x23')](handleEntityNotFound(_0x4b2d14,null))[_0x9c59('0x23')](respondWithResult(_0x4b2d14,null))['catch'](handleError(_0x4b2d14,null));};exports[_0x9c59('0x4d')]=function(_0x46e6c0,_0x479f67){return db[_0x9c59('0x32')]['create'](_0x46e6c0['body'],{})[_0x9c59('0x23')](function(_0x8e2b39){var _0x3ecc91=_0x46e6c0[_0x9c59('0x4e')][_0x9c59('0x25')]({'plain':!![]});if(!_0x3ecc91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ecc91[_0x9c59('0x4f')]===_0x9c59('0x4e')){var _0x36f6ef=_0x8e2b39[_0x9c59('0x25')]({'plain':!![]});var _0x422fb0=[{'name':_0x9c59('0x26'),'value':_0x9c59('0x27')},{'name':'QueueCampaigns','value':_0x9c59('0x50')}];var _0x447e4f=_['find'](_0x422fb0,[_0x9c59('0x2a'),_0x36f6ef[_0x9c59('0x2c')]])[_0x9c59('0x2e')];return db[_0x9c59('0x51')][_0x9c59('0x2d')]({'where':{'name':_0x447e4f,'userProfileId':_0x3ecc91['userProfileId']},'raw':!![]})[_0x9c59('0x23')](function(_0x19cd40){if(_0x19cd40&&_0x19cd40[_0x9c59('0x52')]===0x0){return db[_0x9c59('0x53')][_0x9c59('0x4d')]({'name':_0x36f6ef[_0x9c59('0x2e')],'resourceId':_0x36f6ef['id'],'type':_0x19cd40[_0x9c59('0x2e')],'sectionId':_0x19cd40['id']},{})['then'](function(){return _0x8e2b39;});}else{return _0x8e2b39;}})['catch'](function(_0x3375b4){logger[_0x9c59('0x30')](_0x9c59('0x54'),_0x3375b4);throw _0x3375b4;});}return _0x8e2b39;})[_0x9c59('0x23')](respondWithResult(_0x479f67,0xc9))[_0x9c59('0x55')](handleError(_0x479f67,null));};exports['clone']=function(_0x1acd80,_0x4cd16f){var _0x2357b0={'where':{'id':_0x1acd80[_0x9c59('0x4b')]['id']}},_0x553599={};_0x553599[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x32')][_0x9c59('0x33')]);_0x2357b0[_0x9c59('0x3a')]=_['intersection'](_0x553599['model'],qs[_0x9c59('0x39')](_0x1acd80[_0x9c59('0x37')][_0x9c59('0x39')]));_0x2357b0[_0x9c59('0x3a')]=_0x2357b0['attributes'][_0x9c59('0x3b')]?_0x2357b0[_0x9c59('0x3a')]:_0x553599['model'];if(_0x1acd80[_0x9c59('0x37')][_0x9c59('0x46')]){_0x2357b0[_0x9c59('0x47')]=[{'all':!![]}];}_0x2357b0=_[_0x9c59('0x43')]({},_0x2357b0,_0x1acd80[_0x9c59('0x45')]);return db[_0x9c59('0x32')][_0x9c59('0x2d')](_0x2357b0)[_0x9c59('0x23')](handleEntityNotFound(_0x4cd16f,null))[_0x9c59('0x23')](function(_0x386ebd){if(_0x386ebd){var _0x1a638c=_0x386ebd[_0x9c59('0x25')]({'plain':!![]});_0x1a638c=qs['omit'](_0x1a638c,['id','createdAt',_0x9c59('0x56')]);_0x1acd80['body']=_[_0x9c59('0x57')](_0x1acd80[_0x9c59('0x58')],['id',_0x9c59('0x59'),'updatedAt']);return db[_0x9c59('0x32')][_0x9c59('0x4d')](_['merge'](_0x1a638c,_0x1acd80[_0x9c59('0x58')]),{'include':_0x1acd80[_0x9c59('0x37')][_0x9c59('0x46')]?[{'all':!![]}]:undefined})[_0x9c59('0x23')](function(_0xf5e341){var _0x431f2f=_0x1acd80[_0x9c59('0x4e')]['get']({'plain':!![]});if(!_0x431f2f)throw new Error(_0x9c59('0x5a'));if(_0x431f2f[_0x9c59('0x4f')]===_0x9c59('0x4e')){var _0x3f6077=_0xf5e341[_0x9c59('0x25')]({'plain':!![]});var _0x269f0e=[{'name':_0x9c59('0x26'),'value':_0x9c59('0x27')},{'name':_0x9c59('0x28'),'value':'outbound'}];var _0x30dc57=_[_0x9c59('0x2d')](_0x269f0e,[_0x9c59('0x2a'),_0x3f6077['type']])[_0x9c59('0x2e')];return db['UserProfileSection'][_0x9c59('0x2d')]({'where':{'name':_0x30dc57,'userProfileId':_0x431f2f[_0x9c59('0x5b')]},'raw':!![]})[_0x9c59('0x23')](function(_0x574ad2){if(_0x574ad2&&_0x574ad2[_0x9c59('0x52')]===0x0){return db[_0x9c59('0x53')][_0x9c59('0x4d')]({'name':_0x3f6077['name'],'resourceId':_0x3f6077['id'],'type':_0x574ad2[_0x9c59('0x2e')],'sectionId':_0x574ad2['id']},{})['then'](function(){return _0xf5e341;});}else{return _0xf5e341;}})[_0x9c59('0x55')](function(_0x43de6f){logger[_0x9c59('0x30')](_0x9c59('0x54'),_0x43de6f);throw _0x43de6f;});}return _0xf5e341;});}})[_0x9c59('0x23')](respondWithResult(_0x4cd16f,0xc9))['catch'](handleError(_0x4cd16f,null));};exports[_0x9c59('0x22')]=function(_0x30947f,_0x88c569){if(_0x30947f[_0x9c59('0x58')]['id']){delete _0x30947f['body']['id'];}return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x30947f[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x88c569,null))[_0x9c59('0x23')](saveUpdates(_0x30947f[_0x9c59('0x58')],null))[_0x9c59('0x23')](respondWithResult(_0x88c569,null))[_0x9c59('0x55')](handleError(_0x88c569,null));};exports['destroy']=function(_0x5a86b7,_0x261845){return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x5a86b7[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x261845,null))['then'](removeEntity(_0x261845,null))[_0x9c59('0x55')](handleError(_0x261845,null));};exports[_0x9c59('0x5c')]=function(_0x447c42,_0x328010,_0x5b3b6){var _0x3a920b={'raw':![],'where':{}};var _0x21075f={};var _0x35033d={'count':0x0,'rows':[]};return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x447c42['params']['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x328010,null))[_0x9c59('0x23')](function(_0x35744b){if(_0x35744b){_0x21075f['model']=_[_0x9c59('0x4c')](db[_0x9c59('0x5e')][_0x9c59('0x33')]);_0x21075f[_0x9c59('0x37')]=_['keys'](_0x447c42[_0x9c59('0x37')]);_0x21075f['filters']=_[_0x9c59('0x38')](_0x21075f[_0x9c59('0x36')],_0x21075f[_0x9c59('0x37')]);_0x3a920b[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x21075f[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x447c42[_0x9c59('0x37')]['fields']));_0x3a920b['attributes']=_0x3a920b['attributes'][_0x9c59('0x3b')]?_0x3a920b[_0x9c59('0x3a')]:_0x21075f[_0x9c59('0x36')];if(!_0x447c42[_0x9c59('0x37')][_0x9c59('0x3c')]('nolimit')){_0x3a920b[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x447c42['query'][_0x9c59('0x1d')]);_0x3a920b[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x447c42[_0x9c59('0x37')][_0x9c59('0x1b')]);}_0x3a920b[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x447c42[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x3a920b[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x447c42[_0x9c59('0x37')],_0x21075f[_0x9c59('0x42')]));_0x3a920b['where'][_0x9c59('0x5f')]=_0x35744b['id'];if(_0x447c42[_0x9c59('0x37')][_0x9c59('0x29')]){_0x3a920b[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x3a920b[_0x9c59('0x40')],{'$or':_['map'](_0x3a920b['attributes'],function(_0x22b2ea){var _0xe1c117={};_0xe1c117[_0x22b2ea]={'$like':'%'+_0x447c42[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0xe1c117;})});}_0x3a920b=_[_0x9c59('0x43')]({},_0x3a920b,_0x447c42[_0x9c59('0x45')]);return db[_0x9c59('0x5e')][_0x9c59('0x1e')]({'where':_0x3a920b[_0x9c59('0x40')]})[_0x9c59('0x23')](function(_0x1dae4f){_0x35033d['count']=_0x1dae4f;if(_0x447c42['query'][_0x9c59('0x46')]){_0x3a920b['include']=[{'all':!![]}];}return db[_0x9c59('0x5e')][_0x9c59('0x48')](_0x3a920b);})[_0x9c59('0x23')](function(_0x4fd5f){_0x35033d[_0x9c59('0x49')]=_0x4fd5f;return _0x35033d;});}})[_0x9c59('0x23')](respondWithFilteredResult(_0x328010,_0x3a920b))[_0x9c59('0x55')](handleError(_0x328010,null));};exports['getHopperHistories']=function(_0x4cee27,_0x518443,_0x233645){var _0x3daff9={'raw':!![],'where':{}};var _0x45db7d={};var _0x4d50b5={'count':0x0,'rows':[]};return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x4cee27[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x518443,null))[_0x9c59('0x23')](function(_0x227d4e){if(_0x227d4e){_0x45db7d[_0x9c59('0x36')]=_['keys'](db[_0x9c59('0x60')][_0x9c59('0x33')]);_0x45db7d['query']=_[_0x9c59('0x4c')](_0x4cee27[_0x9c59('0x37')]);_0x45db7d['filters']=_[_0x9c59('0x38')](_0x45db7d[_0x9c59('0x36')],_0x45db7d[_0x9c59('0x37')]);_0x3daff9['attributes']=_[_0x9c59('0x38')](_0x45db7d['model'],qs[_0x9c59('0x39')](_0x4cee27['query'][_0x9c59('0x39')]));_0x3daff9['attributes']=_0x3daff9[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x3daff9['attributes']:_0x45db7d[_0x9c59('0x36')];if(!_0x4cee27[_0x9c59('0x37')][_0x9c59('0x3c')]('nolimit')){_0x3daff9[_0x9c59('0x1d')]=qs['limit'](_0x4cee27[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x3daff9[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x4cee27[_0x9c59('0x37')][_0x9c59('0x1b')]);}_0x3daff9[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x4cee27['query'][_0x9c59('0x3f')]);_0x3daff9['where']=qs['filters'](_[_0x9c59('0x41')](_0x4cee27[_0x9c59('0x37')],_0x45db7d[_0x9c59('0x42')]));_0x3daff9[_0x9c59('0x40')][_0x9c59('0x5f')]=_0x227d4e['id'];if(_0x4cee27['query']['filter']){_0x3daff9[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x3daff9[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x3daff9[_0x9c59('0x3a')],function(_0x31421c){var _0x4b6915={};_0x4b6915[_0x31421c]={'$like':'%'+_0x4cee27[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x4b6915;})});}_0x3daff9=_[_0x9c59('0x43')]({},_0x3daff9,_0x4cee27['options']);return db[_0x9c59('0x60')][_0x9c59('0x1e')]({'where':_0x3daff9['where']})[_0x9c59('0x23')](function(_0x3e67d3){_0x4d50b5[_0x9c59('0x1e')]=_0x3e67d3;if(_0x4cee27[_0x9c59('0x37')][_0x9c59('0x46')]){_0x3daff9[_0x9c59('0x47')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3daff9);})[_0x9c59('0x23')](function(_0x43b5c1){_0x4d50b5[_0x9c59('0x49')]=_0x43b5c1;return _0x4d50b5;});}})['then'](respondWithFilteredResult(_0x518443,_0x3daff9))[_0x9c59('0x55')](handleError(_0x518443,null));};exports[_0x9c59('0x61')]=function(_0x12b242,_0x246518,_0x5f19c8){var _0x109c38={'raw':!![],'where':{}};var _0x56c179={};var _0x5a2b37={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9c59('0x5d')]({'where':{'id':_0x12b242[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x246518,null))['then'](function(_0x160096){if(_0x160096){_0x56c179[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x62')][_0x9c59('0x33')]);_0x56c179[_0x9c59('0x37')]=_['keys'](_0x12b242['query']);_0x56c179['filters']=_[_0x9c59('0x38')](_0x56c179[_0x9c59('0x36')],_0x56c179[_0x9c59('0x37')]);_0x109c38['attributes']=_['intersection'](_0x56c179['model'],qs[_0x9c59('0x39')](_0x12b242[_0x9c59('0x37')][_0x9c59('0x39')]));_0x109c38[_0x9c59('0x3a')]=_0x109c38[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x109c38[_0x9c59('0x3a')]:_0x56c179[_0x9c59('0x36')];if(!_0x12b242['query'][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x109c38[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x12b242['query']['limit']);_0x109c38[_0x9c59('0x1b')]=qs['offset'](_0x12b242['query'][_0x9c59('0x1b')]);}_0x109c38[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x12b242[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x109c38[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x12b242[_0x9c59('0x37')],_0x56c179[_0x9c59('0x42')]));_0x109c38[_0x9c59('0x40')][_0x9c59('0x5f')]=_0x160096['id'];if(_0x12b242[_0x9c59('0x37')][_0x9c59('0x29')]){_0x109c38[_0x9c59('0x40')]=_['merge'](_0x109c38[_0x9c59('0x40')],{'$or':_['map'](_0x109c38['attributes'],function(_0x37e5ae){var _0x2384ec={};_0x2384ec[_0x37e5ae]={'$like':'%'+_0x12b242[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x2384ec;})});}_0x109c38=_['merge']({},_0x109c38,_0x12b242[_0x9c59('0x45')]);return db[_0x9c59('0x62')][_0x9c59('0x1e')]({'where':_0x109c38[_0x9c59('0x40')]})[_0x9c59('0x23')](function(_0x45d1d7){_0x5a2b37[_0x9c59('0x1e')]=_0x45d1d7;if(_0x12b242[_0x9c59('0x37')][_0x9c59('0x46')]){_0x109c38[_0x9c59('0x47')]=[{'all':!![]}];}return db[_0x9c59('0x62')][_0x9c59('0x48')](_0x109c38);})[_0x9c59('0x23')](function(_0x5c1dc2){_0x5a2b37[_0x9c59('0x49')]=_0x5c1dc2;return _0x5a2b37;});}})['then'](respondWithFilteredResult(_0x246518,_0x109c38))[_0x9c59('0x55')](handleError(_0x246518,null));};exports[_0x9c59('0x63')]=function(_0x137a4f,_0x3ce6c4,_0x403e48){var _0x2dbc60={'raw':!![],'where':{}};var _0x3fd0b7={};var _0x275be5={'count':0x0,'rows':[]};return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x137a4f[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x3ce6c4,null))[_0x9c59('0x23')](function(_0x35b214){if(_0x35b214){_0x3fd0b7[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x64')][_0x9c59('0x33')]);_0x3fd0b7['query']=_[_0x9c59('0x4c')](_0x137a4f[_0x9c59('0x37')]);_0x3fd0b7[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x3fd0b7[_0x9c59('0x36')],_0x3fd0b7[_0x9c59('0x37')]);_0x2dbc60[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x3fd0b7[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x137a4f[_0x9c59('0x37')]['fields']));_0x2dbc60['attributes']=_0x2dbc60[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x2dbc60[_0x9c59('0x3a')]:_0x3fd0b7[_0x9c59('0x36')];if(!_0x137a4f[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x2dbc60['limit']=qs['limit'](_0x137a4f[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x2dbc60[_0x9c59('0x1b')]=qs['offset'](_0x137a4f['query']['offset']);}_0x2dbc60[_0x9c59('0x3e')]=qs['sort'](_0x137a4f['query'][_0x9c59('0x3f')]);_0x2dbc60['where']=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x137a4f[_0x9c59('0x37')],_0x3fd0b7[_0x9c59('0x42')]));_0x2dbc60[_0x9c59('0x40')]['VoiceQueueId']=_0x35b214['id'];if(_0x137a4f[_0x9c59('0x37')][_0x9c59('0x29')]){_0x2dbc60[_0x9c59('0x40')]=_['merge'](_0x2dbc60[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x2dbc60[_0x9c59('0x3a')],function(_0x7e9e64){var _0x10dd7f={};_0x10dd7f[_0x7e9e64]={'$like':'%'+_0x137a4f[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x10dd7f;})});}_0x2dbc60=_[_0x9c59('0x43')]({},_0x2dbc60,_0x137a4f['options']);return db[_0x9c59('0x64')]['count']({'where':_0x2dbc60[_0x9c59('0x40')]})[_0x9c59('0x23')](function(_0x199679){_0x275be5[_0x9c59('0x1e')]=_0x199679;if(_0x137a4f[_0x9c59('0x37')][_0x9c59('0x46')]){_0x2dbc60[_0x9c59('0x47')]=[{'all':!![]}];}return db[_0x9c59('0x64')][_0x9c59('0x48')](_0x2dbc60);})[_0x9c59('0x23')](function(_0x450e2a){_0x275be5['rows']=_0x450e2a;return _0x275be5;});}})[_0x9c59('0x23')](respondWithFilteredResult(_0x3ce6c4,_0x2dbc60))['catch'](handleError(_0x3ce6c4,null));};exports[_0x9c59('0x65')]=function(_0x2cc893,_0x9a813a,_0x51329c){var _0x36696b={};var _0x1b0475={};var _0x44762a;var _0x575da6;return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x2cc893[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x9a813a,null))[_0x9c59('0x23')](function(_0x39b201){if(_0x39b201){_0x44762a=_0x39b201;_0x1b0475[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db['Team'][_0x9c59('0x33')]);_0x1b0475[_0x9c59('0x37')]=_[_0x9c59('0x4c')](_0x2cc893['query']);_0x1b0475[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x1b0475['model'],_0x1b0475[_0x9c59('0x37')]);_0x36696b[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x1b0475[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x2cc893[_0x9c59('0x37')][_0x9c59('0x39')]));_0x36696b['attributes']=_0x36696b[_0x9c59('0x3a')]['length']?_0x36696b['attributes']:_0x1b0475['model'];_0x36696b[_0x9c59('0x3e')]=qs['sort'](_0x2cc893[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x36696b[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x2cc893[_0x9c59('0x37')],_0x1b0475[_0x9c59('0x42')]));if(_0x2cc893[_0x9c59('0x37')][_0x9c59('0x29')]){_0x36696b['where']=_[_0x9c59('0x43')](_0x36696b['where'],{'$or':_[_0x9c59('0x44')](_0x36696b[_0x9c59('0x3a')],function(_0x32a78a){var _0x41f665={};_0x41f665[_0x32a78a]={'$like':'%'+_0x2cc893[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x41f665;})});}_0x36696b=_[_0x9c59('0x43')]({},_0x36696b,_0x2cc893['options']);return _0x44762a[_0x9c59('0x65')](_0x36696b);}})[_0x9c59('0x23')](function(_0x106faf){if(_0x106faf){_0x575da6=_0x106faf['length'];if(!_0x2cc893[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x36696b['limit']=qs[_0x9c59('0x1d')](_0x2cc893['query'][_0x9c59('0x1d')]);_0x36696b[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x2cc893[_0x9c59('0x37')][_0x9c59('0x1b')]);}return _0x44762a[_0x9c59('0x65')](_0x36696b);}})[_0x9c59('0x23')](function(_0x35ffa6){if(_0x35ffa6){return _0x35ffa6?{'count':_0x575da6,'rows':_0x35ffa6}:null;}})[_0x9c59('0x23')](respondWithResult(_0x9a813a,null))[_0x9c59('0x55')](handleError(_0x9a813a,null));};exports[_0x9c59('0x66')]=function(_0x15a407,_0x1c7c0b,_0x184d8){var _0x15d277=_0x15a407['body']['teams'];var _0x483143=_[_0x9c59('0x44')](_0x15d277,'id');return db[_0x9c59('0x67')]['findAll']({'where':{'id':_0x483143},'attributes':['id'],'include':[{'model':db[_0x9c59('0x68')],'as':'Agents','attributes':['id','name',_0x9c59('0x69'),_0x9c59('0x6a'),_0x9c59('0x6b')],'raw':!![]}]})[_0x9c59('0x23')](function(_0x5d2e58){if(_0x5d2e58){var _0x3d05c1=_['flatMap'](_0x5d2e58,function(_0xf2e33b){var _0x51ec5c=_0xf2e33b[_0x9c59('0x25')]({'plain':!![]});_0x51ec5c[_0x9c59('0x6c')][_0x9c59('0x6d')](function(_0x5c5ec2){_0x5c5ec2['penalty']=_[_0x9c59('0x2d')](_0x15d277,{'id':_0x51ec5c['id']})[_0x9c59('0x6e')];});return _0x51ec5c[_0x9c59('0x6c')];});return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x15a407[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](function(_0x4a1261){return db[_0x9c59('0x6f')][_0x9c59('0x70')](function(_0x4be839){return _0x4a1261[_0x9c59('0x66')](_0x483143,{'transaction':_0x4be839})[_0x9c59('0x23')](function(){return BPromise[_0x9c59('0x71')](_0x15d277,function(_0x47680e){return db[_0x9c59('0x72')]['upsert']({'TeamId':_0x47680e['id'],'VoiceQueueId':_0x15a407['params']['id'],'penalty':_0x47680e['penalty']},{'transaction':_0x4be839});});})[_0x9c59('0x23')](function(){return BPromise[_0x9c59('0x71')](_0x3d05c1,function(_0x571ff0){return db[_0x9c59('0x73')]['findOrCreate']({'where':{'UserId':_0x571ff0['id'],'VoiceQueueId':_0x15a407[_0x9c59('0x4b')]['id']},'defaults':{'penalty':_0x571ff0[_0x9c59('0x6e')]},'transaction':_0x4be839});});})[_0x9c59('0x23')](function(){return BPromise['each'](_[_0x9c59('0x29')](_0x3d05c1,{'online':!![]}),function(_0x225eb6){return db[_0x9c59('0x74')][_0x9c59('0x75')]({'membername':_0x225eb6[_0x9c59('0x2e')],'UserId':_0x225eb6['id'],'queue_name':_0x4a1261[_0x9c59('0x2e')],'VoiceQueueId':_0x4a1261['id'],'interface':_[_0x9c59('0x76')](_0x225eb6[_0x9c59('0x6b')])?util[_0x9c59('0x77')]('SIP/%s',_0x225eb6[_0x9c59('0x2e')]):_0x225eb6['interface'],'paused':_0x225eb6['voicePause']||![],'penalty':_0x225eb6[_0x9c59('0x6e')]},{'transaction':_0x4be839});});})['then'](function(){_0x3d05c1['forEach'](function(_0x31c4e7){socket['emit'](_0x9c59('0x78'),{'UserId':_0x31c4e7['id'],'VoiceQueueId':_0x4a1261['id']});});});});});}})['then'](respondWithStatusCode(_0x1c7c0b,null))[_0x9c59('0x55')](handleError(_0x1c7c0b,null));};exports[_0x9c59('0x79')]=function(_0x55043a,_0x58c2f1,_0x218b55){return db[_0x9c59('0x67')][_0x9c59('0x48')]({'where':{'id':_0x55043a[_0x9c59('0x37')][_0x9c59('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x9c59('0x68')],'as':_0x9c59('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x9c59('0x23')](handleEntityNotFound(_0x58c2f1,null))[_0x9c59('0x23')](function(_0x40e684){var _0x1e6f0d=_[_0x9c59('0x44')](_0x40e684,'id');var _0xc80265=[];var _0x28f3bc=[];var _0x252f03=squel[_0x9c59('0x7b')]();_0x252f03[_0x9c59('0x7c')](_0x9c59('0x7d'))[_0x9c59('0x7e')](_0x9c59('0x7f'),'tq')[_0x9c59('0x80')](_0x9c59('0x81'),'ut',_0x9c59('0x82'))[_0x9c59('0x40')](_0x9c59('0x83'),_0x55043a['params']['id']);for(var _0x1aab32=0x0;_0x1aab32<_0x40e684['length'];_0x1aab32+=0x1){let _0x30154e=_0x40e684[_0x1aab32];for(var _0x3e4992=0x0;_0x3e4992<_0x30154e[_0x9c59('0x6c')][_0x9c59('0x3b')];_0x3e4992+=0x1){let _0x12b147=_0x30154e[_0x9c59('0x6c')][_0x3e4992];var _0x43742c=_0x252f03[_0x9c59('0x84')]();_0x43742c[_0x9c59('0x40')](_0x9c59('0x85'),_0x12b147['id']);_0x28f3bc['push'](db['sequelize'][_0x9c59('0x37')](_0x43742c[_0x9c59('0x86')](),{'type':db[_0x9c59('0x6f')][_0x9c59('0x87')][_0x9c59('0x88')]})['then'](function(_0x4b819b){if(_0x4b819b[_0x9c59('0x3b')]===0x1){return _0x12b147['id'];}else{var _0x363e34=_[_0x9c59('0x89')](_[_0x9c59('0x44')](_0x4b819b,_0x9c59('0x8a')),function(_0x4c47e2){return _[_0x9c59('0x2b')](_0x1e6f0d,_0x4c47e2);});if(_0x363e34){return _0x12b147['id'];}}}));}}return BPromise['all'](_0x28f3bc)[_0x9c59('0x23')](function(_0x581941){_0xc80265=_(_0xc80265)[_0x9c59('0x8b')](_0x581941)[_0x9c59('0x8c')]()['value']();return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x55043a[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](function(_0x25f08b){return db['sequelize'][_0x9c59('0x70')](function(_0x2e5c92){return _0x25f08b[_0x9c59('0x79')](_0x55043a[_0x9c59('0x37')][_0x9c59('0x7a')],{'transaction':_0x2e5c92})['then'](function(){if(!_[_0x9c59('0x8d')](_0xc80265)){return _0x25f08b['removeAgents'](_0xc80265,{'transaction':_0x2e5c92})['then'](function(){return db[_0x9c59('0x74')][_0x9c59('0x24')]({'where':{'VoiceQueueId':_0x55043a[_0x9c59('0x4b')]['id'],'UserId':_0xc80265},'transaction':_0x2e5c92});});}})[_0x9c59('0x23')](function(){_0xc80265[_0x9c59('0x6d')](function(_0x2e3cbc){socket['emit'](_0x9c59('0x8e'),{'UserId':_0x2e3cbc,'VoiceQueueId':_0x25f08b['id']});});});});});});})[_0x9c59('0x23')](respondWithStatusCode(_0x58c2f1,null))[_0x9c59('0x55')](handleError(_0x58c2f1,null));};exports[_0x9c59('0x8f')]=function(_0x19eaab,_0x771c90,_0x27d567){var _0x34415d,_0x3037e0;return db[_0x9c59('0x32')]['find']({'where':{'id':_0x19eaab[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x771c90,null))[_0x9c59('0x23')](function(_0x593799){if(_0x593799){_0x3037e0=_0x593799;return _0x593799[_0x9c59('0x8f')](_0x19eaab[_0x9c59('0x58')][_0x9c59('0x7a')],_[_0x9c59('0x57')](_0x19eaab[_0x9c59('0x58')],[_0x9c59('0x7a'),'id'])||{})[_0x9c59('0x90')](function(_0x20d05e){for(var _0x47b277=0x0;_0x47b277<_0x19eaab['body']['ids']['length'];_0x47b277+=0x1){socket[_0x9c59('0x91')](_0x9c59('0x78'),{'UserId':Number(_0x19eaab[_0x9c59('0x58')][_0x9c59('0x7a')][_0x47b277]),'VoiceQueueId':Number(_0x19eaab['params']['id'])});}return _0x20d05e;});}})['then'](function(_0x1629f5){_0x34415d=_0x1629f5||[];if(_0x3037e0){return db[_0x9c59('0x68')][_0x9c59('0x48')]({'where':{'id':_0x19eaab[_0x9c59('0x58')][_0x9c59('0x7a')]},'attributes':['id',_0x9c59('0x2e'),_0x9c59('0x69'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x3cde22){if(!_[_0x9c59('0x8d')](_0x3cde22)){var _0x96b4be=[];for(var _0x48250d=0x0;_0x48250d<_0x3cde22[_0x9c59('0x3b')];_0x48250d++){if(_0x3cde22[_0x48250d][_0x9c59('0x69')]){_0x96b4be[_0x9c59('0x92')](db[_0x9c59('0x74')][_0x9c59('0x75')]({'membername':_0x3cde22[_0x48250d][_0x9c59('0x2e')],'UserId':_0x3cde22[_0x48250d]['id'],'queue_name':_0x3037e0['name'],'VoiceQueueId':_0x3037e0['id'],'interface':_[_0x9c59('0x76')](_0x3cde22[_0x48250d]['interface'])?util[_0x9c59('0x77')](_0x9c59('0x93'),_0x3cde22[_0x48250d]['name']):_0x3cde22[_0x48250d][_0x9c59('0x6b')],'paused':_0x3cde22[_0x48250d][_0x9c59('0x6a')]||![],'penalty':_0x19eaab[_0x9c59('0x58')][_0x9c59('0x6e')]||0x0}));}}return BPromise['all'](_0x96b4be);}})[_0x9c59('0x23')](function(){return _0x34415d;})[_0x9c59('0x23')](respondWithResult(_0x771c90,null))[_0x9c59('0x55')](handleError(_0x771c90,null));};exports['removeAgents']=function(_0x2f9e6a,_0x4a98b8,_0x2ff9e7){return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x2f9e6a['params']['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x4a98b8,null))['then'](function(_0x9e046c){if(_0x9e046c){return _0x9e046c['removeAgents'](_0x2f9e6a[_0x9c59('0x37')]['ids'])[_0x9c59('0x23')](function(){if(_['isArray'](_0x2f9e6a[_0x9c59('0x37')][_0x9c59('0x7a')])){for(var _0x37bc52=0x0;_0x37bc52<_0x2f9e6a[_0x9c59('0x37')][_0x9c59('0x7a')][_0x9c59('0x3b')];_0x37bc52+=0x1){socket[_0x9c59('0x91')](_0x9c59('0x8e'),{'UserId':Number(_0x2f9e6a[_0x9c59('0x37')][_0x9c59('0x7a')][_0x37bc52]),'VoiceQueueId':Number(_0x2f9e6a['params']['id'])});}}else{socket['emit'](_0x9c59('0x8e'),{'UserId':Number(_0x2f9e6a['query']['ids']),'VoiceQueueId':Number(_0x2f9e6a[_0x9c59('0x4b')]['id'])});}});}})[_0x9c59('0x23')](function(_0xd0d643){return db['UserVoiceQueueRt'][_0x9c59('0x24')]({'where':{'VoiceQueueId':_0x2f9e6a[_0x9c59('0x4b')]['id'],'UserId':_0x2f9e6a['query'][_0x9c59('0x7a')]}})[_0x9c59('0x23')](function(){return _0xd0d643;});})['then'](respondWithStatusCode(_0x4a98b8,null))[_0x9c59('0x55')](handleError(_0x4a98b8,null));};exports['getAgents']=function(_0x216394,_0x5a3968,_0x599f2d){var _0x23fe93={};var _0x156ae4={};var _0x370930;var _0x133bf5;return db['VoiceQueue'][_0x9c59('0x5d')]({'where':{'id':_0x216394['params']['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x5a3968,null))[_0x9c59('0x23')](function(_0x5eb407){if(_0x5eb407){_0x370930=_0x5eb407;_0x156ae4[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x68')][_0x9c59('0x33')]);_0x156ae4[_0x9c59('0x37')]=_[_0x9c59('0x4c')](_0x216394[_0x9c59('0x37')]);_0x156ae4[_0x9c59('0x42')]=_['intersection'](_0x156ae4[_0x9c59('0x36')],_0x156ae4[_0x9c59('0x37')]);_0x23fe93[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x156ae4[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x216394[_0x9c59('0x37')]['fields']));_0x23fe93[_0x9c59('0x3a')]=_0x23fe93[_0x9c59('0x3a')]['length']?_0x23fe93[_0x9c59('0x3a')]:_0x156ae4['model'];_0x23fe93[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x216394['query'][_0x9c59('0x3f')]);_0x23fe93[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_['pick'](_0x216394['query'],_0x156ae4[_0x9c59('0x42')]));if(_0x216394[_0x9c59('0x37')][_0x9c59('0x29')]){_0x23fe93[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x23fe93[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x23fe93['attributes'],function(_0x49523c){var _0x5e26be={};_0x5e26be[_0x49523c]={'$like':'%'+_0x216394[_0x9c59('0x37')]['filter']+'%'};return _0x5e26be;})});}_0x23fe93=_[_0x9c59('0x43')]({},_0x23fe93,_0x216394[_0x9c59('0x45')]);return _0x370930[_0x9c59('0x94')](_0x23fe93);}})[_0x9c59('0x23')](function(_0x47bd44){if(_0x47bd44){_0x133bf5=_0x47bd44[_0x9c59('0x3b')];if(!_0x216394[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x23fe93[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x216394[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x23fe93[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x216394[_0x9c59('0x37')]['offset']);}return _0x370930[_0x9c59('0x94')](_0x23fe93);}})[_0x9c59('0x23')](function(_0x203531){if(_0x203531){return _0x203531?{'count':_0x133bf5,'rows':_0x203531}:null;}})[_0x9c59('0x23')](respondWithResult(_0x5a3968,null))[_0x9c59('0x55')](handleError(_0x5a3968,null));};exports[_0x9c59('0x95')]=function(_0x4fb693,_0x44f1c3,_0x4385e9){var _0x93fb86={};var _0x1324ef={};var _0x1eff8d;var _0x2ecb59;return db[_0x9c59('0x32')]['findOne']({'where':{'id':_0x4fb693[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x44f1c3,null))[_0x9c59('0x23')](function(_0x461cd9){if(_0x461cd9){_0x1eff8d=_0x461cd9;_0x1324ef[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x74')][_0x9c59('0x33')]);_0x1324ef[_0x9c59('0x37')]=_[_0x9c59('0x4c')](_0x4fb693[_0x9c59('0x37')]);_0x1324ef[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x1324ef['model'],_0x1324ef[_0x9c59('0x37')]);_0x93fb86[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x1324ef[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x4fb693[_0x9c59('0x37')][_0x9c59('0x39')]));_0x93fb86[_0x9c59('0x3a')]=_0x93fb86[_0x9c59('0x3a')]['length']?_0x93fb86[_0x9c59('0x3a')]:_0x1324ef[_0x9c59('0x36')];_0x93fb86[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x4fb693[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x93fb86['where']=qs['filters'](_[_0x9c59('0x41')](_0x4fb693[_0x9c59('0x37')],_0x1324ef[_0x9c59('0x42')]));if(_0x4fb693[_0x9c59('0x37')]['filter']){_0x93fb86[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x93fb86['where'],{'$or':_[_0x9c59('0x44')](_0x93fb86[_0x9c59('0x3a')],function(_0x5e9ba9){var _0x15cb14={};_0x15cb14[_0x5e9ba9]={'$like':'%'+_0x4fb693[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x15cb14;})});}_0x93fb86=_[_0x9c59('0x43')]({},_0x93fb86,_0x4fb693['options']);return _0x1eff8d[_0x9c59('0x95')](_0x93fb86);}})[_0x9c59('0x23')](function(_0x4f55aa){if(_0x4f55aa){_0x2ecb59=_0x4f55aa['length'];if(!_0x4fb693[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x93fb86[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x4fb693[_0x9c59('0x37')]['limit']);_0x93fb86['offset']=qs['offset'](_0x4fb693[_0x9c59('0x37')][_0x9c59('0x1b')]);}return _0x1eff8d['getMembers'](_0x93fb86);}})[_0x9c59('0x23')](function(_0x97506f){return _0x97506f?{'count':_0x2ecb59,'rows':_0x97506f}:null;})[_0x9c59('0x23')](respondWithResult(_0x44f1c3,null))[_0x9c59('0x55')](handleError(_0x44f1c3,null));};exports[_0x9c59('0x96')]=function(_0x41ecf9,_0x3c630f,_0x4925e3){var _0x113f1f={};var _0x65ab44={};var _0x3fa95a;var _0x3814e3;return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x41ecf9[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c630f,null))[_0x9c59('0x23')](function(_0x3619d0){if(_0x3619d0){_0x3fa95a=_0x3619d0;_0x65ab44[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x97')][_0x9c59('0x33')]);_0x65ab44['query']=_[_0x9c59('0x4c')](_0x41ecf9[_0x9c59('0x37')]);_0x65ab44[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x65ab44[_0x9c59('0x36')],_0x65ab44[_0x9c59('0x37')]);_0x113f1f['attributes']=_['intersection'](_0x65ab44[_0x9c59('0x36')],qs['fields'](_0x41ecf9[_0x9c59('0x37')]['fields']));_0x113f1f[_0x9c59('0x3a')]=_0x113f1f[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x113f1f['attributes']:_0x65ab44[_0x9c59('0x36')];_0x113f1f[_0x9c59('0x3e')]=qs['sort'](_0x41ecf9[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x113f1f[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x41ecf9[_0x9c59('0x37')],_0x65ab44[_0x9c59('0x42')]));if(_0x41ecf9[_0x9c59('0x37')][_0x9c59('0x29')]){_0x113f1f[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x113f1f[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x113f1f['attributes'],function(_0x505d45){var _0x2705c9={};_0x2705c9[_0x505d45]={'$like':'%'+_0x41ecf9['query'][_0x9c59('0x29')]+'%'};return _0x2705c9;})});}_0x113f1f=_['merge']({},_0x113f1f,_0x41ecf9[_0x9c59('0x45')]);return _0x3fa95a[_0x9c59('0x96')](_0x113f1f);}})[_0x9c59('0x23')](function(_0x2fa625){if(_0x2fa625){_0x3814e3=_0x2fa625['length'];if(!_0x41ecf9['query'][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x113f1f['limit']=qs[_0x9c59('0x1d')](_0x41ecf9[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x113f1f[_0x9c59('0x1b')]=qs['offset'](_0x41ecf9[_0x9c59('0x37')]['offset']);}return _0x3fa95a[_0x9c59('0x96')](_0x113f1f);}})[_0x9c59('0x23')](function(_0x11a642){if(_0x11a642){return _0x11a642?{'count':_0x3814e3,'rows':_0x11a642}:null;}})['then'](respondWithResult(_0x3c630f,null))[_0x9c59('0x55')](handleError(_0x3c630f,null));};exports[_0x9c59('0x98')]=function(_0x3793ab,_0x5e38ed,_0x412f0a){var _0x5028d8=moment()[_0x9c59('0x77')](_0x9c59('0x99'));var _0x57c996,_0x4ee302;return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x3793ab[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x5e38ed,null))['then'](function(_0x2b4d3e){if(_0x2b4d3e){_0x4ee302=_0x2b4d3e;return _0x2b4d3e['addLists'](_0x3793ab[_0x9c59('0x58')]['ids'],_[_0x9c59('0x57')](_0x3793ab['body'],[_0x9c59('0x7a'),'id'])||{});}return null;})[_0x9c59('0x90')](function(_0x264468){var _0x44de0c;_0x57c996=_0x264468||[];var _0x7b0747=[];if(_0x264468){for(var _0x28837d=0x0;_0x28837d<_0x264468[_0x9c59('0x3b')];_0x28837d+=0x1){var _0x55429e=_0x264468[_0x28837d][_0x9c59('0x25')]({'plain':!![]});_0x4ee302[_0x9c59('0x9a')]=_0x3793ab['body'][_0x9c59('0x9a')]?_0x3793ab[_0x9c59('0x58')][_0x9c59('0x9a')]:_0x4ee302[_0x9c59('0x9a')];switch(_0x4ee302['dialCheckDuplicateType']){case'always':_0x44de0c=squel['insert']()[_0x9c59('0x9b')](_0x9c59('0x9c'))[_0x9c59('0x9d')](['phone','scheduledAt','ContactId',_0x9c59('0x9e'),_0x9c59('0x5f'),_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0x9f'),'phone')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0xa0'))[_0x9c59('0x7c')]('id','ContactId')[_0x9c59('0x7c')](_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')](),_0x9c59('0x9e'))[_0x9c59('0x7c')](_0x3793ab[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),_0x9c59('0x5f'))['field']('\x27'+_0x5028d8+'\x27','createdAt')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27','updatedAt')[_0x9c59('0x7e')](_0x9c59('0xa2'))[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')](_0x9c59('0xa4'),_0x55429e[_0x9c59('0xa1')]['toString']())['where'](_0x9c59('0xa5'))[_0x9c59('0x40')](_0x9c59('0xa6'),squel[_0x9c59('0x7b')]()['field'](_0x9c59('0xa7'))['from'](_0x9c59('0xa8'))[_0x9c59('0x40')](_0x9c59('0x83'),_0x3793ab['params']['id'][_0x9c59('0x86')]()))[_0x9c59('0x40')](_0x9c59('0xa6'),squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0xa9'))['from'](_0x9c59('0x9c'))['where'](_0x9c59('0x83'),_0x3793ab['params']['id']['toString']())))[_0x9c59('0x86')]();break;case _0x9c59('0xaa'):_0x44de0c=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0x9c'))['fromQuery'](['phone',_0x9c59('0xa0'),_0x9c59('0xac'),_0x9c59('0x9e'),_0x9c59('0x5f'),_0x9c59('0x59'),'updatedAt'],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0x9f'),'phone')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27','scheduledAt')[_0x9c59('0x7c')]('id','ContactId')[_0x9c59('0x7c')](_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')](),_0x9c59('0x9e'))['field'](_0x3793ab[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),'VoiceQueueId')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x59'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x56'))[_0x9c59('0x7e')]('cm_contacts')[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')](_0x9c59('0xa4'),_0x55429e[_0x9c59('0xa1')]['toString']())[_0x9c59('0x40')](_0x9c59('0xa5'))['where'](_0x9c59('0xa6'),squel['select']()[_0x9c59('0x7c')]('COALESCE(phone,\x27\x27)')[_0x9c59('0x7e')](_0x9c59('0x9c'))[_0x9c59('0x40')]('VoiceQueueId\x20=\x20?',_0x3793ab['params']['id'][_0x9c59('0x86')]())))[_0x9c59('0x86')]();break;default:_0x44de0c=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0x9c'))['fromQuery']([_0x9c59('0x9f'),'scheduledAt',_0x9c59('0xac'),_0x9c59('0x9e'),_0x9c59('0x5f'),_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')]('phone',_0x9c59('0x9f'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0xa0'))[_0x9c59('0x7c')]('id',_0x9c59('0xac'))[_0x9c59('0x7c')](_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')](),_0x9c59('0x9e'))[_0x9c59('0x7c')](_0x3793ab[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),_0x9c59('0x5f'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x59'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27','updatedAt')[_0x9c59('0x7e')]('cm_contacts')[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')]('ListId\x20=\x20?',_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')]())[_0x9c59('0x40')](_0x9c59('0xa5')))[_0x9c59('0x86')]();}_0x7b0747[_0x9c59('0x92')](db[_0x9c59('0x6f')][_0x9c59('0x37')](_0x44de0c));}return BPromise[_0x9c59('0xad')](_0x7b0747);}})[_0x9c59('0x23')](function(){var _0x1ca599=[];var _0x5603a8=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0xae'))['fromQuery']([_0x9c59('0xaf'),'phone','OrderBy',_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0xb0'))[_0x9c59('0x7c')](_0x9c59('0xb1'))[_0x9c59('0x7c')]('ci.OrderBy+1')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x59'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x56'))[_0x9c59('0x7e')]('cm_contact_has_items','ci')[_0x9c59('0x80')](_0x9c59('0x9c'),'h',_0x9c59('0xb2'))[_0x9c59('0x40')]('h.scheduledat=?',_0x5028d8)[_0x9c59('0x40')]('ci.ItemClass=?',_0x9c59('0xb3')))[_0x9c59('0x86')]();_0x1ca599[_0x9c59('0x92')](db[_0x9c59('0x6f')][_0x9c59('0x37')](_0x5603a8));return BPromise[_0x9c59('0xad')](_0x1ca599);})[_0x9c59('0x23')](function(){return _0x57c996;})[_0x9c59('0x23')](respondWithResult(_0x5e38ed,null))[_0x9c59('0x55')](handleError(_0x5e38ed,null));};exports['removeLists']=function(_0x7ee9eb,_0x5a533b,_0x3f2aa9){return db[_0x9c59('0x32')]['find']({'where':{'id':_0x7ee9eb[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a533b,null))[_0x9c59('0x23')](function(_0x4f24f4){if(_0x4f24f4){return _0x4f24f4['removeLists'](_0x7ee9eb[_0x9c59('0x37')]['ids']);}})['then'](function(_0xba4ad9){if(_0xba4ad9){return db['CmHopper'][_0x9c59('0x24')]({'where':{'ListId':_0x7ee9eb[_0x9c59('0x37')][_0x9c59('0x7a')],'VoiceQueueId':_0x7ee9eb[_0x9c59('0x4b')]['id']}})['then'](function(){return _0xba4ad9;});}})[_0x9c59('0x23')](respondWithStatusCode(_0x5a533b,null))[_0x9c59('0x55')](handleError(_0x5a533b,null));};exports[_0x9c59('0xb4')]=function(_0x11d04a,_0x1094fb,_0x54b0e7){var _0x542f33={};var _0x3a380e={};var _0x22e860;var _0x17566e;return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x11d04a[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1094fb,null))[_0x9c59('0x23')](function(_0x1cb60b){if(_0x1cb60b){_0x22e860=_0x1cb60b;_0x3a380e[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x97')]['rawAttributes']);_0x3a380e[_0x9c59('0x37')]=_['keys'](_0x11d04a[_0x9c59('0x37')]);_0x3a380e[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x3a380e[_0x9c59('0x36')],_0x3a380e[_0x9c59('0x37')]);_0x542f33[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x3a380e[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x11d04a['query'][_0x9c59('0x39')]));_0x542f33[_0x9c59('0x3a')]=_0x542f33[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x542f33[_0x9c59('0x3a')]:_0x3a380e[_0x9c59('0x36')];_0x542f33[_0x9c59('0x3e')]=qs['sort'](_0x11d04a['query'][_0x9c59('0x3f')]);_0x542f33[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x11d04a[_0x9c59('0x37')],_0x3a380e[_0x9c59('0x42')]));if(_0x11d04a[_0x9c59('0x37')][_0x9c59('0x29')]){_0x542f33[_0x9c59('0x40')]=_['merge'](_0x542f33[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x542f33[_0x9c59('0x3a')],function(_0x49f161){var _0x35a275={};_0x35a275[_0x49f161]={'$like':'%'+_0x11d04a[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x35a275;})});}_0x542f33=_[_0x9c59('0x43')]({},_0x542f33,_0x11d04a[_0x9c59('0x45')]);return _0x22e860[_0x9c59('0xb4')](_0x542f33);}})[_0x9c59('0x23')](function(_0x17892a){if(_0x17892a){_0x17566e=_0x17892a[_0x9c59('0x3b')];if(!_0x11d04a[_0x9c59('0x37')][_0x9c59('0x3c')]('nolimit')){_0x542f33['limit']=qs['limit'](_0x11d04a[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x542f33['offset']=qs[_0x9c59('0x1b')](_0x11d04a[_0x9c59('0x37')][_0x9c59('0x1b')]);}return _0x22e860[_0x9c59('0xb4')](_0x542f33);}})[_0x9c59('0x23')](function(_0x2c938f){if(_0x2c938f){return _0x2c938f?{'count':_0x17566e,'rows':_0x2c938f}:null;}})['then'](respondWithResult(_0x1094fb,null))[_0x9c59('0x55')](handleError(_0x1094fb,null));};exports['addBlackLists']=function(_0x315e21,_0x20fd77,_0x31b631){var _0x2aceb3,_0xb8e48b;return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x315e21['params']['id']}})['then'](handleEntityNotFound(_0x20fd77,null))[_0x9c59('0x23')](function(_0x521104){if(_0x521104){_0xb8e48b=_0x521104;return _0x521104[_0x9c59('0xb5')](_0x315e21[_0x9c59('0x58')][_0x9c59('0x7a')],_['omit'](_0x315e21[_0x9c59('0x58')],[_0x9c59('0x7a'),'id'])||{});}return null;})[_0x9c59('0x90')](function(_0x1497ce){var _0x39ab34;_0x2aceb3=_0x1497ce||[];var _0x58e51d=[];if(_0x1497ce){for(var _0x153d2a=0x0;_0x153d2a<_0x1497ce['length'];_0x153d2a+=0x1){var _0x6eb43f=_0x1497ce[_0x153d2a][_0x9c59('0x25')]({'plain':!![]});_0x39ab34=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0xb6'))[_0x9c59('0x9d')](['phone','ContactId','ListId',_0x9c59('0x5f'),_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0x9f'),'phone')[_0x9c59('0x7c')]('id',_0x9c59('0xac'))[_0x9c59('0x7c')](_0x6eb43f[_0x9c59('0xa1')]['toString'](),'ListId')['field'](_0x315e21[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),_0x9c59('0x5f'))[_0x9c59('0x7c')]('NOW()',_0x9c59('0x59'))[_0x9c59('0x7c')](_0x9c59('0xb7'),_0x9c59('0x56'))[_0x9c59('0x7e')](_0x9c59('0xa2'))[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')](_0x9c59('0xa4'),_0x6eb43f[_0x9c59('0xa1')]['toString']())[_0x9c59('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x9c59('0x86')]();_0x58e51d[_0x9c59('0x92')](db[_0x9c59('0x6f')][_0x9c59('0x37')](_0x39ab34));}return BPromise[_0x9c59('0xad')](_0x58e51d);}})[_0x9c59('0x23')](function(){return _0x2aceb3;})[_0x9c59('0x23')](respondWithResult(_0x20fd77,null))['catch'](handleError(_0x20fd77,null));};exports[_0x9c59('0xb8')]=function(_0x47f729,_0x224f71,_0x3a342f){return db['VoiceQueue'][_0x9c59('0x2d')]({'where':{'id':_0x47f729[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x224f71,null))[_0x9c59('0x23')](function(_0x1b3dbe){if(_0x1b3dbe){return _0x1b3dbe[_0x9c59('0xb8')](_0x47f729[_0x9c59('0x37')]['ids']);}})[_0x9c59('0x23')](function(_0x3735d0){if(_0x3735d0){return db[_0x9c59('0x64')]['destroy']({'where':{'ListId':_0x47f729[_0x9c59('0x37')][_0x9c59('0x7a')],'VoiceQueueId':_0x47f729[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](function(){return _0x3735d0;});}})[_0x9c59('0x23')](respondWithStatusCode(_0x224f71,null))[_0x9c59('0x55')](handleError(_0x224f71,null));}; \ No newline at end of file +var _0xed5c=['length','nolimit','order','sort','pick','where','merge','count','includeAll','include','VoiceQueue','rows','catch','show','params','create','body','role','user','find','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','hasOwnProperty','VoiceQueueId','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','every','includes','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','omit','spread','SIP/%s','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','phone','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','ContactId','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','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','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','type','name','UserProfileResource','destroy','end','error','stack','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x139eb4,_0x42d7e6){var _0x32dd1d=function(_0x236d95){while(--_0x236d95){_0x139eb4['push'](_0x139eb4['shift']());}};_0x32dd1d(++_0x42d7e6);}(_0xed5c,0x81));var _0xced5=function(_0x520ef4,_0x2254c3){_0x520ef4=_0x520ef4-0x0;var _0x36d395=_0xed5c[_0x520ef4];return _0x36d395;};'use strict';var emlformat=require(_0xced5('0x0'));var rimraf=require(_0xced5('0x1'));var zipdir=require(_0xced5('0x2'));var jsonpatch=require(_0xced5('0x3'));var rp=require(_0xced5('0x4'));var moment=require(_0xced5('0x5'));var BPromise=require(_0xced5('0x6'));var Mustache=require(_0xced5('0x7'));var util=require(_0xced5('0x8'));var path=require(_0xced5('0x9'));var sox=require('sox');var csv=require(_0xced5('0xa'));var ejs=require(_0xced5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xced5('0xc'));var crypto=require(_0xced5('0xd'));var jsforce=require(_0xced5('0xe'));var deskjs=require(_0xced5('0xf'));var toCsv=require(_0xced5('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xced5('0x10'));var authService=require(_0xced5('0x11'));var qs=require(_0xced5('0x12'));var as=require(_0xced5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced5('0x14'))('api');var utils=require(_0xced5('0x15'));var config=require(_0xced5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xced5('0x17'))['db'];config['redis']=_[_0xced5('0x18')](config[_0xced5('0x19')],{'host':_0xced5('0x1a'),'port':0x18eb});var socket=require(_0xced5('0x1b'))(new Redis(config[_0xced5('0x19')]));require(_0xced5('0x1c'))[_0xced5('0x1d')](socket);function respondWithStatusCode(_0x4bee02,_0x4b2533){_0x4b2533=_0x4b2533||0xcc;return function(_0x23ca09){if(_0x23ca09){return _0x4bee02[_0xced5('0x1e')](_0x4b2533);}return _0x4bee02[_0xced5('0x1f')](_0x4b2533)['end']();};}function respondWithResult(_0x4fa2a3,_0x456843){_0x456843=_0x456843||0xc8;return function(_0x1c8c90){if(_0x1c8c90){return _0x4fa2a3[_0xced5('0x1f')](_0x456843)[_0xced5('0x20')](_0x1c8c90);}};}function respondWithFilteredResult(_0x17e4eb,_0x13928f){return function(_0x54c5a4){if(_0x54c5a4){var _0x29a3ba=typeof _0x13928f[_0xced5('0x21')]==='undefined'&&typeof _0x13928f[_0xced5('0x22')]===_0xced5('0x23');var _0x14e3ec=_0x54c5a4['count'];var _0x127eb4=_0x29a3ba?0x0:_0x13928f[_0xced5('0x21')];var _0x2a5aca=_0x29a3ba?_0x54c5a4['count']:_0x13928f[_0xced5('0x21')]+_0x13928f[_0xced5('0x22')];var _0xf84ec;if(_0x2a5aca>=_0x14e3ec){_0x2a5aca=_0x14e3ec;_0xf84ec=0xc8;}else{_0xf84ec=0xce;}_0x17e4eb[_0xced5('0x1f')](_0xf84ec);return _0x17e4eb[_0xced5('0x24')](_0xced5('0x25'),_0x127eb4+'-'+_0x2a5aca+'/'+_0x14e3ec)['json'](_0x54c5a4);}return null;};}function patchUpdates(_0x1ba520){return function(_0x4a56a4){try{jsonpatch[_0xced5('0x26')](_0x4a56a4,_0x1ba520,!![]);}catch(_0x5b11c5){return BPromise[_0xced5('0x27')](_0x5b11c5);}return _0x4a56a4[_0xced5('0x28')]();};}function saveUpdates(_0x1c18e0,_0x45766f){return function(_0xe536f8){if(_0xe536f8){return _0xe536f8[_0xced5('0x29')](_0x1c18e0)[_0xced5('0x2a')](function(_0x2f092b){return _0x2f092b;});}return null;};}function removeEntity(_0x548cbb,_0x92ac47){return function(_0x4de26f){if(_0x4de26f){return _0x4de26f['destroy']()[_0xced5('0x2a')](function(){var _0x2cd6c4=_0x4de26f[_0xced5('0x2b')]({'plain':!![]});var _0x2e4774=[{'name':_0xced5('0x2c'),'value':_0xced5('0x2d'),'ignore':![]},{'name':_0xced5('0x2e'),'value':_0xced5('0x2f'),'ignore':![]}];var _0x239b32=_(_0x2e4774)[_0xced5('0x30')](_0xced5('0x31'))['map'](_0xced5('0x32'))[_0xced5('0x32')]();if(_['includes'](_0x239b32,_0x2cd6c4['type'])){return;}var _0x499040=_['find'](_0x2e4774,[_0xced5('0x32'),_0x2cd6c4[_0xced5('0x33')]])[_0xced5('0x34')];return db[_0xced5('0x35')][_0xced5('0x36')]({'where':{'type':_0x499040,'resourceId':_0x2cd6c4['id']}})['then'](function(){return _0x4de26f;});})[_0xced5('0x2a')](function(){_0x548cbb['status'](0xcc)[_0xced5('0x37')]();});}};}function handleEntityNotFound(_0x1fa141,_0x4d56c6){return function(_0x5d8f4f){if(!_0x5d8f4f){_0x1fa141[_0xced5('0x1e')](0x194);}return _0x5d8f4f;};}function handleError(_0x579b4a,_0x2faacb){_0x2faacb=_0x2faacb||0x1f4;return function(_0x3bd7d5){logger[_0xced5('0x38')](_0x3bd7d5[_0xced5('0x39')]);if(_0x3bd7d5[_0xced5('0x34')]){delete _0x3bd7d5[_0xced5('0x34')];}_0x579b4a[_0xced5('0x1f')](_0x2faacb)['send'](_0x3bd7d5);};}exports[_0xced5('0x3a')]=function(_0x213569,_0x5dca26){var _0x39fb2c={},_0x3ff95d={},_0x542afe={'count':0x0,'rows':[]};var _0x288ab0=_[_0xced5('0x3b')](db['VoiceQueue'][_0xced5('0x3c')],function(_0x4ea2fa){return{'name':_0x4ea2fa[_0xced5('0x3d')],'type':_0x4ea2fa['type'][_0xced5('0x3e')]};});_0x3ff95d[_0xced5('0x3f')]=_['map'](_0x288ab0,'name');_0x3ff95d[_0xced5('0x40')]=_[_0xced5('0x41')](_0x213569['query']);_0x3ff95d[_0xced5('0x42')]=_[_0xced5('0x43')](_0x3ff95d['model'],_0x3ff95d[_0xced5('0x40')]);_0x39fb2c[_0xced5('0x44')]=_[_0xced5('0x43')](_0x3ff95d['model'],qs[_0xced5('0x45')](_0x213569[_0xced5('0x40')][_0xced5('0x45')]));_0x39fb2c['attributes']=_0x39fb2c[_0xced5('0x44')][_0xced5('0x46')]?_0x39fb2c[_0xced5('0x44')]:_0x3ff95d['model'];if(!_0x213569[_0xced5('0x40')]['hasOwnProperty'](_0xced5('0x47'))){_0x39fb2c[_0xced5('0x22')]=qs[_0xced5('0x22')](_0x213569[_0xced5('0x40')][_0xced5('0x22')]);_0x39fb2c[_0xced5('0x21')]=qs[_0xced5('0x21')](_0x213569['query'][_0xced5('0x21')]);}_0x39fb2c[_0xced5('0x48')]=qs[_0xced5('0x49')](_0x213569['query'][_0xced5('0x49')]);_0x39fb2c['where']=qs[_0xced5('0x42')](_[_0xced5('0x4a')](_0x213569[_0xced5('0x40')],_0x3ff95d[_0xced5('0x42')]),_0x288ab0);if(_0x213569[_0xced5('0x40')][_0xced5('0x30')]){_0x39fb2c[_0xced5('0x4b')]=_['merge'](_0x39fb2c[_0xced5('0x4b')],{'$or':_['map'](_0x288ab0,function(_0x466e6a){if(_0x466e6a[_0xced5('0x33')]!=='VIRTUAL'){var _0x2f2a57={};_0x2f2a57[_0x466e6a[_0xced5('0x34')]]={'$like':'%'+_0x213569[_0xced5('0x40')][_0xced5('0x30')]+'%'};return _0x2f2a57;}})});}_0x39fb2c=_[_0xced5('0x4c')]({},_0x39fb2c,_0x213569['options']);var _0x53636f={'where':_0x39fb2c[_0xced5('0x4b')]};return db['VoiceQueue'][_0xced5('0x4d')](_0x53636f)[_0xced5('0x2a')](function(_0xf38fab){_0x542afe[_0xced5('0x4d')]=_0xf38fab;if(_0x213569[_0xced5('0x40')][_0xced5('0x4e')]){_0x39fb2c[_0xced5('0x4f')]=[{'all':!![]}];}return db[_0xced5('0x50')]['findAll'](_0x39fb2c);})['then'](function(_0x5c8a1c){_0x542afe[_0xced5('0x51')]=_0x5c8a1c;return _0x542afe;})[_0xced5('0x2a')](respondWithFilteredResult(_0x5dca26,_0x39fb2c))[_0xced5('0x52')](handleError(_0x5dca26,null));};exports[_0xced5('0x53')]=function(_0x1849b9,_0x1539a2){var _0xeb8839={'raw':![],'where':{'id':_0x1849b9[_0xced5('0x54')]['id']}},_0x1cab90={};_0x1cab90[_0xced5('0x3f')]=_[_0xced5('0x41')](db['VoiceQueue'][_0xced5('0x3c')]);_0x1cab90[_0xced5('0x40')]=_[_0xced5('0x41')](_0x1849b9[_0xced5('0x40')]);_0x1cab90[_0xced5('0x42')]=_[_0xced5('0x43')](_0x1cab90['model'],_0x1cab90[_0xced5('0x40')]);_0xeb8839[_0xced5('0x44')]=_[_0xced5('0x43')](_0x1cab90[_0xced5('0x3f')],qs[_0xced5('0x45')](_0x1849b9[_0xced5('0x40')][_0xced5('0x45')]));_0xeb8839[_0xced5('0x44')]=_0xeb8839['attributes'][_0xced5('0x46')]?_0xeb8839[_0xced5('0x44')]:_0x1cab90[_0xced5('0x3f')];if(_0x1849b9[_0xced5('0x40')][_0xced5('0x4e')]){_0xeb8839[_0xced5('0x4f')]=[{'all':!![]}];}_0xeb8839=_['merge']({},_0xeb8839,_0x1849b9['options']);return db[_0xced5('0x50')]['find'](_0xeb8839)[_0xced5('0x2a')](handleEntityNotFound(_0x1539a2,null))['then'](respondWithResult(_0x1539a2,null))[_0xced5('0x52')](handleError(_0x1539a2,null));};exports['create']=function(_0xbefa95,_0xfda45c){return db[_0xced5('0x50')][_0xced5('0x55')](_0xbefa95[_0xced5('0x56')],{})[_0xced5('0x2a')](function(_0xcb1ec1){var _0x3a958f=_0xbefa95['user'][_0xced5('0x2b')]({'plain':!![]});if(!_0x3a958f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a958f[_0xced5('0x57')]===_0xced5('0x58')){var _0x4a47bb=_0xcb1ec1[_0xced5('0x2b')]({'plain':!![]});var _0x50e559=[{'name':_0xced5('0x2c'),'value':_0xced5('0x2d')},{'name':_0xced5('0x2e'),'value':_0xced5('0x2f')}];var _0x590def=_[_0xced5('0x59')](_0x50e559,[_0xced5('0x32'),_0x4a47bb[_0xced5('0x33')]])[_0xced5('0x34')];return db[_0xced5('0x5a')]['find']({'where':{'name':_0x590def,'userProfileId':_0x3a958f[_0xced5('0x5b')]},'raw':!![]})[_0xced5('0x2a')](function(_0xd6315d){if(_0xd6315d&&_0xd6315d[_0xced5('0x5c')]===0x0){return db[_0xced5('0x35')][_0xced5('0x55')]({'name':_0x4a47bb[_0xced5('0x34')],'resourceId':_0x4a47bb['id'],'type':_0xd6315d[_0xced5('0x34')],'sectionId':_0xd6315d['id']},{})[_0xced5('0x2a')](function(){return _0xcb1ec1;});}else{return _0xcb1ec1;}})[_0xced5('0x52')](function(_0x442094){logger[_0xced5('0x38')](_0xced5('0x5d'),_0x442094);throw _0x442094;});}return _0xcb1ec1;})[_0xced5('0x2a')](respondWithResult(_0xfda45c,0xc9))[_0xced5('0x52')](handleError(_0xfda45c,null));};exports[_0xced5('0x5e')]=function(_0x8301b8,_0x4a6e1d){var _0x44cb19={'where':{'id':_0x8301b8[_0xced5('0x54')]['id']}},_0x11f019={};_0x11f019[_0xced5('0x3f')]=_[_0xced5('0x41')](db[_0xced5('0x50')]['rawAttributes']);_0x44cb19[_0xced5('0x44')]=_['intersection'](_0x11f019[_0xced5('0x3f')],qs[_0xced5('0x45')](_0x8301b8[_0xced5('0x40')][_0xced5('0x45')]));_0x44cb19[_0xced5('0x44')]=_0x44cb19[_0xced5('0x44')]['length']?_0x44cb19[_0xced5('0x44')]:_0x11f019[_0xced5('0x3f')];if(_0x8301b8['query'][_0xced5('0x4e')]){_0x44cb19['include']=[{'all':!![]}];}_0x44cb19=_['merge']({},_0x44cb19,_0x8301b8[_0xced5('0x5f')]);return db[_0xced5('0x50')][_0xced5('0x59')](_0x44cb19)[_0xced5('0x2a')](handleEntityNotFound(_0x4a6e1d,null))['then'](function(_0x2259d2){if(_0x2259d2){var _0xea78be=_0x2259d2[_0xced5('0x2b')]({'plain':!![]});_0xea78be=qs['omit'](_0xea78be,['id',_0xced5('0x60'),_0xced5('0x61')]);_0x8301b8['body']=_['omit'](_0x8301b8[_0xced5('0x56')],['id',_0xced5('0x60'),'updatedAt']);return db['VoiceQueue'][_0xced5('0x55')](_[_0xced5('0x4c')](_0xea78be,_0x8301b8[_0xced5('0x56')]),{'include':_0x8301b8['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x426b3b){var _0x599327=_0x8301b8[_0xced5('0x58')][_0xced5('0x2b')]({'plain':!![]});if(!_0x599327)throw new Error(_0xced5('0x62'));if(_0x599327[_0xced5('0x57')]===_0xced5('0x58')){var _0x50d5fd=_0x426b3b[_0xced5('0x2b')]({'plain':!![]});var _0x448a33=[{'name':_0xced5('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xced5('0x2f')}];var _0x4dde63=_['find'](_0x448a33,[_0xced5('0x32'),_0x50d5fd['type']])[_0xced5('0x34')];return db['UserProfileSection'][_0xced5('0x59')]({'where':{'name':_0x4dde63,'userProfileId':_0x599327[_0xced5('0x5b')]},'raw':!![]})[_0xced5('0x2a')](function(_0x39a7f2){if(_0x39a7f2&&_0x39a7f2[_0xced5('0x5c')]===0x0){return db['UserProfileResource'][_0xced5('0x55')]({'name':_0x50d5fd[_0xced5('0x34')],'resourceId':_0x50d5fd['id'],'type':_0x39a7f2['name'],'sectionId':_0x39a7f2['id']},{})[_0xced5('0x2a')](function(){return _0x426b3b;});}else{return _0x426b3b;}})[_0xced5('0x52')](function(_0x546420){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x546420);throw _0x546420;});}return _0x426b3b;});}})[_0xced5('0x2a')](respondWithResult(_0x4a6e1d,0xc9))[_0xced5('0x52')](handleError(_0x4a6e1d,null));};exports[_0xced5('0x29')]=function(_0x3f202c,_0x248535){if(_0x3f202c[_0xced5('0x56')]['id']){delete _0x3f202c[_0xced5('0x56')]['id'];}return db[_0xced5('0x50')]['find']({'where':{'id':_0x3f202c[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x248535,null))[_0xced5('0x2a')](saveUpdates(_0x3f202c[_0xced5('0x56')],null))[_0xced5('0x2a')](respondWithResult(_0x248535,null))[_0xced5('0x52')](handleError(_0x248535,null));};exports[_0xced5('0x36')]=function(_0x425a1e,_0x474b1f){return db[_0xced5('0x50')]['find']({'where':{'id':_0x425a1e['params']['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x474b1f,null))[_0xced5('0x2a')](removeEntity(_0x474b1f,null))[_0xced5('0x52')](handleError(_0x474b1f,null));};exports[_0xced5('0x63')]=function(_0x43abb9,_0x35a2d6,_0x5ed3bc){var _0x3dcfbc={'raw':![],'where':{}};var _0x216223={};var _0x451e90={'count':0x0,'rows':[]};return db[_0xced5('0x50')][_0xced5('0x64')]({'where':{'id':_0x43abb9['params']['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x35a2d6,null))[_0xced5('0x2a')](function(_0x5d80d5){if(_0x5d80d5){_0x216223[_0xced5('0x3f')]=_[_0xced5('0x41')](db[_0xced5('0x65')][_0xced5('0x3c')]);_0x216223['query']=_[_0xced5('0x41')](_0x43abb9[_0xced5('0x40')]);_0x216223['filters']=_[_0xced5('0x43')](_0x216223[_0xced5('0x3f')],_0x216223[_0xced5('0x40')]);_0x3dcfbc[_0xced5('0x44')]=_[_0xced5('0x43')](_0x216223[_0xced5('0x3f')],qs[_0xced5('0x45')](_0x43abb9[_0xced5('0x40')]['fields']));_0x3dcfbc[_0xced5('0x44')]=_0x3dcfbc[_0xced5('0x44')]['length']?_0x3dcfbc[_0xced5('0x44')]:_0x216223[_0xced5('0x3f')];if(!_0x43abb9['query'][_0xced5('0x66')](_0xced5('0x47'))){_0x3dcfbc['limit']=qs[_0xced5('0x22')](_0x43abb9[_0xced5('0x40')]['limit']);_0x3dcfbc[_0xced5('0x21')]=qs[_0xced5('0x21')](_0x43abb9[_0xced5('0x40')][_0xced5('0x21')]);}_0x3dcfbc[_0xced5('0x48')]=qs[_0xced5('0x49')](_0x43abb9[_0xced5('0x40')][_0xced5('0x49')]);_0x3dcfbc[_0xced5('0x4b')]=qs['filters'](_[_0xced5('0x4a')](_0x43abb9[_0xced5('0x40')],_0x216223[_0xced5('0x42')]));_0x3dcfbc[_0xced5('0x4b')][_0xced5('0x67')]=_0x5d80d5['id'];if(_0x43abb9[_0xced5('0x40')][_0xced5('0x30')]){_0x3dcfbc[_0xced5('0x4b')]=_['merge'](_0x3dcfbc['where'],{'$or':_[_0xced5('0x3b')](_0x3dcfbc[_0xced5('0x44')],function(_0x38abe9){var _0x262d48={};_0x262d48[_0x38abe9]={'$like':'%'+_0x43abb9[_0xced5('0x40')][_0xced5('0x30')]+'%'};return _0x262d48;})});}_0x3dcfbc=_[_0xced5('0x4c')]({},_0x3dcfbc,_0x43abb9['options']);return db['CmHopper'][_0xced5('0x4d')]({'where':_0x3dcfbc['where']})[_0xced5('0x2a')](function(_0x2f9ae5){_0x451e90[_0xced5('0x4d')]=_0x2f9ae5;if(_0x43abb9[_0xced5('0x40')]['includeAll']){_0x3dcfbc[_0xced5('0x4f')]=[{'all':!![]}];}return db[_0xced5('0x65')]['findAll'](_0x3dcfbc);})[_0xced5('0x2a')](function(_0x4bb793){_0x451e90[_0xced5('0x51')]=_0x4bb793;return _0x451e90;});}})[_0xced5('0x2a')](respondWithFilteredResult(_0x35a2d6,_0x3dcfbc))[_0xced5('0x52')](handleError(_0x35a2d6,null));};exports['getHopperHistories']=function(_0x38512b,_0x59b8ca,_0xcf0652){var _0x5e9b3f={'raw':!![],'where':{}};var _0x426915={};var _0x4eeb79={'count':0x0,'rows':[]};return db[_0xced5('0x50')][_0xced5('0x64')]({'where':{'id':_0x38512b['params']['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x59b8ca,null))[_0xced5('0x2a')](function(_0x33bd7e){if(_0x33bd7e){_0x426915[_0xced5('0x3f')]=_[_0xced5('0x41')](db[_0xced5('0x68')][_0xced5('0x3c')]);_0x426915[_0xced5('0x40')]=_[_0xced5('0x41')](_0x38512b['query']);_0x426915[_0xced5('0x42')]=_[_0xced5('0x43')](_0x426915[_0xced5('0x3f')],_0x426915[_0xced5('0x40')]);_0x5e9b3f[_0xced5('0x44')]=_[_0xced5('0x43')](_0x426915['model'],qs[_0xced5('0x45')](_0x38512b['query'][_0xced5('0x45')]));_0x5e9b3f[_0xced5('0x44')]=_0x5e9b3f[_0xced5('0x44')][_0xced5('0x46')]?_0x5e9b3f[_0xced5('0x44')]:_0x426915[_0xced5('0x3f')];if(!_0x38512b[_0xced5('0x40')][_0xced5('0x66')](_0xced5('0x47'))){_0x5e9b3f[_0xced5('0x22')]=qs['limit'](_0x38512b['query'][_0xced5('0x22')]);_0x5e9b3f['offset']=qs[_0xced5('0x21')](_0x38512b['query']['offset']);}_0x5e9b3f[_0xced5('0x48')]=qs[_0xced5('0x49')](_0x38512b[_0xced5('0x40')]['sort']);_0x5e9b3f[_0xced5('0x4b')]=qs[_0xced5('0x42')](_[_0xced5('0x4a')](_0x38512b[_0xced5('0x40')],_0x426915['filters']));_0x5e9b3f[_0xced5('0x4b')]['VoiceQueueId']=_0x33bd7e['id'];if(_0x38512b[_0xced5('0x40')]['filter']){_0x5e9b3f[_0xced5('0x4b')]=_[_0xced5('0x4c')](_0x5e9b3f[_0xced5('0x4b')],{'$or':_['map'](_0x5e9b3f['attributes'],function(_0x5fcbed){var _0x1f412a={};_0x1f412a[_0x5fcbed]={'$like':'%'+_0x38512b['query'][_0xced5('0x30')]+'%'};return _0x1f412a;})});}_0x5e9b3f=_[_0xced5('0x4c')]({},_0x5e9b3f,_0x38512b[_0xced5('0x5f')]);return db[_0xced5('0x68')][_0xced5('0x4d')]({'where':_0x5e9b3f[_0xced5('0x4b')]})[_0xced5('0x2a')](function(_0x247b1e){_0x4eeb79[_0xced5('0x4d')]=_0x247b1e;if(_0x38512b[_0xced5('0x40')][_0xced5('0x4e')]){_0x5e9b3f[_0xced5('0x4f')]=[{'all':!![]}];}return db[_0xced5('0x68')][_0xced5('0x69')](_0x5e9b3f);})[_0xced5('0x2a')](function(_0x582ef4){_0x4eeb79[_0xced5('0x51')]=_0x582ef4;return _0x4eeb79;});}})[_0xced5('0x2a')](respondWithFilteredResult(_0x59b8ca,_0x5e9b3f))[_0xced5('0x52')](handleError(_0x59b8ca,null));};exports[_0xced5('0x6a')]=function(_0x1c9857,_0x289ae2,_0xe8e587){var _0xd6dcbd={'raw':!![],'where':{}};var _0x302405={};var _0x535f56={'count':0x0,'rows':[]};return db[_0xced5('0x50')][_0xced5('0x64')]({'where':{'id':_0x1c9857[_0xced5('0x54')]['id']}})['then'](handleEntityNotFound(_0x289ae2,null))[_0xced5('0x2a')](function(_0x3380bd){if(_0x3380bd){_0x302405[_0xced5('0x3f')]=_[_0xced5('0x41')](db[_0xced5('0x6b')][_0xced5('0x3c')]);_0x302405[_0xced5('0x40')]=_[_0xced5('0x41')](_0x1c9857[_0xced5('0x40')]);_0x302405['filters']=_['intersection'](_0x302405[_0xced5('0x3f')],_0x302405['query']);_0xd6dcbd['attributes']=_[_0xced5('0x43')](_0x302405['model'],qs[_0xced5('0x45')](_0x1c9857['query'][_0xced5('0x45')]));_0xd6dcbd['attributes']=_0xd6dcbd['attributes'][_0xced5('0x46')]?_0xd6dcbd[_0xced5('0x44')]:_0x302405['model'];if(!_0x1c9857[_0xced5('0x40')][_0xced5('0x66')](_0xced5('0x47'))){_0xd6dcbd[_0xced5('0x22')]=qs[_0xced5('0x22')](_0x1c9857[_0xced5('0x40')][_0xced5('0x22')]);_0xd6dcbd[_0xced5('0x21')]=qs[_0xced5('0x21')](_0x1c9857[_0xced5('0x40')]['offset']);}_0xd6dcbd[_0xced5('0x48')]=qs[_0xced5('0x49')](_0x1c9857[_0xced5('0x40')][_0xced5('0x49')]);_0xd6dcbd[_0xced5('0x4b')]=qs['filters'](_['pick'](_0x1c9857['query'],_0x302405[_0xced5('0x42')]));_0xd6dcbd['where'][_0xced5('0x67')]=_0x3380bd['id'];if(_0x1c9857['query']['filter']){_0xd6dcbd['where']=_[_0xced5('0x4c')](_0xd6dcbd['where'],{'$or':_['map'](_0xd6dcbd[_0xced5('0x44')],function(_0x31c1e1){var _0x5631a1={};_0x5631a1[_0x31c1e1]={'$like':'%'+_0x1c9857[_0xced5('0x40')]['filter']+'%'};return _0x5631a1;})});}_0xd6dcbd=_[_0xced5('0x4c')]({},_0xd6dcbd,_0x1c9857[_0xced5('0x5f')]);return db['CmHopperFinal'][_0xced5('0x4d')]({'where':_0xd6dcbd['where']})[_0xced5('0x2a')](function(_0x19753a){_0x535f56['count']=_0x19753a;if(_0x1c9857[_0xced5('0x40')][_0xced5('0x4e')]){_0xd6dcbd['include']=[{'all':!![]}];}return db[_0xced5('0x6b')]['findAll'](_0xd6dcbd);})[_0xced5('0x2a')](function(_0x482575){_0x535f56['rows']=_0x482575;return _0x535f56;});}})[_0xced5('0x2a')](respondWithFilteredResult(_0x289ae2,_0xd6dcbd))[_0xced5('0x52')](handleError(_0x289ae2,null));};exports['getHopperBlacks']=function(_0x1286d9,_0x44608e,_0x27ffad){var _0x7aac76={'raw':!![],'where':{}};var _0x31d78b={};var _0x206f87={'count':0x0,'rows':[]};return db[_0xced5('0x50')][_0xced5('0x64')]({'where':{'id':_0x1286d9[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x44608e,null))[_0xced5('0x2a')](function(_0x52f53a){if(_0x52f53a){_0x31d78b['model']=_[_0xced5('0x41')](db[_0xced5('0x6c')][_0xced5('0x3c')]);_0x31d78b[_0xced5('0x40')]=_[_0xced5('0x41')](_0x1286d9['query']);_0x31d78b[_0xced5('0x42')]=_[_0xced5('0x43')](_0x31d78b[_0xced5('0x3f')],_0x31d78b['query']);_0x7aac76[_0xced5('0x44')]=_[_0xced5('0x43')](_0x31d78b[_0xced5('0x3f')],qs[_0xced5('0x45')](_0x1286d9[_0xced5('0x40')][_0xced5('0x45')]));_0x7aac76[_0xced5('0x44')]=_0x7aac76['attributes'][_0xced5('0x46')]?_0x7aac76[_0xced5('0x44')]:_0x31d78b[_0xced5('0x3f')];if(!_0x1286d9[_0xced5('0x40')][_0xced5('0x66')](_0xced5('0x47'))){_0x7aac76[_0xced5('0x22')]=qs[_0xced5('0x22')](_0x1286d9['query'][_0xced5('0x22')]);_0x7aac76[_0xced5('0x21')]=qs['offset'](_0x1286d9[_0xced5('0x40')][_0xced5('0x21')]);}_0x7aac76[_0xced5('0x48')]=qs['sort'](_0x1286d9['query'][_0xced5('0x49')]);_0x7aac76[_0xced5('0x4b')]=qs[_0xced5('0x42')](_[_0xced5('0x4a')](_0x1286d9['query'],_0x31d78b[_0xced5('0x42')]));_0x7aac76['where'][_0xced5('0x67')]=_0x52f53a['id'];if(_0x1286d9['query']['filter']){_0x7aac76[_0xced5('0x4b')]=_[_0xced5('0x4c')](_0x7aac76[_0xced5('0x4b')],{'$or':_[_0xced5('0x3b')](_0x7aac76['attributes'],function(_0x541062){var _0x33646e={};_0x33646e[_0x541062]={'$like':'%'+_0x1286d9[_0xced5('0x40')][_0xced5('0x30')]+'%'};return _0x33646e;})});}_0x7aac76=_[_0xced5('0x4c')]({},_0x7aac76,_0x1286d9[_0xced5('0x5f')]);return db[_0xced5('0x6c')][_0xced5('0x4d')]({'where':_0x7aac76[_0xced5('0x4b')]})[_0xced5('0x2a')](function(_0x13ad22){_0x206f87[_0xced5('0x4d')]=_0x13ad22;if(_0x1286d9['query'][_0xced5('0x4e')]){_0x7aac76[_0xced5('0x4f')]=[{'all':!![]}];}return db[_0xced5('0x6c')]['findAll'](_0x7aac76);})[_0xced5('0x2a')](function(_0x4a5e13){_0x206f87['rows']=_0x4a5e13;return _0x206f87;});}})[_0xced5('0x2a')](respondWithFilteredResult(_0x44608e,_0x7aac76))[_0xced5('0x52')](handleError(_0x44608e,null));};exports[_0xced5('0x6d')]=function(_0x151721,_0x5dd260,_0x2845af){var _0x4ce63f={};var _0x35668a={};var _0x338639;var _0x25dbb9;return db[_0xced5('0x50')]['findOne']({'where':{'id':_0x151721[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x5dd260,null))['then'](function(_0x5c2a19){if(_0x5c2a19){_0x338639=_0x5c2a19;_0x35668a['model']=_[_0xced5('0x41')](db[_0xced5('0x6e')][_0xced5('0x3c')]);_0x35668a[_0xced5('0x40')]=_[_0xced5('0x41')](_0x151721[_0xced5('0x40')]);_0x35668a[_0xced5('0x42')]=_[_0xced5('0x43')](_0x35668a['model'],_0x35668a[_0xced5('0x40')]);_0x4ce63f[_0xced5('0x44')]=_[_0xced5('0x43')](_0x35668a[_0xced5('0x3f')],qs[_0xced5('0x45')](_0x151721[_0xced5('0x40')]['fields']));_0x4ce63f[_0xced5('0x44')]=_0x4ce63f[_0xced5('0x44')]['length']?_0x4ce63f['attributes']:_0x35668a[_0xced5('0x3f')];_0x4ce63f['order']=qs['sort'](_0x151721[_0xced5('0x40')][_0xced5('0x49')]);_0x4ce63f[_0xced5('0x4b')]=qs[_0xced5('0x42')](_[_0xced5('0x4a')](_0x151721[_0xced5('0x40')],_0x35668a[_0xced5('0x42')]));if(_0x151721[_0xced5('0x40')]['filter']){_0x4ce63f[_0xced5('0x4b')]=_[_0xced5('0x4c')](_0x4ce63f['where'],{'$or':_[_0xced5('0x3b')](_0x4ce63f[_0xced5('0x44')],function(_0x4a8b34){var _0x51d710={};_0x51d710[_0x4a8b34]={'$like':'%'+_0x151721['query'][_0xced5('0x30')]+'%'};return _0x51d710;})});}_0x4ce63f=_[_0xced5('0x4c')]({},_0x4ce63f,_0x151721[_0xced5('0x5f')]);return _0x338639[_0xced5('0x6d')](_0x4ce63f);}})[_0xced5('0x2a')](function(_0x3bed24){if(_0x3bed24){_0x25dbb9=_0x3bed24[_0xced5('0x46')];if(!_0x151721['query'][_0xced5('0x66')](_0xced5('0x47'))){_0x4ce63f[_0xced5('0x22')]=qs[_0xced5('0x22')](_0x151721[_0xced5('0x40')][_0xced5('0x22')]);_0x4ce63f[_0xced5('0x21')]=qs['offset'](_0x151721[_0xced5('0x40')]['offset']);}return _0x338639['getTeams'](_0x4ce63f);}})[_0xced5('0x2a')](function(_0x44a238){if(_0x44a238){return _0x44a238?{'count':_0x25dbb9,'rows':_0x44a238}:null;}})[_0xced5('0x2a')](respondWithResult(_0x5dd260,null))[_0xced5('0x52')](handleError(_0x5dd260,null));};exports[_0xced5('0x6f')]=function(_0x40f724,_0x5e4e68,_0x512f23){var _0x573eb6=_0x40f724['body']['teams'];var _0x530bbc=_['map'](_0x573eb6,'id');return db[_0xced5('0x6e')]['findAll']({'where':{'id':_0x530bbc},'attributes':['id'],'include':[{'model':db[_0xced5('0x70')],'as':_0xced5('0x71'),'attributes':['id',_0xced5('0x34'),_0xced5('0x72'),'voicePause',_0xced5('0x73')],'raw':!![]}]})[_0xced5('0x2a')](function(_0x590f82){if(_0x590f82){var _0x575456=_[_0xced5('0x74')](_0x590f82,function(_0x1138b){var _0x973ffd=_0x1138b[_0xced5('0x2b')]({'plain':!![]});_0x973ffd[_0xced5('0x71')][_0xced5('0x75')](function(_0x37efb8){_0x37efb8['penalty']=_['find'](_0x573eb6,{'id':_0x973ffd['id']})[_0xced5('0x76')];});return _0x973ffd[_0xced5('0x71')];});return db['VoiceQueue'][_0xced5('0x59')]({'where':{'id':_0x40f724[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](function(_0x2aa01c){return db[_0xced5('0x77')][_0xced5('0x78')](function(_0x52d75b){return _0x2aa01c['addTeams'](_0x530bbc,{'transaction':_0x52d75b})[_0xced5('0x2a')](function(){return BPromise[_0xced5('0x79')](_0x573eb6,function(_0x52d165){return db[_0xced5('0x7a')][_0xced5('0x7b')]({'TeamId':_0x52d165['id'],'VoiceQueueId':_0x40f724[_0xced5('0x54')]['id'],'penalty':_0x52d165[_0xced5('0x76')]},{'transaction':_0x52d75b});});})['then'](function(){return BPromise['each'](_0x575456,function(_0x1fb030){return db[_0xced5('0x7c')][_0xced5('0x7d')]({'where':{'UserId':_0x1fb030['id'],'VoiceQueueId':_0x40f724['params']['id']},'defaults':{'penalty':_0x1fb030[_0xced5('0x76')]},'transaction':_0x52d75b});});})['then'](function(){return BPromise[_0xced5('0x79')](_[_0xced5('0x30')](_0x575456,{'online':!![]}),function(_0x1ea70b){return db[_0xced5('0x7e')][_0xced5('0x7b')]({'membername':_0x1ea70b['name'],'UserId':_0x1ea70b['id'],'queue_name':_0x2aa01c[_0xced5('0x34')],'VoiceQueueId':_0x2aa01c['id'],'interface':_[_0xced5('0x7f')](_0x1ea70b[_0xced5('0x73')])?util[_0xced5('0x80')]('SIP/%s',_0x1ea70b['name']):_0x1ea70b[_0xced5('0x73')],'paused':_0x1ea70b[_0xced5('0x81')]||![],'penalty':_0x1ea70b[_0xced5('0x76')]},{'transaction':_0x52d75b});});})['then'](function(){_0x575456[_0xced5('0x75')](function(_0x42c06b){socket[_0xced5('0x82')](_0xced5('0x83'),{'UserId':_0x42c06b['id'],'VoiceQueueId':_0x2aa01c['id']});});});});});}})[_0xced5('0x2a')](respondWithStatusCode(_0x5e4e68,null))[_0xced5('0x52')](handleError(_0x5e4e68,null));};exports[_0xced5('0x84')]=function(_0x5cce35,_0x53b436,_0x3c8d00){return db[_0xced5('0x6e')][_0xced5('0x69')]({'where':{'id':_0x5cce35[_0xced5('0x40')][_0xced5('0x85')]},'attributes':['id'],'include':[{'model':db[_0xced5('0x70')],'as':_0xced5('0x71'),'attributes':['id'],'raw':!![]}]})[_0xced5('0x2a')](handleEntityNotFound(_0x53b436,null))[_0xced5('0x2a')](function(_0x5c0cc8){var _0x4fa3a0=_['map'](_0x5c0cc8,'id');var _0x15f48b=[];var _0x2e924f=[];var _0x2c698c=squel[_0xced5('0x86')]();_0x2c698c[_0xced5('0x87')](_0xced5('0x88'))[_0xced5('0x89')]('team_has_voice_queues','tq')[_0xced5('0x8a')](_0xced5('0x8b'),'ut',_0xced5('0x8c'))['where']('VoiceQueueId\x20=\x20?',_0x5cce35[_0xced5('0x54')]['id']);for(var _0x1cc673=0x0;_0x1cc673<_0x5c0cc8['length'];_0x1cc673+=0x1){let _0x4a755d=_0x5c0cc8[_0x1cc673];for(var _0x580ffb=0x0;_0x580ffb<_0x4a755d[_0xced5('0x71')][_0xced5('0x46')];_0x580ffb+=0x1){let _0x3de78a=_0x4a755d[_0xced5('0x71')][_0x580ffb];var _0x4cb9ca=_0x2c698c[_0xced5('0x5e')]();_0x4cb9ca[_0xced5('0x4b')]('ut.UserId\x20=\x20?',_0x3de78a['id']);_0x2e924f[_0xced5('0x8d')](db['sequelize']['query'](_0x4cb9ca['toString'](),{'type':db[_0xced5('0x77')][_0xced5('0x8e')]['SELECT']})[_0xced5('0x2a')](function(_0x2609a1){if(_0x2609a1['length']===0x1){return _0x3de78a['id'];}else{var _0x58d319=_[_0xced5('0x8f')](_[_0xced5('0x3b')](_0x2609a1,'TeamId'),function(_0x1afa96){return _[_0xced5('0x90')](_0x4fa3a0,_0x1afa96);});if(_0x58d319){return _0x3de78a['id'];}}}));}}return BPromise[_0xced5('0x91')](_0x2e924f)[_0xced5('0x2a')](function(_0x4c1e40){_0x15f48b=_(_0x15f48b)[_0xced5('0x92')](_0x4c1e40)[_0xced5('0x93')]()['value']();return db['VoiceQueue'][_0xced5('0x59')]({'where':{'id':_0x5cce35['params']['id']}})[_0xced5('0x2a')](function(_0x20e3ca){return db[_0xced5('0x77')][_0xced5('0x78')](function(_0x335e8d){return _0x20e3ca[_0xced5('0x84')](_0x5cce35['query']['ids'],{'transaction':_0x335e8d})[_0xced5('0x2a')](function(){if(!_[_0xced5('0x94')](_0x15f48b)){return _0x20e3ca[_0xced5('0x95')](_0x15f48b,{'transaction':_0x335e8d})[_0xced5('0x2a')](function(){return db[_0xced5('0x7e')][_0xced5('0x36')]({'where':{'VoiceQueueId':_0x5cce35['params']['id'],'UserId':_0x15f48b},'transaction':_0x335e8d});});}})[_0xced5('0x2a')](function(){_0x15f48b[_0xced5('0x75')](function(_0x1a32a1){socket['emit'](_0xced5('0x96'),{'UserId':_0x1a32a1,'VoiceQueueId':_0x20e3ca['id']});});});});});});})['then'](respondWithStatusCode(_0x53b436,null))['catch'](handleError(_0x53b436,null));};exports['addAgents']=function(_0x14e5db,_0x2ac4d5,_0x30f57b){var _0x298cf8,_0x58522b;return db[_0xced5('0x50')][_0xced5('0x59')]({'where':{'id':_0x14e5db['params']['id']}})['then'](handleEntityNotFound(_0x2ac4d5,null))['then'](function(_0x2690d7){if(_0x2690d7){_0x58522b=_0x2690d7;return _0x2690d7[_0xced5('0x97')](_0x14e5db[_0xced5('0x56')][_0xced5('0x85')],_[_0xced5('0x98')](_0x14e5db[_0xced5('0x56')],[_0xced5('0x85'),'id'])||{})[_0xced5('0x99')](function(_0x475083){for(var _0x28d57b=0x0;_0x28d57b<_0x14e5db['body'][_0xced5('0x85')][_0xced5('0x46')];_0x28d57b+=0x1){socket[_0xced5('0x82')](_0xced5('0x83'),{'UserId':Number(_0x14e5db[_0xced5('0x56')][_0xced5('0x85')][_0x28d57b]),'VoiceQueueId':Number(_0x14e5db[_0xced5('0x54')]['id'])});}return _0x475083;});}})[_0xced5('0x2a')](function(_0x25a584){_0x298cf8=_0x25a584||[];if(_0x58522b){return db['User']['findAll']({'where':{'id':_0x14e5db[_0xced5('0x56')][_0xced5('0x85')]},'attributes':['id',_0xced5('0x34'),_0xced5('0x72'),_0xced5('0x81'),_0xced5('0x73')],'raw':!![]});}})[_0xced5('0x2a')](function(_0x491fb7){if(!_[_0xced5('0x94')](_0x491fb7)){var _0x45a1d1=[];for(var _0x5e4dfe=0x0;_0x5e4dfe<_0x491fb7[_0xced5('0x46')];_0x5e4dfe++){if(_0x491fb7[_0x5e4dfe]['online']){_0x45a1d1['push'](db[_0xced5('0x7e')]['upsert']({'membername':_0x491fb7[_0x5e4dfe][_0xced5('0x34')],'UserId':_0x491fb7[_0x5e4dfe]['id'],'queue_name':_0x58522b[_0xced5('0x34')],'VoiceQueueId':_0x58522b['id'],'interface':_[_0xced5('0x7f')](_0x491fb7[_0x5e4dfe]['interface'])?util[_0xced5('0x80')](_0xced5('0x9a'),_0x491fb7[_0x5e4dfe][_0xced5('0x34')]):_0x491fb7[_0x5e4dfe][_0xced5('0x73')],'paused':_0x491fb7[_0x5e4dfe][_0xced5('0x81')]||![],'penalty':_0x14e5db[_0xced5('0x56')][_0xced5('0x76')]||0x0}));}}return BPromise['all'](_0x45a1d1);}})[_0xced5('0x2a')](function(){return _0x298cf8;})[_0xced5('0x2a')](respondWithResult(_0x2ac4d5,null))[_0xced5('0x52')](handleError(_0x2ac4d5,null));};exports[_0xced5('0x95')]=function(_0x46081c,_0x6d114f,_0x5545fb){return db[_0xced5('0x50')][_0xced5('0x59')]({'where':{'id':_0x46081c['params']['id']}})['then'](handleEntityNotFound(_0x6d114f,null))[_0xced5('0x2a')](function(_0x2a4bf1){if(_0x2a4bf1){return _0x2a4bf1['removeAgents'](_0x46081c['query'][_0xced5('0x85')])[_0xced5('0x2a')](function(){if(_[_0xced5('0x9b')](_0x46081c[_0xced5('0x40')][_0xced5('0x85')])){for(var _0x1bc1e4=0x0;_0x1bc1e4<_0x46081c[_0xced5('0x40')]['ids'][_0xced5('0x46')];_0x1bc1e4+=0x1){socket[_0xced5('0x82')]('userVoiceQueue:remove',{'UserId':Number(_0x46081c[_0xced5('0x40')][_0xced5('0x85')][_0x1bc1e4]),'VoiceQueueId':Number(_0x46081c['params']['id'])});}}else{socket['emit'](_0xced5('0x96'),{'UserId':Number(_0x46081c[_0xced5('0x40')]['ids']),'VoiceQueueId':Number(_0x46081c['params']['id'])});}});}})['then'](function(_0x542f0d){return db['UserVoiceQueueRt'][_0xced5('0x36')]({'where':{'VoiceQueueId':_0x46081c[_0xced5('0x54')]['id'],'UserId':_0x46081c['query'][_0xced5('0x85')]}})[_0xced5('0x2a')](function(){return _0x542f0d;});})['then'](respondWithStatusCode(_0x6d114f,null))[_0xced5('0x52')](handleError(_0x6d114f,null));};exports[_0xced5('0x9c')]=function(_0x40429e,_0x4b3d25,_0x47134b){var _0x121ddc={};var _0x1d7b28={};var _0x2a2eaa;var _0x53d0d8;return db[_0xced5('0x50')]['findOne']({'where':{'id':_0x40429e[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x4b3d25,null))['then'](function(_0x17087c){if(_0x17087c){_0x2a2eaa=_0x17087c;_0x1d7b28[_0xced5('0x3f')]=_[_0xced5('0x41')](db[_0xced5('0x70')][_0xced5('0x3c')]);_0x1d7b28[_0xced5('0x40')]=_[_0xced5('0x41')](_0x40429e[_0xced5('0x40')]);_0x1d7b28[_0xced5('0x42')]=_[_0xced5('0x43')](_0x1d7b28['model'],_0x1d7b28[_0xced5('0x40')]);_0x121ddc[_0xced5('0x44')]=_[_0xced5('0x43')](_0x1d7b28[_0xced5('0x3f')],qs[_0xced5('0x45')](_0x40429e['query']['fields']));_0x121ddc[_0xced5('0x44')]=_0x121ddc[_0xced5('0x44')][_0xced5('0x46')]?_0x121ddc[_0xced5('0x44')]:_0x1d7b28[_0xced5('0x3f')];_0x121ddc['order']=qs[_0xced5('0x49')](_0x40429e[_0xced5('0x40')]['sort']);_0x121ddc[_0xced5('0x4b')]=qs['filters'](_[_0xced5('0x4a')](_0x40429e[_0xced5('0x40')],_0x1d7b28[_0xced5('0x42')]));if(_0x40429e['query']['filter']){_0x121ddc[_0xced5('0x4b')]=_[_0xced5('0x4c')](_0x121ddc['where'],{'$or':_[_0xced5('0x3b')](_0x121ddc['attributes'],function(_0x2a1eb6){var _0x59c5cf={};_0x59c5cf[_0x2a1eb6]={'$like':'%'+_0x40429e['query'][_0xced5('0x30')]+'%'};return _0x59c5cf;})});}_0x121ddc=_[_0xced5('0x4c')]({},_0x121ddc,_0x40429e[_0xced5('0x5f')]);return _0x2a2eaa['getAgents'](_0x121ddc);}})[_0xced5('0x2a')](function(_0x206050){if(_0x206050){_0x53d0d8=_0x206050['length'];if(!_0x40429e[_0xced5('0x40')][_0xced5('0x66')](_0xced5('0x47'))){_0x121ddc['limit']=qs[_0xced5('0x22')](_0x40429e[_0xced5('0x40')]['limit']);_0x121ddc[_0xced5('0x21')]=qs[_0xced5('0x21')](_0x40429e[_0xced5('0x40')][_0xced5('0x21')]);}return _0x2a2eaa[_0xced5('0x9c')](_0x121ddc);}})[_0xced5('0x2a')](function(_0x211b7a){if(_0x211b7a){return _0x211b7a?{'count':_0x53d0d8,'rows':_0x211b7a}:null;}})[_0xced5('0x2a')](respondWithResult(_0x4b3d25,null))[_0xced5('0x52')](handleError(_0x4b3d25,null));};exports[_0xced5('0x9d')]=function(_0x435e14,_0x191fcb,_0x5487f4){var _0x47caa3={};var _0x1a2ab5={};var _0x28afb0;var _0x2b02f3;return db[_0xced5('0x50')][_0xced5('0x64')]({'where':{'id':_0x435e14[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x191fcb,null))[_0xced5('0x2a')](function(_0x18c67e){if(_0x18c67e){_0x28afb0=_0x18c67e;_0x1a2ab5[_0xced5('0x3f')]=_[_0xced5('0x41')](db['UserVoiceQueueRt'][_0xced5('0x3c')]);_0x1a2ab5['query']=_[_0xced5('0x41')](_0x435e14[_0xced5('0x40')]);_0x1a2ab5[_0xced5('0x42')]=_[_0xced5('0x43')](_0x1a2ab5[_0xced5('0x3f')],_0x1a2ab5['query']);_0x47caa3[_0xced5('0x44')]=_[_0xced5('0x43')](_0x1a2ab5[_0xced5('0x3f')],qs['fields'](_0x435e14[_0xced5('0x40')][_0xced5('0x45')]));_0x47caa3[_0xced5('0x44')]=_0x47caa3['attributes']['length']?_0x47caa3[_0xced5('0x44')]:_0x1a2ab5[_0xced5('0x3f')];_0x47caa3[_0xced5('0x48')]=qs[_0xced5('0x49')](_0x435e14['query'][_0xced5('0x49')]);_0x47caa3['where']=qs[_0xced5('0x42')](_['pick'](_0x435e14[_0xced5('0x40')],_0x1a2ab5[_0xced5('0x42')]));if(_0x435e14[_0xced5('0x40')][_0xced5('0x30')]){_0x47caa3[_0xced5('0x4b')]=_['merge'](_0x47caa3[_0xced5('0x4b')],{'$or':_[_0xced5('0x3b')](_0x47caa3[_0xced5('0x44')],function(_0x56d82b){var _0x56b4f2={};_0x56b4f2[_0x56d82b]={'$like':'%'+_0x435e14[_0xced5('0x40')][_0xced5('0x30')]+'%'};return _0x56b4f2;})});}_0x47caa3=_[_0xced5('0x4c')]({},_0x47caa3,_0x435e14['options']);return _0x28afb0[_0xced5('0x9d')](_0x47caa3);}})[_0xced5('0x2a')](function(_0x21d5d2){if(_0x21d5d2){_0x2b02f3=_0x21d5d2[_0xced5('0x46')];if(!_0x435e14[_0xced5('0x40')][_0xced5('0x66')](_0xced5('0x47'))){_0x47caa3[_0xced5('0x22')]=qs[_0xced5('0x22')](_0x435e14['query']['limit']);_0x47caa3[_0xced5('0x21')]=qs['offset'](_0x435e14[_0xced5('0x40')][_0xced5('0x21')]);}return _0x28afb0[_0xced5('0x9d')](_0x47caa3);}})[_0xced5('0x2a')](function(_0x15395e){return _0x15395e?{'count':_0x2b02f3,'rows':_0x15395e}:null;})[_0xced5('0x2a')](respondWithResult(_0x191fcb,null))[_0xced5('0x52')](handleError(_0x191fcb,null));};exports['getLists']=function(_0x319be2,_0x2a3438,_0x527753){var _0x251991={};var _0x4650da={};var _0x4a5fcb;var _0xbc24ca;return db[_0xced5('0x50')][_0xced5('0x64')]({'where':{'id':_0x319be2['params']['id']}})['then'](handleEntityNotFound(_0x2a3438,null))[_0xced5('0x2a')](function(_0x340608){if(_0x340608){_0x4a5fcb=_0x340608;_0x4650da[_0xced5('0x3f')]=_['keys'](db[_0xced5('0x9e')]['rawAttributes']);_0x4650da[_0xced5('0x40')]=_[_0xced5('0x41')](_0x319be2[_0xced5('0x40')]);_0x4650da[_0xced5('0x42')]=_['intersection'](_0x4650da['model'],_0x4650da[_0xced5('0x40')]);_0x251991[_0xced5('0x44')]=_[_0xced5('0x43')](_0x4650da['model'],qs[_0xced5('0x45')](_0x319be2[_0xced5('0x40')][_0xced5('0x45')]));_0x251991[_0xced5('0x44')]=_0x251991[_0xced5('0x44')][_0xced5('0x46')]?_0x251991[_0xced5('0x44')]:_0x4650da[_0xced5('0x3f')];_0x251991[_0xced5('0x48')]=qs[_0xced5('0x49')](_0x319be2[_0xced5('0x40')][_0xced5('0x49')]);_0x251991[_0xced5('0x4b')]=qs[_0xced5('0x42')](_[_0xced5('0x4a')](_0x319be2[_0xced5('0x40')],_0x4650da['filters']));if(_0x319be2[_0xced5('0x40')]['filter']){_0x251991[_0xced5('0x4b')]=_[_0xced5('0x4c')](_0x251991[_0xced5('0x4b')],{'$or':_['map'](_0x251991[_0xced5('0x44')],function(_0xa93acf){var _0x126cf0={};_0x126cf0[_0xa93acf]={'$like':'%'+_0x319be2[_0xced5('0x40')][_0xced5('0x30')]+'%'};return _0x126cf0;})});}_0x251991=_[_0xced5('0x4c')]({},_0x251991,_0x319be2[_0xced5('0x5f')]);return _0x4a5fcb['getLists'](_0x251991);}})[_0xced5('0x2a')](function(_0x1a185b){if(_0x1a185b){_0xbc24ca=_0x1a185b[_0xced5('0x46')];if(!_0x319be2['query'][_0xced5('0x66')](_0xced5('0x47'))){_0x251991[_0xced5('0x22')]=qs[_0xced5('0x22')](_0x319be2[_0xced5('0x40')][_0xced5('0x22')]);_0x251991[_0xced5('0x21')]=qs['offset'](_0x319be2[_0xced5('0x40')]['offset']);}return _0x4a5fcb[_0xced5('0x9f')](_0x251991);}})[_0xced5('0x2a')](function(_0x18ff11){if(_0x18ff11){return _0x18ff11?{'count':_0xbc24ca,'rows':_0x18ff11}:null;}})['then'](respondWithResult(_0x2a3438,null))[_0xced5('0x52')](handleError(_0x2a3438,null));};exports[_0xced5('0xa0')]=function(_0x2b4903,_0x539393,_0x26e288){var _0x45dd46=moment()[_0xced5('0x80')]('YYYY-MM-DD\x20HH:mm:ss');var _0xab1896,_0x31da3c;return db['VoiceQueue'][_0xced5('0x59')]({'where':{'id':_0x2b4903[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x539393,null))[_0xced5('0x2a')](function(_0x165f87){if(_0x165f87){_0x31da3c=_0x165f87;return _0x165f87[_0xced5('0xa0')](_0x2b4903[_0xced5('0x56')]['ids'],_['omit'](_0x2b4903[_0xced5('0x56')],[_0xced5('0x85'),'id'])||{});}return null;})['spread'](function(_0x835dbb){var _0x15f489;_0xab1896=_0x835dbb||[];var _0x2e2e46=[];if(_0x835dbb){for(var _0x15ba88=0x0;_0x15ba88<_0x835dbb['length'];_0x15ba88+=0x1){var _0x1dea62=_0x835dbb[_0x15ba88][_0xced5('0x2b')]({'plain':!![]});_0x31da3c[_0xced5('0xa1')]=_0x2b4903[_0xced5('0x56')][_0xced5('0xa1')]?_0x2b4903[_0xced5('0x56')][_0xced5('0xa1')]:_0x31da3c[_0xced5('0xa1')];switch(_0x31da3c[_0xced5('0xa1')]){case _0xced5('0xa2'):_0x15f489=squel[_0xced5('0xa3')]()[_0xced5('0xa4')](_0xced5('0xa5'))[_0xced5('0xa6')](['phone',_0xced5('0xa7'),'ContactId',_0xced5('0xa8'),_0xced5('0x67'),'createdAt',_0xced5('0x61')],squel['select']()[_0xced5('0x87')](_0xced5('0xa9'),_0xced5('0xa9'))['field']('\x27'+_0x45dd46+'\x27',_0xced5('0xa7'))[_0xced5('0x87')]('id','ContactId')[_0xced5('0x87')](_0x1dea62[_0xced5('0xaa')][_0xced5('0xab')](),_0xced5('0xa8'))[_0xced5('0x87')](_0x2b4903['params']['id'][_0xced5('0xab')](),_0xced5('0x67'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27',_0xced5('0x60'))['field']('\x27'+_0x45dd46+'\x27',_0xced5('0x61'))[_0xced5('0x89')](_0xced5('0xac'))[_0xced5('0x4b')](_0xced5('0xad'))[_0xced5('0x4b')]('ListId\x20=\x20?',_0x1dea62[_0xced5('0xaa')]['toString']())[_0xced5('0x4b')](_0xced5('0xae'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xced5('0x86')]()[_0xced5('0x87')](_0xced5('0xaf'))[_0xced5('0x89')](_0xced5('0xb0'))['where'](_0xced5('0xb1'),_0x2b4903[_0xced5('0x54')]['id'][_0xced5('0xab')]()))['where'](_0xced5('0xb2'),squel[_0xced5('0x86')]()[_0xced5('0x87')](_0xced5('0xb3'))[_0xced5('0x89')](_0xced5('0xa5'))['where'](_0xced5('0xb1'),_0x2b4903[_0xced5('0x54')]['id'][_0xced5('0xab')]())))['toString']();break;case _0xced5('0xb4'):_0x15f489=squel[_0xced5('0xa3')]()[_0xced5('0xa4')]('cm_hopper')['fromQuery']([_0xced5('0xa9'),_0xced5('0xa7'),_0xced5('0xb5'),_0xced5('0xa8'),'VoiceQueueId','createdAt',_0xced5('0x61')],squel[_0xced5('0x86')]()[_0xced5('0x87')](_0xced5('0xa9'),_0xced5('0xa9'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27',_0xced5('0xa7'))[_0xced5('0x87')]('id',_0xced5('0xb5'))['field'](_0x1dea62['CmListId']['toString'](),'ListId')[_0xced5('0x87')](_0x2b4903[_0xced5('0x54')]['id'][_0xced5('0xab')](),_0xced5('0x67'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27',_0xced5('0x60'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27',_0xced5('0x61'))[_0xced5('0x89')]('cm_contacts')['where'](_0xced5('0xad'))[_0xced5('0x4b')](_0xced5('0xb6'),_0x1dea62[_0xced5('0xaa')][_0xced5('0xab')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xced5('0x4b')](_0xced5('0xb2'),squel[_0xced5('0x86')]()['field']('COALESCE(phone,\x27\x27)')[_0xced5('0x89')](_0xced5('0xa5'))[_0xced5('0x4b')](_0xced5('0xb1'),_0x2b4903[_0xced5('0x54')]['id'][_0xced5('0xab')]())))['toString']();break;default:_0x15f489=squel[_0xced5('0xa3')]()['into'](_0xced5('0xa5'))[_0xced5('0xa6')]([_0xced5('0xa9'),'scheduledAt','ContactId',_0xced5('0xa8'),'VoiceQueueId',_0xced5('0x60'),_0xced5('0x61')],squel[_0xced5('0x86')]()[_0xced5('0x87')](_0xced5('0xa9'),_0xced5('0xa9'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27',_0xced5('0xa7'))[_0xced5('0x87')]('id',_0xced5('0xb5'))[_0xced5('0x87')](_0x1dea62[_0xced5('0xaa')][_0xced5('0xab')](),_0xced5('0xa8'))['field'](_0x2b4903['params']['id'][_0xced5('0xab')](),_0xced5('0x67'))['field']('\x27'+_0x45dd46+'\x27',_0xced5('0x60'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27','updatedAt')[_0xced5('0x89')]('cm_contacts')[_0xced5('0x4b')](_0xced5('0xad'))[_0xced5('0x4b')](_0xced5('0xb6'),_0x1dea62['CmListId'][_0xced5('0xab')]())['where'](_0xced5('0xae')))[_0xced5('0xab')]();}_0x2e2e46[_0xced5('0x8d')](db[_0xced5('0x77')][_0xced5('0x40')](_0x15f489));}return BPromise[_0xced5('0x91')](_0x2e2e46);}})['then'](function(){var _0x1799ce=[];var _0x4b1af1=squel['insert']()[_0xced5('0xa4')](_0xced5('0xb7'))[_0xced5('0xa6')]([_0xced5('0xb8'),_0xced5('0xa9'),_0xced5('0xb9'),_0xced5('0x60'),'updatedAt'],squel[_0xced5('0x86')]()['field'](_0xced5('0xba'))[_0xced5('0x87')]('ci.item')[_0xced5('0x87')](_0xced5('0xbb'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27',_0xced5('0x60'))[_0xced5('0x87')]('\x27'+_0x45dd46+'\x27',_0xced5('0x61'))[_0xced5('0x89')](_0xced5('0xbc'),'ci')['join']('cm_hopper','h',_0xced5('0xbd'))[_0xced5('0x4b')](_0xced5('0xbe'),_0x45dd46)[_0xced5('0x4b')](_0xced5('0xbf'),_0xced5('0xc0')))['toString']();_0x1799ce[_0xced5('0x8d')](db[_0xced5('0x77')][_0xced5('0x40')](_0x4b1af1));return BPromise[_0xced5('0x91')](_0x1799ce);})[_0xced5('0x2a')](function(){return _0xab1896;})[_0xced5('0x2a')](respondWithResult(_0x539393,null))[_0xced5('0x52')](handleError(_0x539393,null));};exports['removeLists']=function(_0x460edc,_0x2b5b8b,_0x1dbbd5){return db[_0xced5('0x50')][_0xced5('0x59')]({'where':{'id':_0x460edc['params']['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x2b5b8b,null))[_0xced5('0x2a')](function(_0x3b306b){if(_0x3b306b){return _0x3b306b[_0xced5('0xc1')](_0x460edc[_0xced5('0x40')]['ids']);}})[_0xced5('0x2a')](function(_0x455fb9){if(_0x455fb9){return db[_0xced5('0x65')]['destroy']({'where':{'ListId':_0x460edc['query'][_0xced5('0x85')],'VoiceQueueId':_0x460edc[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](function(){return _0x455fb9;});}})[_0xced5('0x2a')](respondWithStatusCode(_0x2b5b8b,null))[_0xced5('0x52')](handleError(_0x2b5b8b,null));};exports['getBlackLists']=function(_0x422629,_0x2ae75c,_0xdd023d){var _0x471af0={};var _0x2c82c6={};var _0xa03e29;var _0x207cfc;return db[_0xced5('0x50')][_0xced5('0x64')]({'where':{'id':_0x422629[_0xced5('0x54')]['id']}})['then'](handleEntityNotFound(_0x2ae75c,null))[_0xced5('0x2a')](function(_0x2e9c49){if(_0x2e9c49){_0xa03e29=_0x2e9c49;_0x2c82c6['model']=_[_0xced5('0x41')](db[_0xced5('0x9e')][_0xced5('0x3c')]);_0x2c82c6[_0xced5('0x40')]=_[_0xced5('0x41')](_0x422629[_0xced5('0x40')]);_0x2c82c6['filters']=_[_0xced5('0x43')](_0x2c82c6[_0xced5('0x3f')],_0x2c82c6[_0xced5('0x40')]);_0x471af0[_0xced5('0x44')]=_[_0xced5('0x43')](_0x2c82c6[_0xced5('0x3f')],qs['fields'](_0x422629[_0xced5('0x40')]['fields']));_0x471af0[_0xced5('0x44')]=_0x471af0[_0xced5('0x44')][_0xced5('0x46')]?_0x471af0[_0xced5('0x44')]:_0x2c82c6[_0xced5('0x3f')];_0x471af0[_0xced5('0x48')]=qs[_0xced5('0x49')](_0x422629['query'][_0xced5('0x49')]);_0x471af0['where']=qs[_0xced5('0x42')](_[_0xced5('0x4a')](_0x422629['query'],_0x2c82c6[_0xced5('0x42')]));if(_0x422629['query'][_0xced5('0x30')]){_0x471af0[_0xced5('0x4b')]=_[_0xced5('0x4c')](_0x471af0['where'],{'$or':_['map'](_0x471af0[_0xced5('0x44')],function(_0x5d0b72){var _0x109cbd={};_0x109cbd[_0x5d0b72]={'$like':'%'+_0x422629[_0xced5('0x40')][_0xced5('0x30')]+'%'};return _0x109cbd;})});}_0x471af0=_[_0xced5('0x4c')]({},_0x471af0,_0x422629[_0xced5('0x5f')]);return _0xa03e29[_0xced5('0xc2')](_0x471af0);}})[_0xced5('0x2a')](function(_0x4be1c5){if(_0x4be1c5){_0x207cfc=_0x4be1c5[_0xced5('0x46')];if(!_0x422629[_0xced5('0x40')][_0xced5('0x66')](_0xced5('0x47'))){_0x471af0[_0xced5('0x22')]=qs['limit'](_0x422629[_0xced5('0x40')][_0xced5('0x22')]);_0x471af0[_0xced5('0x21')]=qs[_0xced5('0x21')](_0x422629[_0xced5('0x40')]['offset']);}return _0xa03e29[_0xced5('0xc2')](_0x471af0);}})[_0xced5('0x2a')](function(_0x2b5cf7){if(_0x2b5cf7){return _0x2b5cf7?{'count':_0x207cfc,'rows':_0x2b5cf7}:null;}})[_0xced5('0x2a')](respondWithResult(_0x2ae75c,null))[_0xced5('0x52')](handleError(_0x2ae75c,null));};exports[_0xced5('0xc3')]=function(_0x5e07ef,_0x261063,_0xe68a26){var _0x3600c2,_0x515afc;return db['VoiceQueue'][_0xced5('0x59')]({'where':{'id':_0x5e07ef[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x261063,null))[_0xced5('0x2a')](function(_0x215df1){if(_0x215df1){_0x515afc=_0x215df1;return _0x215df1[_0xced5('0xc3')](_0x5e07ef[_0xced5('0x56')][_0xced5('0x85')],_[_0xced5('0x98')](_0x5e07ef[_0xced5('0x56')],['ids','id'])||{});}return null;})[_0xced5('0x99')](function(_0x25277f){var _0x30e0fc;_0x3600c2=_0x25277f||[];var _0x269438=[];if(_0x25277f){for(var _0x5191c4=0x0;_0x5191c4<_0x25277f[_0xced5('0x46')];_0x5191c4+=0x1){var _0xc86886=_0x25277f[_0x5191c4][_0xced5('0x2b')]({'plain':!![]});_0x30e0fc=squel[_0xced5('0xa3')]()[_0xced5('0xa4')](_0xced5('0xc4'))[_0xced5('0xa6')]([_0xced5('0xa9'),_0xced5('0xb5'),_0xced5('0xa8'),_0xced5('0x67'),_0xced5('0x60'),_0xced5('0x61')],squel['select']()[_0xced5('0x87')](_0xced5('0xa9'),_0xced5('0xa9'))['field']('id','ContactId')['field'](_0xc86886[_0xced5('0xaa')][_0xced5('0xab')](),_0xced5('0xa8'))[_0xced5('0x87')](_0x5e07ef['params']['id'][_0xced5('0xab')](),_0xced5('0x67'))[_0xced5('0x87')]('NOW()',_0xced5('0x60'))['field'](_0xced5('0xc5'),'updatedAt')[_0xced5('0x89')](_0xced5('0xac'))[_0xced5('0x4b')]('deletedAt\x20IS\x20NULL')[_0xced5('0x4b')]('ListId\x20=\x20?',_0xc86886['CmListId'][_0xced5('0xab')]())[_0xced5('0x4b')](_0xced5('0xae')))[_0xced5('0xab')]();_0x269438[_0xced5('0x8d')](db['sequelize'][_0xced5('0x40')](_0x30e0fc));}return BPromise['all'](_0x269438);}})[_0xced5('0x2a')](function(){return _0x3600c2;})['then'](respondWithResult(_0x261063,null))['catch'](handleError(_0x261063,null));};exports[_0xced5('0xc6')]=function(_0x586f18,_0x1451dc,_0x2cb10d){return db[_0xced5('0x50')][_0xced5('0x59')]({'where':{'id':_0x586f18[_0xced5('0x54')]['id']}})[_0xced5('0x2a')](handleEntityNotFound(_0x1451dc,null))[_0xced5('0x2a')](function(_0x441118){if(_0x441118){return _0x441118[_0xced5('0xc6')](_0x586f18[_0xced5('0x40')][_0xced5('0x85')]);}})[_0xced5('0x2a')](function(_0x2b2da8){if(_0x2b2da8){return db[_0xced5('0x6c')][_0xced5('0x36')]({'where':{'ListId':_0x586f18['query']['ids'],'VoiceQueueId':_0x586f18['params']['id']}})[_0xced5('0x2a')](function(){return _0x2b2da8;});}})['then'](respondWithStatusCode(_0x1451dc,null))[_0xced5('0x52')](handleError(_0x1451dc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b054179..6456487 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 _0xea5f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','update','remove'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xea5f,0x100));var _0xfea5=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xea5f[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xfea5('0x0'));var VoiceQueue=require(_0xfea5('0x1'))['db'][_0xfea5('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfea5('0x3'),'afterDestroy':_0xfea5('0x4')};function emitEvent(_0x101fab){return function(_0x5b7de8,_0x6db69c,_0x562fc8){VoiceQueueEvents[_0xfea5('0x5')](_0x101fab+':'+_0x5b7de8['id'],_0x5b7de8);VoiceQueueEvents[_0xfea5('0x5')](_0x101fab,_0x5b7de8);_0x562fc8(null);};}for(var e in events){if(events[_0xfea5('0x6')](e)){var event=events[e];VoiceQueue[_0xfea5('0x7')](e,emitEvent(event));}}module[_0xfea5('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x7868=['emit','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7868,0x93));var _0x8786=function(_0x6bc362,_0x56182e){_0x6bc362=_0x6bc362-0x0;var _0x2db519=_0x7868[_0x6bc362];return _0x2db519;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x8786('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8786('0x1')](0x0);var events={'afterCreate':_0x8786('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1a7432){return function(_0x31bfe2,_0x5e12a1,_0x31f99e){VoiceQueueEvents[_0x8786('0x3')](_0x1a7432+':'+_0x31bfe2['id'],_0x31bfe2);VoiceQueueEvents[_0x8786('0x3')](_0x1a7432,_0x31bfe2);_0x31f99e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x8786('0x4')](e,emitEvent(event));}}module[_0x8786('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 7583a84..c4db9b4 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x21fd29,_0x3887a3){var _0x364d4e=function(_0x49fcbc){while(--_0x49fcbc){_0x21fd29['push'](_0x21fd29['shift']());}};_0x364d4e(++_0x3887a3);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0x008c,0x188));var _0xc008=function(_0x4c2cda,_0x5945b0){_0x4c2cda=_0x4c2cda-0x0;var _0x59c47d=_0x008c[_0x4c2cda];return _0x59c47d;};'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')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'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 9103e2b..f4a870a 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 _0x66e4=['VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','result','catch','VoiceQueue','findAll','options','raw','limit','map','attributes','include','model','GetVoiceQueue','ShowVoiceQueue','find','where','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','then','request\x20sent','debug'];(function(_0x2ad6e4,_0x544768){var _0x20006c=function(_0x3543f1){while(--_0x3543f1){_0x2ad6e4['push'](_0x2ad6e4['shift']());}};_0x20006c(++_0x544768);}(_0x66e4,0x12d));var _0x466e=function(_0x22e645,_0x47c117){_0x22e645=_0x22e645-0x0;var _0x242f12=_0x66e4[_0x22e645];return _0x242f12;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x466e('0x0'));var BPromise=require(_0x466e('0x1'));var rs=require(_0x466e('0x2'));var fs=require('fs');var Redis=require(_0x466e('0x3'));var db=require(_0x466e('0x4'))['db'];var utils=require(_0x466e('0x5'));var logger=require('../../config/logger')(_0x466e('0x6'));var config=require(_0x466e('0x7'));var jayson=require(_0x466e('0x8'));var client=jayson[_0x466e('0x9')][_0x466e('0xa')]({'port':0x232a});config[_0x466e('0xb')]=_[_0x466e('0xc')](config[_0x466e('0xb')],{'host':_0x466e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x466e('0xb')]));require(_0x466e('0xe'))[_0x466e('0xf')](socket);function respondWithRpcPromise(_0x3f33f4,_0x305548,_0x37db2c){return new BPromise(function(_0x320309,_0x34c2e3){return client['request'](_0x3f33f4,_0x37db2c)[_0x466e('0x10')](function(_0x16b368){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x305548,_0x466e('0x11'));logger[_0x466e('0x12')](_0x466e('0x13'),_0x305548,_0x466e('0x11'),JSON[_0x466e('0x14')](_0x16b368));if(_0x16b368[_0x466e('0x15')]){if(_0x16b368[_0x466e('0x15')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x305548,_0x16b368[_0x466e('0x15')][_0x466e('0x16')]);return _0x34c2e3(_0x16b368['error'][_0x466e('0x16')]);}logger[_0x466e('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x305548,_0x16b368['error'][_0x466e('0x16')]);return _0x320309(_0x16b368[_0x466e('0x15')][_0x466e('0x16')]);}else{logger['info'](_0x466e('0x17'),_0x305548,'request\x20sent');_0x320309(_0x16b368[_0x466e('0x18')][_0x466e('0x16')]);}})[_0x466e('0x19')](function(_0x312592){logger[_0x466e('0x15')](_0x466e('0x17'),_0x305548,_0x312592);_0x34c2e3(_0x312592);});});}exports['GetVoiceQueue']=function(_0x4caed6){var _0x3fc3af=this;return new Promise(function(_0x131b9c,_0x122c51){return db[_0x466e('0x1a')][_0x466e('0x1b')]({'raw':_0x4caed6[_0x466e('0x1c')]?_0x4caed6[_0x466e('0x1c')][_0x466e('0x1d')]===undefined?!![]:![]:!![],'where':_0x4caed6[_0x466e('0x1c')]?_0x4caed6[_0x466e('0x1c')]['where']||null:null,'attributes':_0x4caed6['options']?_0x4caed6[_0x466e('0x1c')]['attributes']||null:null,'limit':_0x4caed6[_0x466e('0x1c')]?_0x4caed6[_0x466e('0x1c')][_0x466e('0x1e')]||null:null,'include':_0x4caed6['options']?_0x4caed6['options']['include']?_[_0x466e('0x1f')](_0x4caed6[_0x466e('0x1c')]['include'],function(_0x4aeb8f){return{'model':db[_0x4aeb8f['model']],'as':_0x4aeb8f['as'],'attributes':_0x4aeb8f[_0x466e('0x20')],'include':_0x4aeb8f['include']?_['map'](_0x4aeb8f[_0x466e('0x21')],function(_0x33344c){return{'model':db[_0x33344c[_0x466e('0x22')]],'as':_0x33344c['as'],'attributes':_0x33344c['attributes'],'include':_0x33344c['include']?_[_0x466e('0x1f')](_0x33344c[_0x466e('0x21')],function(_0x19c3f9){return{'model':db[_0x19c3f9[_0x466e('0x22')]],'as':_0x19c3f9['as'],'attributes':_0x19c3f9[_0x466e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49ed62){logger['info'](_0x466e('0x23'),_0x4caed6);logger[_0x466e('0x12')](_0x466e('0x23'),_0x4caed6,JSON[_0x466e('0x14')](_0x49ed62));_0x131b9c(_0x49ed62);})[_0x466e('0x19')](function(_0x418634){logger['error']('GetVoiceQueue',_0x418634[_0x466e('0x16')],_0x4caed6);_0x122c51(_0x3fc3af[_0x466e('0x15')](0x1f4,_0x418634[_0x466e('0x16')]));});});};exports[_0x466e('0x24')]=function(_0x384e00){var _0x3f7ed2=this;return new Promise(function(_0x316b18,_0xeaf69){return db[_0x466e('0x1a')][_0x466e('0x25')]({'raw':_0x384e00['options']?_0x384e00[_0x466e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x384e00['options']?_0x384e00['options'][_0x466e('0x26')]||null:null,'attributes':_0x384e00[_0x466e('0x1c')]?_0x384e00[_0x466e('0x1c')][_0x466e('0x20')]||null:null,'include':_0x384e00[_0x466e('0x1c')]?_0x384e00[_0x466e('0x1c')][_0x466e('0x21')]?_[_0x466e('0x1f')](_0x384e00[_0x466e('0x1c')]['include'],function(_0x5f51fb){return{'model':db[_0x5f51fb[_0x466e('0x22')]],'as':_0x5f51fb['as'],'attributes':_0x5f51fb[_0x466e('0x20')],'include':_0x5f51fb[_0x466e('0x21')]?_[_0x466e('0x1f')](_0x5f51fb[_0x466e('0x21')],function(_0x380188){return{'model':db[_0x380188['model']],'as':_0x380188['as'],'attributes':_0x380188[_0x466e('0x20')],'include':_0x380188[_0x466e('0x21')]?_['map'](_0x380188['include'],function(_0x2091ca){return{'model':db[_0x2091ca['model']],'as':_0x2091ca['as'],'attributes':_0x2091ca['attributes']};}):[]};}):[]};}):[]:[]})[_0x466e('0x10')](function(_0xc414f5){logger[_0x466e('0x27')](_0x466e('0x24'),_0x384e00);logger[_0x466e('0x12')](_0x466e('0x24'),_0x384e00,JSON['stringify'](_0xc414f5));_0x316b18(_0xc414f5);})[_0x466e('0x19')](function(_0x32074c){logger['error'](_0x466e('0x24'),_0x32074c['message'],_0x384e00);_0xeaf69(_0x3f7ed2[_0x466e('0x15')](0x1f4,_0x32074c[_0x466e('0x16')]));});});}; \ No newline at end of file +var _0xbf2e=['findAll','options','raw','attributes','limit','map','include','model','ShowVoiceQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue'];(function(_0x4e40e4,_0xe34b01){var _0x33870c=function(_0x2aed03){while(--_0x2aed03){_0x4e40e4['push'](_0x4e40e4['shift']());}};_0x33870c(++_0xe34b01);}(_0xbf2e,0x172));var _0xebf2=function(_0x3c0fe6,_0x22a768){_0x3c0fe6=_0x3c0fe6-0x0;var _0x9cb132=_0xbf2e[_0x3c0fe6];return _0x9cb132;};'use strict';var _=require(_0xebf2('0x0'));var util=require(_0xebf2('0x1'));var moment=require(_0xebf2('0x2'));var BPromise=require('bluebird');var rs=require(_0xebf2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebf2('0x4'))['db'];var utils=require(_0xebf2('0x5'));var logger=require(_0xebf2('0x6'))(_0xebf2('0x7'));var config=require(_0xebf2('0x8'));var jayson=require(_0xebf2('0x9'));var client=jayson[_0xebf2('0xa')][_0xebf2('0xb')]({'port':0x232a});config[_0xebf2('0xc')]=_[_0xebf2('0xd')](config[_0xebf2('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebf2('0xc')]));require(_0xebf2('0xe'))['register'](socket);function respondWithRpcPromise(_0x31f18d,_0x2619c3,_0x4a7b35){return new BPromise(function(_0x249208,_0x363634){return client[_0xebf2('0xf')](_0x31f18d,_0x4a7b35)[_0xebf2('0x10')](function(_0x1c3687){logger[_0xebf2('0x11')](_0xebf2('0x12'),_0x2619c3,_0xebf2('0x13'));logger[_0xebf2('0x14')](_0xebf2('0x15'),_0x2619c3,_0xebf2('0x13'),JSON[_0xebf2('0x16')](_0x1c3687));if(_0x1c3687[_0xebf2('0x17')]){if(_0x1c3687['error'][_0xebf2('0x18')]===0x1f4){logger[_0xebf2('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x2619c3,_0x1c3687[_0xebf2('0x17')][_0xebf2('0x19')]);return _0x363634(_0x1c3687[_0xebf2('0x17')][_0xebf2('0x19')]);}logger['error'](_0xebf2('0x12'),_0x2619c3,_0x1c3687[_0xebf2('0x17')][_0xebf2('0x19')]);return _0x249208(_0x1c3687[_0xebf2('0x17')][_0xebf2('0x19')]);}else{logger['info'](_0xebf2('0x12'),_0x2619c3,_0xebf2('0x13'));_0x249208(_0x1c3687[_0xebf2('0x1a')][_0xebf2('0x19')]);}})[_0xebf2('0x1b')](function(_0x16daf4){logger[_0xebf2('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x2619c3,_0x16daf4);_0x363634(_0x16daf4);});});}exports[_0xebf2('0x1c')]=function(_0x607823){var _0x4ecc30=this;return new Promise(function(_0x4ed98a,_0x3d781b){return db[_0xebf2('0x1d')][_0xebf2('0x1e')]({'raw':_0x607823[_0xebf2('0x1f')]?_0x607823[_0xebf2('0x1f')][_0xebf2('0x20')]===undefined?!![]:![]:!![],'where':_0x607823[_0xebf2('0x1f')]?_0x607823[_0xebf2('0x1f')]['where']||null:null,'attributes':_0x607823[_0xebf2('0x1f')]?_0x607823[_0xebf2('0x1f')][_0xebf2('0x21')]||null:null,'limit':_0x607823[_0xebf2('0x1f')]?_0x607823[_0xebf2('0x1f')][_0xebf2('0x22')]||null:null,'include':_0x607823[_0xebf2('0x1f')]?_0x607823[_0xebf2('0x1f')]['include']?_[_0xebf2('0x23')](_0x607823[_0xebf2('0x1f')][_0xebf2('0x24')],function(_0x3d4e18){return{'model':db[_0x3d4e18[_0xebf2('0x25')]],'as':_0x3d4e18['as'],'attributes':_0x3d4e18[_0xebf2('0x21')],'include':_0x3d4e18['include']?_[_0xebf2('0x23')](_0x3d4e18[_0xebf2('0x24')],function(_0x52d610){return{'model':db[_0x52d610[_0xebf2('0x25')]],'as':_0x52d610['as'],'attributes':_0x52d610['attributes'],'include':_0x52d610[_0xebf2('0x24')]?_[_0xebf2('0x23')](_0x52d610[_0xebf2('0x24')],function(_0x169e34){return{'model':db[_0x169e34[_0xebf2('0x25')]],'as':_0x169e34['as'],'attributes':_0x169e34[_0xebf2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xebf2('0x10')](function(_0x11638b){logger[_0xebf2('0x11')](_0xebf2('0x1c'),_0x607823);logger[_0xebf2('0x14')](_0xebf2('0x1c'),_0x607823,JSON['stringify'](_0x11638b));_0x4ed98a(_0x11638b);})['catch'](function(_0x1d93ff){logger['error'](_0xebf2('0x1c'),_0x1d93ff[_0xebf2('0x19')],_0x607823);_0x3d781b(_0x4ecc30['error'](0x1f4,_0x1d93ff[_0xebf2('0x19')]));});});};exports[_0xebf2('0x26')]=function(_0x19140a){var _0x39df98=this;return new Promise(function(_0x4adfec,_0x5cfc3a){return db[_0xebf2('0x1d')][_0xebf2('0x27')]({'raw':_0x19140a['options']?_0x19140a['options']['raw']===undefined?!![]:![]:!![],'where':_0x19140a[_0xebf2('0x1f')]?_0x19140a[_0xebf2('0x1f')]['where']||null:null,'attributes':_0x19140a[_0xebf2('0x1f')]?_0x19140a[_0xebf2('0x1f')][_0xebf2('0x21')]||null:null,'include':_0x19140a[_0xebf2('0x1f')]?_0x19140a['options']['include']?_['map'](_0x19140a[_0xebf2('0x1f')][_0xebf2('0x24')],function(_0x4fd18d){return{'model':db[_0x4fd18d[_0xebf2('0x25')]],'as':_0x4fd18d['as'],'attributes':_0x4fd18d[_0xebf2('0x21')],'include':_0x4fd18d['include']?_[_0xebf2('0x23')](_0x4fd18d[_0xebf2('0x24')],function(_0x17ead3){return{'model':db[_0x17ead3[_0xebf2('0x25')]],'as':_0x17ead3['as'],'attributes':_0x17ead3[_0xebf2('0x21')],'include':_0x17ead3['include']?_[_0xebf2('0x23')](_0x17ead3['include'],function(_0x2af9d5){return{'model':db[_0x2af9d5[_0xebf2('0x25')]],'as':_0x2af9d5['as'],'attributes':_0x2af9d5['attributes']};}):[]};}):[]};}):[]:[]})[_0xebf2('0x10')](function(_0x41ceb3){logger['info']('ShowVoiceQueue',_0x19140a);logger[_0xebf2('0x14')]('ShowVoiceQueue',_0x19140a,JSON[_0xebf2('0x16')](_0x41ceb3));_0x4adfec(_0x41ceb3);})[_0xebf2('0x1b')](function(_0x404499){logger[_0xebf2('0x17')](_0xebf2('0x26'),_0x404499[_0xebf2('0x19')],_0x19140a);_0x5cfc3a(_0x39df98[_0xebf2('0x17')](0x1f4,_0x404499[_0xebf2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index ce1277d..67ebb71 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 _0xb93f=['./voiceQueue.events','update','emit','register','voiceQueue:'];(function(_0x243bba,_0x1ea69f){var _0x12e696=function(_0x5d3ab5){while(--_0x5d3ab5){_0x243bba['push'](_0x243bba['shift']());}};_0x12e696(++_0x1ea69f);}(_0xb93f,0xc3));var _0xfb93=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb93f[_0x16d10f];return _0x50c823;};'use strict';var VoiceQueueEvents=require(_0xfb93('0x0'));var events=['save','remove',_0xfb93('0x1')];function createListener(_0x16f6bb,_0x545387){return function(_0x46f3aa){_0x545387[_0xfb93('0x2')](_0x16f6bb,_0x46f3aa);};}function removeListener(_0x47a3d1,_0x2f2cf9){return function(){VoiceQueueEvents['removeListener'](_0x47a3d1,_0x2f2cf9);};}exports[_0xfb93('0x3')]=function(_0x417ec8){for(var _0x248072=0x0,_0x70fe33=events['length'];_0x248072<_0x70fe33;_0x248072++){var _0x36d139=events[_0x248072];var _0x4f80a2=createListener(_0xfb93('0x4')+_0x36d139,_0x417ec8);VoiceQueueEvents['on'](_0x36d139,_0x4f80a2);}}; \ No newline at end of file +var _0xc6ed=['remove','update','emit','removeListener','length','save'];(function(_0x496241,_0x25f7cd){var _0x1385f4=function(_0x1ccbfd){while(--_0x1ccbfd){_0x496241['push'](_0x496241['shift']());}};_0x1385f4(++_0x25f7cd);}(_0xc6ed,0x197));var _0xdc6e=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xc6ed[_0x9c2427];return _0x51984f;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xdc6e('0x0'),_0xdc6e('0x1'),_0xdc6e('0x2')];function createListener(_0x2bd23c,_0x3f0f0a){return function(_0x63d95b){_0x3f0f0a[_0xdc6e('0x3')](_0x2bd23c,_0x63d95b);};}function removeListener(_0xed65e8,_0xfa5d31){return function(){VoiceQueueEvents[_0xdc6e('0x4')](_0xed65e8,_0xfa5d31);};}exports['register']=function(_0x420108){for(var _0x3a5262=0x0,_0x215661=events[_0xdc6e('0x5')];_0x3a5262<_0x215661;_0x3a5262++){var _0x23beb2=events[_0x3a5262];var _0x1db159=createListener('voiceQueue:'+_0x23beb2,_0x420108);VoiceQueueEvents['on'](_0x23beb2,_0x1db159);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 937edf6..d23990d 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 _0x2856=['./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','destroy','multer','util','express','../../components/auth/service'];(function(_0x56342f,_0x501e38){var _0x4b009d=function(_0x636e25){while(--_0x636e25){_0x56342f['push'](_0x56342f['shift']());}};_0x4b009d(++_0x501e38);}(_0x2856,0x8c));var _0x6285=function(_0x5a9b6c,_0x30ccd0){_0x5a9b6c=_0x5a9b6c-0x0;var _0x72bed=_0x2856[_0x5a9b6c];return _0x72bed;};'use strict';var multer=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6285('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6285('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6285('0x4'));router[_0x6285('0x5')]('/',auth[_0x6285('0x6')](),controller[_0x6285('0x7')]);router[_0x6285('0x5')]('/describe',auth[_0x6285('0x6')](),controller[_0x6285('0x8')]);router[_0x6285('0x5')](_0x6285('0x9'),auth['isAuthenticated'](),controller[_0x6285('0xa')]);router[_0x6285('0x5')](_0x6285('0xb'),auth[_0x6285('0x6')](),controller[_0x6285('0xc')]);router[_0x6285('0xd')]('/',auth[_0x6285('0x6')](),controller[_0x6285('0xe')]);router[_0x6285('0xf')](_0x6285('0xb'),auth[_0x6285('0x6')](),controller[_0x6285('0x10')]);router['delete'](_0x6285('0xb'),auth[_0x6285('0x6')](),controller[_0x6285('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5106=['show','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id'];(function(_0x14501c,_0x3db08b){var _0x13cbab=function(_0x15b2e5){while(--_0x15b2e5){_0x14501c['push'](_0x14501c['shift']());}};_0x13cbab(++_0x3db08b);}(_0x5106,0x11d));var _0x6510=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5106[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x6510('0x0'));var util=require('util');var path=require(_0x6510('0x1'));var timeout=require(_0x6510('0x2'));var express=require(_0x6510('0x3'));var router=express[_0x6510('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6510('0x5'));var config=require(_0x6510('0x6'));var controller=require(_0x6510('0x7'));router[_0x6510('0x8')]('/',auth[_0x6510('0x9')](),controller[_0x6510('0xa')]);router[_0x6510('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x6510('0xb')]);router[_0x6510('0x8')](_0x6510('0xc'),auth['isAuthenticated'](),controller[_0x6510('0xd')]);router[_0x6510('0x8')](_0x6510('0xe'),auth['isAuthenticated'](),controller[_0x6510('0xf')]);router['post']('/',auth[_0x6510('0x9')](),controller['create']);router[_0x6510('0x10')](_0x6510('0xe'),auth[_0x6510('0x9')](),controller[_0x6510('0x11')]);router[_0x6510('0x12')](_0x6510('0xe'),auth[_0x6510('0x9')](),controller['destroy']);module[_0x6510('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 613b53a..bf20aaf 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 _0xf71c=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue'];(function(_0x595151,_0x1f1f72){var _0x5776df=function(_0x4930fa){while(--_0x4930fa){_0x595151['push'](_0x595151['shift']());}};_0x5776df(++_0x1f1f72);}(_0xf71c,0x135));var _0xcf71=function(_0x56e516,_0x382b9d){_0x56e516=_0x56e516-0x0;var _0x5bb373=_0xf71c[_0x56e516];return _0x5bb373;};'use strict';var Sequelize=require(_0xcf71('0x0'));var moment=require(_0xcf71('0x1'));module[_0xcf71('0x2')]={'type':{'type':Sequelize[_0xcf71('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xcf71('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xcf71('0x4')],'set':function(_0x32f696){var _0x11435b=moment(_0x32f696);var _0x2bac88=moment(this[_0xcf71('0x5')](_0xcf71('0x6')))[_0xcf71('0x7')](_0xcf71('0x8'));var _0xcd9c5e=_0x11435b[_0xcf71('0x9')](_0x2bac88,'seconds');this[_0xcf71('0xa')](_0xcf71('0xb'),_0x32f696);this[_0xcf71('0xa')](_0xcf71('0xc'),_0xcd9c5e||null);}},'position':{'type':Sequelize[_0xcf71('0xd')]},'count':{'type':Sequelize[_0xcf71('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xcf71('0x4')]},'queuecallerexit':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xcf71('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xcf71('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xcf71('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xcf71('0x3')]},'accountcode':{'type':Sequelize[_0xcf71('0x3')]},'context':{'type':Sequelize[_0xcf71('0x3')]},'exten':{'type':Sequelize[_0xcf71('0x3')]},'priority':{'type':Sequelize[_0xcf71('0x3')]},'holdtime':{'type':Sequelize[_0xcf71('0xd')]},'mohtime':{'type':Sequelize[_0xcf71('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcf71('0x3')]},'transfer':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xcf71('0x3')],'comment':_0xcf71('0xf')},'transferexten':{'type':Sequelize[_0xcf71('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xcf71('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcf71('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xcf71('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0xcf71('0x3')]}}; \ No newline at end of file +var _0xe702=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','INTEGER','BOOLEAN'];(function(_0x21481c,_0x1b51ba){var _0x5dd77a=function(_0x4ee13c){while(--_0x4ee13c){_0x21481c['push'](_0x21481c['shift']());}};_0x5dd77a(++_0x1b51ba);}(_0xe702,0x7b));var _0x2e70=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xe702[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x2e70('0x0')]},'uniqueid':{'type':Sequelize[_0x2e70('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2e70('0x0')]},'queuecallerjoinAt':{'type':Sequelize[_0x2e70('0x1')]},'queuecallerleaveAt':{'type':Sequelize[_0x2e70('0x1')],'set':function(_0x1a4887){var _0x1ea4ea=moment(_0x1a4887);var _0x4dac9c=moment(this[_0x2e70('0x2')]('queuecallerjoinAt'))[_0x2e70('0x3')](_0x2e70('0x4'));var _0x3e5961=_0x1ea4ea['diff'](_0x4dac9c,_0x2e70('0x5'));this['setDataValue']('queuecallerleaveAt',_0x1a4887);this[_0x2e70('0x6')]('holdtime',_0x3e5961||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x2e70('0x7')]},'queuecallerabandon':{'type':Sequelize[_0x2e70('0x8')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2e70('0x1')]},'queuecallerexit':{'type':Sequelize[_0x2e70('0x8')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2e70('0x1')]},'queuecallerexitreason':{'type':Sequelize[_0x2e70('0x0')],'comment':_0x2e70('0x9')},'originalposition':{'type':Sequelize[_0x2e70('0x7')]},'channel':{'type':Sequelize[_0x2e70('0x0')]},'connectedlinenum':{'type':Sequelize[_0x2e70('0x0')]},'connectedlinename':{'type':Sequelize[_0x2e70('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2e70('0x0')]},'exten':{'type':Sequelize[_0x2e70('0x0')]},'priority':{'type':Sequelize[_0x2e70('0x0')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x2e70('0x7')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2e70('0x8')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x2e70('0x8')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2e70('0x0')],'comment':_0x2e70('0xa')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2e70('0x0')]},'disposition':{'type':Sequelize[_0x2e70('0x0')]},'secondDisposition':{'type':Sequelize[_0x2e70('0x0')]},'thirdDisposition':{'type':Sequelize[_0x2e70('0x0')]},'queuecallerenterreason':{'type':Sequelize[_0x2e70('0x7')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 76a5603..1599570 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 _0x26c3=['offset','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','body','describe','getVoiceQueuesReport','nolimit','includeAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','status','undefined','limit','count'];(function(_0x53f125,_0x4ba12e){var _0x209b38=function(_0x67892c){while(--_0x67892c){_0x53f125['push'](_0x53f125['shift']());}};_0x209b38(++_0x4ba12e);}(_0x26c3,0x177));var _0x326c=function(_0x3dc1a3,_0x4d82e6){_0x3dc1a3=_0x3dc1a3-0x0;var _0x49721f=_0x26c3[_0x3dc1a3];return _0x49721f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x326c('0x0'));var zipdir=require(_0x326c('0x1'));var jsonpatch=require(_0x326c('0x2'));var rp=require(_0x326c('0x3'));var moment=require(_0x326c('0x4'));var BPromise=require(_0x326c('0x5'));var Mustache=require(_0x326c('0x6'));var util=require('util');var path=require(_0x326c('0x7'));var sox=require(_0x326c('0x8'));var csv=require(_0x326c('0x9'));var ejs=require(_0x326c('0xa'));var fs=require('fs');var fs_extra=require(_0x326c('0xb'));var _=require('lodash');var squel=require(_0x326c('0xc'));var crypto=require('crypto');var jsforce=require(_0x326c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x326c('0x9'));var querystring=require(_0x326c('0xe'));var Papa=require(_0x326c('0xf'));var Redis=require(_0x326c('0x10'));var authService=require(_0x326c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x326c('0x12'));var hardwareService=require(_0x326c('0x13'));var logger=require(_0x326c('0x14'))(_0x326c('0x15'));var utils=require(_0x326c('0x16'));var config=require(_0x326c('0x17'));var licenseUtil=require(_0x326c('0x18'));var db=require(_0x326c('0x19'))['db'];config[_0x326c('0x1a')]=_[_0x326c('0x1b')](config[_0x326c('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x326c('0x1c'))(new Redis(config[_0x326c('0x1a')]));require(_0x326c('0x1d'))[_0x326c('0x1e')](socket);function respondWithStatusCode(_0x1db7a8,_0x5db574){_0x5db574=_0x5db574||0xcc;return function(_0x8a90cd){if(_0x8a90cd){return _0x1db7a8['sendStatus'](_0x5db574);}return _0x1db7a8['status'](_0x5db574)['end']();};}function respondWithResult(_0x5864ad,_0x192210){_0x192210=_0x192210||0xc8;return function(_0x5e50de){if(_0x5e50de){return _0x5864ad[_0x326c('0x1f')](_0x192210)['json'](_0x5e50de);}};}function respondWithFilteredResult(_0x122963,_0x9408b7){return function(_0xc1b805){if(_0xc1b805){var _0x788be5=typeof _0x9408b7['offset']===_0x326c('0x20')&&typeof _0x9408b7[_0x326c('0x21')]==='undefined';var _0x5bd85a=_0xc1b805[_0x326c('0x22')];var _0x2fa4fe=_0x788be5?0x0:_0x9408b7[_0x326c('0x23')];var _0x561933=_0x788be5?_0xc1b805[_0x326c('0x22')]:_0x9408b7[_0x326c('0x23')]+_0x9408b7[_0x326c('0x21')];var _0x2e916a;if(_0x561933>=_0x5bd85a){_0x561933=_0x5bd85a;_0x2e916a=0xc8;}else{_0x2e916a=0xce;}_0x122963[_0x326c('0x1f')](_0x2e916a);return _0x122963['set'](_0x326c('0x24'),_0x2fa4fe+'-'+_0x561933+'/'+_0x5bd85a)[_0x326c('0x25')](_0xc1b805);}return null;};}function patchUpdates(_0x3f6149){return function(_0x333d18){try{jsonpatch['apply'](_0x333d18,_0x3f6149,!![]);}catch(_0x3e9853){return BPromise[_0x326c('0x26')](_0x3e9853);}return _0x333d18[_0x326c('0x27')]();};}function saveUpdates(_0x56a205,_0x77c017){return function(_0x1e86a9){if(_0x1e86a9){return _0x1e86a9[_0x326c('0x28')](_0x56a205)[_0x326c('0x29')](function(_0x3b3cb8){return _0x3b3cb8;});}return null;};}function removeEntity(_0x2e111e,_0x494b88){return function(_0x169557){if(_0x169557){return _0x169557[_0x326c('0x2a')]()[_0x326c('0x29')](function(){_0x2e111e[_0x326c('0x1f')](0xcc)[_0x326c('0x2b')]();});}};}function handleEntityNotFound(_0x1b746f,_0x33a92f){return function(_0x1a4e92){if(!_0x1a4e92){_0x1b746f['sendStatus'](0x194);}return _0x1a4e92;};}function handleError(_0x59f88f,_0x3a49d2){_0x3a49d2=_0x3a49d2||0x1f4;return function(_0x545cfd){logger[_0x326c('0x2c')](_0x545cfd[_0x326c('0x2d')]);if(_0x545cfd[_0x326c('0x2e')]){delete _0x545cfd['name'];}_0x59f88f['status'](_0x3a49d2)[_0x326c('0x2f')](_0x545cfd);};}exports[_0x326c('0x30')]=function(_0x387d97,_0x1cf56a){var _0x5b90ee={},_0x48c344={},_0x59447b={'count':0x0,'rows':[]};var _0x24053a=_[_0x326c('0x31')](db[_0x326c('0x32')][_0x326c('0x33')],function(_0x556e8b){return{'name':_0x556e8b['fieldName'],'type':_0x556e8b[_0x326c('0x34')]['key']};});_0x48c344[_0x326c('0x35')]=_[_0x326c('0x31')](_0x24053a,_0x326c('0x2e'));_0x48c344[_0x326c('0x36')]=_[_0x326c('0x37')](_0x387d97[_0x326c('0x36')]);_0x48c344[_0x326c('0x38')]=_[_0x326c('0x39')](_0x48c344[_0x326c('0x35')],_0x48c344[_0x326c('0x36')]);_0x5b90ee['attributes']=_[_0x326c('0x39')](_0x48c344[_0x326c('0x35')],qs[_0x326c('0x3a')](_0x387d97['query'][_0x326c('0x3a')]));_0x5b90ee['attributes']=_0x5b90ee[_0x326c('0x3b')][_0x326c('0x3c')]?_0x5b90ee[_0x326c('0x3b')]:_0x48c344['model'];if(!_0x387d97['query'][_0x326c('0x3d')]('nolimit')){_0x5b90ee[_0x326c('0x21')]=qs[_0x326c('0x21')](_0x387d97['query'][_0x326c('0x21')]);_0x5b90ee['offset']=qs[_0x326c('0x23')](_0x387d97['query'][_0x326c('0x23')]);}_0x5b90ee[_0x326c('0x3e')]=qs[_0x326c('0x3f')](_0x387d97[_0x326c('0x36')][_0x326c('0x3f')]);_0x5b90ee['where']=qs[_0x326c('0x38')](_[_0x326c('0x40')](_0x387d97[_0x326c('0x36')],_0x48c344[_0x326c('0x38')]),_0x24053a);if(_0x387d97[_0x326c('0x36')][_0x326c('0x41')]){_0x5b90ee[_0x326c('0x42')]=_[_0x326c('0x43')](_0x5b90ee[_0x326c('0x42')],{'$or':_[_0x326c('0x31')](_0x24053a,function(_0x1388fb){if(_0x1388fb[_0x326c('0x34')]!==_0x326c('0x44')){var _0x347d49={};_0x347d49[_0x1388fb['name']]={'$like':'%'+_0x387d97[_0x326c('0x36')][_0x326c('0x41')]+'%'};return _0x347d49;}})});}_0x5b90ee=_[_0x326c('0x43')]({},_0x5b90ee,_0x387d97[_0x326c('0x45')]);var _0x2a0f96={'where':_0x5b90ee['where']};return db[_0x326c('0x32')][_0x326c('0x22')](_0x2a0f96)[_0x326c('0x29')](function(_0x1510ac){_0x59447b[_0x326c('0x22')]=_0x1510ac;if(_0x387d97[_0x326c('0x36')]['includeAll']){_0x5b90ee[_0x326c('0x46')]=[{'all':!![]}];}return db[_0x326c('0x32')][_0x326c('0x47')](_0x5b90ee);})[_0x326c('0x29')](function(_0x1f8fa3){_0x59447b[_0x326c('0x48')]=_0x1f8fa3;return _0x59447b;})[_0x326c('0x29')](respondWithFilteredResult(_0x1cf56a,_0x5b90ee))[_0x326c('0x49')](handleError(_0x1cf56a,null));};exports['show']=function(_0x2940f1,_0x1649ee){var _0x497674={'raw':![],'where':{'id':_0x2940f1[_0x326c('0x4a')]['id']}},_0x309917={};_0x309917['model']=_[_0x326c('0x37')](db['VoiceQueueReport']['rawAttributes']);_0x309917[_0x326c('0x36')]=_['keys'](_0x2940f1[_0x326c('0x36')]);_0x309917[_0x326c('0x38')]=_[_0x326c('0x39')](_0x309917[_0x326c('0x35')],_0x309917[_0x326c('0x36')]);_0x497674['attributes']=_['intersection'](_0x309917[_0x326c('0x35')],qs[_0x326c('0x3a')](_0x2940f1[_0x326c('0x36')][_0x326c('0x3a')]));_0x497674[_0x326c('0x3b')]=_0x497674[_0x326c('0x3b')]['length']?_0x497674[_0x326c('0x3b')]:_0x309917[_0x326c('0x35')];if(_0x2940f1['query']['includeAll']){_0x497674[_0x326c('0x46')]=[{'all':!![]}];}_0x497674=_[_0x326c('0x43')]({},_0x497674,_0x2940f1['options']);return db['VoiceQueueReport'][_0x326c('0x4b')](_0x497674)[_0x326c('0x29')](handleEntityNotFound(_0x1649ee,null))['then'](respondWithResult(_0x1649ee,null))[_0x326c('0x49')](handleError(_0x1649ee,null));};exports[_0x326c('0x4c')]=function(_0x734d43,_0x190167){return db[_0x326c('0x32')][_0x326c('0x4c')](_0x734d43[_0x326c('0x4d')],{})['then'](respondWithResult(_0x190167,0xc9))[_0x326c('0x49')](handleError(_0x190167,null));};exports['update']=function(_0x53225c,_0x522da5){if(_0x53225c[_0x326c('0x4d')]['id']){delete _0x53225c[_0x326c('0x4d')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x53225c[_0x326c('0x4a')]['id']}})[_0x326c('0x29')](handleEntityNotFound(_0x522da5,null))['then'](saveUpdates(_0x53225c[_0x326c('0x4d')],null))[_0x326c('0x29')](respondWithResult(_0x522da5,null))[_0x326c('0x49')](handleError(_0x522da5,null));};exports[_0x326c('0x2a')]=function(_0x47eed2,_0x19165a){return db['VoiceQueueReport'][_0x326c('0x4b')]({'where':{'id':_0x47eed2[_0x326c('0x4a')]['id']}})[_0x326c('0x29')](handleEntityNotFound(_0x19165a,null))[_0x326c('0x29')](removeEntity(_0x19165a,null))[_0x326c('0x49')](handleError(_0x19165a,null));};exports[_0x326c('0x4e')]=function(_0x506f6a,_0x4e08ed){return db[_0x326c('0x32')]['describe']()[_0x326c('0x29')](respondWithResult(_0x4e08ed,null))['catch'](handleError(_0x4e08ed,null));};exports[_0x326c('0x4f')]=function(_0x20f24e,_0x597488){var _0x3f1f4f={},_0x9e2f54={},_0x5e3774={'count':0x0,'rows':[]};_0x9e2f54[_0x326c('0x35')]=_[_0x326c('0x37')](db[_0x326c('0x32')][_0x326c('0x33')]);_0x9e2f54['query']=_[_0x326c('0x37')](_0x20f24e[_0x326c('0x36')]);_0x9e2f54[_0x326c('0x38')]=_['intersection'](_0x9e2f54[_0x326c('0x35')],_0x9e2f54['query']);_0x3f1f4f['attributes']=_[_0x326c('0x39')](_0x9e2f54[_0x326c('0x35')],qs[_0x326c('0x3a')](_0x20f24e['query'][_0x326c('0x3a')]));_0x3f1f4f[_0x326c('0x3b')]=_0x3f1f4f['attributes'][_0x326c('0x3c')]?_0x3f1f4f[_0x326c('0x3b')]:_0x9e2f54[_0x326c('0x35')];if(!_0x20f24e[_0x326c('0x36')][_0x326c('0x3d')](_0x326c('0x50'))){_0x3f1f4f['limit']=qs[_0x326c('0x21')](_0x20f24e[_0x326c('0x36')][_0x326c('0x21')]);_0x3f1f4f[_0x326c('0x23')]=qs[_0x326c('0x23')](_0x20f24e[_0x326c('0x36')][_0x326c('0x23')]);}_0x3f1f4f[_0x326c('0x3e')]=qs['sort'](_0x20f24e[_0x326c('0x36')]['sort']);_0x3f1f4f['where']=qs[_0x326c('0x38')](_['pick'](_0x20f24e[_0x326c('0x36')],_0x9e2f54[_0x326c('0x38')]));if(_0x20f24e[_0x326c('0x36')][_0x326c('0x41')]){_0x3f1f4f[_0x326c('0x42')]=_[_0x326c('0x43')](_0x3f1f4f['where'],{'$or':_[_0x326c('0x31')](_0x3f1f4f[_0x326c('0x3b')],function(_0x2198f1){var _0x1dabed={};_0x1dabed[_0x2198f1]={'$like':'%'+_0x20f24e[_0x326c('0x36')][_0x326c('0x41')]+'%'};return _0x1dabed;})});}_0x3f1f4f=_[_0x326c('0x43')]({},_0x3f1f4f,_0x20f24e['options']);var _0xe93995={'where':_0x3f1f4f['where']};return db[_0x326c('0x32')][_0x326c('0x22')](_0xe93995)['then'](function(_0x210ed3){_0x5e3774[_0x326c('0x22')]=_0x210ed3;if(_0x20f24e[_0x326c('0x36')][_0x326c('0x51')]){_0x3f1f4f[_0x326c('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x326c('0x47')](_0x3f1f4f);})[_0x326c('0x29')](function(_0x348b13){_0x5e3774[_0x326c('0x48')]=_0x348b13;return _0x5e3774;})[_0x326c('0x29')](respondWithFilteredResult(_0x597488,_0x3f1f4f,'getVoiceQueuesReport'))['catch'](handleError(_0x597488,null,_0x326c('0x4f')));}; \ No newline at end of file +var _0xd108=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','fields','length','find','catch','create','body','describe','getVoiceQueuesReport','options','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x9ce42d,_0x153723){var _0xcb720e=function(_0x4f931d){while(--_0x4f931d){_0x9ce42d['push'](_0x9ce42d['shift']());}};_0xcb720e(++_0x153723);}(_0xd108,0x191));var _0x8d10=function(_0x4e0e9b,_0x45999e){_0x4e0e9b=_0x4e0e9b-0x0;var _0x4790b2=_0xd108[_0x4e0e9b];return _0x4790b2;};'use strict';var emlformat=require(_0x8d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d10('0x1'));var jsonpatch=require(_0x8d10('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d10('0x3'));var Mustache=require(_0x8d10('0x4'));var util=require(_0x8d10('0x5'));var path=require('path');var sox=require(_0x8d10('0x6'));var csv=require(_0x8d10('0x7'));var ejs=require(_0x8d10('0x8'));var fs=require('fs');var fs_extra=require(_0x8d10('0x9'));var _=require(_0x8d10('0xa'));var squel=require('squel');var crypto=require(_0x8d10('0xb'));var jsforce=require(_0x8d10('0xc'));var deskjs=require(_0x8d10('0xd'));var toCsv=require(_0x8d10('0x7'));var querystring=require(_0x8d10('0xe'));var Papa=require(_0x8d10('0xf'));var Redis=require(_0x8d10('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8d10('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d10('0x12'));var logger=require(_0x8d10('0x13'))(_0x8d10('0x14'));var utils=require('../../config/utils');var config=require(_0x8d10('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8d10('0x16')]=_['defaults'](config['redis'],{'host':_0x8d10('0x17'),'port':0x18eb});var socket=require(_0x8d10('0x18'))(new Redis(config[_0x8d10('0x16')]));require(_0x8d10('0x19'))[_0x8d10('0x1a')](socket);function respondWithStatusCode(_0x50e5b0,_0x2f7fc0){_0x2f7fc0=_0x2f7fc0||0xcc;return function(_0x4bdb84){if(_0x4bdb84){return _0x50e5b0[_0x8d10('0x1b')](_0x2f7fc0);}return _0x50e5b0[_0x8d10('0x1c')](_0x2f7fc0)[_0x8d10('0x1d')]();};}function respondWithResult(_0xb74ab0,_0x178cb0){_0x178cb0=_0x178cb0||0xc8;return function(_0x5d35a5){if(_0x5d35a5){return _0xb74ab0[_0x8d10('0x1c')](_0x178cb0)[_0x8d10('0x1e')](_0x5d35a5);}};}function respondWithFilteredResult(_0x5c4d33,_0x27be30){return function(_0x1a29ad){if(_0x1a29ad){var _0x130a12=typeof _0x27be30[_0x8d10('0x1f')]===_0x8d10('0x20')&&typeof _0x27be30[_0x8d10('0x21')]===_0x8d10('0x20');var _0x3cc49e=_0x1a29ad[_0x8d10('0x22')];var _0x1a7a04=_0x130a12?0x0:_0x27be30[_0x8d10('0x1f')];var _0x55360e=_0x130a12?_0x1a29ad[_0x8d10('0x22')]:_0x27be30[_0x8d10('0x1f')]+_0x27be30[_0x8d10('0x21')];var _0x13409a;if(_0x55360e>=_0x3cc49e){_0x55360e=_0x3cc49e;_0x13409a=0xc8;}else{_0x13409a=0xce;}_0x5c4d33['status'](_0x13409a);return _0x5c4d33['set'](_0x8d10('0x23'),_0x1a7a04+'-'+_0x55360e+'/'+_0x3cc49e)[_0x8d10('0x1e')](_0x1a29ad);}return null;};}function patchUpdates(_0x2d73dc){return function(_0x363581){try{jsonpatch[_0x8d10('0x24')](_0x363581,_0x2d73dc,!![]);}catch(_0x209aa4){return BPromise[_0x8d10('0x25')](_0x209aa4);}return _0x363581[_0x8d10('0x26')]();};}function saveUpdates(_0x5b3a6f,_0xbf5920){return function(_0x2f5338){if(_0x2f5338){return _0x2f5338[_0x8d10('0x27')](_0x5b3a6f)[_0x8d10('0x28')](function(_0x4949a0){return _0x4949a0;});}return null;};}function removeEntity(_0x4ffba3,_0x3648bd){return function(_0x159cac){if(_0x159cac){return _0x159cac[_0x8d10('0x29')]()['then'](function(){_0x4ffba3['status'](0xcc)[_0x8d10('0x1d')]();});}};}function handleEntityNotFound(_0x4e4914,_0x5b7db9){return function(_0x1d5f1d){if(!_0x1d5f1d){_0x4e4914[_0x8d10('0x1b')](0x194);}return _0x1d5f1d;};}function handleError(_0x17e2ba,_0x22d4e6){_0x22d4e6=_0x22d4e6||0x1f4;return function(_0x5bd86e){logger[_0x8d10('0x2a')](_0x5bd86e[_0x8d10('0x2b')]);if(_0x5bd86e[_0x8d10('0x2c')]){delete _0x5bd86e[_0x8d10('0x2c')];}_0x17e2ba[_0x8d10('0x1c')](_0x22d4e6)[_0x8d10('0x2d')](_0x5bd86e);};}exports[_0x8d10('0x2e')]=function(_0x50ffcd,_0x2dc8c8){var _0x36bc17={},_0x5b357b={},_0x5dcd7c={'count':0x0,'rows':[]};var _0xbae41b=_[_0x8d10('0x2f')](db[_0x8d10('0x30')][_0x8d10('0x31')],function(_0x29034f){return{'name':_0x29034f[_0x8d10('0x32')],'type':_0x29034f['type'][_0x8d10('0x33')]};});_0x5b357b[_0x8d10('0x34')]=_['map'](_0xbae41b,_0x8d10('0x2c'));_0x5b357b['query']=_['keys'](_0x50ffcd[_0x8d10('0x35')]);_0x5b357b[_0x8d10('0x36')]=_[_0x8d10('0x37')](_0x5b357b[_0x8d10('0x34')],_0x5b357b[_0x8d10('0x35')]);_0x36bc17[_0x8d10('0x38')]=_[_0x8d10('0x37')](_0x5b357b[_0x8d10('0x34')],qs['fields'](_0x50ffcd[_0x8d10('0x35')]['fields']));_0x36bc17['attributes']=_0x36bc17['attributes']['length']?_0x36bc17[_0x8d10('0x38')]:_0x5b357b[_0x8d10('0x34')];if(!_0x50ffcd['query'][_0x8d10('0x39')](_0x8d10('0x3a'))){_0x36bc17[_0x8d10('0x21')]=qs['limit'](_0x50ffcd[_0x8d10('0x35')]['limit']);_0x36bc17[_0x8d10('0x1f')]=qs[_0x8d10('0x1f')](_0x50ffcd[_0x8d10('0x35')][_0x8d10('0x1f')]);}_0x36bc17[_0x8d10('0x3b')]=qs[_0x8d10('0x3c')](_0x50ffcd['query'][_0x8d10('0x3c')]);_0x36bc17['where']=qs[_0x8d10('0x36')](_[_0x8d10('0x3d')](_0x50ffcd[_0x8d10('0x35')],_0x5b357b[_0x8d10('0x36')]),_0xbae41b);if(_0x50ffcd[_0x8d10('0x35')][_0x8d10('0x3e')]){_0x36bc17['where']=_['merge'](_0x36bc17[_0x8d10('0x3f')],{'$or':_['map'](_0xbae41b,function(_0x1f6708){if(_0x1f6708['type']!==_0x8d10('0x40')){var _0x28dc21={};_0x28dc21[_0x1f6708['name']]={'$like':'%'+_0x50ffcd['query'][_0x8d10('0x3e')]+'%'};return _0x28dc21;}})});}_0x36bc17=_[_0x8d10('0x41')]({},_0x36bc17,_0x50ffcd['options']);var _0xfb4c6f={'where':_0x36bc17['where']};return db[_0x8d10('0x30')]['count'](_0xfb4c6f)[_0x8d10('0x28')](function(_0x1b3c2c){_0x5dcd7c[_0x8d10('0x22')]=_0x1b3c2c;if(_0x50ffcd[_0x8d10('0x35')][_0x8d10('0x42')]){_0x36bc17[_0x8d10('0x43')]=[{'all':!![]}];}return db[_0x8d10('0x30')][_0x8d10('0x44')](_0x36bc17);})[_0x8d10('0x28')](function(_0x543462){_0x5dcd7c[_0x8d10('0x45')]=_0x543462;return _0x5dcd7c;})[_0x8d10('0x28')](respondWithFilteredResult(_0x2dc8c8,_0x36bc17))['catch'](handleError(_0x2dc8c8,null));};exports[_0x8d10('0x46')]=function(_0x2d2930,_0x44ef1c){var _0x5df0cd={'raw':![],'where':{'id':_0x2d2930[_0x8d10('0x47')]['id']}},_0x124c48={};_0x124c48[_0x8d10('0x34')]=_['keys'](db[_0x8d10('0x30')][_0x8d10('0x31')]);_0x124c48[_0x8d10('0x35')]=_[_0x8d10('0x48')](_0x2d2930['query']);_0x124c48[_0x8d10('0x36')]=_['intersection'](_0x124c48[_0x8d10('0x34')],_0x124c48[_0x8d10('0x35')]);_0x5df0cd[_0x8d10('0x38')]=_['intersection'](_0x124c48[_0x8d10('0x34')],qs[_0x8d10('0x49')](_0x2d2930[_0x8d10('0x35')][_0x8d10('0x49')]));_0x5df0cd[_0x8d10('0x38')]=_0x5df0cd[_0x8d10('0x38')][_0x8d10('0x4a')]?_0x5df0cd[_0x8d10('0x38')]:_0x124c48[_0x8d10('0x34')];if(_0x2d2930[_0x8d10('0x35')][_0x8d10('0x42')]){_0x5df0cd[_0x8d10('0x43')]=[{'all':!![]}];}_0x5df0cd=_[_0x8d10('0x41')]({},_0x5df0cd,_0x2d2930['options']);return db['VoiceQueueReport'][_0x8d10('0x4b')](_0x5df0cd)['then'](handleEntityNotFound(_0x44ef1c,null))[_0x8d10('0x28')](respondWithResult(_0x44ef1c,null))[_0x8d10('0x4c')](handleError(_0x44ef1c,null));};exports[_0x8d10('0x4d')]=function(_0x4e59fa,_0x15ff16){return db[_0x8d10('0x30')][_0x8d10('0x4d')](_0x4e59fa[_0x8d10('0x4e')],{})['then'](respondWithResult(_0x15ff16,0xc9))[_0x8d10('0x4c')](handleError(_0x15ff16,null));};exports[_0x8d10('0x27')]=function(_0x5f23a3,_0x16dfbd){if(_0x5f23a3['body']['id']){delete _0x5f23a3['body']['id'];}return db[_0x8d10('0x30')]['find']({'where':{'id':_0x5f23a3['params']['id']}})[_0x8d10('0x28')](handleEntityNotFound(_0x16dfbd,null))[_0x8d10('0x28')](saveUpdates(_0x5f23a3[_0x8d10('0x4e')],null))[_0x8d10('0x28')](respondWithResult(_0x16dfbd,null))[_0x8d10('0x4c')](handleError(_0x16dfbd,null));};exports[_0x8d10('0x29')]=function(_0x1eb31c,_0x48fbd1){return db[_0x8d10('0x30')]['find']({'where':{'id':_0x1eb31c[_0x8d10('0x47')]['id']}})['then'](handleEntityNotFound(_0x48fbd1,null))['then'](removeEntity(_0x48fbd1,null))['catch'](handleError(_0x48fbd1,null));};exports[_0x8d10('0x4f')]=function(_0xa6cbfd,_0x38e8d4){return db[_0x8d10('0x30')]['describe']()[_0x8d10('0x28')](respondWithResult(_0x38e8d4,null))['catch'](handleError(_0x38e8d4,null));};exports[_0x8d10('0x50')]=function(_0x2e2324,_0x52d387){var _0xe8f108={},_0x5c182e={},_0x1bb82f={'count':0x0,'rows':[]};_0x5c182e[_0x8d10('0x34')]=_['keys'](db['VoiceQueueReport'][_0x8d10('0x31')]);_0x5c182e['query']=_[_0x8d10('0x48')](_0x2e2324['query']);_0x5c182e[_0x8d10('0x36')]=_[_0x8d10('0x37')](_0x5c182e[_0x8d10('0x34')],_0x5c182e[_0x8d10('0x35')]);_0xe8f108[_0x8d10('0x38')]=_[_0x8d10('0x37')](_0x5c182e[_0x8d10('0x34')],qs['fields'](_0x2e2324[_0x8d10('0x35')]['fields']));_0xe8f108[_0x8d10('0x38')]=_0xe8f108[_0x8d10('0x38')][_0x8d10('0x4a')]?_0xe8f108[_0x8d10('0x38')]:_0x5c182e[_0x8d10('0x34')];if(!_0x2e2324[_0x8d10('0x35')][_0x8d10('0x39')](_0x8d10('0x3a'))){_0xe8f108[_0x8d10('0x21')]=qs['limit'](_0x2e2324[_0x8d10('0x35')]['limit']);_0xe8f108['offset']=qs[_0x8d10('0x1f')](_0x2e2324['query'][_0x8d10('0x1f')]);}_0xe8f108[_0x8d10('0x3b')]=qs[_0x8d10('0x3c')](_0x2e2324['query'][_0x8d10('0x3c')]);_0xe8f108[_0x8d10('0x3f')]=qs[_0x8d10('0x36')](_['pick'](_0x2e2324['query'],_0x5c182e[_0x8d10('0x36')]));if(_0x2e2324['query'][_0x8d10('0x3e')]){_0xe8f108[_0x8d10('0x3f')]=_[_0x8d10('0x41')](_0xe8f108[_0x8d10('0x3f')],{'$or':_['map'](_0xe8f108['attributes'],function(_0x3b3f75){var _0x21657f={};_0x21657f[_0x3b3f75]={'$like':'%'+_0x2e2324[_0x8d10('0x35')][_0x8d10('0x3e')]+'%'};return _0x21657f;})});}_0xe8f108=_['merge']({},_0xe8f108,_0x2e2324[_0x8d10('0x51')]);var _0x2a9c7c={'where':_0xe8f108[_0x8d10('0x3f')]};return db[_0x8d10('0x30')][_0x8d10('0x22')](_0x2a9c7c)[_0x8d10('0x28')](function(_0x112517){_0x1bb82f[_0x8d10('0x22')]=_0x112517;if(_0x2e2324[_0x8d10('0x35')][_0x8d10('0x42')]){_0xe8f108['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x8d10('0x44')](_0xe8f108);})[_0x8d10('0x28')](function(_0x390933){_0x1bb82f[_0x8d10('0x45')]=_0x390933;return _0x1bb82f;})[_0x8d10('0x28')](respondWithFilteredResult(_0x52d387,_0xe8f108,_0x8d10('0x50')))[_0x8d10('0x4c')](handleError(_0x52d387,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 3f3a2ce..dcc2f85 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 _0xa002=['hook','exports','events','../../mysqldb','VoiceQueueReport','remove'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xa002,0x1dc));var _0x2a00=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa002[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x2a00('0x0'));var VoiceQueueReport=require(_0x2a00('0x1'))['db'][_0x2a00('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2a00('0x3')};function emitEvent(_0x8fb53f){return function(_0xffdc93,_0x4b7f1d,_0x1e614b){VoiceQueueReportEvents['emit'](_0x8fb53f+':'+_0xffdc93['id'],_0xffdc93);VoiceQueueReportEvents['emit'](_0x8fb53f,_0xffdc93);_0x1e614b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x2a00('0x4')](e,emitEvent(event));}}module[_0x2a00('0x5')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x8152=['events','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x7f99d5,_0x5df01b){var _0x169d49=function(_0x14ec9f){while(--_0x14ec9f){_0x7f99d5['push'](_0x7f99d5['shift']());}};_0x169d49(++_0x5df01b);}(_0x8152,0x1b0));var _0x2815=function(_0x2cdf30,_0x4b8095){_0x2cdf30=_0x2cdf30-0x0;var _0x305edc=_0x8152[_0x2cdf30];return _0x305edc;};'use strict';var EventEmitter=require(_0x2815('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x2815('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2815('0x2')](0x0);var events={'afterCreate':_0x2815('0x3'),'afterUpdate':_0x2815('0x4'),'afterDestroy':'remove'};function emitEvent(_0x398a67){return function(_0x341c6d,_0x1a5835,_0x4fa963){VoiceQueueReportEvents[_0x2815('0x5')](_0x398a67+':'+_0x341c6d['id'],_0x341c6d);VoiceQueueReportEvents[_0x2815('0x5')](_0x398a67,_0x341c6d);_0x4fa963(null);};}for(var e in events){if(events[_0x2815('0x6')](e)){var event=events[e];VoiceQueueReport[_0x2815('0x7')](e,emitEvent(event));}}module[_0x2815('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index aed5811..262287b 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 _0x4a31=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x4a31,0x12f));var _0x14a3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a31[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x14a3('0x0'));var util=require(_0x14a3('0x1'));var logger=require(_0x14a3('0x2'))(_0x14a3('0x3'));var moment=require(_0x14a3('0x4'));var BPromise=require(_0x14a3('0x5'));var rp=require(_0x14a3('0x6'));var fs=require('fs');var path=require(_0x14a3('0x7'));var rimraf=require('rimraf');var config=require(_0x14a3('0x8'));var attributes=require(_0x14a3('0x9'));module[_0x14a3('0xa')]=function(_0x684313,_0x35bb34){return _0x684313[_0x14a3('0xb')](_0x14a3('0xc'),attributes,{'tableName':_0x14a3('0xd'),'paranoid':![],'indexes':[{'fields':[_0x14a3('0xe')]},{'fields':[_0x14a3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5848=['../../config/logger','api','path','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','calleridnum','lodash','util'];(function(_0x3b6e7b,_0x123301){var _0x3e6c79=function(_0x2174a1){while(--_0x2174a1){_0x3b6e7b['push'](_0x3b6e7b['shift']());}};_0x3e6c79(++_0x123301);}(_0x5848,0xcf));var _0x8584=function(_0x5d4e9c,_0x438e03){_0x5d4e9c=_0x5d4e9c-0x0;var _0x44d214=_0x5848[_0x5d4e9c];return _0x44d214;};'use strict';var _=require(_0x8584('0x0'));var util=require(_0x8584('0x1'));var logger=require(_0x8584('0x2'))(_0x8584('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8584('0x4'));var rimraf=require(_0x8584('0x5'));var config=require(_0x8584('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x8584('0x7')]=function(_0x303c9a,_0xb8f183){return _0x303c9a['define'](_0x8584('0x8'),attributes,{'tableName':_0x8584('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x8584('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 1769f98..7dbc042 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 _0xa56d=['findAll','options','raw','attributes','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','stringify','catch','UpdateVoiceQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3abbae,_0x523929){var _0x332e96=function(_0x3104cc){while(--_0x3104cc){_0x3abbae['push'](_0x3abbae['shift']());}};_0x332e96(++_0x523929);}(_0xa56d,0x1bf));var _0xda56=function(_0x38ac0d,_0x16f6f5){_0x38ac0d=_0x38ac0d-0x0;var _0x388fda=_0xa56d[_0x38ac0d];return _0x388fda;};'use strict';var _=require(_0xda56('0x0'));var util=require(_0xda56('0x1'));var moment=require(_0xda56('0x2'));var BPromise=require(_0xda56('0x3'));var rs=require(_0xda56('0x4'));var fs=require('fs');var Redis=require(_0xda56('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda56('0x6'));var logger=require(_0xda56('0x7'))(_0xda56('0x8'));var config=require('../../config/environment');var jayson=require(_0xda56('0x9'));var client=jayson[_0xda56('0xa')][_0xda56('0xb')]({'port':0x232a});config[_0xda56('0xc')]=_['defaults'](config[_0xda56('0xc')],{'host':_0xda56('0xd'),'port':0x18eb});var socket=require(_0xda56('0xe'))(new Redis(config['redis']));require(_0xda56('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c0bbb,_0x440602,_0x5a399b){return new BPromise(function(_0x400f19,_0x940674){return client['request'](_0x2c0bbb,_0x5a399b)[_0xda56('0x10')](function(_0x326691){logger[_0xda56('0x11')](_0xda56('0x12'),_0x440602,_0xda56('0x13'));logger[_0xda56('0x14')](_0xda56('0x15'),_0x440602,_0xda56('0x13'),JSON['stringify'](_0x326691));if(_0x326691['error']){if(_0x326691[_0xda56('0x16')][_0xda56('0x17')]===0x1f4){logger[_0xda56('0x16')](_0xda56('0x12'),_0x440602,_0x326691[_0xda56('0x16')]['message']);return _0x940674(_0x326691[_0xda56('0x16')][_0xda56('0x18')]);}logger['error'](_0xda56('0x12'),_0x440602,_0x326691[_0xda56('0x16')][_0xda56('0x18')]);return _0x400f19(_0x326691['error']['message']);}else{logger[_0xda56('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x440602,'request\x20sent');_0x400f19(_0x326691[_0xda56('0x19')]['message']);}})['catch'](function(_0x2ec36b){logger[_0xda56('0x16')](_0xda56('0x12'),_0x440602,_0x2ec36b);_0x940674(_0x2ec36b);});});}exports['GetVoiceQueueReport']=function(_0x33785c){var _0x23eef1=this;return new Promise(function(_0x181b7a,_0x730af0){return db['VoiceQueueReport'][_0xda56('0x1a')]({'raw':_0x33785c[_0xda56('0x1b')]?_0x33785c[_0xda56('0x1b')][_0xda56('0x1c')]===undefined?!![]:![]:!![],'where':_0x33785c[_0xda56('0x1b')]?_0x33785c['options']['where']||null:null,'attributes':_0x33785c[_0xda56('0x1b')]?_0x33785c[_0xda56('0x1b')][_0xda56('0x1d')]||null:null,'limit':_0x33785c['options']?_0x33785c[_0xda56('0x1b')]['limit']||null:null,'include':_0x33785c[_0xda56('0x1b')]?_0x33785c[_0xda56('0x1b')][_0xda56('0x1e')]?_[_0xda56('0x1f')](_0x33785c[_0xda56('0x1b')][_0xda56('0x1e')],function(_0x1ee979){return{'model':db[_0x1ee979[_0xda56('0x20')]],'as':_0x1ee979['as'],'attributes':_0x1ee979[_0xda56('0x1d')],'include':_0x1ee979[_0xda56('0x1e')]?_[_0xda56('0x1f')](_0x1ee979[_0xda56('0x1e')],function(_0x626d04){return{'model':db[_0x626d04[_0xda56('0x20')]],'as':_0x626d04['as'],'attributes':_0x626d04[_0xda56('0x1d')],'include':_0x626d04['include']?_[_0xda56('0x1f')](_0x626d04[_0xda56('0x1e')],function(_0x1bb5d9){return{'model':db[_0x1bb5d9[_0xda56('0x20')]],'as':_0x1bb5d9['as'],'attributes':_0x1bb5d9[_0xda56('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xda56('0x10')](function(_0x393f1e){logger['info'](_0xda56('0x21'),_0x33785c);logger['debug'](_0xda56('0x21'),_0x33785c,JSON['stringify'](_0x393f1e));_0x181b7a(_0x393f1e);})['catch'](function(_0x4311b9){logger['error'](_0xda56('0x21'),_0x4311b9[_0xda56('0x18')],_0x33785c);_0x730af0(_0x23eef1[_0xda56('0x16')](0x1f4,_0x4311b9[_0xda56('0x18')]));});});};exports[_0xda56('0x22')]=function(_0x31f644){var _0x4f4bcd=this;return new Promise(function(_0x5d1dee,_0x224f60){return db['VoiceQueueReport'][_0xda56('0x23')](_0x31f644['body'],{'raw':_0x31f644[_0xda56('0x1b')]?_0x31f644[_0xda56('0x1b')][_0xda56('0x1c')]===undefined?!![]:![]:!![]})[_0xda56('0x10')](function(_0x5aeb08){logger['info'](_0xda56('0x22'),_0x31f644);logger[_0xda56('0x14')](_0xda56('0x22'),_0x31f644,JSON[_0xda56('0x24')](_0x5aeb08));_0x5d1dee(_0x5aeb08);})[_0xda56('0x25')](function(_0x13e003){logger[_0xda56('0x16')](_0xda56('0x22'),_0x13e003[_0xda56('0x18')],_0x31f644);_0x224f60(_0x4f4bcd[_0xda56('0x16')](0x1f4,_0x13e003['message']));});});};exports[_0xda56('0x26')]=function(_0x3ac93b){var _0x1756b2=this;return new Promise(function(_0x11fb4b,_0xcd4d8f){return db['VoiceQueueReport'][_0xda56('0x27')](_0x3ac93b[_0xda56('0x28')],{'raw':_0x3ac93b['options']?_0x3ac93b['options'][_0xda56('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ac93b[_0xda56('0x1b')]?_0x3ac93b['options'][_0xda56('0x29')]||null:null,'attributes':_0x3ac93b[_0xda56('0x1b')]?_0x3ac93b[_0xda56('0x1b')][_0xda56('0x1d')]||null:null,'limit':_0x3ac93b[_0xda56('0x1b')]?_0x3ac93b['options'][_0xda56('0x2a')]||null:null})[_0xda56('0x10')](function(_0x49d998){logger[_0xda56('0x11')]('UpdateVoiceQueueReport',_0x3ac93b);logger[_0xda56('0x14')](_0xda56('0x26'),_0x3ac93b,JSON['stringify'](_0x49d998));_0x11fb4b(_0x49d998);})[_0xda56('0x25')](function(_0x3a6c13){logger[_0xda56('0x16')](_0xda56('0x26'),_0x3a6c13['message'],_0x3ac93b);_0xcd4d8f(_0x1756b2['error'](0x1f4,_0x3a6c13[_0xda56('0x18')]));});});}; \ No newline at end of file +var _0x55d7=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','limit','include','map','model','attributes','then','CreateVoiceQueueReport','create','body','stringify','UpdateVoiceQueueReport','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voiceQueueReport.socket','info'];(function(_0x3831db,_0x226906){var _0x59c2ce=function(_0x53cdee){while(--_0x53cdee){_0x3831db['push'](_0x3831db['shift']());}};_0x59c2ce(++_0x226906);}(_0x55d7,0x152));var _0x755d=function(_0x4949ba,_0x5a9616){_0x4949ba=_0x4949ba-0x0;var _0x543b99=_0x55d7[_0x4949ba];return _0x543b99;};'use strict';var _=require(_0x755d('0x0'));var util=require('util');var moment=require(_0x755d('0x1'));var BPromise=require('bluebird');var rs=require(_0x755d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x755d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x755d('0x4'));var config=require(_0x755d('0x5'));var jayson=require(_0x755d('0x6'));var client=jayson['client'][_0x755d('0x7')]({'port':0x232a});config[_0x755d('0x8')]=_[_0x755d('0x9')](config[_0x755d('0x8')],{'host':_0x755d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x755d('0x8')]));require(_0x755d('0xb'))['register'](socket);function respondWithRpcPromise(_0x5d7ac2,_0x4d488b,_0x17b1c0){return new BPromise(function(_0xf84db8,_0xf2a002){return client['request'](_0x5d7ac2,_0x17b1c0)['then'](function(_0x1c3a8b){logger[_0x755d('0xc')](_0x755d('0xd'),_0x4d488b,_0x755d('0xe'));logger[_0x755d('0xf')](_0x755d('0x10'),_0x4d488b,_0x755d('0xe'),JSON['stringify'](_0x1c3a8b));if(_0x1c3a8b['error']){if(_0x1c3a8b[_0x755d('0x11')][_0x755d('0x12')]===0x1f4){logger[_0x755d('0x11')](_0x755d('0xd'),_0x4d488b,_0x1c3a8b[_0x755d('0x11')][_0x755d('0x13')]);return _0xf2a002(_0x1c3a8b[_0x755d('0x11')][_0x755d('0x13')]);}logger[_0x755d('0x11')](_0x755d('0xd'),_0x4d488b,_0x1c3a8b[_0x755d('0x11')][_0x755d('0x13')]);return _0xf84db8(_0x1c3a8b[_0x755d('0x11')][_0x755d('0x13')]);}else{logger[_0x755d('0xc')](_0x755d('0xd'),_0x4d488b,'request\x20sent');_0xf84db8(_0x1c3a8b[_0x755d('0x14')]['message']);}})[_0x755d('0x15')](function(_0x3cee83){logger[_0x755d('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d488b,_0x3cee83);_0xf2a002(_0x3cee83);});});}exports[_0x755d('0x16')]=function(_0x588db5){var _0x539acf=this;return new Promise(function(_0x345cd9,_0x58cc0b){return db[_0x755d('0x17')][_0x755d('0x18')]({'raw':_0x588db5['options']?_0x588db5['options'][_0x755d('0x19')]===undefined?!![]:![]:!![],'where':_0x588db5[_0x755d('0x1a')]?_0x588db5[_0x755d('0x1a')][_0x755d('0x1b')]||null:null,'attributes':_0x588db5[_0x755d('0x1a')]?_0x588db5[_0x755d('0x1a')]['attributes']||null:null,'limit':_0x588db5[_0x755d('0x1a')]?_0x588db5['options'][_0x755d('0x1c')]||null:null,'include':_0x588db5[_0x755d('0x1a')]?_0x588db5[_0x755d('0x1a')][_0x755d('0x1d')]?_[_0x755d('0x1e')](_0x588db5[_0x755d('0x1a')][_0x755d('0x1d')],function(_0x2c057d){return{'model':db[_0x2c057d[_0x755d('0x1f')]],'as':_0x2c057d['as'],'attributes':_0x2c057d['attributes'],'include':_0x2c057d['include']?_['map'](_0x2c057d[_0x755d('0x1d')],function(_0x2c325b){return{'model':db[_0x2c325b[_0x755d('0x1f')]],'as':_0x2c325b['as'],'attributes':_0x2c325b['attributes'],'include':_0x2c325b['include']?_[_0x755d('0x1e')](_0x2c325b[_0x755d('0x1d')],function(_0x5b0952){return{'model':db[_0x5b0952[_0x755d('0x1f')]],'as':_0x5b0952['as'],'attributes':_0x5b0952[_0x755d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x755d('0x21')](function(_0x1bb519){logger[_0x755d('0xc')](_0x755d('0x16'),_0x588db5);logger[_0x755d('0xf')](_0x755d('0x16'),_0x588db5,JSON['stringify'](_0x1bb519));_0x345cd9(_0x1bb519);})[_0x755d('0x15')](function(_0x46c2ba){logger['error'](_0x755d('0x16'),_0x46c2ba[_0x755d('0x13')],_0x588db5);_0x58cc0b(_0x539acf[_0x755d('0x11')](0x1f4,_0x46c2ba[_0x755d('0x13')]));});});};exports[_0x755d('0x22')]=function(_0x37fe7e){var _0x4446e0=this;return new Promise(function(_0x1dce7a,_0x1c2287){return db[_0x755d('0x17')][_0x755d('0x23')](_0x37fe7e[_0x755d('0x24')],{'raw':_0x37fe7e[_0x755d('0x1a')]?_0x37fe7e[_0x755d('0x1a')][_0x755d('0x19')]===undefined?!![]:![]:!![]})[_0x755d('0x21')](function(_0x497138){logger['info']('CreateVoiceQueueReport',_0x37fe7e);logger[_0x755d('0xf')](_0x755d('0x22'),_0x37fe7e,JSON[_0x755d('0x25')](_0x497138));_0x1dce7a(_0x497138);})[_0x755d('0x15')](function(_0x1d328d){logger[_0x755d('0x11')](_0x755d('0x22'),_0x1d328d['message'],_0x37fe7e);_0x1c2287(_0x4446e0[_0x755d('0x11')](0x1f4,_0x1d328d[_0x755d('0x13')]));});});};exports['UpdateVoiceQueueReport']=function(_0x41da5e){var _0x4c2f6a=this;return new Promise(function(_0x288943,_0x89f1c7){return db['VoiceQueueReport']['update'](_0x41da5e['body'],{'raw':_0x41da5e[_0x755d('0x1a')]?_0x41da5e[_0x755d('0x1a')][_0x755d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41da5e['options']?_0x41da5e[_0x755d('0x1a')][_0x755d('0x1b')]||null:null,'attributes':_0x41da5e[_0x755d('0x1a')]?_0x41da5e[_0x755d('0x1a')][_0x755d('0x20')]||null:null,'limit':_0x41da5e[_0x755d('0x1a')]?_0x41da5e[_0x755d('0x1a')][_0x755d('0x1c')]||null:null})[_0x755d('0x21')](function(_0x1822a8){logger[_0x755d('0xc')](_0x755d('0x26'),_0x41da5e);logger[_0x755d('0xf')]('UpdateVoiceQueueReport',_0x41da5e,JSON['stringify'](_0x1822a8));_0x288943(_0x1822a8);})['catch'](function(_0x251387){logger[_0x755d('0x11')](_0x755d('0x26'),_0x251387[_0x755d('0x13')],_0x41da5e);_0x89f1c7(_0x4c2f6a[_0x755d('0x11')](0x1f4,_0x251387[_0x755d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 1fe9a0f..2cb9774 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 _0xdad2=['save','remove','register','voiceQueueReport:'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xdad2,0x14c));var _0x2dad=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdad2[_0x4a9fb1];return _0x348672;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2dad('0x0'),_0x2dad('0x1'),'update'];function createListener(_0x22b0a0,_0x15946a){return function(_0x3988ca){_0x15946a['emit'](_0x22b0a0,_0x3988ca);};}function removeListener(_0x3212a5,_0x1437b9){return function(){VoiceQueueReportEvents['removeListener'](_0x3212a5,_0x1437b9);};}exports[_0x2dad('0x2')]=function(_0x36a054){for(var _0x27ca04=0x0,_0xf0022b=events['length'];_0x27ca04<_0xf0022b;_0x27ca04++){var _0x5b6aa2=events[_0x27ca04];var _0x217e41=createListener(_0x2dad('0x3')+_0x5b6aa2,_0x36a054);VoiceQueueReportEvents['on'](_0x5b6aa2,_0x217e41);}}; \ No newline at end of file +var _0x02a7=['length','voiceQueueReport:','save','emit','removeListener'];(function(_0x481bc6,_0x469246){var _0x23ee42=function(_0x259180){while(--_0x259180){_0x481bc6['push'](_0x481bc6['shift']());}};_0x23ee42(++_0x469246);}(_0x02a7,0x7a));var _0x702a=function(_0x491456,_0x168d63){_0x491456=_0x491456-0x0;var _0x5242be=_0x02a7[_0x491456];return _0x5242be;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x702a('0x0'),'remove','update'];function createListener(_0x30b64d,_0x30573e){return function(_0x325874){_0x30573e[_0x702a('0x1')](_0x30b64d,_0x325874);};}function removeListener(_0x4612ca,_0x1fc26b){return function(){VoiceQueueReportEvents[_0x702a('0x2')](_0x4612ca,_0x1fc26b);};}exports['register']=function(_0x1bcfe5){for(var _0x5b7d8c=0x0,_0x26b25e=events[_0x702a('0x3')];_0x5b7d8c<_0x26b25e;_0x5b7d8c++){var _0x3f2954=events[_0x5b7d8c];var _0x161dee=createListener(_0x702a('0x4')+_0x3f2954,_0x1bcfe5);VoiceQueueReportEvents['on'](_0x3f2954,_0x161dee);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 815338e..39c8bb3 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 _0x0fca=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x0fca,0x185));var _0xa0fc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0fca[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xa0fc('0x0'));var util=require(_0xa0fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa0fc('0x2'));var router=express[_0xa0fc('0x3')]();var fs_extra=require(_0xa0fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0fc('0x5'));var config=require(_0xa0fc('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xa0fc('0x7')]('/',auth[_0xa0fc('0x8')](),controller[_0xa0fc('0x9')]);router[_0xa0fc('0x7')](_0xa0fc('0xa'),auth[_0xa0fc('0x8')](),controller[_0xa0fc('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa0fc('0xc')]);router[_0xa0fc('0xd')]('/:id',auth[_0xa0fc('0x8')](),controller[_0xa0fc('0xe')]);router['delete']('/:id',auth[_0xa0fc('0x8')](),controller[_0xa0fc('0xf')]);module[_0xa0fc('0x10')]=router; \ No newline at end of file +var _0x1841=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0x1841,0xdf));var _0x1184=function(_0x44ccf0,_0x446087){_0x44ccf0=_0x44ccf0-0x0;var _0x101f26=_0x1841[_0x44ccf0];return _0x101f26;};'use strict';var multer=require('multer');var util=require(_0x1184('0x0'));var path=require(_0x1184('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1184('0x2')]();var fs_extra=require(_0x1184('0x3'));var auth=require(_0x1184('0x4'));var interaction=require(_0x1184('0x5'));var config=require(_0x1184('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0x1184('0x7')]('/',auth[_0x1184('0x8')](),controller[_0x1184('0x9')]);router[_0x1184('0x7')](_0x1184('0xa'),auth[_0x1184('0x8')](),controller[_0x1184('0xb')]);router[_0x1184('0xc')]('/',auth[_0x1184('0x8')](),controller[_0x1184('0xd')]);router[_0x1184('0xe')](_0x1184('0xa'),auth[_0x1184('0x8')](),controller[_0x1184('0xf')]);router[_0x1184('0x10')](_0x1184('0xa'),auth[_0x1184('0x8')](),controller[_0x1184('0x11')]);module[_0x1184('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index d185f67..5979c39 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 _0xbcbf=['STRING','DATE','moment'];(function(_0x315350,_0x5c6d62){var _0x52a974=function(_0x104adb){while(--_0x104adb){_0x315350['push'](_0x315350['shift']());}};_0x52a974(++_0x5c6d62);}(_0xbcbf,0x16a));var _0xfbcb=function(_0xaabe58,_0x3ca95a){_0xaabe58=_0xaabe58-0x0;var _0x4d8562=_0xbcbf[_0xaabe58];return _0x4d8562;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfbcb('0x0'));module['exports']={'time':{'type':Sequelize[_0xfbcb('0x1')]},'callid':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfbcb('0x2')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xaf44=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x51c360,_0x1d9d29){var _0x33dc40=function(_0x2ee072){while(--_0x2ee072){_0x51c360['push'](_0x51c360['shift']());}};_0x33dc40(++_0x1d9d29);}(_0xaf44,0xf4));var _0x4af4=function(_0x5e909d,_0x274e0d){_0x5e909d=_0x5e909d-0x0;var _0x24d4b5=_0xaf44[_0x5e909d];return _0x24d4b5;};'use strict';var Sequelize=require(_0x4af4('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x4af4('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4af4('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4af4('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4af4('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4af4('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4af4('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4af4('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4af4('0x2')],'allowNull':![],'defaultValue':Sequelize[_0x4af4('0x3')](_0x4af4('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f2804f3..d5e8df4 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 _0xc161=['VoiceQueuesLog','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','create','update','body','find','bluebird','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','stack','name','send','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc161,0xec));var _0x1c16=function(_0x5df532,_0x14cbbe){_0x5df532=_0x5df532-0x0;var _0x143974=_0xc161[_0x5df532];return _0x143974;};'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(_0x1c16('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c16('0x1'));var sox=require(_0x1c16('0x2'));var csv=require(_0x1c16('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c16('0x4'));var _=require(_0x1c16('0x5'));var squel=require(_0x1c16('0x6'));var crypto=require('crypto');var jsforce=require(_0x1c16('0x7'));var deskjs=require(_0x1c16('0x8'));var toCsv=require(_0x1c16('0x3'));var querystring=require(_0x1c16('0x9'));var Papa=require(_0x1c16('0xa'));var Redis=require(_0x1c16('0xb'));var authService=require(_0x1c16('0xc'));var qs=require(_0x1c16('0xd'));var as=require(_0x1c16('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c16('0xf'))(_0x1c16('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1c16('0x11'));var db=require(_0x1c16('0x12'))['db'];function respondWithStatusCode(_0x158663,_0x25cd46){_0x25cd46=_0x25cd46||0xcc;return function(_0x35bb07){if(_0x35bb07){return _0x158663[_0x1c16('0x13')](_0x25cd46);}return _0x158663[_0x1c16('0x14')](_0x25cd46)[_0x1c16('0x15')]();};}function respondWithResult(_0x5cf19d,_0x5d958e){_0x5d958e=_0x5d958e||0xc8;return function(_0x367ecc){if(_0x367ecc){return _0x5cf19d[_0x1c16('0x14')](_0x5d958e)[_0x1c16('0x16')](_0x367ecc);}};}function respondWithFilteredResult(_0x3e1683,_0x125800){return function(_0x3feb05){if(_0x3feb05){var _0x328f7a=typeof _0x125800[_0x1c16('0x17')]===_0x1c16('0x18')&&typeof _0x125800['limit']===_0x1c16('0x18');var _0x3b193d=_0x3feb05[_0x1c16('0x19')];var _0x1b61bb=_0x328f7a?0x0:_0x125800['offset'];var _0x4fcda3=_0x328f7a?_0x3feb05['count']:_0x125800[_0x1c16('0x17')]+_0x125800['limit'];var _0x45d403;if(_0x4fcda3>=_0x3b193d){_0x4fcda3=_0x3b193d;_0x45d403=0xc8;}else{_0x45d403=0xce;}_0x3e1683[_0x1c16('0x14')](_0x45d403);return _0x3e1683['set'](_0x1c16('0x1a'),_0x1b61bb+'-'+_0x4fcda3+'/'+_0x3b193d)[_0x1c16('0x16')](_0x3feb05);}return null;};}function patchUpdates(_0x50c1b8){return function(_0x207fbe){try{jsonpatch[_0x1c16('0x1b')](_0x207fbe,_0x50c1b8,!![]);}catch(_0xea76db){return BPromise['reject'](_0xea76db);}return _0x207fbe[_0x1c16('0x1c')]();};}function saveUpdates(_0x5f2140,_0xa8929e){return function(_0x4782c7){if(_0x4782c7){return _0x4782c7['update'](_0x5f2140)[_0x1c16('0x1d')](function(_0x2662d0){return _0x2662d0;});}return null;};}function removeEntity(_0x1aa909,_0x3eb7e5){return function(_0x1468bf){if(_0x1468bf){return _0x1468bf[_0x1c16('0x1e')]()[_0x1c16('0x1d')](function(){_0x1aa909[_0x1c16('0x14')](0xcc)[_0x1c16('0x15')]();});}};}function handleEntityNotFound(_0x2d39b3,_0x1e82a2){return function(_0x5bad77){if(!_0x5bad77){_0x2d39b3['sendStatus'](0x194);}return _0x5bad77;};}function handleError(_0x1d5042,_0x396880){_0x396880=_0x396880||0x1f4;return function(_0x5e2f14){logger['error'](_0x5e2f14[_0x1c16('0x1f')]);if(_0x5e2f14[_0x1c16('0x20')]){delete _0x5e2f14[_0x1c16('0x20')];}_0x1d5042[_0x1c16('0x14')](_0x396880)[_0x1c16('0x21')](_0x5e2f14);};}exports[_0x1c16('0x22')]=function(_0x69eafe,_0x491c58){var _0x81e8b6={},_0x28d1ae={},_0x1c67f3={'count':0x0,'rows':[]};var _0x4e137f=_[_0x1c16('0x23')](db[_0x1c16('0x24')][_0x1c16('0x25')],function(_0x3b308b){return{'name':_0x3b308b['fieldName'],'type':_0x3b308b['type'][_0x1c16('0x26')]};});_0x28d1ae[_0x1c16('0x27')]=_['map'](_0x4e137f,_0x1c16('0x20'));_0x28d1ae[_0x1c16('0x28')]=_[_0x1c16('0x29')](_0x69eafe[_0x1c16('0x28')]);_0x28d1ae[_0x1c16('0x2a')]=_[_0x1c16('0x2b')](_0x28d1ae[_0x1c16('0x27')],_0x28d1ae[_0x1c16('0x28')]);_0x81e8b6[_0x1c16('0x2c')]=_['intersection'](_0x28d1ae[_0x1c16('0x27')],qs[_0x1c16('0x2d')](_0x69eafe['query'][_0x1c16('0x2d')]));_0x81e8b6[_0x1c16('0x2c')]=_0x81e8b6[_0x1c16('0x2c')][_0x1c16('0x2e')]?_0x81e8b6[_0x1c16('0x2c')]:_0x28d1ae[_0x1c16('0x27')];if(!_0x69eafe['query'][_0x1c16('0x2f')](_0x1c16('0x30'))){_0x81e8b6[_0x1c16('0x31')]=qs[_0x1c16('0x31')](_0x69eafe['query'][_0x1c16('0x31')]);_0x81e8b6['offset']=qs['offset'](_0x69eafe[_0x1c16('0x28')][_0x1c16('0x17')]);}_0x81e8b6[_0x1c16('0x32')]=qs[_0x1c16('0x33')](_0x69eafe[_0x1c16('0x28')][_0x1c16('0x33')]);_0x81e8b6[_0x1c16('0x34')]=qs[_0x1c16('0x2a')](_[_0x1c16('0x35')](_0x69eafe['query'],_0x28d1ae[_0x1c16('0x2a')]),_0x4e137f);if(_0x69eafe[_0x1c16('0x28')][_0x1c16('0x36')]){_0x81e8b6[_0x1c16('0x34')]=_[_0x1c16('0x37')](_0x81e8b6[_0x1c16('0x34')],{'$or':_[_0x1c16('0x23')](_0x4e137f,function(_0x2328e1){if(_0x2328e1[_0x1c16('0x38')]!==_0x1c16('0x39')){var _0x5e9de3={};_0x5e9de3[_0x2328e1[_0x1c16('0x20')]]={'$like':'%'+_0x69eafe[_0x1c16('0x28')]['filter']+'%'};return _0x5e9de3;}})});}_0x81e8b6=_['merge']({},_0x81e8b6,_0x69eafe[_0x1c16('0x3a')]);var _0x41e1f7={'where':_0x81e8b6[_0x1c16('0x34')]};return db[_0x1c16('0x24')][_0x1c16('0x19')](_0x41e1f7)[_0x1c16('0x1d')](function(_0x3a7568){_0x1c67f3[_0x1c16('0x19')]=_0x3a7568;if(_0x69eafe[_0x1c16('0x28')][_0x1c16('0x3b')]){_0x81e8b6[_0x1c16('0x3c')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x81e8b6);})[_0x1c16('0x1d')](function(_0x1c7a88){_0x1c67f3['rows']=_0x1c7a88;return _0x1c67f3;})[_0x1c16('0x1d')](respondWithFilteredResult(_0x491c58,_0x81e8b6))[_0x1c16('0x3d')](handleError(_0x491c58,null));};exports[_0x1c16('0x3e')]=function(_0x1e4a33,_0x4ee9a8){var _0x41183b={'raw':!![],'where':{'id':_0x1e4a33[_0x1c16('0x3f')]['id']}},_0x4fff9e={};_0x4fff9e[_0x1c16('0x27')]=_['keys'](db[_0x1c16('0x24')][_0x1c16('0x25')]);_0x4fff9e[_0x1c16('0x28')]=_[_0x1c16('0x29')](_0x1e4a33[_0x1c16('0x28')]);_0x4fff9e[_0x1c16('0x2a')]=_[_0x1c16('0x2b')](_0x4fff9e['model'],_0x4fff9e[_0x1c16('0x28')]);_0x41183b[_0x1c16('0x2c')]=_['intersection'](_0x4fff9e[_0x1c16('0x27')],qs['fields'](_0x1e4a33[_0x1c16('0x28')][_0x1c16('0x2d')]));_0x41183b[_0x1c16('0x2c')]=_0x41183b[_0x1c16('0x2c')][_0x1c16('0x2e')]?_0x41183b[_0x1c16('0x2c')]:_0x4fff9e[_0x1c16('0x27')];if(_0x1e4a33[_0x1c16('0x28')]['includeAll']){_0x41183b[_0x1c16('0x3c')]=[{'all':!![]}];}_0x41183b=_[_0x1c16('0x37')]({},_0x41183b,_0x1e4a33[_0x1c16('0x3a')]);return db['VoiceQueuesLog']['find'](_0x41183b)['then'](handleEntityNotFound(_0x4ee9a8,null))[_0x1c16('0x1d')](respondWithResult(_0x4ee9a8,null))[_0x1c16('0x3d')](handleError(_0x4ee9a8,null));};exports['create']=function(_0x56d2f2,_0x3fc539){return db['VoiceQueuesLog'][_0x1c16('0x40')](_0x56d2f2['body'],{})[_0x1c16('0x1d')](respondWithResult(_0x3fc539,0xc9))[_0x1c16('0x3d')](handleError(_0x3fc539,null));};exports[_0x1c16('0x41')]=function(_0x55b3b9,_0x821f98){if(_0x55b3b9[_0x1c16('0x42')]['id']){delete _0x55b3b9[_0x1c16('0x42')]['id'];}return db[_0x1c16('0x24')][_0x1c16('0x43')]({'where':{'id':_0x55b3b9[_0x1c16('0x3f')]['id']}})['then'](handleEntityNotFound(_0x821f98,null))[_0x1c16('0x1d')](saveUpdates(_0x55b3b9[_0x1c16('0x42')],null))[_0x1c16('0x1d')](respondWithResult(_0x821f98,null))[_0x1c16('0x3d')](handleError(_0x821f98,null));};exports[_0x1c16('0x1e')]=function(_0x10d9b9,_0x1acbeb){return db[_0x1c16('0x24')][_0x1c16('0x43')]({'where':{'id':_0x10d9b9[_0x1c16('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1acbeb,null))[_0x1c16('0x1d')](removeEntity(_0x1acbeb,null))[_0x1c16('0x3d')](handleError(_0x1acbeb,null));}; \ No newline at end of file +var _0x2876=['request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','then','destroy','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','findAll','rows','catch','show','params','includeAll','body','update','find','zip-dir'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2876,0x162));var _0x6287=function(_0x22dd2b,_0x3b116a){_0x22dd2b=_0x22dd2b-0x0;var _0x2c816c=_0x2876[_0x22dd2b];return _0x2c816c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6287('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6287('0x1'));var moment=require(_0x6287('0x2'));var BPromise=require(_0x6287('0x3'));var Mustache=require(_0x6287('0x4'));var util=require(_0x6287('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6287('0x6'));var ejs=require(_0x6287('0x7'));var fs=require('fs');var fs_extra=require(_0x6287('0x8'));var _=require(_0x6287('0x9'));var squel=require(_0x6287('0xa'));var crypto=require(_0x6287('0xb'));var jsforce=require(_0x6287('0xc'));var deskjs=require(_0x6287('0xd'));var toCsv=require(_0x6287('0x6'));var querystring=require(_0x6287('0xe'));var Papa=require(_0x6287('0xf'));var Redis=require('ioredis');var authService=require(_0x6287('0x10'));var qs=require(_0x6287('0x11'));var as=require(_0x6287('0x12'));var hardwareService=require(_0x6287('0x13'));var logger=require('../../config/logger')(_0x6287('0x14'));var utils=require(_0x6287('0x15'));var config=require(_0x6287('0x16'));var licenseUtil=require(_0x6287('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12b459,_0x56b001){_0x56b001=_0x56b001||0xcc;return function(_0x1f1c60){if(_0x1f1c60){return _0x12b459[_0x6287('0x18')](_0x56b001);}return _0x12b459[_0x6287('0x19')](_0x56b001)[_0x6287('0x1a')]();};}function respondWithResult(_0x564a47,_0x3a653f){_0x3a653f=_0x3a653f||0xc8;return function(_0x4b6f2d){if(_0x4b6f2d){return _0x564a47[_0x6287('0x19')](_0x3a653f)['json'](_0x4b6f2d);}};}function respondWithFilteredResult(_0x4539f6,_0x20f48e){return function(_0x258eee){if(_0x258eee){var _0x3bc0fc=typeof _0x20f48e[_0x6287('0x1b')]===_0x6287('0x1c')&&typeof _0x20f48e[_0x6287('0x1d')]===_0x6287('0x1c');var _0x49a36a=_0x258eee[_0x6287('0x1e')];var _0x516d97=_0x3bc0fc?0x0:_0x20f48e['offset'];var _0x7ae99f=_0x3bc0fc?_0x258eee[_0x6287('0x1e')]:_0x20f48e[_0x6287('0x1b')]+_0x20f48e['limit'];var _0x15995e;if(_0x7ae99f>=_0x49a36a){_0x7ae99f=_0x49a36a;_0x15995e=0xc8;}else{_0x15995e=0xce;}_0x4539f6['status'](_0x15995e);return _0x4539f6[_0x6287('0x1f')]('Content-Range',_0x516d97+'-'+_0x7ae99f+'/'+_0x49a36a)[_0x6287('0x20')](_0x258eee);}return null;};}function patchUpdates(_0x1d33b0){return function(_0x44f4db){try{jsonpatch['apply'](_0x44f4db,_0x1d33b0,!![]);}catch(_0x1df75c){return BPromise[_0x6287('0x21')](_0x1df75c);}return _0x44f4db[_0x6287('0x22')]();};}function saveUpdates(_0x107365,_0x561e37){return function(_0x37f1b6){if(_0x37f1b6){return _0x37f1b6['update'](_0x107365)[_0x6287('0x23')](function(_0x5e547e){return _0x5e547e;});}return null;};}function removeEntity(_0x427599,_0x506f12){return function(_0x489059){if(_0x489059){return _0x489059[_0x6287('0x24')]()[_0x6287('0x23')](function(){_0x427599[_0x6287('0x19')](0xcc)[_0x6287('0x1a')]();});}};}function handleEntityNotFound(_0x152189,_0x39175b){return function(_0x51a1f7){if(!_0x51a1f7){_0x152189[_0x6287('0x18')](0x194);}return _0x51a1f7;};}function handleError(_0x17aa0b,_0x5130e0){_0x5130e0=_0x5130e0||0x1f4;return function(_0x1eaa2e){logger[_0x6287('0x25')](_0x1eaa2e['stack']);if(_0x1eaa2e[_0x6287('0x26')]){delete _0x1eaa2e[_0x6287('0x26')];}_0x17aa0b[_0x6287('0x19')](_0x5130e0)[_0x6287('0x27')](_0x1eaa2e);};}exports[_0x6287('0x28')]=function(_0x2559a0,_0x39c664){var _0x23f66b={},_0x35c0be={},_0x52cc79={'count':0x0,'rows':[]};var _0x5a92ec=_[_0x6287('0x29')](db[_0x6287('0x2a')][_0x6287('0x2b')],function(_0x477452){return{'name':_0x477452[_0x6287('0x2c')],'type':_0x477452[_0x6287('0x2d')][_0x6287('0x2e')]};});_0x35c0be[_0x6287('0x2f')]=_[_0x6287('0x29')](_0x5a92ec,_0x6287('0x26'));_0x35c0be['query']=_[_0x6287('0x30')](_0x2559a0['query']);_0x35c0be[_0x6287('0x31')]=_[_0x6287('0x32')](_0x35c0be[_0x6287('0x2f')],_0x35c0be['query']);_0x23f66b['attributes']=_[_0x6287('0x32')](_0x35c0be['model'],qs[_0x6287('0x33')](_0x2559a0[_0x6287('0x34')][_0x6287('0x33')]));_0x23f66b['attributes']=_0x23f66b[_0x6287('0x35')][_0x6287('0x36')]?_0x23f66b[_0x6287('0x35')]:_0x35c0be[_0x6287('0x2f')];if(!_0x2559a0['query'][_0x6287('0x37')](_0x6287('0x38'))){_0x23f66b[_0x6287('0x1d')]=qs[_0x6287('0x1d')](_0x2559a0[_0x6287('0x34')]['limit']);_0x23f66b['offset']=qs['offset'](_0x2559a0['query'][_0x6287('0x1b')]);}_0x23f66b[_0x6287('0x39')]=qs['sort'](_0x2559a0[_0x6287('0x34')]['sort']);_0x23f66b[_0x6287('0x3a')]=qs[_0x6287('0x31')](_[_0x6287('0x3b')](_0x2559a0['query'],_0x35c0be['filters']),_0x5a92ec);if(_0x2559a0['query'][_0x6287('0x3c')]){_0x23f66b[_0x6287('0x3a')]=_[_0x6287('0x3d')](_0x23f66b[_0x6287('0x3a')],{'$or':_['map'](_0x5a92ec,function(_0xc3da0a){if(_0xc3da0a['type']!=='VIRTUAL'){var _0x1fc545={};_0x1fc545[_0xc3da0a[_0x6287('0x26')]]={'$like':'%'+_0x2559a0[_0x6287('0x34')][_0x6287('0x3c')]+'%'};return _0x1fc545;}})});}_0x23f66b=_[_0x6287('0x3d')]({},_0x23f66b,_0x2559a0['options']);var _0x36ee6c={'where':_0x23f66b['where']};return db['VoiceQueuesLog'][_0x6287('0x1e')](_0x36ee6c)[_0x6287('0x23')](function(_0x374486){_0x52cc79[_0x6287('0x1e')]=_0x374486;if(_0x2559a0[_0x6287('0x34')]['includeAll']){_0x23f66b['include']=[{'all':!![]}];}return db[_0x6287('0x2a')][_0x6287('0x3e')](_0x23f66b);})[_0x6287('0x23')](function(_0x52606d){_0x52cc79[_0x6287('0x3f')]=_0x52606d;return _0x52cc79;})['then'](respondWithFilteredResult(_0x39c664,_0x23f66b))[_0x6287('0x40')](handleError(_0x39c664,null));};exports[_0x6287('0x41')]=function(_0x337c55,_0x3ff9c3){var _0x2898ed={'raw':!![],'where':{'id':_0x337c55[_0x6287('0x42')]['id']}},_0x167d53={};_0x167d53['model']=_[_0x6287('0x30')](db[_0x6287('0x2a')][_0x6287('0x2b')]);_0x167d53[_0x6287('0x34')]=_[_0x6287('0x30')](_0x337c55[_0x6287('0x34')]);_0x167d53[_0x6287('0x31')]=_[_0x6287('0x32')](_0x167d53[_0x6287('0x2f')],_0x167d53['query']);_0x2898ed['attributes']=_[_0x6287('0x32')](_0x167d53['model'],qs[_0x6287('0x33')](_0x337c55['query']['fields']));_0x2898ed[_0x6287('0x35')]=_0x2898ed[_0x6287('0x35')][_0x6287('0x36')]?_0x2898ed[_0x6287('0x35')]:_0x167d53[_0x6287('0x2f')];if(_0x337c55[_0x6287('0x34')][_0x6287('0x43')]){_0x2898ed['include']=[{'all':!![]}];}_0x2898ed=_['merge']({},_0x2898ed,_0x337c55['options']);return db[_0x6287('0x2a')]['find'](_0x2898ed)[_0x6287('0x23')](handleEntityNotFound(_0x3ff9c3,null))['then'](respondWithResult(_0x3ff9c3,null))['catch'](handleError(_0x3ff9c3,null));};exports['create']=function(_0xe73a6d,_0x376c85){return db[_0x6287('0x2a')]['create'](_0xe73a6d[_0x6287('0x44')],{})[_0x6287('0x23')](respondWithResult(_0x376c85,0xc9))[_0x6287('0x40')](handleError(_0x376c85,null));};exports[_0x6287('0x45')]=function(_0x312835,_0x45e820){if(_0x312835[_0x6287('0x44')]['id']){delete _0x312835[_0x6287('0x44')]['id'];}return db[_0x6287('0x2a')][_0x6287('0x46')]({'where':{'id':_0x312835['params']['id']}})[_0x6287('0x23')](handleEntityNotFound(_0x45e820,null))[_0x6287('0x23')](saveUpdates(_0x312835[_0x6287('0x44')],null))[_0x6287('0x23')](respondWithResult(_0x45e820,null))[_0x6287('0x40')](handleError(_0x45e820,null));};exports[_0x6287('0x24')]=function(_0x596213,_0x49f0d5){return db[_0x6287('0x2a')][_0x6287('0x46')]({'where':{'id':_0x596213['params']['id']}})[_0x6287('0x23')](handleEntityNotFound(_0x49f0d5,null))[_0x6287('0x23')](removeEntity(_0x49f0d5,null))[_0x6287('0x40')](handleError(_0x49f0d5,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a6978ac..134e0b6 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 _0xe0eb=['../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x12ac87,_0xd7c597){var _0x2c5e2c=function(_0x54ca16){while(--_0x54ca16){_0x12ac87['push'](_0x12ac87['shift']());}};_0x2c5e2c(++_0xd7c597);}(_0xe0eb,0x71));var _0xbe0e=function(_0x2cf7dd,_0x26172a){_0x2cf7dd=_0x2cf7dd-0x0;var _0x20450a=_0xe0eb[_0x2cf7dd];return _0x20450a;};'use strict';var _=require(_0xbe0e('0x0'));var util=require(_0xbe0e('0x1'));var logger=require('../../config/logger')(_0xbe0e('0x2'));var moment=require(_0xbe0e('0x3'));var BPromise=require(_0xbe0e('0x4'));var rp=require(_0xbe0e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe0e('0x6'));var config=require(_0xbe0e('0x7'));var attributes=require(_0xbe0e('0x8'));module[_0xbe0e('0x9')]=function(_0x4d851c,_0x4d94ed){return _0x4d851c['define'](_0xbe0e('0xa'),attributes,{'tableName':_0xbe0e('0xb'),'paranoid':![],'indexes':[{'name':_0xbe0e('0xc'),'fields':[_0xbe0e('0xd'),_0xbe0e('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6d4f=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','moment'];(function(_0x4a8471,_0x3a4ff2){var _0x4fffe9=function(_0xc2e1fe){while(--_0xc2e1fe){_0x4a8471['push'](_0x4a8471['shift']());}};_0x4fffe9(++_0x3a4ff2);}(_0x6d4f,0xee));var _0xf6d4=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x6d4f[_0x83420c];return _0x1057d7;};'use strict';var _=require(_0xf6d4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf6d4('0x1'));var BPromise=require(_0xf6d4('0x2'));var rp=require(_0xf6d4('0x3'));var fs=require('fs');var path=require(_0xf6d4('0x4'));var rimraf=require(_0xf6d4('0x5'));var config=require(_0xf6d4('0x6'));var attributes=require(_0xf6d4('0x7'));module[_0xf6d4('0x8')]=function(_0xac0926,_0x40088e){return _0xac0926[_0xf6d4('0x9')](_0xf6d4('0xa'),attributes,{'tableName':_0xf6d4('0xb'),'paranoid':![],'indexes':[{'name':_0xf6d4('0xc'),'fields':[_0xf6d4('0xd'),_0xf6d4('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index f8dab31..1293f15 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 _0x6a17=['error','message','VoiceQueuesLog,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3db789,_0x4bb3fc){var _0x471bb7=function(_0x2e508f){while(--_0x2e508f){_0x3db789['push'](_0x3db789['shift']());}};_0x471bb7(++_0x4bb3fc);}(_0x6a17,0x1e8));var _0x76a1=function(_0x2a445d,_0x174504){_0x2a445d=_0x2a445d-0x0;var _0x34ddae=_0x6a17[_0x2a445d];return _0x34ddae;};'use strict';var _=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var moment=require(_0x76a1('0x2'));var BPromise=require(_0x76a1('0x3'));var rs=require(_0x76a1('0x4'));var fs=require('fs');var Redis=require(_0x76a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x76a1('0x6'));var logger=require(_0x76a1('0x7'))(_0x76a1('0x8'));var config=require(_0x76a1('0x9'));var jayson=require(_0x76a1('0xa'));var client=jayson[_0x76a1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aac0d,_0x1e2238,_0xc3f6a3){return new BPromise(function(_0x5849f5,_0x55bce5){return client[_0x76a1('0xc')](_0x3aac0d,_0xc3f6a3)[_0x76a1('0xd')](function(_0x26efac){logger[_0x76a1('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1e2238,_0x76a1('0xf'));logger['debug'](_0x76a1('0x10'),_0x1e2238,_0x76a1('0xf'),JSON[_0x76a1('0x11')](_0x26efac));if(_0x26efac[_0x76a1('0x12')]){if(_0x26efac['error']['code']===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1e2238,_0x26efac['error'][_0x76a1('0x13')]);return _0x55bce5(_0x26efac[_0x76a1('0x12')][_0x76a1('0x13')]);}logger[_0x76a1('0x12')](_0x76a1('0x14'),_0x1e2238,_0x26efac[_0x76a1('0x12')]['message']);return _0x5849f5(_0x26efac['error'][_0x76a1('0x13')]);}else{logger[_0x76a1('0xe')](_0x76a1('0x14'),_0x1e2238,_0x76a1('0xf'));_0x5849f5(_0x26efac[_0x76a1('0x15')][_0x76a1('0x13')]);}})['catch'](function(_0x3a243e){logger['error'](_0x76a1('0x14'),_0x1e2238,_0x3a243e);_0x55bce5(_0x3a243e);});});} \ No newline at end of file +var _0x4731=['util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x55b824,_0x3f0624){var _0x100ff7=function(_0x42cdab){while(--_0x42cdab){_0x55b824['push'](_0x55b824['shift']());}};_0x100ff7(++_0x3f0624);}(_0x4731,0xce));var _0x1473=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x4731[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x1473('0x0'));var util=require(_0x1473('0x1'));var moment=require(_0x1473('0x2'));var BPromise=require(_0x1473('0x3'));var rs=require(_0x1473('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1473('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1473('0x6'));var config=require(_0x1473('0x7'));var jayson=require(_0x1473('0x8'));var client=jayson['client'][_0x1473('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c210a,_0x2b5f36,_0x6f4474){return new BPromise(function(_0x332abb,_0x4c3e0c){return client[_0x1473('0xa')](_0x2c210a,_0x6f4474)[_0x1473('0xb')](function(_0x2328a2){logger[_0x1473('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2b5f36,_0x1473('0xd'));logger[_0x1473('0xe')](_0x1473('0xf'),_0x2b5f36,_0x1473('0xd'),JSON[_0x1473('0x10')](_0x2328a2));if(_0x2328a2[_0x1473('0x11')]){if(_0x2328a2[_0x1473('0x11')][_0x1473('0x12')]===0x1f4){logger['error'](_0x1473('0x13'),_0x2b5f36,_0x2328a2[_0x1473('0x11')][_0x1473('0x14')]);return _0x4c3e0c(_0x2328a2[_0x1473('0x11')][_0x1473('0x14')]);}logger['error'](_0x1473('0x13'),_0x2b5f36,_0x2328a2[_0x1473('0x11')][_0x1473('0x14')]);return _0x332abb(_0x2328a2[_0x1473('0x11')][_0x1473('0x14')]);}else{logger['info'](_0x1473('0x13'),_0x2b5f36,'request\x20sent');_0x332abb(_0x2328a2[_0x1473('0x15')][_0x1473('0x14')]);}})[_0x1473('0x16')](function(_0x383006){logger[_0x1473('0x11')](_0x1473('0x13'),_0x2b5f36,_0x383006);_0x4c3e0c(_0x383006);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index e982610..c10ac71 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 _0x1e4e=['put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x1e4e,0x95));var _0xe1e4=function(_0x4ad3b3,_0x3824ac){_0x4ad3b3=_0x4ad3b3-0x0;var _0x2cbd5f=_0x1e4e[_0x4ad3b3];return _0x2cbd5f;};'use strict';var multer=require('multer');var util=require(_0xe1e4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe1e4('0x1'));var router=express[_0xe1e4('0x2')]();var fs_extra=require(_0xe1e4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe1e4('0x4'));var config=require('../../config/environment');var controller=require(_0xe1e4('0x5'));router[_0xe1e4('0x6')]('/',auth[_0xe1e4('0x7')](),controller[_0xe1e4('0x8')]);router[_0xe1e4('0x6')](_0xe1e4('0x9'),auth[_0xe1e4('0x7')](),controller['describe']);router['get'](_0xe1e4('0xa'),auth[_0xe1e4('0x7')](),controller['show']);router[_0xe1e4('0x6')](_0xe1e4('0xb'),auth['isAuthenticated'](),controller[_0xe1e4('0xc')]);router[_0xe1e4('0x6')](_0xe1e4('0xd'),controller[_0xe1e4('0xe')]);router[_0xe1e4('0x6')](_0xe1e4('0xf'),auth[_0xe1e4('0x7')](),controller['downloadTranscribe']);router[_0xe1e4('0x10')]('/',auth[_0xe1e4('0x7')](),controller[_0xe1e4('0x11')]);router[_0xe1e4('0x10')](_0xe1e4('0xf'),auth[_0xe1e4('0x7')](),controller[_0xe1e4('0x12')]);router[_0xe1e4('0x13')](_0xe1e4('0xa'),auth['isAuthenticated'](),controller[_0xe1e4('0x14')]);router[_0xe1e4('0x15')](_0xe1e4('0xa'),auth['isAuthenticated'](),controller[_0xe1e4('0x16')]);module[_0xe1e4('0x17')]=router; \ No newline at end of file +var _0xc4ff=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index','/describe','describe','get','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','/:id','update','destroy','exports','multer','util','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc4ff,0x115));var _0xfc4f=function(_0x4e1216,_0x591de2){_0x4e1216=_0x4e1216-0x0;var _0x423cd8=_0xc4ff[_0x4e1216];return _0x423cd8;};'use strict';var multer=require(_0xfc4f('0x0'));var util=require(_0xfc4f('0x1'));var path=require(_0xfc4f('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc4f('0x3'));var router=express[_0xfc4f('0x4')]();var fs_extra=require(_0xfc4f('0x5'));var auth=require(_0xfc4f('0x6'));var interaction=require(_0xfc4f('0x7'));var config=require('../../config/environment');var controller=require(_0xfc4f('0x8'));router['get']('/',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0xa')]);router['get'](_0xfc4f('0xb'),auth['isAuthenticated'](),controller[_0xfc4f('0xc')]);router[_0xfc4f('0xd')]('/:id',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0xe')]);router[_0xfc4f('0xd')](_0xfc4f('0xf'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x10')]);router['get'](_0xfc4f('0x11'),controller[_0xfc4f('0x12')]);router[_0xfc4f('0xd')](_0xfc4f('0x13'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x14')]);router[_0xfc4f('0x15')]('/',auth['isAuthenticated'](),controller[_0xfc4f('0x16')]);router[_0xfc4f('0x15')](_0xfc4f('0x13'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x17')]);router['put'](_0xfc4f('0x18'),auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x19')]);router['delete']('/:id',auth[_0xfc4f('0x9')](),controller[_0xfc4f('0x1a')]);module[_0xfc4f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index b6317f3..7d251f2 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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 242968a..f19df53 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 _0xfbec=['readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','format','keys','filters','intersection','model','query','attributes','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','fields','length','body','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','download','message','downloads','MD5','sequelize','col','token','$and','push','decryptFile','secrets','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename'];(function(_0x27e498,_0x4507b0){var _0x5c9f86=function(_0x39fb44){while(--_0x39fb44){_0x27e498['push'](_0x27e498['shift']());}};_0x5c9f86(++_0x4507b0);}(_0xfbec,0x1f3));var _0xcfbe=function(_0x153415,_0x750e96){_0x153415=_0x153415-0x0;var _0x3dc629=_0xfbec[_0x153415];return _0x3dc629;};'use strict';var emlformat=require(_0xcfbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfbe('0x1'));var jsonpatch=require(_0xcfbe('0x2'));var rp=require(_0xcfbe('0x3'));var moment=require(_0xcfbe('0x4'));var BPromise=require(_0xcfbe('0x5'));var Mustache=require(_0xcfbe('0x6'));var util=require(_0xcfbe('0x7'));var path=require(_0xcfbe('0x8'));var sox=require(_0xcfbe('0x9'));var csv=require('to-csv');var ejs=require(_0xcfbe('0xa'));var fs=require('fs');var fs_extra=require(_0xcfbe('0xb'));var _=require(_0xcfbe('0xc'));var squel=require(_0xcfbe('0xd'));var crypto=require(_0xcfbe('0xe'));var jsforce=require(_0xcfbe('0xf'));var deskjs=require(_0xcfbe('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcfbe('0x11'));var Papa=require('papaparse');var AWS=require(_0xcfbe('0x12'));var uuidv4=require(_0xcfbe('0x13'));var Redis=require(_0xcfbe('0x14'));var authService=require(_0xcfbe('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xcfbe('0x16'));var hardwareService=require(_0xcfbe('0x17'));var logger=require(_0xcfbe('0x18'))('api');var utils=require(_0xcfbe('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcfbe('0x1a'))['db'];function respondWithStatusCode(_0x34425d,_0x293602){_0x293602=_0x293602||0xcc;return function(_0xe2aab5){if(_0xe2aab5){return _0x34425d[_0xcfbe('0x1b')](_0x293602);}return _0x34425d['status'](_0x293602)[_0xcfbe('0x1c')]();};}function respondWithResult(_0x234b64,_0x5804a4){_0x5804a4=_0x5804a4||0xc8;return function(_0xadab75){if(_0xadab75){return _0x234b64[_0xcfbe('0x1d')](_0x5804a4)[_0xcfbe('0x1e')](_0xadab75);}};}function respondWithFilteredResult(_0x1cc0e2,_0xa7fb09){return function(_0x3f99b1){if(_0x3f99b1){var _0x1ab8a8=typeof _0xa7fb09[_0xcfbe('0x1f')]===_0xcfbe('0x20')&&typeof _0xa7fb09[_0xcfbe('0x21')]===_0xcfbe('0x20');var _0x27c051=_0x3f99b1['count'];var _0x2b01c9=_0x1ab8a8?0x0:_0xa7fb09[_0xcfbe('0x1f')];var _0x3f43fa=_0x1ab8a8?_0x3f99b1['count']:_0xa7fb09['offset']+_0xa7fb09['limit'];var _0x3b6884;if(_0x3f43fa>=_0x27c051){_0x3f43fa=_0x27c051;_0x3b6884=0xc8;}else{_0x3b6884=0xce;}_0x1cc0e2['status'](_0x3b6884);return _0x1cc0e2[_0xcfbe('0x22')](_0xcfbe('0x23'),_0x2b01c9+'-'+_0x3f43fa+'/'+_0x27c051)[_0xcfbe('0x1e')](_0x3f99b1);}return null;};}function patchUpdates(_0x26dcf8){return function(_0x5268c1){try{jsonpatch['apply'](_0x5268c1,_0x26dcf8,!![]);}catch(_0xcd8a12){return BPromise[_0xcfbe('0x24')](_0xcd8a12);}return _0x5268c1[_0xcfbe('0x25')]();};}function saveUpdates(_0xaeeaeb,_0x541832){return function(_0x2d74ed){if(_0x2d74ed){return _0x2d74ed[_0xcfbe('0x26')](_0xaeeaeb)[_0xcfbe('0x27')](function(_0x5bd56a){return _0x5bd56a;});}return null;};}function removeEntity(_0x28d00d,_0x1fb36e){return function(_0x1fe782){if(_0x1fe782){return _0x1fe782[_0xcfbe('0x28')]()[_0xcfbe('0x27')](function(){_0x28d00d[_0xcfbe('0x1d')](0xcc)[_0xcfbe('0x1c')]();});}};}function handleEntityNotFound(_0x558a1b,_0x528237){return function(_0x4630dd){if(!_0x4630dd){_0x558a1b[_0xcfbe('0x1b')](0x194);}return _0x4630dd;};}function handleError(_0x1f669c,_0x7ca45e){_0x7ca45e=_0x7ca45e||0x1f4;return function(_0x39ceba){logger[_0xcfbe('0x29')](_0x39ceba['stack']);if(_0x39ceba[_0xcfbe('0x2a')]){delete _0x39ceba['name'];}_0x1f669c[_0xcfbe('0x1d')](_0x7ca45e)[_0xcfbe('0x2b')](_0x39ceba);};}exports[_0xcfbe('0x2c')]=function(_0x11ff87,_0x443134){var _0x542f11={},_0x53e531={},_0x54c18e={'count':0x0,'rows':[]};var _0x1e81e6=_[_0xcfbe('0x2d')](db[_0xcfbe('0x2e')][_0xcfbe('0x2f')],function(_0x345128){return{'name':_0x345128[_0xcfbe('0x30')],'type':_0x345128[_0xcfbe('0x31')][_0xcfbe('0x32')]};});_0x53e531['model']=_['differenceBy'](_['map'](_0x1e81e6,_0xcfbe('0x2a')),[_0xcfbe('0x33')]);_0x53e531['query']=_[_0xcfbe('0x34')](_0x11ff87['query']);_0x53e531[_0xcfbe('0x35')]=_[_0xcfbe('0x36')](_0x53e531[_0xcfbe('0x37')],_0x53e531[_0xcfbe('0x38')]);_0x542f11[_0xcfbe('0x39')]=_[_0xcfbe('0x36')](_0x53e531['model'],qs['fields'](_0x11ff87[_0xcfbe('0x38')]['fields']));_0x542f11[_0xcfbe('0x39')]=_0x542f11[_0xcfbe('0x39')]['length']?_0x542f11['attributes']:_0x53e531[_0xcfbe('0x37')];if(!_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x3a')]('nolimit')){_0x542f11[_0xcfbe('0x21')]=qs[_0xcfbe('0x21')](_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x21')]);_0x542f11['offset']=qs[_0xcfbe('0x1f')](_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x1f')]);}_0x542f11['order']=qs[_0xcfbe('0x3b')](_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x3b')]);_0x542f11[_0xcfbe('0x3c')]=qs[_0xcfbe('0x35')](_[_0xcfbe('0x3d')](_0x11ff87[_0xcfbe('0x38')],_0x53e531['filters']),_0x1e81e6);if(_0x11ff87[_0xcfbe('0x38')]['filter']){_0x542f11[_0xcfbe('0x3c')]=_[_0xcfbe('0x3e')](_0x542f11[_0xcfbe('0x3c')],{'$or':_[_0xcfbe('0x2d')](_0x1e81e6,function(_0x2997da){if(_0x2997da[_0xcfbe('0x31')]!==_0xcfbe('0x3f')){var _0x491580={};_0x491580[_0x2997da['name']]={'$like':'%'+_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x40')]+'%'};return _0x491580;}})});}_0x542f11=_['merge']({},_0x542f11,_0x11ff87[_0xcfbe('0x41')]);var _0x3307fa={'where':_0x542f11[_0xcfbe('0x3c')]};return db[_0xcfbe('0x2e')]['count'](_0x3307fa)[_0xcfbe('0x27')](function(_0x467953){_0x54c18e['count']=_0x467953;if(_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x42')]){_0x542f11[_0xcfbe('0x43')]=[{'all':!![]}];}return db[_0xcfbe('0x2e')][_0xcfbe('0x44')](_0x542f11);})[_0xcfbe('0x27')](function(_0x3ce83f){_0x54c18e[_0xcfbe('0x45')]=_0x3ce83f;return _0x54c18e;})['then'](respondWithFilteredResult(_0x443134,_0x542f11))[_0xcfbe('0x46')](handleError(_0x443134,null));};exports['show']=function(_0x1bc8ef,_0x1f070a){var _0x2d9f07={'raw':![],'where':{'id':_0x1bc8ef[_0xcfbe('0x47')]['id']}},_0x289277={};_0x289277['model']=_[_0xcfbe('0x34')](db[_0xcfbe('0x2e')][_0xcfbe('0x2f')]);_0x289277[_0xcfbe('0x38')]=_[_0xcfbe('0x34')](_0x1bc8ef['query']);_0x289277[_0xcfbe('0x35')]=_[_0xcfbe('0x36')](_0x289277[_0xcfbe('0x37')],_0x289277[_0xcfbe('0x38')]);_0x2d9f07[_0xcfbe('0x39')]=_[_0xcfbe('0x36')](_0x289277[_0xcfbe('0x37')],qs[_0xcfbe('0x48')](_0x1bc8ef['query'][_0xcfbe('0x48')]));_0x2d9f07[_0xcfbe('0x39')]=_0x2d9f07[_0xcfbe('0x39')][_0xcfbe('0x49')]?_0x2d9f07[_0xcfbe('0x39')]:_0x289277[_0xcfbe('0x37')];if(_0x1bc8ef[_0xcfbe('0x38')][_0xcfbe('0x42')]){_0x2d9f07[_0xcfbe('0x43')]=[{'all':!![]}];}_0x2d9f07=_['merge']({},_0x2d9f07,_0x1bc8ef[_0xcfbe('0x41')]);return db['VoiceRecording']['find'](_0x2d9f07)[_0xcfbe('0x27')](handleEntityNotFound(_0x1f070a,null))[_0xcfbe('0x27')](respondWithResult(_0x1f070a,null))[_0xcfbe('0x46')](handleError(_0x1f070a,null));};exports['create']=function(_0x4777bf,_0x1b9b8d){return db[_0xcfbe('0x2e')]['create'](_0x4777bf[_0xcfbe('0x4a')],{})[_0xcfbe('0x27')](respondWithResult(_0x1b9b8d,0xc9))[_0xcfbe('0x46')](handleError(_0x1b9b8d,null));};exports[_0xcfbe('0x26')]=function(_0x3927ea,_0x571bb4){if(_0x3927ea[_0xcfbe('0x4a')]['id']){delete _0x3927ea[_0xcfbe('0x4a')]['id'];}return db[_0xcfbe('0x2e')][_0xcfbe('0x4b')]({'where':{'id':_0x3927ea[_0xcfbe('0x47')]['id']}})[_0xcfbe('0x27')](handleEntityNotFound(_0x571bb4,null))[_0xcfbe('0x27')](saveUpdates(_0x3927ea[_0xcfbe('0x4a')],null))[_0xcfbe('0x27')](respondWithResult(_0x571bb4,null))[_0xcfbe('0x46')](handleError(_0x571bb4,null));};exports[_0xcfbe('0x4c')]=function(_0x340f63,_0x196ff0){return db[_0xcfbe('0x2e')]['describe']()[_0xcfbe('0x27')](respondWithResult(_0x196ff0,null))['catch'](handleError(_0x196ff0,null));};exports['download']=function(_0x1f3017,_0x47f691,_0x5a8907){var _0x4b53a=require(_0xcfbe('0x4d'));var _0x53c1f5=![];var _0x4a62a5={};if(_0x1f3017[_0xcfbe('0x38')][_0xcfbe('0x31')]&&_0x1f3017[_0xcfbe('0x38')][_0xcfbe('0x31')]==='uniqueid'){_0x4a62a5[_0xcfbe('0x4e')]=_0x1f3017[_0xcfbe('0x47')]['id'];}else{_0x4a62a5['id']=_0x1f3017['params']['id'];}return db['VoiceRecording'][_0xcfbe('0x4b')]({'where':_0x4a62a5,'attributes':['id',_0xcfbe('0x4f')],'raw':!![]})[_0xcfbe('0x27')](handleEntityNotFound(_0x47f691,null))[_0xcfbe('0x27')](function(_0x2e9426){if(_0x2e9426){var _0x8d0a8=_0x2e9426[_0xcfbe('0x4f')];var _0x2287bf=util[_0xcfbe('0x33')](_0xcfbe('0x50'),_0x8d0a8);if(fs[_0xcfbe('0x51')](_0x2287bf)){_0x53c1f5=!![];return _0x4b53a['decryptFile'](_0x2287bf,_0x8d0a8,config['secrets']['recording'])[_0xcfbe('0x27')](function(){return _0x2e9426;});}return _0x2e9426;}})[_0xcfbe('0x27')](function(_0x27db00){if(_0x27db00){var _0x21fdce=_0x27db00['value'];if(!fs['existsSync'](_0x21fdce)){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))](_0xcfbe('0x54'));}if(_0x27db00[_0xcfbe('0x55')]){return _0x47f691['download'](_0x21fdce,_0x27db00[_0xcfbe('0x55')]+path[_0xcfbe('0x56')](_0x21fdce),function(){if(_0x53c1f5){fs[_0xcfbe('0x57')](_0x21fdce);}});}else{return _0x47f691[_0xcfbe('0x58')](_0x21fdce,function(_0x3b509b){if(_0x53c1f5){fs[_0xcfbe('0x57')](_0x21fdce);}});}}})[_0xcfbe('0x46')](function(_0x370196){if(_0x370196[_0xcfbe('0x59')]===_0xcfbe('0x54')){_0x47f691[_0xcfbe('0x1d')](0x194)[_0xcfbe('0x2b')]('Not\x20found');}else{return handleError(_0x47f691,null);}});};exports[_0xcfbe('0x5a')]=function(_0x11808d,_0x26a9cf,_0x5ec3e5){var _0x5db03e=require(_0xcfbe('0x4d'));var _0x1151a0=![];var _0x1177bb={'$and':[db['sequelize'][_0xcfbe('0x3c')](db['sequelize']['fn'](_0xcfbe('0x5b'),db[_0xcfbe('0x5c')][_0xcfbe('0x5d')]('uniqueid')),_0x11808d[_0xcfbe('0x38')][_0xcfbe('0x5e')])]};if(_0x11808d[_0xcfbe('0x38')][_0xcfbe('0x31')]&&_0x11808d[_0xcfbe('0x38')][_0xcfbe('0x31')]===_0xcfbe('0x4e')){_0x1177bb[_0xcfbe('0x5f')][_0xcfbe('0x60')]({'uniqueid':_0x11808d[_0xcfbe('0x47')]['id']});}else{_0x1177bb[_0xcfbe('0x5f')]['push']({'id':_0x11808d[_0xcfbe('0x47')]['id']});}return db[_0xcfbe('0x2e')][_0xcfbe('0x4b')]({'where':_0x1177bb,'attributes':['id',_0xcfbe('0x4f')],'raw':!![]})[_0xcfbe('0x27')](handleEntityNotFound(_0x26a9cf,null))[_0xcfbe('0x27')](function(_0x3848a6){if(_0x3848a6){var _0xbe75b7=util[_0xcfbe('0x33')](_0xcfbe('0x50'),_0x3848a6[_0xcfbe('0x4f')]);if(fs[_0xcfbe('0x51')](_0xbe75b7)){_0x1151a0=!![];return _0x5db03e[_0xcfbe('0x61')](_0xbe75b7,_0x3848a6[_0xcfbe('0x4f')],config[_0xcfbe('0x62')]['recording'])['then'](function(){return _0x3848a6;});}return _0x3848a6;}})[_0xcfbe('0x27')](function(_0x11decb){if(_0x11decb){if(!fs[_0xcfbe('0x51')](_0x11decb[_0xcfbe('0x4f')])){throw new db['Sequelize'][(_0xcfbe('0x53'))](_0xcfbe('0x54'));}if(_0x11decb[_0xcfbe('0x55')]){return _0x26a9cf['download'](_0x11decb[_0xcfbe('0x4f')],_0x11decb[_0xcfbe('0x55')]+path[_0xcfbe('0x56')](_0x11decb[_0xcfbe('0x4f')]),function(){if(_0x1151a0){fs['unlink'](_0x11decb[_0xcfbe('0x4f')]);}});}else{return _0x26a9cf[_0xcfbe('0x58')](_0x11decb['value'],function(_0xdc7fe9){if(_0x1151a0){fs[_0xcfbe('0x57')](_0x11decb[_0xcfbe('0x4f')]);}});}}})[_0xcfbe('0x46')](handleError(_0x26a9cf,null));};exports[_0xcfbe('0x28')]=function(_0x60375c,_0x224b8c){return db[_0xcfbe('0x2e')][_0xcfbe('0x4b')]({'where':{'id':_0x60375c[_0xcfbe('0x47')]['id']}})[_0xcfbe('0x27')](function(_0x2632a8){if(_[_0xcfbe('0x63')](_0x2632a8)){throw new ReferenceError(_0xcfbe('0x64'));}return _0x2632a8;})[_0xcfbe('0x27')](function(_0x3259c2){var _0x2bb9a7=_0x3259c2[_0xcfbe('0x4f')];logger[_0xcfbe('0x65')](_0xcfbe('0x66'),_0x2bb9a7);if(!_['isNil'](_0x3259c2[_0xcfbe('0x4f')])&&fs['existsSync'](_0x2bb9a7)){logger['info'](_0xcfbe('0x67')+_0x2bb9a7+_0xcfbe('0x68'));fs['unlinkSync'](_0x2bb9a7);}_0x2bb9a7=_0x2bb9a7+_0xcfbe('0x69');if(!_['isNil'](_0x3259c2[_0xcfbe('0x4f')])&&fs[_0xcfbe('0x51')](_0x2bb9a7)){logger[_0xcfbe('0x65')](_0xcfbe('0x67')+_0x2bb9a7+_0xcfbe('0x68'));fs['unlinkSync'](_0x2bb9a7);}return _0x3259c2;})[_0xcfbe('0x27')](function(_0x2a1a2b){if(!_0x2a1a2b)throw new InternalError();return _0x2a1a2b[_0xcfbe('0x28')]();})['then'](function(){_0x224b8c['status'](0xcc)[_0xcfbe('0x1c')]();})[_0xcfbe('0x46')](handleError(_0x224b8c,null));};function getBucketslist(_0x597aa9,_0x48abc0,_0x271d96){return new Promise(function(_0x5ef810,_0x229854){var _0x4a709d=new AWS['S3']({'accessKeyId':_0x48abc0,'secretAccessKey':_0x597aa9,'region':_0x271d96});_0x4a709d[_0xcfbe('0x6a')]({},function(_0x2da4cd,_0x5a9434){if(_0x2da4cd){return _0x229854(_0x2da4cd);}else{return _0x5ef810(_0x5a9434);}});});}function createBucket(_0x2ec94f,_0x4a7f45,_0x2671f2,_0x440c6f){return new Promise(function(_0x208dde,_0x2943af){var _0x4ceebe=new AWS['S3']({'accessKeyId':_0x4a7f45,'secretAccessKey':_0x2ec94f,'region':_0x2671f2});_0x4ceebe[_0xcfbe('0x6b')]({'Bucket':_0x440c6f},function(_0x2cbdc2,_0x4d6807){if(_0x2cbdc2){return _0x2943af(_0x2cbdc2);}else{return _0x208dde(_0x4d6807);}});});}function uploadFile(_0x139ee3,_0x536d95,_0x36df4e,_0x2dc057,_0xa7dbcb,_0xabecbd){return new Promise(function(_0x5776,_0x51428e){var _0x2b6ddb=new AWS['S3']({'accessKeyId':_0x536d95,'secretAccessKey':_0x139ee3,'region':_0x36df4e});_0x2b6ddb[_0xcfbe('0x6c')]({'Bucket':_0x2dc057,'Key':_0xa7dbcb,'Body':_0xabecbd},function(_0x2adbbd,_0x2b0a59){if(_0x2adbbd){return _0x51428e(_0x2adbbd);}else{return _0x5776(_0x2b0a59);}});});}function startTranscribe(_0xd0276c,_0x40f2b3,_0x2f2abc,_0x15fe28,_0x299786,_0x36b94f){return new Promise(function(_0x1f3a6b,_0x30e099){var _0x406512=new AWS[(_0xcfbe('0x6d'))]({'accessKeyId':_0x40f2b3,'secretAccessKey':_0xd0276c,'region':_0x2f2abc});_0x406512[_0xcfbe('0x6e')]({'TranscriptionJobName':_0x15fe28,'LanguageCode':_0x299786,'Media':{'MediaFileUri':_0x36b94f}},function(_0x43be84,_0x5f5cf4){if(_0x43be84){return _0x30e099(_0x43be84);}else{return _0x1f3a6b(_0x5f5cf4);}});});}function transcribe(_0x58f84e,_0x3980f6,_0x47b956,_0x5a60a6,_0x580a41,_0x542f6a,_0x51f814){return new Promise(function(_0xf7706e,_0x49b07a){var _0x3b022c={};logger[_0xcfbe('0x65')](util[_0xcfbe('0x33')](_0xcfbe('0x6f'),_0x58f84e,_0x580a41));return uploadFile(_0x3980f6,_0x47b956,_0x5a60a6,_0x580a41,path[_0xcfbe('0x70')](_0x542f6a),fs[_0xcfbe('0x71')](_0x542f6a))[_0xcfbe('0x27')](function(_0x53dcf7){logger[_0xcfbe('0x65')](util[_0xcfbe('0x33')](_0xcfbe('0x72'),_0x58f84e,_0x580a41,_0x53dcf7[_0xcfbe('0x73')]));_0x3b022c['bucket']=_0x53dcf7[_0xcfbe('0x74')];_0x3b022c[_0xcfbe('0x75')]=_0x53dcf7['Location'];logger[_0xcfbe('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x58f84e));return startTranscribe(_0x3980f6,_0x47b956,_0x5a60a6,uuidv4(),_0x51f814,_0x53dcf7[_0xcfbe('0x73')]);})[_0xcfbe('0x27')](function(_0x430e35){logger['info'](util[_0xcfbe('0x33')](_0xcfbe('0x76'),_0x58f84e,_0x430e35['TranscriptionJob']['TranscriptionJobName']));_0x3b022c[_0xcfbe('0x77')]=_0x430e35[_0xcfbe('0x78')][_0xcfbe('0x79')];_0x3b022c[_0xcfbe('0x7a')]=_0x430e35[_0xcfbe('0x78')]['TranscriptionJobStatus'];return _0xf7706e(_0x3b022c);})[_0xcfbe('0x46')](function(_0x31ba51){return _0x49b07a(_0x31ba51);});});}exports[_0xcfbe('0x7b')]=function(_0x4ff5b1,_0x137a43,_0x130f4d){var _0xc5fdb3;var _0x493750;var _0x4d6afa;var _0x4a881e=require(_0xcfbe('0x4d'));return db[_0xcfbe('0x2e')][_0xcfbe('0x7c')]({'where':{'id':_0x4ff5b1[_0xcfbe('0x47')]['id']}})['then'](function(_0x52087c){if(_0x52087c){var _0x4741ed=util[_0xcfbe('0x33')](_0xcfbe('0x50'),_0x52087c['value']);if(fs['existsSync'](_0x4741ed)){cypher=!![];return _0x4a881e[_0xcfbe('0x61')](_0x4741ed,_0x52087c[_0xcfbe('0x4f')],config['secrets'][_0xcfbe('0x7d')])['then'](function(){return _0x52087c;});}return _0x52087c;}})['then'](function(_0x10a9a5){if(!_0x10a9a5){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))](_0xcfbe('0x7e'));}_0x493750=_0x10a9a5;return db['Setting'][_0xcfbe('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x137a43,null))[_0xcfbe('0x27')](function(_0x3072d3){if(_0x3072d3){_0xc5fdb3=_0x3072d3;if(!_0xc5fdb3[_0xcfbe('0x7f')]||!_0xc5fdb3[_0xcfbe('0x80')]||!_0xc5fdb3[_0xcfbe('0x81')]||!_0xc5fdb3[_0xcfbe('0x82')]||!_0xc5fdb3[_0xcfbe('0x83')]){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))]('Transcribe\x20not\x20configured');}if(_0x4ff5b1[_0xcfbe('0x4a')][_0xcfbe('0x84')]&&(!_0xc5fdb3[_0xcfbe('0x85')]||!_0xc5fdb3['sentimentAccountId']||!_0xc5fdb3['sentimentRegion']||!_0xc5fdb3['language']||!_0xc5fdb3[_0xcfbe('0x83')])){throw new db[(_0xcfbe('0x52'))]['ValidationError'](_0xcfbe('0x86'));}return db[_0xcfbe('0x87')][_0xcfbe('0x7c')]({'where':{'id':_0xc5fdb3['transcribeAccountId']}});}})[_0xcfbe('0x27')](function(_0x2805f4){if(!_0x2805f4){throw new db['Sequelize'][(_0xcfbe('0x53'))](_0xcfbe('0x88'));}if(!_0x2805f4['data1']||!_0x2805f4[_0xcfbe('0x89')]){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))](_0xcfbe('0x8a'));}_0x4d6afa=_0x2805f4;return getBucketslist(_0x4d6afa[_0xcfbe('0x8b')],_0x4d6afa[_0xcfbe('0x89')],_0xc5fdb3['transcribeRegion']);})[_0xcfbe('0x27')](function(_0x27582a){if(_0x27582a&&_0x27582a[_0xcfbe('0x8c')]){var _0x396c68=_[_0xcfbe('0x4b')](_0x27582a[_0xcfbe('0x8c')],function(_0x2c2cf7){return _0x2c2cf7[_0xcfbe('0x8d')]===_0xc5fdb3[_0xcfbe('0x83')];});if(!_0x396c68){logger[_0xcfbe('0x65')](util['format'](_0xcfbe('0x8e'),_0x4ff5b1['params']['id'],_0xc5fdb3[_0xcfbe('0x83')]));return createBucket(_0x4d6afa[_0xcfbe('0x8b')],_0x4d6afa[_0xcfbe('0x89')],_0xc5fdb3[_0xcfbe('0x81')],_0xc5fdb3[_0xcfbe('0x83')]);}logger[_0xcfbe('0x65')](util[_0xcfbe('0x33')](_0xcfbe('0x8f'),_0x4ff5b1['params']['id'],_0xc5fdb3[_0xcfbe('0x83')]));return;}})[_0xcfbe('0x27')](function(_0x230044){if(_0x493750['transcribeStatus']===_0xcfbe('0x90')){return transcribe(_0x4ff5b1[_0xcfbe('0x47')]['id'],_0x4d6afa['data1'],_0x4d6afa[_0xcfbe('0x89')],_0xc5fdb3[_0xcfbe('0x81')],_0xc5fdb3[_0xcfbe('0x83')],_0x493750['value'],_0xc5fdb3[_0xcfbe('0x82')]);}else{logger['info'](util[_0xcfbe('0x33')](_0xcfbe('0x91'),_0x4ff5b1['params']['id']));return{'transcribeStatus':_0xcfbe('0x92')};}})[_0xcfbe('0x27')](function(_0xb45ca0){if(_0xb45ca0){_0xb45ca0['tempSentiment']=_0x4ff5b1[_0xcfbe('0x4a')][_0xcfbe('0x84')];return _0x493750[_0xcfbe('0x93')](_0xb45ca0);}})[_0xcfbe('0x27')](respondWithResult(_0x137a43,null))['catch'](handleError(_0x137a43,null));};function writeFile(_0x1e6199,_0x3a0c9c){return new Promise(function(_0x2f9f1b,_0x59c7c3){fs[_0xcfbe('0x94')](_0x3a0c9c,_0x1e6199,function(_0x58d6b6,_0x413cca){if(_0x58d6b6){return _0x59c7c3(_0x58d6b6);}else{return _0x2f9f1b(_0x413cca);}});});}exports['downloadTranscribe']=function(_0x179686,_0x4532e9,_0x4e2375){return db[_0xcfbe('0x2e')]['findOne']({'where':{'id':_0x179686[_0xcfbe('0x47')]['id']}})['then'](handleEntityNotFound(_0x4532e9))[_0xcfbe('0x27')](function(_0x16edb9){if(_0x16edb9&&_0x16edb9['fileText']){var _0x2a032a=_0x16edb9['fileText'];var _0xbbf9bd=config[_0xcfbe('0x95')]+_0xcfbe('0x96')+_0x16edb9['id']+_0xcfbe('0x97');if(fs[_0xcfbe('0x51')](_0xbbf9bd)){return _0xbbf9bd;}return writeFile(_0x2a032a,_0xbbf9bd)[_0xcfbe('0x27')](function(){return _0xbbf9bd;});}else{throw new db[(_0xcfbe('0x52'))]['ValidationError'](_0xcfbe('0x98'));}})[_0xcfbe('0x27')](function(_0x98efdc){return _0x4532e9['download'](_0x98efdc);})[_0xcfbe('0x46')](handleError(_0x4532e9));}; \ No newline at end of file +var _0x734e=['eml-format','rimraf','zip-dir','mustache','util','sox','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','index','map','VoiceRecording','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','sequelize','MD5','token','push','$and','decryptFile','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJob','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','sentimentAccountId','sentimentRegion','language','Sequelize','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','bucket','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available'];(function(_0x5c1e98,_0x16aebf){var _0x1ceab3=function(_0x254507){while(--_0x254507){_0x5c1e98['push'](_0x5c1e98['shift']());}};_0x1ceab3(++_0x16aebf);}(_0x734e,0x8e));var _0xe734=function(_0x1daebd,_0x79a89){_0x1daebd=_0x1daebd-0x0;var _0x462a89=_0x734e[_0x1daebd];return _0x462a89;};'use strict';var emlformat=require(_0xe734('0x0'));var rimraf=require(_0xe734('0x1'));var zipdir=require(_0xe734('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe734('0x3'));var util=require(_0xe734('0x4'));var path=require('path');var sox=require(_0xe734('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe734('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe734('0x7'));var jsforce=require(_0xe734('0x8'));var deskjs=require(_0xe734('0x9'));var toCsv=require(_0xe734('0xa'));var querystring=require('querystring');var Papa=require(_0xe734('0xb'));var AWS=require(_0xe734('0xc'));var uuidv4=require(_0xe734('0xd'));var Redis=require(_0xe734('0xe'));var authService=require(_0xe734('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe734('0x10'));var hardwareService=require(_0xe734('0x11'));var logger=require('../../config/logger')(_0xe734('0x12'));var utils=require('../../config/utils');var config=require(_0xe734('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x270bac,_0x23df90){_0x23df90=_0x23df90||0xcc;return function(_0x4d9762){if(_0x4d9762){return _0x270bac[_0xe734('0x14')](_0x23df90);}return _0x270bac[_0xe734('0x15')](_0x23df90)['end']();};}function respondWithResult(_0x390493,_0x155854){_0x155854=_0x155854||0xc8;return function(_0x4df9a0){if(_0x4df9a0){return _0x390493['status'](_0x155854)[_0xe734('0x16')](_0x4df9a0);}};}function respondWithFilteredResult(_0x10b1df,_0x1b88bb){return function(_0x55c2e1){if(_0x55c2e1){var _0x3f37d7=typeof _0x1b88bb[_0xe734('0x17')]===_0xe734('0x18')&&typeof _0x1b88bb[_0xe734('0x19')]==='undefined';var _0x379d41=_0x55c2e1[_0xe734('0x1a')];var _0x4bcc37=_0x3f37d7?0x0:_0x1b88bb[_0xe734('0x17')];var _0x3068e8=_0x3f37d7?_0x55c2e1[_0xe734('0x1a')]:_0x1b88bb[_0xe734('0x17')]+_0x1b88bb[_0xe734('0x19')];var _0x402f12;if(_0x3068e8>=_0x379d41){_0x3068e8=_0x379d41;_0x402f12=0xc8;}else{_0x402f12=0xce;}_0x10b1df[_0xe734('0x15')](_0x402f12);return _0x10b1df[_0xe734('0x1b')](_0xe734('0x1c'),_0x4bcc37+'-'+_0x3068e8+'/'+_0x379d41)['json'](_0x55c2e1);}return null;};}function patchUpdates(_0x3cae14){return function(_0x3e6c4e){try{jsonpatch[_0xe734('0x1d')](_0x3e6c4e,_0x3cae14,!![]);}catch(_0x3ed52f){return BPromise[_0xe734('0x1e')](_0x3ed52f);}return _0x3e6c4e[_0xe734('0x1f')]();};}function saveUpdates(_0xa5f16b,_0x3f26a5){return function(_0xa4d9bc){if(_0xa4d9bc){return _0xa4d9bc[_0xe734('0x20')](_0xa5f16b)[_0xe734('0x21')](function(_0x1019db){return _0x1019db;});}return null;};}function removeEntity(_0x1b3563,_0x4f48a8){return function(_0x18d858){if(_0x18d858){return _0x18d858[_0xe734('0x22')]()[_0xe734('0x21')](function(){_0x1b3563[_0xe734('0x15')](0xcc)[_0xe734('0x23')]();});}};}function handleEntityNotFound(_0x46aae2,_0x2d699c){return function(_0x72bbd4){if(!_0x72bbd4){_0x46aae2[_0xe734('0x14')](0x194);}return _0x72bbd4;};}function handleError(_0x46a384,_0x138ec2){_0x138ec2=_0x138ec2||0x1f4;return function(_0x18b7e8){logger[_0xe734('0x24')](_0x18b7e8[_0xe734('0x25')]);if(_0x18b7e8['name']){delete _0x18b7e8['name'];}_0x46a384[_0xe734('0x15')](_0x138ec2)['send'](_0x18b7e8);};}exports[_0xe734('0x26')]=function(_0x1bc27a,_0x488a83){var _0x19dfd0={},_0x1c789e={},_0x49249c={'count':0x0,'rows':[]};var _0x11b456=_[_0xe734('0x27')](db[_0xe734('0x28')][_0xe734('0x29')],function(_0x58f070){return{'name':_0x58f070[_0xe734('0x2a')],'type':_0x58f070[_0xe734('0x2b')][_0xe734('0x2c')]};});_0x1c789e['model']=_['differenceBy'](_[_0xe734('0x27')](_0x11b456,_0xe734('0x2d')),['format']);_0x1c789e[_0xe734('0x2e')]=_['keys'](_0x1bc27a['query']);_0x1c789e[_0xe734('0x2f')]=_[_0xe734('0x30')](_0x1c789e[_0xe734('0x31')],_0x1c789e['query']);_0x19dfd0[_0xe734('0x32')]=_['intersection'](_0x1c789e[_0xe734('0x31')],qs['fields'](_0x1bc27a[_0xe734('0x2e')][_0xe734('0x33')]));_0x19dfd0[_0xe734('0x32')]=_0x19dfd0[_0xe734('0x32')][_0xe734('0x34')]?_0x19dfd0[_0xe734('0x32')]:_0x1c789e[_0xe734('0x31')];if(!_0x1bc27a[_0xe734('0x2e')][_0xe734('0x35')](_0xe734('0x36'))){_0x19dfd0[_0xe734('0x19')]=qs['limit'](_0x1bc27a[_0xe734('0x2e')]['limit']);_0x19dfd0['offset']=qs[_0xe734('0x17')](_0x1bc27a[_0xe734('0x2e')][_0xe734('0x17')]);}_0x19dfd0['order']=qs['sort'](_0x1bc27a[_0xe734('0x2e')][_0xe734('0x37')]);_0x19dfd0[_0xe734('0x38')]=qs[_0xe734('0x2f')](_['pick'](_0x1bc27a[_0xe734('0x2e')],_0x1c789e[_0xe734('0x2f')]),_0x11b456);if(_0x1bc27a[_0xe734('0x2e')]['filter']){_0x19dfd0[_0xe734('0x38')]=_[_0xe734('0x39')](_0x19dfd0[_0xe734('0x38')],{'$or':_[_0xe734('0x27')](_0x11b456,function(_0x4a9e43){if(_0x4a9e43[_0xe734('0x2b')]!==_0xe734('0x3a')){var _0x299b3c={};_0x299b3c[_0x4a9e43[_0xe734('0x2d')]]={'$like':'%'+_0x1bc27a[_0xe734('0x2e')]['filter']+'%'};return _0x299b3c;}})});}_0x19dfd0=_[_0xe734('0x39')]({},_0x19dfd0,_0x1bc27a[_0xe734('0x3b')]);var _0x24435d={'where':_0x19dfd0[_0xe734('0x38')]};return db[_0xe734('0x28')]['count'](_0x24435d)['then'](function(_0x32b124){_0x49249c[_0xe734('0x1a')]=_0x32b124;if(_0x1bc27a[_0xe734('0x2e')]['includeAll']){_0x19dfd0[_0xe734('0x3c')]=[{'all':!![]}];}return db['VoiceRecording'][_0xe734('0x3d')](_0x19dfd0);})[_0xe734('0x21')](function(_0x3c5e39){_0x49249c[_0xe734('0x3e')]=_0x3c5e39;return _0x49249c;})[_0xe734('0x21')](respondWithFilteredResult(_0x488a83,_0x19dfd0))[_0xe734('0x3f')](handleError(_0x488a83,null));};exports['show']=function(_0x58ca8d,_0x163ed5){var _0x40ea95={'raw':![],'where':{'id':_0x58ca8d[_0xe734('0x40')]['id']}},_0x5ef855={};_0x5ef855[_0xe734('0x31')]=_['keys'](db[_0xe734('0x28')][_0xe734('0x29')]);_0x5ef855[_0xe734('0x2e')]=_['keys'](_0x58ca8d[_0xe734('0x2e')]);_0x5ef855['filters']=_['intersection'](_0x5ef855[_0xe734('0x31')],_0x5ef855[_0xe734('0x2e')]);_0x40ea95[_0xe734('0x32')]=_[_0xe734('0x30')](_0x5ef855[_0xe734('0x31')],qs[_0xe734('0x33')](_0x58ca8d[_0xe734('0x2e')][_0xe734('0x33')]));_0x40ea95[_0xe734('0x32')]=_0x40ea95['attributes'][_0xe734('0x34')]?_0x40ea95['attributes']:_0x5ef855['model'];if(_0x58ca8d[_0xe734('0x2e')][_0xe734('0x41')]){_0x40ea95[_0xe734('0x3c')]=[{'all':!![]}];}_0x40ea95=_[_0xe734('0x39')]({},_0x40ea95,_0x58ca8d['options']);return db[_0xe734('0x28')][_0xe734('0x42')](_0x40ea95)['then'](handleEntityNotFound(_0x163ed5,null))[_0xe734('0x21')](respondWithResult(_0x163ed5,null))[_0xe734('0x3f')](handleError(_0x163ed5,null));};exports['create']=function(_0x57101f,_0x533917){return db[_0xe734('0x28')][_0xe734('0x43')](_0x57101f[_0xe734('0x44')],{})[_0xe734('0x21')](respondWithResult(_0x533917,0xc9))[_0xe734('0x3f')](handleError(_0x533917,null));};exports[_0xe734('0x20')]=function(_0x15f733,_0x33d0bf){if(_0x15f733[_0xe734('0x44')]['id']){delete _0x15f733['body']['id'];}return db[_0xe734('0x28')]['find']({'where':{'id':_0x15f733[_0xe734('0x40')]['id']}})[_0xe734('0x21')](handleEntityNotFound(_0x33d0bf,null))[_0xe734('0x21')](saveUpdates(_0x15f733['body'],null))[_0xe734('0x21')](respondWithResult(_0x33d0bf,null))[_0xe734('0x3f')](handleError(_0x33d0bf,null));};exports[_0xe734('0x45')]=function(_0x1b0bbc,_0x18b567){return db[_0xe734('0x28')][_0xe734('0x45')]()['then'](respondWithResult(_0x18b567,null))[_0xe734('0x3f')](handleError(_0x18b567,null));};exports[_0xe734('0x46')]=function(_0x428fc0,_0x3e0442,_0x42f5c0){var _0x2da676=require(_0xe734('0x47'));var _0x3640be=![];var _0x2207b7={};if(_0x428fc0[_0xe734('0x2e')][_0xe734('0x2b')]&&_0x428fc0[_0xe734('0x2e')]['type']===_0xe734('0x48')){_0x2207b7[_0xe734('0x48')]=_0x428fc0[_0xe734('0x40')]['id'];}else{_0x2207b7['id']=_0x428fc0['params']['id'];}return db['VoiceRecording'][_0xe734('0x42')]({'where':_0x2207b7,'attributes':['id',_0xe734('0x49')],'raw':!![]})[_0xe734('0x21')](handleEntityNotFound(_0x3e0442,null))['then'](function(_0x1ed88c){if(_0x1ed88c){var _0x50da30=_0x1ed88c['value'];var _0x5a08b1=util[_0xe734('0x4a')](_0xe734('0x4b'),_0x50da30);if(fs[_0xe734('0x4c')](_0x5a08b1)){_0x3640be=!![];return _0x2da676['decryptFile'](_0x5a08b1,_0x50da30,config[_0xe734('0x4d')][_0xe734('0x4e')])[_0xe734('0x21')](function(){return _0x1ed88c;});}return _0x1ed88c;}})[_0xe734('0x21')](function(_0x493eaa){if(_0x493eaa){var _0x36ec36=_0x493eaa[_0xe734('0x49')];if(!fs[_0xe734('0x4c')](_0x36ec36)){throw new db['Sequelize'][(_0xe734('0x4f'))](_0xe734('0x50'));}if(_0x493eaa['filename']){return _0x3e0442[_0xe734('0x46')](_0x36ec36,_0x493eaa[_0xe734('0x51')]+path[_0xe734('0x52')](_0x36ec36),function(){if(_0x3640be){fs[_0xe734('0x53')](_0x36ec36);}});}else{return _0x3e0442['download'](_0x36ec36,function(_0x5e4bd7){if(_0x3640be){fs['unlink'](_0x36ec36);}});}}})[_0xe734('0x3f')](function(_0x1b4ec5){if(_0x1b4ec5[_0xe734('0x54')]===_0xe734('0x50')){_0x3e0442[_0xe734('0x15')](0x194)[_0xe734('0x55')](_0xe734('0x56'));}else{return handleError(_0x3e0442,null);}});};exports['downloads']=function(_0x21a96b,_0x550e3f,_0x5812b2){var _0x95dfe5=require(_0xe734('0x47'));var _0x5291ee=![];var _0x5f1d6c={'$and':[db[_0xe734('0x57')]['where'](db[_0xe734('0x57')]['fn'](_0xe734('0x58'),db[_0xe734('0x57')]['col'](_0xe734('0x48'))),_0x21a96b['query'][_0xe734('0x59')])]};if(_0x21a96b[_0xe734('0x2e')][_0xe734('0x2b')]&&_0x21a96b[_0xe734('0x2e')][_0xe734('0x2b')]===_0xe734('0x48')){_0x5f1d6c['$and'][_0xe734('0x5a')]({'uniqueid':_0x21a96b[_0xe734('0x40')]['id']});}else{_0x5f1d6c[_0xe734('0x5b')]['push']({'id':_0x21a96b[_0xe734('0x40')]['id']});}return db[_0xe734('0x28')][_0xe734('0x42')]({'where':_0x5f1d6c,'attributes':['id',_0xe734('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x550e3f,null))[_0xe734('0x21')](function(_0x10d83d){if(_0x10d83d){var _0x35c954=util[_0xe734('0x4a')](_0xe734('0x4b'),_0x10d83d[_0xe734('0x49')]);if(fs[_0xe734('0x4c')](_0x35c954)){_0x5291ee=!![];return _0x95dfe5[_0xe734('0x5c')](_0x35c954,_0x10d83d[_0xe734('0x49')],config[_0xe734('0x4d')][_0xe734('0x4e')])[_0xe734('0x21')](function(){return _0x10d83d;});}return _0x10d83d;}})[_0xe734('0x21')](function(_0x52af64){if(_0x52af64){if(!fs['existsSync'](_0x52af64[_0xe734('0x49')])){throw new db['Sequelize'][(_0xe734('0x4f'))](_0xe734('0x50'));}if(_0x52af64[_0xe734('0x51')]){return _0x550e3f[_0xe734('0x46')](_0x52af64[_0xe734('0x49')],_0x52af64['filename']+path[_0xe734('0x52')](_0x52af64['value']),function(){if(_0x5291ee){fs[_0xe734('0x53')](_0x52af64[_0xe734('0x49')]);}});}else{return _0x550e3f[_0xe734('0x46')](_0x52af64[_0xe734('0x49')],function(_0x25d570){if(_0x5291ee){fs[_0xe734('0x53')](_0x52af64[_0xe734('0x49')]);}});}}})['catch'](handleError(_0x550e3f,null));};exports[_0xe734('0x22')]=function(_0x609583,_0x33dd55){return db[_0xe734('0x28')][_0xe734('0x42')]({'where':{'id':_0x609583['params']['id']}})[_0xe734('0x21')](function(_0x278454){if(_[_0xe734('0x5d')](_0x278454)){throw new ReferenceError(_0xe734('0x5e'));}return _0x278454;})[_0xe734('0x21')](function(_0x33c397){var _0x902f21=_0x33c397['value'];logger[_0xe734('0x5f')](_0xe734('0x60'),_0x902f21);if(!_[_0xe734('0x5d')](_0x33c397[_0xe734('0x49')])&&fs[_0xe734('0x4c')](_0x902f21)){logger[_0xe734('0x5f')](_0xe734('0x61')+_0x902f21+_0xe734('0x62'));fs['unlinkSync'](_0x902f21);}_0x902f21=_0x902f21+'.cypher';if(!_['isNil'](_0x33c397['value'])&&fs[_0xe734('0x4c')](_0x902f21)){logger['info']('File:\x20\x22'+_0x902f21+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe734('0x63')](_0x902f21);}return _0x33c397;})[_0xe734('0x21')](function(_0x29beb4){if(!_0x29beb4)throw new InternalError();return _0x29beb4[_0xe734('0x22')]();})[_0xe734('0x21')](function(){_0x33dd55[_0xe734('0x15')](0xcc)[_0xe734('0x23')]();})[_0xe734('0x3f')](handleError(_0x33dd55,null));};function getBucketslist(_0x38aaf9,_0x22cc56,_0x41cb4a){return new Promise(function(_0x2f846f,_0x46740d){var _0x4e515d=new AWS['S3']({'accessKeyId':_0x22cc56,'secretAccessKey':_0x38aaf9,'region':_0x41cb4a});_0x4e515d['listBuckets']({},function(_0x2d1135,_0x5be677){if(_0x2d1135){return _0x46740d(_0x2d1135);}else{return _0x2f846f(_0x5be677);}});});}function createBucket(_0x37b6a5,_0x4238a2,_0x353114,_0x1a6aa3){return new Promise(function(_0xb34a6d,_0xad731e){var _0x59f0f3=new AWS['S3']({'accessKeyId':_0x4238a2,'secretAccessKey':_0x37b6a5,'region':_0x353114});_0x59f0f3['createBucket']({'Bucket':_0x1a6aa3},function(_0x1e4b86,_0xab1a25){if(_0x1e4b86){return _0xad731e(_0x1e4b86);}else{return _0xb34a6d(_0xab1a25);}});});}function uploadFile(_0x388508,_0x390cc0,_0x1340e2,_0x27fe46,_0x51c99a,_0x15a598){return new Promise(function(_0x215ada,_0x235dc6){var _0x3c2988=new AWS['S3']({'accessKeyId':_0x390cc0,'secretAccessKey':_0x388508,'region':_0x1340e2});_0x3c2988['upload']({'Bucket':_0x27fe46,'Key':_0x51c99a,'Body':_0x15a598},function(_0x261a5e,_0x20dbdc){if(_0x261a5e){return _0x235dc6(_0x261a5e);}else{return _0x215ada(_0x20dbdc);}});});}function startTranscribe(_0x4a3e59,_0x55f791,_0x311f34,_0x52de62,_0x591760,_0x299e45){return new Promise(function(_0x539de9,_0x5cec14){var _0x15dd59=new AWS[(_0xe734('0x64'))]({'accessKeyId':_0x55f791,'secretAccessKey':_0x4a3e59,'region':_0x311f34});_0x15dd59[_0xe734('0x65')]({'TranscriptionJobName':_0x52de62,'LanguageCode':_0x591760,'Media':{'MediaFileUri':_0x299e45}},function(_0x2920c8,_0x1651ec){if(_0x2920c8){return _0x5cec14(_0x2920c8);}else{return _0x539de9(_0x1651ec);}});});}function transcribe(_0x4206d7,_0x159d1d,_0xecbbdf,_0x313f5e,_0x3afc5a,_0x37afa7,_0x317acf){return new Promise(function(_0x4f1ef7,_0x41dea1){var _0x427376={};logger[_0xe734('0x5f')](util[_0xe734('0x4a')](_0xe734('0x66'),_0x4206d7,_0x3afc5a));return uploadFile(_0x159d1d,_0xecbbdf,_0x313f5e,_0x3afc5a,path[_0xe734('0x67')](_0x37afa7),fs[_0xe734('0x68')](_0x37afa7))[_0xe734('0x21')](function(_0x297617){logger[_0xe734('0x5f')](util[_0xe734('0x4a')](_0xe734('0x69'),_0x4206d7,_0x3afc5a,_0x297617['Location']));_0x427376['bucket']=_0x297617[_0xe734('0x6a')];_0x427376[_0xe734('0x6b')]=_0x297617[_0xe734('0x6c')];logger['info'](util[_0xe734('0x4a')](_0xe734('0x6d'),_0x4206d7));return startTranscribe(_0x159d1d,_0xecbbdf,_0x313f5e,uuidv4(),_0x317acf,_0x297617[_0xe734('0x6c')]);})[_0xe734('0x21')](function(_0x52fcb6){logger[_0xe734('0x5f')](util[_0xe734('0x4a')](_0xe734('0x6e'),_0x4206d7,_0x52fcb6['TranscriptionJob'][_0xe734('0x6f')]));_0x427376[_0xe734('0x70')]=_0x52fcb6['TranscriptionJob'][_0xe734('0x6f')];_0x427376[_0xe734('0x71')]=_0x52fcb6[_0xe734('0x72')]['TranscriptionJobStatus'];return _0x4f1ef7(_0x427376);})[_0xe734('0x3f')](function(_0x508d67){return _0x41dea1(_0x508d67);});});}exports['runTranscribe']=function(_0x3c9a97,_0x44ccfc,_0xba653b){var _0x29f59e;var _0x549f77;var _0x7f1cff;var _0x1e0260=require(_0xe734('0x47'));return db[_0xe734('0x28')][_0xe734('0x73')]({'where':{'id':_0x3c9a97[_0xe734('0x40')]['id']}})[_0xe734('0x21')](function(_0x59e4bd){if(_0x59e4bd){var _0x32346d=util['format']('%s.cypher',_0x59e4bd['value']);if(fs[_0xe734('0x4c')](_0x32346d)){cypher=!![];return _0x1e0260[_0xe734('0x5c')](_0x32346d,_0x59e4bd[_0xe734('0x49')],config[_0xe734('0x4d')][_0xe734('0x4e')])['then'](function(){return _0x59e4bd;});}return _0x59e4bd;}})[_0xe734('0x21')](function(_0x4ffc36){if(!_0x4ffc36){throw new db['Sequelize'][(_0xe734('0x4f'))](_0xe734('0x74'));}_0x549f77=_0x4ffc36;return db[_0xe734('0x75')][_0xe734('0x73')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x44ccfc,null))[_0xe734('0x21')](function(_0x14a098){if(_0x14a098){_0x29f59e=_0x14a098;if(!_0x29f59e[_0xe734('0x76')]||!_0x29f59e[_0xe734('0x77')]||!_0x29f59e[_0xe734('0x78')]||!_0x29f59e['language']||!_0x29f59e['bucket']){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x3c9a97[_0xe734('0x44')]['runSentiment']&&(!_0x29f59e['sentiment']||!_0x29f59e[_0xe734('0x79')]||!_0x29f59e[_0xe734('0x7a')]||!_0x29f59e[_0xe734('0x7b')]||!_0x29f59e['bucket'])){throw new db[(_0xe734('0x7c'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xe734('0x73')]({'where':{'id':_0x29f59e[_0xe734('0x77')]}});}})[_0xe734('0x21')](function(_0x2f8283){if(!_0x2f8283){throw new db[(_0xe734('0x7c'))][(_0xe734('0x4f'))](_0xe734('0x7d'));}if(!_0x2f8283[_0xe734('0x7e')]||!_0x2f8283[_0xe734('0x7f')]){throw new db[(_0xe734('0x7c'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x7f1cff=_0x2f8283;return getBucketslist(_0x7f1cff[_0xe734('0x7e')],_0x7f1cff[_0xe734('0x7f')],_0x29f59e[_0xe734('0x78')]);})[_0xe734('0x21')](function(_0x317cec){if(_0x317cec&&_0x317cec[_0xe734('0x80')]){var _0x12377f=_[_0xe734('0x42')](_0x317cec[_0xe734('0x80')],function(_0x52cde3){return _0x52cde3['Name']===_0x29f59e[_0xe734('0x81')];});if(!_0x12377f){logger[_0xe734('0x5f')](util[_0xe734('0x4a')](_0xe734('0x82'),_0x3c9a97[_0xe734('0x40')]['id'],_0x29f59e[_0xe734('0x81')]));return createBucket(_0x7f1cff[_0xe734('0x7e')],_0x7f1cff[_0xe734('0x7f')],_0x29f59e[_0xe734('0x78')],_0x29f59e[_0xe734('0x81')]);}logger[_0xe734('0x5f')](util[_0xe734('0x4a')](_0xe734('0x83'),_0x3c9a97[_0xe734('0x40')]['id'],_0x29f59e['bucket']));return;}})['then'](function(_0x126308){if(_0x549f77['transcribeStatus']===_0xe734('0x84')){return transcribe(_0x3c9a97[_0xe734('0x40')]['id'],_0x7f1cff[_0xe734('0x7e')],_0x7f1cff[_0xe734('0x7f')],_0x29f59e['transcribeRegion'],_0x29f59e[_0xe734('0x81')],_0x549f77[_0xe734('0x49')],_0x29f59e[_0xe734('0x7b')]);}else{logger['info'](util[_0xe734('0x4a')](_0xe734('0x85'),_0x3c9a97[_0xe734('0x40')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0xcb9d5a){if(_0xcb9d5a){_0xcb9d5a['tempSentiment']=_0x3c9a97[_0xe734('0x44')][_0xe734('0x86')];return _0x549f77[_0xe734('0x87')](_0xcb9d5a);}})[_0xe734('0x21')](respondWithResult(_0x44ccfc,null))[_0xe734('0x3f')](handleError(_0x44ccfc,null));};function writeFile(_0x152eee,_0x37c34d){return new Promise(function(_0x165915,_0xbce1e8){fs[_0xe734('0x88')](_0x37c34d,_0x152eee,function(_0x1f0afa,_0x570d75){if(_0x1f0afa){return _0xbce1e8(_0x1f0afa);}else{return _0x165915(_0x570d75);}});});}exports[_0xe734('0x89')]=function(_0x28257c,_0x506afd,_0x3de489){return db[_0xe734('0x28')]['findOne']({'where':{'id':_0x28257c[_0xe734('0x40')]['id']}})['then'](handleEntityNotFound(_0x506afd))[_0xe734('0x21')](function(_0x36862b){if(_0x36862b&&_0x36862b['fileText']){var _0x2cbd0b=_0x36862b[_0xe734('0x8a')];var _0x544ece=config[_0xe734('0x8b')]+_0xe734('0x8c')+_0x36862b['id']+'.txt';if(fs[_0xe734('0x4c')](_0x544ece)){return _0x544ece;}return writeFile(_0x2cbd0b,_0x544ece)['then'](function(){return _0x544ece;});}else{throw new db[(_0xe734('0x7c'))][(_0xe734('0x4f'))](_0xe734('0x8d'));}})['then'](function(_0x2e0aa7){return _0x506afd[_0xe734('0x46')](_0x2e0aa7);})[_0xe734('0x3f')](handleError(_0x506afd));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 5c783f1..d38fa11 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 _0x5d70=['transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x3e1e25,_0x39c3bd){var _0xbde8b8=function(_0x29444e){while(--_0x29444e){_0x3e1e25['push'](_0x3e1e25['shift']());}};_0xbde8b8(++_0x39c3bd);}(_0x5d70,0x8d));var _0x05d7=function(_0x2009ec,_0x15fc89){_0x2009ec=_0x2009ec-0x0;var _0xf983df=_0x5d70[_0x2009ec];return _0xf983df;};'use strict';var attributes=require(_0x05d7('0x0'));module[_0x05d7('0x1')]=function(_0x54771b,_0x17a801){return _0x54771b[_0x05d7('0x2')](_0x05d7('0x3'),attributes,{'tableName':_0x05d7('0x4'),'paranoid':![],'indexes':[{'name':_0x05d7('0x5'),'fields':[_0x05d7('0x5')]},{'name':'transcribeStatus','fields':[_0x05d7('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f37=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x332251,_0x3c134f){var _0x592e7d=function(_0x5bc27d){while(--_0x5bc27d){_0x332251['push'](_0x332251['shift']());}};_0x592e7d(++_0x3c134f);}(_0x8f37,0x190));var _0x78f3=function(_0x5ebce4,_0x487d3c){_0x5ebce4=_0x5ebce4-0x0;var _0xf89bf=_0x8f37[_0x5ebce4];return _0xf89bf;};'use strict';var attributes=require(_0x78f3('0x0'));module[_0x78f3('0x1')]=function(_0x351c4f,_0x5c221b){return _0x351c4f['define'](_0x78f3('0x2'),attributes,{'tableName':_0x78f3('0x3'),'paranoid':![],'indexes':[{'name':_0x78f3('0x4'),'fields':['uniqueid']},{'name':_0x78f3('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d4f380c..ba52821 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 _0xe3da=['CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceRecording','update','body','options','where','attributes','limit','then','UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink'];(function(_0x477af7,_0x2990be){var _0x1ad758=function(_0x4fcb0a){while(--_0x4fcb0a){_0x477af7['push'](_0x477af7['shift']());}};_0x1ad758(++_0x2990be);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['UpdateVoiceRecording']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')](_0x3f8cf9[_0xae3d('0x1a')],{'raw':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9['options'][_0xae3d('0x1c')]||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null})[_0xae3d('0x1f')](function(_0x3224ff){logger[_0xae3d('0xe')](_0xae3d('0x20'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x20'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x3224ff));_0x558e42(_0x3224ff);})[_0xae3d('0x21')](function(_0x1fe90f){logger[_0xae3d('0x14')](_0xae3d('0x20'),_0x1fe90f[_0xae3d('0x16')],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x1fe90f['message']));});});};exports[_0xae3d('0x22')]=function(_0x185e71){var _0xb5940=this;return new Promise(function(_0x52df0f,_0x256bd0){var _0x4391db=require(_0xae3d('0x23'));var _0x54c1e1;return db['Setting'][_0xae3d('0x24')]({'attributes':['id',_0xae3d('0x25')],'where':{'id':0x1},'raw':!![]})[_0xae3d('0x1f')](function(_0x3114f9){_0x54c1e1=_0x3114f9;return db[_0xae3d('0x18')]['create'](_0x185e71[_0xae3d('0x1a')]);})[_0xae3d('0x1f')](function(_0x5a39c5){if(_0x54c1e1[_0xae3d('0x25')]&&fs[_0xae3d('0x26')](_0x5a39c5[_0xae3d('0x27')])){var _0x46f484=util[_0xae3d('0x28')](_0xae3d('0x29'),_0x5a39c5['value']);return _0x4391db['encryptFile'](_0x5a39c5['value'],_0x46f484,config[_0xae3d('0x2a')][_0xae3d('0x2b')])[_0xae3d('0x1f')](function(){fs[_0xae3d('0x2c')](_0x5a39c5['value']);logger[_0xae3d('0xe')](_0xae3d('0x2d'));return _0x5a39c5;});}return _0x5a39c5;})[_0xae3d('0x1f')](function(_0x3748d2){logger[_0xae3d('0xe')](_0xae3d('0x22'),_0x185e71);logger[_0xae3d('0x11')]('CreateVoiceRecording',_0x185e71,JSON[_0xae3d('0x13')](_0x3748d2));_0x52df0f(_0x3748d2);})['catch'](function(_0x55aae4){logger[_0xae3d('0x14')]('CreateVoiceRecording',_0x55aae4[_0xae3d('0x16')],_0x185e71);_0x256bd0(_0xb5940['error'](0x1f4,_0x55aae4['message']));});});}; \ No newline at end of file +var _0x5c3c=['../../config/environment','jayson/promise','client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x210cd8,_0x12799e){var _0x1af9e4=function(_0x15c56b){while(--_0x15c56b){_0x210cd8['push'](_0x210cd8['shift']());}};_0x1af9e4(++_0x12799e);}(_0x5c3c,0x132));var _0xc5c3=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x5c3c[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')](_0x2ff158[_0xc5c3('0x1a')],{'raw':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158[_0xc5c3('0x1b')][_0xc5c3('0x1d')]||null:null,'attributes':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1e')]||null:null,'limit':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158[_0xc5c3('0x1b')][_0xc5c3('0x1f')]||null:null})[_0xc5c3('0xd')](function(_0x67445){logger[_0xc5c3('0x15')]('UpdateVoiceRecording',_0x2ff158);logger['debug'](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x67445));_0x28bae6(_0x67445);})['catch'](function(_0x5c7329){logger[_0xc5c3('0x12')](_0xc5c3('0x17'),_0x5c7329[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x5c7329['message']));});});};exports[_0xc5c3('0x20')]=function(_0x22f607){var _0x20c506=this;return new Promise(function(_0x29791c,_0x5caf85){var _0x21efd6=require('../../components/encryptor');var _0x2eacec;return db['Setting'][_0xc5c3('0x21')]({'attributes':['id',_0xc5c3('0x22')],'where':{'id':0x1},'raw':!![]})[_0xc5c3('0xd')](function(_0x4773c5){_0x2eacec=_0x4773c5;return db[_0xc5c3('0x18')][_0xc5c3('0x23')](_0x22f607[_0xc5c3('0x1a')]);})['then'](function(_0xbcafd6){if(_0x2eacec['callRecordingEncryption']&&fs[_0xc5c3('0x24')](_0xbcafd6[_0xc5c3('0x25')])){var _0x5b26e9=util['format'](_0xc5c3('0x26'),_0xbcafd6[_0xc5c3('0x25')]);return _0x21efd6[_0xc5c3('0x27')](_0xbcafd6[_0xc5c3('0x25')],_0x5b26e9,config['secrets'][_0xc5c3('0x28')])[_0xc5c3('0xd')](function(){fs[_0xc5c3('0x29')](_0xbcafd6[_0xc5c3('0x25')]);logger[_0xc5c3('0x15')](_0xc5c3('0x2a'));return _0xbcafd6;});}return _0xbcafd6;})[_0xc5c3('0xd')](function(_0x1e6749){logger[_0xc5c3('0x15')]('CreateVoiceRecording',_0x22f607);logger[_0xc5c3('0x2b')](_0xc5c3('0x20'),_0x22f607,JSON[_0xc5c3('0x11')](_0x1e6749));_0x29791c(_0x1e6749);})[_0xc5c3('0x2c')](function(_0x330391){logger[_0xc5c3('0x12')](_0xc5c3('0x20'),_0x330391['message'],_0x22f607);_0x5caf85(_0x20c506['error'](0x1f4,_0x330391[_0xc5c3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e06e15b..a32d7e4 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 _0xac4f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xac4f,0xe1));var _0xfac4=function(_0x45d56b,_0x3b99e4){_0x45d56b=_0x45d56b-0x0;var _0xd62e37=_0xac4f[_0x45d56b];return _0xd62e37;};'use strict';var multer=require(_0xfac4('0x0'));var util=require(_0xfac4('0x1'));var path=require(_0xfac4('0x2'));var timeout=require(_0xfac4('0x3'));var express=require(_0xfac4('0x4'));var router=express[_0xfac4('0x5')]();var fs_extra=require(_0xfac4('0x6'));var auth=require(_0xfac4('0x7'));var interaction=require(_0xfac4('0x8'));var config=require(_0xfac4('0x9'));var controller=require(_0xfac4('0xa'));router[_0xfac4('0xb')]('/',auth[_0xfac4('0xc')](),controller[_0xfac4('0xd')]);router[_0xfac4('0xb')](_0xfac4('0xe'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfac4('0xf'),auth[_0xfac4('0xc')](),controller[_0xfac4('0x10')]);router[_0xfac4('0x11')]('/',auth[_0xfac4('0xc')](),controller['create']);router[_0xfac4('0x12')](_0xfac4('0xf'),auth[_0xfac4('0xc')](),controller['update']);router['delete'](_0xfac4('0xf'),auth[_0xfac4('0xc')](),controller[_0xfac4('0x13')]);module[_0xfac4('0x14')]=router; \ No newline at end of file +var _0xefbf=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x493b70,_0x168e73){var _0x4c2355=function(_0x1e0247){while(--_0x1e0247){_0x493b70['push'](_0x493b70['shift']());}};_0x4c2355(++_0x168e73);}(_0xefbf,0x93));var _0xfefb=function(_0x59fe3a,_0x26123c){_0x59fe3a=_0x59fe3a-0x0;var _0xe89c3e=_0xefbf[_0x59fe3a];return _0xe89c3e;};'use strict';var multer=require(_0xfefb('0x0'));var util=require(_0xfefb('0x1'));var path=require(_0xfefb('0x2'));var timeout=require('connect-timeout');var express=require(_0xfefb('0x3'));var router=express[_0xfefb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfefb('0x5'));var interaction=require(_0xfefb('0x6'));var config=require(_0xfefb('0x7'));var controller=require(_0xfefb('0x8'));router[_0xfefb('0x9')]('/',auth[_0xfefb('0xa')](),controller[_0xfefb('0xb')]);router['get'](_0xfefb('0xc'),auth[_0xfefb('0xa')](),controller[_0xfefb('0xd')]);router['get'](_0xfefb('0xe'),auth[_0xfefb('0xa')](),controller[_0xfefb('0xf')]);router[_0xfefb('0x10')]('/',auth[_0xfefb('0xa')](),controller[_0xfefb('0x11')]);router[_0xfefb('0x12')](_0xfefb('0xe'),auth[_0xfefb('0xa')](),controller[_0xfefb('0x13')]);router[_0xfefb('0x14')](_0xfefb('0xe'),auth[_0xfefb('0xa')](),controller[_0xfefb('0x15')]);module[_0xfefb('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 212815c..100d2f0 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 _0x1bfd=['exports','ENUM','attended','STRING','Yes','moment'];(function(_0x33eb07,_0x2b5296){var _0x71843b=function(_0x4dd25e){while(--_0x4dd25e){_0x33eb07['push'](_0x33eb07['shift']());}};_0x71843b(++_0x2b5296);}(_0x1bfd,0x107));var _0xd1bf=function(_0x342b1d,_0x58fb84){_0x342b1d=_0x342b1d-0x0;var _0x49c372=_0x1bfd[_0x342b1d];return _0x49c372;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd1bf('0x0'));module[_0xd1bf('0x1')]={'type':{'type':Sequelize[_0xd1bf('0x2')]('blind',_0xd1bf('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xd1bf('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xd1bf('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd1bf('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xd1bf('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xd1bf('0x4')]},'transferercontext':{'type':Sequelize[_0xd1bf('0x4')]},'transfererexten':{'type':Sequelize[_0xd1bf('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xd1bf('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xd1bf('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xd1bf('0x4')]},'transfereecontext':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeexten':{'type':Sequelize[_0xd1bf('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd1bf('0x2')](_0xd1bf('0x5'),'No')},'context':{'type':Sequelize[_0xd1bf('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2e71=['ENUM','attended','STRING','Yes','sequelize','moment'];(function(_0x374e84,_0x1260ed){var _0x162826=function(_0x2f68e2){while(--_0x2f68e2){_0x374e84['push'](_0x374e84['shift']());}};_0x162826(++_0x1260ed);}(_0x2e71,0x18a));var _0x12e7=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0x2e71[_0x173f10];return _0x53142d;};'use strict';var Sequelize=require(_0x12e7('0x0'));var moment=require(_0x12e7('0x1'));module['exports']={'type':{'type':Sequelize[_0x12e7('0x2')]('blind',_0x12e7('0x3'))},'result':{'type':Sequelize[_0x12e7('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x12e7('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x12e7('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x12e7('0x4')]},'transferercontext':{'type':Sequelize[_0x12e7('0x4')]},'transfererexten':{'type':Sequelize[_0x12e7('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x12e7('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x12e7('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x12e7('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x12e7('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x12e7('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x12e7('0x4')]},'transfereecontext':{'type':Sequelize[_0x12e7('0x4')]},'transfereeexten':{'type':Sequelize[_0x12e7('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x12e7('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x12e7('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x12e7('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c7556c5..9e3936c 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 _0x731d=['key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','merge','options','then','includeAll','findAll','rows','show','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','update','destroy','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type'];(function(_0x36f9cb,_0x7a4ca2){var _0x47b3ab=function(_0x1c66b1){while(--_0x1c66b1){_0x36f9cb['push'](_0x36f9cb['shift']());}};_0x47b3ab(++_0x7a4ca2);}(_0x731d,0xaa));var _0xd731=function(_0x1d6aa6,_0x58de49){_0x1d6aa6=_0x1d6aa6-0x0;var _0x1a97b9=_0x731d[_0x1d6aa6];return _0x1a97b9;};'use strict';var emlformat=require(_0xd731('0x0'));var rimraf=require(_0xd731('0x1'));var zipdir=require(_0xd731('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd731('0x3'));var moment=require(_0xd731('0x4'));var BPromise=require(_0xd731('0x5'));var Mustache=require(_0xd731('0x6'));var util=require('util');var path=require(_0xd731('0x7'));var sox=require(_0xd731('0x8'));var csv=require(_0xd731('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd731('0xa'));var squel=require(_0xd731('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd731('0xc'));var toCsv=require(_0xd731('0x9'));var querystring=require(_0xd731('0xd'));var Papa=require('papaparse');var Redis=require(_0xd731('0xe'));var authService=require(_0xd731('0xf'));var qs=require(_0xd731('0x10'));var as=require(_0xd731('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd731('0x12'));var licenseUtil=require(_0xd731('0x13'));var db=require(_0xd731('0x14'))['db'];function respondWithStatusCode(_0x385523,_0x5a88d3){_0x5a88d3=_0x5a88d3||0xcc;return function(_0x15b635){if(_0x15b635){return _0x385523[_0xd731('0x15')](_0x5a88d3);}return _0x385523[_0xd731('0x16')](_0x5a88d3)['end']();};}function respondWithResult(_0x4fa53c,_0x5846e8){_0x5846e8=_0x5846e8||0xc8;return function(_0x5882fe){if(_0x5882fe){return _0x4fa53c[_0xd731('0x16')](_0x5846e8)[_0xd731('0x17')](_0x5882fe);}};}function respondWithFilteredResult(_0x4c20b9,_0x1a332c){return function(_0x3c3eb3){if(_0x3c3eb3){var _0x2a00d2=typeof _0x1a332c['offset']===_0xd731('0x18')&&typeof _0x1a332c[_0xd731('0x19')]===_0xd731('0x18');var _0x21a0f3=_0x3c3eb3[_0xd731('0x1a')];var _0x1e324b=_0x2a00d2?0x0:_0x1a332c['offset'];var _0x23a772=_0x2a00d2?_0x3c3eb3[_0xd731('0x1a')]:_0x1a332c[_0xd731('0x1b')]+_0x1a332c['limit'];var _0x2ea06a;if(_0x23a772>=_0x21a0f3){_0x23a772=_0x21a0f3;_0x2ea06a=0xc8;}else{_0x2ea06a=0xce;}_0x4c20b9['status'](_0x2ea06a);return _0x4c20b9[_0xd731('0x1c')]('Content-Range',_0x1e324b+'-'+_0x23a772+'/'+_0x21a0f3)[_0xd731('0x17')](_0x3c3eb3);}return null;};}function patchUpdates(_0x2df227){return function(_0x549c1a){try{jsonpatch['apply'](_0x549c1a,_0x2df227,!![]);}catch(_0x41a01c){return BPromise[_0xd731('0x1d')](_0x41a01c);}return _0x549c1a['save']();};}function saveUpdates(_0x540498,_0x3100c0){return function(_0x561a21){if(_0x561a21){return _0x561a21[_0xd731('0x1e')](_0x540498)['then'](function(_0x34ffd0){return _0x34ffd0;});}return null;};}function removeEntity(_0x31b033,_0x327169){return function(_0x25ce79){if(_0x25ce79){return _0x25ce79[_0xd731('0x1f')]()['then'](function(){_0x31b033[_0xd731('0x16')](0xcc)[_0xd731('0x20')]();});}};}function handleEntityNotFound(_0x289037,_0x589257){return function(_0x5cb92f){if(!_0x5cb92f){_0x289037[_0xd731('0x15')](0x194);}return _0x5cb92f;};}function handleError(_0x3ed639,_0x54149f){_0x54149f=_0x54149f||0x1f4;return function(_0x32193e){logger[_0xd731('0x21')](_0x32193e[_0xd731('0x22')]);if(_0x32193e[_0xd731('0x23')]){delete _0x32193e[_0xd731('0x23')];}_0x3ed639['status'](_0x54149f)[_0xd731('0x24')](_0x32193e);};}exports[_0xd731('0x25')]=function(_0x2aee86,_0x1b9626){var _0x45793c={},_0x560eb5={},_0x3f8bc4={'count':0x0,'rows':[]};var _0x1cdb40=_[_0xd731('0x26')](db[_0xd731('0x27')][_0xd731('0x28')],function(_0x52c51a){return{'name':_0x52c51a[_0xd731('0x29')],'type':_0x52c51a[_0xd731('0x2a')][_0xd731('0x2b')]};});_0x560eb5[_0xd731('0x2c')]=_['map'](_0x1cdb40,_0xd731('0x23'));_0x560eb5['query']=_[_0xd731('0x2d')](_0x2aee86[_0xd731('0x2e')]);_0x560eb5['filters']=_['intersection'](_0x560eb5['model'],_0x560eb5['query']);_0x45793c[_0xd731('0x2f')]=_[_0xd731('0x30')](_0x560eb5[_0xd731('0x2c')],qs[_0xd731('0x31')](_0x2aee86[_0xd731('0x2e')][_0xd731('0x31')]));_0x45793c[_0xd731('0x2f')]=_0x45793c['attributes'][_0xd731('0x32')]?_0x45793c[_0xd731('0x2f')]:_0x560eb5[_0xd731('0x2c')];if(!_0x2aee86[_0xd731('0x2e')]['hasOwnProperty'](_0xd731('0x33'))){_0x45793c['limit']=qs[_0xd731('0x19')](_0x2aee86[_0xd731('0x2e')]['limit']);_0x45793c[_0xd731('0x1b')]=qs[_0xd731('0x1b')](_0x2aee86['query'][_0xd731('0x1b')]);}_0x45793c[_0xd731('0x34')]=qs[_0xd731('0x35')](_0x2aee86[_0xd731('0x2e')][_0xd731('0x35')]);_0x45793c['where']=qs[_0xd731('0x36')](_['pick'](_0x2aee86['query'],_0x560eb5['filters']),_0x1cdb40);if(_0x2aee86['query'][_0xd731('0x37')]){_0x45793c[_0xd731('0x38')]=_[_0xd731('0x39')](_0x45793c[_0xd731('0x38')],{'$or':_['map'](_0x1cdb40,function(_0x41e49c){if(_0x41e49c[_0xd731('0x2a')]!=='VIRTUAL'){var _0x510643={};_0x510643[_0x41e49c[_0xd731('0x23')]]={'$like':'%'+_0x2aee86[_0xd731('0x2e')]['filter']+'%'};return _0x510643;}})});}_0x45793c=_[_0xd731('0x39')]({},_0x45793c,_0x2aee86[_0xd731('0x3a')]);var _0x216a98={'where':_0x45793c[_0xd731('0x38')]};return db[_0xd731('0x27')][_0xd731('0x1a')](_0x216a98)[_0xd731('0x3b')](function(_0x41479e){_0x3f8bc4['count']=_0x41479e;if(_0x2aee86[_0xd731('0x2e')][_0xd731('0x3c')]){_0x45793c['include']=[{'all':!![]}];}return db[_0xd731('0x27')][_0xd731('0x3d')](_0x45793c);})[_0xd731('0x3b')](function(_0x2ec5db){_0x3f8bc4[_0xd731('0x3e')]=_0x2ec5db;return _0x3f8bc4;})[_0xd731('0x3b')](respondWithFilteredResult(_0x1b9626,_0x45793c))['catch'](handleError(_0x1b9626,null));};exports[_0xd731('0x3f')]=function(_0x312808,_0x1d809e){var _0x4de43b={'raw':!![],'where':{'id':_0x312808['params']['id']}},_0x46ef01={};_0x46ef01[_0xd731('0x2c')]=_[_0xd731('0x2d')](db[_0xd731('0x27')]['rawAttributes']);_0x46ef01['query']=_[_0xd731('0x2d')](_0x312808['query']);_0x46ef01[_0xd731('0x36')]=_[_0xd731('0x30')](_0x46ef01[_0xd731('0x2c')],_0x46ef01['query']);_0x4de43b[_0xd731('0x2f')]=_[_0xd731('0x30')](_0x46ef01[_0xd731('0x2c')],qs[_0xd731('0x31')](_0x312808[_0xd731('0x2e')][_0xd731('0x31')]));_0x4de43b[_0xd731('0x2f')]=_0x4de43b[_0xd731('0x2f')][_0xd731('0x32')]?_0x4de43b[_0xd731('0x2f')]:_0x46ef01[_0xd731('0x2c')];if(_0x312808[_0xd731('0x2e')]['includeAll']){_0x4de43b[_0xd731('0x40')]=[{'all':!![]}];}_0x4de43b=_[_0xd731('0x39')]({},_0x4de43b,_0x312808[_0xd731('0x3a')]);return db[_0xd731('0x27')][_0xd731('0x41')](_0x4de43b)['then'](handleEntityNotFound(_0x1d809e,null))['then'](respondWithResult(_0x1d809e,null))[_0xd731('0x42')](handleError(_0x1d809e,null));};exports[_0xd731('0x43')]=function(_0x3d7ea3,_0x3b74b8){return db[_0xd731('0x27')][_0xd731('0x43')](_0x3d7ea3[_0xd731('0x44')],{})[_0xd731('0x3b')](respondWithResult(_0x3b74b8,0xc9))[_0xd731('0x42')](handleError(_0x3b74b8,null));};exports[_0xd731('0x1e')]=function(_0x8f42ea,_0x19b416){if(_0x8f42ea['body']['id']){delete _0x8f42ea[_0xd731('0x44')]['id'];}return db[_0xd731('0x27')][_0xd731('0x41')]({'where':{'id':_0x8f42ea[_0xd731('0x45')]['id']}})[_0xd731('0x3b')](handleEntityNotFound(_0x19b416,null))[_0xd731('0x3b')](saveUpdates(_0x8f42ea['body'],null))['then'](respondWithResult(_0x19b416,null))[_0xd731('0x42')](handleError(_0x19b416,null));};exports[_0xd731('0x1f')]=function(_0x501500,_0x3a98a0){return db[_0xd731('0x27')][_0xd731('0x41')]({'where':{'id':_0x501500[_0xd731('0x45')]['id']}})[_0xd731('0x3b')](handleEntityNotFound(_0x3a98a0,null))['then'](removeEntity(_0x3a98a0,null))[_0xd731('0x42')](handleError(_0x3a98a0,null));};exports[_0xd731('0x46')]=function(_0x4267b,_0x2417d9){return db[_0xd731('0x27')][_0xd731('0x46')]()[_0xd731('0x3b')](respondWithResult(_0x2417d9,null))[_0xd731('0x42')](handleError(_0x2417d9,null));}; \ No newline at end of file +var _0x2314=['../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','destroy','error','name','send','map','VoiceTransferReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x1e4c55,_0x1415eb){var _0x511ab5=function(_0x2958cb){while(--_0x2958cb){_0x1e4c55['push'](_0x1e4c55['shift']());}};_0x511ab5(++_0x1415eb);}(_0x2314,0x7d));var _0x4231=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0x2314[_0x4d08b8];return _0x70214a;};'use strict';var emlformat=require(_0x4231('0x0'));var rimraf=require(_0x4231('0x1'));var zipdir=require(_0x4231('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4231('0x3'));var moment=require('moment');var BPromise=require(_0x4231('0x4'));var Mustache=require(_0x4231('0x5'));var util=require('util');var path=require(_0x4231('0x6'));var sox=require(_0x4231('0x7'));var csv=require(_0x4231('0x8'));var ejs=require(_0x4231('0x9'));var fs=require('fs');var fs_extra=require(_0x4231('0xa'));var _=require(_0x4231('0xb'));var squel=require(_0x4231('0xc'));var crypto=require(_0x4231('0xd'));var jsforce=require(_0x4231('0xe'));var deskjs=require(_0x4231('0xf'));var toCsv=require(_0x4231('0x8'));var querystring=require(_0x4231('0x10'));var Papa=require(_0x4231('0x11'));var Redis=require(_0x4231('0x12'));var authService=require(_0x4231('0x13'));var qs=require(_0x4231('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4231('0x15'));var logger=require('../../config/logger')(_0x4231('0x16'));var utils=require(_0x4231('0x17'));var config=require(_0x4231('0x18'));var licenseUtil=require(_0x4231('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bbe9a,_0x30a3c1){_0x30a3c1=_0x30a3c1||0xcc;return function(_0x49a9f0){if(_0x49a9f0){return _0x4bbe9a[_0x4231('0x1a')](_0x30a3c1);}return _0x4bbe9a['status'](_0x30a3c1)[_0x4231('0x1b')]();};}function respondWithResult(_0x3c258e,_0x59fab7){_0x59fab7=_0x59fab7||0xc8;return function(_0x3e895e){if(_0x3e895e){return _0x3c258e['status'](_0x59fab7)[_0x4231('0x1c')](_0x3e895e);}};}function respondWithFilteredResult(_0x339d87,_0x4a4ff0){return function(_0x33fb52){if(_0x33fb52){var _0x3ded5f=typeof _0x4a4ff0[_0x4231('0x1d')]===_0x4231('0x1e')&&typeof _0x4a4ff0[_0x4231('0x1f')]===_0x4231('0x1e');var _0x367969=_0x33fb52[_0x4231('0x20')];var _0xbaf48d=_0x3ded5f?0x0:_0x4a4ff0[_0x4231('0x1d')];var _0x168b39=_0x3ded5f?_0x33fb52[_0x4231('0x20')]:_0x4a4ff0[_0x4231('0x1d')]+_0x4a4ff0[_0x4231('0x1f')];var _0x52c88f;if(_0x168b39>=_0x367969){_0x168b39=_0x367969;_0x52c88f=0xc8;}else{_0x52c88f=0xce;}_0x339d87[_0x4231('0x21')](_0x52c88f);return _0x339d87[_0x4231('0x22')]('Content-Range',_0xbaf48d+'-'+_0x168b39+'/'+_0x367969)[_0x4231('0x1c')](_0x33fb52);}return null;};}function patchUpdates(_0x150805){return function(_0x382bab){try{jsonpatch[_0x4231('0x23')](_0x382bab,_0x150805,!![]);}catch(_0x449701){return BPromise[_0x4231('0x24')](_0x449701);}return _0x382bab['save']();};}function saveUpdates(_0x2eae45,_0x467dcf){return function(_0x5e951b){if(_0x5e951b){return _0x5e951b[_0x4231('0x25')](_0x2eae45)[_0x4231('0x26')](function(_0x34adb5){return _0x34adb5;});}return null;};}function removeEntity(_0x2bd52f,_0x1facc9){return function(_0x5da119){if(_0x5da119){return _0x5da119[_0x4231('0x27')]()[_0x4231('0x26')](function(){_0x2bd52f[_0x4231('0x21')](0xcc)[_0x4231('0x1b')]();});}};}function handleEntityNotFound(_0x36aa4f,_0x5aaf93){return function(_0x27946d){if(!_0x27946d){_0x36aa4f['sendStatus'](0x194);}return _0x27946d;};}function handleError(_0x44c3a3,_0x347dff){_0x347dff=_0x347dff||0x1f4;return function(_0x5e2306){logger[_0x4231('0x28')](_0x5e2306['stack']);if(_0x5e2306[_0x4231('0x29')]){delete _0x5e2306[_0x4231('0x29')];}_0x44c3a3[_0x4231('0x21')](_0x347dff)[_0x4231('0x2a')](_0x5e2306);};}exports['index']=function(_0x567563,_0x4d0ef5){var _0x40644a={},_0x10a632={},_0x16e2cd={'count':0x0,'rows':[]};var _0x5d6f49=_[_0x4231('0x2b')](db[_0x4231('0x2c')][_0x4231('0x2d')],function(_0x25427a){return{'name':_0x25427a['fieldName'],'type':_0x25427a[_0x4231('0x2e')]['key']};});_0x10a632[_0x4231('0x2f')]=_[_0x4231('0x2b')](_0x5d6f49,_0x4231('0x29'));_0x10a632[_0x4231('0x30')]=_[_0x4231('0x31')](_0x567563[_0x4231('0x30')]);_0x10a632['filters']=_[_0x4231('0x32')](_0x10a632['model'],_0x10a632[_0x4231('0x30')]);_0x40644a[_0x4231('0x33')]=_[_0x4231('0x32')](_0x10a632[_0x4231('0x2f')],qs[_0x4231('0x34')](_0x567563[_0x4231('0x30')][_0x4231('0x34')]));_0x40644a['attributes']=_0x40644a[_0x4231('0x33')]['length']?_0x40644a[_0x4231('0x33')]:_0x10a632[_0x4231('0x2f')];if(!_0x567563[_0x4231('0x30')][_0x4231('0x35')]('nolimit')){_0x40644a[_0x4231('0x1f')]=qs['limit'](_0x567563['query']['limit']);_0x40644a[_0x4231('0x1d')]=qs[_0x4231('0x1d')](_0x567563[_0x4231('0x30')]['offset']);}_0x40644a[_0x4231('0x36')]=qs[_0x4231('0x37')](_0x567563[_0x4231('0x30')][_0x4231('0x37')]);_0x40644a[_0x4231('0x38')]=qs[_0x4231('0x39')](_[_0x4231('0x3a')](_0x567563['query'],_0x10a632['filters']),_0x5d6f49);if(_0x567563[_0x4231('0x30')][_0x4231('0x3b')]){_0x40644a['where']=_[_0x4231('0x3c')](_0x40644a[_0x4231('0x38')],{'$or':_[_0x4231('0x2b')](_0x5d6f49,function(_0x43aba4){if(_0x43aba4[_0x4231('0x2e')]!==_0x4231('0x3d')){var _0x55a280={};_0x55a280[_0x43aba4[_0x4231('0x29')]]={'$like':'%'+_0x567563[_0x4231('0x30')]['filter']+'%'};return _0x55a280;}})});}_0x40644a=_[_0x4231('0x3c')]({},_0x40644a,_0x567563[_0x4231('0x3e')]);var _0x59cac4={'where':_0x40644a[_0x4231('0x38')]};return db[_0x4231('0x2c')][_0x4231('0x20')](_0x59cac4)[_0x4231('0x26')](function(_0x8dc618){_0x16e2cd['count']=_0x8dc618;if(_0x567563['query'][_0x4231('0x3f')]){_0x40644a[_0x4231('0x40')]=[{'all':!![]}];}return db[_0x4231('0x2c')][_0x4231('0x41')](_0x40644a);})[_0x4231('0x26')](function(_0x5d616c){_0x16e2cd[_0x4231('0x42')]=_0x5d616c;return _0x16e2cd;})[_0x4231('0x26')](respondWithFilteredResult(_0x4d0ef5,_0x40644a))[_0x4231('0x43')](handleError(_0x4d0ef5,null));};exports[_0x4231('0x44')]=function(_0xe40914,_0x4cb2fb){var _0xc9ab34={'raw':!![],'where':{'id':_0xe40914['params']['id']}},_0x21add7={};_0x21add7['model']=_[_0x4231('0x31')](db['VoiceTransferReport']['rawAttributes']);_0x21add7[_0x4231('0x30')]=_[_0x4231('0x31')](_0xe40914[_0x4231('0x30')]);_0x21add7['filters']=_[_0x4231('0x32')](_0x21add7[_0x4231('0x2f')],_0x21add7[_0x4231('0x30')]);_0xc9ab34[_0x4231('0x33')]=_[_0x4231('0x32')](_0x21add7[_0x4231('0x2f')],qs[_0x4231('0x34')](_0xe40914[_0x4231('0x30')]['fields']));_0xc9ab34[_0x4231('0x33')]=_0xc9ab34[_0x4231('0x33')][_0x4231('0x45')]?_0xc9ab34[_0x4231('0x33')]:_0x21add7['model'];if(_0xe40914['query'][_0x4231('0x3f')]){_0xc9ab34[_0x4231('0x40')]=[{'all':!![]}];}_0xc9ab34=_[_0x4231('0x3c')]({},_0xc9ab34,_0xe40914[_0x4231('0x3e')]);return db[_0x4231('0x2c')]['find'](_0xc9ab34)[_0x4231('0x26')](handleEntityNotFound(_0x4cb2fb,null))[_0x4231('0x26')](respondWithResult(_0x4cb2fb,null))[_0x4231('0x43')](handleError(_0x4cb2fb,null));};exports[_0x4231('0x46')]=function(_0x3ee4b3,_0x47d75d){return db[_0x4231('0x2c')][_0x4231('0x46')](_0x3ee4b3[_0x4231('0x47')],{})[_0x4231('0x26')](respondWithResult(_0x47d75d,0xc9))[_0x4231('0x43')](handleError(_0x47d75d,null));};exports[_0x4231('0x25')]=function(_0x8234b1,_0xaea746){if(_0x8234b1[_0x4231('0x47')]['id']){delete _0x8234b1[_0x4231('0x47')]['id'];}return db[_0x4231('0x2c')][_0x4231('0x48')]({'where':{'id':_0x8234b1['params']['id']}})[_0x4231('0x26')](handleEntityNotFound(_0xaea746,null))[_0x4231('0x26')](saveUpdates(_0x8234b1[_0x4231('0x47')],null))[_0x4231('0x26')](respondWithResult(_0xaea746,null))['catch'](handleError(_0xaea746,null));};exports[_0x4231('0x27')]=function(_0x4b1ca1,_0x24ddb5){return db[_0x4231('0x2c')][_0x4231('0x48')]({'where':{'id':_0x4b1ca1[_0x4231('0x49')]['id']}})[_0x4231('0x26')](handleEntityNotFound(_0x24ddb5,null))['then'](removeEntity(_0x24ddb5,null))[_0x4231('0x43')](handleError(_0x24ddb5,null));};exports[_0x4231('0x4a')]=function(_0x56bf7b,_0x5aef93){return db[_0x4231('0x2c')]['describe']()['then'](respondWithResult(_0x5aef93,null))[_0x4231('0x43')](handleError(_0x5aef93,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 36daddd..79567f1 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 _0xa67b=['report_call_transfer','api','moment','path','rimraf','./voiceTransferReport.attributes','define','VoiceTransferReport'];(function(_0x1f0d02,_0x544507){var _0x7cb25=function(_0x12d57b){while(--_0x12d57b){_0x1f0d02['push'](_0x1f0d02['shift']());}};_0x7cb25(++_0x544507);}(_0xa67b,0x179));var _0xba67=function(_0x3c6397,_0x73d921){_0x3c6397=_0x3c6397-0x0;var _0x15bc50=_0xa67b[_0x3c6397];return _0x15bc50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xba67('0x0'));var moment=require(_0xba67('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba67('0x2'));var rimraf=require(_0xba67('0x3'));var config=require('../../config/environment');var attributes=require(_0xba67('0x4'));module['exports']=function(_0x4c3cb5,_0x40452e){return _0x4c3cb5[_0xba67('0x5')](_0xba67('0x6'),attributes,{'tableName':_0xba67('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44ef=['moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x8044,_0x155838){var _0x57f882=function(_0x12c1ff){while(--_0x12c1ff){_0x8044['push'](_0x8044['shift']());}};_0x57f882(++_0x155838);}(_0x44ef,0x88));var _0xf44e=function(_0x2f78ee,_0x3e6339){_0x2f78ee=_0x2f78ee-0x0;var _0x30448f=_0x44ef[_0x2f78ee];return _0x30448f;};'use strict';var _=require(_0xf44e('0x0'));var util=require(_0xf44e('0x1'));var logger=require(_0xf44e('0x2'))(_0xf44e('0x3'));var moment=require(_0xf44e('0x4'));var BPromise=require(_0xf44e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf44e('0x6'));var rimraf=require(_0xf44e('0x7'));var config=require(_0xf44e('0x8'));var attributes=require(_0xf44e('0x9'));module[_0xf44e('0xa')]=function(_0x392679,_0x5f1409){return _0x392679[_0xf44e('0xb')](_0xf44e('0xc'),attributes,{'tableName':_0xf44e('0xd'),'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 78b22bb..b4a0820 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 _0xbda8=['raw','debug','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceTransferReport','body','options'];(function(_0x90d39c,_0x4712a0){var _0x4ac0b0=function(_0x4a0961){while(--_0x4a0961){_0x90d39c['push'](_0x90d39c['shift']());}};_0x4ac0b0(++_0x4712a0);}(_0xbda8,0xe3));var _0x8bda=function(_0xc1a8fc,_0x24f513){_0xc1a8fc=_0xc1a8fc-0x0;var _0x3dd6a3=_0xbda8[_0xc1a8fc];return _0x3dd6a3;};'use strict';var _=require('lodash');var util=require(_0x8bda('0x0'));var moment=require(_0x8bda('0x1'));var BPromise=require(_0x8bda('0x2'));var rs=require(_0x8bda('0x3'));var fs=require('fs');var Redis=require(_0x8bda('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bda('0x5'));var logger=require(_0x8bda('0x6'))(_0x8bda('0x7'));var config=require(_0x8bda('0x8'));var jayson=require(_0x8bda('0x9'));var client=jayson[_0x8bda('0xa')][_0x8bda('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2673ca,_0x4502d2,_0x585c8e){return new BPromise(function(_0x403c77,_0x57cac0){return client['request'](_0x2673ca,_0x585c8e)[_0x8bda('0xc')](function(_0x28473d){logger[_0x8bda('0xd')](_0x8bda('0xe'),_0x4502d2,_0x8bda('0xf'));logger['debug'](_0x8bda('0x10'),_0x4502d2,_0x8bda('0xf'),JSON[_0x8bda('0x11')](_0x28473d));if(_0x28473d[_0x8bda('0x12')]){if(_0x28473d[_0x8bda('0x12')][_0x8bda('0x13')]===0x1f4){logger[_0x8bda('0x12')](_0x8bda('0xe'),_0x4502d2,_0x28473d['error']['message']);return _0x57cac0(_0x28473d['error'][_0x8bda('0x14')]);}logger[_0x8bda('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4502d2,_0x28473d[_0x8bda('0x12')][_0x8bda('0x14')]);return _0x403c77(_0x28473d[_0x8bda('0x12')][_0x8bda('0x14')]);}else{logger['info'](_0x8bda('0xe'),_0x4502d2,_0x8bda('0xf'));_0x403c77(_0x28473d[_0x8bda('0x15')]['message']);}})['catch'](function(_0x236446){logger[_0x8bda('0x12')](_0x8bda('0xe'),_0x4502d2,_0x236446);_0x57cac0(_0x236446);});});}exports['CreateVoiceTransferReport']=function(_0x21cbd4){var _0x222bb3=this;return new Promise(function(_0x2e90eb,_0x20b035){return db[_0x8bda('0x16')]['create'](_0x21cbd4[_0x8bda('0x17')],{'raw':_0x21cbd4[_0x8bda('0x18')]?_0x21cbd4[_0x8bda('0x18')][_0x8bda('0x19')]===undefined?!![]:![]:!![]})[_0x8bda('0xc')](function(_0x29985c){logger['info']('CreateVoiceTransferReport',_0x21cbd4);logger[_0x8bda('0x1a')](_0x8bda('0x1b'),_0x21cbd4,JSON[_0x8bda('0x11')](_0x29985c));_0x2e90eb(_0x29985c);})['catch'](function(_0x3bc900){logger['error'](_0x8bda('0x1b'),_0x3bc900[_0x8bda('0x14')],_0x21cbd4);_0x20b035(_0x222bb3[_0x8bda('0x12')](0x1f4,_0x3bc900[_0x8bda('0x14')]));});});}; \ No newline at end of file +var _0xda0b=['then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceTransferReport','body','options','raw'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xda0b,0x18b));var _0xbda0=function(_0x419498,_0x42abeb){_0x419498=_0x419498-0x0;var _0x31eda5=_0xda0b[_0x419498];return _0x31eda5;};'use strict';var _=require(_0xbda0('0x0'));var util=require(_0xbda0('0x1'));var moment=require(_0xbda0('0x2'));var BPromise=require(_0xbda0('0x3'));var rs=require(_0xbda0('0x4'));var fs=require('fs');var Redis=require(_0xbda0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbda0('0x6'));var logger=require(_0xbda0('0x7'))(_0xbda0('0x8'));var config=require(_0xbda0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbda0('0xa')][_0xbda0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc90982,_0x11c1af,_0x3dfe56){return new BPromise(function(_0x2d0c02,_0x3861c0){return client[_0xbda0('0xc')](_0xc90982,_0x3dfe56)['then'](function(_0x7756fb){logger[_0xbda0('0xd')](_0xbda0('0xe'),_0x11c1af,_0xbda0('0xf'));logger['debug'](_0xbda0('0x10'),_0x11c1af,_0xbda0('0xf'),JSON[_0xbda0('0x11')](_0x7756fb));if(_0x7756fb[_0xbda0('0x12')]){if(_0x7756fb['error']['code']===0x1f4){logger['error'](_0xbda0('0xe'),_0x11c1af,_0x7756fb['error'][_0xbda0('0x13')]);return _0x3861c0(_0x7756fb['error'][_0xbda0('0x13')]);}logger[_0xbda0('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x11c1af,_0x7756fb['error'][_0xbda0('0x13')]);return _0x2d0c02(_0x7756fb['error']['message']);}else{logger[_0xbda0('0xd')](_0xbda0('0xe'),_0x11c1af,_0xbda0('0xf'));_0x2d0c02(_0x7756fb[_0xbda0('0x14')][_0xbda0('0x13')]);}})['catch'](function(_0x3ee8a4){logger['error'](_0xbda0('0xe'),_0x11c1af,_0x3ee8a4);_0x3861c0(_0x3ee8a4);});});}exports[_0xbda0('0x15')]=function(_0x5d6019){var _0xc43633=this;return new Promise(function(_0x26d8ed,_0x5ec6ec){return db['VoiceTransferReport']['create'](_0x5d6019[_0xbda0('0x16')],{'raw':_0x5d6019[_0xbda0('0x17')]?_0x5d6019['options'][_0xbda0('0x18')]===undefined?!![]:![]:!![]})[_0xbda0('0x19')](function(_0x280239){logger[_0xbda0('0xd')](_0xbda0('0x15'),_0x5d6019);logger[_0xbda0('0x1a')]('CreateVoiceTransferReport',_0x5d6019,JSON[_0xbda0('0x11')](_0x280239));_0x26d8ed(_0x280239);})[_0xbda0('0x1b')](function(_0x1f2aa8){logger[_0xbda0('0x12')](_0xbda0('0x15'),_0x1f2aa8[_0xbda0('0x13')],_0x5d6019);_0x5ec6ec(_0xc43633['error'](0x1f4,_0x1f2aa8['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index e3c0403..015a4ec 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 _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0x2021c1,_0xf2a55c){var _0x4c16c7=function(_0x1716e7){while(--_0x1716e7){_0x2021c1['push'](_0x2021c1['shift']());}};_0x4c16c7(++_0xf2a55c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file +var _0x008c=['/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','/calls','calls'];(function(_0xa74764,_0x1e499c){var _0x3e4e57=function(_0x1db54e){while(--_0x1db54e){_0xa74764['push'](_0xa74764['shift']());}};_0x3e4e57(++_0x1e499c);}(_0x008c,0x188));var _0xc008=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0x008c[_0x581960];return _0x4ee892;};'use strict';var express=require(_0xc008('0x0'));var router=express[_0xc008('0x1')]();var auth=require(_0xc008('0x2'));var controller=require(_0xc008('0x3'));router[_0xc008('0x4')]('/originate',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x7')]);router[_0xc008('0x4')](_0xc008('0x8'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0x9')]);router[_0xc008('0x4')]('/answer',auth[_0xc008('0x5')](),auth['isWebrtcLicence'](),controller[_0xc008('0xa')]);router['post']('/hold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['hold']);router['post']('/unhold',auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller['unhold']);router[_0xc008('0x4')](_0xc008('0xb'),auth[_0xc008('0x5')](),auth[_0xc008('0x6')](),controller[_0xc008('0xc')]);router[_0xc008('0x4')](_0xc008('0xd'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 3774c8d..9d21d9c 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 _0xf021=['conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','log','handleError:','stack','name','status','NotFound','request','then','error','code','message','result','catch','User','findOne','agent','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','info','originate\x20fired:','body','json','userId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','VoiceChannels'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xf021,0x18f));var _0x1f02=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xf021[_0x5d4f12];return _0x4eb577;};'use strict';var path=require(_0x1f02('0x0'));var fs=require('fs');var _=require(_0x1f02('0x1'));var db=require(_0x1f02('0x2'))['db'];var config=require(_0x1f02('0x3'));var util=require(_0x1f02('0x4'));var BPromise=require('bluebird');var jayson=require(_0x1f02('0x5'));var amiClient=jayson['client'][_0x1f02('0x6')]({'port':0x232a});var logger=require(_0x1f02('0x7'))('webbarapi');var Redis=require('ioredis');config[_0x1f02('0x8')]=_['defaults'](config[_0x1f02('0x8')],{'host':_0x1f02('0x9'),'port':0x18eb});var io=require(_0x1f02('0xa'))(new Redis(config[_0x1f02('0x8')]));var Schema=require(_0x1f02('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1f02('0xc')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x1f02('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]},'sessionId':{'type':_0x1f02('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1f02('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]},'sessionId':{'type':'string','required':[!![],_0x1f02('0xf')]},'transferNumber':{'type':_0x1f02('0xd'),'required':[!![],_0x1f02('0x10')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]},'sessionId':{'type':_0x1f02('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]}});function emit(_0x3b0a3d,_0x4b76f7,_0x2e602d){logger['info'](_0x3b0a3d,_0x4b76f7,JSON['stringify'](_0x2e602d));io['to'](_0x3b0a3d)['emit'](_0x4b76f7,_0x2e602d);}function handleError(_0x5f4e55){return function(_0x4d1e4f){console[_0x1f02('0x11')](_0x1f02('0x12'),_0x4d1e4f,_0x4d1e4f instanceof RangeError);logger['error'](_0x4d1e4f[_0x1f02('0x13')]);if(_0x4d1e4f instanceof RangeError){if(_0x4d1e4f[_0x1f02('0x14')]){delete _0x4d1e4f[_0x1f02('0x14')];}_0x5f4e55[_0x1f02('0x15')](0x194)['send'](_0x4d1e4f);}else{if(_0x4d1e4f['name']){delete _0x4d1e4f[_0x1f02('0x14')];}_0x5f4e55[_0x1f02('0x15')](0x1f4)['send'](_0x4d1e4f);}};}function checkError(){return function(_0x5b399a){if(!_0x5b399a){throw new RangeError(_0x1f02('0x16'));}return _0x5b399a;};}function respondWithRpcPromise(_0xbdf82a,_0x2f637d){return new BPromise(function(_0xbabbd7,_0x480297){var _0x12c4af=amiClient;return _0x12c4af[_0x1f02('0x17')](_0xbdf82a,_0x2f637d)[_0x1f02('0x18')](function(_0x2f422c){if(_0x2f422c[_0x1f02('0x19')]){if(_0x2f422c[_0x1f02('0x19')][_0x1f02('0x1a')]===0x1f4){return _0x480297(_0x2f422c['error'][_0x1f02('0x1b')]);}return _0xbabbd7(_0x2f422c[_0x1f02('0x19')]['message']);}else{_0xbabbd7(_0x2f422c[_0x1f02('0x1c')]);}})[_0x1f02('0x1d')](function(_0x575a86){_0x480297(_0x575a86);});});}function getAgent(_0x57bb58){return db[_0x1f02('0x1e')][_0x1f02('0x1f')]({'where':{'id':_0x57bb58,'role':_0x1f02('0x20')}})[_0x1f02('0x18')](checkError());}function getAgentCheckSession(_0x3f5c5e,_0x3f5577){return new BPromise(function(_0x297cf4,_0x4c8891){var _0x4d5f7e=respondWithRpcPromise('VoiceChannels');var _0x3ef4bf=getAgent(_0x3f5c5e);Promise[_0x1f02('0x21')]([_0x4d5f7e,_0x3ef4bf])[_0x1f02('0x18')](function(_0x496afd){var _0x5c2c42=_0x496afd[0x0];var _0x227567=_0x496afd[0x1];var _0x6e88d5=_[_0x1f02('0x22')](_0x5c2c42[_0x1f02('0x23')],function(_0x220345){return _0x220345[_0x1f02('0x24')]==_0x227567['id']&&_0x220345[_0x1f02('0x25')]==_0x3f5577;});if(_0x6e88d5[_0x1f02('0x26')]==0x1){_0x297cf4(_0x227567);}else{_0x4c8891(new RangeError(_0x1f02('0x27')+_0x3f5577+_0x1f02('0x28')));}});});}exports['originate']=function(_0x137e06,_0x5ab7a2){logger[_0x1f02('0x29')](_0x1f02('0x2a'),_0x137e06[_0x1f02('0x2b')]);var _0x2bf78e=originateValidation[_0x1f02('0xb')](_0x137e06[_0x1f02('0x2b')]);if(_0x2bf78e['length']>0x0){return _0x5ab7a2['status'](0x190)[_0x1f02('0x2c')](_0x2bf78e);}var _0x15e655=_0x137e06['body'][_0x1f02('0x2d')];var _0x4d1aec=_0x137e06[_0x1f02('0x2b')]['callNumber'];var _0x3c473f=_0x137e06['body']['callerId'];var _0x26f33e=_0x137e06[_0x1f02('0x2b')][_0x1f02('0x2e')];return getAgent(_0x15e655)[_0x1f02('0x18')](function(_0x55c9a3){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x55c9a3[_0x1f02('0x14')]);emit(util['format'](_0x1f02('0x30'),_0x55c9a3[_0x1f02('0x14')]),_0x1f02('0x31'),{'callNumber':_0x4d1aec,'callerId':_0x3c473f,'callbackUrl':_0x26f33e});return _0x5ab7a2[_0x1f02('0x15')](0xc8)[_0x1f02('0x2c')]({'error':![],'message':_0x1f02('0x32')});})['catch'](handleError(_0x5ab7a2));};exports[_0x1f02('0x33')]=function(_0x143e18,_0x1ad162){logger['info'](_0x1f02('0x34'),_0x143e18['body']);var _0x1e4fe5=hangupValidation['validate'](_0x143e18['body']);if(_0x1e4fe5[_0x1f02('0x26')]>0x0){return _0x1ad162['status'](0x190)['json'](_0x1e4fe5);}var _0x3ec5bd=_0x143e18[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x9b0e0=_0x143e18['body'][_0x1f02('0x25')];return getAgent(_0x3ec5bd)['then'](function(_0x2cd179){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x2cd179[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x2cd179[_0x1f02('0x14')]),_0x1f02('0x36'),{'sessionId':_0x9b0e0});return _0x1ad162[_0x1f02('0x15')](0xc8)['json']({'error':![],'message':_0x1f02('0x37')});})['catch'](handleError(_0x1ad162));};exports[_0x1f02('0x38')]=function(_0x544301,_0x3d895a){logger[_0x1f02('0x29')](_0x1f02('0x39'),_0x544301['body']);var _0x5938e1=answerValidation[_0x1f02('0xb')](_0x544301[_0x1f02('0x2b')]);if(_0x5938e1[_0x1f02('0x26')]>0x0){return _0x3d895a[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x5938e1);}var _0x15fb49=_0x544301[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x391b57=_0x544301['body'][_0x1f02('0x25')];return getAgent(_0x15fb49)['then'](function(_0x51c8be){logger[_0x1f02('0x29')]('entityFound:',_0x51c8be['name']);emit(util[_0x1f02('0x35')]('user:%s',_0x51c8be['name']),_0x1f02('0x3a'),{'sessionId':_0x391b57});return _0x3d895a[_0x1f02('0x15')](0xc8)['json']({'error':![],'message':_0x1f02('0x3b')});})[_0x1f02('0x1d')](handleError(_0x3d895a));};exports[_0x1f02('0x3c')]=function(_0x3b1f5b,_0x5d45db){logger[_0x1f02('0x29')](_0x1f02('0x3d'),_0x3b1f5b[_0x1f02('0x2b')]);var _0x4d03ad=holdValidation[_0x1f02('0xb')](_0x3b1f5b[_0x1f02('0x2b')]);if(_0x4d03ad[_0x1f02('0x26')]>0x0){return _0x5d45db[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x4d03ad);}var _0x282e5b=_0x3b1f5b[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x1abfaa=_0x3b1f5b[_0x1f02('0x2b')]['sessionId'];return getAgent(_0x282e5b)[_0x1f02('0x18')](function(_0x50d5ed){logger[_0x1f02('0x29')]('entityFound:',_0x50d5ed[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x50d5ed[_0x1f02('0x14')]),_0x1f02('0x3e'),{'sessionId':_0x1abfaa});return _0x5d45db[_0x1f02('0x15')](0xc8)[_0x1f02('0x2c')]({'error':![],'message':_0x1f02('0x3f')});})[_0x1f02('0x1d')](handleError(_0x5d45db));};exports[_0x1f02('0x40')]=function(_0x1241c5,_0x5792d8){logger[_0x1f02('0x29')](_0x1f02('0x41'),_0x1241c5[_0x1f02('0x2b')]);var _0x102551=unholdValidation[_0x1f02('0xb')](_0x1241c5[_0x1f02('0x2b')]);if(_0x102551[_0x1f02('0x26')]>0x0){return _0x5792d8[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x102551);}var _0x587d60=_0x1241c5[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x3e46c6=_0x1241c5[_0x1f02('0x2b')][_0x1f02('0x25')];return getAgent(_0x587d60)['then'](function(_0x12c1fb){logger['info'](_0x1f02('0x2f'),_0x12c1fb[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x12c1fb[_0x1f02('0x14')]),_0x1f02('0x42'),{'sessionId':_0x3e46c6});return _0x5792d8[_0x1f02('0x15')](0xc8)[_0x1f02('0x2c')]({'error':![],'message':_0x1f02('0x43')});})[_0x1f02('0x1d')](handleError(_0x5792d8));};exports['calls']=function(_0x4a43eb,_0x4d084c){logger[_0x1f02('0x29')]('calls\x20fired:',_0x4d084c[_0x1f02('0x2b')]);var _0x449d58=callsValidation['validate'](_0x4a43eb[_0x1f02('0x2b')]);if(_0x449d58['length']>0x0){return _0x4d084c['status'](0x190)['json'](_0x449d58);}var _0x24192d=_0x4a43eb[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x390df6=respondWithRpcPromise(_0x1f02('0x44'));var _0x3321b3=getAgent(_0x24192d);return Promise['all']([_0x390df6,_0x3321b3])[_0x1f02('0x18')](function(_0xdd2e2b){var _0x496e3c=_0xdd2e2b[0x0];var _0x5c2745=_0xdd2e2b[0x1];var _0x2b0e0d=_[_0x1f02('0x22')](_0x496e3c[_0x1f02('0x23')],function(_0x47efdf){return _0x47efdf[_0x1f02('0x24')]==_0x5c2745['id'];});return _0x4d084c['status'](0xc8)[_0x1f02('0x2c')]({'count':_0x2b0e0d['length'],'rows':_0x2b0e0d});})[_0x1f02('0x1d')](handleError(_0x4d084c));};exports[_0x1f02('0x45')]=function(_0xd7be3b,_0x2b54ac){logger[_0x1f02('0x29')](_0x1f02('0x46'),_0xd7be3b[_0x1f02('0x2b')]);var _0x4ca1d9=conferenceValidation[_0x1f02('0xb')](_0xd7be3b[_0x1f02('0x2b')]);if(_0x4ca1d9[_0x1f02('0x26')]>0x0){return _0x2b54ac[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x4ca1d9);}var _0x2e9881=_0xd7be3b[_0x1f02('0x2b')][_0x1f02('0x2d')];return getAgent(_0x2e9881)[_0x1f02('0x18')](function(_0x3a465f){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x3a465f['name']);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x3a465f['name']),_0x1f02('0x47'));return _0x2b54ac[_0x1f02('0x15')](0xc8)['json']({'error':![],'message':_0x1f02('0x48')});})[_0x1f02('0x1d')](handleError(_0x2b54ac));};exports[_0x1f02('0x49')]=function(_0x4b3b3e,_0x4b8f28){logger[_0x1f02('0x29')](_0x1f02('0x4a'),_0x4b3b3e[_0x1f02('0x2b')]);var _0x3ce624=transferValidation[_0x1f02('0xb')](_0x4b3b3e[_0x1f02('0x2b')]);if(_0x3ce624[_0x1f02('0x26')]>0x0){return _0x4b8f28[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x3ce624);}var _0x2ed1d7=_0x4b3b3e['body'][_0x1f02('0x2d')];var _0x5f054b=_0x4b3b3e['body'][_0x1f02('0x25')];var _0xe7dde7=_0x4b3b3e[_0x1f02('0x2b')][_0x1f02('0x4b')];return getAgent(_0x2ed1d7)[_0x1f02('0x18')](function(_0x6b73f5){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x6b73f5[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x6b73f5[_0x1f02('0x14')]),_0x1f02('0x4c'),{'sessionId':_0x5f054b,'transferNumber':_0xe7dde7});return _0x4b8f28['status'](0xc8)['json']({'error':![],'message':_0x1f02('0x4d')});})[_0x1f02('0x1d')](handleError(_0x4b8f28));}; \ No newline at end of file +var _0xb18e=['webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','../../mysqldb','util','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','send','request','then','error','code','catch','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','validate','format'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0xb18e,0x181));var _0xeb18=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0xb18e[_0x48cb1f];return _0x172c4d;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xeb18('0x0'))['db'];var config=require('../../config/environment');var util=require(_0xeb18('0x1'));var BPromise=require('bluebird');var jayson=require(_0xeb18('0x2'));var amiClient=jayson[_0xeb18('0x3')]['http']({'port':0x232a});var logger=require(_0xeb18('0x4'))(_0xeb18('0x5'));var Redis=require(_0xeb18('0x6'));config[_0xeb18('0x7')]=_[_0xeb18('0x8')](config[_0xeb18('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xeb18('0x9'))(new Redis(config[_0xeb18('0x7')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xeb18('0xa'),'required':[!![],_0xeb18('0xb')]},'callNumber':{'type':_0xeb18('0xc'),'required':[!![],_0xeb18('0xd')]},'callerId':{'type':_0xeb18('0xc')},'callbackUrl':{'type':_0xeb18('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0xeb18('0xa'),'required':[!![],_0xeb18('0xb')]},'sessionId':{'type':_0xeb18('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xeb18('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xeb18('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xeb18('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xeb18('0xc'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0xeb18('0xe')]}});var holdValidation=new Schema({'userId':{'type':_0xeb18('0xa'),'required':[!![],_0xeb18('0xb')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xeb18('0xb')]},'sessionId':{'type':_0xeb18('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xeb18('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0xeb18('0xa'),'required':[!![],_0xeb18('0xb')]}});function emit(_0x4b1e93,_0x314156,_0x1235b0){logger[_0xeb18('0xf')](_0x4b1e93,_0x314156,JSON[_0xeb18('0x10')](_0x1235b0));io['to'](_0x4b1e93)[_0xeb18('0x11')](_0x314156,_0x1235b0);}function handleError(_0x285400){return function(_0x284733){console['log'](_0xeb18('0x12'),_0x284733,_0x284733 instanceof RangeError);logger['error'](_0x284733[_0xeb18('0x13')]);if(_0x284733 instanceof RangeError){if(_0x284733[_0xeb18('0x14')]){delete _0x284733[_0xeb18('0x14')];}_0x285400[_0xeb18('0x15')](0x194)[_0xeb18('0x16')](_0x284733);}else{if(_0x284733['name']){delete _0x284733[_0xeb18('0x14')];}_0x285400[_0xeb18('0x15')](0x1f4)[_0xeb18('0x16')](_0x284733);}};}function checkError(){return function(_0x3ab7e5){if(!_0x3ab7e5){throw new RangeError('NotFound');}return _0x3ab7e5;};}function respondWithRpcPromise(_0x327dba,_0x279c99){return new BPromise(function(_0x22c7e4,_0x862fe3){var _0xaa824b=amiClient;return _0xaa824b[_0xeb18('0x17')](_0x327dba,_0x279c99)[_0xeb18('0x18')](function(_0x38f57a){if(_0x38f57a[_0xeb18('0x19')]){if(_0x38f57a[_0xeb18('0x19')][_0xeb18('0x1a')]===0x1f4){return _0x862fe3(_0x38f57a[_0xeb18('0x19')]['message']);}return _0x22c7e4(_0x38f57a[_0xeb18('0x19')]['message']);}else{_0x22c7e4(_0x38f57a['result']);}})[_0xeb18('0x1b')](function(_0x42ae48){_0x862fe3(_0x42ae48);});});}function getAgent(_0x3e1b84){return db[_0xeb18('0x1c')][_0xeb18('0x1d')]({'where':{'id':_0x3e1b84,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x693669,_0x8dc2a4){return new BPromise(function(_0x3312d8,_0x4c2270){var _0xde2775=respondWithRpcPromise(_0xeb18('0x1e'));var _0x5d2f33=getAgent(_0x693669);Promise[_0xeb18('0x1f')]([_0xde2775,_0x5d2f33])['then'](function(_0x54e62b){var _0x50c72f=_0x54e62b[0x0];var _0x4883e2=_0x54e62b[0x1];var _0x5120f6=_[_0xeb18('0x20')](_0x50c72f[_0xeb18('0x21')],function(_0x27455b){return _0x27455b[_0xeb18('0x22')]==_0x4883e2['id']&&_0x27455b[_0xeb18('0x23')]==_0x8dc2a4;});if(_0x5120f6[_0xeb18('0x24')]==0x1){_0x3312d8(_0x4883e2);}else{_0x4c2270(new RangeError('sessionId\x20'+_0x8dc2a4+_0xeb18('0x25')));}});});}exports[_0xeb18('0x26')]=function(_0xd3611f,_0x1445ba){logger[_0xeb18('0xf')](_0xeb18('0x27'),_0xd3611f[_0xeb18('0x28')]);var _0x26a368=originateValidation['validate'](_0xd3611f[_0xeb18('0x28')]);if(_0x26a368[_0xeb18('0x24')]>0x0){return _0x1445ba[_0xeb18('0x15')](0x190)[_0xeb18('0x29')](_0x26a368);}var _0x199d50=_0xd3611f[_0xeb18('0x28')][_0xeb18('0x2a')];var _0x599df7=_0xd3611f[_0xeb18('0x28')]['callNumber'];var _0x8f5471=_0xd3611f[_0xeb18('0x28')][_0xeb18('0x2b')];var _0x11d482=_0xd3611f['body'][_0xeb18('0x2c')];return getAgent(_0x199d50)[_0xeb18('0x18')](function(_0x44e381){logger[_0xeb18('0xf')](_0xeb18('0x2d'),_0x44e381[_0xeb18('0x14')]);emit(util['format'](_0xeb18('0x2e'),_0x44e381[_0xeb18('0x14')]),_0xeb18('0x2f'),{'callNumber':_0x599df7,'callerId':_0x8f5471,'callbackUrl':_0x11d482});return _0x1445ba[_0xeb18('0x15')](0xc8)[_0xeb18('0x29')]({'error':![],'message':_0xeb18('0x30')});})[_0xeb18('0x1b')](handleError(_0x1445ba));};exports[_0xeb18('0x31')]=function(_0x1b8b8d,_0x188950){logger[_0xeb18('0xf')](_0xeb18('0x32'),_0x1b8b8d['body']);var _0x386297=hangupValidation[_0xeb18('0x33')](_0x1b8b8d[_0xeb18('0x28')]);if(_0x386297[_0xeb18('0x24')]>0x0){return _0x188950[_0xeb18('0x15')](0x190)['json'](_0x386297);}var _0x33bbda=_0x1b8b8d[_0xeb18('0x28')][_0xeb18('0x2a')];var _0x40c626=_0x1b8b8d[_0xeb18('0x28')]['sessionId'];return getAgent(_0x33bbda)[_0xeb18('0x18')](function(_0x54d291){logger[_0xeb18('0xf')](_0xeb18('0x2d'),_0x54d291[_0xeb18('0x14')]);emit(util[_0xeb18('0x34')](_0xeb18('0x2e'),_0x54d291['name']),_0xeb18('0x35'),{'sessionId':_0x40c626});return _0x188950[_0xeb18('0x15')](0xc8)[_0xeb18('0x29')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x188950));};exports[_0xeb18('0x36')]=function(_0x291f35,_0x3fce34){logger[_0xeb18('0xf')](_0xeb18('0x37'),_0x291f35['body']);var _0x5189d3=answerValidation['validate'](_0x291f35[_0xeb18('0x28')]);if(_0x5189d3[_0xeb18('0x24')]>0x0){return _0x3fce34[_0xeb18('0x15')](0x190)['json'](_0x5189d3);}var _0x30a4b0=_0x291f35[_0xeb18('0x28')][_0xeb18('0x2a')];var _0x26d293=_0x291f35[_0xeb18('0x28')][_0xeb18('0x23')];return getAgent(_0x30a4b0)[_0xeb18('0x18')](function(_0x4ae2d5){logger[_0xeb18('0xf')](_0xeb18('0x2d'),_0x4ae2d5[_0xeb18('0x14')]);emit(util[_0xeb18('0x34')](_0xeb18('0x2e'),_0x4ae2d5[_0xeb18('0x14')]),_0xeb18('0x38'),{'sessionId':_0x26d293});return _0x3fce34['status'](0xc8)[_0xeb18('0x29')]({'error':![],'message':_0xeb18('0x39')});})[_0xeb18('0x1b')](handleError(_0x3fce34));};exports[_0xeb18('0x3a')]=function(_0x2d5a1f,_0x2fe4aa){logger[_0xeb18('0xf')](_0xeb18('0x3b'),_0x2d5a1f[_0xeb18('0x28')]);var _0x31ff0b=holdValidation[_0xeb18('0x33')](_0x2d5a1f['body']);if(_0x31ff0b['length']>0x0){return _0x2fe4aa[_0xeb18('0x15')](0x190)[_0xeb18('0x29')](_0x31ff0b);}var _0x4893e0=_0x2d5a1f[_0xeb18('0x28')]['userId'];var _0x12be15=_0x2d5a1f['body'][_0xeb18('0x23')];return getAgent(_0x4893e0)[_0xeb18('0x18')](function(_0x4b4fb4){logger[_0xeb18('0xf')](_0xeb18('0x2d'),_0x4b4fb4[_0xeb18('0x14')]);emit(util[_0xeb18('0x34')](_0xeb18('0x2e'),_0x4b4fb4[_0xeb18('0x14')]),_0xeb18('0x3c'),{'sessionId':_0x12be15});return _0x2fe4aa[_0xeb18('0x15')](0xc8)['json']({'error':![],'message':_0xeb18('0x3d')});})[_0xeb18('0x1b')](handleError(_0x2fe4aa));};exports['unhold']=function(_0x2fbcc7,_0x444dbb){logger[_0xeb18('0xf')]('unhold\x20fired:',_0x2fbcc7[_0xeb18('0x28')]);var _0x52673d=unholdValidation[_0xeb18('0x33')](_0x2fbcc7[_0xeb18('0x28')]);if(_0x52673d['length']>0x0){return _0x444dbb[_0xeb18('0x15')](0x190)[_0xeb18('0x29')](_0x52673d);}var _0x450152=_0x2fbcc7[_0xeb18('0x28')][_0xeb18('0x2a')];var _0x4a3233=_0x2fbcc7['body'][_0xeb18('0x23')];return getAgent(_0x450152)[_0xeb18('0x18')](function(_0x5c41a6){logger[_0xeb18('0xf')]('entityFound:',_0x5c41a6[_0xeb18('0x14')]);emit(util['format'](_0xeb18('0x2e'),_0x5c41a6[_0xeb18('0x14')]),_0xeb18('0x3e'),{'sessionId':_0x4a3233});return _0x444dbb[_0xeb18('0x15')](0xc8)[_0xeb18('0x29')]({'error':![],'message':_0xeb18('0x3f')});})[_0xeb18('0x1b')](handleError(_0x444dbb));};exports[_0xeb18('0x40')]=function(_0x1211ed,_0xdec9a4){logger['info'](_0xeb18('0x41'),_0xdec9a4[_0xeb18('0x28')]);var _0x2fa7c4=callsValidation['validate'](_0x1211ed['body']);if(_0x2fa7c4[_0xeb18('0x24')]>0x0){return _0xdec9a4['status'](0x190)['json'](_0x2fa7c4);}var _0x32ee3a=_0x1211ed[_0xeb18('0x28')]['userId'];var _0x4482a8=respondWithRpcPromise('VoiceChannels');var _0x394edc=getAgent(_0x32ee3a);return Promise[_0xeb18('0x1f')]([_0x4482a8,_0x394edc])[_0xeb18('0x18')](function(_0x4c9ce7){var _0x462f30=_0x4c9ce7[0x0];var _0x550400=_0x4c9ce7[0x1];var _0x24c427=_['filter'](_0x462f30[_0xeb18('0x21')],function(_0x71ee78){return _0x71ee78['UserId']==_0x550400['id'];});return _0xdec9a4[_0xeb18('0x15')](0xc8)['json']({'count':_0x24c427[_0xeb18('0x24')],'rows':_0x24c427});})[_0xeb18('0x1b')](handleError(_0xdec9a4));};exports[_0xeb18('0x42')]=function(_0x423468,_0x469f0f){logger[_0xeb18('0xf')]('conference\x20fired:',_0x423468['body']);var _0x12056d=conferenceValidation['validate'](_0x423468[_0xeb18('0x28')]);if(_0x12056d[_0xeb18('0x24')]>0x0){return _0x469f0f[_0xeb18('0x15')](0x190)[_0xeb18('0x29')](_0x12056d);}var _0x46507b=_0x423468[_0xeb18('0x28')][_0xeb18('0x2a')];return getAgent(_0x46507b)[_0xeb18('0x18')](function(_0x541cc9){logger['info']('entityFound:',_0x541cc9[_0xeb18('0x14')]);emit(util[_0xeb18('0x34')](_0xeb18('0x2e'),_0x541cc9[_0xeb18('0x14')]),_0xeb18('0x43'));return _0x469f0f['status'](0xc8)[_0xeb18('0x29')]({'error':![],'message':_0xeb18('0x44')});})[_0xeb18('0x1b')](handleError(_0x469f0f));};exports['transfer']=function(_0x50bf85,_0x260734){logger['info'](_0xeb18('0x45'),_0x50bf85[_0xeb18('0x28')]);var _0x28c4a8=transferValidation[_0xeb18('0x33')](_0x50bf85['body']);if(_0x28c4a8['length']>0x0){return _0x260734['status'](0x190)[_0xeb18('0x29')](_0x28c4a8);}var _0x3f4778=_0x50bf85['body']['userId'];var _0x2940fc=_0x50bf85['body'][_0xeb18('0x23')];var _0x27b482=_0x50bf85['body'][_0xeb18('0x46')];return getAgent(_0x3f4778)[_0xeb18('0x18')](function(_0x4b783b){logger[_0xeb18('0xf')](_0xeb18('0x2d'),_0x4b783b[_0xeb18('0x14')]);emit(util[_0xeb18('0x34')](_0xeb18('0x2e'),_0x4b783b[_0xeb18('0x14')]),_0xeb18('0x47'),{'sessionId':_0x2940fc,'transferNumber':_0x27b482});return _0x260734[_0xeb18('0x15')](0xc8)[_0xeb18('0x29')]({'error':![],'message':_0xeb18('0x48')});})[_0xeb18('0x1b')](handleError(_0x260734));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 63903c7..2a629b7 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 _0xef0f=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeAnswers','exports'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xef0f,0x168));var _0xfef0=function(_0x4723f3,_0x19f729){_0x4723f3=_0x4723f3-0x0;var _0x12b53d=_0xef0f[_0x4723f3];return _0x12b53d;};'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('0x8')](_0xfef0('0xf'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x8')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x8')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller['getAgents']);router[_0xfef0('0x8')](_0xfef0('0x14'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x15')]);router[_0xfef0('0x16')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x17')]);router['post'](_0xfef0('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x18')]);router[_0xfef0('0x16')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x19')]);router[_0xfef0('0x16')]('/:id/applications',auth[_0xfef0('0x9')](),controller[_0xfef0('0x1a')]);router[_0xfef0('0x16')](_0xfef0('0x1b'),controller[_0xfef0('0x1c')]);router['post'](_0xfef0('0x1d'),auth['isAuthenticated'](),controller[_0xfef0('0x1e')]);router[_0xfef0('0x1f')](_0xfef0('0xd'),auth['isAuthenticated'](),controller[_0xfef0('0x20')]);router['delete'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xfef0('0x9')](),controller['removeDispositions']);router[_0xfef0('0x21')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x22')]);router[_0xfef0('0x21')](_0xfef0('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xfef0('0x23')]=router; \ No newline at end of file +var _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0x1341a6,_0x23816a){var _0x37658e=function(_0xbe0a4d){while(--_0xbe0a4d){_0x1341a6['push'](_0x1341a6['shift']());}};_0x37658e(++_0x23816a);}(_0x430c,0x1a1));var _0xc430=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x430c[_0x2891d1];return _0x486948;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 791e94a..b48ae18 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 _0x48f6=['generate','ENUM','sinch','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','sequelize','exports','STRING','name'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x48f6,0x168));var _0x648f=function(_0x1b85fe,_0x1b8b6b){_0x1b85fe=_0x1b85fe-0x0;var _0x50d28a=_0x48f6[_0x1b85fe];return _0x50d28a;};'use strict';var Sequelize=require(_0x648f('0x0'));var rs=require('randomstring');module[_0x648f('0x1')]={'name':{'type':Sequelize[_0x648f('0x2')],'unique':_0x648f('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x648f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x648f('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x648f('0x4')]();}},'phone':{'type':Sequelize[_0x648f('0x2')]},'type':{'type':Sequelize[_0x648f('0x5')]('twilio',_0x648f('0x6'))},'accountSid':{'type':Sequelize[_0x648f('0x2')]},'baseUrl':{'type':Sequelize[_0x648f('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x648f('0x7')],'defaultValue':function(){return _0x648f('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x648f('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x648f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x648f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x648f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x648f('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x648f('0xb'),'set':function(_0x7c79ea){if(!_0x7c79ea){this[_0x648f('0xc')]('mandatoryDispositionPauseId',null);}this[_0x648f('0xc')]('mandatoryDisposition',_0x7c79ea);}},'description':{'type':Sequelize[_0x648f('0x2')]}}; \ No newline at end of file +var _0x484e=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio'];(function(_0x3c942d,_0x417d7f){var _0x17a1d3=function(_0x1419bf){while(--_0x1419bf){_0x3c942d['push'](_0x3c942d['shift']());}};_0x17a1d3(++_0x417d7f);}(_0x484e,0x13b));var _0xe484=function(_0x4db5e3,_0x3cea3e){_0x4db5e3=_0x4db5e3-0x0;var _0x465846=_0x484e[_0x4db5e3];return _0x465846;};'use strict';var Sequelize=require(_0xe484('0x0'));var rs=require(_0xe484('0x1'));module[_0xe484('0x2')]={'name':{'type':Sequelize[_0xe484('0x3')],'unique':_0xe484('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe484('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe484('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe484('0x3')],'defaultValue':function(){return rs[_0xe484('0x5')]();}},'phone':{'type':Sequelize[_0xe484('0x3')]},'type':{'type':Sequelize[_0xe484('0x6')](_0xe484('0x7'),_0xe484('0x8'))},'accountSid':{'type':Sequelize[_0xe484('0x3')]},'baseUrl':{'type':Sequelize[_0xe484('0x3')]},'authToken':{'type':Sequelize[_0xe484('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe484('0x9')],'defaultValue':function(){return _0xe484('0xa');}},'notificationSound':{'type':Sequelize[_0xe484('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe484('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe484('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe484('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe484('0xc')],'comment':_0xe484('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xe484('0xb')],'defaultValue':![],'comment':_0xe484('0xe'),'set':function(_0x4adff){if(!_0x4adff){this[_0xe484('0xf')]('mandatoryDispositionPauseId',null);}this[_0xe484('0xf')](_0xe484('0x10'),_0x4adff);}},'description':{'type':Sequelize[_0xe484('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index f2837a7..23765b6 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 _0x8ee8=['Messages','dataValues','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','Pause','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','getDispositions','findOne','Disposition','nolimit','order','WhatsappAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','Applications','account','sinch','statuses','state','read','timestamp','message_id','applications','orderBy','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','notifications','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x8ee8,0x192));var _0x88ee=function(_0x2c50e4,_0x15cd2f){_0x2c50e4=_0x2c50e4-0x0;var _0x474118=_0x8ee8[_0x2c50e4];return _0x474118;};'use strict';var emlformat=require(_0x88ee('0x0'));var rimraf=require(_0x88ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x88ee('0x2'));var moment=require(_0x88ee('0x3'));var BPromise=require(_0x88ee('0x4'));var Mustache=require(_0x88ee('0x5'));var util=require(_0x88ee('0x6'));var path=require(_0x88ee('0x7'));var sox=require(_0x88ee('0x8'));var csv=require(_0x88ee('0x9'));var ejs=require(_0x88ee('0xa'));var fs=require('fs');var fs_extra=require(_0x88ee('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x88ee('0xc'));var jsforce=require(_0x88ee('0xd'));var deskjs=require(_0x88ee('0xe'));var toCsv=require(_0x88ee('0x9'));var querystring=require(_0x88ee('0xf'));var Papa=require(_0x88ee('0x10'));var Redis=require(_0x88ee('0x11'));var authService=require(_0x88ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x88ee('0x13'));var hardwareService=require(_0x88ee('0x14'));var logger=require(_0x88ee('0x15'))('api');var utils=require(_0x88ee('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x88ee('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x88ee('0x18')](config['redis'],{'host':_0x88ee('0x19'),'port':0x18eb});var socket=require(_0x88ee('0x1a'))(new Redis(config[_0x88ee('0x1b')]));require(_0x88ee('0x1c'))[_0x88ee('0x1d')](socket);var jayson=require(_0x88ee('0x1e'));var client=jayson[_0x88ee('0x1f')][_0x88ee('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x21388e,_0x2a7abd,_0x584353,_0x1ad5bd){return new BPromise(function(_0x44f1c3,_0x4b1410){var _0x441b45=_0x1ad5bd||client;return _0x441b45[_0x88ee('0x21')](_0x21388e,_0x584353)[_0x88ee('0x22')](function(_0x19eee9){logger[_0x88ee('0x23')](_0x88ee('0x24'),_0x2a7abd,'request\x20sent');logger[_0x88ee('0x25')](_0x88ee('0x26'),_0x2a7abd,_0x88ee('0x27'),JSON[_0x88ee('0x28')](_0x19eee9));if(_0x19eee9[_0x88ee('0x29')]){if(_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2a')]===0x1f4){logger[_0x88ee('0x29')](_0x88ee('0x24'),_0x2a7abd,_0x19eee9['error']['message']);return _0x4b1410(_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2b')]);}logger[_0x88ee('0x29')](_0x88ee('0x24'),_0x2a7abd,_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2b')]);return _0x44f1c3(_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2b')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x2a7abd,'request\x20sent');_0x44f1c3(_0x19eee9['result'][_0x88ee('0x2b')]);}})[_0x88ee('0x2c')](function(_0x5b914a){logger[_0x88ee('0x29')](_0x88ee('0x24'),_0x2a7abd,_0x5b914a);_0x4b1410(_0x5b914a);});});}function respondWithStatusCode(_0x433757,_0x4f114f){_0x4f114f=_0x4f114f||0xcc;return function(_0x5e21cb){if(_0x5e21cb){return _0x433757[_0x88ee('0x2d')](_0x4f114f);}return _0x433757[_0x88ee('0x2e')](_0x4f114f)[_0x88ee('0x2f')]();};}function respondWithResult(_0x57bf64,_0x31bc3f){_0x31bc3f=_0x31bc3f||0xc8;return function(_0x3c4f54){if(_0x3c4f54){return _0x57bf64[_0x88ee('0x2e')](_0x31bc3f)[_0x88ee('0x30')](_0x3c4f54);}};}function respondWithFilteredResult(_0x34f833,_0x3bcc16){return function(_0x481b29){if(_0x481b29){var _0x2d0b73=typeof _0x3bcc16[_0x88ee('0x31')]==='undefined'&&typeof _0x3bcc16['limit']===_0x88ee('0x32');var _0x1e9d13=_0x481b29[_0x88ee('0x33')];var _0xe5217b=_0x2d0b73?0x0:_0x3bcc16[_0x88ee('0x31')];var _0x270991=_0x2d0b73?_0x481b29[_0x88ee('0x33')]:_0x3bcc16[_0x88ee('0x31')]+_0x3bcc16['limit'];var _0x3308a7;if(_0x270991>=_0x1e9d13){_0x270991=_0x1e9d13;_0x3308a7=0xc8;}else{_0x3308a7=0xce;}_0x34f833[_0x88ee('0x2e')](_0x3308a7);return _0x34f833[_0x88ee('0x34')](_0x88ee('0x35'),_0xe5217b+'-'+_0x270991+'/'+_0x1e9d13)['json'](_0x481b29);}return null;};}function patchUpdates(_0x1409a1){return function(_0x59f938){try{jsonpatch[_0x88ee('0x36')](_0x59f938,_0x1409a1,!![]);}catch(_0x3ab1e7){return BPromise[_0x88ee('0x37')](_0x3ab1e7);}return _0x59f938[_0x88ee('0x38')]();};}function saveUpdates(_0xb4c778,_0x6fa959){return function(_0x5b9fbd){if(_0x5b9fbd){return _0x5b9fbd[_0x88ee('0x39')](_0xb4c778)[_0x88ee('0x22')](function(_0x2f2ae0){return _0x2f2ae0;});}return null;};}function removeEntity(_0x49451a,_0x1472b3){return function(_0x40e6bd){if(_0x40e6bd){return _0x40e6bd[_0x88ee('0x3a')]()[_0x88ee('0x22')](function(){var _0x4a6c2e=_0x40e6bd[_0x88ee('0x3b')]({'plain':!![]});var _0x2ff27c=_0x88ee('0x3c');return db[_0x88ee('0x3d')][_0x88ee('0x3a')]({'where':{'type':_0x2ff27c,'resourceId':_0x4a6c2e['id']}})[_0x88ee('0x22')](function(){return _0x40e6bd;});})['then'](function(){_0x49451a[_0x88ee('0x2e')](0xcc)[_0x88ee('0x2f')]();});}};}function handleEntityNotFound(_0x5abf6f,_0x2b8153){return function(_0x7006c4){if(!_0x7006c4){_0x5abf6f[_0x88ee('0x2d')](0x194);}return _0x7006c4;};}function handleError(_0x430af7,_0x2d3141){_0x2d3141=_0x2d3141||0x1f4;return function(_0x4e31cf){logger['error'](_0x4e31cf['stack']);if(_0x4e31cf[_0x88ee('0x3e')]){delete _0x4e31cf[_0x88ee('0x3e')];}_0x430af7['status'](_0x2d3141)[_0x88ee('0x3f')](_0x4e31cf);};}exports[_0x88ee('0x40')]=function(_0x17d216,_0x422854){var _0x242868={'include':[{'model':db['Pause'],'as':_0x88ee('0x41')}]},_0x2ba365={},_0x50bf40={'count':0x0,'rows':[]};var _0xd0cb80=_[_0x88ee('0x42')](db[_0x88ee('0x43')][_0x88ee('0x44')],function(_0x13c1b9){return{'name':_0x13c1b9[_0x88ee('0x45')],'type':_0x13c1b9[_0x88ee('0x46')][_0x88ee('0x47')]};});_0x2ba365['model']=_['map'](_0xd0cb80,'name');_0x2ba365[_0x88ee('0x48')]=_['keys'](_0x17d216[_0x88ee('0x48')]);_0x2ba365[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x2ba365[_0x88ee('0x4b')],_0x2ba365[_0x88ee('0x48')]);_0x242868[_0x88ee('0x4c')]=_[_0x88ee('0x4a')](_0x2ba365[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x17d216[_0x88ee('0x48')][_0x88ee('0x4d')]));_0x242868[_0x88ee('0x4c')]=_0x242868[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x242868[_0x88ee('0x4c')]:_0x2ba365['model'];if(!_0x17d216[_0x88ee('0x48')][_0x88ee('0x4f')]('nolimit')){_0x242868[_0x88ee('0x50')]=qs[_0x88ee('0x50')](_0x17d216['query'][_0x88ee('0x50')]);_0x242868['offset']=qs['offset'](_0x17d216[_0x88ee('0x48')][_0x88ee('0x31')]);}_0x242868['order']=qs[_0x88ee('0x51')](_0x17d216['query'][_0x88ee('0x51')]);_0x242868[_0x88ee('0x52')]=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x17d216['query'],_0x2ba365[_0x88ee('0x49')]),_0xd0cb80);if(_0x17d216['query'][_0x88ee('0x54')]){_0x242868[_0x88ee('0x52')]=_['merge'](_0x242868[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0xd0cb80,function(_0x211bc5){if(_0x211bc5[_0x88ee('0x46')]!==_0x88ee('0x55')){var _0x1ce090={};_0x1ce090[_0x211bc5[_0x88ee('0x3e')]]={'$like':'%'+_0x17d216[_0x88ee('0x48')][_0x88ee('0x54')]+'%'};return _0x1ce090;}})});}_0x242868=_[_0x88ee('0x56')]({},_0x242868,_0x17d216[_0x88ee('0x57')]);var _0x22ab7f={'where':_0x242868['where']};return db['WhatsappAccount'][_0x88ee('0x33')](_0x22ab7f)[_0x88ee('0x22')](function(_0x53ce46){_0x50bf40[_0x88ee('0x33')]=_0x53ce46;if(_0x17d216[_0x88ee('0x48')][_0x88ee('0x58')]){_0x242868[_0x88ee('0x59')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x88ee('0x5a')](_0x242868);})['then'](function(_0x22eb97){_0x50bf40[_0x88ee('0x5b')]=_0x22eb97;return _0x50bf40;})[_0x88ee('0x22')](respondWithFilteredResult(_0x422854,_0x242868))['catch'](handleError(_0x422854,null));};exports[_0x88ee('0x5c')]=function(_0x6de4e6,_0x89f756){var _0x57b04e={'raw':![],'where':{'id':_0x6de4e6['params']['id']},'include':[{'model':db[_0x88ee('0x5d')],'as':_0x88ee('0x41')}]},_0x4771cf={};_0x4771cf['model']=_[_0x88ee('0x5e')](db[_0x88ee('0x43')][_0x88ee('0x44')]);_0x4771cf['query']=_[_0x88ee('0x5e')](_0x6de4e6[_0x88ee('0x48')]);_0x4771cf[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x4771cf[_0x88ee('0x4b')],_0x4771cf[_0x88ee('0x48')]);_0x57b04e[_0x88ee('0x4c')]=_[_0x88ee('0x4a')](_0x4771cf[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x6de4e6['query']['fields']));_0x57b04e[_0x88ee('0x4c')]=_0x57b04e[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x57b04e['attributes']:_0x4771cf[_0x88ee('0x4b')];if(_0x6de4e6['query'][_0x88ee('0x58')]){_0x57b04e[_0x88ee('0x59')]=[{'all':!![]}];}_0x57b04e=_[_0x88ee('0x56')]({},_0x57b04e,_0x6de4e6[_0x88ee('0x57')]);return db[_0x88ee('0x43')][_0x88ee('0x5f')](_0x57b04e)[_0x88ee('0x22')](handleEntityNotFound(_0x89f756,null))[_0x88ee('0x22')](respondWithResult(_0x89f756,null))[_0x88ee('0x2c')](handleError(_0x89f756,null));};exports[_0x88ee('0x60')]=function(_0x686903,_0x225a5){return db[_0x88ee('0x43')][_0x88ee('0x60')](_0x686903[_0x88ee('0x61')],{})[_0x88ee('0x22')](function(_0x3330dc){var _0x5215e3=_0x686903['user'][_0x88ee('0x3b')]({'plain':!![]});if(!_0x5215e3)throw new Error(_0x88ee('0x62'));if(_0x5215e3[_0x88ee('0x63')]===_0x88ee('0x64')){var _0x5600b6=_0x3330dc[_0x88ee('0x3b')]({'plain':!![]});var _0x4bcffa=_0x88ee('0x3c');return db['UserProfileSection'][_0x88ee('0x5f')]({'where':{'name':_0x4bcffa,'userProfileId':_0x5215e3[_0x88ee('0x65')]},'raw':!![]})[_0x88ee('0x22')](function(_0x268ba0){if(_0x268ba0&&_0x268ba0[_0x88ee('0x66')]===0x0){return db[_0x88ee('0x3d')][_0x88ee('0x60')]({'name':_0x5600b6[_0x88ee('0x3e')],'resourceId':_0x5600b6['id'],'type':_0x268ba0[_0x88ee('0x3e')],'sectionId':_0x268ba0['id']},{})[_0x88ee('0x22')](function(){return _0x3330dc;});}else{return _0x3330dc;}})[_0x88ee('0x2c')](function(_0x3450b5){logger[_0x88ee('0x29')](_0x88ee('0x67'),_0x3450b5);throw _0x3450b5;});}return _0x3330dc;})[_0x88ee('0x22')](respondWithResult(_0x225a5,0xc9))[_0x88ee('0x2c')](handleError(_0x225a5,null));};exports[_0x88ee('0x39')]=function(_0x205c8d,_0x4fa6ff){if(_0x205c8d[_0x88ee('0x61')]['id']){delete _0x205c8d[_0x88ee('0x61')]['id'];}return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x205c8d[_0x88ee('0x68')]['id']},'include':[{'model':db[_0x88ee('0x5d')],'as':_0x88ee('0x41')}]})[_0x88ee('0x22')](handleEntityNotFound(_0x4fa6ff,null))[_0x88ee('0x22')](saveUpdates(_0x205c8d[_0x88ee('0x61')],null))[_0x88ee('0x22')](respondWithResult(_0x4fa6ff,null))['catch'](handleError(_0x4fa6ff,null));};exports[_0x88ee('0x3a')]=function(_0x3803cc,_0x1a81e0){return db['WhatsappAccount']['find']({'where':{'id':_0x3803cc['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x1a81e0,null))[_0x88ee('0x22')](removeEntity(_0x1a81e0,null))[_0x88ee('0x2c')](handleError(_0x1a81e0,null));};exports[_0x88ee('0x69')]=function(_0x1cc6e7,_0x5bbc37){return db[_0x88ee('0x43')][_0x88ee('0x69')]()['then'](respondWithResult(_0x5bbc37,null))[_0x88ee('0x2c')](handleError(_0x5bbc37,null));};exports[_0x88ee('0x6a')]=function(_0xe17e29,_0x254e41,_0x174821){if(_0xe17e29[_0x88ee('0x61')]['id']){delete _0xe17e29[_0x88ee('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0xe17e29['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x254e41,null))[_0x88ee('0x22')](function(_0xcdacb9){if(_0xcdacb9){_0xe17e29[_0x88ee('0x61')]['WhatsappAccountId']=_0xcdacb9['id'];return db['Disposition']['create'](_0xe17e29[_0x88ee('0x61')]);}})['then'](respondWithResult(_0x254e41,null))[_0x88ee('0x2c')](handleError(_0x254e41,null));};exports[_0x88ee('0x6b')]=function(_0x46cd2b,_0x530903,_0x3be9a5){var _0x5ac16e={'raw':![],'where':{}};var _0x1717eb={};var _0x264165={'count':0x0,'rows':[]};return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x46cd2b['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x530903,null))[_0x88ee('0x22')](function(_0x594e4b){if(_0x594e4b){_0x1717eb[_0x88ee('0x4b')]=_[_0x88ee('0x5e')](db[_0x88ee('0x6d')][_0x88ee('0x44')]);_0x1717eb[_0x88ee('0x48')]=_['keys'](_0x46cd2b[_0x88ee('0x48')]);_0x1717eb[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x1717eb[_0x88ee('0x4b')],_0x1717eb[_0x88ee('0x48')]);_0x5ac16e['attributes']=_[_0x88ee('0x4a')](_0x1717eb[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x46cd2b['query']['fields']));_0x5ac16e[_0x88ee('0x4c')]=_0x5ac16e[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x5ac16e[_0x88ee('0x4c')]:_0x1717eb[_0x88ee('0x4b')];if(!_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x5ac16e[_0x88ee('0x50')]=qs[_0x88ee('0x50')](_0x46cd2b['query'][_0x88ee('0x50')]);_0x5ac16e['offset']=qs[_0x88ee('0x31')](_0x46cd2b['query']['offset']);}_0x5ac16e[_0x88ee('0x6f')]=qs[_0x88ee('0x51')](_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x51')]);_0x5ac16e['where']=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x46cd2b[_0x88ee('0x48')],_0x1717eb[_0x88ee('0x49')]));_0x5ac16e[_0x88ee('0x52')][_0x88ee('0x70')]=_0x594e4b['id'];if(_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x54')]){_0x5ac16e[_0x88ee('0x52')]=_[_0x88ee('0x56')](_0x5ac16e[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x5ac16e[_0x88ee('0x4c')],function(_0x5a88c0){var _0x3e65ff={};_0x3e65ff[_0x5a88c0]={'$like':'%'+_0x46cd2b[_0x88ee('0x48')]['filter']+'%'};return _0x3e65ff;})});}_0x5ac16e=_[_0x88ee('0x56')]({},_0x5ac16e,_0x46cd2b['options']);return db[_0x88ee('0x6d')][_0x88ee('0x33')]({'where':_0x5ac16e['where']})[_0x88ee('0x22')](function(_0x1b26ae){_0x264165[_0x88ee('0x33')]=_0x1b26ae;if(_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x58')]){_0x5ac16e[_0x88ee('0x59')]=[{'all':!![]}];}return db[_0x88ee('0x6d')]['findAll'](_0x5ac16e);})['then'](function(_0x5613c4){_0x264165['rows']=_0x5613c4;return _0x264165;});}})['then'](respondWithFilteredResult(_0x530903,_0x5ac16e))[_0x88ee('0x2c')](handleError(_0x530903,null));};exports['removeDispositions']=function(_0x3911a7,_0x12bfed,_0x30e6b5){return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x3911a7[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x12bfed,null))[_0x88ee('0x22')](function(_0x1652bc){if(_0x1652bc){return _0x1652bc[_0x88ee('0x71')](_0x3911a7['query'][_0x88ee('0x72')]);}})[_0x88ee('0x22')](respondWithStatusCode(_0x12bfed,null))[_0x88ee('0x2c')](handleError(_0x12bfed,null));};exports[_0x88ee('0x73')]=function(_0x1fbbc4,_0x2b473d,_0x4c27da){if(_0x1fbbc4[_0x88ee('0x61')]['id']){delete _0x1fbbc4[_0x88ee('0x61')]['id'];}return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x1fbbc4[_0x88ee('0x68')]['id']}})['then'](handleEntityNotFound(_0x2b473d,null))[_0x88ee('0x22')](function(_0x182751){if(_0x182751){_0x1fbbc4[_0x88ee('0x61')][_0x88ee('0x70')]=_0x182751['id'];return db['CannedAnswer'][_0x88ee('0x60')](_0x1fbbc4['body']);}})['then'](respondWithResult(_0x2b473d,null))['catch'](handleError(_0x2b473d,null));};exports[_0x88ee('0x74')]=function(_0x5c4741,_0x484514,_0x1735b6){var _0x5948bc={'raw':![],'where':{}};var _0x451557={};var _0x37894b={'count':0x0,'rows':[]};return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x5c4741['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x484514,null))[_0x88ee('0x22')](function(_0x434b19){if(_0x434b19){_0x451557['model']=_[_0x88ee('0x5e')](db[_0x88ee('0x75')][_0x88ee('0x44')]);_0x451557[_0x88ee('0x48')]=_[_0x88ee('0x5e')](_0x5c4741['query']);_0x451557['filters']=_[_0x88ee('0x4a')](_0x451557['model'],_0x451557[_0x88ee('0x48')]);_0x5948bc[_0x88ee('0x4c')]=_[_0x88ee('0x4a')](_0x451557[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x5c4741[_0x88ee('0x48')][_0x88ee('0x4d')]));_0x5948bc['attributes']=_0x5948bc['attributes'][_0x88ee('0x4e')]?_0x5948bc[_0x88ee('0x4c')]:_0x451557[_0x88ee('0x4b')];if(!_0x5c4741[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x5948bc[_0x88ee('0x50')]=qs[_0x88ee('0x50')](_0x5c4741['query']['limit']);_0x5948bc[_0x88ee('0x31')]=qs[_0x88ee('0x31')](_0x5c4741[_0x88ee('0x48')][_0x88ee('0x31')]);}_0x5948bc[_0x88ee('0x6f')]=qs[_0x88ee('0x51')](_0x5c4741[_0x88ee('0x48')][_0x88ee('0x51')]);_0x5948bc['where']=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x5c4741[_0x88ee('0x48')],_0x451557[_0x88ee('0x49')]));_0x5948bc['where'][_0x88ee('0x70')]=_0x434b19['id'];if(_0x5c4741[_0x88ee('0x48')][_0x88ee('0x54')]){_0x5948bc[_0x88ee('0x52')]=_[_0x88ee('0x56')](_0x5948bc[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x5948bc['attributes'],function(_0x52a3f2){var _0x5082c7={};_0x5082c7[_0x52a3f2]={'$like':'%'+_0x5c4741['query'][_0x88ee('0x54')]+'%'};return _0x5082c7;})});}_0x5948bc=_[_0x88ee('0x56')]({},_0x5948bc,_0x5c4741['options']);return db[_0x88ee('0x75')][_0x88ee('0x33')]({'where':_0x5948bc['where']})[_0x88ee('0x22')](function(_0x54d5e3){_0x37894b[_0x88ee('0x33')]=_0x54d5e3;if(_0x5c4741[_0x88ee('0x48')][_0x88ee('0x58')]){_0x5948bc['include']=[{'all':!![]}];}return db[_0x88ee('0x75')][_0x88ee('0x5a')](_0x5948bc);})[_0x88ee('0x22')](function(_0x11c704){_0x37894b['rows']=_0x11c704;return _0x37894b;});}})[_0x88ee('0x22')](respondWithFilteredResult(_0x484514,_0x5948bc))[_0x88ee('0x2c')](handleError(_0x484514,null));};exports[_0x88ee('0x76')]=function(_0xbd70e2,_0x5f565a,_0x1ddb16){return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0xbd70e2[_0x88ee('0x68')]['id']}})['then'](handleEntityNotFound(_0x5f565a,null))[_0x88ee('0x22')](function(_0x14f94e){if(_0x14f94e){return _0x14f94e[_0x88ee('0x76')](_0xbd70e2[_0x88ee('0x48')][_0x88ee('0x72')]);}})[_0x88ee('0x22')](respondWithStatusCode(_0x5f565a,null))['catch'](handleError(_0x5f565a,null));};exports['addAgents']=function(_0x513714,_0x4da960,_0x26bc9a){return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x513714[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x4da960,null))['then'](function(_0x5987cb){if(_0x5987cb){return _0x5987cb[_0x88ee('0x77')](_0x513714[_0x88ee('0x61')][_0x88ee('0x72')],_[_0x88ee('0x78')](_0x513714['body'],[_0x88ee('0x72'),'id'])||{})[_0x88ee('0x79')](function(_0x548899){for(var _0x57edf9=0x0;_0x57edf9<_0x513714[_0x88ee('0x61')][_0x88ee('0x72')][_0x88ee('0x4e')];_0x57edf9+=0x1){socket[_0x88ee('0x7a')]('userWhatsappAccount:save',{'UserId':Number(_0x513714[_0x88ee('0x61')][_0x88ee('0x72')][_0x57edf9]),'WhatsappAccountId':Number(_0x513714[_0x88ee('0x68')]['id'])});}return _0x548899;});}})[_0x88ee('0x22')](respondWithResult(_0x4da960,null))['catch'](handleError(_0x4da960,null));};exports[_0x88ee('0x7b')]=function(_0x5da24f,_0x25f122,_0x407a0b){return db['WhatsappAccount'][_0x88ee('0x5f')]({'where':{'id':_0x5da24f[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x25f122,null))['then'](function(_0x3642ec){if(_0x3642ec){return _0x3642ec[_0x88ee('0x7b')](_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')])[_0x88ee('0x22')](function(){if(_[_0x88ee('0x7c')](_0x5da24f['query']['ids'])){for(var _0x569f8a=0x0;_0x569f8a<_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')][_0x88ee('0x4e')];_0x569f8a+=0x1){socket[_0x88ee('0x7a')]('userWhatsappAccount:remove',{'UserId':Number(_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')][_0x569f8a]),'WhatsappAccountId':Number(_0x5da24f[_0x88ee('0x68')]['id'])});}}else{socket['emit'](_0x88ee('0x7d'),{'UserId':Number(_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')]),'WhatsappAccountId':Number(_0x5da24f[_0x88ee('0x68')]['id'])});}});}})[_0x88ee('0x22')](respondWithStatusCode(_0x25f122,null))['catch'](handleError(_0x25f122,null));};exports[_0x88ee('0x7e')]=function(_0x58404f,_0x3d7690,_0x108507){var _0x2c1eac={};var _0x5a908d={};var _0x3f7a1e;var _0x4d52ac;return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x58404f[_0x88ee('0x68')]['id']}})['then'](handleEntityNotFound(_0x3d7690,null))[_0x88ee('0x22')](function(_0x38da6e){if(_0x38da6e){_0x3f7a1e=_0x38da6e;_0x5a908d[_0x88ee('0x4b')]=_[_0x88ee('0x5e')](db[_0x88ee('0x7f')]['rawAttributes']);_0x5a908d[_0x88ee('0x48')]=_[_0x88ee('0x5e')](_0x58404f[_0x88ee('0x48')]);_0x5a908d[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x5a908d[_0x88ee('0x4b')],_0x5a908d[_0x88ee('0x48')]);_0x2c1eac[_0x88ee('0x4c')]=_['intersection'](_0x5a908d[_0x88ee('0x4b')],qs['fields'](_0x58404f[_0x88ee('0x48')][_0x88ee('0x4d')]));_0x2c1eac[_0x88ee('0x4c')]=_0x2c1eac['attributes'][_0x88ee('0x4e')]?_0x2c1eac[_0x88ee('0x4c')]:_0x5a908d[_0x88ee('0x4b')];_0x2c1eac[_0x88ee('0x6f')]=qs[_0x88ee('0x51')](_0x58404f['query']['sort']);_0x2c1eac['where']=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x58404f[_0x88ee('0x48')],_0x5a908d['filters']));if(_0x58404f['query'][_0x88ee('0x54')]){_0x2c1eac['where']=_[_0x88ee('0x56')](_0x2c1eac[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x2c1eac[_0x88ee('0x4c')],function(_0x2f0509){var _0x1555a8={};_0x1555a8[_0x2f0509]={'$like':'%'+_0x58404f[_0x88ee('0x48')][_0x88ee('0x54')]+'%'};return _0x1555a8;})});}_0x2c1eac=_[_0x88ee('0x56')]({},_0x2c1eac,_0x58404f[_0x88ee('0x57')]);return _0x3f7a1e[_0x88ee('0x7e')](_0x2c1eac);}})['then'](function(_0x24b68a){if(_0x24b68a){_0x4d52ac=_0x24b68a[_0x88ee('0x4e')];if(!_0x58404f[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x2c1eac[_0x88ee('0x50')]=qs['limit'](_0x58404f[_0x88ee('0x48')][_0x88ee('0x50')]);_0x2c1eac[_0x88ee('0x31')]=qs['offset'](_0x58404f['query'][_0x88ee('0x31')]);}return _0x3f7a1e[_0x88ee('0x7e')](_0x2c1eac);}})[_0x88ee('0x22')](function(_0x12dd2a){if(_0x12dd2a){return _0x12dd2a?{'count':_0x4d52ac,'rows':_0x12dd2a}:null;}})['then'](respondWithResult(_0x3d7690,null))[_0x88ee('0x2c')](handleError(_0x3d7690,null));};exports[_0x88ee('0x80')]=function(_0x549b18,_0x182769){var _0x4c3f39=_0x549b18[_0x88ee('0x68')]['id'];var _0x407146=_0x549b18[_0x88ee('0x61')];var _0x286f89=0xc8;var _0x46071f=null;return db[_0x88ee('0x81')][_0x88ee('0x82')]({'isolationLevel':db[_0x88ee('0x81')][_0x88ee('0x83')][_0x88ee('0x84')]['READ_COMMITTED']},function(_0x258273){return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x4c3f39},'transaction':_0x258273})[_0x88ee('0x22')](function(_0x425652){if(_0x425652){return db[_0x88ee('0x85')][_0x88ee('0x3a')]({'where':{'WhatsappAccountId':_0x4c3f39},'transaction':_0x258273})['then'](function(){var _0x1b23ba=_[_0x88ee('0x42')](_0x407146,function(_0x5251e6){_0x5251e6['WhatsappAccountId']=_0x4c3f39;return _0x5251e6;});return db[_0x88ee('0x85')][_0x88ee('0x86')](_0x1b23ba,{'transaction':_0x258273});});}else{_0x286f89=0x194;_0x46071f=[];}});})[_0x88ee('0x22')](function(){if(_0x286f89!==0x194){return db['WhatsappApplication'][_0x88ee('0x87')]({'where':{'WhatsappAccountId':_0x4c3f39},'order':_0x88ee('0x88')})[_0x88ee('0x22')](function(_0x4a1456){_0x46071f=_0x4a1456;});}})['catch'](function(_0x527c10){_0x286f89=0x1f4;logger[_0x88ee('0x29')](_0x527c10[_0x88ee('0x89')]);if(_0x527c10[_0x88ee('0x3e')]){delete _0x527c10[_0x88ee('0x3e')];}_0x46071f=_0x527c10;})[_0x88ee('0x8a')](function(){if(_0x46071f===null){_0x182769[_0x88ee('0x2d')](_0x286f89);}else{if(_0x286f89===0x1f4){_0x182769[_0x88ee('0x2e')](_0x286f89)['send'](_0x46071f);}else{_0x182769['status'](_0x286f89)['json'](_0x46071f);}}});};exports['getApplications']=function(_0x392ade,_0x1f973a,_0x253f6d){var _0x5919d4={};var _0x57e77d={};var _0x5192d9;var _0x2c50a7;return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x392ade[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x1f973a,null))['then'](function(_0x368a9b){if(_0x368a9b){_0x5192d9=_0x368a9b;_0x57e77d['model']=_['keys'](db[_0x88ee('0x85')][_0x88ee('0x44')]);_0x57e77d[_0x88ee('0x48')]=_['keys'](_0x392ade['query']);_0x57e77d[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x57e77d[_0x88ee('0x4b')],_0x57e77d['query']);_0x5919d4['attributes']=_[_0x88ee('0x4a')](_0x57e77d['model'],qs[_0x88ee('0x4d')](_0x392ade['query'][_0x88ee('0x4d')]));_0x5919d4[_0x88ee('0x4c')]=_0x5919d4[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x5919d4[_0x88ee('0x4c')]:_0x57e77d['model'];_0x5919d4['order']=qs[_0x88ee('0x51')](_0x392ade[_0x88ee('0x48')][_0x88ee('0x51')]);_0x5919d4[_0x88ee('0x52')]=qs['filters'](_['pick'](_0x392ade[_0x88ee('0x48')],_0x57e77d[_0x88ee('0x49')]));if(_0x392ade[_0x88ee('0x48')][_0x88ee('0x54')]){_0x5919d4[_0x88ee('0x52')]=_[_0x88ee('0x56')](_0x5919d4[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x5919d4[_0x88ee('0x4c')],function(_0x5b2f51){var _0x2e2e35={};_0x2e2e35[_0x5b2f51]={'$like':'%'+_0x392ade[_0x88ee('0x48')][_0x88ee('0x54')]+'%'};return _0x2e2e35;})});}_0x5919d4=_[_0x88ee('0x56')]({},_0x5919d4,_0x392ade[_0x88ee('0x57')]);return _0x5192d9[_0x88ee('0x8b')](_0x5919d4);}})['then'](function(_0x59ce8d){if(_0x59ce8d){_0x2c50a7=_0x59ce8d[_0x88ee('0x4e')];if(!_0x392ade[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x5919d4['limit']=qs[_0x88ee('0x50')](_0x392ade['query']['limit']);_0x5919d4['offset']=qs[_0x88ee('0x31')](_0x392ade[_0x88ee('0x48')][_0x88ee('0x31')]);}return _0x5192d9['getApplications'](_0x5919d4);}})[_0x88ee('0x22')](function(_0x1b579e){if(_0x1b579e){return _0x1b579e?{'count':_0x2c50a7,'rows':_0x1b579e}:null;}})[_0x88ee('0x22')](respondWithResult(_0x1f973a,null))[_0x88ee('0x2c')](handleError(_0x1f973a,null));};exports['notify']=function(_0x3ebf9c,_0x2ab653,_0xe9f417){var _0x178c1a={'channel':'whatsapp'};var _0x3c8937=[];var _0x54da61=[];var _0x51a5e4={};return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x3ebf9c[_0x88ee('0x68')]['id']},'include':[{'model':db[_0x88ee('0x85')],'as':_0x88ee('0x8c')}]})[_0x88ee('0x22')](handleEntityNotFound(_0x2ab653,null))[_0x88ee('0x22')](function(_0x55ea36){_0x178c1a[_0x88ee('0x8d')]=_0x55ea36;if(_0x178c1a[_0x88ee('0x8d')]&&_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]===_0x88ee('0x8e')&&_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')]){if(_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')][_0x88ee('0x4e')]===0x0)return;if(_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')][0x0][_0x88ee('0x90')]!==_0x88ee('0x91'))return;return db['WhatsappMessage'][_0x88ee('0x39')]({'read':!![],'readAt':_0x3ebf9c['body'][_0x88ee('0x8f')][0x0][_0x88ee('0x92')]},{'where':{'messageId':_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')][0x0][_0x88ee('0x93')]},'individualHooks':!![]})[_0x88ee('0x22')](function(_0x408e54){return _0x2ab653[_0x88ee('0x2e')](0xc8)[_0x88ee('0x30')](_0x408e54);});}_0x178c1a[_0x88ee('0x94')]=_[_0x88ee('0x95')](_0x55ea36['Applications'],[_0x88ee('0x88')],['asc']);if(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x8c')]){delete _0x178c1a[_0x88ee('0x8d')]['Applications'];}return db[_0x88ee('0x96')][_0x88ee('0x69')]()[_0x88ee('0x22')](function(_0x4d7471){if(!_0x4d7471){throw new db['Sequelize'][(_0x88ee('0x97'))](_0x88ee('0x98'));}_0x3c8937=_[_0x88ee('0x99')](_[_0x88ee('0x5e')](_0x4d7471),['createdAt','updatedAt']);_0x54da61=_[_0x88ee('0x99')](_[_0x88ee('0x5e')](_0x4d7471),[_0x88ee('0x9a'),_0x88ee('0x9b'),_0x88ee('0x9c'),_0x88ee('0x9d')]);_0x178c1a[_0x88ee('0x61')]={'mapKey':'mobile'};if(_0x178c1a['account']&&_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]===_0x88ee('0x9e')){_0x178c1a[_0x88ee('0x61')][_0x88ee('0x9f')]=_0x3ebf9c['body'][_0x88ee('0xa0')]['replace']('whatsapp:','');_0x178c1a[_0x88ee('0x61')][_0x88ee('0x61')]=_0x3ebf9c['body'][_0x88ee('0xa1')];_0x178c1a['body'][_0x88ee('0xa2')]=_0x3ebf9c[_0x88ee('0x61')]['MessageSid'];}if(_0x178c1a[_0x88ee('0x8d')]&&_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]===_0x88ee('0x8e')){_0x178c1a['body'][_0x88ee('0x9f')]=_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0xa3')][0x0]['from'];_0x178c1a['body']['body']=_0x3ebf9c['body'][_0x88ee('0xa3')][0x0][_0x88ee('0x2b')]['body'];_0x178c1a[_0x88ee('0x61')][_0x88ee('0xa2')]=_0x3ebf9c[_0x88ee('0x61')]['notifications'][0x0]['message_id'];}if(_0x178c1a[_0x88ee('0x61')]['id']){delete _0x178c1a[_0x88ee('0x61')]['id'];}if(_[_0x88ee('0xa4')](_0x178c1a[_0x88ee('0x61')]['from'])){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))]('from\x20is\x20mandatory');}if(_[_0x88ee('0xa4')](_0x178c1a[_0x88ee('0x61')][_0x88ee('0x61')])||_0x178c1a[_0x88ee('0x61')][_0x88ee('0x61')]===''){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))](_0x88ee('0xa6'));}if(_[_0x88ee('0xa4')](_0x178c1a[_0x88ee('0x61')][_0x88ee('0xa7')])){throw new db['Sequelize'][(_0x88ee('0x97'))](_0x88ee('0xa8')+_0x54da61);}if(!_[_0x88ee('0xa9')](_0x54da61,_0x178c1a['body']['mapKey'])){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))](_0x88ee('0xaa')+_0x54da61);}_0x51a5e4[_0x178c1a['body']['mapKey']]=_0x178c1a[_0x88ee('0x61')][_0x88ee('0x9f')];return db[_0x88ee('0xab')]['find']({'where':{'id':_0x178c1a['account'][_0x88ee('0x9d')]},'include':[{'model':db[_0x88ee('0x96')],'as':_0x88ee('0xac'),'where':_0x51a5e4,'limit':0x1,'order':[[_0x88ee('0x9b'),_0x88ee('0xad')]]}]});})['then'](handleEntityNotFound(_0x2ab653,null))['then'](function(_0x308311){if(_0x308311){_0x178c1a['list']=_['omit'](_0x308311,[_0x88ee('0xac')]);if(_0x308311['Contacts']['length']){return _0x308311['Contacts'][0x0];}var _0x2a6da4=_[_0x88ee('0x18')](_0x178c1a['body'],{'firstName':_0x178c1a['body'][_0x88ee('0x9f')],'ListId':_0x308311['id']});_0x2a6da4[_0x178c1a['body'][_0x88ee('0xa7')]]=_0x178c1a['body']['from'];return db[_0x88ee('0x96')]['create'](_0x2a6da4,{'fields':_0x3c8937,'raw':!![]});}})[_0x88ee('0x22')](handleEntityNotFound(_0x2ab653,null))[_0x88ee('0x22')](function(_0x25d504){if(_0x25d504){_0x178c1a['contact']=_0x25d504;var _0x1110dd={'ContactId':_0x25d504['id'],'phone':_0x178c1a[_0x88ee('0x61')][_0x88ee('0x9f')],'WhatsappAccountId':_0x3ebf9c[_0x88ee('0x68')]['id']};var _0x21a5cc={'ContactId':_0x25d504['id'],'WhatsappAccountId':_0x3ebf9c[_0x88ee('0x68')]['id'],'closed':![]};return db[_0x88ee('0xae')][_0x88ee('0x5f')]({'where':_0x21a5cc})[_0x88ee('0x22')](function(_0x3882f7){if(_0x3882f7){return[_0x3882f7,![]];}return db[_0x88ee('0xae')][_0x88ee('0x60')](_0x1110dd)[_0x88ee('0x22')](function(_0x3b0710){return[_0x3b0710,!![]];});});}})['spread'](function(_0x390f29,_0xd4f42d){_0x178c1a[_0x88ee('0xaf')]=_0x390f29[_0x88ee('0x3b')]({'plain':!![]});_0x178c1a['interaction'][_0x88ee('0xb0')]=![];if(_0xd4f42d){if(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0xb1')]){_0x178c1a[_0x88ee('0x94')][_0x88ee('0xb2')]({'id':0x0,'priority':_0x178c1a[_0x88ee('0x94')][_0x88ee('0x4e')]+0x1,'app':_0x88ee('0xb3'),'appdata':'unmanaged','interval':_0x88ee('0xb4')});}_0x178c1a['interaction'][_0x88ee('0xb0')]=!![];}return db[_0x88ee('0xb5')]['create']({'phone':_0x178c1a['body'][_0x88ee('0x9f')],'messageId':_0x178c1a['body'][_0x88ee('0xa2')],'body':_0x178c1a[_0x88ee('0x61')]['body'],'WhatsappAccountId':_0x3ebf9c[_0x88ee('0x68')]['id'],'WhatsappInteractionId':_0x390f29['id'],'direction':'in','ContactId':_0x390f29[_0x88ee('0xb6')],'AttachmentId':_0x178c1a[_0x88ee('0x61')][_0x88ee('0xb7')]});})[_0x88ee('0x22')](function(_0x6bf510){_0x178c1a[_0x88ee('0x2b')]=_0x6bf510;if(_0x178c1a['interaction'][_0x88ee('0xb8')]){return db[_0x88ee('0x7f')]['find']({'attributes':['id','name'],'where':{'id':_0x178c1a[_0x88ee('0xaf')][_0x88ee('0xb8')]}})[_0x88ee('0x22')](function(_0xad1402){if(_0xad1402){_0x178c1a[_0x88ee('0x94')][_0x88ee('0xb9')]({'id':0x0,'priority':0x0,'app':_0x88ee('0xba'),'appdata':_0xad1402[_0x88ee('0x3e')]+','+(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0xbb')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x88ee('0xbc'),_0x178c1a);});}return respondWithRpcPromise('Start',_0x88ee('0xbc'),_0x178c1a);})[_0x88ee('0x22')](function(_0x2d74f1){if(_0x2d74f1){var _0x5abf63=0xc8;var _0x47a3ca=_0x88ee('0xbd');logger[_0x88ee('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x47a3ca,_0x5abf63,_0x88ee('0xbe'));logger[_0x88ee('0x25')](_0x88ee('0xbf'),_0x47a3ca,_0x5abf63,'entity\x20found',JSON[_0x88ee('0x28')](_0x2d74f1));if(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]==='twilio'){return _0x2ab653['status'](_0x5abf63)[_0x88ee('0x34')](_0x88ee('0xc0'),_0x88ee('0xc1'))[_0x88ee('0x3f')](_0x88ee('0xc2'));}else{return _0x2ab653[_0x88ee('0x2e')](_0x5abf63)[_0x88ee('0x30')](_0x2d74f1);}}});})[_0x88ee('0x2c')](handleError(_0x2ab653,null));};exports[_0x88ee('0x3f')]=function(_0x518e61,_0x39ed8d,_0x56215d){var _0x11e480,_0x394bea,_0x46acad;if(_['isNil'](_0x518e61['body'][_0x88ee('0x61')])||_0x518e61['body']['body']===''){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x88ee('0xa4')](_0x518e61[_0x88ee('0x61')]['to'])){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))](_0x88ee('0xc3'));}_0x11e480=_0x518e61[_0x88ee('0x61')]['to'];return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x518e61['params']['id']},'include':[{'model':db[_0x88ee('0xab')],'as':'List','include':[{'model':db[_0x88ee('0x96')],'as':_0x88ee('0xac'),'where':{'mobile':_0x11e480},'limit':0x1,'order':[[_0x88ee('0x9b'),'DESC']]}]}]})[_0x88ee('0x22')](handleEntityNotFound(_0x39ed8d,null))[_0x88ee('0x22')](function(_0x43d80b){if(_0x43d80b&&_0x43d80b[_0x88ee('0xc4')]){_0x394bea=_0x43d80b[_0x88ee('0x3b')]({'plain':!![]});if(_0x394bea[_0x88ee('0xc4')]&&_0x394bea[_0x88ee('0xc4')]['Contacts']['length']){return _0x394bea[_0x88ee('0xc4')][_0x88ee('0xac')][0x0];}return db['CmContact']['create'](_[_0x88ee('0x18')](_0x518e61[_0x88ee('0x61')],{'firstName':_0x11e480,'mobile':_0x11e480,'phone':_0x11e480,'ListId':_0x394bea[_0x88ee('0x9d')]}));}})['then'](handleEntityNotFound(_0x39ed8d,null))['then'](function(_0x178c38){if(_0x178c38){_0x46acad=_0x178c38;return db[_0x88ee('0xae')][_0x88ee('0x5f')]({'where':{'ContactId':_0x46acad['id'],'closed':![],'WhatsappAccountId':_0x394bea['id']}})[_0x88ee('0x22')](function(_0x41446f){if(_0x41446f){return[_0x41446f,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x518e61['user']['id'],'ContactId':_0x46acad['id'],'WhatsappAccountId':_0x394bea['id'],'phone':_0x11e480,'firstMsgDirection':_0x88ee('0xc5'),'Messages':[_[_0x88ee('0x56')](_0x518e61[_0x88ee('0x61')],{'read':![],'body':_0x518e61[_0x88ee('0x61')][_0x88ee('0x61')],'phone':_0x11e480,'WhatsappAccountId':_0x394bea['id'],'UserId':_0x518e61[_0x88ee('0x64')]['id'],'ContactId':_0x46acad['id']})]},{'include':[{'model':db[_0x88ee('0xb5')],'as':_0x88ee('0xc6')}]})['then'](function(_0x415f67){return[_0x415f67,!![]];});});}})[_0x88ee('0x79')](function(_0x4b302e,_0x26a628){if(_0x26a628){return _0x4b302e;}return db['WhatsappMessage']['create'](_[_0x88ee('0x56')](_0x518e61[_0x88ee('0x61')],{'read':![],'body':_0x518e61[_0x88ee('0x61')]['body'],'phone':_0x11e480,'WhatsappAccountId':_0x394bea['id'],'WhatsappInteractionId':_0x4b302e['id'],'UserId':_0x518e61['user']['id'],'ContactId':_0x46acad['id']}))[_0x88ee('0x22')](function(_0x1ce425){_0x4b302e['dataValues'][_0x88ee('0xc6')]=[];_0x4b302e['dataValues']['Messages'][_0x88ee('0xb2')](_0x1ce425[_0x88ee('0xc7')]);return _0x4b302e;});})['then'](respondWithResult(_0x39ed8d,null))[_0x88ee('0x2c')](handleError(_0x39ed8d,null));}; \ No newline at end of file +var _0xd684=['zip-dir','fast-json-patch','request-promise','moment','bluebird','path','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/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','destroy','get','UserProfileResource','end','stack','name','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappAccount','include','findAll','rows','params','Pause','mandatoryDispositionPause','keys','includeAll','find','create','user','role','userProfileId','update','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','length','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','getAgents','User','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','account','sinch','statuses','WhatsappMessage','applications','orderBy','Applications','asc','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','from','From','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','created','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','Content-Type','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','rimraf'];(function(_0x20778c,_0x9c81a0){var _0x32d193=function(_0x43ece6){while(--_0x43ece6){_0x20778c['push'](_0x20778c['shift']());}};_0x32d193(++_0x9c81a0);}(_0xd684,0xb6));var _0x4d68=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xd684[_0x17784a];return _0x41aded;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d68('0x0'));var zipdir=require(_0x4d68('0x1'));var jsonpatch=require(_0x4d68('0x2'));var rp=require(_0x4d68('0x3'));var moment=require(_0x4d68('0x4'));var BPromise=require(_0x4d68('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4d68('0x6'));var sox=require(_0x4d68('0x7'));var csv=require(_0x4d68('0x8'));var ejs=require(_0x4d68('0x9'));var fs=require('fs');var fs_extra=require(_0x4d68('0xa'));var _=require(_0x4d68('0xb'));var squel=require(_0x4d68('0xc'));var crypto=require(_0x4d68('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4d68('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4d68('0xf'));var Papa=require('papaparse');var Redis=require(_0x4d68('0x10'));var authService=require(_0x4d68('0x11'));var qs=require(_0x4d68('0x12'));var as=require(_0x4d68('0x13'));var hardwareService=require(_0x4d68('0x14'));var logger=require(_0x4d68('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4d68('0x16'));var db=require(_0x4d68('0x17'))['db'];config[_0x4d68('0x18')]=_[_0x4d68('0x19')](config['redis'],{'host':_0x4d68('0x1a'),'port':0x18eb});var socket=require(_0x4d68('0x1b'))(new Redis(config[_0x4d68('0x18')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x4d68('0x1c'));var client=jayson['client'][_0x4d68('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x242491,_0x79299f,_0xcfb7d8,_0xd21bdf){return new BPromise(function(_0x2291db,_0x580e54){var _0x19b0f4=_0xd21bdf||client;return _0x19b0f4[_0x4d68('0x1e')](_0x242491,_0xcfb7d8)[_0x4d68('0x1f')](function(_0x42715b){logger[_0x4d68('0x20')](_0x4d68('0x21'),_0x79299f,_0x4d68('0x22'));logger[_0x4d68('0x23')](_0x4d68('0x24'),_0x79299f,_0x4d68('0x22'),JSON[_0x4d68('0x25')](_0x42715b));if(_0x42715b[_0x4d68('0x26')]){if(_0x42715b['error'][_0x4d68('0x27')]===0x1f4){logger['error'](_0x4d68('0x21'),_0x79299f,_0x42715b[_0x4d68('0x26')]['message']);return _0x580e54(_0x42715b[_0x4d68('0x26')][_0x4d68('0x28')]);}logger[_0x4d68('0x26')](_0x4d68('0x21'),_0x79299f,_0x42715b[_0x4d68('0x26')][_0x4d68('0x28')]);return _0x2291db(_0x42715b[_0x4d68('0x26')][_0x4d68('0x28')]);}else{logger[_0x4d68('0x20')](_0x4d68('0x21'),_0x79299f,_0x4d68('0x22'));_0x2291db(_0x42715b[_0x4d68('0x29')][_0x4d68('0x28')]);}})[_0x4d68('0x2a')](function(_0x139683){logger[_0x4d68('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x79299f,_0x139683);_0x580e54(_0x139683);});});}function respondWithStatusCode(_0x29b426,_0x420377){_0x420377=_0x420377||0xcc;return function(_0x3d9d06){if(_0x3d9d06){return _0x29b426[_0x4d68('0x2b')](_0x420377);}return _0x29b426[_0x4d68('0x2c')](_0x420377)['end']();};}function respondWithResult(_0x2b5d9e,_0xd5b5c2){_0xd5b5c2=_0xd5b5c2||0xc8;return function(_0x350d14){if(_0x350d14){return _0x2b5d9e[_0x4d68('0x2c')](_0xd5b5c2)[_0x4d68('0x2d')](_0x350d14);}};}function respondWithFilteredResult(_0x589adf,_0x26d129){return function(_0xd7b518){if(_0xd7b518){var _0x5e0429=typeof _0x26d129[_0x4d68('0x2e')]===_0x4d68('0x2f')&&typeof _0x26d129[_0x4d68('0x30')]===_0x4d68('0x2f');var _0x3632a8=_0xd7b518[_0x4d68('0x31')];var _0x556b1a=_0x5e0429?0x0:_0x26d129[_0x4d68('0x2e')];var _0x56450f=_0x5e0429?_0xd7b518[_0x4d68('0x31')]:_0x26d129['offset']+_0x26d129[_0x4d68('0x30')];var _0x1b0dd1;if(_0x56450f>=_0x3632a8){_0x56450f=_0x3632a8;_0x1b0dd1=0xc8;}else{_0x1b0dd1=0xce;}_0x589adf[_0x4d68('0x2c')](_0x1b0dd1);return _0x589adf[_0x4d68('0x32')]('Content-Range',_0x556b1a+'-'+_0x56450f+'/'+_0x3632a8)[_0x4d68('0x2d')](_0xd7b518);}return null;};}function patchUpdates(_0x4f73de){return function(_0x34fd18){try{jsonpatch['apply'](_0x34fd18,_0x4f73de,!![]);}catch(_0x2ae4e4){return BPromise[_0x4d68('0x33')](_0x2ae4e4);}return _0x34fd18[_0x4d68('0x34')]();};}function saveUpdates(_0x52f322,_0xb5058a){return function(_0x12632f){if(_0x12632f){return _0x12632f['update'](_0x52f322)['then'](function(_0x2e497b){return _0x2e497b;});}return null;};}function removeEntity(_0x712632,_0x3f1dcf){return function(_0x2f44df){if(_0x2f44df){return _0x2f44df[_0x4d68('0x35')]()[_0x4d68('0x1f')](function(){var _0x4a8147=_0x2f44df[_0x4d68('0x36')]({'plain':!![]});var _0x5b2130='WhatsappAccounts';return db[_0x4d68('0x37')]['destroy']({'where':{'type':_0x5b2130,'resourceId':_0x4a8147['id']}})[_0x4d68('0x1f')](function(){return _0x2f44df;});})['then'](function(){_0x712632[_0x4d68('0x2c')](0xcc)[_0x4d68('0x38')]();});}};}function handleEntityNotFound(_0x128825,_0x4ed456){return function(_0x7bd724){if(!_0x7bd724){_0x128825[_0x4d68('0x2b')](0x194);}return _0x7bd724;};}function handleError(_0x31df18,_0x548751){_0x548751=_0x548751||0x1f4;return function(_0x4d77c9){logger[_0x4d68('0x26')](_0x4d77c9[_0x4d68('0x39')]);if(_0x4d77c9[_0x4d68('0x3a')]){delete _0x4d77c9[_0x4d68('0x3a')];}_0x31df18[_0x4d68('0x2c')](_0x548751)['send'](_0x4d77c9);};}exports[_0x4d68('0x3b')]=function(_0x1e9959,_0x1830b3){var _0x21c5ee={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x44134f={},_0x27c45c={'count':0x0,'rows':[]};var _0x82c4f0=_[_0x4d68('0x3c')](db['WhatsappAccount'][_0x4d68('0x3d')],function(_0x1ed773){return{'name':_0x1ed773['fieldName'],'type':_0x1ed773[_0x4d68('0x3e')]['key']};});_0x44134f[_0x4d68('0x3f')]=_[_0x4d68('0x3c')](_0x82c4f0,_0x4d68('0x3a'));_0x44134f[_0x4d68('0x40')]=_['keys'](_0x1e9959[_0x4d68('0x40')]);_0x44134f[_0x4d68('0x41')]=_[_0x4d68('0x42')](_0x44134f[_0x4d68('0x3f')],_0x44134f['query']);_0x21c5ee[_0x4d68('0x43')]=_['intersection'](_0x44134f['model'],qs[_0x4d68('0x44')](_0x1e9959[_0x4d68('0x40')]['fields']));_0x21c5ee[_0x4d68('0x43')]=_0x21c5ee[_0x4d68('0x43')]['length']?_0x21c5ee[_0x4d68('0x43')]:_0x44134f[_0x4d68('0x3f')];if(!_0x1e9959['query'][_0x4d68('0x45')](_0x4d68('0x46'))){_0x21c5ee[_0x4d68('0x30')]=qs[_0x4d68('0x30')](_0x1e9959['query']['limit']);_0x21c5ee[_0x4d68('0x2e')]=qs[_0x4d68('0x2e')](_0x1e9959[_0x4d68('0x40')][_0x4d68('0x2e')]);}_0x21c5ee[_0x4d68('0x47')]=qs[_0x4d68('0x48')](_0x1e9959[_0x4d68('0x40')][_0x4d68('0x48')]);_0x21c5ee[_0x4d68('0x49')]=qs[_0x4d68('0x41')](_[_0x4d68('0x4a')](_0x1e9959[_0x4d68('0x40')],_0x44134f[_0x4d68('0x41')]),_0x82c4f0);if(_0x1e9959['query'][_0x4d68('0x4b')]){_0x21c5ee[_0x4d68('0x49')]=_[_0x4d68('0x4c')](_0x21c5ee['where'],{'$or':_['map'](_0x82c4f0,function(_0x49f3d9){if(_0x49f3d9[_0x4d68('0x3e')]!==_0x4d68('0x4d')){var _0xf04d0b={};_0xf04d0b[_0x49f3d9[_0x4d68('0x3a')]]={'$like':'%'+_0x1e9959[_0x4d68('0x40')][_0x4d68('0x4b')]+'%'};return _0xf04d0b;}})});}_0x21c5ee=_['merge']({},_0x21c5ee,_0x1e9959[_0x4d68('0x4e')]);var _0x1be874={'where':_0x21c5ee[_0x4d68('0x49')]};return db[_0x4d68('0x4f')][_0x4d68('0x31')](_0x1be874)[_0x4d68('0x1f')](function(_0x2d8890){_0x27c45c[_0x4d68('0x31')]=_0x2d8890;if(_0x1e9959[_0x4d68('0x40')]['includeAll']){_0x21c5ee[_0x4d68('0x50')]=[{'all':!![]}];}return db[_0x4d68('0x4f')][_0x4d68('0x51')](_0x21c5ee);})[_0x4d68('0x1f')](function(_0x3ea18a){_0x27c45c[_0x4d68('0x52')]=_0x3ea18a;return _0x27c45c;})[_0x4d68('0x1f')](respondWithFilteredResult(_0x1830b3,_0x21c5ee))[_0x4d68('0x2a')](handleError(_0x1830b3,null));};exports['show']=function(_0x2fc8b0,_0x5380a2){var _0x542429={'raw':![],'where':{'id':_0x2fc8b0[_0x4d68('0x53')]['id']},'include':[{'model':db[_0x4d68('0x54')],'as':_0x4d68('0x55')}]},_0x396f4f={};_0x396f4f['model']=_[_0x4d68('0x56')](db[_0x4d68('0x4f')][_0x4d68('0x3d')]);_0x396f4f[_0x4d68('0x40')]=_[_0x4d68('0x56')](_0x2fc8b0[_0x4d68('0x40')]);_0x396f4f['filters']=_[_0x4d68('0x42')](_0x396f4f[_0x4d68('0x3f')],_0x396f4f[_0x4d68('0x40')]);_0x542429[_0x4d68('0x43')]=_[_0x4d68('0x42')](_0x396f4f['model'],qs[_0x4d68('0x44')](_0x2fc8b0[_0x4d68('0x40')][_0x4d68('0x44')]));_0x542429[_0x4d68('0x43')]=_0x542429[_0x4d68('0x43')]['length']?_0x542429[_0x4d68('0x43')]:_0x396f4f[_0x4d68('0x3f')];if(_0x2fc8b0[_0x4d68('0x40')][_0x4d68('0x57')]){_0x542429[_0x4d68('0x50')]=[{'all':!![]}];}_0x542429=_[_0x4d68('0x4c')]({},_0x542429,_0x2fc8b0[_0x4d68('0x4e')]);return db[_0x4d68('0x4f')][_0x4d68('0x58')](_0x542429)[_0x4d68('0x1f')](handleEntityNotFound(_0x5380a2,null))[_0x4d68('0x1f')](respondWithResult(_0x5380a2,null))['catch'](handleError(_0x5380a2,null));};exports['create']=function(_0x267b5f,_0x5391e2){return db[_0x4d68('0x4f')][_0x4d68('0x59')](_0x267b5f['body'],{})[_0x4d68('0x1f')](function(_0x243aa1){var _0x595648=_0x267b5f[_0x4d68('0x5a')]['get']({'plain':!![]});if(!_0x595648)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x595648[_0x4d68('0x5b')]==='user'){var _0x8c140c=_0x243aa1[_0x4d68('0x36')]({'plain':!![]});var _0x1bb120='WhatsappAccounts';return db['UserProfileSection'][_0x4d68('0x58')]({'where':{'name':_0x1bb120,'userProfileId':_0x595648[_0x4d68('0x5c')]},'raw':!![]})['then'](function(_0x583435){if(_0x583435&&_0x583435['autoAssociation']===0x0){return db[_0x4d68('0x37')][_0x4d68('0x59')]({'name':_0x8c140c[_0x4d68('0x3a')],'resourceId':_0x8c140c['id'],'type':_0x583435[_0x4d68('0x3a')],'sectionId':_0x583435['id']},{})[_0x4d68('0x1f')](function(){return _0x243aa1;});}else{return _0x243aa1;}})['catch'](function(_0x2b2878){logger[_0x4d68('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b2878);throw _0x2b2878;});}return _0x243aa1;})['then'](respondWithResult(_0x5391e2,0xc9))[_0x4d68('0x2a')](handleError(_0x5391e2,null));};exports[_0x4d68('0x5d')]=function(_0xa8cfff,_0x108ba1){if(_0xa8cfff[_0x4d68('0x5e')]['id']){delete _0xa8cfff[_0x4d68('0x5e')]['id'];}return db[_0x4d68('0x4f')][_0x4d68('0x58')]({'where':{'id':_0xa8cfff['params']['id']},'include':[{'model':db[_0x4d68('0x54')],'as':'mandatoryDispositionPause'}]})[_0x4d68('0x1f')](handleEntityNotFound(_0x108ba1,null))[_0x4d68('0x1f')](saveUpdates(_0xa8cfff[_0x4d68('0x5e')],null))['then'](respondWithResult(_0x108ba1,null))['catch'](handleError(_0x108ba1,null));};exports[_0x4d68('0x35')]=function(_0x17cc9d,_0x19e42e){return db[_0x4d68('0x4f')]['find']({'where':{'id':_0x17cc9d[_0x4d68('0x53')]['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x19e42e,null))[_0x4d68('0x1f')](removeEntity(_0x19e42e,null))[_0x4d68('0x2a')](handleError(_0x19e42e,null));};exports[_0x4d68('0x5f')]=function(_0x3cab77,_0x5e5290){return db['WhatsappAccount']['describe']()['then'](respondWithResult(_0x5e5290,null))[_0x4d68('0x2a')](handleError(_0x5e5290,null));};exports[_0x4d68('0x60')]=function(_0x53aa7b,_0x2fc5dd,_0x418ce1){if(_0x53aa7b[_0x4d68('0x5e')]['id']){delete _0x53aa7b[_0x4d68('0x5e')]['id'];}return db[_0x4d68('0x4f')][_0x4d68('0x58')]({'where':{'id':_0x53aa7b['params']['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x2fc5dd,null))[_0x4d68('0x1f')](function(_0x3f9c15){if(_0x3f9c15){_0x53aa7b[_0x4d68('0x5e')][_0x4d68('0x61')]=_0x3f9c15['id'];return db[_0x4d68('0x62')]['create'](_0x53aa7b[_0x4d68('0x5e')]);}})[_0x4d68('0x1f')](respondWithResult(_0x2fc5dd,null))[_0x4d68('0x2a')](handleError(_0x2fc5dd,null));};exports[_0x4d68('0x63')]=function(_0x36c2dc,_0x28b525,_0x3de046){var _0x48710d={'raw':![],'where':{}};var _0x36f461={};var _0x133374={'count':0x0,'rows':[]};return db[_0x4d68('0x4f')]['findOne']({'where':{'id':_0x36c2dc[_0x4d68('0x53')]['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x28b525,null))[_0x4d68('0x1f')](function(_0x4cedff){if(_0x4cedff){_0x36f461['model']=_[_0x4d68('0x56')](db[_0x4d68('0x62')][_0x4d68('0x3d')]);_0x36f461[_0x4d68('0x40')]=_['keys'](_0x36c2dc['query']);_0x36f461[_0x4d68('0x41')]=_['intersection'](_0x36f461[_0x4d68('0x3f')],_0x36f461['query']);_0x48710d[_0x4d68('0x43')]=_[_0x4d68('0x42')](_0x36f461[_0x4d68('0x3f')],qs[_0x4d68('0x44')](_0x36c2dc[_0x4d68('0x40')][_0x4d68('0x44')]));_0x48710d[_0x4d68('0x43')]=_0x48710d[_0x4d68('0x43')][_0x4d68('0x64')]?_0x48710d['attributes']:_0x36f461[_0x4d68('0x3f')];if(!_0x36c2dc[_0x4d68('0x40')]['hasOwnProperty'](_0x4d68('0x46'))){_0x48710d[_0x4d68('0x30')]=qs[_0x4d68('0x30')](_0x36c2dc[_0x4d68('0x40')][_0x4d68('0x30')]);_0x48710d['offset']=qs['offset'](_0x36c2dc[_0x4d68('0x40')][_0x4d68('0x2e')]);}_0x48710d[_0x4d68('0x47')]=qs[_0x4d68('0x48')](_0x36c2dc[_0x4d68('0x40')][_0x4d68('0x48')]);_0x48710d[_0x4d68('0x49')]=qs[_0x4d68('0x41')](_[_0x4d68('0x4a')](_0x36c2dc[_0x4d68('0x40')],_0x36f461[_0x4d68('0x41')]));_0x48710d[_0x4d68('0x49')]['WhatsappAccountId']=_0x4cedff['id'];if(_0x36c2dc['query'][_0x4d68('0x4b')]){_0x48710d['where']=_['merge'](_0x48710d[_0x4d68('0x49')],{'$or':_[_0x4d68('0x3c')](_0x48710d[_0x4d68('0x43')],function(_0x2e2c06){var _0x2790d0={};_0x2790d0[_0x2e2c06]={'$like':'%'+_0x36c2dc[_0x4d68('0x40')][_0x4d68('0x4b')]+'%'};return _0x2790d0;})});}_0x48710d=_['merge']({},_0x48710d,_0x36c2dc[_0x4d68('0x4e')]);return db[_0x4d68('0x62')][_0x4d68('0x31')]({'where':_0x48710d['where']})[_0x4d68('0x1f')](function(_0x2593e5){_0x133374[_0x4d68('0x31')]=_0x2593e5;if(_0x36c2dc[_0x4d68('0x40')][_0x4d68('0x57')]){_0x48710d[_0x4d68('0x50')]=[{'all':!![]}];}return db[_0x4d68('0x62')][_0x4d68('0x51')](_0x48710d);})[_0x4d68('0x1f')](function(_0x1b9d79){_0x133374[_0x4d68('0x52')]=_0x1b9d79;return _0x133374;});}})[_0x4d68('0x1f')](respondWithFilteredResult(_0x28b525,_0x48710d))[_0x4d68('0x2a')](handleError(_0x28b525,null));};exports[_0x4d68('0x65')]=function(_0x25b1b7,_0x1f2e4e,_0x332bc9){return db[_0x4d68('0x4f')][_0x4d68('0x58')]({'where':{'id':_0x25b1b7['params']['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x1f2e4e,null))[_0x4d68('0x1f')](function(_0x401c3d){if(_0x401c3d){return _0x401c3d['removeDispositions'](_0x25b1b7[_0x4d68('0x40')][_0x4d68('0x66')]);}})[_0x4d68('0x1f')](respondWithStatusCode(_0x1f2e4e,null))[_0x4d68('0x2a')](handleError(_0x1f2e4e,null));};exports['addAnswer']=function(_0x1cf9ad,_0x554063,_0x547b17){if(_0x1cf9ad[_0x4d68('0x5e')]['id']){delete _0x1cf9ad['body']['id'];}return db[_0x4d68('0x4f')][_0x4d68('0x58')]({'where':{'id':_0x1cf9ad['params']['id']}})['then'](handleEntityNotFound(_0x554063,null))[_0x4d68('0x1f')](function(_0x46e5f7){if(_0x46e5f7){_0x1cf9ad[_0x4d68('0x5e')][_0x4d68('0x61')]=_0x46e5f7['id'];return db['CannedAnswer'][_0x4d68('0x59')](_0x1cf9ad['body']);}})[_0x4d68('0x1f')](respondWithResult(_0x554063,null))[_0x4d68('0x2a')](handleError(_0x554063,null));};exports[_0x4d68('0x67')]=function(_0x580d7a,_0x525e40,_0x4e48f0){var _0x2a4f3c={'raw':![],'where':{}};var _0x51bbfc={};var _0x44b8a5={'count':0x0,'rows':[]};return db[_0x4d68('0x4f')][_0x4d68('0x68')]({'where':{'id':_0x580d7a[_0x4d68('0x53')]['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x525e40,null))[_0x4d68('0x1f')](function(_0x5c9bab){if(_0x5c9bab){_0x51bbfc['model']=_[_0x4d68('0x56')](db[_0x4d68('0x69')][_0x4d68('0x3d')]);_0x51bbfc[_0x4d68('0x40')]=_['keys'](_0x580d7a['query']);_0x51bbfc[_0x4d68('0x41')]=_[_0x4d68('0x42')](_0x51bbfc[_0x4d68('0x3f')],_0x51bbfc[_0x4d68('0x40')]);_0x2a4f3c['attributes']=_[_0x4d68('0x42')](_0x51bbfc[_0x4d68('0x3f')],qs[_0x4d68('0x44')](_0x580d7a[_0x4d68('0x40')][_0x4d68('0x44')]));_0x2a4f3c[_0x4d68('0x43')]=_0x2a4f3c[_0x4d68('0x43')][_0x4d68('0x64')]?_0x2a4f3c[_0x4d68('0x43')]:_0x51bbfc[_0x4d68('0x3f')];if(!_0x580d7a['query'][_0x4d68('0x45')](_0x4d68('0x46'))){_0x2a4f3c[_0x4d68('0x30')]=qs[_0x4d68('0x30')](_0x580d7a[_0x4d68('0x40')]['limit']);_0x2a4f3c['offset']=qs[_0x4d68('0x2e')](_0x580d7a[_0x4d68('0x40')][_0x4d68('0x2e')]);}_0x2a4f3c[_0x4d68('0x47')]=qs['sort'](_0x580d7a[_0x4d68('0x40')][_0x4d68('0x48')]);_0x2a4f3c[_0x4d68('0x49')]=qs[_0x4d68('0x41')](_[_0x4d68('0x4a')](_0x580d7a[_0x4d68('0x40')],_0x51bbfc[_0x4d68('0x41')]));_0x2a4f3c['where'][_0x4d68('0x61')]=_0x5c9bab['id'];if(_0x580d7a['query'][_0x4d68('0x4b')]){_0x2a4f3c['where']=_[_0x4d68('0x4c')](_0x2a4f3c[_0x4d68('0x49')],{'$or':_[_0x4d68('0x3c')](_0x2a4f3c[_0x4d68('0x43')],function(_0x45a605){var _0x2e8e62={};_0x2e8e62[_0x45a605]={'$like':'%'+_0x580d7a[_0x4d68('0x40')][_0x4d68('0x4b')]+'%'};return _0x2e8e62;})});}_0x2a4f3c=_[_0x4d68('0x4c')]({},_0x2a4f3c,_0x580d7a['options']);return db[_0x4d68('0x69')][_0x4d68('0x31')]({'where':_0x2a4f3c['where']})['then'](function(_0x29c06c){_0x44b8a5[_0x4d68('0x31')]=_0x29c06c;if(_0x580d7a[_0x4d68('0x40')]['includeAll']){_0x2a4f3c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4d68('0x51')](_0x2a4f3c);})[_0x4d68('0x1f')](function(_0x193f85){_0x44b8a5[_0x4d68('0x52')]=_0x193f85;return _0x44b8a5;});}})['then'](respondWithFilteredResult(_0x525e40,_0x2a4f3c))[_0x4d68('0x2a')](handleError(_0x525e40,null));};exports[_0x4d68('0x6a')]=function(_0x3ebf53,_0x60a352,_0x444d4b){return db[_0x4d68('0x4f')][_0x4d68('0x58')]({'where':{'id':_0x3ebf53[_0x4d68('0x53')]['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x60a352,null))[_0x4d68('0x1f')](function(_0x164f44){if(_0x164f44){return _0x164f44[_0x4d68('0x6a')](_0x3ebf53['query'][_0x4d68('0x66')]);}})[_0x4d68('0x1f')](respondWithStatusCode(_0x60a352,null))[_0x4d68('0x2a')](handleError(_0x60a352,null));};exports[_0x4d68('0x6b')]=function(_0x5e14ac,_0x479243,_0x21e351){return db[_0x4d68('0x4f')][_0x4d68('0x58')]({'where':{'id':_0x5e14ac[_0x4d68('0x53')]['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x479243,null))[_0x4d68('0x1f')](function(_0x247c9d){if(_0x247c9d){return _0x247c9d[_0x4d68('0x6b')](_0x5e14ac[_0x4d68('0x5e')]['ids'],_[_0x4d68('0x6c')](_0x5e14ac[_0x4d68('0x5e')],[_0x4d68('0x66'),'id'])||{})['spread'](function(_0x4c0b0d){for(var _0x3e1c00=0x0;_0x3e1c00<_0x5e14ac[_0x4d68('0x5e')][_0x4d68('0x66')]['length'];_0x3e1c00+=0x1){socket[_0x4d68('0x6d')](_0x4d68('0x6e'),{'UserId':Number(_0x5e14ac[_0x4d68('0x5e')]['ids'][_0x3e1c00]),'WhatsappAccountId':Number(_0x5e14ac['params']['id'])});}return _0x4c0b0d;});}})[_0x4d68('0x1f')](respondWithResult(_0x479243,null))['catch'](handleError(_0x479243,null));};exports[_0x4d68('0x6f')]=function(_0xe429d7,_0x588fd2,_0x3a4547){return db['WhatsappAccount']['find']({'where':{'id':_0xe429d7['params']['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x588fd2,null))[_0x4d68('0x1f')](function(_0x298d3b){if(_0x298d3b){return _0x298d3b['removeAgents'](_0xe429d7['query']['ids'])[_0x4d68('0x1f')](function(){if(_[_0x4d68('0x70')](_0xe429d7[_0x4d68('0x40')][_0x4d68('0x66')])){for(var _0x58896d=0x0;_0x58896d<_0xe429d7[_0x4d68('0x40')][_0x4d68('0x66')][_0x4d68('0x64')];_0x58896d+=0x1){socket[_0x4d68('0x6d')]('userWhatsappAccount:remove',{'UserId':Number(_0xe429d7[_0x4d68('0x40')]['ids'][_0x58896d]),'WhatsappAccountId':Number(_0xe429d7[_0x4d68('0x53')]['id'])});}}else{socket[_0x4d68('0x6d')]('userWhatsappAccount:remove',{'UserId':Number(_0xe429d7['query']['ids']),'WhatsappAccountId':Number(_0xe429d7['params']['id'])});}});}})[_0x4d68('0x1f')](respondWithStatusCode(_0x588fd2,null))[_0x4d68('0x2a')](handleError(_0x588fd2,null));};exports[_0x4d68('0x71')]=function(_0x21b0a4,_0x5f4877,_0x9baa67){var _0x371709={};var _0x44c2c5={};var _0x22a8fd;var _0x19086f;return db[_0x4d68('0x4f')]['findOne']({'where':{'id':_0x21b0a4[_0x4d68('0x53')]['id']}})[_0x4d68('0x1f')](handleEntityNotFound(_0x5f4877,null))[_0x4d68('0x1f')](function(_0x125a21){if(_0x125a21){_0x22a8fd=_0x125a21;_0x44c2c5['model']=_[_0x4d68('0x56')](db[_0x4d68('0x72')][_0x4d68('0x3d')]);_0x44c2c5[_0x4d68('0x40')]=_['keys'](_0x21b0a4['query']);_0x44c2c5[_0x4d68('0x41')]=_[_0x4d68('0x42')](_0x44c2c5[_0x4d68('0x3f')],_0x44c2c5[_0x4d68('0x40')]);_0x371709[_0x4d68('0x43')]=_[_0x4d68('0x42')](_0x44c2c5['model'],qs['fields'](_0x21b0a4[_0x4d68('0x40')]['fields']));_0x371709['attributes']=_0x371709[_0x4d68('0x43')]['length']?_0x371709[_0x4d68('0x43')]:_0x44c2c5['model'];_0x371709['order']=qs[_0x4d68('0x48')](_0x21b0a4[_0x4d68('0x40')]['sort']);_0x371709[_0x4d68('0x49')]=qs['filters'](_[_0x4d68('0x4a')](_0x21b0a4[_0x4d68('0x40')],_0x44c2c5[_0x4d68('0x41')]));if(_0x21b0a4['query']['filter']){_0x371709[_0x4d68('0x49')]=_['merge'](_0x371709[_0x4d68('0x49')],{'$or':_[_0x4d68('0x3c')](_0x371709[_0x4d68('0x43')],function(_0x36c8b5){var _0x19d105={};_0x19d105[_0x36c8b5]={'$like':'%'+_0x21b0a4[_0x4d68('0x40')][_0x4d68('0x4b')]+'%'};return _0x19d105;})});}_0x371709=_[_0x4d68('0x4c')]({},_0x371709,_0x21b0a4[_0x4d68('0x4e')]);return _0x22a8fd[_0x4d68('0x71')](_0x371709);}})[_0x4d68('0x1f')](function(_0x55fbf1){if(_0x55fbf1){_0x19086f=_0x55fbf1['length'];if(!_0x21b0a4[_0x4d68('0x40')][_0x4d68('0x45')](_0x4d68('0x46'))){_0x371709[_0x4d68('0x30')]=qs['limit'](_0x21b0a4[_0x4d68('0x40')][_0x4d68('0x30')]);_0x371709[_0x4d68('0x2e')]=qs['offset'](_0x21b0a4[_0x4d68('0x40')][_0x4d68('0x2e')]);}return _0x22a8fd[_0x4d68('0x71')](_0x371709);}})[_0x4d68('0x1f')](function(_0x1132a0){if(_0x1132a0){return _0x1132a0?{'count':_0x19086f,'rows':_0x1132a0}:null;}})[_0x4d68('0x1f')](respondWithResult(_0x5f4877,null))[_0x4d68('0x2a')](handleError(_0x5f4877,null));};exports[_0x4d68('0x73')]=function(_0x12b2e5,_0x50843c){var _0x291c37=_0x12b2e5[_0x4d68('0x53')]['id'];var _0x3782b0=_0x12b2e5[_0x4d68('0x5e')];var _0x236209=0xc8;var _0x5c3784=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x4d68('0x74')][_0x4d68('0x75')][_0x4d68('0x76')]},function(_0x31c366){return db[_0x4d68('0x4f')][_0x4d68('0x68')]({'where':{'id':_0x291c37},'transaction':_0x31c366})[_0x4d68('0x1f')](function(_0x34bf72){if(_0x34bf72){return db[_0x4d68('0x77')][_0x4d68('0x35')]({'where':{'WhatsappAccountId':_0x291c37},'transaction':_0x31c366})['then'](function(){var _0x107d2e=_[_0x4d68('0x3c')](_0x3782b0,function(_0x53d374){_0x53d374[_0x4d68('0x61')]=_0x291c37;return _0x53d374;});return db[_0x4d68('0x77')][_0x4d68('0x78')](_0x107d2e,{'transaction':_0x31c366});});}else{_0x236209=0x194;_0x5c3784=[];}});})['then'](function(){if(_0x236209!==0x194){return db[_0x4d68('0x77')][_0x4d68('0x79')]({'where':{'WhatsappAccountId':_0x291c37},'order':_0x4d68('0x7a')})[_0x4d68('0x1f')](function(_0x1b189d){_0x5c3784=_0x1b189d;});}})['catch'](function(_0xff39d0){_0x236209=0x1f4;logger[_0x4d68('0x26')](_0xff39d0[_0x4d68('0x39')]);if(_0xff39d0[_0x4d68('0x3a')]){delete _0xff39d0['name'];}_0x5c3784=_0xff39d0;})[_0x4d68('0x7b')](function(){if(_0x5c3784===null){_0x50843c[_0x4d68('0x2b')](_0x236209);}else{if(_0x236209===0x1f4){_0x50843c[_0x4d68('0x2c')](_0x236209)[_0x4d68('0x7c')](_0x5c3784);}else{_0x50843c['status'](_0x236209)[_0x4d68('0x2d')](_0x5c3784);}}});};exports[_0x4d68('0x7d')]=function(_0x406cf4,_0x1e6413,_0x2e25d7){var _0x36e7d6={};var _0x46dbe2={};var _0x352e94;var _0x335a34;return db[_0x4d68('0x4f')][_0x4d68('0x68')]({'where':{'id':_0x406cf4[_0x4d68('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e6413,null))[_0x4d68('0x1f')](function(_0x2f0cd8){if(_0x2f0cd8){_0x352e94=_0x2f0cd8;_0x46dbe2[_0x4d68('0x3f')]=_[_0x4d68('0x56')](db[_0x4d68('0x77')][_0x4d68('0x3d')]);_0x46dbe2['query']=_[_0x4d68('0x56')](_0x406cf4[_0x4d68('0x40')]);_0x46dbe2[_0x4d68('0x41')]=_[_0x4d68('0x42')](_0x46dbe2['model'],_0x46dbe2['query']);_0x36e7d6[_0x4d68('0x43')]=_[_0x4d68('0x42')](_0x46dbe2[_0x4d68('0x3f')],qs[_0x4d68('0x44')](_0x406cf4['query']['fields']));_0x36e7d6[_0x4d68('0x43')]=_0x36e7d6[_0x4d68('0x43')][_0x4d68('0x64')]?_0x36e7d6[_0x4d68('0x43')]:_0x46dbe2[_0x4d68('0x3f')];_0x36e7d6[_0x4d68('0x47')]=qs['sort'](_0x406cf4[_0x4d68('0x40')]['sort']);_0x36e7d6[_0x4d68('0x49')]=qs[_0x4d68('0x41')](_['pick'](_0x406cf4['query'],_0x46dbe2[_0x4d68('0x41')]));if(_0x406cf4[_0x4d68('0x40')][_0x4d68('0x4b')]){_0x36e7d6[_0x4d68('0x49')]=_[_0x4d68('0x4c')](_0x36e7d6[_0x4d68('0x49')],{'$or':_[_0x4d68('0x3c')](_0x36e7d6['attributes'],function(_0x389f86){var _0x5e3217={};_0x5e3217[_0x389f86]={'$like':'%'+_0x406cf4[_0x4d68('0x40')][_0x4d68('0x4b')]+'%'};return _0x5e3217;})});}_0x36e7d6=_[_0x4d68('0x4c')]({},_0x36e7d6,_0x406cf4[_0x4d68('0x4e')]);return _0x352e94[_0x4d68('0x7d')](_0x36e7d6);}})[_0x4d68('0x1f')](function(_0x38e64c){if(_0x38e64c){_0x335a34=_0x38e64c[_0x4d68('0x64')];if(!_0x406cf4[_0x4d68('0x40')][_0x4d68('0x45')]('nolimit')){_0x36e7d6['limit']=qs[_0x4d68('0x30')](_0x406cf4[_0x4d68('0x40')][_0x4d68('0x30')]);_0x36e7d6[_0x4d68('0x2e')]=qs['offset'](_0x406cf4['query'][_0x4d68('0x2e')]);}return _0x352e94[_0x4d68('0x7d')](_0x36e7d6);}})[_0x4d68('0x1f')](function(_0x7da5ed){if(_0x7da5ed){return _0x7da5ed?{'count':_0x335a34,'rows':_0x7da5ed}:null;}})['then'](respondWithResult(_0x1e6413,null))[_0x4d68('0x2a')](handleError(_0x1e6413,null));};exports[_0x4d68('0x7e')]=function(_0xd66c60,_0x2e761d,_0x5e7d9c){var _0x7d3920={'channel':'whatsapp'};var _0x4a01d4=[];var _0x2e4066=[];var _0x1199f4={};return db['WhatsappAccount'][_0x4d68('0x58')]({'where':{'id':_0xd66c60[_0x4d68('0x53')]['id']},'include':[{'model':db[_0x4d68('0x77')],'as':'Applications'}]})[_0x4d68('0x1f')](handleEntityNotFound(_0x2e761d,null))['then'](function(_0x27bcea){_0x7d3920['account']=_0x27bcea;if(_0x7d3920[_0x4d68('0x7f')]&&_0x7d3920[_0x4d68('0x7f')][_0x4d68('0x3e')]===_0x4d68('0x80')&&_0xd66c60['body'][_0x4d68('0x81')]){if(_0xd66c60[_0x4d68('0x5e')][_0x4d68('0x81')][_0x4d68('0x64')]===0x0)return;if(_0xd66c60[_0x4d68('0x5e')][_0x4d68('0x81')][0x0]['state']!=='read')return;return db[_0x4d68('0x82')][_0x4d68('0x5d')]({'read':!![],'readAt':_0xd66c60[_0x4d68('0x5e')][_0x4d68('0x81')][0x0]['timestamp']},{'where':{'messageId':_0xd66c60[_0x4d68('0x5e')][_0x4d68('0x81')][0x0]['message_id']},'individualHooks':!![]})[_0x4d68('0x1f')](function(_0x8c380){return _0x2e761d[_0x4d68('0x2c')](0xc8)['json'](_0x8c380);});}_0x7d3920[_0x4d68('0x83')]=_[_0x4d68('0x84')](_0x27bcea[_0x4d68('0x85')],['priority'],[_0x4d68('0x86')]);if(_0x7d3920[_0x4d68('0x7f')][_0x4d68('0x85')]){delete _0x7d3920[_0x4d68('0x7f')][_0x4d68('0x85')];}return db[_0x4d68('0x87')][_0x4d68('0x5f')]()[_0x4d68('0x1f')](function(_0x591211){if(!_0x591211){throw new db[(_0x4d68('0x88'))]['ValidationError']('no\x20available\x20attributes');}_0x4a01d4=_[_0x4d68('0x89')](_['keys'](_0x591211),[_0x4d68('0x8a'),_0x4d68('0x8b')]);_0x2e4066=_['difference'](_[_0x4d68('0x56')](_0x591211),[_0x4d68('0x8a'),_0x4d68('0x8b'),_0x4d68('0x8c'),_0x4d68('0x8d')]);_0x7d3920[_0x4d68('0x5e')]={'mapKey':'mobile'};if(_0x7d3920[_0x4d68('0x7f')]&&_0x7d3920['account'][_0x4d68('0x3e')]==='twilio'){_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x8e')]=_0xd66c60[_0x4d68('0x5e')][_0x4d68('0x8f')]['replace']('whatsapp:','');_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x5e')]=_0xd66c60['body']['Body'];_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x90')]=_0xd66c60[_0x4d68('0x5e')][_0x4d68('0x91')];}if(_0x7d3920[_0x4d68('0x7f')]&&_0x7d3920[_0x4d68('0x7f')]['type']===_0x4d68('0x80')){_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x8e')]=_0xd66c60[_0x4d68('0x5e')][_0x4d68('0x92')][0x0]['from'];_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x5e')]=_0xd66c60[_0x4d68('0x5e')]['notifications'][0x0][_0x4d68('0x28')]['body'];_0x7d3920['body'][_0x4d68('0x90')]=_0xd66c60[_0x4d68('0x5e')]['notifications'][0x0]['message_id'];}if(_0x7d3920['body']['id']){delete _0x7d3920[_0x4d68('0x5e')]['id'];}if(_['isNil'](_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x8e')])){throw new db['Sequelize']['ValidationError'](_0x4d68('0x93'));}if(_[_0x4d68('0x94')](_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x5e')])||_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x5e')]===''){throw new db[(_0x4d68('0x88'))][(_0x4d68('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4d68('0x94')](_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x96')])){throw new db['Sequelize']['ValidationError'](_0x4d68('0x97')+_0x2e4066);}if(!_[_0x4d68('0x98')](_0x2e4066,_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x96')])){throw new db[(_0x4d68('0x88'))][(_0x4d68('0x95'))](_0x4d68('0x99')+_0x2e4066);}_0x1199f4[_0x7d3920['body'][_0x4d68('0x96')]]=_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x8e')];return db[_0x4d68('0x9a')][_0x4d68('0x58')]({'where':{'id':_0x7d3920[_0x4d68('0x7f')]['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1199f4,'limit':0x1,'order':[[_0x4d68('0x8b'),_0x4d68('0x9b')]]}]});})[_0x4d68('0x1f')](handleEntityNotFound(_0x2e761d,null))[_0x4d68('0x1f')](function(_0x1126fe){if(_0x1126fe){_0x7d3920['list']=_[_0x4d68('0x6c')](_0x1126fe,[_0x4d68('0x9c')]);if(_0x1126fe[_0x4d68('0x9c')]['length']){return _0x1126fe[_0x4d68('0x9c')][0x0];}var _0x357e20=_[_0x4d68('0x19')](_0x7d3920[_0x4d68('0x5e')],{'firstName':_0x7d3920['body'][_0x4d68('0x8e')],'ListId':_0x1126fe['id']});_0x357e20[_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x96')]]=_0x7d3920['body']['from'];return db['CmContact'][_0x4d68('0x59')](_0x357e20,{'fields':_0x4a01d4,'raw':!![]});}})[_0x4d68('0x1f')](handleEntityNotFound(_0x2e761d,null))[_0x4d68('0x1f')](function(_0x3c8da8){if(_0x3c8da8){_0x7d3920[_0x4d68('0x9d')]=_0x3c8da8;var _0x2b324c={'ContactId':_0x3c8da8['id'],'phone':_0x7d3920[_0x4d68('0x5e')]['from'],'WhatsappAccountId':_0xd66c60[_0x4d68('0x53')]['id']};var _0x13da4c={'ContactId':_0x3c8da8['id'],'WhatsappAccountId':_0xd66c60[_0x4d68('0x53')]['id'],'closed':![]};return db[_0x4d68('0x9e')][_0x4d68('0x58')]({'where':_0x13da4c})[_0x4d68('0x1f')](function(_0x4cc0e7){if(_0x4cc0e7){return[_0x4cc0e7,![]];}return db[_0x4d68('0x9e')][_0x4d68('0x59')](_0x2b324c)['then'](function(_0x8e058b){return[_0x8e058b,!![]];});});}})['spread'](function(_0x373b03,_0x3ded34){_0x7d3920[_0x4d68('0x9f')]=_0x373b03[_0x4d68('0x36')]({'plain':!![]});_0x7d3920['interaction']['created']=![];if(_0x3ded34){if(_0x7d3920['account'][_0x4d68('0xa0')]){_0x7d3920[_0x4d68('0x83')][_0x4d68('0xa1')]({'id':0x0,'priority':_0x7d3920[_0x4d68('0x83')][_0x4d68('0x64')]+0x1,'app':_0x4d68('0xa2'),'appdata':_0x4d68('0xa3'),'interval':'*,*,*,*'});}_0x7d3920['interaction'][_0x4d68('0xa4')]=!![];}return db[_0x4d68('0x82')][_0x4d68('0x59')]({'phone':_0x7d3920[_0x4d68('0x5e')][_0x4d68('0x8e')],'messageId':_0x7d3920['body'][_0x4d68('0x90')],'body':_0x7d3920['body'][_0x4d68('0x5e')],'WhatsappAccountId':_0xd66c60['params']['id'],'WhatsappInteractionId':_0x373b03['id'],'direction':'in','ContactId':_0x373b03['ContactId'],'AttachmentId':_0x7d3920[_0x4d68('0x5e')]['AttachmentId']});})['then'](function(_0x17f354){_0x7d3920[_0x4d68('0x28')]=_0x17f354;if(_0x7d3920[_0x4d68('0x9f')][_0x4d68('0xa5')]){return db[_0x4d68('0x72')][_0x4d68('0x58')]({'attributes':['id',_0x4d68('0x3a')],'where':{'id':_0x7d3920['interaction'][_0x4d68('0xa5')]}})[_0x4d68('0x1f')](function(_0x2b2c0a){if(_0x2b2c0a){_0x7d3920[_0x4d68('0x83')][_0x4d68('0xa6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2b2c0a['name']+','+(_0x7d3920['account'][_0x4d68('0xa7')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4d68('0xa8'),'startRouting',_0x7d3920);});}return respondWithRpcPromise('Start',_0x4d68('0xa9'),_0x7d3920);})['then'](function(_0x2d2fc4){if(_0x2d2fc4){var _0x1d47ce=0xc8;var _0x100930=_0x4d68('0xaa');logger[_0x4d68('0x20')](_0x4d68('0x24'),_0x100930,_0x1d47ce,'entity\x20found');logger['debug'](_0x4d68('0xab'),_0x100930,_0x1d47ce,_0x4d68('0xac'),JSON[_0x4d68('0x25')](_0x2d2fc4));if(_0x7d3920[_0x4d68('0x7f')]['type']===_0x4d68('0xad')){return _0x2e761d[_0x4d68('0x2c')](_0x1d47ce)[_0x4d68('0x32')](_0x4d68('0xae'),'text/xml')[_0x4d68('0x7c')](_0x4d68('0xaf'));}else{return _0x2e761d['status'](_0x1d47ce)[_0x4d68('0x2d')](_0x2d2fc4);}}});})[_0x4d68('0x2a')](handleError(_0x2e761d,null));};exports[_0x4d68('0x7c')]=function(_0x1e36c0,_0x34a9e9,_0x381cbd){var _0x82c59f,_0x5cf86b,_0x2f1d6d;if(_[_0x4d68('0x94')](_0x1e36c0[_0x4d68('0x5e')][_0x4d68('0x5e')])||_0x1e36c0[_0x4d68('0x5e')][_0x4d68('0x5e')]===''){throw new db[(_0x4d68('0x88'))][(_0x4d68('0x95'))](_0x4d68('0xb0'));}if(_[_0x4d68('0x94')](_0x1e36c0[_0x4d68('0x5e')]['to'])){throw new db[(_0x4d68('0x88'))][(_0x4d68('0x95'))](_0x4d68('0xb1'));}_0x82c59f=_0x1e36c0[_0x4d68('0x5e')]['to'];return db[_0x4d68('0x4f')]['find']({'where':{'id':_0x1e36c0[_0x4d68('0x53')]['id']},'include':[{'model':db[_0x4d68('0x9a')],'as':'List','include':[{'model':db[_0x4d68('0x87')],'as':_0x4d68('0x9c'),'where':{'mobile':_0x82c59f},'limit':0x1,'order':[[_0x4d68('0x8b'),_0x4d68('0x9b')]]}]}]})[_0x4d68('0x1f')](handleEntityNotFound(_0x34a9e9,null))[_0x4d68('0x1f')](function(_0x13ebb9){if(_0x13ebb9&&_0x13ebb9[_0x4d68('0xb2')]){_0x5cf86b=_0x13ebb9[_0x4d68('0x36')]({'plain':!![]});if(_0x5cf86b[_0x4d68('0xb2')]&&_0x5cf86b[_0x4d68('0xb2')]['Contacts'][_0x4d68('0x64')]){return _0x5cf86b[_0x4d68('0xb2')][_0x4d68('0x9c')][0x0];}return db['CmContact']['create'](_[_0x4d68('0x19')](_0x1e36c0[_0x4d68('0x5e')],{'firstName':_0x82c59f,'mobile':_0x82c59f,'phone':_0x82c59f,'ListId':_0x5cf86b[_0x4d68('0x8d')]}));}})['then'](handleEntityNotFound(_0x34a9e9,null))[_0x4d68('0x1f')](function(_0x3ce0ff){if(_0x3ce0ff){_0x2f1d6d=_0x3ce0ff;return db[_0x4d68('0x9e')][_0x4d68('0x58')]({'where':{'ContactId':_0x2f1d6d['id'],'closed':![],'WhatsappAccountId':_0x5cf86b['id']}})[_0x4d68('0x1f')](function(_0xd00ee3){if(_0xd00ee3){return[_0xd00ee3,![]];}return db[_0x4d68('0x9e')][_0x4d68('0x59')]({'UserId':_0x1e36c0[_0x4d68('0x5a')]['id'],'ContactId':_0x2f1d6d['id'],'WhatsappAccountId':_0x5cf86b['id'],'phone':_0x82c59f,'firstMsgDirection':_0x4d68('0xb3'),'Messages':[_[_0x4d68('0x4c')](_0x1e36c0['body'],{'read':![],'body':_0x1e36c0['body'][_0x4d68('0x5e')],'phone':_0x82c59f,'WhatsappAccountId':_0x5cf86b['id'],'UserId':_0x1e36c0[_0x4d68('0x5a')]['id'],'ContactId':_0x2f1d6d['id']})]},{'include':[{'model':db[_0x4d68('0x82')],'as':_0x4d68('0xb4')}]})[_0x4d68('0x1f')](function(_0xdeb8c){return[_0xdeb8c,!![]];});});}})[_0x4d68('0xb5')](function(_0x4f3fc9,_0x5171db){if(_0x5171db){return _0x4f3fc9;}return db[_0x4d68('0x82')]['create'](_[_0x4d68('0x4c')](_0x1e36c0['body'],{'read':![],'body':_0x1e36c0[_0x4d68('0x5e')][_0x4d68('0x5e')],'phone':_0x82c59f,'WhatsappAccountId':_0x5cf86b['id'],'WhatsappInteractionId':_0x4f3fc9['id'],'UserId':_0x1e36c0['user']['id'],'ContactId':_0x2f1d6d['id']}))[_0x4d68('0x1f')](function(_0x245d33){_0x4f3fc9['dataValues'][_0x4d68('0xb4')]=[];_0x4f3fc9[_0x4d68('0xb6')][_0x4d68('0xb4')][_0x4d68('0xa1')](_0x245d33[_0x4d68('0xb6')]);return _0x4f3fc9;});})['then'](respondWithResult(_0x34a9e9,null))[_0x4d68('0x2a')](handleError(_0x34a9e9,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 93b1251..3520127 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 _0xd953=['exports','WhatsappAccount','remove','emit','hook'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0xd953,0x10f));var _0x3d95=function(_0x63aa4,_0x70d23f){_0x63aa4=_0x63aa4-0x0;var _0x316ad4=_0xd953[_0x63aa4];return _0x316ad4;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x3d95('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3d95('0x1')};function emitEvent(_0x426c74){return function(_0x49bb11,_0x131e3e,_0x224a9b){WhatsappAccountEvents[_0x3d95('0x2')](_0x426c74+':'+_0x49bb11['id'],_0x49bb11);WhatsappAccountEvents[_0x3d95('0x2')](_0x426c74,_0x49bb11);_0x224a9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x3d95('0x3')](e,emitEvent(event));}}module[_0x3d95('0x4')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd52a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xd52a,0x1e8));var _0xad52=function(_0x714a43,_0x1181e1){_0x714a43=_0x714a43-0x0;var _0x480734=_0xd52a[_0x714a43];return _0x480734;};'use strict';var EventEmitter=require(_0xad52('0x0'));var WhatsappAccount=require(_0xad52('0x1'))['db'][_0xad52('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xad52('0x3')](0x0);var events={'afterCreate':_0xad52('0x4'),'afterUpdate':_0xad52('0x5'),'afterDestroy':_0xad52('0x6')};function emitEvent(_0x397572){return function(_0x3e6593,_0x17669e,_0x5a117f){WhatsappAccountEvents[_0xad52('0x7')](_0x397572+':'+_0x3e6593['id'],_0x3e6593);WhatsappAccountEvents[_0xad52('0x7')](_0x397572,_0x3e6593);_0x5a117f(null);};}for(var e in events){if(events[_0xad52('0x8')](e)){var event=events[e];WhatsappAccount[_0xad52('0x9')](e,emitEvent(event));}}module[_0xad52('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 07ac6c2..b88c560 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 _0xad6d=['WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x30355a,_0x5f4c70){var _0x46e555=function(_0x1fdf41){while(--_0x1fdf41){_0x30355a['push'](_0x30355a['shift']());}};_0x46e555(++_0x5f4c70);}(_0xad6d,0xe9));var _0xdad6=function(_0x3aab3f,_0x2a208b){_0x3aab3f=_0x3aab3f-0x0;var _0x58c335=_0xad6d[_0x3aab3f];return _0x58c335;};'use strict';var _=require(_0xdad6('0x0'));var util=require('util');var logger=require(_0xdad6('0x1'))(_0xdad6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdad6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdad6('0x4'));var config=require(_0xdad6('0x5'));var attributes=require(_0xdad6('0x6'));module[_0xdad6('0x7')]=function(_0x3ff3ed,_0x4d9612){return _0x3ff3ed[_0xdad6('0x8')](_0xdad6('0x9'),attributes,{'tableName':_0xdad6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa022=['path','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','request-promise'];(function(_0xade274,_0x13b8dc){var _0x45a9db=function(_0x30b3f9){while(--_0x30b3f9){_0xade274['push'](_0xade274['shift']());}};_0x45a9db(++_0x13b8dc);}(_0xa022,0xcc));var _0x2a02=function(_0x16ba0c,_0x5b2c36){_0x16ba0c=_0x16ba0c-0x0;var _0x454dd5=_0xa022[_0x16ba0c];return _0x454dd5;};'use strict';var _=require(_0x2a02('0x0'));var util=require('util');var logger=require(_0x2a02('0x1'))(_0x2a02('0x2'));var moment=require(_0x2a02('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a02('0x4'));var fs=require('fs');var path=require(_0x2a02('0x5'));var rimraf=require(_0x2a02('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a02('0x7'));module['exports']=function(_0x285958,_0x1c0882){return _0x285958[_0x2a02('0x8')](_0x2a02('0x9'),attributes,{'tableName':_0x2a02('0xa'),'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 884ee1e..4f8603b 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 _0x1753=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','raw','options','where','attributes','include','model','map','lodash'];(function(_0x4d9d54,_0x1b9bcf){var _0x489b1b=function(_0x50bf0c){while(--_0x50bf0c){_0x4d9d54['push'](_0x4d9d54['shift']());}};_0x489b1b(++_0x1b9bcf);}(_0x1753,0xb3));var _0x3175=function(_0x3335c4,_0x3be639){_0x3335c4=_0x3335c4-0x0;var _0x3810f4=_0x1753[_0x3335c4];return _0x3810f4;};'use strict';var _=require(_0x3175('0x0'));var util=require(_0x3175('0x1'));var moment=require(_0x3175('0x2'));var BPromise=require(_0x3175('0x3'));var rs=require(_0x3175('0x4'));var fs=require('fs');var Redis=require(_0x3175('0x5'));var db=require(_0x3175('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3175('0x7'))('rpc');var config=require(_0x3175('0x8'));var jayson=require(_0x3175('0x9'));var client=jayson['client'][_0x3175('0xa')]({'port':0x232a});config[_0x3175('0xb')]=_[_0x3175('0xc')](config[_0x3175('0xb')],{'host':_0x3175('0xd'),'port':0x18eb});var socket=require(_0x3175('0xe'))(new Redis(config[_0x3175('0xb')]));require(_0x3175('0xf'))['register'](socket);function respondWithRpcPromise(_0x2a2afe,_0x5b4c85,_0x3d58da){return new BPromise(function(_0x25056b,_0x4f7ee8){return client[_0x3175('0x10')](_0x2a2afe,_0x3d58da)[_0x3175('0x11')](function(_0x525ddb){logger['info'](_0x3175('0x12'),_0x5b4c85,_0x3175('0x13'));logger[_0x3175('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5b4c85,'request\x20sent',JSON[_0x3175('0x15')](_0x525ddb));if(_0x525ddb[_0x3175('0x16')]){if(_0x525ddb[_0x3175('0x16')]['code']===0x1f4){logger[_0x3175('0x16')](_0x3175('0x12'),_0x5b4c85,_0x525ddb[_0x3175('0x16')][_0x3175('0x17')]);return _0x4f7ee8(_0x525ddb[_0x3175('0x16')][_0x3175('0x17')]);}logger['error'](_0x3175('0x12'),_0x5b4c85,_0x525ddb['error'][_0x3175('0x17')]);return _0x25056b(_0x525ddb['error'][_0x3175('0x17')]);}else{logger[_0x3175('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x5b4c85,_0x3175('0x13'));_0x25056b(_0x525ddb[_0x3175('0x19')]['message']);}})[_0x3175('0x1a')](function(_0x94fd2f){logger[_0x3175('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x5b4c85,_0x94fd2f);_0x4f7ee8(_0x94fd2f);});});}exports[_0x3175('0x1b')]=function(_0x431e57){var _0x3e9fcc=this;return new Promise(function(_0x4b155e,_0x3c2568){return db[_0x3175('0x1c')]['find']({'raw':_0x431e57['options']?_0x431e57['options'][_0x3175('0x1d')]===undefined?!![]:![]:!![],'where':_0x431e57['options']?_0x431e57[_0x3175('0x1e')][_0x3175('0x1f')]||null:null,'attributes':_0x431e57[_0x3175('0x1e')]?_0x431e57[_0x3175('0x1e')][_0x3175('0x20')]||null:null,'include':_0x431e57['options']?_0x431e57[_0x3175('0x1e')][_0x3175('0x21')]?_['map'](_0x431e57[_0x3175('0x1e')][_0x3175('0x21')],function(_0x3f77a4){return{'model':db[_0x3f77a4[_0x3175('0x22')]],'as':_0x3f77a4['as'],'attributes':_0x3f77a4[_0x3175('0x20')],'include':_0x3f77a4[_0x3175('0x21')]?_[_0x3175('0x23')](_0x3f77a4[_0x3175('0x21')],function(_0x3556c5){return{'model':db[_0x3556c5[_0x3175('0x22')]],'as':_0x3556c5['as'],'attributes':_0x3556c5[_0x3175('0x20')],'include':_0x3556c5[_0x3175('0x21')]?_['map'](_0x3556c5['include'],function(_0x59c169){return{'model':db[_0x59c169[_0x3175('0x22')]],'as':_0x59c169['as'],'attributes':_0x59c169['attributes']};}):[]};}):[]};}):[]:[]})[_0x3175('0x11')](function(_0x14f298){logger[_0x3175('0x18')](_0x3175('0x1b'),_0x431e57);logger[_0x3175('0x14')](_0x3175('0x1b'),_0x431e57,JSON[_0x3175('0x15')](_0x14f298));_0x4b155e(_0x14f298);})[_0x3175('0x1a')](function(_0x1541f6){logger[_0x3175('0x16')](_0x3175('0x1b'),_0x1541f6['message'],_0x431e57);_0x3c2568(_0x3e9fcc['error'](0x1f4,_0x1541f6['message']));});});}; \ No newline at end of file +var _0x24a9=['rpc','../../config/environment','jayson/promise','client','redis','defaults','register','request','then','info','request\x20sent','debug','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','find','options','where','attributes','model','include','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x28770f,_0x5cff78){var _0x51bfe2=function(_0x332e8c){while(--_0x332e8c){_0x28770f['push'](_0x28770f['shift']());}};_0x51bfe2(++_0x5cff78);}(_0x24a9,0xf9));var _0x924a=function(_0x1e7223,_0x1a2b0d){_0x1e7223=_0x1e7223-0x0;var _0x153a78=_0x24a9[_0x1e7223];return _0x153a78;};'use strict';var _=require(_0x924a('0x0'));var util=require(_0x924a('0x1'));var moment=require('moment');var BPromise=require(_0x924a('0x2'));var rs=require(_0x924a('0x3'));var fs=require('fs');var Redis=require(_0x924a('0x4'));var db=require(_0x924a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x924a('0x6'))(_0x924a('0x7'));var config=require(_0x924a('0x8'));var jayson=require(_0x924a('0x9'));var client=jayson[_0x924a('0xa')]['http']({'port':0x232a});config[_0x924a('0xb')]=_[_0x924a('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x924a('0xb')]));require('./whatsappAccount.socket')[_0x924a('0xd')](socket);function respondWithRpcPromise(_0x40dade,_0xf0e80a,_0x2b1b12){return new BPromise(function(_0x50bd14,_0x44dfe4){return client[_0x924a('0xe')](_0x40dade,_0x2b1b12)[_0x924a('0xf')](function(_0x1e0907){logger[_0x924a('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0xf0e80a,_0x924a('0x11'));logger[_0x924a('0x12')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xf0e80a,_0x924a('0x11'),JSON['stringify'](_0x1e0907));if(_0x1e0907[_0x924a('0x13')]){if(_0x1e0907['error'][_0x924a('0x14')]===0x1f4){logger[_0x924a('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0xf0e80a,_0x1e0907[_0x924a('0x13')][_0x924a('0x15')]);return _0x44dfe4(_0x1e0907['error'][_0x924a('0x15')]);}logger[_0x924a('0x13')](_0x924a('0x16'),_0xf0e80a,_0x1e0907[_0x924a('0x13')][_0x924a('0x15')]);return _0x50bd14(_0x1e0907[_0x924a('0x13')][_0x924a('0x15')]);}else{logger[_0x924a('0x10')](_0x924a('0x16'),_0xf0e80a,'request\x20sent');_0x50bd14(_0x1e0907[_0x924a('0x17')][_0x924a('0x15')]);}})[_0x924a('0x18')](function(_0x5c2e5f){logger[_0x924a('0x13')](_0x924a('0x16'),_0xf0e80a,_0x5c2e5f);_0x44dfe4(_0x5c2e5f);});});}exports[_0x924a('0x19')]=function(_0x390e71){var _0x48d54d=this;return new Promise(function(_0x157342,_0xb86ce5){return db['WhatsappAccount'][_0x924a('0x1a')]({'raw':_0x390e71[_0x924a('0x1b')]?_0x390e71['options']['raw']===undefined?!![]:![]:!![],'where':_0x390e71[_0x924a('0x1b')]?_0x390e71[_0x924a('0x1b')][_0x924a('0x1c')]||null:null,'attributes':_0x390e71['options']?_0x390e71[_0x924a('0x1b')][_0x924a('0x1d')]||null:null,'include':_0x390e71['options']?_0x390e71[_0x924a('0x1b')]['include']?_['map'](_0x390e71[_0x924a('0x1b')]['include'],function(_0x2734d2){return{'model':db[_0x2734d2[_0x924a('0x1e')]],'as':_0x2734d2['as'],'attributes':_0x2734d2[_0x924a('0x1d')],'include':_0x2734d2[_0x924a('0x1f')]?_['map'](_0x2734d2[_0x924a('0x1f')],function(_0x5f2dec){return{'model':db[_0x5f2dec[_0x924a('0x1e')]],'as':_0x5f2dec['as'],'attributes':_0x5f2dec['attributes'],'include':_0x5f2dec['include']?_['map'](_0x5f2dec[_0x924a('0x1f')],function(_0x5a67c5){return{'model':db[_0x5a67c5[_0x924a('0x1e')]],'as':_0x5a67c5['as'],'attributes':_0x5a67c5[_0x924a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x924a('0xf')](function(_0x157add){logger[_0x924a('0x10')](_0x924a('0x19'),_0x390e71);logger[_0x924a('0x12')](_0x924a('0x19'),_0x390e71,JSON['stringify'](_0x157add));_0x157342(_0x157add);})[_0x924a('0x18')](function(_0x3bed28){logger[_0x924a('0x13')](_0x924a('0x19'),_0x3bed28[_0x924a('0x15')],_0x390e71);_0xb86ce5(_0x48d54d[_0x924a('0x13')](0x1f4,_0x3bed28[_0x924a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 2eb3690..8ecebf2 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 _0xd0fb=['whatsappAccount:','./whatsappAccount.events','save','remove','update','length'];(function(_0x3ee771,_0x384fea){var _0x286607=function(_0x29a3c5){while(--_0x29a3c5){_0x3ee771['push'](_0x3ee771['shift']());}};_0x286607(++_0x384fea);}(_0xd0fb,0xc1));var _0xbd0f=function(_0x305d5f,_0x530030){_0x305d5f=_0x305d5f-0x0;var _0x58e2c4=_0xd0fb[_0x305d5f];return _0x58e2c4;};'use strict';var WhatsappAccountEvents=require(_0xbd0f('0x0'));var events=[_0xbd0f('0x1'),_0xbd0f('0x2'),_0xbd0f('0x3')];function createListener(_0x4698e7,_0x13f9a2){return function(_0x4864cb){_0x13f9a2['emit'](_0x4698e7,_0x4864cb);};}function removeListener(_0x458ba9,_0x5784ad){return function(){WhatsappAccountEvents['removeListener'](_0x458ba9,_0x5784ad);};}exports['register']=function(_0x2e26c3){for(var _0x178a53=0x0,_0xc2c43b=events[_0xbd0f('0x4')];_0x178a53<_0xc2c43b;_0x178a53++){var _0x440f81=events[_0x178a53];var _0x290f12=createListener(_0xbd0f('0x5')+_0x440f81,_0x2e26c3);WhatsappAccountEvents['on'](_0x440f81,_0x290f12);}}; \ No newline at end of file +var _0xf356=['length','whatsappAccount:','save','emit','register'];(function(_0x4be163,_0x25b0d2){var _0x89068d=function(_0x39e66e){while(--_0x39e66e){_0x4be163['push'](_0x4be163['shift']());}};_0x89068d(++_0x25b0d2);}(_0xf356,0xbb));var _0x6f35=function(_0x3e8d6e,_0x7939b9){_0x3e8d6e=_0x3e8d6e-0x0;var _0x4969eb=_0xf356[_0x3e8d6e];return _0x4969eb;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x6f35('0x0'),'remove','update'];function createListener(_0x5afcd9,_0x598964){return function(_0x34b01d){_0x598964[_0x6f35('0x1')](_0x5afcd9,_0x34b01d);};}function removeListener(_0x9e105,_0x2699af){return function(){WhatsappAccountEvents['removeListener'](_0x9e105,_0x2699af);};}exports[_0x6f35('0x2')]=function(_0x16b01f){for(var _0x42e33b=0x0,_0x2c8cc0=events[_0x6f35('0x3')];_0x42e33b<_0x2c8cc0;_0x42e33b++){var _0x6d7cfa=events[_0x42e33b];var _0x3c1908=createListener(_0x6f35('0x4')+_0x6d7cfa,_0x16b01f);WhatsappAccountEvents['on'](_0x6d7cfa,_0x3c1908);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 918f6fe..489eb0b 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 _0x8682=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x6de21f,_0x18ed5b){var _0xc874fe=function(_0x1921ff){while(--_0x1921ff){_0x6de21f['push'](_0x6de21f['shift']());}};_0xc874fe(++_0x18ed5b);}(_0x8682,0x66));var _0x2868=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8682[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x2868('0x0'));var util=require(_0x2868('0x1'));var path=require(_0x2868('0x2'));var timeout=require(_0x2868('0x3'));var express=require(_0x2868('0x4'));var router=express[_0x2868('0x5')]();var fs_extra=require(_0x2868('0x6'));var auth=require(_0x2868('0x7'));var interaction=require(_0x2868('0x8'));var config=require(_0x2868('0x9'));var controller=require(_0x2868('0xa'));router['get']('/',auth[_0x2868('0xb')](),controller[_0x2868('0xc')]);router[_0x2868('0xd')](_0x2868('0xe'),auth[_0x2868('0xb')](),controller[_0x2868('0xf')]);router[_0x2868('0x10')]('/',auth[_0x2868('0xb')](),controller[_0x2868('0x11')]);router['put'](_0x2868('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2868('0xe'),auth[_0x2868('0xb')](),controller[_0x2868('0x12')]);module[_0x2868('0x13')]=router; \ No newline at end of file +var _0x0470=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','index','get','show','/:id','isAuthenticated'];(function(_0x29ed0b,_0x5e924a){var _0x5e61f2=function(_0x2e0ff0){while(--_0x2e0ff0){_0x29ed0b['push'](_0x29ed0b['shift']());}};_0x5e61f2(++_0x5e924a);}(_0x0470,0x9c));var _0x0047=function(_0x21d1f5,_0x118802){_0x21d1f5=_0x21d1f5-0x0;var _0x1b2391=_0x0470[_0x21d1f5];return _0x1b2391;};'use strict';var multer=require(_0x0047('0x0'));var util=require(_0x0047('0x1'));var path=require('path');var timeout=require(_0x0047('0x2'));var express=require(_0x0047('0x3'));var router=express[_0x0047('0x4')]();var fs_extra=require(_0x0047('0x5'));var auth=require(_0x0047('0x6'));var interaction=require(_0x0047('0x7'));var config=require('../../config/environment');var controller=require(_0x0047('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0047('0x9')]);router[_0x0047('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0047('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0047('0xc'),auth[_0x0047('0xd')](),controller['update']);router[_0x0047('0xe')](_0x0047('0xc'),auth[_0x0047('0xd')](),controller[_0x0047('0xf')]);module[_0x0047('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 66a13c7..14d6106 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 _0x22f1=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x56cf0b,_0x5a0d72){var _0x59f6c6=function(_0x5b249c){while(--_0x5b249c){_0x56cf0b['push'](_0x56cf0b['shift']());}};_0x59f6c6(++_0x5a0d72);}(_0x22f1,0xe0));var _0x122f=function(_0x442ab3,_0xf176b1){_0x442ab3=_0x442ab3-0x0;var _0x230105=_0x22f1[_0x442ab3];return _0x230105;};'use strict';var Sequelize=require(_0x122f('0x0'));module[_0x122f('0x1')]={'priority':{'type':Sequelize[_0x122f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x122f('0x3')],'allowNull':![],'defaultValue':_0x122f('0x4')},'appdata':{'type':Sequelize[_0x122f('0x5')]()},'description':{'type':Sequelize[_0x122f('0x3')]},'interval':{'type':Sequelize[_0x122f('0x3')],'defaultValue':_0x122f('0x6')}}; \ No newline at end of file +var _0x47b3=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x47b3,0xee));var _0x347b=function(_0x2324b5,_0x48d454){_0x2324b5=_0x2324b5-0x0;var _0x574a40=_0x47b3[_0x2324b5];return _0x574a40;};'use strict';var Sequelize=require(_0x347b('0x0'));module[_0x347b('0x1')]={'priority':{'type':Sequelize[_0x347b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x347b('0x3')},'appdata':{'type':Sequelize[_0x347b('0x4')]()},'description':{'type':Sequelize[_0x347b('0x5')]},'interval':{'type':Sequelize[_0x347b('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f54ad51..5312dcd 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 _0x5f66=['update','catch','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','../../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','WhatsappApplication','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x123917,_0x45e5c6){var _0x3352df=function(_0x248ea5){while(--_0x248ea5){_0x123917['push'](_0x123917['shift']());}};_0x3352df(++_0x45e5c6);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'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')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['WhatsappApplication'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file +var _0xf4c9=['eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','reject','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x3a8ada,_0xea1a8){var _0x4e80ba=function(_0x3da728){while(--_0x3da728){_0x3a8ada['push'](_0x3a8ada['shift']());}};_0x4e80ba(++_0xea1a8);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf4c9[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x9f4c('0x0'));var rimraf=require(_0x9f4c('0x1'));var zipdir=require(_0x9f4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f4c('0x3'));var moment=require('moment');var BPromise=require(_0x9f4c('0x4'));var Mustache=require(_0x9f4c('0x5'));var util=require(_0x9f4c('0x6'));var path=require('path');var sox=require(_0x9f4c('0x7'));var csv=require('to-csv');var ejs=require(_0x9f4c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f4c('0x9'));var jsforce=require(_0x9f4c('0xa'));var deskjs=require(_0x9f4c('0xb'));var toCsv=require(_0x9f4c('0xc'));var querystring=require(_0x9f4c('0xd'));var Papa=require(_0x9f4c('0xe'));var Redis=require('ioredis');var authService=require(_0x9f4c('0xf'));var qs=require(_0x9f4c('0x10'));var as=require(_0x9f4c('0x11'));var hardwareService=require(_0x9f4c('0x12'));var logger=require(_0x9f4c('0x13'))(_0x9f4c('0x14'));var utils=require(_0x9f4c('0x15'));var config=require(_0x9f4c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d71a9,_0x124492){_0x124492=_0x124492||0xcc;return function(_0x53159a){if(_0x53159a){return _0x4d71a9['sendStatus'](_0x124492);}return _0x4d71a9[_0x9f4c('0x17')](_0x124492)['end']();};}function respondWithResult(_0x5a9cb0,_0xf217d4){_0xf217d4=_0xf217d4||0xc8;return function(_0x4ce352){if(_0x4ce352){return _0x5a9cb0['status'](_0xf217d4)[_0x9f4c('0x18')](_0x4ce352);}};}function respondWithFilteredResult(_0x516787,_0x25f8ed){return function(_0x336fc2){if(_0x336fc2){var _0x46abfe=typeof _0x25f8ed[_0x9f4c('0x19')]===_0x9f4c('0x1a')&&typeof _0x25f8ed[_0x9f4c('0x1b')]==='undefined';var _0x2be1ba=_0x336fc2[_0x9f4c('0x1c')];var _0x143335=_0x46abfe?0x0:_0x25f8ed[_0x9f4c('0x19')];var _0x3f862c=_0x46abfe?_0x336fc2['count']:_0x25f8ed[_0x9f4c('0x19')]+_0x25f8ed[_0x9f4c('0x1b')];var _0x8efbfe;if(_0x3f862c>=_0x2be1ba){_0x3f862c=_0x2be1ba;_0x8efbfe=0xc8;}else{_0x8efbfe=0xce;}_0x516787['status'](_0x8efbfe);return _0x516787['set']('Content-Range',_0x143335+'-'+_0x3f862c+'/'+_0x2be1ba)['json'](_0x336fc2);}return null;};}function patchUpdates(_0x2040a5){return function(_0x47accd){try{jsonpatch['apply'](_0x47accd,_0x2040a5,!![]);}catch(_0x603a8d){return BPromise[_0x9f4c('0x1d')](_0x603a8d);}return _0x47accd['save']();};}function saveUpdates(_0x341693,_0x1d0df9){return function(_0x57b636){if(_0x57b636){return _0x57b636[_0x9f4c('0x1e')](_0x341693)['then'](function(_0x5e6632){return _0x5e6632;});}return null;};}function removeEntity(_0x36e15f,_0x49d6d6){return function(_0xa4a8e9){if(_0xa4a8e9){return _0xa4a8e9[_0x9f4c('0x1f')]()[_0x9f4c('0x20')](function(){_0x36e15f[_0x9f4c('0x17')](0xcc)[_0x9f4c('0x21')]();});}};}function handleEntityNotFound(_0x10c9a9,_0x53c2d3){return function(_0x25b775){if(!_0x25b775){_0x10c9a9[_0x9f4c('0x22')](0x194);}return _0x25b775;};}function handleError(_0x174552,_0x167126){_0x167126=_0x167126||0x1f4;return function(_0x2c7b7e){logger[_0x9f4c('0x23')](_0x2c7b7e[_0x9f4c('0x24')]);if(_0x2c7b7e[_0x9f4c('0x25')]){delete _0x2c7b7e[_0x9f4c('0x25')];}_0x174552[_0x9f4c('0x17')](_0x167126)[_0x9f4c('0x26')](_0x2c7b7e);};}exports[_0x9f4c('0x27')]=function(_0x168ed8,_0x3702bf){var _0x21ba20={},_0x246599={},_0x31d486={'count':0x0,'rows':[]};var _0x149ce5=_[_0x9f4c('0x28')](db[_0x9f4c('0x29')][_0x9f4c('0x2a')],function(_0x2158ac){return{'name':_0x2158ac['fieldName'],'type':_0x2158ac['type']['key']};});_0x246599[_0x9f4c('0x2b')]=_[_0x9f4c('0x28')](_0x149ce5,'name');_0x246599[_0x9f4c('0x2c')]=_[_0x9f4c('0x2d')](_0x168ed8[_0x9f4c('0x2c')]);_0x246599['filters']=_['intersection'](_0x246599[_0x9f4c('0x2b')],_0x246599[_0x9f4c('0x2c')]);_0x21ba20['attributes']=_[_0x9f4c('0x2e')](_0x246599['model'],qs['fields'](_0x168ed8[_0x9f4c('0x2c')][_0x9f4c('0x2f')]));_0x21ba20[_0x9f4c('0x30')]=_0x21ba20[_0x9f4c('0x30')][_0x9f4c('0x31')]?_0x21ba20[_0x9f4c('0x30')]:_0x246599['model'];if(!_0x168ed8[_0x9f4c('0x2c')][_0x9f4c('0x32')](_0x9f4c('0x33'))){_0x21ba20[_0x9f4c('0x1b')]=qs[_0x9f4c('0x1b')](_0x168ed8[_0x9f4c('0x2c')][_0x9f4c('0x1b')]);_0x21ba20[_0x9f4c('0x19')]=qs[_0x9f4c('0x19')](_0x168ed8[_0x9f4c('0x2c')][_0x9f4c('0x19')]);}_0x21ba20[_0x9f4c('0x34')]=qs[_0x9f4c('0x35')](_0x168ed8['query'][_0x9f4c('0x35')]);_0x21ba20['where']=qs[_0x9f4c('0x36')](_[_0x9f4c('0x37')](_0x168ed8[_0x9f4c('0x2c')],_0x246599[_0x9f4c('0x36')]),_0x149ce5);if(_0x168ed8[_0x9f4c('0x2c')][_0x9f4c('0x38')]){_0x21ba20[_0x9f4c('0x39')]=_[_0x9f4c('0x3a')](_0x21ba20[_0x9f4c('0x39')],{'$or':_[_0x9f4c('0x28')](_0x149ce5,function(_0x3bfdeb){if(_0x3bfdeb[_0x9f4c('0x3b')]!=='VIRTUAL'){var _0x3349a8={};_0x3349a8[_0x3bfdeb[_0x9f4c('0x25')]]={'$like':'%'+_0x168ed8[_0x9f4c('0x2c')]['filter']+'%'};return _0x3349a8;}})});}_0x21ba20=_[_0x9f4c('0x3a')]({},_0x21ba20,_0x168ed8[_0x9f4c('0x3c')]);var _0x198c59={'where':_0x21ba20['where']};return db[_0x9f4c('0x29')][_0x9f4c('0x1c')](_0x198c59)[_0x9f4c('0x20')](function(_0x332d0b){_0x31d486[_0x9f4c('0x1c')]=_0x332d0b;if(_0x168ed8[_0x9f4c('0x2c')][_0x9f4c('0x3d')]){_0x21ba20[_0x9f4c('0x3e')]=[{'all':!![]}];}return db[_0x9f4c('0x29')][_0x9f4c('0x3f')](_0x21ba20);})['then'](function(_0x167363){_0x31d486[_0x9f4c('0x40')]=_0x167363;return _0x31d486;})['then'](respondWithFilteredResult(_0x3702bf,_0x21ba20))[_0x9f4c('0x41')](handleError(_0x3702bf,null));};exports[_0x9f4c('0x42')]=function(_0xdbd03b,_0x5170a2){var _0x21f25b={'raw':!![],'where':{'id':_0xdbd03b[_0x9f4c('0x43')]['id']}},_0x4da3ed={};_0x4da3ed['model']=_[_0x9f4c('0x2d')](db[_0x9f4c('0x29')][_0x9f4c('0x2a')]);_0x4da3ed[_0x9f4c('0x2c')]=_[_0x9f4c('0x2d')](_0xdbd03b['query']);_0x4da3ed['filters']=_[_0x9f4c('0x2e')](_0x4da3ed[_0x9f4c('0x2b')],_0x4da3ed[_0x9f4c('0x2c')]);_0x21f25b['attributes']=_[_0x9f4c('0x2e')](_0x4da3ed['model'],qs['fields'](_0xdbd03b[_0x9f4c('0x2c')]['fields']));_0x21f25b[_0x9f4c('0x30')]=_0x21f25b[_0x9f4c('0x30')][_0x9f4c('0x31')]?_0x21f25b['attributes']:_0x4da3ed[_0x9f4c('0x2b')];if(_0xdbd03b['query'][_0x9f4c('0x3d')]){_0x21f25b[_0x9f4c('0x3e')]=[{'all':!![]}];}_0x21f25b=_[_0x9f4c('0x3a')]({},_0x21f25b,_0xdbd03b[_0x9f4c('0x3c')]);return db['WhatsappApplication'][_0x9f4c('0x44')](_0x21f25b)['then'](handleEntityNotFound(_0x5170a2,null))[_0x9f4c('0x20')](respondWithResult(_0x5170a2,null))['catch'](handleError(_0x5170a2,null));};exports[_0x9f4c('0x45')]=function(_0x1294da,_0x5f13c8){return db[_0x9f4c('0x29')][_0x9f4c('0x45')](_0x1294da['body'],{})[_0x9f4c('0x20')](respondWithResult(_0x5f13c8,0xc9))['catch'](handleError(_0x5f13c8,null));};exports[_0x9f4c('0x1e')]=function(_0x384f47,_0x5b8fca){if(_0x384f47['body']['id']){delete _0x384f47['body']['id'];}return db[_0x9f4c('0x29')][_0x9f4c('0x44')]({'where':{'id':_0x384f47['params']['id']}})[_0x9f4c('0x20')](handleEntityNotFound(_0x5b8fca,null))[_0x9f4c('0x20')](saveUpdates(_0x384f47[_0x9f4c('0x46')],null))['then'](respondWithResult(_0x5b8fca,null))[_0x9f4c('0x41')](handleError(_0x5b8fca,null));};exports['destroy']=function(_0x1830e7,_0x3af9de){return db['WhatsappApplication']['find']({'where':{'id':_0x1830e7[_0x9f4c('0x43')]['id']}})[_0x9f4c('0x20')](handleEntityNotFound(_0x3af9de,null))['then'](removeEntity(_0x3af9de,null))[_0x9f4c('0x41')](handleError(_0x3af9de,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index b063fc5..32ba679 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 _0xb0b9=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x6bfb2d,_0x482a27){var _0xe35878=function(_0x2ba3f9){while(--_0x2ba3f9){_0x6bfb2d['push'](_0x6bfb2d['shift']());}};_0xe35878(++_0x482a27);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3ead1b,_0x44b24c){_0x3ead1b=_0x3ead1b-0x0;var _0x3089fd=_0xb0b9[_0x3ead1b];return _0x3089fd;};'use strict';var _=require(_0x9b0b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9b0b('0x1'));var moment=require(_0x9b0b('0x2'));var BPromise=require(_0x9b0b('0x3'));var rp=require(_0x9b0b('0x4'));var fs=require('fs');var path=require(_0x9b0b('0x5'));var rimraf=require(_0x9b0b('0x6'));var config=require(_0x9b0b('0x7'));var attributes=require(_0x9b0b('0x8'));module[_0x9b0b('0x9')]=function(_0x24d4a9,_0x2c3d97){return _0x24d4a9[_0x9b0b('0xa')](_0x9b0b('0xb'),attributes,{'tableName':_0x9b0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x097c=['bluebird','request-promise','path','../../config/environment','exports','define','whatsapp_applications','lodash','util','../../config/logger','moment'];(function(_0x4a698c,_0x3bed13){var _0x18cde6=function(_0x5c4a7d){while(--_0x5c4a7d){_0x4a698c['push'](_0x4a698c['shift']());}};_0x18cde6(++_0x3bed13);}(_0x097c,0x1d5));var _0xc097=function(_0xc685ff,_0x4a167a){_0xc685ff=_0xc685ff-0x0;var _0x32a276=_0x097c[_0xc685ff];return _0x32a276;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var logger=require(_0xc097('0x2'))('api');var moment=require(_0xc097('0x3'));var BPromise=require(_0xc097('0x4'));var rp=require(_0xc097('0x5'));var fs=require('fs');var path=require(_0xc097('0x6'));var rimraf=require('rimraf');var config=require(_0xc097('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0xc097('0x8')]=function(_0x3c9603,_0x31bc9a){return _0x3c9603[_0xc097('0x9')]('WhatsappApplication',attributes,{'tableName':_0xc097('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index ae311c1..49f7385 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 _0xac31=['code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2589a4,_0x5bbc0e){var _0x4951f9=function(_0x267a55){while(--_0x267a55){_0x2589a4['push'](_0x2589a4['shift']());}};_0x4951f9(++_0x5bbc0e);}(_0xac31,0xca));var _0x1ac3=function(_0x3d361e,_0x133e30){_0x3d361e=_0x3d361e-0x0;var _0x52350b=_0xac31[_0x3d361e];return _0x52350b;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x008c,0x188));var _0xc008=function(_0x4f4f59,_0x4215c1){_0x4f4f59=_0x4f4f59-0x0;var _0x322725=_0x008c[_0x4f4f59];return _0x322725;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 0706c19..c7b4d55 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 _0xc949=['post','create','addMessage','/:id/tags','whatsapp','addTags','put','whatsappinteraction:update','delete','tracked','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xc949,0x181));var _0x9c94=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc949[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0x8')](_0x9c94('0xf'),auth[_0x9c94('0x9')](),controller['getMessages']);router[_0x9c94('0x8')](_0x9c94('0x10'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0x12')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);router[_0x9c94('0x12')](_0x9c94('0xf'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x14')]);router[_0x9c94('0x12')](_0x9c94('0x15'),auth[_0x9c94('0x9')](),interaction['tracked'](_0x9c94('0x16'),'whatsappinteraction:addtags'),controller[_0x9c94('0x17')]);router[_0x9c94('0x18')]('/:id',auth[_0x9c94('0x9')](),interaction['tracked']('whatsapp',_0x9c94('0x19')),controller['update']);router[_0x9c94('0x1a')](_0x9c94('0xd'),auth['isAuthenticated'](),interaction[_0x9c94('0x1b')](_0x9c94('0x16'),_0x9c94('0x1c')),controller[_0x9c94('0x1d')]);router[_0x9c94('0x1a')](_0x9c94('0x15'),auth[_0x9c94('0x9')](),controller['removeTags']);module[_0x9c94('0x1e')]=router; \ No newline at end of file +var _0xe14b=['/:id','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','express','Router','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','put'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe14b,0x93));var _0xbe14=function(_0x19efbe,_0x45c0e9){_0x19efbe=_0x19efbe-0x0;var _0x59f115=_0xe14b[_0x19efbe];return _0x59f115;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMessages']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0xe')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0xe')](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x10')]);router[_0xbe14('0xe')](_0xbe14('0x11'),auth[_0xbe14('0x7')](),interaction[_0xbe14('0x12')](_0xbe14('0x13'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),interaction[_0xbe14('0x12')]('whatsapp',_0xbe14('0x16')),controller[_0xbe14('0x17')]);router[_0xbe14('0x18')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),interaction[_0xbe14('0x12')](_0xbe14('0x13'),'whatsappinteraction:destroy'),controller[_0xbe14('0x19')]);router[_0xbe14('0x18')](_0xbe14('0x11'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1a')]);module[_0xbe14('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 46b77a7..9d1f92a 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 _0x37cc=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x37cc,0x185));var _0xc37c=function(_0x1010b7,_0x1420a1){_0x1010b7=_0x1010b7-0x0;var _0x5aec14=_0x37cc[_0x1010b7];return _0x5aec14;};'use strict';var Sequelize=require(_0xc37c('0x0'));var moment=require(_0xc37c('0x1'));module[_0xc37c('0x2')]={'closed':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc37c('0x4')]},'disposition':{'type':Sequelize[_0xc37c('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc37c('0x5')]},'phone':{'type':Sequelize[_0xc37c('0x5')]},'read1stAt':{'type':Sequelize[_0xc37c('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc37c('0x6')]('in',_0xc37c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc37c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc37c('0x6')]('in',_0xc37c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0309=['STRING','ENUM','BOOLEAN','sequelize','exports','DATE'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x0309,0x165));var _0x9030=function(_0x387975,_0x37dc31){_0x387975=_0x387975-0x0;var _0x333de4=_0x0309[_0x387975];return _0x333de4;};'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/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 5de2c05..b40499d 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 _0xa988=['spread','Tag','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','mkdirSync','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','secret','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','sendStatus','end','status','limit','count','offset','set','Content-Range','update','then','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','findAll','whatsapp','query','catch','show','params','model','filters','intersection','fields','attributes','length','includeAll','include','merge','options','create','body','find','destroy','describe','addMessage','ids','omit','findOne','keys','WhatsappMessage','hasOwnProperty','order','sort','where','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows'];(function(_0x4b8548,_0x2b33fd){var _0x2485dc=function(_0x41cad5){while(--_0x41cad5){_0x4b8548['push'](_0x4b8548['shift']());}};_0x2485dc(++_0x2b33fd);}(_0xa988,0x1a7));var _0x8a98=function(_0x180451,_0x3533f1){_0x180451=_0x180451-0x0;var _0x4c3a39=_0xa988[_0x180451];return _0x4c3a39;};'use strict';var rimraf=require(_0x8a98('0x0'));var zipdir=require(_0x8a98('0x1'));var moment=require(_0x8a98('0x2'));var BPromise=require(_0x8a98('0x3'));var util=require(_0x8a98('0x4'));var path=require('path');var ejs=require(_0x8a98('0x5'));var fs=require('fs');var _=require(_0x8a98('0x6'));var Redis=require(_0x8a98('0x7'));var interaction=require(_0x8a98('0x8'));var qs=require(_0x8a98('0x9'));var pdf=require(_0x8a98('0xa'));var logger=require(_0x8a98('0xb'))(_0x8a98('0xc'));var config=require('../../config/environment');var db=require(_0x8a98('0xd'))['db'];config[_0x8a98('0xe')]=_['defaults'](config[_0x8a98('0xe')],{'host':_0x8a98('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8a98('0x10'))[_0x8a98('0x11')](socket);function respondWithStatusCode(_0x51f11f,_0x3cac53){_0x3cac53=_0x3cac53||0xcc;return function(_0xf73acb){if(_0xf73acb){return _0x51f11f[_0x8a98('0x12')](_0x3cac53);}return _0x51f11f['status'](_0x3cac53)[_0x8a98('0x13')]();};}function respondWithResult(_0x282591,_0x100159){_0x100159=_0x100159||0xc8;return function(_0x50fd87){if(_0x50fd87){return _0x282591[_0x8a98('0x14')](_0x100159)['json'](_0x50fd87);}};}function respondWithFilteredResult(_0x55dcde,_0x56e619){return function(_0x12da45){if(_0x12da45){var _0x4a317f=typeof _0x56e619['offset']==='undefined'&&typeof _0x56e619[_0x8a98('0x15')]==='undefined';var _0x28f117=_0x12da45[_0x8a98('0x16')];var _0x304f0b=_0x4a317f?0x0:_0x56e619[_0x8a98('0x17')];var _0xf02e1=_0x4a317f?_0x12da45[_0x8a98('0x16')]:_0x56e619[_0x8a98('0x17')]+_0x56e619[_0x8a98('0x15')];var _0x5d4ac5;if(_0xf02e1>=_0x28f117){_0xf02e1=_0x28f117;_0x5d4ac5=0xc8;}else{_0x5d4ac5=0xce;}_0x55dcde['status'](_0x5d4ac5);return _0x55dcde[_0x8a98('0x18')](_0x8a98('0x19'),_0x304f0b+'-'+_0xf02e1+'/'+_0x28f117)['json'](_0x12da45);}return null;};}function saveUpdates(_0x336cf6){return function(_0x4c91d6){if(_0x4c91d6){return _0x4c91d6[_0x8a98('0x1a')](_0x336cf6)[_0x8a98('0x1b')](function(_0xc9658d){return _0xc9658d;});}return null;};}function removeEntity(_0xf35f5){return function(_0x289a2d){if(_0x289a2d){return _0x289a2d['destroy']()['then'](function(){_0xf35f5[_0x8a98('0x14')](0xcc)[_0x8a98('0x13')]();});}};}function handleEntityNotFound(_0x272ab7){return function(_0x291d03){if(!_0x291d03){_0x272ab7[_0x8a98('0x12')](0x194);}return _0x291d03;};}function handleError(_0x43e3ce,_0x3b9b88){_0x3b9b88=_0x3b9b88||0x1f4;return function(_0xde5a55){logger[_0x8a98('0x1c')](_0xde5a55[_0x8a98('0x1d')]);if(_0xde5a55['name']){delete _0xde5a55[_0x8a98('0x1e')];}_0x43e3ce[_0x8a98('0x14')](_0x3b9b88)[_0x8a98('0x1f')](_0xde5a55);};}exports[_0x8a98('0x20')]=function(_0x4448aa,_0x486164){var _0x1deb61={};var _0x58f590=_['map'](db[_0x8a98('0x21')][_0x8a98('0x22')],function(_0x21c720){return{'name':_0x21c720[_0x8a98('0x23')],'type':_0x21c720[_0x8a98('0x24')][_0x8a98('0x25')]};});_0x1deb61=qs['getOptions'](_0x58f590,_0x4448aa);return interaction[_0x8a98('0x26')](_0x8a98('0x27'),_0x4448aa[_0x8a98('0x28')],_0x4448aa['user'],_0x1deb61,_0x58f590)[_0x8a98('0x1b')](respondWithFilteredResult(_0x486164,_0x1deb61))[_0x8a98('0x29')](handleError(_0x486164,null));};exports[_0x8a98('0x2a')]=function(_0x2f4aba,_0x558bb1){var _0x27f3b1={'raw':![],'where':{'id':_0x2f4aba[_0x8a98('0x2b')]['id']}},_0x5edd60={};_0x5edd60[_0x8a98('0x2c')]=_['keys'](db[_0x8a98('0x21')][_0x8a98('0x22')]);_0x5edd60[_0x8a98('0x28')]=_['keys'](_0x2f4aba[_0x8a98('0x28')]);_0x5edd60[_0x8a98('0x2d')]=_[_0x8a98('0x2e')](_0x5edd60[_0x8a98('0x2c')],_0x5edd60[_0x8a98('0x28')]);_0x27f3b1['attributes']=_['intersection'](_0x5edd60[_0x8a98('0x2c')],qs[_0x8a98('0x2f')](_0x2f4aba[_0x8a98('0x28')][_0x8a98('0x2f')]));_0x27f3b1[_0x8a98('0x30')]=_0x27f3b1[_0x8a98('0x30')][_0x8a98('0x31')]?_0x27f3b1['attributes']:_0x5edd60['model'];if(_0x2f4aba[_0x8a98('0x28')][_0x8a98('0x32')]){_0x27f3b1[_0x8a98('0x33')]=[{'all':!![]}];}_0x27f3b1=_[_0x8a98('0x34')]({},_0x27f3b1,_0x2f4aba[_0x8a98('0x35')]);return db[_0x8a98('0x21')]['find'](_0x27f3b1)[_0x8a98('0x1b')](handleEntityNotFound(_0x558bb1,null))['then'](respondWithResult(_0x558bb1,null))[_0x8a98('0x29')](handleError(_0x558bb1,null));};exports['create']=function(_0x75ef3f,_0x1d88ea){return db[_0x8a98('0x21')][_0x8a98('0x36')](_0x75ef3f[_0x8a98('0x37')],{})[_0x8a98('0x1b')](respondWithResult(_0x1d88ea,0xc9))[_0x8a98('0x29')](handleError(_0x1d88ea,null));};exports['update']=function(_0x54ef1a,_0x166f42){if(_0x54ef1a['body']['id']){delete _0x54ef1a[_0x8a98('0x37')]['id'];}return db[_0x8a98('0x21')][_0x8a98('0x38')]({'where':{'id':_0x54ef1a[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x166f42,null))['then'](saveUpdates(_0x54ef1a[_0x8a98('0x37')],null))[_0x8a98('0x1b')](respondWithResult(_0x166f42,null))[_0x8a98('0x29')](handleError(_0x166f42,null));};exports[_0x8a98('0x39')]=function(_0x8c71bb,_0x3953ff){return db['WhatsappInteraction'][_0x8a98('0x38')]({'where':{'id':_0x8c71bb[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x3953ff,null))[_0x8a98('0x1b')](removeEntity(_0x3953ff,null))[_0x8a98('0x29')](handleError(_0x3953ff,null));};exports[_0x8a98('0x3a')]=function(_0x101301,_0x29385f){return db['WhatsappInteraction'][_0x8a98('0x3a')]()['then'](respondWithResult(_0x29385f,null))[_0x8a98('0x29')](handleError(_0x29385f,null));};exports[_0x8a98('0x3b')]=function(_0x17a946,_0x2f450c){return db['WhatsappMessage'][_0x8a98('0x38')]({'where':{'id':_0x17a946[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x2f450c,null))[_0x8a98('0x1b')](function(_0x12d689){if(_0x12d689){return _0x12d689[_0x8a98('0x3b')](_0x17a946['body'][_0x8a98('0x3c')],_[_0x8a98('0x3d')](_0x17a946['body'],[_0x8a98('0x3c'),'id'])||{});}})[_0x8a98('0x1b')](respondWithResult(_0x2f450c,null))[_0x8a98('0x29')](handleError(_0x2f450c,null));};exports['getMessages']=function(_0x5bdbf7,_0x3a03f3){var _0x15e676={'raw':![],'where':{}};var _0x4c4535={};var _0x1a69ef={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x8a98('0x3e')]({'where':{'id':_0x5bdbf7[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x3a03f3,null))[_0x8a98('0x1b')](function(_0x1df134){if(_0x1df134){_0x4c4535[_0x8a98('0x2c')]=_[_0x8a98('0x3f')](db[_0x8a98('0x40')][_0x8a98('0x22')]);_0x4c4535['query']=_[_0x8a98('0x3f')](_0x5bdbf7[_0x8a98('0x28')]);_0x4c4535[_0x8a98('0x2d')]=_[_0x8a98('0x2e')](_0x4c4535[_0x8a98('0x2c')],_0x4c4535[_0x8a98('0x28')]);_0x15e676['attributes']=_[_0x8a98('0x2e')](_0x4c4535['model'],qs['fields'](_0x5bdbf7['query'][_0x8a98('0x2f')]));_0x15e676[_0x8a98('0x30')]=_0x15e676['attributes']['length']?_0x15e676[_0x8a98('0x30')]:_0x4c4535[_0x8a98('0x2c')];if(!_0x5bdbf7[_0x8a98('0x28')][_0x8a98('0x41')]('nolimit')){_0x15e676['limit']=qs[_0x8a98('0x15')](_0x5bdbf7[_0x8a98('0x28')]['limit']);_0x15e676[_0x8a98('0x17')]=qs[_0x8a98('0x17')](_0x5bdbf7['query'][_0x8a98('0x17')]);}_0x15e676[_0x8a98('0x42')]=qs[_0x8a98('0x43')](_0x5bdbf7['query'][_0x8a98('0x43')]);_0x15e676['where']=qs[_0x8a98('0x2d')](_['pick'](_0x5bdbf7[_0x8a98('0x28')],_0x4c4535[_0x8a98('0x2d')]));_0x15e676[_0x8a98('0x44')][_0x8a98('0x45')]=_0x1df134['id'];if(_0x5bdbf7[_0x8a98('0x28')][_0x8a98('0x46')]){_0x15e676[_0x8a98('0x44')]=_[_0x8a98('0x34')](_0x15e676[_0x8a98('0x44')],{'$or':_[_0x8a98('0x47')](_0x15e676[_0x8a98('0x30')],function(_0x3290d7){var _0x25e850={};_0x25e850[_0x3290d7]={'$like':'%'+_0x5bdbf7['query'][_0x8a98('0x46')]+'%'};return _0x25e850;})});}if(_0x5bdbf7[_0x8a98('0x28')]['$gte']){var _0x3c61b2=_0x5bdbf7['query'][_0x8a98('0x48')][_0x8a98('0x49')](',');var _0x15c3de={};_0x15c3de[_0x3c61b2[0x0]]={'$gte':moment(_0x3c61b2[0x1])[_0x8a98('0x4a')](_0x8a98('0x4b'))};_0x15e676[_0x8a98('0x44')]=_[_0x8a98('0x34')](_0x15e676[_0x8a98('0x44')],_0x15c3de);}_0x15e676=_[_0x8a98('0x34')]({},_0x15e676,_0x5bdbf7['options']);return db[_0x8a98('0x40')][_0x8a98('0x16')]({'where':_0x15e676['where']})[_0x8a98('0x1b')](function(_0x5725e3){_0x1a69ef[_0x8a98('0x16')]=_0x5725e3;if(_0x5bdbf7[_0x8a98('0x28')][_0x8a98('0x32')]){_0x15e676[_0x8a98('0x33')]=[{'all':!![]}];}return db[_0x8a98('0x40')]['findAll'](_0x15e676);})[_0x8a98('0x1b')](function(_0x4a4609){_0x1a69ef[_0x8a98('0x4c')]=_0x4a4609;return _0x1a69ef;});}})[_0x8a98('0x1b')](respondWithFilteredResult(_0x3a03f3,_0x15e676))[_0x8a98('0x29')](handleError(_0x3a03f3,null));};exports['addTags']=function(_0x3eda45,_0x270338){return db[_0x8a98('0x21')][_0x8a98('0x38')]({'where':{'id':_0x3eda45[_0x8a98('0x2b')]['id']}})['then'](handleEntityNotFound(_0x270338,null))[_0x8a98('0x1b')](function(_0x133838){if(_0x133838){return _0x133838['setTags'](_0x3eda45['body'][_0x8a98('0x3c')],_['omit'](_0x3eda45[_0x8a98('0x37')],[_0x8a98('0x3c'),'id'])||{})[_0x8a98('0x4d')](function(){return db[_0x8a98('0x4e')][_0x8a98('0x26')]({'attributes':['id','name','color'],'where':{'id':_0x3eda45[_0x8a98('0x37')][_0x8a98('0x3c')]}});})[_0x8a98('0x1b')](function(_0x41922f){socket['emit'](_0x8a98('0x4f'),{'id':Number(_0x3eda45[_0x8a98('0x2b')]['id']),'tags':_0x41922f||[]});return{'id':Number(_0x3eda45[_0x8a98('0x2b')]['id']),'tags':_0x41922f||[]};});}})['then'](respondWithResult(_0x270338,null))[_0x8a98('0x29')](handleError(_0x270338,null));};exports[_0x8a98('0x50')]=function(_0x4c753f,_0x5af254){return db[_0x8a98('0x21')][_0x8a98('0x38')]({'where':{'id':_0x4c753f[_0x8a98('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af254,null))['then'](function(_0x54ad2a){if(_0x54ad2a){return _0x54ad2a['removeTags'](_0x4c753f[_0x8a98('0x28')][_0x8a98('0x3c')]);}})[_0x8a98('0x1b')](respondWithStatusCode(_0x5af254,null))[_0x8a98('0x29')](handleError(_0x5af254,null));};exports[_0x8a98('0x51')]=function(_0x5caa01,_0x3517a7){var _0x346ecd=moment()[_0x8a98('0x52')]()[_0x8a98('0x53')]();var _0x30a451=path[_0x8a98('0x54')](config[_0x8a98('0x55')],_0x8a98('0x56'),_0x8a98('0x57'),_0x8a98('0x58'));var _0x2c5bd1=path['join'](config[_0x8a98('0x55')],_0x8a98('0x56'),_0x8a98('0x57'),_0x8a98('0x59'));var _0xe2cb84=path[_0x8a98('0x54')](_0x30a451,_0x346ecd);var _0x46df35=util[_0x8a98('0x4a')](_0x8a98('0x5a'),_0x5caa01['params']['id'],_0x346ecd);var _0x10589b=path['join'](_0x30a451,_0x46df35);var _0x2b73b8=[];_0x2b73b8[_0x8a98('0x5b')]({'model':db['User'],'as':_0x8a98('0x5c'),'attributes':['id',_0x8a98('0x5d')],'raw':!![]});_0x2b73b8[_0x8a98('0x5b')]({'model':db[_0x8a98('0x5e')],'as':_0x8a98('0x5f'),'attributes':['id','firstName',_0x8a98('0x60')],'raw':!![]});if(_0x5caa01[_0x8a98('0x28')][_0x8a98('0x59')]){_0x2b73b8[_0x8a98('0x5b')]({'model':db[_0x8a98('0x61')],'as':_0x8a98('0x61'),'raw':!![]});}var _0x488cdf=[{'model':db[_0x8a98('0x40')],'as':_0x8a98('0x62'),'attributes':['id','body',_0x8a98('0x63'),_0x8a98('0x64'),'secret',_0x8a98('0x65')],'include':_0x2b73b8}];_0x488cdf[_0x8a98('0x5b')]({'model':db[_0x8a98('0x66')],'as':_0x8a98('0x67'),'attributes':['id',_0x8a98('0x1e')]});_0x488cdf[_0x8a98('0x5b')]({'model':db[_0x8a98('0x5c')],'as':_0x8a98('0x68'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x8a98('0x38')]({'where':{'id':_0x5caa01[_0x8a98('0x2b')]['id']},'include':_0x488cdf})[_0x8a98('0x1b')](handleEntityNotFound(_0x3517a7,null))[_0x8a98('0x1b')](function(_0x5d4f3e){if(_0x5d4f3e){var _0x191856=_0x5d4f3e['get']({'plain':!![]});fs[_0x8a98('0x69')](_0xe2cb84);var _0x2a4a82={'channel':'Whatsapp','account':_0x191856['Account'][_0x8a98('0x1e')],'agent':_0x191856[_0x8a98('0x68')]?_0x191856[_0x8a98('0x68')][_0x8a98('0x5d')]:_0x8a98('0x6a'),'createdAt':moment(_0x191856[_0x8a98('0x63')])[_0x8a98('0x4a')](_0x8a98('0x4b'))[_0x8a98('0x53')](),'closedAt':_0x191856['closed']?moment(_0x191856[_0x8a98('0x6b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x8a98('0x53')]():'','disposition':_0x191856[_0x8a98('0x6c')],'messages':_(_0x191856[_0x8a98('0x62')])['filter']({'secret':![]})[_0x8a98('0x47')](function(_0x2ca7e0){if(_0x2ca7e0[_0x8a98('0x61')]){var _0x506543=path[_0x8a98('0x54')](_0x2c5bd1,_0x2ca7e0[_0x8a98('0x61')][_0x8a98('0x6d')]);if(fs[_0x8a98('0x6e')](_0x506543)){fs[_0x8a98('0x6f')](_0x506543)[_0x8a98('0x70')](fs[_0x8a98('0x71')](path[_0x8a98('0x54')](_0xe2cb84,_0x2ca7e0[_0x8a98('0x61')][_0x8a98('0x6d')])));}}return{'date':moment(_0x2ca7e0[_0x8a98('0x63')])['format'](_0x8a98('0x4b'))[_0x8a98('0x53')](),'sender':_0x2ca7e0[_0x8a98('0x64')]===_0x8a98('0x72')?_0x2ca7e0[_0x8a98('0x5c')]?_0x2ca7e0[_0x8a98('0x5c')]['fullname']:_0x8a98('0x73'):_0x2ca7e0[_0x8a98('0x5f')][_0x8a98('0x74')]+(_0x2ca7e0[_0x8a98('0x5f')][_0x8a98('0x60')]?'\x20'+_0x2ca7e0[_0x8a98('0x5f')][_0x8a98('0x60')]:''),'body':_0x2ca7e0['Attachment']?_0x2ca7e0['Attachment'][_0x8a98('0x6d')]:_0x2ca7e0[_0x8a98('0x37')],'direction':_0x2ca7e0[_0x8a98('0x64')]===_0x8a98('0x72')?'A':'C','secret':_0x2ca7e0[_0x8a98('0x75')],'read':_0x2ca7e0[_0x8a98('0x65')],'attachment':_0x2ca7e0[_0x8a98('0x61')]};})['value']()};return ejs['renderFile'](path[_0x8a98('0x54')](config[_0x8a98('0x55')],_0x8a98('0x56'),'views','downloadInteraction.ejs'),{'interaction':_0x2a4a82})[_0x8a98('0x1b')](function(_0x19670c){var _0x1ade4a=path[_0x8a98('0x54')](_0xe2cb84,_0x8a98('0x76')+_0x191856['id']+'-'+_0x346ecd+_0x8a98('0x77'));var _0x39ffd1={'path':_0x1ade4a,'channel':_0x8a98('0x78'),'interactionId':_0x191856['id']};return pdf[_0x8a98('0x79')](_0x19670c,_0x39ffd1);})['then'](function(){return new BPromise(function(_0x107aa9,_0x2e1c4f){zipdir(_0xe2cb84,{'saveTo':_0x10589b},function(_0x25f42f,_0x45efe1){if(_0x25f42f)return _0x2e1c4f(_0x25f42f);return _0x107aa9(_0x45efe1);});})[_0x8a98('0x1b')](function(){return new BPromise(function(_0x5c3f57,_0x36644d){rimraf(_0xe2cb84,function(_0x4f7bdd){if(_0x4f7bdd)_0x36644d(_0x4f7bdd);return _0x5c3f57();});});})[_0x8a98('0x1b')](function(){return _0x3517a7[_0x8a98('0x51')](_0x10589b,_0x46df35,function(_0x2929b7){if(_0x2929b7){console[_0x8a98('0x7a')](_0x8a98('0x7b'),_0x2929b7);}else{fs[_0x8a98('0x7c')](_0x10589b);}});});});}else{return _0x3517a7['sendStatus'](0xc8);}})[_0x8a98('0x29')](handleError(_0x3517a7,null));}; \ No newline at end of file +var _0x1b89=['path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','limit','count','offset','then','end','error','name','send','index','map','type','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','WhatsappInteraction','rawAttributes','intersection','attributes','fields','length','includeAll','include','find','create','body','update','destroy','describe','addMessage','WhatsappMessage','omit','ids','filters','nolimit','order','sort','where','WhatsappInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','Tag','emit','removeTags','download','unix','toString','join','root','server','files','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','closedAt','Messages','basename','existsSync','createReadStream','createWriteStream','out','secret','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','util'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x1b89,0x1d4));var _0x91b8=function(_0x290fd1,_0x5df6f1){_0x290fd1=_0x290fd1-0x0;var _0x5bdf49=_0x1b89[_0x290fd1];return _0x5bdf49;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x91b8('0x0'));var moment=require(_0x91b8('0x1'));var BPromise=require(_0x91b8('0x2'));var util=require(_0x91b8('0x3'));var path=require(_0x91b8('0x4'));var ejs=require(_0x91b8('0x5'));var fs=require('fs');var _=require(_0x91b8('0x6'));var Redis=require('ioredis');var interaction=require(_0x91b8('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x91b8('0x8'));var logger=require(_0x91b8('0x9'))(_0x91b8('0xa'));var config=require(_0x91b8('0xb'));var db=require(_0x91b8('0xc'))['db'];config[_0x91b8('0xd')]=_['defaults'](config[_0x91b8('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x91b8('0xe'))(new Redis(config[_0x91b8('0xd')]));require('./whatsappInteraction.socket')[_0x91b8('0xf')](socket);function respondWithStatusCode(_0x5c43d2,_0x470919){_0x470919=_0x470919||0xcc;return function(_0x40af93){if(_0x40af93){return _0x5c43d2[_0x91b8('0x10')](_0x470919);}return _0x5c43d2[_0x91b8('0x11')](_0x470919)['end']();};}function respondWithResult(_0x56aec8,_0x37a020){_0x37a020=_0x37a020||0xc8;return function(_0x4ece7b){if(_0x4ece7b){return _0x56aec8[_0x91b8('0x11')](_0x37a020)[_0x91b8('0x12')](_0x4ece7b);}};}function respondWithFilteredResult(_0x293bdd,_0x2ba822){return function(_0x3981c2){if(_0x3981c2){var _0x494ddd=typeof _0x2ba822['offset']==='undefined'&&typeof _0x2ba822[_0x91b8('0x13')]==='undefined';var _0x2341c6=_0x3981c2[_0x91b8('0x14')];var _0x278b77=_0x494ddd?0x0:_0x2ba822[_0x91b8('0x15')];var _0x777f01=_0x494ddd?_0x3981c2[_0x91b8('0x14')]:_0x2ba822['offset']+_0x2ba822[_0x91b8('0x13')];var _0x2c10a3;if(_0x777f01>=_0x2341c6){_0x777f01=_0x2341c6;_0x2c10a3=0xc8;}else{_0x2c10a3=0xce;}_0x293bdd[_0x91b8('0x11')](_0x2c10a3);return _0x293bdd['set']('Content-Range',_0x278b77+'-'+_0x777f01+'/'+_0x2341c6)[_0x91b8('0x12')](_0x3981c2);}return null;};}function saveUpdates(_0x4b76bf){return function(_0x25d681){if(_0x25d681){return _0x25d681['update'](_0x4b76bf)[_0x91b8('0x16')](function(_0x2f7239){return _0x2f7239;});}return null;};}function removeEntity(_0x4138c8){return function(_0x1e2a77){if(_0x1e2a77){return _0x1e2a77['destroy']()['then'](function(){_0x4138c8[_0x91b8('0x11')](0xcc)[_0x91b8('0x17')]();});}};}function handleEntityNotFound(_0x9362a4){return function(_0x578d6a){if(!_0x578d6a){_0x9362a4[_0x91b8('0x10')](0x194);}return _0x578d6a;};}function handleError(_0x3134fa,_0x177b43){_0x177b43=_0x177b43||0x1f4;return function(_0x34e8e0){logger[_0x91b8('0x18')](_0x34e8e0['stack']);if(_0x34e8e0[_0x91b8('0x19')]){delete _0x34e8e0['name'];}_0x3134fa[_0x91b8('0x11')](_0x177b43)[_0x91b8('0x1a')](_0x34e8e0);};}exports[_0x91b8('0x1b')]=function(_0x4fdd4d,_0x2ab0a1){var _0xbcf7ff={};var _0x3ffea6=_[_0x91b8('0x1c')](db['WhatsappInteraction']['rawAttributes'],function(_0x675151){return{'name':_0x675151['fieldName'],'type':_0x675151[_0x91b8('0x1d')]['key']};});_0xbcf7ff=qs[_0x91b8('0x1e')](_0x3ffea6,_0x4fdd4d);return interaction[_0x91b8('0x1f')](_0x91b8('0x20'),_0x4fdd4d[_0x91b8('0x21')],_0x4fdd4d[_0x91b8('0x22')],_0xbcf7ff,_0x3ffea6)[_0x91b8('0x16')](respondWithFilteredResult(_0x2ab0a1,_0xbcf7ff))[_0x91b8('0x23')](handleError(_0x2ab0a1,null));};exports[_0x91b8('0x24')]=function(_0xc0e68c,_0x354128){var _0xcbe0b={'raw':![],'where':{'id':_0xc0e68c[_0x91b8('0x25')]['id']}},_0x596071={};_0x596071[_0x91b8('0x26')]=_[_0x91b8('0x27')](db[_0x91b8('0x28')][_0x91b8('0x29')]);_0x596071[_0x91b8('0x21')]=_[_0x91b8('0x27')](_0xc0e68c[_0x91b8('0x21')]);_0x596071['filters']=_[_0x91b8('0x2a')](_0x596071[_0x91b8('0x26')],_0x596071[_0x91b8('0x21')]);_0xcbe0b[_0x91b8('0x2b')]=_[_0x91b8('0x2a')](_0x596071[_0x91b8('0x26')],qs['fields'](_0xc0e68c[_0x91b8('0x21')][_0x91b8('0x2c')]));_0xcbe0b[_0x91b8('0x2b')]=_0xcbe0b[_0x91b8('0x2b')][_0x91b8('0x2d')]?_0xcbe0b[_0x91b8('0x2b')]:_0x596071[_0x91b8('0x26')];if(_0xc0e68c[_0x91b8('0x21')][_0x91b8('0x2e')]){_0xcbe0b[_0x91b8('0x2f')]=[{'all':!![]}];}_0xcbe0b=_['merge']({},_0xcbe0b,_0xc0e68c['options']);return db[_0x91b8('0x28')][_0x91b8('0x30')](_0xcbe0b)[_0x91b8('0x16')](handleEntityNotFound(_0x354128,null))[_0x91b8('0x16')](respondWithResult(_0x354128,null))[_0x91b8('0x23')](handleError(_0x354128,null));};exports[_0x91b8('0x31')]=function(_0x110ca6,_0x352316){return db[_0x91b8('0x28')]['create'](_0x110ca6[_0x91b8('0x32')],{})[_0x91b8('0x16')](respondWithResult(_0x352316,0xc9))['catch'](handleError(_0x352316,null));};exports[_0x91b8('0x33')]=function(_0x34912a,_0x5e1a93){if(_0x34912a[_0x91b8('0x32')]['id']){delete _0x34912a[_0x91b8('0x32')]['id'];}return db[_0x91b8('0x28')][_0x91b8('0x30')]({'where':{'id':_0x34912a['params']['id']}})['then'](handleEntityNotFound(_0x5e1a93,null))[_0x91b8('0x16')](saveUpdates(_0x34912a[_0x91b8('0x32')],null))['then'](respondWithResult(_0x5e1a93,null))['catch'](handleError(_0x5e1a93,null));};exports[_0x91b8('0x34')]=function(_0x3858e2,_0x36f1bf){return db[_0x91b8('0x28')][_0x91b8('0x30')]({'where':{'id':_0x3858e2[_0x91b8('0x25')]['id']}})['then'](handleEntityNotFound(_0x36f1bf,null))[_0x91b8('0x16')](removeEntity(_0x36f1bf,null))[_0x91b8('0x23')](handleError(_0x36f1bf,null));};exports[_0x91b8('0x35')]=function(_0x512720,_0x5f1a97){return db['WhatsappInteraction'][_0x91b8('0x35')]()['then'](respondWithResult(_0x5f1a97,null))[_0x91b8('0x23')](handleError(_0x5f1a97,null));};exports[_0x91b8('0x36')]=function(_0x539087,_0x5ca9aa){return db[_0x91b8('0x37')][_0x91b8('0x30')]({'where':{'id':_0x539087[_0x91b8('0x25')]['id']}})[_0x91b8('0x16')](handleEntityNotFound(_0x5ca9aa,null))[_0x91b8('0x16')](function(_0x26a9c1){if(_0x26a9c1){return _0x26a9c1[_0x91b8('0x36')](_0x539087[_0x91b8('0x32')]['ids'],_[_0x91b8('0x38')](_0x539087[_0x91b8('0x32')],[_0x91b8('0x39'),'id'])||{});}})[_0x91b8('0x16')](respondWithResult(_0x5ca9aa,null))[_0x91b8('0x23')](handleError(_0x5ca9aa,null));};exports['getMessages']=function(_0x18ab64,_0x2688b9){var _0x527e92={'raw':![],'where':{}};var _0x296a10={};var _0x31c55b={'count':0x0,'rows':[]};return db[_0x91b8('0x28')]['findOne']({'where':{'id':_0x18ab64[_0x91b8('0x25')]['id']}})['then'](handleEntityNotFound(_0x2688b9,null))[_0x91b8('0x16')](function(_0x1764fe){if(_0x1764fe){_0x296a10['model']=_['keys'](db[_0x91b8('0x37')][_0x91b8('0x29')]);_0x296a10['query']=_[_0x91b8('0x27')](_0x18ab64[_0x91b8('0x21')]);_0x296a10[_0x91b8('0x3a')]=_[_0x91b8('0x2a')](_0x296a10[_0x91b8('0x26')],_0x296a10[_0x91b8('0x21')]);_0x527e92[_0x91b8('0x2b')]=_[_0x91b8('0x2a')](_0x296a10[_0x91b8('0x26')],qs[_0x91b8('0x2c')](_0x18ab64[_0x91b8('0x21')][_0x91b8('0x2c')]));_0x527e92[_0x91b8('0x2b')]=_0x527e92[_0x91b8('0x2b')][_0x91b8('0x2d')]?_0x527e92['attributes']:_0x296a10[_0x91b8('0x26')];if(!_0x18ab64[_0x91b8('0x21')]['hasOwnProperty'](_0x91b8('0x3b'))){_0x527e92[_0x91b8('0x13')]=qs[_0x91b8('0x13')](_0x18ab64[_0x91b8('0x21')]['limit']);_0x527e92[_0x91b8('0x15')]=qs[_0x91b8('0x15')](_0x18ab64[_0x91b8('0x21')][_0x91b8('0x15')]);}_0x527e92[_0x91b8('0x3c')]=qs[_0x91b8('0x3d')](_0x18ab64[_0x91b8('0x21')][_0x91b8('0x3d')]);_0x527e92[_0x91b8('0x3e')]=qs[_0x91b8('0x3a')](_['pick'](_0x18ab64['query'],_0x296a10['filters']));_0x527e92['where'][_0x91b8('0x3f')]=_0x1764fe['id'];if(_0x18ab64['query'][_0x91b8('0x40')]){_0x527e92['where']=_[_0x91b8('0x41')](_0x527e92[_0x91b8('0x3e')],{'$or':_['map'](_0x527e92[_0x91b8('0x2b')],function(_0x220558){var _0x2c309b={};_0x2c309b[_0x220558]={'$like':'%'+_0x18ab64[_0x91b8('0x21')][_0x91b8('0x40')]+'%'};return _0x2c309b;})});}if(_0x18ab64[_0x91b8('0x21')][_0x91b8('0x42')]){var _0x4bca90=_0x18ab64['query'][_0x91b8('0x42')][_0x91b8('0x43')](',');var _0xe6d078={};_0xe6d078[_0x4bca90[0x0]]={'$gte':moment(_0x4bca90[0x1])[_0x91b8('0x44')](_0x91b8('0x45'))};_0x527e92['where']=_[_0x91b8('0x41')](_0x527e92[_0x91b8('0x3e')],_0xe6d078);}_0x527e92=_[_0x91b8('0x41')]({},_0x527e92,_0x18ab64['options']);return db[_0x91b8('0x37')][_0x91b8('0x14')]({'where':_0x527e92[_0x91b8('0x3e')]})[_0x91b8('0x16')](function(_0x8949ca){_0x31c55b['count']=_0x8949ca;if(_0x18ab64[_0x91b8('0x21')][_0x91b8('0x2e')]){_0x527e92[_0x91b8('0x2f')]=[{'all':!![]}];}return db[_0x91b8('0x37')][_0x91b8('0x1f')](_0x527e92);})[_0x91b8('0x16')](function(_0x4c4611){_0x31c55b['rows']=_0x4c4611;return _0x31c55b;});}})[_0x91b8('0x16')](respondWithFilteredResult(_0x2688b9,_0x527e92))[_0x91b8('0x23')](handleError(_0x2688b9,null));};exports[_0x91b8('0x46')]=function(_0x2b01f1,_0x45f2f1){return db['WhatsappInteraction'][_0x91b8('0x30')]({'where':{'id':_0x2b01f1[_0x91b8('0x25')]['id']}})['then'](handleEntityNotFound(_0x45f2f1,null))[_0x91b8('0x16')](function(_0x392064){if(_0x392064){return _0x392064[_0x91b8('0x47')](_0x2b01f1[_0x91b8('0x32')]['ids'],_[_0x91b8('0x38')](_0x2b01f1[_0x91b8('0x32')],[_0x91b8('0x39'),'id'])||{})['spread'](function(){return db[_0x91b8('0x48')]['findAll']({'attributes':['id',_0x91b8('0x19'),'color'],'where':{'id':_0x2b01f1[_0x91b8('0x32')][_0x91b8('0x39')]}});})['then'](function(_0x2c4b64){socket[_0x91b8('0x49')]('whatsappInteractionTags:save',{'id':Number(_0x2b01f1['params']['id']),'tags':_0x2c4b64||[]});return{'id':Number(_0x2b01f1[_0x91b8('0x25')]['id']),'tags':_0x2c4b64||[]};});}})[_0x91b8('0x16')](respondWithResult(_0x45f2f1,null))[_0x91b8('0x23')](handleError(_0x45f2f1,null));};exports[_0x91b8('0x4a')]=function(_0x51ccc1,_0x538431){return db[_0x91b8('0x28')][_0x91b8('0x30')]({'where':{'id':_0x51ccc1[_0x91b8('0x25')]['id']}})[_0x91b8('0x16')](handleEntityNotFound(_0x538431,null))['then'](function(_0xe0ca57){if(_0xe0ca57){return _0xe0ca57[_0x91b8('0x4a')](_0x51ccc1[_0x91b8('0x21')][_0x91b8('0x39')]);}})[_0x91b8('0x16')](respondWithStatusCode(_0x538431,null))[_0x91b8('0x23')](handleError(_0x538431,null));};exports[_0x91b8('0x4b')]=function(_0x439bac,_0x1b6d9e){var _0x547c4e=moment()[_0x91b8('0x4c')]()[_0x91b8('0x4d')]();var _0x5ebb1f=path[_0x91b8('0x4e')](config[_0x91b8('0x4f')],_0x91b8('0x50'),_0x91b8('0x51'),'tmp');var _0x3e0f34=path[_0x91b8('0x4e')](config[_0x91b8('0x4f')],_0x91b8('0x50'),_0x91b8('0x51'),_0x91b8('0x52'));var _0x4a3e23=path[_0x91b8('0x4e')](_0x5ebb1f,_0x547c4e);var _0x88a9e5=util[_0x91b8('0x44')]('transcript-%d-%s.zip',_0x439bac['params']['id'],_0x547c4e);var _0x2243fd=path['join'](_0x5ebb1f,_0x88a9e5);var _0x3f7df3=[];_0x3f7df3[_0x91b8('0x53')]({'model':db[_0x91b8('0x54')],'as':_0x91b8('0x54'),'attributes':['id',_0x91b8('0x55')],'raw':!![]});_0x3f7df3[_0x91b8('0x53')]({'model':db[_0x91b8('0x56')],'as':_0x91b8('0x57'),'attributes':['id',_0x91b8('0x58'),_0x91b8('0x59')],'raw':!![]});if(_0x439bac[_0x91b8('0x21')]['attachments']){_0x3f7df3['push']({'model':db[_0x91b8('0x5a')],'as':'Attachment','raw':!![]});}var _0x3d0eec=[{'model':db[_0x91b8('0x37')],'as':'Messages','attributes':['id',_0x91b8('0x32'),_0x91b8('0x5b'),_0x91b8('0x5c'),'secret','read'],'include':_0x3f7df3}];_0x3d0eec[_0x91b8('0x53')]({'model':db[_0x91b8('0x5d')],'as':_0x91b8('0x5e'),'attributes':['id','name']});_0x3d0eec['push']({'model':db[_0x91b8('0x54')],'as':_0x91b8('0x5f'),'attributes':['id',_0x91b8('0x55')]});return db[_0x91b8('0x28')]['find']({'where':{'id':_0x439bac['params']['id']},'include':_0x3d0eec})[_0x91b8('0x16')](handleEntityNotFound(_0x1b6d9e,null))['then'](function(_0x1a8242){if(_0x1a8242){var _0x58a8f1=_0x1a8242['get']({'plain':!![]});fs[_0x91b8('0x60')](_0x4a3e23);var _0x2010b3={'channel':_0x91b8('0x61'),'account':_0x58a8f1['Account'][_0x91b8('0x19')],'agent':_0x58a8f1['Owner']?_0x58a8f1[_0x91b8('0x5f')][_0x91b8('0x55')]:_0x91b8('0x62'),'createdAt':moment(_0x58a8f1[_0x91b8('0x5b')])[_0x91b8('0x44')](_0x91b8('0x45'))[_0x91b8('0x4d')](),'closedAt':_0x58a8f1[_0x91b8('0x63')]?moment(_0x58a8f1[_0x91b8('0x64')])[_0x91b8('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x58a8f1['disposition'],'messages':_(_0x58a8f1[_0x91b8('0x65')])[_0x91b8('0x40')]({'secret':![]})[_0x91b8('0x1c')](function(_0x2006d3){if(_0x2006d3['Attachment']){var _0x46b964=path[_0x91b8('0x4e')](_0x3e0f34,_0x2006d3['Attachment'][_0x91b8('0x66')]);if(fs[_0x91b8('0x67')](_0x46b964)){fs[_0x91b8('0x68')](_0x46b964)['pipe'](fs[_0x91b8('0x69')](path[_0x91b8('0x4e')](_0x4a3e23,_0x2006d3[_0x91b8('0x5a')][_0x91b8('0x66')])));}}return{'date':moment(_0x2006d3[_0x91b8('0x5b')])[_0x91b8('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2006d3[_0x91b8('0x5c')]==='out'?_0x2006d3['User']?_0x2006d3[_0x91b8('0x54')][_0x91b8('0x55')]:'System':_0x2006d3[_0x91b8('0x57')][_0x91b8('0x58')]+(_0x2006d3[_0x91b8('0x57')]['lastName']?'\x20'+_0x2006d3[_0x91b8('0x57')][_0x91b8('0x59')]:''),'body':_0x2006d3[_0x91b8('0x5a')]?_0x2006d3[_0x91b8('0x5a')][_0x91b8('0x66')]:_0x2006d3[_0x91b8('0x32')],'direction':_0x2006d3[_0x91b8('0x5c')]===_0x91b8('0x6a')?'A':'C','secret':_0x2006d3[_0x91b8('0x6b')],'read':_0x2006d3[_0x91b8('0x6c')],'attachment':_0x2006d3['Attachment']};})[_0x91b8('0x6d')]()};return ejs[_0x91b8('0x6e')](path[_0x91b8('0x4e')](config[_0x91b8('0x4f')],_0x91b8('0x50'),'views',_0x91b8('0x6f')),{'interaction':_0x2010b3})[_0x91b8('0x16')](function(_0xd5f765){var _0x1a73e0=path[_0x91b8('0x4e')](_0x4a3e23,_0x91b8('0x70')+_0x58a8f1['id']+'-'+_0x547c4e+_0x91b8('0x71'));var _0x30d53e={'path':_0x1a73e0,'channel':'Whatsapp','interactionId':_0x58a8f1['id']};return pdf[_0x91b8('0x72')](_0xd5f765,_0x30d53e);})[_0x91b8('0x16')](function(){return new BPromise(function(_0x33cc5e,_0x3e35b9){zipdir(_0x4a3e23,{'saveTo':_0x2243fd},function(_0x5002b9,_0x6dcdb4){if(_0x5002b9)return _0x3e35b9(_0x5002b9);return _0x33cc5e(_0x6dcdb4);});})[_0x91b8('0x16')](function(){return new BPromise(function(_0x21e72a,_0x4b122c){rimraf(_0x4a3e23,function(_0x5dd759){if(_0x5dd759)_0x4b122c(_0x5dd759);return _0x21e72a();});});})[_0x91b8('0x16')](function(){return _0x1b6d9e[_0x91b8('0x4b')](_0x2243fd,_0x88a9e5,function(_0x164d6e){if(_0x164d6e){console[_0x91b8('0x73')](_0x91b8('0x74'),_0x164d6e);}else{fs[_0x91b8('0x75')](_0x2243fd);}});});});}else{return _0x1b6d9e[_0x91b8('0x10')](0xc8);}})[_0x91b8('0x23')](handleError(_0x1b6d9e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index a653392..abb246e 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 _0x6be1=['update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6be1,0x12f));var _0x16be=function(_0x5a0c89,_0x5195ea){_0x5a0c89=_0x5a0c89-0x0;var _0x5edcb5=_0x6be1[_0x5a0c89];return _0x5edcb5;};'use strict';var EventEmitter=require(_0x16be('0x0'));var WhatsappInteraction=require(_0x16be('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16be('0x2'),'afterUpdate':_0x16be('0x3'),'afterDestroy':_0x16be('0x4')};function emitEvent(_0x18fafc){return function(_0x8e7a1,_0x5743a,_0x36e4da){_0x8e7a1[_0x16be('0x5')]({'attributes':['id'],'raw':!![]})[_0x16be('0x6')](function(_0x1c5e94){_0x8e7a1['setDataValue'](_0x16be('0x7'),_0x1c5e94[_0x16be('0x8')](function(_0x1c0460){return{'id':_0x1c0460['id']};}));return WhatsappMessage[_0x16be('0x9')]({'where':{'WhatsappInteractionId':_0x8e7a1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16be('0x6')](function(_0x3227ca){_0x8e7a1[_0x16be('0xa')](_0x16be('0xb'),_0x3227ca[_0x16be('0xc')]);WhatsappInteractionEvents[_0x16be('0xd')](_0x18fafc+':'+_0x8e7a1['id'],_0x8e7a1);WhatsappInteractionEvents[_0x16be('0xd')](_0x18fafc,_0x8e7a1);_0x36e4da(null);})[_0x16be('0xe')](_0x36e4da(null));};}for(var e in events){if(events[_0x16be('0xf')](e)){var event=events[e];WhatsappInteraction[_0x16be('0x10')](e,emitEvent(event));}}module[_0x16be('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xf4eb=['then','setDataValue','findAll','unreadMessages','length','catch','hook','exports','events','setMaxListeners','remove','getUsers'];(function(_0x211118,_0x47e09e){var _0x463d8c=function(_0x286e30){while(--_0x286e30){_0x211118['push'](_0x211118['shift']());}};_0x463d8c(++_0x47e09e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3df7b6,_0x454243){_0x3df7b6=_0x3df7b6-0x0;var _0x586432=_0xf4eb[_0x3df7b6];return _0x586432;};'use strict';var EventEmitter=require(_0xbf4e('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbf4e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbf4e('0x2')};function emitEvent(_0x1c7606){return function(_0x32d1d7,_0x18c665,_0xa4dcf5){_0x32d1d7[_0xbf4e('0x3')]({'attributes':['id'],'raw':!![]})[_0xbf4e('0x4')](function(_0x540736){_0x32d1d7[_0xbf4e('0x5')]('Users',_0x540736['map'](function(_0xa4280c){return{'id':_0xa4280c['id']};}));return WhatsappMessage[_0xbf4e('0x6')]({'where':{'WhatsappInteractionId':_0x32d1d7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbf4e('0x4')](function(_0xc86f04){_0x32d1d7[_0xbf4e('0x5')](_0xbf4e('0x7'),_0xc86f04[_0xbf4e('0x8')]);WhatsappInteractionEvents['emit'](_0x1c7606+':'+_0x32d1d7['id'],_0x32d1d7);WhatsappInteractionEvents['emit'](_0x1c7606,_0x32d1d7);_0xa4dcf5(null);})[_0xbf4e('0x9')](_0xa4dcf5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xbf4e('0xa')](e,emitEvent(event));}}module[_0xbf4e('0xb')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 36b2d67..5eee543 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 _0xfaa4=['define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','lodash','util','../../config/logger','moment','./whatsappInteraction.attributes','exports'];(function(_0x4b55e8,_0x41ba7e){var _0x46e844=function(_0x2b1e4f){while(--_0x2b1e4f){_0x4b55e8['push'](_0x4b55e8['shift']());}};_0x46e844(++_0x41ba7e);}(_0xfaa4,0x17a));var _0x4faa=function(_0x1875e5,_0x2e953a){_0x1875e5=_0x1875e5-0x0;var _0x199da0=_0xfaa4[_0x1875e5];return _0x199da0;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var logger=require(_0x4faa('0x2'))('api');var moment=require(_0x4faa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4faa('0x4'));module[_0x4faa('0x5')]=function(_0x26d8ac,_0x6fe7da){return _0x26d8ac[_0x4faa('0x6')](_0x4faa('0x7'),attributes,{'tableName':_0x4faa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x353019,_0x388487,_0x2d2c74){if(_0x353019[_0x4faa('0x9')](_0x4faa('0xa'))){_0x353019['closedAt']=moment()[_0x4faa('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d2c74(null,_0x353019);}}});}; \ No newline at end of file +var _0x4c5a=['define','WhatsappInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x15c166,_0xc6050f){var _0x55987e=function(_0x4837f5){while(--_0x4837f5){_0x15c166['push'](_0x15c166['shift']());}};_0x55987e(++_0xc6050f);}(_0x4c5a,0x1c0));var _0xa4c5=function(_0x1a5182,_0x25b2dd){_0x1a5182=_0x1a5182-0x0;var _0x37d275=_0x4c5a[_0x1a5182];return _0x37d275;};'use strict';var _=require(_0xa4c5('0x0'));var util=require(_0xa4c5('0x1'));var logger=require('../../config/logger')(_0xa4c5('0x2'));var moment=require(_0xa4c5('0x3'));var BPromise=require('bluebird');var rp=require(_0xa4c5('0x4'));var fs=require('fs');var path=require(_0xa4c5('0x5'));var rimraf=require('rimraf');var config=require(_0xa4c5('0x6'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x748d28,_0x1141fe){return _0x748d28[_0xa4c5('0x7')](_0xa4c5('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43c5b9,_0x207168,_0x2e3958){if(_0x43c5b9[_0xa4c5('0x9')]('closed')){_0x43c5b9[_0xa4c5('0xa')]=moment()[_0xa4c5('0xb')](_0xa4c5('0xc'));}_0x2e3958(null,_0x43c5b9);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c149e7c..64d8de0 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 _0x1ad3=['catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','info','AddTags','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x35c1cf,_0x197400){var _0x56bc59=function(_0x7b52ad){while(--_0x7b52ad){_0x35c1cf['push'](_0x35c1cf['shift']());}};_0x56bc59(++_0x197400);}(_0x1ad3,0x137));var _0x31ad=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0x1ad3[_0x1bb812];return _0x372adb;};'use strict';var _=require('lodash');var util=require(_0x31ad('0x0'));var moment=require(_0x31ad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31ad('0x2'))['db'];var utils=require(_0x31ad('0x3'));var logger=require(_0x31ad('0x4'))(_0x31ad('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x31ad('0x6')]({'port':0x232a});config[_0x31ad('0x7')]=_[_0x31ad('0x8')](config[_0x31ad('0x7')],{'host':_0x31ad('0x9'),'port':0x18eb});var socket=require(_0x31ad('0xa'))(new Redis(config[_0x31ad('0x7')]));require('./whatsappInteraction.socket')[_0x31ad('0xb')](socket);function respondWithRpcPromise(_0x5438ca,_0x22cc8a,_0x2623d0){return new BPromise(function(_0x588dde,_0x4fc79a){return client[_0x31ad('0xc')](_0x5438ca,_0x2623d0)[_0x31ad('0xd')](function(_0x6856e1){logger['info'](_0x31ad('0xe'),_0x22cc8a,_0x31ad('0xf'));logger[_0x31ad('0x10')](_0x31ad('0x11'),_0x22cc8a,'request\x20sent',JSON[_0x31ad('0x12')](_0x6856e1));if(_0x6856e1['error']){if(_0x6856e1[_0x31ad('0x13')]['code']===0x1f4){logger[_0x31ad('0x13')](_0x31ad('0xe'),_0x22cc8a,_0x6856e1[_0x31ad('0x13')][_0x31ad('0x14')]);return _0x4fc79a(_0x6856e1[_0x31ad('0x13')]['message']);}logger[_0x31ad('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x22cc8a,_0x6856e1['error'][_0x31ad('0x14')]);return _0x588dde(_0x6856e1['error']['message']);}else{logger['info'](_0x31ad('0xe'),_0x22cc8a,_0x31ad('0xf'));_0x588dde(_0x6856e1[_0x31ad('0x15')][_0x31ad('0x14')]);}})[_0x31ad('0x16')](function(_0x560b78){logger[_0x31ad('0x13')](_0x31ad('0xe'),_0x22cc8a,_0x560b78);_0x4fc79a(_0x560b78);});});}exports[_0x31ad('0x17')]=function(_0x38fffc){var _0x579264=this;return new Promise(function(_0x1f3a7e,_0x44766c){return db[_0x31ad('0x18')]['update'](_0x38fffc[_0x31ad('0x19')],{'raw':_0x38fffc['options']?_0x38fffc[_0x31ad('0x1a')][_0x31ad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38fffc[_0x31ad('0x1a')]?_0x38fffc[_0x31ad('0x1a')][_0x31ad('0x1c')]||null:null,'attributes':_0x38fffc[_0x31ad('0x1a')]?_0x38fffc['options'][_0x31ad('0x1d')]||null:null,'limit':_0x38fffc['options']?_0x38fffc[_0x31ad('0x1a')]['limit']||null:null})[_0x31ad('0xd')](function(_0x502c9f){logger['info'](_0x31ad('0x17'),_0x38fffc);logger[_0x31ad('0x10')](_0x31ad('0x17'),_0x38fffc,JSON['stringify'](_0x502c9f));_0x1f3a7e(_0x502c9f);})[_0x31ad('0x16')](function(_0x371e01){logger[_0x31ad('0x13')]('UpdateWhatsappInteraction',_0x371e01[_0x31ad('0x14')],_0x38fffc);_0x44766c(_0x579264['error'](0x1f4,_0x371e01[_0x31ad('0x14')]));});});};exports[_0x31ad('0x1e')]=function(_0xa71631){return new Promise(function(_0x579a29,_0x1d3e99){return db[_0x31ad('0x18')]['find']({'where':_0xa71631['options']?_0xa71631['options'][_0x31ad('0x1c')]||null:null})[_0x31ad('0xd')](function(_0xa1f858){if(_0xa1f858){return _0xa1f858[_0x31ad('0x1f')](_0xa71631[_0x31ad('0x19')][_0x31ad('0x20')],_[_0x31ad('0x21')](_0xa71631[_0x31ad('0x19')],[_0x31ad('0x20'),'id'])||{});}})[_0x31ad('0x22')](function(_0x52aa11){logger[_0x31ad('0x23')](_0x31ad('0x24'),_0xa71631);logger[_0x31ad('0x10')]('AddTags',_0xa71631,JSON[_0x31ad('0x12')](_0x52aa11));_0x579a29(_0x52aa11);})[_0x31ad('0x16')](function(_0x2806fb){logger[_0x31ad('0x13')]('AddTags',_0x2806fb[_0x31ad('0x14')],_0xa71631);_0x1d3e99(_this[_0x31ad('0x13')](0x1f4,_0x2806fb[_0x31ad('0x14')]));});});}; \ No newline at end of file +var _0x9423=['addTags','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','limit','catch','AddTagsToWhatsappInteraction','find','where'];(function(_0x107040,_0x1a65b2){var _0x212f01=function(_0x930fcc){while(--_0x930fcc){_0x107040['push'](_0x107040['shift']());}};_0x212f01(++_0x1a65b2);}(_0x9423,0xef));var _0x3942=function(_0x128689,_0x209c92){_0x128689=_0x128689-0x0;var _0x12c6ef=_0x9423[_0x128689];return _0x12c6ef;};'use strict';var _=require(_0x3942('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3942('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3942('0x2'));var db=require(_0x3942('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3942('0x4'))('rpc');var config=require(_0x3942('0x5'));var jayson=require(_0x3942('0x6'));var client=jayson[_0x3942('0x7')][_0x3942('0x8')]({'port':0x232a});config[_0x3942('0x9')]=_['defaults'](config[_0x3942('0x9')],{'host':_0x3942('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3942('0x9')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x79066b,_0x5b96f9,_0x2e3fff){return new BPromise(function(_0x5ded45,_0x3773e2){return client['request'](_0x79066b,_0x2e3fff)[_0x3942('0xb')](function(_0x19279f){logger[_0x3942('0xc')]('WhatsappInteraction,\x20%s,\x20%s',_0x5b96f9,_0x3942('0xd'));logger[_0x3942('0xe')](_0x3942('0xf'),_0x5b96f9,'request\x20sent',JSON[_0x3942('0x10')](_0x19279f));if(_0x19279f[_0x3942('0x11')]){if(_0x19279f['error'][_0x3942('0x12')]===0x1f4){logger[_0x3942('0x11')](_0x3942('0x13'),_0x5b96f9,_0x19279f[_0x3942('0x11')]['message']);return _0x3773e2(_0x19279f[_0x3942('0x11')][_0x3942('0x14')]);}logger['error'](_0x3942('0x13'),_0x5b96f9,_0x19279f[_0x3942('0x11')][_0x3942('0x14')]);return _0x5ded45(_0x19279f['error'][_0x3942('0x14')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x5b96f9,'request\x20sent');_0x5ded45(_0x19279f[_0x3942('0x15')]['message']);}})['catch'](function(_0x488c89){logger[_0x3942('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x5b96f9,_0x488c89);_0x3773e2(_0x488c89);});});}exports[_0x3942('0x16')]=function(_0x39b4c5){var _0x43cd81=this;return new Promise(function(_0x3943a2,_0x333548){return db[_0x3942('0x17')][_0x3942('0x18')](_0x39b4c5[_0x3942('0x19')],{'raw':_0x39b4c5[_0x3942('0x1a')]?_0x39b4c5[_0x3942('0x1a')][_0x3942('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39b4c5[_0x3942('0x1a')]?_0x39b4c5[_0x3942('0x1a')]['where']||null:null,'attributes':_0x39b4c5['options']?_0x39b4c5[_0x3942('0x1a')][_0x3942('0x1c')]||null:null,'limit':_0x39b4c5['options']?_0x39b4c5['options'][_0x3942('0x1d')]||null:null})[_0x3942('0xb')](function(_0x53fe46){logger[_0x3942('0xc')](_0x3942('0x16'),_0x39b4c5);logger[_0x3942('0xe')](_0x3942('0x16'),_0x39b4c5,JSON[_0x3942('0x10')](_0x53fe46));_0x3943a2(_0x53fe46);})[_0x3942('0x1e')](function(_0x20acc0){logger['error'](_0x3942('0x16'),_0x20acc0['message'],_0x39b4c5);_0x333548(_0x43cd81[_0x3942('0x11')](0x1f4,_0x20acc0[_0x3942('0x14')]));});});};exports[_0x3942('0x1f')]=function(_0x4d4122){return new Promise(function(_0xb8e36f,_0x120426){return db[_0x3942('0x17')][_0x3942('0x20')]({'where':_0x4d4122['options']?_0x4d4122[_0x3942('0x1a')][_0x3942('0x21')]||null:null})[_0x3942('0xb')](function(_0x3a86be){if(_0x3a86be){return _0x3a86be[_0x3942('0x22')](_0x4d4122[_0x3942('0x19')][_0x3942('0x23')],_[_0x3942('0x24')](_0x4d4122[_0x3942('0x19')],['ids','id'])||{});}})[_0x3942('0x25')](function(_0x301436){logger['info']('AddTags',_0x4d4122);logger[_0x3942('0xe')](_0x3942('0x26'),_0x4d4122,JSON[_0x3942('0x10')](_0x301436));_0xb8e36f(_0x301436);})[_0x3942('0x1e')](function(_0x426ea9){logger[_0x3942('0x11')](_0x3942('0x26'),_0x426ea9[_0x3942('0x14')],_0x4d4122);_0x120426(_this[_0x3942('0x11')](0x1f4,_0x426ea9[_0x3942('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 9b0d9d8..1b224de 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 _0x6693=['./whatsappInteraction.events','save','remove','update','emit','length'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x6693,0x120));var _0x3669=function(_0x49804e,_0x21ef26){_0x49804e=_0x49804e-0x0;var _0x4ecfbc=_0x6693[_0x49804e];return _0x4ecfbc;};'use strict';var WhatsappInteractionEvents=require(_0x3669('0x0'));var events=[_0x3669('0x1'),_0x3669('0x2'),_0x3669('0x3')];function createListener(_0x220ec0,_0xf54c5a){return function(_0x2aebbe){_0xf54c5a[_0x3669('0x4')](_0x220ec0,_0x2aebbe);};}function removeListener(_0x7dcb04,_0xd7011a){return function(){WhatsappInteractionEvents['removeListener'](_0x7dcb04,_0xd7011a);};}exports['register']=function(_0x214515){for(var _0x2586ea=0x0,_0x18b470=events[_0x3669('0x5')];_0x2586ea<_0x18b470;_0x2586ea++){var _0x1b670c=events[_0x2586ea];var _0x1e74c7=createListener('whatsappInteraction:'+_0x1b670c,_0x214515);WhatsappInteractionEvents['on'](_0x1b670c,_0x1e74c7);}}; \ No newline at end of file +var _0x8a72=['whatsappInteraction:','./whatsappInteraction.events','save','update','removeListener','length'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x8a72,0xd9));var _0x28a7=function(_0x18f590,_0x255344){_0x18f590=_0x18f590-0x0;var _0x37debb=_0x8a72[_0x18f590];return _0x37debb;};'use strict';var WhatsappInteractionEvents=require(_0x28a7('0x0'));var events=[_0x28a7('0x1'),'remove',_0x28a7('0x2')];function createListener(_0x34a2a4,_0x2aec0c){return function(_0x11af19){_0x2aec0c['emit'](_0x34a2a4,_0x11af19);};}function removeListener(_0x843661,_0x3d4fc5){return function(){WhatsappInteractionEvents[_0x28a7('0x3')](_0x843661,_0x3d4fc5);};}exports['register']=function(_0x3b074d){for(var _0x2452d9=0x0,_0x4e63e7=events[_0x28a7('0x4')];_0x2452d9<_0x4e63e7;_0x2452d9++){var _0x52dd28=events[_0x2452d9];var _0x3f4f6e=createListener(_0x28a7('0x5')+_0x52dd28,_0x3b074d);WhatsappInteractionEvents['on'](_0x52dd28,_0x3f4f6e);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d72d08d..c956928 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 _0x3320=['reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','tracked','whatsapp','whatsappmessage:create','status','put','update','/:id/accept','accept','/:id/reject'];(function(_0x4ea9c8,_0x1bb40e){var _0x482d14=function(_0x5e5a9f){while(--_0x5e5a9f){_0x4ea9c8['push'](_0x4ea9c8['shift']());}};_0x482d14(++_0x1bb40e);}(_0x3320,0x12d));var _0x0332=function(_0x39aedb,_0x11ec9c){_0x39aedb=_0x39aedb-0x0;var _0x1e016f=_0x3320[_0x39aedb];return _0x1e016f;};'use strict';var multer=require('multer');var util=require(_0x0332('0x0'));var path=require(_0x0332('0x1'));var timeout=require(_0x0332('0x2'));var express=require(_0x0332('0x3'));var router=express[_0x0332('0x4')]();var fs_extra=require(_0x0332('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0332('0x6'));var config=require(_0x0332('0x7'));var controller=require('./whatsappMessage.controller');router[_0x0332('0x8')]('/',auth[_0x0332('0x9')](),controller[_0x0332('0xa')]);router[_0x0332('0x8')]('/describe',auth[_0x0332('0x9')](),controller['describe']);router['get'](_0x0332('0xb'),auth[_0x0332('0x9')](),controller[_0x0332('0xc')]);router[_0x0332('0xd')]('/',auth[_0x0332('0x9')](),interaction[_0x0332('0xe')](_0x0332('0xf'),_0x0332('0x10')),controller['create']);router['post']('/:id/status',controller[_0x0332('0x11')]);router[_0x0332('0x12')](_0x0332('0xb'),auth[_0x0332('0x9')](),controller[_0x0332('0x13')]);router[_0x0332('0x12')](_0x0332('0x14'),auth[_0x0332('0x9')](),controller[_0x0332('0x15')]);router[_0x0332('0x12')](_0x0332('0x16'),auth[_0x0332('0x9')](),controller[_0x0332('0x17')]);router[_0x0332('0x18')](_0x0332('0xb'),auth[_0x0332('0x9')](),controller[_0x0332('0x19')]);module[_0x0332('0x1a')]=router; \ No newline at end of file +var _0x333d=['whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','tracked'];(function(_0xc8c3e2,_0x4aa48d){var _0x680c59=function(_0x4e9b08){while(--_0x4e9b08){_0xc8c3e2['push'](_0xc8c3e2['shift']());}};_0x680c59(++_0x4aa48d);}(_0x333d,0x193));var _0xd333=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x333d[_0x277107];return _0x1da046;};'use strict';var multer=require(_0xd333('0x0'));var util=require('util');var path=require(_0xd333('0x1'));var timeout=require(_0xd333('0x2'));var express=require(_0xd333('0x3'));var router=express[_0xd333('0x4')]();var fs_extra=require(_0xd333('0x5'));var auth=require(_0xd333('0x6'));var interaction=require(_0xd333('0x7'));var config=require(_0xd333('0x8'));var controller=require('./whatsappMessage.controller');router[_0xd333('0x9')]('/',auth[_0xd333('0xa')](),controller[_0xd333('0xb')]);router[_0xd333('0x9')](_0xd333('0xc'),auth[_0xd333('0xa')](),controller[_0xd333('0xd')]);router[_0xd333('0x9')](_0xd333('0xe'),auth[_0xd333('0xa')](),controller['show']);router[_0xd333('0xf')]('/',auth[_0xd333('0xa')](),interaction[_0xd333('0x10')](_0xd333('0x11'),_0xd333('0x12')),controller[_0xd333('0x13')]);router[_0xd333('0xf')](_0xd333('0x14'),controller[_0xd333('0x15')]);router[_0xd333('0x16')](_0xd333('0xe'),auth[_0xd333('0xa')](),controller[_0xd333('0x17')]);router[_0xd333('0x16')](_0xd333('0x18'),auth[_0xd333('0xa')](),controller[_0xd333('0x19')]);router[_0xd333('0x16')](_0xd333('0x1a'),auth[_0xd333('0xa')](),controller[_0xd333('0x1b')]);router['delete'](_0xd333('0xe'),auth['isAuthenticated'](),controller[_0xd333('0x1c')]);module[_0xd333('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 cbd44f1..0a6f573 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 _0xb715=['medium','BOOLEAN','out','STRING','TEXT','exports'];(function(_0x5b734b,_0x486a7f){var _0x2a15a3=function(_0x187239){while(--_0x187239){_0x5b734b['push'](_0x5b734b['shift']());}};_0x2a15a3(++_0x486a7f);}(_0xb715,0x16d));var _0x5b71=function(_0x35c805,_0x468612){_0x35c805=_0x35c805-0x0;var _0x4a7a7f=_0xb715[_0x35c805];return _0x4a7a7f;};'use strict';var Sequelize=require('sequelize');module[_0x5b71('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5b71('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5b71('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5b71('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x5b71('0x4')](0xbe)},'phone':{'type':Sequelize[_0x5b71('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5b71('0x4')]},'providerResponse':{'type':Sequelize[_0x5b71('0x5')]}}; \ No newline at end of file +var _0xf78b=['BOOLEAN','sequelize','TEXT','medium','out','STRING','DATE'];(function(_0x55e113,_0x72aeb){var _0x2e287c=function(_0x5178d9){while(--_0x5178d9){_0x55e113['push'](_0x55e113['shift']());}};_0x2e287c(++_0x72aeb);}(_0xf78b,0x78));var _0xbf78=function(_0xa4c2e7,_0x4b67e9){_0xa4c2e7=_0xa4c2e7-0x0;var _0x5b34ae=_0xf78b[_0xa4c2e7];return _0x5b34ae;};'use strict';var Sequelize=require(_0xbf78('0x0'));module['exports']={'body':{'type':Sequelize[_0xbf78('0x1')](_0xbf78('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbf78('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbf78('0x4')](0xbe)},'phone':{'type':Sequelize[_0xbf78('0x4')]},'readAt':{'type':Sequelize[_0xbf78('0x5')]},'secret':{'type':Sequelize[_0xbf78('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbf78('0x4')]},'providerResponse':{'type':Sequelize[_0xbf78('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 3125bf6..c554235 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 _0xdc93=['util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','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','./whatsappMessage.socket','register','http','client','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','params','options','create','body','find','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','QueryTypes','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x445018,_0x36c4e9){var _0x2e2808=function(_0x37f655){while(--_0x37f655){_0x445018['push'](_0x445018['shift']());}};_0x2e2808(++_0x36c4e9);}(_0xdc93,0x8a));var _0x3dc9=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0xdc93[_0x264545];return _0x114d10;};'use strict';var emlformat=require(_0x3dc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dc9('0x1'));var jsonpatch=require(_0x3dc9('0x2'));var rp=require(_0x3dc9('0x3'));var moment=require(_0x3dc9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3dc9('0x5'));var util=require(_0x3dc9('0x6'));var path=require(_0x3dc9('0x7'));var sox=require(_0x3dc9('0x8'));var csv=require('to-csv');var ejs=require(_0x3dc9('0x9'));var fs=require('fs');var fs_extra=require(_0x3dc9('0xa'));var _=require('lodash');var squel=require(_0x3dc9('0xb'));var crypto=require(_0x3dc9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3dc9('0xd'));var toCsv=require(_0x3dc9('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3dc9('0xf'));var authService=require(_0x3dc9('0x10'));var qs=require(_0x3dc9('0x11'));var as=require(_0x3dc9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dc9('0x13'))(_0x3dc9('0x14'));var utils=require(_0x3dc9('0x15'));var config=require(_0x3dc9('0x16'));var licenseUtil=require(_0x3dc9('0x17'));var db=require(_0x3dc9('0x18'))['db'];config[_0x3dc9('0x19')]=_['defaults'](config['redis'],{'host':_0x3dc9('0x1a'),'port':0x18eb});var socket=require(_0x3dc9('0x1b'))(new Redis(config[_0x3dc9('0x19')]));require(_0x3dc9('0x1c'))[_0x3dc9('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3dc9('0x1e')]({'port':0x232c});var client9002=jayson[_0x3dc9('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5af7e5,_0x1cd9a8,_0x5c2bee,_0x4cb985){return new BPromise(function(_0x14d6c3,_0x179055){var _0x42fe4a=_0x4cb985||client;return _0x42fe4a['request'](_0x5af7e5,_0x5c2bee)[_0x3dc9('0x20')](function(_0x39329c){logger[_0x3dc9('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x1cd9a8,_0x3dc9('0x22'));logger['debug'](_0x3dc9('0x23'),_0x1cd9a8,_0x3dc9('0x22'),JSON[_0x3dc9('0x24')](_0x39329c));if(_0x39329c[_0x3dc9('0x25')]){if(_0x39329c['error'][_0x3dc9('0x26')]===0x1f4){logger[_0x3dc9('0x25')](_0x3dc9('0x27'),_0x1cd9a8,_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);return _0x179055(_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);}logger['error'](_0x3dc9('0x27'),_0x1cd9a8,_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);return _0x14d6c3(_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);}else{logger[_0x3dc9('0x21')](_0x3dc9('0x27'),_0x1cd9a8,_0x3dc9('0x22'));_0x14d6c3(_0x39329c['result']['message']);}})[_0x3dc9('0x29')](function(_0x553c0b){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1cd9a8,_0x553c0b);_0x179055(_0x553c0b);});});}function respondWithStatusCode(_0x7578bb,_0x3ea43b){_0x3ea43b=_0x3ea43b||0xcc;return function(_0x172ae9){if(_0x172ae9){return _0x7578bb[_0x3dc9('0x2a')](_0x3ea43b);}return _0x7578bb[_0x3dc9('0x2b')](_0x3ea43b)['end']();};}function respondWithResult(_0x5b513e,_0x17dd33){_0x17dd33=_0x17dd33||0xc8;return function(_0x35c06a){if(_0x35c06a){return _0x5b513e[_0x3dc9('0x2b')](_0x17dd33)[_0x3dc9('0x2c')](_0x35c06a);}};}function respondWithFilteredResult(_0xff997c,_0x5c0e74){return function(_0x59225b){if(_0x59225b){var _0x2c26ce=typeof _0x5c0e74[_0x3dc9('0x2d')]===_0x3dc9('0x2e')&&typeof _0x5c0e74[_0x3dc9('0x2f')]==='undefined';var _0x513322=_0x59225b['count'];var _0x396a21=_0x2c26ce?0x0:_0x5c0e74[_0x3dc9('0x2d')];var _0x26449c=_0x2c26ce?_0x59225b[_0x3dc9('0x30')]:_0x5c0e74['offset']+_0x5c0e74[_0x3dc9('0x2f')];var _0x1cbade;if(_0x26449c>=_0x513322){_0x26449c=_0x513322;_0x1cbade=0xc8;}else{_0x1cbade=0xce;}_0xff997c['status'](_0x1cbade);return _0xff997c['set'](_0x3dc9('0x31'),_0x396a21+'-'+_0x26449c+'/'+_0x513322)['json'](_0x59225b);}return null;};}function patchUpdates(_0x544b52){return function(_0x5bd6e2){try{jsonpatch['apply'](_0x5bd6e2,_0x544b52,!![]);}catch(_0x4911ca){return BPromise[_0x3dc9('0x32')](_0x4911ca);}return _0x5bd6e2[_0x3dc9('0x33')]();};}function saveUpdates(_0x2435fa,_0x3fdd90){return function(_0xe8114){if(_0xe8114){return _0xe8114[_0x3dc9('0x34')](_0x2435fa)[_0x3dc9('0x20')](function(_0x4e2dfe){return _0x4e2dfe;});}return null;};}function removeEntity(_0x482096,_0x1fbad3){return function(_0x1d9fa7){if(_0x1d9fa7){return _0x1d9fa7[_0x3dc9('0x35')]()[_0x3dc9('0x20')](function(){_0x482096[_0x3dc9('0x2b')](0xcc)[_0x3dc9('0x36')]();});}};}function handleEntityNotFound(_0x5aec12,_0x4fd866){return function(_0x235397){if(!_0x235397){_0x5aec12[_0x3dc9('0x2a')](0x194);}return _0x235397;};}function handleError(_0x2a6a5a,_0x234571){_0x234571=_0x234571||0x1f4;return function(_0x1ad2f9){logger[_0x3dc9('0x25')](_0x1ad2f9[_0x3dc9('0x37')]);if(_0x1ad2f9[_0x3dc9('0x38')]){delete _0x1ad2f9[_0x3dc9('0x38')];}_0x2a6a5a[_0x3dc9('0x2b')](_0x234571)[_0x3dc9('0x39')](_0x1ad2f9);};}exports[_0x3dc9('0x3a')]=function(_0x5a0326,_0x14216a){var _0x5b24a4={},_0x237e34={},_0x50e305={'count':0x0,'rows':[]};var _0x45de9a=_[_0x3dc9('0x3b')](db[_0x3dc9('0x3c')][_0x3dc9('0x3d')],function(_0x4a898d){return{'name':_0x4a898d[_0x3dc9('0x3e')],'type':_0x4a898d[_0x3dc9('0x3f')][_0x3dc9('0x40')]};});_0x237e34[_0x3dc9('0x41')]=_[_0x3dc9('0x3b')](_0x45de9a,_0x3dc9('0x38'));_0x237e34[_0x3dc9('0x42')]=_[_0x3dc9('0x43')](_0x5a0326['query']);_0x237e34['filters']=_['intersection'](_0x237e34[_0x3dc9('0x41')],_0x237e34[_0x3dc9('0x42')]);_0x5b24a4[_0x3dc9('0x44')]=_[_0x3dc9('0x45')](_0x237e34[_0x3dc9('0x41')],qs[_0x3dc9('0x46')](_0x5a0326['query']['fields']));_0x5b24a4[_0x3dc9('0x44')]=_0x5b24a4[_0x3dc9('0x44')][_0x3dc9('0x47')]?_0x5b24a4['attributes']:_0x237e34[_0x3dc9('0x41')];if(!_0x5a0326['query'][_0x3dc9('0x48')](_0x3dc9('0x49'))){_0x5b24a4[_0x3dc9('0x2f')]=qs[_0x3dc9('0x2f')](_0x5a0326[_0x3dc9('0x42')]['limit']);_0x5b24a4['offset']=qs[_0x3dc9('0x2d')](_0x5a0326[_0x3dc9('0x42')][_0x3dc9('0x2d')]);}_0x5b24a4[_0x3dc9('0x4a')]=qs[_0x3dc9('0x4b')](_0x5a0326[_0x3dc9('0x42')]['sort']);_0x5b24a4['where']=qs[_0x3dc9('0x4c')](_['pick'](_0x5a0326[_0x3dc9('0x42')],_0x237e34[_0x3dc9('0x4c')]),_0x45de9a);if(_0x5a0326[_0x3dc9('0x42')][_0x3dc9('0x4d')]){_0x5b24a4['where']=_[_0x3dc9('0x4e')](_0x5b24a4['where'],{'$or':_[_0x3dc9('0x3b')](_0x45de9a,function(_0x33bfa4){if(_0x33bfa4['type']!==_0x3dc9('0x4f')){var _0x2076ea={};_0x2076ea[_0x33bfa4[_0x3dc9('0x38')]]={'$like':'%'+_0x5a0326['query'][_0x3dc9('0x4d')]+'%'};return _0x2076ea;}})});}_0x5b24a4=_[_0x3dc9('0x4e')]({},_0x5b24a4,_0x5a0326['options']);var _0x188a2={'where':_0x5b24a4[_0x3dc9('0x50')]};return db[_0x3dc9('0x3c')][_0x3dc9('0x30')](_0x188a2)[_0x3dc9('0x20')](function(_0x5a0a6e){_0x50e305['count']=_0x5a0a6e;if(_0x5a0326['query'][_0x3dc9('0x51')]){_0x5b24a4[_0x3dc9('0x52')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x3dc9('0x53')](_0x5b24a4);})[_0x3dc9('0x20')](function(_0x451f88){_0x50e305[_0x3dc9('0x54')]=_0x451f88;return _0x50e305;})[_0x3dc9('0x20')](respondWithFilteredResult(_0x14216a,_0x5b24a4))[_0x3dc9('0x29')](handleError(_0x14216a,null));};exports['show']=function(_0x37d476,_0x12e1d3){var _0x3a4b6a={'raw':!![],'where':{'id':_0x37d476[_0x3dc9('0x55')]['id']}},_0x1b6513={};_0x1b6513[_0x3dc9('0x41')]=_[_0x3dc9('0x43')](db['WhatsappMessage']['rawAttributes']);_0x1b6513[_0x3dc9('0x42')]=_[_0x3dc9('0x43')](_0x37d476[_0x3dc9('0x42')]);_0x1b6513['filters']=_[_0x3dc9('0x45')](_0x1b6513[_0x3dc9('0x41')],_0x1b6513[_0x3dc9('0x42')]);_0x3a4b6a[_0x3dc9('0x44')]=_[_0x3dc9('0x45')](_0x1b6513['model'],qs[_0x3dc9('0x46')](_0x37d476[_0x3dc9('0x42')][_0x3dc9('0x46')]));_0x3a4b6a[_0x3dc9('0x44')]=_0x3a4b6a['attributes'][_0x3dc9('0x47')]?_0x3a4b6a['attributes']:_0x1b6513['model'];if(_0x37d476[_0x3dc9('0x42')][_0x3dc9('0x51')]){_0x3a4b6a[_0x3dc9('0x52')]=[{'all':!![]}];}_0x3a4b6a=_[_0x3dc9('0x4e')]({},_0x3a4b6a,_0x37d476[_0x3dc9('0x56')]);return db['WhatsappMessage']['find'](_0x3a4b6a)[_0x3dc9('0x20')](handleEntityNotFound(_0x12e1d3,null))[_0x3dc9('0x20')](respondWithResult(_0x12e1d3,null))[_0x3dc9('0x29')](handleError(_0x12e1d3,null));};exports['create']=function(_0x5b933,_0x5db833){return db[_0x3dc9('0x3c')][_0x3dc9('0x57')](_0x5b933[_0x3dc9('0x58')],{})['then'](respondWithResult(_0x5db833,0xc9))[_0x3dc9('0x29')](handleError(_0x5db833,null));};exports[_0x3dc9('0x34')]=function(_0x16e041,_0x5ed04c){if(_0x16e041[_0x3dc9('0x58')]['id']){delete _0x16e041[_0x3dc9('0x58')]['id'];}return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x16e041[_0x3dc9('0x55')]['id']}})[_0x3dc9('0x20')](handleEntityNotFound(_0x5ed04c,null))['then'](saveUpdates(_0x16e041[_0x3dc9('0x58')],null))[_0x3dc9('0x20')](respondWithResult(_0x5ed04c,null))[_0x3dc9('0x29')](handleError(_0x5ed04c,null));};exports[_0x3dc9('0x35')]=function(_0x1f371d,_0x5d93b1){return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x1f371d['params']['id']}})[_0x3dc9('0x20')](handleEntityNotFound(_0x5d93b1,null))['then'](removeEntity(_0x5d93b1,null))[_0x3dc9('0x29')](handleError(_0x5d93b1,null));};exports[_0x3dc9('0x5a')]=function(_0x481dc1,_0x36e41e){return db[_0x3dc9('0x3c')]['describe']()[_0x3dc9('0x20')](respondWithResult(_0x36e41e,null))['catch'](handleError(_0x36e41e,null));};var interaction_log=require(_0x3dc9('0x13'))(_0x3dc9('0x5b'));exports['accept']=function(_0x248e12,_0x5bf013,_0x2e7cfb){var _0x5812d1={'agent':{},'channel':_0x3dc9('0x5c')};if(_0x248e12['body']['id']){delete _0x248e12[_0x3dc9('0x58')]['id'];}_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x5d')]=!![];_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x5e')]=moment()[_0x3dc9('0x5f')](_0x3dc9('0x60'));_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')]=_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')]||_0x248e12[_0x3dc9('0x62')]['id'];_0x5812d1[_0x3dc9('0x63')]['id']=_0x248e12[_0x3dc9('0x58')]['UserId'];return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x248e12['params']['id'],'UserId':null}})[_0x3dc9('0x20')](handleEntityNotFound(_0x5bf013,null))[_0x3dc9('0x20')](saveUpdates(_0x248e12[_0x3dc9('0x58')],null))[_0x3dc9('0x20')](function(_0x614c1e){if(_0x614c1e){_0x5812d1[_0x3dc9('0x28')]=_0x614c1e[_0x3dc9('0x64')]({'plain':!![]});return db[_0x3dc9('0x65')][_0x3dc9('0x59')]({'where':{'id':_0x614c1e[_0x3dc9('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5bf013,null))['then'](function(_0x5a2120){if(_0x5a2120){return _0x5a2120[_0x3dc9('0x34')]({'UserId':_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')],'read1stAt':_[_0x3dc9('0x67')](_0x5a2120[_0x3dc9('0x68')])?moment()[_0x3dc9('0x5f')](_0x3dc9('0x60')):undefined});}return null;})[_0x3dc9('0x20')](function(_0x4b80ad){if(_0x4b80ad){_0x5812d1[_0x3dc9('0x69')]=_0x4b80ad[_0x3dc9('0x64')]({'plain':!![]});interaction_log['info'](_0x3dc9('0x6a'),_0x248e12['user']['id'],_0x248e12[_0x3dc9('0x62')][_0x3dc9('0x38')],_0x248e12[_0x3dc9('0x62')]['role'],_0x5812d1['interaction']['id'],_0x248e12[_0x3dc9('0x58')]?JSON['stringify'](_0x248e12[_0x3dc9('0x58')]):_0x3dc9('0x6b'));return respondWithRpcPromise(_0x3dc9('0x6c'),_0x3dc9('0x6d'),_0x5812d1);}return null;})[_0x3dc9('0x20')](function(_0x6a7817){var _0x18f5b1=_0x3dc9('0x6e')+_0x6a7817[_0x3dc9('0x28')][_0x3dc9('0x6f')];return db['sequelize'][_0x3dc9('0x42')](_0x18f5b1,{'type':db[_0x3dc9('0x70')]['QueryTypes'][_0x3dc9('0x71')],'raw':!![]})[_0x3dc9('0x20')](function(_0x1fcf2c){return _0x1fcf2c;});})[_0x3dc9('0x20')](function(_0x54ee94){if(_0x54ee94){_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x72')]=_0x54ee94[0x0];if(!_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')])return;return db[_0x3dc9('0x73')][_0x3dc9('0x59')]({'where':{'id':_0x248e12['body'][_0x3dc9('0x61')],'role':_0x3dc9('0x63')},'attributes':['id',_0x3dc9('0x38'),_0x3dc9('0x74'),_0x3dc9('0x75'),_0x3dc9('0x76')],'raw':!![]});}return null;})[_0x3dc9('0x20')](function(_0x52e544){if(!_0x52e544)return null;_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x63')]=_0x52e544;return _0x5812d1;})[_0x3dc9('0x20')](function(_0x51c7f2){if(_0x51c7f2){if(_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x77')]){_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x78')]=util[_0x3dc9('0x5f')](_0x3dc9('0x79'),_0x248e12[_0x3dc9('0x62')][_0x3dc9('0x38')]);_0x5812d1[_0x3dc9('0x28')]['channel']=_0x5812d1['channel'];_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x7a')]=_0x5812d1[_0x3dc9('0x7b')];_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x7c')]=_0x3dc9('0x7d');return respondWithRpcPromise(_0x3dc9('0x7e'),_0x3dc9('0x7e'),{'event':_0x3dc9('0x7f'),'message':_0x5812d1[_0x3dc9('0x28')]},client9002)[_0x3dc9('0x20')](function(){return _0x5812d1;});}return _0x5812d1;}return null;})['then'](respondWithResult(_0x5bf013,null))['catch'](handleError(_0x5bf013,null));};var interaction_log=require(_0x3dc9('0x13'))(_0x3dc9('0x5b'));exports[_0x3dc9('0x32')]=function(_0x6fab32,_0x4e6253,_0x170827){var _0x3fb26a={'agent':{},'channel':_0x3dc9('0x5c')};if(_0x6fab32[_0x3dc9('0x58')]['id']){delete _0x6fab32[_0x3dc9('0x58')]['id'];}_0x6fab32[_0x3dc9('0x58')]['UserId']=_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')]||_0x6fab32['user']['id'];_0x3fb26a[_0x3dc9('0x63')]['id']=_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')];return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x6fab32[_0x3dc9('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e6253,null))['then'](function(_0xb8ba67){if(_0xb8ba67){_0x3fb26a[_0x3dc9('0x28')]=_0xb8ba67[_0x3dc9('0x64')]({'plain':!![]});return db[_0x3dc9('0x65')]['find']({'where':{'id':_0xb8ba67['WhatsappInteractionId']}});}return null;})[_0x3dc9('0x20')](handleEntityNotFound(_0x4e6253,null))[_0x3dc9('0x20')](function(_0xc44d2c){if(_0xc44d2c){_0x3fb26a[_0x3dc9('0x69')]=_0xc44d2c['get']({'plain':!![]});interaction_log[_0x3dc9('0x21')](_0x3dc9('0x80'),_0x6fab32['user']['id'],_0x6fab32[_0x3dc9('0x62')][_0x3dc9('0x38')],_0x6fab32[_0x3dc9('0x62')][_0x3dc9('0x81')],_0x3fb26a[_0x3dc9('0x69')]['id'],_0x6fab32[_0x3dc9('0x58')]?JSON[_0x3dc9('0x24')](_0x6fab32[_0x3dc9('0x58')]):'null');return respondWithRpcPromise(_0x3dc9('0x82'),_0x3dc9('0x83'),_0x3fb26a);}return null;})[_0x3dc9('0x20')](function(_0x34e62c){var _0x26f36f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34e62c[_0x3dc9('0x28')][_0x3dc9('0x6f')];return db[_0x3dc9('0x84')][_0x3dc9('0x42')](_0x26f36f,{'type':db[_0x3dc9('0x70')][_0x3dc9('0x85')][_0x3dc9('0x71')],'raw':!![]})[_0x3dc9('0x20')](function(_0x1478d2){return _0x1478d2;});})[_0x3dc9('0x20')](function(_0x5ae88b){if(_0x5ae88b){_0x3fb26a[_0x3dc9('0x28')]['contact']=_0x5ae88b[0x0];if(!_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')])return;return db[_0x3dc9('0x73')]['find']({'where':{'id':_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')],'role':_0x3dc9('0x63')},'attributes':['id',_0x3dc9('0x38'),'fullname',_0x3dc9('0x75'),_0x3dc9('0x76')],'raw':!![]});}return null;})[_0x3dc9('0x20')](function(_0x1719e0){if(!_0x1719e0)return null;_0x3fb26a['message'][_0x3dc9('0x63')]=_0x1719e0;return _0x3fb26a;})[_0x3dc9('0x20')](function(_0x38c84e){if(_0x38c84e){_0x38c84e[_0x3dc9('0x28')][_0x3dc9('0x78')]=util[_0x3dc9('0x5f')](_0x3dc9('0x79'),_0x6fab32[_0x3dc9('0x62')][_0x3dc9('0x38')]);_0x38c84e[_0x3dc9('0x28')][_0x3dc9('0x7b')]=_0x3fb26a['channel'];_0x38c84e[_0x3dc9('0x28')]['motionChannel']=_0x3fb26a[_0x3dc9('0x7b')];_0x38c84e[_0x3dc9('0x28')][_0x3dc9('0x7c')]=_0x3dc9('0x32');respondWithRpcPromise(_0x3dc9('0x7e'),_0x3dc9('0x7e'),{'event':_0x3dc9('0x86'),'message':_0x38c84e[_0x3dc9('0x28')]},client9002);return _0x3fb26a;}return null;})[_0x3dc9('0x20')](respondWithResult(_0x4e6253,null))[_0x3dc9('0x29')](handleError(_0x4e6253,null));};exports[_0x3dc9('0x2b')]=function(_0x4885bc,_0x4ee047,_0x30b31c){if(_0x4885bc[_0x3dc9('0x58')]['id']){delete _0x4885bc['body']['id'];}var _0x33cbab;return db['WhatsappMessage'][_0x3dc9('0x59')]({'where':{'id':_0x4885bc['params']['id']}})['then'](handleEntityNotFound(_0x4ee047,null))[_0x3dc9('0x20')](function(_0x25e59f){if(_0x25e59f){_0x33cbab=_0x25e59f;return db[_0x3dc9('0x87')]['find']({'where':{'id':_0x25e59f[_0x3dc9('0x88')]}});}})[_0x3dc9('0x20')](handleEntityNotFound(_0x4ee047,null))[_0x3dc9('0x20')](function(_0x2710d1){if(_0x2710d1){logger['debug'](_0x3dc9('0x89'),_0x3dc9('0x2b'),'received\x20delivery\x20report\x20from',_0x2710d1[_0x3dc9('0x3f')],util[_0x3dc9('0x8a')](_0x4885bc[_0x3dc9('0x58')],{'showHidden':![],'depth':null}));switch(_0x2710d1['type']){case'twilio':if(_0x4885bc[_0x3dc9('0x58')][_0x3dc9('0x8b')]&&_0x4885bc[_0x3dc9('0x58')]['MessageSid']===_0x33cbab[_0x3dc9('0x8c')]&&_0x4885bc['body']['MessageStatus']&&_0x4885bc[_0x3dc9('0x58')][_0x3dc9('0x8d')]==='read'){return _0x33cbab['update']({'read':!![]});}else{logger[_0x3dc9('0x25')](_0x3dc9('0x8e'),_0x3dc9('0x2b'),_0x3dc9('0x8f'),util[_0x3dc9('0x8a')](_0x4885bc['body'],{'showHidden':![],'depth':null}));}break;}return _0x33cbab;}})['then'](respondWithResult(_0x4ee047,null))['catch'](handleError(_0x4ee047,null));}; \ No newline at end of file +var _0xbf5b=['name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','motionChannel','channel','event','accept','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','ContactId','QueryTypes','internal','SIP/%s','rejectmessage','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','stack'];(function(_0x3f25d9,_0x424937){var _0x311e21=function(_0x2ff3d9){while(--_0x2ff3d9){_0x3f25d9['push'](_0x3f25d9['shift']());}};_0x311e21(++_0x424937);}(_0xbf5b,0xeb));var _0xbbf5=function(_0x507c6e,_0x5b7703){_0x507c6e=_0x507c6e-0x0;var _0x236242=_0xbf5b[_0x507c6e];return _0x236242;};'use strict';var emlformat=require(_0xbbf5('0x0'));var rimraf=require(_0xbbf5('0x1'));var zipdir=require(_0xbbf5('0x2'));var jsonpatch=require(_0xbbf5('0x3'));var rp=require(_0xbbf5('0x4'));var moment=require(_0xbbf5('0x5'));var BPromise=require(_0xbbf5('0x6'));var Mustache=require(_0xbbf5('0x7'));var util=require('util');var path=require(_0xbbf5('0x8'));var sox=require('sox');var csv=require(_0xbbf5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbbf5('0xa'));var _=require('lodash');var squel=require(_0xbbf5('0xb'));var crypto=require(_0xbbf5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbbf5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbbf5('0xe'));var Papa=require(_0xbbf5('0xf'));var Redis=require(_0xbbf5('0x10'));var authService=require(_0xbbf5('0x11'));var qs=require(_0xbbf5('0x12'));var as=require(_0xbbf5('0x13'));var hardwareService=require(_0xbbf5('0x14'));var logger=require(_0xbbf5('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbbf5('0x16'));var licenseUtil=require(_0xbbf5('0x17'));var db=require(_0xbbf5('0x18'))['db'];config[_0xbbf5('0x19')]=_[_0xbbf5('0x1a')](config[_0xbbf5('0x19')],{'host':_0xbbf5('0x1b'),'port':0x18eb});var socket=require(_0xbbf5('0x1c'))(new Redis(config['redis']));require(_0xbbf5('0x1d'))[_0xbbf5('0x1e')](socket);var jayson=require(_0xbbf5('0x1f'));var client=jayson[_0xbbf5('0x20')][_0xbbf5('0x21')]({'port':0x232c});var client9002=jayson[_0xbbf5('0x20')][_0xbbf5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5a56b3,_0x1502d9,_0x2b6ed4,_0x1b553d){return new BPromise(function(_0x3de047,_0x2a40b9){var _0x15f779=_0x1b553d||client;return _0x15f779[_0xbbf5('0x22')](_0x5a56b3,_0x2b6ed4)[_0xbbf5('0x23')](function(_0x1de06e){logger[_0xbbf5('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x1502d9,_0xbbf5('0x25'));logger[_0xbbf5('0x26')](_0xbbf5('0x27'),_0x1502d9,_0xbbf5('0x25'),JSON['stringify'](_0x1de06e));if(_0x1de06e[_0xbbf5('0x28')]){if(_0x1de06e['error'][_0xbbf5('0x29')]===0x1f4){logger[_0xbbf5('0x28')](_0xbbf5('0x2a'),_0x1502d9,_0x1de06e['error'][_0xbbf5('0x2b')]);return _0x2a40b9(_0x1de06e[_0xbbf5('0x28')][_0xbbf5('0x2b')]);}logger[_0xbbf5('0x28')](_0xbbf5('0x2a'),_0x1502d9,_0x1de06e[_0xbbf5('0x28')][_0xbbf5('0x2b')]);return _0x3de047(_0x1de06e[_0xbbf5('0x28')][_0xbbf5('0x2b')]);}else{logger[_0xbbf5('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x1502d9,_0xbbf5('0x25'));_0x3de047(_0x1de06e[_0xbbf5('0x2c')][_0xbbf5('0x2b')]);}})['catch'](function(_0x11f291){logger[_0xbbf5('0x28')](_0xbbf5('0x2a'),_0x1502d9,_0x11f291);_0x2a40b9(_0x11f291);});});}function respondWithStatusCode(_0x461499,_0x23fda8){_0x23fda8=_0x23fda8||0xcc;return function(_0x58b7a9){if(_0x58b7a9){return _0x461499[_0xbbf5('0x2d')](_0x23fda8);}return _0x461499[_0xbbf5('0x2e')](_0x23fda8)[_0xbbf5('0x2f')]();};}function respondWithResult(_0x1f6471,_0x43de0f){_0x43de0f=_0x43de0f||0xc8;return function(_0x25800a){if(_0x25800a){return _0x1f6471[_0xbbf5('0x2e')](_0x43de0f)[_0xbbf5('0x30')](_0x25800a);}};}function respondWithFilteredResult(_0x244b2d,_0x2074ee){return function(_0x3d5eaf){if(_0x3d5eaf){var _0x156a8e=typeof _0x2074ee[_0xbbf5('0x31')]===_0xbbf5('0x32')&&typeof _0x2074ee[_0xbbf5('0x33')]==='undefined';var _0x1b721f=_0x3d5eaf['count'];var _0x28751e=_0x156a8e?0x0:_0x2074ee[_0xbbf5('0x31')];var _0x31dab2=_0x156a8e?_0x3d5eaf[_0xbbf5('0x34')]:_0x2074ee[_0xbbf5('0x31')]+_0x2074ee['limit'];var _0x4d1325;if(_0x31dab2>=_0x1b721f){_0x31dab2=_0x1b721f;_0x4d1325=0xc8;}else{_0x4d1325=0xce;}_0x244b2d[_0xbbf5('0x2e')](_0x4d1325);return _0x244b2d['set'](_0xbbf5('0x35'),_0x28751e+'-'+_0x31dab2+'/'+_0x1b721f)[_0xbbf5('0x30')](_0x3d5eaf);}return null;};}function patchUpdates(_0x4bac66){return function(_0x3f1709){try{jsonpatch['apply'](_0x3f1709,_0x4bac66,!![]);}catch(_0x204950){return BPromise[_0xbbf5('0x36')](_0x204950);}return _0x3f1709['save']();};}function saveUpdates(_0x2b31a4,_0x410e13){return function(_0xbef36){if(_0xbef36){return _0xbef36[_0xbbf5('0x37')](_0x2b31a4)['then'](function(_0x5e269a){return _0x5e269a;});}return null;};}function removeEntity(_0x2273d8,_0x43c69e){return function(_0x47a519){if(_0x47a519){return _0x47a519['destroy']()['then'](function(){_0x2273d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x87f38a,_0x2e0e75){return function(_0xccc6a6){if(!_0xccc6a6){_0x87f38a[_0xbbf5('0x2d')](0x194);}return _0xccc6a6;};}function handleError(_0x1725f4,_0x128072){_0x128072=_0x128072||0x1f4;return function(_0x218811){logger['error'](_0x218811[_0xbbf5('0x38')]);if(_0x218811[_0xbbf5('0x39')]){delete _0x218811[_0xbbf5('0x39')];}_0x1725f4[_0xbbf5('0x2e')](_0x128072)[_0xbbf5('0x3a')](_0x218811);};}exports[_0xbbf5('0x3b')]=function(_0x4e4643,_0x4ccc3d){var _0x15db04={},_0x3ebcf3={},_0x25c435={'count':0x0,'rows':[]};var _0x4db800=_[_0xbbf5('0x3c')](db[_0xbbf5('0x3d')][_0xbbf5('0x3e')],function(_0x3afc36){return{'name':_0x3afc36[_0xbbf5('0x3f')],'type':_0x3afc36[_0xbbf5('0x40')]['key']};});_0x3ebcf3['model']=_[_0xbbf5('0x3c')](_0x4db800,_0xbbf5('0x39'));_0x3ebcf3['query']=_['keys'](_0x4e4643[_0xbbf5('0x41')]);_0x3ebcf3[_0xbbf5('0x42')]=_['intersection'](_0x3ebcf3[_0xbbf5('0x43')],_0x3ebcf3[_0xbbf5('0x41')]);_0x15db04[_0xbbf5('0x44')]=_[_0xbbf5('0x45')](_0x3ebcf3[_0xbbf5('0x43')],qs[_0xbbf5('0x46')](_0x4e4643[_0xbbf5('0x41')]['fields']));_0x15db04[_0xbbf5('0x44')]=_0x15db04['attributes']['length']?_0x15db04[_0xbbf5('0x44')]:_0x3ebcf3['model'];if(!_0x4e4643[_0xbbf5('0x41')][_0xbbf5('0x47')](_0xbbf5('0x48'))){_0x15db04[_0xbbf5('0x33')]=qs['limit'](_0x4e4643[_0xbbf5('0x41')][_0xbbf5('0x33')]);_0x15db04[_0xbbf5('0x31')]=qs[_0xbbf5('0x31')](_0x4e4643[_0xbbf5('0x41')]['offset']);}_0x15db04[_0xbbf5('0x49')]=qs['sort'](_0x4e4643[_0xbbf5('0x41')][_0xbbf5('0x4a')]);_0x15db04[_0xbbf5('0x4b')]=qs[_0xbbf5('0x42')](_[_0xbbf5('0x4c')](_0x4e4643['query'],_0x3ebcf3[_0xbbf5('0x42')]),_0x4db800);if(_0x4e4643[_0xbbf5('0x41')]['filter']){_0x15db04['where']=_[_0xbbf5('0x4d')](_0x15db04[_0xbbf5('0x4b')],{'$or':_[_0xbbf5('0x3c')](_0x4db800,function(_0x2c70e0){if(_0x2c70e0['type']!==_0xbbf5('0x4e')){var _0x259a2b={};_0x259a2b[_0x2c70e0['name']]={'$like':'%'+_0x4e4643[_0xbbf5('0x41')][_0xbbf5('0x4f')]+'%'};return _0x259a2b;}})});}_0x15db04=_[_0xbbf5('0x4d')]({},_0x15db04,_0x4e4643[_0xbbf5('0x50')]);var _0xc3b5c8={'where':_0x15db04[_0xbbf5('0x4b')]};return db[_0xbbf5('0x3d')][_0xbbf5('0x34')](_0xc3b5c8)[_0xbbf5('0x23')](function(_0x10b14b){_0x25c435[_0xbbf5('0x34')]=_0x10b14b;if(_0x4e4643['query'][_0xbbf5('0x51')]){_0x15db04[_0xbbf5('0x52')]=[{'all':!![]}];}return db[_0xbbf5('0x3d')][_0xbbf5('0x53')](_0x15db04);})['then'](function(_0x49fe41){_0x25c435[_0xbbf5('0x54')]=_0x49fe41;return _0x25c435;})[_0xbbf5('0x23')](respondWithFilteredResult(_0x4ccc3d,_0x15db04))[_0xbbf5('0x55')](handleError(_0x4ccc3d,null));};exports[_0xbbf5('0x56')]=function(_0x274f6d,_0x161e18){var _0x4572df={'raw':!![],'where':{'id':_0x274f6d[_0xbbf5('0x57')]['id']}},_0x5d89c5={};_0x5d89c5['model']=_[_0xbbf5('0x58')](db[_0xbbf5('0x3d')][_0xbbf5('0x3e')]);_0x5d89c5[_0xbbf5('0x41')]=_[_0xbbf5('0x58')](_0x274f6d[_0xbbf5('0x41')]);_0x5d89c5[_0xbbf5('0x42')]=_['intersection'](_0x5d89c5['model'],_0x5d89c5[_0xbbf5('0x41')]);_0x4572df[_0xbbf5('0x44')]=_[_0xbbf5('0x45')](_0x5d89c5[_0xbbf5('0x43')],qs['fields'](_0x274f6d['query'][_0xbbf5('0x46')]));_0x4572df[_0xbbf5('0x44')]=_0x4572df[_0xbbf5('0x44')][_0xbbf5('0x59')]?_0x4572df['attributes']:_0x5d89c5[_0xbbf5('0x43')];if(_0x274f6d[_0xbbf5('0x41')][_0xbbf5('0x51')]){_0x4572df[_0xbbf5('0x52')]=[{'all':!![]}];}_0x4572df=_['merge']({},_0x4572df,_0x274f6d['options']);return db['WhatsappMessage'][_0xbbf5('0x5a')](_0x4572df)['then'](handleEntityNotFound(_0x161e18,null))[_0xbbf5('0x23')](respondWithResult(_0x161e18,null))[_0xbbf5('0x55')](handleError(_0x161e18,null));};exports['create']=function(_0x2554e5,_0x1d1633){return db[_0xbbf5('0x3d')][_0xbbf5('0x5b')](_0x2554e5[_0xbbf5('0x5c')],{})[_0xbbf5('0x23')](respondWithResult(_0x1d1633,0xc9))[_0xbbf5('0x55')](handleError(_0x1d1633,null));};exports[_0xbbf5('0x37')]=function(_0x3ada0e,_0x4b8830){if(_0x3ada0e['body']['id']){delete _0x3ada0e[_0xbbf5('0x5c')]['id'];}return db['WhatsappMessage'][_0xbbf5('0x5a')]({'where':{'id':_0x3ada0e[_0xbbf5('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b8830,null))[_0xbbf5('0x23')](saveUpdates(_0x3ada0e['body'],null))[_0xbbf5('0x23')](respondWithResult(_0x4b8830,null))['catch'](handleError(_0x4b8830,null));};exports['destroy']=function(_0x3a3aa6,_0x32d9c0){return db[_0xbbf5('0x3d')][_0xbbf5('0x5a')]({'where':{'id':_0x3a3aa6['params']['id']}})['then'](handleEntityNotFound(_0x32d9c0,null))[_0xbbf5('0x23')](removeEntity(_0x32d9c0,null))[_0xbbf5('0x55')](handleError(_0x32d9c0,null));};exports[_0xbbf5('0x5d')]=function(_0x1971f0,_0x5a74f6){return db[_0xbbf5('0x3d')]['describe']()[_0xbbf5('0x23')](respondWithResult(_0x5a74f6,null))[_0xbbf5('0x55')](handleError(_0x5a74f6,null));};var interaction_log=require(_0xbbf5('0x15'))(_0xbbf5('0x5e'));exports['accept']=function(_0x2c0645,_0x35fe73,_0x5e8901){var _0xd69634={'agent':{},'channel':_0xbbf5('0x5f')};if(_0x2c0645[_0xbbf5('0x5c')]['id']){delete _0x2c0645[_0xbbf5('0x5c')]['id'];}_0x2c0645['body'][_0xbbf5('0x60')]=!![];_0x2c0645[_0xbbf5('0x5c')][_0xbbf5('0x61')]=moment()[_0xbbf5('0x62')](_0xbbf5('0x63'));_0x2c0645[_0xbbf5('0x5c')][_0xbbf5('0x64')]=_0x2c0645[_0xbbf5('0x5c')][_0xbbf5('0x64')]||_0x2c0645[_0xbbf5('0x65')]['id'];_0xd69634[_0xbbf5('0x66')]['id']=_0x2c0645[_0xbbf5('0x5c')][_0xbbf5('0x64')];return db[_0xbbf5('0x3d')]['find']({'where':{'id':_0x2c0645[_0xbbf5('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35fe73,null))[_0xbbf5('0x23')](saveUpdates(_0x2c0645[_0xbbf5('0x5c')],null))[_0xbbf5('0x23')](function(_0x3fc003){if(_0x3fc003){_0xd69634[_0xbbf5('0x2b')]=_0x3fc003[_0xbbf5('0x67')]({'plain':!![]});return db[_0xbbf5('0x68')][_0xbbf5('0x5a')]({'where':{'id':_0x3fc003['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x35fe73,null))[_0xbbf5('0x23')](function(_0x350001){if(_0x350001){return _0x350001[_0xbbf5('0x37')]({'UserId':_0x2c0645[_0xbbf5('0x5c')][_0xbbf5('0x64')],'read1stAt':_[_0xbbf5('0x69')](_0x350001[_0xbbf5('0x6a')])?moment()[_0xbbf5('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1a4e5a){if(_0x1a4e5a){_0xd69634[_0xbbf5('0x6b')]=_0x1a4e5a[_0xbbf5('0x67')]({'plain':!![]});interaction_log[_0xbbf5('0x24')](_0xbbf5('0x6c'),_0x2c0645[_0xbbf5('0x65')]['id'],_0x2c0645[_0xbbf5('0x65')][_0xbbf5('0x39')],_0x2c0645[_0xbbf5('0x65')][_0xbbf5('0x6d')],_0xd69634[_0xbbf5('0x6b')]['id'],_0x2c0645[_0xbbf5('0x5c')]?JSON['stringify'](_0x2c0645[_0xbbf5('0x5c')]):'null');return respondWithRpcPromise(_0xbbf5('0x6e'),_0xbbf5('0x6f'),_0xd69634);}return null;})['then'](function(_0x28b187){var _0xec4403=_0xbbf5('0x70')+_0x28b187[_0xbbf5('0x2b')]['ContactId'];return db[_0xbbf5('0x71')][_0xbbf5('0x41')](_0xec4403,{'type':db[_0xbbf5('0x72')]['QueryTypes'][_0xbbf5('0x73')],'raw':!![]})[_0xbbf5('0x23')](function(_0x11b172){return _0x11b172;});})[_0xbbf5('0x23')](function(_0x4b865b){if(_0x4b865b){_0xd69634[_0xbbf5('0x2b')][_0xbbf5('0x74')]=_0x4b865b[0x0];if(!_0x2c0645[_0xbbf5('0x5c')][_0xbbf5('0x64')])return;return db[_0xbbf5('0x75')][_0xbbf5('0x5a')]({'where':{'id':_0x2c0645[_0xbbf5('0x5c')]['UserId'],'role':_0xbbf5('0x66')},'attributes':['id',_0xbbf5('0x39'),'fullname',_0xbbf5('0x76'),'internal'],'raw':!![]});}return null;})[_0xbbf5('0x23')](function(_0x3e9acc){if(!_0x3e9acc)return null;_0xd69634[_0xbbf5('0x2b')][_0xbbf5('0x66')]=_0x3e9acc;return _0xd69634;})[_0xbbf5('0x23')](function(_0x7a98b5){if(_0x7a98b5){if(_0x2c0645[_0xbbf5('0x5c')][_0xbbf5('0x77')]){_0xd69634[_0xbbf5('0x2b')][_0xbbf5('0x78')]=util[_0xbbf5('0x62')]('SIP/%s',_0x2c0645[_0xbbf5('0x65')][_0xbbf5('0x39')]);_0xd69634[_0xbbf5('0x2b')]['channel']=_0xd69634['channel'];_0xd69634[_0xbbf5('0x2b')][_0xbbf5('0x79')]=_0xd69634[_0xbbf5('0x7a')];_0xd69634['message'][_0xbbf5('0x7b')]=_0xbbf5('0x7c');return respondWithRpcPromise(_0xbbf5('0x7d'),_0xbbf5('0x7d'),{'event':_0xbbf5('0x7e'),'message':_0xd69634[_0xbbf5('0x2b')]},client9002)[_0xbbf5('0x23')](function(){return _0xd69634;});}return _0xd69634;}return null;})[_0xbbf5('0x23')](respondWithResult(_0x35fe73,null))[_0xbbf5('0x55')](handleError(_0x35fe73,null));};var interaction_log=require('../../config/logger')(_0xbbf5('0x5e'));exports[_0xbbf5('0x36')]=function(_0x357e3d,_0x477774,_0x4944d2){var _0x45f8b6={'agent':{},'channel':'whatsapp'};if(_0x357e3d[_0xbbf5('0x5c')]['id']){delete _0x357e3d['body']['id'];}_0x357e3d[_0xbbf5('0x5c')]['UserId']=_0x357e3d['body'][_0xbbf5('0x64')]||_0x357e3d['user']['id'];_0x45f8b6[_0xbbf5('0x66')]['id']=_0x357e3d[_0xbbf5('0x5c')][_0xbbf5('0x64')];return db['WhatsappMessage']['find']({'where':{'id':_0x357e3d['params']['id'],'UserId':null}})[_0xbbf5('0x23')](handleEntityNotFound(_0x477774,null))[_0xbbf5('0x23')](function(_0x5344f2){if(_0x5344f2){_0x45f8b6[_0xbbf5('0x2b')]=_0x5344f2[_0xbbf5('0x67')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x5344f2[_0xbbf5('0x7f')]}});}return null;})[_0xbbf5('0x23')](handleEntityNotFound(_0x477774,null))[_0xbbf5('0x23')](function(_0x39c627){if(_0x39c627){_0x45f8b6[_0xbbf5('0x6b')]=_0x39c627[_0xbbf5('0x67')]({'plain':!![]});interaction_log['info'](_0xbbf5('0x80'),_0x357e3d[_0xbbf5('0x65')]['id'],_0x357e3d[_0xbbf5('0x65')][_0xbbf5('0x39')],_0x357e3d['user']['role'],_0x45f8b6[_0xbbf5('0x6b')]['id'],_0x357e3d[_0xbbf5('0x5c')]?JSON[_0xbbf5('0x81')](_0x357e3d[_0xbbf5('0x5c')]):_0xbbf5('0x82'));return respondWithRpcPromise(_0xbbf5('0x83'),_0xbbf5('0x84'),_0x45f8b6);}return null;})[_0xbbf5('0x23')](function(_0x5cfd63){var _0x409af6=_0xbbf5('0x70')+_0x5cfd63[_0xbbf5('0x2b')][_0xbbf5('0x85')];return db[_0xbbf5('0x71')][_0xbbf5('0x41')](_0x409af6,{'type':db['Sequelize'][_0xbbf5('0x86')][_0xbbf5('0x73')],'raw':!![]})[_0xbbf5('0x23')](function(_0x4ff93e){return _0x4ff93e;});})[_0xbbf5('0x23')](function(_0x57b30e){if(_0x57b30e){_0x45f8b6[_0xbbf5('0x2b')][_0xbbf5('0x74')]=_0x57b30e[0x0];if(!_0x357e3d[_0xbbf5('0x5c')]['UserId'])return;return db[_0xbbf5('0x75')][_0xbbf5('0x5a')]({'where':{'id':_0x357e3d[_0xbbf5('0x5c')]['UserId'],'role':_0xbbf5('0x66')},'attributes':['id',_0xbbf5('0x39'),'fullname','email',_0xbbf5('0x87')],'raw':!![]});}return null;})[_0xbbf5('0x23')](function(_0x51d7d6){if(!_0x51d7d6)return null;_0x45f8b6[_0xbbf5('0x2b')][_0xbbf5('0x66')]=_0x51d7d6;return _0x45f8b6;})[_0xbbf5('0x23')](function(_0x12ce39){if(_0x12ce39){_0x12ce39[_0xbbf5('0x2b')][_0xbbf5('0x78')]=util['format'](_0xbbf5('0x88'),_0x357e3d[_0xbbf5('0x65')]['name']);_0x12ce39['message'][_0xbbf5('0x7a')]=_0x45f8b6[_0xbbf5('0x7a')];_0x12ce39[_0xbbf5('0x2b')][_0xbbf5('0x79')]=_0x45f8b6['channel'];_0x12ce39['message'][_0xbbf5('0x7b')]=_0xbbf5('0x36');respondWithRpcPromise(_0xbbf5('0x7d'),_0xbbf5('0x7d'),{'event':_0xbbf5('0x89'),'message':_0x12ce39[_0xbbf5('0x2b')]},client9002);return _0x45f8b6;}return null;})[_0xbbf5('0x23')](respondWithResult(_0x477774,null))[_0xbbf5('0x55')](handleError(_0x477774,null));};exports['status']=function(_0x440c62,_0xc4e402,_0xcbcc6b){if(_0x440c62[_0xbbf5('0x5c')]['id']){delete _0x440c62['body']['id'];}var _0x26a925;return db['WhatsappMessage'][_0xbbf5('0x5a')]({'where':{'id':_0x440c62['params']['id']}})[_0xbbf5('0x23')](handleEntityNotFound(_0xc4e402,null))[_0xbbf5('0x23')](function(_0x45017b){if(_0x45017b){_0x26a925=_0x45017b;return db['WhatsappAccount'][_0xbbf5('0x5a')]({'where':{'id':_0x45017b[_0xbbf5('0x8a')]}});}})[_0xbbf5('0x23')](handleEntityNotFound(_0xc4e402,null))['then'](function(_0x1b371e){if(_0x1b371e){logger[_0xbbf5('0x26')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xbbf5('0x2e'),_0xbbf5('0x8b'),_0x1b371e[_0xbbf5('0x40')],util[_0xbbf5('0x8c')](_0x440c62[_0xbbf5('0x5c')],{'showHidden':![],'depth':null}));switch(_0x1b371e['type']){case _0xbbf5('0x8d'):if(_0x440c62[_0xbbf5('0x5c')][_0xbbf5('0x8e')]&&_0x440c62[_0xbbf5('0x5c')]['MessageSid']===_0x26a925[_0xbbf5('0x8f')]&&_0x440c62[_0xbbf5('0x5c')][_0xbbf5('0x90')]&&_0x440c62[_0xbbf5('0x5c')][_0xbbf5('0x90')]===_0xbbf5('0x60')){return _0x26a925[_0xbbf5('0x37')]({'read':!![]});}else{logger[_0xbbf5('0x28')](_0xbbf5('0x91'),_0xbbf5('0x2e'),_0xbbf5('0x8d'),util[_0xbbf5('0x8c')](_0x440c62['body'],{'showHidden':![],'depth':null}));}break;}return _0x26a925;}})['then'](respondWithResult(_0xc4e402,null))[_0xbbf5('0x55')](handleError(_0xc4e402,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 7cf4cae..bf6d784 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 _0xf290=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x1cfb1a,_0x1bb622){var _0x4c0d85=function(_0xe0ed83){while(--_0xe0ed83){_0x1cfb1a['push'](_0x1cfb1a['shift']());}};_0x4c0d85(++_0x1bb622);}(_0xf290,0xde));var _0x0f29=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xf290[_0xe39824];return _0x4bc31e;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x0f29('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0f29('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f29('0x2'),'afterDestroy':_0x0f29('0x3')};function emitEvent(_0x38f5b5){return function(_0x28b644,_0xfdab92,_0x5984ba){WhatsappMessageEvents[_0x0f29('0x4')](_0x38f5b5+':'+_0x28b644['id'],_0x28b644);WhatsappMessageEvents['emit'](_0x38f5b5,_0x28b644);_0x5984ba(null);};}for(var e in events){if(events[_0x0f29('0x5')](e)){var event=events[e];WhatsappMessage[_0x0f29('0x6')](e,emitEvent(event));}}module[_0x0f29('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x5eb1=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','WhatsappMessage'];(function(_0x3d0062,_0x4aa074){var _0x131d4c=function(_0x5c1091){while(--_0x5c1091){_0x3d0062['push'](_0x3d0062['shift']());}};_0x131d4c(++_0x4aa074);}(_0x5eb1,0x7c));var _0x15eb=function(_0x316efa,_0x20a1e1){_0x316efa=_0x316efa-0x0;var _0x4d96cc=_0x5eb1[_0x316efa];return _0x4d96cc;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x15eb('0x0'))['db'][_0x15eb('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x15eb('0x2')](0x0);var events={'afterCreate':_0x15eb('0x3'),'afterUpdate':_0x15eb('0x4'),'afterDestroy':_0x15eb('0x5')};function emitEvent(_0x5e1142){return function(_0x3ba774,_0x19d816,_0x1f38c6){WhatsappMessageEvents[_0x15eb('0x6')](_0x5e1142+':'+_0x3ba774['id'],_0x3ba774);WhatsappMessageEvents['emit'](_0x5e1142,_0x3ba774);_0x1f38c6(null);};}for(var e in events){if(events[_0x15eb('0x7')](e)){var event=events[e];WhatsappMessage[_0x15eb('0x8')](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 c37bd85..75413d8 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 _0xca45=['afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','fti_whatsapp_messages','body','get','direction','UserId','WhatsappInteraction','findOne','update','createdAt','toLowerCase','error','out','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','then','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x20de89,_0x59ec59){var _0x561ffc=function(_0x3c53b9){while(--_0x3c53b9){_0x20de89['push'](_0x20de89['shift']());}};_0x561ffc(++_0x59ec59);}(_0xca45,0x1ae));var _0x5ca4=function(_0xf33c0c,_0x4a8fc5){_0xf33c0c=_0xf33c0c-0x0;var _0x80aaa0=_0xca45[_0xf33c0c];return _0x80aaa0;};'use strict';var _=require('lodash');var util=require(_0x5ca4('0x0'));var logger=require(_0x5ca4('0x1'))(_0x5ca4('0x2'));var moment=require(_0x5ca4('0x3'));var BPromise=require(_0x5ca4('0x4'));var rp=require(_0x5ca4('0x5'));var fetch=require(_0x5ca4('0x6'));var fs=require('fs');var path=require(_0x5ca4('0x7'));var rimraf=require(_0x5ca4('0x8'));var config=require(_0x5ca4('0x9'));var attributes=require(_0x5ca4('0xa'));module[_0x5ca4('0xb')]=function(_0x1a3684,_0x5f4a0f){return _0x1a3684[_0x5ca4('0xc')](_0x5ca4('0xd'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x5ca4('0xe'),'fields':[_0x5ca4('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x529cba,_0x29e36b,_0x987054){var _0x42776=_0x1a3684['models'];var _0x540b82=_0x529cba[_0x5ca4('0x10')]({'plain':!![]});if(_0x540b82['direction']['toLowerCase']()==='in'||_0x540b82[_0x5ca4('0x11')]['toLowerCase']()==='out'&&!_0x540b82['secret']&&!_['isNil'](_0x540b82[_0x5ca4('0x12')])){_0x42776[_0x5ca4('0x13')][_0x5ca4('0x14')]({'where':{'id':_0x540b82['WhatsappInteractionId']}})['then'](function(_0x433c77){if(_0x433c77){_0x433c77[_0x5ca4('0x15')]({'lastMsgAt':_0x540b82[_0x5ca4('0x16')],'lastMsgDirection':_0x540b82['direction'][_0x5ca4('0x17')]()});}})['catch'](function(_0x22ddbd){console[_0x5ca4('0x18')](_0x22ddbd);});}if(_0x540b82[_0x5ca4('0x11')]===_0x5ca4('0x19')&&!_0x540b82[_0x5ca4('0x1a')]){var _0x58c565;_0x42776[_0x5ca4('0x1b')][_0x5ca4('0x1c')]({'where':{'id':_0x540b82[_0x5ca4('0x1d')]},'raw':!![]})['then'](function(_0x4d8c47){_0x58c565=_0x4d8c47;if(_0x58c565&&_0x58c565[_0x5ca4('0x1e')]){switch(_0x58c565['type']){case _0x5ca4('0x1f'):var _0x20f205=require(_0x5ca4('0x1f'));if(_0x58c565[_0x5ca4('0x20')]&&_0x58c565[_0x5ca4('0x21')]&&_0x58c565[_0x5ca4('0x22')]){var _0x543c88=new _0x20f205(_0x58c565['accountSid'],_0x58c565[_0x5ca4('0x21')]);_0x543c88[_0x5ca4('0x23')]['create']({'body':_0x540b82['body'],'to':'whatsapp:'+_0x540b82[_0x5ca4('0x22')],'from':_0x5ca4('0x24')+_0x58c565[_0x5ca4('0x22')],'statusCallback':_0x58c565[_0x5ca4('0x25')]+'/api/whatsapp/messages/'+_0x540b82['id']+'/status?token='+_0x58c565['token']})[_0x5ca4('0x26')](function(_0x2fd27d){if(_0x2fd27d[_0x5ca4('0x27')]){return _0x529cba[_0x5ca4('0x15')]({'messageId':_0x2fd27d[_0x5ca4('0x27')]});}})[_0x5ca4('0x28')](function(_0x2b8a9c){logger[_0x5ca4('0x18')](_0x5ca4('0x29'),'afterCreate',_0x5ca4('0x1f'),util['inspect'](_0x2b8a9c,{'showHidden':![],'depth':null}));});}else{logger[_0x5ca4('0x18')](_0x5ca4('0x29'),_0x5ca4('0x2a'),_0x5ca4('0x1f'),_0x5ca4('0x2b'));}break;case _0x5ca4('0x2c'):var _0x11b630=_0x58c565[_0x5ca4('0x20')];var _0xd917bf=_0x58c565['authToken'];var _0x367cca=_0x58c565[_0x5ca4('0x2d')]+_0x5ca4('0x2e')+_0x11b630+_0x5ca4('0x2f');var _0x3f4e24={'to':[_0x540b82[_0x5ca4('0x22')]],'message':{'type':_0x5ca4('0x30'),'text':_0x540b82[_0x5ca4('0xf')]}};var _0x5a39a8={'method':_0x5ca4('0x31'),'uri':_0x367cca,'headers':{'Authorization':_0x5ca4('0x32')+_0xd917bf,'Content-Type':_0x5ca4('0x33')},'body':_0x3f4e24,'json':!![]};rp(_0x5a39a8)[_0x5ca4('0x26')](function(_0x3dc9e5){if(_0x3dc9e5['statuses'][0x0][_0x5ca4('0x34')]){return _0x529cba[_0x5ca4('0x15')]({'messageId':_0x3dc9e5[_0x5ca4('0x35')][0x0][_0x5ca4('0x34')]});}})[_0x5ca4('0x28')](function(_0x255f93){logger[_0x5ca4('0x36')](_0x5ca4('0x37'),_0x255f93);});break;}}})[_0x5ca4('0x38')](function(){_0x987054();});}else{_0x987054();}}},'charset':_0x5ca4('0x39'),'collate':_0x5ca4('0x3a')});}; \ No newline at end of file +var _0x804d=['finally','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','findOne','then','update','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','/api/whatsapp/messages/','token','sid','catch','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x804d,0x170));var _0xd804=function(_0x38cdf2,_0x56d63a){_0x38cdf2=_0x38cdf2-0x0;var _0x59fc04=_0x804d[_0x38cdf2];return _0x59fc04;};'use strict';var _=require('lodash');var util=require(_0xd804('0x0'));var logger=require(_0xd804('0x1'))('api');var moment=require(_0xd804('0x2'));var BPromise=require(_0xd804('0x3'));var rp=require(_0xd804('0x4'));var fetch=require(_0xd804('0x5'));var fs=require('fs');var path=require(_0xd804('0x6'));var rimraf=require(_0xd804('0x7'));var config=require(_0xd804('0x8'));var attributes=require(_0xd804('0x9'));module[_0xd804('0xa')]=function(_0x5508da,_0x3e2072){return _0x5508da[_0xd804('0xb')](_0xd804('0xc'),attributes,{'tableName':_0xd804('0xd'),'paranoid':![],'indexes':[{'name':_0xd804('0xe'),'fields':[_0xd804('0xe')]},{'name':_0xd804('0xf'),'fields':[_0xd804('0x10')],'type':_0xd804('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x567532,_0x4a0f6a,_0xfe194d){var _0x5ae25d=_0x5508da[_0xd804('0x12')];var _0x363141=_0x567532[_0xd804('0x13')]({'plain':!![]});if(_0x363141[_0xd804('0x14')][_0xd804('0x15')]()==='in'||_0x363141['direction'][_0xd804('0x15')]()===_0xd804('0x16')&&!_0x363141[_0xd804('0x17')]&&!_['isNil'](_0x363141[_0xd804('0x18')])){_0x5ae25d['WhatsappInteraction'][_0xd804('0x19')]({'where':{'id':_0x363141['WhatsappInteractionId']}})[_0xd804('0x1a')](function(_0x381ce3){if(_0x381ce3){_0x381ce3[_0xd804('0x1b')]({'lastMsgAt':_0x363141['createdAt'],'lastMsgDirection':_0x363141[_0xd804('0x14')]['toLowerCase']()});}})['catch'](function(_0x51c71f){console[_0xd804('0x1c')](_0x51c71f);});}if(_0x363141['direction']==='out'&&!_0x363141[_0xd804('0x17')]){var _0x3d6df7;_0x5ae25d[_0xd804('0x1d')][_0xd804('0x1e')]({'where':{'id':_0x363141[_0xd804('0x1f')]},'raw':!![]})['then'](function(_0x4c20be){_0x3d6df7=_0x4c20be;if(_0x3d6df7&&_0x3d6df7[_0xd804('0x20')]){switch(_0x3d6df7[_0xd804('0x20')]){case _0xd804('0x21'):var _0x4028bd=require('twilio');if(_0x3d6df7[_0xd804('0x22')]&&_0x3d6df7[_0xd804('0x23')]&&_0x3d6df7['phone']){var _0x53002f=new _0x4028bd(_0x3d6df7['accountSid'],_0x3d6df7[_0xd804('0x23')]);_0x53002f[_0xd804('0x24')][_0xd804('0x25')]({'body':_0x363141[_0xd804('0x10')],'to':_0xd804('0x26')+_0x363141[_0xd804('0x27')],'from':_0xd804('0x26')+_0x3d6df7['phone'],'statusCallback':_0x3d6df7['remote']+_0xd804('0x28')+_0x363141['id']+'/status?token='+_0x3d6df7[_0xd804('0x29')]})['then'](function(_0x3bbd00){if(_0x3bbd00['sid']){return _0x567532[_0xd804('0x1b')]({'messageId':_0x3bbd00[_0xd804('0x2a')]});}})[_0xd804('0x2b')](function(_0x33979f){logger[_0xd804('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xd804('0x2c'),_0xd804('0x21'),util[_0xd804('0x2d')](_0x33979f,{'showHidden':![],'depth':null}));});}else{logger[_0xd804('0x1c')](_0xd804('0x2e'),_0xd804('0x2c'),_0xd804('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xd804('0x2f'):var _0x57dda7=_0x3d6df7[_0xd804('0x22')];var _0x858964=_0x3d6df7[_0xd804('0x23')];var _0x5ecc73=_0x3d6df7[_0xd804('0x30')]+_0xd804('0x31')+_0x57dda7+_0xd804('0x32');var _0x569923={'to':[_0x363141[_0xd804('0x27')]],'message':{'type':_0xd804('0x33'),'text':_0x363141[_0xd804('0x10')]}};var _0x42ecc6={'method':_0xd804('0x34'),'uri':_0x5ecc73,'headers':{'Authorization':_0xd804('0x35')+_0x858964,'Content-Type':_0xd804('0x36')},'body':_0x569923,'json':!![]};rp(_0x42ecc6)[_0xd804('0x1a')](function(_0xaffd54){if(_0xaffd54[_0xd804('0x37')][0x0][_0xd804('0x38')]){return _0x567532[_0xd804('0x1b')]({'messageId':_0xaffd54[_0xd804('0x37')][0x0][_0xd804('0x38')]});}})['catch'](function(_0x5b026c){logger[_0xd804('0x39')](_0xd804('0x3a'),_0x5b026c);});break;}}})[_0xd804('0x3b')](function(){_0xfe194d();});}else{_0xfe194d();}}},'charset':'utf8mb4','collate':_0xd804('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 3b946c9..c17a13b 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 _0x0d52=['localhost','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults'];(function(_0x5ad597,_0x3f5fad){var _0x365f59=function(_0x4ffe73){while(--_0x4ffe73){_0x5ad597['push'](_0x5ad597['shift']());}};_0x365f59(++_0x3f5fad);}(_0x0d52,0x6b));var _0x20d5=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0d52[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x20d5('0x0'));var util=require(_0x20d5('0x1'));var moment=require(_0x20d5('0x2'));var BPromise=require(_0x20d5('0x3'));var rs=require(_0x20d5('0x4'));var fs=require('fs');var Redis=require(_0x20d5('0x5'));var db=require(_0x20d5('0x6'))['db'];var utils=require(_0x20d5('0x7'));var logger=require(_0x20d5('0x8'))(_0x20d5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x20d5('0xa')]['http']({'port':0x232a});config[_0x20d5('0xb')]=_[_0x20d5('0xc')](config[_0x20d5('0xb')],{'host':_0x20d5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x55cfb8,_0x2d1c49,_0xe9f049){return new BPromise(function(_0x577efe,_0x5ee48f){return client[_0x20d5('0xe')](_0x55cfb8,_0xe9f049)[_0x20d5('0xf')](function(_0x16c30e){logger['info'](_0x20d5('0x10'),_0x2d1c49,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2d1c49,_0x20d5('0x11'),JSON['stringify'](_0x16c30e));if(_0x16c30e[_0x20d5('0x12')]){if(_0x16c30e[_0x20d5('0x12')]['code']===0x1f4){logger[_0x20d5('0x12')](_0x20d5('0x10'),_0x2d1c49,_0x16c30e[_0x20d5('0x12')][_0x20d5('0x13')]);return _0x5ee48f(_0x16c30e[_0x20d5('0x12')][_0x20d5('0x13')]);}logger['error'](_0x20d5('0x10'),_0x2d1c49,_0x16c30e['error'][_0x20d5('0x13')]);return _0x577efe(_0x16c30e['error'][_0x20d5('0x13')]);}else{logger[_0x20d5('0x14')](_0x20d5('0x10'),_0x2d1c49,'request\x20sent');_0x577efe(_0x16c30e[_0x20d5('0x15')]['message']);}})[_0x20d5('0x16')](function(_0x3bb658){logger[_0x20d5('0x12')](_0x20d5('0x10'),_0x2d1c49,_0x3bb658);_0x5ee48f(_0x3bb658);});});}exports[_0x20d5('0x17')]=function(_0x53421f){var _0x1c829e=this;return new Promise(function(_0x10e59d,_0x1feded){return db[_0x20d5('0x18')][_0x20d5('0x19')](_0x53421f[_0x20d5('0x1a')],{'raw':_0x53421f[_0x20d5('0x1b')]?_0x53421f['options'][_0x20d5('0x1c')]===undefined?!![]:![]:!![]})[_0x20d5('0xf')](function(_0xebd6da){logger[_0x20d5('0x14')](_0x20d5('0x17'),_0x53421f);logger['debug'](_0x20d5('0x17'),_0x53421f,JSON[_0x20d5('0x1d')](_0xebd6da));_0x10e59d(_0xebd6da);})[_0x20d5('0x16')](function(_0x2856c8){logger[_0x20d5('0x12')](_0x20d5('0x17'),_0x2856c8[_0x20d5('0x13')],_0x53421f);_0x1feded(_0x1c829e[_0x20d5('0x12')](0x1f4,_0x2856c8[_0x20d5('0x13')]));});});}; \ No newline at end of file +var _0x8f7c=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','info','request\x20sent','debug','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0x8f7c,0x18f));var _0xc8f7=function(_0x4413cf,_0x3f70e8){_0x4413cf=_0x4413cf-0x0;var _0x9a1479=_0x8f7c[_0x4413cf];return _0x9a1479;};'use strict';var _=require(_0xc8f7('0x0'));var util=require(_0xc8f7('0x1'));var moment=require(_0xc8f7('0x2'));var BPromise=require(_0xc8f7('0x3'));var rs=require(_0xc8f7('0x4'));var fs=require('fs');var Redis=require(_0xc8f7('0x5'));var db=require(_0xc8f7('0x6'))['db'];var utils=require(_0xc8f7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc8f7('0x8'));var jayson=require(_0xc8f7('0x9'));var client=jayson[_0xc8f7('0xa')]['http']({'port':0x232a});config[_0xc8f7('0xb')]=_[_0xc8f7('0xc')](config[_0xc8f7('0xb')],{'host':_0xc8f7('0xd'),'port':0x18eb});var socket=require(_0xc8f7('0xe'))(new Redis(config['redis']));require(_0xc8f7('0xf'))['register'](socket);function respondWithRpcPromise(_0x3f09a5,_0x2e39b4,_0x2c53cf){return new BPromise(function(_0x5850f3,_0x3a770c){return client[_0xc8f7('0x10')](_0x3f09a5,_0x2c53cf)['then'](function(_0x374125){logger[_0xc8f7('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x2e39b4,_0xc8f7('0x12'));logger[_0xc8f7('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2e39b4,_0xc8f7('0x12'),JSON[_0xc8f7('0x14')](_0x374125));if(_0x374125[_0xc8f7('0x15')]){if(_0x374125['error'][_0xc8f7('0x16')]===0x1f4){logger[_0xc8f7('0x15')](_0xc8f7('0x17'),_0x2e39b4,_0x374125['error']['message']);return _0x3a770c(_0x374125[_0xc8f7('0x15')][_0xc8f7('0x18')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x2e39b4,_0x374125[_0xc8f7('0x15')]['message']);return _0x5850f3(_0x374125[_0xc8f7('0x15')][_0xc8f7('0x18')]);}else{logger['info'](_0xc8f7('0x17'),_0x2e39b4,_0xc8f7('0x12'));_0x5850f3(_0x374125['result'][_0xc8f7('0x18')]);}})[_0xc8f7('0x19')](function(_0x4afbe0){logger['error'](_0xc8f7('0x17'),_0x2e39b4,_0x4afbe0);_0x3a770c(_0x4afbe0);});});}exports[_0xc8f7('0x1a')]=function(_0x1f39b4){var _0x19e7bc=this;return new Promise(function(_0x5320c0,_0x5e6386){return db[_0xc8f7('0x1b')][_0xc8f7('0x1c')](_0x1f39b4[_0xc8f7('0x1d')],{'raw':_0x1f39b4[_0xc8f7('0x1e')]?_0x1f39b4[_0xc8f7('0x1e')][_0xc8f7('0x1f')]===undefined?!![]:![]:!![]})[_0xc8f7('0x20')](function(_0x4be8ce){logger[_0xc8f7('0x11')](_0xc8f7('0x1a'),_0x1f39b4);logger[_0xc8f7('0x13')]('CreateWhatsappMessage',_0x1f39b4,JSON[_0xc8f7('0x14')](_0x4be8ce));_0x5320c0(_0x4be8ce);})[_0xc8f7('0x19')](function(_0x59d985){logger[_0xc8f7('0x15')](_0xc8f7('0x1a'),_0x59d985[_0xc8f7('0x18')],_0x1f39b4);_0x5e6386(_0x19e7bc['error'](0x1f4,_0x59d985['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index f4f4d2b..cacadc1 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 _0x8561=['./whatsappMessage.events','save','update','removeListener','register','length'];(function(_0x141834,_0xac4783){var _0x330907=function(_0x47f652){while(--_0x47f652){_0x141834['push'](_0x141834['shift']());}};_0x330907(++_0xac4783);}(_0x8561,0x1f2));var _0x1856=function(_0x461eaa,_0x5b9604){_0x461eaa=_0x461eaa-0x0;var _0x3f2756=_0x8561[_0x461eaa];return _0x3f2756;};'use strict';var WhatsappMessageEvents=require(_0x1856('0x0'));var events=[_0x1856('0x1'),'remove',_0x1856('0x2')];function createListener(_0x33fe8f,_0x2b9015){return function(_0x22648a){_0x2b9015['emit'](_0x33fe8f,_0x22648a);};}function removeListener(_0x75a896,_0x19857f){return function(){WhatsappMessageEvents[_0x1856('0x3')](_0x75a896,_0x19857f);};}exports[_0x1856('0x4')]=function(_0xc62c4c){for(var _0x103d37=0x0,_0x479f07=events[_0x1856('0x5')];_0x103d37<_0x479f07;_0x103d37++){var _0x27d9fd=events[_0x103d37];var _0x1abf25=createListener('whatsappMessage:'+_0x27d9fd,_0xc62c4c);WhatsappMessageEvents['on'](_0x27d9fd,_0x1abf25);}}; \ No newline at end of file +var _0x5293=['./whatsappMessage.events','save','emit','removeListener','register','whatsappMessage:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5293,0x138));var _0x3529=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x5293[_0x18a436];return _0x5c2cf8;};'use strict';var WhatsappMessageEvents=require(_0x3529('0x0'));var events=[_0x3529('0x1'),'remove','update'];function createListener(_0x1bd428,_0x43dace){return function(_0x603836){_0x43dace[_0x3529('0x2')](_0x1bd428,_0x603836);};}function removeListener(_0x4e576b,_0x2f5d09){return function(){WhatsappMessageEvents[_0x3529('0x3')](_0x4e576b,_0x2f5d09);};}exports[_0x3529('0x4')]=function(_0x554b71){for(var _0x5334a2=0x0,_0xb2184d=events['length'];_0x5334a2<_0xb2184d;_0x5334a2++){var _0x1d24cf=events[_0x5334a2];var _0x4a1ac5=createListener(_0x3529('0x5')+_0x1d24cf,_0x554b71);WhatsappMessageEvents['on'](_0x1d24cf,_0x4a1ac5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 65de732..afe1ea1 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 _0xc1bc=['/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams'];(function(_0x3979bb,_0x36f403){var _0xaedec8=function(_0x1821cb){while(--_0x1821cb){_0x3979bb['push'](_0x3979bb['shift']());}};_0xaedec8(++_0x36f403);}(_0xc1bc,0x1cb));var _0xcc1b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc1bc[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xcc1b('0x0'));var util=require(_0xcc1b('0x1'));var path=require(_0xcc1b('0x2'));var timeout=require(_0xcc1b('0x3'));var express=require(_0xcc1b('0x4'));var router=express[_0xcc1b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcc1b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcc1b('0x7'));var controller=require('./whatsappQueue.controller');router[_0xcc1b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcc1b('0x8')](_0xcc1b('0x9'),auth[_0xcc1b('0xa')](),controller[_0xcc1b('0xb')]);router[_0xcc1b('0x8')](_0xcc1b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcc1b('0x8')](_0xcc1b('0xd'),auth['isAuthenticated'](),controller[_0xcc1b('0xe')]);router[_0xcc1b('0x8')](_0xcc1b('0xf'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xcc1b('0x10'),auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x11')]);router['post']('/',auth[_0xcc1b('0xa')](),controller['create']);router[_0xcc1b('0x12')]('/:id/teams',auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x13')]);router['post']('/:id/users',auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x14')]);router[_0xcc1b('0x15')](_0xcc1b('0xc'),auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x16')]);router[_0xcc1b('0x17')](_0xcc1b('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xcc1b('0x17')](_0xcc1b('0xf'),auth[_0xcc1b('0xa')](),controller['removeTeams']);router[_0xcc1b('0x17')]('/:id/users',auth[_0xcc1b('0xa')](),controller['removeAgents']);module[_0xcc1b('0x18')]=router; \ No newline at end of file +var _0xa046=['getAgents','addTeams','post','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x265034,_0x237402){var _0x5d18f0=function(_0x4da967){while(--_0x4da967){_0x265034['push'](_0x265034['shift']());}};_0x5d18f0(++_0x237402);}(_0xa046,0xab));var _0x6a04=function(_0x1a7d78,_0x54d6ff){_0x1a7d78=_0x1a7d78-0x0;var _0x3153ae=_0xa046[_0x1a7d78];return _0x3153ae;};'use strict';var multer=require(_0x6a04('0x0'));var util=require(_0x6a04('0x1'));var path=require(_0x6a04('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a04('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a04('0x4'));var interaction=require(_0x6a04('0x5'));var config=require(_0x6a04('0x6'));var controller=require(_0x6a04('0x7'));router[_0x6a04('0x8')]('/',auth[_0x6a04('0x9')](),controller[_0x6a04('0xa')]);router[_0x6a04('0x8')](_0x6a04('0xb'),auth[_0x6a04('0x9')](),controller['describe']);router[_0x6a04('0x8')](_0x6a04('0xc'),auth[_0x6a04('0x9')](),controller['show']);router[_0x6a04('0x8')](_0x6a04('0xd'),auth['isAuthenticated'](),controller[_0x6a04('0xe')]);router[_0x6a04('0x8')](_0x6a04('0xf'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x10')]);router[_0x6a04('0x8')](_0x6a04('0x11'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x12')]);router['post']('/',auth[_0x6a04('0x9')](),controller['create']);router['post'](_0x6a04('0xf'),auth['isAuthenticated'](),controller[_0x6a04('0x13')]);router[_0x6a04('0x14')](_0x6a04('0x11'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x15')]);router['put'](_0x6a04('0xc'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x16')]);router[_0x6a04('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x6a04('0x18')]);router[_0x6a04('0x17')](_0x6a04('0xf'),auth['isAuthenticated'](),controller[_0x6a04('0x19')]);router['delete'](_0x6a04('0x11'),auth[_0x6a04('0x9')](),controller[_0x6a04('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a29c329..cea22ca 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 _0xb458=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x285e45,_0x34ecaf){var _0x15d68a=function(_0x248191){while(--_0x248191){_0x285e45['push'](_0x285e45['shift']());}};_0x15d68a(++_0x34ecaf);}(_0xb458,0xca));var _0x8b45=function(_0x416df5,_0x5cd9e7){_0x416df5=_0x416df5-0x0;var _0x53235b=_0xb458[_0x416df5];return _0x53235b;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'unique':_0x8b45('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x5'),_0x8b45('0x6'),_0x8b45('0x7'))},'description':{'type':Sequelize[_0x8b45('0x2')]}}; \ No newline at end of file +var _0x13c0=['roundrobin','sequelize','exports','STRING','name','beepall'];(function(_0x181c09,_0x1abf25){var _0x20473e=function(_0x1b1320){while(--_0x1b1320){_0x181c09['push'](_0x181c09['shift']());}};_0x20473e(++_0x1abf25);}(_0x13c0,0x79));var _0x013c=function(_0xed6f46,_0x1c9006){_0xed6f46=_0xed6f46-0x0;var _0x5b267c=_0x13c0[_0xed6f46];return _0x5b267c;};'use strict';var Sequelize=require(_0x013c('0x0'));module[_0x013c('0x1')]={'name':{'type':Sequelize[_0x013c('0x2')],'unique':_0x013c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x013c('0x4'),_0x013c('0x5'))},'description':{'type':Sequelize[_0x013c('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 0b7f813..7fd6340 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 _0x1743=['Team','addTeams','ids','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','compact','value','removeAgents','forEach','emit','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappQueue.socket','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','name','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','WhatsappQueue','includeAll','include','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','body','describe','findOne','UserWhatsappQueue','pick','WhatsappQueueId','findAll','User','findAndCountAll','whatsappPause','updatedAt','createdAt','rows','format','getTeams'];(function(_0x82de21,_0x3e5114){var _0x45b924=function(_0x484110){while(--_0x484110){_0x82de21['push'](_0x82de21['shift']());}};_0x45b924(++_0x3e5114);}(_0x1743,0x1b1));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3174('0x0'));var rimraf=require(_0x3174('0x1'));var zipdir=require(_0x3174('0x2'));var jsonpatch=require(_0x3174('0x3'));var rp=require(_0x3174('0x4'));var moment=require(_0x3174('0x5'));var BPromise=require(_0x3174('0x6'));var Mustache=require('mustache');var util=require(_0x3174('0x7'));var path=require(_0x3174('0x8'));var sox=require(_0x3174('0x9'));var csv=require('to-csv');var ejs=require(_0x3174('0xa'));var fs=require('fs');var fs_extra=require(_0x3174('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3174('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3174('0xd'));var toCsv=require(_0x3174('0xe'));var querystring=require(_0x3174('0xf'));var Papa=require('papaparse');var Redis=require(_0x3174('0x10'));var authService=require(_0x3174('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3174('0x12'));var logger=require(_0x3174('0x13'))(_0x3174('0x14'));var utils=require(_0x3174('0x15'));var config=require(_0x3174('0x16'));var licenseUtil=require(_0x3174('0x17'));var db=require('../../mysqldb')['db'];config[_0x3174('0x18')]=_[_0x3174('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3174('0x1a'))(new Redis(config[_0x3174('0x18')]));require(_0x3174('0x1b'))['register'](socket);function respondWithStatusCode(_0x443ff7,_0x47ed12){_0x47ed12=_0x47ed12||0xcc;return function(_0x134492){if(_0x134492){return _0x443ff7['sendStatus'](_0x47ed12);}return _0x443ff7[_0x3174('0x1c')](_0x47ed12)[_0x3174('0x1d')]();};}function respondWithResult(_0x4ff2ff,_0x3d4338){_0x3d4338=_0x3d4338||0xc8;return function(_0x209f21){if(_0x209f21){return _0x4ff2ff[_0x3174('0x1c')](_0x3d4338)['json'](_0x209f21);}};}function respondWithFilteredResult(_0x1f5458,_0x4f232b){return function(_0x4e37d4){if(_0x4e37d4){var _0x226e3d=typeof _0x4f232b[_0x3174('0x1e')]==='undefined'&&typeof _0x4f232b[_0x3174('0x1f')]===_0x3174('0x20');var _0xcb65ae=_0x4e37d4[_0x3174('0x21')];var _0x166cf5=_0x226e3d?0x0:_0x4f232b[_0x3174('0x1e')];var _0xc131af=_0x226e3d?_0x4e37d4['count']:_0x4f232b[_0x3174('0x1e')]+_0x4f232b[_0x3174('0x1f')];var _0x5ae4a5;if(_0xc131af>=_0xcb65ae){_0xc131af=_0xcb65ae;_0x5ae4a5=0xc8;}else{_0x5ae4a5=0xce;}_0x1f5458[_0x3174('0x1c')](_0x5ae4a5);return _0x1f5458[_0x3174('0x22')](_0x3174('0x23'),_0x166cf5+'-'+_0xc131af+'/'+_0xcb65ae)[_0x3174('0x24')](_0x4e37d4);}return null;};}function patchUpdates(_0x253963){return function(_0x20e457){try{jsonpatch[_0x3174('0x25')](_0x20e457,_0x253963,!![]);}catch(_0x31f2f4){return BPromise['reject'](_0x31f2f4);}return _0x20e457[_0x3174('0x26')]();};}function saveUpdates(_0x58f413,_0x1e13c2){return function(_0x5db39c){if(_0x5db39c){return _0x5db39c[_0x3174('0x27')](_0x58f413)[_0x3174('0x28')](function(_0x5899cf){return _0x5899cf;});}return null;};}function removeEntity(_0x3cd9bc,_0x57d52e){return function(_0x493477){if(_0x493477){return _0x493477[_0x3174('0x29')]()[_0x3174('0x28')](function(){var _0x2b9282=_0x493477[_0x3174('0x2a')]({'plain':!![]});var _0x182e9b=_0x3174('0x2b');return db[_0x3174('0x2c')]['destroy']({'where':{'type':_0x182e9b,'resourceId':_0x2b9282['id']}})[_0x3174('0x28')](function(){return _0x493477;});})[_0x3174('0x28')](function(){_0x3cd9bc[_0x3174('0x1c')](0xcc)[_0x3174('0x1d')]();});}};}function handleEntityNotFound(_0x15e286,_0x32b495){return function(_0x12f15e){if(!_0x12f15e){_0x15e286[_0x3174('0x2d')](0x194);}return _0x12f15e;};}function handleError(_0x1e3675,_0x58ac1c){_0x58ac1c=_0x58ac1c||0x1f4;return function(_0x42c195){logger['error'](_0x42c195['stack']);if(_0x42c195[_0x3174('0x2e')]){delete _0x42c195[_0x3174('0x2e')];}_0x1e3675['status'](_0x58ac1c)['send'](_0x42c195);};}exports['index']=function(_0x1c2517,_0x4c6e24){var _0x143c42={},_0x5bde9b={},_0x54d9ce={'count':0x0,'rows':[]};var _0x1cb086=_[_0x3174('0x2f')](db['WhatsappQueue'][_0x3174('0x30')],function(_0x577886){return{'name':_0x577886[_0x3174('0x31')],'type':_0x577886['type']['key']};});_0x5bde9b[_0x3174('0x32')]=_[_0x3174('0x2f')](_0x1cb086,'name');_0x5bde9b[_0x3174('0x33')]=_['keys'](_0x1c2517[_0x3174('0x33')]);_0x5bde9b[_0x3174('0x34')]=_[_0x3174('0x35')](_0x5bde9b[_0x3174('0x32')],_0x5bde9b['query']);_0x143c42[_0x3174('0x36')]=_[_0x3174('0x35')](_0x5bde9b[_0x3174('0x32')],qs[_0x3174('0x37')](_0x1c2517['query'][_0x3174('0x37')]));_0x143c42[_0x3174('0x36')]=_0x143c42[_0x3174('0x36')][_0x3174('0x38')]?_0x143c42[_0x3174('0x36')]:_0x5bde9b[_0x3174('0x32')];if(!_0x1c2517[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x143c42[_0x3174('0x1f')]=qs[_0x3174('0x1f')](_0x1c2517['query'][_0x3174('0x1f')]);_0x143c42[_0x3174('0x1e')]=qs[_0x3174('0x1e')](_0x1c2517['query'][_0x3174('0x1e')]);}_0x143c42[_0x3174('0x3b')]=qs[_0x3174('0x3c')](_0x1c2517[_0x3174('0x33')][_0x3174('0x3c')]);_0x143c42[_0x3174('0x3d')]=qs[_0x3174('0x34')](_['pick'](_0x1c2517['query'],_0x5bde9b['filters']),_0x1cb086);if(_0x1c2517['query'][_0x3174('0x3e')]){_0x143c42[_0x3174('0x3d')]=_['merge'](_0x143c42[_0x3174('0x3d')],{'$or':_['map'](_0x1cb086,function(_0x18bb3b){if(_0x18bb3b[_0x3174('0x3f')]!==_0x3174('0x40')){var _0x4b1276={};_0x4b1276[_0x18bb3b[_0x3174('0x2e')]]={'$like':'%'+_0x1c2517[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x4b1276;}})});}_0x143c42=_[_0x3174('0x41')]({},_0x143c42,_0x1c2517[_0x3174('0x42')]);var _0x2ed8d4={'where':_0x143c42[_0x3174('0x3d')]};return db[_0x3174('0x43')][_0x3174('0x21')](_0x2ed8d4)[_0x3174('0x28')](function(_0x19c9de){_0x54d9ce[_0x3174('0x21')]=_0x19c9de;if(_0x1c2517[_0x3174('0x33')][_0x3174('0x44')]){_0x143c42[_0x3174('0x45')]=[{'all':!![]}];}return db[_0x3174('0x43')]['findAll'](_0x143c42);})['then'](function(_0x3b8920){_0x54d9ce['rows']=_0x3b8920;return _0x54d9ce;})[_0x3174('0x28')](respondWithFilteredResult(_0x4c6e24,_0x143c42))[_0x3174('0x46')](handleError(_0x4c6e24,null));};exports[_0x3174('0x47')]=function(_0x2073df,_0x338463){var _0x16b8dd={'raw':!![],'where':{'id':_0x2073df[_0x3174('0x48')]['id']}},_0x1a135b={};_0x1a135b[_0x3174('0x32')]=_[_0x3174('0x49')](db['WhatsappQueue'][_0x3174('0x30')]);_0x1a135b[_0x3174('0x33')]=_[_0x3174('0x49')](_0x2073df[_0x3174('0x33')]);_0x1a135b['filters']=_[_0x3174('0x35')](_0x1a135b[_0x3174('0x32')],_0x1a135b['query']);_0x16b8dd[_0x3174('0x36')]=_[_0x3174('0x35')](_0x1a135b[_0x3174('0x32')],qs['fields'](_0x2073df[_0x3174('0x33')][_0x3174('0x37')]));_0x16b8dd[_0x3174('0x36')]=_0x16b8dd[_0x3174('0x36')][_0x3174('0x38')]?_0x16b8dd['attributes']:_0x1a135b['model'];if(_0x2073df[_0x3174('0x33')][_0x3174('0x44')]){_0x16b8dd[_0x3174('0x45')]=[{'all':!![]}];}_0x16b8dd=_[_0x3174('0x41')]({},_0x16b8dd,_0x2073df[_0x3174('0x42')]);return db[_0x3174('0x43')][_0x3174('0x4a')](_0x16b8dd)[_0x3174('0x28')](handleEntityNotFound(_0x338463,null))['then'](respondWithResult(_0x338463,null))['catch'](handleError(_0x338463,null));};exports[_0x3174('0x4b')]=function(_0x5a3ad0,_0x540c52){return db[_0x3174('0x43')][_0x3174('0x4b')](_0x5a3ad0['body'],{})[_0x3174('0x28')](function(_0xf6bb66){var _0x32d80c=_0x5a3ad0[_0x3174('0x4c')][_0x3174('0x2a')]({'plain':!![]});if(!_0x32d80c)throw new Error(_0x3174('0x4d'));if(_0x32d80c['role']===_0x3174('0x4c')){var _0x448ac2=_0xf6bb66[_0x3174('0x2a')]({'plain':!![]});var _0x355452=_0x3174('0x2b');return db[_0x3174('0x4e')]['find']({'where':{'name':_0x355452,'userProfileId':_0x32d80c['userProfileId']},'raw':!![]})[_0x3174('0x28')](function(_0x355e26){if(_0x355e26&&_0x355e26['autoAssociation']===0x0){return db[_0x3174('0x2c')][_0x3174('0x4b')]({'name':_0x448ac2[_0x3174('0x2e')],'resourceId':_0x448ac2['id'],'type':_0x355e26[_0x3174('0x2e')],'sectionId':_0x355e26['id']},{})['then'](function(){return _0xf6bb66;});}else{return _0xf6bb66;}})['catch'](function(_0x6f7ca1){logger[_0x3174('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6f7ca1);throw _0x6f7ca1;});}return _0xf6bb66;})[_0x3174('0x28')](respondWithResult(_0x540c52,0xc9))[_0x3174('0x46')](handleError(_0x540c52,null));};exports[_0x3174('0x27')]=function(_0x240d54,_0x10766a){if(_0x240d54['body']['id']){delete _0x240d54[_0x3174('0x50')]['id'];}return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0x240d54[_0x3174('0x48')]['id']}})['then'](handleEntityNotFound(_0x10766a,null))[_0x3174('0x28')](saveUpdates(_0x240d54[_0x3174('0x50')],null))[_0x3174('0x28')](respondWithResult(_0x10766a,null))[_0x3174('0x46')](handleError(_0x10766a,null));};exports[_0x3174('0x29')]=function(_0xc2ae0f,_0x5bbc25){return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0xc2ae0f[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x5bbc25,null))[_0x3174('0x28')](removeEntity(_0x5bbc25,null))[_0x3174('0x46')](handleError(_0x5bbc25,null));};exports[_0x3174('0x51')]=function(_0x280b13,_0x33dc22){return db[_0x3174('0x43')]['describe']()['then'](respondWithResult(_0x33dc22,null))[_0x3174('0x46')](handleError(_0x33dc22,null));};exports['getMembers']=function(_0x5e6a78,_0xe180,_0x587ca5){var _0x42cdd6={'raw':!![],'where':{}},_0x4082df={},_0x4dc4b3;return db[_0x3174('0x43')][_0x3174('0x52')]({'where':{'id':_0x5e6a78[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0xe180,null))[_0x3174('0x28')](function(_0x1f1993){if(_0x1f1993){_0x4dc4b3=_0x1f1993[_0x3174('0x2a')]({'plain':!![]});_0x4082df[_0x3174('0x32')]=_[_0x3174('0x49')](db[_0x3174('0x53')][_0x3174('0x30')]);_0x4082df['query']=_[_0x3174('0x49')](_0x5e6a78[_0x3174('0x33')]);_0x4082df[_0x3174('0x34')]=_[_0x3174('0x35')](_0x4082df[_0x3174('0x32')],_0x4082df['query']);_0x42cdd6['attributes']=_[_0x3174('0x35')](_0x4082df[_0x3174('0x32')],qs[_0x3174('0x37')](_0x5e6a78['query'][_0x3174('0x37')]));_0x42cdd6[_0x3174('0x36')]=_0x42cdd6[_0x3174('0x36')]['length']?_0x42cdd6[_0x3174('0x36')]:_0x4082df['model'];if(!_0x5e6a78[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x42cdd6[_0x3174('0x1f')]=qs['limit'](_0x5e6a78[_0x3174('0x33')][_0x3174('0x1f')]);_0x42cdd6[_0x3174('0x1e')]=qs[_0x3174('0x1e')](_0x5e6a78['query']['offset']);}_0x42cdd6['order']=qs[_0x3174('0x3c')](_0x5e6a78[_0x3174('0x33')][_0x3174('0x3c')]);_0x42cdd6[_0x3174('0x3d')]=qs['filters'](_[_0x3174('0x54')](_0x5e6a78[_0x3174('0x33')],_0x4082df[_0x3174('0x34')]));_0x42cdd6[_0x3174('0x3d')][_0x3174('0x55')]=_0x1f1993['id'];if(_0x5e6a78[_0x3174('0x33')][_0x3174('0x3e')]){_0x42cdd6['where']=_[_0x3174('0x41')](_0x42cdd6[_0x3174('0x3d')],{'$or':_[_0x3174('0x2f')](_0x42cdd6[_0x3174('0x36')],function(_0x333c45){var _0x473e19={};_0x473e19[_0x333c45]={'$like':'%'+_0x5e6a78[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x473e19;})});}_0x42cdd6=_[_0x3174('0x41')]({},_0x42cdd6,_0x5e6a78[_0x3174('0x42')]);return db['UserWhatsappQueue'][_0x3174('0x56')](_0x42cdd6);}})[_0x3174('0x28')](function(_0x29f638){if(_0x29f638){return db[_0x3174('0x57')][_0x3174('0x58')]({'where':{'id':_[_0x3174('0x2f')](_0x29f638,'UserId'),'role':'agent'},'attributes':['id','name',_0x3174('0x59'),_0x3174('0x5a'),_0x3174('0x5b')]});}})[_0x3174('0x28')](function(_0x5f4587){if(_0x5f4587){return{'count':_0x5f4587[_0x3174('0x21')],'rows':_[_0x3174('0x2f')](_0x5f4587[_0x3174('0x5c')],function(_0x29f559){return{'membername':_0x29f559[_0x3174('0x2e')],'UserId':_0x29f559['id'],'queue_name':_0x4dc4b3['name'],'WhatsappQueueId':_0x4dc4b3['id'],'interface':util[_0x3174('0x5d')]('%s/%s','SIP',_0x29f559[_0x3174('0x2e')]),'penalty':0x0,'paused':_0x29f559[_0x3174('0x59')],'createdAt':_0x29f559[_0x3174('0x5b')],'updatedAt':_0x29f559[_0x3174('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3174('0x28')](respondWithFilteredResult(_0xe180,_0x42cdd6))[_0x3174('0x46')](handleError(_0xe180,null));};exports[_0x3174('0x5e')]=function(_0x378157,_0x3174d3,_0x2de6a6){var _0x2cc632={};var _0x55ab8f={};var _0x35af9a;var _0x5751bb;return db[_0x3174('0x43')][_0x3174('0x52')]({'where':{'id':_0x378157[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x3174d3,null))[_0x3174('0x28')](function(_0x17329b){if(_0x17329b){_0x35af9a=_0x17329b;_0x55ab8f[_0x3174('0x32')]=_[_0x3174('0x49')](db[_0x3174('0x5f')][_0x3174('0x30')]);_0x55ab8f['query']=_[_0x3174('0x49')](_0x378157[_0x3174('0x33')]);_0x55ab8f[_0x3174('0x34')]=_[_0x3174('0x35')](_0x55ab8f[_0x3174('0x32')],_0x55ab8f['query']);_0x2cc632[_0x3174('0x36')]=_['intersection'](_0x55ab8f[_0x3174('0x32')],qs['fields'](_0x378157[_0x3174('0x33')][_0x3174('0x37')]));_0x2cc632[_0x3174('0x36')]=_0x2cc632[_0x3174('0x36')]['length']?_0x2cc632['attributes']:_0x55ab8f[_0x3174('0x32')];_0x2cc632[_0x3174('0x3b')]=qs[_0x3174('0x3c')](_0x378157['query']['sort']);_0x2cc632['where']=qs['filters'](_[_0x3174('0x54')](_0x378157[_0x3174('0x33')],_0x55ab8f['filters']));if(_0x378157['query']['filter']){_0x2cc632[_0x3174('0x3d')]=_[_0x3174('0x41')](_0x2cc632[_0x3174('0x3d')],{'$or':_[_0x3174('0x2f')](_0x2cc632[_0x3174('0x36')],function(_0x541232){var _0x5e9cd2={};_0x5e9cd2[_0x541232]={'$like':'%'+_0x378157[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x5e9cd2;})});}_0x2cc632=_['merge']({},_0x2cc632,_0x378157[_0x3174('0x42')]);return _0x35af9a[_0x3174('0x5e')](_0x2cc632);}})[_0x3174('0x28')](function(_0x378727){if(_0x378727){_0x5751bb=_0x378727['length'];if(!_0x378157[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x2cc632[_0x3174('0x1f')]=qs['limit'](_0x378157['query']['limit']);_0x2cc632['offset']=qs[_0x3174('0x1e')](_0x378157[_0x3174('0x33')][_0x3174('0x1e')]);}return _0x35af9a[_0x3174('0x5e')](_0x2cc632);}})[_0x3174('0x28')](function(_0x4f06ba){if(_0x4f06ba){return _0x4f06ba?{'count':_0x5751bb,'rows':_0x4f06ba}:null;}})[_0x3174('0x28')](respondWithResult(_0x3174d3,null))[_0x3174('0x46')](handleError(_0x3174d3,null));};exports[_0x3174('0x60')]=function(_0x16a98d,_0x37ca25,_0x2c559f){var _0x49bc74=_0x16a98d[_0x3174('0x50')][_0x3174('0x61')];return db[_0x3174('0x5f')]['findAll']({'where':{'id':_0x49bc74},'attributes':['id'],'include':[{'model':db[_0x3174('0x57')],'as':'Agents','attributes':['id',_0x3174('0x2e'),'online',_0x3174('0x62'),_0x3174('0x63')],'raw':!![]}]})[_0x3174('0x28')](function(_0x2948d3){if(_0x2948d3){var _0x56b846=_['flatMap'](_0x2948d3,function(_0x2a1496){var _0x5ed3fc=_0x2a1496[_0x3174('0x2a')]({'plain':!![]});return _0x5ed3fc[_0x3174('0x64')];});return db['WhatsappQueue']['find']({'where':{'id':_0x16a98d[_0x3174('0x48')]['id']}})[_0x3174('0x28')](function(_0x1ff3c7){return db[_0x3174('0x65')][_0x3174('0x66')](function(_0x3158f0){return _0x1ff3c7[_0x3174('0x60')](_0x49bc74,{'transaction':_0x3158f0})[_0x3174('0x28')](function(){return BPromise[_0x3174('0x67')](_0x56b846,function(_0x5ce2ae){return db['UserWhatsappQueue'][_0x3174('0x68')]({'where':{'UserId':_0x5ce2ae['id'],'WhatsappQueueId':_0x16a98d[_0x3174('0x48')]['id']},'transaction':_0x3158f0});});})[_0x3174('0x28')](function(){_0x56b846['forEach'](function(_0x2ef45c){socket['emit']('userWhatsappQueue:save',{'UserId':_0x2ef45c['id'],'WhatsappQueueId':_0x1ff3c7['id']});});});});});}})[_0x3174('0x28')](respondWithStatusCode(_0x37ca25,null))[_0x3174('0x46')](handleError(_0x37ca25,null));};exports[_0x3174('0x69')]=function(_0x47c4be,_0x53976c,_0x20c98e){return db[_0x3174('0x5f')][_0x3174('0x56')]({'where':{'id':_0x47c4be[_0x3174('0x33')][_0x3174('0x61')]},'attributes':['id'],'include':[{'model':db[_0x3174('0x57')],'as':_0x3174('0x64'),'attributes':['id'],'raw':!![]}]})[_0x3174('0x28')](handleEntityNotFound(_0x53976c,null))[_0x3174('0x28')](function(_0x4302de){var _0x4158db=_[_0x3174('0x2f')](_0x4302de,'id');var _0x59e33f=[];var _0x37ca6a=[];var _0x490747=squel[_0x3174('0x6a')]();_0x490747[_0x3174('0x6b')](_0x3174('0x6c'))[_0x3174('0x6d')](_0x3174('0x6e'),'tq')[_0x3174('0x6f')](_0x3174('0x70'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3174('0x3d')](_0x3174('0x71'),_0x47c4be['params']['id']);for(var _0x5628aa=0x0;_0x5628aa<_0x4302de[_0x3174('0x38')];_0x5628aa+=0x1){let _0x11730c=_0x4302de[_0x5628aa];for(var _0x293545=0x0;_0x293545<_0x11730c[_0x3174('0x64')][_0x3174('0x38')];_0x293545+=0x1){let _0x3d581b=_0x11730c['Agents'][_0x293545];var _0x4e9860=_0x490747[_0x3174('0x72')]();_0x4e9860['where'](_0x3174('0x73'),_0x3d581b['id']);_0x37ca6a[_0x3174('0x74')](db[_0x3174('0x65')][_0x3174('0x33')](_0x4e9860[_0x3174('0x75')](),{'type':db[_0x3174('0x65')][_0x3174('0x76')][_0x3174('0x77')]})[_0x3174('0x28')](function(_0x9bf65){if(_0x9bf65['length']===0x1){return _0x3d581b['id'];}else{var _0xe5a58=_[_0x3174('0x78')](_[_0x3174('0x2f')](_0x9bf65,_0x3174('0x79')),function(_0x3a852f){return _['includes'](_0x4158db,_0x3a852f);});if(_0xe5a58){return _0x3d581b['id'];}}}));}}return BPromise['all'](_0x37ca6a)['then'](function(_0x2d77b8){_0x59e33f=_(_0x59e33f)['union'](_0x2d77b8)[_0x3174('0x7a')]()[_0x3174('0x7b')]();return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0x47c4be[_0x3174('0x48')]['id']}})[_0x3174('0x28')](function(_0x41b29f){return db[_0x3174('0x65')][_0x3174('0x66')](function(_0x29cafd){return _0x41b29f['removeTeams'](_0x47c4be[_0x3174('0x33')][_0x3174('0x61')],{'transaction':_0x29cafd})[_0x3174('0x28')](function(){if(!_['isEmpty'](_0x59e33f)){return _0x41b29f[_0x3174('0x7c')](_0x59e33f,{'transaction':_0x29cafd});}})[_0x3174('0x28')](function(){_0x59e33f[_0x3174('0x7d')](function(_0x34270f){socket[_0x3174('0x7e')](_0x3174('0x7f'),{'UserId':_0x34270f,'WhatsappQueueId':_0x41b29f['id']});});});});});});})[_0x3174('0x28')](respondWithStatusCode(_0x53976c,null))[_0x3174('0x46')](handleError(_0x53976c,null));};exports[_0x3174('0x80')]=function(_0x76f959,_0x42513b,_0x384665){return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0x76f959[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x42513b,null))[_0x3174('0x28')](function(_0x594b70){if(_0x594b70){return _0x594b70[_0x3174('0x80')](_0x76f959[_0x3174('0x50')]['ids'],_['omit'](_0x76f959[_0x3174('0x50')],[_0x3174('0x61'),'id'])||{})[_0x3174('0x81')](function(_0x2cdb73){for(var _0x350402=0x0;_0x350402<_0x76f959['body'][_0x3174('0x61')]['length'];_0x350402+=0x1){socket[_0x3174('0x7e')]('userWhatsappQueue:save',{'UserId':Number(_0x76f959[_0x3174('0x50')][_0x3174('0x61')][_0x350402]),'WhatsappQueueId':Number(_0x76f959[_0x3174('0x48')]['id'])});}return _0x2cdb73;});}})[_0x3174('0x28')](respondWithResult(_0x42513b,null))[_0x3174('0x46')](handleError(_0x42513b,null));};exports[_0x3174('0x7c')]=function(_0x3b042d,_0x358eb4,_0x458087){return db[_0x3174('0x43')]['find']({'where':{'id':_0x3b042d[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x358eb4,null))[_0x3174('0x28')](function(_0x3bb73a){if(_0x3bb73a){return _0x3bb73a[_0x3174('0x7c')](_0x3b042d[_0x3174('0x33')]['ids'])[_0x3174('0x28')](function(){if(_[_0x3174('0x82')](_0x3b042d[_0x3174('0x33')][_0x3174('0x61')])){for(var _0x37f00f=0x0;_0x37f00f<_0x3b042d[_0x3174('0x33')][_0x3174('0x61')]['length'];_0x37f00f+=0x1){socket[_0x3174('0x7e')](_0x3174('0x7f'),{'UserId':Number(_0x3b042d[_0x3174('0x33')][_0x3174('0x61')][_0x37f00f]),'WhatsappQueueId':Number(_0x3b042d[_0x3174('0x48')]['id'])});}}else{socket[_0x3174('0x7e')](_0x3174('0x7f'),{'UserId':Number(_0x3b042d['query']['ids']),'WhatsappQueueId':Number(_0x3b042d[_0x3174('0x48')]['id'])});}});}})[_0x3174('0x28')](respondWithStatusCode(_0x358eb4,null))[_0x3174('0x46')](handleError(_0x358eb4,null));};exports[_0x3174('0x83')]=function(_0x3cdf83,_0x39112d,_0x19fd75){var _0x74d66f={};var _0x3bc522={};var _0x119e2b;var _0x53f774;return db[_0x3174('0x43')][_0x3174('0x52')]({'where':{'id':_0x3cdf83[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x39112d,null))[_0x3174('0x28')](function(_0x112772){if(_0x112772){_0x119e2b=_0x112772;_0x3bc522[_0x3174('0x32')]=_[_0x3174('0x49')](db[_0x3174('0x57')][_0x3174('0x30')]);_0x3bc522[_0x3174('0x33')]=_[_0x3174('0x49')](_0x3cdf83['query']);_0x3bc522[_0x3174('0x34')]=_['intersection'](_0x3bc522[_0x3174('0x32')],_0x3bc522[_0x3174('0x33')]);_0x74d66f[_0x3174('0x36')]=_[_0x3174('0x35')](_0x3bc522['model'],qs[_0x3174('0x37')](_0x3cdf83['query']['fields']));_0x74d66f[_0x3174('0x36')]=_0x74d66f['attributes'][_0x3174('0x38')]?_0x74d66f['attributes']:_0x3bc522[_0x3174('0x32')];_0x74d66f[_0x3174('0x3b')]=qs['sort'](_0x3cdf83['query']['sort']);_0x74d66f[_0x3174('0x3d')]=qs[_0x3174('0x34')](_[_0x3174('0x54')](_0x3cdf83['query'],_0x3bc522[_0x3174('0x34')]));if(_0x3cdf83[_0x3174('0x33')][_0x3174('0x3e')]){_0x74d66f[_0x3174('0x3d')]=_['merge'](_0x74d66f[_0x3174('0x3d')],{'$or':_['map'](_0x74d66f['attributes'],function(_0x25396d){var _0x5b9414={};_0x5b9414[_0x25396d]={'$like':'%'+_0x3cdf83[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x5b9414;})});}_0x74d66f=_['merge']({},_0x74d66f,_0x3cdf83[_0x3174('0x42')]);return _0x119e2b[_0x3174('0x83')](_0x74d66f);}})['then'](function(_0x424091){if(_0x424091){_0x53f774=_0x424091[_0x3174('0x38')];if(!_0x3cdf83[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x74d66f[_0x3174('0x1f')]=qs['limit'](_0x3cdf83['query'][_0x3174('0x1f')]);_0x74d66f['offset']=qs['offset'](_0x3cdf83[_0x3174('0x33')][_0x3174('0x1e')]);}return _0x119e2b['getAgents'](_0x74d66f);}})['then'](function(_0x19c259){if(_0x19c259){return _0x19c259?{'count':_0x53f774,'rows':_0x19c259}:null;}})[_0x3174('0x28')](respondWithResult(_0x39112d,null))[_0x3174('0x46')](handleError(_0x39112d,null));}; \ No newline at end of file +var _0x68c3=['ids','Team','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','forEach','userWhatsappQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','update','then','destroy','get','WhatsappQueues','name','send','WhatsappQueue','rawAttributes','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','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','describe','getMembers','UserWhatsappQueue','User','findAndCountAll','agent','createdAt','%s/%s','SIP','whatsappPause','updatedAt','getTeams','findOne','addTeams'];(function(_0x96cc16,_0x5d27d6){var _0x42d571=function(_0x3ac280){while(--_0x3ac280){_0x96cc16['push'](_0x96cc16['shift']());}};_0x42d571(++_0x5d27d6);}(_0x68c3,0x1da));var _0x368c=function(_0x161ac3,_0x142e49){_0x161ac3=_0x161ac3-0x0;var _0x3bb837=_0x68c3[_0x161ac3];return _0x3bb837;};'use strict';var emlformat=require(_0x368c('0x0'));var rimraf=require(_0x368c('0x1'));var zipdir=require(_0x368c('0x2'));var jsonpatch=require(_0x368c('0x3'));var rp=require(_0x368c('0x4'));var moment=require(_0x368c('0x5'));var BPromise=require(_0x368c('0x6'));var Mustache=require(_0x368c('0x7'));var util=require(_0x368c('0x8'));var path=require('path');var sox=require(_0x368c('0x9'));var csv=require(_0x368c('0xa'));var ejs=require(_0x368c('0xb'));var fs=require('fs');var fs_extra=require(_0x368c('0xc'));var _=require(_0x368c('0xd'));var squel=require('squel');var crypto=require(_0x368c('0xe'));var jsforce=require(_0x368c('0xf'));var deskjs=require(_0x368c('0x10'));var toCsv=require(_0x368c('0xa'));var querystring=require(_0x368c('0x11'));var Papa=require(_0x368c('0x12'));var Redis=require(_0x368c('0x13'));var authService=require(_0x368c('0x14'));var qs=require(_0x368c('0x15'));var as=require(_0x368c('0x16'));var hardwareService=require(_0x368c('0x17'));var logger=require(_0x368c('0x18'))(_0x368c('0x19'));var utils=require('../../config/utils');var config=require(_0x368c('0x1a'));var licenseUtil=require(_0x368c('0x1b'));var db=require(_0x368c('0x1c'))['db'];config[_0x368c('0x1d')]=_[_0x368c('0x1e')](config[_0x368c('0x1d')],{'host':_0x368c('0x1f'),'port':0x18eb});var socket=require(_0x368c('0x20'))(new Redis(config['redis']));require(_0x368c('0x21'))[_0x368c('0x22')](socket);function respondWithStatusCode(_0xa7bbbb,_0x502f4e){_0x502f4e=_0x502f4e||0xcc;return function(_0x120729){if(_0x120729){return _0xa7bbbb[_0x368c('0x23')](_0x502f4e);}return _0xa7bbbb['status'](_0x502f4e)[_0x368c('0x24')]();};}function respondWithResult(_0x231fbb,_0x1bd2aa){_0x1bd2aa=_0x1bd2aa||0xc8;return function(_0x21c9c6){if(_0x21c9c6){return _0x231fbb['status'](_0x1bd2aa)[_0x368c('0x25')](_0x21c9c6);}};}function respondWithFilteredResult(_0x57765f,_0x3d0218){return function(_0x3ba16a){if(_0x3ba16a){var _0x232a8f=typeof _0x3d0218[_0x368c('0x26')]===_0x368c('0x27')&&typeof _0x3d0218[_0x368c('0x28')]===_0x368c('0x27');var _0x257815=_0x3ba16a['count'];var _0x3377e0=_0x232a8f?0x0:_0x3d0218['offset'];var _0x3f076c=_0x232a8f?_0x3ba16a[_0x368c('0x29')]:_0x3d0218[_0x368c('0x26')]+_0x3d0218[_0x368c('0x28')];var _0xc9ce3a;if(_0x3f076c>=_0x257815){_0x3f076c=_0x257815;_0xc9ce3a=0xc8;}else{_0xc9ce3a=0xce;}_0x57765f[_0x368c('0x2a')](_0xc9ce3a);return _0x57765f[_0x368c('0x2b')]('Content-Range',_0x3377e0+'-'+_0x3f076c+'/'+_0x257815)['json'](_0x3ba16a);}return null;};}function patchUpdates(_0x1fd21b){return function(_0x3452f6){try{jsonpatch[_0x368c('0x2c')](_0x3452f6,_0x1fd21b,!![]);}catch(_0x5bfe0c){return BPromise['reject'](_0x5bfe0c);}return _0x3452f6[_0x368c('0x2d')]();};}function saveUpdates(_0x59f594,_0x4dee48){return function(_0x44a919){if(_0x44a919){return _0x44a919[_0x368c('0x2e')](_0x59f594)[_0x368c('0x2f')](function(_0x244c35){return _0x244c35;});}return null;};}function removeEntity(_0x5411a2,_0x695d78){return function(_0xf9f4a2){if(_0xf9f4a2){return _0xf9f4a2[_0x368c('0x30')]()[_0x368c('0x2f')](function(){var _0x18bfb7=_0xf9f4a2[_0x368c('0x31')]({'plain':!![]});var _0x4f56c2=_0x368c('0x32');return db['UserProfileResource'][_0x368c('0x30')]({'where':{'type':_0x4f56c2,'resourceId':_0x18bfb7['id']}})[_0x368c('0x2f')](function(){return _0xf9f4a2;});})[_0x368c('0x2f')](function(){_0x5411a2[_0x368c('0x2a')](0xcc)[_0x368c('0x24')]();});}};}function handleEntityNotFound(_0x1721e5,_0x3ba210){return function(_0x2f83f2){if(!_0x2f83f2){_0x1721e5['sendStatus'](0x194);}return _0x2f83f2;};}function handleError(_0x2034fb,_0x58c4d3){_0x58c4d3=_0x58c4d3||0x1f4;return function(_0xfa461a){logger['error'](_0xfa461a['stack']);if(_0xfa461a[_0x368c('0x33')]){delete _0xfa461a[_0x368c('0x33')];}_0x2034fb[_0x368c('0x2a')](_0x58c4d3)[_0x368c('0x34')](_0xfa461a);};}exports['index']=function(_0x5a6bfc,_0x4c01b0){var _0x3a3905={},_0x42a4ba={},_0x4cf10f={'count':0x0,'rows':[]};var _0x1aec74=_['map'](db[_0x368c('0x35')][_0x368c('0x36')],function(_0x23a2a6){return{'name':_0x23a2a6['fieldName'],'type':_0x23a2a6[_0x368c('0x37')][_0x368c('0x38')]};});_0x42a4ba[_0x368c('0x39')]=_[_0x368c('0x3a')](_0x1aec74,'name');_0x42a4ba['query']=_[_0x368c('0x3b')](_0x5a6bfc[_0x368c('0x3c')]);_0x42a4ba['filters']=_[_0x368c('0x3d')](_0x42a4ba['model'],_0x42a4ba[_0x368c('0x3c')]);_0x3a3905[_0x368c('0x3e')]=_[_0x368c('0x3d')](_0x42a4ba[_0x368c('0x39')],qs[_0x368c('0x3f')](_0x5a6bfc['query'][_0x368c('0x3f')]));_0x3a3905[_0x368c('0x3e')]=_0x3a3905[_0x368c('0x3e')][_0x368c('0x40')]?_0x3a3905[_0x368c('0x3e')]:_0x42a4ba['model'];if(!_0x5a6bfc[_0x368c('0x3c')][_0x368c('0x41')](_0x368c('0x42'))){_0x3a3905['limit']=qs['limit'](_0x5a6bfc[_0x368c('0x3c')][_0x368c('0x28')]);_0x3a3905[_0x368c('0x26')]=qs[_0x368c('0x26')](_0x5a6bfc[_0x368c('0x3c')][_0x368c('0x26')]);}_0x3a3905[_0x368c('0x43')]=qs['sort'](_0x5a6bfc[_0x368c('0x3c')][_0x368c('0x44')]);_0x3a3905['where']=qs['filters'](_[_0x368c('0x45')](_0x5a6bfc[_0x368c('0x3c')],_0x42a4ba[_0x368c('0x46')]),_0x1aec74);if(_0x5a6bfc[_0x368c('0x3c')][_0x368c('0x47')]){_0x3a3905[_0x368c('0x48')]=_[_0x368c('0x49')](_0x3a3905[_0x368c('0x48')],{'$or':_[_0x368c('0x3a')](_0x1aec74,function(_0x5cd48e){if(_0x5cd48e[_0x368c('0x37')]!=='VIRTUAL'){var _0x39ff8f={};_0x39ff8f[_0x5cd48e[_0x368c('0x33')]]={'$like':'%'+_0x5a6bfc[_0x368c('0x3c')][_0x368c('0x47')]+'%'};return _0x39ff8f;}})});}_0x3a3905=_[_0x368c('0x49')]({},_0x3a3905,_0x5a6bfc[_0x368c('0x4a')]);var _0x2cb038={'where':_0x3a3905[_0x368c('0x48')]};return db['WhatsappQueue'][_0x368c('0x29')](_0x2cb038)[_0x368c('0x2f')](function(_0x4e098d){_0x4cf10f['count']=_0x4e098d;if(_0x5a6bfc[_0x368c('0x3c')][_0x368c('0x4b')]){_0x3a3905[_0x368c('0x4c')]=[{'all':!![]}];}return db[_0x368c('0x35')][_0x368c('0x4d')](_0x3a3905);})[_0x368c('0x2f')](function(_0x123ef7){_0x4cf10f[_0x368c('0x4e')]=_0x123ef7;return _0x4cf10f;})[_0x368c('0x2f')](respondWithFilteredResult(_0x4c01b0,_0x3a3905))[_0x368c('0x4f')](handleError(_0x4c01b0,null));};exports['show']=function(_0x74813c,_0x1a06ac){var _0x9c287a={'raw':!![],'where':{'id':_0x74813c[_0x368c('0x50')]['id']}},_0x454b26={};_0x454b26[_0x368c('0x39')]=_['keys'](db['WhatsappQueue'][_0x368c('0x36')]);_0x454b26[_0x368c('0x3c')]=_[_0x368c('0x3b')](_0x74813c[_0x368c('0x3c')]);_0x454b26[_0x368c('0x46')]=_[_0x368c('0x3d')](_0x454b26[_0x368c('0x39')],_0x454b26[_0x368c('0x3c')]);_0x9c287a[_0x368c('0x3e')]=_['intersection'](_0x454b26[_0x368c('0x39')],qs[_0x368c('0x3f')](_0x74813c[_0x368c('0x3c')][_0x368c('0x3f')]));_0x9c287a[_0x368c('0x3e')]=_0x9c287a[_0x368c('0x3e')]['length']?_0x9c287a['attributes']:_0x454b26[_0x368c('0x39')];if(_0x74813c['query'][_0x368c('0x4b')]){_0x9c287a[_0x368c('0x4c')]=[{'all':!![]}];}_0x9c287a=_[_0x368c('0x49')]({},_0x9c287a,_0x74813c[_0x368c('0x4a')]);return db[_0x368c('0x35')][_0x368c('0x51')](_0x9c287a)[_0x368c('0x2f')](handleEntityNotFound(_0x1a06ac,null))[_0x368c('0x2f')](respondWithResult(_0x1a06ac,null))[_0x368c('0x4f')](handleError(_0x1a06ac,null));};exports[_0x368c('0x52')]=function(_0x2709e7,_0x324112){return db['WhatsappQueue'][_0x368c('0x52')](_0x2709e7[_0x368c('0x53')],{})[_0x368c('0x2f')](function(_0x3c4756){var _0x24d207=_0x2709e7[_0x368c('0x54')]['get']({'plain':!![]});if(!_0x24d207)throw new Error(_0x368c('0x55'));if(_0x24d207[_0x368c('0x56')]===_0x368c('0x54')){var _0x4511b8=_0x3c4756[_0x368c('0x31')]({'plain':!![]});var _0xbbff47='WhatsappQueues';return db[_0x368c('0x57')][_0x368c('0x51')]({'where':{'name':_0xbbff47,'userProfileId':_0x24d207[_0x368c('0x58')]},'raw':!![]})[_0x368c('0x2f')](function(_0x4e6b7b){if(_0x4e6b7b&&_0x4e6b7b[_0x368c('0x59')]===0x0){return db[_0x368c('0x5a')][_0x368c('0x52')]({'name':_0x4511b8['name'],'resourceId':_0x4511b8['id'],'type':_0x4e6b7b[_0x368c('0x33')],'sectionId':_0x4e6b7b['id']},{})[_0x368c('0x2f')](function(){return _0x3c4756;});}else{return _0x3c4756;}})[_0x368c('0x4f')](function(_0x5e621c){logger['error'](_0x368c('0x5b'),_0x5e621c);throw _0x5e621c;});}return _0x3c4756;})['then'](respondWithResult(_0x324112,0xc9))[_0x368c('0x4f')](handleError(_0x324112,null));};exports['update']=function(_0x586d3d,_0x1f817c){if(_0x586d3d[_0x368c('0x53')]['id']){delete _0x586d3d['body']['id'];}return db[_0x368c('0x35')][_0x368c('0x51')]({'where':{'id':_0x586d3d[_0x368c('0x50')]['id']}})[_0x368c('0x2f')](handleEntityNotFound(_0x1f817c,null))[_0x368c('0x2f')](saveUpdates(_0x586d3d['body'],null))['then'](respondWithResult(_0x1f817c,null))[_0x368c('0x4f')](handleError(_0x1f817c,null));};exports[_0x368c('0x30')]=function(_0x58cc8f,_0x14dc26){return db[_0x368c('0x35')][_0x368c('0x51')]({'where':{'id':_0x58cc8f[_0x368c('0x50')]['id']}})[_0x368c('0x2f')](handleEntityNotFound(_0x14dc26,null))[_0x368c('0x2f')](removeEntity(_0x14dc26,null))[_0x368c('0x4f')](handleError(_0x14dc26,null));};exports['describe']=function(_0x233b8d,_0x3603a5){return db[_0x368c('0x35')][_0x368c('0x5c')]()[_0x368c('0x2f')](respondWithResult(_0x3603a5,null))['catch'](handleError(_0x3603a5,null));};exports[_0x368c('0x5d')]=function(_0x4ba82a,_0x29f992,_0x2e7861){var _0x9af92b={'raw':!![],'where':{}},_0xf2943a={},_0x553659;return db[_0x368c('0x35')]['findOne']({'where':{'id':_0x4ba82a[_0x368c('0x50')]['id']}})[_0x368c('0x2f')](handleEntityNotFound(_0x29f992,null))[_0x368c('0x2f')](function(_0x12f085){if(_0x12f085){_0x553659=_0x12f085[_0x368c('0x31')]({'plain':!![]});_0xf2943a[_0x368c('0x39')]=_[_0x368c('0x3b')](db[_0x368c('0x5e')][_0x368c('0x36')]);_0xf2943a['query']=_['keys'](_0x4ba82a[_0x368c('0x3c')]);_0xf2943a[_0x368c('0x46')]=_[_0x368c('0x3d')](_0xf2943a[_0x368c('0x39')],_0xf2943a['query']);_0x9af92b[_0x368c('0x3e')]=_['intersection'](_0xf2943a[_0x368c('0x39')],qs[_0x368c('0x3f')](_0x4ba82a[_0x368c('0x3c')][_0x368c('0x3f')]));_0x9af92b[_0x368c('0x3e')]=_0x9af92b[_0x368c('0x3e')]['length']?_0x9af92b[_0x368c('0x3e')]:_0xf2943a[_0x368c('0x39')];if(!_0x4ba82a[_0x368c('0x3c')][_0x368c('0x41')](_0x368c('0x42'))){_0x9af92b['limit']=qs[_0x368c('0x28')](_0x4ba82a[_0x368c('0x3c')][_0x368c('0x28')]);_0x9af92b[_0x368c('0x26')]=qs['offset'](_0x4ba82a[_0x368c('0x3c')][_0x368c('0x26')]);}_0x9af92b[_0x368c('0x43')]=qs['sort'](_0x4ba82a['query'][_0x368c('0x44')]);_0x9af92b[_0x368c('0x48')]=qs[_0x368c('0x46')](_[_0x368c('0x45')](_0x4ba82a['query'],_0xf2943a[_0x368c('0x46')]));_0x9af92b[_0x368c('0x48')]['WhatsappQueueId']=_0x12f085['id'];if(_0x4ba82a['query'][_0x368c('0x47')]){_0x9af92b[_0x368c('0x48')]=_[_0x368c('0x49')](_0x9af92b[_0x368c('0x48')],{'$or':_['map'](_0x9af92b['attributes'],function(_0x47694e){var _0x265527={};_0x265527[_0x47694e]={'$like':'%'+_0x4ba82a['query'][_0x368c('0x47')]+'%'};return _0x265527;})});}_0x9af92b=_['merge']({},_0x9af92b,_0x4ba82a[_0x368c('0x4a')]);return db[_0x368c('0x5e')][_0x368c('0x4d')](_0x9af92b);}})[_0x368c('0x2f')](function(_0x2f2240){if(_0x2f2240){return db[_0x368c('0x5f')][_0x368c('0x60')]({'where':{'id':_['map'](_0x2f2240,'UserId'),'role':_0x368c('0x61')},'attributes':['id',_0x368c('0x33'),'whatsappPause','updatedAt',_0x368c('0x62')]});}})['then'](function(_0x333f5b){if(_0x333f5b){return{'count':_0x333f5b[_0x368c('0x29')],'rows':_[_0x368c('0x3a')](_0x333f5b[_0x368c('0x4e')],function(_0x40f7a6){return{'membername':_0x40f7a6['name'],'UserId':_0x40f7a6['id'],'queue_name':_0x553659[_0x368c('0x33')],'WhatsappQueueId':_0x553659['id'],'interface':util['format'](_0x368c('0x63'),_0x368c('0x64'),_0x40f7a6[_0x368c('0x33')]),'penalty':0x0,'paused':_0x40f7a6[_0x368c('0x65')],'createdAt':_0x40f7a6[_0x368c('0x62')],'updatedAt':_0x40f7a6[_0x368c('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x368c('0x2f')](respondWithFilteredResult(_0x29f992,_0x9af92b))[_0x368c('0x4f')](handleError(_0x29f992,null));};exports[_0x368c('0x67')]=function(_0x3518ec,_0x22afb6,_0x45b09a){var _0x52fa42={};var _0x279779={};var _0x4c1868;var _0x18ab5e;return db['WhatsappQueue'][_0x368c('0x68')]({'where':{'id':_0x3518ec[_0x368c('0x50')]['id']}})['then'](handleEntityNotFound(_0x22afb6,null))[_0x368c('0x2f')](function(_0x280ab1){if(_0x280ab1){_0x4c1868=_0x280ab1;_0x279779[_0x368c('0x39')]=_['keys'](db['Team'][_0x368c('0x36')]);_0x279779[_0x368c('0x3c')]=_[_0x368c('0x3b')](_0x3518ec[_0x368c('0x3c')]);_0x279779['filters']=_[_0x368c('0x3d')](_0x279779[_0x368c('0x39')],_0x279779['query']);_0x52fa42['attributes']=_['intersection'](_0x279779['model'],qs['fields'](_0x3518ec[_0x368c('0x3c')][_0x368c('0x3f')]));_0x52fa42['attributes']=_0x52fa42[_0x368c('0x3e')][_0x368c('0x40')]?_0x52fa42[_0x368c('0x3e')]:_0x279779[_0x368c('0x39')];_0x52fa42[_0x368c('0x43')]=qs[_0x368c('0x44')](_0x3518ec['query'][_0x368c('0x44')]);_0x52fa42[_0x368c('0x48')]=qs[_0x368c('0x46')](_[_0x368c('0x45')](_0x3518ec['query'],_0x279779[_0x368c('0x46')]));if(_0x3518ec[_0x368c('0x3c')][_0x368c('0x47')]){_0x52fa42[_0x368c('0x48')]=_['merge'](_0x52fa42[_0x368c('0x48')],{'$or':_[_0x368c('0x3a')](_0x52fa42[_0x368c('0x3e')],function(_0x37f032){var _0x1c13e5={};_0x1c13e5[_0x37f032]={'$like':'%'+_0x3518ec[_0x368c('0x3c')][_0x368c('0x47')]+'%'};return _0x1c13e5;})});}_0x52fa42=_[_0x368c('0x49')]({},_0x52fa42,_0x3518ec[_0x368c('0x4a')]);return _0x4c1868[_0x368c('0x67')](_0x52fa42);}})['then'](function(_0x146c02){if(_0x146c02){_0x18ab5e=_0x146c02['length'];if(!_0x3518ec[_0x368c('0x3c')][_0x368c('0x41')](_0x368c('0x42'))){_0x52fa42[_0x368c('0x28')]=qs[_0x368c('0x28')](_0x3518ec['query']['limit']);_0x52fa42[_0x368c('0x26')]=qs['offset'](_0x3518ec[_0x368c('0x3c')][_0x368c('0x26')]);}return _0x4c1868['getTeams'](_0x52fa42);}})[_0x368c('0x2f')](function(_0x350b49){if(_0x350b49){return _0x350b49?{'count':_0x18ab5e,'rows':_0x350b49}:null;}})['then'](respondWithResult(_0x22afb6,null))[_0x368c('0x4f')](handleError(_0x22afb6,null));};exports[_0x368c('0x69')]=function(_0x4faa42,_0x739433,_0x448c76){var _0x3a18fd=_0x4faa42[_0x368c('0x53')][_0x368c('0x6a')];return db[_0x368c('0x6b')][_0x368c('0x4d')]({'where':{'id':_0x3a18fd},'attributes':['id'],'include':[{'model':db[_0x368c('0x5f')],'as':_0x368c('0x6c'),'attributes':['id','name',_0x368c('0x6d'),_0x368c('0x6e'),'interface'],'raw':!![]}]})[_0x368c('0x2f')](function(_0x48b0f5){if(_0x48b0f5){var _0x2b3aa2=_[_0x368c('0x6f')](_0x48b0f5,function(_0x4ed5f7){var _0x17ad7f=_0x4ed5f7['get']({'plain':!![]});return _0x17ad7f['Agents'];});return db[_0x368c('0x35')]['find']({'where':{'id':_0x4faa42[_0x368c('0x50')]['id']}})['then'](function(_0x4b0da0){return db[_0x368c('0x70')]['transaction'](function(_0x59b1ea){return _0x4b0da0[_0x368c('0x69')](_0x3a18fd,{'transaction':_0x59b1ea})[_0x368c('0x2f')](function(){return BPromise[_0x368c('0x71')](_0x2b3aa2,function(_0x56b6f0){return db[_0x368c('0x5e')][_0x368c('0x72')]({'where':{'UserId':_0x56b6f0['id'],'WhatsappQueueId':_0x4faa42[_0x368c('0x50')]['id']},'transaction':_0x59b1ea});});})[_0x368c('0x2f')](function(){_0x2b3aa2['forEach'](function(_0x362130){socket[_0x368c('0x73')](_0x368c('0x74'),{'UserId':_0x362130['id'],'WhatsappQueueId':_0x4b0da0['id']});});});});});}})[_0x368c('0x2f')](respondWithStatusCode(_0x739433,null))['catch'](handleError(_0x739433,null));};exports[_0x368c('0x75')]=function(_0xa3751b,_0x364281,_0x55795b){return db['Team'][_0x368c('0x4d')]({'where':{'id':_0xa3751b['query'][_0x368c('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x368c('0x5f')],'as':_0x368c('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x368c('0x2f')](handleEntityNotFound(_0x364281,null))['then'](function(_0x4e4b7b){var _0x907d44=_['map'](_0x4e4b7b,'id');var _0x15ff9f=[];var _0x14ce22=[];var _0x239645=squel[_0x368c('0x76')]();_0x239645['field'](_0x368c('0x77'))[_0x368c('0x78')](_0x368c('0x79'),'tq')[_0x368c('0x7a')](_0x368c('0x7b'),'ut',_0x368c('0x7c'))['where'](_0x368c('0x7d'),_0xa3751b[_0x368c('0x50')]['id']);for(var _0x1865f1=0x0;_0x1865f1<_0x4e4b7b['length'];_0x1865f1+=0x1){let _0x42efcd=_0x4e4b7b[_0x1865f1];for(var _0x574902=0x0;_0x574902<_0x42efcd[_0x368c('0x6c')][_0x368c('0x40')];_0x574902+=0x1){let _0x21668e=_0x42efcd[_0x368c('0x6c')][_0x574902];var _0x4fa236=_0x239645['clone']();_0x4fa236[_0x368c('0x48')](_0x368c('0x7e'),_0x21668e['id']);_0x14ce22[_0x368c('0x7f')](db['sequelize'][_0x368c('0x3c')](_0x4fa236['toString'](),{'type':db[_0x368c('0x70')]['QueryTypes'][_0x368c('0x80')]})[_0x368c('0x2f')](function(_0x258cce){if(_0x258cce[_0x368c('0x40')]===0x1){return _0x21668e['id'];}else{var _0x151257=_[_0x368c('0x81')](_[_0x368c('0x3a')](_0x258cce,_0x368c('0x82')),function(_0x2ebab4){return _[_0x368c('0x83')](_0x907d44,_0x2ebab4);});if(_0x151257){return _0x21668e['id'];}}}));}}return BPromise[_0x368c('0x84')](_0x14ce22)['then'](function(_0x5b9e09){_0x15ff9f=_(_0x15ff9f)[_0x368c('0x85')](_0x5b9e09)[_0x368c('0x86')]()[_0x368c('0x87')]();return db[_0x368c('0x35')][_0x368c('0x51')]({'where':{'id':_0xa3751b[_0x368c('0x50')]['id']}})[_0x368c('0x2f')](function(_0x5bcfc1){return db[_0x368c('0x70')][_0x368c('0x88')](function(_0x1a190e){return _0x5bcfc1[_0x368c('0x75')](_0xa3751b[_0x368c('0x3c')][_0x368c('0x6a')],{'transaction':_0x1a190e})['then'](function(){if(!_[_0x368c('0x89')](_0x15ff9f)){return _0x5bcfc1['removeAgents'](_0x15ff9f,{'transaction':_0x1a190e});}})[_0x368c('0x2f')](function(){_0x15ff9f[_0x368c('0x8a')](function(_0x1a2882){socket['emit'](_0x368c('0x8b'),{'UserId':_0x1a2882,'WhatsappQueueId':_0x5bcfc1['id']});});});});});});})['then'](respondWithStatusCode(_0x364281,null))[_0x368c('0x4f')](handleError(_0x364281,null));};exports[_0x368c('0x8c')]=function(_0x5b5595,_0x3e994a,_0x400987){return db[_0x368c('0x35')][_0x368c('0x51')]({'where':{'id':_0x5b5595[_0x368c('0x50')]['id']}})['then'](handleEntityNotFound(_0x3e994a,null))[_0x368c('0x2f')](function(_0x114ee7){if(_0x114ee7){return _0x114ee7['addAgents'](_0x5b5595[_0x368c('0x53')][_0x368c('0x6a')],_['omit'](_0x5b5595[_0x368c('0x53')],['ids','id'])||{})[_0x368c('0x8d')](function(_0x367d00){for(var _0xdb3598=0x0;_0xdb3598<_0x5b5595[_0x368c('0x53')][_0x368c('0x6a')][_0x368c('0x40')];_0xdb3598+=0x1){socket[_0x368c('0x73')](_0x368c('0x74'),{'UserId':Number(_0x5b5595[_0x368c('0x53')][_0x368c('0x6a')][_0xdb3598]),'WhatsappQueueId':Number(_0x5b5595[_0x368c('0x50')]['id'])});}return _0x367d00;});}})[_0x368c('0x2f')](respondWithResult(_0x3e994a,null))['catch'](handleError(_0x3e994a,null));};exports['removeAgents']=function(_0x3efa99,_0x37a18e,_0x26a25d){return db['WhatsappQueue'][_0x368c('0x51')]({'where':{'id':_0x3efa99[_0x368c('0x50')]['id']}})[_0x368c('0x2f')](handleEntityNotFound(_0x37a18e,null))['then'](function(_0x37d865){if(_0x37d865){return _0x37d865[_0x368c('0x8e')](_0x3efa99[_0x368c('0x3c')][_0x368c('0x6a')])[_0x368c('0x2f')](function(){if(_[_0x368c('0x8f')](_0x3efa99[_0x368c('0x3c')][_0x368c('0x6a')])){for(var _0x14778c=0x0;_0x14778c<_0x3efa99[_0x368c('0x3c')][_0x368c('0x6a')][_0x368c('0x40')];_0x14778c+=0x1){socket[_0x368c('0x73')](_0x368c('0x8b'),{'UserId':Number(_0x3efa99[_0x368c('0x3c')]['ids'][_0x14778c]),'WhatsappQueueId':Number(_0x3efa99[_0x368c('0x50')]['id'])});}}else{socket[_0x368c('0x73')](_0x368c('0x8b'),{'UserId':Number(_0x3efa99[_0x368c('0x3c')][_0x368c('0x6a')]),'WhatsappQueueId':Number(_0x3efa99[_0x368c('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x37a18e,null))[_0x368c('0x4f')](handleError(_0x37a18e,null));};exports['getAgents']=function(_0x1fd209,_0x2406ca,_0x1249f8){var _0x22c9ff={};var _0x5689a5={};var _0x2eda88;var _0x49f37c;return db[_0x368c('0x35')]['findOne']({'where':{'id':_0x1fd209[_0x368c('0x50')]['id']}})[_0x368c('0x2f')](handleEntityNotFound(_0x2406ca,null))[_0x368c('0x2f')](function(_0x4d1316){if(_0x4d1316){_0x2eda88=_0x4d1316;_0x5689a5[_0x368c('0x39')]=_['keys'](db[_0x368c('0x5f')][_0x368c('0x36')]);_0x5689a5['query']=_[_0x368c('0x3b')](_0x1fd209[_0x368c('0x3c')]);_0x5689a5[_0x368c('0x46')]=_[_0x368c('0x3d')](_0x5689a5[_0x368c('0x39')],_0x5689a5[_0x368c('0x3c')]);_0x22c9ff['attributes']=_['intersection'](_0x5689a5[_0x368c('0x39')],qs['fields'](_0x1fd209[_0x368c('0x3c')][_0x368c('0x3f')]));_0x22c9ff[_0x368c('0x3e')]=_0x22c9ff[_0x368c('0x3e')][_0x368c('0x40')]?_0x22c9ff['attributes']:_0x5689a5['model'];_0x22c9ff['order']=qs[_0x368c('0x44')](_0x1fd209[_0x368c('0x3c')][_0x368c('0x44')]);_0x22c9ff[_0x368c('0x48')]=qs['filters'](_[_0x368c('0x45')](_0x1fd209[_0x368c('0x3c')],_0x5689a5['filters']));if(_0x1fd209['query'][_0x368c('0x47')]){_0x22c9ff['where']=_[_0x368c('0x49')](_0x22c9ff[_0x368c('0x48')],{'$or':_['map'](_0x22c9ff[_0x368c('0x3e')],function(_0x8f7da3){var _0x2624d3={};_0x2624d3[_0x8f7da3]={'$like':'%'+_0x1fd209[_0x368c('0x3c')][_0x368c('0x47')]+'%'};return _0x2624d3;})});}_0x22c9ff=_[_0x368c('0x49')]({},_0x22c9ff,_0x1fd209['options']);return _0x2eda88[_0x368c('0x90')](_0x22c9ff);}})['then'](function(_0x1954c5){if(_0x1954c5){_0x49f37c=_0x1954c5[_0x368c('0x40')];if(!_0x1fd209['query'][_0x368c('0x41')](_0x368c('0x42'))){_0x22c9ff[_0x368c('0x28')]=qs['limit'](_0x1fd209['query'][_0x368c('0x28')]);_0x22c9ff[_0x368c('0x26')]=qs['offset'](_0x1fd209[_0x368c('0x3c')][_0x368c('0x26')]);}return _0x2eda88[_0x368c('0x90')](_0x22c9ff);}})['then'](function(_0x146ad3){if(_0x146ad3){return _0x146ad3?{'count':_0x49f37c,'rows':_0x146ad3}:null;}})[_0x368c('0x2f')](respondWithResult(_0x2406ca,null))[_0x368c('0x4f')](handleError(_0x2406ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 8a3e8ce..f4549c4 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 _0x6cea=['hasOwnProperty','exports','events','WhatsappQueue','save','update','remove','emit'];(function(_0x1fd675,_0x587658){var _0x521d1c=function(_0x2d16e0){while(--_0x2d16e0){_0x1fd675['push'](_0x1fd675['shift']());}};_0x521d1c(++_0x587658);}(_0x6cea,0xd2));var _0xa6ce=function(_0x4f5fc4,_0x1e4ba8){_0x4f5fc4=_0x4f5fc4-0x0;var _0x3f9b69=_0x6cea[_0x4f5fc4];return _0x3f9b69;};'use strict';var EventEmitter=require(_0xa6ce('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xa6ce('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6ce('0x2'),'afterUpdate':_0xa6ce('0x3'),'afterDestroy':_0xa6ce('0x4')};function emitEvent(_0x2555b7){return function(_0x288884,_0x3303e5,_0x4c47a9){WhatsappQueueEvents[_0xa6ce('0x5')](_0x2555b7+':'+_0x288884['id'],_0x288884);WhatsappQueueEvents[_0xa6ce('0x5')](_0x2555b7,_0x288884);_0x4c47a9(null);};}for(var e in events){if(events[_0xa6ce('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xa6ce('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x318f=['save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x181b4c,_0x1265bc){var _0x2b8ebb=function(_0x4370de){while(--_0x4370de){_0x181b4c['push'](_0x181b4c['shift']());}};_0x2b8ebb(++_0x1265bc);}(_0x318f,0xac));var _0xf318=function(_0x594b66,_0x2e2bd2){_0x594b66=_0x594b66-0x0;var _0x5a6e57=_0x318f[_0x594b66];return _0x5a6e57;};'use strict';var EventEmitter=require(_0xf318('0x0'));var WhatsappQueue=require(_0xf318('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf318('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4bb2e7){return function(_0x43c688,_0x155ba7,_0x2f9149){WhatsappQueueEvents['emit'](_0x4bb2e7+':'+_0x43c688['id'],_0x43c688);WhatsappQueueEvents[_0xf318('0x3')](_0x4bb2e7,_0x43c688);_0x2f9149(null);};}for(var e in events){if(events[_0xf318('0x4')](e)){var event=events[e];WhatsappQueue[_0xf318('0x5')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 5938c09..33b042e 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 _0xe492=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','WhatsappQueue','whatsapp_queues'];(function(_0x673826,_0x6c57d7){var _0x349887=function(_0x1f7da2){while(--_0x1f7da2){_0x673826['push'](_0x673826['shift']());}};_0x349887(++_0x6c57d7);}(_0xe492,0x79));var _0x2e49=function(_0x34a080,_0x25be48){_0x34a080=_0x34a080-0x0;var _0x145ce4=_0xe492[_0x34a080];return _0x145ce4;};'use strict';var _=require(_0x2e49('0x0'));var util=require(_0x2e49('0x1'));var logger=require(_0x2e49('0x2'))(_0x2e49('0x3'));var moment=require(_0x2e49('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e49('0x5'));var fs=require('fs');var path=require(_0x2e49('0x6'));var rimraf=require(_0x2e49('0x7'));var config=require(_0x2e49('0x8'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x5e9445,_0x1019d9){return _0x5e9445['define'](_0x2e49('0x9'),attributes,{'tableName':_0x2e49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e6a=['WhatsappQueue','whatsapp_queues','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define'];(function(_0x197cac,_0x1af986){var _0x4a076c=function(_0x568a2c){while(--_0x568a2c){_0x197cac['push'](_0x197cac['shift']());}};_0x4a076c(++_0x1af986);}(_0x6e6a,0xfc));var _0xa6e6=function(_0xd75522,_0x36ae5d){_0xd75522=_0xd75522-0x0;var _0x135eb9=_0x6e6a[_0xd75522];return _0x135eb9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa6e6('0x0'));var moment=require(_0xa6e6('0x1'));var BPromise=require('bluebird');var rp=require(_0xa6e6('0x2'));var fs=require('fs');var path=require(_0xa6e6('0x3'));var rimraf=require(_0xa6e6('0x4'));var config=require(_0xa6e6('0x5'));var attributes=require(_0xa6e6('0x6'));module['exports']=function(_0x362666,_0x514dac){return _0x362666[_0xa6e6('0x7')](_0xa6e6('0x8'),attributes,{'tableName':_0xa6e6('0x9'),'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 3ca8aea..6603ec8 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 _0xcbd8=['stringify','code','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x43059a,_0x3cd630){var _0x104bb3=function(_0x2457c5){while(--_0x2457c5){_0x43059a['push'](_0x43059a['shift']());}};_0x104bb3(++_0x3cd630);}(_0xcbd8,0x1a3));var _0x8cbd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcbd8[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x8cbd('0x0'));var util=require('util');var moment=require(_0x8cbd('0x1'));var BPromise=require(_0x8cbd('0x2'));var rs=require(_0x8cbd('0x3'));var fs=require('fs');var Redis=require(_0x8cbd('0x4'));var db=require(_0x8cbd('0x5'))['db'];var utils=require(_0x8cbd('0x6'));var logger=require(_0x8cbd('0x7'))(_0x8cbd('0x8'));var config=require('../../config/environment');var jayson=require(_0x8cbd('0x9'));var client=jayson['client'][_0x8cbd('0xa')]({'port':0x232a});config[_0x8cbd('0xb')]=_[_0x8cbd('0xc')](config[_0x8cbd('0xb')],{'host':_0x8cbd('0xd'),'port':0x18eb});var socket=require(_0x8cbd('0xe'))(new Redis(config[_0x8cbd('0xb')]));require('./whatsappQueue.socket')[_0x8cbd('0xf')](socket);function respondWithRpcPromise(_0x26b01c,_0x282fd3,_0x191252){return new BPromise(function(_0x8f8838,_0x40b205){return client['request'](_0x26b01c,_0x191252)[_0x8cbd('0x10')](function(_0x58f4c4){logger[_0x8cbd('0x11')](_0x8cbd('0x12'),_0x282fd3,_0x8cbd('0x13'));logger[_0x8cbd('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x282fd3,_0x8cbd('0x13'),JSON[_0x8cbd('0x15')](_0x58f4c4));if(_0x58f4c4['error']){if(_0x58f4c4['error'][_0x8cbd('0x16')]===0x1f4){logger['error'](_0x8cbd('0x12'),_0x282fd3,_0x58f4c4[_0x8cbd('0x17')][_0x8cbd('0x18')]);return _0x40b205(_0x58f4c4[_0x8cbd('0x17')][_0x8cbd('0x18')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x282fd3,_0x58f4c4[_0x8cbd('0x17')]['message']);return _0x8f8838(_0x58f4c4[_0x8cbd('0x17')][_0x8cbd('0x18')]);}else{logger[_0x8cbd('0x11')](_0x8cbd('0x12'),_0x282fd3,_0x8cbd('0x13'));_0x8f8838(_0x58f4c4[_0x8cbd('0x19')][_0x8cbd('0x18')]);}})[_0x8cbd('0x1a')](function(_0xfaf163){logger[_0x8cbd('0x17')](_0x8cbd('0x12'),_0x282fd3,_0xfaf163);_0x40b205(_0xfaf163);});});}exports['GetWhatsappQueue']=function(_0xbc918f){var _0x5d1c0=this;return new Promise(function(_0x299f4d,_0x1d158c){return db['WhatsappQueue'][_0x8cbd('0x1b')]({'raw':_0xbc918f['options']?_0xbc918f[_0x8cbd('0x1c')][_0x8cbd('0x1d')]===undefined?!![]:![]:!![],'where':_0xbc918f[_0x8cbd('0x1c')]?_0xbc918f['options'][_0x8cbd('0x1e')]||null:null,'attributes':_0xbc918f['options']?_0xbc918f['options'][_0x8cbd('0x1f')]||null:null,'limit':_0xbc918f[_0x8cbd('0x1c')]?_0xbc918f[_0x8cbd('0x1c')][_0x8cbd('0x20')]||null:null,'include':_0xbc918f['options']?_0xbc918f[_0x8cbd('0x1c')][_0x8cbd('0x21')]?_['map'](_0xbc918f['options'][_0x8cbd('0x21')],function(_0x523b48){return{'model':db[_0x523b48[_0x8cbd('0x22')]],'as':_0x523b48['as'],'attributes':_0x523b48[_0x8cbd('0x1f')],'include':_0x523b48[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x523b48[_0x8cbd('0x21')],function(_0x337e39){return{'model':db[_0x337e39['model']],'as':_0x337e39['as'],'attributes':_0x337e39[_0x8cbd('0x1f')],'include':_0x337e39[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x337e39['include'],function(_0x1d20b5){return{'model':db[_0x1d20b5['model']],'as':_0x1d20b5['as'],'attributes':_0x1d20b5['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cbd('0x10')](function(_0x2fe78f){logger['info'](_0x8cbd('0x24'),_0xbc918f);logger[_0x8cbd('0x14')]('GetWhatsappQueue',_0xbc918f,JSON[_0x8cbd('0x15')](_0x2fe78f));_0x299f4d(_0x2fe78f);})[_0x8cbd('0x1a')](function(_0x4620fc){logger[_0x8cbd('0x17')](_0x8cbd('0x24'),_0x4620fc[_0x8cbd('0x18')],_0xbc918f);_0x1d158c(_0x5d1c0['error'](0x1f4,_0x4620fc[_0x8cbd('0x18')]));});});};exports[_0x8cbd('0x25')]=function(_0x229fcc){var _0x2f8df1=this;return new Promise(function(_0x2e3281,_0x13b55f){return db[_0x8cbd('0x26')][_0x8cbd('0x27')]({'raw':_0x229fcc[_0x8cbd('0x1c')]?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x1d')]===undefined?!![]:![]:!![],'where':_0x229fcc['options']?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x1e')]||null:null,'attributes':_0x229fcc[_0x8cbd('0x1c')]?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x1f')]||null:null,'include':_0x229fcc[_0x8cbd('0x1c')]?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x21')]?_['map'](_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x21')],function(_0x1fad9d){return{'model':db[_0x1fad9d['model']],'as':_0x1fad9d['as'],'attributes':_0x1fad9d[_0x8cbd('0x1f')],'include':_0x1fad9d[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x1fad9d[_0x8cbd('0x21')],function(_0x2544cc){return{'model':db[_0x2544cc['model']],'as':_0x2544cc['as'],'attributes':_0x2544cc['attributes'],'include':_0x2544cc[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x2544cc[_0x8cbd('0x21')],function(_0x451f1f){return{'model':db[_0x451f1f[_0x8cbd('0x22')]],'as':_0x451f1f['as'],'attributes':_0x451f1f[_0x8cbd('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcd71bf){logger[_0x8cbd('0x11')]('ShowWhatsappQueue',_0x229fcc);logger[_0x8cbd('0x14')](_0x8cbd('0x25'),_0x229fcc,JSON[_0x8cbd('0x15')](_0xcd71bf));_0x2e3281(_0xcd71bf);})[_0x8cbd('0x1a')](function(_0x3c1a08){logger[_0x8cbd('0x17')](_0x8cbd('0x25'),_0x3c1a08['message'],_0x229fcc);_0x13b55f(_0x2f8df1['error'](0x1f4,_0x3c1a08[_0x8cbd('0x18')]));});});}; \ No newline at end of file +var _0x4ba6=['find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','WhatsappQueue,\x20%s,\x20%s','message','catch','WhatsappQueue','raw','options','where','attributes','limit','include','map','model','GetWhatsappQueue','stringify','ShowWhatsappQueue'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0x4ba6,0x7c));var _0x64ba=function(_0x5cef48,_0x4f4b95){_0x5cef48=_0x5cef48-0x0;var _0x2486c6=_0x4ba6[_0x5cef48];return _0x2486c6;};'use strict';var _=require(_0x64ba('0x0'));var util=require(_0x64ba('0x1'));var moment=require(_0x64ba('0x2'));var BPromise=require(_0x64ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64ba('0x4'));var db=require(_0x64ba('0x5'))['db'];var utils=require(_0x64ba('0x6'));var logger=require(_0x64ba('0x7'))(_0x64ba('0x8'));var config=require(_0x64ba('0x9'));var jayson=require(_0x64ba('0xa'));var client=jayson[_0x64ba('0xb')][_0x64ba('0xc')]({'port':0x232a});config[_0x64ba('0xd')]=_[_0x64ba('0xe')](config[_0x64ba('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x64ba('0xf'))(new Redis(config[_0x64ba('0xd')]));require('./whatsappQueue.socket')[_0x64ba('0x10')](socket);function respondWithRpcPromise(_0x4470f4,_0x2d4900,_0x3069b9){return new BPromise(function(_0x244502,_0x1e04f3){return client[_0x64ba('0x11')](_0x4470f4,_0x3069b9)[_0x64ba('0x12')](function(_0x2d4e91){logger[_0x64ba('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x2d4900,_0x64ba('0x14'));logger[_0x64ba('0x15')](_0x64ba('0x16'),_0x2d4900,_0x64ba('0x14'),JSON['stringify'](_0x2d4e91));if(_0x2d4e91['error']){if(_0x2d4e91['error'][_0x64ba('0x17')]===0x1f4){logger[_0x64ba('0x18')](_0x64ba('0x19'),_0x2d4900,_0x2d4e91['error'][_0x64ba('0x1a')]);return _0x1e04f3(_0x2d4e91[_0x64ba('0x18')][_0x64ba('0x1a')]);}logger['error'](_0x64ba('0x19'),_0x2d4900,_0x2d4e91[_0x64ba('0x18')][_0x64ba('0x1a')]);return _0x244502(_0x2d4e91[_0x64ba('0x18')][_0x64ba('0x1a')]);}else{logger[_0x64ba('0x13')](_0x64ba('0x19'),_0x2d4900,_0x64ba('0x14'));_0x244502(_0x2d4e91['result'][_0x64ba('0x1a')]);}})[_0x64ba('0x1b')](function(_0x430c84){logger['error'](_0x64ba('0x19'),_0x2d4900,_0x430c84);_0x1e04f3(_0x430c84);});});}exports['GetWhatsappQueue']=function(_0x581734){var _0x5b40e7=this;return new Promise(function(_0x309393,_0x305d48){return db[_0x64ba('0x1c')]['findAll']({'raw':_0x581734['options']?_0x581734['options'][_0x64ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x581734[_0x64ba('0x1e')]?_0x581734[_0x64ba('0x1e')][_0x64ba('0x1f')]||null:null,'attributes':_0x581734[_0x64ba('0x1e')]?_0x581734[_0x64ba('0x1e')][_0x64ba('0x20')]||null:null,'limit':_0x581734[_0x64ba('0x1e')]?_0x581734[_0x64ba('0x1e')][_0x64ba('0x21')]||null:null,'include':_0x581734[_0x64ba('0x1e')]?_0x581734[_0x64ba('0x1e')][_0x64ba('0x22')]?_[_0x64ba('0x23')](_0x581734[_0x64ba('0x1e')][_0x64ba('0x22')],function(_0x3a2a16){return{'model':db[_0x3a2a16[_0x64ba('0x24')]],'as':_0x3a2a16['as'],'attributes':_0x3a2a16[_0x64ba('0x20')],'include':_0x3a2a16['include']?_[_0x64ba('0x23')](_0x3a2a16['include'],function(_0x18b5cb){return{'model':db[_0x18b5cb[_0x64ba('0x24')]],'as':_0x18b5cb['as'],'attributes':_0x18b5cb[_0x64ba('0x20')],'include':_0x18b5cb['include']?_[_0x64ba('0x23')](_0x18b5cb[_0x64ba('0x22')],function(_0x3be8dd){return{'model':db[_0x3be8dd['model']],'as':_0x3be8dd['as'],'attributes':_0x3be8dd[_0x64ba('0x20')]};}):[]};}):[]};}):[]:[]})[_0x64ba('0x12')](function(_0x2673f6){logger[_0x64ba('0x13')](_0x64ba('0x25'),_0x581734);logger[_0x64ba('0x15')](_0x64ba('0x25'),_0x581734,JSON[_0x64ba('0x26')](_0x2673f6));_0x309393(_0x2673f6);})[_0x64ba('0x1b')](function(_0x487552){logger[_0x64ba('0x18')](_0x64ba('0x25'),_0x487552['message'],_0x581734);_0x305d48(_0x5b40e7[_0x64ba('0x18')](0x1f4,_0x487552[_0x64ba('0x1a')]));});});};exports[_0x64ba('0x27')]=function(_0x533dd2){var _0x5d4e98=this;return new Promise(function(_0x41f698,_0x4575c8){return db['WhatsappQueue'][_0x64ba('0x28')]({'raw':_0x533dd2[_0x64ba('0x1e')]?_0x533dd2[_0x64ba('0x1e')][_0x64ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x533dd2[_0x64ba('0x1e')]?_0x533dd2['options'][_0x64ba('0x1f')]||null:null,'attributes':_0x533dd2['options']?_0x533dd2['options']['attributes']||null:null,'include':_0x533dd2[_0x64ba('0x1e')]?_0x533dd2[_0x64ba('0x1e')][_0x64ba('0x22')]?_['map'](_0x533dd2[_0x64ba('0x1e')]['include'],function(_0x5a2d62){return{'model':db[_0x5a2d62[_0x64ba('0x24')]],'as':_0x5a2d62['as'],'attributes':_0x5a2d62[_0x64ba('0x20')],'include':_0x5a2d62['include']?_[_0x64ba('0x23')](_0x5a2d62[_0x64ba('0x22')],function(_0x555474){return{'model':db[_0x555474['model']],'as':_0x555474['as'],'attributes':_0x555474[_0x64ba('0x20')],'include':_0x555474['include']?_[_0x64ba('0x23')](_0x555474[_0x64ba('0x22')],function(_0x4a0ece){return{'model':db[_0x4a0ece['model']],'as':_0x4a0ece['as'],'attributes':_0x4a0ece[_0x64ba('0x20')]};}):[]};}):[]};}):[]:[]})[_0x64ba('0x12')](function(_0x176df2){logger[_0x64ba('0x13')](_0x64ba('0x27'),_0x533dd2);logger[_0x64ba('0x15')](_0x64ba('0x27'),_0x533dd2,JSON[_0x64ba('0x26')](_0x176df2));_0x41f698(_0x176df2);})[_0x64ba('0x1b')](function(_0x4523e4){logger['error'](_0x64ba('0x27'),_0x4523e4[_0x64ba('0x1a')],_0x533dd2);_0x4575c8(_0x5d4e98[_0x64ba('0x18')](0x1f4,_0x4523e4['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 3e7694e..09990b1 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 _0x1a7c=['removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0xd1f310,_0x57aabb){var _0x66d97f=function(_0x44cb32){while(--_0x44cb32){_0xd1f310['push'](_0xd1f310['shift']());}};_0x66d97f(++_0x57aabb);}(_0x1a7c,0xf1));var _0xc1a7=function(_0x3d07f2,_0x19854d){_0x3d07f2=_0x3d07f2-0x0;var _0x26052a=_0x1a7c[_0x3d07f2];return _0x26052a;};'use strict';var WhatsappQueueEvents=require(_0xc1a7('0x0'));var events=[_0xc1a7('0x1'),_0xc1a7('0x2'),_0xc1a7('0x3')];function createListener(_0x1a1ffd,_0x4ada5b){return function(_0x19e960){_0x4ada5b['emit'](_0x1a1ffd,_0x19e960);};}function removeListener(_0x3788e7,_0x5eea52){return function(){WhatsappQueueEvents[_0xc1a7('0x4')](_0x3788e7,_0x5eea52);};}exports['register']=function(_0x3fcd25){for(var _0x558480=0x0,_0x1a8ba0=events[_0xc1a7('0x5')];_0x558480<_0x1a8ba0;_0x558480++){var _0x55dce7=events[_0x558480];var _0x5a24da=createListener(_0xc1a7('0x6')+_0x55dce7,_0x3fcd25);WhatsappQueueEvents['on'](_0x55dce7,_0x5a24da);}}; \ No newline at end of file +var _0x7e81=['removeListener','register','whatsappQueue:','./whatsappQueue.events','save','emit'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x7e81,0x1b3));var _0x17e8=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7e81[_0xf50820];return _0x2a9b10;};'use strict';var WhatsappQueueEvents=require(_0x17e8('0x0'));var events=[_0x17e8('0x1'),'remove','update'];function createListener(_0x3a6ed0,_0x4e50ea){return function(_0x458e9f){_0x4e50ea[_0x17e8('0x2')](_0x3a6ed0,_0x458e9f);};}function removeListener(_0x489a82,_0xb34fe){return function(){WhatsappQueueEvents[_0x17e8('0x3')](_0x489a82,_0xb34fe);};}exports[_0x17e8('0x4')]=function(_0x36ea4f){for(var _0x2acb94=0x0,_0x59dcde=events['length'];_0x2acb94<_0x59dcde;_0x2acb94++){var _0xaa0ac1=events[_0x2acb94];var _0x3f01b0=createListener(_0x17e8('0x5')+_0xaa0ac1,_0x36ea4f);WhatsappQueueEvents['on'](_0xaa0ac1,_0x3f01b0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 62bfcd0..6d64baf 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 _0x26ad=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','put','update','destroy'];(function(_0x4cd2d7,_0x18ae02){var _0x1d4fd2=function(_0x516a51){while(--_0x516a51){_0x4cd2d7['push'](_0x4cd2d7['shift']());}};_0x1d4fd2(++_0x18ae02);}(_0x26ad,0xb1));var _0xd26a=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x26ad[_0xbeb808];return _0x5d6909;};'use strict';var multer=require(_0xd26a('0x0'));var util=require('util');var path=require(_0xd26a('0x1'));var timeout=require(_0xd26a('0x2'));var express=require('express');var router=express[_0xd26a('0x3')]();var fs_extra=require(_0xd26a('0x4'));var auth=require(_0xd26a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd26a('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xd26a('0x7')]('/',auth[_0xd26a('0x8')](),controller['index']);router[_0xd26a('0x7')]('/describe',auth[_0xd26a('0x8')](),controller[_0xd26a('0x9')]);router[_0xd26a('0x7')](_0xd26a('0xa'),auth[_0xd26a('0x8')](),controller[_0xd26a('0xb')]);router['post']('/',auth[_0xd26a('0x8')](),controller['create']);router[_0xd26a('0xc')]('/:id',auth[_0xd26a('0x8')](),controller[_0xd26a('0xd')]);router['delete'](_0xd26a('0xa'),auth[_0xd26a('0x8')](),controller[_0xd26a('0xe')]);module[_0xd26a('0xf')]=router; \ No newline at end of file +var _0xb10c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0xfd1fcd,_0x3182b7){var _0x1e0646=function(_0x4f4fa4){while(--_0x4f4fa4){_0xfd1fcd['push'](_0xfd1fcd['shift']());}};_0x1e0646(++_0x3182b7);}(_0xb10c,0xd8));var _0xcb10=function(_0x5a2db8,_0x409f2a){_0x5a2db8=_0x5a2db8-0x0;var _0x28b4f8=_0xb10c[_0x5a2db8];return _0x28b4f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcb10('0x0'));var timeout=require(_0xcb10('0x1'));var express=require(_0xcb10('0x2'));var router=express[_0xcb10('0x3')]();var fs_extra=require(_0xcb10('0x4'));var auth=require(_0xcb10('0x5'));var interaction=require(_0xcb10('0x6'));var config=require(_0xcb10('0x7'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xcb10('0x8')](),controller[_0xcb10('0x9')]);router[_0xcb10('0xa')](_0xcb10('0xb'),auth[_0xcb10('0x8')](),controller[_0xcb10('0xc')]);router['get'](_0xcb10('0xd'),auth[_0xcb10('0x8')](),controller[_0xcb10('0xe')]);router['post']('/',auth[_0xcb10('0x8')](),controller[_0xcb10('0xf')]);router[_0xcb10('0x10')]('/:id',auth[_0xcb10('0x8')](),controller[_0xcb10('0x11')]);router['delete'](_0xcb10('0xd'),auth['isAuthenticated'](),controller[_0xcb10('0x12')]);module[_0xcb10('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index c4d4c29..e0bac12 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5399cd,_0x2d7c5f){var _0x47a409=function(_0x488808){while(--_0x488808){_0x5399cd['push'](_0x5399cd['shift']());}};_0x47a409(++_0x2d7c5f);}(_0x7a54,0x106));var _0x47a5=function(_0x3b992f,_0x39f461){_0x3b992f=_0x3b992f-0x0;var _0x53c8f1=_0x7a54[_0x3b992f];return _0x53c8f1;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0xd00153,_0x47e18c){var _0x1b5426=function(_0x3882ac){while(--_0x3882ac){_0xd00153['push'](_0xd00153['shift']());}};_0x1b5426(++_0x47e18c);}(_0x7a54,0x106));var _0x47a5=function(_0x12ec61,_0x569180){_0x12ec61=_0x12ec61-0x0;var _0x75408a=_0x7a54[_0x12ec61];return _0x75408a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 83f80f2..c814f23 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 _0x6f7a=['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','sendStatus','error','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x16666f,_0x214298){var _0x24593f=function(_0x345eee){while(--_0x345eee){_0x16666f['push'](_0x16666f['shift']());}};_0x24593f(++_0x214298);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x40f21f,_0x51ded7){_0x40f21f=_0x40f21f-0x0;var _0x1cd9c9=_0x6f7a[_0x40f21f];return _0x1cd9c9;};'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(){_0x2b6a84[_0xa6f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ef97,_0x402d25){return function(_0x5efdce){if(!_0x5efdce){_0x47ef97[_0xa6f7('0x23')](0x194);}return _0x5efdce;};}function handleError(_0x126d24,_0x3c79ea){_0x3c79ea=_0x3c79ea||0x1f4;return function(_0x2b4c6c){logger[_0xa6f7('0x24')](_0x2b4c6c['stack']);if(_0x2b4c6c['name']){delete _0x2b4c6c[_0xa6f7('0x25')];}_0x126d24[_0xa6f7('0x19')](_0x3c79ea)['send'](_0x2b4c6c);};}exports[_0xa6f7('0x26')]=function(_0x27babb,_0x87bccc){var _0x3a7ff9={},_0x224f5a={},_0x10bf77={'count':0x0,'rows':[]};var _0x353de8=_[_0xa6f7('0x27')](db[_0xa6f7('0x28')][_0xa6f7('0x29')],function(_0x40b0f8){return{'name':_0x40b0f8[_0xa6f7('0x2a')],'type':_0x40b0f8['type'][_0xa6f7('0x2b')]};});_0x224f5a[_0xa6f7('0x2c')]=_['map'](_0x353de8,_0xa6f7('0x25'));_0x224f5a[_0xa6f7('0x2d')]=_['keys'](_0x27babb['query']);_0x224f5a[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x224f5a[_0xa6f7('0x2c')],_0x224f5a[_0xa6f7('0x2d')]);_0x3a7ff9[_0xa6f7('0x30')]=_['intersection'](_0x224f5a['model'],qs[_0xa6f7('0x31')](_0x27babb['query'][_0xa6f7('0x31')]));_0x3a7ff9[_0xa6f7('0x30')]=_0x3a7ff9[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x3a7ff9[_0xa6f7('0x30')]:_0x224f5a[_0xa6f7('0x2c')];if(!_0x27babb['query'][_0xa6f7('0x33')](_0xa6f7('0x34'))){_0x3a7ff9[_0xa6f7('0x1d')]=qs['limit'](_0x27babb[_0xa6f7('0x2d')]['limit']);_0x3a7ff9[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x27babb[_0xa6f7('0x2d')]['offset']);}_0x3a7ff9[_0xa6f7('0x35')]=qs[_0xa6f7('0x36')](_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x36')]);_0x3a7ff9[_0xa6f7('0x37')]=qs[_0xa6f7('0x2e')](_['pick'](_0x27babb[_0xa6f7('0x2d')],_0x224f5a[_0xa6f7('0x2e')]),_0x353de8);if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]){_0x3a7ff9[_0xa6f7('0x37')]=_[_0xa6f7('0x39')](_0x3a7ff9[_0xa6f7('0x37')],{'$or':_[_0xa6f7('0x27')](_0x353de8,function(_0x4c2d2e){if(_0x4c2d2e[_0xa6f7('0x3a')]!==_0xa6f7('0x3b')){var _0x353e54={};_0x353e54[_0x4c2d2e['name']]={'$like':'%'+_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]+'%'};return _0x353e54;}})});}_0x3a7ff9=_['merge']({},_0x3a7ff9,_0x27babb[_0xa6f7('0x3c')]);var _0x13c7c4={'where':_0x3a7ff9[_0xa6f7('0x37')]};return db[_0xa6f7('0x28')][_0xa6f7('0x1f')](_0x13c7c4)['then'](function(_0x2e3eb2){_0x10bf77[_0xa6f7('0x1f')]=_0x2e3eb2;if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x3a7ff9[_0xa6f7('0x3e')]=[{'all':!![]}];}return db[_0xa6f7('0x28')][_0xa6f7('0x3f')](_0x3a7ff9);})[_0xa6f7('0x40')](function(_0x5646b9){_0x10bf77['rows']=_0x5646b9;return _0x10bf77;})[_0xa6f7('0x40')](respondWithFilteredResult(_0x87bccc,_0x3a7ff9))[_0xa6f7('0x41')](handleError(_0x87bccc,null));};exports[_0xa6f7('0x42')]=function(_0x2546a3,_0x2ac07f){var _0x387714={'raw':!![],'where':{'id':_0x2546a3[_0xa6f7('0x43')]['id']}},_0x21fdd7={};_0x21fdd7[_0xa6f7('0x2c')]=_[_0xa6f7('0x44')](db['WhatsappQueueReport'][_0xa6f7('0x29')]);_0x21fdd7[_0xa6f7('0x2d')]=_['keys'](_0x2546a3[_0xa6f7('0x2d')]);_0x21fdd7[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x21fdd7[_0xa6f7('0x2c')],_0x21fdd7['query']);_0x387714[_0xa6f7('0x30')]=_['intersection'](_0x21fdd7['model'],qs[_0xa6f7('0x31')](_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x31')]));_0x387714[_0xa6f7('0x30')]=_0x387714[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x387714[_0xa6f7('0x30')]:_0x21fdd7['model'];if(_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x387714['include']=[{'all':!![]}];}_0x387714=_[_0xa6f7('0x39')]({},_0x387714,_0x2546a3[_0xa6f7('0x3c')]);return db[_0xa6f7('0x28')]['find'](_0x387714)[_0xa6f7('0x40')](handleEntityNotFound(_0x2ac07f,null))['then'](respondWithResult(_0x2ac07f,null))[_0xa6f7('0x41')](handleError(_0x2ac07f,null));};exports[_0xa6f7('0x45')]=function(_0x260e77,_0x5f3c84){return db['WhatsappQueueReport'][_0xa6f7('0x45')](_0x260e77['body'],{})[_0xa6f7('0x40')](respondWithResult(_0x5f3c84,0xc9))['catch'](handleError(_0x5f3c84,null));};exports['update']=function(_0x1e7089,_0x2e3a04){if(_0x1e7089[_0xa6f7('0x46')]['id']){delete _0x1e7089[_0xa6f7('0x46')]['id'];}return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x1e7089['params']['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x2e3a04,null))[_0xa6f7('0x40')](saveUpdates(_0x1e7089['body'],null))[_0xa6f7('0x40')](respondWithResult(_0x2e3a04,null))['catch'](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x48')]=function(_0x59091a,_0x488efc){return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x59091a[_0xa6f7('0x43')]['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x488efc,null))[_0xa6f7('0x40')](removeEntity(_0x488efc,null))['catch'](handleError(_0x488efc,null));};exports[_0xa6f7('0x49')]=function(_0x34de29,_0x5cddc9){return db[_0xa6f7('0x28')]['describe']()[_0xa6f7('0x40')](respondWithResult(_0x5cddc9,null))[_0xa6f7('0x41')](handleError(_0x5cddc9,null));}; \ No newline at end of file +var _0x3c81=['apply','reject','save','update','then','destroy','end','error','name','send','map','WhatsappQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x7b5c52,_0x53948c){var _0x2e347d=function(_0x5ad3af){while(--_0x5ad3af){_0x7b5c52['push'](_0x7b5c52['shift']());}};_0x2e347d(++_0x53948c);}(_0x3c81,0x102));var _0x13c8=function(_0x1035b7,_0x46ee1e){_0x1035b7=_0x1035b7-0x0;var _0x3d31fe=_0x3c81[_0x1035b7];return _0x3d31fe;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];function respondWithStatusCode(_0x5ab91d,_0x21442d){_0x21442d=_0x21442d||0xcc;return function(_0x7b6da8){if(_0x7b6da8){return _0x5ab91d[_0x13c8('0x19')](_0x21442d);}return _0x5ab91d[_0x13c8('0x1a')](_0x21442d)['end']();};}function respondWithResult(_0x42955d,_0x515681){_0x515681=_0x515681||0xc8;return function(_0x4d7a88){if(_0x4d7a88){return _0x42955d['status'](_0x515681)[_0x13c8('0x1b')](_0x4d7a88);}};}function respondWithFilteredResult(_0x5e0e06,_0x337397){return function(_0x17a3c1){if(_0x17a3c1){var _0x23f64e=typeof _0x337397[_0x13c8('0x1c')]==='undefined'&&typeof _0x337397[_0x13c8('0x1d')]===_0x13c8('0x1e');var _0x31ae02=_0x17a3c1[_0x13c8('0x1f')];var _0xce1ad2=_0x23f64e?0x0:_0x337397[_0x13c8('0x1c')];var _0x346417=_0x23f64e?_0x17a3c1[_0x13c8('0x1f')]:_0x337397[_0x13c8('0x1c')]+_0x337397[_0x13c8('0x1d')];var _0xe9386a;if(_0x346417>=_0x31ae02){_0x346417=_0x31ae02;_0xe9386a=0xc8;}else{_0xe9386a=0xce;}_0x5e0e06['status'](_0xe9386a);return _0x5e0e06[_0x13c8('0x20')](_0x13c8('0x21'),_0xce1ad2+'-'+_0x346417+'/'+_0x31ae02)[_0x13c8('0x1b')](_0x17a3c1);}return null;};}function patchUpdates(_0x313ea3){return function(_0x513085){try{jsonpatch[_0x13c8('0x22')](_0x513085,_0x313ea3,!![]);}catch(_0x3c4603){return BPromise[_0x13c8('0x23')](_0x3c4603);}return _0x513085[_0x13c8('0x24')]();};}function saveUpdates(_0x436d5d,_0x2fc123){return function(_0x5ab47f){if(_0x5ab47f){return _0x5ab47f[_0x13c8('0x25')](_0x436d5d)[_0x13c8('0x26')](function(_0x315d6c){return _0x315d6c;});}return null;};}function removeEntity(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(_0x1770e5){return _0x1770e5[_0x13c8('0x27')]()['then'](function(){_0xcf41d2['status'](0xcc)[_0x13c8('0x28')]();});}};}function handleEntityNotFound(_0x4aff35,_0x47e8ae){return function(_0x5ad0dc){if(!_0x5ad0dc){_0x4aff35[_0x13c8('0x19')](0x194);}return _0x5ad0dc;};}function handleError(_0xc7f1b6,_0x53ada9){_0x53ada9=_0x53ada9||0x1f4;return function(_0x4df077){logger[_0x13c8('0x29')](_0x4df077['stack']);if(_0x4df077['name']){delete _0x4df077[_0x13c8('0x2a')];}_0xc7f1b6[_0x13c8('0x1a')](_0x53ada9)[_0x13c8('0x2b')](_0x4df077);};}exports['index']=function(_0x5ef2f7,_0x277a89){var _0x1071a0={},_0x399840={},_0x441182={'count':0x0,'rows':[]};var _0x138017=_[_0x13c8('0x2c')](db[_0x13c8('0x2d')]['rawAttributes'],function(_0x109cb8){return{'name':_0x109cb8[_0x13c8('0x2e')],'type':_0x109cb8['type']['key']};});_0x399840[_0x13c8('0x2f')]=_[_0x13c8('0x2c')](_0x138017,'name');_0x399840[_0x13c8('0x30')]=_[_0x13c8('0x31')](_0x5ef2f7['query']);_0x399840[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],_0x399840[_0x13c8('0x30')]);_0x1071a0[_0x13c8('0x34')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x5ef2f7['query']['fields']));_0x1071a0[_0x13c8('0x34')]=_0x1071a0[_0x13c8('0x34')]['length']?_0x1071a0[_0x13c8('0x34')]:_0x399840['model'];if(!_0x5ef2f7[_0x13c8('0x30')]['hasOwnProperty'](_0x13c8('0x36'))){_0x1071a0[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x1d')]);_0x1071a0[_0x13c8('0x1c')]=qs[_0x13c8('0x1c')](_0x5ef2f7['query'][_0x13c8('0x1c')]);}_0x1071a0[_0x13c8('0x37')]=qs['sort'](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x38')]);_0x1071a0[_0x13c8('0x39')]=qs['filters'](_['pick'](_0x5ef2f7['query'],_0x399840[_0x13c8('0x32')]),_0x138017);if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]){_0x1071a0[_0x13c8('0x39')]=_[_0x13c8('0x3b')](_0x1071a0[_0x13c8('0x39')],{'$or':_[_0x13c8('0x2c')](_0x138017,function(_0xe19858){if(_0xe19858[_0x13c8('0x3c')]!=='VIRTUAL'){var _0x5b2a28={};_0x5b2a28[_0xe19858[_0x13c8('0x2a')]]={'$like':'%'+_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]+'%'};return _0x5b2a28;}})});}_0x1071a0=_[_0x13c8('0x3b')]({},_0x1071a0,_0x5ef2f7['options']);var _0x35e1e7={'where':_0x1071a0['where']};return db[_0x13c8('0x2d')][_0x13c8('0x1f')](_0x35e1e7)[_0x13c8('0x26')](function(_0x1cd02c){_0x441182[_0x13c8('0x1f')]=_0x1cd02c;if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3d')]){_0x1071a0[_0x13c8('0x3e')]=[{'all':!![]}];}return db[_0x13c8('0x2d')][_0x13c8('0x3f')](_0x1071a0);})[_0x13c8('0x26')](function(_0x416169){_0x441182[_0x13c8('0x40')]=_0x416169;return _0x441182;})[_0x13c8('0x26')](respondWithFilteredResult(_0x277a89,_0x1071a0))[_0x13c8('0x41')](handleError(_0x277a89,null));};exports[_0x13c8('0x42')]=function(_0x1b2ada,_0x1505fb){var _0xc5eb86={'raw':!![],'where':{'id':_0x1b2ada[_0x13c8('0x43')]['id']}},_0x1cff99={};_0x1cff99[_0x13c8('0x2f')]=_[_0x13c8('0x31')](db[_0x13c8('0x2d')][_0x13c8('0x44')]);_0x1cff99['query']=_[_0x13c8('0x31')](_0x1b2ada[_0x13c8('0x30')]);_0x1cff99[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],_0x1cff99['query']);_0xc5eb86['attributes']=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x1b2ada['query']['fields']));_0xc5eb86['attributes']=_0xc5eb86[_0x13c8('0x34')]['length']?_0xc5eb86[_0x13c8('0x34')]:_0x1cff99['model'];if(_0x1b2ada[_0x13c8('0x30')][_0x13c8('0x3d')]){_0xc5eb86[_0x13c8('0x3e')]=[{'all':!![]}];}_0xc5eb86=_[_0x13c8('0x3b')]({},_0xc5eb86,_0x1b2ada[_0x13c8('0x45')]);return db[_0x13c8('0x2d')]['find'](_0xc5eb86)[_0x13c8('0x26')](handleEntityNotFound(_0x1505fb,null))[_0x13c8('0x26')](respondWithResult(_0x1505fb,null))['catch'](handleError(_0x1505fb,null));};exports[_0x13c8('0x46')]=function(_0x26155d,_0x2e925f){return db[_0x13c8('0x2d')][_0x13c8('0x46')](_0x26155d['body'],{})[_0x13c8('0x26')](respondWithResult(_0x2e925f,0xc9))[_0x13c8('0x41')](handleError(_0x2e925f,null));};exports[_0x13c8('0x25')]=function(_0x38418b,_0x185d18){if(_0x38418b['body']['id']){delete _0x38418b[_0x13c8('0x47')]['id'];}return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x38418b[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x185d18,null))[_0x13c8('0x26')](saveUpdates(_0x38418b[_0x13c8('0x47')],null))[_0x13c8('0x26')](respondWithResult(_0x185d18,null))[_0x13c8('0x41')](handleError(_0x185d18,null));};exports[_0x13c8('0x27')]=function(_0x266f4e,_0x5e1fe5){return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x266f4e[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x5e1fe5,null))[_0x13c8('0x26')](removeEntity(_0x5e1fe5,null))[_0x13c8('0x41')](handleError(_0x5e1fe5,null));};exports['describe']=function(_0x341fd3,_0x416e4f){return db[_0x13c8('0x2d')]['describe']()['then'](respondWithResult(_0x416e4f,null))[_0x13c8('0x41')](handleError(_0x416e4f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index e7eb4ee..bb423fc 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 _0x1840=['exports','define','WhatsappQueueReport','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x200fc0,_0x4338c6){var _0x212f16=function(_0x375490){while(--_0x375490){_0x200fc0['push'](_0x200fc0['shift']());}};_0x212f16(++_0x4338c6);}(_0x1840,0x12f));var _0x0184=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1840[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x0184('0x0'));var util=require(_0x0184('0x1'));var logger=require('../../config/logger')(_0x0184('0x2'));var moment=require(_0x0184('0x3'));var BPromise=require('bluebird');var rp=require(_0x0184('0x4'));var fs=require('fs');var path=require(_0x0184('0x5'));var rimraf=require(_0x0184('0x6'));var config=require(_0x0184('0x7'));var attributes=require(_0x0184('0x8'));module[_0x0184('0x9')]=function(_0x1a349f,_0x1ab798){return _0x1a349f[_0x0184('0xa')](_0x0184('0xb'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x0184('0xc'),'fields':[_0x0184('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ad0=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x49edd6,_0x3eae3d){var _0x3c2d44=function(_0x32c168){while(--_0x32c168){_0x49edd6['push'](_0x49edd6['shift']());}};_0x3c2d44(++_0x3eae3d);}(_0x2ad0,0x1ee));var _0x02ad=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x2ad0[_0x21c6b8];return _0x39d474;};'use strict';var _=require(_0x02ad('0x0'));var util=require(_0x02ad('0x1'));var logger=require('../../config/logger')(_0x02ad('0x2'));var moment=require(_0x02ad('0x3'));var BPromise=require(_0x02ad('0x4'));var rp=require(_0x02ad('0x5'));var fs=require('fs');var path=require(_0x02ad('0x6'));var rimraf=require(_0x02ad('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x02ad('0x8')]=function(_0x54f843,_0x14aece){return _0x54f843[_0x02ad('0x9')](_0x02ad('0xa'),attributes,{'tableName':_0x02ad('0xb'),'paranoid':![],'indexes':[{'name':_0x02ad('0xc'),'fields':[_0x02ad('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 70a3c37..4ff374d 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 _0xcf7a=['UpdateWhatsappQueueReport','update','body','options','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','raw','debug'];(function(_0x3d2761,_0x2696bf){var _0x531ae9=function(_0x495aa6){while(--_0x495aa6){_0x3d2761['push'](_0x3d2761['shift']());}};_0x531ae9(++_0x2696bf);}(_0xcf7a,0x18b));var _0xacf7=function(_0x500deb,_0x2b5e9d){_0x500deb=_0x500deb-0x0;var _0x4ebe54=_0xcf7a[_0x500deb];return _0x4ebe54;};'use strict';var _=require(_0xacf7('0x0'));var util=require(_0xacf7('0x1'));var moment=require('moment');var BPromise=require(_0xacf7('0x2'));var rs=require(_0xacf7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xacf7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xacf7('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xacf7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x521629,_0x6b5094,_0x87358f){return new BPromise(function(_0x59c664,_0x17b396){return client[_0xacf7('0x7')](_0x521629,_0x87358f)[_0xacf7('0x8')](function(_0x364b9c){logger[_0xacf7('0x9')](_0xacf7('0xa'),_0x6b5094,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x6b5094,_0xacf7('0xb'),JSON[_0xacf7('0xc')](_0x364b9c));if(_0x364b9c[_0xacf7('0xd')]){if(_0x364b9c[_0xacf7('0xd')]['code']===0x1f4){logger[_0xacf7('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x6b5094,_0x364b9c[_0xacf7('0xd')][_0xacf7('0xe')]);return _0x17b396(_0x364b9c['error'][_0xacf7('0xe')]);}logger[_0xacf7('0xd')](_0xacf7('0xa'),_0x6b5094,_0x364b9c[_0xacf7('0xd')][_0xacf7('0xe')]);return _0x59c664(_0x364b9c[_0xacf7('0xd')][_0xacf7('0xe')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x6b5094,_0xacf7('0xb'));_0x59c664(_0x364b9c['result'][_0xacf7('0xe')]);}})[_0xacf7('0xf')](function(_0x5ca9fc){logger[_0xacf7('0xd')](_0xacf7('0xa'),_0x6b5094,_0x5ca9fc);_0x17b396(_0x5ca9fc);});});}exports[_0xacf7('0x10')]=function(_0x58d7e6){var _0x2fc10b=this;return new Promise(function(_0x3d7a36,_0x293979){return db[_0xacf7('0x11')][_0xacf7('0x12')](_0x58d7e6['body'],{'raw':_0x58d7e6['options']?_0x58d7e6['options'][_0xacf7('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x473ad4){logger['info'](_0xacf7('0x10'),_0x58d7e6);logger[_0xacf7('0x14')](_0xacf7('0x10'),_0x58d7e6,JSON[_0xacf7('0xc')](_0x473ad4));_0x3d7a36(_0x473ad4);})[_0xacf7('0xf')](function(_0x58be3d){logger['error'](_0xacf7('0x10'),_0x58be3d['message'],_0x58d7e6);_0x293979(_0x2fc10b[_0xacf7('0xd')](0x1f4,_0x58be3d[_0xacf7('0xe')]));});});};exports[_0xacf7('0x15')]=function(_0x252424){var _0x4adbb9=this;return new Promise(function(_0x124c4d,_0xfe7d67){return db[_0xacf7('0x11')][_0xacf7('0x16')](_0x252424[_0xacf7('0x17')],{'raw':_0x252424[_0xacf7('0x18')]?_0x252424[_0xacf7('0x18')][_0xacf7('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x252424[_0xacf7('0x18')]?_0x252424[_0xacf7('0x18')]['where']||null:null,'attributes':_0x252424['options']?_0x252424['options']['attributes']||null:null,'limit':_0x252424[_0xacf7('0x18')]?_0x252424['options'][_0xacf7('0x19')]||null:null})[_0xacf7('0x8')](function(_0x1c6c6a){logger['info'](_0xacf7('0x15'),_0x252424);logger['debug'](_0xacf7('0x15'),_0x252424,JSON[_0xacf7('0xc')](_0x1c6c6a));_0x124c4d(_0x1c6c6a);})[_0xacf7('0xf')](function(_0x6d69f2){logger[_0xacf7('0xd')](_0xacf7('0x15'),_0x6d69f2[_0xacf7('0xe')],_0x252424);_0xfe7d67(_0x4adbb9[_0xacf7('0xd')](0x1f4,_0x6d69f2['message']));});});}; \ No newline at end of file +var _0x4f26=['limit','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','UpdateWhatsappQueueReport','update','raw','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4f26,0xc8));var _0x64f2=function(_0x24092f,_0x28e911){_0x24092f=_0x24092f-0x0;var _0x134d1d=_0x4f26[_0x24092f];return _0x134d1d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x64f2('0x0'));var BPromise=require(_0x64f2('0x1'));var rs=require(_0x64f2('0x2'));var fs=require('fs');var Redis=require(_0x64f2('0x3'));var db=require(_0x64f2('0x4'))['db'];var utils=require(_0x64f2('0x5'));var logger=require('../../config/logger')(_0x64f2('0x6'));var config=require(_0x64f2('0x7'));var jayson=require(_0x64f2('0x8'));var client=jayson[_0x64f2('0x9')][_0x64f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53f720,_0xee44b8,_0x12c937){return new BPromise(function(_0x3a6373,_0x155501){return client[_0x64f2('0xb')](_0x53f720,_0x12c937)[_0x64f2('0xc')](function(_0x45e878){logger[_0x64f2('0xd')](_0x64f2('0xe'),_0xee44b8,_0x64f2('0xf'));logger[_0x64f2('0x10')](_0x64f2('0x11'),_0xee44b8,_0x64f2('0xf'),JSON['stringify'](_0x45e878));if(_0x45e878['error']){if(_0x45e878[_0x64f2('0x12')][_0x64f2('0x13')]===0x1f4){logger[_0x64f2('0x12')](_0x64f2('0xe'),_0xee44b8,_0x45e878[_0x64f2('0x12')][_0x64f2('0x14')]);return _0x155501(_0x45e878[_0x64f2('0x12')][_0x64f2('0x14')]);}logger[_0x64f2('0x12')](_0x64f2('0xe'),_0xee44b8,_0x45e878[_0x64f2('0x12')]['message']);return _0x3a6373(_0x45e878[_0x64f2('0x12')]['message']);}else{logger['info'](_0x64f2('0xe'),_0xee44b8,'request\x20sent');_0x3a6373(_0x45e878[_0x64f2('0x15')][_0x64f2('0x14')]);}})[_0x64f2('0x16')](function(_0x5ecc48){logger[_0x64f2('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0xee44b8,_0x5ecc48);_0x155501(_0x5ecc48);});});}exports[_0x64f2('0x17')]=function(_0x5b42ae){var _0x23469e=this;return new Promise(function(_0x1d46e1,_0x4e5a99){return db[_0x64f2('0x18')]['create'](_0x5b42ae[_0x64f2('0x19')],{'raw':_0x5b42ae['options']?_0x5b42ae[_0x64f2('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x64f2('0xc')](function(_0x103008){logger[_0x64f2('0xd')](_0x64f2('0x17'),_0x5b42ae);logger[_0x64f2('0x10')]('CreateWhatsappQueueReport',_0x5b42ae,JSON['stringify'](_0x103008));_0x1d46e1(_0x103008);})[_0x64f2('0x16')](function(_0x31b210){logger[_0x64f2('0x12')](_0x64f2('0x17'),_0x31b210[_0x64f2('0x14')],_0x5b42ae);_0x4e5a99(_0x23469e['error'](0x1f4,_0x31b210[_0x64f2('0x14')]));});});};exports[_0x64f2('0x1b')]=function(_0x1286ec){var _0x2f0d30=this;return new Promise(function(_0x133ffb,_0x1bbd38){return db[_0x64f2('0x18')][_0x64f2('0x1c')](_0x1286ec[_0x64f2('0x19')],{'raw':_0x1286ec[_0x64f2('0x1a')]?_0x1286ec['options'][_0x64f2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1286ec['options']?_0x1286ec[_0x64f2('0x1a')][_0x64f2('0x1e')]||null:null,'attributes':_0x1286ec[_0x64f2('0x1a')]?_0x1286ec[_0x64f2('0x1a')]['attributes']||null:null,'limit':_0x1286ec[_0x64f2('0x1a')]?_0x1286ec[_0x64f2('0x1a')][_0x64f2('0x1f')]||null:null})[_0x64f2('0xc')](function(_0x31883e){logger[_0x64f2('0xd')](_0x64f2('0x1b'),_0x1286ec);logger[_0x64f2('0x10')](_0x64f2('0x1b'),_0x1286ec,JSON[_0x64f2('0x20')](_0x31883e));_0x133ffb(_0x31883e);})[_0x64f2('0x16')](function(_0x4a87ff){logger[_0x64f2('0x12')](_0x64f2('0x1b'),_0x4a87ff[_0x64f2('0x14')],_0x1286ec);_0x1bbd38(_0x2f0d30['error'](0x1f4,_0x4a87ff['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 22bcd0e..7017d04 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 _0xd8ff=['index','get','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated'];(function(_0x2efb96,_0x40a4ce){var _0x50d38d=function(_0x22eaa9){while(--_0x22eaa9){_0x2efb96['push'](_0x2efb96['shift']());}};_0x50d38d(++_0x40a4ce);}(_0xd8ff,0x17c));var _0xfd8f=function(_0x195270,_0x412abb){_0x195270=_0x195270-0x0;var _0x5398dd=_0xd8ff[_0x195270];return _0x5398dd;};'use strict';var multer=require(_0xfd8f('0x0'));var util=require(_0xfd8f('0x1'));var path=require(_0xfd8f('0x2'));var timeout=require(_0xfd8f('0x3'));var express=require(_0xfd8f('0x4'));var router=express[_0xfd8f('0x5')]();var fs_extra=require(_0xfd8f('0x6'));var auth=require(_0xfd8f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfd8f('0x8'));var controller=require(_0xfd8f('0x9'));router['get']('/',auth[_0xfd8f('0xa')](),controller[_0xfd8f('0xb')]);router[_0xfd8f('0xc')](_0xfd8f('0xd'),auth[_0xfd8f('0xa')](),controller[_0xfd8f('0xe')]);router[_0xfd8f('0xc')]('/:id',auth[_0xfd8f('0xa')](),controller[_0xfd8f('0xf')]);router['post']('/',auth[_0xfd8f('0xa')](),controller[_0xfd8f('0x10')]);router[_0xfd8f('0x11')](_0xfd8f('0x12'),auth[_0xfd8f('0xa')](),controller[_0xfd8f('0x13')]);router[_0xfd8f('0x14')](_0xfd8f('0x12'),auth[_0xfd8f('0xa')](),controller[_0xfd8f('0x15')]);module[_0xfd8f('0x16')]=router; \ No newline at end of file +var _0xf0e7=['describe','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','isAuthenticated','index','get'];(function(_0x11f28f,_0x30ebf9){var _0x413f1a=function(_0x537f8b){while(--_0x537f8b){_0x11f28f['push'](_0x11f28f['shift']());}};_0x413f1a(++_0x30ebf9);}(_0xf0e7,0x198));var _0x7f0e=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xf0e7[_0x3ba924];return _0x4cc1df;};'use strict';var multer=require(_0x7f0e('0x0'));var util=require('util');var path=require(_0x7f0e('0x1'));var timeout=require(_0x7f0e('0x2'));var express=require(_0x7f0e('0x3'));var router=express[_0x7f0e('0x4')]();var fs_extra=require(_0x7f0e('0x5'));var auth=require(_0x7f0e('0x6'));var interaction=require(_0x7f0e('0x7'));var config=require('../../config/environment');var controller=require(_0x7f0e('0x8'));router['get']('/',auth[_0x7f0e('0x9')](),controller[_0x7f0e('0xa')]);router[_0x7f0e('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7f0e('0xc')]);router[_0x7f0e('0xb')](_0x7f0e('0xd'),auth['isAuthenticated'](),controller[_0x7f0e('0xe')]);router[_0x7f0e('0xf')]('/',auth[_0x7f0e('0x9')](),controller[_0x7f0e('0x10')]);router[_0x7f0e('0x11')](_0x7f0e('0xd'),auth[_0x7f0e('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7f0e('0x12')]);module[_0x7f0e('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 66f40d8..afa74ba 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 _0x85cf=['STRING','ENUM','account','agent','queue','DATE','exports'];(function(_0x2298b9,_0x4e0da9){var _0x2d5fbb=function(_0x2f48bf){while(--_0x2f48bf){_0x2298b9['push'](_0x2298b9['shift']());}};_0x2d5fbb(++_0x4e0da9);}(_0x85cf,0x76));var _0xf85c=function(_0x41a35a,_0xda06ad){_0x41a35a=_0x41a35a-0x0;var _0x33899c=_0x85cf[_0x41a35a];return _0x33899c;};'use strict';var Sequelize=require('sequelize');module[_0xf85c('0x0')]={'uniqueid':{'type':Sequelize[_0xf85c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf85c('0x2')](_0xf85c('0x3'),_0xf85c('0x4'),_0xf85c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf85c('0x6')]}}; \ No newline at end of file +var _0xb10b=['ENUM','account','queue','DATE','sequelize','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb10b,0x12a));var _0xbb10=function(_0x4432f2,_0x22697a){_0x4432f2=_0x4432f2-0x0;var _0x1c97d6=_0xb10b[_0x4432f2];return _0x1c97d6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbb10('0x2')](_0xbb10('0x3'),'agent',_0xbb10('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xbb10('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 4ebc4c4..36dd126 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 _0xf431=['catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','stack','name','send','index','map','WhatsappTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include'];(function(_0x163eda,_0x4038dc){var _0x344833=function(_0x2ccbe2){while(--_0x2ccbe2){_0x163eda['push'](_0x163eda['shift']());}};_0x344833(++_0x4038dc);}(_0xf431,0x93));var _0x1f43=function(_0x456904,_0x4cb25c){_0x456904=_0x456904-0x0;var _0x4b0063=_0xf431[_0x456904];return _0x4b0063;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f43('0x0'));var zipdir=require(_0x1f43('0x1'));var jsonpatch=require(_0x1f43('0x2'));var rp=require('request-promise');var moment=require(_0x1f43('0x3'));var BPromise=require(_0x1f43('0x4'));var Mustache=require('mustache');var util=require(_0x1f43('0x5'));var path=require(_0x1f43('0x6'));var sox=require(_0x1f43('0x7'));var csv=require(_0x1f43('0x8'));var ejs=require(_0x1f43('0x9'));var fs=require('fs');var fs_extra=require(_0x1f43('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1f43('0xb'));var jsforce=require(_0x1f43('0xc'));var deskjs=require(_0x1f43('0xd'));var toCsv=require(_0x1f43('0x8'));var querystring=require(_0x1f43('0xe'));var Papa=require('papaparse');var Redis=require(_0x1f43('0xf'));var authService=require(_0x1f43('0x10'));var qs=require(_0x1f43('0x11'));var as=require(_0x1f43('0x12'));var hardwareService=require(_0x1f43('0x13'));var logger=require(_0x1f43('0x14'))(_0x1f43('0x15'));var utils=require('../../config/utils');var config=require(_0x1f43('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f9b0d,_0xa25bbc){_0xa25bbc=_0xa25bbc||0xcc;return function(_0x1f0057){if(_0x1f0057){return _0x2f9b0d[_0x1f43('0x17')](_0xa25bbc);}return _0x2f9b0d[_0x1f43('0x18')](_0xa25bbc)[_0x1f43('0x19')]();};}function respondWithResult(_0x94948d,_0xe5e0c1){_0xe5e0c1=_0xe5e0c1||0xc8;return function(_0x5418c5){if(_0x5418c5){return _0x94948d[_0x1f43('0x18')](_0xe5e0c1)[_0x1f43('0x1a')](_0x5418c5);}};}function respondWithFilteredResult(_0x297672,_0x1127f6){return function(_0x23a6f0){if(_0x23a6f0){var _0x9d7d9b=typeof _0x1127f6[_0x1f43('0x1b')]===_0x1f43('0x1c')&&typeof _0x1127f6[_0x1f43('0x1d')]===_0x1f43('0x1c');var _0x37c140=_0x23a6f0[_0x1f43('0x1e')];var _0x1ac7fd=_0x9d7d9b?0x0:_0x1127f6[_0x1f43('0x1b')];var _0x3d1f6c=_0x9d7d9b?_0x23a6f0[_0x1f43('0x1e')]:_0x1127f6[_0x1f43('0x1b')]+_0x1127f6[_0x1f43('0x1d')];var _0x3448b0;if(_0x3d1f6c>=_0x37c140){_0x3d1f6c=_0x37c140;_0x3448b0=0xc8;}else{_0x3448b0=0xce;}_0x297672[_0x1f43('0x18')](_0x3448b0);return _0x297672[_0x1f43('0x1f')]('Content-Range',_0x1ac7fd+'-'+_0x3d1f6c+'/'+_0x37c140)['json'](_0x23a6f0);}return null;};}function patchUpdates(_0x1eced8){return function(_0x3e63c7){try{jsonpatch[_0x1f43('0x20')](_0x3e63c7,_0x1eced8,!![]);}catch(_0x13d9e9){return BPromise['reject'](_0x13d9e9);}return _0x3e63c7['save']();};}function saveUpdates(_0x3c457a,_0x11fb59){return function(_0x1d82e2){if(_0x1d82e2){return _0x1d82e2[_0x1f43('0x21')](_0x3c457a)[_0x1f43('0x22')](function(_0xc32547){return _0xc32547;});}return null;};}function removeEntity(_0x2385d3,_0x634c3a){return function(_0x4fdd4a){if(_0x4fdd4a){return _0x4fdd4a[_0x1f43('0x23')]()['then'](function(){_0x2385d3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b5409,_0x20bea8){return function(_0x2c0ee8){if(!_0x2c0ee8){_0x5b5409['sendStatus'](0x194);}return _0x2c0ee8;};}function handleError(_0x4aa4eb,_0x4dfbcc){_0x4dfbcc=_0x4dfbcc||0x1f4;return function(_0x21671e){logger['error'](_0x21671e[_0x1f43('0x24')]);if(_0x21671e['name']){delete _0x21671e[_0x1f43('0x25')];}_0x4aa4eb['status'](_0x4dfbcc)[_0x1f43('0x26')](_0x21671e);};}exports[_0x1f43('0x27')]=function(_0x12cf00,_0x1eaa34){var _0x5d5d6a={},_0x335d07={},_0x4199d6={'count':0x0,'rows':[]};var _0x5b49c9=_[_0x1f43('0x28')](db[_0x1f43('0x29')]['rawAttributes'],function(_0x2fc441){return{'name':_0x2fc441[_0x1f43('0x2a')],'type':_0x2fc441[_0x1f43('0x2b')]['key']};});_0x335d07[_0x1f43('0x2c')]=_[_0x1f43('0x28')](_0x5b49c9,_0x1f43('0x25'));_0x335d07[_0x1f43('0x2d')]=_[_0x1f43('0x2e')](_0x12cf00[_0x1f43('0x2d')]);_0x335d07[_0x1f43('0x2f')]=_[_0x1f43('0x30')](_0x335d07[_0x1f43('0x2c')],_0x335d07[_0x1f43('0x2d')]);_0x5d5d6a[_0x1f43('0x31')]=_['intersection'](_0x335d07[_0x1f43('0x2c')],qs[_0x1f43('0x32')](_0x12cf00[_0x1f43('0x2d')]['fields']));_0x5d5d6a[_0x1f43('0x31')]=_0x5d5d6a[_0x1f43('0x31')][_0x1f43('0x33')]?_0x5d5d6a[_0x1f43('0x31')]:_0x335d07[_0x1f43('0x2c')];if(!_0x12cf00[_0x1f43('0x2d')]['hasOwnProperty'](_0x1f43('0x34'))){_0x5d5d6a['limit']=qs[_0x1f43('0x1d')](_0x12cf00[_0x1f43('0x2d')]['limit']);_0x5d5d6a[_0x1f43('0x1b')]=qs[_0x1f43('0x1b')](_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x1b')]);}_0x5d5d6a[_0x1f43('0x35')]=qs[_0x1f43('0x36')](_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x36')]);_0x5d5d6a['where']=qs['filters'](_[_0x1f43('0x37')](_0x12cf00[_0x1f43('0x2d')],_0x335d07['filters']),_0x5b49c9);if(_0x12cf00['query'][_0x1f43('0x38')]){_0x5d5d6a[_0x1f43('0x39')]=_['merge'](_0x5d5d6a[_0x1f43('0x39')],{'$or':_[_0x1f43('0x28')](_0x5b49c9,function(_0x20637d){if(_0x20637d['type']!==_0x1f43('0x3a')){var _0x57fd37={};_0x57fd37[_0x20637d[_0x1f43('0x25')]]={'$like':'%'+_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x38')]+'%'};return _0x57fd37;}})});}_0x5d5d6a=_[_0x1f43('0x3b')]({},_0x5d5d6a,_0x12cf00[_0x1f43('0x3c')]);var _0x72ada6={'where':_0x5d5d6a['where']};return db[_0x1f43('0x29')][_0x1f43('0x1e')](_0x72ada6)[_0x1f43('0x22')](function(_0x451de3){_0x4199d6[_0x1f43('0x1e')]=_0x451de3;if(_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x3d')]){_0x5d5d6a[_0x1f43('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x5d5d6a);})[_0x1f43('0x22')](function(_0x3ec7d6){_0x4199d6['rows']=_0x3ec7d6;return _0x4199d6;})[_0x1f43('0x22')](respondWithFilteredResult(_0x1eaa34,_0x5d5d6a))[_0x1f43('0x3f')](handleError(_0x1eaa34,null));};exports[_0x1f43('0x40')]=function(_0x13459b,_0x5ab397){var _0x50cf4a={'raw':!![],'where':{'id':_0x13459b[_0x1f43('0x41')]['id']}},_0xa4dc92={};_0xa4dc92[_0x1f43('0x2c')]=_[_0x1f43('0x2e')](db[_0x1f43('0x29')]['rawAttributes']);_0xa4dc92[_0x1f43('0x2d')]=_['keys'](_0x13459b[_0x1f43('0x2d')]);_0xa4dc92[_0x1f43('0x2f')]=_[_0x1f43('0x30')](_0xa4dc92[_0x1f43('0x2c')],_0xa4dc92[_0x1f43('0x2d')]);_0x50cf4a[_0x1f43('0x31')]=_[_0x1f43('0x30')](_0xa4dc92[_0x1f43('0x2c')],qs[_0x1f43('0x32')](_0x13459b[_0x1f43('0x2d')][_0x1f43('0x32')]));_0x50cf4a[_0x1f43('0x31')]=_0x50cf4a[_0x1f43('0x31')][_0x1f43('0x33')]?_0x50cf4a[_0x1f43('0x31')]:_0xa4dc92[_0x1f43('0x2c')];if(_0x13459b[_0x1f43('0x2d')][_0x1f43('0x3d')]){_0x50cf4a[_0x1f43('0x3e')]=[{'all':!![]}];}_0x50cf4a=_[_0x1f43('0x3b')]({},_0x50cf4a,_0x13459b[_0x1f43('0x3c')]);return db[_0x1f43('0x29')][_0x1f43('0x42')](_0x50cf4a)[_0x1f43('0x22')](handleEntityNotFound(_0x5ab397,null))['then'](respondWithResult(_0x5ab397,null))[_0x1f43('0x3f')](handleError(_0x5ab397,null));};exports[_0x1f43('0x43')]=function(_0x5542e7,_0x3ef084){return db[_0x1f43('0x29')][_0x1f43('0x43')](_0x5542e7['body'],{})[_0x1f43('0x22')](respondWithResult(_0x3ef084,0xc9))[_0x1f43('0x3f')](handleError(_0x3ef084,null));};exports['update']=function(_0x30bf64,_0x2785e5){if(_0x30bf64[_0x1f43('0x44')]['id']){delete _0x30bf64[_0x1f43('0x44')]['id'];}return db['WhatsappTransferReport'][_0x1f43('0x42')]({'where':{'id':_0x30bf64[_0x1f43('0x41')]['id']}})['then'](handleEntityNotFound(_0x2785e5,null))[_0x1f43('0x22')](saveUpdates(_0x30bf64[_0x1f43('0x44')],null))[_0x1f43('0x22')](respondWithResult(_0x2785e5,null))[_0x1f43('0x3f')](handleError(_0x2785e5,null));};exports[_0x1f43('0x23')]=function(_0x393b8f,_0x4fb78c){return db[_0x1f43('0x29')][_0x1f43('0x42')]({'where':{'id':_0x393b8f[_0x1f43('0x41')]['id']}})[_0x1f43('0x22')](handleEntityNotFound(_0x4fb78c,null))[_0x1f43('0x22')](removeEntity(_0x4fb78c,null))['catch'](handleError(_0x4fb78c,null));};exports[_0x1f43('0x45')]=function(_0x485b38,_0x408256){return db['WhatsappTransferReport'][_0x1f43('0x45')]()[_0x1f43('0x22')](respondWithResult(_0x408256,null))[_0x1f43('0x3f')](handleError(_0x408256,null));}; \ No newline at end of file +var _0x6c57=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','order','sort','where','pick','filter','merge','options','WhatsappTransferReport','includeAll','findAll','catch','show','params','fields','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json'];(function(_0xb99888,_0x39832c){var _0x13f105=function(_0x19cd40){while(--_0x19cd40){_0xb99888['push'](_0xb99888['shift']());}};_0x13f105(++_0x39832c);}(_0x6c57,0x76));var _0x76c5=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6c57[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require(_0x76c5('0x0'));var rimraf=require(_0x76c5('0x1'));var zipdir=require(_0x76c5('0x2'));var jsonpatch=require(_0x76c5('0x3'));var rp=require('request-promise');var moment=require(_0x76c5('0x4'));var BPromise=require(_0x76c5('0x5'));var Mustache=require(_0x76c5('0x6'));var util=require(_0x76c5('0x7'));var path=require(_0x76c5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76c5('0x9'));var fs=require('fs');var fs_extra=require(_0x76c5('0xa'));var _=require(_0x76c5('0xb'));var squel=require('squel');var crypto=require(_0x76c5('0xc'));var jsforce=require(_0x76c5('0xd'));var deskjs=require(_0x76c5('0xe'));var toCsv=require(_0x76c5('0xf'));var querystring=require(_0x76c5('0x10'));var Papa=require(_0x76c5('0x11'));var Redis=require(_0x76c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x76c5('0x13'));var as=require(_0x76c5('0x14'));var hardwareService=require(_0x76c5('0x15'));var logger=require(_0x76c5('0x16'))(_0x76c5('0x17'));var utils=require(_0x76c5('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c03fa,_0x52b749){_0x52b749=_0x52b749||0xcc;return function(_0xc13406){if(_0xc13406){return _0x1c03fa[_0x76c5('0x19')](_0x52b749);}return _0x1c03fa[_0x76c5('0x1a')](_0x52b749)['end']();};}function respondWithResult(_0x22bfa6,_0x4834c5){_0x4834c5=_0x4834c5||0xc8;return function(_0x5e0d11){if(_0x5e0d11){return _0x22bfa6[_0x76c5('0x1a')](_0x4834c5)[_0x76c5('0x1b')](_0x5e0d11);}};}function respondWithFilteredResult(_0x2f7576,_0x1c100b){return function(_0x10062e){if(_0x10062e){var _0x407eb0=typeof _0x1c100b[_0x76c5('0x1c')]===_0x76c5('0x1d')&&typeof _0x1c100b['limit']===_0x76c5('0x1d');var _0xd162f=_0x10062e[_0x76c5('0x1e')];var _0x49874d=_0x407eb0?0x0:_0x1c100b[_0x76c5('0x1c')];var _0x4a01a3=_0x407eb0?_0x10062e[_0x76c5('0x1e')]:_0x1c100b['offset']+_0x1c100b[_0x76c5('0x1f')];var _0x51ae28;if(_0x4a01a3>=_0xd162f){_0x4a01a3=_0xd162f;_0x51ae28=0xc8;}else{_0x51ae28=0xce;}_0x2f7576[_0x76c5('0x1a')](_0x51ae28);return _0x2f7576[_0x76c5('0x20')](_0x76c5('0x21'),_0x49874d+'-'+_0x4a01a3+'/'+_0xd162f)['json'](_0x10062e);}return null;};}function patchUpdates(_0x32b3d1){return function(_0x116af0){try{jsonpatch['apply'](_0x116af0,_0x32b3d1,!![]);}catch(_0x1c05ce){return BPromise[_0x76c5('0x22')](_0x1c05ce);}return _0x116af0[_0x76c5('0x23')]();};}function saveUpdates(_0x10eab2,_0x3a9e12){return function(_0x312fdc){if(_0x312fdc){return _0x312fdc[_0x76c5('0x24')](_0x10eab2)['then'](function(_0x5b91ef){return _0x5b91ef;});}return null;};}function removeEntity(_0x565c49,_0x5b54df){return function(_0x2dca7d){if(_0x2dca7d){return _0x2dca7d['destroy']()[_0x76c5('0x25')](function(){_0x565c49[_0x76c5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48ddaa,_0xff4b87){return function(_0x2c49fd){if(!_0x2c49fd){_0x48ddaa['sendStatus'](0x194);}return _0x2c49fd;};}function handleError(_0xb55ce,_0x50609b){_0x50609b=_0x50609b||0x1f4;return function(_0x1551fb){logger[_0x76c5('0x26')](_0x1551fb[_0x76c5('0x27')]);if(_0x1551fb[_0x76c5('0x28')]){delete _0x1551fb[_0x76c5('0x28')];}_0xb55ce[_0x76c5('0x1a')](_0x50609b)[_0x76c5('0x29')](_0x1551fb);};}exports[_0x76c5('0x2a')]=function(_0x1bb9c3,_0x33bf8f){var _0x113bac={},_0x513a05={},_0x57b537={'count':0x0,'rows':[]};var _0x12f873=_['map'](db['WhatsappTransferReport'][_0x76c5('0x2b')],function(_0x1c1434){return{'name':_0x1c1434[_0x76c5('0x2c')],'type':_0x1c1434[_0x76c5('0x2d')]['key']};});_0x513a05[_0x76c5('0x2e')]=_[_0x76c5('0x2f')](_0x12f873,_0x76c5('0x28'));_0x513a05[_0x76c5('0x30')]=_[_0x76c5('0x31')](_0x1bb9c3['query']);_0x513a05[_0x76c5('0x32')]=_[_0x76c5('0x33')](_0x513a05[_0x76c5('0x2e')],_0x513a05[_0x76c5('0x30')]);_0x113bac[_0x76c5('0x34')]=_[_0x76c5('0x33')](_0x513a05[_0x76c5('0x2e')],qs['fields'](_0x1bb9c3['query']['fields']));_0x113bac[_0x76c5('0x34')]=_0x113bac[_0x76c5('0x34')]['length']?_0x113bac['attributes']:_0x513a05['model'];if(!_0x1bb9c3[_0x76c5('0x30')]['hasOwnProperty']('nolimit')){_0x113bac[_0x76c5('0x1f')]=qs[_0x76c5('0x1f')](_0x1bb9c3[_0x76c5('0x30')]['limit']);_0x113bac[_0x76c5('0x1c')]=qs[_0x76c5('0x1c')](_0x1bb9c3[_0x76c5('0x30')]['offset']);}_0x113bac[_0x76c5('0x35')]=qs[_0x76c5('0x36')](_0x1bb9c3['query']['sort']);_0x113bac[_0x76c5('0x37')]=qs['filters'](_[_0x76c5('0x38')](_0x1bb9c3[_0x76c5('0x30')],_0x513a05[_0x76c5('0x32')]),_0x12f873);if(_0x1bb9c3[_0x76c5('0x30')][_0x76c5('0x39')]){_0x113bac[_0x76c5('0x37')]=_[_0x76c5('0x3a')](_0x113bac[_0x76c5('0x37')],{'$or':_['map'](_0x12f873,function(_0x37ea15){if(_0x37ea15[_0x76c5('0x2d')]!=='VIRTUAL'){var _0x4bdee5={};_0x4bdee5[_0x37ea15[_0x76c5('0x28')]]={'$like':'%'+_0x1bb9c3['query'][_0x76c5('0x39')]+'%'};return _0x4bdee5;}})});}_0x113bac=_[_0x76c5('0x3a')]({},_0x113bac,_0x1bb9c3[_0x76c5('0x3b')]);var _0x4fe12f={'where':_0x113bac[_0x76c5('0x37')]};return db[_0x76c5('0x3c')][_0x76c5('0x1e')](_0x4fe12f)[_0x76c5('0x25')](function(_0x79a65e){_0x57b537[_0x76c5('0x1e')]=_0x79a65e;if(_0x1bb9c3[_0x76c5('0x30')][_0x76c5('0x3d')]){_0x113bac['include']=[{'all':!![]}];}return db[_0x76c5('0x3c')][_0x76c5('0x3e')](_0x113bac);})[_0x76c5('0x25')](function(_0x1188c9){_0x57b537['rows']=_0x1188c9;return _0x57b537;})[_0x76c5('0x25')](respondWithFilteredResult(_0x33bf8f,_0x113bac))[_0x76c5('0x3f')](handleError(_0x33bf8f,null));};exports[_0x76c5('0x40')]=function(_0x115ae8,_0x32a983){var _0x250cf0={'raw':!![],'where':{'id':_0x115ae8[_0x76c5('0x41')]['id']}},_0x1352ed={};_0x1352ed[_0x76c5('0x2e')]=_[_0x76c5('0x31')](db[_0x76c5('0x3c')][_0x76c5('0x2b')]);_0x1352ed['query']=_[_0x76c5('0x31')](_0x115ae8[_0x76c5('0x30')]);_0x1352ed[_0x76c5('0x32')]=_[_0x76c5('0x33')](_0x1352ed[_0x76c5('0x2e')],_0x1352ed[_0x76c5('0x30')]);_0x250cf0[_0x76c5('0x34')]=_[_0x76c5('0x33')](_0x1352ed[_0x76c5('0x2e')],qs[_0x76c5('0x42')](_0x115ae8[_0x76c5('0x30')]['fields']));_0x250cf0[_0x76c5('0x34')]=_0x250cf0[_0x76c5('0x34')]['length']?_0x250cf0[_0x76c5('0x34')]:_0x1352ed[_0x76c5('0x2e')];if(_0x115ae8[_0x76c5('0x30')][_0x76c5('0x3d')]){_0x250cf0[_0x76c5('0x43')]=[{'all':!![]}];}_0x250cf0=_[_0x76c5('0x3a')]({},_0x250cf0,_0x115ae8['options']);return db[_0x76c5('0x3c')][_0x76c5('0x44')](_0x250cf0)['then'](handleEntityNotFound(_0x32a983,null))[_0x76c5('0x25')](respondWithResult(_0x32a983,null))[_0x76c5('0x3f')](handleError(_0x32a983,null));};exports[_0x76c5('0x45')]=function(_0xf67df4,_0x5cae1a){return db[_0x76c5('0x3c')][_0x76c5('0x45')](_0xf67df4[_0x76c5('0x46')],{})[_0x76c5('0x25')](respondWithResult(_0x5cae1a,0xc9))[_0x76c5('0x3f')](handleError(_0x5cae1a,null));};exports['update']=function(_0x43bdf6,_0x1cadd3){if(_0x43bdf6[_0x76c5('0x46')]['id']){delete _0x43bdf6[_0x76c5('0x46')]['id'];}return db[_0x76c5('0x3c')]['find']({'where':{'id':_0x43bdf6[_0x76c5('0x41')]['id']}})[_0x76c5('0x25')](handleEntityNotFound(_0x1cadd3,null))[_0x76c5('0x25')](saveUpdates(_0x43bdf6[_0x76c5('0x46')],null))[_0x76c5('0x25')](respondWithResult(_0x1cadd3,null))['catch'](handleError(_0x1cadd3,null));};exports[_0x76c5('0x47')]=function(_0x23323f,_0x4e34e4){return db['WhatsappTransferReport'][_0x76c5('0x44')]({'where':{'id':_0x23323f[_0x76c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e34e4,null))['then'](removeEntity(_0x4e34e4,null))[_0x76c5('0x3f')](handleError(_0x4e34e4,null));};exports[_0x76c5('0x48')]=function(_0x152d08,_0x5bc3ff){return db[_0x76c5('0x3c')][_0x76c5('0x48')]()[_0x76c5('0x25')](respondWithResult(_0x5bc3ff,null))[_0x76c5('0x3f')](handleError(_0x5bc3ff,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d4253a9..fb6ee2d 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 _0xcba1=['bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xcba1,0x14e));var _0x1cba=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0xcba1[_0x2c6120];return _0x5fb114;};'use strict';var _=require(_0x1cba('0x0'));var util=require('util');var logger=require(_0x1cba('0x1'))(_0x1cba('0x2'));var moment=require(_0x1cba('0x3'));var BPromise=require(_0x1cba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cba('0x5'));var rimraf=require(_0x1cba('0x6'));var config=require(_0x1cba('0x7'));var attributes=require(_0x1cba('0x8'));module[_0x1cba('0x9')]=function(_0x1ecec1,_0x2f0d2b){return _0x1ecec1[_0x1cba('0xa')]('WhatsappTransferReport',attributes,{'tableName':_0x1cba('0xb'),'paranoid':![],'indexes':[{'name':_0x1cba('0xc'),'fields':[_0x1cba('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5ee=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x33daf4,_0xd0952){var _0x20f62a=function(_0x55c454){while(--_0x55c454){_0x33daf4['push'](_0x33daf4['shift']());}};_0x20f62a(++_0xd0952);}(_0xd5ee,0x159));var _0xed5e=function(_0x337800,_0x1e986e){_0x337800=_0x337800-0x0;var _0x2caa1d=_0xd5ee[_0x337800];return _0x2caa1d;};'use strict';var _=require(_0xed5e('0x0'));var util=require(_0xed5e('0x1'));var logger=require(_0xed5e('0x2'))('api');var moment=require(_0xed5e('0x3'));var BPromise=require(_0xed5e('0x4'));var rp=require(_0xed5e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed5e('0x6'));var config=require(_0xed5e('0x7'));var attributes=require(_0xed5e('0x8'));module[_0xed5e('0x9')]=function(_0x25f1ce,_0x2f2a7a){return _0x25f1ce['define']('WhatsappTransferReport',attributes,{'tableName':_0xed5e('0xa'),'paranoid':![],'indexes':[{'name':_0xed5e('0xb'),'fields':[_0xed5e('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 73a557b..503331e 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 _0x984e=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0x2168f8,_0x359007){var _0x8ec81a=function(_0x516c4b){while(--_0x516c4b){_0x2168f8['push'](_0x2168f8['shift']());}};_0x8ec81a(++_0x359007);}(_0x984e,0xdb));var _0xe984=function(_0x3f33bd,_0x570aeb){_0x3f33bd=_0x3f33bd-0x0;var _0x5c7677=_0x984e[_0x3f33bd];return _0x5c7677;};'use strict';var _=require('lodash');var util=require(_0xe984('0x0'));var moment=require(_0xe984('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe984('0x2'));var db=require(_0xe984('0x3'))['db'];var utils=require(_0xe984('0x4'));var logger=require(_0xe984('0x5'))(_0xe984('0x6'));var config=require(_0xe984('0x7'));var jayson=require(_0xe984('0x8'));var client=jayson['client'][_0xe984('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c7b55,_0x445515,_0x530733){return new BPromise(function(_0x4870ba,_0x40995d){return client[_0xe984('0xa')](_0x5c7b55,_0x530733)['then'](function(_0x547011){logger['info'](_0xe984('0xb'),_0x445515,_0xe984('0xc'));logger['debug'](_0xe984('0xd'),_0x445515,_0xe984('0xc'),JSON[_0xe984('0xe')](_0x547011));if(_0x547011[_0xe984('0xf')]){if(_0x547011[_0xe984('0xf')][_0xe984('0x10')]===0x1f4){logger[_0xe984('0xf')](_0xe984('0xb'),_0x445515,_0x547011['error'][_0xe984('0x11')]);return _0x40995d(_0x547011['error'][_0xe984('0x11')]);}logger['error'](_0xe984('0xb'),_0x445515,_0x547011[_0xe984('0xf')][_0xe984('0x11')]);return _0x4870ba(_0x547011[_0xe984('0xf')][_0xe984('0x11')]);}else{logger[_0xe984('0x12')](_0xe984('0xb'),_0x445515,_0xe984('0xc'));_0x4870ba(_0x547011['result'][_0xe984('0x11')]);}})[_0xe984('0x13')](function(_0x338786){logger[_0xe984('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x445515,_0x338786);_0x40995d(_0x338786);});});} \ No newline at end of file +var _0xc69f=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5c6689,_0x29eae4){var _0x372091=function(_0x522859){while(--_0x522859){_0x5c6689['push'](_0x5c6689['shift']());}};_0x372091(++_0x29eae4);}(_0xc69f,0x1b4));var _0xfc69=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc69f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc69('0x0'));var BPromise=require(_0xfc69('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc69('0x2'));var db=require(_0xfc69('0x3'))['db'];var utils=require(_0xfc69('0x4'));var logger=require(_0xfc69('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfc69('0x6'));var client=jayson[_0xfc69('0x7')][_0xfc69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23db8a,_0x474267,_0x4ea443){return new BPromise(function(_0x3e4535,_0x2425bd){return client[_0xfc69('0x9')](_0x23db8a,_0x4ea443)['then'](function(_0x464516){logger[_0xfc69('0xa')](_0xfc69('0xb'),_0x474267,_0xfc69('0xc'));logger[_0xfc69('0xd')](_0xfc69('0xe'),_0x474267,_0xfc69('0xc'),JSON['stringify'](_0x464516));if(_0x464516[_0xfc69('0xf')]){if(_0x464516['error']['code']===0x1f4){logger[_0xfc69('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x474267,_0x464516['error'][_0xfc69('0x10')]);return _0x2425bd(_0x464516[_0xfc69('0xf')][_0xfc69('0x10')]);}logger[_0xfc69('0xf')](_0xfc69('0xb'),_0x474267,_0x464516[_0xfc69('0xf')][_0xfc69('0x10')]);return _0x3e4535(_0x464516[_0xfc69('0xf')][_0xfc69('0x10')]);}else{logger[_0xfc69('0xa')](_0xfc69('0xb'),_0x474267,_0xfc69('0xc'));_0x3e4535(_0x464516[_0xfc69('0x11')][_0xfc69('0x10')]);}})['catch'](function(_0x115a15){logger[_0xfc69('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x474267,_0x115a15);_0x2425bd(_0x115a15);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index feabd6c..ce72292 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x536e=['./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','default','listen','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','join','Offline\x20apps:','filter','status','online','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x536e,0x155));var _0xe536=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0x536e[_0x1e081a];return _0x428209;};'use strict';var _=require(_0xe536('0x0'));var db=require(_0xe536('0x1'))['db'];var seedDb=require(_0xe536('0x2'));var checkLicense=require(_0xe536('0x3'));var rpc=require(_0xe536('0x4'));var config=require(_0xe536('0x5'));var logger=require(_0xe536('0x6'))(_0xe536('0x7'));var pm2=require(_0xe536('0x8'));var pm2Config=require(_0xe536('0x9'));var schedule=require(_0xe536('0xa'));var chat=require(_0xe536('0xb'));var whatsapp=require(_0xe536('0xc'));var transcribe=require(_0xe536('0xd'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0xe536('0xe')]()[_0xe536('0xf')](function(){if(config['seedDB']){return seedDb[_0xe536('0x10')]();}})[_0xe536('0xf')](function(){return checkLicense[_0xe536('0x10')]();})[_0xe536('0xf')](function(){return rpc[_0xe536('0x11')]();})[_0xe536('0xf')](function(_0xe08ef0){logger['info'](_0xe08ef0);return chat['start']();})[_0xe536('0xf')](function(){return whatsapp[_0xe536('0x12')]();})['then'](function(){return schedule[_0xe536('0x12')]();})[_0xe536('0xf')](function(){return transcribe[_0xe536('0x12')]();})[_0xe536('0xf')](function(){return provider[_0xe536('0x12')]();})[_0xe536('0xf')](function(_0x498591){logger[_0xe536('0x13')](_0x498591);return pm2[_0xe536('0x12')](pm2Config);})[_0xe536('0xf')](function(_0x32e841){var _0x349020=_0x32e841['filter'](function(_0x410583){return typeof _0x410583[_0xe536('0x14')]===_0xe536('0x15')&&_0x410583['exitCode']>=0x0;});if(_0x349020[_0xe536('0x16')]>0x0){throw new Error(_0x349020[_0xe536('0x16')]+_0xe536('0x17')+_[_0xe536('0x18')](_0x349020,function(_0x4cf519){return'\x22'+_0x4cf519['pm2_env'][_0xe536('0x19')]+'\x22';}));}logger[_0xe536('0x13')](_0xe536('0x1a'),_[_0xe536('0x18')](_['filter'](_0x32e841,{'status':'online'}),_0xe536('0x19'))[_0xe536('0x1b')]());logger[_0xe536('0x13')](_0xe536('0x1c'),_[_0xe536('0x18')](_[_0xe536('0x1d')](_0x32e841,function(_0x3c3e82){return _0x3c3e82[_0xe536('0x1e')]!==_0xe536('0x1f');}),_0xe536('0x19'))[_0xe536('0x1b')]()||'None');console['log'](_0xe536('0x20'));})[_0xe536('0x21')](function(_0x5a034d){console['log'](_0xe536('0x22'),_0x5a034d);logger[_0xe536('0x23')](_0xe536('0x24'),_0x5a034d);process[_0xe536('0x25')](0x1);});}main(); \ No newline at end of file +var _0x9ca0=['sequelize','sync','then','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider'];(function(_0x96f635,_0x582606){var _0x3b275a=function(_0x1ed897){while(--_0x1ed897){_0x96f635['push'](_0x96f635['shift']());}};_0x3b275a(++_0x582606);}(_0x9ca0,0x65));var _0x09ca=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x9ca0[_0xd39959];return _0x1ff69c;};'use strict';var _=require(_0x09ca('0x0'));var db=require(_0x09ca('0x1'))['db'];var seedDb=require(_0x09ca('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x09ca('0x3'));var config=require(_0x09ca('0x4'));var logger=require('./config/logger')(_0x09ca('0x5'));var pm2=require(_0x09ca('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x09ca('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x09ca('0x8'));var provider=require(_0x09ca('0x9'));function main(){return db[_0x09ca('0xa')][_0x09ca('0xb')]()[_0x09ca('0xc')](function(){if(config['seedDB']){return seedDb['default']();}})[_0x09ca('0xc')](function(){return checkLicense[_0x09ca('0xd')]();})['then'](function(){return rpc[_0x09ca('0xe')]();})[_0x09ca('0xc')](function(_0x34ea15){logger[_0x09ca('0xf')](_0x34ea15);return chat[_0x09ca('0x10')]();})[_0x09ca('0xc')](function(){return whatsapp['start']();})[_0x09ca('0xc')](function(){return schedule[_0x09ca('0x10')]();})['then'](function(){return transcribe[_0x09ca('0x10')]();})['then'](function(){return provider[_0x09ca('0x10')]();})[_0x09ca('0xc')](function(_0x4183aa){logger['info'](_0x4183aa);return pm2['start'](pm2Config);})[_0x09ca('0xc')](function(_0x2fa47e){var _0x51c520=_0x2fa47e[_0x09ca('0x11')](function(_0xdb0c26){return typeof _0xdb0c26[_0x09ca('0x12')]===_0x09ca('0x13')&&_0xdb0c26[_0x09ca('0x12')]>=0x0;});if(_0x51c520[_0x09ca('0x14')]>0x0){throw new Error(_0x51c520[_0x09ca('0x14')]+_0x09ca('0x15')+_[_0x09ca('0x16')](_0x51c520,function(_0x330b88){return'\x22'+_0x330b88[_0x09ca('0x17')][_0x09ca('0x18')]+'\x22';}));}logger['info'](_0x09ca('0x19'),_[_0x09ca('0x16')](_[_0x09ca('0x11')](_0x2fa47e,{'status':_0x09ca('0x1a')}),_0x09ca('0x18'))[_0x09ca('0x1b')]());logger[_0x09ca('0xf')](_0x09ca('0x1c'),_['map'](_[_0x09ca('0x11')](_0x2fa47e,function(_0xfe4fea){return _0xfe4fea[_0x09ca('0x1d')]!=='online';}),_0x09ca('0x18'))[_0x09ca('0x1b')]()||_0x09ca('0x1e'));console[_0x09ca('0x1f')]('App\x20Ready!');})[_0x09ca('0x20')](function(_0xdecfde){console[_0x09ca('0x1f')](_0x09ca('0x21'),_0xdecfde);logger[_0x09ca('0x22')](_0x09ca('0x23'),_0xdecfde);process[_0x09ca('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 4f6d513..7026525 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 _0x54ef=['../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','moment','secrets','session','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','headers','authorization','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','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.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','payload','options','toString','hex','floor','HS512','../../mysqldb','../../config/environment'];(function(_0x1f8784,_0x285f48){var _0x2a4e3e=function(_0x25ec00){while(--_0x25ec00){_0x1f8784['push'](_0x1f8784['shift']());}};_0x2a4e3e(++_0x285f48);}(_0x54ef,0x112));var _0xf54e=function(_0x218439,_0x595bad){_0x218439=_0x218439-0x0;var _0x1fa5c5=_0x54ef[_0x218439];return _0x1fa5c5;};'use strict';var db=require(_0xf54e('0x0'))['db'];var config=require(_0xf54e('0x1'));var hardwareConf=require(_0xf54e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf54e('0x3'));var _=require(_0xf54e('0x4'));var jwt=require(_0xf54e('0x5'));var expressJwt=require(_0xf54e('0x6'));var compose=require(_0xf54e('0x7'));var basicAuth=require(_0xf54e('0x8'));var crypto=require(_0xf54e('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xf54e('0xa'));var validateJwt=expressJwt({'secret':config[_0xf54e('0xb')][_0xf54e('0xc')]});var userAttributes=['id','role',_0xf54e('0xd'),'name',_0xf54e('0xe'),_0xf54e('0xf'),'userpic',_0xf54e('0x10'),_0xf54e('0x11'),_0xf54e('0x12'),_0xf54e('0x13'),'mailPause',_0xf54e('0x14'),_0xf54e('0x15'),_0xf54e('0x16'),_0xf54e('0x17'),'showWebBar',_0xf54e('0x18'),'lastPauseAt','crudPermissions',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'phoneBarAutoAnswerDelay',_0xf54e('0x1d'),_0xf54e('0x1e'),_0xf54e('0x1f'),_0xf54e('0x20'),'phoneBarExpires',_0xf54e('0x21'),_0xf54e('0x22'),_0xf54e('0x23'),'hotdesk','interface',_0xf54e('0x24'),_0xf54e('0x25'),_0xf54e('0x26'),_0xf54e('0x27'),_0xf54e('0x28'),_0xf54e('0x29'),_0xf54e('0x2a'),_0xf54e('0x2b'),_0xf54e('0x2c'),_0xf54e('0x2d'),_0xf54e('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0xf54e('0x2f'),'smsAutoanswerDelay',_0xf54e('0x30'),_0xf54e('0x31'),_0xf54e('0x32'),_0xf54e('0x33'),_0xf54e('0x34'),_0xf54e('0x35')];exports[_0xf54e('0x36')]=function(){return this[_0xf54e('0x37')](!![])[_0xf54e('0x38')](function(_0x5f9eea,_0x1c58bd,_0x5b83df){if(_0x5f9eea[_0xf54e('0x39')]){_0x5b83df();}else{return db['ChatInteraction'][_0xf54e('0x3a')]({'where':{'id':_0x5f9eea[_0xf54e('0x3b')]['id']},'attributes':['id',_0xf54e('0x3c'),_0xf54e('0x3d')],'raw':!![]})[_0xf54e('0x3e')](function(_0x160160){if(_0x160160&&_0x160160[_0xf54e('0x3c')]){return _0x1c58bd[_0xf54e('0x3f')](_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?0x195:0x193)[_0xf54e('0x41')]({'message':_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?'Unmanaged.':_0xf54e('0x42')});}else{_0x5b83df();}})['catch'](function(_0x282c63){_0x5b83df(_0x282c63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15b888){return compose()[_0xf54e('0x38')](function(_0x21ba00,_0xa13cd0,_0x25b643){var _0x3993e4;if(_0x21ba00[_0xf54e('0x43')]['authorization']){if(_['startsWith'](_0x21ba00[_0xf54e('0x43')][_0xf54e('0x44')],_0xf54e('0x45'))){var _0x16d00f=basicAuth(_0x21ba00);db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'name':_0x16d00f[_0xf54e('0x48')]}})[_0xf54e('0x3e')](function(_0x3ae704){if(!_0x3ae704||!_0x3ae704[_0xf54e('0x49')](_0x16d00f['pass'])){return _0xa13cd0['status'](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x4a')});}_0x21ba00['user']={'id':_0x3ae704['id']};_0x25b643();})[_0xf54e('0x4b')](function(_0x82e313){_0x25b643(_0x82e313);});}else if(_[_0xf54e('0x4c')](_0x21ba00[_0xf54e('0x43')]['authorization'],'Bearer')){validateJwt(_0x21ba00,_0xa13cd0,_0x25b643);}else{if(_0x15b888){_0x25b643();}else{return _0xa13cd0['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x4d')});}}}else if(_0x21ba00[_0xf54e('0x4e')][_0xf54e('0x4f')]){try{var _0x29dc39={'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ba00['query']['apikey'],_0x29dc39)[_0xf54e('0x3e')](function(_0x734187){return db['User']['find']({'where':{'id':_0x734187[_0xf54e('0x51')]}})[_0xf54e('0x3e')](function(_0x173e6c){_0x3993e4=_0x173e6c;return db['Setting'][_0xf54e('0x3a')]({'where':{'id':0x1},'attributes':[_0xf54e('0x52'),'blockDuration'],'raw':!![]});})[_0xf54e('0x3e')](function(_0x6e5bdf){if(!_0x3993e4||!_[_0xf54e('0x53')](_0x3993e4[_0xf54e('0x54')],_0x734187[_0xf54e('0x55')])){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3993e4[_0xf54e('0x56')]){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3993e4[_0xf54e('0x57')]){if(_0x6e5bdf[_0xf54e('0x58')]>0x0){if(moment(_0x3993e4[_0xf54e('0x59')])[_0xf54e('0x5a')](_0x6e5bdf[_0xf54e('0x58')],_0xf54e('0x5b'))>moment()){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}else{return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}_0x21ba00[_0xf54e('0x39')]={'id':_0x3993e4['id']};_0x25b643();});})[_0xf54e('0x4b')](function(){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x533423){_0x25b643(_0x533423);}}else if(_0x15b888){_0x25b643();}else{return _0xa13cd0[_0xf54e('0x3f')](0x193)[_0xf54e('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf54e('0x38')](function(_0x311ce1,_0x381c03,_0x4f61d7){if(_0x311ce1[_0xf54e('0x39')]){db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'id':_0x311ce1[_0xf54e('0x39')]['id']},'attributes':userAttributes})[_0xf54e('0x3e')](function(_0x143a39){if(!_0x143a39){return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5d')});}_0x311ce1['user']=_0x143a39;_0x4f61d7();})[_0xf54e('0x4b')](function(_0x3447fd){_0x4f61d7(_0x3447fd);});}else if(_0x15b888){_0x4f61d7();}else{return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5e')});}});};exports[_0xf54e('0x5f')]=function canUpdate(){return compose()['use'](function(_0x23a4a1,_0x59af72,_0x1d16e0){return licenseUtil['getLicense']()[_0xf54e('0x3e')](function(_0x331b16){if(_0x331b16[_0xf54e('0x60')]){_0x1d16e0();}else{return _0x59af72['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0x32fb46){_0x1d16e0(_0x32fb46);});});};exports[_0xf54e('0x62')]=function isWebrtcLicence(){return compose()['use'](function(_0x427799,_0x297737,_0x346bb4){return licenseUtil[_0xf54e('0x63')]()['then'](function(_0x1bdb5a){if(_0x1bdb5a[_0xf54e('0x64')]){_0x346bb4();}else{return _0x297737['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0xca0141){_0x346bb4(_0xca0141);});});};exports['isMiddleware']=function(_0x196e68,_0x2b645e,_0x2527f6){_0x196e68[_0xf54e('0x65')]=!![];return _0x2527f6();};exports[_0xf54e('0x66')]=function signToken(_0x3237ef){return signJwt(_0x3237ef);};exports[_0xf54e('0x67')]=function(_0xd7b0c5,_0x15bfef){if(!_0xd7b0c5[_0xf54e('0x39')]){return _0x15bfef[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x68')});}var _0x2de1fe={'payload':{'id':_0xd7b0c5[_0xf54e('0x39')]['id'],'role':_0xd7b0c5[_0xf54e('0x39')][_0xf54e('0x69')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2de1fe)[_0xf54e('0x3e')](function(_0x21fd80){_0x15bfef[_0xf54e('0x6a')]('motion.token',_0x21fd80);_0x15bfef['redirect'](_0xf54e('0x6b'));})[_0xf54e('0x4b')](function(_0x45861b){return _0x15bfef[_0xf54e('0x3f')](0x1f4)[_0xf54e('0x6c')](_0x45861b);});};exports[_0xf54e('0x6d')]=function(_0x22763f){if(_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x54')])||_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x6f')])){return null;}else{return createJwt(_0x22763f);}};exports['generateApiKey']=function(_0x2aacf6){_0x2aacf6[_0xf54e('0x54')]=generateNonce();_0x2aacf6[_0xf54e('0x6f')]=generateIssuedAt();return createJwt(_0x2aacf6);};exports[_0xf54e('0x70')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f=_0x1b8f16['query'][_0xf54e('0x4f')];if(_0x18a25f){var _0x5fabd2={'nonce':_0x30f53b[_0xf54e('0x54')],'iat':_0x30f53b['apiKeyIat'],'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18a25f,_0x5fabd2)[_0xf54e('0x3e')](function(){return generateApiKey(_0x30f53b);});}else{throw{'message':_0xf54e('0x71')};}};exports[_0xf54e('0x72')]=function(_0x5b882f){var _0x1d8ccf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8ccf[_0xf54e('0x73')](_0x5b882f))throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0xf54e('0x76'));return;};exports[_0xf54e('0x77')]=function(_0x21d485,_0x55d57f,_0x55de5c){var _0x4270e1=encryptor[_0xf54e('0x78')](_0x55d57f)['split'](',');for(var _0x29743e=0x0;_0x29743e<_0x55de5c;_0x29743e++){if(!_0x4270e1[_0x29743e])break;if(_0x21d485['toLowerCase']()===_0x4270e1[_0x29743e][_0xf54e('0x79')]()){var _0x528a64=util[_0xf54e('0x7a')](_0xf54e('0x7b'),_0x55de5c);if(_0x55de5c===0x1){_0x528a64=_0xf54e('0x7c');}throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0x528a64);}}return;};exports[_0xf54e('0x7d')]=function(_0x556e55,_0x479572){var _0x79345=_0x479572?encryptor[_0xf54e('0x78')](_0x479572)['split'](','):[];if(_0x79345['length']===0x5){_0x79345[_0xf54e('0x7e')](-0x1,0x1);}_0x79345['unshift'](_0x556e55);return encryptor[_0xf54e('0x7f')](_0x79345[_0xf54e('0x80')](','));};function signJwt(_0x47596c){var _0x2b11f8=BPromise[_0xf54e('0x81')](jwt[_0xf54e('0x82')],{'context':jwt});var _0x3bf476=_0x47596c[_0xf54e('0x83')]||config[_0xf54e('0xb')][_0xf54e('0xc')];return new BPromise(function(_0x1f9dad,_0x2c6d0e){_0x2b11f8(_0x47596c[_0xf54e('0x84')],_0x3bf476,_0x47596c[_0xf54e('0x85')])['then'](function(_0x302f3d){_0x1f9dad(_0x302f3d);})[_0xf54e('0x4b')](function(_0xb7ff4d){_0x2c6d0e(_0xb7ff4d);});});}function verifyJwt(_0x11908b,_0x1e4c0d,_0x494629){var _0xf50b1b=BPromise[_0xf54e('0x81')](jwt['verify'],{'context':jwt});var _0x51ec35=_0x494629||config[_0xf54e('0xb')]['session'];return new BPromise(function(_0x26322a,_0x39c5eb){_0xf50b1b(_0x11908b,_0x51ec35,_0x1e4c0d)[_0xf54e('0x3e')](function(_0x9789b9){_0x26322a(_0x9789b9);})['catch'](function(_0x2ecda1){_0x39c5eb(_0x2ecda1);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf54e('0x86')](_0xf54e('0x87'));}function generateIssuedAt(){return Math[_0xf54e('0x88')](Date['now']()/0x3e8)[_0xf54e('0x86')]();}function createJwt(_0x504ec7){var _0x3f7224={'payload':{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce']},'options':{'algorithm':_0xf54e('0x89'),'subject':_0x504ec7['id']['toString'](),'issuer':hardwareConf[_0xf54e('0x50')](),'audience':hardwareConf[_0xf54e('0x50')]()}};return signJwt(_0x3f7224)[_0xf54e('0x3e')](function(_0x38405c){return{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce'],'token':_0x38405c};});} \ No newline at end of file +var _0x54ef=['../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','moment','secrets','session','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','headers','authorization','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','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.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','payload','options','toString','hex','floor','HS512','../../mysqldb','../../config/environment'];(function(_0x2bdff1,_0x3faac6){var _0x491a00=function(_0x2bfe3d){while(--_0x2bfe3d){_0x2bdff1['push'](_0x2bdff1['shift']());}};_0x491a00(++_0x3faac6);}(_0x54ef,0x112));var _0xf54e=function(_0x1ba368,_0x4c6010){_0x1ba368=_0x1ba368-0x0;var _0x32a6a1=_0x54ef[_0x1ba368];return _0x32a6a1;};'use strict';var db=require(_0xf54e('0x0'))['db'];var config=require(_0xf54e('0x1'));var hardwareConf=require(_0xf54e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf54e('0x3'));var _=require(_0xf54e('0x4'));var jwt=require(_0xf54e('0x5'));var expressJwt=require(_0xf54e('0x6'));var compose=require(_0xf54e('0x7'));var basicAuth=require(_0xf54e('0x8'));var crypto=require(_0xf54e('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xf54e('0xa'));var validateJwt=expressJwt({'secret':config[_0xf54e('0xb')][_0xf54e('0xc')]});var userAttributes=['id','role',_0xf54e('0xd'),'name',_0xf54e('0xe'),_0xf54e('0xf'),'userpic',_0xf54e('0x10'),_0xf54e('0x11'),_0xf54e('0x12'),_0xf54e('0x13'),'mailPause',_0xf54e('0x14'),_0xf54e('0x15'),_0xf54e('0x16'),_0xf54e('0x17'),'showWebBar',_0xf54e('0x18'),'lastPauseAt','crudPermissions',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'phoneBarAutoAnswerDelay',_0xf54e('0x1d'),_0xf54e('0x1e'),_0xf54e('0x1f'),_0xf54e('0x20'),'phoneBarExpires',_0xf54e('0x21'),_0xf54e('0x22'),_0xf54e('0x23'),'hotdesk','interface',_0xf54e('0x24'),_0xf54e('0x25'),_0xf54e('0x26'),_0xf54e('0x27'),_0xf54e('0x28'),_0xf54e('0x29'),_0xf54e('0x2a'),_0xf54e('0x2b'),_0xf54e('0x2c'),_0xf54e('0x2d'),_0xf54e('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0xf54e('0x2f'),'smsAutoanswerDelay',_0xf54e('0x30'),_0xf54e('0x31'),_0xf54e('0x32'),_0xf54e('0x33'),_0xf54e('0x34'),_0xf54e('0x35')];exports[_0xf54e('0x36')]=function(){return this[_0xf54e('0x37')](!![])[_0xf54e('0x38')](function(_0x5f9eea,_0x1c58bd,_0x5b83df){if(_0x5f9eea[_0xf54e('0x39')]){_0x5b83df();}else{return db['ChatInteraction'][_0xf54e('0x3a')]({'where':{'id':_0x5f9eea[_0xf54e('0x3b')]['id']},'attributes':['id',_0xf54e('0x3c'),_0xf54e('0x3d')],'raw':!![]})[_0xf54e('0x3e')](function(_0x160160){if(_0x160160&&_0x160160[_0xf54e('0x3c')]){return _0x1c58bd[_0xf54e('0x3f')](_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?0x195:0x193)[_0xf54e('0x41')]({'message':_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?'Unmanaged.':_0xf54e('0x42')});}else{_0x5b83df();}})['catch'](function(_0x282c63){_0x5b83df(_0x282c63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15b888){return compose()[_0xf54e('0x38')](function(_0x21ba00,_0xa13cd0,_0x25b643){var _0x3993e4;if(_0x21ba00[_0xf54e('0x43')]['authorization']){if(_['startsWith'](_0x21ba00[_0xf54e('0x43')][_0xf54e('0x44')],_0xf54e('0x45'))){var _0x16d00f=basicAuth(_0x21ba00);db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'name':_0x16d00f[_0xf54e('0x48')]}})[_0xf54e('0x3e')](function(_0x3ae704){if(!_0x3ae704||!_0x3ae704[_0xf54e('0x49')](_0x16d00f['pass'])){return _0xa13cd0['status'](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x4a')});}_0x21ba00['user']={'id':_0x3ae704['id']};_0x25b643();})[_0xf54e('0x4b')](function(_0x82e313){_0x25b643(_0x82e313);});}else if(_[_0xf54e('0x4c')](_0x21ba00[_0xf54e('0x43')]['authorization'],'Bearer')){validateJwt(_0x21ba00,_0xa13cd0,_0x25b643);}else{if(_0x15b888){_0x25b643();}else{return _0xa13cd0['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x4d')});}}}else if(_0x21ba00[_0xf54e('0x4e')][_0xf54e('0x4f')]){try{var _0x29dc39={'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ba00['query']['apikey'],_0x29dc39)[_0xf54e('0x3e')](function(_0x734187){return db['User']['find']({'where':{'id':_0x734187[_0xf54e('0x51')]}})[_0xf54e('0x3e')](function(_0x173e6c){_0x3993e4=_0x173e6c;return db['Setting'][_0xf54e('0x3a')]({'where':{'id':0x1},'attributes':[_0xf54e('0x52'),'blockDuration'],'raw':!![]});})[_0xf54e('0x3e')](function(_0x6e5bdf){if(!_0x3993e4||!_[_0xf54e('0x53')](_0x3993e4[_0xf54e('0x54')],_0x734187[_0xf54e('0x55')])){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3993e4[_0xf54e('0x56')]){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3993e4[_0xf54e('0x57')]){if(_0x6e5bdf[_0xf54e('0x58')]>0x0){if(moment(_0x3993e4[_0xf54e('0x59')])[_0xf54e('0x5a')](_0x6e5bdf[_0xf54e('0x58')],_0xf54e('0x5b'))>moment()){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}else{return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}_0x21ba00[_0xf54e('0x39')]={'id':_0x3993e4['id']};_0x25b643();});})[_0xf54e('0x4b')](function(){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x533423){_0x25b643(_0x533423);}}else if(_0x15b888){_0x25b643();}else{return _0xa13cd0[_0xf54e('0x3f')](0x193)[_0xf54e('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf54e('0x38')](function(_0x311ce1,_0x381c03,_0x4f61d7){if(_0x311ce1[_0xf54e('0x39')]){db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'id':_0x311ce1[_0xf54e('0x39')]['id']},'attributes':userAttributes})[_0xf54e('0x3e')](function(_0x143a39){if(!_0x143a39){return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5d')});}_0x311ce1['user']=_0x143a39;_0x4f61d7();})[_0xf54e('0x4b')](function(_0x3447fd){_0x4f61d7(_0x3447fd);});}else if(_0x15b888){_0x4f61d7();}else{return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5e')});}});};exports[_0xf54e('0x5f')]=function canUpdate(){return compose()['use'](function(_0x23a4a1,_0x59af72,_0x1d16e0){return licenseUtil['getLicense']()[_0xf54e('0x3e')](function(_0x331b16){if(_0x331b16[_0xf54e('0x60')]){_0x1d16e0();}else{return _0x59af72['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0x32fb46){_0x1d16e0(_0x32fb46);});});};exports[_0xf54e('0x62')]=function isWebrtcLicence(){return compose()['use'](function(_0x427799,_0x297737,_0x346bb4){return licenseUtil[_0xf54e('0x63')]()['then'](function(_0x1bdb5a){if(_0x1bdb5a[_0xf54e('0x64')]){_0x346bb4();}else{return _0x297737['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0xca0141){_0x346bb4(_0xca0141);});});};exports['isMiddleware']=function(_0x196e68,_0x2b645e,_0x2527f6){_0x196e68[_0xf54e('0x65')]=!![];return _0x2527f6();};exports[_0xf54e('0x66')]=function signToken(_0x3237ef){return signJwt(_0x3237ef);};exports[_0xf54e('0x67')]=function(_0xd7b0c5,_0x15bfef){if(!_0xd7b0c5[_0xf54e('0x39')]){return _0x15bfef[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x68')});}var _0x2de1fe={'payload':{'id':_0xd7b0c5[_0xf54e('0x39')]['id'],'role':_0xd7b0c5[_0xf54e('0x39')][_0xf54e('0x69')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2de1fe)[_0xf54e('0x3e')](function(_0x21fd80){_0x15bfef[_0xf54e('0x6a')]('motion.token',_0x21fd80);_0x15bfef['redirect'](_0xf54e('0x6b'));})[_0xf54e('0x4b')](function(_0x45861b){return _0x15bfef[_0xf54e('0x3f')](0x1f4)[_0xf54e('0x6c')](_0x45861b);});};exports[_0xf54e('0x6d')]=function(_0x22763f){if(_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x54')])||_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x6f')])){return null;}else{return createJwt(_0x22763f);}};exports['generateApiKey']=function(_0x2aacf6){_0x2aacf6[_0xf54e('0x54')]=generateNonce();_0x2aacf6[_0xf54e('0x6f')]=generateIssuedAt();return createJwt(_0x2aacf6);};exports[_0xf54e('0x70')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f=_0x1b8f16['query'][_0xf54e('0x4f')];if(_0x18a25f){var _0x5fabd2={'nonce':_0x30f53b[_0xf54e('0x54')],'iat':_0x30f53b['apiKeyIat'],'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18a25f,_0x5fabd2)[_0xf54e('0x3e')](function(){return generateApiKey(_0x30f53b);});}else{throw{'message':_0xf54e('0x71')};}};exports[_0xf54e('0x72')]=function(_0x5b882f){var _0x1d8ccf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8ccf[_0xf54e('0x73')](_0x5b882f))throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0xf54e('0x76'));return;};exports[_0xf54e('0x77')]=function(_0x21d485,_0x55d57f,_0x55de5c){var _0x4270e1=encryptor[_0xf54e('0x78')](_0x55d57f)['split'](',');for(var _0x29743e=0x0;_0x29743e<_0x55de5c;_0x29743e++){if(!_0x4270e1[_0x29743e])break;if(_0x21d485['toLowerCase']()===_0x4270e1[_0x29743e][_0xf54e('0x79')]()){var _0x528a64=util[_0xf54e('0x7a')](_0xf54e('0x7b'),_0x55de5c);if(_0x55de5c===0x1){_0x528a64=_0xf54e('0x7c');}throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0x528a64);}}return;};exports[_0xf54e('0x7d')]=function(_0x556e55,_0x479572){var _0x79345=_0x479572?encryptor[_0xf54e('0x78')](_0x479572)['split'](','):[];if(_0x79345['length']===0x5){_0x79345[_0xf54e('0x7e')](-0x1,0x1);}_0x79345['unshift'](_0x556e55);return encryptor[_0xf54e('0x7f')](_0x79345[_0xf54e('0x80')](','));};function signJwt(_0x47596c){var _0x2b11f8=BPromise[_0xf54e('0x81')](jwt[_0xf54e('0x82')],{'context':jwt});var _0x3bf476=_0x47596c[_0xf54e('0x83')]||config[_0xf54e('0xb')][_0xf54e('0xc')];return new BPromise(function(_0x1f9dad,_0x2c6d0e){_0x2b11f8(_0x47596c[_0xf54e('0x84')],_0x3bf476,_0x47596c[_0xf54e('0x85')])['then'](function(_0x302f3d){_0x1f9dad(_0x302f3d);})[_0xf54e('0x4b')](function(_0xb7ff4d){_0x2c6d0e(_0xb7ff4d);});});}function verifyJwt(_0x11908b,_0x1e4c0d,_0x494629){var _0xf50b1b=BPromise[_0xf54e('0x81')](jwt['verify'],{'context':jwt});var _0x51ec35=_0x494629||config[_0xf54e('0xb')]['session'];return new BPromise(function(_0x26322a,_0x39c5eb){_0xf50b1b(_0x11908b,_0x51ec35,_0x1e4c0d)[_0xf54e('0x3e')](function(_0x9789b9){_0x26322a(_0x9789b9);})['catch'](function(_0x2ecda1){_0x39c5eb(_0x2ecda1);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf54e('0x86')](_0xf54e('0x87'));}function generateIssuedAt(){return Math[_0xf54e('0x88')](Date['now']()/0x3e8)[_0xf54e('0x86')]();}function createJwt(_0x504ec7){var _0x3f7224={'payload':{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce']},'options':{'algorithm':_0xf54e('0x89'),'subject':_0x504ec7['id']['toString'](),'issuer':hardwareConf[_0xf54e('0x50')](),'audience':hardwareConf[_0xf54e('0x50')]()}};return signJwt(_0x3f7224)[_0xf54e('0x3e')](function(_0x38405c){return{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce'],'token':_0x38405c};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index de54899..506e94e 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b07=['getFilteredContacts','rows','catch','describe','startsWith','cf_','map','CmCustomField','findOne','all','length','fieldType','type','keys','lodash','./sql-utils','../../mysqldb','skipContactsQuery','getContactsSubquery','search','parseAdvancedSearchFilter','then','where','default','fields','filter','clause','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x2b07,0x103));var _0x72b0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2b07[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x72b0('0x0'));var sqlUtils=require(_0x72b0('0x1'));var db=require(_0x72b0('0x2'))['db'];exports['findAll']=function(_0xce2917,_0x23acca,_0x4b30b1,_0x206985){var _0x153a43={'count':0x0,'rows':[]};var _0x566456=sqlUtils[_0x72b0('0x3')](_0x23acca,_0xce2917);if(_0x566456){return Promise['resolve'](_0x153a43);}var _0x2f246d=sqlUtils[_0x72b0('0x4')]();var _0x446873={};var _0x1b88b5=![];var _0x4d0af1=![];return Promise['resolve']()['then'](function(){if(_0xce2917[_0x72b0('0x5')]){return sqlUtils[_0x72b0('0x6')](_0xce2917[_0x72b0('0x5')],_0x206985);}else{return sqlUtils['parseQueryParameters'](_0xce2917,_0x206985);}})[_0x72b0('0x7')](function(_0x74bf75){_0x2f246d[_0x72b0('0x8')](_0x74bf75[_0x72b0('0x9')]);_0x2f246d[_0x72b0('0x8')](_0x74bf75[_0x72b0('0xa')]);_0x2f246d[_0x72b0('0x8')](_0x74bf75[_0x72b0('0xb')]);_0x2f246d[_0x72b0('0x8')](_0x74bf75['user'][_0x72b0('0xc')]);_0x446873=_0x74bf75['tags'];_0x4d0af1=_0x74bf75['user'][_0x72b0('0xd')];return sqlUtils[_0x72b0('0xe')](_0x23acca,_0xce2917,_0x4d0af1);})[_0x72b0('0x7')](function(_0x3cbd1e){_0x2f246d[_0x72b0('0x8')](_0x3cbd1e);var _0x9bd98b=_0xce2917['search']?_0x446873[_0x72b0('0xf')]:_0xce2917[_0x72b0('0x10')];_0x1b88b5=_0x9bd98b?!![]:![];return sqlUtils[_0x72b0('0x11')](_0x2f246d,_0x9bd98b);})['then'](function(_0x2293be){_0x153a43[_0x72b0('0x12')]=_0x2293be;if(_0x153a43[_0x72b0('0x12')]===0x0){return;}if(_0xce2917[_0x72b0('0x13')]){_0x4d0af1=!![];}return sqlUtils[_0x72b0('0x14')](_0x2f246d,_0xce2917[_0x72b0('0xa')],_0x4b30b1,_0x1b88b5,_0x446873[_0x72b0('0xc')],_0x4d0af1);})[_0x72b0('0x7')](function(_0x191dae){if(!_0x191dae){return[];}return sqlUtils[_0x72b0('0x15')](_0x191dae,_0xce2917,_0x4b30b1);})['then'](function(_0x1e3951){_0x153a43[_0x72b0('0x16')]=_0x1e3951;return _0x153a43;})[_0x72b0('0x17')](function(_0x2b9e94){throw _0x2b9e94;});};exports[_0x72b0('0x18')]=function(){var _0x83c533={};var _0x72c7c5=[];return db['CmContact'][_0x72b0('0x18')]()[_0x72b0('0x7')](function(_0x3fbad1){_0x83c533=_0x3fbad1;var _0x286c89=Object['keys'](_0x83c533)[_0x72b0('0xb')](function(_0x307926){return _[_0x72b0('0x19')](_0x307926,_0x72b0('0x1a'))?_0x307926:undefined;});var _0xed095f=_0x286c89[_0x72b0('0x1b')](function(_0x2646e9){return db[_0x72b0('0x1c')][_0x72b0('0x1d')]({'where':{'id':_0x2646e9['slice'](0x3)},'raw':!![]});});return Promise[_0x72b0('0x1e')](_0xed095f);})[_0x72b0('0x7')](function(_0x7eff39){for(var _0x483932=0x0;_0x483932<_0x7eff39[_0x72b0('0x1f')];_0x483932++){if(_0x7eff39[_0x483932]){var _0x4ef20f=_0x72b0('0x1a')+_0x7eff39[_0x483932]['id'];_0x83c533[_0x4ef20f][_0x72b0('0x20')]=_0x7eff39[_0x483932][_0x72b0('0x21')];}}_0x72c7c5=_[_0x72b0('0x1b')](Object[_0x72b0('0x22')](_0x83c533),function(_0x1bb9be){return{'name':_0x1bb9be,'type':_0x83c533[_0x1bb9be][_0x72b0('0x21')]};});return _0x72c7c5;})['catch'](function(_0x2f0ca5){throw _0x2f0ca5;});}; \ No newline at end of file +var _0x3f14=['../../mysqldb','findAll','resolve','getContactsSubquery','search','parseAdvancedSearchFilter','parseQueryParameters','where','fields','filter','user','skip','checkListsRestrictions','then','ids','tag','countFilteredContacts','count','User','buildContactsQuery','clause','getFilteredContacts','rows','catch','describe','CmContact','keys','CmCustomField','slice','all','length','cf_','fieldType','type','map','lodash','./sql-utils'];(function(_0x547c2a,_0x42e032){var _0x4206c9=function(_0x4ae715){while(--_0x4ae715){_0x547c2a['push'](_0x547c2a['shift']());}};_0x4206c9(++_0x42e032);}(_0x3f14,0xdc));var _0x43f1=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0x3f14[_0x1deb72];return _0x18bbdf;};'use strict';var _=require(_0x43f1('0x0'));var sqlUtils=require(_0x43f1('0x1'));var db=require(_0x43f1('0x2'))['db'];exports[_0x43f1('0x3')]=function(_0x2bfebc,_0x5da12d,_0xb82bfc,_0x35ff8b){var _0x1d0ca8={'count':0x0,'rows':[]};var _0x33497e=sqlUtils['skipContactsQuery'](_0x5da12d,_0x2bfebc);if(_0x33497e){return Promise[_0x43f1('0x4')](_0x1d0ca8);}var _0x1c827e=sqlUtils[_0x43f1('0x5')]();var _0x52be8f={};var _0x398aca=![];var _0x1bba6f=![];return Promise[_0x43f1('0x4')]()['then'](function(){if(_0x2bfebc[_0x43f1('0x6')]){return sqlUtils[_0x43f1('0x7')](_0x2bfebc[_0x43f1('0x6')],_0x35ff8b);}else{return sqlUtils[_0x43f1('0x8')](_0x2bfebc,_0x35ff8b);}})['then'](function(_0x54865d){_0x1c827e[_0x43f1('0x9')](_0x54865d['default']);_0x1c827e['where'](_0x54865d[_0x43f1('0xa')]);_0x1c827e[_0x43f1('0x9')](_0x54865d[_0x43f1('0xb')]);_0x1c827e['where'](_0x54865d[_0x43f1('0xc')]['clause']);_0x52be8f=_0x54865d['tags'];_0x1bba6f=_0x54865d[_0x43f1('0xc')][_0x43f1('0xd')];return sqlUtils[_0x43f1('0xe')](_0x5da12d,_0x2bfebc,_0x1bba6f);})[_0x43f1('0xf')](function(_0x21f826){_0x1c827e[_0x43f1('0x9')](_0x21f826);var _0x3a838f=_0x2bfebc[_0x43f1('0x6')]?_0x52be8f[_0x43f1('0x10')]:_0x2bfebc[_0x43f1('0x11')];_0x398aca=_0x3a838f?!![]:![];return sqlUtils[_0x43f1('0x12')](_0x1c827e,_0x3a838f);})[_0x43f1('0xf')](function(_0xa24813){_0x1d0ca8[_0x43f1('0x13')]=_0xa24813;if(_0x1d0ca8[_0x43f1('0x13')]===0x0){return;}if(_0x2bfebc[_0x43f1('0x14')]){_0x1bba6f=!![];}return sqlUtils[_0x43f1('0x15')](_0x1c827e,_0x2bfebc[_0x43f1('0xa')],_0xb82bfc,_0x398aca,_0x52be8f[_0x43f1('0x16')],_0x1bba6f);})[_0x43f1('0xf')](function(_0x4672e0){if(!_0x4672e0){return[];}return sqlUtils[_0x43f1('0x17')](_0x4672e0,_0x2bfebc,_0xb82bfc);})[_0x43f1('0xf')](function(_0x325952){_0x1d0ca8[_0x43f1('0x18')]=_0x325952;return _0x1d0ca8;})[_0x43f1('0x19')](function(_0x59de8d){throw _0x59de8d;});};exports[_0x43f1('0x1a')]=function(){var _0x5ca098={};var _0x55ee4a=[];return db[_0x43f1('0x1b')][_0x43f1('0x1a')]()['then'](function(_0x792ba9){_0x5ca098=_0x792ba9;var _0x1a47e8=Object[_0x43f1('0x1c')](_0x5ca098)['filter'](function(_0x1e10a2){return _['startsWith'](_0x1e10a2,'cf_')?_0x1e10a2:undefined;});var _0xfed2e=_0x1a47e8['map'](function(_0x1dcd5b){return db[_0x43f1('0x1d')]['findOne']({'where':{'id':_0x1dcd5b[_0x43f1('0x1e')](0x3)},'raw':!![]});});return Promise[_0x43f1('0x1f')](_0xfed2e);})[_0x43f1('0xf')](function(_0x22e89a){for(var _0x1b1eeb=0x0;_0x1b1eeb<_0x22e89a[_0x43f1('0x20')];_0x1b1eeb++){if(_0x22e89a[_0x1b1eeb]){var _0x24d7bb=_0x43f1('0x21')+_0x22e89a[_0x1b1eeb]['id'];_0x5ca098[_0x24d7bb][_0x43f1('0x22')]=_0x22e89a[_0x1b1eeb][_0x43f1('0x23')];}}_0x55ee4a=_[_0x43f1('0x24')](Object[_0x43f1('0x1c')](_0x5ca098),function(_0x3ba274){return{'name':_0x3ba274,'type':_0x5ca098[_0x3ba274][_0x43f1('0x23')]};});return _0x55ee4a;})[_0x43f1('0x19')](function(_0x15f6cd){throw _0x15f6cd;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index e514cc0..0d1dd40 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e67=['.id','ct.CmContactId\x20=\x20','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','includes','push','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','name','dateOfBirth','datetime','DATE','buildExpression','type','default','text','value','start','end','map','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','c.ListId\x20IN\x20?','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','filter','getLists','attributes','select','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','findAll','color','CmContact','sequelize','query','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','QueryTypes','toString','exports','lodash','squel','../parsers/advancedSearch','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20'];(function(_0x3fcdc2,_0x1d4c33){var _0x998d0b=function(_0x1d62f2){while(--_0x1d62f2){_0x3fcdc2['push'](_0x3fcdc2['shift']());}};_0x998d0b(++_0x1d4c33);}(_0x9e67,0xc8));var _0x79e6=function(_0x5734bc,_0x563194){_0x5734bc=_0x5734bc-0x0;var _0x5875c1=_0x9e67[_0x5734bc];return _0x5875c1;};'use strict';var _=require(_0x79e6('0x0'));var squel=require(_0x79e6('0x1'));var as=require(_0x79e6('0x2'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0x79e6('0x3'))['db'];function skipContactsQuery(_0x1439d9,_0x53888b){var _0x1d49fb=![];if(_0x1439d9[_0x79e6('0x4')]===_0x79e6('0x5')&&!_0x53888b[_0x79e6('0x6')]&&!_0x53888b[_0x79e6('0x7')]&&_0x53888b[_0x79e6('0x8')]!==_0x79e6('0x9')){_0x1d49fb=!![];}return _0x1d49fb;}function getContactsSubquery(){return squel['select']()[_0x79e6('0xa')](_0x79e6('0xb'),'c')[_0x79e6('0xc')](_0x79e6('0xd'));}function applyJoinClauses(_0x31aa2f,_0x51086e){var _0x336e55=_0x51086e?'c':_0x79e6('0xe');_0x31aa2f[_0x79e6('0xf')](_0x79e6('0x10'),'uc',_0x79e6('0x11')+_0x336e55+_0x79e6('0x12'))[_0x79e6('0xf')]('cm_contact_has_tags','ct',_0x79e6('0x13')+_0x336e55+_0x79e6('0x12'))[_0x79e6('0xf')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x31aa2f;}function addFieldsToQuery(_0x14cfe5,_0x406075,_0x7dec00,_0x433241,_0x3c8b3c){var _0x13bc40=_0x3c8b3c?'c':_0x79e6('0xe');if(!_0x406075){_0x406075=['id',_0x79e6('0x14'),_0x79e6('0x15'),_0x79e6('0x16'),_0x79e6('0x17'),_0x79e6('0x18'),_0x79e6('0x19'),_0x79e6('0x7'),'CompanyId',_0x79e6('0x1a'),_0x79e6('0x1b'),_0x79e6('0x1c'),'TagIds'];}else if(!_0x406075[_0x79e6('0x1d')]('id')){_0x406075[_0x79e6('0x1e')]('id');}var _0x3260e9=_0x7dec00&&_0x3c8b3c||!_0x7dec00&&!_0x3c8b3c;if(_0x433241){_0x3260e9=_0x433241&&_0x3c8b3c||!_0x433241&&!_0x3c8b3c;}_0x406075['forEach'](function(_0x32aaa){if(_0x32aaa===_0x79e6('0x1f')){if(_0x3260e9){_0x14cfe5[_0x79e6('0x20')](_0x79e6('0x21'),_0x32aaa);}else if(_0x7dec00||_0x433241){_0x14cfe5['field'](_0x13bc40+'.'+_0x32aaa);}}else{_0x14cfe5[_0x79e6('0x20')](_0x13bc40+'.'+_0x32aaa);}});return _0x14cfe5;}function getSqlClauses(){var _0x4242db={'default':squel['expr'](),'fields':squel[_0x79e6('0x22')](),'filter':squel[_0x79e6('0x22')](),'tags':{'clause':squel[_0x79e6('0x22')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x4242db;}function parseTagParameter(_0x2c63b0){var _0x48e38a=squel[_0x79e6('0x22')]();if(_0x2c63b0){var _0x590597=utils[_0x79e6('0x23')](_0x2c63b0);_0x590597[_0x79e6('0x24')](function(_0x447cc4){_0x48e38a['or'](_0x79e6('0x25'),'%,'+_0x447cc4+',%');});}return _0x48e38a;}function parseSearchFilter(_0x2809ae){var _0x3575e6=squel[_0x79e6('0x22')]();if(_0x2809ae){var _0x489d2f=_0x2809ae[_0x79e6('0x26')]('\x5c','\x5c\x5c')[_0x79e6('0x26')](/'/g,'\x27\x27');if(_0x489d2f[_0x79e6('0x27')]('\x20')['length']>0x1){_0x3575e6['or'](_0x79e6('0x28'),qs[_0x79e6('0x29')](_0x489d2f,!![]),null);}else{if(qs[_0x79e6('0x2a')](_0x489d2f)){_0x3575e6['or'](_0x79e6('0x2b'),_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x2c'),_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x2d'),_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x2e'),_0x489d2f+'%');}else if(qs[_0x79e6('0x2f')](_0x489d2f)){_0x3575e6['or'](_0x79e6('0x30'),_0x489d2f+'%');}else{_0x3575e6['or'](_0x79e6('0x31'),'%'+_0x489d2f+'%');_0x3575e6['or']('c.lastName\x20LIKE\x20?','%'+_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x30'),'%'+_0x489d2f+'%');}}}return _0x3575e6;}function parseAdvancedSearchFilter(_0x2990e8,_0xca1d81){var _0x3b3990=getSqlClauses();var _0x3aa56a=as[_0x79e6('0x32')](_0x2990e8);var _0x4c7807=_0x3aa56a[_0x79e6('0x33')];for(var _0x3765ec=0x0;_0x3765ec<_0x3aa56a[_0x79e6('0x34')][_0x79e6('0x35')];_0x3765ec++){var _0x3a058b=_0x3aa56a['conditions'][_0x3765ec];var _0x2e6ffc='c';var _0x1a7c86=_['find'](_0xca1d81,[_0x79e6('0x36'),_0x3a058b[_0x79e6('0x20')]]);if(_0x1a7c86){if(_0x3a058b[_0x79e6('0x20')]===_0x79e6('0x37')||_0x1a7c86['fieldType']===_0x79e6('0x38')){_0x3a058b['castTo']=_0x79e6('0x39');}var _0x65f304=as[_0x79e6('0x3a')](_0x2e6ffc,_0x1a7c86[_0x79e6('0x3b')],_0x3a058b);_0x3b3990[_0x79e6('0x3c')][_0x4c7807](_0x65f304[_0x79e6('0x3d')],_0x65f304[_0x79e6('0x3e')][_0x79e6('0x3f')],_0x65f304['value'][_0x79e6('0x40')]);}else{if(_0x3a058b[_0x79e6('0x20')]==='Tag'){var _0x2bfa3b=_0x3a058b[_0x79e6('0x3e')][_0x79e6('0x27')](',')[_0x79e6('0x41')](function(_0x3b1cb5){return Number(_0x3b1cb5);});var _0x2918f7=parseTagParameter(_0x2bfa3b);_0x3b3990['tags'][_0x79e6('0x42')][_0x79e6('0x43')](_0x2918f7);_0x3b3990['tags'][_0x79e6('0x44')]=_0x2bfa3b;}else if(_0x3a058b[_0x79e6('0x20')]===_0x79e6('0x45')){_0x3b3990[_0x79e6('0x46')][_0x79e6('0x42')][_0x79e6('0x43')](_0x79e6('0x47'),_0x3a058b[_0x79e6('0x3e')]);_0x3b3990[_0x79e6('0x46')][_0x79e6('0x48')]=!![];}}}return _0x3b3990;}function parseModelFields(_0x5d0fa0,_0x7783ee){var _0x2eae93=squel[_0x79e6('0x22')]();var _0x1612c8=_(_0x5d0fa0)[_0x79e6('0x49')]()[_0x79e6('0x41')](function(_0x17c8f0){return _[_0x79e6('0x4a')](_0x7783ee,[_0x79e6('0x36'),_0x17c8f0])?_0x17c8f0:undefined;})[_0x79e6('0x4b')]()[_0x79e6('0x3e')]();if(_0x5d0fa0['Contact']){_0x1612c8[_0x79e6('0x1e')]('Contact');}if(_0x5d0fa0[_0x79e6('0x45')]){_0x1612c8[_0x79e6('0x1e')](_0x79e6('0x45'));}if(_0x1612c8['length']>0x0){_0x1612c8['forEach'](function(_0x2bb207){if(_0x2bb207===_0x79e6('0x7')){_0x2eae93[_0x79e6('0x43')](_0x79e6('0x4c'),[][_0x79e6('0x4d')](_0x5d0fa0[_0x2bb207]));}else if(_0x2bb207===_0x79e6('0x4e')){var _0x2c669f='%'+_0x5d0fa0[_0x2bb207]+'%';_0x2eae93[_0x79e6('0x43')](_0x79e6('0x4f'),_0x2c669f);}else if(_0x2bb207===_0x79e6('0x45')){_0x2eae93['and']('uc.UserId\x20=\x20?',_0x5d0fa0[_0x2bb207]);}else{_0x2eae93[_0x79e6('0x43')]('c.'+_0x2bb207+'\x20=\x20?',_0x5d0fa0[_0x2bb207]);}});}return _0x2eae93;}function parseQueryParameters(_0x5b6587,_0xef5007){var _0x112562=getSqlClauses();return Promise[_0x79e6('0x50')]()[_0x79e6('0x51')](function(){return parseModelFields(_0x5b6587,_0xef5007);})[_0x79e6('0x51')](function(_0x13564a){_0x112562[_0x79e6('0x52')][_0x79e6('0x43')](_0x13564a);return parseTagParameter(_0x5b6587['tag']);})['then'](function(_0x161cce){_0x112562['tags'][_0x79e6('0x42')][_0x79e6('0x43')](_0x161cce);return parseSearchFilter(_0x5b6587[_0x79e6('0x53')]);})[_0x79e6('0x51')](function(_0x2b4279){_0x112562[_0x79e6('0x53')]=_0x2b4279;return _0x112562;});}function checkListsRestrictions(_0x3df11d,_0x316c2e,_0x3cc95b){var _0x5992d5=squel[_0x79e6('0x22')]();return Promise[_0x79e6('0x50')]()[_0x79e6('0x51')](function(){if(_0x316c2e[_0x79e6('0x6')]&&_0x3df11d[_0x79e6('0x4')]===_0x79e6('0x5')&&!_0x3cc95b){return _0x3df11d[_0x79e6('0x54')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x8d9aab){if(_0x8d9aab){if(_0x8d9aab[_0x79e6('0x35')]===0x0){_0x5992d5[_0x79e6('0x43')]('c.ListId\x20IS\x20NULL');}else{_0x5992d5[_0x79e6('0x43')](_0x79e6('0x4c'),_[_0x79e6('0x41')](_0x8d9aab,'id'));}}})[_0x79e6('0x51')](function(){return _0x5992d5;});}function buildContactsQuery(_0x1e89c2,_0x460400,_0x2571a8,_0x3f5212,_0x6163fa,_0x313798){if(_0x460400){_0x460400=_0x2571a8[_0x79e6('0x55')];}_0x1e89c2=addFieldsToQuery(_0x1e89c2,_0x460400,_0x3f5212,_0x313798,!![]);var _0xa517fc=squel[_0x79e6('0x56')]();_0xa517fc=addFieldsToQuery(_0xa517fc,_0x460400,_0x3f5212,_0x313798,![]);if(_0x3f5212||_0x313798){_0x1e89c2=applyJoinClauses(_0x1e89c2,!![]);_0x1e89c2[_0x79e6('0x57')](_0x79e6('0x58'));if(_0x2571a8[_0x79e6('0x59')]){_0xa517fc[_0x79e6('0x59')](_0x2571a8[_0x79e6('0x59')]);}if(_0x2571a8[_0x79e6('0x5a')]){_0xa517fc[_0x79e6('0x5a')](_0x2571a8[_0x79e6('0x5a')]);}}else{_0xa517fc=applyJoinClauses(_0xa517fc,![]);_0xa517fc[_0x79e6('0x57')](_0x79e6('0x5b'));if(_0x2571a8[_0x79e6('0x59')]){_0x1e89c2[_0x79e6('0x59')](_0x2571a8[_0x79e6('0x59')]);}if(_0x2571a8[_0x79e6('0x5a')]){_0x1e89c2[_0x79e6('0x5a')](_0x2571a8[_0x79e6('0x5a')]);}}_0xa517fc['having'](_0x6163fa);if(_0x2571a8[_0x79e6('0x5c')]){_0x2571a8[_0x79e6('0x5c')]['forEach'](function(_0x1fe40d){_0x1e89c2[_0x79e6('0x5c')]('c.'+_0x1fe40d[0x0],_0x1fe40d[0x1]===_0x79e6('0x5d')?![]:!![]);_0xa517fc['order'](_0x79e6('0x5e')+_0x1fe40d[0x0],_0x1fe40d[0x1]===_0x79e6('0x5d')?![]:!![]);});}_0xa517fc[_0x79e6('0xa')](_0x1e89c2,_0x79e6('0xe'));return _0xa517fc;}function getFilteredContacts(_0x2939c6){var _0x18b989=[];return db['Tag'][_0x79e6('0x5f')]({'attributes':['id',_0x79e6('0x36'),_0x79e6('0x60')],'raw':!![]})[_0x79e6('0x51')](function(_0x431404){_0x18b989=_['keyBy'](_0x431404,'id');var _0x115cd1={'type':db['Sequelize']['QueryTypes']['SELECT'],'model':db[_0x79e6('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x79e6('0x62')][_0x79e6('0x63')](_0x2939c6['toString'](),_0x115cd1);})[_0x79e6('0x51')](function(_0x22d80f){_0x22d80f[_0x79e6('0x24')](function(_0x5b4caf){if(_0x5b4caf[_0x79e6('0x1f')]){_0x5b4caf[_0x79e6('0x64')]=[];_0x5b4caf[_0x79e6('0x1f')]['split'](',')[_0x79e6('0x24')](function(_0x3db857){_0x5b4caf[_0x79e6('0x64')][_0x79e6('0x1e')](_0x18b989[_0x3db857]);});}delete _0x5b4caf['TagIds'];});return _0x22d80f;});}function countFilteredContacts(_0x57417f,_0x302a87){var _0x3a2fee=_0x57417f[_0x79e6('0x65')]();_0x3a2fee[_0x79e6('0x20')](_0x79e6('0x66'));_0x3a2fee=applyJoinClauses(_0x3a2fee,!![]);_0x57417f[_0x79e6('0x57')](_0x79e6('0x58'));var _0xb553a3=utils[_0x79e6('0x23')](_0x302a87);if(!_[_0x79e6('0x67')](_0xb553a3)){_0x3a2fee[_0x79e6('0xc')](_0x79e6('0x68'),_0xb553a3);}var _0x396614={'type':db[_0x79e6('0x69')][_0x79e6('0x6a')]['SELECT'],'raw':!![]};return db[_0x79e6('0x62')][_0x79e6('0x63')](_0x3a2fee[_0x79e6('0x6b')](),_0x396614)[_0x79e6('0x51')](function(_0x53cbf6){return _0x53cbf6[0x0][_0x79e6('0x66')];});}module[_0x79e6('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x29f5=['QueryTypes','SELECT','toString','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','autocomplete','true','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','fax','email','ListId','createdAt','updatedAt','deletedAt','TagIds','includes','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','castTo','DATE','type','default','text','value','start','end','Tag','map','tags','clause','and','User','user','skip','keys','some','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','resolve','then','fields','tag','filter','search','getLists','c.ListId\x20IS\x20NULL','limit','offset','group','subqry.id','having','order','DESC','subqry.','from','keyBy','Sequelize','CmContact','sequelize','query','Tags','clone','c.id','isEmpty','t.id\x20IN\x20?'];(function(_0x48a96f,_0x14e526){var _0x870119=function(_0x1bacd9){while(--_0x1bacd9){_0x48a96f['push'](_0x48a96f['shift']());}};_0x870119(++_0x14e526);}(_0x29f5,0x14f));var _0x529f=function(_0xbd493c,_0x3b2445){_0xbd493c=_0xbd493c-0x0;var _0x39a48b=_0x29f5[_0xbd493c];return _0x39a48b;};'use strict';var _=require(_0x529f('0x0'));var squel=require(_0x529f('0x1'));var as=require(_0x529f('0x2'));var qs=require(_0x529f('0x3'));var utils=require(_0x529f('0x4'));var db=require(_0x529f('0x5'))['db'];function skipContactsQuery(_0x1b4fdf,_0x3a03bc){var _0x525ceb=![];if(_0x1b4fdf[_0x529f('0x6')]===_0x529f('0x7')&&!_0x3a03bc['search']&&!_0x3a03bc['ListId']&&_0x3a03bc[_0x529f('0x8')]!==_0x529f('0x9')){_0x525ceb=!![];}return _0x525ceb;}function getContactsSubquery(){return squel[_0x529f('0xa')]()['from'](_0x529f('0xb'),'c')[_0x529f('0xc')](_0x529f('0xd'));}function applyJoinClauses(_0x23587f,_0x448774){var _0x259004=_0x448774?'c':_0x529f('0xe');_0x23587f[_0x529f('0xf')](_0x529f('0x10'),'uc',_0x529f('0x11')+_0x259004+_0x529f('0x12'))['left_join']('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20'+_0x259004+_0x529f('0x12'))['left_join'](_0x529f('0x13'),'t',_0x529f('0x14'));return _0x23587f;}function addFieldsToQuery(_0xbdefba,_0x11b1ac,_0x481d15,_0x422c54,_0x2d8ac6){var _0x2c2ac9=_0x2d8ac6?'c':_0x529f('0xe');if(!_0x11b1ac){_0x11b1ac=['id',_0x529f('0x15'),_0x529f('0x16'),'phone','mobile',_0x529f('0x17'),_0x529f('0x18'),_0x529f('0x19'),'CompanyId',_0x529f('0x1a'),_0x529f('0x1b'),_0x529f('0x1c'),_0x529f('0x1d')];}else if(!_0x11b1ac[_0x529f('0x1e')]('id')){_0x11b1ac['push']('id');}var _0x5ca29a=_0x481d15&&_0x2d8ac6||!_0x481d15&&!_0x2d8ac6;if(_0x422c54){_0x5ca29a=_0x422c54&&_0x2d8ac6||!_0x422c54&&!_0x2d8ac6;}_0x11b1ac[_0x529f('0x1f')](function(_0x40b0e1){if(_0x40b0e1===_0x529f('0x1d')){if(_0x5ca29a){_0xbdefba[_0x529f('0x20')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x40b0e1);}else if(_0x481d15||_0x422c54){_0xbdefba[_0x529f('0x20')](_0x2c2ac9+'.'+_0x40b0e1);}}else{_0xbdefba[_0x529f('0x20')](_0x2c2ac9+'.'+_0x40b0e1);}});return _0xbdefba;}function getSqlClauses(){var _0x2b4479={'default':squel[_0x529f('0x21')](),'fields':squel['expr'](),'filter':squel[_0x529f('0x21')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x529f('0x21')](),'skip':![]}};return _0x2b4479;}function parseTagParameter(_0x15b8a6){var _0x168832=squel[_0x529f('0x21')]();if(_0x15b8a6){var _0x7c76d9=utils[_0x529f('0x22')](_0x15b8a6);_0x7c76d9[_0x529f('0x1f')](function(_0x5ef6f4){_0x168832['or'](_0x529f('0x23'),'%,'+_0x5ef6f4+',%');});}return _0x168832;}function parseSearchFilter(_0x224422){var _0x141099=squel[_0x529f('0x21')]();if(_0x224422){var _0x52fc25=_0x224422['replace']('\x5c','\x5c\x5c')[_0x529f('0x24')](/'/g,'\x27\x27');if(_0x52fc25[_0x529f('0x25')]('\x20')[_0x529f('0x26')]>0x1){_0x141099['or'](_0x529f('0x27'),qs['getFullTextValue'](_0x52fc25,!![]),null);}else{if(qs['isNumeric'](_0x52fc25)){_0x141099['or'](_0x529f('0x28'),_0x52fc25+'%');_0x141099['or'](_0x529f('0x29'),_0x52fc25+'%');_0x141099['or']('c.mobile\x20LIKE\x20?',_0x52fc25+'%');_0x141099['or'](_0x529f('0x2a'),_0x52fc25+'%');}else if(qs[_0x529f('0x2b')](_0x52fc25)){_0x141099['or']('c.email\x20LIKE\x20?',_0x52fc25+'%');}else{_0x141099['or'](_0x529f('0x2c'),'%'+_0x52fc25+'%');_0x141099['or'](_0x529f('0x2d'),'%'+_0x52fc25+'%');_0x141099['or'](_0x529f('0x2e'),'%'+_0x52fc25+'%');}}}return _0x141099;}function parseAdvancedSearchFilter(_0x582e4c,_0x33658b){var _0x442d63=getSqlClauses();var _0x4f43f0=as[_0x529f('0x2f')](_0x582e4c);var _0x42dab0=_0x4f43f0[_0x529f('0x30')];for(var _0x19f08a=0x0;_0x19f08a<_0x4f43f0[_0x529f('0x31')][_0x529f('0x26')];_0x19f08a++){var _0x4a8597=_0x4f43f0[_0x529f('0x31')][_0x19f08a];var _0x3a844a='c';var _0x2c22c5=_[_0x529f('0x32')](_0x33658b,[_0x529f('0x33'),_0x4a8597[_0x529f('0x20')]]);if(_0x2c22c5){if(_0x4a8597[_0x529f('0x20')]===_0x529f('0x34')||_0x2c22c5[_0x529f('0x35')]==='datetime'){_0x4a8597[_0x529f('0x36')]=_0x529f('0x37');}var _0xaea87c=as['buildExpression'](_0x3a844a,_0x2c22c5[_0x529f('0x38')],_0x4a8597);_0x442d63[_0x529f('0x39')][_0x42dab0](_0xaea87c[_0x529f('0x3a')],_0xaea87c[_0x529f('0x3b')][_0x529f('0x3c')],_0xaea87c[_0x529f('0x3b')][_0x529f('0x3d')]);}else{if(_0x4a8597[_0x529f('0x20')]===_0x529f('0x3e')){var _0x5be000=_0x4a8597[_0x529f('0x3b')][_0x529f('0x25')](',')[_0x529f('0x3f')](function(_0x31e120){return Number(_0x31e120);});var _0x1c9cda=parseTagParameter(_0x5be000);_0x442d63[_0x529f('0x40')][_0x529f('0x41')][_0x529f('0x42')](_0x1c9cda);_0x442d63[_0x529f('0x40')]['ids']=_0x5be000;}else if(_0x4a8597[_0x529f('0x20')]===_0x529f('0x43')){_0x442d63['user']['clause'][_0x529f('0x42')]('uc.UserId\x20=\x20?',_0x4a8597[_0x529f('0x3b')]);_0x442d63[_0x529f('0x44')][_0x529f('0x45')]=!![];}}}return _0x442d63;}function parseModelFields(_0xb75615,_0x1312bc){var _0x3b0ca0=squel[_0x529f('0x21')]();var _0x493bf0=_(_0xb75615)[_0x529f('0x46')]()[_0x529f('0x3f')](function(_0x130e12){return _[_0x529f('0x47')](_0x1312bc,[_0x529f('0x33'),_0x130e12])?_0x130e12:undefined;})['compact']()['value']();if(_0xb75615[_0x529f('0x48')]){_0x493bf0[_0x529f('0x49')]('Contact');}if(_0xb75615[_0x529f('0x43')]){_0x493bf0['push'](_0x529f('0x43'));}if(_0x493bf0[_0x529f('0x26')]>0x0){_0x493bf0['forEach'](function(_0x54f25c){if(_0x54f25c===_0x529f('0x19')){_0x3b0ca0[_0x529f('0x42')](_0x529f('0x4a'),[][_0x529f('0x4b')](_0xb75615[_0x54f25c]));}else if(_0x54f25c===_0x529f('0x48')){var _0x1c6d13='%'+_0xb75615[_0x54f25c]+'%';_0x3b0ca0['and'](_0x529f('0x4c'),_0x1c6d13);}else if(_0x54f25c===_0x529f('0x43')){_0x3b0ca0['and'](_0x529f('0x4d'),_0xb75615[_0x54f25c]);}else{_0x3b0ca0[_0x529f('0x42')]('c.'+_0x54f25c+'\x20=\x20?',_0xb75615[_0x54f25c]);}});}return _0x3b0ca0;}function parseQueryParameters(_0x586c50,_0x50a87f){var _0x4a7e6c=getSqlClauses();return Promise[_0x529f('0x4e')]()['then'](function(){return parseModelFields(_0x586c50,_0x50a87f);})[_0x529f('0x4f')](function(_0x2eef3f){_0x4a7e6c[_0x529f('0x50')][_0x529f('0x42')](_0x2eef3f);return parseTagParameter(_0x586c50[_0x529f('0x51')]);})['then'](function(_0x111a3b){_0x4a7e6c['tags']['clause'][_0x529f('0x42')](_0x111a3b);return parseSearchFilter(_0x586c50[_0x529f('0x52')]);})[_0x529f('0x4f')](function(_0x3f5a34){_0x4a7e6c[_0x529f('0x52')]=_0x3f5a34;return _0x4a7e6c;});}function checkListsRestrictions(_0x39967a,_0x4a8da9,_0x2d63a7){var _0x5e2e91=squel[_0x529f('0x21')]();return Promise[_0x529f('0x4e')]()['then'](function(){if(_0x4a8da9[_0x529f('0x53')]&&_0x39967a['role']===_0x529f('0x7')&&!_0x2d63a7){return _0x39967a[_0x529f('0x54')]({'attributes':['id'],'raw':!![]});}})[_0x529f('0x4f')](function(_0x33ce77){if(_0x33ce77){if(_0x33ce77[_0x529f('0x26')]===0x0){_0x5e2e91[_0x529f('0x42')](_0x529f('0x55'));}else{_0x5e2e91[_0x529f('0x42')](_0x529f('0x4a'),_[_0x529f('0x3f')](_0x33ce77,'id'));}}})[_0x529f('0x4f')](function(){return _0x5e2e91;});}function buildContactsQuery(_0x1b7ad3,_0x586000,_0x1cc546,_0x1c2bb7,_0x18a737,_0x1c90ff){if(_0x586000){_0x586000=_0x1cc546['attributes'];}_0x1b7ad3=addFieldsToQuery(_0x1b7ad3,_0x586000,_0x1c2bb7,_0x1c90ff,!![]);var _0x46e7af=squel[_0x529f('0xa')]();_0x46e7af=addFieldsToQuery(_0x46e7af,_0x586000,_0x1c2bb7,_0x1c90ff,![]);if(_0x1c2bb7||_0x1c90ff){_0x1b7ad3=applyJoinClauses(_0x1b7ad3,!![]);_0x1b7ad3['group']('c.id');if(_0x1cc546[_0x529f('0x56')]){_0x46e7af[_0x529f('0x56')](_0x1cc546['limit']);}if(_0x1cc546[_0x529f('0x57')]){_0x46e7af[_0x529f('0x57')](_0x1cc546[_0x529f('0x57')]);}}else{_0x46e7af=applyJoinClauses(_0x46e7af,![]);_0x46e7af[_0x529f('0x58')](_0x529f('0x59'));if(_0x1cc546[_0x529f('0x56')]){_0x1b7ad3['limit'](_0x1cc546[_0x529f('0x56')]);}if(_0x1cc546[_0x529f('0x57')]){_0x1b7ad3[_0x529f('0x57')](_0x1cc546[_0x529f('0x57')]);}}_0x46e7af[_0x529f('0x5a')](_0x18a737);if(_0x1cc546[_0x529f('0x5b')]){_0x1cc546[_0x529f('0x5b')][_0x529f('0x1f')](function(_0x21660c){_0x1b7ad3[_0x529f('0x5b')]('c.'+_0x21660c[0x0],_0x21660c[0x1]===_0x529f('0x5c')?![]:!![]);_0x46e7af[_0x529f('0x5b')](_0x529f('0x5d')+_0x21660c[0x0],_0x21660c[0x1]===_0x529f('0x5c')?![]:!![]);});}_0x46e7af[_0x529f('0x5e')](_0x1b7ad3,_0x529f('0xe'));return _0x46e7af;}function getFilteredContacts(_0x54d42c){var _0x2a91f3=[];return db[_0x529f('0x3e')]['findAll']({'attributes':['id','name','color'],'raw':!![]})['then'](function(_0x67f0d4){_0x2a91f3=_[_0x529f('0x5f')](_0x67f0d4,'id');var _0x1e28a2={'type':db[_0x529f('0x60')]['QueryTypes']['SELECT'],'model':db[_0x529f('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x529f('0x62')][_0x529f('0x63')](_0x54d42c['toString'](),_0x1e28a2);})['then'](function(_0x57f84d){_0x57f84d[_0x529f('0x1f')](function(_0x1857aa){if(_0x1857aa[_0x529f('0x1d')]){_0x1857aa[_0x529f('0x64')]=[];_0x1857aa[_0x529f('0x1d')][_0x529f('0x25')](',')['forEach'](function(_0x45f9c7){_0x1857aa[_0x529f('0x64')]['push'](_0x2a91f3[_0x45f9c7]);});}delete _0x1857aa[_0x529f('0x1d')];});return _0x57f84d;});}function countFilteredContacts(_0x4a4af7,_0x513ca1){var _0x1a4712=_0x4a4af7[_0x529f('0x65')]();_0x1a4712['field']('COUNT(*)');_0x1a4712=applyJoinClauses(_0x1a4712,!![]);_0x4a4af7[_0x529f('0x58')](_0x529f('0x66'));var _0x2a97b5=utils[_0x529f('0x22')](_0x513ca1);if(!_[_0x529f('0x67')](_0x2a97b5)){_0x1a4712[_0x529f('0xc')](_0x529f('0x68'),_0x2a97b5);}var _0x43bb3a={'type':db[_0x529f('0x60')][_0x529f('0x69')][_0x529f('0x6a')],'raw':!![]};return db[_0x529f('0x62')][_0x529f('0x63')](_0x1a4712[_0x529f('0x6b')](),_0x43bb3a)[_0x529f('0x4f')](function(_0x288879){return _0x288879[0x0][_0x529f('0x6c')];});}module[_0x529f('0x6d')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b770b77..3fff23c 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 _0xef39=['../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','encryptFile','createCipher','data','update','binary','write','end','decryptFile','createDecipher','final','close','encryptString','secret','utf8','base64','lodash'];(function(_0x5a82a0,_0xd1584a){var _0x206394=function(_0x2c8150){while(--_0x2c8150){_0x5a82a0['push'](_0x5a82a0['shift']());}};_0x206394(++_0xd1584a);}(_0xef39,0x13f));var _0x9ef3=function(_0x2a0630,_0x7a9c7f){_0x2a0630=_0x2a0630-0x0;var _0x5bdc68=_0xef39[_0x2a0630];return _0x5bdc68;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x9ef3('0x0'));var config=require(_0x9ef3('0x1'));var logger=require(_0x9ef3('0x2'))(_0x9ef3('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9ef3('0x4')][_0x9ef3('0x5')],'algorithm':_0x9ef3('0x6')};const fileOptions={'algorithm':_0x9ef3('0x7')};if(config['encrypt']&&config[_0x9ef3('0x8')][_0x9ef3('0x9')]){var isSupported=isAlgorithmSupported(config[_0x9ef3('0x8')][_0x9ef3('0x9')]);if(isSupported){fileOptions[_0x9ef3('0x9')]=config['encrypt'][_0x9ef3('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9ef3('0xa')](',\x20');logger[_0x9ef3('0xb')](config[_0x9ef3('0x8')]['algorithm'],_0x9ef3('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1ceb2a){return AES_SUPPORTED_RX[_0x9ef3('0xd')](_0x1ceb2a);}function getSupportedCiphers(){return crypto[_0x9ef3('0xe')]()[_0x9ef3('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x52d787){return getSupportedCiphers()[_0x9ef3('0x10')](_0x52d787)>-0x1;}function combineOptions(_0x23cb14){var _0x25ad73={};for(var _0x5baf59 in fileOptions){if(fileOptions['hasOwnProperty'](_0x5baf59)){_0x25ad73[_0x5baf59]=fileOptions[_0x5baf59];}}if(_0x23cb14){for(var _0x2d0bd0 in _0x23cb14){if(_0x23cb14['hasOwnProperty'](_0x2d0bd0)){_0x25ad73[_0x2d0bd0]=_0x23cb14[_0x2d0bd0];}}}return _0x25ad73;}exports[_0x9ef3('0x11')]=function(_0x2e5a84,_0x3aa507,_0x1baf90,_0x37ce9b){return new BPromise(function(_0x2c2f30,_0x5a4a05){_0x37ce9b=combineOptions(_0x37ce9b);var _0x13b008=new Buffer(_0x1baf90);var _0x30e536=fs['createReadStream'](_0x2e5a84);var _0x557946=fs['createWriteStream'](_0x3aa507);var _0x23b71b=crypto[_0x9ef3('0x12')](_0x37ce9b[_0x9ef3('0x9')],_0x13b008);_0x30e536['on'](_0x9ef3('0x13'),function(_0x32acc7){var _0x952749=new Buffer(_0x23b71b[_0x9ef3('0x14')](_0x32acc7),_0x9ef3('0x15'));_0x557946[_0x9ef3('0x16')](_0x952749);});_0x30e536['on'](_0x9ef3('0x17'),function(){try{var _0x280e47=new Buffer(_0x23b71b['final'](_0x9ef3('0x15')),_0x9ef3('0x15'));_0x557946['write'](_0x280e47);_0x557946[_0x9ef3('0x17')]();_0x557946['on']('close',function(){return _0x2c2f30(_0x3aa507);});}catch(_0x359d0a){fs['unlink'](_0x3aa507);return _0x5a4a05(_0x359d0a);}});});};exports[_0x9ef3('0x18')]=function(_0x228192,_0x2afb5f,_0x5a7567,_0x2ae010){return new BPromise(function(_0x11b8f2,_0x58d136){_0x2ae010=combineOptions(_0x2ae010);var _0x2cf7d4=new Buffer(_0x5a7567);var _0x455632=fs['createReadStream'](_0x228192);var _0x1cfc12=fs['createWriteStream'](_0x2afb5f);var _0x5a9568=crypto[_0x9ef3('0x19')](_0x2ae010[_0x9ef3('0x9')],_0x2cf7d4);_0x455632['on']('data',function(_0x4074be){var _0x3c0bff=new Buffer(_0x5a9568[_0x9ef3('0x14')](_0x4074be),'binary');_0x1cfc12[_0x9ef3('0x16')](_0x3c0bff);});_0x455632['on'](_0x9ef3('0x17'),function(){try{var _0x55eab1=new Buffer(_0x5a9568[_0x9ef3('0x1a')](_0x9ef3('0x15')),_0x9ef3('0x15'));_0x1cfc12[_0x9ef3('0x16')](_0x55eab1);_0x1cfc12[_0x9ef3('0x17')]();_0x1cfc12['on'](_0x9ef3('0x1b'),function(){return _0x11b8f2(_0x2afb5f);});}catch(_0x32ed0b){fs['unlink'](_0x2afb5f);return _0x58d136(_0x32ed0b);}});});};exports[_0x9ef3('0x1c')]=function(_0x232205,_0x5c6aed,_0x3f72c5){var _0x3e7163=_0x3f72c5||stringOptions[_0x9ef3('0x9')];var _0x5d7a8a=_0x5c6aed||stringOptions[_0x9ef3('0x1d')];var _0x88a8a6=crypto[_0x9ef3('0x12')](_0x3e7163,_0x5d7a8a);var _0x4d7d34=_0x88a8a6[_0x9ef3('0x14')](_0x232205,_0x9ef3('0x1e'),_0x9ef3('0x1f'));_0x4d7d34+=_0x88a8a6[_0x9ef3('0x1a')](_0x9ef3('0x1f'));return _0x4d7d34;};exports['decryptString']=function(_0x34720b,_0x51115f,_0x20b68a){var _0x4923ef=_0x20b68a||stringOptions[_0x9ef3('0x9')];var _0x490015=_0x51115f||stringOptions['secret'];var _0x51257e=crypto[_0x9ef3('0x19')](_0x4923ef,_0x490015);var _0x1d16ee=_0x51257e[_0x9ef3('0x14')](_0x34720b,'base64','utf8');_0x1d16ee+=_0x51257e[_0x9ef3('0x1a')](_0x9ef3('0x1e'));return _0x1d16ee;}; \ No newline at end of file +var _0xaf80=['createCipher','update','binary','end','final','write','close','unlink','decryptFile','createDecipher','data','encryptString','secret','utf8','base64','decryptString','crypto','lodash','../../config/environment','secrets','session','aes192','encrypt','algorithm','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xaf80,0x150));var _0x0af8=function(_0x920178,_0x488c1f){_0x920178=_0x920178-0x0;var _0x3c41d2=_0xaf80[_0x920178];return _0x3c41d2;};'use strict';var crypto=require(_0x0af8('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x0af8('0x1'));var config=require(_0x0af8('0x2'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0af8('0x3')][_0x0af8('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x0af8('0x5')};if(config['encrypt']&&config[_0x0af8('0x6')][_0x0af8('0x7')]){var isSupported=isAlgorithmSupported(config[_0x0af8('0x6')][_0x0af8('0x7')]);if(isSupported){fileOptions[_0x0af8('0x7')]=config['encrypt'][_0x0af8('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x0af8('0x6')][_0x0af8('0x7')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x45367f){return AES_SUPPORTED_RX[_0x0af8('0x8')](_0x45367f);}function getSupportedCiphers(){return crypto[_0x0af8('0x9')]()[_0x0af8('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x442a97){return getSupportedCiphers()[_0x0af8('0xb')](_0x442a97)>-0x1;}function combineOptions(_0x22c6b0){var _0x1eebde={};for(var _0x1e007c in fileOptions){if(fileOptions[_0x0af8('0xc')](_0x1e007c)){_0x1eebde[_0x1e007c]=fileOptions[_0x1e007c];}}if(_0x22c6b0){for(var _0x4799d2 in _0x22c6b0){if(_0x22c6b0['hasOwnProperty'](_0x4799d2)){_0x1eebde[_0x4799d2]=_0x22c6b0[_0x4799d2];}}}return _0x1eebde;}exports[_0x0af8('0xd')]=function(_0x179285,_0x11b2ba,_0x23cd0b,_0x579ab8){return new BPromise(function(_0xc431,_0x21a0e3){_0x579ab8=combineOptions(_0x579ab8);var _0x3ecc21=new Buffer(_0x23cd0b);var _0x3154bd=fs[_0x0af8('0xe')](_0x179285);var _0x5381e0=fs[_0x0af8('0xf')](_0x11b2ba);var _0x2ba559=crypto[_0x0af8('0x10')](_0x579ab8[_0x0af8('0x7')],_0x3ecc21);_0x3154bd['on']('data',function(_0x30fde2){var _0x3a179d=new Buffer(_0x2ba559[_0x0af8('0x11')](_0x30fde2),_0x0af8('0x12'));_0x5381e0['write'](_0x3a179d);});_0x3154bd['on'](_0x0af8('0x13'),function(){try{var _0x18dbbd=new Buffer(_0x2ba559[_0x0af8('0x14')](_0x0af8('0x12')),_0x0af8('0x12'));_0x5381e0[_0x0af8('0x15')](_0x18dbbd);_0x5381e0[_0x0af8('0x13')]();_0x5381e0['on'](_0x0af8('0x16'),function(){return _0xc431(_0x11b2ba);});}catch(_0x1f497d){fs[_0x0af8('0x17')](_0x11b2ba);return _0x21a0e3(_0x1f497d);}});});};exports[_0x0af8('0x18')]=function(_0x4d8204,_0x22f343,_0x530b0f,_0x2ed5ce){return new BPromise(function(_0x5d4202,_0x3c23b9){_0x2ed5ce=combineOptions(_0x2ed5ce);var _0x2c37dd=new Buffer(_0x530b0f);var _0x348081=fs['createReadStream'](_0x4d8204);var _0x4110e4=fs[_0x0af8('0xf')](_0x22f343);var _0x581f4f=crypto[_0x0af8('0x19')](_0x2ed5ce[_0x0af8('0x7')],_0x2c37dd);_0x348081['on'](_0x0af8('0x1a'),function(_0x3991dd){var _0x21612d=new Buffer(_0x581f4f[_0x0af8('0x11')](_0x3991dd),_0x0af8('0x12'));_0x4110e4[_0x0af8('0x15')](_0x21612d);});_0x348081['on'](_0x0af8('0x13'),function(){try{var _0x2e743c=new Buffer(_0x581f4f[_0x0af8('0x14')](_0x0af8('0x12')),_0x0af8('0x12'));_0x4110e4['write'](_0x2e743c);_0x4110e4[_0x0af8('0x13')]();_0x4110e4['on'](_0x0af8('0x16'),function(){return _0x5d4202(_0x22f343);});}catch(_0x405725){fs['unlink'](_0x22f343);return _0x3c23b9(_0x405725);}});});};exports[_0x0af8('0x1b')]=function(_0x5f167d,_0x55b281,_0x17c664){var _0x50116d=_0x17c664||stringOptions[_0x0af8('0x7')];var _0x3d6af9=_0x55b281||stringOptions[_0x0af8('0x1c')];var _0x42948a=crypto[_0x0af8('0x10')](_0x50116d,_0x3d6af9);var _0x57a0a4=_0x42948a[_0x0af8('0x11')](_0x5f167d,_0x0af8('0x1d'),_0x0af8('0x1e'));_0x57a0a4+=_0x42948a[_0x0af8('0x14')](_0x0af8('0x1e'));return _0x57a0a4;};exports[_0x0af8('0x1f')]=function(_0x31f4d5,_0x5d20c8,_0x254067){var _0xb94da3=_0x254067||stringOptions[_0x0af8('0x7')];var _0x39e879=_0x5d20c8||stringOptions[_0x0af8('0x1c')];var _0x33caaa=crypto['createDecipher'](_0xb94da3,_0x39e879);var _0x253dc2=_0x33caaa[_0x0af8('0x11')](_0x31f4d5,_0x0af8('0x1e'),_0x0af8('0x1d'));_0x253dc2+=_0x33caaa['final']('utf8');return _0x253dc2;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9625d4b..f733ebb 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 _0xf3bd=['.csv','existsSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','info','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','splitSizeCsv','then','sequelize','format','QueryTypes','SELECT','num','Empty','length','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname'];(function(_0x4f3255,_0xbd0881){var _0x332e4a=function(_0x393a48){while(--_0x393a48){_0x4f3255['push'](_0x4f3255['shift']());}};_0x332e4a(++_0xbd0881);}(_0xf3bd,0x1a9));var _0xdf3b=function(_0x3e1594,_0x415558){_0x3e1594=_0x3e1594-0x0;var _0x3067a6=_0xf3bd[_0x3e1594];return _0x3067a6;};'use strict';var util=require(_0xdf3b('0x0'));var path=require('path');var _=require(_0xdf3b('0x1'));var csv=require(_0xdf3b('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xdf3b('0x3'));var rimraf=require(_0xdf3b('0x4'));var db=require(_0xdf3b('0x5'))['db'];var dbH=require(_0xdf3b('0x5'))['dbH'];var logger=require('../../config/logger')(_0xdf3b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xdf3b('0x7')][0x2]);var QUERY=process[_0xdf3b('0x7')][0x3];var PATH=process[_0xdf3b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x33c325,_0x4dd353){var _0x376c0b={'status':_0x33c325};var _0xdc3f33={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4dd353){_0x376c0b[_0xdf3b('0x8')]=_0x4dd353;}return db[_0xdf3b('0x9')]['update'](_0x376c0b,_0xdc3f33);}function main(){var _0x40683c=0x1388;var _0x1f5a28;logger['info'](util['format'](_0xdf3b('0xa'),EXTRACTED_REPORT_ID,_0xdf3b('0xb')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdf3b('0xc')]})[_0xdf3b('0xd')](function(_0x367b5e){if(_0x367b5e){_0x1f5a28=_0x367b5e;_0x40683c=_0x1f5a28[_0xdf3b('0xc')]||0x1388;}})[_0xdf3b('0xd')](function(){return dbH[_0xdf3b('0xe')]['query'](util[_0xdf3b('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xdf3b('0x10')][_0xdf3b('0x11')]});})[_0xdf3b('0xd')](function(_0x14d828){if(!_0x14d828[0x0][_0xdf3b('0x12')]){return analyticExtractedReport(_0xdf3b('0x13'));}var _0x544149=[];var _0x4f8bbb=0x0;if(_0x1f5a28['split']){if(_0x14d828&&_0x14d828[_0xdf3b('0x14')]){var _0x54d15e=_['range'](_0x14d828[0x0][_0xdf3b('0x12')]/_0x40683c);var _0x1486e3=Number['isInteger'](_0x14d828[0x0][_0xdf3b('0x12')]/_0x40683c)?_0x14d828[0x0][_0xdf3b('0x12')]%_0x40683c:0x0;_0x54d15e[_0xdf3b('0x15')](function(_0x98ab8b){if(_0x98ab8b>0x0){_0x4f8bbb+=_0x40683c;}_0x544149[_0xdf3b('0x16')](dbH[_0xdf3b('0xe')][_0xdf3b('0x17')](util[_0xdf3b('0xf')](_0xdf3b('0x18'),QUERY,_0x40683c,_0x4f8bbb),{'type':dbH[_0xdf3b('0xe')][_0xdf3b('0x10')][_0xdf3b('0x11')]}));});if(_0x1486e3>0x0){_0x4f8bbb+=_0x40683c;_0x544149['push'](dbH[_0xdf3b('0xe')][_0xdf3b('0x17')](util[_0xdf3b('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1486e3,_0x4f8bbb),{'type':dbH['sequelize']['QueryTypes'][_0xdf3b('0x11')]}));}}}else{_0x544149[_0xdf3b('0x16')](dbH[_0xdf3b('0xe')][_0xdf3b('0x17')](QUERY,{'type':dbH['sequelize'][_0xdf3b('0x10')][_0xdf3b('0x11')]}));}var _0x4d7619=path[_0xdf3b('0x19')](PATH);var _0xccaf48=path['basename'](PATH,_0xdf3b('0x1a'));var _0x220a55=_0x1f5a28['split']&&_0x544149['length']>0x1;var _0x44f091=[];if(!fs[_0xdf3b('0x1b')](path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48))&&_0x220a55){fs['mkdirSync'](path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48));}return BPromise[_0xdf3b('0x1d')](_0x544149,function(_0x1088d3){_0x44f091[_0xdf3b('0x16')](_0x1088d3);})[_0xdf3b('0xd')](function(){for(var _0x1c733c=0x0;_0x1c733c<_0x44f091[_0xdf3b('0x14')];_0x1c733c+=0x1){var _0x4e3b0e;var _0x32df9f=_0x44f091[_0x1c733c];if(_0x220a55){_0x4e3b0e=path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48,util[_0xdf3b('0xf')](_0xdf3b('0x1e'),_0xccaf48,_0x1c733c,'csv'));}else{_0x4e3b0e=path['join'](_0x4d7619,util[_0xdf3b('0xf')](_0xdf3b('0x1f'),_0xccaf48,_0xdf3b('0x20')));}fs[_0xdf3b('0x21')](_0x4e3b0e,csv(_0x32df9f));}})[_0xdf3b('0xd')](function(){if(_0x220a55){return new Promise(function(_0x585a86){zipdir(path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48),{'saveTo':path[_0xdf3b('0x1c')](_0x4d7619,util['format'](_0xdf3b('0x1f'),_0xccaf48,_0xdf3b('0x22')))},function(_0x5c2183,_0x19fd6f){rimraf(path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48),function(){});_0x585a86(_0xdf3b('0x23'));});});}})[_0xdf3b('0xd')](function(){logger[_0xdf3b('0x24')](util[_0xdf3b('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xdf3b('0xb')));return analyticExtractedReport(_0xdf3b('0x25'),_0x220a55?util[_0xdf3b('0xf')]('%s.%s',_0xccaf48,_0x220a55?_0xdf3b('0x22'):_0xdf3b('0x20')):null);});})['catch'](function(_0x18143e){logger[_0xdf3b('0x24')](util[_0xdf3b('0xf')](_0xdf3b('0x26'),EXTRACTED_REPORT_ID,_0xdf3b('0xb')),util[_0xdf3b('0x27')](_0x18143e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdf3b('0x28'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7efb=['zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Setting','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','bluebird'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x7efb,0x10b));var _0xb7ef=function(_0x2c4378,_0x221bf8){_0x2c4378=_0x2c4378-0x0;var _0x3c312b=_0x7efb[_0x2c4378];return _0x3c312b;};'use strict';var util=require(_0xb7ef('0x0'));var path=require(_0xb7ef('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xb7ef('0x2'));var zipdir=require(_0xb7ef('0x3'));var rimraf=require('rimraf');var db=require(_0xb7ef('0x4'))['db'];var dbH=require(_0xb7ef('0x4'))[_0xb7ef('0x5')];var logger=require(_0xb7ef('0x6'))(_0xb7ef('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xb7ef('0x8')][0x2]);var QUERY=process[_0xb7ef('0x8')][0x3];var PATH=process[_0xb7ef('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x22d07a,_0x259931){var _0xbb5387={'status':_0x22d07a};var _0x183b7a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x259931){_0xbb5387[_0xb7ef('0x9')]=_0x259931;}return db[_0xb7ef('0xa')][_0xb7ef('0xb')](_0xbb5387,_0x183b7a);}function main(){var _0x109c43=0x1388;var _0x48847d;logger['info'](util[_0xb7ef('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xb7ef('0xd')][_0xb7ef('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb7ef('0xf'),'splitSizeCsv']})[_0xb7ef('0x10')](function(_0xeebc14){if(_0xeebc14){_0x48847d=_0xeebc14;_0x109c43=_0x48847d[_0xb7ef('0x11')]||0x1388;}})[_0xb7ef('0x10')](function(){return dbH[_0xb7ef('0x12')][_0xb7ef('0x13')](util[_0xb7ef('0xc')](_0xb7ef('0x14'),QUERY),{'type':dbH[_0xb7ef('0x12')][_0xb7ef('0x15')][_0xb7ef('0x16')]});})[_0xb7ef('0x10')](function(_0x2b158e){if(!_0x2b158e[0x0][_0xb7ef('0x17')]){return analyticExtractedReport('Empty');}var _0x388968=[];var _0xb5fa15=0x0;if(_0x48847d[_0xb7ef('0xf')]){if(_0x2b158e&&_0x2b158e[_0xb7ef('0x18')]){var _0x210392=_[_0xb7ef('0x19')](_0x2b158e[0x0][_0xb7ef('0x17')]/_0x109c43);var _0x53f842=Number['isInteger'](_0x2b158e[0x0][_0xb7ef('0x17')]/_0x109c43)?_0x2b158e[0x0]['num']%_0x109c43:0x0;_0x210392[_0xb7ef('0x1a')](function(_0x327d4f){if(_0x327d4f>0x0){_0xb5fa15+=_0x109c43;}_0x388968[_0xb7ef('0x1b')](dbH['sequelize'][_0xb7ef('0x13')](util['format'](_0xb7ef('0x1c'),QUERY,_0x109c43,_0xb5fa15),{'type':dbH[_0xb7ef('0x12')][_0xb7ef('0x15')][_0xb7ef('0x16')]}));});if(_0x53f842>0x0){_0xb5fa15+=_0x109c43;_0x388968[_0xb7ef('0x1b')](dbH[_0xb7ef('0x12')][_0xb7ef('0x13')](util['format'](_0xb7ef('0x1c'),QUERY,_0x53f842,_0xb5fa15),{'type':dbH[_0xb7ef('0x12')][_0xb7ef('0x15')][_0xb7ef('0x16')]}));}}}else{_0x388968['push'](dbH[_0xb7ef('0x12')][_0xb7ef('0x13')](QUERY,{'type':dbH[_0xb7ef('0x12')]['QueryTypes'][_0xb7ef('0x16')]}));}var _0x1c2e1f=path['dirname'](PATH);var _0x287625=path['basename'](PATH,_0xb7ef('0x1d'));var _0x3e757f=_0x48847d[_0xb7ef('0xf')]&&_0x388968['length']>0x1;var _0x6d5201=[];if(!fs['existsSync'](path[_0xb7ef('0x1e')](_0x1c2e1f,_0x287625))&&_0x3e757f){fs[_0xb7ef('0x1f')](path[_0xb7ef('0x1e')](_0x1c2e1f,_0x287625));}return BPromise[_0xb7ef('0x20')](_0x388968,function(_0x577f8a){_0x6d5201[_0xb7ef('0x1b')](_0x577f8a);})[_0xb7ef('0x10')](function(){for(var _0x613afe=0x0;_0x613afe<_0x6d5201[_0xb7ef('0x18')];_0x613afe+=0x1){var _0x3aa751;var _0x12af39=_0x6d5201[_0x613afe];if(_0x3e757f){_0x3aa751=path[_0xb7ef('0x1e')](_0x1c2e1f,_0x287625,util[_0xb7ef('0xc')](_0xb7ef('0x21'),_0x287625,_0x613afe,'csv'));}else{_0x3aa751=path[_0xb7ef('0x1e')](_0x1c2e1f,util[_0xb7ef('0xc')](_0xb7ef('0x22'),_0x287625,_0xb7ef('0x23')));}fs[_0xb7ef('0x24')](_0x3aa751,csv(_0x12af39));}})['then'](function(){if(_0x3e757f){return new Promise(function(_0x421144){zipdir(path[_0xb7ef('0x1e')](_0x1c2e1f,_0x287625),{'saveTo':path['join'](_0x1c2e1f,util[_0xb7ef('0xc')](_0xb7ef('0x22'),_0x287625,_0xb7ef('0x25')))},function(_0x29be71,_0x194a74){rimraf(path[_0xb7ef('0x1e')](_0x1c2e1f,_0x287625),function(){});_0x421144('zip\x20finished');});});}})[_0xb7ef('0x10')](function(){logger['info'](util[_0xb7ef('0xc')](_0xb7ef('0x26'),EXTRACTED_REPORT_ID,_0xb7ef('0x27')));return analyticExtractedReport('Completed',_0x3e757f?util[_0xb7ef('0xc')](_0xb7ef('0x22'),_0x287625,_0x3e757f?_0xb7ef('0x25'):_0xb7ef('0x23')):null);});})[_0xb7ef('0x28')](function(_0x5f47b4){logger[_0xb7ef('0x29')](util['format'](_0xb7ef('0x2a'),EXTRACTED_REPORT_ID,_0xb7ef('0x27')),util['inspect'](_0x5f47b4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb7ef('0x2b'));})[_0xb7ef('0x2c')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index fb683ce..5d495ad 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 _0x1f04=['all','%s.%s','zip','zip\x20finished','info','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','end','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','toString','value','fill','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','footer','Arial','black','right','num','Empty','Setting','find','split','then','splitSizePdf','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0x1f04,0x1ce));var _0x41f0=function(_0x4a7e27,_0x1e94fb){_0x4a7e27=_0x4a7e27-0x0;var _0x391f82=_0x1f04[_0x4a7e27];return _0x391f82;};'use strict';var _=require(_0x41f0('0x0'));var fs=require('fs');var util=require(_0x41f0('0x1'));var path=require(_0x41f0('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x41f0('0x3'));var PdfPrinter=require(_0x41f0('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x41f0('0x5')];var window=new JSDOM('')[_0x41f0('0x6')];var BPromise=require(_0x41f0('0x7'));var db=require(_0x41f0('0x8'))['db'];var dbH=require(_0x41f0('0x8'))[_0x41f0('0x9')];var logger=require(_0x41f0('0xa'))(_0x41f0('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x41f0('0xc')][0x3];var PATH=process[_0x41f0('0xc')][0x4];var NAME=process[_0x41f0('0xc')][0x5];var FORMAT=_0x41f0('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3596b9,_0x132ec3){var _0x4ffb3b={'status':_0x3596b9};var _0x1a860a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x132ec3){_0x4ffb3b['savename']=_0x132ec3;}return db[_0x41f0('0xe')][_0x41f0('0xf')](_0x4ffb3b,_0x1a860a);}function getHeaders(_0x16108f){return _['map'](_0x16108f,function(_0x5dc8da){return{'text':_0x5dc8da,'style':'tableHeader'};});}function getRows(_0x18ab8d,_0x3bc8d7){return _['map'](_0x3bc8d7,function(_0x3c2c40){return _(_0x3c2c40)['pick'](_0x18ab8d)[_0x41f0('0x10')](function(_0x524a84){return _0x524a84?_[_0x41f0('0x11')](_0x524a84):'';})[_0x41f0('0x12')]();});}function createTable(_0x285fcc,_0x3c18b7){var _0x538049={'widths':_[_0x41f0('0x13')](Array(_0x285fcc[_0x41f0('0x14')]),0x91),'heights':function(_0x309bc1){return _0x309bc1===0x0?_0x41f0('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x146f6c=getHeaders(_0x285fcc);_0x538049[_0x41f0('0x16')][_0x41f0('0x17')](_0x146f6c);var _0x581e96=getRows(_0x285fcc,_0x3c18b7);_0x538049['body']=_0x538049[_0x41f0('0x16')][_0x41f0('0x18')](_0x581e96);return _0x538049;}function createTables(_0x9bde26){var _0x4c35dc=[];var _0x4e85f0=_[_0x41f0('0x19')](Object[_0x41f0('0x1a')](_0x9bde26[0x0]),0x5);_0x4e85f0['forEach'](function(_0x56568d){_0x4c35dc['push'](createTable(_0x56568d,_0x9bde26));});return _0x4c35dc;}function getPDFDocDefinition(_0x10a74b){var _0x438ce5=util[_0x41f0('0x1b')](_0x41f0('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x41f0('0x1d')])[_0x41f0('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x41f0('0x1e')])['format'](FORMAT));var _0x33e4d7=[];for(var _0x3054f9=0x0;_0x3054f9<_0x10a74b[_0x41f0('0x14')];_0x3054f9++){var _0x4f7ee0=[];if(_0x3054f9===0x0){_0x4f7ee0[_0x41f0('0x17')]({'text':_0x438ce5,'style':_0x41f0('0x1f')});}var _0x25cdf5={'table':_0x10a74b[_0x3054f9]};if(_0x3054f9>0x0){_0x25cdf5[_0x41f0('0x20')]=_0x41f0('0x21');_0x25cdf5[_0x41f0('0x22')]=[0x0,0x46,0x0,0x0];}_0x4f7ee0[_0x41f0('0x17')](_0x25cdf5);_0x33e4d7[_0x41f0('0x17')](_0x4f7ee0);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x33e4d7,'footer':function(_0x5d405e,_0x5c8378){return{'text':_0x5d405e['toString']()+'\x20/\x20'+_0x5c8378,'style':_0x41f0('0x23')};},'defaultStyle':{'font':_0x41f0('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x41f0('0x25')},'footer':{'alignment':_0x41f0('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x21269b){var _0xef3eee=0x1388;var _0x389ab0;if(!_0x21269b[0x0][_0x41f0('0x27')]){return analyticExtractedReport(_0x41f0('0x28'));}return db[_0x41f0('0x29')][_0x41f0('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x41f0('0x2b'),'splitSizePdf']})[_0x41f0('0x2c')](function(_0x5d35a3){if(_0x5d35a3){_0x389ab0=_0x5d35a3;_0xef3eee=_0x389ab0[_0x41f0('0x2d')]||0x3e8;}})['then'](function(){var _0x4bbceb=[];var _0x3709e4=0x0;if(_0x389ab0[_0x41f0('0x2b')]){if(_0x21269b&&_0x21269b[_0x41f0('0x14')]){var _0x98abe1=_['range'](_0x21269b[0x0][_0x41f0('0x27')]/_0xef3eee);var _0x509d7c=Number[_0x41f0('0x2e')](_0x21269b[0x0][_0x41f0('0x27')]/_0xef3eee)?_0x21269b[0x0][_0x41f0('0x27')]%_0xef3eee:0x0;_0x98abe1['forEach'](function(_0x32f488){if(_0x32f488>0x0){_0x3709e4+=_0xef3eee;}_0x4bbceb['push'](dbH[_0x41f0('0x2f')][_0x41f0('0x30')](util[_0x41f0('0x1b')](_0x41f0('0x31'),QUERY,_0xef3eee,_0x3709e4),{'type':dbH[_0x41f0('0x2f')]['QueryTypes'][_0x41f0('0x32')]}));});if(_0x509d7c>0x0){_0x3709e4+=_0xef3eee;_0x4bbceb[_0x41f0('0x17')](dbH['sequelize']['query'](util[_0x41f0('0x1b')](_0x41f0('0x31'),QUERY,_0x509d7c,_0x3709e4),{'type':dbH[_0x41f0('0x2f')][_0x41f0('0x33')][_0x41f0('0x32')]}));}}}else{_0x4bbceb[_0x41f0('0x17')](dbH['sequelize'][_0x41f0('0x30')](QUERY,{'type':dbH[_0x41f0('0x2f')][_0x41f0('0x33')][_0x41f0('0x32')]}));}var _0x5b1eaf=path['dirname'](PATH);var _0x5ccad6=path[_0x41f0('0x34')](PATH,'.pdf');var _0x501151=_0x389ab0['split']&&_0x4bbceb[_0x41f0('0x14')]>0x1;var _0x171097=[];if(!fs[_0x41f0('0x35')](path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6))&&_0x501151){fs[_0x41f0('0x37')](path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6));}return BPromise['each'](_0x4bbceb,function(_0x2d1fb4){_0x171097['push'](_0x2d1fb4);})[_0x41f0('0x2c')](function(){var _0x11b105=[];for(var _0x137924=0x0;_0x137924<_0x171097['length'];_0x137924+=0x1){var _0x3b43d3=_0x171097[_0x137924];var _0x4872d7=createTables(_[_0x41f0('0x38')](_0x3b43d3));var _0x189861;var _0x3ffcaf=getPDFDocDefinition(_0x4872d7);var _0x4e90ad=getPDFPrinter();var _0x44532a=_0x4e90ad[_0x41f0('0x39')](_0x3ffcaf);if(_0x501151){_0x189861=path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6,util['format'](_0x41f0('0x3a'),_0x5ccad6,_0x137924,_0x41f0('0x3b')));}else{_0x189861=path[_0x41f0('0x36')](_0x5b1eaf,util['format']('%s.%s',_0x5ccad6,'pdf'));}_0x11b105[_0x41f0('0x17')](writePDFDocument(_0x44532a,_0x189861));}return Promise[_0x41f0('0x3c')](_0x11b105);})[_0x41f0('0x2c')](function(){if(_0x501151){return new Promise(function(_0x47b6fa){zipdir(path['join'](_0x5b1eaf,_0x5ccad6),{'saveTo':path[_0x41f0('0x36')](_0x5b1eaf,util[_0x41f0('0x1b')](_0x41f0('0x3d'),_0x5ccad6,_0x41f0('0x3e')))},function(){rimraf(path['join'](_0x5b1eaf,_0x5ccad6),function(){});_0x47b6fa(_0x41f0('0x3f'));});});}})[_0x41f0('0x2c')](function(){if(!_0x501151)return;rimraf(path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6),function(){});})['then'](function(){logger[_0x41f0('0x40')](util[_0x41f0('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x41f0('0x41')));return analyticExtractedReport('Completed',_0x501151?util[_0x41f0('0x1b')](_0x41f0('0x3d'),_0x5ccad6,_0x501151?_0x41f0('0x3e'):_0x41f0('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x41f0('0x40')](util[_0x41f0('0x1b')](_0x41f0('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x41f0('0xe')][_0x41f0('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x41f0('0x2c')](function(_0x57aae9){EXTRACTED_REPORT=_0x57aae9;return dbH[_0x41f0('0x2f')][_0x41f0('0x30')](util[_0x41f0('0x1b')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x41f0('0x2f')][_0x41f0('0x33')][_0x41f0('0x32')]});})['then'](extractReport)[_0x41f0('0x44')](function(_0x5ba138){logger[_0x41f0('0x40')](util[_0x41f0('0x1b')](_0x41f0('0x45'),EXTRACTED_REPORT_ID,_0x41f0('0x41')),util['inspect'](_0x5ba138,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x41f0('0x46'));})[_0x41f0('0x47')](function(){process[_0x41f0('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x130e3f=new PdfPrinter({'Arial':{'normal':__dirname+_0x41f0('0x49'),'bold':__dirname+_0x41f0('0x4a'),'italics':__dirname+_0x41f0('0x4b'),'bolditalics':__dirname+_0x41f0('0x4c')}});return _0x130e3f;}function getPDFDocDefinitionFromHTML(_0xedcb41,_0x37ab17){var _0x2aaeef=util[_0x41f0('0x1b')](_0x41f0('0x4d'),_0x37ab17[_0x41f0('0x4e')],_0x37ab17[_0x41f0('0x4f')]);var _0xffe6ba=moment()['format'](_0x41f0('0x50'))[_0x41f0('0x11')]();var _0x3047c5=htmlToPdfmake(_0xedcb41,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3047c5],'defaultStyle':{'font':_0x41f0('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x41f0('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x41f0('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x41f0('0x51')}},'header':function(){return[{'text':_0x41f0('0x52'),'style':_0x41f0('0x1f')}];},'footer':function(_0x32f987,_0x4e4dcf){return[{'text':util[_0x41f0('0x1b')](_0x41f0('0x53'),_0x2aaeef,_0x32f987,_0x4e4dcf,_0xffe6ba),'style':_0x41f0('0x23')}];}};}function writePDFDocument(_0x4bc5a0,_0x39f9ec){return new Promise(function(_0x44fdfa,_0x37ee1f){var _0x32c7b5=_0x4bc5a0['pipe'](fs[_0x41f0('0x54')](_0x39f9ec));_0x32c7b5['on'](_0x41f0('0x55'),function(){_0x44fdfa(_0x41f0('0x55'));});_0x32c7b5['on']('error',function(_0x3f99ad){_0x37ee1f(_0x3f99ad);});_0x4bc5a0[_0x41f0('0x56')]();});}exports['createPdfFromHTML']=function(_0x169195,_0x38b28b){var _0x150634=getPDFPrinter();var _0x55fe36=getPDFDocDefinitionFromHTML(_0x169195,_0x38b28b);var _0x29085b=_0x150634[_0x41f0('0x39')](_0x55fe36);return writePDFDocument(_0x29085b,_0x38b28b[_0x41f0('0x2')])[_0x41f0('0x44')](function(_0x368707){throw _0x368707;});}; \ No newline at end of file +var _0xa341=['basename','existsSync','join','each','then','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','Arial','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','fill','length','auto','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','pageBreak','before','margin','landscape','toString','footer','right','num','split','splitSizePdf','range','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0xa341,0xd2));var _0x1a34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa341[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1a34('0x0'));var fs=require('fs');var util=require(_0x1a34('0x1'));var path=require(_0x1a34('0x2'));var moment=require(_0x1a34('0x3'));var htmlToPdfmake=require(_0x1a34('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x1a34('0x5'));var rimraf=require(_0x1a34('0x6'));var JSDOM=require(_0x1a34('0x7'))[_0x1a34('0x8')];var window=new JSDOM('')[_0x1a34('0x9')];var BPromise=require(_0x1a34('0xa'));var db=require(_0x1a34('0xb'))['db'];var dbH=require(_0x1a34('0xb'))[_0x1a34('0xc')];var logger=require('../../config/logger')(_0x1a34('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1a34('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x1a34('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4b1098,_0x3e3034){var _0x2b5c52={'status':_0x4b1098};var _0x2a27b5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e3034){_0x2b5c52[_0x1a34('0xf')]=_0x3e3034;}return db[_0x1a34('0x10')][_0x1a34('0x11')](_0x2b5c52,_0x2a27b5);}function getHeaders(_0x1f1f45){return _[_0x1a34('0x12')](_0x1f1f45,function(_0x16ee14){return{'text':_0x16ee14,'style':_0x1a34('0x13')};});}function getRows(_0x9609eb,_0x1c7589){return _[_0x1a34('0x12')](_0x1c7589,function(_0x55b690){return _(_0x55b690)[_0x1a34('0x14')](_0x9609eb)[_0x1a34('0x12')](function(_0xa766aa){return _0xa766aa?_['toString'](_0xa766aa):'';})['value']();});}function createTable(_0x105baf,_0x56f8fb){var _0x429afd={'widths':_[_0x1a34('0x15')](Array(_0x105baf[_0x1a34('0x16')]),0x91),'heights':function(_0x2ce8bc){return _0x2ce8bc===0x0?_0x1a34('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xf9e5cf=getHeaders(_0x105baf);_0x429afd['body']['push'](_0xf9e5cf);var _0x2680c7=getRows(_0x105baf,_0x56f8fb);_0x429afd[_0x1a34('0x18')]=_0x429afd['body'][_0x1a34('0x19')](_0x2680c7);return _0x429afd;}function createTables(_0x595750){var _0x32582d=[];var _0x394f04=_[_0x1a34('0x1a')](Object[_0x1a34('0x1b')](_0x595750[0x0]),0x5);_0x394f04[_0x1a34('0x1c')](function(_0xb83ac7){_0x32582d[_0x1a34('0x1d')](createTable(_0xb83ac7,_0x595750));});return _0x32582d;}function getPDFDocDefinition(_0x2ce4f1){var _0x541594=util[_0x1a34('0x1e')](_0x1a34('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x1a34('0x20')])[_0x1a34('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x1a34('0x21')])[_0x1a34('0x1e')](FORMAT));var _0x88f4fc=[];for(var _0x192b56=0x0;_0x192b56<_0x2ce4f1[_0x1a34('0x16')];_0x192b56++){var _0x5823da=[];if(_0x192b56===0x0){_0x5823da[_0x1a34('0x1d')]({'text':_0x541594,'style':'header'});}var _0xf72303={'table':_0x2ce4f1[_0x192b56]};if(_0x192b56>0x0){_0xf72303[_0x1a34('0x22')]=_0x1a34('0x23');_0xf72303[_0x1a34('0x24')]=[0x0,0x46,0x0,0x0];}_0x5823da[_0x1a34('0x1d')](_0xf72303);_0x88f4fc[_0x1a34('0x1d')](_0x5823da);}return{'pageSize':'A4','pageOrientation':_0x1a34('0x25'),'content':_0x88f4fc,'footer':function(_0xae0ef7,_0x477326){return{'text':_0xae0ef7[_0x1a34('0x26')]()+'\x20/\x20'+_0x477326,'style':_0x1a34('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x1a34('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5eacd9){var _0x4e0755=0x1388;var _0xffc8c0;if(!_0x5eacd9[0x0][_0x1a34('0x29')]){return analyticExtractedReport('Empty');}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1a34('0x2a'),_0x1a34('0x2b')]})['then'](function(_0x5dc04d){if(_0x5dc04d){_0xffc8c0=_0x5dc04d;_0x4e0755=_0xffc8c0['splitSizePdf']||0x3e8;}})['then'](function(){var _0x50f6b6=[];var _0x1f1c74=0x0;if(_0xffc8c0['split']){if(_0x5eacd9&&_0x5eacd9[_0x1a34('0x16')]){var _0x270043=_[_0x1a34('0x2c')](_0x5eacd9[0x0]['num']/_0x4e0755);var _0x2af1b3=Number['isInteger'](_0x5eacd9[0x0][_0x1a34('0x29')]/_0x4e0755)?_0x5eacd9[0x0][_0x1a34('0x29')]%_0x4e0755:0x0;_0x270043[_0x1a34('0x1c')](function(_0x5028d4){if(_0x5028d4>0x0){_0x1f1c74+=_0x4e0755;}_0x50f6b6[_0x1a34('0x1d')](dbH[_0x1a34('0x2d')][_0x1a34('0x2e')](util[_0x1a34('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4e0755,_0x1f1c74),{'type':dbH['sequelize'][_0x1a34('0x2f')][_0x1a34('0x30')]}));});if(_0x2af1b3>0x0){_0x1f1c74+=_0x4e0755;_0x50f6b6[_0x1a34('0x1d')](dbH[_0x1a34('0x2d')][_0x1a34('0x2e')](util['format'](_0x1a34('0x31'),QUERY,_0x2af1b3,_0x1f1c74),{'type':dbH[_0x1a34('0x2d')][_0x1a34('0x2f')][_0x1a34('0x30')]}));}}}else{_0x50f6b6['push'](dbH[_0x1a34('0x2d')]['query'](QUERY,{'type':dbH[_0x1a34('0x2d')]['QueryTypes'][_0x1a34('0x30')]}));}var _0x41ad88=path[_0x1a34('0x32')](PATH);var _0x32220b=path[_0x1a34('0x33')](PATH,'.pdf');var _0x2ff23f=_0xffc8c0[_0x1a34('0x2a')]&&_0x50f6b6[_0x1a34('0x16')]>0x1;var _0x5303e8=[];if(!fs[_0x1a34('0x34')](path['join'](_0x41ad88,_0x32220b))&&_0x2ff23f){fs['mkdirSync'](path[_0x1a34('0x35')](_0x41ad88,_0x32220b));}return BPromise[_0x1a34('0x36')](_0x50f6b6,function(_0x36c13d){_0x5303e8[_0x1a34('0x1d')](_0x36c13d);})[_0x1a34('0x37')](function(){var _0xfdca7c=[];for(var _0x310a6b=0x0;_0x310a6b<_0x5303e8['length'];_0x310a6b+=0x1){var _0x14eb63=_0x5303e8[_0x310a6b];var _0x290e12=createTables(_['flatten'](_0x14eb63));var _0x5d9bc9;var _0x44fccf=getPDFDocDefinition(_0x290e12);var _0x39fba1=getPDFPrinter();var _0x5dfe79=_0x39fba1[_0x1a34('0x38')](_0x44fccf);if(_0x2ff23f){_0x5d9bc9=path['join'](_0x41ad88,_0x32220b,util[_0x1a34('0x1e')](_0x1a34('0x39'),_0x32220b,_0x310a6b,_0x1a34('0x3a')));}else{_0x5d9bc9=path['join'](_0x41ad88,util[_0x1a34('0x1e')]('%s.%s',_0x32220b,_0x1a34('0x3a')));}_0xfdca7c['push'](writePDFDocument(_0x5dfe79,_0x5d9bc9));}return Promise[_0x1a34('0x3b')](_0xfdca7c);})[_0x1a34('0x37')](function(){if(_0x2ff23f){return new Promise(function(_0x6a9f98){zipdir(path[_0x1a34('0x35')](_0x41ad88,_0x32220b),{'saveTo':path[_0x1a34('0x35')](_0x41ad88,util[_0x1a34('0x1e')](_0x1a34('0x3c'),_0x32220b,_0x1a34('0x3d')))},function(){rimraf(path[_0x1a34('0x35')](_0x41ad88,_0x32220b),function(){});_0x6a9f98('zip\x20finished');});});}})[_0x1a34('0x37')](function(){if(!_0x2ff23f)return;rimraf(path[_0x1a34('0x35')](_0x41ad88,_0x32220b),function(){});})['then'](function(){logger[_0x1a34('0x3e')](util[_0x1a34('0x1e')](_0x1a34('0x3f'),EXTRACTED_REPORT_ID,_0x1a34('0x40')));return analyticExtractedReport(_0x1a34('0x41'),_0x2ff23f?util[_0x1a34('0x1e')](_0x1a34('0x3c'),_0x32220b,_0x2ff23f?_0x1a34('0x3d'):_0x1a34('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1a34('0x3e')](util[_0x1a34('0x1e')](_0x1a34('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x1a34('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1a34('0x37')](function(_0x435883){EXTRACTED_REPORT=_0x435883;return dbH[_0x1a34('0x2d')][_0x1a34('0x2e')](util[_0x1a34('0x1e')](_0x1a34('0x44'),QUERY),{'type':dbH[_0x1a34('0x2d')][_0x1a34('0x2f')][_0x1a34('0x30')]});})['then'](extractReport)['catch'](function(_0x375535){logger['info'](util[_0x1a34('0x1e')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0x1a34('0x45')](_0x375535,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x1a34('0x46')](function(){process[_0x1a34('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x346ff1=new PdfPrinter({'Arial':{'normal':__dirname+_0x1a34('0x48'),'bold':__dirname+_0x1a34('0x49'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x1a34('0x4a')}});return _0x346ff1;}function getPDFDocDefinitionFromHTML(_0x49440c,_0x4d685b){var _0x3fa34c=util[_0x1a34('0x1e')](_0x1a34('0x4b'),_0x4d685b[_0x1a34('0x4c')],_0x4d685b['interactionId']);var _0x373816=moment()['format'](_0x1a34('0x4d'))[_0x1a34('0x26')]();var _0xc2c02f=htmlToPdfmake(_0x49440c,{'window':window,'tableAutoSize':!![]});return{'content':[_0xc2c02f],'defaultStyle':{'font':_0x1a34('0x4e')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1a34('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x1a34('0x4f')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x1a34('0x50')}];},'footer':function(_0x6edaed,_0x12d938){return[{'text':util[_0x1a34('0x1e')](_0x1a34('0x51'),_0x3fa34c,_0x6edaed,_0x12d938,_0x373816),'style':_0x1a34('0x27')}];}};}function writePDFDocument(_0x2f0ac3,_0x758918){return new Promise(function(_0x5bdfc5,_0x5aa886){var _0x71a23f=_0x2f0ac3[_0x1a34('0x52')](fs['createWriteStream'](_0x758918));_0x71a23f['on'](_0x1a34('0x53'),function(){_0x5bdfc5(_0x1a34('0x53'));});_0x71a23f['on'](_0x1a34('0x54'),function(_0x333653){_0x5aa886(_0x333653);});_0x2f0ac3['end']();});}exports[_0x1a34('0x55')]=function(_0x83272c,_0x578d68){var _0x2ac59f=getPDFPrinter();var _0x62b4f2=getPDFDocDefinitionFromHTML(_0x83272c,_0x578d68);var _0x10c374=_0x2ac59f[_0x1a34('0x38')](_0x62b4f2);return writePDFDocument(_0x10c374,_0x578d68[_0x1a34('0x2')])[_0x1a34('0x56')](function(_0xa222ab){throw _0xa222ab;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 7e28561..5f585c7 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 _0x4f0f=['writeFileSync','binary','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','inspect','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s'];(function(_0x3a74b9,_0x40b2b7){var _0x56d414=function(_0x472093){while(--_0x472093){_0x3a74b9['push'](_0x3a74b9['shift']());}};_0x56d414(++_0x40b2b7);}(_0x4f0f,0xdf));var _0xf4f0=function(_0x1cb380,_0x8ca874){_0x1cb380=_0x1cb380-0x0;var _0x21aff5=_0x4f0f[_0x1cb380];return _0x21aff5;};'use strict';var util=require(_0xf4f0('0x0'));var path=require(_0xf4f0('0x1'));var _=require(_0xf4f0('0x2'));var fs=require('fs');var json2xls=require(_0xf4f0('0x3'));var BPromise=require('bluebird');var zipdir=require(_0xf4f0('0x4'));var rimraf=require(_0xf4f0('0x5'));var db=require(_0xf4f0('0x6'))['db'];var dbH=require('../../mysqldb')[_0xf4f0('0x7')];var logger=require('../../config/logger')(_0xf4f0('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf4f0('0x9')][0x3];var PATH=process[_0xf4f0('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x595027,_0x127bad){var _0x3157db={'status':_0x595027};var _0x1f3419={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x127bad){_0x3157db[_0xf4f0('0xa')]=_0x127bad;}return db[_0xf4f0('0xb')][_0xf4f0('0xc')](_0x3157db,_0x1f3419);}function main(){var _0x20dfc5=0x1388;var _0x445b76;logger['info'](util[_0xf4f0('0xd')](_0xf4f0('0xe'),EXTRACTED_REPORT_ID,_0xf4f0('0xf')));return db[_0xf4f0('0x10')][_0xf4f0('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf4f0('0x12'),'splitSizeXlsx']})[_0xf4f0('0x13')](function(_0x2a55c0){if(_0x2a55c0){_0x445b76=_0x2a55c0;_0x20dfc5=_0x445b76[_0xf4f0('0x14')]||0x1388;}})[_0xf4f0('0x13')](function(){return dbH[_0xf4f0('0x15')]['query'](util['format'](_0xf4f0('0x16'),QUERY),{'type':dbH[_0xf4f0('0x15')][_0xf4f0('0x17')][_0xf4f0('0x18')]});})['then'](function(_0x34af76){if(!_0x34af76[0x0]['num']){return analyticExtractedReport('Empty');}var _0x246abd=[];var _0x51ef8a=0x0;if(_0x445b76[_0xf4f0('0x12')]){if(_0x34af76&&_0x34af76[_0xf4f0('0x19')]){var _0x2b7468=_[_0xf4f0('0x1a')](_0x34af76[0x0][_0xf4f0('0x1b')]/_0x20dfc5);var _0x3fcd8f=Number[_0xf4f0('0x1c')](_0x34af76[0x0][_0xf4f0('0x1b')]/_0x20dfc5)?_0x34af76[0x0][_0xf4f0('0x1b')]%_0x20dfc5:0x0;_0x2b7468[_0xf4f0('0x1d')](function(_0x18109b){if(_0x18109b>0x0){_0x51ef8a+=_0x20dfc5;}_0x246abd[_0xf4f0('0x1e')](dbH[_0xf4f0('0x15')][_0xf4f0('0x1f')](util[_0xf4f0('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x20dfc5,_0x51ef8a),{'type':dbH[_0xf4f0('0x15')][_0xf4f0('0x17')][_0xf4f0('0x18')]}));});if(_0x3fcd8f>0x0){_0x51ef8a+=_0x20dfc5;_0x246abd[_0xf4f0('0x1e')](dbH[_0xf4f0('0x15')][_0xf4f0('0x1f')](util[_0xf4f0('0xd')](_0xf4f0('0x20'),QUERY,_0x3fcd8f,_0x51ef8a),{'type':dbH[_0xf4f0('0x15')][_0xf4f0('0x17')][_0xf4f0('0x18')]}));}}}else{_0x246abd[_0xf4f0('0x1e')](dbH[_0xf4f0('0x15')]['query'](QUERY,{'type':dbH[_0xf4f0('0x15')]['QueryTypes'][_0xf4f0('0x18')]}));}var _0x4e2173=path[_0xf4f0('0x21')](PATH);var _0x1cfe65=path[_0xf4f0('0x22')](PATH,_0xf4f0('0x23'));var _0x1f7b75=_0x445b76[_0xf4f0('0x12')]&&_0x246abd[_0xf4f0('0x19')]>0x1;var _0x34a3f8=[];if(!fs[_0xf4f0('0x24')](path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65))&&_0x1f7b75){fs[_0xf4f0('0x26')](path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65));}return BPromise[_0xf4f0('0x27')](_0x246abd,function(_0x304326){_0x34a3f8[_0xf4f0('0x1e')](_0x304326);})[_0xf4f0('0x13')](function(){for(var _0x13b84a=0x0;_0x13b84a<_0x34a3f8['length'];_0x13b84a+=0x1){var _0x2059a4;var _0x3d5f1e=_0x34a3f8[_0x13b84a];if(_0x1f7b75){_0x2059a4=path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65,util['format']('%s%d.%s',_0x1cfe65,_0x13b84a,_0xf4f0('0x28')));}else{_0x2059a4=path[_0xf4f0('0x25')](_0x4e2173,util[_0xf4f0('0xd')](_0xf4f0('0x29'),_0x1cfe65,'xlsx'));}fs[_0xf4f0('0x2a')](_0x2059a4,json2xls(_0x3d5f1e),_0xf4f0('0x2b'));}})[_0xf4f0('0x13')](function(){if(_0x1f7b75){return new Promise(function(_0x135101){zipdir(path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65),{'saveTo':path[_0xf4f0('0x25')](_0x4e2173,util[_0xf4f0('0xd')](_0xf4f0('0x29'),_0x1cfe65,'zip'))},function(_0x1199b4,_0x1eab0b){rimraf(path['join'](_0x4e2173,_0x1cfe65),function(){});_0x135101(_0xf4f0('0x2c'));});});}})[_0xf4f0('0x13')](function(){logger[_0xf4f0('0x2d')](util[_0xf4f0('0xd')](_0xf4f0('0x2e'),EXTRACTED_REPORT_ID,_0xf4f0('0xf')));return analyticExtractedReport(_0xf4f0('0x2f'),_0x1f7b75?util[_0xf4f0('0xd')](_0xf4f0('0x29'),_0x1cfe65,_0x1f7b75?_0xf4f0('0x30'):_0xf4f0('0x28')):null);});})['catch'](function(_0x1d9c4a){logger[_0xf4f0('0x2d')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf4f0('0xf')),util[_0xf4f0('0x31')](_0x1d9c4a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf4f0('0x32'));})[_0xf4f0('0x33')](function(){process[_0xf4f0('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x81b3=['sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','json2xls','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','find','split','splitSizeXlsx','then'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x81b3,0x19d));var _0x381b=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x81b3[_0x2be8c2];return _0x97f531;};'use strict';var util=require(_0x381b('0x0'));var path=require(_0x381b('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x381b('0x2'));var BPromise=require(_0x381b('0x3'));var zipdir=require(_0x381b('0x4'));var rimraf=require('rimraf');var db=require(_0x381b('0x5'))['db'];var dbH=require(_0x381b('0x5'))['dbH'];var logger=require(_0x381b('0x6'))(_0x381b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x381b('0x8')][0x2]);var QUERY=process[_0x381b('0x8')][0x3];var PATH=process[_0x381b('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x717f71,_0x27a27a){var _0x28b42f={'status':_0x717f71};var _0x55f9f8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x27a27a){_0x28b42f[_0x381b('0x9')]=_0x27a27a;}return db[_0x381b('0xa')][_0x381b('0xb')](_0x28b42f,_0x55f9f8);}function main(){var _0x3c7e9b=0x1388;var _0x4d0d46;logger[_0x381b('0xc')](util[_0x381b('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x381b('0xe')));return db['Setting'][_0x381b('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x381b('0x10'),_0x381b('0x11')]})['then'](function(_0xb1f9e9){if(_0xb1f9e9){_0x4d0d46=_0xb1f9e9;_0x3c7e9b=_0x4d0d46[_0x381b('0x11')]||0x1388;}})[_0x381b('0x12')](function(){return dbH[_0x381b('0x13')][_0x381b('0x14')](util['format'](_0x381b('0x15'),QUERY),{'type':dbH[_0x381b('0x13')][_0x381b('0x16')]['SELECT']});})[_0x381b('0x12')](function(_0x4e0d8b){if(!_0x4e0d8b[0x0][_0x381b('0x17')]){return analyticExtractedReport(_0x381b('0x18'));}var _0x34ca81=[];var _0x5a5e4d=0x0;if(_0x4d0d46[_0x381b('0x10')]){if(_0x4e0d8b&&_0x4e0d8b[_0x381b('0x19')]){var _0x2d8ab4=_[_0x381b('0x1a')](_0x4e0d8b[0x0][_0x381b('0x17')]/_0x3c7e9b);var _0x7c4696=Number[_0x381b('0x1b')](_0x4e0d8b[0x0][_0x381b('0x17')]/_0x3c7e9b)?_0x4e0d8b[0x0][_0x381b('0x17')]%_0x3c7e9b:0x0;_0x2d8ab4[_0x381b('0x1c')](function(_0x42de3f){if(_0x42de3f>0x0){_0x5a5e4d+=_0x3c7e9b;}_0x34ca81['push'](dbH['sequelize'][_0x381b('0x14')](util['format'](_0x381b('0x1d'),QUERY,_0x3c7e9b,_0x5a5e4d),{'type':dbH[_0x381b('0x13')][_0x381b('0x16')][_0x381b('0x1e')]}));});if(_0x7c4696>0x0){_0x5a5e4d+=_0x3c7e9b;_0x34ca81[_0x381b('0x1f')](dbH[_0x381b('0x13')][_0x381b('0x14')](util[_0x381b('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x7c4696,_0x5a5e4d),{'type':dbH[_0x381b('0x13')]['QueryTypes'][_0x381b('0x1e')]}));}}}else{_0x34ca81[_0x381b('0x1f')](dbH[_0x381b('0x13')][_0x381b('0x14')](QUERY,{'type':dbH[_0x381b('0x13')][_0x381b('0x16')][_0x381b('0x1e')]}));}var _0x140825=path['dirname'](PATH);var _0x2585e7=path[_0x381b('0x20')](PATH,_0x381b('0x21'));var _0x18639b=_0x4d0d46['split']&&_0x34ca81[_0x381b('0x19')]>0x1;var _0x35b4ee=[];if(!fs[_0x381b('0x22')](path[_0x381b('0x23')](_0x140825,_0x2585e7))&&_0x18639b){fs[_0x381b('0x24')](path[_0x381b('0x23')](_0x140825,_0x2585e7));}return BPromise[_0x381b('0x25')](_0x34ca81,function(_0x358a41){_0x35b4ee[_0x381b('0x1f')](_0x358a41);})[_0x381b('0x12')](function(){for(var _0xf0b9b5=0x0;_0xf0b9b5<_0x35b4ee['length'];_0xf0b9b5+=0x1){var _0x1e39ba;var _0x464f2c=_0x35b4ee[_0xf0b9b5];if(_0x18639b){_0x1e39ba=path[_0x381b('0x23')](_0x140825,_0x2585e7,util[_0x381b('0xd')](_0x381b('0x26'),_0x2585e7,_0xf0b9b5,_0x381b('0x27')));}else{_0x1e39ba=path['join'](_0x140825,util['format'](_0x381b('0x28'),_0x2585e7,'xlsx'));}fs[_0x381b('0x29')](_0x1e39ba,json2xls(_0x464f2c),_0x381b('0x2a'));}})[_0x381b('0x12')](function(){if(_0x18639b){return new Promise(function(_0x4ab7cb){zipdir(path[_0x381b('0x23')](_0x140825,_0x2585e7),{'saveTo':path['join'](_0x140825,util[_0x381b('0xd')](_0x381b('0x28'),_0x2585e7,_0x381b('0x2b')))},function(_0x49c6da,_0x1c9d16){rimraf(path['join'](_0x140825,_0x2585e7),function(){});_0x4ab7cb(_0x381b('0x2c'));});});}})[_0x381b('0x12')](function(){logger[_0x381b('0xc')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x381b('0xe')));return analyticExtractedReport('Completed',_0x18639b?util[_0x381b('0xd')](_0x381b('0x28'),_0x2585e7,_0x18639b?_0x381b('0x2b'):_0x381b('0x27')):null);});})[_0x381b('0x2d')](function(_0x3316f7){logger['info'](util[_0x381b('0xd')](_0x381b('0x2e'),EXTRACTED_REPORT_ID,_0x381b('0xe')),util['inspect'](_0x3316f7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x381b('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index baeb7c0..5c2bff7 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 _0xcc39=['findAll','then','intervals','VoiceExtension','IntervalId','map','exten','filter','playback','hasOwnProperty','priority','extensions','find','push','type','Set','format','CDR(type)=%s','context','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','answer','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','bulkCreate','sortBy','error','lodash','util','models','Interval'];(function(_0x5b27ab,_0x2efcdc){var _0x1b45a4=function(_0xd90dcb){while(--_0xd90dcb){_0x5b27ab['push'](_0x5b27ab['shift']());}};_0x1b45a4(++_0x2efcdc);}(_0xcc39,0x1d1));var _0x9cc3=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xcc39[_0x41cfd4];return _0x190f48;};'use strict';var _=require(_0x9cc3('0x0'));var util=require(_0x9cc3('0x1'));function rewrite(_0x186903,_0x221736){var _0x14968d=this;return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x3')][_0x9cc3('0x4')]({'raw':!![]})[_0x9cc3('0x5')](function(_0x5b29fa){_0x14968d[_0x9cc3('0x6')]=_0x5b29fa;return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x7')]['findAll']({'where':{'IntervalId':_0x221736[_0x9cc3('0x8')]},'raw':!![]});})[_0x9cc3('0x5')](function(_0xf74b19){return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x7')][_0x9cc3('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x9cc3('0x9')](_0xf74b19,_0x9cc3('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x5272c4){var _0x4f12b9=_[_0x9cc3('0xb')](_0x5272c4,{'priority':'1'});var _0x5ade90=_[_0x9cc3('0xb')](_0x5272c4,{'isApp':0x1});var _0x6ab743=_['groupBy'](_0x5ade90,_0x9cc3('0xa'));var _0x2b9fe8=['queue',_0x9cc3('0xc')];var _0x3419d3=[];var _0x2f8c9e=[];for(var _0x27211d in _0x6ab743){if(_0x6ab743[_0x9cc3('0xd')](_0x27211d)){_0x14968d[_0x9cc3('0xe')]=0x2;_0x14968d[_0x9cc3('0xf')]=[];_0x14968d['extension']=_[_0x9cc3('0x10')](_0x4f12b9,{'exten':_0x6ab743[_0x27211d][0x0]['exten']});_0x14968d['extensions'][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':util[_0x9cc3('0x14')](_0x9cc3('0x15'),_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')]),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});if(_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')]==='inbound'){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x17')+_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d['priority']++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});}else if(_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')]===_0x9cc3('0x19')){if(_0x14968d['extension']){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x1a')+(_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x1c')]?_0x9cc3('0x1d')+_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x1c')]+'}':_0x9cc3('0x1e')),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});}_0x14968d[_0x9cc3('0xf')]['push']({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':'Set','appdata':_0x9cc3('0x17')+_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});var _0x3f223c=_0x14968d['priority']++;_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':'ExecIf','appdata':_0x9cc3('0x1f')+(_0x3f223c+0x2)+_0x9cc3('0x20')+(_0x3f223c+0x1)+')','context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x3f223c,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});if(_0x14968d[_0x9cc3('0x1b')]){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x14968d['extension'][_0x9cc3('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x14968d['extension']['cutdigits']+'}':_0x9cc3('0x21'),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});}_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':'Set','appdata':_0x9cc3('0x22')+_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});if(_0x14968d[_0x9cc3('0x1b')]&&_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0xd')](_0x9cc3('0x23'))&&_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x23')]!==_0x9cc3('0x24')){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});_0x14968d['extensions'][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x23')]||_0x9cc3('0x25'),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});}}_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d['priority']++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x26'),'context':_0x6ab743[_0x27211d][0x0]['context'],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x27'),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0]['exten'],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});for(var _0x1a5219=0x0,_0xe35396=0x0;_0x1a5219<_0x6ab743[_0x27211d]['length'];_0x1a5219+=0x1,_0xe35396=0x0){var _0x10b54e=_0x6ab743[_0x27211d][_0x1a5219];if(_0x10b54e[_0x9cc3('0x12')]){_0x10b54e[_0x9cc3('0x12')]=_0x10b54e[_0x9cc3('0x12')][_0x9cc3('0x28')]();}var _0x36044f=[];var _0x26e516=[];delete _0x10b54e['id'];delete _0x10b54e[_0x9cc3('0x29')];delete _0x10b54e[_0x9cc3('0x2a')];var _0x373c77=_0x10b54e['interval']!==_0x9cc3('0x2b')?[_0x10b54e[_0x9cc3('0x2c')]]:_0x10b54e[_0x9cc3('0x8')]?_[_0x9cc3('0x9')](_[_0x9cc3('0xb')](_0x14968d[_0x9cc3('0x6')],{'IntervalId':_0x10b54e['IntervalId']}),_0x9cc3('0x2c')):[];if(_0x10b54e[_0x9cc3('0xd')]('tag')){if(_0x10b54e[_0x9cc3('0x2d')]&&_0x10b54e['tag']!=='--'){_0x36044f['push']({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x2e')+_0x10b54e[_0x9cc3('0x2d')],'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d['priority']+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}}if(_0x10b54e[_0x9cc3('0x12')]===_0x9cc3('0x19')&&_0x10b54e[_0x9cc3('0xd')](_0x9cc3('0x30'))){if(_0x10b54e[_0x9cc3('0x30')]){_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':'ExecIf','appdata':_0x9cc3('0x31')+_0x10b54e[_0x9cc3('0x30')]+')','context':_0x10b54e['context'],'exten':_0x10b54e['exten'],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}else{_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x32'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77['length']+_0x14968d['priority']+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}}if(_0x10b54e[_0x9cc3('0xd')](_0x9cc3('0x33'))){if(_0x2b9fe8['indexOf'](_0x10b54e[_0x9cc3('0x34')][_0x9cc3('0x28')]())>=0x0&&_0x10b54e[_0x9cc3('0x35')]!=='custom'){if(_0x10b54e[_0x9cc3('0x33')]){_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x32'),'appdata':_0x9cc3('0x36'),'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e['VoiceExtensionId']});_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x37'),'context':_0x10b54e['context'],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77['length']+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}else{_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x32'),'appdata':_0x9cc3('0x38'),'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77['length']+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e['type'],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x39'),'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e['VoiceExtensionId']});}}}for(var _0x4fc8b1=0x0;_0x4fc8b1<_0x373c77[_0x9cc3('0x2f')];_0x4fc8b1+=0x1){var _0x44a44f=_0x14968d[_0x9cc3('0xe')]+_0x373c77['length'];var _0x11f3fd=_0x4fc8b1===_0x373c77['length']-0x1?_0x14968d[_0x9cc3('0xe')]+_0x36044f[_0x9cc3('0x2f')]+_0x26e516[_0x9cc3('0x2f')]+0x2:_0x14968d[_0x9cc3('0xe')]+_0x4fc8b1+0x1;_0x36044f[_0x9cc3('0x3a')](_0x4fc8b1,0x0,{'type':_0x10b54e['type'],'app':_0x9cc3('0x3b'),'appdata':_0x373c77[_0x4fc8b1]+'?'+_0x10b54e[_0x9cc3('0x16')]+_0x9cc3('0x3c')+_0x44a44f+':'+_0x10b54e[_0x9cc3('0x16')]+_0x9cc3('0x3c')+_0x11f3fd,'exten':_0x10b54e['exten'],'context':_0x10b54e['context'],'priority':_0x14968d[_0x9cc3('0xe')]+_0x4fc8b1,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});}_0x10b54e[_0x9cc3('0xe')]=_0x36044f['length']?_[_0x9cc3('0x3d')](_0x36044f)[_0x9cc3('0xe')]+0x1:_0x14968d[_0x9cc3('0xe')];_0x14968d[_0x9cc3('0xe')]=(_0x26e516[_0x9cc3('0x2f')]?_[_0x9cc3('0x3d')](_0x26e516)[_0x9cc3('0xe')]:_0x10b54e['priority'])+0x1;_0x14968d[_0x9cc3('0xf')]=_[_0x9cc3('0x3e')](_0x14968d['extensions'],_0x36044f,[_0x10b54e],_0x26e516);}_0x14968d['extensions']['push']({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x3f'),'exten':_0x6ab743[_0x27211d][0x0]['exten'],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'priority':_0x14968d[_0x9cc3('0xe')],'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});_0x3419d3['push'](_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]);_0x2f8c9e=_[_0x9cc3('0x3e')](_0x2f8c9e,_0x14968d[_0x9cc3('0xf')]);}}return _0x186903['transaction'](function(_0x3d16b8){return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3419d3}},'transaction':_0x3d16b8})['then'](function(_0x4f94bd){return _0x186903['models'][_0x9cc3('0x7')][_0x9cc3('0x40')](_[_0x9cc3('0x41')](_0x2f8c9e,_0x9cc3('0xe')),{'transaction':_0x3d16b8});});});})['catch'](function(_0x2de68c){console[_0x9cc3('0x42')](_0x2de68c);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xbd9f=['hasOwnProperty','extensions','find','push','type','Set','format','context','VoiceExtensionId','inbound','CDR(routeid)=','priority','extension','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','bulkCreate','sortBy','catch','error','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback'];(function(_0x109ca0,_0x1010c6){var _0x58a444=function(_0x860a1a){while(--_0x860a1a){_0x109ca0['push'](_0x109ca0['shift']());}};_0x58a444(++_0x1010c6);}(_0xbd9f,0xc6));var _0xfbd9=function(_0x5eb3c1,_0x2d0bab){_0x5eb3c1=_0x5eb3c1-0x0;var _0xfafed=_0xbd9f[_0x5eb3c1];return _0xfafed;};'use strict';var _=require('lodash');var util=require(_0xfbd9('0x0'));function rewrite(_0x5ebe51,_0x31eb0d){var _0x1a0531=this;return _0x5ebe51[_0xfbd9('0x1')][_0xfbd9('0x2')][_0xfbd9('0x3')]({'raw':!![]})[_0xfbd9('0x4')](function(_0x149f00){_0x1a0531[_0xfbd9('0x5')]=_0x149f00;return _0x5ebe51[_0xfbd9('0x1')][_0xfbd9('0x6')][_0xfbd9('0x3')]({'where':{'IntervalId':_0x31eb0d[_0xfbd9('0x7')]},'raw':!![]});})['then'](function(_0x4383de){return _0x5ebe51[_0xfbd9('0x1')][_0xfbd9('0x6')][_0xfbd9('0x3')]({'where':{'exten':{'$in':_[_0xfbd9('0x8')](_[_0xfbd9('0x9')](_0x4383de,_0xfbd9('0xa')))}},'order':[{'raw':_0xfbd9('0xb')}],'raw':!![]});})['then'](function(_0x32dd48){var _0x5291f2=_[_0xfbd9('0xc')](_0x32dd48,{'priority':'1'});var _0x2a10c9=_[_0xfbd9('0xc')](_0x32dd48,{'isApp':0x1});var _0x5e4b2a=_['groupBy'](_0x2a10c9,'exten');var _0x3f5aaf=[_0xfbd9('0xd'),_0xfbd9('0xe')];var _0x174d5f=[];var _0x1ed99b=[];for(var _0x2368af in _0x5e4b2a){if(_0x5e4b2a[_0xfbd9('0xf')](_0x2368af)){_0x1a0531['priority']=0x2;_0x1a0531[_0xfbd9('0x10')]=[];_0x1a0531['extension']=_[_0xfbd9('0x11')](_0x5291f2,{'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')]});_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':util[_0xfbd9('0x15')]('CDR(type)=%s',_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')]),'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0]['exten'],'priority':_0x1a0531['priority']++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});if(_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')]===_0xfbd9('0x18')){_0x1a0531['extensions']['push']({'type':_0x5e4b2a[_0x2368af][0x0]['type'],'app':'Set','appdata':_0xfbd9('0x19')+_0x5e4b2a[_0x2368af][0x0]['VoiceExtensionId'],'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531[_0xfbd9('0x1a')]++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});}else if(_0x5e4b2a[_0x2368af][0x0]['type']==='outbound'){if(_0x1a0531[_0xfbd9('0x1b')]){_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':'CDR(destination)='+(_0x1a0531[_0xfbd9('0x1b')][_0xfbd9('0x1c')]?_0xfbd9('0x1d')+_0x1a0531['extension'][_0xfbd9('0x1c')]+'}':_0xfbd9('0x1e')),'context':_0x5e4b2a[_0x2368af][0x0]['context'],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531[_0xfbd9('0x1a')]++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});}_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0]['type'],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x19')+_0x5e4b2a[_0x2368af][0x0]['VoiceExtensionId'],'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531['priority']++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});var _0x57d6ff=_0x1a0531[_0xfbd9('0x1a')]++;_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0]['type'],'app':_0xfbd9('0x1f'),'appdata':_0xfbd9('0x20')+(_0x57d6ff+0x2)+_0xfbd9('0x21')+(_0x57d6ff+0x1)+')','context':_0x5e4b2a[_0x2368af][0x0]['context'],'exten':_0x5e4b2a[_0x2368af][0x0]['exten'],'priority':_0x57d6ff,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0]['VoiceExtensionId']});if(_0x1a0531[_0xfbd9('0x1b')]){_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':_0x1a0531[_0xfbd9('0x1b')]['cutdigits']?_0xfbd9('0x22')+_0x1a0531[_0xfbd9('0x1b')]['cutdigits']+'}':_0xfbd9('0x23'),'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531[_0xfbd9('0x1a')]++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0]['VoiceExtensionId']});}_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0]['type'],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x24')+_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')],'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531[_0xfbd9('0x1a')]++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});if(_0x1a0531['extension']&&_0x1a0531[_0xfbd9('0x1b')][_0xfbd9('0xf')](_0xfbd9('0x25'))&&_0x1a0531[_0xfbd9('0x1b')][_0xfbd9('0x25')]!=='none'){_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x26'),'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531[_0xfbd9('0x1a')]++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0]['VoiceExtensionId']});_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0]['type'],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x27')+_0x1a0531['extension'][_0xfbd9('0x25')]||'wav','context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531[_0xfbd9('0x1a')]++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});}}_0x1a0531['extensions'][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x28'),'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531['priority']++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x29'),'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531[_0xfbd9('0x1a')]++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0]['VoiceExtensionId']});_0x1a0531['extensions'][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x2a'),'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'priority':_0x1a0531['priority']++,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});for(var _0x16368a=0x0,_0x4dc3fb=0x0;_0x16368a<_0x5e4b2a[_0x2368af][_0xfbd9('0x2b')];_0x16368a+=0x1,_0x4dc3fb=0x0){var _0x5ba850=_0x5e4b2a[_0x2368af][_0x16368a];if(_0x5ba850[_0xfbd9('0x13')]){_0x5ba850[_0xfbd9('0x13')]=_0x5ba850[_0xfbd9('0x13')][_0xfbd9('0x2c')]();}var _0x1581d8=[];var _0x48c32b=[];delete _0x5ba850['id'];delete _0x5ba850[_0xfbd9('0x2d')];delete _0x5ba850[_0xfbd9('0x2e')];var _0x362d0d=_0x5ba850[_0xfbd9('0x2f')]!==_0xfbd9('0x30')?[_0x5ba850[_0xfbd9('0x2f')]]:_0x5ba850['IntervalId']?_[_0xfbd9('0x9')](_['filter'](_0x1a0531[_0xfbd9('0x5')],{'IntervalId':_0x5ba850[_0xfbd9('0x7')]}),_0xfbd9('0x2f')):[];if(_0x5ba850[_0xfbd9('0xf')](_0xfbd9('0x31'))){if(_0x5ba850[_0xfbd9('0x31')]&&_0x5ba850[_0xfbd9('0x31')]!=='--'){_0x1581d8[_0xfbd9('0x12')]({'type':_0x5ba850[_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x32')+_0x5ba850[_0xfbd9('0x31')],'context':_0x5ba850[_0xfbd9('0x16')],'exten':_0x5ba850[_0xfbd9('0xa')],'priority':_0x362d0d['length']+_0x1a0531[_0xfbd9('0x1a')]+_0x4dc3fb++,'VoiceExtensionId':_0x5ba850[_0xfbd9('0x17')]});}}if(_0x5ba850[_0xfbd9('0x13')]===_0xfbd9('0x33')&&_0x5ba850[_0xfbd9('0xf')](_0xfbd9('0x34'))){if(_0x5ba850[_0xfbd9('0x34')]){_0x1581d8[_0xfbd9('0x12')]({'type':_0x5ba850[_0xfbd9('0x13')],'app':_0xfbd9('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5ba850[_0xfbd9('0x34')]+')','context':_0x5ba850['context'],'exten':_0x5ba850[_0xfbd9('0xa')],'priority':_0x362d0d['length']+_0x1a0531[_0xfbd9('0x1a')]+_0x4dc3fb++,'VoiceExtensionId':_0x5ba850[_0xfbd9('0x17')]});}else{_0x1581d8[_0xfbd9('0x12')]({'type':_0x5ba850[_0xfbd9('0x13')],'app':_0xfbd9('0x1f'),'appdata':_0xfbd9('0x35'),'context':_0x5ba850[_0xfbd9('0x16')],'exten':_0x5ba850[_0xfbd9('0xa')],'priority':_0x362d0d[_0xfbd9('0x2b')]+_0x1a0531[_0xfbd9('0x1a')]+_0x4dc3fb++,'VoiceExtensionId':_0x5ba850[_0xfbd9('0x17')]});}}if(_0x5ba850[_0xfbd9('0xf')](_0xfbd9('0x36'))){if(_0x3f5aaf['indexOf'](_0x5ba850[_0xfbd9('0x37')][_0xfbd9('0x2c')]())>=0x0&&_0x5ba850[_0xfbd9('0x38')]!==_0xfbd9('0x39')){if(_0x5ba850[_0xfbd9('0x36')]){_0x1581d8[_0xfbd9('0x12')]({'type':_0x5ba850['type'],'app':'ExecIf','appdata':_0xfbd9('0x3a'),'context':_0x5ba850[_0xfbd9('0x16')],'exten':_0x5ba850[_0xfbd9('0xa')],'priority':_0x362d0d[_0xfbd9('0x2b')]+_0x1a0531[_0xfbd9('0x1a')]+_0x4dc3fb++,'VoiceExtensionId':_0x5ba850[_0xfbd9('0x17')]});_0x1581d8[_0xfbd9('0x12')]({'type':_0x5ba850['type'],'app':_0xfbd9('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5ba850[_0xfbd9('0x16')],'exten':_0x5ba850[_0xfbd9('0xa')],'priority':_0x362d0d[_0xfbd9('0x2b')]+_0x1a0531['priority']+_0x4dc3fb++,'VoiceExtensionId':_0x5ba850[_0xfbd9('0x17')]});}else{_0x1581d8['push']({'type':_0x5ba850[_0xfbd9('0x13')],'app':_0xfbd9('0x1f'),'appdata':_0xfbd9('0x3b'),'context':_0x5ba850[_0xfbd9('0x16')],'exten':_0x5ba850[_0xfbd9('0xa')],'priority':_0x362d0d['length']+_0x1a0531['priority']+_0x4dc3fb++,'VoiceExtensionId':_0x5ba850['VoiceExtensionId']});_0x1581d8['push']({'type':_0x5ba850[_0xfbd9('0x13')],'app':_0xfbd9('0x14'),'appdata':_0xfbd9('0x3c'),'context':_0x5ba850[_0xfbd9('0x16')],'exten':_0x5ba850[_0xfbd9('0xa')],'priority':_0x362d0d[_0xfbd9('0x2b')]+_0x1a0531[_0xfbd9('0x1a')]+_0x4dc3fb++,'VoiceExtensionId':_0x5ba850[_0xfbd9('0x17')]});}}}for(var _0x3c0556=0x0;_0x3c0556<_0x362d0d[_0xfbd9('0x2b')];_0x3c0556+=0x1){var _0x301853=_0x1a0531['priority']+_0x362d0d['length'];var _0x3045a6=_0x3c0556===_0x362d0d['length']-0x1?_0x1a0531[_0xfbd9('0x1a')]+_0x1581d8[_0xfbd9('0x2b')]+_0x48c32b[_0xfbd9('0x2b')]+0x2:_0x1a0531[_0xfbd9('0x1a')]+_0x3c0556+0x1;_0x1581d8['splice'](_0x3c0556,0x0,{'type':_0x5ba850[_0xfbd9('0x13')],'app':_0xfbd9('0x3d'),'appdata':_0x362d0d[_0x3c0556]+'?'+_0x5ba850[_0xfbd9('0x16')]+_0xfbd9('0x3e')+_0x301853+':'+_0x5ba850[_0xfbd9('0x16')]+_0xfbd9('0x3e')+_0x3045a6,'exten':_0x5ba850['exten'],'context':_0x5ba850[_0xfbd9('0x16')],'priority':_0x1a0531['priority']+_0x3c0556,'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});}_0x5ba850[_0xfbd9('0x1a')]=_0x1581d8[_0xfbd9('0x2b')]?_[_0xfbd9('0x3f')](_0x1581d8)['priority']+0x1:_0x1a0531[_0xfbd9('0x1a')];_0x1a0531[_0xfbd9('0x1a')]=(_0x48c32b[_0xfbd9('0x2b')]?_['last'](_0x48c32b)[_0xfbd9('0x1a')]:_0x5ba850[_0xfbd9('0x1a')])+0x1;_0x1a0531[_0xfbd9('0x10')]=_[_0xfbd9('0x40')](_0x1a0531[_0xfbd9('0x10')],_0x1581d8,[_0x5ba850],_0x48c32b);}_0x1a0531[_0xfbd9('0x10')][_0xfbd9('0x12')]({'type':_0x5e4b2a[_0x2368af][0x0]['type'],'app':'Hangup','exten':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0xa')],'context':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x16')],'priority':_0x1a0531['priority'],'VoiceExtensionId':_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]});_0x174d5f['push'](_0x5e4b2a[_0x2368af][0x0][_0xfbd9('0x17')]);_0x1ed99b=_['concat'](_0x1ed99b,_0x1a0531[_0xfbd9('0x10')]);}}return _0x5ebe51[_0xfbd9('0x41')](function(_0x283ba2){return _0x5ebe51[_0xfbd9('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x174d5f}},'transaction':_0x283ba2})[_0xfbd9('0x4')](function(_0x3d7f75){return _0x5ebe51[_0xfbd9('0x1')]['VoiceExtension'][_0xfbd9('0x42')](_[_0xfbd9('0x43')](_0x1ed99b,_0xfbd9('0x1a')),{'transaction':_0x283ba2});});});})[_0xfbd9('0x44')](function(_0x54e868){console[_0xfbd9('0x45')](_0x54e868);});}exports[_0xfbd9('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index aa50d76..54c6ad0 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 _0xb5b4=['error','contact','index','test','errors','message','join','data','phone','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','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','always','query','VoiceQueueId','onlyIfOpen','sequelize','findAll','BlackLists','get','all','Campaign','Lists','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb5b4,0x1ab));var _0x4b5b=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0xb5b4[_0x5cab28];return _0xa3554d;};'use strict';var BPromise=require(_0x4b5b('0x0'));var util=require('util');var _=require(_0x4b5b('0x1'));var fs=require('fs');var squel=require(_0x4b5b('0x2'));var Papa=require(_0x4b5b('0x3'));var Redis=require(_0x4b5b('0x4'));var db=require(_0x4b5b('0x5'))['db'];var config=require(_0x4b5b('0x6'));var logger=require(_0x4b5b('0x7'))('api');config[_0x4b5b('0x8')]=_['defaults'](config[_0x4b5b('0x8')],{'host':_0x4b5b('0x9'),'port':0x18eb});var socket=require(_0x4b5b('0xa'))(new Redis(config[_0x4b5b('0x8')]));require(_0x4b5b('0xb'))[_0x4b5b('0xc')](socket);try{if(!process[_0x4b5b('0xd')][0x2]||process[_0x4b5b('0xd')][0x2]==='undefined'||process[_0x4b5b('0xd')][0x2]===_0x4b5b('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x4b5b('0xd')][0x2];if(!process['argv'][0x3]||process[_0x4b5b('0xd')][0x3]===_0x4b5b('0xf')||process[_0x4b5b('0xd')][0x3]==='null'||!process[_0x4b5b('0xd')][0x4]||process[_0x4b5b('0xd')][0x4]===_0x4b5b('0xf')||process[_0x4b5b('0xd')][0x4]===_0x4b5b('0xe')){throw new Error(_0x4b5b('0x10'));}var FIELDS=_[_0x4b5b('0x11')](process[_0x4b5b('0xd')][0x3]['split'](','),process[_0x4b5b('0xd')][0x4][_0x4b5b('0x12')](','));if(!process['argv'][0x5]||process[_0x4b5b('0xd')][0x5]==='undefined'||process[_0x4b5b('0xd')][0x5]==='null'){throw new Error(_0x4b5b('0x13'));}var LISTID=process[_0x4b5b('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x4b5b('0xd')][0x6]!==_0x4b5b('0xf')&&process[_0x4b5b('0xd')][0x6]!==_0x4b5b('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x4b5b('0xd')][0x7]&&process['argv'][0x7]!==_0x4b5b('0xf')&&process[_0x4b5b('0xd')][0x7]!=='null'?process[_0x4b5b('0xd')][0x7]:null;if(!process[_0x4b5b('0xd')][0x8]||process[_0x4b5b('0xd')][0x8]==='undefined'||process[_0x4b5b('0xd')][0x8]===_0x4b5b('0xe')){throw new Error(_0x4b5b('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x58afd9){logger[_0x4b5b('0x15')](_0x58afd9);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(_0x33093,_0x420350,_0x56024b,_0x4ca5a4){var _0x526890={'message':_0x420350};_0x526890[_0x33093]=!![];if(_0x56024b){_0x526890[_0x4b5b('0x16')]=_0x56024b;}if(_0x4ca5a4){_0x526890[_0x4b5b('0x17')]=_0x4ca5a4;}return _0x526890;}function isEmail(_0x5e12ad){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))*$/[_0x4b5b('0x18')](_0x5e12ad);}function checkRow(_0x113ed0,_0x1ee05e,_0x36fc3b){return new BPromise(function(_0xc0058c,_0x2fe166){if(_['isNil'](_0x113ed0)){return _0x2fe166(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x36fc3b));}if(_0x113ed0[_0x4b5b('0x19')]&&_0x113ed0[_0x4b5b('0x19')]['length']){var _0xf97a8c=_['map'](_0x113ed0[_0x4b5b('0x19')],_0x4b5b('0x1a'))[_0x4b5b('0x1b')](';');return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0xf97a8c,null,_0x36fc3b));}var _0x178de6={};for(var _0x2aeae4 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2aeae4)&&FIELDS[_0x2aeae4]){_0x178de6[_0x2aeae4]=_0x113ed0[_0x4b5b('0x1c')][0x0][FIELDS[_0x2aeae4]]||_0x113ed0['data'][0x0]['\ufeff'+FIELDS[_0x2aeae4]];}}if(!_0x178de6['firstName']){return _0x2fe166(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x36fc3b));}if(!_0x178de6[_0x4b5b('0x1d')]){return _0x2fe166(handleCheckRowError('error',_0x4b5b('0x1e'),null,_0x36fc3b));}if(_0x178de6['birthDate']){var _0x2dde02=moment(_0x178de6[_0x4b5b('0x1f')],_0x4b5b('0x20'));if(!_0x2dde02[_0x4b5b('0x21')]()){return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0x4b5b('0x22'),null,_0x36fc3b));}}if(_0x178de6[_0x4b5b('0x23')]){if(!isEmail(_0x178de6[_0x4b5b('0x23')])){return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0x4b5b('0x24'),null,_0x36fc3b));}}_0x178de6[_0x4b5b('0x25')]=LISTID;_0x178de6[_0x4b5b('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4b5b('0x27')]&&_0x1ee05e){var _0x131447={};for(var _0xead1d4=0x0,_0x3684aa=DUPLICATES[_0x4b5b('0x27')];_0xead1d4<_0x3684aa;_0xead1d4+=0x1){_0x131447[DUPLICATES[_0xead1d4]]=_0x178de6[DUPLICATES[_0xead1d4]];}var _0x1c5c7c=_[_0x4b5b('0x28')](_0x1ee05e,_0x131447);if(_0x1c5c7c){return _0x2fe166(handleCheckRowError(_0x4b5b('0x29'),_0x4b5b('0x2a'),_0x1c5c7c,_0x36fc3b));}}return db[_0x4b5b('0x2b')][_0x4b5b('0x2c')](_0x178de6,{'raw':!![],'hooks':![],'fields':_[_0x4b5b('0x2d')](_0x178de6)})[_0x4b5b('0x2e')](function(_0x15ec2e){if(DUPLICATES&&DUPLICATES[_0x4b5b('0x27')]&&_0x1ee05e){_0x1ee05e[_0x4b5b('0x2f')](_[_0x4b5b('0x30')](_0x178de6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x15ec2e['id'];return _0xc0058c();})[_0x4b5b('0x31')](function(_0x4a740d){return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0x4b5b('0x32')+(_0x4a740d[_0x4b5b('0x1a')]||JSON[_0x4b5b('0x33')](_0x4a740d)),null,_0x36fc3b));});});}function checkHopper(){function _0x856195(){return function(_0x2fcb36){logger[_0x4b5b('0x15')](_0x4b5b('0x34'),'checkHopper',util[_0x4b5b('0x35')](_0x2fcb36,{'showHidden':![],'depth':null}));};}var _0x3f63db=function(_0x2407bc,_0x31dd23){var _0x4a33b2=squel[_0x4b5b('0x36')]()[_0x4b5b('0x37')]('cm_hopper')[_0x4b5b('0x38')](['phone',_0x4b5b('0x39'),_0x4b5b('0x3a'),_0x4b5b('0x25'),_0x31dd23,_0x4b5b('0x3b'),_0x4b5b('0x3c')],squel['select']()[_0x4b5b('0x3d')](_0x4b5b('0x1d'),'phone')[_0x4b5b('0x3d')]('NOW()',_0x4b5b('0x39'))[_0x4b5b('0x3d')]('id',_0x4b5b('0x3a'))[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))[_0x4b5b('0x3d')](_0x2407bc['id']['toString'](),_0x31dd23)['field'](_0x4b5b('0x3f'),_0x4b5b('0x3b'))[_0x4b5b('0x3d')]('NOW()',_0x4b5b('0x3c'))[_0x4b5b('0x40')](_0x4b5b('0x41'))[_0x4b5b('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x4b5b('0x43'),LISTID['toString']())[_0x4b5b('0x42')](_0x4b5b('0x44'))['where'](_0x4b5b('0x45'),squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x1d'))[_0x4b5b('0x40')](_0x4b5b('0x47'))[_0x4b5b('0x42')](_0x31dd23+_0x4b5b('0x48'),_0x2407bc['id'][_0x4b5b('0x3e')]())))[_0x4b5b('0x3e')]();return _0x4a33b2;};var _0x2d0582=function(_0xf4dcca,_0xdc7ef5){var _0x3c887b=squel[_0x4b5b('0x36')]()['into'](_0x4b5b('0x47'))[_0x4b5b('0x38')]([_0x4b5b('0x1d'),'scheduledAt',_0x4b5b('0x3a'),_0x4b5b('0x25'),_0xdc7ef5,'createdAt','updatedAt'],squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x1d'),'phone')[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x39'))[_0x4b5b('0x3d')]('id',_0x4b5b('0x3a'))[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))[_0x4b5b('0x3d')](_0xf4dcca['id'][_0x4b5b('0x3e')](),_0xdc7ef5)[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x3b'))[_0x4b5b('0x3d')](_0x4b5b('0x3f'),'updatedAt')[_0x4b5b('0x40')](_0x4b5b('0x41'))[_0x4b5b('0x42')](_0x4b5b('0x49'))[_0x4b5b('0x42')](_0x4b5b('0x43'),LISTID[_0x4b5b('0x3e')]())[_0x4b5b('0x42')](_0x4b5b('0x4a'),squel[_0x4b5b('0x4b')](hopperContacts))['where'](_0x4b5b('0x44'))[_0x4b5b('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x4c'))['from'](_0x4b5b('0x4d'))[_0x4b5b('0x42')](_0xdc7ef5+_0x4b5b('0x48'),_0xf4dcca['id'][_0x4b5b('0x3e')]()))[_0x4b5b('0x42')](_0x4b5b('0x45'),squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x1d'))[_0x4b5b('0x40')](_0x4b5b('0x47'))[_0x4b5b('0x42')](_0xdc7ef5+_0x4b5b('0x48'),_0xf4dcca['id']['toString']())))[_0x4b5b('0x3e')]();return _0x3c887b;};function _0x333575(_0x32a702,_0x274a3e){var _0x43fe64=squel['insert']()[_0x4b5b('0x37')]('cm_hopper')[_0x4b5b('0x38')]([_0x4b5b('0x1d'),'scheduledAt','ContactId',_0x4b5b('0x25'),_0x274a3e,_0x4b5b('0x3b'),'updatedAt'],squel['select']()[_0x4b5b('0x3d')](_0x4b5b('0x1d'),_0x4b5b('0x1d'))[_0x4b5b('0x3d')]('NOW()','scheduledAt')['field']('id','ContactId')[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))['field'](_0x32a702['id'][_0x4b5b('0x3e')](),_0x274a3e)[_0x4b5b('0x3d')]('NOW()',_0x4b5b('0x3b'))[_0x4b5b('0x3d')]('NOW()','updatedAt')[_0x4b5b('0x40')](_0x4b5b('0x41'))['where'](_0x4b5b('0x49'))[_0x4b5b('0x42')](_0x4b5b('0x43'),LISTID[_0x4b5b('0x3e')]())[_0x4b5b('0x42')](_0x4b5b('0x4a'),squel['str'](hopperContacts))[_0x4b5b('0x42')](_0x4b5b('0x44')))[_0x4b5b('0x3e')]();return _0x43fe64;}function _0x38bf67(_0x5cf78b,_0x7abdd4){var _0x59b9d0=squel[_0x4b5b('0x36')]()['into'](_0x4b5b('0x4e'))[_0x4b5b('0x38')]([_0x4b5b('0x1d'),_0x4b5b('0x3a'),_0x4b5b('0x25'),_0x7abdd4,'createdAt',_0x4b5b('0x3c')],squel[_0x4b5b('0x46')]()['field'](_0x4b5b('0x1d'),_0x4b5b('0x1d'))[_0x4b5b('0x3d')]('id','ContactId')[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))[_0x4b5b('0x3d')](_0x5cf78b['id'][_0x4b5b('0x3e')](),_0x7abdd4)[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x3b'))[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x3c'))[_0x4b5b('0x40')]('cm_contacts')['where'](_0x4b5b('0x49'))[_0x4b5b('0x42')](_0x4b5b('0x43'),LISTID[_0x4b5b('0x3e')]())[_0x4b5b('0x42')](_0x4b5b('0x4a'),squel[_0x4b5b('0x4b')](hopperContacts))[_0x4b5b('0x42')](_0x4b5b('0x44')))[_0x4b5b('0x3e')]();return _0x59b9d0;}return db[_0x4b5b('0x4f')]['findAll']({'where':{'type':_0x4b5b('0x50')},'attributes':['id',_0x4b5b('0x51')],'include':[{'model':db[_0x4b5b('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x4b5b('0x2e')](function(_0x1a978d){var _0x3e410a=[];if(_0x1a978d){var _0x2bf105;for(var _0x1af440=0x0,_0x4781ac;_0x1af440<_0x1a978d['length'];_0x1af440+=0x1){_0x4781ac=_0x1a978d[_0x1af440]['get']({'plain':!![]});switch(_0x4781ac[_0x4b5b('0x51')]){case _0x4b5b('0x53'):_0x3e410a['push'](db['sequelize'][_0x4b5b('0x54')](_0x2d0582(_0x4781ac,_0x4b5b('0x55')))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));break;case _0x4b5b('0x56'):_0x3e410a[_0x4b5b('0x2f')](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x3f63db(_0x4781ac,'VoiceQueueId'))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));break;default:_0x3e410a['push'](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x333575(_0x4781ac,_0x4b5b('0x55')))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));}}}return _0x3e410a;})['all']()[_0x4b5b('0x2e')](function(){return db[_0x4b5b('0x4f')][_0x4b5b('0x58')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x4b5b('0x52')],'as':_0x4b5b('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x20fcb8){var _0x738543=[];if(_0x20fcb8){var _0x15f400;for(var _0x5f1a4d=0x0,_0x1c2285;_0x5f1a4d<_0x20fcb8[_0x4b5b('0x27')];_0x5f1a4d+=0x1){_0x1c2285=_0x20fcb8[_0x5f1a4d][_0x4b5b('0x5a')]({'plain':!![]});_0x738543['push'](db['sequelize'][_0x4b5b('0x54')](_0x38bf67(_0x1c2285,_0x4b5b('0x55')))['then'](function(){})[_0x4b5b('0x31')](_0x856195()));}}return _0x738543;})[_0x4b5b('0x5b')]();})[_0x4b5b('0x2e')](function(){return db[_0x4b5b('0x5c')][_0x4b5b('0x58')]({'attributes':['id',_0x4b5b('0x51')],'include':[{'model':db[_0x4b5b('0x52')],'as':_0x4b5b('0x5d'),'where':{'id':LISTID}}]})[_0x4b5b('0x2e')](function(_0x5dc1e8){var _0x4398f3=[];if(_0x5dc1e8){for(var _0x27af96=0x0,_0xd1b626;_0x27af96<_0x5dc1e8[_0x4b5b('0x27')];_0x27af96+=0x1){_0xd1b626=_0x5dc1e8[_0x27af96]['get']({'plain':!![]});switch(_0xd1b626[_0x4b5b('0x51')]){case _0x4b5b('0x53'):_0x4398f3[_0x4b5b('0x2f')](db['sequelize'][_0x4b5b('0x54')](_0x2d0582(_0xd1b626,'CampaignId'))['then'](function(){})[_0x4b5b('0x31')](_0x856195()));break;case _0x4b5b('0x56'):_0x4398f3['push'](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x3f63db(_0xd1b626,_0x4b5b('0x5e')))[_0x4b5b('0x2e')](function(){})[_0x4b5b('0x31')](_0x856195()));break;default:_0x4398f3['push'](db['sequelize'][_0x4b5b('0x54')](_0x333575(_0xd1b626,_0x4b5b('0x5e')))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));}}}return _0x4398f3;})['all']();})[_0x4b5b('0x2e')](function(){return db[_0x4b5b('0x5c')][_0x4b5b('0x58')]({'attributes':['id'],'include':[{'model':db[_0x4b5b('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x4b5b('0x2e')](function(_0x87b331){var _0x29151d=[];if(_0x87b331){for(var _0x56100d=0x0,_0x4efcfb;_0x56100d<_0x87b331[_0x4b5b('0x27')];_0x56100d+=0x1){_0x4efcfb=_0x87b331[_0x56100d][_0x4b5b('0x5a')]({'plain':!![]});_0x29151d[_0x4b5b('0x2f')](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x38bf67(_0x4efcfb,_0x4b5b('0x5e')))[_0x4b5b('0x2e')](function(){})[_0x4b5b('0x31')](_0x856195()));}}return _0x29151d;})[_0x4b5b('0x5b')]();})['catch'](function(_0x561e1b){logger[_0x4b5b('0x15')]('cmContact,\x20%s,\x20%s',_0x4b5b('0x5f'),_0x561e1b[_0x4b5b('0x1a')]);});}var processPromises=function(_0x81a9c4){return BPromise[_0x4b5b('0x5b')](promises)[_0x4b5b('0x2e')](function(_0xb9bb1f){})[_0x4b5b('0x31')](function(_0x4e86d5){logger[_0x4b5b('0x15')](_0x4b5b('0x60'),JSON['stringify'](_0x4e86d5));})[_0x4b5b('0x61')](function(){socket['emit'](_0x4b5b('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x81a9c4){return _0x81a9c4[_0x4b5b('0x63')]();}});};var endCsv=function(){return BPromise[_0x4b5b('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x4b5b('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4b5b('0x65')](FILEPATH);}catch(_0x1a54a8){logger['error'](_0x4b5b('0x66'),JSON[_0x4b5b('0x33')](_0x1a54a8));}finally{process[_0x4b5b('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x4b5b('0x68')](_0x4b5b('0x69'));endCsv();});function main(){return BPromise[_0x4b5b('0x64')]()[_0x4b5b('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4b5b('0x12')](',');return db[_0x4b5b('0x2b')][_0x4b5b('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4b5b('0x2e')](function(_0x224a5c){var _0x373784=fs[_0x4b5b('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4b5b('0x6b')](_0x373784,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a1bcc,_0x301cb0){total+=0x1;var _0x52f3b3=total;promises['push'](checkRow(_0x5a1bcc,_0x224a5c,_0x52f3b3)[_0x4b5b('0x2e')](function(){success+=0x1;})[_0x4b5b('0x31')](function(_0x1730ec){if(_0x1730ec['error']){errors+=0x1;delete _0x1730ec[_0x4b5b('0x15')];}else if(_0x1730ec[_0x4b5b('0x29')]){duplicates+=0x1;delete _0x1730ec['duplicate'];}rows[_0x4b5b('0x2f')](_0x1730ec);}));if(total%0xc8===0x0){_0x301cb0[_0x4b5b('0x6c')]();return processPromises(_0x301cb0);}},'complete':function(){return processPromises()[_0x4b5b('0x2e')](function(){logger[_0x4b5b('0x68')](_0x4b5b('0x6d'));endCsv();});},'error':function(_0x230bd7,_0x547519){logger[_0x4b5b('0x68')](_0x4b5b('0x6e'),JSON[_0x4b5b('0x33')](_0x230bd7));endCsv();}});})[_0x4b5b('0x31')](function(_0x45d812){logger[_0x4b5b('0x15')](_0x4b5b('0x6f'),JSON['stringify'](_0x45d812));});}main(); \ No newline at end of file +var _0x3e91=['errors','length','map','join','data','firstName','firstName\x20not\x20specified!','phone','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','cm_hopper','fromQuery','ContactId','updatedAt','select','field','toString','NOW()','createdAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','scheduledAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','into','str','cm_hopper_black','VoiceQueue','findAll','CmList','Lists','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','catch','all','outbound','BlackLists','Campaign','always','CampaignId','onlyIfOpen','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!'];(function(_0x6f50af,_0x1b274b){var _0x5d8f7c=function(_0x332267){while(--_0x332267){_0x6f50af['push'](_0x6f50af['shift']());}};_0x5d8f7c(++_0x1b274b);}(_0x3e91,0x18f));var _0x13e9=function(_0x314079,_0x2b98a0){_0x314079=_0x314079-0x0;var _0x423351=_0x3e91[_0x314079];return _0x423351;};'use strict';var BPromise=require('bluebird');var util=require(_0x13e9('0x0'));var _=require(_0x13e9('0x1'));var fs=require('fs');var squel=require(_0x13e9('0x2'));var Papa=require(_0x13e9('0x3'));var Redis=require(_0x13e9('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x13e9('0x5'));var logger=require(_0x13e9('0x6'))(_0x13e9('0x7'));config[_0x13e9('0x8')]=_[_0x13e9('0x9')](config[_0x13e9('0x8')],{'host':_0x13e9('0xa'),'port':0x18eb});var socket=require(_0x13e9('0xb'))(new Redis(config[_0x13e9('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x13e9('0xc')](socket);try{if(!process[_0x13e9('0xd')][0x2]||process[_0x13e9('0xd')][0x2]===_0x13e9('0xe')||process['argv'][0x2]===_0x13e9('0xf')){throw new Error(_0x13e9('0x10'));}var FILEPATH=process[_0x13e9('0xd')][0x2];if(!process['argv'][0x3]||process[_0x13e9('0xd')][0x3]===_0x13e9('0xe')||process['argv'][0x3]===_0x13e9('0xf')||!process[_0x13e9('0xd')][0x4]||process['argv'][0x4]==='undefined'||process[_0x13e9('0xd')][0x4]===_0x13e9('0xf')){throw new Error(_0x13e9('0x11'));}var FIELDS=_[_0x13e9('0x12')](process['argv'][0x3][_0x13e9('0x13')](','),process['argv'][0x4][_0x13e9('0x13')](','));if(!process[_0x13e9('0xd')][0x5]||process['argv'][0x5]===_0x13e9('0xe')||process[_0x13e9('0xd')][0x5]===_0x13e9('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x13e9('0xd')][0x6]&&process[_0x13e9('0xd')][0x6]!==_0x13e9('0xe')&&process[_0x13e9('0xd')][0x6]!==_0x13e9('0xf')?process[_0x13e9('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x13e9('0xd')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x13e9('0xf')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x13e9('0xd')][0x8]===_0x13e9('0xe')||process['argv'][0x8]===_0x13e9('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x13e9('0xd')][0x8];}catch(_0x1048c7){logger[_0x13e9('0x14')](_0x1048c7);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(_0x1ed14b,_0x56b71a,_0x465feb,_0x327642){var _0x479b5c={'message':_0x56b71a};_0x479b5c[_0x1ed14b]=!![];if(_0x465feb){_0x479b5c[_0x13e9('0x15')]=_0x465feb;}if(_0x327642){_0x479b5c[_0x13e9('0x16')]=_0x327642;}return _0x479b5c;}function isEmail(_0x1f77d7){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))*$/[_0x13e9('0x17')](_0x1f77d7);}function checkRow(_0x18c0d9,_0x3be6ca,_0x4b6609){return new BPromise(function(_0x2b4df2,_0x4a2db5){if(_['isNil'](_0x18c0d9)){return _0x4a2db5(handleCheckRowError(_0x13e9('0x14'),_0x13e9('0x18'),null,_0x4b6609));}if(_0x18c0d9[_0x13e9('0x19')]&&_0x18c0d9[_0x13e9('0x19')][_0x13e9('0x1a')]){var _0x40c207=_[_0x13e9('0x1b')](_0x18c0d9[_0x13e9('0x19')],'message')[_0x13e9('0x1c')](';');return _0x4a2db5(handleCheckRowError(_0x13e9('0x14'),_0x40c207,null,_0x4b6609));}var _0x144b56={};for(var _0x4bb74c in FIELDS){if(FIELDS['hasOwnProperty'](_0x4bb74c)&&FIELDS[_0x4bb74c]){_0x144b56[_0x4bb74c]=_0x18c0d9[_0x13e9('0x1d')][0x0][FIELDS[_0x4bb74c]]||_0x18c0d9['data'][0x0]['\ufeff'+FIELDS[_0x4bb74c]];}}if(!_0x144b56[_0x13e9('0x1e')]){return _0x4a2db5(handleCheckRowError(_0x13e9('0x14'),_0x13e9('0x1f'),null,_0x4b6609));}if(!_0x144b56[_0x13e9('0x20')]){return _0x4a2db5(handleCheckRowError(_0x13e9('0x14'),'phone\x20not\x20specified!',null,_0x4b6609));}if(_0x144b56['birthDate']){var _0x4cc483=moment(_0x144b56['birthDate'],'YYYY-MM-DD');if(!_0x4cc483[_0x13e9('0x21')]()){return _0x4a2db5(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4b6609));}}if(_0x144b56[_0x13e9('0x22')]){if(!isEmail(_0x144b56[_0x13e9('0x22')])){return _0x4a2db5(handleCheckRowError(_0x13e9('0x14'),_0x13e9('0x23'),null,_0x4b6609));}}_0x144b56[_0x13e9('0x24')]=LISTID;_0x144b56['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x13e9('0x1a')]&&_0x3be6ca){var _0x572aa5={};for(var _0x22d35e=0x0,_0x1e6d76=DUPLICATES['length'];_0x22d35e<_0x1e6d76;_0x22d35e+=0x1){_0x572aa5[DUPLICATES[_0x22d35e]]=_0x144b56[DUPLICATES[_0x22d35e]];}var _0x2158c2=_['find'](_0x3be6ca,_0x572aa5);if(_0x2158c2){return _0x4a2db5(handleCheckRowError(_0x13e9('0x25'),_0x13e9('0x26'),_0x2158c2,_0x4b6609));}}return db[_0x13e9('0x27')][_0x13e9('0x28')](_0x144b56,{'raw':!![],'hooks':![],'fields':_['keys'](_0x144b56)})[_0x13e9('0x29')](function(_0x48338e){if(DUPLICATES&&DUPLICATES[_0x13e9('0x1a')]&&_0x3be6ca){_0x3be6ca[_0x13e9('0x2a')](_[_0x13e9('0x2b')](_0x144b56,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x48338e['id'];return _0x2b4df2();})['catch'](function(_0x9ccea0){return _0x4a2db5(handleCheckRowError(_0x13e9('0x14'),_0x13e9('0x2c')+(_0x9ccea0[_0x13e9('0x2d')]||JSON[_0x13e9('0x2e')](_0x9ccea0)),null,_0x4b6609));});});}function checkHopper(){function _0x283d22(){return function(_0x571c65){logger[_0x13e9('0x14')](_0x13e9('0x2f'),_0x13e9('0x30'),util['inspect'](_0x571c65,{'showHidden':![],'depth':null}));};}var _0x1700bd=function(_0x3363b5,_0x4e1337){var _0x18f880=squel[_0x13e9('0x31')]()['into'](_0x13e9('0x32'))[_0x13e9('0x33')]([_0x13e9('0x20'),'scheduledAt',_0x13e9('0x34'),'ListId',_0x4e1337,'createdAt',_0x13e9('0x35')],squel[_0x13e9('0x36')]()['field'](_0x13e9('0x20'),_0x13e9('0x20'))[_0x13e9('0x37')]('NOW()','scheduledAt')[_0x13e9('0x37')]('id',_0x13e9('0x34'))['field'](LISTID[_0x13e9('0x38')](),_0x13e9('0x24'))[_0x13e9('0x37')](_0x3363b5['id']['toString'](),_0x4e1337)['field'](_0x13e9('0x39'),_0x13e9('0x3a'))[_0x13e9('0x37')](_0x13e9('0x39'),_0x13e9('0x35'))[_0x13e9('0x3b')](_0x13e9('0x3c'))[_0x13e9('0x3d')]('deletedAt\x20IS\x20NULL')[_0x13e9('0x3d')](_0x13e9('0x3e'),LISTID['toString']())['where'](_0x13e9('0x3f'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x13e9('0x36')]()[_0x13e9('0x37')](_0x13e9('0x20'))[_0x13e9('0x3b')]('cm_hopper')[_0x13e9('0x3d')](_0x4e1337+'\x20=\x20?',_0x3363b5['id']['toString']())))[_0x13e9('0x38')]();return _0x18f880;};var _0x3a222a=function(_0x225a21,_0x421bf2){var _0x3191d4=squel[_0x13e9('0x31')]()['into'](_0x13e9('0x32'))[_0x13e9('0x33')](['phone',_0x13e9('0x40'),_0x13e9('0x34'),'ListId',_0x421bf2,'createdAt','updatedAt'],squel[_0x13e9('0x36')]()[_0x13e9('0x37')]('phone',_0x13e9('0x20'))[_0x13e9('0x37')]('NOW()',_0x13e9('0x40'))[_0x13e9('0x37')]('id',_0x13e9('0x34'))[_0x13e9('0x37')](LISTID[_0x13e9('0x38')](),'ListId')['field'](_0x225a21['id']['toString'](),_0x421bf2)['field'](_0x13e9('0x39'),_0x13e9('0x3a'))['field'](_0x13e9('0x39'),'updatedAt')[_0x13e9('0x3b')](_0x13e9('0x3c'))[_0x13e9('0x3d')](_0x13e9('0x41'))[_0x13e9('0x3d')]('ListId\x20=\x20?',LISTID[_0x13e9('0x38')]())[_0x13e9('0x3d')](_0x13e9('0x42'),squel['str'](hopperContacts))['where'](_0x13e9('0x3f'))['where'](_0x13e9('0x43'),squel['select']()[_0x13e9('0x37')](_0x13e9('0x44'))[_0x13e9('0x3b')](_0x13e9('0x45'))[_0x13e9('0x3d')](_0x421bf2+_0x13e9('0x46'),_0x225a21['id'][_0x13e9('0x38')]()))['where'](_0x13e9('0x43'),squel[_0x13e9('0x36')]()[_0x13e9('0x37')](_0x13e9('0x20'))[_0x13e9('0x3b')]('cm_hopper')[_0x13e9('0x3d')](_0x421bf2+_0x13e9('0x46'),_0x225a21['id'][_0x13e9('0x38')]())))[_0x13e9('0x38')]();return _0x3191d4;};function _0x60502d(_0x1c1619,_0x178184){var _0x552f45=squel[_0x13e9('0x31')]()[_0x13e9('0x47')](_0x13e9('0x32'))[_0x13e9('0x33')]([_0x13e9('0x20'),_0x13e9('0x40'),_0x13e9('0x34'),'ListId',_0x178184,_0x13e9('0x3a'),_0x13e9('0x35')],squel[_0x13e9('0x36')]()['field']('phone','phone')[_0x13e9('0x37')]('NOW()',_0x13e9('0x40'))[_0x13e9('0x37')]('id',_0x13e9('0x34'))[_0x13e9('0x37')](LISTID[_0x13e9('0x38')](),_0x13e9('0x24'))['field'](_0x1c1619['id'][_0x13e9('0x38')](),_0x178184)[_0x13e9('0x37')](_0x13e9('0x39'),_0x13e9('0x3a'))['field'](_0x13e9('0x39'),_0x13e9('0x35'))[_0x13e9('0x3b')](_0x13e9('0x3c'))[_0x13e9('0x3d')]('deletedAt\x20IS\x20NULL')[_0x13e9('0x3d')](_0x13e9('0x3e'),LISTID[_0x13e9('0x38')]())[_0x13e9('0x3d')]('id\x20IN\x20?',squel[_0x13e9('0x48')](hopperContacts))['where'](_0x13e9('0x3f')))[_0x13e9('0x38')]();return _0x552f45;}function _0x4433c7(_0x57e6f4,_0x3121c2){var _0x519733=squel[_0x13e9('0x31')]()[_0x13e9('0x47')](_0x13e9('0x49'))[_0x13e9('0x33')]([_0x13e9('0x20'),_0x13e9('0x34'),_0x13e9('0x24'),_0x3121c2,'createdAt','updatedAt'],squel[_0x13e9('0x36')]()[_0x13e9('0x37')](_0x13e9('0x20'),_0x13e9('0x20'))[_0x13e9('0x37')]('id',_0x13e9('0x34'))[_0x13e9('0x37')](LISTID[_0x13e9('0x38')](),_0x13e9('0x24'))[_0x13e9('0x37')](_0x57e6f4['id'][_0x13e9('0x38')](),_0x3121c2)[_0x13e9('0x37')](_0x13e9('0x39'),_0x13e9('0x3a'))['field'](_0x13e9('0x39'),'updatedAt')[_0x13e9('0x3b')](_0x13e9('0x3c'))[_0x13e9('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0x13e9('0x3e'),LISTID[_0x13e9('0x38')]())[_0x13e9('0x3d')](_0x13e9('0x42'),squel['str'](hopperContacts))['where'](_0x13e9('0x3f')))[_0x13e9('0x38')]();return _0x519733;}return db[_0x13e9('0x4a')][_0x13e9('0x4b')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x13e9('0x4c')],'as':_0x13e9('0x4d'),'where':{'id':LISTID}}]})[_0x13e9('0x29')](function(_0x35603e){var _0x32065b=[];if(_0x35603e){var _0x107e9a;for(var _0x58fd15=0x0,_0x39b0d8;_0x58fd15<_0x35603e[_0x13e9('0x1a')];_0x58fd15+=0x1){_0x39b0d8=_0x35603e[_0x58fd15][_0x13e9('0x4e')]({'plain':!![]});switch(_0x39b0d8[_0x13e9('0x4f')]){case'always':_0x32065b[_0x13e9('0x2a')](db[_0x13e9('0x50')][_0x13e9('0x51')](_0x3a222a(_0x39b0d8,_0x13e9('0x52')))[_0x13e9('0x29')](function(){})[_0x13e9('0x53')](_0x283d22()));break;case'onlyIfOpen':_0x32065b[_0x13e9('0x2a')](db[_0x13e9('0x50')][_0x13e9('0x51')](_0x1700bd(_0x39b0d8,_0x13e9('0x52')))[_0x13e9('0x29')](function(){})[_0x13e9('0x53')](_0x283d22()));break;default:_0x32065b['push'](db[_0x13e9('0x50')][_0x13e9('0x51')](_0x60502d(_0x39b0d8,_0x13e9('0x52')))[_0x13e9('0x29')](function(){})['catch'](_0x283d22()));}}}return _0x32065b;})[_0x13e9('0x54')]()[_0x13e9('0x29')](function(){return db[_0x13e9('0x4a')]['findAll']({'where':{'type':_0x13e9('0x55')},'attributes':['id'],'include':[{'model':db[_0x13e9('0x4c')],'as':_0x13e9('0x56'),'where':{'id':LISTID}}]})['then'](function(_0xdaaf66){var _0x329443=[];if(_0xdaaf66){var _0x219038;for(var _0x28c5e9=0x0,_0x499a68;_0x28c5e9<_0xdaaf66[_0x13e9('0x1a')];_0x28c5e9+=0x1){_0x499a68=_0xdaaf66[_0x28c5e9][_0x13e9('0x4e')]({'plain':!![]});_0x329443[_0x13e9('0x2a')](db[_0x13e9('0x50')][_0x13e9('0x51')](_0x4433c7(_0x499a68,_0x13e9('0x52')))[_0x13e9('0x29')](function(){})[_0x13e9('0x53')](_0x283d22()));}}return _0x329443;})[_0x13e9('0x54')]();})[_0x13e9('0x29')](function(){return db[_0x13e9('0x57')][_0x13e9('0x4b')]({'attributes':['id',_0x13e9('0x4f')],'include':[{'model':db['CmList'],'as':_0x13e9('0x4d'),'where':{'id':LISTID}}]})[_0x13e9('0x29')](function(_0x55a24e){var _0x86df=[];if(_0x55a24e){for(var _0x2e4e04=0x0,_0x1595fc;_0x2e4e04<_0x55a24e[_0x13e9('0x1a')];_0x2e4e04+=0x1){_0x1595fc=_0x55a24e[_0x2e4e04][_0x13e9('0x4e')]({'plain':!![]});switch(_0x1595fc[_0x13e9('0x4f')]){case _0x13e9('0x58'):_0x86df[_0x13e9('0x2a')](db[_0x13e9('0x50')][_0x13e9('0x51')](_0x3a222a(_0x1595fc,_0x13e9('0x59')))[_0x13e9('0x29')](function(){})['catch'](_0x283d22()));break;case _0x13e9('0x5a'):_0x86df[_0x13e9('0x2a')](db[_0x13e9('0x50')][_0x13e9('0x51')](_0x1700bd(_0x1595fc,_0x13e9('0x59')))[_0x13e9('0x29')](function(){})[_0x13e9('0x53')](_0x283d22()));break;default:_0x86df[_0x13e9('0x2a')](db['sequelize']['query'](_0x60502d(_0x1595fc,_0x13e9('0x59')))[_0x13e9('0x29')](function(){})[_0x13e9('0x53')](_0x283d22()));}}}return _0x86df;})[_0x13e9('0x54')]();})[_0x13e9('0x29')](function(){return db[_0x13e9('0x57')][_0x13e9('0x4b')]({'attributes':['id'],'include':[{'model':db[_0x13e9('0x4c')],'as':_0x13e9('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x355121){var _0x510578=[];if(_0x355121){for(var _0x27ad48=0x0,_0x201497;_0x27ad48<_0x355121[_0x13e9('0x1a')];_0x27ad48+=0x1){_0x201497=_0x355121[_0x27ad48][_0x13e9('0x4e')]({'plain':!![]});_0x510578[_0x13e9('0x2a')](db['sequelize']['query'](_0x4433c7(_0x201497,_0x13e9('0x59')))[_0x13e9('0x29')](function(){})[_0x13e9('0x53')](_0x283d22()));}}return _0x510578;})[_0x13e9('0x54')]();})['catch'](function(_0x2a9245){logger[_0x13e9('0x14')]('cmContact,\x20%s,\x20%s',_0x13e9('0x5b'),_0x2a9245['message']);});}var processPromises=function(_0x106499){return BPromise[_0x13e9('0x54')](promises)[_0x13e9('0x29')](function(_0x246858){})['catch'](function(_0x386529){logger[_0x13e9('0x14')](_0x13e9('0x5c'),JSON[_0x13e9('0x2e')](_0x386529));})['finally'](function(){socket[_0x13e9('0x5d')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x106499){return _0x106499['resume']();}});};var endCsv=function(){return BPromise[_0x13e9('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x13e9('0x29')](function(){socket[_0x13e9('0x5d')](_0x13e9('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x13e9('0x60')](FILEPATH);}catch(_0xb7ff2d){logger['error'](_0x13e9('0x61'),JSON[_0x13e9('0x2e')](_0xb7ff2d));}finally{process[_0x13e9('0x62')](0x0);}});};process['on'](_0x13e9('0x63'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x13e9('0x5e')]()[_0x13e9('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x13e9('0x13')](',');return db['CmContact'][_0x13e9('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x13e9('0x29')](function(_0x2c8c1a){var _0x2e2dca=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x13e9('0x64')](_0x2e2dca,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1972ab,_0x8655fd){total+=0x1;var _0x15b62e=total;promises[_0x13e9('0x2a')](checkRow(_0x1972ab,_0x2c8c1a,_0x15b62e)[_0x13e9('0x29')](function(){success+=0x1;})[_0x13e9('0x53')](function(_0x68ff84){if(_0x68ff84['error']){errors+=0x1;delete _0x68ff84['error'];}else if(_0x68ff84[_0x13e9('0x25')]){duplicates+=0x1;delete _0x68ff84[_0x13e9('0x25')];}rows[_0x13e9('0x2a')](_0x68ff84);}));if(total%0xc8===0x0){_0x8655fd[_0x13e9('0x65')]();return processPromises(_0x8655fd);}},'complete':function(){return processPromises()['then'](function(){logger[_0x13e9('0x66')](_0x13e9('0x67'));endCsv();});},'error':function(_0x323324,_0x5e3fa0){logger['info'](_0x13e9('0x68'),JSON['stringify'](_0x323324));endCsv();}});})[_0x13e9('0x53')](function(_0x3fd7f7){logger[_0x13e9('0x14')](_0x13e9('0x69'),JSON[_0x13e9('0x2e')](_0x3fd7f7));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5979e48..6536fe5 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 _0xf0b0=['campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','exit','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','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','length','push','all','split','isNil','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','select','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','into','cm_hopper_black','updatedAt','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','recallme','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','errors','code','sequelize','query','spread','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','catch','timezones','dialTimezone','utcOffset','set','stringify','send','binding','clone','socket_timestamp','server/files/tmp','includes','header','ContactItemType','name','_description','writeFileSync','data','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','SystemRow','appendFileSync','emit','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId'];(function(_0x446f7d,_0x4d63a4){var _0x11fa79=function(_0x4cf383){while(--_0x4cf383){_0x446f7d['push'](_0x446f7d['shift']());}};_0x11fa79(++_0x4d63a4);}(_0xf0b0,0xc8));var _0x0f0b=function(_0x3f36ee,_0x66bc12){_0x3f36ee=_0x3f36ee-0x0;var _0x3238a4=_0xf0b0[_0x3f36ee];return _0x3238a4;};'use strict';var fs=require('fs');var path=require(_0x0f0b('0x0'));var _=require(_0x0f0b('0x1'));var Papa=require(_0x0f0b('0x2'));var util=require(_0x0f0b('0x3'));var BPromise=require(_0x0f0b('0x4'));var moment=require(_0x0f0b('0x5'));var squel=require(_0x0f0b('0x6'));var Redis=require(_0x0f0b('0x7'));var db=require(_0x0f0b('0x8'))['db'];var config=require('../../../config/environment');var shared=require(_0x0f0b('0x9'));var logger=require('../../../config/logger')(_0x0f0b('0xa'));config[_0x0f0b('0xb')]=_[_0x0f0b('0xc')](config[_0x0f0b('0xb')],{'host':_0x0f0b('0xd'),'port':0x18eb});var socket=require(_0x0f0b('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x0f0b('0xf')](_0x0f0b('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x0f0b('0xf')](_0x0f0b('0x10'));function isEmail(_0x5afd74){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))*$/[_0x0f0b('0x11')](_0x5afd74);}function selectNotIn(_0x24fe45,_0x57b118,_0x5ddb1e,_0x4b1c7d,_0x378664){return squel['select']()[_0x0f0b('0x12')](_0x0f0b('0x13'))['from'](_0x4b1c7d)[_0x0f0b('0x14')](_0x57b118,null,_0x57b118+_0x0f0b('0x15')+_0x4b1c7d+'.'+_0x5ddb1e)[_0x0f0b('0x16')](_0x4b1c7d+'.'+_0x5ddb1e+_0x0f0b('0x17')+_0x24fe45+'.'+_0x5ddb1e)[_0x0f0b('0x16')](_0x57b118+_0x0f0b('0x18')+_0x378664[_0x0f0b('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x8cfef5,_0x45e979){promisesAdditionalPhones=[];return db[_0x0f0b('0x19')][_0x0f0b('0x1a')]({'raw':!![],'attributes':['id',_0x0f0b('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x0f0b('0x1c')](function(_0x45fd81){if(_0x45fd81!==null){var _0x5715e5=[];for(var _0x145f49=0x0;_0x145f49<_0x45fd81[_0x0f0b('0x1d')];_0x145f49++){var _0x98d74=_0x45fd81[_0x145f49];_0x5715e5[_0x0f0b('0x1e')](insertAdditionalPhones(_0x98d74));}}Promise[_0x0f0b('0x1f')](_0x5715e5)[_0x0f0b('0x1c')](function(){_0x8cfef5({'val':0x1});});});});}function insertAdditionalPhones(_0x36be02){return new Promise(function(_0x13a875,_0x2b66ca){var _0x548079=_0x36be02[_0x0f0b('0x1b')];var _0x5a2a81=_0x548079[_0x0f0b('0x20')](';');var _0x110406=[];orderBy=0x0;for(var _0x144fab=0x0;_0x144fab<_0x5a2a81[_0x0f0b('0x1d')];_0x144fab++){_0x110406[_0x0f0b('0x1e')](splitAdditionalPhone(_0x36be02['id'],_0x5a2a81[_0x144fab]));}Promise['all'](_0x110406)['then'](function(){_0x13a875({'val':_0x5a2a81[_0x0f0b('0x1d')]});});});}function splitAdditionalPhone(_0x49a016,_0x4da9fc){return new Promise(function(_0x497c67,_0x1b0c11){var _0x44fd9d=_0x4da9fc[_0x0f0b('0x20')](':');var _0x3e4b9f=_0x44fd9d[0x0];var _0x562374=_0x44fd9d[0x1];if(!_[_0x0f0b('0x21')](_0x562374)){var _0x423ddf=_0x562374[_0x0f0b('0x20')]('|');var _0x2f4eb3=[];for(var _0x4f5c3e=0x0;_0x4f5c3e<_0x423ddf['length'];_0x4f5c3e++){if(_0x423ddf[_0x4f5c3e]!==''){var _0x4ff8b3=_[_0x0f0b('0x22')](promisesAdditionalPhones,{'contactId':_0x49a016,'phone':_0x423ddf[_0x4f5c3e]});if(_0x4ff8b3[_0x0f0b('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x0f0b('0x1e')]({'contactId':_0x49a016,'contactTypeId':_0x3e4b9f,'phone':_0x423ddf[_0x4f5c3e],'orderBy':orderBy});}}}_0x497c67({'ok':0x1});}else _0x497c67({'res':0x0});});}function createAdditionalPhone(_0x34aad7,_0x188d53,_0x5c6883,_0x5094f7){var _0x294c70='';var _0x1ad777='';var _0x20841e=_0x5c6883[_0x0f0b('0x20')]('§');_0x294c70=_0x20841e[0x0];if(_0x20841e['length']==0x2)_0x1ad777=_0x20841e[0x1];return new Promise(function(_0x1ba743,_0xccbfaa){return db[_0x0f0b('0x23')][_0x0f0b('0x24')]({'where':{'CmContactId':_0x34aad7,'item':_0x294c70}})[_0x0f0b('0x1c')](function(_0x3ccbb7){if(_0x3ccbb7){return db[_0x0f0b('0x23')][_0x0f0b('0x25')]({'ItemTypeId':_0x188d53,'description':_0x1ad777,'OrderBy':_0x5094f7},{'where':{'CmContactId':_0x34aad7,'item':_0x294c70}})[_0x0f0b('0x1c')](function(_0x250045){_0x1ba743({'res':'updated'});});}else{return db['CmContactHasItem'][_0x0f0b('0x26')]({'CmContactId':_0x34aad7,'item':_0x294c70,'description':_0x1ad777,'ItemTypeId':_0x188d53,'OrderBy':_0x5094f7,'ItemClass':_0x0f0b('0x27')})[_0x0f0b('0x1c')](function(_0x387d38){_0x1ba743({'res':_0x0f0b('0x28')});});}});});}function insertCmHopper(_0x5ecf56,_0x14e6e6,_0x5cfcbe,_0x2c591a,_0x3b3de9){var _0x1ced97=[_0x0f0b('0x29'),_0x0f0b('0x2a'),'cm_contacts.id',_0x0f0b('0x2b'),_0x14e6e6+'.'+_0x2c591a,_0x0f0b('0x2c'),_0x0f0b('0x2d'),_0x0f0b('0x2e'),'cm_contacts.UserId','\x22'+_0x3b3de9+'\x22'];return squel[_0x0f0b('0x2f')]()['into'](_0x0f0b('0x30'))[_0x0f0b('0x31')]([_0x0f0b('0x13'),_0x0f0b('0x32'),_0x0f0b('0x33'),'ListId',_0x2c591a,_0x0f0b('0x34'),'updatedAt',_0x0f0b('0x35'),_0x0f0b('0x36'),'recallme'],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x1ced97)[_0x0f0b('0x39')](_0x14e6e6)[_0x0f0b('0x14')](_0x0f0b('0x3a'),null,_0x0f0b('0x3b')+_0x14e6e6+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x5cfcbe,null,_0x5cfcbe+_0x0f0b('0x15')+_0x14e6e6+'.'+_0x2c591a)['where'](_0x14e6e6+_0x0f0b('0x3d'),_0x5ecf56)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW)[_0x0f0b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x14e6e6,_0x5cfcbe,_0x2c591a,_0x0f0b('0x30'),[_0x0f0b('0x3f'),_0x0f0b('0x40')]))['where'](_0x0f0b('0x41'),selectNotIn(_0x14e6e6,_0x5cfcbe,_0x2c591a,'cm_hopper',[_0x0f0b('0x3f')])))[_0x0f0b('0x42')]();}function insertCmHopperBlack(_0x5052a0,_0x3239cb,_0x16a3a2,_0x539cda){var _0x3c591a=[_0x0f0b('0x29'),'cm_contacts.id','cm_contacts.ListId',_0x3239cb+'.'+_0x539cda,_0x0f0b('0x2c'),_0x0f0b('0x2d')];return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x44'))[_0x0f0b('0x31')]([_0x0f0b('0x13'),_0x0f0b('0x33'),'ListId',_0x539cda,'createdAt',_0x0f0b('0x45')],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x3c591a)[_0x0f0b('0x39')](_0x3239cb)[_0x0f0b('0x14')]('cm_contacts',null,_0x0f0b('0x3b')+_0x3239cb+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x16a3a2,null,_0x16a3a2+_0x0f0b('0x15')+_0x3239cb+'.'+_0x539cda)[_0x0f0b('0x16')](_0x3239cb+'.CmListId\x20=\x20?',_0x5052a0)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW)[_0x0f0b('0x16')](_0x0f0b('0x41'),squel[_0x0f0b('0x37')]()[_0x0f0b('0x12')]('phone')[_0x0f0b('0x39')](_0x0f0b('0x44'))[_0x0f0b('0x16')]('ListId\x20=\x20?',_0x5052a0)[_0x0f0b('0x16')](_0x539cda+_0x0f0b('0x17')+_0x3239cb+'.'+_0x539cda)))['toString']();}function insertTzCmHopper(_0x451048,_0x3012e3,_0x5ae97b,_0x2b116f,_0x4910fe,_0x410cbc){var _0x246701=[_0x0f0b('0x29'),_0x0f0b('0x46')+_0x410cbc+_0x0f0b('0x47'),'cm_contacts.id',_0x0f0b('0x2b'),_0x3012e3+'.'+_0x2b116f,_0x0f0b('0x2c'),_0x0f0b('0x2d'),_0x0f0b('0x2e'),_0x0f0b('0x48'),'\x22'+_0x4910fe+'\x22'];var _0x4becf2=squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')]('cm_hopper')[_0x0f0b('0x31')](['phone',_0x0f0b('0x32'),_0x0f0b('0x33'),'ListId',_0x2b116f,_0x0f0b('0x34'),'updatedAt',_0x0f0b('0x35'),_0x0f0b('0x36'),_0x0f0b('0x49')],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x246701)['from'](_0x3012e3)[_0x0f0b('0x14')]('cm_contacts',null,_0x0f0b('0x3b')+_0x3012e3+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x5ae97b,null,_0x5ae97b+'.id\x20=\x20'+_0x3012e3+'.'+_0x2b116f)[_0x0f0b('0x14')](_0x410cbc,null,_0x410cbc+_0x0f0b('0x15')+_0x3012e3+'.'+_0x2b116f)['where'](_0x3012e3+_0x0f0b('0x3d'),_0x451048)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW)[_0x0f0b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3012e3,_0x5ae97b,_0x2b116f,'cm_hopper',[_0x0f0b('0x3f'),_0x0f0b('0x40')]))[_0x0f0b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3012e3,_0x5ae97b,_0x2b116f,_0x0f0b('0x30'),[_0x0f0b('0x3f')])))[_0x0f0b('0x42')]();return _0x4becf2;}function insertTzCmHopperBlack(_0x4d09d8,_0x4665ee,_0x27f0c9,_0x62a515){var _0x4cd108=[_0x0f0b('0x29'),'cm_contacts.id',_0x0f0b('0x2b'),_0x4665ee+'.'+_0x62a515,'cm_contacts.createdAt',_0x0f0b('0x2d')];return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x44'))['fromQuery']([_0x0f0b('0x13'),_0x0f0b('0x33'),'ListId',_0x62a515,'createdAt',_0x0f0b('0x45')],squel[_0x0f0b('0x37')]()['fields'](_0x4cd108)[_0x0f0b('0x39')](_0x4665ee)['join'](_0x0f0b('0x3a'),null,_0x0f0b('0x3b')+_0x4665ee+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x27f0c9,null,_0x27f0c9+_0x0f0b('0x15')+_0x4665ee+'.'+_0x62a515)[_0x0f0b('0x16')](_0x4665ee+_0x0f0b('0x3d'),_0x4d09d8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x0f0b('0x41'),squel[_0x0f0b('0x37')]()[_0x0f0b('0x12')](_0x0f0b('0x13'))[_0x0f0b('0x39')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x4d09d8)[_0x0f0b('0x16')](_0x62a515+_0x0f0b('0x17')+_0x4665ee+'.'+_0x62a515)))[_0x0f0b('0x42')]();}function insertCmHopperAdditionalPhones(_0x9fcbbc){var _0x4b5551=['cm_hopper.id',_0x0f0b('0x4a'),_0x0f0b('0x4b'),'cm_contact_has_items.createdAt',_0x0f0b('0x4c')];return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x4d'))[_0x0f0b('0x31')]([_0x0f0b('0x4e'),'phone',_0x0f0b('0x4f'),'createdAt','updatedAt'],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x4b5551)[_0x0f0b('0x39')](_0x0f0b('0x30'))['join']('cm_contacts',null,_0x0f0b('0x50'))[_0x0f0b('0x14')](_0x0f0b('0x51'),null,_0x0f0b('0x52'))['where'](_0x0f0b('0x53'),_0x9fcbbc)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW))[_0x0f0b('0x42')]();}function insertCmContact(_0x1493d3,_0x1bca6d,_0x51a8c3,_0x761049){var _0x437c5b=_['concat'](_[_0x0f0b('0x54')](_0x761049),[_0x0f0b('0x55'),_0x0f0b('0x56'),'createdAt',_0x0f0b('0x45')]);return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x3a'))[_0x0f0b('0x31')](_0x437c5b,squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x437c5b)[_0x0f0b('0x39')](_0x1bca6d)[_0x0f0b('0x16')]('('+_0x51a8c3[_0x0f0b('0x14')](',')+_0x0f0b('0x57'),squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x51a8c3)['from'](_0x0f0b('0x3a'))[_0x0f0b('0x16')](_0x0f0b('0x58'),_0x1493d3)['where'](_0x0f0b('0x59')))['where'](_0x0f0b('0x5a'),squel['select']()[_0x0f0b('0x12')](_0x0f0b('0x5b'),_0x0f0b('0x5c'))[_0x0f0b('0x39')](_0x1bca6d)[_0x0f0b('0x5d')](_0x51a8c3[_0x0f0b('0x14')](','))))[_0x0f0b('0x42')]();}function handleStop(){logger[_0x0f0b('0x5e')](_0x0f0b('0x5f'));stopped=!![];}function handleUncaughtException(_0x2dec79){logger[_0x0f0b('0x60')](_0x2dec79[_0x0f0b('0x61')]);process['exit'](0x1);}function handleError(_0x3e556b,_0x6b1900){stats[_0x0f0b('0x62')][_0x0f0b('0x1e')]({'name':_0x6b1900[_0x0f0b('0x63')],'message':_0x6b1900['message'],'row':_0x3e556b});}function handleQuery(_0x1ffb2f){logger[_0x0f0b('0x5e')](_0x1ffb2f);return db[_0x0f0b('0x64')][_0x0f0b('0x65')](_0x1ffb2f)[_0x0f0b('0x66')](function(_0x27f072){results[_0x0f0b('0x1e')](_0x27f072);})['catch'](function(_0x5ecd58){logger[_0x0f0b('0x60')](_0x5ecd58[_0x0f0b('0x61')]);});}function updateTzCampaigns(_0xbd794e){return new Promise(function(_0xd1fa3,_0x463e64){var _0x209669=squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](['campaigns.id',_0x0f0b('0x67')])['from'](_0x0f0b('0x68'))[_0x0f0b('0x14')](_0x0f0b('0x69'),null,_0x0f0b('0x6a'))['where']('campaigns_has_cm_lists.CmListId='+_0xbd794e);db['sequelize']['query'](_0x209669[_0x0f0b('0x42')]())[_0x0f0b('0x66')](function(_0x3928fe){var _0x59cc7d=[];for(var _0x374f2d=0x0;_0x374f2d<_0x3928fe[_0x0f0b('0x1d')];_0x374f2d++){_0x59cc7d[_0x0f0b('0x1e')](getTimezoneData(_0x3928fe[_0x374f2d],tmp_campaigns));}BPromise[_0x0f0b('0x1f')](_0x59cc7d)[_0x0f0b('0x1c')](function(){_0xd1fa3({'val':0x1});});})['catch'](function(_0x1a91a6){logger['error'](_0x1a91a6[_0x0f0b('0x61')]);_0xd1fa3({'val':0x0});});});}function updateTzVoiceQueues(_0x206776){return new Promise(function(_0x2740bf,_0x3f43a7){var _0x4b7308=squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')]([_0x0f0b('0x6b'),_0x0f0b('0x6c')])[_0x0f0b('0x39')](_0x0f0b('0x6d'))[_0x0f0b('0x14')]('voice_queues_has_cm_lists',null,_0x0f0b('0x6e'))['where']('voice_queues_has_cm_lists.CmListId='+_0x206776);db['sequelize'][_0x0f0b('0x65')](_0x4b7308[_0x0f0b('0x42')]())['spread'](function(_0x2fe9b7){var _0x17214a=[];for(var _0x2ef6e2=0x0;_0x2ef6e2<_0x2fe9b7[_0x0f0b('0x1d')];_0x2ef6e2++){_0x17214a[_0x0f0b('0x1e')](getTimezoneData(_0x2fe9b7[_0x2ef6e2],tmp_voice_queues));}BPromise['all'](_0x17214a)[_0x0f0b('0x1c')](function(){_0x2740bf({'val':0x1});});})[_0x0f0b('0x6f')](function(_0x3b1eae){logger[_0x0f0b('0x60')](_0x3b1eae[_0x0f0b('0x61')]);_0x2740bf({'val':0x0});});});}function getTimezoneData(_0x26eb9b,_0xe26176){return new Promise(function(_0x2d9edd,_0x1fa2fc){var _0x4cc0d8=shared[_0x0f0b('0x70')];var _0x347565=_0x4cc0d8[_0x26eb9b[_0x0f0b('0x71')]];if(_[_0x0f0b('0x21')](_0x347565)){_0x2d9edd({'ret':0x1});}else{var _0x50d9e7=_0x347565[_0x0f0b('0x72')];var _0x2b3415=squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0xe26176)[_0x0f0b('0x73')]('id',_0x26eb9b['id'])[_0x0f0b('0x73')]('offset',_0x50d9e7)[_0x0f0b('0x73')]('dialTimezone',_0x26eb9b[_0x0f0b('0x71')])['toString']();return db[_0x0f0b('0x64')]['query'](_0x2b3415)['spread'](function(_0x41b82a){_0x2d9edd({'ret':0x1});})[_0x0f0b('0x6f')](function(_0x4814ab){logger[_0x0f0b('0x60')](_0x4814ab[_0x0f0b('0x61')]);_0x1fa2fc({'ret':0x1});});}});}function handleTZQuery(_0x4cc81b){logger['info'](_0x4cc81b);return db[_0x0f0b('0x64')][_0x0f0b('0x65')](_0x4cc81b)['spread'](function(_0x147890){})['catch'](function(_0x45d4e9){logger[_0x0f0b('0x60')](_0x45d4e9[_0x0f0b('0x61')]);});}function main(_0x3cae3d,_0x1dabd7,_0x211d73,_0x55e549){logger[_0x0f0b('0x5e')]('main',_0x3cae3d,JSON[_0x0f0b('0x74')](_0x1dabd7));process[_0x0f0b('0x75')]('start');var _0x1c077b=_0x1dabd7[_0x0f0b('0x76')];var _0x20617a=_[_0x0f0b('0x77')](_0x1c077b);var _0x478ef0=_0x1dabd7[_0x0f0b('0x78')];var _0x26e79c=path[_0x0f0b('0x14')](config['root'],_0x0f0b('0x79'),_0x478ef0+'.csv');hasTZ=_['keys'](_0x1c077b)[_0x0f0b('0x7a')]('dialTimezone');var _0xdf4592=_[_0x0f0b('0x54')](_0x1c077b)['join']();logger[_0x0f0b('0x5e')](_0x0f0b('0x7b'),_0xdf4592);db[_0x0f0b('0x7c')][_0x0f0b('0x1a')]({'raw':!![],'attributes':['id',_0x0f0b('0x7d')]})[_0x0f0b('0x1c')](function(_0x8031e4){for(var _0x50e7c3=0x0;_0x50e7c3<_0x8031e4[_0x0f0b('0x1d')];_0x50e7c3++){if(_0x8031e4[_0x50e7c3][_0x0f0b('0x7d')]in _0x1c077b){contactItemTypes['push'](_0x8031e4[_0x50e7c3]);delete _0x20617a[_0x8031e4[_0x50e7c3][_0x0f0b('0x7d')]];hasAdditionalPhones=!![];}for(var _0x28f2be in _0x1c077b){if(_0x8031e4[_0x50e7c3][_0x0f0b('0x7d')]+_0x0f0b('0x7e')===_0x28f2be){phoneDescriptions[_0x0f0b('0x1e')]({'itemTypeId':_0x8031e4[_0x50e7c3]['id'],'description':_0x28f2be});delete _0x20617a[_0x28f2be];}}}if(hasAdditionalPhones)_0x20617a[_0x0f0b('0x1b')]='';var _0x5dc27f=_[_0x0f0b('0x54')](_0x20617a)[_0x0f0b('0x14')]();logger[_0x0f0b('0x5e')](_0x0f0b('0x7b'),_0x5dc27f);fs[_0x0f0b('0x7f')](_0x26e79c,_0x5dc27f+'\x0a');Papa['parse'](fs['createReadStream'](_0x3cae3d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x49abac,_0x156561){try{for(var _0x67e0d5=0x0,_0x280ad8=[];_0x67e0d5<_0x49abac[_0x0f0b('0x80')][_0x0f0b('0x1d')];_0x67e0d5++){stats['rows']+=0x1;if(_0x49abac[_0x0f0b('0x62')][_0x67e0d5]){handleError(_0x49abac[_0x0f0b('0x80')][_0x67e0d5],_0x49abac[_0x0f0b('0x62')][_0x67e0d5]);}else{var _0x3b85c2=[];var _0x4f734f=[];var _0x5738c2={};for(var _0x258796 in _0x1c077b){let _0x274b94=contactItemTypes[_0x0f0b('0x81')](_0x2974ea=>_0x2974ea[_0x0f0b('0x7d')]===_0x258796);let _0x24c067=contactItemTypes[_0x0f0b('0x81')](_0x54a41a=>_0x54a41a[_0x0f0b('0x7d')]+_0x0f0b('0x7e')===_0x258796);if(_[_0x0f0b('0x21')](_0x274b94)&&_[_0x0f0b('0x21')](_0x24c067)){if(_0x1c077b[_0x0f0b('0x82')](_0x258796)){if(_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]]){var _0x11f07e=_[_0x0f0b('0x83')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]][_0x0f0b('0x84')](/"/g,'\x27'));switch(_0x258796){case'scheduledat':var _0x349df6=moment(_0x11f07e,_0x0f0b('0x10'),!![]);if(_0x349df6[_0x0f0b('0x85')]()){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}else{_0x3b85c2['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x5465e4=parseInt(_0x11f07e);_0x11f07e=_[_0x0f0b('0x86')](_0x5465e4)||_0x5465e4<0x0||_0x5465e4>0x4?_0x55e549?0x3:0x2:_0x5465e4;_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');break;case _0x0f0b('0x36'):var _0xc18f2e=parseInt(_0x11f07e);if(_[_0x0f0b('0x87')](_0xc18f2e)&&_['includes'](_0x211d73,_0xc18f2e)){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0xc18f2e+'\x22');}else{_0x3b85c2['push'](_0x0f0b('0x88'));}break;case _0x0f0b('0x89'):if(isEmail(_0x11f07e)){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}else{_0x3b85c2[_0x0f0b('0x1e')]('email\x20wrong\x20format');}break;case _0x0f0b('0x8a'):var _0x564828=moment(_0x11f07e,_0x0f0b('0x8b'),!![]);if(_0x564828['isValid']()){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}else{_0x3b85c2[_0x0f0b('0x1e')](_0x0f0b('0x8c'));}break;case _0x0f0b('0x71'):var _0x139abf=shared[_0x0f0b('0x70')];var _0x4ff917=_0x139abf[_0x11f07e];if(!_[_0x0f0b('0x21')](_0x4ff917)){var _0x189387=_0x4ff917['utcOffset'];_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');_0x280ad8['push']('\x22'+_0x189387+'\x22');}break;default:_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}}else{switch(_0x258796){case _0x0f0b('0x8d'):case _0x0f0b('0x13'):_0x3b85c2['push'](_0x258796+_0x0f0b('0x8e'));break;default:_0x280ad8[_0x0f0b('0x1e')]('\x22\x22');}}}}else{var _0x2d30a8='';if(!_[_0x0f0b('0x21')](_0x274b94)){if(!_0x5738c2[_0x0f0b('0x82')](_0x274b94['id'])){if(!_[_0x0f0b('0x21')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]])){var _0x11f07e=_[_0x0f0b('0x83')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]][_0x0f0b('0x84')](/"/g,'\x27'));var _0x53c7d6=phoneDescriptions[_0x0f0b('0x81')](_0x59b0c3=>_0x59b0c3[_0x0f0b('0x8f')]===_0x274b94['id']);if(!_['isNil'](_0x53c7d6)){var _0x23a4c9=_[_0x0f0b('0x83')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x53c7d6['description']]][_0x0f0b('0x84')](/"/g,'\x27'));if(!_[_0x0f0b('0x21')](_0x23a4c9))_0x11f07e=_0x11f07e+'§'+_0x23a4c9;}if(_0x2d30a8=='')_0x2d30a8=_0x11f07e;else _0x2d30a8+='|'+_0x11f07e;}_0x4f734f[_0x0f0b('0x1e')](_0x274b94['id']+':'+_0x2d30a8);_0x5738c2[_0x274b94['id']]=0x1;}}}}if(hasAdditionalPhones){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x4f734f['join'](';')+'\x22');}if(_0x3b85c2['length']){handleError(_0x49abac[_0x0f0b('0x80')][_0x67e0d5],{'code':_0x0f0b('0x90'),'message':_0x3b85c2['join']()});}else{fs[_0x0f0b('0x91')](_0x26e79c,_0x280ad8[_0x0f0b('0x14')]()+'\x0a');}_0x280ad8=[];}if(!(stats['rows']%0xc8)){socket[_0x0f0b('0x92')]('contact:import:'+_0x478ef0,stats);stats[_0x0f0b('0x62')]=[];}}if(stopped){logger[_0x0f0b('0x5e')](_0x0f0b('0x93'));_0x156561['abort']();}}catch(_0x4c8f96){handleError(_0x49abac[_0x0f0b('0x80')][_0x67e0d5],{'code':_0x0f0b('0x94'),'message':_0x4c8f96['message']});logger['error'](_0x0f0b('0x95'),_0x4c8f96['message']);}},'complete':function(){try{var _0x3efb01=[];var _0x51f690=[];var _0xe8ed56='cm_contacts';if(_0x1dabd7[_0x0f0b('0x96')]&&_0x1dabd7[_0x0f0b('0x96')][_0x0f0b('0x1d')]){_0xe8ed56=_0x0f0b('0x97')+_0x478ef0;_0x3efb01['push'](_0x0f0b('0x98')+_0xe8ed56+_0x0f0b('0x99'));}tmp_campaigns='campaigns_'+_0x478ef0;tmp_voice_queues='voice_queues_'+_0x478ef0;_0x51f690['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x0f0b('0x9a'));_0x51f690[_0x0f0b('0x1e')](_0x0f0b('0x98')+tmp_voice_queues+_0x0f0b('0x9a'));BPromise[_0x0f0b('0x9b')](_0x51f690,handleTZQuery)[_0x0f0b('0x1c')](function(_0x5088ff){updateTzCampaigns(_0x1dabd7[_0x0f0b('0x55')])[_0x0f0b('0x1c')](function(_0x4c6a98){updateTzVoiceQueues(_0x1dabd7[_0x0f0b('0x55')])[_0x0f0b('0x1c')](function(_0x5ba8e7){if(hasTZ)_0x5dc27f=_0x5dc27f[_0x0f0b('0x84')](_0x0f0b('0x71'),_0x0f0b('0x9c'));var _0x1db19f=util['format']('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',_0x26e79c,_0xe8ed56,_0x5dc27f,_0x1dabd7[_0x0f0b('0x55')],_0x1dabd7[_0x0f0b('0x56')]||null,NOW,NOW);if(_[_0x0f0b('0x21')](_0x1c077b[_0x0f0b('0x32')])){_0x1db19f+=_0x0f0b('0x9d');}_0x3efb01[_0x0f0b('0x1e')](_0x1db19f);if(_0x1dabd7[_0x0f0b('0x96')]&&_0x1dabd7['duplicates'][_0x0f0b('0x1d')]){_0x3efb01['push'](insertCmContact(_0x1dabd7[_0x0f0b('0x55')],_0xe8ed56,_0x1dabd7['duplicates'],_0x1c077b));_0x3efb01['push'](_0x0f0b('0x9e')+_0xe8ed56+';');}BPromise[_0x0f0b('0x9b')](_0x3efb01,handleQuery)[_0x0f0b('0x1c')](function(_0x1e55c2){BPromise[_0x0f0b('0x1f')]([handleAdditionalPhones()])[_0x0f0b('0x1c')](function(){_0x3efb01=[];for(var _0x2a05ee=0x0;_0x2a05ee\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','then','length','all','AdditionalPhones','split','isNil','filter','push','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x8dd4,0x142));var _0x48dd=function(_0x9c0d3e,_0x5bad2d){_0x9c0d3e=_0x9c0d3e-0x0;var _0x124534=_0x8dd4[_0x9c0d3e];return _0x124534;};'use strict';var fs=require('fs');var path=require(_0x48dd('0x0'));var _=require(_0x48dd('0x1'));var Papa=require(_0x48dd('0x2'));var util=require(_0x48dd('0x3'));var BPromise=require(_0x48dd('0x4'));var moment=require(_0x48dd('0x5'));var squel=require(_0x48dd('0x6'));var Redis=require(_0x48dd('0x7'));var db=require(_0x48dd('0x8'))['db'];var config=require(_0x48dd('0x9'));var shared=require(_0x48dd('0xa'));var logger=require(_0x48dd('0xb'))(_0x48dd('0xc'));config[_0x48dd('0xd')]=_[_0x48dd('0xe')](config[_0x48dd('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x48dd('0xf'))(new Redis(config[_0x48dd('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x48dd('0x10')](_0x48dd('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x48dd('0x10')](_0x48dd('0x11'));function isEmail(_0x58f56f){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))*$/[_0x48dd('0x12')](_0x58f56f);}function selectNotIn(_0x2ba9e7,_0x8aae8e,_0x4c4c39,_0x39e9ee,_0x19ae24){return squel[_0x48dd('0x13')]()[_0x48dd('0x14')](_0x48dd('0x15'))[_0x48dd('0x16')](_0x39e9ee)['join'](_0x8aae8e,null,_0x8aae8e+_0x48dd('0x17')+_0x39e9ee+'.'+_0x4c4c39)[_0x48dd('0x18')](_0x39e9ee+'.'+_0x4c4c39+_0x48dd('0x19')+_0x2ba9e7+'.'+_0x4c4c39)[_0x48dd('0x18')](_0x8aae8e+_0x48dd('0x1a')+_0x19ae24[_0x48dd('0x1b')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4459eb,_0x59edf9){promisesAdditionalPhones=[];return db[_0x48dd('0x1c')][_0x48dd('0x1d')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x48dd('0x1e')](function(_0x51f18f){if(_0x51f18f!==null){var _0x1f38eb=[];for(var _0x24addf=0x0;_0x24addf<_0x51f18f[_0x48dd('0x1f')];_0x24addf++){var _0x237304=_0x51f18f[_0x24addf];_0x1f38eb['push'](insertAdditionalPhones(_0x237304));}}Promise[_0x48dd('0x20')](_0x1f38eb)[_0x48dd('0x1e')](function(){_0x4459eb({'val':0x1});});});});}function insertAdditionalPhones(_0xbf9a87){return new Promise(function(_0x1d8a25,_0x4b9873){var _0x3237af=_0xbf9a87[_0x48dd('0x21')];var _0x271be5=_0x3237af[_0x48dd('0x22')](';');var _0x215de8=[];orderBy=0x0;for(var _0x4f194a=0x0;_0x4f194a<_0x271be5[_0x48dd('0x1f')];_0x4f194a++){_0x215de8['push'](splitAdditionalPhone(_0xbf9a87['id'],_0x271be5[_0x4f194a]));}Promise[_0x48dd('0x20')](_0x215de8)[_0x48dd('0x1e')](function(){_0x1d8a25({'val':_0x271be5[_0x48dd('0x1f')]});});});}function splitAdditionalPhone(_0x109194,_0x1f5ac2){return new Promise(function(_0xa9df11,_0x2464a9){var _0x13d66c=_0x1f5ac2['split'](':');var _0x52d217=_0x13d66c[0x0];var _0x4707af=_0x13d66c[0x1];if(!_[_0x48dd('0x23')](_0x4707af)){var _0x82a065=_0x4707af['split']('|');var _0xf0244b=[];for(var _0x11c17c=0x0;_0x11c17c<_0x82a065[_0x48dd('0x1f')];_0x11c17c++){if(_0x82a065[_0x11c17c]!==''){var _0x2e5301=_[_0x48dd('0x24')](promisesAdditionalPhones,{'contactId':_0x109194,'phone':_0x82a065[_0x11c17c]});if(_0x2e5301[_0x48dd('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0x48dd('0x25')]({'contactId':_0x109194,'contactTypeId':_0x52d217,'phone':_0x82a065[_0x11c17c],'orderBy':orderBy});}}}_0xa9df11({'ok':0x1});}else _0xa9df11({'res':0x0});});}function createAdditionalPhone(_0x171a89,_0x19e20d,_0x422a53,_0x41bfc4){var _0x2e26d1='';var _0x4c3a7a='';var _0x1ddaf3=_0x422a53[_0x48dd('0x22')]('§');_0x2e26d1=_0x1ddaf3[0x0];if(_0x1ddaf3[_0x48dd('0x1f')]==0x2)_0x4c3a7a=_0x1ddaf3[0x1];return new Promise(function(_0x3a92b1,_0x4d3146){return db[_0x48dd('0x26')][_0x48dd('0x27')]({'where':{'CmContactId':_0x171a89,'item':_0x2e26d1}})[_0x48dd('0x1e')](function(_0x530e46){if(_0x530e46){return db[_0x48dd('0x26')][_0x48dd('0x28')]({'ItemTypeId':_0x19e20d,'description':_0x4c3a7a,'OrderBy':_0x41bfc4},{'where':{'CmContactId':_0x171a89,'item':_0x2e26d1}})[_0x48dd('0x1e')](function(_0x33d401){_0x3a92b1({'res':_0x48dd('0x29')});});}else{return db[_0x48dd('0x26')][_0x48dd('0x2a')]({'CmContactId':_0x171a89,'item':_0x2e26d1,'description':_0x4c3a7a,'ItemTypeId':_0x19e20d,'OrderBy':_0x41bfc4,'ItemClass':_0x48dd('0x2b')})[_0x48dd('0x1e')](function(_0x560b02){_0x3a92b1({'res':_0x48dd('0x2c')});});}});});}function insertCmHopper(_0x186fbd,_0x492ce8,_0x1b15b8,_0x5ee476,_0x1fc710){var _0x5238e0=[_0x48dd('0x2d'),'cm_contacts.scheduledat',_0x48dd('0x2e'),'cm_contacts.ListId',_0x492ce8+'.'+_0x5ee476,_0x48dd('0x2f'),_0x48dd('0x30'),'cm_contacts.priority',_0x48dd('0x31'),'\x22'+_0x1fc710+'\x22'];return squel['insert']()['into'](_0x48dd('0x32'))[_0x48dd('0x33')]([_0x48dd('0x15'),_0x48dd('0x34'),_0x48dd('0x35'),_0x48dd('0x36'),_0x5ee476,_0x48dd('0x37'),_0x48dd('0x38'),'priority',_0x48dd('0x39'),_0x48dd('0x3a')],squel[_0x48dd('0x13')]()['fields'](_0x5238e0)[_0x48dd('0x16')](_0x492ce8)[_0x48dd('0x1b')](_0x48dd('0x3b'),null,_0x48dd('0x3c')+_0x492ce8+'.CmListId')[_0x48dd('0x1b')](_0x1b15b8,null,_0x1b15b8+'.id\x20=\x20'+_0x492ce8+'.'+_0x5ee476)[_0x48dd('0x18')](_0x492ce8+_0x48dd('0x3d'),_0x186fbd)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x48dd('0x18')](_0x48dd('0x3e'),selectNotIn(_0x492ce8,_0x1b15b8,_0x5ee476,_0x48dd('0x32'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x48dd('0x18')](_0x48dd('0x3e'),selectNotIn(_0x492ce8,_0x1b15b8,_0x5ee476,'cm_hopper',['\x22always\x22'])))[_0x48dd('0x3f')]();}function insertCmHopperBlack(_0x2c81bd,_0xbed94,_0x39d455,_0x22b427){var _0x168fde=['cm_contacts.phone',_0x48dd('0x2e'),_0x48dd('0x40'),_0xbed94+'.'+_0x22b427,_0x48dd('0x2f'),_0x48dd('0x30')];return squel[_0x48dd('0x41')]()['into'](_0x48dd('0x42'))[_0x48dd('0x33')]([_0x48dd('0x15'),_0x48dd('0x35'),_0x48dd('0x36'),_0x22b427,_0x48dd('0x37'),_0x48dd('0x38')],squel['select']()[_0x48dd('0x43')](_0x168fde)[_0x48dd('0x16')](_0xbed94)['join'](_0x48dd('0x3b'),null,_0x48dd('0x3c')+_0xbed94+'.CmListId')[_0x48dd('0x1b')](_0x39d455,null,_0x39d455+_0x48dd('0x17')+_0xbed94+'.'+_0x22b427)[_0x48dd('0x18')](_0xbed94+'.CmListId\x20=\x20?',_0x2c81bd)['where'](_0x48dd('0x44'),NOW)[_0x48dd('0x18')](_0x48dd('0x3e'),squel[_0x48dd('0x13')]()[_0x48dd('0x14')](_0x48dd('0x15'))['from'](_0x48dd('0x42'))[_0x48dd('0x18')]('ListId\x20=\x20?',_0x2c81bd)[_0x48dd('0x18')](_0x22b427+_0x48dd('0x19')+_0xbed94+'.'+_0x22b427)))['toString']();}function insertTzCmHopper(_0x58eb64,_0xcf14cb,_0x4f1be9,_0x48e19a,_0x2fd658,_0x24922d){var _0x49aac4=[_0x48dd('0x2d'),_0x48dd('0x45')+_0x24922d+_0x48dd('0x46'),_0x48dd('0x2e'),_0x48dd('0x40'),_0xcf14cb+'.'+_0x48e19a,_0x48dd('0x2f'),'cm_contacts.updatedAt',_0x48dd('0x47'),_0x48dd('0x31'),'\x22'+_0x2fd658+'\x22'];var _0x43b6be=squel[_0x48dd('0x41')]()[_0x48dd('0x48')](_0x48dd('0x32'))[_0x48dd('0x33')]([_0x48dd('0x15'),_0x48dd('0x34'),_0x48dd('0x35'),_0x48dd('0x36'),_0x48e19a,_0x48dd('0x37'),_0x48dd('0x38'),_0x48dd('0x49'),_0x48dd('0x39'),_0x48dd('0x3a')],squel[_0x48dd('0x13')]()['fields'](_0x49aac4)['from'](_0xcf14cb)[_0x48dd('0x1b')](_0x48dd('0x3b'),null,_0x48dd('0x3c')+_0xcf14cb+_0x48dd('0x4a'))['join'](_0x4f1be9,null,_0x4f1be9+_0x48dd('0x17')+_0xcf14cb+'.'+_0x48e19a)[_0x48dd('0x1b')](_0x24922d,null,_0x24922d+'.id\x20=\x20'+_0xcf14cb+'.'+_0x48e19a)[_0x48dd('0x18')](_0xcf14cb+_0x48dd('0x3d'),_0x58eb64)['where'](_0x48dd('0x44'),NOW)[_0x48dd('0x18')](_0x48dd('0x3e'),selectNotIn(_0xcf14cb,_0x4f1be9,_0x48e19a,_0x48dd('0x32'),[_0x48dd('0x4b'),_0x48dd('0x4c')]))[_0x48dd('0x18')](_0x48dd('0x3e'),selectNotIn(_0xcf14cb,_0x4f1be9,_0x48e19a,_0x48dd('0x32'),[_0x48dd('0x4b')])))[_0x48dd('0x3f')]();return _0x43b6be;}function insertTzCmHopperBlack(_0x6d824d,_0x17150d,_0x2190d0,_0x37ab8b){var _0x1edb1c=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x17150d+'.'+_0x37ab8b,_0x48dd('0x2f'),_0x48dd('0x30')];return squel['insert']()[_0x48dd('0x48')]('cm_hopper_black')[_0x48dd('0x33')]([_0x48dd('0x15'),_0x48dd('0x35'),'ListId',_0x37ab8b,_0x48dd('0x37'),_0x48dd('0x38')],squel['select']()[_0x48dd('0x43')](_0x1edb1c)['from'](_0x17150d)[_0x48dd('0x1b')](_0x48dd('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0x17150d+_0x48dd('0x4a'))[_0x48dd('0x1b')](_0x2190d0,null,_0x2190d0+_0x48dd('0x17')+_0x17150d+'.'+_0x37ab8b)[_0x48dd('0x18')](_0x17150d+'.CmListId\x20=\x20?',_0x6d824d)[_0x48dd('0x18')](_0x48dd('0x44'),NOW)['where'](_0x48dd('0x3e'),squel['select']()['field'](_0x48dd('0x15'))[_0x48dd('0x16')](_0x48dd('0x42'))[_0x48dd('0x18')](_0x48dd('0x4d'),_0x6d824d)[_0x48dd('0x18')](_0x37ab8b+_0x48dd('0x19')+_0x17150d+'.'+_0x37ab8b)))['toString']();}function insertCmHopperAdditionalPhones(_0x2d8a4f){var _0x34245c=[_0x48dd('0x4e'),'cm_contact_has_items.item',_0x48dd('0x4f'),'cm_contact_has_items.createdAt',_0x48dd('0x50')];return squel[_0x48dd('0x41')]()['into'](_0x48dd('0x51'))['fromQuery']([_0x48dd('0x52'),'phone','OrderBy',_0x48dd('0x37'),_0x48dd('0x38')],squel['select']()['fields'](_0x34245c)[_0x48dd('0x16')](_0x48dd('0x32'))[_0x48dd('0x1b')](_0x48dd('0x3b'),null,_0x48dd('0x53'))[_0x48dd('0x1b')](_0x48dd('0x54'),null,_0x48dd('0x55'))[_0x48dd('0x18')](_0x48dd('0x56'),_0x2d8a4f)[_0x48dd('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x48dd('0x3f')]();}function insertCmContact(_0x5e5796,_0x1e02ff,_0x115fdb,_0x5169a8){var _0x15fbe3=_['concat'](_[_0x48dd('0x57')](_0x5169a8),[_0x48dd('0x36'),_0x48dd('0x58'),_0x48dd('0x37'),_0x48dd('0x38')]);return squel[_0x48dd('0x41')]()['into'](_0x48dd('0x3b'))[_0x48dd('0x33')](_0x15fbe3,squel[_0x48dd('0x13')]()['fields'](_0x15fbe3)[_0x48dd('0x16')](_0x1e02ff)['where']('('+_0x115fdb[_0x48dd('0x1b')](',')+_0x48dd('0x59'),squel[_0x48dd('0x13')]()[_0x48dd('0x43')](_0x115fdb)['from']('cm_contacts')[_0x48dd('0x18')]('ListId\x20=\x20?',_0x5e5796)[_0x48dd('0x18')](_0x48dd('0x5a')))[_0x48dd('0x18')](_0x48dd('0x5b'),squel[_0x48dd('0x13')]()['field'](_0x48dd('0x5c'),'min_id')[_0x48dd('0x16')](_0x1e02ff)['group'](_0x115fdb[_0x48dd('0x1b')](','))))['toString']();}function handleStop(){logger['info'](_0x48dd('0x5d'));stopped=!![];}function handleUncaughtException(_0x45914f){logger[_0x48dd('0x5e')](_0x45914f[_0x48dd('0x5f')]);process[_0x48dd('0x60')](0x1);}function handleError(_0x5eb194,_0x4ef5f8){stats['errors'][_0x48dd('0x25')]({'name':_0x4ef5f8[_0x48dd('0x61')],'message':_0x4ef5f8[_0x48dd('0x5f')],'row':_0x5eb194});}function handleQuery(_0x236807){logger[_0x48dd('0x62')](_0x236807);return db[_0x48dd('0x63')][_0x48dd('0x64')](_0x236807)['spread'](function(_0x5dd89c){results['push'](_0x5dd89c);})[_0x48dd('0x65')](function(_0x2bbed3){logger['error'](_0x2bbed3[_0x48dd('0x5f')]);});}function updateTzCampaigns(_0x1e21fe){return new Promise(function(_0x5623cd,_0x30b885){var _0x3e4e2a=squel['select']()[_0x48dd('0x43')](['campaigns.id',_0x48dd('0x66')])['from'](_0x48dd('0x67'))['join'](_0x48dd('0x68'),null,_0x48dd('0x69'))[_0x48dd('0x18')](_0x48dd('0x6a')+_0x1e21fe);db['sequelize'][_0x48dd('0x64')](_0x3e4e2a[_0x48dd('0x3f')]())[_0x48dd('0x6b')](function(_0x44598b){var _0x3753b5=[];for(var _0x2efff6=0x0;_0x2efff6<_0x44598b[_0x48dd('0x1f')];_0x2efff6++){_0x3753b5[_0x48dd('0x25')](getTimezoneData(_0x44598b[_0x2efff6],tmp_campaigns));}BPromise[_0x48dd('0x20')](_0x3753b5)[_0x48dd('0x1e')](function(){_0x5623cd({'val':0x1});});})[_0x48dd('0x65')](function(_0x5ed452){logger['error'](_0x5ed452[_0x48dd('0x5f')]);_0x5623cd({'val':0x0});});});}function updateTzVoiceQueues(_0x5cdfa1){return new Promise(function(_0x418883,_0x254964){var _0x4bd0df=squel[_0x48dd('0x13')]()[_0x48dd('0x43')]([_0x48dd('0x6c'),_0x48dd('0x6d')])[_0x48dd('0x16')](_0x48dd('0x6e'))[_0x48dd('0x1b')]('voice_queues_has_cm_lists',null,_0x48dd('0x6f'))[_0x48dd('0x18')](_0x48dd('0x70')+_0x5cdfa1);db[_0x48dd('0x63')][_0x48dd('0x64')](_0x4bd0df[_0x48dd('0x3f')]())[_0x48dd('0x6b')](function(_0x3afc10){var _0x110d56=[];for(var _0x281a67=0x0;_0x281a67<_0x3afc10[_0x48dd('0x1f')];_0x281a67++){_0x110d56[_0x48dd('0x25')](getTimezoneData(_0x3afc10[_0x281a67],tmp_voice_queues));}BPromise[_0x48dd('0x20')](_0x110d56)['then'](function(){_0x418883({'val':0x1});});})['catch'](function(_0x5898de){logger[_0x48dd('0x5e')](_0x5898de[_0x48dd('0x5f')]);_0x418883({'val':0x0});});});}function getTimezoneData(_0x2730ad,_0x4b2ef1){return new Promise(function(_0x1ecf75,_0x142749){var _0x310ea1=shared[_0x48dd('0x71')];var _0x5a38b7=_0x310ea1[_0x2730ad[_0x48dd('0x72')]];if(_[_0x48dd('0x23')](_0x5a38b7)){_0x1ecf75({'ret':0x1});}else{var _0x52abb2=_0x5a38b7['utcOffset'];var _0x324d9e=squel[_0x48dd('0x41')]()[_0x48dd('0x48')](_0x4b2ef1)['set']('id',_0x2730ad['id'])['set'](_0x48dd('0x73'),_0x52abb2)[_0x48dd('0x74')](_0x48dd('0x72'),_0x2730ad[_0x48dd('0x72')])['toString']();return db[_0x48dd('0x63')][_0x48dd('0x64')](_0x324d9e)[_0x48dd('0x6b')](function(_0x3f3c4f){_0x1ecf75({'ret':0x1});})[_0x48dd('0x65')](function(_0x4b739f){logger['error'](_0x4b739f[_0x48dd('0x5f')]);_0x142749({'ret':0x1});});}});}function handleTZQuery(_0x5b8b3a){logger[_0x48dd('0x62')](_0x5b8b3a);return db[_0x48dd('0x63')]['query'](_0x5b8b3a)[_0x48dd('0x6b')](function(_0x46b195){})[_0x48dd('0x65')](function(_0x4f5e75){logger[_0x48dd('0x5e')](_0x4f5e75[_0x48dd('0x5f')]);});}function main(_0xffe10d,_0x591672,_0x29ca90,_0x3b86c5){logger['info'](_0x48dd('0x75'),_0xffe10d,JSON['stringify'](_0x591672));process[_0x48dd('0x76')](_0x48dd('0x77'));var _0xfe5e93=_0x591672[_0x48dd('0x78')];var _0x15af3f=_[_0x48dd('0x79')](_0xfe5e93);var _0x28a5fb=_0x591672['socket_timestamp'];var _0x32850b=path['join'](config[_0x48dd('0x7a')],_0x48dd('0x7b'),_0x28a5fb+_0x48dd('0x7c'));hasTZ=_[_0x48dd('0x57')](_0xfe5e93)[_0x48dd('0x7d')]('dialTimezone');var _0x5cea92=_[_0x48dd('0x57')](_0xfe5e93)['join']();logger[_0x48dd('0x62')]('header',_0x5cea92);db[_0x48dd('0x7e')][_0x48dd('0x1d')]({'raw':!![],'attributes':['id',_0x48dd('0x7f')]})['then'](function(_0x81fedc){for(var _0x3e4a7a=0x0;_0x3e4a7a<_0x81fedc['length'];_0x3e4a7a++){if(_0x81fedc[_0x3e4a7a]['name']in _0xfe5e93){contactItemTypes[_0x48dd('0x25')](_0x81fedc[_0x3e4a7a]);delete _0x15af3f[_0x81fedc[_0x3e4a7a][_0x48dd('0x7f')]];hasAdditionalPhones=!![];}for(var _0x5ed409 in _0xfe5e93){if(_0x81fedc[_0x3e4a7a][_0x48dd('0x7f')]+'_description'===_0x5ed409){phoneDescriptions[_0x48dd('0x25')]({'itemTypeId':_0x81fedc[_0x3e4a7a]['id'],'description':_0x5ed409});delete _0x15af3f[_0x5ed409];}}}if(hasAdditionalPhones)_0x15af3f['AdditionalPhones']='';var _0x52b880=_[_0x48dd('0x57')](_0x15af3f)['join']();logger['info'](_0x48dd('0x80'),_0x52b880);fs[_0x48dd('0x81')](_0x32850b,_0x52b880+'\x0a');Papa[_0x48dd('0x82')](fs['createReadStream'](_0xffe10d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x54f823,_0x1e4c10){try{for(var _0x40d75e=0x0,_0x1416ab=[];_0x40d75e<_0x54f823[_0x48dd('0x83')][_0x48dd('0x1f')];_0x40d75e++){stats[_0x48dd('0x84')]+=0x1;if(_0x54f823[_0x48dd('0x85')][_0x40d75e]){handleError(_0x54f823[_0x48dd('0x83')][_0x40d75e],_0x54f823['errors'][_0x40d75e]);}else{var _0x8d5382=[];var _0x3e3047=[];var _0x4978e7={};for(var _0x32b04a in _0xfe5e93){let _0x321bdd=contactItemTypes[_0x48dd('0x86')](_0x4ba6ca=>_0x4ba6ca[_0x48dd('0x7f')]===_0x32b04a);let _0x45ad42=contactItemTypes['find'](_0x532738=>_0x532738['name']+_0x48dd('0x87')===_0x32b04a);if(_[_0x48dd('0x23')](_0x321bdd)&&_[_0x48dd('0x23')](_0x45ad42)){if(_0xfe5e93[_0x48dd('0x88')](_0x32b04a)){if(_0x54f823[_0x48dd('0x83')][_0x40d75e][_0xfe5e93[_0x32b04a]]){var _0x4990c7=_[_0x48dd('0x89')](_0x54f823[_0x48dd('0x83')][_0x40d75e][_0xfe5e93[_0x32b04a]][_0x48dd('0x8a')](/"/g,'\x27'));switch(_0x32b04a){case _0x48dd('0x34'):var _0x49bfbb=moment(_0x4990c7,_0x48dd('0x11'),!![]);if(_0x49bfbb[_0x48dd('0x8b')]()){_0x1416ab['push']('\x22'+_0x4990c7+'\x22');}else{_0x8d5382[_0x48dd('0x25')](_0x48dd('0x8c'));}break;case _0x48dd('0x49'):var _0x38f3cf=parseInt(_0x4990c7);_0x4990c7=_[_0x48dd('0x8d')](_0x38f3cf)||_0x38f3cf<0x0||_0x38f3cf>0x4?_0x3b86c5?0x3:0x2:_0x38f3cf;_0x1416ab['push']('\x22'+_0x4990c7+'\x22');break;case'UserId':var _0x5b6efb=parseInt(_0x4990c7);if(_[_0x48dd('0x8e')](_0x5b6efb)&&_[_0x48dd('0x7d')](_0x29ca90,_0x5b6efb)){_0x1416ab[_0x48dd('0x25')]('\x22'+_0x5b6efb+'\x22');}else{_0x8d5382[_0x48dd('0x25')](_0x48dd('0x8f'));}break;case _0x48dd('0x90'):if(isEmail(_0x4990c7)){_0x1416ab[_0x48dd('0x25')]('\x22'+_0x4990c7+'\x22');}else{_0x8d5382['push']('email\x20wrong\x20format');}break;case _0x48dd('0x91'):var _0x459ae1=moment(_0x4990c7,_0x48dd('0x92'),!![]);if(_0x459ae1['isValid']()){_0x1416ab[_0x48dd('0x25')]('\x22'+_0x4990c7+'\x22');}else{_0x8d5382[_0x48dd('0x25')](_0x48dd('0x93'));}break;case'dialTimezone':var _0x222649=shared[_0x48dd('0x71')];var _0x42fc1c=_0x222649[_0x4990c7];if(!_[_0x48dd('0x23')](_0x42fc1c)){var _0x318676=_0x42fc1c[_0x48dd('0x94')];_0x1416ab['push']('\x22'+_0x4990c7+'\x22');_0x1416ab[_0x48dd('0x25')]('\x22'+_0x318676+'\x22');}break;default:_0x1416ab[_0x48dd('0x25')]('\x22'+_0x4990c7+'\x22');}}else{switch(_0x32b04a){case _0x48dd('0x95'):case _0x48dd('0x15'):_0x8d5382['push'](_0x32b04a+'\x20not\x20specified');break;default:_0x1416ab[_0x48dd('0x25')]('\x22\x22');}}}}else{var _0x2b87df='';if(!_[_0x48dd('0x23')](_0x321bdd)){if(!_0x4978e7[_0x48dd('0x88')](_0x321bdd['id'])){if(!_[_0x48dd('0x23')](_0x54f823[_0x48dd('0x83')][_0x40d75e][_0xfe5e93[_0x32b04a]])){var _0x4990c7=_['trim'](_0x54f823[_0x48dd('0x83')][_0x40d75e][_0xfe5e93[_0x32b04a]][_0x48dd('0x8a')](/"/g,'\x27'));var _0x298aea=phoneDescriptions[_0x48dd('0x86')](_0x39fca0=>_0x39fca0[_0x48dd('0x96')]===_0x321bdd['id']);if(!_['isNil'](_0x298aea)){var _0x4fd32e=_[_0x48dd('0x89')](_0x54f823[_0x48dd('0x83')][_0x40d75e][_0xfe5e93[_0x298aea[_0x48dd('0x97')]]][_0x48dd('0x8a')](/"/g,'\x27'));if(!_['isNil'](_0x4fd32e))_0x4990c7=_0x4990c7+'§'+_0x4fd32e;}if(_0x2b87df=='')_0x2b87df=_0x4990c7;else _0x2b87df+='|'+_0x4990c7;}_0x3e3047[_0x48dd('0x25')](_0x321bdd['id']+':'+_0x2b87df);_0x4978e7[_0x321bdd['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1416ab[_0x48dd('0x25')]('\x22'+_0x3e3047[_0x48dd('0x1b')](';')+'\x22');}if(_0x8d5382[_0x48dd('0x1f')]){handleError(_0x54f823[_0x48dd('0x83')][_0x40d75e],{'code':_0x48dd('0x98'),'message':_0x8d5382[_0x48dd('0x1b')]()});}else{fs[_0x48dd('0x99')](_0x32850b,_0x1416ab['join']()+'\x0a');}_0x1416ab=[];}if(!(stats[_0x48dd('0x84')]%0xc8)){socket[_0x48dd('0x9a')](_0x48dd('0x9b')+_0x28a5fb,stats);stats[_0x48dd('0x85')]=[];}}if(stopped){logger[_0x48dd('0x62')]('Abort\x20parser');_0x1e4c10[_0x48dd('0x9c')]();}}catch(_0x1649f3){handleError(_0x54f823[_0x48dd('0x83')][_0x40d75e],{'code':_0x48dd('0x9d'),'message':_0x1649f3[_0x48dd('0x5f')]});logger[_0x48dd('0x5e')](_0x48dd('0x9e'),_0x1649f3['message']);}},'complete':function(){try{var _0x1aefe6=[];var _0x135172=[];var _0x386620=_0x48dd('0x3b');if(_0x591672[_0x48dd('0x9f')]&&_0x591672[_0x48dd('0x9f')]['length']){_0x386620=_0x48dd('0xa0')+_0x28a5fb;_0x1aefe6[_0x48dd('0x25')](_0x48dd('0xa1')+_0x386620+_0x48dd('0xa2'));}tmp_campaigns=_0x48dd('0xa3')+_0x28a5fb;tmp_voice_queues=_0x48dd('0xa4')+_0x28a5fb;_0x135172['push'](_0x48dd('0xa1')+tmp_campaigns+_0x48dd('0xa5'));_0x135172[_0x48dd('0x25')](_0x48dd('0xa1')+tmp_voice_queues+_0x48dd('0xa5'));BPromise[_0x48dd('0xa6')](_0x135172,handleTZQuery)['then'](function(_0x4794d9){updateTzCampaigns(_0x591672[_0x48dd('0x36')])[_0x48dd('0x1e')](function(_0x3e8e53){updateTzVoiceQueues(_0x591672['ListId'])[_0x48dd('0x1e')](function(_0x1f8615){if(hasTZ)_0x52b880=_0x52b880['replace']('dialTimezone',_0x48dd('0xa7'));var _0xc22941=util[_0x48dd('0x10')](_0x48dd('0xa8'),_0x32850b,_0x386620,_0x52b880,_0x591672[_0x48dd('0x36')],_0x591672[_0x48dd('0x58')]||null,NOW,NOW);if(_[_0x48dd('0x23')](_0xfe5e93['scheduledat'])){_0xc22941+=_0x48dd('0xa9');}_0x1aefe6[_0x48dd('0x25')](_0xc22941);if(_0x591672[_0x48dd('0x9f')]&&_0x591672[_0x48dd('0x9f')][_0x48dd('0x1f')]){_0x1aefe6[_0x48dd('0x25')](insertCmContact(_0x591672[_0x48dd('0x36')],_0x386620,_0x591672[_0x48dd('0x9f')],_0xfe5e93));_0x1aefe6['push']('DROP\x20TABLE\x20'+_0x386620+';');}BPromise[_0x48dd('0xa6')](_0x1aefe6,handleQuery)['then'](function(_0x19b9f9){BPromise[_0x48dd('0x20')]([handleAdditionalPhones()])['then'](function(){_0x1aefe6=[];for(var _0x383dfa=0x0;_0x383dfa_0x4c99a6[_0xde35('0x6b')]===_0x492e05);let _0x324806=contactItemTypes[_0xde35('0x71')](_0x105047=>_0x105047['name']+_0xde35('0x6c')===_0x492e05);if(_[_0xde35('0x1a')](_0x350540)&&_[_0xde35('0x1a')](_0x324806)){if(_0x17e806[_0xde35('0x72')](_0x492e05)){if(_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05]]){var _0x434022=_['trim'](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05]][_0xde35('0x73')](/"/g,'\x27'));switch(_0x492e05){case _0xde35('0x35'):var _0x56775f=moment(_0x434022,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x56775f[_0xde35('0x74')]()){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4['push'](_0xde35('0x75'));}break;case _0xde35('0x76'):var _0x15e768=parseInt(_0x434022);_0x434022=_['isNaN'](_0x15e768)||_0x15e768<0x0||_0x15e768>0x4?_0x4322ce?0x3:0x2:_0x15e768;_0x24832d['push']('\x22'+_0x434022+'\x22');break;case _0xde35('0x3a'):var _0x3d8a79=parseInt(_0x434022);if(_[_0xde35('0x77')](_0x3d8a79)&&_[_0xde35('0x78')](_0x30e2e5,_0x3d8a79)){_0x24832d[_0xde35('0x1b')]('\x22'+_0x3d8a79+'\x22');}else{_0x4f37a4[_0xde35('0x1b')]('agent\x20not\x20exists');}break;case _0xde35('0x79'):if(isEmail(_0x434022)){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4[_0xde35('0x1b')](_0xde35('0x7a'));}break;case _0xde35('0x7b'):var _0xd0e970=moment(_0x434022,_0xde35('0x7c'),!![]);if(_0xd0e970['isValid']()){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4[_0xde35('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}}else{switch(_0x492e05){case _0xde35('0x7d'):case _0xde35('0x12'):_0x4f37a4[_0xde35('0x1b')](_0x492e05+_0xde35('0x7e'));break;default:_0x24832d[_0xde35('0x1b')]('\x22\x22');}}}}else{var _0x2f4913='';if(!_[_0xde35('0x1a')](_0x350540)){if(!_0x53dbbe['hasOwnProperty'](_0x350540['id'])){for(var _0x32e8f9=0x0;_0x32e8f9<_0x17e806[_0x492e05]['length'];_0x32e8f9++){var _0x434022=_[_0xde35('0x7f')](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05][_0x32e8f9]][_0xde35('0x73')](/"/g,'\x27'));var _0x25bdf1=phoneDescriptions[_0xde35('0x71')](_0x4585ea=>_0x4585ea[_0xde35('0x80')]===_0x350540['id']);if(!_[_0xde35('0x1a')](_0x25bdf1)){var _0x221f48=_[_0xde35('0x7f')](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x25bdf1[_0xde35('0x81')]][0x0]][_0xde35('0x73')](/"/g,'\x27'));if(!_['isNil'](_0x221f48))_0x434022=_0x434022+'§'+_0x221f48;}if(_0x2f4913=='')_0x2f4913=_0x434022;else _0x2f4913+='|'+_0x434022;}_0x38602e[_0xde35('0x1b')](_0x350540['id']+':'+_0x2f4913);_0x53dbbe[_0x350540['id']]=0x1;}}}}if(hasAdditionalPhones){_0x24832d[_0xde35('0x1b')]('\x22'+_0x38602e[_0xde35('0x3d')](';')+'\x22');}if(_0x4f37a4[_0xde35('0x19')]){handleError(_0x57a8c9[_0xde35('0x70')][_0x4b777c],{'code':_0xde35('0x82'),'message':_0x4f37a4[_0xde35('0x3d')]()});}else{fs['appendFileSync'](_0x784b38,_0x24832d['join']()+'\x0a');}_0x24832d=[];}if(!(stats[_0xde35('0x83')]%0xc8)){socket[_0xde35('0x84')](_0xde35('0x85')+_0x48b880,stats);stats[_0xde35('0x5e')]=[];}}if(stopped){logger[_0xde35('0x5c')]('Abort\x20parser');_0x3573ad[_0xde35('0x86')]();}}catch(_0x5df20d){handleError(_0x57a8c9['data'][_0x4b777c],{'code':'SystemError','message':_0x5df20d[_0xde35('0x1e')]});logger[_0xde35('0x1d')](_0xde35('0x87'),_0x5df20d[_0xde35('0x1e')]);}},'complete':function(){try{var _0x1d04ae=[];var _0xbb9987=tempTableName;_0x1d04ae[_0xde35('0x1b')](_0xde35('0x88')+_0xbb9987+'\x20LIKE\x20cm_contacts;');logger[_0xde35('0x5c')](_0xde35('0x89'),contactItemTypes['length']);var _0x5b87b2=util['format'](_0xde35('0x8a'),_0x784b38,_0xbb9987,_0x109243,_0x59bfaf[_0xde35('0x37')],_0x59bfaf[_0xde35('0x57')]||null,NOW,NOW);if(_[_0xde35('0x1a')](_0x17e806[_0xde35('0x35')])){_0x5b87b2+=_0xde35('0x8b');}_0x1d04ae[_0xde35('0x1b')](_0x5b87b2);BPromise['each'](_0x1d04ae,handleQuery)[_0xde35('0x25')](function(_0x5824e6){BPromise[_0xde35('0x20')]([handleAdditionalPhones()])[_0xde35('0x25')](function(){_0x1d04ae=[];for(var _0xa7a044=0x0;_0xa7a044\x20\x20');}var _0x141b57=path[_0xde35('0x3d')](config[_0xde35('0x66')],_0xde35('0x97'),process[_0xde35('0x96')][0x2]);if(!fs['existsSync'](_0x141b57)){throw new Error(_0xde35('0x98'));}var _0x2a0747={};try{_0x2a0747=JSON[_0xde35('0x6f')](process['argv'][0x3]);if(!_0x2a0747['binding']){throw new Error(_0xde35('0x99'));}var _0xca36d3=0x0;if(_0x2a0747['binding']['UserId']){_0xca36d3=0x1;}if(!_0x2a0747['ListId']){throw new Error(_0xde35('0x9a'));}}catch(_0x211b6a){throw new Error('body\x20id\x20mandatory');}var _0x1b9314=[];try{_0x1b9314=_['map'](JSON[_0xde35('0x6f')](process[_0xde35('0x96')][0x4]),'id');}catch(_0x48f994){logger['info'](_0xde35('0x9b'));}main(_0x141b57,_0x2a0747,_0x1b9314,_0xca36d3);}validate();process['on']('SIGINT',handleStop);process['on'](_0xde35('0x9c'),handleUncaughtException); \ No newline at end of file +var _0x1e7b=['bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','update','updated','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','from','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','toString','cm_hopper_black','cm_contacts.ListId\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','\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','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','min_id','Received\x20SIGINT','exit','code','info','main','stringify','send','start','binding','clone','socket_timestamp','server/files/tmp','.csv','findAll','name','_description','header','parse','createReadStream','data','rows','errors','find','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','itemTypeId','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contact','contactTypeId','orderBy','DROP\x20TABLE\x20','each','unlink','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util'];(function(_0x7a2953,_0x3ae268){var _0x4aaefb=function(_0x20f9fb){while(--_0x20f9fb){_0x7a2953['push'](_0x7a2953['shift']());}};_0x4aaefb(++_0x3ae268);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x15dafa,_0x3bd9b2){_0x15dafa=_0x15dafa-0x0;var _0x390812=_0x1e7b[_0x15dafa];return _0x390812;};'use strict';var fs=require('fs');var path=require(_0xb1e7('0x0'));var _=require(_0xb1e7('0x1'));var Papa=require('papaparse');var util=require(_0xb1e7('0x2'));var BPromise=require(_0xb1e7('0x3'));var moment=require('moment');var squel=require(_0xb1e7('0x4'));var Redis=require(_0xb1e7('0x5'));var db=require(_0xb1e7('0x6'))['db'];var config=require(_0xb1e7('0x7'));var logger=require('../../../config/logger')(_0xb1e7('0x8'));config[_0xb1e7('0x9')]=_[_0xb1e7('0xa')](config[_0xb1e7('0x9')],{'host':_0xb1e7('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1e7('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xb1e7('0xc')](_0xb1e7('0xd'));var tempTableName=_0xb1e7('0xe')+moment()[_0xb1e7('0xc')](_0xb1e7('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x842e0a){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))*$/[_0xb1e7('0x10')](_0x842e0a);}function selectNotIn(_0x13af76,_0x2521e9,_0xd34f8c,_0x1aaf8f,_0xc7eea1){return squel[_0xb1e7('0x11')]()[_0xb1e7('0x12')]('phone')['from'](_0x1aaf8f)[_0xb1e7('0x13')](_0x2521e9,null,_0x2521e9+_0xb1e7('0x14')+_0x1aaf8f+'.'+_0xd34f8c)[_0xb1e7('0x15')](_0x1aaf8f+'.'+_0xd34f8c+'\x20=\x20'+_0x13af76+'.'+_0xd34f8c)[_0xb1e7('0x15')](_0x2521e9+_0xb1e7('0x16')+_0xc7eea1[_0xb1e7('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4e1343,_0x2318e9){promisesAdditionalPhones=[];promisesContact=[];return db[_0xb1e7('0x17')][_0xb1e7('0x18')]('select\x20*\x20from\x20'+tempTableName)[_0xb1e7('0x19')](function(_0x2f677d){if(_0x2f677d!==null){var _0xe090d0=[];for(var _0x160838=0x0;_0x160838<_0x2f677d[_0xb1e7('0x1a')];_0x160838++){var _0x2d1dd0=_0x2f677d[_0x160838];if(!_[_0xb1e7('0x1b')](_0x2d1dd0[_0xb1e7('0x1c')])){if(!_[_0xb1e7('0x1b')](_0x2d1dd0[_0xb1e7('0x1d')]))_0xe090d0[_0xb1e7('0x1e')](insertAdditionalPhones(_0x2d1dd0));promisesContact[_0xb1e7('0x1e')]({'contact':_0x2d1dd0});}}}Promise[_0xb1e7('0x1f')](_0xe090d0)[_0xb1e7('0x20')](function(){_0x4e1343({'val':0x1});});})[_0xb1e7('0x21')](function(_0x4863b6){logger[_0xb1e7('0x22')](_0x4863b6[_0xb1e7('0x23')]);});});}function insertAdditionalPhones(_0x51b0e3){return new Promise(function(_0x2fbd93,_0x56ee72){var _0x1fee0e=_0x51b0e3[_0xb1e7('0x1d')];if(_[_0xb1e7('0x1b')](_0x1fee0e))_0x56ee72({'val':0x0});else{var _0x134c99=_0x1fee0e[_0xb1e7('0x24')](';');var _0x1d9558=[];orderBy=0x0;for(var _0x4d43dc=0x0;_0x4d43dc<_0x134c99[_0xb1e7('0x1a')];_0x4d43dc++){_0x1d9558[_0xb1e7('0x1e')](splitAdditionalPhone(_0x51b0e3['id'],_0x134c99[_0x4d43dc]));}Promise['all'](_0x1d9558)['then'](function(){_0x2fbd93({'val':_0x134c99[_0xb1e7('0x1a')]});});}});}function splitAdditionalPhone(_0x41b2e2,_0x163148){return new Promise(function(_0x5185bb,_0x1265d9){var _0x18ba5f=_0x163148[_0xb1e7('0x24')](':');var _0x149670=_0x18ba5f[0x0];var _0x5ada06=_0x18ba5f[0x1];if(_0x5ada06!==''){var _0x582dcc=_0x5ada06[_0xb1e7('0x24')]('|');var _0x50d850=[];for(var _0x2853f9=0x0;_0x2853f9<_0x582dcc[_0xb1e7('0x1a')];_0x2853f9++){if(_0x582dcc[_0x2853f9]!==''){var _0x2bc953=_[_0xb1e7('0x25')](promisesAdditionalPhones,{'contactId':_0x41b2e2,'phone':_0x582dcc[_0x2853f9]});if(_0x2bc953[_0xb1e7('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xb1e7('0x1e')]({'contactId':_0x41b2e2,'contactTypeId':_0x149670,'phone':_0x582dcc[_0x2853f9],'orderBy':orderBy});}}}_0x5185bb({'ok':0x1});}else _0x5185bb({'res':0x0});});}function createAdditionalPhone(_0x2a1dd6,_0x30534f,_0x290633,_0x2ad5e7){var _0x294735='';var _0x235f63='';var _0x2a0ede=_0x290633['split']('§');_0x294735=_0x2a0ede[0x0];if(_0x2a0ede[_0xb1e7('0x1a')]==0x2)_0x235f63=_0x2a0ede[0x1];return new Promise(function(_0x6e5f84,_0x12cb8e){return db[_0xb1e7('0x26')]['findOne']({'where':{'CmContactId':_0x2a1dd6,'item':_0x294735}})[_0xb1e7('0x20')](function(_0x5218d0){if(_0x5218d0){return db['CmContactHasItem'][_0xb1e7('0x27')]({'ItemTypeId':_0x30534f,'description':_0x235f63,'OrderBy':_0x2ad5e7},{'where':{'CmContactId':_0x2a1dd6,'item':_0x294735}})[_0xb1e7('0x20')](function(_0x3d0c48){_0x6e5f84({'res':_0xb1e7('0x28')});});}else{return db[_0xb1e7('0x26')]['create']({'CmContactId':_0x2a1dd6,'item':_0x294735,'ItemTypeId':_0x30534f,'description':_0x235f63,'OrderBy':_0x2ad5e7,'ItemClass':'PHONE'})['then'](function(_0x329a7a){_0x6e5f84({'res':_0xb1e7('0x29')});});}});});}function updateContact(_0x3ffe8e){return new Promise(function(_0x2f692d,_0x37ffe4){var _0x5d944e=_0x3ffe8e['id'];delete _0x3ffe8e['id'];return db[_0xb1e7('0x2a')][_0xb1e7('0x27')](_0x3ffe8e,{'where':{'id':_0x5d944e}})[_0xb1e7('0x20')](function(_0x25785a){updatedRows+=0x1;return db[_0xb1e7('0x2b')]['update']({'phone':_0x3ffe8e['phone']},{'where':{'ContactId':_0x5d944e}})[_0xb1e7('0x20')](function(_0x1f4240){_0x2f692d({'ret':'OK'});});});});}function insertCmHopper(_0x213084,_0x53bfd9,_0xe9df78,_0x283981,_0x38f1eb){var _0x42e3c7=[_0xb1e7('0x2c'),'cm_contacts.scheduledat',_0xb1e7('0x2d'),_0xb1e7('0x2e'),_0x53bfd9+'.'+_0x283981,_0xb1e7('0x2f'),_0xb1e7('0x30'),_0xb1e7('0x31'),_0xb1e7('0x32'),'\x22'+_0x38f1eb+'\x22'];return squel[_0xb1e7('0x33')]()[_0xb1e7('0x34')]('cm_hopper')[_0xb1e7('0x35')]([_0xb1e7('0x1c'),'scheduledat',_0xb1e7('0x36'),_0xb1e7('0x37'),_0x283981,_0xb1e7('0x38'),_0xb1e7('0x39'),_0xb1e7('0x3a'),_0xb1e7('0x3b'),'recallme'],squel['select']()[_0xb1e7('0x3c')](_0x42e3c7)[_0xb1e7('0x3d')](_0x53bfd9)['join'](_0xb1e7('0x3e'),null,'cm_contacts.ListId\x20=\x20'+_0x53bfd9+_0xb1e7('0x3f'))[_0xb1e7('0x13')](_0xe9df78,null,_0xe9df78+'.id\x20=\x20'+_0x53bfd9+'.'+_0x283981)[_0xb1e7('0x15')](_0x53bfd9+'.CmListId\x20=\x20?',_0x213084)[_0xb1e7('0x15')](_0xb1e7('0x40'),NOW)[_0xb1e7('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x53bfd9,_0xe9df78,_0x283981,'cm_hopper',[_0xb1e7('0x41'),'\x22onlyIfOpen\x22']))[_0xb1e7('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x53bfd9,_0xe9df78,_0x283981,'cm_hopper',['\x22always\x22'])))[_0xb1e7('0x42')]();}function insertCmHopperBlack(_0x297833,_0x392333,_0x2ee791,_0x546b00){var _0xd51cbb=[_0xb1e7('0x2c'),'cm_contacts.id','cm_contacts.ListId',_0x392333+'.'+_0x546b00,_0xb1e7('0x2f'),'cm_contacts.updatedAt'];return squel['insert']()[_0xb1e7('0x34')](_0xb1e7('0x43'))[_0xb1e7('0x35')]([_0xb1e7('0x1c'),_0xb1e7('0x36'),_0xb1e7('0x37'),_0x546b00,_0xb1e7('0x38'),'updatedAt'],squel[_0xb1e7('0x11')]()[_0xb1e7('0x3c')](_0xd51cbb)[_0xb1e7('0x3d')](_0x392333)[_0xb1e7('0x13')](_0xb1e7('0x3e'),null,_0xb1e7('0x44')+_0x392333+_0xb1e7('0x3f'))[_0xb1e7('0x13')](_0x2ee791,null,_0x2ee791+_0xb1e7('0x14')+_0x392333+'.'+_0x546b00)[_0xb1e7('0x15')](_0x392333+'.CmListId\x20=\x20?',_0x297833)[_0xb1e7('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb1e7('0x15')](_0xb1e7('0x45'),squel['select']()['field']('phone')[_0xb1e7('0x3d')]('cm_hopper_black')[_0xb1e7('0x15')]('ListId\x20=\x20?',_0x297833)[_0xb1e7('0x15')](_0x546b00+_0xb1e7('0x46'),_0x392333+'.'+_0x546b00)))[_0xb1e7('0x42')]();}function insertCmHopperAdditionalPhones(_0x9fc86d){var _0x387b57=[_0xb1e7('0x47'),_0xb1e7('0x48'),_0xb1e7('0x49'),_0xb1e7('0x4a'),_0xb1e7('0x4b')];return squel[_0xb1e7('0x33')]()[_0xb1e7('0x34')](_0xb1e7('0x4c'))[_0xb1e7('0x35')]([_0xb1e7('0x4d'),'phone','OrderBy','createdAt',_0xb1e7('0x39')],squel[_0xb1e7('0x11')]()[_0xb1e7('0x3c')](_0x387b57)['from']('cm_hopper')[_0xb1e7('0x13')](_0xb1e7('0x3e'),null,_0xb1e7('0x4e'))[_0xb1e7('0x13')](_0xb1e7('0x4f'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xb1e7('0x15')](_0xb1e7('0x50'),_0x9fc86d)['where'](_0xb1e7('0x40'),NOW))[_0xb1e7('0x42')]();}function insertCmContact(_0x39f200,_0x5da9c8,_0x3dce41,_0x4ac712){var _0x9421bd=_[_0xb1e7('0x51')](_[_0xb1e7('0x52')](_0x4ac712),[_0xb1e7('0x37'),_0xb1e7('0x53'),_0xb1e7('0x38'),_0xb1e7('0x39')]);return squel[_0xb1e7('0x33')]()[_0xb1e7('0x34')](_0xb1e7('0x3e'))[_0xb1e7('0x35')](_0x9421bd,squel[_0xb1e7('0x11')]()['fields'](_0x9421bd)['from'](_0x5da9c8)[_0xb1e7('0x15')]('('+_0x3dce41[_0xb1e7('0x13')](',')+_0xb1e7('0x54'),squel[_0xb1e7('0x11')]()[_0xb1e7('0x3c')](_0x3dce41)[_0xb1e7('0x3d')](_0xb1e7('0x3e'))['where']('ListId\x20=\x20?',_0x39f200))[_0xb1e7('0x15')]('id\x20IN\x20?',squel[_0xb1e7('0x11')]()[_0xb1e7('0x12')]('MIN(id)',_0xb1e7('0x55'))[_0xb1e7('0x3d')](_0x5da9c8)['group'](_0x3dce41[_0xb1e7('0x13')](','))))[_0xb1e7('0x42')]();}function handleStop(){logger['info'](_0xb1e7('0x56'));stopped=!![];}function handleUncaughtException(_0x4b7ffe){logger['error'](_0x4b7ffe[_0xb1e7('0x23')]);process[_0xb1e7('0x57')](0x1);}function handleError(_0x335cf2,_0xb4118b){stats['errors']['push']({'name':_0xb4118b[_0xb1e7('0x58')],'message':_0xb4118b['message'],'row':_0x335cf2});}function handleQuery(_0x4e5932){logger[_0xb1e7('0x59')](_0x4e5932);return db[_0xb1e7('0x17')][_0xb1e7('0x18')](_0x4e5932)[_0xb1e7('0x19')](function(_0x33105f){results[_0xb1e7('0x1e')](_0x33105f);})['catch'](function(_0x2bc2e6){logger[_0xb1e7('0x22')](_0x2bc2e6['message']);});}function main(_0x100c68,_0x475dc5,_0x134297,_0xb182d4){logger['info'](_0xb1e7('0x5a'),_0x100c68,JSON[_0xb1e7('0x5b')](_0x475dc5));process[_0xb1e7('0x5c')](_0xb1e7('0x5d'));var _0x352805=_0x475dc5[_0xb1e7('0x5e')];var _0x384990=_[_0xb1e7('0x5f')](_0x352805);var _0x5b0c10=_0x475dc5[_0xb1e7('0x60')];var _0x58dcd2=path[_0xb1e7('0x13')](config['root'],_0xb1e7('0x61'),_0x5b0c10+_0xb1e7('0x62'));logger[_0xb1e7('0x59')]('body',_0x475dc5);db['ContactItemType'][_0xb1e7('0x63')]({'raw':!![],'attributes':['id',_0xb1e7('0x64')]})[_0xb1e7('0x20')](function(_0x37db4f){for(var _0x25dc7c=0x0;_0x25dc7c<_0x37db4f[_0xb1e7('0x1a')];_0x25dc7c++){if(_0x37db4f[_0x25dc7c]['name']in _0x352805){contactItemTypes[_0xb1e7('0x1e')](_0x37db4f[_0x25dc7c]);delete _0x384990[_0x37db4f[_0x25dc7c][_0xb1e7('0x64')]];hasAdditionalPhones=!![];}for(var _0x3bd581 in _0x352805){if(_0x37db4f[_0x25dc7c][_0xb1e7('0x64')]+_0xb1e7('0x65')===_0x3bd581){phoneDescriptions['push']({'itemTypeId':_0x37db4f[_0x25dc7c]['id'],'description':_0x3bd581});delete _0x384990[_0x3bd581];}}}if(hasAdditionalPhones)_0x384990[_0xb1e7('0x1d')]='';var _0x2eb9c1=_[_0xb1e7('0x52')](_0x384990)[_0xb1e7('0x13')]();logger[_0xb1e7('0x59')](_0xb1e7('0x66'),_0x2eb9c1);fs['writeFileSync'](_0x58dcd2,_0x2eb9c1+'\x0a');Papa[_0xb1e7('0x67')](fs[_0xb1e7('0x68')](_0x100c68),{'header':!![],'skipEmptyLines':!![],'step':function(_0x47fb75,_0x4440f5){try{for(var _0x4a93e1=0x0,_0x52e3f9=[];_0x4a93e1<_0x47fb75[_0xb1e7('0x69')]['length'];_0x4a93e1++){stats[_0xb1e7('0x6a')]+=0x1;if(_0x47fb75[_0xb1e7('0x6b')][_0x4a93e1]){handleError(_0x47fb75[_0xb1e7('0x69')][_0x4a93e1],_0x47fb75['errors'][_0x4a93e1]);}else{var _0x2e1ae5=[];var _0x659a8c=[];var _0x21b9f6={};for(var _0x19f732 in _0x352805){let _0x543652=contactItemTypes[_0xb1e7('0x6c')](_0x298a21=>_0x298a21[_0xb1e7('0x64')]===_0x19f732);let _0x125699=contactItemTypes[_0xb1e7('0x6c')](_0x13395f=>_0x13395f[_0xb1e7('0x64')]+_0xb1e7('0x65')===_0x19f732);if(_[_0xb1e7('0x1b')](_0x543652)&&_[_0xb1e7('0x1b')](_0x125699)){if(_0x352805[_0xb1e7('0x6d')](_0x19f732)){if(_0x47fb75[_0xb1e7('0x69')][_0x4a93e1][_0x352805[_0x19f732]]){var _0x2b5f66=_[_0xb1e7('0x6e')](_0x47fb75[_0xb1e7('0x69')][_0x4a93e1][_0x352805[_0x19f732]][_0xb1e7('0x6f')](/"/g,'\x27'));switch(_0x19f732){case _0xb1e7('0x70'):var _0x3f485e=moment(_0x2b5f66,_0xb1e7('0xd'),!![]);if(_0x3f485e[_0xb1e7('0x71')]()){_0x52e3f9[_0xb1e7('0x1e')]('\x22'+_0x2b5f66+'\x22');}else{_0x2e1ae5[_0xb1e7('0x1e')](_0xb1e7('0x72'));}break;case _0xb1e7('0x3a'):var _0x5b4a95=parseInt(_0x2b5f66);_0x2b5f66=_['isNaN'](_0x5b4a95)||_0x5b4a95<0x0||_0x5b4a95>0x4?_0xb182d4?0x3:0x2:_0x5b4a95;_0x52e3f9[_0xb1e7('0x1e')]('\x22'+_0x2b5f66+'\x22');break;case _0xb1e7('0x3b'):var _0x1c5594=parseInt(_0x2b5f66);if(_[_0xb1e7('0x73')](_0x1c5594)&&_[_0xb1e7('0x74')](_0x134297,_0x1c5594)){_0x52e3f9[_0xb1e7('0x1e')]('\x22'+_0x1c5594+'\x22');}else{_0x2e1ae5['push'](_0xb1e7('0x75'));}break;case _0xb1e7('0x76'):if(isEmail(_0x2b5f66)){_0x52e3f9[_0xb1e7('0x1e')]('\x22'+_0x2b5f66+'\x22');}else{_0x2e1ae5[_0xb1e7('0x1e')]('email\x20wrong\x20format');}break;case _0xb1e7('0x77'):var _0x311dc1=moment(_0x2b5f66,'YYYY-MM-DD',!![]);if(_0x311dc1[_0xb1e7('0x71')]()){_0x52e3f9[_0xb1e7('0x1e')]('\x22'+_0x2b5f66+'\x22');}else{_0x2e1ae5[_0xb1e7('0x1e')](_0xb1e7('0x78'));}break;default:_0x52e3f9[_0xb1e7('0x1e')]('\x22'+_0x2b5f66+'\x22');}}else{switch(_0x19f732){case'firstName':case _0xb1e7('0x1c'):_0x2e1ae5[_0xb1e7('0x1e')](_0x19f732+_0xb1e7('0x79'));break;default:_0x52e3f9[_0xb1e7('0x1e')]('\x22\x22');}}}}else{var _0x4f169e='';if(!_['isNil'](_0x543652)){if(!_0x21b9f6[_0xb1e7('0x6d')](_0x543652['id'])){for(var _0x2a8aa0=0x0;_0x2a8aa0<_0x352805[_0x19f732][_0xb1e7('0x1a')];_0x2a8aa0++){var _0x2b5f66=_[_0xb1e7('0x6e')](_0x47fb75[_0xb1e7('0x69')][_0x4a93e1][_0x352805[_0x19f732][_0x2a8aa0]][_0xb1e7('0x6f')](/"/g,'\x27'));var _0x136cb6=phoneDescriptions['find'](_0x33bce4=>_0x33bce4[_0xb1e7('0x7a')]===_0x543652['id']);if(!_[_0xb1e7('0x1b')](_0x136cb6)){var _0xa31872=_[_0xb1e7('0x6e')](_0x47fb75[_0xb1e7('0x69')][_0x4a93e1][_0x352805[_0x136cb6['description']][0x0]][_0xb1e7('0x6f')](/"/g,'\x27'));if(!_[_0xb1e7('0x1b')](_0xa31872))_0x2b5f66=_0x2b5f66+'§'+_0xa31872;}if(_0x4f169e=='')_0x4f169e=_0x2b5f66;else _0x4f169e+='|'+_0x2b5f66;}_0x659a8c[_0xb1e7('0x1e')](_0x543652['id']+':'+_0x4f169e);_0x21b9f6[_0x543652['id']]=0x1;}}}}if(hasAdditionalPhones){_0x52e3f9['push']('\x22'+_0x659a8c[_0xb1e7('0x13')](';')+'\x22');}if(_0x2e1ae5['length']){handleError(_0x47fb75['data'][_0x4a93e1],{'code':'SystemRow','message':_0x2e1ae5['join']()});}else{fs[_0xb1e7('0x7b')](_0x58dcd2,_0x52e3f9['join']()+'\x0a');}_0x52e3f9=[];}if(!(stats['rows']%0xc8)){socket[_0xb1e7('0x7c')](_0xb1e7('0x7d')+_0x5b0c10,stats);stats['errors']=[];}}if(stopped){logger[_0xb1e7('0x59')](_0xb1e7('0x7e'));_0x4440f5[_0xb1e7('0x7f')]();}}catch(_0x3564ae){handleError(_0x47fb75[_0xb1e7('0x69')][_0x4a93e1],{'code':'SystemError','message':_0x3564ae['message']});logger[_0xb1e7('0x22')](_0xb1e7('0x80'),_0x3564ae[_0xb1e7('0x23')]);}},'complete':function(){try{var _0x4895ad=[];var _0x29ca84=tempTableName;_0x4895ad[_0xb1e7('0x1e')](_0xb1e7('0x81')+_0x29ca84+_0xb1e7('0x82'));logger[_0xb1e7('0x59')](_0xb1e7('0x83'),contactItemTypes[_0xb1e7('0x1a')]);var _0xc9fe87=util[_0xb1e7('0xc')](_0xb1e7('0x84'),_0x58dcd2,_0x29ca84,_0x2eb9c1,_0x475dc5['ListId'],_0x475dc5[_0xb1e7('0x53')]||null,NOW,NOW);if(_[_0xb1e7('0x1b')](_0x352805[_0xb1e7('0x70')])){_0xc9fe87+=_0xb1e7('0x85');}_0x4895ad[_0xb1e7('0x1e')](_0xc9fe87);BPromise['each'](_0x4895ad,handleQuery)[_0xb1e7('0x20')](function(_0x3d201b){BPromise[_0xb1e7('0x1f')]([handleAdditionalPhones()])['then'](function(){_0x4895ad=[];for(var _0x3a3f50=0x0;_0x3a3f50\x20\x20');}var _0x474d6d=path[_0xb1e7('0x13')](config[_0xb1e7('0x8e')],_0xb1e7('0x61'),process[_0xb1e7('0x8d')][0x2]);if(!fs[_0xb1e7('0x8f')](_0x474d6d)){throw new Error(_0xb1e7('0x90'));}var _0x356d2d={};try{_0x356d2d=JSON[_0xb1e7('0x67')](process[_0xb1e7('0x8d')][0x3]);if(!_0x356d2d[_0xb1e7('0x5e')]){throw new Error(_0xb1e7('0x91'));}var _0x4b9d22=0x0;if(_0x356d2d['binding'][_0xb1e7('0x3b')]){_0x4b9d22=0x1;}if(!_0x356d2d[_0xb1e7('0x37')]){throw new Error(_0xb1e7('0x92'));}}catch(_0x3f00c5){throw new Error(_0xb1e7('0x93'));}var _0x13e7e9=[];try{_0x13e7e9=_[_0xb1e7('0x94')](JSON[_0xb1e7('0x67')](process[_0xb1e7('0x8d')][0x4]),'id');}catch(_0x4c8ced){logger[_0xb1e7('0x59')](_0xb1e7('0x95'));}main(_0x474d6d,_0x356d2d,_0x13e7e9,_0x4b9d22);}validate();process['on'](_0xb1e7('0x96'),handleStop);process['on'](_0xb1e7('0x97'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 88f77b4..91122f6 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf3c=['string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','calleridnum','Outbound\x20Call','variable','destcalleridnum','getDescriptions','keyValue','Caller\x20Name','Call\x20To','Queue','queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects'];(function(_0x31446b,_0x45e235){var _0x1ec2a5=function(_0x288b8c){while(--_0x288b8c){_0x31446b['push'](_0x31446b['shift']());}};_0x1ec2a5(++_0x45e235);}(_0xcf3c,0xdb));var _0xccf3=function(_0x482c56,_0xd039d1){_0x482c56=_0x482c56-0x0;var _0x1a6e32=_0xcf3c[_0x482c56];return _0x1a6e32;};'use strict';exports[_0xccf3('0x0')]=function(_0x2f369d,_0x55ae2a){var _0x15dde0=[{'type':_0xccf3('0x1'),'content':_0xccf3('0x2'),'variableName':null}];switch(_0x2f369d[_0xccf3('0x3')]()){case _0xccf3('0x4'):switch(_0x55ae2a[_0xccf3('0x3')]()){case _0xccf3('0x5'):_0x15dde0[_0xccf3('0x6')]({'type':'variable','content':'','variableName':'queue'});_0x15dde0[_0xccf3('0x6')]({'type':'variable','content':'','variableName':_0xccf3('0x7')});break;case'outbound':_0x15dde0['push']({'type':_0xccf3('0x1'),'content':_0xccf3('0x8'),'variableName':null});_0x15dde0[_0xccf3('0x6')]({'type':_0xccf3('0x9'),'content':'','variableName':_0xccf3('0xa')});break;}}return _0x15dde0;};exports[_0xccf3('0xb')]=function(_0x4128fa,_0x32c152){var _0x8d2c13=[];switch(_0x4128fa[_0xccf3('0x3')]()){case'voice':switch(_0x32c152[_0xccf3('0x3')]()){case _0xccf3('0x5'):_0x8d2c13=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xccf3('0xc'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0xccf3('0x7')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0xd'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xccf3('0xe'),'keyType':_0xccf3('0x9'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xccf3('0xf'),'keyType':'variable','variableName':_0xccf3('0x10')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x11'),'keyType':_0xccf3('0x9'),'variableName':'uniqueid'},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x12'),'keyType':'variable','variableName':_0xccf3('0x13')},{'type':_0xccf3('0x1'),'content':_0xccf3('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x15'),'keyType':_0xccf3('0x9'),'variableName':_0xccf3('0x16')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x17'),'keyType':'variable','variableName':_0xccf3('0xa')},{'type':_0xccf3('0x1'),'content':_0xccf3('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xccf3('0xc'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xccf3('0x13')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x19'),'keyType':'variable','variableName':_0xccf3('0x1a')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x1b'),'keyType':_0xccf3('0x9'),'variableName':'agentcompleteAt'},{'type':_0xccf3('0xc'),'content':'','key':'Hold\x20Time','keyType':_0xccf3('0x9'),'variableName':_0xccf3('0x1c')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x1d'),'keyType':'variable','variableName':_0xccf3('0x1e')}];break;case _0xccf3('0x1f'):_0x8d2c13=[{'type':_0xccf3('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x20'),'keyType':'variable','keyContent':'','variableName':_0xccf3('0xa')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x21'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x22')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x11'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x23')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x12'),'keyType':'variable','keyContent':'','variableName':_0xccf3('0x24')},{'type':_0xccf3('0x1'),'content':_0xccf3('0x18')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x25'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x26')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x27'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x28')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x29'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x2a')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x2b')}];break;}}return _0x8d2c13;}; \ No newline at end of file +var _0xb275=['destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','outbound','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','Answer\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','variable','queue','push','Outbound\x20Call','destcalleridnum','Caller\x20Number','calleridnum','keyValue','Caller\x20Name','Call\x20To'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb275,0xa1));var _0x5b27=function(_0x57a366,_0x212874){_0x57a366=_0x57a366-0x0;var _0xc0fbc5=_0xb275[_0x57a366];return _0xc0fbc5;};'use strict';exports[_0x5b27('0x0')]=function(_0x1c0857,_0x1226ac){var _0x80abe6=[{'type':_0x5b27('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1c0857[_0x5b27('0x2')]()){case _0x5b27('0x3'):switch(_0x1226ac[_0x5b27('0x2')]()){case _0x5b27('0x4'):_0x80abe6['push']({'type':_0x5b27('0x5'),'content':'','variableName':_0x5b27('0x6')});_0x80abe6['push']({'type':_0x5b27('0x5'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x80abe6[_0x5b27('0x7')]({'type':_0x5b27('0x1'),'content':_0x5b27('0x8'),'variableName':null});_0x80abe6[_0x5b27('0x7')]({'type':_0x5b27('0x5'),'content':'','variableName':_0x5b27('0x9')});break;}}return _0x80abe6;};exports['getDescriptions']=function(_0x1e0350,_0x3c4a63){var _0x2d206f=[];switch(_0x1e0350[_0x5b27('0x2')]()){case _0x5b27('0x3'):switch(_0x3c4a63[_0x5b27('0x2')]()){case _0x5b27('0x4'):_0x2d206f=[{'type':_0x5b27('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x5b27('0xa'),'keyType':_0x5b27('0x5'),'variableName':_0x5b27('0xb')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0xd'),'keyType':_0x5b27('0x5'),'variableName':'calleridname'},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0xe'),'keyType':'variable','variableName':_0x5b27('0xf')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x10'),'keyType':_0x5b27('0x5'),'variableName':_0x5b27('0x6')},{'type':_0x5b27('0xc'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0x5b27('0x11')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x12'),'keyType':_0x5b27('0x5'),'variableName':_0x5b27('0x13')},{'type':_0x5b27('0x1'),'content':_0x5b27('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x15'),'keyType':_0x5b27('0x5'),'variableName':_0x5b27('0x16')},{'type':_0x5b27('0xc'),'content':'','key':'Agent\x20Number','keyType':_0x5b27('0x5'),'variableName':_0x5b27('0x9')},{'type':_0x5b27('0x1'),'content':_0x5b27('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x5b27('0x18'),'keyType':_0x5b27('0x5'),'variableName':_0x5b27('0x13')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x19'),'keyType':_0x5b27('0x5'),'variableName':_0x5b27('0x1a')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x1b'),'keyType':_0x5b27('0x5'),'variableName':_0x5b27('0x1c')},{'type':'keyValue','content':'','key':_0x5b27('0x1d'),'keyType':'variable','variableName':_0x5b27('0x1e')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x1f'),'keyType':'variable','variableName':'talktime'}];break;case _0x5b27('0x20'):_0x2d206f=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x21'),'keyType':_0x5b27('0x5'),'keyContent':'','variableName':_0x5b27('0x9')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x22'),'keyType':'variable','keyContent':'','variableName':_0x5b27('0x23')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x24'),'keyType':_0x5b27('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0x5b27('0xc'),'content':'','key':'Date','keyType':_0x5b27('0x5'),'keyContent':'','variableName':_0x5b27('0x25')},{'type':_0x5b27('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x5b27('0x26'),'keyType':_0x5b27('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0x5b27('0xc'),'content':'','key':'Complete\x20Time','keyType':_0x5b27('0x5'),'keyContent':'','variableName':_0x5b27('0x27')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x28'),'keyType':_0x5b27('0x5'),'keyContent':'','variableName':_0x5b27('0x29')},{'type':_0x5b27('0xc'),'content':'','key':_0x5b27('0x2a'),'keyType':_0x5b27('0x5'),'keyContent':'','variableName':_0x5b27('0x2b')}];break;}}return _0x2d206f;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 2adfb2c..f8ac537 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8999=['resolve','getInteractionsQuery','then','search','parseQueryParameters','where','contact','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','ids','length','count','clause','order','DESC','getClosedOrderClause','rows','catch','tracked','query','clone','body','omit','html','phone','fax','mobile','updateUser','./sql-utils','./utils','findAll','skipInteractionsQuery'];(function(_0x50c154,_0x4e08a2){var _0x23aad4=function(_0xb549c1){while(--_0xb549c1){_0x50c154['push'](_0x50c154['shift']());}};_0x23aad4(++_0x4e08a2);}(_0x8999,0x10d));var _0x9899=function(_0x1a6c7f,_0x5aee3f){_0x1a6c7f=_0x1a6c7f-0x0;var _0x1d378d=_0x8999[_0x1a6c7f];return _0x1d378d;};'use strict';var _=require('lodash');var sqlUtils=require(_0x9899('0x0'));var utils=require(_0x9899('0x1'));exports[_0x9899('0x2')]=function(_0x3bd4f8,_0x4887fb,_0x2e4592,_0x1440d5,_0x1aea69){var _0x5a5c19={'count':0x0,'rows':[]};var _0x1735a3=sqlUtils[_0x9899('0x3')](_0x3bd4f8,_0x2e4592,_0x4887fb);if(_0x1735a3){return Promise[_0x9899('0x4')](_0x5a5c19);}var _0x376792=sqlUtils[_0x9899('0x5')](_0x3bd4f8);var _0x50f916={};return Promise['resolve']()[_0x9899('0x6')](function(){if(_0x4887fb[_0x9899('0x7')]){return sqlUtils['parseAdvancedSearchFilter'](_0x4887fb[_0x9899('0x7')],_0x1aea69);}else{return sqlUtils[_0x9899('0x8')](_0x3bd4f8,_0x4887fb,_0x1aea69);}})[_0x9899('0x6')](function(_0x4e69db){_0x376792[_0x9899('0x9')](_0x4e69db['body']);_0x376792['where'](_0x4e69db[_0x9899('0xa')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xb')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xc')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xd')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xe')]);_0x376792[_0x9899('0xf')](_0x4e69db[_0x9899('0x10')]);_0x50f916=_0x4e69db[_0x9899('0x11')];return sqlUtils[_0x9899('0x12')](_0x3bd4f8,_0x2e4592,_0x4887fb);})[_0x9899('0x6')](function(_0x2123ba){_0x376792[_0x9899('0x9')](_0x2123ba);_0x376792[_0x9899('0x13')]('i.id');var _0x23e3d0=_0x4887fb[_0x9899('0x7')]?_0x50f916[_0x9899('0x14')]:_0x4887fb['tag'];return sqlUtils['countFilteredInteractions'](_0x376792,_0x23e3d0);})[_0x9899('0x6')](function(_0x5ca047){_0x5a5c19['count']=_0x5ca047[_0x9899('0x15')];if(_0x5a5c19[_0x9899('0x16')]===0x0){return[];}_0x376792['having'](_0x50f916[_0x9899('0x17')]);if(_0x1440d5[_0x9899('0x18')]){_0x1440d5[_0x9899('0x18')]['forEach'](function(_0x4782a4){var _0xb59629=_0x4782a4[0x0]==='contactName'?_0x4782a4[0x0]:'i.'+_0x4782a4[0x0];_0x376792[_0x9899('0x18')](_0xb59629,_0x4782a4[0x1]===_0x9899('0x19')?![]:!![]);if(_0x4782a4[0x0]==='closed'){var _0x5361df=sqlUtils[_0x9899('0x1a')](_0x3bd4f8,_0x4887fb);_0x376792[_0x9899('0x18')](_0x5361df,_0x4782a4[0x1]===_0x9899('0x19')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x3bd4f8,_0x376792,_0x4887fb,_0x1440d5);})[_0x9899('0x6')](function(_0x1831eb){_0x5a5c19[_0x9899('0x1b')]=_0x1831eb;return _0x5a5c19;})[_0x9899('0x1c')](function(_0x1a78d0){throw _0x1a78d0;});};exports[_0x9899('0x1d')]=function(_0x365b22,_0x290eaf){return function(_0x438db1,_0x2aa54c,_0x49b482){var _0x2a41ce=_0x438db1[_0x9899('0xe')];var _0x4e9f75={};var _0x31c217=_0x438db1[_0x9899('0x1e')];if(_0x4e9f75){_0x4e9f75=_[_0x9899('0x1f')](_0x438db1[_0x9899('0x20')]);_0x4e9f75=_[_0x9899('0x21')](_0x4e9f75,[_0x9899('0x20'),_0x9899('0x22'),_0x9899('0x23'),_0x9899('0x24'),_0x9899('0x25')]);}utils[_0x9899('0x26')](_0x2a41ce,_0x4e9f75,_0x31c217,_0x365b22,_0x290eaf);_0x49b482(null);};}; \ No newline at end of file +var _0x9390=['omit','html','phone','fax','mobile','lodash','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseQueryParameters','where','body','contact','default','fields','filter','user','read','tags','checkAccountsRestrictions','group','i.id','tag','countFilteredInteractions','count','length','clause','order','forEach','contactName','closed','getClosedOrderClause','DESC','getFilteredInteractions','rows','catch','tracked'];(function(_0x5bdabb,_0x1b20f2){var _0x252348=function(_0x5175d0){while(--_0x5175d0){_0x5bdabb['push'](_0x5bdabb['shift']());}};_0x252348(++_0x1b20f2);}(_0x9390,0x195));var _0x0939=function(_0xa4e3c9,_0x389612){_0xa4e3c9=_0xa4e3c9-0x0;var _0x5b2725=_0x9390[_0xa4e3c9];return _0x5b2725;};'use strict';var _=require(_0x0939('0x0'));var sqlUtils=require('./sql-utils');var utils=require('./utils');exports[_0x0939('0x1')]=function(_0xa223b7,_0x41f55a,_0x84b90a,_0x6ad0db,_0x7e3299){var _0x985edf={'count':0x0,'rows':[]};var _0x5cb8bd=sqlUtils[_0x0939('0x2')](_0xa223b7,_0x84b90a,_0x41f55a);if(_0x5cb8bd){return Promise[_0x0939('0x3')](_0x985edf);}var _0x2718b3=sqlUtils[_0x0939('0x4')](_0xa223b7);var _0x496dc0={};return Promise[_0x0939('0x3')]()[_0x0939('0x5')](function(){if(_0x41f55a[_0x0939('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x41f55a[_0x0939('0x6')],_0x7e3299);}else{return sqlUtils[_0x0939('0x7')](_0xa223b7,_0x41f55a,_0x7e3299);}})[_0x0939('0x5')](function(_0x5511b1){_0x2718b3[_0x0939('0x8')](_0x5511b1[_0x0939('0x9')]);_0x2718b3[_0x0939('0x8')](_0x5511b1[_0x0939('0xa')]);_0x2718b3['where'](_0x5511b1[_0x0939('0xb')]);_0x2718b3[_0x0939('0x8')](_0x5511b1[_0x0939('0xc')]);_0x2718b3[_0x0939('0x8')](_0x5511b1[_0x0939('0xd')]);_0x2718b3[_0x0939('0x8')](_0x5511b1[_0x0939('0xe')]);_0x2718b3['having'](_0x5511b1[_0x0939('0xf')]);_0x496dc0=_0x5511b1[_0x0939('0x10')];return sqlUtils[_0x0939('0x11')](_0xa223b7,_0x84b90a,_0x41f55a);})[_0x0939('0x5')](function(_0x48e506){_0x2718b3['where'](_0x48e506);_0x2718b3[_0x0939('0x12')](_0x0939('0x13'));var _0x6f2593=_0x41f55a[_0x0939('0x6')]?_0x496dc0['ids']:_0x41f55a[_0x0939('0x14')];return sqlUtils[_0x0939('0x15')](_0x2718b3,_0x6f2593);})[_0x0939('0x5')](function(_0x500497){_0x985edf[_0x0939('0x16')]=_0x500497[_0x0939('0x17')];if(_0x985edf[_0x0939('0x16')]===0x0){return[];}_0x2718b3['having'](_0x496dc0[_0x0939('0x18')]);if(_0x6ad0db[_0x0939('0x19')]){_0x6ad0db[_0x0939('0x19')][_0x0939('0x1a')](function(_0x581968){var _0x25af92=_0x581968[0x0]===_0x0939('0x1b')?_0x581968[0x0]:'i.'+_0x581968[0x0];_0x2718b3[_0x0939('0x19')](_0x25af92,_0x581968[0x1]==='DESC'?![]:!![]);if(_0x581968[0x0]===_0x0939('0x1c')){var _0xc7f5ad=sqlUtils[_0x0939('0x1d')](_0xa223b7,_0x41f55a);_0x2718b3['order'](_0xc7f5ad,_0x581968[0x1]===_0x0939('0x1e')?![]:!![]);}});}return sqlUtils[_0x0939('0x1f')](_0xa223b7,_0x2718b3,_0x41f55a,_0x6ad0db);})[_0x0939('0x5')](function(_0x908fe9){_0x985edf[_0x0939('0x20')]=_0x908fe9;return _0x985edf;})[_0x0939('0x21')](function(_0x32f14d){throw _0x32f14d;});};exports[_0x0939('0x22')]=function(_0x67e040,_0x339279){return function(_0x5ccba6,_0x5a6316,_0x1ac25f){var _0x34ce78=_0x5ccba6[_0x0939('0xe')];var _0x216ce8={};var _0x240abc=_0x5ccba6['query'];if(_0x216ce8){_0x216ce8=_['clone'](_0x5ccba6[_0x0939('0x9')]);_0x216ce8=_[_0x0939('0x23')](_0x216ce8,[_0x0939('0x9'),_0x0939('0x24'),_0x0939('0x25'),_0x0939('0x26'),_0x0939('0x27')]);}utils['updateUser'](_0x34ce78,_0x216ce8,_0x240abc,_0x67e040,_0x339279);_0x1ac25f(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index da86b82..151403a 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bd8=['whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','value','start','end','and','operator','$substring','split','contact','ContactId','tags','clause','ids','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','plainBody','keys','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','unshift','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.substatus','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','toString','groupBy','Setting','enableEmailPreview','all','clone','isEmpty','t.id\x20IN\x20?','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','accounts','a.id\x20=\x20i.','messages','me.','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','sms'];(function(_0x2eddea,_0x5711d0){var _0x5827d6=function(_0x47e621){while(--_0x47e621){_0x2eddea['push'](_0x2eddea['shift']());}};_0x5827d6(++_0x5711d0);}(_0x8bd8,0x6d));var _0x88bd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8bd8[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x88bd('0x0'));var squel=require(_0x88bd('0x1'));var as=require(_0x88bd('0x2'));var qs=require(_0x88bd('0x3'));var updateInteraction=require(_0x88bd('0x4'))['updateInteraction'];var utils=require(_0x88bd('0x5'));var db=require(_0x88bd('0x6'))['db'];function skipInteractionsQuery(_0x13a704,_0x31f016,_0x3f638e){var _0x3be59d=![];var _0x24f3d0=utils[_0x88bd('0x7')](_0x13a704);if(_0x31f016[_0x88bd('0x8')]===_0x88bd('0x9')&&!_0x3f638e[_0x88bd('0xa')]&&!_0x3f638e[_0x24f3d0]){_0x3be59d=!![];}return _0x3be59d;}function getTagsQuery(){return squel[_0x88bd('0xb')]()['field']('id')[_0x88bd('0xc')](_0x88bd('0xd'))[_0x88bd('0xc')](_0x88bd('0xe'))[_0x88bd('0xf')](_0x88bd('0x10'));}function getUsersQuery(_0x5e4431,_0x4fda0e){var _0x469f8e=utils[_0x88bd('0x11')](_0x5e4431);var _0x55c3d6='user_has_'+_0x5e4431+_0x88bd('0x12');var _0x50b021=squel[_0x88bd('0xb')]()['field'](_0x88bd('0x13'))[_0x88bd('0xc')](_0x88bd('0x14'))[_0x88bd('0xc')](_0x88bd('0x15')+_0x469f8e)[_0x88bd('0xf')](_0x55c3d6,'ui')[_0x88bd('0x16')](_0x88bd('0x17'),'u',_0x88bd('0x18'));if(_0x4fda0e[_0x88bd('0x19')]>0x0){_0x50b021[_0x88bd('0x1a')](_0x88bd('0x15')+_0x469f8e+_0x88bd('0x1b'),_[_0x88bd('0x1c')](_0x4fda0e,'id'));}return _0x50b021;}function getInteractionsQuery(_0x81af2a){var _0x230f50=utils[_0x88bd('0x1d')](_0x81af2a);var _0xbecee8=utils[_0x88bd('0x7')](_0x81af2a);var _0x56f5d8=utils[_0x88bd('0x11')](_0x81af2a);return squel['select']()[_0x88bd('0xf')](_0x230f50[_0x88bd('0x1e')],'i')[_0x88bd('0x16')](_0x88bd('0x1f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x88bd('0x17'),'o','o.id\x20=\x20i.UserId')[_0x88bd('0x16')](_0x230f50[_0x88bd('0x20')],'a',_0x88bd('0x21')+_0xbecee8)[_0x88bd('0x16')](_0x230f50[_0x88bd('0x22')],'me',_0x88bd('0x23')+_0x56f5d8+'\x20=\x20i.id')[_0x88bd('0x16')](_0x230f50['interactionsTags'],'it',_0x88bd('0x24')+_0x56f5d8+'\x20=\x20i.id')[_0x88bd('0x16')]('tools_tags','t',_0x88bd('0x25'));}function getSqlClauses(){var _0x102655={'body':squel[_0x88bd('0x26')](),'contact':squel['expr'](),'default':squel[_0x88bd('0x26')](),'fields':squel[_0x88bd('0x26')](),'filter':squel[_0x88bd('0x26')](),'read':squel[_0x88bd('0x26')](),'tags':{'clause':squel[_0x88bd('0x26')](),'ids':null},'user':squel['expr']()};return _0x102655;}function parseTagParameter(_0x3489ec){var _0x14f004=squel[_0x88bd('0x26')]();if(_0x3489ec){var _0x3a2e15=utils[_0x88bd('0x27')](_0x3489ec);_0x3a2e15[_0x88bd('0x28')](function(_0x11d0cc){_0x14f004['or'](_0x88bd('0x29'),'%,'+_0x11d0cc+',%');});}return _0x14f004;}function parseReadParameter(_0x59dbcd){var _0x13fe7d='';if(_0x59dbcd){_0x13fe7d='unreadMessages\x20{OPERATOR}\x200';if(_0x59dbcd==='1'){_0x13fe7d=_0x13fe7d[_0x88bd('0x2a')](_0x88bd('0x2b'),'=');}else{_0x13fe7d=_0x13fe7d[_0x88bd('0x2a')](_0x88bd('0x2b'),'>');}}return _0x13fe7d;}function parseSearchFilter(_0x33a636,_0x45d492){var _0x34fd38=squel[_0x88bd('0x26')]();if(_0x45d492){var _0x10cfa0=_0x45d492[_0x88bd('0x2a')]('\x5c','\x5c\x5c')[_0x88bd('0x2a')](/'/g,'\x27\x27');if(qs[_0x88bd('0x2c')](_0x10cfa0)){_0x34fd38['or']('i.id\x20LIKE\x20?',_0x10cfa0+'%');if([_0x88bd('0x2d'),_0x88bd('0x2e')]['includes'](_0x33a636)){_0x34fd38['or'](_0x88bd('0x2f'),_0x10cfa0+'%');}else if(_0x33a636===_0x88bd('0x30')){_0x34fd38['or'](_0x88bd('0x31'),_0x10cfa0+'%');}else if(_0x33a636==='openchannel'){_0x34fd38['or'](_0x88bd('0x32'),_0x10cfa0+'%');}}else if(_0x33a636===_0x88bd('0x33')&&qs[_0x88bd('0x34')](_0x10cfa0)){_0x34fd38['or']('c.email\x20LIKE\x20?',_0x10cfa0+'%');}else{if(_0x33a636===_0x88bd('0x33')){_0x34fd38['or'](_0x88bd('0x35'),qs[_0x88bd('0x36')](_0x10cfa0,!![]))['or'](_0x88bd('0x37'),qs['getFullTextValue'](_0x10cfa0));}else if(_0x33a636!==_0x88bd('0x30')){_0x34fd38['or'](_0x88bd('0x38'),qs[_0x88bd('0x36')](_0x10cfa0));}_0x34fd38['or'](_0x88bd('0x39'),qs[_0x88bd('0x36')](_0x10cfa0,!![]),null);}}return _0x34fd38;}function parseAdvancedSearchFilter(_0x2e0507,_0xb37532){var _0x2bcd41=getSqlClauses();var _0x2d77bd=as[_0x88bd('0x3a')](_0x2e0507);var _0x435149=_0x2d77bd[_0x88bd('0x3b')];for(var _0x10931d=0x0;_0x10931d<_0x2d77bd[_0x88bd('0x3c')][_0x88bd('0x19')];_0x10931d++){var _0x461521=_0x2d77bd['conditions'][_0x10931d];var _0x59b68d='i';var _0x1596cd=_[_0x88bd('0x3d')](_0xb37532,[_0x88bd('0xd'),_0x461521[_0x88bd('0xc')]]);if(_0x1596cd){var _0x458c8c=as[_0x88bd('0x3e')](_0x59b68d,_0x1596cd[_0x88bd('0x3f')],_0x461521);_0x2bcd41[_0x88bd('0x40')][_0x435149](_0x458c8c[_0x88bd('0x41')],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x43')],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x44')]);}else{switch(_0x461521[_0x88bd('0xc')]){case'unreadMessages':var _0x272eb1=parseReadParameter(_0x461521[_0x88bd('0x42')]);_0x2bcd41['read'][_0x88bd('0x45')](_0x272eb1);break;case'Contact':if(_0x461521[_0x88bd('0x46')]===_0x88bd('0x47')){if(_0x461521[_0x88bd('0x42')][_0x88bd('0x48')]('\x20')[_0x88bd('0x19')]>0x1){_0x2bcd41[_0x88bd('0x49')][_0x435149](_0x88bd('0x39'),qs[_0x88bd('0x36')](_0x461521['value'],!![]),null);}else{var _0x2a1e9e='%'+_0x461521[_0x88bd('0x42')]+'%';_0x2bcd41['contact'][_0x435149]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2a1e9e,_0x2a1e9e,_0x2a1e9e);}}else{_0x1596cd=_['find'](_0xb37532,[_0x88bd('0xd'),_0x88bd('0x4a')]);_0x461521[_0x88bd('0xc')]=_0x88bd('0x4a');_0x458c8c=as[_0x88bd('0x3e')](_0x59b68d,_0x1596cd[_0x88bd('0x3f')],_0x461521);_0x2bcd41[_0x88bd('0x49')][_0x435149](_0x458c8c[_0x88bd('0x41')],_0x458c8c[_0x88bd('0x42')]['start'],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x44')]);}break;case'Tag':var _0x59a7d0=_0x461521[_0x88bd('0x42')]['split'](',')['map'](function(_0x19e3fe){return Number(_0x19e3fe);});var _0x507b4c=parseTagParameter(_0x59a7d0);_0x2bcd41[_0x88bd('0x4b')][_0x88bd('0x4c')][_0x88bd('0x45')](_0x507b4c);_0x2bcd41[_0x88bd('0x4b')][_0x88bd('0x4d')]=_0x59a7d0;break;case'User':if(_0x461521[_0x88bd('0x46')]===_0x88bd('0x47')){_0x2bcd41['user'][_0x435149](_0x88bd('0x4e'),'%'+_0x461521[_0x88bd('0x42')]+'%',null);}else{_0x1596cd=_[_0x88bd('0x3d')](_0xb37532,['name',_0x88bd('0x4f')]);_0x461521['field']=_0x88bd('0x4f');_0x458c8c=as[_0x88bd('0x3e')](_0x59b68d,_0x1596cd['type'],_0x461521);_0x2bcd41[_0x88bd('0x50')][_0x435149](_0x458c8c[_0x88bd('0x41')],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x43')],_0x458c8c[_0x88bd('0x42')]['end']);}break;case _0x88bd('0x51'):case _0x88bd('0x52'):_0x458c8c=as[_0x88bd('0x3e')]('me',null,_0x461521);_0x2bcd41[_0x88bd('0x51')][_0x435149](_0x458c8c['text'],_0x458c8c[_0x88bd('0x42')]['start'],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x44')]);break;}}}return _0x2bcd41;}function parseModelFields(_0x4e3fc9,_0x999175,_0x1b6cd7){var _0x51a56c=utils[_0x88bd('0x7')](_0x4e3fc9);var _0x352b40=squel[_0x88bd('0x26')]();var _0x116647=_(_0x999175)[_0x88bd('0x53')]()[_0x88bd('0x1c')](function(_0x48b576){return _['some'](_0x1b6cd7,['name',_0x48b576])?_0x48b576:undefined;})['compact']()[_0x88bd('0x42')]();if(_0x116647['length']>0x0){_0x116647[_0x88bd('0x28')](function(_0xc0aeda){if(_0xc0aeda===_0x51a56c){_0x352b40[_0x88bd('0x45')]('i.'+_0x51a56c+_0x88bd('0x1b'),[]['concat'](_0x999175[_0xc0aeda]));}else if(_0xc0aeda==='createdAt'){var _0x49456d=JSON[_0x88bd('0x54')](_0x999175[_0xc0aeda])[_0x88bd('0x55')];var _0x3fdc6b=JSON[_0x88bd('0x54')](_0x999175[_0xc0aeda])[_0x88bd('0x56')];_0x352b40[_0x88bd('0x45')](_0x88bd('0x57'),_0x49456d,_0x3fdc6b);}else{if(_0x999175[_0xc0aeda]===_0x88bd('0x58')){_0x352b40[_0x88bd('0x45')]('i.'+_0xc0aeda+_0x88bd('0x59'));}else{_0x352b40['and']('i.'+_0xc0aeda+_0x88bd('0x5a'),_0x999175[_0xc0aeda]);}}});}return _0x352b40;}function parseQueryParameters(_0x2f26ea,_0x3202e3,_0x4e7f08){var _0x1e80aa=getSqlClauses();return Promise[_0x88bd('0x5b')]()[_0x88bd('0x5c')](function(){return parseModelFields(_0x2f26ea,_0x3202e3,_0x4e7f08);})[_0x88bd('0x5c')](function(_0xa546a8){_0x1e80aa[_0x88bd('0x5d')][_0x88bd('0x45')](_0xa546a8);return parseReadParameter(_0x3202e3[_0x88bd('0x5e')]);})[_0x88bd('0x5c')](function(_0xc25e38){_0x1e80aa[_0x88bd('0x5e')]['and'](_0xc25e38);return parseTagParameter(_0x3202e3['tag']);})[_0x88bd('0x5c')](function(_0x24bb33){_0x1e80aa[_0x88bd('0x4b')][_0x88bd('0x4c')][_0x88bd('0x45')](_0x24bb33);return parseSearchFilter(_0x2f26ea,_0x3202e3['filter']);})[_0x88bd('0x5c')](function(_0x51e67e){_0x1e80aa['filter']=_0x51e67e;return _0x1e80aa;});}function checkAccountsRestrictions(_0xbf6406,_0x10b872,_0x4d682b){var _0x704b76=utils['getAccountFK'](_0xbf6406);var _0xa17eb9=_0x88bd('0x5f')+_[_0x88bd('0x60')](_0xbf6406)+(_0xbf6406===_0x88bd('0x61')?_0x88bd('0x62'):_0x88bd('0x63'));var _0x5f23ba=squel[_0x88bd('0x26')]();return Promise['resolve']()[_0x88bd('0x5c')](function(){if(_0x4d682b[_0x88bd('0xa')]&&_0x10b872[_0x88bd('0x8')]===_0x88bd('0x9')){return _0x10b872[_0xa17eb9]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x5a4182){if(_0x5a4182){if(_0x5a4182[_0x88bd('0x19')]===0x0){_0x5f23ba[_0x88bd('0x45')]('i.'+_0x704b76+_0x88bd('0x59'));}else{_0x5f23ba['and']('i.'+_0x704b76+_0x88bd('0x1b'),_[_0x88bd('0x1c')](_0x5a4182,'id'));}}else if(!_0x4d682b[_0x704b76]){_0x5f23ba[_0x88bd('0x45')]('i.'+_0x704b76+_0x88bd('0x64'));}})['then'](function(){return _0x5f23ba;});}function getClosedOrderClause(_0x45560b,_0x4677af){var _0x5abb44='';var _0x3681cb=['i.thirdDisposition','i.secondDisposition','i.disposition'];if(_0x45560b===_0x88bd('0x33')){_0x3681cb[_0x88bd('0x65')]('i.substatus');}if(_0x4677af['closed']==='0'&&_0x45560b===_0x88bd('0x33')){_0x5abb44='i.substatus';}else{if(_0x4677af[_0x88bd('0x66')]==='1'){_0x3681cb['shift']();}_0x5abb44=_0x88bd('0x67')+_0x3681cb[_0x88bd('0x68')](',\x20')+')';}return _0x5abb44;}function getFilteredInteractions(_0x1d0003,_0x1275e6,_0xd90c1c,_0x1a327a){var _0x17d1ef=utils[_0x88bd('0x11')](_0x1d0003);var _0x10cf60=_[_0x88bd('0x60')](_0x1d0003)+_0x88bd('0x69');var _0xf6ad1=[];var _0x424dd0=getTagsQuery();var _0x25e30f={'type':db[_0x88bd('0x6a')][_0x88bd('0x6b')][_0x88bd('0x6c')],'raw':!![]};var _0x3d9475=[];var _0x136d4f=[];return db[_0x88bd('0x6d')]['query'](_0x424dd0['toString'](),_0x25e30f)[_0x88bd('0x5c')](function(_0x269d35){_0xf6ad1=_['keyBy'](_0x269d35,'id');_0x25e30f=_[_0x88bd('0x6e')](_0x25e30f,{'model':db[_0x10cf60],'mapToModel':!![],'nest':!![]});if(_0xd90c1c['fields']){_0x1a327a['attributes'][_0x88bd('0x28')](function(_0x4c02aa){_0x1275e6[_0x88bd('0xc')]('i.'+_0x4c02aa);});}else{_0x1275e6[_0x88bd('0xc')](_0x88bd('0x6f'),_0x88bd('0x70'));_0x1275e6[_0x88bd('0xc')]('a.key','Account.key');_0x1275e6['field']('a.mandatoryDisposition',_0x88bd('0x71'));if(_0x1d0003===_0x88bd('0x33')){_0x1275e6[_0x88bd('0xc')](_0x88bd('0x72'),_0x88bd('0x73'));_0x1275e6['field'](_0x88bd('0x74'),_0x88bd('0x75'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x76'));_0x1275e6[_0x88bd('0xc')]('i.createdAt');_0x1275e6[_0x88bd('0xc')](_0x88bd('0x77'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x78'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x79'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7a'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7b'));_0x1275e6['field']('i.lastMsgDirection');_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7c'));_0x1275e6['field']('i.disposition');_0x1275e6['field']('i.secondDisposition');_0x1275e6[_0x88bd('0xc')]('i.thirdDisposition');_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7d'));_0x1275e6[_0x88bd('0xc')]('i.to');_0x1275e6[_0x88bd('0xc')]('i.ContactId');_0x1275e6['field'](_0x88bd('0x7e'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7f'));}else if(_0x1d0003===_0x88bd('0x80')){_0x1275e6['field'](_0x88bd('0x81'),_0x88bd('0x75'));}else{_0x1275e6['field'](_0x88bd('0x82'),_0x88bd('0x75'));}if(_0x1d0003!==_0x88bd('0x33')){_0x1275e6[_0x88bd('0xc')](_0x88bd('0x83'));}_0x1275e6[_0x88bd('0xc')](_0x88bd('0x84'),_0x88bd('0x85'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x86'),_0x88bd('0x87'));_0x1275e6['field'](_0x88bd('0x88'),'Contact.email');_0x1275e6['field'](_0x88bd('0x89'),_0x88bd('0x8a'));_0x1275e6[_0x88bd('0xc')]('c.mobile',_0x88bd('0x8b'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x8c'),'Contact.fax');_0x1275e6[_0x88bd('0xc')]('o.fullname','Owner.fullname');_0x1275e6[_0x88bd('0xc')]('o.internal',_0x88bd('0x8d'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x8e'),_0x88bd('0x8f'));}if(_0x1a327a['limit']){_0x1275e6[_0x88bd('0x90')](_0x1a327a[_0x88bd('0x90')]);}if(_0x1a327a[_0x88bd('0x91')]){_0x1275e6['offset'](_0x1a327a[_0x88bd('0x91')]);}return db['sequelize'][_0x88bd('0x92')](_0x1275e6[_0x88bd('0x93')](),_0x25e30f);})[_0x88bd('0x5c')](function(_0x13a816){_0x3d9475=_0x13a816;var _0x406216=getUsersQuery(_0x1d0003,_0x3d9475);return db[_0x88bd('0x6d')][_0x88bd('0x92')](_0x406216[_0x88bd('0x93')](),_0x25e30f);})['then'](function(_0x1ffe90){_0x136d4f=_[_0x88bd('0x94')](_0x1ffe90,_0x17d1ef);if(_0x1d0003==='mail'){return db[_0x88bd('0x95')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x88bd('0x5c')](function(_0x1aae94){var _0x142af5=_0x1aae94?_0x1aae94[_0x88bd('0x96')]:undefined;var _0x342c8b=_0x3d9475[_0x88bd('0x1c')](function(_0x1f7735){return updateInteraction(_0x1f7735,_0xf6ad1,_0x136d4f,_0x142af5);});return Promise[_0x88bd('0x97')](_0x342c8b);});}function countFilteredInteractions(_0x479baf,_0x54f0db){var _0x55a200=_0x479baf[_0x88bd('0x98')]();_0x55a200['field']('COUNT(*)');_0x55a200[_0x88bd('0xc')](_0x88bd('0x6f'),'unreadMessages');var _0x1d05a0=utils[_0x88bd('0x27')](_0x54f0db);if(!_[_0x88bd('0x99')](_0x1d05a0)){_0x55a200[_0x88bd('0x1a')](_0x88bd('0x9a'),_0x1d05a0);}var _0x40c670={'type':db[_0x88bd('0x6a')][_0x88bd('0x6b')][_0x88bd('0x6c')],'raw':!![]};return db['sequelize'][_0x88bd('0x92')](_0x55a200[_0x88bd('0x93')](),_0x40c670);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x0f33=['messages','me.','\x20=\x20i.id','it.','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','length','find','buildExpression','default','text','value','start','end','unreadMessages','read','and','Contact','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','split','tags','clause','ids','User','operator','user','UserId','body','plainBody','keys','some','compact','\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','tag','filter','capitalize','chat','Websites','search','role','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','Interaction','Sequelize','QueryTypes','sequelize','query','toString','keyBy','fields','attributes','forEach','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','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','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','SELECT','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','getAccountFK','agent','select','field','name','color','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','ui.','from','left_join','where','map','interactions','cm_contacts','users','accounts','a.id\x20=\x20i.'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0x0f33,0x1dd));var _0x30f3=function(_0x5e618d,_0x28527e){_0x5e618d=_0x5e618d-0x0;var _0x24a942=_0x0f33[_0x5e618d];return _0x24a942;};'use strict';var _=require(_0x30f3('0x0'));var squel=require(_0x30f3('0x1'));var as=require(_0x30f3('0x2'));var qs=require(_0x30f3('0x3'));var updateInteraction=require(_0x30f3('0x4'))['updateInteraction'];var utils=require(_0x30f3('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x4ea91a,_0x5e61e8,_0x55f7ee){var _0x50bb57=![];var _0x2f50f7=utils[_0x30f3('0x6')](_0x4ea91a);if(_0x5e61e8['role']===_0x30f3('0x7')&&!_0x55f7ee['search']&&!_0x55f7ee[_0x2f50f7]){_0x50bb57=!![];}return _0x50bb57;}function getTagsQuery(){return squel[_0x30f3('0x8')]()[_0x30f3('0x9')]('id')[_0x30f3('0x9')](_0x30f3('0xa'))['field'](_0x30f3('0xb'))['from'](_0x30f3('0xc'));}function getUsersQuery(_0x51f1f2,_0x23454d){var _0x53afbb=utils[_0x30f3('0xd')](_0x51f1f2);var _0x935a39=_0x30f3('0xe')+_0x51f1f2+'_interactions';var _0x782c8e=squel[_0x30f3('0x8')]()[_0x30f3('0x9')](_0x30f3('0xf'))['field'](_0x30f3('0x10'))[_0x30f3('0x9')](_0x30f3('0x11')+_0x53afbb)[_0x30f3('0x12')](_0x935a39,'ui')[_0x30f3('0x13')]('users','u','u.id\x20=\x20ui.UserId');if(_0x23454d['length']>0x0){_0x782c8e[_0x30f3('0x14')](_0x30f3('0x11')+_0x53afbb+'\x20IN\x20?',_[_0x30f3('0x15')](_0x23454d,'id'));}return _0x782c8e;}function getInteractionsQuery(_0x39b2b4){var _0x1ad207=utils['getInteractionsTables'](_0x39b2b4);var _0x27a603=utils[_0x30f3('0x6')](_0x39b2b4);var _0x1c4072=utils[_0x30f3('0xd')](_0x39b2b4);return squel[_0x30f3('0x8')]()[_0x30f3('0x12')](_0x1ad207[_0x30f3('0x16')],'i')[_0x30f3('0x13')](_0x30f3('0x17'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x30f3('0x18'),'o','o.id\x20=\x20i.UserId')[_0x30f3('0x13')](_0x1ad207[_0x30f3('0x19')],'a',_0x30f3('0x1a')+_0x27a603)[_0x30f3('0x13')](_0x1ad207[_0x30f3('0x1b')],'me',_0x30f3('0x1c')+_0x1c4072+_0x30f3('0x1d'))[_0x30f3('0x13')](_0x1ad207['interactionsTags'],'it',_0x30f3('0x1e')+_0x1c4072+'\x20=\x20i.id')[_0x30f3('0x13')](_0x30f3('0xc'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x221fba={'body':squel[_0x30f3('0x1f')](),'contact':squel['expr'](),'default':squel['expr'](),'fields':squel[_0x30f3('0x1f')](),'filter':squel['expr'](),'read':squel[_0x30f3('0x1f')](),'tags':{'clause':squel[_0x30f3('0x1f')](),'ids':null},'user':squel[_0x30f3('0x1f')]()};return _0x221fba;}function parseTagParameter(_0x3fd5f1){var _0x2c94ce=squel[_0x30f3('0x1f')]();if(_0x3fd5f1){var _0x1bf29a=utils[_0x30f3('0x20')](_0x3fd5f1);_0x1bf29a['forEach'](function(_0x429529){_0x2c94ce['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x429529+',%');});}return _0x2c94ce;}function parseReadParameter(_0x13fa48){var _0x51c4fd='';if(_0x13fa48){_0x51c4fd=_0x30f3('0x21');if(_0x13fa48==='1'){_0x51c4fd=_0x51c4fd[_0x30f3('0x22')](_0x30f3('0x23'),'=');}else{_0x51c4fd=_0x51c4fd[_0x30f3('0x22')]('{OPERATOR}','>');}}return _0x51c4fd;}function parseSearchFilter(_0xc83fef,_0x41641f){var _0x4da34d=squel['expr']();if(_0x41641f){var _0x49ffea=_0x41641f[_0x30f3('0x22')]('\x5c','\x5c\x5c')[_0x30f3('0x22')](/'/g,'\x27\x27');if(qs[_0x30f3('0x24')](_0x49ffea)){_0x4da34d['or'](_0x30f3('0x25'),_0x49ffea+'%');if([_0x30f3('0x26'),_0x30f3('0x27')][_0x30f3('0x28')](_0xc83fef)){_0x4da34d['or'](_0x30f3('0x29'),_0x49ffea+'%');}else if(_0xc83fef===_0x30f3('0x2a')){_0x4da34d['or'](_0x30f3('0x2b'),_0x49ffea+'%');}else if(_0xc83fef===_0x30f3('0x2c')){_0x4da34d['or'](_0x30f3('0x2d'),_0x49ffea+'%');}}else if(_0xc83fef===_0x30f3('0x2e')&&qs[_0x30f3('0x2f')](_0x49ffea)){_0x4da34d['or']('c.email\x20LIKE\x20?',_0x49ffea+'%');}else{if(_0xc83fef===_0x30f3('0x2e')){_0x4da34d['or'](_0x30f3('0x30'),qs[_0x30f3('0x31')](_0x49ffea,!![]))['or'](_0x30f3('0x32'),qs[_0x30f3('0x31')](_0x49ffea));}else if(_0xc83fef!==_0x30f3('0x2a')){_0x4da34d['or'](_0x30f3('0x33'),qs[_0x30f3('0x31')](_0x49ffea));}_0x4da34d['or'](_0x30f3('0x34'),qs[_0x30f3('0x31')](_0x49ffea,!![]),null);}}return _0x4da34d;}function parseAdvancedSearchFilter(_0x462e58,_0x161a9d){var _0x38f094=getSqlClauses();var _0x24879b=as[_0x30f3('0x35')](_0x462e58);var _0x5b8a67=_0x24879b['sqlOperator'];for(var _0x2969ea=0x0;_0x2969ea<_0x24879b[_0x30f3('0x36')][_0x30f3('0x37')];_0x2969ea++){var _0x3b0ae5=_0x24879b[_0x30f3('0x36')][_0x2969ea];var _0x20f28a='i';var _0x946754=_[_0x30f3('0x38')](_0x161a9d,['name',_0x3b0ae5[_0x30f3('0x9')]]);if(_0x946754){var _0x2e6a42=as[_0x30f3('0x39')](_0x20f28a,_0x946754['type'],_0x3b0ae5);_0x38f094[_0x30f3('0x3a')][_0x5b8a67](_0x2e6a42[_0x30f3('0x3b')],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3d')],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3e')]);}else{switch(_0x3b0ae5['field']){case _0x30f3('0x3f'):var _0x5c6c88=parseReadParameter(_0x3b0ae5[_0x30f3('0x3c')]);_0x38f094[_0x30f3('0x40')][_0x30f3('0x41')](_0x5c6c88);break;case _0x30f3('0x42'):if(_0x3b0ae5['operator']===_0x30f3('0x43')){if(_0x3b0ae5[_0x30f3('0x3c')]['split']('\x20')[_0x30f3('0x37')]>0x1){_0x38f094[_0x30f3('0x44')][_0x5b8a67](_0x30f3('0x34'),qs['getFullTextValue'](_0x3b0ae5[_0x30f3('0x3c')],!![]),null);}else{var _0x32ac81='%'+_0x3b0ae5[_0x30f3('0x3c')]+'%';_0x38f094[_0x30f3('0x44')][_0x5b8a67](_0x30f3('0x45'),_0x32ac81,_0x32ac81,_0x32ac81);}}else{_0x946754=_[_0x30f3('0x38')](_0x161a9d,[_0x30f3('0xa'),_0x30f3('0x46')]);_0x3b0ae5[_0x30f3('0x9')]=_0x30f3('0x46');_0x2e6a42=as['buildExpression'](_0x20f28a,_0x946754[_0x30f3('0x47')],_0x3b0ae5);_0x38f094[_0x30f3('0x44')][_0x5b8a67](_0x2e6a42[_0x30f3('0x3b')],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3d')],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3e')]);}break;case'Tag':var _0x45daa9=_0x3b0ae5[_0x30f3('0x3c')][_0x30f3('0x48')](',')[_0x30f3('0x15')](function(_0x133f40){return Number(_0x133f40);});var _0x4b45c1=parseTagParameter(_0x45daa9);_0x38f094[_0x30f3('0x49')][_0x30f3('0x4a')][_0x30f3('0x41')](_0x4b45c1);_0x38f094[_0x30f3('0x49')][_0x30f3('0x4b')]=_0x45daa9;break;case _0x30f3('0x4c'):if(_0x3b0ae5[_0x30f3('0x4d')]===_0x30f3('0x43')){_0x38f094[_0x30f3('0x4e')][_0x5b8a67]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3b0ae5[_0x30f3('0x3c')]+'%',null);}else{_0x946754=_[_0x30f3('0x38')](_0x161a9d,[_0x30f3('0xa'),_0x30f3('0x4f')]);_0x3b0ae5[_0x30f3('0x9')]=_0x30f3('0x4f');_0x2e6a42=as[_0x30f3('0x39')](_0x20f28a,_0x946754[_0x30f3('0x47')],_0x3b0ae5);_0x38f094[_0x30f3('0x4e')][_0x5b8a67](_0x2e6a42[_0x30f3('0x3b')],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3d')],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3e')]);}break;case _0x30f3('0x50'):case _0x30f3('0x51'):_0x2e6a42=as[_0x30f3('0x39')]('me',null,_0x3b0ae5);_0x38f094[_0x30f3('0x50')][_0x5b8a67](_0x2e6a42['text'],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3d')],_0x2e6a42[_0x30f3('0x3c')][_0x30f3('0x3e')]);break;}}}return _0x38f094;}function parseModelFields(_0x409cbb,_0x27b3cd,_0x5c22ca){var _0x10d5e2=utils[_0x30f3('0x6')](_0x409cbb);var _0x516e70=squel[_0x30f3('0x1f')]();var _0x4bd67d=_(_0x27b3cd)[_0x30f3('0x52')]()[_0x30f3('0x15')](function(_0x286d10){return _[_0x30f3('0x53')](_0x5c22ca,[_0x30f3('0xa'),_0x286d10])?_0x286d10:undefined;})[_0x30f3('0x54')]()[_0x30f3('0x3c')]();if(_0x4bd67d[_0x30f3('0x37')]>0x0){_0x4bd67d['forEach'](function(_0x131dd2){if(_0x131dd2===_0x10d5e2){_0x516e70[_0x30f3('0x41')]('i.'+_0x10d5e2+_0x30f3('0x55'),[][_0x30f3('0x56')](_0x27b3cd[_0x131dd2]));}else if(_0x131dd2===_0x30f3('0x57')){var _0x19643e=JSON['parse'](_0x27b3cd[_0x131dd2])[_0x30f3('0x58')];var _0x255c40=JSON[_0x30f3('0x59')](_0x27b3cd[_0x131dd2])[_0x30f3('0x5a')];_0x516e70['and'](_0x30f3('0x5b'),_0x19643e,_0x255c40);}else{if(_0x27b3cd[_0x131dd2]===_0x30f3('0x5c')){_0x516e70['and']('i.'+_0x131dd2+_0x30f3('0x5d'));}else{_0x516e70[_0x30f3('0x41')]('i.'+_0x131dd2+_0x30f3('0x5e'),_0x27b3cd[_0x131dd2]);}}});}return _0x516e70;}function parseQueryParameters(_0x26a518,_0x4d9374,_0x5e5f59){var _0x10c78d=getSqlClauses();return Promise[_0x30f3('0x5f')]()[_0x30f3('0x60')](function(){return parseModelFields(_0x26a518,_0x4d9374,_0x5e5f59);})['then'](function(_0x116d74){_0x10c78d['fields'][_0x30f3('0x41')](_0x116d74);return parseReadParameter(_0x4d9374[_0x30f3('0x40')]);})[_0x30f3('0x60')](function(_0x587018){_0x10c78d['read'][_0x30f3('0x41')](_0x587018);return parseTagParameter(_0x4d9374[_0x30f3('0x61')]);})['then'](function(_0x545ebe){_0x10c78d[_0x30f3('0x49')][_0x30f3('0x4a')]['and'](_0x545ebe);return parseSearchFilter(_0x26a518,_0x4d9374[_0x30f3('0x62')]);})['then'](function(_0x7ac7c6){_0x10c78d[_0x30f3('0x62')]=_0x7ac7c6;return _0x10c78d;});}function checkAccountsRestrictions(_0x368d60,_0x40d64d,_0x26d116){var _0x2c2550=utils[_0x30f3('0x6')](_0x368d60);var _0x4b9357='get'+_[_0x30f3('0x63')](_0x368d60)+(_0x368d60===_0x30f3('0x64')?_0x30f3('0x65'):'Accounts');var _0x1c1c04=squel['expr']();return Promise[_0x30f3('0x5f')]()[_0x30f3('0x60')](function(){if(_0x26d116[_0x30f3('0x66')]&&_0x40d64d[_0x30f3('0x67')]==='agent'){return _0x40d64d[_0x4b9357]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x489fb8){if(_0x489fb8){if(_0x489fb8[_0x30f3('0x37')]===0x0){_0x1c1c04[_0x30f3('0x41')]('i.'+_0x2c2550+_0x30f3('0x5d'));}else{_0x1c1c04['and']('i.'+_0x2c2550+_0x30f3('0x55'),_['map'](_0x489fb8,'id'));}}else if(!_0x26d116[_0x2c2550]){_0x1c1c04[_0x30f3('0x41')]('i.'+_0x2c2550+_0x30f3('0x68'));}})['then'](function(){return _0x1c1c04;});}function getClosedOrderClause(_0x4d5ca6,_0xa446a7){var _0x3ca8db='';var _0x5b36bd=[_0x30f3('0x69'),_0x30f3('0x6a'),_0x30f3('0x6b')];if(_0x4d5ca6===_0x30f3('0x2e')){_0x5b36bd[_0x30f3('0x6c')](_0x30f3('0x6d'));}if(_0xa446a7[_0x30f3('0x6e')]==='0'&&_0x4d5ca6===_0x30f3('0x2e')){_0x3ca8db=_0x30f3('0x6d');}else{if(_0xa446a7[_0x30f3('0x6e')]==='1'){_0x5b36bd[_0x30f3('0x6f')]();}_0x3ca8db='CONCAT_WS(\x27\x27,\x20'+_0x5b36bd[_0x30f3('0x70')](',\x20')+')';}return _0x3ca8db;}function getFilteredInteractions(_0x5ca02b,_0x32a347,_0x26e595,_0x292c73){var _0x2c4cae=utils['getInteractionFK'](_0x5ca02b);var _0x2b663e=_['capitalize'](_0x5ca02b)+_0x30f3('0x71');var _0x6477d8=[];var _0x5e6a6d=getTagsQuery();var _0x1b66a5={'type':db[_0x30f3('0x72')][_0x30f3('0x73')]['SELECT'],'raw':!![]};var _0x2293dc=[];var _0x38b619=[];return db[_0x30f3('0x74')][_0x30f3('0x75')](_0x5e6a6d[_0x30f3('0x76')](),_0x1b66a5)[_0x30f3('0x60')](function(_0x42559f){_0x6477d8=_[_0x30f3('0x77')](_0x42559f,'id');_0x1b66a5=_['merge'](_0x1b66a5,{'model':db[_0x2b663e],'mapToModel':!![],'nest':!![]});if(_0x26e595[_0x30f3('0x78')]){_0x292c73[_0x30f3('0x79')][_0x30f3('0x7a')](function(_0x2e06ea){_0x32a347[_0x30f3('0x9')]('i.'+_0x2e06ea);});}else{_0x32a347[_0x30f3('0x9')](_0x30f3('0x7b'),_0x30f3('0x3f'));_0x32a347['field'](_0x30f3('0x7c'),_0x30f3('0x7d'));_0x32a347[_0x30f3('0x9')]('a.mandatoryDisposition',_0x30f3('0x7e'));if(_0x5ca02b===_0x30f3('0x2e')){_0x32a347[_0x30f3('0x9')]('a.email',_0x30f3('0x7f'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x80'),_0x30f3('0x81'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x82'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x83'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x84'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x85'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x86'));_0x32a347[_0x30f3('0x9')]('i.attach');_0x32a347[_0x30f3('0x9')]('i.lastMsgAt');_0x32a347[_0x30f3('0x9')](_0x30f3('0x87'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x88'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x6b'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x6a'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x69'));_0x32a347[_0x30f3('0x9')]('i.substatus');_0x32a347[_0x30f3('0x9')](_0x30f3('0x89'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x8a'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x8b'));_0x32a347[_0x30f3('0x9')]('i.UserId');}else if(_0x5ca02b==='openchannel'){_0x32a347[_0x30f3('0x9')]('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',_0x30f3('0x81'));}else{_0x32a347['field'](_0x30f3('0x8c'),'contactName');}if(_0x5ca02b!==_0x30f3('0x2e')){_0x32a347['field']('i.*');}_0x32a347['field'](_0x30f3('0x8d'),_0x30f3('0x8e'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x8f'),'Contact.lastName');_0x32a347['field'](_0x30f3('0x90'),_0x30f3('0x91'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x92'),_0x30f3('0x93'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x94'),_0x30f3('0x95'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x96'),_0x30f3('0x97'));_0x32a347[_0x30f3('0x9')]('o.fullname',_0x30f3('0x98'));_0x32a347[_0x30f3('0x9')](_0x30f3('0x99'),_0x30f3('0x9a'));_0x32a347['field'](_0x30f3('0x9b'),_0x30f3('0x9c'));}if(_0x292c73[_0x30f3('0x9d')]){_0x32a347[_0x30f3('0x9d')](_0x292c73['limit']);}if(_0x292c73[_0x30f3('0x9e')]){_0x32a347[_0x30f3('0x9e')](_0x292c73[_0x30f3('0x9e')]);}return db[_0x30f3('0x74')][_0x30f3('0x75')](_0x32a347[_0x30f3('0x76')](),_0x1b66a5);})[_0x30f3('0x60')](function(_0x581181){_0x2293dc=_0x581181;var _0x4c2907=getUsersQuery(_0x5ca02b,_0x2293dc);return db['sequelize']['query'](_0x4c2907[_0x30f3('0x76')](),_0x1b66a5);})[_0x30f3('0x60')](function(_0x297117){_0x38b619=_[_0x30f3('0x9f')](_0x297117,_0x2c4cae);if(_0x5ca02b===_0x30f3('0x2e')){return db[_0x30f3('0xa0')][_0x30f3('0xa1')]({'attributes':[_0x30f3('0xa2')],'raw':!![]});}})[_0x30f3('0x60')](function(_0x473105){var _0x45317e=_0x473105?_0x473105[_0x30f3('0xa2')]:undefined;var _0x57191b=_0x2293dc[_0x30f3('0x15')](function(_0x17f1ec){return updateInteraction(_0x17f1ec,_0x6477d8,_0x38b619,_0x45317e);});return Promise[_0x30f3('0xa3')](_0x57191b);});}function countFilteredInteractions(_0x5423e8,_0x386dbd){var _0x3c5f38=_0x5423e8[_0x30f3('0xa4')]();_0x3c5f38[_0x30f3('0x9')](_0x30f3('0xa5'));_0x3c5f38[_0x30f3('0x9')](_0x30f3('0x7b'),'unreadMessages');var _0x5b72d1=utils[_0x30f3('0x20')](_0x386dbd);if(!_[_0x30f3('0xa6')](_0x5b72d1)){_0x3c5f38['where']('t.id\x20IN\x20?',_0x5b72d1);}var _0x427c69={'type':db['Sequelize'][_0x30f3('0x73')][_0x30f3('0xa7')],'raw':!![]};return db['sequelize']['query'](_0x3c5f38[_0x30f3('0x76')](),_0x427c69);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 2c4ed4c..1b945f4 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa809=['talking','unmanaged','total','disposition','abandoned','UserId','findOne','out','plainBody','lastMsgText','updateInteraction','then','Tags','lodash','../../mysqldb','fullname','split','forEach','waiting'];(function(_0x5cbbeb,_0x142ebc){var _0x4cf278=function(_0x1087e8){while(--_0x1087e8){_0x5cbbeb['push'](_0x5cbbeb['shift']());}};_0x4cf278(++_0x142ebc);}(_0xa809,0x1c2));var _0x9a80=function(_0x3ada0a,_0x5e94e9){_0x3ada0a=_0x3ada0a-0x0;var _0x41ffc0=_0xa809[_0x3ada0a];return _0x41ffc0;};'use strict';var _=require(_0x9a80('0x0'));var db=require(_0x9a80('0x1'))['db'];function getInteractionUsers(_0x26319d,_0x305642){return new Promise(function(_0x4068f3,_0xe1ec99){try{var _0x3f9c15=[];if(_0x305642[_0x26319d]){_0x3f9c15=_0x305642[_0x26319d]['map'](function(_0x21666b){return{'id':_0x21666b['id'],'fullname':_0x21666b[_0x9a80('0x2')]};});}return _0x4068f3(_0x3f9c15);}catch(_0x1a2c02){_0xe1ec99(_0x1a2c02);}});}function getInteractionTags(_0x533541,_0x299feb){var _0x12f5e8=[];if(_0x533541){_0x533541[_0x9a80('0x3')](',')[_0x9a80('0x4')](function(_0x1132a9){_0x12f5e8['push'](_0x299feb[_0x1132a9]);});}return _0x12f5e8;}function updateWaitingCounter(_0x85cecb){if(_0x85cecb[_0x9a80('0x5')]){_0x85cecb['waiting']-=0x1;}}function updateInteractionCounters(_0x1497b4){_0x1497b4['waiting']=0x0;_0x1497b4[_0x9a80('0x6')]=0x0;_0x1497b4['answered']=0x0;_0x1497b4[_0x9a80('0x7')]=0x0;_0x1497b4['abandoned']=0x0;_0x1497b4[_0x9a80('0x8')]=0x0;if(_0x1497b4['closed']){if(_0x1497b4[_0x9a80('0x9')]===_0x9a80('0xa')){_0x1497b4[_0x9a80('0xa')]+=0x1;updateWaitingCounter(_0x1497b4);}if(_0x1497b4[_0x9a80('0xb')]){_0x1497b4['answered']+=0x1;if(_0x1497b4[_0x9a80('0x6')]){_0x1497b4[_0x9a80('0x6')]-=0x1;}}else{if(_0x1497b4[_0x9a80('0x9')]){_0x1497b4[_0x9a80('0x7')]+=0x1;updateWaitingCounter(_0x1497b4);}}}else{if(!_0x1497b4[_0x9a80('0xb')]){_0x1497b4[_0x9a80('0x5')]+=0x1;}if(_0x1497b4['UserId']){_0x1497b4[_0x9a80('0x6')]+=0x1;updateWaitingCounter(_0x1497b4);}}_0x1497b4[_0x9a80('0x8')]+=0x1;return _0x1497b4;}function getLastMessageText(_0x543d32){return db['MailMessage'][_0x9a80('0xc')]({'where':{'$and':[{'MailInteractionId':_0x543d32['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9a80('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9a80('0xe')],'order':'-id','raw':!![]})['then'](function(_0x4101fd){if(_0x4101fd&&_0x4101fd[_0x9a80('0xe')]){_0x543d32[_0x9a80('0xf')]=_['trimStart'](_0x4101fd[_0x9a80('0xe')]);}return _0x543d32;})['catch'](function(_0x51a5dc){throw _0x51a5dc;});}exports[_0x9a80('0x10')]=function(_0x1637c2,_0x1e358a,_0xae6c68,_0x5add85){return new Promise(function(_0x5cd4da,_0x3ca0be){return getInteractionUsers(_0x1637c2['id'],_0xae6c68)[_0x9a80('0x11')](function(_0x4f21fd){_0x1637c2['Users']=_0x4f21fd;return getInteractionTags(_0x1637c2['TagIds'],_0x1e358a);})['then'](function(_0x5c97fc){_0x1637c2[_0x9a80('0x12')]=_0x5c97fc;delete _0x1637c2['TagIds'];return updateInteractionCounters(_0x1637c2);})[_0x9a80('0x11')](function(_0x20bc9e){if(_0x5add85){return getLastMessageText(_0x20bc9e);}else{return _0x20bc9e;}})[_0x9a80('0x11')](function(_0x13e608){_0x5cd4da(_0x13e608);})['catch'](function(_0x5d0ff4){_0x3ca0be(_0x5d0ff4);});});}; \ No newline at end of file +var _0x690d=['lodash','map','push','waiting','talking','unmanaged','closed','disposition','abandoned','UserId','answered','total','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','then','Tags'];(function(_0x537d7a,_0x486335){var _0x233a65=function(_0x3fde2b){while(--_0x3fde2b){_0x537d7a['push'](_0x537d7a['shift']());}};_0x233a65(++_0x486335);}(_0x690d,0xc0));var _0xd690=function(_0x3956a2,_0x4a8d1c){_0x3956a2=_0x3956a2-0x0;var _0xae6aae=_0x690d[_0x3956a2];return _0xae6aae;};'use strict';var _=require(_0xd690('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x15e93f,_0x4afcc3){return new Promise(function(_0x4a44a8,_0x1ce28b){try{var _0x17240e=[];if(_0x4afcc3[_0x15e93f]){_0x17240e=_0x4afcc3[_0x15e93f][_0xd690('0x1')](function(_0x59b9d7){return{'id':_0x59b9d7['id'],'fullname':_0x59b9d7['fullname']};});}return _0x4a44a8(_0x17240e);}catch(_0x4e04e2){_0x1ce28b(_0x4e04e2);}});}function getInteractionTags(_0xbfb81e,_0x37ae5c){var _0x2abffa=[];if(_0xbfb81e){_0xbfb81e['split'](',')['forEach'](function(_0x968a92){_0x2abffa[_0xd690('0x2')](_0x37ae5c[_0x968a92]);});}return _0x2abffa;}function updateWaitingCounter(_0x33b6e4){if(_0x33b6e4[_0xd690('0x3')]){_0x33b6e4[_0xd690('0x3')]-=0x1;}}function updateInteractionCounters(_0x490812){_0x490812['waiting']=0x0;_0x490812[_0xd690('0x4')]=0x0;_0x490812['answered']=0x0;_0x490812[_0xd690('0x5')]=0x0;_0x490812['abandoned']=0x0;_0x490812['total']=0x0;if(_0x490812[_0xd690('0x6')]){if(_0x490812[_0xd690('0x7')]===_0xd690('0x8')){_0x490812[_0xd690('0x8')]+=0x1;updateWaitingCounter(_0x490812);}if(_0x490812[_0xd690('0x9')]){_0x490812[_0xd690('0xa')]+=0x1;if(_0x490812[_0xd690('0x4')]){_0x490812['talking']-=0x1;}}else{if(_0x490812[_0xd690('0x7')]){_0x490812[_0xd690('0x5')]+=0x1;updateWaitingCounter(_0x490812);}}}else{if(!_0x490812['UserId']){_0x490812[_0xd690('0x3')]+=0x1;}if(_0x490812[_0xd690('0x9')]){_0x490812[_0xd690('0x4')]+=0x1;updateWaitingCounter(_0x490812);}}_0x490812[_0xd690('0xb')]+=0x1;return _0x490812;}function getLastMessageText(_0x7f6eef){return db['MailMessage'][_0xd690('0xc')]({'where':{'$and':[{'MailInteractionId':_0x7f6eef['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd690('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd690('0xe')],'order':_0xd690('0xf'),'raw':!![]})['then'](function(_0x45c12a){if(_0x45c12a&&_0x45c12a['plainBody']){_0x7f6eef[_0xd690('0x10')]=_[_0xd690('0x11')](_0x45c12a[_0xd690('0xe')]);}return _0x7f6eef;})[_0xd690('0x12')](function(_0x54fe8e){throw _0x54fe8e;});}exports[_0xd690('0x13')]=function(_0x463d0b,_0x2b5234,_0x58c6ec,_0x3b16e5){return new Promise(function(_0x437f2c,_0x26aa77){return getInteractionUsers(_0x463d0b['id'],_0x58c6ec)['then'](function(_0x20c38f){_0x463d0b[_0xd690('0x14')]=_0x20c38f;return getInteractionTags(_0x463d0b[_0xd690('0x15')],_0x2b5234);})[_0xd690('0x16')](function(_0x5a6bdc){_0x463d0b[_0xd690('0x17')]=_0x5a6bdc;delete _0x463d0b[_0xd690('0x15')];return updateInteractionCounters(_0x463d0b);})['then'](function(_0x79b69f){if(_0x3b16e5){return getLastMessageText(_0x79b69f);}else{return _0x79b69f;}})[_0xd690('0x16')](function(_0x2ee2e1){_0x437f2c(_0x2ee2e1);})['catch'](function(_0x2439f8){_0x26aa77(_0x2439f8);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index b0dc905..c026972 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe2e=['_interaction_has_tags','_messages','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interactions'];(function(_0x3f656e,_0x34900b){var _0x2463da=function(_0x19251a){while(--_0x19251a){_0x3f656e['push'](_0x3f656e['shift']());}};_0x2463da(++_0x34900b);}(_0xbe2e,0x121));var _0xebe2=function(_0x5d8404,_0x1a75dd){_0x5d8404=_0x5d8404-0x0;var _0x103479=_0xbe2e[_0x5d8404];return _0x103479;};'use strict';var _=require(_0xebe2('0x0'));var db=require(_0xebe2('0x1'))['db'];var loggers={'openchannel':require(_0xebe2('0x2'))('openchannel-interactions'),'mail':require(_0xebe2('0x2'))(_0xebe2('0x3')),'fax':require(_0xebe2('0x2'))(_0xebe2('0x4')),'sms':require(_0xebe2('0x2'))(_0xebe2('0x5')),'chat':require(_0xebe2('0x2'))(_0xebe2('0x6')),'whatsapp':require(_0xebe2('0x2'))(_0xebe2('0x7'))};function getAccountFK(_0x194e92){return _[_0xebe2('0x8')](_0x194e92)+(_0x194e92===_0xebe2('0x9')?_0xebe2('0xa'):_0xebe2('0xb'))+'Id';}function getInteractionFK(_0x5121dc){return _['capitalize'](_0x5121dc)+_0xebe2('0xc');}function getInteractionId(_0x3b4507,_0x1dfcfa,_0x111b11){if(_0x3b4507&&_0x3b4507[_[_0xebe2('0xd')](_0x111b11)+_0xebe2('0xc')]){return _0x3b4507[_['upperFirst'](_0x111b11)+'InteractionId'];}else if(_0x3b4507&&_0x3b4507['id']){return _0x3b4507['id'];}else if(_0x1dfcfa&&_0x1dfcfa['id']){return _0x1dfcfa['id'];}else{return _0xebe2('0xe');}}function getInteractionsTables(_0x55fc7a){return{'accounts':_0x55fc7a+'_'+(_0x55fc7a===_0xebe2('0x9')?'websites':_0xebe2('0xf')),'interactions':_0x55fc7a+_0xebe2('0x10'),'interactionsTags':_0x55fc7a+_0xebe2('0x11'),'messages':_0x55fc7a+_0xebe2('0x12'),'userInteractions':_0xebe2('0x13')+_0x55fc7a+'_interactions'};}function getSelectedTags(_0x186c2d){var _0x2e6867=[];if(_0x186c2d){_0x2e6867=Array['isArray'](_0x186c2d)?_0x186c2d:[_0x186c2d];}return _0x2e6867;}function log(_0x461457,_0x53ef00,_0xa1b116,_0x12ad62,_0x30bf96,_0x33a79e){loggers[_0x30bf96[_0xebe2('0x14')]()][_0x461457](_0xebe2('0x15'),_0x33a79e[_0xebe2('0x16')](),_0x53ef00?_0x53ef00['id']:null,_0x53ef00?_0x53ef00[_0xebe2('0x17')]:null,_0x53ef00?_0x53ef00[_0xebe2('0x18')]:null,getInteractionId(_0xa1b116,_0x12ad62,_0x30bf96),_0xa1b116?JSON[_0xebe2('0x19')](_0xa1b116):'null');}function updateUser(_0x257736,_0x21b19e,_0x53d0b5,_0x4b1480,_0x4e6462){db[_[_0xebe2('0xd')](_0x4b1480)+_0xebe2('0x1a')][_0xebe2('0x1b')]({'where':{'id':getInteractionId(_0x21b19e,_0x53d0b5,_0x4b1480)}})[_0xebe2('0x1c')](function(_0x216892){if(_0x216892){return _0x216892[_0xebe2('0x1d')]({'UserId':_0x257736?_0x257736['id']:null});}})['then'](function(_0x47d120){if(_0x47d120){log(_0xebe2('0x1e'),_0x257736,_0x21b19e,_0x53d0b5,_0x4b1480,_0x4e6462);}})[_0xebe2('0x1f')](function(){log(_0xebe2('0x20'),_0x257736,_0x21b19e,_0x53d0b5,_0x4b1480,_0x4e6462);});}module[_0xebe2('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x8c3c=['InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info','exports','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website'];(function(_0x57940d,_0x4ea4ca){var _0x17932b=function(_0x34e892){while(--_0x34e892){_0x57940d['push'](_0x57940d['shift']());}};_0x17932b(++_0x4ea4ca);}(_0x8c3c,0x1d5));var _0xc8c3=function(_0x1cddc6,_0x14d525){_0x1cddc6=_0x1cddc6-0x0;var _0x314846=_0x8c3c[_0x1cddc6];return _0x314846;};'use strict';var _=require(_0xc8c3('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xc8c3('0x1'))(_0xc8c3('0x2')),'mail':require(_0xc8c3('0x1'))(_0xc8c3('0x3')),'fax':require('../../config/logger')(_0xc8c3('0x4')),'sms':require(_0xc8c3('0x1'))(_0xc8c3('0x5')),'chat':require(_0xc8c3('0x1'))(_0xc8c3('0x6')),'whatsapp':require(_0xc8c3('0x1'))(_0xc8c3('0x7'))};function getAccountFK(_0x2fe60d){return _[_0xc8c3('0x8')](_0x2fe60d)+(_0x2fe60d===_0xc8c3('0x9')?_0xc8c3('0xa'):'Account')+'Id';}function getInteractionFK(_0x5f53d1){return _[_0xc8c3('0x8')](_0x5f53d1)+_0xc8c3('0xb');}function getInteractionId(_0x13c1a9,_0x3c742c,_0x195833){if(_0x13c1a9&&_0x13c1a9[_['upperFirst'](_0x195833)+_0xc8c3('0xb')]){return _0x13c1a9[_[_0xc8c3('0xc')](_0x195833)+'InteractionId'];}else if(_0x13c1a9&&_0x13c1a9['id']){return _0x13c1a9['id'];}else if(_0x3c742c&&_0x3c742c['id']){return _0x3c742c['id'];}else{return _0xc8c3('0xd');}}function getInteractionsTables(_0x18191e){return{'accounts':_0x18191e+'_'+(_0x18191e===_0xc8c3('0x9')?'websites':_0xc8c3('0xe')),'interactions':_0x18191e+_0xc8c3('0xf'),'interactionsTags':_0x18191e+_0xc8c3('0x10'),'messages':_0x18191e+_0xc8c3('0x11'),'userInteractions':_0xc8c3('0x12')+_0x18191e+_0xc8c3('0xf')};}function getSelectedTags(_0xb65490){var _0x1456b1=[];if(_0xb65490){_0x1456b1=Array[_0xc8c3('0x13')](_0xb65490)?_0xb65490:[_0xb65490];}return _0x1456b1;}function log(_0x245f1a,_0x26fefa,_0x3026e0,_0x16ac9a,_0x3bb57b,_0x54d800){loggers[_0x3bb57b[_0xc8c3('0x14')]()][_0x245f1a](_0xc8c3('0x15'),_0x54d800[_0xc8c3('0x16')](),_0x26fefa?_0x26fefa['id']:null,_0x26fefa?_0x26fefa[_0xc8c3('0x17')]:null,_0x26fefa?_0x26fefa['role']:null,getInteractionId(_0x3026e0,_0x16ac9a,_0x3bb57b),_0x3026e0?JSON[_0xc8c3('0x18')](_0x3026e0):_0xc8c3('0x19'));}function updateUser(_0x167acf,_0x96f557,_0x502703,_0xe7bf04,_0x4710c0){db[_[_0xc8c3('0xc')](_0xe7bf04)+_0xc8c3('0x1a')][_0xc8c3('0x1b')]({'where':{'id':getInteractionId(_0x96f557,_0x502703,_0xe7bf04)}})[_0xc8c3('0x1c')](function(_0x3562da){if(_0x3562da){return _0x3562da[_0xc8c3('0x1d')]({'UserId':_0x167acf?_0x167acf['id']:null});}})['then'](function(_0x151753){if(_0x151753){log(_0xc8c3('0x1e'),_0x167acf,_0x96f557,_0x502703,_0xe7bf04,_0x4710c0);}})['catch'](function(){log('error',_0x167acf,_0x96f557,_0x502703,_0xe7bf04,_0x4710c0);});}module[_0xc8c3('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 7ca6010..b43d25f 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ae0=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','update','base64','utf8','final','use','License','findOne','count','status'];(function(_0x48c547,_0x2a17af){var _0x200c3d=function(_0x45d344){while(--_0x45d344){_0x48c547['push'](_0x48c547['shift']());}};_0x200c3d(++_0x2a17af);}(_0x2ae0,0xbd));var _0x02ae=function(_0x1aae64,_0x48ca82){_0x1aae64=_0x1aae64-0x0;var _0x388767=_0x2ae0[_0x1aae64];return _0x388767;};'use strict';var crypto=require(_0x02ae('0x0'));var util=require(_0x02ae('0x1'));var compose=require(_0x02ae('0x2'));var db=require(_0x02ae('0x3'))['db'];var config=require(_0x02ae('0x4'));function getValueFromLicense(_0x1719c6,_0x3ed9ff){if(_0x1719c6&&_0x3ed9ff){if(_0x3ed9ff['data1']&&_0x3ed9ff['license']){var _0x4fffc3=_0x3ed9ff[_0x02ae('0x5')];var _0x414548=_0x3ed9ff[_0x02ae('0x6')];var _0x31a819=_0x4fffc3['split']('-')[0x4];var _0x1f6183=_0x4fffc3['split']('-')[0x0];var _0x2f5055=crypto['createDecipher'](_0x02ae('0x7'),util[_0x02ae('0x8')]('%s:%s:%s',_0x31a819,_0x4fffc3,_0x1f6183));var _0x542671=_0x2f5055[_0x02ae('0x9')](_0x414548,_0x02ae('0xa'),_0x02ae('0xb'));_0x542671+=_0x2f5055[_0x02ae('0xc')]('utf8');var _0x4c05b1=JSON['parse'](_0x542671);return _0x4c05b1['hasOwnProperty'](_0x1719c6)?_0x4c05b1[_0x1719c6]:null;}}return null;}function isLimit(_0x564a34,_0x1b0c14,_0x5b6ddc,_0x361e31){var _0x345bda=_0x1b0c14;return compose()[_0x02ae('0xd')](function(_0x43d271,_0x3986e5,_0x1c2643){return db[_0x02ae('0xe')][_0x02ae('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x266397){var _0x31aa42=getValueFromLicense(_0x564a34,_0x266397);return _0x31aa42?_0x31aa42:_0x345bda;})['then'](function(_0x1c38f7){_0x345bda=_0x1c38f7;return _0x5b6ddc[_0x02ae('0x10')](_0x361e31);})['then'](function(_0x22d9ec){if(_0x22d9ec>=_0x345bda){return _0x3986e5[_0x02ae('0x11')](0x193)['json']({'message':util[_0x02ae('0x8')](_0x02ae('0x12'),_0x564a34)});}_0x1c2643();})[_0x02ae('0x13')](function(_0x3c3780){_0x1c2643(_0x3c3780);});});}function isUserLimit(){return isLimit(_0x02ae('0x14'),0x1,db[_0x02ae('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x02ae('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x7b13=['aes-256-ctr','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','use','License','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','crypto','util','../../mysqldb','../../config/environment','license','split'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x7b13,0x118));var _0x37b1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7b13[_0x167cc1];return _0x10bc4b;};'use strict';var crypto=require(_0x37b1('0x0'));var util=require(_0x37b1('0x1'));var compose=require('composable-middleware');var db=require(_0x37b1('0x2'))['db'];var config=require(_0x37b1('0x3'));function getValueFromLicense(_0x22c31a,_0x425005){if(_0x22c31a&&_0x425005){if(_0x425005['data1']&&_0x425005['license']){var _0x5507cc=_0x425005['data1'];var _0x49d30e=_0x425005[_0x37b1('0x4')];var _0x1eab64=_0x5507cc[_0x37b1('0x5')]('-')[0x4];var _0x8a9fdd=_0x5507cc[_0x37b1('0x5')]('-')[0x0];var _0x220669=crypto['createDecipher'](_0x37b1('0x6'),util['format'](_0x37b1('0x7'),_0x1eab64,_0x5507cc,_0x8a9fdd));var _0x1d4f80=_0x220669[_0x37b1('0x8')](_0x49d30e,_0x37b1('0x9'),_0x37b1('0xa'));_0x1d4f80+=_0x220669[_0x37b1('0xb')](_0x37b1('0xa'));var _0x4d5456=JSON['parse'](_0x1d4f80);return _0x4d5456[_0x37b1('0xc')](_0x22c31a)?_0x4d5456[_0x22c31a]:null;}}return null;}function isLimit(_0x4af668,_0x506210,_0x253a00,_0x12835b){var _0x492f24=_0x506210;return compose()[_0x37b1('0xd')](function(_0x26c570,_0x4579a7,_0xf50ab2){return db[_0x37b1('0xe')][_0x37b1('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x37b1('0x10')](function(_0x395881){var _0x5b05a9=getValueFromLicense(_0x4af668,_0x395881);return _0x5b05a9?_0x5b05a9:_0x492f24;})[_0x37b1('0x10')](function(_0x59a515){_0x492f24=_0x59a515;return _0x253a00[_0x37b1('0x11')](_0x12835b);})[_0x37b1('0x10')](function(_0x5c6186){if(_0x5c6186>=_0x492f24){return _0x4579a7[_0x37b1('0x12')](0x193)[_0x37b1('0x13')]({'message':util[_0x37b1('0x14')](_0x37b1('0x15'),_0x4af668)});}_0xf50ab2();})['catch'](function(_0x32ca47){_0xf50ab2(_0x32ca47);});});}function isUserLimit(){return isLimit(_0x37b1('0x16'),0x1,db[_0x37b1('0x17')],{'where':{'$or':[{'role':_0x37b1('0x18')},{'role':'user'}]}});}exports[_0x37b1('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 317e9f6..8493a31 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 _0xb766=['$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','$gte','>=\x20?','$in','start','$startsWith','shift','utcOffset','hours','seconds','moment','sqlOperator','[$or]','and','replace','[$and]','split','slice','match','forEach','filter','indexOf','push','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xb766,0x114));var _0x6b76=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xb766[_0x113a6c];return _0x1ac632;};'use strict';var _=require('lodash');var moment=require(_0x6b76('0x0'));exports['parseSearch']=function(_0x2a6b7d){var _0x53a4d0={'conditions':[]};_0x53a4d0[_0x6b76('0x1')]=_['startsWith'](_0x2a6b7d,_0x6b76('0x2'))?'or':_0x6b76('0x3');var _0x3b85ea=_0x2a6b7d[_0x6b76('0x4')](_0x6b76('0x5'),'')[_0x6b76('0x4')](_0x6b76('0x2'),'')[_0x6b76('0x6')]('||');for(var _0x1c2af1=0x0;_0x1c2af1<_0x3b85ea['length'];_0x1c2af1++){var _0x16539d=_0x3b85ea[_0x1c2af1][_0x6b76('0x6')](':=');var _0x352785=_0x16539d[0x0];var _0x3df5fc=_0x16539d[_0x6b76('0x7')](0x1);_0x3df5fc['forEach'](function(_0x5cf336){var _0x2b7c99=_0x5cf336[_0x6b76('0x6')]('[')['shift']();var _0x55c5f4=_0x5cf336[_0x6b76('0x8')](/\[(.*?)\]/g);_0x55c5f4[_0x6b76('0x9')](function(_0x234f0c){var _0x55f556=_0x234f0c[_0x6b76('0x6')]('[')[_0x6b76('0xa')](function(_0x520ef8){return _0x520ef8[_0x6b76('0xb')](']')>-0x1;})['map'](function(_0x5dc103){return _0x5dc103['split'](']')[0x0];})[0x0];_0x53a4d0['conditions'][_0x6b76('0xc')]({'field':_0x352785,'operator':_0x2b7c99,'value':_0x55f556});});});}return _0x53a4d0;};exports[_0x6b76('0xd')]=function(_0xca414c,_0x1b9bab,_0x197dae){var _0x1e5fcb={};if(_0x1b9bab===_0x6b76('0xe')){if(_0x197dae[_0x6b76('0xf')]==='$eq'){_0x197dae['operator']=_0x6b76('0x10');_0x197dae[_0x6b76('0x11')]+=','+_0x197dae['value'];}else if(_['includes']([_0x6b76('0x12'),_0x6b76('0x13')],_0x197dae[_0x6b76('0xf')])){_0x197dae[_0x6b76('0x11')]=moment(_0x197dae['value'])[_0x6b76('0x14')](0x1,_0x6b76('0x15'))[_0x6b76('0x16')](_0x6b76('0x17'));}}if(_0x197dae[_0x6b76('0x18')]){_0x1b9bab=_0x197dae[_0x6b76('0x18')];_0x1e5fcb[_0x6b76('0x19')]=_0x6b76('0x1a')+_0xca414c+'.'+_0x197dae[_0x6b76('0x1b')]+_0x6b76('0x1c')+_0x197dae[_0x6b76('0x18')]+')\x20'+parseOperator(_0x197dae[_0x6b76('0xf')]);}else{_0x1e5fcb['text']=_0xca414c+'.'+_0x197dae['field']+'\x20'+parseOperator(_0x197dae[_0x6b76('0xf')]);}if(_['includes']([_0x6b76('0x1d'),_0x6b76('0x1e')],_0x197dae['operator']))_0x1e5fcb[_0x6b76('0x19')]='('+_0x1e5fcb[_0x6b76('0x19')]+_0x6b76('0x1f')+_0xca414c+'.'+_0x197dae['field']+'\x20IS\x20NULL)';_0x1e5fcb[_0x6b76('0x11')]=parseValue(_0x1b9bab,_0x197dae['operator'],_0x197dae['value']);return _0x1e5fcb;};function parseOperator(_0x27e7e1){var _0x51cf8d;switch(_0x27e7e1){case'$in':_0x51cf8d=_0x6b76('0x20');break;case _0x6b76('0x1e'):_0x51cf8d=_0x6b76('0x21');break;case _0x6b76('0x22'):_0x51cf8d=_0x6b76('0x23');break;case _0x6b76('0x1d'):_0x51cf8d=_0x6b76('0x24');break;case _0x6b76('0x25'):case'$startsWith':case _0x6b76('0x26'):_0x51cf8d=_0x6b76('0x27');break;case'$lt':_0x51cf8d=_0x6b76('0x28');break;case _0x6b76('0x12'):_0x51cf8d=_0x6b76('0x29');break;case _0x6b76('0x13'):_0x51cf8d='<=\x20?';break;case _0x6b76('0x2a'):_0x51cf8d=_0x6b76('0x2b');break;case _0x6b76('0x10'):_0x51cf8d='BETWEEN\x20?\x20AND\x20?';break;}return _0x51cf8d;}function parseValue(_0xb7b4fa,_0x20a08e,_0x110642){var _0xeb1fe={'start':undefined,'end':undefined};switch(_0x20a08e){case _0x6b76('0x2c'):case _0x6b76('0x1e'):_0xeb1fe['start']=_0x110642['split'](',');break;case'$substring':_0xeb1fe[_0x6b76('0x2d')]='%'+_0x110642+'%';break;case _0x6b76('0x2e'):_0xeb1fe[_0x6b76('0x2d')]=_0x110642+'%';break;case'$endsWith':_0xeb1fe[_0x6b76('0x2d')]='%'+_0x110642;break;case'$between':var _0x1ae698=_0x110642[_0x6b76('0x6')](',');var _0x110642=_0x1ae698[_0x6b76('0x2f')]();var _0x16615a=_0x1ae698['pop']();if(_0xb7b4fa===_0x6b76('0xe')){_0x110642=moment(_0x110642)[_0x6b76('0x30')](0x0,!![])[_0x6b76('0x16')]();_0x16615a=moment(_0x16615a)[_0x6b76('0x30')](0x0,!![])[_0x6b76('0x14')](0x17,_0x6b76('0x31'))[_0x6b76('0x14')](0x3b,'minutes')['add'](0x3b,_0x6b76('0x32'))[_0x6b76('0x16')]();}_0xeb1fe={'start':_0x110642,'end':_0x16615a};break;default:_0xeb1fe[_0x6b76('0x2d')]=_0x110642;break;}return _0xeb1fe;} \ No newline at end of file +var _0xd7de=['buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','$ne','$notIn','text','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','start','$between','utcOffset','format','minutes','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','length','forEach','shift','match','filter','map','conditions','push'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7de,0x12d));var _0xed7d=function(_0x1f0bc5,_0x51ddd5){_0x1f0bc5=_0x1f0bc5-0x0;var _0x16994d=_0xd7de[_0x1f0bc5];return _0x16994d;};'use strict';var _=require(_0xed7d('0x0'));var moment=require(_0xed7d('0x1'));exports[_0xed7d('0x2')]=function(_0xb7fc2b){var _0x52f6f1={'conditions':[]};_0x52f6f1[_0xed7d('0x3')]=_[_0xed7d('0x4')](_0xb7fc2b,_0xed7d('0x5'))?'or':'and';var _0x1db4ac=_0xb7fc2b[_0xed7d('0x6')](_0xed7d('0x7'),'')[_0xed7d('0x6')](_0xed7d('0x5'),'')[_0xed7d('0x8')]('||');for(var _0x1e1710=0x0;_0x1e1710<_0x1db4ac[_0xed7d('0x9')];_0x1e1710++){var _0x2d622e=_0x1db4ac[_0x1e1710][_0xed7d('0x8')](':=');var _0x5e47c8=_0x2d622e[0x0];var _0x4ab16e=_0x2d622e['slice'](0x1);_0x4ab16e[_0xed7d('0xa')](function(_0x9c0275){var _0x48fb8f=_0x9c0275[_0xed7d('0x8')]('[')[_0xed7d('0xb')]();var _0x3989cd=_0x9c0275[_0xed7d('0xc')](/\[(.*?)\]/g);_0x3989cd['forEach'](function(_0x48df8a){var _0x11ce09=_0x48df8a['split']('[')[_0xed7d('0xd')](function(_0x43547d){return _0x43547d['indexOf'](']')>-0x1;})[_0xed7d('0xe')](function(_0x9eaf94){return _0x9eaf94[_0xed7d('0x8')](']')[0x0];})[0x0];_0x52f6f1[_0xed7d('0xf')][_0xed7d('0x10')]({'field':_0x5e47c8,'operator':_0x48fb8f,'value':_0x11ce09});});});}return _0x52f6f1;};exports[_0xed7d('0x11')]=function(_0x2f4383,_0x2714c5,_0x4ee16e){var _0x3c3113={};if(_0x2714c5===_0xed7d('0x12')){if(_0x4ee16e[_0xed7d('0x13')]===_0xed7d('0x14')){_0x4ee16e['operator']='$between';_0x4ee16e[_0xed7d('0x15')]+=','+_0x4ee16e[_0xed7d('0x15')];}else if(_[_0xed7d('0x16')]([_0xed7d('0x17'),_0xed7d('0x18')],_0x4ee16e[_0xed7d('0x13')])){_0x4ee16e[_0xed7d('0x15')]=moment(_0x4ee16e[_0xed7d('0x15')])[_0xed7d('0x19')](0x1,_0xed7d('0x1a'))['format'](_0xed7d('0x1b'));}}if(_0x4ee16e[_0xed7d('0x1c')]){_0x2714c5=_0x4ee16e['castTo'];_0x3c3113['text']=_0xed7d('0x1d')+_0x2f4383+'.'+_0x4ee16e[_0xed7d('0x1e')]+_0xed7d('0x1f')+_0x4ee16e[_0xed7d('0x1c')]+')\x20'+parseOperator(_0x4ee16e[_0xed7d('0x13')]);}else{_0x3c3113['text']=_0x2f4383+'.'+_0x4ee16e['field']+'\x20'+parseOperator(_0x4ee16e[_0xed7d('0x13')]);}if(_[_0xed7d('0x16')]([_0xed7d('0x20'),_0xed7d('0x21')],_0x4ee16e[_0xed7d('0x13')]))_0x3c3113[_0xed7d('0x22')]='('+_0x3c3113[_0xed7d('0x22')]+'\x20OR\x20'+_0x2f4383+'.'+_0x4ee16e['field']+_0xed7d('0x23');_0x3c3113[_0xed7d('0x15')]=parseValue(_0x2714c5,_0x4ee16e[_0xed7d('0x13')],_0x4ee16e['value']);return _0x3c3113;};function parseOperator(_0x490b22){var _0x2e9d7a;switch(_0x490b22){case _0xed7d('0x24'):_0x2e9d7a='IN\x20?';break;case _0xed7d('0x21'):_0x2e9d7a=_0xed7d('0x25');break;case _0xed7d('0x14'):_0x2e9d7a='=\x20?';break;case _0xed7d('0x20'):_0x2e9d7a=_0xed7d('0x26');break;case _0xed7d('0x27'):case _0xed7d('0x28'):case _0xed7d('0x29'):_0x2e9d7a=_0xed7d('0x2a');break;case'$lt':_0x2e9d7a=_0xed7d('0x2b');break;case _0xed7d('0x17'):_0x2e9d7a=_0xed7d('0x2c');break;case'$lte':_0x2e9d7a=_0xed7d('0x2d');break;case _0xed7d('0x2e'):_0x2e9d7a=_0xed7d('0x2f');break;case'$between':_0x2e9d7a='BETWEEN\x20?\x20AND\x20?';break;}return _0x2e9d7a;}function parseValue(_0x7e7e2a,_0x25fa72,_0x4a3868){var _0x39dd1e={'start':undefined,'end':undefined};switch(_0x25fa72){case _0xed7d('0x24'):case _0xed7d('0x21'):_0x39dd1e[_0xed7d('0x30')]=_0x4a3868[_0xed7d('0x8')](',');break;case _0xed7d('0x27'):_0x39dd1e[_0xed7d('0x30')]='%'+_0x4a3868+'%';break;case'$startsWith':_0x39dd1e[_0xed7d('0x30')]=_0x4a3868+'%';break;case _0xed7d('0x29'):_0x39dd1e[_0xed7d('0x30')]='%'+_0x4a3868;break;case _0xed7d('0x31'):var _0x24bfd8=_0x4a3868['split'](',');var _0x4a3868=_0x24bfd8[_0xed7d('0xb')]();var _0x47aad8=_0x24bfd8['pop']();if(_0x7e7e2a==='DATE'){_0x4a3868=moment(_0x4a3868)[_0xed7d('0x32')](0x0,!![])[_0xed7d('0x33')]();_0x47aad8=moment(_0x47aad8)[_0xed7d('0x32')](0x0,!![])['add'](0x17,'hours')[_0xed7d('0x19')](0x3b,_0xed7d('0x34'))['add'](0x3b,'seconds')[_0xed7d('0x33')]();}_0x39dd1e={'start':_0x4a3868,'end':_0x47aad8};break;default:_0x39dd1e[_0xed7d('0x30')]=_0x4a3868;break;}return _0x39dd1e;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 17176c8..eea869f 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 _0x0000=['sequelize','parse','keys','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','offset','sort','map','priority','cast','DESC','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','\x22{EXPR}\x22','forEach','replace','push','{EXPR}','join','getOptions','query','$id','model','intersection','attributes','fields','order','where','pick','filter','object','includes','columns','value','merge','VIRTUAL','lower','lodash'];(function(_0x34eeca,_0x341ab3){var _0x3ecb26=function(_0xece073){while(--_0xece073){_0x34eeca['push'](_0x34eeca['shift']());}};_0x3ecb26(++_0x341ab3);}(_0x0000,0x130));var _0x0000=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0000[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0000('0x0'));var sequelize=require(_0x0000('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f1f59){var _0xb98eed=['ne'];try{var _0x176bbb=JSON['parse'](_0x1f1f59);var _0x33ba37=Object['keys'](_0x176bbb)[0x0];return _0xb98eed['includes'](_0x33ba37);}catch(_0x3fc37b){return![];}}function getOperatorValue(_0x498b0e){var _0x143957=JSON[_0x0000('0x2')](_0x498b0e);var _0x113fef=Object[_0x0000('0x3')](_0x143957)[0x0];var _0x20b235=_0x143957[_0x113fef];return{['$'+_0x113fef]:_0x20b235};}exports['fields']=function(_0x17d832){var _0x420e8b=null;if(_0x17d832){_0x420e8b=_0x17d832[_0x0000('0x4')](',');}return _0x420e8b;};exports[_0x0000('0x5')]=function(_0x4f707e,_0x46c859){var _0x4f08ac={};if(!_[_0x0000('0x6')](_0x4f707e)){_[_0x0000('0x7')](_0x4f707e,function(_0x92adc0,_0x2e6c17){try{if(_0x46c859){var _0x2bfe3d=_[_0x0000('0x8')](_0x46c859,{'name':_0x2e6c17})||{};if(hasSequelizeOperator(_0x92adc0)){_0x4f08ac[_0x2e6c17]=getOperatorValue(_0x92adc0);}else if(_0x2bfe3d[_0x0000('0x9')]===_0x0000('0xa')&&_['isPlainObject'](_0x92adc0)){var _0x1512f7=JSON[_0x0000('0x2')](_0x92adc0);var _0x35e9c2={'$gte':moment(moment(_0x1512f7[_0x0000('0xb')])[_0x0000('0xc')](_0x0000('0xd')))[_0x0000('0xe')]()[_0x0000('0xc')](),'$lte':moment(moment(_0x1512f7['$lte'])[_0x0000('0xc')]('YYYY-MM-DD'))[_0x0000('0xe')]()[_0x0000('0xf')](0x1,'s')[_0x0000('0xc')]()};_0x4f08ac[_0x2e6c17]=_0x35e9c2;}else if(_0x2bfe3d[_0x0000('0x10')]===_0x0000('0x11')){_0x4f08ac[_0x2e6c17]=_0x92adc0;}else{_0x4f08ac[_0x2e6c17]=_['isArray'](_0x92adc0)?_0x92adc0:JSON[_0x0000('0x2')](_0x92adc0);}}else{_0x4f08ac[_0x2e6c17]=_[_0x0000('0x12')](_0x92adc0)?_0x92adc0:JSON[_0x0000('0x2')](_0x92adc0);}}catch(_0x4f0c11){_0x4f08ac[_0x2e6c17]=_0x92adc0[_0x0000('0x4')](',');}});}return _0x4f08ac;};exports[_0x0000('0x13')]=function(_0x868c16){_0x868c16=parseInt(_0x868c16,0xa);if(!_0x868c16||_0x868c16<0x0){_0x868c16=LIMIT_VALUE;}return _0x868c16;};exports[_0x0000('0x14')]=function(_0x2ff88a){_0x2ff88a=parseInt(_0x2ff88a,0xa);if(!_0x2ff88a||_0x2ff88a<0x0){_0x2ff88a=0x0;}return _0x2ff88a;};exports[_0x0000('0x15')]=function(_0x409206){var _0x4af023,_0x449d2c=null;if(_0x409206){_0x4af023=_0x409206['split'](',');_0x449d2c=_[_0x0000('0x16')](_0x4af023,function(_0x5e56cb){if(_0x5e56cb['indexOf']('-')===0x0){return[_0x5e56cb===_0x0000('0x17')?sequelize[_0x0000('0x18')](sequelize['col']('priority'),'unsigned'):_0x5e56cb['substr'](0x1),_0x0000('0x19')];}else{return[_0x5e56cb===_0x0000('0x17')?sequelize[_0x0000('0x18')](sequelize[_0x0000('0x1a')](_0x0000('0x17')),'unsigned'):_0x5e56cb,_0x0000('0x1b')];}});}return _0x449d2c;};exports[_0x0000('0x1c')]=function(_0x5ee02e,_0x5afbb0){if(_[_0x0000('0x6')](_0x5ee02e)){return _0x5ee02e;}if(_[_0x0000('0x12')](_0x5ee02e)){for(var _0x21aa48=0x0;_0x21aa48<_0x5ee02e[_0x0000('0x1d')];_0x21aa48+=0x1){_0x5ee02e[_0x21aa48]=this[_0x0000('0x1c')](_0x5ee02e[_0x21aa48],_0x5afbb0);}return _0x5ee02e;}if(!_[_0x0000('0x1e')](_0x5ee02e)){return _0x5ee02e;}if(_[_0x0000('0x1f')](_0x5afbb0)){_0x5afbb0=[_0x5afbb0];}if(!_[_0x0000('0x12')](_0x5afbb0)){return _0x5ee02e;}for(var _0x19b639=0x0;_0x19b639<_0x5afbb0['length'];_0x19b639+=0x1){_[_0x0000('0x20')](_0x5ee02e,_0x5afbb0[_0x19b639]);}for(var _0x4618cb in _0x5ee02e){if(_0x5ee02e[_0x0000('0x21')](_0x4618cb)){_0x5ee02e[_0x4618cb]=this[_0x0000('0x1c')](_0x5ee02e[_0x4618cb],_0x5afbb0);}}return _0x5ee02e;};exports[_0x0000('0x22')]=function(_0x240cbf){return _0x240cbf[_0x0000('0x23')](RegExp(_0x0000('0x24')))?!![]:![];};exports['isEmail']=function(_0x450c77){return _0x450c77['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x593005,_0x364419){var _0x48d872=[];var _0x1b4b30=/[ `!@#$%^&*()_\-?~]/;var _0x4ebaf5=_0x364419?_0x0000('0x25'):'{EXPR}';_0x593005[_0x0000('0x4')](/[ ,]+/)[_0x0000('0x26')](function(_0x65f6bc){_0x65f6bc=_0x65f6bc[_0x0000('0x27')](/([^:]")"+/g,'$1');_0x65f6bc='+'+_0x65f6bc+'*';var _0x5eca69=_0x65f6bc[_0x0000('0x23')](_0x1b4b30);if(_0x5eca69){_0x65f6bc='\x22'+_0x65f6bc+'\x22';}_0x48d872[_0x0000('0x28')](_0x65f6bc);});_0x4ebaf5=_0x4ebaf5[_0x0000('0x27')](_0x0000('0x29'),_0x48d872[_0x0000('0x2a')]('\x20'));return _0x4ebaf5;};exports[_0x0000('0x2b')]=function(_0x134547,_0x539f4f,_0x519c44){var _0x127a70={},_0x5100de={};if(_0x539f4f[_0x0000('0x2c')]['$id']){_0x539f4f[_0x0000('0x2c')]['id']=_0x539f4f[_0x0000('0x2c')]['$id'];delete _0x539f4f[_0x0000('0x2c')][_0x0000('0x2d')];}_0x127a70[_0x0000('0x2e')]=_[_0x0000('0x16')](_0x134547,_0x0000('0x10'));_0x127a70[_0x0000('0x2c')]=_[_0x0000('0x3')](_0x539f4f['query']);_0x127a70[_0x0000('0x5')]=_[_0x0000('0x2f')](_0x127a70[_0x0000('0x2e')],_0x127a70[_0x0000('0x2c')]);_0x5100de[_0x0000('0x30')]=_[_0x0000('0x2f')](_0x127a70[_0x0000('0x2e')],this[_0x0000('0x31')](_0x539f4f[_0x0000('0x2c')][_0x0000('0x31')]));_0x5100de[_0x0000('0x30')]=_0x5100de[_0x0000('0x30')]['length']?_0x5100de[_0x0000('0x30')]:_0x127a70['model'];if(!_0x539f4f[_0x0000('0x2c')][_0x0000('0x21')]('nolimit')){_0x5100de[_0x0000('0x13')]=this[_0x0000('0x13')](_0x539f4f[_0x0000('0x2c')][_0x0000('0x13')]);_0x5100de[_0x0000('0x14')]=this[_0x0000('0x14')](_0x539f4f[_0x0000('0x2c')][_0x0000('0x14')]);}_0x5100de[_0x0000('0x32')]=this[_0x0000('0x15')](_0x539f4f[_0x0000('0x2c')]['sort']);_0x5100de[_0x0000('0x33')]=this[_0x0000('0x5')](_[_0x0000('0x34')](_0x539f4f[_0x0000('0x2c')],_0x127a70[_0x0000('0x5')]),_0x134547);if(_0x539f4f['query'][_0x0000('0x35')]){var _0x5be2d9=_0x134547;var _0x156247=_0x539f4f['query']['filter'];if(typeof _0x156247===_0x0000('0x36')){_0x5be2d9=_['filter'](_0x134547,function(_0x482b83){return _[_0x0000('0x37')](_0x156247[_0x0000('0x38')],_0x482b83[_0x0000('0x10')]);});_0x156247=_0x156247[_0x0000('0x39')];}_0x5100de[_0x0000('0x33')]=_[_0x0000('0x3a')](_0x5100de[_0x0000('0x33')],{'$or':_[_0x0000('0x16')](_0x5be2d9,function(_0x11b011){if(_0x11b011[_0x0000('0x9')]!==_0x0000('0x3b')){if(_0x519c44){return sequelize[_0x0000('0x33')](sequelize['fn'](_0x0000('0x3c'),sequelize[_0x0000('0x1a')](_0x11b011[_0x0000('0x10')])),{'$like':sequelize['fn'](_0x0000('0x3c'),'%'+_0x539f4f[_0x0000('0x2c')]['filter']+'%')});}else{var _0x55c097={};_0x55c097[_0x11b011[_0x0000('0x10')]]={'$like':'%'+_0x539f4f[_0x0000('0x2c')]['filter']+'%'};return _0x55c097;}}})});}_0x5100de=_[_0x0000('0x3a')]({},_0x5100de,_0x539f4f['options']);return _0x5100de;}; \ No newline at end of file +var _0x7651=['format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','map','priority','cast','unsigned','col','omit','isEmpty','isArray','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','sort','where','pick','object','filter','columns','value','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','forOwn','find','type','DATE','isPlainObject'];(function(_0x4b13a0,_0x2aec2a){var _0x486759=function(_0x534ad9){while(--_0x534ad9){_0x4b13a0['push'](_0x4b13a0['shift']());}};_0x486759(++_0x2aec2a);}(_0x7651,0xaf));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1765('0x0'));var sequelize=require(_0x1765('0x1'));var moment=require(_0x1765('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xf59e1a){var _0x2eb2d1=['ne'];try{var _0x4c60b3=JSON[_0x1765('0x3')](_0xf59e1a);var _0x192379=Object[_0x1765('0x4')](_0x4c60b3)[0x0];return _0x2eb2d1[_0x1765('0x5')](_0x192379);}catch(_0x152e93){return![];}}function getOperatorValue(_0x49faec){var _0x5788ac=JSON['parse'](_0x49faec);var _0x5d1778=Object[_0x1765('0x4')](_0x5788ac)[0x0];var _0x574536=_0x5788ac[_0x5d1778];return{['$'+_0x5d1778]:_0x574536};}exports[_0x1765('0x6')]=function(_0x4a546a){var _0xa02a07=null;if(_0x4a546a){_0xa02a07=_0x4a546a[_0x1765('0x7')](',');}return _0xa02a07;};exports[_0x1765('0x8')]=function(_0x19021d,_0x9d0aa2){var _0x1cc950={};if(!_['isEmpty'](_0x19021d)){_[_0x1765('0x9')](_0x19021d,function(_0x21997d,_0xbbda21){try{if(_0x9d0aa2){var _0x13bc19=_[_0x1765('0xa')](_0x9d0aa2,{'name':_0xbbda21})||{};if(hasSequelizeOperator(_0x21997d)){_0x1cc950[_0xbbda21]=getOperatorValue(_0x21997d);}else if(_0x13bc19[_0x1765('0xb')]===_0x1765('0xc')&&_[_0x1765('0xd')](_0x21997d)){var _0x117380=JSON['parse'](_0x21997d);var _0x44ca88={'$gte':moment(moment(_0x117380['$gte'])[_0x1765('0xe')](_0x1765('0xf')))[_0x1765('0x10')]()[_0x1765('0xe')](),'$lte':moment(moment(_0x117380[_0x1765('0x11')])[_0x1765('0xe')](_0x1765('0xf')))[_0x1765('0x10')]()[_0x1765('0x12')](0x1,'s')[_0x1765('0xe')]()};_0x1cc950[_0xbbda21]=_0x44ca88;}else if(_0x13bc19[_0x1765('0x13')]===_0x1765('0x14')){_0x1cc950[_0xbbda21]=_0x21997d;}else{_0x1cc950[_0xbbda21]=_['isArray'](_0x21997d)?_0x21997d:JSON[_0x1765('0x3')](_0x21997d);}}else{_0x1cc950[_0xbbda21]=_['isArray'](_0x21997d)?_0x21997d:JSON[_0x1765('0x3')](_0x21997d);}}catch(_0x3985ab){_0x1cc950[_0xbbda21]=_0x21997d[_0x1765('0x7')](',');}});}return _0x1cc950;};exports['limit']=function(_0x2d84de){_0x2d84de=parseInt(_0x2d84de,0xa);if(!_0x2d84de||_0x2d84de<0x0){_0x2d84de=LIMIT_VALUE;}return _0x2d84de;};exports['offset']=function(_0x25dbb8){_0x25dbb8=parseInt(_0x25dbb8,0xa);if(!_0x25dbb8||_0x25dbb8<0x0){_0x25dbb8=0x0;}return _0x25dbb8;};exports['sort']=function(_0x3f3932){var _0x2d6447,_0x32d8ba=null;if(_0x3f3932){_0x2d6447=_0x3f3932[_0x1765('0x7')](',');_0x32d8ba=_[_0x1765('0x15')](_0x2d6447,function(_0x13b865){if(_0x13b865['indexOf']('-')===0x0){return[_0x13b865===_0x1765('0x16')?sequelize[_0x1765('0x17')](sequelize['col'](_0x1765('0x16')),_0x1765('0x18')):_0x13b865['substr'](0x1),'DESC'];}else{return[_0x13b865===_0x1765('0x16')?sequelize['cast'](sequelize[_0x1765('0x19')]('priority'),_0x1765('0x18')):_0x13b865,'ASC'];}});}return _0x32d8ba;};exports[_0x1765('0x1a')]=function(_0x4f557c,_0x5bc8ed){if(_[_0x1765('0x1b')](_0x4f557c)){return _0x4f557c;}if(_[_0x1765('0x1c')](_0x4f557c)){for(var _0x30c379=0x0;_0x30c379<_0x4f557c[_0x1765('0x1d')];_0x30c379+=0x1){_0x4f557c[_0x30c379]=this['omit'](_0x4f557c[_0x30c379],_0x5bc8ed);}return _0x4f557c;}if(!_[_0x1765('0x1e')](_0x4f557c)){return _0x4f557c;}if(_['isString'](_0x5bc8ed)){_0x5bc8ed=[_0x5bc8ed];}if(!_[_0x1765('0x1c')](_0x5bc8ed)){return _0x4f557c;}for(var _0x2192cd=0x0;_0x2192cd<_0x5bc8ed[_0x1765('0x1d')];_0x2192cd+=0x1){_[_0x1765('0x1f')](_0x4f557c,_0x5bc8ed[_0x2192cd]);}for(var _0x283f65 in _0x4f557c){if(_0x4f557c[_0x1765('0x20')](_0x283f65)){_0x4f557c[_0x283f65]=this[_0x1765('0x1a')](_0x4f557c[_0x283f65],_0x5bc8ed);}}return _0x4f557c;};exports[_0x1765('0x21')]=function(_0x55eaf8){return _0x55eaf8[_0x1765('0x22')](RegExp(_0x1765('0x23')))?!![]:![];};exports[_0x1765('0x24')]=function(_0x5b9b3c){return _0x5b9b3c[_0x1765('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x44eed1,_0x515ae8){var _0xda6637=[];var _0x4fa414=/[ `!@#$%^&*()_\-?~]/;var _0x45a524=_0x515ae8?_0x1765('0x25'):_0x1765('0x26');_0x44eed1[_0x1765('0x7')](/[ ,]+/)[_0x1765('0x27')](function(_0x50f5a3){_0x50f5a3=_0x50f5a3[_0x1765('0x28')](/([^:]")"+/g,'$1');_0x50f5a3='+'+_0x50f5a3+'*';var _0x5ddeb8=_0x50f5a3[_0x1765('0x22')](_0x4fa414);if(_0x5ddeb8){_0x50f5a3='\x22'+_0x50f5a3+'\x22';}_0xda6637[_0x1765('0x29')](_0x50f5a3);});_0x45a524=_0x45a524[_0x1765('0x28')](_0x1765('0x26'),_0xda6637[_0x1765('0x2a')]('\x20'));return _0x45a524;};exports[_0x1765('0x2b')]=function(_0x2b3412,_0x1191f3,_0x10f7b5){var _0x4bdb90={},_0x36c15b={};if(_0x1191f3[_0x1765('0x2c')][_0x1765('0x2d')]){_0x1191f3[_0x1765('0x2c')]['id']=_0x1191f3[_0x1765('0x2c')]['$id'];delete _0x1191f3[_0x1765('0x2c')][_0x1765('0x2d')];}_0x4bdb90[_0x1765('0x2e')]=_['map'](_0x2b3412,_0x1765('0x13'));_0x4bdb90[_0x1765('0x2c')]=_['keys'](_0x1191f3['query']);_0x4bdb90['filters']=_[_0x1765('0x2f')](_0x4bdb90[_0x1765('0x2e')],_0x4bdb90['query']);_0x36c15b[_0x1765('0x30')]=_['intersection'](_0x4bdb90[_0x1765('0x2e')],this[_0x1765('0x6')](_0x1191f3['query'][_0x1765('0x6')]));_0x36c15b['attributes']=_0x36c15b[_0x1765('0x30')][_0x1765('0x1d')]?_0x36c15b[_0x1765('0x30')]:_0x4bdb90[_0x1765('0x2e')];if(!_0x1191f3['query'][_0x1765('0x20')](_0x1765('0x31'))){_0x36c15b[_0x1765('0x32')]=this['limit'](_0x1191f3[_0x1765('0x2c')][_0x1765('0x32')]);_0x36c15b[_0x1765('0x33')]=this[_0x1765('0x33')](_0x1191f3[_0x1765('0x2c')][_0x1765('0x33')]);}_0x36c15b['order']=this[_0x1765('0x34')](_0x1191f3[_0x1765('0x2c')][_0x1765('0x34')]);_0x36c15b[_0x1765('0x35')]=this['filters'](_[_0x1765('0x36')](_0x1191f3[_0x1765('0x2c')],_0x4bdb90[_0x1765('0x8')]),_0x2b3412);if(_0x1191f3[_0x1765('0x2c')]['filter']){var _0x2f8df8=_0x2b3412;var _0x4ddade=_0x1191f3[_0x1765('0x2c')]['filter'];if(typeof _0x4ddade===_0x1765('0x37')){_0x2f8df8=_[_0x1765('0x38')](_0x2b3412,function(_0x4986df){return _['includes'](_0x4ddade[_0x1765('0x39')],_0x4986df[_0x1765('0x13')]);});_0x4ddade=_0x4ddade[_0x1765('0x3a')];}_0x36c15b[_0x1765('0x35')]=_['merge'](_0x36c15b[_0x1765('0x35')],{'$or':_['map'](_0x2f8df8,function(_0x46a148){if(_0x46a148[_0x1765('0xb')]!==_0x1765('0x3b')){if(_0x10f7b5){return sequelize['where'](sequelize['fn'](_0x1765('0x3c'),sequelize[_0x1765('0x19')](_0x46a148[_0x1765('0x13')])),{'$like':sequelize['fn'](_0x1765('0x3c'),'%'+_0x1191f3[_0x1765('0x2c')][_0x1765('0x38')]+'%')});}else{var _0xf27294={};_0xf27294[_0x46a148[_0x1765('0x13')]]={'$like':'%'+_0x1191f3[_0x1765('0x2c')][_0x1765('0x38')]+'%'};return _0xf27294;}}})});}_0x36c15b=_[_0x1765('0x3d')]({},_0x36c15b,_0x1191f3[_0x1765('0x3e')]);return _0x36c15b;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 3ad58af..469b28b 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4021=['resolve','User','findAll','name','fullname','map','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','internal','validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','isNil','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','busy','getAgentStatus','startCase','Queue','findOne','getAgents','getAgentIdsByQueues','includes','getAgentIdsByStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4021,0x14b));var _0x1402=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x4021[_0x4fc80b];return _0x119dba;};'use strict';var _=require(_0x1402('0x0'));var jayson=require(_0x1402('0x1'));var db=require(_0x1402('0x2'))['db'];var amiClient=jayson[_0x1402('0x3')][_0x1402('0x4')]({'port':0x232a});var routingClient=jayson[_0x1402('0x3')][_0x1402('0x4')]({'port':0x232c});function isAgentPaused(_0x1a6396,_0x54ff7f){var _0x225001=[_0x1a6396[_0x1402('0x5')],_0x1a6396[_0x1402('0x6')],_0x1a6396[_0x1402('0x7')],_0x1a6396[_0x1402('0x8')],_0x1a6396[_0x1402('0x9')],_0x1a6396[_0x1402('0xa')],_0x1a6396[_0x1402('0xb')]];if(!_0x54ff7f)return _['every'](_0x225001);var _0x1fd6f8=_[_0x1402('0xc')](_0x225001);return _0x1fd6f8[_0x1402('0xd')]>0x0&&_0x1fd6f8[_0x1402('0xd')]<_0x225001[_0x1402('0xd')]?!![]:![];}function isIdle(_0x4477d5){return _0x4477d5===_0x1402('0xe')||_0x4477d5===_0x1402('0xf')||_0x4477d5===_0x1402('0x10')||_0x4477d5==='ringing'||_[_0x1402('0x11')](_0x4477d5);}function isAgentIdle(_0x3a061b){if(_0x3a061b[_0x1402('0x12')]!=='idle'&&_0x3a061b['voicePause']){_0x3a061b[_0x1402('0x12')]='pause';return![];}return _[_0x1402('0x13')]([_0x3a061b[_0x1402('0x14')],_0x3a061b[_0x1402('0x15')],_0x3a061b[_0x1402('0x16')],_0x3a061b[_0x1402('0x17')],_0x3a061b['smsStatus'],_0x3a061b[_0x1402('0x12')],_0x3a061b[_0x1402('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x1402('0x19')](_0x1402('0x1a'),{})[_0x1402('0x1b')](function(_0x22a4c7){if(_0x22a4c7[_0x1402('0x1c')]){throw new Error(_0x1402('0x1d'));}var _0x1aa805=_0x22a4c7[_0x1402('0x1e')];return routingClient[_0x1402('0x19')](_0x1402('0x1a'),{})[_0x1402('0x1b')](function(_0x2dc7ba){if(_0x2dc7ba['error']){throw new Error(_0x1402('0x1f'));}var _0x5cb9e7=_0x2dc7ba[_0x1402('0x1e')];return _[_0x1402('0x20')]({},_0x1aa805,_0x5cb9e7);});})[_0x1402('0x21')](function(_0x19ddc3){throw _0x19ddc3;});}exports[_0x1402('0x22')]=getRealtimeAgents;function getAgentStatus(_0x105ab8){var _0x56611e=_0x1402('0xf');if(isAgentPaused(_0x105ab8))_0x56611e=_0x1402('0x23');else if(isAgentPaused(_0x105ab8,!![]))_0x56611e='*pause';else if(isAgentIdle(_0x105ab8))_0x56611e=_0x1402('0xe');else _0x56611e=_0x1402('0x24');return _0x56611e;}exports[_0x1402('0x25')]=getAgentStatus;function getAgentIdsByQueues(_0x1a638c,_0x51dcee){var _0x1bca13=_['isArray'](_0x1a638c)?_0x1a638c:[_0x1a638c];var _0x376634=_[_0x1402('0x26')](_0x51dcee)+_0x1402('0x27');var _0x487dc2=_['map'](_0x1bca13,function(_0x4a58fb){return db[_0x376634][_0x1402('0x28')]({'where':{'id':_0x4a58fb}})[_0x1402('0x1b')](function(_0x16b727){if(!_0x16b727)return[];return _0x16b727[_0x1402('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x487dc2)[_0x1402('0x1b')](function(_0x58a329){var _0xad78ad=_(_0x58a329)['flatten']()['map']('id')['uniq']()['value']();return _0xad78ad;});}exports[_0x1402('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x57f39e,_0x19647c,_0x5d8ad4){try{if(_0x19647c[_0x1402('0xd')]>0x0){_0x57f39e=_0x57f39e[_0x1402('0xc')](function(_0x429e6c){return _0x19647c[_0x1402('0x2b')](_0x429e6c['id']);});}var _0xc6cc00=_0x57f39e[_0x1402('0xc')](function(_0x23b2d6){var _0x597886='busy';if(isAgentIdle(_0x23b2d6)){_0x597886=_0x1402('0xe');}return _0x597886===_0x5d8ad4;});return _['map'](_0xc6cc00,'id');}catch(_0x40cda9){throw _0x40cda9;}}exports[_0x1402('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1f34dd,_0x91b11d,_0x27bcd8){return Promise[_0x1402('0x2d')]()['then'](function(){if(_0x91b11d['length']>0x0){_0x1f34dd=_0x1f34dd['filter'](function(_0x202150){return _0x91b11d[_0x1402('0x2b')](_0x202150['id']);});}return _0x1f34dd;})['then'](function(){return db[_0x1402('0x2e')][_0x1402('0x2f')]({'attributes':['id',_0x1402('0x30'),_0x1402('0x31'),'chatPause',_0x1402('0x6'),'mailPause','openchannelPause',_0x1402('0x9'),_0x1402('0xa'),_0x1402('0xb'),'pauseType'],'where':{'id':{'$in':_[_0x1402('0x32')](_0x1f34dd,'id')}},'raw':!![]});})[_0x1402('0x1b')](function(_0x2593a9){return _0x2593a9['map'](function(_0x2562cd){var _0x589b97=_[_0x1402('0x33')](_0x1f34dd,['id',_0x2562cd['id']]);var _0x52b2ad=filterAgentAttributes(_0x589b97);_[_0x1402('0x20')](_0x2562cd,_0x52b2ad);_0x2562cd[_0x1402('0x34')]=getAgentStatus(_0x2562cd);return _0x2562cd;});})[_0x1402('0x1b')](function(_0x38c2fb){var _0x3a8724=sortAgentsByStatus(_0x38c2fb,_0x27bcd8);return _[_0x1402('0x32')](_0x3a8724,'id');})[_0x1402('0x21')](function(_0x2060b1){throw _0x2060b1;});}exports[_0x1402('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x53c8a8){var _0x2ca53e={'fields':[],'order':null};var _0x197531=_0x53c8a8[_0x1402('0x36')](',');_0x2ca53e[_0x1402('0x37')]=_[_0x1402('0xc')](_0x197531,function(_0x358a42){if(!_0x358a42[_0x1402('0x2b')](_0x1402('0x34'))){return!![];}_0x2ca53e[_0x1402('0x38')]=_[_0x1402('0x39')](_0x358a42,'-')?_0x1402('0x3a'):_0x1402('0x3b');return![];});return _0x2ca53e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0xfbae30){if(_0xfbae30['includes'](_0x1402('0x31'))&&!_0xfbae30[_0x1402('0x2b')](_0x1402('0x3c'))){var _0x4d2795=_0xfbae30['substring'](0x0,_0xfbae30['indexOf']('fullname'));_0xfbae30+=','+_0x4d2795+'internal';}return _0xfbae30;}exports[_0x1402('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0x1743d1,_0x4e3a26){var _0x48bff1=_0x1743d1[_0x1402('0x3e')](function(_0xd19348,_0x6ea3ef){if(_0xd19348[_0x1402('0x34')]===_0x6ea3ef['globalStatus']){if(_0xd19348[_0x1402('0x34')]===_0x1402('0x23')){if(_0x4e3a26===_0x1402('0x3a')){return(_0xd19348[_0x1402('0x3f')]||'')<(_0x6ea3ef[_0x1402('0x3f')]||'')||_0xd19348[_0x1402('0x31')][_0x1402('0x40')]()>_0x6ea3ef['fullname'][_0x1402('0x40')]()?0x1:-0x1;}else{return(_0xd19348[_0x1402('0x3f')]||'')<(_0x6ea3ef['pauseType']||'')||_0xd19348[_0x1402('0x31')][_0x1402('0x40')]()>_0x6ea3ef['fullname'][_0x1402('0x40')]()?-0x1:0x1;}}else{if(_0x4e3a26==='DESC'){return _0xd19348[_0x1402('0x31')][_0x1402('0x40')]()<_0x6ea3ef[_0x1402('0x31')][_0x1402('0x40')]()?0x1:-0x1;}else{return _0xd19348[_0x1402('0x31')][_0x1402('0x40')]()<_0x6ea3ef[_0x1402('0x31')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x4e3a26===_0x1402('0x3a')){return _0xd19348[_0x1402('0x34')]<_0x6ea3ef[_0x1402('0x34')]?0x1:-0x1;}else{return _0xd19348['globalStatus']<_0x6ea3ef['globalStatus']?-0x1:0x1;}}});return _0x48bff1;}exports[_0x1402('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0xe66bf7){var _0xbe3ba6=[_0x1402('0x42'),_0x1402('0x43'),_0x1402('0x44'),'lastPauseAt',_0x1402('0x3f'),_0x1402('0x45'),_0x1402('0x3c'),_0x1402('0x46'),'chatPause','openchannelPause',_0x1402('0x7'),'smsPause','whatsappPause',_0x1402('0x6'),'voicePause',_0x1402('0x47'),'openchannelCapacity',_0x1402('0x48'),_0x1402('0x49'),_0x1402('0x4a'),_0x1402('0x4b'),_0x1402('0x4c'),_0x1402('0x4d'),'mailCurrentCapacity',_0x1402('0x4e'),'whatsappCurrentCapacity',_0x1402('0x4f'),_0x1402('0x14'),_0x1402('0x17'),_0x1402('0x16'),'smsStatus',_0x1402('0x18'),_0x1402('0x15'),_0x1402('0x12'),_0x1402('0x50'),_0x1402('0x51'),'mailStatusTime',_0x1402('0x52'),_0x1402('0x53'),_0x1402('0x54'),_0x1402('0x55'),'queue','destconnectedlinenum',_0x1402('0x56'),_0x1402('0x57'),_0x1402('0x58'),_0x1402('0x59')];var _0x1eaf0f=[_0x1402('0x5'),_0x1402('0x8'),_0x1402('0x7'),_0x1402('0x9'),_0x1402('0xb'),_0x1402('0x6'),_0x1402('0xa'),_0x1402('0x43')];var _0x43c112=_(_0xe66bf7)[_0x1402('0x5a')](_0x1eaf0f)[_0x1402('0x5b')](_0xbe3ba6)[_0x1402('0x5c')]();return _0x43c112;}exports[_0x1402('0x5d')]=filterAgentAttributes; \ No newline at end of file +var _0x796d=['globalStatus','getSortedAgentsIdsByStatus','split','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','toLowerCase','online','lastLoginAt','lastPauseAt','chatCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','filterAgentAttributes','lodash','../../mysqldb','http','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','result','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','isArray','map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','User','findAll','name','fullname','chatPause','faxPause','mailPause','pauseType','find'];(function(_0x2052f7,_0x3ccf3a){var _0x40dd5f=function(_0x4f3d0f){while(--_0x4f3d0f){_0x2052f7['push'](_0x2052f7['shift']());}};_0x40dd5f(++_0x3ccf3a);}(_0x796d,0xc6));var _0xd796=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x796d[_0x1d1d09];return _0x8827e;};'use strict';var _=require(_0xd796('0x0'));var jayson=require('jayson/promise');var db=require(_0xd796('0x1'))['db'];var amiClient=jayson['client'][_0xd796('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0xd796('0x2')]({'port':0x232c});function isAgentPaused(_0x562ed1,_0x541ca2){var _0x12af8c=[_0x562ed1['chatPause'],_0x562ed1['faxPause'],_0x562ed1['mailPause'],_0x562ed1[_0xd796('0x3')],_0x562ed1[_0xd796('0x4')],_0x562ed1[_0xd796('0x5')],_0x562ed1[_0xd796('0x6')]];if(!_0x541ca2)return _[_0xd796('0x7')](_0x12af8c);var _0x204594=_[_0xd796('0x8')](_0x12af8c);return _0x204594['length']>0x0&&_0x204594[_0xd796('0x9')]<_0x12af8c[_0xd796('0x9')]?!![]:![];}function isIdle(_0x3c2060){return _0x3c2060===_0xd796('0xa')||_0x3c2060===_0xd796('0xb')||_0x3c2060===_0xd796('0xc')||_0x3c2060==='ringing'||_[_0xd796('0xd')](_0x3c2060);}function isAgentIdle(_0x4da4d4){if(_0x4da4d4['voiceStatus']!==_0xd796('0xa')&&_0x4da4d4[_0xd796('0x5')]){_0x4da4d4[_0xd796('0xe')]=_0xd796('0xf');return![];}return _[_0xd796('0x7')]([_0x4da4d4[_0xd796('0x10')],_0x4da4d4[_0xd796('0x11')],_0x4da4d4[_0xd796('0x12')],_0x4da4d4[_0xd796('0x13')],_0x4da4d4[_0xd796('0x14')],_0x4da4d4['voiceStatus'],_0x4da4d4[_0xd796('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xd796('0x16')](_0xd796('0x17'),{})[_0xd796('0x18')](function(_0x1e3721){if(_0x1e3721['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x5d2441=_0x1e3721[_0xd796('0x19')];return routingClient['request']('Agents',{})['then'](function(_0x49acae){if(_0x49acae[_0xd796('0x1a')]){throw new Error(_0xd796('0x1b'));}var _0xe7f583=_0x49acae[_0xd796('0x19')];return _[_0xd796('0x1c')]({},_0x5d2441,_0xe7f583);});})[_0xd796('0x1d')](function(_0x4a4dcc){throw _0x4a4dcc;});}exports[_0xd796('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x108806){var _0x1ed89d=_0xd796('0xb');if(isAgentPaused(_0x108806))_0x1ed89d=_0xd796('0xf');else if(isAgentPaused(_0x108806,!![]))_0x1ed89d=_0xd796('0x1f');else if(isAgentIdle(_0x108806))_0x1ed89d=_0xd796('0xa');else _0x1ed89d=_0xd796('0x20');return _0x1ed89d;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x3a8736,_0x4ff8af){var _0x29b4f0=_[_0xd796('0x21')](_0x3a8736)?_0x3a8736:[_0x3a8736];var _0x42f449=_['startCase'](_0x4ff8af)+'Queue';var _0x3e7822=_[_0xd796('0x22')](_0x29b4f0,function(_0x3ac8f5){return db[_0x42f449][_0xd796('0x23')]({'where':{'id':_0x3ac8f5}})[_0xd796('0x18')](function(_0x22a6de){if(!_0x22a6de)return[];return _0x22a6de[_0xd796('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xd796('0x25')](_0x3e7822)[_0xd796('0x18')](function(_0x10c98a){var _0x5f5c55=_(_0x10c98a)[_0xd796('0x26')]()['map']('id')['uniq']()[_0xd796('0x27')]();return _0x5f5c55;});}exports[_0xd796('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5aee68,_0x2ec023,_0x45d0b6){try{if(_0x2ec023[_0xd796('0x9')]>0x0){_0x5aee68=_0x5aee68['filter'](function(_0x49cc51){return _0x2ec023[_0xd796('0x29')](_0x49cc51['id']);});}var _0x30f698=_0x5aee68[_0xd796('0x8')](function(_0x47d34d){var _0x1c4d8f=_0xd796('0x20');if(isAgentIdle(_0x47d34d)){_0x1c4d8f='idle';}return _0x1c4d8f===_0x45d0b6;});return _['map'](_0x30f698,'id');}catch(_0x5773a9){throw _0x5773a9;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x41a6c6,_0x5ad68a,_0x5146f1){return Promise['resolve']()[_0xd796('0x18')](function(){if(_0x5ad68a[_0xd796('0x9')]>0x0){_0x41a6c6=_0x41a6c6['filter'](function(_0x59a5b8){return _0x5ad68a['includes'](_0x59a5b8['id']);});}return _0x41a6c6;})['then'](function(){return db[_0xd796('0x2a')][_0xd796('0x2b')]({'attributes':['id',_0xd796('0x2c'),_0xd796('0x2d'),_0xd796('0x2e'),_0xd796('0x2f'),_0xd796('0x30'),'openchannelPause',_0xd796('0x4'),_0xd796('0x5'),'whatsappPause',_0xd796('0x31')],'where':{'id':{'$in':_[_0xd796('0x22')](_0x41a6c6,'id')}},'raw':!![]});})['then'](function(_0x2188bc){return _0x2188bc[_0xd796('0x22')](function(_0x29f3f5){var _0x53f34c=_[_0xd796('0x32')](_0x41a6c6,['id',_0x29f3f5['id']]);var _0xa9b354=filterAgentAttributes(_0x53f34c);_[_0xd796('0x1c')](_0x29f3f5,_0xa9b354);_0x29f3f5[_0xd796('0x33')]=getAgentStatus(_0x29f3f5);return _0x29f3f5;});})[_0xd796('0x18')](function(_0x1faecd){var _0x5f2707=sortAgentsByStatus(_0x1faecd,_0x5146f1);return _['map'](_0x5f2707,'id');})[_0xd796('0x1d')](function(_0x22f9c2){throw _0x22f9c2;});}exports[_0xd796('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x1a50a2){var _0x3c3f82={'fields':[],'order':null};var _0x53d003=_0x1a50a2[_0xd796('0x35')](',');_0x3c3f82['fields']=_[_0xd796('0x8')](_0x53d003,function(_0x248c20){if(!_0x248c20[_0xd796('0x29')](_0xd796('0x33'))){return!![];}_0x3c3f82['order']=_[_0xd796('0x36')](_0x248c20,'-')?_0xd796('0x37'):_0xd796('0x38');return![];});return _0x3c3f82;}exports[_0xd796('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x4a1d61){if(_0x4a1d61[_0xd796('0x29')]('fullname')&&!_0x4a1d61[_0xd796('0x29')](_0xd796('0x3a'))){var _0x35f85e=_0x4a1d61[_0xd796('0x3b')](0x0,_0x4a1d61['indexOf']('fullname'));_0x4a1d61+=','+_0x35f85e+'internal';}return _0x4a1d61;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x110992,_0x1c149e){var _0x23fbda=_0x110992['sort'](function(_0x5bdd62,_0x130ad5){if(_0x5bdd62[_0xd796('0x33')]===_0x130ad5[_0xd796('0x33')]){if(_0x5bdd62[_0xd796('0x33')]==='pause'){if(_0x1c149e===_0xd796('0x37')){return(_0x5bdd62[_0xd796('0x31')]||'')<(_0x130ad5['pauseType']||'')||_0x5bdd62[_0xd796('0x2d')][_0xd796('0x3c')]()>_0x130ad5[_0xd796('0x2d')][_0xd796('0x3c')]()?0x1:-0x1;}else{return(_0x5bdd62['pauseType']||'')<(_0x130ad5[_0xd796('0x31')]||'')||_0x5bdd62[_0xd796('0x2d')]['toLowerCase']()>_0x130ad5[_0xd796('0x2d')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x1c149e===_0xd796('0x37')){return _0x5bdd62[_0xd796('0x2d')][_0xd796('0x3c')]()<_0x130ad5['fullname'][_0xd796('0x3c')]()?0x1:-0x1;}else{return _0x5bdd62[_0xd796('0x2d')]['toLowerCase']()<_0x130ad5['fullname'][_0xd796('0x3c')]()?-0x1:0x1;}}}else{if(_0x1c149e==='DESC'){return _0x5bdd62[_0xd796('0x33')]<_0x130ad5['globalStatus']?0x1:-0x1;}else{return _0x5bdd62[_0xd796('0x33')]<_0x130ad5[_0xd796('0x33')]?-0x1:0x1;}}});return _0x23fbda;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x623048){var _0x1363d0=['userpic',_0xd796('0x3d'),_0xd796('0x3e'),'lastPauseAt',_0xd796('0x31'),_0xd796('0x3f'),_0xd796('0x3a'),'address','chatPause',_0xd796('0x3'),'mailPause','smsPause',_0xd796('0x6'),_0xd796('0x2f'),_0xd796('0x5'),_0xd796('0x40'),'openchannelCapacity','mailCapacity',_0xd796('0x41'),_0xd796('0x42'),_0xd796('0x43'),'chatCurrentCapacity',_0xd796('0x44'),_0xd796('0x45'),_0xd796('0x46'),_0xd796('0x47'),_0xd796('0x48'),_0xd796('0x10'),_0xd796('0x13'),_0xd796('0x12'),'smsStatus',_0xd796('0x15'),_0xd796('0x11'),_0xd796('0xe'),_0xd796('0x49'),_0xd796('0x4a'),'mailStatusTime',_0xd796('0x4b'),'whatsappStatusTime','faxStatusTime','voiceStatusTime',_0xd796('0x4c'),'destconnectedlinenum',_0xd796('0x4d'),_0xd796('0x4e'),_0xd796('0x4f'),_0xd796('0x50')];var _0x24671b=[_0xd796('0x2e'),'openchannelPause','mailPause',_0xd796('0x4'),_0xd796('0x6'),_0xd796('0x2f'),_0xd796('0x5'),_0xd796('0x3d')];var _0x1a417f=_(_0x623048)['omit'](_0x24671b)[_0xd796('0x51')](_0x1363d0)[_0xd796('0x27')]();return _0x1a417f;}exports[_0xd796('0x52')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 03adf6a..c146f60 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30bd=['get','waiting','voice','find','merge','pick','lodash','jayson/promise','util','client','http','available','loggedIn','paused','busy','invalid','loggedInDb','onHold','ringing','ringInUse','unavailable','unknown','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','outbound','concat','map'];(function(_0x873932,_0x2df78e){var _0x531f67=function(_0x134b67){while(--_0x134b67){_0x873932['push'](_0x873932['shift']());}};_0x531f67(++_0x2df78e);}(_0x30bd,0xd2));var _0xd30b=function(_0x1b6047,_0x37d791){_0x1b6047=_0x1b6047-0x0;var _0x488395=_0x30bd[_0x1b6047];return _0x488395;};'use strict';var _=require(_0xd30b('0x0'));var jayson=require(_0xd30b('0x1'));var util=require(_0xd30b('0x2'));var amiClient=jayson[_0xd30b('0x3')][_0xd30b('0x4')]({'port':0x232a});var routingClient=jayson[_0xd30b('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd30b('0x5'),_0xd30b('0x6'),_0xd30b('0x7'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xd30b('0x8'),'inUse',_0xd30b('0x9'),_0xd30b('0xa'),'notInUse',_0xd30b('0xb'),_0xd30b('0xc'),_0xd30b('0xd'),'talking',_0xd30b('0xe'),_0xd30b('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xd30b('0x10'),'message','statusMessage',_0xd30b('0x11'),_0xd30b('0x12'),_0xd30b('0x13'),_0xd30b('0x14'),_0xd30b('0x15'),_0xd30b('0x16'),_0xd30b('0x17'),_0xd30b('0x18'),'erlangBusyFactor',_0xd30b('0x19'),'dialPredictiveIntervalMaxThreshold',_0xd30b('0x1a'),_0xd30b('0x1b'),_0xd30b('0x1c'),'predictiveIntervalAnsweredCalls',_0xd30b('0x1d'),'predictiveIntervalDroppedCallsCallersExit',_0xd30b('0x1e'),_0xd30b('0x1f')];function getRealtimeQueues(_0x431849,_0x220b26){var _0x22865e=_0x220b26==='voice'?amiClient:routingClient;return _0x22865e[_0xd30b('0x20')](_[_0xd30b('0x21')](_0x220b26)+_0xd30b('0x22'),_0x431849)[_0xd30b('0x23')](function(_0x4762d0){if(_0x4762d0[_0xd30b('0x24')])throw new Error(util[_0xd30b('0x25')](_0xd30b('0x26'),_0x220b26));return _0x4762d0[_0xd30b('0x27')];})['catch'](function(_0xad2ad3){throw _0xad2ad3;});}exports[_0xd30b('0x28')]=getRealtimeQueues;function initializeQueues(_0x239f67,_0x3dbdbd,_0x5a85b7,_0x46f89e){var _0x36b518=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5a85b7==='voice'){if(_0x46f89e===_0xd30b('0x29')){_0x36b518=_0x36b518['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x46f89e===_0xd30b('0x2a')){_0x36b518=_0x36b518[_0xd30b('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x239f67[_0xd30b('0x2c')](function(_0x10dce4){var _0x5a1e5b=_0x10dce4[_0xd30b('0x2d')]({'plain':!![]});_0x5a1e5b['paused']=0x0;_0x5a1e5b[_0xd30b('0xa')]=0x0;_0x5a1e5b[_0xd30b('0x6')]=0x0;_0x5a1e5b[_0xd30b('0x5')]=0x0;_0x5a1e5b[_0xd30b('0x2e')]=0x0;if(_0x5a85b7===_0xd30b('0x2f')){_0x5a1e5b['talking']=0x0;_0x5a1e5b[_0xd30b('0x8')]=0x0;if(_0x46f89e==='outbound'){_0x5a1e5b['pTalking']=0x0;_0x5a1e5b[_0xd30b('0x10')]=0x0;}}var _0x1efd9d=_[_0xd30b('0x30')](_0x3dbdbd,['id',_0x5a1e5b['id']]);if(_0x1efd9d){_[_0xd30b('0x31')](_0x5a1e5b,_[_0xd30b('0x32')](_0x1efd9d,_0x36b518));}return _0x5a1e5b;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0x5876=['merge','pick','initializeQueues','jayson/promise','client','http','loggedIn','paused','inUse','invalid','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','Trunk','startProgressive','erlangCalls','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','error','format','result','catch','inbound','concat','outbound','map','loggedInDb','available','waiting','find'];(function(_0x5c6a5e,_0x5343d5){var _0x187fed=function(_0x18e64a){while(--_0x18e64a){_0x5c6a5e['push'](_0x5c6a5e['shift']());}};_0x187fed(++_0x5343d5);}(_0x5876,0x17b));var _0x6587=function(_0x2b8347,_0x14e3f2){_0x2b8347=_0x2b8347-0x0;var _0x15e93e=_0x5876[_0x2b8347];return _0x15e93e;};'use strict';var _=require('lodash');var jayson=require(_0x6587('0x0'));var util=require('util');var amiClient=jayson[_0x6587('0x1')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x6587('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x6587('0x3'),_0x6587('0x4'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x6587('0x5'),_0x6587('0x6'),'loggedInDb',_0x6587('0x7'),_0x6587('0x8'),_0x6587('0x9'),_0x6587('0xa'),_0x6587('0xb'),_0x6587('0xc'),_0x6587('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6587('0xe'),_0x6587('0xf'),_0x6587('0x10'),_0x6587('0x11'),'dialActive','dialMethod',_0x6587('0x12'),'startPredictive',_0x6587('0x13'),_0x6587('0x14'),'erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor',_0x6587('0x15'),_0x6587('0x16'),_0x6587('0x17'),'predictiveIntervalAvailable',_0x6587('0x18'),'predictiveIntervalAnsweredCalls',_0x6587('0x19'),_0x6587('0x1a'),_0x6587('0x1b'),_0x6587('0x1c')];function getRealtimeQueues(_0x433488,_0xb20d55){var _0x54befb=_0xb20d55===_0x6587('0x1d')?amiClient:routingClient;return _0x54befb[_0x6587('0x1e')](_[_0x6587('0x1f')](_0xb20d55)+'Queues',_0x433488)['then'](function(_0x515dfd){if(_0x515dfd[_0x6587('0x20')])throw new Error(util[_0x6587('0x21')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xb20d55));return _0x515dfd[_0x6587('0x22')];})[_0x6587('0x23')](function(_0x5cb8c9){throw _0x5cb8c9;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x2cabcc,_0x381288,_0x297a83,_0x503693){var _0x58ea72=DEFAULT_QUEUE_ATTRIBUTES;if(_0x297a83===_0x6587('0x1d')){if(_0x503693===_0x6587('0x24')){_0x58ea72=_0x58ea72[_0x6587('0x25')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x503693===_0x6587('0x26')){_0x58ea72=_0x58ea72[_0x6587('0x25')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2cabcc[_0x6587('0x27')](function(_0x3ad6ee){var _0x5ca3d5=_0x3ad6ee['get']({'plain':!![]});_0x5ca3d5[_0x6587('0x4')]=0x0;_0x5ca3d5[_0x6587('0x28')]=0x0;_0x5ca3d5[_0x6587('0x3')]=0x0;_0x5ca3d5[_0x6587('0x29')]=0x0;_0x5ca3d5[_0x6587('0x2a')]=0x0;if(_0x297a83===_0x6587('0x1d')){_0x5ca3d5[_0x6587('0xb')]=0x0;_0x5ca3d5['busy']=0x0;if(_0x503693==='outbound'){_0x5ca3d5[_0x6587('0xe')]=0x0;_0x5ca3d5['originated']=0x0;}}var _0x47250e=_[_0x6587('0x2b')](_0x381288,['id',_0x5ca3d5['id']]);if(_0x47250e){_[_0x6587('0x2c')](_0x5ca3d5,_[_0x6587('0x2d')](_0x47250e,_0x58ea72));}return _0x5ca3d5;});}exports[_0x6587('0x2e')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a131403..758e27e 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3b16e1,_0x3bda3e){var _0x311d1b=function(_0x2a979b){while(--_0x2a979b){_0x3b16e1['push'](_0x3b16e1['shift']());}};_0x311d1b(++_0x3bda3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5cc35f,_0x5acd94){var _0x3f33eb=function(_0x1af690){while(--_0x1af690){_0x5cc35f['push'](_0x5cc35f['shift']());}};_0x3f33eb(++_0x5acd94);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 7d7843e..80d37cb 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 _0x84df=['model','join','md5','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','createHash','substring','crypto','child_process','execSync','../environment','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','map'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x84df,0xd6));var _0xf84d=function(_0x515e9f,_0xff9586){_0x515e9f=_0x515e9f-0x0;var _0x19cbf0=_0x84df[_0x515e9f];return _0x19cbf0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xf84d('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xf84d('0x1'))[_0xf84d('0x2')];var config=require(_0xf84d('0x3'));function getInterfaces(){var _0x1e1122=[];var _0x521e48=os['networkInterfaces']();var _0x297373=_['orderBy'](_[_0xf84d('0x4')](_0x521e48));for(var _0xf616a5=0x0;_0xf616a5<_0x297373['length'];_0xf616a5++){var _0x1a609d=_0x521e48[_0x297373[_0xf616a5]][_0xf84d('0x5')](function(_0x35b9c9){return _0x35b9c9[_0xf84d('0x6')]==='IPv4'&&_0x35b9c9[_0xf84d('0x7')]===![];});_0x1e1122=_0x1e1122[_0xf84d('0x8')](_0x1a609d);}return _0x1e1122;}function getFirstInterface(){var _0x1e086a=_[_0xf84d('0x9')](getInterfaces());return{'macAddress':_0x1e086a&&_0x1e086a[_0xf84d('0xa')]?_0x1e086a[_0xf84d('0xa')]:_0xf84d('0xb'),'ipAddress':_0x1e086a&&_0x1e086a['address']?_0x1e086a[_0xf84d('0xc')]:_0xf84d('0xd')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x222d22=_[_0xf84d('0xe')](os[_0xf84d('0xf')]()[_0xf84d('0x10')](function(_0x5c200a){return _0x5c200a[_0xf84d('0x11')];}))[_0xf84d('0x12')](':');return crypto['createHash'](_0xf84d('0x13'))[_0xf84d('0x14')](_0x222d22)[_0xf84d('0x15')](_0xf84d('0x16'));}exports[_0xf84d('0x17')]=function(){var _0x2bde2f=os['platform']();var _0xefa8a2=/[0-9a-f-]{36}/;if(config[_0xf84d('0x18')]&&_0xefa8a2[_0xf84d('0x19')](config['licenseToken'])){return config['licenseToken'];}else if(_0x2bde2f===_0xf84d('0x1a')){return exec(_0xf84d('0x1b'),{'encoding':_0xf84d('0x1c')})['replace']('\x0d\x0a','');}else{var _0x13e20d=getFirstInterface();var _0x1a0dfa=getCPUhash();var _0x34f9f5=_0x1a0dfa+'|'+os[_0xf84d('0x1d')]()+'|'+_0x13e20d[_0xf84d('0x1e')]+'|'+_0x13e20d['ipAddress'];var _0x5dc03d=crypto[_0xf84d('0x1f')](_0xf84d('0x13'))[_0xf84d('0x14')](_0x34f9f5)[_0xf84d('0x15')](_0xf84d('0x16'));return _0x5dc03d[_0xf84d('0x20')](0x0,0x8)+'-'+_0x5dc03d[_0xf84d('0x20')](0x8,0xc)+'-'+_0x5dc03d[_0xf84d('0x20')](0xc,0x10)+'-'+_0x5dc03d[_0xf84d('0x20')](0x10,0x14)+'-'+_0x5dc03d[_0xf84d('0x20')](0x14);}}; \ No newline at end of file +var _0x2e9c=['execSync','../environment','networkInterfaces','keys','length','filter','IPv4','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update','digest','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process'];(function(_0x44d40e,_0x385d76){var _0x49fa79=function(_0x4325c4){while(--_0x4325c4){_0x44d40e['push'](_0x44d40e['shift']());}};_0x49fa79(++_0x385d76);}(_0x2e9c,0x1a0));var _0xc2e9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2e9c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc2e9('0x0'));var os=require('os');var crypto=require(_0xc2e9('0x1'));var machine=require(_0xc2e9('0x2'));var exec=require(_0xc2e9('0x3'))[_0xc2e9('0x4')];var config=require(_0xc2e9('0x5'));function getInterfaces(){var _0x4927d7=[];var _0x17a32b=os[_0xc2e9('0x6')]();var _0x19f91c=_['orderBy'](_[_0xc2e9('0x7')](_0x17a32b));for(var _0x266196=0x0;_0x266196<_0x19f91c[_0xc2e9('0x8')];_0x266196++){var _0x13a63a=_0x17a32b[_0x19f91c[_0x266196]][_0xc2e9('0x9')](function(_0x18e870){return _0x18e870['family']===_0xc2e9('0xa')&&_0x18e870[_0xc2e9('0xb')]===![];});_0x4927d7=_0x4927d7['concat'](_0x13a63a);}return _0x4927d7;}function getFirstInterface(){var _0x29427a=_['head'](getInterfaces());return{'macAddress':_0x29427a&&_0x29427a[_0xc2e9('0xc')]?_0x29427a[_0xc2e9('0xc')]:_0xc2e9('0xd'),'ipAddress':_0x29427a&&_0x29427a[_0xc2e9('0xe')]?_0x29427a[_0xc2e9('0xe')]:_0xc2e9('0xf')};}exports[_0xc2e9('0x10')]=getFirstInterface;function getCPUhash(){var _0x33bf51=_['orderBy'](os[_0xc2e9('0x11')]()[_0xc2e9('0x12')](function(_0x3e3dbd){return _0x3e3dbd[_0xc2e9('0x13')];}))['join'](':');return crypto[_0xc2e9('0x14')](_0xc2e9('0x15'))[_0xc2e9('0x16')](_0x33bf51)[_0xc2e9('0x17')](_0xc2e9('0x18'));}exports['getUuid']=function(){var _0x30cca1=os[_0xc2e9('0x19')]();var _0x4a81bb=/[0-9a-f-]{36}/;if(config[_0xc2e9('0x1a')]&&_0x4a81bb[_0xc2e9('0x1b')](config[_0xc2e9('0x1a')])){return config[_0xc2e9('0x1a')];}else if(_0x30cca1===_0xc2e9('0x1c')){return exec(_0xc2e9('0x1d'),{'encoding':_0xc2e9('0x1e')})[_0xc2e9('0x1f')]('\x0d\x0a','');}else{var _0x377c8b=getFirstInterface();var _0x1b2ad0=getCPUhash();var _0x2f9310=_0x1b2ad0+'|'+os[_0xc2e9('0x20')]()+'|'+_0x377c8b['macAddress']+'|'+_0x377c8b[_0xc2e9('0x21')];var _0x3d867d=crypto[_0xc2e9('0x14')](_0xc2e9('0x15'))['update'](_0x2f9310)[_0xc2e9('0x17')](_0xc2e9('0x18'));return _0x3d867d[_0xc2e9('0x22')](0x0,0x8)+'-'+_0x3d867d[_0xc2e9('0x22')](0x8,0xc)+'-'+_0x3d867d[_0xc2e9('0x22')](0xc,0x10)+'-'+_0x3d867d[_0xc2e9('0x22')](0x10,0x14)+'-'+_0x3d867d[_0xc2e9('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 77df186..9bae5e4 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 _0xfa4d=['format','%s/api/servers/%s/check?version=%s','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','encryptString','diff','decryptString','days','YYYY-MM-DD\x20HH:mm','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','moment','request-promise','bluebird','version','../../components/encryptor','../logger','license'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xfa4d,0x14e));var _0xdfa4=function(_0xff5c1f,_0x1432c5){_0xff5c1f=_0xff5c1f-0x0;var _0x416808=_0xfa4d[_0xff5c1f];return _0x416808;};'use strict';var util=require(_0xdfa4('0x0'));var moment=require(_0xdfa4('0x1'));var rp=require(_0xdfa4('0x2'));var BPromise=require(_0xdfa4('0x3'));var pkginfo=require('pkginfo')(module,_0xdfa4('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xdfa4('0x5'));var hardware=require('./hardware');var logger=require(_0xdfa4('0x6'))(_0xdfa4('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x332ed5){return new BPromise(function(_0x2a7bd6,_0x52f269){var _0x359655=util[_0xdfa4('0x8')](_0xdfa4('0x9'),HOST,_0x332ed5,module['exports'][_0xdfa4('0x4')]);if(oldToken){_0x359655=util[_0xdfa4('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x332ed5,module['exports'][_0xdfa4('0x4')],oldToken);}var _0x56d195={'uri':_0x359655,'method':_0xdfa4('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x56d195)[_0xdfa4('0xb')](function(_0x3f1828){_0x2a7bd6(_0x3f1828);})['catch'](function(_0x5a2a56){_0x52f269(_0x5a2a56);});});}function manageLicense(_0x26b382,_0x32812c){var _0x6a5272=_0x32812c[_0xdfa4('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x6a5272[_0xdfa4('0xd')]!==_0x26b382&&!_0x6a5272[_0xdfa4('0xe')]){oldToken=_0x6a5272[_0xdfa4('0xd')];}httpRequest(_0x26b382)[_0xdfa4('0xb')](function(_0x2577b4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2577b4['active']){isOldTokenSent=![];if(!_0x6a5272['license']&&_0x6a5272['license']!=_0x2577b4['license']||_0x6a5272[_0xdfa4('0x7')]&&_0x6a5272[_0xdfa4('0xe')]){logger[_0xdfa4('0xf')](_0xdfa4('0x10'));}if(_0x6a5272['license']&&!_0x6a5272[_0xdfa4('0xe')]&&_0x6a5272[_0xdfa4('0x7')]!=_0x2577b4['license']){logger[_0xdfa4('0xf')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x6a5272[_0xdfa4('0x7')]&&!_0x6a5272[_0xdfa4('0xe')]&&_0x6a5272[_0xdfa4('0x7')]==_0x2577b4['license']){return _0x32812c;}return _0x32812c['update']({'data1':_0x26b382,'data2':null,'license':_0x2577b4[_0xdfa4('0x7')]});}else{if(_0x2577b4[_0xdfa4('0x7')]||_0x6a5272[_0xdfa4('0x7')]){if(!_0x6a5272[_0xdfa4('0xe')]){if(_0x6a5272[_0xdfa4('0xd')]==_0x26b382){GRAY_PERIOD_REASON='Disabled';logger[_0xdfa4('0xf')](_0xdfa4('0x11'));}else{GRAY_PERIOD_REASON=_0xdfa4('0x12');logger[_0xdfa4('0xf')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x6a5272[_0xdfa4('0xd')],_0x26b382);}logger[_0xdfa4('0xf')](_0xdfa4('0x13'),GRAY_PERIOD_REASON[_0xdfa4('0x14')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x32812c[_0xdfa4('0x15')]({'data2':encryptor[_0xdfa4('0x16')](moment()[_0xdfa4('0x8')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xdfa4('0x17')](encryptor[_0xdfa4('0x18')](_0x6a5272['data2']),_0xdfa4('0x19'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xdfa4('0x8')](_0xdfa4('0x1a')));isOldTokenSent=![];return _0x32812c[_0xdfa4('0x15')]({'data1':_0x26b382,'data2':null,'license':null});}}}else{if(_0x6a5272[_0xdfa4('0xd')]!=_0x26b382){logger[_0xdfa4('0xf')](_0xdfa4('0x1b'),_0x6a5272[_0xdfa4('0xd')],_0x26b382);return _0x32812c[_0xdfa4('0x15')]({'data1':_0x26b382,'data2':null,'license':null});}}}return _0x32812c;})[_0xdfa4('0xb')](function(_0x5ea129){_0x32812c=_0x5ea129;})[_0xdfa4('0x1c')](function(_0x258d43){logger['error'](_0x258d43['message']);})[_0xdfa4('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0xdfa4('0x1e')](),_0x32812c);},TIME);});}function defaultLicense(){var _0x3d0446=hardware['getUuid']();if(_0x3d0446){return db[_0xdfa4('0x1f')][_0xdfa4('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x3d0446}})[_0xdfa4('0x21')](function(_0x43b59b,_0x49585e){logger['info'](_0xdfa4('0x22'),_0x3d0446);manageLicense(_0x3d0446,_0x43b59b);})[_0xdfa4('0x1c')](function(_0xa54826){logger[_0xdfa4('0x23')](_0xa54826[_0xdfa4('0x24')]);});}}exports[_0xdfa4('0x25')]=defaultLicense; \ No newline at end of file +var _0xa7bc=['THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7bc,0x131));var _0xca7b=function(_0x21bc2b,_0x1f9cd5){_0x21bc2b=_0x21bc2b-0x0;var _0x34b38a=_0xa7bc[_0x21bc2b];return _0x34b38a;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0xca7b('0x0'));var BPromise=require(_0xca7b('0x1'));var pkginfo=require(_0xca7b('0x2'))(module,_0xca7b('0x3'));var db=require(_0xca7b('0x4'))['db'];var encryptor=require(_0xca7b('0x5'));var hardware=require(_0xca7b('0x6'));var logger=require(_0xca7b('0x7'))(_0xca7b('0x8'));var HOST=_0xca7b('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xee100d){return new BPromise(function(_0x536f37,_0x39c1bb){var _0x2f4ca5=util[_0xca7b('0xa')](_0xca7b('0xb'),HOST,_0xee100d,module['exports'][_0xca7b('0x3')]);if(oldToken){_0x2f4ca5=util['format'](_0xca7b('0xc'),HOST,_0xee100d,module[_0xca7b('0xd')][_0xca7b('0x3')],oldToken);}var _0x3cc192={'uri':_0x2f4ca5,'method':_0xca7b('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x3cc192)[_0xca7b('0xf')](function(_0x55cc92){_0x536f37(_0x55cc92);})[_0xca7b('0x10')](function(_0x5f4674){_0x39c1bb(_0x5f4674);});});}function manageLicense(_0x4bc5d7,_0x381aa7){var _0x5ba2ef=_0x381aa7[_0xca7b('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x5ba2ef[_0xca7b('0x12')]!==_0x4bc5d7&&!_0x5ba2ef[_0xca7b('0x13')]){oldToken=_0x5ba2ef[_0xca7b('0x12')];}httpRequest(_0x4bc5d7)[_0xca7b('0xf')](function(_0x119e20){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x119e20[_0xca7b('0x14')]){isOldTokenSent=![];if(!_0x5ba2ef['license']&&_0x5ba2ef[_0xca7b('0x8')]!=_0x119e20[_0xca7b('0x8')]||_0x5ba2ef[_0xca7b('0x8')]&&_0x5ba2ef['data2']){logger[_0xca7b('0x15')](_0xca7b('0x16'));}if(_0x5ba2ef[_0xca7b('0x8')]&&!_0x5ba2ef[_0xca7b('0x13')]&&_0x5ba2ef[_0xca7b('0x8')]!=_0x119e20[_0xca7b('0x8')]){logger['info'](_0xca7b('0x17'));}if(_0x5ba2ef[_0xca7b('0x8')]&&!_0x5ba2ef[_0xca7b('0x13')]&&_0x5ba2ef[_0xca7b('0x8')]==_0x119e20['license']){return _0x381aa7;}return _0x381aa7[_0xca7b('0x18')]({'data1':_0x4bc5d7,'data2':null,'license':_0x119e20[_0xca7b('0x8')]});}else{if(_0x119e20[_0xca7b('0x8')]||_0x5ba2ef[_0xca7b('0x8')]){if(!_0x5ba2ef['data2']){if(_0x5ba2ef[_0xca7b('0x12')]==_0x4bc5d7){GRAY_PERIOD_REASON=_0xca7b('0x19');logger[_0xca7b('0x15')](_0xca7b('0x1a'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xca7b('0x15')](_0xca7b('0x1b'),_0x5ba2ef[_0xca7b('0x12')],_0x4bc5d7);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xca7b('0x1c')](),moment()[_0xca7b('0xa')](_0xca7b('0x1d')));return _0x381aa7['update']({'data2':encryptor[_0xca7b('0x1e')](moment()[_0xca7b('0xa')](_0xca7b('0x1d')))});}else{if(moment()[_0xca7b('0x1f')](encryptor[_0xca7b('0x20')](_0x5ba2ef[_0xca7b('0x13')]),'days')>DAYS){logger[_0xca7b('0x15')](_0xca7b('0x21'),moment()['format'](_0xca7b('0x1d')));isOldTokenSent=![];return _0x381aa7[_0xca7b('0x18')]({'data1':_0x4bc5d7,'data2':null,'license':null});}}}else{if(_0x5ba2ef['data1']!=_0x4bc5d7){logger[_0xca7b('0x15')](_0xca7b('0x1b'),_0x5ba2ef[_0xca7b('0x12')],_0x4bc5d7);return _0x381aa7[_0xca7b('0x18')]({'data1':_0x4bc5d7,'data2':null,'license':null});}}}return _0x381aa7;})[_0xca7b('0xf')](function(_0x56fa43){_0x381aa7=_0x56fa43;})[_0xca7b('0x10')](function(_0x24bc0d){logger[_0xca7b('0x22')](_0x24bc0d[_0xca7b('0x23')]);})[_0xca7b('0x24')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x381aa7);},TIME);});}function defaultLicense(){var _0x59c60e=hardware['getUuid']();if(_0x59c60e){return db[_0xca7b('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x59c60e}})[_0xca7b('0x26')](function(_0xca28fc,_0x46e885){logger[_0xca7b('0x15')](_0xca7b('0x27'),_0x59c60e);manageLicense(_0x59c60e,_0xca28fc);})[_0xca7b('0x10')](function(_0x303451){logger[_0xca7b('0x22')](_0x303451['message']);});}}exports[_0xca7b('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e3fa539..7de5fbb 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 _0x2bc4=['2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','days','grayReason','changed','disabled','findAll','sequelize','COUNT','col','role','count','user','telephone','forEach','admin','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','../../components/encryptor','../../mysqldb'];(function(_0x134005,_0xf81813){var _0x454a20=function(_0x42a9e8){while(--_0x42a9e8){_0x134005['push'](_0x134005['shift']());}};_0x454a20(++_0xf81813);}(_0x2bc4,0xdc));var _0x42bc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2bc4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x42bc('0x0'));var moment=require(_0x42bc('0x1'));var BPromise=require(_0x42bc('0x2'));var hardware=require('./hardware');var encryptor=require(_0x42bc('0x3'));var db=require(_0x42bc('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x42bc('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x42bc('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3ff495){return new BPromise(function(_0x3095e7,_0x1d14e5){return db[_0x42bc('0x7')][_0x42bc('0x8')](_[_0x42bc('0x9')](_0x3ff495,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x18c990){return checkLicense(_0x18c990,null);})[_0x42bc('0xa')](function(_0x29af3a){_0x3095e7(_0x29af3a);return;})['catch'](function(_0x1ed390){_0x1d14e5(_0x1ed390);});});}function checkLicense(_0x24ea82,_0x2adb50){if(!_0x24ea82){demoLicense['uuid']=_0x24ea82['data1'];return demoLicense;}try{var _0x11ee1f=_0x2adb50||_0x24ea82['license'];if(_[_0x42bc('0xb')](_0x11ee1f)){throw new Error(_0x42bc('0xc'));}var _0x53ccc9=_0x24ea82[_0x42bc('0xd')];var _0x2f5ad0=_0x24ea82[_0x42bc('0xe')];var _0x20883e=_0x53ccc9[_0x42bc('0xf')]('-')[0x4];var _0x178f59=_0x53ccc9['split']('-')[0x0];var _0x38d49b=encryptor[_0x42bc('0x10')](_0x11ee1f,util[_0x42bc('0x11')](_0x42bc('0x12'),_0x20883e,_0x53ccc9,_0x178f59));var _0x35a10c=JSON[_0x42bc('0x13')](_0x38d49b);_0x35a10c[_0x42bc('0x14')]=![];_0x35a10c[_0x42bc('0x15')]=_0x53ccc9;_0x35a10c[_0x42bc('0x16')]=hardware['getUuid']();if(_0x2f5ad0){var _0x4dd23f=encryptor[_0x42bc('0x10')](_0x2f5ad0);_0x35a10c[_0x42bc('0x17')]=_0x4dd23f;_0x35a10c[_0x42bc('0x18')]=moment(_0x4dd23f)['add'](0x7,_0x42bc('0x19'))['format']();_0x35a10c[_0x42bc('0x1a')]=_0x35a10c[_0x42bc('0x15')]!=_0x35a10c[_0x42bc('0x16')]?_0x42bc('0x1b'):_0x42bc('0x1c');}return _0x35a10c;}catch(_0x2d4e22){breakingLicense[_0x42bc('0x15')]=_0x24ea82[_0x42bc('0xd')];breakingLicense['message']=_0x2d4e22['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5d3f05,_0x4a3e3e){getLicense()[_0x42bc('0xa')](function(_0x23e464){return db['User'][_0x42bc('0x1d')]({'attributes':['role',[db[_0x42bc('0x1e')]['fn'](_0x42bc('0x1f'),db['sequelize'][_0x42bc('0x20')](_0x42bc('0x21'))),_0x42bc('0x22')]],'group':_0x42bc('0x21'),'where':{'role':{'$or':['admin',_0x42bc('0x23'),_0x42bc('0x24')]}},'raw':!![]})['then'](function(_0x206026){var _0x248273={'user':_0x23e464['users']||0x0,'telephone':_0x23e464['telephones']||0x0};_0x206026[_0x42bc('0x25')](function(_0x24e8cb){var _0x48daa4=_0x24e8cb['role']===_0x42bc('0x26')?_0x42bc('0x23'):_0x24e8cb[_0x42bc('0x21')];_0x248273[_0x48daa4]-=_0x24e8cb['count'];if(_0x248273[_0x48daa4]<0x0)_0x248273[_0x48daa4]=0x0;});_0x5d3f05(_0x248273);return;});})[_0x42bc('0x27')](function(_0xecc8a2){_0x4a3e3e(_0xecc8a2);});});}function checkUserLimits(_0x198abf){return new BPromise(function(_0x2a3d70,_0x4774b8){getLimits()[_0x42bc('0xa')](function(_0x4d49e7){var _0x4b56ea=_[_0x42bc('0x28')](_[_0x42bc('0x29')](_0x198abf,_0x42bc('0x21')),['admin',_0x42bc('0x23'),_0x42bc('0x24')]);var _0x21a292=(_0x4b56ea['admin']||0x0)+(_0x4b56ea[_0x42bc('0x23')]||0x0);var _0x5bc1bc=_0x4b56ea[_0x42bc('0x24')]||0x0;if(_0x21a292>_0x4d49e7[_0x42bc('0x23')])return _0x4774b8(_0x42bc('0x2a'));if(_0x5bc1bc>_0x4d49e7['telephone'])return _0x4774b8(_0x42bc('0x2b'));return _0x2a3d70();})[_0x42bc('0x27')](function(_0x564c67){_0x4774b8(_0x564c67);});});}module[_0x42bc('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x5afd=['exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','find','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','gray','deadline','days','grayReason','uuid','machineUuid','changed','message','User','role','sequelize','COUNT','col','count','admin','users','telephones','user','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0x40162e,_0x5aaf3d){var _0x39791c=function(_0x45a1d6){while(--_0x45a1d6){_0x40162e['push'](_0x40162e['shift']());}};_0x39791c(++_0x5aaf3d);}(_0x5afd,0x1c3));var _0xd5af=function(_0x2d9b4f,_0x597016){_0x2d9b4f=_0x2d9b4f-0x0;var _0x6c1c59=_0x5afd[_0x2d9b4f];return _0x6c1c59;};'use strict';var util=require(_0xd5af('0x0'));var _=require(_0xd5af('0x1'));var moment=require(_0xd5af('0x2'));var BPromise=require(_0xd5af('0x3'));var hardware=require(_0xd5af('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0xd5af('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd5af('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd5af('0x7'),'machineUuid':hardware[_0xd5af('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xd5af('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1d54b2){return new BPromise(function(_0xf9cf59,_0x5328e1){return db['License'][_0xd5af('0x9')](_['defaults'](_0x1d54b2,{'raw':!![],'where':{'id':0x1}}))[_0xd5af('0xa')](function(_0xf4b543){return checkLicense(_0xf4b543,null);})['then'](function(_0x4e0d0d){_0xf9cf59(_0x4e0d0d);return;})[_0xd5af('0xb')](function(_0x1fe76b){_0x5328e1(_0x1fe76b);});});}function checkLicense(_0xb79a58,_0x122f23){if(!_0xb79a58){demoLicense['uuid']=_0xb79a58[_0xd5af('0xc')];return demoLicense;}try{var _0x58f0f0=_0x122f23||_0xb79a58[_0xd5af('0xd')];if(_[_0xd5af('0xe')](_0x58f0f0)){throw new Error(_0xd5af('0xf'));}var _0x315fea=_0xb79a58[_0xd5af('0xc')];var _0x214f7b=_0xb79a58[_0xd5af('0x10')];var _0x140447=_0x315fea[_0xd5af('0x11')]('-')[0x4];var _0x22aea7=_0x315fea[_0xd5af('0x11')]('-')[0x0];var _0xe222ae=encryptor[_0xd5af('0x12')](_0x58f0f0,util[_0xd5af('0x13')]('%s:%s:%s',_0x140447,_0x315fea,_0x22aea7));var _0xf0256=JSON[_0xd5af('0x14')](_0xe222ae);_0xf0256['demo']=![];_0xf0256['uuid']=_0x315fea;_0xf0256['machineUuid']=hardware[_0xd5af('0x8')]();if(_0x214f7b){var _0x1c9fcf=encryptor[_0xd5af('0x12')](_0x214f7b);_0xf0256[_0xd5af('0x15')]=_0x1c9fcf;_0xf0256[_0xd5af('0x16')]=moment(_0x1c9fcf)['add'](0x7,_0xd5af('0x17'))['format']();_0xf0256[_0xd5af('0x18')]=_0xf0256[_0xd5af('0x19')]!=_0xf0256[_0xd5af('0x1a')]?_0xd5af('0x1b'):'disabled';}return _0xf0256;}catch(_0x27353c){breakingLicense[_0xd5af('0x19')]=_0xb79a58[_0xd5af('0xc')];breakingLicense[_0xd5af('0x1c')]=_0x27353c['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4460a6,_0x58d6c4){getLicense()['then'](function(_0x8e1483){return db[_0xd5af('0x1d')]['findAll']({'attributes':[_0xd5af('0x1e'),[db[_0xd5af('0x1f')]['fn'](_0xd5af('0x20'),db[_0xd5af('0x1f')][_0xd5af('0x21')](_0xd5af('0x1e'))),_0xd5af('0x22')]],'group':_0xd5af('0x1e'),'where':{'role':{'$or':[_0xd5af('0x23'),'user','telephone']}},'raw':!![]})[_0xd5af('0xa')](function(_0x27518f){var _0x34b6c4={'user':_0x8e1483[_0xd5af('0x24')]||0x0,'telephone':_0x8e1483[_0xd5af('0x25')]||0x0};_0x27518f['forEach'](function(_0x562887){var _0x4f9d76=_0x562887[_0xd5af('0x1e')]===_0xd5af('0x23')?_0xd5af('0x26'):_0x562887[_0xd5af('0x1e')];_0x34b6c4[_0x4f9d76]-=_0x562887[_0xd5af('0x22')];if(_0x34b6c4[_0x4f9d76]<0x0)_0x34b6c4[_0x4f9d76]=0x0;});_0x4460a6(_0x34b6c4);return;});})[_0xd5af('0xb')](function(_0x46e6de){_0x58d6c4(_0x46e6de);});});}function checkUserLimits(_0x39ffa4){return new BPromise(function(_0x4e454a,_0x2435c0){getLimits()[_0xd5af('0xa')](function(_0x557b96){var _0x35577f=_[_0xd5af('0x27')](_[_0xd5af('0x28')](_0x39ffa4,'role'),[_0xd5af('0x23'),_0xd5af('0x26'),'telephone']);var _0x52976e=(_0x35577f[_0xd5af('0x23')]||0x0)+(_0x35577f['user']||0x0);var _0x264346=_0x35577f[_0xd5af('0x29')]||0x0;if(_0x52976e>_0x557b96['user'])return _0x2435c0(_0xd5af('0x2a'));if(_0x264346>_0x557b96[_0xd5af('0x29')])return _0x2435c0(_0xd5af('0x2b'));return _0x4e454a();})['catch'](function(_0x5b416e){_0x2435c0(_0x5b416e);});});}module[_0xd5af('0x2c')]={'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 fc1e397..9b4e13e 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 _0x77e6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x332fb5,_0x42ea2f){var _0x5a1f0a=function(_0x3adb05){while(--_0x3adb05){_0x332fb5['push'](_0x332fb5['shift']());}};_0x5a1f0a(++_0x42ea2f);}(_0x77e6,0x1a6));var _0x677e=function(_0x104a5b,_0x1e9635){_0x104a5b=_0x104a5b-0x0;var _0x430356=_0x77e6[_0x104a5b];return _0x430356;};'use strict';module[_0x677e('0x0')]={'DOMAIN':_0x677e('0x1'),'SESSION_SECRET':_0x677e('0x2'),'GOOGLE_ID':_0x677e('0x3'),'GOOGLE_SECRET':_0x677e('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x3423=['app-id','secret','myappanuglar-secret'];(function(_0x2c4841,_0x1beaaf){var _0x5e4d4d=function(_0xc2d2f4){while(--_0xc2d2f4){_0x2c4841['push'](_0x2c4841['shift']());}};_0x5e4d4d(++_0x1beaaf);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3342('0x0'),'GOOGLE_ID':_0x3342('0x1'),'GOOGLE_SECRET':_0x3342('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 9919a1f..3c3217f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea3b=['fileLogger','exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xea3b,0xd6));var _0xbea3=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0xea3b[_0x3653c7];return _0x58a021;};'use strict';var fileLogger=require('../utils/loggers')[_0xbea3('0x0')];module[_0xbea3('0x1')]=fileLogger; \ No newline at end of file +var _0xf7db=['../utils/loggers','fileLogger','exports'];(function(_0x584875,_0x5509b0){var _0x1c170a=function(_0x38dc93){while(--_0x38dc93){_0x584875['push'](_0x584875['shift']());}};_0x1c170a(++_0x5509b0);}(_0xf7db,0x96));var _0xbf7d=function(_0xb04cdd,_0x42c6e7){_0xb04cdd=_0xb04cdd-0x0;var _0x5c2d03=_0xf7db[_0xb04cdd];return _0x5c2d03;};'use strict';var fileLogger=require(_0xbf7d('0x0'))[_0xbf7d('0x1')];module[_0xbf7d('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 582bbe7..bef6cde 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 _0xf2c0=['join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf2c0,0x176));var _0x0f2c=function(_0x5d3a42,_0x72e14){_0x5d3a42=_0x5d3a42-0x0;var _0x1dd612=_0xf2c0[_0x5d3a42];return _0x1dd612;};'use strict';var path=require(_0x0f2c('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path[_0x0f2c('0x1')](cfg[_0x0f2c('0x2')],_0x0f2c('0x3')))};var pm2config={'apps':[{'name':_0x0f2c('0x4'),'script':path[_0x0f2c('0x1')](__dirname,_0x0f2c('0x5')),'env':env},{'name':_0x0f2c('0x6'),'script':path['join'](__dirname,_0x0f2c('0x7')),'env':env},{'name':_0x0f2c('0x8'),'script':path[_0x0f2c('0x1')](__dirname,_0x0f2c('0x9')),'env':env},{'name':_0x0f2c('0xa'),'script':path[_0x0f2c('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x0f2c('0xb'),'script':path['join'](__dirname,_0x0f2c('0xc')),'env':env},{'name':'xdr','script':path[_0x0f2c('0x1')](__dirname,_0x0f2c('0xd')),'env':env}]};module[_0x0f2c('0xe')]=pm2config; \ No newline at end of file +var _0x9996=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','../../config/environment','resolve','join','legacy-libs','../../services/express/index.js','ami'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x9996,0x1e4));var _0x6999=function(_0x4a0ebf,_0x55ba40){_0x4a0ebf=_0x4a0ebf-0x0;var _0x181f1e=_0x9996[_0x4a0ebf];return _0x181f1e;};'use strict';var path=require('path');var cfg=require(_0x6999('0x0'));var env={'NODE_PATH':path[_0x6999('0x1')](path[_0x6999('0x2')](cfg['root'],_0x6999('0x3')))};var pm2config={'apps':[{'name':'express','script':path[_0x6999('0x2')](__dirname,_0x6999('0x4')),'env':env},{'name':_0x6999('0x5'),'script':path[_0x6999('0x2')](__dirname,_0x6999('0x6')),'env':env},{'name':_0x6999('0x7'),'script':path[_0x6999('0x2')](__dirname,_0x6999('0x8')),'env':env},{'name':_0x6999('0x9'),'script':path[_0x6999('0x2')](__dirname,_0x6999('0xa')),'env':env},{'name':'routing','script':path['join'](__dirname,_0x6999('0xb')),'env':env},{'name':_0x6999('0xc'),'script':path[_0x6999('0x2')](__dirname,_0x6999('0xd')),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index ef33c7d..ef20215 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 _0xa31b=['then','stop','restart','list','delete','dump','bluebird','connect','connected','disconnect'];(function(_0x4a48b2,_0x5b51fc){var _0x452e59=function(_0x551540){while(--_0x551540){_0x4a48b2['push'](_0x4a48b2['shift']());}};_0x452e59(++_0x5b51fc);}(_0xa31b,0x114));var _0xba31=function(_0x4289eb,_0x3860ce){_0x4289eb=_0x4289eb-0x0;var _0x1bea5d=_0xa31b[_0x4289eb];return _0x1bea5d;};'use strict';var pm2=require('pm2');var BPromise=require(_0xba31('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x15857a,_0x347d7d){return pm2[_0xba31('0x1')](function(_0x369678){if(_0x369678){return _0x347d7d(_0x369678);}return _0x15857a(_0xba31('0x2'));});});};exports['start']=function(_0x47cd39){return connect()['then'](function(){return new BPromise(function(_0x148cc9,_0x3c299c){return pm2['start'](_0x47cd39,function(_0x2f821f,_0x62246e){if(_0x2f821f){return _0x3c299c(_0x2f821f);}pm2[_0xba31('0x3')]();return _0x148cc9(_0x62246e);});});});};exports['stop']=function(_0x246cd2){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x3de460,_0x165762){return pm2[_0xba31('0x5')](_0x246cd2,function(_0x366ae4,_0x1be068){if(_0x366ae4){return _0x165762(_0x366ae4);}pm2['disconnect']();return _0x3de460(_0x1be068);});});});};exports['restart']=function(_0x17ec59){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x3436e9,_0x4d41ec){return pm2[_0xba31('0x6')](_0x17ec59,function(_0x3d8dc8,_0x19b85a){if(_0x3d8dc8){return _0x4d41ec(_0x3d8dc8);}pm2[_0xba31('0x3')]();return _0x3436e9(_0x19b85a);});});});};exports[_0xba31('0x7')]=function(){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x15890a,_0x439bee){return pm2[_0xba31('0x7')](function(_0x238f96,_0x1b022c){if(_0x238f96){return _0x439bee(_0x238f96);}pm2[_0xba31('0x3')]();return _0x15890a(_0x1b022c);});});});};exports['describe']=function(_0x15b2b6){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x3e744b,_0x407de6){return pm2['describe'](_0x15b2b6,function(_0x4b32d7,_0x2de2dd){if(_0x4b32d7){return _0x407de6(_0x4b32d7);}pm2['disconnect']();return _0x3e744b(_0x2de2dd);});});});};exports[_0xba31('0x8')]=function(_0x1ee270){return connect()['then'](function(){return new BPromise(function(_0x52d02b,_0x25bb92){return pm2[_0xba31('0x8')](_0x1ee270,function(_0x337054,_0x54fada){if(_0x337054){return _0x25bb92(_0x337054);}pm2[_0xba31('0x3')]();return _0x52d02b(_0x54fada);});});});};exports[_0xba31('0x9')]=function(){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x22bd4e,_0x395b3d){return pm2[_0xba31('0x9')](function(_0xf52dae){if(_0xf52dae){return _0x395b3d(_0xf52dae);}return _0x22bd4e('saved');});});});}; \ No newline at end of file +var _0xdda9=['then','start','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xdda9,0x168));var _0x9dda=function(_0x2c4c48,_0x402353){_0x2c4c48=_0x2c4c48-0x0;var _0x5ee161=_0xdda9[_0x2c4c48];return _0x5ee161;};'use strict';var pm2=require(_0x9dda('0x0'));var BPromise=require(_0x9dda('0x1'));var config=require(_0x9dda('0x2'));function connect(){return new BPromise(function(_0x40821b,_0x292501){return pm2[_0x9dda('0x3')](function(_0x345364){if(_0x345364){return _0x292501(_0x345364);}return _0x40821b('connected');});});};exports['start']=function(_0x3e9dc8){return connect()[_0x9dda('0x4')](function(){return new BPromise(function(_0x125d4e,_0x33be75){return pm2[_0x9dda('0x5')](_0x3e9dc8,function(_0x5171b4,_0xda31e2){if(_0x5171b4){return _0x33be75(_0x5171b4);}pm2[_0x9dda('0x6')]();return _0x125d4e(_0xda31e2);});});});};exports[_0x9dda('0x7')]=function(_0x4e7b16){return connect()[_0x9dda('0x4')](function(){return new BPromise(function(_0x28aab2,_0x30b2f5){return pm2[_0x9dda('0x7')](_0x4e7b16,function(_0x53eff8,_0x18d20d){if(_0x53eff8){return _0x30b2f5(_0x53eff8);}pm2['disconnect']();return _0x28aab2(_0x18d20d);});});});};exports[_0x9dda('0x8')]=function(_0x4694ed){return connect()['then'](function(){return new BPromise(function(_0x5f57d1,_0x559e55){return pm2['restart'](_0x4694ed,function(_0x4ac269,_0x4b5f36){if(_0x4ac269){return _0x559e55(_0x4ac269);}pm2[_0x9dda('0x6')]();return _0x5f57d1(_0x4b5f36);});});});};exports[_0x9dda('0x9')]=function(){return connect()[_0x9dda('0x4')](function(){return new BPromise(function(_0x327a4a,_0xcee3a6){return pm2['list'](function(_0x39b688,_0x217130){if(_0x39b688){return _0xcee3a6(_0x39b688);}pm2['disconnect']();return _0x327a4a(_0x217130);});});});};exports[_0x9dda('0xa')]=function(_0x2390b4){return connect()['then'](function(){return new BPromise(function(_0x369f4b,_0x432aac){return pm2['describe'](_0x2390b4,function(_0x15a4a9,_0x31a8d9){if(_0x15a4a9){return _0x432aac(_0x15a4a9);}pm2['disconnect']();return _0x369f4b(_0x31a8d9);});});});};exports[_0x9dda('0xb')]=function(_0x51d7a2){return connect()[_0x9dda('0x4')](function(){return new BPromise(function(_0x388563,_0x46d87c){return pm2[_0x9dda('0xb')](_0x51d7a2,function(_0x55faa3,_0x50a3ea){if(_0x55faa3){return _0x46d87c(_0x55faa3);}pm2['disconnect']();return _0x388563(_0x50a3ea);});});});};exports['dump']=function(){return connect()[_0x9dda('0x4')](function(){return new BPromise(function(_0x34c43d,_0x465e49){return pm2[_0x9dda('0xc')](function(_0x511253){if(_0x511253){return _0x465e49(_0x511253);}return _0x34c43d(_0x9dda('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index da55fa2..e951d93 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 _0xcaab=['emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','localhost','redis','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x249514,_0x289a22){var _0x3f1f18=function(_0x5a1070){while(--_0x5a1070){_0x249514['push'](_0x249514['shift']());}};_0x3f1f18(++_0x289a22);}(_0xcaab,0x15b));var _0xbcaa=function(_0x54cedc,_0x573701){_0x54cedc=_0x54cedc-0x0;var _0x302703=_0xcaab[_0x54cedc];return _0x302703;};'use strict';var _=require(_0xbcaa('0x0'));var moment=require(_0xbcaa('0x1'));var Redis=require(_0xbcaa('0x2'));var util=require(_0xbcaa('0x3'));var config=require(_0xbcaa('0x4'));var db=require(_0xbcaa('0x5'))['db'];var logger=require(_0xbcaa('0x6'))(_0xbcaa('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0xbcaa('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbcaa('0x9')]));function closeInteractions(){var _0x1d33d1=0x0;var _0x5810f5=[];return db[_0xbcaa('0xa')][_0xbcaa('0xb')]({'raw':!![],'attributes':['id',_0xbcaa('0xc')],'where':{'id':0x1}})[_0xbcaa('0xd')](function(_0x4551ae){_0x1d33d1=_0x4551ae['chatTimeout'];if(_0x1d33d1){return db[_0xbcaa('0xe')][_0xbcaa('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xbcaa('0x10')](_0x4551ae[_0xbcaa('0xc')],_0xbcaa('0x11'))}}});}else{return[];}})[_0xbcaa('0xd')](function(_0x2ce8ac){if(_0x2ce8ac&&_0x2ce8ac[_0xbcaa('0x12')]){_0x5810f5=_[_0xbcaa('0x13')](_0x2ce8ac||[],'id');logger[_0xbcaa('0x14')](_0xbcaa('0x15'),_0x5810f5[_0xbcaa('0x16')]());return db['ChatInteraction']['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xbcaa('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5810f5}});}})['then'](function(){if(_0x5810f5&&_0x5810f5[_0xbcaa('0x12')]){logger[_0xbcaa('0x14')](_0xbcaa('0x18'),_0x5810f5[_0xbcaa('0x16')]());for(var _0x21c204=0x0;_0x21c204<_0x5810f5['length'];_0x21c204++){io[_0xbcaa('0x19')]('chatInteraction:update',{'id':_0x5810f5[_0x21c204],'closed':!![]});}}})[_0xbcaa('0x1a')](function(_0x4edade){logger[_0xbcaa('0x1b')](_0xbcaa('0x1c'),_0x4edade?util[_0xbcaa('0x1d')](_0x4edade,{'showHidden':![],'depth':null}):'');});}exports[_0xbcaa('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9070=['ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','lastMsgAt','subtract','minutes','then','length','map','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment'];(function(_0x3960d2,_0x1f82c5){var _0x2c02a2=function(_0x5d631b){while(--_0x5d631b){_0x3960d2['push'](_0x3960d2['shift']());}};_0x2c02a2(++_0x1f82c5);}(_0x9070,0x1cd));var _0x0907=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x9070[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require('lodash');var moment=require(_0x0907('0x0'));var Redis=require(_0x0907('0x1'));var util=require(_0x0907('0x2'));var config=require(_0x0907('0x3'));var db=require(_0x0907('0x4'))['db'];var logger=require(_0x0907('0x5'))(_0x0907('0x6'));config[_0x0907('0x7')]=_[_0x0907('0x8')](config[_0x0907('0x7')],{'host':_0x0907('0x9'),'port':0x18eb});var io=require(_0x0907('0xa'))(new Redis(config[_0x0907('0x7')]));function closeInteractions(){var _0x395946=0x0;var _0x47f43f=[];return db[_0x0907('0xb')]['find']({'raw':!![],'attributes':['id',_0x0907('0xc')],'where':{'id':0x1}})['then'](function(_0x49763b){_0x395946=_0x49763b[_0x0907('0xc')];if(_0x395946){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x0907('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0907('0xe')](_0x49763b[_0x0907('0xc')],_0x0907('0xf'))}}});}else{return[];}})[_0x0907('0x10')](function(_0x1c310c){if(_0x1c310c&&_0x1c310c[_0x0907('0x11')]){_0x47f43f=_[_0x0907('0x12')](_0x1c310c||[],'id');logger['info'](_0x0907('0x13'),_0x47f43f['join']());return db['ChatInteraction'][_0x0907('0x14')]({'closeReason':_0x0907('0x15'),'disposition':_0x0907('0x16'),'closed':!![],'closedAt':moment()[_0x0907('0x17')](_0x0907('0x18'))},{'where':{'id':_0x47f43f}});}})[_0x0907('0x10')](function(){if(_0x47f43f&&_0x47f43f['length']){logger[_0x0907('0x19')](_0x0907('0x1a'),_0x47f43f[_0x0907('0x1b')]());for(var _0x2f3808=0x0;_0x2f3808<_0x47f43f[_0x0907('0x11')];_0x2f3808++){io[_0x0907('0x1c')](_0x0907('0x1d'),{'id':_0x47f43f[_0x2f3808],'closed':!![]});}}})['catch'](function(_0x14f0b2){logger[_0x0907('0x1e')](_0x0907('0x1f'),_0x14f0b2?util['inspect'](_0x14f0b2,{'showHidden':![],'depth':null}):'');});}exports[_0x0907('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 619cf15..f5c1367 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1570=['startAllRefreshIntervals'];(function(_0x185bff,_0x1a4ad7){var _0x9978b9=function(_0x20b3cc){while(--_0x20b3cc){_0x185bff['push'](_0x185bff['shift']());}};_0x9978b9(++_0x1a4ad7);}(_0x1570,0x16c));var _0x0157=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x1570[_0xf50820];return _0x2a9b10;};'use strict';function start(){var _0x1f425f=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1f425f[_0x0157('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x7b88=['exports','startAllRefreshIntervals'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7b88,0x115));var _0x87b8=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x7b88[_0x12f688];return _0x59c3de;};'use strict';function start(){var _0x425796=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x425796[_0x87b8('0x0')]();}module[_0x87b8('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 3999393..16afc8d 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 _0xf048=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','data','stringify','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','start','stop\x20cron','endAt','update','update\x20cron','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x4201f9,_0x5196ac){var _0x1e2848=function(_0x58923d){while(--_0x58923d){_0x4201f9['push'](_0x4201f9['shift']());}};_0x1e2848(++_0x5196ac);}(_0xf048,0x182));var _0x8f04=function(_0x16730f,_0xcee12e){_0x16730f=_0x16730f-0x0;var _0x1998a9=_0xf048[_0x16730f];return _0x1998a9;};'use strict';var fs=require('fs');var util=require(_0x8f04('0x0'));var path=require(_0x8f04('0x1'));var _=require(_0x8f04('0x2'));var moment=require(_0x8f04('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x8f04('0x4'));var BPromise=require(_0x8f04('0x5'));var logger=require(_0x8f04('0x6'))(_0x8f04('0x7'));var db=require(_0x8f04('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x8f04('0x9'));var client=jayson[_0x8f04('0xa')][_0x8f04('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2e5cf3,_0x261d82){return function(){logger[_0x8f04('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2e5cf3[_0x8f04('0xd')]);var _0x38d2a5=!![];var _0x56c8fc=_0x2e5cf3['MailAccount'][_0x8f04('0xe')]();var _0x37801c={'account':_0x56c8fc,'message':{'from':util[_0x8f04('0xf')](_0x8f04('0x10'),_0x2e5cf3[_0x8f04('0x11')][_0x8f04('0x12')],_0x2e5cf3['MailAccount'][_0x8f04('0xd')]||_0x2e5cf3['MailAccount'][_0x8f04('0x13')][_0x8f04('0x14')]),'to':_0x2e5cf3[_0x8f04('0xd')],'cc':_0x2e5cf3['cc'],'bcc':_0x2e5cf3[_0x8f04('0x15')],'subject':util[_0x8f04('0xf')](_0x8f04('0x16'),_0x261d82[_0x8f04('0x12')],_0x2e5cf3[_0x8f04('0x17')],_0x2e5cf3[_0x8f04('0x18')])}};var _0x3efe75=path['join'](__dirname,_0x8f04('0x19'));var _0x3c275a=_0x261d82[_0x8f04('0x1a')];var _0x1b05b4=util['format'](_0x8f04('0x1b'),path[_0x8f04('0x1c')](_0x261d82[_0x8f04('0x1a')],path['extname'](_0x261d82[_0x8f04('0x1a')])),_0x8f04('0x1d'));var _0x338022=path[_0x8f04('0x1e')](_0x3efe75,_0x3c275a);var _0x24c442=path[_0x8f04('0x1e')](_0x3efe75,_0x1b05b4);if(fs[_0x8f04('0x1f')](_0x338022)){_0x261d82[_0x8f04('0x20')]=_0x8f04('0x21');_0x37801c[_0x8f04('0x22')][_0x8f04('0x23')]=[{'filename':_0x3c275a,'path':_0x338022}];_0x37801c[_0x8f04('0x22')][_0x8f04('0x24')]=util[_0x8f04('0xf')](_0x8f04('0x25'),JSON['stringify'](_0x261d82,null,0x2));}else if(fs[_0x8f04('0x1f')](_0x24c442)){_0x261d82[_0x8f04('0x20')]=_0x8f04('0x21');_0x37801c['message'][_0x8f04('0x23')]=[{'filename':_0x1b05b4,'path':_0x24c442}];}else{_0x37801c[_0x8f04('0x22')][_0x8f04('0x24')]=_0x8f04('0x26');if(!_0x2e5cf3[_0x8f04('0x27')]){_0x38d2a5=![];logger[_0x8f04('0xc')](_0x8f04('0x28'));}}if(_0x38d2a5){return client[_0x8f04('0x29')]('SendMail',_0x37801c)[_0x8f04('0x2a')](function(_0x2797d5){if(_0x2797d5[_0x8f04('0x2b')]){return logger[_0x8f04('0x2b')](_0x8f04('0x2c'),JSON['stringify'](_0x2797d5));}return logger[_0x8f04('0xc')](_0x8f04('0x2d'));})[_0x8f04('0x2e')](function(_0x2818ca){return logger[_0x8f04('0x2b')]('error\x20mail',JSON['stringify'](_0x2818ca));});}};}function handleError(){return function(_0x1f931c){return logger['error'](JSON['stringify'](_0x1f931c));};}function handleResult(_0x292840){return function(_0xdd7e17){logger[_0x8f04('0xc')](_0x8f04('0x2f'),JSON[_0x8f04('0x30')](_0xdd7e17));if(_0x292840[_0x8f04('0x11')]&&_0x292840[_0x8f04('0x11')][_0x8f04('0x13')]&&!_[_0x8f04('0x31')](_0x292840[_0x8f04('0xd')])){setTimeout(handleSendEmail(_0x292840,_0xdd7e17),0x3c*0x3e8);}};}function handleJob(_0x4148de){return function(){try{if(_[_0x8f04('0x31')](_0x4148de['subtractNumber'])){return logger[_0x8f04('0xc')](_0x8f04('0x32'));}if(_[_0x8f04('0x31')](_0x4148de[_0x8f04('0x18')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x305a52={'startDate':moment()['subtract'](_0x4148de[_0x8f04('0x17')],_0x4148de[_0x8f04('0x18')])[_0x8f04('0xf')](_0x8f04('0x33')),'endDate':moment()[_0x8f04('0xf')](_0x8f04('0x33')),'type':'scheduled','output':_0x4148de['output'],'name':_0x4148de[_0x8f04('0x12')]};if(!_[_0x8f04('0x31')](_0x4148de[_0x8f04('0x34')])){logger[_0x8f04('0xc')](_0x8f04('0x35'),_0x4148de[_0x8f04('0x34')]);return analyticDefaultReportController['runReport']({'id':_0x4148de[_0x8f04('0x34')]},_0x305a52)[_0x8f04('0x2a')](handleResult(_0x4148de))[_0x8f04('0x2e')](handleError());}if(!_[_0x8f04('0x31')](_0x4148de[_0x8f04('0x36')])){logger['info'](_0x8f04('0x37'),_0x4148de[_0x8f04('0x36')]);return analyticCustomReportController[_0x8f04('0x38')]({'id':_0x4148de[_0x8f04('0x36')]},_0x305a52)[_0x8f04('0x2a')](handleResult(_0x4148de))[_0x8f04('0x2e')](handleError());}}catch(_0x323e4f){logger[_0x8f04('0x2b')](JSON['stringify'](_0x323e4f));}return logger[_0x8f04('0xc')](_0x8f04('0x39'));};}function getJobs(_0x3a1a53){var _0x3ee573={};if(_0x3a1a53){_0x3ee573['id']=_0x3a1a53;}return db['Schedule'][_0x8f04('0x3a')]({'where':_0x3ee573,'include':[{'model':db[_0x8f04('0x11')],'attributes':['id',_0x8f04('0x12'),_0x8f04('0xd')],'include':[{'model':db[_0x8f04('0x3b')],'as':_0x8f04('0x13'),'include':[{'model':db[_0x8f04('0x3c')],'as':_0x8f04('0x3c')}]}]}]})[_0x8f04('0x2a')](function(_0x1b38ed){var _0x59ff88=_[_0x8f04('0x3d')](manager['jobs']);var _0x39c6dc=_[_0x8f04('0x3e')](_0x1b38ed,function(_0x33ed83){return _0x33ed83['id'][_0x8f04('0x3f')]();});var _0x1dbf53=_[_0x8f04('0x40')](_0x1b38ed,function(_0x5c6897){return _0x5c6897['id'][_0x8f04('0x3f')]();});var _0x2f7f28=_0x3a1a53?_0x39c6dc:_[_0x8f04('0x41')](_0x39c6dc,_0x59ff88);var _0x4bf8ff=_['intersection'](_0x39c6dc,_0x59ff88);var _0x413f3a=_[_0x8f04('0x41')](_0x59ff88,_0x39c6dc);var _0x5843b1;var _0x1efd83;for(_0x5843b1=0x0;_0x5843b1<_0x413f3a['length']&&!_0x3a1a53;_0x5843b1+=0x1){_0x1efd83=_0x413f3a[_0x5843b1][_0x8f04('0x3f')]();if(manager[_0x8f04('0x42')](_0x1efd83)){manager[_0x8f04('0x43')](_0x1efd83);manager[_0x8f04('0x44')](_0x1efd83);logger[_0x8f04('0xc')](_0x8f04('0x45'),_0x1efd83);}}logger['info'](_0x8f04('0x46'),JSON[_0x8f04('0x30')](_0x2f7f28));for(_0x5843b1=0x0;_0x5843b1<_0x2f7f28[_0x8f04('0x47')];_0x5843b1+=0x1){_0x1efd83=_0x2f7f28[_0x5843b1]['toString']();logger[_0x8f04('0xc')](_0x8f04('0x48'),_0x1efd83);if(_0x3a1a53){logger[_0x8f04('0xc')](_0x8f04('0x49'),_0x3a1a53);logger[_0x8f04('0xc')](JSON['stringify'](_0x1dbf53[_0x1efd83]));BPromise[_0x8f04('0x4a')]()[_0x8f04('0x2a')](handleJob(_0x1dbf53[_0x1efd83]));logger[_0x8f04('0xc')](_0x8f04('0x4b'),_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}else if(_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]&&_0x1dbf53[_0x1efd83]['active']&&moment()[_0x8f04('0x4d')](_0x1dbf53[_0x1efd83][_0x8f04('0x4e')],_0x1dbf53[_0x1efd83]['endAt'])){manager[_0x8f04('0x4f')](_0x1efd83,_0x1dbf53[_0x1efd83][_0x8f04('0x4c')],handleJob(_0x1dbf53[_0x1efd83]));manager[_0x8f04('0x50')](_0x1efd83);logger[_0x8f04('0xc')]('add\x20cron',_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}else if(manager['exists'](_0x1efd83)){manager[_0x8f04('0x43')](_0x1efd83);manager[_0x8f04('0x44')](_0x1efd83);logger[_0x8f04('0xc')](_0x8f04('0x51'),_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}}for(_0x5843b1=0x0,_0x1efd83;_0x5843b1<_0x4bf8ff[_0x8f04('0x47')]&&!_0x3a1a53;_0x5843b1+=0x1){_0x1efd83=_0x4bf8ff[_0x5843b1][_0x8f04('0x3f')]();if(manager[_0x8f04('0x42')](_0x1efd83)){if(_0x1dbf53[_0x1efd83]['cron']&&_0x1dbf53[_0x1efd83]['active']&&moment()['isBetween'](_0x1dbf53[_0x1efd83]['startAt'],_0x1dbf53[_0x1efd83][_0x8f04('0x52')])){manager[_0x8f04('0x53')](_0x1efd83,_0x1dbf53[_0x1efd83][_0x8f04('0x4c')],handleJob(_0x1dbf53[_0x1efd83]));logger[_0x8f04('0xc')](_0x8f04('0x54'),_0x1dbf53[_0x1efd83][_0x8f04('0x12')],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}else{manager[_0x8f04('0x43')](_0x1efd83);manager[_0x8f04('0x44')](_0x1efd83);logger[_0x8f04('0xc')](_0x8f04('0x51'),_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83]['cron']);}}}})[_0x8f04('0x2e')](function(_0x396fb1){logger[_0x8f04('0x2b')](JSON[_0x8f04('0x30')](_0x396fb1));});}exports['run']=function(_0x299e41){return getJobs(_0x299e41);};exports[_0x8f04('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa534=['getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','%s.%s','savename','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','empty\x20file,\x20email\x20not\x20sent','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','CloudProvider','keys','map','keyBy','toString','difference','intersection','exists','toRun','length','index','my\x20id','resolve','cron','active','endAt','add','start','add\x20cron','stop','deleteJob','isBetween','startAt','update\x20cron','stop\x20cron','run','util','path','lodash','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount'];(function(_0x22ada8,_0x23a7ea){var _0x506e36=function(_0xd6ed10){while(--_0xd6ed10){_0x22ada8['push'](_0x22ada8['shift']());}};_0x506e36(++_0x23a7ea);}(_0xa534,0x1cd));var _0x4a53=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa534[_0x4b369d];return _0x571a98;};'use strict';var fs=require('fs');var util=require(_0x4a53('0x0'));var path=require(_0x4a53('0x1'));var _=require(_0x4a53('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x4a53('0x3'));var logger=require(_0x4a53('0x4'))(_0x4a53('0x5'));var db=require(_0x4a53('0x6'))['db'];var analyticCustomReportController=require(_0x4a53('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x4a53('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f3d91,_0x267b3e){return function(){logger[_0x4a53('0x9')](_0x4a53('0xa'),_0x2f3d91[_0x4a53('0xb')]);var _0xadfcea=!![];var _0x267be4=_0x2f3d91[_0x4a53('0xc')][_0x4a53('0xd')]();var _0x181d27={'account':_0x267be4,'message':{'from':util[_0x4a53('0xe')](_0x4a53('0xf'),_0x2f3d91[_0x4a53('0xc')]['name'],_0x2f3d91['MailAccount']['email']||_0x2f3d91['MailAccount'][_0x4a53('0x10')][_0x4a53('0x11')]),'to':_0x2f3d91[_0x4a53('0xb')],'cc':_0x2f3d91['cc'],'bcc':_0x2f3d91['bcc'],'subject':util[_0x4a53('0xe')](_0x4a53('0x12'),_0x267b3e[_0x4a53('0x13')],_0x2f3d91[_0x4a53('0x14')],_0x2f3d91[_0x4a53('0x15')])}};var _0x36baa3=path[_0x4a53('0x16')](__dirname,'../../files/reports');var _0x504da5=_0x267b3e['savename'];var _0x17eecc=util[_0x4a53('0xe')](_0x4a53('0x17'),path['basename'](_0x267b3e[_0x4a53('0x18')],path['extname'](_0x267b3e[_0x4a53('0x18')])),'zip');var _0x10c0e8=path[_0x4a53('0x16')](_0x36baa3,_0x504da5);var _0xabccd8=path[_0x4a53('0x16')](_0x36baa3,_0x17eecc);if(fs[_0x4a53('0x19')](_0x10c0e8)){_0x267b3e[_0x4a53('0x1a')]=_0x4a53('0x1b');_0x181d27[_0x4a53('0x1c')][_0x4a53('0x1d')]=[{'filename':_0x504da5,'path':_0x10c0e8}];_0x181d27['message'][_0x4a53('0x1e')]=util['format'](_0x4a53('0x1f'),JSON[_0x4a53('0x20')](_0x267b3e,null,0x2));}else if(fs[_0x4a53('0x19')](_0xabccd8)){_0x267b3e['status']=_0x4a53('0x1b');_0x181d27[_0x4a53('0x1c')][_0x4a53('0x1d')]=[{'filename':_0x17eecc,'path':_0xabccd8}];}else{_0x181d27[_0x4a53('0x1c')][_0x4a53('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2f3d91['sendIfEmpty']){_0xadfcea=![];logger[_0x4a53('0x9')](_0x4a53('0x21'));}}if(_0xadfcea){return client['request'](_0x4a53('0x22'),_0x181d27)['then'](function(_0x131d41){if(_0x131d41[_0x4a53('0x23')]){return logger[_0x4a53('0x23')](_0x4a53('0x24'),JSON[_0x4a53('0x20')](_0x131d41));}return logger[_0x4a53('0x9')](_0x4a53('0x25'));})[_0x4a53('0x26')](function(_0x95b625){return logger[_0x4a53('0x23')](_0x4a53('0x24'),JSON['stringify'](_0x95b625));});}};}function handleError(){return function(_0x59dfce){return logger['error'](JSON[_0x4a53('0x20')](_0x59dfce));};}function handleResult(_0x441638){return function(_0x5bef3a){logger[_0x4a53('0x9')](_0x4a53('0x27'),JSON[_0x4a53('0x20')](_0x5bef3a));if(_0x441638[_0x4a53('0xc')]&&_0x441638[_0x4a53('0xc')][_0x4a53('0x10')]&&!_[_0x4a53('0x28')](_0x441638['email'])){setTimeout(handleSendEmail(_0x441638,_0x5bef3a),0x3c*0x3e8);}};}function handleJob(_0x5237e0){return function(){try{if(_[_0x4a53('0x28')](_0x5237e0[_0x4a53('0x14')])){return logger[_0x4a53('0x9')](_0x4a53('0x29'));}if(_['isNil'](_0x5237e0['subtractUnit'])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x357d4b={'startDate':moment()[_0x4a53('0x2a')](_0x5237e0[_0x4a53('0x14')],_0x5237e0[_0x4a53('0x15')])[_0x4a53('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x4a53('0x2b')),'type':_0x4a53('0x2c'),'output':_0x5237e0[_0x4a53('0x2d')],'name':_0x5237e0[_0x4a53('0x13')]};if(!_['isNil'](_0x5237e0[_0x4a53('0x2e')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x5237e0[_0x4a53('0x2e')]);return analyticDefaultReportController[_0x4a53('0x2f')]({'id':_0x5237e0[_0x4a53('0x2e')]},_0x357d4b)[_0x4a53('0x30')](handleResult(_0x5237e0))['catch'](handleError());}if(!_[_0x4a53('0x28')](_0x5237e0[_0x4a53('0x31')])){logger[_0x4a53('0x9')](_0x4a53('0x32'),_0x5237e0[_0x4a53('0x31')]);return analyticCustomReportController[_0x4a53('0x2f')]({'id':_0x5237e0[_0x4a53('0x31')]},_0x357d4b)[_0x4a53('0x30')](handleResult(_0x5237e0))[_0x4a53('0x26')](handleError());}}catch(_0x5ad37f){logger[_0x4a53('0x23')](JSON['stringify'](_0x5ad37f));}return logger[_0x4a53('0x9')](_0x4a53('0x33'));};}function getJobs(_0xfdcde){var _0x19588f={};if(_0xfdcde){_0x19588f['id']=_0xfdcde;}return db[_0x4a53('0x34')]['findAll']({'where':_0x19588f,'include':[{'model':db['MailAccount'],'attributes':['id',_0x4a53('0x13'),_0x4a53('0xb')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x4a53('0x35')],'as':_0x4a53('0x35')}]}]}]})['then'](function(_0x501339){var _0x40bf8c=_[_0x4a53('0x36')](manager['jobs']);var _0x3a03b2=_[_0x4a53('0x37')](_0x501339,function(_0x2a721f){return _0x2a721f['id']['toString']();});var _0x5a8151=_[_0x4a53('0x38')](_0x501339,function(_0x5abbf8){return _0x5abbf8['id'][_0x4a53('0x39')]();});var _0x4d45fc=_0xfdcde?_0x3a03b2:_[_0x4a53('0x3a')](_0x3a03b2,_0x40bf8c);var _0x29eb65=_[_0x4a53('0x3b')](_0x3a03b2,_0x40bf8c);var _0x946c46=_[_0x4a53('0x3a')](_0x40bf8c,_0x3a03b2);var _0x6334aa;var _0x1ff857;for(_0x6334aa=0x0;_0x6334aa<_0x946c46['length']&&!_0xfdcde;_0x6334aa+=0x1){_0x1ff857=_0x946c46[_0x6334aa][_0x4a53('0x39')]();if(manager[_0x4a53('0x3c')](_0x1ff857)){manager['stop'](_0x1ff857);manager['deleteJob'](_0x1ff857);logger[_0x4a53('0x9')]('delete\x20cron',_0x1ff857);}}logger['info'](_0x4a53('0x3d'),JSON[_0x4a53('0x20')](_0x4d45fc));for(_0x6334aa=0x0;_0x6334aa<_0x4d45fc[_0x4a53('0x3e')];_0x6334aa+=0x1){_0x1ff857=_0x4d45fc[_0x6334aa][_0x4a53('0x39')]();logger['info'](_0x4a53('0x3f'),_0x1ff857);if(_0xfdcde){logger[_0x4a53('0x9')](_0x4a53('0x40'),_0xfdcde);logger['info'](JSON[_0x4a53('0x20')](_0x5a8151[_0x1ff857]));BPromise[_0x4a53('0x41')]()[_0x4a53('0x30')](handleJob(_0x5a8151[_0x1ff857]));logger[_0x4a53('0x9')]('run\x20job',_0x5a8151[_0x1ff857][_0x4a53('0x13')],_0x5a8151[_0x1ff857][_0x4a53('0x42')]);}else if(_0x5a8151[_0x1ff857][_0x4a53('0x42')]&&_0x5a8151[_0x1ff857][_0x4a53('0x43')]&&moment()['isBetween'](_0x5a8151[_0x1ff857]['startAt'],_0x5a8151[_0x1ff857][_0x4a53('0x44')])){manager[_0x4a53('0x45')](_0x1ff857,_0x5a8151[_0x1ff857][_0x4a53('0x42')],handleJob(_0x5a8151[_0x1ff857]));manager[_0x4a53('0x46')](_0x1ff857);logger[_0x4a53('0x9')](_0x4a53('0x47'),_0x5a8151[_0x1ff857]['name'],_0x5a8151[_0x1ff857]['cron']);}else if(manager['exists'](_0x1ff857)){manager[_0x4a53('0x48')](_0x1ff857);manager[_0x4a53('0x49')](_0x1ff857);logger[_0x4a53('0x9')]('stop\x20cron',_0x5a8151[_0x1ff857][_0x4a53('0x13')],_0x5a8151[_0x1ff857][_0x4a53('0x42')]);}}for(_0x6334aa=0x0,_0x1ff857;_0x6334aa<_0x29eb65[_0x4a53('0x3e')]&&!_0xfdcde;_0x6334aa+=0x1){_0x1ff857=_0x29eb65[_0x6334aa][_0x4a53('0x39')]();if(manager[_0x4a53('0x3c')](_0x1ff857)){if(_0x5a8151[_0x1ff857]['cron']&&_0x5a8151[_0x1ff857][_0x4a53('0x43')]&&moment()[_0x4a53('0x4a')](_0x5a8151[_0x1ff857][_0x4a53('0x4b')],_0x5a8151[_0x1ff857][_0x4a53('0x44')])){manager['update'](_0x1ff857,_0x5a8151[_0x1ff857][_0x4a53('0x42')],handleJob(_0x5a8151[_0x1ff857]));logger[_0x4a53('0x9')](_0x4a53('0x4c'),_0x5a8151[_0x1ff857][_0x4a53('0x13')],_0x5a8151[_0x1ff857][_0x4a53('0x42')]);}else{manager[_0x4a53('0x48')](_0x1ff857);manager[_0x4a53('0x49')](_0x1ff857);logger[_0x4a53('0x9')](_0x4a53('0x4d'),_0x5a8151[_0x1ff857]['name'],_0x5a8151[_0x1ff857][_0x4a53('0x42')]);}}}})[_0x4a53('0x26')](function(_0x5d8cc4){logger[_0x4a53('0x23')](JSON[_0x4a53('0x20')](_0x5d8cc4));});}exports[_0x4a53('0x4e')]=function(_0x29d23e){return getJobs(_0x29d23e);};exports['start']=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 e448cbd..d12e4cc 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 _0xeb74=['transcribe','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','push','error','inspect','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','getTranscriptionJob','Comprehend','substring','format','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available'];(function(_0x10d58c,_0x39bf44){var _0x505ab7=function(_0x5b9b58){while(--_0x5b9b58){_0x10d58c['push'](_0x10d58c['shift']());}};_0x505ab7(++_0x39bf44);}(_0xeb74,0xe3));var _0x4eb7=function(_0x42a18a,_0x555aaf){_0x42a18a=_0x42a18a-0x0;var _0x2dbd68=_0xeb74[_0x42a18a];return _0x2dbd68;};var _=require(_0x4eb7('0x0'));var AWS=require(_0x4eb7('0x1'));var rp=require(_0x4eb7('0x2'));var util=require(_0x4eb7('0x3'));var BPromise=require(_0x4eb7('0x4'));var db=require(_0x4eb7('0x5'))['db'];var logger=require(_0x4eb7('0x6'))('transcribe');function getTranscriptionJob(_0x35c7ca,_0x1dc8d0,_0x29b666,_0x176f0b){return new Promise(function(_0xa6e086,_0x563d6e){var _0x3986cd=new AWS['TranscribeService']({'accessKeyId':_0x1dc8d0,'secretAccessKey':_0x35c7ca,'region':_0x29b666});_0x3986cd[_0x4eb7('0x7')]({'TranscriptionJobName':_0x176f0b},function(_0x2cffe7,_0x588a1c){if(_0x2cffe7){return _0x563d6e(_0x2cffe7);}else{return _0xa6e086(_0x588a1c);}});});}function sentiment(_0x47a89b,_0xe07330,_0x2f8296,_0x4b3add,_0xa72e98){return new Promise(function(_0x4ff98e,_0x3326cd){var _0x462392=new AWS[(_0x4eb7('0x8'))]({'accessKeyId':_0xe07330,'secretAccessKey':_0x47a89b,'region':_0x2f8296});_0x462392['detectSentiment']({'Text':_0x4b3add,'LanguageCode':_0xa72e98[_0x4eb7('0x9')](0x0,0x2)},function(_0x35b880,_0x3c0e15){if(_0x35b880){return _0x3326cd(_0x35b880);}else{return _0x4ff98e(_0x3c0e15);}});});}function checkTranscribeJob(_0x3273b1,_0x35fa89,_0x4194e1){var _0x3c9f45;return new BPromise(function(_0x4c27a4,_0x4c33a9){logger['info'](util[_0x4eb7('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3273b1['id'],_0x3273b1[_0x4eb7('0xb')]));return getTranscriptionJob(_0x4194e1[_0x4eb7('0xc')],_0x4194e1[_0x4eb7('0xd')],_0x35fa89[_0x4eb7('0xe')],_0x3273b1[_0x4eb7('0xb')])[_0x4eb7('0xf')](function(_0x11674f){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x11'),_0x3273b1['id'],_0x3273b1['transcribeName'],_0x11674f[_0x4eb7('0x12')][_0x4eb7('0x13')]));if(!_0x3273b1[_0x4eb7('0x14')]){switch(_0x11674f[_0x4eb7('0x12')][_0x4eb7('0x13')]){case _0x4eb7('0x15'):var _0x2d0ea7={'transcribeStatus':_0x11674f[_0x4eb7('0x12')]['TranscriptionJobStatus'],'fileUri':_0x11674f[_0x4eb7('0x12')][_0x4eb7('0x16')][_0x4eb7('0x17')]};logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x18'),_0x3273b1['id']));return rp({'uri':_0x11674f[_0x4eb7('0x12')]['Transcript'][_0x4eb7('0x17')],'json':!![]})[_0x4eb7('0xf')](function(_0x4783b1){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x19'),_0x3273b1['id']));if(_0x4783b1&&_0x4783b1[_0x4eb7('0x1a')]&&_0x4783b1[_0x4eb7('0x1a')][_0x4eb7('0x1b')]&&_0x4783b1[_0x4eb7('0x1a')]['transcripts'][_0x4eb7('0x1c')]){_0x2d0ea7[_0x4eb7('0x14')]='';for(var _0x2e8de8=0x0;_0x2e8de8<_0x4783b1[_0x4eb7('0x1a')][_0x4eb7('0x1b')][_0x4eb7('0x1c')];_0x2e8de8++){_0x2d0ea7[_0x4eb7('0x14')]+=_0x4783b1[_0x4eb7('0x1a')][_0x4eb7('0x1b')][_0x2e8de8][_0x4eb7('0x1d')]+'';}}return _0x3273b1[_0x4eb7('0x1e')](_0x2d0ea7);})[_0x4eb7('0xf')](function(){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));if(!_0x3273b1[_0x4eb7('0x20')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x23'));}if(!_0x35fa89[_0x4eb7('0x24')]||!_0x35fa89[_0x4eb7('0x25')]||!_0x35fa89[_0x4eb7('0x26')]||!_0x35fa89[_0x4eb7('0x27')]||!_0x35fa89['bucket']){throw new db[(_0x4eb7('0x21'))]['ValidationError'](_0x4eb7('0x28'));}if(!_0x2d0ea7[_0x4eb7('0x14')]){throw new Error(_0x4eb7('0x29'));}if(_0x35fa89[_0x4eb7('0x25')]===_0x4194e1['id']){return _0x4194e1;}else{return db[_0x4eb7('0x2a')][_0x4eb7('0x2b')]({'where':{'id':_settings[_0x4eb7('0x25')]}});}})[_0x4eb7('0xf')](function(_0x264c0b){if(!_0x264c0b){throw new db['Sequelize'][(_0x4eb7('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x264c0b[_0x4eb7('0xc')]||!_0x264c0b[_0x4eb7('0xd')]){throw new db['Sequelize']['ValidationError'](_0x4eb7('0x2c'));}_0x3c9f45=_0x264c0b;logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x2d'),_0x3273b1['id']));return sentiment(_0x3c9f45['data1'],_0x3c9f45[_0x4eb7('0xd')],_0x35fa89[_0x4eb7('0x26')],_0x2d0ea7[_0x4eb7('0x14')],_0x35fa89[_0x4eb7('0x27')]);})[_0x4eb7('0xf')](function(_0x5ab58d){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x2e'),_0x3273b1['id']));return _0x3273b1['update']({'sentiment':_0x5ab58d[_0x4eb7('0x2f')],'sPositive':_0x5ab58d[_0x4eb7('0x30')][_0x4eb7('0x31')],'sNegative':_0x5ab58d['SentimentScore'][_0x4eb7('0x32')],'sMixed':_0x5ab58d['SentimentScore'][_0x4eb7('0x33')],'sNeutral':_0x5ab58d[_0x4eb7('0x30')][_0x4eb7('0x34')]});})[_0x4eb7('0xf')](function(){logger['info'](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));_0x4c27a4();});case _0x4eb7('0x35'):return _0x3273b1[_0x4eb7('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x11674f['TranscriptionJob']['FailureReason']})[_0x4eb7('0xf')](function(){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));_0x4c27a4();});default:logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x36'),_0x3273b1['id']));break;}}else{return BPromise[_0x4eb7('0x37')]()[_0x4eb7('0xf')](function(){if(!_0x3273b1[_0x4eb7('0x20')]){throw new db['Sequelize'][(_0x4eb7('0x22'))](_0x4eb7('0x23'));}if(!_0x35fa89[_0x4eb7('0x24')]||!_0x35fa89[_0x4eb7('0x25')]||!_0x35fa89[_0x4eb7('0x26')]||!_0x35fa89[_0x4eb7('0x27')]||!_0x35fa89[_0x4eb7('0x38')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x28'));}if(!_0x3273b1[_0x4eb7('0x14')]){throw new Error(_0x4eb7('0x29'));}if(_0x35fa89[_0x4eb7('0x25')]===_0x4194e1['id']){return _0x4194e1;}else{return db[_0x4eb7('0x2a')][_0x4eb7('0x2b')]({'where':{'id':_settings[_0x4eb7('0x25')]}});}})[_0x4eb7('0xf')](function(_0xc302ac){if(!_0xc302ac){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xc302ac[_0x4eb7('0xc')]||!_0xc302ac[_0x4eb7('0xd')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x2c'));}_0x3c9f45=_0xc302ac;logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x2d'),_0x3273b1['id']));return sentiment(_0x3c9f45[_0x4eb7('0xc')],_0x3c9f45['data2'],_0x35fa89[_0x4eb7('0x26')],_0x3273b1['fileText'],_0x35fa89[_0x4eb7('0x27')]);})[_0x4eb7('0xf')](function(_0x146647){logger['info'](util[_0x4eb7('0xa')](_0x4eb7('0x2e'),_0x3273b1['id']));return _0x3273b1[_0x4eb7('0x1e')]({'sentiment':_0x146647[_0x4eb7('0x2f')],'sPositive':_0x146647['SentimentScore'][_0x4eb7('0x31')],'sNegative':_0x146647['SentimentScore'][_0x4eb7('0x32')],'sMixed':_0x146647[_0x4eb7('0x30')][_0x4eb7('0x33')],'sNeutral':_0x146647[_0x4eb7('0x30')][_0x4eb7('0x34')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));_0x4c27a4();});}})[_0x4eb7('0x39')](function(_0x6f634d){if(_0x6f634d){if(!_0x6f634d['name']||_0x6f634d[_0x4eb7('0x3a')]!==_0x4eb7('0x3b')){logger['error'](util[_0x4eb7('0xa')](_0x4eb7('0x3c'),_0x3273b1['id']),util['inspect'](_0x6f634d,{'showHidden':![],'depth':null}));}}_0x4c27a4();});});}function checkTranscribe(){var _0x30f19c;var _0x9db987;var _0x3c8049;return db['VoiceRecording'][_0x4eb7('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x28320b){if(!_0x28320b||!_0x28320b[_0x4eb7('0x1c')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x3e'));}_0x30f19c=_0x28320b;return db[_0x4eb7('0x3f')][_0x4eb7('0x2b')]({'where':{'id':0x1}});})[_0x4eb7('0xf')](function(_0x2913c5){if(!_0x2913c5){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x40'));}_0x9db987=_0x2913c5;if(!_0x9db987[_0x4eb7('0x41')]||!_0x9db987[_0x4eb7('0x42')]||!_0x9db987[_0x4eb7('0xe')]||!_0x9db987[_0x4eb7('0x27')]||!_0x9db987[_0x4eb7('0x38')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x43'));}return db['CloudProvider'][_0x4eb7('0x2b')]({'where':{'id':_0x9db987['transcribeAccountId']}});})['then'](function(_0x3f3a5f){if(!_0x3f3a5f){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x44'));}if(!_0x3f3a5f[_0x4eb7('0xc')]||!_0x3f3a5f['data2']){throw new db['Sequelize'][(_0x4eb7('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x3c8049=_0x3f3a5f;var _0x2f68a8=[];_0x30f19c[_0x4eb7('0x45')](function(_0x1e2098){_0x2f68a8[_0x4eb7('0x46')](checkTranscribeJob(_0x1e2098,_0x9db987,_0x3c8049));});return BPromise['all'](_0x2f68a8);})[_0x4eb7('0x39')](function(_0x29eccb){if(_0x29eccb){if(!_0x29eccb[_0x4eb7('0x3a')]||_0x29eccb[_0x4eb7('0x3a')]!=='SequelizeValidationError'){logger[_0x4eb7('0x47')](util[_0x4eb7('0x48')](_0x29eccb,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x720e=['TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Positive','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','push','lodash','aws-sdk','request-promise','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeRegion','then','transcribeName'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x720e,0x1cb));var _0xe720=function(_0x5c98ea,_0xa782aa){_0x5c98ea=_0x5c98ea-0x0;var _0x51e853=_0x720e[_0x5c98ea];return _0x51e853;};var _=require(_0xe720('0x0'));var AWS=require(_0xe720('0x1'));var rp=require(_0xe720('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0xe720('0x3'))['db'];var logger=require('../../config/logger')(_0xe720('0x4'));function getTranscriptionJob(_0x22eb1f,_0x42ebdc,_0x403cce,_0x92c299){return new Promise(function(_0x43463b,_0x3952f0){var _0x4ffe24=new AWS[(_0xe720('0x5'))]({'accessKeyId':_0x42ebdc,'secretAccessKey':_0x22eb1f,'region':_0x403cce});_0x4ffe24[_0xe720('0x6')]({'TranscriptionJobName':_0x92c299},function(_0x4e715c,_0x4a3b70){if(_0x4e715c){return _0x3952f0(_0x4e715c);}else{return _0x43463b(_0x4a3b70);}});});}function sentiment(_0x4ffad8,_0x812c3b,_0x2e08e7,_0x1891f7,_0x5b0926){return new Promise(function(_0x553bc8,_0x1d8689){var _0x189ca2=new AWS[(_0xe720('0x7'))]({'accessKeyId':_0x812c3b,'secretAccessKey':_0x4ffad8,'region':_0x2e08e7});_0x189ca2[_0xe720('0x8')]({'Text':_0x1891f7,'LanguageCode':_0x5b0926[_0xe720('0x9')](0x0,0x2)},function(_0x5ee664,_0x4d651f){if(_0x5ee664){return _0x1d8689(_0x5ee664);}else{return _0x553bc8(_0x4d651f);}});});}function checkTranscribeJob(_0x2dd7bc,_0x128830,_0x1a82cc){var _0xac0320;return new BPromise(function(_0xea1a0a,_0x42a109){logger[_0xe720('0xa')](util[_0xe720('0xb')](_0xe720('0xc'),_0x2dd7bc['id'],_0x2dd7bc['transcribeName']));return getTranscriptionJob(_0x1a82cc['data1'],_0x1a82cc[_0xe720('0xd')],_0x128830[_0xe720('0xe')],_0x2dd7bc['transcribeName'])[_0xe720('0xf')](function(_0x2fd06d){logger['info'](util[_0xe720('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x2dd7bc['id'],_0x2dd7bc[_0xe720('0x10')],_0x2fd06d[_0xe720('0x11')]['TranscriptionJobStatus']));if(!_0x2dd7bc[_0xe720('0x12')]){switch(_0x2fd06d['TranscriptionJob'][_0xe720('0x13')]){case _0xe720('0x14'):var _0x37928b={'transcribeStatus':_0x2fd06d['TranscriptionJob'][_0xe720('0x13')],'fileUri':_0x2fd06d['TranscriptionJob'][_0xe720('0x15')][_0xe720('0x16')]};logger[_0xe720('0xa')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x2dd7bc['id']));return rp({'uri':_0x2fd06d[_0xe720('0x11')]['Transcript'][_0xe720('0x16')],'json':!![]})[_0xe720('0xf')](function(_0xa0fa1a){logger[_0xe720('0xa')](util[_0xe720('0xb')](_0xe720('0x17'),_0x2dd7bc['id']));if(_0xa0fa1a&&_0xa0fa1a['results']&&_0xa0fa1a[_0xe720('0x18')][_0xe720('0x19')]&&_0xa0fa1a[_0xe720('0x18')]['transcripts'][_0xe720('0x1a')]){_0x37928b[_0xe720('0x12')]='';for(var _0x3bc303=0x0;_0x3bc303<_0xa0fa1a[_0xe720('0x18')][_0xe720('0x19')][_0xe720('0x1a')];_0x3bc303++){_0x37928b[_0xe720('0x12')]+=_0xa0fa1a[_0xe720('0x18')][_0xe720('0x19')][_0x3bc303][_0xe720('0x1b')]+'';}}return _0x2dd7bc[_0xe720('0x1c')](_0x37928b);})[_0xe720('0xf')](function(){logger['info'](util[_0xe720('0xb')](_0xe720('0x1d'),_0x2dd7bc['id']));if(!_0x2dd7bc[_0xe720('0x1e')]){throw new db[(_0xe720('0x1f'))]['ValidationError'](_0xe720('0x20'));}if(!_0x128830[_0xe720('0x21')]||!_0x128830[_0xe720('0x22')]||!_0x128830[_0xe720('0x23')]||!_0x128830[_0xe720('0x24')]||!_0x128830[_0xe720('0x25')]){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x37928b[_0xe720('0x12')]){throw new Error(_0xe720('0x27'));}if(_0x128830['sentimentAccountId']===_0x1a82cc['id']){return _0x1a82cc;}else{return db['CloudProvider'][_0xe720('0x28')]({'where':{'id':_settings[_0xe720('0x22')]}});}})[_0xe720('0xf')](function(_0x51b4ff){if(!_0x51b4ff){throw new db['Sequelize'][(_0xe720('0x26'))](_0xe720('0x29'));}if(!_0x51b4ff[_0xe720('0x2a')]||!_0x51b4ff[_0xe720('0xd')]){throw new db['Sequelize'][(_0xe720('0x26'))](_0xe720('0x2b'));}_0xac0320=_0x51b4ff;logger[_0xe720('0xa')](util[_0xe720('0xb')](_0xe720('0x2c'),_0x2dd7bc['id']));return sentiment(_0xac0320[_0xe720('0x2a')],_0xac0320[_0xe720('0xd')],_0x128830[_0xe720('0x23')],_0x37928b[_0xe720('0x12')],_0x128830['language']);})['then'](function(_0x43e06a){logger['info'](util[_0xe720('0xb')](_0xe720('0x2d'),_0x2dd7bc['id']));return _0x2dd7bc[_0xe720('0x1c')]({'sentiment':_0x43e06a[_0xe720('0x2e')],'sPositive':_0x43e06a[_0xe720('0x2f')]['Positive'],'sNegative':_0x43e06a[_0xe720('0x2f')]['Negative'],'sMixed':_0x43e06a[_0xe720('0x2f')][_0xe720('0x30')],'sNeutral':_0x43e06a[_0xe720('0x2f')]['Neutral']});})['then'](function(){logger[_0xe720('0xa')](util[_0xe720('0xb')](_0xe720('0x1d'),_0x2dd7bc['id']));_0xea1a0a();});case _0xe720('0x31'):return _0x2dd7bc[_0xe720('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x2fd06d[_0xe720('0x11')]['FailureReason']})['then'](function(){logger[_0xe720('0xa')](util[_0xe720('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dd7bc['id']));_0xea1a0a();});default:logger[_0xe720('0xa')](util[_0xe720('0xb')](_0xe720('0x32'),_0x2dd7bc['id']));break;}}else{return BPromise[_0xe720('0x33')]()[_0xe720('0xf')](function(){if(!_0x2dd7bc['tempSentiment']){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))](_0xe720('0x20'));}if(!_0x128830[_0xe720('0x21')]||!_0x128830[_0xe720('0x22')]||!_0x128830[_0xe720('0x23')]||!_0x128830[_0xe720('0x24')]||!_0x128830[_0xe720('0x25')]){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))](_0xe720('0x34'));}if(!_0x2dd7bc[_0xe720('0x12')]){throw new Error(_0xe720('0x27'));}if(_0x128830[_0xe720('0x22')]===_0x1a82cc['id']){return _0x1a82cc;}else{return db[_0xe720('0x35')][_0xe720('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xe720('0xf')](function(_0x9b9279){if(!_0x9b9279){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))](_0xe720('0x29'));}if(!_0x9b9279[_0xe720('0x2a')]||!_0x9b9279[_0xe720('0xd')]){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))](_0xe720('0x2b'));}_0xac0320=_0x9b9279;logger[_0xe720('0xa')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2dd7bc['id']));return sentiment(_0xac0320[_0xe720('0x2a')],_0xac0320[_0xe720('0xd')],_0x128830[_0xe720('0x23')],_0x2dd7bc['fileText'],_0x128830[_0xe720('0x24')]);})['then'](function(_0x33ddec){logger[_0xe720('0xa')](util['format'](_0xe720('0x2d'),_0x2dd7bc['id']));return _0x2dd7bc[_0xe720('0x1c')]({'sentiment':_0x33ddec['Sentiment'],'sPositive':_0x33ddec[_0xe720('0x2f')][_0xe720('0x36')],'sNegative':_0x33ddec[_0xe720('0x2f')][_0xe720('0x37')],'sMixed':_0x33ddec[_0xe720('0x2f')]['Mixed'],'sNeutral':_0x33ddec[_0xe720('0x2f')]['Neutral'],'transcribeStatus':_0xe720('0x14')});})[_0xe720('0xf')](function(){logger[_0xe720('0xa')](util[_0xe720('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dd7bc['id']));_0xea1a0a();});}})[_0xe720('0x38')](function(_0x28e23d){if(_0x28e23d){if(!_0x28e23d[_0xe720('0x39')]||_0x28e23d[_0xe720('0x39')]!==_0xe720('0x3a')){logger[_0xe720('0x3b')](util['format'](_0xe720('0x3c'),_0x2dd7bc['id']),util[_0xe720('0x3d')](_0x28e23d,{'showHidden':![],'depth':null}));}}_0xea1a0a();});});}function checkTranscribe(){var _0x5ec662;var _0x1f74bd;var _0x295f72;return db[_0xe720('0x3e')]['findAll']({'where':{'transcribeStatus':_0xe720('0x3f')}})[_0xe720('0xf')](function(_0x2278d5){if(!_0x2278d5||!_0x2278d5[_0xe720('0x1a')]){throw new db[(_0xe720('0x1f'))]['ValidationError'](_0xe720('0x40'));}_0x5ec662=_0x2278d5;return db['Setting'][_0xe720('0x28')]({'where':{'id':0x1}});})[_0xe720('0xf')](function(_0x4f2ede){if(!_0x4f2ede){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))](_0xe720('0x41'));}_0x1f74bd=_0x4f2ede;if(!_0x1f74bd[_0xe720('0x4')]||!_0x1f74bd[_0xe720('0x42')]||!_0x1f74bd[_0xe720('0xe')]||!_0x1f74bd['language']||!_0x1f74bd[_0xe720('0x25')]){throw new db['Sequelize'][(_0xe720('0x26'))]('Transcribe\x20not\x20configured');}return db[_0xe720('0x35')][_0xe720('0x28')]({'where':{'id':_0x1f74bd[_0xe720('0x42')]}});})['then'](function(_0x5c1e87){if(!_0x5c1e87){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))](_0xe720('0x29'));}if(!_0x5c1e87[_0xe720('0x2a')]||!_0x5c1e87[_0xe720('0xd')]){throw new db[(_0xe720('0x1f'))][(_0xe720('0x26'))](_0xe720('0x2b'));}_0x295f72=_0x5c1e87;var _0x2cf50a=[];_0x5ec662['forEach'](function(_0x2acfb7){_0x2cf50a[_0xe720('0x43')](checkTranscribeJob(_0x2acfb7,_0x1f74bd,_0x295f72));});return BPromise['all'](_0x2cf50a);})[_0xe720('0x38')](function(_0x131b9f){if(_0x131b9f){if(!_0x131b9f[_0xe720('0x39')]||_0x131b9f[_0xe720('0x39')]!==_0xe720('0x3a')){logger['error'](util[_0xe720('0x3d')](_0x131b9f,{'showHidden':![],'depth':null}));}}});}exports['start']=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 e588dcd..aadecf2 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 _0x0741=['info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0741,0x1bc));var _0x1074=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x0741[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x1074('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x1074('0x1'));var config=require(_0x1074('0x2'));var db=require(_0x1074('0x3'))['db'];var logger=require('../logger')(_0x1074('0x4'));config[_0x1074('0x5')]=_['defaults'](config[_0x1074('0x5')],{'host':_0x1074('0x6'),'port':0x18eb});var io=require(_0x1074('0x7'))(new Redis(config[_0x1074('0x5')]));function closeInteractions(){var _0x554976=[];return db[_0x1074('0x8')][_0x1074('0x9')]({'raw':!![],'attributes':['id',_0x1074('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1074('0xb')](0x18,'hours')}}})[_0x1074('0xc')](function(_0x33fe77){if(_0x33fe77&&_0x33fe77[_0x1074('0xd')]){_0x554976=_[_0x1074('0xe')](_0x33fe77||[],'id');logger[_0x1074('0xf')](_0x1074('0x10'),_0x554976['join']());return db['WhatsappInteraction'][_0x1074('0x11')]({'closeReason':_0x1074('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x1074('0x13'))},{'where':{'id':_0x554976}});}})[_0x1074('0xc')](function(){if(_0x554976&&_0x554976[_0x1074('0xd')]){logger[_0x1074('0xf')](_0x1074('0x14'),_0x554976['join']());for(var _0x3859bd=0x0;_0x3859bd<_0x554976[_0x1074('0xd')];_0x3859bd++){io[_0x1074('0x15')]('whatsappInteraction:update',{'id':_0x554976[_0x3859bd],'closed':!![]});}}})[_0x1074('0x16')](function(_0x413a85){logger[_0x1074('0x17')](_0x1074('0x18'),_0x413a85?util[_0x1074('0x19')](_0x413a85,{'showHidden':![],'depth':null}):'');});}exports[_0x1074('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6233=['lodash','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect'];(function(_0x251ba8,_0x5c04eb){var _0x19e422=function(_0x333f5d){while(--_0x333f5d){_0x251ba8['push'](_0x251ba8['shift']());}};_0x19e422(++_0x5c04eb);}(_0x6233,0xba));var _0x3623=function(_0x281c8a,_0x1bfb92){_0x281c8a=_0x281c8a-0x0;var _0x460c8d=_0x6233[_0x281c8a];return _0x460c8d;};'use strict';var _=require(_0x3623('0x0'));var moment=require('moment');var Redis=require(_0x3623('0x1'));var util=require('util');var config=require(_0x3623('0x2'));var db=require(_0x3623('0x3'))['db'];var logger=require(_0x3623('0x4'))(_0x3623('0x5'));config[_0x3623('0x6')]=_[_0x3623('0x7')](config[_0x3623('0x6')],{'host':_0x3623('0x8'),'port':0x18eb});var io=require(_0x3623('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x5bf1d2=[];return db[_0x3623('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x3623('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3623('0xc')](0x18,_0x3623('0xd'))}}})[_0x3623('0xe')](function(_0x1f264f){if(_0x1f264f&&_0x1f264f[_0x3623('0xf')]){_0x5bf1d2=_[_0x3623('0x10')](_0x1f264f||[],'id');logger[_0x3623('0x11')](_0x3623('0x12'),_0x5bf1d2[_0x3623('0x13')]());return db[_0x3623('0xa')][_0x3623('0x14')]({'closeReason':_0x3623('0x15'),'disposition':_0x3623('0x16'),'closed':!![],'closedAt':moment()[_0x3623('0x17')](_0x3623('0x18'))},{'where':{'id':_0x5bf1d2}});}})[_0x3623('0xe')](function(){if(_0x5bf1d2&&_0x5bf1d2[_0x3623('0xf')]){logger['info'](_0x3623('0x19'),_0x5bf1d2[_0x3623('0x13')]());for(var _0x531bb3=0x0;_0x531bb3<_0x5bf1d2[_0x3623('0xf')];_0x531bb3++){io[_0x3623('0x1a')]('whatsappInteraction:update',{'id':_0x5bf1d2[_0x531bb3],'closed':!![]});}}})[_0x3623('0x1b')](function(_0x1d7630){logger[_0x3623('0x1c')](_0x3623('0x1d'),_0x1d7630?util[_0x3623('0x1e')](_0x1d7630,{'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/seedContact.js b/server/config/seedContact.js index 18c079c..7e9f2f3 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2e7=['catch','Innocenzo','Biondo','@xcally.com','push','now','innocenzo.biondo','destroy','then','CmContact','log','finished\x20populating','CmHopper','hopper1','bulkCreate','contacts2','hopper2'];(function(_0xbb345,_0x33f5d0){var _0x3362f8=function(_0x3df4cd){while(--_0x3df4cd){_0xbb345['push'](_0xbb345['shift']());}};_0x3362f8(++_0x33f5d0);}(_0xb2e7,0x122));var _0x7b2e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb2e7[_0x2641f9];return _0x585741;};'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['push']({'id':i,'firstName':_0x7b2e('0x0')+i,'lastName':_0x7b2e('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x7b2e('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7b2e('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x7b2e('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7b2e('0x3')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x7b2e('0x1')+i,'phone':0xf879fb460+i,'email':_0x7b2e('0x5')+i+_0x7b2e('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7b2e('0x3')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7b2e('0x4')](),'updatedAt':Date['now']()});}db['CmContact'][_0x7b2e('0x6')]({'where':{}})[_0x7b2e('0x7')](function(){return db[_0x7b2e('0x8')]['bulkCreate'](contacts);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')](_0x7b2e('0xa'),'contacts1');return db['CmHopper'][_0x7b2e('0x6')]({'where':{}});})[_0x7b2e('0x7')](function(){return db[_0x7b2e('0xb')]['bulkCreate'](hopper);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')](_0x7b2e('0xa'),_0x7b2e('0xc'));return db[_0x7b2e('0x8')][_0x7b2e('0xd')](contacts2);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')](_0x7b2e('0xa'),_0x7b2e('0xe'));return db['CmHopper'][_0x7b2e('0xd')](hopper2);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')]('finished\x20populating',_0x7b2e('0xf'));})[_0x7b2e('0x10')](function(_0x2813cc){console['log'](_0x2813cc);}); \ No newline at end of file +var _0xe89f=['contacts2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x454166,_0x51a652){var _0x1404ee=function(_0x357bb1){while(--_0x357bb1){_0x454166['push'](_0x454166['shift']());}};_0x1404ee(++_0x51a652);}(_0xe89f,0xb6));var _0xfe89=function(_0x4072c2,_0x5987f9){_0x4072c2=_0x4072c2-0x0;var _0xd10bd7=_0xe89f[_0x4072c2];return _0xd10bd7;};'use strict';var util=require(_0xfe89('0x0'));var db=require(_0xfe89('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xfe89('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xfe89('0x3')+i,'phone':0xf879fb460+i,'email':_0xfe89('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xfe89('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xfe89('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xfe89('0x3')+i,'phone':0xf879fb460+i,'email':_0xfe89('0x4')+i+_0xfe89('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xfe89('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xfe89('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xfe89('0x5')](),'updatedAt':Date['now']()});}db[_0xfe89('0x7')][_0xfe89('0x8')]({'where':{}})[_0xfe89('0x9')](function(){return db[_0xfe89('0x7')][_0xfe89('0xa')](contacts);})['then'](function(){console[_0xfe89('0xb')](_0xfe89('0xc'),_0xfe89('0xd'));return db[_0xfe89('0xe')][_0xfe89('0x8')]({'where':{}});})['then'](function(){return db['CmHopper'][_0xfe89('0xa')](hopper);})[_0xfe89('0x9')](function(){console[_0xfe89('0xb')]('finished\x20populating',_0xfe89('0xf'));return db[_0xfe89('0x7')][_0xfe89('0xa')](contacts2);})[_0xfe89('0x9')](function(){console[_0xfe89('0xb')](_0xfe89('0xc'),_0xfe89('0x10'));return db[_0xfe89('0xe')][_0xfe89('0xa')](hopper2);})['then'](function(){console[_0xfe89('0xb')](_0xfe89('0xc'),'hopper2');})[_0xfe89('0x11')](function(_0x1afc45){console[_0xfe89('0xb')](_0x1afc45);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 708ef2d..3b67f6b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f9c=['log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x7f9c,0x7b));var _0xc7f9=function(_0x321bdf,_0x524ae5){_0x321bdf=_0x321bdf-0x0;var _0x271a7b=_0x7f9c[_0x321bdf];return _0x271a7b;};'use strict';var util=require(_0xc7f9('0x0'));var db=require(_0xc7f9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc7f9('0x2')]({'name':util['format'](_0xc7f9('0x3'),_0xc7f9('0x4'),i),'fullname':util[_0xc7f9('0x5')](_0xc7f9('0x3'),_0xc7f9('0x4'),i),'email':util[_0xc7f9('0x5')](_0xc7f9('0x6'),_0xc7f9('0x4'),i),'role':_0xc7f9('0x4'),'password':_0xc7f9('0x7'),'internal':0xfa0+i,'type':_0xc7f9('0x8'),'transport':[_0xc7f9('0x9'),'ws',_0xc7f9('0xa')],'disallow':['all'],'allow':[_0xc7f9('0xb')],'defaultuser':util[_0xc7f9('0x5')](_0xc7f9('0x3'),_0xc7f9('0x4'),i),'encryption':_0xc7f9('0xc'),'avpf':'yes','force_avp':_0xc7f9('0xc'),'icesupport':_0xc7f9('0xc'),'dtlsenable':_0xc7f9('0xc'),'dtlsverify':'no','dtlscertfile':_0xc7f9('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xc7f9('0xe'),'callerid':util[_0xc7f9('0x5')](_0xc7f9('0xf'),util['format'](_0xc7f9('0x3'),'agent',i),0xfa0+i)});}db[_0xc7f9('0x10')]['bulkCreate'](users)['then'](function(){console[_0xc7f9('0x11')](_0xc7f9('0x12'));})[_0xc7f9('0x13')](function(_0x3e7d86){console[_0xc7f9('0x11')](_0x3e7d86);}); \ No newline at end of file +var _0x5d20=['format','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','util','../mysqldb','push','%s%s','agent'];(function(_0x131bc7,_0x5f0f52){var _0x2b887b=function(_0x212f71){while(--_0x212f71){_0x131bc7['push'](_0x131bc7['shift']());}};_0x2b887b(++_0x5f0f52);}(_0x5d20,0xc3));var _0x05d2=function(_0x142849,_0x4f35eb){_0x142849=_0x142849-0x0;var _0x59d465=_0x5d20[_0x142849];return _0x59d465;};'use strict';var util=require(_0x05d2('0x0'));var db=require(_0x05d2('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x05d2('0x2')]({'name':util['format'](_0x05d2('0x3'),_0x05d2('0x4'),i),'fullname':util[_0x05d2('0x5')](_0x05d2('0x3'),_0x05d2('0x4'),i),'email':util[_0x05d2('0x5')](_0x05d2('0x6'),_0x05d2('0x4'),i),'role':_0x05d2('0x4'),'password':_0x05d2('0x7'),'internal':0xfa0+i,'type':_0x05d2('0x8'),'transport':[_0x05d2('0x9'),'ws',_0x05d2('0xa')],'disallow':[_0x05d2('0xb')],'allow':['ulaw'],'defaultuser':util[_0x05d2('0x5')]('%s%s',_0x05d2('0x4'),i),'encryption':_0x05d2('0xc'),'avpf':'yes','force_avp':_0x05d2('0xc'),'icesupport':_0x05d2('0xc'),'dtlsenable':_0x05d2('0xc'),'dtlsverify':'no','dtlscertfile':_0x05d2('0xd'),'dtlsprivatekey':_0x05d2('0xe'),'dtlssetup':'actpass','callerid':util['format'](_0x05d2('0xf'),util[_0x05d2('0x5')](_0x05d2('0x3'),_0x05d2('0x4'),i),0xfa0+i)});}db['User'][_0x05d2('0x10')](users)[_0x05d2('0x11')](function(){console[_0x05d2('0x12')](_0x05d2('0x13'));})['catch'](function(_0x5b9a5e){console[_0x05d2('0x12')](_0x5b9a5e);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 634f6f0..2454cf6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda34=['chat','fax','sms','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','CONNECTED','bluebird','../mysqldb','name','Agents','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','format','%s:queue:%s','length','handshake','query','User','find','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','userProfileId','FaxQueues','FaxQueue','SmsQueues','MailQueues','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xda34,0x14e));var _0x4da3=function(_0x36bc9a,_0x352b6f){_0x36bc9a=_0x36bc9a-0x0;var _0x4f508=_0xda34[_0x36bc9a];return _0x4f508;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x4da3('0x0'));var db=require(_0x4da3('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x4da3('0x2')],'include':[{'as':_0x4da3('0x3'),'model':db['User'],'attributes':['id','name',_0x4da3('0x4')],'raw':!![],'where':{'role':_0x4da3('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4da3('0x2')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4da3('0x2'),_0x4da3('0x6')],'where':{'type':_0x4da3('0x7')}};function getAssociatedResources(_0x4d3f20,_0x2af5ec,_0x563d8e){return db[_0x4da3('0x8')][_0x4da3('0x9')]({'where':{'name':_0x4d3f20,'userProfileId':_0x2af5ec},'raw':!![]})[_0x4da3('0xa')](function(_0x4e5799){if(_0x4e5799){if(_0x4e5799[_0x4da3('0xb')]){switch(_0x4d3f20){case _0x4da3('0xc'):case _0x4da3('0xd'):case'FaxQueues':case'SmsQueues':case'MailQueues':case _0x4da3('0xe'):case _0x4da3('0xf'):return db[_0x563d8e][_0x4da3('0x10')](queryQueues);case _0x4da3('0x11'):return db[_0x563d8e][_0x4da3('0x10')](queryTelephones);case _0x4da3('0x12'):return db[_0x563d8e][_0x4da3('0x10')](queryTrunks);case _0x4da3('0x13'):return db[_0x563d8e][_0x4da3('0x10')](queryCampaigns);}}else{return db[_0x4da3('0x14')][_0x4da3('0x10')]({'attributes':['resourceId'],'where':{'sectionId':_0x4e5799['id']},'raw':!![]})['then'](function(_0x7503ba){if(_0x7503ba){var _0x330f62={'where':{'id':_[_0x4da3('0x15')](_0x7503ba,_0x4da3('0x16'))},'raw':!![]};switch(_0x563d8e){case'User':_0x330f62[_0x4da3('0x17')][_0x4da3('0x4')]='telephone';break;case'Campaign':_0x330f62[_0x4da3('0x17')][_0x4da3('0x6')]=_0x4da3('0x7');break;}return db[_0x563d8e]['findAll'](_0x330f62);}else{return[];}});}}else{return[];}})[_0x4da3('0xa')](function(_0x30e615){return _0x30e615;});}function joinOrLeaveQueues(_0x439744,_0x27a6dc,_0x158714,_0x4d7ae0){_0x439744[_0x27a6dc](util[_0x4da3('0x18')](_0x4da3('0x19'),_0x158714,_0x4d7ae0['name']));if(_0x4d7ae0['Agents']){for(var _0x2bf45e=0x0;_0x2bf45e<_0x4d7ae0[_0x4da3('0x3')][_0x4da3('0x1a')];_0x2bf45e+=0x1){_0x439744[_0x27a6dc](util[_0x4da3('0x18')]('user:%s',_0x4d7ae0['Agents'][_0x2bf45e]['name']));}}}function joinOrLeave(_0x4a23e2,_0x1699ef,_0xfeff22){var _0x1d7638;if(_0x4a23e2[_0x4da3('0x1b')][_0x4da3('0x1c')]['id']){db[_0x4da3('0x1d')][_0x4da3('0x1e')]({'attributes':['id',_0x4da3('0x2'),'role','userProfileId'],'where':{'id':_0x4a23e2[_0x4da3('0x1b')]['query']['id']},'include':[{'model':db[_0x4da3('0x1f')],'as':_0x4da3('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x21')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x22')],'as':_0x4da3('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x24')],'as':_0x4da3('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x26')],'as':_0x4da3('0x27'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x4da3('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xd779f4){if(_0xd779f4){_0x1d7638=_0xd779f4;_0x4a23e2[_0x1699ef](util['format']('user:%s',_0xd779f4[_0x4da3('0x2')]));var _0x1d7643=[];switch(_0xd779f4[_0x4da3('0x4')]){case _0x4da3('0x29'):_0x4a23e2[_0x1699ef]('voice:inbound');_0x4a23e2[_0x1699ef]('voice:outbound');if(queryQueues[_0x4da3('0x2a')](_0x4da3('0x2b'))){delete queryQueues[_0x4da3('0x2b')];}_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x2d')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x2e')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db['FaxQueue'][_0x4da3('0x10')](queryQueues));_0x1d7643['push'](db[_0x4da3('0x2f')]['findAll'](queryQueues));_0x1d7643['push'](db[_0x4da3('0x30')][_0x4da3('0x10')](queryQueues));_0x1d7643['push'](db[_0x4da3('0x31')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x32')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x1d')][_0x4da3('0x10')](queryTelephones));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x33')]['findAll'](queryTrunks));_0x1d7643['push'](db[_0x4da3('0x34')][_0x4da3('0x10')](queryCampaigns));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x1d')][_0x4da3('0x10')](queryAgents));break;case _0x4da3('0x35'):_0x4a23e2[_0x1699ef]('voice:inbound');_0x4a23e2[_0x1699ef](_0x4da3('0x36'));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources('VoiceQueues',_0xd779f4[_0x4da3('0x37')],_0x4da3('0x2d')));_0x1d7643['push'](getAssociatedResources(_0x4da3('0xd'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x2e')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x38'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x39')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x3a'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x2f')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x3b'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x30')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0xe'),_0xd779f4['userProfileId'],_0x4da3('0x31')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0xf'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x32')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x11'),_0xd779f4[_0x4da3('0x37')],'User'));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x12'),_0xd779f4[_0x4da3('0x37')],'Trunk'));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x13'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x34')));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x1d')]['findAll'](queryAgents));break;case _0x4da3('0x5'):_0x4a23e2[_0x1699ef]('voice:inbound');_0x4a23e2[_0x1699ef](_0x4da3('0x36'));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3c')]({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4['getChatQueues']({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3d')]({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3e')]({'attributes':['id','name']}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3f')]({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x40')]({'attributes':['id','name']}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x41')]({'attributes':['id',_0x4da3('0x2')]}));break;}return BPromise['all'](_0x1d7643);}})[_0x4da3('0xa')](function(_0x39454e){if(_0x39454e&&_0x39454e[_0x4da3('0x1a')]){for(var _0x54968e=0x0;_0x54968e<_0x39454e[_0x4da3('0x1a')];_0x54968e+=0x1){for(var _0x7603cf=0x0;_0x7603cf<_0x39454e[_0x54968e][_0x4da3('0x1a')];_0x7603cf+=0x1){switch(_0x54968e){case 0x0:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,'voice',_0x39454e[_0x54968e][_0x7603cf]);break;case 0x1:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x42'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x2:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x43'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x3:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x44'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x4:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,'mail',_0x39454e[_0x54968e][_0x7603cf]);break;case 0x5:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,'openchannel',_0x39454e[_0x54968e][_0x7603cf]);break;case 0x6:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x45'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x7:if(_0x1d7638['role']!==_0x4da3('0x5'))_0x4a23e2[_0x1699ef](util[_0x4da3('0x18')](_0x4da3('0x46'),_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;case 0x8:if(_0x1d7638['role']!==_0x4da3('0x5'))_0x4a23e2[_0x1699ef](util[_0x4da3('0x18')](_0x4da3('0x47'),_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;case 0x9:if(_0x1d7638[_0x4da3('0x4')]!=='agent')_0x4a23e2[_0x1699ef](util[_0x4da3('0x18')](_0x4da3('0x48'),_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x6')],_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;case 0xa:_0x4a23e2[_0x1699ef](util['format']('user:%s',_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;}}}}})['then'](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x26359c=_['map'](_0x1d7638[_0x4da3('0x20')],'id');return _0x1d7638[_0x4da3('0x4a')](_0x26359c)['then'](function(){for(var _0x5ca90f=0x0;_0x5ca90f<_0x26359c[_0x4da3('0x1a')];_0x5ca90f+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x4c'),{'ChatInteractionId':Number(_0x26359c[_0x5ca90f]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x2894b5=_['map'](_0x1d7638[_0x4da3('0x4d')],'id');return _0x1d7638[_0x4da3('0x4e')](_0x2894b5)['then'](function(){for(var _0x42c057=0x0;_0x42c057<_0x2894b5[_0x4da3('0x1a')];_0x42c057+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x4f'),{'MailInteractionId':Number(_0x2894b5[_0x42c057]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x4d57c8=_['map'](_0x1d7638['FaxInteractions'],'id');return _0x1d7638['removeFaxInteractions'](_0x4d57c8)[_0x4da3('0xa')](function(){for(var _0x1eb834=0x0;_0x1eb834<_0x4d57c8['length'];_0x1eb834+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x50'),{'FaxInteractionId':Number(_0x4d57c8[_0x1eb834]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x152d11=_[_0x4da3('0x15')](_0x1d7638[_0x4da3('0x25')],'id');return _0x1d7638['removeSmsInteractions'](_0x152d11)[_0x4da3('0xa')](function(){for(var _0x4ea714=0x0;_0x4ea714<_0x152d11[_0x4da3('0x1a')];_0x4ea714+=0x1){_0xfeff22['emit'](_0x4da3('0x51'),{'SmsInteractionId':Number(_0x152d11[_0x4ea714]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x1066a8=_[_0x4da3('0x15')](_0x1d7638[_0x4da3('0x27')],'id');return _0x1d7638[_0x4da3('0x52')](_0x1066a8)[_0x4da3('0xa')](function(){for(var _0xc12d49=0x0;_0xc12d49<_0x1066a8[_0x4da3('0x1a')];_0xc12d49+=0x1){_0xfeff22['emit'](_0x4da3('0x53'),{'OpenchannelInteractionId':Number(_0x1066a8[_0xc12d49]),'UserId':Number(_0x1d7638['id'])});}});}})['then'](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x40e00e=_['map'](_0x1d7638['WhatsappInteractions'],'id');return _0x1d7638[_0x4da3('0x54')](_0x40e00e)[_0x4da3('0xa')](function(){for(var _0x4a7bd4=0x0;_0x4a7bd4<_0x40e00e[_0x4da3('0x1a')];_0x4a7bd4+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x55'),{'WhatsappInteractionId':Number(_0x40e00e[_0x4a7bd4]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0x56')](function(_0x5e6173){_0x4a23e2['log'](_0x5e6173);});}}function onDisconnect(_0x5c9463,_0x5afa92){joinOrLeave(_0x5c9463,_0x4da3('0x49'),_0x5afa92);}function onConnect(_0x5c5c62){joinOrLeave(_0x5c5c62,_0x4da3('0x57'));}exports[_0x4da3('0x58')]=function(_0x3e707d){_0x3e707d['on'](_0x4da3('0x59'),function(_0x4a6b76){_0x4a6b76[_0x4da3('0x5a')](0x0);_0x4a6b76[_0x4da3('0x5b')]=_0x4a6b76[_0x4da3('0x5c')][_0x4da3('0x59')][_0x4da3('0x5d')]+':'+_0x4a6b76[_0x4da3('0x5c')][_0x4da3('0x59')][_0x4da3('0x5e')];_0x4a6b76[_0x4da3('0x5f')]=new Date();_0x4a6b76['log']=function(_0x1c9d1c){console[_0x4da3('0x60')](_0x4da3('0x61')+_0x4a6b76[_0x4da3('0x62')][_0x4da3('0x2')]+'['+_0x4a6b76['address']+']',_0x1c9d1c);};_0x4a6b76['on']('disconnect',function(){onDisconnect(_0x4a6b76,_0x3e707d);_0x4a6b76[_0x4da3('0x60')]('DISCONNECTED');});onConnect(_0x4a6b76);_0x4a6b76['log'](_0x4da3('0x63'));});}; \ No newline at end of file +var _0x9962=['role','telephone','agent','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','format','%s:queue:%s','length','user:%s','handshake','query','User','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Campaign','user','FaxQueue','MailQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','voice','chat','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','emit','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','address','request','remoteAddress','connection','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','Agents','name'];(function(_0x11b266,_0x5c8a35){var _0x3986e7=function(_0x1172e9){while(--_0x1172e9){_0x11b266['push'](_0x11b266['shift']());}};_0x3986e7(++_0x5c8a35);}(_0x9962,0xb8));var _0x2996=function(_0x113a85,_0x50f089){_0x113a85=_0x113a85-0x0;var _0x3c1387=_0x9962[_0x113a85];return _0x3c1387;};'use strict';var _=require(_0x2996('0x0'));var util=require('util');var BPromise=require(_0x2996('0x1'));var db=require(_0x2996('0x2'))['db'];var config=require(_0x2996('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x2996('0x4'),'model':db['User'],'attributes':['id',_0x2996('0x5'),_0x2996('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2996('0x5')],'where':{'role':_0x2996('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x2996('0x5')],'where':{'role':_0x2996('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2996('0x5'),_0x2996('0x9')],'where':{'type':_0x2996('0xa')}};function getAssociatedResources(_0x58a04e,_0x13b5a6,_0x5a24dd){return db[_0x2996('0xb')][_0x2996('0xc')]({'where':{'name':_0x58a04e,'userProfileId':_0x13b5a6},'raw':!![]})[_0x2996('0xd')](function(_0x35bcfe){if(_0x35bcfe){if(_0x35bcfe['autoAssociation']){switch(_0x58a04e){case _0x2996('0xe'):case _0x2996('0xf'):case _0x2996('0x10'):case _0x2996('0x11'):case'MailQueues':case _0x2996('0x12'):case _0x2996('0x13'):return db[_0x5a24dd][_0x2996('0x14')](queryQueues);case _0x2996('0x15'):return db[_0x5a24dd]['findAll'](queryTelephones);case _0x2996('0x16'):return db[_0x5a24dd]['findAll'](queryTrunks);case _0x2996('0x17'):return db[_0x5a24dd][_0x2996('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0x2996('0x14')]({'attributes':[_0x2996('0x18')],'where':{'sectionId':_0x35bcfe['id']},'raw':!![]})[_0x2996('0xd')](function(_0x43e380){if(_0x43e380){var _0xc267fb={'where':{'id':_[_0x2996('0x19')](_0x43e380,_0x2996('0x18'))},'raw':!![]};switch(_0x5a24dd){case'User':_0xc267fb['where'][_0x2996('0x6')]=_0x2996('0x7');break;case'Campaign':_0xc267fb['where'][_0x2996('0x9')]=_0x2996('0xa');break;}return db[_0x5a24dd]['findAll'](_0xc267fb);}else{return[];}});}}else{return[];}})[_0x2996('0xd')](function(_0x11ef19){return _0x11ef19;});}function joinOrLeaveQueues(_0x9743ee,_0x330381,_0x289748,_0x350729){_0x9743ee[_0x330381](util[_0x2996('0x1a')](_0x2996('0x1b'),_0x289748,_0x350729[_0x2996('0x5')]));if(_0x350729[_0x2996('0x4')]){for(var _0x5bfc6d=0x0;_0x5bfc6d<_0x350729[_0x2996('0x4')][_0x2996('0x1c')];_0x5bfc6d+=0x1){_0x9743ee[_0x330381](util[_0x2996('0x1a')](_0x2996('0x1d'),_0x350729[_0x2996('0x4')][_0x5bfc6d]['name']));}}}function joinOrLeave(_0x161004,_0x42e5f5,_0x2bfb2b){var _0x4de34d;if(_0x161004[_0x2996('0x1e')][_0x2996('0x1f')]['id']){db[_0x2996('0x20')]['find']({'attributes':['id',_0x2996('0x5'),_0x2996('0x6'),_0x2996('0x21')],'where':{'id':_0x161004['handshake'][_0x2996('0x1f')]['id']},'include':[{'model':db[_0x2996('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2996('0x23')],'as':_0x2996('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x2996('0x25')],'as':_0x2996('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x2996('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2996('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x2996('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3adddd){if(_0x3adddd){_0x4de34d=_0x3adddd;_0x161004[_0x42e5f5](util[_0x2996('0x1a')](_0x2996('0x1d'),_0x3adddd[_0x2996('0x5')]));var _0x4b3e5e=[];switch(_0x3adddd['role']){case _0x2996('0x2a'):_0x161004[_0x42e5f5](_0x2996('0x2b'));_0x161004[_0x42e5f5](_0x2996('0x2c'));if(queryQueues[_0x2996('0x2d')](_0x2996('0x2e'))){delete queryQueues[_0x2996('0x2e')];}_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x30')]['findAll'](queryQueues));_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x31')]['findAll'](queryQueues));_0x4b3e5e[_0x2996('0x2f')](db['FaxQueue'][_0x2996('0x14')](queryQueues));_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x32')]['findAll'](queryQueues));_0x4b3e5e['push'](db[_0x2996('0x33')]['findAll'](queryQueues));_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x34')]['findAll'](queryQueues));_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x35')][_0x2996('0x14')](queryQueues));_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x20')][_0x2996('0x14')](queryTelephones));_0x4b3e5e['push'](db['Trunk'][_0x2996('0x14')](queryTrunks));_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x36')][_0x2996('0x14')](queryCampaigns));_0x4b3e5e[_0x2996('0x2f')](db[_0x2996('0x20')]['findAll'](queryAgents));break;case _0x2996('0x37'):_0x161004[_0x42e5f5](_0x2996('0x2b'));_0x161004[_0x42e5f5]('voice:outbound');_0x4b3e5e['push'](getAssociatedResources(_0x2996('0xe'),_0x3adddd[_0x2996('0x21')],'VoiceQueue'));_0x4b3e5e[_0x2996('0x2f')](getAssociatedResources(_0x2996('0xf'),_0x3adddd[_0x2996('0x21')],_0x2996('0x31')));_0x4b3e5e[_0x2996('0x2f')](getAssociatedResources(_0x2996('0x10'),_0x3adddd[_0x2996('0x21')],_0x2996('0x38')));_0x4b3e5e['push'](getAssociatedResources(_0x2996('0x11'),_0x3adddd[_0x2996('0x21')],_0x2996('0x32')));_0x4b3e5e['push'](getAssociatedResources(_0x2996('0x39'),_0x3adddd['userProfileId'],_0x2996('0x33')));_0x4b3e5e[_0x2996('0x2f')](getAssociatedResources(_0x2996('0x12'),_0x3adddd[_0x2996('0x21')],_0x2996('0x34')));_0x4b3e5e[_0x2996('0x2f')](getAssociatedResources(_0x2996('0x13'),_0x3adddd[_0x2996('0x21')],_0x2996('0x35')));_0x4b3e5e[_0x2996('0x2f')](getAssociatedResources('Telephones',_0x3adddd[_0x2996('0x21')],_0x2996('0x20')));_0x4b3e5e[_0x2996('0x2f')](getAssociatedResources('Trunks',_0x3adddd[_0x2996('0x21')],'Trunk'));_0x4b3e5e['push'](getAssociatedResources(_0x2996('0x17'),_0x3adddd[_0x2996('0x21')],_0x2996('0x36')));_0x4b3e5e['push'](db[_0x2996('0x20')][_0x2996('0x14')](queryAgents));break;case _0x2996('0x8'):_0x161004[_0x42e5f5](_0x2996('0x2b'));_0x161004[_0x42e5f5](_0x2996('0x2c'));_0x4b3e5e[_0x2996('0x2f')](_0x3adddd['getVoiceQueues']({'attributes':['id','name']}));_0x4b3e5e[_0x2996('0x2f')](_0x3adddd[_0x2996('0x3a')]({'attributes':['id',_0x2996('0x5')]}));_0x4b3e5e[_0x2996('0x2f')](_0x3adddd[_0x2996('0x3b')]({'attributes':['id',_0x2996('0x5')]}));_0x4b3e5e[_0x2996('0x2f')](_0x3adddd[_0x2996('0x3c')]({'attributes':['id','name']}));_0x4b3e5e['push'](_0x3adddd['getMailQueues']({'attributes':['id',_0x2996('0x5')]}));_0x4b3e5e[_0x2996('0x2f')](_0x3adddd['getOpenchannelQueues']({'attributes':['id',_0x2996('0x5')]}));_0x4b3e5e[_0x2996('0x2f')](_0x3adddd[_0x2996('0x3d')]({'attributes':['id','name']}));break;}return BPromise[_0x2996('0x3e')](_0x4b3e5e);}})[_0x2996('0xd')](function(_0x42fa23){if(_0x42fa23&&_0x42fa23[_0x2996('0x1c')]){for(var _0x1b6d7e=0x0;_0x1b6d7e<_0x42fa23[_0x2996('0x1c')];_0x1b6d7e+=0x1){for(var _0x3096d5=0x0;_0x3096d5<_0x42fa23[_0x1b6d7e][_0x2996('0x1c')];_0x3096d5+=0x1){switch(_0x1b6d7e){case 0x0:joinOrLeaveQueues(_0x161004,_0x42e5f5,_0x2996('0x3f'),_0x42fa23[_0x1b6d7e][_0x3096d5]);break;case 0x1:joinOrLeaveQueues(_0x161004,_0x42e5f5,_0x2996('0x40'),_0x42fa23[_0x1b6d7e][_0x3096d5]);break;case 0x2:joinOrLeaveQueues(_0x161004,_0x42e5f5,'fax',_0x42fa23[_0x1b6d7e][_0x3096d5]);break;case 0x3:joinOrLeaveQueues(_0x161004,_0x42e5f5,'sms',_0x42fa23[_0x1b6d7e][_0x3096d5]);break;case 0x4:joinOrLeaveQueues(_0x161004,_0x42e5f5,'mail',_0x42fa23[_0x1b6d7e][_0x3096d5]);break;case 0x5:joinOrLeaveQueues(_0x161004,_0x42e5f5,_0x2996('0x41'),_0x42fa23[_0x1b6d7e][_0x3096d5]);break;case 0x6:joinOrLeaveQueues(_0x161004,_0x42e5f5,_0x2996('0x42'),_0x42fa23[_0x1b6d7e][_0x3096d5]);break;case 0x7:if(_0x4de34d[_0x2996('0x6')]!==_0x2996('0x8'))_0x161004[_0x42e5f5](util[_0x2996('0x1a')](_0x2996('0x43'),_0x42fa23[_0x1b6d7e][_0x3096d5][_0x2996('0x5')]));break;case 0x8:if(_0x4de34d[_0x2996('0x6')]!==_0x2996('0x8'))_0x161004[_0x42e5f5](util[_0x2996('0x1a')]('trunk:%s',_0x42fa23[_0x1b6d7e][_0x3096d5]['name']));break;case 0x9:if(_0x4de34d[_0x2996('0x6')]!==_0x2996('0x8'))_0x161004[_0x42e5f5](util[_0x2996('0x1a')](_0x2996('0x44'),_0x42fa23[_0x1b6d7e][_0x3096d5][_0x2996('0x9')],_0x42fa23[_0x1b6d7e][_0x3096d5][_0x2996('0x5')]));break;case 0xa:_0x161004[_0x42e5f5](util[_0x2996('0x1a')]('user:%s',_0x42fa23[_0x1b6d7e][_0x3096d5][_0x2996('0x5')]));break;}}}}})[_0x2996('0xd')](function(){if(_0x42e5f5===_0x2996('0x45')){var _0x136e24=_[_0x2996('0x19')](_0x4de34d[_0x2996('0x46')],'id');return _0x4de34d['removeChatInteractions'](_0x136e24)[_0x2996('0xd')](function(){for(var _0x2e1ac7=0x0;_0x2e1ac7<_0x136e24[_0x2996('0x1c')];_0x2e1ac7+=0x1){_0x2bfb2b[_0x2996('0x47')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x136e24[_0x2e1ac7]),'UserId':Number(_0x4de34d['id'])});}});}})['then'](function(){if(_0x42e5f5===_0x2996('0x45')){var _0x270b74=_[_0x2996('0x19')](_0x4de34d[_0x2996('0x24')],'id');return _0x4de34d['removeMailInteractions'](_0x270b74)['then'](function(){for(var _0x50f343=0x0;_0x50f343<_0x270b74[_0x2996('0x1c')];_0x50f343+=0x1){_0x2bfb2b[_0x2996('0x47')](_0x2996('0x48'),{'MailInteractionId':Number(_0x270b74[_0x50f343]),'UserId':Number(_0x4de34d['id'])});}});}})['then'](function(){if(_0x42e5f5===_0x2996('0x45')){var _0x13fb1b=_[_0x2996('0x19')](_0x4de34d[_0x2996('0x26')],'id');return _0x4de34d['removeFaxInteractions'](_0x13fb1b)[_0x2996('0xd')](function(){for(var _0x22eba1=0x0;_0x22eba1<_0x13fb1b[_0x2996('0x1c')];_0x22eba1+=0x1){_0x2bfb2b[_0x2996('0x47')](_0x2996('0x49'),{'FaxInteractionId':Number(_0x13fb1b[_0x22eba1]),'UserId':Number(_0x4de34d['id'])});}});}})['then'](function(){if(_0x42e5f5===_0x2996('0x45')){var _0x1da797=_[_0x2996('0x19')](_0x4de34d[_0x2996('0x27')],'id');return _0x4de34d[_0x2996('0x4a')](_0x1da797)[_0x2996('0xd')](function(){for(var _0x2497a4=0x0;_0x2497a4<_0x1da797[_0x2996('0x1c')];_0x2497a4+=0x1){_0x2bfb2b[_0x2996('0x47')](_0x2996('0x4b'),{'SmsInteractionId':Number(_0x1da797[_0x2497a4]),'UserId':Number(_0x4de34d['id'])});}});}})['then'](function(){if(_0x42e5f5===_0x2996('0x45')){var _0x3c76aa=_[_0x2996('0x19')](_0x4de34d[_0x2996('0x4c')],'id');return _0x4de34d[_0x2996('0x4d')](_0x3c76aa)[_0x2996('0xd')](function(){for(var _0x52b0df=0x0;_0x52b0df<_0x3c76aa['length'];_0x52b0df+=0x1){_0x2bfb2b[_0x2996('0x47')](_0x2996('0x4e'),{'OpenchannelInteractionId':Number(_0x3c76aa[_0x52b0df]),'UserId':Number(_0x4de34d['id'])});}});}})[_0x2996('0xd')](function(){if(_0x42e5f5===_0x2996('0x45')){var _0x4bf78b=_[_0x2996('0x19')](_0x4de34d[_0x2996('0x29')],'id');return _0x4de34d[_0x2996('0x4f')](_0x4bf78b)[_0x2996('0xd')](function(){for(var _0x2a9f6b=0x0;_0x2a9f6b<_0x4bf78b['length'];_0x2a9f6b+=0x1){_0x2bfb2b[_0x2996('0x47')](_0x2996('0x50'),{'WhatsappInteractionId':Number(_0x4bf78b[_0x2a9f6b]),'UserId':Number(_0x4de34d['id'])});}});}})[_0x2996('0x51')](function(_0x3563eb){_0x161004[_0x2996('0x52')](_0x3563eb);});}}function onDisconnect(_0x562bcd,_0x33aac4){joinOrLeave(_0x562bcd,_0x2996('0x45'),_0x33aac4);}function onConnect(_0x50dde0){joinOrLeave(_0x50dde0,_0x2996('0x53'));}exports[_0x2996('0x54')]=function(_0xb09dbe){_0xb09dbe['on']('connection',function(_0x2e9b78){_0x2e9b78['setMaxListeners'](0x0);_0x2e9b78[_0x2996('0x55')]=_0x2e9b78[_0x2996('0x56')]['connection'][_0x2996('0x57')]+':'+_0x2e9b78['request'][_0x2996('0x58')]['remotePort'];_0x2e9b78[_0x2996('0x59')]=new Date();_0x2e9b78[_0x2996('0x52')]=function(_0x2a1a89){console[_0x2996('0x52')](_0x2996('0x5a')+_0x2e9b78[_0x2996('0x5b')][_0x2996('0x5')]+'['+_0x2e9b78['address']+']',_0x2a1a89);};_0x2e9b78['on'](_0x2996('0x5c'),function(){onDisconnect(_0x2e9b78,_0xb09dbe);_0x2e9b78[_0x2996('0x52')](_0x2996('0x5d'));});onConnect(_0x2e9b78);_0x2e9b78[_0x2996('0x52')](_0x2996('0x5e'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 8fd5273..86b6dc9 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 _0xc22b=['jayson/promise','triggers','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','channel','motionChannel','ContactId','undefined','sequelize','query','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','offlineMessage','event','opened','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','closed','changed','substatus','AfterUpdate','User','find','name','fullname','email','default','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb'];(function(_0x4588da,_0x4dca4d){var _0x148038=function(_0x5e2372){while(--_0x5e2372){_0x4588da['push'](_0x4588da['shift']());}};_0x148038(++_0x4dca4d);}(_0xc22b,0x8e));var _0xbc22=function(_0x4ce6d0,_0x1bc1a0){_0x4ce6d0=_0x4ce6d0-0x0;var _0x3d7585=_0xc22b[_0x4ce6d0];return _0x3d7585;};'use strict';var util=require(_0xbc22('0x0'));var db=require(_0xbc22('0x1'))['db'];var jayson=require(_0xbc22('0x2'));var logger=require('../logger')(_0xbc22('0x3'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0xbc22('0x4'),'model':_0xbc22('0x5'),'event':_0xbc22('0x6'),'condition':_0xbc22('0x7'),'callback':afterCreate},{'channel':_0xbc22('0x4'),'model':_0xbc22('0x5'),'event':_0xbc22('0x8'),'condition':_0xbc22('0x9'),'callback':afterUpdate},{'channel':_0xbc22('0x4'),'model':_0xbc22('0xa'),'event':_0xbc22('0x6'),'condition':_0xbc22('0xb'),'callback':afterCreateMessage},{'channel':_0xbc22('0x4'),'model':_0xbc22('0xc'),'event':_0xbc22('0x6'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0xbc22('0xd'),'model':_0xbc22('0xe'),'event':_0xbc22('0x6'),'condition':_0xbc22('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0xbc22('0xe'),'event':_0xbc22('0x8'),'condition':_0xbc22('0x9'),'callback':afterUpdate},{'channel':_0xbc22('0xd'),'model':_0xbc22('0xf'),'event':_0xbc22('0x6'),'condition':_0xbc22('0xb'),'callback':afterCreateMessage},{'channel':_0xbc22('0x10'),'model':'WhatsappInteraction','event':_0xbc22('0x6'),'condition':_0xbc22('0x7'),'callback':afterCreate},{'channel':_0xbc22('0x10'),'model':_0xbc22('0x11'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbc22('0x10'),'model':_0xbc22('0x12'),'event':'afterCreate','condition':_0xbc22('0xb'),'callback':afterCreateMessage},{'channel':_0xbc22('0x13'),'model':_0xbc22('0x14'),'event':_0xbc22('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xbc22('0x13'),'model':_0xbc22('0x14'),'event':_0xbc22('0x8'),'condition':_0xbc22('0x9'),'callback':afterUpdate},{'channel':_0xbc22('0x13'),'model':'FaxMessage','event':_0xbc22('0x6'),'condition':_0xbc22('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0xbc22('0x6'),'condition':_0xbc22('0x7'),'callback':afterCreate},{'channel':_0xbc22('0x15'),'model':'MailInteraction','event':_0xbc22('0x8'),'condition':_0xbc22('0x9'),'callback':afterUpdate},{'channel':_0xbc22('0x15'),'model':_0xbc22('0x16'),'event':_0xbc22('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xbc22('0x6'),'condition':_0xbc22('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0xbc22('0x17'),'event':_0xbc22('0x8'),'condition':_0xbc22('0x9'),'callback':afterUpdate},{'channel':_0xbc22('0x18'),'model':'OpenchannelMessage','event':_0xbc22('0x6'),'condition':_0xbc22('0xb'),'callback':afterCreateMessage}];function request(_0x5439e2){return client[_0xbc22('0x19')](_0xbc22('0x1a'),_0x5439e2)[_0xbc22('0x1b')](function(_0x4b0074){logger[_0xbc22('0x1c')]('Trigger,\x20%s','EventManager',_0x4b0074);if(_0x4b0074['error']){if(_0x4b0074[_0xbc22('0x1d')][_0xbc22('0x1e')]===0x1f4){logger[_0xbc22('0x1d')](_0xbc22('0x1f'),'EventManager',_0x4b0074[_0xbc22('0x1d')]);}}})[_0xbc22('0x20')](function(_0xf230ae){logger['error'](_0xbc22('0x1f'),_0xbc22('0x1a'),_0xf230ae);});}function afterCreateMessage(_0x10e84a){return function(_0x152c68){_0x152c68=_0x152c68['get']({'plain':!![]});_0x152c68[_0xbc22('0x21')]=_0x10e84a;_0x152c68[_0xbc22('0x22')]=_0x10e84a;_0x152c68['event']=_0x152c68['direction'];Promise['resolve']()[_0xbc22('0x1b')](function(){if(typeof _0x152c68[_0xbc22('0x23')]===_0xbc22('0x24'))return null;var _0x57ff4c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x152c68[_0xbc22('0x23')];return db[_0xbc22('0x25')][_0xbc22('0x26')](_0x57ff4c,{'type':db['Sequelize'][_0xbc22('0x27')][_0xbc22('0x28')],'raw':!![]});})['then'](function(_0x1c4703){if(_0x1c4703){_0x152c68[_0xbc22('0x29')]=_0x1c4703[0x0];}if(typeof _0x152c68[_0xbc22('0x2a')]===_0xbc22('0x24'))return;return getAgent(_0x152c68['UserId']);})[_0xbc22('0x1b')](function(_0x38ca43){if(_0x38ca43){_0x152c68[_0xbc22('0x2b')]=util[_0xbc22('0x2c')](_0xbc22('0x2d'),_0x38ca43['name']);_0x152c68[_0xbc22('0x2e')]=_0x38ca43;_0x152c68[_0xbc22('0x21')]=_0x10e84a;return request({'event':_0xbc22('0x2f'),'message':_0x152c68});}else{return request({'event':_0xbc22('0x30'),'message':_0x152c68});}})[_0xbc22('0x20')](function(_0x4edcea){logger[_0xbc22('0x1d')](_0xbc22('0x1f'),_0xbc22('0x31'),_0x4edcea);});};}function afterCreateOfflineMessage(_0x383b5c){return function(_0x497128){_0x497128=_0x497128[_0xbc22('0x32')]({'plain':!![]});_0x497128['channel']=_0x383b5c;_0x497128['motionChannel']=_0x383b5c;_0x497128['event']=_0xbc22('0x33');return request({'event':_0x497128['event'],'message':_0x497128});};}function afterCreate(_0xcc192,_0x1c51d5){return function(_0x92e46b){_0x92e46b=_0x92e46b[_0xbc22('0x32')]({'plain':!![]});_0x92e46b[_0xbc22('0x21')]=_0xcc192;_0x92e46b[_0xbc22('0x22')]=_0xcc192;_0x92e46b[_0xbc22('0x34')]=_0xbc22('0x35');Promise[_0xbc22('0x36')]()[_0xbc22('0x1b')](function(){var _0x7d605a=_0xbc22('0x37')+_0x92e46b['ContactId'];return db[_0xbc22('0x25')][_0xbc22('0x26')](_0x7d605a,{'type':db[_0xbc22('0x38')][_0xbc22('0x27')]['SELECT'],'raw':!![]});})[_0xbc22('0x1b')](function(_0x4777d6){if(_0x4777d6){_0x92e46b['contact']=_0x4777d6[0x0];}if(typeof _0x92e46b[_0xbc22('0x2a')]==='undefined')return;return getAgent(_0x92e46b['UserId']);})[_0xbc22('0x1b')](function(_0x49362e){if(_0x49362e){_0x92e46b[_0xbc22('0x2b')]=util['format'](_0xbc22('0x2d'),_0x49362e['name']);_0x92e46b['agent']=_0x49362e;}return request({'event':_0x1c51d5,'message':_0x92e46b});})[_0xbc22('0x20')](function(_0x49cf13){logger[_0xbc22('0x1d')](_0xbc22('0x1f'),'AfterCreate',_0x49cf13);});};}function afterUpdate(_0x1a36a7){return function(_0xf0010b){var _0x433329=_0xf0010b['changed'](_0xbc22('0x39'))&&_0xf0010b[_0xbc22('0x39')];var _0x2b0bd8=_0xf0010b[_0xbc22('0x3a')](_0xbc22('0x3b'));if(_0x433329||_0x2b0bd8){var _0x3ed2d8=_0x433329?'closedinteraction':'substatus';var _0x55afcc=_0xf0010b[_0xbc22('0x32')]({'plain':!![]});_0x55afcc['channel']=_0x1a36a7;_0x55afcc['motionChannel']=_0x1a36a7;_0x55afcc[_0xbc22('0x34')]=_0x433329?'closed':_0xbc22('0x3b');var _0x3f10ab=_0xbc22('0x37')+_0x55afcc[_0xbc22('0x23')];return db[_0xbc22('0x25')][_0xbc22('0x26')](_0x3f10ab,{'type':db[_0xbc22('0x38')]['QueryTypes'][_0xbc22('0x28')],'raw':!![]})[_0xbc22('0x1b')](function(_0xe8b931){if(_0xe8b931){_0x55afcc[_0xbc22('0x29')]=_0xe8b931[0x0];}if(typeof _0x55afcc[_0xbc22('0x2a')]===_0xbc22('0x24'))return;return getAgent(_0x55afcc[_0xbc22('0x2a')]);})[_0xbc22('0x1b')](function(_0x4ed2b4){if(_0x4ed2b4){_0x55afcc[_0xbc22('0x2b')]=util[_0xbc22('0x2c')]('SIP/%s',_0x4ed2b4['name']);_0x55afcc[_0xbc22('0x2e')]=_0x4ed2b4;}return request({'event':_0x3ed2d8,'message':_0x55afcc});})[_0xbc22('0x20')](function(_0x89c0c){logger[_0xbc22('0x1d')](_0xbc22('0x1f'),_0xbc22('0x3c'),_0x89c0c);});}};}function getAgent(_0x40b692){return db[_0xbc22('0x3d')][_0xbc22('0x3e')]({'where':{'id':_0x40b692},'attributes':['id',_0xbc22('0x3f'),_0xbc22('0x40'),_0xbc22('0x41'),'internal'],'raw':!![]})[_0xbc22('0x1b')](function(_0x5d3cbe){return _0x5d3cbe;});}exports[_0xbc22('0x42')]=function(){for(var _0x5eb1e8=0x0;_0x5eb1e8=_0x4a1cd5[_0x5af6('0x15')]){throw Error(_0x5af6('0x16'));}_0x1c0a3f(_0x1c8713);})['catch'](function(_0x28b208){_0x505079(_0x28b208);});});}; \ No newline at end of file +var _0xeb54=['User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','../mysqldb','voice','mail','fax','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','getLicense','role'];(function(_0x9ea249,_0x4478c9){var _0x2eab06=function(_0x9f9f79){while(--_0x9f9f79){_0x9ea249['push'](_0x9ea249['shift']());}};_0x2eab06(++_0x4478c9);}(_0xeb54,0x1ae));var _0x4eb5=function(_0x1d542c,_0x22b74d){_0x1d542c=_0x1d542c-0x0;var _0x3a0a61=_0xeb54[_0x1d542c];return _0x3a0a61;};'use strict';var _=require('lodash');var BPromise=require(_0x4eb5('0x0'));var db=require(_0x4eb5('0x1'))['db'];var util=require('./license/util');var channels=[_0x4eb5('0x2'),_0x4eb5('0x3'),'chat',_0x4eb5('0x4'),'sms','whatsapp','openchannel'];exports['getChannels']=function(){return channels;};exports[_0x4eb5('0x5')]=function(_0x40c7ab){_0x40c7ab=_0x40c7ab['toLowerCase']();return _[_0x4eb5('0x6')](channels,_0x40c7ab);};exports[_0x4eb5('0x7')]=function(_0xf5a847,_0x182b16,_0x4fce8b,_0x5c03b8){var _0x557c81={'loginAttempts':_0x182b16,'blocked':_0x4fce8b};if(!_[_0x4eb5('0x8')](_0x5c03b8)){_0x557c81[_0x4eb5('0x9')]=_0x5c03b8;}return _0xf5a847['updateAttributes'](_0x557c81);};exports[_0x4eb5('0xa')]=function(_0x14ee62){return new BPromise(function(_0x31d5d8,_0x35a29b){var _0x170bbc=0x0;if(_0x14ee62[_0x4eb5('0xb')]!=='agent'){_0x31d5d8(_0x14ee62);}db[_0x4eb5('0xc')][_0x4eb5('0xd')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x14ee62['id']}}})['then'](function(_0x6a64ad){_0x170bbc=_0x6a64ad;return util[_0x4eb5('0xa')]();})[_0x4eb5('0xe')](function(_0x34fe1c){if(_0x34fe1c&&_0x34fe1c[_0x4eb5('0xf')]&&_0x170bbc>=_0x34fe1c['agents']){throw Error(_0x4eb5('0x10'));}_0x31d5d8(_0x14ee62);})['catch'](function(_0x2535d9){_0x35a29b(_0x2535d9);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 45dd88a..c00d2e9 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bb5=['message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Not\x20Found','OutOfInterval','error','stack','status','send','exports','util','../config/logger'];(function(_0x21de95,_0x71ff49){var _0x8689ea=function(_0x3cfb56){while(--_0x3cfb56){_0x21de95['push'](_0x21de95['shift']());}};_0x8689ea(++_0x71ff49);}(_0x0bb5,0x148));var _0x50bb=function(_0x2ff4cc,_0x18274a){_0x2ff4cc=_0x2ff4cc-0x0;var _0x5b76e5=_0x0bb5[_0x2ff4cc];return _0x5b76e5;};'use strict';var util=require(_0x50bb('0x0'));var logger=require(_0x50bb('0x1'))('api');var APIError=function(_0x5a12b6,_0x348380){this[_0x50bb('0x2')]=_0x5a12b6||_0x50bb('0x3');this[_0x50bb('0x4')]=_0x348380||_0x50bb('0x5');util[_0x50bb('0x6')](APIError,Error);};var APIBadRequestError=function(_0x451b4c){this[_0x50bb('0x2')]=_0x451b4c||'Bad\x20Request';this['name']=_0x50bb('0x7');util[_0x50bb('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2e5463){this[_0x50bb('0x2')]=_0x2e5463||'Entity\x20not\x20found';this['name']=_0x50bb('0x8');util[_0x50bb('0x6')](APINotFoundError,APIError);};function getStatusCode(_0x3ae598){switch(_0x3ae598){case _0x50bb('0x7'):return 0x190;case'Forbidden',_0x50bb('0x9'):return 0x193;case _0x50bb('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x184d06){return function(_0x41055d){logger[_0x50bb('0xa')](_0x41055d[_0x50bb('0xb')]);var _0x38d3b6=getStatusCode(_0x41055d['name']);if(_0x41055d[_0x50bb('0x4')])delete _0x41055d['name'];return _0x184d06[_0x50bb('0xc')](_0x38d3b6)[_0x50bb('0xd')](_0x41055d);};}module[_0x50bb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xbec5=['error','stack','status','send','exports','util','../config/logger','message','Internal\x20Server\x20Error','name','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval'];(function(_0x478d7b,_0x4eaa36){var _0xeed206=function(_0x304287){while(--_0x304287){_0x478d7b['push'](_0x478d7b['shift']());}};_0xeed206(++_0x4eaa36);}(_0xbec5,0xe5));var _0x5bec=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xbec5[_0x2b91c5];return _0xbd5531;};'use strict';var util=require(_0x5bec('0x0'));var logger=require(_0x5bec('0x1'))('api');var APIError=function(_0x1d4842,_0x38c81a){this[_0x5bec('0x2')]=_0x1d4842||_0x5bec('0x3');this[_0x5bec('0x4')]=_0x38c81a||'Error';util[_0x5bec('0x5')](APIError,Error);};var APIBadRequestError=function(_0x376cdb){this[_0x5bec('0x2')]=_0x376cdb||'Bad\x20Request';this[_0x5bec('0x4')]=_0x5bec('0x6');util[_0x5bec('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x406e65){this[_0x5bec('0x2')]=_0x406e65||_0x5bec('0x7');this[_0x5bec('0x4')]=_0x5bec('0x8');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x41a827){switch(_0x41a827){case'Bad\x20Request':return 0x190;case _0x5bec('0x9'),_0x5bec('0xa'):return 0x193;case _0x5bec('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x4a5482){return function(_0x288d1b){logger[_0x5bec('0xb')](_0x288d1b[_0x5bec('0xc')]);var _0x57ffc4=getStatusCode(_0x288d1b[_0x5bec('0x4')]);if(_0x288d1b[_0x5bec('0x4')])delete _0x288d1b['name'];return _0x4a5482[_0x5bec('0xd')](_0x57ffc4)[_0x5bec('0xe')](_0x288d1b);};}module[_0x5bec('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7c66d2b..0e4bd37 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0490=['status','render','json'];(function(_0x4d183d,_0x123de0){var _0x431236=function(_0x35642b){while(--_0x35642b){_0x4d183d['push'](_0x4d183d['shift']());}};_0x431236(++_0x123de0);}(_0x0490,0x147));var _0x0049=function(_0x398382,_0x3d252f){_0x398382=_0x398382-0x0;var _0x2d8dce=_0x0490[_0x398382];return _0x2d8dce;};'use strict';module['exports'][0x194]=function pageNotFound(_0x34765b,_0x5f5313){var _0x555b7c='404';var _0x5b6bc9=0x194;var _0x2803f6={'status':_0x5b6bc9};_0x5f5313[_0x0049('0x0')](_0x2803f6[_0x0049('0x0')]);_0x5f5313[_0x0049('0x1')](_0x555b7c,{},function(_0x2872ec,_0x4a59b9){if(_0x2872ec){return _0x5f5313[_0x0049('0x0')](_0x2803f6[_0x0049('0x0')])[_0x0049('0x2')](_0x2803f6);}_0x5f5313['send'](_0x4a59b9);});}; \ No newline at end of file +var _0xc4dd=['exports','404','status','render','json','send'];(function(_0x2360be,_0x91c64a){var _0x55cbee=function(_0x3cf856){while(--_0x3cf856){_0x2360be['push'](_0x2360be['shift']());}};_0x55cbee(++_0x91c64a);}(_0xc4dd,0x1bc));var _0xdc4d=function(_0x307590,_0x165010){_0x307590=_0x307590-0x0;var _0x2615b1=_0xc4dd[_0x307590];return _0x2615b1;};'use strict';module[_0xdc4d('0x0')][0x194]=function pageNotFound(_0x3e9c06,_0x1e35c4){var _0x11df43=_0xdc4d('0x1');var _0x24a80f=0x194;var _0x3e4a91={'status':_0x24a80f};_0x1e35c4['status'](_0x3e4a91[_0xdc4d('0x2')]);_0x1e35c4[_0xdc4d('0x3')](_0x11df43,{},function(_0x3e6dd8,_0x67b7f0){if(_0x3e6dd8){return _0x1e35c4['status'](_0x3e4a91[_0xdc4d('0x2')])[_0xdc4d('0x4')](_0x3e4a91);}_0x1e35c4[_0xdc4d('0x5')](_0x67b7f0);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 9d968c5..948eba0 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ede=['user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','IntervalId','Pause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceQueueReport','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','Agents','MailQueue','team_has_mail_queues','MailInteractionId','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','TagId','Dashboard','Items','FaxAccountId','Exntensions','FaxInteractionId','Account','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelInteraction','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatWebsiteId','UserChatQueue','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Contacts','CmContactId','HopperHistories','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CmHopperId','CampaignId','OwnerId','Condition','All','OneAll','OneAny','AutomationAnyId','Action','Actions','ParentId','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','TriggerAllId','Trigger','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','DeskAccount','Subjects','int_desk_configuration_has_tags','Configurations','ZohoAccount','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','VoicePrefixes','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToAgent','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','Queues','voice_queues_has_cm_lists','UserProfileSection','UserProfileSections','sectionId','WhatsappAccount','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','username','password','options','database','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','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','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','VoiceMail','UserId','hasOne','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','UserNotifications','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','SmsInteraction','SmsInteractions'];(function(_0x260720,_0x44220b){var _0x21a52b=function(_0x1ab506){while(--_0x1ab506){_0x260720['push'](_0x260720['shift']());}};_0x21a52b(++_0x44220b);}(_0x6ede,0xd6));var _0xe6ed=function(_0x432169,_0x7ffbe9){_0x432169=_0x432169-0x0;var _0x28e745=_0x6ede[_0x432169];return _0x28e745;};'use strict';var config=require(_0xe6ed('0x0'));var Sequelize=require(_0xe6ed('0x1'));var _=require(_0xe6ed('0x2'));var jstz=require(_0xe6ed('0x3'));var timezone=jstz[_0xe6ed('0x4')]();config[_0xe6ed('0x1')]=_[_0xe6ed('0x5')](config[_0xe6ed('0x1')],{'database':_0xe6ed('0x6'),'username':'xcall','password':_0xe6ed('0x7'),'options':{'host':_0xe6ed('0x8'),'port':0xcea,'dialect':_0xe6ed('0x9'),'dialectOptions':{'charset':_0xe6ed('0xa')},'logging':![],'timezone':timezone[_0xe6ed('0xb')](),'define':{'charset':_0xe6ed('0xc'),'collate':_0xe6ed('0xd')}}});config[_0xe6ed('0xe')]=_[_0xe6ed('0x5')](config[_0xe6ed('0xe')],{'database':_0xe6ed('0x6'),'username':'xcall','password':_0xe6ed('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xe6ed('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xe6ed('0xb')](),'define':{'charset':_0xe6ed('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe6ed('0x1')]['database'],config['sequelize'][_0xe6ed('0xf')],config[_0xe6ed('0x1')][_0xe6ed('0x10')],config[_0xe6ed('0x1')][_0xe6ed('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe6ed('0xe')][_0xe6ed('0x12')],config[_0xe6ed('0xe')][_0xe6ed('0xf')],config['sequelizeHistory'][_0xe6ed('0x10')],config[_0xe6ed('0xe')]['options'])};db['User']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x13'));db[_0xe6ed('0x14')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x16'));db[_0xe6ed('0x17')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x18'));db[_0xe6ed('0x19')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x1a'));db[_0xe6ed('0x1b')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x1c'));db[_0xe6ed('0x1d')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x1e'));db[_0xe6ed('0x1f')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x20'));db['VoiceMail']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x21'));db[_0xe6ed('0x22')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x23'));db[_0xe6ed('0x24')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x25'));db[_0xe6ed('0x26')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x27'));db['VoiceAgentReport']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x28'));db['VoiceQueueReport']=db['sequelize'][_0xe6ed('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xe6ed('0x29')]=db['sequelize']['import'](_0xe6ed('0x2a'));db[_0xe6ed('0x2b')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db['sequelize']['import'](_0xe6ed('0x2c'));db['UserVoiceQueueRt']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x2d'));db[_0xe6ed('0x2e')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x2f'));db['UserChatQueue']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x30'));db[_0xe6ed('0x31')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x32'));db['UserFaxQueue']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x33'));db[_0xe6ed('0x34')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x35'));db[_0xe6ed('0x36')]=db[_0xe6ed('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xe6ed('0x37')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xe6ed('0x38')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x39'));db[_0xe6ed('0x3a')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x3b'));db[_0xe6ed('0x3c')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x3d'));db['MailQueue']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/mailQueue/mailQueue.model');db[_0xe6ed('0x3e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x3f'));db[_0xe6ed('0x40')]=db['sequelize'][_0xe6ed('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0xe6ed('0x41')]=db['sequelize']['import']('../api/mailMessage/mailMessage.model');db[_0xe6ed('0x42')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x43'));db[_0xe6ed('0x44')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x45'));db['Dashboard']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x46'));db[_0xe6ed('0x47')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x48'));db[_0xe6ed('0x49')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x4a'));db[_0xe6ed('0x4b')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x4c'));db[_0xe6ed('0x4d')]=db[_0xe6ed('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0xe6ed('0x4e')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x4f'));db[_0xe6ed('0x50')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x51'));db['FaxQueueReport']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x52'));db[_0xe6ed('0x53')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x54'));db['SmsApplication']=db['sequelize']['import'](_0xe6ed('0x55'));db['SmsInteraction']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x56'));db['SmsMessage']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x57'));db[_0xe6ed('0x58')]=db['sequelize'][_0xe6ed('0x15')]('../api/smsQueue/smsQueue.model');db[_0xe6ed('0x59')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5a'));db[_0xe6ed('0x5b')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5c'));db['OpenchannelInteraction']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5d'));db[_0xe6ed('0x5e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5f'));db['OpenchannelQueue']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x60'));db[_0xe6ed('0x61')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0xe6ed('0x62')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x63'));db[_0xe6ed('0x64')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x65'));db['ChatInteraction']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x66'));db[_0xe6ed('0x67')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x68'));db['ChatOfflineMessage']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x69'));db[_0xe6ed('0x6a')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x6b'));db[_0xe6ed('0x6c')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/chatGroup/chatGroup.model');db[_0xe6ed('0x6d')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x6e'));db[_0xe6ed('0x6f')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x70'));db[_0xe6ed('0x71')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x72'));db[_0xe6ed('0x73')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x74'));db[_0xe6ed('0x75')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xe6ed('0x76')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x77'));db[_0xe6ed('0x78')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xe6ed('0x79')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x7a'));db[_0xe6ed('0x7b')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x7c'));db['Action']=db['sequelize']['import'](_0xe6ed('0x7d'));db[_0xe6ed('0x7e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x7f'));db[_0xe6ed('0x80')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x81'));db[_0xe6ed('0x82')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/disposition/disposition.model');db['Condition']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x83'));db[_0xe6ed('0x84')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x85'));db['Pause']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x86'));db[_0xe6ed('0x87')]=db['sequelize']['import'](_0xe6ed('0x88'));db[_0xe6ed('0x89')]=db['sequelize']['import'](_0xe6ed('0x8a'));db[_0xe6ed('0x8b')]=db[_0xe6ed('0x1')]['import']('../api/schedule/schedule.model');db[_0xe6ed('0x8c')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/sound/sound.model');db['Tag']=db[_0xe6ed('0x1')]['import']('../api/tag/tag.model');db[_0xe6ed('0x8d')]=db['sequelize'][_0xe6ed('0x15')]('../api/contactItemType/contactItemType.model');db[_0xe6ed('0x8e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x8f'));db[_0xe6ed('0x90')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x91'));db[_0xe6ed('0x92')]=db['sequelize'][_0xe6ed('0x15')]('../api/template/template.model');db['Trigger']=db['sequelize']['import'](_0xe6ed('0x93'));db['Variable']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x94'));db['Integration']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x95'));db[_0xe6ed('0x96')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/integrationReport/integrationReport.model');db[_0xe6ed('0x97')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x98'));db[_0xe6ed('0x99')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x9a'));db[_0xe6ed('0x9b')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x9c'));db[_0xe6ed('0x9d')]=db['sequelize']['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xe6ed('0x9e')]=db['sequelize']['import'](_0xe6ed('0x9f'));db[_0xe6ed('0xa0')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xa1'));db[_0xe6ed('0xa2')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xa3'));db[_0xe6ed('0xa4')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xe6ed('0xa5')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xa6'));db[_0xe6ed('0xa7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xa8'));db[_0xe6ed('0xa9')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xaa'));db['DeskAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/intDeskAccount/intDeskAccount.model');db[_0xe6ed('0xab')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xe6ed('0xac')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xad'));db['ZohoAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xae'));db[_0xe6ed('0xaf')]=db['sequelize'][_0xe6ed('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xe6ed('0xb0')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xb1'));db[_0xe6ed('0xb2')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xb3'));db['ZendeskConfiguration']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xb4'));db['ZendeskField']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xb5'));db[_0xe6ed('0xb6')]=db['sequelize'][_0xe6ed('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xe6ed('0xb7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xb8'));db['FreshdeskField']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xb9'));db['VtigerAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xba'));db[_0xe6ed('0xbb')]=db['sequelize'][_0xe6ed('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xe6ed('0xbc')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xbd'));db[_0xe6ed('0xbe')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xbf'));db[_0xe6ed('0xc0')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xc1'));db[_0xe6ed('0xc2')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xc3'));db[_0xe6ed('0xc4')]=db[_0xe6ed('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize'][_0xe6ed('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xe6ed('0xc5')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xc6'));db[_0xe6ed('0xc7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xc8'));db[_0xe6ed('0xc9')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xca'));db[_0xe6ed('0xcb')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xcc'));db['Integration']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x95'));db[_0xe6ed('0xcd')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xce'));db[_0xe6ed('0xcf')]=db['sequelize']['import'](_0xe6ed('0xd0'));db['ChatInternalMessage']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xd1'));db[_0xe6ed('0xd2')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xd3'));db[_0xe6ed('0xd4')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xd5'));db[_0xe6ed('0xd6')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xe6ed('0xd7')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xd8'));db['SquareReport']=db['sequelize']['import'](_0xe6ed('0xd9'));db[_0xe6ed('0xda')]=db['sequelize'][_0xe6ed('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xe6ed('0xdb')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/jscriptyProject/jscriptyProject.model');db[_0xe6ed('0xdc')]=db['sequelize']['import'](_0xe6ed('0xdd'));db[_0xe6ed('0xde')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xdf'));db['SquareRecording']=db['sequelize'][_0xe6ed('0x15')]('../api/squareRecording/squareRecording.model');db[_0xe6ed('0xe0')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe1'));db['Team']=db['sequelize'][_0xe6ed('0x15')]('../api/team/team.model');db[_0xe6ed('0xe2')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe3'));db[_0xe6ed('0xe4')]=db['sequelize'][_0xe6ed('0x15')]('../api/campaign/campaign.model');db[_0xe6ed('0xe5')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe6'));db[_0xe6ed('0xe7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe8'));db['Plugin']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/plugin/plugin.model');db[_0xe6ed('0xe9')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xea'));db[_0xe6ed('0xeb')]=db['sequelize']['import'](_0xe6ed('0xec'));db[_0xe6ed('0xed')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0xe6ed('0xee')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xef'));db[_0xe6ed('0xf0')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf1'));db[_0xe6ed('0xf2')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xf3'));db[_0xe6ed('0xf4')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf5'));db[_0xe6ed('0xf6')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf7'));db['UserProfileSection']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0xe6ed('0xf8')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0xe6ed('0x1')]['import']('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf9'));db['WhatsappInteraction']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xfa'));db[_0xe6ed('0xfb')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xfc'));db['WhatsappQueueReport']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xe6ed('0xfd')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xfe'));db[_0xe6ed('0xff')]=db['sequelize']['import'](_0xe6ed('0x100'));db['CloudProvider']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0xe6ed('0x101')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x102'));db[_0xe6ed('0x103')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x104'));db['UserVoicePrefix']=db['sequelize']['import'](_0xe6ed('0x105'));db[_0xe6ed('0x106')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x107'));db[_0xe6ed('0x108')]['hasOne'](db[_0xe6ed('0x109')],{'as':_0xe6ed('0x109'),'onDelete':'cascade','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10b')](db[_0xe6ed('0x106')],{'as':'userSetting','onDelete':'cascade','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x1d')],{'as':'Recordings','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x10d')],{'as':_0xe6ed('0x10e'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')]['hasMany'](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x10f'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db['User'][_0xe6ed('0x10c')](db[_0xe6ed('0x76')],{'as':_0xe6ed('0x111'),'foreignKey':'UserId'});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x112'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x79')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db['OpenchannelInteraction'],{'as':_0xe6ed('0x113'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x114')],{'as':_0xe6ed('0x115'),'foreignKey':'UserId'});db['User'][_0xe6ed('0x10c')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xe6ed('0x108')]['hasMany'](db['FaxInteraction'],{'as':_0xe6ed('0x116'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x117'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x118')],{'as':_0xe6ed('0x119'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x11a')],{'as':_0xe6ed('0x11b'),'foreignKey':'SenderId'});db[_0xe6ed('0x108')][_0xe6ed('0x11c')](db[_0xe6ed('0xf6')],{'as':_0xe6ed('0xf6'),'foreignKey':_0xe6ed('0x11d')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x6c')],{'as':'Groups','through':_0xe6ed('0x11f')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x71')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xe6ed('0x108')]['belongsToMany'](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x120'),'through':'cm_user_has_lists'});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x122')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x117'),'through':_0xe6ed('0x123')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['ChatInteraction'],{'as':_0xe6ed('0x115'),'through':'user_has_chat_interactions'});db['User'][_0xe6ed('0x11e')](db['FaxInteraction'],{'as':_0xe6ed('0x116'),'through':_0xe6ed('0x124')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x125')],{'as':_0xe6ed('0x126'),'through':_0xe6ed('0x127')});db[_0xe6ed('0x108')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0xe6ed('0x113'),'through':_0xe6ed('0x128')});db['User'][_0xe6ed('0x11e')](db[_0xe6ed('0x118')],{'as':_0xe6ed('0x119'),'through':_0xe6ed('0x129')});db[_0xe6ed('0x108')]['belongsToMany'](db['VoiceQueue'],{'as':_0xe6ed('0x12a'),'through':_0xe6ed('0x2e'),'required':![]});db[_0xe6ed('0x108')]['belongsToMany'](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xe6ed('0x12b'),'required':![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['MailQueue'],{'as':_0xe6ed('0x12c'),'through':'UserMailQueue','required':![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['ChatQueue'],{'as':_0xe6ed('0x12d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x50')],{'as':_0xe6ed('0x12e'),'through':_0xe6ed('0x12f'),'required':![]});db[_0xe6ed('0x108')]['belongsToMany'](db[_0xe6ed('0x58')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db['User'][_0xe6ed('0x11e')](db[_0xe6ed('0x130')],{'as':_0xe6ed('0x131'),'through':_0xe6ed('0x36'),'required':![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0xff')],{'as':_0xe6ed('0x132'),'through':_0xe6ed('0x37'),'required':![]});db['User'][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'through':_0xe6ed('0x133')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['ChatWebsite'],{'as':_0xe6ed('0x134'),'through':_0xe6ed('0x135')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x49')],{'as':_0xe6ed('0x136'),'through':_0xe6ed('0x137')});db['User']['belongsToMany'](db[_0xe6ed('0x3c')],{'as':_0xe6ed('0x138'),'through':_0xe6ed('0x139')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x59')],{'as':_0xe6ed('0x13a'),'through':_0xe6ed('0x13b')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['SmsAccount'],{'as':_0xe6ed('0x13c'),'through':'user_has_sms_accounts'});db[_0xe6ed('0x108')]['belongsToMany'](db['WhatsappAccount'],{'as':_0xe6ed('0x13d'),'through':_0xe6ed('0x13e')});db[_0xe6ed('0x14')]['hasMany'](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x13f'),'onDelete':'cascade','foreignKey':_0xe6ed('0x140')});db['VoiceContext']['hasMany'](db[_0xe6ed('0x19')],{'onDelete':'cascade'});db[_0xe6ed('0x19')][_0xe6ed('0x10c')](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x141'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x142')]['belongsToMany'](db[_0xe6ed('0x8c')],{'as':_0xe6ed('0x143'),'through':_0xe6ed('0x144')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db[_0xe6ed('0x10d')],{'as':_0xe6ed('0x145'),'foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db['CmHopper'],{'as':_0xe6ed('0x147'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xe6ed('0x10c')](db['CmHopperFinal'],{'as':_0xe6ed('0x111'),'foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')]['hasMany'](db[_0xe6ed('0x75')],{'as':_0xe6ed('0x148'),'foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db[_0xe6ed('0xd6')],{'as':_0xe6ed('0x149'),'foreignKey':_0xe6ed('0x146')});db['VoiceQueue'][_0xe6ed('0x11c')](db['Trunk'],{'as':'Trunk','foreignKey':_0xe6ed('0x14a')});db[_0xe6ed('0x1b')][_0xe6ed('0x11c')](db['Trunk'],{'as':_0xe6ed('0x14b'),'foreignKey':'TrunkBackupId'});db[_0xe6ed('0x1b')][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'as':'Interval','foreignKey':_0xe6ed('0x14c')});db['VoiceQueue'][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':'mandatoryDispositionPause','foreignKey':_0xe6ed('0x14e')});db[_0xe6ed('0x1b')][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x120'),'through':'voice_queues_has_cm_lists'});db[_0xe6ed('0x1b')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x2e')});db[_0xe6ed('0x1b')]['belongsToMany'](db[_0xe6ed('0x121')],{'as':_0xe6ed('0x14f'),'through':'TeamVoiceQueue'});db[_0xe6ed('0x1b')][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x150'),'through':_0xe6ed('0x151')});db[_0xe6ed('0x1d')]['belongsTo'](db['User'],{'as':'User','foreignKey':'UserId'});db[_0xe6ed('0x1f')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x108'),'foreignKey':'UserId'});db['VoiceMail'][_0xe6ed('0x10c')](db[_0xe6ed('0x22')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':'mailboxuser','sourceKey':_0xe6ed('0x153')});db['VoiceMailMessage'][_0xe6ed('0x11c')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xe6ed('0x153')});db[_0xe6ed('0x24')][_0xe6ed('0x10c')](db[_0xe6ed('0x154')],{'as':'QueueCalls','foreignKey':_0xe6ed('0x155'),'constraints':![]});db[_0xe6ed('0x24')][_0xe6ed('0x10c')](db[_0xe6ed('0x156')],{'as':'AgentReports','foreignKey':_0xe6ed('0x155'),'constraints':![]});db[_0xe6ed('0x24')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x108'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x24')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db['MailServerIn'][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{'as':_0xe6ed('0x3c'),'foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x38')][_0xe6ed('0x11c')](db[_0xe6ed('0x15a')],{'as':'CloudProvider','foreignKey':_0xe6ed('0x15b'),'onDelete':'restrict'});db['MailServerOut'][_0xe6ed('0x11c')](db['MailAccount'],{'as':_0xe6ed('0x3c'),'foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x3a')][_0xe6ed('0x11c')](db[_0xe6ed('0x15a')],{'as':_0xe6ed('0x15a'),'foreignKey':_0xe6ed('0x15b'),'onDelete':_0xe6ed('0x15c')});db['MailAccount']['hasOne'](db[_0xe6ed('0x38')],{'as':_0xe6ed('0x15d'),'onDelete':'cascade'});db[_0xe6ed('0x3c')][_0xe6ed('0x10b')](db[_0xe6ed('0x3a')],{'as':_0xe6ed('0x15e'),'onDelete':'cascade'});db[_0xe6ed('0x3c')][_0xe6ed('0x10c')](db['Disposition'],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x159'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x3c')][_0xe6ed('0x10c')](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':_0xe6ed('0x159')});db['MailAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x41')],{'as':_0xe6ed('0x152'),'foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x3c')]['hasMany'](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x3c')]['hasMany'](db[_0xe6ed('0x42')],{'as':_0xe6ed('0x141')});db['MailAccount'][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db['MailAccount'][_0xe6ed('0x11c')](db[_0xe6ed('0x92')],{'as':'Template','foreignKey':_0xe6ed('0x164')});db['MailAccount'][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':_0xe6ed('0x165'),'foreignKey':_0xe6ed('0x14e')});db[_0xe6ed('0x3c')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x139')});db['MailQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':'UserMailQueue'});db[_0xe6ed('0x167')][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x168'),'as':_0xe6ed('0x14f')});db[_0xe6ed('0x40')][_0xe6ed('0x10c')](db[_0xe6ed('0x41')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x169')});db[_0xe6ed('0x40')][_0xe6ed('0x11c')](db['MailAccount'],{'as':'Account','foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x40')][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x40')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db['MailInteraction'][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x16c'),'as':_0xe6ed('0x16d')});db[_0xe6ed('0x40')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x16c'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x40')][_0xe6ed('0x11e')](db['User'],{'as':'Users','through':_0xe6ed('0x123'),'foreignKey':_0xe6ed('0x169')});db[_0xe6ed('0x41')][_0xe6ed('0x10c')](db[_0xe6ed('0xe7')],{'as':_0xe6ed('0x16f'),'onDelete':'cascade'});db[_0xe6ed('0x41')][_0xe6ed('0x11c')](db['User'],{'as':_0xe6ed('0x108')});db[_0xe6ed('0x41')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157')});db['MailMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x169')});db['MailMessage'][_0xe6ed('0x11c')](db['MailAccount'],{'as':'Account','foreignKey':_0xe6ed('0x159')});db['MailMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':_0xe6ed('0x61'),'foreignKey':'ChatWebsiteId'});db[_0xe6ed('0x41')][_0xe6ed('0x11c')](db[_0xe6ed('0x171')],{'as':'ChatOfflineMessage','foreignKey':_0xe6ed('0x172')});db[_0xe6ed('0x42')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x15c')});db['MailApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x167')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x42')][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{'onDelete':_0xe6ed('0x15c')});db['MailApplication']['belongsTo'](db[_0xe6ed('0x84')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x42')][_0xe6ed('0x11c')](db['Tag'],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db['MailQueueReport'][_0xe6ed('0x11c')](db['MailAccount'],{});db[_0xe6ed('0x44')][_0xe6ed('0x11c')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['MailQueueReport'][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db['MailQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x40')],{});db['MailQueueReport']['belongsTo'](db[_0xe6ed('0x41')],{});db['MailQueueReport']['belongsTo'](db[_0xe6ed('0x108')],{});db[_0xe6ed('0x44')]['belongsTo'](db['MailQueue'],{});db[_0xe6ed('0x174')][_0xe6ed('0x10c')](db['DashboardItem'],{'as':_0xe6ed('0x175'),'onDelete':_0xe6ed('0x110')});db['FaxAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x176'),'onDelete':_0xe6ed('0x110')});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xe6ed('0x176')});db[_0xe6ed('0x49')]['hasMany'](db[_0xe6ed('0x4d')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x49')][_0xe6ed('0x10c')](db[_0xe6ed('0x4b')],{'as':_0xe6ed('0x141')});db['FaxAccount']['hasMany'](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x177'),'onDelete':'cascade'});db[_0xe6ed('0x49')][_0xe6ed('0x10c')](db[_0xe6ed('0x4e')],{'as':_0xe6ed('0x152')});db[_0xe6ed('0x49')]['belongsTo'](db['Trunk'],{'as':_0xe6ed('0x2b')});db[_0xe6ed('0x49')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x49')]['belongsTo'](db['Pause'],{'as':_0xe6ed('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe6ed('0x49')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x137')});db['FaxApplication']['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0xe6ed('0x50')],{'onDelete':'restrict'});db[_0xe6ed('0x4b')][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x4b')]['belongsTo'](db[_0xe6ed('0x16b')],{'onDelete':'restrict','foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x4d')]['hasMany'](db['FaxMessage'],{'as':'Messages','onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x178')});db[_0xe6ed('0x4d')][_0xe6ed('0x11c')](db['FaxAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x176')});db[_0xe6ed('0x4d')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x4d')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x4d')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x17a'),'as':'Tags'});db[_0xe6ed('0x4d')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x17a'),'as':'ThroughTags'});db[_0xe6ed('0x4d')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':_0xe6ed('0x124'),'foreignKey':_0xe6ed('0x178')});db['FaxMessage'][_0xe6ed('0x11c')](db['User'],{'onDelete':'cascade','as':_0xe6ed('0x108')});db[_0xe6ed('0x4e')][_0xe6ed('0x11c')](db[_0xe6ed('0x4d')],{'as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x178')});db[_0xe6ed('0x4e')]['belongsTo'](db['CmContact'],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157')});db[_0xe6ed('0x4e')][_0xe6ed('0x11c')](db[_0xe6ed('0xe7')],{'as':'Attachment','foreignKey':_0xe6ed('0x17c')});db[_0xe6ed('0x4e')][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{'as':_0xe6ed('0x179'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x12f')});db[_0xe6ed('0x50')][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x17d'),'as':'Teams'});db['FaxQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['CmList'],{'as':'List','foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':'Contact','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['FaxInteraction'],{});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['FaxMessage'],{});db[_0xe6ed('0x17e')]['belongsTo'](db['User'],{});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['FaxQueue'],{});db[_0xe6ed('0x53')]['hasMany'](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x17f'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x53')][_0xe6ed('0x10c')](db[_0xe6ed('0x80')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x180')],{'as':'Messages','foreignKey':_0xe6ed('0x17f')});db[_0xe6ed('0x53')][_0xe6ed('0x10c')](db[_0xe6ed('0x125')],{'as':'Interactions'});db[_0xe6ed('0x53')][_0xe6ed('0x10c')](db['SmsApplication'],{'as':_0xe6ed('0x141')});db[_0xe6ed('0x53')][_0xe6ed('0x11c')](db['CmList'],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db['SmsAccount']['belongsTo'](db['Pause'],{'as':_0xe6ed('0x165'),'foreignKey':_0xe6ed('0x14e')});db['SmsAccount'][_0xe6ed('0x11e')](db['User'],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x181')});db['SmsApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x182')][_0xe6ed('0x11c')](db[_0xe6ed('0x58')],{'onDelete':_0xe6ed('0x15c')});db['SmsApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'onDelete':'restrict'});db[_0xe6ed('0x182')][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'onDelete':'restrict','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x182')][_0xe6ed('0x11c')](db['Tag'],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x125')][_0xe6ed('0x10c')](db[_0xe6ed('0x180')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':'SmsInteractionId'});db[_0xe6ed('0x125')]['belongsTo'](db['SmsAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x17f')});db['SmsInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x125')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':'Owner','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x125')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x183'),'as':'Tags'});db[_0xe6ed('0x125')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x183'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x125')][_0xe6ed('0x11e')](db['User'],{'as':'Users','through':_0xe6ed('0x127'),'foreignKey':_0xe6ed('0x184')});db['SmsMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':'User'});db[_0xe6ed('0x180')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157')});db['SmsMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x125')],{'onDelete':'cascade','as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x184')});db[_0xe6ed('0x180')][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'as':'Account','foreignKey':_0xe6ed('0x17f')});db['SmsQueue']['belongsToMany'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x34'),'foreignKey':_0xe6ed('0x185')});db['SmsQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':'team_has_sms_queues','as':_0xe6ed('0x14f')});db['OpenchannelAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x186'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x59')]['hasMany'](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':_0xe6ed('0x186')});db['OpenchannelAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x187')],{'as':'Interactions','foreignKey':_0xe6ed('0x186')});db[_0xe6ed('0x59')][_0xe6ed('0x10c')](db['OpenchannelMessage'],{'as':_0xe6ed('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0xe6ed('0x59')][_0xe6ed('0x10c')](db[_0xe6ed('0x5b')],{'as':_0xe6ed('0x141'),'foreignKey':_0xe6ed('0x186')});db[_0xe6ed('0x59')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x59')][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':_0xe6ed('0x165'),'foreignKey':_0xe6ed('0x14e')});db[_0xe6ed('0x59')]['belongsToMany'](db['User'],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x13b')});db[_0xe6ed('0x5b')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x5b')]['belongsTo'](db[_0xe6ed('0x130')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x188')});db['OpenchannelApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x186')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x5b')][_0xe6ed('0x11c')](db[_0xe6ed('0x16b')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x187')]['hasMany'](db[_0xe6ed('0x5e')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x189')});db[_0xe6ed('0x187')][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{'as':_0xe6ed('0x179'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x187')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x187')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':'openchannel_interaction_has_tags','as':_0xe6ed('0x16d')});db[_0xe6ed('0x187')]['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xe6ed('0x187')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0xe6ed('0x5e')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x108')});db[_0xe6ed('0x5e')][_0xe6ed('0x11c')](db['CmContact'],{'onDelete':_0xe6ed('0x110'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0xe6ed('0x187')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x189')});db[_0xe6ed('0x5e')]['belongsTo'](db[_0xe6ed('0xe7')],{'as':_0xe6ed('0xe7'),'foreignKey':_0xe6ed('0x17c')});db[_0xe6ed('0x5e')]['belongsTo'](db[_0xe6ed('0x59')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x186')});db['OpenchannelQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x36'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xe6ed('0x11e')](db['Team'],{'through':_0xe6ed('0x18a'),'as':_0xe6ed('0x14f')});db['ChatWebsite'][_0xe6ed('0x10c')](db['Disposition'],{'as':_0xe6ed('0x15f'),'foreignKey':'ChatWebsiteId','onDelete':_0xe6ed('0x110')});db['ChatWebsite']['hasMany'](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':'ChatWebsiteId'});db[_0xe6ed('0x61')][_0xe6ed('0x10c')](db['ChatProactiveAction'],{'as':_0xe6ed('0x18b')});db['ChatWebsite'][_0xe6ed('0x10c')](db[_0xe6ed('0x114')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x61')][_0xe6ed('0x10c')](db[_0xe6ed('0x64')],{'as':_0xe6ed('0x141')});db[_0xe6ed('0x61')][_0xe6ed('0x10c')](db['ChatMessage'],{'as':'Messages'});db['ChatWebsite']['belongsTo'](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x61')]['belongsTo'](db[_0xe6ed('0x84')],{'as':'Interval','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x61')][_0xe6ed('0x11c')](db['MailAccount'],{'as':_0xe6ed('0x3c'),'foreignKey':'MailAccountId'});db[_0xe6ed('0x61')][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x135')});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':'List','foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x62')]['belongsTo'](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db['OpenchannelQueueReport'][_0xe6ed('0x11c')](db['OpenchannelInteraction'],{});db[_0xe6ed('0x62')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db['User'],{});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db['OpenchannelQueue'],{});db[_0xe6ed('0x64')]['belongsTo'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x18c'),'foreignKey':_0xe6ed('0x10a'),'onDelete':'restrict'});db['ChatApplication'][_0xe6ed('0x11c')](db['ChatQueue'],{'as':_0xe6ed('0x18d'),'foreignKey':_0xe6ed('0x18e'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x64')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0xe6ed('0x15c')});db['ChatApplication']['belongsTo'](db[_0xe6ed('0x16b')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x114')][_0xe6ed('0x10c')](db[_0xe6ed('0x67')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x18f')});db[_0xe6ed('0x114')]['belongsTo'](db[_0xe6ed('0x61')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xe6ed('0x114')][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x114')][_0xe6ed('0x11c')](db['User'],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x114')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x190'),'as':_0xe6ed('0x16d')});db[_0xe6ed('0x114')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x190'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x114')]['belongsToMany'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':_0xe6ed('0x191'),'foreignKey':_0xe6ed('0x18f')});db[_0xe6ed('0x67')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x110'),'as':'User'});db[_0xe6ed('0x67')]['belongsTo'](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':'Contact','foreignKey':_0xe6ed('0x158')});db['ChatMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x114')],{'onDelete':_0xe6ed('0x110'),'as':'Interaction','foreignKey':_0xe6ed('0x18f')});db[_0xe6ed('0x67')][_0xe6ed('0x11c')](db['Attachment'],{'as':_0xe6ed('0xe7'),'foreignKey':_0xe6ed('0x17c')});db[_0xe6ed('0x67')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x192')});db[_0xe6ed('0x171')][_0xe6ed('0x10c')](db[_0xe6ed('0xe7')],{'as':'Attachments','foreignKey':_0xe6ed('0x172'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x171')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x192')});db[_0xe6ed('0x6a')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x193'),'hooks':!![]});db['ChatQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x194'),'as':'Teams'});db[_0xe6ed('0x6c')]['hasMany'](db[_0xe6ed('0x195')],{'as':'Messages','foreignKey':_0xe6ed('0x196'),'onDelete':'cascade'});db[_0xe6ed('0x6c')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x145'),'through':_0xe6ed('0x11f')});db[_0xe6ed('0x6d')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0xe6ed('0x192')});db[_0xe6ed('0x6f')][_0xe6ed('0x10c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x197'),'foreignKey':'CompanyId'});db[_0xe6ed('0x71')]['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0xe6ed('0x198')});db[_0xe6ed('0x71')]['hasMany'](db[_0xe6ed('0x73')],{'as':'Hoppers','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')]['hasMany'](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x199'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x79')],{'as':'ReportAgentPreview','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db['JscriptySessionReport'],{'as':_0xe6ed('0x149'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x187')],{'as':_0xe6ed('0x113'),'foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')]['hasMany'](db['ChatInteraction'],{'as':_0xe6ed('0x115'),'foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x125')],{'as':_0xe6ed('0x126'),'foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db['CmContact'][_0xe6ed('0x10c')](db['FaxInteraction'],{'as':_0xe6ed('0x116'),'foreignKey':'ContactId','onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x40')],{'as':'MailInteractions','foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')]['belongsTo'](db['CmCompany'],{'as':'Company','foreignKey':_0xe6ed('0x19a')});db[_0xe6ed('0x71')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x71')]['belongsToMany'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':_0xe6ed('0x19b')});db[_0xe6ed('0x71')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'as':_0xe6ed('0x16d'),'through':_0xe6ed('0x19c')});db[_0xe6ed('0x71')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x19c'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x73')][_0xe6ed('0x10c')](db[_0xe6ed('0x90')],{'as':'AdditionalPhones','foreignKey':_0xe6ed('0x19d')});db[_0xe6ed('0x73')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x73')]['belongsTo'](db['CmList'],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163'),'onDelete':'cascade'});db['CmHopper'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x18c'),'foreignKey':_0xe6ed('0x10a')});db['CmHopper'][_0xe6ed('0x11c')](db['VoiceQueue'],{'as':_0xe6ed('0x18d'),'foreignKey':_0xe6ed('0x146'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x73')][_0xe6ed('0x11c')](db[_0xe6ed('0xe4')],{'as':_0xe6ed('0xe4'),'foreignKey':_0xe6ed('0x19e'),'onDelete':'cascade'});db[_0xe6ed('0x73')]['belongsTo'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x19f')});db[_0xe6ed('0x75')]['belongsTo'](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x75')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':'List','foreignKey':'ListId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x75')][_0xe6ed('0x11c')](db[_0xe6ed('0x1b')],{'as':_0xe6ed('0x18d'),'foreignKey':_0xe6ed('0x146'),'onDelete':_0xe6ed('0x110')});db['CmHopperBlack'][_0xe6ed('0x11c')](db[_0xe6ed('0xe4')],{'as':_0xe6ed('0xe4'),'foreignKey':_0xe6ed('0x19e'),'onDelete':'cascade'});db[_0xe6ed('0x7e')][_0xe6ed('0x10c')](db[_0xe6ed('0x1a0')],{'as':{'plural':_0xe6ed('0x1a1'),'singular':_0xe6ed('0x1a2')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xe6ed('0x7e')]['hasMany'](db[_0xe6ed('0x1a0')],{'as':{'plural':'Any','singular':_0xe6ed('0x1a3')},'foreignKey':_0xe6ed('0x1a4'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x7e')]['hasMany'](db[_0xe6ed('0x1a5')],{'as':_0xe6ed('0x1a6'),'foreignKey':'AutomationId','onDelete':_0xe6ed('0x110'),'hooks':!![]});db['Disposition']['hasMany'](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x1a7'),'onDelete':_0xe6ed('0x110')});db['Interval'][_0xe6ed('0x10c')](db[_0xe6ed('0x84')],{'as':'Intervals','foreignKey':_0xe6ed('0x14c'),'onDelete':_0xe6ed('0x110'),'hooks':!![],'required':![]});db['Interval'][_0xe6ed('0x10c')](db[_0xe6ed('0x19')],{'as':'Extensions','foreignKey':_0xe6ed('0x14c'),'onDelete':'restrict'});db['Interval']['hasMany'](db[_0xe6ed('0x42')],{'as':'MailApplications','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x84')][_0xe6ed('0x10c')](db[_0xe6ed('0x64')],{'as':'ChatApplications','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x84')][_0xe6ed('0x10c')](db[_0xe6ed('0x4b')],{'as':'FaxApplications','foreignKey':_0xe6ed('0x14c')});db['Interval'][_0xe6ed('0x10c')](db[_0xe6ed('0x182')],{'as':_0xe6ed('0x1a8'),'foreignKey':'IntervalId'});db['Schedule'][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{});db[_0xe6ed('0x8b')][_0xe6ed('0x11c')](db[_0xe6ed('0x1a9')],{'foreignKey':_0xe6ed('0x1aa')});db[_0xe6ed('0x8b')][_0xe6ed('0x11c')](db['AnalyticCustomReport'],{'foreignKey':_0xe6ed('0x1ab')});db[_0xe6ed('0x8c')]['belongsToMany'](db[_0xe6ed('0x142')],{'as':_0xe6ed('0x1ac'),'through':_0xe6ed('0x144'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db['CmContact'],{'through':_0xe6ed('0x19c')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db['ChatInteraction'],{'through':_0xe6ed('0x190')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db[_0xe6ed('0x40')],{'through':'mail_interaction_has_tags'});db[_0xe6ed('0x16b')]['belongsToMany'](db[_0xe6ed('0x125')],{'through':_0xe6ed('0x183')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db['FaxInteraction'],{'through':_0xe6ed('0x17a')});db['Tag'][_0xe6ed('0x11e')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xe6ed('0x16b')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xe6ed('0x1ad')});db['CmContactHasItem'][_0xe6ed('0x11c')](db[_0xe6ed('0x8d')],{'as':_0xe6ed('0x1ae'),'foreignKey':_0xe6ed('0x1af')});db[_0xe6ed('0x90')][_0xe6ed('0x11c')](db[_0xe6ed('0x73')],{'as':_0xe6ed('0x1b0'),'foreignKey':_0xe6ed('0x19d')});db[_0xe6ed('0x8e')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x198')});db['Trigger']['hasMany'](db[_0xe6ed('0x1a0')],{'as':{'plural':_0xe6ed('0x1b1'),'singular':'AllCondition'},'foreignKey':_0xe6ed('0x1b2'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x1b3')][_0xe6ed('0x10c')](db['Condition'],{'as':{'plural':_0xe6ed('0x1b4'),'singular':'AnyCondition'},'foreignKey':_0xe6ed('0x1b5'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x1b3')][_0xe6ed('0x10c')](db[_0xe6ed('0x1a5')],{'as':_0xe6ed('0x1a6'),'foreignKey':_0xe6ed('0x1b6'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x97')][_0xe6ed('0x10c')](db[_0xe6ed('0x9d')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xe6ed('0x1a9')][_0xe6ed('0x10c')](db[_0xe6ed('0x9d')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1aa')});db[_0xe6ed('0x9b')][_0xe6ed('0x10c')](db['AnalyticFieldReport'],{'as':_0xe6ed('0x1b7'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1b8')});db[_0xe6ed('0x9d')]['belongsTo'](db[_0xe6ed('0x9b')],{'foreignKey':'MetricId'});db[_0xe6ed('0xa0')]['hasMany'](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xa2')][_0xe6ed('0x10c')](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xa2')][_0xe6ed('0x10c')](db[_0xe6ed('0xa4')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xa2')][_0xe6ed('0x10c')](db['SalesforceField'],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xa2')][_0xe6ed('0x11c')](db[_0xe6ed('0xa0')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xa4')][_0xe6ed('0x10c')](db['SalesforceField'],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xa4')]['hasMany'](db[_0xe6ed('0xa4')],{'as':_0xe6ed('0x1bf'),'foreignKey':'DescriptionId'});db[_0xe6ed('0xa4')]['hasMany'](db[_0xe6ed('0xa4')],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xa4')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xa5')]['hasMany'](db[_0xe6ed('0xa7')],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':'AccountId'});db[_0xe6ed('0xa7')]['hasMany'](db[_0xe6ed('0xa9')],{'as':'Subjects','onDelete':_0xe6ed('0x110'),'foreignKey':'SubjectId'});db[_0xe6ed('0xa7')]['hasMany'](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db['SugarcrmConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db['SugarcrmConfiguration'][_0xe6ed('0x11c')](db[_0xe6ed('0xa5')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xa9')][_0xe6ed('0x10c')](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xa9')][_0xe6ed('0x10c')](db['SugarcrmField'],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db['SugarcrmField']['hasMany'](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1c0'),'foreignKey':'FieldId'});db[_0xe6ed('0xa9')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0x1c3')][_0xe6ed('0x10c')](db[_0xe6ed('0xab')],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xab')]['hasMany'](db[_0xe6ed('0xac')],{'as':_0xe6ed('0x1c4'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xab')]['hasMany'](db['DeskField'],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xab')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xe6ed('0x1bd')});db['DeskConfiguration'][_0xe6ed('0x11c')](db[_0xe6ed('0x1c3')],{'as':'Account','foreignKey':_0xe6ed('0x1b9')});db['DeskConfiguration'][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1c5')});db[_0xe6ed('0xac')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xac')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xac')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':'Field','foreignKey':'FieldId'});db[_0xe6ed('0xac')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':'VariableId'});db['ZohoAccount'][_0xe6ed('0x10c')](db['ZohoConfiguration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xaf')][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1c4'),'onDelete':_0xe6ed('0x110'),'foreignKey':'SubjectId'});db[_0xe6ed('0xaf')][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db['ZohoConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db['ZohoConfiguration'][_0xe6ed('0x11c')](db[_0xe6ed('0x1c7')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xb0')][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField'][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xb0')]['hasMany'](db['ZohoField'],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xb0')][_0xe6ed('0x11c')](db['Variable'],{'as':'Variable','foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xb2')][_0xe6ed('0x10c')](db[_0xe6ed('0x1c8')],{'as':_0xe6ed('0x1c6'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0x1c8')][_0xe6ed('0x10c')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0x1c8')][_0xe6ed('0x10c')](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0x1c8')]['hasMany'](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1b7'),'foreignKey':'FieldId'});db[_0xe6ed('0x1c8')][_0xe6ed('0x11c')](db[_0xe6ed('0xb2')],{'as':'Account','foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0x1c8')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1ca')});db[_0xe6ed('0x1c9')][_0xe6ed('0x10c')](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db['ZendeskField'][_0xe6ed('0x10c')](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0x1c9')][_0xe6ed('0x10c')](db['ZendeskField'],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db['ZendeskField'][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xb6')][_0xe6ed('0x10c')](db['FreshdeskConfiguration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xb7')]['hasMany'](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1c4'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1ba')});db['FreshdeskConfiguration']['hasMany'](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db['FreshdeskConfiguration']['belongsTo'](db['FreshdeskAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['FreshdeskConfiguration'][_0xe6ed('0x11e')](db['Tag'],{'through':_0xe6ed('0x1cc')});db[_0xe6ed('0x1cb')]['hasMany'](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0x1cb')][_0xe6ed('0x10c')](db['FreshdeskField'],{'as':_0xe6ed('0x1bf'),'foreignKey':'DescriptionId'});db[_0xe6ed('0x1cb')][_0xe6ed('0x10c')](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1c0'),'foreignKey':'FieldId'});db[_0xe6ed('0x1cb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db['VtigerAccount'][_0xe6ed('0x10c')](db['VtigerConfiguration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xbb')][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1c4'),'foreignKey':_0xe6ed('0x1ba')});db['VtigerConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db['VtigerConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1b7'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xbb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1cd')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['VtigerField'][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1be'),'foreignKey':'SubjectId'});db[_0xe6ed('0xbc')][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xbc')][_0xe6ed('0x10c')](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0xe6ed('0xbc')]['belongsTo'](db['Variable'],{'as':_0xe6ed('0x1c1'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0xc0')],{'as':_0xe6ed('0x1c6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xe6ed('0xc0')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1c4'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc0')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xc0')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':'Fields','foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xc0')]['belongsTo'](db['ServicenowAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['ServicenowField'][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc2')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xc2')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1c0'),'foreignKey':'FieldId'});db[_0xe6ed('0xc2')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':'Variable','foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xc4')][_0xe6ed('0x10c')](db['Dynamics365Configuration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xc4')][_0xe6ed('0x11c')](db[_0xe6ed('0x15a')],{'as':'CloudProvider','foreignKey':_0xe6ed('0x15b')});db[_0xe6ed('0x1ce')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1c4'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1ba')});db['Dynamics365Configuration'][_0xe6ed('0x10c')](db['Dynamics365Field'],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':'DescriptionId'});db[_0xe6ed('0x1ce')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1b7'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0x1ce')][_0xe6ed('0x11c')](db[_0xe6ed('0xc4')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xc5')]['hasMany'](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc5')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1bf'),'foreignKey':'DescriptionId'});db[_0xe6ed('0xc5')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xc5')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':'Variable','foreignKey':'VariableId'});db[_0xe6ed('0xc7')][_0xe6ed('0x10c')](db[_0xe6ed('0xc9')],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':'AccountId'});db[_0xe6ed('0xc9')]['hasMany'](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1c4'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc9')][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xc9')][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1b7'),'foreignKey':'FieldId'});db[_0xe6ed('0xc9')][_0xe6ed('0x11c')](db[_0xe6ed('0xc7')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['FreshsalesField'][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':'Subject','foreignKey':_0xe6ed('0x1ba')});db['FreshsalesField'][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':'Description','foreignKey':'DescriptionId'});db['FreshsalesField'][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xcb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db['CmList'],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x114')],{});db[_0xe6ed('0xcf')]['belongsTo'](db[_0xe6ed('0x67')],{});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x6a')],{});db[_0xe6ed('0x195')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':'cascade','foreignKey':_0xe6ed('0x1cf')});db[_0xe6ed('0x195')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1d0')});db[_0xe6ed('0xd6')][_0xe6ed('0x10c')](db[_0xe6ed('0xd4')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xe6ed('0xd6')][_0xe6ed('0x10c')](db[_0xe6ed('0xd2')],{'foreignKey':_0xe6ed('0x1d1'),'onDelete':_0xe6ed('0x110')});db['SmsQueueReport'][_0xe6ed('0x11c')](db['SmsAccount'],{});db['SmsQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':'ListId'});db[_0xe6ed('0xd7')]['belongsTo'](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x125')],{});db[_0xe6ed('0xd7')][_0xe6ed('0x11c')](db[_0xe6ed('0x180')],{});db[_0xe6ed('0xd7')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{});db['SmsQueueReport']['belongsTo'](db[_0xe6ed('0x58')],{});db[_0xe6ed('0xdb')][_0xe6ed('0x10c')](db[_0xe6ed('0xd6')],{'foreignKey':'ProjectId'});db[_0xe6ed('0xdb')][_0xe6ed('0x10c')](db[_0xe6ed('0xd4')],{'foreignKey':_0xe6ed('0x1d2')});db['JscriptyProject'][_0xe6ed('0x10c')](db[_0xe6ed('0xd2')],{'foreignKey':_0xe6ed('0x1d2')});db['Team'][_0xe6ed('0x11e')](db['User'],{'as':_0xe6ed('0x166'),'through':'user_has_teams'});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db[_0xe6ed('0x1b')],{'through':'TeamVoiceQueue','as':_0xe6ed('0x12a')});db['Team'][_0xe6ed('0x11e')](db[_0xe6ed('0x167')],{'through':_0xe6ed('0x168'),'as':'MailQueues'});db['Team'][_0xe6ed('0x11e')](db[_0xe6ed('0x6a')],{'through':_0xe6ed('0x194'),'as':_0xe6ed('0x12d')});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xe6ed('0x12e')});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db['SmsQueue'],{'through':_0xe6ed('0x1d3'),'as':_0xe6ed('0x1d4')});db['Team'][_0xe6ed('0x11e')](db['OpenchannelQueue'],{'through':_0xe6ed('0x18a'),'as':_0xe6ed('0x131')});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db[_0xe6ed('0xff')],{'through':_0xe6ed('0x1d5'),'as':_0xe6ed('0x132')});db[_0xe6ed('0x121')]['belongsToMany'](db[_0xe6ed('0xf4')],{'through':'TeamVoicePrefix','as':_0xe6ed('0x1d6')});db['Campaign'][_0xe6ed('0x10c')](db[_0xe6ed('0x73')],{'as':_0xe6ed('0x147'),'foreignKey':'CampaignId'});db[_0xe6ed('0xe4')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe6ed('0x19e')});db[_0xe6ed('0xe4')][_0xe6ed('0x10c')](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x199'),'foreignKey':_0xe6ed('0x19e')});db[_0xe6ed('0xe4')]['hasMany'](db[_0xe6ed('0x75')],{'as':_0xe6ed('0x148'),'foreignKey':_0xe6ed('0x19e')});db[_0xe6ed('0xe4')][_0xe6ed('0x11c')](db['Trunk'],{'as':'Trunk','foreignKey':_0xe6ed('0x14a')});db['Campaign'][_0xe6ed('0x11c')](db[_0xe6ed('0x2b')],{'as':_0xe6ed('0x14b'),'foreignKey':'TrunkBackupId'});db[_0xe6ed('0xe4')][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'as':'Interval','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0xe4')][_0xe6ed('0x11c')](db[_0xe6ed('0x1d7')],{'as':_0xe6ed('0x1d7'),'foreignKey':_0xe6ed('0x1d8')});db[_0xe6ed('0xe4')][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'as':'Lists','through':_0xe6ed('0x1d9')});db[_0xe6ed('0xe4')]['belongsToMany'](db[_0xe6ed('0xf2')],{'as':'BlackLists','through':_0xe6ed('0x1da')});db['Attachment'][_0xe6ed('0x11c')](db[_0xe6ed('0x171')],{'as':_0xe6ed('0x171'),'foreignKey':_0xe6ed('0x172')});db['MailTransferReport'][_0xe6ed('0x11c')](db['MailMessage'],{});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db[_0xe6ed('0x40')],{});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1db'),'as':_0xe6ed('0x1dc')});db[_0xe6ed('0xe9')]['belongsTo'](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1dd'),'as':'ToAgent'});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db[_0xe6ed('0x167')],{'foreignKey':_0xe6ed('0x1de'),'as':_0xe6ed('0x1df')});db['MailTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{'foreignKey':_0xe6ed('0x1e0'),'as':_0xe6ed('0x1e1')});db[_0xe6ed('0xeb')]['belongsTo'](db[_0xe6ed('0x67')],{});db[_0xe6ed('0xeb')][_0xe6ed('0x11c')](db[_0xe6ed('0x114')],{});db[_0xe6ed('0xeb')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'foreignKey':_0xe6ed('0x1e2'),'as':_0xe6ed('0x1e3')});db['ChatTransferReport'][_0xe6ed('0x11c')](db['User'],{'foreignKey':_0xe6ed('0x1db'),'as':_0xe6ed('0x1dc')});db[_0xe6ed('0xeb')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0xe6ed('0x1e4')});db[_0xe6ed('0xeb')][_0xe6ed('0x11c')](db[_0xe6ed('0x6a')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db['ChatTransferReport'][_0xe6ed('0x11c')](db['ChatWebsite'],{'foreignKey':_0xe6ed('0x1e5'),'as':_0xe6ed('0x1e1')});db['FaxTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x4e')],{});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db[_0xe6ed('0x4d')],{});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{'foreignKey':_0xe6ed('0x1e6'),'as':_0xe6ed('0x1e3')});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db['User'],{'foreignKey':_0xe6ed('0x1dd'),'as':_0xe6ed('0x1e4')});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db['FaxQueue'],{'foreignKey':_0xe6ed('0x1e7'),'as':_0xe6ed('0x1df')});db[_0xe6ed('0xed')]['belongsTo'](db[_0xe6ed('0x49')],{'foreignKey':_0xe6ed('0x1e8'),'as':_0xe6ed('0x1e1')});db['OpenchannelTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x5e')],{});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db[_0xe6ed('0x187')],{});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{'foreignKey':_0xe6ed('0x1e9'),'as':_0xe6ed('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe6ed('0x108')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1dd'),'as':'ToAgent'});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db['OpenchannelQueue'],{'foreignKey':_0xe6ed('0x1ea'),'as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db[_0xe6ed('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db['SmsMessage'],{});db[_0xe6ed('0xf0')]['belongsTo'](db[_0xe6ed('0x125')],{});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'foreignKey':_0xe6ed('0x1eb'),'as':_0xe6ed('0x1e3')});db['SmsTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1db'),'as':_0xe6ed('0x1dc')});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':'ToUserId','as':_0xe6ed('0x1e4')});db[_0xe6ed('0xf0')]['belongsTo'](db[_0xe6ed('0x58')],{'foreignKey':'ToSmsQueueId','as':_0xe6ed('0x1df')});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'foreignKey':_0xe6ed('0x1ec'),'as':_0xe6ed('0x1e1')});db[_0xe6ed('0xf2')]['hasMany'](db[_0xe6ed('0x82')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0xf2')][_0xe6ed('0x10c')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0xe6ed('0x163')});db['CmList'][_0xe6ed('0x10c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x197'),'onDelete':_0xe6ed('0x110'),'foreignKey':'ListId'});db[_0xe6ed('0xf2')][_0xe6ed('0x10c')](db[_0xe6ed('0x76')],{'as':_0xe6ed('0x111'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xf2')]['hasMany'](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x112'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xf2')][_0xe6ed('0x10c')](db[_0xe6ed('0x79')],{'as':_0xe6ed('0x79'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xf2')][_0xe6ed('0x11e')](db[_0xe6ed('0x1b')],{'as':_0xe6ed('0x1ed'),'through':_0xe6ed('0x1ee')});db[_0xe6ed('0xf2')][_0xe6ed('0x11e')](db['User'],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x133')});db[_0xe6ed('0xf4')][_0xe6ed('0x10c')](db[_0xe6ed('0x19')],{'as':'Extensions','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0xf4')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x12b')});db['VoicePrefix'][_0xe6ed('0x11e')](db['Team'],{'through':_0xe6ed('0x103'),'as':_0xe6ed('0x14f')});db['UserProfile'][_0xe6ed('0x10c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'foreignKey':_0xe6ed('0x11d')});db['UserProfile'][_0xe6ed('0x10c')](db[_0xe6ed('0x1ef')],{'as':_0xe6ed('0x1f0'),'foreignKey':_0xe6ed('0x11d'),'onDelete':'cascade'});db['UserProfileSection'][_0xe6ed('0x10c')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xe6ed('0x1f1'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x1f2')][_0xe6ed('0x10c')](db[_0xe6ed('0x82')],{'as':'Dispositions','foreignKey':_0xe6ed('0x1f3'),'onDelete':_0xe6ed('0x110')});db['WhatsappAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':_0xe6ed('0x1f3')});db[_0xe6ed('0x1f2')][_0xe6ed('0x10c')](db[_0xe6ed('0xfb')],{'as':_0xe6ed('0x152'),'foreignKey':_0xe6ed('0x1f3')});db[_0xe6ed('0x1f2')]['hasMany'](db[_0xe6ed('0x118')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x1f2')]['hasMany'](db['WhatsappApplication'],{'as':_0xe6ed('0x141')});db[_0xe6ed('0x1f2')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':'List','foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x1f2')][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':_0xe6ed('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x13e')});db['WhatsappApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xe6ed('0x11c')](db['WhatsappQueue'],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x1f4')]['belongsTo'](db[_0xe6ed('0x1f2')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'onDelete':'restrict','foreignKey':_0xe6ed('0x14c')});db['WhatsappApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x16b')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':'TagId'});db['WhatsappInteraction'][_0xe6ed('0x10c')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe6ed('0x1f5')});db['WhatsappInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1f3')});db['WhatsappInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x118')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x118')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1ad'),'as':_0xe6ed('0x16d')});db[_0xe6ed('0x118')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1ad'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x118')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':'user_has_whatsapp_interactions','foreignKey':_0xe6ed('0x1f5')});db['WhatsappMessage']['belongsTo'](db[_0xe6ed('0x108')],{'as':'User'});db['WhatsappMessage'][_0xe6ed('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0xe6ed('0x157')});db[_0xe6ed('0xfb')][_0xe6ed('0x11c')](db[_0xe6ed('0x118')],{'onDelete':'cascade','as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x1f5')});db[_0xe6ed('0xfb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'as':'Account','foreignKey':_0xe6ed('0x1f3')});db[_0xe6ed('0x1f6')]['belongsTo'](db[_0xe6ed('0x1f2')],{});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':'ListId'});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0x118')],{});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0xff')],{});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0xfb')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xe6ed('0x108')],{});db[_0xe6ed('0xfd')]['belongsTo'](db[_0xe6ed('0xfb')],{});db[_0xe6ed('0xfd')][_0xe6ed('0x11c')](db[_0xe6ed('0x118')],{});db['WhatsappTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'foreignKey':_0xe6ed('0x1f7'),'as':_0xe6ed('0x1e3')});db['WhatsappTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'foreignKey':_0xe6ed('0x1f8'),'as':_0xe6ed('0x1e1')});db[_0xe6ed('0xfd')]['belongsTo'](db[_0xe6ed('0xff')],{'foreignKey':_0xe6ed('0x1f9'),'as':_0xe6ed('0x1df')});db[_0xe6ed('0xfd')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xe6ed('0x1dc')});db[_0xe6ed('0xfd')]['belongsTo'](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1dd'),'as':_0xe6ed('0x1e4')});db['WhatsappQueue']['belongsToMany'](db['User'],{'as':_0xe6ed('0x166'),'through':'UserWhatsappQueue','foreignKey':_0xe6ed('0x1fa')});db[_0xe6ed('0xff')][_0xe6ed('0x11e')](db['Team'],{'through':_0xe6ed('0x1d5'),'as':_0xe6ed('0x14f')});db[_0xe6ed('0x106')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x1fb'),'foreignKey':_0xe6ed('0x10a'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x15a')][_0xe6ed('0x10b')](db['Dynamics365Account'],{'as':_0xe6ed('0xc4'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x15a')]['hasOne'](db[_0xe6ed('0x38')],{'as':_0xe6ed('0x15d'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x15a')][_0xe6ed('0x10b')](db['MailServerOut'],{'as':_0xe6ed('0x15e'),'onDelete':_0xe6ed('0x15c')});module[_0xe6ed('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x7e08=['../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmHopperAdditionalPhone','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','SquareRecording','SquareMessage','Team','License','Campaign','Migration','../api/migration/migration.model','Attachment','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','cascade','UserId','hasOne','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','UserProfile','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','UserOpenchannelQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','ScreenRecording','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Dispositions','CannedAnswer','Answers','Interactions','MailApplication','ListId','Template','Teams','MailInteractionId','Account','Contact','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','ChatWebsite','ChatWebsiteId','ChatOfflineMessageId','Dashboard','Items','FaxAccountId','Exntensions','List','mandatoryDispositionPause','TagId','FaxInteractionId','ContactId','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','Agent','ChatQueue','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','CmContactHasItem','Phones','CmContactId','JscriptySessions','Company','cm_contact_has_tags','OwnerId','CampaignId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceConfiguration','Subjects','SubjectId','DescriptionId','Subject','Description','Field','FieldId','SugarcrmField','Descriptions','int_desk_configuration_has_tags','VariableId','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','ServicenowAccount','FromId','ToId','JscriptyAnswerReport','ProjectId','user_has_teams','team_has_mail_queues','MailQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','VoicePrefix','userProfileId','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','ToQueueId','Smtp','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','MailQueue','../api/mailQueue/mailQueue.model'];(function(_0x1a593d,_0x2ed6c4){var _0x1f4858=function(_0x1a5701){while(--_0x1a5701){_0x1a593d['push'](_0x1a593d['shift']());}};_0x1f4858(++_0x2ed6c4);}(_0x7e08,0x1bc));var _0x87e0=function(_0xc9361f,_0x367857){_0xc9361f=_0xc9361f-0x0;var _0x5d1c01=_0x7e08[_0xc9361f];return _0x5d1c01;};'use strict';var config=require(_0x87e0('0x0'));var Sequelize=require(_0x87e0('0x1'));var _=require(_0x87e0('0x2'));var jstz=require(_0x87e0('0x3'));var timezone=jstz[_0x87e0('0x4')]();config[_0x87e0('0x1')]=_[_0x87e0('0x5')](config[_0x87e0('0x1')],{'database':_0x87e0('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x87e0('0x7'),'port':0xcea,'dialect':_0x87e0('0x8'),'dialectOptions':{'charset':_0x87e0('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x87e0('0xa'),'collate':_0x87e0('0xb')}}});config['sequelizeHistory']=_[_0x87e0('0x5')](config[_0x87e0('0xc')],{'database':_0x87e0('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x87e0('0x8'),'dialectOptions':{'charset':_0x87e0('0x9')},'logging':![],'timezone':timezone[_0x87e0('0xd')](),'define':{'charset':_0x87e0('0xa'),'collate':_0x87e0('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x87e0('0xe')],config[_0x87e0('0x1')][_0x87e0('0xf')],config[_0x87e0('0x1')][_0x87e0('0x10')],config[_0x87e0('0x1')][_0x87e0('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x87e0('0xc')]['database'],config[_0x87e0('0xc')][_0x87e0('0xf')],config[_0x87e0('0xc')][_0x87e0('0x10')],config['sequelizeHistory'][_0x87e0('0x11')])};db[_0x87e0('0x12')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x14'));db[_0x87e0('0x15')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x16'));db['VoiceContext']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x17'));db[_0x87e0('0x18')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x19'));db[_0x87e0('0x1a')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x1b'));db[_0x87e0('0x1c')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x1d'));db[_0x87e0('0x1e')]=db['sequelize'][_0x87e0('0x13')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x1f'));db[_0x87e0('0x20')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x21'));db[_0x87e0('0x22')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x23'));db[_0x87e0('0x24')]=db['sequelize']['import'](_0x87e0('0x25'));db[_0x87e0('0x26')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x27'));db[_0x87e0('0x28')]=db['sequelize']['import'](_0x87e0('0x29'));db['VoiceQueueReport']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x2a'));db[_0x87e0('0x2b')]=db[_0x87e0('0x1')]['import']('../api/memberReport/memberReport.model');db[_0x87e0('0x2c')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x2d'));db['VoiceTransferReport']=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x87e0('0x2e')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x2f'));db[_0x87e0('0x30')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x31'));db['UserChatQueue']=db[_0x87e0('0x1')]['import'](_0x87e0('0x32'));db['UserMailQueue']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x33'));db[_0x87e0('0x34')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x35'));db[_0x87e0('0x36')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x37'));db['UserOpenchannelQueue']=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x38'));db[_0x87e0('0x39')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x3a'));db[_0x87e0('0x3b')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x3c'));db[_0x87e0('0x3d')]=db[_0x87e0('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x87e0('0x3e')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/mailAccount/mailAccount.model');db[_0x87e0('0x3f')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x40'));db['MailSubstatus']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x41'));db[_0x87e0('0x42')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x43'));db[_0x87e0('0x44')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x45'));db['MailApplication']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x46'));db[_0x87e0('0x47')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x48'));db[_0x87e0('0x49')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x4a'));db[_0x87e0('0x4b')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x4c'));db[_0x87e0('0x4d')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x4e'));db[_0x87e0('0x4f')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x50'));db[_0x87e0('0x51')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x52'));db[_0x87e0('0x53')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x54'));db[_0x87e0('0x55')]=db[_0x87e0('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x87e0('0x56')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x57'));db[_0x87e0('0x58')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x59'));db[_0x87e0('0x5a')]=db['sequelize']['import'](_0x87e0('0x5b'));db['SmsMessage']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x5c'));db[_0x87e0('0x5d')]=db['sequelize'][_0x87e0('0x13')]('../api/smsQueue/smsQueue.model');db[_0x87e0('0x5e')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x87e0('0x5f')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0x87e0('0x60')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x61'));db[_0x87e0('0x62')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x63'));db['OpenchannelQueue']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x64'));db['ChatWebsite']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x65'));db[_0x87e0('0x66')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x67'));db[_0x87e0('0x68')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x69'));db[_0x87e0('0x6a')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x87e0('0x6b')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/chatMessage/chatMessage.model');db[_0x87e0('0x6c')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x6d'));db['ChatQueue']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x6e'));db[_0x87e0('0x6f')]=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db[_0x87e0('0x70')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x71'));db[_0x87e0('0x72')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x73'));db['CmContact']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x74'));db[_0x87e0('0x75')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/cmHopper/cmHopper.model');db[_0x87e0('0x76')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x87e0('0x77')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x78'));db[_0x87e0('0x79')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x7a'));db['ReportAgentPreview']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x7b'));db[_0x87e0('0x7c')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x7d'));db[_0x87e0('0x7e')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x7f'));db[_0x87e0('0x80')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x81'));db['CannedAnswer']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x82'));db[_0x87e0('0x83')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x84'));db[_0x87e0('0x85')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x86'));db['Interval']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x87'));db[_0x87e0('0x88')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x89'));db[_0x87e0('0x8a')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x8b'));db[_0x87e0('0x8c')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x8d'));db[_0x87e0('0x8e')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x8f'));db[_0x87e0('0x90')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x91'));db[_0x87e0('0x92')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x93'));db[_0x87e0('0x94')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x95'));db['CmContactHasItem']=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x87e0('0x96')]=db['sequelize'][_0x87e0('0x13')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db['Template']=db[_0x87e0('0x1')]['import'](_0x87e0('0x97'));db[_0x87e0('0x98')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/trigger/trigger.model');db[_0x87e0('0x99')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x9a'));db[_0x87e0('0x9b')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x9c'));db[_0x87e0('0x9d')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x9e'));db[_0x87e0('0x9f')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xa0'));db['AnalyticDefaultReport']=db[_0x87e0('0x1')]['import'](_0x87e0('0xa1'));db[_0x87e0('0xa2')]=db['sequelize']['import'](_0x87e0('0xa3'));db[_0x87e0('0xa4')]=db[_0x87e0('0x1')]['import'](_0x87e0('0xa5'));db[_0x87e0('0xa6')]=db[_0x87e0('0x1')]['import'](_0x87e0('0xa7'));db['AnalyticTreeReport']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xa8'));db[_0x87e0('0xa9')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xaa'));db['SalesforceConfiguration']=db[_0x87e0('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x87e0('0xab')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xac'));db[_0x87e0('0xad')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xae'));db[_0x87e0('0xaf')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xb0'));db['SugarcrmField']=db[_0x87e0('0x1')]['import'](_0x87e0('0xb1'));db[_0x87e0('0xb2')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/intDeskAccount/intDeskAccount.model');db[_0x87e0('0xb3')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xb4'));db[_0x87e0('0xb5')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/intDeskField/intDeskField.model');db[_0x87e0('0xb6')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x87e0('0xb7')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xb8'));db[_0x87e0('0xb9')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xba'));db['ZendeskConfiguration']=db['sequelize']['import'](_0x87e0('0xbb'));db[_0x87e0('0xbc')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xbd'));db[_0x87e0('0xbe')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xbf'));db[_0x87e0('0xc0')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xc1'));db[_0x87e0('0xc2')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xc3'));db['VtigerConfiguration']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xc4'));db['VtigerField']=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db['sequelize'][_0x87e0('0x13')](_0x87e0('0xc5'));db[_0x87e0('0xc6')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xc7'));db[_0x87e0('0xc8')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xc9'));db[_0x87e0('0xca')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xcb'));db[_0x87e0('0xcc')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xcd'));db[_0x87e0('0xce')]=db[_0x87e0('0x1')]['import'](_0x87e0('0xcf'));db[_0x87e0('0xd0')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x87e0('0xd1')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xd2'));db[_0x87e0('0xd3')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0xd4'));db[_0x87e0('0x9b')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x9c'));db[_0x87e0('0xd5')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/network/network.model');db[_0x87e0('0xd6')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xd7'));db[_0x87e0('0xd8')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db['sequelize'][_0x87e0('0x13')](_0x87e0('0xd9'));db[_0x87e0('0xda')]=db[_0x87e0('0x1')]['import'](_0x87e0('0xdb'));db[_0x87e0('0xdc')]=db[_0x87e0('0x1')]['import'](_0x87e0('0xdd'));db[_0x87e0('0xde')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xdf'));db[_0x87e0('0xe0')]=db[_0x87e0('0x1')]['import'](_0x87e0('0xe1'));db[_0x87e0('0xe2')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/setting/setting.model');db[_0x87e0('0xe3')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x87e0('0xe4')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/squareProject/squareProject.model');db[_0x87e0('0xe5')]=db[_0x87e0('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0x87e0('0xe6')]=db[_0x87e0('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0x87e0('0xe7')]=db[_0x87e0('0x1')]['import']('../api/team/team.model');db[_0x87e0('0xe8')]=db[_0x87e0('0x1')]['import']('../api/license/license.model');db[_0x87e0('0xe9')]=db[_0x87e0('0x1')]['import']('../api/campaign/campaign.model');db[_0x87e0('0xea')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xeb'));db[_0x87e0('0xec')]=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/attachment/attachment.model');db['Plugin']=db['sequelize'][_0x87e0('0x13')](_0x87e0('0xed'));db[_0x87e0('0xee')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0xef'));db['ChatTransferReport']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xf0'));db[_0x87e0('0xf1')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0xf2'));db[_0x87e0('0xf3')]=db[_0x87e0('0x1')]['import'](_0x87e0('0xf4'));db['SmsTransferReport']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xf5'));db[_0x87e0('0xf6')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xf7'));db['VoicePrefix']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xf8'));db['UserProfile']=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0x87e0('0xf9')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xfa'));db[_0x87e0('0xfb')]=db[_0x87e0('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0x87e0('0xfc')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0xfd'));db[_0x87e0('0xfe')]=db[_0x87e0('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x87e0('0xff')]=db['sequelize']['import']('../api/whatsappApplication/whatsappApplication.model');db[_0x87e0('0x100')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x101'));db[_0x87e0('0x102')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x103'));db[_0x87e0('0x104')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x105'));db[_0x87e0('0x106')]=db[_0x87e0('0x1')]['import'](_0x87e0('0x107'));db[_0x87e0('0x108')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x109'));db['CloudProvider']=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x10a'));db[_0x87e0('0x10b')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x10c'));db[_0x87e0('0x10d')]=db['sequelize'][_0x87e0('0x13')](_0x87e0('0x10e'));db['UserVoicePrefix']=db[_0x87e0('0x1')][_0x87e0('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x87e0('0x10f')]=db[_0x87e0('0x1')][_0x87e0('0x13')](_0x87e0('0x110'));db[_0x87e0('0x12')]['hasOne'](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x112')});db['User'][_0x87e0('0x113')](db[_0x87e0('0x10f')],{'as':_0x87e0('0x114'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x112')});db['User'][_0x87e0('0x115')](db[_0x87e0('0x1e')],{'as':_0x87e0('0x116'),'foreignKey':'UserId'});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0x2e')],{'as':_0x87e0('0x117'),'foreignKey':'UserId'});db[_0x87e0('0x12')]['hasMany'](db[_0x87e0('0x18')],{'as':_0x87e0('0x118'),'onDelete':_0x87e0('0x111'),'hooks':!![]});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0x77')],{'as':'HopperFinals','foreignKey':_0x87e0('0x112')});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0x79')],{'as':_0x87e0('0x119'),'foreignKey':'UserId'});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0x11a')],{'as':_0x87e0('0x11a'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x12')]['hasMany'](db[_0x87e0('0x60')],{'as':_0x87e0('0x11b'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0x6a')],{'as':_0x87e0('0x11c'),'foreignKey':_0x87e0('0x112')});db['User'][_0x87e0('0x115')](db[_0x87e0('0x5a')],{'as':_0x87e0('0x11d'),'foreignKey':_0x87e0('0x112')});db['User'][_0x87e0('0x115')](db['FaxInteraction'],{'as':_0x87e0('0x11e'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0x42')],{'as':_0x87e0('0x11f'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0x100')],{'as':_0x87e0('0x120'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x12')][_0x87e0('0x115')](db[_0x87e0('0xfc')],{'as':'UserNotifications','foreignKey':_0x87e0('0x121')});db[_0x87e0('0x12')][_0x87e0('0x122')](db[_0x87e0('0x123')],{'as':_0x87e0('0x123'),'foreignKey':'userProfileId'});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x6f')],{'as':'Groups','through':_0x87e0('0x125')});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x126')],{'as':_0x87e0('0x127'),'through':_0x87e0('0x128')});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x129'),'through':_0x87e0('0x12a')});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0xe7')],{'through':'user_has_teams'});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x42')],{'as':_0x87e0('0x11f'),'through':'user_has_mail_interactions'});db['User']['belongsToMany'](db[_0x87e0('0x6a')],{'as':_0x87e0('0x11c'),'through':_0x87e0('0x12b')});db[_0x87e0('0x12')]['belongsToMany'](db[_0x87e0('0x4f')],{'as':_0x87e0('0x11e'),'through':_0x87e0('0x12c')});db['User'][_0x87e0('0x124')](db[_0x87e0('0x5a')],{'as':_0x87e0('0x11d'),'through':_0x87e0('0x12d')});db[_0x87e0('0x12')][_0x87e0('0x124')](db['OpenchannelInteraction'],{'as':_0x87e0('0x11b'),'through':'user_has_openchannel_interactions'});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x100')],{'as':_0x87e0('0x120'),'through':_0x87e0('0x12e')});db['User'][_0x87e0('0x124')](db[_0x87e0('0x1c')],{'as':_0x87e0('0x12f'),'through':_0x87e0('0x30'),'required':![]});db[_0x87e0('0x12')][_0x87e0('0x124')](db['VoicePrefix'],{'as':_0x87e0('0x130'),'through':_0x87e0('0x131'),'required':![]});db[_0x87e0('0x12')]['belongsToMany'](db[_0x87e0('0x3f')],{'as':'MailQueues','through':_0x87e0('0x132'),'required':![]});db[_0x87e0('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x87e0('0x133'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x87e0('0x53')],{'as':_0x87e0('0x134'),'through':_0x87e0('0x34'),'required':![]});db[_0x87e0('0x12')][_0x87e0('0x124')](db['SmsQueue'],{'as':_0x87e0('0x135'),'through':_0x87e0('0x36'),'required':![]});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x136')],{'as':_0x87e0('0x137'),'through':_0x87e0('0x138'),'required':![]});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x108')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0xf6')],{'through':_0x87e0('0x12a')});db[_0x87e0('0x12')][_0x87e0('0x124')](db['ChatWebsite'],{'as':_0x87e0('0x139'),'through':_0x87e0('0x13a')});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x4b')],{'as':_0x87e0('0x13b'),'through':_0x87e0('0x13c')});db['User'][_0x87e0('0x124')](db[_0x87e0('0x3e')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0x5e')],{'as':_0x87e0('0x13d'),'through':_0x87e0('0x13e')});db['User'][_0x87e0('0x124')](db[_0x87e0('0x56')],{'as':_0x87e0('0x13f'),'through':_0x87e0('0x140')});db[_0x87e0('0x12')][_0x87e0('0x124')](db[_0x87e0('0xfe')],{'as':_0x87e0('0x141'),'through':'user_has_whatsapp_accounts'});db['VoiceChanSpy'][_0x87e0('0x115')](db['VoiceExtension'],{'as':_0x87e0('0x142'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x143')});db[_0x87e0('0x144')][_0x87e0('0x115')](db[_0x87e0('0x18')],{'onDelete':'cascade'});db[_0x87e0('0x18')][_0x87e0('0x115')](db[_0x87e0('0x18')],{'as':_0x87e0('0x145'),'onDelete':'cascade'});db[_0x87e0('0x1a')][_0x87e0('0x124')](db[_0x87e0('0x90')],{'as':_0x87e0('0x146'),'through':'moh_has_sounds'});db[_0x87e0('0x1c')][_0x87e0('0x115')](db[_0x87e0('0x2e')],{'as':_0x87e0('0x147'),'foreignKey':_0x87e0('0x148')});db[_0x87e0('0x1c')]['hasMany'](db['CmHopper'],{'as':_0x87e0('0x149'),'foreignKey':'VoiceQueueId'});db[_0x87e0('0x1c')][_0x87e0('0x115')](db[_0x87e0('0x77')],{'as':_0x87e0('0x14a'),'foreignKey':_0x87e0('0x148')});db[_0x87e0('0x1c')][_0x87e0('0x115')](db[_0x87e0('0x79')],{'as':_0x87e0('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x87e0('0x1c')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x87e0('0x1c')][_0x87e0('0x115')](db[_0x87e0('0x76')],{'as':_0x87e0('0x14c'),'foreignKey':'VoiceQueueId'});db[_0x87e0('0x1c')][_0x87e0('0x115')](db[_0x87e0('0xdc')],{'as':'JscriptySessions','foreignKey':_0x87e0('0x148')});db[_0x87e0('0x1c')][_0x87e0('0x122')](db['Trunk'],{'as':_0x87e0('0x2c'),'foreignKey':_0x87e0('0x14d')});db[_0x87e0('0x1c')][_0x87e0('0x122')](db[_0x87e0('0x2c')],{'as':_0x87e0('0x14e'),'foreignKey':_0x87e0('0x14f')});db[_0x87e0('0x1c')][_0x87e0('0x122')](db['Interval'],{'as':_0x87e0('0x150'),'foreignKey':_0x87e0('0x151')});db[_0x87e0('0x1c')]['belongsTo'](db[_0x87e0('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0x87e0('0x152')});db[_0x87e0('0x1c')][_0x87e0('0x124')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x129'),'through':_0x87e0('0x153')});db[_0x87e0('0x1c')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':_0x87e0('0x30')});db['VoiceQueue'][_0x87e0('0x124')](db['Team'],{'as':'Teams','through':_0x87e0('0x10b')});db[_0x87e0('0x1c')]['belongsToMany'](db[_0x87e0('0xf6')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x12'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x155')][_0x87e0('0x122')](db['User'],{'as':_0x87e0('0x12'),'foreignKey':'UserId'});db[_0x87e0('0x20')]['hasMany'](db['VoiceMailMessage'],{'as':_0x87e0('0x156'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x157'),'sourceKey':_0x87e0('0x158')});db['VoiceMailMessage'][_0x87e0('0x122')](db[_0x87e0('0x20')],{'foreignKey':'mailboxuser','targetKey':_0x87e0('0x158')});db['VoiceCallReport'][_0x87e0('0x115')](db[_0x87e0('0x159')],{'as':'QueueCalls','foreignKey':_0x87e0('0x15a'),'constraints':![]});db[_0x87e0('0x24')][_0x87e0('0x115')](db['VoiceAgentReport'],{'as':_0x87e0('0x15b'),'foreignKey':_0x87e0('0x15a'),'constraints':![]});db[_0x87e0('0x24')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':'User','foreignKey':_0x87e0('0x112')});db[_0x87e0('0x24')][_0x87e0('0x122')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x87e0('0x3b')][_0x87e0('0x122')](db['MailAccount'],{'as':_0x87e0('0x3e'),'foreignKey':_0x87e0('0x15c')});db[_0x87e0('0x3b')][_0x87e0('0x122')](db['CloudProvider'],{'as':_0x87e0('0x15d'),'foreignKey':_0x87e0('0x15e'),'onDelete':'restrict'});db[_0x87e0('0x3d')]['belongsTo'](db['MailAccount'],{'as':_0x87e0('0x3e'),'foreignKey':_0x87e0('0x15c')});db[_0x87e0('0x3d')][_0x87e0('0x122')](db[_0x87e0('0x15d')],{'as':_0x87e0('0x15d'),'foreignKey':_0x87e0('0x15e'),'onDelete':_0x87e0('0x15f')});db['MailAccount'][_0x87e0('0x113')](db[_0x87e0('0x3b')],{'as':_0x87e0('0x160'),'onDelete':_0x87e0('0x111')});db['MailAccount'][_0x87e0('0x113')](db[_0x87e0('0x3d')],{'as':'Smtp','onDelete':_0x87e0('0x111')});db['MailAccount'][_0x87e0('0x115')](db[_0x87e0('0x83')],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x15c'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x3e')]['hasMany'](db[_0x87e0('0x162')],{'as':_0x87e0('0x163'),'foreignKey':_0x87e0('0x15c')});db[_0x87e0('0x3e')][_0x87e0('0x115')](db['MailMessage'],{'as':_0x87e0('0x156'),'foreignKey':_0x87e0('0x15c')});db[_0x87e0('0x3e')][_0x87e0('0x115')](db[_0x87e0('0x42')],{'as':_0x87e0('0x164')});db[_0x87e0('0x3e')][_0x87e0('0x115')](db[_0x87e0('0x165')],{'as':_0x87e0('0x145')});db[_0x87e0('0x3e')]['belongsTo'](db[_0x87e0('0xf6')],{'as':'List','foreignKey':_0x87e0('0x166')});db[_0x87e0('0x3e')][_0x87e0('0x122')](db[_0x87e0('0x167')],{'as':'Template','foreignKey':'TemplateId'});db['MailAccount'][_0x87e0('0x122')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':'user_has_mail_accounts'});db[_0x87e0('0x3f')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':'Agents','through':_0x87e0('0x132')});db['MailQueue'][_0x87e0('0x124')](db['Team'],{'through':'team_has_mail_queues','as':_0x87e0('0x168')});db[_0x87e0('0x42')]['hasMany'](db[_0x87e0('0x44')],{'as':_0x87e0('0x156'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x169')});db['MailInteraction'][_0x87e0('0x122')](db[_0x87e0('0x3e')],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x15c')});db[_0x87e0('0x42')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':'ContactId'});db[_0x87e0('0x42')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':'Owner','foreignKey':_0x87e0('0x112')});db[_0x87e0('0x42')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x16c'),'as':_0x87e0('0x16d')});db['MailInteraction'][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':'mail_interaction_has_tags','as':_0x87e0('0x16e')});db[_0x87e0('0x42')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x16f'),'through':_0x87e0('0x170'),'foreignKey':'MailInteractionId'});db[_0x87e0('0x44')]['hasMany'](db['Attachment'],{'as':_0x87e0('0x171'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x44')][_0x87e0('0x122')](db['User'],{'as':_0x87e0('0x12')});db['MailMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x87e0('0x16b')});db[_0x87e0('0x44')][_0x87e0('0x122')](db[_0x87e0('0x42')],{'as':'Interaction','foreignKey':_0x87e0('0x169')});db[_0x87e0('0x44')][_0x87e0('0x122')](db[_0x87e0('0x3e')],{'as':_0x87e0('0x16a'),'foreignKey':'MailAccountId'});db['MailMessage']['belongsTo'](db[_0x87e0('0x172')],{'as':_0x87e0('0x172'),'foreignKey':_0x87e0('0x173')});db[_0x87e0('0x44')][_0x87e0('0x122')](db[_0x87e0('0x6c')],{'as':_0x87e0('0x6c'),'foreignKey':_0x87e0('0x174')});db[_0x87e0('0x165')][_0x87e0('0x122')](db['User'],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x165')][_0x87e0('0x122')](db[_0x87e0('0x3f')],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x165')][_0x87e0('0x122')](db[_0x87e0('0x3e')],{'onDelete':_0x87e0('0x15f')});db['MailApplication']['belongsTo'](db[_0x87e0('0x150')],{'onDelete':_0x87e0('0x15f'),'foreignKey':_0x87e0('0x151')});db[_0x87e0('0x165')][_0x87e0('0x122')](db[_0x87e0('0x92')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x87e0('0x47')]['belongsTo'](db['MailAccount'],{});db['MailQueueReport'][_0x87e0('0x122')](db[_0x87e0('0xf6')],{'as':'List','foreignKey':_0x87e0('0x166')});db[_0x87e0('0x47')]['belongsTo'](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':'ContactId'});db[_0x87e0('0x47')][_0x87e0('0x122')](db['MailInteraction'],{});db[_0x87e0('0x47')]['belongsTo'](db['MailMessage'],{});db[_0x87e0('0x47')]['belongsTo'](db[_0x87e0('0x12')],{});db['MailQueueReport'][_0x87e0('0x122')](db[_0x87e0('0x3f')],{});db[_0x87e0('0x175')][_0x87e0('0x115')](db['DashboardItem'],{'as':_0x87e0('0x176'),'onDelete':'cascade'});db[_0x87e0('0x4b')][_0x87e0('0x115')](db[_0x87e0('0x83')],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x177'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x4b')][_0x87e0('0x115')](db[_0x87e0('0x162')],{'as':_0x87e0('0x163'),'foreignKey':'FaxAccountId'});db[_0x87e0('0x4b')][_0x87e0('0x115')](db['FaxInteraction'],{'as':_0x87e0('0x164')});db['FaxAccount']['hasMany'](db[_0x87e0('0x4d')],{'as':_0x87e0('0x145')});db['FaxAccount'][_0x87e0('0x115')](db['VoiceExtension'],{'as':_0x87e0('0x178'),'onDelete':_0x87e0('0x111')});db['FaxAccount'][_0x87e0('0x115')](db['FaxMessage'],{'as':_0x87e0('0x156')});db[_0x87e0('0x4b')]['belongsTo'](db[_0x87e0('0x2c')],{'as':_0x87e0('0x2c')});db[_0x87e0('0x4b')]['belongsTo'](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0x4b')]['belongsTo'](db[_0x87e0('0x88')],{'as':_0x87e0('0x17a'),'foreignKey':_0x87e0('0x152')});db['FaxAccount'][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':'Agents','through':_0x87e0('0x13c')});db[_0x87e0('0x4d')]['belongsTo'](db['User'],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x4d')][_0x87e0('0x122')](db['FaxQueue'],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db['FaxAccount'],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x4d')][_0x87e0('0x122')](db[_0x87e0('0x92')],{'onDelete':'restrict','foreignKey':_0x87e0('0x17b')});db['FaxInteraction'][_0x87e0('0x115')](db[_0x87e0('0x51')],{'as':_0x87e0('0x156'),'onDelete':'cascade','foreignKey':_0x87e0('0x17c')});db[_0x87e0('0x4f')][_0x87e0('0x122')](db[_0x87e0('0x4b')],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x177')});db[_0x87e0('0x4f')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x4f')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x17e'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x4f')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x17f'),'as':_0x87e0('0x16d')});db[_0x87e0('0x4f')][_0x87e0('0x124')](db['Tag'],{'through':_0x87e0('0x17f'),'as':_0x87e0('0x16e')});db[_0x87e0('0x4f')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x16f'),'through':_0x87e0('0x12c'),'foreignKey':_0x87e0('0x17c')});db[_0x87e0('0x51')]['belongsTo'](db[_0x87e0('0x12')],{'onDelete':_0x87e0('0x111'),'as':_0x87e0('0x12')});db['FaxMessage'][_0x87e0('0x122')](db[_0x87e0('0x4f')],{'as':'Interaction','foreignKey':_0x87e0('0x17c')});db[_0x87e0('0x51')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'onDelete':_0x87e0('0x111'),'as':_0x87e0('0x16b')});db[_0x87e0('0x51')][_0x87e0('0x122')](db['Attachment'],{'as':_0x87e0('0xec'),'foreignKey':_0x87e0('0x180')});db[_0x87e0('0x51')][_0x87e0('0x122')](db[_0x87e0('0x4b')],{'as':_0x87e0('0x16a'),'foreignKey':'FaxAccountId'});db[_0x87e0('0x53')]['belongsToMany'](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':_0x87e0('0x34')});db[_0x87e0('0x53')][_0x87e0('0x124')](db[_0x87e0('0xe7')],{'through':_0x87e0('0x181'),'as':'Teams'});db['FaxQueueReport'][_0x87e0('0x122')](db['FaxAccount'],{});db[_0x87e0('0x55')][_0x87e0('0x122')](db[_0x87e0('0xf6')],{'as':'List','foreignKey':_0x87e0('0x166')});db[_0x87e0('0x55')]['belongsTo'](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x55')][_0x87e0('0x122')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x87e0('0x122')](db[_0x87e0('0x51')],{});db[_0x87e0('0x55')][_0x87e0('0x122')](db[_0x87e0('0x12')],{});db[_0x87e0('0x55')][_0x87e0('0x122')](db[_0x87e0('0x53')],{});db[_0x87e0('0x56')][_0x87e0('0x115')](db['Disposition'],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x182'),'onDelete':'cascade'});db[_0x87e0('0x56')][_0x87e0('0x115')](db[_0x87e0('0x162')],{'as':_0x87e0('0x163'),'foreignKey':_0x87e0('0x182')});db[_0x87e0('0x56')]['hasMany'](db[_0x87e0('0x183')],{'as':'Messages','foreignKey':_0x87e0('0x182')});db[_0x87e0('0x56')]['hasMany'](db[_0x87e0('0x5a')],{'as':'Interactions'});db[_0x87e0('0x56')][_0x87e0('0x115')](db[_0x87e0('0x58')],{'as':'Applications'});db[_0x87e0('0x56')][_0x87e0('0x122')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0x56')][_0x87e0('0x122')](db[_0x87e0('0x88')],{'as':_0x87e0('0x17a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x87e0('0x56')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':_0x87e0('0x140')});db[_0x87e0('0x58')]['belongsTo'](db[_0x87e0('0x12')],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x58')][_0x87e0('0x122')](db[_0x87e0('0x5d')],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x58')]['belongsTo'](db[_0x87e0('0x56')],{'onDelete':_0x87e0('0x15f')});db['SmsApplication'][_0x87e0('0x122')](db['Interval'],{'onDelete':_0x87e0('0x15f'),'foreignKey':_0x87e0('0x151')});db[_0x87e0('0x58')][_0x87e0('0x122')](db['Tag'],{'onDelete':_0x87e0('0x15f'),'foreignKey':_0x87e0('0x17b')});db[_0x87e0('0x5a')][_0x87e0('0x115')](db[_0x87e0('0x183')],{'as':_0x87e0('0x156'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x184')});db[_0x87e0('0x5a')][_0x87e0('0x122')](db[_0x87e0('0x56')],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x182')});db[_0x87e0('0x5a')]['belongsTo'](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db['SmsInteraction'][_0x87e0('0x122')](db['User'],{'as':_0x87e0('0x17e'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x5a')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x87e0('0x5a')][_0x87e0('0x124')](db['Tag'],{'through':_0x87e0('0x185'),'as':_0x87e0('0x16e')});db[_0x87e0('0x5a')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x16f'),'through':'user_has_sms_interactions','foreignKey':_0x87e0('0x184')});db['SmsMessage'][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x12')});db['SmsMessage'][_0x87e0('0x122')](db[_0x87e0('0x126')],{'onDelete':'cascade','as':'Contact'});db[_0x87e0('0x183')]['belongsTo'](db[_0x87e0('0x5a')],{'onDelete':_0x87e0('0x111'),'as':'Interaction','foreignKey':_0x87e0('0x184')});db[_0x87e0('0x183')][_0x87e0('0x122')](db['SmsAccount'],{'as':_0x87e0('0x16a'),'foreignKey':'SmsAccountId'});db[_0x87e0('0x5d')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':'UserSmsQueue','foreignKey':_0x87e0('0x186')});db[_0x87e0('0x5d')][_0x87e0('0x124')](db[_0x87e0('0xe7')],{'through':_0x87e0('0x187'),'as':'Teams'});db['OpenchannelAccount'][_0x87e0('0x115')](db['Disposition'],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x188'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x5e')][_0x87e0('0x115')](db[_0x87e0('0x162')],{'as':_0x87e0('0x163'),'foreignKey':_0x87e0('0x188')});db[_0x87e0('0x5e')][_0x87e0('0x115')](db[_0x87e0('0x60')],{'as':_0x87e0('0x164'),'foreignKey':_0x87e0('0x188')});db['OpenchannelAccount'][_0x87e0('0x115')](db[_0x87e0('0x62')],{'as':_0x87e0('0x156'),'foreignKey':'OpenchannelAccountId'});db[_0x87e0('0x5e')][_0x87e0('0x115')](db[_0x87e0('0x5f')],{'as':_0x87e0('0x145'),'foreignKey':_0x87e0('0x188')});db['OpenchannelAccount'][_0x87e0('0x122')](db['CmList'],{'as':'List','foreignKey':_0x87e0('0x166')});db['OpenchannelAccount'][_0x87e0('0x122')](db[_0x87e0('0x88')],{'as':_0x87e0('0x17a'),'foreignKey':_0x87e0('0x152')});db[_0x87e0('0x5e')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':_0x87e0('0x13e')});db['OpenchannelApplication'][_0x87e0('0x122')](db[_0x87e0('0x12')],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x5f')][_0x87e0('0x122')](db[_0x87e0('0x136')],{'onDelete':_0x87e0('0x15f'),'foreignKey':_0x87e0('0x189')});db['OpenchannelApplication'][_0x87e0('0x122')](db[_0x87e0('0x5e')],{'onDelete':_0x87e0('0x15f'),'foreignKey':_0x87e0('0x188')});db['OpenchannelApplication'][_0x87e0('0x122')](db[_0x87e0('0x150')],{'onDelete':_0x87e0('0x15f'),'foreignKey':_0x87e0('0x151')});db[_0x87e0('0x5f')][_0x87e0('0x122')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x87e0('0x17b')});db[_0x87e0('0x60')][_0x87e0('0x115')](db[_0x87e0('0x62')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x87e0('0x18a')});db['OpenchannelInteraction'][_0x87e0('0x122')](db['OpenchannelAccount'],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x188')});db[_0x87e0('0x60')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x60')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x17e'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x60')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x18b'),'as':_0x87e0('0x16d')});db[_0x87e0('0x60')]['belongsToMany'](db[_0x87e0('0x92')],{'through':_0x87e0('0x18b'),'as':'ThroughTags'});db[_0x87e0('0x60')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x87e0('0x18a')});db[_0x87e0('0x62')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'onDelete':_0x87e0('0x111'),'as':_0x87e0('0x12')});db[_0x87e0('0x62')]['belongsTo'](db[_0x87e0('0x126')],{'onDelete':'cascade','as':_0x87e0('0x16b')});db[_0x87e0('0x62')][_0x87e0('0x122')](db[_0x87e0('0x60')],{'onDelete':_0x87e0('0x111'),'as':'Interaction','foreignKey':_0x87e0('0x18a')});db[_0x87e0('0x62')]['belongsTo'](db[_0x87e0('0xec')],{'as':_0x87e0('0xec'),'foreignKey':'AttachmentId'});db[_0x87e0('0x62')][_0x87e0('0x122')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x87e0('0x188')});db['OpenchannelQueue'][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':'UserOpenchannelQueue','foreignKey':_0x87e0('0x189')});db['OpenchannelQueue']['belongsToMany'](db['Team'],{'through':_0x87e0('0x18c'),'as':'Teams'});db[_0x87e0('0x172')]['hasMany'](db[_0x87e0('0x83')],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x173'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x172')]['hasMany'](db['CannedAnswer'],{'as':_0x87e0('0x163'),'foreignKey':'ChatWebsiteId'});db[_0x87e0('0x172')][_0x87e0('0x115')](db[_0x87e0('0x70')],{'as':'ProactiveActions'});db[_0x87e0('0x172')][_0x87e0('0x115')](db[_0x87e0('0x6a')],{'as':'Interactions'});db[_0x87e0('0x172')][_0x87e0('0x115')](db['ChatApplication'],{'as':_0x87e0('0x145')});db[_0x87e0('0x172')][_0x87e0('0x115')](db[_0x87e0('0x6b')],{'as':_0x87e0('0x156')});db[_0x87e0('0x172')][_0x87e0('0x122')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0x172')]['belongsTo'](db[_0x87e0('0x150')],{'as':_0x87e0('0x150'),'foreignKey':'IntervalId'});db[_0x87e0('0x172')][_0x87e0('0x122')](db[_0x87e0('0x3e')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x87e0('0x172')][_0x87e0('0x122')](db[_0x87e0('0x88')],{'as':_0x87e0('0x17a'),'foreignKey':_0x87e0('0x152')});db[_0x87e0('0x172')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':_0x87e0('0x13a')});db['OpenchannelQueueReport'][_0x87e0('0x122')](db[_0x87e0('0x5e')],{});db['OpenchannelQueueReport'][_0x87e0('0x122')](db['CmList'],{'as':_0x87e0('0x179'),'foreignKey':'ListId'});db[_0x87e0('0x66')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':'Contact','foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x66')]['belongsTo'](db[_0x87e0('0x60')],{});db[_0x87e0('0x66')][_0x87e0('0x122')](db['OpenchannelMessage'],{});db[_0x87e0('0x66')]['belongsTo'](db[_0x87e0('0x12')],{});db[_0x87e0('0x66')][_0x87e0('0x122')](db[_0x87e0('0x136')],{});db[_0x87e0('0x68')]['belongsTo'](db[_0x87e0('0x12')],{'as':_0x87e0('0x18d'),'foreignKey':_0x87e0('0x112'),'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x68')]['belongsTo'](db[_0x87e0('0x18e')],{'as':_0x87e0('0x18f'),'foreignKey':_0x87e0('0x190'),'onDelete':'restrict'});db[_0x87e0('0x68')]['belongsTo'](db[_0x87e0('0x172')],{'as':'Website','foreignKey':_0x87e0('0x173'),'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x68')][_0x87e0('0x122')](db[_0x87e0('0x92')],{'onDelete':'restrict','foreignKey':_0x87e0('0x17b')});db['ChatInteraction']['hasMany'](db[_0x87e0('0x6b')],{'as':'Messages','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x191')});db[_0x87e0('0x6a')]['belongsTo'](db[_0x87e0('0x172')],{'as':_0x87e0('0x16a'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x6a')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x17e'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x6a')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':'chat_interaction_has_tags','as':_0x87e0('0x16d')});db[_0x87e0('0x6a')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x192'),'as':_0x87e0('0x16e')});db[_0x87e0('0x6a')]['belongsToMany'](db[_0x87e0('0x12')],{'as':_0x87e0('0x16f'),'through':'user_has_chat_interactions','foreignKey':_0x87e0('0x191')});db['ChatMessage']['belongsTo'](db[_0x87e0('0x12')],{'onDelete':'cascade','as':_0x87e0('0x12')});db[_0x87e0('0x6b')][_0x87e0('0x122')](db['CmContact'],{'onDelete':'cascade','as':_0x87e0('0x16b'),'foreignKey':'ContactId'});db['ChatMessage'][_0x87e0('0x122')](db[_0x87e0('0x6a')],{'onDelete':_0x87e0('0x111'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x87e0('0x6b')][_0x87e0('0x122')](db['Attachment'],{'as':'Attachment','foreignKey':_0x87e0('0x180')});db['ChatMessage'][_0x87e0('0x122')](db[_0x87e0('0x172')],{'as':'Account','foreignKey':_0x87e0('0x173')});db[_0x87e0('0x6c')][_0x87e0('0x115')](db[_0x87e0('0xec')],{'as':'Attachments','foreignKey':_0x87e0('0x174'),'onDelete':_0x87e0('0x111'),'hooks':!![]});db[_0x87e0('0x6c')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'onDelete':'cascade','as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x6c')][_0x87e0('0x122')](db[_0x87e0('0x172')],{'as':_0x87e0('0x16a'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x87e0('0x124')](db[_0x87e0('0xe7')],{'through':_0x87e0('0x193'),'as':_0x87e0('0x168')});db[_0x87e0('0x6f')][_0x87e0('0x115')](db[_0x87e0('0xd8')],{'as':_0x87e0('0x156'),'foreignKey':_0x87e0('0x194'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x6f')]['belongsToMany'](db[_0x87e0('0x12')],{'as':'Members','through':_0x87e0('0x125')});db['ChatProactiveAction']['belongsTo'](db['ChatWebsite'],{'as':_0x87e0('0x195'),'foreignKey':_0x87e0('0x173')});db[_0x87e0('0x72')][_0x87e0('0x115')](db[_0x87e0('0x126')],{'as':'Contacts','foreignKey':_0x87e0('0x196')});db[_0x87e0('0x126')][_0x87e0('0x115')](db[_0x87e0('0x197')],{'as':_0x87e0('0x198'),'foreignKey':_0x87e0('0x199')});db[_0x87e0('0x126')][_0x87e0('0x115')](db[_0x87e0('0x75')],{'as':_0x87e0('0x149'),'foreignKey':'ContactId'});db[_0x87e0('0x126')][_0x87e0('0x115')](db[_0x87e0('0x77')],{'as':_0x87e0('0x14a'),'foreignKey':_0x87e0('0x17d')});db['CmContact']['hasMany'](db[_0x87e0('0x79')],{'as':_0x87e0('0x14b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x126')][_0x87e0('0x115')](db['ReportAgentPreview'],{'as':_0x87e0('0x11a'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x126')]['hasMany'](db[_0x87e0('0xdc')],{'as':_0x87e0('0x19a'),'foreignKey':'ContactId'});db['CmContact'][_0x87e0('0x115')](db[_0x87e0('0x60')],{'as':_0x87e0('0x11b'),'foreignKey':_0x87e0('0x17d'),'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x126')][_0x87e0('0x115')](db[_0x87e0('0x6a')],{'as':_0x87e0('0x11c'),'foreignKey':'ContactId','onDelete':_0x87e0('0x15f')});db['CmContact'][_0x87e0('0x115')](db[_0x87e0('0x5a')],{'as':_0x87e0('0x11d'),'foreignKey':_0x87e0('0x17d'),'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x126')]['hasMany'](db['FaxInteraction'],{'as':_0x87e0('0x11e'),'foreignKey':_0x87e0('0x17d'),'onDelete':_0x87e0('0x15f')});db['CmContact'][_0x87e0('0x115')](db[_0x87e0('0x42')],{'as':'MailInteractions','foreignKey':_0x87e0('0x17d'),'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x126')][_0x87e0('0x122')](db[_0x87e0('0x72')],{'as':_0x87e0('0x19b'),'foreignKey':_0x87e0('0x196')});db[_0x87e0('0x126')][_0x87e0('0x122')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166'),'onDelete':_0x87e0('0x111')});db['CmContact']['belongsToMany'](db['User'],{'as':_0x87e0('0x16f'),'through':_0x87e0('0x128')});db[_0x87e0('0x126')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'as':_0x87e0('0x16d'),'through':'cm_contact_has_tags'});db[_0x87e0('0x126')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x19c'),'as':_0x87e0('0x16e')});db[_0x87e0('0x75')][_0x87e0('0x115')](db[_0x87e0('0x96')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0x87e0('0x75')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x87e0('0x111')});db['CmHopper']['belongsTo'](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':'ListId','onDelete':_0x87e0('0x111')});db[_0x87e0('0x75')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x18d'),'foreignKey':_0x87e0('0x112')});db[_0x87e0('0x75')][_0x87e0('0x122')](db[_0x87e0('0x1c')],{'as':_0x87e0('0x18f'),'foreignKey':_0x87e0('0x148'),'onDelete':_0x87e0('0x111')});db['CmHopper']['belongsTo'](db['Campaign'],{'as':_0x87e0('0xe9'),'foreignKey':'CampaignId','onDelete':_0x87e0('0x111')});db[_0x87e0('0x75')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x17e'),'foreignKey':_0x87e0('0x19d')});db[_0x87e0('0x76')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x76')]['belongsTo'](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':'ListId','onDelete':_0x87e0('0x111')});db[_0x87e0('0x76')][_0x87e0('0x122')](db[_0x87e0('0x1c')],{'as':_0x87e0('0x18f'),'foreignKey':_0x87e0('0x148'),'onDelete':'cascade'});db[_0x87e0('0x76')][_0x87e0('0x122')](db[_0x87e0('0xe9')],{'as':'Campaign','foreignKey':_0x87e0('0x19e'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0x80')][_0x87e0('0x115')](db['Condition'],{'as':{'plural':'All','singular':_0x87e0('0x19f')},'foreignKey':_0x87e0('0x1a0'),'onDelete':'cascade','hooks':!![]});db[_0x87e0('0x80')][_0x87e0('0x115')](db[_0x87e0('0x85')],{'as':{'plural':_0x87e0('0x1a1'),'singular':_0x87e0('0x1a2')},'foreignKey':_0x87e0('0x1a3'),'onDelete':_0x87e0('0x111'),'hooks':!![]});db[_0x87e0('0x80')]['hasMany'](db[_0x87e0('0x7e')],{'as':_0x87e0('0x1a4'),'foreignKey':_0x87e0('0x1a5'),'onDelete':_0x87e0('0x111'),'hooks':!![]});db[_0x87e0('0x83')][_0x87e0('0x115')](db[_0x87e0('0x83')],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x1a6'),'onDelete':'cascade'});db[_0x87e0('0x150')][_0x87e0('0x115')](db[_0x87e0('0x150')],{'as':_0x87e0('0x1a7'),'foreignKey':_0x87e0('0x151'),'onDelete':_0x87e0('0x111'),'hooks':!![],'required':![]});db['Interval'][_0x87e0('0x115')](db['VoiceExtension'],{'as':_0x87e0('0x118'),'foreignKey':_0x87e0('0x151'),'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x150')]['hasMany'](db[_0x87e0('0x165')],{'as':_0x87e0('0x1a8'),'foreignKey':'IntervalId'});db[_0x87e0('0x150')][_0x87e0('0x115')](db[_0x87e0('0x68')],{'as':_0x87e0('0x1a9'),'foreignKey':'IntervalId'});db[_0x87e0('0x150')][_0x87e0('0x115')](db[_0x87e0('0x4d')],{'as':_0x87e0('0x1aa'),'foreignKey':_0x87e0('0x151')});db[_0x87e0('0x150')][_0x87e0('0x115')](db[_0x87e0('0x58')],{'as':_0x87e0('0x1ab'),'foreignKey':_0x87e0('0x151')});db[_0x87e0('0x8e')]['belongsTo'](db[_0x87e0('0x3e')],{});db[_0x87e0('0x8e')][_0x87e0('0x122')](db['AnalyticDefaultReport'],{'foreignKey':_0x87e0('0x1ac')});db['Schedule'][_0x87e0('0x122')](db['AnalyticCustomReport'],{'foreignKey':_0x87e0('0x1ad')});db[_0x87e0('0x90')][_0x87e0('0x124')](db[_0x87e0('0x1a')],{'as':_0x87e0('0x1ae'),'through':_0x87e0('0x1af'),'onDelete':_0x87e0('0x15f')});db[_0x87e0('0x92')][_0x87e0('0x124')](db[_0x87e0('0x126')],{'through':'cm_contact_has_tags'});db[_0x87e0('0x92')]['belongsToMany'](db[_0x87e0('0x6a')],{'through':_0x87e0('0x192')});db[_0x87e0('0x92')][_0x87e0('0x124')](db[_0x87e0('0x42')],{'through':_0x87e0('0x16c')});db['Tag'][_0x87e0('0x124')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x87e0('0x92')][_0x87e0('0x124')](db[_0x87e0('0x4f')],{'through':_0x87e0('0x17f')});db['Tag'][_0x87e0('0x124')](db[_0x87e0('0x60')],{'through':'openchannel_interaction_has_tags'});db[_0x87e0('0x92')][_0x87e0('0x124')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x87e0('0x197')]['belongsTo'](db[_0x87e0('0x94')],{'as':'ItemType','foreignKey':_0x87e0('0x1b0')});db[_0x87e0('0x96')][_0x87e0('0x122')](db[_0x87e0('0x75')],{'as':_0x87e0('0x1b1'),'foreignKey':_0x87e0('0x1b2')});db[_0x87e0('0x197')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x199')});db['Trigger'][_0x87e0('0x115')](db[_0x87e0('0x85')],{'as':{'plural':_0x87e0('0x1b3'),'singular':_0x87e0('0x1b4')},'foreignKey':_0x87e0('0x1b5'),'onDelete':_0x87e0('0x111'),'hooks':!![]});db[_0x87e0('0x98')][_0x87e0('0x115')](db[_0x87e0('0x85')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0x87e0('0x1b6'),'onDelete':_0x87e0('0x111'),'hooks':!![]});db[_0x87e0('0x98')][_0x87e0('0x115')](db[_0x87e0('0x7e')],{'as':_0x87e0('0x1a4'),'foreignKey':_0x87e0('0x1b7'),'onDelete':'cascade','hooks':!![]});db[_0x87e0('0x9f')][_0x87e0('0x115')](db[_0x87e0('0xa6')],{'as':_0x87e0('0x1b8'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1ad'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x87e0('0xa6')],{'as':_0x87e0('0x1b8'),'onDelete':'cascade','foreignKey':_0x87e0('0x1ac')});db[_0x87e0('0xa4')][_0x87e0('0x115')](db[_0x87e0('0xa6')],{'as':_0x87e0('0x1b8'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1b9')});db[_0x87e0('0xa6')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x87e0('0x115')](db['SalesforceConfiguration'],{'as':_0x87e0('0x1ba'),'onDelete':'cascade','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0x1bc')]['hasMany'](db['SalesforceField'],{'as':_0x87e0('0x1bd'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1be')});db[_0x87e0('0x1bc')][_0x87e0('0x115')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0x1bc')][_0x87e0('0x115')](db['SalesforceField'],{'as':_0x87e0('0x1b8'),'onDelete':_0x87e0('0x111'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x87e0('0x122')](db[_0x87e0('0xa9')],{'as':'Account','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xab')]['hasMany'](db[_0x87e0('0xab')],{'as':_0x87e0('0x1c0'),'foreignKey':_0x87e0('0x1be')});db['SalesforceField'][_0x87e0('0x115')](db[_0x87e0('0xab')],{'as':_0x87e0('0x1c1'),'foreignKey':_0x87e0('0x1bf')});db['SalesforceField'][_0x87e0('0x115')](db['SalesforceField'],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xab')]['belongsTo'](db['Variable'],{'as':_0x87e0('0x99'),'foreignKey':'VariableId'});db[_0x87e0('0xad')]['hasMany'](db[_0x87e0('0xaf')],{'as':_0x87e0('0x1ba'),'onDelete':'cascade','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xaf')]['hasMany'](db[_0x87e0('0x1c4')],{'as':'Subjects','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1be')});db[_0x87e0('0xaf')]['hasMany'](db[_0x87e0('0x1c4')],{'as':_0x87e0('0x1c5'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xaf')][_0x87e0('0x115')](db[_0x87e0('0x1c4')],{'as':'Fields','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xaf')][_0x87e0('0x122')](db[_0x87e0('0xad')],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0x1c4')][_0x87e0('0x115')](db['SugarcrmField'],{'as':_0x87e0('0x1c0'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x87e0('0x115')](db[_0x87e0('0x1c4')],{'as':_0x87e0('0x1c1'),'foreignKey':'DescriptionId'});db[_0x87e0('0x1c4')][_0x87e0('0x115')](db[_0x87e0('0x1c4')],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0x1c4')][_0x87e0('0x122')](db['Variable'],{'as':_0x87e0('0x99'),'foreignKey':'VariableId'});db[_0x87e0('0xb2')]['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xb3')][_0x87e0('0x115')](db[_0x87e0('0xb5')],{'as':_0x87e0('0x1bd'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1be')});db['DeskConfiguration'][_0x87e0('0x115')](db[_0x87e0('0xb5')],{'as':'Descriptions','onDelete':_0x87e0('0x111'),'foreignKey':'DescriptionId'});db[_0x87e0('0xb3')][_0x87e0('0x115')](db[_0x87e0('0xb5')],{'as':_0x87e0('0x1b8'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xb3')][_0x87e0('0x122')](db[_0x87e0('0xb2')],{'as':_0x87e0('0x16a'),'foreignKey':'AccountId'});db[_0x87e0('0xb3')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x1c6')});db['DeskField'][_0x87e0('0x115')](db[_0x87e0('0xb5')],{'as':'Subject','foreignKey':_0x87e0('0x1be')});db[_0x87e0('0xb5')]['hasMany'](db[_0x87e0('0xb5')],{'as':_0x87e0('0x1c1'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xb5')][_0x87e0('0x115')](db['DeskField'],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db['DeskField'][_0x87e0('0x122')](db[_0x87e0('0x99')],{'as':'Variable','foreignKey':_0x87e0('0x1c7')});db[_0x87e0('0xb6')]['hasMany'](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x87e0('0x111'),'foreignKey':'AccountId'});db[_0x87e0('0xb7')]['hasMany'](db['ZohoField'],{'as':_0x87e0('0x1bd'),'onDelete':'cascade','foreignKey':_0x87e0('0x1be')});db[_0x87e0('0xb7')][_0x87e0('0x115')](db['ZohoField'],{'as':_0x87e0('0x1c5'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xb7')][_0x87e0('0x115')](db[_0x87e0('0x1c8')],{'as':_0x87e0('0x1b8'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xb7')][_0x87e0('0x122')](db[_0x87e0('0xb6')],{'as':'Account','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0x1c8')][_0x87e0('0x115')](db[_0x87e0('0x1c8')],{'as':_0x87e0('0x1c0'),'foreignKey':'SubjectId'});db['ZohoField'][_0x87e0('0x115')](db[_0x87e0('0x1c8')],{'as':_0x87e0('0x1c1'),'foreignKey':'DescriptionId'});db['ZohoField'][_0x87e0('0x115')](db[_0x87e0('0x1c8')],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0x1c8')]['belongsTo'](db[_0x87e0('0x99')],{'as':_0x87e0('0x99'),'foreignKey':_0x87e0('0x1c7')});db['ZendeskAccount']['hasMany'](db[_0x87e0('0x1c9')],{'as':'Configurations','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0x1c9')]['hasMany'](db[_0x87e0('0xbc')],{'as':'Subjects','foreignKey':_0x87e0('0x1be')});db[_0x87e0('0x1c9')][_0x87e0('0x115')](db[_0x87e0('0xbc')],{'as':_0x87e0('0x1c5'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0x1c9')][_0x87e0('0x115')](db['ZendeskField'],{'as':'Fields','foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0x1c9')]['belongsTo'](db[_0x87e0('0xb9')],{'as':'Account','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0x1c9')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x1ca')});db[_0x87e0('0xbc')]['hasMany'](db[_0x87e0('0xbc')],{'as':_0x87e0('0x1c0'),'foreignKey':'SubjectId'});db[_0x87e0('0xbc')][_0x87e0('0x115')](db[_0x87e0('0xbc')],{'as':'Description','foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xbc')][_0x87e0('0x115')](db[_0x87e0('0xbc')],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xbc')][_0x87e0('0x122')](db[_0x87e0('0x99')],{'as':_0x87e0('0x99'),'foreignKey':_0x87e0('0x1c7')});db['FreshdeskAccount'][_0x87e0('0x115')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xbe')][_0x87e0('0x115')](db[_0x87e0('0xc0')],{'as':'Subjects','onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1be')});db[_0x87e0('0xbe')][_0x87e0('0x115')](db[_0x87e0('0xc0')],{'as':_0x87e0('0x1c5'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xbe')][_0x87e0('0x115')](db[_0x87e0('0xc0')],{'as':_0x87e0('0x1b8'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xbe')][_0x87e0('0x122')](db[_0x87e0('0x1cb')],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xbe')][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x1cc')});db['FreshdeskField']['hasMany'](db[_0x87e0('0xc0')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x87e0('0xc0')][_0x87e0('0x115')](db[_0x87e0('0xc0')],{'as':'Description','foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xc0')][_0x87e0('0x115')](db[_0x87e0('0xc0')],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xc0')][_0x87e0('0x122')](db['Variable'],{'as':_0x87e0('0x99'),'foreignKey':_0x87e0('0x1c7')});db[_0x87e0('0xc2')]['hasMany'](db[_0x87e0('0x1cd')],{'as':_0x87e0('0x1ba'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0x1cd')][_0x87e0('0x115')](db['VtigerField'],{'as':_0x87e0('0x1bd'),'foreignKey':_0x87e0('0x1be')});db[_0x87e0('0x1cd')]['hasMany'](db['VtigerField'],{'as':_0x87e0('0x1c5'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0x1cd')]['hasMany'](db[_0x87e0('0x1ce')],{'as':_0x87e0('0x1b8'),'foreignKey':_0x87e0('0x1c3')});db['VtigerConfiguration'][_0x87e0('0x122')](db[_0x87e0('0xc2')],{'as':'Account','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0x1ce')][_0x87e0('0x115')](db['VtigerField'],{'as':_0x87e0('0x1c0'),'foreignKey':_0x87e0('0x1be')});db[_0x87e0('0x1ce')][_0x87e0('0x115')](db[_0x87e0('0x1ce')],{'as':_0x87e0('0x1c1'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0x1ce')][_0x87e0('0x115')](db[_0x87e0('0x1ce')],{'as':'Field','foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0x1ce')][_0x87e0('0x122')](db[_0x87e0('0x99')],{'as':_0x87e0('0x99'),'foreignKey':'VariableId'});db[_0x87e0('0x1cf')][_0x87e0('0x115')](db[_0x87e0('0xc6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x87e0('0x1bb')});db['ServicenowConfiguration'][_0x87e0('0x115')](db[_0x87e0('0xc8')],{'as':_0x87e0('0x1bd'),'foreignKey':_0x87e0('0x1be')});db['ServicenowConfiguration'][_0x87e0('0x115')](db[_0x87e0('0xc8')],{'as':_0x87e0('0x1c5'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x87e0('0xc8')],{'as':'Fields','foreignKey':'FieldId'});db[_0x87e0('0xc6')][_0x87e0('0x122')](db[_0x87e0('0x1cf')],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xc8')][_0x87e0('0x115')](db[_0x87e0('0xc8')],{'as':_0x87e0('0x1c0'),'foreignKey':_0x87e0('0x1be')});db['ServicenowField'][_0x87e0('0x115')](db[_0x87e0('0xc8')],{'as':'Description','foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xc8')][_0x87e0('0x115')](db[_0x87e0('0xc8')],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xc8')][_0x87e0('0x122')](db[_0x87e0('0x99')],{'as':'Variable','foreignKey':_0x87e0('0x1c7')});db['Dynamics365Account'][_0x87e0('0x115')](db[_0x87e0('0xcc')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x87e0('0x1bb')});db['Dynamics365Account'][_0x87e0('0x122')](db[_0x87e0('0x15d')],{'as':_0x87e0('0x15d'),'foreignKey':_0x87e0('0x15e')});db[_0x87e0('0xcc')][_0x87e0('0x115')](db['Dynamics365Field'],{'as':_0x87e0('0x1bd'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1be')});db['Dynamics365Configuration'][_0x87e0('0x115')](db[_0x87e0('0xce')],{'as':_0x87e0('0x1c5'),'onDelete':_0x87e0('0x111'),'foreignKey':'DescriptionId'});db[_0x87e0('0xcc')][_0x87e0('0x115')](db['Dynamics365Field'],{'as':_0x87e0('0x1b8'),'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1c3')});db['Dynamics365Configuration'][_0x87e0('0x122')](db['Dynamics365Account'],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xce')]['hasMany'](db[_0x87e0('0xce')],{'as':_0x87e0('0x1c0'),'foreignKey':_0x87e0('0x1be')});db[_0x87e0('0xce')][_0x87e0('0x115')](db[_0x87e0('0xce')],{'as':_0x87e0('0x1c1'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xce')][_0x87e0('0x115')](db[_0x87e0('0xce')],{'as':_0x87e0('0x1c2'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xce')][_0x87e0('0x122')](db[_0x87e0('0x99')],{'as':_0x87e0('0x99'),'foreignKey':'VariableId'});db[_0x87e0('0xd0')]['hasMany'](db[_0x87e0('0xd1')],{'as':_0x87e0('0x1ba'),'onDelete':'cascade','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xd1')][_0x87e0('0x115')](db[_0x87e0('0xd3')],{'as':_0x87e0('0x1bd'),'foreignKey':_0x87e0('0x1be')});db[_0x87e0('0xd1')][_0x87e0('0x115')](db[_0x87e0('0xd3')],{'as':'Descriptions','foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xd1')]['hasMany'](db[_0x87e0('0xd3')],{'as':_0x87e0('0x1b8'),'foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xd1')][_0x87e0('0x122')](db[_0x87e0('0xd0')],{'as':'Account','foreignKey':_0x87e0('0x1bb')});db[_0x87e0('0xd3')][_0x87e0('0x115')](db[_0x87e0('0xd3')],{'as':_0x87e0('0x1c0'),'foreignKey':_0x87e0('0x1be')});db['FreshsalesField']['hasMany'](db[_0x87e0('0xd3')],{'as':_0x87e0('0x1c1'),'foreignKey':_0x87e0('0x1bf')});db[_0x87e0('0xd3')]['hasMany'](db['FreshsalesField'],{'as':'Field','foreignKey':_0x87e0('0x1c3')});db[_0x87e0('0xd3')][_0x87e0('0x122')](db['Variable'],{'as':_0x87e0('0x99'),'foreignKey':_0x87e0('0x1c7')});db[_0x87e0('0xd6')][_0x87e0('0x122')](db[_0x87e0('0x172')],{});db[_0x87e0('0xd6')][_0x87e0('0x122')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166')});db['ChatQueueReport'][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0xd6')][_0x87e0('0x122')](db[_0x87e0('0x6a')],{});db[_0x87e0('0xd6')][_0x87e0('0x122')](db[_0x87e0('0x6b')],{});db['ChatQueueReport'][_0x87e0('0x122')](db['User'],{});db[_0x87e0('0xd6')]['belongsTo'](db[_0x87e0('0x18e')],{});db[_0x87e0('0xd8')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'onDelete':_0x87e0('0x111'),'foreignKey':_0x87e0('0x1d0')});db['ChatInternalMessage'][_0x87e0('0x122')](db['User'],{'onDelete':'cascade','foreignKey':_0x87e0('0x1d1')});db['JscriptySessionReport'][_0x87e0('0x115')](db[_0x87e0('0xda')],{'foreignKey':'SessionId','onDelete':_0x87e0('0x111')});db['JscriptySessionReport']['hasMany'](db[_0x87e0('0x1d2')],{'foreignKey':'SessionId','onDelete':_0x87e0('0x111')});db['SmsQueueReport'][_0x87e0('0x122')](db[_0x87e0('0x56')],{});db['SmsQueueReport']['belongsTo'](db['CmList'],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166')});db['SmsQueueReport'][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0xde')][_0x87e0('0x122')](db[_0x87e0('0x5a')],{});db['SmsQueueReport'][_0x87e0('0x122')](db['SmsMessage'],{});db[_0x87e0('0xde')][_0x87e0('0x122')](db[_0x87e0('0x12')],{});db[_0x87e0('0xde')][_0x87e0('0x122')](db[_0x87e0('0x5d')],{});db[_0x87e0('0xe0')][_0x87e0('0x115')](db[_0x87e0('0xdc')],{'foreignKey':_0x87e0('0x1d3')});db[_0x87e0('0xe0')][_0x87e0('0x115')](db[_0x87e0('0xda')],{'foreignKey':_0x87e0('0x1d3')});db[_0x87e0('0xe0')][_0x87e0('0x115')](db[_0x87e0('0x1d2')],{'foreignKey':_0x87e0('0x1d3')});db[_0x87e0('0xe7')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':'Agents','through':_0x87e0('0x1d4')});db['Team'][_0x87e0('0x124')](db[_0x87e0('0x1c')],{'through':_0x87e0('0x10b'),'as':'VoiceQueues'});db['Team']['belongsToMany'](db['MailQueue'],{'through':_0x87e0('0x1d5'),'as':_0x87e0('0x1d6')});db['Team']['belongsToMany'](db['ChatQueue'],{'through':_0x87e0('0x193'),'as':_0x87e0('0x133')});db[_0x87e0('0xe7')][_0x87e0('0x124')](db[_0x87e0('0x53')],{'through':_0x87e0('0x181'),'as':_0x87e0('0x134')});db['Team'][_0x87e0('0x124')](db[_0x87e0('0x5d')],{'through':'team_has_sms_queues','as':_0x87e0('0x135')});db[_0x87e0('0xe7')][_0x87e0('0x124')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Team'][_0x87e0('0x124')](db[_0x87e0('0x108')],{'through':_0x87e0('0x1d7'),'as':'WhatsappQueues'});db[_0x87e0('0xe7')][_0x87e0('0x124')](db['VoicePrefix'],{'through':_0x87e0('0x10d'),'as':_0x87e0('0x130')});db[_0x87e0('0xe9')][_0x87e0('0x115')](db['CmHopper'],{'as':_0x87e0('0x149'),'foreignKey':_0x87e0('0x19e')});db[_0x87e0('0xe9')][_0x87e0('0x115')](db[_0x87e0('0x77')],{'as':_0x87e0('0x14a'),'foreignKey':_0x87e0('0x19e')});db[_0x87e0('0xe9')]['hasMany'](db[_0x87e0('0x79')],{'as':_0x87e0('0x14b'),'foreignKey':_0x87e0('0x19e')});db[_0x87e0('0xe9')][_0x87e0('0x115')](db[_0x87e0('0x76')],{'as':_0x87e0('0x14c'),'foreignKey':_0x87e0('0x19e')});db[_0x87e0('0xe9')][_0x87e0('0x122')](db[_0x87e0('0x2c')],{'as':'Trunk','foreignKey':_0x87e0('0x14d')});db['Campaign'][_0x87e0('0x122')](db[_0x87e0('0x2c')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x87e0('0xe9')][_0x87e0('0x122')](db[_0x87e0('0x150')],{'as':_0x87e0('0x150'),'foreignKey':_0x87e0('0x151')});db[_0x87e0('0xe9')]['belongsTo'](db[_0x87e0('0xe4')],{'as':_0x87e0('0xe4'),'foreignKey':_0x87e0('0x1d8')});db[_0x87e0('0xe9')][_0x87e0('0x124')](db['CmList'],{'as':_0x87e0('0x129'),'through':_0x87e0('0x1d9')});db[_0x87e0('0xe9')][_0x87e0('0x124')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x1da'),'through':'campaigns_has_cm_blacklists'});db[_0x87e0('0xec')]['belongsTo'](db[_0x87e0('0x6c')],{'as':_0x87e0('0x6c'),'foreignKey':_0x87e0('0x174')});db[_0x87e0('0xee')][_0x87e0('0x122')](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db[_0x87e0('0x42')],{});db['MailTransferReport'][_0x87e0('0x122')](db['MailAccount'],{'foreignKey':_0x87e0('0x1db'),'as':_0x87e0('0x1dc')});db[_0x87e0('0xee')]['belongsTo'](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1dd'),'as':_0x87e0('0x1de')});db[_0x87e0('0xee')]['belongsTo'](db['User'],{'foreignKey':_0x87e0('0x1df'),'as':'ToAgent'});db['MailTransferReport'][_0x87e0('0x122')](db[_0x87e0('0x3f')],{'foreignKey':_0x87e0('0x1e0'),'as':_0x87e0('0x1e1')});db[_0x87e0('0xee')]['belongsTo'](db[_0x87e0('0x3e')],{'foreignKey':_0x87e0('0x1e2'),'as':_0x87e0('0x1e3')});db[_0x87e0('0x1e4')]['belongsTo'](db[_0x87e0('0x6b')],{});db[_0x87e0('0x1e4')][_0x87e0('0x122')](db[_0x87e0('0x6a')],{});db[_0x87e0('0x1e4')][_0x87e0('0x122')](db[_0x87e0('0x172')],{'foreignKey':_0x87e0('0x1e5'),'as':_0x87e0('0x1dc')});db[_0x87e0('0x1e4')][_0x87e0('0x122')](db['User'],{'foreignKey':'FromUserId','as':_0x87e0('0x1de')});db['ChatTransferReport'][_0x87e0('0x122')](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1df'),'as':_0x87e0('0x1e6')});db[_0x87e0('0x1e4')][_0x87e0('0x122')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x87e0('0x1e1')});db[_0x87e0('0x1e4')][_0x87e0('0x122')](db[_0x87e0('0x172')],{'foreignKey':_0x87e0('0x1e7'),'as':_0x87e0('0x1e3')});db['FaxTransferReport'][_0x87e0('0x122')](db['FaxMessage'],{});db[_0x87e0('0xf1')]['belongsTo'](db[_0x87e0('0x4f')],{});db['FaxTransferReport'][_0x87e0('0x122')](db['FaxAccount'],{'foreignKey':_0x87e0('0x1e8'),'as':'FromAccount'});db[_0x87e0('0xf1')]['belongsTo'](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1dd'),'as':'FromAgent'});db[_0x87e0('0xf1')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1df'),'as':_0x87e0('0x1e6')});db[_0x87e0('0xf1')][_0x87e0('0x122')](db['FaxQueue'],{'foreignKey':_0x87e0('0x1e9'),'as':_0x87e0('0x1e1')});db['FaxTransferReport'][_0x87e0('0x122')](db['FaxAccount'],{'foreignKey':_0x87e0('0x1ea'),'as':_0x87e0('0x1e3')});db['OpenchannelTransferReport'][_0x87e0('0x122')](db['OpenchannelMessage'],{});db[_0x87e0('0xf3')][_0x87e0('0x122')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x87e0('0x5e')],{'foreignKey':_0x87e0('0x1eb'),'as':'FromAccount'});db[_0x87e0('0xf3')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1dd'),'as':_0x87e0('0x1de')});db['OpenchannelTransferReport'][_0x87e0('0x122')](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1df'),'as':'ToAgent'});db[_0x87e0('0xf3')]['belongsTo'](db[_0x87e0('0x136')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x87e0('0xf3')]['belongsTo'](db[_0x87e0('0x5e')],{'foreignKey':_0x87e0('0x1ec'),'as':_0x87e0('0x1e3')});db['SmsTransferReport'][_0x87e0('0x122')](db[_0x87e0('0x183')],{});db[_0x87e0('0x1ed')][_0x87e0('0x122')](db['SmsInteraction'],{});db[_0x87e0('0x1ed')][_0x87e0('0x122')](db['SmsAccount'],{'foreignKey':_0x87e0('0x1ee'),'as':_0x87e0('0x1dc')});db[_0x87e0('0x1ed')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1dd'),'as':_0x87e0('0x1de')});db[_0x87e0('0x1ed')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1df'),'as':_0x87e0('0x1e6')});db[_0x87e0('0x1ed')][_0x87e0('0x122')](db[_0x87e0('0x5d')],{'foreignKey':_0x87e0('0x1ef'),'as':'ToQueue'});db['SmsTransferReport'][_0x87e0('0x122')](db[_0x87e0('0x56')],{'foreignKey':_0x87e0('0x1f0'),'as':'ToAccount'});db[_0x87e0('0xf6')][_0x87e0('0x115')](db[_0x87e0('0x83')],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x166'),'onDelete':_0x87e0('0x111')});db['CmList']['hasMany'](db['CmCustomField'],{'as':_0x87e0('0x1f1'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0xf6')]['hasMany'](db[_0x87e0('0x126')],{'as':'Contacts','onDelete':_0x87e0('0x111'),'foreignKey':'ListId'});db[_0x87e0('0xf6')][_0x87e0('0x115')](db[_0x87e0('0x77')],{'as':_0x87e0('0x14a'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0xf6')]['hasMany'](db[_0x87e0('0x79')],{'as':_0x87e0('0x119'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0xf6')][_0x87e0('0x115')](db[_0x87e0('0x11a')],{'as':_0x87e0('0x11a'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0xf6')]['belongsToMany'](db[_0x87e0('0x1c')],{'as':_0x87e0('0x1f2'),'through':_0x87e0('0x153')});db[_0x87e0('0xf6')]['belongsToMany'](db['User'],{'as':_0x87e0('0x154'),'through':_0x87e0('0x12a')});db[_0x87e0('0x1f3')][_0x87e0('0x115')](db[_0x87e0('0x18')],{'as':_0x87e0('0x118'),'onDelete':'cascade'});db[_0x87e0('0x1f3')][_0x87e0('0x124')](db['User'],{'as':_0x87e0('0x154'),'through':_0x87e0('0x131')});db[_0x87e0('0x1f3')][_0x87e0('0x124')](db[_0x87e0('0xe7')],{'through':_0x87e0('0x10d'),'as':_0x87e0('0x168')});db[_0x87e0('0x123')][_0x87e0('0x115')](db[_0x87e0('0x12')],{'as':'Users','foreignKey':_0x87e0('0x1f4')});db[_0x87e0('0x123')]['hasMany'](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x87e0('0x111')});db[_0x87e0('0xf9')][_0x87e0('0x115')](db[_0x87e0('0xfb')],{'as':_0x87e0('0x1f5'),'foreignKey':_0x87e0('0x1f6'),'onDelete':_0x87e0('0x111')});db[_0x87e0('0xfe')][_0x87e0('0x115')](db[_0x87e0('0x83')],{'as':_0x87e0('0x161'),'foreignKey':_0x87e0('0x1f7'),'onDelete':_0x87e0('0x111')});db['WhatsappAccount'][_0x87e0('0x115')](db[_0x87e0('0x162')],{'as':'Answers','foreignKey':_0x87e0('0x1f7')});db['WhatsappAccount'][_0x87e0('0x115')](db[_0x87e0('0x102')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0x87e0('0xfe')][_0x87e0('0x115')](db['WhatsappInteraction'],{'as':_0x87e0('0x164')});db[_0x87e0('0xfe')][_0x87e0('0x115')](db[_0x87e0('0xff')],{'as':_0x87e0('0x145')});db['WhatsappAccount'][_0x87e0('0x122')](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166')});db['WhatsappAccount'][_0x87e0('0x122')](db[_0x87e0('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0x87e0('0x152')});db[_0x87e0('0xfe')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':_0x87e0('0x1f8')});db[_0x87e0('0xff')]['belongsTo'](db['User'],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0xff')]['belongsTo'](db['WhatsappQueue'],{'onDelete':_0x87e0('0x15f')});db[_0x87e0('0xff')][_0x87e0('0x122')](db[_0x87e0('0xfe')],{'onDelete':'restrict'});db[_0x87e0('0xff')]['belongsTo'](db[_0x87e0('0x150')],{'onDelete':'restrict','foreignKey':_0x87e0('0x151')});db[_0x87e0('0xff')][_0x87e0('0x122')](db['Tag'],{'onDelete':_0x87e0('0x15f'),'foreignKey':_0x87e0('0x17b')});db['WhatsappInteraction'][_0x87e0('0x115')](db[_0x87e0('0x102')],{'as':_0x87e0('0x156'),'onDelete':'cascade','foreignKey':_0x87e0('0x1f9')});db[_0x87e0('0x100')][_0x87e0('0x122')](db['WhatsappAccount'],{'as':_0x87e0('0x16a'),'foreignKey':_0x87e0('0x1f7')});db['WhatsappInteraction'][_0x87e0('0x122')](db['CmContact'],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x100')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':'Owner','foreignKey':_0x87e0('0x112')});db['WhatsappInteraction'][_0x87e0('0x124')](db[_0x87e0('0x92')],{'through':_0x87e0('0x1fa'),'as':'Tags'});db['WhatsappInteraction'][_0x87e0('0x124')](db['Tag'],{'through':_0x87e0('0x1fa'),'as':_0x87e0('0x16e')});db[_0x87e0('0x100')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x16f'),'through':_0x87e0('0x12e'),'foreignKey':_0x87e0('0x1f9')});db[_0x87e0('0x102')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'as':_0x87e0('0x12')});db[_0x87e0('0x102')][_0x87e0('0x122')](db['CmContact'],{'onDelete':'cascade','as':_0x87e0('0x16b')});db[_0x87e0('0x102')][_0x87e0('0x122')](db[_0x87e0('0x100')],{'onDelete':_0x87e0('0x111'),'as':'Interaction','foreignKey':_0x87e0('0x1f9')});db[_0x87e0('0x102')][_0x87e0('0x122')](db[_0x87e0('0xfe')],{'as':'Account','foreignKey':_0x87e0('0x1f7')});db[_0x87e0('0x104')][_0x87e0('0x122')](db[_0x87e0('0xfe')],{});db[_0x87e0('0x104')]['belongsTo'](db[_0x87e0('0xf6')],{'as':_0x87e0('0x179'),'foreignKey':_0x87e0('0x166')});db[_0x87e0('0x104')][_0x87e0('0x122')](db[_0x87e0('0x126')],{'as':_0x87e0('0x16b'),'foreignKey':_0x87e0('0x17d')});db[_0x87e0('0x104')][_0x87e0('0x122')](db[_0x87e0('0x100')],{});db[_0x87e0('0x104')]['belongsTo'](db[_0x87e0('0x108')],{});db[_0x87e0('0x104')][_0x87e0('0x122')](db[_0x87e0('0x102')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x87e0('0x12')],{});db[_0x87e0('0x106')][_0x87e0('0x122')](db[_0x87e0('0x102')],{});db['WhatsappTransferReport'][_0x87e0('0x122')](db['WhatsappInteraction'],{});db[_0x87e0('0x106')]['belongsTo'](db[_0x87e0('0xfe')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x87e0('0x106')][_0x87e0('0x122')](db[_0x87e0('0xfe')],{'foreignKey':'ToWhatsappAccountId','as':_0x87e0('0x1e3')});db[_0x87e0('0x106')][_0x87e0('0x122')](db[_0x87e0('0x108')],{'foreignKey':_0x87e0('0x1fb'),'as':_0x87e0('0x1e1')});db[_0x87e0('0x106')][_0x87e0('0x122')](db['User'],{'foreignKey':_0x87e0('0x1dd'),'as':_0x87e0('0x1de')});db[_0x87e0('0x106')][_0x87e0('0x122')](db[_0x87e0('0x12')],{'foreignKey':_0x87e0('0x1df'),'as':_0x87e0('0x1e6')});db[_0x87e0('0x108')][_0x87e0('0x124')](db[_0x87e0('0x12')],{'as':_0x87e0('0x154'),'through':_0x87e0('0x39'),'foreignKey':'WhatsappQueueId'});db[_0x87e0('0x108')][_0x87e0('0x124')](db['Team'],{'through':_0x87e0('0x1d7'),'as':'Teams'});db[_0x87e0('0x10f')][_0x87e0('0x122')](db['User'],{'as':'user','foreignKey':_0x87e0('0x112'),'onDelete':_0x87e0('0x111'),'hooks':!![]});db[_0x87e0('0x15d')]['hasOne'](db[_0x87e0('0xca')],{'as':'Dynamics365Account','onDelete':_0x87e0('0x15f')});db[_0x87e0('0x15d')][_0x87e0('0x113')](db['MailServerIn'],{'as':_0x87e0('0x160'),'onDelete':'restrict'});db[_0x87e0('0x15d')][_0x87e0('0x113')](db['MailServerOut'],{'as':_0x87e0('0x1fc'),'onDelete':_0x87e0('0x15f')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 5c16af2..8a76142 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4383=['./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.1.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/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/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/webbar'];(function(_0xaa2d94,_0x5dbc72){var _0xa52e81=function(_0x1b1adc){while(--_0x1b1adc){_0xaa2d94['push'](_0xaa2d94['shift']());}};_0xa52e81(++_0x5dbc72);}(_0x4383,0x122));var _0x3438=function(_0x1369a7,_0x252150){_0x1369a7=_0x1369a7-0x0;var _0x52322d=_0x4383[_0x1369a7];return _0x52322d;};'use strict';var path=require('path');var express=require(_0x3438('0x0'));var errors=require(_0x3438('0x1'));var config=require(_0x3438('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0x3438('0x3')];var clientSideLogs=require(_0x3438('0x4'));exports[_0x3438('0x5')]=function(_0x438481){return setupLoggers(_0x438481)[_0x3438('0x6')](function(){_0x438481['use'](_0x3438('0x7'),require(_0x3438('0x8')));_0x438481[_0x3438('0x9')](_0x3438('0xa'),require(_0x3438('0xb')));_0x438481[_0x3438('0x9')](_0x3438('0xc'),require('./api/voiceContext'));_0x438481[_0x3438('0x9')]('/api/voice/extensions',require('./api/voiceExtension'));_0x438481['use'](_0x3438('0xd'),require(_0x3438('0xe')));_0x438481['use']('/api/voice/queues',require(_0x3438('0xf')));_0x438481['use'](_0x3438('0x10'),require(_0x3438('0x11')));_0x438481[_0x3438('0x9')](_0x3438('0x12'),require(_0x3438('0x13')));_0x438481[_0x3438('0x9')](_0x3438('0x14'),require(_0x3438('0x15')));_0x438481[_0x3438('0x9')]('/api/voice/mails/messages',require(_0x3438('0x16')));_0x438481[_0x3438('0x9')](_0x3438('0x17'),require(_0x3438('0x18')));_0x438481['use'](_0x3438('0x19'),require(_0x3438('0x1a')));_0x438481['use'](_0x3438('0x1b'),require('./api/voiceAgentReport'));_0x438481[_0x3438('0x9')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x438481[_0x3438('0x9')](_0x3438('0x1c'),require(_0x3438('0x1d')));_0x438481['use']('/api/trunks',require(_0x3438('0x1e')));_0x438481[_0x3438('0x9')](_0x3438('0x1f'),require(_0x3438('0x20')));_0x438481[_0x3438('0x9')]('/api/mail/out_servers',require(_0x3438('0x21')));_0x438481[_0x3438('0x9')](_0x3438('0x22'),require(_0x3438('0x23')));_0x438481['use'](_0x3438('0x24'),require(_0x3438('0x25')));_0x438481[_0x3438('0x9')](_0x3438('0x26'),require(_0x3438('0x27')));_0x438481[_0x3438('0x9')](_0x3438('0x28'),require(_0x3438('0x29')));_0x438481[_0x3438('0x9')](_0x3438('0x2a'),require(_0x3438('0x2b')));_0x438481['use']('/api/mail/applications',require(_0x3438('0x2c')));_0x438481[_0x3438('0x9')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x438481[_0x3438('0x9')](_0x3438('0x2d'),require(_0x3438('0x2e')));_0x438481[_0x3438('0x9')]('/api/dashboards/items',require(_0x3438('0x2f')));_0x438481[_0x3438('0x9')](_0x3438('0x30'),require(_0x3438('0x31')));_0x438481['use'](_0x3438('0x32'),require('./api/faxApplication'));_0x438481[_0x3438('0x9')](_0x3438('0x33'),require(_0x3438('0x34')));_0x438481[_0x3438('0x9')](_0x3438('0x35'),require(_0x3438('0x36')));_0x438481[_0x3438('0x9')](_0x3438('0x37'),require(_0x3438('0x38')));_0x438481[_0x3438('0x9')](_0x3438('0x39'),require(_0x3438('0x3a')));_0x438481[_0x3438('0x9')](_0x3438('0x3b'),require(_0x3438('0x3c')));_0x438481[_0x3438('0x9')](_0x3438('0x3d'),require(_0x3438('0x3e')));_0x438481[_0x3438('0x9')](_0x3438('0x3f'),require(_0x3438('0x40')));_0x438481[_0x3438('0x9')]('/api/sms/messages',require(_0x3438('0x41')));_0x438481[_0x3438('0x9')](_0x3438('0x42'),require(_0x3438('0x43')));_0x438481['use'](_0x3438('0x44'),require(_0x3438('0x45')));_0x438481[_0x3438('0x9')](_0x3438('0x46'),require(_0x3438('0x47')));_0x438481[_0x3438('0x9')](_0x3438('0x48'),require(_0x3438('0x49')));_0x438481[_0x3438('0x9')]('/api/openchannel/messages',require(_0x3438('0x4a')));_0x438481['use'](_0x3438('0x4b'),require(_0x3438('0x4c')));_0x438481[_0x3438('0x9')](_0x3438('0x4d'),require(_0x3438('0x4e')));_0x438481[_0x3438('0x9')](_0x3438('0x4f'),require(_0x3438('0x50')));_0x438481[_0x3438('0x9')](_0x3438('0x51'),require('./api/chatApplication'));_0x438481['use'](_0x3438('0x52'),require(_0x3438('0x53')));_0x438481['use']('/api/chat/messages',require(_0x3438('0x54')));_0x438481[_0x3438('0x9')](_0x3438('0x55'),require('./api/chatOfflineMessage'));_0x438481[_0x3438('0x9')](_0x3438('0x56'),require('./api/chatQueue'));_0x438481[_0x3438('0x9')](_0x3438('0x57'),require(_0x3438('0x58')));_0x438481[_0x3438('0x9')](_0x3438('0x59'),require(_0x3438('0x5a')));_0x438481[_0x3438('0x9')](_0x3438('0x5b'),require(_0x3438('0x5c')));_0x438481[_0x3438('0x9')](_0x3438('0x5d'),require(_0x3438('0x5e')));_0x438481[_0x3438('0x9')](_0x3438('0x5f'),require('./api/cmHopper'));_0x438481['use'](_0x3438('0x60'),require('./api/cmHopperBlack'));_0x438481[_0x3438('0x9')](_0x3438('0x61'),require(_0x3438('0x62')));_0x438481[_0x3438('0x9')]('/api/cm/hopper_history',require(_0x3438('0x63')));_0x438481[_0x3438('0x9')](_0x3438('0x64'),require(_0x3438('0x65')));_0x438481[_0x3438('0x9')]('/api/actions',require('./api/action'));_0x438481[_0x3438('0x9')](_0x3438('0x66'),require(_0x3438('0x67')));_0x438481[_0x3438('0x9')]('/api/canned_answers',require(_0x3438('0x68')));_0x438481[_0x3438('0x9')](_0x3438('0x69'),require(_0x3438('0x6a')));_0x438481['use'](_0x3438('0x6b'),require('./api/condition'));_0x438481[_0x3438('0x9')](_0x3438('0x6c'),require(_0x3438('0x6d')));_0x438481[_0x3438('0x9')](_0x3438('0x6e'),require(_0x3438('0x6f')));_0x438481[_0x3438('0x9')](_0x3438('0x70'),require('./api/cdr'));_0x438481[_0x3438('0x9')](_0x3438('0x71'),require('./api/voiceQueuesLog'));_0x438481[_0x3438('0x9')](_0x3438('0x72'),require(_0x3438('0x73')));_0x438481[_0x3438('0x9')]('/api/sounds',require(_0x3438('0x74')));_0x438481[_0x3438('0x9')]('/api/tags',require('./api/tag'));_0x438481[_0x3438('0x9')](_0x3438('0x75'),require('./api/contactItemType'));_0x438481['use'](_0x3438('0x76'),require(_0x3438('0x77')));_0x438481[_0x3438('0x9')](_0x3438('0x78'),require(_0x3438('0x79')));_0x438481[_0x3438('0x9')](_0x3438('0x7a'),require('./api/template'));_0x438481['use']('/api/triggers',require(_0x3438('0x7b')));_0x438481[_0x3438('0x9')](_0x3438('0x7c'),require(_0x3438('0x7d')));_0x438481['use'](_0x3438('0x7e'),require(_0x3438('0x7f')));_0x438481[_0x3438('0x9')](_0x3438('0x80'),require(_0x3438('0x81')));_0x438481['use'](_0x3438('0x82'),require('./api/analyticCustomReport'));_0x438481[_0x3438('0x9')](_0x3438('0x83'),require(_0x3438('0x84')));_0x438481[_0x3438('0x9')]('/api/analytics/extracted_reports',require(_0x3438('0x85')));_0x438481[_0x3438('0x9')]('/api/analytics/metrics',require(_0x3438('0x86')));_0x438481[_0x3438('0x9')](_0x3438('0x87'),require('./api/analyticFieldReport'));_0x438481['use']('/api/analytics/tree_reports',require(_0x3438('0x88')));_0x438481[_0x3438('0x9')]('/api/integrations/salesforce/accounts',require(_0x3438('0x89')));_0x438481['use']('/api/integrations/salesforce/configurations',require(_0x3438('0x8a')));_0x438481[_0x3438('0x9')](_0x3438('0x8b'),require(_0x3438('0x8c')));_0x438481[_0x3438('0x9')](_0x3438('0x8d'),require(_0x3438('0x8e')));_0x438481[_0x3438('0x9')](_0x3438('0x8f'),require(_0x3438('0x90')));_0x438481[_0x3438('0x9')]('/api/integrations/sugarcrm/fields',require(_0x3438('0x91')));_0x438481[_0x3438('0x9')]('/api/integrations/desk/accounts',require(_0x3438('0x92')));_0x438481[_0x3438('0x9')](_0x3438('0x93'),require(_0x3438('0x94')));_0x438481['use'](_0x3438('0x95'),require(_0x3438('0x96')));_0x438481[_0x3438('0x9')]('/api/integrations/zoho/accounts',require(_0x3438('0x97')));_0x438481[_0x3438('0x9')](_0x3438('0x98'),require(_0x3438('0x99')));_0x438481['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x438481[_0x3438('0x9')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x438481['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x438481['use'](_0x3438('0x9a'),require('./api/intZendeskField'));_0x438481[_0x3438('0x9')](_0x3438('0x9b'),require(_0x3438('0x9c')));_0x438481[_0x3438('0x9')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x438481[_0x3438('0x9')](_0x3438('0x9d'),require(_0x3438('0x9e')));_0x438481[_0x3438('0x9')](_0x3438('0x9f'),require(_0x3438('0xa0')));_0x438481[_0x3438('0x9')](_0x3438('0xa1'),require(_0x3438('0xa2')));_0x438481[_0x3438('0x9')]('/api/integrations/vtiger/fields',require(_0x3438('0xa3')));_0x438481['use'](_0x3438('0xa4'),require(_0x3438('0xa5')));_0x438481[_0x3438('0x9')](_0x3438('0xa6'),require(_0x3438('0xa7')));_0x438481[_0x3438('0x9')](_0x3438('0xa8'),require('./api/intServicenowField'));_0x438481[_0x3438('0x9')](_0x3438('0xa9'),require('./api/intDynamics365Account'));_0x438481[_0x3438('0x9')](_0x3438('0xaa'),require('./api/intDynamics365Configuration'));_0x438481['use'](_0x3438('0xab'),require(_0x3438('0xac')));_0x438481[_0x3438('0x9')](_0x3438('0xad'),require(_0x3438('0xae')));_0x438481[_0x3438('0x9')]('/api/integrations/freshsales/configurations',require(_0x3438('0xaf')));_0x438481[_0x3438('0x9')](_0x3438('0xb0'),require(_0x3438('0xb1')));_0x438481[_0x3438('0x9')](_0x3438('0xb2'),require(_0x3438('0xb3')));_0x438481[_0x3438('0x9')](_0x3438('0xb4'),require('./api/chatQueueReport'));_0x438481[_0x3438('0x9')](_0x3438('0xb5'),require(_0x3438('0xb6')));_0x438481[_0x3438('0x9')](_0x3438('0xb7'),require(_0x3438('0xb8')));_0x438481['use'](_0x3438('0xb9'),require(_0x3438('0xba')));_0x438481['use'](_0x3438('0xbb'),require('./api/jscriptySessionReport'));_0x438481[_0x3438('0x9')](_0x3438('0xbc'),require(_0x3438('0xbd')));_0x438481[_0x3438('0x9')](_0x3438('0xbe'),require(_0x3438('0xbf')));_0x438481[_0x3438('0x9')](_0x3438('0xc0'),require('./api/squareReportDetail'));_0x438481[_0x3438('0x9')](_0x3438('0xc1'),require(_0x3438('0xc2')));_0x438481[_0x3438('0x9')](_0x3438('0xc3'),require(_0x3438('0xc4')));_0x438481[_0x3438('0x9')](_0x3438('0xc5'),require(_0x3438('0xc6')));_0x438481[_0x3438('0x9')](_0x3438('0xc7'),require(_0x3438('0xc8')));_0x438481['use'](_0x3438('0xc9'),require(_0x3438('0xca')));_0x438481[_0x3438('0x9')](_0x3438('0xcb'),require(_0x3438('0xcc')));_0x438481[_0x3438('0x9')]('/api/teams',require(_0x3438('0xcd')));_0x438481[_0x3438('0x9')](_0x3438('0xce'),require(_0x3438('0xcf')));_0x438481[_0x3438('0x9')]('/api/campaigns',require(_0x3438('0xd0')));_0x438481[_0x3438('0x9')]('/api/migrations',require(_0x3438('0xd1')));_0x438481[_0x3438('0x9')](_0x3438('0xd2'),require(_0x3438('0xd3')));_0x438481[_0x3438('0x9')](_0x3438('0xd4'),require(_0x3438('0xd5')));_0x438481[_0x3438('0x9')]('/api/mail/reports/transfer',require(_0x3438('0xd6')));_0x438481[_0x3438('0x9')]('/api/chat/reports/transfer',require(_0x3438('0xd7')));_0x438481[_0x3438('0x9')]('/api/fax/reports/transfer',require(_0x3438('0xd8')));_0x438481[_0x3438('0x9')]('/api/openchannel/reports/transfer',require(_0x3438('0xd9')));_0x438481[_0x3438('0x9')](_0x3438('0xda'),require(_0x3438('0xdb')));_0x438481[_0x3438('0x9')](_0x3438('0xdc'),require(_0x3438('0xdd')));_0x438481[_0x3438('0x9')](_0x3438('0xde'),require(_0x3438('0xdf')));_0x438481[_0x3438('0x9')]('/api/userProfiles',require(_0x3438('0xe0')));_0x438481[_0x3438('0x9')]('/api/userProfile/sections',require(_0x3438('0xe1')));_0x438481['use']('/api/userProfile/resources',require('./api/userProfileResource'));_0x438481[_0x3438('0x9')]('/api/userNotifications',require(_0x3438('0xe2')));_0x438481[_0x3438('0x9')](_0x3438('0xe3'),require('./api/whatsappAccount'));_0x438481[_0x3438('0x9')](_0x3438('0xe4'),require('./api/whatsappApplication'));_0x438481[_0x3438('0x9')]('/api/whatsapp/interactions',require(_0x3438('0xe5')));_0x438481[_0x3438('0x9')](_0x3438('0xe6'),require(_0x3438('0xe7')));_0x438481['use'](_0x3438('0xe8'),require(_0x3438('0xe9')));_0x438481[_0x3438('0x9')](_0x3438('0xea'),require(_0x3438('0xeb')));_0x438481['use'](_0x3438('0xec'),require('./api/whatsappQueue'));_0x438481['use'](_0x3438('0xed'),require(_0x3438('0xee')));_0x438481['use'](_0x3438('0xef'),require('./api/realtime'));_0x438481['use'](_0x3438('0xf0'),require(_0x3438('0xf1')));_0x438481['use']('/api/auth/local',require(_0x3438('0xf2')));_0x438481[_0x3438('0x9')](_0x3438('0xf3'),require(_0x3438('0xf4')));_0x438481[_0x3438('0x9')]('/api/auth/activedirectory',require(_0x3438('0xf5')));_0x438481['use'](_0x3438('0xf6'),require('./api/jira'));_0x438481['use'](_0x3438('0xf7'),require(_0x3438('0xf8')));_0x438481['use'](_0x3438('0xf9'),require(_0x3438('0xfa')));_0x438481['use'](_0x3438('0xfb'),require(_0x3438('0xfc')));_0x438481[_0x3438('0x9')]('/api/pm2',require('./api/pm2'));_0x438481[_0x3438('0x9')](_0x3438('0xfd'),require(_0x3438('0xfe')));_0x438481['use'](_0x3438('0xff'),clientSideLogs);_0x438481[_0x3438('0x9')](_0x3438('0x100'),express[_0x3438('0x101')](path[_0x3438('0x102')](config[_0x3438('0x103')],_0x3438('0x100'))));_0x438481['use'](_0x3438('0x104'),express['static'](path[_0x3438('0x102')](config[_0x3438('0x103')],_0x3438('0x104'))));_0x438481[_0x3438('0x9')]('/demo',express[_0x3438('0x101')](path[_0x3438('0x102')](config['root'],_0x3438('0x105'))));_0x438481[_0x3438('0x9')](_0x3438('0x106'),express[_0x3438('0x101')](path[_0x3438('0x102')](config[_0x3438('0x103')],'snippet',_0x3438('0x107'))));_0x438481[_0x3438('0x9')](_0x3438('0x108'),express[_0x3438('0x101')](path[_0x3438('0x102')](config['root'],'/server/files/plugins')));_0x438481[_0x3438('0x109')](_0x3438('0x10a'))[_0x3438('0x10b')](errors[0x194]);_0x438481[_0x3438('0x109')]('/*')['get'](function(_0x1c5e6b,_0x7a724c){_0x7a724c[_0x3438('0x10c')](path[_0x3438('0x10d')](_0x438481[_0x3438('0x10b')](_0x3438('0x10e'))+_0x3438('0x10f')));});return _0x438481;});}; \ No newline at end of file +var _0x5d6b=['/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','join','/apidoc','/www','static','root','/demo','/snippet','/plugins','route','get','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','./api/smsMessage'];(function(_0x32766f,_0x11188c){var _0x5dfec0=function(_0x1412c4){while(--_0x1412c4){_0x32766f['push'](_0x32766f['shift']());}};_0x5dfec0(++_0x11188c);}(_0x5d6b,0xc9));var _0xb5d6=function(_0x2ce596,_0x10313b){_0x2ce596=_0x2ce596-0x0;var _0x2e65a4=_0x5d6b[_0x2ce596];return _0x2e65a4;};'use strict';var path=require(_0xb5d6('0x0'));var express=require(_0xb5d6('0x1'));var errors=require(_0xb5d6('0x2'));var config=require(_0xb5d6('0x3'));var setupLoggers=require(_0xb5d6('0x4'))[_0xb5d6('0x5')];var clientSideLogs=require(_0xb5d6('0x6'));exports[_0xb5d6('0x7')]=function(_0x37b45a){return setupLoggers(_0x37b45a)[_0xb5d6('0x8')](function(){_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xa'),require(_0xb5d6('0xb')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xc'),require(_0xb5d6('0xd')));_0x37b45a['use'](_0xb5d6('0xe'),require('./api/voiceContext'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xf'),require(_0xb5d6('0x10')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x11'),require(_0xb5d6('0x12')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x13'),require(_0xb5d6('0x14')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x15'),require(_0xb5d6('0x16')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x17'),require('./api/screenRecording'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x18'),require(_0xb5d6('0x19')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x1a'),require(_0xb5d6('0x1b')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x1c'),require(_0xb5d6('0x1d')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x1e'),require(_0xb5d6('0x1f')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x20'),require(_0xb5d6('0x21')));_0x37b45a[_0xb5d6('0x9')]('/api/voice/queues/reports',require(_0xb5d6('0x22')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x23'),require(_0xb5d6('0x24')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x25'),require(_0xb5d6('0x26')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x27'),require(_0xb5d6('0x28')));_0x37b45a[_0xb5d6('0x9')]('/api/mail/out_servers',require(_0xb5d6('0x29')));_0x37b45a[_0xb5d6('0x9')]('/api/mail/accounts',require(_0xb5d6('0x2a')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x2b'),require(_0xb5d6('0x2c')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x2d'),require(_0xb5d6('0x2e')));_0x37b45a[_0xb5d6('0x9')]('/api/mail/interactions',require(_0xb5d6('0x2f')));_0x37b45a['use'](_0xb5d6('0x30'),require(_0xb5d6('0x31')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x32'),require('./api/mailApplication'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x33'),require(_0xb5d6('0x34')));_0x37b45a['use'](_0xb5d6('0x35'),require('./api/dashboard'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x36'),require(_0xb5d6('0x37')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x38'),require('./api/faxAccount'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x39'),require(_0xb5d6('0x3a')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x3b'),require('./api/faxInteraction'));_0x37b45a['use'](_0xb5d6('0x3c'),require('./api/faxMessage'));_0x37b45a['use'](_0xb5d6('0x3d'),require(_0xb5d6('0x3e')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x3f'),require(_0xb5d6('0x40')));_0x37b45a[_0xb5d6('0x9')]('/api/sms/accounts',require(_0xb5d6('0x41')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x42'),require('./api/smsApplication'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x43'),require('./api/smsInteraction'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x44'),require(_0xb5d6('0x45')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x46'),require(_0xb5d6('0x47')));_0x37b45a['use'](_0xb5d6('0x48'),require(_0xb5d6('0x49')));_0x37b45a[_0xb5d6('0x9')]('/api/openchannel/applications',require(_0xb5d6('0x4a')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x4b'),require('./api/openchannelInteraction'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x4c'),require(_0xb5d6('0x4d')));_0x37b45a[_0xb5d6('0x9')]('/api/openchannel/queues',require(_0xb5d6('0x4e')));_0x37b45a[_0xb5d6('0x9')]('/api/chat/websites',require(_0xb5d6('0x4f')));_0x37b45a['use'](_0xb5d6('0x50'),require(_0xb5d6('0x51')));_0x37b45a['use'](_0xb5d6('0x52'),require(_0xb5d6('0x53')));_0x37b45a[_0xb5d6('0x9')]('/api/chat/interactions',require(_0xb5d6('0x54')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x55'),require('./api/chatMessage'));_0x37b45a['use']('/api/chat/offline_messages',require(_0xb5d6('0x56')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x57'),require(_0xb5d6('0x58')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x59'),require(_0xb5d6('0x5a')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x5b'),require(_0xb5d6('0x5c')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x5d'),require(_0xb5d6('0x5e')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x5f'),require(_0xb5d6('0x60')));_0x37b45a[_0xb5d6('0x9')]('/api/cm/hopper',require(_0xb5d6('0x61')));_0x37b45a['use'](_0xb5d6('0x62'),require(_0xb5d6('0x63')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x64'),require('./api/cmHopperFinal'));_0x37b45a['use'](_0xb5d6('0x65'),require(_0xb5d6('0x66')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x67'),require(_0xb5d6('0x68')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x69'),require('./api/action'));_0x37b45a['use'](_0xb5d6('0x6a'),require(_0xb5d6('0x6b')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x6c'),require(_0xb5d6('0x6d')));_0x37b45a[_0xb5d6('0x9')]('/api/dispositions',require(_0xb5d6('0x6e')));_0x37b45a['use']('/api/conditions',require('./api/condition'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x6f'),require(_0xb5d6('0x70')));_0x37b45a['use'](_0xb5d6('0x71'),require(_0xb5d6('0x72')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x73'),require('./api/cdr'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x74'),require(_0xb5d6('0x75')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x76'),require(_0xb5d6('0x77')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x78'),require(_0xb5d6('0x79')));_0x37b45a['use']('/api/tags',require('./api/tag'));_0x37b45a['use']('/api/contact_item_types',require(_0xb5d6('0x7a')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x7b'),require(_0xb5d6('0x7c')));_0x37b45a['use'](_0xb5d6('0x7d'),require(_0xb5d6('0x7e')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x7f'),require(_0xb5d6('0x80')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x81'),require(_0xb5d6('0x82')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x83'),require(_0xb5d6('0x84')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x85'),require(_0xb5d6('0x86')));_0x37b45a['use']('/api/integrations/reports',require('./api/integrationReport'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x87'),require(_0xb5d6('0x88')));_0x37b45a['use'](_0xb5d6('0x89'),require('./api/analyticDefaultReport'));_0x37b45a[_0xb5d6('0x9')]('/api/analytics/extracted_reports',require(_0xb5d6('0x8a')));_0x37b45a[_0xb5d6('0x9')]('/api/analytics/metrics',require(_0xb5d6('0x8b')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x8c'),require(_0xb5d6('0x8d')));_0x37b45a[_0xb5d6('0x9')]('/api/analytics/tree_reports',require(_0xb5d6('0x8e')));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x37b45a['use'](_0xb5d6('0x8f'),require(_0xb5d6('0x90')));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x91'),require(_0xb5d6('0x92')));_0x37b45a['use']('/api/integrations/sugarcrm/fields',require(_0xb5d6('0x93')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x94'),require('./api/intDeskAccount'));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/desk/configurations',require(_0xb5d6('0x95')));_0x37b45a['use'](_0xb5d6('0x96'),require(_0xb5d6('0x97')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x98'),require(_0xb5d6('0x99')));_0x37b45a['use'](_0xb5d6('0x9a'),require('./api/intZohoConfiguration'));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x9b'),require(_0xb5d6('0x9c')));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/zendesk/configurations',require(_0xb5d6('0x9d')));_0x37b45a['use'](_0xb5d6('0x9e'),require(_0xb5d6('0x9f')));_0x37b45a['use'](_0xb5d6('0xa0'),require(_0xb5d6('0xa1')));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/freshdesk/configurations',require(_0xb5d6('0xa2')));_0x37b45a['use'](_0xb5d6('0xa3'),require(_0xb5d6('0xa4')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xa5'),require('./api/intVtigerAccount'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xa6'),require(_0xb5d6('0xa7')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xa8'),require(_0xb5d6('0xa9')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xaa'),require('./api/intServicenowAccount'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xab'),require(_0xb5d6('0xac')));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/servicenow/fields',require(_0xb5d6('0xad')));_0x37b45a['use']('/api/integrations/dynamics365/accounts',require(_0xb5d6('0xae')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xaf'),require('./api/intDynamics365Configuration'));_0x37b45a[_0xb5d6('0x9')]('/api/integrations/dynamics365/fields',require(_0xb5d6('0xb0')));_0x37b45a['use'](_0xb5d6('0xb1'),require('./api/intFreshsalesAccount'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xb2'),require(_0xb5d6('0xb3')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xb4'),require('./api/intFreshsalesField'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xb5'),require('./api/network'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xb6'),require('./api/chatQueueReport'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xb7'),require(_0xb5d6('0xb8')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xb9'),require('./api/jscriptyAnswerReport'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xba'),require(_0xb5d6('0xbb')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xbc'),require(_0xb5d6('0xbd')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xbe'),require(_0xb5d6('0xbf')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xc0'),require('./api/squareReport'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xc1'),require(_0xb5d6('0xc2')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xc3'),require(_0xb5d6('0xc4')));_0x37b45a['use'](_0xb5d6('0xc5'),require(_0xb5d6('0xc6')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xc7'),require(_0xb5d6('0xc8')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xc9'),require(_0xb5d6('0xca')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xcb'),require(_0xb5d6('0xcc')));_0x37b45a['use'](_0xb5d6('0xcd'),require('./api/squareMessage'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xce'),require(_0xb5d6('0xcf')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xd0'),require('./api/license'));_0x37b45a['use'](_0xb5d6('0xd1'),require('./api/campaign'));_0x37b45a['use']('/api/migrations',require(_0xb5d6('0xd2')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xd3'),require(_0xb5d6('0xd4')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xd5'),require(_0xb5d6('0xd6')));_0x37b45a['use']('/api/mail/reports/transfer',require(_0xb5d6('0xd7')));_0x37b45a['use']('/api/chat/reports/transfer',require(_0xb5d6('0xd8')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xd9'),require(_0xb5d6('0xda')));_0x37b45a['use']('/api/openchannel/reports/transfer',require(_0xb5d6('0xdb')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xdc'),require('./api/smsTransferReport'));_0x37b45a['use'](_0xb5d6('0xdd'),require(_0xb5d6('0xde')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xdf'),require('./api/voicePrefix'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xe0'),require(_0xb5d6('0xe1')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xe2'),require('./api/userProfileSection'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xe3'),require(_0xb5d6('0xe4')));_0x37b45a[_0xb5d6('0x9')]('/api/userNotifications',require('./api/userNotification'));_0x37b45a['use'](_0xb5d6('0xe5'),require(_0xb5d6('0xe6')));_0x37b45a['use']('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xe7'),require('./api/whatsappInteraction'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xe8'),require(_0xb5d6('0xe9')));_0x37b45a[_0xb5d6('0x9')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xea'),require(_0xb5d6('0xeb')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xec'),require('./api/whatsappQueue'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xed'),require(_0xb5d6('0xee')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xef'),require('./api/realtime'));_0x37b45a[_0xb5d6('0x9')]('/api/user-settings',require(_0xb5d6('0xf0')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xf1'),require(_0xb5d6('0xf2')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xf3'),require(_0xb5d6('0xf4')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xf5'),require(_0xb5d6('0xf6')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xf7'),require(_0xb5d6('0xf8')));_0x37b45a['use'](_0xb5d6('0xf9'),require(_0xb5d6('0xfa')));_0x37b45a['use'](_0xb5d6('0xfb'),require(_0xb5d6('0xfc')));_0x37b45a['use'](_0xb5d6('0xfd'),require(_0xb5d6('0xfe')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0xff'),require(_0xb5d6('0x100')));_0x37b45a['use'](_0xb5d6('0x101'),require('./api/webbar'));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x102'),clientSideLogs);_0x37b45a[_0xb5d6('0x9')]('/apidoc',express['static'](path[_0xb5d6('0x103')](config['root'],_0xb5d6('0x104'))));_0x37b45a['use'](_0xb5d6('0x105'),express[_0xb5d6('0x106')](path[_0xb5d6('0x103')](config[_0xb5d6('0x107')],'/www')));_0x37b45a['use'](_0xb5d6('0x108'),express[_0xb5d6('0x106')](path[_0xb5d6('0x103')](config[_0xb5d6('0x107')],'/demo')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x109'),express[_0xb5d6('0x106')](path[_0xb5d6('0x103')](config['root'],'snippet','3.1.0')));_0x37b45a[_0xb5d6('0x9')](_0xb5d6('0x10a'),express[_0xb5d6('0x106')](path[_0xb5d6('0x103')](config[_0xb5d6('0x107')],'/server/files/plugins')));_0x37b45a[_0xb5d6('0x10b')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xb5d6('0x10c')](errors[0x194]);_0x37b45a[_0xb5d6('0x10b')]('/*')[_0xb5d6('0x10c')](function(_0x611c83,_0x1a87cf){_0x1a87cf['sendFile'](path[_0xb5d6('0x10d')](_0x37b45a[_0xb5d6('0x10c')]('appPath')+_0xb5d6('0x10e')));});return _0x37b45a;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 5928473..f0720a6 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x293a=['../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','port','rpc','localhost','error','listen','log','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceAgentReport/voiceAgentReport.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/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc'];(function(_0x1af92c,_0x1e6f9d){var _0x387bc5=function(_0x184431){while(--_0x184431){_0x1af92c['push'](_0x1af92c['shift']());}};_0x387bc5(++_0x1e6f9d);}(_0x293a,0xa6));var _0xa293=function(_0x58d3c5,_0x5865c6){_0x58d3c5=_0x58d3c5-0x0;var _0x4722f8=_0x293a[_0x58d3c5];return _0x4722f8;};'use strict';var jayson=require(_0xa293('0x0'));var _=require(_0xa293('0x1'));var config=require(_0xa293('0x2'));exports['listen']=function(){return new Promise(function(_0x574568,_0x11535e){var _0x2b7402={};_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x4')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x5')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceQueue/voiceQueue.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceRecording/voiceRecording.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x6')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x7')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x8')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x9')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0xa')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0xb')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0xc')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/mailAccount/mailAccount.rpc'));_0x2b7402=_['merge'](_0x2b7402,require('../api/mailQueue/mailQueue.rpc'));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0xd')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0xe')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0xf')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x10')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x11')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x12')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/faxMessage/faxMessage.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x13')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x14')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x15')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/smsInteraction/smsInteraction.rpc'));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x16')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x17')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x18')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x19')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1a')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x1b')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1c')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/chatInteraction/chatInteraction.rpc'));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x1d')));_0x2b7402=_['merge'](_0x2b7402,require('../api/chatQueue/chatQueue.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1e')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/cmHopper/cmHopper.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1f')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x20')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x21')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/interval/interval.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x22')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x23')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x24')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x25')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x26')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/variable/variable.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x27')));_0x2b7402=_['merge'](_0x2b7402,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x28')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x29')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2a')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2b')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2c')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x2d')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2e')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2f')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x30')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/squareReport/squareReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x31')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x32')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x33')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x34')));_0x2b7402=_['merge'](_0x2b7402,require('../api/squareRecording/squareRecording.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x35')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x36')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x37')));_0x2b7402=_['merge'](_0x2b7402,require('../api/plugin/plugin.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x38')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x39')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x3a')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x3b')));_0x2b7402=_['merge'](_0x2b7402,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4a280e=jayson[_0xa293('0x3c')](_0x2b7402)['http']();var _0x3cd247=config['rpc'][_0xa293('0x3d')]||config[_0xa293('0x3d')]+0x1;var _0x34489d=config[_0xa293('0x3e')]['ip']||_0xa293('0x3f');_0x4a280e['on'](_0xa293('0x40'),function(_0x1d2e1a){return _0x11535e(_0x1d2e1a);});_0x4a280e[_0xa293('0x41')](_0x3cd247,_0x34489d,function(){console[_0xa293('0x42')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x34489d,_0x3cd247);require('../config/triggers')['default']();return _0x574568(_0xa293('0x43')+_0x34489d+':'+_0x3cd247);});});}; \ No newline at end of file +var _0x5a43=['../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc'];(function(_0x3ee35a,_0x4e2bc5){var _0x118dfc=function(_0x14efbb){while(--_0x14efbb){_0x3ee35a['push'](_0x3ee35a['shift']());}};_0x118dfc(++_0x4e2bc5);}(_0x5a43,0xd0));var _0x35a4=function(_0x2b0266,_0x10417d){_0x2b0266=_0x2b0266-0x0;var _0x5c81a7=_0x5a43[_0x2b0266];return _0x5c81a7;};'use strict';var jayson=require(_0x35a4('0x0'));var _=require(_0x35a4('0x1'));var config=require(_0x35a4('0x2'));exports[_0x35a4('0x3')]=function(){return new Promise(function(_0x53bd35,_0x1528ee){var _0x58c390={};_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x4')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x5')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x7')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x8')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x9')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0xa')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0xb')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0xc')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/trunk/trunk.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0xd')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0xe')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0xf')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x10')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/mailInteraction/mailInteraction.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x11')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x12')));_0x58c390=_['merge'](_0x58c390,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x13')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x14')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x15')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/faxMessage/faxMessage.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x16')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x17')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/smsAccount/smsAccount.rpc'));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x18')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x19')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x1a')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x1b')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x1c')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x1d')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x1e')));_0x58c390=_['merge'](_0x58c390,require('../api/chatInteraction/chatInteraction.rpc'));_0x58c390=_['merge'](_0x58c390,require('../api/chatMessage/chatMessage.rpc'));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x1f')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x20')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x21')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x22')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x23')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x24')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/pause/pause.rpc'));_0x58c390=_['merge'](_0x58c390,require('../api/sound/sound.rpc'));_0x58c390=_['merge'](_0x58c390,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x25')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x26')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x27')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x28')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x29')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x2a')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x2b')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x2c')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x2d')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x2e')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x2f')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x30')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x31')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x32')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x33')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x34')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x35')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/squareOdbc/squareOdbc.rpc'));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x36')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x37')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x38')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x39')));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x3a')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/plugin/plugin.rpc'));_0x58c390=_['merge'](_0x58c390,require(_0x35a4('0x3b')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x3c')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x3d')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require(_0x35a4('0x3e')));_0x58c390=_[_0x35a4('0x6')](_0x58c390,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x49814b=jayson['server'](_0x58c390)[_0x35a4('0x3f')]();var _0x588660=config[_0x35a4('0x40')]['port']||config[_0x35a4('0x41')]+0x1;var _0xcf6eb9=config[_0x35a4('0x40')]['ip']||_0x35a4('0x42');_0x49814b['on'](_0x35a4('0x43'),function(_0x2287f8){return _0x1528ee(_0x2287f8);});_0x49814b[_0x35a4('0x3')](_0x588660,_0xcf6eb9,function(){console[_0x35a4('0x44')](_0x35a4('0x45'),_0xcf6eb9,_0x588660);require(_0x35a4('0x46'))[_0x35a4('0x47')]();return _0x53bd35('RPC\x20listening\x20on\x20'+_0xcf6eb9+':'+_0x588660);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c8adc7d..fb4924f 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 _0xb8bd=['SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','toLowerCase','hangup','emit','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setVariable','isBoolean','isNumber'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb8bd,0x100));var _0xdb8b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb8bd[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0xdb8b('0x0'));var _=require(_0xdb8b('0x1'));var EventEmitter=require(_0xdb8b('0x2'))[_0xdb8b('0x3')];var AGIReply=require(_0xdb8b('0x4'));var AGIError=require(_0xdb8b('0x5'));function AGIChannel(_0x55dc66){var _0x896e16=this,_0x555ee5=new AGIReply(),_0x4b6c92=![],_0x4b183a={};EventEmitter['call'](_0x896e16);_0x55dc66[_0xdb8b('0x6')](_0xdb8b('0x7'));_0x55dc66[_0xdb8b('0x8')](0x8*0x3c*0x3c*0x3e8);_0x555ee5[_0xdb8b('0x6')](_0xdb8b('0x7'));_0x555ee5['on'](_0xdb8b('0x9'),function(_0x663eb6){for(var _0x2514c6 in _0x663eb6){_0x896e16[_0x2514c6]=_0x663eb6[_0x2514c6];}_0x896e16['emit']('ready');});_0x555ee5['on']('line',function(_0x1da0f3){if(_0x1da0f3[_0xdb8b('0xa')]()==_0xdb8b('0xb')){_0x896e16[_0xdb8b('0xc')]('hangup');return;}if(_0x1da0f3[_0xdb8b('0xd')](0x0,0xb)==_0xdb8b('0xe')){_0x4b6c92=!![];}if(_0x4b6c92){_0x4b183a['rx']+=_0x1da0f3+'\x0a';if(_0x1da0f3[_0xdb8b('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x4b6c92=![];}}else{_0x4b183a['rx']=_0x1da0f3;}if(_0x4b6c92){return;}if(typeof _0x4b183a['cb']==_0xdb8b('0x10')){var _0x36b6ce=_0x4b183a['rx'][_0xdb8b('0xd')](0x0,0x3),_0x1af6ec=null,_0x31f914=null;_0x36b6ce=parseInt(_0x36b6ce);if(isNaN(_0x36b6ce)){_0x4b183a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xdb8b('0x11')});return;}if(_0x36b6ce!=0xc8){_0x4b183a['cb'](null,{'code':_0x36b6ce,'result':-0x1,'extra':'KO'});return;}_0x1af6ec=_0x4b183a['rx'][_0xdb8b('0xd')](0x4)[_0xdb8b('0x12')](_0xdb8b('0x13'),'');if(_0x1af6ec[_0xdb8b('0x14')]('\x20')!=-0x1){_0x1af6ec=_0x1af6ec[_0xdb8b('0x15')](0x0,_0x1af6ec[_0xdb8b('0x14')]('\x20'));}if(_[_0xdb8b('0x16')](_0x1af6ec,'-1')){_0x1af6ec=parseInt(_0x1af6ec);}_0x31f914=_0x4b183a['rx']['split']('\x20');if(_0x31f914[_0xdb8b('0x17')]==0x3){_0x31f914=_0x31f914[0x2][_0xdb8b('0xd')](0x1,_0x31f914[0x2]['length']-0x1);}else if(_0x31f914[_0xdb8b('0x17')]>0x3){var _0x44a0bd=/\((.+)\)/;var _0x87d278=_0x4b183a['rx'][_0xdb8b('0x18')](_0x44a0bd);if(_0x87d278){_0x31f914=_0x87d278[0x1];}else{_0x31f914=null;}}else{_0x31f914=null;}_0x4b183a['cb'](null,{'code':_0x36b6ce,'result':_0x1af6ec,'extra':_0x31f914});}});_0x55dc66['on'](_0xdb8b('0x19'),function(_0x37617e){_0x896e16[_0xdb8b('0xc')](_0xdb8b('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x37617e[_0xdb8b('0x1a')]));});_0x55dc66['on'](_0xdb8b('0x1b'),function(){_0x896e16[_0xdb8b('0xc')](_0xdb8b('0x1b'),new AGIError(_0xdb8b('0x1c')));});_0x55dc66['on'](_0xdb8b('0x1d'),function(){_0x896e16[_0xdb8b('0xc')]('timeout',new AGIError(_0xdb8b('0x1e')));_0x55dc66[_0xdb8b('0x1f')]();});_0x55dc66[_0xdb8b('0x20')](_0x555ee5);this[_0xdb8b('0x21')]=function(_0x4368cd,_0x2af7f5){var _0x4368cd=_0x4368cd||'',_0x2af7f5=typeof _0x2af7f5==_0xdb8b('0x10')?_0x2af7f5:new Function();_0x4b183a={'tx':_0x4368cd,'rx':'','cb':_0x2af7f5};_0x55dc66[_0xdb8b('0x22')](_0x4368cd+'\x0a');},this[_0xdb8b('0x1b')]=function(){_0x55dc66[_0xdb8b('0x1f')]();};}util[_0xdb8b('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x5db78f){return this[_0xdb8b('0x21')]['sync'](this,_0x5db78f);};AGIChannel[_0xdb8b('0x24')]['answer']=function(){return this[_0xdb8b('0x25')](_0xdb8b('0x26'));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x27')]=function(_0x2c5506,_0x1e27b7,_0x3526e6){_0x2c5506=_0x2c5506===undefined?_0xdb8b('0x28'):_0x2c5506;_0x1e27b7=_0x1e27b7===undefined?'5':_0x1e27b7;_0x3526e6=_0x3526e6===undefined?'1':_0x3526e6;return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x2a'),_0x2c5506,_0x1e27b7*0x3e8,_0x3526e6));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x2b')]=function(_0x40a754){_0x40a754=_0x40a754||'NO\x20MESSAGE';return this[_0xdb8b('0x25')](util['format'](_0xdb8b('0x2c'),_0x40a754));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x2d')]=function(_0x1b7607,_0x573d31){if(_[_0xdb8b('0x2e')](_0x573d31)){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x2f'),_0x1b7607,_0x573d31[_0xdb8b('0x30')](',')));}return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x2f'),_0x1b7607,_0x573d31));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x31')]=function(_0x300829){return this['sendRequest'](util['format'](_0xdb8b('0x32'),_0x300829));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x33')]=function(_0x4079ea){return this['sendRequest'](util[_0xdb8b('0x29')](_0xdb8b('0x34'),_0x4079ea));};AGIChannel['prototype']['setPriority']=function(_0x58d1aa){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')]('SET\x20PRIORITY\x20%s',_0x58d1aa));};AGIChannel[_0xdb8b('0x24')]['hangup']=function(){return this[_0xdb8b('0x25')]('HANGUP');};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x35')]=function(_0x578fb2,_0x429959){var _0x3ba70d=_[_0xdb8b('0x36')](_0x429959)||_[_0xdb8b('0x37')](_0x429959)?_0x429959['toString']():_0x429959;return this[_0xdb8b('0x25')](util['format'](_0xdb8b('0x38'),_0x578fb2,_0x3ba70d?_0x3ba70d['toString']()[_0xdb8b('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x39')]=function(_0x40ad3a,_0x4309d3){return this['sendRequest'](util['format'](_0xdb8b('0x3a'),_0x40ad3a,_0x4309d3));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x3b')]=function(_0xf9bae8,_0x5098fc){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x3c'),_0xf9bae8,_0x5098fc));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x3d')]=function(_0xf23bf3,_0x10e4ea){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xf23bf3,_0x10e4ea));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x3e')]=function(_0x46dbd7,_0x34becf,_0x1b1145){_0x34becf=_0x34becf||this[_0xdb8b('0x3f')];_0x1b1145=_0x1b1145||0x1;this[_0xdb8b('0x31')](_0x46dbd7);this['setExtension'](_0x34becf);this[_0xdb8b('0x40')](_0x1b1145);return this[_0xdb8b('0x2b')](util[_0xdb8b('0x29')](_0xdb8b('0x41'),_0x46dbd7,_0x34becf,_0x1b1145));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x42')]=function(_0x5e84f7){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x5e84f7));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x43')]=function(_0x2512d7,_0x923f80,_0x4794c3,_0x507609,_0x1cb3d9,_0x211820){_0x923f80=_0x923f80||_0xdb8b('0x44');_0x4794c3=_0x4794c3||'';_0x507609=_0x507609===undefined?-0x1:_0x507609==='-1'?-0x1:_0x507609*0x3e8;_0x1cb3d9=_0x1cb3d9===undefined?'':'s='+_0x1cb3d9;_0x211820=_0x211820?'BEEP':'';return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x45'),_0x2512d7,_0x923f80,_0x4794c3,_0x507609,_0x211820,_0x1cb3d9));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x46')]=function(_0x4c8a8f,_0x1d1106){_0x1d1106=_0x1d1106||'';return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x47'),_0x4c8a8f,_0x1d1106));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x48')]=function(_0x5a5c24){return this[_0xdb8b('0x2d')](_0xdb8b('0x49'),_0x5a5c24);};AGIChannel['prototype']['wait']=function(_0x58254d){return this[_0xdb8b('0x2d')](_0xdb8b('0x4a'),_0x58254d);};AGIChannel['prototype']['error']=function(_0x1a6038,_0x3864f4){this[_0xdb8b('0x2b')](util[_0xdb8b('0x29')](_0xdb8b('0x4b'),_0x1a6038['id'],_0x1a6038[_0xdb8b('0x4c')],_0x3864f4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xdb8b('0x4d')]=AGIChannel; \ No newline at end of file +var _0x9f53=['setPriority','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','toLowerCase','emit','hangup','search','substring','no\x20code','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','close','inherits','prototype','sendRequest','command','sync','answer','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','format','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9f53,0xfb));var _0x39f5=function(_0xc7fe63,_0x1a2229){_0xc7fe63=_0xc7fe63-0x0;var _0x1af54b=_0x9f53[_0xc7fe63];return _0x1af54b;};'use strict';var util=require(_0x39f5('0x0'));var _=require(_0x39f5('0x1'));var EventEmitter=require(_0x39f5('0x2'))['EventEmitter'];var AGIReply=require(_0x39f5('0x3'));var AGIError=require(_0x39f5('0x4'));function AGIChannel(_0x5743c4){var _0x27c9ab=this,_0x3e2258=new AGIReply(),_0xa78506=![],_0x2ae252={};EventEmitter[_0x39f5('0x5')](_0x27c9ab);_0x5743c4[_0x39f5('0x6')](_0x39f5('0x7'));_0x5743c4[_0x39f5('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3e2258[_0x39f5('0x6')]('utf8');_0x3e2258['on'](_0x39f5('0x9'),function(_0x416023){for(var _0x5e45b5 in _0x416023){_0x27c9ab[_0x5e45b5]=_0x416023[_0x5e45b5];}_0x27c9ab['emit']('ready');});_0x3e2258['on']('line',function(_0x21e6f8){if(_0x21e6f8[_0x39f5('0xa')]()=='hangup'){_0x27c9ab[_0x39f5('0xb')](_0x39f5('0xc'));return;}if(_0x21e6f8['substring'](0x0,0xb)=='520-Invalid'){_0xa78506=!![];}if(_0xa78506){_0x2ae252['rx']+=_0x21e6f8+'\x0a';if(_0x21e6f8[_0x39f5('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0xa78506=![];}}else{_0x2ae252['rx']=_0x21e6f8;}if(_0xa78506){return;}if(typeof _0x2ae252['cb']=='function'){var _0x26450e=_0x2ae252['rx'][_0x39f5('0xe')](0x0,0x3),_0x46f793=null,_0x19f6a0=null;_0x26450e=parseInt(_0x26450e);if(isNaN(_0x26450e)){_0x2ae252['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x39f5('0xf')});return;}if(_0x26450e!=0xc8){_0x2ae252['cb'](null,{'code':_0x26450e,'result':-0x1,'extra':'KO'});return;}_0x46f793=_0x2ae252['rx'][_0x39f5('0xe')](0x4)['replace']('result=','');if(_0x46f793[_0x39f5('0x10')]('\x20')!=-0x1){_0x46f793=_0x46f793['substr'](0x0,_0x46f793['indexOf']('\x20'));}if(_[_0x39f5('0x11')](_0x46f793,'-1')){_0x46f793=parseInt(_0x46f793);}_0x19f6a0=_0x2ae252['rx']['split']('\x20');if(_0x19f6a0['length']==0x3){_0x19f6a0=_0x19f6a0[0x2]['substring'](0x1,_0x19f6a0[0x2][_0x39f5('0x12')]-0x1);}else if(_0x19f6a0['length']>0x3){var _0x4d148f=/\((.+)\)/;var _0x25986e=_0x2ae252['rx'][_0x39f5('0x13')](_0x4d148f);if(_0x25986e){_0x19f6a0=_0x25986e[0x1];}else{_0x19f6a0=null;}}else{_0x19f6a0=null;}_0x2ae252['cb'](null,{'code':_0x26450e,'result':_0x46f793,'extra':_0x19f6a0});}});_0x5743c4['on'](_0x39f5('0x14'),function(_0x124c79){_0x27c9ab[_0x39f5('0xb')](_0x39f5('0x14'),new AGIError(_0x39f5('0x15'),_0x124c79['code']));});_0x5743c4['on']('close',function(){_0x27c9ab[_0x39f5('0xb')]('close',new AGIError(_0x39f5('0x16')));});_0x5743c4['on'](_0x39f5('0x17'),function(){_0x27c9ab[_0x39f5('0xb')]('timeout',new AGIError(_0x39f5('0x18')));_0x5743c4[_0x39f5('0x19')]();});_0x5743c4[_0x39f5('0x1a')](_0x3e2258);this['command']=function(_0x47d0ae,_0x387f8c){var _0x47d0ae=_0x47d0ae||'',_0x387f8c=typeof _0x387f8c=='function'?_0x387f8c:new Function();_0x2ae252={'tx':_0x47d0ae,'rx':'','cb':_0x387f8c};_0x5743c4[_0x39f5('0x1b')](_0x47d0ae+'\x0a');},this[_0x39f5('0x1c')]=function(){_0x5743c4[_0x39f5('0x19')]();};}util[_0x39f5('0x1d')](AGIChannel,EventEmitter);AGIChannel[_0x39f5('0x1e')][_0x39f5('0x1f')]=function(_0x2fd98e){return this[_0x39f5('0x20')][_0x39f5('0x21')](this,_0x2fd98e);};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x22')]=function(){return this['sendRequest'](_0x39f5('0x23'));};AGIChannel['prototype']['getData']=function(_0x46b90a,_0x2d0aa8,_0x48b128){_0x46b90a=_0x46b90a===undefined?'beep':_0x46b90a;_0x2d0aa8=_0x2d0aa8===undefined?'5':_0x2d0aa8;_0x48b128=_0x48b128===undefined?'1':_0x48b128;return this[_0x39f5('0x1f')](util['format'](_0x39f5('0x24'),_0x46b90a,_0x2d0aa8*0x3e8,_0x48b128));};AGIChannel[_0x39f5('0x1e')]['noop']=function(_0x41c3c6){_0x41c3c6=_0x41c3c6||_0x39f5('0x25');return this['sendRequest'](util[_0x39f5('0x26')]('VERBOSE\x20\x22%s\x22',_0x41c3c6));};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x27')]=function(_0x4d4428,_0x17c1f8){if(_[_0x39f5('0x28')](_0x17c1f8)){return this['sendRequest'](util['format'](_0x39f5('0x29'),_0x4d4428,_0x17c1f8[_0x39f5('0x2a')](',')));}return this['sendRequest'](util[_0x39f5('0x26')](_0x39f5('0x29'),_0x4d4428,_0x17c1f8));};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x2b')]=function(_0x241da5){return this[_0x39f5('0x1f')](util[_0x39f5('0x26')]('SET\x20CONTEXT\x20%s',_0x241da5));};AGIChannel[_0x39f5('0x1e')]['setExtension']=function(_0x5f1e8f){return this[_0x39f5('0x1f')](util[_0x39f5('0x26')](_0x39f5('0x2c'),_0x5f1e8f));};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x2d')]=function(_0x8919df){return this[_0x39f5('0x1f')](util[_0x39f5('0x26')]('SET\x20PRIORITY\x20%s',_0x8919df));};AGIChannel['prototype'][_0x39f5('0xc')]=function(){return this[_0x39f5('0x1f')]('HANGUP');};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x2e')]=function(_0x4c4066,_0x552892){var _0x43c973=_[_0x39f5('0x2f')](_0x552892)||_[_0x39f5('0x30')](_0x552892)?_0x552892['toString']():_0x552892;return this[_0x39f5('0x1f')](util['format'](_0x39f5('0x31'),_0x4c4066,_0x43c973?_0x43c973[_0x39f5('0x32')]()[_0x39f5('0x33')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x34')]=function(_0x3d8336,_0x7c93c7){return this[_0x39f5('0x1f')](util[_0x39f5('0x26')](_0x39f5('0x35'),_0x3d8336,_0x7c93c7));};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x36')]=function(_0x5f0b08,_0x2544a0){return this['sendRequest'](util['format'](_0x39f5('0x37'),_0x5f0b08,_0x2544a0));};AGIChannel['prototype'][_0x39f5('0x38')]=function(_0x989b3f,_0x4f55bc){return this[_0x39f5('0x1f')](util['format'](_0x39f5('0x39'),_0x989b3f,_0x4f55bc));};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x3a')]=function(_0x3c9bfc,_0xc541da,_0x5dc5c0){_0xc541da=_0xc541da||this['extension'];_0x5dc5c0=_0x5dc5c0||0x1;this['setContext'](_0x3c9bfc);this[_0x39f5('0x3b')](_0xc541da);this[_0x39f5('0x2d')](_0x5dc5c0);return this['noop'](util[_0x39f5('0x26')](_0x39f5('0x3c'),_0x3c9bfc,_0xc541da,_0x5dc5c0));};AGIChannel['prototype'][_0x39f5('0x3d')]=function(_0x2957c4){return this['sendRequest'](util[_0x39f5('0x26')](_0x39f5('0x3e'),_0x2957c4));};AGIChannel['prototype'][_0x39f5('0x3f')]=function(_0x1db56d,_0x5c9056,_0x3a2fb1,_0x555695,_0x239204,_0x53fe73){_0x5c9056=_0x5c9056||_0x39f5('0x40');_0x3a2fb1=_0x3a2fb1||'';_0x555695=_0x555695===undefined?-0x1:_0x555695==='-1'?-0x1:_0x555695*0x3e8;_0x239204=_0x239204===undefined?'':'s='+_0x239204;_0x53fe73=_0x53fe73?_0x39f5('0x41'):'';return this['sendRequest'](util[_0x39f5('0x26')](_0x39f5('0x42'),_0x1db56d,_0x5c9056,_0x3a2fb1,_0x555695,_0x53fe73,_0x239204));};AGIChannel[_0x39f5('0x1e')]['streamFile']=function(_0x17c442,_0x5c203e){_0x5c203e=_0x5c203e||'';return this[_0x39f5('0x1f')](util[_0x39f5('0x26')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x17c442,_0x5c203e));};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x43')]=function(_0x3f2dea){return this[_0x39f5('0x27')](_0x39f5('0x44'),_0x3f2dea);};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x45')]=function(_0xfe9197){return this[_0x39f5('0x27')](_0x39f5('0x46'),_0xfe9197);};AGIChannel[_0x39f5('0x1e')][_0x39f5('0x14')]=function(_0x52bef2,_0x27d8be){this['noop'](util[_0x39f5('0x26')](_0x39f5('0x47'),_0x52bef2['id'],_0x52bef2[_0x39f5('0x48')],_0x27d8be));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x39f5('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index e53d450..0d040d0 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 _0xf39e=['E_AGI_UNDEFINED','push','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x18cc54,_0x41be23){var _0x99075=function(_0x4f370b){while(--_0x4f370b){_0x18cc54['push'](_0x18cc54['shift']());}};_0x99075(++_0x41be23);}(_0xf39e,0xa5));var _0xef39=function(_0xb6fd98,_0x1e3992){_0xb6fd98=_0xb6fd98-0x0;var _0x5d613d=_0xf39e[_0xb6fd98];return _0x5d613d;};'use strict';var util=require(_0xef39('0x0'));var error={'E_AGI_UNDEFINED':_0xef39('0x1'),'E_AGI_ARGUMENT_PORT':_0xef39('0x2'),'E_AGI_SERVER_ERROR':_0xef39('0x3'),'E_AGI_SERVER_CLOSE':_0xef39('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xef39('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xef39('0x6'),'E_AGI_SOCKET_CLOSE':_0xef39('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xef39('0x8'),'E_AGI_COMMAND_EMPTY':_0xef39('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xef39('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x38f9a7){var _0x38f9a7=_0x38f9a7||null,_0x34f5ab=_0x34f5ab||[],_0x4f0f80=0x1,_0x3ba2b3='';if(!error[_0x38f9a7]){_0x38f9a7=_0xef39('0xb');}_0x34f5ab[_0xef39('0xc')](error[_0x38f9a7]);while(arguments[_0x4f0f80]){_0x34f5ab[_0xef39('0xc')](arguments[_0x4f0f80]);_0x4f0f80++;}_0x3ba2b3=util['format'][_0xef39('0xd')](util,_0x34f5ab);this['message']=_0x3ba2b3;this[_0xef39('0xe')]=_0x38f9a7;}module[_0xef39('0xf')]=AGIError; \ No newline at end of file +var _0x9c84=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x2621a8,_0x39473d){var _0xb40187=function(_0x49400d){while(--_0x49400d){_0x2621a8['push'](_0x2621a8['shift']());}};_0xb40187(++_0x39473d);}(_0x9c84,0x191));var _0x49c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c84[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x49c8('0x0'));var error={'E_AGI_UNDEFINED':_0x49c8('0x1'),'E_AGI_ARGUMENT_PORT':_0x49c8('0x2'),'E_AGI_SERVER_ERROR':_0x49c8('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x49c8('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x49c8('0x5'),'E_AGI_SOCKET_ERROR':_0x49c8('0x6'),'E_AGI_SOCKET_CLOSE':_0x49c8('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x49c8('0x8'),'E_AGI_COMMAND_EMPTY':_0x49c8('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x49c8('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5506e7){var _0x5506e7=_0x5506e7||null,_0x4bbc31=_0x4bbc31||[],_0x4a93c8=0x1,_0x25fd0d='';if(!error[_0x5506e7]){_0x5506e7=_0x49c8('0xb');}_0x4bbc31[_0x49c8('0xc')](error[_0x5506e7]);while(arguments[_0x4a93c8]){_0x4bbc31[_0x49c8('0xc')](arguments[_0x4a93c8]);_0x4a93c8++;}_0x25fd0d=util[_0x49c8('0xd')][_0x49c8('0xe')](util,_0x4bbc31);this['message']=_0x25fd0d;this[_0x49c8('0xf')]=_0x5506e7;}module[_0x49c8('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index ce74fc4..57c8472 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38eb=['E_AGI_SERVER_ERROR','agi','parse','exports','events','EventEmitter','ioredis','./error','../../config/environment','redis','subscribe','emit','error'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x38eb,0x6c));var _0xb38e=function(_0x287dc3,_0x1fcd7a){_0x287dc3=_0x287dc3-0x0;var _0x46f3e5=_0x38eb[_0x287dc3];return _0x46f3e5;};'use strict';var _=require('lodash');var EventEmitter=require(_0xb38e('0x0'))[_0xb38e('0x1')];var Redis=require(_0xb38e('0x2'));var AGIError=require(_0xb38e('0x3'));var config=require(_0xb38e('0x4'));config[_0xb38e('0x5')]=_['defaults'](config[_0xb38e('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb38e('0x5')]);sub[_0xb38e('0x6')]('agi',function(_0x49827b){if(_0x49827b)return eventEmitter[_0xb38e('0x7')](_0xb38e('0x8'),new AGIError(_0xb38e('0x9'),_0x49827b));});sub['on']('message',function(_0x10cddd,_0x3ec3b4){if(_0x10cddd!==_0xb38e('0xa'))return;try{var _0xc48417=JSON[_0xb38e('0xb')](_0x3ec3b4);eventEmitter[_0xb38e('0x7')]('projectUpdate',_0xc48417);}catch(_0x5e8296){eventEmitter[_0xb38e('0x7')](_0xb38e('0x8'),new AGIError(_0xb38e('0x9'),_0x5e8296));}});module[_0xb38e('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x10a4=['ioredis','./error','../../config/environment','redis','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','projectUpdate','exports','lodash','events','EventEmitter'];(function(_0xbf7f20,_0x3f856e){var _0x5dc25d=function(_0x504cae){while(--_0x504cae){_0xbf7f20['push'](_0xbf7f20['shift']());}};_0x5dc25d(++_0x3f856e);}(_0x10a4,0x129));var _0x410a=function(_0x1a286f,_0x374d52){_0x1a286f=_0x1a286f-0x0;var _0x33e8b0=_0x10a4[_0x1a286f];return _0x33e8b0;};'use strict';var _=require(_0x410a('0x0'));var EventEmitter=require(_0x410a('0x1'))[_0x410a('0x2')];var Redis=require(_0x410a('0x3'));var AGIError=require(_0x410a('0x4'));var config=require(_0x410a('0x5'));config[_0x410a('0x6')]=_['defaults'](config[_0x410a('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x410a('0x6')]);sub[_0x410a('0x7')]('agi',function(_0x36bd77){if(_0x36bd77)return eventEmitter[_0x410a('0x8')](_0x410a('0x9'),new AGIError(_0x410a('0xa'),_0x36bd77));});sub['on'](_0x410a('0xb'),function(_0x401410,_0x178075){if(_0x401410!==_0x410a('0xc'))return;try{var _0x43705d=JSON['parse'](_0x178075);eventEmitter[_0x410a('0x8')](_0x410a('0xd'),_0x43705d);}catch(_0x22724f){eventEmitter[_0x410a('0x8')]('error',new AGIError(_0x410a('0xa'),_0x22724f));}});module[_0x410a('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index d3eb009..da94dfe 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 _0x9476=['condition','split','target','agicommand','menu','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','getdigits','getsecretdigits','vertices','prototype','addVertex','addEdge','edges','push','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length'];(function(_0x29a009,_0x3655e7){var _0x37ae51=function(_0x1c41e1){while(--_0x1c41e1){_0x29a009['push'](_0x29a009['shift']());}};_0x37ae51(++_0x3655e7);}(_0x9476,0xdc));var _0x6947=function(_0x59186e,_0x1bf528){_0x59186e=_0x59186e-0x0;var _0x1235ed=_0x9476[_0x59186e];return _0x1235ed;};'use strict';var _=require(_0x6947('0x0'));var logger=require('../../../config/logger')(_0x6947('0x1'));var verticesWithRetry=['menu',_0x6947('0x2'),_0x6947('0x3')];var Graph=function(){this[_0x6947('0x4')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x6947('0x5')][_0x6947('0x6')]=function(_0x5ab61b){this['vertices'][_0x5ab61b['id']]=_0x5ab61b;this['edges'][_0x5ab61b['id']]=[];};Graph['prototype'][_0x6947('0x7')]=function(_0x2fac07,_0x2be568,_0x10f876){this[_0x6947('0x8')][_0x2fac07][_0x6947('0x9')]({'target':_0x2be568,'condition':_0x10f876});this[_0x6947('0xa')]+=0x1;};Graph[_0x6947('0x5')]['size']=function(){return _[_0x6947('0xb')](this[_0x6947('0x4')]);};Graph['prototype'][_0x6947('0xc')]=function(){return this[_0x6947('0xa')];};Graph['prototype'][_0x6947('0xd')]=function(_0x2add32){return this[_0x6947('0x4')][_0x2add32];};Graph[_0x6947('0x5')][_0x6947('0xe')]=function(_0x2cb5a9,_0x5438e1){if(!this[_0x6947('0x4')][_0x2cb5a9]){return logger[_0x6947('0xf')](_0x6947('0x10'));}var _0x4f8c9e=_0x5438e1(this[_0x6947('0x4')][_0x2cb5a9]);if(!_0x4f8c9e){return logger[_0x6947('0xf')](_0x6947('0x11'));}if(this[_0x6947('0x8')][_0x2cb5a9]['length']===0x0){return logger[_0x6947('0xf')](_0x6947('0x12'));}for(var _0x5ce6be=0x0,_0x17cf15=[],_0x271dd9=![];_0x5ce6be\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','evtHangup','createSquareReport','catch','agi_','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','./server','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid'];(function(_0x31c496,_0x4549dc){var _0x34072f=function(_0x3497e9){while(--_0x3497e9){_0x31c496['push'](_0x31c496['shift']());}};_0x34072f(++_0x4549dc);}(_0x1640,0x88));var _0x0164=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x1640[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x0164('0x0'));var syncho=require(_0x0164('0x1'));var util=require(_0x0164('0x2'));var config=require(_0x0164('0x3'));var logger=require(_0x0164('0x4'))(_0x0164('0x5'));var utilLicense=require(_0x0164('0x6'));var rpc=require(_0x0164('0x7'));var Project=require('./project');var AGIEmitter=require(_0x0164('0x8'))[_0x0164('0x9')];var projects=[];config[_0x0164('0x5')]=_[_0x0164('0xa')](config[_0x0164('0x5')],{'ip':_0x0164('0xb'),'port':0x11dd});AGIEmitter['on'](_0x0164('0xc'),projectUpdateHandler);function connectionHandler(_0x51dbe0){process[_0x0164('0xd')](function(){syncho(function(){try{setChannelVariables(_0x51dbe0);agiHandler(_0x51dbe0);}catch(_0x239205){logger[_0x0164('0xe')](_0x239205[_0x0164('0xf')]);}});});}function projectUpdateHandler(_0x26ff8c){try{var _0x5bf2c5=_[_0x0164('0x10')](projects,['id',_0x26ff8c['id']]);if(_0x5bf2c5>-0x1){if(_0x26ff8c[_0x0164('0x11')]===!![]){projects['splice'](_0x5bf2c5,0x1);}else{projects[_0x5bf2c5]=_0x26ff8c;}}else{projects['push'](_0x26ff8c);}}catch(_0x26de83){logger[_0x0164('0xe')](_0x26de83['stack']);}}function listeningHandler(){console[_0x0164('0x12')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0164('0x5')][_0x0164('0x13')]);logger['info'](util[_0x0164('0x14')](_0x0164('0x15'),config[_0x0164('0x5')]['ip'],config[_0x0164('0x5')]['port']));}function errorHandler(_0x3c2f0a){if(_0x3c2f0a&&_0x3c2f0a[_0x0164('0x16')]&&_0x3c2f0a[_0x0164('0x17')]){logger[_0x0164('0xe')](util['format']('[%s]\x20%s',_0x3c2f0a[_0x0164('0x16')],_0x3c2f0a[_0x0164('0x17')]));}else{logger['error'](util[_0x0164('0x14')](_0x0164('0x18'),_0x3c2f0a['stack']));}}function closeHandler(){logger[_0x0164('0x19')](util[_0x0164('0x14')](_0x0164('0x1a'),this[_0x0164('0x1b')],this['calleridname'],this['callerid'],this[_0x0164('0x1c')],this[_0x0164('0x1d')]));try{createSquareReport(this);}catch(_0x5cc9f1){logger['error'](_0x5cc9f1[_0x0164('0xf')]);}}function timeoutHandler(){logger[_0x0164('0x19')](util[_0x0164('0x14')](_0x0164('0x1e'),this['arg_1'],this[_0x0164('0x1f')],this[_0x0164('0x20')],this['dnid'],this[_0x0164('0x1d')]));}function hangupHandler(){logger[_0x0164('0x19')](util[_0x0164('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x0164('0x1b')],this[_0x0164('0x1f')],this['callerid'],this[_0x0164('0x1c')],this['uniqueid']));this[_0x0164('0x21')]=!![];}function createSquareReport(_0x2510f4,_0x7def6a){rpc[_0x0164('0x22')](_0x2510f4)['then'](function(_0x3d8243){if(_0x7def6a){_0x7def6a(null,_0x3d8243);}})[_0x0164('0x23')](function(_0x263ef4){if(_0x7def6a){_0x7def6a(null,_0x263ef4);}});}function setChannelVariables(_0x1e51ee){for(var _0x3f0aeb in _0x1e51ee){if(_0x1e51ee['hasOwnProperty'](_0x3f0aeb)){if(_0x3f0aeb['indexOf'](_0x0164('0x24'))===0x0){_0x1e51ee[_0x3f0aeb['substring'](0x4)]=_0x1e51ee[_0x3f0aeb];delete _0x1e51ee[_0x3f0aeb];}}}}function agiHandler(_0x7adc9d){logger[_0x0164('0x25')](_0x0164('0x26'),JSON['stringify'](_0x7adc9d,null,0x2));logger[_0x0164('0x19')](util[_0x0164('0x14')](_0x0164('0x27'),_0x7adc9d[_0x0164('0x1b')],_0x7adc9d['calleridname'],_0x7adc9d['callerid'],_0x7adc9d['dnid'],_0x7adc9d['uniqueid']));_0x7adc9d['on'](_0x0164('0xe'),errorHandler);_0x7adc9d['on']('close',closeHandler);_0x7adc9d['on'](_0x0164('0x28'),timeoutHandler);_0x7adc9d[_0x0164('0x21')]=![];_0x7adc9d['on'](_0x0164('0x29'),hangupHandler);var _0x1eca8b=_[_0x0164('0x2a')](projects,[_0x0164('0x16'),_0x7adc9d[_0x0164('0x1b')]]);if(!_0x1eca8b)return Project[_0x0164('0x2b')](_0x7adc9d);if(!_0x1eca8b['production'])return Project[_0x0164('0x2c')](_0x7adc9d);return Project[_0x0164('0x2d')](_0x1eca8b,_0x7adc9d);}function main(){var _0x4adacf;return utilLicense[_0x0164('0x2e')]()[_0x0164('0x2f')](function(_0x155011){if(!_0x155011)return;if(_0x155011[_0x0164('0x30')]){if(_0x155011[_0x0164('0x31')]&&_0x155011['callysquare']>0x0){logger[_0x0164('0x19')](util['format'](_0x0164('0x32'),_0x155011[_0x0164('0x31')]));_0x4adacf=_0x155011[_0x0164('0x31')];}else{logger[_0x0164('0x19')](_0x0164('0x33'));}}else{logger[_0x0164('0x19')](_0x0164('0x34'));_0x4adacf=-0x1;}})[_0x0164('0x2f')](function(){return Project[_0x0164('0x35')]();})[_0x0164('0x2f')](function(_0x1997e0){projects=_0x1997e0;return;})['catch'](function(_0x46ede8){logger['error']('[LICENSE]',_0x46ede8[_0x0164('0xf')]);})['finally'](function(){var _0x3bc183=require(_0x0164('0x36'))(config[_0x0164('0x5')][_0x0164('0x13')],config[_0x0164('0x5')]['ip'],_0x4adacf);_0x3bc183['on'](_0x0164('0xe'),errorHandler);_0x3bc183['on']('listening',listeningHandler);_0x3bc183['on']('connection',connectionHandler);_0x3bc183['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xb56b=['log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','stack','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close','timeout','production','initialize','getLicense','then','voice','callysquare','getAll','[LICENSE]','./server','listening','connection','lodash','syncho','../../config/environment','agi','../../config/license/util','./rpc','./events','EventEmitter','defaults','127.0.0.1','nextTick','error','findIndex','deleted','splice'];(function(_0x4ad355,_0x433598){var _0x40acfd=function(_0x305e29){while(--_0x305e29){_0x4ad355['push'](_0x4ad355['shift']());}};_0x40acfd(++_0x433598);}(_0xb56b,0x12f));var _0xbb56=function(_0x3be82c,_0x3307d7){_0x3be82c=_0x3be82c-0x0;var _0x40d25a=_0xb56b[_0x3be82c];return _0x40d25a;};'use strict';var _=require(_0xbb56('0x0'));var syncho=require(_0xbb56('0x1'));var util=require('util');var config=require(_0xbb56('0x2'));var logger=require('../../config/logger')(_0xbb56('0x3'));var utilLicense=require(_0xbb56('0x4'));var rpc=require(_0xbb56('0x5'));var Project=require('./project');var AGIEmitter=require(_0xbb56('0x6'))[_0xbb56('0x7')];var projects=[];config[_0xbb56('0x3')]=_[_0xbb56('0x8')](config['agi'],{'ip':_0xbb56('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0xf8c874){process[_0xbb56('0xa')](function(){syncho(function(){try{setChannelVariables(_0xf8c874);agiHandler(_0xf8c874);}catch(_0x508396){logger[_0xbb56('0xb')](_0x508396['stack']);}});});}function projectUpdateHandler(_0xe7be17){try{var _0x3ff27e=_[_0xbb56('0xc')](projects,['id',_0xe7be17['id']]);if(_0x3ff27e>-0x1){if(_0xe7be17[_0xbb56('0xd')]===!![]){projects[_0xbb56('0xe')](_0x3ff27e,0x1);}else{projects[_0x3ff27e]=_0xe7be17;}}else{projects['push'](_0xe7be17);}}catch(_0x523071){logger[_0xbb56('0xb')](_0x523071['stack']);}}function listeningHandler(){console[_0xbb56('0xf')](_0xbb56('0x10'),config[_0xbb56('0x3')][_0xbb56('0x11')]);logger[_0xbb56('0x12')](util[_0xbb56('0x13')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xbb56('0x3')]['ip'],config['agi'][_0xbb56('0x11')]));}function errorHandler(_0x151a46){if(_0x151a46&&_0x151a46[_0xbb56('0x14')]&&_0x151a46[_0xbb56('0x15')]){logger[_0xbb56('0xb')](util['format']('[%s]\x20%s',_0x151a46['name'],_0x151a46[_0xbb56('0x15')]));}else{logger['error'](util[_0xbb56('0x13')]('[ERROR]\x20%s',_0x151a46['stack']));}}function closeHandler(){logger['info'](util[_0xbb56('0x13')](_0xbb56('0x16'),this['arg_1'],this['calleridname'],this[_0xbb56('0x17')],this[_0xbb56('0x18')],this[_0xbb56('0x19')]));try{createSquareReport(this);}catch(_0x3a5fc9){logger[_0xbb56('0xb')](_0x3a5fc9[_0xbb56('0x1a')]);}}function timeoutHandler(){logger[_0xbb56('0x12')](util[_0xbb56('0x13')](_0xbb56('0x1b'),this[_0xbb56('0x1c')],this[_0xbb56('0x1d')],this['callerid'],this[_0xbb56('0x18')],this[_0xbb56('0x19')]));}function hangupHandler(){logger[_0xbb56('0x12')](util[_0xbb56('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xbb56('0x1c')],this[_0xbb56('0x1d')],this['callerid'],this[_0xbb56('0x18')],this[_0xbb56('0x19')]));this[_0xbb56('0x1e')]=!![];}function createSquareReport(_0x83a4b4,_0x2953d7){rpc[_0xbb56('0x1f')](_0x83a4b4)['then'](function(_0x1387c3){if(_0x2953d7){_0x2953d7(null,_0x1387c3);}})[_0xbb56('0x20')](function(_0x24adc1){if(_0x2953d7){_0x2953d7(null,_0x24adc1);}});}function setChannelVariables(_0x18ae7b){for(var _0x3d6891 in _0x18ae7b){if(_0x18ae7b[_0xbb56('0x21')](_0x3d6891)){if(_0x3d6891[_0xbb56('0x22')](_0xbb56('0x23'))===0x0){_0x18ae7b[_0x3d6891[_0xbb56('0x24')](0x4)]=_0x18ae7b[_0x3d6891];delete _0x18ae7b[_0x3d6891];}}}}function agiHandler(_0x163ea7){logger[_0xbb56('0x25')](_0xbb56('0x26'),JSON[_0xbb56('0x27')](_0x163ea7,null,0x2));logger[_0xbb56('0x12')](util[_0xbb56('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x163ea7[_0xbb56('0x1c')],_0x163ea7['calleridname'],_0x163ea7['callerid'],_0x163ea7[_0xbb56('0x18')],_0x163ea7['uniqueid']));_0x163ea7['on'](_0xbb56('0xb'),errorHandler);_0x163ea7['on'](_0xbb56('0x28'),closeHandler);_0x163ea7['on'](_0xbb56('0x29'),timeoutHandler);_0x163ea7[_0xbb56('0x1e')]=![];_0x163ea7['on']('hangup',hangupHandler);var _0x2b05c1=_['find'](projects,[_0xbb56('0x14'),_0x163ea7[_0xbb56('0x1c')]]);if(!_0x2b05c1)return Project['handleNotFound'](_0x163ea7);if(!_0x2b05c1[_0xbb56('0x2a')])return Project['handleUnpublished'](_0x163ea7);return Project[_0xbb56('0x2b')](_0x2b05c1,_0x163ea7);}function main(){var _0xd01b85;return utilLicense[_0xbb56('0x2c')]()[_0xbb56('0x2d')](function(_0x2e2ebe){if(!_0x2e2ebe)return;if(_0x2e2ebe[_0xbb56('0x2e')]){if(_0x2e2ebe[_0xbb56('0x2f')]&&_0x2e2ebe['callysquare']>0x0){logger[_0xbb56('0x12')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x2e2ebe[_0xbb56('0x2f')]));_0xd01b85=_0x2e2ebe[_0xbb56('0x2f')];}else{logger[_0xbb56('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xbb56('0x12')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xd01b85=-0x1;}})[_0xbb56('0x2d')](function(){return Project[_0xbb56('0x30')]();})['then'](function(_0x18d090){projects=_0x18d090;return;})[_0xbb56('0x20')](function(_0x560157){logger[_0xbb56('0xb')](_0xbb56('0x31'),_0x560157[_0xbb56('0x1a')]);})['finally'](function(){var _0x5761d9=require(_0xbb56('0x32'))(config['agi'][_0xbb56('0x11')],config[_0xbb56('0x3')]['ip'],_0xd01b85);_0x5761d9['on'](_0xbb56('0xb'),errorHandler);_0x5761d9['on'](_0xbb56('0x33'),listeningHandler);_0x5761d9['on'](_0xbb56('0x34'),connectionHandler);_0x5761d9['on'](_0xbb56('0x28'),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 9b0bd35..8b1f139 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 _0xec77=['SendMail','bluebird','jayson/promise','client','http','request','error','result','catch','sendMailMessage'];(function(_0x4b1c96,_0x271d77){var _0x5cca89=function(_0x5e3c28){while(--_0x5e3c28){_0x4b1c96['push'](_0x4b1c96['shift']());}};_0x5cca89(++_0x271d77);}(_0xec77,0xf1));var _0x7ec7=function(_0x557ff2,_0x5d76c7){_0x557ff2=_0x557ff2-0x0;var _0x578d53=_0xec77[_0x557ff2];return _0x578d53;};'use strict';var BPromise=require(_0x7ec7('0x0'));var jayson=require(_0x7ec7('0x1'));var client=jayson[_0x7ec7('0x2')][_0x7ec7('0x3')]({'port':0x232b});function request(_0x77f7da,_0x147578){return new BPromise(function(_0x16b9ce,_0x501c45){return client[_0x7ec7('0x4')](_0x77f7da,_0x147578)['then'](function(_0x3aaee6){if(_0x3aaee6['error']){return _0x501c45(_0x3aaee6[_0x7ec7('0x5')]['message']);}else{return _0x16b9ce(_0x3aaee6[_0x7ec7('0x6')]);}})[_0x7ec7('0x7')](function(_0x5da11e){return _0x501c45(_0x5da11e);});});}exports[_0x7ec7('0x8')]=function(_0x32830f,_0x233a72){return request(_0x7ec7('0x9'),{'account':_0x32830f,'message':_0x233a72});}; \ No newline at end of file +var _0x9791=['http','request','then','error','message','result','catch','SendMail','bluebird','jayson/promise'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x9791,0x1e8));var _0x1979=function(_0x3907e2,_0x5bff31){_0x3907e2=_0x3907e2-0x0;var _0x3221a1=_0x9791[_0x3907e2];return _0x3221a1;};'use strict';var BPromise=require(_0x1979('0x0'));var jayson=require(_0x1979('0x1'));var client=jayson['client'][_0x1979('0x2')]({'port':0x232b});function request(_0x2b3eed,_0x5755d2){return new BPromise(function(_0x55132a,_0x338ea9){return client[_0x1979('0x3')](_0x2b3eed,_0x5755d2)[_0x1979('0x4')](function(_0x4c8992){if(_0x4c8992[_0x1979('0x5')]){return _0x338ea9(_0x4c8992['error'][_0x1979('0x6')]);}else{return _0x55132a(_0x4c8992[_0x1979('0x7')]);}})[_0x1979('0x8')](function(_0x374a90){return _0x338ea9(_0x374a90);});});}exports['sendMailMessage']=function(_0x12ba58,_0x2df159){return request(_0x1979('0x9'),{'account':_0x12ba58,'message':_0x2df159});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index e8bcf31..31d7847 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc61c=['finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','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','close','Project\x20%s\x20not\x20published','exports','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','value','inspect','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','start','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','result','toString'];(function(_0x1c7a40,_0x5b0b1b){var _0x53b785=function(_0x1c9eb4){while(--_0x1c9eb4){_0x1c7a40['push'](_0x1c7a40['shift']());}};_0x53b785(++_0x5b0b1b);}(_0xc61c,0x1ea));var _0xcc61=function(_0xad921d,_0x4e852b){_0xad921d=_0xad921d-0x0;var _0x50a737=_0xc61c[_0xad921d];return _0x50a737;};'use strict';var _=require('lodash');var moment=require(_0xcc61('0x0'));var parser=require('xml2json');var util=require(_0xcc61('0x1'));var logger=require(_0xcc61('0x2'))(_0xcc61('0x3'));var rpc=require(_0xcc61('0x4'));var mailRpc=require(_0xcc61('0x5'));var Graph=require(_0xcc61('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xcc61('0x7')]()[_0xcc61('0x8')](function(_0x4caa76){logger[_0xcc61('0x9')](_0xcc61('0xa'),_0x4caa76[_0xcc61('0xb')]);return[];});}function addVertex(_0x3624f4,_0x3d5920,_0x2cd3b8){_0x3d5920[_0xcc61('0xc')]=_0x2cd3b8;if(_0x3d5920[_0xcc61('0xd')](_0xcc61('0xe'))){_0x3d5920[_0xcc61('0xf')]=parseInt(_0x3d5920[_0xcc61('0xe')],0xa);}_0x3624f4[_0xcc61('0x10')](_[_0xcc61('0x11')](_0x3d5920,_0xcc61('0x12')));}function initGraph(_0x4ba621,_0x4d6426){var _0x5c32bb=new Graph();for(var _0x438025 in _0x4ba621){if(_0x4ba621['hasOwnProperty'](_0x438025)){if(_['isArray'](_0x4ba621[_0x438025])){for(var _0x580a8b=0x0;_0x580a8b<_0x4ba621[_0x438025][_0xcc61('0x13')];_0x580a8b+=0x1){addVertex(_0x5c32bb,_0x4ba621[_0x438025][_0x580a8b],_0x438025);}}else{addVertex(_0x5c32bb,_0x4ba621[_0x438025],_0x438025);}}}for(var _0x105ae3=0x0;_0x105ae3<_0x4d6426[_0xcc61('0x13')];_0x105ae3+=0x1){if(_0x4d6426[_0x105ae3][_0xcc61('0x14')]&&_0x4d6426[_0x105ae3][_0xcc61('0x15')]){_0x5c32bb[_0xcc61('0x16')](_0x4d6426[_0x105ae3][_0xcc61('0x14')],_0x4d6426[_0x105ae3][_0xcc61('0x15')],_0x4d6426[_0x105ae3][_0xcc61('0x17')]);}}return _0x5c32bb;}function getRoot(_0x18cdb3){return parser['toJson'](_0x18cdb3,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x2fd706){return util[_0xcc61('0x18')](_0x2fd706,{'showHidden':![],'depth':null});}function initialize(_0x3c7e64,_0x5f3a34){var _0x16e3f1=getRoot(_0x3c7e64['production']);if(!_0x16e3f1||!_0x16e3f1['start'])return;var _0x4d5431,_0x4137ea,_0x4829ef;logger[_0xcc61('0x19')](_0xcc61('0x1a'),JSON[_0xcc61('0x1b')](_0x16e3f1,null,0x2));_0x5f3a34[_0xcc61('0x1c')]=moment()[_0xcc61('0x1d')](_0xcc61('0x1e'));_0x4d5431=initGraph(_['omit'](_0x16e3f1,_0xcc61('0x12')),_0x16e3f1[_0xcc61('0x12')]);_0x4137ea=new Vertices(_0x5f3a34,rpc,mailRpc);logger[_0xcc61('0x1f')](util['format'](_0xcc61('0x20'),_0x5f3a34[_0xcc61('0x21')],_0x5f3a34[_0xcc61('0x22')],_0x5f3a34[_0xcc61('0x23')],_0x5f3a34['dnid'],_0x5f3a34[_0xcc61('0x24')]));_0x4d5431[_0xcc61('0x25')](_0x16e3f1[_0xcc61('0x26')]['id'],function(_0x3f90fa){try{_0x3f90fa=_0x4137ea[_0xcc61('0x27')](_0x3f90fa);logger[_0xcc61('0x19')]('vertex',JSON[_0xcc61('0x1b')](_0x3f90fa,null,0x2));if(_0x3f90fa[_0xcc61('0xc')]===_0xcc61('0x28')){logger[_0xcc61('0x1f')](_0xcc61('0x29'));_0x5f3a34[_0xcc61('0x2a')]=_0x3f90fa['context']||_0x5f3a34[_0xcc61('0x2a')];_0x5f3a34[_0xcc61('0x2b')]=_0x3f90fa[_0xcc61('0x2b')];_0x5f3a34['priority']=_0x3f90fa[_0xcc61('0x2c')]?_0x3f90fa[_0xcc61('0x2c')]-0x1:0x1;return null;}else if(_0x3f90fa&&_0x4137ea[_0x3f90fa[_0xcc61('0xc')]]){_0x4829ef=_0x4137ea[_0x3f90fa['agicommand']](_0x3f90fa);logger[_0xcc61('0x1f')](_0xcc61('0x2d'),JSON[_0xcc61('0x1b')](_0x4829ef,null,0x2));if(_0x4829ef&&_0x4829ef[_0xcc61('0x2e')]===AGI_CODE_SUCCESS&&_0x4829ef['result']!==AGI_RESULT_ERROR&&!_0x5f3a34[_0xcc61('0x2f')]){logger[_0xcc61('0x19')](_0xcc61('0x2d'),inspect(_0x4829ef));return _['isUndefined'](_0x4829ef[_0xcc61('0x30')])?null:_0x4829ef[_0xcc61('0x30')][_0xcc61('0x31')]();}else{logger[_0xcc61('0x9')](_0xcc61('0x2d'),inspect(_0x4829ef));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3cb20b){logger['error'](_0x3cb20b[_0xcc61('0xb')]);return null;}});if(_0x16e3f1[_0xcc61('0x32')]){logger[_0xcc61('0x1f')](util[_0xcc61('0x1d')](_0xcc61('0x33'),_0x5f3a34[_0xcc61('0x21')],_0x5f3a34[_0xcc61('0x22')],_0x5f3a34[_0xcc61('0x23')],_0x5f3a34['dnid'],_0x5f3a34[_0xcc61('0x24')]));_0x4d5431[_0xcc61('0x25')](_0x16e3f1['finally']['id'],function(_0x1953d4){try{_0x1953d4=_0x4137ea[_0xcc61('0x27')](_0x1953d4);logger[_0xcc61('0x19')](_0xcc61('0x34'),JSON[_0xcc61('0x1b')](_0x1953d4,null,0x2));if(_0x1953d4&&_0x4137ea[_0x1953d4['agicommand']]){_0x4829ef=_0x4137ea[_0x1953d4[_0xcc61('0xc')]](_0x1953d4);if(_0x4829ef){logger[_0xcc61('0x19')]('response',inspect(_0x4829ef));return _[_0xcc61('0x35')](_0x4829ef['result'])?null:_0x4829ef[_0xcc61('0x30')][_0xcc61('0x31')]();}else{logger['error'](_0xcc61('0x2d'),inspect(_0x4829ef));return null;}}else{logger[_0xcc61('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x4a2714){logger[_0xcc61('0x9')](_0x4a2714[_0xcc61('0xb')]);return null;}});}logger[_0xcc61('0x1f')](util[_0xcc61('0x1d')](_0xcc61('0x36'),_0x5f3a34[_0xcc61('0x21')],_0x5f3a34[_0xcc61('0x22')],_0x5f3a34[_0xcc61('0x23')],_0x5f3a34['dnid'],_0x5f3a34['uniqueid']));logger[_0xcc61('0x1f')](util[_0xcc61('0x1d')](_0xcc61('0x37'),_0x5f3a34[_0xcc61('0x2a')],_0x5f3a34[_0xcc61('0x2b')],parseInt(_0x5f3a34['priority'],0xa)+0x1));_0x5f3a34[_0xcc61('0x38')](_0x5f3a34[_0xcc61('0x2a')],_0x5f3a34[_0xcc61('0x2b')],parseInt(_0x5f3a34[_0xcc61('0x2c')],0xa)+0x1);_0x5f3a34[_0xcc61('0x39')]();}function handleNotFound(_0x16e829){logger[_0xcc61('0x9')](util[_0xcc61('0x1d')]('Project\x20%s\x20not\x20found',_0x16e829[_0xcc61('0x21')]));_0x16e829['continueAt'](_0x16e829[_0xcc61('0x2a')],_0x16e829['extension'],parseInt(_0x16e829[_0xcc61('0x2c')],0xa)+0x1);_0x16e829['close']();}function handleUnpublished(_0x43852c){logger[_0xcc61('0x9')](util['format'](_0xcc61('0x3a'),_0x43852c[_0xcc61('0x21')]));_0x43852c[_0xcc61('0x38')](_0x43852c[_0xcc61('0x2a')],_0x43852c[_0xcc61('0x2b')],parseInt(_0x43852c[_0xcc61('0x2c')],0xa)+0x1);_0x43852c[_0xcc61('0x39')]();}module[_0xcc61('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x8bae=['agicommand','hasOwnProperty','maxRetry','retry','addVertex','mxCell','length','source','target','addEdge','toJson','root','production','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','info','context','extension','priority','response','code','result','evtHangup','isUndefined','agicommand\x20not\x20found','stack','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','../../config/logger','agi','./rpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0x8bae,0x1c5));var _0xe8ba=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8bae[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var moment=require(_0xe8ba('0x0'));var parser=require(_0xe8ba('0x1'));var util=require(_0xe8ba('0x2'));var logger=require(_0xe8ba('0x3'))(_0xe8ba('0x4'));var rpc=require(_0xe8ba('0x5'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0xe8ba('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xe8ba('0x7')]()[_0xe8ba('0x8')](function(_0x54fcc4){logger[_0xe8ba('0x9')](_0xe8ba('0xa'),_0x54fcc4['stack']);return[];});}function addVertex(_0x2a978a,_0x55d911,_0x3d81b5){_0x55d911[_0xe8ba('0xb')]=_0x3d81b5;if(_0x55d911[_0xe8ba('0xc')]('retry')){_0x55d911[_0xe8ba('0xd')]=parseInt(_0x55d911[_0xe8ba('0xe')],0xa);}_0x2a978a[_0xe8ba('0xf')](_['omit'](_0x55d911,_0xe8ba('0x10')));}function initGraph(_0x549e67,_0x1bddeb){var _0x1bb5ea=new Graph();for(var _0x57053a in _0x549e67){if(_0x549e67['hasOwnProperty'](_0x57053a)){if(_['isArray'](_0x549e67[_0x57053a])){for(var _0x26e086=0x0;_0x26e086<_0x549e67[_0x57053a]['length'];_0x26e086+=0x1){addVertex(_0x1bb5ea,_0x549e67[_0x57053a][_0x26e086],_0x57053a);}}else{addVertex(_0x1bb5ea,_0x549e67[_0x57053a],_0x57053a);}}}for(var _0xb0ce20=0x0;_0xb0ce20<_0x1bddeb[_0xe8ba('0x11')];_0xb0ce20+=0x1){if(_0x1bddeb[_0xb0ce20][_0xe8ba('0x12')]&&_0x1bddeb[_0xb0ce20][_0xe8ba('0x13')]){_0x1bb5ea[_0xe8ba('0x14')](_0x1bddeb[_0xb0ce20][_0xe8ba('0x12')],_0x1bddeb[_0xb0ce20][_0xe8ba('0x13')],_0x1bddeb[_0xb0ce20]['value']);}}return _0x1bb5ea;}function getRoot(_0x1f0661){return parser[_0xe8ba('0x15')](_0x1f0661,{'object':!![]})['mxGraphModel'][_0xe8ba('0x16')];}function inspect(_0x367029){return util['inspect'](_0x367029,{'showHidden':![],'depth':null});}function initialize(_0x4dc04b,_0x1564e8){var _0x34d3c4=getRoot(_0x4dc04b[_0xe8ba('0x17')]);if(!_0x34d3c4||!_0x34d3c4['start'])return;var _0x1f4908,_0x436089,_0x34a8a2;logger[_0xe8ba('0x18')]('root',JSON[_0xe8ba('0x19')](_0x34d3c4,null,0x2));_0x1564e8['joinAt']=moment()[_0xe8ba('0x1a')](_0xe8ba('0x1b'));_0x1f4908=initGraph(_[_0xe8ba('0x1c')](_0x34d3c4,'mxCell'),_0x34d3c4[_0xe8ba('0x10')]);_0x436089=new Vertices(_0x1564e8,rpc,mailRpc);logger['info'](util['format'](_0xe8ba('0x1d'),_0x1564e8[_0xe8ba('0x1e')],_0x1564e8[_0xe8ba('0x1f')],_0x1564e8[_0xe8ba('0x20')],_0x1564e8[_0xe8ba('0x21')],_0x1564e8[_0xe8ba('0x22')]));_0x1f4908[_0xe8ba('0x23')](_0x34d3c4['start']['id'],function(_0x1045d){try{_0x1045d=_0x436089[_0xe8ba('0x24')](_0x1045d);logger[_0xe8ba('0x18')](_0xe8ba('0x25'),JSON[_0xe8ba('0x19')](_0x1045d,null,0x2));if(_0x1045d[_0xe8ba('0xb')]===_0xe8ba('0x26')){logger[_0xe8ba('0x27')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1564e8[_0xe8ba('0x28')]=_0x1045d[_0xe8ba('0x28')]||_0x1564e8[_0xe8ba('0x28')];_0x1564e8[_0xe8ba('0x29')]=_0x1045d[_0xe8ba('0x29')];_0x1564e8[_0xe8ba('0x2a')]=_0x1045d['priority']?_0x1045d['priority']-0x1:0x1;return null;}else if(_0x1045d&&_0x436089[_0x1045d[_0xe8ba('0xb')]]){_0x34a8a2=_0x436089[_0x1045d[_0xe8ba('0xb')]](_0x1045d);logger['info'](_0xe8ba('0x2b'),JSON[_0xe8ba('0x19')](_0x34a8a2,null,0x2));if(_0x34a8a2&&_0x34a8a2[_0xe8ba('0x2c')]===AGI_CODE_SUCCESS&&_0x34a8a2[_0xe8ba('0x2d')]!==AGI_RESULT_ERROR&&!_0x1564e8[_0xe8ba('0x2e')]){logger[_0xe8ba('0x18')](_0xe8ba('0x2b'),inspect(_0x34a8a2));return _[_0xe8ba('0x2f')](_0x34a8a2['result'])?null:_0x34a8a2[_0xe8ba('0x2d')]['toString']();}else{logger[_0xe8ba('0x9')]('response',inspect(_0x34a8a2));return null;}}else{logger['error'](_0xe8ba('0x30'));return null;}}catch(_0x59de7f){logger[_0xe8ba('0x9')](_0x59de7f[_0xe8ba('0x31')]);return null;}});if(_0x34d3c4[_0xe8ba('0x32')]){logger[_0xe8ba('0x27')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1564e8[_0xe8ba('0x1e')],_0x1564e8[_0xe8ba('0x1f')],_0x1564e8[_0xe8ba('0x20')],_0x1564e8[_0xe8ba('0x21')],_0x1564e8['uniqueid']));_0x1f4908['traverseBFS'](_0x34d3c4['finally']['id'],function(_0x15882b){try{_0x15882b=_0x436089[_0xe8ba('0x24')](_0x15882b);logger[_0xe8ba('0x18')]('vertex',JSON[_0xe8ba('0x19')](_0x15882b,null,0x2));if(_0x15882b&&_0x436089[_0x15882b[_0xe8ba('0xb')]]){_0x34a8a2=_0x436089[_0x15882b['agicommand']](_0x15882b);if(_0x34a8a2){logger[_0xe8ba('0x18')](_0xe8ba('0x2b'),inspect(_0x34a8a2));return _['isUndefined'](_0x34a8a2[_0xe8ba('0x2d')])?null:_0x34a8a2[_0xe8ba('0x2d')]['toString']();}else{logger[_0xe8ba('0x9')](_0xe8ba('0x2b'),inspect(_0x34a8a2));return null;}}else{logger[_0xe8ba('0x9')](_0xe8ba('0x30'));return null;}}catch(_0x5550f9){logger[_0xe8ba('0x9')](_0x5550f9['stack']);return null;}});}logger['info'](util[_0xe8ba('0x1a')](_0xe8ba('0x33'),_0x1564e8['arg_1'],_0x1564e8['calleridname'],_0x1564e8[_0xe8ba('0x20')],_0x1564e8[_0xe8ba('0x21')],_0x1564e8['uniqueid']));logger[_0xe8ba('0x27')](util['format'](_0xe8ba('0x34'),_0x1564e8['context'],_0x1564e8['extension'],parseInt(_0x1564e8['priority'],0xa)+0x1));_0x1564e8['continueAt'](_0x1564e8[_0xe8ba('0x28')],_0x1564e8[_0xe8ba('0x29')],parseInt(_0x1564e8[_0xe8ba('0x2a')],0xa)+0x1);_0x1564e8[_0xe8ba('0x35')]();}function handleNotFound(_0x3572a4){logger['error'](util[_0xe8ba('0x1a')](_0xe8ba('0x36'),_0x3572a4['arg_1']));_0x3572a4[_0xe8ba('0x37')](_0x3572a4['context'],_0x3572a4['extension'],parseInt(_0x3572a4[_0xe8ba('0x2a')],0xa)+0x1);_0x3572a4['close']();}function handleUnpublished(_0x8dc7bd){logger['error'](util[_0xe8ba('0x1a')](_0xe8ba('0x38'),_0x8dc7bd[_0xe8ba('0x1e')]));_0x8dc7bd['continueAt'](_0x8dc7bd[_0xe8ba('0x28')],_0x8dc7bd['extension'],parseInt(_0x8dc7bd[_0xe8ba('0x2a')],0xa)+0x1);_0x8dc7bd[_0xe8ba('0x35')]();}module[_0xe8ba('0x39')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index cfb0cc9..9cf34c0 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 _0x6417=['_inBody','indexOf','substring','length','trim','slice','emit','headers','line','exports','stream','Transform','call','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString'];(function(_0x28f652,_0xf24d4a){var _0x5445e6=function(_0x8b37ca){while(--_0x8b37ca){_0x28f652['push'](_0x28f652['shift']());}};_0x5445e6(++_0xf24d4a);}(_0x6417,0x8f));var _0x7641=function(_0x11956b,_0x4b730c){_0x11956b=_0x11956b-0x0;var _0x2cccb2=_0x6417[_0x11956b];return _0x2cccb2;};'use strict';var util=require('util');var Transform=require(_0x7641('0x0'))[_0x7641('0x1')];function AGIReply(_0x5deeb8){Transform[_0x7641('0x2')](this,_0x5deeb8);this['_localBuffer']='';this['_inBody']=![];}util[_0x7641('0x3')](AGIReply,Transform);AGIReply[_0x7641('0x4')][_0x7641('0x5')]=function(_0x1c7502,_0x235635,_0x42f75f){var _0x419fdf='\x0a',_0x2f5396=['\x0a\x0a',_0x7641('0x6')],_0x105db4=-0x1,_0x747b81=-0x1,_0x146ca6='',_0x134d87=0x0,_0x4ba05b='',_0x29c7dd='';this[_0x7641('0x7')]+=_0x1c7502[_0x7641('0x8')]();_0x4ba05b=this['_localBuffer'];if(!this[_0x7641('0x9')]){_0x134d87=0x0;while(_0x2f5396[_0x134d87]){while((_0x747b81=_0x4ba05b[_0x7641('0xa')](_0x2f5396[_0x134d87]))!=-0x1){_0x146ca6=_0x2f5396[_0x134d87];_0x29c7dd=_0x4ba05b[_0x7641('0xb')](0x0,_0x747b81);_0x4ba05b=_0x4ba05b['substring'](_0x747b81+_0x146ca6[_0x7641('0xc')]);var _0x153ec2=_0x29c7dd['split'](_0x419fdf),_0x5ded6b=0x0,_0x207599={},_0x517eb6='',_0x536365='',_0x405f5f=-0x1;while(_0x153ec2[_0x5ded6b]){_0x405f5f=_0x153ec2[_0x5ded6b][_0x7641('0xa')](':');if(_0x405f5f!=-0x1){_0x517eb6=_0x153ec2[_0x5ded6b]['slice'](0x0,_0x405f5f)[_0x7641('0xd')]();_0x536365=_0x153ec2[_0x5ded6b][_0x7641('0xe')](_0x405f5f+0x1)['trim']();if(_0x517eb6[_0x7641('0xc')]>0x0){_0x207599[_0x517eb6]=_0x536365;}}else{}_0x5ded6b++;}this[_0x7641('0xf')](_0x7641('0x10'),_0x207599);this[_0x7641('0x9')]=!![];}_0x134d87++;}this['_localBuffer']=_0x4ba05b;}else{while((_0x105db4=_0x4ba05b[_0x7641('0xa')](_0x419fdf))!=-0x1){_0x29c7dd=_0x4ba05b[_0x7641('0xb')](0x0,_0x105db4);this[_0x7641('0xf')](_0x7641('0x11'),_0x29c7dd);_0x4ba05b=_0x4ba05b[_0x7641('0xb')](_0x105db4+_0x419fdf[_0x7641('0xc')]);}this[_0x7641('0x7')]=_0x4ba05b;}_0x42f75f();};module[_0x7641('0x12')]=AGIReply; \ No newline at end of file +var _0x29c4=['Transform','call','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','line','exports','util'];(function(_0x412978,_0x338563){var _0xffb348=function(_0x48b78e){while(--_0x48b78e){_0x412978['push'](_0x412978['shift']());}};_0xffb348(++_0x338563);}(_0x29c4,0x155));var _0x429c=function(_0x25a5c2,_0x388137){_0x25a5c2=_0x25a5c2-0x0;var _0x4d134f=_0x29c4[_0x25a5c2];return _0x4d134f;};'use strict';var util=require(_0x429c('0x0'));var Transform=require('stream')[_0x429c('0x1')];function AGIReply(_0x4c1772){Transform[_0x429c('0x2')](this,_0x4c1772);this[_0x429c('0x3')]='';this[_0x429c('0x4')]=![];}util[_0x429c('0x5')](AGIReply,Transform);AGIReply[_0x429c('0x6')]['_transform']=function(_0x1e69c8,_0x502610,_0x130049){var _0x458905='\x0a',_0x23c289=['\x0a\x0a',_0x429c('0x7')],_0x3bd101=-0x1,_0x575b62=-0x1,_0x1d3f5e='',_0x1ae770=0x0,_0x4d8afc='',_0x197e5b='';this[_0x429c('0x3')]+=_0x1e69c8[_0x429c('0x8')]();_0x4d8afc=this[_0x429c('0x3')];if(!this[_0x429c('0x4')]){_0x1ae770=0x0;while(_0x23c289[_0x1ae770]){while((_0x575b62=_0x4d8afc[_0x429c('0x9')](_0x23c289[_0x1ae770]))!=-0x1){_0x1d3f5e=_0x23c289[_0x1ae770];_0x197e5b=_0x4d8afc['substring'](0x0,_0x575b62);_0x4d8afc=_0x4d8afc[_0x429c('0xa')](_0x575b62+_0x1d3f5e[_0x429c('0xb')]);var _0x45e8dd=_0x197e5b[_0x429c('0xc')](_0x458905),_0x444685=0x0,_0x2287ea={},_0x4bde6e='',_0x2ee2af='',_0x4e4052=-0x1;while(_0x45e8dd[_0x444685]){_0x4e4052=_0x45e8dd[_0x444685][_0x429c('0x9')](':');if(_0x4e4052!=-0x1){_0x4bde6e=_0x45e8dd[_0x444685][_0x429c('0xd')](0x0,_0x4e4052)[_0x429c('0xe')]();_0x2ee2af=_0x45e8dd[_0x444685][_0x429c('0xd')](_0x4e4052+0x1)['trim']();if(_0x4bde6e[_0x429c('0xb')]>0x0){_0x2287ea[_0x4bde6e]=_0x2ee2af;}}else{}_0x444685++;}this[_0x429c('0xf')]('headers',_0x2287ea);this[_0x429c('0x4')]=!![];}_0x1ae770++;}this['_localBuffer']=_0x4d8afc;}else{while((_0x3bd101=_0x4d8afc['indexOf'](_0x458905))!=-0x1){_0x197e5b=_0x4d8afc[_0x429c('0xa')](0x0,_0x3bd101);this[_0x429c('0xf')](_0x429c('0x10'),_0x197e5b);_0x4d8afc=_0x4d8afc[_0x429c('0xa')](_0x3bd101+_0x458905['length']);}this[_0x429c('0x3')]=_0x4d8afc;}_0x130049();};module[_0x429c('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index e89cb2a..b0198fd 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 _0x8b7c=['Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','Smtp','CloudProvider','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name'];(function(_0x5a67ea,_0x42eb27){var _0x5899d9=function(_0x532301){while(--_0x532301){_0x5a67ea['push'](_0x5a67ea['shift']());}};_0x5899d9(++_0x42eb27);}(_0x8b7c,0x119));var _0xc8b7=function(_0x55c979,_0x36c5f0){_0x55c979=_0x55c979-0x0;var _0x690107=_0x8b7c[_0x55c979];return _0x690107;};'use strict';var _=require(_0xc8b7('0x0'));var moment=require(_0xc8b7('0x1'));var jayson=require(_0xc8b7('0x2'));var client=jayson[_0xc8b7('0x3')][_0xc8b7('0x4')]({'port':0x2329});function request(_0x47766d,_0x47089d){return new Promise(function(_0x201c49,_0x4f66ab){return client[_0xc8b7('0x5')](_0x47766d,_0x47089d)[_0xc8b7('0x6')](function(_0x3899cd){if(_0x3899cd['error']){return _0x4f66ab(_0x3899cd[_0xc8b7('0x7')][_0xc8b7('0x8')]);}else{return _0x201c49(_0x3899cd[_0xc8b7('0x9')]);}})[_0xc8b7('0xa')](function(_0x9e4763){return _0x4f66ab(_0x9e4763);});});}exports[_0xc8b7('0xb')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xc8b7('0xc'),'production']}});};exports[_0xc8b7('0xd')]=function(_0xf69f1f){return request(_0xc8b7('0xe'),{'options':{'raw':![],'where':{'name':_0xf69f1f},'attributes':[_0xc8b7('0xf')]}});};exports[_0xc8b7('0x10')]=function(_0x4f4587){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4f4587},'include':[{'model':'MailServerOut','as':_0xc8b7('0x11'),'include':[{'model':_0xc8b7('0x12'),'as':_0xc8b7('0x12')}]}],'attributes':['id',_0xc8b7('0xc'),'email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x4d4269){return request(_0xc8b7('0xe'),{'options':{'where':{'id':_0x4d4269},'attributes':[_0xc8b7('0xc')]}});};exports[_0xc8b7('0x13')]=function(_0x5c6e5b){return request(_0xc8b7('0x14'),{'options':{'where':{'id':_0x5c6e5b},'attributes':[_0xc8b7('0xc')]}});};exports[_0xc8b7('0x15')]=function(_0x1b7dc0){return request(_0xc8b7('0x16'),{'options':{'where':{'id':_0x1b7dc0},'attributes':['name']}});};exports[_0xc8b7('0x17')]=function(_0x26d70a){return request(_0xc8b7('0x18'),{'options':{'where':{'id':_0x26d70a},'attributes':[_0xc8b7('0x19')]}});};exports[_0xc8b7('0x1a')]=function(_0x186dbd){return request(_0xc8b7('0x1b'),{'options':{'where':{'id':_0x186dbd},'attributes':['name']}});};exports['getContactByPhone']=function(_0x1cf47c){return request(_0xc8b7('0x1c'),{'options':{'where':{'phone':_0x1cf47c[_0xc8b7('0x1d')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x5df9f7){return request(_0xc8b7('0x1e'),{'options':{'where':{'id':_0x5df9f7},'attributes':['name']}});};exports[_0xc8b7('0x1f')]=function(_0x566c4d){return request(_0xc8b7('0x20'),{'options':{'where':{'id':_0x566c4d},'attributes':[_0xc8b7('0x21')]}});};exports['getIntervalById']=function(_0x298e69){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x298e69},'include':[{'model':_0xc8b7('0x22'),'as':_0xc8b7('0x23')}]}});};exports[_0xc8b7('0x24')]=function(_0x5e11cd){return request(_0xc8b7('0x25'),{'options':{'where':{'id':_0x5e11cd},'attributes':['id',_0xc8b7('0xc')]}});};exports[_0xc8b7('0x26')]=function(_0x5b28ad){return request(_0xc8b7('0x27'),{'body':_0x5b28ad});};exports[_0xc8b7('0x28')]=function(_0x908acb){return request(_0xc8b7('0x29'),{'body':_0x908acb});};exports[_0xc8b7('0x2a')]=function(_0x3d6a2b){return request(_0xc8b7('0x2b'),{'body':_[_0xc8b7('0x2c')](_0x3d6a2b,{'project_name':_0x3d6a2b[_0xc8b7('0x2d')],'prev_project_name':_0x3d6a2b[_0xc8b7('0x2e')]||'','is_subproject':_0x3d6a2b[_0xc8b7('0x2e')]?!![]:![],'leaveAt':moment()['format'](_0xc8b7('0x2f'))})});};exports[_0xc8b7('0x30')]=function(_0x3a9ce2){return request(_0xc8b7('0x31'),{'body':_0x3a9ce2});};exports[_0xc8b7('0x32')]=function(_0x311047){return request('CreateSquareMessage',{'body':_0x311047});};exports['createCmContact']=function(_0x16cc83){return request(_0xc8b7('0x33'),{'options':{'raw':![],'where':{'phone':_0x16cc83[_0xc8b7('0x1d')],'ListId':_0x16cc83[_0xc8b7('0x34')]}}})[_0xc8b7('0x6')](function(_0x17cae3){if(_0x17cae3){return _0x17cae3;}return request(_0xc8b7('0x35'),{'body':_0x16cc83});});};exports['getPauseById']=function(_0x3a9658){return request(_0xc8b7('0x36'),{'options':{'where':{'id':_0x3a9658},'attributes':[_0xc8b7('0xc')]}});};exports[_0xc8b7('0x37')]=function(_0x27f4b7,_0x340af1){return request(_0xc8b7('0x38'),{'body':{'interface':_0x340af1},'options':{'where':_0x27f4b7}});};exports[_0xc8b7('0x39')]=function(_0x4fe3e4,_0x247388,_0x3c5db5){return request(_0xc8b7('0x3a'),{'body':{'type':_0x247388,'uniqueid':_0x3c5db5},'options':{'where':_0x4fe3e4}});};exports[_0xc8b7('0x3b')]=function(_0x2d6e6b){return request(_0xc8b7('0x3c'),{'body':{},'options':{'where':_0x2d6e6b}});};exports[_0xc8b7('0x3d')]=function(_0x34c7d6){return request(_0xc8b7('0x3e'),{'body':{},'options':{'where':_0x34c7d6}});}; \ No newline at end of file +var _0xac9d=['createCmContact','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','moment','jayson/promise','client','http','request','error','message','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage'];(function(_0x15fc0c,_0x1e023b){var _0x1c9d81=function(_0x174e0b){while(--_0x174e0b){_0x15fc0c['push'](_0x15fc0c['shift']());}};_0x1c9d81(++_0x1e023b);}(_0xac9d,0x14d));var _0xdac9=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xac9d[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var jayson=require(_0xdac9('0x2'));var client=jayson[_0xdac9('0x3')][_0xdac9('0x4')]({'port':0x2329});function request(_0x27eb7c,_0x25d1b3){return new Promise(function(_0x1b967e,_0x51a5d7){return client[_0xdac9('0x5')](_0x27eb7c,_0x25d1b3)['then'](function(_0x3d56ae){if(_0x3d56ae[_0xdac9('0x6')]){return _0x51a5d7(_0x3d56ae[_0xdac9('0x6')][_0xdac9('0x7')]);}else{return _0x1b967e(_0x3d56ae[_0xdac9('0x8')]);}})[_0xdac9('0x9')](function(_0x5531af){return _0x51a5d7(_0x5531af);});});}exports[_0xdac9('0xa')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xdac9('0xb'),_0xdac9('0xc')]}});};exports[_0xdac9('0xd')]=function(_0x1a4674){return request(_0xdac9('0xe'),{'options':{'raw':![],'where':{'name':_0x1a4674},'attributes':[_0xdac9('0xc')]}});};exports[_0xdac9('0xf')]=function(_0x1b604a){return request(_0xdac9('0x10'),{'options':{'raw':![],'where':{'id':_0x1b604a},'include':[{'model':'MailServerOut','as':_0xdac9('0x11'),'include':[{'model':_0xdac9('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0xdac9('0xb'),_0xdac9('0x13')],'smtp':!![]}});};exports[_0xdac9('0x14')]=function(_0x4b2436){return request(_0xdac9('0xe'),{'options':{'where':{'id':_0x4b2436},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x15')]=function(_0x5f0bbd){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5f0bbd},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x16')]=function(_0x50f9fe){return request(_0xdac9('0x17'),{'options':{'where':{'id':_0x50f9fe},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x18')]=function(_0x5b2f1b){return request(_0xdac9('0x19'),{'options':{'where':{'id':_0x5b2f1b},'attributes':[_0xdac9('0x1a')]}});};exports[_0xdac9('0x1b')]=function(_0xec1016){return request('ShowUser',{'options':{'where':{'id':_0xec1016},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x1c')]=function(_0x571e07){return request(_0xdac9('0x1d'),{'options':{'where':{'phone':_0x571e07[_0xdac9('0x1e')]},'attributes':['id']}});};exports[_0xdac9('0x1f')]=function(_0x181d11){return request('ShowTrunk',{'options':{'where':{'id':_0x181d11},'attributes':['name']}});};exports[_0xdac9('0x20')]=function(_0x20ece3){return request(_0xdac9('0x21'),{'options':{'where':{'id':_0x20ece3},'attributes':[_0xdac9('0x22')]}});};exports['getIntervalById']=function(_0x23ee5e){return request(_0xdac9('0x23'),{'options':{'raw':![],'where':{'id':_0x23ee5e},'include':[{'model':_0xdac9('0x24'),'as':_0xdac9('0x25')}]}});};exports[_0xdac9('0x26')]=function(_0x42317c){return request(_0xdac9('0x27'),{'options':{'where':{'id':_0x42317c},'attributes':['id',_0xdac9('0xb')]}});};exports[_0xdac9('0x28')]=function(_0x33de5c){return request('CreateSmsMessage',{'body':_0x33de5c});};exports[_0xdac9('0x29')]=function(_0x11f4fd){return request(_0xdac9('0x2a'),{'body':_0x11f4fd});};exports[_0xdac9('0x2b')]=function(_0x5ca076){return request(_0xdac9('0x2c'),{'body':_['merge'](_0x5ca076,{'project_name':_0x5ca076[_0xdac9('0x2d')],'prev_project_name':_0x5ca076[_0xdac9('0x2e')]||'','is_subproject':_0x5ca076['arg_2']?!![]:![],'leaveAt':moment()[_0xdac9('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xdac9('0x30')]=function(_0x3743f7){return request(_0xdac9('0x31'),{'body':_0x3743f7});};exports[_0xdac9('0x32')]=function(_0x57d76a){return request('CreateSquareMessage',{'body':_0x57d76a});};exports[_0xdac9('0x33')]=function(_0x170afd){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x170afd['phone'],'ListId':_0x170afd[_0xdac9('0x34')]}}})[_0xdac9('0x35')](function(_0x13efba){if(_0x13efba){return _0x13efba;}return request(_0xdac9('0x36'),{'body':_0x170afd});});};exports[_0xdac9('0x37')]=function(_0x2247f8){return request(_0xdac9('0x38'),{'options':{'where':{'id':_0x2247f8},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x39')]=function(_0x2f36f4,_0xb49c21){return request(_0xdac9('0x3a'),{'body':{'interface':_0xb49c21},'options':{'where':_0x2f36f4}});};exports[_0xdac9('0x3b')]=function(_0x336fd5,_0x410cec,_0x446080){return request(_0xdac9('0x3c'),{'body':{'type':_0x410cec,'uniqueid':_0x446080},'options':{'where':_0x336fd5}});};exports[_0xdac9('0x3d')]=function(_0x339f31){return request(_0xdac9('0x3e'),{'body':{},'options':{'where':_0x339f31}});};exports[_0xdac9('0x3f')]=function(_0x514eee){return request('LogoutUser',{'body':{},'options':{'where':_0x514eee}});}; \ 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 a44aeb8..7182d5f 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 _0x03db=['./polly','./lex','exports'];(function(_0x49caf4,_0x33d5b4){var _0x355943=function(_0x27bdae){while(--_0x27bdae){_0x49caf4['push'](_0x49caf4['shift']());}};_0x355943(++_0x33d5b4);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};var polly=require(_0xb03d('0x0'));var lex=require(_0xb03d('0x1'));module[_0xb03d('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x2706=['exports','./lex'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x2706,0x107));var _0x6270=function(_0x46e0a0,_0x33bbb9){_0x46e0a0=_0x46e0a0-0x0;var _0x2f3aa2=_0x2706[_0x46e0a0];return _0x2f3aa2;};var polly=require('./polly');var lex=require(_0x6270('0x0'));module[_0x6270('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 e0107b7..974e4dd 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 _0x70e0=['exports','./lib/api'];(function(_0x223a3e,_0x2da798){var _0x582005=function(_0x4adba8){while(--_0x4adba8){_0x223a3e['push'](_0x223a3e['shift']());}};_0x582005(++_0x2da798);}(_0x70e0,0x17b));var _0x070e=function(_0x57b94f,_0x37a250){_0x57b94f=_0x57b94f-0x0;var _0x96df9f=_0x70e0[_0x57b94f];return _0x96df9f;};'use strict';var lex=require(_0x070e('0x0'));module[_0x070e('0x1')]=function(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32){return lex(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32);}; \ No newline at end of file +var _0x6f0d=['exports'];(function(_0x3b32b2,_0x13397d){var _0xc3e55=function(_0x392d24){while(--_0x392d24){_0x3b32b2['push'](_0x3b32b2['shift']());}};_0xc3e55(++_0x13397d);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x39dac8,_0x981ece){_0x39dac8=_0x39dac8-0x0;var _0x310a98=_0x6f0d[_0x39dac8];return _0x310a98;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ 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 25957fe..248af7b 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(_0x4d5f86,_0x4ba228){var _0x286790=function(_0x380bee){while(--_0x380bee){_0x4d5f86['push'](_0x4d5f86['shift']());}};_0x286790(++_0x4ba228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x40ad9e,_0x5b1278){var _0x45eaf7=function(_0x2c7c15){while(--_0x2c7c15){_0x40ad9e['push'](_0x40ad9e['shift']());}};_0x45eaf7(++_0x5b1278);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 16fdf9f..1e7aa63 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 _0x8bd6=['exports','./lib/api'];(function(_0x2b5d9c,_0x4cf3cd){var _0x184937=function(_0x198c57){while(--_0x198c57){_0x2b5d9c['push'](_0x2b5d9c['shift']());}};_0x184937(++_0x4cf3cd);}(_0x8bd6,0x9b));var _0x68bd=function(_0x140115,_0x4555dd){_0x140115=_0x140115-0x0;var _0x5e88ed=_0x8bd6[_0x140115];return _0x5e88ed;};'use strict';var polly=require(_0x68bd('0x0'));module[_0x68bd('0x1')]=function(_0x50cf65,_0x45b039,_0x3b410f,_0x55e2a3,_0x164766,_0x4f6f61,_0x7282ae){return polly(_0x50cf65,_0x45b039,_0x3b410f,_0x55e2a3,_0x164766,_0x4f6f61,_0x7282ae);}; \ No newline at end of file +var _0x5b12=['./lib/api','exports'];(function(_0x4fddf9,_0x1ac6ae){var _0x21d1a9=function(_0x22e611){while(--_0x22e611){_0x4fddf9['push'](_0x4fddf9['shift']());}};_0x21d1a9(++_0x1ac6ae);}(_0x5b12,0xa6));var _0x25b1=function(_0x38d6d7,_0x20d153){_0x38d6d7=_0x38d6d7-0x0;var _0xb694c=_0x5b12[_0x38d6d7];return _0xb694c;};'use strict';var polly=require(_0x25b1('0x0'));module[_0x25b1('0x1')]=function(_0x25e9ca,_0x163046,_0x246cc5,_0x5b36de,_0x270767,_0x308bb6,_0x1110ea){return polly(_0x25e9ca,_0x163046,_0x246cc5,_0x5b36de,_0x270767,_0x308bb6,_0x1110ea);}; \ 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 0ad3138..66bf41b 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 _0x881b=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile'];(function(_0x1a680b,_0x3df1ae){var _0x19c9ec=function(_0x45a199){while(--_0x45a199){_0x1a680b['push'](_0x1a680b['shift']());}};_0x19c9ec(++_0x3df1ae);}(_0x881b,0x13e));var _0xb881=function(_0x1535be,_0x4335a5){_0x1535be=_0x1535be-0x0;var _0x307aa0=_0x881b[_0x1535be];return _0x307aa0;};'use strict';var fs=require('fs');var path=require(_0xb881('0x0'));var BPromise=require(_0xb881('0x1'));var rs=require(_0xb881('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x319f3e,_0x2b8d35,_0x33abae){return new BPromise(function(_0x3ccf4e,_0x4a2db3){_0x319f3e[_0xb881('0x3')](_0x2b8d35,function(_0x5848ed,_0x41d578){if(_0x5848ed){_0x4a2db3(_0x5848ed);}else if(_0x41d578){if(_0x41d578[_0xb881('0x4')]instanceof Buffer){fs[_0xb881('0x5')](_0x33abae,_0x41d578[_0xb881('0x4')],function(_0x584efd){if(_0x584efd){_0x4a2db3(_0x584efd);}else{_0x3ccf4e();}});}else{_0x4a2db3(new Error(_0xb881('0x6')));}}else{_0x4a2db3(new Error(_0xb881('0x7')));}});});}module[_0xb881('0x8')]=function(_0x2bd308,_0x567ca8,_0x4bbe59,_0x5f2256,_0x5b482a,_0x258916,_0x28e6fe){var _0x1ea6e8=new AWS[(_0xb881('0x9'))]({'accessKeyId':_0x2bd308,'secretAccessKey':_0x567ca8,'region':_0x4bbe59});var _0x3b6f6d={'Text':_0x5b482a,'TextType':_0x258916||_0xb881('0xa'),'OutputFormat':_0xb881('0xb'),'VoiceId':_0x5f2256};return pollyResult(_0x1ea6e8,_0x3b6f6d,_0x28e6fe);}; \ No newline at end of file +var _0xcd0e=['bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path'];(function(_0x6d070a,_0x47e825){var _0x2c065d=function(_0xd0565c){while(--_0xd0565c){_0x6d070a['push'](_0x6d070a['shift']());}};_0x2c065d(++_0x47e825);}(_0xcd0e,0x1ee));var _0xecd0=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xcd0e[_0x43b08];return _0x5e05f4;};'use strict';var fs=require('fs');var path=require(_0xecd0('0x0'));var BPromise=require(_0xecd0('0x1'));var rs=require(_0xecd0('0x2'));var AWS=require(_0xecd0('0x3'));function pollyResult(_0x4440f5,_0x19aa57,_0x633076){return new BPromise(function(_0x354fab,_0x4fb4f9){_0x4440f5[_0xecd0('0x4')](_0x19aa57,function(_0x42b5d2,_0xa97e77){if(_0x42b5d2){_0x4fb4f9(_0x42b5d2);}else if(_0xa97e77){if(_0xa97e77[_0xecd0('0x5')]instanceof Buffer){fs[_0xecd0('0x6')](_0x633076,_0xa97e77[_0xecd0('0x5')],function(_0x2ec5f2){if(_0x2ec5f2){_0x4fb4f9(_0x2ec5f2);}else{_0x354fab();}});}else{_0x4fb4f9(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4fb4f9(new Error(_0xecd0('0x7')));}});});}module['exports']=function(_0x408b22,_0x2e67d5,_0x347116,_0x1d7336,_0x2e14b4,_0x2fb346,_0x143314){var _0xdee6d5=new AWS[(_0xecd0('0x8'))]({'accessKeyId':_0x408b22,'secretAccessKey':_0x2e67d5,'region':_0x347116});var _0x1d7d3d={'Text':_0x2e14b4,'TextType':_0x2fb346||_0xecd0('0x9'),'OutputFormat':_0xecd0('0xa'),'VoiceId':_0x1d7336};return pollyResult(_0xdee6d5,_0x1d7d3d,_0x143314);}; \ 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 90ef469..3d182b9 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 _0x08ae=['./lib/api'];(function(_0xb13e8b,_0x327dc9){var _0x459143=function(_0x65db7d){while(--_0x65db7d){_0xb13e8b['push'](_0xb13e8b['shift']());}};_0x459143(++_0x327dc9);}(_0x08ae,0xed));var _0xe08a=function(_0x44efc3,_0xe3381c){_0x44efc3=_0x44efc3-0x0;var _0x15dfc0=_0x08ae[_0x44efc3];return _0x15dfc0;};'use strict';var asr=require(_0xe08a('0x0'));module['exports']=function(_0x13a8c5,_0x1a247e,_0x4e0bfa,_0x481fdd){return asr(_0x13a8c5,_0x1a247e,_0x4e0bfa);}; \ No newline at end of file +var _0x9f70=['exports','./lib/api'];(function(_0x3a3e24,_0x40a3c0){var _0x41db6a=function(_0x428338){while(--_0x428338){_0x3a3e24['push'](_0x3a3e24['shift']());}};_0x41db6a(++_0x40a3c0);}(_0x9f70,0x1c7));var _0x09f7=function(_0x38531d,_0x22bf04){_0x38531d=_0x38531d-0x0;var _0x2b8dd9=_0x9f70[_0x38531d];return _0x2b8dd9;};'use strict';var asr=require(_0x09f7('0x0'));module[_0x09f7('0x1')]=function(_0x4c57ba,_0x567917,_0x17e224,_0x2dc894){return asr(_0x4c57ba,_0x567917,_0x17e224);}; \ 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 6d0ee14..f07221d 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 _0xfc1e=['8000','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xfc1e[_0x618414];return _0x21c19a;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xefc1('0x0')]=function(_0x22ce4b,_0x2a6255,_0x913595){return new BPromise(function(_0xbe8efc,_0x4960a1){var _0xd502e9;if(typeof _0x22ce4b!==_0xefc1('0x1')||_0x22ce4b['length']===0x0){return _0x4960a1('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a6255!==_0xefc1('0x1')||_0x2a6255[_0xefc1('0x2')]===0x0){return _0x4960a1(_0xefc1('0x3'));}if(typeof _0x913595!==_0xefc1('0x4')&&(typeof _0x913595!==_0xefc1('0x1')||_0x913595[_0xefc1('0x2')]===0x0)){return _0x4960a1(_0xefc1('0x5'));}try{_0xd502e9=fs[_0xefc1('0x6')](_0x22ce4b)[_0xefc1('0x7')](_0xefc1('0x8'));}catch(_0x1d10bc){return _0x4960a1(_0x1d10bc);}return _0xbe8efc({'method':'POST','uri':host+_0xefc1('0x9')+_0x2a6255,'body':{'config':{'encoding':_0xefc1('0xa'),'sampleRateHertz':_0xefc1('0xb'),'languageCode':_0x913595},'audio':{'content':_0xd502e9}},'json':!![]});});}; \ No newline at end of file +var _0x7341=['https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0x43d96d,_0x528146){var _0x42f48b=function(_0x579152){while(--_0x579152){_0x43d96d['push'](_0x43d96d['shift']());}};_0x42f48b(++_0x528146);}(_0x7341,0xe4));var _0x1734=function(_0x53d2a2,_0x5ac6db){_0x53d2a2=_0x53d2a2-0x0;var _0x5bca64=_0x7341[_0x53d2a2];return _0x5bca64;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x1734('0x0');module['exports']=function(_0x2cfd38,_0x36397c,_0x47c889){return new BPromise(function(_0x3bf99a,_0x42c26d){var _0x3010fd;if(typeof _0x2cfd38!==_0x1734('0x1')||_0x2cfd38[_0x1734('0x2')]===0x0){return _0x42c26d(_0x1734('0x3'));}if(typeof _0x36397c!==_0x1734('0x1')||_0x36397c['length']===0x0){return _0x42c26d(_0x1734('0x4'));}if(typeof _0x47c889!==_0x1734('0x5')&&(typeof _0x47c889!==_0x1734('0x1')||_0x47c889['length']===0x0)){return _0x42c26d(_0x1734('0x6'));}try{_0x3010fd=fs['readFileSync'](_0x2cfd38)['toString'](_0x1734('0x7'));}catch(_0xcf0632){return _0x42c26d(_0xcf0632);}return _0x3bf99a({'method':_0x1734('0x8'),'uri':host+_0x1734('0x9')+_0x36397c,'body':{'config':{'encoding':_0x1734('0xa'),'sampleRateHertz':_0x1734('0xb'),'languageCode':_0x47c889},'audio':{'content':_0x3010fd}},'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 3c1e27f..774ca7a 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 _0xb796=['./asr'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb796,0xbf));var _0x6b79=function(_0x4401d1,_0x5844ef){_0x4401d1=_0x4401d1-0x0;var _0x13cef1=_0xb796[_0x4401d1];return _0x13cef1;};var asr=require(_0x6b79('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x9c1e=['./asr'];(function(_0x27b42e,_0x5f5289){var _0xf59069=function(_0x2577b0){while(--_0x2577b0){_0x27b42e['push'](_0x27b42e['shift']());}};_0xf59069(++_0x5f5289);}(_0x9c1e,0x13a));var _0xe9c1=function(_0x4c492c,_0x1a9c4c){_0x4c492c=_0x4c492c-0x0;var _0x460e16=_0x9c1e[_0x4c492c];return _0x460e16;};var asr=require(_0xe9c1('0x0'));module['exports']={'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 e4bd524..f3dd984 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 _0xc941=['google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish\x20download\x20file','close','unlink','download\x20error','end','WHAT_EVER','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','then','chmodSync','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','generate','.wav','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','code','metadata','endConversation','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','confidence','awsPolly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','channelData','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','dialogflow','https','md5','querystring','randomstring','sox'];(function(_0x5f392b,_0x38c3d4){var _0x5fe20b=function(_0x45a2b5){while(--_0x45a2b5){_0x5f392b['push'](_0x5f392b['shift']());}};_0x5fe20b(++_0x38c3d4);}(_0xc941,0x10b));var _0x1c94=function(_0xe60792,_0x70bcf5){_0xe60792=_0xe60792-0x0;var _0x566013=_0xc941[_0xe60792];return _0x566013;};'use strict';var apiai=require(_0x1c94('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x1c94('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x1c94('0x2'));var md5=require(_0x1c94('0x3'));var path=require('path');var querystring=require(_0x1c94('0x4'));var rp=require('request-promise');var rs=require(_0x1c94('0x5'));var sox=require(_0x1c94('0x6'));var tts=require(_0x1c94('0x7'));var urlParse=require(_0x1c94('0x8'))[_0x1c94('0x9')];var util=require(_0x1c94('0xa'));var aws=require(_0x1c94('0xb'));var google=require(_0x1c94('0xc'));var sestek=require(_0x1c94('0xd'));var tilde=require(_0x1c94('0xe'));var logger=require(_0x1c94('0xf'))(_0x1c94('0x10'));var ISPEECH_API=_0x1c94('0x11');function downloadFile(_0x156192,_0x2ed437){return new BPromise(function(_0x3c304f,_0x1dcc8d){var _0x24c5f6=urlParse(_0x156192);var _0x4271d2=_0x24c5f6[_0x1c94('0x12')]===_0x1c94('0x13')?https:http;var _0x4fef89={'host':_0x24c5f6[_0x1c94('0x14')],'path':_0x24c5f6[_0x1c94('0x15')],'headers':{'user-agent':'WHAT_EVER'}};_0x4271d2[_0x1c94('0x16')](_0x4fef89,function(_0x1d53f3){if(_0x1d53f3[_0x1c94('0x17')]!==0xc8){logger[_0x1c94('0x18')](_0x1c94('0x19')+_0x156192+_0x1c94('0x1a')+_0x1d53f3[_0x1c94('0x17')]+'\x20('+_0x1d53f3[_0x1c94('0x1b')]+')');_0x1dcc8d(new Error(_0x1c94('0x19')+_0x156192+_0x1c94('0x1a')+_0x1d53f3[_0x1c94('0x17')]+'\x20('+_0x1d53f3[_0x1c94('0x1b')]+')'));return;}var _0x165958=fs['createWriteStream'](_0x2ed437);_0x165958['on']('finish',function(){logger['info'](_0x1c94('0x1c'));_0x165958[_0x1c94('0x1d')](_0x3c304f);});_0x165958['on'](_0x1c94('0x18'),function(_0x178ca0){fs[_0x1c94('0x1e')](_0x2ed437);logger[_0x1c94('0x18')](_0x1c94('0x1f'),_0x178ca0);_0x1dcc8d(_0x178ca0);});_0x1d53f3['pipe'](_0x165958);})['on'](_0x1c94('0x18'),function(_0x36567c){logger[_0x1c94('0x18')](_0x36567c);_0x1dcc8d(_0x36567c);})[_0x1c94('0x20')]();});}function uploadFile(_0x5c465e){return new BPromise(function(_0x1f2b0d,_0x305398){var _0xca004f=urlParse(_0x5c465e);var _0x399177=_0xca004f[_0x1c94('0x12')]==='https:'?https:http;var _0x495e27={'host':_0xca004f[_0x1c94('0x14')],'path':_0xca004f[_0x1c94('0x15')],'headers':{'user-agent':_0x1c94('0x21')}};_0x399177[_0x1c94('0x16')](_0x495e27,function(_0xb9a5b3){if(_0xb9a5b3[_0x1c94('0x17')]!==0xc8){_0x305398(new Error(_0x1c94('0x19')+_0x5c465e+_0x1c94('0x1a')+_0xb9a5b3[_0x1c94('0x17')]+'\x20('+_0xb9a5b3[_0x1c94('0x1b')]+')'));return;}var _0x13a675='';_0xb9a5b3['on']('data',function(_0x79fc5a){_0x13a675+=_0x79fc5a;});_0xb9a5b3['on'](_0x1c94('0x20'),function(){_0x1f2b0d(_0x13a675);});})['on']('error',function(_0x4bb468){_0x305398(_0x4bb468);})['end']();});}function convertFile(_0x18d946,_0x554034){return new BPromise(function(_0x183698,_0x385c2a){var _0x403b10=sox[_0x1c94('0x22')](_0x18d946,_0x554034,{'sampleRate':0x1f40,'format':_0x1c94('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x403b10['on'](_0x1c94('0x18'),function(_0x3de060){logger[_0x1c94('0x18')](_0x1c94('0x24'),_0x3de060);_0x385c2a(_0x3de060);});_0x403b10['on'](_0x1c94('0x20'),function(){logger[_0x1c94('0x25')](_0x1c94('0x26'));_0x183698();});_0x403b10[_0x1c94('0x27')]();});}function base64Decode(_0x4d1144,_0x61bf17){var _0x58f640=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x58f640,_0x4d1144,'base64');return convertFile(_0x58f640,_0x61bf17)[_0x1c94('0x2a')](function(){try{fs[_0x1c94('0x1e')](_0x58f640);fs[_0x1c94('0x2b')](_0x61bf17,'777');}catch(_0x3e7e58){logger[_0x1c94('0x18')](_0x3e7e58);}return _0x61bf17['split']('.')[0x0];});}function base64Encode(_0x513260){var _0x480deb=fs[_0x1c94('0x2c')](_0x513260);return new Buffer(_0x480deb)[_0x1c94('0x2d')](_0x1c94('0x2e'));}exports[_0x1c94('0x2f')]=function(_0x2a4c5f,_0x782597,_0x1c46d0,_0x2b534d,_0x467063,_0x2e8f21){var _0x50a8f6,_0x13116e;var _0x1728ff=_0x1c94('0x30');var _0xa6bf9f='?key='+_0x2a4c5f;var _0xa760b6={};if(_0x782597===_0x1c94('0x31')){_0xa760b6[_0x1c94('0x32')]={'ssml':_0x1c46d0};}else{_0xa760b6[_0x1c94('0x32')]={'text':_0x1c46d0};};_0xa760b6[_0x1c94('0x33')]={'languageCode':_0x2b534d,'ssmlGender':_0x467063};_0xa760b6[_0x1c94('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x55f031={'url':_0x1728ff+_0x1c94('0x35')+_0xa6bf9f,'method':_0x1c94('0x36'),'json':!![],'body':_0xa760b6};return rp(_0x55f031)['then'](function(_0x78bcbc){return new BPromise(function(_0x4c20d3,_0xe6553c){_0x50a8f6=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+_0x1c94('0x37'));var _0x49f39e=Buffer[_0x1c94('0x38')](_0x78bcbc[_0x1c94('0x39')],_0x1c94('0x2e'));return fs[_0x1c94('0x3a')](_0x50a8f6,_0x49f39e,function(_0xca8774){_0xe6553c(_0xca8774);},function(_0x175429){fs[_0x1c94('0x2b')](_0x50a8f6,_0x1c94('0x3b'));_0x4c20d3(_0x175429);});});})['then'](function(_0x1a20fc){_0x13116e=path['resolve'](__dirname,'tmp',rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d'));return convertFile(_0x50a8f6,_0x13116e);})[_0x1c94('0x2a')](function(){try{fs[_0x1c94('0x1e')](_0x50a8f6);fs['chmodSync'](_0x13116e,_0x1c94('0x3b'));}catch(_0x1ceb19){logger[_0x1c94('0x18')](_0x1ceb19);}logger[_0x1c94('0x25')](_0x1c94('0x3e'),_0x13116e[_0x1c94('0x3f')]('.')[0x0]);return _0x13116e[_0x1c94('0x3f')]('.')[0x0];});};exports[_0x1c94('0x40')]=function(_0x13200a,_0x4243c1){var _0x41572f=_0x1c94('0x41');var _0x1bdac9,_0x1b06b4;var _0x850981;var _0xc92ff7={'encoding':_0x1c94('0x42'),'method':'POST','timeout':0x2710,'url':_0x41572f,'headers':{'Content-Type':_0x1c94('0x43')},'body':_0x1c94('0x44')+encodeURIComponent(JSON[_0x1c94('0x45')]([[[_0x1c94('0x46'),JSON[_0x1c94('0x45')]([_0x13200a,_0x4243c1||'en',![],_0x1c94('0x47')]),null,_0x1c94('0x48')]]]))};return rp(_0xc92ff7)[_0x1c94('0x2a')](function(_0x395f8f){try{_0x850981=eval(_0x395f8f[_0x1c94('0x49')](0x5))[0x0][0x2];}catch(_0x20aef0){throw new Error(_0x1c94('0x4a')+_0x395f8f[_0x1c94('0x4b')]);}if(!_0x850981){if(_0x13200a[_0x1c94('0x4c')]>0xc8){throw new Error(_0x1c94('0x4d'));}else{throw new Error(_0x1c94('0x4e')+_0x4243c1+'\x22\x20might\x20not\x20exist');}}try{_0x850981=eval(_0x850981)[0x0];}catch(_0x3f7845){throw new Error(_0x1c94('0x4a')+res[_0x1c94('0x4b')]);}const _0x2ec596=_0x850981;_0x1bdac9=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+_0x1c94('0x37'));fs[_0x1c94('0x4f')](_0x1bdac9,_0x850981,{'encoding':_0x1c94('0x2e')});_0x1b06b4=path['resolve'](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+_0x1c94('0x3d'));return convertFile(_0x1bdac9,_0x1b06b4);})[_0x1c94('0x2a')](function(){try{fs['unlink'](_0x1bdac9);fs[_0x1c94('0x2b')](_0x1b06b4,_0x1c94('0x3b'));}catch(_0x57541a){logger[_0x1c94('0x18')](_0x57541a);}logger['info'](_0x1c94('0x50'),_0x1b06b4[_0x1c94('0x3f')]('.')[0x0]);return _0x1b06b4['split']('.')[0x0];});};exports[_0x1c94('0x51')]=function(_0xf5501d,_0x2552d8,_0x6596b6){return google[_0x1c94('0x52')](_0xf5501d,_0x2552d8,_0x6596b6)[_0x1c94('0x2a')](function(_0x2e2494){logger['info'](_0x2e2494['uri']);return rp(_0x2e2494);})[_0x1c94('0x2a')](function(_0x5bc125){var _0x1fccaa='';var _0x25494a=0x0;try{fs[_0x1c94('0x1e')](_0xf5501d);}catch(_0x330a46){logger[_0x1c94('0x18')](_0x330a46);}if(_0x5bc125&&_0x5bc125[_0x1c94('0x53')]){_0x1fccaa=_0x5bc125[_0x1c94('0x53')][_0x1c94('0x54')](function(_0x3fe043){return _0x3fe043&&_0x3fe043[_0x1c94('0x55')][0x0]&&_0x3fe043['alternatives'][0x0][_0x1c94('0x56')]?_0x3fe043[_0x1c94('0x55')][0x0][_0x1c94('0x56')]:'';})[_0x1c94('0x57')]('\x0a');_0x25494a=_0x5bc125['results']['map'](function(_0x4024a0){return _0x4024a0&&_0x4024a0[_0x1c94('0x55')][0x0]&&_0x4024a0[_0x1c94('0x55')][0x0]['confidence']?_0x4024a0[_0x1c94('0x55')][0x0]['confidence']:0x0;})[_0x1c94('0x57')]('\x0a');}logger[_0x1c94('0x25')](_0x1c94('0x58'),_0x1fccaa);logger[_0x1c94('0x25')](_0x1c94('0x59'),_0x25494a);return{'transcript':_0x1fccaa,'confidence':_0x25494a};})['catch'](function(_0x35262d){logger[_0x1c94('0x18')](_0x1c94('0x5a'),_0x35262d['statusCode'],_0x35262d[_0x1c94('0x5b')],_0x35262d[_0x1c94('0x5c')]);});};exports[_0x1c94('0x5d')]=function(_0x588bc7,_0x43c75c,_0x38d8ae,_0x256000){var _0x936daa=apiai(_0x43c75c,{'language':_0x256000||'en'});return _0x936daa[_0x1c94('0x5e')](_0x38d8ae,{'sessionId':md5(_0x588bc7)})[_0x1c94('0x2a')](function(_0x44a1b6){logger[_0x1c94('0x25')](JSON[_0x1c94('0x45')](_0x44a1b6));return{'source':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x60')],'resolvedQuery':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x61')],'action':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x62')],'actionIncomplete':_0x44a1b6[_0x1c94('0x5f')]['actionIncomplete'],'speech':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x63')][_0x1c94('0x64')],'score':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x65')],'statusCode':_0x44a1b6['status'][_0x1c94('0x66')],'endConversation':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x67')][_0x1c94('0x68')]||![],'isFallbackIntent':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x67')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x109991,_0x154186,_0x50ca2c,_0x171176,_0x2065dc,_0x447bd4){var _0x44d785=_0x171176[_0x1c94('0x69')](/\\n/g,'\x0a');var _0x2dd6c9={'credentials':{'private_key':_0x44d785,'client_email':_0x50ca2c}};var _0x34e7ec=new dialogflow[(_0x1c94('0x6a'))](_0x2dd6c9);var _0xd30133=_0x34e7ec[_0x1c94('0x6b')](_0x154186,md5(_0x109991));var _0x2645a8={'session':_0xd30133,'queryInput':{'text':{'text':_0x2065dc,'languageCode':_0x447bd4}}};return _0x34e7ec['detectIntent'](_0x2645a8)[_0x1c94('0x2a')](function(_0x4ca58e){if(_0x4ca58e&&_0x4ca58e[_0x1c94('0x4c')]){logger[_0x1c94('0x25')](_0x1c94('0x6c'),JSON['stringify'](_0x4ca58e));var _0x50a81b=_0x4ca58e[0x0];if(_0x50a81b){var _0x19957d={'action':_0x50a81b[_0x1c94('0x6d')]['action'],'allRequiredParamsPresent':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x6e')],'endConversation':_0x50a81b['queryResult'][_0x1c94('0x6f')]&&_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x6f')][_0x1c94('0x70')]?_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x6f')][_0x1c94('0x70')][_0x1c94('0x71')]['boolValue']:![],'fulfillmentText':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x72')],'intentName':_0x50a81b['queryResult'][_0x1c94('0x73')][_0x1c94('0x5b')],'intentDisplayName':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x73')]['displayName'],'isFallbackIntent':_0x50a81b[_0x1c94('0x6d')]['intent'][_0x1c94('0x74')],'languageCode':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x75')],'queryText':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x76')],'responseId':_0x50a81b['responseId'],'score':_0x50a81b['queryResult'][_0x1c94('0x77')],'speech':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x72')],'providerResponse':JSON['stringify'](_0x4ca58e)};return _0x19957d;}}});};exports[_0x1c94('0x78')]=function(_0x2dfc5e,_0x42ad12,_0x5c64d0,_0x27d9d9){return tilde['asr'](_0x2dfc5e,_0x42ad12,_0x5c64d0,_0x27d9d9)[_0x1c94('0x2a')](function(_0x46c808){try{fs[_0x1c94('0x1e')](_0x2dfc5e);}catch(_0x54785d){logger[_0x1c94('0x18')](_0x54785d);}logger[_0x1c94('0x25')](_0x1c94('0x79'),_0x46c808[_0x1c94('0x56')]);logger['info']('Tilde\x20ASR\x20confidence',_0x46c808[_0x1c94('0x7a')]);return _0x46c808;});};exports[_0x1c94('0x7b')]=function(_0x29ba8d,_0x5ef5c8,_0x433e49,_0x42c33e,_0x3f21e4,_0x3ee072){var _0xb0c160=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x37'));var _0xa1d2d3;return aws['polly'](_0x29ba8d,_0x5ef5c8,_0x433e49,_0x42c33e,_0x3f21e4,_0x3ee072,_0xb0c160)[_0x1c94('0x2a')](function(){_0xa1d2d3=path[_0x1c94('0x28')](__dirname,'tmp',rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d'));return convertFile(_0xb0c160,_0xa1d2d3);})['then'](function(){try{fs[_0x1c94('0x1e')](_0xb0c160);fs[_0x1c94('0x2b')](_0xa1d2d3,_0x1c94('0x3b'));}catch(_0x581a96){logger[_0x1c94('0x18')](_0x581a96);}return _0xa1d2d3[_0x1c94('0x3f')]('.')[0x0];});};exports[_0x1c94('0x7c')]=function(_0x78026c,_0x5201e0,_0x42828e,_0x36241c,_0x244d85,_0x44331f){return aws[_0x1c94('0x7d')](_0x78026c,_0x5201e0,_0x42828e,_0x36241c,_0x244d85,_0x44331f)[_0x1c94('0x2a')](function(_0xddf7b5){logger['info'](JSON[_0x1c94('0x45')](_0xddf7b5));return _0xddf7b5;});};exports[_0x1c94('0x7e')]=function(_0x288c18,_0xd3dff2,_0x18e745,_0x493d55){var _0x5d1959=util['format'](_0x1c94('0x7f'),ISPEECH_API,_0x288c18,encodeURIComponent(_0xd3dff2),_0x18e745,_0x493d55);var _0x3dc730=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+'.mp3');var _0xf4dfce;return downloadFile(_0x5d1959,_0x3dc730)[_0x1c94('0x2a')](function(){_0xf4dfce=path['resolve'](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d'));return convertFile(_0x3dc730,_0xf4dfce);})[_0x1c94('0x2a')](function(){try{fs[_0x1c94('0x1e')](_0x3dc730);fs['chmodSync'](_0xf4dfce,_0x1c94('0x3b'));}catch(_0x26bc79){logger[_0x1c94('0x18')](_0x26bc79);}return _0xf4dfce[_0x1c94('0x3f')]('.')[0x0];});};exports['ispeechASR']=function(_0x16cf8f,_0x3d79c0,_0x335a70,_0x21832e){var _0x12160e=util[_0x1c94('0x80')](_0x1c94('0x81'),ISPEECH_API,_0x3d79c0,_0x335a70,base64Encode(_0x16cf8f),_0x21832e?util[_0x1c94('0x80')](_0x1c94('0x82'),encodeURIComponent(_0x21832e)):'freeform=3');return uploadFile(_0x12160e)[_0x1c94('0x2a')](function(_0x1c22b4){return querystring[_0x1c94('0x9')](_0x1c22b4);});};exports[_0x1c94('0x83')]=function(_0x4ebc1e,_0x1ca77a){return sestek['nda'](_0x4ebc1e,_0x1ca77a)[_0x1c94('0x2a')](function(_0x3674ea){logger['info'](JSON['stringify'](_0x3674ea));var _0x27ce8e={'speech':_0x3674ea['text'],'action':_0x3674ea[_0x1c94('0x84')]?_0x3674ea[_0x1c94('0x84')]['CustomAction']:undefined,'actiondata':_0x3674ea[_0x1c94('0x84')]?_0x3674ea[_0x1c94('0x84')][_0x1c94('0x85')]:undefined};if(_0x3674ea[_0x1c94('0x84')]&&_0x3674ea['channelData']['AudioFromTts']){return base64Decode(_0x3674ea['channelData'][_0x1c94('0x86')][_0x1c94('0x87')],path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d')))[_0x1c94('0x2a')](function(_0x42ca92){_0x27ce8e[_0x1c94('0x88')]=_0x42ca92;return _0x27ce8e;});}return _0x27ce8e;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xc589=['null','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','parse\x20response\x20failed:\x0a','goggleTTS\x20path','asr','results','alternatives','transcript','map','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','result','source','actionIncomplete','fulfillment','status','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','queryText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','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','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','apiai-promise','bluebird','dialogflow','http','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','WHAT_EVER','data','transcode','error\x20convert','info','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','777','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','then','.mp3','from','writeFile','chmodSync','tmp','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0xc589,0x140));var _0x9c58=function(_0x4648cd,_0x167611){_0x4648cd=_0x4648cd-0x0;var _0x122956=_0xc589[_0x4648cd];return _0x122956;};'use strict';var apiai=require(_0x9c58('0x0'));var BPromise=require(_0x9c58('0x1'));var dialogflow=require(_0x9c58('0x2'));var fs=require('fs');var http=require(_0x9c58('0x3'));var https=require('https');var md5=require(_0x9c58('0x4'));var path=require(_0x9c58('0x5'));var querystring=require(_0x9c58('0x6'));var rp=require(_0x9c58('0x7'));var rs=require(_0x9c58('0x8'));var sox=require(_0x9c58('0x9'));var tts=require(_0x9c58('0xa'));var urlParse=require(_0x9c58('0xb'))[_0x9c58('0xc')];var util=require(_0x9c58('0xd'));var aws=require(_0x9c58('0xe'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x9c58('0xf'));var logger=require(_0x9c58('0x10'))(_0x9c58('0x11'));var ISPEECH_API=_0x9c58('0x12');function downloadFile(_0x2fc644,_0x23bdf5){return new BPromise(function(_0x1a944d,_0x365fbe){var _0x8aebf0=urlParse(_0x2fc644);var _0x41643b=_0x8aebf0[_0x9c58('0x13')]===_0x9c58('0x14')?https:http;var _0x42f174={'host':_0x8aebf0[_0x9c58('0x15')],'path':_0x8aebf0[_0x9c58('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x41643b[_0x9c58('0x16')](_0x42f174,function(_0x18c6a5){if(_0x18c6a5[_0x9c58('0x17')]!==0xc8){logger[_0x9c58('0x18')](_0x9c58('0x19')+_0x2fc644+_0x9c58('0x1a')+_0x18c6a5[_0x9c58('0x17')]+'\x20('+_0x18c6a5['statusMessage']+')');_0x365fbe(new Error('request\x20to\x20'+_0x2fc644+_0x9c58('0x1a')+_0x18c6a5['statusCode']+'\x20('+_0x18c6a5[_0x9c58('0x1b')]+')'));return;}var _0x2be868=fs['createWriteStream'](_0x23bdf5);_0x2be868['on'](_0x9c58('0x1c'),function(){logger['info'](_0x9c58('0x1d'));_0x2be868[_0x9c58('0x1e')](_0x1a944d);});_0x2be868['on']('error',function(_0x12cce9){fs[_0x9c58('0x1f')](_0x23bdf5);logger['error'](_0x9c58('0x20'),_0x12cce9);_0x365fbe(_0x12cce9);});_0x18c6a5[_0x9c58('0x21')](_0x2be868);})['on'](_0x9c58('0x18'),function(_0x1dc575){logger[_0x9c58('0x18')](_0x1dc575);_0x365fbe(_0x1dc575);})[_0x9c58('0x22')]();});}function uploadFile(_0x5b3c35){return new BPromise(function(_0x3a6a42,_0x5b8d8b){var _0xa9301c=urlParse(_0x5b3c35);var _0x407453=_0xa9301c[_0x9c58('0x13')]===_0x9c58('0x14')?https:http;var _0x7eeae6={'host':_0xa9301c[_0x9c58('0x15')],'path':_0xa9301c[_0x9c58('0x5')],'headers':{'user-agent':_0x9c58('0x23')}};_0x407453[_0x9c58('0x16')](_0x7eeae6,function(_0x25d725){if(_0x25d725[_0x9c58('0x17')]!==0xc8){_0x5b8d8b(new Error('request\x20to\x20'+_0x5b3c35+_0x9c58('0x1a')+_0x25d725[_0x9c58('0x17')]+'\x20('+_0x25d725[_0x9c58('0x1b')]+')'));return;}var _0x775dfe='';_0x25d725['on'](_0x9c58('0x24'),function(_0x574370){_0x775dfe+=_0x574370;});_0x25d725['on'](_0x9c58('0x22'),function(){_0x3a6a42(_0x775dfe);});})['on'](_0x9c58('0x18'),function(_0x121c8e){_0x5b8d8b(_0x121c8e);})[_0x9c58('0x22')]();});}function convertFile(_0xb762b8,_0x24fcb5){return new BPromise(function(_0x56e7cf,_0x28f705){var _0x4deeca=sox[_0x9c58('0x25')](_0xb762b8,_0x24fcb5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4deeca['on'](_0x9c58('0x18'),function(_0xe73e8e){logger[_0x9c58('0x18')](_0x9c58('0x26'),_0xe73e8e);_0x28f705(_0xe73e8e);});_0x4deeca['on']('end',function(){logger[_0x9c58('0x27')](_0x9c58('0x28'));_0x56e7cf();});_0x4deeca[_0x9c58('0x29')]();});}function base64Decode(_0x141c12,_0x53e39a){var _0x563f96=path[_0x9c58('0x2a')](__dirname,'tmp',rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x2c'));fs[_0x9c58('0x2d')](_0x563f96,_0x141c12,_0x9c58('0x2e'));return convertFile(_0x563f96,_0x53e39a)['then'](function(){try{fs[_0x9c58('0x1f')](_0x563f96);fs['chmodSync'](_0x53e39a,_0x9c58('0x2f'));}catch(_0x16c3a2){logger[_0x9c58('0x18')](_0x16c3a2);}return _0x53e39a['split']('.')[0x0];});}function base64Encode(_0x1b94c5){var _0x23f5da=fs[_0x9c58('0x30')](_0x1b94c5);return new Buffer(_0x23f5da)[_0x9c58('0x31')](_0x9c58('0x2e'));}exports['googleCloudTTS']=function(_0xd177ef,_0x1d3343,_0x4995f4,_0x4bc77f,_0x2d5ae7,_0x591fd0){var _0x226097,_0x22eccf;var _0x4913b1=_0x9c58('0x32');var _0x2cb574=_0x9c58('0x33')+_0xd177ef;var _0x187e69={};if(_0x1d3343===_0x9c58('0x34')){_0x187e69['input']={'ssml':_0x4995f4};}else{_0x187e69[_0x9c58('0x35')]={'text':_0x4995f4};};_0x187e69[_0x9c58('0x36')]={'languageCode':_0x4bc77f,'ssmlGender':_0x2d5ae7};_0x187e69[_0x9c58('0x37')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x23a4bc={'url':_0x4913b1+_0x9c58('0x38')+_0x2cb574,'method':'POST','json':!![],'body':_0x187e69};return rp(_0x23a4bc)[_0x9c58('0x39')](function(_0x556065){return new BPromise(function(_0x5373e6,_0xae61cc){_0x226097=path['resolve'](__dirname,'tmp',rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x3a'));var _0x4d2b25=Buffer[_0x9c58('0x3b')](_0x556065['audioContent'],_0x9c58('0x2e'));return fs[_0x9c58('0x3c')](_0x226097,_0x4d2b25,function(_0x559d71){_0xae61cc(_0x559d71);},function(_0x10b269){fs[_0x9c58('0x3d')](_0x226097,_0x9c58('0x2f'));_0x5373e6(_0x10b269);});});})['then'](function(_0x13d4ed){_0x22eccf=path[_0x9c58('0x2a')](__dirname,_0x9c58('0x3e'),rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x2c'));return convertFile(_0x226097,_0x22eccf);})[_0x9c58('0x39')](function(){try{fs[_0x9c58('0x1f')](_0x226097);fs['chmodSync'](_0x22eccf,'777');}catch(_0x4aa9f0){logger['error'](_0x4aa9f0);}logger['info'](_0x9c58('0x3f'),_0x22eccf[_0x9c58('0x40')]('.')[0x0]);return _0x22eccf['split']('.')[0x0];});};exports[_0x9c58('0x41')]=function(_0x378eca,_0x18564f){var _0x5cecf9=_0x9c58('0x42');var _0x39603e,_0x58ec57;var _0x1e21a8;var _0x2e3a1e={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x5cecf9,'headers':{'Content-Type':_0x9c58('0x43')},'body':_0x9c58('0x44')+encodeURIComponent(JSON[_0x9c58('0x45')]([[['jQ1olc',JSON[_0x9c58('0x45')]([_0x378eca,_0x18564f||'en',![],_0x9c58('0x46')]),null,'generic']]]))};return rp(_0x2e3a1e)[_0x9c58('0x39')](function(_0x4cb861){try{_0x1e21a8=eval(_0x4cb861[_0x9c58('0x47')](0x5))[0x0][0x2];}catch(_0x433c66){throw new Error('parse\x20response\x20failed:\x0a'+_0x4cb861[_0x9c58('0x24')]);}if(!_0x1e21a8){if(_0x378eca[_0x9c58('0x48')]>0xc8){throw new Error(_0x9c58('0x49'));}else{throw new Error(_0x9c58('0x4a')+_0x18564f+'\x22\x20might\x20not\x20exist');}}try{_0x1e21a8=eval(_0x1e21a8)[0x0];}catch(_0x3bc322){throw new Error(_0x9c58('0x4b')+res[_0x9c58('0x24')]);}const _0x558b9c=_0x1e21a8;_0x39603e=path[_0x9c58('0x2a')](__dirname,'tmp',rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x3a'));fs['writeFileSync'](_0x39603e,_0x1e21a8,{'encoding':'base64'});_0x58ec57=path[_0x9c58('0x2a')](__dirname,'tmp',rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x2c'));return convertFile(_0x39603e,_0x58ec57);})[_0x9c58('0x39')](function(){try{fs[_0x9c58('0x1f')](_0x39603e);fs[_0x9c58('0x3d')](_0x58ec57,'777');}catch(_0x1c565e){logger[_0x9c58('0x18')](_0x1c565e);}logger[_0x9c58('0x27')](_0x9c58('0x4c'),_0x58ec57[_0x9c58('0x40')]('.')[0x0]);return _0x58ec57[_0x9c58('0x40')]('.')[0x0];});};exports['googleASR']=function(_0x108ad5,_0x5dae4b,_0x72dfbe){return google[_0x9c58('0x4d')](_0x108ad5,_0x5dae4b,_0x72dfbe)[_0x9c58('0x39')](function(_0xa74392){logger[_0x9c58('0x27')](_0xa74392['uri']);return rp(_0xa74392);})[_0x9c58('0x39')](function(_0x2bb595){var _0x329ad1='';var _0x143d0d=0x0;try{fs[_0x9c58('0x1f')](_0x108ad5);}catch(_0x3a5293){logger[_0x9c58('0x18')](_0x3a5293);}if(_0x2bb595&&_0x2bb595[_0x9c58('0x4e')]){_0x329ad1=_0x2bb595[_0x9c58('0x4e')]['map'](function(_0x55cb13){return _0x55cb13&&_0x55cb13['alternatives'][0x0]&&_0x55cb13[_0x9c58('0x4f')][0x0][_0x9c58('0x50')]?_0x55cb13['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x143d0d=_0x2bb595[_0x9c58('0x4e')][_0x9c58('0x51')](function(_0x467536){return _0x467536&&_0x467536[_0x9c58('0x4f')][0x0]&&_0x467536[_0x9c58('0x4f')][0x0][_0x9c58('0x52')]?_0x467536[_0x9c58('0x4f')][0x0][_0x9c58('0x52')]:0x0;})[_0x9c58('0x53')]('\x0a');}logger[_0x9c58('0x27')](_0x9c58('0x54'),_0x329ad1);logger[_0x9c58('0x27')]('googleASR\x20confidence',_0x143d0d);return{'transcript':_0x329ad1,'confidence':_0x143d0d};})[_0x9c58('0x55')](function(_0x4c836f){logger['error'](_0x9c58('0x56'),_0x4c836f[_0x9c58('0x17')],_0x4c836f[_0x9c58('0x57')],_0x4c836f['message']);});};exports['googleDialogflow']=function(_0x4dcd2e,_0x15e7b6,_0x14169f,_0x3203e3){var _0x504cbe=apiai(_0x15e7b6,{'language':_0x3203e3||'en'});return _0x504cbe['textRequest'](_0x14169f,{'sessionId':md5(_0x4dcd2e)})[_0x9c58('0x39')](function(_0x11e3ae){logger[_0x9c58('0x27')](JSON[_0x9c58('0x45')](_0x11e3ae));return{'source':_0x11e3ae[_0x9c58('0x58')][_0x9c58('0x59')],'resolvedQuery':_0x11e3ae['result']['resolvedQuery'],'action':_0x11e3ae[_0x9c58('0x58')]['action'],'actionIncomplete':_0x11e3ae[_0x9c58('0x58')][_0x9c58('0x5a')],'speech':_0x11e3ae[_0x9c58('0x58')][_0x9c58('0x5b')]['speech'],'score':_0x11e3ae['result']['score'],'statusCode':_0x11e3ae[_0x9c58('0x5c')]['code'],'endConversation':_0x11e3ae[_0x9c58('0x58')][_0x9c58('0x5d')]['endConversation']||![],'isFallbackIntent':_0x11e3ae[_0x9c58('0x58')][_0x9c58('0x5d')][_0x9c58('0x5e')]};});};exports[_0x9c58('0x5f')]=function(_0x45ede4,_0x484aac,_0x284885,_0xf35ebd,_0x8f142d,_0x308cfd){var _0x2d9f6f=_0xf35ebd['replace'](/\\n/g,'\x0a');var _0x1c4fe7={'credentials':{'private_key':_0x2d9f6f,'client_email':_0x284885}};var _0x2c0735=new dialogflow[(_0x9c58('0x60'))](_0x1c4fe7);var _0x2ec470=_0x2c0735[_0x9c58('0x61')](_0x484aac,md5(_0x45ede4));var _0x545e19={'session':_0x2ec470,'queryInput':{'text':{'text':_0x8f142d,'languageCode':_0x308cfd}}};return _0x2c0735['detectIntent'](_0x545e19)['then'](function(_0x2e365b){if(_0x2e365b&&_0x2e365b[_0x9c58('0x48')]){logger['info'](_0x9c58('0x62'),JSON[_0x9c58('0x45')](_0x2e365b));var _0xe6aa1c=_0x2e365b[0x0];if(_0xe6aa1c){var _0xf39a8d={'action':_0xe6aa1c[_0x9c58('0x63')][_0x9c58('0x64')],'allRequiredParamsPresent':_0xe6aa1c[_0x9c58('0x63')][_0x9c58('0x65')],'endConversation':_0xe6aa1c[_0x9c58('0x63')][_0x9c58('0x66')]&&_0xe6aa1c[_0x9c58('0x63')][_0x9c58('0x66')][_0x9c58('0x67')]?_0xe6aa1c['queryResult'][_0x9c58('0x66')][_0x9c58('0x67')][_0x9c58('0x68')][_0x9c58('0x69')]:![],'fulfillmentText':_0xe6aa1c[_0x9c58('0x63')][_0x9c58('0x6a')],'intentName':_0xe6aa1c['queryResult'][_0x9c58('0x6b')][_0x9c58('0x57')],'intentDisplayName':_0xe6aa1c['queryResult'][_0x9c58('0x6b')][_0x9c58('0x6c')],'isFallbackIntent':_0xe6aa1c[_0x9c58('0x63')][_0x9c58('0x6b')]['isFallback'],'languageCode':_0xe6aa1c[_0x9c58('0x63')]['languageCode'],'queryText':_0xe6aa1c[_0x9c58('0x63')][_0x9c58('0x6d')],'responseId':_0xe6aa1c['responseId'],'score':_0xe6aa1c[_0x9c58('0x63')]['intentDetectionConfidence'],'speech':_0xe6aa1c[_0x9c58('0x63')]['fulfillmentText'],'providerResponse':JSON[_0x9c58('0x45')](_0x2e365b)};return _0xf39a8d;}}});};exports[_0x9c58('0x6e')]=function(_0x294529,_0x2722f9,_0x58ab81,_0x438689){return tilde[_0x9c58('0x4d')](_0x294529,_0x2722f9,_0x58ab81,_0x438689)[_0x9c58('0x39')](function(_0x5974a5){try{fs[_0x9c58('0x1f')](_0x294529);}catch(_0x44b838){logger[_0x9c58('0x18')](_0x44b838);}logger[_0x9c58('0x27')](_0x9c58('0x6f'),_0x5974a5['transcript']);logger[_0x9c58('0x27')]('Tilde\x20ASR\x20confidence',_0x5974a5['confidence']);return _0x5974a5;});};exports[_0x9c58('0x70')]=function(_0x3540fe,_0x20fcfc,_0x23c3a0,_0x586d0f,_0x224c9a,_0x816ab1){var _0x431660=path[_0x9c58('0x2a')](__dirname,_0x9c58('0x3e'),rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x3a'));var _0x5e3122;return aws[_0x9c58('0x71')](_0x3540fe,_0x20fcfc,_0x23c3a0,_0x586d0f,_0x224c9a,_0x816ab1,_0x431660)[_0x9c58('0x39')](function(){_0x5e3122=path['resolve'](__dirname,'tmp',rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x2c'));return convertFile(_0x431660,_0x5e3122);})[_0x9c58('0x39')](function(){try{fs[_0x9c58('0x1f')](_0x431660);fs[_0x9c58('0x3d')](_0x5e3122,_0x9c58('0x2f'));}catch(_0x3f51b3){logger['error'](_0x3f51b3);}return _0x5e3122[_0x9c58('0x40')]('.')[0x0];});};exports[_0x9c58('0x72')]=function(_0x5d9af6,_0x3f2985,_0x23742c,_0x18066c,_0x96fec6,_0x2a736d){return aws[_0x9c58('0x73')](_0x5d9af6,_0x3f2985,_0x23742c,_0x18066c,_0x96fec6,_0x2a736d)[_0x9c58('0x39')](function(_0x1fdcc5){logger[_0x9c58('0x27')](JSON[_0x9c58('0x45')](_0x1fdcc5));return _0x1fdcc5;});};exports[_0x9c58('0x74')]=function(_0x22a0ef,_0x2f2116,_0x300555,_0x24bf4e){var _0x426571=util[_0x9c58('0x75')](_0x9c58('0x76'),ISPEECH_API,_0x22a0ef,encodeURIComponent(_0x2f2116),_0x300555,_0x24bf4e);var _0x3d2900=path[_0x9c58('0x2a')](__dirname,_0x9c58('0x3e'),rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x3a'));var _0x8b39c4;return downloadFile(_0x426571,_0x3d2900)[_0x9c58('0x39')](function(){_0x8b39c4=path[_0x9c58('0x2a')](__dirname,_0x9c58('0x3e'),rs[_0x9c58('0x2b')](0x4)+_0x9c58('0x2c'));return convertFile(_0x3d2900,_0x8b39c4);})[_0x9c58('0x39')](function(){try{fs['unlink'](_0x3d2900);fs[_0x9c58('0x3d')](_0x8b39c4,'777');}catch(_0x5b8f39){logger[_0x9c58('0x18')](_0x5b8f39);}return _0x8b39c4[_0x9c58('0x40')]('.')[0x0];});};exports[_0x9c58('0x77')]=function(_0x433ec3,_0x1ca894,_0x3290ff,_0x2d0ec3){var _0x51974a=util[_0x9c58('0x75')](_0x9c58('0x78'),ISPEECH_API,_0x1ca894,_0x3290ff,base64Encode(_0x433ec3),_0x2d0ec3?util[_0x9c58('0x75')](_0x9c58('0x79'),encodeURIComponent(_0x2d0ec3)):_0x9c58('0x7a'));return uploadFile(_0x51974a)[_0x9c58('0x39')](function(_0x545b9c){return querystring[_0x9c58('0xc')](_0x545b9c);});};exports[_0x9c58('0x7b')]=function(_0x448283,_0x107259){return sestek[_0x9c58('0x7c')](_0x448283,_0x107259)['then'](function(_0x1f8df8){logger[_0x9c58('0x27')](JSON[_0x9c58('0x45')](_0x1f8df8));var _0x48e722={'speech':_0x1f8df8['text'],'action':_0x1f8df8[_0x9c58('0x7d')]?_0x1f8df8[_0x9c58('0x7d')][_0x9c58('0x7e')]:undefined,'actiondata':_0x1f8df8['channelData']?_0x1f8df8[_0x9c58('0x7d')][_0x9c58('0x7f')]:undefined};if(_0x1f8df8['channelData']&&_0x1f8df8[_0x9c58('0x7d')][_0x9c58('0x80')]){return base64Decode(_0x1f8df8[_0x9c58('0x7d')]['AudioFromTts']['Data'],path[_0x9c58('0x2a')](__dirname,_0x9c58('0x3e'),rs[_0x9c58('0x2b')](0x4)+'.wav'))[_0x9c58('0x39')](function(_0x54bb7a){_0x48e722['audiofile']=_0x54bb7a;return _0x48e722;});}return _0x48e722;});};exports[_0x9c58('0x81')]=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 69c16da..74f649b 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 _0x3c09=['./nda','exports'];(function(_0x23fb2a,_0x172f30){var _0x7c867c=function(_0x5505dd){while(--_0x5505dd){_0x23fb2a['push'](_0x23fb2a['shift']());}};_0x7c867c(++_0x172f30);}(_0x3c09,0xaa));var _0x93c0=function(_0xfd5c71,_0x8bd14d){_0xfd5c71=_0xfd5c71-0x0;var _0x1ebb7a=_0x3c09[_0xfd5c71];return _0x1ebb7a;};var nda=require(_0x93c0('0x0'));module[_0x93c0('0x1')]={'nda':nda}; \ No newline at end of file +var _0xef05=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef05,0xf9));var _0x5ef0=function(_0x4d21ff,_0x23bc30){_0x4d21ff=_0x4d21ff-0x0;var _0x7c2559=_0xef05[_0x4d21ff];return _0x7c2559;};var nda=require('./nda');module[_0x5ef0('0x0')]={'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 96413a9..250bbee 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 _0x2e21=['ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','calleridname','dnid','text','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2e21,0xba));var _0x12e2=function(_0x4c3c8b,_0x561dac){_0x4c3c8b=_0x4c3c8b-0x0;var _0x116208=_0x2e21[_0x4c3c8b];return _0x116208;};'use strict';var rp=require(_0x12e2('0x0'));var url=require(_0x12e2('0x1'));var logger=require(_0x12e2('0x2'))('agi');module[_0x12e2('0x3')]=function(_0x56d4f3,_0x261954){var _0x3bc460={'method':_0x12e2('0x4'),'uri':url[_0x12e2('0x5')](_0x261954[_0x12e2('0x6')],_0x12e2('0x7')),'form':{'grant_type':_0x12e2('0x8'),'username':_0x261954[_0x12e2('0x9')],'password':_0x261954[_0x12e2('0x8')]},'json':!![]};return rp(_0x3bc460)[_0x12e2('0xa')](function(_0x321e79){var _0x372494={'method':'POST','uri':url[_0x12e2('0x5')](_0x261954['ndassistant_url'],_0x12e2('0xb')),'body':{'type':_0x261954['ndaactivity_type']||_0x12e2('0xc'),'channelId':_0x12e2('0xd'),'conversation':{'id':_0x56d4f3[_0x12e2('0xe')]},'from':{'id':_0x56d4f3['callerid'],'name':_0x56d4f3[_0x12e2('0xf')]},'recipient':{'id':_0x56d4f3[_0x12e2('0x10')],'name':_0x56d4f3['extension']},'text':_0x261954[_0x12e2('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x321e79[_0x12e2('0x12')]},'json':!![]};if(_0x261954['project']){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x15')]=_0x261954[_0x12e2('0x16')];}if(_0x261954[_0x12e2('0x17')]=='1'){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x12e2('0x19')};}if(_0x261954['custom_action']){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x1a')]=_0x261954[_0x12e2('0x1b')];if(_0x261954[_0x12e2('0x1c')]){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x1d')]=_0x261954[_0x12e2('0x1c')];}}logger[_0x12e2('0x1e')](JSON[_0x12e2('0x1f')](_0x372494));return rp(_0x372494);});}; \ No newline at end of file +var _0xe9ad=['password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0xe9ad,0x82));var _0xde9a=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0xe9ad[_0x28578d];return _0x524826;};'use strict';var rp=require(_0xde9a('0x0'));var url=require(_0xde9a('0x1'));var logger=require(_0xde9a('0x2'))(_0xde9a('0x3'));module[_0xde9a('0x4')]=function(_0x398c3b,_0x11047e){var _0x4d2982={'method':_0xde9a('0x5'),'uri':url[_0xde9a('0x6')](_0x11047e[_0xde9a('0x7')],_0xde9a('0x8')),'form':{'grant_type':'password','username':_0x11047e[_0xde9a('0x9')],'password':_0x11047e[_0xde9a('0xa')]},'json':!![]};return rp(_0x4d2982)[_0xde9a('0xb')](function(_0x5d4412){var _0x45d4a7={'method':_0xde9a('0x5'),'uri':url[_0xde9a('0x6')](_0x11047e[_0xde9a('0xc')],_0xde9a('0xd')),'body':{'type':_0x11047e[_0xde9a('0xe')]||_0xde9a('0xf'),'channelId':_0xde9a('0x10'),'conversation':{'id':_0x398c3b[_0xde9a('0x11')]},'from':{'id':_0x398c3b['callerid'],'name':_0x398c3b[_0xde9a('0x12')]},'recipient':{'id':_0x398c3b[_0xde9a('0x13')],'name':_0x398c3b[_0xde9a('0x14')]},'text':_0x11047e[_0xde9a('0x15')],'channelData':{}},'headers':{'Authorization':_0xde9a('0x16')+_0x5d4412[_0xde9a('0x17')]},'json':!![]};if(_0x11047e[_0xde9a('0x18')]){_0x45d4a7[_0xde9a('0x19')][_0xde9a('0x1a')]['ProjectName']=_0x11047e[_0xde9a('0x18')];}if(_0x11047e[_0xde9a('0x1b')]=='1'){_0x45d4a7[_0xde9a('0x19')][_0xde9a('0x1a')][_0xde9a('0x1c')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xde9a('0x1d')};}if(_0x11047e[_0xde9a('0x1e')]){_0x45d4a7[_0xde9a('0x19')][_0xde9a('0x1a')][_0xde9a('0x1f')]=_0x11047e[_0xde9a('0x1e')];if(_0x11047e[_0xde9a('0x20')]){_0x45d4a7[_0xde9a('0x19')][_0xde9a('0x1a')][_0xde9a('0x21')]=_0x11047e[_0xde9a('0x20')];}}logger['info'](JSON[_0xde9a('0x22')](_0x45d4a7));return rp(_0x45d4a7);});}; \ 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 31099f0..2f52954 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x2a6a9a,_0x26237d,_0x9de0e4,_0x621492){return asr(_0x2a6a9a,_0x26237d,_0x9de0e4,_0x621492);}; \ No newline at end of file +var _0x3ef5=['exports'];(function(_0x55ac3e,_0x3336f6){var _0x23099e=function(_0x187715){while(--_0x187715){_0x55ac3e['push'](_0x55ac3e['shift']());}};_0x23099e(++_0x3336f6);}(_0x3ef5,0x115));var _0x53ef=function(_0x4a7bde,_0x5af865){_0x4a7bde=_0x4a7bde-0x0;var _0x5630be=_0x3ef5[_0x4a7bde];return _0x5630be;};'use strict';var asr=require('./lib/api');module[_0x53ef('0x0')]=function(_0x775e06,_0x4a029c,_0x4e1b04,_0x580fba){return asr(_0x775e06,_0x4a029c,_0x4e1b04,_0x580fba);}; \ 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 d2048a9..03856cb 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 _0x7c1c=['transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','close','../../../../../../config/logger','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','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x7c1c,0x180));var _0xc7c1=function(_0x435686,_0x105683){_0x435686=_0x435686-0x0;var _0x14e285=_0x7c1c[_0x435686];return _0x14e285;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xc7c1('0x0'))('agi');module[_0xc7c1('0x1')]=function(_0x2716f1,_0x3a183d,_0x573d3e,_0x1d8893){return new BPromise(function(_0x45bad7,_0x39d9f0){logger['info']('Tilde\x20URI',_0x1d8893||_0xc7c1('0x2'));var _0x40f678=new WebSocket(_0x1d8893||_0xc7c1('0x2'),{'perMessageDeflate':![]});var _0x4f3cfb='';var _0x157eae='0';var _0x34a91f='1';var _0x2e8691=_0xc7c1('0x3');function _0x4f1ace(_0x1bc1fa){var _0x404954=crypto['createHash']('sha1');_0x404954['update'](_0x1bc1fa);return _0x404954['digest']('hex');}function _0x4619ae(){try{logger[_0xc7c1('0x4')](_0xc7c1('0x5'));var _0x183804=moment()[_0xc7c1('0x6')]();var _0x175e04=_0x4f1ace(_0x183804+_0x3a183d+_0x573d3e);_0x40f678[_0xc7c1('0x7')](JSON[_0xc7c1('0x8')]({'appID':_0x3a183d,'timestamp':_0x183804,'appKey':_0x175e04}));var _0x10a29a=fs[_0xc7c1('0x9')](_0x2716f1);_0x10a29a['on'](_0xc7c1('0xa'),function(_0x2bd6b3){_0x40f678[_0xc7c1('0x7')](_0x2bd6b3);});_0x10a29a['on']('close',function(){_0x40f678[_0xc7c1('0x7')]('EOS');});}catch(_0x39ce12){logger[_0xc7c1('0xb')](_0xc7c1('0xc'),JSON['stringify'](_0x39ce12));_0x40f678[_0xc7c1('0xd')]();}}function _0x9a945e(_0x54f855){try{if(_0x54f855){var _0x344eda=JSON['parse'](_0x54f855);switch(_0x344eda[_0xc7c1('0xe')]){case 0x0:if(_0x344eda[_0xc7c1('0xf')]){if(_0x344eda[_0xc7c1('0xf')][_0xc7c1('0x10')]){logger[_0xc7c1('0x4')](_0xc7c1('0x11'),JSON[_0xc7c1('0x8')](_0x344eda[_0xc7c1('0xf')][_0xc7c1('0x12')]));_0x4f3cfb=_0x344eda[_0xc7c1('0xf')]['hypotheses'][0x0][_0xc7c1('0x13')];_0x157eae=_0x344eda['result'][_0xc7c1('0x12')][0x0]['likelihood'];_0x34a91f='0';_0x2e8691=_0xc7c1('0x14');_0x40f678['terminate']();}}break;case 0x1:logger[_0xc7c1('0x4')](_0xc7c1('0x3'));_0x34a91f='1';_0x2e8691=_0xc7c1('0x3');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x34a91f='2';_0x2e8691=_0xc7c1('0x15');break;case 0x9:logger[_0xc7c1('0x4')](_0xc7c1('0x16'));_0x34a91f='9';_0x2e8691=_0xc7c1('0x16');break;case 0xa:logger[_0xc7c1('0x4')](_0xc7c1('0x17'));_0x34a91f='10';_0x2e8691=_0xc7c1('0x17');break;case 0xb:logger[_0xc7c1('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x34a91f='11';_0x2e8691=_0xc7c1('0x18');}}}catch(_0x4226c9){logger[_0xc7c1('0xb')](_0xc7c1('0x19'),JSON[_0xc7c1('0x8')](_0x4226c9));_0x40f678['terminate']();}}function _0x1ff6f9(){logger['info'](_0xc7c1('0x1a'));_0x45bad7({'transcript':_0x4f3cfb,'confidence':_0x157eae,'status':_0x34a91f,'status_message':_0x2e8691});}function _0x4d97e3(_0xfd7d73){logger[_0xc7c1('0xb')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xc7c1('0x1b')](_0xfd7d73)){logger[_0xc7c1('0xb')](_['isObject'](_0xfd7d73)?JSON[_0xc7c1('0x8')](_0xfd7d73):_0xfd7d73);}}_0x40f678['on'](_0xc7c1('0x1c'),_0x4619ae);_0x40f678['on'](_0xc7c1('0x1d'),_0x9a945e);_0x40f678['on'](_0xc7c1('0x1e'),_0x1ff6f9);_0x40f678['on'](_0xc7c1('0xb'),_0x4d97e3);});}; \ No newline at end of file +var _0xf948=['result','final','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','lodash','crypto','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','status'];(function(_0x19dbb4,_0x1e7969){var _0x53e63f=function(_0x18b0e3){while(--_0x18b0e3){_0x19dbb4['push'](_0x19dbb4['shift']());}};_0x53e63f(++_0x1e7969);}(_0xf948,0xac));var _0x8f94=function(_0x568591,_0x12546f){_0x568591=_0x568591-0x0;var _0x37865c=_0xf948[_0x568591];return _0x37865c;};'use strict';var BPromise=require('bluebird');var _=require(_0x8f94('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x8f94('0x1'));var logger=require('../../../../../../config/logger')('agi');module[_0x8f94('0x2')]=function(_0x34891e,_0x1a8a85,_0x2121f6,_0x495e7f){return new BPromise(function(_0x3cc1bb,_0x29e32f){logger[_0x8f94('0x3')](_0x8f94('0x4'),_0x495e7f||_0x8f94('0x5'));var _0x4ce229=new WebSocket(_0x495e7f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x10cb60='';var _0x19c13d='0';var _0x2b728c='1';var _0x29c5a1=_0x8f94('0x6');function _0x1c1cbc(_0x4905ce){var _0x43c05f=crypto[_0x8f94('0x7')]('sha1');_0x43c05f[_0x8f94('0x8')](_0x4905ce);return _0x43c05f[_0x8f94('0x9')]('hex');}function _0x5c049f(){try{logger[_0x8f94('0x3')](_0x8f94('0xa'));var _0x89d16c=moment()[_0x8f94('0xb')]();var _0x5a0270=_0x1c1cbc(_0x89d16c+_0x1a8a85+_0x2121f6);_0x4ce229[_0x8f94('0xc')](JSON[_0x8f94('0xd')]({'appID':_0x1a8a85,'timestamp':_0x89d16c,'appKey':_0x5a0270}));var _0x340c70=fs['createReadStream'](_0x34891e);_0x340c70['on'](_0x8f94('0xe'),function(_0xfa97d2){_0x4ce229[_0x8f94('0xc')](_0xfa97d2);});_0x340c70['on'](_0x8f94('0xf'),function(){_0x4ce229[_0x8f94('0xc')]('EOS');});}catch(_0x4c5723){logger[_0x8f94('0x10')](_0x8f94('0x11'),JSON[_0x8f94('0xd')](_0x4c5723));_0x4ce229[_0x8f94('0x12')]();}}function _0x427fb6(_0x38bc30){try{if(_0x38bc30){var _0x36f70e=JSON['parse'](_0x38bc30);switch(_0x36f70e[_0x8f94('0x13')]){case 0x0:if(_0x36f70e[_0x8f94('0x14')]){if(_0x36f70e[_0x8f94('0x14')][_0x8f94('0x15')]){logger[_0x8f94('0x3')]('Tilde\x20ASR\x20hypoteses',JSON[_0x8f94('0xd')](_0x36f70e[_0x8f94('0x14')][_0x8f94('0x16')]));_0x10cb60=_0x36f70e[_0x8f94('0x14')]['hypotheses'][0x0][_0x8f94('0x17')];_0x19c13d=_0x36f70e[_0x8f94('0x14')][_0x8f94('0x16')][0x0]['likelihood'];_0x2b728c='0';_0x29c5a1=_0x8f94('0x18');_0x4ce229[_0x8f94('0x12')]();}}break;case 0x1:logger[_0x8f94('0x3')](_0x8f94('0x6'));_0x2b728c='1';_0x29c5a1=_0x8f94('0x6');break;case 0x2:logger[_0x8f94('0x3')](_0x8f94('0x19'));_0x2b728c='2';_0x29c5a1=_0x8f94('0x19');break;case 0x9:logger[_0x8f94('0x3')](_0x8f94('0x1a'));_0x2b728c='9';_0x29c5a1=_0x8f94('0x1a');break;case 0xa:logger[_0x8f94('0x3')](_0x8f94('0x1b'));_0x2b728c='10';_0x29c5a1='Authentication\x20failed.';break;case 0xb:logger[_0x8f94('0x3')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2b728c='11';_0x29c5a1='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4f9f6b){logger[_0x8f94('0x10')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x8f94('0xd')](_0x4f9f6b));_0x4ce229[_0x8f94('0x12')]();}}function _0x2865c1(){logger['info'](_0x8f94('0x1c'));_0x3cc1bb({'transcript':_0x10cb60,'confidence':_0x19c13d,'status':_0x2b728c,'status_message':_0x29c5a1});}function _0x57b9db(_0x28660c){logger[_0x8f94('0x10')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x8f94('0x1d')](_0x28660c)){logger[_0x8f94('0x10')](_['isObject'](_0x28660c)?JSON[_0x8f94('0xd')](_0x28660c):_0x28660c);}}_0x4ce229['on'](_0x8f94('0x1e'),_0x5c049f);_0x4ce229['on'](_0x8f94('0x1f'),_0x427fb6);_0x4ce229['on']('close',_0x2865c1);_0x4ce229['on'](_0x8f94('0x10'),_0x57b9db);});}; \ 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 7fd69e9..b6d2b10 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 _0x8aae=['exports','./asr'];(function(_0x369e42,_0x525644){var _0x51cc7f=function(_0x3a5a32){while(--_0x3a5a32){_0x369e42['push'](_0x369e42['shift']());}};_0x51cc7f(++_0x525644);}(_0x8aae,0x161));var _0xe8aa=function(_0x294568,_0xf2e70d){_0x294568=_0x294568-0x0;var _0x56c58d=_0x8aae[_0x294568];return _0x56c58d;};var asr=require(_0xe8aa('0x0'));module[_0xe8aa('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8daa=['./asr','exports'];(function(_0x2c8805,_0x320e32){var _0x31fd9f=function(_0x272c9f){while(--_0x272c9f){_0x2c8805['push'](_0x2c8805['shift']());}};_0x31fd9f(++_0x320e32);}(_0x8daa,0x10a));var _0xa8da=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x8daa[_0x14476b];return _0x24e2e8;};var asr=require(_0xa8da('0x0'));module[_0xa8da('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 0dbfca9..b44f181 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x412165,_0x1a76e2){var _0x27c5c5=function(_0x390314){while(--_0x390314){_0x412165['push'](_0x412165['shift']());}};_0x27c5c5(++_0x1a76e2);}(_0x34e8,0x12c));var _0x834e=function(_0x2cf552,_0xb29256){_0x2cf552=_0x2cf552-0x0;var _0x526cb8=_0x34e8[_0x2cf552];return _0x526cb8;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 52521e0..ff385dd 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 _0x60a5=['IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','no\x20find\x20by\x20configured','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','getVoiceQueue','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','Smtp','user','debug','sendMailMessage','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','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','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','odbc','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','getdigits','getsecretdigits','rpc','prototype','getVariable','getVariableById','then','name','catch','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','url','method','number','timeout','includes','POST','PUT','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','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_secret_access_key','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','length','isString','replaceAllVariables','%s.%s','saveRestApiResult','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','exec','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','minutes','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','MRCPSynth','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','streamFile','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoif','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'];(function(_0x10577a,_0x317fc2){var _0x32e013=function(_0x3ca861){while(--_0x3ca861){_0x10577a['push'](_0x10577a['shift']());}};_0x32e013(++_0x317fc2);}(_0x60a5,0x83));var _0x560a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x60a5[_0x618414];return _0x21c19a;};'use strict';var fs=require('fs');var util=require(_0x560a('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x560a('0x1'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x560a('0x2'));var rp=require(_0x560a('0x3'));var logger=require(_0x560a('0x4'))('agi');var config=require(_0x560a('0x5'));var shared=require(_0x560a('0x6'));var scripts=require(_0x560a('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=['menu',_0x560a('0x8'),_0x560a('0x9')];var AGIVertices=function(_0x33ddbd,_0x281350,_0x52c52e){this['channel']=_0x33ddbd;this[_0x560a('0xa')]=_0x281350;this['mailRpc']=_0x52c52e;};AGIVertices[_0x560a('0xb')][_0x560a('0xc')]=function(_0x4f7df3,_0x12e51e){this[_0x560a('0xa')][_0x560a('0xd')](_0x4f7df3)[_0x560a('0xe')](function(_0x33a153){_0x12e51e(null,_0x33a153?_0x33a153[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x276796){_0x12e51e(_0x276796);});};AGIVertices[_0x560a('0xb')]['getVoiceQueue']=function(_0x232dd8,_0x102074){this[_0x560a('0xa')]['getVoiceQueueById'](_0x232dd8)[_0x560a('0xe')](function(_0x43430){_0x102074(null,_0x43430?_0x43430[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x54a445){_0x102074(_0x54a445);});};AGIVertices[_0x560a('0xb')][_0x560a('0x11')]=function(_0x14f430,_0x3f9f15){this['rpc']['getSquareProjectById'](_0x14f430)[_0x560a('0xe')](function(_0x251a08){_0x3f9f15(null,_0x251a08?_0x251a08[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x481d56){_0x3f9f15(_0x481d56);});};AGIVertices[_0x560a('0xb')][_0x560a('0x12')]=function(_0xb24d7a,_0x2b484f){this[_0x560a('0xa')]['getSquareOdbcById'](_0xb24d7a)[_0x560a('0xe')](function(_0x155c2b){_0x2b484f(null,_0x155c2b?_0x155c2b[_0x560a('0x13')]:![]);})[_0x560a('0x10')](function(_0x23bfd6){_0x2b484f(_0x23bfd6);});};AGIVertices[_0x560a('0xb')][_0x560a('0x14')]=function(_0x4f33a8,_0x292a5a){this[_0x560a('0xa')][_0x560a('0x15')](_0x4f33a8)[_0x560a('0xe')](function(_0x29167f){_0x292a5a(null,_0x29167f?_0x29167f[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x423822){_0x292a5a(_0x423822);});};AGIVertices['prototype']['getTrunk']=function(_0x535737,_0x306510){this[_0x560a('0xa')]['getTrunkById'](_0x535737)['then'](function(_0x3ff302){_0x306510(null,_0x3ff302?_0x3ff302['name']:![]);})[_0x560a('0x10')](function(_0xc94611){_0x306510(_0xc94611);});};AGIVertices['prototype'][_0x560a('0x16')]=function(_0x4430e8,_0x56557a){var _0x1ddcf6=this;this[_0x560a('0xa')][_0x560a('0x17')](_0x4430e8)[_0x560a('0xe')](function(_0x40a668){_0x56557a(null,_0x40a668?_0x1ddcf6['getSoundPath'](_0x40a668[_0x560a('0x18')]):![]);})[_0x560a('0x10')](function(_0x571eb6){_0x56557a(_0x571eb6);});};AGIVertices[_0x560a('0xb')][_0x560a('0x19')]=function(_0xf4a166,_0x6434c2){this[_0x560a('0xa')][_0x560a('0x1a')](_0xf4a166)[_0x560a('0xe')](function(_0x54817a){_0x6434c2(null,_0x54817a?_0x54817a:![]);})[_0x560a('0x10')](function(_0x339dc6){_0x6434c2(_0x339dc6);});};AGIVertices['prototype']['sendMailMessage']=function(_0x16bccd,_0x465418,_0x155e3e){this[_0x560a('0x1b')]['sendMailMessage'](_0x16bccd,_0x465418)['then'](function(){_0x155e3e(null);})['catch'](function(_0x8dbc4a){_0x155e3e(_0x8dbc4a);});};AGIVertices[_0x560a('0xb')][_0x560a('0x1c')]=function(_0x45632b,_0x32a9cc){this[_0x560a('0xa')][_0x560a('0x1d')](_0x45632b)[_0x560a('0xe')](function(_0x198883){if(_0x198883){if(_0x198883[_0x560a('0x1e')]){_0x32a9cc(null,[_0x198883['interval']]);}else{_0x32a9cc(null,_[_0x560a('0x1f')](_0x198883[_0x560a('0x20')],_0x560a('0x21')));}}else{_0x32a9cc(null,![]);}})[_0x560a('0x10')](function(_0x155428){_0x32a9cc(_0x155428);});};AGIVertices['prototype']['getSoundPath']=function(_0x2eda65){return util[_0x560a('0x22')](_0x560a('0x23'),FILES_PATH,_0x2eda65);};AGIVertices[_0x560a('0xb')][_0x560a('0x24')]=function(_0x49ad54,_0x13cfcf,_0x44d39d){odbc['open'](_0x49ad54,function(_0x3b5e48){if(_0x3b5e48){logger[_0x560a('0x25')](_0x560a('0x26'),_0x3b5e48);_0x44d39d(_0x3b5e48);}else{logger[_0x560a('0x27')](_0x560a('0x28'));odbc[_0x560a('0x29')](_0x13cfcf,function(_0x4e7396,_0x12bcf4){if(_0x4e7396){logger[_0x560a('0x27')](_0x560a('0x2a'),_0x13cfcf);_0x44d39d(_0x4e7396);}else{logger[_0x560a('0x27')]('Query\x20executed\x20correctly\x20%s',_0x13cfcf);odbc[_0x560a('0x2b')](function(_0x513e00){if(_0x513e00){logger[_0x560a('0x25')](_0x560a('0x2c'),_0x513e00);}_0x44d39d(null,_0x12bcf4);});}});}});};AGIVertices[_0x560a('0xb')][_0x560a('0x2d')]=function(_0x329f01,_0x8f8f84){this[_0x560a('0xa')][_0x560a('0x2e')](_0x329f01)[_0x560a('0xe')](function(_0x45db8b){_0x8f8f84(null,_0x45db8b?_0x45db8b:![]);})[_0x560a('0x10')](function(_0x1fd711){_0x8f8f84(_0x1fd711);});};AGIVertices[_0x560a('0xb')]['createSmsMessage']=function(_0x97467a,_0x126886){this[_0x560a('0xa')][_0x560a('0x2f')](_0x97467a)['then'](function(_0x1c3956){_0x126886(null,_0x1c3956);})['catch'](function(_0x52623f){_0x126886(_0x52623f);});};AGIVertices[_0x560a('0xb')][_0x560a('0x30')]=function(_0x11c8bd,_0x462d62,_0x1a1d3a){this[_0x560a('0xa')]['createSquareDetailsReport']({'uniqueid':this[_0x560a('0x31')][_0x560a('0x32')],'node':_0x11c8bd['label'],'application':_0x11c8bd['agicommand'],'data':_0x462d62||null,'project_name':this['channel'][_0x560a('0x33')],'callerid':this[_0x560a('0x31')][_0x560a('0x34')]})['then'](function(_0x5de491){if(_0x1a1d3a){_0x1a1d3a(null,_0x5de491);}})[_0x560a('0x10')](function(_0x4e52c3){if(_0x1a1d3a){_0x1a1d3a(_0x4e52c3);}});};AGIVertices[_0x560a('0xb')][_0x560a('0x35')]=function(_0x107340,_0x4a968f,_0x3ff955,_0x1991e4){this[_0x560a('0xa')]['createSquareRecording']({'uniqueid':this[_0x560a('0x31')][_0x560a('0x32')],'callerid':this[_0x560a('0x31')]['callerid'],'calleridname':this['channel'][_0x560a('0x36')],'context':this['channel'][_0x560a('0x37')],'extension':this['channel'][_0x560a('0x38')],'priority':this[_0x560a('0x31')][_0x560a('0x39')],'accountcode':this[_0x560a('0x31')][_0x560a('0x3a')],'dnid':this[_0x560a('0x31')][_0x560a('0x3b')],'projectName':this[_0x560a('0x31')]['arg_1'],'saveName':_0x4a968f,'filename':_0x107340[_0x560a('0x3c')]||_0x4a968f,'savePath':_0x3ff955})['then'](function(_0x580999){_0x1991e4(null,_0x580999);})[_0x560a('0x10')](function(_0xdf1613){_0x1991e4(_0xdf1613);});};AGIVertices[_0x560a('0xb')][_0x560a('0x3d')]=function(_0x4d68e9,_0x563f94,_0x211111,_0x5ab3f0,_0x3f8a48){this[_0x560a('0xa')]['createSquareMessage']({'uniqueid':this[_0x560a('0x31')][_0x560a('0x32')],'body':_0x4d68e9,'direction':_0x563f94,'providerName':_0x211111,'providerResponse':_0x5ab3f0})[_0x560a('0xe')](function(_0x13463f){if(_0x3f8a48){_0x3f8a48(null,_0x13463f);}})['catch'](function(_0x38dae1){if(_0x3f8a48){_0x3f8a48(_0x38dae1);}});};AGIVertices[_0x560a('0xb')][_0x560a('0x3e')]=function(_0x34be8b,_0x5b6740){this[_0x560a('0xa')][_0x560a('0x3e')]({'firstName':_[_0x560a('0x3f')](_0x34be8b[_0x560a('0xf')])||_[_0x560a('0x40')](_0x34be8b[_0x560a('0xf')])?_0x560a('0x41')+Math[_0x560a('0x42')]():_0x34be8b['name'],'lastName':_[_0x560a('0x3f')](_0x34be8b[_0x560a('0x43')])||_[_0x560a('0x40')](_0x34be8b[_0x560a('0x43')])?null:_0x34be8b['lastName'],'phone':_0x34be8b[_0x560a('0x44')],'ListId':_0x34be8b['list_id'],'scheduledat':_0x34be8b[_0x560a('0x45')],'callbackUniqueid':this['channel'][_0x560a('0x32')],'tags':'callback','description':_0x560a('0x46')+_0x34be8b[_0x560a('0x45')][_0x560a('0x47')](),'priority':_0x34be8b[_0x560a('0x48')]})[_0x560a('0xe')](function(_0x1a4b33){_0x5b6740(null,_0x1a4b33);})['catch'](function(_0x59c3d1){_0x5b6740(_0x59c3d1);});};AGIVertices[_0x560a('0xb')][_0x560a('0x49')]=function(_0x2d5c9c,_0x3f4eca){this[_0x560a('0xa')][_0x560a('0x4a')](_0x2d5c9c)[_0x560a('0xe')](function(_0x178f7a){_0x3f4eca(null,_0x178f7a?_0x178f7a[_0x560a('0xf')]:![]);})['catch'](function(_0x331800){_0x3f4eca(_0x331800);});};AGIVertices[_0x560a('0xb')]['agentPause']=function(_0x131744,_0x1e6b3f,_0x31552a){var _0x564c8a={'role':_0x560a('0x4b')};_0x564c8a[_0x131744]=this['channel'][_0x560a('0x34')];this[_0x560a('0xa')][_0x560a('0x4c')](_0x564c8a,_0x1e6b3f,this['channel'][_0x560a('0x32')])[_0x560a('0xe')](function(_0x166859){_0x31552a(null,_[_0x560a('0x40')](_0x166859)?![]:!![]);})['catch'](function(_0x174409){logger[_0x560a('0x25')](_0x174409);_0x31552a(null,![]);});};AGIVertices[_0x560a('0xb')]['agentUnpause']=function(_0x23fdd4,_0x4daef4){var _0x56df20={'role':'agent'};_0x56df20[_0x23fdd4]=this[_0x560a('0x31')][_0x560a('0x34')];this[_0x560a('0xa')][_0x560a('0x4d')](_0x56df20)[_0x560a('0xe')](function(_0x147f12){_0x4daef4(null,_[_0x560a('0x40')](_0x147f12)?![]:!![]);})['catch'](function(_0x27384b){logger[_0x560a('0x25')](_0x27384b);_0x4daef4(null,![]);});};AGIVertices[_0x560a('0xb')][_0x560a('0x4e')]=function(_0x50c05c,_0x3e0314){var _0x3e8800={'role':_0x560a('0x4b')};_0x3e8800[_0x50c05c]=this[_0x560a('0x31')][_0x560a('0x34')];this[_0x560a('0xa')][_0x560a('0x4e')](_0x3e8800)['then'](function(_0x8ca81a){_0x3e0314(null,_['isNil'](_0x8ca81a)?![]:!![]);})[_0x560a('0x10')](function(_0x4b0bcc){logger[_0x560a('0x25')](_0x4b0bcc);_0x3e0314(null,![]);});};AGIVertices[_0x560a('0xb')][_0x560a('0x4f')]=function(_0x590cd5,_0x18bb91){var _0x2fa8b7={'role':_0x560a('0x4b')};_0x2fa8b7[_0x590cd5]=this[_0x560a('0x31')]['callerid'];var _0x745abe=_0x590cd5!=_0x560a('0x50')?util[_0x560a('0x22')](_0x560a('0x51'),_0x560a('0x52'),this['channel'][_0x560a('0x34')]):undefined;this['rpc'][_0x560a('0x4f')](_0x2fa8b7,_0x745abe)[_0x560a('0xe')](function(_0x1e2818){_0x18bb91(null,_['isNil'](_0x1e2818)?![]:!![]);})[_0x560a('0x10')](function(_0x15a58d){logger[_0x560a('0x25')](_0x15a58d);_0x18bb91(null,![]);});};AGIVertices[_0x560a('0xb')]['shellCommand']=function(_0x5f305a,_0x52facf){sh['exec'](_[_0x560a('0x53')](_0x5f305a),function(_0x38feb5,_0x8c479f){var _0x5075b0=_0x8c479f[_0x560a('0x54')](/(\r\n|\n|\r)/gm,'');_0x52facf(null,_0x5075b0);});};AGIVertices[_0x560a('0xb')][_0x560a('0x55')]=function(_0x1ac52d,_0x2b4027){scripts[_0x560a('0x55')](_0x1ac52d[_0x560a('0x56')],_0x1ac52d[_0x560a('0x57')]||_0x560a('0x58'),_0x1ac52d[_0x560a('0x58')],_0x1ac52d['languageCode']||_0x560a('0x59'),_0x1ac52d[_0x560a('0x5a')]||_0x560a('0x5b'),_0x1ac52d[_0x560a('0x5c')]||_0x560a('0x5d'))[_0x560a('0xe')](function(_0x58d14e){_0x2b4027(null,_0x58d14e);})['catch'](function(_0x10ef85){_0x2b4027(_0x10ef85);});};AGIVertices[_0x560a('0xb')]['googleTTS']=function(_0x1622a3,_0x3234b1){scripts[_0x560a('0x5e')](_0x1622a3[_0x560a('0x58')],_0x1622a3['google_tts_language']||'en',0x1)[_0x560a('0xe')](function(_0x464d2e){_0x3234b1(null,_0x464d2e);})[_0x560a('0x10')](function(_0x316017){_0x3234b1(_0x316017);});};AGIVertices[_0x560a('0xb')]['restAPI']=function(_0x1258db,_0x538f3){var _0x4103d3={'uri':_0x1258db[_0x560a('0x5f')],'method':_0x1258db[_0x560a('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1258db['timeout'])===_0x560a('0x61')&&parseInt(_0x1258db[_0x560a('0x62')])>=0x1?parseInt(_0x1258db[_0x560a('0x62')])*0x3e8:0x5*0x3e8};if(_[_0x560a('0x63')]([_0x560a('0x64'),_0x560a('0x65')],_0x4103d3['method']['toUpperCase']())){try{_0x4103d3[_0x560a('0x66')]=_0x1258db[_0x560a('0x67')]?JSON[_0x560a('0x68')](_0x1258db[_0x560a('0x67')]):{};}catch(_0x465317){logger[_0x560a('0x25')](_0x560a('0x69'),_0x465317);}}try{_0x4103d3[_0x560a('0x6a')]=_0x1258db[_0x560a('0x6b')]?JSON['parse'](_0x1258db['rawHeaders']):{};}catch(_0x402606){logger[_0x560a('0x25')](_0x560a('0x6c'),_0x402606);}if(_0x1258db['computedVariables']){try{var _0xbda73e=require(_0x1258db['computedVariables'])[_0x560a('0x6d')](this,_0x4103d3);_0x4103d3[_0x560a('0x6e')]=Mustache[_0x560a('0x6f')](_0x1258db[_0x560a('0x5f')],_0xbda73e,{},['$$','$$']);if(_0x4103d3[_0x560a('0x6a')]){_0x4103d3[_0x560a('0x6a')]=JSON[_0x560a('0x68')](Mustache[_0x560a('0x6f')](JSON[_0x560a('0x70')](_0x4103d3[_0x560a('0x6a')]),_0xbda73e,{},['$$','$$']));}if(_0x4103d3['body']){_0x4103d3['body']=JSON['parse'](Mustache[_0x560a('0x6f')](JSON['stringify'](_0x4103d3['body']),_0xbda73e,{},['$$','$$']));}}catch(_0x437c52){logger[_0x560a('0x25')](_0x560a('0x71'),_0x437c52);}}rp(_0x4103d3)[_0x560a('0xe')](function(_0x59b376){var _0x41c2ee={'statusCode':_0x59b376[_0x560a('0x72')]||0xc8,'statusMessage':_0x59b376[_0x560a('0x73')]||'OK','headers':_0x59b376[_0x560a('0x6a')]||{},'body':_0x59b376[_0x560a('0x66')]||{}};_0x538f3(null,_0x41c2ee);})['catch'](function(_0x48d38e){var _0x35082c={'statusCode':_0x48d38e[_0x560a('0x72')]||0x1f4,'statusMessage':_0x48d38e['message']||_0x560a('0x74'),'headers':_0x48d38e['options'][_0x560a('0x6a')]||{},'body':_0x48d38e[_0x560a('0x75')][_0x560a('0x66')]||{}};_0x538f3(null,_0x35082c);});};AGIVertices[_0x560a('0xb')][_0x560a('0x76')]=function(_0x11909a,_0x1c1da7){scripts[_0x560a('0x76')](this['channel'][_0x560a('0x32')],_0x11909a[_0x560a('0x77')],_0x11909a[_0x560a('0x58')],_0x11909a['dialogflow_language']||'en')['then'](function(_0x340611){_0x1c1da7(null,_0x340611);})[_0x560a('0x10')](function(_0x5e443f){_0x1c1da7(_0x5e443f);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x1009da,_0x183bb0){scripts[_0x560a('0x78')](this[_0x560a('0x31')][_0x560a('0x32')],_0x1009da[_0x560a('0x79')],_0x1009da[_0x560a('0x7a')],_0x1009da[_0x560a('0x7b')],_0x1009da['text'],_0x1009da[_0x560a('0x7c')]||'en')[_0x560a('0xe')](function(_0x44dc90){_0x183bb0(null,_0x44dc90);})[_0x560a('0x10')](function(_0x27718a){_0x183bb0(_0x27718a);});};AGIVertices[_0x560a('0xb')]['sestekNDA']=function(_0x233421,_0x30b9dc){scripts['sestekNDA'](this[_0x560a('0x31')],_0x233421)['then'](function(_0x44587e){_0x30b9dc(null,_0x44587e);})[_0x560a('0x10')](function(_0x45a00c){_0x30b9dc(_0x45a00c);});};AGIVertices['prototype'][_0x560a('0x7d')]=function(_0x4678c5,_0x17d53){scripts[_0x560a('0x7d')](_0x4678c5[_0x560a('0x77')],_0x4678c5[_0x560a('0x58')],_0x4678c5[_0x560a('0x7e')]||_0x560a('0x59'),_0x4678c5[_0x560a('0x7f')])[_0x560a('0xe')](function(_0x1b2e5a){_0x17d53(null,_0x1b2e5a);})[_0x560a('0x10')](function(_0x522032){_0x17d53(_0x522032);});};AGIVertices[_0x560a('0xb')][_0x560a('0x80')]=function(_0x584a24,_0x16ba9c,_0x39b45f){scripts[_0x560a('0x80')](_0x16ba9c,_0x584a24[_0x560a('0x77')],_0x584a24[_0x560a('0x81')]||'en-US',this[_0x560a('0x82')](_0x584a24['model'])?_0x584a24['model']:undefined)[_0x560a('0xe')](function(_0x10047b){_0x39b45f(null,_0x10047b);})[_0x560a('0x10')](function(_0x29bfd4){_0x39b45f(_0x29bfd4);});};AGIVertices[_0x560a('0xb')][_0x560a('0x83')]=function(_0x1f4a1d,_0x5826c9){scripts[_0x560a('0x83')](_0x1f4a1d[_0x560a('0x84')],_0x1f4a1d['aws_secret_access_key'],_0x1f4a1d[_0x560a('0x85')],_0x1f4a1d[_0x560a('0x86')]||_0x560a('0x87'),_0x1f4a1d[_0x560a('0x58')],_0x1f4a1d['aws_text_type']||'text')[_0x560a('0xe')](function(_0x1c1fad){_0x5826c9(null,_0x1c1fad);})[_0x560a('0x10')](function(_0x3eed19){_0x5826c9(_0x3eed19);});};AGIVertices[_0x560a('0xb')][_0x560a('0x88')]=function(_0x48e172,_0x32f741){scripts['awsLex'](this[_0x560a('0x31')][_0x560a('0x32')],_0x48e172[_0x560a('0x84')],_0x48e172[_0x560a('0x89')],_0x48e172['aws_lex_region'],_0x48e172['text'],_0x48e172['aws_bot_name'])[_0x560a('0xe')](function(_0x1b60fd){_0x32f741(null,_0x1b60fd);})[_0x560a('0x10')](function(_0x2303bf){_0x32f741(_0x2303bf);});};AGIVertices[_0x560a('0xb')]['googleASR']=function(_0x340a43,_0x20d8ca,_0x3e39f6){scripts[_0x560a('0x8a')](_0x20d8ca,_0x340a43[_0x560a('0x77')],_0x340a43[_0x560a('0x8b')]||_0x560a('0x59'))[_0x560a('0xe')](function(_0x23e13f){_0x3e39f6(null,_0x23e13f);})[_0x560a('0x10')](function(_0x277310){_0x3e39f6(_0x277310);});};AGIVertices[_0x560a('0xb')][_0x560a('0x8c')]=function(_0x218553,_0x4792b9,_0xb8c0f3){scripts[_0x560a('0x8c')](_0x4792b9,_0x218553[_0x560a('0x8d')],_0x218553[_0x560a('0x8e')],_0x218553[_0x560a('0x6e')])['then'](function(_0x561542){_0xb8c0f3(null,_0x561542);})[_0x560a('0x10')](function(_0x1d2df7){_0xb8c0f3(_0x1d2df7);});};AGIVertices[_0x560a('0xb')][_0x560a('0x8f')]=function(_0x4fc2b0){var _0x28fd0f=_[_0x560a('0x63')](verticesWithRetry,_0x4fc2b0['agicommand'])?_0x4fc2b0:_['clone'](_0x4fc2b0);for(var _0x210bc8 in _0x28fd0f){if(_0x28fd0f['hasOwnProperty'](_0x210bc8)){if(_0x28fd0f[_0x210bc8]&&_['isString'](_0x28fd0f[_0x210bc8])){if(_['includes'](recursiveMapAttributes,_0x210bc8)){_0x28fd0f[_0x210bc8]=this[_0x560a('0x90')](_0x28fd0f[_0x210bc8]);}else{_0x28fd0f[_0x210bc8]=this['replaceAllVariables'](_0x28fd0f[_0x210bc8]);}}}}return _0x28fd0f;};AGIVertices[_0x560a('0xb')]['recursiveNodeIndex']=function(_0x4faec7){for(var _0x14003f in _0x4faec7){if(_0x4faec7[_0x560a('0x91')](_0x14003f)){if(_[_0x560a('0x92')](_0x4faec7[_0x14003f])){this[_0x560a('0x93')](_0x4faec7[_0x14003f]);}else if(_['isArray'](_0x4faec7[_0x14003f])){for(var _0x38e045=0x0;_0x38e045<_0x4faec7[_0x14003f][_0x560a('0x94')];_0x38e045++){this[_0x560a('0x93')](_0x4faec7[_0x14003f][_0x38e045]);}}else if(_[_0x560a('0x95')](_0x4faec7[_0x14003f])){_0x4faec7[_0x14003f]=this[_0x560a('0x96')](_0x4faec7[_0x14003f]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x5e155d,_0x56d839){for(var _0x6915a3 in _0x5e155d){if(_0x5e155d['hasOwnProperty'](_0x6915a3)){if(_[_0x560a('0x92')](_0x5e155d[_0x6915a3])){if(!_[_0x560a('0x3f')](_0x5e155d[_0x6915a3])){this['saveRestApiResult'](_0x5e155d[_0x6915a3],util[_0x560a('0x22')](_0x560a('0x97'),_0x56d839,_0x6915a3));}}else if(_['isArray'](_0x5e155d[_0x6915a3])){for(var _0x4b4a4a=0x0;_0x4b4a4a<_0x5e155d[_0x6915a3]['length'];_0x4b4a4a++){this[_0x560a('0x98')](_0x5e155d[_0x6915a3][_0x4b4a4a],util[_0x560a('0x22')]('%s.%s',_0x56d839,_0x6915a3+'['+_0x4b4a4a+']'));}}else{if(!_['isNil'](_0x5e155d[_0x6915a3])){this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x97'),_0x56d839,_0x6915a3),_0x5e155d[_0x6915a3]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x955b17){try{var _0x4cf886=JSON[_0x560a('0x68')](_0x955b17);this['recursiveNodeIndex'](_0x4cf886);return JSON[_0x560a('0x70')](_0x4cf886);}catch(_0x3fe651){return this[_0x560a('0x96')](_0x955b17);}};AGIVertices[_0x560a('0xb')][_0x560a('0x96')]=function(_0x34a864){var _0x2b1def=_0x34a864[_0x560a('0x9a')]('{');for(var _0x5a5019=0x1;_0x5a5019<_0x2b1def['length'];_0x5a5019+=0x1){var _0x3cf5ba=_0x2b1def[_0x5a5019][_0x560a('0x9a')]('}');if(_0x3cf5ba[_0x560a('0x94')]>0x1){_0x34a864=_0x34a864[_0x560a('0x9b')]('{'+_0x3cf5ba[0x0]+'}',this[_0x560a('0x31')][_0x560a('0xc')](_0x3cf5ba[0x0])[_0x560a('0x9c')]||_0x3cf5ba[0x0]);}}if(_0x2b1def['length']===0x1){return _0x34a864[_0x560a('0x47')]();}return this[_0x560a('0x96')](_0x34a864);};AGIVertices[_0x560a('0xb')][_0x560a('0x9d')]=function(_0x32eb1c,_0x2fafe6){var _0xc8aecb=this[_0x560a('0x31')]['getVariable'](_0x32eb1c);if(_0xc8aecb[_0x560a('0x9e')]===-0x1){return _0xc8aecb;}logger['info'](util[_0x560a('0x22')](_0x560a('0x9f'),_0x2fafe6,_0xc8aecb['extra']));return this['channel'][_0x560a('0x99')](_0x2fafe6,_0xc8aecb[_0x560a('0x9c')]);};AGIVertices[_0x560a('0xb')][_0x560a('0x82')]=function(_0x24c672){return _0x24c672&&_0x24c672!=='0'&&_0x24c672!=='-1'&&_0x24c672!=='';};AGIVertices['prototype'][_0x560a('0xa0')]=function(_0x21e306){this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x21e306,'-');_0x21e306[_0x560a('0xa1')]=_0x21e306[_0x560a('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x560a('0xb')][_0x560a('0xa2')]=function(_0x190d64){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xa3'),_0x190d64[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x190d64[_0x560a('0x58')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xa5'));}var _0x38dcdc='\x22'+_0x190d64[_0x560a('0x58')]+'\x22';if(this['isConfigured'](_0x190d64[_0x560a('0x75')])){_0x38dcdc+=','+_0x190d64[_0x560a('0x75')];}var _0x3fc7a7=this[_0x560a('0x31')][_0x560a('0xa6')]('MRCPSynth',_0x38dcdc);if(_0x3fc7a7[_0x560a('0x9e')]===-0x1){return _0x3fc7a7;}return this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xa8'),_0x38dcdc));};AGIVertices['prototype']['mrcprecog']=function(_0x274037){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xa9'),_0x274037[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x274037[_0x560a('0xaa')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xab'));}var _0x54c348=_0x274037[_0x560a('0xaa')];if(this[_0x560a('0x82')](_0x274037[_0x560a('0x75')])){_0x54c348+=','+_0x274037[_0x560a('0x75')];}var _0x618db3=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xac'),_0x54c348);if(_0x618db3['result']===-0x1){return _0x618db3;}var _0x37196f=this[_0x560a('0x9d')](_0x560a('0xad'),'MRCP_RECOG_CONFIDENCE');if(_0x37196f[_0x560a('0x9e')]===-0x1){return _0x37196f;}var _0x1b6e56=this['getAndSetVariable'](_0x560a('0xae'),_0x560a('0xaf'));if(_0x1b6e56[_0x560a('0x9e')]===-0x1){return _0x1b6e56;}var _0xf7e7ae=this[_0x560a('0x9d')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0xf7e7ae['result']===-0x1){return _0xf7e7ae;}return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0xb0'),_0x54c348));};AGIVertices[_0x560a('0xb')][_0x560a('0xb1')]=function(_0x4dcfc2){logger['info'](util[_0x560a('0x22')](_0x560a('0xb2'),_0x4dcfc2['label']));return this[_0x560a('0x31')]['agi']([_0x4dcfc2[_0x560a('0xb3')],_0x4dcfc2['args']]);};AGIVertices[_0x560a('0xb')][_0x560a('0xb4')]=function(_0x19dda5){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xb5'),_0x19dda5['label']));if(this[_0x560a('0x82')](_0x19dda5[_0x560a('0x62')])){logger[_0x560a('0x27')](util['format'](_0x560a('0xb6'),_0x19dda5[_0x560a('0x62')]));var _0x2338c3=this[_0x560a('0x31')]['wait'](_0x19dda5[_0x560a('0x62')]);if(_0x2338c3[_0x560a('0x9e')]===-0x1){return _0x2338c3;}}return this[_0x560a('0x31')]['answer']();};AGIVertices[_0x560a('0xb')]['callback']=function(_0x1a08da){logger['info'](util[_0x560a('0x22')](_0x560a('0xb7'),_0x1a08da[_0x560a('0xa4')]));if(!this['isConfigured'](_0x1a08da[_0x560a('0xb8')])){return this['channel'][_0x560a('0x25')](_0x1a08da,'no\x20list\x20selected');}_0x1a08da[_0x560a('0x45')]=moment();if(this[_0x560a('0x82')](_0x1a08da[_0x560a('0xb9')])){_0x1a08da[_0x560a('0x45')]=moment()['add'](_0x1a08da[_0x560a('0xb9')],_0x560a('0xba'));}if(!this[_0x560a('0x82')](_0x1a08da['callback_priority'])){_0x1a08da[_0x560a('0x48')]=0x2;}this['createCmContact']['sync'](this,_0x1a08da);return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0xbb'),_0x1a08da[_0x560a('0x44')],_0x1a08da[_0x560a('0xb8')],_0x1a08da[_0x560a('0x45')]));};AGIVertices[_0x560a('0xb')][_0x560a('0xbc')]=function(_0x2a2f07){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a2f07[_0x560a('0xa4')]));var _0x38d059=this[_0x560a('0x31')][_0x560a('0xa6')](_0x2a2f07[_0x560a('0xbd')],_0x2a2f07['options']);if(_0x38d059[_0x560a('0x9e')]===-0x1){return _0x38d059;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x2a2f07[_0x560a('0xbd')],_0x2a2f07['options']));};AGIVertices[_0x560a('0xb')][_0x560a('0xbf')]=function(_0x4f759f){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xc0'),_0x4f759f[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x4f759f['text'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xa5'));}var _0x165e3c='\x22'+_0x4f759f[_0x560a('0x58')]+'\x22';if(this[_0x560a('0x82')](_0x4f759f[_0x560a('0x75')])){_0x165e3c+=','+_0x4f759f['options'];}var _0x27fd65=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xc1'),_0x165e3c);if(_0x27fd65[_0x560a('0x9e')]===-0x1){return _0x27fd65;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xa8'),_0x165e3c));};AGIVertices[_0x560a('0xb')][_0x560a('0xc2')]=function(_0x454d5c){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x454d5c[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x454d5c[_0x560a('0x58')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xa5'));}var _0x18189c='\x22'+_0x454d5c['text']+'\x22';if(this[_0x560a('0x82')](_0x454d5c['options'])){_0x18189c+=','+_0x454d5c[_0x560a('0x75')];}var _0x193d39=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xc1'),_0x18189c);if(_0x193d39[_0x560a('0x9e')]===-0x1){return _0x193d39;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xa8'),_0x18189c));};AGIVertices[_0x560a('0xb')][_0x560a('0xc3')]=function(_0x4f2aa0){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xc4'),_0x4f2aa0[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x4f2aa0['grammar'])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20grammar\x20configured');}var _0x47a2f2=_0x4f2aa0['grammar'];if(this[_0x560a('0x82')](_0x4f2aa0[_0x560a('0x75')])){_0x47a2f2+=','+_0x4f2aa0[_0x560a('0x75')];}var _0x23e5d7=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xac'),_0x47a2f2);if(_0x23e5d7['result']===-0x1){return _0x23e5d7;}var _0x2e5948=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x2e5948[_0x560a('0x9e')]===-0x1){return _0x2e5948;}var _0x535467=this[_0x560a('0x9d')](_0x560a('0xae'),_0x560a('0xc5'));if(_0x535467[_0x560a('0x9e')]===-0x1){return _0x535467;}var _0x165396=this[_0x560a('0x9d')](_0x560a('0xc6'),_0x560a('0xc7'));if(_0x165396['result']===-0x1){return _0x165396;}return this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')]('Executed\x20command\x20MRCPRecog\x20%s',_0x47a2f2));};AGIVertices[_0x560a('0xb')][_0x560a('0xc8')]=function(_0x249732){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xc9'),_0x249732[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x249732[_0x560a('0xaa')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20grammar\x20configured');}var _0x563c04=_0x249732[_0x560a('0xaa')];if(this['isConfigured'](_0x249732['options'])){_0x563c04+=','+_0x249732[_0x560a('0x75')];}var _0x572dd2=this[_0x560a('0x31')][_0x560a('0xa6')]('MRCPRecog',_0x563c04);if(_0x572dd2[_0x560a('0x9e')]===-0x1){return _0x572dd2;}var _0x3a3459=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x560a('0xca'));if(_0x3a3459['result']===-0x1){return _0x3a3459;}var _0x4a970f=this[_0x560a('0x9d')](_0x560a('0xae'),_0x560a('0xcb'));if(_0x4a970f[_0x560a('0x9e')]===-0x1){return _0x4a970f;}var _0x396749=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x396749[_0x560a('0x9e')]===-0x1){return _0x396749;}return this['channel'][_0x560a('0xa7')](util['format'](_0x560a('0xb0'),_0x563c04));};AGIVertices['prototype'][_0x560a('0xcc')]=function(_0x1fcdd4){logger[_0x560a('0x27')](util['format'](_0x560a('0xcd'),_0x1fcdd4[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x1fcdd4[_0x560a('0xce')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1fcdd4,_0x560a('0xcf'));}var _0x161434=this[_0x560a('0x12')][_0x560a('0x6d')](this,_0x1fcdd4[_0x560a('0xce')]);if(!_0x161434){return this['channel'][_0x560a('0x25')](_0x1fcdd4,_0x560a('0xd0'));}if(!this[_0x560a('0x82')](_0x1fcdd4[_0x560a('0x29')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1fcdd4,_0x560a('0xd1'));}var _0x2cb870=_0x1fcdd4['query'][_0x560a('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xd2'),_0x2cb870));var _0x449d29=this[_0x560a('0x24')][_0x560a('0x6d')](this,_0x161434,_0x2cb870);this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x1fcdd4,_0x2cb870);if(!this[_0x560a('0x82')](_0x1fcdd4[_0x560a('0xd3')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xd4'));}var _0x2637e9=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x1fcdd4[_0x560a('0xd3')]);if(!_0x2637e9){return this[_0x560a('0x31')]['error'](_0x1fcdd4,'no\x20variable\x20found');}var _0x35967f=this;_0x449d29[_0x560a('0xd5')](function(_0x584244,_0x5eb348){Object[_0x560a('0xd6')](_0x584244)['forEach'](function(_0xd9e4dc){_0x35967f['channel'][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xd7'),_0x2637e9,_0x5eb348,_0xd9e4dc),_0x584244[_0xd9e4dc]);});});this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xd8'),_0x2637e9),_0x449d29['length']);return this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xd9'),_0x2637e9));};AGIVertices[_0x560a('0xb')][_0x560a('0xda')]=function(_0x519a26){logger['debug'](util[_0x560a('0x22')](_0x560a('0xdb'),_0x519a26[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x519a26[_0x560a('0xdc')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x519a26,_0x560a('0xdd'));}var _0x3ac212=this[_0x560a('0x14')][_0x560a('0x6d')](this,_0x519a26[_0x560a('0xdc')]);if(!_0x3ac212){return this[_0x560a('0x31')][_0x560a('0x25')](_0x519a26,'no\x20user\x20found');}var _0x34978a=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xde'),[util[_0x560a('0x22')](_0x560a('0xdf'),_0x3ac212),_0x519a26['timeout'],_0x519a26[_0x560a('0xe0')],_0x519a26[_0x560a('0x5f')]]);if(_0x34978a['result']===-0x1){return _0x34978a;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x560a('0xb')]['dialogflow']=function(_0x21ada7){logger[_0x560a('0x27')](util['format'](_0x560a('0xe1'),_0x21ada7[_0x560a('0xa4')]));if(!this['isConfigured'](_0x21ada7[_0x560a('0x77')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xe2'));}if(!this[_0x560a('0x82')](_0x21ada7[_0x560a('0x58')])){return this[_0x560a('0x31')]['noop']('no\x20text\x20configured');}this['channel'][_0x560a('0xe3')]=!![];this[_0x560a('0x30')](_0x21ada7);this[_0x560a('0x3d')](_0x21ada7[_0x560a('0x58')],'in','','');this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xe4'),_0x21ada7[_0x560a('0x58')]));var _0x6bebd=this['googleDialogflow']['sync'](this,_0x21ada7);if(_0x6bebd){for(var _0x8f891b in _0x6bebd){if(_0x6bebd['hasOwnProperty'](_0x8f891b)){this[_0x560a('0x31')]['setVariable'](util[_0x560a('0x22')](_0x560a('0xe5'),_0x8f891b[_0x560a('0xe6')]()),_0x6bebd[_0x8f891b]);}}this[_0x560a('0x3d')](_0x6bebd[_0x560a('0xe7')],_0x560a('0xe8'),'dialogflow','');return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Dialogflow\x20Result\x20%s',_0x6bebd['speech']));}return this[_0x560a('0x31')][_0x560a('0x25')](_0x21ada7,_0x560a('0xe9'));};AGIVertices[_0x560a('0xb')][_0x560a('0xea')]=function(_0x455df8){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xeb'),_0x455df8[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x79')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xec'));}if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x7a')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xed'));}if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x7b')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x455df8[_0x560a('0x7c')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xee'));}if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x58')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xe3')]=!![];this['createSquareDetailsReport'](_0x455df8);this[_0x560a('0x3d')](_0x455df8['text'],'in','','');this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xef'),_0x455df8['text']));var _0x1e6025=this[_0x560a('0x78')]['sync'](this,_0x455df8);if(_0x1e6025){for(var _0x37befb in _0x1e6025){if(_0x1e6025[_0x560a('0x91')](_0x37befb)){if(_0x37befb!==_0x560a('0xf0')){this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xe5'),_0x37befb[_0x560a('0xe6')]()),_0x1e6025[_0x37befb]);}}}this[_0x560a('0x3d')](_0x1e6025[_0x560a('0xe7')],_0x560a('0xe8'),_0x560a('0xea'),_0x1e6025['providerResponse']);return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xf1'),_0x1e6025[_0x560a('0xe7')]));}return this[_0x560a('0x31')][_0x560a('0x25')](_0x455df8,_0x560a('0xf2'));};AGIVertices[_0x560a('0xb')][_0x560a('0xf3')]=function(_0x57c024){logger['info'](util[_0x560a('0x22')](_0x560a('0xf4'),_0x57c024[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x57c024[_0x560a('0xf5')])){return this['channel']['noop'](_0x560a('0xf6'));}if(!this[_0x560a('0x82')](_0x57c024[_0x560a('0xf7')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xf8'));}if(!this[_0x560a('0x82')](_0x57c024[_0x560a('0xf9')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xfa'));}if(!this['isConfigured'](_0x57c024[_0x560a('0xfb')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xa5'));}this['channel'][_0x560a('0xe3')]=!![];this[_0x560a('0x30')](_0x57c024);this['createSquareMessage'](_0x57c024['text'],'in','','');this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xfc'),_0x57c024[_0x560a('0x58')]));var _0x230586=this[_0x560a('0xfd')][_0x560a('0x6d')](this,_0x57c024);if(_0x230586){for(var _0x32fe31 in _0x230586){if(_0x230586[_0x560a('0x91')](_0x32fe31)){this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xfe'),_0x32fe31[_0x560a('0xe6')]()),_0x230586[_0x32fe31]);}}this['createSquareMessage'](_0x230586[_0x560a('0xe7')],_0x560a('0xe8'),_0x560a('0xf3'),'');if(_0x230586[_0x560a('0xff')]){this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x100'),_0x230586[_0x560a('0xff')]));var _0x225362=this[_0x560a('0x31')]['streamFile'](_0x230586[_0x560a('0xff')]);try{fs[_0x560a('0x101')](_0x230586[_0x560a('0xff')]+'.wav');}catch(_0x30f497){logger[_0x560a('0x25')](_0x30f497);}return _0x225362;}else{return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')]('SestekNDA\x20Result\x20%s',_0x230586[_0x560a('0xe7')]));}}return this['channel']['error'](_0x57c024,_0x560a('0x102'));};AGIVertices['prototype'][_0x560a('0x103')]=function(_0x243881){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x104'),_0x243881[_0x560a('0xa4')]));return this[_0x560a('0x31')]['noop']('end');};AGIVertices['prototype'][_0x560a('0x105')]=function(_0xeaa26c){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x106'),_0xeaa26c['label']));var _0x4750d1='';if(_0xeaa26c[_0x560a('0x107')]){if(!this[_0x560a('0x82')](_0xeaa26c[_0x560a('0x107')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0xeaa26c,_0x560a('0x108'));}else{var _0x198dca=parseInt(_0xeaa26c[_0x560a('0x107')],0xa);if(isNaN(_0x198dca)){_0x4750d1=_0xeaa26c['trunk_id'];}else{_0x4750d1=this[_0x560a('0x109')][_0x560a('0x6d')](this,_0xeaa26c['trunk_id']);if(!_0x4750d1){return this[_0x560a('0x31')][_0x560a('0x25')](_0xeaa26c,_0x560a('0x10a'));}}}}else if(_0xeaa26c[_0x560a('0x10b')]){_0x4750d1=_0xeaa26c[_0x560a('0x10b')];}else{return this[_0x560a('0x31')][_0x560a('0x25')](_0xeaa26c,_0x560a('0x108'));}var _0x188997=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xde'),[util[_0x560a('0x22')](_0x560a('0x10c'),_0x4750d1,_0xeaa26c[_0x560a('0x44')]),_0xeaa26c[_0x560a('0x62')],_0xeaa26c[_0x560a('0xe0')],_0xeaa26c['url']]);if(_0x188997[_0x560a('0x9e')]===-0x1){return _0x188997;}return this['channel'][_0x560a('0xa7')](util['format'](_0x560a('0x10d'),'DIAL'));};AGIVertices['prototype'][_0x560a('0x10e')]=function(_0x247226){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x247226[_0x560a('0xa4')]));return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x10e'));};AGIVertices[_0x560a('0xb')][_0x560a('0x8')]=function(_0x24acdd){logger['info'](util[_0x560a('0x22')](_0x560a('0x10f'),_0x24acdd[_0x560a('0xa4')]));if(_0x24acdd[_0x560a('0xa1')]===0x0){return this[_0x560a('0xa0')](_0x24acdd);}_0x24acdd[_0x560a('0xa1')]-=0x1;if(!this[_0x560a('0x82')](_0x24acdd[_0x560a('0x110')])){return this['channel'][_0x560a('0x25')](_0x24acdd,_0x560a('0x111'));}var _0x15a6c0=this[_0x560a('0x16')][_0x560a('0x6d')](this,_0x24acdd[_0x560a('0x110')]);if(!_0x15a6c0){return this[_0x560a('0x31')][_0x560a('0x25')](_0x24acdd,_0x560a('0x112'));}if(!this[_0x560a('0x82')](_0x24acdd[_0x560a('0xd3')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x560a('0xd4'));}var _0x5f3776=this[_0x560a('0x31')][_0x560a('0x113')](_0x15a6c0,_0x24acdd[_0x560a('0x114')],_0x24acdd[_0x560a('0x115')]);var _0x548802=_0x5f3776[_0x560a('0x9e')]?_0x5f3776[_0x560a('0x9e')][_0x560a('0x47')]():'';logger[_0x560a('0x27')](_0x560a('0x116'),JSON[_0x560a('0x70')](_0x5f3776));if(_0x5f3776[_0x560a('0x9e')]===-0x1){this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x24acdd,_0x548802);return _0x5f3776;}else if(_0x5f3776['extra']===_0x560a('0x62')){_0x5f3776['result']=_0x548802[_0x560a('0x94')]>=parseInt(_0x24acdd[_0x560a('0x117')])?'x':'i';}else{_0x5f3776['result']=_0x548802[_0x560a('0x94')]>=parseInt(_0x24acdd[_0x560a('0x117')])&&_0x548802['length']<=parseInt(_0x24acdd[_0x560a('0x115')])?'x':'i';}var _0x5cba05=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x24acdd[_0x560a('0xd3')]);if(!_0x5cba05){return this['channel'][_0x560a('0x25')](_0x24acdd,_0x560a('0x118'));}this['channel']['setVariable'](_0x5cba05,_0x548802);if(this['isConfigured'](_0x24acdd[_0x560a('0x119')])){var _0x4f0e54=parseInt(_0x24acdd[_0x560a('0x119')],0xa);var _0x32f6a2=rs[_0x560a('0x11a')]({'charset':'*','length':_0x4f0e54});var _0x457352=_0x548802[_0x560a('0x94')];if(_0x457352>0x0){if(_0x457352>_0x4f0e54){this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x24acdd,_0x24acdd[_0x560a('0x11b')]===_0x560a('0x11c')?_0x32f6a2+_0x548802[_0x560a('0x11d')](_0x4f0e54):_0x548802[_0x560a('0x11d')](0x0,_0x457352-_0x4f0e54)+_0x32f6a2);}else{this[_0x560a('0x30')]['sync'](this,_0x24acdd,rs[_0x560a('0x11a')]({'charset':'*','length':_0x457352}));}}else{this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x24acdd,'');}}else{this['createSquareDetailsReport'][_0x560a('0x6d')](this,_0x24acdd,_0x548802);}return _0x5f3776;};AGIVertices[_0x560a('0xb')][_0x560a('0x9')]=function(_0x14c8bf){logger[_0x560a('0x27')](util['format'](_0x560a('0x11e'),_0x14c8bf['label']));return this[_0x560a('0x8')](_0x14c8bf);};AGIVertices['prototype']['goal']=function(_0x355895){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x11f'),_0x355895[_0x560a('0xa4')]));this['createSquareDetailsReport'][_0x560a('0x6d')](this,_0x355895,_0x355895[_0x560a('0x120')]);return this[_0x560a('0x31')][_0x560a('0xa7')](util['format']('GOAL\x20%s',_0x355895[_0x560a('0x120')]));};AGIVertices[_0x560a('0xb')][_0x560a('0x121')]=function(_0x2e8acb){logger[_0x560a('0x27')](util['format'](_0x560a('0x122'),_0x2e8acb['label']));if(!this[_0x560a('0x82')](_0x2e8acb[_0x560a('0x84')])||!this['isConfigured'](_0x2e8acb[_0x560a('0x89')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x560a('0x82')](_0x2e8acb[_0x560a('0x58')])){return this['channel']['noop'](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x123'),_0x2e8acb[_0x560a('0x58')]));var _0xc2501b=this[_0x560a('0x83')][_0x560a('0x6d')](this,_0x2e8acb);if(_0xc2501b){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('aws\x20Polly\x20%s\x20file\x20created',_0xc2501b));var _0xad6a03=this[_0x560a('0x31')][_0x560a('0x124')](_0xc2501b);try{fs[_0x560a('0x101')](_0xc2501b+_0x560a('0x125'));}catch(_0x25a95c){logger['error'](_0x25a95c);}return _0xad6a03;}return this[_0x560a('0x31')][_0x560a('0x25')](_0x2e8acb,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x560a('0xb')]['awslex']=function(_0x258ef3){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x126'),_0x258ef3[_0x560a('0xa4')]));if(!this['isConfigured'](_0x258ef3[_0x560a('0x84')])||!this[_0x560a('0x82')](_0x258ef3[_0x560a('0x89')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x127'));}if(!this[_0x560a('0x82')](_0x258ef3[_0x560a('0x128')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x129'));}if(!this[_0x560a('0x82')](_0x258ef3[_0x560a('0x58')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xe3')]=!![];this[_0x560a('0x30')](_0x258ef3);this[_0x560a('0x3d')](_0x258ef3[_0x560a('0x58')],'in','','');this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x12a'),_0x258ef3[_0x560a('0x58')]));var _0x1b40aa=this['awsLex'][_0x560a('0x6d')](this,_0x258ef3);if(_0x1b40aa){for(var _0x24954d in _0x1b40aa){if(_0x1b40aa[_0x560a('0x91')](_0x24954d)&&_['isString'](_0x1b40aa[_0x24954d])){this[_0x560a('0x31')][_0x560a('0x99')](util['format'](_0x560a('0x12b'),_0x24954d[_0x560a('0xe6')]()),_0x1b40aa[_0x24954d]);}}if(_[_0x560a('0x40')](_0x1b40aa[_0x560a('0x12c')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x560a('0x3d')](_0x1b40aa[_0x560a('0x12c')],_0x560a('0xe8'),_0x560a('0x12d'),'');return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Amazon\x20Lex\x20Result\x20%s',_0x1b40aa[_0x560a('0x12c')]));}}return this['channel'][_0x560a('0x25')](_0x258ef3,_0x560a('0x12e'));};AGIVertices[_0x560a('0xb')][_0x560a('0x12f')]=function(_0x590bd5){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x130'),_0x590bd5[_0x560a('0xa4')],_0x590bd5[_0x560a('0x62')]));if(!this[_0x560a('0x82')](_0x590bd5['key'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xe2'));}var _0x19b6f0='wav';var _0xeff610=util['format'](_0x560a('0x131'),FILES_PATH,rs[_0x560a('0x11a')](0x4));var _0x37b115=util['format'](_0x560a('0x97'),_0xeff610,_0x19b6f0);var _0x447b30=!![];if(_0x590bd5[_0x560a('0x132')]===_0x560a('0x133')){_0x447b30=![];}var _0x37c9e9=this['channel'][_0x560a('0x134')](_0xeff610,_0x19b6f0,_0x590bd5[_0x560a('0x135')],_0x590bd5[_0x560a('0x62')],undefined,_0x447b30);if(_0x37c9e9[_0x560a('0x9e')]!==-0x1){this['channel']['noop'](util[_0x560a('0x22')](_0x560a('0x136'),_0x37b115));var _0x9e67c1=this[_0x560a('0x8a')]['sync'](this,_0x590bd5,_0x37b115);if(_0x9e67c1){for(var _0x1dd675 in _0x9e67c1){if(_0x9e67c1[_0x560a('0x91')](_0x1dd675)){this['channel'][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x137'),_0x1dd675['toUpperCase']()),_0x9e67c1[_0x1dd675]);}}return this['channel']['noop'](util[_0x560a('0x22')](_0x560a('0x138'),JSON['stringify'](_0x9e67c1)));}}return _0x37c9e9;};AGIVertices[_0x560a('0xb')][_0x560a('0x139')]=function(_0x85add2){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x13a'),_0x85add2[_0x560a('0xa4')]));if(!this['isConfigured'](_0x85add2[_0x560a('0x8d')])){return this[_0x560a('0x31')]['noop']('no\x20appid\x20configured');}if(!this[_0x560a('0x82')](_0x85add2['appsecret'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x13b'));}var _0x176d02='wav';var _0x560d88=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x560a('0x11a')](0x4));var _0x31a7ca=util['format'](_0x560a('0x97'),_0x560d88,_0x176d02);var _0x42401a=!![];if(_0x85add2[_0x560a('0x132')]===_0x560a('0x133')){_0x42401a=![];}var _0x669de8=this[_0x560a('0x31')]['recordFile'](_0x560d88,_0x176d02,_0x85add2[_0x560a('0x135')],_0x85add2[_0x560a('0x62')],undefined,_0x42401a);if(_0x669de8[_0x560a('0x9e')]!==-0x1){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x13c'),_0x31a7ca));var _0x152687=this[_0x560a('0x8c')][_0x560a('0x6d')](this,_0x85add2,_0x31a7ca);if(_0x152687){for(var _0x333bf6 in _0x152687){if(_0x152687[_0x560a('0x91')](_0x333bf6)){this[_0x560a('0x31')][_0x560a('0x99')](util['format'](_0x560a('0x13d'),_0x333bf6[_0x560a('0xe6')]()),_0x152687[_0x333bf6]);}}return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0x13e'),JSON[_0x560a('0x70')](_0x152687)));}}return _0x669de8;};AGIVertices[_0x560a('0xb')]['gotoc']=function(_0x1b442e){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1b442e['label']));return this[_0x560a('0x31')]['continueAt'](_0x1b442e[_0x560a('0x37')],_0x1b442e[_0x560a('0x38')],_0x1b442e[_0x560a('0x39')]);};AGIVertices['prototype'][_0x560a('0x13f')]=function(_0x4f63e2){logger['info'](util[_0x560a('0x22')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4f63e2[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x4f63e2[_0x560a('0x140')])){return this['channel'][_0x560a('0x25')](_0x4f63e2,_0x560a('0x141'));}try{var _0x4e44fa=eval(_0x4f63e2[_0x560a('0x140')])?_0x560a('0x142'):_0x560a('0x143');this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x144'),_0x4f63e2[_0x560a('0x140')],_0x4e44fa));return{'code':0xc8,'result':_0x4e44fa};}catch(_0x3468f0){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x560a('0xb')]['gotoiftime']=function(_0x118c07){logger[_0x560a('0x27')](util['format'](_0x560a('0x145'),_0x118c07['label']));if(!this['isConfigured'](_0x118c07['interval_id'])){return this[_0x560a('0x31')]['error'](_0x118c07,_0x560a('0x146'));}var _0x510a9e=this['getIntervals'][_0x560a('0x6d')](this,_0x118c07[_0x560a('0x147')]);if(!_0x510a9e){return this[_0x560a('0x31')][_0x560a('0x25')](_0x118c07,_0x560a('0x148'));}for(var _0x2ff6a8=0x0;_0x2ff6a8<_0x510a9e[_0x560a('0x94')];_0x2ff6a8+=0x1){var _0x36785b=this[_0x560a('0x31')][_0x560a('0xc')](util[_0x560a('0x22')](_0x560a('0x149'),_0x510a9e[_0x2ff6a8]));if(_0x36785b[_0x560a('0x9e')]===-0x1){return _0x36785b;}logger[_0x560a('0x27')](util['format'](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],_0x36785b[_0x560a('0x9c')]));if(_0x36785b[_0x560a('0x9c')]===_0x560a('0x142')){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],'true'));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],_0x560a('0x142')));return{'code':0xc8,'result':_0x560a('0x142')};}else{logger[_0x560a('0x27')](util['format']('IFTIME\x20%s\x20%s',_0x510a9e[_0x2ff6a8],_0x560a('0x143')));this[_0x560a('0x31')]['noop'](util['format'](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],_0x560a('0x143')));}}return{'code':0xc8,'result':_0x560a('0x143')};};AGIVertices[_0x560a('0xb')][_0x560a('0x14b')]=function(_0x4855aa){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x14c'),_0x4855aa[_0x560a('0xa4')]));return this[_0x560a('0x31')][_0x560a('0x14b')]();};AGIVertices[_0x560a('0xb')][_0x560a('0x14d')]=function(_0x5832d5){logger[_0x560a('0x27')](util['format'](_0x560a('0x14e'),_0x5832d5[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x5832d5['key'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xe2'));}var _0xbaab0e=_0x560a('0x14f');var _0x20c343=util[_0x560a('0x22')](_0x560a('0x131'),FILES_PATH,rs[_0x560a('0x11a')](0x4));var _0x5a586b=util['format'](_0x560a('0x97'),_0x20c343,_0xbaab0e);var _0x2d8c1a=!![];if(_0x5832d5['beep']===_0x560a('0x133')){_0x2d8c1a=![];}var _0x45da00=this[_0x560a('0x31')]['recordFile'](_0x20c343,_0xbaab0e,_0x5832d5['intKey'],_0x5832d5[_0x560a('0x62')],undefined,_0x2d8c1a);if(_0x45da00[_0x560a('0x9e')]!==-0x1){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x150'),_0x5a586b));var _0x619bd5=this[_0x560a('0x80')]['sync'](this,_0x5832d5,_0x5a586b);if(_0x619bd5){for(var _0x3168c2 in _0x619bd5){if(_0x619bd5['hasOwnProperty'](_0x3168c2)){this[_0x560a('0x31')][_0x560a('0x99')](util['format'](_0x560a('0x151'),_0x3168c2[_0x560a('0xe6')]()),_0x619bd5[_0x3168c2]);}}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x152'),JSON[_0x560a('0x70')](_0x619bd5)));}}return _0x45da00;};AGIVertices[_0x560a('0xb')][_0x560a('0x153')]=function(_0x35b2cd){logger[_0x560a('0x27')](util['format'](_0x560a('0x154'),_0x35b2cd[_0x560a('0xa4')]));if(!this['isConfigured'](_0x35b2cd[_0x560a('0x77')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x35b2cd[_0x560a('0x58')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20text\x20configured');}this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')]('Trying\x20ispeech\x20TTS\x20%s',_0x35b2cd[_0x560a('0x58')]));var _0x4ddab9=this[_0x560a('0x7d')]['sync'](this,_0x35b2cd);if(_0x4ddab9){this['channel'][_0x560a('0xa7')](util['format'](_0x560a('0x150'),_0x4ddab9));var _0x16f54a=this[_0x560a('0x31')][_0x560a('0x124')](_0x4ddab9,_0x35b2cd[_0x560a('0x135')]);try{fs[_0x560a('0x101')](_0x4ddab9+'.wav');}catch(_0x350136){logger[_0x560a('0x25')](_0x350136);}return _0x16f54a;}return this['channel'][_0x560a('0x25')](_0x35b2cd,_0x560a('0x155'));};AGIVertices['prototype']['login']=function(_0x56de22){logger[_0x560a('0x27')](util['format'](_0x560a('0x156'),_0x56de22[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x56de22[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x56de22,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x560a('0x158'),this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));var _0x12e8e8=this['agentLogin'][_0x560a('0x6d')](this,_0x56de22[_0x560a('0x157')]);if(_0x12e8e8){logger[_0x560a('0x27')](util[_0x560a('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0x560a('0x27')](util['format'](_0x560a('0x15a'),this['channel'][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));return{'code':0xc8,'result':_0x560a('0x15b')};}};AGIVertices['prototype'][_0x560a('0x15c')]=function(_0x557550){logger[_0x560a('0x27')](util['format'](_0x560a('0x15d'),_0x557550[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x557550[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x557550,'no\x20find\x20by\x20configured');}logger['info'](util[_0x560a('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x560a('0x31')][_0x560a('0x34')],_0x557550['findBy']));var _0xc24308=this[_0x560a('0x4e')][_0x560a('0x6d')](this,_0x557550[_0x560a('0x157')]);if(_0xc24308){logger['info'](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')]['callerid'],_0x557550['findBy']));this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x560a('0x31')][_0x560a('0x34')],_0x557550[_0x560a('0x157')]));return{'code':0xc8,'result':_0x560a('0x15e')};}else{logger[_0x560a('0x27')](util[_0x560a('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x557550[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x15a'),this[_0x560a('0x31')]['callerid'],_0x557550[_0x560a('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x560a('0xb')][_0x560a('0x15f')]=function(_0x899f4){logger[_0x560a('0x27')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x899f4['label']));if(!this[_0x560a('0x82')](_0x899f4[_0x560a('0x160')])){return this[_0x560a('0x31')]['error'](_0x899f4,_0x560a('0x161'));}this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x162'),_0x899f4[_0x560a('0x160')]));var _0x154713=eval(_0x899f4['operation']);if(!this[_0x560a('0x82')](_0x899f4['variable_id'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xd4'));}var _0x7516a5=this['getVariable'][_0x560a('0x6d')](this,_0x899f4[_0x560a('0xd3')]);if(!_0x7516a5){return this[_0x560a('0x31')][_0x560a('0x25')](_0x899f4,_0x560a('0x118'));}if(_[_0x560a('0x163')](_0x154713)){var _0x6f84a3=this;_0x154713[_0x560a('0xd5')](function(_0x232f80,_0x1d73b0){_0x6f84a3['channel'][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x164'),_0x7516a5,_0x1d73b0),_0x232f80);});return this[_0x560a('0x31')][_0x560a('0xa7')](util['format']('variable\x20%s[key]\x20set',_0x7516a5));}else{return this[_0x560a('0x31')][_0x560a('0x99')](_0x7516a5,_0x154713);}};AGIVertices[_0x560a('0xb')]['menu']=function(_0x51fb37){logger['info'](util['format'](_0x560a('0x165'),_0x51fb37[_0x560a('0xa4')]));if(_0x51fb37[_0x560a('0xa1')]===0x0){return this[_0x560a('0xa0')](_0x51fb37);}_0x51fb37[_0x560a('0xa1')]-=0x1;if(!this[_0x560a('0x82')](_0x51fb37['file_id'])){return this['channel'][_0x560a('0x25')](_0x51fb37,_0x560a('0x111'));}var _0xba2c6b=this['getSound'][_0x560a('0x6d')](this,_0x51fb37['file_id']);if(!_0xba2c6b){return this[_0x560a('0x31')][_0x560a('0x25')](_0x51fb37,_0x560a('0x112'));}var _0xc6e4a=this[_0x560a('0x31')][_0x560a('0x113')](_0xba2c6b,_0x51fb37[_0x560a('0x114')],_0x51fb37[_0x560a('0x166')]);var _0x45d976=_0xc6e4a[_0x560a('0x9e')];if(_0xc6e4a[_0x560a('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x51fb37,'-1');return _0xc6e4a;}else if(_0xc6e4a['extra']===_0x560a('0x62')){_0xc6e4a['result']=_0xc6e4a[_0x560a('0x9e')][_0x560a('0x94')]>0x0?_0xc6e4a[_0x560a('0x9e')]:'t';}else if(_['isEmpty'](_0xc6e4a[_0x560a('0x9e')])){_0xc6e4a[_0x560a('0x9e')]='#';_0x45d976='#';}if(!this[_0x560a('0x82')](_0x51fb37['variable_id'])){this['channel'][_0x560a('0xa7')](_0x560a('0xd4'));}else{var _0x56348c=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x51fb37[_0x560a('0xd3')]);if(!_0x56348c){return this[_0x560a('0x31')][_0x560a('0x25')](_0x51fb37,_0x560a('0x118'));}this[_0x560a('0x31')][_0x560a('0x99')](_0x56348c,_0x45d976);}this[_0x560a('0x30')]['sync'](this,_0x51fb37,_0x45d976);return _0xc6e4a;};AGIVertices[_0x560a('0xb')]['noop']=function(_0xc8e2ba){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x167'),_0xc8e2ba['label']));return this[_0x560a('0x31')]['noop'](_0xc8e2ba[_0x560a('0x168')]||_0xc8e2ba['label']);};AGIVertices[_0x560a('0xb')][_0x560a('0x169')]=function(_0x3b4c47){logger['info'](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3b4c47[_0x560a('0xa4')]));if(!this['isConfigured'](_0x3b4c47[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3b4c47,_0x560a('0x16a'));}logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x158'),this[_0x560a('0x31')][_0x560a('0x34')],_0x3b4c47[_0x560a('0x157')]));var _0x1c94ad=this['getPause'][_0x560a('0x6d')](this,_0x3b4c47[_0x560a('0x16b')]);var _0x15d0be=this[_0x560a('0x4c')][_0x560a('0x6d')](this,_0x3b4c47[_0x560a('0x157')],_0x1c94ad);if(_0x15d0be){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')]['callerid'],_0x3b4c47[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')]['callerid'],_0x3b4c47[_0x560a('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x3b4c47['findBy']));this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')][_0x560a('0x34')],_0x3b4c47[_0x560a('0x157')]));return{'code':0xc8,'result':_0x560a('0x15b')};}};AGIVertices[_0x560a('0xb')]['playback']=function(_0x2aedee){logger[_0x560a('0x27')](util['format'](_0x560a('0x16c'),_0x2aedee[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x2aedee[_0x560a('0x110')])){return this['channel']['error'](_0x2aedee,'no\x20file\x20audio\x20selected');}var _0x1c9474=this['getSound']['sync'](this,_0x2aedee[_0x560a('0x110')]);if(!_0x1c9474){return this[_0x560a('0x31')][_0x560a('0x25')](_0x2aedee,_0x560a('0x112'));}var _0x5513c9=this['channel'][_0x560a('0xa6')](_0x560a('0x16d'),[_0x1c9474,_0x2aedee[_0x560a('0xe0')]]);if(_0x5513c9[_0x560a('0x9e')]===-0x1){return _0x5513c9;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x16d'),_0x1c9474));};AGIVertices[_0x560a('0xb')][_0x560a('0x16e')]=function(_0x3202b4){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3202b4[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x3202b4[_0x560a('0x16f')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3202b4,'no\x20queue\x20selected');}var _0x28cb5d='';var _0x2fb1d1=parseInt(_0x3202b4[_0x560a('0x16f')],0xa);if(isNaN(_0x2fb1d1)){_0x28cb5d=_0x3202b4['queue_id'];}else{_0x28cb5d=this[_0x560a('0x170')][_0x560a('0x6d')](this,_0x3202b4['queue_id']);if(!_0x28cb5d){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3202b4,'no\x20queue\x20found');}}var _0x27450d='';if(this['isConfigured'](_0x3202b4[_0x560a('0x110')])){var _0x303a0b=this[_0x560a('0x16')][_0x560a('0x6d')](this,_0x3202b4['file_id']);if(_0x303a0b){_0x27450d=_0x303a0b;}}this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x3202b4,_0x28cb5d);if(_0x3202b4[_0x560a('0xe0')][_0x560a('0x171')]('x')<0x0){_0x3202b4[_0x560a('0xe0')]+='x';}if(_0x3202b4[_0x560a('0xe0')][_0x560a('0x171')]('X')<0x0){_0x3202b4[_0x560a('0xe0')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x28cb5d?_0x28cb5d[_0x560a('0x172')]():'');var _0x29a508=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0x173'),[_0x28cb5d,_0x3202b4[_0x560a('0xe0')],_0x3202b4['url'],_0x27450d,_0x3202b4['timeout'],_0x3202b4[_0x560a('0xb1')],_0x3202b4[_0x560a('0x174')],_0x3202b4[_0x560a('0x175')],'',_0x3202b4[_0x560a('0x176')]]);if(_0x29a508['result']===-0x1){return _0x29a508;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x173'),_0x28cb5d));};AGIVertices[_0x560a('0xb')][_0x560a('0x177')]=function(_0x4d66b1){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x178'),_0x4d66b1[_0x560a('0xa4')]));var _0x581bf6=_0x4d66b1[_0x560a('0x179')]||_0x560a('0x14f');var _0x21fc8f=util[_0x560a('0x22')](_0x560a('0x17a'),this['channel'][_0x560a('0x32')],rs['generate'](0x5));var _0x33a914=util[_0x560a('0x22')](_0x560a('0x17b'),FILES_PATH,_0x21fc8f,_0x581bf6);var _0xe993c9=util[_0x560a('0x22')](_0x560a('0x131'),FILES_PATH,_0x21fc8f);this['createSquareRecording'][_0x560a('0x6d')](this,_0x4d66b1,_0x21fc8f,_0x33a914);this['channel'][_0x560a('0x99')]('RECORDING_SAVENAME',_0x21fc8f);logger['info'](_0x560a('0x17c'),_0xe993c9,_0x581bf6,_0x4d66b1[_0x560a('0x17d')],_0x4d66b1[_0x560a('0x62')]);return this['channel'][_0x560a('0x134')](_0xe993c9,_0x581bf6,_0x4d66b1['escape_digits'],_0x4d66b1[_0x560a('0x62')],undefined,!![]);};AGIVertices[_0x560a('0xb')][_0x560a('0x17e')]=function(_0x3b05e5){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x17f'),_0x3b05e5[_0x560a('0xa4')]));if(!this['isConfigured'](_0x3b05e5['url'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x180'));}var _0x12f93b=this[_0x560a('0x181')]['sync'](this,_0x3b05e5);logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x182'),util[_0x560a('0x183')](_0x12f93b,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x3b05e5[_0x560a('0xd3')])){return this['channel'][_0x560a('0xa7')](_0x560a('0x184'));}var _0x114baa=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x3b05e5[_0x560a('0xd3')]);if(!_0x114baa){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3b05e5,_0x560a('0x118'));}this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x185'),_0x114baa),_0x12f93b[_0x560a('0x72')]?_0x12f93b[_0x560a('0x72')]:_0x560a('0x186'));this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')]('%s_STATUS_MESSAGE',_0x114baa),_0x12f93b[_0x560a('0x73')]?_0x12f93b[_0x560a('0x73')]:'OK');if(_0x12f93b[_0x560a('0x66')]){try{this['saveRestApiResult'](_0x12f93b[_0x560a('0x66')],_0x114baa);}catch(_0x3c5ab0){logger[_0x560a('0x25')](util[_0x560a('0x22')](_0x560a('0x187'),_0x114baa));}}return this['channel']['noop'](util[_0x560a('0x22')](_0x560a('0xd9'),_0x114baa));};AGIVertices[_0x560a('0xb')][_0x560a('0x188')]=function(_0x4263df){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x189'),_0x4263df['label']));return this[_0x560a('0x31')][_0x560a('0x18a')](_0x4263df[_0x560a('0x18b')][_0x560a('0x54')](/\s+/g,''),_0x4263df[_0x560a('0x17d')]);};AGIVertices[_0x560a('0xb')][_0x560a('0x18c')]=function(_0x529b8d){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x529b8d['label']));return this[_0x560a('0x31')][_0x560a('0x18d')](_0x529b8d[_0x560a('0x61')]['replace'](/\s+/g,''),_0x529b8d['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x160f1f){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x18e'),_0x160f1f['label']));return this['channel'][_0x560a('0x18f')](_0x160f1f[_0x560a('0x58')],_0x160f1f[_0x560a('0x17d')]);};AGIVertices[_0x560a('0xb')]['sendMail']=function(_0x435bee){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x190'),_0x435bee['label']));if(!this['isConfigured'](_0x435bee[_0x560a('0x191')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x192'));}var _0x58719e=this['getMailAccount'][_0x560a('0x6d')](this,_0x435bee['account_id']);if(!_0x58719e||!_0x58719e['Smtp']){return this[_0x560a('0x31')]['error'](_0x435bee,'no\x20mail\x20account\x20found');}var _0x19db31={'from':util[_0x560a('0x22')](_0x560a('0x193'),_0x58719e[_0x560a('0xf')],_0x58719e[_0x560a('0x194')]||_0x58719e[_0x560a('0x195')][_0x560a('0x196')]),'to':_0x435bee['to']||'','cc':_0x435bee['cc']||'','bcc':_0x435bee['bcc']||'','subject':_0x435bee['subject'],'html':_0x435bee[_0x560a('0x58')],'text':_0x435bee[_0x560a('0x58')]};if(this['isConfigured'](_0x435bee['template_id'])){}logger[_0x560a('0x197')]('sendMail\x20message',JSON[_0x560a('0x70')](_0x19db31));this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x435bee,_0x435bee[_0x560a('0x191')]);this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x58719e[_0x560a('0xf')]));this[_0x560a('0x198')]['sync'](this,_0x58719e[_0x560a('0x199')],_0x19db31);return this[_0x560a('0x31')][_0x560a('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x560a('0xb')][_0x560a('0x19a')]=function(_0x37121a){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x19b'),_0x37121a[_0x560a('0xa4')]));return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x19c'));};AGIVertices[_0x560a('0xb')][_0x560a('0x19d')]=function(_0x32a15d){logger[_0x560a('0x27')](util['format'](_0x560a('0x19e'),_0x32a15d['label']));if(!this[_0x560a('0x82')](_0x32a15d[_0x560a('0x19f')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1a0'));}var _0x5d311a=this[_0x560a('0x2d')][_0x560a('0x6d')](this,_0x32a15d['sms_account_id']);if(!_0x5d311a){return this[_0x560a('0x31')]['error'](_0x32a15d,_0x560a('0x1a1'));}var _0x2c79c3={'body':_0x32a15d[_0x560a('0x1a2')],'phone':_0x32a15d['to']||'','SmsAccountId':_0x5d311a['id']};logger['debug'](_0x560a('0x1a3'),JSON['stringify'](_0x2c79c3));this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x32a15d,_0x32a15d[_0x560a('0x19f')]);this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1a4'),_0x5d311a[_0x560a('0xf')]));this[_0x560a('0x2f')]['sync'](this,_0x2c79c3);return this['channel']['noop'](_0x560a('0x1a5'));};AGIVertices[_0x560a('0xb')][_0x560a('0x1a6')]=function(_0x556382){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x1a7'),_0x556382[_0x560a('0xa4')]));if(!this['isConfigured'](_0x556382[_0x560a('0xd3')])){return this[_0x560a('0x31')]['error'](_0x556382,_0x560a('0x1a8'));}var _0x939b16=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x556382[_0x560a('0xd3')]);if(!_0x939b16){return this[_0x560a('0x31')][_0x560a('0x25')](_0x556382,_0x560a('0x118'));}return this[_0x560a('0x31')][_0x560a('0x99')](_0x939b16,_0x556382[_0x560a('0x1a9')]);};AGIVertices[_0x560a('0xb')][_0x560a('0x1aa')]=function(_0x18aa8a){logger['info'](util[_0x560a('0x22')]('Enter\x20in\x20START\x20(%s)\x20block',_0x18aa8a[_0x560a('0xa4')]));this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1ab'));if(_0x18aa8a[_0x560a('0xb4')]===_0x560a('0x1ac')){this[_0x560a('0x31')][_0x560a('0xa7')]('Answer');return this[_0x560a('0x31')][_0x560a('0xb4')]();}return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1ad'));};AGIVertices[_0x560a('0xb')][_0x560a('0x1ae')]=function(_0x1e918b){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x1af'),_0x1e918b['label']));if(!this[_0x560a('0x82')](_0x1e918b[_0x560a('0x1b0')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1e918b,_0x560a('0x1b1'));}var _0x590357=this['getSquareProject']['sync'](this,_0x1e918b[_0x560a('0x1b0')]);if(!this['isConfigured'](_0x590357)){return this[_0x560a('0x31')]['error'](_0x1e918b,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1e918b[_0x560a('0x1b0')]));}if(_0x590357===this['channel'][_0x560a('0x33')]){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1e918b,_0x560a('0x1b2'));}this['createSquareDetailsReport'][_0x560a('0x6d')](this,_0x1e918b,_0x590357);var _0x273a5a=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0x1b3'),util[_0x560a('0x22')](_0x560a('0x1b4'),config[_0x560a('0xb1')][_0x560a('0x1b5')]||_0x560a('0x1b6'),_0x590357,this[_0x560a('0x31')][_0x560a('0x33')]));if(_0x273a5a['result']===-0x1){return _0x273a5a;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x1b3'),_0x590357));};AGIVertices[_0x560a('0xb')][_0x560a('0x1b7')]=function(_0x570f99){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x1b8'),_0x570f99[_0x560a('0xa4')]));var _0x150358=this[_0x560a('0x1b9')]['sync'](this,_0x570f99[_0x560a('0xb3')]);this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x570f99,_0x570f99[_0x560a('0xb3')]);if(this['isConfigured'](_0x570f99[_0x560a('0xd3')])){var _0x1928d1=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x570f99[_0x560a('0xd3')]);if(_0x1928d1){this['channel'][_0x560a('0x99')](_0x1928d1,_0x150358);return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1ba'),_0x570f99[_0x560a('0xb3')],_0x1928d1));}}return this[_0x560a('0x31')][_0x560a('0xa7')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x570f99[_0x560a('0xb3')]));};AGIVertices[_0x560a('0xb')][_0x560a('0x1bb')]=function(_0x3f0db0){logger[_0x560a('0x27')](util['format'](_0x560a('0x1bc'),_0x3f0db0[_0x560a('0xa4')]));_0x3f0db0[_0x560a('0x58')]=_0x3f0db0[_0x560a('0x58')][_0x560a('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3f0db0[_0x560a('0x56')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1bd'));}if(!this[_0x560a('0x82')](_0x3f0db0[_0x560a('0x58')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1be'),_0x3f0db0['text']));var _0x173d99=this[_0x560a('0x55')][_0x560a('0x6d')](this,_0x3f0db0);if(_0x173d99){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1bf'),_0x173d99));var _0x3e9d2b=this[_0x560a('0x31')][_0x560a('0x124')](_0x173d99);try{fs[_0x560a('0x101')](_0x173d99+_0x560a('0x125'));}catch(_0x5f3a38){logger['error'](_0x5f3a38);}return _0x3e9d2b;}return this['channel']['error'](_0x3f0db0,_0x560a('0x1c0'));};AGIVertices[_0x560a('0xb')]['tts']=function(_0x272b52){logger['info'](util[_0x560a('0x22')](_0x560a('0x1c1'),_0x272b52[_0x560a('0xa4')]));_0x272b52[_0x560a('0x58')]=_0x272b52[_0x560a('0x58')][_0x560a('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x272b52[_0x560a('0x58')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')]['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x272b52[_0x560a('0x58')]));var _0x1fa111=this[_0x560a('0x5e')][_0x560a('0x6d')](this,_0x272b52);if(_0x1fa111){this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')]('Google\x20TTS\x20%s\x20file\x20created',_0x1fa111));var _0x16d232=this[_0x560a('0x31')]['streamFile'](_0x1fa111);try{fs[_0x560a('0x101')](_0x1fa111+'.wav');}catch(_0x26e07b){logger[_0x560a('0x25')](_0x26e07b);}return _0x16d232;}return this[_0x560a('0x31')][_0x560a('0x25')](_0x272b52,_0x560a('0x1c2'));};AGIVertices[_0x560a('0xb')][_0x560a('0x1c3')]=function(_0x446066){logger['info'](util[_0x560a('0x22')](_0x560a('0x1c4'),_0x446066[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x446066[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x446066,_0x560a('0x16a'));}logger['info'](util[_0x560a('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x560a('0x31')][_0x560a('0x34')],_0x446066['findBy']));var _0x2b66c1=this['agentUnpause'][_0x560a('0x6d')](this,_0x446066[_0x560a('0x157')]);if(_0x2b66c1){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')][_0x560a('0x34')],_0x446066[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x159'),this['channel'][_0x560a('0x34')],_0x446066['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x446066[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x446066['findBy']));return{'code':0xc8,'result':_0x560a('0x15b')};}};AGIVertices['prototype'][_0x560a('0x1c5')]=function(_0x411b22){logger['info'](util[_0x560a('0x22')](_0x560a('0x1c6'),_0x411b22[_0x560a('0xa4')]));var _0x162524=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0x1c7'),[_0x411b22['mailbox'],_0x411b22[_0x560a('0x75')]]);if(_0x162524[_0x560a('0x9e')]===-0x1){return _0x162524;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x1c7'),_0x411b22[_0x560a('0x1c8')]));};AGIVertices[_0x560a('0xb')][_0x560a('0x1c9')]=function(_0x13d783){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x13d783['label']));if(!this[_0x560a('0x82')](_0x13d783[_0x560a('0xd3')])){return this['channel'][_0x560a('0x25')](_0x13d783,_0x560a('0x1a8'));}var _0x366e92=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x13d783[_0x560a('0xd3')]);if(!_0x366e92){return this[_0x560a('0x31')]['error'](_0x13d783,_0x560a('0x118'));}var _0x2f2d9a=this[_0x560a('0x31')][_0x560a('0xc')](_0x366e92);return{'code':0xc8,'result':_0x2f2d9a['extra']?_0x2f2d9a[_0x560a('0x9c')]:'-'};};String[_0x560a('0xb')][_0x560a('0x9b')]=function(_0x1b6091,_0x3136d0){return this[_0x560a('0x9a')](_0x1b6091)[_0x560a('0x1ca')](_0x3136d0);};module[_0x560a('0x1cb')]=AGIVertices; \ No newline at end of file +var _0x13f6=['MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','createSquareMessage','speech','out','dialogflow','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','response','test','mindigit','no\x20variable\x20found','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','recordFile','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','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','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','getsecretdigits','rpc','mailRpc','prototype','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','arg_1','file','createCmContact','isEmpty','isNil','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','toUpperCase','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','body','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','includes','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured'];(function(_0x553ae0,_0x1ef5e4){var _0x41ade2=function(_0x111291){while(--_0x111291){_0x553ae0['push'](_0x553ae0['shift']());}};_0x41ade2(++_0x1ef5e4);}(_0x13f6,0x124));var _0x613f=function(_0xe22db5,_0x52829d){_0xe22db5=_0xe22db5-0x0;var _0x1f56cc=_0x13f6[_0xe22db5];return _0x1f56cc;};'use strict';var fs=require('fs');var util=require(_0x613f('0x0'));var _=require(_0x613f('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var Mustache=require(_0x613f('0x4'));var rp=require('request-promise');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var shared=require('../../config/environment/shared');var scripts=require(_0x613f('0x8'));var FILES_PATH=_0x613f('0x9');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=['menu','getdigits',_0x613f('0xa')];var AGIVertices=function(_0x1e6ca2,_0x363736,_0x35b672){this['channel']=_0x1e6ca2;this[_0x613f('0xb')]=_0x363736;this[_0x613f('0xc')]=_0x35b672;};AGIVertices[_0x613f('0xd')]['getVariable']=function(_0x2622f3,_0x164edf){this[_0x613f('0xb')]['getVariableById'](_0x2622f3)[_0x613f('0xe')](function(_0xa81fcd){_0x164edf(null,_0xa81fcd?_0xa81fcd['name']:![]);})['catch'](function(_0x517f57){_0x164edf(_0x517f57);});};AGIVertices[_0x613f('0xd')][_0x613f('0xf')]=function(_0x3832d8,_0x375db1){this[_0x613f('0xb')][_0x613f('0x10')](_0x3832d8)[_0x613f('0xe')](function(_0x291268){_0x375db1(null,_0x291268?_0x291268[_0x613f('0x11')]:![]);})[_0x613f('0x12')](function(_0x548218){_0x375db1(_0x548218);});};AGIVertices[_0x613f('0xd')]['getSquareProject']=function(_0x5c769c,_0x1bc605){this[_0x613f('0xb')]['getSquareProjectById'](_0x5c769c)[_0x613f('0xe')](function(_0x4f9dae){_0x1bc605(null,_0x4f9dae?_0x4f9dae[_0x613f('0x11')]:![]);})[_0x613f('0x12')](function(_0x431266){_0x1bc605(_0x431266);});};AGIVertices[_0x613f('0xd')][_0x613f('0x13')]=function(_0x1ba35f,_0x4e412c){this['rpc'][_0x613f('0x14')](_0x1ba35f)['then'](function(_0x48493c){_0x4e412c(null,_0x48493c?_0x48493c[_0x613f('0x15')]:![]);})[_0x613f('0x12')](function(_0x4f5a5a){_0x4e412c(_0x4f5a5a);});};AGIVertices[_0x613f('0xd')][_0x613f('0x16')]=function(_0x2aa14b,_0x48b28a){this['rpc'][_0x613f('0x17')](_0x2aa14b)[_0x613f('0xe')](function(_0x2acfcf){_0x48b28a(null,_0x2acfcf?_0x2acfcf['name']:![]);})[_0x613f('0x12')](function(_0x33e0c6){_0x48b28a(_0x33e0c6);});};AGIVertices[_0x613f('0xd')][_0x613f('0x18')]=function(_0x3013a1,_0x4e3d5a){this[_0x613f('0xb')][_0x613f('0x19')](_0x3013a1)['then'](function(_0x22035f){_0x4e3d5a(null,_0x22035f?_0x22035f[_0x613f('0x11')]:![]);})[_0x613f('0x12')](function(_0x4a878d){_0x4e3d5a(_0x4a878d);});};AGIVertices['prototype']['getSound']=function(_0x379920,_0x594c28){var _0x412269=this;this[_0x613f('0xb')]['getSoundById'](_0x379920)[_0x613f('0xe')](function(_0x2551c1){_0x594c28(null,_0x2551c1?_0x412269['getSoundPath'](_0x2551c1['save_name']):![]);})['catch'](function(_0x24be7c){_0x594c28(_0x24be7c);});};AGIVertices[_0x613f('0xd')][_0x613f('0x1a')]=function(_0x47f4af,_0x23eda8){this[_0x613f('0xb')][_0x613f('0x1b')](_0x47f4af)[_0x613f('0xe')](function(_0x4f8500){_0x23eda8(null,_0x4f8500?_0x4f8500:![]);})[_0x613f('0x12')](function(_0x5b2a1f){_0x23eda8(_0x5b2a1f);});};AGIVertices[_0x613f('0xd')][_0x613f('0x1c')]=function(_0x10fa2b,_0x1664f1,_0x5d7e9a){this[_0x613f('0xc')][_0x613f('0x1c')](_0x10fa2b,_0x1664f1)[_0x613f('0xe')](function(){_0x5d7e9a(null);})['catch'](function(_0x21a1d1){_0x5d7e9a(_0x21a1d1);});};AGIVertices['prototype'][_0x613f('0x1d')]=function(_0x11e7c2,_0xc8976c){this[_0x613f('0xb')][_0x613f('0x1e')](_0x11e7c2)[_0x613f('0xe')](function(_0x589157){if(_0x589157){if(_0x589157[_0x613f('0x1f')]){_0xc8976c(null,[_0x589157[_0x613f('0x20')]]);}else{_0xc8976c(null,_[_0x613f('0x21')](_0x589157[_0x613f('0x22')],_0x613f('0x20')));}}else{_0xc8976c(null,![]);}})['catch'](function(_0x59236e){_0xc8976c(_0x59236e);});};AGIVertices['prototype'][_0x613f('0x23')]=function(_0x72c804){return util[_0x613f('0x24')](_0x613f('0x25'),FILES_PATH,_0x72c804);};AGIVertices['prototype'][_0x613f('0x26')]=function(_0xaedbbd,_0x4ed25f,_0x45e6df){odbc['open'](_0xaedbbd,function(_0x310016){if(_0x310016){logger['error'](_0x613f('0x27'),_0x310016);_0x45e6df(_0x310016);}else{logger['info'](_0x613f('0x28'));odbc[_0x613f('0x29')](_0x4ed25f,function(_0x46842f,_0x511bb7){if(_0x46842f){logger[_0x613f('0x2a')](_0x613f('0x2b'),_0x4ed25f);_0x45e6df(_0x46842f);}else{logger[_0x613f('0x2a')](_0x613f('0x2c'),_0x4ed25f);odbc[_0x613f('0x2d')](function(_0x19708b){if(_0x19708b){logger[_0x613f('0x2e')](_0x613f('0x2f'),_0x19708b);}_0x45e6df(null,_0x511bb7);});}});}});};AGIVertices[_0x613f('0xd')][_0x613f('0x30')]=function(_0x4da8d3,_0x28b1bc){this[_0x613f('0xb')][_0x613f('0x31')](_0x4da8d3)[_0x613f('0xe')](function(_0x301d33){_0x28b1bc(null,_0x301d33?_0x301d33:![]);})[_0x613f('0x12')](function(_0xa76fff){_0x28b1bc(_0xa76fff);});};AGIVertices['prototype'][_0x613f('0x32')]=function(_0x696f16,_0x3b88d7){this[_0x613f('0xb')][_0x613f('0x32')](_0x696f16)[_0x613f('0xe')](function(_0x1040ba){_0x3b88d7(null,_0x1040ba);})['catch'](function(_0x343a59){_0x3b88d7(_0x343a59);});};AGIVertices[_0x613f('0xd')][_0x613f('0x33')]=function(_0x2f584e,_0x3952c9,_0x1c63ec){this[_0x613f('0xb')][_0x613f('0x33')]({'uniqueid':this[_0x613f('0x34')][_0x613f('0x35')],'node':_0x2f584e[_0x613f('0x36')],'application':_0x2f584e[_0x613f('0x37')],'data':_0x3952c9||null,'project_name':this[_0x613f('0x34')]['arg_1'],'callerid':this[_0x613f('0x34')][_0x613f('0x38')]})[_0x613f('0xe')](function(_0x4968dc){if(_0x1c63ec){_0x1c63ec(null,_0x4968dc);}})['catch'](function(_0x152a3c){if(_0x1c63ec){_0x1c63ec(_0x152a3c);}});};AGIVertices[_0x613f('0xd')][_0x613f('0x39')]=function(_0x16b288,_0xdaec43,_0x12c36f,_0x2d1a89){this[_0x613f('0xb')][_0x613f('0x39')]({'uniqueid':this[_0x613f('0x34')]['uniqueid'],'callerid':this['channel'][_0x613f('0x38')],'calleridname':this[_0x613f('0x34')]['calleridname'],'context':this[_0x613f('0x34')][_0x613f('0x3a')],'extension':this[_0x613f('0x34')][_0x613f('0x3b')],'priority':this[_0x613f('0x34')][_0x613f('0x3c')],'accountcode':this[_0x613f('0x34')][_0x613f('0x3d')],'dnid':this[_0x613f('0x34')][_0x613f('0x3e')],'projectName':this[_0x613f('0x34')][_0x613f('0x3f')],'saveName':_0xdaec43,'filename':_0x16b288[_0x613f('0x40')]||_0xdaec43,'savePath':_0x12c36f})[_0x613f('0xe')](function(_0x1fd46c){_0x2d1a89(null,_0x1fd46c);})[_0x613f('0x12')](function(_0x3adc7c){_0x2d1a89(_0x3adc7c);});};AGIVertices[_0x613f('0xd')]['createSquareMessage']=function(_0x47c84b,_0x114645,_0x69ea16,_0x5f0f73,_0x48d29a){this[_0x613f('0xb')]['createSquareMessage']({'uniqueid':this['channel'][_0x613f('0x35')],'body':_0x47c84b,'direction':_0x114645,'providerName':_0x69ea16,'providerResponse':_0x5f0f73})[_0x613f('0xe')](function(_0x26ba69){if(_0x48d29a){_0x48d29a(null,_0x26ba69);}})['catch'](function(_0x1e3298){if(_0x48d29a){_0x48d29a(_0x1e3298);}});};AGIVertices[_0x613f('0xd')]['createCmContact']=function(_0x55e878,_0x1c0c8e){this[_0x613f('0xb')][_0x613f('0x41')]({'firstName':_[_0x613f('0x42')](_0x55e878[_0x613f('0x11')])||_[_0x613f('0x43')](_0x55e878[_0x613f('0x11')])?'callback_'+Math['random']():_0x55e878[_0x613f('0x11')],'lastName':_['isEmpty'](_0x55e878['lastName'])||_[_0x613f('0x43')](_0x55e878[_0x613f('0x44')])?null:_0x55e878[_0x613f('0x44')],'phone':_0x55e878['phone'],'ListId':_0x55e878[_0x613f('0x45')],'scheduledat':_0x55e878[_0x613f('0x46')],'callbackUniqueid':this[_0x613f('0x34')][_0x613f('0x35')],'tags':_0x613f('0x47'),'description':_0x613f('0x48')+_0x55e878[_0x613f('0x46')]['toString'](),'priority':_0x55e878[_0x613f('0x49')]})['then'](function(_0x3ce3dd){_0x1c0c8e(null,_0x3ce3dd);})[_0x613f('0x12')](function(_0x33bbde){_0x1c0c8e(_0x33bbde);});};AGIVertices[_0x613f('0xd')][_0x613f('0x4a')]=function(_0x1df0c8,_0x2161f6){this[_0x613f('0xb')][_0x613f('0x4b')](_0x1df0c8)[_0x613f('0xe')](function(_0x2ebce1){_0x2161f6(null,_0x2ebce1?_0x2ebce1[_0x613f('0x11')]:![]);})[_0x613f('0x12')](function(_0x54ad8f){_0x2161f6(_0x54ad8f);});};AGIVertices['prototype'][_0x613f('0x4c')]=function(_0x4b6eb3,_0xcb1c9d,_0x3c3cd7){var _0x42a72b={'role':_0x613f('0x4d')};_0x42a72b[_0x4b6eb3]=this[_0x613f('0x34')][_0x613f('0x38')];this[_0x613f('0xb')][_0x613f('0x4c')](_0x42a72b,_0xcb1c9d,this[_0x613f('0x34')][_0x613f('0x35')])[_0x613f('0xe')](function(_0x588bba){_0x3c3cd7(null,_[_0x613f('0x43')](_0x588bba)?![]:!![]);})[_0x613f('0x12')](function(_0x2688cd){logger[_0x613f('0x2e')](_0x2688cd);_0x3c3cd7(null,![]);});};AGIVertices['prototype'][_0x613f('0x4e')]=function(_0xe28447,_0x4babc6){var _0x49ab25={'role':_0x613f('0x4d')};_0x49ab25[_0xe28447]=this['channel']['callerid'];this['rpc'][_0x613f('0x4e')](_0x49ab25)['then'](function(_0x49854b){_0x4babc6(null,_['isNil'](_0x49854b)?![]:!![]);})[_0x613f('0x12')](function(_0xbf0903){logger['error'](_0xbf0903);_0x4babc6(null,![]);});};AGIVertices[_0x613f('0xd')][_0x613f('0x4f')]=function(_0x8ba26d,_0x2a7ca7){var _0x5b8712={'role':_0x613f('0x4d')};_0x5b8712[_0x8ba26d]=this[_0x613f('0x34')]['callerid'];this[_0x613f('0xb')][_0x613f('0x4f')](_0x5b8712)[_0x613f('0xe')](function(_0x24bff9){_0x2a7ca7(null,_[_0x613f('0x43')](_0x24bff9)?![]:!![]);})[_0x613f('0x12')](function(_0xbead7c){logger[_0x613f('0x2e')](_0xbead7c);_0x2a7ca7(null,![]);});};AGIVertices[_0x613f('0xd')][_0x613f('0x50')]=function(_0x14f418,_0x2e5c06){var _0x50d7ca={'role':_0x613f('0x4d')};_0x50d7ca[_0x14f418]=this[_0x613f('0x34')][_0x613f('0x38')];var _0x36c3af=_0x14f418!=_0x613f('0x51')?util[_0x613f('0x24')]('%s/%s@from-sip/n',_0x613f('0x52'),this[_0x613f('0x34')][_0x613f('0x38')]):undefined;this[_0x613f('0xb')][_0x613f('0x50')](_0x50d7ca,_0x36c3af)[_0x613f('0xe')](function(_0x4ec334){_0x2e5c06(null,_['isNil'](_0x4ec334)?![]:!![]);})[_0x613f('0x12')](function(_0x25a550){logger[_0x613f('0x2e')](_0x25a550);_0x2e5c06(null,![]);});};AGIVertices[_0x613f('0xd')]['shellCommand']=function(_0x11d2f4,_0x29e5c8){sh[_0x613f('0x53')](_[_0x613f('0x54')](_0x11d2f4),function(_0x5af9c6,_0x282a9f){var _0x28005b=_0x282a9f[_0x613f('0x55')](/(\r\n|\n|\r)/gm,'');_0x29e5c8(null,_0x28005b);});};AGIVertices[_0x613f('0xd')][_0x613f('0x56')]=function(_0x45e933,_0x2892f4){scripts[_0x613f('0x56')](_0x45e933['apiKey'],_0x45e933[_0x613f('0x57')]||_0x613f('0x58'),_0x45e933[_0x613f('0x58')],_0x45e933[_0x613f('0x59')]||_0x613f('0x5a'),_0x45e933[_0x613f('0x5b')]||_0x613f('0x5c'),_0x45e933[_0x613f('0x5d')]||_0x613f('0x5e'))[_0x613f('0xe')](function(_0x4c4710){_0x2892f4(null,_0x4c4710);})[_0x613f('0x12')](function(_0x285424){_0x2892f4(_0x285424);});};AGIVertices[_0x613f('0xd')][_0x613f('0x5f')]=function(_0x3838cf,_0x418f53){scripts[_0x613f('0x5f')](_0x3838cf[_0x613f('0x58')],_0x3838cf[_0x613f('0x60')]||'en',0x1)[_0x613f('0xe')](function(_0x278fac){_0x418f53(null,_0x278fac);})['catch'](function(_0xb36b52){_0x418f53(_0xb36b52);});};AGIVertices[_0x613f('0xd')][_0x613f('0x61')]=function(_0x907273,_0x205957){var _0x2de316={'uri':_0x907273[_0x613f('0x62')],'method':_0x907273[_0x613f('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x907273[_0x613f('0x64')])===_0x613f('0x65')&&parseInt(_0x907273[_0x613f('0x64')])>=0x1?parseInt(_0x907273[_0x613f('0x64')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x613f('0x66'),_0x613f('0x67')],_0x2de316['method'][_0x613f('0x68')]())){try{_0x2de316['body']=_0x907273[_0x613f('0x69')]?JSON['parse'](_0x907273['rawBody']):{};}catch(_0x2587ad){logger[_0x613f('0x2e')](_0x613f('0x6a'),_0x2587ad);}}try{_0x2de316[_0x613f('0x6b')]=_0x907273[_0x613f('0x6c')]?JSON[_0x613f('0x6d')](_0x907273[_0x613f('0x6c')]):{};}catch(_0x5be071){logger[_0x613f('0x2e')](_0x613f('0x6e'),_0x5be071);}if(_0x907273[_0x613f('0x6f')]){try{var _0x2bc172=require(_0x907273[_0x613f('0x6f')])['sync'](this,_0x2de316);_0x2de316[_0x613f('0x70')]=Mustache[_0x613f('0x71')](_0x907273['url'],_0x2bc172,{},['$$','$$']);if(_0x2de316[_0x613f('0x6b')]){_0x2de316[_0x613f('0x6b')]=JSON[_0x613f('0x6d')](Mustache['render'](JSON['stringify'](_0x2de316['headers']),_0x2bc172,{},['$$','$$']));}if(_0x2de316[_0x613f('0x72')]){_0x2de316[_0x613f('0x72')]=JSON['parse'](Mustache[_0x613f('0x71')](JSON[_0x613f('0x73')](_0x2de316[_0x613f('0x72')]),_0x2bc172,{},['$$','$$']));}}catch(_0x59e0e1){logger[_0x613f('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x59e0e1);}}rp(_0x2de316)[_0x613f('0xe')](function(_0x537763){var _0x4953e3={'statusCode':_0x537763[_0x613f('0x74')]||0xc8,'statusMessage':_0x537763[_0x613f('0x75')]||'OK','headers':_0x537763[_0x613f('0x6b')]||{},'body':_0x537763[_0x613f('0x72')]||{}};_0x205957(null,_0x4953e3);})[_0x613f('0x12')](function(_0x42a59b){var _0x107126={'statusCode':_0x42a59b[_0x613f('0x74')]||0x1f4,'statusMessage':_0x42a59b[_0x613f('0x76')]||_0x613f('0x77'),'headers':_0x42a59b[_0x613f('0x78')]['headers']||{},'body':_0x42a59b[_0x613f('0x78')][_0x613f('0x72')]||{}};_0x205957(null,_0x107126);});};AGIVertices[_0x613f('0xd')][_0x613f('0x79')]=function(_0x399491,_0x2b3220){scripts[_0x613f('0x79')](this['channel'][_0x613f('0x35')],_0x399491[_0x613f('0x7a')],_0x399491[_0x613f('0x58')],_0x399491[_0x613f('0x7b')]||'en')['then'](function(_0x102e35){_0x2b3220(null,_0x102e35);})[_0x613f('0x12')](function(_0x14c426){_0x2b3220(_0x14c426);});};AGIVertices[_0x613f('0xd')][_0x613f('0x7c')]=function(_0x2fb442,_0x5d3a30){scripts[_0x613f('0x7c')](this[_0x613f('0x34')]['uniqueid'],_0x2fb442[_0x613f('0x7d')],_0x2fb442[_0x613f('0x7e')],_0x2fb442[_0x613f('0x7f')],_0x2fb442[_0x613f('0x58')],_0x2fb442[_0x613f('0x80')]||'en')['then'](function(_0x275e85){_0x5d3a30(null,_0x275e85);})[_0x613f('0x12')](function(_0x443c3d){_0x5d3a30(_0x443c3d);});};AGIVertices[_0x613f('0xd')][_0x613f('0x81')]=function(_0x1f9c40,_0x52ad92){scripts['sestekNDA'](this[_0x613f('0x34')],_0x1f9c40)[_0x613f('0xe')](function(_0x2e7533){_0x52ad92(null,_0x2e7533);})['catch'](function(_0x3fa7aa){_0x52ad92(_0x3fa7aa);});};AGIVertices[_0x613f('0xd')][_0x613f('0x82')]=function(_0x3f93dc,_0x5bf46e){scripts[_0x613f('0x82')](_0x3f93dc[_0x613f('0x7a')],_0x3f93dc['text'],_0x3f93dc['ispeech_tts_language']||'en-US',_0x3f93dc[_0x613f('0x83')])['then'](function(_0x2dc994){_0x5bf46e(null,_0x2dc994);})[_0x613f('0x12')](function(_0x2be5a8){_0x5bf46e(_0x2be5a8);});};AGIVertices[_0x613f('0xd')]['ispeechASR']=function(_0x205b4f,_0x344ad7,_0x8d820f){scripts[_0x613f('0x84')](_0x344ad7,_0x205b4f[_0x613f('0x7a')],_0x205b4f[_0x613f('0x85')]||_0x613f('0x5a'),this['isConfigured'](_0x205b4f[_0x613f('0x86')])?_0x205b4f[_0x613f('0x86')]:undefined)[_0x613f('0xe')](function(_0x58c8f3){_0x8d820f(null,_0x58c8f3);})[_0x613f('0x12')](function(_0x446cf6){_0x8d820f(_0x446cf6);});};AGIVertices[_0x613f('0xd')]['awsPolly']=function(_0x3a4eca,_0xe74780){scripts[_0x613f('0x87')](_0x3a4eca[_0x613f('0x88')],_0x3a4eca[_0x613f('0x89')],_0x3a4eca[_0x613f('0x8a')],_0x3a4eca[_0x613f('0x8b')]||_0x613f('0x8c'),_0x3a4eca['text'],_0x3a4eca['aws_text_type']||_0x613f('0x58'))[_0x613f('0xe')](function(_0x27b2f1){_0xe74780(null,_0x27b2f1);})[_0x613f('0x12')](function(_0x13acaa){_0xe74780(_0x13acaa);});};AGIVertices['prototype'][_0x613f('0x8d')]=function(_0x4e560f,_0x1f72e7){scripts[_0x613f('0x8d')](this[_0x613f('0x34')][_0x613f('0x35')],_0x4e560f['aws_access_key_id'],_0x4e560f[_0x613f('0x89')],_0x4e560f[_0x613f('0x8e')],_0x4e560f['text'],_0x4e560f[_0x613f('0x8f')])['then'](function(_0x199494){_0x1f72e7(null,_0x199494);})[_0x613f('0x12')](function(_0x443f07){_0x1f72e7(_0x443f07);});};AGIVertices[_0x613f('0xd')][_0x613f('0x90')]=function(_0x5ac9d2,_0x3f11b3,_0xef032b){scripts['googleASR'](_0x3f11b3,_0x5ac9d2[_0x613f('0x7a')],_0x5ac9d2['google_asr_language']||_0x613f('0x5a'))[_0x613f('0xe')](function(_0x24c189){_0xef032b(null,_0x24c189);})[_0x613f('0x12')](function(_0x385d2a){_0xef032b(_0x385d2a);});};AGIVertices[_0x613f('0xd')][_0x613f('0x91')]=function(_0x5ef935,_0x46430f,_0x3aabf7){scripts[_0x613f('0x91')](_0x46430f,_0x5ef935[_0x613f('0x92')],_0x5ef935[_0x613f('0x93')],_0x5ef935[_0x613f('0x70')])[_0x613f('0xe')](function(_0x50d7ce){_0x3aabf7(null,_0x50d7ce);})[_0x613f('0x12')](function(_0xf41f3b){_0x3aabf7(_0xf41f3b);});};AGIVertices['prototype'][_0x613f('0x94')]=function(_0x280a4c){var _0x550975=_[_0x613f('0x95')](verticesWithRetry,_0x280a4c[_0x613f('0x37')])?_0x280a4c:_['clone'](_0x280a4c);for(var _0x28f494 in _0x550975){if(_0x550975[_0x613f('0x96')](_0x28f494)){if(_0x550975[_0x28f494]&&_[_0x613f('0x97')](_0x550975[_0x28f494])){if(_[_0x613f('0x95')](recursiveMapAttributes,_0x28f494)){_0x550975[_0x28f494]=this[_0x613f('0x98')](_0x550975[_0x28f494]);}else{_0x550975[_0x28f494]=this[_0x613f('0x99')](_0x550975[_0x28f494]);}}}}return _0x550975;};AGIVertices[_0x613f('0xd')][_0x613f('0x9a')]=function(_0x442bb8){for(var _0x1f21be in _0x442bb8){if(_0x442bb8[_0x613f('0x96')](_0x1f21be)){if(_[_0x613f('0x9b')](_0x442bb8[_0x1f21be])){this[_0x613f('0x9a')](_0x442bb8[_0x1f21be]);}else if(_[_0x613f('0x9c')](_0x442bb8[_0x1f21be])){for(var _0x6110c0=0x0;_0x6110c0<_0x442bb8[_0x1f21be][_0x613f('0x9d')];_0x6110c0++){this[_0x613f('0x9a')](_0x442bb8[_0x1f21be][_0x6110c0]);}}else if(_[_0x613f('0x97')](_0x442bb8[_0x1f21be])){_0x442bb8[_0x1f21be]=this[_0x613f('0x99')](_0x442bb8[_0x1f21be]);}}}};AGIVertices[_0x613f('0xd')]['saveRestApiResult']=function(_0x318874,_0x5d558e){for(var _0xf56397 in _0x318874){if(_0x318874[_0x613f('0x96')](_0xf56397)){if(_['isPlainObject'](_0x318874[_0xf56397])){if(!_[_0x613f('0x42')](_0x318874[_0xf56397])){this[_0x613f('0x9e')](_0x318874[_0xf56397],util[_0x613f('0x24')](_0x613f('0x9f'),_0x5d558e,_0xf56397));}}else if(_[_0x613f('0x9c')](_0x318874[_0xf56397])){for(var _0x442fca=0x0;_0x442fca<_0x318874[_0xf56397]['length'];_0x442fca++){this[_0x613f('0x9e')](_0x318874[_0xf56397][_0x442fca],util[_0x613f('0x24')]('%s.%s',_0x5d558e,_0xf56397+'['+_0x442fca+']'));}}else{if(!_[_0x613f('0x43')](_0x318874[_0xf56397])){this[_0x613f('0x34')][_0x613f('0xa0')](util[_0x613f('0x24')](_0x613f('0x9f'),_0x5d558e,_0xf56397),_0x318874[_0xf56397]);}}}}};AGIVertices[_0x613f('0xd')]['replaceObjectAllVariables']=function(_0xa5e108){try{var _0x456f89=JSON[_0x613f('0x6d')](_0xa5e108);this[_0x613f('0x9a')](_0x456f89);return JSON[_0x613f('0x73')](_0x456f89);}catch(_0x210674){return this[_0x613f('0x99')](_0xa5e108);}};AGIVertices[_0x613f('0xd')]['replaceAllVariables']=function(_0x3793f4){var _0x5aab24=_0x3793f4['split']('{');for(var _0x1ea4ba=0x1;_0x1ea4ba<_0x5aab24[_0x613f('0x9d')];_0x1ea4ba+=0x1){var _0x4a98af=_0x5aab24[_0x1ea4ba][_0x613f('0xa1')]('}');if(_0x4a98af[_0x613f('0x9d')]>0x1){_0x3793f4=_0x3793f4[_0x613f('0xa2')]('{'+_0x4a98af[0x0]+'}',this[_0x613f('0x34')][_0x613f('0xa3')](_0x4a98af[0x0])[_0x613f('0xa4')]||_0x4a98af[0x0]);}}if(_0x5aab24[_0x613f('0x9d')]===0x1){return _0x3793f4[_0x613f('0xa5')]();}return this[_0x613f('0x99')](_0x3793f4);};AGIVertices['prototype'][_0x613f('0xa6')]=function(_0x5cb8c5,_0x42be0a){var _0x36fb8a=this['channel'][_0x613f('0xa3')](_0x5cb8c5);if(_0x36fb8a['result']===-0x1){return _0x36fb8a;}logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xa7'),_0x42be0a,_0x36fb8a['extra']));return this[_0x613f('0x34')][_0x613f('0xa0')](_0x42be0a,_0x36fb8a[_0x613f('0xa4')]);};AGIVertices[_0x613f('0xd')][_0x613f('0xa8')]=function(_0x459450){return _0x459450&&_0x459450!=='0'&&_0x459450!=='-1'&&_0x459450!=='';};AGIVertices[_0x613f('0xd')][_0x613f('0xa9')]=function(_0x20641d){this['createSquareDetailsReport'][_0x613f('0xaa')](this,_0x20641d,'-');_0x20641d[_0x613f('0xab')]=_0x20641d[_0x613f('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x613f('0xac')]=function(_0x22eedd){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xad'),_0x22eedd[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x22eedd[_0x613f('0x58')])){return this['channel'][_0x613f('0xae')](_0x613f('0xaf'));}var _0x5ba82d='\x22'+_0x22eedd[_0x613f('0x58')]+'\x22';if(this[_0x613f('0xa8')](_0x22eedd[_0x613f('0x78')])){_0x5ba82d+=','+_0x22eedd[_0x613f('0x78')];}var _0x23e393=this['channel']['exec'](_0x613f('0xb0'),_0x5ba82d);if(_0x23e393[_0x613f('0xb1')]===-0x1){return _0x23e393;}return this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')](_0x613f('0xb2'),_0x5ba82d));};AGIVertices[_0x613f('0xd')]['mrcprecog']=function(_0x3571fc){logger['info'](util['format'](_0x613f('0xb3'),_0x3571fc[_0x613f('0x36')]));if(!this['isConfigured'](_0x3571fc[_0x613f('0xb4')])){return this[_0x613f('0x34')]['noop'](_0x613f('0xb5'));}var _0x262b83=_0x3571fc[_0x613f('0xb4')];if(this[_0x613f('0xa8')](_0x3571fc[_0x613f('0x78')])){_0x262b83+=','+_0x3571fc['options'];}var _0x4c5378=this[_0x613f('0x34')]['exec'](_0x613f('0xb6'),_0x262b83);if(_0x4c5378['result']===-0x1){return _0x4c5378;}var _0x41cbd4=this['getAndSetVariable'](_0x613f('0xb7'),'MRCP_RECOG_CONFIDENCE');if(_0x41cbd4['result']===-0x1){return _0x41cbd4;}var _0x115697=this[_0x613f('0xa6')]('RECOG_INPUT()',_0x613f('0xb8'));if(_0x115697['result']===-0x1){return _0x115697;}var _0x591a02=this['getAndSetVariable'](_0x613f('0xb9'),_0x613f('0xba'));if(_0x591a02[_0x613f('0xb1')]===-0x1){return _0x591a02;}return this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xbb'),_0x262b83));};AGIVertices['prototype'][_0x613f('0x6')]=function(_0x26b700){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xbc'),_0x26b700[_0x613f('0x36')]));return this[_0x613f('0x34')]['agi']([_0x26b700[_0x613f('0xbd')],_0x26b700[_0x613f('0xbe')]]);};AGIVertices[_0x613f('0xd')]['answer']=function(_0xc10a6c){logger[_0x613f('0x2a')](util[_0x613f('0x24')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xc10a6c[_0x613f('0x36')]));if(this[_0x613f('0xa8')](_0xc10a6c[_0x613f('0x64')])){logger['info'](util[_0x613f('0x24')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xc10a6c[_0x613f('0x64')]));var _0x172a31=this[_0x613f('0x34')][_0x613f('0xbf')](_0xc10a6c[_0x613f('0x64')]);if(_0x172a31[_0x613f('0xb1')]===-0x1){return _0x172a31;}}return this[_0x613f('0x34')]['answer']();};AGIVertices['prototype']['callback']=function(_0x38fcb2){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xc0'),_0x38fcb2['label']));if(!this['isConfigured'](_0x38fcb2[_0x613f('0x45')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x38fcb2,_0x613f('0xc1'));}_0x38fcb2[_0x613f('0x46')]=moment();if(this['isConfigured'](_0x38fcb2['delay'])){_0x38fcb2[_0x613f('0x46')]=moment()[_0x613f('0xc2')](_0x38fcb2[_0x613f('0xc3')],_0x613f('0xc4'));}if(!this[_0x613f('0xa8')](_0x38fcb2['callback_priority'])){_0x38fcb2[_0x613f('0x49')]=0x2;}this[_0x613f('0x41')][_0x613f('0xaa')](this,_0x38fcb2);return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xc5'),_0x38fcb2[_0x613f('0xc6')],_0x38fcb2[_0x613f('0x45')],_0x38fcb2[_0x613f('0x46')]));};AGIVertices[_0x613f('0xd')][_0x613f('0xc7')]=function(_0x19b90c){logger['info'](util[_0x613f('0x24')](_0x613f('0xc8'),_0x19b90c[_0x613f('0x36')]));var _0x29ae7a=this['channel'][_0x613f('0x53')](_0x19b90c[_0x613f('0xc9')],_0x19b90c['options']);if(_0x29ae7a[_0x613f('0xb1')]===-0x1){return _0x29ae7a;}return this['channel'][_0x613f('0xae')](util[_0x613f('0x24')]('Executed\x20command\x20%s\x20%s',_0x19b90c['application'],_0x19b90c[_0x613f('0x78')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x207687){logger[_0x613f('0x2a')](util['format'](_0x613f('0xca'),_0x207687['label']));if(!this[_0x613f('0xa8')](_0x207687['text'])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xaf'));}var _0xff6615='\x22'+_0x207687['text']+'\x22';if(this[_0x613f('0xa8')](_0x207687[_0x613f('0x78')])){_0xff6615+=','+_0x207687[_0x613f('0x78')];}var _0x47ef95=this['channel']['exec'](_0x613f('0xb0'),_0xff6615);if(_0x47ef95['result']===-0x1){return _0x47ef95;}return this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')](_0x613f('0xb2'),_0xff6615));};AGIVertices[_0x613f('0xd')][_0x613f('0xcb')]=function(_0x14ac3b){logger[_0x613f('0x2a')](util['format'](_0x613f('0xcc'),_0x14ac3b[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x14ac3b['text'])){return this[_0x613f('0x34')]['noop'](_0x613f('0xaf'));}var _0x5fdaf8='\x22'+_0x14ac3b[_0x613f('0x58')]+'\x22';if(this['isConfigured'](_0x14ac3b[_0x613f('0x78')])){_0x5fdaf8+=','+_0x14ac3b['options'];}var _0x2d34f5=this['channel'][_0x613f('0x53')](_0x613f('0xb0'),_0x5fdaf8);if(_0x2d34f5[_0x613f('0xb1')]===-0x1){return _0x2d34f5;}return this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5fdaf8));};AGIVertices[_0x613f('0xd')][_0x613f('0xcd')]=function(_0x2648b0){logger['info'](util[_0x613f('0x24')](_0x613f('0xce'),_0x2648b0[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x2648b0[_0x613f('0xb4')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xb5'));}var _0x292a88=_0x2648b0[_0x613f('0xb4')];if(this['isConfigured'](_0x2648b0['options'])){_0x292a88+=','+_0x2648b0[_0x613f('0x78')];}var _0xfeaf64=this['channel']['exec']('MRCPRecog',_0x292a88);if(_0xfeaf64[_0x613f('0xb1')]===-0x1){return _0xfeaf64;}var _0x58588a=this['getAndSetVariable'](_0x613f('0xb7'),_0x613f('0xcf'));if(_0x58588a['result']===-0x1){return _0x58588a;}var _0x2db077=this[_0x613f('0xa6')](_0x613f('0xd0'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2db077[_0x613f('0xb1')]===-0x1){return _0x2db077;}var _0x552891=this[_0x613f('0xa6')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x552891[_0x613f('0xb1')]===-0x1){return _0x552891;}return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xbb'),_0x292a88));};AGIVertices['prototype'][_0x613f('0xd1')]=function(_0x4558d3){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xd2'),_0x4558d3[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x4558d3[_0x613f('0xb4')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xb5'));}var _0x256d75=_0x4558d3[_0x613f('0xb4')];if(this[_0x613f('0xa8')](_0x4558d3['options'])){_0x256d75+=','+_0x4558d3['options'];}var _0x30a7e2=this[_0x613f('0x34')][_0x613f('0x53')](_0x613f('0xb6'),_0x256d75);if(_0x30a7e2[_0x613f('0xb1')]===-0x1){return _0x30a7e2;}var _0x527fc3=this['getAndSetVariable'](_0x613f('0xb7'),_0x613f('0xd3'));if(_0x527fc3[_0x613f('0xb1')]===-0x1){return _0x527fc3;}var _0x3671b4=this['getAndSetVariable'](_0x613f('0xd0'),_0x613f('0xd4'));if(_0x3671b4[_0x613f('0xb1')]===-0x1){return _0x3671b4;}var _0x4e1ddd=this[_0x613f('0xa6')](_0x613f('0xb9'),_0x613f('0xd5'));if(_0x4e1ddd['result']===-0x1){return _0x4e1ddd;}return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xbb'),_0x256d75));};AGIVertices['prototype'][_0x613f('0xd6')]=function(_0x1fd03f){logger[_0x613f('0x2a')](util['format'](_0x613f('0xd7'),_0x1fd03f[_0x613f('0x36')]));if(!this['isConfigured'](_0x1fd03f[_0x613f('0xd8')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x1fd03f,'no\x20database\x20selected');}var _0x22c00e=this['getSquareOdbc'][_0x613f('0xaa')](this,_0x1fd03f[_0x613f('0xd8')]);if(!_0x22c00e){return this['channel'][_0x613f('0x2e')](_0x1fd03f,_0x613f('0xd9'));}if(!this[_0x613f('0xa8')](_0x1fd03f['query'])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x1fd03f,'no\x20query\x20configured');}var _0x3df261=_0x1fd03f[_0x613f('0x29')][_0x613f('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x613f('0x34')]['noop'](util['format'](_0x613f('0xda'),_0x3df261));var _0x37c9ae=this[_0x613f('0x26')]['sync'](this,_0x22c00e,_0x3df261);this[_0x613f('0x33')]['sync'](this,_0x1fd03f,_0x3df261);if(!this['isConfigured'](_0x1fd03f['variable_id'])){return this['channel'][_0x613f('0xae')](_0x613f('0xdb'));}var _0x37a7ca=this[_0x613f('0xa3')][_0x613f('0xaa')](this,_0x1fd03f[_0x613f('0xdc')]);if(!_0x37a7ca){return this[_0x613f('0x34')]['error'](_0x1fd03f,'no\x20variable\x20found');}var _0x55e56a=this;_0x37c9ae['forEach'](function(_0x2dc9c3,_0x4cfb5d){Object[_0x613f('0xdd')](_0x2dc9c3)[_0x613f('0xde')](function(_0x1db7ac){_0x55e56a[_0x613f('0x34')][_0x613f('0xa0')](util['format'](_0x613f('0xdf'),_0x37a7ca,_0x4cfb5d,_0x1db7ac),_0x2dc9c3[_0x1db7ac]);});});this[_0x613f('0x34')][_0x613f('0xa0')](util['format'](_0x613f('0xe0'),_0x37a7ca),_0x37c9ae[_0x613f('0x9d')]);return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xe1'),_0x37a7ca));};AGIVertices[_0x613f('0xd')][_0x613f('0xe2')]=function(_0x467fa5){logger['debug'](util['format'](_0x613f('0xe3'),_0x467fa5[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x467fa5[_0x613f('0xe4')])){return this['channel'][_0x613f('0x2e')](_0x467fa5,_0x613f('0xe5'));}var _0x234a6f=this['getUser'][_0x613f('0xaa')](this,_0x467fa5[_0x613f('0xe4')]);if(!_0x234a6f){return this['channel'][_0x613f('0x2e')](_0x467fa5,_0x613f('0xe6'));}var _0xb42c0=this[_0x613f('0x34')][_0x613f('0x53')]('DIAL',[util['format']('SIP/%s',_0x234a6f),_0x467fa5['timeout'],_0x467fa5[_0x613f('0xe7')],_0x467fa5[_0x613f('0x62')]]);if(_0xb42c0[_0x613f('0xb1')]===-0x1){return _0xb42c0;}return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xe8'),_0x613f('0xe9')));};AGIVertices[_0x613f('0xd')]['dialogflow']=function(_0x1d933c){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xea'),_0x1d933c[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x1d933c['key'])){return this[_0x613f('0x34')]['noop'](_0x613f('0xeb'));}if(!this['isConfigured'](_0x1d933c[_0x613f('0x58')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xaf'));}this[_0x613f('0x34')][_0x613f('0xec')]=!![];this['createSquareDetailsReport'](_0x1d933c);this['createSquareMessage'](_0x1d933c[_0x613f('0x58')],'in','','');this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')](_0x613f('0xed'),_0x1d933c[_0x613f('0x58')]));var _0x5672e2=this[_0x613f('0x79')]['sync'](this,_0x1d933c);if(_0x5672e2){for(var _0x158480 in _0x5672e2){if(_0x5672e2[_0x613f('0x96')](_0x158480)){this[_0x613f('0x34')][_0x613f('0xa0')](util['format'](_0x613f('0xee'),_0x158480[_0x613f('0x68')]()),_0x5672e2[_0x158480]);}}this[_0x613f('0xef')](_0x5672e2[_0x613f('0xf0')],_0x613f('0xf1'),_0x613f('0xf2'),'');return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')]('Dialogflow\x20Result\x20%s',_0x5672e2[_0x613f('0xf0')]));}return this[_0x613f('0x34')]['error'](_0x1d933c,_0x613f('0xf3'));};AGIVertices[_0x613f('0xd')][_0x613f('0xf4')]=function(_0x34a8f3){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xf5'),_0x34a8f3['label']));if(!this['isConfigured'](_0x34a8f3[_0x613f('0x7d')])){return this['channel'][_0x613f('0xae')](_0x613f('0xf6'));}if(!this[_0x613f('0xa8')](_0x34a8f3[_0x613f('0x7e')])){return this['channel'][_0x613f('0xae')](_0x613f('0xf7'));}if(!this[_0x613f('0xa8')](_0x34a8f3[_0x613f('0x7f')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xf8'));}if(!this[_0x613f('0xa8')](_0x34a8f3[_0x613f('0x80')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xf9'));}if(!this[_0x613f('0xa8')](_0x34a8f3[_0x613f('0x58')])){return this['channel'][_0x613f('0xae')](_0x613f('0xaf'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x34a8f3);this[_0x613f('0xef')](_0x34a8f3[_0x613f('0x58')],'in','','');this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xfa'),_0x34a8f3[_0x613f('0x58')]));var _0x1220b8=this['googleDialogflowV2'][_0x613f('0xaa')](this,_0x34a8f3);if(_0x1220b8){for(var _0x558e54 in _0x1220b8){if(_0x1220b8[_0x613f('0x96')](_0x558e54)){if(_0x558e54!=='providerResponse'){this[_0x613f('0x34')]['setVariable'](util[_0x613f('0x24')]('DIALOGFLOW_%s',_0x558e54['toUpperCase']()),_0x1220b8[_0x558e54]);}}}this[_0x613f('0xef')](_0x1220b8['speech'],'out',_0x613f('0xf4'),_0x1220b8[_0x613f('0xfb')]);return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xfc'),_0x1220b8[_0x613f('0xf0')]));}return this[_0x613f('0x34')]['error'](_0x34a8f3,_0x613f('0xfd'));};AGIVertices[_0x613f('0xd')][_0x613f('0xfe')]=function(_0xe40ecf){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0xff'),_0xe40ecf[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0xe40ecf[_0x613f('0x100')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x101'));}if(!this['isConfigured'](_0xe40ecf[_0x613f('0x102')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x103'));}if(!this[_0x613f('0xa8')](_0xe40ecf[_0x613f('0x104')])){return this[_0x613f('0x34')]['noop'](_0x613f('0x105'));}if(!this[_0x613f('0xa8')](_0xe40ecf[_0x613f('0x106')])){return this['channel'][_0x613f('0xae')](_0x613f('0xaf'));}this['channel'][_0x613f('0xec')]=!![];this['createSquareDetailsReport'](_0xe40ecf);this[_0x613f('0xef')](_0xe40ecf[_0x613f('0x58')],'in','','');this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x107'),_0xe40ecf['text']));var _0x151ec5=this[_0x613f('0x81')][_0x613f('0xaa')](this,_0xe40ecf);if(_0x151ec5){for(var _0x1ed876 in _0x151ec5){if(_0x151ec5[_0x613f('0x96')](_0x1ed876)){this[_0x613f('0x34')]['setVariable'](util[_0x613f('0x24')](_0x613f('0x108'),_0x1ed876[_0x613f('0x68')]()),_0x151ec5[_0x1ed876]);}}this['createSquareMessage'](_0x151ec5[_0x613f('0xf0')],_0x613f('0xf1'),_0x613f('0xfe'),'');if(_0x151ec5[_0x613f('0x109')]){this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x10a'),_0x151ec5['audiofile']));var _0x46858e=this[_0x613f('0x34')]['streamFile'](_0x151ec5['audiofile']);try{fs[_0x613f('0x10b')](_0x151ec5[_0x613f('0x109')]+_0x613f('0x10c'));}catch(_0x4ddc0f){logger['error'](_0x4ddc0f);}return _0x46858e;}else{return this[_0x613f('0x34')][_0x613f('0xae')](util['format'](_0x613f('0x10d'),_0x151ec5[_0x613f('0xf0')]));}}return this[_0x613f('0x34')][_0x613f('0x2e')](_0xe40ecf,_0x613f('0x10e'));};AGIVertices[_0x613f('0xd')][_0x613f('0x10f')]=function(_0xe24bd9){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x110'),_0xe24bd9['label']));return this[_0x613f('0x34')]['noop'](_0x613f('0x10f'));};AGIVertices[_0x613f('0xd')][_0x613f('0x111')]=function(_0x23f469){logger['info'](util[_0x613f('0x24')](_0x613f('0x112'),_0x23f469['label']));var _0x4d837e='';if(_0x23f469[_0x613f('0x113')]){if(!this['isConfigured'](_0x23f469[_0x613f('0x113')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x23f469,_0x613f('0x114'));}else{var _0x27a402=parseInt(_0x23f469[_0x613f('0x113')],0xa);if(isNaN(_0x27a402)){_0x4d837e=_0x23f469[_0x613f('0x113')];}else{_0x4d837e=this[_0x613f('0x18')][_0x613f('0xaa')](this,_0x23f469[_0x613f('0x113')]);if(!_0x4d837e){return this['channel'][_0x613f('0x2e')](_0x23f469,'no\x20trunk\x20found');}}}}else if(_0x23f469[_0x613f('0x115')]){_0x4d837e=_0x23f469[_0x613f('0x115')];}else{return this[_0x613f('0x34')][_0x613f('0x2e')](_0x23f469,_0x613f('0x114'));}var _0x45e15b=this[_0x613f('0x34')]['exec'](_0x613f('0xe9'),[util[_0x613f('0x24')](_0x613f('0x116'),_0x4d837e,_0x23f469[_0x613f('0xc6')]),_0x23f469[_0x613f('0x64')],_0x23f469[_0x613f('0xe7')],_0x23f469[_0x613f('0x62')]]);if(_0x45e15b['result']===-0x1){return _0x45e15b;}return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0xe8'),_0x613f('0xe9')));};AGIVertices[_0x613f('0xd')][_0x613f('0x117')]=function(_0x532254){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x118'),_0x532254['label']));return this[_0x613f('0x34')]['noop'](_0x613f('0x117'));};AGIVertices['prototype'][_0x613f('0x119')]=function(_0xb2c23b){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x11a'),_0xb2c23b['label']));if(_0xb2c23b[_0x613f('0xab')]===0x0){return this[_0x613f('0xa9')](_0xb2c23b);}_0xb2c23b[_0x613f('0xab')]-=0x1;if(!this['isConfigured'](_0xb2c23b[_0x613f('0x11b')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0xb2c23b,_0x613f('0x11c'));}var _0x36e2e0=this[_0x613f('0x11d')][_0x613f('0xaa')](this,_0xb2c23b[_0x613f('0x11b')]);if(!_0x36e2e0){return this[_0x613f('0x34')]['error'](_0xb2c23b,_0x613f('0x11e'));}if(!this[_0x613f('0xa8')](_0xb2c23b[_0x613f('0xdc')])){return this[_0x613f('0x34')]['error'](_0x613f('0xdb'));}var _0x574ee4=this['channel']['getData'](_0x36e2e0,_0xb2c23b[_0x613f('0x11f')],_0xb2c23b['maxdigit']);var _0x4d554f=_0x574ee4[_0x613f('0xb1')]?_0x574ee4[_0x613f('0xb1')]['toString']():'';logger['info'](_0x613f('0x120'),JSON[_0x613f('0x73')](_0x574ee4));if(_0x574ee4['result']===-0x1){this[_0x613f('0x33')][_0x613f('0xaa')](this,_0xb2c23b,_0x4d554f);return _0x574ee4;}else if(_0x574ee4[_0x613f('0xa4')]===_0x613f('0x64')){_0x574ee4[_0x613f('0xb1')]=_0x4d554f[_0x613f('0x9d')]>=parseInt(_0xb2c23b[_0x613f('0x121')])?'x':'i';}else{_0x574ee4[_0x613f('0xb1')]=_0x4d554f[_0x613f('0x9d')]>=parseInt(_0xb2c23b[_0x613f('0x121')])&&_0x4d554f[_0x613f('0x9d')]<=parseInt(_0xb2c23b['maxdigit'])?'x':'i';}var _0x28f525=this[_0x613f('0xa3')][_0x613f('0xaa')](this,_0xb2c23b[_0x613f('0xdc')]);if(!_0x28f525){return this[_0x613f('0x34')]['error'](_0xb2c23b,_0x613f('0x122'));}this[_0x613f('0x34')][_0x613f('0xa0')](_0x28f525,_0x4d554f);if(this[_0x613f('0xa8')](_0xb2c23b['hiddendigitsnum'])){var _0x185e59=parseInt(_0xb2c23b['hiddendigitsnum'],0xa);var _0x4e320=rs[_0x613f('0x123')]({'charset':'*','length':_0x185e59});var _0x177e0b=_0x4d554f['length'];if(_0x177e0b>0x0){if(_0x177e0b>_0x185e59){this[_0x613f('0x33')]['sync'](this,_0xb2c23b,_0xb2c23b['hiddendigitspos']===_0x613f('0x124')?_0x4e320+_0x4d554f[_0x613f('0x125')](_0x185e59):_0x4d554f[_0x613f('0x125')](0x0,_0x177e0b-_0x185e59)+_0x4e320);}else{this['createSquareDetailsReport'][_0x613f('0xaa')](this,_0xb2c23b,rs[_0x613f('0x123')]({'charset':'*','length':_0x177e0b}));}}else{this['createSquareDetailsReport'][_0x613f('0xaa')](this,_0xb2c23b,'');}}else{this[_0x613f('0x33')][_0x613f('0xaa')](this,_0xb2c23b,_0x4d554f);}return _0x574ee4;};AGIVertices[_0x613f('0xd')][_0x613f('0xa')]=function(_0x4735e2){logger[_0x613f('0x2a')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4735e2[_0x613f('0x36')]));return this[_0x613f('0x119')](_0x4735e2);};AGIVertices[_0x613f('0xd')][_0x613f('0x126')]=function(_0x34ddbb){logger['info'](util[_0x613f('0x24')](_0x613f('0x127'),_0x34ddbb[_0x613f('0x36')]));this[_0x613f('0x33')][_0x613f('0xaa')](this,_0x34ddbb,_0x34ddbb[_0x613f('0x128')]);return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x129'),_0x34ddbb[_0x613f('0x128')]));};AGIVertices[_0x613f('0xd')]['awspolly']=function(_0x2d0a43){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x12a'),_0x2d0a43['label']));if(!this[_0x613f('0xa8')](_0x2d0a43[_0x613f('0x88')])||!this[_0x613f('0xa8')](_0x2d0a43[_0x613f('0x89')])){return this['channel'][_0x613f('0xae')](_0x613f('0x12b'));}if(!this[_0x613f('0xa8')](_0x2d0a43[_0x613f('0x58')])){return this[_0x613f('0x34')]['noop'](_0x613f('0xaf'));}this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x12c'),_0x2d0a43[_0x613f('0x58')]));var _0x4ba17b=this[_0x613f('0x87')][_0x613f('0xaa')](this,_0x2d0a43);if(_0x4ba17b){this[_0x613f('0x34')][_0x613f('0xae')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x4ba17b));var _0x2928be=this['channel'][_0x613f('0x12d')](_0x4ba17b);try{fs[_0x613f('0x10b')](_0x4ba17b+'.wav');}catch(_0xb09b06){logger[_0x613f('0x2e')](_0xb09b06);}return _0x2928be;}return this['channel'][_0x613f('0x2e')](_0x2d0a43,_0x613f('0x12e'));};AGIVertices['prototype']['awslex']=function(_0x45fb3e){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x12f'),_0x45fb3e['label']));if(!this['isConfigured'](_0x45fb3e[_0x613f('0x88')])||!this[_0x613f('0xa8')](_0x45fb3e[_0x613f('0x89')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x12b'));}if(!this['isConfigured'](_0x45fb3e['aws_bot_name'])){return this['channel']['noop'](_0x613f('0x130'));}if(!this[_0x613f('0xa8')](_0x45fb3e[_0x613f('0x58')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xaf'));}this[_0x613f('0x34')][_0x613f('0xec')]=!![];this['createSquareDetailsReport'](_0x45fb3e);this[_0x613f('0xef')](_0x45fb3e[_0x613f('0x58')],'in','','');this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x131'),_0x45fb3e[_0x613f('0x58')]));var _0x324dde=this['awsLex'][_0x613f('0xaa')](this,_0x45fb3e);if(_0x324dde){for(var _0x245315 in _0x324dde){if(_0x324dde['hasOwnProperty'](_0x245315)&&_[_0x613f('0x97')](_0x324dde[_0x245315])){this[_0x613f('0x34')]['setVariable'](util[_0x613f('0x24')](_0x613f('0x132'),_0x245315[_0x613f('0x68')]()),_0x324dde[_0x245315]);}}if(_['isNil'](_0x324dde[_0x613f('0x76')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x133'));}else{this[_0x613f('0xef')](_0x324dde['message'],'out','amazonlex','');return this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')](_0x613f('0x134'),_0x324dde[_0x613f('0x76')]));}}return this[_0x613f('0x34')][_0x613f('0x2e')](_0x45fb3e,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x613f('0xd')][_0x613f('0x135')]=function(_0x1a0128){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x136'),_0x1a0128['label'],_0x1a0128[_0x613f('0x64')]));if(!this[_0x613f('0xa8')](_0x1a0128[_0x613f('0x7a')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xeb'));}var _0x12d2c9=_0x613f('0x137');var _0x1fbf87=util[_0x613f('0x24')](_0x613f('0x138'),FILES_PATH,rs['generate'](0x4));var _0xc13b26=util[_0x613f('0x24')](_0x613f('0x9f'),_0x1fbf87,_0x12d2c9);var _0x4905b1=!![];if(_0x1a0128[_0x613f('0x139')]==='NOBEEP'){_0x4905b1=![];}var _0x757d09=this[_0x613f('0x34')]['recordFile'](_0x1fbf87,_0x12d2c9,_0x1a0128[_0x613f('0x13a')],_0x1a0128[_0x613f('0x64')],undefined,_0x4905b1);if(_0x757d09['result']!==-0x1){this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x13b'),_0xc13b26));var _0x102ea9=this[_0x613f('0x90')][_0x613f('0xaa')](this,_0x1a0128,_0xc13b26);if(_0x102ea9){for(var _0x54df29 in _0x102ea9){if(_0x102ea9[_0x613f('0x96')](_0x54df29)){this['channel']['setVariable'](util['format']('GOOGLE_ASR_%s',_0x54df29[_0x613f('0x68')]()),_0x102ea9[_0x54df29]);}}return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x13c'),JSON[_0x613f('0x73')](_0x102ea9)));}}return _0x757d09;};AGIVertices[_0x613f('0xd')][_0x613f('0x13d')]=function(_0x191867){logger['info'](util[_0x613f('0x24')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x191867[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x191867[_0x613f('0x92')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x13e'));}if(!this[_0x613f('0xa8')](_0x191867['appsecret'])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x13f'));}var _0x426656=_0x613f('0x137');var _0x23a868=util[_0x613f('0x24')](_0x613f('0x138'),FILES_PATH,rs['generate'](0x4));var _0x54c164=util['format'](_0x613f('0x9f'),_0x23a868,_0x426656);var _0x5949a4=!![];if(_0x191867['beep']===_0x613f('0x140')){_0x5949a4=![];}var _0xd3a49d=this[_0x613f('0x34')][_0x613f('0x141')](_0x23a868,_0x426656,_0x191867['intKey'],_0x191867[_0x613f('0x64')],undefined,_0x5949a4);if(_0xd3a49d[_0x613f('0xb1')]!==-0x1){this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x142'),_0x54c164));var _0x104e6e=this[_0x613f('0x91')][_0x613f('0xaa')](this,_0x191867,_0x54c164);if(_0x104e6e){for(var _0x2836b2 in _0x104e6e){if(_0x104e6e['hasOwnProperty'](_0x2836b2)){this[_0x613f('0x34')][_0x613f('0xa0')](util[_0x613f('0x24')]('TILDE_ASR_%s',_0x2836b2[_0x613f('0x68')]()),_0x104e6e[_0x2836b2]);}}return this[_0x613f('0x34')][_0x613f('0xae')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x613f('0x73')](_0x104e6e)));}}return _0xd3a49d;};AGIVertices[_0x613f('0xd')][_0x613f('0x143')]=function(_0x24fc62){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x144'),_0x24fc62[_0x613f('0x36')]));return this['channel'][_0x613f('0x145')](_0x24fc62[_0x613f('0x3a')],_0x24fc62[_0x613f('0x3b')],_0x24fc62[_0x613f('0x3c')]);};AGIVertices[_0x613f('0xd')][_0x613f('0x146')]=function(_0x4cbfec){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x147'),_0x4cbfec['label']));if(!this[_0x613f('0xa8')](_0x4cbfec[_0x613f('0x148')])){return this['channel'][_0x613f('0x2e')](_0x4cbfec,_0x613f('0x149'));}try{var _0x196df0=eval(_0x4cbfec[_0x613f('0x148')])?_0x613f('0x14a'):'false';this[_0x613f('0x34')][_0x613f('0xae')](util['format'](_0x613f('0x14b'),_0x4cbfec[_0x613f('0x148')],_0x196df0));return{'code':0xc8,'result':_0x196df0};}catch(_0x592f1b){return{'code':0xc8,'result':_0x613f('0x14c')};}};AGIVertices[_0x613f('0xd')][_0x613f('0x14d')]=function(_0x57ad0b){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x14e'),_0x57ad0b[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x57ad0b[_0x613f('0x14f')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x57ad0b,_0x613f('0x150'));}var _0x2b9ec8=this['getIntervals'][_0x613f('0xaa')](this,_0x57ad0b['interval_id']);if(!_0x2b9ec8){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x57ad0b,_0x613f('0x151'));}for(var _0x3ef342=0x0;_0x3ef342<_0x2b9ec8[_0x613f('0x9d')];_0x3ef342+=0x1){var _0x564269=this['channel'][_0x613f('0xa3')](util[_0x613f('0x24')](_0x613f('0x152'),_0x2b9ec8[_0x3ef342]));if(_0x564269[_0x613f('0xb1')]===-0x1){return _0x564269;}logger[_0x613f('0x2a')](util['format'](_0x613f('0x153'),_0x2b9ec8[_0x3ef342],_0x564269['extra']));if(_0x564269[_0x613f('0xa4')]===_0x613f('0x14a')){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x153'),_0x2b9ec8[_0x3ef342],_0x613f('0x14a')));this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')]('IFTIME\x20%s\x20%s',_0x2b9ec8[_0x3ef342],_0x613f('0x14a')));return{'code':0xc8,'result':_0x613f('0x14a')};}else{logger[_0x613f('0x2a')](util['format'](_0x613f('0x153'),_0x2b9ec8[_0x3ef342],_0x613f('0x14c')));this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x153'),_0x2b9ec8[_0x3ef342],_0x613f('0x14c')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x613f('0xd')][_0x613f('0x154')]=function(_0x281576){logger[_0x613f('0x2a')](util['format'](_0x613f('0x155'),_0x281576[_0x613f('0x36')]));return this[_0x613f('0x34')][_0x613f('0x154')]();};AGIVertices['prototype'][_0x613f('0x156')]=function(_0x43631c){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x157'),_0x43631c[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x43631c[_0x613f('0x7a')])){return this['channel'][_0x613f('0xae')](_0x613f('0xeb'));}var _0x4ba3d5=_0x613f('0x137');var _0x4a70bf=util[_0x613f('0x24')](_0x613f('0x138'),FILES_PATH,rs[_0x613f('0x123')](0x4));var _0x388d56=util[_0x613f('0x24')](_0x613f('0x9f'),_0x4a70bf,_0x4ba3d5);var _0x8a5f52=!![];if(_0x43631c['beep']==='NOBEEP'){_0x8a5f52=![];}var _0x28c031=this[_0x613f('0x34')]['recordFile'](_0x4a70bf,_0x4ba3d5,_0x43631c['intKey'],_0x43631c[_0x613f('0x64')],undefined,_0x8a5f52);if(_0x28c031['result']!==-0x1){this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x158'),_0x388d56));var _0x2a14df=this[_0x613f('0x84')][_0x613f('0xaa')](this,_0x43631c,_0x388d56);if(_0x2a14df){for(var _0xc042ab in _0x2a14df){if(_0x2a14df[_0x613f('0x96')](_0xc042ab)){this[_0x613f('0x34')]['setVariable'](util[_0x613f('0x24')](_0x613f('0x159'),_0xc042ab['toUpperCase']()),_0x2a14df[_0xc042ab]);}}return this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x2a14df)));}}return _0x28c031;};AGIVertices[_0x613f('0xd')]['ispeechtts']=function(_0x4a0c9f){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x15a'),_0x4a0c9f[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x4a0c9f['key'])){return this[_0x613f('0x34')]['noop'](_0x613f('0xeb'));}if(!this['isConfigured'](_0x4a0c9f[_0x613f('0x58')])){return this[_0x613f('0x34')]['noop']('no\x20text\x20configured');}this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x15b'),_0x4a0c9f['text']));var _0x5be0d5=this['ispeechTTS'][_0x613f('0xaa')](this,_0x4a0c9f);if(_0x5be0d5){this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')]('ispeech\x20%s\x20file\x20created',_0x5be0d5));var _0x28984d=this[_0x613f('0x34')][_0x613f('0x12d')](_0x5be0d5,_0x4a0c9f[_0x613f('0x13a')]);try{fs[_0x613f('0x10b')](_0x5be0d5+_0x613f('0x10c'));}catch(_0x51f3bf){logger['error'](_0x51f3bf);}return _0x28984d;}return this['channel']['error'](_0x4a0c9f,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x613f('0xd')][_0x613f('0x15c')]=function(_0x4038c2){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x15d'),_0x4038c2['label']));if(!this['isConfigured'](_0x4038c2[_0x613f('0x15e')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x4038c2,_0x613f('0x15f'));}logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x160'),this['channel'][_0x613f('0x38')],_0x4038c2[_0x613f('0x15e')]));var _0x12b96b=this['agentLogin']['sync'](this,_0x4038c2[_0x613f('0x15e')]);if(_0x12b96b){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x161'),this[_0x613f('0x34')]['callerid'],_0x4038c2[_0x613f('0x15e')]));this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')](_0x613f('0x161'),this['channel'][_0x613f('0x38')],_0x4038c2[_0x613f('0x15e')]));return{'code':0xc8,'result':_0x613f('0x162')};}else{logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x163'),this[_0x613f('0x34')][_0x613f('0x38')],_0x4038c2['findBy']));this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x163'),this[_0x613f('0x34')][_0x613f('0x38')],_0x4038c2[_0x613f('0x15e')]));return{'code':0xc8,'result':_0x613f('0x164')};}};AGIVertices[_0x613f('0xd')]['logout']=function(_0x4da610){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x165'),_0x4da610[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x4da610[_0x613f('0x15e')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x4da610,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x613f('0x160'),this[_0x613f('0x34')][_0x613f('0x38')],_0x4da610[_0x613f('0x15e')]));var _0x424322=this[_0x613f('0x4f')][_0x613f('0xaa')](this,_0x4da610[_0x613f('0x15e')]);if(_0x424322){logger[_0x613f('0x2a')](util['format'](_0x613f('0x161'),this[_0x613f('0x34')]['callerid'],_0x4da610[_0x613f('0x15e')]));this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x161'),this[_0x613f('0x34')]['callerid'],_0x4da610[_0x613f('0x15e')]));return{'code':0xc8,'result':_0x613f('0x162')};}else{logger[_0x613f('0x2a')](util['format'](_0x613f('0x163'),this['channel']['callerid'],_0x4da610[_0x613f('0x15e')]));this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x163'),this[_0x613f('0x34')][_0x613f('0x38')],_0x4da610[_0x613f('0x15e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x49b7cc){logger['info'](util['format'](_0x613f('0x166'),_0x49b7cc[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x49b7cc[_0x613f('0x167')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x49b7cc,_0x613f('0x168'));}this['channel'][_0x613f('0xae')](util['format'](_0x613f('0x169'),_0x49b7cc[_0x613f('0x167')]));var _0x54c68e=eval(_0x49b7cc[_0x613f('0x167')]);if(!this['isConfigured'](_0x49b7cc[_0x613f('0xdc')])){return this[_0x613f('0x34')]['noop'](_0x613f('0xdb'));}var _0x3ef8d6=this[_0x613f('0xa3')][_0x613f('0xaa')](this,_0x49b7cc[_0x613f('0xdc')]);if(!_0x3ef8d6){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x49b7cc,_0x613f('0x122'));}if(_['isArray'](_0x54c68e)){var _0x12cf88=this;_0x54c68e[_0x613f('0xde')](function(_0x87b86,_0x1ee08c){_0x12cf88['channel'][_0x613f('0xa0')](util['format'](_0x613f('0x16a'),_0x3ef8d6,_0x1ee08c),_0x87b86);});return this[_0x613f('0x34')][_0x613f('0xae')](util['format']('variable\x20%s[key]\x20set',_0x3ef8d6));}else{return this[_0x613f('0x34')][_0x613f('0xa0')](_0x3ef8d6,_0x54c68e);}};AGIVertices[_0x613f('0xd')][_0x613f('0x16b')]=function(_0x452434){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x16c'),_0x452434[_0x613f('0x36')]));if(_0x452434['retry']===0x0){return this[_0x613f('0xa9')](_0x452434);}_0x452434['retry']-=0x1;if(!this['isConfigured'](_0x452434['file_id'])){return this[_0x613f('0x34')]['error'](_0x452434,_0x613f('0x11c'));}var _0x57121b=this[_0x613f('0x11d')][_0x613f('0xaa')](this,_0x452434[_0x613f('0x11b')]);if(!_0x57121b){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x452434,'no\x20file\x20audio\x20found');}var _0x26d3d6=this[_0x613f('0x34')]['getData'](_0x57121b,_0x452434[_0x613f('0x11f')],_0x452434[_0x613f('0x16d')]);var _0x5e2b70=_0x26d3d6[_0x613f('0xb1')];if(_0x26d3d6['result']===-0x1){this[_0x613f('0x33')][_0x613f('0xaa')](this,_0x452434,'-1');return _0x26d3d6;}else if(_0x26d3d6['extra']===_0x613f('0x64')){_0x26d3d6[_0x613f('0xb1')]=_0x26d3d6[_0x613f('0xb1')][_0x613f('0x9d')]>0x0?_0x26d3d6[_0x613f('0xb1')]:'t';}else if(_['isEmpty'](_0x26d3d6[_0x613f('0xb1')])){_0x26d3d6['result']='#';_0x5e2b70='#';}if(!this['isConfigured'](_0x452434[_0x613f('0xdc')])){this[_0x613f('0x34')][_0x613f('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x58d037=this['getVariable'][_0x613f('0xaa')](this,_0x452434['variable_id']);if(!_0x58d037){return this[_0x613f('0x34')]['error'](_0x452434,'no\x20variable\x20found');}this[_0x613f('0x34')][_0x613f('0xa0')](_0x58d037,_0x5e2b70);}this['createSquareDetailsReport']['sync'](this,_0x452434,_0x5e2b70);return _0x26d3d6;};AGIVertices['prototype'][_0x613f('0xae')]=function(_0x298fc0){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x16e'),_0x298fc0[_0x613f('0x36')]));return this[_0x613f('0x34')][_0x613f('0xae')](_0x298fc0['output']||_0x298fc0[_0x613f('0x36')]);};AGIVertices[_0x613f('0xd')]['pause']=function(_0x444d05){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x16f'),_0x444d05[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x444d05['findBy'])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x444d05,'no\x20find\x20by\x20configured');}logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x160'),this[_0x613f('0x34')][_0x613f('0x38')],_0x444d05[_0x613f('0x15e')]));var _0x40873d=this['getPause'][_0x613f('0xaa')](this,_0x444d05[_0x613f('0x170')]);var _0xf3b6d1=this[_0x613f('0x4c')][_0x613f('0xaa')](this,_0x444d05['findBy'],_0x40873d);if(_0xf3b6d1){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x161'),this[_0x613f('0x34')][_0x613f('0x38')],_0x444d05['findBy']));this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x161'),this[_0x613f('0x34')][_0x613f('0x38')],_0x444d05[_0x613f('0x15e')]));return{'code':0xc8,'result':_0x613f('0x162')};}else{logger['info'](util[_0x613f('0x24')](_0x613f('0x163'),this[_0x613f('0x34')]['callerid'],_0x444d05[_0x613f('0x15e')]));this['channel']['noop'](util['format'](_0x613f('0x161'),this[_0x613f('0x34')]['callerid'],_0x444d05[_0x613f('0x15e')]));return{'code':0xc8,'result':_0x613f('0x164')};}};AGIVertices[_0x613f('0xd')]['playback']=function(_0x15fec0){logger['info'](util[_0x613f('0x24')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x15fec0[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x15fec0['file_id'])){return this['channel'][_0x613f('0x2e')](_0x15fec0,_0x613f('0x11c'));}var _0x245155=this[_0x613f('0x11d')][_0x613f('0xaa')](this,_0x15fec0['file_id']);if(!_0x245155){return this['channel'][_0x613f('0x2e')](_0x15fec0,_0x613f('0x11e'));}var _0x3fd35e=this[_0x613f('0x34')][_0x613f('0x53')](_0x613f('0x171'),[_0x245155,_0x15fec0[_0x613f('0xe7')]]);if(_0x3fd35e['result']===-0x1){return _0x3fd35e;}return this[_0x613f('0x34')][_0x613f('0xae')](util['format'](_0x613f('0x172'),'PLAYBACK',_0x245155));};AGIVertices[_0x613f('0xd')][_0x613f('0x173')]=function(_0x167f19){logger['info'](util[_0x613f('0x24')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x167f19['label']));if(!this['isConfigured'](_0x167f19[_0x613f('0x174')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x167f19,_0x613f('0x175'));}var _0x5ade30='';var _0x202f25=parseInt(_0x167f19[_0x613f('0x174')],0xa);if(isNaN(_0x202f25)){_0x5ade30=_0x167f19[_0x613f('0x174')];}else{_0x5ade30=this[_0x613f('0xf')][_0x613f('0xaa')](this,_0x167f19[_0x613f('0x174')]);if(!_0x5ade30){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x167f19,_0x613f('0x176'));}}var _0x567a1a='';if(this[_0x613f('0xa8')](_0x167f19[_0x613f('0x11b')])){var _0x7740e9=this['getSound'][_0x613f('0xaa')](this,_0x167f19[_0x613f('0x11b')]);if(_0x7740e9){_0x567a1a=_0x7740e9;}}this[_0x613f('0x33')][_0x613f('0xaa')](this,_0x167f19,_0x5ade30);if(_0x167f19[_0x613f('0xe7')][_0x613f('0x177')]('x')<0x0){_0x167f19[_0x613f('0xe7')]+='x';}if(_0x167f19[_0x613f('0xe7')][_0x613f('0x177')]('X')<0x0){_0x167f19[_0x613f('0xe7')]+='X';}this[_0x613f('0x34')][_0x613f('0xa0')](_0x613f('0x178'),_0x5ade30?_0x5ade30[_0x613f('0x179')]():'');var _0x245a1f=this['channel'][_0x613f('0x53')](_0x613f('0x17a'),[_0x5ade30,_0x167f19['opts'],_0x167f19['url'],_0x567a1a,_0x167f19[_0x613f('0x64')],_0x167f19['agi'],_0x167f19[_0x613f('0x17b')],_0x167f19[_0x613f('0x17c')],'',_0x167f19[_0x613f('0x17d')]]);if(_0x245a1f[_0x613f('0xb1')]===-0x1){return _0x245a1f;}return this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')](_0x613f('0x172'),_0x613f('0x17a'),_0x5ade30));};AGIVertices[_0x613f('0xd')][_0x613f('0x17e')]=function(_0x7e0b85){logger['info'](util[_0x613f('0x24')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x7e0b85['label']));var _0x2b8dcd=_0x7e0b85[_0x613f('0x17f')]||_0x613f('0x137');var _0x3cd209=util[_0x613f('0x24')](_0x613f('0x180'),this[_0x613f('0x34')]['uniqueid'],rs[_0x613f('0x123')](0x5));var _0x1e3a68=util[_0x613f('0x24')]('%s/recordings/%s.%s',FILES_PATH,_0x3cd209,_0x2b8dcd);var _0x41e38c=util['format'](_0x613f('0x138'),FILES_PATH,_0x3cd209);this[_0x613f('0x39')][_0x613f('0xaa')](this,_0x7e0b85,_0x3cd209,_0x1e3a68);this['channel'][_0x613f('0xa0')](_0x613f('0x181'),_0x3cd209);logger[_0x613f('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x41e38c,_0x2b8dcd,_0x7e0b85[_0x613f('0x182')],_0x7e0b85['timeout']);return this[_0x613f('0x34')][_0x613f('0x141')](_0x41e38c,_0x2b8dcd,_0x7e0b85['escape_digits'],_0x7e0b85[_0x613f('0x64')],undefined,!![]);};AGIVertices[_0x613f('0xd')][_0x613f('0x183')]=function(_0x29fa0b){logger[_0x613f('0x2a')](util['format'](_0x613f('0x184'),_0x29fa0b['label']));if(!this['isConfigured'](_0x29fa0b[_0x613f('0x62')])){return this[_0x613f('0x34')][_0x613f('0xae')]('no\x20url\x20configured');}var _0x384565=this[_0x613f('0x61')][_0x613f('0xaa')](this,_0x29fa0b);logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x185'),util[_0x613f('0x186')](_0x384565,{'showHidden':![],'depth':null})));if(!this[_0x613f('0xa8')](_0x29fa0b[_0x613f('0xdc')])){return this['channel'][_0x613f('0xae')](_0x613f('0x187'));}var _0x5c9b20=this['getVariable'][_0x613f('0xaa')](this,_0x29fa0b[_0x613f('0xdc')]);if(!_0x5c9b20){return this[_0x613f('0x34')]['error'](_0x29fa0b,_0x613f('0x122'));}this[_0x613f('0x34')][_0x613f('0xa0')](util['format'](_0x613f('0x188'),_0x5c9b20),_0x384565[_0x613f('0x74')]?_0x384565['statusCode']:'200');this[_0x613f('0x34')]['setVariable'](util[_0x613f('0x24')](_0x613f('0x189'),_0x5c9b20),_0x384565[_0x613f('0x75')]?_0x384565[_0x613f('0x75')]:'OK');if(_0x384565['body']){try{this[_0x613f('0x9e')](_0x384565[_0x613f('0x72')],_0x5c9b20);}catch(_0xbbda57){logger['error'](util['format'](_0x613f('0x18a'),_0x5c9b20));}}return this['channel']['noop'](util[_0x613f('0x24')](_0x613f('0xe1'),_0x5c9b20));};AGIVertices['prototype'][_0x613f('0x18b')]=function(_0x1db84a){logger['info'](util[_0x613f('0x24')](_0x613f('0x18c'),_0x1db84a['label']));return this[_0x613f('0x34')]['sayDigits'](_0x1db84a[_0x613f('0x18d')][_0x613f('0x55')](/\s+/g,''),_0x1db84a[_0x613f('0x182')]);};AGIVertices[_0x613f('0xd')][_0x613f('0x18e')]=function(_0x2a27f6){logger['info'](util[_0x613f('0x24')](_0x613f('0x18f'),_0x2a27f6[_0x613f('0x36')]));return this[_0x613f('0x34')]['sayNumber'](_0x2a27f6[_0x613f('0x65')][_0x613f('0x55')](/\s+/g,''),_0x2a27f6['escape_digits']);};AGIVertices[_0x613f('0xd')][_0x613f('0x190')]=function(_0x32aa73){logger['info'](util[_0x613f('0x24')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x32aa73[_0x613f('0x36')]));return this[_0x613f('0x34')][_0x613f('0x191')](_0x32aa73[_0x613f('0x58')],_0x32aa73[_0x613f('0x182')]);};AGIVertices[_0x613f('0xd')][_0x613f('0x192')]=function(_0x3bd23c){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x193'),_0x3bd23c[_0x613f('0x36')]));if(!this['isConfigured'](_0x3bd23c[_0x613f('0x194')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x195'));}var _0x4866c4=this[_0x613f('0x1a')][_0x613f('0xaa')](this,_0x3bd23c['account_id']);if(!_0x4866c4||!_0x4866c4[_0x613f('0x196')]){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x3bd23c,'no\x20mail\x20account\x20found');}var _0x393e58={'from':util[_0x613f('0x24')](_0x613f('0x197'),_0x4866c4[_0x613f('0x11')],_0x4866c4[_0x613f('0x198')]||_0x4866c4['Smtp'][_0x613f('0x199')]),'to':_0x3bd23c['to']||'','cc':_0x3bd23c['cc']||'','bcc':_0x3bd23c[_0x613f('0x19a')]||'','subject':_0x3bd23c[_0x613f('0x19b')],'html':_0x3bd23c[_0x613f('0x58')],'text':_0x3bd23c['text']};if(this[_0x613f('0xa8')](_0x3bd23c[_0x613f('0x19c')])){}logger['debug'](_0x613f('0x19d'),JSON[_0x613f('0x73')](_0x393e58));this[_0x613f('0x33')][_0x613f('0xaa')](this,_0x3bd23c,_0x3bd23c[_0x613f('0x194')]);this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')](_0x613f('0x19e'),_0x4866c4[_0x613f('0x11')]));this[_0x613f('0x1c')][_0x613f('0xaa')](this,_0x4866c4[_0x613f('0x19f')],_0x393e58);return this[_0x613f('0x34')][_0x613f('0xae')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x613f('0xd')][_0x613f('0x1a0')]=function(_0x28b1ae){logger['info'](util[_0x613f('0x24')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x28b1ae[_0x613f('0x36')]));return this[_0x613f('0x34')]['noop'](_0x613f('0x1a1'));};AGIVertices[_0x613f('0xd')]['sendSMS']=function(_0x471d67){logger[_0x613f('0x2a')](util[_0x613f('0x24')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x471d67[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x471d67[_0x613f('0x1a2')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x1a3'));}var _0x209865=this[_0x613f('0x30')][_0x613f('0xaa')](this,_0x471d67['sms_account_id']);if(!_0x209865){return this['channel'][_0x613f('0x2e')](_0x471d67,_0x613f('0x1a4'));}var _0x2ee7fd={'body':_0x471d67['sms_text'],'phone':_0x471d67['to']||'','SmsAccountId':_0x209865['id']};logger[_0x613f('0x1a5')](_0x613f('0x1a6'),JSON[_0x613f('0x73')](_0x2ee7fd));this[_0x613f('0x33')][_0x613f('0xaa')](this,_0x471d67,_0x471d67[_0x613f('0x1a2')]);this[_0x613f('0x34')][_0x613f('0xae')](util['format'](_0x613f('0x1a7'),_0x209865[_0x613f('0x11')]));this[_0x613f('0x32')][_0x613f('0xaa')](this,_0x2ee7fd);return this[_0x613f('0x34')]['noop'](_0x613f('0x1a8'));};AGIVertices[_0x613f('0xd')]['set']=function(_0xeb706f){logger[_0x613f('0x2a')](util['format'](_0x613f('0x1a9'),_0xeb706f['label']));if(!this[_0x613f('0xa8')](_0xeb706f['variable_id'])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0xeb706f,_0x613f('0x1aa'));}var _0x540015=this[_0x613f('0xa3')][_0x613f('0xaa')](this,_0xeb706f[_0x613f('0xdc')]);if(!_0x540015){return this['channel'][_0x613f('0x2e')](_0xeb706f,_0x613f('0x122'));}return this['channel']['setVariable'](_0x540015,_0xeb706f[_0x613f('0x1ab')]);};AGIVertices[_0x613f('0xd')][_0x613f('0x1ac')]=function(_0x1f4727){logger[_0x613f('0x2a')](util['format'](_0x613f('0x1ad'),_0x1f4727['label']));this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x1ae'));if(_0x1f4727[_0x613f('0x1af')]===_0x613f('0x1b0')){this[_0x613f('0x34')][_0x613f('0xae')]('Answer');return this[_0x613f('0x34')][_0x613f('0x1af')]();}return this['channel'][_0x613f('0xae')](_0x613f('0x1b1'));};AGIVertices['prototype'][_0x613f('0x1b2')]=function(_0x24e1ed){logger[_0x613f('0x2a')](util['format'](_0x613f('0x1b3'),_0x24e1ed[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x24e1ed[_0x613f('0x1b4')])){return this[_0x613f('0x34')]['error'](_0x24e1ed,_0x613f('0x1b5'));}var _0x31da44=this[_0x613f('0x1b6')][_0x613f('0xaa')](this,_0x24e1ed[_0x613f('0x1b4')]);if(!this[_0x613f('0xa8')](_0x31da44)){return this['channel']['error'](_0x24e1ed,util[_0x613f('0x24')](_0x613f('0x1b7'),_0x24e1ed[_0x613f('0x1b4')]));}if(_0x31da44===this['channel'][_0x613f('0x3f')]){return this[_0x613f('0x34')]['error'](_0x24e1ed,_0x613f('0x1b8'));}this[_0x613f('0x33')]['sync'](this,_0x24e1ed,_0x31da44);var _0x149ce6=this[_0x613f('0x34')][_0x613f('0x53')](_0x613f('0x1b9'),util[_0x613f('0x24')](_0x613f('0x1ba'),config['agi'][_0x613f('0x1bb')]||_0x613f('0x1bc'),_0x31da44,this['channel']['arg_1']));if(_0x149ce6[_0x613f('0xb1')]===-0x1){return _0x149ce6;}return this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')]('Executed\x20command\x20%s\x20%s','AGI',_0x31da44));};AGIVertices[_0x613f('0xd')][_0x613f('0x1bd')]=function(_0x253934){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x253934['label']));var _0x3fd5cd=this[_0x613f('0x1be')]['sync'](this,_0x253934[_0x613f('0xbd')]);this['createSquareDetailsReport'][_0x613f('0xaa')](this,_0x253934,_0x253934['command']);if(this[_0x613f('0xa8')](_0x253934[_0x613f('0xdc')])){var _0x3b98d5=this['getVariable'][_0x613f('0xaa')](this,_0x253934[_0x613f('0xdc')]);if(_0x3b98d5){this[_0x613f('0x34')][_0x613f('0xa0')](_0x3b98d5,_0x3fd5cd);return this['channel'][_0x613f('0xae')](util['format'](_0x613f('0x1bf'),_0x253934[_0x613f('0xbd')],_0x3b98d5));}}return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x1c0'),_0x253934[_0x613f('0xbd')]));};AGIVertices[_0x613f('0xd')][_0x613f('0x1c1')]=function(_0x213ea2){logger[_0x613f('0x2a')](util['format'](_0x613f('0x1c2'),_0x213ea2[_0x613f('0x36')]));_0x213ea2['text']=_0x213ea2[_0x613f('0x58')][_0x613f('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x613f('0xa8')](_0x213ea2['apiKey'])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0x1c3'));}if(!this['isConfigured'](_0x213ea2[_0x613f('0x58')])){return this[_0x613f('0x34')][_0x613f('0xae')](_0x613f('0xaf'));}this[_0x613f('0x34')]['noop'](util[_0x613f('0x24')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x213ea2[_0x613f('0x58')]));var _0x584a9c=this[_0x613f('0x56')]['sync'](this,_0x213ea2);if(_0x584a9c){this[_0x613f('0x34')][_0x613f('0xae')](util['format'](_0x613f('0x1c4'),_0x584a9c));var _0x295d18=this[_0x613f('0x34')][_0x613f('0x12d')](_0x584a9c);try{fs['unlink'](_0x584a9c+'.wav');}catch(_0x4015d7){logger[_0x613f('0x2e')](_0x4015d7);}return _0x295d18;}return this[_0x613f('0x34')][_0x613f('0x2e')](_0x213ea2,_0x613f('0x1c5'));};AGIVertices['prototype'][_0x613f('0x1c6')]=function(_0x4cae0b){logger[_0x613f('0x2a')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4cae0b[_0x613f('0x36')]));_0x4cae0b[_0x613f('0x58')]=_0x4cae0b[_0x613f('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x613f('0xa8')](_0x4cae0b[_0x613f('0x58')])){return this['channel'][_0x613f('0xae')]('no\x20text\x20configured');}this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x1c7'),_0x4cae0b['text']));var _0x2294e1=this[_0x613f('0x5f')][_0x613f('0xaa')](this,_0x4cae0b);if(_0x2294e1){this['channel'][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x1c8'),_0x2294e1));var _0xf75e8c=this[_0x613f('0x34')][_0x613f('0x12d')](_0x2294e1);try{fs['unlink'](_0x2294e1+_0x613f('0x10c'));}catch(_0x406e5e){logger[_0x613f('0x2e')](_0x406e5e);}return _0xf75e8c;}return this[_0x613f('0x34')][_0x613f('0x2e')](_0x4cae0b,_0x613f('0x1c9'));};AGIVertices[_0x613f('0xd')][_0x613f('0x1ca')]=function(_0x2b719c){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x1cb'),_0x2b719c['label']));if(!this['isConfigured'](_0x2b719c[_0x613f('0x15e')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x2b719c,_0x613f('0x15f'));}logger[_0x613f('0x2a')](util['format'](_0x613f('0x160'),this[_0x613f('0x34')][_0x613f('0x38')],_0x2b719c[_0x613f('0x15e')]));var _0x1192d4=this[_0x613f('0x4e')][_0x613f('0xaa')](this,_0x2b719c[_0x613f('0x15e')]);if(_0x1192d4){logger[_0x613f('0x2a')](util['format'](_0x613f('0x161'),this[_0x613f('0x34')][_0x613f('0x38')],_0x2b719c[_0x613f('0x15e')]));this['channel'][_0x613f('0xae')](util[_0x613f('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x613f('0x34')][_0x613f('0x38')],_0x2b719c['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x613f('0x24')](_0x613f('0x163'),this['channel'][_0x613f('0x38')],_0x2b719c['findBy']));this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x163'),this['channel']['callerid'],_0x2b719c['findBy']));return{'code':0xc8,'result':_0x613f('0x164')};}};AGIVertices[_0x613f('0xd')][_0x613f('0x1cc')]=function(_0x4d804e){logger[_0x613f('0x2a')](util[_0x613f('0x24')](_0x613f('0x1cd'),_0x4d804e[_0x613f('0x36')]));var _0x4f42ec=this[_0x613f('0x34')]['exec'](_0x613f('0x1ce'),[_0x4d804e[_0x613f('0x1cf')],_0x4d804e['options']]);if(_0x4f42ec[_0x613f('0xb1')]===-0x1){return _0x4f42ec;}return this[_0x613f('0x34')][_0x613f('0xae')](util[_0x613f('0x24')](_0x613f('0x172'),_0x613f('0x1ce'),_0x4d804e['mailbox']));};AGIVertices[_0x613f('0xd')][_0x613f('0x1d0')]=function(_0x12ba07){logger['info'](util[_0x613f('0x24')](_0x613f('0x1d1'),_0x12ba07[_0x613f('0x36')]));if(!this[_0x613f('0xa8')](_0x12ba07[_0x613f('0xdc')])){return this[_0x613f('0x34')][_0x613f('0x2e')](_0x12ba07,'no\x20variable\x20selected');}var _0x4afd07=this['getVariable']['sync'](this,_0x12ba07['variable_id']);if(!_0x4afd07){return this[_0x613f('0x34')]['error'](_0x12ba07,_0x613f('0x122'));}var _0x3a6158=this[_0x613f('0x34')][_0x613f('0xa3')](_0x4afd07);return{'code':0xc8,'result':_0x3a6158[_0x613f('0xa4')]?_0x3a6158['extra']:'-'};};String[_0x613f('0xd')]['replaceAll']=function(_0x541fdc,_0x17adc9){return this[_0x613f('0xa1')](_0x541fdc)[_0x613f('0x1d2')](_0x17adc9);};module[_0x613f('0x1d3')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index e8971ed..d58a69a 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 _0x226c=['../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','seconds','startAcw','queue','ACW','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','prototype','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','acw','../rpc/user'];(function(_0x757536,_0x24797c){var _0x55753d=function(_0x17f11c){while(--_0x17f11c){_0x757536['push'](_0x757536['shift']());}};_0x55753d(++_0x24797c);}(_0x226c,0x19f));var _0xc226=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x226c[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xc226('0x0'));var moment=require(_0xc226('0x1'));var ami=require(_0xc226('0x2'));var logger=require('../../../config/logger')(_0xc226('0x3'));var RpcUser=require(_0xc226('0x4'));var RpcVoiceAgentReport=require(_0xc226('0x5'));function Acw(_0x3fa4ab){this[_0xc226('0x6')]=_0x3fa4ab[_0xc226('0x6')];this['agents']=_0x3fa4ab[_0xc226('0x7')];this[_0xc226('0x8')]=_0x3fa4ab[_0xc226('0x8')];this[_0xc226('0x9')]={};ami['on'](_0xc226('0xa'),this['syncAgentConnect'][_0xc226('0xb')](this));ami['on'](_0xc226('0xc'),this[_0xc226('0xd')][_0xc226('0xb')](this));ami['on'](_0xc226('0xe'),this[_0xc226('0xf')]['bind'](this));ami['on'](_0xc226('0x10'),this['syncAgentRingNoAnswer'][_0xc226('0xb')](this));ami['on']('attendedtransfer',this[_0xc226('0x11')][_0xc226('0xb')](this));ami['on'](_0xc226('0x12'),this['syncBlindTransfer'][_0xc226('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0xc226('0x13')]['bind'](this));}function getDiff(_0x5aebe9){var _0x262619=moment()[_0xc226('0x14')](0x0);var _0x51f57e=moment(_0x5aebe9)[_0xc226('0x14')](0x0);return _0x262619['diff'](_0x51f57e,_0xc226('0x15'));}Acw['prototype'][_0xc226('0x16')]=function(_0x2a3662){try{var _0x51482e=this;var _0x36c376=this['channels'][_0x2a3662]['interface'];var _0x168dcb=this['channels'][_0x2a3662][_0xc226('0x17')];var _0x596e7a=this['voiceQueues'][_0x168dcb];var _0x465b7f=![];var _0x5a8a96=_0xc226('0x18');if(_0x596e7a['mandatoryDisposition']){if(_0x596e7a['mandatoryDispositionPause'][_0xc226('0x19')]){_0x465b7f=!![];_0x5a8a96=_0x596e7a[_0xc226('0x1a')][_0xc226('0x19')];}}return ami[_0xc226('0x1b')]({'action':_0xc226('0x1c'),'interface':_0x36c376,'paused':!![],'reason':_0x5a8a96})[_0xc226('0x1d')](function(){if(_0x51482e[_0xc226('0x7')][_0x36c376]){return RpcUser[_0xc226('0x1e')](_0x51482e[_0xc226('0x7')][_0x36c376]['id'])[_0xc226('0x1d')](function(_0x1f11de){if(_0x1f11de&&!_0x1f11de[_0xc226('0x1f')]){logger[_0xc226('0x20')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2a3662,_0x36c376,_0x168dcb);var _0x17c202=_0x51482e[_0xc226('0x9')][_0x2a3662][_0xc226('0x21')]&&_0x51482e['channels'][_0x2a3662]['destlinkedid']?_0x51482e[_0xc226('0x9')][_0x2a3662][_0xc226('0x22')]:_0x2a3662;return RpcUser['savePause'](_0x51482e[_0xc226('0x7')][_0x36c376],_0x5a8a96,_0x17c202)[_0xc226('0x1d')](function(){if(!_0x465b7f){_0x51482e[_0xc226('0x8')][_0x36c376]={};logger[_0xc226('0x20')](_0xc226('0x23'),_0x2a3662,_0x51482e[_0xc226('0x6')][_0x168dcb]['acwTimeout'],_0x36c376,_0x168dcb);_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x24')]=setTimeout(_0x51482e[_0xc226('0x25')]['bind'](_0x51482e,_0x36c376),_0x51482e[_0xc226('0x6')][_0x168dcb]['acwTimeout']*0x3e8);_0x51482e[_0xc226('0x8')][_0x36c376]['lastPauseAt']=moment()['format'](_0xc226('0x26'));_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x27')]=_0x2a3662;_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x17')]=_0x168dcb;_0x51482e['timers'][_0x36c376][_0xc226('0x28')]=function(){var _0x2abea9=getDiff(_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x29')]);clearTimeout(_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x24')]);_0x51482e['timers'][_0x36c376]['timer']=![];RpcVoiceAgentReport[_0xc226('0x2a')]({'acwtime':_0x2abea9},_0x51482e['timers'][_0x36c376][_0xc226('0x27')],_0x36c376)[_0xc226('0x1d')](function(_0x2a1398){logger[_0xc226('0x20')](_0xc226('0x2b'),_0x2a3662,_0x2abea9,_0x2a1398);})[_0xc226('0x2c')](function(_0x205275){logger[_0xc226('0x2d')]('[%s][UPDATE][ERRORS:%s]',_0x2a3662,_0x205275);});delete _0x51482e[_0xc226('0x8')][_0x36c376];};}});}else{logger[_0xc226('0x20')](_0xc226('0x2e'),_0x2a3662,_0x36c376,_0x168dcb);}});}})[_0xc226('0x2c')](function(){logger[_0xc226('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2a3662,_0x51482e[_0xc226('0x6')][_0x168dcb][_0xc226('0x2f')],_0x36c376,_0x168dcb);})['finally'](function(){delete _0x51482e['channels'][_0x2a3662];});}catch(_0x44499e){logger[_0xc226('0x2d')]('[ACW][START]\x20%s',_0x44499e[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x25')]=function(_0x3544a3){try{var _0x3d468e=this;if(_0x3d468e[_0xc226('0x8')][_0x3544a3]){_0x3d468e[_0xc226('0x8')][_0x3544a3][_0xc226('0x24')]=![];var _0x2be7a0=_0x3d468e[_0xc226('0x8')][_0x3544a3][_0xc226('0x27')];var _0x58b5f0=_0x3d468e[_0xc226('0x8')][_0x3544a3][_0xc226('0x17')];var _0x8b962c=_0x3d468e[_0xc226('0x6')][_0x58b5f0]['acwTimeout'];logger['info'](_0xc226('0x31'),_0x2be7a0,_0x3544a3);RpcUser[_0xc226('0x32')](this[_0xc226('0x7')][_0x3544a3]);RpcVoiceAgentReport[_0xc226('0x2a')]({'acwtime':_0x8b962c,'agentacw':!![]},_0x2be7a0,_0x3544a3)['then'](function(_0x5462fc){logger[_0xc226('0x20')](_0xc226('0x2b'),_0x2be7a0,_0x8b962c,_0x5462fc);})['catch'](function(_0x318ef1){logger[_0xc226('0x2d')](_0xc226('0x33'),_0x2be7a0,_0x318ef1);});}else{logger[_0xc226('0x2d')](_0xc226('0x34'),_0x3544a3);if(_0x3d468e['timers']){logger[_0xc226('0x20')](_0xc226('0x35'),JSON['stringify'](_0x3d468e[_0xc226('0x8')]));}}}catch(_0x4547ab){logger[_0xc226('0x2d')](_0xc226('0x36'),_0x4547ab[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x37')]=function(_0x3b3d39){try{if(this[_0xc226('0x6')][_0x3b3d39['queue']]&&(this[_0xc226('0x6')][_0x3b3d39[_0xc226('0x17')]][_0xc226('0x3')]||this[_0xc226('0x6')][_0x3b3d39[_0xc226('0x17')]][_0xc226('0x38')])){if(this[_0xc226('0x7')][_0x3b3d39['interface']]){this[_0xc226('0x9')][_0x3b3d39[_0xc226('0x27')]]={'queue':_0x3b3d39[_0xc226('0x17')],'interface':_0x3b3d39[_0xc226('0x39')],'destlinkedid':_0x3b3d39[_0xc226('0x22')]};}}}catch(_0x41b0b2){logger[_0xc226('0x2d')](_0xc226('0x3a'),_0x41b0b2['message']);}};Acw['prototype'][_0xc226('0x13')]=function(_0x5d9c07){try{if(this['voiceQueues'][_0x5d9c07[_0xc226('0x17')]]&&(this[_0xc226('0x6')][_0x5d9c07[_0xc226('0x17')]][_0xc226('0x3')]||this['voiceQueues'][_0x5d9c07['queue']][_0xc226('0x38')])){if(this[_0xc226('0x7')][_0x5d9c07[_0xc226('0x39')]]){this[_0xc226('0x9')][_0x5d9c07['uniqueid']]={'queue':_0x5d9c07[_0xc226('0x17')],'interface':_0x5d9c07[_0xc226('0x39')]};}}}catch(_0x3313e3){logger['error'](_0xc226('0x3b'),_0x3313e3[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0xd')]=function(_0x5a7925){try{if(this[_0xc226('0x9')][_0x5a7925[_0xc226('0x27')]]&&_['isUndefined'](this[_0xc226('0x9')][_0x5a7925[_0xc226('0x27')]][_0xc226('0x21')])){logger[_0xc226('0x20')]('[%s][HANGUP:UNIQUEID]',_0x5a7925['uniqueid']);this['startAcw'](_0x5a7925['uniqueid']);}else if(this['channels'][_0x5a7925[_0xc226('0x3c')]]&&_[_0xc226('0x3d')](this['channels'][_0x5a7925[_0xc226('0x3c')]][_0xc226('0x21')])){logger[_0xc226('0x20')](_0xc226('0x3e'),_0x5a7925[_0xc226('0x3c')]);this[_0xc226('0x16')](_0x5a7925['linkedid']);}}catch(_0x3732ea){logger[_0xc226('0x2d')]('[ACW][syncHangupRequest]\x20%s',_0x3732ea[_0xc226('0x30')]);}};Acw['prototype']['syncHangup']=function(_0x1b1cd3){try{if(this[_0xc226('0x9')][_0x1b1cd3[_0xc226('0x27')]]&&this[_0xc226('0x9')][_0x1b1cd3[_0xc226('0x27')]][_0xc226('0x21')]){logger[_0xc226('0x20')](_0xc226('0x3f'),_0x1b1cd3[_0xc226('0x27')]);this['startAcw'](_0x1b1cd3[_0xc226('0x27')]);}else if(this[_0xc226('0x9')][_0x1b1cd3[_0xc226('0x3c')]]&&this['channels'][_0x1b1cd3[_0xc226('0x3c')]][_0xc226('0x21')]){logger[_0xc226('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1b1cd3[_0xc226('0x3c')]);this[_0xc226('0x16')](_0x1b1cd3[_0xc226('0x3c')]);}}catch(_0x494c44){logger[_0xc226('0x2d')](_0xc226('0x40'),_0x494c44[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x11')]=function(_0x1954f7){try{if(!_[_0xc226('0x41')](this[_0xc226('0x9')][_0x1954f7[_0xc226('0x42')]])){this[_0xc226('0x16')](_0x1954f7[_0xc226('0x42')]);if(this['channels'][_0x1954f7[_0xc226('0x43')]]){this[_0xc226('0x9')][_0x1954f7[_0xc226('0x43')]][_0xc226('0x21')]=!![];this[_0xc226('0x9')][_0x1954f7['transfertargetuniqueid']]=this[_0xc226('0x9')][_0x1954f7[_0xc226('0x43')]];delete this[_0xc226('0x9')][_0x1954f7[_0xc226('0x43')]];}}else if(!_[_0xc226('0x41')](this['channels'][_0x1954f7[_0xc226('0x44')]])){this['startAcw'](_0x1954f7[_0xc226('0x44')]);if(this[_0xc226('0x9')][_0x1954f7[_0xc226('0x45')]]){this[_0xc226('0x9')][_0x1954f7['origtransfereruniqueid']][_0xc226('0x21')]=!![];this[_0xc226('0x9')][_0x1954f7['transfereeuniqueid']]=this[_0xc226('0x9')][_0x1954f7[_0xc226('0x45')]];delete this[_0xc226('0x9')][_0x1954f7[_0xc226('0x45')]];}}}catch(_0x24172b){logger[_0xc226('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x24172b[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x46')]=function(_0x55bf85){try{if(this['channels'][_0x55bf85[_0xc226('0x47')]]){logger['info'](_0xc226('0x48'),JSON[_0xc226('0x49')](_0x55bf85[_0xc226('0x47')]));this[_0xc226('0x16')](_0x55bf85[_0xc226('0x47')]);}else if(this[_0xc226('0x9')][_0x55bf85['transfererlinkedid']]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xc226('0x49')](_0x55bf85['transfererlinkedid']));this[_0xc226('0x16')](_0x55bf85[_0xc226('0x4a')]);}}catch(_0x1b5b5b){logger['error'](_0xc226('0x4b'),_0x1b5b5b[_0xc226('0x30')]);}};Acw[_0xc226('0x4c')]['syncAgentRingNoAnswer']=function(_0x23efd0){try{if(this[_0xc226('0x6')][_0x23efd0[_0xc226('0x17')]]&&this[_0xc226('0x6')][_0x23efd0[_0xc226('0x17')]][_0xc226('0x4d')]===_0xc226('0x4e')){if(this[_0xc226('0x7')][_0x23efd0[_0xc226('0x39')]]){logger[_0xc226('0x20')](_0xc226('0x4f'),_0x23efd0[_0xc226('0x27')],_0x23efd0[_0xc226('0x39')],_0x23efd0[_0xc226('0x17')]);return RpcUser[_0xc226('0x50')](this['agents'][_0x23efd0[_0xc226('0x39')]],_0xc226('0x51'),_0x23efd0[_0xc226('0x27')]);}}}catch(_0x39cae5){logger[_0xc226('0x2d')](_0xc226('0x52'),_0x39cae5['message']);}};module[_0xc226('0x53')]=Acw; \ No newline at end of file +var _0xb863=['../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','syncHangup','bind','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','acwTimeout','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','timer','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','prototype','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','acw'];(function(_0x5b346f,_0x339947){var _0x152f38=function(_0xbfc774){while(--_0xbfc774){_0x5b346f['push'](_0x5b346f['shift']());}};_0x152f38(++_0x339947);}(_0xb863,0x149));var _0x3b86=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xb863[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x3b86('0x0'));var moment=require('moment');var ami=require(_0x3b86('0x1'));var logger=require('../../../config/logger')(_0x3b86('0x2'));var RpcUser=require(_0x3b86('0x3'));var RpcVoiceAgentReport=require(_0x3b86('0x4'));function Acw(_0x28b74b){this[_0x3b86('0x5')]=_0x28b74b[_0x3b86('0x5')];this[_0x3b86('0x6')]=_0x28b74b[_0x3b86('0x6')];this['timers']=_0x28b74b[_0x3b86('0x7')];this[_0x3b86('0x8')]={};ami['on'](_0x3b86('0x9'),this[_0x3b86('0xa')]['bind'](this));ami['on'](_0x3b86('0xb'),this[_0x3b86('0xc')]['bind'](this));ami['on']('hangup',this[_0x3b86('0xd')][_0x3b86('0xe')](this));ami['on'](_0x3b86('0xf'),this['syncAgentRingNoAnswer'][_0x3b86('0xe')](this));ami['on'](_0x3b86('0x10'),this[_0x3b86('0x11')]['bind'](this));ami['on'](_0x3b86('0x12'),this['syncBlindTransfer'][_0x3b86('0xe')](this));ami['on'](_0x3b86('0x13'),this[_0x3b86('0x14')][_0x3b86('0xe')](this));}function getDiff(_0x19fe3f){var _0xf252eb=moment()['milliseconds'](0x0);var _0x205417=moment(_0x19fe3f)[_0x3b86('0x15')](0x0);return _0xf252eb[_0x3b86('0x16')](_0x205417,_0x3b86('0x17'));}Acw['prototype'][_0x3b86('0x18')]=function(_0x2fffe3){try{var _0x2927cf=this;var _0xeca1fd=this['channels'][_0x2fffe3][_0x3b86('0x19')];var _0x168f97=this[_0x3b86('0x8')][_0x2fffe3][_0x3b86('0x1a')];var _0x38b045=this['voiceQueues'][_0x168f97];var _0x4d6233=![];var _0x449c7a=_0x3b86('0x1b');if(_0x38b045['mandatoryDisposition']){if(_0x38b045[_0x3b86('0x1c')][_0x3b86('0x1d')]){_0x4d6233=!![];_0x449c7a=_0x38b045[_0x3b86('0x1c')][_0x3b86('0x1d')];}}return ami['Action']({'action':_0x3b86('0x1e'),'interface':_0xeca1fd,'paused':!![],'reason':_0x449c7a})[_0x3b86('0x1f')](function(){if(_0x2927cf['agents'][_0xeca1fd]){return RpcUser[_0x3b86('0x20')](_0x2927cf[_0x3b86('0x6')][_0xeca1fd]['id'])[_0x3b86('0x1f')](function(_0xdc129){if(_0xdc129&&!_0xdc129[_0x3b86('0x21')]){logger[_0x3b86('0x22')](_0x3b86('0x23'),_0x2fffe3,_0xeca1fd,_0x168f97);var _0x414fc7=_0x2927cf[_0x3b86('0x8')][_0x2fffe3]['attended']&&_0x2927cf['channels'][_0x2fffe3][_0x3b86('0x24')]?_0x2927cf[_0x3b86('0x8')][_0x2fffe3][_0x3b86('0x24')]:_0x2fffe3;return RpcUser[_0x3b86('0x25')](_0x2927cf[_0x3b86('0x6')][_0xeca1fd],_0x449c7a,_0x414fc7)[_0x3b86('0x1f')](function(){if(!_0x4d6233){_0x2927cf['timers'][_0xeca1fd]={};logger[_0x3b86('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2fffe3,_0x2927cf[_0x3b86('0x5')][_0x168f97][_0x3b86('0x26')],_0xeca1fd,_0x168f97);_0x2927cf[_0x3b86('0x7')][_0xeca1fd]['timer']=setTimeout(_0x2927cf['stopAcw'][_0x3b86('0xe')](_0x2927cf,_0xeca1fd),_0x2927cf[_0x3b86('0x5')][_0x168f97][_0x3b86('0x26')]*0x3e8);_0x2927cf['timers'][_0xeca1fd]['lastPauseAt']=moment()['format'](_0x3b86('0x27'));_0x2927cf[_0x3b86('0x7')][_0xeca1fd][_0x3b86('0x28')]=_0x2fffe3;_0x2927cf[_0x3b86('0x7')][_0xeca1fd]['queue']=_0x168f97;_0x2927cf['timers'][_0xeca1fd][_0x3b86('0x29')]=function(){var _0x3de845=getDiff(_0x2927cf[_0x3b86('0x7')][_0xeca1fd][_0x3b86('0x2a')]);clearTimeout(_0x2927cf[_0x3b86('0x7')][_0xeca1fd]['timer']);_0x2927cf['timers'][_0xeca1fd][_0x3b86('0x2b')]=![];RpcVoiceAgentReport[_0x3b86('0x2c')]({'acwtime':_0x3de845},_0x2927cf[_0x3b86('0x7')][_0xeca1fd][_0x3b86('0x28')],_0xeca1fd)[_0x3b86('0x1f')](function(_0x46ad49){logger[_0x3b86('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x2fffe3,_0x3de845,_0x46ad49);})[_0x3b86('0x2d')](function(_0x363115){logger[_0x3b86('0x2e')](_0x3b86('0x2f'),_0x2fffe3,_0x363115);});delete _0x2927cf[_0x3b86('0x7')][_0xeca1fd];};}});}else{logger[_0x3b86('0x22')](_0x3b86('0x30'),_0x2fffe3,_0xeca1fd,_0x168f97);}});}})[_0x3b86('0x2d')](function(){logger[_0x3b86('0x2e')](_0x3b86('0x31'),_0x2fffe3,_0x2927cf[_0x3b86('0x5')][_0x168f97][_0x3b86('0x26')],_0xeca1fd,_0x168f97);})[_0x3b86('0x32')](function(){delete _0x2927cf[_0x3b86('0x8')][_0x2fffe3];});}catch(_0x4fa3eb){logger[_0x3b86('0x2e')]('[ACW][START]\x20%s',_0x4fa3eb[_0x3b86('0x33')]);}};Acw[_0x3b86('0x34')][_0x3b86('0x35')]=function(_0x556de8){try{var _0x3b48e1=this;if(_0x3b48e1[_0x3b86('0x7')][_0x556de8]){_0x3b48e1[_0x3b86('0x7')][_0x556de8][_0x3b86('0x2b')]=![];var _0x4973c3=_0x3b48e1[_0x3b86('0x7')][_0x556de8][_0x3b86('0x28')];var _0x1eaf86=_0x3b48e1['timers'][_0x556de8][_0x3b86('0x1a')];var _0xd9d94f=_0x3b48e1[_0x3b86('0x5')][_0x1eaf86][_0x3b86('0x26')];logger[_0x3b86('0x22')](_0x3b86('0x36'),_0x4973c3,_0x556de8);RpcUser[_0x3b86('0x37')](this['agents'][_0x556de8]);RpcVoiceAgentReport['update']({'acwtime':_0xd9d94f,'agentacw':!![]},_0x4973c3,_0x556de8)[_0x3b86('0x1f')](function(_0x5eea8b){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x4973c3,_0xd9d94f,_0x5eea8b);})[_0x3b86('0x2d')](function(_0x258500){logger[_0x3b86('0x2e')](_0x3b86('0x2f'),_0x4973c3,_0x258500);});}else{logger[_0x3b86('0x2e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x556de8);if(_0x3b48e1['timers']){logger[_0x3b86('0x22')](_0x3b86('0x38'),JSON[_0x3b86('0x39')](_0x3b48e1[_0x3b86('0x7')]));}}}catch(_0x4adc4f){logger['error'](_0x3b86('0x3a'),_0x4adc4f['message']);}};Acw[_0x3b86('0x34')][_0x3b86('0xa')]=function(_0x539594){try{if(this[_0x3b86('0x5')][_0x539594[_0x3b86('0x1a')]]&&(this[_0x3b86('0x5')][_0x539594[_0x3b86('0x1a')]][_0x3b86('0x2')]||this[_0x3b86('0x5')][_0x539594[_0x3b86('0x1a')]][_0x3b86('0x3b')])){if(this[_0x3b86('0x6')][_0x539594[_0x3b86('0x19')]]){this[_0x3b86('0x8')][_0x539594[_0x3b86('0x28')]]={'queue':_0x539594[_0x3b86('0x1a')],'interface':_0x539594['interface'],'destlinkedid':_0x539594[_0x3b86('0x24')]};}}}catch(_0x53cdc8){logger[_0x3b86('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x53cdc8[_0x3b86('0x33')]);}};Acw[_0x3b86('0x34')][_0x3b86('0x14')]=function(_0xb287b){try{if(this[_0x3b86('0x5')][_0xb287b[_0x3b86('0x1a')]]&&(this[_0x3b86('0x5')][_0xb287b['queue']][_0x3b86('0x2')]||this[_0x3b86('0x5')][_0xb287b['queue']]['mandatoryDisposition'])){if(this[_0x3b86('0x6')][_0xb287b[_0x3b86('0x19')]]){this[_0x3b86('0x8')][_0xb287b[_0x3b86('0x28')]]={'queue':_0xb287b['queue'],'interface':_0xb287b[_0x3b86('0x19')]};}}}catch(_0x4c36d1){logger[_0x3b86('0x2e')](_0x3b86('0x3c'),_0x4c36d1['message']);}};Acw[_0x3b86('0x34')]['syncHangupRequest']=function(_0xa509aa){try{if(this[_0x3b86('0x8')][_0xa509aa['uniqueid']]&&_[_0x3b86('0x3d')](this[_0x3b86('0x8')][_0xa509aa['uniqueid']][_0x3b86('0x3e')])){logger[_0x3b86('0x22')]('[%s][HANGUP:UNIQUEID]',_0xa509aa[_0x3b86('0x28')]);this[_0x3b86('0x18')](_0xa509aa[_0x3b86('0x28')]);}else if(this['channels'][_0xa509aa[_0x3b86('0x3f')]]&&_['isUndefined'](this[_0x3b86('0x8')][_0xa509aa['linkedid']][_0x3b86('0x3e')])){logger[_0x3b86('0x22')]('[%s][HANGUP:LINKEDID]',_0xa509aa[_0x3b86('0x3f')]);this[_0x3b86('0x18')](_0xa509aa[_0x3b86('0x3f')]);}}catch(_0x5eba6f){logger[_0x3b86('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x5eba6f[_0x3b86('0x33')]);}};Acw['prototype'][_0x3b86('0xd')]=function(_0x166f19){try{if(this[_0x3b86('0x8')][_0x166f19['uniqueid']]&&this[_0x3b86('0x8')][_0x166f19['uniqueid']][_0x3b86('0x3e')]){logger[_0x3b86('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x166f19[_0x3b86('0x28')]);this[_0x3b86('0x18')](_0x166f19[_0x3b86('0x28')]);}else if(this[_0x3b86('0x8')][_0x166f19['linkedid']]&&this['channels'][_0x166f19['linkedid']][_0x3b86('0x3e')]){logger['info'](_0x3b86('0x40'),_0x166f19[_0x3b86('0x3f')]);this['startAcw'](_0x166f19[_0x3b86('0x3f')]);}}catch(_0x494211){logger[_0x3b86('0x2e')](_0x3b86('0x41'),_0x494211[_0x3b86('0x33')]);}};Acw[_0x3b86('0x34')][_0x3b86('0x11')]=function(_0xc4a38a){try{if(!_[_0x3b86('0x42')](this[_0x3b86('0x8')][_0xc4a38a[_0x3b86('0x43')]])){this[_0x3b86('0x18')](_0xc4a38a[_0x3b86('0x43')]);if(this['channels'][_0xc4a38a[_0x3b86('0x44')]]){this[_0x3b86('0x8')][_0xc4a38a[_0x3b86('0x44')]][_0x3b86('0x3e')]=!![];this['channels'][_0xc4a38a[_0x3b86('0x45')]]=this[_0x3b86('0x8')][_0xc4a38a['secondtransfereruniqueid']];delete this[_0x3b86('0x8')][_0xc4a38a[_0x3b86('0x44')]];}}else if(!_['isNil'](this['channels'][_0xc4a38a[_0x3b86('0x45')]])){this[_0x3b86('0x18')](_0xc4a38a[_0x3b86('0x45')]);if(this['channels'][_0xc4a38a[_0x3b86('0x46')]]){this[_0x3b86('0x8')][_0xc4a38a['origtransfereruniqueid']][_0x3b86('0x3e')]=!![];this[_0x3b86('0x8')][_0xc4a38a[_0x3b86('0x43')]]=this[_0x3b86('0x8')][_0xc4a38a[_0x3b86('0x46')]];delete this['channels'][_0xc4a38a[_0x3b86('0x46')]];}}}catch(_0x5c1bec){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x5c1bec[_0x3b86('0x33')]);}};Acw[_0x3b86('0x34')][_0x3b86('0x47')]=function(_0x50999b){try{if(this['channels'][_0x50999b[_0x3b86('0x48')]]){logger[_0x3b86('0x22')](_0x3b86('0x49'),JSON[_0x3b86('0x39')](_0x50999b['transfereruniqueid']));this[_0x3b86('0x18')](_0x50999b[_0x3b86('0x48')]);}else if(this[_0x3b86('0x8')][_0x50999b['transfererlinkedid']]){logger['info'](_0x3b86('0x4a'),JSON[_0x3b86('0x39')](_0x50999b[_0x3b86('0x4b')]));this[_0x3b86('0x18')](_0x50999b[_0x3b86('0x4b')]);}}catch(_0x44a569){logger[_0x3b86('0x2e')](_0x3b86('0x4c'),_0x44a569[_0x3b86('0x33')]);}};Acw[_0x3b86('0x34')][_0x3b86('0x4d')]=function(_0x1fe3e7){try{if(this[_0x3b86('0x5')][_0x1fe3e7[_0x3b86('0x1a')]]&&this['voiceQueues'][_0x1fe3e7[_0x3b86('0x1a')]][_0x3b86('0x4e')]===_0x3b86('0x4f')){if(this['agents'][_0x1fe3e7[_0x3b86('0x19')]]){logger[_0x3b86('0x22')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1fe3e7[_0x3b86('0x28')],_0x1fe3e7[_0x3b86('0x19')],_0x1fe3e7[_0x3b86('0x1a')]);return RpcUser[_0x3b86('0x25')](this[_0x3b86('0x6')][_0x1fe3e7[_0x3b86('0x19')]],_0x3b86('0x50'),_0x1fe3e7[_0x3b86('0x28')]);}}}catch(_0x4851cf){logger['error'](_0x3b86('0x51'),_0x4851cf[_0x3b86('0x33')]);}};module[_0x3b86('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 10589e8..a8273ea 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 _0x757e=['Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','actionSipPeerStatus','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','action','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','queuesummary','info','once','close','connect','shutdown'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0x757e,0x1b8));var _0xe757=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x757e[_0x14add3];return _0x4a174f;};'use strict';var Manager=require(_0xe757('0x0'));var BPromise=require(_0xe757('0x1'));var util=require(_0xe757('0x2'));var logger=require(_0xe757('0x3'))(_0xe757('0x4'));var config=require(_0xe757('0x5'));var ami=new Manager(config[_0xe757('0x6')][_0xe757('0x7')],config[_0xe757('0x6')]['ip'],config['asterisk'][_0xe757('0x8')],config['asterisk'][_0xe757('0x9')],!![]);ami[_0xe757('0xa')]();ami[_0xe757('0xb')]=BPromise['promisify'](ami[_0xe757('0xc')]);function error(_0x5f0ada){logger[_0xe757('0xd')](util[_0xe757('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config['asterisk'][_0xe757('0x7')],util[_0xe757('0xf')](_0x5f0ada,![],null)));}function close(){logger['error'](util[_0xe757('0xe')](_0xe757('0x10'),config[_0xe757('0x6')][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config[_0xe757('0x6')][_0xe757('0x7')]));}ami[_0xe757('0x11')]=function(){return function(){return ami[_0xe757('0xb')]({'action':_0xe757('0x12')});};};ami[_0xe757('0x13')]=function(){return function(){return ami[_0xe757('0xb')]({'action':_0xe757('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xe757('0x15')]=function(){return function(){return ami[_0xe757('0xb')]({'action':_0xe757('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xe757('0xb')]({'action':'coreshowchannels'});};};function connect(){logger[_0xe757('0x17')](util[_0xe757('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xe757('0x6')][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config[_0xe757('0x6')][_0xe757('0x7')]));ami[_0xe757('0x18')](_0xe757('0xd'),error);ami[_0xe757('0x18')](_0xe757('0x19'),close);}ami['on'](_0xe757('0x1a'),connect);ami['on'](_0xe757('0x1b'),function(_0x388668){logger['info'](util['format'](_0xe757('0x1c'),config['asterisk'][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config[_0xe757('0x6')][_0xe757('0x7')],util['inspect'](_0x388668,![],null)));});ami['on'](_0xe757('0x1d'),function(){logger['info'](util[_0xe757('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe757('0x6')]['username'],config[_0xe757('0x6')]['ip'],config['asterisk'][_0xe757('0x7')]));return Promise['resolve']()[_0xe757('0x1e')](ami[_0xe757('0x11')]())[_0xe757('0x1e')](ami['actionDeviceStateList']())[_0xe757('0x1e')](ami[_0xe757('0x1f')]())[_0xe757('0x1e')](ami[_0xe757('0x15')]())[_0xe757('0x1e')](ami[_0xe757('0x20')]())[_0xe757('0x21')](function(_0xdd85e){logger[_0xe757('0xd')](_0xe757('0x22'),util[_0xe757('0xf')](_0xdd85e,{'showHidden':![],'depth':null}));});});ami[_0xe757('0x18')]('error',error);ami['once']('close',close);module[_0xe757('0x23')]=ami; \ No newline at end of file +var _0x9aab=['util','../../config/logger','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','asterisk-manager','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9aab,0x1d2));var _0xb9aa=function(_0x232f4a,_0x589b01){_0x232f4a=_0x232f4a-0x0;var _0x2fd6f7=_0x9aab[_0x232f4a];return _0x2fd6f7;};'use strict';var Manager=require(_0xb9aa('0x0'));var BPromise=require(_0xb9aa('0x1'));var util=require(_0xb9aa('0x2'));var logger=require(_0xb9aa('0x3'))(_0xb9aa('0x4'));var config=require(_0xb9aa('0x5'));var ami=new Manager(config[_0xb9aa('0x6')][_0xb9aa('0x7')],config[_0xb9aa('0x6')]['ip'],config[_0xb9aa('0x6')][_0xb9aa('0x8')],config[_0xb9aa('0x6')]['password'],!![]);ami[_0xb9aa('0x9')]();ami[_0xb9aa('0xa')]=BPromise[_0xb9aa('0xb')](ami[_0xb9aa('0xc')]);function error(_0x1d88af){logger[_0xb9aa('0xd')](util[_0xb9aa('0xe')](_0xb9aa('0xf'),config[_0xb9aa('0x6')][_0xb9aa('0x8')],config['asterisk']['ip'],config['asterisk'][_0xb9aa('0x7')],util[_0xb9aa('0x10')](_0x1d88af,![],null)));}function close(){logger['error'](util[_0xb9aa('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xb9aa('0x6')]['username'],config[_0xb9aa('0x6')]['ip'],config[_0xb9aa('0x6')][_0xb9aa('0x7')]));}ami[_0xb9aa('0x11')]=function(){return function(){return ami[_0xb9aa('0xa')]({'action':_0xb9aa('0x12')});};};ami[_0xb9aa('0x13')]=function(){return function(){return ami[_0xb9aa('0xa')]({'action':_0xb9aa('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xb9aa('0xa')]({'action':_0xb9aa('0x15')});};};ami[_0xb9aa('0x16')]=function(){return function(){return ami[_0xb9aa('0xa')]({'action':_0xb9aa('0x17')});};};ami[_0xb9aa('0x18')]=function(){return function(){return ami[_0xb9aa('0xa')]({'action':_0xb9aa('0x19')});};};function connect(){logger[_0xb9aa('0x1a')](util['format'](_0xb9aa('0x1b'),config[_0xb9aa('0x6')][_0xb9aa('0x8')],config[_0xb9aa('0x6')]['ip'],config['asterisk'][_0xb9aa('0x7')]));ami[_0xb9aa('0x1c')](_0xb9aa('0xd'),error);ami[_0xb9aa('0x1c')](_0xb9aa('0x1d'),close);}ami['on'](_0xb9aa('0x1e'),connect);ami['on']('shutdown',function(_0x59c8be){logger[_0xb9aa('0x1a')](util['format'](_0xb9aa('0x1f'),config[_0xb9aa('0x6')][_0xb9aa('0x8')],config[_0xb9aa('0x6')]['ip'],config[_0xb9aa('0x6')][_0xb9aa('0x7')],util[_0xb9aa('0x10')](_0x59c8be,![],null)));});ami['on'](_0xb9aa('0x20'),function(){logger[_0xb9aa('0x1a')](util['format'](_0xb9aa('0x21'),config[_0xb9aa('0x6')]['username'],config[_0xb9aa('0x6')]['ip'],config[_0xb9aa('0x6')][_0xb9aa('0x7')]));return Promise[_0xb9aa('0x22')]()[_0xb9aa('0x23')](ami[_0xb9aa('0x11')]())[_0xb9aa('0x23')](ami[_0xb9aa('0x13')]())['then'](ami[_0xb9aa('0x24')]())[_0xb9aa('0x23')](ami[_0xb9aa('0x16')]())[_0xb9aa('0x23')](ami[_0xb9aa('0x18')]())[_0xb9aa('0x25')](function(_0x530b44){logger[_0xb9aa('0xd')](_0xb9aa('0x26'),util['inspect'](_0x530b44,{'showHidden':![],'depth':null}));});});ami[_0xb9aa('0x1c')](_0xb9aa('0xd'),error);ami[_0xb9aa('0x1c')](_0xb9aa('0x1d'),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 c50a717..7221d00 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 _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xb7e7[_0x298ed3];return _0x5aad28;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 955419c..63a99f8 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 _0xa268=['dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','variables','trim','dialCutDigit','substring','SIP/%s/%s%s','dialPrefix','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialDropMaxRetry','[rescheduleContact][Abandoned]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','reason','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','loggedIn','predictiveIntervalPauses','busyFactor','erlangCallToSecond','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','scheduledat','voicePause','preview','unlockContact','outboundReCallsDay','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','getContactDialer','[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','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]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','erlangb','util','lodash','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','socket.io-emitter','redis','../rpc/cmHopper','../rpc/interval','./models/final','./models/hangup','env','XCALLY_IP_AGI','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','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','erlangBusyFactor','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaign','format','campaign:ivr:%s','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','ifTime','Failure','\x20Timezone\x20unknow\x20','length','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','push','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','syncCampaigns','undefined','isIVRCampaignActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Global:\x20','isGlobal','AMI\x20IfTime','syncAgentConnect','queue','uniqueid','type','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','countglobal','dialDropRetryFrequency','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialAbandonedMaxRetry','Abandoned','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','pick','idHopper','strategy','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','run','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','amdstatus','exten','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','dialAMDActive','MACHINE','Machine','countmachineretry','emit','custom:amd','[syncAgentComplete][createHistory][0]','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countcongestionretry','[rescheduleContact][Machine]','syncHangup','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','resolve','statusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','clearZombieChannels','[uniqueid]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','xcally-motion-dialer'];(function(_0x38224c,_0x1ff97b){var _0xba7c3d=function(_0x5c40e9){while(--_0x5c40e9){_0x38224c['push'](_0x38224c['shift']());}};_0xba7c3d(++_0x1ff97b);}(_0xa268,0xba));var _0x8a26=function(_0x59ae52,_0x3fc3e0){_0x59ae52=_0x59ae52-0x0;var _0x47daac=_0xa268[_0x59ae52];return _0x47daac;};'use strict';var util=require(_0x8a26('0x0'));var _=require(_0x8a26('0x1'));var uuid=require(_0x8a26('0x2'));var moment=require(_0x8a26('0x3'));var rr=require('rr');var Redis=require(_0x8a26('0x4'));var utils=require(_0x8a26('0x5'));var hopperUtils=require('./utils/hopper');var ut=require(_0x8a26('0x6'));var config=require(_0x8a26('0x7'));var logger=require(_0x8a26('0x8'))(_0x8a26('0x9'));var loggerBooked=require(_0x8a26('0x8'))(_0x8a26('0xa'));var loggerPredictive=require(_0x8a26('0x8'))(_0x8a26('0xb'));var loggerPredictiveCalls=require(_0x8a26('0x8'))(_0x8a26('0xc'));var loggerSyncQueueSummary=require(_0x8a26('0x8'))('syncQueueSummary');var ami=require(_0x8a26('0xd'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8a26('0xe'))(new Redis(config[_0x8a26('0xf')]));var cmHopper=require(_0x8a26('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0x8a26('0x11'));var Action=require('./models/action');var History=require('./models/history');var Final=require(_0x8a26('0x12'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x8a26('0x13'));var ipAgi=process[_0x8a26('0x14')][_0x8a26('0x15')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8a26('0x16')]['enqueue']=function(_0x2a2ae8){this[_0x8a26('0x17')]=this[_0x8a26('0x17')]?this[_0x8a26('0x17')][_0x8a26('0x18')](_0x2a2ae8):_0x2a2ae8();};function Dialer(_0xfa7cb2,_0x37f3a1){this[_0x8a26('0x19')]=new Sequence();this['preview']=_0x37f3a1;this[_0x8a26('0x1a')]=_0xfa7cb2['voiceQueues'];this[_0x8a26('0x1b')]=_0xfa7cb2[_0x8a26('0x1b')];this[_0x8a26('0x1c')]=_0xfa7cb2['agents'];this[_0x8a26('0x1d')]=_0xfa7cb2['trunks'];this['maxNumberOriginate']=config[_0x8a26('0x1e')]||0x2;this[_0x8a26('0x1f')]={};this[_0x8a26('0x20')]={};this['contactsId']={};this[_0x8a26('0x21')]={};this[_0x8a26('0x22')]={};this[_0x8a26('0x23')]={};this['startProgressive']={};this[_0x8a26('0x24')]={};this[_0x8a26('0x25')]={};this[_0x8a26('0x26')]={};this[_0x8a26('0x27')]={};ami['on'](_0x8a26('0x28'),this['syncAgentConnect'][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x2a'),this['syncQueueCallerAbandon'][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x2b'),this[_0x8a26('0x2c')]['bind'](this));ami['on'](_0x8a26('0x2d'),this[_0x8a26('0x2e')][_0x8a26('0x29')](this));ami['on']('custom:queuesummary',this[_0x8a26('0x2f')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x30'),this[_0x8a26('0x31')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x32'),this['syncHangup'][_0x8a26('0x29')](this));ami['on']('newexten',this[_0x8a26('0x33')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x34'),this[_0x8a26('0x35')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x36'),this[_0x8a26('0x37')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x8a26('0x38')]['bind'](this));this['loopCampaigns']();this[_0x8a26('0x39')]();RpcSetting['getSettings']()[_0x8a26('0x3a')](function(_0xf208f4){previewRecallmeReminderInterval=_0xf208f4[_0x8a26('0x3b')];});}function isNotNull(_0x5f33a3){return _0x5f33a3!==null&&!_[_0x8a26('0x3c')](_0x5f33a3);}function msgResponse(_0xc2426a,_0xad4894,_0x29091a){return{'action':_0xc2426a,'response':_0xad4894,'message':_0x29091a,'stack':_0x29091a};}function emit(_0x3a4d4d,_0x18f5a0,_0x3a9075){io['to'](_0x3a4d4d)['emit'](_0x18f5a0,_0x3a9075);}function emitOutboundVoiceQueueSummary(_0x5e081a){if(_0x5e081a['type']==='outbound'){logger[_0x8a26('0x3d')](_0x8a26('0x3e'),util[_0x8a26('0x3f')](_0x5e081a,{'showHidden':![],'depth':null}));emit(util['format'](_0x8a26('0x40'),_0x5e081a[_0x8a26('0x41')]),_0x8a26('0x42'),_0x5e081a);}}function checkGetDataPredictive(_0x2612e0){if(isNotNull(_0x2612e0)&&!_[_0x8a26('0x43')](_0x2612e0)){loggerPredictive['info'](_0x8a26('0x44'));loggerPredictive[_0x8a26('0x45')](_0x8a26('0x46'),_0x2612e0[_0x8a26('0x47')]);loggerPredictive[_0x8a26('0x45')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2612e0[_0x8a26('0x48')]);loggerPredictive[_0x8a26('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2612e0[_0x8a26('0x49')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4a'),_0x2612e0[_0x8a26('0x4b')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4c'),_0x2612e0[_0x8a26('0x4d')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2612e0[_0x8a26('0x4e')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4f'));if(_0x2612e0['predictiveIntervalTotalCalls']>0x0){if(!_[_0x8a26('0x3c')](_0x2612e0[_0x8a26('0x4e')])&&_0x2612e0['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x8a26('0x45')](_0x8a26('0x50'));if(!_['isUndefined'](_0x2612e0[_0x8a26('0x4d')])&&_0x2612e0[_0x8a26('0x4d')]>0x0){return!![];}loggerPredictive[_0x8a26('0x45')](_0x8a26('0x51'));}else{loggerPredictive[_0x8a26('0x45')](_0x8a26('0x52'));}}else{loggerPredictive[_0x8a26('0x45')](_0x8a26('0x53'));}return![];}function mergeDataErlangB(_0x4f765c){return function(_0x22a1f5){loggerPredictive[_0x8a26('0x45')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x8a26('0x45')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a1f5[_0x8a26('0x54')]);loggerPredictive[_0x8a26('0x45')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a1f5['erlangCallToSecond']);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x55'),_0x22a1f5[_0x8a26('0x56')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x57'),_0x22a1f5[_0x8a26('0x58')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a1f5['erlangAbandonmentRate']);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4f'));_[_0x8a26('0x59')](_0x4f765c,_0x22a1f5);};}function ifInterval(_0x3963cb,_0x4de069){if(_[_0x8a26('0x3c')](_0x4de069)){return![];}return utils[_0x8a26('0x5a')](undefined,_0x4de069)<_0x3963cb*0x3c;}function clearPredictiveAttributes(_0x4f3d2b){if(_0x4f3d2b[_0x8a26('0x5b')]){_0x4f3d2b[_0x8a26('0x5b')]=undefined;loggerPredictive[_0x8a26('0x3d')](_0x4f3d2b['name'],_0x8a26('0x5c'));}if(_0x4f3d2b[_0x8a26('0x23')]){_0x4f3d2b[_0x8a26('0x23')]=undefined;loggerPredictive[_0x8a26('0x3d')](_0x4f3d2b[_0x8a26('0x41')],'startPredictive\x20value\x20cleared');}if(_0x4f3d2b[_0x8a26('0x5d')]){clearInterval(_0x4f3d2b[_0x8a26('0x5d')]);_0x4f3d2b[_0x8a26('0x5d')]=undefined;loggerPredictive[_0x8a26('0x3d')](_0x4f3d2b[_0x8a26('0x41')],_0x8a26('0x5e'));}}function loggerCatchPredictive(_0xa57ba9,_0xa76319){return function(_0x29253c){loggerPredictive[_0x8a26('0x5f')](_0xa76319[_0x8a26('0x41')],_0xa57ba9);loggerPredictive[_0x8a26('0x5f')](_0x29253c[_0x8a26('0x60')]);clearPredictiveAttributes(_0xa76319);};}function loggerCatch(_0x430753){return function(_0x343715){logger[_0x8a26('0x5f')](_0x430753,util['inspect'](_0x343715,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x555c0f,_0x2c660f,_0x571cbf){return function(_0x45f5f0){utils[_0x8a26('0x61')](_0x2c660f,_0x571cbf,0x0);logger['error'](_0x555c0f,util[_0x8a26('0x3f')](_0x45f5f0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1234c8){return function(_0x16da99){if(isNotNull(_0x16da99)&&isNotNull(_0x16da99[0x0])){if(_0x16da99[0x0][_0x8a26('0x62')]>0x0){_0x1234c8['message']=utils[_0x8a26('0x63')][_0x8a26('0x64')];logger[_0x8a26('0x45')]('[getContactDialer2][ReScheduled]'+_0x1234c8[_0x8a26('0x41')],_0x16da99[0x0][_0x8a26('0x62')],_0x8a26('0x65'));}else{_0x1234c8[_0x8a26('0x66')]=utils['CAMPAIGN_STATUS'][_0x8a26('0x67')];logger[_0x8a26('0x45')](_0x8a26('0x68')+_0x1234c8[_0x8a26('0x41')]);}}};}function createObjHistory(_0x2a14f2,_0x1145c0,_0x30b235,_0x2240f5,_0x57e20e){_0x2a14f2[_0x8a26('0x66')]=_0x30b235;var _0x17a837=new Action(_0x2a14f2,_0x1145c0);var _0x103ab3=new History(_0x17a837);_0x103ab3[_0x8a26('0x69')]=_0x2240f5;_0x103ab3['statedesc']=_0x57e20e;_0x103ab3[_0x8a26('0x6a')]=_0x17a837[_0x8a26('0x6b')];return _0x103ab3;}function unlockQueueStatus(_0x13626c,_0x9cdbf8){setTimeout(function(){if(_[_0x8a26('0x3c')](_0x13626c[_0x8a26('0x6c')])){loggerBooked['error'](_0x8a26('0x6d'),_0x9cdbf8);}_0x13626c[_0x8a26('0x6c')]=!![];loggerBooked[_0x8a26('0x45')](_0x8a26('0x6e'),_0x9cdbf8,JSON[_0x8a26('0x6f')](_['pick'](_0x13626c,[_0x8a26('0x41'),_0x8a26('0x6c')])));},0x1f3);}function checkInterval(_0x4b5ce3){return function(){if(!isNotNull(_0x4b5ce3[_0x8a26('0x70')])){_0x4b5ce3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];throw _0x4b5ce3[_0x8a26('0x41')]+_0x8a26('0x72');}if(!isNotNull(_0x4b5ce3['Interval'][_0x8a26('0x73')])){_0x4b5ce3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];throw _0x4b5ce3[_0x8a26('0x41')]+_0x8a26('0x72');}if(!isNotNull(_[_0x8a26('0x43')](_0x4b5ce3[_0x8a26('0x70')]['Intervals']))){_0x4b5ce3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];throw _0x4b5ce3[_0x8a26('0x41')]+_0x8a26('0x72');}};}function checkIsIVRCampaignActive(_0x23871a){return function(){if(!utils['isIVRCampaignActive'](_0x23871a)){_0x23871a[_0x8a26('0x66')]=utils[_0x8a26('0x63')]['INACTIVE'];throw _0x23871a['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x275176){if(utils[_0x8a26('0x74')](_0x275176)){emit(util[_0x8a26('0x75')](_0x8a26('0x76'),_0x275176['name']),'campaign:save',_0x275176);}}function loggerCatchQueueSummary(_0x58d5b2,_0x3168c0){return function(_0x5c1715){clearPredictiveAttributes(_0x3168c0);emitCampaignSummary(_0x3168c0);loggerSyncQueueSummary[_0x8a26('0x3d')](_0x58d5b2,util['inspect'](_0x5c1715,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xdb669b){if(_0xdb669b[_0x8a26('0x77')]){if(_0xdb669b[_0x8a26('0x78')]===0x0){_0xdb669b['sendMessageOneNotActive']=![];_0xdb669b['message']=utils['CAMPAIGN_STATUS'][_0x8a26('0x79')];loggerSyncQueueSummary[_0x8a26('0x3d')](_0x8a26('0x7a'),_0xdb669b['name'],'is\x20not\x20active');}else{_0xdb669b['message']=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x8a26('0x3d')](_0x8a26('0x7a'),_0xdb669b['name'],_0x8a26('0x7b'));}emitCampaignSummary(_0xdb669b);}}function myreject(_0x4cb408){return function(_0x5252e7){return _0x4cb408(msgResponse(_0x8a26('0x7c'),_0x8a26('0x7d'),JSON['stringify'](_0x5252e7)));};}Dialer[_0x8a26('0x16')][_0x8a26('0x7e')]=function(_0x447e49){return!_[_0x8a26('0x3c')](_0x447e49)&&_0x447e49&&!_[_0x8a26('0x3c')](_0x447e49[_0x8a26('0x41')])&&!_[_0x8a26('0x3c')](_0x447e49[_0x8a26('0x7f')])&&_0x447e49[_0x8a26('0x7f')]&&(this[_0x8a26('0x1d')][util['format'](_0x8a26('0x80'),_0x447e49[_0x8a26('0x41')])][_0x8a26('0x81')]===_0x8a26('0x82')||this[_0x8a26('0x1d')][util[_0x8a26('0x75')](_0x8a26('0x80'),_0x447e49['name'])][_0x8a26('0x81')]===_0x8a26('0x83'));};Dialer[_0x8a26('0x16')][_0x8a26('0x84')]=function(_0xd22ea3){var _0xa24ed9=this;return function(){if(!_0xa24ed9['isTrunkReachable'](_0xd22ea3[_0x8a26('0x85')])){if(!_0xa24ed9['isTrunkReachable'](_0xd22ea3[_0x8a26('0x86')])){_0xd22ea3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x87')];throw _0xd22ea3[_0x8a26('0x41')]+_0x8a26('0x88');}}};};Dialer[_0x8a26('0x16')][_0x8a26('0x89')]=function(_0x3443ee,_0x231802,_0x2a2391,_0x23f6d8){var _0xcc3d57=this;return function(){var _0x1dff1d=!![];return _0xcc3d57[_0x8a26('0x8a')](_0x3443ee,_0x231802,_0x2a2391,_0x23f6d8,_0x1dff1d);};};Dialer[_0x8a26('0x16')]['checkIfTimeIntervals']=function(_0x2f95b4,_0x1c56a0,_0x2d34ec,_0x288c04){var _0x400e16=this;return function(){var _0xf68247=![];return _0x400e16[_0x8a26('0x8a')](_0x2f95b4[_0x8a26('0x73')],_0x1c56a0,_0x2d34ec,_0x288c04,_0xf68247);};};Dialer[_0x8a26('0x16')][_0x8a26('0x8a')]=function(_0x22f611,_0x3095e8,_0x15c599,_0x5b91bc,_0x19d636){var _0x79eb23=[];return new Promise(function(_0x28044f,_0x1ad1b2){if(!isNotNull(_0x22f611)){_0x5b91bc[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];return _0x1ad1b2(msgResponse('ifTime','Failure',_0x15c599+_0x8a26('0x8b')));}if(_[_0x8a26('0x43')](_0x22f611)){_0x5b91bc['message']=utils[_0x8a26('0x63')][_0x8a26('0x8c')];return _0x1ad1b2(msgResponse('ifTime','Failure',_0x15c599+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3095e8&&_[_0x8a26('0x3c')](config[_0x8a26('0x8d')][_0x3095e8])){_0x5b91bc['message']=utils[_0x8a26('0x63')][_0x8a26('0x8e')];return _0x1ad1b2(msgResponse(_0x8a26('0x8f'),_0x8a26('0x90'),_0x15c599+_0x8a26('0x91')+_0x3095e8));}if(_['isArray'](_0x22f611)){for(var _0x2fd6f0=0x0;_0x2fd6f0<_0x22f611[_0x8a26('0x92')];_0x2fd6f0+=0x1){_0x79eb23['push'](ami[_0x8a26('0x93')]({'action':_0x8a26('0x94'),'command':util[_0x8a26('0x75')](_0x8a26('0x95'),_0x22f611[_0x2fd6f0][_0x8a26('0x96')],!_[_0x8a26('0x3c')](config['timezones'][_0x3095e8])?_0x3095e8:'')})[_0x8a26('0x3a')](function(_0x3c73ca){return _0x3c73ca[_0x8a26('0x97')][_0x8a26('0x98')](_0x8a26('0x99'))>=0x0;})[_0x8a26('0x9a')](myreject(_0x1ad1b2)));}}else{_0x79eb23[_0x8a26('0x9b')](ami[_0x8a26('0x93')]({'action':_0x8a26('0x94'),'command':util[_0x8a26('0x75')]('iftime\x20%s,%s',_0x22f611,!_[_0x8a26('0x3c')](config[_0x8a26('0x8d')][_0x3095e8])?_0x3095e8:'')})[_0x8a26('0x3a')](function(_0x5085ad){return _0x5085ad[_0x8a26('0x97')]['indexOf']('true')>=0x0;})[_0x8a26('0x9a')](myreject(_0x1ad1b2)));}Promise[_0x8a26('0x9c')](_0x79eb23)[_0x8a26('0x3a')](function(_0x26a343){var _0x449d44=_[_0x8a26('0x9d')](_0x26a343);if(_0x449d44){return _0x28044f(_0x449d44);}else{_0x5b91bc['message']=_0x19d636?utils[_0x8a26('0x63')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x8a26('0x63')][_0x8a26('0x9e')];return _0x1ad1b2(msgResponse(_0x8a26('0x9f'),_0x8a26('0x90'),'Global:\x20'+_0x19d636+'\x20'+_0x15c599+_0x8a26('0xa0')+util['inspect'](_0x22f611,{'showHidden':![],'depth':null})+_0x8a26('0xa1')+_0x3095e8));}})[_0x8a26('0x9a')](function(_0x3caddb){return _0x1ad1b2(msgResponse(_0x8a26('0x8f'),'Failure',JSON[_0x8a26('0x6f')](_0x3caddb)));});});};Dialer['prototype'][_0x8a26('0xa2')]=function(){var _0x31ddcd=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x8a26('0x3a')](function(){setInterval(function(){_0x31ddcd[_0x8a26('0xa3')]();},0x3e8);});};Dialer[_0x8a26('0x16')][_0x8a26('0xa3')]=function(){var _0x538cb0=this;var _0xb52674;for(var _0xccb9bc in this[_0x8a26('0x1b')]){if(typeof this['campaigns'][_0xccb9bc]!==_0x8a26('0xa4')){_0xb52674=this['campaigns'][_0xccb9bc];if(utils['isIVRCampaign'](_0xb52674)&&utils[_0x8a26('0xa5')](_0xb52674)){_0xb52674['sendMessageOneNotActive']=!![];Promise['resolve']()[_0x8a26('0x3a')](checkIsIVRCampaignActive(_0xb52674))[_0x8a26('0x3a')](checkInterval(_0xb52674))['then'](_0x538cb0['checkIsTrunkReachable'](_0xb52674))[_0x8a26('0x3a')](_0x538cb0[_0x8a26('0x89')](_0xb52674[_0x8a26('0xa6')],_0xb52674[_0x8a26('0xa7')],_0xb52674[_0x8a26('0x41')],_0xb52674))[_0x8a26('0x3a')](_0x538cb0[_0x8a26('0xa8')](_0xb52674[_0x8a26('0x70')],_0xb52674[_0x8a26('0xa7')],_0xb52674[_0x8a26('0x41')],_0xb52674))[_0x8a26('0x3a')](_0x538cb0[_0x8a26('0xa9')](_0xb52674))[_0x8a26('0x9a')](loggerCatchQueueSummary('[syncCampaigns]',_0xb52674));}else{notSendMessagesCampaign(_0xb52674);}}}};Dialer['prototype'][_0x8a26('0xaa')]=function(_0x2464ec){if(_0x2464ec['dialMethod']!==_0x8a26('0xb')){clearPredictiveAttributes(_0x2464ec);}switch(_0x2464ec[_0x8a26('0xab')]){case'progressive':this[_0x8a26('0xac')](_0x2464ec,0x1);break;case _0x8a26('0xad'):this['handlePower'](_0x2464ec,_0x2464ec[_0x8a26('0xae')]);break;case _0x8a26('0xb'):this['predictive'](_0x2464ec);break;case _0x8a26('0xa'):this[_0x8a26('0xac')](_0x2464ec,0x1);break;default:logger['error']('Queue',_0x2464ec[_0x8a26('0x41')],_0x8a26('0xaf'));}};Dialer[_0x8a26('0x16')][_0x8a26('0x8f')]=function(_0x2687ec,_0x373472){var _0x2d9d30=_0x2687ec[_0x8a26('0xa7')];var _0x212f76=_0x373472?_0x2687ec[_0x8a26('0xa6')]:_0x2687ec['Interval']['Intervals'];logger[_0x8a26('0xb0')]('Dialer::ifTime()',_0x212f76,_0x2d9d30,_0x2687ec[_0x8a26('0x41')],util[_0x8a26('0x75')](_0x8a26('0xb1'),_0x2687ec[_0x8a26('0x41')],_0x2687ec['id']));var _0x22c2fc=null;return Interval[_0x8a26('0xb2')](_0x212f76,_0x2d9d30)[_0x8a26('0x3a')](function(_0x5a1859){if(_0x5a1859===!![]){return _0x5a1859;}else{_0x2687ec[_0x8a26('0x66')]=_0x373472?utils[_0x8a26('0x63')][_0x8a26('0xb3')]:utils[_0x8a26('0x63')][_0x8a26('0x9e')];_0x22c2fc=msgResponse(_0x8a26('0x9f'),_0x8a26('0x90'),_0x8a26('0xb4')+_0x373472+'\x20'+_0x2687ec['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x8a26('0x3f')](_0x212f76,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2d9d30);}if(_0x22c2fc!==null){logger[_0x8a26('0xb0')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x22c2fc);_0x22c2fc[_0x8a26('0xb5')]=_0x373472;throw _0x22c2fc;}})[_0x8a26('0x9a')](function(_0x278e1e){logger['error'](_0x8a26('0xb6'),_0x278e1e);throw msgResponse(_0x8a26('0x7c'),_0x8a26('0x7d'),util[_0x8a26('0x3f')](_0x278e1e,{'showHidden':![],'depth':null}));});};Dialer[_0x8a26('0x16')][_0x8a26('0xb7')]=function(_0x20c134){if(this[_0x8a26('0x1a')][_0x20c134[_0x8a26('0xb8')]]){if(this[_0x8a26('0x21')][_0x20c134[_0x8a26('0xb9')]]&&this[_0x8a26('0x21')][_0x20c134['uniqueid']][_0x8a26('0xba')]!=='ivr'){this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x20c134[_0x8a26('0xb8')]]);this['uniqueId'][_0x20c134[_0x8a26('0xb9')]][_0x8a26('0xbc')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));}}};Dialer[_0x8a26('0x16')][_0x8a26('0x2e')]=function(_0x2a030e){var _0x308041=this[_0x8a26('0x21')][_0x2a030e['uniqueid']];if(this[_0x8a26('0x1a')][_0x2a030e[_0x8a26('0xb8')]]){if(_0x308041&&_0x308041['type']!==_0x8a26('0xbe')){delete this[_0x8a26('0x21')][_0x2a030e[_0x8a26('0xb9')]];this[_0x8a26('0x1a')][_0x2a030e[_0x8a26('0xb8')]][_0x8a26('0xbf')]+=0x1;var _0x536db9=new AgentComplete(_0x308041,_0x2a030e);if(_0x2a030e['reason']==='agent'){_0x536db9[_0x8a26('0xc0')]=this['voiceQueues'][_0x2a030e[_0x8a26('0xb8')]][_0x8a26('0xc1')]&&this[_0x8a26('0x1a')][_0x2a030e[_0x8a26('0xb8')]][_0x8a26('0xc2')]?moment()[_0x8a26('0x75')](_0x8a26('0xbd')):undefined;}hopperUtils[_0x8a26('0xc3')](_0x536db9)['catch'](loggerCatch(_0x8a26('0xc4')));hopperUtils[_0x8a26('0xc5')](_0x536db9)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0xc6')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x2bc9a3){var _0x4096e3=this[_0x8a26('0x21')][_0x2bc9a3[_0x8a26('0xb9')]];var _0x591158=this;var _0x46e887=![];var _0x15c29f;var _0x5281b0;if(this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]){if(_0x4096e3&&_0x4096e3[_0x8a26('0xba')]!==_0x8a26('0xbe')){delete this[_0x8a26('0x21')][_0x2bc9a3[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]);_0x4096e3[_0x8a26('0xc7')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));var _0x123cb2=new QueueCallerAbandon(_0x4096e3,_0x2bc9a3);if(utils[_0x8a26('0x5a')](_0x4096e3[_0x8a26('0xc7')],_0x4096e3[_0x8a26('0xc8')])>=_0x4096e3[_0x8a26('0xc9')]){this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0x49')]+=0x1;this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xca')]+=0x1;this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xcb')]+=0x1;_0x123cb2[_0x8a26('0x69')]=0xa;_0x123cb2[_0x8a26('0xcc')]=_0x8a26('0xcd');_0x123cb2[_0x8a26('0xce')]=_0x8a26('0xcf');_0x123cb2[_0x8a26('0xc0')]=this['voiceQueues'][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xc1')]?moment()[_0x8a26('0x75')](_0x8a26('0xbd')):undefined;_0x123cb2['countdropretry']+=0x1;_0x123cb2[_0x8a26('0xd0')]+=0x1;_0x15c29f=this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xd1')];_0x5281b0=this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x123cb2,_0x123cb2[_0x8a26('0x69')],_0x4096e3[_0x8a26('0xd2')])['then'](function(_0x13a08d){_0x46e887=_0x13a08d[_0x8a26('0xd3')]==0x1;if(_0x123cb2['countdropretry']>=_0x591158[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]['dialDropMaxRetry']){_0x591158[_0x8a26('0xd4')](_0x123cb2,_0x13a08d[_0x8a26('0xd3')]);}else{hopperUtils[_0x8a26('0xd5')]({'active':![],'countdropretry':_0x123cb2['countdropretry'],'scheduledat':moment()[_0x8a26('0xd6')](_0x591158['voiceQueues'][_0x2bc9a3['queue']][_0x8a26('0xd1')],_0x8a26('0xd7'))['format'](_0x8a26('0xbd')),'ContactId':_0x4096e3[_0x8a26('0xd8')],'ListId':_0x4096e3[_0x8a26('0xd9')],'VoiceQueueId':_0x4096e3[_0x8a26('0xda')]||undefined,'CampaignId':_0x4096e3[_0x8a26('0xdb')]||undefined})['catch'](loggerCatch(_0x8a26('0xdc')));var _0x4d7097=new History(_0x123cb2);_0x4d7097[_0x8a26('0x69')]=0xa;_0x4d7097['statedesc']='Drop';_0x4d7097[_0x8a26('0x6b')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));_0x4d7097['endtime']=_0x4d7097[_0x8a26('0x6b')];_0x4d7097[_0x8a26('0xdd')]=_0x123cb2[_0x8a26('0xdd')];_0x4d7097[_0x8a26('0xde')]=_0x123cb2['calleridnum'];hopperUtils[_0x8a26('0xc3')](_0x4d7097)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0xdf')));}})[_0x8a26('0x3a')](function(){if(_0x46e887)hopperUtils[_0x8a26('0xe0')](_0x123cb2,_0x15c29f,_0x5281b0)[_0x8a26('0x3a')](function(){return 0x1;});});}else{this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0x4b')]+=0x1;this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe1')]+=0x1;_0x123cb2[_0x8a26('0x69')]=0xb;_0x123cb2[_0x8a26('0xcc')]='Abandoned';_0x123cb2[_0x8a26('0xce')]=_0x8a26('0xe2');_0x123cb2[_0x8a26('0xe3')]+=0x1;_0x123cb2[_0x8a26('0xd0')]+=0x1;_0x15c29f=this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe4')];_0x5281b0=this['voiceQueues'][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe5')];hopperUtils[_0x8a26('0xe6')](_0x123cb2,_0x123cb2['state'],_0x4096e3['voiceQueue'])[_0x8a26('0x3a')](function(_0x3f60fc){if(_0x123cb2['countabandonedretry']>=_0x591158[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe7')]){_0x591158['queueCallerAbandonCreateState'](_0x123cb2,_0x3f60fc[_0x8a26('0xd3')]);}else{hopperUtils[_0x8a26('0xd5')]({'active':![],'countabandonedretry':_0x123cb2[_0x8a26('0xe3')],'scheduledat':moment()[_0x8a26('0xd6')](_0x591158[_0x8a26('0x1a')][_0x2bc9a3['queue']][_0x8a26('0xe4')],'minutes')[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x4096e3[_0x8a26('0xd8')],'ListId':_0x4096e3['ListId'],'VoiceQueueId':_0x4096e3['VoiceQueueId']||undefined,'CampaignId':_0x4096e3[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x329caf=new History(_0x123cb2);_0x329caf[_0x8a26('0x69')]=0xb;_0x329caf[_0x8a26('0xcc')]=_0x8a26('0xe8');_0x329caf[_0x8a26('0x6b')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));_0x329caf[_0x8a26('0x6a')]=_0x329caf[_0x8a26('0x6b')];_0x329caf[_0x8a26('0xdd')]=_0x123cb2[_0x8a26('0xdd')];_0x329caf['calleridnum']=_0x123cb2[_0x8a26('0xde')];hopperUtils[_0x8a26('0xc3')](_0x329caf)[_0x8a26('0x9a')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x8a26('0x3a')](function(){if(_0x46e887)hopperUtils[_0x8a26('0xe0')](_0x123cb2,_0x15c29f,_0x5281b0)['then'](function(){return 0x1;});});}}}};Dialer[_0x8a26('0x16')]['syncNewExten']=function(_0x16a2c0){if(this[_0x8a26('0x20')][_0x16a2c0[_0x8a26('0xb9')]]){this[_0x8a26('0x20')][_0x16a2c0[_0x8a26('0xb9')]][_0x8a26('0xe9')]=_0x16a2c0[_0x8a26('0xe9')];}if(this[_0x8a26('0x21')][_0x16a2c0['uniqueid']]){this['uniqueId'][_0x16a2c0[_0x8a26('0xb9')]][_0x8a26('0xe9')]=_0x16a2c0[_0x8a26('0xe9')];}};Dialer[_0x8a26('0x16')][_0x8a26('0x37')]=function(_0x5eee40){if(!this['actions'][_0x5eee40[_0x8a26('0xea')]]){return;}var _0x44aa27=this[_0x8a26('0x1a')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xb8')]]['strategy']||_0x8a26('0xeb');if(_0x44aa27===_0x8a26('0xec')){if(this['actions'][_0x5eee40[_0x8a26('0xea')]]&&_[_0x8a26('0xed')](this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xee')])&&_0x5eee40[_0x8a26('0x81')]==='1'&&_0x5eee40[_0x8a26('0xef')]==='0'){if(this[_0x8a26('0x1c')][_0x5eee40[_0x8a26('0xf0')]]){if(!this[_0x8a26('0x1c')][_0x5eee40[_0x8a26('0xf0')]][_0x8a26('0xee')]){this['agents'][_0x5eee40['stateinterface']]['locked']=!![];this[_0x8a26('0x20')][_0x5eee40['actionid']][_0x8a26('0xee')]=!![];this[_0x8a26('0x20')][_0x5eee40['actionid']][_0x8a26('0xf0')]=_0x5eee40['stateinterface'];}}}}else if(_0x44aa27==='rrmemory'){if(this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]]){if(this[_0x8a26('0x1c')][_0x5eee40['stateinterface']]){this[_0x8a26('0x20')][_0x5eee40['actionid']][_0x8a26('0xf0')]=_0x5eee40[_0x8a26('0xf0')];if(_[_0x8a26('0xed')](this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]]['queue']])){this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xb8')]]=[];}this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xb8')]][_0x8a26('0x9b')](_[_0x8a26('0x59')](_[_0x8a26('0xf1')](this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]],[_0x8a26('0xf2'),_0x8a26('0xf0')]),{'status':_0x5eee40[_0x8a26('0x81')],'paused':_0x5eee40[_0x8a26('0xef')]}));}}}};Dialer[_0x8a26('0x16')][_0x8a26('0x38')]=function(_0x30f7a2){if(!this[_0x8a26('0x20')][_0x30f7a2['actionid']]){return;}var _0x1b87ab=this;var _0x1734af=this['voiceQueues'][this[_0x8a26('0x20')][_0x30f7a2['actionid']][_0x8a26('0xb8')]];var _0x46a231=_0x1734af[_0x8a26('0xf3')]||_0x8a26('0xeb');if(_0x46a231===_0x8a26('0xec')){if(this[_0x8a26('0x20')][_0x30f7a2['actionid']]&&this[_0x8a26('0x20')][_0x30f7a2['actionid']]['stateinterface']){this['preview']['run'](this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['idHopper'],this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xf0')])[_0x8a26('0x9a')](function(_0x2ee8c4){logger[_0x8a26('0x5f')](_0x8a26('0xf4'),util['inspect'](_0x2ee8c4,{'showHidden':![],'depth':null}));})[_0x8a26('0x18')](function(){_0x1b87ab[_0x8a26('0xbb')](_0x1b87ab['voiceQueues'][_0x1b87ab['actions'][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]);_0x1b87ab['agents'][_0x1b87ab[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xf0')]][_0x8a26('0xee')]=![];delete _0x1b87ab[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]];unlockQueueStatus(_0x1734af);});}else{this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]);hopperUtils[_0x8a26('0xd5')]({'active':![],'ContactId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['ContactId'],'ListId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xd9')],'VoiceQueueId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xda')]||undefined,'CampaignId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]];unlockQueueStatus(_0x1734af);}}else if(_0x46a231==='rrmemory'){var _0x43e812;if(this['actions'][_0x30f7a2[_0x8a26('0xea')]]&&!_['isEmpty'](this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x30f7a2['actionid']][_0x8a26('0xb8')]])){if(this[_0x8a26('0x26')][_0x1b87ab['actions'][_0x30f7a2['actionid']][_0x8a26('0xb8')]]){this['queueBookedRR'][_0x1b87ab[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['queue']]=this['queueBookedRR'][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]?this[_0x8a26('0x26')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['queue']]:this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]?this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['queue']][_0x8a26('0xf5')]||0x0:0x0;}this['queueBooked'][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]][_0x8a26('0xf5')]=this[_0x8a26('0x26')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]];for(var _0x87b325=0x0;_0x87b325=_0x592fa2[_0x8a26('0x11b')]){_0x2b6c21[_0x8a26('0x11c')](_0x3ac77f,_0x5a1966,_0x14c684,_0x8a26('0x11d'));}else{if(_0x3ac77f[_0x8a26('0x113')]>=_0x592fa2[_0x8a26('0x11e')]){_0x2b6c21[_0x8a26('0x11f')](_0x3ac77f,_0x5a1966,_0x14c684,_0x8a26('0x120'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3ac77f[_0x8a26('0x113')],'scheduledat':moment()[_0x8a26('0xd6')](_0x592fa2[_0x8a26('0x121')],_0x8a26('0xd7'))[_0x8a26('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ac77f[_0x8a26('0xd8')],'ListId':_0x3ac77f['ListId'],'VoiceQueueId':_0x3ac77f[_0x8a26('0xda')]||undefined,'CampaignId':_0x3ac77f[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Machine]'));_0x5a1966({'reschedule':0x1});}}});}if(_0x58039f[_0x8a26('0xba')]===_0x8a26('0xbe')&&this[_0x8a26('0x1b')][_0x58039f['queue']][_0x8a26('0x110')]&&_0x467d3c['value']===_0x8a26('0x108')){delete this[_0x8a26('0x21')][_0x467d3c[_0x8a26('0xb9')]];this['updateOriginated'](this[_0x8a26('0x1b')][_0x58039f[_0x8a26('0xb8')]]);_0x5a5e05=new Hangup(_0x58039f,_0x467d3c);_0x5a5e05[_0x8a26('0x69')]=0x12;_0x5a5e05['statedesc']=_0x8a26('0x10a');_0x5a5e05['membername']=_0x8a26('0x10c');ami[_0x8a26('0x114')](_0x8a26('0x115'),ut[_0x8a26('0x10d')](_0x5a5e05,_0x8a26('0x10e')));this['saveInDb'](_0x5a5e05,_0x8a26('0x122'),_0x8a26('0x123'));}if(_0x58039f[_0x8a26('0xba')]===_0x8a26('0xbe')&&this['campaigns'][_0x58039f[_0x8a26('0xb8')]][_0x8a26('0x110')]&&_0x467d3c[_0x8a26('0x107')]===_0x8a26('0x111')){return new Promise(function(_0x17080e,_0x26615e){delete _0x2b6c21[_0x8a26('0x21')][_0x467d3c[_0x8a26('0xb9')]];_0x2b6c21[_0x8a26('0xbb')](_0x2b6c21['campaigns'][_0x58039f[_0x8a26('0xb8')]]);_0x2b6c21[_0x8a26('0x1b')][_0x58039f[_0x8a26('0xb8')]][_0x8a26('0xbf')]+=0x1;_0x2b6c21['campaigns'][_0x58039f['queue']][_0x8a26('0x109')]+=0x1;var _0x28fbe2=_0x2b6c21[_0x8a26('0x1b')][_0x58039f[_0x8a26('0xb8')]];var _0x3871a1=new Hangup(_0x58039f,_0x467d3c);_0x3871a1['state']=0x13;_0x3871a1['statedesc']=_0x8a26('0x112');_0x3871a1['membername']='AMD';_0x3871a1[_0x8a26('0x113')]+=0x1;_0x3871a1[_0x8a26('0xd0')]+=0x1;_0x3871a1[_0x8a26('0x10e')]=!![];ami[_0x8a26('0x114')](_0x8a26('0x115'),ut[_0x8a26('0x10d')](_0x3871a1,_0x8a26('0x10e')));hopperUtils[_0x8a26('0xc3')](_0x3871a1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3871a1[_0x8a26('0x124')]+_0x3871a1[_0x8a26('0x125')]+_0x3871a1[_0x8a26('0x117')]+_0x3871a1[_0x8a26('0x118')]+_0x3871a1[_0x8a26('0x119')]+_0x3871a1['countabandonedretry']+_0x3871a1['countmachineretry']+_0x3871a1[_0x8a26('0x11a')]>=_0x28fbe2[_0x8a26('0x11b')]){_0x2b6c21[_0x8a26('0x11c')](_0x3871a1,_0x17080e,_0x26615e,_0x8a26('0x11d'));}else{if(_0x3871a1[_0x8a26('0x113')]>=_0x28fbe2['dialMachineMaxRetry']){_0x2b6c21[_0x8a26('0x11f')](_0x3871a1,_0x17080e,_0x26615e,_0x8a26('0x120'));}else{hopperUtils[_0x8a26('0xd5')]({'active':![],'countmachineretry':_0x3871a1[_0x8a26('0x113')],'scheduledat':moment()[_0x8a26('0xd6')](_0x28fbe2['dialMachineRetryFrequency'],_0x8a26('0xd7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3871a1['ContactId'],'ListId':_0x3871a1[_0x8a26('0xd9')],'VoiceQueueId':_0x3871a1[_0x8a26('0xda')]||undefined,'CampaignId':_0x3871a1['CampaignId']||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x126')));_0x17080e({'reschedule':0x1});}}});}}};Dialer[_0x8a26('0x16')][_0x8a26('0x127')]=function(_0x5b6393){var _0x2adffe=this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];var _0x5a635c;if(_0x2adffe&&_0x2adffe['type']==='ivr'){delete this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1b')][_0x2adffe[_0x8a26('0xb8')]]);this[_0x8a26('0x1b')][_0x2adffe[_0x8a26('0xb8')]]['ivrAnswerCallsDay']+=0x1;_0x5a635c=new Hangup(_0x2adffe,_0x5b6393);hopperUtils['createHistory'](_0x5a635c)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x128')));}if(_0x2adffe&&_0x2adffe['type']!==_0x8a26('0xbe')&&isNotNull(this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]['dialQueueProject'])){delete this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]);this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]][_0x8a26('0xbf')]+=0x1;this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]][_0x8a26('0x109')]+=0x1;_0x5a635c=new Hangup(_0x2adffe,_0x5b6393);_0x5a635c[_0x8a26('0x69')]=0x10;_0x5a635c[_0x8a26('0xcc')]=_0x8a26('0x129');_0x5a635c[_0x8a26('0x10b')]=_0x8a26('0x12a');hopperUtils['createHistory'](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x12b')));hopperUtils[_0x8a26('0xc5')](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x128')));}if(_0x2adffe&&_0x2adffe['type']!=='ivr'&&!isNotNull(this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]][_0x8a26('0x12c')])){delete this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]);this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]['outboundUnknownCallsDay']+=0x1;_0x5a635c=new Hangup(_0x2adffe,_0x5b6393);_0x5a635c['state']=0xc;_0x5a635c[_0x8a26('0xcc')]=_0x5b6393[_0x8a26('0x12d')];_0x5a635c[_0x8a26('0x10b')]=_0x8a26('0x12e');hopperUtils[_0x8a26('0xc3')](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x12b')));hopperUtils[_0x8a26('0xc5')](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x128')));}};Dialer[_0x8a26('0x16')][_0x8a26('0x2f')]=function(_0x55c65d){var _0x4d17ce=this;if(!_0x4d17ce[_0x8a26('0x27')][_0x55c65d['name']]){_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]]={'running':![]};}else if(_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]][_0x8a26('0x12f')]===!![]){return;}else if(_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]][_0x8a26('0x12f')]===![]){_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]][_0x8a26('0x12f')]=!![];}var _0x278404=_0x4d17ce[_0x8a26('0x1a')][_0x55c65d[_0x8a26('0x41')]];var _0x3b9264=_0x278404[_0x8a26('0x66')]!==utils[_0x8a26('0x63')]['INACTIVE'];var _0x1d1e99=utils[_0x8a26('0x130')](_0x278404);_0x278404['statusMessage']=utils[_0x8a26('0x131')](_0x278404,_0x4d17ce['trunks']);Promise[_0x8a26('0x132')]()['then'](function(){if(_0x278404[_0x8a26('0x133')]===utils[_0x8a26('0x63')][_0x8a26('0x79')]){if(_0x3b9264){clearPredictiveAttributes(_0x278404);_0x55c65d['startPredictive']=undefined;_0x55c65d['startProgressive']=undefined;}if(_0x278404[_0x8a26('0x133')]===utils['CAMPAIGN_STATUS']['INACTIVE']){_0x55c65d[_0x8a26('0x134')]=0x0;_0x55c65d['paused']=0x0;_0x55c65d[_0x8a26('0x135')]=0x0;_0x55c65d[_0x8a26('0x136')]=0x0;_0x55c65d[_0x8a26('0x137')]=0x0;}}else if(_0x278404['statusMessage']===utils[_0x8a26('0x63')][_0x8a26('0x138')]&&!_0x1d1e99){return _0x4d17ce[_0x8a26('0x8f')](_0x278404,!![])['then'](function(){return _0x4d17ce[_0x8a26('0x8f')](_0x278404,![]);})[_0x8a26('0x3a')](function(){return _0x4d17ce[_0x8a26('0xaa')](_0x278404);})['catch'](function(_0x2b22d9){loggerSyncQueueSummary[_0x8a26('0x3d')](_0x8a26('0x139'),util['inspect'](_0x2b22d9,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x278404);});}else{clearPredictiveAttributes(_0x278404);}})['then'](function(){var _0x3d6489=_0x55c65d[_0x8a26('0x13a')](_0x278404);if(_0x3d6489||_0x278404[_0x8a26('0x13b')]){_0x278404[_0x8a26('0x13b')]=![];_0x55c65d[_0x8a26('0x13c')](_0x278404);Object[_0x8a26('0x13d')](_0x278404,_0x55c65d);emitOutboundVoiceQueueSummary(_0x55c65d);}_0x4d17ce['queuesSummary'][_0x278404[_0x8a26('0x41')]][_0x8a26('0x12f')]=![];})[_0x8a26('0x9a')](function(_0x13a66d){logger[_0x8a26('0x5f')](_0x8a26('0x139'),util['inspect'](_0x13a66d,{'showHidden':![],'depth':null}));_0x4d17ce[_0x8a26('0x27')][_0x278404['name']][_0x8a26('0x12f')]=![];});};Dialer['prototype'][_0x8a26('0x31')]=_[_0x8a26('0x13e')](function(){var _0x20e1bc=_[_0x8a26('0x13f')](this['voiceQueues'],function(_0x1f83ea){return _0x1f83ea[_0x8a26('0x140')];});var _0x322396=_['filter'](this['agents'],function(_0x46a900){return _0x46a900[_0x8a26('0x141')]&&_0x46a900['status']===_0x8a26('0x82');});if(_0x20e1bc[_0x8a26('0x92')]>0x0&&_0x322396[_0x8a26('0x92')]>0x0){return Promise[_0x8a26('0x132')]()[_0x8a26('0x3a')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x20e1bc,'id'),previewRecallmeReminderInterval,_[_0x8a26('0x142')](_0x322396,'id')))[_0x8a26('0x3a')](function(_0x38c4c7){for(var _0xaccddd=0x0;_0xaccddd<_0x38c4c7['length'];_0xaccddd++){var _0x357615=_0x38c4c7[_0xaccddd][_0x8a26('0x143')][_0x8a26('0x41')];if(_0x357615)io['to'](util[_0x8a26('0x75')](_0x8a26('0x144'),_0x357615))[_0x8a26('0x114')]('user:dialPreviewRecallReminder',{'hopper':_0x38c4c7[_0xaccddd]});}})['catch'](function(_0x21f46d){logger['error']('checkPreviewRecallReminder',_0x21f46d);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8a26('0x16')]['loopClearZombieChannels']=function(){var _0x18f4b9=this;setInterval(function(){_0x18f4b9[_0x8a26('0x145')](_0x18f4b9[_0x8a26('0x21')],_0x8a26('0x146'));_0x18f4b9['clearZombieChannels'](_0x18f4b9[_0x8a26('0x20')],'[actions]');},0x32c8);};Dialer[_0x8a26('0x16')]['clearZombieChannels']=function(_0x4675d7,_0x30d53c){var _0x199904=this;for(var _0x8658b in _0x4675d7){if(typeof _0x4675d7[_0x8658b]!==_0x8a26('0xa4')){this['sequence'][_0x8a26('0x147')](function(){if(!_[_0x8a26('0xed')](_0x4675d7[_0x8658b])){return ami[_0x8a26('0x93')]({'action':_0x8a26('0x81'),'channel':_0x4675d7[_0x8658b][_0x8a26('0xe9')]})[_0x8a26('0x9a')](function(_0x1f54b3){if(_0x1f54b3['message']===_0x8a26('0x148')){setTimeout(function(){if(_0x4675d7[_0x8658b]&&_0x4675d7[_0x8658b][_0x8a26('0xba')]!==_0x8a26('0xbe')){_0x199904[_0x8a26('0xbb')](_0x199904['voiceQueues'][_0x4675d7[_0x8658b]['queue']]);logger[_0x8a26('0x5f')](_0x8a26('0x149'),_0x30d53c,_0x8658b,_0x4675d7[_0x8658b][_0x8a26('0xb8')]);delete _0x4675d7[_0x8658b];}if(_0x4675d7[_0x8658b]&&_0x4675d7[_0x8658b][_0x8a26('0xba')]===_0x8a26('0xbe')){_0x199904[_0x8a26('0xbb')](_0x199904['campaigns'][_0x4675d7[_0x8658b]['queue']]);logger[_0x8a26('0x5f')](_0x8a26('0x14a'),_0x30d53c,_0x8658b,_0x4675d7[_0x8658b]['queue']);delete _0x4675d7[_0x8658b];}},0x2328);}});}});}}};Dialer[_0x8a26('0x16')][_0x8a26('0x14b')]=function(_0x396479){return Promise[_0x8a26('0x132')]()[_0x8a26('0x3a')](voiceQueueRt[_0x8a26('0x14b')](_0x396479))[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x14c')));};Dialer['prototype'][_0x8a26('0xbb')]=function(_0x4f5299){if(!_[_0x8a26('0x3c')](_0x4f5299)&&_0x4f5299!==null){if(typeof _0x4f5299[_0x8a26('0x78')]!==_0x8a26('0xa4')){if(_0x4f5299[_0x8a26('0x78')]>0x0){_0x4f5299[_0x8a26('0x78')]-=0x1;}else{logger[_0x8a26('0x5f')](_0x8a26('0x14d'));}}}else{logger['error'](_0x8a26('0x14e'));}};Dialer[_0x8a26('0x16')]['loggerHandler']=function(_0x3fcf0d,_0x32b6ea){var _0x2eb788=this;return function(_0x78450e){_0x2eb788[_0x8a26('0xbb')](_0x32b6ea);logger[_0x8a26('0x5f')](_0x3fcf0d,util[_0x8a26('0x3f')](_0x78450e,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x8a26('0x14f')]=function(_0x2a489,_0x431ca4,_0x5155ef){var _0x2913ff={'state':0x19,'statedesc':_0x8a26('0x150')};this[_0x8a26('0xbb')](_0x431ca4);this['saveInDb'](_['merge'](_0x2913ff,_['pick'](_0x5155ef,[_0x8a26('0xd8'),_0x8a26('0xd9'),_0x8a26('0x151'),_0x8a26('0xda'),_0x8a26('0xdb')])),_0x8a26('0x152'),_0x8a26('0x153'));logger[_0x8a26('0x5f')](_0x2a489);};Dialer['prototype'][_0x8a26('0x10f')]=function(_0x313e70,_0x5316c8,_0x12291a){hopperUtils[_0x8a26('0xc3')](_0x313e70)['catch'](loggerCatch(_0x5316c8));hopperUtils['moveContactManagedDialer'](_0x313e70)['catch'](loggerCatch(_0x12291a));};Dialer[_0x8a26('0x16')][_0x8a26('0xd4')]=function(_0x2fce6c,_0x27f966){hopperUtils['createHistory'](_0x2fce6c)[_0x8a26('0x9a')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x27f966==0x0){hopperUtils[_0x8a26('0xc5')](_0x2fce6c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x154')));}};Dialer[_0x8a26('0x16')][_0x8a26('0x155')]=function(_0x523f17){return Promise[_0x8a26('0x132')]()[_0x8a26('0x3a')](cmHopper['handlePreviewRecallNotifications'](_0x523f17['id'],previewRecallmeReminderInterval))[_0x8a26('0x3a')](function(_0x13079c){for(var _0x109885=0x0;_0x109885<_0x13079c[_0x8a26('0x92')];_0x109885++){var _0x2a9696=_0x13079c[_0x109885]['Agent']['name'];if(_0x2a9696)io['to'](util[_0x8a26('0x75')]('user:%s',_0x2a9696))[_0x8a26('0x114')](_0x8a26('0x156'),{'hopper':_0x13079c[_0x109885]});}})[_0x8a26('0x9a')](function(){});};Dialer[_0x8a26('0x16')]['launchHandleIvr']=function(_0x1a094a){var _0xc8772b=this;return function(){_0xc8772b[_0x8a26('0x157')](_0x1a094a);};};Dialer[_0x8a26('0x16')][_0x8a26('0x158')]=function(_0x2c2054,_0x384d81){var _0x1f8de0=this;var _0x2bebdb=uuid['v4']();this[_0x8a26('0x20')][_0x2bebdb]=new Action(_0x2c2054,_0x384d81,_0x2bebdb);return new Promise(function(_0x4482c8,_0x298f70){if(_[_0x8a26('0x3c')](_0x2c2054)&&typeof _0x2c2054!==_0x8a26('0x159')){return _0x298f70(msgResponse(_0x8a26('0x15a'),'Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x384d81[_0x8a26('0x15b')])||_0x384d81[_0x8a26('0x15b')]===null){return _0x298f70(msgResponse(_0x8a26('0x15a'),'Failure',_0x8a26('0x15c')));}var _0x29a17f={'XMD-CALLERID':_0x1f8de0[_0x8a26('0x20')][_0x2bebdb][_0x8a26('0x15d')](),'XMD-AGI':_0x2c2054['dialQueueProject']?util['format'](_0x8a26('0x15e'),ipAgi,_0x2c2054[_0x8a26('0x12c')]):_0x8a26('0x15f'),'XMD-AGIAFTER':_0x2c2054[_0x8a26('0xc1')]?util[_0x8a26('0x75')](_0x8a26('0x15e'),ipAgi,_0x2c2054['dialQueueProject2']):_0x8a26('0x15f'),'XMD-QUEUE':utils[_0x8a26('0x160')](_0x2c2054)?util[_0x8a26('0x75')]('\x22%s,%s%s,,,%s\x22',_0x2c2054[_0x8a26('0x41')],_0x2c2054[_0x8a26('0x161')]||'',_0x2c2054[_0x8a26('0xc2')]?'c':'',_0x2c2054['dialQueueTimeout']||0x3):_0x8a26('0x15f'),'XMD-CONTACTID':_0x384d81[_0x8a26('0xd8')],'XMD-CDRTYPE':_0x8a26('0x9'),'CALLERID(all)':_0x1f8de0[_0x8a26('0x20')][_0x2bebdb][_0x8a26('0x15d')](),'XMD-AMD':_0x2c2054[_0x8a26('0x110')]?_0x8a26('0x138'):_0x8a26('0x15f'),'XMD-DESTINATION':_0x8a26('0x162')};if(_0x2c2054[_0x8a26('0x110')]){_0x29a17f['XMD-AMDINITIALSILENCE']=_0x2c2054[_0x8a26('0x163')]||0x9c4;_0x29a17f[_0x8a26('0x164')]=_0x2c2054[_0x8a26('0x165')]||0x5dc;_0x29a17f[_0x8a26('0x166')]=_0x2c2054[_0x8a26('0x167')]||0x320;_0x29a17f[_0x8a26('0x168')]=_0x2c2054[_0x8a26('0x169')]||0x1388;_0x29a17f[_0x8a26('0x16a')]=_0x2c2054['dialAMDMinWordLength']||0x64;_0x29a17f['XMD-AMDBETWEENWORDSSILENCE']=_0x2c2054[_0x8a26('0x16b')]||0x32;_0x29a17f[_0x8a26('0x16c')]=_0x2c2054[_0x8a26('0x16d')]||0x3;_0x29a17f[_0x8a26('0x16e')]=_0x2c2054[_0x8a26('0x16f')]||0x100;_0x29a17f[_0x8a26('0x170')]=_0x2c2054[_0x8a26('0x171')]||0x1388;}if(utils[_0x8a26('0x160')](_0x2c2054)){_0x29a17f['XMD-VOICEQUEUEID']=_0x384d81['VoiceQueueId'];}else{_0x29a17f[_0x8a26('0x172')]=_0x384d81[_0x8a26('0xdb')];}for(var _0x3fefcc in _0x384d81[_0x8a26('0x173')]){if(typeof _0x384d81[_0x8a26('0x173')][_0x3fefcc]!==_0x8a26('0xa4')){if(isNotNull(_0x384d81[_0x8a26('0x173')][_0x3fefcc])&&_0x3fefcc!=='id'&&_0x3fefcc!==_0x8a26('0x174')&&_0x3fefcc!==_0x8a26('0x175')&&_0x3fefcc!==_0x8a26('0x176')){_0x29a17f[util[_0x8a26('0x75')](_0x8a26('0x177'),_0x8a26('0x178'),_[_0x8a26('0x179')](_0x3fefcc))]=_0x384d81[_0x8a26('0x173')][_0x3fefcc];}}}var _0x337a89=_0x1f8de0[_0x8a26('0x7e')](_0x2c2054[_0x8a26('0x85')])?utils[_0x8a26('0x17a')](_0x2c2054['Trunk'][_0x8a26('0x17b')],_0x2c2054['dialOriginateCallerIdName'],_0x2c2054[_0x8a26('0x17c')]>0x0?utils[_0x8a26('0x17d')](_0x2c2054[_0x8a26('0x17e')],_0x2c2054[_0x8a26('0x17c')]):_0x2c2054['dialOriginateCallerIdNumber']):utils[_0x8a26('0x17a')](_[_0x8a26('0xed')](_0x2c2054[_0x8a26('0x86')])?_0x2c2054['Trunk'][_0x8a26('0x17b')]:_0x2c2054[_0x8a26('0x86')]['callerid'],_0x2c2054[_0x8a26('0x17f')],_0x2c2054[_0x8a26('0x17c')]>0x0?utils[_0x8a26('0x17d')](_0x2c2054[_0x8a26('0x17e')],_0x2c2054[_0x8a26('0x17c')]):_0x2c2054[_0x8a26('0x17e')]);if(_0x337a89){_0x29a17f['XMD-ORIGINATECALLERIDNAME']=_0x1f8de0[_0x8a26('0x20')][_0x2bebdb][_0x8a26('0x180')]=utils['extractCalleridName'](_0x337a89);_0x29a17f['XMD-ORIGINATECALLERIDNUM']=_0x384d81[_0x8a26('0x15b')];}_0x2c2054[_0x8a26('0x181')]=_0x29a17f;return ami[_0x8a26('0x93')]({'actionid':_0x2bebdb,'action':_0x8a26('0x15a'),'channel':_0x1f8de0[_0x8a26('0x7e')](_0x2c2054[_0x8a26('0x85')])?util[_0x8a26('0x75')]('SIP/%s/%s%s',_0x2c2054[_0x8a26('0x85')][_0x8a26('0x41')],isNotNull(_0x2c2054['dialPrefix'])?_0x2c2054['dialPrefix'][_0x8a26('0x182')]()||'':'',_0x2c2054[_0x8a26('0x183')]>0x0?_0x384d81[_0x8a26('0x15b')][_0x8a26('0x184')](_0x2c2054[_0x8a26('0x183')]):_0x384d81[_0x8a26('0x15b')]):util[_0x8a26('0x75')](_0x8a26('0x185'),_[_0x8a26('0xed')](_0x2c2054[_0x8a26('0x86')])?_0x2c2054['Trunk']['name']:_0x2c2054[_0x8a26('0x86')]['name'],isNotNull(_0x2c2054[_0x8a26('0x186')])?_0x2c2054[_0x8a26('0x186')][_0x8a26('0x182')]()||'':'',_0x2c2054[_0x8a26('0x183')]>0x0?_0x384d81[_0x8a26('0x15b')]['substring'](_0x2c2054[_0x8a26('0x183')]):_0x384d81[_0x8a26('0x15b')]),'callerid':_0x337a89,'Exten':_0x8a26('0x162'),'Context':_0x8a26('0x187'),'Priority':'1','variable':_0x29a17f,'timeout':(_0x2c2054[_0x8a26('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2bebdb})[_0x8a26('0x3a')](function(_0xcbdf77){return _0x4482c8(_0xcbdf77);})['catch'](function(_0xac2563){_0x2c2054[_0x8a26('0x189')]+=0x1;var _0x29f7c3=new History(_0x1f8de0[_0x8a26('0x20')][_0x2bebdb]);logger['error'](util[_0x8a26('0x75')]('[originateError]:\x20%s',JSON[_0x8a26('0x6f')](_0xac2563)));_0x29f7c3[_0x8a26('0x69')]=0xe;_0x29f7c3[_0x8a26('0xcc')]=_0x8a26('0x18a');_0x29f7c3['starttime']=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));_0x29f7c3[_0x8a26('0x6a')]=_0x29f7c3['starttime'];hopperUtils[_0x8a26('0xc3')](_0x29f7c3)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x18b')));_0x1f8de0['moveContactManagedDialer'](_0x29f7c3)['catch'](loggerCatch('[originate][error]'))[_0x8a26('0x18')](function(){delete _0x1f8de0[_0x8a26('0x20')][_0x2bebdb];return _0x298f70(msgResponse(_0x8a26('0x15a'),_0x8a26('0x7d'),_0x8a26('0x18c')));});});});};Dialer[_0x8a26('0x16')]['checkRetriveMax']=function(_0x13504c,_0x3aa85b,_0x1a242e){var _0x38bc3c=new History(_0x3aa85b);if(_0x38bc3c[_0x8a26('0x124')]+_0x38bc3c[_0x8a26('0x125')]+_0x38bc3c[_0x8a26('0x117')]+_0x38bc3c['countnosuchnumberretry']+_0x38bc3c[_0x8a26('0x119')]+_0x38bc3c[_0x8a26('0xe3')]+_0x38bc3c[_0x8a26('0x113')]+_0x38bc3c[_0x8a26('0x11a')]>=_0x1a242e['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x13504c){case 0x3:if(_0x38bc3c[_0x8a26('0x117')]>=_0x1a242e[_0x8a26('0x18d')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x38bc3c[_0x8a26('0x117')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e[_0x8a26('0x18e')],_0x8a26('0xd7'))[_0x8a26('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x38bc3c[_0x8a26('0x124')]>=_0x1a242e[_0x8a26('0x18f')]-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countbusyretry':_0x38bc3c[_0x8a26('0x124')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialBusyRetryFrequency'],'minutes')[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x38bc3c['ContactId'],'ListId':_0x38bc3c['ListId'],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x190')));break;case 0x8:if(_0x38bc3c[_0x8a26('0x125')]>=_0x1a242e[_0x8a26('0x191')]-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countcongestionretry':_0x38bc3c['countcongestionretry']+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e[_0x8a26('0x192')],_0x8a26('0xd7'))[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x193')));break;case 0x0:if(_0x38bc3c[_0x8a26('0x118')]>=_0x1a242e[_0x8a26('0x194')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x38bc3c[_0x8a26('0x118')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialNoSuchNumberRetryFrequency'],_0x8a26('0xd7'))[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x38bc3c[_0x8a26('0x119')]>=_0x1a242e[_0x8a26('0x195')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x38bc3c['countdropretry']+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e[_0x8a26('0xd1')],_0x8a26('0xd7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x38bc3c[_0x8a26('0xe3')]>=_0x1a242e['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x38bc3c[_0x8a26('0xe3')]+=0x1,'scheduledat':moment()['add'](_0x1a242e[_0x8a26('0xe4')],'minutes')['format'](_0x8a26('0xbd')),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c['ListId'],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x196')));break;case 0x13:if(_0x38bc3c[_0x8a26('0x113')]>=_0x1a242e[_0x8a26('0x11e')]-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countmachineretry':_0x38bc3c['countmachineretry']+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialMachineRetryFrequency'],_0x8a26('0xd7'))['format'](_0x8a26('0xbd')),'ContactId':_0x38bc3c['ContactId'],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x38bc3c[_0x8a26('0x11a')]>=_0x1a242e['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countagentrejectretry':_0x38bc3c[_0x8a26('0x11a')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialAgentRejectRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c['ListId'],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x197')));break;default:return!![];}};Dialer[_0x8a26('0x16')]['callProgressDetecting']=function(_0xf870cb,_0x5f0716,_0x2443fd){var _0x117920=this;var _0x408541=new History(_0xf870cb);var _0x28b09b=![];var _0x33efbf;var _0x52d5b8;return new Promise(function(_0x4f5479,_0x266bfd){if(_[_0x8a26('0x3c')](_0x5f0716)&&typeof _0x5f0716!=='object'){return _0x266bfd(msgResponse(_0x8a26('0x198'),'Failure',_0x8a26('0x199')));}if(_[_0x8a26('0x3c')](_0x2443fd)&&typeof _0x2443fd!==_0x8a26('0x159')){return _0x266bfd(msgResponse(_0x8a26('0x198'),'Failure',_0x8a26('0x19a')));}hopperUtils[_0x8a26('0xe6')](_0x408541,_0x2443fd['reason'],_0x5f0716)['then'](function(_0x375384){if(_0x375384[_0x8a26('0xd3')]==0x1)_0x28b09b=!![];switch(_0x2443fd['reason']){case'0':_0x5f0716[_0x8a26('0x19b')]+=0x1;_0x408541[_0x8a26('0x69')]=0x0;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x19c');_0x408541[_0x8a26('0x118')]+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;ami['emit'](_0x8a26('0x19d'),ut[_0x8a26('0x10d')](_0xf870cb,_0x8a26('0x19e')));_0x33efbf=_0x5f0716[_0x8a26('0x19f')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils[_0x8a26('0xc3')](_0x408541)['catch'](loggerCatch(_0x8a26('0x116')));if(_0x117920[_0x8a26('0x1a0')](0x0,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countnosuchnumberretry']>=_0x5f0716[_0x8a26('0x194')]){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1a1'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1a1'));}}break;case'3':_0x5f0716[_0x8a26('0x1a2')]+=0x1;_0x408541[_0x8a26('0x69')]=0x3;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x1a3');_0x408541['countnoanswerretry']+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;var _0x259259=ut[_0x8a26('0x1a4')](_0xf870cb,_0x5f0716);ami[_0x8a26('0x114')](_0x8a26('0x1a5'),_0x259259);_0x33efbf=_0x5f0716[_0x8a26('0x18e')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils[_0x8a26('0xc3')](_0x408541)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x117920[_0x8a26('0x1a0')](0x3,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countnoanswerretry']>=_0x5f0716['dialNoAnswerMaxRetry']){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1a6'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5f0716[_0x8a26('0x1a7')]+=0x1;_0x408541[_0x8a26('0x69')]=0x5;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x1a8');_0x408541[_0x8a26('0x124')]+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;ami[_0x8a26('0x114')](_0x8a26('0x1a9'),ut[_0x8a26('0x10d')](_0xf870cb,_0x8a26('0x1aa')));_0x33efbf=_0x5f0716[_0x8a26('0x1ab')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils['createHistory'](_0x408541)[_0x8a26('0x9a')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x117920['checkRetriveMax'](0x5,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541[_0x8a26('0x124')]>=_0x5f0716[_0x8a26('0x18f')]){_0x117920['createStateFinal'](_0x408541,_0x4f5479,_0x266bfd,'reason\x205\x20busy');}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1ac'));}}break;case'8':_0x5f0716[_0x8a26('0x1ad')]+=0x1;_0x408541[_0x8a26('0x69')]=0x8;_0x408541[_0x8a26('0xcc')]='Congestion';_0x408541['countcongestionretry']+=0x1;_0x408541['countglobal']+=0x1;_0x33efbf=_0x5f0716[_0x8a26('0x192')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];ami[_0x8a26('0x114')](_0x8a26('0x1ae'),ut[_0x8a26('0x10d')](_0xf870cb,'congestion'));hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1af')));if(_0x117920[_0x8a26('0x1a0')](0x8,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countcongestionretry']>=_0x5f0716[_0x8a26('0x191')]){_0x117920['createStateFinal'](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b0'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b0'));}}break;case'11':_0x5f0716[_0x8a26('0x1b1')]+=0x1;_0x408541['state']=0xb;_0x408541[_0x8a26('0xcc')]='Abandoned';_0x408541['countabandonedretry']+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;_0x33efbf=_0x5f0716[_0x8a26('0xe4')];_0x52d5b8=_0x5f0716['callAdditionalPhoneAfterMin'];hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1b2')));if(_0x117920['checkRetriveMax'](0xb,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541[_0x8a26('0xe3')]>=_0x5f0716['dialAbandonedMaxRetry']){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b3'));}else{_0x117920['stateGlobal'](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b3'));}}break;case'20':_0x5f0716[_0x8a26('0x1b4')]+=0x1;_0x408541[_0x8a26('0x69')]=0x14;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x1b5');_0x408541['countagentrejectretry']+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;_0x33efbf=_0x5f0716[_0x8a26('0x1b6')];_0x52d5b8=_0x5f0716['callAdditionalPhoneAfterMin'];ami[_0x8a26('0x114')](_0x8a26('0x1b7'),ut['buildObj'](_0xf870cb,_0x8a26('0x1b8')));hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1b9')));if(_0x117920[_0x8a26('0x1a0')](0x14,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countagentrejectretry']>=_0x5f0716['dialAgentRejectMaxRetry']){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1ba'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,'reason\x2020\x20agentreject');}}break;default:_0x5f0716[_0x8a26('0x1bb')]+=0x1;_0x408541[_0x8a26('0x69')]=0xc;_0x408541['statedesc']=_0x2443fd[_0x8a26('0x1bc')];_0x33efbf=_0x5f0716[_0x8a26('0x1b6')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1bd')));if(_0x117920[_0x8a26('0x1a0')](_0x2443fd[_0x8a26('0x1bc')],_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541[_0x8a26('0x124')]+_0x408541[_0x8a26('0x125')]+_0x408541['countnoanswerretry']+_0x408541[_0x8a26('0x118')]+_0x408541['countdropretry']+_0x408541[_0x8a26('0xe3')]+_0x408541[_0x8a26('0x113')]+_0x408541['countagentrejectretry']>=_0x5f0716[_0x8a26('0x11b')]){_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x2443fd[_0x8a26('0x1bc')]);}else{_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x2443fd[_0x8a26('0x1bc')]);}}}})['then'](function(){if(_0x28b09b){hopperUtils[_0x8a26('0xe0')](_0x408541,_0x33efbf,_0x52d5b8)[_0x8a26('0x3a')](function(){return _0x4f5479(0x1);});}});});};Dialer[_0x8a26('0x16')][_0x8a26('0x11c')]=function(_0x5ffaa,_0x1b3095,_0x1796bd,_0x4de352){var _0x999cf0=new Final(_0x5ffaa);_0x999cf0['state']=0xf;_0x999cf0[_0x8a26('0xcc')]='Global';this['createStateFinal'](_0x999cf0,_0x1b3095,_0x1796bd,_0x4de352);};Dialer[_0x8a26('0x16')][_0x8a26('0x11f')]=function(_0x1de57b,_0x18ca36,_0x3fbe72,_0x36e339){hopperUtils[_0x8a26('0xc5')](_0x1de57b)[_0x8a26('0x3a')](function(){return _0x18ca36(msgResponse(_0x8a26('0x198'),_0x8a26('0x102'),_0x36e339));})[_0x8a26('0x9a')](function(){return _0x3fbe72(msgResponse(_0x8a26('0x1be'),_0x8a26('0x90'),_0x8a26('0x1bf')));});};Dialer[_0x8a26('0x16')][_0x8a26('0xb')]=function(_0x57326b){var _0x17fdd9=_0x57326b[_0x8a26('0x1c0')]/0x64;var _0x253aae=_0x57326b[_0x8a26('0xca')]/(_0x57326b[_0x8a26('0xca')]+_0x57326b[_0x8a26('0xbf')]);var _0x45a4f3=Math['round'](_0x57326b[_0x8a26('0x1c1')]*(_0x57326b[_0x8a26('0x1c2')]/0x64));var _0x300366=Math[_0x8a26('0x1c3')](_0x57326b[_0x8a26('0x1c1')]*(_0x57326b[_0x8a26('0x1c4')]/0x64));var _0x145705=_0x57326b[_0x8a26('0x134')]+_0x57326b[_0x8a26('0x136')];var _0x455619=Math[_0x8a26('0x1c5')](_0x57326b[_0x8a26('0x54')]*_0x57326b[_0x8a26('0x56')]*_0x57326b[_0x8a26('0x1c6')]*_0x57326b[_0x8a26('0x1c7')]);if(_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x5b')])){if(!_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x23')])){_0x57326b['startPredictive']=undefined;loggerPredictive['error'](_0x8a26('0x1c8'),_0x8a26('0x1c9'));}if(!_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x5d')])){loggerPredictive[_0x8a26('0x5f')](_0x8a26('0x1c8'),_0x8a26('0x1ca'));clearInterval(_0x57326b[_0x8a26('0x5d')]);_0x57326b[_0x8a26('0x5d')]=undefined;}_0x57326b[_0x8a26('0x5b')]=moment()['format'](_0x8a26('0xbd'));loggerPredictive[_0x8a26('0x45')](_0x57326b[_0x8a26('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x57326b[_0x8a26('0x5b')]);this[_0x8a26('0xac')](_0x57326b,0x1);}else if(ifInterval(_0x57326b[_0x8a26('0x1cb')],_0x57326b['startProgressive'])){this[_0x8a26('0xac')](_0x57326b,0x1);loggerPredictiveCalls[_0x8a26('0x45')]('[startMethodPredictive][StartProgressive][Loop]',_0x57326b[_0x8a26('0x5b')],_0x57326b[_0x8a26('0x41')]);_0x57326b[_0x8a26('0x54')]=0x0;_0x57326b['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x17fdd9<_0x253aae&&_0x57326b[_0x8a26('0x1cc')]===_0x8a26('0x1cd')){clearPredictiveAttributes(_0x57326b);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x8a26('0x1ce'),_0x253aae,_0x8a26('0x5b'),_0x57326b[_0x8a26('0x41')]);}else if(_0x455619<_0x57326b['predictiveIntervalErlangCallsDroppedCalls']&&_0x57326b[_0x8a26('0x1cc')]===_0x8a26('0x1cd')){clearPredictiveAttributes(_0x57326b);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x8a26('0x1cf'),_0x455619,_0x8a26('0x1d0'),_0x57326b[_0x8a26('0xcb')],'startProgressive',_0x57326b[_0x8a26('0x41')]);}else if(!ifInterval(_0x57326b[_0x8a26('0x1cb')],_0x57326b[_0x8a26('0x5b')])&&_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x23')])&&!_[_0x8a26('0x3c')](_0x57326b['startProgressive'])){_0x57326b[_0x8a26('0x23')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));loggerPredictive[_0x8a26('0x45')](_0x57326b['name'],_0x8a26('0x1d1'),_0x57326b[_0x8a26('0x23')]);hopperUtils['avgHandleTime'](_0x57326b[_0x8a26('0x1cb')])[_0x8a26('0x3a')](this[_0x8a26('0x1d2')](_0x57326b))[_0x8a26('0x3a')](mergeDataErlangB(_0x57326b))[_0x8a26('0x3a')](this[_0x8a26('0x1d3')](_0x57326b))[_0x8a26('0x9a')](loggerCatchPredictive(_0x8a26('0x1d4'),_0x57326b));}else if(!ifInterval(_0x57326b['dialPredictiveInterval'],_0x57326b[_0x8a26('0x23')])){_0x57326b[_0x8a26('0xcb')]=0x0;_0x57326b[_0x8a26('0x23')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));loggerPredictive['info'](_0x57326b[_0x8a26('0x41')],_0x8a26('0x1d5'),_0x57326b[_0x8a26('0x23')]);clearInterval(_0x57326b[_0x8a26('0x5d')]);_0x57326b[_0x8a26('0x5d')]=undefined;hopperUtils['avgHandleTime'](_0x57326b[_0x8a26('0x1cb')])[_0x8a26('0x3a')](this['getDataPredictive'](_0x57326b))[_0x8a26('0x3a')](mergeDataErlangB(_0x57326b))['then'](this[_0x8a26('0x1d3')](_0x57326b))[_0x8a26('0x9a')](loggerCatchPredictive(_0x8a26('0x1d6'),_0x57326b));}else if(_0x57326b[_0x8a26('0x1c1')]&&_0x145705<_0x57326b[_0x8a26('0x1c1')]-_0x300366){clearPredictiveAttributes(_0x57326b);loggerPredictive[_0x8a26('0x45')](_0x57326b[_0x8a26('0x41')],_0x8a26('0x1d7'),_0x145705,_0x8a26('0x1d8'),_0x57326b[_0x8a26('0x1c1')],'-',_0x300366,'=',_0x57326b[_0x8a26('0x1c1')]-_0x300366,')');}else if(_0x57326b[_0x8a26('0x1c1')]&&_0x145705>_0x57326b[_0x8a26('0x1c1')]+_0x45a4f3){clearPredictiveAttributes(_0x57326b);loggerPredictive[_0x8a26('0x45')](_0x57326b['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x145705,_0x8a26('0x1d9'),_0x57326b[_0x8a26('0x1c1')],'+',_0x45a4f3,'=',_0x57326b[_0x8a26('0x1c1')]+_0x45a4f3,')');}};Dialer[_0x8a26('0x16')]['getDataPredictive']=function(_0x4d0f45){var _0x2ba410=this;return function(_0x4b9a84){return new Promise(function(_0x49f237,_0x1435de){_[_0x8a26('0x59')](_0x4d0f45,_0x4b9a84[0x0]);if(checkGetDataPredictive(_0x4b9a84[0x0])){var _0x5bef45=_0x4d0f45['predictiveIntervalAvailable']=_0x4d0f45[_0x8a26('0x136')]+_0x4d0f45[_0x8a26('0x134')];var _0x1e79c7=_0x4d0f45[_0x8a26('0x1cb')]*0x3c;var _0x297658=_0x4b9a84[0x0][_0x8a26('0x4e')]+_0x4b9a84[0x0][_0x8a26('0x4d')];var _0x4ce371=(_0x4b9a84[0x0][_0x8a26('0x48')]+_0x4b9a84[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b9a84[0x0][_0x8a26('0x4b')])/_0x4b9a84[0x0][_0x8a26('0x47')];_0x4d0f45[_0x8a26('0x1c6')]=_0x4ce371>0x0?_0x4ce371:0x1;switch(_0x4d0f45['dialPredictiveOptimization']){case _0x8a26('0x1cd'):var _0x2bc1f2=_0x4d0f45[_0x8a26('0x1c0')]/0x64;return _0x2ba410[_0x8a26('0x1da')](_0x5bef45,_0x1e79c7,_0x297658,_0x4ce371,_0x2bc1f2)[_0x8a26('0x3a')](function(_0x8415e3){return _0x49f237(_0x8415e3);});case _0x8a26('0x1db'):var _0x58dc4c=_0x4d0f45[_0x8a26('0x1c0')]/0x64;return _0x2ba410['busyFactor'](_0x5bef45,_0x1e79c7,_0x297658,_0x4ce371,_0x58dc4c)['then'](function(_0x4afb87){return _0x49f237(_0x4afb87);});default:return _0x1435de(msgResponse('[getDataPredictive]',_0x8a26('0x90'),_0x8a26('0x1dc')));}}else{return _0x1435de(msgResponse(_0x8a26('0x1dd'),_0x8a26('0x90'),_0x8a26('0x1de')));}});};};Dialer[_0x8a26('0x16')][_0x8a26('0x1df')]=function(_0x25a241){var _0x450af1=this;return function(_0x5f21e5){return new Promise(function(_0xcdfb93,_0x5e99ce){_[_0x8a26('0x59')](_0x25a241,_0x5f21e5[0x0]);if(checkGetDataPredictive(_0x5f21e5[0x0])){loggerPredictive[_0x8a26('0x45')](JSON['stringify'](_0x5f21e5[0x0]));if(_0x25a241['dialPredictiveOptimization']===_0x8a26('0x1cd')){return _0x450af1[_0x8a26('0x14b')](_0x25a241['id'])[_0x8a26('0x3a')](function(_0x222647){var _0x497ea9=_0x25a241['loggedIn']-_0x222647[0x0][_0x8a26('0x1e0')];var _0x1e7d52=_0x25a241[_0x8a26('0x1cb')]*0x3c;var _0x3dec4b=_0x5f21e5[0x0][_0x8a26('0x4e')]+_0x5f21e5[0x0][_0x8a26('0x4d')];var _0x1b0c96=(_0x5f21e5[0x0][_0x8a26('0x48')]+_0x5f21e5[0x0][_0x8a26('0x49')]+_0x5f21e5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5f21e5[0x0][_0x8a26('0x47')];var _0x18506e=_0x25a241['dialPredictiveOptimizationPercentage']/0x64;_0x25a241['predictiveIntervalPauses']=_0x222647[0x0][_0x8a26('0x1e0')]||0x0;_0x25a241[_0x8a26('0x1c6')]=_0x1b0c96>0x0?_0x1b0c96:0x1;return _0x450af1[_0x8a26('0x1da')](_0x497ea9,_0x1e7d52,_0x3dec4b,_0x1b0c96,_0x18506e);})[_0x8a26('0x3a')](function(_0x3d3c63){return _0xcdfb93(_0x3d3c63);})[_0x8a26('0x9a')](function(_0x5d2b12){return _0x5e99ce(msgResponse(_0x8a26('0x1e1'),'Failure',JSON['stringify'](_0x5d2b12)));});}if(_0x25a241['dialPredictiveOptimization']==='agentBusyFactor'){return _0x450af1[_0x8a26('0x14b')](_0x25a241['id'])[_0x8a26('0x3a')](function(_0x3a9b86){var _0x50545e=_0x25a241[_0x8a26('0x1e2')]-_0x3a9b86[0x0][_0x8a26('0x1e0')];var _0x4f34d0=_0x25a241[_0x8a26('0x1cb')]*0x3c;var _0x345c56=_0x5f21e5[0x0][_0x8a26('0x4e')]+_0x5f21e5[0x0][_0x8a26('0x4d')];var _0x2a27f5=(_0x5f21e5[0x0][_0x8a26('0x48')]+_0x5f21e5[0x0][_0x8a26('0x49')]+_0x5f21e5[0x0][_0x8a26('0x4b')])/_0x5f21e5[0x0]['predictiveIntervalTotalCalls'];var _0x426c8c=_0x25a241[_0x8a26('0x1c0')]/0x64;_0x25a241[_0x8a26('0x1e3')]=_0x3a9b86[0x0]['outboundQueuePauses']||0x0;_0x25a241[_0x8a26('0x1c6')]=_0x2a27f5>0x0?_0x2a27f5:0x1;return _0x450af1[_0x8a26('0x1e4')](_0x50545e,_0x4f34d0,_0x345c56,_0x2a27f5,_0x426c8c);})[_0x8a26('0x3a')](function(_0x1d45f3){return _0xcdfb93(_0x1d45f3);})['catch'](function(_0x59b9cd){return _0x5e99ce(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x59b9cd)));});}}else{return _0x5e99ce(msgResponse('[getDataPredictive]',_0x8a26('0x90'),'check\x20failure'));}});};};Dialer[_0x8a26('0x16')][_0x8a26('0x1d3')]=function(_0x1a3fe3){var _0x1d1715=this;return function(){var _0x5ab156=0x0;var _0x1596a3=Math[_0x8a26('0x1c5')](_0x1a3fe3[_0x8a26('0x1e5')]*0x3e8);if(_0x1596a3>0x0){_0x1596a3=_0x1596a3<0x64?0x64:_0x1596a3;loggerPredictive[_0x8a26('0x45')](_0x1a3fe3[_0x8a26('0x41')],'one\x20call\x20every:',_0x1596a3,'milliseconds');_0x1a3fe3[_0x8a26('0x5d')]=setInterval(function(){_0x1d1715['handlePredictive'](_0x1a3fe3);loggerPredictiveCalls['info']('[handlePredictive]',_0x5ab156+=0x1);},_0x1596a3);}else{loggerPredictive[_0x8a26('0x45')](_0x1a3fe3['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x8a26('0x16')][_0x8a26('0x1e6')]=function(_0x1d888d,_0x24f89a){var _0x338824=this;return function(_0x5adf0a){if(_[_0x8a26('0x43')](_0x5adf0a)){if(_[_0x8a26('0xed')](_0x24f89a[_0x8a26('0x151')])||!_0x24f89a[_0x8a26('0x1e7')]){if(_0x1d888d[_0x8a26('0xab')]===_0x8a26('0xa')){_0x1d888d['queueStatusComplete']=_[_0x8a26('0x3c')](_0x1d888d[_0x8a26('0x6c')])?!![]:_0x1d888d[_0x8a26('0x6c')];var _0x33aaa1=uuid['v4']();_0x338824['actions'][_0x33aaa1]=new Action(_0x1d888d,_0x24f89a,_0x33aaa1);loggerBooked[_0x8a26('0x45')](_0x8a26('0x1e8'),_0x33aaa1,'queueStatusComplete:\x20',JSON['stringify'](_0x1d888d['queueStatusComplete']),_0x8a26('0x1e9'),_0x1d888d[_0x8a26('0x41')]);if(_0x1d888d['queueStatusComplete']){_0x1d888d[_0x8a26('0x6c')]=![];_0x338824[_0x8a26('0x25')][_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xb8')]]=[];ami[_0x8a26('0x93')]({'actionid':_0x33aaa1,'action':_0x8a26('0x1ea'),'queue':_0x1d888d[_0x8a26('0x41')]})[_0x8a26('0x9a')](function(){_0x338824[_0x8a26('0xbb')](_0x1d888d);hopperUtils[_0x8a26('0xd5')]({'active':![],'ContactId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xd8')],'ListId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xd9')],'VoiceQueueId':_0x338824[_0x8a26('0x20')][_0x33aaa1]['VoiceQueueId']||undefined,'CampaignId':_0x338824['actions'][_0x33aaa1]['CampaignId']||undefined})[_0x8a26('0x9a')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x338824[_0x8a26('0x20')][_0x33aaa1];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x8a26('0x6f')](_0x1d888d['queueStatusComplete']),_0x8a26('0x1e9'),_0x1d888d[_0x8a26('0x41')]);_0x338824['updateOriginated'](_0x1d888d);hopperUtils[_0x8a26('0xd5')]({'active':![],'ContactId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xd8')],'ListId':_0x338824['actions'][_0x33aaa1][_0x8a26('0xd9')],'VoiceQueueId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xda')]||undefined,'CampaignId':_0x338824['actions'][_0x33aaa1][_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x338824['actions'][_0x33aaa1];}}else{return _0x338824[_0x8a26('0x158')](_0x1d888d,_0x24f89a);}}else{if(utils[_0x8a26('0x5a')](undefined,_0x24f89a[_0x8a26('0x1eb')])<_0x1d888d['dialRecallMeTimeout']*0x3c){if(_0x24f89a[_0x8a26('0x143')]&&!_0x24f89a[_0x8a26('0x143')][_0x8a26('0x1ec')]){_0x338824[_0x8a26('0x1ed')]['run'](_0x24f89a['id'])[_0x8a26('0x18')](function(){_0x338824[_0x8a26('0xbb')](_0x1d888d);});}else{hopperUtils[_0x8a26('0x1ee')]({'active':![]},_0x24f89a['id'],0x1)[_0x8a26('0x18')](function(){_0x338824[_0x8a26('0xbb')](_0x1d888d);});}}else{_0x1d888d[_0x8a26('0x1ef')]+=0x1;_0x338824[_0x8a26('0xbb')](_0x1d888d);if(_0x1d888d['dialRecallInQueue']){hopperUtils[_0x8a26('0xd5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x24f89a[_0x8a26('0xd8')],'ListId':_0x24f89a[_0x8a26('0xd9')],'VoiceQueueId':_0x24f89a[_0x8a26('0xda')]||undefined,'CampaignId':_0x24f89a[_0x8a26('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x8a26('0xc3')](createObjHistory(_0x1d888d,_0x24f89a,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x8a26('0x1f0')))['catch'](loggerCatch(_0x8a26('0x1f1')));}else{_0x338824['saveInDb'](createObjHistory(_0x1d888d,_0x24f89a,utils[_0x8a26('0x63')][_0x8a26('0x1f2')],0x16,_0x8a26('0x1f3')),_0x8a26('0x1f4'),_0x8a26('0x1f5'));}}}}else{_0x1d888d['outboundBlacklistCallsDay']+=0x1;_0x338824[_0x8a26('0x10f')](createObjHistory(_0x1d888d,_0x24f89a,utils[_0x8a26('0x63')][_0x8a26('0x1f6')],0xd,'Blacklist'),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x8a26('0x1f7');}};};Dialer[_0x8a26('0x16')][_0x8a26('0x157')]=function(_0x477073){var _0x3c0cc2=this;var _0x143031=_0x477073[_0x8a26('0x1f8')]-_0x477073[_0x8a26('0x78')]-_0x477073[_0x8a26('0x1f9')];emitCampaignSummary(_0x477073);if(_0x143031>0x0){if(_0x143031>this[_0x8a26('0x1e')]){_0x143031=this[_0x8a26('0x1e')];}_0x477073[_0x8a26('0x1f9')]+=_0x143031;hopperUtils[_0x8a26('0x1fa')](_0x477073['id'],_0x143031,_0x477073[_0x8a26('0x1fb')],_0x477073)[_0x8a26('0x3a')](function(_0x5a8bf7){_0x477073[_0x8a26('0x1f9')]-=_0x143031;_0x477073[_0x8a26('0x1f9')]=_0x477073[_0x8a26('0x1f9')]>0x0?_0x477073[_0x8a26('0x1f9')]:0x0;if(!utils[_0x8a26('0x1fc')](_0x5a8bf7)){_0x477073[_0x8a26('0x66')]=utils['CAMPAIGN_STATUS'][_0x8a26('0x67')];logger['info'](_0x8a26('0x1fd')+_0x477073[_0x8a26('0x41')]);}else{_0x477073[_0x8a26('0x78')]+=_0x5a8bf7[_0x8a26('0x92')];_0x477073[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x1fe')];for(var _0x385820=0x0;_0x385820<_0x5a8bf7[_0x8a26('0x92')];_0x385820+=0x1){_0x477073['ivrTotalCallsDays']+=0x1;if(_[_0x8a26('0xed')](_0x5a8bf7[_0x385820])||_[_0x8a26('0xed')](_0x5a8bf7[_0x385820][_0x8a26('0x173')])||_[_0x8a26('0xed')](_0x5a8bf7[_0x385820]['phone'])){_0x3c0cc2[_0x8a26('0x14f')](_0x8a26('0x1ff'),_0x477073,_0x5a8bf7[_0x385820]);}else{hopperUtils[_0x8a26('0x200')](_[_0x8a26('0xf1')](_0x5a8bf7[_0x385820],[_0x8a26('0xdb'),_0x8a26('0x15b')]))['then'](_0x3c0cc2[_0x8a26('0x1e6')](_0x477073,_0x5a8bf7[_0x385820]))['catch'](_0x3c0cc2[_0x8a26('0x201')](_0x8a26('0x202'),_0x477073));}}}})[_0x8a26('0x9a')](loggerGetContactDialer(_0x8a26('0x203'),_0x477073,_0x143031));}};Dialer[_0x8a26('0x16')][_0x8a26('0xac')]=function(_0x4c5275,_0x4eb310){var _0x54eb81=this;var _0x24f132=[];if(_0x4eb310<0x1||_0x4c5275[_0x8a26('0xab')]==='booked'){_0x4eb310=0x1;}var _0x268bf6=Math[_0x8a26('0x1c5')](_0x4c5275[_0x8a26('0x134')]*_0x4eb310)-_0x4c5275[_0x8a26('0x78')]-_0x4c5275[_0x8a26('0x1f9')];if(_0x4c5275['dialLimitQueue']>0x0){var _0x534e99=_0x4c5275['dialLimitQueue']-_0x4c5275['originated']-_0x4c5275[_0x8a26('0x136')]-_0x4c5275[_0x8a26('0x1f9')]-_0x4c5275['pTalking'];if(_0x268bf6>_0x534e99){_0x268bf6=_0x534e99;}}if(_0x268bf6>0x0){if(_0x4c5275[_0x8a26('0xab')]===_0x8a26('0xa')){_0x268bf6=0x1;}if(_0x268bf6>this[_0x8a26('0x1e')]){_0x268bf6=this[_0x8a26('0x1e')];}_0x4c5275[_0x8a26('0x1f9')]+=_0x268bf6;for(var _0x7c116d in this[_0x8a26('0x1c')]){if(typeof this['agents'][_0x7c116d]!==_0x8a26('0xa4')){if(this['agents'][_0x7c116d]['state']===_0x8a26('0x204')&&this[_0x8a26('0x1c')][_0x7c116d]['status']===_0x8a26('0x82')){_0x24f132[_0x8a26('0x9b')](this[_0x8a26('0x1c')][_0x7c116d]['id']);}}}hopperUtils['getContactDialer'](_0x4c5275,_0x24f132,_0x268bf6)[_0x8a26('0x3a')](function(_0x4172a4){_0x4c5275[_0x8a26('0x1f9')]-=_0x268bf6;_0x4c5275[_0x8a26('0x1f9')]=_0x4c5275[_0x8a26('0x1f9')]>0x0?_0x4c5275['temp']:0x0;if(!utils[_0x8a26('0x1fc')](_0x4172a4)){hopperUtils[_0x8a26('0x205')](_0x4c5275)[_0x8a26('0x3a')](sendMessageReschedule(_0x4c5275))[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x206')));}else{_0x4c5275['originated']+=_0x4172a4[_0x8a26('0x92')];_0x4c5275[_0x8a26('0x66')]=_0x4c5275[_0x8a26('0xab')]===_0x8a26('0xa')?utils[_0x8a26('0x63')][_0x8a26('0x138')]:utils[_0x8a26('0x63')][_0x8a26('0x1fe')];for(var _0x24b425=0x0;_0x24b425<_0x4172a4[_0x8a26('0x92')];_0x24b425+=0x1){if(_['isNil'](_0x4172a4[_0x24b425])||_[_0x8a26('0xed')](_0x4172a4[_0x24b425][_0x8a26('0x173')])||_[_0x8a26('0xed')](_0x4172a4[_0x24b425][_0x8a26('0x15b')])){_0x54eb81[_0x8a26('0x14f')]('[actionOriginate]\x20',_0x4c5275,_0x4172a4[_0x24b425]);}else{hopperUtils[_0x8a26('0x207')](_[_0x8a26('0xf1')](_0x4172a4[_0x24b425],[_0x8a26('0xda'),_0x8a26('0x15b')]))[_0x8a26('0x3a')](_0x54eb81[_0x8a26('0x1e6')](_0x4c5275,_0x4172a4[_0x24b425]))[_0x8a26('0x9a')](_0x54eb81[_0x8a26('0x201')](_0x8a26('0x1ff'),_0x4c5275));}}}})[_0x8a26('0x9a')](loggerGetContactDialer(_0x8a26('0x208'),_0x4c5275,_0x268bf6));}};Dialer[_0x8a26('0x16')][_0x8a26('0x5d')]=function(_0x31488d){if(_0x31488d[_0x8a26('0x209')]>0x0){var _0x3e04df=_0x31488d[_0x8a26('0x209')]-_0x31488d[_0x8a26('0x78')]-_0x31488d[_0x8a26('0x136')];if(_0x3e04df>0x0){this[_0x8a26('0x20a')](_0x31488d);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x8a26('0x20a')](_0x31488d);}};Dialer[_0x8a26('0x16')][_0x8a26('0x20a')]=function(_0x199b42){var _0x126396=this;var _0x2cc688=[];_0x199b42[_0x8a26('0x78')]+=0x1;for(var _0x21edca in this['agents']){if(typeof this[_0x8a26('0x1c')][_0x21edca]!==_0x8a26('0xa4')){if(this[_0x8a26('0x1c')][_0x21edca][_0x8a26('0x69')]===_0x8a26('0x204')&&this[_0x8a26('0x1c')][_0x21edca][_0x8a26('0x81')]===_0x8a26('0x82')){_0x2cc688[_0x8a26('0x9b')](this[_0x8a26('0x1c')][_0x21edca]['id']);}}}return this[_0x8a26('0x20b')](_0x199b42['id'],_0x2cc688,0x1,_0x199b42[_0x8a26('0x1fb')],_0x199b42)[_0x8a26('0x3a')](function(_0x2db54f){if(!utils['checkContactEmpty'](_0x2db54f)){utils[_0x8a26('0x61')](_0x199b42,0x1,0x0);return hopperUtils['countReScheduled'](_0x199b42)[_0x8a26('0x3a')](sendMessageReschedule(_0x199b42))[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x206')));}else{_0x199b42[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x1fe')];if(_[_0x8a26('0xed')](_0x2db54f[0x0])||_[_0x8a26('0xed')](_0x2db54f[0x0][_0x8a26('0x173')])||_[_0x8a26('0xed')](_0x2db54f[0x0][_0x8a26('0x15b')])){_0x126396[_0x8a26('0x14f')]('[actionOriginate]\x20',_0x199b42,_0x2db54f[0x0]);}else{return hopperUtils[_0x8a26('0x207')](_[_0x8a26('0xf1')](_0x2db54f[0x0],[_0x8a26('0xda'),'phone']))['then'](_0x126396[_0x8a26('0x1e6')](_0x199b42,_0x2db54f[0x0]))[_0x8a26('0x9a')](_0x126396['loggerHandler'](_0x8a26('0x20c'),_0x199b42));}}})[_0x8a26('0x9a')](loggerGetContactDialer(_0x8a26('0x20d'),_0x199b42,0x1));};Dialer[_0x8a26('0x16')][_0x8a26('0x1da')]=function(_0x3b974e,_0x3bd734,_0x110515,_0x335a81,_0x2afcdc,_0x465da2){loggerPredictive[_0x8a26('0x45')](_0x8a26('0x20e'));loggerPredictive['info'](_0x8a26('0x20f'),_0x3b974e);loggerPredictive[_0x8a26('0x45')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3bd734);loggerPredictive[_0x8a26('0x45')]('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',_0x110515);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x210'),_0x335a81);loggerPredictive[_0x8a26('0x45')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2afcdc);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4f'));return new Promise(function(_0x527107,_0x42918f){if(_0x3b974e<=0x0||isNaN(_0x3b974e)){return _0x42918f(msgResponse(_0x8a26('0x211'),_0x8a26('0x7d'),_0x8a26('0x212')+_0x3b974e));}if(_0x110515<=0x0||isNaN(_0x110515)){return _0x42918f(msgResponse('[abandonmentRate]',_0x8a26('0x7d'),_0x8a26('0x213')+_0x110515));}if(_0x335a81<=0x0||isNaN(_0x335a81)){return _0x42918f(msgResponse(_0x8a26('0x211'),_0x8a26('0x7d'),_0x8a26('0x214')+_0x335a81));}if(_0x3bd734<=0x0||isNaN(_0x3bd734)){return _0x42918f(msgResponse('[abandonmentRate]',_0x8a26('0x7d'),'interval\x20=\x20'+_0x3bd734));}if(_0x2afcdc<=0x0||isNaN(_0x2afcdc)){return _0x42918f(msgResponse(_0x8a26('0x211'),_0x8a26('0x7d'),'Amax\x20=\x20'+_0x2afcdc));}_0x465da2=_0x465da2||0x0;var _0x33acde=0x1/_0x110515;var _0x3b6320=0x0;var _0x4038be=0x0;var _0x5973df=0x0;var _0x4d7d52=0x0;for(var _0xca5084=0x0;_0x5973df<_0x2afcdc;_0xca5084+=0x1){_0x4038be=_0xca5084/_0x3bd734;_0x3b6320=(_0x335a81*_0x4038be+_0x465da2)/_0x33acde;_0x5973df=utils['erlangb'](_0x3b6320,_0x3b974e);_0x4d7d52=_0x3b6320/_0x3b974e*(0x1-utils['erlangb'](_0x3b6320,_0x3b974e));}return _0x527107({'erlangCalls':_0xca5084,'erlangCallToSecond':_0x3bd734/_0xca5084,'erlangAbandonmentRate':_0x5973df,'erlangBusyFactor':_0x4d7d52});});};Dialer[_0x8a26('0x16')][_0x8a26('0x1e4')]=function(_0x1c676c,_0xb2959a,_0x273eef,_0x7397b9,_0x25eede,_0x524223){loggerPredictive[_0x8a26('0x45')](_0x8a26('0x215'));loggerPredictive[_0x8a26('0x45')](_0x8a26('0x20f'),_0x1c676c);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x216'),_0xb2959a);loggerPredictive['info'](_0x8a26('0x217'),_0x273eef);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x210'),_0x7397b9);loggerPredictive['info'](_0x8a26('0x218'),_0x25eede);loggerPredictive['info'](_0x8a26('0x4f'));return new Promise(function(_0x31f65e,_0x264f03){if(_0x1c676c<=0x0||isNaN(_0x1c676c)){return _0x264f03(msgResponse(_0x8a26('0x219'),_0x8a26('0x7d'),_0x8a26('0x212')+_0x1c676c));}if(_0x273eef<=0x0||isNaN(_0x273eef)){return _0x264f03(msgResponse('[busyFactor]',_0x8a26('0x7d'),'Ts\x20=\x20'+_0x273eef));}if(_0x7397b9<=0x0||isNaN(_0x7397b9)){return _0x264f03(msgResponse(_0x8a26('0x219'),_0x8a26('0x7d'),'p\x20=\x20'+_0x7397b9));}if(_0xb2959a<=0x0||isNaN(_0xb2959a)){return _0x264f03(msgResponse('[busyFactor]',_0x8a26('0x7d'),_0x8a26('0x21a')+_0xb2959a));}if(_0x25eede<=0x0||isNaN(_0x25eede)){return _0x264f03(msgResponse(_0x8a26('0x219'),_0x8a26('0x7d'),_0x8a26('0x21b')+_0x25eede));}_0x524223=_0x524223||0x0;var _0x49fc93=0x1/_0x273eef;var _0x487162=0x0;var _0x497f26=0x0;var _0x19e45b=0x0;var _0x1f32e5=0x0;for(var _0x150789=0x0;_0x1f32e5<_0x25eede;_0x150789+=0x1){_0x497f26=_0x150789/_0xb2959a;_0x487162=(_0x7397b9*_0x497f26+_0x524223)/_0x49fc93;_0x19e45b=utils[_0x8a26('0x21c')](_0x487162,_0x1c676c);_0x1f32e5=_0x487162/_0x1c676c*(0x1-utils[_0x8a26('0x21c')](_0x487162,_0x1c676c));}return _0x31f65e({'erlangCalls':_0x150789,'erlangCallToSecond':_0xb2959a/_0x150789,'erlangAbandonmentRate':_0x19e45b,'erlangBusyFactor':_0x1f32e5});});};module['exports']=Dialer; \ No newline at end of file +var _0x1919=['calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','verifyAdditionalPhones','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','roundrobin','isNil','locked','stateinterface','rrmemory','paused','strategy','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','updateOriginated','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','callProgressDetecting','variable','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','AMD','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','value','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','countagentrejectretry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','[syncHangupIvr]','queuesSummary','running','statusMessage','getQueueCampaignStatusMessage','available','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','sequence','[Dialer][checkChannel]','getVoiceQueueRtPauses','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncAgentComplete][createHistory]','checkPreviewRecallReminder','handleIvr','actionOriginate','object','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','Trunk','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','phone','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','createStateFinal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','talking','erlangCalls','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','predictiveIntervalAnsweredCalls','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','outboundQueuePauses','floor','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','dialRecallMeTimeout','voicePause','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','originated','temp','getContactDialerIvr','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','checkContactEmpty','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\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]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','erlangBusyFactor','merge','getSeconds','startProgressive','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','timezones','then','indexOf','iftime\x20%s,%s','content','true','catch','all','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','uniqueid','ivr','YYYY-MM-DD\x20HH:mm:ss','queue','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','moveContactManagedDialer','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','state','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]'];(function(_0x3efa00,_0x42c22e){var _0x33b53a=function(_0x2ce45c){while(--_0x2ce45c){_0x3efa00['push'](_0x3efa00['shift']());}};_0x33b53a(++_0x42c22e);}(_0x1919,0x14a));var _0x9191=function(_0x2dec16,_0x598b21){_0x2dec16=_0x2dec16-0x0;var _0x2b5e45=_0x1919[_0x2dec16];return _0x2b5e45;};'use strict';var util=require(_0x9191('0x0'));var _=require(_0x9191('0x1'));var uuid=require(_0x9191('0x2'));var moment=require(_0x9191('0x3'));var rr=require('rr');var Redis=require(_0x9191('0x4'));var utils=require(_0x9191('0x5'));var hopperUtils=require(_0x9191('0x6'));var ut=require('../preview/util/util');var config=require(_0x9191('0x7'));var logger=require(_0x9191('0x8'))(_0x9191('0x9'));var loggerBooked=require(_0x9191('0x8'))(_0x9191('0xa'));var loggerPredictive=require(_0x9191('0x8'))(_0x9191('0xb'));var loggerPredictiveCalls=require(_0x9191('0x8'))(_0x9191('0xc'));var loggerSyncQueueSummary=require(_0x9191('0x8'))('syncQueueSummary');var ami=require(_0x9191('0xd'));config[_0x9191('0xe')]=_[_0x9191('0xf')](config[_0x9191('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x9191('0x10'))(new Redis(config[_0x9191('0xe')]));var cmHopper=require(_0x9191('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x9191('0x12'));var Interval=require(_0x9191('0x13'));var Action=require(_0x9191('0x14'));var History=require('./models/history');var Final=require(_0x9191('0x15'));var AgentComplete=require(_0x9191('0x16'));var QueueCallerAbandon=require(_0x9191('0x17'));var Hangup=require(_0x9191('0x18'));var ipAgi=process[_0x9191('0x19')][_0x9191('0x1a')]||_0x9191('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9191('0x1c')][_0x9191('0x1d')]=function(_0x530ff2){this[_0x9191('0x1e')]=this['tail']?this[_0x9191('0x1e')][_0x9191('0x1f')](_0x530ff2):_0x530ff2();};function Dialer(_0x14f4be,_0x476e08){this['sequence']=new Sequence();this[_0x9191('0x20')]=_0x476e08;this[_0x9191('0x21')]=_0x14f4be[_0x9191('0x21')];this[_0x9191('0x22')]=_0x14f4be['campaigns'];this['agents']=_0x14f4be[_0x9191('0x23')];this[_0x9191('0x24')]=_0x14f4be[_0x9191('0x24')];this['maxNumberOriginate']=config[_0x9191('0x25')]||0x2;this[_0x9191('0x26')]={};this[_0x9191('0x27')]={};this[_0x9191('0x28')]={};this[_0x9191('0x29')]={};this[_0x9191('0x2a')]={};this['startPredictive']={};this['startProgressive']={};this[_0x9191('0x2b')]={};this[_0x9191('0x2c')]={};this[_0x9191('0x2d')]={};this['queuesSummary']={};ami['on'](_0x9191('0x2e'),this[_0x9191('0x2f')][_0x9191('0x30')](this));ami['on']('queuecallerabandon',this[_0x9191('0x31')][_0x9191('0x30')](this));ami['on'](_0x9191('0x32'),this[_0x9191('0x33')][_0x9191('0x30')](this));ami['on'](_0x9191('0x34'),this[_0x9191('0x35')][_0x9191('0x30')](this));ami['on'](_0x9191('0x36'),this[_0x9191('0x37')][_0x9191('0x30')](this));ami['on'](_0x9191('0x38'),this[_0x9191('0x39')][_0x9191('0x30')](this));ami['on'](_0x9191('0x3a'),this[_0x9191('0x3b')]['bind'](this));ami['on']('newexten',this[_0x9191('0x3c')]['bind'](this));ami['on'](_0x9191('0x3d'),this[_0x9191('0x3e')][_0x9191('0x30')](this));ami['on'](_0x9191('0x3f'),this[_0x9191('0x40')]['bind'](this));ami['on'](_0x9191('0x41'),this[_0x9191('0x42')][_0x9191('0x30')](this));this[_0x9191('0x43')]();this[_0x9191('0x44')]();RpcSetting[_0x9191('0x45')]()['then'](function(_0x59659c){previewRecallmeReminderInterval=_0x59659c[_0x9191('0x46')];});}function isNotNull(_0x292e08){return _0x292e08!==null&&!_[_0x9191('0x47')](_0x292e08);}function msgResponse(_0x3e515d,_0x51bb3e,_0x52286a){return{'action':_0x3e515d,'response':_0x51bb3e,'message':_0x52286a,'stack':_0x52286a};}function emit(_0x1ea081,_0x87fb1c,_0x365b63){io['to'](_0x1ea081)[_0x9191('0x48')](_0x87fb1c,_0x365b63);}function emitOutboundVoiceQueueSummary(_0x278780){if(_0x278780[_0x9191('0x49')]===_0x9191('0x4a')){logger[_0x9191('0x4b')](_0x9191('0x4c'),util['inspect'](_0x278780,{'showHidden':![],'depth':null}));emit(util[_0x9191('0x4d')]('voice:queue:%s',_0x278780[_0x9191('0x4e')]),_0x9191('0x4f'),_0x278780);}}function checkGetDataPredictive(_0x1f5be1){if(isNotNull(_0x1f5be1)&&!_[_0x9191('0x50')](_0x1f5be1)){loggerPredictive[_0x9191('0x51')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x9191('0x51')](_0x9191('0x52'),_0x1f5be1['predictiveIntervalTotalCalls']);loggerPredictive[_0x9191('0x51')](_0x9191('0x53'),_0x1f5be1['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9191('0x51')](_0x9191('0x54'),_0x1f5be1[_0x9191('0x55')]);loggerPredictive[_0x9191('0x51')](_0x9191('0x56'),_0x1f5be1[_0x9191('0x57')]);loggerPredictive['info'](_0x9191('0x58'),_0x1f5be1['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f5be1[_0x9191('0x59')]);loggerPredictive['info'](_0x9191('0x5a'));if(_0x1f5be1[_0x9191('0x5b')]>0x0){if(!_[_0x9191('0x47')](_0x1f5be1['predictiveIntervalAvgTalktime'])&&_0x1f5be1['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x9191('0x51')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x9191('0x47')](_0x1f5be1[_0x9191('0x5c')])&&_0x1f5be1[_0x9191('0x5c')]>0x0){return!![];}loggerPredictive[_0x9191('0x51')](_0x9191('0x5d'));}else{loggerPredictive['info'](_0x9191('0x5e'));}}else{loggerPredictive[_0x9191('0x51')](_0x9191('0x5f'));}return![];}function mergeDataErlangB(_0x33bed8){return function(_0x3ef6b5){loggerPredictive[_0x9191('0x51')](_0x9191('0x60'));loggerPredictive['info'](_0x9191('0x61'),_0x3ef6b5['erlangCalls']);loggerPredictive[_0x9191('0x51')](_0x9191('0x62'),_0x3ef6b5['erlangCallToSecond']);loggerPredictive[_0x9191('0x51')](_0x9191('0x63'),_0x3ef6b5[_0x9191('0x64')]);loggerPredictive[_0x9191('0x51')](_0x9191('0x65'),_0x3ef6b5[_0x9191('0x66')]);loggerPredictive[_0x9191('0x51')](_0x9191('0x63'),_0x3ef6b5[_0x9191('0x64')]);loggerPredictive[_0x9191('0x51')](_0x9191('0x5a'));_[_0x9191('0x67')](_0x33bed8,_0x3ef6b5);};}function ifInterval(_0xedf059,_0x31a346){if(_['isUndefined'](_0x31a346)){return![];}return utils[_0x9191('0x68')](undefined,_0x31a346)<_0xedf059*0x3c;}function clearPredictiveAttributes(_0x535dd7){if(_0x535dd7['startProgressive']){_0x535dd7[_0x9191('0x69')]=undefined;loggerPredictive[_0x9191('0x4b')](_0x535dd7[_0x9191('0x4e')],'startProgressive\x20value\x20cleared');}if(_0x535dd7[_0x9191('0x6a')]){_0x535dd7[_0x9191('0x6a')]=undefined;loggerPredictive[_0x9191('0x4b')](_0x535dd7['name'],_0x9191('0x6b'));}if(_0x535dd7[_0x9191('0x6c')]){clearInterval(_0x535dd7['handlePredictive']);_0x535dd7[_0x9191('0x6c')]=undefined;loggerPredictive[_0x9191('0x4b')](_0x535dd7[_0x9191('0x4e')],_0x9191('0x6d'));}}function loggerCatchPredictive(_0x85f32c,_0x7060e5){return function(_0x35862b){loggerPredictive[_0x9191('0x6e')](_0x7060e5[_0x9191('0x4e')],_0x85f32c);loggerPredictive[_0x9191('0x6e')](_0x35862b[_0x9191('0x6f')]);clearPredictiveAttributes(_0x7060e5);};}function loggerCatch(_0x586247){return function(_0x16f7c6){logger['error'](_0x586247,util[_0x9191('0x70')](_0x16f7c6,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x335b7f,_0x4ad6de,_0x4a4068){return function(_0x172da2){utils['checkContactLowerLimitOriginate'](_0x4ad6de,_0x4a4068,0x0);logger[_0x9191('0x6e')](_0x335b7f,util['inspect'](_0x172da2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x452b90){return function(_0x41ab0d){if(isNotNull(_0x41ab0d)&&isNotNull(_0x41ab0d[0x0])){if(_0x41ab0d[0x0]['contactsRescheduled']>0x0){_0x452b90[_0x9191('0x71')]=utils[_0x9191('0x72')][_0x9191('0x73')];logger[_0x9191('0x51')](_0x9191('0x74')+_0x452b90[_0x9191('0x4e')],_0x41ab0d[0x0][_0x9191('0x75')],_0x9191('0x76'));}else{_0x452b90[_0x9191('0x71')]=utils[_0x9191('0x72')][_0x9191('0x77')];logger[_0x9191('0x51')](_0x9191('0x78')+_0x452b90['name']);}}};}function createObjHistory(_0x50fb35,_0x3c3e53,_0x19ec7c,_0x498dbe,_0x14c094){_0x50fb35[_0x9191('0x71')]=_0x19ec7c;var _0x425a58=new Action(_0x50fb35,_0x3c3e53);var _0x53be0c=new History(_0x425a58);_0x53be0c['state']=_0x498dbe;_0x53be0c[_0x9191('0x79')]=_0x14c094;_0x53be0c[_0x9191('0x7a')]=_0x425a58[_0x9191('0x7b')];return _0x53be0c;}function unlockQueueStatus(_0x3b2321,_0x456e3d){setTimeout(function(){if(_[_0x9191('0x47')](_0x3b2321[_0x9191('0x7c')])){loggerBooked[_0x9191('0x6e')]('[unlockQueueStatus][undefined]',_0x456e3d);}_0x3b2321[_0x9191('0x7c')]=!![];loggerBooked['info'](_0x9191('0x7d'),_0x456e3d,JSON[_0x9191('0x7e')](_[_0x9191('0x7f')](_0x3b2321,['name',_0x9191('0x7c')])));},0x1f3);}function checkInterval(_0x3f25b8){return function(){if(!isNotNull(_0x3f25b8[_0x9191('0x80')])){_0x3f25b8[_0x9191('0x71')]=utils[_0x9191('0x72')]['NULL_INTERVAL'];throw _0x3f25b8[_0x9191('0x4e')]+_0x9191('0x81');}if(!isNotNull(_0x3f25b8[_0x9191('0x80')][_0x9191('0x82')])){_0x3f25b8[_0x9191('0x71')]=utils[_0x9191('0x72')][_0x9191('0x83')];throw _0x3f25b8[_0x9191('0x4e')]+_0x9191('0x81');}if(!isNotNull(_['isEmpty'](_0x3f25b8[_0x9191('0x80')][_0x9191('0x82')]))){_0x3f25b8[_0x9191('0x71')]=utils[_0x9191('0x72')]['NULL_INTERVAL'];throw _0x3f25b8[_0x9191('0x4e')]+_0x9191('0x81');}};}function checkIsIVRCampaignActive(_0x40d5f1){return function(){if(!utils[_0x9191('0x84')](_0x40d5f1)){_0x40d5f1['message']=utils['CAMPAIGN_STATUS'][_0x9191('0x85')];throw _0x40d5f1[_0x9191('0x4e')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0xd9e058){if(utils[_0x9191('0x86')](_0xd9e058)){emit(util[_0x9191('0x4d')](_0x9191('0x87'),_0xd9e058[_0x9191('0x4e')]),_0x9191('0x88'),_0xd9e058);}}function loggerCatchQueueSummary(_0x24f814,_0x1a8e8f){return function(_0x48e6b1){clearPredictiveAttributes(_0x1a8e8f);emitCampaignSummary(_0x1a8e8f);loggerSyncQueueSummary[_0x9191('0x4b')](_0x24f814,util[_0x9191('0x70')](_0x48e6b1,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xa1a98d){if(_0xa1a98d['sendMessageOneNotActive']){if(_0xa1a98d['originated']===0x0){_0xa1a98d[_0x9191('0x89')]=![];_0xa1a98d['message']=utils['CAMPAIGN_STATUS'][_0x9191('0x85')];loggerSyncQueueSummary['debug'](_0x9191('0x8a'),_0xa1a98d[_0x9191('0x4e')],'is\x20not\x20active');}else{_0xa1a98d['message']=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x9191('0x4b')](_0x9191('0x8a'),_0xa1a98d[_0x9191('0x4e')],_0x9191('0x8b'));}emitCampaignSummary(_0xa1a98d);}}function myreject(_0xe9ff95){return function(_0x66d2e9){return _0xe9ff95(msgResponse('[ifTime][Action]',_0x9191('0x8c'),JSON[_0x9191('0x7e')](_0x66d2e9)));};}Dialer['prototype'][_0x9191('0x8d')]=function(_0x4ef449){return!_[_0x9191('0x47')](_0x4ef449)&&_0x4ef449&&!_[_0x9191('0x47')](_0x4ef449[_0x9191('0x4e')])&&!_[_0x9191('0x47')](_0x4ef449['active'])&&_0x4ef449[_0x9191('0x8e')]&&(this['trunks'][util[_0x9191('0x4d')](_0x9191('0x8f'),_0x4ef449['name'])][_0x9191('0x90')]===_0x9191('0x91')||this[_0x9191('0x24')][util[_0x9191('0x4d')](_0x9191('0x8f'),_0x4ef449[_0x9191('0x4e')])][_0x9191('0x90')]===_0x9191('0x92'));};Dialer[_0x9191('0x1c')]['checkIsTrunkReachable']=function(_0x49b8d7){var _0x47ab90=this;return function(){if(!_0x47ab90['isTrunkReachable'](_0x49b8d7['Trunk'])){if(!_0x47ab90[_0x9191('0x8d')](_0x49b8d7['TrunkBackup'])){_0x49b8d7[_0x9191('0x71')]=utils[_0x9191('0x72')][_0x9191('0x93')];throw _0x49b8d7[_0x9191('0x4e')]+_0x9191('0x94');}}};};Dialer[_0x9191('0x1c')][_0x9191('0x95')]=function(_0x380d1a,_0x1cf393,_0x3d520d,_0x75efd6){var _0x52bab8=this;return function(){var _0x26a3fc=!![];return _0x52bab8['ifTimeIvr'](_0x380d1a,_0x1cf393,_0x3d520d,_0x75efd6,_0x26a3fc);};};Dialer[_0x9191('0x1c')][_0x9191('0x96')]=function(_0x48c0f6,_0x3ab9a5,_0x43f0a1,_0x38f4d7){var _0x9b99ed=this;return function(){var _0x162bfa=![];return _0x9b99ed['ifTimeIvr'](_0x48c0f6[_0x9191('0x82')],_0x3ab9a5,_0x43f0a1,_0x38f4d7,_0x162bfa);};};Dialer[_0x9191('0x1c')][_0x9191('0x97')]=function(_0x285486,_0x112d90,_0x5a6cbb,_0x5b2f28,_0x525d36){var _0x1c54f8=[];return new Promise(function(_0x333bb4,_0x10527e){if(!isNotNull(_0x285486)){_0x5b2f28['message']=utils[_0x9191('0x72')][_0x9191('0x83')];return _0x10527e(msgResponse(_0x9191('0x98'),_0x9191('0x99'),_0x5a6cbb+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x285486)){_0x5b2f28['message']=utils[_0x9191('0x72')][_0x9191('0x9a')];return _0x10527e(msgResponse(_0x9191('0x98'),_0x9191('0x99'),_0x5a6cbb+_0x9191('0x9b')));}if(_0x112d90&&_[_0x9191('0x47')](config['timezones'][_0x112d90])){_0x5b2f28['message']=utils[_0x9191('0x72')][_0x9191('0x9c')];return _0x10527e(msgResponse(_0x9191('0x98'),_0x9191('0x99'),_0x5a6cbb+_0x9191('0x9d')+_0x112d90));}if(_[_0x9191('0x9e')](_0x285486)){for(var _0x2acc1c=0x0;_0x2acc1c<_0x285486[_0x9191('0x9f')];_0x2acc1c+=0x1){_0x1c54f8[_0x9191('0xa0')](ami[_0x9191('0xa1')]({'action':_0x9191('0xa2'),'command':util[_0x9191('0x4d')]('iftime\x20%s,%s',_0x285486[_0x2acc1c][_0x9191('0xa3')],!_['isUndefined'](config[_0x9191('0xa4')][_0x112d90])?_0x112d90:'')})[_0x9191('0xa5')](function(_0x5dbff3){return _0x5dbff3['content'][_0x9191('0xa6')]('true')>=0x0;})['catch'](myreject(_0x10527e)));}}else{_0x1c54f8[_0x9191('0xa0')](ami[_0x9191('0xa1')]({'action':_0x9191('0xa2'),'command':util['format'](_0x9191('0xa7'),_0x285486,!_[_0x9191('0x47')](config[_0x9191('0xa4')][_0x112d90])?_0x112d90:'')})[_0x9191('0xa5')](function(_0x355402){return _0x355402[_0x9191('0xa8')]['indexOf'](_0x9191('0xa9'))>=0x0;})[_0x9191('0xaa')](myreject(_0x10527e)));}Promise[_0x9191('0xab')](_0x1c54f8)[_0x9191('0xa5')](function(_0x308166){var _0x54c801=_['some'](_0x308166);if(_0x54c801){return _0x333bb4(_0x54c801);}else{_0x5b2f28[_0x9191('0x71')]=_0x525d36?utils['CAMPAIGN_STATUS'][_0x9191('0xac')]:utils[_0x9191('0x72')]['OVERTIME_INTERVAL'];return _0x10527e(msgResponse(_0x9191('0xad'),_0x9191('0x99'),_0x9191('0xae')+_0x525d36+'\x20'+_0x5a6cbb+_0x9191('0xaf')+util[_0x9191('0x70')](_0x285486,{'showHidden':![],'depth':null})+_0x9191('0xb0')+_0x112d90));}})[_0x9191('0xaa')](function(_0x20ed12){return _0x10527e(msgResponse(_0x9191('0x98'),'Failure',JSON[_0x9191('0x7e')](_0x20ed12)));});});};Dialer[_0x9191('0x1c')][_0x9191('0x43')]=function(){var _0x2edf64=this;return cmHopper[_0x9191('0xb1')]({'active':![]},{'where':{'active':!![]}})[_0x9191('0xa5')](function(){setInterval(function(){_0x2edf64[_0x9191('0xb2')]();},0x3e8);});};Dialer[_0x9191('0x1c')][_0x9191('0xb2')]=function(){var _0x980b72=this;var _0x20be0f;for(var _0x1157ea in this[_0x9191('0x22')]){if(typeof this[_0x9191('0x22')][_0x1157ea]!==_0x9191('0xb3')){_0x20be0f=this[_0x9191('0x22')][_0x1157ea];if(utils[_0x9191('0x86')](_0x20be0f)&&utils[_0x9191('0x84')](_0x20be0f)){_0x20be0f[_0x9191('0x89')]=!![];Promise[_0x9191('0xb4')]()['then'](checkIsIVRCampaignActive(_0x20be0f))['then'](checkInterval(_0x20be0f))[_0x9191('0xa5')](_0x980b72['checkIsTrunkReachable'](_0x20be0f))[_0x9191('0xa5')](_0x980b72[_0x9191('0x95')](_0x20be0f['dialGlobalInterval'],_0x20be0f[_0x9191('0xb5')],_0x20be0f[_0x9191('0x4e')],_0x20be0f))['then'](_0x980b72[_0x9191('0x96')](_0x20be0f[_0x9191('0x80')],_0x20be0f[_0x9191('0xb5')],_0x20be0f[_0x9191('0x4e')],_0x20be0f))['then'](_0x980b72[_0x9191('0xb6')](_0x20be0f))['catch'](loggerCatchQueueSummary(_0x9191('0xb7'),_0x20be0f));}else{notSendMessagesCampaign(_0x20be0f);}}}};Dialer[_0x9191('0x1c')][_0x9191('0xb8')]=function(_0x160081){if(_0x160081['dialMethod']!=='predictive'){clearPredictiveAttributes(_0x160081);}switch(_0x160081[_0x9191('0xb9')]){case'progressive':this[_0x9191('0xba')](_0x160081,0x1);break;case _0x9191('0xbb'):this[_0x9191('0xba')](_0x160081,_0x160081['dialPowerLevel']);break;case _0x9191('0xb'):this[_0x9191('0xb')](_0x160081);break;case _0x9191('0xa'):this['handlePower'](_0x160081,0x1);break;default:logger[_0x9191('0x6e')](_0x9191('0xbc'),_0x160081[_0x9191('0x4e')],_0x9191('0xbd'));}};Dialer[_0x9191('0x1c')][_0x9191('0x98')]=function(_0x2f71c0,_0x32613d){var _0x3594e7=_0x2f71c0[_0x9191('0xb5')];var _0x5d16a2=_0x32613d?_0x2f71c0['dialGlobalInterval']:_0x2f71c0['Interval'][_0x9191('0x82')];logger[_0x9191('0xbe')](_0x9191('0xbf'),_0x5d16a2,_0x3594e7,_0x2f71c0['name'],util[_0x9191('0x4d')](_0x9191('0xc0'),_0x2f71c0['name'],_0x2f71c0['id']));var _0x5757cd=null;return Interval[_0x9191('0xc1')](_0x5d16a2,_0x3594e7)[_0x9191('0xa5')](function(_0x2787ab){if(_0x2787ab===!![]){return _0x2787ab;}else{_0x2f71c0[_0x9191('0x71')]=_0x32613d?utils[_0x9191('0x72')][_0x9191('0xac')]:utils[_0x9191('0x72')][_0x9191('0xc2')];_0x5757cd=msgResponse('[ifTime][promiseAll]',_0x9191('0x99'),'Global:\x20'+_0x32613d+'\x20'+_0x2f71c0[_0x9191('0x4e')]+_0x9191('0xaf')+util[_0x9191('0x70')](_0x5d16a2,{'showHidden':![],'depth':null})+_0x9191('0xb0')+_0x3594e7);}if(_0x5757cd!==null){logger[_0x9191('0xbe')](_0x9191('0xc3'),_0x5757cd);_0x5757cd[_0x9191('0xc4')]=_0x32613d;throw _0x5757cd;}})[_0x9191('0xaa')](function(_0x40ed2a){logger[_0x9191('0x6e')](_0x9191('0xc5'),_0x40ed2a);throw msgResponse(_0x9191('0xc6'),_0x9191('0x8c'),util[_0x9191('0x70')](_0x40ed2a,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x9191('0x2f')]=function(_0x2516ff){if(this[_0x9191('0x21')][_0x2516ff['queue']]){if(this['uniqueId'][_0x2516ff[_0x9191('0xc7')]]&&this['uniqueId'][_0x2516ff[_0x9191('0xc7')]][_0x9191('0x49')]!==_0x9191('0xc8')){this['updateOriginated'](this[_0x9191('0x21')][_0x2516ff['queue']]);this['uniqueId'][_0x2516ff[_0x9191('0xc7')]]['answertime']=moment()['format'](_0x9191('0xc9'));}}};Dialer[_0x9191('0x1c')][_0x9191('0x35')]=function(_0x2080a9){var _0x54cee6=this['uniqueId'][_0x2080a9[_0x9191('0xc7')]];if(this[_0x9191('0x21')][_0x2080a9[_0x9191('0xca')]]){if(_0x54cee6&&_0x54cee6[_0x9191('0x49')]!==_0x9191('0xc8')){delete this[_0x9191('0x29')][_0x2080a9[_0x9191('0xc7')]];this[_0x9191('0x21')][_0x2080a9[_0x9191('0xca')]]['outboundAnswerCallsDay']+=0x1;var _0xe0bcdb=new AgentComplete(_0x54cee6,_0x2080a9);if(_0x2080a9[_0x9191('0xcb')]===_0x9191('0xcc')){_0xe0bcdb['agiafterat']=this[_0x9191('0x21')][_0x2080a9[_0x9191('0xca')]][_0x9191('0xcd')]&&this[_0x9191('0x21')][_0x2080a9[_0x9191('0xca')]][_0x9191('0xce')]?moment()['format'](_0x9191('0xc9')):undefined;}hopperUtils['createHistory'](_0xe0bcdb)[_0x9191('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x9191('0xcf')](_0xe0bcdb)['catch'](loggerCatch(_0x9191('0xd0')));}}};Dialer['prototype'][_0x9191('0x31')]=function(_0x2ea2f4){var _0xa4088b=this[_0x9191('0x29')][_0x2ea2f4[_0x9191('0xc7')]];var _0x317f1a=this;var _0x4e4b77=![];var _0x5230cf;var _0x5ad6e9;if(this[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]]){if(_0xa4088b&&_0xa4088b[_0x9191('0x49')]!==_0x9191('0xc8')){delete this[_0x9191('0x29')][_0x2ea2f4[_0x9191('0xc7')]];this['updateOriginated'](this[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]]);_0xa4088b['droptime']=moment()[_0x9191('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4105c6=new QueueCallerAbandon(_0xa4088b,_0x2ea2f4);if(utils[_0x9191('0x68')](_0xa4088b[_0x9191('0xd1')],_0xa4088b['responsetime'])>=_0xa4088b[_0x9191('0xd2')]){this[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0x55')]+=0x1;this[_0x9191('0x21')][_0x2ea2f4['queue']][_0x9191('0xd3')]+=0x1;this[_0x9191('0x21')][_0x2ea2f4['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4105c6[_0x9191('0xd4')]=0xa;_0x4105c6[_0x9191('0x79')]=_0x9191('0xd5');_0x4105c6[_0x9191('0xd6')]=_0x9191('0xd7');_0x4105c6[_0x9191('0xd8')]=this['voiceQueues'][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0xcd')]?moment()['format'](_0x9191('0xc9')):undefined;_0x4105c6[_0x9191('0xd9')]+=0x1;_0x4105c6['countglobal']+=0x1;_0x5230cf=this[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0xda')];_0x5ad6e9=this[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0xdb')];hopperUtils['verifyAdditionalPhones'](_0x4105c6,_0x4105c6[_0x9191('0xd4')],_0xa4088b[_0x9191('0xdc')])[_0x9191('0xa5')](function(_0xe40d7d){_0x4e4b77=_0xe40d7d[_0x9191('0xdd')]==0x1;if(_0x4105c6[_0x9191('0xd9')]>=_0x317f1a[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]]['dialDropMaxRetry']){_0x317f1a[_0x9191('0xde')](_0x4105c6,_0xe40d7d[_0x9191('0xdd')]);}else{hopperUtils[_0x9191('0xdf')]({'active':![],'countdropretry':_0x4105c6[_0x9191('0xd9')],'scheduledat':moment()[_0x9191('0xe0')](_0x317f1a[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]]['dialDropRetryFrequency'],_0x9191('0xe1'))[_0x9191('0x4d')](_0x9191('0xc9')),'ContactId':_0xa4088b[_0x9191('0xe2')],'ListId':_0xa4088b[_0x9191('0xe3')],'VoiceQueueId':_0xa4088b[_0x9191('0xe4')]||undefined,'CampaignId':_0xa4088b[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0xe6')));var _0x14702a=new History(_0x4105c6);_0x14702a['state']=0xa;_0x14702a[_0x9191('0x79')]=_0x9191('0xd5');_0x14702a[_0x9191('0x7b')]=moment()['format'](_0x9191('0xc9'));_0x14702a[_0x9191('0x7a')]=_0x14702a[_0x9191('0x7b')];_0x14702a[_0x9191('0xe7')]=_0x4105c6['calleridname'];_0x14702a[_0x9191('0xe8')]=_0x4105c6['calleridnum'];hopperUtils[_0x9191('0xe9')](_0x14702a)[_0x9191('0xaa')](loggerCatch(_0x9191('0xea')));}})[_0x9191('0xa5')](function(){if(_0x4e4b77)hopperUtils[_0x9191('0xeb')](_0x4105c6,_0x5230cf,_0x5ad6e9)[_0x9191('0xa5')](function(){return 0x1;});});}else{this[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0x57')]+=0x1;this[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0xec')]+=0x1;_0x4105c6[_0x9191('0xd4')]=0xb;_0x4105c6['statedesc']=_0x9191('0xed');_0x4105c6[_0x9191('0xd6')]=_0x9191('0xee');_0x4105c6[_0x9191('0xef')]+=0x1;_0x4105c6[_0x9191('0xf0')]+=0x1;_0x5230cf=this[_0x9191('0x21')][_0x2ea2f4['queue']]['dialAbandonedRetryFrequency'];_0x5ad6e9=this['voiceQueues'][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0xdb')];hopperUtils[_0x9191('0xf1')](_0x4105c6,_0x4105c6['state'],_0xa4088b[_0x9191('0xdc')])[_0x9191('0xa5')](function(_0x5186e4){if(_0x4105c6['countabandonedretry']>=_0x317f1a['voiceQueues'][_0x2ea2f4[_0x9191('0xca')]]['dialAbandonedMaxRetry']){_0x317f1a['queueCallerAbandonCreateState'](_0x4105c6,_0x5186e4[_0x9191('0xdd')]);}else{hopperUtils[_0x9191('0xdf')]({'active':![],'countabandonedretry':_0x4105c6[_0x9191('0xef')],'scheduledat':moment()[_0x9191('0xe0')](_0x317f1a[_0x9191('0x21')][_0x2ea2f4[_0x9191('0xca')]][_0x9191('0xf2')],_0x9191('0xe1'))[_0x9191('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa4088b[_0x9191('0xe2')],'ListId':_0xa4088b[_0x9191('0xe3')],'VoiceQueueId':_0xa4088b['VoiceQueueId']||undefined,'CampaignId':_0xa4088b[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0xf3')));var _0x5a23fe=new History(_0x4105c6);_0x5a23fe[_0x9191('0xd4')]=0xb;_0x5a23fe['statedesc']=_0x9191('0xed');_0x5a23fe[_0x9191('0x7b')]=moment()[_0x9191('0x4d')](_0x9191('0xc9'));_0x5a23fe['endtime']=_0x5a23fe[_0x9191('0x7b')];_0x5a23fe[_0x9191('0xe7')]=_0x4105c6[_0x9191('0xe7')];_0x5a23fe[_0x9191('0xe8')]=_0x4105c6[_0x9191('0xe8')];hopperUtils[_0x9191('0xe9')](_0x5a23fe)['catch'](loggerCatch(_0x9191('0xf4')));}})[_0x9191('0xa5')](function(){if(_0x4e4b77)hopperUtils[_0x9191('0xeb')](_0x4105c6,_0x5230cf,_0x5ad6e9)['then'](function(){return 0x1;});});}}}};Dialer[_0x9191('0x1c')][_0x9191('0x3c')]=function(_0x516e88){if(this[_0x9191('0x27')][_0x516e88[_0x9191('0xc7')]]){this[_0x9191('0x27')][_0x516e88[_0x9191('0xc7')]]['channel']=_0x516e88[_0x9191('0xf5')];}if(this[_0x9191('0x29')][_0x516e88[_0x9191('0xc7')]]){this[_0x9191('0x29')][_0x516e88[_0x9191('0xc7')]][_0x9191('0xf5')]=_0x516e88[_0x9191('0xf5')];}};Dialer[_0x9191('0x1c')][_0x9191('0x40')]=function(_0x31a146){if(!this[_0x9191('0x27')][_0x31a146['actionid']]){return;}var _0x4d445f=this[_0x9191('0x21')][this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]]['queue']]['strategy']||'rrmemory';if(_0x4d445f===_0x9191('0xf7')){if(this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]]&&_[_0x9191('0xf8')](this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]][_0x9191('0xf9')])&&_0x31a146[_0x9191('0x90')]==='1'&&_0x31a146['paused']==='0'){if(this['agents'][_0x31a146['stateinterface']]){if(!this[_0x9191('0x23')][_0x31a146[_0x9191('0xfa')]][_0x9191('0xf9')]){this[_0x9191('0x23')][_0x31a146[_0x9191('0xfa')]][_0x9191('0xf9')]=!![];this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]][_0x9191('0xf9')]=!![];this[_0x9191('0x27')][_0x31a146['actionid']][_0x9191('0xfa')]=_0x31a146['stateinterface'];}}}}else if(_0x4d445f===_0x9191('0xfb')){if(this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]]){if(this['agents'][_0x31a146[_0x9191('0xfa')]]){this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]][_0x9191('0xfa')]=_0x31a146[_0x9191('0xfa')];if(_[_0x9191('0xf8')](this[_0x9191('0x2c')][this['actions'][_0x31a146[_0x9191('0xf6')]][_0x9191('0xca')]])){this['queueBooked'][this['actions'][_0x31a146[_0x9191('0xf6')]][_0x9191('0xca')]]=[];}this['queueBooked'][this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]]['queue']][_0x9191('0xa0')](_[_0x9191('0x67')](_[_0x9191('0x7f')](this[_0x9191('0x27')][_0x31a146[_0x9191('0xf6')]],['idHopper','stateinterface']),{'status':_0x31a146[_0x9191('0x90')],'paused':_0x31a146[_0x9191('0xfc')]}));}}}};Dialer[_0x9191('0x1c')][_0x9191('0x42')]=function(_0x4c5d07){if(!this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]]){return;}var _0xb76b64=this;var _0x443fe9=this[_0x9191('0x21')][this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xca')]];var _0x53f808=_0x443fe9[_0x9191('0xfd')]||_0x9191('0xfb');if(_0x53f808===_0x9191('0xf7')){if(this[_0x9191('0x27')][_0x4c5d07['actionid']]&&this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xfa')]){this['preview'][_0x9191('0xfe')](this[_0x9191('0x27')][_0x4c5d07['actionid']][_0x9191('0xff')],this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xfa')])[_0x9191('0xaa')](function(_0x2b5c13){logger[_0x9191('0x6e')](_0x9191('0x100'),util['inspect'](_0x2b5c13,{'showHidden':![],'depth':null}));})['finally'](function(){_0xb76b64['updateOriginated'](_0xb76b64[_0x9191('0x21')][_0xb76b64['actions'][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xca')]]);_0xb76b64[_0x9191('0x23')][_0xb76b64[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xfa')]][_0x9191('0xf9')]=![];delete _0xb76b64[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]];unlockQueueStatus(_0x443fe9);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xca')]]);hopperUtils[_0x9191('0xdf')]({'active':![],'ContactId':this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xe2')],'ListId':this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xe3')],'VoiceQueueId':this['actions'][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xe4')]||undefined,'CampaignId':this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xe5')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x9191('0x27')][_0x4c5d07['actionid']];unlockQueueStatus(_0x443fe9);}}else if(_0x53f808===_0x9191('0xfb')){var _0x3d1b1e;if(this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]]&&!_['isEmpty'](this[_0x9191('0x2c')][this[_0x9191('0x27')][_0x4c5d07['actionid']][_0x9191('0xca')]])){if(this[_0x9191('0x2d')][_0xb76b64[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xca')]]){this['queueBookedRR'][_0xb76b64[_0x9191('0x27')][_0x4c5d07['actionid']][_0x9191('0xca')]]=this[_0x9191('0x2d')][this[_0x9191('0x27')][_0x4c5d07['actionid']][_0x9191('0xca')]]?this['queueBookedRR'][this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]]['queue']]:this[_0x9191('0x2c')][this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xca')]]?this[_0x9191('0x2c')][this['actions'][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xca')]][_0x9191('0x101')]||0x0:0x0;}this[_0x9191('0x2c')][this[_0x9191('0x27')][_0x4c5d07[_0x9191('0xf6')]][_0x9191('0xca')]][_0x9191('0x101')]=this[_0x9191('0x2d')][this['actions'][_0x4c5d07['actionid']]['queue']];for(var _0x59c1dc=0x0;_0x59c1dc=_0x215395[_0x9191('0x125')]){_0xf38f78['stateGlobal'](_0x2f0ee3,_0x2e0f2a,_0x174a2b,_0x9191('0x126'));}else{if(_0x2f0ee3[_0x9191('0x121')]>=_0x215395[_0x9191('0x127')]){_0xf38f78['createStateFinal'](_0x2f0ee3,_0x2e0f2a,_0x174a2b,_0x9191('0x128'));}else{hopperUtils[_0x9191('0xdf')]({'active':![],'countmachineretry':_0x2f0ee3['countmachineretry'],'scheduledat':moment()[_0x9191('0xe0')](_0x215395[_0x9191('0x129')],_0x9191('0xe1'))[_0x9191('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f0ee3['ContactId'],'ListId':_0x2f0ee3[_0x9191('0xe3')],'VoiceQueueId':_0x2f0ee3['VoiceQueueId']||undefined,'CampaignId':_0x2f0ee3[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0x12a')));_0x2e0f2a({'reschedule':0x1});}}});}if(_0x3cc7a0[_0x9191('0x49')]==='ivr'&&this['campaigns'][_0x3cc7a0[_0x9191('0xca')]]['dialAMDActive']&&_0x107bea[_0x9191('0x12b')]===_0x9191('0x114')){delete this[_0x9191('0x29')][_0x107bea[_0x9191('0xc7')]];this[_0x9191('0x105')](this[_0x9191('0x22')][_0x3cc7a0[_0x9191('0xca')]]);_0x2b3d4b=new Hangup(_0x3cc7a0,_0x107bea);_0x2b3d4b[_0x9191('0xd4')]=0x12;_0x2b3d4b['statedesc']=_0x9191('0x117');_0x2b3d4b[_0x9191('0x118')]=_0x9191('0x120');ami[_0x9191('0x48')](_0x9191('0x119'),ut[_0x9191('0x11a')](_0x2b3d4b,_0x9191('0x11b')));this[_0x9191('0x11c')](_0x2b3d4b,_0x9191('0x12c'),_0x9191('0x12d'));}if(_0x3cc7a0[_0x9191('0x49')]===_0x9191('0xc8')&&this[_0x9191('0x22')][_0x3cc7a0[_0x9191('0xca')]][_0x9191('0x113')]&&_0x107bea[_0x9191('0x12b')]==='MACHINE'){return new Promise(function(_0x4e5f2e,_0x5e5e46){delete _0xf38f78['uniqueId'][_0x107bea[_0x9191('0xc7')]];_0xf38f78[_0x9191('0x105')](_0xf38f78[_0x9191('0x22')][_0x3cc7a0['queue']]);_0xf38f78[_0x9191('0x22')][_0x3cc7a0[_0x9191('0xca')]][_0x9191('0x115')]+=0x1;_0xf38f78['campaigns'][_0x3cc7a0[_0x9191('0xca')]][_0x9191('0x116')]+=0x1;var _0x4864d1=_0xf38f78[_0x9191('0x22')][_0x3cc7a0[_0x9191('0xca')]];var _0x97bdad=new Hangup(_0x3cc7a0,_0x107bea);_0x97bdad[_0x9191('0xd4')]=0x13;_0x97bdad['statedesc']=_0x9191('0x11f');_0x97bdad[_0x9191('0x118')]=_0x9191('0x120');_0x97bdad[_0x9191('0x121')]+=0x1;_0x97bdad['countglobal']+=0x1;_0x97bdad[_0x9191('0x11b')]=!![];ami[_0x9191('0x48')](_0x9191('0x119'),ut[_0x9191('0x11a')](_0x97bdad,'amd'));hopperUtils[_0x9191('0xe9')](_0x97bdad)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x97bdad[_0x9191('0x123')]+_0x97bdad[_0x9191('0x124')]+_0x97bdad['countnoanswerretry']+_0x97bdad[_0x9191('0x12e')]+_0x97bdad[_0x9191('0xd9')]+_0x97bdad[_0x9191('0xef')]+_0x97bdad[_0x9191('0x121')]+_0x97bdad[_0x9191('0x12f')]>=_0x4864d1[_0x9191('0x125')]){_0xf38f78[_0x9191('0x130')](_0x97bdad,_0x4e5f2e,_0x5e5e46,_0x9191('0x126'));}else{if(_0x97bdad[_0x9191('0x121')]>=_0x4864d1[_0x9191('0x127')]){_0xf38f78['createStateFinal'](_0x97bdad,_0x4e5f2e,_0x5e5e46,_0x9191('0x128'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x97bdad[_0x9191('0x121')],'scheduledat':moment()[_0x9191('0xe0')](_0x4864d1[_0x9191('0x129')],_0x9191('0xe1'))[_0x9191('0x4d')](_0x9191('0xc9')),'ContactId':_0x97bdad[_0x9191('0xe2')],'ListId':_0x97bdad[_0x9191('0xe3')],'VoiceQueueId':_0x97bdad[_0x9191('0xe4')]||undefined,'CampaignId':_0x97bdad[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0x12a')));_0x4e5f2e({'reschedule':0x1});}}});}}};Dialer[_0x9191('0x1c')][_0x9191('0x3b')]=function(_0x10478b){var _0x534343=this[_0x9191('0x29')][_0x10478b['uniqueid']];var _0x154b4c;if(_0x534343&&_0x534343[_0x9191('0x49')]===_0x9191('0xc8')){delete this[_0x9191('0x29')][_0x10478b['uniqueid']];this[_0x9191('0x105')](this['campaigns'][_0x534343[_0x9191('0xca')]]);this[_0x9191('0x22')][_0x534343[_0x9191('0xca')]][_0x9191('0x131')]+=0x1;_0x154b4c=new Hangup(_0x534343,_0x10478b);hopperUtils['createHistory'](_0x154b4c)[_0x9191('0xaa')](loggerCatch(_0x9191('0x132')));hopperUtils[_0x9191('0xcf')](_0x154b4c)[_0x9191('0xaa')](loggerCatch('[syncHangupIvr]'));}if(_0x534343&&_0x534343[_0x9191('0x49')]!==_0x9191('0xc8')&&isNotNull(this[_0x9191('0x21')][_0x534343[_0x9191('0xca')]][_0x9191('0x133')])){delete this['uniqueId'][_0x10478b['uniqueid']];this[_0x9191('0x105')](this[_0x9191('0x21')][_0x534343[_0x9191('0xca')]]);this['voiceQueues'][_0x534343[_0x9191('0xca')]][_0x9191('0x115')]+=0x1;this[_0x9191('0x21')][_0x534343[_0x9191('0xca')]][_0x9191('0x116')]+=0x1;_0x154b4c=new Hangup(_0x534343,_0x10478b);_0x154b4c['state']=0x10;_0x154b4c['statedesc']=_0x9191('0x134');_0x154b4c[_0x9191('0x118')]=_0x9191('0x135');hopperUtils[_0x9191('0xe9')](_0x154b4c)[_0x9191('0xaa')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x9191('0xcf')](_0x154b4c)[_0x9191('0xaa')](loggerCatch('[syncHangupIvr]'));}if(_0x534343&&_0x534343[_0x9191('0x49')]!==_0x9191('0xc8')&&!isNotNull(this['voiceQueues'][_0x534343[_0x9191('0xca')]][_0x9191('0x133')])){delete this['uniqueId'][_0x10478b[_0x9191('0xc7')]];this[_0x9191('0x105')](this['voiceQueues'][_0x534343['queue']]);this[_0x9191('0x21')][_0x534343[_0x9191('0xca')]][_0x9191('0x136')]+=0x1;_0x154b4c=new Hangup(_0x534343,_0x10478b);_0x154b4c[_0x9191('0xd4')]=0xc;_0x154b4c['statedesc']=_0x10478b[_0x9191('0x137')];_0x154b4c[_0x9191('0x118')]=_0x9191('0x138');hopperUtils[_0x9191('0xe9')](_0x154b4c)[_0x9191('0xaa')](loggerCatch(_0x9191('0x132')));hopperUtils[_0x9191('0xcf')](_0x154b4c)['catch'](loggerCatch(_0x9191('0x139')));}};Dialer['prototype'][_0x9191('0x37')]=function(_0x1efa41){var _0x497dcb=this;if(!_0x497dcb[_0x9191('0x13a')][_0x1efa41[_0x9191('0x4e')]]){_0x497dcb['queuesSummary'][_0x1efa41['name']]={'running':![]};}else if(_0x497dcb[_0x9191('0x13a')][_0x1efa41[_0x9191('0x4e')]]['running']===!![]){return;}else if(_0x497dcb['queuesSummary'][_0x1efa41[_0x9191('0x4e')]][_0x9191('0x13b')]===![]){_0x497dcb['queuesSummary'][_0x1efa41[_0x9191('0x4e')]]['running']=!![];}var _0x625e94=_0x497dcb[_0x9191('0x21')][_0x1efa41[_0x9191('0x4e')]];var _0x5b9086=_0x625e94[_0x9191('0x71')]!==utils[_0x9191('0x72')][_0x9191('0x85')];var _0x19e1b3=utils['isPreviewCampaign'](_0x625e94);_0x625e94[_0x9191('0x13c')]=utils[_0x9191('0x13d')](_0x625e94,_0x497dcb['trunks']);Promise[_0x9191('0xb4')]()[_0x9191('0xa5')](function(){if(_0x625e94[_0x9191('0x13c')]===utils[_0x9191('0x72')][_0x9191('0x85')]){if(_0x5b9086){clearPredictiveAttributes(_0x625e94);_0x1efa41[_0x9191('0x6a')]=undefined;_0x1efa41[_0x9191('0x69')]=undefined;}if(_0x625e94[_0x9191('0x13c')]===utils[_0x9191('0x72')]['INACTIVE']){_0x1efa41[_0x9191('0x13e')]=0x0;_0x1efa41['paused']=0x0;_0x1efa41['inUse']=0x0;_0x1efa41['talking']=0x0;_0x1efa41[_0x9191('0x13f')]=0x0;}}else if(_0x625e94[_0x9191('0x13c')]===utils[_0x9191('0x72')][_0x9191('0x140')]&&!_0x19e1b3){return _0x497dcb[_0x9191('0x98')](_0x625e94,!![])[_0x9191('0xa5')](function(){return _0x497dcb[_0x9191('0x98')](_0x625e94,![]);})['then'](function(){return _0x497dcb[_0x9191('0xb8')](_0x625e94);})[_0x9191('0xaa')](function(_0x582e42){loggerSyncQueueSummary[_0x9191('0x4b')]('[syncQueueSummary]',util[_0x9191('0x70')](_0x582e42,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x625e94);});}else{clearPredictiveAttributes(_0x625e94);}})[_0x9191('0xa5')](function(){var _0x3a505b=_0x1efa41[_0x9191('0x141')](_0x625e94);if(_0x3a505b||_0x625e94[_0x9191('0x142')]){_0x625e94['queueSummaryCountersUpdated']=![];_0x1efa41[_0x9191('0x143')](_0x625e94);Object[_0x9191('0x144')](_0x625e94,_0x1efa41);emitOutboundVoiceQueueSummary(_0x1efa41);}_0x497dcb[_0x9191('0x13a')][_0x625e94[_0x9191('0x4e')]][_0x9191('0x13b')]=![];})[_0x9191('0xaa')](function(_0x4bac9c){logger[_0x9191('0x6e')](_0x9191('0x145'),util[_0x9191('0x70')](_0x4bac9c,{'showHidden':![],'depth':null}));_0x497dcb[_0x9191('0x13a')][_0x625e94['name']][_0x9191('0x13b')]=![];});};Dialer[_0x9191('0x1c')]['syncQueueSummaryComplete']=_[_0x9191('0x146')](function(){var _0x5eb62f=_[_0x9191('0x147')](this[_0x9191('0x21')],function(_0x1f8960){return _0x1f8960[_0x9191('0x148')];});var _0x37e3bf=_[_0x9191('0x147')](this['agents'],function(_0x28c1c3){return _0x28c1c3['online']&&_0x28c1c3[_0x9191('0x90')]===_0x9191('0x91');});if(_0x5eb62f[_0x9191('0x9f')]>0x0&&_0x37e3bf[_0x9191('0x9f')]>0x0){return Promise['resolve']()[_0x9191('0xa5')](cmHopper[_0x9191('0x149')](_['map'](_0x5eb62f,'id'),previewRecallmeReminderInterval,_[_0x9191('0x14a')](_0x37e3bf,'id')))[_0x9191('0xa5')](function(_0x5764e1){for(var _0x4be390=0x0;_0x4be390<_0x5764e1['length'];_0x4be390++){var _0x458027=_0x5764e1[_0x4be390][_0x9191('0x14b')][_0x9191('0x4e')];if(_0x458027)io['to'](util[_0x9191('0x4d')](_0x9191('0x14c'),_0x458027))[_0x9191('0x48')](_0x9191('0x14d'),{'hopper':_0x5764e1[_0x4be390]});}})[_0x9191('0xaa')](function(_0x1db0f0){logger[_0x9191('0x6e')]('checkPreviewRecallReminder',_0x1db0f0);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9191('0x1c')][_0x9191('0x44')]=function(){var _0x3f5d92=this;setInterval(function(){_0x3f5d92['clearZombieChannels'](_0x3f5d92[_0x9191('0x29')],_0x9191('0x14e'));_0x3f5d92[_0x9191('0x14f')](_0x3f5d92[_0x9191('0x27')],_0x9191('0x150'));},0x32c8);};Dialer['prototype'][_0x9191('0x14f')]=function(_0x20e7ae,_0x3ca5fc){var _0x14ffc3=this;for(var _0x3c8080 in _0x20e7ae){if(typeof _0x20e7ae[_0x3c8080]!=='undefined'){this[_0x9191('0x151')][_0x9191('0x1d')](function(){if(!_[_0x9191('0xf8')](_0x20e7ae[_0x3c8080])){return ami['Action']({'action':_0x9191('0x90'),'channel':_0x20e7ae[_0x3c8080][_0x9191('0xf5')]})[_0x9191('0xaa')](function(_0x374a85){if(_0x374a85['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x20e7ae[_0x3c8080]&&_0x20e7ae[_0x3c8080]['type']!==_0x9191('0xc8')){_0x14ffc3['updateOriginated'](_0x14ffc3[_0x9191('0x21')][_0x20e7ae[_0x3c8080][_0x9191('0xca')]]);logger[_0x9191('0x6e')](_0x9191('0x152'),_0x3ca5fc,_0x3c8080,_0x20e7ae[_0x3c8080][_0x9191('0xca')]);delete _0x20e7ae[_0x3c8080];}if(_0x20e7ae[_0x3c8080]&&_0x20e7ae[_0x3c8080][_0x9191('0x49')]===_0x9191('0xc8')){_0x14ffc3['updateOriginated'](_0x14ffc3[_0x9191('0x22')][_0x20e7ae[_0x3c8080][_0x9191('0xca')]]);logger[_0x9191('0x6e')]('[Dialer][checkChannel][ivr]',_0x3ca5fc,_0x3c8080,_0x20e7ae[_0x3c8080][_0x9191('0xca')]);delete _0x20e7ae[_0x3c8080];}},0x2328);}});}});}}};Dialer[_0x9191('0x1c')][_0x9191('0x153')]=function(_0x5d3e55){return Promise[_0x9191('0xb4')]()[_0x9191('0xa5')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5d3e55))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x9191('0x105')]=function(_0x4c1404){if(!_[_0x9191('0x47')](_0x4c1404)&&_0x4c1404!==null){if(typeof _0x4c1404['originated']!==_0x9191('0xb3')){if(_0x4c1404['originated']>0x0){_0x4c1404['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9191('0x6e')](_0x9191('0x154'));}};Dialer[_0x9191('0x1c')][_0x9191('0x155')]=function(_0x2037e7,_0x5cbce8){var _0x23ef7d=this;return function(_0x530401){_0x23ef7d['updateOriginated'](_0x5cbce8);logger[_0x9191('0x6e')](_0x2037e7,util['inspect'](_0x530401,{'showHidden':![],'depth':null}));};};Dialer[_0x9191('0x1c')][_0x9191('0x156')]=function(_0x9766a0,_0x5cf529,_0x46b5f3){var _0x22b4dd={'state':0x19,'statedesc':_0x9191('0x157')};this['updateOriginated'](_0x5cf529);this[_0x9191('0x11c')](_['merge'](_0x22b4dd,_['pick'](_0x46b5f3,[_0x9191('0xe2'),_0x9191('0xe3'),_0x9191('0x158'),_0x9191('0xe4'),_0x9191('0xe5')])),_0x9191('0x159'),_0x9191('0x15a'));logger[_0x9191('0x6e')](_0x9766a0);};Dialer['prototype']['saveInDb']=function(_0x1f2a7a,_0x3fb081,_0x69cfdf){hopperUtils[_0x9191('0xe9')](_0x1f2a7a)['catch'](loggerCatch(_0x3fb081));hopperUtils[_0x9191('0xcf')](_0x1f2a7a)[_0x9191('0xaa')](loggerCatch(_0x69cfdf));};Dialer[_0x9191('0x1c')][_0x9191('0xde')]=function(_0x33e0c3,_0x1e0e15){hopperUtils[_0x9191('0xe9')](_0x33e0c3)['catch'](loggerCatch(_0x9191('0x15b')));if(_0x1e0e15==0x0){hopperUtils[_0x9191('0xcf')](_0x33e0c3)[_0x9191('0xaa')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x9191('0x1c')][_0x9191('0x15c')]=function(_0x28baac){return Promise[_0x9191('0xb4')]()[_0x9191('0xa5')](cmHopper[_0x9191('0x149')](_0x28baac['id'],previewRecallmeReminderInterval))[_0x9191('0xa5')](function(_0x1548ed){for(var _0x13e1e5=0x0;_0x13e1e5<_0x1548ed[_0x9191('0x9f')];_0x13e1e5++){var _0x36cb4=_0x1548ed[_0x13e1e5]['Agent']['name'];if(_0x36cb4)io['to'](util[_0x9191('0x4d')](_0x9191('0x14c'),_0x36cb4))[_0x9191('0x48')](_0x9191('0x14d'),{'hopper':_0x1548ed[_0x13e1e5]});}})[_0x9191('0xaa')](function(){});};Dialer[_0x9191('0x1c')][_0x9191('0xb6')]=function(_0x3d6aff){var _0xccc2aa=this;return function(){_0xccc2aa[_0x9191('0x15d')](_0x3d6aff);};};Dialer[_0x9191('0x1c')][_0x9191('0x15e')]=function(_0x4f943f,_0x5d3009){var _0x442640=this;var _0x44a275=uuid['v4']();this[_0x9191('0x27')][_0x44a275]=new Action(_0x4f943f,_0x5d3009,_0x44a275);return new Promise(function(_0xaf39fa,_0x1e2fed){if(_[_0x9191('0x47')](_0x4f943f)&&typeof _0x4f943f!==_0x9191('0x15f')){return _0x1e2fed(msgResponse(_0x9191('0x160'),_0x9191('0x99'),'voiceQueue\x20is\x20undefine'));}if(_[_0x9191('0x47')](_0x5d3009['phone'])||_0x5d3009['phone']===null){return _0x1e2fed(msgResponse(_0x9191('0x160'),_0x9191('0x99'),_0x9191('0x161')));}var _0x5cc397={'XMD-CALLERID':_0x442640[_0x9191('0x27')][_0x44a275][_0x9191('0x162')](),'XMD-AGI':_0x4f943f[_0x9191('0x133')]?util[_0x9191('0x4d')](_0x9191('0x163'),ipAgi,_0x4f943f[_0x9191('0x133')]):'NONE','XMD-AGIAFTER':_0x4f943f[_0x9191('0xcd')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x4f943f[_0x9191('0xcd')]):'NONE','XMD-QUEUE':utils[_0x9191('0x164')](_0x4f943f)?util['format'](_0x9191('0x165'),_0x4f943f[_0x9191('0x4e')],_0x4f943f[_0x9191('0x166')]||'',_0x4f943f['dialAgiAfterHangupAgent']?'c':'',_0x4f943f['dialQueueTimeout']||0x3):_0x9191('0x167'),'XMD-CONTACTID':_0x5d3009['ContactId'],'XMD-CDRTYPE':_0x9191('0x9'),'CALLERID(all)':_0x442640[_0x9191('0x27')][_0x44a275][_0x9191('0x162')](),'XMD-AMD':_0x4f943f[_0x9191('0x113')]?_0x9191('0x140'):_0x9191('0x167'),'XMD-DESTINATION':_0x9191('0x112')};if(_0x4f943f[_0x9191('0x113')]){_0x5cc397[_0x9191('0x168')]=_0x4f943f[_0x9191('0x169')]||0x9c4;_0x5cc397['XMD-AMDGREETING']=_0x4f943f[_0x9191('0x16a')]||0x5dc;_0x5cc397[_0x9191('0x16b')]=_0x4f943f[_0x9191('0x16c')]||0x320;_0x5cc397[_0x9191('0x16d')]=_0x4f943f[_0x9191('0x16e')]||0x1388;_0x5cc397[_0x9191('0x16f')]=_0x4f943f[_0x9191('0x170')]||0x64;_0x5cc397['XMD-AMDBETWEENWORDSSILENCE']=_0x4f943f[_0x9191('0x171')]||0x32;_0x5cc397[_0x9191('0x172')]=_0x4f943f[_0x9191('0x173')]||0x3;_0x5cc397[_0x9191('0x174')]=_0x4f943f[_0x9191('0x175')]||0x100;_0x5cc397[_0x9191('0x176')]=_0x4f943f[_0x9191('0x177')]||0x1388;}if(utils[_0x9191('0x164')](_0x4f943f)){_0x5cc397[_0x9191('0x178')]=_0x5d3009[_0x9191('0xe4')];}else{_0x5cc397[_0x9191('0x179')]=_0x5d3009[_0x9191('0xe5')];}for(var _0x52ec6c in _0x5d3009[_0x9191('0x17a')]){if(typeof _0x5d3009[_0x9191('0x17a')][_0x52ec6c]!==_0x9191('0xb3')){if(isNotNull(_0x5d3009[_0x9191('0x17a')][_0x52ec6c])&&_0x52ec6c!=='id'&&_0x52ec6c!==_0x9191('0x17b')&&_0x52ec6c!=='createdAt'&&_0x52ec6c!==_0x9191('0x17c')){_0x5cc397[util[_0x9191('0x4d')](_0x9191('0x17d'),_0x9191('0x17e'),_[_0x9191('0x17f')](_0x52ec6c))]=_0x5d3009[_0x9191('0x17a')][_0x52ec6c];}}}var _0x1bc823=_0x442640['isTrunkReachable'](_0x4f943f[_0x9191('0x180')])?utils[_0x9191('0x181')](_0x4f943f[_0x9191('0x180')][_0x9191('0x182')],_0x4f943f['dialOriginateCallerIdName'],_0x4f943f[_0x9191('0x183')]>0x0?utils[_0x9191('0x184')](_0x4f943f[_0x9191('0x185')],_0x4f943f[_0x9191('0x183')]):_0x4f943f['dialOriginateCallerIdNumber']):utils[_0x9191('0x181')](_[_0x9191('0xf8')](_0x4f943f[_0x9191('0x186')])?_0x4f943f['Trunk'][_0x9191('0x182')]:_0x4f943f[_0x9191('0x186')]['callerid'],_0x4f943f['dialOriginateCallerIdName'],_0x4f943f[_0x9191('0x183')]>0x0?utils[_0x9191('0x184')](_0x4f943f[_0x9191('0x185')],_0x4f943f[_0x9191('0x183')]):_0x4f943f[_0x9191('0x185')]);if(_0x1bc823){_0x5cc397[_0x9191('0x187')]=_0x442640['actions'][_0x44a275][_0x9191('0x188')]=utils[_0x9191('0x189')](_0x1bc823);_0x5cc397['XMD-ORIGINATECALLERIDNUM']=_0x5d3009[_0x9191('0x18a')];}_0x4f943f['variables']=_0x5cc397;return ami['Action']({'actionid':_0x44a275,'action':_0x9191('0x160'),'channel':_0x442640[_0x9191('0x8d')](_0x4f943f[_0x9191('0x180')])?util['format'](_0x9191('0x18b'),_0x4f943f[_0x9191('0x180')][_0x9191('0x4e')],isNotNull(_0x4f943f['dialPrefix'])?_0x4f943f[_0x9191('0x18c')][_0x9191('0x18d')]()||'':'',_0x4f943f[_0x9191('0x18e')]>0x0?_0x5d3009[_0x9191('0x18a')]['substring'](_0x4f943f['dialCutDigit']):_0x5d3009['phone']):util['format']('SIP/%s/%s%s',_[_0x9191('0xf8')](_0x4f943f[_0x9191('0x186')])?_0x4f943f[_0x9191('0x180')][_0x9191('0x4e')]:_0x4f943f[_0x9191('0x186')]['name'],isNotNull(_0x4f943f[_0x9191('0x18c')])?_0x4f943f[_0x9191('0x18c')]['trim']()||'':'',_0x4f943f[_0x9191('0x18e')]>0x0?_0x5d3009[_0x9191('0x18a')][_0x9191('0x18f')](_0x4f943f[_0x9191('0x18e')]):_0x5d3009[_0x9191('0x18a')]),'callerid':_0x1bc823,'Exten':'xcally-motion-dialer','Context':_0x9191('0x190'),'Priority':'1','variable':_0x5cc397,'timeout':(_0x4f943f[_0x9191('0x191')]||0x1e)*0x3e8,'async':!![],'channelid':_0x44a275})[_0x9191('0xa5')](function(_0x34ff94){return _0xaf39fa(_0x34ff94);})['catch'](function(_0x32c08e){_0x4f943f[_0x9191('0x192')]+=0x1;var _0x35089d=new History(_0x442640[_0x9191('0x27')][_0x44a275]);logger[_0x9191('0x6e')](util['format']('[originateError]:\x20%s',JSON[_0x9191('0x7e')](_0x32c08e)));_0x35089d['state']=0xe;_0x35089d[_0x9191('0x79')]=_0x9191('0x193');_0x35089d[_0x9191('0x7b')]=moment()[_0x9191('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x35089d[_0x9191('0x7a')]=_0x35089d[_0x9191('0x7b')];hopperUtils[_0x9191('0xe9')](_0x35089d)[_0x9191('0xaa')](loggerCatch(_0x9191('0x194')));_0x442640[_0x9191('0xcf')](_0x35089d)[_0x9191('0xaa')](loggerCatch(_0x9191('0x194')))[_0x9191('0x1f')](function(){delete _0x442640['actions'][_0x44a275];return _0x1e2fed(msgResponse('originate',_0x9191('0x8c'),_0x9191('0x195')));});});});};Dialer['prototype'][_0x9191('0x196')]=function(_0x2c6c7e,_0x3224bc,_0x354d55){var _0x1d80aa=new History(_0x3224bc);if(_0x1d80aa[_0x9191('0x123')]+_0x1d80aa[_0x9191('0x124')]+_0x1d80aa[_0x9191('0x197')]+_0x1d80aa[_0x9191('0x12e')]+_0x1d80aa[_0x9191('0xd9')]+_0x1d80aa[_0x9191('0xef')]+_0x1d80aa['countmachineretry']+_0x1d80aa[_0x9191('0x12f')]>=_0x354d55[_0x9191('0x125')]-0x1){return!![];}switch(_0x2c6c7e){case 0x3:if(_0x1d80aa[_0x9191('0x197')]>=_0x354d55[_0x9191('0x198')]-0x1){return!![];}hopperUtils[_0x9191('0xdf')]({'active':![],'countnoanswerretry':_0x1d80aa['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x9191('0xe0')](_0x354d55['dialNoAnswerRetryFrequency'],_0x9191('0xe1'))[_0x9191('0x4d')](_0x9191('0xc9')),'ContactId':_0x1d80aa[_0x9191('0xe2')],'ListId':_0x1d80aa[_0x9191('0xe3')],'VoiceQueueId':_0x1d80aa[_0x9191('0xe4')]||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})['catch'](loggerCatch(_0x9191('0x199')));break;case 0x5:if(_0x1d80aa[_0x9191('0x123')]>=_0x354d55[_0x9191('0x19a')]-0x1){return!![];}hopperUtils[_0x9191('0xdf')]({'active':![],'countbusyretry':_0x1d80aa[_0x9191('0x123')]+=0x1,'scheduledat':moment()['add'](_0x354d55[_0x9191('0x19b')],_0x9191('0xe1'))['format'](_0x9191('0xc9')),'ContactId':_0x1d80aa['ContactId'],'ListId':_0x1d80aa['ListId'],'VoiceQueueId':_0x1d80aa['VoiceQueueId']||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1d80aa[_0x9191('0x124')]>=_0x354d55[_0x9191('0x19c')]-0x1){return!![];}hopperUtils[_0x9191('0xdf')]({'active':![],'countcongestionretry':_0x1d80aa[_0x9191('0x124')]+=0x1,'scheduledat':moment()[_0x9191('0xe0')](_0x354d55[_0x9191('0x19d')],_0x9191('0xe1'))['format'](_0x9191('0xc9')),'ContactId':_0x1d80aa[_0x9191('0xe2')],'ListId':_0x1d80aa['ListId'],'VoiceQueueId':_0x1d80aa['VoiceQueueId']||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0x19e')));break;case 0x0:if(_0x1d80aa['countnosuchnumberretry']>=_0x354d55[_0x9191('0x19f')]-0x1){return!![];}else{hopperUtils[_0x9191('0xdf')]({'active':![],'countnosuchnumberretry':_0x1d80aa[_0x9191('0x12e')]+=0x1,'scheduledat':moment()['add'](_0x354d55['dialNoSuchNumberRetryFrequency'],_0x9191('0xe1'))[_0x9191('0x4d')](_0x9191('0xc9')),'ContactId':_0x1d80aa[_0x9191('0xe2')],'ListId':_0x1d80aa[_0x9191('0xe3')],'VoiceQueueId':_0x1d80aa[_0x9191('0xe4')]||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0x1a0')));}break;case 0xa:if(_0x1d80aa[_0x9191('0xd9')]>=_0x354d55[_0x9191('0x1a1')]-0x1){return!![];}hopperUtils[_0x9191('0xdf')]({'active':![],'countdropretry':_0x1d80aa['countdropretry']+=0x1,'scheduledat':moment()[_0x9191('0xe0')](_0x354d55[_0x9191('0xda')],_0x9191('0xe1'))[_0x9191('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d80aa['ContactId'],'ListId':_0x1d80aa[_0x9191('0xe3')],'VoiceQueueId':_0x1d80aa[_0x9191('0xe4')]||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0xe6')));break;case 0xb:if(_0x1d80aa['countabandonedretry']>=_0x354d55[_0x9191('0x1a2')]-0x1){return!![];}hopperUtils[_0x9191('0xdf')]({'active':![],'countabandonedretry':_0x1d80aa[_0x9191('0xef')]+=0x1,'scheduledat':moment()[_0x9191('0xe0')](_0x354d55[_0x9191('0xf2')],_0x9191('0xe1'))[_0x9191('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d80aa[_0x9191('0xe2')],'ListId':_0x1d80aa[_0x9191('0xe3')],'VoiceQueueId':_0x1d80aa[_0x9191('0xe4')]||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})['catch'](loggerCatch(_0x9191('0xf3')));break;case 0x13:if(_0x1d80aa[_0x9191('0x121')]>=_0x354d55[_0x9191('0x127')]-0x1){return!![];}hopperUtils[_0x9191('0xdf')]({'active':![],'countmachineretry':_0x1d80aa[_0x9191('0x121')]+=0x1,'scheduledat':moment()[_0x9191('0xe0')](_0x354d55[_0x9191('0x129')],_0x9191('0xe1'))[_0x9191('0x4d')](_0x9191('0xc9')),'ContactId':_0x1d80aa[_0x9191('0xe2')],'ListId':_0x1d80aa['ListId'],'VoiceQueueId':_0x1d80aa[_0x9191('0xe4')]||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1d80aa['countagentrejectretry']>=_0x354d55['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x9191('0xdf')]({'active':![],'countagentrejectretry':_0x1d80aa['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x354d55[_0x9191('0x1a3')],_0x9191('0xe1'))[_0x9191('0x4d')](_0x9191('0xc9')),'ContactId':_0x1d80aa[_0x9191('0xe2')],'ListId':_0x1d80aa[_0x9191('0xe3')],'VoiceQueueId':_0x1d80aa[_0x9191('0xe4')]||undefined,'CampaignId':_0x1d80aa[_0x9191('0xe5')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x9191('0x1c')]['callProgressDetecting']=function(_0x31d353,_0x2eb370,_0x2d0b56){var _0x173b88=this;var _0x488b18=new History(_0x31d353);var _0x22eceb=![];var _0x5e0c55;var _0x421575;return new Promise(function(_0x332361,_0xbd1a7){if(_[_0x9191('0x47')](_0x2eb370)&&typeof _0x2eb370!==_0x9191('0x15f')){return _0xbd1a7(msgResponse(_0x9191('0x1a4'),_0x9191('0x99'),_0x9191('0x1a5')));}if(_[_0x9191('0x47')](_0x2d0b56)&&typeof _0x2d0b56!==_0x9191('0x15f')){return _0xbd1a7(msgResponse('[callProgressDetecting]','Failure',_0x9191('0x1a6')));}hopperUtils[_0x9191('0xf1')](_0x488b18,_0x2d0b56[_0x9191('0xcb')],_0x2eb370)[_0x9191('0xa5')](function(_0x12cb01){if(_0x12cb01[_0x9191('0xdd')]==0x1)_0x22eceb=!![];switch(_0x2d0b56[_0x9191('0xcb')]){case'0':_0x2eb370[_0x9191('0x1a7')]+=0x1;_0x488b18[_0x9191('0xd4')]=0x0;_0x488b18[_0x9191('0x79')]=_0x9191('0x1a8');_0x488b18['countnosuchnumberretry']+=0x1;_0x488b18[_0x9191('0xf0')]+=0x1;ami['emit'](_0x9191('0x1a9'),ut['buildObj'](_0x31d353,_0x9191('0x1aa')));_0x5e0c55=_0x2eb370[_0x9191('0x1ab')];_0x421575=_0x2eb370['callAdditionalPhoneAfterMin'];hopperUtils[_0x9191('0xe9')](_0x488b18)['catch'](loggerCatch(_0x9191('0x122')));if(_0x173b88['checkRetriveMax'](0x0,_0x31d353,_0x2eb370)&&!_0x22eceb){if(_0x488b18[_0x9191('0x12e')]>=_0x2eb370[_0x9191('0x19f')]){_0x173b88[_0x9191('0x1ac')](_0x488b18,_0x332361,_0xbd1a7,'reason\x200\x20no\x20such\x20number....');}else{_0x173b88['stateGlobal'](_0x488b18,_0x332361,_0xbd1a7,_0x9191('0x1ad'));}}break;case'3':_0x2eb370[_0x9191('0x1ae')]+=0x1;_0x488b18['state']=0x3;_0x488b18[_0x9191('0x79')]='NoAnswer';_0x488b18['countnoanswerretry']+=0x1;_0x488b18[_0x9191('0xf0')]+=0x1;var _0x51ae6a=ut[_0x9191('0x1af')](_0x31d353,_0x2eb370);ami[_0x9191('0x48')](_0x9191('0x1b0'),_0x51ae6a);_0x5e0c55=_0x2eb370[_0x9191('0x1b1')];_0x421575=_0x2eb370[_0x9191('0xdb')];hopperUtils['createHistory'](_0x488b18)[_0x9191('0xaa')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x173b88[_0x9191('0x196')](0x3,_0x31d353,_0x2eb370)&&!_0x22eceb){if(_0x488b18['countnoanswerretry']>=_0x2eb370[_0x9191('0x198')]){_0x173b88[_0x9191('0x1ac')](_0x488b18,_0x332361,_0xbd1a7,'reason\x203\x20ringing\x20no\x20answer');}else{_0x173b88[_0x9191('0x130')](_0x488b18,_0x332361,_0xbd1a7,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2eb370['outboundBusyCallsDay']+=0x1;_0x488b18[_0x9191('0xd4')]=0x5;_0x488b18[_0x9191('0x79')]='Busy';_0x488b18[_0x9191('0x123')]+=0x1;_0x488b18[_0x9191('0xf0')]+=0x1;ami[_0x9191('0x48')](_0x9191('0x1b2'),ut[_0x9191('0x11a')](_0x31d353,_0x9191('0x1b3')));_0x5e0c55=_0x2eb370[_0x9191('0x19b')];_0x421575=_0x2eb370[_0x9191('0xdb')];hopperUtils[_0x9191('0xe9')](_0x488b18)[_0x9191('0xaa')](loggerCatch(_0x9191('0x1b4')));if(_0x173b88[_0x9191('0x196')](0x5,_0x31d353,_0x2eb370)&&!_0x22eceb){if(_0x488b18['countbusyretry']>=_0x2eb370[_0x9191('0x19a')]){_0x173b88[_0x9191('0x1ac')](_0x488b18,_0x332361,_0xbd1a7,'reason\x205\x20busy');}else{_0x173b88['stateGlobal'](_0x488b18,_0x332361,_0xbd1a7,_0x9191('0x1b5'));}}break;case'8':_0x2eb370[_0x9191('0x1b6')]+=0x1;_0x488b18['state']=0x8;_0x488b18[_0x9191('0x79')]=_0x9191('0x1b7');_0x488b18[_0x9191('0x124')]+=0x1;_0x488b18[_0x9191('0xf0')]+=0x1;_0x5e0c55=_0x2eb370['dialCongestionRetryFrequency'];_0x421575=_0x2eb370[_0x9191('0xdb')];ami['emit'](_0x9191('0x1b8'),ut[_0x9191('0x11a')](_0x31d353,_0x9191('0x1b9')));hopperUtils[_0x9191('0xe9')](_0x488b18)[_0x9191('0xaa')](loggerCatch(_0x9191('0x1ba')));if(_0x173b88[_0x9191('0x196')](0x8,_0x31d353,_0x2eb370)&&!_0x22eceb){if(_0x488b18[_0x9191('0x124')]>=_0x2eb370[_0x9191('0x19c')]){_0x173b88[_0x9191('0x1ac')](_0x488b18,_0x332361,_0xbd1a7,_0x9191('0x1bb'));}else{_0x173b88[_0x9191('0x130')](_0x488b18,_0x332361,_0xbd1a7,_0x9191('0x1bb'));}}break;case'11':_0x2eb370[_0x9191('0x1bc')]+=0x1;_0x488b18[_0x9191('0xd4')]=0xb;_0x488b18[_0x9191('0x79')]=_0x9191('0xed');_0x488b18[_0x9191('0xef')]+=0x1;_0x488b18[_0x9191('0xf0')]+=0x1;_0x5e0c55=_0x2eb370[_0x9191('0xf2')];_0x421575=_0x2eb370['callAdditionalPhoneAfterMin'];hopperUtils[_0x9191('0xe9')](_0x488b18)['catch'](loggerCatch(_0x9191('0xf4')));if(_0x173b88[_0x9191('0x196')](0xb,_0x31d353,_0x2eb370)&&!_0x22eceb){if(_0x488b18[_0x9191('0xef')]>=_0x2eb370['dialAbandonedMaxRetry']){_0x173b88[_0x9191('0x1ac')](_0x488b18,_0x332361,_0xbd1a7,_0x9191('0x1bd'));}else{_0x173b88[_0x9191('0x130')](_0x488b18,_0x332361,_0xbd1a7,'reason\x2011\x20abandoned');}}break;case'20':_0x2eb370[_0x9191('0x1be')]+=0x1;_0x488b18[_0x9191('0xd4')]=0x14;_0x488b18['statedesc']=_0x9191('0x1bf');_0x488b18[_0x9191('0x12f')]+=0x1;_0x488b18[_0x9191('0xf0')]+=0x1;_0x5e0c55=_0x2eb370['dialAgentRejectRetryFrequency'];_0x421575=_0x2eb370[_0x9191('0xdb')];ami[_0x9191('0x48')]('custom:agentreject',ut[_0x9191('0x11a')](_0x31d353,_0x9191('0x1c0')));hopperUtils[_0x9191('0xe9')](_0x488b18)['catch'](loggerCatch(_0x9191('0x1c1')));if(_0x173b88[_0x9191('0x196')](0x14,_0x31d353,_0x2eb370)&&!_0x22eceb){if(_0x488b18[_0x9191('0x12f')]>=_0x2eb370[_0x9191('0x1c2')]){_0x173b88[_0x9191('0x1ac')](_0x488b18,_0x332361,_0xbd1a7,_0x9191('0x1c3'));}else{_0x173b88[_0x9191('0x130')](_0x488b18,_0x332361,_0xbd1a7,_0x9191('0x1c3'));}}break;default:_0x2eb370['outboundUnknownCallsDay']+=0x1;_0x488b18[_0x9191('0xd4')]=0xc;_0x488b18[_0x9191('0x79')]=_0x2d0b56['reason'];_0x5e0c55=_0x2eb370[_0x9191('0x1a3')];_0x421575=_0x2eb370[_0x9191('0xdb')];hopperUtils[_0x9191('0xe9')](_0x488b18)[_0x9191('0xaa')](loggerCatch(_0x9191('0x1c4')));if(_0x173b88['checkRetriveMax'](_0x2d0b56[_0x9191('0xcb')],_0x31d353,_0x2eb370)&&!_0x22eceb){if(_0x488b18['countbusyretry']+_0x488b18[_0x9191('0x124')]+_0x488b18[_0x9191('0x197')]+_0x488b18['countnosuchnumberretry']+_0x488b18[_0x9191('0xd9')]+_0x488b18[_0x9191('0xef')]+_0x488b18[_0x9191('0x121')]+_0x488b18[_0x9191('0x12f')]>=_0x2eb370[_0x9191('0x125')]){_0x173b88[_0x9191('0x130')](_0x488b18,_0x332361,_0xbd1a7,_0x2d0b56[_0x9191('0xcb')]);}else{_0x173b88['createStateFinal'](_0x488b18,_0x332361,_0xbd1a7,_0x2d0b56[_0x9191('0xcb')]);}}}})[_0x9191('0xa5')](function(){if(_0x22eceb){hopperUtils[_0x9191('0xeb')](_0x488b18,_0x5e0c55,_0x421575)['then'](function(){return _0x332361(0x1);});}});});};Dialer[_0x9191('0x1c')][_0x9191('0x130')]=function(_0x41a757,_0x4c0581,_0x1a9032,_0x266452){var _0x95abcb=new Final(_0x41a757);_0x95abcb[_0x9191('0xd4')]=0xf;_0x95abcb['statedesc']=_0x9191('0x1c5');this[_0x9191('0x1ac')](_0x95abcb,_0x4c0581,_0x1a9032,_0x266452);};Dialer['prototype']['createStateFinal']=function(_0x231b86,_0x3d3943,_0x2b0364,_0xd6b71c){hopperUtils[_0x9191('0xcf')](_0x231b86)[_0x9191('0xa5')](function(){return _0x3d3943(msgResponse('[callProgressDetecting]',_0x9191('0x1c6'),_0xd6b71c));})[_0x9191('0xaa')](function(){return _0x2b0364(msgResponse(_0x9191('0x1c7'),_0x9191('0x99'),_0x9191('0x1c8')));});};Dialer[_0x9191('0x1c')][_0x9191('0xb')]=function(_0x3a9510){var _0x17dad0=_0x3a9510[_0x9191('0x1c9')]/0x64;var _0x3c0294=_0x3a9510['outboundDropCallsDayTimeout']/(_0x3a9510[_0x9191('0xd3')]+_0x3a9510[_0x9191('0x115')]);var _0x1832e0=Math[_0x9191('0x1ca')](_0x3a9510[_0x9191('0x1cb')]*(_0x3a9510['predictiveIntervalMaxThreshold']/0x64));var _0x348b05=Math[_0x9191('0x1ca')](_0x3a9510[_0x9191('0x1cb')]*(_0x3a9510[_0x9191('0x1cc')]/0x64));var _0x33f592=_0x3a9510[_0x9191('0x13e')]+_0x3a9510[_0x9191('0x1cd')];var _0x1b8e53=Math['floor'](_0x3a9510[_0x9191('0x1ce')]*_0x3a9510[_0x9191('0x64')]*_0x3a9510[_0x9191('0x1cf')]*_0x3a9510['predictiveIntervalMultiplicativeFactor']);if(_[_0x9191('0x47')](_0x3a9510[_0x9191('0x69')])){if(!_[_0x9191('0x47')](_0x3a9510['startPredictive'])){_0x3a9510[_0x9191('0x6a')]=undefined;loggerPredictive[_0x9191('0x6e')](_0x9191('0x1d0'),_0x9191('0x1d1'));}if(!_[_0x9191('0x47')](_0x3a9510[_0x9191('0x6c')])){loggerPredictive[_0x9191('0x6e')](_0x9191('0x1d0'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3a9510[_0x9191('0x6c')]);_0x3a9510['handlePredictive']=undefined;}_0x3a9510[_0x9191('0x69')]=moment()[_0x9191('0x4d')](_0x9191('0xc9'));loggerPredictive['info'](_0x3a9510['name'],_0x9191('0x1d2'),_0x3a9510[_0x9191('0x69')]);this[_0x9191('0xba')](_0x3a9510,0x1);}else if(ifInterval(_0x3a9510[_0x9191('0x1d3')],_0x3a9510[_0x9191('0x69')])){this[_0x9191('0xba')](_0x3a9510,0x1);loggerPredictiveCalls[_0x9191('0x51')](_0x9191('0x1d4'),_0x3a9510[_0x9191('0x69')],_0x3a9510[_0x9191('0x4e')]);_0x3a9510[_0x9191('0x1ce')]=0x0;_0x3a9510[_0x9191('0x1d5')]=0x0;}else if(_0x17dad0<_0x3c0294&&_0x3a9510[_0x9191('0x1d6')]==='dropRate'){clearPredictiveAttributes(_0x3a9510);loggerPredictive[_0x9191('0x51')](_0x9191('0x1d7'),'Dropped\x20calls\x20day',_0x3c0294,_0x9191('0x69'),_0x3a9510[_0x9191('0x4e')]);}else if(_0x1b8e53<_0x3a9510[_0x9191('0x1d5')]&&_0x3a9510['dialPredictiveOptimization']===_0x9191('0x1d8')){clearPredictiveAttributes(_0x3a9510);loggerPredictive[_0x9191('0x51')](_0x9191('0x1d9'),_0x9191('0x1da'),_0x1b8e53,_0x9191('0x1db'),_0x3a9510['predictiveIntervalErlangCallsDroppedCalls'],_0x9191('0x69'),_0x3a9510[_0x9191('0x4e')]);}else if(!ifInterval(_0x3a9510[_0x9191('0x1d3')],_0x3a9510[_0x9191('0x69')])&&_[_0x9191('0x47')](_0x3a9510[_0x9191('0x6a')])&&!_[_0x9191('0x47')](_0x3a9510[_0x9191('0x69')])){_0x3a9510[_0x9191('0x6a')]=moment()['format'](_0x9191('0xc9'));loggerPredictive[_0x9191('0x51')](_0x3a9510[_0x9191('0x4e')],_0x9191('0x1dc'),_0x3a9510[_0x9191('0x6a')]);hopperUtils[_0x9191('0x1dd')](_0x3a9510[_0x9191('0x1d3')])[_0x9191('0xa5')](this[_0x9191('0x1de')](_0x3a9510))[_0x9191('0xa5')](mergeDataErlangB(_0x3a9510))['then'](this['startMethodPredictive'](_0x3a9510))[_0x9191('0xaa')](loggerCatchPredictive(_0x9191('0x1df'),_0x3a9510));}else if(!ifInterval(_0x3a9510[_0x9191('0x1d3')],_0x3a9510[_0x9191('0x6a')])){_0x3a9510[_0x9191('0x1d5')]=0x0;_0x3a9510[_0x9191('0x6a')]=moment()[_0x9191('0x4d')](_0x9191('0xc9'));loggerPredictive['info'](_0x3a9510[_0x9191('0x4e')],_0x9191('0x1e0'),_0x3a9510[_0x9191('0x6a')]);clearInterval(_0x3a9510[_0x9191('0x6c')]);_0x3a9510[_0x9191('0x6c')]=undefined;hopperUtils[_0x9191('0x1dd')](_0x3a9510[_0x9191('0x1d3')])[_0x9191('0xa5')](this[_0x9191('0x1de')](_0x3a9510))[_0x9191('0xa5')](mergeDataErlangB(_0x3a9510))[_0x9191('0xa5')](this[_0x9191('0x1e1')](_0x3a9510))[_0x9191('0xaa')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3a9510));}else if(_0x3a9510['predictiveIntervalAvailable']&&_0x33f592<_0x3a9510[_0x9191('0x1cb')]-_0x348b05){clearPredictiveAttributes(_0x3a9510);loggerPredictive[_0x9191('0x51')](_0x3a9510[_0x9191('0x4e')],_0x9191('0x1e2'),_0x33f592,_0x9191('0x1e3'),_0x3a9510[_0x9191('0x1cb')],'-',_0x348b05,'=',_0x3a9510['predictiveIntervalAvailable']-_0x348b05,')');}else if(_0x3a9510[_0x9191('0x1cb')]&&_0x33f592>_0x3a9510[_0x9191('0x1cb')]+_0x1832e0){clearPredictiveAttributes(_0x3a9510);loggerPredictive[_0x9191('0x51')](_0x3a9510[_0x9191('0x4e')],_0x9191('0x1e2'),_0x33f592,')\x20are\x20more\x20than\x20threshold\x20(',_0x3a9510[_0x9191('0x1cb')],'+',_0x1832e0,'=',_0x3a9510[_0x9191('0x1cb')]+_0x1832e0,')');}};Dialer[_0x9191('0x1c')][_0x9191('0x1de')]=function(_0x2cf22b){var _0x382447=this;return function(_0x3e4c6e){return new Promise(function(_0x3b1746,_0x286c32){_[_0x9191('0x67')](_0x2cf22b,_0x3e4c6e[0x0]);if(checkGetDataPredictive(_0x3e4c6e[0x0])){var _0x394880=_0x2cf22b[_0x9191('0x1cb')]=_0x2cf22b[_0x9191('0x1cd')]+_0x2cf22b['available'];var _0x22b12a=_0x2cf22b[_0x9191('0x1d3')]*0x3c;var _0x427439=_0x3e4c6e[0x0][_0x9191('0x59')]+_0x3e4c6e[0x0]['predictiveIntervalAvgHoldtime'];var _0x2e0736=(_0x3e4c6e[0x0]['predictiveIntervalAnsweredCalls']+_0x3e4c6e[0x0][_0x9191('0x55')]+_0x3e4c6e[0x0][_0x9191('0x57')])/_0x3e4c6e[0x0][_0x9191('0x5b')];_0x2cf22b[_0x9191('0x1cf')]=_0x2e0736>0x0?_0x2e0736:0x1;switch(_0x2cf22b[_0x9191('0x1d6')]){case _0x9191('0x1d8'):var _0x58ae14=_0x2cf22b[_0x9191('0x1c9')]/0x64;return _0x382447['abandonmentRate'](_0x394880,_0x22b12a,_0x427439,_0x2e0736,_0x58ae14)[_0x9191('0xa5')](function(_0x3be285){return _0x3b1746(_0x3be285);});case'agentBusyFactor':var _0x2af6b8=_0x2cf22b[_0x9191('0x1c9')]/0x64;return _0x382447[_0x9191('0x1e4')](_0x394880,_0x22b12a,_0x427439,_0x2e0736,_0x2af6b8)['then'](function(_0x174b27){return _0x3b1746(_0x174b27);});default:return _0x286c32(msgResponse(_0x9191('0x1e5'),_0x9191('0x99'),_0x9191('0x1e6')));}}else{return _0x286c32(msgResponse(_0x9191('0x1e5'),_0x9191('0x99'),_0x9191('0x1e7')));}});};};Dialer[_0x9191('0x1c')][_0x9191('0x1e8')]=function(_0xdbf965){var _0x47cb2a=this;return function(_0x1b2718){return new Promise(function(_0x259920,_0x5c9b5c){_['merge'](_0xdbf965,_0x1b2718[0x0]);if(checkGetDataPredictive(_0x1b2718[0x0])){loggerPredictive['info'](JSON[_0x9191('0x7e')](_0x1b2718[0x0]));if(_0xdbf965[_0x9191('0x1d6')]==='dropRate'){return _0x47cb2a[_0x9191('0x153')](_0xdbf965['id'])[_0x9191('0xa5')](function(_0x5c782c){var _0x1156d2=_0xdbf965[_0x9191('0x1e9')]-_0x5c782c[0x0]['outboundQueuePauses'];var _0x33e9fb=_0xdbf965['dialPredictiveInterval']*0x3c;var _0x5c8ea4=_0x1b2718[0x0]['predictiveIntervalAvgTalktime']+_0x1b2718[0x0][_0x9191('0x5c')];var _0x1be8bd=(_0x1b2718[0x0][_0x9191('0x1ea')]+_0x1b2718[0x0][_0x9191('0x55')]+_0x1b2718[0x0][_0x9191('0x57')])/_0x1b2718[0x0][_0x9191('0x5b')];var _0x513516=_0xdbf965[_0x9191('0x1c9')]/0x64;_0xdbf965[_0x9191('0x1eb')]=_0x5c782c[0x0]['outboundQueuePauses']||0x0;_0xdbf965[_0x9191('0x1cf')]=_0x1be8bd>0x0?_0x1be8bd:0x1;return _0x47cb2a['abandonmentRate'](_0x1156d2,_0x33e9fb,_0x5c8ea4,_0x1be8bd,_0x513516);})[_0x9191('0xa5')](function(_0x40699b){return _0x259920(_0x40699b);})[_0x9191('0xaa')](function(_0x3fa7ab){return _0x5c9b5c(msgResponse(_0x9191('0x1ec'),_0x9191('0x99'),JSON[_0x9191('0x7e')](_0x3fa7ab)));});}if(_0xdbf965['dialPredictiveOptimization']===_0x9191('0x1ed')){return _0x47cb2a[_0x9191('0x153')](_0xdbf965['id'])[_0x9191('0xa5')](function(_0x470687){var _0xd82e4f=_0xdbf965[_0x9191('0x1e9')]-_0x470687[0x0][_0x9191('0x1ee')];var _0x30cf05=_0xdbf965[_0x9191('0x1d3')]*0x3c;var _0x1fef60=_0x1b2718[0x0]['predictiveIntervalAvgTalktime']+_0x1b2718[0x0][_0x9191('0x5c')];var _0x3df2f3=(_0x1b2718[0x0][_0x9191('0x1ea')]+_0x1b2718[0x0][_0x9191('0x55')]+_0x1b2718[0x0][_0x9191('0x57')])/_0x1b2718[0x0][_0x9191('0x5b')];var _0xe2e507=_0xdbf965[_0x9191('0x1c9')]/0x64;_0xdbf965[_0x9191('0x1eb')]=_0x470687[0x0][_0x9191('0x1ee')]||0x0;_0xdbf965[_0x9191('0x1cf')]=_0x3df2f3>0x0?_0x3df2f3:0x1;return _0x47cb2a[_0x9191('0x1e4')](_0xd82e4f,_0x30cf05,_0x1fef60,_0x3df2f3,_0xe2e507);})['then'](function(_0x17975b){return _0x259920(_0x17975b);})[_0x9191('0xaa')](function(_0x20ea88){return _0x5c9b5c(msgResponse(_0x9191('0x1ec'),_0x9191('0x99'),JSON[_0x9191('0x7e')](_0x20ea88)));});}}else{return _0x5c9b5c(msgResponse(_0x9191('0x1e5'),'Failure',_0x9191('0x1e7')));}});};};Dialer['prototype'][_0x9191('0x1e1')]=function(_0x5303b0){var _0x3c657b=this;return function(){var _0x194569=0x0;var _0x12a1f8=Math[_0x9191('0x1ef')](_0x5303b0[_0x9191('0x1f0')]*0x3e8);if(_0x12a1f8>0x0){_0x12a1f8=_0x12a1f8<0x64?0x64:_0x12a1f8;loggerPredictive['info'](_0x5303b0[_0x9191('0x4e')],_0x9191('0x1f1'),_0x12a1f8,'milliseconds');_0x5303b0[_0x9191('0x6c')]=setInterval(function(){_0x3c657b['handlePredictive'](_0x5303b0);loggerPredictiveCalls[_0x9191('0x51')](_0x9191('0x1f2'),_0x194569+=0x1);},_0x12a1f8);}else{loggerPredictive['info'](_0x5303b0[_0x9191('0x4e')],_0x9191('0x1f3'));}};};Dialer[_0x9191('0x1c')][_0x9191('0x1f4')]=function(_0x32b857,_0x207692){var _0x4db3a5=this;return function(_0x1276da){if(_[_0x9191('0x50')](_0x1276da)){if(_['isNil'](_0x207692[_0x9191('0x158')])||!_0x207692[_0x9191('0x1f5')]){if(_0x32b857['dialMethod']===_0x9191('0xa')){_0x32b857[_0x9191('0x7c')]=_[_0x9191('0x47')](_0x32b857[_0x9191('0x7c')])?!![]:_0x32b857[_0x9191('0x7c')];var _0x6bbbaa=uuid['v4']();_0x4db3a5[_0x9191('0x27')][_0x6bbbaa]=new Action(_0x32b857,_0x207692,_0x6bbbaa);loggerBooked[_0x9191('0x51')](_0x9191('0x1f6'),_0x6bbbaa,_0x9191('0x1f7'),JSON[_0x9191('0x7e')](_0x32b857[_0x9191('0x7c')]),'Queue:\x20',_0x32b857[_0x9191('0x4e')]);if(_0x32b857[_0x9191('0x7c')]){_0x32b857['queueStatusComplete']=![];_0x4db3a5[_0x9191('0x2c')][_0x4db3a5[_0x9191('0x27')][_0x6bbbaa]['queue']]=[];ami[_0x9191('0xa1')]({'actionid':_0x6bbbaa,'action':_0x9191('0x1f8'),'queue':_0x32b857[_0x9191('0x4e')]})[_0x9191('0xaa')](function(){_0x4db3a5[_0x9191('0x105')](_0x32b857);hopperUtils[_0x9191('0xdf')]({'active':![],'ContactId':_0x4db3a5['actions'][_0x6bbbaa][_0x9191('0xe2')],'ListId':_0x4db3a5[_0x9191('0x27')][_0x6bbbaa][_0x9191('0xe3')],'VoiceQueueId':_0x4db3a5[_0x9191('0x27')][_0x6bbbaa][_0x9191('0xe4')]||undefined,'CampaignId':_0x4db3a5[_0x9191('0x27')][_0x6bbbaa]['CampaignId']||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0x1f9')));delete _0x4db3a5[_0x9191('0x27')][_0x6bbbaa];});}else{loggerBooked[_0x9191('0x51')](_0x9191('0x1fa'),JSON[_0x9191('0x7e')](_0x32b857[_0x9191('0x7c')]),_0x9191('0x1fb'),_0x32b857[_0x9191('0x4e')]);_0x4db3a5[_0x9191('0x105')](_0x32b857);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x4db3a5['actions'][_0x6bbbaa][_0x9191('0xe2')],'ListId':_0x4db3a5[_0x9191('0x27')][_0x6bbbaa][_0x9191('0xe3')],'VoiceQueueId':_0x4db3a5[_0x9191('0x27')][_0x6bbbaa][_0x9191('0xe4')]||undefined,'CampaignId':_0x4db3a5['actions'][_0x6bbbaa][_0x9191('0xe5')]||undefined})['catch'](loggerCatch(_0x9191('0x1f9')));delete _0x4db3a5[_0x9191('0x27')][_0x6bbbaa];}}else{return _0x4db3a5[_0x9191('0x15e')](_0x32b857,_0x207692);}}else{if(utils[_0x9191('0x68')](undefined,_0x207692['scheduledat'])<_0x32b857[_0x9191('0x1fc')]*0x3c){if(_0x207692['Agent']&&!_0x207692['Agent'][_0x9191('0x1fd')]){_0x4db3a5[_0x9191('0x20')][_0x9191('0xfe')](_0x207692['id'])[_0x9191('0x1f')](function(){_0x4db3a5['updateOriginated'](_0x32b857);});}else{hopperUtils['unlockContact']({'active':![]},_0x207692['id'],0x1)[_0x9191('0x1f')](function(){_0x4db3a5[_0x9191('0x105')](_0x32b857);});}}else{_0x32b857['outboundReCallsDay']+=0x1;_0x4db3a5[_0x9191('0x105')](_0x32b857);if(_0x32b857['dialRecallInQueue']){hopperUtils[_0x9191('0xdf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x207692[_0x9191('0xe2')],'ListId':_0x207692[_0x9191('0xe3')],'VoiceQueueId':_0x207692['VoiceQueueId']||undefined,'CampaignId':_0x207692[_0x9191('0xe5')]||undefined})[_0x9191('0xaa')](loggerCatch(_0x9191('0x1fe')));hopperUtils[_0x9191('0xe9')](createObjHistory(_0x32b857,_0x207692,utils[_0x9191('0x72')][_0x9191('0x1ff')],0x17,'RecallInQueue'))['catch'](loggerCatch(_0x9191('0x200')));}else{_0x4db3a5[_0x9191('0x11c')](createObjHistory(_0x32b857,_0x207692,utils[_0x9191('0x72')][_0x9191('0x201')],0x16,_0x9191('0x202')),_0x9191('0x203'),'[Originate][HistoryRecallClose]');}}}}else{_0x32b857[_0x9191('0x204')]+=0x1;_0x4db3a5['saveInDb'](createObjHistory(_0x32b857,_0x207692,utils[_0x9191('0x72')][_0x9191('0x205')],0xd,_0x9191('0x206')),'[Originate][historyBlacklist]',_0x9191('0x207'));throw _0x9191('0x208');}};};Dialer[_0x9191('0x1c')][_0x9191('0x15d')]=function(_0x33c13f){var _0x18229a=this;var _0x7554b7=_0x33c13f[_0x9191('0x209')]-_0x33c13f[_0x9191('0x20a')]-_0x33c13f['temp'];emitCampaignSummary(_0x33c13f);if(_0x7554b7>0x0){if(_0x7554b7>this['maxNumberOriginate']){_0x7554b7=this[_0x9191('0x25')];}_0x33c13f[_0x9191('0x20b')]+=_0x7554b7;hopperUtils[_0x9191('0x20c')](_0x33c13f['id'],_0x7554b7,_0x33c13f[_0x9191('0x20d')],_0x33c13f)['then'](function(_0x38de64){_0x33c13f[_0x9191('0x20b')]-=_0x7554b7;_0x33c13f['temp']=_0x33c13f[_0x9191('0x20b')]>0x0?_0x33c13f[_0x9191('0x20b')]:0x0;if(!utils['checkContactEmpty'](_0x38de64)){_0x33c13f[_0x9191('0x71')]=utils[_0x9191('0x72')]['NO_AVAILABLE_CONTACTS'];logger[_0x9191('0x51')]('[getContactCampaign2][Empty]'+_0x33c13f[_0x9191('0x4e')]);}else{_0x33c13f[_0x9191('0x20a')]+=_0x38de64[_0x9191('0x9f')];_0x33c13f['message']=utils[_0x9191('0x72')][_0x9191('0x20e')];for(var _0x3d9f29=0x0;_0x3d9f29<_0x38de64[_0x9191('0x9f')];_0x3d9f29+=0x1){_0x33c13f[_0x9191('0x20f')]+=0x1;if(_[_0x9191('0xf8')](_0x38de64[_0x3d9f29])||_['isNil'](_0x38de64[_0x3d9f29]['Contact'])||_[_0x9191('0xf8')](_0x38de64[_0x3d9f29][_0x9191('0x18a')])){_0x18229a['emptyContact'](_0x9191('0x210'),_0x33c13f,_0x38de64[_0x3d9f29]);}else{hopperUtils['checkIsBlackListIvr'](_['pick'](_0x38de64[_0x3d9f29],[_0x9191('0xe5'),'phone']))[_0x9191('0xa5')](_0x18229a[_0x9191('0x1f4')](_0x33c13f,_0x38de64[_0x3d9f29]))[_0x9191('0xaa')](_0x18229a['loggerHandler'](_0x9191('0x211'),_0x33c13f));}}}})[_0x9191('0xaa')](loggerGetContactDialer(_0x9191('0x212'),_0x33c13f,_0x7554b7));}};Dialer[_0x9191('0x1c')][_0x9191('0xba')]=function(_0x59b4c8,_0x4f62c3){var _0x51438c=this;var _0xb3e209=[];if(_0x4f62c3<0x1||_0x59b4c8[_0x9191('0xb9')]===_0x9191('0xa')){_0x4f62c3=0x1;}var _0x2e56c1=Math[_0x9191('0x1ef')](_0x59b4c8[_0x9191('0x13e')]*_0x4f62c3)-_0x59b4c8[_0x9191('0x20a')]-_0x59b4c8[_0x9191('0x20b')];if(_0x59b4c8[_0x9191('0x213')]>0x0){var _0x458767=_0x59b4c8['dialLimitQueue']-_0x59b4c8[_0x9191('0x20a')]-_0x59b4c8['talking']-_0x59b4c8['temp']-_0x59b4c8[_0x9191('0x13f')];if(_0x2e56c1>_0x458767){_0x2e56c1=_0x458767;}}if(_0x2e56c1>0x0){if(_0x59b4c8[_0x9191('0xb9')]===_0x9191('0xa')){_0x2e56c1=0x1;}if(_0x2e56c1>this[_0x9191('0x25')]){_0x2e56c1=this[_0x9191('0x25')];}_0x59b4c8[_0x9191('0x20b')]+=_0x2e56c1;for(var _0x24b60c in this['agents']){if(typeof this['agents'][_0x24b60c]!==_0x9191('0xb3')){if(this[_0x9191('0x23')][_0x24b60c][_0x9191('0xd4')]===_0x9191('0x214')&&this[_0x9191('0x23')][_0x24b60c][_0x9191('0x90')]===_0x9191('0x91')){_0xb3e209[_0x9191('0xa0')](this[_0x9191('0x23')][_0x24b60c]['id']);}}}hopperUtils['getContactDialer'](_0x59b4c8,_0xb3e209,_0x2e56c1)[_0x9191('0xa5')](function(_0x334271){_0x59b4c8[_0x9191('0x20b')]-=_0x2e56c1;_0x59b4c8['temp']=_0x59b4c8[_0x9191('0x20b')]>0x0?_0x59b4c8[_0x9191('0x20b')]:0x0;if(!utils['checkContactEmpty'](_0x334271)){hopperUtils[_0x9191('0x215')](_0x59b4c8)[_0x9191('0xa5')](sendMessageReschedule(_0x59b4c8))['catch'](loggerCatch(_0x9191('0x216')));}else{_0x59b4c8[_0x9191('0x20a')]+=_0x334271[_0x9191('0x9f')];_0x59b4c8[_0x9191('0x71')]=_0x59b4c8['dialMethod']===_0x9191('0xa')?utils[_0x9191('0x72')]['ACTIVE']:utils[_0x9191('0x72')][_0x9191('0x20e')];for(var _0x516f50=0x0;_0x516f50<_0x334271[_0x9191('0x9f')];_0x516f50+=0x1){if(_[_0x9191('0xf8')](_0x334271[_0x516f50])||_['isNil'](_0x334271[_0x516f50][_0x9191('0x17a')])||_[_0x9191('0xf8')](_0x334271[_0x516f50]['phone'])){_0x51438c[_0x9191('0x156')](_0x9191('0x210'),_0x59b4c8,_0x334271[_0x516f50]);}else{hopperUtils[_0x9191('0x217')](_[_0x9191('0x7f')](_0x334271[_0x516f50],[_0x9191('0xe4'),_0x9191('0x18a')]))[_0x9191('0xa5')](_0x51438c[_0x9191('0x1f4')](_0x59b4c8,_0x334271[_0x516f50]))[_0x9191('0xaa')](_0x51438c['loggerHandler'](_0x9191('0x210'),_0x59b4c8));}}}})['catch'](loggerGetContactDialer(_0x9191('0x218'),_0x59b4c8,_0x2e56c1));}};Dialer[_0x9191('0x1c')][_0x9191('0x6c')]=function(_0x34ab67){if(_0x34ab67[_0x9191('0x213')]>0x0){var _0x143b60=_0x34ab67['dialLimitQueue']-_0x34ab67[_0x9191('0x20a')]-_0x34ab67[_0x9191('0x1cd')];if(_0x143b60>0x0){this[_0x9191('0x219')](_0x34ab67);}else{loggerPredictiveCalls[_0x9191('0x51')](_0x9191('0x21a'));}}else{this[_0x9191('0x219')](_0x34ab67);}};Dialer[_0x9191('0x1c')][_0x9191('0x219')]=function(_0x508f65){var _0x36ef9c=this;var _0x58dd43=[];_0x508f65[_0x9191('0x20a')]+=0x1;for(var _0x2fa36b in this['agents']){if(typeof this[_0x9191('0x23')][_0x2fa36b]!=='undefined'){if(this[_0x9191('0x23')][_0x2fa36b][_0x9191('0xd4')]===_0x9191('0x214')&&this[_0x9191('0x23')][_0x2fa36b][_0x9191('0x90')]==='reachable'){_0x58dd43[_0x9191('0xa0')](this[_0x9191('0x23')][_0x2fa36b]['id']);}}}return this[_0x9191('0x21b')](_0x508f65['id'],_0x58dd43,0x1,_0x508f65[_0x9191('0x20d')],_0x508f65)['then'](function(_0x3560ba){if(!utils[_0x9191('0x21c')](_0x3560ba)){utils[_0x9191('0x21d')](_0x508f65,0x1,0x0);return hopperUtils[_0x9191('0x215')](_0x508f65)[_0x9191('0xa5')](sendMessageReschedule(_0x508f65))[_0x9191('0xaa')](loggerCatch('[countReScheduled]\x20'));}else{_0x508f65['message']=utils[_0x9191('0x72')][_0x9191('0x20e')];if(_['isNil'](_0x3560ba[0x0])||_[_0x9191('0xf8')](_0x3560ba[0x0]['Contact'])||_[_0x9191('0xf8')](_0x3560ba[0x0][_0x9191('0x18a')])){_0x36ef9c[_0x9191('0x156')](_0x9191('0x210'),_0x508f65,_0x3560ba[0x0]);}else{return hopperUtils[_0x9191('0x217')](_[_0x9191('0x7f')](_0x3560ba[0x0],['VoiceQueueId','phone']))['then'](_0x36ef9c[_0x9191('0x1f4')](_0x508f65,_0x3560ba[0x0]))[_0x9191('0xaa')](_0x36ef9c['loggerHandler'](_0x9191('0x21e'),_0x508f65));}}})[_0x9191('0xaa')](loggerGetContactDialer(_0x9191('0x21f'),_0x508f65,0x1));};Dialer[_0x9191('0x1c')][_0x9191('0x220')]=function(_0x557287,_0x5c27fb,_0x2d3d86,_0x3bb9cb,_0x595a9b,_0x2d71bf){loggerPredictive[_0x9191('0x51')](_0x9191('0x221'));loggerPredictive[_0x9191('0x51')]('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',_0x557287);loggerPredictive['info'](_0x9191('0x222'),_0x5c27fb);loggerPredictive[_0x9191('0x51')]('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',_0x2d3d86);loggerPredictive[_0x9191('0x51')](_0x9191('0x223'),_0x3bb9cb);loggerPredictive[_0x9191('0x51')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x595a9b);loggerPredictive['info'](_0x9191('0x5a'));return new Promise(function(_0x4e32f6,_0x285b01){if(_0x557287<=0x0||isNaN(_0x557287)){return _0x285b01(msgResponse(_0x9191('0x224'),_0x9191('0x8c'),_0x9191('0x225')+_0x557287));}if(_0x2d3d86<=0x0||isNaN(_0x2d3d86)){return _0x285b01(msgResponse(_0x9191('0x224'),_0x9191('0x8c'),'Ts\x20=\x20'+_0x2d3d86));}if(_0x3bb9cb<=0x0||isNaN(_0x3bb9cb)){return _0x285b01(msgResponse(_0x9191('0x224'),_0x9191('0x8c'),_0x9191('0x226')+_0x3bb9cb));}if(_0x5c27fb<=0x0||isNaN(_0x5c27fb)){return _0x285b01(msgResponse(_0x9191('0x224'),_0x9191('0x8c'),_0x9191('0x227')+_0x5c27fb));}if(_0x595a9b<=0x0||isNaN(_0x595a9b)){return _0x285b01(msgResponse(_0x9191('0x224'),_0x9191('0x8c'),'Amax\x20=\x20'+_0x595a9b));}_0x2d71bf=_0x2d71bf||0x0;var _0x56dd74=0x1/_0x2d3d86;var _0x3518ec=0x0;var _0x396c0d=0x0;var _0x45262d=0x0;var _0x1167b8=0x0;for(var _0x3a6118=0x0;_0x45262d<_0x595a9b;_0x3a6118+=0x1){_0x396c0d=_0x3a6118/_0x5c27fb;_0x3518ec=(_0x3bb9cb*_0x396c0d+_0x2d71bf)/_0x56dd74;_0x45262d=utils[_0x9191('0x228')](_0x3518ec,_0x557287);_0x1167b8=_0x3518ec/_0x557287*(0x1-utils[_0x9191('0x228')](_0x3518ec,_0x557287));}return _0x4e32f6({'erlangCalls':_0x3a6118,'erlangCallToSecond':_0x5c27fb/_0x3a6118,'erlangAbandonmentRate':_0x45262d,'erlangBusyFactor':_0x1167b8});});};Dialer[_0x9191('0x1c')][_0x9191('0x1e4')]=function(_0x122ce0,_0x1ce910,_0x739dd3,_0x8d9cdf,_0x446cb3,_0x58950b){loggerPredictive[_0x9191('0x51')](_0x9191('0x229'));loggerPredictive[_0x9191('0x51')](_0x9191('0x22a'),_0x122ce0);loggerPredictive[_0x9191('0x51')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ce910);loggerPredictive['info'](_0x9191('0x22b'),_0x739dd3);loggerPredictive[_0x9191('0x51')](_0x9191('0x223'),_0x8d9cdf);loggerPredictive[_0x9191('0x51')](_0x9191('0x22c'),_0x446cb3);loggerPredictive[_0x9191('0x51')](_0x9191('0x5a'));return new Promise(function(_0x1eeb04,_0x27de1c){if(_0x122ce0<=0x0||isNaN(_0x122ce0)){return _0x27de1c(msgResponse(_0x9191('0x22d'),_0x9191('0x8c'),'m\x20=\x20'+_0x122ce0));}if(_0x739dd3<=0x0||isNaN(_0x739dd3)){return _0x27de1c(msgResponse('[busyFactor]',_0x9191('0x8c'),_0x9191('0x22e')+_0x739dd3));}if(_0x8d9cdf<=0x0||isNaN(_0x8d9cdf)){return _0x27de1c(msgResponse(_0x9191('0x22d'),'Error',_0x9191('0x226')+_0x8d9cdf));}if(_0x1ce910<=0x0||isNaN(_0x1ce910)){return _0x27de1c(msgResponse(_0x9191('0x22d'),_0x9191('0x8c'),_0x9191('0x227')+_0x1ce910));}if(_0x446cb3<=0x0||isNaN(_0x446cb3)){return _0x27de1c(msgResponse(_0x9191('0x22d'),'Error',_0x9191('0x22f')+_0x446cb3));}_0x58950b=_0x58950b||0x0;var _0x48ac61=0x1/_0x739dd3;var _0x5cd6b5=0x0;var _0x4b791c=0x0;var _0x4b7bfd=0x0;var _0x3ebc63=0x0;for(var _0x370b38=0x0;_0x3ebc63<_0x446cb3;_0x370b38+=0x1){_0x4b791c=_0x370b38/_0x1ce910;_0x5cd6b5=(_0x8d9cdf*_0x4b791c+_0x58950b)/_0x48ac61;_0x4b7bfd=utils['erlangb'](_0x5cd6b5,_0x122ce0);_0x3ebc63=_0x5cd6b5/_0x122ce0*(0x1-utils[_0x9191('0x228')](_0x5cd6b5,_0x122ce0));}return _0x1eeb04({'erlangCalls':_0x370b38,'erlangCallToSecond':_0x1ce910/_0x370b38,'erlangAbandonmentRate':_0x4b7bfd,'erlangBusyFactor':_0x3ebc63});});};module[_0x9191('0x230')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 7e07608..7c4b51d 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73e0=['Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','queue','exports','lodash','moment','string','name'];(function(_0x3aff8a,_0x41febc){var _0x2686bc=function(_0x59e959){while(--_0x59e959){_0x3aff8a['push'](_0x3aff8a['shift']());}};_0x2686bc(++_0x41febc);}(_0x73e0,0x1a0));var _0x073e=function(_0x2122d7,_0xca3d55){_0x2122d7=_0x2122d7-0x0;var _0x546bd8=_0x73e0[_0x2122d7];return _0x546bd8;};'use strict';var util=require('util');var _=require(_0x073e('0x0'));var moment=require(_0x073e('0x1'));function checkNameSurname(_0x5bcb52,_0x54babc,_0x564c38){var _0x3ae0c6='';if(!_['isNil'](_0x54babc)&&_0x073e('0x2')===typeof _0x54babc){_0x3ae0c6+=_0x54babc;}if(!_['isNil'](_0x564c38)&&_0x073e('0x2')===typeof _0x564c38){_0x3ae0c6+='\x20'+_0x564c38;}if(_0x3ae0c6!==''){return _0x3ae0c6;}return _0x5bcb52;}function Action(_0x4b50c5,_0x5d7166,_0x368928){this['voiceQueue']=_0x4b50c5;this['uniqueid']=_0x368928||undefined;this[_0x073e('0x3')]=checkNameSurname(_0x5d7166[_0x073e('0x4')]['phone'],_0x5d7166[_0x073e('0x4')][_0x073e('0x5')],_0x5d7166[_0x073e('0x4')][_0x073e('0x6')]);this[_0x073e('0x7')]=_0x5d7166[_0x073e('0x8')];this['queue']=_0x4b50c5[_0x073e('0x3')];this[_0x073e('0x9')]=_0x5d7166[_0x073e('0x9')]||![];this[_0x073e('0xa')]=_0x4b50c5[_0x073e('0xa')];this['dialQueueTimeout']=_0x4b50c5[_0x073e('0xb')]||0x3;this[_0x073e('0xc')]=_0x5d7166['scheduledat'];this[_0x073e('0xd')]=_0x5d7166[_0x073e('0xd')];this[_0x073e('0xe')]=_0x5d7166[_0x073e('0xe')];this[_0x073e('0xf')]=_0x5d7166[_0x073e('0xf')];this[_0x073e('0x10')]=_0x5d7166[_0x073e('0x10')];this[_0x073e('0x11')]=_0x5d7166['countdropretry'];this[_0x073e('0x12')]=_0x5d7166[_0x073e('0x12')];this['countmachineretry']=_0x5d7166['countmachineretry'];this['countagentrejectretry']=_0x5d7166['countagentrejectretry'];this['ContactId']=_0x5d7166[_0x073e('0x13')];this[_0x073e('0x14')]=_0x5d7166['ListId'];this[_0x073e('0x15')]=_0x5d7166[_0x073e('0x15')];this[_0x073e('0x16')]=_0x5d7166[_0x073e('0x16')];this[_0x073e('0x17')]=_0x5d7166[_0x073e('0x17')];this[_0x073e('0x18')]=_0x5d7166['id'];this[_0x073e('0x19')]=_0x5d7166[_0x073e('0x4')][_0x073e('0x5')]||'';this[_0x073e('0x1a')]=moment()['format'](_0x073e('0x1b'));this[_0x073e('0x1c')]=_0x5d7166[_0x073e('0x1c')];this[_0x073e('0x1d')]=_0x5d7166[_0x073e('0x1d')];this[_0x073e('0x1e')]=_0x5d7166[_0x073e('0x1e')];this[_0x073e('0x1f')]=_0x5d7166[_0x073e('0x1f')];this['originatecalleridnum']='';this[_0x073e('0x20')]='';}Action[_0x073e('0x21')][_0x073e('0x22')]=function(){return util[_0x073e('0x23')](_0x073e('0x24'),this[_0x073e('0x3')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0x073e('0x25')](this['voiceQueue'][_0x073e('0x26')]):this[_0x073e('0x7')]);};Action['prototype'][_0x073e('0x27')]=function(){return this[_0x073e('0x28')];};module[_0x073e('0x29')]=Action; \ No newline at end of file +var _0x4a15=['originatecalleridname','prototype','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum'];(function(_0x3b1cf8,_0x5b79f9){var _0x5d0434=function(_0x1b6559){while(--_0x1b6559){_0x3b1cf8['push'](_0x3b1cf8['shift']());}};_0x5d0434(++_0x5b79f9);}(_0x4a15,0xb4));var _0x54a1=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x4a15[_0x1399d6];return _0x4a9db4;};'use strict';var util=require(_0x54a1('0x0'));var _=require(_0x54a1('0x1'));var moment=require(_0x54a1('0x2'));function checkNameSurname(_0x5c6bab,_0x1c7b90,_0x3fb232){var _0x361303='';if(!_[_0x54a1('0x3')](_0x1c7b90)&&_0x54a1('0x4')===typeof _0x1c7b90){_0x361303+=_0x1c7b90;}if(!_[_0x54a1('0x3')](_0x3fb232)&&_0x54a1('0x4')===typeof _0x3fb232){_0x361303+='\x20'+_0x3fb232;}if(_0x361303!==''){return _0x361303;}return _0x5c6bab;}function Action(_0x1d03f7,_0x311651,_0x46d9bf){this['voiceQueue']=_0x1d03f7;this[_0x54a1('0x5')]=_0x46d9bf||undefined;this[_0x54a1('0x6')]=checkNameSurname(_0x311651[_0x54a1('0x7')][_0x54a1('0x8')],_0x311651['Contact'][_0x54a1('0x9')],_0x311651[_0x54a1('0x7')][_0x54a1('0xa')]);this[_0x54a1('0xb')]=_0x311651['phone'];this[_0x54a1('0xc')]=_0x1d03f7[_0x54a1('0x6')];this[_0x54a1('0xd')]=_0x311651[_0x54a1('0xd')]||![];this[_0x54a1('0xe')]=_0x1d03f7['type'];this[_0x54a1('0xf')]=_0x1d03f7[_0x54a1('0xf')]||0x3;this[_0x54a1('0x10')]=_0x311651[_0x54a1('0x10')];this[_0x54a1('0x11')]=_0x311651['countbusyretry'];this[_0x54a1('0x12')]=_0x311651['countcongestionretry'];this['countnoanswerretry']=_0x311651[_0x54a1('0x13')];this[_0x54a1('0x14')]=_0x311651[_0x54a1('0x14')];this[_0x54a1('0x15')]=_0x311651[_0x54a1('0x15')];this[_0x54a1('0x16')]=_0x311651[_0x54a1('0x16')];this[_0x54a1('0x17')]=_0x311651['countmachineretry'];this['countagentrejectretry']=_0x311651['countagentrejectretry'];this['ContactId']=_0x311651['ContactId'];this[_0x54a1('0x18')]=_0x311651[_0x54a1('0x18')];this[_0x54a1('0x19')]=_0x311651[_0x54a1('0x19')];this[_0x54a1('0x1a')]=_0x311651[_0x54a1('0x1a')];this[_0x54a1('0x1b')]=_0x311651[_0x54a1('0x1b')];this[_0x54a1('0x1c')]=_0x311651['id'];this['ContactFirstName']=_0x311651['Contact'][_0x54a1('0x9')]||'';this['starttime']=moment()[_0x54a1('0x1d')](_0x54a1('0x1e'));this[_0x54a1('0x1f')]=_0x311651['callback'];this[_0x54a1('0x20')]=_0x311651[_0x54a1('0x20')];this['callbackat']=_0x311651[_0x54a1('0x21')];this['recallme']=_0x311651['recallme'];this[_0x54a1('0x22')]='';this[_0x54a1('0x23')]='';}Action[_0x54a1('0x24')]['getCaller']=function(){return util[_0x54a1('0x1d')](_0x54a1('0x25'),this['name'],this[_0x54a1('0x26')][_0x54a1('0x27')]>0x0?this[_0x54a1('0xb')][_0x54a1('0x28')](this['voiceQueue'][_0x54a1('0x27')]):this[_0x54a1('0xb')]);};Action[_0x54a1('0x24')][_0x54a1('0x29')]=function(){return this[_0x54a1('0xc')];};module[_0x54a1('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 00241d1..a5975aa 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3914=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','Answer','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x3914,0x10d));var _0x4391=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x3914[_0x528497];return _0x392d59;};'use strict';var moment=require(_0x4391('0x0'));var utils=require(_0x4391('0x1'));function AgentComplete(_0x7d7b1e,_0xde1823){this['state']=0x4;this[_0x4391('0x2')]=_0x4391('0x3');this['scheduledat']=_0x7d7b1e['scheduledat'];this[_0x4391('0x4')]=_0x7d7b1e[_0x4391('0x4')];this['campaigntype']=_0x7d7b1e['type']===_0x4391('0x5')?_0x4391('0x6'):_0x7d7b1e['type'];this[_0x4391('0x7')]=_0x7d7b1e[_0x4391('0x7')];this[_0x4391('0x8')]=_0x7d7b1e[_0x4391('0x8')];this[_0x4391('0x9')]=_0x7d7b1e[_0x4391('0x9')];this['countglobal']=_0x7d7b1e[_0x4391('0x7')]+_0x7d7b1e['countcongestionretry']+_0x7d7b1e[_0x4391('0x9')]+_0x7d7b1e[_0x4391('0xa')]+_0x7d7b1e[_0x4391('0xb')]+_0x7d7b1e[_0x4391('0xc')]+_0x7d7b1e[_0x4391('0xd')]+_0x7d7b1e[_0x4391('0xe')];this['countnosuchnumberretry']=_0x7d7b1e[_0x4391('0xa')];this[_0x4391('0xb')]=_0x7d7b1e['countdropretry'];this[_0x4391('0xc')]=_0x7d7b1e[_0x4391('0xc')];this['countmachineretry']=_0x7d7b1e[_0x4391('0xd')];this['countagentrejectretry']=_0x7d7b1e[_0x4391('0xe')];this[_0x4391('0xf')]=_0xde1823[_0x4391('0xf')];this[_0x4391('0x10')]=_0x7d7b1e['name'];this[_0x4391('0x11')]=_0x7d7b1e[_0x4391('0x12')];this[_0x4391('0x13')]=_0x7d7b1e[_0x4391('0x13')];this['responsetime']=_0x7d7b1e[_0x4391('0x14')];this[_0x4391('0x15')]=_0x7d7b1e['answertime'];this[_0x4391('0x16')]=moment()[_0x4391('0x17')](_0x4391('0x18'));this['ringtime']=utils[_0x4391('0x19')](_0x7d7b1e[_0x4391('0x14')],_0x7d7b1e['starttime']);this[_0x4391('0x1a')]=utils[_0x4391('0x19')](_0x7d7b1e[_0x4391('0x15')],_0x7d7b1e[_0x4391('0x14')]);this[_0x4391('0x1b')]=utils[_0x4391('0x19')](this[_0x4391('0x16')],_0x7d7b1e['answertime']);this[_0x4391('0x6')]=_0xde1823[_0x4391('0x6')];this[_0x4391('0x1c')]=_0xde1823[_0x4391('0x1c')];this[_0x4391('0x1d')]=_0xde1823[_0x4391('0x1d')];this['callback']=_0x7d7b1e[_0x4391('0x1e')];this[_0x4391('0x1f')]=_0x7d7b1e['callbackuniqueid'];this[_0x4391('0x20')]=_0x7d7b1e['callbackat'];this[_0x4391('0x21')]=_0x7d7b1e[_0x4391('0x21')];this[_0x4391('0x22')]=_0x7d7b1e[_0x4391('0x22')];this[_0x4391('0x23')]=_0x7d7b1e[_0x4391('0x23')];this[_0x4391('0x24')]=_0x7d7b1e[_0x4391('0x24')];this[_0x4391('0x25')]=_0x7d7b1e[_0x4391('0x25')];this[_0x4391('0x26')]=_0x7d7b1e[_0x4391('0x26')];this[_0x4391('0x27')]=_0x7d7b1e['originatecalleridnum']||'';this[_0x4391('0x28')]=_0x7d7b1e['originatecalleridname']||'';this[_0x4391('0x29')]=_0x7d7b1e[_0x4391('0x29')];}module[_0x4391('0x2a')]=AgentComplete; \ No newline at end of file +var _0xfdba=['agiafterat','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','queue','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x58f2ff,_0x3de889){var _0x575a6f=function(_0x808da3){while(--_0x808da3){_0x58f2ff['push'](_0x58f2ff['shift']());}};_0x575a6f(++_0x3de889);}(_0xfdba,0xb1));var _0xafdb=function(_0x4554c0,_0x486ed1){_0x4554c0=_0x4554c0-0x0;var _0x4491bf=_0xfdba[_0x4554c0];return _0x4491bf;};'use strict';var moment=require(_0xafdb('0x0'));var utils=require(_0xafdb('0x1'));function AgentComplete(_0x45f89e,_0x100424){this[_0xafdb('0x2')]=0x4;this[_0xafdb('0x3')]=_0xafdb('0x4');this['scheduledat']=_0x45f89e[_0xafdb('0x5')];this[_0xafdb('0x6')]=_0x45f89e[_0xafdb('0x6')];this[_0xafdb('0x7')]=_0x45f89e[_0xafdb('0x6')]==='outbound'?'queue':_0x45f89e['type'];this[_0xafdb('0x8')]=_0x45f89e[_0xafdb('0x8')];this['countcongestionretry']=_0x45f89e[_0xafdb('0x9')];this[_0xafdb('0xa')]=_0x45f89e[_0xafdb('0xa')];this[_0xafdb('0xb')]=_0x45f89e['countbusyretry']+_0x45f89e['countcongestionretry']+_0x45f89e[_0xafdb('0xa')]+_0x45f89e[_0xafdb('0xc')]+_0x45f89e[_0xafdb('0xd')]+_0x45f89e[_0xafdb('0xe')]+_0x45f89e[_0xafdb('0xf')]+_0x45f89e['countagentrejectretry'];this[_0xafdb('0xc')]=_0x45f89e[_0xafdb('0xc')];this[_0xafdb('0xd')]=_0x45f89e['countdropretry'];this[_0xafdb('0xe')]=_0x45f89e[_0xafdb('0xe')];this[_0xafdb('0xf')]=_0x45f89e[_0xafdb('0xf')];this[_0xafdb('0x10')]=_0x45f89e[_0xafdb('0x10')];this[_0xafdb('0x11')]=_0x100424['uniqueid'];this['calleridname']=_0x45f89e[_0xafdb('0x12')];this['calleridnum']=_0x45f89e[_0xafdb('0x13')];this[_0xafdb('0x14')]=_0x45f89e['starttime'];this['responsetime']=_0x45f89e[_0xafdb('0x15')];this[_0xafdb('0x16')]=_0x45f89e['answertime'];this[_0xafdb('0x17')]=moment()[_0xafdb('0x18')](_0xafdb('0x19'));this[_0xafdb('0x1a')]=utils['getSeconds'](_0x45f89e[_0xafdb('0x15')],_0x45f89e['starttime']);this[_0xafdb('0x1b')]=utils['getSeconds'](_0x45f89e['answertime'],_0x45f89e[_0xafdb('0x15')]);this[_0xafdb('0x1c')]=utils[_0xafdb('0x1d')](this[_0xafdb('0x17')],_0x45f89e[_0xafdb('0x16')]);this[_0xafdb('0x1e')]=_0x100424[_0xafdb('0x1e')];this[_0xafdb('0x1f')]=_0x100424['membername'];this[_0xafdb('0x20')]=_0x100424[_0xafdb('0x20')];this[_0xafdb('0x21')]=_0x45f89e[_0xafdb('0x21')];this[_0xafdb('0x22')]=_0x45f89e[_0xafdb('0x22')];this['callbackat']=_0x45f89e['callbackat'];this[_0xafdb('0x23')]=_0x45f89e[_0xafdb('0x23')];this['ContactId']=_0x45f89e[_0xafdb('0x24')];this[_0xafdb('0x25')]=_0x45f89e[_0xafdb('0x25')];this['UserId']=_0x45f89e[_0xafdb('0x26')];this[_0xafdb('0x27')]=_0x45f89e['VoiceQueueId'];this['CampaignId']=_0x45f89e[_0xafdb('0x28')];this[_0xafdb('0x29')]=_0x45f89e[_0xafdb('0x29')]||'';this['originatecalleridname']=_0x45f89e[_0xafdb('0x2a')]||'';this[_0xafdb('0x2b')]=_0x45f89e[_0xafdb('0x2b')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 5958871..aa2a71b 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e6e=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','exports'];(function(_0x36e1c6,_0x77575f){var _0x5d014d=function(_0x13b598){while(--_0x13b598){_0x36e1c6['push'](_0x36e1c6['shift']());}};_0x5d014d(++_0x77575f);}(_0x4e6e,0x80));var _0xe4e6=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x4e6e[_0x46d0c9];return _0x174506;};'use strict';function Final(_0x411fa7){this['uniqueid']=_0x411fa7['uniqueid'];this[_0xe4e6('0x0')]=_0x411fa7[_0xe4e6('0x0')];this[_0xe4e6('0x1')]=_0x411fa7['type'];this[_0xe4e6('0x2')]=_0x411fa7['type']===_0xe4e6('0x3')?_0xe4e6('0x4'):_0x411fa7[_0xe4e6('0x1')];this[_0xe4e6('0x5')]=_0x411fa7[_0xe4e6('0x5')];this['countcongestionretry']=_0x411fa7['countcongestionretry'];this['countnoanswerretry']=_0x411fa7[_0xe4e6('0x6')];this[_0xe4e6('0x7')]=_0x411fa7[_0xe4e6('0x5')]+_0x411fa7['countcongestionretry']+_0x411fa7[_0xe4e6('0x6')]+_0x411fa7[_0xe4e6('0x8')]+_0x411fa7[_0xe4e6('0x9')]+_0x411fa7['countabandonedretry']+_0x411fa7[_0xe4e6('0xa')]+_0x411fa7[_0xe4e6('0xb')];this[_0xe4e6('0x8')]=_0x411fa7[_0xe4e6('0x8')];this[_0xe4e6('0x9')]=_0x411fa7[_0xe4e6('0x9')];this[_0xe4e6('0xc')]=_0x411fa7[_0xe4e6('0xc')];this[_0xe4e6('0xa')]=_0x411fa7[_0xe4e6('0xa')];this[_0xe4e6('0xb')]=_0x411fa7[_0xe4e6('0xb')];this[_0xe4e6('0x4')]=_0x411fa7[_0xe4e6('0x4')];this[_0xe4e6('0xd')]=_0x411fa7[_0xe4e6('0xd')];this['calleridnum']=_0x411fa7[_0xe4e6('0xe')];this[_0xe4e6('0xf')]=_0x411fa7['starttime'];this[_0xe4e6('0x10')]=_0x411fa7[_0xe4e6('0x10')];this[_0xe4e6('0x11')]=_0x411fa7['responsetime'];this[_0xe4e6('0x12')]=_0x411fa7[_0xe4e6('0x12')]||0x0;this[_0xe4e6('0x13')]=_0x411fa7[_0xe4e6('0x13')]||0x0;this['talktime']=_0x411fa7[_0xe4e6('0x14')]||0x0;this['callback']=_0x411fa7['callback'];this[_0xe4e6('0x15')]=_0x411fa7[_0xe4e6('0x15')];this[_0xe4e6('0x16')]=_0x411fa7[_0xe4e6('0x16')];this[_0xe4e6('0x17')]=_0x411fa7[_0xe4e6('0x17')];this['ContactId']=_0x411fa7[_0xe4e6('0x18')];this[_0xe4e6('0x19')]=_0x411fa7[_0xe4e6('0x19')];this[_0xe4e6('0x1a')]=_0x411fa7[_0xe4e6('0x1a')];this['VoiceQueueId']=_0x411fa7['VoiceQueueId'];this[_0xe4e6('0x1b')]=_0x411fa7['CampaignId'];this['originatecalleridnum']=_0x411fa7[_0xe4e6('0x1c')]||'';this[_0xe4e6('0x1d')]=_0x411fa7[_0xe4e6('0x1d')]||'';this[_0xe4e6('0x1e')]=_0x411fa7[_0xe4e6('0x1e')];this['statedesc']=_0x411fa7['statedesc'];}module[_0xe4e6('0x1f')]=Final; \ No newline at end of file +var _0x8d1f=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime'];(function(_0x2a9a61,_0x454bc8){var _0x9ed4c2=function(_0x1ac86c){while(--_0x1ac86c){_0x2a9a61['push'](_0x2a9a61['shift']());}};_0x9ed4c2(++_0x454bc8);}(_0x8d1f,0x7a));var _0xf8d1=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8d1f[_0x3e5086];return _0xfeb102;};'use strict';function Final(_0x30ace3){this[_0xf8d1('0x0')]=_0x30ace3['uniqueid'];this[_0xf8d1('0x1')]=_0x30ace3[_0xf8d1('0x1')];this['type']=_0x30ace3[_0xf8d1('0x2')];this[_0xf8d1('0x3')]=_0x30ace3[_0xf8d1('0x2')]===_0xf8d1('0x4')?'queue':_0x30ace3[_0xf8d1('0x2')];this['countbusyretry']=_0x30ace3[_0xf8d1('0x5')];this['countcongestionretry']=_0x30ace3[_0xf8d1('0x6')];this['countnoanswerretry']=_0x30ace3[_0xf8d1('0x7')];this[_0xf8d1('0x8')]=_0x30ace3[_0xf8d1('0x5')]+_0x30ace3[_0xf8d1('0x6')]+_0x30ace3['countnoanswerretry']+_0x30ace3['countnosuchnumberretry']+_0x30ace3[_0xf8d1('0x9')]+_0x30ace3[_0xf8d1('0xa')]+_0x30ace3[_0xf8d1('0xb')]+_0x30ace3[_0xf8d1('0xc')];this['countnosuchnumberretry']=_0x30ace3[_0xf8d1('0xd')];this[_0xf8d1('0x9')]=_0x30ace3[_0xf8d1('0x9')];this[_0xf8d1('0xa')]=_0x30ace3[_0xf8d1('0xa')];this['countmachineretry']=_0x30ace3[_0xf8d1('0xb')];this['countagentrejectretry']=_0x30ace3[_0xf8d1('0xc')];this[_0xf8d1('0xe')]=_0x30ace3[_0xf8d1('0xe')];this[_0xf8d1('0xf')]=_0x30ace3[_0xf8d1('0xf')];this['calleridnum']=_0x30ace3[_0xf8d1('0x10')];this['starttime']=_0x30ace3[_0xf8d1('0x11')];this[_0xf8d1('0x12')]=_0x30ace3[_0xf8d1('0x12')];this[_0xf8d1('0x13')]=_0x30ace3['responsetime'];this['ringtime']=_0x30ace3[_0xf8d1('0x14')]||0x0;this['holdtime']=_0x30ace3[_0xf8d1('0x15')]||0x0;this[_0xf8d1('0x16')]=_0x30ace3['talktime']||0x0;this[_0xf8d1('0x17')]=_0x30ace3['callback'];this[_0xf8d1('0x18')]=_0x30ace3[_0xf8d1('0x18')];this[_0xf8d1('0x19')]=_0x30ace3[_0xf8d1('0x19')];this['recallme']=_0x30ace3[_0xf8d1('0x1a')];this[_0xf8d1('0x1b')]=_0x30ace3[_0xf8d1('0x1b')];this[_0xf8d1('0x1c')]=_0x30ace3[_0xf8d1('0x1c')];this[_0xf8d1('0x1d')]=_0x30ace3[_0xf8d1('0x1d')];this[_0xf8d1('0x1e')]=_0x30ace3['VoiceQueueId'];this[_0xf8d1('0x1f')]=_0x30ace3[_0xf8d1('0x1f')];this['originatecalleridnum']=_0x30ace3['originatecalleridnum']||'';this[_0xf8d1('0x20')]=_0x30ace3['originatecalleridname']||'';this[_0xf8d1('0x21')]=_0x30ace3[_0xf8d1('0x21')];this[_0xf8d1('0x22')]=_0x30ace3[_0xf8d1('0x22')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 41af247..8c6c927 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa35d=['responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','amd','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa35d,0x15c));var _0xda35=function(_0x1dd6e7,_0x1cda2b){_0x1dd6e7=_0x1dd6e7-0x0;var _0xb53aa4=_0xa35d[_0x1dd6e7];return _0xb53aa4;};'use strict';var moment=require(_0xda35('0x0'));var utils=require(_0xda35('0x1'));function Hangup(_0x366f98,_0xaf8559){this[_0xda35('0x2')]=0x4;this[_0xda35('0x3')]='Answer';this[_0xda35('0x4')]=_0x366f98[_0xda35('0x4')];this[_0xda35('0x5')]=_0x366f98[_0xda35('0x5')];this['campaigntype']=_0x366f98[_0xda35('0x5')]===_0xda35('0x6')?'queue':_0x366f98[_0xda35('0x5')];this[_0xda35('0x7')]=_0x366f98[_0xda35('0x7')]||![];this[_0xda35('0x8')]=_0x366f98[_0xda35('0x8')];this['countcongestionretry']=_0x366f98['countcongestionretry'];this['countnoanswerretry']=_0x366f98[_0xda35('0x9')];this[_0xda35('0xa')]=_0x366f98['countbusyretry']+_0x366f98[_0xda35('0xb')]+_0x366f98[_0xda35('0x9')]+_0x366f98['countnosuchnumberretry']+_0x366f98[_0xda35('0xc')]+_0x366f98[_0xda35('0xd')]+_0x366f98[_0xda35('0xe')]+_0x366f98[_0xda35('0xf')];this['countnosuchnumberretry']=_0x366f98['countnosuchnumberretry'];this[_0xda35('0xc')]=_0x366f98[_0xda35('0xc')];this[_0xda35('0xd')]=_0x366f98[_0xda35('0xd')];this[_0xda35('0xe')]=_0x366f98[_0xda35('0xe')];this[_0xda35('0xf')]=_0x366f98['countagentrejectretry'];this[_0xda35('0x10')]=_0xaf8559[_0xda35('0x10')];this[_0xda35('0x11')]=_0x366f98[_0xda35('0x12')];this[_0xda35('0x13')]=_0x366f98['number'];this[_0xda35('0x14')]=_0x366f98['starttime'];this[_0xda35('0x15')]=_0x366f98['responsetime'];this[_0xda35('0x16')]=moment()['format'](_0xda35('0x17'));this['ringtime']=utils[_0xda35('0x18')](_0x366f98[_0xda35('0x15')],_0x366f98[_0xda35('0x14')]);this[_0xda35('0x19')]=0x0;this['talktime']=utils[_0xda35('0x18')](this['endtime'],_0x366f98[_0xda35('0x15')]);this['queue']=_0x366f98[_0xda35('0x1a')];this[_0xda35('0x1b')]=_0xda35('0x1c');this[_0xda35('0x1d')]=_0xaf8559[_0xda35('0x1e')];this[_0xda35('0x1f')]=_0x366f98[_0xda35('0x1f')];this[_0xda35('0x20')]=_0x366f98[_0xda35('0x20')];this['callbackat']=_0x366f98[_0xda35('0x21')];this['recallme']=_0x366f98[_0xda35('0x22')];this[_0xda35('0x23')]=_0x366f98[_0xda35('0x23')];this[_0xda35('0x24')]=_0x366f98[_0xda35('0x24')];this[_0xda35('0x25')]=_0x366f98['UserId'];this[_0xda35('0x26')]=_0x366f98[_0xda35('0x26')];this['CampaignId']=_0x366f98[_0xda35('0x27')];}module[_0xda35('0x28')]=Hangup; \ No newline at end of file +var _0xc973=['exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId'];(function(_0x450a0d,_0x21839f){var _0x41e651=function(_0x174efa){while(--_0x174efa){_0x450a0d['push'](_0x450a0d['shift']());}};_0x41e651(++_0x21839f);}(_0xc973,0xf1));var _0x3c97=function(_0x10b41f,_0x883b07){_0x10b41f=_0x10b41f-0x0;var _0x179515=_0xc973[_0x10b41f];return _0x179515;};'use strict';var moment=require(_0x3c97('0x0'));var utils=require(_0x3c97('0x1'));function Hangup(_0x2efaab,_0x31fd0c){this[_0x3c97('0x2')]=0x4;this[_0x3c97('0x3')]='Answer';this[_0x3c97('0x4')]=_0x2efaab['scheduledat'];this[_0x3c97('0x5')]=_0x2efaab[_0x3c97('0x5')];this['campaigntype']=_0x2efaab[_0x3c97('0x5')]===_0x3c97('0x6')?_0x3c97('0x7'):_0x2efaab['type'];this[_0x3c97('0x8')]=_0x2efaab[_0x3c97('0x8')]||![];this[_0x3c97('0x9')]=_0x2efaab[_0x3c97('0x9')];this['countcongestionretry']=_0x2efaab[_0x3c97('0xa')];this[_0x3c97('0xb')]=_0x2efaab[_0x3c97('0xb')];this[_0x3c97('0xc')]=_0x2efaab[_0x3c97('0x9')]+_0x2efaab[_0x3c97('0xa')]+_0x2efaab[_0x3c97('0xb')]+_0x2efaab[_0x3c97('0xd')]+_0x2efaab[_0x3c97('0xe')]+_0x2efaab['countabandonedretry']+_0x2efaab[_0x3c97('0xf')]+_0x2efaab[_0x3c97('0x10')];this[_0x3c97('0xd')]=_0x2efaab[_0x3c97('0xd')];this[_0x3c97('0xe')]=_0x2efaab['countdropretry'];this[_0x3c97('0x11')]=_0x2efaab['countabandonedretry'];this[_0x3c97('0xf')]=_0x2efaab[_0x3c97('0xf')];this[_0x3c97('0x10')]=_0x2efaab['countagentrejectretry'];this[_0x3c97('0x12')]=_0x31fd0c['uniqueid'];this[_0x3c97('0x13')]=_0x2efaab['name'];this[_0x3c97('0x14')]=_0x2efaab[_0x3c97('0x15')];this[_0x3c97('0x16')]=_0x2efaab[_0x3c97('0x16')];this[_0x3c97('0x17')]=_0x2efaab['responsetime'];this[_0x3c97('0x18')]=moment()[_0x3c97('0x19')](_0x3c97('0x1a'));this['ringtime']=utils[_0x3c97('0x1b')](_0x2efaab[_0x3c97('0x17')],_0x2efaab['starttime']);this[_0x3c97('0x1c')]=0x0;this['talktime']=utils[_0x3c97('0x1b')](this[_0x3c97('0x18')],_0x2efaab['responsetime']);this[_0x3c97('0x7')]=_0x2efaab[_0x3c97('0x7')];this['membername']=_0x3c97('0x1d');this['reason']=_0x31fd0c[_0x3c97('0x1e')];this['callback']=_0x2efaab[_0x3c97('0x1f')];this[_0x3c97('0x20')]=_0x2efaab[_0x3c97('0x20')];this[_0x3c97('0x21')]=_0x2efaab[_0x3c97('0x21')];this[_0x3c97('0x22')]=_0x2efaab[_0x3c97('0x22')];this[_0x3c97('0x23')]=_0x2efaab[_0x3c97('0x23')];this[_0x3c97('0x24')]=_0x2efaab[_0x3c97('0x24')];this['UserId']=_0x2efaab['UserId'];this[_0x3c97('0x25')]=_0x2efaab['VoiceQueueId'];this[_0x3c97('0x26')]=_0x2efaab[_0x3c97('0x26')];}module[_0x3c97('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index bc0c718..c147915 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x858f=['originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','number','responsetime','ringtime','getSeconds','starttime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x290d66,_0x1f9d6d){var _0x5393e8=function(_0x27b5a7){while(--_0x27b5a7){_0x290d66['push'](_0x290d66['shift']());}};_0x5393e8(++_0x1f9d6d);}(_0x858f,0x1c0));var _0xf858=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x858f[_0x26b5ff];return _0x58603e;};'use strict';var utils=require(_0xf858('0x0'));function History(_0x179bbc){this['uniqueid']=_0x179bbc[_0xf858('0x1')];this[_0xf858('0x2')]=_0x179bbc['scheduledat']||undefined;this[_0xf858('0x3')]=_0x179bbc['type'];this[_0xf858('0x4')]=_0x179bbc['type']==='outbound'?_0xf858('0x5'):_0x179bbc['type'];this[_0xf858('0x6')]=_0x179bbc['countbusyretry'];this['countcongestionretry']=_0x179bbc[_0xf858('0x7')];this[_0xf858('0x8')]=_0x179bbc['countnoanswerretry'];this[_0xf858('0x9')]=_0x179bbc[_0xf858('0x6')]+_0x179bbc['countcongestionretry']+_0x179bbc[_0xf858('0x8')]+_0x179bbc[_0xf858('0xa')]+_0x179bbc['countdropretry']+_0x179bbc[_0xf858('0xb')]+_0x179bbc[_0xf858('0xc')]+_0x179bbc[_0xf858('0xd')];this[_0xf858('0xa')]=_0x179bbc[_0xf858('0xa')];this[_0xf858('0xe')]=_0x179bbc['countdropretry'];this[_0xf858('0xb')]=_0x179bbc[_0xf858('0xb')];this[_0xf858('0xc')]=_0x179bbc[_0xf858('0xc')];this[_0xf858('0xd')]=_0x179bbc['countagentrejectretry'];this[_0xf858('0x5')]=_0x179bbc[_0xf858('0x5')];this[_0xf858('0xf')]=_0x179bbc[_0xf858('0x10')];this['calleridnum']=_0x179bbc[_0xf858('0x11')];this['starttime']=_0x179bbc['starttime'];this[_0xf858('0x12')]=_0x179bbc[_0xf858('0x12')];this['endtime']=_0x179bbc[_0xf858('0x12')];this[_0xf858('0x13')]=utils[_0xf858('0x14')](_0x179bbc[_0xf858('0x12')],_0x179bbc[_0xf858('0x15')]);this['holdtime']=0x0;this[_0xf858('0x16')]=0x0;this[_0xf858('0x17')]=_0x179bbc[_0xf858('0x17')];this[_0xf858('0x18')]=_0x179bbc[_0xf858('0x18')];this[_0xf858('0x19')]=_0x179bbc[_0xf858('0x19')];this[_0xf858('0x1a')]=_0x179bbc[_0xf858('0x1a')];this[_0xf858('0x1b')]=_0x179bbc['ContactId'];this[_0xf858('0x1c')]=_0x179bbc[_0xf858('0x1c')];this[_0xf858('0x1d')]=_0x179bbc[_0xf858('0x1d')];this[_0xf858('0x1e')]=_0x179bbc[_0xf858('0x1e')];this['CampaignId']=_0x179bbc[_0xf858('0x1f')];this[_0xf858('0x20')]=_0x179bbc[_0xf858('0x20')]||'';this[_0xf858('0x21')]=_0x179bbc[_0xf858('0x21')]||'';this[_0xf858('0x22')]=_0x179bbc[_0xf858('0x22')];this[_0xf858('0x23')]=_0x179bbc['statedesc'];}module[_0xf858('0x24')]=History; \ No newline at end of file +var _0x6dc4=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x4da6d5,_0x41991c){var _0x1768fa=function(_0x3995b2){while(--_0x3995b2){_0x4da6d5['push'](_0x4da6d5['shift']());}};_0x1768fa(++_0x41991c);}(_0x6dc4,0x169));var _0x46dc=function(_0x1f6ed8,_0x246490){_0x1f6ed8=_0x1f6ed8-0x0;var _0x476cac=_0x6dc4[_0x1f6ed8];return _0x476cac;};'use strict';var utils=require(_0x46dc('0x0'));function History(_0x29c742){this[_0x46dc('0x1')]=_0x29c742['uniqueid'];this[_0x46dc('0x2')]=_0x29c742[_0x46dc('0x2')]||undefined;this[_0x46dc('0x3')]=_0x29c742['type'];this[_0x46dc('0x4')]=_0x29c742['type']===_0x46dc('0x5')?_0x46dc('0x6'):_0x29c742[_0x46dc('0x3')];this[_0x46dc('0x7')]=_0x29c742[_0x46dc('0x7')];this[_0x46dc('0x8')]=_0x29c742['countcongestionretry'];this['countnoanswerretry']=_0x29c742[_0x46dc('0x9')];this[_0x46dc('0xa')]=_0x29c742[_0x46dc('0x7')]+_0x29c742[_0x46dc('0x8')]+_0x29c742[_0x46dc('0x9')]+_0x29c742[_0x46dc('0xb')]+_0x29c742[_0x46dc('0xc')]+_0x29c742[_0x46dc('0xd')]+_0x29c742[_0x46dc('0xe')]+_0x29c742[_0x46dc('0xf')];this['countnosuchnumberretry']=_0x29c742[_0x46dc('0xb')];this['countdropretry']=_0x29c742[_0x46dc('0xc')];this[_0x46dc('0xd')]=_0x29c742[_0x46dc('0xd')];this['countmachineretry']=_0x29c742[_0x46dc('0xe')];this[_0x46dc('0xf')]=_0x29c742[_0x46dc('0xf')];this[_0x46dc('0x6')]=_0x29c742[_0x46dc('0x6')];this['calleridname']=_0x29c742[_0x46dc('0x10')];this[_0x46dc('0x11')]=_0x29c742['number'];this[_0x46dc('0x12')]=_0x29c742[_0x46dc('0x12')];this['responsetime']=_0x29c742[_0x46dc('0x13')];this[_0x46dc('0x14')]=_0x29c742[_0x46dc('0x13')];this[_0x46dc('0x15')]=utils[_0x46dc('0x16')](_0x29c742[_0x46dc('0x13')],_0x29c742['starttime']);this[_0x46dc('0x17')]=0x0;this[_0x46dc('0x18')]=0x0;this['callback']=_0x29c742[_0x46dc('0x19')];this[_0x46dc('0x1a')]=_0x29c742[_0x46dc('0x1a')];this[_0x46dc('0x1b')]=_0x29c742[_0x46dc('0x1b')];this[_0x46dc('0x1c')]=_0x29c742[_0x46dc('0x1c')];this[_0x46dc('0x1d')]=_0x29c742[_0x46dc('0x1d')];this[_0x46dc('0x1e')]=_0x29c742[_0x46dc('0x1e')];this[_0x46dc('0x1f')]=_0x29c742[_0x46dc('0x1f')];this[_0x46dc('0x20')]=_0x29c742['VoiceQueueId'];this[_0x46dc('0x21')]=_0x29c742['CampaignId'];this[_0x46dc('0x22')]=_0x29c742[_0x46dc('0x22')]||'';this[_0x46dc('0x23')]=_0x29c742[_0x46dc('0x23')]||'';this[_0x46dc('0x24')]=_0x29c742['state'];this[_0x46dc('0x25')]=_0x29c742[_0x46dc('0x25')];}module[_0x46dc('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index ff9eae6..88e1476 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9c1=['../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','getSeconds','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc'];(function(_0x4b1d30,_0x5965d5){var _0x5d7ae1=function(_0x337e64){while(--_0x337e64){_0x4b1d30['push'](_0x4b1d30['shift']());}};_0x5d7ae1(++_0x5965d5);}(_0xa9c1,0x1e0));var _0x1a9c=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xa9c1[_0x273c39];return _0x46d6b5;};'use strict';var utils=require(_0x1a9c('0x0'));function QueueCallerAbandon(_0xf58d9f,_0xb4bf1a){this[_0x1a9c('0x1')]=_0xf58d9f['scheduledat'];this[_0x1a9c('0x2')]=_0xf58d9f['type'];this[_0x1a9c('0x3')]=_0xf58d9f[_0x1a9c('0x2')]===_0x1a9c('0x4')?_0x1a9c('0x5'):_0xf58d9f[_0x1a9c('0x2')];this[_0x1a9c('0x6')]=_0xf58d9f[_0x1a9c('0x6')];this['countcongestionretry']=_0xf58d9f[_0x1a9c('0x7')];this[_0x1a9c('0x8')]=_0xf58d9f[_0x1a9c('0x8')];this[_0x1a9c('0x9')]=_0xf58d9f[_0x1a9c('0x6')]+_0xf58d9f[_0x1a9c('0x7')]+_0xf58d9f['countnoanswerretry']+_0xf58d9f['countnosuchnumberretry']+_0xf58d9f[_0x1a9c('0xa')]+_0xf58d9f['countabandonedretry']+_0xf58d9f[_0x1a9c('0xb')]+_0xf58d9f[_0x1a9c('0xc')];this[_0x1a9c('0xd')]=_0xf58d9f[_0x1a9c('0xd')];this[_0x1a9c('0xa')]=_0xf58d9f[_0x1a9c('0xa')];this[_0x1a9c('0xe')]=_0xf58d9f[_0x1a9c('0xe')];this[_0x1a9c('0xb')]=_0xf58d9f['countmachineretry'];this[_0x1a9c('0xc')]=_0xf58d9f[_0x1a9c('0xc')];this['uniqueid']=_0xb4bf1a['uniqueid'];this['calleridname']=_0xf58d9f['name'];this[_0x1a9c('0xf')]=_0xf58d9f[_0x1a9c('0x10')];this[_0x1a9c('0x11')]=_0xf58d9f[_0x1a9c('0x11')];this[_0x1a9c('0x12')]=_0xf58d9f[_0x1a9c('0x12')];this['droptime']=_0xf58d9f[_0x1a9c('0x13')];this['dropreason']=_0xf58d9f['dropreason'];this[_0x1a9c('0x14')]=this[_0x1a9c('0x13')];this[_0x1a9c('0x15')]=utils[_0x1a9c('0x16')](_0xf58d9f[_0x1a9c('0x12')],_0xf58d9f['starttime']);this['holdtime']=utils[_0x1a9c('0x16')](this[_0x1a9c('0x13')],_0xf58d9f['responsetime']);this['talktime']=0x0;this[_0x1a9c('0x5')]=_0xb4bf1a[_0x1a9c('0x5')];this[_0x1a9c('0x17')]=_0xb4bf1a[_0x1a9c('0x18')];this['reason']=_0xb4bf1a[_0x1a9c('0x19')];this[_0x1a9c('0x1a')]=_0xf58d9f[_0x1a9c('0x1a')];this[_0x1a9c('0x1b')]=_0xf58d9f[_0x1a9c('0x1b')];this['callbackat']=_0xf58d9f[_0x1a9c('0x1c')];this[_0x1a9c('0x1d')]=_0xf58d9f['recallme'];this[_0x1a9c('0x1e')]=_0xf58d9f[_0x1a9c('0x1e')];this['ListId']=_0xf58d9f[_0x1a9c('0x1f')];this[_0x1a9c('0x20')]=_0xf58d9f[_0x1a9c('0x20')];this[_0x1a9c('0x21')]=_0xf58d9f['VoiceQueueId'];this[_0x1a9c('0x22')]=_0xf58d9f[_0x1a9c('0x22')];this['originatecalleridnum']=_0xf58d9f[_0x1a9c('0x23')]||'';this[_0x1a9c('0x24')]=_0xf58d9f['originatecalleridname']||'';this['agiafterat']=_0xf58d9f[_0x1a9c('0x25')];this[_0x1a9c('0x26')]=_0xf58d9f['state'];this[_0x1a9c('0x27')]=_0xf58d9f['statedesc'];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x7600=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','connectedlinename'];(function(_0x316882,_0x55d02a){var _0x451a8d=function(_0x5aeeb6){while(--_0x5aeeb6){_0x316882['push'](_0x316882['shift']());}};_0x451a8d(++_0x55d02a);}(_0x7600,0x12d));var _0x0760=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x7600[_0x485b5a];return _0xd2b34d;};'use strict';var utils=require(_0x0760('0x0'));function QueueCallerAbandon(_0x493e17,_0x10535a){this['scheduledat']=_0x493e17[_0x0760('0x1')];this[_0x0760('0x2')]=_0x493e17[_0x0760('0x2')];this['campaigntype']=_0x493e17[_0x0760('0x2')]==='outbound'?_0x0760('0x3'):_0x493e17[_0x0760('0x2')];this[_0x0760('0x4')]=_0x493e17[_0x0760('0x4')];this['countcongestionretry']=_0x493e17[_0x0760('0x5')];this[_0x0760('0x6')]=_0x493e17[_0x0760('0x6')];this[_0x0760('0x7')]=_0x493e17[_0x0760('0x4')]+_0x493e17['countcongestionretry']+_0x493e17[_0x0760('0x6')]+_0x493e17[_0x0760('0x8')]+_0x493e17[_0x0760('0x9')]+_0x493e17[_0x0760('0xa')]+_0x493e17[_0x0760('0xb')]+_0x493e17[_0x0760('0xc')];this[_0x0760('0x8')]=_0x493e17[_0x0760('0x8')];this[_0x0760('0x9')]=_0x493e17[_0x0760('0x9')];this[_0x0760('0xa')]=_0x493e17[_0x0760('0xa')];this['countmachineretry']=_0x493e17[_0x0760('0xb')];this['countagentrejectretry']=_0x493e17[_0x0760('0xc')];this[_0x0760('0xd')]=_0x10535a[_0x0760('0xd')];this['calleridname']=_0x493e17[_0x0760('0xe')];this[_0x0760('0xf')]=_0x493e17[_0x0760('0x10')];this[_0x0760('0x11')]=_0x493e17['starttime'];this[_0x0760('0x12')]=_0x493e17[_0x0760('0x12')];this[_0x0760('0x13')]=_0x493e17['droptime'];this[_0x0760('0x14')]=_0x493e17[_0x0760('0x14')];this[_0x0760('0x15')]=this[_0x0760('0x13')];this[_0x0760('0x16')]=utils[_0x0760('0x17')](_0x493e17[_0x0760('0x12')],_0x493e17[_0x0760('0x11')]);this[_0x0760('0x18')]=utils[_0x0760('0x17')](this[_0x0760('0x13')],_0x493e17['responsetime']);this[_0x0760('0x19')]=0x0;this['queue']=_0x10535a[_0x0760('0x3')];this['membername']=_0x10535a[_0x0760('0x1a')];this[_0x0760('0x1b')]=_0x10535a[_0x0760('0x1b')];this[_0x0760('0x1c')]=_0x493e17[_0x0760('0x1c')];this[_0x0760('0x1d')]=_0x493e17[_0x0760('0x1d')];this['callbackat']=_0x493e17[_0x0760('0x1e')];this[_0x0760('0x1f')]=_0x493e17[_0x0760('0x1f')];this[_0x0760('0x20')]=_0x493e17[_0x0760('0x20')];this[_0x0760('0x21')]=_0x493e17[_0x0760('0x21')];this['UserId']=_0x493e17[_0x0760('0x22')];this[_0x0760('0x23')]=_0x493e17['VoiceQueueId'];this[_0x0760('0x24')]=_0x493e17[_0x0760('0x24')];this[_0x0760('0x25')]=_0x493e17[_0x0760('0x25')]||'';this[_0x0760('0x26')]=_0x493e17[_0x0760('0x26')]||'';this['agiafterat']=_0x493e17['agiafterat'];this[_0x0760('0x27')]=_0x493e17['state'];this['statedesc']=_0x493e17[_0x0760('0x28')];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index f3c7a24..77cccde 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x572018,_0x179543){var _0x46b508=function(_0x5cdd59){while(--_0x5cdd59){_0x572018['push'](_0x572018['shift']());}};_0x46b508(++_0x179543);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x4837eb,_0x36c230){var _0x48bf8f=function(_0x16a2f2){while(--_0x16a2f2){_0x4837eb['push'](_0x4837eb['shift']());}};_0x48bf8f(++_0x36c230);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index f71c96c..570058d 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x312e=['Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','TrunkBackup','includes','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','toString','error','decrementOriginate','length','erlangb','checkContactLowerLimitOriginate','lodash','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','preview','isPreviewCampaign','type','ivr','isIVRCampaign','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','seconds','getSeconds','dialMethod','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval'];(function(_0x11d5d4,_0x25e7bb){var _0x49f3f8=function(_0x3d28ca){while(--_0x3d28ca){_0x11d5d4['push'](_0x11d5d4['shift']());}};_0x49f3f8(++_0x25e7bb);}(_0x312e,0xb3));var _0xe312=function(_0x3a1fd7,_0x482ff9){_0x3a1fd7=_0x3a1fd7-0x0;var _0x74d81f=_0x312e[_0x3a1fd7];return _0x74d81f;};'use strict';var _=require(_0xe312('0x0'));var moment=require('moment');var util=require(_0xe312('0x1'));var logger=require('../../../../config/logger')(_0xe312('0x2'));var timezones=require(_0xe312('0x3'))[_0xe312('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xe312('0x5'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xe312('0x6'),'DEACTIVATED':_0xe312('0x7'),'DISACTIVED':_0xe312('0x8'),'EMPTY_INTERVAL':_0xe312('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0xe312('0xa'),'NO_AVAILABLE_CONTACTS':_0xe312('0xb'),'NULL_INTERVAL':_0xe312('0xc'),'OVERTIME_INTERVAL':_0xe312('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xe312('0xe'),'QUEUE_RECALL':_0xe312('0xf'),'RECALL_TIMEOUT':_0xe312('0x10'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xe312('0x11'),'UNREACHABLE_TRUNK':_0xe312('0x12')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x499d5a){return _0x499d5a['dialMethod']===_0xe312('0x13');}exports[_0xe312('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x115522){return _0x115522[_0xe312('0x15')]===_0xe312('0x16');}exports[_0xe312('0x17')]=isIVRCampaign;function isOutboundQueue(_0x51c4d9){return _0x51c4d9[_0xe312('0x15')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x210efb){return _0x210efb['dialActive'];}exports[_0xe312('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x11ca6e){return _0x11ca6e[_0xe312('0x19')];}exports[_0xe312('0x1a')]=isIVRCampaignActive;function getSeconds(_0x37aeec,_0x5818cd){var _0x34bd95=moment(_0x37aeec)[_0xe312('0x1b')](0x0);var _0x27592f=moment(_0x5818cd)[_0xe312('0x1b')](0x0);return _0x34bd95['diff'](_0x27592f,_0xe312('0x1c'));}exports[_0xe312('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x16907f,_0x4e1320){var _0x2eb258=![];var _0x458c66=_0x16907f[_0xe312('0x1e')]!==_0x4e1320[_0xe312('0x1e')]||_0x16907f[_0xe312('0x1f')]!==_0x4e1320[_0xe312('0x1f')]||_0x16907f[_0xe312('0x20')]!==_0x4e1320[_0xe312('0x20')];var _0xeb8caa=_0x16907f[_0xe312('0x21')]!==_0x4e1320[_0xe312('0x21')]||_0x16907f[_0xe312('0x22')]!==_0x4e1320[_0xe312('0x22')]||_0x16907f[_0xe312('0x23')]!==_0x4e1320['loggedInDb']||_0x16907f[_0xe312('0x24')]!==_0x4e1320[_0xe312('0x24')]||_0x16907f[_0xe312('0x25')]!==_0x4e1320['talking']||_0x16907f[_0xe312('0x26')]!==_0x4e1320[_0xe312('0x26')]||_0x16907f['waiting']!==_0x4e1320[_0xe312('0x27')]||_0x16907f[_0xe312('0x28')]!==_0x4e1320['inUse']||_0x16907f[_0xe312('0x29')]!==_0x4e1320[_0xe312('0x29')];if(_0x16907f['Trunk']&&_0x4e1320[_0xe312('0x2a')]){_0x2eb258=_0x16907f['Trunk']['name']!==_0x4e1320[_0xe312('0x2a')][_0xe312('0x2b')]||_0x16907f[_0xe312('0x2a')][_0xe312('0x19')]!==_0x4e1320['Trunk'][_0xe312('0x19')];}return _0x458c66||_0xeb8caa||_0x2eb258;}exports[_0xe312('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5283e2){var _0x19c1fa=null;var _0x1a8709=_0x5283e2[_0xe312('0x2d')];if(_[_0xe312('0x2e')](_0x5283e2[_0xe312('0x2f')])||_[_0xe312('0x2e')](_0x5283e2[_0xe312('0x30')])||_[_0xe312('0x2e')](_0x5283e2[_0xe312('0x30')][_0xe312('0x31')])){_0x19c1fa=CAMPAIGN_STATUS[_0xe312('0x32')];}else if(_[_0xe312('0x33')](_0x5283e2[_0xe312('0x2f')])||_[_0xe312('0x33')](_0x5283e2[_0xe312('0x30')]['Intervals'])){_0x19c1fa=CAMPAIGN_STATUS[_0xe312('0x34')];}else if(_0x1a8709&&!timezones[_0x1a8709]){_0x19c1fa=CAMPAIGN_STATUS[_0xe312('0x35')];}return _0x19c1fa;}function checkAnyValidTrunk(_0x11086b,_0x5b9c3c){var _0x2fb4d0=null;var _0x12866c=_0xe312('0x36');var _0x4a92a4=[_0xe312('0x37'),'unmonitored'];var _0x23da1a=!![];if(_0x11086b['Trunk']&&_0x11086b[_0xe312('0x2a')]['active']){_0x12866c+=_0x11086b['Trunk'][_0xe312('0x2b')];_0x2fb4d0=_0x5b9c3c[_0x12866c];_0x23da1a=_0x4a92a4['includes'](_0x2fb4d0['status']);}else if(_0x11086b[_0xe312('0x38')]&&_0x11086b['TrunkBackup'][_0xe312('0x19')]){_0x12866c+=_0x11086b['TrunkBackup'][_0xe312('0x2b')];_0x2fb4d0=_0x5b9c3c[_0x12866c];_0x23da1a=_0x4a92a4[_0xe312('0x39')](_0x2fb4d0['status']);}return _0x23da1a;}function getQueueCampaignStatusMessage(_0x248011,_0x53df4f){var _0x4da0f5=CAMPAIGN_STATUS[_0xe312('0x5')];var _0x547bf7=isPreviewCampaign(_0x248011);if(!isQueueCampaignActive(_0x248011)){if(_0x547bf7){_0x4da0f5=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x248011[_0xe312('0x29')]===0x0&&_0x248011[_0xe312('0x25')]===0x0&&_0x248011[_0xe312('0x27')]===0x0&&(_0x248011[_0xe312('0x26')]||0x0)===0x0){_0x4da0f5=CAMPAIGN_STATUS['INACTIVE'];}else{_0x4da0f5=CAMPAIGN_STATUS[_0xe312('0x3a')];}}}else if(_0x248011['loggedIn']===0x0){_0x4da0f5=CAMPAIGN_STATUS[_0xe312('0x3b')];}else if(!checkAnyValidTrunk(_0x248011,_0x53df4f)){_0x4da0f5=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x248011)){var _0x436747=checkAnyValidQueueCampaignInterval(_0x248011);if(_0x436747){_0x4da0f5=_0x436747;}}return _0x4da0f5;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3902ef){var _0x451d27=CAMPAIGN_STATUS[_0xe312('0x3a')];if(_0x3902ef[_0xe312('0x29')]===0x0&&_0x3902ef[_0xe312('0x25')]===0x0&&_0x3902ef[_0xe312('0x27')]===0x0&&(_0x3902ef[_0xe312('0x26')]||0x0)===0x0){_0x451d27=CAMPAIGN_STATUS['INACTIVE'];}return _0x451d27;}exports[_0xe312('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4f94ea){var _0x5f2d7e=_0x4f94ea[_0xe312('0x3d')](/"(.*?)"/);return _0x5f2d7e?_0x5f2d7e[0x1]:_0x4f94ea;}exports[_0xe312('0x3e')]=extractCalleridName;function getCallerId(_0x4b41cb,_0x3c1748,_0x160085){if(!_[_0xe312('0x3f')](_0x160085)&&typeof _0x160085===_0xe312('0x40')&&!_[_0xe312('0x33')](_0x160085)){if(!_[_0xe312('0x3f')](_0x3c1748)&&typeof _0x3c1748===_0xe312('0x40')&&!_[_0xe312('0x33')](_0x3c1748)){return util[_0xe312('0x41')](_0xe312('0x42'),_0x3c1748,_0x160085);}return util[_0xe312('0x41')](_0xe312('0x42'),_0x160085,_0x160085);}if(!_[_0xe312('0x3f')](_0x4b41cb)&&typeof _0x4b41cb==='string'&&!_[_0xe312('0x33')](_0x4b41cb)){return _0x4b41cb;}return _0xe312('0x43');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x10e089,_0x5e9886){var _0x10c6be;var _0x162709;var _0x4e6488;if(_0x5e9886<=0x0){_0x5e9886=0x1;}_0x10c6be=new RegExp(_0xe312('0x44')+_0x5e9886+'}$');_0x162709=Math[_0xe312('0x45')](0xa,_0x5e9886-0x1);_0x4e6488=Math['pow'](0xa,_0x5e9886)-0x1;return util[_0xe312('0x41')]('%s',_['replace'](_0x10e089,_0x10c6be,_['random'](_0x162709,_0x4e6488)[_0xe312('0x46')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x2b7892){if(_0x2b7892[_0xe312('0x29')]&&_0x2b7892[_0xe312('0x29')]>0x0){_0x2b7892['originated']-=0x1;}else{logger[_0xe312('0x47')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xe312('0x48')]=decrementOriginate;function checkContactEmpty(_0x4fe94f){return _0x4fe94f&&_0x4fe94f[_0xe312('0x49')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x3fa242,_0x4baaad){if(_0x4baaad===0x0){return 0x0;}var _0x5b359d=0x1;for(var _0x5c5ccc=0x1;_0x5c5ccc<=_0x4baaad;_0x5c5ccc+=0x1){_0x5b359d=0x1+_0x5b359d*_0x5c5ccc/_0x3fa242;}return 0x1/_0x5b359d;}exports[_0xe312('0x4a')]=erlangb;function checkContactLowerLimitOriginate(_0x4a141d,_0x1c3cf0,_0x15d379){if(_0x1c3cf0>_0x15d379){for(var _0x37d431=0x0;_0x37d431<_0x1c3cf0-_0x15d379;_0x37d431+=0x1){decrementOriginate(_0x4a141d);}}}exports[_0xe312('0x4b')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xde54=['getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','outbound','isOutboundQueue','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','UNREACHABLE_TRUNK','DISACTIVED'];(function(_0x1b4c62,_0x294f75){var _0x5ab092=function(_0x1f9345){while(--_0x1f9345){_0x1b4c62['push'](_0x1b4c62['shift']());}};_0x5ab092(++_0x294f75);}(_0xde54,0x66));var _0x4de5=function(_0x205699,_0x3afccd){_0x205699=_0x205699-0x0;var _0xa3cf80=_0xde54[_0x205699];return _0xa3cf80;};'use strict';var _=require(_0x4de5('0x0'));var moment=require(_0x4de5('0x1'));var util=require(_0x4de5('0x2'));var logger=require(_0x4de5('0x3'))(_0x4de5('0x4'));var timezones=require(_0x4de5('0x5'))[_0x4de5('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x4de5('0x7'),'BLACKLIST':_0x4de5('0x8'),'CONTACTS_RESCHEDULED':_0x4de5('0x9'),'DEACTIVATED':_0x4de5('0xa'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x4de5('0xb'),'NO_AVAILABLE_CONTACTS':_0x4de5('0xc'),'NULL_INTERVAL':_0x4de5('0xd'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x4de5('0xe'),'QUEUE_RECALL':_0x4de5('0xf'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x4de5('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x4de5('0x11')};exports[_0x4de5('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x654556){return _0x654556[_0x4de5('0x13')]===_0x4de5('0x14');}exports[_0x4de5('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x4cd344){return _0x4cd344[_0x4de5('0x16')]==='ivr';}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x3de870){return _0x3de870[_0x4de5('0x16')]===_0x4de5('0x17');}exports[_0x4de5('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x270b5c){return _0x270b5c['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x27b1fd){return _0x27b1fd['active'];}exports[_0x4de5('0x19')]=isIVRCampaignActive;function getSeconds(_0x535c60,_0x1e5317){var _0x45d2ee=moment(_0x535c60)['milliseconds'](0x0);var _0x1e3d27=moment(_0x1e5317)[_0x4de5('0x1a')](0x0);return _0x45d2ee[_0x4de5('0x1b')](_0x1e3d27,_0x4de5('0x1c'));}exports[_0x4de5('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x260c91,_0x461f9b){var _0x384128=![];var _0x5c43ab=_0x260c91['dialMethod']!==_0x461f9b[_0x4de5('0x13')]||_0x260c91[_0x4de5('0x1e')]!==_0x461f9b['dialActive']||_0x260c91[_0x4de5('0x1f')]!==_0x461f9b[_0x4de5('0x1f')];var _0xc1aa39=_0x260c91['available']!==_0x461f9b['available']||_0x260c91[_0x4de5('0x20')]!==_0x461f9b[_0x4de5('0x20')]||_0x260c91[_0x4de5('0x21')]!==_0x461f9b['loggedInDb']||_0x260c91[_0x4de5('0x22')]!==_0x461f9b[_0x4de5('0x22')]||_0x260c91[_0x4de5('0x23')]!==_0x461f9b[_0x4de5('0x23')]||_0x260c91[_0x4de5('0x24')]!==_0x461f9b[_0x4de5('0x24')]||_0x260c91[_0x4de5('0x25')]!==_0x461f9b[_0x4de5('0x25')]||_0x260c91[_0x4de5('0x26')]!==_0x461f9b[_0x4de5('0x26')]||_0x260c91[_0x4de5('0x27')]!==_0x461f9b['originated'];if(_0x260c91[_0x4de5('0x28')]&&_0x461f9b['Trunk']){_0x384128=_0x260c91[_0x4de5('0x28')][_0x4de5('0x29')]!==_0x461f9b[_0x4de5('0x28')][_0x4de5('0x29')]||_0x260c91[_0x4de5('0x28')][_0x4de5('0x2a')]!==_0x461f9b[_0x4de5('0x28')][_0x4de5('0x2a')];}return _0x5c43ab||_0xc1aa39||_0x384128;}exports[_0x4de5('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x56290a){var _0x2b3953=null;var _0x282f73=_0x56290a[_0x4de5('0x2c')];if(_[_0x4de5('0x2d')](_0x56290a[_0x4de5('0x2e')])||_[_0x4de5('0x2d')](_0x56290a['Interval'])||_['isNil'](_0x56290a[_0x4de5('0x2f')][_0x4de5('0x30')])){_0x2b3953=CAMPAIGN_STATUS[_0x4de5('0x31')];}else if(_[_0x4de5('0x32')](_0x56290a[_0x4de5('0x2e')])||_[_0x4de5('0x32')](_0x56290a[_0x4de5('0x2f')][_0x4de5('0x30')])){_0x2b3953=CAMPAIGN_STATUS[_0x4de5('0x33')];}else if(_0x282f73&&!timezones[_0x282f73]){_0x2b3953=CAMPAIGN_STATUS[_0x4de5('0x34')];}return _0x2b3953;}function checkAnyValidTrunk(_0x4a4de4,_0x30189f){var _0x1f4924=null;var _0x444717=_0x4de5('0x35');var _0x2b6be3=[_0x4de5('0x36'),_0x4de5('0x37')];var _0x211ea4=!![];if(_0x4a4de4[_0x4de5('0x28')]&&_0x4a4de4[_0x4de5('0x28')][_0x4de5('0x2a')]){_0x444717+=_0x4a4de4[_0x4de5('0x28')]['name'];_0x1f4924=_0x30189f[_0x444717];_0x211ea4=_0x2b6be3['includes'](_0x1f4924[_0x4de5('0x38')]);}else if(_0x4a4de4[_0x4de5('0x39')]&&_0x4a4de4[_0x4de5('0x39')][_0x4de5('0x2a')]){_0x444717+=_0x4a4de4[_0x4de5('0x39')]['name'];_0x1f4924=_0x30189f[_0x444717];_0x211ea4=_0x2b6be3[_0x4de5('0x3a')](_0x1f4924[_0x4de5('0x38')]);}return _0x211ea4;}function getQueueCampaignStatusMessage(_0x6734c8,_0x566ef4){var _0x2fd2f0=CAMPAIGN_STATUS[_0x4de5('0x7')];var _0x37ea07=isPreviewCampaign(_0x6734c8);if(!isQueueCampaignActive(_0x6734c8)){if(_0x37ea07){_0x2fd2f0=CAMPAIGN_STATUS[_0x4de5('0x3b')];}else{if(_0x6734c8[_0x4de5('0x27')]===0x0&&_0x6734c8[_0x4de5('0x23')]===0x0&&_0x6734c8[_0x4de5('0x25')]===0x0&&(_0x6734c8[_0x4de5('0x24')]||0x0)===0x0){_0x2fd2f0=CAMPAIGN_STATUS[_0x4de5('0x3b')];}else{_0x2fd2f0=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x6734c8[_0x4de5('0x20')]===0x0){_0x2fd2f0=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x6734c8,_0x566ef4)){_0x2fd2f0=CAMPAIGN_STATUS[_0x4de5('0x3c')];}else if(!isPreviewCampaign(_0x6734c8)){var _0x22f00f=checkAnyValidQueueCampaignInterval(_0x6734c8);if(_0x22f00f){_0x2fd2f0=_0x22f00f;}}return _0x2fd2f0;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x41bf89){var _0xd2976a=CAMPAIGN_STATUS[_0x4de5('0x3d')];if(_0x41bf89['originated']===0x0&&_0x41bf89[_0x4de5('0x23')]===0x0&&_0x41bf89['waiting']===0x0&&(_0x41bf89[_0x4de5('0x24')]||0x0)===0x0){_0xd2976a=CAMPAIGN_STATUS['INACTIVE'];}return _0xd2976a;}exports[_0x4de5('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xde65ee){var _0x2331ee=_0xde65ee[_0x4de5('0x3f')](/"(.*?)"/);return _0x2331ee?_0x2331ee[0x1]:_0xde65ee;}exports[_0x4de5('0x40')]=extractCalleridName;function getCallerId(_0x1b861b,_0x729d5,_0x348671){if(!_[_0x4de5('0x41')](_0x348671)&&typeof _0x348671===_0x4de5('0x42')&&!_[_0x4de5('0x32')](_0x348671)){if(!_['isUndefined'](_0x729d5)&&typeof _0x729d5==='string'&&!_[_0x4de5('0x32')](_0x729d5)){return util[_0x4de5('0x43')](_0x4de5('0x44'),_0x729d5,_0x348671);}return util[_0x4de5('0x43')](_0x4de5('0x44'),_0x348671,_0x348671);}if(!_['isUndefined'](_0x1b861b)&&typeof _0x1b861b==='string'&&!_[_0x4de5('0x32')](_0x1b861b)){return _0x1b861b;}return'\x22\x22\x20<>';}exports[_0x4de5('0x45')]=getCallerId;function getCallerIdRandom(_0x4c156d,_0x55472a){var _0x3e0531;var _0x3ff9f6;var _0x5ee489;if(_0x55472a<=0x0){_0x55472a=0x1;}_0x3e0531=new RegExp(_0x4de5('0x46')+_0x55472a+'}$');_0x3ff9f6=Math[_0x4de5('0x47')](0xa,_0x55472a-0x1);_0x5ee489=Math[_0x4de5('0x47')](0xa,_0x55472a)-0x1;return util[_0x4de5('0x43')]('%s',_[_0x4de5('0x48')](_0x4c156d,_0x3e0531,_[_0x4de5('0x49')](_0x3ff9f6,_0x5ee489)[_0x4de5('0x4a')]()));}exports[_0x4de5('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x563063){if(_0x563063[_0x4de5('0x27')]&&_0x563063[_0x4de5('0x27')]>0x0){_0x563063['originated']-=0x1;}else{logger['error'](_0x4de5('0x4c'));}}exports[_0x4de5('0x4d')]=decrementOriginate;function checkContactEmpty(_0x25422b){return _0x25422b&&_0x25422b[_0x4de5('0x4e')]>0x0;}exports[_0x4de5('0x4f')]=checkContactEmpty;function erlangb(_0x56dd4d,_0x1baa34){if(_0x1baa34===0x0){return 0x0;}var _0xbceff9=0x1;for(var _0x5af8d9=0x1;_0x5af8d9<=_0x1baa34;_0x5af8d9+=0x1){_0xbceff9=0x1+_0xbceff9*_0x5af8d9/_0x56dd4d;}return 0x1/_0xbceff9;}exports[_0x4de5('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x2e2986,_0x250fb9,_0x2bc910){if(_0x250fb9>_0x2bc910){for(var _0x176ce4=0x0;_0x176ce4<_0x250fb9-_0x2bc910;_0x176ce4+=0x1){decrementOriginate(_0x2e2986);}}}exports[_0x4de5('0x51')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 3f709a2..a6aa3f6 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(_0x36d285,_0x1c3aaf){var _0x60719a=function(_0x3a3049){while(--_0x3a3049){_0x36d285['push'](_0x36d285['shift']());}};_0x60719a(++_0x1c3aaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x22a263,_0x560c72){var _0x2b1a24=function(_0x3477d3){while(--_0x3477d3){_0x22a263['push'](_0x22a263['shift']());}};_0x2b1a24(++_0x560c72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 5d0e59d..e43e061 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 _0xb44b=['[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','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','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','checkTrunk','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','channelstate','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb44b,0x118));var _0xbb44=function(_0x35027c,_0x4af623){_0x35027c=_0x35027c-0x0;var _0x4bba7d=_0xb44b[_0x35027c];return _0x4bba7d;};'use strict';var util=require(_0xbb44('0x0'));var _=require(_0xbb44('0x1'));var BPromise=require('bluebird');var uuid=require(_0xbb44('0x2'));var moment=require(_0xbb44('0x3'));var path=require(_0xbb44('0x4'));var tiff2pdf=require(_0xbb44('0x5'));var gs=require(_0xbb44('0x6'));var logger=require(_0xbb44('0x7'))(_0xbb44('0x8'));var ami=require(_0xbb44('0x9'));var rpcDb=require(_0xbb44('0xa'));var Channel=require('./channel');var ut=require(_0xbb44('0xb'));var Action=require(_0xbb44('0xc'));var faxAccount=require(_0xbb44('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xbb44('0xe'));function Fax(_0x1262b9){this[_0xbb44('0xf')]={};this[_0xbb44('0x10')]=_0x1262b9[_0xbb44('0x10')];this[_0xbb44('0x11')]=_0x1262b9['trunks'];this[_0xbb44('0x12')]={};ami['on'](_0xbb44('0x13'),this[_0xbb44('0x14')][_0xbb44('0x15')](this));ami['on']('varset',this[_0xbb44('0x16')]['bind'](this));ami['on'](_0xbb44('0x17'),this[_0xbb44('0x18')]['bind'](this));ami['on'](_0xbb44('0x19'),this[_0xbb44('0x1a')]['bind'](this));ami['on'](_0xbb44('0x1b'),this[_0xbb44('0x1c')]['bind'](this));ami['on'](_0xbb44('0x1d'),this[_0xbb44('0x1e')]['bind'](this));ami['on'](_0xbb44('0x1f'),this['syncHangup'][_0xbb44('0x15')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xbb44('0x15')](this));}Fax[_0xbb44('0x20')]['syncNewchannel']=function(_0x774b47){if(_0x774b47['context']===_0xbb44('0x21')){for(var _0x18556d in this[_0xbb44('0x10')]){if(this[_0xbb44('0x10')][_0xbb44('0x22')](_0x18556d)){if(_0x774b47['exten']===this['faxAccounts'][_0x18556d][_0xbb44('0x23')]){this[_0xbb44('0xf')][_0x774b47[_0xbb44('0x24')]]={};this[_0xbb44('0xf')][_0x774b47[_0xbb44('0x24')]][_0xbb44('0x25')]=_0x774b47[_0xbb44('0x25')];this[_0xbb44('0xf')][_0x774b47[_0xbb44('0x24')]]['id']=this[_0xbb44('0x10')][_0x18556d]['id'];this[_0xbb44('0xf')][_0x774b47['uniqueid']][_0xbb44('0x26')]=this[_0xbb44('0x10')][_0x18556d][_0xbb44('0x26')];logger['info'](_0x774b47[_0xbb44('0x24')],_0xbb44('0x27'));}}}}if(this[_0xbb44('0x12')][_0x774b47[_0xbb44('0x24')]]){this[_0xbb44('0xf')][_0x774b47['uniqueid']]={};this['channels'][_0x774b47['uniqueid']][_0xbb44('0x25')]=_0x774b47[_0xbb44('0x25')];logger[_0xbb44('0x28')](_0x774b47[_0xbb44('0x24')],'\x20syncNewchannel\x20');}};Fax[_0xbb44('0x20')]['syncVarSet']=function(_0x4bd942){if(this['channels'][_0x4bd942['uniqueid']]){for(var _0x5147a8 in _0x4bd942[_0xbb44('0x29')]){if(_0x4bd942[_0xbb44('0x29')][_0xbb44('0x22')](_0x5147a8)){this[_0xbb44('0xf')][_0x4bd942[_0xbb44('0x24')]][_0x5147a8]=_0x4bd942['value'];}}}};Fax[_0xbb44('0x20')][_0xbb44('0x18')]=function(_0x1a2a33){if(this[_0xbb44('0xf')][_0x1a2a33['uniqueid']]){this[_0xbb44('0xf')][_0x1a2a33[_0xbb44('0x24')]][_0xbb44('0x2a')]=_0x1a2a33[_0xbb44('0x2a')];this[_0xbb44('0xf')][_0x1a2a33['uniqueid']]['channelstatedesc']=_0x1a2a33['channelstatedesc'];}};Fax[_0xbb44('0x20')][_0xbb44('0x1a')]=function(_0x20066b){if(this[_0xbb44('0xf')][_0x20066b[_0xbb44('0x24')]]){for(var _0x44f22e in _0x20066b['variable']){if(_0x20066b[_0xbb44('0x29')][_0xbb44('0x22')](_0x44f22e)){this['channels'][_0x20066b['uniqueid']][_0x44f22e]=_0x20066b[_0xbb44('0x2b')];}}}};Fax[_0xbb44('0x20')][_0xbb44('0x1c')]=function(_0x566554){if(this['channels'][_0x566554[_0xbb44('0x24')]]){this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]][_0xbb44('0x2c')]=_0x566554['operation'];this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]][_0xbb44('0x2d')]=_0x566554[_0xbb44('0x2d')];this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]]['localstationid']=_0x566554[_0xbb44('0x23')];this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]][_0xbb44('0x2e')]=_0x566554[_0xbb44('0x2e')];logger['info'](_0x566554[_0xbb44('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0xbb44('0x20')][_0xbb44('0x1e')]=function(_0x208b1f){var _0x464054=this;if(this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]]){var _0x5439e7=this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]]['id'];this[_0xbb44('0xf')][_0x208b1f['uniqueid']][_0xbb44('0x2f')]=_0x208b1f[_0xbb44('0x2f')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x30')]=_0x208b1f[_0xbb44('0x30')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x23')]=_0x208b1f['localstationid'];this[_0xbb44('0xf')][_0x208b1f['uniqueid']][_0xbb44('0x31')]=_0x208b1f[_0xbb44('0x31')];this[_0xbb44('0xf')][_0x208b1f['uniqueid']][_0xbb44('0x32')]=_0x208b1f[_0xbb44('0x32')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x2e')]=_0x208b1f[_0xbb44('0x2e')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x33')]=_0x208b1f[_0xbb44('0x33')];if(this['channels'][_0x208b1f['uniqueid']][_0xbb44('0x30')]>0x0){tiff2pdf(_0x208b1f[_0xbb44('0x2e')],_0xbb44('0x34'),function(_0x1d4622){logger[_0xbb44('0x28')](_0x208b1f[_0xbb44('0x24')],_0xbb44('0x35'),_0x1d4622['message']);attachment[_0xbb44('0x36')]({'name':path['parse'](_0x208b1f[_0xbb44('0x2e')])['name'],'basename':path[_0xbb44('0x37')](_0x208b1f[_0xbb44('0x2e')])[_0xbb44('0x26')]+'.pdf','type':_0xbb44('0x38')})[_0xbb44('0x39')](function(_0x3c6ef9){faxAccount[_0xbb44('0x3a')](_0x5439e7,{'from':_0x208b1f[_0xbb44('0x33')],'mapKey':'fax','body':path[_0xbb44('0x37')](_0x208b1f[_0xbb44('0x2e')])[_0xbb44('0x26')]+_0xbb44('0x3b'),'AttachmentId':_0x3c6ef9['id']})[_0xbb44('0x3c')](function(_0x12ac9f){logger[_0xbb44('0x3d')](_0x208b1f[_0xbb44('0x24')],_0xbb44('0x3e'),JSON[_0xbb44('0x3f')](_0x12ac9f));});})[_0xbb44('0x3c')](function(_0x1bc8f1){logger[_0xbb44('0x3d')](_0x208b1f[_0xbb44('0x24')],_0xbb44('0x40'),JSON['stringify'](_0x1bc8f1));});});}logger['info'](_0x208b1f['uniqueid'],'\x20receiveFax\x20');}};Fax[_0xbb44('0x20')][_0xbb44('0x41')]=function(_0x43b29d){if(this[_0xbb44('0x12')][_0x43b29d[_0xbb44('0x24')]]){_[_0xbb44('0x42')](this['channels'][_0x43b29d[_0xbb44('0x24')]],_['pick'](_0x43b29d,[_0xbb44('0x43'),_0xbb44('0x44')]));}};function updateStatus(_0xbd46b3){if(_0xbd46b3[_0xbb44('0x45')]){faxMessage[_0xbb44('0x46')](_0xbd46b3[_0xbb44('0x45')],{'failMessage':_0xbb44('0x47')})[_0xbb44('0x39')](function(_0x35f91c){ut[_0xbb44('0x48')](_0xbb44('0x49'),_0x35f91c);})[_0xbb44('0x3c')](function(_0x4367d8){ut[_0xbb44('0x48')](_0xbb44('0x4a'),_0x4367d8);});}else{ut[_0xbb44('0x48')](_0xbb44('0x4b'));}}Fax['prototype'][_0xbb44('0x4c')]=function(_0x3de710,_0x1b2b39,_0x720198){var _0x5e0c7e=this;var _0x5a0822={};if(_0x1b2b39){_0x5a0822={'read':_0x1b2b39};}else{_0x5a0822={'failMessage':_0x720198};}if(this[_0xbb44('0x12')][_0x3de710][_0xbb44('0x45')]){faxMessage[_0xbb44('0x46')](this['actions'][_0x3de710]['AttachmentId'],_0x5a0822)[_0xbb44('0x39')](function(_0x23f868){ut[_0xbb44('0x48')]('[Fax][Message][Updated]',_0x23f868);})[_0xbb44('0x3c')](function(_0x3994c6){ut['logger'](_0xbb44('0x4d'),_0x3994c6);})[_0xbb44('0x4e')](function(){delete _0x5e0c7e[_0xbb44('0xf')][_0x3de710];delete _0x5e0c7e[_0xbb44('0x12')][_0x3de710];});}else{ut[_0xbb44('0x48')](_0xbb44('0x4f'));delete this[_0xbb44('0xf')][_0x3de710];delete this['actions'][_0x3de710];}};Fax[_0xbb44('0x20')][_0xbb44('0x50')]=function(_0x2df9e6){var _0x11c557=this;if(this['channels'][_0x2df9e6[_0xbb44('0x24')]]){if(this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]]){this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]]['id']=this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]]['id'];this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x26')]=this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x26')];}logger[_0xbb44('0x28')](_0x2df9e6[_0xbb44('0x24')],this[_0xbb44('0x12')][_0x2df9e6['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xbb44('0x51'),JSON['stringify'](this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]]));if(this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]]){if(this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]]['faxpages']>0x0&&this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x1b')]===_0xbb44('0x52')){this['updateStatus'](_0x2df9e6[_0xbb44('0x24')],!![]);}else{this[_0xbb44('0x4c')](_0x2df9e6[_0xbb44('0x24')],![],this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x53')]?_0xbb44('0x54')+this[_0xbb44('0xf')][_0x2df9e6['uniqueid']][_0xbb44('0x53')]:_0xbb44('0x55'));}}}};Fax[_0xbb44('0x20')][_0xbb44('0x56')]=function(_0x2dc6fa){var _0x5e4b83=this;return new BPromise(function(_0x106be8,_0x345146){_0x5e4b83[_0xbb44('0x57')](_0x2dc6fa,_0x5e4b83[_0xbb44('0x10')][_0x2dc6fa[_0xbb44('0x58')]])[_0xbb44('0x39')](function(_0x2e265f){ut[_0xbb44('0x48')]('[Fax][execOriginate][success]',_0x2e265f);_0x106be8(ut[_0xbb44('0x59')](_0xbb44('0x5a')));})[_0xbb44('0x3c')](function(_0x360ac6){ut[_0xbb44('0x48')](_0xbb44('0x5b'),_0x360ac6);updateStatus(_0x2dc6fa);_0x345146(ut[_0xbb44('0x59')](_0xbb44('0x5c')));});});};Fax['prototype'][_0xbb44('0x5d')]=function(_0x23f313){var _0x2d1997=this;return new BPromise(function(_0x47940d,_0x359840){var _0x3f378d=_0x2d1997['checkTrunk'](_0x2d1997[_0xbb44('0x10')][_0x23f313[_0xbb44('0x58')]][_0xbb44('0x5e')],_0x23f313);if(_0x3f378d['isValid']){_0x47940d(ut[_0xbb44('0x59')](_0xbb44('0x5f')));}else{_0x359840(ut[_0xbb44('0x59')](_0x3f378d['message']));}});};function originate(_0x38787f,_0x5c7b63,_0x4d429f){return new BPromise(function(_0x3f13de,_0x403e64){if(_0x4d429f){var _0x4a0bbe=util['format'](_0xbb44('0x60'),path[_0xbb44('0x37')](_0x38787f[_0xbb44('0x4')])['name'],_0x38787f['path']);gs[_0xbb44('0x61')](_0x4a0bbe)['then'](function(){_0x38787f[_0xbb44('0x4')]=util['format'](_0xbb44('0x62'),path[_0xbb44('0x37')](_0x38787f['path'])[_0xbb44('0x63')],path[_0xbb44('0x37')](_0x38787f[_0xbb44('0x4')])[_0xbb44('0x26')]);_0x5c7b63[_0xbb44('0x64')]=_0x38787f[_0xbb44('0x4')];ut['logger'](_0xbb44('0x65'),'');ami[_0xbb44('0x66')](ut['variablesAction'](_0x38787f,_0x5c7b63))[_0xbb44('0x39')](function(_0x341e82){_0x3f13de(_0x341e82);})[_0xbb44('0x3c')](function(_0x46e1b0){_0x403e64(_0x46e1b0);});})[_0xbb44('0x3c')](function(_0x589780){_0x403e64(_0x589780);});}else{ami[_0xbb44('0x66')](ut[_0xbb44('0x67')](_0x38787f,_0x5c7b63))[_0xbb44('0x39')](function(_0xb55a8d){_0x3f13de(_0xb55a8d);})[_0xbb44('0x3c')](function(_0x1f3e91){_0x403e64(_0x1f3e91);});}});}Fax[_0xbb44('0x20')][_0xbb44('0x57')]=function(_0x282f7e,_0xe1c05a){var _0x2fceea=this;return new BPromise(function(_0x2988b9,_0x3f204f){var _0x1b6e6c=uuid['v4']();var _0x4cba78=ut['addVariables'](_0x282f7e,_0xe1c05a);_0x2fceea[_0xbb44('0x12')][_0x1b6e6c]=new Action(_0x1b6e6c,_0xe1c05a,_0x282f7e);var _0x4fe0c0=_0x2fceea[_0xbb44('0x12')][_0x1b6e6c];if(path[_0xbb44('0x37')](_0x282f7e[_0xbb44('0x4')])['ext']===_0xbb44('0x3b')){originate(_0x4fe0c0,_0x4cba78,!![])['then'](function(_0x311910){_0x2988b9(_0x311910);})[_0xbb44('0x3c')](function(_0x2755e9){_0x3f204f(_0x2755e9);});}else{originate(_0x4fe0c0,_0x4cba78,![])['then'](function(_0xc905b9){_0x2988b9(_0xc905b9);})[_0xbb44('0x3c')](function(_0xf980d4){_0x3f204f(_0xf980d4);});}});};Fax[_0xbb44('0x20')][_0xbb44('0x68')]=function(_0x5ae9a3){return!_[_0xbb44('0x69')](_0x5ae9a3)&&!_[_0xbb44('0x69')](_0x5ae9a3[_0xbb44('0x26')])&&!_[_0xbb44('0x69')](_0x5ae9a3[_0xbb44('0x6a')])&&_0x5ae9a3[_0xbb44('0x6a')]&&!_[_0xbb44('0x69')](this[_0xbb44('0x11')][util['format']('SIP/%s',_0x5ae9a3['name'])])&&!_[_0xbb44('0x69')](this[_0xbb44('0x11')][util[_0xbb44('0x6b')]('SIP/%s',_0x5ae9a3[_0xbb44('0x26')])][_0xbb44('0x2d')])&&(this[_0xbb44('0x11')][util[_0xbb44('0x6b')](_0xbb44('0x6c'),_0x5ae9a3[_0xbb44('0x26')])]['status']===_0xbb44('0x6d')||this[_0xbb44('0x11')][util[_0xbb44('0x6b')](_0xbb44('0x6c'),_0x5ae9a3['name'])][_0xbb44('0x2d')]===_0xbb44('0x6e'));};Fax[_0xbb44('0x20')][_0xbb44('0x6f')]=function(_0xaff32c,_0x564964){if(!this[_0xbb44('0x68')](_0xaff32c)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xbb44('0x69')](_0xaff32c)?'':_0xaff32c[_0xbb44('0x26')]+_0xbb44('0x70'));return{'isValid':![],'message':_0xbb44('0x71')};}if(_[_0xbb44('0x69')](_0x564964['fax'])){ut[_0xbb44('0x48')](_0xbb44('0x72'),JSON[_0xbb44('0x3f')](_0x564964));return{'isValid':![],'message':_0xbb44('0x73')};}if(_[_0xbb44('0x69')](_0x564964[_0xbb44('0x4')])){ut[_0xbb44('0x48')](_0xbb44('0x74'),JSON[_0xbb44('0x3f')](_0x564964));return{'isValid':![],'message':_0xbb44('0x75')};}return{'isValid':!![],'message':_0xbb44('0x76')};};module['exports']=Fax; \ No newline at end of file +var _0x7b33=['util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','./rpcDb','./channel','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','prototype','channelstate','channelstatedesc','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','.pdf','application/pdf','notify','fax','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','reason','[Fax][Message][Error][Updated]','logger','updateStatus','AttachmentId','update','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20path','Is\x20Valid','exports'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x7b33,0x6f));var _0x37b3=function(_0x26b284,_0x1328ca){_0x26b284=_0x26b284-0x0;var _0x26dcaa=_0x7b33[_0x26b284];return _0x26dcaa;};'use strict';var util=require(_0x37b3('0x0'));var _=require(_0x37b3('0x1'));var BPromise=require(_0x37b3('0x2'));var uuid=require('uuid');var moment=require(_0x37b3('0x3'));var path=require(_0x37b3('0x4'));var tiff2pdf=require(_0x37b3('0x5'));var gs=require(_0x37b3('0x6'));var logger=require(_0x37b3('0x7'))('fax');var ami=require('../ami');var rpcDb=require(_0x37b3('0x8'));var Channel=require(_0x37b3('0x9'));var ut=require('./util/util');var Action=require(_0x37b3('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x37b3('0xb'));function Fax(_0x1e303e){this[_0x37b3('0xc')]={};this[_0x37b3('0xd')]=_0x1e303e[_0x37b3('0xd')];this[_0x37b3('0xe')]=_0x1e303e[_0x37b3('0xe')];this[_0x37b3('0xf')]={};ami['on']('newchannel',this[_0x37b3('0x10')][_0x37b3('0x11')](this));ami['on'](_0x37b3('0x12'),this[_0x37b3('0x13')][_0x37b3('0x11')](this));ami['on'](_0x37b3('0x14'),this[_0x37b3('0x15')]['bind'](this));ami['on'](_0x37b3('0x16'),this[_0x37b3('0x17')]['bind'](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x37b3('0x11')](this));ami['on'](_0x37b3('0x18'),this[_0x37b3('0x19')]['bind'](this));ami['on'](_0x37b3('0x1a'),this[_0x37b3('0x1b')][_0x37b3('0x11')](this));ami['on'](_0x37b3('0x1c'),this[_0x37b3('0x1d')]['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0x4aa5b8){if(_0x4aa5b8[_0x37b3('0x1e')]==='from-voip-provider'){for(var _0xe7dc65 in this[_0x37b3('0xd')]){if(this[_0x37b3('0xd')]['hasOwnProperty'](_0xe7dc65)){if(_0x4aa5b8[_0x37b3('0x1f')]===this['faxAccounts'][_0xe7dc65]['localstationid']){this[_0x37b3('0xc')][_0x4aa5b8[_0x37b3('0x20')]]={};this[_0x37b3('0xc')][_0x4aa5b8[_0x37b3('0x20')]][_0x37b3('0x21')]=_0x4aa5b8[_0x37b3('0x21')];this[_0x37b3('0xc')][_0x4aa5b8[_0x37b3('0x20')]]['id']=this[_0x37b3('0xd')][_0xe7dc65]['id'];this[_0x37b3('0xc')][_0x4aa5b8[_0x37b3('0x20')]][_0x37b3('0x22')]=this['faxAccounts'][_0xe7dc65][_0x37b3('0x22')];logger[_0x37b3('0x23')](_0x4aa5b8['uniqueid'],_0x37b3('0x24'));}}}}if(this[_0x37b3('0xf')][_0x4aa5b8[_0x37b3('0x20')]]){this[_0x37b3('0xc')][_0x4aa5b8[_0x37b3('0x20')]]={};this['channels'][_0x4aa5b8[_0x37b3('0x20')]][_0x37b3('0x21')]=_0x4aa5b8[_0x37b3('0x21')];logger['info'](_0x4aa5b8['uniqueid'],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x37b3('0x13')]=function(_0x1b5f72){if(this[_0x37b3('0xc')][_0x1b5f72[_0x37b3('0x20')]]){for(var _0x1c5d5b in _0x1b5f72[_0x37b3('0x25')]){if(_0x1b5f72[_0x37b3('0x25')][_0x37b3('0x26')](_0x1c5d5b)){this[_0x37b3('0xc')][_0x1b5f72[_0x37b3('0x20')]][_0x1c5d5b]=_0x1b5f72[_0x37b3('0x27')];}}}};Fax[_0x37b3('0x28')][_0x37b3('0x15')]=function(_0x115907){if(this['channels'][_0x115907[_0x37b3('0x20')]]){this[_0x37b3('0xc')][_0x115907[_0x37b3('0x20')]][_0x37b3('0x29')]=_0x115907[_0x37b3('0x29')];this['channels'][_0x115907[_0x37b3('0x20')]][_0x37b3('0x2a')]=_0x115907['channelstatedesc'];}};Fax[_0x37b3('0x28')][_0x37b3('0x17')]=function(_0xad124e){if(this[_0x37b3('0xc')][_0xad124e['uniqueid']]){for(var _0x2b6069 in _0xad124e[_0x37b3('0x25')]){if(_0xad124e[_0x37b3('0x25')][_0x37b3('0x26')](_0x2b6069)){this[_0x37b3('0xc')][_0xad124e[_0x37b3('0x20')]][_0x2b6069]=_0xad124e['value'];}}}};Fax[_0x37b3('0x28')][_0x37b3('0x2b')]=function(_0x2d7abf){if(this['channels'][_0x2d7abf['uniqueid']]){this[_0x37b3('0xc')][_0x2d7abf[_0x37b3('0x20')]][_0x37b3('0x2c')]=_0x2d7abf['operation'];this[_0x37b3('0xc')][_0x2d7abf[_0x37b3('0x20')]]['status']=_0x2d7abf[_0x37b3('0x2d')];this[_0x37b3('0xc')][_0x2d7abf[_0x37b3('0x20')]][_0x37b3('0x2e')]=_0x2d7abf['localstationid'];this[_0x37b3('0xc')][_0x2d7abf[_0x37b3('0x20')]][_0x37b3('0x2f')]=_0x2d7abf[_0x37b3('0x2f')];logger[_0x37b3('0x23')](_0x2d7abf[_0x37b3('0x20')],_0x37b3('0x30'));}};Fax[_0x37b3('0x28')][_0x37b3('0x19')]=function(_0x241073){var _0x2d6e0f=this;if(this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]]){var _0x17371b=this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]]['id'];this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]][_0x37b3('0x31')]=_0x241073[_0x37b3('0x31')];this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]][_0x37b3('0x32')]=_0x241073[_0x37b3('0x32')];this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]]['localstationid']=_0x241073['localstationid'];this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]][_0x37b3('0x33')]=_0x241073['resolution'];this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]]['transferrate']=_0x241073[_0x37b3('0x34')];this[_0x37b3('0xc')][_0x241073['uniqueid']][_0x37b3('0x2f')]=_0x241073[_0x37b3('0x2f')];this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]][_0x37b3('0x35')]=_0x241073[_0x37b3('0x35')];if(this[_0x37b3('0xc')][_0x241073[_0x37b3('0x20')]][_0x37b3('0x32')]>0x0){tiff2pdf(_0x241073['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x4c6942){logger[_0x37b3('0x23')](_0x241073[_0x37b3('0x20')],'\x20result\x20conversion\x20file\x20',_0x4c6942[_0x37b3('0x36')]);attachment[_0x37b3('0x37')]({'name':path['parse'](_0x241073[_0x37b3('0x2f')])['name'],'basename':path[_0x37b3('0x38')](_0x241073[_0x37b3('0x2f')])[_0x37b3('0x22')]+_0x37b3('0x39'),'type':_0x37b3('0x3a')})['then'](function(_0x12de45){faxAccount[_0x37b3('0x3b')](_0x17371b,{'from':_0x241073[_0x37b3('0x35')],'mapKey':_0x37b3('0x3c'),'body':path[_0x37b3('0x38')](_0x241073['filename'])[_0x37b3('0x22')]+_0x37b3('0x39'),'AttachmentId':_0x12de45['id']})['catch'](function(_0x458c09){logger[_0x37b3('0x3d')](_0x241073[_0x37b3('0x20')],_0x37b3('0x3e'),JSON[_0x37b3('0x3f')](_0x458c09));});})[_0x37b3('0x40')](function(_0x1cc3b9){logger[_0x37b3('0x3d')](_0x241073['uniqueid'],_0x37b3('0x41'),JSON[_0x37b3('0x3f')](_0x1cc3b9));});});}logger[_0x37b3('0x23')](_0x241073[_0x37b3('0x20')],'\x20receiveFax\x20');}};Fax[_0x37b3('0x28')][_0x37b3('0x1d')]=function(_0x245119){if(this[_0x37b3('0xf')][_0x245119['uniqueid']]){_['merge'](this[_0x37b3('0xc')][_0x245119[_0x37b3('0x20')]],_[_0x37b3('0x42')](_0x245119,['response',_0x37b3('0x43')]));}};function updateStatus(_0x184b45){if(_0x184b45['AttachmentId']){faxMessage['update'](_0x184b45['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x305d3e){ut['logger'](_0x37b3('0x44'),_0x305d3e);})[_0x37b3('0x40')](function(_0x5d7deb){ut[_0x37b3('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x5d7deb);});}else{ut[_0x37b3('0x45')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x37b3('0x28')][_0x37b3('0x46')]=function(_0x4de148,_0x4b35fc,_0xea0548){var _0x2d7c64=this;var _0x1bd5cf={};if(_0x4b35fc){_0x1bd5cf={'read':_0x4b35fc};}else{_0x1bd5cf={'failMessage':_0xea0548};}if(this[_0x37b3('0xf')][_0x4de148][_0x37b3('0x47')]){faxMessage[_0x37b3('0x48')](this[_0x37b3('0xf')][_0x4de148][_0x37b3('0x47')],_0x1bd5cf)[_0x37b3('0x49')](function(_0x44dc1d){ut[_0x37b3('0x45')](_0x37b3('0x4a'),_0x44dc1d);})[_0x37b3('0x40')](function(_0x582550){ut[_0x37b3('0x45')](_0x37b3('0x4b'),_0x582550);})[_0x37b3('0x4c')](function(){delete _0x2d7c64[_0x37b3('0xc')][_0x4de148];delete _0x2d7c64[_0x37b3('0xf')][_0x4de148];});}else{ut[_0x37b3('0x45')](_0x37b3('0x4d'));delete this[_0x37b3('0xc')][_0x4de148];delete this[_0x37b3('0xf')][_0x4de148];}};Fax['prototype']['syncHangup']=function(_0x5c0f19){var _0x3dd6dd=this;if(this['channels'][_0x5c0f19[_0x37b3('0x20')]]){if(this['actions'][_0x5c0f19[_0x37b3('0x20')]]){this['channels'][_0x5c0f19[_0x37b3('0x20')]]['id']=this['actions'][_0x5c0f19[_0x37b3('0x20')]]['id'];this['channels'][_0x5c0f19['uniqueid']][_0x37b3('0x22')]=this[_0x37b3('0xf')][_0x5c0f19['uniqueid']][_0x37b3('0x22')];}logger[_0x37b3('0x23')](_0x5c0f19[_0x37b3('0x20')],this['actions'][_0x5c0f19[_0x37b3('0x20')]]?_0x37b3('0x4e'):_0x37b3('0x4f'),JSON[_0x37b3('0x3f')](this[_0x37b3('0xc')][_0x5c0f19[_0x37b3('0x20')]]));if(this['actions'][_0x5c0f19[_0x37b3('0x20')]]){if(this['channels'][_0x5c0f19['uniqueid']][_0x37b3('0x50')]>0x0&&this[_0x37b3('0xc')][_0x5c0f19['uniqueid']][_0x37b3('0x51')]==='SUCCESS'){this[_0x37b3('0x46')](_0x5c0f19[_0x37b3('0x20')],!![]);}else{this['updateStatus'](_0x5c0f19[_0x37b3('0x20')],![],this[_0x37b3('0xc')][_0x5c0f19[_0x37b3('0x20')]][_0x37b3('0x52')]?_0x37b3('0x53')+this[_0x37b3('0xc')][_0x5c0f19[_0x37b3('0x20')]]['faxstatusstring']:_0x37b3('0x54'));}}}};Fax[_0x37b3('0x28')]['send']=function(_0x2fb846){var _0xe1fe24=this;return new BPromise(function(_0xc32690,_0x27fffe){_0xe1fe24[_0x37b3('0x55')](_0x2fb846,_0xe1fe24[_0x37b3('0xd')][_0x2fb846[_0x37b3('0x56')]])[_0x37b3('0x49')](function(_0x51879b){ut[_0x37b3('0x45')](_0x37b3('0x57'),_0x51879b);_0xc32690(ut['message']('Fax\x20received'));})[_0x37b3('0x40')](function(_0x2bfaf7){ut[_0x37b3('0x45')](_0x37b3('0x58'),_0x2bfaf7);updateStatus(_0x2fb846);_0x27fffe(ut[_0x37b3('0x36')]('Fax\x20failed'));});});};Fax[_0x37b3('0x28')][_0x37b3('0x59')]=function(_0x1873a2){var _0x340803=this;return new BPromise(function(_0x20359f,_0x51005a){var _0x3541fb=_0x340803[_0x37b3('0x5a')](_0x340803[_0x37b3('0xd')][_0x1873a2[_0x37b3('0x56')]][_0x37b3('0x5b')],_0x1873a2);if(_0x3541fb['isValid']){_0x20359f(ut['message']('Trunk\x20Reachable'));}else{_0x51005a(ut['message'](_0x3541fb[_0x37b3('0x36')]));}});};function originate(_0x22ca06,_0x2155f2,_0x51252f){return new BPromise(function(_0x2f56d4,_0x3e35b4){if(_0x51252f){var _0x3488a5=util[_0x37b3('0x5c')](_0x37b3('0x5d'),path[_0x37b3('0x38')](_0x22ca06[_0x37b3('0x4')])[_0x37b3('0x22')],_0x22ca06[_0x37b3('0x4')]);gs[_0x37b3('0x5e')](_0x3488a5)['then'](function(){_0x22ca06[_0x37b3('0x4')]=util[_0x37b3('0x5c')](_0x37b3('0x5f'),path['parse'](_0x22ca06[_0x37b3('0x4')])[_0x37b3('0x60')],path[_0x37b3('0x38')](_0x22ca06[_0x37b3('0x4')])['name']);_0x2155f2[_0x37b3('0x61')]=_0x22ca06[_0x37b3('0x4')];ut[_0x37b3('0x45')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut['variablesAction'](_0x22ca06,_0x2155f2))[_0x37b3('0x49')](function(_0x4f19ea){_0x2f56d4(_0x4f19ea);})['catch'](function(_0x2f8129){_0x3e35b4(_0x2f8129);});})['catch'](function(_0x5c0240){_0x3e35b4(_0x5c0240);});}else{ami[_0x37b3('0x62')](ut['variablesAction'](_0x22ca06,_0x2155f2))[_0x37b3('0x49')](function(_0x197e10){_0x2f56d4(_0x197e10);})[_0x37b3('0x40')](function(_0x4ea954){_0x3e35b4(_0x4ea954);});}});}Fax['prototype'][_0x37b3('0x55')]=function(_0x1bbd8f,_0x3c9d5c){var _0x19c659=this;return new BPromise(function(_0xe9a7e1,_0x5d6122){var _0x28498c=uuid['v4']();var _0x40c309=ut[_0x37b3('0x63')](_0x1bbd8f,_0x3c9d5c);_0x19c659[_0x37b3('0xf')][_0x28498c]=new Action(_0x28498c,_0x3c9d5c,_0x1bbd8f);var _0x49e7d9=_0x19c659[_0x37b3('0xf')][_0x28498c];if(path['parse'](_0x1bbd8f[_0x37b3('0x4')])['ext']===_0x37b3('0x39')){originate(_0x49e7d9,_0x40c309,!![])[_0x37b3('0x49')](function(_0x543ae4){_0xe9a7e1(_0x543ae4);})[_0x37b3('0x40')](function(_0xf0155e){_0x5d6122(_0xf0155e);});}else{originate(_0x49e7d9,_0x40c309,![])['then'](function(_0x44b699){_0xe9a7e1(_0x44b699);})[_0x37b3('0x40')](function(_0x12dc4b){_0x5d6122(_0x12dc4b);});}});};Fax[_0x37b3('0x28')][_0x37b3('0x64')]=function(_0x82bafe){return!_[_0x37b3('0x65')](_0x82bafe)&&!_[_0x37b3('0x65')](_0x82bafe['name'])&&!_[_0x37b3('0x65')](_0x82bafe[_0x37b3('0x66')])&&_0x82bafe[_0x37b3('0x66')]&&!_[_0x37b3('0x65')](this[_0x37b3('0xe')][util[_0x37b3('0x5c')](_0x37b3('0x67'),_0x82bafe[_0x37b3('0x22')])])&&!_[_0x37b3('0x65')](this['trunks'][util[_0x37b3('0x5c')](_0x37b3('0x67'),_0x82bafe['name'])][_0x37b3('0x2d')])&&(this[_0x37b3('0xe')][util[_0x37b3('0x5c')](_0x37b3('0x67'),_0x82bafe[_0x37b3('0x22')])][_0x37b3('0x2d')]===_0x37b3('0x68')||this['trunks'][util[_0x37b3('0x5c')](_0x37b3('0x67'),_0x82bafe['name'])][_0x37b3('0x2d')]===_0x37b3('0x69'));};Fax[_0x37b3('0x28')][_0x37b3('0x5a')]=function(_0x558e74,_0xd52412){if(!this[_0x37b3('0x64')](_0x558e74)){ut[_0x37b3('0x45')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_['isNil'](_0x558e74)?'':_0x558e74['name']+_0x37b3('0x6a'));return{'isValid':![],'message':_0x37b3('0x6b')};}if(_['isNil'](_0xd52412[_0x37b3('0x3c')])){ut[_0x37b3('0x45')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x37b3('0x3f')](_0xd52412));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0xd52412[_0x37b3('0x4')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x37b3('0x3f')](_0xd52412));return{'isValid':![],'message':_0x37b3('0x6c')};}return{'isValid':!![],'message':_0x37b3('0x6d')};};module[_0x37b3('0x6e')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 04e1e60..da176d5 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 _0x399a=['preview','../rpc/faxAccount','error','inspect','notify','resolve','catch','util','bluebird'];(function(_0xec1092,_0xde00ff){var _0x534e33=function(_0x1f31f6){while(--_0x1f31f6){_0xec1092['push'](_0xec1092['shift']());}};_0x534e33(++_0xde00ff);}(_0x399a,0xa9));var _0xa399=function(_0x165cc3,_0x1b2d7d){_0x165cc3=_0x165cc3-0x0;var _0x2d5eea=_0x399a[_0x165cc3];return _0x2d5eea;};'use strict';var util=require(_0xa399('0x0'));var BPromise=require(_0xa399('0x1'));var logger=require('../../../config/logger')(_0xa399('0x2'));var _=require('lodash');var faxAccount=require(_0xa399('0x3'));function loggerCatch(_0x238cb2){return function(_0x3c6adf){logger[_0xa399('0x4')](_0x238cb2,util[_0xa399('0x5')](_0x3c6adf,{'showHidden':![],'depth':null}));};}exports[_0xa399('0x6')]=function(_0x36f164,_0x2e3a33){return BPromise[_0xa399('0x7')]()['then'](faxAccount[_0xa399('0x6')](_0x36f164,_0x2e3a33))[_0xa399('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x660a=['error','notify','resolve','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x660a,0x124));var _0xa660=function(_0xe9e6cf,_0x395f6d){_0xe9e6cf=_0xe9e6cf-0x0;var _0x2b8851=_0x660a[_0xe9e6cf];return _0x2b8851;};'use strict';var util=require(_0xa660('0x0'));var BPromise=require(_0xa660('0x1'));var logger=require(_0xa660('0x2'))(_0xa660('0x3'));var _=require(_0xa660('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x27f0b5){return function(_0x1bf143){logger[_0xa660('0x5')](_0x27f0b5,util['inspect'](_0x1bf143,{'showHidden':![],'depth':null}));};}exports[_0xa660('0x6')]=function(_0x2b811d,_0x54e135){return BPromise[_0xa660('0x7')]()['then'](faxAccount[_0xa660('0x6')](_0x2b811d,_0x54e135))['catch'](loggerCatch(_0xa660('0x8')));}; \ 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 5ce875b..c6369f6 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 _0xd81d=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x36837c,_0xb785a1){var _0x314cca=function(_0x47564c){while(--_0x47564c){_0x36837c['push'](_0x36837c['shift']());}};_0x314cca(++_0xb785a1);}(_0xd81d,0xf0));var _0xdd81=function(_0x4750b8,_0xd4b867){_0x4750b8=_0x4750b8-0x0;var _0x4cc810=_0xd81d[_0x4750b8];return _0x4cc810;};'use strict';var util=require(_0xdd81('0x0'));var logger=require(_0xdd81('0x1'))(_0xdd81('0x2'));var BPromise=require(_0xdd81('0x3'));var exec=require(_0xdd81('0x4'))[_0xdd81('0x5')];exports[_0xdd81('0x6')]=function(_0x8da13a){return new BPromise(function(_0x4a2736,_0x2e5766){exec(_0x8da13a,function(_0x37c5c9,_0x4d84c9,_0xa141e1){logger[_0xdd81('0x7')]('Exec\x20gs',_0x4d84c9);if(_0x37c5c9){logger[_0xdd81('0x7')](_0xdd81('0x8'),_0xdd81('0x9'),util[_0xdd81('0xa')](_0x37c5c9,{'showHidden':![],'depth':null}),_0x4d84c9,_0xa141e1);_0x2e5766(_0x37c5c9);}_0x4a2736(_0x4d84c9);});});}; \ No newline at end of file +var _0xd5d5=['Exec\x20gs','inspect','fax','bluebird','child_process','exec','execute','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd5d5,0xea));var _0x5d5d=function(_0x39782f,_0x4aa931){_0x39782f=_0x39782f-0x0;var _0x47768c=_0xd5d5[_0x39782f];return _0x47768c;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x5d5d('0x0'));var BPromise=require(_0x5d5d('0x1'));var exec=require(_0x5d5d('0x2'))[_0x5d5d('0x3')];exports[_0x5d5d('0x4')]=function(_0x1d718c){return new BPromise(function(_0x45d51c,_0x595d7b){exec(_0x1d718c,function(_0x139d78,_0x3f3f08,_0x57169a){logger[_0x5d5d('0x5')]('Exec\x20gs',_0x3f3f08);if(_0x139d78){logger[_0x5d5d('0x5')](_0x5d5d('0x6'),'\x20Error\x20:',util[_0x5d5d('0x7')](_0x139d78,{'showHidden':![],'depth':null}),_0x3f3f08,_0x57169a);_0x595d7b(_0x139d78);}_0x45d51c(_0x3f3f08);});});}; \ 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 f5bae51..c1d626b 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 _0x9ade=['lodash','fax','logger','info','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util'];(function(_0x26222d,_0x1d2de1){var _0x16bf9f=function(_0x43892a){while(--_0x43892a){_0x26222d['push'](_0x26222d['shift']());}};_0x16bf9f(++_0x1d2de1);}(_0x9ade,0x107));var _0xe9ad=function(_0xeb7891,_0x4771f7){_0xeb7891=_0xeb7891-0x0;var _0x11cc19=_0x9ade[_0xeb7891];return _0x11cc19;};'use strict';var util=require(_0xe9ad('0x0'));var _=require(_0xe9ad('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xe9ad('0x2'));exports['message']=function(_0xeb076b){return{'message':_0xeb076b};};exports[_0xe9ad('0x3')]=function(_0x4d4ee0,_0x52984f){logger[_0xe9ad('0x4')](_0x4d4ee0,util[_0xe9ad('0x5')](_0x52984f,{'showHidden':![],'depth':null}));};exports[_0xe9ad('0x6')]=function(_0x3e4092,_0x308564){var _0x6ede7f={'XMF-ECM':_0x308564[_0xe9ad('0x7')],'XMF-HEADERINFO':_0x308564[_0xe9ad('0x8')],'XMF-MINRATE':_0x308564['minrate'],'XMF-MAXRATE':_0x308564[_0xe9ad('0x9')],'XMF-MODEM':util[_0xe9ad('0xa')](_0xe9ad('0xb'),_0x308564[_0xe9ad('0xc')]),'XMF-GATEWAY':_0x308564[_0xe9ad('0xd')],'XMF-FAXDETECT':_0x308564[_0xe9ad('0xe')],'XMF-T38TIMEOUT':_0x308564[_0xe9ad('0xf')],'XMF-LOCALSTATIONID':_0x308564[_0xe9ad('0x10')],'XMF-PATH':_0x3e4092[_0xe9ad('0x11')]};return _0x6ede7f;};exports[_0xe9ad('0x12')]=function(_0x1aec2b,_0x1f7bc){return{'actionid':_0x1aec2b['uniqueid'],'action':_0xe9ad('0x13'),'channel':_0x1aec2b[_0xe9ad('0x14')],'Exten':_0xe9ad('0x15'),'Context':_0xe9ad('0x16'),'Priority':'1','callerid':util['format'](_0xe9ad('0x17'),_0x1aec2b[_0xe9ad('0x8')]?_0x1aec2b[_0xe9ad('0x8')]:'',_0x1aec2b[_0xe9ad('0x10')]),'variable':_0x1f7bc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1aec2b['uniqueid']};}; \ No newline at end of file +var _0x07c2=['moment','fax','message','logger','inspect','addVariables','ecm','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','originate','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','uniqueid','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x07c2,0xf1));var _0x207c=function(_0x51f99e,_0x70684d){_0x51f99e=_0x51f99e-0x0;var _0x5b12cd=_0x07c2[_0x51f99e];return _0x5b12cd;};'use strict';var util=require(_0x207c('0x0'));var _=require('lodash');var moment=require(_0x207c('0x1'));var logger=require('../../../../config/logger')(_0x207c('0x2'));exports[_0x207c('0x3')]=function(_0xfd76c1){return{'message':_0xfd76c1};};exports[_0x207c('0x4')]=function(_0x15df8d,_0x475331){logger['info'](_0x15df8d,util[_0x207c('0x5')](_0x475331,{'showHidden':![],'depth':null}));};exports[_0x207c('0x6')]=function(_0x40db91,_0x397d0f){var _0x538561={'XMF-ECM':_0x397d0f[_0x207c('0x7')],'XMF-HEADERINFO':_0x397d0f['headerinfo'],'XMF-MINRATE':_0x397d0f['minrate'],'XMF-MAXRATE':_0x397d0f[_0x207c('0x8')],'XMF-MODEM':util[_0x207c('0x9')](_0x207c('0xa'),_0x397d0f[_0x207c('0xb')]),'XMF-GATEWAY':_0x397d0f['gateway'],'XMF-FAXDETECT':_0x397d0f[_0x207c('0xc')],'XMF-T38TIMEOUT':_0x397d0f[_0x207c('0xd')],'XMF-LOCALSTATIONID':_0x397d0f[_0x207c('0xe')],'XMF-PATH':_0x40db91[_0x207c('0xf')]};return _0x538561;};exports[_0x207c('0x10')]=function(_0x28be07,_0x3ba361){return{'actionid':_0x28be07['uniqueid'],'action':_0x207c('0x11'),'channel':_0x28be07['channel'],'Exten':_0x207c('0x12'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x207c('0x13'),_0x28be07[_0x207c('0x14')]?_0x28be07['headerinfo']:'',_0x28be07[_0x207c('0xe')]),'variable':_0x3ba361,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x28be07[_0x207c('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 0092d45..56f0cbc 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 _0xfffc=['./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','resolve','then','getAgents','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','sync','[index.js][main]','moment','./server','./realtime','./report','./acw','./preview'];(function(_0x3326c3,_0x14382c){var _0x14eb8a=function(_0x2f2cb3){while(--_0x2f2cb3){_0x3326c3['push'](_0x3326c3['shift']());}};_0x14eb8a(++_0x14382c);}(_0xfffc,0x84));var _0xcfff=function(_0x4ade92,_0x4d333f){_0x4ade92=_0x4ade92-0x0;var _0x58eff3=_0xfffc[_0x4ade92];return _0x58eff3;};'use strict';var util=require('util');var moment=require(_0xcfff('0x0'));var server=require(_0xcfff('0x1'));var Realtime=require(_0xcfff('0x2'));var Report=require(_0xcfff('0x3'));var Acw=require(_0xcfff('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0xcfff('0x5'));var Fax=require(_0xcfff('0x6'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xcfff('0x7'));var voiceCallReport=require(_0xcfff('0x8'));var trunk=require('./rpc/trunk');var trigger=require(_0xcfff('0x9'));var template=require(_0xcfff('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xcfff('0xb'));var zendesk=require(_0xcfff('0xc'));var salesforce=require(_0xcfff('0xd'));var sugarcrm=require(_0xcfff('0xe'));var freshdesk=require(_0xcfff('0xf'));var desk=require(_0xcfff('0x10'));var zoho=require(_0xcfff('0x11'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xcfff('0x12'));var servicenow=require(_0xcfff('0x13'));var dynamics365=require(_0xcfff('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xcfff('0x15'))(_0xcfff('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xcfff('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xcfff('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xcfff('0x18')]()[_0xcfff('0x19')](user[_0xcfff('0x1a')]())[_0xcfff('0x19')](realtime[_0xcfff('0x1b')]())[_0xcfff('0x19')](user['getTelephones']())[_0xcfff('0x19')](realtime['initTelephones']())[_0xcfff('0x19')](trunk[_0xcfff('0x1c')]())[_0xcfff('0x19')](realtime[_0xcfff('0x1d')]())[_0xcfff('0x19')](voiceQueue[_0xcfff('0x1e')]())[_0xcfff('0x19')](realtime[_0xcfff('0x1f')]())[_0xcfff('0x19')](trigger[_0xcfff('0x20')]())[_0xcfff('0x19')](realtime[_0xcfff('0x21')]())[_0xcfff('0x19')](template['getTemplates']())[_0xcfff('0x19')](realtime[_0xcfff('0x22')]())['then'](zendesk[_0xcfff('0x23')]())[_0xcfff('0x19')](realtime[_0xcfff('0x24')]())[_0xcfff('0x19')](salesforce[_0xcfff('0x25')]())[_0xcfff('0x19')](realtime[_0xcfff('0x26')]())[_0xcfff('0x19')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xcfff('0x27')]())['then'](freshdesk[_0xcfff('0x28')]())[_0xcfff('0x19')](realtime[_0xcfff('0x29')]())[_0xcfff('0x19')](desk[_0xcfff('0x2a')]())[_0xcfff('0x19')](realtime[_0xcfff('0x2b')]())[_0xcfff('0x19')](zoho[_0xcfff('0x2c')]())[_0xcfff('0x19')](realtime[_0xcfff('0x2d')]())['then'](vtiger['getVtigerAccounts']())[_0xcfff('0x19')](realtime[_0xcfff('0x2e')]())[_0xcfff('0x19')](freshsales[_0xcfff('0x2f')]())[_0xcfff('0x19')](realtime['initFreshsalesAccounts']())[_0xcfff('0x19')](servicenow[_0xcfff('0x30')]())[_0xcfff('0x19')](realtime[_0xcfff('0x31')]())[_0xcfff('0x19')](dynamics365[_0xcfff('0x32')]())[_0xcfff('0x19')](realtime[_0xcfff('0x33')]())[_0xcfff('0x19')](campaign[_0xcfff('0x34')]())[_0xcfff('0x19')](realtime[_0xcfff('0x35')]())[_0xcfff('0x19')](voiceExtension[_0xcfff('0x36')]())[_0xcfff('0x19')](realtime[_0xcfff('0x37')]())[_0xcfff('0x19')](faxAccount['getFaxAccounts']())['then'](realtime[_0xcfff('0x38')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xcfff('0x18')]()['then'](voiceQueueReport[_0xcfff('0x39')]())[_0xcfff('0x19')](realtime[_0xcfff('0x3a')]())[_0xcfff('0x19')](cmHopperHistory[_0xcfff('0x3b')]())['then'](realtime[_0xcfff('0x3c')]())['then'](cmHopperHistory[_0xcfff('0x3d')]())[_0xcfff('0x19')](realtime[_0xcfff('0x3e')]())[_0xcfff('0x19')](voiceCallReport['getVoiceCallReports']())[_0xcfff('0x19')](realtime[_0xcfff('0x3f')]())[_0xcfff('0x40')](function(_0x7c18e1){logger[_0xcfff('0x41')]('[index.js][initParams]',util[_0xcfff('0x42')](_0x7c18e1,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xcfff('0x19')](function(){return initRealtime();})[_0xcfff('0x19')](function(){return initParams();})[_0xcfff('0x19')](function(){report[_0xcfff('0x43')]();setInterval(initRealtime,0x1388);})[_0xcfff('0x40')](function(_0x22a82b){logger[_0xcfff('0x41')](_0xcfff('0x44'),util[_0xcfff('0x42')](_0x22a82b,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x504f=['[index.js][main]','inspect','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','get','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','listen','error'];(function(_0xf9afbd,_0x5b6760){var _0x47f3ad=function(_0x29a958){while(--_0x29a958){_0xf9afbd['push'](_0xf9afbd['shift']());}};_0x47f3ad(++_0x5b6760);}(_0x504f,0x1be));var _0xf504=function(_0x57babc,_0x4f29a7){_0x57babc=_0x57babc-0x0;var _0x71c58b=_0x504f[_0x57babc];return _0x71c58b;};'use strict';var util=require(_0xf504('0x0'));var moment=require(_0xf504('0x1'));var server=require('./server');var Realtime=require(_0xf504('0x2'));var Report=require(_0xf504('0x3'));var Acw=require(_0xf504('0x4'));var Trigger=require(_0xf504('0x5'));var Dialer=require(_0xf504('0x6'));var Preview=require(_0xf504('0x7'));var Fax=require(_0xf504('0x8'));var user=require(_0xf504('0x9'));var voiceQueue=require(_0xf504('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xf504('0xb'));var trunk=require(_0xf504('0xc'));var trigger=require(_0xf504('0xd'));var template=require(_0xf504('0xe'));var cmHopperHistory=require(_0xf504('0xf'));var campaign=require(_0xf504('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xf504('0x11'));var zendesk=require(_0xf504('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xf504('0x13'));var freshdesk=require(_0xf504('0x14'));var desk=require(_0xf504('0x15'));var zoho=require(_0xf504('0x16'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xf504('0x17'));var dynamics365=require(_0xf504('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xf504('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xf504('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf504('0x1b')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xf504('0x1c')]()['then'](user[_0xf504('0x1d')]())[_0xf504('0x1e')](realtime[_0xf504('0x1f')]())[_0xf504('0x1e')](user[_0xf504('0x20')]())['then'](realtime[_0xf504('0x21')]())[_0xf504('0x1e')](trunk[_0xf504('0x22')]())['then'](realtime[_0xf504('0x23')]())[_0xf504('0x1e')](voiceQueue[_0xf504('0x24')]())[_0xf504('0x1e')](realtime[_0xf504('0x25')]())[_0xf504('0x1e')](trigger[_0xf504('0x26')]())[_0xf504('0x1e')](realtime[_0xf504('0x27')]())[_0xf504('0x1e')](template[_0xf504('0x28')]())['then'](realtime[_0xf504('0x29')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0xf504('0x2a')]())[_0xf504('0x1e')](salesforce['getSalesforceAccounts']())[_0xf504('0x1e')](realtime[_0xf504('0x2b')]())[_0xf504('0x1e')](sugarcrm[_0xf504('0x2c')]())[_0xf504('0x1e')](realtime[_0xf504('0x2d')]())[_0xf504('0x1e')](freshdesk['getFreshdeskAccounts']())[_0xf504('0x1e')](realtime[_0xf504('0x2e')]())[_0xf504('0x1e')](desk[_0xf504('0x2f')]())['then'](realtime[_0xf504('0x30')]())[_0xf504('0x1e')](zoho['getZohoAccounts']())[_0xf504('0x1e')](realtime[_0xf504('0x31')]())[_0xf504('0x1e')](vtiger[_0xf504('0x32')]())['then'](realtime[_0xf504('0x33')]())['then'](freshsales[_0xf504('0x34')]())[_0xf504('0x1e')](realtime[_0xf504('0x35')]())[_0xf504('0x1e')](servicenow[_0xf504('0x36')]())[_0xf504('0x1e')](realtime[_0xf504('0x37')]())[_0xf504('0x1e')](dynamics365[_0xf504('0x38')]())[_0xf504('0x1e')](realtime[_0xf504('0x39')]())[_0xf504('0x1e')](campaign['getCampaigns']())['then'](realtime[_0xf504('0x3a')]())[_0xf504('0x1e')](voiceExtension[_0xf504('0x3b')]())[_0xf504('0x1e')](realtime[_0xf504('0x3c')]())['then'](faxAccount[_0xf504('0x3d')]())[_0xf504('0x1e')](realtime[_0xf504('0x3e')]())[_0xf504('0x1e')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0xf504('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0xf504('0x1e')](realtime['initVoiceQueueReports']())[_0xf504('0x1e')](cmHopperHistory[_0xf504('0x3f')]())['then'](realtime[_0xf504('0x40')]())[_0xf504('0x1e')](cmHopperHistory[_0xf504('0x41')]())['then'](realtime[_0xf504('0x42')]())[_0xf504('0x1e')](voiceCallReport['getVoiceCallReports']())[_0xf504('0x1e')](realtime[_0xf504('0x43')]())[_0xf504('0x44')](function(_0x236283){logger['error'](_0xf504('0x45'),util['inspect'](_0x236283,{'showHidden':![],'depth':null}));});}function main(){return server[_0xf504('0x46')](realtime,preview,fax)[_0xf504('0x1e')](function(){return initRealtime();})[_0xf504('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xf504('0x44')](function(_0x29c146){logger[_0xf504('0x47')](_0xf504('0x48'),util[_0xf504('0x49')](_0x29c146,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3961245..6bab2ac 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 _0x39fd=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','mobile','interface','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','voiceStatusTime','toNumber','format','status','online','user:%s','user:save','user:presence','exports','lodash','util','moment'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x39fd,0x1d6));var _0xd39f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x39fd[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd39f('0x0'));var util=require(_0xd39f('0x1'));var moment=require(_0xd39f('0x2'));var md5=require('md5');var Redis=require(_0xd39f('0x3'));var config=require(_0xd39f('0x4'));config[_0xd39f('0x5')]=_[_0xd39f('0x6')](config[_0xd39f('0x5')],{'host':_0xd39f('0x7'),'port':0x18eb});var io=require(_0xd39f('0x8'))(new Redis(config[_0xd39f('0x5')]));function Agent(_0x7252de){this['id']=_0x7252de['id']||0x0;this['name']=_0x7252de[_0xd39f('0x9')]||'';this['email']=_0x7252de[_0xd39f('0xa')]||'';this[_0xd39f('0xb')]=_0x7252de[_0xd39f('0xb')]||'';this['fullname']=_0x7252de[_0xd39f('0xc')]||'';this[_0xd39f('0xd')]=_0xd39f('0xe');this[_0xd39f('0xf')]=0x0;this['status']='unknown';this[_0xd39f('0x10')]='';this[_0xd39f('0x11')]='';this[_0xd39f('0x12')]='';this[_0xd39f('0x13')]='';this['online']=_0x7252de['online']||![];this[_0xd39f('0x14')]=_0xd39f('0xe');this['voiceStatusTime']=0x0;this[_0xd39f('0x15')]='';this[_0xd39f('0x16')]='';this[_0xd39f('0x17')]=![];this[_0xd39f('0x18')]=![];this[_0xd39f('0x19')]='';}Agent[_0xd39f('0x1a')][_0xd39f('0x1b')]=function(_0x480232){var _0x2ce4ae;if(_0x480232&&_0x480232[_0xd39f('0xd')]){_0x2ce4ae=_0x480232['state'][_0xd39f('0x1c')]();switch(_0x2ce4ae){case _0xd39f('0x1d'):_0x2ce4ae=_0xd39f('0x1e');break;case _0xd39f('0x1f'):_0x2ce4ae=_0xd39f('0x20');break;}}if(_0x2ce4ae&&this['voiceStatus']!==_0x2ce4ae||_0x480232[_0xd39f('0x21')]){this[_0xd39f('0x22')]=_[_0xd39f('0x23')](moment()[_0xd39f('0x24')]('x'));}if(_0x2ce4ae){this[_0xd39f('0x14')]=_0x2ce4ae;}var _0x4bee20={'id':this['id'],'name':this[_0xd39f('0x9')],'email':this[_0xd39f('0xa')],'accountcode':this[_0xd39f('0xb')],'fullname':this[_0xd39f('0xc')],'state':this[_0xd39f('0xd')],'stateTime':this[_0xd39f('0xf')],'status':this[_0xd39f('0x25')],'address':this[_0xd39f('0x10')],'online':this[_0xd39f('0x26')],'voiceStatus':this[_0xd39f('0x14')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xd39f('0x15')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xd39f('0x13')],'onhold':this[_0xd39f('0x17')]};var _0x5db858=md5(JSON['stringify'](_0x4bee20));if(this[_0xd39f('0x19')]!==_0x5db858){this[_0xd39f('0x19')]=_0x5db858;io['to'](util[_0xd39f('0x24')](_0xd39f('0x27'),_0x4bee20[_0xd39f('0x9')]))['emit'](_0xd39f('0x28'),_0x4bee20);io['emit'](_0xd39f('0x29'),_0x4bee20);}};module[_0xd39f('0x2a')]=Agent; \ No newline at end of file +var _0x4912=['emit','user:save','user:presence','exports','util','moment','md5','ioredis','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','status','interface','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','stateTime','online','onhold','stringify'];(function(_0x15bce1,_0x24588b){var _0x189fca=function(_0x4f2525){while(--_0x4f2525){_0x15bce1['push'](_0x15bce1['shift']());}};_0x189fca(++_0x24588b);}(_0x4912,0x1c0));var _0x2491=function(_0x3a630a,_0xba3ded){_0x3a630a=_0x3a630a-0x0;var _0x341063=_0x4912[_0x3a630a];return _0x341063;};'use strict';var _=require('lodash');var util=require(_0x2491('0x0'));var moment=require(_0x2491('0x1'));var md5=require(_0x2491('0x2'));var Redis=require(_0x2491('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x2491('0x4')](config[_0x2491('0x5')],{'host':_0x2491('0x6'),'port':0x18eb});var io=require(_0x2491('0x7'))(new Redis(config[_0x2491('0x5')]));function Agent(_0x1594e8){this['id']=_0x1594e8['id']||0x0;this[_0x2491('0x8')]=_0x1594e8[_0x2491('0x8')]||'';this['email']=_0x1594e8[_0x2491('0x9')]||'';this[_0x2491('0xa')]=_0x1594e8[_0x2491('0xa')]||'';this[_0x2491('0xb')]=_0x1594e8[_0x2491('0xb')]||'';this['state']=_0x2491('0xc');this['stateTime']=0x0;this[_0x2491('0xd')]=_0x2491('0xc');this['address']='';this['phone']='';this['mobile']='';this[_0x2491('0xe')]='';this['online']=_0x1594e8['online']||![];this[_0x2491('0xf')]=_0x2491('0xc');this[_0x2491('0x10')]=0x0;this[_0x2491('0x11')]='';this[_0x2491('0x12')]='';this['onhold']=![];this['local']=![];this[_0x2491('0x2')]='';}Agent['prototype'][_0x2491('0x13')]=function(_0x10b7bc){var _0x56b815;if(_0x10b7bc&&_0x10b7bc[_0x2491('0x14')]){_0x56b815=_0x10b7bc[_0x2491('0x14')][_0x2491('0x15')]();switch(_0x56b815){case _0x2491('0x16'):_0x56b815=_0x2491('0x17');break;case _0x2491('0x18'):_0x56b815=_0x2491('0x19');break;}}if(_0x56b815&&this['voiceStatus']!==_0x56b815||_0x10b7bc[_0x2491('0x1a')]){this[_0x2491('0x10')]=_[_0x2491('0x1b')](moment()[_0x2491('0x1c')]('x'));}if(_0x56b815){this[_0x2491('0xf')]=_0x56b815;}var _0x2472ee={'id':this['id'],'name':this[_0x2491('0x8')],'email':this[_0x2491('0x9')],'accountcode':this[_0x2491('0xa')],'fullname':this[_0x2491('0xb')],'state':this[_0x2491('0x14')],'stateTime':this[_0x2491('0x1d')],'status':this[_0x2491('0xd')],'address':this['address'],'online':this[_0x2491('0x1e')],'voiceStatus':this[_0x2491('0xf')],'voiceStatusTime':this[_0x2491('0x10')],'voiceStatusCallerIdNumber':this[_0x2491('0x11')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x2491('0xe')],'onhold':this[_0x2491('0x1f')]};var _0x34f6e6=md5(JSON[_0x2491('0x20')](_0x2472ee));if(this[_0x2491('0x2')]!==_0x34f6e6){this['md5']=_0x34f6e6;io['to'](util[_0x2491('0x1c')]('user:%s',_0x2472ee[_0x2491('0x8')]))[_0x2491('0x21')](_0x2491('0x22'),_0x2472ee);io[_0x2491('0x21')](_0x2491('0x23'),_0x2472ee);}};module[_0x2491('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index fefd91d..e4bdfea 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 _0xe132=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x5d76cc,_0x195736){var _0x4acce4=function(_0x3b889d){while(--_0x3b889d){_0x5d76cc['push'](_0x5d76cc['shift']());}};_0x4acce4(++_0x195736);}(_0xe132,0x173));var _0x2e13=function(_0x253a87,_0x35c6d9){_0x253a87=_0x253a87-0x0;var _0x42d5f4=_0xe132[_0x253a87];return _0x42d5f4;};'use strict';function Campaign(_0xaec839){this['id']=_0xaec839['id']||0x0;this[_0x2e13('0x0')]=_0xaec839[_0x2e13('0x0')]||'';this['type']=_0xaec839[_0x2e13('0x1')]||_0x2e13('0x2');this['originated']=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x2e13('0x3')]=0x0;this[_0x2e13('0x4')]='';this[_0x2e13('0x5')]=!![];this['active']=_0xaec839[_0x2e13('0x6')];this[_0x2e13('0x7')]=_0xaec839['limitCalls'];this[_0x2e13('0x8')]=_0xaec839[_0x2e13('0x8')]||null;this['dialGlobalInterval']=_0xaec839[_0x2e13('0x9')]?_0xaec839['dialGlobalInterval']:null;this[_0x2e13('0xa')]=_0xaec839[_0x2e13('0xa')];this[_0x2e13('0xb')]=_0xaec839[_0x2e13('0xb')];this[_0x2e13('0xc')]=_0xaec839[_0x2e13('0xc')]||0x1e;this[_0x2e13('0xd')]=_0xaec839[_0x2e13('0xd')];this[_0x2e13('0xe')]=_0xaec839[_0x2e13('0xe')];this[_0x2e13('0xf')]=_0xaec839[_0x2e13('0xf')];this[_0x2e13('0x10')]=_0xaec839[_0x2e13('0x10')];this[_0x2e13('0x11')]=_0xaec839[_0x2e13('0x11')];this['dialNoAnswerRetryFrequency']=_0xaec839[_0x2e13('0x12')];this[_0x2e13('0x13')]=_0xaec839[_0x2e13('0x13')];this[_0x2e13('0x14')]=_0xaec839['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0xaec839[_0x2e13('0x15')]||0x96;this[_0x2e13('0x16')]=_0xaec839[_0x2e13('0x16')]||0x3;this[_0x2e13('0x17')]=_0xaec839['dialDropRetryFrequency']||0x96;this[_0x2e13('0x18')]=_0xaec839[_0x2e13('0x18')]||0x3;this[_0x2e13('0x19')]=_0xaec839[_0x2e13('0x19')]||0x96;this[_0x2e13('0x1a')]=_0xaec839['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0xaec839[_0x2e13('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0xaec839['dialAgentRejectMaxRetry']||0x3;this[_0x2e13('0x1c')]=_0xaec839[_0x2e13('0x1c')]||0x96;this[_0x2e13('0x1d')]=_0xaec839[_0x2e13('0x1d')]||_0x2e13('0x1e');this[_0x2e13('0x1f')]=_0xaec839[_0x2e13('0x1f')]||undefined;this[_0x2e13('0x20')]=_0xaec839[_0x2e13('0x20')]||undefined;this[_0x2e13('0x21')]=_0xaec839[_0x2e13('0x21')]||undefined;this['TrunkBackup']=_0xaec839[_0x2e13('0x22')]?_0xaec839[_0x2e13('0x22')]:undefined;this['Trunk']=_0xaec839[_0x2e13('0x23')]?_0xaec839['Trunk']:undefined;this['Interval']=_0xaec839[_0x2e13('0x24')]?_0xaec839['Interval']:undefined;this[_0x2e13('0x25')]=_0xaec839[_0x2e13('0x25')]?_0xaec839[_0x2e13('0x25')]:undefined;this[_0x2e13('0x26')]=_0xaec839[_0x2e13('0x25')]?_0xaec839[_0x2e13('0x25')][_0x2e13('0x0')]:undefined;this[_0x2e13('0x27')]=_0xaec839[_0x2e13('0x27')]||![];this['dialAMDInitialSilence']=_0xaec839[_0x2e13('0x28')];this[_0x2e13('0x29')]=_0xaec839['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0xaec839[_0x2e13('0x2a')];this['dialAMDTotalAnalysisTime']=_0xaec839['dialAMDTotalAnalysisTime'];this[_0x2e13('0x2b')]=_0xaec839['dialAMDMinWordLength'];this[_0x2e13('0x2c')]=_0xaec839[_0x2e13('0x2c')];this['dialAMDMaximumNumberOfWords']=_0xaec839[_0x2e13('0x2d')];this[_0x2e13('0x2e')]=_0xaec839[_0x2e13('0x2e')];this[_0x2e13('0x2f')]=_0xaec839[_0x2e13('0x2f')];}module[_0x2e13('0x30')]=Campaign; \ No newline at end of file +var _0xa2d6=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x55e92e,_0x29df69){var _0x276969=function(_0x28791e){while(--_0x28791e){_0x55e92e['push'](_0x55e92e['shift']());}};_0x276969(++_0x29df69);}(_0xa2d6,0x124));var _0x6a2d=function(_0x125425,_0x4b6bab){_0x125425=_0x125425-0x0;var _0xd04dc4=_0xa2d6[_0x125425];return _0xd04dc4;};'use strict';function Campaign(_0x797e18){this['id']=_0x797e18['id']||0x0;this[_0x6a2d('0x0')]=_0x797e18[_0x6a2d('0x0')]||'';this['type']=_0x797e18[_0x6a2d('0x1')]||_0x6a2d('0x2');this[_0x6a2d('0x3')]=0x0;this[_0x6a2d('0x4')]=0x0;this[_0x6a2d('0x5')]=0x0;this[_0x6a2d('0x6')]=0x0;this[_0x6a2d('0x7')]='';this[_0x6a2d('0x8')]=!![];this[_0x6a2d('0x9')]=_0x797e18[_0x6a2d('0x9')];this['limitCalls']=_0x797e18[_0x6a2d('0xa')];this[_0x6a2d('0xb')]=_0x797e18['dialTimezone']||null;this[_0x6a2d('0xc')]=_0x797e18[_0x6a2d('0xc')]?_0x797e18[_0x6a2d('0xc')]:null;this['dialOriginateCallerIdName']=_0x797e18['dialOriginateCallerIdName'];this[_0x6a2d('0xd')]=_0x797e18['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x797e18[_0x6a2d('0xe')]||0x1e;this[_0x6a2d('0xf')]=_0x797e18['dialCongestionMaxRetry'];this[_0x6a2d('0x10')]=_0x797e18[_0x6a2d('0x10')];this[_0x6a2d('0x11')]=_0x797e18[_0x6a2d('0x11')];this[_0x6a2d('0x12')]=_0x797e18['dialBusyRetryFrequency'];this[_0x6a2d('0x13')]=_0x797e18[_0x6a2d('0x13')];this[_0x6a2d('0x14')]=_0x797e18[_0x6a2d('0x14')];this[_0x6a2d('0x15')]=_0x797e18[_0x6a2d('0x15')];this[_0x6a2d('0x16')]=_0x797e18[_0x6a2d('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x797e18[_0x6a2d('0x17')]||0x96;this[_0x6a2d('0x18')]=_0x797e18[_0x6a2d('0x18')]||0x3;this['dialDropRetryFrequency']=_0x797e18[_0x6a2d('0x19')]||0x96;this[_0x6a2d('0x1a')]=_0x797e18[_0x6a2d('0x1a')]||0x3;this['dialAbandonedRetryFrequency']=_0x797e18[_0x6a2d('0x1b')]||0x96;this[_0x6a2d('0x1c')]=_0x797e18['dialMachineMaxRetry']||0x3;this[_0x6a2d('0x1d')]=_0x797e18[_0x6a2d('0x1d')]||0x96;this[_0x6a2d('0x1e')]=_0x797e18[_0x6a2d('0x1e')]||0x3;this[_0x6a2d('0x1f')]=_0x797e18[_0x6a2d('0x1f')]||0x96;this[_0x6a2d('0x20')]=_0x797e18['dialOrderByScheduledAt']||_0x6a2d('0x21');this[_0x6a2d('0x22')]=_0x797e18[_0x6a2d('0x22')]||undefined;this[_0x6a2d('0x23')]=_0x797e18['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x6a2d('0x24')]=_0x797e18[_0x6a2d('0x24')]||undefined;this[_0x6a2d('0x25')]=_0x797e18[_0x6a2d('0x25')]?_0x797e18[_0x6a2d('0x25')]:undefined;this[_0x6a2d('0x26')]=_0x797e18['Trunk']?_0x797e18[_0x6a2d('0x26')]:undefined;this[_0x6a2d('0x27')]=_0x797e18[_0x6a2d('0x27')]?_0x797e18[_0x6a2d('0x27')]:undefined;this[_0x6a2d('0x28')]=_0x797e18['SquareProject']?_0x797e18[_0x6a2d('0x28')]:undefined;this[_0x6a2d('0x29')]=_0x797e18[_0x6a2d('0x28')]?_0x797e18[_0x6a2d('0x28')][_0x6a2d('0x0')]:undefined;this[_0x6a2d('0x2a')]=_0x797e18[_0x6a2d('0x2a')]||![];this['dialAMDInitialSilence']=_0x797e18[_0x6a2d('0x2b')];this[_0x6a2d('0x2c')]=_0x797e18[_0x6a2d('0x2c')];this['dialAMDAfterGreetingSilence']=_0x797e18[_0x6a2d('0x2d')];this[_0x6a2d('0x2e')]=_0x797e18[_0x6a2d('0x2e')];this[_0x6a2d('0x2f')]=_0x797e18[_0x6a2d('0x2f')];this[_0x6a2d('0x30')]=_0x797e18[_0x6a2d('0x30')];this[_0x6a2d('0x31')]=_0x797e18['dialAMDMaximumNumberOfWords'];this[_0x6a2d('0x32')]=_0x797e18[_0x6a2d('0x32')];this[_0x6a2d('0x33')]=_0x797e18['dialAMDMaximumWordLength'];}module[_0x6a2d('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 3354ac2..2058f71 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 _0xed03=['duration','billableseconds','holdtime','type','tag','monitor','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridnum','connectedlinename','context','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata'];(function(_0x339230,_0x1b4205){var _0x641284=function(_0x4a9349){while(--_0x4a9349){_0x339230['push'](_0x339230['shift']());}};_0x641284(++_0x1b4205);}(_0xed03,0xdc));var _0x3ed0=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xed03[_0x21549c];return _0x426cbd;};'use strict';function Channel(){this[_0x3ed0('0x0')]=null;this[_0x3ed0('0x1')]='';this['destinationchannel']='';this[_0x3ed0('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x3ed0('0x3')]=undefined;this['accountcode']=0x0;this[_0x3ed0('0x4')]='';this['uniqueid']=0x0;this[_0x3ed0('0x5')]=0x0;this[_0x3ed0('0x6')]=0x0;this[_0x3ed0('0x7')]=![];this[_0x3ed0('0x8')]=null;this[_0x3ed0('0x9')]=null;this[_0x3ed0('0xa')]=![];this[_0x3ed0('0xb')]=![];this[_0x3ed0('0xc')]='';this[_0x3ed0('0xd')]='';this[_0x3ed0('0xe')]=0x0;this[_0x3ed0('0xf')]=0x0;this[_0x3ed0('0x10')]=0x0;this[_0x3ed0('0x11')]=null;this[_0x3ed0('0x12')]=null;this['disposition']=null;this[_0x3ed0('0x13')]=![];this['monitorFilename']=null;this[_0x3ed0('0x14')]=null;this[_0x3ed0('0x15')]=[];this[_0x3ed0('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x3ed0('0x17')]=undefined;this[_0x3ed0('0x18')]=0x0;}module[_0x3ed0('0x19')]=Channel; \ No newline at end of file +var _0x8ff9=['disposition','monitor','monitorFilename','monitors','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','type','tag'];(function(_0x4ea8a1,_0x3ac827){var _0x29ed69=function(_0x8d79ab){while(--_0x8d79ab){_0x4ea8a1['push'](_0x4ea8a1['shift']());}};_0x29ed69(++_0x3ac827);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x3a3143,_0x5e832f){_0x3a3143=_0x3a3143-0x0;var _0x50a900=_0x8ff9[_0x3a3143];return _0x50a900;};'use strict';function Channel(){this[_0x98ff('0x0')]=null;this[_0x98ff('0x1')]='';this[_0x98ff('0x2')]='';this[_0x98ff('0x3')]=0x0;this[_0x98ff('0x4')]='';this[_0x98ff('0x5')]=undefined;this[_0x98ff('0x6')]=undefined;this[_0x98ff('0x7')]=0x0;this[_0x98ff('0x8')]='';this[_0x98ff('0x9')]=0x0;this[_0x98ff('0xa')]=0x0;this['exten']=0x0;this[_0x98ff('0xb')]=![];this[_0x98ff('0xc')]=null;this[_0x98ff('0xd')]=null;this[_0x98ff('0xe')]=![];this[_0x98ff('0xf')]=![];this[_0x98ff('0x10')]='';this['lastdata']='';this[_0x98ff('0x11')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x98ff('0x12')]=null;this[_0x98ff('0x13')]=null;this[_0x98ff('0x14')]=null;this[_0x98ff('0x15')]=![];this[_0x98ff('0x16')]=null;this['queue']=null;this[_0x98ff('0x17')]=[];this['transfercalleridnum']=undefined;this[_0x98ff('0x18')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x98ff('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 0f8b8b3..420d809 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 _0xc511=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x2b5d95,_0x546f4a){var _0x40cb15=function(_0x35174f){while(--_0x35174f){_0x2b5d95['push'](_0x2b5d95['shift']());}};_0x40cb15(++_0x546f4a);}(_0xc511,0x8a));var _0x1c51=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0xc511[_0x543242];return _0x4c99b6;};'use strict';function DeskAccount(_0x25c18a){this['id']=_0x25c18a['id']||0x0;this['name']=_0x25c18a[_0x1c51('0x0')]||'';this['username']=_0x25c18a[_0x1c51('0x1')]||'';this[_0x1c51('0x2')]=_0x25c18a[_0x1c51('0x2')]||'';this[_0x1c51('0x3')]=_0x25c18a[_0x1c51('0x3')]||'';this[_0x1c51('0x4')]=_0x25c18a[_0x1c51('0x4')]||'';this['consumerKey']=_0x25c18a[_0x1c51('0x5')]||'';this[_0x1c51('0x6')]=_0x25c18a['consumerSecret']||'';this[_0x1c51('0x7')]=_0x25c18a[_0x1c51('0x7')]||'';this[_0x1c51('0x8')]=_0x25c18a[_0x1c51('0x8')]||'';this[_0x1c51('0x9')]=_0x25c18a[_0x1c51('0x9')]||'';this[_0x1c51('0xa')]=_0x25c18a[_0x1c51('0xa')]||'';this[_0x1c51('0xb')]=_0x25c18a[_0x1c51('0xb')]||{};}module[_0x1c51('0xc')]=DeskAccount; \ No newline at end of file +var _0x2f5a=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','token','tokenSecret','type'];(function(_0x1cfd38,_0x15a1b0){var _0x5dd1fc=function(_0x6bf1){while(--_0x6bf1){_0x1cfd38['push'](_0x1cfd38['shift']());}};_0x5dd1fc(++_0x15a1b0);}(_0x2f5a,0x12f));var _0xa2f5=function(_0x28ff30,_0x342f9c){_0x28ff30=_0x28ff30-0x0;var _0x453c8b=_0x2f5a[_0x28ff30];return _0x453c8b;};'use strict';function DeskAccount(_0x6e3e9d){this['id']=_0x6e3e9d['id']||0x0;this[_0xa2f5('0x0')]=_0x6e3e9d[_0xa2f5('0x0')]||'';this[_0xa2f5('0x1')]=_0x6e3e9d[_0xa2f5('0x1')]||'';this['remoteUri']=_0x6e3e9d[_0xa2f5('0x2')]||'';this[_0xa2f5('0x3')]=_0x6e3e9d[_0xa2f5('0x3')]||'';this[_0xa2f5('0x4')]=_0x6e3e9d['password']||'';this[_0xa2f5('0x5')]=_0x6e3e9d['consumerKey']||'';this['consumerSecret']=_0x6e3e9d['consumerSecret']||'';this[_0xa2f5('0x6')]=_0x6e3e9d[_0xa2f5('0x6')]||'';this[_0xa2f5('0x7')]=_0x6e3e9d['tokenSecret']||'';this[_0xa2f5('0x8')]=_0x6e3e9d[_0xa2f5('0x8')]||'';this[_0xa2f5('0x9')]=_0x6e3e9d[_0xa2f5('0x9')]||'';this[_0xa2f5('0xa')]=_0x6e3e9d['Configurations']||{};}module[_0xa2f5('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 0e1442b..56f7732 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 _0x5974=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri','tenantId'];(function(_0x35e62c,_0x56dc75){var _0xf8754f=function(_0x37c6c2){while(--_0x37c6c2){_0x35e62c['push'](_0x35e62c['shift']());}};_0xf8754f(++_0x56dc75);}(_0x5974,0x1be));var _0x4597=function(_0xd3c939,_0x356e38){_0xd3c939=_0xd3c939-0x0;var _0x2cb033=_0x5974[_0xd3c939];return _0x2cb033;};'use strict';function Dynamics365Account(_0x5680ba){this['id']=_0x5680ba['id']||0x0;this[_0x4597('0x0')]=_0x5680ba['name']||'';this[_0x4597('0x1')]=_0x5680ba['username']||'';this[_0x4597('0x2')]=_0x5680ba[_0x4597('0x2')]||'';this['remoteUri']=_0x5680ba[_0x4597('0x3')]||'';this[_0x4597('0x4')]=_0x5680ba[_0x4597('0x4')]||'';this[_0x4597('0x5')]=_0x5680ba[_0x4597('0x5')]||'';this[_0x4597('0x6')]=_0x5680ba[_0x4597('0x6')]||{};this[_0x4597('0x7')]=_0x5680ba[_0x4597('0x7')]||'';this[_0x4597('0x8')]=_0x5680ba[_0x4597('0x8')]||![];this[_0x4597('0x9')]=_0x5680ba[_0x4597('0x9')]||{};this[_0x4597('0xa')]=_0x5680ba['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x729b=['CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x3634d8,_0xbfa70b){var _0x2c1369=function(_0x27b79a){while(--_0x27b79a){_0x3634d8['push'](_0x3634d8['shift']());}};_0x2c1369(++_0xbfa70b);}(_0x729b,0x1d6));var _0xb729=function(_0x155c70,_0x8cae07){_0x155c70=_0x155c70-0x0;var _0x479bf2=_0x729b[_0x155c70];return _0x479bf2;};'use strict';function Dynamics365Account(_0x164177){this['id']=_0x164177['id']||0x0;this['name']=_0x164177[_0xb729('0x0')]||'';this['username']=_0x164177[_0xb729('0x1')]||'';this[_0xb729('0x2')]=_0x164177[_0xb729('0x2')]||'';this[_0xb729('0x3')]=_0x164177['remoteUri']||'';this['tenantId']=_0x164177[_0xb729('0x4')]||'';this[_0xb729('0x5')]=_0x164177[_0xb729('0x5')]||'';this['clientSecret']=_0x164177[_0xb729('0x6')]||{};this[_0xb729('0x7')]=_0x164177[_0xb729('0x7')]||'';this[_0xb729('0x8')]=_0x164177[_0xb729('0x8')]||![];this[_0xb729('0x9')]=_0x164177[_0xb729('0x9')]||{};this[_0xb729('0xa')]=_0x164177['CloudProvider']||{};}module[_0xb729('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index d2bfed6..d74611f 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 _0x2ec5=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','description','ecm','headerinfo','minrate','maxrate'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x2ec5,0x6b));var _0x52ec=function(_0x263ac9,_0x18aa58){_0x263ac9=_0x263ac9-0x0;var _0x1cc2af=_0x2ec5[_0x263ac9];return _0x1cc2af;};'use strict';function FaxAccount(_0x268a4e){this['id']=_0x268a4e['id']||0x0;this['name']=_0x268a4e['name']||'';this[_0x52ec('0x0')]=_0x268a4e[_0x52ec('0x0')];this[_0x52ec('0x1')]=_0x268a4e[_0x52ec('0x1')];this[_0x52ec('0x2')]=_0x268a4e[_0x52ec('0x2')];this['localstationid']=_0x268a4e['localstationid'];this[_0x52ec('0x3')]=_0x268a4e[_0x52ec('0x3')]||0x960;this[_0x52ec('0x4')]=_0x268a4e['maxrate']||0x3840;this[_0x52ec('0x5')]=_0x268a4e[_0x52ec('0x5')]||_0x52ec('0x6');this[_0x52ec('0x7')]=_0x268a4e[_0x52ec('0x7')]||'no';this[_0x52ec('0x8')]=_0x268a4e[_0x52ec('0x8')]||'no';this[_0x52ec('0x9')]=_0x268a4e[_0x52ec('0x9')]||0x1388;this[_0x52ec('0xa')]=_0x268a4e['tech']||'SIP';this[_0x52ec('0xb')]=_0x268a4e[_0x52ec('0xb')]?_0x268a4e[_0x52ec('0xb')]:undefined;this[_0x52ec('0xc')]=_0x268a4e[_0x52ec('0xc')];this[_0x52ec('0xd')]=_0x268a4e[_0x52ec('0xd')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x1df2=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','key'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x1df2,0x1d1));var _0x21df=function(_0x197be8,_0x45411c){_0x197be8=_0x197be8-0x0;var _0x4d5115=_0x1df2[_0x197be8];return _0x4d5115;};'use strict';function FaxAccount(_0x342792){this['id']=_0x342792['id']||0x0;this[_0x21df('0x0')]=_0x342792[_0x21df('0x0')]||'';this[_0x21df('0x1')]=_0x342792[_0x21df('0x1')];this[_0x21df('0x2')]=_0x342792[_0x21df('0x2')];this[_0x21df('0x3')]=_0x342792[_0x21df('0x3')];this['localstationid']=_0x342792[_0x21df('0x4')];this[_0x21df('0x5')]=_0x342792[_0x21df('0x5')]||0x960;this[_0x21df('0x6')]=_0x342792[_0x21df('0x6')]||0x3840;this['modem']=_0x342792['modem']||_0x21df('0x7');this['gateway']=_0x342792[_0x21df('0x8')]||'no';this[_0x21df('0x9')]=_0x342792['faxdetect']||'no';this[_0x21df('0xa')]=_0x342792['t38timeout']||0x1388;this[_0x21df('0xb')]=_0x342792[_0x21df('0xb')]||_0x21df('0xc');this['Trunk']=_0x342792[_0x21df('0xd')]?_0x342792[_0x21df('0xd')]:undefined;this['ListId']=_0x342792['ListId'];this[_0x21df('0xe')]=_0x342792['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 095f14c..856fa11 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 _0xe7c4=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x35a4a1,_0xcce320){var _0x1a5746=function(_0x39bd1c){while(--_0x39bd1c){_0x35a4a1['push'](_0x35a4a1['shift']());}};_0x1a5746(++_0xcce320);}(_0xe7c4,0x100));var _0x4e7c=function(_0xeb1b4b,_0x6507e1){_0xeb1b4b=_0xeb1b4b-0x0;var _0x285ff=_0xe7c4[_0xeb1b4b];return _0x285ff;};'use strict';function FreshdeskAccount(_0x28b0b5){this['id']=_0x28b0b5['id']||0x0;this[_0x4e7c('0x0')]=_0x28b0b5[_0x4e7c('0x0')]||'';this[_0x4e7c('0x1')]=_0x28b0b5[_0x4e7c('0x1')]||'';this['apiKey']=_0x28b0b5['token']||'';this[_0x4e7c('0x2')]=_0x28b0b5[_0x4e7c('0x2')]||'';this[_0x4e7c('0x3')]=_0x28b0b5[_0x4e7c('0x3')]||'';this[_0x4e7c('0x4')]=_0x28b0b5[_0x4e7c('0x4')]||{};}module[_0x4e7c('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xee55=['token','remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x19f4ee,_0x208b6a){var _0x2cc923=function(_0x515950){while(--_0x515950){_0x19f4ee['push'](_0x19f4ee['shift']());}};_0x2cc923(++_0x208b6a);}(_0xee55,0x154));var _0x5ee5=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0xee55[_0x1399d6];return _0x4a9db4;};'use strict';function FreshdeskAccount(_0x3dadbc){this['id']=_0x3dadbc['id']||0x0;this[_0x5ee5('0x0')]=_0x3dadbc[_0x5ee5('0x0')]||'';this[_0x5ee5('0x1')]=_0x3dadbc[_0x5ee5('0x1')]||'';this[_0x5ee5('0x2')]=_0x3dadbc[_0x5ee5('0x3')]||'';this[_0x5ee5('0x4')]=_0x3dadbc[_0x5ee5('0x4')]||'';this[_0x5ee5('0x5')]=_0x3dadbc[_0x5ee5('0x5')]||'';this[_0x5ee5('0x6')]=_0x3dadbc[_0x5ee5('0x6')]||{};}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 76703f6..e532cf2 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 _0x7923=['remoteUri','Configurations','exports','name','username','apiKey','token'];(function(_0x4f549f,_0x195899){var _0x4f3740=function(_0x3adbfc){while(--_0x3adbfc){_0x4f549f['push'](_0x4f549f['shift']());}};_0x4f3740(++_0x195899);}(_0x7923,0x8f));var _0x3792=function(_0x5f7814,_0x44e884){_0x5f7814=_0x5f7814-0x0;var _0x5e3fef=_0x7923[_0x5f7814];return _0x5e3fef;};'use strict';function FreshsalesAccount(_0x1980d4){this['id']=_0x1980d4['id']||0x0;this[_0x3792('0x0')]=_0x1980d4[_0x3792('0x0')]||'';this[_0x3792('0x1')]=_0x1980d4[_0x3792('0x1')]||'';this[_0x3792('0x2')]=_0x1980d4[_0x3792('0x3')]||'';this['remoteUri']=_0x1980d4[_0x3792('0x4')]||'';this['serverUrl']=_0x1980d4['serverUrl']||'';this[_0x3792('0x5')]=_0x1980d4['Configurations']||{};}module[_0x3792('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xbf4e=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf4e,0x172));var _0xebf4=function(_0x571066,_0x55c6b0){_0x571066=_0x571066-0x0;var _0x388f47=_0xbf4e[_0x571066];return _0x388f47;};'use strict';function FreshsalesAccount(_0x4047f){this['id']=_0x4047f['id']||0x0;this[_0xebf4('0x0')]=_0x4047f[_0xebf4('0x0')]||'';this[_0xebf4('0x1')]=_0x4047f[_0xebf4('0x1')]||'';this[_0xebf4('0x2')]=_0x4047f['token']||'';this[_0xebf4('0x3')]=_0x4047f['remoteUri']||'';this['serverUrl']=_0x4047f[_0xebf4('0x4')]||'';this[_0xebf4('0x5')]=_0x4047f['Configurations']||{};}module[_0xebf4('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 83ba90e..1921283 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 _0x3456=['priority','holdtime','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode'];(function(_0x45c7c1,_0x272c94){var _0xdba959=function(_0x54184a){while(--_0x54184a){_0x45c7c1['push'](_0x45c7c1['shift']());}};_0xdba959(++_0x272c94);}(_0x3456,0x151));var _0x6345=function(_0x85d5a8,_0x1977be){_0x85d5a8=_0x85d5a8-0x0;var _0x20479b=_0x3456[_0x85d5a8];return _0x20479b;};'use strict';function QueueReport(){this[_0x6345('0x0')]=_0x6345('0x1');this[_0x6345('0x2')]='';this[_0x6345('0x3')]='';this[_0x6345('0x4')]='';this[_0x6345('0x5')]='';this['queuecallerjoinAt']=null;this[_0x6345('0x6')]=null;this['position']=0x1;this['count']=0x1;this[_0x6345('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x6345('0x8')]=![];this[_0x6345('0x9')]=null;this[_0x6345('0xa')]=![];this[_0x6345('0xb')]=null;this['originalposition']=0x1;this['channel']='';this[_0x6345('0xc')]='';this[_0x6345('0xd')]='';this[_0x6345('0xe')]='';this['context']='';this['exten']='';this[_0x6345('0xf')]='';this[_0x6345('0x10')]=0x0;this['assigned']=![];this[_0x6345('0x11')]='';this['motionChannel']=_0x6345('0x12');this['routealias']=null;this[_0x6345('0x13')]=0x0;this[_0x6345('0x14')]={};}module[_0x6345('0x15')]=QueueReport; \ No newline at end of file +var _0x7ece=['context','priority','holdtime','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename'];(function(_0x4bab92,_0x497266){var _0x5ebe8b=function(_0x229d91){while(--_0x229d91){_0x4bab92['push'](_0x4bab92['shift']());}};_0x5ebe8b(++_0x497266);}(_0x7ece,0xc9));var _0xe7ec=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7ece[_0xfae23b];return _0x200640;};'use strict';function QueueReport(){this['type']=_0xe7ec('0x0');this[_0xe7ec('0x1')]='';this['calleridnum']='';this[_0xe7ec('0x2')]='';this[_0xe7ec('0x3')]='';this[_0xe7ec('0x4')]=null;this[_0xe7ec('0x5')]=null;this[_0xe7ec('0x6')]=0x1;this[_0xe7ec('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xe7ec('0x8')]=![];this['queuecallercompleteAt']=null;this[_0xe7ec('0x9')]=![];this[_0xe7ec('0xa')]=null;this[_0xe7ec('0xb')]=0x1;this[_0xe7ec('0xc')]='';this[_0xe7ec('0xd')]='';this[_0xe7ec('0xe')]='';this['accountcode']='';this[_0xe7ec('0xf')]='';this['exten']='';this[_0xe7ec('0x10')]='';this[_0xe7ec('0x11')]=0x0;this['assigned']=![];this[_0xe7ec('0x12')]='';this[_0xe7ec('0x13')]='voice';this[_0xe7ec('0x14')]=null;this[_0xe7ec('0x15')]=0x0;this[_0xe7ec('0x16')]={};}module[_0xe7ec('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index aa3fc08..bcd40c3 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 _0x4a56=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x5d22f1,_0x2428c8){var _0x4819e2=function(_0x4109ec){while(--_0x4109ec){_0x5d22f1['push'](_0x5d22f1['shift']());}};_0x4819e2(++_0x2428c8);}(_0x4a56,0x17c));var _0x64a5=function(_0x900f48,_0x2ef7d8){_0x900f48=_0x900f48-0x0;var _0x50f00b=_0x4a56[_0x900f48];return _0x50f00b;};'use strict';function SalesforceAccount(_0x508e82){this['id']=_0x508e82['id']||0x0;this[_0x64a5('0x0')]=_0x508e82['name']||'';this[_0x64a5('0x1')]=_0x508e82[_0x64a5('0x1')]||'';this[_0x64a5('0x2')]=_0x508e82[_0x64a5('0x2')]||'';this['password']=_0x508e82[_0x64a5('0x3')]||'';this[_0x64a5('0x4')]=_0x508e82[_0x64a5('0x4')]||'';this[_0x64a5('0x5')]=_0x508e82['clientSecret']||'';this[_0x64a5('0x6')]=_0x508e82['securityToken']||'';this[_0x64a5('0x7')]=_0x508e82[_0x64a5('0x7')]||_0x64a5('0x8');this['serverUrl']=_0x508e82[_0x64a5('0x9')]||'';this[_0x64a5('0xa')]=_0x508e82[_0x64a5('0xa')]||{};}module[_0x64a5('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x4a08=['serverUrl','Configurations','exports','name','username','password','clientId','clientSecret','type','integrationTab'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0x4a08,0x11b));var _0x84a0=function(_0x49197e,_0xb3373f){_0x49197e=_0x49197e-0x0;var _0x4e883e=_0x4a08[_0x49197e];return _0x4e883e;};'use strict';function SalesforceAccount(_0x17cc12){this['id']=_0x17cc12['id']||0x0;this['name']=_0x17cc12[_0x84a0('0x0')]||'';this[_0x84a0('0x1')]=_0x17cc12[_0x84a0('0x1')]||'';this['remoteUri']=_0x17cc12['remoteUri']||'';this[_0x84a0('0x2')]=_0x17cc12[_0x84a0('0x2')]||'';this['clientId']=_0x17cc12[_0x84a0('0x3')]||'';this['clientSecret']=_0x17cc12[_0x84a0('0x4')]||'';this['securityToken']=_0x17cc12['securityToken']||'';this[_0x84a0('0x5')]=_0x17cc12['type']||_0x84a0('0x6');this[_0x84a0('0x7')]=_0x17cc12[_0x84a0('0x7')]||'';this[_0x84a0('0x8')]=_0x17cc12[_0x84a0('0x8')]||{};}module[_0x84a0('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 2d49537..5aeb300 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 _0x6dde=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x41b313,_0x216343){var _0x145ab9=function(_0x3a3ca1){while(--_0x3a3ca1){_0x41b313['push'](_0x41b313['shift']());}};_0x145ab9(++_0x216343);}(_0x6dde,0x161));var _0xe6dd=function(_0x1c5b1e,_0x49c839){_0x1c5b1e=_0x1c5b1e-0x0;var _0x4835e0=_0x6dde[_0x1c5b1e];return _0x4835e0;};'use strict';function ServicenowAccount(_0x596c86){this['id']=_0x596c86['id']||0x0;this[_0xe6dd('0x0')]=_0x596c86['name']||'';this[_0xe6dd('0x1')]=_0x596c86[_0xe6dd('0x1')]||'';this[_0xe6dd('0x2')]=_0x596c86[_0xe6dd('0x2')]||'';this[_0xe6dd('0x3')]=_0x596c86[_0xe6dd('0x3')]||'';this[_0xe6dd('0x4')]=_0x596c86[_0xe6dd('0x4')]||'';this[_0xe6dd('0x5')]=_0x596c86['Configurations']||{};}module[_0xe6dd('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x141b=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x582db3,_0x4a7a22){var _0x4f920f=function(_0x40b4e6){while(--_0x40b4e6){_0x582db3['push'](_0x582db3['shift']());}};_0x4f920f(++_0x4a7a22);}(_0x141b,0x138));var _0xb141=function(_0x24d46f,_0x2f7b71){_0x24d46f=_0x24d46f-0x0;var _0x2713e8=_0x141b[_0x24d46f];return _0x2713e8;};'use strict';function ServicenowAccount(_0x297534){this['id']=_0x297534['id']||0x0;this[_0xb141('0x0')]=_0x297534[_0xb141('0x0')]||'';this[_0xb141('0x1')]=_0x297534[_0xb141('0x1')]||'';this[_0xb141('0x2')]=_0x297534[_0xb141('0x2')]||'';this[_0xb141('0x3')]=_0x297534[_0xb141('0x3')]||'';this[_0xb141('0x4')]=_0x297534[_0xb141('0x4')]||'';this[_0xb141('0x5')]=_0x297534[_0xb141('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 5d8853c..dc4489f 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 _0xeee1=['remoteUri','serverUrl','name','password'];(function(_0x2a5e68,_0x17aa40){var _0x59e90c=function(_0x476ef2){while(--_0x476ef2){_0x2a5e68['push'](_0x2a5e68['shift']());}};_0x59e90c(++_0x17aa40);}(_0xeee1,0x19e));var _0x1eee=function(_0x947d15,_0x5c4988){_0x947d15=_0x947d15-0x0;var _0x4c3a67=_0xeee1[_0x947d15];return _0x4c3a67;};'use strict';function SugarcrmAccount(_0x5dc707){this['id']=_0x5dc707['id']||0x0;this['name']=_0x5dc707[_0x1eee('0x0')]||'';this['username']=_0x5dc707['username']||'';this['password']=_0x5dc707[_0x1eee('0x1')]||'';this[_0x1eee('0x2')]=_0x5dc707[_0x1eee('0x2')]||'';this[_0x1eee('0x3')]=_0x5dc707['serverUrl']||'';this['Configurations']=_0x5dc707['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x440a=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x440a,0xfb));var _0xa440=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x440a[_0x17d9e3];return _0x14192d;};'use strict';function SugarcrmAccount(_0x37bb5b){this['id']=_0x37bb5b['id']||0x0;this['name']=_0x37bb5b[_0xa440('0x0')]||'';this[_0xa440('0x1')]=_0x37bb5b[_0xa440('0x1')]||'';this['password']=_0x37bb5b[_0xa440('0x2')]||'';this[_0xa440('0x3')]=_0x37bb5b[_0xa440('0x3')]||'';this[_0xa440('0x4')]=_0x37bb5b['serverUrl']||'';this[_0xa440('0x5')]=_0x37bb5b[_0xa440('0x5')]||{};}module[_0xa440('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 f0b2866..9f9fecb 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 _0x8533=['stateTime','unknown','exports','name','accountcode','state'];(function(_0x275896,_0x518a08){var _0x11b763=function(_0x39fa05){while(--_0x39fa05){_0x275896['push'](_0x275896['shift']());}};_0x11b763(++_0x518a08);}(_0x8533,0x141));var _0x3853=function(_0x34ba71,_0xa71b46){_0x34ba71=_0x34ba71-0x0;var _0x5d6948=_0x8533[_0x34ba71];return _0x5d6948;};'use strict';function Telephone(_0x4b8f88){this['id']=_0x4b8f88['id']||0x0;this[_0x3853('0x0')]=_0x4b8f88[_0x3853('0x0')]||'';this['accountcode']=_0x4b8f88[_0x3853('0x1')]||'';this[_0x3853('0x2')]='unknown';this[_0x3853('0x3')]=0x0;this['status']=_0x3853('0x4');this['address']='';}module[_0x3853('0x5')]=Telephone; \ No newline at end of file +var _0xe3af=['accountcode','state','unknown','stateTime','status','address','exports','name'];(function(_0x23e51d,_0x1b848b){var _0x5291a3=function(_0x49241e){while(--_0x49241e){_0x23e51d['push'](_0x23e51d['shift']());}};_0x5291a3(++_0x1b848b);}(_0xe3af,0x18f));var _0xfe3a=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0xe3af[_0x4347ec];return _0x4c8314;};'use strict';function Telephone(_0x3ee29d){this['id']=_0x3ee29d['id']||0x0;this[_0xfe3a('0x0')]=_0x3ee29d[_0xfe3a('0x0')]||'';this[_0xfe3a('0x1')]=_0x3ee29d['accountcode']||'';this[_0xfe3a('0x2')]=_0xfe3a('0x3');this[_0xfe3a('0x4')]=0x0;this[_0xfe3a('0x5')]=_0xfe3a('0x3');this[_0xfe3a('0x6')]='';}module[_0xfe3a('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 55998f0..c221e24 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(_0x863e15,_0x3ba42e){var _0x1a7666=function(_0x4e7025){while(--_0x4e7025){_0x863e15['push'](_0x863e15['shift']());}};_0x1a7666(++_0x3ba42e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 _0xa9e0=['exports','name'];(function(_0x408247,_0x3310fb){var _0x5abfa7=function(_0x2e6a29){while(--_0x2e6a29){_0x408247['push'](_0x408247['shift']());}};_0x5abfa7(++_0x3310fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 59e273b..3c67dc6 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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x416b43,_0x277b8e){var _0xa2ec71=function(_0x156a7f){while(--_0x156a7f){_0x416b43['push'](_0x416b43['shift']());}};_0xa2ec71(++_0x277b8e);}(_0x2032,0xd9));var _0x2203=function(_0x4041e1,_0x112532){_0x4041e1=_0x4041e1-0x0;var _0x1c9357=_0x2032[_0x4041e1];return _0x1c9357;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x4a69be,_0x12b879){var _0x35b8d6=function(_0x4b3018){while(--_0x4b3018){_0x4a69be['push'](_0x4a69be['shift']());}};_0x35b8d6(++_0x12b879);}(_0x757a,0xde));var _0xa757=function(_0x2829a8,_0xaa10b9){_0x2829a8=_0x2829a8-0x0;var _0x1d05ff=_0x757a[_0x2829a8];return _0x1d05ff;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 8e5d385..4d318b1 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 _0x2542=['split','host','port','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf'];(function(_0x534da7,_0xb73f79){var _0x373dab=function(_0x42fa6b){while(--_0x42fa6b){_0x534da7['push'](_0x534da7['shift']());}};_0x373dab(++_0xb73f79);}(_0x2542,0x81));var _0x2254=function(_0x5ec4b5,_0x83767d){_0x5ec4b5=_0x5ec4b5-0x0;var _0x1d32ad=_0x2542[_0x5ec4b5];return _0x1d32ad;};'use strict';function Trunk(_0x265733){this['id']=_0x265733['id']||0x0;this[_0x2254('0x0')]=_0x265733[_0x2254('0x0')]||![];this[_0x2254('0x1')]=_0x265733[_0x2254('0x1')]||'';this['state']=_0x2254('0x2');this[_0x2254('0x3')]=0x0;this[_0x2254('0x4')]=_0x2254('0x2');this['registry']=_0x265733[_0x2254('0x5')]&&_0x265733['registry'][_0x2254('0x6')](':')?_0x265733[_0x2254('0x5')][_0x2254('0x7')](':')[0x0]:'';this[_0x2254('0x8')]='';this[_0x2254('0x9')]='';this[_0x2254('0xa')]='';this[_0x2254('0xb')]='';this['refresh']='';this[_0x2254('0xc')]='unknown';this[_0x2254('0xd')]='';this[_0x2254('0xe')]='';this[_0x2254('0xf')]=_0x265733[_0x2254('0xf')]||'';}module[_0x2254('0x10')]=Trunk; \ No newline at end of file +var _0x0af3=['refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','split','port','domain','domainport'];(function(_0x541090,_0x982a26){var _0x21d833=function(_0x5a29fb){while(--_0x5a29fb){_0x541090['push'](_0x541090['shift']());}};_0x21d833(++_0x982a26);}(_0x0af3,0xa5));var _0x30af=function(_0x20f0bf,_0x30bc2a){_0x20f0bf=_0x20f0bf-0x0;var _0x3a54e8=_0x0af3[_0x20f0bf];return _0x3a54e8;};'use strict';function Trunk(_0x1f136c){this['id']=_0x1f136c['id']||0x0;this['active']=_0x1f136c[_0x30af('0x0')]||![];this[_0x30af('0x1')]=_0x1f136c[_0x30af('0x1')]||'';this[_0x30af('0x2')]=_0x30af('0x3');this['stateTime']=0x0;this[_0x30af('0x4')]=_0x30af('0x3');this['registry']=_0x1f136c[_0x30af('0x5')]&&_0x1f136c[_0x30af('0x5')][_0x30af('0x6')](':')?_0x1f136c['registry'][_0x30af('0x7')](':')[0x0]:'';this['host']='';this[_0x30af('0x8')]='';this[_0x30af('0x9')]='';this[_0x30af('0xa')]='';this[_0x30af('0xb')]='';this[_0x30af('0xc')]=_0x30af('0x3');this['registrationtime']='';this[_0x30af('0xd')]='';this[_0x30af('0xe')]=_0x1f136c[_0x30af('0xe')]||'';}module[_0x30af('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 462914d..42411a4 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 _0x555b=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x555b,0x106));var _0xb555=function(_0x4123e4,_0x4e2013){_0x4123e4=_0x4123e4-0x0;var _0x59c4ea=_0x555b[_0x4123e4];return _0x59c4ea;};'use strict';function voiceExtension(_0x3f2637){this['id']=_0x3f2637['id']||0x0;this['exten']=_0x3f2637[_0xb555('0x0')]||'';this[_0xb555('0x1')]=_0x3f2637[_0xb555('0x1')]||'none';this['mandatoryDisposition']=_0x3f2637[_0xb555('0x2')]||![];}module[_0xb555('0x3')]=voiceExtension; \ No newline at end of file +var _0x939e=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x4ca81c,_0x55f2a0){var _0x5a902c=function(_0x5d7862){while(--_0x5d7862){_0x4ca81c['push'](_0x4ca81c['shift']());}};_0x5a902c(++_0x55f2a0);}(_0x939e,0xfb));var _0xe939=function(_0x59a1d9,_0x181115){_0x59a1d9=_0x59a1d9-0x0;var _0x577f9c=_0x939e[_0x59a1d9];return _0x577f9c;};'use strict';function voiceExtension(_0x41a74b){this['id']=_0x41a74b['id']||0x0;this[_0xe939('0x0')]=_0x41a74b[_0xe939('0x0')]||'';this[_0xe939('0x1')]=_0x41a74b[_0xe939('0x1')]||_0xe939('0x2');this['mandatoryDisposition']=_0x41a74b[_0xe939('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 413fd91..c9559ac 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 _0x29fb=['erlangCallToSecond','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','rrordered','wrandom','name','monitor_format','type','inbound','waiting','sumDuration','sumHoldTime','available','loggedIn','notInUse','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','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','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls'];(function(_0x355eef,_0x351eca){var _0x309900=function(_0x58b7d4){while(--_0x58b7d4){_0x355eef['push'](_0x355eef['shift']());}};_0x309900(++_0x351eca);}(_0x29fb,0x1ee));var _0xb29f=function(_0x1675a5,_0x580068){_0x1675a5=_0x1675a5-0x0;var _0xde996a=_0x29fb[_0x1675a5];return _0xde996a;};'use strict';var monitorFormat={'wav':_0xb29f('0x0'),'wav49':_0xb29f('0x1'),'gsm':_0xb29f('0x2')};var strategy={'fewestcalls':_0xb29f('0x3'),'leastrecent':_0xb29f('0x4'),'linear':_0xb29f('0x5'),'random':_0xb29f('0x6'),'ringall':_0xb29f('0x7'),'rr':'roundrobin','rrmemory':'rrmemory','rrordered':_0xb29f('0x8'),'wrandom':_0xb29f('0x9')};function VoiceQueue(_0x4db46e){this['id']=_0x4db46e['id']||0x0;this[_0xb29f('0xa')]=_0x4db46e[_0xb29f('0xa')]||'';this[_0xb29f('0xb')]=_0x4db46e[_0xb29f('0xb')]||'';this[_0xb29f('0xc')]=_0x4db46e[_0xb29f('0xc')]||_0xb29f('0xd');this[_0xb29f('0xe')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0xb29f('0xf')]=0x0;this[_0xb29f('0x10')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xb29f('0x11')]=0x0;this['busy']=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0xb29f('0x12')]=0x0;this[_0xb29f('0x13')]=0x0;this['onHold']=0x0;this[_0xb29f('0x14')]=0x0;this[_0xb29f('0x15')]=0x0;this[_0xb29f('0x16')]=0x0;this['talking']=0x0;this[_0xb29f('0x17')]=0x0;this[_0xb29f('0x18')]=0x0;this[_0xb29f('0x19')]=_0x4db46e[_0xb29f('0x19')]||![];this[_0xb29f('0x1a')]=_0x4db46e[_0xb29f('0x1a')]||0xa;this[_0xb29f('0x1b')]=_0x4db46e[_0xb29f('0x1b')]||'no';this[_0xb29f('0x1c')]=!![];this[_0xb29f('0x1d')]='';this['statusMessage']='';this[_0xb29f('0x1e')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x4db46e[_0xb29f('0x1f')]||null;this[_0xb29f('0x20')]=_0x4db46e[_0xb29f('0x20')]?_0x4db46e[_0xb29f('0x20')]:null;this[_0xb29f('0x21')]=_0x4db46e[_0xb29f('0x21')];this[_0xb29f('0x22')]=_0x4db46e[_0xb29f('0x22')]||_0xb29f('0x23');this[_0xb29f('0x24')]=_0x4db46e[_0xb29f('0x24')]||0x0;this['dialLimitQueue']=_0x4db46e[_0xb29f('0x25')]||0x0;this[_0xb29f('0x26')]=_0x4db46e[_0xb29f('0x26')]||0x1;this['dialPredictiveOptimization']=_0x4db46e[_0xb29f('0x27')]||_0xb29f('0x28');this[_0xb29f('0x29')]=_0x4db46e[_0xb29f('0x29')]||0.03;this[_0xb29f('0x2a')]=_0x4db46e['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x4db46e[_0xb29f('0x2b')]||_0xb29f('0x2c');this['dialOriginateCallerIdNumber']=_0x4db46e['dialOriginateCallerIdNumber']||_0xb29f('0x2c');this['dialOriginateTimeout']=_0x4db46e[_0xb29f('0x2d')]||0x1e;this[_0xb29f('0x2e')]=_0x4db46e[_0xb29f('0x2e')]||_0xb29f('0x2f');this[_0xb29f('0x30')]=_0x4db46e[_0xb29f('0x30')]||0x3;this[_0xb29f('0x31')]=_0x4db46e[_0xb29f('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x4db46e[_0xb29f('0x32')]||0x3;this[_0xb29f('0x33')]=_0x4db46e[_0xb29f('0x33')]||0x96;this[_0xb29f('0x34')]=_0x4db46e['dialBusyMaxRetry']||0x3;this[_0xb29f('0x35')]=_0x4db46e[_0xb29f('0x35')]||0x96;this[_0xb29f('0x36')]=_0x4db46e[_0xb29f('0x36')]||0x3;this[_0xb29f('0x37')]=_0x4db46e[_0xb29f('0x37')]||0x96;this[_0xb29f('0x38')]=_0x4db46e['dialNoSuchNumberMaxRetry']||0x3;this[_0xb29f('0x39')]=_0x4db46e[_0xb29f('0x39')]||0x96;this[_0xb29f('0x3a')]=_0x4db46e[_0xb29f('0x3a')]||0x3;this[_0xb29f('0x3b')]=_0x4db46e[_0xb29f('0x3b')]||0x96;this[_0xb29f('0x3c')]=_0x4db46e['dialAbandonedMaxRetry']||0x3;this[_0xb29f('0x3d')]=_0x4db46e[_0xb29f('0x3d')]||0x96;this[_0xb29f('0x3e')]=_0x4db46e['dialMachineMaxRetry']||0x3;this[_0xb29f('0x3f')]=_0x4db46e[_0xb29f('0x3f')]||0x96;this[_0xb29f('0x40')]=_0x4db46e['dialAgentRejectMaxRetry']||0x3;this[_0xb29f('0x41')]=_0x4db46e['dialAgentRejectRetryFrequency']||0x96;this[_0xb29f('0x42')]=_0x4db46e['callAdditionalPhoneAfterMin']||0x3;this[_0xb29f('0x43')]=_0x4db46e[_0xb29f('0x43')]||0x4;this['Trunk']=_0x4db46e[_0xb29f('0x44')]?_0x4db46e['Trunk']:undefined;this[_0xb29f('0x45')]=_0x4db46e[_0xb29f('0x45')]?_0x4db46e[_0xb29f('0x45')]:undefined;this[_0xb29f('0x46')]=_0x4db46e['dialPrefix']||undefined;this[_0xb29f('0x47')]=_0x4db46e[_0xb29f('0x47')]?_0x4db46e[_0xb29f('0x47')]:undefined;this[_0xb29f('0x48')]=_0x4db46e[_0xb29f('0x48')]||_0xb29f('0x49');this[_0xb29f('0x4a')]=_0x4db46e[_0xb29f('0x4a')]||undefined;this[_0xb29f('0x4b')]=_0x4db46e[_0xb29f('0x4b')]||undefined;this[_0xb29f('0x4c')]=strategy[_0x4db46e[_0xb29f('0x4c')]];this[_0xb29f('0x4d')]=!![];this['dialAMDActive']=_0x4db46e[_0xb29f('0x4e')]||![];this['dialAMDInitialSilence']=_0x4db46e[_0xb29f('0x4f')];this['dialAMDGreeting']=_0x4db46e[_0xb29f('0x50')];this['dialAMDAfterGreetingSilence']=_0x4db46e['dialAMDAfterGreetingSilence'];this[_0xb29f('0x51')]=_0x4db46e[_0xb29f('0x51')];this[_0xb29f('0x52')]=_0x4db46e[_0xb29f('0x52')];this[_0xb29f('0x53')]=_0x4db46e[_0xb29f('0x53')];this[_0xb29f('0x54')]=_0x4db46e[_0xb29f('0x54')];this[_0xb29f('0x55')]=_0x4db46e[_0xb29f('0x55')];this[_0xb29f('0x56')]=_0x4db46e['dialAMDMaximumWordLength'];this[_0xb29f('0x57')]=0x0;this[_0xb29f('0x58')]=0x0;this[_0xb29f('0x59')]=_0x4db46e[_0xb29f('0x59')];this['outboundAnswerCallsDay']=0x0;this[_0xb29f('0x5a')]=0x0;this[_0xb29f('0x5b')]=0x0;this[_0xb29f('0x5c')]=0x0;this[_0xb29f('0x5d')]=0x0;this[_0xb29f('0x5e')]=0x0;this[_0xb29f('0x5f')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xb29f('0x60')]=0x0;this[_0xb29f('0x61')]=0x0;this[_0xb29f('0x62')]=0x0;this[_0xb29f('0x63')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xb29f('0x64')]=undefined;this[_0xb29f('0x65')]=1.05;this[_0xb29f('0x66')]=0x0;this[_0xb29f('0x67')]=0x0;this[_0xb29f('0x68')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb29f('0x69')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xb29f('0x6a')]=_0x4db46e[_0xb29f('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x4db46e['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xb29f('0x6c')]=0x0;this[_0xb29f('0x6d')]=0x1;this[_0xb29f('0x6e')]=0x0;this[_0xb29f('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4db46e['dialRecallMeTimeout']||0x1e;this[_0xb29f('0x70')]=_0x4db46e[_0xb29f('0x70')]||![];this[_0xb29f('0x71')]=!!_0x4db46e[_0xb29f('0x71')]||![];this[_0xb29f('0x72')]=!!_0x4db46e[_0xb29f('0x72')]||![];this[_0xb29f('0x73')]=_0x4db46e[_0xb29f('0x73')]||undefined;this[_0xb29f('0x74')]=_0x4db46e[_0xb29f('0x74')]||![];this[_0xb29f('0x75')]=_0x4db46e['dialAgiAfterHangupAgent']||![];this[_0xb29f('0xb')]=monitorFormat[_0x4db46e[_0xb29f('0xb')]]?monitorFormat[_0x4db46e[_0xb29f('0xb')]]:undefined;this['mandatoryDisposition']=_0x4db46e[_0xb29f('0x76')]||![];this[_0xb29f('0x77')]=_0x4db46e[_0xb29f('0x77')]?_0x4db46e['mandatoryDispositionPause']:undefined;this[_0xb29f('0x78')]=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0xbc3a=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','inbound','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','onHold','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry'];(function(_0x1cc3f1,_0x5153ff){var _0x18fd43=function(_0x509c65){while(--_0x509c65){_0x1cc3f1['push'](_0x1cc3f1['shift']());}};_0x18fd43(++_0x5153ff);}(_0xbc3a,0xc1));var _0xabc3=function(_0x5b6ce8,_0x332e64){_0x5b6ce8=_0x5b6ce8-0x0;var _0x296142=_0xbc3a[_0x5b6ce8];return _0x296142;};'use strict';var monitorFormat={'wav':_0xabc3('0x0'),'wav49':'wav49','gsm':_0xabc3('0x1')};var strategy={'fewestcalls':_0xabc3('0x2'),'leastrecent':_0xabc3('0x3'),'linear':_0xabc3('0x4'),'random':_0xabc3('0x5'),'ringall':_0xabc3('0x6'),'rr':_0xabc3('0x7'),'rrmemory':_0xabc3('0x8'),'rrordered':_0xabc3('0x9'),'wrandom':_0xabc3('0xa')};function VoiceQueue(_0x229b7f){this['id']=_0x229b7f['id']||0x0;this[_0xabc3('0xb')]=_0x229b7f[_0xabc3('0xb')]||'';this[_0xabc3('0xc')]=_0x229b7f['monitor_format']||'';this['type']=_0x229b7f['type']||_0xabc3('0xd');this['waiting']=0x0;this[_0xabc3('0xe')]=0x0;this[_0xabc3('0xf')]=0x0;this['sumDuration']=0x0;this[_0xabc3('0x10')]=0x0;this[_0xabc3('0x11')]=0x0;this[_0xabc3('0x12')]=0x0;this[_0xabc3('0x13')]=0x0;this[_0xabc3('0x14')]=0x0;this[_0xabc3('0x15')]=0x0;this[_0xabc3('0x16')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0xabc3('0x17')]=0x0;this['paused']=0x0;this[_0xabc3('0x18')]=0x0;this[_0xabc3('0x19')]=0x0;this[_0xabc3('0x1a')]=0x0;this[_0xabc3('0x1b')]=0x0;this[_0xabc3('0x1c')]=0x0;this[_0xabc3('0x1d')]=_0x229b7f[_0xabc3('0x1d')]||![];this[_0xabc3('0x1e')]=_0x229b7f[_0xabc3('0x1e')]||0xa;this[_0xabc3('0x1f')]=_0x229b7f[_0xabc3('0x1f')]||'no';this[_0xabc3('0x20')]=!![];this[_0xabc3('0x21')]='';this['statusMessage']='';this['originated']=0x0;this['temp']=0x0;this[_0xabc3('0x22')]=_0x229b7f[_0xabc3('0x22')]||null;this[_0xabc3('0x23')]=_0x229b7f['dialGlobalInterval']?_0x229b7f['dialGlobalInterval']:null;this[_0xabc3('0x24')]=_0x229b7f[_0xabc3('0x24')];this[_0xabc3('0x25')]=_0x229b7f[_0xabc3('0x25')]||'progressive';this['dialLimitChannel']=_0x229b7f['dialLimitChannel']||0x0;this[_0xabc3('0x26')]=_0x229b7f[_0xabc3('0x26')]||0x0;this[_0xabc3('0x27')]=_0x229b7f[_0xabc3('0x27')]||0x1;this[_0xabc3('0x28')]=_0x229b7f[_0xabc3('0x28')]||_0xabc3('0x29');this[_0xabc3('0x2a')]=_0x229b7f[_0xabc3('0x2a')]||0.03;this[_0xabc3('0x2b')]=_0x229b7f['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x229b7f[_0xabc3('0x2c')]||'anonymous';this[_0xabc3('0x2d')]=_0x229b7f[_0xabc3('0x2d')]||_0xabc3('0x2e');this[_0xabc3('0x2f')]=_0x229b7f[_0xabc3('0x2f')]||0x1e;this[_0xabc3('0x30')]=_0x229b7f[_0xabc3('0x30')]||_0xabc3('0x31');this[_0xabc3('0x32')]=_0x229b7f[_0xabc3('0x32')]||0x3;this[_0xabc3('0x33')]=_0x229b7f[_0xabc3('0x33')]||undefined;this[_0xabc3('0x34')]=_0x229b7f[_0xabc3('0x34')]||0x3;this[_0xabc3('0x35')]=_0x229b7f[_0xabc3('0x35')]||0x96;this['dialBusyMaxRetry']=_0x229b7f[_0xabc3('0x36')]||0x3;this[_0xabc3('0x37')]=_0x229b7f[_0xabc3('0x37')]||0x96;this['dialNoAnswerMaxRetry']=_0x229b7f[_0xabc3('0x38')]||0x3;this[_0xabc3('0x39')]=_0x229b7f[_0xabc3('0x39')]||0x96;this[_0xabc3('0x3a')]=_0x229b7f['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x229b7f[_0xabc3('0x3b')]||0x96;this[_0xabc3('0x3c')]=_0x229b7f[_0xabc3('0x3c')]||0x3;this[_0xabc3('0x3d')]=_0x229b7f['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x229b7f[_0xabc3('0x3e')]||0x3;this[_0xabc3('0x3f')]=_0x229b7f[_0xabc3('0x3f')]||0x96;this[_0xabc3('0x40')]=_0x229b7f[_0xabc3('0x40')]||0x3;this['dialMachineRetryFrequency']=_0x229b7f['dialMachineRetryFrequency']||0x96;this[_0xabc3('0x41')]=_0x229b7f['dialAgentRejectMaxRetry']||0x3;this[_0xabc3('0x42')]=_0x229b7f['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x229b7f[_0xabc3('0x43')]||0x3;this[_0xabc3('0x44')]=_0x229b7f['dialGlobalMaxRetry']||0x4;this[_0xabc3('0x45')]=_0x229b7f['Trunk']?_0x229b7f[_0xabc3('0x45')]:undefined;this['TrunkBackup']=_0x229b7f[_0xabc3('0x46')]?_0x229b7f[_0xabc3('0x46')]:undefined;this[_0xabc3('0x47')]=_0x229b7f[_0xabc3('0x47')]||undefined;this[_0xabc3('0x48')]=_0x229b7f[_0xabc3('0x48')]?_0x229b7f['Interval']:undefined;this['dialOrderByScheduledAt']=_0x229b7f[_0xabc3('0x49')]||'DESC';this[_0xabc3('0x4a')]=_0x229b7f[_0xabc3('0x4a')]||undefined;this[_0xabc3('0x4b')]=_0x229b7f[_0xabc3('0x4b')]||undefined;this[_0xabc3('0x4c')]=strategy[_0x229b7f[_0xabc3('0x4c')]];this[_0xabc3('0x4d')]=!![];this['dialAMDActive']=_0x229b7f[_0xabc3('0x4e')]||![];this[_0xabc3('0x4f')]=_0x229b7f[_0xabc3('0x4f')];this[_0xabc3('0x50')]=_0x229b7f[_0xabc3('0x50')];this['dialAMDAfterGreetingSilence']=_0x229b7f[_0xabc3('0x51')];this[_0xabc3('0x52')]=_0x229b7f['dialAMDTotalAnalysisTime'];this[_0xabc3('0x53')]=_0x229b7f[_0xabc3('0x53')];this[_0xabc3('0x54')]=_0x229b7f[_0xabc3('0x54')];this['dialAMDMaximumNumberOfWords']=_0x229b7f[_0xabc3('0x55')];this[_0xabc3('0x56')]=_0x229b7f[_0xabc3('0x56')];this[_0xabc3('0x57')]=_0x229b7f[_0xabc3('0x57')];this[_0xabc3('0x58')]=0x0;this['pTalking']=0x0;this['timeout']=_0x229b7f[_0xabc3('0x59')];this[_0xabc3('0x5a')]=0x0;this[_0xabc3('0x5b')]=0x0;this[_0xabc3('0x5c')]=0x0;this[_0xabc3('0x5d')]=0x0;this[_0xabc3('0x5e')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xabc3('0x5f')]=0x0;this[_0xabc3('0x60')]=0x0;this[_0xabc3('0x61')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xabc3('0x62')]=0x0;this[_0xabc3('0x63')]=0x0;this[_0xabc3('0x64')]=undefined;this['startPredictive']=undefined;this[_0xabc3('0x65')]=undefined;this[_0xabc3('0x66')]=1.05;this[_0xabc3('0x67')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xabc3('0x68')]=0x0;this[_0xabc3('0x69')]=0x0;this[_0xabc3('0x6a')]=0x0;this[_0xabc3('0x6b')]=0x0;this[_0xabc3('0x6c')]=_0x229b7f[_0xabc3('0x6d')]||0x14;this[_0xabc3('0x6e')]=_0x229b7f[_0xabc3('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xabc3('0x6f')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xabc3('0x70')]=0x0;this['erlangCallToSecond']=0x0;this[_0xabc3('0x71')]=0x0;this[_0xabc3('0x72')]=0x0;this[_0xabc3('0x73')]=_0x229b7f[_0xabc3('0x73')]||0x1e;this[_0xabc3('0x74')]=_0x229b7f['dialRecallInQueue']||![];this[_0xabc3('0x75')]=!!_0x229b7f['dialPreviewAutoRecallMe']||![];this[_0xabc3('0x76')]=!!_0x229b7f[_0xabc3('0x76')]||![];this[_0xabc3('0x77')]=_0x229b7f[_0xabc3('0x77')]||undefined;this[_0xabc3('0x78')]=_0x229b7f[_0xabc3('0x78')]||![];this['dialAgiAfterHangupAgent']=_0x229b7f[_0xabc3('0x79')]||![];this['monitor_format']=monitorFormat[_0x229b7f[_0xabc3('0xc')]]?monitorFormat[_0x229b7f[_0xabc3('0xc')]]:undefined;this['mandatoryDisposition']=_0x229b7f[_0xabc3('0x7a')]||![];this[_0xabc3('0x7b')]=_0x229b7f[_0xabc3('0x7b')]?_0x229b7f[_0xabc3('0x7b')]:undefined;this[_0xabc3('0x7c')]=![];}module[_0xabc3('0x7d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 4810d33..7219bc6 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['message','active','updateReportFromOutboundQueue','outboundNoSuchCallsDay','exports','available','loggedIn','loggedInDb','paused','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','statusMessage','Trunk','callerid','prototype','createReport','loggedin','callers','length','incall','includes','status','keys','queue','dialer','exten','compareToInboundQueue','some'];(function(_0x33616f,_0x3855c6){var _0x47221f=function(_0xe32c3a){while(--_0xe32c3a){_0x33616f['push'](_0x33616f['shift']());}};_0x47221f(++_0x3855c6);}(_0xeec6,0x1c2));var _0x6eec=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xeec6[_0x25662e];return _0x59b7bc;};'use strict';var INBOUND_COUNTERS=[_0x6eec('0x0'),_0x6eec('0x1'),_0x6eec('0x2'),_0x6eec('0x3'),'ringing',_0x6eec('0x4'),_0x6eec('0x5')];var OUTBOUND_COUNTERS=[_0x6eec('0x0'),_0x6eec('0x6'),_0x6eec('0x7'),_0x6eec('0x1'),'loggedInDb',_0x6eec('0x8'),_0x6eec('0x9'),'outboundAnswerCallsDay',_0x6eec('0xa'),_0x6eec('0xb'),_0x6eec('0xc'),_0x6eec('0xd'),'outboundNoSuchCallsDay',_0x6eec('0xe'),_0x6eec('0xf'),_0x6eec('0x10'),'paused','pTalking','talking',_0x6eec('0x11'),_0x6eec('0x12'),'total','waiting'];function VoiceQueueSummary(_0x1cc8d3){this['id']=_0x1cc8d3['id'];this['name']=_0x1cc8d3[_0x6eec('0x13')];this[_0x6eec('0x14')]=_0x1cc8d3[_0x6eec('0x14')];this[_0x6eec('0x15')]=_0x1cc8d3[_0x6eec('0x15')]||0x0;this['answered']=_0x1cc8d3[_0x6eec('0x6')]||0x0;this[_0x6eec('0x0')]=_0x1cc8d3[_0x6eec('0x0')]||0x0;this[_0x6eec('0x16')]=_0x1cc8d3[_0x6eec('0x16')]||0x0;this[_0x6eec('0x7')]=_0x1cc8d3[_0x6eec('0x7')]||0x0;this[_0x6eec('0x17')]=_0x1cc8d3[_0x6eec('0x17')]||0x0;this[_0x6eec('0x1')]=_0x1cc8d3['loggedIn']||0x0;this[_0x6eec('0x2')]=_0x1cc8d3['loggedInDb']||0x0;this[_0x6eec('0x18')]=_0x1cc8d3[_0x6eec('0x18')]||0x0;this['notInUse']=_0x1cc8d3[_0x6eec('0x19')]||0x0;this[_0x6eec('0x3')]=_0x1cc8d3[_0x6eec('0x3')]||0x0;this['ringing']=_0x1cc8d3[_0x6eec('0x1a')]||0x0;this[_0x6eec('0x1b')]=_0x1cc8d3[_0x6eec('0x1b')];this[_0x6eec('0x11')]=_0x1cc8d3[_0x6eec('0x11')];this[_0x6eec('0x12')]=_0x1cc8d3['sumDuration'];this[_0x6eec('0x1c')]=_0x1cc8d3[_0x6eec('0x1c')]||0x0;this[_0x6eec('0x4')]=_0x1cc8d3[_0x6eec('0x4')]||0x0;this[_0x6eec('0x1d')]=_0x1cc8d3[_0x6eec('0x1d')]||0x0;this['type']=_0x1cc8d3[_0x6eec('0x1e')];this[_0x6eec('0x1f')]=_0x1cc8d3[_0x6eec('0x1f')]||0x0;this[_0x6eec('0x20')]=_0x1cc8d3[_0x6eec('0x20')]||0x0;this[_0x6eec('0x21')]=_0x1cc8d3['unmanaged']||0x0;this[_0x6eec('0x5')]=_0x1cc8d3[_0x6eec('0x5')]||0x0;if(_0x1cc8d3[_0x6eec('0x1e')]===_0x6eec('0x22')){this[_0x6eec('0x23')]=_0x1cc8d3[_0x6eec('0x23')]||0x0;this[_0x6eec('0x24')]=_0x1cc8d3[_0x6eec('0x24')];this[_0x6eec('0x25')]=_0x1cc8d3['dialMethod'];this[_0x6eec('0x26')]=_0x1cc8d3[_0x6eec('0x26')];this[_0x6eec('0x27')]=_0x1cc8d3[_0x6eec('0x27')];this['dialOriginateTimeout']=_0x1cc8d3[_0x6eec('0x28')];this[_0x6eec('0x29')]=_0x1cc8d3['dialPrefix'];this['temp']=_0x1cc8d3[_0x6eec('0x2a')];this['outboundAnswerAgiCallsDay']=_0x1cc8d3[_0x6eec('0x2b')];this[_0x6eec('0x2c')]=_0x1cc8d3[_0x6eec('0x2c')];this[_0x6eec('0xa')]=_0x1cc8d3[_0x6eec('0xa')];this[_0x6eec('0xb')]=_0x1cc8d3[_0x6eec('0xb')];this[_0x6eec('0xc')]=_0x1cc8d3[_0x6eec('0xc')];this[_0x6eec('0x2d')]=_0x1cc8d3['outboundDropCallsDayACS'];this[_0x6eec('0x2e')]=_0x1cc8d3['outboundDropCallsDayCallersExit'];this[_0x6eec('0x2f')]=_0x1cc8d3[_0x6eec('0x2f')];this[_0x6eec('0xd')]=_0x1cc8d3['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x1cc8d3['outboundNoSuchCallsDay'];this[_0x6eec('0x30')]=_0x1cc8d3[_0x6eec('0x30')];this[_0x6eec('0xe')]=_0x1cc8d3[_0x6eec('0xe')];this[_0x6eec('0xf')]=_0x1cc8d3[_0x6eec('0xf')];this[_0x6eec('0x10')]=_0x1cc8d3[_0x6eec('0x10')];this[_0x6eec('0x31')]=_0x1cc8d3[_0x6eec('0x31')];this[_0x6eec('0x32')]=_0x1cc8d3[_0x6eec('0x32')];this['predictiveIntervalAvgTalktime']=_0x1cc8d3[_0x6eec('0x33')];this[_0x6eec('0x34')]=_0x1cc8d3[_0x6eec('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x1cc8d3[_0x6eec('0x35')];this[_0x6eec('0x36')]=_0x1cc8d3[_0x6eec('0x36')];this[_0x6eec('0x37')]=_0x1cc8d3[_0x6eec('0x37')];this[_0x6eec('0x38')]=_0x1cc8d3['predictiveIntervalHitRate'];this[_0x6eec('0x39')]=_0x1cc8d3[_0x6eec('0x39')];this[_0x6eec('0x3a')]=_0x1cc8d3['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x1cc8d3[_0x6eec('0x3b')];this[_0x6eec('0x3c')]=_0x1cc8d3[_0x6eec('0x3c')];this[_0x6eec('0x8')]=_0x1cc8d3[_0x6eec('0x8')];this['erlangCalls']=_0x1cc8d3[_0x6eec('0x3d')];this[_0x6eec('0x3e')]=_0x1cc8d3[_0x6eec('0x3e')];this[_0x6eec('0x3f')]=_0x1cc8d3[_0x6eec('0x3f')];this[_0x6eec('0x40')]=_0x1cc8d3[_0x6eec('0x40')];this[_0x6eec('0x41')]=_0x1cc8d3['startPredictive'];this[_0x6eec('0x42')]=_0x1cc8d3[_0x6eec('0x42')];this['message']=_0x1cc8d3['message'];this[_0x6eec('0x43')]=_0x1cc8d3[_0x6eec('0x43')];}if(_0x1cc8d3[_0x6eec('0x44')]){this[_0x6eec('0x44')]={'id':_0x1cc8d3['Trunk']['id'],'name':_0x1cc8d3['Trunk'][_0x6eec('0x13')],'active':_0x1cc8d3['Trunk']['active'],'callerid':_0x1cc8d3[_0x6eec('0x44')][_0x6eec('0x45')]};}}VoiceQueueSummary[_0x6eec('0x46')][_0x6eec('0x47')]=function(_0x25d3f3,_0x58dfe7,_0x931bcf,_0x3a4d25){this['loggedInDb']=0x0;this[_0x6eec('0x4')]=0x0;this[_0x6eec('0x3')]=0x0;this['unknown']=0x0;this[_0x6eec('0x19')]=0x0;this[_0x6eec('0x7')]=0x0;this['busy']=0x0;this[_0x6eec('0x17')]=0x0;this[_0x6eec('0x1f')]=0x0;this[_0x6eec('0x1a')]=0x0;this[_0x6eec('0x1b')]=0x0;this['onHold']=0x0;if(_0x931bcf){if(_0x931bcf[_0x6eec('0x0')]){this[_0x6eec('0x0')]=Number(_0x931bcf[_0x6eec('0x0')]);}if(_0x931bcf[_0x6eec('0x48')]){this[_0x6eec('0x1')]=Number(_0x931bcf['loggedin']);}if(_0x931bcf['callers']){this[_0x6eec('0x5')]=Number(_0x931bcf[_0x6eec('0x49')]);}}for(var _0x3703b5=0x0;_0x3703b5<_0x25d3f3[_0x6eec('0x4a')];_0x3703b5++){var _0x44c7b8=_0x58dfe7['SIP/'+_0x25d3f3[_0x3703b5][_0x6eec('0x13')]];if(_0x44c7b8&&_0x44c7b8['online']){this[_0x6eec('0x2')]+=0x1;}if(_0x25d3f3[_0x3703b5][_0x6eec('0x4b')]==='1'){this[_0x6eec('0x4')]+=0x1;}if(_0x25d3f3[_0x3703b5]['paused']==='1'&&!['2','7','8'][_0x6eec('0x4c')](_0x25d3f3[_0x3703b5][_0x6eec('0x4d')])){this[_0x6eec('0x3')]+=0x1;}switch(_0x25d3f3[_0x3703b5][_0x6eec('0x4d')]){case'0':this[_0x6eec('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x6eec('0x7')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x6eec('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x6eec('0x1b')]+=0x1;break;case'8':this[_0x6eec('0x18')]+=0x1;break;}}if(this[_0x6eec('0x25')]==='booked'){var _0x4b4223=Object[_0x6eec('0x4e')](_0x3a4d25);for(var _0x142914=0x0;_0x142914<_0x4b4223[_0x6eec('0x4a')];_0x142914++){var _0x2d0fc0=_0x4b4223[_0x142914];var _0x188359=_0x3a4d25[_0x2d0fc0];if(_0x188359[_0x6eec('0x4f')]===this[_0x6eec('0x13')]&&_0x188359[_0x6eec('0x1e')]===_0x6eec('0x50')&&_0x188359[_0x6eec('0x51')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0x6eec('0x4')]>this[_0x6eec('0x7')]){this[_0x6eec('0x4')]=this['inUse'];}this[_0x6eec('0x23')]=0x0;}return this;};VoiceQueueSummary[_0x6eec('0x46')][_0x6eec('0x52')]=function(_0x149bb2){var _0x386632=![];if(_0x149bb2){_0x386632=INBOUND_COUNTERS[_0x6eec('0x53')](function(_0x10c10a){return this[_0x10c10a]!==_0x149bb2[_0x10c10a];},this);}return _0x386632;};VoiceQueueSummary[_0x6eec('0x46')]['compareToOutboundQueue']=function(_0xdf888d){var _0x37f48e=![];var _0x3374ef=![];var _0x3e77f3=![];if(_0xdf888d){_0x37f48e=this['dialMethod']!==_0xdf888d['dialMethod']||this['dialActive']!==_0xdf888d[_0x6eec('0x24')]||this[_0x6eec('0x54')]!==_0xdf888d[_0x6eec('0x54')]||this[_0x6eec('0x43')]!==_0xdf888d['statusMessage'];_0x3374ef=OUTBOUND_COUNTERS['some'](function(_0x10a173){return this[_0x10a173]!==_0xdf888d[_0x10a173];},this);if(this[_0x6eec('0x44')]&&_0xdf888d[_0x6eec('0x44')]){_0x3e77f3=this['Trunk'][_0x6eec('0x13')]!==_0xdf888d[_0x6eec('0x44')][_0x6eec('0x13')]||this[_0x6eec('0x44')][_0x6eec('0x55')]!==_0xdf888d[_0x6eec('0x44')][_0x6eec('0x55')];}}return _0x37f48e||_0x3374ef||_0x3e77f3;};VoiceQueueSummary[_0x6eec('0x46')][_0x6eec('0x56')]=function(_0x4e921a){this[_0x6eec('0x6')]=_0x4e921a['answered'];this[_0x6eec('0x54')]=_0x4e921a[_0x6eec('0x54')];this[_0x6eec('0x43')]=_0x4e921a[_0x6eec('0x43')];this[_0x6eec('0x8')]=_0x4e921a[_0x6eec('0x8')];this[_0x6eec('0x9')]=_0x4e921a['outboundAbandonedCallsDay'];this[_0x6eec('0x2c')]=_0x4e921a['outboundAnswerCallsDay'];this[_0x6eec('0xa')]=_0x4e921a['outboundBlacklistCallsDay'];this[_0x6eec('0xb')]=_0x4e921a[_0x6eec('0xb')];this[_0x6eec('0xc')]=_0x4e921a[_0x6eec('0xc')];this[_0x6eec('0xd')]=_0x4e921a[_0x6eec('0xd')];this[_0x6eec('0x57')]=_0x4e921a[_0x6eec('0x57')];this[_0x6eec('0xe')]=_0x4e921a[_0x6eec('0xe')];this['outboundRejectCallsDay']=_0x4e921a['outboundRejectCallsDay'];this[_0x6eec('0x10')]=_0x4e921a[_0x6eec('0x10')];this[_0x6eec('0x11')]=_0x4e921a[_0x6eec('0x11')];this[_0x6eec('0x12')]=_0x4e921a['sumDuration'];this[_0x6eec('0x1d')]=_0x4e921a[_0x6eec('0x1d')];if(this['dialMethod']==='preview'){this['pTalking']=_0x4e921a[_0x6eec('0x23')];}};module[_0x6eec('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0x432b=['exten','xcally-motion-preview','compareToInboundQueue','some','preview','available','loggedInDb','paused','ringing','talking','answered','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','waiting','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','incall','includes','booked','keys','length','dialer'];(function(_0x1fd563,_0x196466){var _0x4673f3=function(_0x15e015){while(--_0x15e015){_0x1fd563['push'](_0x1fd563['shift']());}};_0x4673f3(++_0x196466);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var INBOUND_COUNTERS=[_0xb432('0x0'),'loggedIn',_0xb432('0x1'),_0xb432('0x2'),_0xb432('0x3'),_0xb432('0x4'),'waiting'];var OUTBOUND_COUNTERS=['available',_0xb432('0x5'),'inUse',_0xb432('0x6'),'loggedInDb',_0xb432('0x7'),_0xb432('0x8'),_0xb432('0x9'),_0xb432('0xa'),_0xb432('0xb'),_0xb432('0xc'),_0xb432('0xd'),_0xb432('0xe'),'outboundReCallsDay',_0xb432('0xf'),_0xb432('0x10'),_0xb432('0x2'),_0xb432('0x11'),_0xb432('0x4'),_0xb432('0x12'),'sumDuration','total',_0xb432('0x13')];function VoiceQueueSummary(_0x255773){this['id']=_0x255773['id'];this['name']=_0x255773[_0xb432('0x14')];this[_0xb432('0x15')]=_0x255773[_0xb432('0x15')];this['abandoned']=_0x255773[_0xb432('0x16')]||0x0;this[_0xb432('0x5')]=_0x255773['answered']||0x0;this[_0xb432('0x0')]=_0x255773[_0xb432('0x0')]||0x0;this[_0xb432('0x17')]=_0x255773[_0xb432('0x17')]||0x0;this[_0xb432('0x18')]=_0x255773['inUse']||0x0;this['invalid']=_0x255773[_0xb432('0x19')]||0x0;this[_0xb432('0x6')]=_0x255773[_0xb432('0x6')]||0x0;this[_0xb432('0x1')]=_0x255773[_0xb432('0x1')]||0x0;this[_0xb432('0x1a')]=_0x255773[_0xb432('0x1a')]||0x0;this[_0xb432('0x1b')]=_0x255773[_0xb432('0x1b')]||0x0;this[_0xb432('0x2')]=_0x255773['paused']||0x0;this['ringing']=_0x255773[_0xb432('0x3')]||0x0;this[_0xb432('0x1c')]=_0x255773[_0xb432('0x1c')];this[_0xb432('0x12')]=_0x255773['sumBillable'];this[_0xb432('0x1d')]=_0x255773[_0xb432('0x1d')];this[_0xb432('0x1e')]=_0x255773[_0xb432('0x1e')]||0x0;this[_0xb432('0x4')]=_0x255773[_0xb432('0x4')]||0x0;this[_0xb432('0x1f')]=_0x255773[_0xb432('0x1f')]||0x0;this['type']=_0x255773[_0xb432('0x20')];this[_0xb432('0x21')]=_0x255773['unavailable']||0x0;this[_0xb432('0x22')]=_0x255773[_0xb432('0x22')]||0x0;this[_0xb432('0x23')]=_0x255773[_0xb432('0x23')]||0x0;this[_0xb432('0x13')]=_0x255773[_0xb432('0x13')]||0x0;if(_0x255773[_0xb432('0x20')]===_0xb432('0x24')){this[_0xb432('0x11')]=_0x255773[_0xb432('0x11')]||0x0;this['dialActive']=_0x255773[_0xb432('0x25')];this[_0xb432('0x26')]=_0x255773[_0xb432('0x26')];this[_0xb432('0x27')]=_0x255773[_0xb432('0x27')];this[_0xb432('0x28')]=_0x255773['dialOriginateCallerIdNumber'];this[_0xb432('0x29')]=_0x255773[_0xb432('0x29')];this[_0xb432('0x2a')]=_0x255773[_0xb432('0x2a')];this[_0xb432('0x2b')]=_0x255773[_0xb432('0x2b')];this[_0xb432('0x2c')]=_0x255773[_0xb432('0x2c')];this[_0xb432('0x9')]=_0x255773['outboundAnswerCallsDay'];this[_0xb432('0xa')]=_0x255773[_0xb432('0xa')];this[_0xb432('0xb')]=_0x255773[_0xb432('0xb')];this[_0xb432('0xc')]=_0x255773[_0xb432('0xc')];this[_0xb432('0x2d')]=_0x255773[_0xb432('0x2d')];this[_0xb432('0x2e')]=_0x255773[_0xb432('0x2e')];this[_0xb432('0x2f')]=_0x255773[_0xb432('0x2f')];this['outboundNoAnswerCallsDay']=_0x255773[_0xb432('0xd')];this['outboundNoSuchCallsDay']=_0x255773[_0xb432('0xe')];this[_0xb432('0x30')]=_0x255773[_0xb432('0x30')];this[_0xb432('0x31')]=_0x255773[_0xb432('0x31')];this[_0xb432('0xf')]=_0x255773['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x255773['outboundUnknownCallsDay'];this[_0xb432('0x32')]=_0x255773[_0xb432('0x32')];this[_0xb432('0x33')]=_0x255773[_0xb432('0x33')];this['predictiveIntervalAvgTalktime']=_0x255773['predictiveIntervalAvgTalktime'];this[_0xb432('0x34')]=_0x255773['predictiveIntervalDroppedCallsCallersExit'];this[_0xb432('0x35')]=_0x255773[_0xb432('0x35')];this['predictiveIntervalErlangCalls']=_0x255773[_0xb432('0x36')];this[_0xb432('0x37')]=_0x255773[_0xb432('0x37')];this[_0xb432('0x38')]=_0x255773[_0xb432('0x38')];this['predictiveIntervalMultiplicativeFactor']=_0x255773[_0xb432('0x39')];this[_0xb432('0x3a')]=_0x255773[_0xb432('0x3a')];this[_0xb432('0x3b')]=_0x255773[_0xb432('0x3b')];this[_0xb432('0x3c')]=_0x255773[_0xb432('0x3c')];this['originated']=_0x255773['originated'];this[_0xb432('0x3d')]=_0x255773[_0xb432('0x3d')];this['erlangCallToSecond']=_0x255773[_0xb432('0x3e')];this[_0xb432('0x3f')]=_0x255773[_0xb432('0x3f')];this[_0xb432('0x40')]=_0x255773[_0xb432('0x40')];this['startPredictive']=_0x255773[_0xb432('0x41')];this[_0xb432('0x42')]=_0x255773[_0xb432('0x42')];this[_0xb432('0x43')]=_0x255773[_0xb432('0x43')];this[_0xb432('0x44')]=_0x255773[_0xb432('0x44')];}if(_0x255773[_0xb432('0x45')]){this[_0xb432('0x45')]={'id':_0x255773['Trunk']['id'],'name':_0x255773['Trunk'][_0xb432('0x14')],'active':_0x255773[_0xb432('0x45')][_0xb432('0x46')],'callerid':_0x255773[_0xb432('0x45')][_0xb432('0x47')]};}}VoiceQueueSummary[_0xb432('0x48')][_0xb432('0x49')]=function(_0x456bce,_0x4a1e3a,_0x504535,_0x4d4a73){this[_0xb432('0x1')]=0x0;this[_0xb432('0x4')]=0x0;this[_0xb432('0x2')]=0x0;this[_0xb432('0x22')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this[_0xb432('0x17')]=0x0;this[_0xb432('0x19')]=0x0;this['unavailable']=0x0;this[_0xb432('0x3')]=0x0;this['ringInUse']=0x0;this[_0xb432('0x1a')]=0x0;if(_0x504535){if(_0x504535[_0xb432('0x0')]){this['available']=Number(_0x504535['available']);}if(_0x504535[_0xb432('0x4a')]){this['loggedIn']=Number(_0x504535[_0xb432('0x4a')]);}if(_0x504535[_0xb432('0x4b')]){this['waiting']=Number(_0x504535[_0xb432('0x4b')]);}}for(var _0x4b1763=0x0;_0x4b1763<_0x456bce['length'];_0x4b1763++){var _0x58010e=_0x4a1e3a['SIP/'+_0x456bce[_0x4b1763][_0xb432('0x14')]];if(_0x58010e&&_0x58010e['online']){this[_0xb432('0x1')]+=0x1;}if(_0x456bce[_0x4b1763][_0xb432('0x4c')]==='1'){this['talking']+=0x1;}if(_0x456bce[_0x4b1763]['paused']==='1'&&!['2','7','8'][_0xb432('0x4d')](_0x456bce[_0x4b1763]['status'])){this[_0xb432('0x2')]+=0x1;}switch(_0x456bce[_0x4b1763]['status']){case'0':this[_0xb432('0x22')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xb432('0x18')]+=0x1;break;case'3':this[_0xb432('0x17')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xb432('0x1c')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0xb432('0x4e')){var _0x2a4fc1=Object[_0xb432('0x4f')](_0x4d4a73);for(var _0x4487ac=0x0;_0x4487ac<_0x2a4fc1[_0xb432('0x50')];_0x4487ac++){var _0x16f2bc=_0x2a4fc1[_0x4487ac];var _0x4b9c9c=_0x4d4a73[_0x16f2bc];if(_0x4b9c9c['queue']===this['name']&&_0x4b9c9c['type']===_0xb432('0x51')&&_0x4b9c9c[_0xb432('0x52')]===_0xb432('0x53')){this[_0xb432('0x4')]+=0x1;}}if(this[_0xb432('0x4')]>this[_0xb432('0x18')]){this[_0xb432('0x4')]=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype'][_0xb432('0x54')]=function(_0x20b75c){var _0x43737b=![];if(_0x20b75c){_0x43737b=INBOUND_COUNTERS[_0xb432('0x55')](function(_0x244bd8){return this[_0x244bd8]!==_0x20b75c[_0x244bd8];},this);}return _0x43737b;};VoiceQueueSummary['prototype']['compareToOutboundQueue']=function(_0x18527c){var _0x360362=![];var _0x8882ad=![];var _0x2cef6d=![];if(_0x18527c){_0x360362=this['dialMethod']!==_0x18527c[_0xb432('0x26')]||this[_0xb432('0x25')]!==_0x18527c['dialActive']||this[_0xb432('0x43')]!==_0x18527c[_0xb432('0x43')]||this[_0xb432('0x44')]!==_0x18527c[_0xb432('0x44')];_0x8882ad=OUTBOUND_COUNTERS[_0xb432('0x55')](function(_0x294d0c){return this[_0x294d0c]!==_0x18527c[_0x294d0c];},this);if(this[_0xb432('0x45')]&&_0x18527c[_0xb432('0x45')]){_0x2cef6d=this[_0xb432('0x45')][_0xb432('0x14')]!==_0x18527c[_0xb432('0x45')][_0xb432('0x14')]||this[_0xb432('0x45')][_0xb432('0x46')]!==_0x18527c[_0xb432('0x45')]['active'];}}return _0x360362||_0x8882ad||_0x2cef6d;};VoiceQueueSummary[_0xb432('0x48')]['updateReportFromOutboundQueue']=function(_0x1cb7d5){this[_0xb432('0x5')]=_0x1cb7d5['answered'];this['message']=_0x1cb7d5[_0xb432('0x43')];this[_0xb432('0x44')]=_0x1cb7d5[_0xb432('0x44')];this[_0xb432('0x7')]=_0x1cb7d5[_0xb432('0x7')];this[_0xb432('0x8')]=_0x1cb7d5[_0xb432('0x8')];this[_0xb432('0x9')]=_0x1cb7d5[_0xb432('0x9')];this[_0xb432('0xa')]=_0x1cb7d5[_0xb432('0xa')];this[_0xb432('0xb')]=_0x1cb7d5[_0xb432('0xb')];this['outboundCongestionCallsDay']=_0x1cb7d5[_0xb432('0xc')];this['outboundNoAnswerCallsDay']=_0x1cb7d5[_0xb432('0xd')];this[_0xb432('0xe')]=_0x1cb7d5[_0xb432('0xe')];this[_0xb432('0x31')]=_0x1cb7d5[_0xb432('0x31')];this[_0xb432('0xf')]=_0x1cb7d5[_0xb432('0xf')];this['outboundUnknownCallsDay']=_0x1cb7d5[_0xb432('0x10')];this[_0xb432('0x12')]=_0x1cb7d5[_0xb432('0x12')];this[_0xb432('0x1d')]=_0x1cb7d5[_0xb432('0x1d')];this[_0xb432('0x1f')]=_0x1cb7d5[_0xb432('0x1f')];if(this['dialMethod']===_0xb432('0x56')){this[_0xb432('0x11')]=_0x1cb7d5[_0xb432('0x11')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index f108cde..ef97294 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 _0xe7b3=['name','username','remoteUri','serverUrl','exports'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xe7b3,0xd2));var _0x3e7b=function(_0x3d639c,_0x44b7c3){_0x3d639c=_0x3d639c-0x0;var _0x1f2517=_0xe7b3[_0x3d639c];return _0x1f2517;};'use strict';function VtigerAccount(_0x1c4342){this['id']=_0x1c4342['id']||0x0;this['name']=_0x1c4342[_0x3e7b('0x0')]||'';this[_0x3e7b('0x1')]=_0x1c4342[_0x3e7b('0x1')]||'';this['accessKey']=_0x1c4342['accessKey']||'';this[_0x3e7b('0x2')]=_0x1c4342[_0x3e7b('0x2')]||'';this[_0x3e7b('0x3')]=_0x1c4342[_0x3e7b('0x3')]||'';this['Configurations']=_0x1c4342['Configurations']||{};}module[_0x3e7b('0x4')]=VtigerAccount; \ No newline at end of file +var _0x1321=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x1cb9e4,_0x2a66cd){var _0x27afe5=function(_0x37f7cc){while(--_0x37f7cc){_0x1cb9e4['push'](_0x1cb9e4['shift']());}};_0x27afe5(++_0x2a66cd);}(_0x1321,0x1ca));var _0x1132=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1321[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x468cc3){this['id']=_0x468cc3['id']||0x0;this[_0x1132('0x0')]=_0x468cc3[_0x1132('0x0')]||'';this[_0x1132('0x1')]=_0x468cc3[_0x1132('0x1')]||'';this[_0x1132('0x2')]=_0x468cc3[_0x1132('0x2')]||'';this[_0x1132('0x3')]=_0x468cc3[_0x1132('0x3')]||'';this[_0x1132('0x4')]=_0x468cc3['serverUrl']||'';this[_0x1132('0x5')]=_0x468cc3[_0x1132('0x5')]||{};}module[_0x1132('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 d8b99e2..aa66384 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 _0xee1c=['username','password','token','remoteUri','authType','type','integrationTab','Configurations'];(function(_0x3a7acc,_0x248e3e){var _0x25eb0b=function(_0x4efd67){while(--_0x4efd67){_0x3a7acc['push'](_0x3a7acc['shift']());}};_0x25eb0b(++_0x248e3e);}(_0xee1c,0x1e8));var _0xcee1=function(_0x47a491,_0x45e171){_0x47a491=_0x47a491-0x0;var _0x3b176b=_0xee1c[_0x47a491];return _0x3b176b;};'use strict';function ZendeskAccount(_0x43e690){this['id']=_0x43e690['id']||0x0;this['name']=_0x43e690['name']||'';this[_0xcee1('0x0')]=_0x43e690['username']||'';this[_0xcee1('0x1')]=_0x43e690[_0xcee1('0x1')]||'';this[_0xcee1('0x2')]=_0x43e690[_0xcee1('0x2')]||'';this[_0xcee1('0x3')]=_0x43e690[_0xcee1('0x3')]||'';this[_0xcee1('0x4')]=_0x43e690['authType']||'';this[_0xcee1('0x5')]=_0x43e690['type']||_0xcee1('0x6');this['serverUrl']=_0x43e690['serverUrl']||'';this['Configurations']=_0x43e690[_0xcee1('0x7')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xf5a4=['type','integrationTab','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x466aeb,_0x46d8c0){var _0x5073f8=function(_0x2383b5){while(--_0x2383b5){_0x466aeb['push'](_0x466aeb['shift']());}};_0x5073f8(++_0x46d8c0);}(_0xf5a4,0x1e0));var _0x4f5a=function(_0x5c2e2b,_0x8e9b19){_0x5c2e2b=_0x5c2e2b-0x0;var _0x3b10aa=_0xf5a4[_0x5c2e2b];return _0x3b10aa;};'use strict';function ZendeskAccount(_0x54bfe0){this['id']=_0x54bfe0['id']||0x0;this[_0x4f5a('0x0')]=_0x54bfe0[_0x4f5a('0x0')]||'';this[_0x4f5a('0x1')]=_0x54bfe0[_0x4f5a('0x1')]||'';this[_0x4f5a('0x2')]=_0x54bfe0[_0x4f5a('0x2')]||'';this[_0x4f5a('0x3')]=_0x54bfe0['token']||'';this[_0x4f5a('0x4')]=_0x54bfe0[_0x4f5a('0x4')]||'';this[_0x4f5a('0x5')]=_0x54bfe0[_0x4f5a('0x5')]||'';this['type']=_0x54bfe0[_0x4f5a('0x6')]||_0x4f5a('0x7');this['serverUrl']=_0x54bfe0['serverUrl']||'';this['Configurations']=_0x54bfe0[_0x4f5a('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index ebf3409..b7d669e 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 _0x3905=['host','zone','clientId','serverUrl','code','refreshToken','Configurations','name','description'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x3905,0x19c));var _0x5390=function(_0x4dbc5d,_0x2d0a51){_0x4dbc5d=_0x4dbc5d-0x0;var _0x45b461=_0x3905[_0x4dbc5d];return _0x45b461;};'use strict';function ZohoAccount(_0x21ce18){this['id']=_0x21ce18['id']||0x0;this['name']=_0x21ce18[_0x5390('0x0')]||'';this[_0x5390('0x1')]=_0x21ce18[_0x5390('0x1')]||'';this[_0x5390('0x2')]=_0x21ce18[_0x5390('0x2')]||'';this['zone']=_0x21ce18[_0x5390('0x3')]||'';this[_0x5390('0x4')]=_0x21ce18['clientId']||'';this['clientSecret']=_0x21ce18['clientSecret']||'';this[_0x5390('0x5')]=_0x21ce18[_0x5390('0x5')]||'';this['code']=_0x21ce18[_0x5390('0x6')]||'';this[_0x5390('0x7')]=_0x21ce18[_0x5390('0x7')]||'';this[_0x5390('0x8')]=_0x21ce18[_0x5390('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x6e63=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','zone','clientId'];(function(_0x2fc375,_0x157399){var _0xc5a092=function(_0x1d9fc3){while(--_0x1d9fc3){_0x2fc375['push'](_0x2fc375['shift']());}};_0xc5a092(++_0x157399);}(_0x6e63,0x74));var _0x36e6=function(_0x2893a0,_0x472eb1){_0x2893a0=_0x2893a0-0x0;var _0x96a726=_0x6e63[_0x2893a0];return _0x96a726;};'use strict';function ZohoAccount(_0x163de9){this['id']=_0x163de9['id']||0x0;this[_0x36e6('0x0')]=_0x163de9['name']||'';this['description']=_0x163de9[_0x36e6('0x1')]||'';this['host']=_0x163de9['host']||'';this['zone']=_0x163de9[_0x36e6('0x2')]||'';this[_0x36e6('0x3')]=_0x163de9[_0x36e6('0x3')]||'';this[_0x36e6('0x4')]=_0x163de9[_0x36e6('0x4')]||'';this[_0x36e6('0x5')]=_0x163de9[_0x36e6('0x5')]||'';this[_0x36e6('0x6')]=_0x163de9[_0x36e6('0x6')]||'';this[_0x36e6('0x7')]=_0x163de9[_0x36e6('0x7')]||'';this[_0x36e6('0x8')]=_0x163de9[_0x36e6('0x8')]||{};}module[_0x36e6('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 2c989f7..f8338df 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 _0x1eba=['channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','name'];(function(_0x31e59a,_0x4f1968){var _0x363cb8=function(_0x4c45b8){while(--_0x4c45b8){_0x31e59a['push'](_0x31e59a['shift']());}};_0x363cb8(++_0x4f1968);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x1eba[_0x4f2c3a];return _0x17d91c;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));function checkNameSurname(_0x2158d5,_0x3ef7ee,_0x5865fc){var _0x56c5f2='';if(!_[_0xa1eb('0x3')](_0x3ef7ee)&&_0xa1eb('0x4')===typeof _0x3ef7ee){_0x56c5f2+=_0x3ef7ee;}if(!_[_0xa1eb('0x3')](_0x5865fc)&&_0xa1eb('0x4')===typeof _0x5865fc){_0x56c5f2+='\x20'+_0x5865fc;}if(_0x56c5f2!==''){return _0x56c5f2;}return _0x2158d5;}function Action(_0x138789,_0x2933d0,_0x1d0d67,_0x2bfbb0,_0x39a5a3){this[_0xa1eb('0x5')]=_0x1d0d67||undefined;this[_0xa1eb('0x6')]=_0x138789['id'];this[_0xa1eb('0x7')]=_0x2933d0['name'];this[_0xa1eb('0x8')]=_0x2933d0['type'];this[_0xa1eb('0x9')]='queue';this[_0xa1eb('0xa')]=![];this['membername']=_[_0xa1eb('0x3')](_0x138789['Agent'])?undefined:_0x138789[_0xa1eb('0xb')][_0xa1eb('0xc')];this[_0xa1eb('0xd')]=this['membername']?util[_0xa1eb('0xe')](_0xa1eb('0xf'),this['membername']):_0x2bfbb0||undefined;this[_0xa1eb('0x10')]=checkNameSurname(_0x138789['Contact']['phone'],_0x138789[_0xa1eb('0x11')]['firstName'],_0x138789[_0xa1eb('0x11')][_0xa1eb('0x12')]);this[_0xa1eb('0x13')]=_0x138789[_0xa1eb('0x13')]||![];this[_0xa1eb('0x14')]=_0x138789[_0xa1eb('0x15')];this[_0xa1eb('0x16')]=_0x138789[_0xa1eb('0x16')];this[_0xa1eb('0x17')]=_0x138789['countbusyretry']||0x0;this[_0xa1eb('0x18')]=_0x138789['countcongestionretry']||0x0;this[_0xa1eb('0x19')]=_0x138789[_0xa1eb('0x19')]||0x0;this[_0xa1eb('0x1a')]=(_0x138789[_0xa1eb('0x17')]||0x0)+(_0x138789['countcongestionretry']||0x0)+(_0x138789[_0xa1eb('0x19')]||0x0)+(_0x138789[_0xa1eb('0x1b')]||0x0)+(_0x138789[_0xa1eb('0x1c')]||0x0)+(_0x138789[_0xa1eb('0x1d')]||0x0)+(_0x138789[_0xa1eb('0x1e')]||0x0)+(_0x138789[_0xa1eb('0x1f')]||0x0);this[_0xa1eb('0x1b')]=_0x138789[_0xa1eb('0x1b')]||0x0;this['countdropretry']=_0x138789[_0xa1eb('0x1c')]||0x0;this['countabandonedretry']=_0x138789[_0xa1eb('0x1d')]||0x0;this[_0xa1eb('0x1e')]=_0x138789[_0xa1eb('0x1e')]||0x0;this[_0xa1eb('0x1f')]=_0x138789['countagentrejectretry']||0x0;this['callback']=_0x138789[_0xa1eb('0x20')];this[_0xa1eb('0x21')]=_0x138789['callbackuniqueid'];this[_0xa1eb('0x22')]=_0x138789[_0xa1eb('0x22')];this[_0xa1eb('0x23')]=_0x138789[_0xa1eb('0x23')];this[_0xa1eb('0x24')]=_0x138789[_0xa1eb('0x24')];this[_0xa1eb('0x25')]=_0x138789[_0xa1eb('0x25')];this[_0xa1eb('0x26')]=_[_0xa1eb('0x3')](_0x138789[_0xa1eb('0xb')])?_0x138789[_0xa1eb('0x26')]:_0x138789['Agent']['id'];this[_0xa1eb('0x27')]=_0x138789[_0xa1eb('0x27')];this['originatecalleridnum']='';this[_0xa1eb('0x28')]='';}Action['prototype'][_0xa1eb('0x29')]=function(){return util[_0xa1eb('0xe')]('\x22%s\x22\x20<%s>',this[_0xa1eb('0x10')],this[_0xa1eb('0x2a')]);};module[_0xa1eb('0x2b')]=Action; \ No newline at end of file +var _0x7334=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone'];(function(_0x45b479,_0x3e6574){var _0x1c3cbe=function(_0xd53e52){while(--_0xd53e52){_0x45b479['push'](_0x45b479['shift']());}};_0x1c3cbe(++_0x3e6574);}(_0x7334,0x184));var _0x4733=function(_0x2b8a13,_0x41599c){_0x2b8a13=_0x2b8a13-0x0;var _0x58f5a3=_0x7334[_0x2b8a13];return _0x58f5a3;};'use strict';var util=require(_0x4733('0x0'));var _=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));function checkNameSurname(_0x5016ad,_0x59882e,_0x26b8f3){var _0x4b8b5a='';if(!_[_0x4733('0x3')](_0x59882e)&&_0x4733('0x4')===typeof _0x59882e){_0x4b8b5a+=_0x59882e;}if(!_[_0x4733('0x3')](_0x26b8f3)&&_0x4733('0x4')===typeof _0x26b8f3){_0x4b8b5a+='\x20'+_0x26b8f3;}if(_0x4b8b5a!==''){return _0x4b8b5a;}return _0x5016ad;}function Action(_0x2b146d,_0x449ead,_0x16d7cc,_0x283754,_0x12cafa){this[_0x4733('0x5')]=_0x16d7cc||undefined;this[_0x4733('0x6')]=_0x2b146d['id'];this[_0x4733('0x7')]=_0x449ead[_0x4733('0x8')];this[_0x4733('0x9')]=_0x449ead[_0x4733('0x9')];this[_0x4733('0xa')]=_0x4733('0x7');this['dialAnswer']=![];this[_0x4733('0xb')]=_[_0x4733('0x3')](_0x2b146d['Agent'])?undefined:_0x2b146d[_0x4733('0xc')]['name'];this[_0x4733('0xd')]=this[_0x4733('0xb')]?util[_0x4733('0xe')](_0x4733('0xf'),this[_0x4733('0xb')]):_0x283754||undefined;this[_0x4733('0x10')]=checkNameSurname(_0x2b146d[_0x4733('0x11')]['phone'],_0x2b146d[_0x4733('0x11')]['firstName'],_0x2b146d[_0x4733('0x11')][_0x4733('0x12')]);this[_0x4733('0x13')]=_0x2b146d[_0x4733('0x13')]||![];this[_0x4733('0x14')]=_0x2b146d[_0x4733('0x15')];this[_0x4733('0x16')]=_0x2b146d[_0x4733('0x16')];this[_0x4733('0x17')]=_0x2b146d['countbusyretry']||0x0;this[_0x4733('0x18')]=_0x2b146d[_0x4733('0x18')]||0x0;this['countnoanswerretry']=_0x2b146d[_0x4733('0x19')]||0x0;this[_0x4733('0x1a')]=(_0x2b146d[_0x4733('0x17')]||0x0)+(_0x2b146d[_0x4733('0x18')]||0x0)+(_0x2b146d['countnoanswerretry']||0x0)+(_0x2b146d['countnosuchnumberretry']||0x0)+(_0x2b146d[_0x4733('0x1b')]||0x0)+(_0x2b146d[_0x4733('0x1c')]||0x0)+(_0x2b146d['countmachineretry']||0x0)+(_0x2b146d[_0x4733('0x1d')]||0x0);this[_0x4733('0x1e')]=_0x2b146d[_0x4733('0x1e')]||0x0;this[_0x4733('0x1b')]=_0x2b146d['countdropretry']||0x0;this[_0x4733('0x1c')]=_0x2b146d[_0x4733('0x1c')]||0x0;this['countmachineretry']=_0x2b146d[_0x4733('0x1f')]||0x0;this[_0x4733('0x1d')]=_0x2b146d['countagentrejectretry']||0x0;this[_0x4733('0x20')]=_0x2b146d[_0x4733('0x20')];this[_0x4733('0x21')]=_0x2b146d[_0x4733('0x21')];this[_0x4733('0x22')]=_0x2b146d[_0x4733('0x22')];this[_0x4733('0x23')]=_0x2b146d[_0x4733('0x23')];this['ContactId']=_0x2b146d[_0x4733('0x24')];this[_0x4733('0x25')]=_0x2b146d[_0x4733('0x25')];this[_0x4733('0x26')]=_[_0x4733('0x3')](_0x2b146d[_0x4733('0xc')])?_0x2b146d[_0x4733('0x26')]:_0x2b146d[_0x4733('0xc')]['id'];this[_0x4733('0x27')]=_0x2b146d[_0x4733('0x27')];this['originatecalleridnum']='';this[_0x4733('0x28')]='';}Action['prototype']['getCaller']=function(){return util[_0x4733('0xe')]('\x22%s\x22\x20<%s>',this[_0x4733('0x10')],this['number']);};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 6a3f2ea..4be6136 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 _0x70e0=['[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','callProgressDetectingAgent','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','../../../config/environment','../../../config/logger','preview','../ami','../rpc/cmHopperAdditionalPhone','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','hangup','syncHangup','syncHangupRequest','bind','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','info','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','paused','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','CAMPAIGN_STATUS','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','type','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','enqueue','[clearZombieChannels][talking]','Queue','queue','pick','UserId','VoiceQueueId','ListId','status','catch','message','No\x20such\x20channel','updateOriginated','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','[action]','recallMe','agentReadyId','agents','isNil','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','dialActive','isTrunkReachable','Trunk','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','dialGlobalMaxRetry','dialBusyMaxRetry','rescheduleContact','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','queueSummaryCountersUpdated','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','Contact','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','unlockContact','getContactPreview','recallme','phone','checkInBlack'];(function(_0x524756,_0xaae98a){var _0x1a3286=function(_0x53d335){while(--_0x53d335){_0x524756['push'](_0x524756['shift']());}};_0x1a3286(++_0xaae98a);}(_0x70e0,0x17b));var _0x070e=function(_0x5b78f3,_0x1e2229){_0x5b78f3=_0x5b78f3-0x0;var _0x26d00b=_0x70e0[_0x5b78f3];return _0x26d00b;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var uuid=require(_0x070e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x070e('0x3'));var logger=require(_0x070e('0x4'))(_0x070e('0x5'));var loggerAction=require(_0x070e('0x4'))('actionPreview');var ami=require(_0x070e('0x6'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x070e('0x7'));var Action=require('./action');var ut=require('./util/util');var utils=require('../dialer/utils');config[_0x070e('0x8')]=_[_0x070e('0x9')](config[_0x070e('0x8')],{'host':_0x070e('0xa'),'port':0x18eb});var io=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x8')]));var Sequence=function(){};Sequence[_0x070e('0xc')]['enqueue']=function(_0x49b2fb){this[_0x070e('0xd')]=this[_0x070e('0xd')]?this[_0x070e('0xd')][_0x070e('0xe')](_0x49b2fb):_0x49b2fb();};function Preview(_0xa927a2){this[_0x070e('0xf')]=new Sequence();this[_0x070e('0x10')]=_0xa927a2[_0x070e('0x11')];this[_0x070e('0x12')]=_0xa927a2[_0x070e('0x12')];this[_0x070e('0x13')]={};this['agents']=_0xa927a2['agents'];this[_0x070e('0x14')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0x070e('0x15'),this[_0x070e('0x16')]['bind'](this));ami['on']('hanguprequest',this[_0x070e('0x17')][_0x070e('0x18')](this));ami['on'](_0x070e('0x19'),this[_0x070e('0x1a')]['bind'](this));ami['on']('newexten',this[_0x070e('0x1b')][_0x070e('0x18')](this));ami['on'](_0x070e('0x1c'),this[_0x070e('0x1d')][_0x070e('0x18')](this));ami['on']('attendedtransfer',this[_0x070e('0x1e')][_0x070e('0x18')](this));ami['on'](_0x070e('0x1f'),this[_0x070e('0x20')][_0x070e('0x18')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x4e958f,_0x9907cf,_0x3004f0){io['to'](_0x4e958f)[_0x070e('0x21')](_0x9907cf,_0x3004f0);}function emitVoiceQueueChannelRemove(_0x4be0d7){logger[_0x070e('0x22')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x070e('0x23')](_0x4be0d7));emit(util[_0x070e('0x24')](_0x070e('0x25'),_0x4be0d7[_0x070e('0x26')]),_0x070e('0x27'),_0x4be0d7);io[_0x070e('0x21')](_0x070e('0x28'),_0x4be0d7);}function notSendMessagesQueue(_0x164cdf){if(_0x164cdf['sendMessageOneNotActive']){if(_0x164cdf[_0x070e('0x29')]===0x0&&_0x164cdf[_0x070e('0x2a')]===0x0){_0x164cdf[_0x070e('0x2b')]=![];_0x164cdf['available']=0x0;_0x164cdf[_0x070e('0x2c')]=0x0;_0x164cdf['message']=utils['CAMPAIGN_STATUS'][_0x070e('0x2d')];ut[_0x070e('0x2e')](_0x070e('0x2f'),_0x164cdf[_0x070e('0x26')]+_0x070e('0x30'));}else{_0x164cdf['message']=utils[_0x070e('0x31')][_0x070e('0x32')];ut[_0x070e('0x2e')](_0x070e('0x2f'),_0x164cdf[_0x070e('0x26')]+_0x070e('0x33'));}}}Preview[_0x070e('0xc')][_0x070e('0x34')]=function(){var _0x5e8326=this;setInterval(function(){_0x5e8326[_0x070e('0x35')]();},0x7cf);};Preview[_0x070e('0xc')][_0x070e('0x35')]=function(){var _0x56fc12=this['campaignsPreview'];this[_0x070e('0x14')]+=0x1;for(var _0x46065c in _0x56fc12){if(_0x56fc12[_0x070e('0x36')](_0x46065c)&&(_0x56fc12[_0x46065c]['dialMethod']===_0x070e('0x5')||_0x56fc12[_0x46065c][_0x070e('0x37')]===_0x070e('0x38'))&&_0x56fc12[_0x46065c][_0x070e('0x39')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x56fc12[_0x070e('0x36')](_0x46065c)&&_0x56fc12[_0x46065c]['dialMethod']===_0x070e('0x5')&&_0x56fc12[_0x46065c][_0x070e('0x39')]==='outbound'){if(_0x56fc12[_0x46065c]['dialActive']){this[_0x070e('0x3a')](_0x56fc12[_0x46065c]);if(_0x56fc12[_0x46065c][_0x070e('0x3b')])this['recallMe'](_0x56fc12[_0x46065c]);}else{notSendMessagesQueue(_0x56fc12[_0x46065c]);}}}};Preview['prototype'][_0x070e('0x3c')]=function(_0x27dd1f){var _0x444d02=this;this[_0x070e('0xf')][_0x070e('0x3d')](function(){if(!_['isNil'](_0x444d02['actions'][_0x27dd1f])){loggerAction[_0x070e('0x22')](_0x070e('0x3e'),_0x27dd1f,_0x070e('0x3f'),_0x444d02[_0x070e('0x13')][_0x27dd1f][_0x070e('0x40')],'originated:\x20',JSON[_0x070e('0x23')](_0x444d02[_0x070e('0x10')][_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]][_0x070e('0x29')]),'pTalking:\x20',JSON['stringify'](_0x444d02['campaignsPreview'][_0x444d02[_0x070e('0x13')][_0x27dd1f][_0x070e('0x40')]][_0x070e('0x2a')]),JSON[_0x070e('0x23')](_0x444d02[_0x070e('0x13')][_0x27dd1f]['dialAnswer']),JSON[_0x070e('0x23')](_[_0x070e('0x41')](_0x444d02[_0x070e('0x13')][_0x27dd1f],['contactId',_0x070e('0x42'),_0x070e('0x43'),_0x070e('0x44')])));return ami['Action']({'action':_0x070e('0x45'),'channel':_0x444d02[_0x070e('0x13')][_0x27dd1f]['channel']})[_0x070e('0x46')](function(_0x5d689b){if(_0x5d689b[_0x070e('0x47')]===_0x070e('0x48')){setTimeout(function(){if(_0x444d02[_0x070e('0x13')][_0x27dd1f]){ut[_0x070e('0x49')](_0x444d02[_0x070e('0x10')][_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]],'[clearZombieChannel]');if(_0x444d02['actions'][_0x27dd1f][_0x070e('0x4a')]===!![]){ut[_0x070e('0x4b')](_0x444d02[_0x070e('0x10')][_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]],_0x070e('0x4c'));ut[_0x070e('0x4d')](_0x070e('0x4e')+_0x27dd1f,_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x27dd1f,_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]);delete _0x444d02[_0x070e('0x13')][_0x27dd1f];}},0x2328);}});}});};Preview[_0x070e('0xc')][_0x070e('0x4f')]=function(){var _0x34f23e=this;loggerAction['info'](_0x070e('0x50'),_['size'](this[_0x070e('0x13')]));for(var _0x42245d in this[_0x070e('0x13')]){if(_0x34f23e['actions']['hasOwnProperty'](_0x42245d)){_0x34f23e[_0x070e('0x3c')](_0x42245d);}}};Preview['prototype'][_0x070e('0x51')]=function(_0x3fdb75){var _0x139820=this;rpcDb['getContactRecallMe'](_0x3fdb75['id'],ut[_0x070e('0x52')](this[_0x070e('0x53')]))['then'](function(_0x589b97){if(!_[_0x070e('0x54')](_0x589b97)){for(var _0x945901=0x0;_0x945901<_0x589b97[_0x070e('0x55')];_0x945901+=0x1){if(ut[_0x070e('0x56')](_0x589b97[_0x945901][_0x070e('0x57')])<_0x3fdb75['dialRecallMeTimeout']*0x3c){if(_0x589b97[_0x945901][_0x070e('0x58')]&&!_0x589b97[_0x945901][_0x070e('0x58')][_0x070e('0x59')]){_0x139820[_0x070e('0x5a')](_0x589b97[_0x945901]['id'])[_0x070e('0x5b')](ut[_0x070e('0x5c')](_0x070e('0x5d')))[_0x070e('0x46')](ut[_0x070e('0x5c')](_0x070e('0x5d')));}else{rpcDb[_0x070e('0x5e')](_0x589b97[_0x945901]['id']);}}else{var _0x3be553=new Action(_0x589b97[_0x945901],_0x3fdb75);_0x3be553[_0x070e('0x5f')]=moment()[_0x070e('0x24')](_0x070e('0x60'));_0x3fdb75['outboundReCallsDay']+=0x1;ut[_0x070e('0x61')](_0x3be553,0x17,_0x070e('0x62'));if(_0x3fdb75[_0x070e('0x63')]){rpcDb[_0x070e('0x64')](ut[_0x070e('0x65')](_0x589b97[_0x945901]));rpcDb[_0x070e('0x66')](_0x3be553,_0x070e('0x67'));}else{ut[_0x070e('0x61')](_0x3be553,0x16,_0x070e('0x68'));rpcDb['createCustomerHistory'](_0x3be553,_0x070e('0x69'));rpcDb['createCustomerFinal'](_0x3be553,_0x070e('0x69'));}}}}})[_0x070e('0x46')](ut['logger2'](_0x070e('0x6a')));};Preview[_0x070e('0xc')][_0x070e('0x3a')]=function(_0xa74805){_0xa74805[_0x070e('0x2b')]=!![];if(ut[_0x070e('0x6b')](_0xa74805[_0x070e('0x6c')])){_0xa74805['message']=utils[_0x070e('0x31')]['NO_AGENTS_LOGGED'];}else if(!ut['isActive'](_0xa74805[_0x070e('0x6d')])){_0xa74805[_0x070e('0x47')]=utils[_0x070e('0x31')][_0x070e('0x2d')];}else if(!this[_0x070e('0x6e')](_0xa74805[_0x070e('0x6f')])){if(!this[_0x070e('0x6e')](_0xa74805[_0x070e('0x70')])){_0xa74805['message']=utils[_0x070e('0x31')]['UNREACHABLE_TRUNK'];}else{_0xa74805['message']=utils[_0x070e('0x31')][_0x070e('0x71')];}}else{_0xa74805['message']=utils[_0x070e('0x31')][_0x070e('0x71')];}};Preview[_0x070e('0xc')][_0x070e('0x72')]=function(_0x1aacfc,_0x382ce3,_0x1b36cd){var _0x4ef647=this;var _0x5874cd=this['actions'][_0x382ce3];var _0x3087e5=this[_0x070e('0x10')][_0x5874cd[_0x070e('0x40')]];var _0x2f8fcb;var _0x5ac0b5=![];var _0x25f34c=0x2;var _0x5d3c3a=0x3;if(_0x3087e5){switch(_0x1b36cd){case'1':_0x3087e5[_0x070e('0x73')]+=0x1;_0x5874cd[_0x070e('0x74')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x0,_0x070e('0x77'));ami['emit'](_0x070e('0x78'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0x7a')));rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0x7b'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'0',_0x3087e5)['then'](function(_0x1f1df5){_0x5ac0b5=_0x1f1df5['additional']==0x1;_0x25f34c=_0x3087e5[_0x070e('0x7d')];_0x5d3c3a=_0x3087e5['callAdditionalPhoneAfterMin'];if(!_0x5ac0b5){if(ut['totalGlobal'](_0x5874cd)>=_0x3087e5['dialGlobalMaxRetry']){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0x81'));}else{if(_0x5874cd[_0x070e('0x74')]>=_0x3087e5[_0x070e('0x82')]){rpcDb['createCustomerFinal'](_0x5874cd,_0x070e('0x81'));}else{rpcDb['rescheduleContact'](ut[_0x070e('0x83')](_0x5874cd,'countnosuchnumberretry',_0x3087e5[_0x070e('0x7d')]),_0x5874cd[_0x070e('0x84')],_0x5874cd['activeContact']);}}delete this[_0x070e('0x13')][_0x1aacfc['linkedid']];}else{_0x5874cd[_0x070e('0x74')]++;logger[_0x070e('0x22')](_0x070e('0x85'),_0x5874cd[_0x070e('0x74')]);logger[_0x070e('0x22')]('id',_0x5874cd[_0x070e('0x86')]);_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnosuchnumberretry':_0x5874cd[_0x070e('0x74')]}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0x89'):var _0x20bcf3=moment()['format'](_0x070e('0x60'));_0x5874cd[_0x070e('0x8a')]=_0x20bcf3;_0x5874cd[_0x070e('0x8b')]=_0x20bcf3;_0x5874cd[_0x070e('0x4a')]=!![];_0x3087e5['pTalking']+=0x1;logger[_0x070e('0x22')](_0x070e('0x8c'),_0x5874cd[_0x070e('0x8d')],_0x070e('0x8e'),_0x3087e5[_0x070e('0x26')],_0x070e('0x8f'),_0x3087e5['pTalking']);ami[_0x070e('0x21')](_0x070e('0x90'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0x91'),this['campaignsPreview'][_0x5874cd[_0x070e('0x40')]]));if(_0x3087e5['acw']){ami[_0x070e('0x21')](_0x070e('0x92'),ut[_0x070e('0x93')](_0x5874cd));}break;case'16':ami[_0x070e('0x21')](_0x070e('0x94'),ut['buildObj'](_0x5874cd,_0x070e('0x95'),this[_0x070e('0x10')][_0x5874cd[_0x070e('0x40')]]));emitVoiceQueueChannelRemove(ut[_0x070e('0x79')](_0x5874cd,'complete'));_0x3087e5[_0x070e('0x96')]+=0x1;_0x3087e5['total']+=0x1;_0x3087e5[_0x070e('0x97')]+=0x1;ut[_0x070e('0x4b')](_0x3087e5,_0x070e('0x98'));_0x5874cd['countglobal']=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x4,_0x070e('0x99'));rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0x9a'));rpcDb[_0x070e('0x80')](_0x5874cd,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x070e('0x9b')](_0x5874cd);_0x3087e5['sumDuration']+=_0x5874cd[_0x070e('0x9c')];_0x3087e5[_0x070e('0x9d')]+=_0x5874cd['talktime'];logger['info'](_0x070e('0x9e'),_0x5874cd[_0x070e('0x8d')],_0x070e('0x8e'),_0x3087e5[_0x070e('0x26')],_0x070e('0x8f'),_0x3087e5[_0x070e('0x2a')]);delete this[_0x070e('0x13')][_0x1aacfc[_0x070e('0x9f')]];break;case _0x070e('0xa0'):_0x3087e5[_0x070e('0xa1')]+=0x1;_0x5874cd[_0x070e('0xa2')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x5,_0x070e('0xa3'));_0x25f34c=_0x3087e5[_0x070e('0xa4')];_0x5d3c3a=_0x3087e5['callAdditionalPhoneAfterMin'];ami['emit'](_0x070e('0xa5'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0xa6')));rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xa7'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'5',_0x3087e5)[_0x070e('0x5b')](function(_0x110813){_0x5ac0b5=_0x110813[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb['createCustomerFinal'](_0x2f8fcb,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5874cd['countbusyretry']>=_0x3087e5[_0x070e('0xaa')]){rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xa7'));}else{rpcDb[_0x070e('0xab')](ut['scheduledAt'](_0x5874cd,_0x070e('0xa2'),_0x3087e5[_0x070e('0xa4')]),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xa2')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd['idContact'],'field':{'countbusyretry':_0x5874cd[_0x070e('0xa2')]}})['then'](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0xad'):_0x3087e5[_0x070e('0xae')]+=0x1;_0x5874cd[_0x070e('0xaf')]+=0x1;_0x5874cd['countglobal']=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x3,'NoAnswer');_0x25f34c=_0x3087e5[_0x070e('0xb0')];_0x5d3c3a=_0x3087e5[_0x070e('0xb1')];var _0x553ea1=ut[_0x070e('0xb2')](_0x5874cd,_0x3087e5);ami[_0x070e('0x21')](_0x070e('0xb3'),_0x553ea1);rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0xb4'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'3',_0x3087e5)[_0x070e('0x5b')](function(_0x1ad0bf){_0x5ac0b5=_0x1ad0bf[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xb5'));}else{if(_0x5874cd[_0x070e('0xaf')]>=_0x3087e5[_0x070e('0xb6')]){rpcDb['createCustomerFinal'](_0x5874cd,_0x070e('0xb4'));}else{rpcDb[_0x070e('0xab')](ut[_0x070e('0x83')](_0x5874cd,_0x070e('0xaf'),_0x3087e5[_0x070e('0xb0')]),_0x5874cd[_0x070e('0x84')],_0x5874cd['activeContact']);}}}else{_0x5874cd['countnoanswerretry']++;_0x4ef647['incrementPreviewCounters']({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd[_0x070e('0xaf')]}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)['then'](function(){});});}});break;case _0x070e('0xb7'):_0x3087e5[_0x070e('0xb8')]+=0x1;_0x5874cd[_0x070e('0xb9')]+=0x1;_0x5874cd['countglobal']=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x8,_0x070e('0xba'));_0x25f34c=_0x3087e5[_0x070e('0xbb')];_0x5d3c3a=_0x3087e5['callAdditionalPhoneAfterMin'];ami['emit'](_0x070e('0xbc'),ut[_0x070e('0x79')](_0x5874cd,'congestion'));rpcDb[_0x070e('0x66')](_0x5874cd,'[callProgressDetectingCustomer][logCongestion]');_0x4ef647['verifyAdditionalPhones'](_0x5874cd,'8',_0x3087e5)['then'](function(_0x15480c){_0x5ac0b5=_0x15480c[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xbd'));}else{if(_0x5874cd[_0x070e('0xb9')]>=_0x3087e5[_0x070e('0xbe')]){rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xbf'));}else{rpcDb[_0x070e('0xab')](ut[_0x070e('0x83')](_0x5874cd,_0x070e('0xb9'),_0x3087e5[_0x070e('0xa4')]),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xb9')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countcongestionretry':_0x5874cd[_0x070e('0xb9')]}})['then'](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0xc0'):_0x3087e5[_0x070e('0xc1')]+=0x1;_0x5874cd['countagentrejectretry']+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x14,_0x070e('0xc2'));_0x25f34c=_0x3087e5[_0x070e('0xc3')];_0x5d3c3a=_0x3087e5[_0x070e('0xb1')];ami['emit']('custom:agentreject',ut['buildObj'](_0x5874cd,_0x070e('0xc4')));rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0xc5'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'20',_0x3087e5)['then'](function(_0x912f24){_0x5ac0b5=_0x912f24[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut['totalGlobal'](_0x5874cd)>=_0x3087e5['dialGlobalMaxRetry']){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0x14,_0x070e('0xc2'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xc6'));}else{if(_0x5874cd[_0x070e('0xc7')]>=_0x3087e5['dialAgentRejectMaxRetry']){rpcDb[_0x070e('0x80')](_0x5874cd,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x070e('0xab')](ut[_0x070e('0x83')](_0x5874cd,'countagentrejectretry',_0x3087e5[_0x070e('0xc3')]),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd['countnoanswerretry']}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0xc8'):_0x3087e5[_0x070e('0xc9')]+=0x1;_0x5874cd['countabandonedretry']+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0xb,_0x070e('0xca'));rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xcb'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'11',_0x3087e5)[_0x070e('0x5b')](function(_0x1fb1e6){_0x5ac0b5=_0x1fb1e6[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xcb'));}else{if(_0x5874cd['countabandonedetry']>=_0x3087e5['dialAbandonedMaxRety']){rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xcb'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5874cd,'countabandonedretry',_0x3087e5['dialAbandonedRetryFrequency']),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd[_0x070e('0xaf')]}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case'18':_0x3087e5[_0x070e('0xcc')]+=0x1;_0x5874cd['countmachineretry']+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x12,_0x1aacfc[_0x070e('0xcd')]||_0x1aacfc[_0x070e('0xce')]);ami[_0x070e('0x21')](_0x070e('0xcf'),ut['buildObj'](_0x5874cd,_0x070e('0xd0')));rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xd1'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'18',_0x3087e5)['then'](function(_0x4096ae){_0x5ac0b5=_0x4096ae[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0x12,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xd1'));}else{rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xd1'));}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647['incrementPreviewCounters']({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd[_0x070e('0xaf')]}})['then'](function(){_0x4ef647['swapAdditionalPhones'](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});delete this['actions'][_0x1aacfc[_0x070e('0x9f')]];break;case'19':_0x3087e5[_0x070e('0xcc')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x13,_0x1aacfc[_0x070e('0xcd')]||_0x1aacfc[_0x070e('0xce')]);ami['emit'](_0x070e('0xcf'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0xd0')));rpcDb[_0x070e('0x66')](_0x5874cd,'[callProgressDetectingCustomer][machine]');_0x4ef647['verifyAdditionalPhones'](_0x5874cd,'18',_0x3087e5)[_0x070e('0x5b')](function(_0x205305){_0x5ac0b5=_0x205305[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut['totalGlobal'](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,'Global');rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xd2'));}else{rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xd2'));}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd['idContact'],'field':{'countnoanswerretry':_0x5874cd['countnoanswerretry']}})[_0x070e('0x5b')](function(){_0x4ef647['swapAdditionalPhones'](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});delete this[_0x070e('0x13')][_0x1aacfc['linkedid']];break;default:if(_0x5874cd[_0x070e('0x4a')]){ut['decrementTalkink'](_0x3087e5,_0x070e('0xd3'));ut[_0x070e('0x4d')](_0x070e('0xd4')+_0x3087e5[_0x070e('0x26')],_0x1aacfc);}_0x3087e5[_0x070e('0xcc')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut['totalGlobal'](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0xc,_0x1aacfc[_0x070e('0xcd')]||_0x1aacfc['dialstatus']);_0x25f34c=_0x3087e5['dialAgentRejectRetryFrequency'];_0x5d3c3a=_0x3087e5[_0x070e('0xb1')];rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xd5'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'20',_0x3087e5)[_0x070e('0x5b')](function(_0x3e2c30){_0x5ac0b5=_0x3e2c30[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5['dialGlobalMaxRetry']){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xd6'));}else{rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xd6'));}delete this[_0x070e('0x13')][_0x1aacfc[_0x070e('0x9f')]];}else{_0x4ef647['swapAdditionalPhones'](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});}});}if(!(_0x5874cd[_0x070e('0x4a')]&&_0x1b36cd==='16')){ut[_0x070e('0x49')](_0x3087e5,_0x070e('0xd7'));logger[_0x070e('0x22')](_0x070e('0xd8'),_0x5874cd[_0x070e('0x8d')],_0x070e('0x8e'),_0x3087e5[_0x070e('0x26')],_0x070e('0xd9'),_0x3087e5['originated']);}if(_0x1b36cd!=='ANSWER'){delete this[_0x070e('0x13')][_0x1aacfc[_0x070e('0x9f')]];delete this[_0x070e('0x13')][_0x1aacfc['destlinkedid']];}_0x3087e5[_0x070e('0xda')]=!![];}};Preview[_0x070e('0xc')]['callProgressDetectingAgent']=function(_0x26901c,_0x2b6909,_0x2f34b9){if(_[_0x070e('0xdb')](_0x2b6909)&&_0x070e('0xdc')!==typeof _0x2b6909){return;}if(_[_0x070e('0xdb')](_0x2f34b9)&&'object'!==typeof _0x2f34b9){return;}switch(_0x2f34b9['reason']){case'0':ut[_0x070e('0xdd')](_0x26901c,0x0,_0x070e('0x77'));rpcDb['createAgentHistory'](_0x26901c,_0x070e('0xde'));break;case'3':ut[_0x070e('0xdd')](_0x26901c,0x3,_0x070e('0xdf'));rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe1'));break;case'5':ut[_0x070e('0xdd')](_0x26901c,0x5,'Busy');rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe2'));break;case'8':ut['logAgent'](_0x26901c,0x8,_0x070e('0xba'));rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe3'));break;case'22':ut[_0x070e('0xdd')](_0x26901c,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x26901c,_0x070e('0xe4'));break;default:ut[_0x070e('0xdd')](_0x26901c,0xc,_0x2f34b9[_0x070e('0xe5')]);rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe3'));}ut[_0x070e('0x49')](_0x2b6909,_0x070e('0xe6'));logger[_0x070e('0x22')](_0x070e('0xe7'),_0x26901c[_0x070e('0x8d')],'\x20Queue',_0x2b6909[_0x070e('0x26')],_0x070e('0xd9'),_0x2b6909[_0x070e('0x29')]);delete this[_0x070e('0x13')][_0x26901c['uniqueid']];};Preview[_0x070e('0xc')][_0x070e('0x7c')]=function(_0x510bce,_0x4b559b,_0x27c346){return cmHopperAdditionalPhone[_0x070e('0x7c')](_0x510bce,_0x4b559b,_0x27c346)[_0x070e('0x46')](logger['info'](_0x070e('0xe8')));};Preview[_0x070e('0xc')][_0x070e('0x88')]=function(_0x2e21cf,_0x34b5ae,_0x5605da){return cmHopperAdditionalPhone[_0x070e('0x88')](_0x2e21cf,_0x34b5ae,_0x5605da)[_0x070e('0x46')](logger['info'](_0x070e('0xe9')));};Preview['prototype']['incrementPreviewCounters']=function(_0x48b0aa){return Promise[_0x070e('0xea')]()[_0x070e('0x5b')](cmHopperAdditionalPhone[_0x070e('0x87')](_0x48b0aa))[_0x070e('0x46')](logger['info'](_0x070e('0xeb')));};Preview[_0x070e('0xc')]['checkInBlack']=function(_0x3c6a6e,_0xa9694a,_0x24448e,_0x41afe5,_0x4ea0a6){var _0x445182=this;return new Promise(function(_0x50fbb4,_0x40ff1b){if(_['isNil'](_0xa9694a)||_[_0x070e('0x54')](_0xa9694a[_0x070e('0xec')])||_[_0x070e('0x54')](_0xa9694a['phone'])||_[_0x070e('0x54')](_0xa9694a[_0x070e('0x43')])){_0x40ff1b(ut[_0x070e('0x47')]('Contact\x20is\x20undefined',_0x41afe5,_0x4ea0a6));return;}var _0xbaed32=uuid['v4']();var _0x3a5086=_0x445182['campaignsPreview'][_0xa9694a[_0x070e('0x3f')][_0x070e('0x26')]];var _0x478e5b=_0x24448e?_0x445182['agents'][_0x24448e]['id']:undefined;_0x445182['actions'][_0xbaed32]=new Action(_0xa9694a,_0x3a5086,_0xbaed32,_0x24448e,_0x478e5b);var _0x5e1fee=_0x445182[_0x070e('0x13')][_0xbaed32];_0x5e1fee[_0x070e('0x84')]=_0x41afe5;_0x5e1fee[_0x070e('0xac')]=_0x4ea0a6;_0x5e1fee[_0x070e('0xed')]=_0x24448e;if(_[_0x070e('0xee')](_0x3c6a6e)){_0x445182[_0x070e('0xef')](_0x5e1fee,_0x3a5086,_0xa9694a,_0x24448e)[_0x070e('0x5b')](function(_0x472fc9){logger['info']('[Preview][execCall][success]','Queue:\x20'+_0x5e1fee['queue']+_0x070e('0xf0')+_0x5e1fee[_0x070e('0x86')],JSON[_0x070e('0x23')](_0x472fc9));ami[_0x070e('0x21')](_0x070e('0xf1'),ut['buildObj'](_0x5e1fee,'called',_0x445182[_0x070e('0x10')][_0x5e1fee[_0x070e('0x40')]]));_0x50fbb4(ut['message'](_0x070e('0xf2')));})[_0x070e('0x46')](function(_0x239385){ut[_0x070e('0x2e')](_0x070e('0xf3'),_0x239385);_0x40ff1b(ut[_0x070e('0x47')]('Call\x20failed',_0x41afe5,_0x4ea0a6));});}else{_0x3a5086[_0x070e('0xf4')]+=0x1;ut[_0x070e('0xf5')](_0x5e1fee);rpcDb[_0x070e('0xf6')](_0x5e1fee,'[Blacklist][error]');delete _0x445182[_0x070e('0x13')][_0xbaed32];_0x40ff1b(ut[_0x070e('0x47')](_0x070e('0xf7'),_0x41afe5,_0x4ea0a6));}});};Preview[_0x070e('0xc')]['isTrunkReachable']=function(_0x4175b9){return!_[_0x070e('0x54')](_0x4175b9)&&!_['isNil'](_0x4175b9[_0x070e('0x26')])&&!_[_0x070e('0x54')](_0x4175b9['active'])&&_0x4175b9[_0x070e('0xf8')]&&!_['isNil'](this[_0x070e('0x12')][util['format'](_0x070e('0xf9'),_0x4175b9['name'])])&&!_['isNil'](this[_0x070e('0x12')][util['format']('SIP/%s',_0x4175b9[_0x070e('0x26')])][_0x070e('0x45')])&&(this[_0x070e('0x12')][util[_0x070e('0x24')](_0x070e('0xf9'),_0x4175b9['name'])][_0x070e('0x45')]===_0x070e('0xfa')||this[_0x070e('0x12')][util[_0x070e('0x24')](_0x070e('0xf9'),_0x4175b9[_0x070e('0x26')])]['status']===_0x070e('0xfb'));};Preview[_0x070e('0xc')][_0x070e('0x5a')]=function(_0x44c780,_0x5817a0){return this['execRun'](_0x44c780,_0x5817a0)[_0x070e('0x5b')](function(_0x324641){return _[_0x070e('0x41')](_0x324641,[_0x070e('0x47')]);})[_0x070e('0x46')](function(_0x150ff2){if(_0x150ff2['unlock']){rpcDb[_0x070e('0xfc')](_0x44c780);}if(_0x150ff2[_0x070e('0xf8')]){rpcDb[_0x070e('0x5e')](_0x44c780);}throw _[_0x070e('0x41')](_0x150ff2,[_0x070e('0x47')]);});};Preview[_0x070e('0xc')]['execRun']=function(_0x4aabc3,_0x9b1fb1){var _0x43e514=this;var _0x193c72,_0x150bfb;return rpcDb[_0x070e('0xfd')](_0x4aabc3)[_0x070e('0x5b')](function(_0x257569){if(!_['isNil'](_0x257569[0x0])){_0x150bfb=_0x257569[0x0][_0x070e('0xfe')]?![]:!![];_0x193c72=_0x257569[0x0]['recallme']?!![]:![];_0x193c72=_0x9b1fb1?!![]:_0x193c72;}var _0xfe12a6=_0x43e514['validateContact'](_0x257569);if(_0xfe12a6['isValid']){rpcDb['checkIsBlackList'](_[_0x070e('0x41')](_0x257569[0x0],[_0x070e('0x43'),_0x070e('0xff')]))[_0x070e('0x5b')](function(_0xec8bee){_0x43e514[_0x070e('0x100')](_0xec8bee,_0x257569[0x0],_0x9b1fb1,_0x150bfb,_0x193c72)[_0x070e('0x5b')](function(_0x37285d){return _0x37285d;})[_0x070e('0x46')](function(_0x538bd4){throw _0x538bd4;});})[_0x070e('0x46')](function(_0x170efa){ut[_0x070e('0x2e')](_0x070e('0x101'),_0x170efa);throw ut[_0x070e('0x47')](_0x070e('0x102'),_0x150bfb,_0x193c72);});}else{throw ut[_0x070e('0x47')](_0xfe12a6[_0x070e('0x47')],_0x150bfb,_0x193c72);}})[_0x070e('0x46')](function(_0x4ad025){ut['logger'](_0x070e('0x103'),_0x4ad025);throw ut[_0x070e('0x47')]('Call\x20unsuccessful',![],!![]);});};Preview[_0x070e('0xc')]['validateContact']=function(_0x48d26c){if(_[_0x070e('0x54')](_0x48d26c)||_[_0x070e('0xee')](_0x48d26c)||!_['isNil'](_0x48d26c[0x0][_0x070e('0x58')])&&_[_0x070e('0x54')](_0x48d26c[0x0][_0x070e('0x58')]['name'])){ut['logger'](_0x070e('0x104'),_0x48d26c);return{'isValid':![],'message':_0x070e('0x105')};}var _0x21d392=this['campaignsPreview'][_0x48d26c[0x0][_0x070e('0x3f')][_0x070e('0x26')]];_0x21d392['message']=utils[_0x070e('0x31')][_0x070e('0x71')];if(_[_0x070e('0x54')](_0x21d392)){ut[_0x070e('0x2e')](_0x070e('0x106'),_0x21d392);return{'isValid':![],'message':_0x070e('0x107')};}if(!this[_0x070e('0x6e')](_0x21d392[_0x070e('0x6f')])){ut[_0x070e('0x2e')](_0x070e('0x108'),_0x070e('0x109')+_0x21d392[_0x070e('0x26')]+_0x070e('0x10a'));if(!this[_0x070e('0x6e')](_0x21d392[_0x070e('0x70')])){ut[_0x070e('0x2e')](_0x070e('0x108'),_0x21d392['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x21d392[_0x070e('0x6d')])){ut[_0x070e('0x2e')](_0x070e('0x10b'),_0x21d392['name']+_0x070e('0x10c'));return{'isValid':![],'message':_0x070e('0x109')+_0x21d392[_0x070e('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x070e('0x10d')};};Preview[_0x070e('0xc')][_0x070e('0xef')]=function(_0x3ef1b3,_0x526afc,_0x7f803a,_0x3967bd){var _0x4717de=this;return new Promise(function(_0x4fde12,_0xcd40c1){var _0x417350=_0x3ef1b3[_0x070e('0x8d')];var _0x220cc9=_0x4717de[_0x070e('0x6e')](_0x526afc[_0x070e('0x6f')])?util[_0x070e('0x24')](_0x070e('0x10e'),_0x526afc[_0x070e('0x6f')]['name'],_['isNil'](_0x526afc[_0x070e('0x10f')])?'':_0x526afc['dialPrefix']['trim']()||'',_0x526afc[_0x070e('0x110')]>0x0?_0x7f803a[_0x070e('0xff')][_0x070e('0x111')](_0x526afc[_0x070e('0x110')]):_0x7f803a[_0x070e('0xff')]):util[_0x070e('0x24')]('SIP/%s/%s%s',_[_0x070e('0x54')](_0x526afc[_0x070e('0x70')])?_0x526afc[_0x070e('0x6f')][_0x070e('0x26')]:_0x526afc['TrunkBackup'][_0x070e('0x26')],_['isNil'](_0x526afc[_0x070e('0x10f')])?'':_0x526afc[_0x070e('0x10f')][_0x070e('0x112')]()||'',_0x526afc[_0x070e('0x110')]>0x0?_0x7f803a[_0x070e('0xff')][_0x070e('0x111')](_0x526afc[_0x070e('0x110')]):_0x7f803a[_0x070e('0xff')]);var _0x2b4e74=_0x4717de['isTrunkReachable'](_0x526afc[_0x070e('0x6f')])?ut[_0x070e('0x113')](_0x526afc[_0x070e('0x6f')][_0x070e('0x114')],_0x526afc[_0x070e('0x115')],_0x526afc[_0x070e('0x116')]>0x0?ut[_0x070e('0x117')](_0x526afc[_0x070e('0x118')],_0x526afc['dialRandomLastDigitCallerIdNumber']):_0x526afc[_0x070e('0x118')]):ut[_0x070e('0x113')](_['isNil'](_0x526afc['TrunkBackup'])?_0x526afc[_0x070e('0x6f')][_0x070e('0x114')]:_0x526afc[_0x070e('0x70')][_0x070e('0x114')],_0x526afc[_0x070e('0x115')],_0x526afc[_0x070e('0x116')]>0x0?ut['getCallerIdRandom'](_0x526afc['dialOriginateCallerIdNumber'],_0x526afc[_0x070e('0x116')]):_0x526afc[_0x070e('0x118')]);if(_0x2b4e74){_0x3ef1b3['originatecalleridname']=ut[_0x070e('0x119')](_0x2b4e74);_0x3ef1b3['originatecalleridnum']=ut[_0x070e('0x11a')](_0x2b4e74);}var _0xa2c957=ut['addVariables'](_0x526afc,_0x7f803a,_0x220cc9,_0x2b4e74,_0x417350,_0x3ef1b3);_[_0x070e('0x11b')](_0x3ef1b3,ut[_0x070e('0x11c')](_0xa2c957));_0x3ef1b3['starttime']=moment()['format'](_0x070e('0x60'));_0x526afc['variables']=_0xa2c957;var _0x1ebec9=ut[_0x070e('0x11d')](_0x3ef1b3,_0x526afc,_0xa2c957,_0x3ef1b3[_0x070e('0xac')],_0x3967bd);return ami['Action'](_0x1ebec9)[_0x070e('0x5b')](function(_0x17adf3){_0x526afc['originated']+=0x1;logger[_0x070e('0x22')](_0x070e('0x11e'),_0x417350,_0x070e('0x8e'),_0x526afc[_0x070e('0x26')],_0x070e('0xd9'),_0x526afc[_0x070e('0x29')]);_0x4fde12(_0x17adf3);})[_0x070e('0x46')](function(_0x358e1b){ut[_0x070e('0xdd')](_0x3ef1b3,0xe,_0x070e('0x11f'));rpcDb['createAgentHistory'](_0x3ef1b3,_0x070e('0x120'));_0xcd40c1(_0x358e1b);});});};Preview[_0x070e('0xc')][_0x070e('0x1b')]=function(_0x52d89d){if(this['actions'][_0x52d89d[_0x070e('0x9f')]]){this[_0x070e('0x13')][_0x52d89d[_0x070e('0x9f')]][_0x070e('0x121')]=_0x52d89d['channel'];}};Preview[_0x070e('0xc')]['syncOriginateResponse']=function(_0x5044e8){var _0x1a1851=this;var _0x52ca6c=this[_0x070e('0x13')][_0x5044e8[_0x070e('0x122')]];if(_0x52ca6c){if(_0x52ca6c[_0x070e('0xed')]&&this[_0x070e('0x53')][_0x52ca6c['lookAgent']]){ut[_0x070e('0x123')](_0x52ca6c,this['agents'][_0x52ca6c[_0x070e('0xed')]][_0x070e('0x26')],this[_0x070e('0x53')][_0x52ca6c[_0x070e('0xed')]]['id']);}var _0x475774=_[_0x070e('0x124')](_0x52ca6c);_0x475774[_0x070e('0x8a')]=moment()[_0x070e('0x24')](_0x070e('0x60'));var _0xf8cfd=_0x1a1851[_0x070e('0x10')][_0x52ca6c[_0x070e('0x40')]];if(ut[_0x070e('0x125')](_0x5044e8[_0x070e('0x126')])){if(_0x52ca6c[_0x070e('0x84')]){rpcDb[_0x070e('0xfc')](_0x52ca6c['idContact']);}if(_0x52ca6c['activeContact']){rpcDb[_0x070e('0x5e')](_0x52ca6c[_0x070e('0x86')]);}ami['emit'](_0x070e('0x127'),ut[_0x070e('0x79')](_0x52ca6c,'rejected',this[_0x070e('0x10')][_0x52ca6c[_0x070e('0x40')]]));this['callProgressDetectingAgent'](_0x475774,_0xf8cfd,_0x5044e8);}else{_0x52ca6c[_0x070e('0x5f')]=moment()[_0x070e('0x24')](_0x070e('0x60'));ut[_0x070e('0xdd')](_0x475774,0x4,_0x070e('0x99'));rpcDb[_0x070e('0xe0')](_0x475774,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x070e('0xc')][_0x070e('0x16')]=function(_0x275767){var _0x4f33d8=this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]];var _0xe50bad;if(_0x4f33d8){_0xe50bad=this[_0x070e('0x10')][_0x4f33d8['queue']];logger['info'](_0x070e('0x128'),_0x275767[_0x070e('0x9f')],_0x070e('0x8e'),_0xe50bad[_0x070e('0x26')],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);}if(this[_0x070e('0x13')][_0x275767['linkedid']]&&_0x275767[_0x070e('0x9f')]!==_0x275767[_0x070e('0x8d')]){if(_0x275767[_0x070e('0x129')]==='16'&&this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){this[_0x070e('0x72')](_0x275767,_0x275767[_0x070e('0x9f')],_0x275767[_0x070e('0x129')]);}else if(this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){logger[_0x070e('0x22')](_0x070e('0x12a'),_0x275767[_0x070e('0x9f')],_0x275767['cause'],_0x070e('0x8e'),_0xe50bad[_0x070e('0x26')],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);this[_0x070e('0x72')](_0x275767,_0x275767[_0x070e('0x9f')],_0x275767[_0x070e('0x129')]);}}else if(_0x4f33d8&&_['isNil'](_0x4f33d8[_0x070e('0x12b')])&&_0xe50bad[_0x070e('0x12c')]&&_0x275767[_0x070e('0x9f')]===_0x275767[_0x070e('0x8d')]&&_[_0x070e('0x54')](_0x275767[_0x070e('0xe5')])&&_0x275767[_0x070e('0x129')]==='16'&&_0x275767[_0x070e('0x12d')]==='6'&&_[_0x070e('0xdb')](_0x4f33d8['transfer'])){if(_0x4f33d8[_0x070e('0x84')]){rpcDb[_0x070e('0xfc')](_0x4f33d8[_0x070e('0x86')]);}if(_0x4f33d8[_0x070e('0xac')]){rpcDb[_0x070e('0x5e')](_0x4f33d8[_0x070e('0x86')]);}_0x275767[_0x070e('0xe5')]='22';this[_0x070e('0x12e')](_0x4f33d8,_0xe50bad,_0x275767);}else if(_0x4f33d8&&_0x4f33d8[_0x070e('0x12f')]){if(_0x275767[_0x070e('0x129')]==='16'&&this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){logger[_0x070e('0x22')](_0x070e('0x130'),_0x275767[_0x070e('0x9f')],_0x275767[_0x070e('0x129')],_0x070e('0x8e'),_0xe50bad[_0x070e('0x26')],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);this[_0x070e('0x72')](_0x275767,_0x275767['linkedid'],_0x275767[_0x070e('0x129')]);}else if(this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){logger['info'](_0x070e('0x12a'),_0x275767['linkedid'],_0x275767[_0x070e('0x129')],'\x20Queue',_0xe50bad['name'],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);this[_0x070e('0x72')](_0x275767,_0x275767['linkedid'],_0x275767[_0x070e('0x129')]);}}};Preview['prototype'][_0x070e('0x1a')]=function(_0x1e0e55){if(this['actions'][_0x1e0e55[_0x070e('0x131')]]&&_0x1e0e55['destlinkedid']!==_0x1e0e55[_0x070e('0x132')]){this[_0x070e('0x72')](_0x1e0e55,_0x1e0e55[_0x070e('0x131')],_0x1e0e55['dialstatus']);}};Preview['prototype'][_0x070e('0x17')]=function(_0x4bed29){if(this[_0x070e('0x13')][_0x4bed29[_0x070e('0x9f')]]&&_0x4bed29[_0x070e('0x9f')]!==_0x4bed29[_0x070e('0x8d')]&&!this[_0x070e('0x13')][_0x4bed29[_0x070e('0x9f')]]['dialAnswer']){if(_0x4bed29['cause']==='1'){this[_0x070e('0x72')](_0x4bed29,_0x4bed29['linkedid'],_0x4bed29['cause']);}}};Preview[_0x070e('0xc')][_0x070e('0x133')]=function(_0x3c8b7d,_0x5ddf05,_0x241d86){if(this[_0x070e('0x13')][_0x3c8b7d]){if(_[_0x070e('0x54')](this['actions'][_0x3c8b7d]['variables'])){this[_0x070e('0x13')][_0x3c8b7d][_0x070e('0x134')]={};}this[_0x070e('0x13')][_0x3c8b7d]['variables'][_0x5ddf05]=_0x241d86;}};Preview[_0x070e('0xc')]['syncVarSet']=function(_0x2e9263){try{if(!_['isNil'](_0x2e9263)){if(ut[_0x070e('0x135')](_[_0x070e('0x136')](_0x2e9263['variable'])[0x0])){this[_0x070e('0x133')](_0x2e9263[_0x070e('0x8d')],_[_0x070e('0x136')](_0x2e9263[_0x070e('0x137')])[0x0],_0x2e9263[_0x070e('0x138')]);}}}catch(_0xd6529a){logger[_0x070e('0x139')](_0x070e('0x13a'),util[_0x070e('0x13b')](_0xd6529a,{'showHidden':![],'depth':null}));}};Preview[_0x070e('0xc')][_0x070e('0x1e')]=function(_0x10b168){if(_0x10b168){if(this[_0x070e('0x13')][_0x10b168['transfertargetlinkedid']]){this[_0x070e('0x13')][_0x10b168[_0x070e('0x13c')]][_0x070e('0x12f')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x38afa3){if(_0x38afa3){if(this[_0x070e('0x13')][_0x38afa3['transfererlinkedid']]){this[_0x070e('0x13')][_0x38afa3[_0x070e('0x13d')]][_0x070e('0x12f')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x34e8=['localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','type','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','actions','queue','originated:\x20','stringify','dialAnswer','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','agentReadyId','isNil','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','outboundNoAnswerCallsDay','countnoanswerretry','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','pick','execRun','recallme','isValid','checkIsBlackList','logger','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variables','[originated][increment]','OriginateError','syncNewExten','syncOriginateResponse','lookAgent','logLookAgent','responsetime','isFailure','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','cause','statedesc','isUndefined','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','filterKey','keys','addVariable','variable','value','error','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','../dialer/utils','redis','defaults'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x34e8,0x12c));var _0x834e=function(_0x3c74cd,_0x1134ab){_0x3c74cd=_0x3c74cd-0x0;var _0x1ce427=_0x34e8[_0x3c74cd];return _0x1ce427;};'use strict';var util=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var uuid=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));var logger=require(_0x834e('0x5'))(_0x834e('0x6'));var loggerAction=require(_0x834e('0x5'))(_0x834e('0x7'));var ami=require(_0x834e('0x8'));var rpcDb=require(_0x834e('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x834e('0xa'));var ut=require('./util/util');var utils=require(_0x834e('0xb'));config[_0x834e('0xc')]=_[_0x834e('0xd')](config[_0x834e('0xc')],{'host':_0x834e('0xe'),'port':0x18eb});var io=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xc')]));var Sequence=function(){};Sequence[_0x834e('0x10')][_0x834e('0x11')]=function(_0x186b3b){this[_0x834e('0x12')]=this[_0x834e('0x12')]?this[_0x834e('0x12')][_0x834e('0x13')](_0x186b3b):_0x186b3b();};function Preview(_0x293514){this[_0x834e('0x14')]=new Sequence();this[_0x834e('0x15')]=_0x293514['voiceQueues'];this[_0x834e('0x16')]=_0x293514[_0x834e('0x16')];this['actions']={};this[_0x834e('0x17')]=_0x293514[_0x834e('0x17')];this[_0x834e('0x18')]=0x0;ami['on'](_0x834e('0x19'),this['syncOriginateResponse'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1b'),this['syncHangup'][_0x834e('0x1a')](this));ami['on']('hanguprequest',this[_0x834e('0x1c')][_0x834e('0x1a')](this));ami['on']('dialend',this[_0x834e('0x1d')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1e'),this['syncNewExten'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1f'),this[_0x834e('0x20')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x21'),this[_0x834e('0x22')][_0x834e('0x1a')](this));ami['on']('blindtransfer',this[_0x834e('0x23')][_0x834e('0x1a')](this));this[_0x834e('0x24')](this[_0x834e('0x15')]);}function emit(_0x4ab05d,_0x45a630,_0x62f8f1){io['to'](_0x4ab05d)['emit'](_0x45a630,_0x62f8f1);}function emitVoiceQueueChannelRemove(_0x1b4bdf){logger[_0x834e('0x25')](_0x834e('0x26'),JSON['stringify'](_0x1b4bdf));emit(util['format'](_0x834e('0x27'),_0x1b4bdf[_0x834e('0x28')]),'voice_queue_channel:remove',_0x1b4bdf);io[_0x834e('0x29')](_0x834e('0x2a'),_0x1b4bdf);}function notSendMessagesQueue(_0x58f4fd){if(_0x58f4fd[_0x834e('0x2b')]){if(_0x58f4fd[_0x834e('0x2c')]===0x0&&_0x58f4fd[_0x834e('0x2d')]===0x0){_0x58f4fd['sendMessageOneNotActive']=![];_0x58f4fd[_0x834e('0x2e')]=0x0;_0x58f4fd[_0x834e('0x2f')]=0x0;_0x58f4fd['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];ut['logger'](_0x834e('0x31'),_0x58f4fd[_0x834e('0x28')]+_0x834e('0x32'));}else{_0x58f4fd[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x35')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x58f4fd['name']+'\x20is\x20deactivated');}}}Preview[_0x834e('0x10')][_0x834e('0x24')]=function(){var _0x106d6a=this;setInterval(function(){_0x106d6a['syncCampaigns']();},0x7cf);};Preview[_0x834e('0x10')][_0x834e('0x36')]=function(){var _0x1f3671=this[_0x834e('0x15')];this[_0x834e('0x18')]+=0x1;for(var _0x390119 in _0x1f3671){if(_0x1f3671[_0x834e('0x37')](_0x390119)&&(_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')||_0x1f3671[_0x390119]['dialMethod']===_0x834e('0x39'))&&_0x1f3671[_0x390119]['type']===_0x834e('0x3a')){if(this[_0x834e('0x18')]>0x7){this[_0x834e('0x18')]=0x0;this[_0x834e('0x3b')]();}}if(_0x1f3671[_0x834e('0x37')](_0x390119)&&_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')&&_0x1f3671[_0x390119][_0x834e('0x3c')]===_0x834e('0x3a')){if(_0x1f3671[_0x390119][_0x834e('0x3d')]){this['setMessage'](_0x1f3671[_0x390119]);if(_0x1f3671[_0x390119][_0x834e('0x3e')])this[_0x834e('0x3f')](_0x1f3671[_0x390119]);}else{notSendMessagesQueue(_0x1f3671[_0x390119]);}}}};Preview[_0x834e('0x10')][_0x834e('0x40')]=function(_0x595cc0){var _0x3f88ad=this;this[_0x834e('0x14')]['enqueue'](function(){if(!_['isNil'](_0x3f88ad['actions'][_0x595cc0])){loggerAction[_0x834e('0x25')](_0x834e('0x41'),_0x595cc0,_0x834e('0x42'),_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')],_0x834e('0x45'),JSON['stringify'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]][_0x834e('0x2c')]),'pTalking:\x20',JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0]['queue']][_0x834e('0x2d')]),JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x47')]),JSON[_0x834e('0x46')](_['pick'](_0x3f88ad[_0x834e('0x43')][_0x595cc0],['contactId','UserId',_0x834e('0x48'),'ListId'])));return ami[_0x834e('0x49')]({'action':_0x834e('0x4a'),'channel':_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x4b')]})[_0x834e('0x4c')](function(_0x574ea8){if(_0x574ea8[_0x834e('0x33')]===_0x834e('0x4d')){setTimeout(function(){if(_0x3f88ad[_0x834e('0x43')][_0x595cc0]){ut['updateOriginated'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']],_0x834e('0x4e'));if(_0x3f88ad['actions'][_0x595cc0][_0x834e('0x47')]===!![]){ut[_0x834e('0x4f')](_0x3f88ad['campaignsPreview'][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]],_0x834e('0x4e'));ut[_0x834e('0x50')](_0x834e('0x51')+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')]);}ut[_0x834e('0x50')]('[Dialer][checkChannel][Preview]'+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']);delete _0x3f88ad[_0x834e('0x43')][_0x595cc0];}},0x2328);}});}});};Preview['prototype'][_0x834e('0x3b')]=function(){var _0x5a5807=this;loggerAction[_0x834e('0x25')](_0x834e('0x52'),_['size'](this[_0x834e('0x43')]));for(var _0x3f2321 in this[_0x834e('0x43')]){if(_0x5a5807[_0x834e('0x43')][_0x834e('0x37')](_0x3f2321)){_0x5a5807[_0x834e('0x40')](_0x3f2321);}}};Preview[_0x834e('0x10')][_0x834e('0x3f')]=function(_0x5dc63b){var _0x279ea1=this;rpcDb['getContactRecallMe'](_0x5dc63b['id'],ut[_0x834e('0x53')](this[_0x834e('0x17')]))['then'](function(_0x112306){if(!_[_0x834e('0x54')](_0x112306)){for(var _0x25b035=0x0;_0x25b035<_0x112306[_0x834e('0x55')];_0x25b035+=0x1){if(ut[_0x834e('0x56')](_0x112306[_0x25b035][_0x834e('0x57')])<_0x5dc63b['dialRecallMeTimeout']*0x3c){if(_0x112306[_0x25b035]['Agent']&&!_0x112306[_0x25b035][_0x834e('0x58')][_0x834e('0x59')]){_0x279ea1[_0x834e('0x5a')](_0x112306[_0x25b035]['id'])[_0x834e('0x5b')](ut[_0x834e('0x5c')](_0x834e('0x5d')))[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x5d')));}else{rpcDb[_0x834e('0x5e')](_0x112306[_0x25b035]['id']);}}else{var _0xf02f0d=new Action(_0x112306[_0x25b035],_0x5dc63b);_0xf02f0d[_0x834e('0x5f')]=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x5dc63b[_0x834e('0x62')]+=0x1;ut[_0x834e('0x63')](_0xf02f0d,0x17,_0x834e('0x64'));if(_0x5dc63b[_0x834e('0x65')]){rpcDb[_0x834e('0x66')](ut[_0x834e('0x67')](_0x112306[_0x25b035]));rpcDb['createCustomerHistory'](_0xf02f0d,_0x834e('0x68'));}else{ut[_0x834e('0x63')](_0xf02f0d,0x16,'RecallFailedTimeout');rpcDb[_0x834e('0x69')](_0xf02f0d,_0x834e('0x6a'));rpcDb['createCustomerFinal'](_0xf02f0d,_0x834e('0x6a'));}}}}})[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x6b')));};Preview[_0x834e('0x10')][_0x834e('0x6c')]=function(_0x4549ba){_0x4549ba['sendMessageOneNotActive']=!![];if(ut[_0x834e('0x6d')](_0x4549ba[_0x834e('0x6e')])){_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x6f')];}else if(!ut[_0x834e('0x70')](_0x4549ba[_0x834e('0x3d')])){_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];}else if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x71')])){if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x72')])){_0x4549ba['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x73')];}else{_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];}};Preview[_0x834e('0x10')][_0x834e('0x75')]=function(_0x315858,_0x3d3f2b,_0x4273f1){var _0x528e66=this;var _0x142334=this[_0x834e('0x43')][_0x3d3f2b];var _0x5d5ac2=this[_0x834e('0x15')][_0x142334['queue']];var _0x3e58ef;var _0x45eceb=![];var _0x5160c4=0x2;var _0x41ef86=0x3;if(_0x5d5ac2){switch(_0x4273f1){case'1':_0x5d5ac2[_0x834e('0x76')]+=0x1;_0x142334[_0x834e('0x77')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x0,_0x834e('0x79'));ami[_0x834e('0x29')]('custom:agentnosuchnumber',ut[_0x834e('0x7a')](_0x142334,_0x834e('0x7b')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x7c'));_0x528e66[_0x834e('0x7d')](_0x142334,'0',_0x5d5ac2)[_0x834e('0x5b')](function(_0x3a1426){_0x45eceb=_0x3a1426[_0x834e('0x7e')]==0x1;_0x5160c4=_0x5d5ac2[_0x834e('0x7f')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0x86'));}else{if(_0x142334[_0x834e('0x77')]>=_0x5d5ac2[_0x834e('0x87')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x86'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnosuchnumberretry',_0x5d5ac2[_0x834e('0x7f')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x142334[_0x834e('0x77')]++;logger['info']('actioncountonusuch',_0x142334[_0x834e('0x77')]);logger[_0x834e('0x25')]('id',_0x142334[_0x834e('0x8c')]);_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnosuchnumberretry':_0x142334[_0x834e('0x77')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case _0x834e('0x8f'):var _0x5a99e6=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x142334['responsetime']=_0x5a99e6;_0x142334['answertime']=_0x5a99e6;_0x142334[_0x834e('0x47')]=!![];_0x5d5ac2[_0x834e('0x2d')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x90'),_0x142334[_0x834e('0x91')],'\x20Queue',_0x5d5ac2[_0x834e('0x28')],_0x834e('0x92'),_0x5d5ac2[_0x834e('0x2d')]);ami[_0x834e('0x29')](_0x834e('0x93'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0x94'),this[_0x834e('0x15')][_0x142334[_0x834e('0x44')]]));if(_0x5d5ac2[_0x834e('0x95')]){ami['emit'](_0x834e('0x96'),ut[_0x834e('0x97')](_0x142334));}break;case'16':ami[_0x834e('0x29')](_0x834e('0x98'),ut['buildObj'](_0x142334,_0x834e('0x99'),this['campaignsPreview'][_0x142334['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x142334,_0x834e('0x99')));_0x5d5ac2[_0x834e('0x9a')]+=0x1;_0x5d5ac2['total']+=0x1;_0x5d5ac2[_0x834e('0x9b')]+=0x1;ut[_0x834e('0x4f')](_0x5d5ac2,'[16]');_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x4,'Answer');rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x9c'));rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x9d'));rpcDb[_0x834e('0x9e')](_0x142334);_0x5d5ac2['sumDuration']+=_0x142334[_0x834e('0x9f')];_0x5d5ac2['sumBillable']+=_0x142334[_0x834e('0x9f')];logger[_0x834e('0x25')](_0x834e('0xa0'),_0x142334['uniqueid'],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],'pTalking:\x20',_0x5d5ac2[_0x834e('0x2d')]);delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'BUSY':_0x5d5ac2[_0x834e('0xa3')]+=0x1;_0x142334[_0x834e('0xa4')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x5,_0x834e('0xa5'));_0x5160c4=_0x5d5ac2[_0x834e('0xa6')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami[_0x834e('0x29')](_0x834e('0xa7'),ut['buildObj'](_0x142334,'busy'));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xa8'));_0x528e66[_0x834e('0x7d')](_0x142334,'5',_0x5d5ac2)[_0x834e('0x5b')](function(_0x37fa2c){_0x45eceb=_0x37fa2c[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xa9'));}else{if(_0x142334[_0x834e('0xa4')]>=_0x5d5ac2['dialBusyMaxRetry']){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xa8'));}else{rpcDb[_0x834e('0x88')](ut['scheduledAt'](_0x142334,_0x834e('0xa4'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xa4')]++;_0x528e66['incrementPreviewCounters']({'id':_0x142334['idContact'],'field':{'countbusyretry':_0x142334[_0x834e('0xa4')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'NOANSWER':_0x5d5ac2[_0x834e('0xaa')]+=0x1;_0x142334[_0x834e('0xab')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x3,'NoAnswer');_0x5160c4=_0x5d5ac2['dialNoAnswerRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];var _0x6735e6=ut[_0x834e('0xac')](_0x142334,_0x5d5ac2);ami[_0x834e('0x29')](_0x834e('0xad'),_0x6735e6);rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xae'));_0x528e66[_0x834e('0x7d')](_0x142334,'3',_0x5d5ac2)[_0x834e('0x5b')](function(_0x17e61a){_0x45eceb=_0x17e61a['additional']==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xaf'));}else{if(_0x142334[_0x834e('0xab')]>=_0x5d5ac2[_0x834e('0xb0')]){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnoanswerretry',_0x5d5ac2[_0x834e('0xb1')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'CONGESTION':_0x5d5ac2[_0x834e('0xb2')]+=0x1;_0x142334[_0x834e('0xb3')]+=0x1;_0x142334['countglobal']=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x8,'Congestion');_0x5160c4=_0x5d5ac2[_0x834e('0xb4')];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];ami['emit'](_0x834e('0xb5'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xb6')));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logCongestion]');_0x528e66[_0x834e('0x7d')](_0x142334,'8',_0x5d5ac2)[_0x834e('0x5b')](function(_0x260934){_0x45eceb=_0x260934[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xb7'));}else{if(_0x142334[_0x834e('0xb3')]>=_0x5d5ac2[_0x834e('0xb8')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xb9'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,_0x834e('0xb3'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xb3')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countcongestionretry':_0x142334[_0x834e('0xb3')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case _0x834e('0xba'):_0x5d5ac2[_0x834e('0xbb')]+=0x1;_0x142334[_0x834e('0xbc')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x14,'AgentReject');_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami['emit'](_0x834e('0xbd'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xbe')));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xbf'));_0x528e66[_0x834e('0x7d')](_0x142334,'20',_0x5d5ac2)[_0x834e('0x5b')](function(_0x1594ef){_0x45eceb=_0x1594ef[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0x14,_0x834e('0xc0'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc1'));}else{if(_0x142334[_0x834e('0xbc')]>=_0x5d5ac2['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x834e('0x89')](_0x142334,_0x834e('0xbc'),_0x5d5ac2['dialAgentRejectRetryFrequency']),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334['countnoanswerretry']++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'ABANDONED':_0x5d5ac2['outboundAbandonedCallsDay']+=0x1;_0x142334[_0x834e('0xc2')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0xb,_0x834e('0xc3'));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logAbandoned]');_0x528e66[_0x834e('0x7d')](_0x142334,'11',_0x5d5ac2)[_0x834e('0x5b')](function(_0x216d1f){_0x45eceb=_0x216d1f[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0xf,'Global');rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc4'));}else{if(_0x142334[_0x834e('0xc5')]>=_0x5d5ac2[_0x834e('0xc6')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xc4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x142334,_0x834e('0xc2'),_0x5d5ac2[_0x834e('0xc7')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'18':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0xc9')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x12,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xce'));_0x528e66[_0x834e('0x7d')](_0x142334,'18',_0x5d5ac2)['then'](function(_0x5f1e3b){_0x45eceb=_0x5f1e3b[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0x12,_0x834e('0x84'));rpcDb['createCustomerFinal'](_0x3e58ef,_0x834e('0xce'));}else{rpcDb['createCustomerFinal'](_0x142334,_0x834e('0xce'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'19':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x13,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xcf'));_0x528e66['verifyAdditionalPhones'](_0x142334,'18',_0x5d5ac2)['then'](function(_0x2df814){_0x45eceb=_0x2df814[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xcf'));}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xcf'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})['then'](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858['linkedid']];break;default:if(_0x142334[_0x834e('0x47')]){ut[_0x834e('0x4f')](_0x5d5ac2,'[default]');ut['loggerError'](_0x834e('0xd0')+_0x5d5ac2[_0x834e('0x28')],_0x315858);}_0x5d5ac2['outboundUnknownCallsDay']+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0xc,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logUnknown]');_0x528e66['verifyAdditionalPhones'](_0x142334,'20',_0x5d5ac2)['then'](function(_0xac9d00){_0x45eceb=_0xac9d00[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xd1'));}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});}});}if(!(_0x142334[_0x834e('0x47')]&&_0x4273f1==='16')){ut['updateOriginated'](_0x5d5ac2,_0x834e('0xd2'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingCustomer]',_0x142334[_0x834e('0x91')],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],_0x834e('0x45'),_0x5d5ac2[_0x834e('0x2c')]);}if(_0x4273f1!==_0x834e('0x8f')){delete this['actions'][_0x315858[_0x834e('0xa2')]];delete this[_0x834e('0x43')][_0x315858[_0x834e('0xd3')]];}_0x5d5ac2[_0x834e('0xd4')]=!![];}};Preview[_0x834e('0x10')][_0x834e('0xd5')]=function(_0x5d3c6d,_0x448420,_0x490a57){if(_['isUndefined'](_0x448420)&&_0x834e('0xd6')!==typeof _0x448420){return;}if(_['isUndefined'](_0x490a57)&&'object'!==typeof _0x490a57){return;}switch(_0x490a57[_0x834e('0xd7')]){case'0':ut[_0x834e('0xd8')](_0x5d3c6d,0x0,_0x834e('0x79'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xda'));break;case'3':ut[_0x834e('0xd8')](_0x5d3c6d,0x3,_0x834e('0xdb'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdc'));break;case'5':ut[_0x834e('0xd8')](_0x5d3c6d,0x5,_0x834e('0xa5'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdd'));break;case'8':ut[_0x834e('0xd8')](_0x5d3c6d,0x8,'Congestion');rpcDb[_0x834e('0xd9')](_0x5d3c6d,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x834e('0xd8')](_0x5d3c6d,0x16,_0x834e('0xde'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdf'));break;default:ut['logAgent'](_0x5d3c6d,0xc,_0x490a57['reason']);rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xe0'));}ut['updateOriginated'](_0x448420,_0x834e('0xe1'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingAgent]',_0x5d3c6d[_0x834e('0x91')],_0x834e('0xa1'),_0x448420[_0x834e('0x28')],_0x834e('0x45'),_0x448420['originated']);delete this['actions'][_0x5d3c6d['uniqueid']];};Preview['prototype'][_0x834e('0x7d')]=function(_0x3c4847,_0x47891e,_0x41ba0c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3c4847,_0x47891e,_0x41ba0c)[_0x834e('0x4c')](logger[_0x834e('0x25')](_0x834e('0xe2')));};Preview[_0x834e('0x10')][_0x834e('0x8e')]=function(_0xfa6cdb,_0x3c775f,_0x4fc61d){return cmHopperAdditionalPhone[_0x834e('0x8e')](_0xfa6cdb,_0x3c775f,_0x4fc61d)[_0x834e('0x4c')](logger['info'](_0x834e('0xe3')));};Preview[_0x834e('0x10')]['incrementPreviewCounters']=function(_0x486c18){return Promise['resolve']()[_0x834e('0x5b')](cmHopperAdditionalPhone[_0x834e('0x8d')](_0x486c18))[_0x834e('0x4c')](logger['info'](_0x834e('0xe4')));};Preview[_0x834e('0x10')][_0x834e('0xe5')]=function(_0x17e729,_0x4b4f7c,_0xad7b72,_0x19cb0b,_0x13af70){var _0x8804a8=this;return new Promise(function(_0x102640,_0x48b6c4){if(_['isNil'](_0x4b4f7c)||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe6')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe7')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0x48')])){_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xe8'),_0x19cb0b,_0x13af70));return;}var _0x38151c=uuid['v4']();var _0x97a4b2=_0x8804a8[_0x834e('0x15')][_0x4b4f7c[_0x834e('0x42')][_0x834e('0x28')]];var _0x4b12cd=_0xad7b72?_0x8804a8[_0x834e('0x17')][_0xad7b72]['id']:undefined;_0x8804a8[_0x834e('0x43')][_0x38151c]=new Action(_0x4b4f7c,_0x97a4b2,_0x38151c,_0xad7b72,_0x4b12cd);var _0x3f5b2e=_0x8804a8[_0x834e('0x43')][_0x38151c];_0x3f5b2e['unlockAgent']=_0x19cb0b;_0x3f5b2e['activeContact']=_0x13af70;_0x3f5b2e['lookAgent']=_0xad7b72;if(_[_0x834e('0xe9')](_0x17e729)){_0x8804a8[_0x834e('0xea')](_0x3f5b2e,_0x97a4b2,_0x4b4f7c,_0xad7b72)[_0x834e('0x5b')](function(_0x23d7e6){logger[_0x834e('0x25')](_0x834e('0xeb'),_0x834e('0xec')+_0x3f5b2e[_0x834e('0x44')]+'\x20IdHopper:\x20'+_0x3f5b2e['idContact'],JSON['stringify'](_0x23d7e6));ami['emit'](_0x834e('0xed'),ut[_0x834e('0x7a')](_0x3f5b2e,_0x834e('0xee'),_0x8804a8[_0x834e('0x15')][_0x3f5b2e[_0x834e('0x44')]]));_0x102640(ut[_0x834e('0x33')](_0x834e('0xef')));})[_0x834e('0x4c')](function(_0x33757d){ut['logger']('[Preview][execCall][failure]',_0x33757d);_0x48b6c4(ut['message']('Call\x20failed',_0x19cb0b,_0x13af70));});}else{_0x97a4b2[_0x834e('0xf0')]+=0x1;ut[_0x834e('0xf1')](_0x3f5b2e);rpcDb[_0x834e('0xf2')](_0x3f5b2e,_0x834e('0xf3'));delete _0x8804a8[_0x834e('0x43')][_0x38151c];_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xf4'),_0x19cb0b,_0x13af70));}});};Preview[_0x834e('0x10')][_0x834e('0xf5')]=function(_0xcd64c2){return!_[_0x834e('0x54')](_0xcd64c2)&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0x28')])&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0xf6')])&&_0xcd64c2[_0x834e('0xf6')]&&!_['isNil'](this[_0x834e('0x16')][util['format'](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])])&&!_[_0x834e('0x54')](this['trunks'][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2['name'])]['status'])&&(this[_0x834e('0x16')][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf8')||this[_0x834e('0x16')][util[_0x834e('0x60')]('SIP/%s',_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf9'));};Preview[_0x834e('0x10')][_0x834e('0x5a')]=function(_0x614e15,_0x17aaae){return this['execRun'](_0x614e15,_0x17aaae)[_0x834e('0x5b')](function(_0x59e298){return _['pick'](_0x59e298,[_0x834e('0x33')]);})[_0x834e('0x4c')](function(_0x4b16fa){if(_0x4b16fa[_0x834e('0xfa')]){rpcDb[_0x834e('0xfb')](_0x614e15);}if(_0x4b16fa['active']){rpcDb[_0x834e('0x5e')](_0x614e15);}throw _[_0x834e('0xfc')](_0x4b16fa,['message']);});};Preview['prototype'][_0x834e('0xfd')]=function(_0x2ec9f1,_0x4e6525){var _0x58a935=this;var _0x269ff6,_0xa496aa;return rpcDb['getContactPreview'](_0x2ec9f1)['then'](function(_0x495352){if(!_['isNil'](_0x495352[0x0])){_0xa496aa=_0x495352[0x0][_0x834e('0xfe')]?![]:!![];_0x269ff6=_0x495352[0x0]['recallme']?!![]:![];_0x269ff6=_0x4e6525?!![]:_0x269ff6;}var _0x3be4c3=_0x58a935['validateContact'](_0x495352);if(_0x3be4c3[_0x834e('0xff')]){rpcDb[_0x834e('0x100')](_[_0x834e('0xfc')](_0x495352[0x0],[_0x834e('0x48'),'phone']))[_0x834e('0x5b')](function(_0x446d89){_0x58a935[_0x834e('0xe5')](_0x446d89,_0x495352[0x0],_0x4e6525,_0xa496aa,_0x269ff6)[_0x834e('0x5b')](function(_0x3a3a6c){return _0x3a3a6c;})[_0x834e('0x4c')](function(_0x3d8abb){throw _0x3d8abb;});})[_0x834e('0x4c')](function(_0x464ae6){ut[_0x834e('0x101')]('[Preview][checkIsBlackList]',_0x464ae6);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',_0xa496aa,_0x269ff6);});}else{throw ut[_0x834e('0x33')](_0x3be4c3[_0x834e('0x33')],_0xa496aa,_0x269ff6);}})[_0x834e('0x4c')](function(_0x31a7ae){ut[_0x834e('0x101')]('[Preview][getContactPreview]',_0x31a7ae);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype'][_0x834e('0x102')]=function(_0x30ecb9){if(_[_0x834e('0x54')](_0x30ecb9)||_['isEmpty'](_0x30ecb9)||!_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')])&&_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')][_0x834e('0x28')])){ut[_0x834e('0x101')](_0x834e('0x103'),_0x30ecb9);return{'isValid':![],'message':_0x834e('0x104')};}var _0x125787=this[_0x834e('0x15')][_0x30ecb9[0x0][_0x834e('0x42')]['name']];_0x125787[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];if(_[_0x834e('0x54')](_0x125787)){ut[_0x834e('0x101')](_0x834e('0x105'),_0x125787);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x71')])){ut[_0x834e('0x101')](_0x834e('0x106'),_0x834e('0x107')+_0x125787[_0x834e('0x28')]+_0x834e('0x108'));if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x72')])){ut[_0x834e('0x101')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x125787['name']+_0x834e('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x834e('0x70')](_0x125787[_0x834e('0x3d')])){ut[_0x834e('0x101')](_0x834e('0x10a'),_0x125787[_0x834e('0x28')]+_0x834e('0x10b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x125787[_0x834e('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x834e('0xea')]=function(_0x3b9429,_0x52cdd5,_0x5cb379,_0x494e08){var _0x2515f6=this;return new Promise(function(_0x45c8e6,_0x3512d8){var _0x5e0bfe=_0x3b9429[_0x834e('0x91')];var _0x21cb1d=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?util[_0x834e('0x60')](_0x834e('0x10c'),_0x52cdd5['Trunk']['name'],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379[_0x834e('0xe7')][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]):util[_0x834e('0x60')](_0x834e('0x10c'),_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x28')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x28')],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379['phone'][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]);var _0x431f18=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?ut[_0x834e('0x111')](_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')],_0x52cdd5['dialOriginateCallerIdName'],_0x52cdd5[_0x834e('0x113')]>0x0?ut[_0x834e('0x114')](_0x52cdd5[_0x834e('0x115')],_0x52cdd5[_0x834e('0x113')]):_0x52cdd5['dialOriginateCallerIdNumber']):ut[_0x834e('0x111')](_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x112')],_0x52cdd5[_0x834e('0x116')],_0x52cdd5[_0x834e('0x113')]>0x0?ut['getCallerIdRandom'](_0x52cdd5[_0x834e('0x115')],_0x52cdd5['dialRandomLastDigitCallerIdNumber']):_0x52cdd5[_0x834e('0x115')]);if(_0x431f18){_0x3b9429['originatecalleridname']=ut[_0x834e('0x117')](_0x431f18);_0x3b9429[_0x834e('0x118')]=ut[_0x834e('0x119')](_0x431f18);}var _0x2d2268=ut[_0x834e('0x11a')](_0x52cdd5,_0x5cb379,_0x21cb1d,_0x431f18,_0x5e0bfe,_0x3b9429);_['merge'](_0x3b9429,ut[_0x834e('0x11b')](_0x2d2268));_0x3b9429[_0x834e('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x52cdd5[_0x834e('0x11c')]=_0x2d2268;var _0x4db3c5=ut['variablesAction'](_0x3b9429,_0x52cdd5,_0x2d2268,_0x3b9429['activeContact'],_0x494e08);return ami[_0x834e('0x49')](_0x4db3c5)[_0x834e('0x5b')](function(_0xbd9400){_0x52cdd5[_0x834e('0x2c')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x11d'),_0x5e0bfe,_0x834e('0xa1'),_0x52cdd5['name'],_0x834e('0x45'),_0x52cdd5[_0x834e('0x2c')]);_0x45c8e6(_0xbd9400);})['catch'](function(_0x5df60f){ut[_0x834e('0xd8')](_0x3b9429,0xe,_0x834e('0x11e'));rpcDb['createAgentHistory'](_0x3b9429,'[originateFailure][logOriginateFailure]');_0x3512d8(_0x5df60f);});});};Preview[_0x834e('0x10')][_0x834e('0x11f')]=function(_0x42305c){if(this['actions'][_0x42305c[_0x834e('0xa2')]]){this[_0x834e('0x43')][_0x42305c[_0x834e('0xa2')]]['channel']=_0x42305c[_0x834e('0x4b')];}};Preview['prototype'][_0x834e('0x120')]=function(_0x1debf7){var _0x3a1328=this;var _0x10971d=this[_0x834e('0x43')][_0x1debf7['actionid']];if(_0x10971d){if(_0x10971d[_0x834e('0x121')]&&this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]){ut[_0x834e('0x122')](_0x10971d,this[_0x834e('0x17')][_0x10971d['lookAgent']]['name'],this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]['id']);}var _0x13d670=_['clone'](_0x10971d);_0x13d670[_0x834e('0x123')]=moment()[_0x834e('0x60')](_0x834e('0x61'));var _0x386b73=_0x3a1328['campaignsPreview'][_0x10971d[_0x834e('0x44')]];if(ut[_0x834e('0x124')](_0x1debf7['response'])){if(_0x10971d[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x10971d[_0x834e('0x8c')]);}if(_0x10971d[_0x834e('0x8b')]){rpcDb['disableContact'](_0x10971d[_0x834e('0x8c')]);}ami['emit'](_0x834e('0x125'),ut[_0x834e('0x7a')](_0x10971d,_0x834e('0x126'),this[_0x834e('0x15')][_0x10971d[_0x834e('0x44')]]));this[_0x834e('0xd5')](_0x13d670,_0x386b73,_0x1debf7);}else{_0x10971d['starttime']=moment()['format'](_0x834e('0x61'));ut[_0x834e('0xd8')](_0x13d670,0x4,'Answer');rpcDb[_0x834e('0xd9')](_0x13d670,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x834e('0x10')][_0x834e('0x127')]=function(_0x319d6c){var _0x151b58=this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]];var _0x36836f;if(_0x151b58){_0x36836f=this['campaignsPreview'][_0x151b58[_0x834e('0x44')]];logger[_0x834e('0x25')](_0x834e('0x128'),_0x319d6c[_0x834e('0xa2')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);}if(this[_0x834e('0x43')][_0x319d6c['linkedid']]&&_0x319d6c['linkedid']!==_0x319d6c['uniqueid']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')]('[syncHangup][talking][cause]',_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c['cause']);}}else if(_0x151b58&&_[_0x834e('0x54')](_0x151b58[_0x834e('0x12a')])&&_0x36836f['dialQueueProject']&&_0x319d6c[_0x834e('0xa2')]===_0x319d6c[_0x834e('0x91')]&&_[_0x834e('0x54')](_0x319d6c[_0x834e('0xd7')])&&_0x319d6c['cause']==='16'&&_0x319d6c['channelstate']==='6'&&_[_0x834e('0x12b')](_0x151b58['transfer'])){if(_0x151b58[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x151b58[_0x834e('0x8c')]);}if(_0x151b58[_0x834e('0x8b')]){rpcDb[_0x834e('0x5e')](_0x151b58['idContact']);}_0x319d6c[_0x834e('0xd7')]='22';this['callProgressDetectingAgent'](_0x151b58,_0x36836f,_0x319d6c);}else if(_0x151b58&&_0x151b58['transfer']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12c'),_0x319d6c['linkedid'],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this['actions'][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12d'),_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}}};Preview[_0x834e('0x10')][_0x834e('0x1d')]=function(_0x371767){if(this[_0x834e('0x43')][_0x371767[_0x834e('0xd3')]]&&_0x371767[_0x834e('0xd3')]!==_0x371767[_0x834e('0x12e')]){this[_0x834e('0x75')](_0x371767,_0x371767[_0x834e('0xd3')],_0x371767[_0x834e('0xcb')]);}};Preview['prototype'][_0x834e('0x1c')]=function(_0x1cd122){if(this['actions'][_0x1cd122['linkedid']]&&_0x1cd122['linkedid']!==_0x1cd122[_0x834e('0x91')]&&!this[_0x834e('0x43')][_0x1cd122[_0x834e('0xa2')]][_0x834e('0x47')]){if(_0x1cd122[_0x834e('0x129')]==='1'){this[_0x834e('0x75')](_0x1cd122,_0x1cd122[_0x834e('0xa2')],_0x1cd122['cause']);}}};Preview['prototype']['addVariable']=function(_0x47947b,_0x684a97,_0x3c8fc2){if(this[_0x834e('0x43')][_0x47947b]){if(_['isNil'](this['actions'][_0x47947b]['variables'])){this[_0x834e('0x43')][_0x47947b]['variables']={};}this['actions'][_0x47947b][_0x834e('0x11c')][_0x684a97]=_0x3c8fc2;}};Preview[_0x834e('0x10')][_0x834e('0x20')]=function(_0x1acdbd){try{if(!_[_0x834e('0x54')](_0x1acdbd)){if(ut[_0x834e('0x12f')](_[_0x834e('0x130')](_0x1acdbd['variable'])[0x0])){this[_0x834e('0x131')](_0x1acdbd[_0x834e('0x91')],_[_0x834e('0x130')](_0x1acdbd[_0x834e('0x132')])[0x0],_0x1acdbd[_0x834e('0x133')]);}}}catch(_0x488f82){logger[_0x834e('0x134')]('[syncVarSet][Preview]',util[_0x834e('0x135')](_0x488f82,{'showHidden':![],'depth':null}));}};Preview[_0x834e('0x10')][_0x834e('0x22')]=function(_0x57714a){if(_0x57714a){if(this['actions'][_0x57714a['transfertargetlinkedid']]){this['actions'][_0x57714a[_0x834e('0x136')]][_0x834e('0x137')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x20d61c){if(_0x20d61c){if(this[_0x834e('0x43')][_0x20d61c[_0x834e('0x138')]]){this['actions'][_0x20d61c[_0x834e('0x138')]][_0x834e('0x137')]=!![];}}};module[_0x834e('0x139')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index c8c2322..947c987 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 _0x740c=['error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueReport'];(function(_0x4c009b,_0x1380f8){var _0x192c77=function(_0x6a4228){while(--_0x6a4228){_0x4c009b['push'](_0x4c009b['shift']());}};_0x192c77(++_0x1380f8);}(_0x740c,0x96));var _0xc740=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x740c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xc740('0x0'));var BPromise=require(_0xc740('0x1'));var logger=require(_0xc740('0x2'))('preview');var cmHopper=require(_0xc740('0x3'));var cmHopperHistory=require(_0xc740('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xc740('0x5'));function loggerCatch(_0x4a6fbf){return function(_0x1027f5){logger[_0xc740('0x6')](_0x4a6fbf,util[_0xc740('0x7')](_0x1027f5,{'showHidden':![],'depth':null}));};}function create(_0x5b9645){return cmHopperHistory[_0xc740('0x8')](_0x5b9645)['catch'](loggerCatch(_0xc740('0x9')));}function createAgent(_0x9b3263){return BPromise[_0xc740('0xa')]()[_0xc740('0xb')](agentReportPreview[_0xc740('0x8')](_0x9b3263))[_0xc740('0xc')](loggerCatch(_0xc740('0x9')));}function moveContact(_0x3bfbc7){return cmHopper[_0xc740('0xd')](_0x3bfbc7,!![])['catch'](loggerCatch(_0xc740('0xe')));}exports[_0xc740('0xf')]=function(_0x13cff3){return cmHopperBlack[_0xc740('0xf')](_0x13cff3)[_0xc740('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xc740('0x10')]=function(_0x1906e5){return BPromise[_0xc740('0xa')]()[_0xc740('0xb')](cmHopper[_0xc740('0x10')](_0x1906e5))[_0xc740('0xc')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x35f0,_0x5151e6){create(_0x35f0)[_0xc740('0xc')](loggerCatch(_0x5151e6));moveContact(_0x35f0)['catch'](loggerCatch(_0x5151e6));};exports[_0xc740('0x11')]=function(_0x390906,_0x5e526c){createAgent(_0x390906)[_0xc740('0xc')](loggerCatch(_0x5e526c));};exports['createCustomerHistory']=function(_0x33fdc4,_0x59d62b){create(_0x33fdc4)[_0xc740('0xc')](loggerCatch(_0x59d62b));};exports[_0xc740('0x12')]=function(_0x56c746,_0xd94806){moveContact(_0x56c746)[_0xc740('0xc')](loggerCatch(_0xd94806));};exports[_0xc740('0x13')]=function(_0x4ebb83,_0x4fb4dd,_0x49ef0a){if(_0x4fb4dd){_0x4ebb83['UserId']=null;}if(_0x49ef0a){_0x4ebb83[_0xc740('0x14')]=![];}return cmHopper['rescheduleContact'](_0x4ebb83)[_0xc740('0xc')](loggerCatch(_0xc740('0x15')));};exports[_0xc740('0x16')]=function(_0x471547){return cmHopper['countReScheduled'](_0x471547)[_0xc740('0xc')](loggerCatch(_0xc740('0x17')));};exports[_0xc740('0x18')]=function(_0x19dea8){return cmHopper['unlockContact']({'UserId':null},_0x19dea8,0x1)['catch'](loggerCatch(_0xc740('0x19')));};exports[_0xc740('0x1a')]=function(_0x4e8428){return cmHopper[_0xc740('0x18')]({'active':![]},_0x4e8428,0x1)[_0xc740('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xc740('0x1b')]=function(_0x1b3a78){var _0x3abbe8={};_0x3abbe8[_0xc740('0x1c')]=_0x1b3a78[_0xc740('0x1c')];_0x3abbe8[_0xc740('0x1d')]=_0x1b3a78['uniqueid'];_0x3abbe8[_0xc740('0x1e')]=_0x1b3a78['calleridnum'];_0x3abbe8['calleridname']=_0x1b3a78[_0xc740('0x1f')];_0x3abbe8[_0xc740('0x20')]=_0x1b3a78['queue'];_0x3abbe8['queuecallerjoinAt']=_0x1b3a78[_0xc740('0x21')];_0x3abbe8[_0xc740('0x22')]=_0x1b3a78[_0xc740('0x21')];_0x3abbe8[_0xc740('0x23')]=0x1;_0x3abbe8[_0xc740('0x24')]=_0x1b3a78['endtime'];_0x3abbe8[_0xc740('0x25')]=_0x1b3a78[_0xc740('0x26')];_0x3abbe8[_0xc740('0x27')]=_0xc740('0x28');_0x3abbe8[_0xc740('0x29')]='xcally-motion-preview';_0x3abbe8[_0xc740('0x2a')]=0x0;_0x3abbe8['assigned']=0x1;_0x3abbe8[_0xc740('0x2b')]=_0x1b3a78['membername'];_0x3abbe8[_0xc740('0x2c')]=_0xc740('0x2d');return BPromise[_0xc740('0xa')]()['then'](voiceQueueReport[_0xc740('0x2e')](_0x3abbe8))['catch'](loggerCatch(_0xc740('0x2f')));};exports[_0xc740('0x30')]=function(_0x4e446a,_0x22a9d2){return BPromise[_0xc740('0xa')]()[_0xc740('0xb')](cmHopper[_0xc740('0x30')](_0x4e446a,_0x22a9d2))[_0xc740('0xc')](loggerCatch(_0xc740('0x31')));};exports[_0xc740('0x32')]=function(_0x3fb80b){return cmHopper[_0xc740('0x13')](_0x3fb80b,!![],!![])[_0xc740('0xc')](loggerCatch(_0xc740('0x33')));}; \ No newline at end of file +var _0x51fd=['queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','resolve','createAgentHistory','createCustomerHistory','UserId','active','rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete'];(function(_0x2a829f,_0x1b0c15){var _0x5737c3=function(_0x2376f9){while(--_0x2376f9){_0x2a829f['push'](_0x2a829f['shift']());}};_0x5737c3(++_0x1b0c15);}(_0x51fd,0x1c0));var _0xd51f=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x51fd[_0x255d5b];return _0x3e141a;};'use strict';var util=require('util');var BPromise=require(_0xd51f('0x0'));var logger=require(_0xd51f('0x1'))('preview');var cmHopper=require(_0xd51f('0x2'));var cmHopperHistory=require(_0xd51f('0x3'));var cmHopperBlack=require(_0xd51f('0x4'));var agentReportPreview=require(_0xd51f('0x5'));var voiceQueueReport=require(_0xd51f('0x6'));function loggerCatch(_0x1410d6){return function(_0x4d9a8e){logger[_0xd51f('0x7')](_0x1410d6,util[_0xd51f('0x8')](_0x4d9a8e,{'showHidden':![],'depth':null}));};}function create(_0x130d3b){return cmHopperHistory[_0xd51f('0x9')](_0x130d3b)[_0xd51f('0xa')](loggerCatch(_0xd51f('0xb')));}function createAgent(_0x5dddb0){return BPromise['resolve']()[_0xd51f('0xc')](agentReportPreview[_0xd51f('0x9')](_0x5dddb0))[_0xd51f('0xa')](loggerCatch(_0xd51f('0xb')));}function moveContact(_0x119a82){return cmHopper[_0xd51f('0xd')](_0x119a82,!![])[_0xd51f('0xa')](loggerCatch(_0xd51f('0xe')));}exports['checkIsBlackList']=function(_0x4878af){return cmHopperBlack['checkIsBlackList'](_0x4878af)[_0xd51f('0xa')](loggerCatch(_0xd51f('0xf')));};exports[_0xd51f('0x10')]=function(_0x1afb21){return BPromise[_0xd51f('0x11')]()['then'](cmHopper[_0xd51f('0x10')](_0x1afb21))[_0xd51f('0xa')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x1d1b03,_0x2481c2){create(_0x1d1b03)[_0xd51f('0xa')](loggerCatch(_0x2481c2));moveContact(_0x1d1b03)['catch'](loggerCatch(_0x2481c2));};exports[_0xd51f('0x12')]=function(_0x3f889a,_0x5a7bac){createAgent(_0x3f889a)[_0xd51f('0xa')](loggerCatch(_0x5a7bac));};exports[_0xd51f('0x13')]=function(_0x5948f8,_0x5c33c5){create(_0x5948f8)[_0xd51f('0xa')](loggerCatch(_0x5c33c5));};exports['createCustomerFinal']=function(_0x2c6bd9,_0x29e11b){moveContact(_0x2c6bd9)[_0xd51f('0xa')](loggerCatch(_0x29e11b));};exports['rescheduleContact']=function(_0x29dc20,_0x58635b,_0x3b3669){if(_0x58635b){_0x29dc20[_0xd51f('0x14')]=null;}if(_0x3b3669){_0x29dc20[_0xd51f('0x15')]=![];}return cmHopper[_0xd51f('0x16')](_0x29dc20)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x44654c){return cmHopper[_0xd51f('0x17')](_0x44654c)['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0xd51f('0x18')]=function(_0x24caa1){return cmHopper[_0xd51f('0x18')]({'UserId':null},_0x24caa1,0x1)[_0xd51f('0xa')](loggerCatch(_0xd51f('0x19')));};exports[_0xd51f('0x1a')]=function(_0x30cfe3){return cmHopper[_0xd51f('0x18')]({'active':![]},_0x30cfe3,0x1)[_0xd51f('0xa')](loggerCatch(_0xd51f('0x1b')));};exports[_0xd51f('0x1c')]=function(_0x2f9b35){var _0x5ac402={};_0x5ac402[_0xd51f('0x1d')]=_0x2f9b35[_0xd51f('0x1d')];_0x5ac402[_0xd51f('0x1e')]=_0x2f9b35[_0xd51f('0x1e')];_0x5ac402[_0xd51f('0x1f')]=_0x2f9b35['calleridnum'];_0x5ac402[_0xd51f('0x20')]=_0x2f9b35['calleridname'];_0x5ac402[_0xd51f('0x21')]=_0x2f9b35[_0xd51f('0x21')];_0x5ac402[_0xd51f('0x22')]=_0x2f9b35[_0xd51f('0x23')];_0x5ac402[_0xd51f('0x24')]=_0x2f9b35['answertime'];_0x5ac402[_0xd51f('0x25')]=0x1;_0x5ac402[_0xd51f('0x26')]=_0x2f9b35[_0xd51f('0x27')];_0x5ac402['connectedlinename']=_0x2f9b35[_0xd51f('0x28')];_0x5ac402[_0xd51f('0x29')]=_0xd51f('0x2a');_0x5ac402[_0xd51f('0x2b')]=_0xd51f('0x2c');_0x5ac402['holdtime']=0x0;_0x5ac402[_0xd51f('0x2d')]=0x1;_0x5ac402[_0xd51f('0x2e')]=_0x2f9b35[_0xd51f('0x28')];_0x5ac402[_0xd51f('0x2f')]=_0xd51f('0x30');return BPromise['resolve']()[_0xd51f('0xc')](voiceQueueReport[_0xd51f('0x31')](_0x5ac402))['catch'](loggerCatch(_0xd51f('0x32')));};exports[_0xd51f('0x33')]=function(_0x27187d,_0xdf0def){return BPromise[_0xd51f('0x11')]()['then'](cmHopper[_0xd51f('0x33')](_0x27187d,_0xdf0def))[_0xd51f('0xa')](loggerCatch(_0xd51f('0x34')));};exports[_0xd51f('0x35')]=function(_0xec2588){return cmHopper[_0xd51f('0x16')](_0xec2588,!![],!![])['catch'](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 62b959b..9e7d16f 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 _0x683d=['\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','membername','UserId','talktime','answertime','isFailure','variablesAction','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','active','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','not_inuse','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','calleridname','calleridnum','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>'];(function(_0x546781,_0x151a58){var _0x366373=function(_0x11c52c){while(--_0x11c52c){_0x546781['push'](_0x546781['shift']());}};_0x366373(++_0x151a58);}(_0x683d,0x7b));var _0xd683=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x683d[_0x2d61b2];return _0x12df89;};'use strict';var util=require('util');var _=require(_0xd683('0x0'));var moment=require(_0xd683('0x1'));var logger=require('../../../../config/logger')(_0xd683('0x2'));var ipAgi=process[_0xd683('0x3')][_0xd683('0x4')]||_0xd683('0x5');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x17e1d0){return function(_0x5dfe51){logger[_0xd683('0x6')](_0x17e1d0,util[_0xd683('0x7')](_0x5dfe51,{'showHidden':![],'depth':null}));};};exports[_0xd683('0x8')]=function(_0x3097d7,_0xa588d8){logger[_0xd683('0x9')](_0x3097d7,util[_0xd683('0x7')](_0xa588d8,{'showHidden':![],'depth':null}));};exports[_0xd683('0xa')]=function(_0x3b1572,_0x41aced){logger[_0xd683('0x6')](_0x3b1572,util[_0xd683('0x7')](_0x41aced,{'showHidden':![],'depth':null}));};exports[_0xd683('0xb')]=function(_0x2a5d6d){return function(_0x5b03cf){logger[_0xd683('0x9')](_0x2a5d6d,util['inspect'](_0x5b03cf,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x57b435,_0x4b8c61,_0x1b33c1){return{'message':_0x57b435,'unlock':_0x4b8c61,'active':_0x1b33c1};};exports[_0xd683('0xc')]=function(_0x5d7cd1,_0x5520e7,_0x5136a0){if(!_[_0xd683('0xd')](_0x5136a0)&&_0xd683('0xe')===typeof _0x5136a0&&!_['isEmpty'](_0x5136a0)){if(!_[_0xd683('0xd')](_0x5520e7)&&'string'===typeof _0x5520e7&&!_[_0xd683('0xf')](_0x5520e7)){return util[_0xd683('0x10')](_0xd683('0x11'),_0x5520e7,_0x5136a0);}return util[_0xd683('0x10')](_0xd683('0x11'),_0x5136a0,_0x5136a0);}if(!_[_0xd683('0xd')](_0x5d7cd1)&&_0xd683('0xe')===typeof _0x5d7cd1&&!_[_0xd683('0xf')](_0x5d7cd1)){return _0x5d7cd1;}return _0xd683('0x12');};exports[_0xd683('0x13')]=function(_0x59f648){if(_[_0xd683('0x14')](_0x59f648)){return![];}return _0x59f648;};exports[_0xd683('0x15')]=function(_0x634076,_0x5bf9c0,_0x109e95,_0x2ace2a,_0x4ecec8,_0x2d1b0d){var _0x3a81e3={'XMD-QUEUE':_0x5bf9c0[_0xd683('0x16')]?_0x5bf9c0[_0xd683('0x16')][_0xd683('0x17')]:'','XMD-CALLERID':_0x2ace2a,'XMD-CALLERID-PREVIEW':_0x2d1b0d?util['format']('\x22%s\x22\x20<%s>',_0x2d1b0d['calleridname'],_0x2d1b0d['calleridnum']):_0x2ace2a,'XMD-DIALID':_0x4ecec8,'XMD-CONTACTID':_0x5bf9c0[_0xd683('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2ace2a,'XMD-VOICEQUEUEID':_0x5bf9c0[_0xd683('0x19')],'XMD-DIALCHANNEL':_0x109e95,'XMD-DIALTIMEOUT':_0x634076[_0xd683('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x634076[_0xd683('0x1b')]?'g':'',_[_0xd683('0xf')](_0x634076['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x634076[_0xd683('0x1c')]||'','XMD-AGI':_0x634076['dialQueueProject']?util[_0xd683('0x10')](_0xd683('0x1d'),ipAgi,_0x634076['dialQueueProject']):_0xd683('0x1e'),'XMD-AGIAFTER':_0x634076[_0xd683('0x1b')]?util['format'](_0xd683('0x1d'),ipAgi,_0x634076[_0xd683('0x1b')]):_0xd683('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x2d1b0d?_0x2d1b0d[_0xd683('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x2d1b0d?_0x2d1b0d[_0xd683('0x20')]:'','XMD-DESTINATION':_0xd683('0x21'),'SIPADDHEADER':_0xd683('0x22')};if(!_[_0xd683('0xf')](_0x634076['monitor_format'])){_0x3a81e3[util[_0xd683('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x634076['monitor_format'];_0x3a81e3[util['format']('%s',_0xd683('0x23'))]=_0x4ecec8;}if(_0x5bf9c0&&_0x5bf9c0[_0xd683('0x24')]){for(var _0x1ee679 in _0x5bf9c0[_0xd683('0x24')]){if(_0x5bf9c0[_0xd683('0x24')][_0xd683('0x25')](_0x1ee679)){if(!_[_0xd683('0x14')](_0x5bf9c0[_0xd683('0x24')][_0x1ee679])&&_0x1ee679!=='id'&&_0x1ee679!==_0xd683('0x26')&&_0x1ee679!==_0xd683('0x27')&&_0x1ee679!=='updatedAt'){_0x3a81e3[util[_0xd683('0x10')](_0xd683('0x28'),_0xd683('0x29'),_['toUpper'](_0x1ee679))]=_0x5bf9c0[_0xd683('0x24')][_0x1ee679];}}}}return _0x3a81e3;};exports[_0xd683('0x2a')]=function(_0xdd5363){var _0x2fee80={};for(var _0x49b457 in _0xdd5363){if(_0xdd5363[_0xd683('0x25')](_0x49b457)){_0x2fee80[util[_0xd683('0x10')]('%s',_['toLower'](_0x49b457))]=_0xdd5363[_0x49b457];}}return{'variables':_0x2fee80};};exports['updateOriginated']=function(_0x4535bb,_0x46620e){if(!_['isNil'](_0x4535bb)){if(_0x4535bb[_0xd683('0x25')](_0xd683('0x2b'))){if(_0x4535bb[_0xd683('0x2b')]>0x0){_0x4535bb[_0xd683('0x2b')]-=0x1;}else{logger['error'](_0xd683('0x2c'),_0x46620e);}}}else{logger[_0xd683('0x6')](_0xd683('0x2d'),_0x46620e);}};exports[_0xd683('0x2e')]=function(_0x43a1ae){var _0x52a0f8=moment()[_0xd683('0x10')](_0xd683('0x2f'));_0x43a1ae[_0xd683('0x30')]=0xd;_0x43a1ae[_0xd683('0x31')]=_0xd683('0x32');_0x43a1ae[_0xd683('0x33')]=_0x52a0f8;_0x43a1ae[_0xd683('0x34')]=_0x52a0f8;_0x43a1ae[_0xd683('0x35')]=_0x52a0f8;};exports[_0xd683('0x36')]=function(_0xad5800,_0x533e45,_0x53b933){var _0x3feab0=moment()['format'](_0xd683('0x2f'));_0xad5800['state']=_0x533e45;_0xad5800[_0xd683('0x31')]=_0x53b933;_0xad5800[_0xd683('0x34')]=_0x3feab0;_0xad5800[_0xd683('0x37')]=utils[_0xd683('0x38')](_0xad5800['responsetime'],_0xad5800['starttime']);};exports['logLookAgent']=function(_0x2c4264,_0xc0c4ca,_0x46a94d){_0x2c4264[_0xd683('0x39')]=_0xc0c4ca;_0x2c4264[_0xd683('0x3a')]=_0x46a94d;};exports['logCustomer']=function(_0x3ecaa1,_0x304534,_0x1c8d0b){var _0x28773c=moment()['format'](_0xd683('0x2f'));_0x3ecaa1[_0xd683('0x30')]=_0x304534;_0x3ecaa1[_0xd683('0x31')]=_0x1c8d0b;_0x3ecaa1['responsetime']=_0x3ecaa1[_0xd683('0x34')]?_0x3ecaa1['responsetime']:_0x28773c;_0x3ecaa1[_0xd683('0x35')]=_0x3ecaa1['endtime']?_0x3ecaa1[_0xd683('0x35')]:_0x28773c;_0x3ecaa1['ringtime']=utils['getSeconds'](_0x3ecaa1[_0xd683('0x34')]||0x0,_0x3ecaa1['starttime']||0x0);_0x3ecaa1[_0xd683('0x3b')]=_0x3ecaa1[_0xd683('0x3c')]?utils[_0xd683('0x38')](_0x3ecaa1['endtime'],_0x3ecaa1[_0xd683('0x3c')]):0x0;};exports[_0xd683('0x3d')]=function(_0x122639){return _0x122639==='Failure';};exports[_0xd683('0x3e')]=function(_0x4d05d1,_0x23d78d,_0x3b724c,_0xd03994,_0x1c3b04){var _0x318970=_0xd03994?'RECALL':_0x4d05d1['calleridname'];_0x318970=_0x1c3b04?_0xd683('0x3f'):_0x318970;return{'actionid':_0x4d05d1[_0xd683('0x40')],'action':_0xd683('0x41'),'channel':_0x4d05d1[_0xd683('0x42')],'callerid':util[_0xd683('0x10')](_0xd683('0x11'),_0x318970,_0x4d05d1['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x3b724c,'timeout':(_0x23d78d[_0xd683('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d05d1[_0xd683('0x40')]};};exports[_0xd683('0x44')]=function(_0xec4971){return _0xec4971[_0xd683('0x45')]+_0xec4971[_0xd683('0x46')]+_0xec4971[_0xd683('0x47')]+_0xec4971[_0xd683('0x48')]+_0xec4971[_0xd683('0x49')];};exports['cloneAction']=function(_0x36b595){var _0x29f393=_['clone'](_0x36b595);_0x29f393[_0xd683('0x30')]=0xf;_0x29f393[_0xd683('0x31')]=_0xd683('0x4a');return _0x29f393;};exports[_0xd683('0x4b')]=function(_0x100cea,_0x32720f,_0x383905){var _0x276e6d={};_0x276e6d[_0x32720f]=_0x100cea[_0x32720f];_0x276e6d[_0xd683('0x4c')]=![];_0x276e6d['scheduledat']=moment()[_0xd683('0x4d')](_0x383905,_0xd683('0x4e'))[_0xd683('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x276e6d[_0xd683('0x18')]=_0x100cea[_0xd683('0x18')];_0x276e6d[_0xd683('0x4f')]=_0x100cea[_0xd683('0x4f')];_0x276e6d[_0xd683('0x19')]=_0x100cea['VoiceQueueId']||undefined;return _0x276e6d;};exports['decrementTalkink']=function(_0x34247d,_0x45dca8){if(!_[_0xd683('0x14')](_0x34247d)){if(_0x34247d[_0xd683('0x50')]>0x0){_0x34247d[_0xd683('0x50')]-=0x1;}else{logger[_0xd683('0x6')](_0x45dca8,_0xd683('0x51'));}}else{logger['error'](_0x45dca8,_0xd683('0x52'));}};exports[_0xd683('0x53')]=function(_0xfa7824){if(_0xfa7824<=0x0){return!![];}return![];};function buildObj(_0x1f2430,_0x48025c,_0x2e7f33){_0x1f2430[_0xd683('0x54')]=_0x48025c;_0x1f2430[_0xd683('0x17')]=_0x1f2430[_0xd683('0x55')];_0x1f2430[_0xd683('0x56')]=_0x1f2430['channelAgent'];_0x1f2430[_0xd683('0x57')]=_0xd683('0x58');if(_0x2e7f33){_0x1f2430[_0xd683('0x59')]=_0x2e7f33[_0xd683('0x59')];}return _0x1f2430;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x5f0340){var _0x38f3f1={};_0x38f3f1[_0xd683('0x55')]=_0x5f0340[_0xd683('0x55')];_0x38f3f1[_0xd683('0x56')]=_0x5f0340[_0xd683('0x42')];_0x38f3f1['uniqueid']=_0x5f0340[_0xd683('0x40')];return _0x38f3f1;};exports['agentReadyId']=function(_0x56c901){var _0x541ab3=[];for(var _0x169c57 in _0x56c901){if(_0x56c901['hasOwnProperty'](_0x169c57)){if(!_[_0xd683('0x14')](_0x56c901[_0x169c57])&&_0x56c901[_0x169c57]['state']===_0xd683('0x5a')&&_0x56c901[_0x169c57]['status']===_0xd683('0x5b')){_0x541ab3[_0xd683('0x5c')](_0x56c901[_0x169c57]['id']);}}}return _0x541ab3;};exports[_0xd683('0x5d')]=function(_0x501cb6){var _0x52ebdc=moment()[_0xd683('0x5e')](0x0);var _0x12aba9=moment(_0x501cb6)[_0xd683('0x5e')](0x0);return _0x52ebdc[_0xd683('0x5f')](_0x12aba9,_0xd683('0x60'));};exports[_0xd683('0x61')]=function(_0xaa2c7e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xaa2c7e[_0xd683('0x18')],'ListId':_0xaa2c7e[_0xd683('0x4f')],'VoiceQueueId':_0xaa2c7e[_0xd683('0x19')]||undefined,'CampaignId':_0xaa2c7e[_0xd683('0x62')]||undefined};};exports['filterKey']=function(_0xae7e6b){if(_0xae7e6b===_0xd683('0x40')||_0xae7e6b===_0xd683('0x63')||_0xae7e6b===_0xd683('0x55')||_0xae7e6b===_0xd683('0x64')||_0xae7e6b===_0xd683('0x65')||_0xae7e6b===_0xd683('0x66')||_0xae7e6b===_0xd683('0x39')||_0xae7e6b===_0xd683('0x42')||_0xae7e6b===_0xd683('0x67')||_0xae7e6b===_0xd683('0x4c')||_0xae7e6b===_0xd683('0x68')||_0xae7e6b===_0xd683('0x69')||_0xae7e6b===_0xd683('0x45')||_0xae7e6b==='countcongestionretry'||_0xae7e6b===_0xd683('0x47')||_0xae7e6b===_0xd683('0x6a')||_0xae7e6b===_0xd683('0x6b')||_0xae7e6b===_0xd683('0x6c')||_0xae7e6b===_0xd683('0x6d')||_0xae7e6b===_0xd683('0x6e')||_0xae7e6b==='ContactId'||_0xae7e6b===_0xd683('0x4f')||_0xae7e6b===_0xd683('0x3a')||_0xae7e6b===_0xd683('0x19')||_0xae7e6b==='sipcallid'||_0xae7e6b===_0xd683('0x6f')||_0xae7e6b===_0xd683('0x70')||_0xae7e6b===_0xd683('0x71')||_0xae7e6b==='xmd-listid'||_0xae7e6b==='xmd-dialurl'||_0xae7e6b===_0xd683('0x72')||_0xae7e6b===_0xd683('0x73')||_0xae7e6b==='xmd-dialid'||_0xae7e6b===_0xd683('0x74')||_0xae7e6b===_0xd683('0x75')||_0xae7e6b===_0xd683('0x76')||_0xae7e6b===_0xd683('0x77')||_0xae7e6b==='xmd-agiafter'||_0xae7e6b===_0xd683('0x78')||_0xae7e6b===_0xd683('0x79')||_0xae7e6b===_0xd683('0x7a')||_0xae7e6b===_0xd683('0x7b')||_0xae7e6b===_0xd683('0x7c')||_0xae7e6b==='rtpaudioqosloss'||_0xae7e6b===_0xd683('0x7d')||_0xae7e6b===_0xd683('0x7e')||_0xae7e6b===_0xd683('0x7f')||_0xae7e6b===_0xd683('0x79')||_0xae7e6b===_0xd683('0x7a')||_0xae7e6b===_0xd683('0x7b')||_0xae7e6b===_0xd683('0x7c')||_0xae7e6b==='rtpaudioqosloss'||_0xae7e6b==='rtpaudioqoslossbridged'||_0xae7e6b===_0xd683('0x7e')||_0xae7e6b===_0xd683('0x7f')||_0xae7e6b===_0xd683('0x80')||_0xae7e6b===_0xd683('0x81')||_0xae7e6b===_0xd683('0x30')||_0xae7e6b==='statedesc'){return![];}return!![];};exports[_0xd683('0x82')]=function(_0x2b6e95,_0x32ef16){var _0x48510f,_0x2fb4b4,_0x15b250;if(_0x32ef16<=0x0){_0x32ef16=0x1;}_0x48510f=new RegExp(_0xd683('0x83')+_0x32ef16+'}$');_0x2fb4b4=Math[_0xd683('0x84')](0xa,_0x32ef16-0x1);_0x15b250=Math[_0xd683('0x84')](0xa,_0x32ef16)-0x1;return util[_0xd683('0x10')]('%s',_[_0xd683('0x85')](_0x2b6e95,_0x48510f,_[_0xd683('0x86')](_0x2fb4b4,_0x15b250)));};exports['extractCalleridName']=function(_0x5835d0){var _0x25ac96=_0x5835d0[_0xd683('0x87')](/"(.*?)"/);return _0x25ac96?_0x25ac96[0x1]:_0x5835d0;};exports['extractCalleridNumber']=function(_0x55427c){var _0xf5a625=_0x55427c[_0xd683('0x87')](/<(.*?)>/);return _0xf5a625?_0xf5a625[0x1]:_0x55427c;};function buildNoAnswerEventPayload(_0x138823,_0x49c7c1){var _0x3f65a7=buildObj(_0x138823,_0xd683('0x88'));if(!_[_0xd683('0xf')](_0x49c7c1[_0xd683('0x89')])){Object['keys'](_0x49c7c1['variables'])[_0xd683('0x8a')](function(_0x7a9152){_0x3f65a7[_0x7a9152[_0xd683('0x8b')]()]=_0x49c7c1[_0xd683('0x89')][_0x7a9152];});}return _0x3f65a7;}exports[_0xd683('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x8661=['uniqueid','originate','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','name','queue','interface','channelAgent','voice','buildObj','not_inuse','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','countcongestionretry','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','ringtime','getSeconds','membername','UserId','logCustomer','statedesc','endtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED'];(function(_0xaee9b2,_0x4f74cf){var _0x8c26c1=function(_0x252b5a){while(--_0x252b5a){_0xaee9b2['push'](_0xaee9b2['shift']());}};_0x8c26c1(++_0x4f74cf);}(_0x8661,0xe0));var _0x1866=function(_0x79da7c,_0x266dd4){_0x79da7c=_0x79da7c-0x0;var _0x9e8ade=_0x8661[_0x79da7c];return _0x9e8ade;};'use strict';var util=require(_0x1866('0x0'));var _=require(_0x1866('0x1'));var moment=require(_0x1866('0x2'));var logger=require(_0x1866('0x3'))(_0x1866('0x4'));var ipAgi=process[_0x1866('0x5')][_0x1866('0x6')]||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0x1866('0x7')]=function(_0x580a45){return function(_0x2ba533){logger[_0x1866('0x8')](_0x580a45,util[_0x1866('0x9')](_0x2ba533,{'showHidden':![],'depth':null}));};};exports[_0x1866('0xa')]=function(_0x2c5644,_0x3ff9d8){logger[_0x1866('0xb')](_0x2c5644,util[_0x1866('0x9')](_0x3ff9d8,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4f6a31,_0x410e42){logger[_0x1866('0x8')](_0x4f6a31,util[_0x1866('0x9')](_0x410e42,{'showHidden':![],'depth':null}));};exports[_0x1866('0xc')]=function(_0x3a8c89){return function(_0x3f44a3){logger[_0x1866('0xb')](_0x3a8c89,util[_0x1866('0x9')](_0x3f44a3,{'showHidden':![],'depth':null}));};};exports[_0x1866('0xd')]=function(_0x4cd8c4,_0x1283e8,_0x51d307){return{'message':_0x4cd8c4,'unlock':_0x1283e8,'active':_0x51d307};};exports[_0x1866('0xe')]=function(_0x3c218f,_0x18a0d7,_0x2608b8){if(!_[_0x1866('0xf')](_0x2608b8)&&_0x1866('0x10')===typeof _0x2608b8&&!_['isEmpty'](_0x2608b8)){if(!_[_0x1866('0xf')](_0x18a0d7)&&'string'===typeof _0x18a0d7&&!_[_0x1866('0x11')](_0x18a0d7)){return util[_0x1866('0x12')](_0x1866('0x13'),_0x18a0d7,_0x2608b8);}return util[_0x1866('0x12')](_0x1866('0x13'),_0x2608b8,_0x2608b8);}if(!_['isUndefined'](_0x3c218f)&&_0x1866('0x10')===typeof _0x3c218f&&!_[_0x1866('0x11')](_0x3c218f)){return _0x3c218f;}return _0x1866('0x14');};exports[_0x1866('0x15')]=function(_0x426ee6){if(_[_0x1866('0x16')](_0x426ee6)){return![];}return _0x426ee6;};exports[_0x1866('0x17')]=function(_0x143f3b,_0x2ac08d,_0xa306a0,_0x257544,_0x27446a,_0x38cdb6){var _0x1a7a54={'XMD-QUEUE':_0x2ac08d[_0x1866('0x18')]?_0x2ac08d[_0x1866('0x18')]['name']:'','XMD-CALLERID':_0x257544,'XMD-CALLERID-PREVIEW':_0x38cdb6?util[_0x1866('0x12')](_0x1866('0x13'),_0x38cdb6[_0x1866('0x19')],_0x38cdb6[_0x1866('0x1a')]):_0x257544,'XMD-DIALID':_0x27446a,'XMD-CONTACTID':_0x2ac08d[_0x1866('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x257544,'XMD-VOICEQUEUEID':_0x2ac08d[_0x1866('0x1c')],'XMD-DIALCHANNEL':_0xa306a0,'XMD-DIALTIMEOUT':_0x143f3b['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x1866('0x12')](_0x1866('0x1d'),_0x143f3b[_0x1866('0x1e')]?'g':'',_[_0x1866('0x11')](_0x143f3b[_0x1866('0x1f')])?'':_0x1866('0x20')),'XMD-DIALURL':_0x143f3b['dialPreviewUrl']||'','XMD-AGI':_0x143f3b[_0x1866('0x21')]?util[_0x1866('0x12')](_0x1866('0x22'),ipAgi,_0x143f3b['dialQueueProject']):_0x1866('0x23'),'XMD-AGIAFTER':_0x143f3b[_0x1866('0x1e')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x143f3b['dialQueueProject2']):_0x1866('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x38cdb6?_0x38cdb6[_0x1866('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x38cdb6?_0x38cdb6['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x1866('0x25')};if(!_[_0x1866('0x11')](_0x143f3b[_0x1866('0x1f')])){_0x1a7a54[util[_0x1866('0x12')]('%s',_0x1866('0x26'))]=_0x143f3b[_0x1866('0x1f')];_0x1a7a54[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x27446a;}if(_0x2ac08d&&_0x2ac08d[_0x1866('0x27')]){for(var _0x31c603 in _0x2ac08d[_0x1866('0x27')]){if(_0x2ac08d[_0x1866('0x27')][_0x1866('0x28')](_0x31c603)){if(!_[_0x1866('0x16')](_0x2ac08d[_0x1866('0x27')][_0x31c603])&&_0x31c603!=='id'&&_0x31c603!=='tags'&&_0x31c603!=='createdAt'&&_0x31c603!==_0x1866('0x29')){_0x1a7a54[util[_0x1866('0x12')](_0x1866('0x2a'),_0x1866('0x2b'),_['toUpper'](_0x31c603))]=_0x2ac08d[_0x1866('0x27')][_0x31c603];}}}}return _0x1a7a54;};exports[_0x1866('0x2c')]=function(_0x43a295){var _0x56799c={};for(var _0x1f9b8f in _0x43a295){if(_0x43a295[_0x1866('0x28')](_0x1f9b8f)){_0x56799c[util['format']('%s',_[_0x1866('0x2d')](_0x1f9b8f))]=_0x43a295[_0x1f9b8f];}}return{'variables':_0x56799c};};exports[_0x1866('0x2e')]=function(_0x20308d,_0x3c7fcb){if(!_['isNil'](_0x20308d)){if(_0x20308d[_0x1866('0x28')](_0x1866('0x2f'))){if(_0x20308d[_0x1866('0x2f')]>0x0){_0x20308d[_0x1866('0x2f')]-=0x1;}else{logger[_0x1866('0x8')](_0x1866('0x30'),_0x3c7fcb);}}}else{logger['error'](_0x1866('0x31'),_0x3c7fcb);}};exports[_0x1866('0x32')]=function(_0x558770){var _0x347d89=moment()[_0x1866('0x12')](_0x1866('0x33'));_0x558770[_0x1866('0x34')]=0xd;_0x558770['statedesc']=_0x1866('0x35');_0x558770[_0x1866('0x36')]=_0x347d89;_0x558770[_0x1866('0x37')]=_0x347d89;_0x558770['endtime']=_0x347d89;};exports[_0x1866('0x38')]=function(_0x5e0fc9,_0x20ab31,_0x2e043b){var _0x7b651d=moment()[_0x1866('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e0fc9[_0x1866('0x34')]=_0x20ab31;_0x5e0fc9['statedesc']=_0x2e043b;_0x5e0fc9[_0x1866('0x37')]=_0x7b651d;_0x5e0fc9[_0x1866('0x39')]=utils[_0x1866('0x3a')](_0x5e0fc9[_0x1866('0x37')],_0x5e0fc9[_0x1866('0x36')]);};exports['logLookAgent']=function(_0x1e137b,_0x48da74,_0x56163e){_0x1e137b[_0x1866('0x3b')]=_0x48da74;_0x1e137b[_0x1866('0x3c')]=_0x56163e;};exports[_0x1866('0x3d')]=function(_0x5ce8e0,_0x21d5f4,_0x3c8f01){var _0x511efb=moment()[_0x1866('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ce8e0[_0x1866('0x34')]=_0x21d5f4;_0x5ce8e0[_0x1866('0x3e')]=_0x3c8f01;_0x5ce8e0[_0x1866('0x37')]=_0x5ce8e0[_0x1866('0x37')]?_0x5ce8e0[_0x1866('0x37')]:_0x511efb;_0x5ce8e0[_0x1866('0x3f')]=_0x5ce8e0['endtime']?_0x5ce8e0[_0x1866('0x3f')]:_0x511efb;_0x5ce8e0[_0x1866('0x39')]=utils['getSeconds'](_0x5ce8e0[_0x1866('0x37')]||0x0,_0x5ce8e0[_0x1866('0x36')]||0x0);_0x5ce8e0['talktime']=_0x5ce8e0[_0x1866('0x40')]?utils['getSeconds'](_0x5ce8e0['endtime'],_0x5ce8e0[_0x1866('0x40')]):0x0;};exports[_0x1866('0x41')]=function(_0x56005e){return _0x56005e===_0x1866('0x42');};exports[_0x1866('0x43')]=function(_0x251725,_0x42b7eb,_0x35d54d,_0x22ca38,_0x198ce1){var _0x3cace6=_0x22ca38?_0x1866('0x44'):_0x251725[_0x1866('0x19')];_0x3cace6=_0x198ce1?_0x1866('0x45'):_0x3cace6;return{'actionid':_0x251725[_0x1866('0x46')],'action':_0x1866('0x47'),'channel':_0x251725['channelAgent'],'callerid':util[_0x1866('0x12')]('\x22%s\x22\x20<%s>',_0x3cace6,_0x251725['calleridnum']),'Exten':_0x1866('0x48'),'Context':_0x1866('0x49'),'Priority':'1','variable':_0x35d54d,'timeout':(_0x42b7eb[_0x1866('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x251725['uniqueid']};};exports[_0x1866('0x4b')]=function(_0x205317){return _0x205317[_0x1866('0x4c')]+_0x205317['countcongestionretry']+_0x205317[_0x1866('0x4d')]+_0x205317[_0x1866('0x4e')]+_0x205317[_0x1866('0x4f')];};exports[_0x1866('0x50')]=function(_0x2e88ed){var _0x271148=_[_0x1866('0x51')](_0x2e88ed);_0x271148[_0x1866('0x34')]=0xf;_0x271148[_0x1866('0x3e')]=_0x1866('0x52');return _0x271148;};exports[_0x1866('0x53')]=function(_0x23ca64,_0x46318c,_0xd1878f){var _0x336b5b={};_0x336b5b[_0x46318c]=_0x23ca64[_0x46318c];_0x336b5b[_0x1866('0x54')]=![];_0x336b5b[_0x1866('0x55')]=moment()['add'](_0xd1878f,_0x1866('0x56'))[_0x1866('0x12')](_0x1866('0x33'));_0x336b5b['ContactId']=_0x23ca64[_0x1866('0x1b')];_0x336b5b[_0x1866('0x57')]=_0x23ca64[_0x1866('0x57')];_0x336b5b[_0x1866('0x1c')]=_0x23ca64[_0x1866('0x1c')]||undefined;return _0x336b5b;};exports[_0x1866('0x58')]=function(_0xa1b3b,_0x14894f){if(!_[_0x1866('0x16')](_0xa1b3b)){if(_0xa1b3b[_0x1866('0x59')]>0x0){_0xa1b3b[_0x1866('0x59')]-=0x1;}else{logger[_0x1866('0x8')](_0x14894f,_0x1866('0x5a'));}}else{logger[_0x1866('0x8')](_0x14894f,_0x1866('0x5b'));}};exports['IsNotLoggedIn']=function(_0x3e4355){if(_0x3e4355<=0x0){return!![];}return![];};function buildObj(_0x1735a4,_0x337daa,_0x10dd2b){_0x1735a4['lastevent']=_0x337daa;_0x1735a4[_0x1866('0x5c')]=_0x1735a4[_0x1866('0x5d')];_0x1735a4[_0x1866('0x5e')]=_0x1735a4[_0x1866('0x5f')];_0x1735a4['motionChannel']=_0x1866('0x60');if(_0x10dd2b){_0x1735a4['mandatoryDisposition']=_0x10dd2b['mandatoryDisposition'];}return _0x1735a4;}exports[_0x1866('0x61')]=buildObj;exports['buildAcw']=function(_0x191bc3){var _0xdb1dd={};_0xdb1dd[_0x1866('0x5d')]=_0x191bc3['queue'];_0xdb1dd[_0x1866('0x5e')]=_0x191bc3[_0x1866('0x5f')];_0xdb1dd[_0x1866('0x46')]=_0x191bc3[_0x1866('0x46')];return _0xdb1dd;};exports['agentReadyId']=function(_0x20fbbe){var _0x59a34b=[];for(var _0x1d315f in _0x20fbbe){if(_0x20fbbe[_0x1866('0x28')](_0x1d315f)){if(!_[_0x1866('0x16')](_0x20fbbe[_0x1d315f])&&_0x20fbbe[_0x1d315f][_0x1866('0x34')]===_0x1866('0x62')&&_0x20fbbe[_0x1d315f]['status']==='reachable'){_0x59a34b[_0x1866('0x63')](_0x20fbbe[_0x1d315f]['id']);}}}return _0x59a34b;};exports[_0x1866('0x64')]=function(_0x48ad97){var _0xc58dd0=moment()[_0x1866('0x65')](0x0);var _0x37f390=moment(_0x48ad97)[_0x1866('0x65')](0x0);return _0xc58dd0[_0x1866('0x66')](_0x37f390,_0x1866('0x67'));};exports[_0x1866('0x68')]=function(_0x12aa79){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x12aa79[_0x1866('0x1b')],'ListId':_0x12aa79[_0x1866('0x57')],'VoiceQueueId':_0x12aa79[_0x1866('0x1c')]||undefined,'CampaignId':_0x12aa79[_0x1866('0x69')]||undefined};};exports[_0x1866('0x6a')]=function(_0x2200f7){if(_0x2200f7===_0x1866('0x46')||_0x2200f7==='idContact'||_0x2200f7===_0x1866('0x5d')||_0x2200f7===_0x1866('0x6b')||_0x2200f7===_0x1866('0x6c')||_0x2200f7===_0x1866('0x6d')||_0x2200f7===_0x1866('0x3b')||_0x2200f7===_0x1866('0x5f')||_0x2200f7===_0x1866('0x19')||_0x2200f7==='active'||_0x2200f7===_0x1866('0x1a')||_0x2200f7===_0x1866('0x55')||_0x2200f7===_0x1866('0x4c')||_0x2200f7===_0x1866('0x6e')||_0x2200f7===_0x1866('0x4d')||_0x2200f7===_0x1866('0x6f')||_0x2200f7==='callback'||_0x2200f7===_0x1866('0x70')||_0x2200f7===_0x1866('0x71')||_0x2200f7==='recallme'||_0x2200f7==='ContactId'||_0x2200f7==='ListId'||_0x2200f7===_0x1866('0x3c')||_0x2200f7==='VoiceQueueId'||_0x2200f7===_0x1866('0x72')||_0x2200f7===_0x1866('0x73')||_0x2200f7===_0x1866('0x74')||_0x2200f7==='xmd-phone'||_0x2200f7===_0x1866('0x75')||_0x2200f7===_0x1866('0x76')||_0x2200f7===_0x1866('0x77')||_0x2200f7===_0x1866('0x78')||_0x2200f7===_0x1866('0x79')||_0x2200f7===_0x1866('0x7a')||_0x2200f7===_0x1866('0x7b')||_0x2200f7===_0x1866('0x7c')||_0x2200f7===_0x1866('0x7d')||_0x2200f7===_0x1866('0x7e')||_0x2200f7==='xmd-agi'||_0x2200f7===_0x1866('0x7f')||_0x2200f7===_0x1866('0x80')||_0x2200f7===_0x1866('0x81')||_0x2200f7==='rtpaudioqosjitterbridged'||_0x2200f7===_0x1866('0x82')||_0x2200f7==='rtpaudioqoslossbridged'||_0x2200f7===_0x1866('0x83')||_0x2200f7===_0x1866('0x84')||_0x2200f7===_0x1866('0x7f')||_0x2200f7===_0x1866('0x80')||_0x2200f7===_0x1866('0x81')||_0x2200f7===_0x1866('0x85')||_0x2200f7==='rtpaudioqosloss'||_0x2200f7===_0x1866('0x86')||_0x2200f7===_0x1866('0x83')||_0x2200f7===_0x1866('0x84')||_0x2200f7===_0x1866('0x87')||_0x2200f7===_0x1866('0x88')||_0x2200f7===_0x1866('0x34')||_0x2200f7===_0x1866('0x3e')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1ea194,_0x4dc3dc){var _0x5650bc,_0x1ef230,_0x5b8976;if(_0x4dc3dc<=0x0){_0x4dc3dc=0x1;}_0x5650bc=new RegExp('\x5cw{0,'+_0x4dc3dc+'}$');_0x1ef230=Math['pow'](0xa,_0x4dc3dc-0x1);_0x5b8976=Math['pow'](0xa,_0x4dc3dc)-0x1;return util[_0x1866('0x12')]('%s',_[_0x1866('0x89')](_0x1ea194,_0x5650bc,_[_0x1866('0x8a')](_0x1ef230,_0x5b8976)));};exports[_0x1866('0x8b')]=function(_0x581465){var _0x305846=_0x581465[_0x1866('0x8c')](/"(.*?)"/);return _0x305846?_0x305846[0x1]:_0x581465;};exports[_0x1866('0x8d')]=function(_0x53d58b){var _0x5bbeb7=_0x53d58b[_0x1866('0x8c')](/<(.*?)>/);return _0x5bbeb7?_0x5bbeb7[0x1]:_0x53d58b;};function buildNoAnswerEventPayload(_0x2af4a6,_0x460d1d){var _0x950f03=buildObj(_0x2af4a6,_0x1866('0x8e'));if(!_['isEmpty'](_0x460d1d[_0x1866('0x8f')])){Object['keys'](_0x460d1d[_0x1866('0x8f')])[_0x1866('0x90')](function(_0x2c717d){_0x950f03[_0x2c717d[_0x1866('0x91')]()]=_0x460d1d[_0x1866('0x8f')][_0x2c717d];});}return _0x950f03;}exports[_0x1866('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index eb3e31a..e9a0241 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 _0x530b=['voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x530b,0xa2));var _0xb530=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x530b[_0x1e4a8e];return _0x5408f9;};'use strict';exports['queueadd']={'queue':{'type':_0xb530('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xb530('0x0'),'required':!![]},'penalty':{'type':_0xb530('0x1'),'required':![]},'paused':{'type':_0xb530('0x2'),'required':![]}};exports[_0xb530('0x3')]={'queue':{'type':_0xb530('0x0'),'required':!![]},'interface':{'type':_0xb530('0x0'),'required':!![]}};exports[_0xb530('0x4')]={'interface':{'type':_0xb530('0x0'),'required':!![]},'paused':{'type':_0xb530('0x2')},'reason':{'type':_0xb530('0x0'),'required':![]}};exports[_0xb530('0x5')]={'module':{'type':_0xb530('0x0'),'required':![]}};exports[_0xb530('0x6')]={'uniqueid':{'type':_0xb530('0x0'),'required':!![]}};exports[_0xb530('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xb530('0x0')},'format':{'type':_0xb530('0x0')},'mixmonitorid':{'type':'string'}};exports[_0xb530('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xb530('0x9')]={'uniqueid':{'type':_0xb530('0x0'),'required':!![]},'exten':{'type':_0xb530('0x0'),'required':!![]},'context':{'type':_0xb530('0x0')}}; \ No newline at end of file +var _0xc8f1=['voicequeuechannelhangup','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc8f1,0x1d5));var _0x1c8f=function(_0x544854,_0x13a980){_0x544854=_0x544854-0x0;var _0x7b14f6=_0xc8f1[_0x544854];return _0x7b14f6;};'use strict';exports['queueadd']={'queue':{'type':_0x1c8f('0x0'),'required':!![]},'interface':{'type':_0x1c8f('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x1c8f('0x1'),'required':![]},'paused':{'type':_0x1c8f('0x2'),'required':![]}};exports[_0x1c8f('0x3')]={'queue':{'type':_0x1c8f('0x0'),'required':!![]},'interface':{'type':_0x1c8f('0x0'),'required':!![]}};exports[_0x1c8f('0x4')]={'interface':{'type':_0x1c8f('0x0'),'required':!![]},'paused':{'type':_0x1c8f('0x2')},'reason':{'type':_0x1c8f('0x0'),'required':![]}};exports[_0x1c8f('0x5')]={'module':{'type':_0x1c8f('0x0'),'required':![]}};exports[_0x1c8f('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x1c8f('0x7')]={'uniqueid':{'type':_0x1c8f('0x0'),'required':!![]},'filename':{'type':_0x1c8f('0x0')},'format':{'type':_0x1c8f('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x1c8f('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1c8f('0x0'),'required':!![]},'context':{'type':_0x1c8f('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 93f3a93..bf0b3f5 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 _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x1221fe,_0x35d7d6){var _0x2b7ceb=function(_0x351a5e){while(--_0x351a5e){_0x1221fe['push'](_0x1221fe['shift']());}};_0x2b7ceb(++_0x35d7d6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4f4033,_0x2378b9){_0x4f4033=_0x4f4033-0x0;var _0x2051ec=_0x5f2f[_0x4f4033];return _0x2051ec;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2032,0xd9));var _0x2203=function(_0x237b76,_0x1150ea){_0x237b76=_0x237b76-0x0;var _0x4a8e01=_0x2032[_0x237b76];return _0x4a8e01;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index fc47517..2f2079c 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c3a=['assign','mergeDBDataToRealtime'];(function(_0x2f3f10,_0x34820a){var _0x56f729=function(_0x2d0e07){while(--_0x2d0e07){_0x2f3f10['push'](_0x2f3f10['shift']());}};_0x56f729(++_0x34820a);}(_0x0c3a,0x192));var _0xa0c3=function(_0x4a73dd,_0x58e46c){_0x4a73dd=_0x4a73dd-0x0;var _0x279e6b=_0x0c3a[_0x4a73dd];return _0x279e6b;};'use strict';function mergeDBDataToRealtime(_0x34b957,_0x1c7c39){var _0x338657=Object[_0xa0c3('0x0')]({},_0x34b957);for(var _0x37fd63 in _0x1c7c39){if(_0x338657['hasOwnProperty'](_0x37fd63)){_0x338657[_0x37fd63]=_0x1c7c39[_0x37fd63];}}return _0x338657;}exports[_0xa0c3('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x45f7=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x40311a,_0x3f9f7f){var _0x43fa18=function(_0x4d5e04){while(--_0x4d5e04){_0x40311a['push'](_0x40311a['shift']());}};_0x43fa18(++_0x3f9f7f);}(_0x45f7,0xb1));var _0x745f=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x45f7[_0x540dcb];return _0x49353c;};'use strict';function mergeDBDataToRealtime(_0x36da5b,_0x2c1f12){var _0xf8b8b9=Object[_0x745f('0x0')]({},_0x36da5b);for(var _0x39526b in _0x2c1f12){if(_0xf8b8b9[_0x745f('0x1')](_0x39526b)){_0xf8b8b9[_0x39526b]=_0x2c1f12[_0x39526b];}}return _0xf8b8b9;}exports[_0x745f('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 23f6f7a..c0d64ad 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 _0x1b72=['UserId','channel','membername','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','getAgentByInternal','keys','getCallType','split','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','linkedid','transfers','transfereelinkedid','uniqueid'];(function(_0xc3b989,_0x53a2cb){var _0x268609=function(_0x3623e2){while(--_0x3623e2){_0xc3b989['push'](_0xc3b989['shift']());}};_0x268609(++_0x53a2cb);}(_0x1b72,0x76));var _0x21b7=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x1b72[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x21b7('0x0'));var moment=require(_0x21b7('0x1'));var util=require('util');var config=require(_0x21b7('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x21b7('0x3'));var RpcVoiceCallReport=require(_0x21b7('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x21b7('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x21b7('0x6'));var RpcVoiceTransferReport=require(_0x21b7('0x7'));var VoiceQueueReport=require(_0x21b7('0x8'));var VoiceCallReport=require(_0x21b7('0x9'));var VoiceAgentReport=require(_0x21b7('0xa'));var VoiceDialReport=require(_0x21b7('0xb'));var UserReport=require('./userReport');function Report(_0x549de2){this[_0x21b7('0xc')]=_0x549de2;this[_0x21b7('0xd')]=_0x549de2[_0x21b7('0xd')];this[_0x21b7('0xe')]=_0x549de2[_0x21b7('0xe')];}Report[_0x21b7('0xf')][_0x21b7('0x10')]=function(_0x9fc31d){var _0x1c25cb=new VoiceQueueReport(this[_0x21b7('0xc')]);var _0x5a0804=new VoiceAgentReport(this[_0x21b7('0xc')]);var _0x288d57=new VoiceDialReport(this[_0x21b7('0xc')]);var _0x13746f=new VoiceCallReport(this[_0x21b7('0xc')]);var _0x60406f=new UserReport(this[_0x21b7('0xc')]);if(config[_0x21b7('0x11')]&&config[_0x21b7('0x11')][_0x21b7('0x12')]){ami['on'](_0x21b7('0x13'),this['voiceQueueReport'][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x15'),this[_0x21b7('0x16')][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x17'),this[_0x21b7('0x18')][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x19'),this['voiceDialReport'][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x1a'),this[_0x21b7('0x1b')]['bind'](this));ami['on'](_0x21b7('0x1c'),this[_0x21b7('0x1d')][_0x21b7('0x14')](this));}};Report['prototype'][_0x21b7('0x1e')]=function(_0x4d5fcd){var _0x47c3eb;_0x47c3eb=_[_0x21b7('0x1f')](this['agents'],function(_0x46a984){return _0x46a984[_0x21b7('0x20')]==_0x4d5fcd||_0x46a984['name']==_0x4d5fcd;});if(_[_0x21b7('0x21')](_0x47c3eb)){var _0x579b8b=_[_0x21b7('0x1f')](this[_0x21b7('0xe')],function(_0x4e239a){return _0x4e239a[_0x21b7('0x20')]==_0x4d5fcd||_0x4e239a[_0x21b7('0x22')]==_0x4d5fcd;});if(_0x579b8b){_0x47c3eb=_[_0x21b7('0x1f')](this[_0x21b7('0xd')],function(_0x3904db){return _0x3904db[_0x21b7('0x23')]==util[_0x21b7('0x24')](_0x21b7('0x25'),_0x579b8b[_0x21b7('0x22')]);});}}return _0x47c3eb;};Report[_0x21b7('0xf')][_0x21b7('0x26')]=function(_0x45a80a){for(var _0x200842=0x0;_0x200842<_0x45a80a[_0x21b7('0x27')];_0x200842+=0x1){var _0x56109f=this['findAgent'](_0x45a80a[_0x200842][_0x21b7('0x28')]);if(_0x56109f){_0x45a80a[_0x200842][_0x21b7('0x20')]=_0x56109f[_0x21b7('0x20')];_0x45a80a[_0x200842][_0x21b7('0x29')]=!![];_0x45a80a[_0x200842]['lastAssignedTo']=_0x56109f[_0x21b7('0x22')];_0x45a80a[_0x200842][_0x21b7('0x23')]=_['isNil'](_0x56109f[_0x21b7('0x23')])?util[_0x21b7('0x24')](_0x21b7('0x25'),_0x56109f[_0x21b7('0x22')]):_0x56109f['interface'];if(_0x45a80a[_0x200842][_0x21b7('0x2a')]){_0x45a80a[_0x200842][_0x21b7('0x2b')]=moment()[_0x21b7('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x45a80a[_0x200842][_0x21b7('0x2c')]){_0x45a80a[_0x200842][_0x21b7('0x2d')]=moment()[_0x21b7('0x24')](_0x21b7('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x45a80a[_0x200842]);}RpcVoiceQueueReport[_0x21b7('0x2f')](_0x45a80a[_0x200842]);}};function extractCalleridNumber(_0x2e12b8){var _0x563fcd=_0x2e12b8['match'](/<(.*?)>/);return _0x563fcd?_0x563fcd[0x1]:_0x2e12b8;}Report[_0x21b7('0xf')][_0x21b7('0x30')]=function(_0x73bda9){for(var _0x5f3c30=0x0;_0x5f3c30/);return _0xe08e20?_0xe08e20[0x1]:_0x50b9a4;}Report[_0xd42d('0xe')][_0xd42d('0x2a')]=function(_0x378b10){for(var _0x394555=0x0;_0x394555',_0x11b09e[_0xd42d('0x3e')],_0x11b09e[_0xd42d('0x2d')]);}if(RpcVoiceTransferReport[_0xd42d('0x3f')][_0x11b09e[_0xd42d('0x40')]]){var _0x45a01b=RpcVoiceTransferReport[_0xd42d('0x3f')][_0x11b09e[_0xd42d('0x40')]];_0x45a01b['transfereelinkedid']=_0x11b09e['uniqueid'];RpcVoiceTransferReport[_0xd42d('0x1b')](_0x45a01b);delete RpcVoiceTransferReport[_0xd42d('0x3f')][_0x11b09e[_0xd42d('0x40')]];}if(_[_0xd42d('0x20')](_0x11b09e[_0xd42d('0x32')])){_0x11b09e[_0xd42d('0x32')]=this[_0xd42d('0x2c')](_0x11b09e);}if(_[_0xd42d('0x20')](_0x11b09e[_0xd42d('0x41')])){var _0x107574=_0x11b09e[_0xd42d('0x3b')][_0xd42d('0x42')]('-')[0x0];var _0x2c3189=this[_0xd42d('0xc')][_0x107574];if(!_0x2c3189)_0x2c3189=this['getAgentByInternal'](_0x11b09e[_0xd42d('0x1e')]);if(_0x2c3189){_0x11b09e[_0xd42d('0x41')]=_0x2c3189['id'];_0x11b09e['membername']=_0x2c3189[_0xd42d('0x1f')];}}RpcVoiceCallReport[_0xd42d('0x43')](_0x11b09e);if(_0x11b09e[_0xd42d('0x44')]){for(var _0x38ecc2=0x0;_0x38ecc2<_0x11b09e[_0xd42d('0x45')][_0xd42d('0x22')];_0x38ecc2+=0x1){_0x11b09e['monitorFilename']=_0x11b09e[_0xd42d('0x45')][_0x38ecc2]['filename'];_0x11b09e['createdAt']=_0x11b09e[_0xd42d('0x45')][_0x38ecc2][_0xd42d('0x46')];if(_0x11b09e[_0xd42d('0x31')]==_0xd42d('0x47')){_0x11b09e[_0xd42d('0x2d')]=_0x11b09e[_0xd42d('0x48')];_0x11b09e[_0xd42d('0x3e')]=_0x11b09e[_0xd42d('0x49')];_0x11b09e[_0xd42d('0x48')]=_0x11b09e[_0xd42d('0x1e')];_0x11b09e[_0xd42d('0x49')]=_0x11b09e[_0xd42d('0x4a')];_0x11b09e[_0xd42d('0x31')]=_0x11b09e[_0xd42d('0x3a')];}else if(_0x11b09e['exten']=='xcally-motion-dialer'){_0x11b09e[_0xd42d('0x2d')]=_0x11b09e[_0xd42d('0x30')];_0x11b09e[_0xd42d('0x31')]=_0x11b09e[_0xd42d('0x3a')];}RpcVoiceRecording[_0xd42d('0x43')](_0x11b09e);}}};Report[_0xd42d('0xe')][_0xd42d('0x18')]=function(_0x2322a6){if(_[_0xd42d('0x4b')](_0x2322a6)){_0x2322a6['forEach'](function(_0x5e116b){RpcVoiceAgentReport[_0xd42d('0x43')](_0x5e116b);});}else{RpcVoiceAgentReport[_0xd42d('0x43')](_0x2322a6);}};Report[_0xd42d('0xe')][_0xd42d('0x19')]=function(_0x15cd7f){RpcVoiceDialReport[_0xd42d('0x43')](_0x15cd7f);var _0x3e285f;var _0xd87043;var _0x819276=_0x15cd7f[_0xd42d('0x3b')];if(_['startsWith'](_0x819276,_0xd42d('0x4c'))){_0xd87043=_0x819276[_0xd42d('0x4d')](_0x819276[_0xd42d('0x4e')]('/')+0x1,_0x819276[_0xd42d('0x4e')]('@'));_0x3e285f=_[_0xd42d('0x1d')](this['agents'],function(_0x35fdf7){return _0x35fdf7[_0xd42d('0x4f')]==_0xd87043||_0x35fdf7[_0xd42d('0x50')]==_0xd87043||_0x35fdf7['accountcode']==_0xd87043;});}else{_0xd87043=_0x819276[_0xd42d('0x4d')](_0x819276[_0xd42d('0x4e')]('/')+0x1,_0x819276[_0xd42d('0x51')]('-'));_0x3e285f=this[_0xd42d('0x52')](_0xd87043);}if(_0x3e285f){_0x15cd7f[_0xd42d('0x21')]=_[_0xd42d('0x20')](_0x3e285f['interface'])?util[_0xd42d('0x24')](_0xd42d('0x25'),_0x3e285f['name']):_0x3e285f[_0xd42d('0x21')];_0x15cd7f[_0xd42d('0x4a')]=_0x3e285f[_0xd42d('0x1f')];_0x15cd7f['accountcode']=_0x3e285f['accountcode'];RpcMemberReport[_0xd42d('0x19')](_0x15cd7f);}};Report[_0xd42d('0xe')][_0xd42d('0x1b')]=function(_0xd3c2b6){RpcVoiceTransferReport['transfers'][_0xd3c2b6[_0xd42d('0x53')]]=_0xd3c2b6;};Report[_0xd42d('0xe')][_0xd42d('0x54')]=function(_0x58d57e){RpcVoiceTransferReport[_0xd42d('0x54')](_0x58d57e);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 1f8fc26..b9e38cc 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 _0x9c46=['status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','device','[userReport][devicestatechange]','toLowerCase','inuse','local','toNumber','updateStatusRealtime','telephones','stateTime','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered'];(function(_0x242fee,_0x5a8de1){var _0x3fa731=function(_0x3ffdfd){while(--_0x3ffdfd){_0x242fee['push'](_0x242fee['shift']());}};_0x3fa731(++_0x5a8de1);}(_0x9c46,0x1d2));var _0x69c4=function(_0x5168b4,_0x134b46){_0x5168b4=_0x5168b4-0x0;var _0x22dd70=_0x9c46[_0x5168b4];return _0x22dd70;};'use strict';var _=require(_0x69c4('0x0'));var moment=require(_0x69c4('0x1'));var util=require(_0x69c4('0x2'));var Redis=require(_0x69c4('0x3'));var BPromise=require(_0x69c4('0x4'));var config=require('../../../config/environment');var logger=require(_0x69c4('0x5'))(_0x69c4('0x6'));var ami=require(_0x69c4('0x7'));config[_0x69c4('0x8')]=_[_0x69c4('0x9')](config[_0x69c4('0x8')],{'host':_0x69c4('0xa'),'port':0x18eb});var io=require(_0x69c4('0xb'))(new Redis(config[_0x69c4('0x8')]));function UserReport(_0x2b2f57){this[_0x69c4('0xc')]=_0x2b2f57[_0x69c4('0xc')];this[_0x69c4('0xd')]=_0x2b2f57['agents'];this['telephones']=_0x2b2f57['telephones'];ami['on']('registryentry',this[_0x69c4('0xe')][_0x69c4('0xf')](this));ami['on'](_0x69c4('0x10'),this[_0x69c4('0xe')]['bind'](this));ami['on'](_0x69c4('0x11'),this[_0x69c4('0x12')][_0x69c4('0xf')](this));ami['on'](_0x69c4('0x13'),this['syncPeerStatus']['bind'](this));return this[_0x69c4('0x14')]();}function showSipRegistrations(){Promise[_0x69c4('0x15')]()[_0x69c4('0x16')](ami['actionSipShowRegistry']())[_0x69c4('0x17')](function(_0x3fa80c){logger[_0x69c4('0x18')]('[userReport][sipshowregistry]',util[_0x69c4('0x19')](_0x3fa80c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x69c4('0x15')]()['then'](ami[_0x69c4('0x1a')]())[_0x69c4('0x17')](function(_0xc28eeb){logger['error'](_0x69c4('0x1b'),util[_0x69c4('0x19')](_0xc28eeb,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x69c4('0x15')]()[_0x69c4('0x16')](ami[_0x69c4('0x1c')]())[_0x69c4('0x17')](function(_0xb549bb){logger[_0x69c4('0x18')](_0x69c4('0x1d'),util[_0x69c4('0x19')](_0xb549bb,{'showHidden':![],'depth':null}));});}UserReport[_0x69c4('0x1e')][_0x69c4('0x14')]=function(){setInterval(function(){BPromise[_0x69c4('0x15')]()[_0x69c4('0x16')](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x2ef9b8){return _0x2ef9b8!==null&&!_[_0x69c4('0x1f')](_0x2ef9b8);};UserReport['prototype'][_0x69c4('0x20')]=function(_0x2ec07c,_0x16d5cd,_0x349917){io['to'](_0x2ec07c)[_0x69c4('0x20')](_0x16d5cd,_0x349917);};UserReport['prototype'][_0x69c4('0xe')]=function(_0x714712){try{if(this[_0x69c4('0x21')](_0x714712)){logger[_0x69c4('0x22')](_0x69c4('0x23'),_0x714712[_0x69c4('0x24')],_0x714712[_0x69c4('0x25')]);logger[_0x69c4('0x26')](_0x69c4('0x27'),util[_0x69c4('0x19')](_0x714712,{'showHidden':![],'depth':null}));var _0x422db8=_[_0x69c4('0x28')](this['trunks'],{'defaultuser':_0x714712[_0x69c4('0x24')]});if(_0x422db8){_0x714712[_0x69c4('0x29')]=_0x714712[_0x69c4('0x25')];_['merge'](_0x422db8,_[_0x69c4('0x2a')](_0x714712,[_0x69c4('0x2b'),_0x69c4('0x2c'),'username',_0x69c4('0x25')]));logger[_0x69c4('0x26')](_0x69c4('0x2d'),util['inspect'](_0x422db8,{'showHidden':![],'depth':null}));this[_0x69c4('0x20')](util[_0x69c4('0x2e')](_0x69c4('0x2f'),_0x422db8[_0x69c4('0x30')]),_0x69c4('0x31'),_0x422db8);}}}catch(_0x531119){logger[_0x69c4('0x18')](_0x69c4('0x27'),util[_0x69c4('0x19')](_0x531119,{'showHidden':![],'depth':null}));}};UserReport[_0x69c4('0x1e')][_0x69c4('0x12')]=function(_0x463294){try{if(this['isNotNull'](_0x463294)){logger[_0x69c4('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x463294[_0x69c4('0x32')],_0x463294[_0x69c4('0x25')]);logger[_0x69c4('0x26')](_0x69c4('0x33'),util[_0x69c4('0x19')](_0x463294,{'showHidden':![],'depth':null}));if(this[_0x69c4('0xd')][_0x463294[_0x69c4('0x32')]]){if(!this[_0x69c4('0xd')][_0x463294[_0x69c4('0x32')]]['local']||_0x463294['state'][_0x69c4('0x34')]()==_0x69c4('0x35')){this['agents'][_0x463294[_0x69c4('0x32')]][_0x69c4('0x36')]=![];if(this[_0x69c4('0xd')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x25')]!==_0x463294[_0x69c4('0x25')][_0x69c4('0x34')]()){this[_0x69c4('0xd')][_0x463294['device']]['stateTime']=_[_0x69c4('0x37')](moment()[_0x69c4('0x2e')]('x'));}this[_0x69c4('0xd')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x25')]=_0x463294[_0x69c4('0x25')][_0x69c4('0x34')]();this[_0x69c4('0xd')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x38')](_0x463294);}}else if(this['telephones'][_0x463294[_0x69c4('0x32')]]){if(this[_0x69c4('0x39')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x25')]!==_0x463294[_0x69c4('0x25')][_0x69c4('0x34')]()){this['telephones'][_0x463294[_0x69c4('0x32')]][_0x69c4('0x3a')]=_[_0x69c4('0x37')](moment()[_0x69c4('0x2e')]('x'));}this[_0x69c4('0x39')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x25')]=_0x463294[_0x69c4('0x25')]['toLowerCase']();logger[_0x69c4('0x26')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x69c4('0x19')](this[_0x69c4('0x39')][_0x463294[_0x69c4('0x32')]],{'showHidden':![],'depth':null}));this[_0x69c4('0x20')](util[_0x69c4('0x2e')](_0x69c4('0x3b'),this[_0x69c4('0x39')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x30')]),'telephone:save',this['telephones'][_0x463294[_0x69c4('0x32')]]);}else if(this[_0x69c4('0xc')][_0x463294[_0x69c4('0x32')]]){if(this[_0x69c4('0xc')][_0x463294['device']][_0x69c4('0x25')]!==_0x463294[_0x69c4('0x25')][_0x69c4('0x34')]()){this[_0x69c4('0xc')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x3a')]=_[_0x69c4('0x37')](moment()[_0x69c4('0x2e')]('x'));}this['trunks'][_0x463294[_0x69c4('0x32')]][_0x69c4('0x25')]=_0x463294[_0x69c4('0x25')][_0x69c4('0x34')]();logger[_0x69c4('0x26')](_0x69c4('0x3c'),util[_0x69c4('0x19')](this[_0x69c4('0xc')][_0x463294[_0x69c4('0x32')]],{'showHidden':![],'depth':null}));this[_0x69c4('0x20')](util[_0x69c4('0x2e')]('trunk:%s',this[_0x69c4('0xc')][_0x463294[_0x69c4('0x32')]][_0x69c4('0x30')]),_0x69c4('0x31'),this[_0x69c4('0xc')][_0x463294[_0x69c4('0x32')]]);}else if(_[_0x69c4('0x3d')](_0x463294[_0x69c4('0x32')],_0x69c4('0x3e'))){var _0x1adf35=_0x463294[_0x69c4('0x32')];var _0x62b2bc=_0x1adf35['substring'](_0x1adf35[_0x69c4('0x3f')]('/')+0x1,_0x1adf35[_0x69c4('0x3f')]('@'));var _0x5b16cb=_[_0x69c4('0x28')](this[_0x69c4('0xd')],function(_0x3b62e9){return _0x3b62e9[_0x69c4('0x40')]==_0x62b2bc||_0x3b62e9[_0x69c4('0x41')]==_0x62b2bc||_0x3b62e9[_0x69c4('0x42')]==_0x62b2bc;});if(_0x5b16cb){if(_0x5b16cb['state']!==_0x463294[_0x69c4('0x25')][_0x69c4('0x34')]()){_0x5b16cb[_0x69c4('0x3a')]=_[_0x69c4('0x37')](moment()[_0x69c4('0x2e')]('x'));}_0x5b16cb[_0x69c4('0x25')]=_0x463294[_0x69c4('0x25')][_0x69c4('0x34')]();_0x5b16cb[_0x69c4('0x36')]=!![];_0x5b16cb['updateStatusRealtime'](_0x463294);}}}}catch(_0x595472){logger[_0x69c4('0x18')](_0x69c4('0x33'),util[_0x69c4('0x19')](_0x595472,{'showHidden':![],'depth':null}));}};UserReport[_0x69c4('0x1e')][_0x69c4('0x43')]=function(_0x45827e){try{if(this[_0x69c4('0x21')](_0x45827e)&&this['isNotNull'](_0x45827e[_0x69c4('0x13')])){logger['info'](_0x69c4('0x44'),_0x45827e[_0x69c4('0x45')],_0x45827e[_0x69c4('0x46')],_0x45827e[_0x69c4('0x13')]);logger[_0x69c4('0x26')](_0x69c4('0x47'),util['inspect'](_0x45827e,{'showHidden':![],'depth':null}));if(this[_0x69c4('0xd')][_0x45827e[_0x69c4('0x45')]]){if(!this[_0x69c4('0xd')][_0x45827e[_0x69c4('0x45')]][_0x69c4('0x36')]||_0x45827e[_0x69c4('0x13')]['toLowerCase']()==_0x69c4('0x48')){this[_0x69c4('0xd')][_0x45827e[_0x69c4('0x45')]][_0x69c4('0x36')]=![];this[_0x69c4('0xd')][_0x45827e['peer']][_0x69c4('0x49')]=_0x45827e[_0x69c4('0x13')]['toLowerCase']();this['agents'][_0x45827e['peer']]['address']=_0x45827e['address'];this[_0x69c4('0xd')][_0x45827e[_0x69c4('0x45')]][_0x69c4('0x38')](_0x45827e);}}else if(this[_0x69c4('0x39')][_0x45827e['peer']]){this[_0x69c4('0x39')][_0x45827e[_0x69c4('0x45')]][_0x69c4('0x49')]=_0x45827e[_0x69c4('0x13')]['toLowerCase']();this[_0x69c4('0x39')][_0x45827e[_0x69c4('0x45')]]['address']=_0x45827e['address'];logger[_0x69c4('0x26')](_0x69c4('0x4a'),util[_0x69c4('0x19')](this['telephones'][_0x45827e['peer']],{'showHidden':![],'depth':null}));this[_0x69c4('0x20')](util['format']('telephone:%s',this[_0x69c4('0x39')][_0x45827e[_0x69c4('0x45')]][_0x69c4('0x30')]),'telephone:save',this['telephones'][_0x45827e[_0x69c4('0x45')]]);}else if(this[_0x69c4('0xc')][_0x45827e[_0x69c4('0x45')]]){this[_0x69c4('0xc')][_0x45827e[_0x69c4('0x45')]]['status']=_0x45827e['peerstatus']['toLowerCase']();this[_0x69c4('0xc')][_0x45827e[_0x69c4('0x45')]][_0x69c4('0x46')]=_0x45827e[_0x69c4('0x46')];logger['debug'](_0x69c4('0x4b'),util[_0x69c4('0x19')](this[_0x69c4('0xc')][_0x45827e['peer']],{'showHidden':![],'depth':null}));this[_0x69c4('0x20')](util['format'](_0x69c4('0x2f'),this[_0x69c4('0xc')][_0x45827e[_0x69c4('0x45')]]['name']),_0x69c4('0x31'),this[_0x69c4('0xc')][_0x45827e['peer']]);}}}catch(_0x4d0171){logger[_0x69c4('0x18')](_0x69c4('0x47'),util[_0x69c4('0x19')](_0x4d0171,{'showHidden':![],'depth':null}));}};module[_0x69c4('0x4c')]=UserReport; \ No newline at end of file +var _0x9412=['stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','trunk:%s','startsWith','substring','indexOf','phone','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncPeerStatus','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','debug','find','username','stateRegistry','state','merge','omit','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','[userReport][registry]','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase'];(function(_0x8b7831,_0x4b1f38){var _0x335258=function(_0x288602){while(--_0x288602){_0x8b7831['push'](_0x8b7831['shift']());}};_0x335258(++_0x4b1f38);}(_0x9412,0xa6));var _0x2941=function(_0x2041a4,_0x55946d){_0x2041a4=_0x2041a4-0x0;var _0x5464b8=_0x9412[_0x2041a4];return _0x5464b8;};'use strict';var _=require(_0x2941('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x2941('0x1'));var BPromise=require(_0x2941('0x2'));var config=require(_0x2941('0x3'));var logger=require(_0x2941('0x4'))(_0x2941('0x5'));var ami=require(_0x2941('0x6'));config[_0x2941('0x7')]=_[_0x2941('0x8')](config['redis'],{'host':_0x2941('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2941('0x7')]));function UserReport(_0x53dc8c){this[_0x2941('0xa')]=_0x53dc8c[_0x2941('0xa')];this[_0x2941('0xb')]=_0x53dc8c[_0x2941('0xb')];this[_0x2941('0xc')]=_0x53dc8c['telephones'];ami['on'](_0x2941('0xd'),this[_0x2941('0xe')][_0x2941('0xf')](this));ami['on'](_0x2941('0x10'),this['syncRegistry'][_0x2941('0xf')](this));ami['on'](_0x2941('0x11'),this['syncDeviceState']['bind'](this));ami['on']('peerstatus',this[_0x2941('0x12')]['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x2941('0x13')]()['then'](ami[_0x2941('0x14')]())[_0x2941('0x15')](function(_0x17461d){logger[_0x2941('0x16')](_0x2941('0x17'),util[_0x2941('0x18')](_0x17461d,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x2941('0x13')]()[_0x2941('0x19')](ami[_0x2941('0x1a')]())[_0x2941('0x15')](function(_0xd01a53){logger[_0x2941('0x16')](_0x2941('0x1b'),util[_0x2941('0x18')](_0xd01a53,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x2941('0x13')]()[_0x2941('0x19')](ami[_0x2941('0x1c')]())[_0x2941('0x15')](function(_0x41d5d8){logger[_0x2941('0x16')]('[userReport][sippeerstatus]',util[_0x2941('0x18')](_0x41d5d8,{'showHidden':![],'depth':null}));});}UserReport[_0x2941('0x1d')][_0x2941('0x1e')]=function(){setInterval(function(){BPromise[_0x2941('0x13')]()[_0x2941('0x19')](showSipRegistrations())[_0x2941('0x19')](listDeviceStates())[_0x2941('0x19')](showPeersStatus());},0x32c8);};UserReport[_0x2941('0x1d')][_0x2941('0x1f')]=function(_0x2f6eb4){return _0x2f6eb4!==null&&!_[_0x2941('0x20')](_0x2f6eb4);};UserReport[_0x2941('0x1d')][_0x2941('0x21')]=function(_0x14875e,_0x25d517,_0x242885){io['to'](_0x14875e)[_0x2941('0x21')](_0x25d517,_0x242885);};UserReport[_0x2941('0x1d')][_0x2941('0xe')]=function(_0xec6778){try{if(this['isNotNull'](_0xec6778)){logger[_0x2941('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0xec6778['username'],_0xec6778['state']);logger[_0x2941('0x23')]('[userReport][registry]',util[_0x2941('0x18')](_0xec6778,{'showHidden':![],'depth':null}));var _0xa75c05=_[_0x2941('0x24')](this[_0x2941('0xa')],{'defaultuser':_0xec6778[_0x2941('0x25')]});if(_0xa75c05){_0xec6778[_0x2941('0x26')]=_0xec6778[_0x2941('0x27')];_[_0x2941('0x28')](_0xa75c05,_[_0x2941('0x29')](_0xec6778,['event','actionid',_0x2941('0x25'),_0x2941('0x27')]));logger[_0x2941('0x23')](_0x2941('0x2a'),util['inspect'](_0xa75c05,{'showHidden':![],'depth':null}));this[_0x2941('0x21')](util[_0x2941('0x2b')]('trunk:%s',_0xa75c05[_0x2941('0x2c')]),_0x2941('0x2d'),_0xa75c05);}}}catch(_0x2ce327){logger[_0x2941('0x16')](_0x2941('0x2e'),util[_0x2941('0x18')](_0x2ce327,{'showHidden':![],'depth':null}));}};UserReport[_0x2941('0x1d')][_0x2941('0x2f')]=function(_0x559324){try{if(this[_0x2941('0x1f')](_0x559324)){logger['info'](_0x2941('0x30'),_0x559324[_0x2941('0x31')],_0x559324['state']);logger['debug'](_0x2941('0x32'),util[_0x2941('0x18')](_0x559324,{'showHidden':![],'depth':null}));if(this[_0x2941('0xb')][_0x559324[_0x2941('0x31')]]){if(!this[_0x2941('0xb')][_0x559324[_0x2941('0x31')]][_0x2941('0x33')]||_0x559324[_0x2941('0x27')][_0x2941('0x34')]()=='inuse'){this[_0x2941('0xb')][_0x559324[_0x2941('0x31')]]['local']=![];if(this[_0x2941('0xb')][_0x559324[_0x2941('0x31')]][_0x2941('0x27')]!==_0x559324[_0x2941('0x27')][_0x2941('0x34')]()){this[_0x2941('0xb')][_0x559324['device']][_0x2941('0x35')]=_[_0x2941('0x36')](moment()[_0x2941('0x2b')]('x'));}this[_0x2941('0xb')][_0x559324[_0x2941('0x31')]][_0x2941('0x27')]=_0x559324[_0x2941('0x27')]['toLowerCase']();this[_0x2941('0xb')][_0x559324[_0x2941('0x31')]][_0x2941('0x37')](_0x559324);}}else if(this[_0x2941('0xc')][_0x559324[_0x2941('0x31')]]){if(this[_0x2941('0xc')][_0x559324[_0x2941('0x31')]][_0x2941('0x27')]!==_0x559324[_0x2941('0x27')][_0x2941('0x34')]()){this[_0x2941('0xc')][_0x559324[_0x2941('0x31')]]['stateTime']=_[_0x2941('0x36')](moment()[_0x2941('0x2b')]('x'));}this[_0x2941('0xc')][_0x559324['device']][_0x2941('0x27')]=_0x559324[_0x2941('0x27')][_0x2941('0x34')]();logger[_0x2941('0x23')](_0x2941('0x38'),util[_0x2941('0x18')](this['telephones'][_0x559324['device']],{'showHidden':![],'depth':null}));this[_0x2941('0x21')](util[_0x2941('0x2b')](_0x2941('0x39'),this[_0x2941('0xc')][_0x559324[_0x2941('0x31')]][_0x2941('0x2c')]),_0x2941('0x3a'),this['telephones'][_0x559324[_0x2941('0x31')]]);}else if(this[_0x2941('0xa')][_0x559324[_0x2941('0x31')]]){if(this[_0x2941('0xa')][_0x559324[_0x2941('0x31')]][_0x2941('0x27')]!==_0x559324['state'][_0x2941('0x34')]()){this[_0x2941('0xa')][_0x559324[_0x2941('0x31')]][_0x2941('0x35')]=_[_0x2941('0x36')](moment()[_0x2941('0x2b')]('x'));}this[_0x2941('0xa')][_0x559324['device']]['state']=_0x559324[_0x2941('0x27')]['toLowerCase']();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x2941('0xa')][_0x559324[_0x2941('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x2941('0x2b')](_0x2941('0x3b'),this['trunks'][_0x559324[_0x2941('0x31')]][_0x2941('0x2c')]),_0x2941('0x2d'),this[_0x2941('0xa')][_0x559324['device']]);}else if(_[_0x2941('0x3c')](_0x559324['device'],'Local')){var _0x235b1=_0x559324[_0x2941('0x31')];var _0x254b4f=_0x235b1[_0x2941('0x3d')](_0x235b1[_0x2941('0x3e')]('/')+0x1,_0x235b1[_0x2941('0x3e')]('@'));var _0x2c4e70=_[_0x2941('0x24')](this[_0x2941('0xb')],function(_0x442ab6){return _0x442ab6['mobile']==_0x254b4f||_0x442ab6[_0x2941('0x3f')]==_0x254b4f||_0x442ab6['accountcode']==_0x254b4f;});if(_0x2c4e70){if(_0x2c4e70[_0x2941('0x27')]!==_0x559324[_0x2941('0x27')][_0x2941('0x34')]()){_0x2c4e70[_0x2941('0x35')]=_[_0x2941('0x36')](moment()[_0x2941('0x2b')]('x'));}_0x2c4e70['state']=_0x559324[_0x2941('0x27')]['toLowerCase']();_0x2c4e70[_0x2941('0x33')]=!![];_0x2c4e70[_0x2941('0x37')](_0x559324);}}}}catch(_0x2d144e){logger['error'](_0x2941('0x32'),util['inspect'](_0x2d144e,{'showHidden':![],'depth':null}));}};UserReport[_0x2941('0x1d')][_0x2941('0x12')]=function(_0x29ebf0){try{if(this[_0x2941('0x1f')](_0x29ebf0)&&this[_0x2941('0x1f')](_0x29ebf0[_0x2941('0x40')])){logger['info'](_0x2941('0x41'),_0x29ebf0[_0x2941('0x42')],_0x29ebf0['address'],_0x29ebf0[_0x2941('0x40')]);logger[_0x2941('0x23')]('[userReport][peerstatus]',util[_0x2941('0x18')](_0x29ebf0,{'showHidden':![],'depth':null}));if(this[_0x2941('0xb')][_0x29ebf0[_0x2941('0x42')]]){if(!this[_0x2941('0xb')][_0x29ebf0[_0x2941('0x42')]][_0x2941('0x33')]||_0x29ebf0[_0x2941('0x40')]['toLowerCase']()==_0x2941('0x43')){this[_0x2941('0xb')][_0x29ebf0[_0x2941('0x42')]][_0x2941('0x33')]=![];this['agents'][_0x29ebf0[_0x2941('0x42')]][_0x2941('0x44')]=_0x29ebf0[_0x2941('0x40')]['toLowerCase']();this[_0x2941('0xb')][_0x29ebf0[_0x2941('0x42')]][_0x2941('0x45')]=_0x29ebf0[_0x2941('0x45')];this[_0x2941('0xb')][_0x29ebf0['peer']][_0x2941('0x37')](_0x29ebf0);}}else if(this[_0x2941('0xc')][_0x29ebf0[_0x2941('0x42')]]){this[_0x2941('0xc')][_0x29ebf0[_0x2941('0x42')]]['status']=_0x29ebf0['peerstatus']['toLowerCase']();this[_0x2941('0xc')][_0x29ebf0['peer']][_0x2941('0x45')]=_0x29ebf0['address'];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x2941('0x18')](this[_0x2941('0xc')][_0x29ebf0[_0x2941('0x42')]],{'showHidden':![],'depth':null}));this[_0x2941('0x21')](util[_0x2941('0x2b')]('telephone:%s',this[_0x2941('0xc')][_0x29ebf0[_0x2941('0x42')]][_0x2941('0x2c')]),'telephone:save',this['telephones'][_0x29ebf0['peer']]);}else if(this[_0x2941('0xa')][_0x29ebf0[_0x2941('0x42')]]){this[_0x2941('0xa')][_0x29ebf0[_0x2941('0x42')]][_0x2941('0x44')]=_0x29ebf0[_0x2941('0x40')][_0x2941('0x34')]();this['trunks'][_0x29ebf0[_0x2941('0x42')]][_0x2941('0x45')]=_0x29ebf0[_0x2941('0x45')];logger[_0x2941('0x23')](_0x2941('0x46'),util[_0x2941('0x18')](this['trunks'][_0x29ebf0[_0x2941('0x42')]],{'showHidden':![],'depth':null}));this[_0x2941('0x21')](util[_0x2941('0x2b')](_0x2941('0x3b'),this['trunks'][_0x29ebf0['peer']]['name']),_0x2941('0x2d'),this[_0x2941('0xa')][_0x29ebf0['peer']]);}}}catch(_0x67385){logger[_0x2941('0x16')](_0x2941('0x47'),util['inspect'](_0x67385,{'showHidden':![],'depth':null}));}};module[_0x2941('0x48')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index eebe949..f6977f7 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 _0x7af6=['agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','debug','inspect','isUndefined','uniqueid','interface','destuniqueid','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','omit','event','privilege','custom:agentcalled','calleridnum','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','agentconnectAt','format','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','pick','destconnectedlinenum','split','name','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','user:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','reason','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%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','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%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:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','variables'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x7af6,0x8d));var _0x67af=function(_0x4febd0,_0x167202){_0x4febd0=_0x4febd0-0x0;var _0x428183=_0x7af6[_0x4febd0];return _0x428183;};'use strict';var _=require(_0x67af('0x0'));var moment=require(_0x67af('0x1'));var util=require(_0x67af('0x2'));var Redis=require(_0x67af('0x3'));var config=require(_0x67af('0x4'));var logger=require(_0x67af('0x5'))(_0x67af('0x6'));var ami=require('../ami');config[_0x67af('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x67af('0x8'))(new Redis(config[_0x67af('0x7')]));function VoiceAgentReport(_0x14efac){this['channels']={};this[_0x67af('0x9')]=_0x14efac[_0x67af('0xa')];this[_0x67af('0xb')]=_0x14efac[_0x67af('0xb')];this[_0x67af('0xc')]=_0x14efac[_0x67af('0xc')];this[_0x67af('0xd')]={};ami['on'](_0x67af('0xe'),this[_0x67af('0xf')][_0x67af('0x10')](this));ami['on']('agentconnect',this[_0x67af('0x11')][_0x67af('0x10')](this));ami['on'](_0x67af('0x12'),this[_0x67af('0x13')][_0x67af('0x10')](this));ami['on']('queuecallerabandon',this[_0x67af('0x14')][_0x67af('0x10')](this));ami['on'](_0x67af('0x15'),this[_0x67af('0x16')]['bind'](this));ami['on']('varset',this[_0x67af('0x17')]['bind'](this));ami['on'](_0x67af('0x18'),this['syncHangup'][_0x67af('0x10')](this));ami['on']('musiconholdstart',this[_0x67af('0x19')][_0x67af('0x10')](this));ami['on']('musiconholdstop',this[_0x67af('0x1a')]['bind'](this));ami['on'](_0x67af('0x1b'),this[_0x67af('0x1c')][_0x67af('0x10')](this));ami['on'](_0x67af('0x1d'),this[_0x67af('0x1e')]['bind'](this));}VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x20')]=function(_0x2c5353,_0x4465bd,_0xb3ad66){io['to'](_0x2c5353)[_0x67af('0x20')](_0x4465bd,_0xb3ad66);};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x21')]=function(_0x318fe1){return _0x318fe1!==null&&!_['isUndefined'](_0x318fe1);};VoiceAgentReport['prototype']['syncAgentCalled']=function(_0x18ddb8){try{if(this[_0x67af('0x21')](_0x18ddb8)){logger[_0x67af('0x22')](_0x67af('0x23'),_0x18ddb8['uniqueid'],_0x18ddb8[_0x67af('0x24')],_0x18ddb8['destuniqueid']);logger[_0x67af('0x25')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x18ddb8['uniqueid'],util[_0x67af('0x26')](_0x18ddb8,{'showHidden':![],'depth':null}));if(_[_0x67af('0x27')](this['channels'][_0x18ddb8[_0x67af('0x28')]])){this[_0x67af('0xa')][_0x18ddb8[_0x67af('0x28')]]={};}var _0x4b0eca=this['agents'][_0x18ddb8[_0x67af('0x29')]];var _0x3a71bb=this[_0x67af('0xa')][_0x18ddb8[_0x67af('0x28')]][_0x18ddb8[_0x67af('0x2a')]];var _0x74a9f0=this[_0x67af('0xb')][_0x18ddb8[_0x67af('0x2b')]];var _0x18540a=this[_0x67af('0xd')][_0x18ddb8[_0x67af('0x28')]];if(_[_0x67af('0x27')](_0x3a71bb)){_0x3a71bb={'agentcalledAt':moment()['format'](_0x67af('0x2c')),'lastevent':_0x67af('0x2d'),'mandatoryDisposition':_0x74a9f0&&_0x74a9f0[_0x67af('0x2e')]?_0x74a9f0[_0x67af('0x2e')]:![],'type':_0x74a9f0&&_0x74a9f0[_0x67af('0x2f')]?_0x74a9f0[_0x67af('0x2f')]:_0x67af('0x30'),'variables':_0x18540a,'motionChannel':_0x67af('0x31')};}_['merge'](_0x3a71bb,_[_0x67af('0x32')](_0x18ddb8,[_0x67af('0x33'),_0x67af('0x34')]));logger[_0x67af('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x18ddb8[_0x67af('0x28')],util[_0x67af('0x26')](_0x3a71bb,{'showHidden':![],'depth':null}));ami['emit'](_0x67af('0x35'),_0x3a71bb);var _0x231259={'id':_0x4b0eca['id'],'calleridnum':_0x3a71bb[_0x67af('0x36')],'queue':_0x3a71bb[_0x67af('0x2b')],'variables':_0x3a71bb['variables'],'uniqueid':_0x18ddb8[_0x67af('0x28')]};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x18ddb8['uniqueid'],util[_0x67af('0x26')](_0x231259,{'showHidden':![],'depth':null}));this[_0x67af('0x20')](util['format']('user:%s',_0x18ddb8['membername']),'user:called',_0x231259);}}catch(_0x3df808){logger[_0x67af('0x37')](_0x67af('0x38'),_0x18ddb8[_0x67af('0x28')],util[_0x67af('0x26')](_0x3df808,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x11')]=function(_0x242422){try{if(this[_0x67af('0x21')](_0x242422)){if(this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]]){logger['debug']('[%s][voiceAgentReport][agentconnect]\x20event:',_0x242422['uniqueid'],util['inspect'](_0x242422,{'showHidden':![],'depth':null}));for(var _0x3c3f9b in this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]]){if(this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x67af('0x39')](_0x3c3f9b)){if(_0x242422[_0x67af('0x2a')]===_0x3c3f9b){logger[_0x67af('0x22')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x242422[_0x67af('0x28')],_0x242422[_0x67af('0x24')],_0x242422[_0x67af('0x2a')]);this[_0x67af('0xa')][_0x242422['uniqueid']][_0x3c3f9b][_0x67af('0x3a')]=moment()[_0x67af('0x3b')](_0x67af('0x2c'));this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x3c')]=_0x242422[_0x67af('0x3c')];this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x3d')]=_0x242422[_0x67af('0x3d')];this['channels'][_0x242422['uniqueid']][_0x3c3f9b]['destchannelstate']=_0x242422[_0x67af('0x3e')];this['channels'][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x3f')]=_0x242422[_0x67af('0x3f')];this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x40')]=_0x242422['holdtime'];this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x41')]=_0x67af('0x42');if(this[_0x67af('0x9')][this[_0x67af('0xa')][_0x242422['uniqueid']][_0x3c3f9b][_0x67af('0x28')]]){var _0x3c49bf=this['voiceChannels'][this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b]['uniqueid']][_0x67af('0x43')];this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x43')]=_0x3c49bf;_0x242422[_0x67af('0x43')]=_0x3c49bf;}_[_0x67af('0x44')](this[_0x67af('0xc')][_0x242422['interface']],_[_0x67af('0x45')](_0x242422,[_0x67af('0x2b'),_0x67af('0x46'),'routealias']));var _0x37a9c0=this[_0x67af('0xc')][_0x242422['channel'][_0x67af('0x47')]('-')[0x0]];var _0x3376c8={'id':_0x37a9c0['id'],'name':_0x37a9c0[_0x67af('0x48')],'agentconnected':!![],'destaccountcode':_0x37a9c0['accountcode'],'destconnectedlinenum':this['channels'][_0x242422['uniqueid']][_0x242422[_0x67af('0x2a')]][_0x67af('0x49')],'queue':this[_0x67af('0xa')][_0x242422['uniqueid']][_0x242422[_0x67af('0x2a')]][_0x67af('0x2b')],'routealias':this['channels'][_0x242422[_0x67af('0x28')]][_0x242422[_0x67af('0x2a')]][_0x67af('0x43')],'uniqueid':this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x242422[_0x67af('0x2a')]][_0x67af('0x28')]};logger[_0x67af('0x25')](_0x67af('0x4a'),_0x242422[_0x67af('0x28')],util['inspect'](_0x3376c8,{'showHidden':![],'depth':null}));ami[_0x67af('0x20')](_0x67af('0x4b'),_0x3376c8);logger[_0x67af('0x25')](_0x67af('0x4c'),_0x242422[_0x67af('0x28')],util[_0x67af('0x26')](_0x3376c8,{'showHidden':![],'depth':null}));this[_0x67af('0x20')](util[_0x67af('0x3b')](_0x67af('0x4d'),_0x242422[_0x67af('0x24')]),_0x67af('0x4e'),_0x3376c8);}else if(!this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x12')]&&!this[_0x67af('0xa')][_0x242422['uniqueid']][_0x3c3f9b][_0x67af('0x15')]){logger[_0x67af('0x22')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x242422[_0x67af('0x28')],this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x24')],_0x3c3f9b);this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x12')]=!![];this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x4f')]=moment()[_0x67af('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x50')]=_0x242422[_0x67af('0x2a')];this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b][_0x67af('0x51')]=_0x242422[_0x67af('0x24')];this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b]['lastevent']='answered_elsewhere';this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b]['reason']=_0x67af('0x52');logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x242422['uniqueid'],util['inspect'](this[_0x67af('0xa')][_0x242422['uniqueid']][_0x3c3f9b],{'showHidden':![],'depth':null}));ami[_0x67af('0x20')](_0x67af('0x53'),this[_0x67af('0xa')][_0x242422[_0x67af('0x28')]][_0x3c3f9b]);}}}}}}catch(_0x14f005){logger[_0x67af('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x242422[_0x67af('0x28')],util['inspect'](_0x14f005,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x13')]=function(_0x1dcc2d){try{if(this[_0x67af('0x21')](_0x1dcc2d)){logger[_0x67af('0x25')](_0x67af('0x54'),_0x1dcc2d[_0x67af('0x28')],util['inspect'](_0x1dcc2d,{'showHidden':![],'depth':null}));if(this[_0x67af('0xa')][_0x1dcc2d[_0x67af('0x28')]]&&this[_0x67af('0xa')][_0x1dcc2d['uniqueid']][_0x1dcc2d[_0x67af('0x2a')]]){logger[_0x67af('0x22')](_0x67af('0x55'),_0x1dcc2d['uniqueid'],_0x1dcc2d[_0x67af('0x24')],_0x1dcc2d['destuniqueid']);var _0x2a75fd=this['agents'][_0x1dcc2d[_0x67af('0x29')]];var _0xf0f83c=this[_0x67af('0xa')][_0x1dcc2d[_0x67af('0x28')]][_0x1dcc2d[_0x67af('0x2a')]];_0xf0f83c['agentringnoanswer']=!![];_0xf0f83c['agentringnoanswerAt']=moment()[_0x67af('0x3b')](_0x67af('0x2c'));_0xf0f83c[_0x67af('0x41')]=_0x67af('0x56');_0xf0f83c['reason']=_0x67af('0x56');var _0x5c6184={'id':_0x2a75fd['id'],'name':_0x2a75fd[_0x67af('0x48')],'queue':_0xf0f83c[_0x67af('0x2b')],'uniqueid':_0xf0f83c[_0x67af('0x28')]};logger[_0x67af('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x1dcc2d[_0x67af('0x28')],util[_0x67af('0x26')](_0x5c6184,{'showHidden':![],'depth':null}));this[_0x67af('0x20')](util['format']('user:%s',_0x2a75fd['name']),_0x67af('0x57'),_0x5c6184);ami['emit']('custom:agentringnoanswer',_0xf0f83c);}}}catch(_0x420fd1){logger['error'](_0x67af('0x58'),_0x1dcc2d[_0x67af('0x28')],util[_0x67af('0x26')](_0x420fd1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x14')]=function(_0x282f83){try{if(this[_0x67af('0x21')](_0x282f83)){logger[_0x67af('0x25')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x282f83['uniqueid'],util['inspect'](_0x282f83,{'showHidden':![],'depth':null}));if(this[_0x67af('0xa')][_0x282f83[_0x67af('0x28')]]){for(var _0x1094f5 in this[_0x67af('0xa')][_0x282f83['uniqueid']]){if(this[_0x67af('0xa')][_0x282f83[_0x67af('0x28')]][_0x67af('0x39')](_0x1094f5)&&!this['channels'][_0x282f83[_0x67af('0x28')]][_0x1094f5][_0x67af('0x12')]&&!this[_0x67af('0xa')][_0x282f83[_0x67af('0x28')]][_0x1094f5]['agentcomplete']){logger[_0x67af('0x22')](_0x67af('0x59'),_0x282f83[_0x67af('0x28')],this[_0x67af('0xa')][_0x282f83[_0x67af('0x28')]][_0x1094f5]['membername'],_0x1094f5);this[_0x67af('0xa')][_0x282f83['uniqueid']][_0x1094f5]['agentringnoanswer']=!![];this[_0x67af('0xa')][_0x282f83[_0x67af('0x28')]][_0x1094f5]['agentringnoanswerAt']=moment()[_0x67af('0x3b')](_0x67af('0x2c'));this[_0x67af('0xa')][_0x282f83['uniqueid']][_0x1094f5][_0x67af('0x41')]=_0x67af('0x5a');this[_0x67af('0xa')][_0x282f83[_0x67af('0x28')]][_0x1094f5]['reason']=_0x67af('0x5a');logger[_0x67af('0x25')](_0x67af('0x5b'),_0x282f83[_0x67af('0x28')],util[_0x67af('0x26')](this['channels'][_0x282f83[_0x67af('0x28')]][_0x1094f5],{'showHidden':![],'depth':null}));ami['emit'](_0x67af('0x5c'),this[_0x67af('0xa')][_0x282f83['uniqueid']][_0x1094f5]);}}}}}catch(_0x429815){logger[_0x67af('0x37')](_0x67af('0x5d'),_0x282f83['uniqueid'],util['inspect'](_0x429815,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x67af('0x16')]=function(_0x16711b){try{if(this['isNotNull'](_0x16711b)){logger[_0x67af('0x25')](_0x67af('0x5e'),_0x16711b[_0x67af('0x28')],util[_0x67af('0x26')](_0x16711b,{'showHidden':![],'depth':null}));if(this[_0x67af('0xa')][_0x16711b['uniqueid']]){for(var _0x3c0a42 in this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]]){if(this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x67af('0x39')](_0x3c0a42)){if(this['channels'][_0x16711b[_0x67af('0x28')]][_0x3c0a42][_0x67af('0x3a')]&&!this[_0x67af('0xa')][_0x16711b['uniqueid']][_0x3c0a42]['agentcomplete']){logger[_0x67af('0x22')](_0x67af('0x5f'),_0x16711b[_0x67af('0x28')],this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x3c0a42][_0x67af('0x24')],_0x3c0a42);this[_0x67af('0xa')][_0x16711b['uniqueid']][_0x3c0a42][_0x67af('0x15')]=!![];this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x3c0a42]['agentcompleteAt']=moment()[_0x67af('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x3c0a42][_0x67af('0x41')]=_0x67af('0x60');this['channels'][_0x16711b[_0x67af('0x28')]][_0x3c0a42]['reason']=_0x16711b[_0x67af('0x61')]==_0x67af('0x62')?_0x67af('0x63'):_0x16711b[_0x67af('0x61')];this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x3c0a42][_0x67af('0x64')]=_0x16711b[_0x67af('0x64')];if(this['voiceQueues'][_0x16711b[_0x67af('0x2b')]]&&this[_0x67af('0xb')][_0x16711b[_0x67af('0x2b')]][_0x67af('0x65')]){this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x3c0a42][_0x67af('0x66')]=this[_0x67af('0xb')][_0x16711b['queue']]['acwTimeout'];this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x3c0a42][_0x67af('0x67')]=!![];}this[_0x67af('0xc')][_0x16711b[_0x67af('0x29')]]=_[_0x67af('0x32')](this[_0x67af('0xc')][_0x16711b[_0x67af('0x29')]],[_0x67af('0x2b'),_0x67af('0x46')]);logger[_0x67af('0x25')](_0x67af('0x68'),_0x16711b[_0x67af('0x28')],util[_0x67af('0x26')](this[_0x67af('0xa')][_0x16711b['uniqueid']][_0x3c0a42],{'showHidden':![],'depth':null}));ami[_0x67af('0x20')](_0x67af('0x69'),this[_0x67af('0xa')][_0x16711b[_0x67af('0x28')]][_0x3c0a42]);logger[_0x67af('0x25')](_0x67af('0x6a'),_0x16711b['uniqueid'],util[_0x67af('0x26')]({'id':this[_0x67af('0xc')][_0x16711b['interface']]['id'],'destaccountcode':_0x16711b['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x67af('0x20')](util[_0x67af('0x3b')]('user:%s',_0x16711b[_0x67af('0x24')]),_0x67af('0x6b'),{'id':this['agents'][_0x16711b[_0x67af('0x29')]]['id'],'destaccountcode':Number(_0x16711b['destaccountcode'])});}}}}}}catch(_0x1d58ba){logger[_0x67af('0x37')]('[%s][voiceAgentReport][agentcomplete]',_0x16711b[_0x67af('0x28')],util[_0x67af('0x26')](_0x1d58ba,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x6397c9){try{if(this[_0x67af('0x21')](_0x6397c9)){logger[_0x67af('0x25')](_0x67af('0x6c'),_0x6397c9['uniqueid'],util[_0x67af('0x26')](_0x6397c9,{'showHidden':![],'depth':null}));this[_0x67af('0x6d')](_0x6397c9['uniqueid'],_[_0x67af('0x6e')](_0x6397c9[_0x67af('0x6f')])[0x0],_0x6397c9[_0x67af('0x70')]);if(this[_0x67af('0xa')][_0x6397c9[_0x67af('0x28')]]){for(var _0x4e6d18 in this[_0x67af('0xa')][_0x6397c9[_0x67af('0x28')]]){if(this[_0x67af('0xa')][_0x6397c9[_0x67af('0x28')]][_0x67af('0x39')](_0x4e6d18)){logger['info'](_0x67af('0x71'),_0x6397c9[_0x67af('0x28')],_0x4e6d18,_['keys'](_0x6397c9[_0x67af('0x6f')])[0x0],_0x6397c9[_0x67af('0x70')]);if(_[_0x67af('0x27')](this[_0x67af('0xa')][_0x6397c9[_0x67af('0x28')]][_0x4e6d18]['variables'])){this[_0x67af('0xa')][_0x6397c9[_0x67af('0x28')]][_0x4e6d18][_0x67af('0xd')]={};}this[_0x67af('0xa')][_0x6397c9['uniqueid']][_0x4e6d18][_0x67af('0xd')]=this[_0x67af('0xd')][_0x6397c9['uniqueid']];}}}}}catch(_0xd7eaec){logger[_0x67af('0x37')](_0x67af('0x72'),_0x6397c9[_0x67af('0x28')],util['inspect'](_0xd7eaec,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x6d')]=function(_0x3997cb,_0x4dd0df,_0x25b4a4){var _0x54c947=[_0x67af('0x73'),_0x67af('0x74'),_0x67af('0x75'),'rtpaudioqosjitterbridged',_0x67af('0x76'),'rtpaudioqoslossbridged',_0x67af('0x77'),_0x67af('0x78'),_0x67af('0x79'),_0x67af('0x7a'),_0x67af('0x7b'),_0x67af('0x7c'),_0x67af('0x7d'),'memberdynamic',_0x67af('0x7e'),_0x67af('0x7f'),_0x67af('0x24'),_0x67af('0x80'),_0x67af('0x81')];if(!_[_0x67af('0x82')](_0x4dd0df)&&!_[_0x67af('0x83')](_0x54c947,_0x4dd0df)){if(_[_0x67af('0x27')](this[_0x67af('0xd')][_0x3997cb])){this[_0x67af('0xd')][_0x3997cb]={};}this[_0x67af('0xd')][_0x3997cb][_0x4dd0df]=_0x25b4a4;}};VoiceAgentReport['prototype'][_0x67af('0x84')]=function(_0x1aedaa){try{if(this[_0x67af('0x21')](_0x1aedaa)){logger[_0x67af('0x25')]('[%s][voiceAgentReport][hangup]\x20event:',_0x1aedaa['uniqueid'],util['inspect'](_0x1aedaa,{'showHidden':![],'depth':null}));if(this[_0x67af('0xa')][_0x1aedaa[_0x67af('0x28')]]){for(var _0x36c048 in this[_0x67af('0xa')][_0x1aedaa['uniqueid']]){if(this['channels'][_0x1aedaa[_0x67af('0x28')]]['hasOwnProperty'](_0x36c048)){if(this[_0x67af('0xa')][_0x1aedaa['uniqueid']][_0x36c048][_0x67af('0x61')]==_0x67af('0x62')&&this[_0x67af('0xa')][_0x1aedaa[_0x67af('0x28')]][_0x36c048][_0x67af('0x15')]){logger[_0x67af('0x22')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x1aedaa[_0x67af('0x28')],_0x36c048);this[_0x67af('0xa')][_0x1aedaa[_0x67af('0x28')]][_0x36c048][_0x67af('0x85')]=moment()[_0x67af('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x67af('0x25')](_0x67af('0x86'),_0x1aedaa['uniqueid'],util[_0x67af('0x26')](_[_0x67af('0x87')](this[_0x67af('0xa')][_0x1aedaa[_0x67af('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x67af('0x20')](_0x67af('0x88'),_[_0x67af('0x87')](this[_0x67af('0xa')][_0x1aedaa[_0x67af('0x28')]]));delete this[_0x67af('0xa')][_0x1aedaa['uniqueid']];}if(this[_0x67af('0xd')][_0x1aedaa[_0x67af('0x28')]]){delete this[_0x67af('0xd')][_0x1aedaa[_0x67af('0x28')]];}}}catch(_0x5bba0d){logger['error'](_0x67af('0x89'),_0x1aedaa[_0x67af('0x28')],util[_0x67af('0x26')](_0x5bba0d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x1c')]=function(_0x8bac43){try{if(this['isNotNull'](_0x8bac43)){logger[_0x67af('0x25')](_0x67af('0x8a'),_0x8bac43[_0x67af('0x28')],util[_0x67af('0x26')](_0x8bac43,{'showHidden':![],'depth':null}));if(this[_0x67af('0xa')][_0x8bac43['transfereeuniqueid']]){for(var _0x5bb439 in this['channels'][_0x8bac43[_0x67af('0x8b')]]){if(this[_0x67af('0xa')][_0x8bac43[_0x67af('0x8b')]][_0x67af('0x39')](_0x5bb439)){if(_0x8bac43[_0x67af('0x8c')]===_0x5bb439){logger[_0x67af('0x22')](_0x67af('0x8d'),_0x8bac43[_0x67af('0x28')],this['channels'][_0x8bac43[_0x67af('0x8b')]][_0x5bb439][_0x67af('0x24')],_0x5bb439);var _0xcc8d97=moment();this['channels'][_0x8bac43['transfereeuniqueid']][_0x5bb439][_0x67af('0x15')]=!![];this[_0x67af('0xa')][_0x8bac43[_0x67af('0x8b')]][_0x5bb439][_0x67af('0x85')]=moment()[_0x67af('0x3b')](_0x67af('0x2c'));this[_0x67af('0xa')][_0x8bac43[_0x67af('0x8b')]][_0x5bb439]['lastevent']=_0x67af('0x60');this['channels'][_0x8bac43['transfereeuniqueid']][_0x5bb439]['reason']=_0x67af('0x62');this[_0x67af('0xa')][_0x8bac43[_0x67af('0x8b')]][_0x5bb439][_0x67af('0x64')]=_0xcc8d97[_0x67af('0x8e')](this[_0x67af('0xa')][_0x8bac43[_0x67af('0x8b')]][_0x5bb439][_0x67af('0x3a')],_0x67af('0x8f'));}}}}if(this[_0x67af('0xa')][_0x8bac43['secondtransfereruniqueid']]){var _0x2ab650=this[_0x67af('0xa')][_0x8bac43[_0x67af('0x90')]];this[_0x67af('0xa')][_0x8bac43[_0x67af('0x90')]]=this[_0x67af('0xa')][_0x8bac43[_0x67af('0x8b')]];this[_0x67af('0xa')][_0x8bac43[_0x67af('0x8b')]]=_0x2ab650;}}}catch(_0x1f47dd){logger[_0x67af('0x37')](_0x67af('0x91'),_0x8bac43['uniqueid'],util[_0x67af('0x26')](_0x1f47dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x1e')]=function(_0x4563d8){try{if(this[_0x67af('0x21')](_0x4563d8)){logger[_0x67af('0x25')](_0x67af('0x92'),_0x4563d8[_0x67af('0x28')],util[_0x67af('0x26')](_0x4563d8,{'showHidden':![],'depth':null}));if(this['channels'][_0x4563d8['transfereeuniqueid']]){for(var _0x666809 in this[_0x67af('0xa')][_0x4563d8[_0x67af('0x8b')]]){if(this['channels'][_0x4563d8[_0x67af('0x8b')]][_0x67af('0x39')](_0x666809)){if(_0x4563d8['transfereruniqueid']===_0x666809){logger[_0x67af('0x22')](_0x67af('0x93'),_0x4563d8[_0x67af('0x28')],this[_0x67af('0xa')][_0x4563d8['transfereeuniqueid']][_0x666809]['membername'],_0x666809);var _0x2cc7e2=moment();this['channels'][_0x4563d8[_0x67af('0x8b')]][_0x666809][_0x67af('0x15')]=!![];this[_0x67af('0xa')][_0x4563d8[_0x67af('0x8b')]][_0x666809]['agentcompleteAt']=_0x2cc7e2;this[_0x67af('0xa')][_0x4563d8[_0x67af('0x8b')]][_0x666809][_0x67af('0x41')]='complete';this['channels'][_0x4563d8['transfereeuniqueid']][_0x666809]['reason']='transfer';this[_0x67af('0xa')][_0x4563d8['transfereeuniqueid']][_0x666809][_0x67af('0x64')]=_0x2cc7e2[_0x67af('0x8e')](this[_0x67af('0xa')][_0x4563d8['transfereeuniqueid']][_0x666809][_0x67af('0x3a')],_0x67af('0x8f'));}}}}}}catch(_0x5db63e){logger['error'](_0x67af('0x94'),_0x4563d8[_0x67af('0x28')],util[_0x67af('0x26')](_0x5db63e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x19')]=function(_0x503327){var _0x327e76='';try{if(this[_0x67af('0x21')](_0x503327)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x503327[_0x67af('0x28')],util[_0x67af('0x26')](_0x503327,{'showHidden':![],'depth':null}));if(_0x503327[_0x67af('0x95')]){_0x327e76=_0x503327[_0x67af('0x95')][_0x67af('0x96')](0x0,_0x503327[_0x67af('0x95')][_0x67af('0x97')]('-'));if(this[_0x67af('0xc')][_0x327e76]){logger[_0x67af('0x22')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x503327[_0x67af('0x28')],_0x327e76);this['agents'][_0x327e76][_0x67af('0x98')]=!![];}}}}catch(_0x399899){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x503327[_0x67af('0x28')],util[_0x67af('0x26')](_0x399899,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x67af('0x1f')][_0x67af('0x1a')]=function(_0x25dbce){var _0x69fd51='';try{if(this[_0x67af('0x21')](_0x25dbce)){logger[_0x67af('0x25')](_0x67af('0x99'),_0x25dbce[_0x67af('0x28')],util[_0x67af('0x26')](_0x25dbce,{'showHidden':![],'depth':null}));if(_0x25dbce[_0x67af('0x95')]){_0x69fd51=_0x25dbce[_0x67af('0x95')][_0x67af('0x96')](0x0,_0x25dbce[_0x67af('0x95')][_0x67af('0x97')]('-'));if(this[_0x67af('0xc')][_0x69fd51]){logger[_0x67af('0x22')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x25dbce[_0x67af('0x28')],_0x69fd51);this[_0x67af('0xc')][_0x69fd51][_0x67af('0x98')]=![];}}}}catch(_0x11d9a0){logger[_0x67af('0x37')]('[%s][voiceAgentReport][musiconholdstop]',_0x25dbce['uniqueid'],util[_0x67af('0x26')](_0x11d9a0,{'showHidden':![],'depth':null}));}};module[_0x67af('0x9a')]=VoiceAgentReport; \ No newline at end of file +var _0x63c8=['[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','voiceChannels','voiceQueues','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','channels','agents','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','merge','destconnectedlinenum','channel','split','name','accountcode','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberrealtime','[%s][voiceAgentReport][hangup]\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]'];(function(_0x5a547d,_0x3fffc8){var _0x3372f8=function(_0xa7487a){while(--_0xa7487a){_0x5a547d['push'](_0x5a547d['shift']());}};_0x3372f8(++_0x3fffc8);}(_0x63c8,0x14e));var _0x863c=function(_0x379418,_0x56b40f){_0x379418=_0x379418-0x0;var _0x1e5afb=_0x63c8[_0x379418];return _0x1e5afb;};'use strict';var _=require(_0x863c('0x0'));var moment=require(_0x863c('0x1'));var util=require(_0x863c('0x2'));var Redis=require('ioredis');var config=require(_0x863c('0x3'));var logger=require(_0x863c('0x4'))('ami');var ami=require('../ami');config[_0x863c('0x5')]=_[_0x863c('0x6')](config['redis'],{'host':_0x863c('0x7'),'port':0x18eb});var io=require(_0x863c('0x8'))(new Redis(config[_0x863c('0x5')]));function VoiceAgentReport(_0x1fdbf2){this['channels']={};this[_0x863c('0x9')]=_0x1fdbf2['channels'];this['voiceQueues']=_0x1fdbf2[_0x863c('0xa')];this['agents']=_0x1fdbf2['agents'];this[_0x863c('0xb')]={};ami['on'](_0x863c('0xc'),this[_0x863c('0xd')]['bind'](this));ami['on'](_0x863c('0xe'),this[_0x863c('0xf')][_0x863c('0x10')](this));ami['on']('agentringnoanswer',this[_0x863c('0x11')][_0x863c('0x10')](this));ami['on'](_0x863c('0x12'),this[_0x863c('0x13')][_0x863c('0x10')](this));ami['on'](_0x863c('0x14'),this[_0x863c('0x15')]['bind'](this));ami['on']('varset',this[_0x863c('0x16')][_0x863c('0x10')](this));ami['on'](_0x863c('0x17'),this[_0x863c('0x18')]['bind'](this));ami['on'](_0x863c('0x19'),this[_0x863c('0x1a')]['bind'](this));ami['on'](_0x863c('0x1b'),this[_0x863c('0x1c')][_0x863c('0x10')](this));ami['on'](_0x863c('0x1d'),this[_0x863c('0x1e')][_0x863c('0x10')](this));ami['on'](_0x863c('0x1f'),this[_0x863c('0x20')][_0x863c('0x10')](this));}VoiceAgentReport[_0x863c('0x21')][_0x863c('0x22')]=function(_0x212a74,_0x3c4657,_0xb04c32){io['to'](_0x212a74)['emit'](_0x3c4657,_0xb04c32);};VoiceAgentReport['prototype'][_0x863c('0x23')]=function(_0x28fe35){return _0x28fe35!==null&&!_[_0x863c('0x24')](_0x28fe35);};VoiceAgentReport[_0x863c('0x21')][_0x863c('0xd')]=function(_0x53eec4){try{if(this['isNotNull'](_0x53eec4)){logger[_0x863c('0x25')](_0x863c('0x26'),_0x53eec4[_0x863c('0x27')],_0x53eec4[_0x863c('0x28')],_0x53eec4[_0x863c('0x29')]);logger[_0x863c('0x2a')](_0x863c('0x2b'),_0x53eec4[_0x863c('0x27')],util[_0x863c('0x2c')](_0x53eec4,{'showHidden':![],'depth':null}));if(_[_0x863c('0x24')](this[_0x863c('0x2d')][_0x53eec4['uniqueid']])){this[_0x863c('0x2d')][_0x53eec4[_0x863c('0x27')]]={};}var _0x3487e5=this[_0x863c('0x2e')][_0x53eec4[_0x863c('0x2f')]];var _0x5b52bd=this['channels'][_0x53eec4['uniqueid']][_0x53eec4[_0x863c('0x29')]];var _0x2cca3f=this[_0x863c('0xa')][_0x53eec4[_0x863c('0x30')]];var _0xed23f5=this[_0x863c('0xb')][_0x53eec4[_0x863c('0x27')]];if(_[_0x863c('0x24')](_0x5b52bd)){_0x5b52bd={'agentcalledAt':moment()[_0x863c('0x31')](_0x863c('0x32')),'lastevent':_0x863c('0x33'),'mandatoryDisposition':_0x2cca3f&&_0x2cca3f[_0x863c('0x34')]?_0x2cca3f['mandatoryDisposition']:![],'type':_0x2cca3f&&_0x2cca3f[_0x863c('0x35')]?_0x2cca3f[_0x863c('0x35')]:_0x863c('0x36'),'variables':_0xed23f5,'motionChannel':_0x863c('0x37')};}_['merge'](_0x5b52bd,_[_0x863c('0x38')](_0x53eec4,[_0x863c('0x39'),_0x863c('0x3a')]));logger[_0x863c('0x2a')](_0x863c('0x3b'),_0x53eec4['uniqueid'],util[_0x863c('0x2c')](_0x5b52bd,{'showHidden':![],'depth':null}));ami[_0x863c('0x22')](_0x863c('0x3c'),_0x5b52bd);var _0xf8a601={'id':_0x3487e5['id'],'calleridnum':_0x5b52bd[_0x863c('0x3d')],'queue':_0x5b52bd[_0x863c('0x30')],'variables':_0x5b52bd[_0x863c('0xb')],'uniqueid':_0x53eec4[_0x863c('0x27')]};logger['debug'](_0x863c('0x3e'),_0x53eec4[_0x863c('0x27')],util[_0x863c('0x2c')](_0xf8a601,{'showHidden':![],'depth':null}));this[_0x863c('0x22')](util[_0x863c('0x31')](_0x863c('0x3f'),_0x53eec4[_0x863c('0x28')]),_0x863c('0x40'),_0xf8a601);}}catch(_0x10cc60){logger[_0x863c('0x41')](_0x863c('0x42'),_0x53eec4[_0x863c('0x27')],util[_0x863c('0x2c')](_0x10cc60,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x863c('0xf')]=function(_0x4c164d){try{if(this['isNotNull'](_0x4c164d)){if(this['channels'][_0x4c164d[_0x863c('0x27')]]){logger[_0x863c('0x2a')](_0x863c('0x43'),_0x4c164d[_0x863c('0x27')],util[_0x863c('0x2c')](_0x4c164d,{'showHidden':![],'depth':null}));for(var _0x24c249 in this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]]){if(this[_0x863c('0x2d')][_0x4c164d['uniqueid']]['hasOwnProperty'](_0x24c249)){if(_0x4c164d[_0x863c('0x29')]===_0x24c249){logger[_0x863c('0x25')](_0x863c('0x44'),_0x4c164d[_0x863c('0x27')],_0x4c164d[_0x863c('0x28')],_0x4c164d[_0x863c('0x29')]);this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x45')]=moment()[_0x863c('0x31')](_0x863c('0x32'));this['channels'][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x46')]=_0x4c164d[_0x863c('0x46')];this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x47')]=_0x4c164d[_0x863c('0x47')];this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x48')]=_0x4c164d[_0x863c('0x48')];this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x49')]=_0x4c164d['destchannelstatedesc'];this[_0x863c('0x2d')][_0x4c164d['uniqueid']][_0x24c249][_0x863c('0x4a')]=_0x4c164d['holdtime'];this[_0x863c('0x2d')][_0x4c164d['uniqueid']][_0x24c249][_0x863c('0x4b')]='connect';if(this[_0x863c('0x9')][this['channels'][_0x4c164d['uniqueid']][_0x24c249][_0x863c('0x27')]]){var _0x138132=this[_0x863c('0x9')][this[_0x863c('0x2d')][_0x4c164d['uniqueid']][_0x24c249][_0x863c('0x27')]][_0x863c('0x4c')];this[_0x863c('0x2d')][_0x4c164d['uniqueid']][_0x24c249][_0x863c('0x4c')]=_0x138132;_0x4c164d[_0x863c('0x4c')]=_0x138132;}_[_0x863c('0x4d')](this[_0x863c('0x2e')][_0x4c164d['interface']],_['pick'](_0x4c164d,[_0x863c('0x30'),_0x863c('0x4e'),_0x863c('0x4c')]));var _0xb65c94=this[_0x863c('0x2e')][_0x4c164d[_0x863c('0x4f')][_0x863c('0x50')]('-')[0x0]];var _0x33ced7={'id':_0xb65c94['id'],'name':_0xb65c94[_0x863c('0x51')],'agentconnected':!![],'destaccountcode':_0xb65c94[_0x863c('0x52')],'destconnectedlinenum':this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x4c164d['destuniqueid']][_0x863c('0x53')],'queue':this['channels'][_0x4c164d['uniqueid']][_0x4c164d['destuniqueid']][_0x863c('0x30')],'routealias':this['channels'][_0x4c164d[_0x863c('0x27')]][_0x4c164d[_0x863c('0x29')]][_0x863c('0x4c')],'uniqueid':this['channels'][_0x4c164d[_0x863c('0x27')]][_0x4c164d[_0x863c('0x29')]]['uniqueid']};logger[_0x863c('0x2a')](_0x863c('0x54'),_0x4c164d['uniqueid'],util[_0x863c('0x2c')](_0x33ced7,{'showHidden':![],'depth':null}));ami[_0x863c('0x22')](_0x863c('0x55'),_0x33ced7);logger[_0x863c('0x2a')](_0x863c('0x56'),_0x4c164d['uniqueid'],util[_0x863c('0x2c')](_0x33ced7,{'showHidden':![],'depth':null}));this[_0x863c('0x22')](util['format'](_0x863c('0x3f'),_0x4c164d[_0x863c('0x28')]),_0x863c('0x57'),_0x33ced7);}else if(!this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x58')]&&!this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x14')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c164d[_0x863c('0x27')],this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249]['membername'],_0x24c249);this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x58')]=!![];this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x59')]=moment()['format'](_0x863c('0x32'));this[_0x863c('0x2d')][_0x4c164d['uniqueid']][_0x24c249][_0x863c('0x5a')]=_0x4c164d['destuniqueid'];this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x5b')]=_0x4c164d[_0x863c('0x28')];this['channels'][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x4b')]='answered_elsewhere';this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249][_0x863c('0x5c')]=_0x863c('0x5d');logger[_0x863c('0x2a')](_0x863c('0x5e'),_0x4c164d[_0x863c('0x27')],util[_0x863c('0x2c')](this[_0x863c('0x2d')][_0x4c164d[_0x863c('0x27')]][_0x24c249],{'showHidden':![],'depth':null}));ami[_0x863c('0x22')](_0x863c('0x5f'),this[_0x863c('0x2d')][_0x4c164d['uniqueid']][_0x24c249]);}}}}}}catch(_0x8c2ee1){logger[_0x863c('0x41')](_0x863c('0x60'),_0x4c164d[_0x863c('0x27')],util[_0x863c('0x2c')](_0x8c2ee1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x863c('0x21')][_0x863c('0x11')]=function(_0x409d13){try{if(this['isNotNull'](_0x409d13)){logger[_0x863c('0x2a')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x409d13[_0x863c('0x27')],util[_0x863c('0x2c')](_0x409d13,{'showHidden':![],'depth':null}));if(this['channels'][_0x409d13['uniqueid']]&&this['channels'][_0x409d13['uniqueid']][_0x409d13[_0x863c('0x29')]]){logger[_0x863c('0x25')](_0x863c('0x61'),_0x409d13[_0x863c('0x27')],_0x409d13['membername'],_0x409d13['destuniqueid']);var _0x1f2f25=this[_0x863c('0x2e')][_0x409d13[_0x863c('0x2f')]];var _0x1ee87b=this[_0x863c('0x2d')][_0x409d13[_0x863c('0x27')]][_0x409d13[_0x863c('0x29')]];_0x1ee87b['agentringnoanswer']=!![];_0x1ee87b['agentringnoanswerAt']=moment()[_0x863c('0x31')](_0x863c('0x32'));_0x1ee87b['lastevent']=_0x863c('0x62');_0x1ee87b[_0x863c('0x5c')]=_0x863c('0x62');var _0x2b8f7b={'id':_0x1f2f25['id'],'name':_0x1f2f25[_0x863c('0x51')],'queue':_0x1ee87b['queue'],'uniqueid':_0x1ee87b['uniqueid']};logger[_0x863c('0x2a')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x409d13[_0x863c('0x27')],util[_0x863c('0x2c')](_0x2b8f7b,{'showHidden':![],'depth':null}));this[_0x863c('0x22')](util[_0x863c('0x31')]('user:%s',_0x1f2f25[_0x863c('0x51')]),_0x863c('0x63'),_0x2b8f7b);ami['emit'](_0x863c('0x64'),_0x1ee87b);}}}catch(_0x41670e){logger[_0x863c('0x41')](_0x863c('0x65'),_0x409d13['uniqueid'],util[_0x863c('0x2c')](_0x41670e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x863c('0x21')][_0x863c('0x13')]=function(_0x5ae80e){try{if(this[_0x863c('0x23')](_0x5ae80e)){logger[_0x863c('0x2a')](_0x863c('0x66'),_0x5ae80e[_0x863c('0x27')],util['inspect'](_0x5ae80e,{'showHidden':![],'depth':null}));if(this[_0x863c('0x2d')][_0x5ae80e[_0x863c('0x27')]]){for(var _0x2e2434 in this[_0x863c('0x2d')][_0x5ae80e[_0x863c('0x27')]]){if(this[_0x863c('0x2d')][_0x5ae80e[_0x863c('0x27')]][_0x863c('0x67')](_0x2e2434)&&!this[_0x863c('0x2d')][_0x5ae80e[_0x863c('0x27')]][_0x2e2434][_0x863c('0x58')]&&!this[_0x863c('0x2d')][_0x5ae80e['uniqueid']][_0x2e2434]['agentcomplete']){logger[_0x863c('0x25')](_0x863c('0x68'),_0x5ae80e[_0x863c('0x27')],this[_0x863c('0x2d')][_0x5ae80e[_0x863c('0x27')]][_0x2e2434][_0x863c('0x28')],_0x2e2434);this[_0x863c('0x2d')][_0x5ae80e[_0x863c('0x27')]][_0x2e2434]['agentringnoanswer']=!![];this['channels'][_0x5ae80e[_0x863c('0x27')]][_0x2e2434][_0x863c('0x59')]=moment()['format'](_0x863c('0x32'));this[_0x863c('0x2d')][_0x5ae80e['uniqueid']][_0x2e2434]['lastevent']='abandoned';this[_0x863c('0x2d')][_0x5ae80e['uniqueid']][_0x2e2434][_0x863c('0x5c')]=_0x863c('0x69');logger[_0x863c('0x2a')](_0x863c('0x6a'),_0x5ae80e['uniqueid'],util[_0x863c('0x2c')](this[_0x863c('0x2d')][_0x5ae80e[_0x863c('0x27')]][_0x2e2434],{'showHidden':![],'depth':null}));ami[_0x863c('0x22')](_0x863c('0x6b'),this[_0x863c('0x2d')][_0x5ae80e['uniqueid']][_0x2e2434]);}}}}}catch(_0x59eedd){logger[_0x863c('0x41')](_0x863c('0x6c'),_0x5ae80e['uniqueid'],util[_0x863c('0x2c')](_0x59eedd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x863c('0x15')]=function(_0x10f9d4){try{if(this[_0x863c('0x23')](_0x10f9d4)){logger[_0x863c('0x2a')](_0x863c('0x6d'),_0x10f9d4[_0x863c('0x27')],util[_0x863c('0x2c')](_0x10f9d4,{'showHidden':![],'depth':null}));if(this[_0x863c('0x2d')][_0x10f9d4[_0x863c('0x27')]]){for(var _0x5391a9 in this[_0x863c('0x2d')][_0x10f9d4[_0x863c('0x27')]]){if(this[_0x863c('0x2d')][_0x10f9d4[_0x863c('0x27')]][_0x863c('0x67')](_0x5391a9)){if(this['channels'][_0x10f9d4['uniqueid']][_0x5391a9][_0x863c('0x45')]&&!this[_0x863c('0x2d')][_0x10f9d4['uniqueid']][_0x5391a9][_0x863c('0x14')]){logger[_0x863c('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x10f9d4[_0x863c('0x27')],this[_0x863c('0x2d')][_0x10f9d4[_0x863c('0x27')]][_0x5391a9][_0x863c('0x28')],_0x5391a9);this[_0x863c('0x2d')][_0x10f9d4[_0x863c('0x27')]][_0x5391a9][_0x863c('0x14')]=!![];this[_0x863c('0x2d')][_0x10f9d4['uniqueid']][_0x5391a9][_0x863c('0x6e')]=moment()[_0x863c('0x31')](_0x863c('0x32'));this['channels'][_0x10f9d4[_0x863c('0x27')]][_0x5391a9][_0x863c('0x4b')]=_0x863c('0x6f');this[_0x863c('0x2d')][_0x10f9d4['uniqueid']][_0x5391a9][_0x863c('0x5c')]=_0x10f9d4['reason']==_0x863c('0x70')?_0x863c('0x71'):_0x10f9d4[_0x863c('0x5c')];this[_0x863c('0x2d')][_0x10f9d4['uniqueid']][_0x5391a9][_0x863c('0x72')]=_0x10f9d4[_0x863c('0x72')];if(this['voiceQueues'][_0x10f9d4[_0x863c('0x30')]]&&this['voiceQueues'][_0x10f9d4['queue']][_0x863c('0x73')]){this[_0x863c('0x2d')][_0x10f9d4['uniqueid']][_0x5391a9][_0x863c('0x74')]=this['voiceQueues'][_0x10f9d4['queue']][_0x863c('0x75')];this['channels'][_0x10f9d4['uniqueid']][_0x5391a9][_0x863c('0x76')]=!![];}this[_0x863c('0x2e')][_0x10f9d4['interface']]=_['omit'](this['agents'][_0x10f9d4[_0x863c('0x2f')]],[_0x863c('0x30'),'destconnectedlinenum']);logger[_0x863c('0x2a')](_0x863c('0x77'),_0x10f9d4['uniqueid'],util[_0x863c('0x2c')](this[_0x863c('0x2d')][_0x10f9d4[_0x863c('0x27')]][_0x5391a9],{'showHidden':![],'depth':null}));ami[_0x863c('0x22')](_0x863c('0x78'),this[_0x863c('0x2d')][_0x10f9d4[_0x863c('0x27')]][_0x5391a9]);logger[_0x863c('0x2a')](_0x863c('0x79'),_0x10f9d4[_0x863c('0x27')],util[_0x863c('0x2c')]({'id':this[_0x863c('0x2e')][_0x10f9d4[_0x863c('0x2f')]]['id'],'destaccountcode':_0x10f9d4[_0x863c('0x7a')]},{'showHidden':![],'depth':null}));this[_0x863c('0x22')](util[_0x863c('0x31')](_0x863c('0x3f'),_0x10f9d4['membername']),_0x863c('0x7b'),{'id':this[_0x863c('0x2e')][_0x10f9d4['interface']]['id'],'destaccountcode':Number(_0x10f9d4[_0x863c('0x7a')])});}}}}}}catch(_0x4d8a20){logger['error'](_0x863c('0x7c'),_0x10f9d4[_0x863c('0x27')],util[_0x863c('0x2c')](_0x4d8a20,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x863c('0x21')][_0x863c('0x16')]=function(_0x3262c3){try{if(this[_0x863c('0x23')](_0x3262c3)){logger[_0x863c('0x2a')](_0x863c('0x7d'),_0x3262c3[_0x863c('0x27')],util['inspect'](_0x3262c3,{'showHidden':![],'depth':null}));this['addVariable'](_0x3262c3[_0x863c('0x27')],_[_0x863c('0x7e')](_0x3262c3['variable'])[0x0],_0x3262c3[_0x863c('0x7f')]);if(this[_0x863c('0x2d')][_0x3262c3[_0x863c('0x27')]]){for(var _0x2cf0c7 in this['channels'][_0x3262c3[_0x863c('0x27')]]){if(this[_0x863c('0x2d')][_0x3262c3[_0x863c('0x27')]][_0x863c('0x67')](_0x2cf0c7)){logger[_0x863c('0x25')](_0x863c('0x80'),_0x3262c3[_0x863c('0x27')],_0x2cf0c7,_[_0x863c('0x7e')](_0x3262c3['variable'])[0x0],_0x3262c3[_0x863c('0x7f')]);if(_['isUndefined'](this[_0x863c('0x2d')][_0x3262c3[_0x863c('0x27')]][_0x2cf0c7]['variables'])){this[_0x863c('0x2d')][_0x3262c3[_0x863c('0x27')]][_0x2cf0c7][_0x863c('0xb')]={};}this[_0x863c('0x2d')][_0x3262c3[_0x863c('0x27')]][_0x2cf0c7][_0x863c('0xb')]=this[_0x863c('0xb')][_0x3262c3['uniqueid']];}}}}}catch(_0x4940e7){logger['error']('[%s][voiceAgentReport][varset]',_0x3262c3['uniqueid'],util[_0x863c('0x2c')](_0x4940e7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x863c('0x21')][_0x863c('0x81')]=function(_0x4826dd,_0x5c1a07,_0x49ef9b){var _0x5b40dd=[_0x863c('0x82'),_0x863c('0x83'),_0x863c('0x84'),'rtpaudioqosjitterbridged',_0x863c('0x85'),_0x863c('0x86'),'rtpaudioqosrtt',_0x863c('0x87'),_0x863c('0x88'),_0x863c('0x89'),_0x863c('0x8a'),_0x863c('0x8b'),'membercalls','memberdynamic',_0x863c('0x8c'),_0x863c('0x8d'),_0x863c('0x28'),'memberpenalty',_0x863c('0x8e')];if(!_['isNil'](_0x5c1a07)&&!_['includes'](_0x5b40dd,_0x5c1a07)){if(_[_0x863c('0x24')](this[_0x863c('0xb')][_0x4826dd])){this[_0x863c('0xb')][_0x4826dd]={};}this[_0x863c('0xb')][_0x4826dd][_0x5c1a07]=_0x49ef9b;}};VoiceAgentReport['prototype'][_0x863c('0x18')]=function(_0x4652ad){try{if(this['isNotNull'](_0x4652ad)){logger[_0x863c('0x2a')](_0x863c('0x8f'),_0x4652ad[_0x863c('0x27')],util[_0x863c('0x2c')](_0x4652ad,{'showHidden':![],'depth':null}));if(this[_0x863c('0x2d')][_0x4652ad[_0x863c('0x27')]]){for(var _0x1aeae5 in this[_0x863c('0x2d')][_0x4652ad[_0x863c('0x27')]]){if(this[_0x863c('0x2d')][_0x4652ad[_0x863c('0x27')]][_0x863c('0x67')](_0x1aeae5)){if(this[_0x863c('0x2d')][_0x4652ad[_0x863c('0x27')]][_0x1aeae5][_0x863c('0x5c')]==_0x863c('0x70')&&this[_0x863c('0x2d')][_0x4652ad['uniqueid']][_0x1aeae5][_0x863c('0x14')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4652ad[_0x863c('0x27')],_0x1aeae5);this['channels'][_0x4652ad['uniqueid']][_0x1aeae5]['agentcompleteAt']=moment()[_0x863c('0x31')](_0x863c('0x32'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x4652ad[_0x863c('0x27')],util[_0x863c('0x2c')](_[_0x863c('0x90')](this[_0x863c('0x2d')][_0x4652ad['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x863c('0x22')](_0x863c('0x91'),_['values'](this['channels'][_0x4652ad['uniqueid']]));delete this[_0x863c('0x2d')][_0x4652ad[_0x863c('0x27')]];}if(this[_0x863c('0xb')][_0x4652ad[_0x863c('0x27')]]){delete this[_0x863c('0xb')][_0x4652ad[_0x863c('0x27')]];}}}catch(_0x28f3a3){logger[_0x863c('0x41')]('[%s][voiceAgentReport][hangup]',_0x4652ad[_0x863c('0x27')],util[_0x863c('0x2c')](_0x28f3a3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x863c('0x21')]['syncAttendedTransfer']=function(_0x9558e8){try{if(this[_0x863c('0x23')](_0x9558e8)){logger['debug'](_0x863c('0x92'),_0x9558e8['uniqueid'],util[_0x863c('0x2c')](_0x9558e8,{'showHidden':![],'depth':null}));if(this[_0x863c('0x2d')][_0x9558e8['transfereeuniqueid']]){for(var _0x12a56b in this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x93')]]){if(this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x93')]][_0x863c('0x67')](_0x12a56b)){if(_0x9558e8[_0x863c('0x94')]===_0x12a56b){logger[_0x863c('0x25')](_0x863c('0x95'),_0x9558e8[_0x863c('0x27')],this['channels'][_0x9558e8[_0x863c('0x93')]][_0x12a56b][_0x863c('0x28')],_0x12a56b);var _0x254eb6=moment();this['channels'][_0x9558e8[_0x863c('0x93')]][_0x12a56b][_0x863c('0x14')]=!![];this['channels'][_0x9558e8[_0x863c('0x93')]][_0x12a56b][_0x863c('0x6e')]=moment()[_0x863c('0x31')](_0x863c('0x32'));this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x93')]][_0x12a56b][_0x863c('0x4b')]=_0x863c('0x6f');this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x93')]][_0x12a56b][_0x863c('0x5c')]=_0x863c('0x70');this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x93')]][_0x12a56b][_0x863c('0x72')]=_0x254eb6[_0x863c('0x96')](this['channels'][_0x9558e8[_0x863c('0x93')]][_0x12a56b]['agentconnectAt'],_0x863c('0x97'));}}}}if(this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x98')]]){var _0x74da7f=this[_0x863c('0x2d')][_0x9558e8['secondtransfereruniqueid']];this['channels'][_0x9558e8[_0x863c('0x98')]]=this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x93')]];this[_0x863c('0x2d')][_0x9558e8[_0x863c('0x93')]]=_0x74da7f;}}}catch(_0x5b2125){logger['error']('[%s][voiceAgentReport][attendedtransfer]',_0x9558e8[_0x863c('0x27')],util[_0x863c('0x2c')](_0x5b2125,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x863c('0x20')]=function(_0x796f3f){try{if(this[_0x863c('0x23')](_0x796f3f)){logger[_0x863c('0x2a')](_0x863c('0x99'),_0x796f3f[_0x863c('0x27')],util[_0x863c('0x2c')](_0x796f3f,{'showHidden':![],'depth':null}));if(this['channels'][_0x796f3f[_0x863c('0x93')]]){for(var _0x195ada in this[_0x863c('0x2d')][_0x796f3f[_0x863c('0x93')]]){if(this[_0x863c('0x2d')][_0x796f3f['transfereeuniqueid']][_0x863c('0x67')](_0x195ada)){if(_0x796f3f[_0x863c('0x9a')]===_0x195ada){logger[_0x863c('0x25')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x796f3f[_0x863c('0x27')],this[_0x863c('0x2d')][_0x796f3f['transfereeuniqueid']][_0x195ada][_0x863c('0x28')],_0x195ada);var _0x933770=moment();this[_0x863c('0x2d')][_0x796f3f[_0x863c('0x93')]][_0x195ada]['agentcomplete']=!![];this[_0x863c('0x2d')][_0x796f3f['transfereeuniqueid']][_0x195ada][_0x863c('0x6e')]=_0x933770;this[_0x863c('0x2d')][_0x796f3f[_0x863c('0x93')]][_0x195ada][_0x863c('0x4b')]=_0x863c('0x6f');this[_0x863c('0x2d')][_0x796f3f[_0x863c('0x93')]][_0x195ada][_0x863c('0x5c')]='transfer';this[_0x863c('0x2d')][_0x796f3f[_0x863c('0x93')]][_0x195ada][_0x863c('0x72')]=_0x933770['diff'](this[_0x863c('0x2d')][_0x796f3f['transfereeuniqueid']][_0x195ada][_0x863c('0x45')],_0x863c('0x97'));}}}}}}catch(_0xe2bc79){logger[_0x863c('0x41')](_0x863c('0x9b'),_0x796f3f[_0x863c('0x27')],util[_0x863c('0x2c')](_0xe2bc79,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x863c('0x21')]['syncMusicOnHoldStart']=function(_0x276c47){var _0x35051d='';try{if(this[_0x863c('0x23')](_0x276c47)){logger[_0x863c('0x2a')](_0x863c('0x9c'),_0x276c47[_0x863c('0x27')],util[_0x863c('0x2c')](_0x276c47,{'showHidden':![],'depth':null}));if(_0x276c47[_0x863c('0x4f')]){_0x35051d=_0x276c47[_0x863c('0x4f')][_0x863c('0x9d')](0x0,_0x276c47['channel'][_0x863c('0x9e')]('-'));if(this[_0x863c('0x2e')][_0x35051d]){logger['info']('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x276c47[_0x863c('0x27')],_0x35051d);this[_0x863c('0x2e')][_0x35051d][_0x863c('0x9f')]=!![];}}}}catch(_0x1dcc55){logger[_0x863c('0x41')](_0x863c('0xa0'),_0x276c47[_0x863c('0x27')],util[_0x863c('0x2c')](_0x1dcc55,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x863c('0x21')][_0x863c('0x1c')]=function(_0x48b317){var _0x1902c5='';try{if(this['isNotNull'](_0x48b317)){logger[_0x863c('0x2a')](_0x863c('0xa1'),_0x48b317[_0x863c('0x27')],util['inspect'](_0x48b317,{'showHidden':![],'depth':null}));if(_0x48b317['channel']){_0x1902c5=_0x48b317[_0x863c('0x4f')]['substring'](0x0,_0x48b317['channel'][_0x863c('0x9e')]('-'));if(this['agents'][_0x1902c5]){logger['info'](_0x863c('0xa2'),_0x48b317[_0x863c('0x27')],_0x1902c5);this[_0x863c('0x2e')][_0x1902c5][_0x863c('0x9f')]=![];}}}}catch(_0x102d21){logger[_0x863c('0x41')](_0x863c('0xa3'),_0x48b317[_0x863c('0x27')],util[_0x863c('0x2c')](_0x102d21,{'showHidden':![],'depth':null}));}};module[_0x863c('0xa4')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 10bc1e9..e9e835b 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 _0x9980=['isNotNull','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','channelstate','merge','undefined','exten','user:%s','name','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','applicationdata','startsWith','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','lastapplication','lastdata','set','cdr(','type','isNil','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','connectedlinename','destinationchannel','UserId','membername','toNumber','routealias','[%s][voiceCallReport][newstate]','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','diff','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','then','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','extension','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','pick','keys','context','from-sip','channel','split','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]'];(function(_0x5f1cab,_0x28833c){var _0x24814e=function(_0x1ea998){while(--_0x1ea998){_0x5f1cab['push'](_0x5f1cab['shift']());}};_0x24814e(++_0x28833c);}(_0x9980,0x145));var _0x0998=function(_0x11e239,_0x3cfa93){_0x11e239=_0x11e239-0x0;var _0x4b1ee8=_0x9980[_0x11e239];return _0x4b1ee8;};'use strict';var _=require(_0x0998('0x0'));var moment=require(_0x0998('0x1'));var util=require(_0x0998('0x2'));var path=require(_0x0998('0x3'));var Redis=require('ioredis');var config=require(_0x0998('0x4'));var logger=require('../../../config/logger')(_0x0998('0x5'));var ami=require(_0x0998('0x6'));var Channel=require(_0x0998('0x7'));var RpcSetting=require(_0x0998('0x8'));var applications=['set',_0x0998('0x9'),_0x0998('0xa'),_0x0998('0xb'),'playback',_0x0998('0xc')];var dispositions=[_0x0998('0xd'),_0x0998('0xe'),_0x0998('0xe'),_0x0998('0xd'),_0x0998('0xd'),_0x0998('0xd'),_0x0998('0xf'),_0x0998('0x10'),'FAILED','FAILED','FAILED'];config[_0x0998('0x11')]=_['defaults'](config[_0x0998('0x11')],{'host':_0x0998('0x12'),'port':0x18eb});var io=require(_0x0998('0x13'))(new Redis(config[_0x0998('0x11')]));function VoiceCallReport(_0x1cfe6d){this[_0x0998('0x14')]=_0x1cfe6d[_0x0998('0x14')];this['agents']=_0x1cfe6d[_0x0998('0x15')];this['blindTransfers']={};ami['on'](_0x0998('0x16'),this[_0x0998('0x17')][_0x0998('0x18')](this));ami['on'](_0x0998('0x19'),this[_0x0998('0x17')][_0x0998('0x18')](this));ami['on'](_0x0998('0x1a'),this[_0x0998('0x1b')][_0x0998('0x18')](this));ami['on']('newstate',this[_0x0998('0x1c')][_0x0998('0x18')](this));ami['on'](_0x0998('0x1d'),this[_0x0998('0x1e')][_0x0998('0x18')](this));ami['on'](_0x0998('0x1f'),this[_0x0998('0x20')][_0x0998('0x18')](this));ami['on'](_0x0998('0x21'),this[_0x0998('0x22')][_0x0998('0x18')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x0998('0x18')](this));ami['on'](_0x0998('0x23'),this['syncBlindTransfer']['bind'](this));ami['on'](_0x0998('0x24'),this[_0x0998('0x25')]['bind'](this));ami['on'](_0x0998('0x26'),this[_0x0998('0x27')][_0x0998('0x18')](this));try{logger[_0x0998('0x28')](_0x0998('0x29'));ami['actionCoreShowChannels']();}catch(_0x3cb21b){logger[_0x0998('0x2a')](_0x0998('0x2b'),util[_0x0998('0x2c')](_0x3cb21b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x0998('0x2d')]['isNotNull']=function(_0x1c29b3){return _0x1c29b3!==null&&!_[_0x0998('0x2e')](_0x1c29b3);};VoiceCallReport[_0x0998('0x2d')][_0x0998('0x2f')]=function(_0x355749,_0x1e6973,_0x2d2964){io['to'](_0x355749)['emit'](_0x1e6973,_0x2d2964);};VoiceCallReport[_0x0998('0x2d')][_0x0998('0x22')]=function(_0x19677){try{if(this['isNotNull'](_0x19677)){logger['info'](_0x0998('0x30'),_0x19677[_0x0998('0x31')],_0x19677[_0x0998('0x32')],_0x19677[_0x0998('0x33')]);logger['debug'](_0x0998('0x34'),_0x19677[_0x0998('0x31')],util[_0x0998('0x2c')](_0x19677,{'showHidden':![],'depth':null}));if(_0x19677['uniqueid']===_0x19677[_0x0998('0x35')]){if(!_[_0x0998('0x2e')](this['channels'][_0x19677[_0x0998('0x31')]])){_['merge'](this[_0x0998('0x14')][_0x19677[_0x0998('0x31')]],_[_0x0998('0x36')](_0x19677,_[_0x0998('0x37')](this[_0x0998('0x14')][_0x19677['uniqueid']])));}}if(_0x19677[_0x0998('0x38')]===_0x0998('0x39')){if(this['agents'][_0x19677[_0x0998('0x3a')][_0x0998('0x3b')]('-')[0x0]]){if(_0x19677['exten']==_0x0998('0x3c')){this['agents'][_0x19677[_0x0998('0x3a')][_0x0998('0x3b')]('-')[0x0]][_0x0998('0x3d')]=_0x19677[_0x0998('0x3e')];this['emit'](util[_0x0998('0x3f')]('user:%s',this[_0x0998('0x15')][_0x19677['channel'][_0x0998('0x3b')]('-')[0x0]]['name']),_0x0998('0x40'),{'destaccountcode':this[_0x0998('0x15')][_0x19677['channel'][_0x0998('0x3b')]('-')[0x0]][_0x0998('0x41')],'destconnectedlinenum':_0x19677[_0x0998('0x3e')]});}}}}}catch(_0x30acb1){logger[_0x0998('0x2a')](_0x0998('0x42'),_0x19677[_0x0998('0x31')],util[_0x0998('0x2c')](_0x30acb1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0998('0x2d')][_0x0998('0x1b')]=function(_0x5bde5b){try{if(this[_0x0998('0x43')](_0x5bde5b)){logger[_0x0998('0x44')](_0x0998('0x45'),_0x5bde5b[_0x0998('0x31')],util[_0x0998('0x2c')](_0x5bde5b,{'showHidden':![],'depth':null}));if(this[_0x0998('0x14')][_0x5bde5b[_0x0998('0x31')]]){return;}if(_0x5bde5b[_0x0998('0x3a')]===_0x0998('0x46')){return;}if(_0x5bde5b['uniqueid']!==_0x5bde5b[_0x0998('0x35')]&&!this[_0x0998('0x47')][_0x5bde5b['linkedid']]){return;}logger[_0x0998('0x28')](_0x0998('0x48'),_0x5bde5b[_0x0998('0x31')],_0x5bde5b['context'],_0x5bde5b['exten']);this[_0x0998('0x14')][_0x5bde5b['uniqueid']]=new Channel();this[_0x0998('0x14')][_0x5bde5b[_0x0998('0x31')]][_0x0998('0x49')]=moment()[_0x0998('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0998('0x14')][_0x5bde5b[_0x0998('0x31')]][_0x0998('0x4a')]=dispositions[_['toNumber'](_0x5bde5b[_0x0998('0x4b')])];_[_0x0998('0x4c')](this[_0x0998('0x14')][_0x5bde5b[_0x0998('0x31')]],_[_0x0998('0x36')](_0x5bde5b,_['keys'](this[_0x0998('0x14')][_0x5bde5b[_0x0998('0x31')]])));if(_0x5bde5b['context']===_0x0998('0x39')){var _0x476853=this[_0x0998('0x15')][_0x5bde5b['channel']['split']('-')[0x0]];if(_0x476853&&typeof _0x476853[_0x0998('0x3d')]===_0x0998('0x4d')){_0x476853[_0x0998('0x3d')]=_0x5bde5b[_0x0998('0x4e')];logger[_0x0998('0x44')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x5bde5b[_0x0998('0x31')],util[_0x0998('0x2c')]({'id':_0x476853['id'],'destaccountcode':_0x476853[_0x0998('0x41')],'destconnectedlinenum':_0x5bde5b[_0x0998('0x4e')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x0998('0x3f')](_0x0998('0x4f'),_0x476853[_0x0998('0x50')]),'user:agentconnect',{'id':_0x476853['id'],'destaccountcode':_0x476853[_0x0998('0x41')],'destconnectedlinenum':_0x5bde5b[_0x0998('0x4e')]});}}}}catch(_0x478cd9){logger['error'](_0x0998('0x51'),_0x5bde5b[_0x0998('0x31')],util[_0x0998('0x2c')](_0x478cd9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0998('0x17')]=function(_0x4af8bc){try{if(this[_0x0998('0x43')](_0x4af8bc)){logger['debug'](_0x0998('0x52'),_0x4af8bc[_0x0998('0x31')],util[_0x0998('0x2c')](_0x4af8bc,{'showHidden':![],'depth':null}));if(_0x4af8bc[_0x0998('0x3a')]===_0x0998('0x46')||_0x4af8bc[_0x0998('0x4e')]==='h')return;if(_0x4af8bc[_0x0998('0x31')]===_0x4af8bc[_0x0998('0x35')]||this[_0x0998('0x47')][_0x4af8bc[_0x0998('0x35')]]){_0x4af8bc[_0x0998('0x53')]=_0x4af8bc[_0x0998('0x53')]?_0x4af8bc[_0x0998('0x53')][_0x0998('0x54')]():undefined;_0x4af8bc['applicationdata']=_0x4af8bc[_0x0998('0x55')]||_0x4af8bc[_0x0998('0x56')];if(_0x4af8bc['appdata']&&!_0x4af8bc[_0x0998('0x55')][_0x0998('0x57')]('CDR(routeAlias)')&&_0x4af8bc['application']!==_0x0998('0x9')){_0x4af8bc[_0x0998('0x56')]=_0x4af8bc['applicationdata']['toLowerCase']();}logger[_0x0998('0x28')](_0x0998('0x58'),_0x4af8bc['uniqueid'],_0x4af8bc['application'],_0x4af8bc[_0x0998('0x56')]);if(_['isUndefined'](this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]])){this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]]=new Channel();this[_0x0998('0x14')][_0x4af8bc['uniqueid']][_0x0998('0x49')]=_0x4af8bc[_0x0998('0x59')]?moment()['subtract'](moment[_0x0998('0x59')](_0x4af8bc[_0x0998('0x59')])[_0x0998('0x5a')](),_0x0998('0x5a'))[_0x0998('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x0998('0x3f')](_0x0998('0x5b'));this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]][_0x0998('0x4a')]=_0x0998('0xd');}_[_0x0998('0x4c')](this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]],_[_0x0998('0x36')](_0x4af8bc,_[_0x0998('0x37')](this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]])));if(_['includes'](applications,_0x4af8bc[_0x0998('0x53')])){this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]][_0x0998('0x5c')]=_0x4af8bc['application'];this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]][_0x0998('0x5d')]=_0x4af8bc['applicationdata'];if(_0x4af8bc['application']===_0x0998('0x5e')&&_['startsWith'](_0x4af8bc[_0x0998('0x56')][_0x0998('0x54')](),_0x0998('0x5f'))){var _0x5149a1=_0x4af8bc[_0x0998('0x56')][_0x0998('0x3b')]('=');var _0x24b120=_0x5149a1[0x0][_0x0998('0x54')]()['match'](/cdr\((.*)\)/);if(_0x24b120){if(_0x24b120[0x1]===_0x0998('0x60')&&!_[_0x0998('0x61')](this['channels'][_0x4af8bc['uniqueid']][_0x24b120[0x1]]))return;this[_0x0998('0x14')][_0x4af8bc[_0x0998('0x31')]][_0x24b120[0x1]]=_0x5149a1[0x1];}}else if(_0x4af8bc['application']===_0x0998('0x9')){this['channels'][_0x4af8bc['uniqueid']][_0x0998('0x9')]=_0x4af8bc[_0x0998('0x56')]['split'](',')[0x0];}}}}}catch(_0x27d8db){logger[_0x0998('0x2a')]('[%s][voiceCallReport][newexten]',_0x4af8bc[_0x0998('0x31')],util['inspect'](_0x27d8db,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0998('0x2d')][_0x0998('0x1c')]=function(_0x1322bf){try{if(this[_0x0998('0x43')](_0x1322bf)){logger[_0x0998('0x28')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x1322bf[_0x0998('0x31')],_0x1322bf[_0x0998('0x35')],_0x1322bf[_0x0998('0x32')],_0x1322bf[_0x0998('0x33')]);logger[_0x0998('0x44')](_0x0998('0x62'),_0x1322bf['uniqueid'],util[_0x0998('0x2c')](_0x1322bf,{'showHidden':![],'depth':null}));if(_0x1322bf[_0x0998('0x4b')]!=='6')return;var _0x26a439=this['agents'][_0x1322bf['channel'][_0x0998('0x3b')]('-')[0x0]];if(_0x1322bf['uniqueid']!==_0x1322bf[_0x0998('0x35')]){var _0x5235da=moment();if(this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]]){if(!this[_0x0998('0x14')][_0x1322bf['linkedid']][_0x0998('0x63')]){this['channels'][_0x1322bf[_0x0998('0x35')]]['answered']=!![];this[_0x0998('0x14')][_0x1322bf['linkedid']][_0x0998('0x64')]=_0x5235da[_0x0998('0x3f')](_0x0998('0x5b'));if(this['channels'][_0x1322bf[_0x0998('0x35')]][_0x0998('0x49')]){this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]][_0x0998('0x65')]=_0x5235da['diff'](this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]][_0x0998('0x49')],_0x0998('0x5a'));}}this['channels'][_0x1322bf[_0x0998('0x35')]]['linkedid']=_0x1322bf[_0x0998('0x31')];if(_0x1322bf[_0x0998('0x33')]!==_0x0998('0x3c')){this['channels'][_0x1322bf[_0x0998('0x35')]][_0x0998('0x3e')]=_0x1322bf['calleridnum'];}this[_0x0998('0x14')][_0x1322bf['linkedid']][_0x0998('0x66')]=_0x1322bf[_0x0998('0x32')];this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]][_0x0998('0x67')]=_0x1322bf[_0x0998('0x3a')];this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]][_0x0998('0x4a')]=dispositions[_['toNumber'](_0x1322bf[_0x0998('0x4b')])];if(_0x26a439){this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]][_0x0998('0x68')]=_0x26a439['id'];this['channels'][_0x1322bf[_0x0998('0x35')]][_0x0998('0x69')]=_0x26a439[_0x0998('0x50')];}}if(this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]]){if(!this['channels'][_0x1322bf['uniqueid']][_0x0998('0x63')]){this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]]['answered']=!![];this[_0x0998('0x14')][_0x1322bf['uniqueid']][_0x0998('0x64')]=_0x5235da[_0x0998('0x3f')](_0x0998('0x5b'));if(this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]][_0x0998('0x49')]){this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]][_0x0998('0x65')]=_0x5235da['diff'](this['channels'][_0x1322bf[_0x0998('0x31')]][_0x0998('0x49')],_0x0998('0x5a'));}}if(_0x1322bf[_0x0998('0x33')]!==_0x0998('0x3c')){this['channels'][_0x1322bf[_0x0998('0x31')]][_0x0998('0x3e')]=_0x1322bf[_0x0998('0x33')];}this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]][_0x0998('0x66')]=_0x1322bf[_0x0998('0x32')];this['channels'][_0x1322bf[_0x0998('0x31')]][_0x0998('0x67')]=_0x1322bf['channel'];this[_0x0998('0x14')][_0x1322bf['uniqueid']][_0x0998('0x4a')]=dispositions[_[_0x0998('0x6a')](_0x1322bf[_0x0998('0x4b')])];}}else{if(this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]]){if(_0x26a439){this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]][_0x0998('0x68')]=_0x26a439['id'];this[_0x0998('0x14')][_0x1322bf['uniqueid']][_0x0998('0x69')]=_0x26a439[_0x0998('0x50')];}}}if(_0x1322bf[_0x0998('0x38')]===_0x0998('0x39')){if(_0x26a439){_0x26a439['destconnectedlinenum']=_0x1322bf['exten'];var _0x16070f,_0x24a793;if(this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]]){_0x16070f=this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]]['routealias'];_0x24a793=this[_0x0998('0x14')][_0x1322bf[_0x0998('0x31')]][_0x0998('0x9')];}else if(this[_0x0998('0x14')][_0x1322bf['linkedid']]){_0x16070f=this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]][_0x0998('0x6b')];_0x24a793=this[_0x0998('0x14')][_0x1322bf[_0x0998('0x35')]]['queue'];}_0x26a439[_0x0998('0x9')]=_0x24a793;_0x26a439[_0x0998('0x6b')]=_0x16070f;var _0x43aee1={'id':_0x26a439['id'],'name':_0x26a439['name'],'agentconnected':!![],'destaccountcode':_0x26a439[_0x0998('0x41')],'destconnectedlinenum':_0x1322bf[_0x0998('0x4e')],'queue':_0x24a793||undefined,'routealias':_0x16070f,'uniqueid':_0x1322bf['linkedid']};logger[_0x0998('0x44')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x1322bf[_0x0998('0x31')],util['inspect'](_0x43aee1,{'showHidden':![],'depth':null}));this[_0x0998('0x2f')](util[_0x0998('0x3f')](_0x0998('0x4f'),_0x26a439[_0x0998('0x50')]),_0x0998('0x40'),_0x43aee1);}}}}catch(_0x3d0e69){logger[_0x0998('0x2a')](_0x0998('0x6c'),_0x1322bf[_0x0998('0x31')],util[_0x0998('0x2c')](_0x3d0e69,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0998('0x2d')]['syncMixMonitorFilename']=function(_0x479b7e,_0x1c535f){try{if(this[_0x0998('0x14')][_0x479b7e]){logger[_0x0998('0x28')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x479b7e,_0x1c535f);this[_0x0998('0x14')][_0x479b7e][_0x0998('0x6d')]=!![];if(_[_0x0998('0x6e')](_0x1c535f,_0x0998('0x6f'))){_0x1c535f=_0x1c535f[_0x0998('0x70')]('.wav49',_0x0998('0x71'));}this[_0x0998('0x14')][_0x479b7e][_0x0998('0x72')]=_0x1c535f;var _0xf9a62b=_[_0x0998('0x73')](this[_0x0998('0x14')][_0x479b7e][_0x0998('0x74')],{'filename':_0x1c535f});if(_[_0x0998('0x61')](_0xf9a62b)){this[_0x0998('0x14')][_0x479b7e][_0x0998('0x74')][_0x0998('0x75')]({'filename':_0x1c535f,'createdAt':moment()[_0x0998('0x3f')](_0x0998('0x5b')),'mixmonitorid':'','status':_0x0998('0x76')});}}}catch(_0x2885a9){logger['error'](_0x0998('0x77'),_0x479b7e,util[_0x0998('0x2c')](_0x2885a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0998('0x2d')][_0x0998('0x1e')]=function(_0x5c65fa){try{if(this[_0x0998('0x43')](_0x5c65fa)){logger[_0x0998('0x44')]('[%s][voiceCallReport][varset]\x20event:',_0x5c65fa[_0x0998('0x31')],util['inspect'](_0x5c65fa,{'showHidden':![],'depth':null}));if(this[_0x0998('0x14')][_0x5c65fa['uniqueid']]&&_0x5c65fa[_0x0998('0x3a')]!=_0x0998('0x46')){if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')])){if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')][_0x0998('0x79')])){logger[_0x0998('0x28')](_0x0998('0x7a'),_0x5c65fa[_0x0998('0x31')],_0x5c65fa['value']);this[_0x0998('0x7b')](_0x5c65fa[_0x0998('0x31')],_0x5c65fa[_0x0998('0x7c')]);}else if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')][_0x0998('0x7d')])){logger[_0x0998('0x28')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x5c65fa[_0x0998('0x31')],_0x5c65fa[_0x0998('0x7c')]);this[_0x0998('0x14')][_0x5c65fa['uniqueid']]['calleridnum']=_0x5c65fa[_0x0998('0x7c')];}else if(this[_0x0998('0x43')](_0x5c65fa['variable']['xmd-callerid'])){logger[_0x0998('0x28')](_0x0998('0x7e'),_0x5c65fa[_0x0998('0x31')],_0x5c65fa[_0x0998('0x7c')]);this[_0x0998('0x14')][_0x5c65fa[_0x0998('0x31')]][_0x0998('0x7f')]=_0x5c65fa[_0x0998('0x7c')];}else if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')][_0x0998('0x80')])){logger[_0x0998('0x28')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5c65fa[_0x0998('0x31')],_0x5c65fa['value']);this[_0x0998('0x14')][_0x5c65fa[_0x0998('0x31')]][_0x0998('0x60')]=_0x5c65fa['value'];}else if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')][_0x0998('0x81')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x5c65fa[_0x0998('0x31')],_0x5c65fa[_0x0998('0x7c')][_0x0998('0x3b')](',')[0x0]);this['channels'][_0x5c65fa[_0x0998('0x31')]][_0x0998('0x9')]=_0x5c65fa[_0x0998('0x7c')]['split'](',')[0x0];}else if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')][_0x0998('0x82')])){logger[_0x0998('0x28')](_0x0998('0x83'),_0x5c65fa[_0x0998('0x31')],_0x5c65fa[_0x0998('0x7c')]);this[_0x0998('0x14')][_0x5c65fa[_0x0998('0x31')]][_0x0998('0x84')]=_0x5c65fa[_0x0998('0x7c')];}else if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')]['xmd-destination'])){logger[_0x0998('0x28')](_0x0998('0x85'),_0x5c65fa[_0x0998('0x31')],_0x5c65fa['value']);this[_0x0998('0x14')][_0x5c65fa['uniqueid']][_0x0998('0x86')]=_0x5c65fa[_0x0998('0x7c')];}else if(this['isNotNull'](_0x5c65fa[_0x0998('0x78')][_0x0998('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x5c65fa[_0x0998('0x31')],_0x5c65fa[_0x0998('0x7c')]);this[_0x0998('0x14')][_0x5c65fa[_0x0998('0x31')]][_0x0998('0x88')]=_0x5c65fa['value'];}else if(this['isNotNull'](_0x5c65fa[_0x0998('0x78')][_0x0998('0x89')])){logger[_0x0998('0x28')](_0x0998('0x8a'),_0x5c65fa[_0x0998('0x31')],_0x5c65fa['value']);this[_0x0998('0x14')][_0x5c65fa[_0x0998('0x31')]][_0x0998('0x9')]=_0x5c65fa[_0x0998('0x7c')];}else if(this['isNotNull'](_0x5c65fa[_0x0998('0x78')][_0x0998('0x8b')])){logger[_0x0998('0x28')](_0x0998('0x8c'),_0x5c65fa[_0x0998('0x31')],_0x5c65fa['value']);this['channels'][_0x5c65fa[_0x0998('0x31')]][_0x0998('0x8d')]=_0x5c65fa['value'];}}}else if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')]['mixmonitor_filename'])){if(_0x5c65fa['value']){var _0xcfec60=path[_0x0998('0x8e')](_0x5c65fa[_0x0998('0x7c')])[_0x0998('0x50')];logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0xcfec60,_0x5c65fa[_0x0998('0x7c')]);this[_0x0998('0x7b')](_0xcfec60,_0x5c65fa[_0x0998('0x7c')]);}}else if(this[_0x0998('0x14')][_0x5c65fa[_0x0998('0x35')]]){if(this[_0x0998('0x43')](_0x5c65fa[_0x0998('0x78')])){if(this[_0x0998('0x43')](_0x5c65fa['variable'][_0x0998('0x8b')])){logger[_0x0998('0x28')](_0x0998('0x8c'),_0x5c65fa[_0x0998('0x35')],_0x5c65fa[_0x0998('0x7c')]);this[_0x0998('0x14')][_0x5c65fa[_0x0998('0x35')]]['sipcalllinkedid']=_0x5c65fa[_0x0998('0x7c')];}}}}}catch(_0x1d0f8f){logger[_0x0998('0x2a')]('[%s][voiceCallReport][varset]',_0x5c65fa[_0x0998('0x31')],util[_0x0998('0x2c')](_0x1d0f8f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0998('0x20')]=function(_0x3b78ba){try{if(this[_0x0998('0x43')](_0x3b78ba)){logger[_0x0998('0x44')](_0x0998('0x8f'),_0x3b78ba['uniqueid'],util[_0x0998('0x2c')](_0x3b78ba,{'showHidden':![],'depth':null}));if(this[_0x0998('0x47')][_0x3b78ba['linkedid']]){if(this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba['linkedid']]['linkedid']]){this['channels'][this['blindTransfers'][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x35')]][_0x0998('0x31')]=_0x3b78ba[_0x0998('0x31')];this['channels'][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x35')]][_0x0998('0x63')]=this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x63')];this['channels'][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x35')]]['answertime']=this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x64')];this[_0x0998('0x14')][this['blindTransfers'][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x35')]][_0x0998('0x67')]=this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x35')]][_0x0998('0x3a')];this['channels'][this['blindTransfers'][_0x3b78ba['linkedid']]['linkedid']][_0x0998('0x4a')]=this['channels'][_0x3b78ba[_0x0998('0x31')]]['disposition'];this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]]=this[_0x0998('0x14')][this['blindTransfers'][_0x3b78ba['linkedid']]['linkedid']];delete this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba['linkedid']][_0x0998('0x35')]];}else if(this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x31')]]){this[_0x0998('0x14')][this['blindTransfers'][_0x3b78ba['linkedid']]['uniqueid']]['uniqueid']=[this[_0x0998('0x14')][this['blindTransfers'][_0x3b78ba['linkedid']]['uniqueid']][_0x0998('0x35')],this['channels'][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x31')]][_0x0998('0x35')]=this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba['linkedid']][_0x0998('0x31')]][_0x0998('0x31')]][0x0];this['channels'][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x31')]]['answered']=this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x63')];this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]]['uniqueid']]['answertime']=this['channels'][_0x3b78ba['uniqueid']]['answertime'];this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x31')]]['destinationchannel']=this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]]['uniqueid']][_0x0998('0x3a')];this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba['linkedid']][_0x0998('0x31')]][_0x0998('0x4a')]=this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x4a')];this[_0x0998('0x14')][_0x3b78ba['uniqueid']]=this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]]['uniqueid']];delete this[_0x0998('0x14')][this[_0x0998('0x47')][_0x3b78ba[_0x0998('0x35')]][_0x0998('0x31')]];}}if(this[_0x0998('0x14')][_0x3b78ba['uniqueid']]){logger['info'](_0x0998('0x90'),_0x3b78ba[_0x0998('0x31')],_0x3b78ba['cause-txt']);var _0x3e4d37=moment();this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]]['endtime']=_0x3e4d37[_0x0998('0x3f')](_0x0998('0x5b'));this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x59')]=_0x3e4d37[_0x0998('0x91')](this['channels'][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x49')],'seconds');if(this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x63')]){this[_0x0998('0x14')][_0x3b78ba['uniqueid']][_0x0998('0x92')]=_0x3e4d37[_0x0998('0x91')](this['channels'][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x64')],_0x0998('0x5a'));this['channels'][_0x3b78ba[_0x0998('0x31')]][_0x0998('0x65')]=this['channels'][_0x3b78ba['uniqueid']][_0x0998('0x59')]-this[_0x0998('0x14')][_0x3b78ba[_0x0998('0x31')]]['billableseconds'];}if(_0x3b78ba[_0x0998('0x38')]===_0x0998('0x39')){if(this['agents'][_0x3b78ba[_0x0998('0x3a')][_0x0998('0x3b')]('-')[0x0]]){this['agents'][_0x3b78ba['channel'][_0x0998('0x3b')]('-')[0x0]]=_[_0x0998('0x93')](this['agents'][_0x3b78ba['channel'][_0x0998('0x3b')]('-')[0x0]],[_0x0998('0x3d')]);logger[_0x0998('0x44')](_0x0998('0x94'),_0x3b78ba[_0x0998('0x31')],util[_0x0998('0x2c')]({'id':this['agents'][_0x3b78ba[_0x0998('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x0998('0x15')][_0x3b78ba[_0x0998('0x3a')]['split']('-')[0x0]][_0x0998('0x41')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x0998('0x3f')]('user:%s',this[_0x0998('0x15')][_0x3b78ba[_0x0998('0x3a')][_0x0998('0x3b')]('-')[0x0]][_0x0998('0x50')]),_0x0998('0x95'),{'id':this['agents'][_0x3b78ba[_0x0998('0x3a')][_0x0998('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3b78ba[_0x0998('0x3a')][_0x0998('0x3b')]('-')[0x0]][_0x0998('0x41')]});for(var _0x58bc5d=0x0;_0x58bc5d0x0?!![]:![];if(!_0x2fff80){return this['syncQueueSummaryComplete'](this[_0x2cfd('0x4a')][_0x2cfd('0x70')]);}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x1e')]=function(_0x5e57fb){var _0x23fe9b=this['summary']['id'];if(this['summary'][_0x2cfd('0x6a')][_0x23fe9b]&&this[_0x2cfd('0x4a')][_0x2cfd('0x6a')][_0x23fe9b][_0x5e57fb[_0x2cfd('0x6b')]]){this[_0x2cfd('0x4a')][_0x2cfd('0x6a')][_0x23fe9b][_0x5e57fb[_0x2cfd('0x6b')]][_0x2cfd('0x14')][_0x2cfd('0x71')](_0x5e57fb);}};VoiceQueueReport[_0x2cfd('0xe')]['syncQueueSummary']=function(_0x480fe3){var _0x1a264b=this;try{if(this['isNotNull'](_0x480fe3)&&this['isNotNull'](_0x480fe3[_0x2cfd('0x51')])){logger[_0x2cfd('0x4c')](_0x2cfd('0x72'),util[_0x2cfd('0x46')](_0x480fe3,{'showHidden':![],'depth':null}));var _0x9619ab=this[_0x2cfd('0x17')][_0x480fe3[_0x2cfd('0x51')]];if(_0x9619ab){logger[_0x2cfd('0x73')](_0x2cfd('0x74'),_0x9619ab['name']);this['summary']['queues'][_0x9619ab[_0x2cfd('0x5b')]]={'summaryEvent':_0x480fe3};this[_0x2cfd('0x4a')][_0x2cfd('0x6f')]+=0x1;return ami['Action']({'action':_0x2cfd('0x6a'),'queue':_0x9619ab[_0x2cfd('0x5b')]})[_0x2cfd('0x62')](function(_0x21d76a){if(!_0x1a264b[_0x2cfd('0x4a')]['queuestatus'][_0x480fe3[_0x2cfd('0x6b')]]){_0x1a264b['summary'][_0x2cfd('0x6a')][_0x480fe3[_0x2cfd('0x6b')]]={};}_0x1a264b[_0x2cfd('0x4a')][_0x2cfd('0x6a')][_0x480fe3[_0x2cfd('0x6b')]][_0x21d76a['actionid']]={'queue':_0x9619ab[_0x2cfd('0x5b')],'agents':[]};})[_0x2cfd('0x5f')](function(_0x9fbbce){throw _0x9fbbce;});}}}catch(_0xb493c7){logger[_0x2cfd('0x44')](_0x2cfd('0x75'),util[_0x2cfd('0x46')](_0xb493c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x1d')]=function(_0xaa0046){if(this[_0x2cfd('0x4a')]['statusRequests']>0x0){this[_0x2cfd('0x4a')][_0x2cfd('0x70')]=_0xaa0046;return;}logger[_0x2cfd('0x4c')](_0x2cfd('0x76'),util[_0x2cfd('0x46')](_0xaa0046,{'showHidden':![],'depth':null}));this[_0x2cfd('0x4a')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x21')]=function(_0x4c060f){try{if(this['isNotNull'](_0x4c060f)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x4c060f[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x4c060f,{'showHidden':![],'depth':null}));if(_[_0x2cfd('0x5d')](this[_0x2cfd('0x12')][_0x4c060f[_0x2cfd('0x4f')]])){this[_0x2cfd('0x12')][_0x4c060f[_0x2cfd('0x4f')]]=[];}if(_['isUndefined'](this[_0x2cfd('0x15')][_0x4c060f[_0x2cfd('0x4f')]])){this['channels'][_0x4c060f[_0x2cfd('0x4f')]]={};}var _0x392059=new QueueReport();_0x392059[_0x2cfd('0x51')]=_0x4c060f[_0x2cfd('0x51')];_0x392059[_0x2cfd('0x59')]=this['voiceQueues'][_0x392059[_0x2cfd('0x51')]]&&this[_0x2cfd('0x17')][_0x392059[_0x2cfd('0x51')]]['type']?this[_0x2cfd('0x17')][_0x392059[_0x2cfd('0x51')]]['type']||_0x2cfd('0x6c'):_0x2cfd('0x6c');_0x392059['queuecallerjoinAt']=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x392059[_0x2cfd('0x78')]=_0x4c060f[_0x2cfd('0x78')];_0x392059['count']=_0x4c060f[_0x2cfd('0x79')];_0x392059['uniqueid']=_0x4c060f[_0x2cfd('0x4f')];_0x392059[_0x2cfd('0x7a')]=this[_0x2cfd('0x15')][_0x4c060f[_0x2cfd('0x4f')]][_0x2cfd('0x7a')];logger[_0x2cfd('0x73')](_0x2cfd('0x7b'),_0x392059[_0x2cfd('0x51')],_0x392059[_0x2cfd('0x59')]);_[_0x2cfd('0x7c')](_0x392059,_[_0x2cfd('0x7d')](_0x4c060f,_[_0x2cfd('0x7e')](_0x392059)));this[_0x2cfd('0x12')][_0x4c060f[_0x2cfd('0x4f')]][_0x2cfd('0x71')](_0x392059);this[_0x2cfd('0x15')][_0x4c060f[_0x2cfd('0x4f')]]=_0x392059;this[_0x2cfd('0x7f')](_0x392059,_0x2cfd('0x20'));}}catch(_0x5d737d){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x4c060f[_0x2cfd('0x4f')],util['inspect'](_0x5d737d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2cfd('0x23')]=function(_0x55a9d7){try{if(this[_0x2cfd('0x80')](_0x55a9d7)){logger[_0x2cfd('0x4c')](_0x2cfd('0x81'),_0x55a9d7[_0x2cfd('0x4f')],util['inspect'](_0x55a9d7,{'showHidden':![],'depth':null}));if(this[_0x2cfd('0x12')][_0x55a9d7[_0x2cfd('0x4f')]]){var _0x55d1fb=_['last'](this[_0x2cfd('0x12')][_0x55a9d7['uniqueid']]);_0x55d1fb[_0x2cfd('0x82')]=![];_0x55d1fb[_0x2cfd('0x83')]=null;_0x55d1fb[_0x2cfd('0x84')]=_0x55a9d7[_0x2cfd('0x84')];_0x55d1fb[_0x2cfd('0x85')]=_0x55a9d7['originalposition'];_0x55d1fb['queuecallerabandon']=!![];_0x55d1fb[_0x2cfd('0x86')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x55d1fb[_0x2cfd('0x54')]=_0x2cfd('0x87');_0x55d1fb[_0x2cfd('0x88')]=null;logger['info'](_0x2cfd('0x89'),_0x55d1fb[_0x2cfd('0x51')],_0x55d1fb['type']);this[_0x2cfd('0x15')][_0x55a9d7[_0x2cfd('0x4f')]]=_0x55d1fb;this['emitVoiceQueueChannelRemove'](_0x55d1fb,_0x2cfd('0x22'));}}}catch(_0x195a64){logger[_0x2cfd('0x44')](_0x2cfd('0x81'),_0x55a9d7[_0x2cfd('0x4f')],util['inspect'](_0x195a64,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2cfd('0x25')]=function(_0x23a319){try{if(this[_0x2cfd('0x80')](_0x23a319)){logger[_0x2cfd('0x4c')](_0x2cfd('0x8a'),_0x23a319['uniqueid'],util[_0x2cfd('0x46')](_0x23a319,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x23a319[_0x2cfd('0x4f')]]){var _0x3cbbe7=_[_0x2cfd('0x8b')](this[_0x2cfd('0x12')][_0x23a319[_0x2cfd('0x4f')]]);_0x3cbbe7[_0x2cfd('0x8c')]=moment()[_0x2cfd('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x3cbbe7[_0x2cfd('0x8d')]=_0x23a319['connectedlinenum'];_0x3cbbe7[_0x2cfd('0x8e')]=_0x23a319[_0x2cfd('0x8e')];logger[_0x2cfd('0x73')](_0x2cfd('0x8f'),_0x3cbbe7[_0x2cfd('0x51')],_0x3cbbe7['type'],_0x23a319[_0x2cfd('0x8d')],_0x23a319[_0x2cfd('0x8e')]);this['channels'][_0x23a319[_0x2cfd('0x4f')]]=_0x3cbbe7;this[_0x2cfd('0x7f')](_0x3cbbe7,_0x2cfd('0x24'));}}}catch(_0x293cb1){logger['error'](_0x2cfd('0x8a'),_0x23a319[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x293cb1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x28')]=function(_0x49ec14){try{if(this[_0x2cfd('0x80')](_0x49ec14)){logger[_0x2cfd('0x4c')](_0x2cfd('0x90'),_0x49ec14[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x49ec14,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x49ec14[_0x2cfd('0x4f')]]){var _0x15a89d=_['last'](this[_0x2cfd('0x12')][_0x49ec14[_0x2cfd('0x4f')]]);_0x15a89d[_0x2cfd('0x82')]=!![];_0x15a89d[_0x2cfd('0x54')]='COMPLETEDBYAGENT';logger[_0x2cfd('0x73')](_0x2cfd('0x91'),_0x15a89d['queue'],_0x15a89d[_0x2cfd('0x59')]);}}}catch(_0x31113e){logger['error'](_0x2cfd('0x90'),_0x49ec14[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x31113e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')]['syncAgentComplete']=function(_0x5dadf9){try{if(this[_0x2cfd('0x80')](_0x5dadf9)){logger['debug'](_0x2cfd('0x92'),_0x5dadf9[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x5dadf9,{'showHidden':![],'depth':null}));if(this[_0x2cfd('0x12')][_0x5dadf9['uniqueid']]){var _0x29d3c0=_[_0x2cfd('0x8b')](this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x4f')]]);_0x29d3c0[_0x2cfd('0x22')]=![];_0x29d3c0[_0x2cfd('0x86')]=null;_0x29d3c0['assigned']=!![];_0x29d3c0[_0x2cfd('0x88')]=_0x5dadf9[_0x2cfd('0x93')];_0x29d3c0['holdtime']=_0x5dadf9[_0x2cfd('0x84')];_0x29d3c0[_0x2cfd('0x82')]=!![];_0x29d3c0['queuecallerexit']=![];_0x29d3c0[_0x2cfd('0x94')]=null;if(!_0x29d3c0[_0x2cfd('0x95')]){if(_0x5dadf9['reason']=='transfer'){_0x29d3c0['queuecallerexitreason']=_0x2cfd('0x96');logger[_0x2cfd('0x73')](_0x2cfd('0x97'),_0x29d3c0[_0x2cfd('0x51')],_0x29d3c0['type']);}else{if(_['startsWith'](_0x5dadf9[_0x2cfd('0x41')][_0x2cfd('0x98')](),_0x2cfd('0x99'))){if(this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x9a')]]){var _0x4f1bc4=_[_0x2cfd('0x8b')](this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x9a')]]);_0x4f1bc4[_0x2cfd('0x82')]=![];_0x4f1bc4[_0x2cfd('0x9b')]=!![];_0x4f1bc4[_0x2cfd('0x94')]=moment(_0x29d3c0[_0x2cfd('0x9c')])[_0x2cfd('0x9d')](_0x5dadf9[_0x2cfd('0x84')],'seconds')[_0x2cfd('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f1bc4[_0x2cfd('0x54')]=_0x2cfd('0x9e');_0x4f1bc4['transfer']=!![];_0x4f1bc4[_0x2cfd('0x9f')]=_0x2cfd('0xa0');_0x4f1bc4['transferexten']=_0x5dadf9[_0x2cfd('0xa1')];_0x4f1bc4[_0x2cfd('0xa2')]=_0x5dadf9[_0x2cfd('0x4f')];logger[_0x2cfd('0x73')](_0x2cfd('0xa3'),_0x4f1bc4[_0x2cfd('0x51')],_0x4f1bc4['type']);var _0x5fd6c9=this[_0x2cfd('0x12')][_0x5dadf9['linkedid']];this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x9a')]]=this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x4f')]];this[_0x2cfd('0x12')][_0x5dadf9['uniqueid']]=_0x5fd6c9;}}else{_0x29d3c0['queuecallerexitreason']=_0x2cfd('0xa4')+_0x5dadf9[_0x2cfd('0xa5')][_0x2cfd('0xa6')]();logger['info'](_0x2cfd('0xa7'),_0x29d3c0[_0x2cfd('0x51')],_0x29d3c0[_0x2cfd('0x59')],_0x29d3c0[_0x2cfd('0x54')]);}}}this[_0x2cfd('0x15')][_0x5dadf9[_0x2cfd('0x4f')]]=_0x29d3c0;}}}catch(_0x1bb210){logger[_0x2cfd('0x44')](_0x2cfd('0x92'),_0x5dadf9[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x1bb210,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x2a')]=function(_0x123f58){try{if(this[_0x2cfd('0x80')](_0x123f58)){logger[_0x2cfd('0x4c')](_0x2cfd('0xa8'),_0x123f58['uniqueid'],util['inspect'](_0x123f58,{'showHidden':![],'depth':null}));this['addVariable'](_0x123f58[_0x2cfd('0x4f')],_[_0x2cfd('0x7e')](_0x123f58[_0x2cfd('0xa9')])[0x0],_0x123f58[_0x2cfd('0xaa')]);if(this[_0x2cfd('0x12')][_0x123f58[_0x2cfd('0x4f')]]){var _0x322465=_['last'](this[_0x2cfd('0x12')][_0x123f58[_0x2cfd('0x4f')]]);if(_0x322465){if(this['isNotNull'](_0x123f58['variable'])&&this['isNotNull'](_0x123f58[_0x2cfd('0xa9')][_0x2cfd('0x6a')])){switch(_0x123f58['value']){case _0x2cfd('0xab'):_0x322465['queuecallerexit']=![];_0x322465[_0x2cfd('0x94')]=null;break;case _0x2cfd('0xac'):_0x322465[_0x2cfd('0xad')]='timeout';_0x322465[_0x2cfd('0x9b')]=!![];_0x322465[_0x2cfd('0x94')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x322465[_0x2cfd('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x2cfd('0xae'),_0x123f58[_0x2cfd('0x4f')],util['inspect'](_0x322465,{'showHidden':![],'depth':null}));ami[_0x2cfd('0x4b')](_0x2cfd('0xaf'),_0x322465);break;default:_0x322465[_0x2cfd('0x9b')]=!![];_0x322465[_0x2cfd('0x94')]=moment()['format'](_0x2cfd('0x77'));_0x322465['queuecallerleaveAt']=moment()['format'](_0x2cfd('0x77'));}_0x322465[_0x2cfd('0x22')]=![];_0x322465[_0x2cfd('0x86')]=null;_0x322465[_0x2cfd('0x54')]=_0x123f58[_0x2cfd('0xaa')];this[_0x2cfd('0x15')][_0x123f58[_0x2cfd('0x4f')]]=_0x322465;this[_0x2cfd('0xb0')](_0x322465,'varset');}else if(this[_0x2cfd('0x80')](_0x123f58[_0x2cfd('0xa9')])&&this[_0x2cfd('0x80')](_0x123f58[_0x2cfd('0xa9')][_0x2cfd('0xb1')])){if(!_0x322465['queuecallerabandon']){_0x322465['queuecallerexit']=!![];_0x322465[_0x2cfd('0x94')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x322465[_0x2cfd('0x54')]=_0x2cfd('0xb2');_0x322465[_0x2cfd('0x8c')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));this[_0x2cfd('0x15')][_0x123f58[_0x2cfd('0x4f')]]=_0x322465;}}logger[_0x2cfd('0x73')](_0x2cfd('0xb3'),_0x123f58[_0x2cfd('0x4f')],_0x322465[_0x2cfd('0x51')],_0x322465[_0x2cfd('0x59')],_[_0x2cfd('0x7e')](_0x123f58[_0x2cfd('0xa9')])[0x0],_0x123f58[_0x2cfd('0xaa')]);_0x322465[_0x2cfd('0x19')]=this[_0x2cfd('0x19')][_0x123f58[_0x2cfd('0x4f')]];}}}}catch(_0x5c1a5a){logger[_0x2cfd('0x44')](_0x2cfd('0xa8'),_0x123f58[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x5c1a5a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0xb4')]=function(_0x5754fa,_0x202d8a,_0x27f42d){var _0x3c9964=[_0x2cfd('0xb5'),'rtpaudioqosbridged',_0x2cfd('0xb6'),_0x2cfd('0xb7'),_0x2cfd('0xb8'),_0x2cfd('0xb9'),_0x2cfd('0xba'),'rtpaudioqosrttbridged',_0x2cfd('0xbb'),'sipuri',_0x2cfd('0xbc'),_0x2cfd('0xbd'),_0x2cfd('0xbe'),_0x2cfd('0xbf'),'memberinterface','memberlastcall','membername',_0x2cfd('0xc0'),_0x2cfd('0xc1')];if(!_[_0x2cfd('0x3f')](_0x202d8a)&&!_[_0x2cfd('0xc2')](_0x3c9964,_0x202d8a)){if(_['isUndefined'](this[_0x2cfd('0x19')][_0x5754fa])){this['variables'][_0x5754fa]={};}this[_0x2cfd('0x19')][_0x5754fa][_0x202d8a]=_0x27f42d;}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0xc3')]=function(_0x57c5a8,_0x1edb8e,_0x18a7f4){var _0x5978f5={};for(var _0x1237de=0x0;_0x1237de0x0?!![]:![];if(!_0x31b115){return this['syncQueueSummaryComplete'](this[_0xe6dc('0x12')][_0xe6dc('0x6d')]);}};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0x16')]=function(_0x37e1ed){var _0x36eff0=this[_0xe6dc('0x12')]['id'];if(this[_0xe6dc('0x12')]['queuestatus'][_0x36eff0]&&this['summary'][_0xe6dc('0x62')][_0x36eff0][_0x37e1ed['actionid']]){this['summary']['queuestatus'][_0x36eff0][_0x37e1ed['actionid']][_0xe6dc('0xe')]['push'](_0x37e1ed);}};VoiceQueueReport[_0xe6dc('0x9')]['syncQueueSummary']=function(_0x5095ee){var _0x424665=this;try{if(this[_0xe6dc('0x5b')](_0x5095ee)&&this[_0xe6dc('0x5b')](_0x5095ee[_0xe6dc('0x4e')])){logger[_0xe6dc('0x52')](_0xe6dc('0x6e'),util[_0xe6dc('0x43')](_0x5095ee,{'showHidden':![],'depth':null}));var _0x478f1d=this['voiceQueues'][_0x5095ee['queue']];if(_0x478f1d){logger[_0xe6dc('0x6f')](_0xe6dc('0x70'),_0x478f1d[_0xe6dc('0x69')]);this[_0xe6dc('0x12')]['queues'][_0x478f1d[_0xe6dc('0x69')]]={'summaryEvent':_0x5095ee};this['summary'][_0xe6dc('0x6c')]+=0x1;return ami[_0xe6dc('0x3a')]({'action':_0xe6dc('0x62'),'queue':_0x478f1d[_0xe6dc('0x69')]})['then'](function(_0x3fa190){if(!_0x424665[_0xe6dc('0x12')][_0xe6dc('0x62')][_0x5095ee[_0xe6dc('0x60')]]){_0x424665[_0xe6dc('0x12')][_0xe6dc('0x62')][_0x5095ee[_0xe6dc('0x60')]]={};}_0x424665[_0xe6dc('0x12')][_0xe6dc('0x62')][_0x5095ee[_0xe6dc('0x60')]][_0x3fa190['actionid']]={'queue':_0x478f1d['name'],'agents':[]};})[_0xe6dc('0x3c')](function(_0x479e7e){throw _0x479e7e;});}}}catch(_0xbc530a){logger['error'](_0xe6dc('0x71'),util[_0xe6dc('0x43')](_0xbc530a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0x72')]=function(_0x276842){if(this['summary'][_0xe6dc('0x6c')]>0x0){this[_0xe6dc('0x12')][_0xe6dc('0x6d')]=_0x276842;return;}logger[_0xe6dc('0x52')](_0xe6dc('0x73'),util[_0xe6dc('0x43')](_0x276842,{'showHidden':![],'depth':null}));this[_0xe6dc('0x12')]=initializeSummary();ami[_0xe6dc('0x47')](_0xe6dc('0x74'),{});};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0x19')]=function(_0x5e14ef){try{if(this[_0xe6dc('0x5b')](_0x5e14ef)){logger[_0xe6dc('0x52')](_0xe6dc('0x75'),_0x5e14ef[_0xe6dc('0x4b')],util['inspect'](_0x5e14ef,{'showHidden':![],'depth':null}));if(_[_0xe6dc('0x5c')](this[_0xe6dc('0x41')][_0x5e14ef['uniqueid']])){this[_0xe6dc('0x41')][_0x5e14ef[_0xe6dc('0x4b')]]=[];}if(_['isUndefined'](this['channels'][_0x5e14ef['uniqueid']])){this[_0xe6dc('0x37')][_0x5e14ef['uniqueid']]={};}var _0x405a42=new QueueReport();_0x405a42[_0xe6dc('0x4e')]=_0x5e14ef[_0xe6dc('0x4e')];_0x405a42['type']=this[_0xe6dc('0x10')][_0x405a42[_0xe6dc('0x4e')]]&&this[_0xe6dc('0x10')][_0x405a42['queue']][_0xe6dc('0x58')]?this[_0xe6dc('0x10')][_0x405a42[_0xe6dc('0x4e')]][_0xe6dc('0x58')]||'inbound':_0xe6dc('0x59');_0x405a42['queuecallerjoinAt']=moment()[_0xe6dc('0x4c')](_0xe6dc('0x76'));_0x405a42[_0xe6dc('0x77')]=_0x5e14ef[_0xe6dc('0x77')];_0x405a42[_0xe6dc('0x78')]=_0x5e14ef[_0xe6dc('0x78')];_0x405a42[_0xe6dc('0x4b')]=_0x5e14ef[_0xe6dc('0x4b')];_0x405a42[_0xe6dc('0x79')]=this[_0xe6dc('0x37')][_0x5e14ef['uniqueid']][_0xe6dc('0x79')];logger['info'](_0xe6dc('0x7a'),_0x405a42[_0xe6dc('0x4e')],_0x405a42[_0xe6dc('0x58')]);_[_0xe6dc('0x7b')](_0x405a42,_['pick'](_0x5e14ef,_[_0xe6dc('0x7c')](_0x405a42)));this[_0xe6dc('0x41')][_0x5e14ef[_0xe6dc('0x4b')]][_0xe6dc('0x7d')](_0x405a42);this[_0xe6dc('0x37')][_0x5e14ef[_0xe6dc('0x4b')]]=_0x405a42;this['emitVoiceQueueChannelSave'](_0x405a42,_0xe6dc('0x18'));}}catch(_0x101950){logger['error'](_0xe6dc('0x75'),_0x5e14ef[_0xe6dc('0x4b')],util[_0xe6dc('0x43')](_0x101950,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6dc('0x9')]['syncQueueCallerAbandon']=function(_0x300f3c){try{if(this[_0xe6dc('0x5b')](_0x300f3c)){logger[_0xe6dc('0x52')](_0xe6dc('0x7e'),_0x300f3c['uniqueid'],util['inspect'](_0x300f3c,{'showHidden':![],'depth':null}));if(this[_0xe6dc('0x41')][_0x300f3c['uniqueid']]){var _0x14de0f=_[_0xe6dc('0x7f')](this[_0xe6dc('0x41')][_0x300f3c[_0xe6dc('0x4b')]]);_0x14de0f['queuecallercomplete']=![];_0x14de0f[_0xe6dc('0x80')]=null;_0x14de0f[_0xe6dc('0x81')]=_0x300f3c[_0xe6dc('0x81')];_0x14de0f[_0xe6dc('0x82')]=_0x300f3c[_0xe6dc('0x82')];_0x14de0f[_0xe6dc('0x1a')]=!![];_0x14de0f['queuecallerabandonAt']=moment()[_0xe6dc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x14de0f[_0xe6dc('0x83')]=_0xe6dc('0x84');_0x14de0f[_0xe6dc('0x85')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x14de0f[_0xe6dc('0x4e')],_0x14de0f['type']);this[_0xe6dc('0x37')][_0x300f3c[_0xe6dc('0x4b')]]=_0x14de0f;this[_0xe6dc('0x51')](_0x14de0f,'queuecallerabandon');}}}catch(_0xd5439d){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x300f3c[_0xe6dc('0x4b')],util[_0xe6dc('0x43')](_0xd5439d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0x1c')]=function(_0x26e7f1){try{if(this[_0xe6dc('0x5b')](_0x26e7f1)){logger[_0xe6dc('0x52')](_0xe6dc('0x86'),_0x26e7f1[_0xe6dc('0x4b')],util['inspect'](_0x26e7f1,{'showHidden':![],'depth':null}));if(this[_0xe6dc('0x41')][_0x26e7f1['uniqueid']]){var _0x3fb8a6=_['last'](this['queueReports'][_0x26e7f1[_0xe6dc('0x4b')]]);_0x3fb8a6[_0xe6dc('0x87')]=moment()['format'](_0xe6dc('0x76'));_0x3fb8a6[_0xe6dc('0x88')]=_0x26e7f1[_0xe6dc('0x88')];_0x3fb8a6[_0xe6dc('0x89')]=_0x26e7f1['connectedlinename'];logger[_0xe6dc('0x6f')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3fb8a6[_0xe6dc('0x4e')],_0x3fb8a6[_0xe6dc('0x58')],_0x26e7f1['connectedlinenum'],_0x26e7f1['connectedlinename']);this[_0xe6dc('0x37')][_0x26e7f1[_0xe6dc('0x4b')]]=_0x3fb8a6;this[_0xe6dc('0x48')](_0x3fb8a6,'queuecallerleave');}}}catch(_0xef66d1){logger[_0xe6dc('0x3f')](_0xe6dc('0x86'),_0x26e7f1[_0xe6dc('0x4b')],util[_0xe6dc('0x43')](_0xef66d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0x1f')]=function(_0x1bd698){try{if(this[_0xe6dc('0x5b')](_0x1bd698)){logger[_0xe6dc('0x52')](_0xe6dc('0x8a'),_0x1bd698[_0xe6dc('0x4b')],util[_0xe6dc('0x43')](_0x1bd698,{'showHidden':![],'depth':null}));if(this[_0xe6dc('0x41')][_0x1bd698[_0xe6dc('0x4b')]]){var _0x5da265=_[_0xe6dc('0x7f')](this[_0xe6dc('0x41')][_0x1bd698[_0xe6dc('0x4b')]]);_0x5da265[_0xe6dc('0x8b')]=!![];_0x5da265[_0xe6dc('0x83')]=_0xe6dc('0x8c');logger[_0xe6dc('0x6f')](_0xe6dc('0x8d'),_0x5da265['queue'],_0x5da265[_0xe6dc('0x58')]);}}}catch(_0xcb202a){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x1bd698[_0xe6dc('0x4b')],util[_0xe6dc('0x43')](_0xcb202a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0x8e')]=function(_0x5309da){try{if(this[_0xe6dc('0x5b')](_0x5309da)){logger[_0xe6dc('0x52')](_0xe6dc('0x8f'),_0x5309da['uniqueid'],util[_0xe6dc('0x43')](_0x5309da,{'showHidden':![],'depth':null}));if(this[_0xe6dc('0x41')][_0x5309da[_0xe6dc('0x4b')]]){var _0x55bf8f=_[_0xe6dc('0x7f')](this['queueReports'][_0x5309da[_0xe6dc('0x4b')]]);_0x55bf8f[_0xe6dc('0x1a')]=![];_0x55bf8f[_0xe6dc('0x90')]=null;_0x55bf8f[_0xe6dc('0x91')]=!![];_0x55bf8f[_0xe6dc('0x85')]=_0x5309da[_0xe6dc('0x92')];_0x55bf8f[_0xe6dc('0x81')]=_0x5309da[_0xe6dc('0x81')];_0x55bf8f[_0xe6dc('0x8b')]=!![];_0x55bf8f[_0xe6dc('0x93')]=![];_0x55bf8f[_0xe6dc('0x94')]=null;if(!_0x55bf8f[_0xe6dc('0x95')]){if(_0x5309da[_0xe6dc('0x96')]==_0xe6dc('0x95')){_0x55bf8f[_0xe6dc('0x83')]='COMPLETED';logger['info'](_0xe6dc('0x97'),_0x55bf8f['queue'],_0x55bf8f[_0xe6dc('0x58')]);}else{if(_[_0xe6dc('0x98')](_0x5309da[_0xe6dc('0x99')][_0xe6dc('0x9a')](),_0xe6dc('0x9b'))){if(this[_0xe6dc('0x41')][_0x5309da['linkedid']]){var _0x5ad4b8=_['last'](this['queueReports'][_0x5309da[_0xe6dc('0x9c')]]);_0x5ad4b8['queuecallercomplete']=![];_0x5ad4b8[_0xe6dc('0x93')]=!![];_0x5ad4b8[_0xe6dc('0x94')]=moment(_0x55bf8f[_0xe6dc('0x9d')])['add'](_0x5309da['holdtime'],_0xe6dc('0x9e'))[_0xe6dc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ad4b8['queuecallerexitreason']='FORWARDTRANSFER';_0x5ad4b8[_0xe6dc('0x95')]=!![];_0x5ad4b8[_0xe6dc('0x9f')]=_0xe6dc('0xa0');_0x5ad4b8[_0xe6dc('0xa1')]=_0x5309da[_0xe6dc('0xa2')];_0x5ad4b8[_0xe6dc('0xa3')]=_0x5309da[_0xe6dc('0x4b')];logger['info'](_0xe6dc('0xa4'),_0x5ad4b8[_0xe6dc('0x4e')],_0x5ad4b8['type']);var _0x41744a=this['queueReports'][_0x5309da[_0xe6dc('0x9c')]];this[_0xe6dc('0x41')][_0x5309da['linkedid']]=this[_0xe6dc('0x41')][_0x5309da[_0xe6dc('0x4b')]];this[_0xe6dc('0x41')][_0x5309da['uniqueid']]=_0x41744a;}}else{_0x55bf8f[_0xe6dc('0x83')]=_0xe6dc('0xa5')+_0x5309da[_0xe6dc('0x96')]['toUpperCase']();logger[_0xe6dc('0x6f')](_0xe6dc('0xa6'),_0x55bf8f[_0xe6dc('0x4e')],_0x55bf8f[_0xe6dc('0x58')],_0x55bf8f[_0xe6dc('0x83')]);}}}this['channels'][_0x5309da['uniqueid']]=_0x55bf8f;}}}catch(_0x5a7249){logger[_0xe6dc('0x3f')](_0xe6dc('0x8f'),_0x5309da[_0xe6dc('0x4b')],util['inspect'](_0x5a7249,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0x21')]=function(_0x594198){try{if(this[_0xe6dc('0x5b')](_0x594198)){logger['debug'](_0xe6dc('0xa7'),_0x594198[_0xe6dc('0x4b')],util[_0xe6dc('0x43')](_0x594198,{'showHidden':![],'depth':null}));this['addVariable'](_0x594198[_0xe6dc('0x4b')],_[_0xe6dc('0x7c')](_0x594198[_0xe6dc('0xa8')])[0x0],_0x594198[_0xe6dc('0xa9')]);if(this['queueReports'][_0x594198[_0xe6dc('0x4b')]]){var _0x33d49d=_[_0xe6dc('0x7f')](this[_0xe6dc('0x41')][_0x594198['uniqueid']]);if(_0x33d49d){if(this[_0xe6dc('0x5b')](_0x594198[_0xe6dc('0xa8')])&&this['isNotNull'](_0x594198[_0xe6dc('0xa8')][_0xe6dc('0x62')])){switch(_0x594198[_0xe6dc('0xa9')]){case _0xe6dc('0xaa'):_0x33d49d['queuecallerexit']=![];_0x33d49d[_0xe6dc('0x94')]=null;break;case'TIMEOUT':_0x33d49d['lastevent']=_0xe6dc('0xab');_0x33d49d[_0xe6dc('0x93')]=!![];_0x33d49d[_0xe6dc('0x94')]=moment()[_0xe6dc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x33d49d[_0xe6dc('0x87')]=moment()[_0xe6dc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0xe6dc('0xac'),_0x594198['uniqueid'],util['inspect'](_0x33d49d,{'showHidden':![],'depth':null}));ami[_0xe6dc('0x47')](_0xe6dc('0xad'),_0x33d49d);break;default:_0x33d49d['queuecallerexit']=!![];_0x33d49d[_0xe6dc('0x94')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x33d49d[_0xe6dc('0x87')]=moment()['format'](_0xe6dc('0x76'));}_0x33d49d[_0xe6dc('0x1a')]=![];_0x33d49d[_0xe6dc('0x90')]=null;_0x33d49d[_0xe6dc('0x83')]=_0x594198[_0xe6dc('0xa9')];this[_0xe6dc('0x37')][_0x594198[_0xe6dc('0x4b')]]=_0x33d49d;this[_0xe6dc('0x51')](_0x33d49d,_0xe6dc('0x20'));}else if(this[_0xe6dc('0x5b')](_0x594198[_0xe6dc('0xa8')])&&this[_0xe6dc('0x5b')](_0x594198[_0xe6dc('0xa8')]['queueposition'])){if(!_0x33d49d[_0xe6dc('0x1a')]){_0x33d49d[_0xe6dc('0x93')]=!![];_0x33d49d[_0xe6dc('0x94')]=moment()[_0xe6dc('0x4c')](_0xe6dc('0x76'));_0x33d49d[_0xe6dc('0x83')]='EXITWITHKEY';_0x33d49d[_0xe6dc('0x87')]=moment()[_0xe6dc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe6dc('0x37')][_0x594198[_0xe6dc('0x4b')]]=_0x33d49d;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x594198['uniqueid'],_0x33d49d[_0xe6dc('0x4e')],_0x33d49d[_0xe6dc('0x58')],_[_0xe6dc('0x7c')](_0x594198[_0xe6dc('0xa8')])[0x0],_0x594198[_0xe6dc('0xa9')]);_0x33d49d[_0xe6dc('0x44')]=this[_0xe6dc('0x44')][_0x594198['uniqueid']];}}}}catch(_0x5ee330){logger[_0xe6dc('0x3f')](_0xe6dc('0xa7'),_0x594198[_0xe6dc('0x4b')],util[_0xe6dc('0x43')](_0x5ee330,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe6dc('0x9')]['addVariable']=function(_0x33f003,_0x564568,_0x5e33bd){var _0x2c1e1e=[_0xe6dc('0xae'),'rtpaudioqosbridged',_0xe6dc('0xaf'),_0xe6dc('0xb0'),_0xe6dc('0xb1'),_0xe6dc('0xb2'),_0xe6dc('0xb3'),'rtpaudioqosrttbridged','sipcallid',_0xe6dc('0xb4'),'bridgepeer',_0xe6dc('0xb5'),_0xe6dc('0xb6'),_0xe6dc('0xb7'),_0xe6dc('0xb8'),'memberlastcall',_0xe6dc('0x92'),'memberpenalty',_0xe6dc('0xb9')];if(!_['isNil'](_0x564568)&&!_['includes'](_0x2c1e1e,_0x564568)){if(_[_0xe6dc('0x5c')](this[_0xe6dc('0x44')][_0x33f003])){this[_0xe6dc('0x44')][_0x33f003]={};}this[_0xe6dc('0x44')][_0x33f003][_0x564568]=_0x5e33bd;}};VoiceQueueReport[_0xe6dc('0x9')][_0xe6dc('0xba')]=function(_0x5ed3f3,_0x54f000,_0x4fc745){var _0x589b5d={};for(var _0x3ae956=0x0;_0x3ae956=0x0?moment(_0x2a97ef['endtime'])[_0xe303('0x19')](_0x2a97ef[_0xe303('0x17')],_0xe303('0xc')):null,'data1':_0xe303('0x1a'),'data2':_0x2a97ef['accountcode'],'data3':_0x2a97ef[_0xe303('0xf')],'data4':_0x2a97ef[_0xe303('0x1b')]||null,'role':'agent','internal':_0x2a97ef[_0xe303('0x11')]?_[_0xe303('0x12')](_0x2a97ef['accountcode']):undefined,'uniqueid':_0x2a97ef[_0xe303('0x13')]},'log':_0xe303('0x5')});}; \ No newline at end of file +var _0x4d0b=['queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','agent','accountcode','toNumber','voiceDialReport','Request','membername','starttime','outbound','dialstring','uniqueid','lodash','util','voiceQueueReport','queuecallercompleteAt'];(function(_0x1d9621,_0x2ce022){var _0x152d1e=function(_0x3f3810){while(--_0x3f3810){_0x1d9621['push'](_0x1d9621['shift']());}};_0x152d1e(++_0x2ce022);}(_0x4d0b,0xe6));var _0xb4d0=function(_0x1426cd,_0x425237){_0x1426cd=_0x1426cd-0x0;var _0x2a247d=_0x4d0b[_0x1426cd];return _0x2a247d;};'use strict';var moment=require('moment');var _=require(_0xb4d0('0x0'));var util=require(_0xb4d0('0x1'));var client=require('../client');exports[_0xb4d0('0x2')]=function(_0x302a6d){var _0x235b9f=_0x302a6d[_0xb4d0('0x3')]||_0x302a6d[_0xb4d0('0x4')];return client['Request'](_0xb4d0('0x5'),{'body':{'channel':'voice','membername':_0x302a6d[_0xb4d0('0x6')],'interface':_[_0xb4d0('0x7')](_0x302a6d['interface'])?util['format']('SIP/%s',_0x302a6d[_0xb4d0('0x6')]):_0x302a6d[_0xb4d0('0x8')],'type':_0xb4d0('0x9'),'enterAt':_0x302a6d[_0xb4d0('0xa')],'exitAt':_0x235b9f,'duration':moment(_0x235b9f)[_0xb4d0('0xb')](_0x302a6d[_0xb4d0('0xa')],_0xb4d0('0xc')),'data1':_0xb4d0('0xd'),'data2':_0x302a6d['calleridnum'],'data3':_0x302a6d[_0xb4d0('0xe')],'data4':null,'data5':_0x302a6d[_0xb4d0('0xf')],'role':_0xb4d0('0x10'),'internal':_0x302a6d[_0xb4d0('0x11')]?_[_0xb4d0('0x12')](_0x302a6d['accountcode']):undefined,'uniqueid':_0x302a6d['uniqueid']},'log':_0xb4d0('0x5')});};exports[_0xb4d0('0x13')]=function(_0x593e5a){return client[_0xb4d0('0x14')](_0xb4d0('0x5'),{'body':{'channel':'voice','membername':_0x593e5a[_0xb4d0('0x15')],'interface':_0x593e5a[_0xb4d0('0x8')],'type':_0xb4d0('0x9'),'enterAt':_0x593e5a[_0xb4d0('0x16')],'exitAt':_0x593e5a['endtime'],'duration':moment(_0x593e5a['endtime'])[_0xb4d0('0xb')](_0x593e5a[_0xb4d0('0x16')],_0xb4d0('0xc'))>=0x0?moment(_0x593e5a['endtime'])[_0xb4d0('0xb')](_0x593e5a[_0xb4d0('0x16')],'seconds'):null,'data1':_0xb4d0('0x17'),'data2':_0x593e5a[_0xb4d0('0x11')],'data3':_0x593e5a[_0xb4d0('0xe')],'data4':_0x593e5a[_0xb4d0('0x18')]||null,'role':_0xb4d0('0x10'),'internal':_0x593e5a[_0xb4d0('0x11')]?_[_0xb4d0('0x12')](_0x593e5a[_0xb4d0('0x11')]):undefined,'uniqueid':_0x593e5a[_0xb4d0('0x19')]},'log':_0xb4d0('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 8523480..8c2a0e1 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 _0xf8ff=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','Request'];(function(_0x12eb9e,_0x163858){var _0x480c7d=function(_0x449437){while(--_0x449437){_0x12eb9e['push'](_0x12eb9e['shift']());}};_0x480c7d(++_0x163858);}(_0xf8ff,0x127));var _0xff8f=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xf8ff[_0x102e37];return _0x35a07c;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xff8f('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xff8f('0x1'),_0xff8f('0x2')]},'log':_0xff8f('0x3')});}; \ No newline at end of file +var _0xb299=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','Request','ShowSetting'];(function(_0x3e94b1,_0x14218b){var _0x4b8663=function(_0x138ce0){while(--_0x138ce0){_0x3e94b1['push'](_0x3e94b1['shift']());}};_0x4b8663(++_0x14218b);}(_0xb299,0x19b));var _0x9b29=function(_0x1fdc46,_0x5e9a3e){_0x1fdc46=_0x1fdc46-0x0;var _0x3302d4=_0xb299[_0x1fdc46];return _0x3302d4;};'use strict';var client=require(_0x9b29('0x0'));exports['getSettings']=function(){return client[_0x9b29('0x1')](_0x9b29('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9b29('0x3'),_0x9b29('0x4')]},'log':_0x9b29('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 47e8971..0479af6 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 _0x307f=['getTemplates','GetTemplate','html','../client'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0x307f,0x1af));var _0xf307=function(_0x2d22ea,_0x376287){_0x2d22ea=_0x2d22ea-0x0;var _0xbc87bd=_0x307f[_0x2d22ea];return _0xbc87bd;};'use strict';var client=require(_0xf307('0x0'));exports[_0xf307('0x1')]=function(_0x42d7ac){return function(_0x303b9d){return client['Request'](_0xf307('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0xf307('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x50c1=['GetTemplate','html','../client','Request'];(function(_0x1cb0e8,_0x3b2000){var _0x281865=function(_0x4585ea){while(--_0x4585ea){_0x1cb0e8['push'](_0x1cb0e8['shift']());}};_0x281865(++_0x3b2000);}(_0x50c1,0x1b6));var _0x150c=function(_0x3ad9fb,_0x3bcd86){_0x3ad9fb=_0x3ad9fb-0x0;var _0x5dbd8c=_0x50c1[_0x3ad9fb];return _0x5dbd8c;};'use strict';var client=require(_0x150c('0x0'));exports['getTemplates']=function(_0x29da4e){return function(_0x4c4e4d){return client[_0x150c('0x1')](_0x150c('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x150c('0x3')]},'log':_0x150c('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 4da538b..4329a8f 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 _0x0df9=['status','Condition','AllConditions','AnyConditions','field','operator','value','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name'];(function(_0x4a6b68,_0x1ae822){var _0x31b265=function(_0x3e4a0e){while(--_0x3e4a0e){_0x4a6b68['push'](_0x4a6b68['shift']());}};_0x31b265(++_0x1ae822);}(_0x0df9,0x74));var _0x90df=function(_0x1678f1,_0x5c0ab8){_0x1678f1=_0x1678f1-0x0;var _0x228a67=_0x0df9[_0x1678f1];return _0x228a67;};'use strict';var client=require(_0x90df('0x0'));exports[_0x90df('0x1')]=function(_0x1665e6){return function(_0x2865ba){return client['Request'](_0x90df('0x2'),{'options':{'raw':![],'attributes':['id',_0x90df('0x3'),'channel',_0x90df('0x4')],'include':[{'model':_0x90df('0x5'),'as':_0x90df('0x6'),'attributes':['id','field','operator','value']},{'model':_0x90df('0x5'),'as':_0x90df('0x7'),'attributes':['id',_0x90df('0x8'),_0x90df('0x9'),_0x90df('0xa')]},{'model':'Action','as':_0x90df('0xb'),'attributes':['id',_0x90df('0xc'),_0x90df('0xd'),_0x90df('0xe'),_0x90df('0xf'),_0x90df('0x10'),_0x90df('0x11'),_0x90df('0x12'),_0x90df('0x13')]}]},'log':_0x90df('0x2')});};}; \ No newline at end of file +var _0x467b=['Action','Actions','action','data1','data4','data5','data6','data7','getTriggers','GetTrigger','name','status','Condition','AllConditions','operator','value','AnyConditions','field'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x467b,0x1a6));var _0xb467=function(_0x38e31a,_0x5d3ade){_0x38e31a=_0x38e31a-0x0;var _0x3292f0=_0x467b[_0x38e31a];return _0x3292f0;};'use strict';var client=require('../client');exports[_0xb467('0x0')]=function(_0x143598){return function(_0x4b925f){return client['Request'](_0xb467('0x1'),{'options':{'raw':![],'attributes':['id',_0xb467('0x2'),'channel',_0xb467('0x3')],'include':[{'model':_0xb467('0x4'),'as':_0xb467('0x5'),'attributes':['id','field',_0xb467('0x6'),_0xb467('0x7')]},{'model':_0xb467('0x4'),'as':_0xb467('0x8'),'attributes':['id',_0xb467('0x9'),_0xb467('0x6'),'value']},{'model':_0xb467('0xa'),'as':_0xb467('0xb'),'attributes':['id',_0xb467('0xc'),_0xb467('0xd'),'data2','data3',_0xb467('0xe'),_0xb467('0xf'),_0xb467('0x10'),_0xb467('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 68bddaa..c4166ad 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 _0x093d=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x4ef395,_0x45faed){var _0x155d7d=function(_0x562ca0){while(--_0x562ca0){_0x4ef395['push'](_0x4ef395['shift']());}};_0x155d7d(++_0x45faed);}(_0x093d,0x1c9));var _0xd093=function(_0x9dd37c,_0x3e255e){_0x9dd37c=_0x9dd37c-0x0;var _0x2a522c=_0x093d[_0x9dd37c];return _0x2a522c;};'use strict';var client=require(_0xd093('0x0'));exports[_0xd093('0x1')]=function(_0x359249){return function(_0x30d894){return client[_0xd093('0x2')](_0xd093('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd093('0x4'),_0xd093('0x5'),_0xd093('0x6')]},'log':_0xd093('0x3')});};}; \ No newline at end of file +var _0x39d5=['name','registry','defaultuser','GetTrunk','../client','getTrunks','Request'];(function(_0xeb6bb1,_0xc83c4c){var _0x387e00=function(_0x55a427){while(--_0x55a427){_0xeb6bb1['push'](_0xeb6bb1['shift']());}};_0x387e00(++_0xc83c4c);}(_0x39d5,0x11c));var _0x539d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x39d5[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x539d('0x0'));exports[_0x539d('0x1')]=function(_0x2a580c){return function(_0x2a5b2e){return client[_0x539d('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x539d('0x3'),_0x539d('0x4'),_0x539d('0x5')]},'log':_0x539d('0x6')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 667883c..40703ad 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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe706,0xa3));var _0x6e70=function(_0x53b93b,_0x1bfab1){_0x53b93b=_0x53b93b-0x0;var _0x485761=_0xe706[_0x53b93b];return _0x485761;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f6e4ba9..fcc222f 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 _0x91f3=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x31e444,_0x3346d4){var _0x39e47d=function(_0x188b66){while(--_0x188b66){_0x31e444['push'](_0x31e444['shift']());}};_0x39e47d(++_0x3346d4);}(_0x91f3,0x1ac));var _0x391f=function(_0x510606,_0x1597eb){_0x510606=_0x510606-0x0;var _0xf6c0ae=_0x91f3[_0x510606];return _0xf6c0ae;};'use strict';var client=require(_0x391f('0x0'));exports[_0x391f('0x1')]=function(_0x3dd784){return client[_0x391f('0x2')]('CreateVoiceAgentReport',{'body':_0x3dd784,'log':_0x391f('0x3')});};exports[_0x391f('0x4')]=function(_0x4c5cc8,_0xd699bb,_0x417bb8){return client[_0x391f('0x2')]('UpdateVoiceAgentReport',{'body':_0x4c5cc8,'options':{'where':{'uniqueid':_0xd699bb,'interface':_0x417bb8,'agentcomplete':!![]}},'log':_0x391f('0x5')});}; \ No newline at end of file +var _0x4ea4=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x4ea4,0x196));var _0x44ea=function(_0x389a61,_0x20216c){_0x389a61=_0x389a61-0x0;var _0x1acde9=_0x4ea4[_0x389a61];return _0x1acde9;};'use strict';var client=require(_0x44ea('0x0'));exports[_0x44ea('0x1')]=function(_0x25d83f){return client[_0x44ea('0x2')](_0x44ea('0x3'),{'body':_0x25d83f,'log':_0x44ea('0x3')});};exports['update']=function(_0x5cf575,_0x2d784f,_0x486ae2){return client[_0x44ea('0x2')](_0x44ea('0x4'),{'body':_0x5cf575,'options':{'where':{'uniqueid':_0x2d784f,'interface':_0x486ae2,'agentcomplete':!![]}},'log':_0x44ea('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 48bbf18..4286ebe 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 _0x16c3=['callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util','create','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x4bae66,_0x1935c5){var _0x31d9ae=function(_0x5f5ad5){while(--_0x5f5ad5){_0x4bae66['push'](_0x4bae66['shift']());}};_0x31d9ae(++_0x1935c5);}(_0x16c3,0x111));var _0x316c=function(_0x8259dc,_0x50029d){_0x8259dc=_0x8259dc-0x0;var _0x113a1b=_0x16c3[_0x8259dc];return _0x113a1b;};'use strict';var moment=require(_0x316c('0x0'));var util=require(_0x316c('0x1'));var _=require('lodash');var client=require('../client');exports[_0x316c('0x2')]=function(_0x368d27){return client['Request'](_0x316c('0x3'),{'body':_[_0x316c('0x4')](_0x368d27,{'source':_0x368d27[_0x316c('0x5')],'destinationcontext':_0x368d27[_0x316c('0x6')],'callerid':_0x368d27[_0x316c('0x7')],'amaflags':_0x316c('0x8')}),'log':_0x316c('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x316c('0x9'),{'options':{'where':{'type':[_0x316c('0xa')],'createdAt':{'$between':[moment()[_0x316c('0xb')](_0x316c('0xc'))[_0x316c('0xd')](_0x316c('0xe')),moment()[_0x316c('0xf')](_0x316c('0xc'))[_0x316c('0xd')](_0x316c('0xe'))]}},'attributes':[_0x316c('0x10'),_0x316c('0x11'),_0x316c('0x12'),'billableseconds']},'log':_0x316c('0x13')});};}; \ No newline at end of file +var _0x6fa8=['getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','billableseconds','moment','lodash','CreateVoiceCallReport','merge','context','DOCUMENTATION'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6fa8,0xda));var _0x86fa=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x6fa8[_0x8dc04d];return _0x2f5f28;};'use strict';var moment=require(_0x86fa('0x0'));var util=require('util');var _=require(_0x86fa('0x1'));var client=require('../client');exports['create']=function(_0x1eb29c){return client['Request'](_0x86fa('0x2'),{'body':_[_0x86fa('0x3')](_0x1eb29c,{'source':_0x1eb29c['calleridnum'],'destinationcontext':_0x1eb29c[_0x86fa('0x4')],'callerid':_0x1eb29c['callerid'],'amaflags':_0x86fa('0x5')}),'log':'CreateVoiceCallReport'});};exports[_0x86fa('0x6')]=function(){return function(){return client['Request'](_0x86fa('0x7'),{'options':{'where':{'type':[_0x86fa('0x8')],'createdAt':{'$between':[moment()[_0x86fa('0x9')](_0x86fa('0xa'))['format'](_0x86fa('0xb')),moment()[_0x86fa('0xc')]('day')[_0x86fa('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x86fa('0xe'),'disposition','duration',_0x86fa('0xf')]},'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 f134ce2..adbb20e 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 _0xadeb=['../client','create','Request','CreateVoiceDialReport'];(function(_0x538b6a,_0x5352ee){var _0x22fb3e=function(_0x59a62f){while(--_0x59a62f){_0x538b6a['push'](_0x538b6a['shift']());}};_0x22fb3e(++_0x5352ee);}(_0xadeb,0x128));var _0xbade=function(_0x4b370f,_0x49dd45){_0x4b370f=_0x4b370f-0x0;var _0x4613ea=_0xadeb[_0x4b370f];return _0x4613ea;};'use strict';var client=require(_0xbade('0x0'));exports[_0xbade('0x1')]=function(_0x5ad1e0){return client[_0xbade('0x2')](_0xbade('0x3'),{'body':_0x5ad1e0,'log':_0xbade('0x3')});}; \ No newline at end of file +var _0x53d0=['Request','CreateVoiceDialReport','create'];(function(_0x2992d7,_0x1077e6){var _0x313c6e=function(_0x3fb91a){while(--_0x3fb91a){_0x2992d7['push'](_0x2992d7['shift']());}};_0x313c6e(++_0x1077e6);}(_0x53d0,0x1c7));var _0x053d=function(_0x32af67,_0xd5da7b){_0x32af67=_0x32af67-0x0;var _0x82acc6=_0x53d0[_0x32af67];return _0x82acc6;};'use strict';var client=require('../client');exports[_0x053d('0x0')]=function(_0x2547be){return client[_0x053d('0x1')](_0x053d('0x2'),{'body':_0x2547be,'log':_0x053d('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ecfa86f..1c06178 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 _0xe630=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x48047b,_0xe294db){var _0x23d1c3=function(_0x37fbe7){while(--_0x37fbe7){_0x48047b['push'](_0x48047b['shift']());}};_0x23d1c3(++_0xe294db);}(_0xe630,0x149));var _0x0e63=function(_0x1bfec9,_0x2a863a){_0x1bfec9=_0x1bfec9-0x0;var _0x35cb18=_0xe630[_0x1bfec9];return _0x35cb18;};'use strict';var client=require(_0x0e63('0x0'));exports[_0x0e63('0x1')]=function(){return function(){return client['Request'](_0x0e63('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0e63('0x3'),_0x0e63('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x0e9f=['getVoiceExtensions','exten','../client'];(function(_0x5cd1e1,_0x24e90a){var _0x195aba=function(_0x1e0e7b){while(--_0x1e0e7b){_0x5cd1e1['push'](_0x5cd1e1['shift']());}};_0x195aba(++_0x24e90a);}(_0x0e9f,0x116));var _0xf0e9=function(_0x59c2c2,_0xd7fc5d){_0x59c2c2=_0x59c2c2-0x0;var _0x2e872c=_0x0e9f[_0x59c2c2];return _0x2e872c;};'use strict';var client=require(_0xf0e9('0x0'));exports[_0xf0e9('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xf0e9('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1457ec9..c3e553e 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 _0x36eb=['Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','../client'];(function(_0x4568a2,_0x3f1312){var _0x462231=function(_0x626433){while(--_0x626433){_0x4568a2['push'](_0x4568a2['shift']());}};_0x462231(++_0x3f1312);}(_0x36eb,0x187));var _0xb36e=function(_0x90289,_0x511f6b){_0x90289=_0x90289-0x0;var _0x51fccf=_0x36eb[_0x90289];return _0x51fccf;};'use strict';var client=require(_0xb36e('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xb36e('0x1')](_0xb36e('0x2'),{'options':{'raw':![],'attributes':['id',_0xb36e('0x3'),_0xb36e('0x4'),_0xb36e('0x5'),_0xb36e('0x6'),_0xb36e('0x7'),_0xb36e('0x8'),_0xb36e('0x9'),_0xb36e('0xa'),_0xb36e('0xb'),'dialLimitQueue',_0xb36e('0xc'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0xb36e('0xd'),_0xb36e('0xe'),_0xb36e('0xf'),_0xb36e('0x10'),'dialQueueOptions',_0xb36e('0x11'),'dialQueueProject',_0xb36e('0x12'),_0xb36e('0x13'),_0xb36e('0x14'),'dialBusyRetryFrequency',_0xb36e('0x15'),'dialNoAnswerRetryFrequency',_0xb36e('0x16'),'dialTimezone','dialGlobalInterval',_0xb36e('0x17'),'dialCheckDuplicateType',_0xb36e('0x18'),_0xb36e('0x19'),_0xb36e('0x1a'),'dialAMDAfterGreetingSilence',_0xb36e('0x1b'),_0xb36e('0x1c'),_0xb36e('0x1d'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout',_0xb36e('0x1e'),_0xb36e('0x1f'),_0xb36e('0x20'),_0xb36e('0x21'),_0xb36e('0x22'),_0xb36e('0x7'),_0xb36e('0x23'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xb36e('0x24'),_0xb36e('0x25'),_0xb36e('0x26'),_0xb36e('0x27'),_0xb36e('0x28'),'dialAbandonedRetryFrequency',_0xb36e('0x29'),_0xb36e('0x2a'),_0xb36e('0x2b'),'dialAgentRejectRetryFrequency',_0xb36e('0x2c'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xb36e('0x2d'),_0xb36e('0x2e')],'include':[{'model':_0xb36e('0x2f'),'as':_0xb36e('0x2f'),'attributes':['id',_0xb36e('0x3'),_0xb36e('0x30'),_0xb36e('0x31')]},{'model':_0xb36e('0x32'),'as':_0xb36e('0x33'),'attributes':['id','name']},{'model':_0xb36e('0x2f'),'as':_0xb36e('0x34'),'attributes':['id',_0xb36e('0x3'),_0xb36e('0x30'),_0xb36e('0x31')]},{'model':_0xb36e('0x35'),'as':_0xb36e('0x35'),'attributes':['id',_0xb36e('0x3')],'include':[{'model':_0xb36e('0x35'),'as':'Intervals','attributes':['id',_0xb36e('0x3'),_0xb36e('0x36')]}]}]},'log':_0xb36e('0x37')});};}; \ No newline at end of file +var _0x85c3=['dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x334a9f,_0x7d9273){var _0x13bf1c=function(_0x3ac392){while(--_0x3ac392){_0x334a9f['push'](_0x334a9f['shift']());}};_0x13bf1c(++_0x7d9273);}(_0x85c3,0xd2));var _0x385c=function(_0x480100,_0x9f8588){_0x480100=_0x480100-0x0;var _0x2cdaea=_0x85c3[_0x480100];return _0x2cdaea;};'use strict';var client=require('../client');exports[_0x385c('0x0')]=function(){return function(){return client[_0x385c('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x385c('0x2'),'acw',_0x385c('0x3'),_0x385c('0x4'),_0x385c('0x5'),_0x385c('0x6'),'dialActive',_0x385c('0x7'),_0x385c('0x8'),'dialLimitQueue',_0x385c('0x9'),_0x385c('0xa'),_0x385c('0xb'),_0x385c('0xc'),'dialOriginateCallerIdName',_0x385c('0xd'),_0x385c('0xe'),'dialQueueOptions',_0x385c('0xf'),_0x385c('0x10'),_0x385c('0x11'),'dialCongestionRetryFrequency',_0x385c('0x12'),_0x385c('0x13'),_0x385c('0x14'),_0x385c('0x15'),_0x385c('0x16'),'dialTimezone','dialGlobalInterval',_0x385c('0x17'),_0x385c('0x18'),_0x385c('0x19'),_0x385c('0x1a'),_0x385c('0x1b'),_0x385c('0x1c'),_0x385c('0x1d'),'dialAMDMinWordLength',_0x385c('0x1e'),_0x385c('0x1f'),_0x385c('0x20'),_0x385c('0x21'),_0x385c('0x22'),_0x385c('0x23'),_0x385c('0x24'),'dialOrderByScheduledAt',_0x385c('0x25'),_0x385c('0x26'),_0x385c('0x27'),_0x385c('0x5'),'strategy',_0x385c('0x28'),_0x385c('0x29'),_0x385c('0x2a'),_0x385c('0x2b'),_0x385c('0x2c'),_0x385c('0x2d'),_0x385c('0x2e'),'dialAbandonedRetryFrequency',_0x385c('0x2f'),_0x385c('0x30'),_0x385c('0x31'),_0x385c('0x32'),_0x385c('0x33'),_0x385c('0x34'),_0x385c('0x35'),_0x385c('0x36'),_0x385c('0x37')],'include':[{'model':_0x385c('0x38'),'as':_0x385c('0x38'),'attributes':['id',_0x385c('0x2'),_0x385c('0x39'),_0x385c('0x3a')]},{'model':_0x385c('0x3b'),'as':'mandatoryDispositionPause','attributes':['id',_0x385c('0x2')]},{'model':_0x385c('0x38'),'as':_0x385c('0x3c'),'attributes':['id',_0x385c('0x2'),_0x385c('0x39'),_0x385c('0x3a')]},{'model':_0x385c('0x3d'),'as':'Interval','attributes':['id',_0x385c('0x2')],'include':[{'model':'Interval','as':_0x385c('0x3e'),'attributes':['id',_0x385c('0x2'),_0x385c('0x3f')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a792c39..78801db 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(_0x1c0ec9,_0x3e7f1f){var _0x1e7da3=function(_0x34803d){while(--_0x34803d){_0x1c0ec9['push'](_0x1c0ec9['shift']());}};_0x1e7da3(++_0x3e7f1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x16bec2,_0x2fad50){var _0x52a48b=function(_0x58ddf1){while(--_0x58ddf1){_0x16bec2['push'](_0x16bec2['shift']());}};_0x52a48b(++_0x2fad50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 2ef2d65..b7a3215 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 _0x2269=['../client','getVoiceQueueRtPauses'];(function(_0x2eec28,_0x192594){var _0x56da81=function(_0x4d26b2){while(--_0x4d26b2){_0x2eec28['push'](_0x2eec28['shift']());}};_0x56da81(++_0x192594);}(_0x2269,0x158));var _0x9226=function(_0x10225c,_0x472d44){_0x10225c=_0x10225c-0x0;var _0x5c1682=_0x2269[_0x10225c];return _0x5c1682;};'use strict';var client=require(_0x9226('0x0'));exports[_0x9226('0x1')]=function(_0x9724c1){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x9724c1,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x9694=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x27200b,_0x580ca6){var _0x56ec10=function(_0x56b783){while(--_0x56b783){_0x27200b['push'](_0x27200b['shift']());}};_0x56ec10(++_0x580ca6);}(_0x9694,0xd4));var _0x4969=function(_0x5e3e02,_0x197125){_0x5e3e02=_0x5e3e02-0x0;var _0x5c0f2f=_0x9694[_0x5e3e02];return _0x5c0f2f;};'use strict';var client=require(_0x4969('0x0'));exports[_0x4969('0x1')]=function(_0x2cad04){return function(){return client[_0x4969('0x2')](_0x4969('0x3'),{'options':{'where':{'VoiceQueueId':_0x2cad04,'paused':!![]},'raw':!![]},'log':_0x4969('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index a06fed1..6607d10 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2ecfa3,_0x53f8e7){var _0x1329ff=function(_0x30b0b5){while(--_0x30b0b5){_0x2ecfa3['push'](_0x2ecfa3['shift']());}};_0x1329ff(++_0x53f8e7);}(_0x7a54,0x106));var _0x47a5=function(_0x4405ea,_0x3a79b0){_0x4405ea=_0x4405ea-0x0;var _0x43bac5=_0x7a54[_0x4405ea];return _0x43bac5;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1c736b,_0x12d351){var _0x430036=function(_0x587e7a){while(--_0x587e7a){_0x1c736b['push'](_0x1c736b['shift']());}};_0x430036(++_0x12d351);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 283763f..df885e2 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 _0xcb6d=['origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel'];(function(_0x5063fd,_0x56747a){var _0x1b7851=function(_0x41f7cb){while(--_0x41f7cb){_0x5063fd['push'](_0x5063fd['shift']());}};_0x1b7851(++_0x56747a);}(_0xcb6d,0x134));var _0xdcb6=function(_0x342778,_0x569680){_0x342778=_0x342778-0x0;var _0x292996=_0xcb6d[_0x342778];return _0x292996;};'use strict';var client=require('../client');exports[_0xdcb6('0x0')]={};exports[_0xdcb6('0x1')]=function(_0x164b1d){return client[_0xdcb6('0x2')](_0xdcb6('0x3'),{'body':{'result':_0x164b1d['result'],'transfererchannel':_0x164b1d['transfererchannel'],'transferercalleridnum':_0x164b1d[_0xdcb6('0x4')],'transferercalleridname':_0x164b1d[_0xdcb6('0x5')],'transfererconnectedlinenum':_0x164b1d['transfererconnectedlinenum'],'transfererconnectedlinename':_0x164b1d[_0xdcb6('0x6')],'transfereraccountcode':_0x164b1d[_0xdcb6('0x7')],'transferercontext':_0x164b1d[_0xdcb6('0x8')],'transfererexten':_0x164b1d[_0xdcb6('0x9')],'transfererlinkedid':_0x164b1d['transfererlinkedid'],'transfereechannel':_0x164b1d[_0xdcb6('0xa')],'transfereecalleridnum':_0x164b1d['transfereecalleridnum'],'transfereecalleridname':_0x164b1d[_0xdcb6('0xb')],'transfereeconnectedlinenum':_0x164b1d['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x164b1d[_0xdcb6('0xc')],'transfereeaccountcode':_0x164b1d['transfereeaccountcode'],'transfereecontext':_0x164b1d[_0xdcb6('0xd')],'transfereeexten':_0x164b1d[_0xdcb6('0xe')],'transfereelinkedid':_0x164b1d['transfereelinkedid'],'isexternal':_0x164b1d[_0xdcb6('0xf')],'context':_0x164b1d[_0xdcb6('0x10')],'extension':_0x164b1d[_0xdcb6('0x11')],'type':_0xdcb6('0x12')},'log':'CreateVoiceTransferReport'});};exports[_0xdcb6('0x13')]=function(_0x3fa368){return client[_0xdcb6('0x2')](_0xdcb6('0x3'),{'body':{'result':_0x3fa368[_0xdcb6('0x14')],'transfererchannel':_0x3fa368[_0xdcb6('0x15')],'transferercalleridnum':_0x3fa368[_0xdcb6('0x16')],'transferercalleridname':_0x3fa368['origtransferercalleridname'],'transfererconnectedlinenum':_0x3fa368[_0xdcb6('0x17')],'transfererconnectedlinename':_0x3fa368['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3fa368['origtransfereraccountcode'],'transferercontext':_0x3fa368['secondtransferercontext'],'transfererexten':_0x3fa368['secondtransfererexten'],'transfererlinkedid':_0x3fa368[_0xdcb6('0x18')],'transfereechannel':_0x3fa368[_0xdcb6('0x19')],'transfereecalleridnum':_0x3fa368[_0xdcb6('0x1a')],'transfereecalleridname':_0x3fa368[_0xdcb6('0x1b')],'transfereeconnectedlinenum':_0x3fa368[_0xdcb6('0x1c')],'transfereeconnectedlinename':_0x3fa368[_0xdcb6('0x1d')],'transfereeaccountcode':_0x3fa368[_0xdcb6('0x1e')],'transfereecontext':_0x3fa368[_0xdcb6('0x1f')],'transfereeexten':_0x3fa368[_0xdcb6('0x20')],'transfereelinkedid':_0x3fa368['transfertargetlinkedid'],'isexternal':_0x3fa368[_0xdcb6('0xf')],'context':_0x3fa368['origtransferercontext'],'extension':_0x3fa368['origtransfererexten'],'type':'attended'},'log':_0xdcb6('0x3')});}; \ No newline at end of file +var _0x5940=['Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','context','extension','attendedTransfer','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x5940,0x166));var _0x0594=function(_0x1b5b37,_0x3da7e1){_0x1b5b37=_0x1b5b37-0x0;var _0x21fb01=_0x5940[_0x1b5b37];return _0x21fb01;};'use strict';var client=require('../client');exports[_0x0594('0x0')]={};exports[_0x0594('0x1')]=function(_0x511452){return client[_0x0594('0x2')](_0x0594('0x3'),{'body':{'result':_0x511452[_0x0594('0x4')],'transfererchannel':_0x511452[_0x0594('0x5')],'transferercalleridnum':_0x511452[_0x0594('0x6')],'transferercalleridname':_0x511452[_0x0594('0x7')],'transfererconnectedlinenum':_0x511452[_0x0594('0x8')],'transfererconnectedlinename':_0x511452[_0x0594('0x9')],'transfereraccountcode':_0x511452['transfereraccountcode'],'transferercontext':_0x511452[_0x0594('0xa')],'transfererexten':_0x511452[_0x0594('0xb')],'transfererlinkedid':_0x511452[_0x0594('0xc')],'transfereechannel':_0x511452[_0x0594('0xd')],'transfereecalleridnum':_0x511452[_0x0594('0xe')],'transfereecalleridname':_0x511452[_0x0594('0xf')],'transfereeconnectedlinenum':_0x511452[_0x0594('0x10')],'transfereeconnectedlinename':_0x511452[_0x0594('0x11')],'transfereeaccountcode':_0x511452['transfereeaccountcode'],'transfereecontext':_0x511452[_0x0594('0x12')],'transfereeexten':_0x511452['transfereeexten'],'transfereelinkedid':_0x511452[_0x0594('0x13')],'isexternal':_0x511452['isexternal'],'context':_0x511452[_0x0594('0x14')],'extension':_0x511452[_0x0594('0x15')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0x0594('0x16')]=function(_0x11d19f){return client['Request'](_0x0594('0x3'),{'body':{'result':_0x11d19f[_0x0594('0x4')],'transfererchannel':_0x11d19f['origtransfererchannel'],'transferercalleridnum':_0x11d19f['origtransferercalleridnum'],'transferercalleridname':_0x11d19f[_0x0594('0x17')],'transfererconnectedlinenum':_0x11d19f[_0x0594('0x18')],'transfererconnectedlinename':_0x11d19f[_0x0594('0x19')],'transfereraccountcode':_0x11d19f[_0x0594('0x1a')],'transferercontext':_0x11d19f['secondtransferercontext'],'transfererexten':_0x11d19f[_0x0594('0x1b')],'transfererlinkedid':_0x11d19f[_0x0594('0x1c')],'transfereechannel':_0x11d19f['transfertargetchannel'],'transfereecalleridnum':_0x11d19f[_0x0594('0x1d')],'transfereecalleridname':_0x11d19f[_0x0594('0x1e')],'transfereeconnectedlinenum':_0x11d19f[_0x0594('0x1f')],'transfereeconnectedlinename':_0x11d19f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x11d19f[_0x0594('0x20')],'transfereecontext':_0x11d19f[_0x0594('0x21')],'transfereeexten':_0x11d19f[_0x0594('0x22')],'transfereelinkedid':_0x11d19f[_0x0594('0x23')],'isexternal':_0x11d19f[_0x0594('0x24')],'context':_0x11d19f[_0x0594('0x25')],'extension':_0x11d19f[_0x0594('0x26')],'type':_0x0594('0x27')},'log':_0x0594('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 533a294..34bc681 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 _0xdbf5=['outbound','includes','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','exten','context','agents','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','%s/%s','SIP','name','timers','updateAcw','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','pick','keys','reload','module','action','then','message','catch','isConnected','error','command','Command','Action','content','voiceQueues','hasOwnProperty','push','length','find','undefined','values','channels','username','voicechannel','validate','map','uniqueid','channel','format','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','stop','StopMixMonitor\x20Success','queueChannels','type','inbound'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2c2052,_0x3da4f6){_0x2c2052=_0x2c2052-0x0;var _0x13474d=_0xdbf5[_0x2c2052];return _0x13474d;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x5dbf('0x1'));var config=require(_0x5dbf('0x2'));var properties=require(_0x5dbf('0x3'));var ami=require(_0x5dbf('0x4'));var VoiceQueueSummary=require(_0x5dbf('0x5'));exports[_0x5dbf('0x6')]=function(_0x776036,_0x1decd2,_0x3f8628){return new Promise(function(_0x3f8222,_0x209b7d){var _0x88128e={'QueuePause':function(_0x93e657){return new Promise(function(_0x52b039){var _0x134810=util['format'](_0x5dbf('0x7'),_0x5dbf('0x8'),_0x93e657[_0x5dbf('0x9')]);if(_0x776036[_0x5dbf('0xa')]&&_0x776036['timers'][_0x134810]&&_0x776036[_0x5dbf('0xa')][_0x134810]['timer']){_0x776036['timers'][_0x134810][_0x5dbf('0xb')]();}if(_0x776036['agents'][_0x134810]){_0x776036['agents'][_0x134810][_0x5dbf('0xc')]({'statePause':_0x93e657['pause']?!![]:![]});}_0x52b039({'code':0xc8,'message':_0x5dbf('0xd')});});},'Reload':function(_0x2bb7ed){var _0x1453a9=this;return new Promise(function(_0x7cb848,_0x14493a){if(ami['isConnected']()==![]){return _0x14493a(_0x1453a9['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}_0x2bb7ed=_[_0x5dbf('0x11')](_0x2bb7ed,_[_0x5dbf('0x12')](properties[_0x5dbf('0x13')][_0x5dbf('0x14')]));_0x2bb7ed[_0x5dbf('0x15')]='Reload';return ami['Action'](_0x2bb7ed)[_0x5dbf('0x16')](function(_0xc4cb1c){_0x7cb848({'code':0xc8,'message':_0xc4cb1c[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x20c2b0){_0x14493a(_0x1453a9['error'](0x1f5,_0x20c2b0[_0x5dbf('0x17')]));});});},'Command':function(_0x4dd03c){var _0x565efa=this;return new Promise(function(_0x577ca2,_0x23d1e7){if(ami[_0x5dbf('0x19')]()==![]){return _0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')]['join']('\x20')));}_0x4dd03c=_[_0x5dbf('0x11')](_0x4dd03c,_0x5dbf('0x1b'));_0x4dd03c[_0x5dbf('0x15')]=_0x5dbf('0x1c');return ami[_0x5dbf('0x1d')](_0x4dd03c)[_0x5dbf('0x16')](function(_0x58085e){_0x577ca2({'code':0xc8,'message':_0x58085e[_0x5dbf('0x1e')]});})[_0x5dbf('0x18')](function(_0x2d3e1b){_0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f5,_0x2d3e1b[_0x5dbf('0x17')]));});});},'VoiceQueues':function(){return new Promise(function(_0x226b93){var _0x290456=[];for(var _0x20ab1b in _0x776036[_0x5dbf('0x1f')]){if(_0x776036[_0x5dbf('0x1f')][_0x5dbf('0x20')](_0x20ab1b)){var _0x232c77=_0x776036[_0x5dbf('0x1f')][_0x20ab1b];var _0x407741=new VoiceQueueSummary(_0x232c77);_0x290456[_0x5dbf('0x21')](_0x407741);}}_0x226b93({'count':_0x290456[_0x5dbf('0x22')],'rows':_0x290456});});},'UpdateVoiceQueue':function(_0x466985){return new Promise(function(_0x3f8341,_0x159e61){var _0x22ec42=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x1f')],{'id':parseInt(_0x466985['id'])});var _0x21cd00=_['omit'](_0x466985,['id']);if(_0x22ec42){for(var _0x2f71eb in _0x21cd00){if(typeof _0x21cd00[_0x2f71eb]!==_0x5dbf('0x24')&&typeof _0x22ec42[_0x2f71eb]!==_0x5dbf('0x24')){_0x22ec42[_0x2f71eb]=_0x21cd00[_0x2f71eb];}}_0x3f8341(_0x22ec42);}else{_0x159e61();}});},'VoiceChannels':function(){return new Promise(function(_0x1fb9a7){var _0x38825a=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x26')]);_0x1fb9a7({'count':_0x38825a[_0x5dbf('0x22')],'rows':_0x38825a});});},'VoiceChannelMixMonitor':function(_0x406ce6){var _0x273b63=this;return new Promise(function(_0x294dd7,_0x50a307){if(ami['isConnected']()==![]){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')]['join']('\x20')));}var _0x5cc3f1=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x406ce6);if(_0x5cc3f1['length']>0x0){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5cc3f1,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x27e058=_['find'](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x406ce6[_0x5dbf('0x2b')]});if(_0x27e058&&_0x27e058[_0x5dbf('0x2c')]){var _0x273577=util[_0x5dbf('0x2d')]('%s.%s',_0x406ce6[_0x5dbf('0x2e')]||_0x406ce6[_0x5dbf('0x2b')],_0x406ce6[_0x5dbf('0x2d')]||_0x5dbf('0x2f'));return ami['Action']({'action':_0x5dbf('0x30'),'channel':_0x27e058[_0x5dbf('0x2c')],'file':_0x273577,'options':_0x5dbf('0x31')})[_0x5dbf('0x16')](function(_0x3e309a){var _0x843d9a=_[_0x5dbf('0x23')](_0x27e058[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')]()});if(_[_0x5dbf('0x35')](_0x843d9a)){_0x27e058['monitors'][_0x5dbf('0x21')]({'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')](),'createdAt':moment()['format'](_0x5dbf('0x36')),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')],'status':_0x5dbf('0x38')});}else{_0x843d9a['mixmonitorid']=_0x3e309a[_0x5dbf('0x37')];_0x843d9a[_0x5dbf('0x39')]=_0x5dbf('0x38');}_0x294dd7({'code':0xc8,'message':[_0x406ce6['uniqueid'],_0x5dbf('0x3a'),_0x3e309a[_0x5dbf('0x37')]][_0x5dbf('0x10')]('\x20'),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')]});})[_0x5dbf('0x18')](function(_0x6ebcc6){_0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f5,[_0x406ce6[_0x5dbf('0x2b')],_0x6ebcc6['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x50a307(_0x273b63['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceChannelStopMixMonitor':function(_0x21122d){var _0x54e5e7=this;return new Promise(function(_0x3ef0eb,_0x229abf){if(ami['isConnected']()==![]){return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2745df=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x21122d);if(_0x2745df[_0x5dbf('0x22')]>0x0){return _0x229abf(_0x54e5e7['error'](0x1f4,_[_0x5dbf('0x2a')](_0x2745df,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x50880d=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x21122d[_0x5dbf('0x2b')]});if(_0x50880d){return Promise[_0x5dbf('0x3c')]()['then'](function(){if(_0x50880d[_0x5dbf('0x2c')]){return ami['Action']({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x2c')],'mixmonitorid':_0x21122d[_0x5dbf('0x37')]})[_0x5dbf('0x18')](function(){});}})['then'](function(){if(_0x50880d['destinationchannel']){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x3e')],'mixmonitorid':_0x21122d['mixmonitorid']})[_0x5dbf('0x18')](function(){});}})['then'](function(){var _0x4d8df1=_['find'](_0x50880d['monitors'],{'mixmonitorid':_0x21122d[_0x5dbf('0x37')]});if(_0x4d8df1){_0x4d8df1[_0x5dbf('0x39')]='stop';}})[_0x5dbf('0x16')](function(){var _0x3ba5cb=util['format'](_0x5dbf('0x3f'),_0x21122d[_0x5dbf('0x2e')]||_0x21122d['uniqueid'],_0x21122d[_0x5dbf('0x2d')]||'wav');var _0x5ab862=_[_0x5dbf('0x23')](_0x50880d[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x3ba5cb['toLowerCase']()});if(_0x5ab862){_0x5ab862['status']=_0x5dbf('0x40');}})[_0x5dbf('0x16')](function(){_0x3ef0eb({'code':0xc8,'message':[_0x21122d[_0x5dbf('0x2b')],_0x5dbf('0x41')][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x3b49c6){_0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,[_0x21122d['uniqueid'],_0x3b49c6[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannels':function(_0x3cc286){var _0x328dc5=this;return new Promise(function(_0x59f825){var _0x1b0b13=_['values'](_0x776036[_0x5dbf('0x42')]);var _0x1a5d82={'count':_0x1b0b13[_0x5dbf('0x22')],'rows':_0x1b0b13};if(_0x3cc286&&_0x3cc286[_0x5dbf('0x43')]){if(![_0x5dbf('0x44'),_0x5dbf('0x45')][_0x5dbf('0x46')](_0x3cc286['type'])){return _0x209b7d(_0x328dc5['error'](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x1e1876=_[_0x5dbf('0x47')](_0x1b0b13,function(_0x36a787){return _0x36a787['type']===_0x3cc286['type'];});_0x1a5d82[_0x5dbf('0x48')]=_0x1e1876[_0x5dbf('0x22')];_0x1a5d82[_0x5dbf('0x49')]=_0x1e1876;}_0x59f825(_0x1a5d82);});},'VoiceQueuesChannel':function(_0x5d70cc){var _0x2c9876=this;return new Promise(function(_0x56633d,_0x3ce224){var _0x37f16f=schema(properties[_0x5dbf('0x4a')])['validate'](_0x5d70cc);if(_0x37f16f['length']>0x0){return _0x3ce224(_0x2c9876[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x37f16f,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x4c034f=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5d70cc['uniqueid']});if(_0x4c034f){_0x56633d(_0x4c034f);}else{return _0x3ce224(_0x2c9876['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannelHangup':function(_0x14bdb1){var _0x197e8c=this;return new Promise(function(_0x20ee69,_0x3e13cb){if(ami[_0x5dbf('0x19')]()==![]){return _0x3e13cb(_0x197e8c['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x5dbf('0x10')]('\x20')));}var _0x5f2005=schema(properties[_0x5dbf('0x4b')])[_0x5dbf('0x29')](_0x14bdb1);if(_0x5f2005[_0x5dbf('0x22')]>0x0){return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5f2005,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x100d83=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x14bdb1[_0x5dbf('0x2b')]});if(_0x100d83&&_0x100d83[_0x5dbf('0x2c')]){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x4c'),'channel':_0x100d83[_0x5dbf('0x2c')]})['then'](function(_0x3fbc3d){_0x20ee69({'code':0xc8,'message':[_0x14bdb1['uniqueid'],_0x3fbc3d[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5a975a){_0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,[_0x14bdb1[_0x5dbf('0x2b')],_0x5a975a[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5ccda4){var _0x3e5a96=this;return new Promise(function(_0x3b0465,_0x18bc53){if(ami[_0x5dbf('0x19')]()==![]){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2997a8=schema(properties['voicequeuechannelredirect'])['validate'](_0x5ccda4);if(_0x2997a8[_0x5dbf('0x22')]>0x0){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x2997a8,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x377d52=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5ccda4[_0x5dbf('0x2b')]});if(_0x377d52&&_0x377d52['channel']){return ami['Action']({'action':'Redirect','channel':_0x377d52['channel'],'exten':_0x5ccda4[_0x5dbf('0x4d')],'context':_0x5ccda4[_0x5dbf('0x4e')]||_0x377d52[_0x5dbf('0x4e')],'priority':0x1})[_0x5dbf('0x16')](function(_0x29c4d9){_0x3b0465({'code':0xc8,'message':[_0x5ccda4[_0x5dbf('0x2b')],_0x29c4d9['message']['toLowerCase']()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5e84ab){_0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,[_0x5ccda4[_0x5dbf('0x2b')],_0x5e84ab[_0x5dbf('0x17')][_0x5dbf('0x34')]()]['join']('\x20')));});}else{return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'Agents':function(_0x131100){return new Promise(function(_0x1afaff){var _0x2aed16=_['values'](_0x776036[_0x5dbf('0x4f')]);if(_0x131100&&_0x131100['id']){var _0x3fce29=_[_0x5dbf('0x23')](_0x2aed16,function(_0x242e02){return _0x242e02['id']===_0x131100['id'];});_0x1afaff(_0x3fce29);}else{_0x1afaff({'count':_0x2aed16['length'],'rows':_0x2aed16});}});},'Telephones':function(){return new Promise(function(_0x11db7e){var _0x5b75a2=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x50')]);_0x11db7e({'count':_0x5b75a2[_0x5dbf('0x22')],'rows':_0x5b75a2});});},'Trunks':function(){return new Promise(function(_0x5f2d67){var _0x46db8d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x51')]);_0x5f2d67({'count':_0x46db8d[_0x5dbf('0x22')],'rows':_0x46db8d});});},'OutboundChannels':function(){return new Promise(function(_0x50db0b){var _0x1f9d2d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x52')]);_0x50db0b({'count':_0x1f9d2d[_0x5dbf('0x22')],'rows':_0x1f9d2d});});},'Outbound':function(){return new Promise(function(_0x392a9b){_0x392a9b(_0x776036[_0x5dbf('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x560d62){var _0x1efc21=_[_0x5dbf('0x25')](_0x776036['campaigns']);_0x560d62({'count':_0x1efc21[_0x5dbf('0x22')],'rows':_0x1efc21});});},'VoiceQueuesPreview':function(_0x2754bb){var _0x1a71fe=this;return new Promise(function(_0x3457de,_0x252be1){_0x1decd2[_0x5dbf('0x53')](_0x2754bb['id'])[_0x5dbf('0x16')](function(_0xdc4439){_0x3457de({'code':0xc8,'message':_0xdc4439[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x1fa250){_0x252be1(_0x1a71fe[_0x5dbf('0x1a')](0x1f4,_0x1fa250[_0x5dbf('0x17')]));});});},'EventManager':function(_0x248c1d){var _0x19f5ab=this;return new Promise(function(_0x37c1a3,_0x542667){if(!_0x248c1d[_0x5dbf('0x54')]){return _0x542667(_0x19f5ab[_0x5dbf('0x1a')](0x1f4,_0x5dbf('0x55')));}ami[_0x5dbf('0x56')]('custom:'+_0x248c1d[_0x5dbf('0x54')],_0x248c1d[_0x5dbf('0x17')]);_0x37c1a3({'code':0xc8,'message':_0x248c1d});});},'FaxAccounts':function(){return new Promise(function(_0x29a71a){var _0x42df4d=_[_0x5dbf('0x25')](_0x776036['faxAccounts']);_0x29a71a({'count':_0x42df4d[_0x5dbf('0x22')],'rows':_0x42df4d});});},'SendFax':function(_0x1ba14c){var _0x4e0117=this;return new Promise(function(_0x5d02f7,_0x3dac55){_0x3f8628[_0x5dbf('0x57')](_0x1ba14c)[_0x5dbf('0x16')](function(_0x8ca7de){_0x5d02f7({'code':0xc8,'message':_0x8ca7de[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x22339b){_0x3dac55(_0x4e0117['error'](0x1f4,_0x22339b[_0x5dbf('0x17')]));});});},'CheckAfterSend':function(_0x3b01c0){var _0x25c831=this;return new Promise(function(_0x1dd5b4,_0x39e600){_0x3f8628[_0x5dbf('0x58')](_0x3b01c0)['then'](function(_0x625875){_0x1dd5b4({'code':0xc8,'message':_0x625875[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x2c5a6e){_0x39e600(_0x25c831[_0x5dbf('0x1a')](0x1f4,_0x2c5a6e['message']));});});}};var _0x2ef784=jayson['server'](_0x88128e)['http']();_0x2ef784['on']('error',function(_0x496306){return _0x209b7d(_0x496306);});_0x2ef784[_0x5dbf('0x6')](0x232a,_0x5dbf('0x59'),function(){console[_0x5dbf('0x5a')](_0x5dbf('0x5b'),0x232a);return _0x3f8222(_0x5dbf('0x5c')+0x232a);});});}; \ No newline at end of file +var _0xb138=['Channel\x20doesn\x27t\x20exist','queueChannels','type','inbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','telephones','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','checkAfterSend','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../model/voiceQueueSummary','listen','format','%s/%s','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','asterisk','command','Command','content','error','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','destinationchannel','StopMixMonitor','stop'];(function(_0x352580,_0x40db47){var _0x459385=function(_0x40b0ef){while(--_0x40b0ef){_0x352580['push'](_0x352580['shift']());}};_0x459385(++_0x40db47);}(_0xb138,0x1dd));var _0x8b13=function(_0x287c1d,_0x4c4991){_0x287c1d=_0x287c1d-0x0;var _0x48341c=_0xb138[_0x287c1d];return _0x48341c;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var jayson=require(_0x8b13('0x2'));var schema=require(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var config=require(_0x8b13('0x5'));var properties=require(_0x8b13('0x6'));var ami=require('../ami');var VoiceQueueSummary=require(_0x8b13('0x7'));exports[_0x8b13('0x8')]=function(_0x3af81a,_0x5ae5b2,_0xd19a0f){return new Promise(function(_0x13f7bd,_0x5d51b1){var _0x3fdf4d={'QueuePause':function(_0x33d1a7){return new Promise(function(_0x22e157){var _0x498832=util[_0x8b13('0x9')](_0x8b13('0xa'),'SIP',_0x33d1a7['name']);if(_0x3af81a[_0x8b13('0xb')]&&_0x3af81a[_0x8b13('0xb')][_0x498832]&&_0x3af81a[_0x8b13('0xb')][_0x498832][_0x8b13('0xc')]){_0x3af81a[_0x8b13('0xb')][_0x498832]['updateAcw']();}if(_0x3af81a[_0x8b13('0xd')][_0x498832]){_0x3af81a[_0x8b13('0xd')][_0x498832][_0x8b13('0xe')]({'statePause':_0x33d1a7[_0x8b13('0xf')]?!![]:![]});}_0x22e157({'code':0xc8,'message':_0x8b13('0x10')});});},'Reload':function(_0x1893b1){var _0x58f97e=this;return new Promise(function(_0x50e7a4,_0x3dcde6){if(ami[_0x8b13('0x11')]()==![]){return _0x3dcde6(_0x58f97e['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x8b13('0x12')],_0x8b13('0x13')][_0x8b13('0x14')]('\x20')));}_0x1893b1=_[_0x8b13('0x15')](_0x1893b1,_[_0x8b13('0x16')](properties['reload'][_0x8b13('0x17')]));_0x1893b1[_0x8b13('0x18')]=_0x8b13('0x19');return ami[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')](function(_0x1fcfe6){_0x50e7a4({'code':0xc8,'message':_0x1fcfe6[_0x8b13('0x1c')]});})[_0x8b13('0x1d')](function(_0x4989d3){_0x3dcde6(_0x58f97e['error'](0x1f5,_0x4989d3[_0x8b13('0x1c')]));});});},'Command':function(_0x335709){var _0x14a8ac=this;return new Promise(function(_0x9c03b4,_0x1e0fe3){if(ami[_0x8b13('0x11')]()==![]){return _0x1e0fe3(_0x14a8ac['error'](0x1f4,[config[_0x8b13('0x1e')]['ip'],config[_0x8b13('0x1e')][_0x8b13('0x12')],'ami\x20disconnected']['join']('\x20')));}_0x335709=_[_0x8b13('0x15')](_0x335709,_0x8b13('0x1f'));_0x335709['action']=_0x8b13('0x20');return ami[_0x8b13('0x1a')](_0x335709)[_0x8b13('0x1b')](function(_0x213280){_0x9c03b4({'code':0xc8,'message':_0x213280[_0x8b13('0x21')]});})['catch'](function(_0x339271){_0x1e0fe3(_0x14a8ac[_0x8b13('0x22')](0x1f5,_0x339271['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x33422f){var _0x4fdd1c=[];for(var _0x420772 in _0x3af81a[_0x8b13('0x23')]){if(_0x3af81a['voiceQueues'][_0x8b13('0x24')](_0x420772)){var _0x3223d8=_0x3af81a['voiceQueues'][_0x420772];var _0x134c5e=new VoiceQueueSummary(_0x3223d8);_0x4fdd1c[_0x8b13('0x25')](_0x134c5e);}}_0x33422f({'count':_0x4fdd1c[_0x8b13('0x26')],'rows':_0x4fdd1c});});},'UpdateVoiceQueue':function(_0x4048e4){return new Promise(function(_0x27fef3,_0x54cdfc){var _0x6023f5=_[_0x8b13('0x27')](_0x3af81a[_0x8b13('0x23')],{'id':parseInt(_0x4048e4['id'])});var _0x1511bf=_[_0x8b13('0x28')](_0x4048e4,['id']);if(_0x6023f5){for(var _0x2bb51d in _0x1511bf){if(typeof _0x1511bf[_0x2bb51d]!=='undefined'&&typeof _0x6023f5[_0x2bb51d]!==_0x8b13('0x29')){_0x6023f5[_0x2bb51d]=_0x1511bf[_0x2bb51d];}}_0x27fef3(_0x6023f5);}else{_0x54cdfc();}});},'VoiceChannels':function(){return new Promise(function(_0xfec033){var _0x109f0e=_[_0x8b13('0x2a')](_0x3af81a[_0x8b13('0x2b')]);_0xfec033({'count':_0x109f0e[_0x8b13('0x26')],'rows':_0x109f0e});});},'VoiceChannelMixMonitor':function(_0x3304bd){var _0x44bce2=this;return new Promise(function(_0x36f732,_0x5751db){if(ami[_0x8b13('0x11')]()==![]){return _0x5751db(_0x44bce2[_0x8b13('0x22')](0x1f4,[config[_0x8b13('0x1e')]['ip'],config[_0x8b13('0x1e')]['username'],'ami\x20disconnected'][_0x8b13('0x14')]('\x20')));}var _0x5cedea=schema(properties['voicechannel'])[_0x8b13('0x3')](_0x3304bd);if(_0x5cedea['length']>0x0){return _0x5751db(_0x44bce2[_0x8b13('0x22')](0x1f4,_[_0x8b13('0x2c')](_0x5cedea,_0x8b13('0x1c'))[_0x8b13('0x14')](',\x20')));}var _0x11657e=_[_0x8b13('0x27')](_0x3af81a[_0x8b13('0x2b')],{'uniqueid':_0x3304bd[_0x8b13('0x2d')]});if(_0x11657e&&_0x11657e[_0x8b13('0x2e')]){var _0x1b313d=util['format'](_0x8b13('0x2f'),_0x3304bd[_0x8b13('0x30')]||_0x3304bd[_0x8b13('0x2d')],_0x3304bd[_0x8b13('0x9')]||_0x8b13('0x31'));return ami[_0x8b13('0x1a')]({'action':_0x8b13('0x32'),'channel':_0x11657e[_0x8b13('0x2e')],'file':_0x1b313d,'options':'ai(mixmonitorid)'})[_0x8b13('0x1b')](function(_0x5089c6){var _0x3826a5=_[_0x8b13('0x27')](_0x11657e[_0x8b13('0x33')],{'filename':_0x8b13('0x34')+_0x1b313d[_0x8b13('0x35')]()});if(_[_0x8b13('0x36')](_0x3826a5)){_0x11657e['monitors']['push']({'filename':_0x8b13('0x34')+_0x1b313d['toLowerCase'](),'createdAt':moment()[_0x8b13('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5089c6[_0x8b13('0x37')],'status':_0x8b13('0x38')});}else{_0x3826a5[_0x8b13('0x37')]=_0x5089c6[_0x8b13('0x37')];_0x3826a5[_0x8b13('0x39')]='rec';}_0x36f732({'code':0xc8,'message':[_0x3304bd['uniqueid'],_0x8b13('0x3a'),_0x5089c6['mixmonitorid']][_0x8b13('0x14')]('\x20'),'mixmonitorid':_0x5089c6[_0x8b13('0x37')]});})['catch'](function(_0x1012eb){_0x5751db(_0x44bce2[_0x8b13('0x22')](0x1f5,[_0x3304bd[_0x8b13('0x2d')],_0x1012eb[_0x8b13('0x1c')][_0x8b13('0x35')]()][_0x8b13('0x14')]('\x20')));});}else{return _0x5751db(_0x44bce2[_0x8b13('0x22')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5a3f5c){var _0x56a3d1=this;return new Promise(function(_0x3eb3c5,_0x16ec3){if(ami[_0x8b13('0x11')]()==![]){return _0x16ec3(_0x56a3d1[_0x8b13('0x22')](0x1f4,[config[_0x8b13('0x1e')]['ip'],config[_0x8b13('0x1e')]['username'],_0x8b13('0x13')]['join']('\x20')));}var _0x13d0ef=schema(properties['voicechannel'])[_0x8b13('0x3')](_0x5a3f5c);if(_0x13d0ef[_0x8b13('0x26')]>0x0){return _0x16ec3(_0x56a3d1[_0x8b13('0x22')](0x1f4,_[_0x8b13('0x2c')](_0x13d0ef,_0x8b13('0x1c'))[_0x8b13('0x14')](',\x20')));}var _0x2009a1=_['find'](_0x3af81a['channels'],{'uniqueid':_0x5a3f5c['uniqueid']});if(_0x2009a1){return Promise[_0x8b13('0x3b')]()[_0x8b13('0x1b')](function(){if(_0x2009a1[_0x8b13('0x2e')]){return ami[_0x8b13('0x1a')]({'action':'StopMixMonitor','channel':_0x2009a1['channel'],'mixmonitorid':_0x5a3f5c[_0x8b13('0x37')]})['catch'](function(){});}})[_0x8b13('0x1b')](function(){if(_0x2009a1[_0x8b13('0x3c')]){return ami[_0x8b13('0x1a')]({'action':_0x8b13('0x3d'),'channel':_0x2009a1[_0x8b13('0x3c')],'mixmonitorid':_0x5a3f5c['mixmonitorid']})[_0x8b13('0x1d')](function(){});}})[_0x8b13('0x1b')](function(){var _0x302db5=_[_0x8b13('0x27')](_0x2009a1[_0x8b13('0x33')],{'mixmonitorid':_0x5a3f5c[_0x8b13('0x37')]});if(_0x302db5){_0x302db5[_0x8b13('0x39')]=_0x8b13('0x3e');}})[_0x8b13('0x1b')](function(){var _0x518298=util[_0x8b13('0x9')]('%s.%s',_0x5a3f5c[_0x8b13('0x30')]||_0x5a3f5c[_0x8b13('0x2d')],_0x5a3f5c[_0x8b13('0x9')]||'wav');var _0x148efb=_[_0x8b13('0x27')](_0x2009a1[_0x8b13('0x33')],{'filename':_0x8b13('0x34')+_0x518298[_0x8b13('0x35')]()});if(_0x148efb){_0x148efb[_0x8b13('0x39')]=_0x8b13('0x3e');}})['then'](function(){_0x3eb3c5({'code':0xc8,'message':[_0x5a3f5c[_0x8b13('0x2d')],'StopMixMonitor\x20Success'][_0x8b13('0x14')]('\x20')});})[_0x8b13('0x1d')](function(_0x193338){_0x16ec3(_0x56a3d1[_0x8b13('0x22')](0x1f5,[_0x5a3f5c[_0x8b13('0x2d')],_0x193338[_0x8b13('0x1c')][_0x8b13('0x35')]()][_0x8b13('0x14')]('\x20')));});}else{return _0x16ec3(_0x56a3d1[_0x8b13('0x22')](0x1f5,_0x8b13('0x3f')));}});},'VoiceQueuesChannels':function(_0x14d456){var _0xddac8e=this;return new Promise(function(_0xd55f3b){var _0x2bdfae=_[_0x8b13('0x2a')](_0x3af81a[_0x8b13('0x40')]);var _0xa1942a={'count':_0x2bdfae['length'],'rows':_0x2bdfae};if(_0x14d456&&_0x14d456[_0x8b13('0x41')]){if(![_0x8b13('0x42'),'outbound'][_0x8b13('0x43')](_0x14d456[_0x8b13('0x41')])){return _0x5d51b1(_0xddac8e[_0x8b13('0x22')](0x190,_0x8b13('0x44')));}var _0x25cb45=_[_0x8b13('0x45')](_0x2bdfae,function(_0x934f){return _0x934f[_0x8b13('0x41')]===_0x14d456[_0x8b13('0x41')];});_0xa1942a[_0x8b13('0x46')]=_0x25cb45[_0x8b13('0x26')];_0xa1942a[_0x8b13('0x47')]=_0x25cb45;}_0xd55f3b(_0xa1942a);});},'VoiceQueuesChannel':function(_0x137e8c){var _0x25ab1f=this;return new Promise(function(_0x22e7a6,_0x49e5f4){var _0x1e0b0b=schema(properties[_0x8b13('0x48')])['validate'](_0x137e8c);if(_0x1e0b0b[_0x8b13('0x26')]>0x0){return _0x49e5f4(_0x25ab1f[_0x8b13('0x22')](0x1f4,_[_0x8b13('0x2c')](_0x1e0b0b,_0x8b13('0x1c'))[_0x8b13('0x14')](',\x20')));}var _0x4f81ae=_[_0x8b13('0x27')](_0x3af81a[_0x8b13('0x40')],{'uniqueid':_0x137e8c[_0x8b13('0x2d')]});if(_0x4f81ae){_0x22e7a6(_0x4f81ae);}else{return _0x49e5f4(_0x25ab1f['error'](0x1f5,_0x8b13('0x3f')));}});},'VoiceQueuesChannelHangup':function(_0x17ab12){var _0x585392=this;return new Promise(function(_0x1a026f,_0x348c11){if(ami[_0x8b13('0x11')]()==![]){return _0x348c11(_0x585392[_0x8b13('0x22')](0x1f4,[config['asterisk']['ip'],config[_0x8b13('0x1e')][_0x8b13('0x12')],'ami\x20disconnected'][_0x8b13('0x14')]('\x20')));}var _0x130704=schema(properties[_0x8b13('0x49')])[_0x8b13('0x3')](_0x17ab12);if(_0x130704['length']>0x0){return _0x348c11(_0x585392[_0x8b13('0x22')](0x1f4,_[_0x8b13('0x2c')](_0x130704,_0x8b13('0x1c'))[_0x8b13('0x14')](',\x20')));}var _0xa06720=_[_0x8b13('0x27')](_0x3af81a['queueChannels'],{'uniqueid':_0x17ab12[_0x8b13('0x2d')]});if(_0xa06720&&_0xa06720[_0x8b13('0x2e')]){return ami[_0x8b13('0x1a')]({'action':'Hangup','channel':_0xa06720[_0x8b13('0x2e')]})[_0x8b13('0x1b')](function(_0x122ea2){_0x1a026f({'code':0xc8,'message':[_0x17ab12[_0x8b13('0x2d')],_0x122ea2['message']['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x4fedbf){_0x348c11(_0x585392[_0x8b13('0x22')](0x1f5,[_0x17ab12[_0x8b13('0x2d')],_0x4fedbf['message'][_0x8b13('0x35')]()]['join']('\x20')));});}else{return _0x348c11(_0x585392[_0x8b13('0x22')](0x1f5,_0x8b13('0x3f')));}});},'VoiceQueuesChannelRedirect':function(_0x42790f){var _0x22c4d4=this;return new Promise(function(_0x43f12a,_0x2ff9c3){if(ami[_0x8b13('0x11')]()==![]){return _0x2ff9c3(_0x22c4d4['error'](0x1f4,[config[_0x8b13('0x1e')]['ip'],config['asterisk'][_0x8b13('0x12')],_0x8b13('0x13')][_0x8b13('0x14')]('\x20')));}var _0x11a4ba=schema(properties[_0x8b13('0x4a')])[_0x8b13('0x3')](_0x42790f);if(_0x11a4ba[_0x8b13('0x26')]>0x0){return _0x2ff9c3(_0x22c4d4['error'](0x1f4,_[_0x8b13('0x2c')](_0x11a4ba,'message')[_0x8b13('0x14')](',\x20')));}var _0x1c3544=_[_0x8b13('0x27')](_0x3af81a[_0x8b13('0x40')],{'uniqueid':_0x42790f[_0x8b13('0x2d')]});if(_0x1c3544&&_0x1c3544['channel']){return ami['Action']({'action':_0x8b13('0x4b'),'channel':_0x1c3544[_0x8b13('0x2e')],'exten':_0x42790f['exten'],'context':_0x42790f[_0x8b13('0x4c')]||_0x1c3544[_0x8b13('0x4c')],'priority':0x1})[_0x8b13('0x1b')](function(_0x51545e){_0x43f12a({'code':0xc8,'message':[_0x42790f[_0x8b13('0x2d')],_0x51545e[_0x8b13('0x1c')][_0x8b13('0x35')]()][_0x8b13('0x14')]('\x20')});})['catch'](function(_0x2a6c62){_0x2ff9c3(_0x22c4d4[_0x8b13('0x22')](0x1f5,[_0x42790f['uniqueid'],_0x2a6c62[_0x8b13('0x1c')][_0x8b13('0x35')]()][_0x8b13('0x14')]('\x20')));});}else{return _0x2ff9c3(_0x22c4d4[_0x8b13('0x22')](0x1f5,_0x8b13('0x3f')));}});},'Agents':function(_0x1243f8){return new Promise(function(_0x4334c1){var _0x1bb954=_[_0x8b13('0x2a')](_0x3af81a[_0x8b13('0xd')]);if(_0x1243f8&&_0x1243f8['id']){var _0x2f2bc5=_[_0x8b13('0x27')](_0x1bb954,function(_0x26b888){return _0x26b888['id']===_0x1243f8['id'];});_0x4334c1(_0x2f2bc5);}else{_0x4334c1({'count':_0x1bb954[_0x8b13('0x26')],'rows':_0x1bb954});}});},'Telephones':function(){return new Promise(function(_0x5bc4d6){var _0x28fb76=_['values'](_0x3af81a[_0x8b13('0x4d')]);_0x5bc4d6({'count':_0x28fb76[_0x8b13('0x26')],'rows':_0x28fb76});});},'Trunks':function(){return new Promise(function(_0x31fc95){var _0x132b81=_['values'](_0x3af81a['trunks']);_0x31fc95({'count':_0x132b81[_0x8b13('0x26')],'rows':_0x132b81});});},'OutboundChannels':function(){return new Promise(function(_0x2236b5){var _0x4d8c62=_[_0x8b13('0x2a')](_0x3af81a[_0x8b13('0x4e')]);_0x2236b5({'count':_0x4d8c62[_0x8b13('0x26')],'rows':_0x4d8c62});});},'Outbound':function(){return new Promise(function(_0x2d7c51){_0x2d7c51(_0x3af81a[_0x8b13('0x4f')]);});},'Campaigns':function(){return new Promise(function(_0x12aa48){var _0x15b553=_[_0x8b13('0x2a')](_0x3af81a[_0x8b13('0x50')]);_0x12aa48({'count':_0x15b553[_0x8b13('0x26')],'rows':_0x15b553});});},'VoiceQueuesPreview':function(_0x48fd36){var _0x2a1fd3=this;return new Promise(function(_0x2e7477,_0x5ac2c4){_0x5ae5b2[_0x8b13('0x51')](_0x48fd36['id'])[_0x8b13('0x1b')](function(_0x58138e){_0x2e7477({'code':0xc8,'message':_0x58138e[_0x8b13('0x1c')]});})[_0x8b13('0x1d')](function(_0x1f77b1){_0x5ac2c4(_0x2a1fd3[_0x8b13('0x22')](0x1f4,_0x1f77b1[_0x8b13('0x1c')]));});});},'EventManager':function(_0xe81c2e){var _0x142886=this;return new Promise(function(_0x1fde8b,_0x5d60f4){if(!_0xe81c2e[_0x8b13('0x52')]){return _0x5d60f4(_0x142886[_0x8b13('0x22')](0x1f4,_0x8b13('0x53')));}ami['emit'](_0x8b13('0x54')+_0xe81c2e['event'],_0xe81c2e[_0x8b13('0x1c')]);_0x1fde8b({'code':0xc8,'message':_0xe81c2e});});},'FaxAccounts':function(){return new Promise(function(_0x383d56){var _0x38a1ce=_[_0x8b13('0x2a')](_0x3af81a[_0x8b13('0x55')]);_0x383d56({'count':_0x38a1ce[_0x8b13('0x26')],'rows':_0x38a1ce});});},'SendFax':function(_0x41cefe){var _0x418eb4=this;return new Promise(function(_0xc73698,_0x2ae970){_0xd19a0f['send'](_0x41cefe)[_0x8b13('0x1b')](function(_0x111a4f){_0xc73698({'code':0xc8,'message':_0x111a4f[_0x8b13('0x1c')]});})[_0x8b13('0x1d')](function(_0x15f169){_0x2ae970(_0x418eb4[_0x8b13('0x22')](0x1f4,_0x15f169[_0x8b13('0x1c')]));});});},'CheckAfterSend':function(_0x9173d){var _0x5cb836=this;return new Promise(function(_0x188cc5,_0x291962){_0xd19a0f[_0x8b13('0x56')](_0x9173d)[_0x8b13('0x1b')](function(_0x4bb71a){_0x188cc5({'code':0xc8,'message':_0x4bb71a['message']});})[_0x8b13('0x1d')](function(_0x512f30){_0x291962(_0x5cb836[_0x8b13('0x22')](0x1f4,_0x512f30[_0x8b13('0x1c')]));});});}};var _0x57c9af=jayson['server'](_0x3fdf4d)[_0x8b13('0x57')]();_0x57c9af['on'](_0x8b13('0x22'),function(_0x3f5502){return _0x5d51b1(_0x3f5502);});_0x57c9af[_0x8b13('0x8')](0x232a,_0x8b13('0x58'),function(){console['log'](_0x8b13('0x59'),0x232a);return _0x13f7bd('RPC\x20listening\x20on\x20port:'+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 d1975e4..a97ed12 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 _0x2d20=['uniqueid','map','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','format','user:%s','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','routeId','destcalleridnum','calleridnum','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]'];(function(_0x117994,_0x46bbbb){var _0x40814a=function(_0x5e88ca){while(--_0x5e88ca){_0x117994['push'](_0x117994['shift']());}};_0x40814a(++_0x46bbbb);}(_0x2d20,0x1d1));var _0x02d2=function(_0x555ef8,_0x1a0f73){_0x555ef8=_0x555ef8-0x0;var _0x4878b6=_0x2d20[_0x555ef8];return _0x4878b6;};'use strict';var _=require(_0x02d2('0x0'));var BPromise=require(_0x02d2('0x1'));var Redis=require(_0x02d2('0x2'));var util=require('util');var config=require(_0x02d2('0x3'));var logger=require(_0x02d2('0x4'))(_0x02d2('0x5'));var cmContactRpc=require(_0x02d2('0x6'));config[_0x02d2('0x7')]=_[_0x02d2('0x8')](config[_0x02d2('0x7')],{'host':_0x02d2('0x9'),'port':0x18eb});var io=require(_0x02d2('0xa'))(new Redis(config[_0x02d2('0x7')]));function emit(_0x2e9660,_0x1c6af3,_0x5f30e0,_0x5368bc,_0x40c0bf){logger['info']('[CM][%s][%s]',_0x2e9660,_0x1c6af3['id'],_0x5f30e0,_0x5368bc,JSON[_0x02d2('0xb')](_0x40c0bf));io['to'](_0x5f30e0)[_0x02d2('0xc')](_0x5368bc,_0x40c0bf);}exports[_0x02d2('0xd')]=function(_0x4b5ea3,_0x287e38,_0x244a3f,_0x1cfb49){var _0x3fe9a0,_0xc6b2f4;var _0x45186a={};var _0x188cfe;var _0x28ad11=Number(_0x244a3f[_0x02d2('0xe')]);var _0x54df74=_0x244a3f[_0x02d2('0xf')]?Boolean(Number(_0x244a3f[_0x02d2('0xf')])):![];var _0x3d537b;var _0x34f9ac=![];if(!_[_0x02d2('0x10')](_0x244a3f[_0x02d2('0x11')])){if(_0x244a3f[_0x02d2('0x11')]=='1')_0x34f9ac=!![];}if(!_0x34f9ac){if(_0x1cfb49[_0x02d2('0x12')]){_0x45186a['id']=_0x1cfb49[_0x02d2('0x12')];}}if(!_0x45186a['id']){_0x45186a['ListId']=_0x28ad11;_0x3d537b=_0x244a3f[_0x02d2('0x13')]&&_0x244a3f['data3']!=='0'?_0x244a3f['data3'][_0x02d2('0x14')](','):['phone'];_0x45186a['$or']=_['map'](_0x3d537b,function(_0x30c733){var _0x1fb040={};_0x1fb040[_0x30c733]=_0x1cfb49[_0x02d2('0x15')]?_0x1cfb49[_0x02d2('0x16')]:_0x1cfb49[_0x02d2('0x17')];return _0x1fb040;});_0x188cfe=_0x1cfb49[_0x02d2('0x15')]?_0x1cfb49[_0x02d2('0x16')]:_0x1cfb49['calleridnum'];}var _0x61cc89=['id','firstName',_0x02d2('0x18'),_0x02d2('0x19'),_0x02d2('0x1a'),_0x02d2('0x1b'),'ListId',_0x02d2('0x1c'),_0x02d2('0x1d'),_0x02d2('0x1e')];var _0x59a1c1=_[_0x02d2('0x1f')](_0x61cc89,_0x3d537b);BPromise[_0x02d2('0x20')]()[_0x02d2('0x21')](cmContactRpc[_0x02d2('0x22')]({'attributes':_0x59a1c1,'where':_0x45186a,'phone':_0x188cfe}))[_0x02d2('0x21')](function(_0x3e82ba){_0xc6b2f4=_0x3e82ba;if(!_[_0x02d2('0x23')](_0xc6b2f4)){if(_0xc6b2f4[_0x02d2('0x24')]===0x1){_0x3fe9a0=_0xc6b2f4[0x0];logger[_0x02d2('0x25')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1cfb49['uniqueid'],_0x287e38['id'],_0x3fe9a0['id']);}else{logger[_0x02d2('0x25')](_0x02d2('0x26'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id'],_[_0x02d2('0x28')](_0xc6b2f4,'id')['join'](','));}return;}else{logger['info'](_0x02d2('0x29'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id']);var _0x2b7bbb={'ListId':_0x28ad11};var _0x396c38=_0x244a3f[_0x02d2('0x2a')]&&_0x244a3f['data4']!=='0'?_0x244a3f[_0x02d2('0x2a')]:_0x02d2('0x19');if(_0x54df74){logger[_0x02d2('0x25')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1cfb49[_0x02d2('0x27')],_0x287e38['id']);_0x2b7bbb[_0x396c38]=_[_0x02d2('0x10')](_0x1cfb49[_0x02d2('0x15')])?_0x1cfb49[_0x02d2('0x17')]:_0x1cfb49[_0x02d2('0x16')];if(_['isNil'](_0x1cfb49['routeId'])){_0x2b7bbb[_0x02d2('0x2b')]=_0x1cfb49[_0x02d2('0x2c')]&&_0x1cfb49[_0x02d2('0x2c')]!==''?_0x1cfb49[_0x02d2('0x2c')]:'Unknown';}else{_0x2b7bbb['firstName']=_0x1cfb49[_0x02d2('0x2d')]&&_0x1cfb49['destcalleridname']!==''?_0x1cfb49[_0x02d2('0x2d')]:'Unknown';}return BPromise[_0x02d2('0x20')]()['then'](cmContactRpc[_0x02d2('0x2e')](_0x2b7bbb))[_0x02d2('0x21')](function(_0x1d1cd2){_0x3fe9a0=_0x1d1cd2;_0xc6b2f4[_0x02d2('0x2f')](_0x1d1cd2);if(_0x3fe9a0){logger['info'](_0x02d2('0x30'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id'],_0x3fe9a0['id']);}return;});}else{logger[_0x02d2('0x25')](_0x02d2('0x31'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id']);_0x2b7bbb[_0x396c38]=_[_0x02d2('0x10')](_0x1cfb49[_0x02d2('0x15')])?_0x1cfb49[_0x02d2('0x17')]:_0x1cfb49[_0x02d2('0x16')];if(_[_0x02d2('0x10')](_0x1cfb49[_0x02d2('0x15')])){_0x2b7bbb['firstName']=_0x1cfb49[_0x02d2('0x2c')]&&_0x1cfb49[_0x02d2('0x2c')]!==''?_0x1cfb49[_0x02d2('0x2c')]:_0x02d2('0x32');}else{_0x2b7bbb['firstName']=_0x1cfb49['destcalleridname']&&_0x1cfb49['destcalleridname']!==''?_0x1cfb49[_0x02d2('0x2d')]:_0x02d2('0x32');}_0x3fe9a0=_0x2b7bbb;_0xc6b2f4[_0x02d2('0x2f')](_0x2b7bbb);return;}}})['then'](function(){if(_0x4b5ea3){emit(_0x1cfb49[_0x02d2('0x27')],_0x287e38,util[_0x02d2('0x33')](_0x02d2('0x34'),_0x4b5ea3['name']),util[_0x02d2('0x33')](_0x02d2('0x35'),_0x244a3f['action'][_0x02d2('0x36')]()),{'evt':_[_0x02d2('0x37')](_0x1cfb49,{'autoCreate':_0x54df74}),'contact':_0x3fe9a0===undefined?{}:_0x3fe9a0,'contacts':_0xc6b2f4[_0x02d2('0x24')]===0x0?undefined:_0xc6b2f4});}});}; \ No newline at end of file +var _0x4885=['emit','exec','data2','isNil','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','createdAt','updatedAt','union','resolve','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','toLowerCase','merge','length','lodash','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify'];(function(_0x3edb26,_0x9613b4){var _0x4ad9f5=function(_0x5cb828){while(--_0x5cb828){_0x3edb26['push'](_0x3edb26['shift']());}};_0x4ad9f5(++_0x9613b4);}(_0x4885,0x12e));var _0x5488=function(_0xf15d06,_0x205368){_0xf15d06=_0xf15d06-0x0;var _0x387ebe=_0x4885[_0xf15d06];return _0x387ebe;};'use strict';var _=require(_0x5488('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x5488('0x1'))(_0x5488('0x2'));var cmContactRpc=require(_0x5488('0x3'));config[_0x5488('0x4')]=_[_0x5488('0x5')](config['redis'],{'host':_0x5488('0x6'),'port':0x18eb});var io=require(_0x5488('0x7'))(new Redis(config[_0x5488('0x4')]));function emit(_0x563c98,_0x35c9b1,_0xf14f4d,_0x516e04,_0x1a1806){logger[_0x5488('0x8')]('[CM][%s][%s]',_0x563c98,_0x35c9b1['id'],_0xf14f4d,_0x516e04,JSON[_0x5488('0x9')](_0x1a1806));io['to'](_0xf14f4d)[_0x5488('0xa')](_0x516e04,_0x1a1806);}exports[_0x5488('0xb')]=function(_0x46d1c2,_0x2c49d8,_0x15a8fa,_0x3b2bfa){var _0x3da30e,_0x3bd06f;var _0x35c0a6={};var _0x4520bd;var _0x3f8c1f=Number(_0x15a8fa['data1']);var _0x1b9a7f=_0x15a8fa[_0x5488('0xc')]?Boolean(Number(_0x15a8fa[_0x5488('0xc')])):![];var _0x2ad302;var _0x300b36=![];if(!_[_0x5488('0xd')](_0x15a8fa['data5'])){if(_0x15a8fa['data5']=='1')_0x300b36=!![];}if(!_0x300b36){if(_0x3b2bfa[_0x5488('0xe')]){_0x35c0a6['id']=_0x3b2bfa[_0x5488('0xe')];}}if(!_0x35c0a6['id']){_0x35c0a6['ListId']=_0x3f8c1f;_0x2ad302=_0x15a8fa[_0x5488('0xf')]&&_0x15a8fa['data3']!=='0'?_0x15a8fa['data3'][_0x5488('0x10')](','):[_0x5488('0x11')];_0x35c0a6[_0x5488('0x12')]=_[_0x5488('0x13')](_0x2ad302,function(_0x1084bf){var _0x25ada9={};_0x25ada9[_0x1084bf]=_0x3b2bfa[_0x5488('0x14')]?_0x3b2bfa[_0x5488('0x15')]:_0x3b2bfa[_0x5488('0x16')];return _0x25ada9;});_0x4520bd=_0x3b2bfa['routeId']?_0x3b2bfa[_0x5488('0x15')]:_0x3b2bfa['calleridnum'];}var _0x3a8ef8=['id',_0x5488('0x17'),_0x5488('0x18'),_0x5488('0x11'),_0x5488('0x19'),_0x5488('0x1a'),_0x5488('0x1b'),_0x5488('0x1c'),'scheduledAt',_0x5488('0x1d')];var _0x5a1b88=_[_0x5488('0x1e')](_0x3a8ef8,_0x2ad302);BPromise[_0x5488('0x1f')]()[_0x5488('0x20')](cmContactRpc[_0x5488('0x21')]({'attributes':_0x5a1b88,'where':_0x35c0a6,'phone':_0x4520bd}))['then'](function(_0x30c516){_0x3bd06f=_0x30c516;if(!_['isEmpty'](_0x3bd06f)){if(_0x3bd06f['length']===0x1){_0x3da30e=_0x3bd06f[0x0];logger['info'](_0x5488('0x22'),_0x3b2bfa['uniqueid'],_0x2c49d8['id'],_0x3da30e['id']);}else{logger[_0x5488('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x3b2bfa[_0x5488('0x23')],_0x2c49d8['id'],_[_0x5488('0x13')](_0x3bd06f,'id')[_0x5488('0x24')](','));}return;}else{logger[_0x5488('0x8')](_0x5488('0x25'),_0x3b2bfa[_0x5488('0x23')],_0x2c49d8['id']);var _0x1e1a54={'ListId':_0x3f8c1f};var _0x48182d=_0x15a8fa[_0x5488('0x26')]&&_0x15a8fa[_0x5488('0x26')]!=='0'?_0x15a8fa[_0x5488('0x26')]:_0x5488('0x11');if(_0x1b9a7f){logger[_0x5488('0x8')](_0x5488('0x27'),_0x3b2bfa[_0x5488('0x23')],_0x2c49d8['id']);_0x1e1a54[_0x48182d]=_[_0x5488('0xd')](_0x3b2bfa['routeId'])?_0x3b2bfa[_0x5488('0x16')]:_0x3b2bfa[_0x5488('0x15')];if(_[_0x5488('0xd')](_0x3b2bfa[_0x5488('0x14')])){_0x1e1a54[_0x5488('0x17')]=_0x3b2bfa[_0x5488('0x28')]&&_0x3b2bfa['calleridname']!==''?_0x3b2bfa['calleridname']:_0x5488('0x29');}else{_0x1e1a54[_0x5488('0x17')]=_0x3b2bfa['destcalleridname']&&_0x3b2bfa[_0x5488('0x2a')]!==''?_0x3b2bfa[_0x5488('0x2a')]:_0x5488('0x29');}return BPromise['resolve']()[_0x5488('0x20')](cmContactRpc[_0x5488('0x2b')](_0x1e1a54))[_0x5488('0x20')](function(_0x33cd24){_0x3da30e=_0x33cd24;_0x3bd06f[_0x5488('0x2c')](_0x33cd24);if(_0x3da30e){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x3b2bfa[_0x5488('0x23')],_0x2c49d8['id'],_0x3da30e['id']);}return;});}else{logger[_0x5488('0x8')](_0x5488('0x2d'),_0x3b2bfa[_0x5488('0x23')],_0x2c49d8['id']);_0x1e1a54[_0x48182d]=_[_0x5488('0xd')](_0x3b2bfa[_0x5488('0x14')])?_0x3b2bfa[_0x5488('0x16')]:_0x3b2bfa[_0x5488('0x15')];if(_['isNil'](_0x3b2bfa[_0x5488('0x14')])){_0x1e1a54[_0x5488('0x17')]=_0x3b2bfa['calleridname']&&_0x3b2bfa['calleridname']!==''?_0x3b2bfa[_0x5488('0x28')]:_0x5488('0x29');}else{_0x1e1a54[_0x5488('0x17')]=_0x3b2bfa[_0x5488('0x2a')]&&_0x3b2bfa[_0x5488('0x2a')]!==''?_0x3b2bfa[_0x5488('0x2a')]:_0x5488('0x29');}_0x3da30e=_0x1e1a54;_0x3bd06f[_0x5488('0x2c')](_0x1e1a54);return;}}})[_0x5488('0x20')](function(){if(_0x46d1c2){emit(_0x3b2bfa[_0x5488('0x23')],_0x2c49d8,util[_0x5488('0x2e')]('user:%s',_0x46d1c2[_0x5488('0x2f')]),util[_0x5488('0x2e')](_0x5488('0x30'),_0x15a8fa['action'][_0x5488('0x31')]()),{'evt':_[_0x5488('0x32')](_0x3b2bfa,{'autoCreate':_0x1b9a7f}),'contact':_0x3da30e===undefined?{}:_0x3da30e,'contacts':_0x3bd06f[_0x5488('0x33')]===0x0?undefined:_0x3bd06f});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2f9d20a..60a3417 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 _0x8a21=['./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentcongestion','custom:agentreject','custom:amd','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','emit','clone','motionChannel','undefined','voice','checkTriggers','interface','status','merge','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','data6','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','accounts','queue','urlforward','script','query','search','checkTrigger','length','checkConditions','channel','AnyConditions','some','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','event','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','equals','util','mustache','ioredis','./urlforward'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a21,0x1d8));var _0x18a2=function(_0x445024,_0x36dca6){_0x445024=_0x445024-0x0;var _0x5ab19a=_0x8a21[_0x445024];return _0x5ab19a;};'use strict';var util=require(_0x18a2('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0x18a2('0x1'));var Redis=require(_0x18a2('0x2'));var urlforward=require(_0x18a2('0x3'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x18a2('0x4'));var config=require(_0x18a2('0x5'));var logger=require(_0x18a2('0x6'))(_0x18a2('0x7'));var ami=require(_0x18a2('0x8'));config[_0x18a2('0x9')]=_[_0x18a2('0xa')](config[_0x18a2('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x18a2('0xb'))(new Redis(config[_0x18a2('0x9')]));var operators={'equals':function(_0x29a54d,_0x5597f5){return _0x29a54d==_0x5597f5;},'not_equals':function(_0x29031a,_0x3e9df9){return _0x29031a!=_0x3e9df9;}};var barAndWebActions=[_0x18a2('0xc'),_0x18a2('0xd'),_0x18a2('0xe')];function Trigger(_0x54ce08){this[_0x18a2('0xf')]=_0x54ce08[_0x18a2('0xf')];this['agents']=_0x54ce08[_0x18a2('0x10')];this[_0x18a2('0x11')]=_0x54ce08['voiceQueues'];this[_0x18a2('0x12')]=_0x54ce08[_0x18a2('0x12')];this['voiceExtensions']=_0x54ce08[_0x18a2('0x13')];this[_0x18a2('0x14')]=_0x54ce08[_0x18a2('0x14')];this[_0x18a2('0x15')]=_0x54ce08['freshdeskAccounts'];this['salesforceAccounts']=_0x54ce08[_0x18a2('0x16')];this['sugarcrmAccounts']=_0x54ce08[_0x18a2('0x17')];this['zohoAccounts']=_0x54ce08[_0x18a2('0x18')];this[_0x18a2('0x19')]=_0x54ce08[_0x18a2('0x19')];this['vtigerAccounts']=_0x54ce08[_0x18a2('0x1a')];this[_0x18a2('0x1b')]=_0x54ce08[_0x18a2('0x1b')];this[_0x18a2('0x1c')]=_0x54ce08[_0x18a2('0x1c')];this['freshsalesAccounts']=_0x54ce08[_0x18a2('0x1d')];this['accounts']={'zendesk':this[_0x18a2('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x18a2('0x15')],'sugarcrm':this[_0x18a2('0x17')],'zoho':this[_0x18a2('0x18')],'desk':this[_0x18a2('0x19')],'vtiger':this[_0x18a2('0x1a')],'dynamics365':this[_0x18a2('0x1c')],'freshsales':this[_0x18a2('0x1d')],'servicenow':this[_0x18a2('0x1b')]};ami['on'](_0x18a2('0x1e'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x21'),this['syncCustomEvent'][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x22'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x23'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:agentnoanswer',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:agentbusy',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x24'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x25'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x26'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:timeout',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x27'),this[_0x18a2('0x28')][_0x18a2('0x20')](this));ami['on']('custom:dialconnect',this[_0x18a2('0x28')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x29'),this[_0x18a2('0x28')][_0x18a2('0x20')](this));ami['on']('custom:newinteraction',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2a'),this[_0x18a2('0x1f')]['bind'](this));ami['on'](_0x18a2('0x2b'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2c'),this['syncCustomEvent'][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2d'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2e'),this[_0x18a2('0x1f')]['bind'](this));ami['on'](_0x18a2('0x2f'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x30'),this[_0x18a2('0x1f')]['bind'](this));}Trigger[_0x18a2('0x31')]['emit']=function(_0x1a9437,_0x9b20c1,_0x42a851){logger[_0x18a2('0x32')](_0x1a9437,_0x9b20c1,JSON['stringify'](_0x42a851));io['to'](_0x1a9437)[_0x18a2('0x33')](_0x9b20c1,_0x42a851);};Trigger[_0x18a2('0x31')]['syncCustomEvent']=function(_0x430a03){var _0x13e882=_[_0x18a2('0x34')](_0x430a03);if(typeof _0x13e882[_0x18a2('0x35')]===_0x18a2('0x36')){_0x13e882['motionChannel']=_0x18a2('0x37');}this[_0x18a2('0x38')](_0x13e882);};Trigger[_0x18a2('0x31')][_0x18a2('0x28')]=function(_0x5aad75){if(this['agents'][_0x5aad75[_0x18a2('0x39')]]){this['syncCustomEvent'](_0x5aad75);}};Trigger[_0x18a2('0x31')][_0x18a2('0x38')]=function(_0x9e6946){var _0x3a6a45;for(var _0x2345eb in this[_0x18a2('0xf')]){if(this[_0x18a2('0xf')]['hasOwnProperty'](_0x2345eb)){if(this[_0x18a2('0xf')][_0x2345eb][_0x18a2('0x3a')]){_0x3a6a45=this['checkTrigger'](this[_0x18a2('0xf')][_0x2345eb],_0x9e6946);if(_0x3a6a45){_[_0x18a2('0x3b')](_0x9e6946,_0x9e6946['variables']);for(var _0x30d37c=0x0,_0x392626,_0x3a5b6d,_0x200080;_0x30d37c0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14b,0x93));var _0xbe14=function(_0x2f974c,_0x22aac7){_0x2f974c=_0x2f974c-0x0;var _0x31ee18=_0xe14b[_0x2f974c];return _0x31ee18;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index bc942e4..2c3b1e1 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 _0xacbf=['forEach','includes','string','type','customField','idField','substring','indexOf','content','incident','incidents','assign','Subjects','getString','Descriptions','ticketType','phonecall','callDirection','queue','/contacts(','phonecalls','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','lastIndexOf','enduserId','contacts?$select=','\x20eq\x20\x27','replace','%2b','4.0','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!'];(function(_0x270cbe,_0x4d9ef1){var _0x382eea=function(_0x9d0c0a){while(--_0x9d0c0a){_0x270cbe['push'](_0x270cbe['shift']());}};_0x382eea(++_0x4d9ef1);}(_0xacbf,0x106));var _0xfacb=function(_0x3d20a3,_0x416806){_0x3d20a3=_0x3d20a3-0x0;var _0x44feb5=_0xacbf[_0x3d20a3];return _0x44feb5;};'use strict';var _=require(_0xfacb('0x0'));var rp=require('request-promise');var util=require(_0xfacb('0x1'));var intUtil=require(_0xfacb('0x2'));var md5=require(_0xfacb('0x3'));var Redis=require(_0xfacb('0x4'));var logger=require(_0xfacb('0x5'))(_0xfacb('0x6'));var config=require(_0xfacb('0x7'));config[_0xfacb('0x8')]=_[_0xfacb('0x9')](config[_0xfacb('0x8')],{'host':_0xfacb('0xa'),'port':0x18eb});var io=require(_0xfacb('0xb'))(new Redis(config[_0xfacb('0x8')]));function getAuthToken(_0x285acd,_0x3bd670,_0x326f64){if(_0x285acd[_0xfacb('0xc')]){_0x285acd['remoteUri']=_0x285acd[_0xfacb('0xd')]['data7'];_0x285acd[_0xfacb('0xe')]=_0x285acd['CloudProvider']['data2'];return Promise[_0xfacb('0xf')](_0x285acd[_0xfacb('0xd')][_0xfacb('0x10')]);}var _0x222534={'method':_0xfacb('0x11'),'uri':_0x3bd670,'form':{'client_id':_0x285acd[_0xfacb('0x12')],'resource':_0x285acd[_0xfacb('0x13')],'username':_0x285acd[_0xfacb('0x14')],'password':_0x285acd[_0xfacb('0x15')],'grant_type':'password','client_secret':_0x285acd[_0xfacb('0x16')]},'json':!![]};return rp(_0x222534)[_0xfacb('0x17')](function(_0x308903){return _0x308903[_0xfacb('0x18')];})[_0xfacb('0x19')](function(_0x58d299){logger[_0xfacb('0x1a')]('['+[_0x326f64[_0xfacb('0x1b')]()]+_0xfacb('0x1c'));return _0x58d299[_0xfacb('0x1d')];});}function getUser(_0x13d6f6,_0x5b4f5e,_0x37f3e3,_0x259c63,_0x38513f,_0xaadf25){return new Promise(function(_0x4e0b7d,_0x593eac){return getAuthToken(_0x5b4f5e,_0x259c63,_0xaadf25)['then'](function(_0x373776){var _0x5d2bf3={'method':_0xfacb('0x1e'),'uri':_0x38513f+_0xfacb('0x1f'),'headers':{'Authorization':_0xfacb('0x20')+_0x373776,'OData-Version':'4.0'},'json':!![]};return rp(_0x5d2bf3);})['then'](function(_0x237403){var _0x4ee9fa=_0x237403[_0xfacb('0x21')];var _0x24b2c8=![];var _0xf4cd11=null;if(!_[_0xfacb('0x22')](_0x37f3e3)){if(intUtil[_0xfacb('0x23')](_0x37f3e3[_0xfacb('0x24')])){_0x13d6f6[_0xfacb('0x25')]=_0x37f3e3[_0xfacb('0x24')];for(_0xf4cd11=0x0;_0xf4cd11<_0x4ee9fa[_0xfacb('0x26')];_0xf4cd11++){if(_0x4ee9fa[_0xf4cd11][_0xfacb('0x27')]===_0x37f3e3[_0xfacb('0x24')]&&!_0x4ee9fa[_0xf4cd11][_0xfacb('0x28')]){_0x24b2c8=!![];logger[_0xfacb('0x29')]('['+[_0xaadf25[_0xfacb('0x1b')]()]+_0xfacb('0x2a')+_0x4ee9fa[_0xf4cd11][_0xfacb('0x2b')]+'!');_0x13d6f6[_0xfacb('0x2c')]=_0x4ee9fa[_0xf4cd11][_0xfacb('0x2b')];}}}}if(!_0x24b2c8){logger[_0xfacb('0x29')]('['+[_0xaadf25[_0xfacb('0x1b')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x13d6f6[_0xfacb('0x25')]=_0x5b4f5e[_0xfacb('0x14')];for(_0xf4cd11=0x0;_0xf4cd11<_0x4ee9fa[_0xfacb('0x26')];_0xf4cd11++){if(_0x4ee9fa[_0xf4cd11][_0xfacb('0x27')]===_0x5b4f5e['username']){_0x13d6f6[_0xfacb('0x2c')]=_0x4ee9fa[_0xf4cd11][_0xfacb('0x2b')];}}}_0x4e0b7d(_0x13d6f6);})['catch'](function(_0x23fc66){_0x593eac(_0x23fc66['message']);});});}function createEndUser(_0x2a46fe,_0xb3be3e,_0xf1325a,_0x296dd8,_0x1ac831,_0x393be9,_0x2124e1){return new Promise(function(_0x3b54e3,_0x104906){return getAuthToken(_0xb3be3e,_0xf1325a,_0x393be9)[_0xfacb('0x17')](function(_0x3f5a29){var _0x147a2d=_0x393be9[_0xfacb('0x2d')]()===_0xfacb('0x2e')?_0x1ac831[_0xfacb('0x2f')]:_0x1ac831[_0xfacb('0x30')];var _0x5f0f1d={'method':_0xfacb('0x11'),'uri':_0x296dd8+_0xfacb('0x31'),'body':{'fullname':_0x147a2d,'firstname':_0x147a2d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfacb('0x32')+_0x2a46fe[_0xfacb('0x2c')]+')'},'headers':{'Authorization':_0xfacb('0x20')+_0x3f5a29,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x5f0f1d[_0xfacb('0x33')][_0x2124e1]=_0x147a2d;return rp(_0x5f0f1d);})[_0xfacb('0x17')](function(_0x128e91){var _0x23499b=_0x128e91[_0xfacb('0x34')][_0xfacb('0x35')];var _0x562e6c=_0x23499b['substring'](_0x23499b[_0xfacb('0x36')]('(')+0x1,_0x23499b[_0xfacb('0x36')](')'));_0x2a46fe[_0xfacb('0x37')]=_0x562e6c;_0x3b54e3(_0x2a46fe);})[_0xfacb('0x19')](function(_0x18bc15){_0x104906(_0x18bc15[_0xfacb('0x1d')]);});});}function getEndUser(_0x15bf81,_0x55e56d,_0x47dd5f,_0x54cba9,_0x279007,_0x5de365,_0x2fd5c9,_0x45bd4d){var _0x56e196=_0x5de365['toLowerCase']()===_0xfacb('0x2e')?_0x279007[_0xfacb('0x2f')]:_0x279007['calleridnum'];return getAuthToken(_0x55e56d,_0x47dd5f,_0x5de365)[_0xfacb('0x17')](function(_0x36f9a2){_0x45bd4d=_0x45bd4d?_0x45bd4d:'telephone1';var _0x2bfd8f={'method':_0xfacb('0x1e'),'uri':_0x54cba9+_0xfacb('0x38')+_0x45bd4d+'&$filter='+_0x45bd4d+_0xfacb('0x39')+_0x56e196[_0xfacb('0x3a')]('+',_0xfacb('0x3b'))+'\x27','headers':{'Authorization':_0xfacb('0x20')+_0x36f9a2,'If-None-Match':null,'OData-Version':_0xfacb('0x3c')},'json':!![]};return rp(_0x2bfd8f);})[_0xfacb('0x17')](function(_0x18edf1){var _0x578453=![];if(!_0x18edf1)return _0x578453;var _0x3df6b2=_0x18edf1[_0xfacb('0x21')];for(var _0x2862f2=0x0;_0x2862f2<_0x3df6b2[_0xfacb('0x26')];_0x2862f2++){if(_0x3df6b2[_0x2862f2][_0x45bd4d]===_0x56e196){_0x578453=!![];_0x15bf81[_0xfacb('0x37')]=_0x3df6b2[_0x2862f2][_0xfacb('0x3d')];}}return _0x578453;})[_0xfacb('0x17')](function(_0x1aa124){if(_0x1aa124)return _0x15bf81;if(_0x2fd5c9===_0xfacb('0x3e')){logger[_0xfacb('0x29')]('['+[_0x5de365[_0xfacb('0x1b')]()]+_0xfacb('0x3f'));return _0x15bf81;}return createEndUser(_0x15bf81,_0x55e56d,_0x47dd5f,_0x54cba9,_0x279007,_0x5de365,_0x45bd4d)[_0xfacb('0x17')](function(_0x2b410f){logger[_0xfacb('0x29')]('['+[_0x5de365[_0xfacb('0x1b')]()]+_0xfacb('0x40'),_0x2b410f[_0xfacb('0x37')]);return _0x2b410f;});});}function getCustomFields(_0x32c0a1,_0x1dcc19,_0x1769e0){var _0x9baa44={};if(_0x32c0a1[_0xfacb('0x26')]>0x0){_[_0xfacb('0x41')](_0x32c0a1,function(_0x3d1464){if(_[_0xfacb('0x42')]([_0xfacb('0x43'),'picklist'],_0x3d1464[_0xfacb('0x44')])&&_0x3d1464['nameField']&&!_0x3d1464[_0xfacb('0x45')]){var _0x1d9a05=_0x3d1464[_0xfacb('0x46')][_0xfacb('0x2d')]();var _0x1157b8=_0x1d9a05[_0xfacb('0x47')](0x0,_0x1d9a05[_0xfacb('0x48')]('_'));var _0x45ad73=_0x1d9a05[_0xfacb('0x47')](_0x1d9a05['indexOf']('_')+0x1);if(_0x1157b8===_0x1769e0){_0x9baa44[_0x45ad73]=_0x3d1464[_0xfacb('0x49')];}}});}return _0x9baa44;}function getTicket(_0x4945d6,_0x1a0587,_0x36da4e,_0x461225,_0x175153,_0xb43d4f,_0x3e1605){return new Promise(function(_0x29b070,_0x423c9a){var _0x4cd405;return getAuthToken(_0x1a0587,_0x36da4e,_0x3e1605)[_0xfacb('0x17')](function(_0x49e55d){if(_0xb43d4f['ticketType']===_0xfacb('0x4a')){_0x4cd405={'method':_0xfacb('0x11'),'uri':_0x461225+_0xfacb('0x4b'),'body':Object[_0xfacb('0x4c')]({},{'title':intUtil['getString'](_0xb43d4f[_0xfacb('0x4d')],_0x175153,'\x20'),'description':intUtil[_0xfacb('0x4e')](_0xb43d4f[_0xfacb('0x4f')],_0x175153,'\x0a'),'customerid_contact@odata.bind':_0x4945d6['enduserId']?'/contacts('+_0x4945d6[_0xfacb('0x37')]+')':undefined,'ownerid@odata.bind':_0xfacb('0x32')+_0x4945d6[_0xfacb('0x2c')]+')','caseorigincode':'1'},getCustomFields(_0xb43d4f['Fields'],_0x175153,_0xb43d4f[_0xfacb('0x50')])),'headers':{'Authorization':_0xfacb('0x20')+_0x49e55d,'OData-Version':_0xfacb('0x3c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xb43d4f[_0xfacb('0x50')]===_0xfacb('0x51')){var _0x1488a5=_0x4945d6[_0xfacb('0x37')]?[{'partyid_systemuser@odata.bind':_0xfacb('0x32')+_0x4945d6[_0xfacb('0x2c')]+')','participationtypemask':_0x4945d6[_0xfacb('0x52')]===_0xfacb('0x53')?0x2:0x1},{'partyid_contact@odata.bind':_0xfacb('0x54')+_0x4945d6[_0xfacb('0x37')]+')','participationtypemask':_0x4945d6[_0xfacb('0x52')]===_0xfacb('0x53')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfacb('0x32')+_0x4945d6[_0xfacb('0x2c')]+')','participationtypemask':_0x4945d6[_0xfacb('0x52')]===_0xfacb('0x53')?0x2:0x1}];_0x4cd405={'method':_0xfacb('0x11'),'uri':_0x461225+_0xfacb('0x55'),'body':Object[_0xfacb('0x4c')]({},{'subject':intUtil[_0xfacb('0x4e')](_0xb43d4f[_0xfacb('0x4d')],_0x175153,'\x20'),'phonenumber':String(_0x175153[_0xfacb('0x30')]),'description':intUtil[_0xfacb('0x4e')](_0xb43d4f[_0xfacb('0x4f')],_0x175153,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4945d6[_0xfacb('0x37')]?'/contacts('+_0x4945d6['enduserId']+')':undefined,'ownerid@odata.bind':_0xfacb('0x32')+_0x4945d6['userId']+')','directioncode':_0x4945d6[_0xfacb('0x52')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1488a5},getCustomFields(_0xb43d4f[_0xfacb('0x56')],_0x175153,_0xb43d4f[_0xfacb('0x50')])),'headers':{'Authorization':_0xfacb('0x20')+_0x49e55d,'OData-Version':_0xfacb('0x3c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4cd405);})[_0xfacb('0x17')](function(_0xa54ed0){var _0x47ba54=_0xa54ed0['headers'][_0xfacb('0x35')];var _0x5b3bdf=_0x47ba54[_0xfacb('0x47')](_0x47ba54['lastIndexOf']('(')+0x1,_0x47ba54[_0xfacb('0x36')](')'));_0x4945d6[_0xfacb('0x57')]=_0x5b3bdf;_0x29b070(_0x4945d6);})[_0xfacb('0x19')](function(_0x4801a1){_0x423c9a(_0x4801a1[_0xfacb('0x1d')]);});});}function emit(_0x5f5adf,_0x530099,_0x218ef8,_0x48aba8){var _0x4b2ea6={'uri':util[_0xfacb('0x58')](_0xfacb('0x59'),_0x5f5adf,_0x218ef8,_0x48aba8)};io['to'](util[_0xfacb('0x58')]('user:%s',_0x530099))[_0xfacb('0x5a')](_0xfacb('0x5b'),_0x4b2ea6);}exports['cs']=function(_0x51644d,_0x4736bf,_0x4447d9,_0x25cd69,_0x39d512,_0x417031,_0x599568,_0xb47544){var _0x46f8bb={};_0x417031[_0xfacb('0x13')]=_0x417031[_0xfacb('0xc')]?intUtil[_0xfacb('0x5c')](_0x417031[_0xfacb('0xd')][_0xfacb('0x5d')]):intUtil[_0xfacb('0x5c')](_0x417031[_0xfacb('0x13')]);_0x417031['serverUrl']=intUtil[_0xfacb('0x5c')](_0x417031[_0xfacb('0x5e')]);_0x46f8bb['callDirection']=_0xb47544==='queue'||_0xb47544===_0xfacb('0x5f')?_0xfacb('0x53'):_0xfacb('0x2e');var _0xee5112=_0x417031['modernAuthentication']?util['format'](_0xfacb('0x60'),_0x417031['CloudProvider'][_0xfacb('0x5d')]):util[_0xfacb('0x58')]('%s/api/data/v9.0/',_0x417031[_0xfacb('0x13')]);var _0x14befc=util[_0xfacb('0x58')]('https://login.microsoftonline.com/%s/oauth2/token',_0x417031[_0xfacb('0xe')]);var _0x461ff6=util[_0xfacb('0x58')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x417031[_0xfacb('0x5e')],_0x4736bf[_0xfacb('0x61')],md5(_0x4736bf['uniqueid']));if(_0x39d512&&_0x39d512['monitor_format']){logger['info']('[QUEUE]',_0xfacb('0x62'));_0x4736bf['recordingURL']=_0x461ff6;}else if(_0x599568&&_0x599568['recordingFormat']&&_0x599568['recordingFormat']!==_0xfacb('0x63')){logger[_0xfacb('0x29')](_0xfacb('0x64'),_0xfacb('0x62'));_0x4736bf[_0xfacb('0x65')]=_0x461ff6;}else{_0x4736bf[_0xfacb('0x65')]='';}return getUser(_0x46f8bb,_0x417031,_0x25cd69,_0x14befc,_0xee5112,_0xb47544)['then'](function(_0x2d6160){logger[_0xfacb('0x29')]('['+_0xb47544[_0xfacb('0x1b')]()+_0xfacb('0x66'),_0x2d6160[_0xfacb('0x2c')]);logger[_0xfacb('0x29')]('['+_0xb47544[_0xfacb('0x1b')]()+']\x20The\x20User\x20email\x20is:',_0x2d6160['userEmail']);return getEndUser(_0x2d6160,_0x417031,_0x14befc,_0xee5112,_0x4736bf,_0xb47544,_0x4447d9[_0xfacb('0x67')],_0x4447d9[_0xfacb('0x68')]);})[_0xfacb('0x17')](function(_0x25e942){logger['info']('['+_0xb47544[_0xfacb('0x1b')]()+_0xfacb('0x69'),_0x25e942['enduserId']);logger['info']('['+_0xb47544[_0xfacb('0x1b')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x4736bf[_0xfacb('0x30')]);return getTicket(_0x25e942,_0x417031,_0x14befc,_0xee5112,_0x4736bf,_0x4447d9,_0xb47544);})['then'](function(_0x294004){logger[_0xfacb('0x29')](util[_0xfacb('0x58')]('['+_0xb47544[_0xfacb('0x1b')]()+_0xfacb('0x6a'),_0x4447d9[_0xfacb('0x50')],_0x294004['ticketId']));logger[_0xfacb('0x29')](util['format']('['+_0xb47544['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0xb47544));if(_0xb47544!==_0xfacb('0x5f')&&_0x4447d9[_0xfacb('0x6b')]){logger[_0xfacb('0x29')]('['+_0xb47544['toUpperCase']()+']',_0xfacb('0x6c'));emit(_0x417031[_0xfacb('0x13')],_0x25cd69['name'],_0x4447d9['ticketType'],_0x294004[_0xfacb('0x57')]);}})[_0xfacb('0x19')](function(_0x52f344){logger[_0xfacb('0x1a')]('['+_0xb47544[_0xfacb('0x1b')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x52f344[_0xfacb('0x1d')]);console[_0xfacb('0x1a')]('Error\x20running\x20Dynamics365\x20integration',_0x52f344);});}; \ No newline at end of file +var _0xdc33=['/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','toLowerCase','\x20eq\x20\x27','replace','%2b','enduserId','contactid','length','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','data5','POST','username','password','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','info',']\x20Agent\x20found\x20','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','internalemailaddress','systemuserid','catch','outbound','destcalleridnum','calleridnum','contacts'];(function(_0x5b501f,_0x2be032){var _0x4c10c7=function(_0x48d091){while(--_0x48d091){_0x5b501f['push'](_0x5b501f['shift']());}};_0x4c10c7(++_0x2be032);}(_0xdc33,0x187));var _0x3dc3=function(_0x5c4679,_0x404702){_0x5c4679=_0x5c4679-0x0;var _0x2fb236=_0xdc33[_0x5c4679];return _0x2fb236;};'use strict';var _=require(_0x3dc3('0x0'));var rp=require(_0x3dc3('0x1'));var util=require('util');var intUtil=require(_0x3dc3('0x2'));var md5=require(_0x3dc3('0x3'));var Redis=require(_0x3dc3('0x4'));var logger=require('../../../../config/logger')(_0x3dc3('0x5'));var config=require(_0x3dc3('0x6'));config[_0x3dc3('0x7')]=_[_0x3dc3('0x8')](config[_0x3dc3('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3dc3('0x9'))(new Redis(config[_0x3dc3('0x7')]));function getAuthToken(_0x18b7c0,_0x153ed8,_0x19a383){if(_0x18b7c0[_0x3dc3('0xa')]){_0x18b7c0[_0x3dc3('0xb')]=_0x18b7c0[_0x3dc3('0xc')][_0x3dc3('0xd')];_0x18b7c0[_0x3dc3('0xe')]=_0x18b7c0[_0x3dc3('0xc')][_0x3dc3('0xf')];return Promise['resolve'](_0x18b7c0[_0x3dc3('0xc')][_0x3dc3('0x10')]);}var _0x1568f8={'method':_0x3dc3('0x11'),'uri':_0x153ed8,'form':{'client_id':_0x18b7c0['clientId'],'resource':_0x18b7c0[_0x3dc3('0xb')],'username':_0x18b7c0[_0x3dc3('0x12')],'password':_0x18b7c0[_0x3dc3('0x13')],'grant_type':_0x3dc3('0x13'),'client_secret':_0x18b7c0['clientSecret']},'json':!![]};return rp(_0x1568f8)[_0x3dc3('0x14')](function(_0x3f3d41){return _0x3f3d41[_0x3dc3('0x15')];})['catch'](function(_0x20b8cf){logger[_0x3dc3('0x16')]('['+[_0x19a383[_0x3dc3('0x17')]()]+_0x3dc3('0x18'));return _0x20b8cf[_0x3dc3('0x19')];});}function getUser(_0x1c9263,_0x364b61,_0x335e4e,_0x3e77e6,_0x26fc84,_0x38eabf){return new Promise(function(_0x419e19,_0x3e5287){return getAuthToken(_0x364b61,_0x3e77e6,_0x38eabf)[_0x3dc3('0x14')](function(_0x323db3){var _0x45eed7={'method':_0x3dc3('0x1a'),'uri':_0x26fc84+_0x3dc3('0x1b'),'headers':{'Authorization':_0x3dc3('0x1c')+_0x323db3,'OData-Version':_0x3dc3('0x1d')},'json':!![]};return rp(_0x45eed7);})[_0x3dc3('0x14')](function(_0x4d10a6){var _0x5c48a9=_0x4d10a6[_0x3dc3('0x1e')];var _0x2341dc=![];var _0x4175d3=null;if(!_[_0x3dc3('0x1f')](_0x335e4e)){if(intUtil['validateEmail'](_0x335e4e[_0x3dc3('0x20')])){_0x1c9263['userEmail']=_0x335e4e[_0x3dc3('0x20')];for(_0x4175d3=0x0;_0x4175d3<_0x5c48a9['length'];_0x4175d3++){if(_0x5c48a9[_0x4175d3]['internalemailaddress']===_0x335e4e[_0x3dc3('0x20')]&&!_0x5c48a9[_0x4175d3]['isdisabled']){_0x2341dc=!![];logger[_0x3dc3('0x21')]('['+[_0x38eabf[_0x3dc3('0x17')]()]+_0x3dc3('0x22')+_0x5c48a9[_0x4175d3]['systemuserid']+'!');_0x1c9263[_0x3dc3('0x23')]=_0x5c48a9[_0x4175d3]['systemuserid'];}}}}if(!_0x2341dc){logger['info']('['+[_0x38eabf[_0x3dc3('0x17')]()]+_0x3dc3('0x24'));_0x1c9263[_0x3dc3('0x25')]=_0x364b61[_0x3dc3('0x12')];for(_0x4175d3=0x0;_0x4175d3<_0x5c48a9['length'];_0x4175d3++){if(_0x5c48a9[_0x4175d3][_0x3dc3('0x26')]===_0x364b61[_0x3dc3('0x12')]){_0x1c9263[_0x3dc3('0x23')]=_0x5c48a9[_0x4175d3][_0x3dc3('0x27')];}}}_0x419e19(_0x1c9263);})[_0x3dc3('0x28')](function(_0x48e912){_0x3e5287(_0x48e912[_0x3dc3('0x19')]);});});}function createEndUser(_0x486502,_0x492e3,_0x1fa668,_0xf774ab,_0x2a56ea,_0x517be2,_0x15e925){return new Promise(function(_0x1e9ba3,_0x1ae8b0){return getAuthToken(_0x492e3,_0x1fa668,_0x517be2)[_0x3dc3('0x14')](function(_0x4de76f){var _0x326299=_0x517be2['toLowerCase']()===_0x3dc3('0x29')?_0x2a56ea[_0x3dc3('0x2a')]:_0x2a56ea[_0x3dc3('0x2b')];var _0x304f56={'method':_0x3dc3('0x11'),'uri':_0xf774ab+_0x3dc3('0x2c'),'body':{'fullname':_0x326299,'firstname':_0x326299,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3dc3('0x2d')+_0x486502[_0x3dc3('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4de76f,'OData-Version':_0x3dc3('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x304f56[_0x3dc3('0x2e')][_0x15e925]=_0x326299;return rp(_0x304f56);})[_0x3dc3('0x14')](function(_0xdd42c){var _0x30693d=_0xdd42c[_0x3dc3('0x2f')][_0x3dc3('0x30')];var _0x9fdd91=_0x30693d[_0x3dc3('0x31')](_0x30693d[_0x3dc3('0x32')]('(')+0x1,_0x30693d[_0x3dc3('0x32')](')'));_0x486502['enduserId']=_0x9fdd91;_0x1e9ba3(_0x486502);})[_0x3dc3('0x28')](function(_0x86785d){_0x1ae8b0(_0x86785d[_0x3dc3('0x19')]);});});}function getEndUser(_0x5f2b6c,_0x3a7b1b,_0xf4b1bf,_0x3c8db,_0x4414f0,_0x1ab521,_0x5c6c43,_0x4b0054){var _0x15ad2f=_0x1ab521[_0x3dc3('0x33')]()==='outbound'?_0x4414f0['destcalleridnum']:_0x4414f0[_0x3dc3('0x2b')];return getAuthToken(_0x3a7b1b,_0xf4b1bf,_0x1ab521)['then'](function(_0x105229){_0x4b0054=_0x4b0054?_0x4b0054:'telephone1';var _0x21c9ff={'method':_0x3dc3('0x1a'),'uri':_0x3c8db+'contacts?$select='+_0x4b0054+'&$filter='+_0x4b0054+_0x3dc3('0x34')+_0x15ad2f[_0x3dc3('0x35')]('+',_0x3dc3('0x36'))+'\x27','headers':{'Authorization':_0x3dc3('0x1c')+_0x105229,'If-None-Match':null,'OData-Version':_0x3dc3('0x1d')},'json':!![]};return rp(_0x21c9ff);})['then'](function(_0x577403){var _0xa367c3=![];if(!_0x577403)return _0xa367c3;var _0xd364=_0x577403['value'];for(var _0x41b832=0x0;_0x41b832<_0xd364['length'];_0x41b832++){if(_0xd364[_0x41b832][_0x4b0054]===_0x15ad2f){_0xa367c3=!![];_0x5f2b6c[_0x3dc3('0x37')]=_0xd364[_0x41b832][_0x3dc3('0x38')];}}return _0xa367c3;})[_0x3dc3('0x14')](function(_0x491291){if(_0x491291)return _0x5f2b6c;if(_0x5c6c43==='nothing'){logger[_0x3dc3('0x21')]('['+[_0x1ab521[_0x3dc3('0x17')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5f2b6c;}return createEndUser(_0x5f2b6c,_0x3a7b1b,_0xf4b1bf,_0x3c8db,_0x4414f0,_0x1ab521,_0x4b0054)[_0x3dc3('0x14')](function(_0x173fbc){logger['info']('['+[_0x1ab521[_0x3dc3('0x17')]()]+']\x20Enduser\x20created!',_0x173fbc[_0x3dc3('0x37')]);return _0x173fbc;});});}function getCustomFields(_0x3485c7,_0x605ae3,_0x565845){var _0x580aec={};if(_0x3485c7[_0x3dc3('0x39')]>0x0){_[_0x3dc3('0x3a')](_0x3485c7,function(_0x3b59c2){if(_[_0x3dc3('0x3b')](['string',_0x3dc3('0x3c')],_0x3b59c2[_0x3dc3('0x3d')])&&_0x3b59c2[_0x3dc3('0x3e')]&&!_0x3b59c2[_0x3dc3('0x3f')]){var _0x5e2ad0=_0x3b59c2[_0x3dc3('0x40')][_0x3dc3('0x33')]();var _0x276bc9=_0x5e2ad0[_0x3dc3('0x31')](0x0,_0x5e2ad0[_0x3dc3('0x41')]('_'));var _0xed7740=_0x5e2ad0['substring'](_0x5e2ad0[_0x3dc3('0x41')]('_')+0x1);if(_0x276bc9===_0x565845){_0x580aec[_0xed7740]=_0x3b59c2[_0x3dc3('0x42')];}}});}return _0x580aec;}function getTicket(_0x43b495,_0x4501bb,_0x5a4fdf,_0x34fca3,_0x50d06e,_0xd56a46,_0x1be8fc){return new Promise(function(_0x28ccd0,_0x110fa3){var _0x2ae713;return getAuthToken(_0x4501bb,_0x5a4fdf,_0x1be8fc)['then'](function(_0x340a18){if(_0xd56a46[_0x3dc3('0x43')]===_0x3dc3('0x44')){_0x2ae713={'method':_0x3dc3('0x11'),'uri':_0x34fca3+'incidents','body':Object[_0x3dc3('0x45')]({},{'title':intUtil[_0x3dc3('0x46')](_0xd56a46[_0x3dc3('0x47')],_0x50d06e,'\x20'),'description':intUtil['getString'](_0xd56a46[_0x3dc3('0x48')],_0x50d06e,'\x0a'),'customerid_contact@odata.bind':_0x43b495[_0x3dc3('0x37')]?_0x3dc3('0x49')+_0x43b495[_0x3dc3('0x37')]+')':undefined,'ownerid@odata.bind':_0x3dc3('0x2d')+_0x43b495['userId']+')','caseorigincode':'1'},getCustomFields(_0xd56a46[_0x3dc3('0x4a')],_0x50d06e,_0xd56a46['ticketType'])),'headers':{'Authorization':_0x3dc3('0x1c')+_0x340a18,'OData-Version':_0x3dc3('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xd56a46[_0x3dc3('0x43')]===_0x3dc3('0x4b')){var _0x413031=_0x43b495[_0x3dc3('0x37')]?[{'partyid_systemuser@odata.bind':_0x3dc3('0x2d')+_0x43b495[_0x3dc3('0x23')]+')','participationtypemask':_0x43b495[_0x3dc3('0x4c')]===_0x3dc3('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x3dc3('0x49')+_0x43b495['enduserId']+')','participationtypemask':_0x43b495[_0x3dc3('0x4c')]===_0x3dc3('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x43b495['userId']+')','participationtypemask':_0x43b495[_0x3dc3('0x4c')]==='queue'?0x2:0x1}];_0x2ae713={'method':_0x3dc3('0x11'),'uri':_0x34fca3+_0x3dc3('0x4e'),'body':Object[_0x3dc3('0x45')]({},{'subject':intUtil[_0x3dc3('0x46')](_0xd56a46[_0x3dc3('0x47')],_0x50d06e,'\x20'),'phonenumber':String(_0x50d06e[_0x3dc3('0x2b')]),'description':intUtil[_0x3dc3('0x46')](_0xd56a46[_0x3dc3('0x48')],_0x50d06e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x43b495['enduserId']?'/contacts('+_0x43b495['enduserId']+')':undefined,'ownerid@odata.bind':_0x3dc3('0x2d')+_0x43b495['userId']+')','directioncode':_0x43b495[_0x3dc3('0x4c')]===_0x3dc3('0x4d')?![]:!![],'phonecall_activity_parties':_0x413031},getCustomFields(_0xd56a46[_0x3dc3('0x4a')],_0x50d06e,_0xd56a46[_0x3dc3('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x340a18,'OData-Version':_0x3dc3('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2ae713);})[_0x3dc3('0x14')](function(_0x294be6){var _0x2bdb08=_0x294be6['headers']['odata-entityid'];var _0x16e582=_0x2bdb08[_0x3dc3('0x31')](_0x2bdb08[_0x3dc3('0x32')]('(')+0x1,_0x2bdb08[_0x3dc3('0x32')](')'));_0x43b495['ticketId']=_0x16e582;_0x28ccd0(_0x43b495);})['catch'](function(_0x21a9eb){_0x110fa3(_0x21a9eb[_0x3dc3('0x19')]);});});}function emit(_0x511bde,_0x26ca23,_0x127371,_0x16e614){var _0x3879a9={'uri':util[_0x3dc3('0x4f')](_0x3dc3('0x50'),_0x511bde,_0x127371,_0x16e614)};io['to'](util['format'](_0x3dc3('0x51'),_0x26ca23))[_0x3dc3('0x52')](_0x3dc3('0x53'),_0x3879a9);}exports['cs']=function(_0x51f950,_0x50d494,_0x1691c5,_0x4c53d9,_0x2752ff,_0x582b94,_0x21b1d9,_0x9f212a){var _0x2eb92a={};_0x582b94['remoteUri']=_0x582b94[_0x3dc3('0xa')]?intUtil[_0x3dc3('0x54')](_0x582b94[_0x3dc3('0xc')][_0x3dc3('0xd')]):intUtil[_0x3dc3('0x54')](_0x582b94['remoteUri']);_0x582b94['serverUrl']=intUtil[_0x3dc3('0x54')](_0x582b94[_0x3dc3('0x55')]);_0x2eb92a['callDirection']=_0x9f212a===_0x3dc3('0x4d')||_0x9f212a===_0x3dc3('0x56')?'queue':_0x3dc3('0x29');var _0x350e12=_0x582b94[_0x3dc3('0xa')]?util['format'](_0x3dc3('0x57'),_0x582b94['CloudProvider']['data7']):util['format']('%s/api/data/v9.0/',_0x582b94[_0x3dc3('0xb')]);var _0x4b4a5f=util[_0x3dc3('0x4f')](_0x3dc3('0x58'),_0x582b94['tenantId']);var _0x42e0b7=util[_0x3dc3('0x4f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x582b94[_0x3dc3('0x55')],_0x50d494[_0x3dc3('0x59')],md5(_0x50d494[_0x3dc3('0x59')]));if(_0x2752ff&&_0x2752ff[_0x3dc3('0x5a')]){logger[_0x3dc3('0x21')]('[QUEUE]',_0x3dc3('0x5b'));_0x50d494[_0x3dc3('0x5c')]=_0x42e0b7;}else if(_0x21b1d9&&_0x21b1d9['recordingFormat']&&_0x21b1d9[_0x3dc3('0x5d')]!==_0x3dc3('0x5e')){logger[_0x3dc3('0x21')](_0x3dc3('0x5f'),_0x3dc3('0x5b'));_0x50d494[_0x3dc3('0x5c')]=_0x42e0b7;}else{_0x50d494[_0x3dc3('0x5c')]='';}return getUser(_0x2eb92a,_0x582b94,_0x4c53d9,_0x4b4a5f,_0x350e12,_0x9f212a)['then'](function(_0x4afae9){logger[_0x3dc3('0x21')]('['+_0x9f212a[_0x3dc3('0x17')]()+_0x3dc3('0x60'),_0x4afae9[_0x3dc3('0x23')]);logger[_0x3dc3('0x21')]('['+_0x9f212a[_0x3dc3('0x17')]()+_0x3dc3('0x61'),_0x4afae9[_0x3dc3('0x25')]);return getEndUser(_0x4afae9,_0x582b94,_0x4b4a5f,_0x350e12,_0x50d494,_0x9f212a,_0x1691c5[_0x3dc3('0x62')],_0x1691c5[_0x3dc3('0x63')]);})[_0x3dc3('0x14')](function(_0x5a64d8){logger[_0x3dc3('0x21')]('['+_0x9f212a[_0x3dc3('0x17')]()+_0x3dc3('0x64'),_0x5a64d8[_0x3dc3('0x37')]);logger[_0x3dc3('0x21')]('['+_0x9f212a['toUpperCase']()+_0x3dc3('0x65'),_0x50d494['calleridnum']);return getTicket(_0x5a64d8,_0x582b94,_0x4b4a5f,_0x350e12,_0x50d494,_0x1691c5,_0x9f212a);})[_0x3dc3('0x14')](function(_0x522a39){logger['info'](util['format']('['+_0x9f212a[_0x3dc3('0x17')]()+_0x3dc3('0x66'),_0x1691c5[_0x3dc3('0x43')],_0x522a39[_0x3dc3('0x67')]));logger[_0x3dc3('0x21')](util[_0x3dc3('0x4f')]('['+_0x9f212a[_0x3dc3('0x17')]()+_0x3dc3('0x68'),_0x9f212a));if(_0x9f212a!==_0x3dc3('0x56')&&_0x1691c5['openNewTab']){logger['info']('['+_0x9f212a[_0x3dc3('0x17')]()+']',_0x3dc3('0x69'));emit(_0x582b94[_0x3dc3('0xb')],_0x4c53d9[_0x3dc3('0x6a')],_0x1691c5['ticketType'],_0x522a39[_0x3dc3('0x67')]);}})[_0x3dc3('0x28')](function(_0x32113f){logger['error']('['+_0x9f212a[_0x3dc3('0x17')]()+_0x3dc3('0x6b'),_0x32113f[_0x3dc3('0x19')]);console[_0x3dc3('0x16')](_0x3dc3('0x6c'),_0x32113f);});}; \ 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 327fa90..9986970 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 _0x140b=['nameField','customField','toLowerCase','content','includes','string','type','idField','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridnum','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','length','Agent\x20found!','find','contact','email','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','picklist'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x140b,0x143));var _0xb140=function(_0x1c6bf6,_0x4fbe52){_0x1c6bf6=_0x1c6bf6-0x0;var _0xcde1b5=_0x140b[_0x1c6bf6];return _0xcde1b5;};'use strict';var _=require(_0xb140('0x0'));var rp=require(_0xb140('0x1'));var md5=require(_0xb140('0x2'));var util=require(_0xb140('0x3'));var Redis=require(_0xb140('0x4'));var intUtil=require(_0xb140('0x5'));var config=require(_0xb140('0x6'));var logger=require('../../../../config/logger')(_0xb140('0x7'));config[_0xb140('0x8')]=_[_0xb140('0x9')](config[_0xb140('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb140('0xa'))(new Redis(config[_0xb140('0x8')]));var headers={'Content-Type':_0xb140('0xb'),'Accept':_0xb140('0xb')};function emit(_0x13e021,_0x491296,_0x1fb08c){io['to'](_0x13e021)['emit'](_0x491296,_0x1fb08c);}function getTicket(_0x38c51d,_0xd9b41c,_0x2b5000,_0x533b35,_0x21dc2b){logger['info'](_0xb140('0xc'));var _0x27b2ae=_[_0xb140('0xd')]({'responder_id':_0xd9b41c['id'],'requester_id':_0x2b5000['id'],'name':util[_0xb140('0xe')](_0xb140('0xf'),_0x21dc2b[_0xb140('0x10')]),'phone':_0x21dc2b[_0xb140('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x533b35[_0xb140('0x12')],_0x21dc2b,'\x20'),'description':intUtil[_0xb140('0x13')](_0x533b35[_0xb140('0x14')],_0x21dc2b,_0xb140('0x15')),'tags':getTags(_0x533b35[_0xb140('0x16')],_0xb140('0x17'))},getCustomFields(_0x533b35[_0xb140('0x18')],_0x21dc2b));_0x27b2ae[_0xb140('0x19')]=_[_0xb140('0x1a')](_[_0xb140('0x1b')](_0x27b2ae[_0xb140('0x19')],'id'),_0xb140('0x1c'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x1d'),_0x38c51d[_0xb140('0x1e')]),'method':'POST','body':_0x27b2ae})[_0xb140('0x1f')](function(_0xc897d7){logger['info'](_0xb140('0x20'));return _0xc897d7;});}function getUser(_0x2e69b3,_0x3cc06a){if(intUtil['validateEmail'](_0x3cc06a)){return request({'uri':util[_0xb140('0xe')]('%s/api/v2/agents',_0x2e69b3[_0xb140('0x1e')]),'qs':{'email':_0x3cc06a}})[_0xb140('0x1f')](function(_0x899ca0){if(_0x899ca0[_0xb140('0x21')]){logger['info'](_0xb140('0x22'));return _[_0xb140('0x23')](_0x899ca0,function(_0x3d3325){return _0x3d3325[_0xb140('0x24')][_0xb140('0x25')]===_0x3cc06a;});}else{logger[_0xb140('0x26')](_0xb140('0x27'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x28'),_0x2e69b3[_0xb140('0x1e')])})['then'](function(_0x358d9d){logger['info'](_0xb140('0x29'));return _0x358d9d;});}});}else{logger[_0xb140('0x26')](_0xb140('0x2a'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x28'),_0x2e69b3[_0xb140('0x1e')])})[_0xb140('0x1f')](function(_0x51128a){logger['info'](_0xb140('0x29'));return _0x51128a;});}}function getEndUser(_0x345d9b,_0x94b3ef,_0x442ea3){logger[_0xb140('0x26')]('Searching\x20enduser\x20with\x20phone',_0x442ea3);return request({'uri':util['format'](_0xb140('0x2b'),_0x345d9b[_0xb140('0x1e')]),'qs':{'phone':_0x442ea3}})[_0xb140('0x1f')](function(_0x26a774){if(_0x26a774[_0xb140('0x21')]){logger[_0xb140('0x26')](_0xb140('0x2c'));return _[_0xb140('0x23')](_0x26a774,{'phone':_0x442ea3});}else{logger['info'](_0xb140('0x2d'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x2b'),_0x345d9b['remoteUri']),'method':_0xb140('0x2e'),'body':{'name':_0x94b3ef,'phone':_0x442ea3}})['then'](function(_0x2d1f04){logger[_0xb140('0x26')]('Enduser\x20created.');return _0x2d1f04;});}});}function getAuth(_0x289a15){return util[_0xb140('0xe')](_0xb140('0x2f'),new Buffer(_0x289a15[_0xb140('0x30')]+':X')[_0xb140('0x31')]('base64'));}function request(_0x142233){logger[_0xb140('0x32')](_0xb140('0x33'),JSON[_0xb140('0x34')](_0x142233));return rp(_[_0xb140('0x9')](_0x142233,{'method':_0xb140('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x33d53d,_0x3d4fb3){var _0x226b33=[];if(_0x33d53d&&_0x33d53d['length']>0x0){_0x226b33=_[_0xb140('0x36')](_0x33d53d,_0x3d4fb3);}return _0x226b33;}function getCustomFields(_0x785d6a,_0x22fd3e){var _0x1dc95c=[];var _0xa8d5b3={'custom_fields':[]};if(_0x785d6a[_0xb140('0x21')]>0x0){_[_0xb140('0x37')](_0x785d6a,function(_0x1ceb2b){if(_['includes'](['string',_0xb140('0x38')],_0x1ceb2b['type'])&&_0x1ceb2b[_0xb140('0x39')]&&!_0x1ceb2b[_0xb140('0x3a')]){_0xa8d5b3[_0x1ceb2b[_0xb140('0x39')][_0xb140('0x3b')]()]=_0x1ceb2b[_0xb140('0x3c')][_0xb140('0x31')]();}else if(_[_0xb140('0x3d')]([_0xb140('0x3e'),_0xb140('0x38')],_0x1ceb2b[_0xb140('0x3f')])&&_0x1ceb2b[_0xb140('0x40')]&&_0x1ceb2b['customField']){_0xa8d5b3['custom_fields']['push']({'id':_0x1ceb2b['idField'],'value':_0x1ceb2b[_0xb140('0x3c')][_0xb140('0x31')]()});}else if(_0x1ceb2b[_0xb140('0x3f')]==='variable'&&_0x1ceb2b[_0xb140('0x41')]&&_0x1ceb2b[_0xb140('0x40')]&&_0x1ceb2b[_0xb140('0x3a')]){_0x22fd3e[_0x1ceb2b[_0xb140('0x41')]]&&_0xa8d5b3['custom_fields'][_0xb140('0x42')]({'id':_0x1ceb2b['idField'],'value':_0x22fd3e[_0x1ceb2b['variableName']][_0xb140('0x31')]()});}else if(_0x1ceb2b[_0xb140('0x3f')]==='customVariable'&&_0x1ceb2b['Variable']&&_0x1ceb2b['Variable'][_0xb140('0x17')]&&_0x1ceb2b['idField']&&_0x1ceb2b['customField']){_0x22fd3e[_0x1ceb2b[_0xb140('0x43')][_0xb140('0x17')][_0xb140('0x3b')]()]&&_0xa8d5b3[_0xb140('0x19')]['push']({'id':_0x1ceb2b[_0xb140('0x40')],'value':_0x22fd3e[_0x1ceb2b[_0xb140('0x43')][_0xb140('0x17')]['toLowerCase']()][_0xb140('0x31')]()});}});}return _0xa8d5b3;}exports[_0xb140('0x44')]=function(_0x54b431,_0x48f74e,_0x28385c,_0x2bec06,_0x59dea5,_0x269df4){var _0x56d58d,_0x1c6a50;_0x269df4[_0xb140('0x1e')]=intUtil[_0xb140('0x45')](_0x269df4[_0xb140('0x1e')]);_0x269df4['serverUrl']=intUtil['stripTrailingSlash'](_0x269df4[_0xb140('0x46')]);if(_0x59dea5&&_0x59dea5[_0xb140('0x47')]){logger[_0xb140('0x26')](_0xb140('0x48'),_0xb140('0x49'));_0x48f74e[_0xb140('0x4a')]=util['format'](_0xb140('0x4b'),_0x269df4[_0xb140('0x46')],_0x48f74e['uniqueid'],md5(_0x48f74e['uniqueid']));}else{_0x48f74e[_0xb140('0x4a')]='';}headers[_0xb140('0x4c')]=getAuth(_0x269df4);return getUser(_0x269df4,_0x2bec06[_0xb140('0x25')])[_0xb140('0x1f')](function(_0x5c5fd6){_0x56d58d=_0x5c5fd6;logger[_0xb140('0x26')](_0xb140('0x4d'),_0x56d58d['id']);return getEndUser(_0x269df4,_0x48f74e[_0xb140('0x10')],_0x48f74e['calleridnum']);})[_0xb140('0x1f')](function(_0x2dad08){_0x1c6a50=_0x2dad08;logger[_0xb140('0x26')](_0xb140('0x4e'),_0x1c6a50['id']);return getTicket(_0x269df4,_0x56d58d,_0x1c6a50,_0x28385c,_0x48f74e);})[_0xb140('0x1f')](function(_0x1aeb19){if(_0x1aeb19&&_0x1aeb19['id']){logger[_0xb140('0x26')](_0xb140('0x20'));logger['info'](_0xb140('0x4f'),_0x1aeb19['id']);logger['info'](_0xb140('0x48'),_0xb140('0x50'));emit(util[_0xb140('0xe')](_0xb140('0x51'),_0x2bec06[_0xb140('0x17')]),_0xb140('0x52'),{'uri':util[_0xb140('0xe')](_0xb140('0x53'),_0x269df4['remoteUri'],_0x1aeb19['id'])});}})[_0xb140('0x54')](function(_0x132c5e){logger[_0xb140('0x55')](_0xb140('0x48'),JSON[_0xb140('0x34')](_0x132c5e));});};exports[_0xb140('0x56')]=function(_0x1f9656,_0x2133d6,_0x1ec04b,_0x310f8c,_0x228118,_0x21e9c4,_0x220ee5){var _0x45c383,_0x6e97eb;_0x21e9c4[_0xb140('0x1e')]=intUtil[_0xb140('0x45')](_0x21e9c4[_0xb140('0x1e')]);_0x21e9c4['serverUrl']=intUtil['stripTrailingSlash'](_0x21e9c4[_0xb140('0x46')]);if(_0x220ee5&&_0x220ee5[_0xb140('0x57')]&&_0x220ee5[_0xb140('0x57')]!==_0xb140('0x58')){logger[_0xb140('0x26')](_0xb140('0x59'),_0xb140('0x49'));_0x2133d6[_0xb140('0x4a')]=util[_0xb140('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21e9c4[_0xb140('0x46')],_0x2133d6['uniqueid'],md5(_0x2133d6[_0xb140('0x5a')]));}headers[_0xb140('0x4c')]=getAuth(_0x21e9c4);return getUser(_0x21e9c4,_0x310f8c[_0xb140('0x25')])['then'](function(_0x280414){_0x45c383=_0x280414;logger['info'](_0xb140('0x4d'),_0x45c383['id']);return getEndUser(_0x21e9c4,_0x2133d6['destcalleridname'],_0x2133d6[_0xb140('0x5b')]);})['then'](function(_0x25b69a){_0x6e97eb=_0x25b69a;logger[_0xb140('0x26')](_0xb140('0x4e'),_0x6e97eb['id']);return getTicket(_0x21e9c4,_0x45c383,_0x6e97eb,_0x1ec04b,_0x2133d6);})[_0xb140('0x1f')](function(_0x1d9e29){if(_0x1d9e29&&_0x1d9e29['id']){logger['info'](_0xb140('0x20'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1d9e29['id']);logger[_0xb140('0x26')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb140('0xe')](_0xb140('0x51'),_0x310f8c[_0xb140('0x17')]),_0xb140('0x52'),{'uri':util[_0xb140('0xe')]('%s/helpdesk/tickets/%d',_0x21e9c4[_0xb140('0x1e')],_0x1d9e29['id'])});}})['catch'](function(_0x1e4d33){logger['error']('[OUTBOUND]',JSON[_0xb140('0x34')](_0x1e4d33));});};exports[_0xb140('0x5c')]=function(_0x4cefc5,_0xcf562e,_0x5e5998,_0x3029b0,_0x5e3156,_0x447c1f){var _0xc137f3,_0x513cde;_0x447c1f['remoteUri']=intUtil['stripTrailingSlash'](_0x447c1f['remoteUri']);_0x447c1f['serverUrl']=intUtil[_0xb140('0x45')](_0x447c1f[_0xb140('0x46')]);if(_0x5e3156&&_0x5e3156[_0xb140('0x47')]){logger[_0xb140('0x26')]('['+_0xcf562e['lastevent'][_0xb140('0x5d')]()+']',_0xb140('0x49'));_0xcf562e[_0xb140('0x4a')]=util['format'](_0xb140('0x4b'),_0x447c1f['serverUrl'],_0xcf562e[_0xb140('0x5a')],md5(_0xcf562e[_0xb140('0x5a')]));}else{_0xcf562e[_0xb140('0x4a')]='';}headers[_0xb140('0x4c')]=getAuth(_0x447c1f);return getUser(_0x447c1f,'')[_0xb140('0x1f')](function(_0x17b163){_0xc137f3=_0x17b163;logger[_0xb140('0x26')]('The\x20User\x20ID\x20is:',_0xc137f3['id']);return getEndUser(_0x447c1f,_0xcf562e['calleridname'],_0xcf562e[_0xb140('0x11')]);})['then'](function(_0xe8528c){_0x513cde=_0xe8528c;logger['info'](_0xb140('0x4e'),_0x513cde['id']);return getTicket(_0x447c1f,_0xc137f3,_0x513cde,_0x5e5998,_0xcf562e);})[_0xb140('0x1f')](function(_0x9f1fc){if(_0x9f1fc){logger[_0xb140('0x26')]('Ticket\x20created!');logger[_0xb140('0x26')]('The\x20Ticket\x20ID\x20is:',_0x9f1fc['id']);}})[_0xb140('0x54')](function(_0x45e04b){logger['error']('['+_0xcf562e[_0xb140('0x5e')][_0xb140('0x5d')]()+']',JSON[_0xb140('0x34')](_0x45e04b));});}; \ No newline at end of file +var _0x48eb=['variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','monitor_format','toUpperCase','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','apiKey','toString','base64','stringify','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','push'];(function(_0x32715c,_0x317ddb){var _0x101baf=function(_0x20db55){while(--_0x20db55){_0x32715c['push'](_0x32715c['shift']());}};_0x101baf(++_0x317ddb);}(_0x48eb,0x1df));var _0xb48e=function(_0x349a2c,_0x4655dc){_0x349a2c=_0x349a2c-0x0;var _0x93d984=_0x48eb[_0x349a2c];return _0x93d984;};'use strict';var _=require('lodash');var rp=require(_0xb48e('0x0'));var md5=require(_0xb48e('0x1'));var util=require('util');var Redis=require(_0xb48e('0x2'));var intUtil=require(_0xb48e('0x3'));var config=require(_0xb48e('0x4'));var logger=require(_0xb48e('0x5'))(_0xb48e('0x6'));config['redis']=_['defaults'](config[_0xb48e('0x7')],{'host':_0xb48e('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xb48e('0x9'),'Accept':'application/json'};function emit(_0x35c6ec,_0x1e569b,_0x53b6ba){io['to'](_0x35c6ec)[_0xb48e('0xa')](_0x1e569b,_0x53b6ba);}function getTicket(_0x42e414,_0x3ab270,_0x35a4bd,_0x4d109b,_0x1e2d4b){logger[_0xb48e('0xb')]('Creating\x20new\x20ticket...');var _0x4e9105=_[_0xb48e('0xc')]({'responder_id':_0x3ab270['id'],'requester_id':_0x35a4bd['id'],'name':util[_0xb48e('0xd')](_0xb48e('0xe'),_0x1e2d4b['calleridname']),'phone':_0x1e2d4b[_0xb48e('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb48e('0x10')](_0x4d109b[_0xb48e('0x11')],_0x1e2d4b,'\x20'),'description':intUtil['getString'](_0x4d109b['Descriptions'],_0x1e2d4b,_0xb48e('0x12')),'tags':getTags(_0x4d109b[_0xb48e('0x13')],_0xb48e('0x14'))},getCustomFields(_0x4d109b[_0xb48e('0x15')],_0x1e2d4b));_0x4e9105[_0xb48e('0x16')]=_[_0xb48e('0x17')](_[_0xb48e('0x18')](_0x4e9105['custom_fields'],'id'),'value');return request({'uri':util[_0xb48e('0xd')](_0xb48e('0x19'),_0x42e414[_0xb48e('0x1a')]),'method':_0xb48e('0x1b'),'body':_0x4e9105})[_0xb48e('0x1c')](function(_0x406554){logger[_0xb48e('0xb')](_0xb48e('0x1d'));return _0x406554;});}function getUser(_0x14e6cd,_0x49f620){if(intUtil[_0xb48e('0x1e')](_0x49f620)){return request({'uri':util[_0xb48e('0xd')]('%s/api/v2/agents',_0x14e6cd['remoteUri']),'qs':{'email':_0x49f620}})[_0xb48e('0x1c')](function(_0x317291){if(_0x317291[_0xb48e('0x1f')]){logger[_0xb48e('0xb')](_0xb48e('0x20'));return _[_0xb48e('0x21')](_0x317291,function(_0x9b946b){return _0x9b946b[_0xb48e('0x22')][_0xb48e('0x23')]===_0x49f620;});}else{logger[_0xb48e('0xb')](_0xb48e('0x24'));return request({'uri':util[_0xb48e('0xd')](_0xb48e('0x25'),_0x14e6cd[_0xb48e('0x1a')])})[_0xb48e('0x1c')](function(_0x333f01){logger['info'](_0xb48e('0x26'));return _0x333f01;});}});}else{logger[_0xb48e('0xb')](_0xb48e('0x27'));return request({'uri':util['format'](_0xb48e('0x25'),_0x14e6cd[_0xb48e('0x1a')])})['then'](function(_0xeb73f){logger[_0xb48e('0xb')](_0xb48e('0x26'));return _0xeb73f;});}}function getEndUser(_0x22783a,_0x2be19b,_0x433e97){logger[_0xb48e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x433e97);return request({'uri':util[_0xb48e('0xd')]('%s/api/v2/contacts',_0x22783a['remoteUri']),'qs':{'phone':_0x433e97}})[_0xb48e('0x1c')](function(_0x496de3){if(_0x496de3[_0xb48e('0x1f')]){logger[_0xb48e('0xb')](_0xb48e('0x28'));return _[_0xb48e('0x21')](_0x496de3,{'phone':_0x433e97});}else{logger[_0xb48e('0xb')](_0xb48e('0x29'));return request({'uri':util[_0xb48e('0xd')](_0xb48e('0x2a'),_0x22783a[_0xb48e('0x1a')]),'method':_0xb48e('0x1b'),'body':{'name':_0x2be19b,'phone':_0x433e97}})[_0xb48e('0x1c')](function(_0x361d12){logger[_0xb48e('0xb')]('Enduser\x20created.');return _0x361d12;});}});}function getAuth(_0x135f03){return util[_0xb48e('0xd')](_0xb48e('0x2b'),new Buffer(_0x135f03[_0xb48e('0x2c')]+':X')[_0xb48e('0x2d')](_0xb48e('0x2e')));}function request(_0x4287cb){logger['debug']('[HTTP]',JSON[_0xb48e('0x2f')](_0x4287cb));return rp(_['defaults'](_0x4287cb,{'method':_0xb48e('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x22a94a,_0x54a77b){var _0x5087e0=[];if(_0x22a94a&&_0x22a94a[_0xb48e('0x1f')]>0x0){_0x5087e0=_[_0xb48e('0x31')](_0x22a94a,_0x54a77b);}return _0x5087e0;}function getCustomFields(_0x1fa375,_0x1dbf44){var _0x54236d=[];var _0xaeb732={'custom_fields':[]};if(_0x1fa375[_0xb48e('0x1f')]>0x0){_[_0xb48e('0x32')](_0x1fa375,function(_0x3df4c1){if(_[_0xb48e('0x33')]([_0xb48e('0x34'),_0xb48e('0x35')],_0x3df4c1[_0xb48e('0x36')])&&_0x3df4c1[_0xb48e('0x37')]&&!_0x3df4c1['customField']){_0xaeb732[_0x3df4c1[_0xb48e('0x37')][_0xb48e('0x38')]()]=_0x3df4c1[_0xb48e('0x39')][_0xb48e('0x2d')]();}else if(_[_0xb48e('0x33')](['string',_0xb48e('0x35')],_0x3df4c1[_0xb48e('0x36')])&&_0x3df4c1[_0xb48e('0x3a')]&&_0x3df4c1[_0xb48e('0x3b')]){_0xaeb732[_0xb48e('0x16')][_0xb48e('0x3c')]({'id':_0x3df4c1[_0xb48e('0x3a')],'value':_0x3df4c1[_0xb48e('0x39')][_0xb48e('0x2d')]()});}else if(_0x3df4c1[_0xb48e('0x36')]===_0xb48e('0x3d')&&_0x3df4c1[_0xb48e('0x3e')]&&_0x3df4c1[_0xb48e('0x3a')]&&_0x3df4c1['customField']){_0x1dbf44[_0x3df4c1[_0xb48e('0x3e')]]&&_0xaeb732['custom_fields']['push']({'id':_0x3df4c1[_0xb48e('0x3a')],'value':_0x1dbf44[_0x3df4c1[_0xb48e('0x3e')]]['toString']()});}else if(_0x3df4c1[_0xb48e('0x36')]===_0xb48e('0x3f')&&_0x3df4c1['Variable']&&_0x3df4c1[_0xb48e('0x40')]['name']&&_0x3df4c1[_0xb48e('0x3a')]&&_0x3df4c1[_0xb48e('0x3b')]){_0x1dbf44[_0x3df4c1[_0xb48e('0x40')]['name'][_0xb48e('0x38')]()]&&_0xaeb732[_0xb48e('0x16')][_0xb48e('0x3c')]({'id':_0x3df4c1['idField'],'value':_0x1dbf44[_0x3df4c1[_0xb48e('0x40')][_0xb48e('0x14')][_0xb48e('0x38')]()][_0xb48e('0x2d')]()});}});}return _0xaeb732;}exports['queue']=function(_0x3b0fd9,_0x5a08d3,_0x164796,_0x54dfcd,_0x533d21,_0x12984c){var _0x15642d,_0x1eb406;_0x12984c[_0xb48e('0x1a')]=intUtil[_0xb48e('0x41')](_0x12984c[_0xb48e('0x1a')]);_0x12984c[_0xb48e('0x42')]=intUtil[_0xb48e('0x41')](_0x12984c[_0xb48e('0x42')]);if(_0x533d21&&_0x533d21['monitor_format']){logger[_0xb48e('0xb')](_0xb48e('0x43'),_0xb48e('0x44'));_0x5a08d3[_0xb48e('0x45')]=util[_0xb48e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12984c[_0xb48e('0x42')],_0x5a08d3['uniqueid'],md5(_0x5a08d3[_0xb48e('0x46')]));}else{_0x5a08d3[_0xb48e('0x45')]='';}headers['Authorization']=getAuth(_0x12984c);return getUser(_0x12984c,_0x54dfcd[_0xb48e('0x23')])[_0xb48e('0x1c')](function(_0x53d874){_0x15642d=_0x53d874;logger[_0xb48e('0xb')](_0xb48e('0x47'),_0x15642d['id']);return getEndUser(_0x12984c,_0x5a08d3[_0xb48e('0x48')],_0x5a08d3[_0xb48e('0xf')]);})[_0xb48e('0x1c')](function(_0xfe8263){_0x1eb406=_0xfe8263;logger['info'](_0xb48e('0x49'),_0x1eb406['id']);return getTicket(_0x12984c,_0x15642d,_0x1eb406,_0x164796,_0x5a08d3);})['then'](function(_0x196d9b){if(_0x196d9b&&_0x196d9b['id']){logger[_0xb48e('0xb')](_0xb48e('0x1d'));logger[_0xb48e('0xb')](_0xb48e('0x4a'),_0x196d9b['id']);logger['info'](_0xb48e('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb48e('0xd')](_0xb48e('0x4b'),_0x54dfcd[_0xb48e('0x14')]),_0xb48e('0x4c'),{'uri':util[_0xb48e('0xd')](_0xb48e('0x4d'),_0x12984c['remoteUri'],_0x196d9b['id'])});}})[_0xb48e('0x4e')](function(_0x40cab0){logger[_0xb48e('0x4f')](_0xb48e('0x43'),JSON['stringify'](_0x40cab0));});};exports[_0xb48e('0x50')]=function(_0xc46e38,_0x42559b,_0x5ad769,_0x387a30,_0x2542e7,_0x364dec,_0x2b92d5){var _0x2eaf87,_0x4856c1;_0x364dec[_0xb48e('0x1a')]=intUtil['stripTrailingSlash'](_0x364dec[_0xb48e('0x1a')]);_0x364dec[_0xb48e('0x42')]=intUtil[_0xb48e('0x41')](_0x364dec['serverUrl']);if(_0x2b92d5&&_0x2b92d5[_0xb48e('0x51')]&&_0x2b92d5[_0xb48e('0x51')]!==_0xb48e('0x52')){logger[_0xb48e('0xb')](_0xb48e('0x53'),_0xb48e('0x44'));_0x42559b[_0xb48e('0x45')]=util['format'](_0xb48e('0x54'),_0x364dec['serverUrl'],_0x42559b[_0xb48e('0x46')],md5(_0x42559b[_0xb48e('0x46')]));}headers[_0xb48e('0x55')]=getAuth(_0x364dec);return getUser(_0x364dec,_0x387a30[_0xb48e('0x23')])[_0xb48e('0x1c')](function(_0x357828){_0x2eaf87=_0x357828;logger[_0xb48e('0xb')](_0xb48e('0x47'),_0x2eaf87['id']);return getEndUser(_0x364dec,_0x42559b[_0xb48e('0x56')],_0x42559b['destcalleridnum']);})['then'](function(_0x59a857){_0x4856c1=_0x59a857;logger[_0xb48e('0xb')](_0xb48e('0x49'),_0x4856c1['id']);return getTicket(_0x364dec,_0x2eaf87,_0x4856c1,_0x5ad769,_0x42559b);})[_0xb48e('0x1c')](function(_0x4621e8){if(_0x4621e8&&_0x4621e8['id']){logger[_0xb48e('0xb')]('Ticket\x20created!');logger['info'](_0xb48e('0x4a'),_0x4621e8['id']);logger[_0xb48e('0xb')](_0xb48e('0x53'),_0xb48e('0x57'));emit(util[_0xb48e('0xd')](_0xb48e('0x4b'),_0x387a30[_0xb48e('0x14')]),'trigger:browser:url',{'uri':util[_0xb48e('0xd')](_0xb48e('0x4d'),_0x364dec['remoteUri'],_0x4621e8['id'])});}})[_0xb48e('0x4e')](function(_0x4ef6a5){logger[_0xb48e('0x4f')]('[OUTBOUND]',JSON[_0xb48e('0x2f')](_0x4ef6a5));});};exports['unmanaged']=function(_0xd439e5,_0x1658dd,_0x32dee3,_0x2d9a57,_0x2bc780,_0x39c476){var _0x5970d9,_0x3c42ff;_0x39c476[_0xb48e('0x1a')]=intUtil[_0xb48e('0x41')](_0x39c476[_0xb48e('0x1a')]);_0x39c476[_0xb48e('0x42')]=intUtil['stripTrailingSlash'](_0x39c476[_0xb48e('0x42')]);if(_0x2bc780&&_0x2bc780[_0xb48e('0x58')]){logger[_0xb48e('0xb')]('['+_0x1658dd['lastevent'][_0xb48e('0x59')]()+']',_0xb48e('0x44'));_0x1658dd[_0xb48e('0x45')]=util[_0xb48e('0xd')](_0xb48e('0x54'),_0x39c476[_0xb48e('0x42')],_0x1658dd[_0xb48e('0x46')],md5(_0x1658dd[_0xb48e('0x46')]));}else{_0x1658dd[_0xb48e('0x45')]='';}headers['Authorization']=getAuth(_0x39c476);return getUser(_0x39c476,'')[_0xb48e('0x1c')](function(_0x32f050){_0x5970d9=_0x32f050;logger[_0xb48e('0xb')]('The\x20User\x20ID\x20is:',_0x5970d9['id']);return getEndUser(_0x39c476,_0x1658dd[_0xb48e('0x48')],_0x1658dd[_0xb48e('0xf')]);})[_0xb48e('0x1c')](function(_0x25165b){_0x3c42ff=_0x25165b;logger[_0xb48e('0xb')](_0xb48e('0x49'),_0x3c42ff['id']);return getTicket(_0x39c476,_0x5970d9,_0x3c42ff,_0x32dee3,_0x1658dd);})[_0xb48e('0x1c')](function(_0x4974e1){if(_0x4974e1){logger[_0xb48e('0xb')](_0xb48e('0x1d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4974e1['id']);}})[_0xb48e('0x4e')](function(_0xda7efe){logger[_0xb48e('0x4f')]('['+_0x1658dd['lastevent'][_0xb48e('0x59')]()+']',JSON[_0xb48e('0x2f')](_0xda7efe));});}; \ 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 f408575..7caaa0f 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 _0x64c7=['/api/lookup?q=','&f=','&entities=contact','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','message','then','users','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','catch','toUpperCase'];(function(_0x57f0fc,_0x5319b9){var _0x9fbccc=function(_0x3dba98){while(--_0x3dba98){_0x57f0fc['push'](_0x57f0fc['shift']());}};_0x9fbccc(++_0x5319b9);}(_0x64c7,0x193));var _0x764c=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x64c7[_0x2fee96];return _0x2e6ad1;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x764c('0x0'));var moment=require(_0x764c('0x1'));var Promise=require(_0x764c('0x2'));var Redis=require(_0x764c('0x3'));var intUtil=require(_0x764c('0x4'));var config=require(_0x764c('0x5'));var logger=require(_0x764c('0x6'))(_0x764c('0x7'));config[_0x764c('0x8')]=_[_0x764c('0x9')](config[_0x764c('0x8')],{'host':_0x764c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x764c('0x8')]));function getAdminId(_0x4941fe,_0x24f23d,_0x4c88fe,_0x2f09ff){return new Promise(function(_0x404fd9,_0x792d49){var _0x3553b7=![];var _0x23cb78={'method':_0x764c('0xb'),'uri':_0x2f09ff+_0x764c('0xc'),'json':!![]};_0x23cb78['headers']=_0x4c88fe;logger[_0x764c('0xd')](_0x764c('0xe'));return rp(_0x23cb78)['then'](function(_0x5b77f7){if(_0x5b77f7){var _0x457ad4=_0x5b77f7['users'];var _0x1c0dbc=null;for(_0x1c0dbc=0x0;_0x1c0dbc<_0x457ad4[_0x764c('0xf')];_0x1c0dbc++){if(_0x457ad4[_0x1c0dbc][_0x764c('0x10')]===_0x4941fe[_0x764c('0x11')]){_0x4941fe[_0x764c('0x12')]=_0x457ad4[_0x1c0dbc]['id'];_0x3553b7=!![];}}if(_0x3553b7){logger[_0x764c('0xd')]('Admin\x20found:',_0x4941fe[_0x764c('0x12')]);_0x404fd9(_0x4941fe);}else{_0x792d49({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x792d49({'statusCode':0x194,'message':_0x764c('0x13')});}})['catch'](function(_0x234c0b){logger[_0x764c('0x14')]('['+[_0x24f23d['toUpperCase']()]+']',_0x234c0b[_0x764c('0x15')]);_0x792d49(_0x234c0b);});});}function getUser(_0x188e4c,_0x10dd66,_0x1a0673){return function(_0x4dc36f){return new Promise(function(_0x55858b,_0x14356e){var _0x71aa4f={'method':_0x764c('0xb'),'uri':_0x1a0673+_0x764c('0xc'),'json':!![]};_0x71aa4f['headers']=_0x10dd66;logger[_0x764c('0xd')]('Getting\x20user\x20list');return rp(_0x71aa4f)[_0x764c('0x16')](function(_0x13451e){if(_0x13451e){var _0x52a127=_0x13451e[_0x764c('0x17')];var _0x48e776=![];var _0x161e91=null;if(_0x4dc36f['agentEmail']!==null){logger[_0x764c('0xd')](_0x764c('0x18'),_0x4dc36f[_0x764c('0x19')]);_0x4dc36f['userEmail']=_0x4dc36f['agentEmail'];for(_0x161e91=0x0;_0x161e91<_0x52a127[_0x764c('0xf')];_0x161e91++){if(_0x52a127[_0x161e91]['email']===_0x4dc36f['agentEmail']){_0x48e776=!![];_0x4dc36f[_0x764c('0x1a')]=_0x52a127[_0x161e91]['id'];logger[_0x764c('0xd')](_0x764c('0x1b'),_0x4dc36f[_0x764c('0x1a')]);}}}if(!_0x48e776){logger[_0x764c('0xd')](_0x764c('0x1c'));_0x4dc36f[_0x764c('0x1d')]=_0x4dc36f[_0x764c('0x11')];_0x4dc36f[_0x764c('0x1a')]=_0x4dc36f[_0x764c('0x12')];_0x48e776=!![];}if(_0x48e776){_0x55858b(_0x4dc36f);}else{_0x14356e({'statusCode':0x194,'message':_0x764c('0x13')});}}else{_0x14356e({'statusCode':0x194,'message':_0x764c('0x13')});}})[_0x764c('0x1e')](function(_0x4bc13e){logger[_0x764c('0x14')]('['+[_0x188e4c[_0x764c('0x1f')]()]+']',_0x4bc13e[_0x764c('0x15')]);_0x14356e(_0x4bc13e);});});};}function searchContact(_0x54d92f,_0x14abf9,_0x2ab535,_0x1a5cdc){return new Promise(function(_0x228eb1,_0x2f7ebc){var _0x41e01d={'method':_0x764c('0xb'),'headers':_0x14abf9,'uri':_0x54d92f+_0x764c('0x20')+_0x1a5cdc+_0x764c('0x21')+_0x2ab535+_0x764c('0x22'),'json':!![]};rp(_0x41e01d)[_0x764c('0x16')](function(_0x2fb58b){var _0x23e9fa=_['find'](_0x2fb58b['contacts'][_0x764c('0x23')],[_0x2ab535,_0x1a5cdc]);_0x228eb1(_0x23e9fa);})[_0x764c('0x1e')](function(_0x375258){_0x2f7ebc(_0x375258);});});}function getEndUser(_0x5daaf8,_0x2dfb6d,_0x59f657){return function(_0x6b8f03){return new Promise(function(_0x4291cf,_0x2ed660){logger['info'](util[_0x764c('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x6b8f03[_0x764c('0x25')]));searchContact(_0x59f657,_0x2dfb6d,_0x764c('0x26'),_0x6b8f03[_0x764c('0x25')])[_0x764c('0x16')](function(_0xbaebc0){if(_0xbaebc0){_0x6b8f03[_0x764c('0x27')]=_0xbaebc0['id'];logger[_0x764c('0xd')](_0x764c('0x28'),_0x6b8f03['endUserId']);return _0x4291cf(_0x6b8f03);}searchContact(_0x59f657,_0x2dfb6d,_0x764c('0x29'),_0x6b8f03[_0x764c('0x25')])[_0x764c('0x16')](function(_0x262a1e){if(_0x262a1e){_0x6b8f03[_0x764c('0x27')]=_0x262a1e['id'];logger[_0x764c('0xd')]('Contact\x20found\x20work_number:',_0x6b8f03['endUserId']);return _0x4291cf(_0x6b8f03);}createEndUser(_0x6b8f03,_0x5daaf8,_0x2dfb6d,_0x59f657)[_0x764c('0x16')](function(_0x2a17ff){logger[_0x764c('0xd')](_0x764c('0x2a'),_0x2a17ff[_0x764c('0x27')]);return _0x4291cf(_0x2a17ff);});});})['catch'](function(_0x350c11){_0x2ed660(_0x350c11);});});};}function createEndUser(_0x137c52,_0x43849e,_0x2eb2de,_0x3419cc){return new Promise(function(_0x1345b7,_0x534503){var _0x138966=moment();var _0x370345={'method':_0x764c('0x2b'),'uri':_0x3419cc+_0x764c('0x2c'),'body':{'contact':{'last_name':_0x137c52['contactNumber'],'work_number':_0x137c52[_0x764c('0x25')],'mobile_number':_0x137c52[_0x764c('0x25')],'owner_id':_0x137c52[_0x764c('0x1a')],'created_at':_0x138966[_0x764c('0x24')](_0x764c('0x2d'))}},'json':!![]};_0x370345[_0x764c('0x2e')]=_0x2eb2de;logger[_0x764c('0xd')](_0x764c('0x2f'));return rp(_0x370345)[_0x764c('0x16')](function(_0x198f8f){_0x137c52[_0x764c('0x27')]=_0x198f8f[_0x764c('0x30')]['id'];_0x1345b7(_0x137c52);})[_0x764c('0x1e')](function(_0x22fc92){logger[_0x764c('0x14')]('['+[_0x43849e[_0x764c('0x1f')]()]+']',_0x22fc92['message']);_0x534503(_0x22fc92[_0x764c('0x15')]);});});}function getTicket(_0x5b95a7,_0x2ee74a,_0x56faf3,_0x36720b,_0x4c7b85){return function(_0x5c85cf){logger['info'](_0x764c('0x31'));return new Promise(function(_0x492c2e,_0x156fb4){var _0xe22455=moment();var _0x56f7b1={'method':_0x764c('0x2b'),'uri':_0x56faf3+_0x764c('0x32'),'body':{'title':intUtil['getString'](_0x36720b['Subjects'],_0x4c7b85,'\x20'),'description':intUtil[_0x764c('0x33')](_0x36720b[_0x764c('0x34')],_0x4c7b85,'\x0a'),'owner_id':_0x5c85cf[_0x764c('0x1a')],'creater_id':_0x5c85cf[_0x764c('0x12')],'targetable_id':_0x5c85cf[_0x764c('0x27')],'targetable_type':'Contact','created_at':_0xe22455[_0x764c('0x24')](_0x764c('0x2d')),'due_date':_0xe22455[_0x764c('0x35')](0x1e,'m')[_0x764c('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x56f7b1[_0x764c('0x2e')]=_0x2ee74a;return rp(_0x56f7b1)[_0x764c('0x16')](function(_0x190922){_0x5c85cf[_0x764c('0x36')]=_0x190922[_0x764c('0x37')]['id'];logger['info'](_0x764c('0x38'),_0x5c85cf[_0x764c('0x36')]);_0x492c2e(_0x5c85cf);})['catch'](function(_0xf6f725){logger['error']('['+[_0x5b95a7['toUpperCase']()]+']',_0xf6f725[_0x764c('0x15')]);_0x156fb4(_0xf6f725[_0x764c('0x15')]);});});};}function emit(_0x45757c,_0x223166,_0x39d077){var _0x26bcc4={'uri':_0x45757c+_0x764c('0x39')+_0x39d077};io['to'](util[_0x764c('0x24')](_0x764c('0x3a'),_0x223166))[_0x764c('0x3b')](_0x764c('0x3c'),_0x26bcc4);}exports['cs']=function(_0x515475,_0x17415f,_0xaf0d73,_0x118c28,_0xabf5ff,_0x1c374c,_0x9846e8,_0x2a17c9){var _0x194f13={};var _0x35adcb={'Authorization':_0x764c('0x3d')+_0x1c374c[_0x764c('0x3e')]};_0x1c374c[_0x764c('0x3f')]=intUtil[_0x764c('0x40')](_0x1c374c[_0x764c('0x3f')]);_0x1c374c[_0x764c('0x41')]=intUtil[_0x764c('0x40')](_0x1c374c[_0x764c('0x41')]);var _0xdb9186=_0x1c374c['remoteUri'];_0x194f13['adminEmail']=_0x1c374c[_0x764c('0x42')];_0x194f13[_0x764c('0x25')]=_0x2a17c9[_0x764c('0x43')]()===_0x764c('0x44')?_0x17415f[_0x764c('0x45')]:_0x17415f[_0x764c('0x46')];_0x194f13[_0x764c('0x47')]=_0x2a17c9===_0x764c('0x48')||_0x2a17c9==='unmanaged'?'queue':_0x764c('0x44');if(_0x118c28){_0x194f13[_0x764c('0x19')]=_0x118c28['email'];}var _0x9ffab4=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c374c[_0x764c('0x41')],_0x17415f['uniqueid'],md5(_0x17415f[_0x764c('0x49')]));if(_0xabf5ff&&_0xabf5ff[_0x764c('0x4a')]){logger['info'](_0x764c('0x4b'),_0x764c('0x4c'));_0x17415f[_0x764c('0x4d')]=_0x9ffab4;}else if(_0x9846e8&&_0x9846e8['recordingFormat']&&_0x9846e8[_0x764c('0x4e')]!==_0x764c('0x4f')){logger[_0x764c('0xd')](_0x764c('0x50'),_0x764c('0x4c'));_0x17415f[_0x764c('0x4d')]=_0x9ffab4;}else{_0x17415f['recordingURL']='';}return getAdminId(_0x194f13,_0x2a17c9,_0x35adcb,_0xdb9186)['then'](getUser(_0x2a17c9,_0x35adcb,_0xdb9186))[_0x764c('0x16')](getEndUser(_0x2a17c9,_0x35adcb,_0xdb9186))['then'](getTicket(_0x2a17c9,_0x35adcb,_0xdb9186,_0xaf0d73,_0x17415f))[_0x764c('0x16')](function(_0x473ec1){logger[_0x764c('0xd')](util['format'](_0x764c('0x51'),_0x473ec1[_0x764c('0x36')]));if(_0x2a17c9!==_0x764c('0x52')){logger[_0x764c('0xd')]('['+[_0x2a17c9['toUpperCase']()]+']',_0x764c('0x53'));emit(_0xdb9186,_0x118c28[_0x764c('0x54')],_0x473ec1[_0x764c('0x27')]);}})['catch'](function(_0x458df8){logger[_0x764c('0x14')]('['+[_0x2a17c9['toUpperCase']()]+_0x764c('0x55'),util[_0x764c('0x56')](_0x458df8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xaee0=['serverUrl','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','catch','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','/api/tasks','getString','Subjects','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','ticketId','user:%s','emit'];(function(_0x2e6a36,_0x44f57c){var _0xa10173=function(_0x155270){while(--_0x155270){_0x2e6a36['push'](_0x2e6a36['shift']());}};_0xa10173(++_0x44f57c);}(_0xaee0,0xbb));var _0x0aee=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xaee0[_0x3438cf];return _0x278698;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x0aee('0x0'));var util=require(_0x0aee('0x1'));var moment=require(_0x0aee('0x2'));var Promise=require(_0x0aee('0x3'));var Redis=require(_0x0aee('0x4'));var intUtil=require(_0x0aee('0x5'));var config=require(_0x0aee('0x6'));var logger=require('../../../../config/logger')(_0x0aee('0x7'));config[_0x0aee('0x8')]=_[_0x0aee('0x9')](config['redis'],{'host':_0x0aee('0xa'),'port':0x18eb});var io=require(_0x0aee('0xb'))(new Redis(config[_0x0aee('0x8')]));function getAdminId(_0x369728,_0x19e1ea,_0x24a8a5,_0x193683){return new Promise(function(_0x4824c5,_0xa5cd3b){var _0x3c1a5d=![];var _0x1bd7c4={'method':_0x0aee('0xc'),'uri':_0x193683+_0x0aee('0xd'),'json':!![]};_0x1bd7c4[_0x0aee('0xe')]=_0x24a8a5;logger[_0x0aee('0xf')](_0x0aee('0x10'));return rp(_0x1bd7c4)[_0x0aee('0x11')](function(_0x5ba0d9){if(_0x5ba0d9){var _0xb069d8=_0x5ba0d9[_0x0aee('0x12')];var _0x4b83a2=null;for(_0x4b83a2=0x0;_0x4b83a2<_0xb069d8['length'];_0x4b83a2++){if(_0xb069d8[_0x4b83a2][_0x0aee('0x13')]===_0x369728[_0x0aee('0x14')]){_0x369728['adminId']=_0xb069d8[_0x4b83a2]['id'];_0x3c1a5d=!![];}}if(_0x3c1a5d){logger[_0x0aee('0xf')](_0x0aee('0x15'),_0x369728[_0x0aee('0x16')]);_0x4824c5(_0x369728);}else{_0xa5cd3b({'statusCode':0x194,'message':_0x0aee('0x17')});}}else{_0xa5cd3b({'statusCode':0x194,'message':_0x0aee('0x17')});}})['catch'](function(_0x348bf2){logger[_0x0aee('0x18')]('['+[_0x19e1ea['toUpperCase']()]+']',_0x348bf2['message']);_0xa5cd3b(_0x348bf2);});});}function getUser(_0x3de061,_0x12287f,_0x13b40d){return function(_0x4f729a){return new Promise(function(_0x53ab14,_0x5d67cd){var _0x179f9f={'method':_0x0aee('0xc'),'uri':_0x13b40d+'/api/selector/owners','json':!![]};_0x179f9f[_0x0aee('0xe')]=_0x12287f;logger[_0x0aee('0xf')]('Getting\x20user\x20list');return rp(_0x179f9f)[_0x0aee('0x11')](function(_0x2b277a){if(_0x2b277a){var _0x251c01=_0x2b277a['users'];var _0x4ea472=![];var _0x4cd896=null;if(_0x4f729a[_0x0aee('0x19')]!==null){logger[_0x0aee('0xf')](_0x0aee('0x1a'),_0x4f729a['agentEmail']);_0x4f729a[_0x0aee('0x1b')]=_0x4f729a[_0x0aee('0x19')];for(_0x4cd896=0x0;_0x4cd896<_0x251c01['length'];_0x4cd896++){if(_0x251c01[_0x4cd896]['email']===_0x4f729a[_0x0aee('0x19')]){_0x4ea472=!![];_0x4f729a[_0x0aee('0x1c')]=_0x251c01[_0x4cd896]['id'];logger[_0x0aee('0xf')](_0x0aee('0x1d'),_0x4f729a[_0x0aee('0x1c')]);}}}if(!_0x4ea472){logger['info']('Admin\x20selected');_0x4f729a[_0x0aee('0x1b')]=_0x4f729a[_0x0aee('0x14')];_0x4f729a['userId']=_0x4f729a[_0x0aee('0x16')];_0x4ea472=!![];}if(_0x4ea472){_0x53ab14(_0x4f729a);}else{_0x5d67cd({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5d67cd({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x5d68fd){logger[_0x0aee('0x18')]('['+[_0x3de061[_0x0aee('0x1e')]()]+']',_0x5d68fd['message']);_0x5d67cd(_0x5d68fd);});});};}function searchContact(_0x5a1272,_0x11e861,_0x14dfc8,_0x373b4c){return new Promise(function(_0x49a5e0,_0x27898f){var _0x5e13af={'method':_0x0aee('0xc'),'headers':_0x11e861,'uri':_0x5a1272+_0x0aee('0x1f')+_0x373b4c+_0x0aee('0x20')+_0x14dfc8+_0x0aee('0x21'),'json':!![]};rp(_0x5e13af)[_0x0aee('0x11')](function(_0x43b428){var _0x42927e=_[_0x0aee('0x22')](_0x43b428[_0x0aee('0x23')][_0x0aee('0x23')],[_0x14dfc8,_0x373b4c]);_0x49a5e0(_0x42927e);})[_0x0aee('0x24')](function(_0x1bab42){_0x27898f(_0x1bab42);});});}function getEndUser(_0x7c69a6,_0x1b2542,_0x40bd94){return function(_0x38d3e2){return new Promise(function(_0x43950f,_0xa4f668){logger[_0x0aee('0xf')](util['format'](_0x0aee('0x25'),_0x38d3e2[_0x0aee('0x26')]));searchContact(_0x40bd94,_0x1b2542,_0x0aee('0x27'),_0x38d3e2[_0x0aee('0x26')])[_0x0aee('0x11')](function(_0x875184){if(_0x875184){_0x38d3e2[_0x0aee('0x28')]=_0x875184['id'];logger[_0x0aee('0xf')](_0x0aee('0x29'),_0x38d3e2['endUserId']);return _0x43950f(_0x38d3e2);}searchContact(_0x40bd94,_0x1b2542,'work_number',_0x38d3e2[_0x0aee('0x26')])[_0x0aee('0x11')](function(_0xde0e6a){if(_0xde0e6a){_0x38d3e2[_0x0aee('0x28')]=_0xde0e6a['id'];logger['info'](_0x0aee('0x2a'),_0x38d3e2[_0x0aee('0x28')]);return _0x43950f(_0x38d3e2);}createEndUser(_0x38d3e2,_0x7c69a6,_0x1b2542,_0x40bd94)[_0x0aee('0x11')](function(_0x5964d3){logger[_0x0aee('0xf')](_0x0aee('0x2b'),_0x5964d3[_0x0aee('0x28')]);return _0x43950f(_0x5964d3);});});})['catch'](function(_0x4b5fb3){_0xa4f668(_0x4b5fb3);});});};}function createEndUser(_0x58a237,_0x1c4160,_0x35f18d,_0x3aae58){return new Promise(function(_0x54e7d2,_0x3dac3d){var _0x5daa2e=moment();var _0x4fc8e1={'method':_0x0aee('0x2c'),'uri':_0x3aae58+_0x0aee('0x2d'),'body':{'contact':{'last_name':_0x58a237[_0x0aee('0x26')],'work_number':_0x58a237['contactNumber'],'mobile_number':_0x58a237[_0x0aee('0x26')],'owner_id':_0x58a237[_0x0aee('0x1c')],'created_at':_0x5daa2e[_0x0aee('0x2e')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4fc8e1[_0x0aee('0xe')]=_0x35f18d;logger[_0x0aee('0xf')](_0x0aee('0x2f'));return rp(_0x4fc8e1)[_0x0aee('0x11')](function(_0x260ec8){_0x58a237[_0x0aee('0x28')]=_0x260ec8[_0x0aee('0x30')]['id'];_0x54e7d2(_0x58a237);})[_0x0aee('0x24')](function(_0x163c2a){logger[_0x0aee('0x18')]('['+[_0x1c4160['toUpperCase']()]+']',_0x163c2a[_0x0aee('0x31')]);_0x3dac3d(_0x163c2a[_0x0aee('0x31')]);});});}function getTicket(_0x2e2b7d,_0x382098,_0x248c33,_0x57c486,_0x4ca5be){return function(_0x34ac18){logger[_0x0aee('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x308c0b,_0xed7bc7){var _0xf17cdb=moment();var _0x154257={'method':_0x0aee('0x2c'),'uri':_0x248c33+_0x0aee('0x32'),'body':{'title':intUtil[_0x0aee('0x33')](_0x57c486[_0x0aee('0x34')],_0x4ca5be,'\x20'),'description':intUtil[_0x0aee('0x33')](_0x57c486['Descriptions'],_0x4ca5be,'\x0a'),'owner_id':_0x34ac18[_0x0aee('0x1c')],'creater_id':_0x34ac18[_0x0aee('0x16')],'targetable_id':_0x34ac18[_0x0aee('0x28')],'targetable_type':'Contact','created_at':_0xf17cdb['format'](_0x0aee('0x35')),'due_date':_0xf17cdb['add'](0x1e,'m')[_0x0aee('0x2e')](_0x0aee('0x35'))},'json':!![]};_0x154257[_0x0aee('0xe')]=_0x382098;return rp(_0x154257)['then'](function(_0xd15261){_0x34ac18['ticketId']=_0xd15261[_0x0aee('0x36')]['id'];logger[_0x0aee('0xf')](_0x0aee('0x37'),_0x34ac18[_0x0aee('0x38')]);_0x308c0b(_0x34ac18);})[_0x0aee('0x24')](function(_0x4cc2bb){logger[_0x0aee('0x18')]('['+[_0x2e2b7d[_0x0aee('0x1e')]()]+']',_0x4cc2bb['message']);_0xed7bc7(_0x4cc2bb[_0x0aee('0x31')]);});});};}function emit(_0x2d757c,_0x917a60,_0x351467){var _0x53685c={'uri':_0x2d757c+'/contacts/'+_0x351467};io['to'](util[_0x0aee('0x2e')](_0x0aee('0x39'),_0x917a60))[_0x0aee('0x3a')]('trigger:browser:url',_0x53685c);}exports['cs']=function(_0x5b6ed1,_0x7ea412,_0x1e9c90,_0x233da8,_0x3f6a9f,_0x3ec767,_0x385d43,_0x4af146){var _0x4c1e7f={};var _0x455d1f={'Authorization':'Token\x20token='+_0x3ec767['apiKey']};_0x3ec767['remoteUri']=intUtil['stripTrailingSlash'](_0x3ec767['remoteUri']);_0x3ec767[_0x0aee('0x3b')]=intUtil[_0x0aee('0x3c')](_0x3ec767[_0x0aee('0x3b')]);var _0x421b2e=_0x3ec767['remoteUri'];_0x4c1e7f[_0x0aee('0x14')]=_0x3ec767[_0x0aee('0x3d')];_0x4c1e7f[_0x0aee('0x26')]=_0x4af146[_0x0aee('0x3e')]()==='outbound'?_0x7ea412[_0x0aee('0x3f')]:_0x7ea412[_0x0aee('0x40')];_0x4c1e7f[_0x0aee('0x41')]=_0x4af146===_0x0aee('0x42')||_0x4af146===_0x0aee('0x43')?_0x0aee('0x42'):_0x0aee('0x44');if(_0x233da8){_0x4c1e7f['agentEmail']=_0x233da8[_0x0aee('0x13')];}var _0x48d2d6=util['format'](_0x0aee('0x45'),_0x3ec767[_0x0aee('0x3b')],_0x7ea412[_0x0aee('0x46')],md5(_0x7ea412[_0x0aee('0x46')]));if(_0x3f6a9f&&_0x3f6a9f[_0x0aee('0x47')]){logger[_0x0aee('0xf')](_0x0aee('0x48'),_0x0aee('0x49'));_0x7ea412[_0x0aee('0x4a')]=_0x48d2d6;}else if(_0x385d43&&_0x385d43[_0x0aee('0x4b')]&&_0x385d43[_0x0aee('0x4b')]!==_0x0aee('0x4c')){logger[_0x0aee('0xf')]('[OUTBOUND]',_0x0aee('0x49'));_0x7ea412[_0x0aee('0x4a')]=_0x48d2d6;}else{_0x7ea412[_0x0aee('0x4a')]='';}return getAdminId(_0x4c1e7f,_0x4af146,_0x455d1f,_0x421b2e)[_0x0aee('0x11')](getUser(_0x4af146,_0x455d1f,_0x421b2e))[_0x0aee('0x11')](getEndUser(_0x4af146,_0x455d1f,_0x421b2e))[_0x0aee('0x11')](getTicket(_0x4af146,_0x455d1f,_0x421b2e,_0x1e9c90,_0x7ea412))[_0x0aee('0x11')](function(_0x55bfea){logger['info'](util[_0x0aee('0x2e')](_0x0aee('0x4d'),_0x55bfea['ticketId']));if(_0x4af146!==_0x0aee('0x43')){logger[_0x0aee('0xf')]('['+[_0x4af146[_0x0aee('0x1e')]()]+']',_0x0aee('0x4e'));emit(_0x421b2e,_0x233da8[_0x0aee('0x4f')],_0x55bfea['endUserId']);}})[_0x0aee('0x24')](function(_0x196e20){logger[_0x0aee('0x18')]('['+[_0x4af146[_0x0aee('0x1e')]()]+_0x0aee('0x50'),util[_0x0aee('0x51')](_0x196e20,{'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 d13f033..20c6557 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 _0x7a7c=['./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./freshsales','zendesk','salesforce','freshdesk','desk','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','zoho','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','lodash','util','./zendesk'];(function(_0x45fc9c,_0x70f2cb){var _0x984946=function(_0x432b38){while(--_0x432b38){_0x45fc9c['push'](_0x45fc9c['shift']());}};_0x984946(++_0x70f2cb);}(_0x7a7c,0xb6));var _0xc7a7=function(_0x98677a,_0x1d6b7c){_0x98677a=_0x98677a-0x0;var _0x5c93d4=_0x7a7c[_0x98677a];return _0x5c93d4;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var zendesk=require(_0xc7a7('0x2'));var salesforce=require(_0xc7a7('0x3'));var sugarcrm=require(_0xc7a7('0x4'));var freshdesk=require(_0xc7a7('0x5'));var zoho=require('./zoho');var desk=require(_0xc7a7('0x6'));var vtiger=require(_0xc7a7('0x7'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xc7a7('0x8'));var integrations=[_0xc7a7('0x9'),_0xc7a7('0xa'),'sugarcrm',_0xc7a7('0xb'),'zoho',_0xc7a7('0xc'),_0xc7a7('0xd'),'dynamics365',_0xc7a7('0xe'),_0xc7a7('0xf')];exports[_0xc7a7('0x10')]=function(_0x365f11,_0x3ed960,_0x276c39,_0x552aa7,_0x5ee86c,_0x4fef81){if(_0x276c39){if(_[_0xc7a7('0x11')](integrations,_0x365f11[_0xc7a7('0x12')][_0xc7a7('0x13')]())){try{var _0xe74b4b=null;var _0x4a8be0='';var _0x1f332d=_0x276c39[_0x365f11['data1']['toLowerCase']()];if(_0x1f332d){var _0xaa89f2=_0x1f332d[_0x365f11[_0xc7a7('0x14')]];if(_0xaa89f2){var _0x24ac56=_['find'](_0xaa89f2[_0xc7a7('0x15')],{'id':parseInt(_0x365f11[_0xc7a7('0x16')],0xa)});if(_0x24ac56){if(_0x552aa7){if(_0x5ee86c&&_0x3ed960[_0xc7a7('0x17')]){_0x4a8be0=_0xc7a7('0x17');}else if(_0x3ed960[_0xc7a7('0x18')]){_0x4a8be0=_0xc7a7('0x19');}else{console[_0xc7a7('0x1a')](_0xc7a7('0x1b'),_0x3ed960);}}else{_0x4a8be0=_0xc7a7('0x1c');}switch(_0x365f11[_0xc7a7('0x12')]['toLowerCase']()){case'zendesk':zendesk[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case'salesforce':salesforce[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0x1d'):sugarcrm[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xb'):freshdesk[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0x1e'):zoho[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xc'):desk[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xd'):vtiger[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xe'):freshsales['cs'](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81,_0x4a8be0);break;case _0xc7a7('0xf'):servicenow['cs'](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81,_0x4a8be0);break;case'dynamics365':dynamics365['cs'](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81,_0x4a8be0);break;default:console[_0xc7a7('0x1a')](_0xc7a7('0x1f'));}}else{_0xe74b4b=require('../../../../config/logger')(_0x365f11['data1'][_0xc7a7('0x13')]());_0xe74b4b[_0xc7a7('0x20')](_0xc7a7('0x21'),util[_0xc7a7('0x22')](_0xc7a7('0x23'),_0x365f11[_0xc7a7('0x12')]['toLowerCase'](),_0x365f11[_0xc7a7('0x16')]));}}else{_0xe74b4b=require(_0xc7a7('0x24'))(_0x365f11[_0xc7a7('0x12')]['toLowerCase']());_0xe74b4b['error'](_0xc7a7('0x21'),util[_0xc7a7('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x365f11[_0xc7a7('0x12')]['toLowerCase'](),_0x365f11['data2']));}}else{}}catch(_0x571f86){console[_0xc7a7('0x20')](_0x571f86);}}}}; \ No newline at end of file +var _0xf2b1=['find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','zoho','vtiger','freshsales','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','zendesk','freshdesk','desk','dynamics365','exec','includes','data1','toLowerCase','data2'];(function(_0x421096,_0x327fb3){var _0x4e9a4c=function(_0x4b0e89){while(--_0x4b0e89){_0x421096['push'](_0x421096['shift']());}};_0x4e9a4c(++_0x327fb3);}(_0xf2b1,0xf8));var _0x1f2b=function(_0x1726e1,_0x1cc1f4){_0x1726e1=_0x1726e1-0x0;var _0x44eccc=_0xf2b1[_0x1726e1];return _0x44eccc;};'use strict';var _=require(_0x1f2b('0x0'));var util=require('util');var zendesk=require(_0x1f2b('0x1'));var salesforce=require(_0x1f2b('0x2'));var sugarcrm=require(_0x1f2b('0x3'));var freshdesk=require(_0x1f2b('0x4'));var zoho=require(_0x1f2b('0x5'));var desk=require(_0x1f2b('0x6'));var vtiger=require(_0x1f2b('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0x1f2b('0x8'));var freshsales=require('./freshsales');var integrations=[_0x1f2b('0x9'),'salesforce','sugarcrm',_0x1f2b('0xa'),'zoho',_0x1f2b('0xb'),'vtiger',_0x1f2b('0xc'),'freshsales','servicenow'];exports[_0x1f2b('0xd')]=function(_0x243885,_0x310a6b,_0x410488,_0x2a6317,_0x3c0a66,_0x545e1b){if(_0x410488){if(_[_0x1f2b('0xe')](integrations,_0x243885[_0x1f2b('0xf')][_0x1f2b('0x10')]())){try{var _0x129ee1=null;var _0xd513e6='';var _0x1b6489=_0x410488[_0x243885[_0x1f2b('0xf')][_0x1f2b('0x10')]()];if(_0x1b6489){var _0x47a653=_0x1b6489[_0x243885[_0x1f2b('0x11')]];if(_0x47a653){var _0x138db4=_[_0x1f2b('0x12')](_0x47a653[_0x1f2b('0x13')],{'id':parseInt(_0x243885[_0x1f2b('0x14')],0xa)});if(_0x138db4){if(_0x2a6317){if(_0x3c0a66&&_0x310a6b[_0x1f2b('0x15')]){_0xd513e6=_0x1f2b('0x15');}else if(_0x310a6b[_0x1f2b('0x16')]){_0xd513e6='outbound';}else{console[_0x1f2b('0x17')](_0x1f2b('0x18'),_0x310a6b);}}else{_0xd513e6=_0x1f2b('0x19');}switch(_0x243885['data1'][_0x1f2b('0x10')]()){case _0x1f2b('0x9'):zendesk[_0xd513e6](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b);break;case'salesforce':salesforce[_0xd513e6](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b);break;case _0x1f2b('0x1a'):sugarcrm[_0xd513e6](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b);break;case'freshdesk':freshdesk[_0xd513e6](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b);break;case _0x1f2b('0x1b'):zoho[_0xd513e6](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b);break;case _0x1f2b('0xb'):desk[_0xd513e6](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b);break;case _0x1f2b('0x1c'):vtiger[_0xd513e6](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b);break;case _0x1f2b('0x1d'):freshsales['cs'](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b,_0xd513e6);break;case _0x1f2b('0x1e'):servicenow['cs'](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b,_0xd513e6);break;case _0x1f2b('0xc'):dynamics365['cs'](_0x243885,_0x310a6b,_0x138db4,_0x2a6317,_0x3c0a66,_0x47a653,_0x545e1b,_0xd513e6);break;default:console[_0x1f2b('0x17')](_0x1f2b('0x1f'));}}else{_0x129ee1=require(_0x1f2b('0x20'))(_0x243885['data1'][_0x1f2b('0x10')]());_0x129ee1[_0x1f2b('0x21')](_0x1f2b('0x22'),util[_0x1f2b('0x23')](_0x1f2b('0x24'),_0x243885['data1'][_0x1f2b('0x10')](),_0x243885['data3']));}}else{_0x129ee1=require('../../../../config/logger')(_0x243885['data1']['toLowerCase']());_0x129ee1[_0x1f2b('0x21')](_0x1f2b('0x22'),util['format'](_0x1f2b('0x25'),_0x243885[_0x1f2b('0xf')][_0x1f2b('0x10')](),_0x243885[_0x1f2b('0x11')]));}}else{}}catch(_0x3a75ef){console[_0x1f2b('0x21')](_0x3a75ef);}}}}; \ 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 e3b6d20..0a82f26 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 _0x066e=['isNil','validateEmail','User','find','execute','then','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','idField','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsRecurrence','contact','endUserType','WhoId','account','Case','ContactId','lead','leadId','sobject'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x066e,0x1d7));var _0xe066=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x066e[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xe066('0x0'));var rp=require(_0xe066('0x1'));var moment=require('moment');var BPromise=require(_0xe066('0x2'));var md5=require('md5');var jsforce=require(_0xe066('0x3'));var util=require(_0xe066('0x4'));var Redis=require(_0xe066('0x5'));var intUtil=require(_0xe066('0x6'));var config=require(_0xe066('0x7'));var logger=require('../../../../config/logger')(_0xe066('0x8'));config[_0xe066('0x9')]=_[_0xe066('0xa')](config[_0xe066('0x9')],{'host':_0xe066('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe066('0x9')]));function emit(_0x322fdf,_0x3714dc,_0x1dc242){io['to'](_0x322fdf)['emit'](_0x3714dc,_0x1dc242);}function getTicket(_0x324d8e,_0x51ae4f,_0x46f18b,_0x4b361e,_0x231e53,_0x43c179,_0x2cb9bc,_0x1077cc){var _0x104b34=Object[_0xe066('0xc')]({},{'OwnerId':_0x51ae4f['id'],'Subject':intUtil[_0xe066('0xd')](_0x4b361e[_0xe066('0xe')],_0x231e53,'\x20'),'Description':intUtil[_0xe066('0xd')](_0x4b361e[_0xe066('0xf')],_0x231e53,'\x0a')},getCustomFields(_0x43c179,_0x231e53));if(_0x46f18b){if(_0x4b361e[_0xe066('0x10')]==='Task'){_0x104b34[_0xe066('0x11')]=moment[_0xe066('0x12')]();_0x104b34['IsReminderSet']=![];_0x104b34[_0xe066('0x13')]=![];if(_0x46f18b['endUserType']===_0xe066('0x14')||_0x46f18b[_0xe066('0x15')]==='lead'){_0x104b34[_0xe066('0x16')]=_0x46f18b['id'];}else if(_0x46f18b['endUserType']===_0xe066('0x17')){_0x104b34['WhatId']=_0x46f18b['id'];}}else if(_0x4b361e[_0xe066('0x10')]===_0xe066('0x18')){if(_0x46f18b['endUserType']==='contact'){_0x104b34[_0xe066('0x19')]=_0x46f18b['id'];}else if(_0x46f18b[_0xe066('0x15')]===_0xe066('0x17')){_0x104b34['AccountId']=_0x46f18b['id'];}else if(_0x46f18b[_0xe066('0x15')]===_0xe066('0x1a')&&_0x4b361e[_0xe066('0x1b')]){_0x104b34[_0x4b361e[_0xe066('0x1b')]]=_0x46f18b['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x2cb9bc[_0xe066('0x1c')](_0x4b361e['ticketType'])['create'](_0x104b34);}function getUser(_0x3056ed,_0x21deb6,_0x4f6d47){if(!_[_0xe066('0x1d')](_0x21deb6)&&intUtil[_0xe066('0x1e')](_0x21deb6)){var _0x21c01d={'Email':_0x21deb6};var _0x2e88e5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4f6d47['sobject'](_0xe066('0x1f'))[_0xe066('0x20')](_0x21c01d,_0x2e88e5)[_0xe066('0x21')]()[_0xe066('0x22')](function(_0x2e6aec){if(_0x2e6aec['length']){var _0x2be0aa=_[_0xe066('0x20')](_0x2e6aec,function(_0x3cd483){return _0x3cd483[_0xe066('0x23')]===_0x21deb6;});if(_0x2be0aa){logger['info']('Agent\x20%s\x20found.',_0x21deb6);return BPromise[_0xe066('0x24')]({'id':_0x2be0aa['Id'],'name':_0x2be0aa[_0xe066('0x25')]});}}else{logger[_0xe066('0x26')](_0xe066('0x27'),_0x21deb6);return _0x4f6d47['identity']()[_0xe066('0x22')](function(_0x56059a){return BPromise[_0xe066('0x24')]({'id':_0x56059a[_0xe066('0x28')],'name':_0x56059a[_0xe066('0x29')]});});}});}else{logger[_0xe066('0x26')](_0xe066('0x27'),_0x21deb6);return _0x4f6d47['identity']()['then'](function(_0x2b3ba3){return BPromise[_0xe066('0x24')]({'id':_0x2b3ba3[_0xe066('0x28')],'name':_0x2b3ba3[_0xe066('0x29')]});});}}function getEndUser(_0x16df98,_0x483b29,_0x387c8b,_0x3667d5,_0xe94c1){var _0xed1e14={'$or':{'Phone':_0x3667d5}};var _0x50528a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xe066('0x26')](_0xe066('0x2a'),_0x3667d5,_0x483b29[_0xe066('0x2b')]);switch(_0x483b29[_0xe066('0x2b')]){case _0xe066('0x2c'):var _0x49f1af=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29['additionalSearchContact']){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x2e')]]=_0x3667d5;_[_0xe066('0x2f')](_0x49f1af[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x31'))[_0xe066('0x20')](_0x49f1af,_0x50528a)[_0xe066('0x21')]()[_0xe066('0x22')](function(_0x43385c){if(_0x43385c&&_0x43385c[_0xe066('0x32')]){return _0x43385c;}else{var _0x29faa1=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x33')]){var _0x501ca1={};_0x501ca1[_0x483b29[_0xe066('0x33')]]=_0x3667d5;_[_0xe066('0x2f')](_0x29faa1[_0xe066('0x30')],_0x501ca1);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x34'))[_0xe066('0x20')](_0x29faa1,_0x50528a);}});case _0xe066('0x35'):var _0xd1b4fa=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x36')]){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x36')]]=_0x3667d5;_[_0xe066('0x2f')](_0xd1b4fa[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x37'))[_0xe066('0x20')](_0xd1b4fa,_0x50528a)[_0xe066('0x21')]()[_0xe066('0x22')](function(_0x5a5090){if(_0x5a5090&&_0x5a5090[_0xe066('0x32')]){return _0x5a5090;}else{var _0x56afb3=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x2e')]){var _0x4e21d0={};_0x4e21d0[_0x483b29[_0xe066('0x2e')]]=_0x3667d5;_[_0xe066('0x2f')](_0x56afb3['$or'],_0x4e21d0);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x31'))[_0xe066('0x20')](_0x56afb3,_0x50528a)['then'](function(_0x2f3424){if(_0x2f3424&&_0x2f3424[_0xe066('0x32')]){return _0x2f3424;}else{var _0x305f98=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29['additionalSearchLead']){var _0x4a9cc4={};_0x4a9cc4[_0x483b29[_0xe066('0x33')]]=_0x3667d5;_[_0xe066('0x2f')](_0x305f98[_0xe066('0x30')],_0x4a9cc4);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x34'))[_0xe066('0x20')](_0x305f98,_0x50528a);}});}});case'contact':var _0x49f1af=_['cloneDeep'](_0xed1e14);if(_0x483b29[_0xe066('0x2e')]){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x2e')]]=_0x3667d5;_[_0xe066('0x2f')](_0x49f1af[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x31'))[_0xe066('0x20')](_0x49f1af,_0x50528a)['execute']();case _0xe066('0x1a'):var _0x389fd7=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x33')]){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x33')]]=_0x3667d5;_[_0xe066('0x2f')](_0x389fd7[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x34'))['find'](_0x389fd7,_0x50528a);case _0xe066('0x17'):var _0xd1b4fa=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x36')]){var _0x54ddc8={};_0x54ddc8[_0x483b29['additionalSearchAccount']]=_0x3667d5;_[_0xe066('0x2f')](_0xd1b4fa[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x37'))[_0xe066('0x20')](_0xd1b4fa,_0x50528a);default:return null;}})[_0xe066('0x22')](function(_0x30ca7f){if(_0x30ca7f&&_0x30ca7f[_0xe066('0x32')]){var _0x3ee8ff=_[_0xe066('0x38')](_0x30ca7f);if(_0x3ee8ff){return BPromise['resolve']({'id':_0x3ee8ff['Id'],'name':_0x3ee8ff[_0xe066('0x25')],'phone':_0x3ee8ff['Phone'],'endUserType':_0x3ee8ff[_0xe066('0x39')][_0xe066('0x3a')][_0xe066('0x3b')]()});}}})[_0xe066('0x22')](function(_0x50ded2){if(_0x50ded2){logger[_0xe066('0x26')](_0xe066('0x3c'),_0x50ded2['endUserType'],_0x3667d5);return BPromise[_0xe066('0x24')](_0x50ded2);}else{logger[_0xe066('0x26')](_0xe066('0x3d'),_0x3667d5);var _0x4f03e9={'Phone':_0x3667d5};if(_0x483b29[_0xe066('0x3e')]){if(_0x483b29['moduleCreate']===_0xe066('0x14')){logger['info'](_0xe066('0x3f'),_0x3667d5,_0x483b29['moduleCreate']);_0x4f03e9[_0xe066('0x40')]=_0x387c8b!==_0xe066('0x41')?_0x387c8b:util[_0xe066('0x42')](_0xe066('0x43'),_0x3667d5);}else if(_0x483b29[_0xe066('0x3e')]===_0xe066('0x1a')){logger[_0xe066('0x26')](_0xe066('0x3f'),_0x3667d5,_0x483b29['moduleCreate']);_0x4f03e9[_0xe066('0x40')]=_0x387c8b!==_0xe066('0x41')?_0x387c8b:util[_0xe066('0x42')]('Caller\x20-\x20%s',_0x3667d5);_0x4f03e9[_0xe066('0x44')]=_0xe066('0x45');}else if(_0x483b29['moduleCreate']===_0xe066('0x17')){logger[_0xe066('0x26')](_0xe066('0x3f'),_0x3667d5,_0x483b29[_0xe066('0x3e')]);_0x4f03e9[_0xe066('0x25')]=_0x387c8b!==_0xe066('0x41')?_0x387c8b:util[_0xe066('0x42')]('Caller\x20-\x20%s',_0x3667d5);}else{return null;}}return _0xe94c1[_0xe066('0x1c')](_[_0xe066('0x46')](_0x483b29[_0xe066('0x3e')]))[_0xe066('0x47')](_0x4f03e9)[_0xe066('0x22')](function(_0x537670){return BPromise['resolve']({'id':_0x537670['id'],'endUserType':_0x483b29[_0xe066('0x3e')]});});}});}function getCustomFields(_0x2f5e0c,_0x4a1485){var _0x185b03={};if(_0x2f5e0c[_0xe066('0x32')]>0x0){_[_0xe066('0x48')](_0x2f5e0c,function(_0x3c895d){if(_[_0xe066('0x49')](['string','picklist'],_0x3c895d[_0xe066('0x3a')])&&_0x3c895d[_0xe066('0x4a')]){_0x185b03[_0x3c895d['idField']]=_0x3c895d['content'][_0xe066('0x4b')]();}else if(_0x3c895d[_0xe066('0x3a')]==='variable'&&_0x3c895d[_0xe066('0x4c')]&&_0x3c895d['idField']){_0x4a1485[_0x3c895d[_0xe066('0x4c')]]&&(_0x185b03[_0x3c895d[_0xe066('0x4a')]]=_0x4a1485[_0x3c895d[_0xe066('0x4c')]]['toString']());}else if(_0x3c895d[_0xe066('0x3a')]===_0xe066('0x4d')&&_0x3c895d[_0xe066('0x4e')]&&_0x3c895d['Variable']['name']&&_0x3c895d[_0xe066('0x4a')]){_0x4a1485[_0x3c895d[_0xe066('0x4e')][_0xe066('0x4f')]['toLowerCase']()]&&(_0x185b03[_0x3c895d['idField']]=_0x4a1485[_0x3c895d[_0xe066('0x4e')][_0xe066('0x4f')][_0xe066('0x3b')]()][_0xe066('0x4b')]());}});}return _0x185b03;}function getConnection(_0xf7c68d){var _0x420bf3=_0xf7c68d[_0xe066('0x50')][_0xe066('0x51')](_0xf7c68d[_0xe066('0x52')]);var _0x5e3ef1=new jsforce[(_0xe066('0x53'))]({'oauth2':{'loginUrl':_0xf7c68d[_0xe066('0x54')]||'https://login.salesforce.com','clientId':_0xf7c68d[_0xe066('0x55')],'clientSecret':_0xf7c68d[_0xe066('0x56')]}});return _0x5e3ef1['login'](_0xf7c68d[_0xe066('0x57')],_0x420bf3)[_0xe066('0x22')](function(){logger['info'](_0xe066('0x58'));return _0x5e3ef1;});}exports[_0xe066('0x59')]=function(_0x309c87,_0x5a4c09,_0x5809c3,_0x471ab6,_0x537453,_0x4340cd){var _0x2ce67d,_0x7dd67a,_0x382a2f,_0x318340;_0x4340cd['serverUrl']=intUtil[_0xe066('0x5a')](_0x4340cd['serverUrl']);_0x4340cd[_0xe066('0x54')]=intUtil[_0xe066('0x5a')](_0x4340cd[_0xe066('0x54')]);if(_0x537453&&_0x537453['monitor_format']){logger[_0xe066('0x26')](_0xe066('0x5b'),'Recording\x20is\x20enabled!');_0x5a4c09[_0xe066('0x5c')]=util[_0xe066('0x42')](_0xe066('0x5d'),_0x4340cd[_0xe066('0x5e')],_0x5a4c09['uniqueid'],md5(_0x5a4c09[_0xe066('0x5f')]));}else{_0x5a4c09[_0xe066('0x5c')]='';}return getConnection(_0x4340cd)['then'](function(_0x5918e9){_0x318340=_0x5918e9;return getUser(_0x4340cd,_0x471ab6[_0xe066('0x60')],_0x318340);})['then'](function(_0x2e836f){_0x2ce67d=_0x2e836f;return getEndUser(_0x4340cd,_0x5809c3,_0x5a4c09[_0xe066('0x61')],_0x5a4c09['calleridnum'],_0x318340);})['then'](function(_0x45bbeb){_0x7dd67a=_0x45bbeb;return getTicket(_0x4340cd,_0x2ce67d,_0x7dd67a,_0x5809c3,_0x5a4c09,_0x5809c3['Fields'],_0x318340,_0xe066('0x59'));})[_0xe066('0x22')](function(_0x151b06){_0x382a2f=_0x151b06;logger['info'](_0xe066('0x62'),_0x382a2f['id']);logger[_0xe066('0x26')](_0xe066('0x63'),_0x382a2f['id'],_0x471ab6[_0xe066('0x4f')],_0x4340cd[_0xe066('0x3a')]);switch(_0x4340cd[_0xe066('0x3a')]){case _0xe066('0x64'):emit(util['format'](_0xe066('0x65'),_0x471ab6[_0xe066('0x4f')]),_0xe066('0x66'),{'recordId':_0x382a2f['id']});break;case _0xe066('0x67'):emit(util[_0xe066('0x42')](_0xe066('0x65'),_0x471ab6[_0xe066('0x4f')]),_0xe066('0x68'),{'uri':util['format']('%s/%s/e',_0x318340[_0xe066('0x69')],_0x382a2f['id'])});break;default:logger['error'](_0xe066('0x6a'));}})[_0xe066('0x6b')](function(_0x17258f){logger[_0xe066('0x6c')](_0xe066('0x5b'),_0x17258f);});};exports[_0xe066('0x6d')]=function(_0x2cd770,_0x407e79,_0x3811ba,_0x286878,_0x122fcc,_0x1f80bc,_0x3bb42c){var _0x11f6c6,_0x2b7f76,_0x16441f,_0x3af394;_0x1f80bc['serverUrl']=intUtil[_0xe066('0x5a')](_0x1f80bc['serverUrl']);_0x1f80bc[_0xe066('0x54')]=intUtil[_0xe066('0x5a')](_0x1f80bc[_0xe066('0x54')]);if(_0x3bb42c&&_0x3bb42c[_0xe066('0x6e')]&&_0x3bb42c[_0xe066('0x6e')]!=='none'){logger[_0xe066('0x26')](_0xe066('0x6f'),_0xe066('0x70'));_0x407e79[_0xe066('0x5c')]=util[_0xe066('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f80bc[_0xe066('0x5e')],_0x407e79['uniqueid'],md5(_0x407e79['uniqueid']));}return getConnection(_0x1f80bc)[_0xe066('0x22')](function(_0x402425){_0x3af394=_0x402425;return getUser(_0x1f80bc,_0x286878[_0xe066('0x60')],_0x3af394);})[_0xe066('0x22')](function(_0x2a2c8f){_0x11f6c6=_0x2a2c8f;return getEndUser(_0x1f80bc,_0x3811ba,_0x407e79[_0xe066('0x71')],_0x407e79[_0xe066('0x72')],_0x3af394);})['then'](function(_0x437bf2){_0x2b7f76=_0x437bf2;return getTicket(_0x1f80bc,_0x11f6c6,_0x2b7f76,_0x3811ba,_0x407e79,_0x3811ba[_0xe066('0x73')],_0x3af394,_0xe066('0x6d'));})[_0xe066('0x22')](function(_0x12e301){_0x16441f=_0x12e301;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x16441f['id']);logger[_0xe066('0x26')](_0xe066('0x74'),_0x16441f['id'],_0x286878[_0xe066('0x4f')],_0x1f80bc[_0xe066('0x3a')]);switch(_0x1f80bc['type']){case _0xe066('0x64'):emit(util[_0xe066('0x42')]('user:%s',_0x286878[_0xe066('0x4f')]),_0xe066('0x66'),{'recordId':_0x16441f['id']});break;case'newTab':emit(util[_0xe066('0x42')](_0xe066('0x65'),_0x286878[_0xe066('0x4f')]),_0xe066('0x68'),{'uri':util[_0xe066('0x42')](_0xe066('0x75'),_0x3af394[_0xe066('0x69')],_0x16441f['id'])});break;default:logger[_0xe066('0x6c')](_0xe066('0x6f'),_0xe066('0x76'));}})[_0xe066('0x6b')](function(_0x1b2bde){logger[_0xe066('0x6c')](_0xe066('0x6f'),_0x1b2bde);});};exports['unmanaged']=function(_0x253d99,_0x4ae8a7,_0x164061,_0x509457,_0x4d31ec,_0x25f9f8){var _0x4ecef0,_0x4b0e3f,_0x5b93ee,_0x9e56fb;_0x25f9f8[_0xe066('0x5e')]=intUtil['stripTrailingSlash'](_0x25f9f8[_0xe066('0x5e')]);_0x25f9f8[_0xe066('0x54')]=intUtil[_0xe066('0x5a')](_0x25f9f8[_0xe066('0x54')]);if(_0x4d31ec&&_0x4d31ec[_0xe066('0x77')]){logger[_0xe066('0x26')]('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+']',_0xe066('0x70'));_0x4ae8a7['recordingURL']=util['format'](_0xe066('0x5d'),_0x25f9f8['serverUrl'],_0x4ae8a7['uniqueid'],md5(_0x4ae8a7['uniqueid']));}else{_0x4ae8a7[_0xe066('0x5c')]='';}return getConnection(_0x25f9f8)['then'](function(_0x25ab95){_0x9e56fb=_0x25ab95;if(!_[_0xe066('0x1d')](_0x509457)){return getUser(_0x25f9f8,_0x509457[_0xe066('0x4f')],_0x9e56fb);}else{return getUser(_0x25f9f8,null,_0x9e56fb);}})['then'](function(_0x14e4c6){_0x4ecef0=_0x14e4c6;return getEndUser(_0x25f9f8,_0x164061,_0x4ae8a7[_0xe066('0x61')],_0x4ae8a7[_0xe066('0x7a')],_0x9e56fb);})[_0xe066('0x22')](function(_0x150f7a){_0x4b0e3f=_0x150f7a;return getTicket(_0x25f9f8,_0x4ecef0,_0x4b0e3f,_0x164061,_0x4ae8a7,_0x164061[_0xe066('0x73')],_0x9e56fb);})[_0xe066('0x22')](function(_0x811301){_0x5b93ee=_0x811301;logger['info']('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+_0xe066('0x7b'),_0x5b93ee['id']);logger['info']('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+_0xe066('0x7c'),_0x25f9f8['type']);})[_0xe066('0x6b')](function(_0x1a4e83){logger[_0xe066('0x6c')]('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+']',_0x1a4e83);});}; \ No newline at end of file +var _0x4f5b=['execute','length','find','Email','Agent\x20%s\x20found.','resolve','identity','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','moduleCreate','','format','LastName','Company','No\x20Company','upperFirst','create','forEach','includes','string','picklist','type','idField','variable','variableName','toString','Variable','name','password','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','lastevent','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','md5','jsforce','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','endUserType','WhoId','account','WhatId','Case','contact','ContactId','AccountId','lead','leadId','info','sobject','isNil','validateEmail'];(function(_0x31bf50,_0x14d03d){var _0x906bc=function(_0x25cb6e){while(--_0x25cb6e){_0x31bf50['push'](_0x31bf50['shift']());}};_0x906bc(++_0x14d03d);}(_0x4f5b,0x16a));var _0xb4f5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4f5b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb4f5('0x0'));var rp=require(_0xb4f5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xb4f5('0x2'));var jsforce=require(_0xb4f5('0x3'));var util=require('util');var Redis=require(_0xb4f5('0x4'));var intUtil=require(_0xb4f5('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb4f5('0x6'))(_0xb4f5('0x7'));config[_0xb4f5('0x8')]=_[_0xb4f5('0x9')](config[_0xb4f5('0x8')],{'host':_0xb4f5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb4f5('0x8')]));function emit(_0x38e43f,_0x5eabb9,_0x3cd339){io['to'](_0x38e43f)[_0xb4f5('0xb')](_0x5eabb9,_0x3cd339);}function getTicket(_0x42b774,_0x213d3e,_0x411832,_0x2e9fea,_0x595353,_0x104e4b,_0x2b8821,_0x420cbf){var _0x444cf9=Object[_0xb4f5('0xc')]({},{'OwnerId':_0x213d3e['id'],'Subject':intUtil[_0xb4f5('0xd')](_0x2e9fea[_0xb4f5('0xe')],_0x595353,'\x20'),'Description':intUtil['getString'](_0x2e9fea[_0xb4f5('0xf')],_0x595353,'\x0a')},getCustomFields(_0x104e4b,_0x595353));if(_0x411832){if(_0x2e9fea[_0xb4f5('0x10')]==='Task'){_0x444cf9[_0xb4f5('0x11')]=moment[_0xb4f5('0x12')]();_0x444cf9[_0xb4f5('0x13')]=![];_0x444cf9['IsRecurrence']=![];if(_0x411832[_0xb4f5('0x14')]==='contact'||_0x411832[_0xb4f5('0x14')]==='lead'){_0x444cf9[_0xb4f5('0x15')]=_0x411832['id'];}else if(_0x411832[_0xb4f5('0x14')]===_0xb4f5('0x16')){_0x444cf9[_0xb4f5('0x17')]=_0x411832['id'];}}else if(_0x2e9fea[_0xb4f5('0x10')]===_0xb4f5('0x18')){if(_0x411832['endUserType']===_0xb4f5('0x19')){_0x444cf9[_0xb4f5('0x1a')]=_0x411832['id'];}else if(_0x411832[_0xb4f5('0x14')]==='account'){_0x444cf9[_0xb4f5('0x1b')]=_0x411832['id'];}else if(_0x411832[_0xb4f5('0x14')]===_0xb4f5('0x1c')&&_0x2e9fea[_0xb4f5('0x1d')]){_0x444cf9[_0x2e9fea[_0xb4f5('0x1d')]]=_0x411832['id'];}else{logger[_0xb4f5('0x1e')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x2b8821[_0xb4f5('0x1f')](_0x2e9fea[_0xb4f5('0x10')])['create'](_0x444cf9);}function getUser(_0x24139b,_0xdc7a1,_0xb9fcf6){if(!_[_0xb4f5('0x20')](_0xdc7a1)&&intUtil[_0xb4f5('0x21')](_0xdc7a1)){var _0x131926={'Email':_0xdc7a1};var _0x385bad={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xb9fcf6['sobject']('User')['find'](_0x131926,_0x385bad)[_0xb4f5('0x22')]()['then'](function(_0x3de158){if(_0x3de158[_0xb4f5('0x23')]){var _0x582c6f=_[_0xb4f5('0x24')](_0x3de158,function(_0x18428f){return _0x18428f[_0xb4f5('0x25')]===_0xdc7a1;});if(_0x582c6f){logger['info'](_0xb4f5('0x26'),_0xdc7a1);return BPromise[_0xb4f5('0x27')]({'id':_0x582c6f['Id'],'name':_0x582c6f['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xdc7a1);return _0xb9fcf6[_0xb4f5('0x28')]()[_0xb4f5('0x29')](function(_0x412cee){return BPromise['resolve']({'id':_0x412cee[_0xb4f5('0x2a')],'name':_0x412cee[_0xb4f5('0x2b')]});});}});}else{logger[_0xb4f5('0x1e')](_0xb4f5('0x2c'),_0xdc7a1);return _0xb9fcf6[_0xb4f5('0x28')]()[_0xb4f5('0x29')](function(_0x2db8ba){return BPromise[_0xb4f5('0x27')]({'id':_0x2db8ba[_0xb4f5('0x2a')],'name':_0x2db8ba['display_name']});});}}function getEndUser(_0x3d2a34,_0x15f9a9,_0x53eb44,_0x2d4828,_0x2febc8){var _0x4189dc={'$or':{'Phone':_0x2d4828}};var _0x243a21={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb4f5('0x27')]()['then'](function(){logger[_0xb4f5('0x1e')](_0xb4f5('0x2d'),_0x2d4828,_0x15f9a9[_0xb4f5('0x2e')]);switch(_0x15f9a9[_0xb4f5('0x2e')]){case _0xb4f5('0x2f'):var _0x8da1fe=_['cloneDeep'](_0x4189dc);if(_0x15f9a9[_0xb4f5('0x30')]){var _0x26fb3e={};_0x26fb3e[_0x15f9a9['additionalSearchContact']]=_0x2d4828;_[_0xb4f5('0x31')](_0x8da1fe[_0xb4f5('0x32')],_0x26fb3e);}return _0x2febc8[_0xb4f5('0x1f')](_0xb4f5('0x33'))[_0xb4f5('0x24')](_0x8da1fe,_0x243a21)[_0xb4f5('0x22')]()[_0xb4f5('0x29')](function(_0x40576a){if(_0x40576a&&_0x40576a[_0xb4f5('0x23')]){return _0x40576a;}else{var _0x42b40a=_[_0xb4f5('0x34')](_0x4189dc);if(_0x15f9a9[_0xb4f5('0x35')]){var _0x3f3d14={};_0x3f3d14[_0x15f9a9['additionalSearchLead']]=_0x2d4828;_['merge'](_0x42b40a['$or'],_0x3f3d14);}return _0x2febc8['sobject'](_0xb4f5('0x36'))[_0xb4f5('0x24')](_0x42b40a,_0x243a21);}});case _0xb4f5('0x37'):var _0x37cfd2=_['cloneDeep'](_0x4189dc);if(_0x15f9a9[_0xb4f5('0x38')]){var _0x26fb3e={};_0x26fb3e[_0x15f9a9[_0xb4f5('0x38')]]=_0x2d4828;_[_0xb4f5('0x31')](_0x37cfd2['$or'],_0x26fb3e);}return _0x2febc8[_0xb4f5('0x1f')]('Account')[_0xb4f5('0x24')](_0x37cfd2,_0x243a21)[_0xb4f5('0x22')]()['then'](function(_0x12de7f){if(_0x12de7f&&_0x12de7f[_0xb4f5('0x23')]){return _0x12de7f;}else{var _0x2fce1c=_[_0xb4f5('0x34')](_0x4189dc);if(_0x15f9a9[_0xb4f5('0x30')]){var _0x31688c={};_0x31688c[_0x15f9a9['additionalSearchContact']]=_0x2d4828;_[_0xb4f5('0x31')](_0x2fce1c[_0xb4f5('0x32')],_0x31688c);}return _0x2febc8[_0xb4f5('0x1f')](_0xb4f5('0x33'))[_0xb4f5('0x24')](_0x2fce1c,_0x243a21)[_0xb4f5('0x29')](function(_0x85a7cf){if(_0x85a7cf&&_0x85a7cf['length']){return _0x85a7cf;}else{var _0x2f49f4=_['cloneDeep'](_0x4189dc);if(_0x15f9a9[_0xb4f5('0x35')]){var _0x13abaf={};_0x13abaf[_0x15f9a9[_0xb4f5('0x35')]]=_0x2d4828;_[_0xb4f5('0x31')](_0x2f49f4['$or'],_0x13abaf);}return _0x2febc8[_0xb4f5('0x1f')](_0xb4f5('0x36'))[_0xb4f5('0x24')](_0x2f49f4,_0x243a21);}});}});case _0xb4f5('0x19'):var _0x8da1fe=_[_0xb4f5('0x34')](_0x4189dc);if(_0x15f9a9[_0xb4f5('0x30')]){var _0x26fb3e={};_0x26fb3e[_0x15f9a9[_0xb4f5('0x30')]]=_0x2d4828;_[_0xb4f5('0x31')](_0x8da1fe[_0xb4f5('0x32')],_0x26fb3e);}return _0x2febc8[_0xb4f5('0x1f')](_0xb4f5('0x33'))[_0xb4f5('0x24')](_0x8da1fe,_0x243a21)[_0xb4f5('0x22')]();case _0xb4f5('0x1c'):var _0x57c836=_['cloneDeep'](_0x4189dc);if(_0x15f9a9['additionalSearchLead']){var _0x26fb3e={};_0x26fb3e[_0x15f9a9['additionalSearchLead']]=_0x2d4828;_['merge'](_0x57c836[_0xb4f5('0x32')],_0x26fb3e);}return _0x2febc8[_0xb4f5('0x1f')](_0xb4f5('0x36'))[_0xb4f5('0x24')](_0x57c836,_0x243a21);case _0xb4f5('0x16'):var _0x37cfd2=_[_0xb4f5('0x34')](_0x4189dc);if(_0x15f9a9[_0xb4f5('0x38')]){var _0x26fb3e={};_0x26fb3e[_0x15f9a9[_0xb4f5('0x38')]]=_0x2d4828;_[_0xb4f5('0x31')](_0x37cfd2[_0xb4f5('0x32')],_0x26fb3e);}return _0x2febc8[_0xb4f5('0x1f')](_0xb4f5('0x39'))['find'](_0x37cfd2,_0x243a21);default:return null;}})[_0xb4f5('0x29')](function(_0x390705){if(_0x390705&&_0x390705[_0xb4f5('0x23')]){var _0x136da1=_[_0xb4f5('0x3a')](_0x390705);if(_0x136da1){return BPromise[_0xb4f5('0x27')]({'id':_0x136da1['Id'],'name':_0x136da1[_0xb4f5('0x3b')],'phone':_0x136da1[_0xb4f5('0x3c')],'endUserType':_0x136da1[_0xb4f5('0x3d')]['type'][_0xb4f5('0x3e')]()});}}})['then'](function(_0xef4690){if(_0xef4690){logger[_0xb4f5('0x1e')](_0xb4f5('0x3f'),_0xef4690[_0xb4f5('0x14')],_0x2d4828);return BPromise[_0xb4f5('0x27')](_0xef4690);}else{logger['info'](_0xb4f5('0x40'),_0x2d4828);var _0x2ddc94={'Phone':_0x2d4828};if(_0x15f9a9['moduleCreate']){if(_0x15f9a9['moduleCreate']==='contact'){logger[_0xb4f5('0x1e')](_0xb4f5('0x41'),_0x2d4828,_0x15f9a9[_0xb4f5('0x42')]);_0x2ddc94['LastName']=_0x53eb44!==_0xb4f5('0x43')?_0x53eb44:util[_0xb4f5('0x44')]('Caller\x20-\x20%s',_0x2d4828);}else if(_0x15f9a9[_0xb4f5('0x42')]==='lead'){logger[_0xb4f5('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2d4828,_0x15f9a9[_0xb4f5('0x42')]);_0x2ddc94[_0xb4f5('0x45')]=_0x53eb44!==_0xb4f5('0x43')?_0x53eb44:util[_0xb4f5('0x44')]('Caller\x20-\x20%s',_0x2d4828);_0x2ddc94[_0xb4f5('0x46')]=_0xb4f5('0x47');}else if(_0x15f9a9[_0xb4f5('0x42')]===_0xb4f5('0x16')){logger[_0xb4f5('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2d4828,_0x15f9a9['moduleCreate']);_0x2ddc94['Name']=_0x53eb44!==''?_0x53eb44:util[_0xb4f5('0x44')]('Caller\x20-\x20%s',_0x2d4828);}else{return null;}}return _0x2febc8[_0xb4f5('0x1f')](_[_0xb4f5('0x48')](_0x15f9a9[_0xb4f5('0x42')]))[_0xb4f5('0x49')](_0x2ddc94)[_0xb4f5('0x29')](function(_0x32bd3c){return BPromise[_0xb4f5('0x27')]({'id':_0x32bd3c['id'],'endUserType':_0x15f9a9['moduleCreate']});});}});}function getCustomFields(_0xce1311,_0x202354){var _0x18aef2={};if(_0xce1311[_0xb4f5('0x23')]>0x0){_[_0xb4f5('0x4a')](_0xce1311,function(_0x5ca31c){if(_[_0xb4f5('0x4b')]([_0xb4f5('0x4c'),_0xb4f5('0x4d')],_0x5ca31c[_0xb4f5('0x4e')])&&_0x5ca31c['idField']){_0x18aef2[_0x5ca31c[_0xb4f5('0x4f')]]=_0x5ca31c['content']['toString']();}else if(_0x5ca31c['type']===_0xb4f5('0x50')&&_0x5ca31c[_0xb4f5('0x51')]&&_0x5ca31c[_0xb4f5('0x4f')]){_0x202354[_0x5ca31c['variableName']]&&(_0x18aef2[_0x5ca31c[_0xb4f5('0x4f')]]=_0x202354[_0x5ca31c[_0xb4f5('0x51')]][_0xb4f5('0x52')]());}else if(_0x5ca31c['type']==='customVariable'&&_0x5ca31c[_0xb4f5('0x53')]&&_0x5ca31c[_0xb4f5('0x53')][_0xb4f5('0x54')]&&_0x5ca31c[_0xb4f5('0x4f')]){_0x202354[_0x5ca31c[_0xb4f5('0x53')][_0xb4f5('0x54')][_0xb4f5('0x3e')]()]&&(_0x18aef2[_0x5ca31c[_0xb4f5('0x4f')]]=_0x202354[_0x5ca31c['Variable'][_0xb4f5('0x54')][_0xb4f5('0x3e')]()][_0xb4f5('0x52')]());}});}return _0x18aef2;}function getConnection(_0x4c8602){var _0x5f15e9=_0x4c8602[_0xb4f5('0x55')]['concat'](_0x4c8602['securityToken']);var _0x362cde=new jsforce[(_0xb4f5('0x56'))]({'oauth2':{'loginUrl':_0x4c8602['remoteUri']||_0xb4f5('0x57'),'clientId':_0x4c8602[_0xb4f5('0x58')],'clientSecret':_0x4c8602[_0xb4f5('0x59')]}});return _0x362cde[_0xb4f5('0x5a')](_0x4c8602[_0xb4f5('0x5b')],_0x5f15e9)[_0xb4f5('0x29')](function(){logger[_0xb4f5('0x1e')](_0xb4f5('0x5c'));return _0x362cde;});}exports[_0xb4f5('0x5d')]=function(_0x36d410,_0x3c7b4c,_0x4c6e61,_0x49037e,_0x36572e,_0x2a0483){var _0x4934be,_0x118821,_0x258a4b,_0x5d6c91;_0x2a0483[_0xb4f5('0x5e')]=intUtil[_0xb4f5('0x5f')](_0x2a0483[_0xb4f5('0x5e')]);_0x2a0483[_0xb4f5('0x60')]=intUtil['stripTrailingSlash'](_0x2a0483['remoteUri']);if(_0x36572e&&_0x36572e[_0xb4f5('0x61')]){logger[_0xb4f5('0x1e')](_0xb4f5('0x62'),'Recording\x20is\x20enabled!');_0x3c7b4c[_0xb4f5('0x63')]=util[_0xb4f5('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a0483[_0xb4f5('0x5e')],_0x3c7b4c[_0xb4f5('0x64')],md5(_0x3c7b4c[_0xb4f5('0x64')]));}else{_0x3c7b4c['recordingURL']='';}return getConnection(_0x2a0483)['then'](function(_0x561310){_0x5d6c91=_0x561310;return getUser(_0x2a0483,_0x49037e[_0xb4f5('0x65')],_0x5d6c91);})[_0xb4f5('0x29')](function(_0x54f1e2){_0x4934be=_0x54f1e2;return getEndUser(_0x2a0483,_0x4c6e61,_0x3c7b4c['calleridname'],_0x3c7b4c[_0xb4f5('0x66')],_0x5d6c91);})[_0xb4f5('0x29')](function(_0xc2b1e4){_0x118821=_0xc2b1e4;return getTicket(_0x2a0483,_0x4934be,_0x118821,_0x4c6e61,_0x3c7b4c,_0x4c6e61[_0xb4f5('0x67')],_0x5d6c91,_0xb4f5('0x5d'));})[_0xb4f5('0x29')](function(_0x114ab4){_0x258a4b=_0x114ab4;logger['info'](_0xb4f5('0x68'),_0x258a4b['id']);logger[_0xb4f5('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x258a4b['id'],_0x49037e['name'],_0x2a0483[_0xb4f5('0x4e')]);switch(_0x2a0483['type']){case _0xb4f5('0x69'):emit(util[_0xb4f5('0x44')](_0xb4f5('0x6a'),_0x49037e[_0xb4f5('0x54')]),_0xb4f5('0x6b'),{'recordId':_0x258a4b['id']});break;case _0xb4f5('0x6c'):emit(util[_0xb4f5('0x44')](_0xb4f5('0x6a'),_0x49037e['name']),_0xb4f5('0x6d'),{'uri':util['format'](_0xb4f5('0x6e'),_0x5d6c91['instanceUrl'],_0x258a4b['id'])});break;default:logger[_0xb4f5('0x6f')](_0xb4f5('0x70'));}})[_0xb4f5('0x71')](function(_0x359576){logger[_0xb4f5('0x6f')](_0xb4f5('0x62'),_0x359576);});};exports[_0xb4f5('0x72')]=function(_0x59696a,_0x22c286,_0x563362,_0x183051,_0x565729,_0x39b335,_0x184936){var _0x382d4d,_0x201b88,_0x287260,_0x7d7b44;_0x39b335['serverUrl']=intUtil['stripTrailingSlash'](_0x39b335['serverUrl']);_0x39b335[_0xb4f5('0x60')]=intUtil['stripTrailingSlash'](_0x39b335[_0xb4f5('0x60')]);if(_0x184936&&_0x184936[_0xb4f5('0x73')]&&_0x184936[_0xb4f5('0x73')]!==_0xb4f5('0x74')){logger[_0xb4f5('0x1e')]('[OUTBOUND]',_0xb4f5('0x75'));_0x22c286[_0xb4f5('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39b335[_0xb4f5('0x5e')],_0x22c286[_0xb4f5('0x64')],md5(_0x22c286[_0xb4f5('0x64')]));}return getConnection(_0x39b335)[_0xb4f5('0x29')](function(_0x1e5b7f){_0x7d7b44=_0x1e5b7f;return getUser(_0x39b335,_0x183051['email'],_0x7d7b44);})[_0xb4f5('0x29')](function(_0x21899b){_0x382d4d=_0x21899b;return getEndUser(_0x39b335,_0x563362,_0x22c286[_0xb4f5('0x76')],_0x22c286[_0xb4f5('0x77')],_0x7d7b44);})['then'](function(_0x595244){_0x201b88=_0x595244;return getTicket(_0x39b335,_0x382d4d,_0x201b88,_0x563362,_0x22c286,_0x563362[_0xb4f5('0x67')],_0x7d7b44,_0xb4f5('0x72'));})['then'](function(_0x3a2e6b){_0x287260=_0x3a2e6b;logger[_0xb4f5('0x1e')](_0xb4f5('0x78'),_0x287260['id']);logger['info'](_0xb4f5('0x79'),_0x287260['id'],_0x183051[_0xb4f5('0x54')],_0x39b335[_0xb4f5('0x4e')]);switch(_0x39b335[_0xb4f5('0x4e')]){case _0xb4f5('0x69'):emit(util['format'](_0xb4f5('0x6a'),_0x183051['name']),_0xb4f5('0x6b'),{'recordId':_0x287260['id']});break;case _0xb4f5('0x6c'):emit(util[_0xb4f5('0x44')]('user:%s',_0x183051[_0xb4f5('0x54')]),'trigger:browser:url',{'uri':util[_0xb4f5('0x44')](_0xb4f5('0x6e'),_0x7d7b44[_0xb4f5('0x7a')],_0x287260['id'])});break;default:logger[_0xb4f5('0x6f')]('[OUTBOUND]',_0xb4f5('0x7b'));}})['catch'](function(_0x2a6f38){logger['error'](_0xb4f5('0x7c'),_0x2a6f38);});};exports[_0xb4f5('0x7d')]=function(_0x51985c,_0x46c177,_0x3ec3c9,_0x55c794,_0x3174a7,_0x10cb50){var _0x3cad43,_0x396679,_0x8a4ea1,_0x1fcb32;_0x10cb50[_0xb4f5('0x5e')]=intUtil[_0xb4f5('0x5f')](_0x10cb50[_0xb4f5('0x5e')]);_0x10cb50[_0xb4f5('0x60')]=intUtil[_0xb4f5('0x5f')](_0x10cb50[_0xb4f5('0x60')]);if(_0x3174a7&&_0x3174a7['monitor_format']){logger[_0xb4f5('0x1e')]('['+_0x46c177[_0xb4f5('0x7e')]['toUpperCase']()+']',_0xb4f5('0x75'));_0x46c177[_0xb4f5('0x63')]=util[_0xb4f5('0x44')](_0xb4f5('0x7f'),_0x10cb50[_0xb4f5('0x5e')],_0x46c177[_0xb4f5('0x64')],md5(_0x46c177[_0xb4f5('0x64')]));}else{_0x46c177[_0xb4f5('0x63')]='';}return getConnection(_0x10cb50)[_0xb4f5('0x29')](function(_0x5e35a6){_0x1fcb32=_0x5e35a6;if(!_['isNil'](_0x55c794)){return getUser(_0x10cb50,_0x55c794[_0xb4f5('0x54')],_0x1fcb32);}else{return getUser(_0x10cb50,null,_0x1fcb32);}})['then'](function(_0x2feeb4){_0x3cad43=_0x2feeb4;return getEndUser(_0x10cb50,_0x3ec3c9,_0x46c177[_0xb4f5('0x80')],_0x46c177[_0xb4f5('0x66')],_0x1fcb32);})[_0xb4f5('0x29')](function(_0x4cf02c){_0x396679=_0x4cf02c;return getTicket(_0x10cb50,_0x3cad43,_0x396679,_0x3ec3c9,_0x46c177,_0x3ec3c9[_0xb4f5('0x67')],_0x1fcb32);})[_0xb4f5('0x29')](function(_0x56ef8e){_0x8a4ea1=_0x56ef8e;logger[_0xb4f5('0x1e')]('['+_0x46c177[_0xb4f5('0x7e')]['toUpperCase']()+_0xb4f5('0x81'),_0x8a4ea1['id']);logger[_0xb4f5('0x1e')]('['+_0x46c177[_0xb4f5('0x7e')][_0xb4f5('0x82')]()+_0xb4f5('0x83'),_0x10cb50[_0xb4f5('0x4e')]);})[_0xb4f5('0x71')](function(_0x24a8a5){logger[_0xb4f5('0x6f')]('['+_0x46c177[_0xb4f5('0x7e')][_0xb4f5('0x82')]()+']',_0x24a8a5);});}; \ 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 3600356..40e0533 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 _0x5be9=[']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','format','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','string','type','customField','toLowerCase','includes','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number'];(function(_0x33d317,_0xfdea83){var _0xd573ec=function(_0x8ea285){while(--_0x8ea285){_0x33d317['push'](_0x33d317['shift']());}};_0xd573ec(++_0xfdea83);}(_0x5be9,0xfd));var _0x95be=function(_0x316ec4,_0x9eaedb){_0x316ec4=_0x316ec4-0x0;var _0x11915b=_0x5be9[_0x316ec4];return _0x11915b;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x95be('0x0'));var util=require(_0x95be('0x1'));var md5=require(_0x95be('0x2'));var Redis=require(_0x95be('0x3'));var intUtil=require('./util');var config=require(_0x95be('0x4'));var logger=require(_0x95be('0x5'))(_0x95be('0x6'));config['redis']=_['defaults'](config[_0x95be('0x7')],{'host':_0x95be('0x8'),'port':0x18eb});var io=require(_0x95be('0x9'))(new Redis(config[_0x95be('0x7')]));function getAdminUser(_0x347ad4,_0x47de1c,_0x2c7ae0,_0xd427f7,_0x35e215,_0x2d9240){return new Promise(function(_0x701dc,_0x22ce20){var _0x1ef9c7={'method':_0x95be('0xa'),'uri':_0xd427f7+_0x95be('0xb')+'&'+_0x35e215+'&'+_0x2d9240,'auth':_0x47de1c,'json':!![]};return rp(_0x1ef9c7)[_0x95be('0xc')](function(_0x58cf9b){if(_0x58cf9b[_0x95be('0xd')][_0x95be('0xe')]>0x0){_0x2c7ae0[_0x95be('0xf')]=_0x58cf9b[_0x95be('0xd')][0x0][_0x95be('0x10')];}logger['info']('['+[_0x347ad4[_0x95be('0x11')]()]+_0x95be('0x12'),_0x2c7ae0);_0x701dc(_0x2c7ae0);})[_0x95be('0x13')](function(_0x21b517){logger['error']('['+[_0x347ad4[_0x95be('0x11')]()]+']',_0x21b517[_0x95be('0x14')]);_0x22ce20(_0x21b517[_0x95be('0x14')]);});});}function getUser(_0x131f24,_0x394e7d,_0x51d03f,_0x504dce,_0x3e6e18){return function(_0x3d6323){logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x16'),_0x3d6323);return new Promise(function(_0x569792,_0x313272){if(intUtil[_0x95be('0x17')](_0x3d6323['userEmail'])){var _0x902e8e={'method':_0x95be('0xa'),'uri':_0x51d03f+_0x95be('0x18')+_0x3d6323[_0x95be('0x19')]+'&'+_0x504dce+'&'+_0x3e6e18,'auth':_0x394e7d,'json':!![]};logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x1a'),_0x902e8e);return rp(_0x902e8e)[_0x95be('0xc')](function(_0xdec38e){logger['info']('['+[_0x131f24['toUpperCase']()]+_0x95be('0x1b'),_0xdec38e);if(_0xdec38e[_0x95be('0xd')][_0x95be('0xe')]>0x0&&String(_0xdec38e[_0x95be('0xd')][0x0]['active'])===_0x95be('0x1c')){_0x3d6323[_0x95be('0x1d')]=_0xdec38e['result'][0x0][_0x95be('0x10')];}else{_0x3d6323[_0x95be('0x1d')]=_0x3d6323[_0x95be('0xf')];_0x3d6323[_0x95be('0x19')]=_0x3d6323[_0x95be('0x1e')];}logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x1f'),_0x3d6323);_0x569792(_0x3d6323);})[_0x95be('0x13')](function(_0x4f2d61){logger['error']('['+[_0x131f24[_0x95be('0x11')]()]+']',_0x4f2d61[_0x95be('0x14')]);_0x313272(_0x4f2d61[_0x95be('0x14')]);});}else{logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x20'));_0x3d6323[_0x95be('0x1d')]=_0x3d6323[_0x95be('0xf')];_0x3d6323[_0x95be('0x19')]=_0x3d6323[_0x95be('0x1e')];_0x569792(_0x3d6323);}});};}function createEndUser(_0x4bd30d,_0x135ba0,_0x4bba1b,_0x11c825,_0x512ec5){logger[_0x95be('0x15')]('['+[_0x4bd30d[_0x95be('0x11')]()]+_0x95be('0x21'),_0x4bba1b);return new Promise(function(_0x5f2659,_0x496319){var _0x1da3e5={'method':_0x95be('0x22'),'uri':_0x11c825+_0x95be('0x23')+_0x512ec5,'body':{'user_name':_0x4bba1b[_0x95be('0x24')],'roles':'user','first_name':_0x4bba1b['endUserNumber'],'active':_0x95be('0x1c'),'date_format':_0x95be('0x25'),'phone':_0x4bba1b[_0x95be('0x24')]},'auth':_0x135ba0,'json':!![]};return rp(_0x1da3e5)[_0x95be('0xc')](function(_0x49f8b5){logger[_0x95be('0x15')]('['+[_0x4bd30d[_0x95be('0x11')]()]+_0x95be('0x26'),_0x49f8b5['result']);_0x4bba1b[_0x95be('0x27')]=_0x49f8b5[_0x95be('0xd')][_0x95be('0x10')];_0x5f2659(_0x4bba1b);})[_0x95be('0x13')](function(_0x5e1a81){logger[_0x95be('0x28')]('['+[_0x4bd30d[_0x95be('0x11')]()]+']',_0x5e1a81[_0x95be('0x14')]);_0x496319(_0x5e1a81[_0x95be('0x14')]);});});}function getEndUser(_0x192c53,_0x47df2d,_0x2b83ea,_0x33a4f0,_0x4123a5){return function(_0x5a3f7e){logger[_0x95be('0x15')]('['+[_0x192c53[_0x95be('0x11')]()]+_0x95be('0x29'),_0x5a3f7e);return new Promise(function(_0x104168,_0xdc229d){var _0xa6fdf4={'method':_0x95be('0xa'),'uri':_0x2b83ea+_0x95be('0x2a')+_0x5a3f7e['endUserNumber']+'&'+_0x33a4f0+'&'+_0x4123a5,'auth':_0x47df2d,'json':!![]};return rp(_0xa6fdf4)['then'](function(_0x2ede52){if(_0x2ede52[_0x95be('0xd')][_0x95be('0xe')]>0x0){_0x5a3f7e['endUserId']=_0x2ede52[_0x95be('0xd')][0x0][_0x95be('0x10')];logger[_0x95be('0x15')]('['+[_0x192c53[_0x95be('0x11')]()]+'],\x20getEndUser\x20crm',_0x5a3f7e);_0x104168(_0x5a3f7e);}else{return createEndUser(_0x192c53,_0x47df2d,_0x5a3f7e,_0x2b83ea,_0x33a4f0)[_0x95be('0xc')](function(_0x527c19){logger[_0x95be('0x15')]('['+[_0x192c53['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x527c19);_0x104168(_0x527c19);});}})[_0x95be('0x13')](function(_0x5938aa){logger[_0x95be('0x28')]('['+[_0x192c53[_0x95be('0x11')]()]+']',_0x5938aa[_0x95be('0x14')]);_0xdc229d(_0x5938aa[_0x95be('0x14')]);});});};}function getCustomFields(_0x186416,_0x4db845){var _0x4a28af={};if(_0x186416[_0x95be('0xe')]>0x0){_['forEach'](_0x186416,function(_0x5ee897){if(_['includes']([_0x95be('0x2b'),'picklist'],_0x5ee897[_0x95be('0x2c')])&&_0x5ee897['nameField']&&!_0x5ee897[_0x95be('0x2d')]){_0x4a28af[_0x5ee897['nameField'][_0x95be('0x2e')]()]=_0x5ee897['content']['toString']();}else if(_[_0x95be('0x2f')](['string',_0x95be('0x30')],_0x5ee897[_0x95be('0x2c')])&&_0x5ee897[_0x95be('0x31')]&&_0x5ee897[_0x95be('0x2d')]){_0x4a28af[_0x5ee897[_0x95be('0x31')][_0x95be('0x2e')]()]=_0x5ee897[_0x95be('0x32')][_0x95be('0x33')]();}else if(_0x5ee897[_0x95be('0x2c')]===_0x95be('0x34')&&_0x5ee897[_0x95be('0x35')]&&_0x5ee897['idField']&&_0x5ee897['customField']){_0x4a28af[_0x5ee897[_0x95be('0x31')][_0x95be('0x2e')]()]=_0x4db845[_0x5ee897[_0x95be('0x35')]][_0x95be('0x33')]();}else if(_0x5ee897[_0x95be('0x2c')]===_0x95be('0x36')&&_0x5ee897[_0x95be('0x37')]&&_0x5ee897[_0x95be('0x37')][_0x95be('0x38')]&&_0x5ee897[_0x95be('0x31')]&&_0x5ee897[_0x95be('0x2d')]){_0x4a28af[_0x5ee897[_0x95be('0x31')][_0x95be('0x2e')]()]=_0x4db845[_0x5ee897['Variable'][_0x95be('0x38')]['toLowerCase']()][_0x95be('0x33')]();}});}return _0x4a28af;}function getTicket(_0x5929d5,_0x54b6b9,_0x21ec48,_0x1045d6,_0x52aca8,_0x2331da){return function(_0x4896e4){logger['info']('['+[_0x5929d5['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x4896e4);return new Promise(function(_0x386aef,_0x558f21){var _0x3ad50f=_0x5929d5[_0x95be('0x2e')]()===_0x95be('0x39')?_0x4896e4[_0x95be('0x1d')]:_0x4896e4[_0x95be('0x27')];var _0x35a604={'method':'POST','uri':_0x21ec48+_0x95be('0x3a')+'?'+_0x2331da,'body':Object[_0x95be('0x3b')]({},{'active':_0x95be('0x1c'),'caller_id':_0x3ad50f,'assigned_to':_0x4896e4[_0x95be('0x1d')],'short_description':intUtil[_0x95be('0x3c')](_0x1045d6[_0x95be('0x3d')],_0x52aca8,'\x20'),'description':intUtil[_0x95be('0x3c')](_0x1045d6[_0x95be('0x3e')],_0x52aca8,'\x0a')},getCustomFields(_0x1045d6[_0x95be('0x3f')],_0x52aca8)),'auth':_0x54b6b9,'json':!![]};return rp(_0x35a604)['then'](function(_0x33ca78){logger[_0x95be('0x15')]('['+[_0x5929d5[_0x95be('0x11')]()]+_0x95be('0x40'),_0x33ca78[_0x95be('0xd')]);_0x4896e4[_0x95be('0x41')]=_0x33ca78[_0x95be('0xd')][_0x95be('0x10')];_0x4896e4[_0x95be('0x42')]=_0x33ca78[_0x95be('0xd')][_0x95be('0x43')];logger[_0x95be('0x15')]('['+[_0x5929d5[_0x95be('0x11')]()]+_0x95be('0x44'),_0x4896e4);_0x386aef(_0x4896e4);})[_0x95be('0x13')](function(_0x7f71ac){logger[_0x95be('0x28')]('['+[_0x5929d5[_0x95be('0x11')]()]+']',_0x7f71ac[_0x95be('0x14')]);_0x558f21(_0x7f71ac['message']);});});};}function createRemoteTag(_0x4fd5b7,_0x1fd509,_0x5e980b,_0xfd7f8e){return new Promise(function(_0x1ed19d,_0x21dfb7){var _0x1d4f5c={'method':_0x95be('0x22'),'uri':_0x5e980b+'label'+'?'+_0xfd7f8e,'body':{'short_description':_0x4fd5b7,'global':!![],'active':!![],'name':_0x4fd5b7},'auth':_0x1fd509,'json':!![]};return rp(_0x1d4f5c)[_0x95be('0xc')](function(_0x2cccd9){var _0xc199b8=_0x2cccd9[_0x95be('0xd')]['sys_id'];_0x1ed19d(_0xc199b8);});});}function getRemoteTag(_0x5e46b1,_0x2b08af,_0x15aec1,_0xc778f3,_0x1110aa){return new Promise(function(_0x48ec0c,_0x14c2f2){var _0x5acf30={'method':'GET','uri':_0x15aec1+_0x95be('0x45')+_0x95be('0x46')+_0x5e46b1+'&'+_0xc778f3,'auth':_0x2b08af,'json':!![]};return rp(_0x5acf30)['then'](function(_0x281ef1){if(_0x281ef1['result']['length']>0x0){var _0x5081a8=_0x281ef1['result'][0x0]['sys_id'];_0x48ec0c(_0x5081a8);}else{return createRemoteTag(_0x5e46b1,_0x2b08af,_0x15aec1,_0xc778f3)[_0x95be('0xc')](function(_0x3fb3a2){_0x48ec0c(_0x3fb3a2);});}});});}function assignTagToIncident(_0x12c504,_0x2a1822,_0x5b4edc,_0x370423,_0x1b32cc){return new Promise(function(_0x2a7cc5,_0x3317eb){var _0x227f86={'method':_0x95be('0x22'),'uri':_0x5b4edc+'label_entry'+'?'+_0x1b32cc,'body':{'label':_0x12c504,'table':_0x95be('0x3a'),'id_type':_0x95be('0x47'),'table_key':_0x370423['ticketId'],'title':'Incident\x20-\x20'+_0x370423['ticketNumber'],'id_display':_0x370423[_0x95be('0x42')]},'auth':_0x2a1822,'json':!![]};return rp(_0x227f86)[_0x95be('0xc')](function(_0x1ec558){_0x2a7cc5();})[_0x95be('0x13')](function(){_0x2a7cc5();});});}function manageTags(_0x1482a6,_0x3f7d11,_0x574d02,_0x3ae97a,_0x1e9688,_0x28f4ef,_0x53926d){return new Promise(function(_0x39df47,_0x100f56){var _0x62ebc1=[];_0x3f7d11[_0x95be('0x48')](function(_0x1eacca){_0x62ebc1[_0x95be('0x49')](getRemoteTag(_0x1eacca,_0x574d02,_0x3ae97a,_0x28f4ef,_0x53926d));});return Promise[_0x95be('0x4a')](_0x62ebc1)[_0x95be('0xc')](function(_0x3860fa){if(_0x3860fa[_0x95be('0xe')]){logger['info']('['+[_0x1482a6['toUpperCase']()]+_0x95be('0x4b'),_0x3860fa);var _0x53e750=[];_0x3860fa[_0x95be('0x48')](function(_0x39b978){_0x53e750[_0x95be('0x49')](assignTagToIncident(_0x39b978,_0x574d02,_0x3ae97a,_0x1e9688,_0x28f4ef));});return Promise['all'](_0x53e750)['then'](function(){_0x39df47();})['catch'](function(){_0x39df47();});}else{_0x39df47();}});});}function getTags(_0x2aeb9f,_0x51891e,_0x3ba458,_0x85a34d,_0x382b9a,_0x32e711){return function(_0x163379){return new Promise(function(_0x37968d,_0x23b877){var _0x5e31b7=[];var _0x56da32=_0x85a34d['Tags'];if(_0x56da32&&_0x56da32[_0x95be('0xe')]>0x0){_0x5e31b7=_['map'](_0x56da32,_0x95be('0x38'));}if(_0x5e31b7[_0x95be('0xe')]>0x0){return manageTags(_0x2aeb9f,_0x5e31b7,_0x51891e,_0x3ba458,_0x163379,_0x382b9a,_0x32e711)[_0x95be('0xc')](function(){_0x37968d(_0x163379);});}else{_0x37968d(_0x163379);}});};}function emit(_0x4decbb,_0x1dce29,_0x1c850e){var _0x23e591=_0x95be('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x95be('0x4d')+'%255EORDERBYDESCnumber';var _0x2a3e0d={'uri':_0x4decbb+_0x95be('0x4e')+_0x1c850e+_0x23e591};io['to'](util['format']('user:%s',_0x1dce29))[_0x95be('0x4f')]('trigger:browser:url',_0x2a3e0d);}exports['cs']=function(_0x2e2c9c,_0x5daac8,_0x5a31e2,_0x175ca4,_0x5e09be,_0x136d6f,_0x27778c,_0x346db3){var _0x12daf0={};var _0x23f260={'user':_0x136d6f[_0x95be('0x50')],'pass':_0x136d6f[_0x95be('0x51')]};var _0x19d9fe=_0x95be('0x52');var _0x1ce849=_0x95be('0x53');_0x136d6f['remoteUri']=intUtil[_0x95be('0x54')](_0x136d6f[_0x95be('0x55')]);_0x136d6f[_0x95be('0x56')]=intUtil['stripTrailingSlash'](_0x136d6f[_0x95be('0x56')]);var _0x3f0b41=util['format'](_0x95be('0x57'),_0x136d6f[_0x95be('0x55')]);_0x12daf0[_0x95be('0x19')]=!_['isNil'](_0x175ca4)?_0x175ca4[_0x95be('0x58')]:null;_0x12daf0[_0x95be('0x1e')]=_0x136d6f[_0x95be('0x58')];_0x12daf0[_0x95be('0x24')]=_0x346db3[_0x95be('0x2e')]()===_0x95be('0x39')?_0x5daac8[_0x95be('0x59')]:_0x5daac8[_0x95be('0x5a')];_0x12daf0['callDirection']=_0x346db3===_0x95be('0x5b')||_0x346db3===_0x95be('0x5c')?_0x95be('0x5b'):_0x95be('0x39');var _0x377837=util['format'](_0x95be('0x5d'),_0x136d6f['serverUrl'],_0x5daac8[_0x95be('0x5e')],md5(_0x5daac8[_0x95be('0x5e')]));if(_0x5e09be&&_0x5e09be[_0x95be('0x5f')]){logger[_0x95be('0x15')]('[QUEUE]',_0x95be('0x60'));_0x5daac8['recordingURL']=_0x377837;}else if(_0x27778c&&_0x27778c[_0x95be('0x61')]&&_0x27778c[_0x95be('0x61')]!==_0x95be('0x62')){logger[_0x95be('0x15')](_0x95be('0x63'),_0x95be('0x60'));_0x5daac8[_0x95be('0x64')]=_0x377837;}else{_0x5daac8[_0x95be('0x64')]='';}return getAdminUser(_0x346db3,_0x23f260,_0x12daf0,_0x3f0b41,_0x1ce849,_0x19d9fe)['then'](getUser(_0x346db3,_0x23f260,_0x3f0b41,_0x1ce849,_0x19d9fe))[_0x95be('0xc')](getEndUser(_0x346db3,_0x23f260,_0x3f0b41,_0x1ce849,_0x19d9fe))[_0x95be('0xc')](getTicket(_0x346db3,_0x23f260,_0x3f0b41,_0x5a31e2,_0x5daac8,_0x1ce849))[_0x95be('0xc')](function(_0x5e8a49){logger['info'](util[_0x95be('0x65')](_0x95be('0x66'),_0x5e8a49['ticketId']));logger[_0x95be('0x15')](util[_0x95be('0x65')](_0x95be('0x67'),_0x346db3));if(_0x346db3!==_0x95be('0x5c')){logger[_0x95be('0x15')]('['+[_0x346db3[_0x95be('0x11')]()]+']',_0x95be('0x68'));emit(_0x136d6f[_0x95be('0x55')],_0x175ca4[_0x95be('0x38')],_0x5e8a49['ticketId']);}})[_0x95be('0x13')](function(_0x1e065f){logger[_0x95be('0x28')]('['+[_0x346db3[_0x95be('0x11')]()]+_0x95be('0x69'),util[_0x95be('0x6a')](_0x1e065f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9fa2=['customField','toLowerCase','toString','picklist','type','idField','content','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','true','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','serverUrl','%s/api/now/table/','remoteUri','isNil','email','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','info','toUpperCase','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','length','active','userId','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','string'];(function(_0x4128dc,_0xf49703){var _0x3902ae=function(_0x358fc4){while(--_0x358fc4){_0x4128dc['push'](_0x4128dc['shift']());}};_0x3902ae(++_0xf49703);}(_0x9fa2,0x104));var _0x29fa=function(_0x2c3255,_0x4e00ae){_0x2c3255=_0x2c3255-0x0;var _0x282aba=_0x9fa2[_0x2c3255];return _0x282aba;};'use strict';var _=require(_0x29fa('0x0'));var Promise=require(_0x29fa('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0x29fa('0x2'));var Redis=require(_0x29fa('0x3'));var intUtil=require('./util');var config=require(_0x29fa('0x4'));var logger=require(_0x29fa('0x5'))(_0x29fa('0x6'));config[_0x29fa('0x7')]=_[_0x29fa('0x8')](config[_0x29fa('0x7')],{'host':_0x29fa('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x29b962,_0x2efcd9,_0x53d1cb,_0x3b0579,_0x46ae41,_0x52d1e1){return new Promise(function(_0x24382d,_0xd7fa53){var _0x24b7a4={'method':_0x29fa('0xa'),'uri':_0x3b0579+_0x29fa('0xb')+'&'+_0x46ae41+'&'+_0x52d1e1,'auth':_0x2efcd9,'json':!![]};return rp(_0x24b7a4)['then'](function(_0x19ffd2){if(_0x19ffd2[_0x29fa('0xc')]['length']>0x0){_0x53d1cb[_0x29fa('0xd')]=_0x19ffd2[_0x29fa('0xc')][0x0][_0x29fa('0xe')];}logger[_0x29fa('0xf')]('['+[_0x29b962[_0x29fa('0x10')]()]+'],\x20getAdminUser\x20crm',_0x53d1cb);_0x24382d(_0x53d1cb);})['catch'](function(_0x556e92){logger[_0x29fa('0x11')]('['+[_0x29b962['toUpperCase']()]+']',_0x556e92[_0x29fa('0x12')]);_0xd7fa53(_0x556e92[_0x29fa('0x12')]);});});}function getUser(_0x59fe63,_0x4e8082,_0x3551e2,_0x4462f7,_0x2a4d77){return function(_0x4d8d1a){logger['info']('['+[_0x59fe63['toUpperCase']()]+_0x29fa('0x13'),_0x4d8d1a);return new Promise(function(_0x246ef2,_0x2e806c){if(intUtil[_0x29fa('0x14')](_0x4d8d1a[_0x29fa('0x15')])){var _0xcb5796={'method':_0x29fa('0xa'),'uri':_0x3551e2+_0x29fa('0x16')+_0x4d8d1a[_0x29fa('0x15')]+'&'+_0x4462f7+'&'+_0x2a4d77,'auth':_0x4e8082,'json':!![]};logger[_0x29fa('0xf')]('['+[_0x59fe63[_0x29fa('0x10')]()]+_0x29fa('0x17'),_0xcb5796);return rp(_0xcb5796)[_0x29fa('0x18')](function(_0x1b1708){logger[_0x29fa('0xf')]('['+[_0x59fe63['toUpperCase']()]+_0x29fa('0x19'),_0x1b1708);if(_0x1b1708[_0x29fa('0xc')][_0x29fa('0x1a')]>0x0&&String(_0x1b1708[_0x29fa('0xc')][0x0][_0x29fa('0x1b')])==='true'){_0x4d8d1a[_0x29fa('0x1c')]=_0x1b1708['result'][0x0][_0x29fa('0xe')];}else{_0x4d8d1a[_0x29fa('0x1c')]=_0x4d8d1a[_0x29fa('0xd')];_0x4d8d1a['userEmail']=_0x4d8d1a['adminEmail'];}logger[_0x29fa('0xf')]('['+[_0x59fe63[_0x29fa('0x10')]()]+_0x29fa('0x1d'),_0x4d8d1a);_0x246ef2(_0x4d8d1a);})[_0x29fa('0x1e')](function(_0x255d07){logger[_0x29fa('0x11')]('['+[_0x59fe63[_0x29fa('0x10')]()]+']',_0x255d07[_0x29fa('0x12')]);_0x2e806c(_0x255d07[_0x29fa('0x12')]);});}else{logger[_0x29fa('0xf')]('['+[_0x59fe63[_0x29fa('0x10')]()]+_0x29fa('0x1f'));_0x4d8d1a[_0x29fa('0x1c')]=_0x4d8d1a[_0x29fa('0xd')];_0x4d8d1a[_0x29fa('0x15')]=_0x4d8d1a[_0x29fa('0x20')];_0x246ef2(_0x4d8d1a);}});};}function createEndUser(_0x3630ed,_0x364e12,_0x4ad13b,_0x2bd71c,_0x5968ea){logger[_0x29fa('0xf')]('['+[_0x3630ed['toUpperCase']()]+_0x29fa('0x21'),_0x4ad13b);return new Promise(function(_0x10b62b,_0x503945){var _0x5ca8f8={'method':_0x29fa('0x22'),'uri':_0x2bd71c+_0x29fa('0x23')+_0x5968ea,'body':{'user_name':_0x4ad13b[_0x29fa('0x24')],'roles':_0x29fa('0x25'),'first_name':_0x4ad13b[_0x29fa('0x24')],'active':'true','date_format':'System','phone':_0x4ad13b[_0x29fa('0x24')]},'auth':_0x364e12,'json':!![]};return rp(_0x5ca8f8)[_0x29fa('0x18')](function(_0x18171a){logger[_0x29fa('0xf')]('['+[_0x3630ed[_0x29fa('0x10')]()]+_0x29fa('0x26'),_0x18171a[_0x29fa('0xc')]);_0x4ad13b[_0x29fa('0x27')]=_0x18171a[_0x29fa('0xc')][_0x29fa('0xe')];_0x10b62b(_0x4ad13b);})[_0x29fa('0x1e')](function(_0x5a6ed8){logger[_0x29fa('0x11')]('['+[_0x3630ed[_0x29fa('0x10')]()]+']',_0x5a6ed8['message']);_0x503945(_0x5a6ed8[_0x29fa('0x12')]);});});}function getEndUser(_0x58b5c9,_0x3c54bc,_0x530900,_0x275aab,_0xf84f46){return function(_0x105d76){logger[_0x29fa('0xf')]('['+[_0x58b5c9['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x105d76);return new Promise(function(_0x34ddb2,_0x5b1591){var _0x2a210d={'method':_0x29fa('0xa'),'uri':_0x530900+_0x29fa('0x28')+_0x105d76[_0x29fa('0x24')]+'&'+_0x275aab+'&'+_0xf84f46,'auth':_0x3c54bc,'json':!![]};return rp(_0x2a210d)[_0x29fa('0x18')](function(_0x4e7a78){if(_0x4e7a78[_0x29fa('0xc')][_0x29fa('0x1a')]>0x0){_0x105d76[_0x29fa('0x27')]=_0x4e7a78[_0x29fa('0xc')][0x0][_0x29fa('0xe')];logger[_0x29fa('0xf')]('['+[_0x58b5c9[_0x29fa('0x10')]()]+'],\x20getEndUser\x20crm',_0x105d76);_0x34ddb2(_0x105d76);}else{return createEndUser(_0x58b5c9,_0x3c54bc,_0x105d76,_0x530900,_0x275aab)[_0x29fa('0x18')](function(_0x36ebed){logger[_0x29fa('0xf')]('['+[_0x58b5c9[_0x29fa('0x10')]()]+_0x29fa('0x29'),_0x36ebed);_0x34ddb2(_0x36ebed);});}})[_0x29fa('0x1e')](function(_0x4a0fe3){logger['error']('['+[_0x58b5c9[_0x29fa('0x10')]()]+']',_0x4a0fe3[_0x29fa('0x12')]);_0x5b1591(_0x4a0fe3[_0x29fa('0x12')]);});});};}function getCustomFields(_0x2ed9b8,_0x5a0ba4){var _0x2da941={};if(_0x2ed9b8['length']>0x0){_['forEach'](_0x2ed9b8,function(_0xf3dc31){if(_['includes']([_0x29fa('0x2a'),'picklist'],_0xf3dc31['type'])&&_0xf3dc31['nameField']&&!_0xf3dc31[_0x29fa('0x2b')]){_0x2da941[_0xf3dc31['nameField'][_0x29fa('0x2c')]()]=_0xf3dc31['content'][_0x29fa('0x2d')]();}else if(_['includes']([_0x29fa('0x2a'),_0x29fa('0x2e')],_0xf3dc31[_0x29fa('0x2f')])&&_0xf3dc31[_0x29fa('0x30')]&&_0xf3dc31[_0x29fa('0x2b')]){_0x2da941[_0xf3dc31[_0x29fa('0x30')][_0x29fa('0x2c')]()]=_0xf3dc31[_0x29fa('0x31')]['toString']();}else if(_0xf3dc31[_0x29fa('0x2f')]==='variable'&&_0xf3dc31[_0x29fa('0x32')]&&_0xf3dc31[_0x29fa('0x30')]&&_0xf3dc31['customField']){_0x2da941[_0xf3dc31[_0x29fa('0x30')][_0x29fa('0x2c')]()]=_0x5a0ba4[_0xf3dc31[_0x29fa('0x32')]]['toString']();}else if(_0xf3dc31[_0x29fa('0x2f')]==='customVariable'&&_0xf3dc31[_0x29fa('0x33')]&&_0xf3dc31[_0x29fa('0x33')][_0x29fa('0x34')]&&_0xf3dc31[_0x29fa('0x30')]&&_0xf3dc31[_0x29fa('0x2b')]){_0x2da941[_0xf3dc31[_0x29fa('0x30')]['toLowerCase']()]=_0x5a0ba4[_0xf3dc31[_0x29fa('0x33')][_0x29fa('0x34')][_0x29fa('0x2c')]()]['toString']();}});}return _0x2da941;}function getTicket(_0x509d73,_0x35851c,_0x109a11,_0x3812b7,_0x2000d9,_0x468ec9){return function(_0x27704d){logger[_0x29fa('0xf')]('['+[_0x509d73[_0x29fa('0x10')]()]+_0x29fa('0x35'),_0x27704d);return new Promise(function(_0x63b0e5,_0x5a7ebf){var _0x2f988a=_0x509d73[_0x29fa('0x2c')]()===_0x29fa('0x36')?_0x27704d['userId']:_0x27704d['endUserId'];var _0x5d348c={'method':_0x29fa('0x22'),'uri':_0x109a11+_0x29fa('0x37')+'?'+_0x468ec9,'body':Object[_0x29fa('0x38')]({},{'active':_0x29fa('0x39'),'caller_id':_0x2f988a,'assigned_to':_0x27704d[_0x29fa('0x1c')],'short_description':intUtil['getString'](_0x3812b7[_0x29fa('0x3a')],_0x2000d9,'\x20'),'description':intUtil[_0x29fa('0x3b')](_0x3812b7[_0x29fa('0x3c')],_0x2000d9,'\x0a')},getCustomFields(_0x3812b7[_0x29fa('0x3d')],_0x2000d9)),'auth':_0x35851c,'json':!![]};return rp(_0x5d348c)[_0x29fa('0x18')](function(_0x53c61){logger[_0x29fa('0xf')]('['+[_0x509d73[_0x29fa('0x10')]()]+_0x29fa('0x3e'),_0x53c61[_0x29fa('0xc')]);_0x27704d[_0x29fa('0x3f')]=_0x53c61[_0x29fa('0xc')][_0x29fa('0xe')];_0x27704d[_0x29fa('0x40')]=_0x53c61[_0x29fa('0xc')]['number'];logger[_0x29fa('0xf')]('['+[_0x509d73['toUpperCase']()]+_0x29fa('0x41'),_0x27704d);_0x63b0e5(_0x27704d);})['catch'](function(_0x55c726){logger[_0x29fa('0x11')]('['+[_0x509d73['toUpperCase']()]+']',_0x55c726['message']);_0x5a7ebf(_0x55c726[_0x29fa('0x12')]);});});};}function createRemoteTag(_0x14ce77,_0x16a004,_0x2c1ff6,_0x15006c){return new Promise(function(_0x1ed0a3,_0x21e9ed){var _0x51b2ab={'method':_0x29fa('0x22'),'uri':_0x2c1ff6+_0x29fa('0x42')+'?'+_0x15006c,'body':{'short_description':_0x14ce77,'global':!![],'active':!![],'name':_0x14ce77},'auth':_0x16a004,'json':!![]};return rp(_0x51b2ab)[_0x29fa('0x18')](function(_0x2d6859){var _0x1deb49=_0x2d6859[_0x29fa('0xc')][_0x29fa('0xe')];_0x1ed0a3(_0x1deb49);});});}function getRemoteTag(_0x6287a1,_0x2bc410,_0x28c9ec,_0xe3d8a4,_0x2145ab){return new Promise(function(_0x127b17,_0xc144a4){var _0x57170d={'method':_0x29fa('0xa'),'uri':_0x28c9ec+_0x29fa('0x42')+_0x29fa('0x43')+_0x6287a1+'&'+_0xe3d8a4,'auth':_0x2bc410,'json':!![]};return rp(_0x57170d)[_0x29fa('0x18')](function(_0x37be99){if(_0x37be99[_0x29fa('0xc')][_0x29fa('0x1a')]>0x0){var _0x292504=_0x37be99[_0x29fa('0xc')][0x0]['sys_id'];_0x127b17(_0x292504);}else{return createRemoteTag(_0x6287a1,_0x2bc410,_0x28c9ec,_0xe3d8a4)['then'](function(_0x4e14f0){_0x127b17(_0x4e14f0);});}});});}function assignTagToIncident(_0x29d3dc,_0x9769a2,_0x252441,_0x10785e,_0x537f41){return new Promise(function(_0x14b75a,_0x24429f){var _0x33f2de={'method':'POST','uri':_0x252441+'label_entry'+'?'+_0x537f41,'body':{'label':_0x29d3dc,'table':'incident','id_type':_0x29fa('0x44'),'table_key':_0x10785e['ticketId'],'title':_0x29fa('0x45')+_0x10785e['ticketNumber'],'id_display':_0x10785e[_0x29fa('0x40')]},'auth':_0x9769a2,'json':!![]};return rp(_0x33f2de)[_0x29fa('0x18')](function(_0x1a134e){_0x14b75a();})[_0x29fa('0x1e')](function(){_0x14b75a();});});}function manageTags(_0xa224f5,_0x2b4545,_0xac15d,_0x41d40e,_0x148803,_0x1961d7,_0x4e0a29){return new Promise(function(_0x10bcbe,_0x435568){var _0x109aac=[];_0x2b4545[_0x29fa('0x46')](function(_0xb1d4de){_0x109aac[_0x29fa('0x47')](getRemoteTag(_0xb1d4de,_0xac15d,_0x41d40e,_0x1961d7,_0x4e0a29));});return Promise[_0x29fa('0x48')](_0x109aac)[_0x29fa('0x18')](function(_0x278a33){if(_0x278a33[_0x29fa('0x1a')]){logger['info']('['+[_0xa224f5[_0x29fa('0x10')]()]+_0x29fa('0x49'),_0x278a33);var _0x4832e6=[];_0x278a33[_0x29fa('0x46')](function(_0xf0ec44){_0x4832e6[_0x29fa('0x47')](assignTagToIncident(_0xf0ec44,_0xac15d,_0x41d40e,_0x148803,_0x1961d7));});return Promise['all'](_0x4832e6)[_0x29fa('0x18')](function(){_0x10bcbe();})['catch'](function(){_0x10bcbe();});}else{_0x10bcbe();}});});}function getTags(_0x4494f6,_0x2eaec8,_0x1afc31,_0x2e999a,_0x8b0c1d,_0x378744){return function(_0x5d7db5){return new Promise(function(_0x405eaf,_0x1942fa){var _0x393e8c=[];var _0x2a5195=_0x2e999a['Tags'];if(_0x2a5195&&_0x2a5195[_0x29fa('0x1a')]>0x0){_0x393e8c=_['map'](_0x2a5195,_0x29fa('0x34'));}if(_0x393e8c['length']>0x0){return manageTags(_0x4494f6,_0x393e8c,_0x2eaec8,_0x1afc31,_0x5d7db5,_0x8b0c1d,_0x378744)[_0x29fa('0x18')](function(){_0x405eaf(_0x5d7db5);});}else{_0x405eaf(_0x5d7db5);}});};}function emit(_0x17ab3f,_0x8722dd,_0x233ad2){var _0x4953ca='%26sysparm_record_target%3Dincident'+_0x29fa('0x4a')+_0x29fa('0x4b')+'%255EORDERBYDESCnumber';var _0x20ed9b={'uri':_0x17ab3f+_0x29fa('0x4c')+_0x233ad2+_0x4953ca};io['to'](util[_0x29fa('0x4d')]('user:%s',_0x8722dd))['emit']('trigger:browser:url',_0x20ed9b);}exports['cs']=function(_0x322b06,_0x3c0194,_0x5803f3,_0x116169,_0x2b69db,_0x4e20c6,_0x3c265e,_0x3e8c9d){var _0x3e7118={};var _0x4c4711={'user':_0x4e20c6[_0x29fa('0x4e')],'pass':_0x4e20c6[_0x29fa('0x4f')]};var _0x4af79e=_0x29fa('0x50');var _0xfbef24=_0x29fa('0x51');_0x4e20c6['remoteUri']=intUtil[_0x29fa('0x52')](_0x4e20c6['remoteUri']);_0x4e20c6[_0x29fa('0x53')]=intUtil[_0x29fa('0x52')](_0x4e20c6[_0x29fa('0x53')]);var _0x1558f1=util['format'](_0x29fa('0x54'),_0x4e20c6[_0x29fa('0x55')]);_0x3e7118[_0x29fa('0x15')]=!_[_0x29fa('0x56')](_0x116169)?_0x116169['email']:null;_0x3e7118[_0x29fa('0x20')]=_0x4e20c6[_0x29fa('0x57')];_0x3e7118[_0x29fa('0x24')]=_0x3e8c9d[_0x29fa('0x2c')]()===_0x29fa('0x36')?_0x3c0194[_0x29fa('0x58')]:_0x3c0194[_0x29fa('0x59')];_0x3e7118[_0x29fa('0x5a')]=_0x3e8c9d==='queue'||_0x3e8c9d==='unmanaged'?'queue':_0x29fa('0x36');var _0xe09b25=util[_0x29fa('0x4d')](_0x29fa('0x5b'),_0x4e20c6[_0x29fa('0x53')],_0x3c0194[_0x29fa('0x5c')],md5(_0x3c0194[_0x29fa('0x5c')]));if(_0x2b69db&&_0x2b69db['monitor_format']){logger[_0x29fa('0xf')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3c0194['recordingURL']=_0xe09b25;}else if(_0x3c265e&&_0x3c265e[_0x29fa('0x5d')]&&_0x3c265e[_0x29fa('0x5d')]!==_0x29fa('0x5e')){logger[_0x29fa('0xf')](_0x29fa('0x5f'),_0x29fa('0x60'));_0x3c0194[_0x29fa('0x61')]=_0xe09b25;}else{_0x3c0194[_0x29fa('0x61')]='';}return getAdminUser(_0x3e8c9d,_0x4c4711,_0x3e7118,_0x1558f1,_0xfbef24,_0x4af79e)['then'](getUser(_0x3e8c9d,_0x4c4711,_0x1558f1,_0xfbef24,_0x4af79e))[_0x29fa('0x18')](getEndUser(_0x3e8c9d,_0x4c4711,_0x1558f1,_0xfbef24,_0x4af79e))[_0x29fa('0x18')](getTicket(_0x3e8c9d,_0x4c4711,_0x1558f1,_0x5803f3,_0x3c0194,_0xfbef24))['then'](function(_0x2438a4){logger[_0x29fa('0xf')](util[_0x29fa('0x4d')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2438a4[_0x29fa('0x3f')]));logger[_0x29fa('0xf')](util[_0x29fa('0x4d')](_0x29fa('0x62'),_0x3e8c9d));if(_0x3e8c9d!==_0x29fa('0x63')){logger['info']('['+[_0x3e8c9d[_0x29fa('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4e20c6[_0x29fa('0x55')],_0x116169[_0x29fa('0x34')],_0x2438a4[_0x29fa('0x3f')]);}})[_0x29fa('0x1e')](function(_0x483f15){logger[_0x29fa('0x11')]('['+[_0x3e8c9d[_0x29fa('0x10')]()]+_0x29fa('0x64'),util['inspect'](_0x483f15,{'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 93c041c..65ce978 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 _0x901f=['variable','custom_fields','type','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','lastevent','toUpperCase','Ticket\x20created!','error','lodash','bluebird','md5','util','ioredis','./util','sugarcrm','defaults','socket.io-emitter','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','Calls','format','apiKey','toString','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','nameField','customField','toLowerCase','content','string','idField'];(function(_0x4d4ea4,_0x5ed1a6){var _0x17d839=function(_0x32f743){while(--_0x32f743){_0x4d4ea4['push'](_0x4d4ea4['shift']());}};_0x17d839(++_0x5ed1a6);}(_0x901f,0x1ae));var _0xf901=function(_0x56011a,_0x391365){_0x56011a=_0x56011a-0x0;var _0x55be12=_0x901f[_0x56011a];return _0x55be12;};'use strict';var _=require(_0xf901('0x0'));var rp=require('request-promise');var BPromise=require(_0xf901('0x1'));var md5=require(_0xf901('0x2'));var util=require(_0xf901('0x3'));var Redis=require(_0xf901('0x4'));var intUtil=require(_0xf901('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf901('0x6'));config['redis']=_[_0xf901('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf901('0x8'))(new Redis(config[_0xf901('0x9')]));var def={'method':_0xf901('0xa'),'json':!![]};function emit(_0x785e77,_0x1f04fc,_0x2a1432){io['to'](_0x785e77)[_0xf901('0xb')](_0x1f04fc,_0x2a1432);}function getTicket(_0x2902ea,_0x3807e4,_0x101a16,_0x4bb454,_0x19e0c6,_0xec2ef9,_0x107fc7,_0x312cc7){logger[_0xf901('0xc')](_0xf901('0xd'));var _0x4e94db=new Date();var _0x20f130=[{'name':_0xf901('0xe'),'value':intUtil[_0xf901('0xf')](_0x4bb454[_0xf901('0x10')],_0x19e0c6,'\x20')},{'name':_0xf901('0x11'),'value':_0x3807e4['id']},{'name':_0xf901('0x12'),'value':_0x3807e4['id']},{'name':_0xf901('0x13'),'value':intUtil[_0xf901('0xf')](_0x4bb454[_0xf901('0x14')],_0x19e0c6,'\x0a')},{'name':'date_start','value':_0x4e94db[_0xf901('0x15')]()['slice'](0x0,0x13)[_0xf901('0x16')]('T','\x20')},{'name':_0xf901('0x17'),'value':'0'},{'name':_0xf901('0x18'),'value':'15'},{'name':_0xf901('0x19'),'value':_0x101a16['id']},{'name':_0xf901('0x1a'),'value':'Contacts'},{'name':_0xf901('0x1b'),'value':_0x101a16[_0xf901('0xe')]},{'name':_0xf901('0x1c'),'value':_0x312cc7}];if(_0xec2ef9[_0xf901('0x1d')]){_[_0xf901('0x1e')](_0xec2ef9,function(_0x5d8d49){if(_0x19e0c6[_0x5d8d49[_0xf901('0x1f')]]){_0x20f130[_0xf901('0x20')]({'name':_0x5d8d49['idField'],'value':_0x19e0c6[_0x5d8d49[_0xf901('0x1f')]]});}});}return request({'form':{'method':_0xf901('0x21'),'input_type':'JSON','response_type':_0xf901('0x22'),'rest_data':JSON['stringify']({'session':_0x107fc7['id'],'module_name':_0xf901('0x23'),'name_value_list':_0x20f130})}});}function getAuth(_0x40ff57){return util[_0xf901('0x24')]('Basic\x20%s',new Buffer(_0x40ff57[_0xf901('0x25')]+':X')[_0xf901('0x26')]('base64'));}function getServerInfo(_0x98cf26){return request({'form':{'method':'get_server_info','input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x98cf26['id']})}});}function getUser(_0x4acf02,_0x25ea9e,_0x3d0359){if(!_[_0xf901('0x28')](_0x25ea9e)){logger[_0xf901('0xc')](_0xf901('0x29'),_0x25ea9e);return request({'form':{'method':_0xf901('0x2a'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x3d0359['id'],'module_name':_0xf901('0x2b'),'query':util[_0xf901('0x24')](_0xf901('0x2c'),_0x25ea9e),'order_by':'','offset':'0','select_fields':['id',_0xf901('0xe'),_0xf901('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5addb7){if(_0x5addb7[_0xf901('0x2e')][_0xf901('0x1d')]){var _0x29d71e=_[_0xf901('0x2f')](_0x5addb7[_0xf901('0x2e')],function(_0x28ae6d){return _0x28ae6d[_0xf901('0x30')][_0xf901('0x2d')][_0xf901('0x31')]===_0x25ea9e;});if(_0x29d71e){logger[_0xf901('0xc')](_0xf901('0x32'));return BPromise['resolve']({'id':_0x29d71e[_0xf901('0x30')]['id'][_0xf901('0x31')],'name':_0x29d71e[_0xf901('0x30')][_0xf901('0xe')][_0xf901('0x31')]});}}logger[_0xf901('0xc')](_0xf901('0x33'));return BPromise['resolve']({'id':_0x3d0359[_0xf901('0x30')]['user_id'][_0xf901('0x31')],'name':_0x3d0359[_0xf901('0x30')][_0xf901('0x2d')][_0xf901('0x31')]});});}else{logger[_0xf901('0xc')](_0xf901('0x34'));return BPromise[_0xf901('0x35')]({'id':_0x3d0359[_0xf901('0x30')]['user_id'][_0xf901('0x31')],'name':_0x3d0359[_0xf901('0x30')]['user_name'][_0xf901('0x31')]});}}function getEndUser(_0x508d73,_0x4220ac,_0x80cdcb,_0x16ed6){logger[_0xf901('0xc')]('Searching\x20enduser\x20with\x20phone',_0x80cdcb);return request({'form':{'method':'get_entry_list','input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x16ed6['id'],'module_name':_0xf901('0x36'),'query':util[_0xf901('0x24')](_0xf901('0x37'),_0x80cdcb),'order_by':'','offset':'0','select_fields':['id',_0xf901('0xe'),_0xf901('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x36a598){if(_0x36a598['entry_list']['length']){var _0x2e209e=_[_0xf901('0x2f')](_0x36a598[_0xf901('0x2e')],function(_0x2bdd0f){return _0x2bdd0f[_0xf901('0x30')][_0xf901('0x38')]['value']===_0x80cdcb;});if(_0x2e209e){logger['info'](_0xf901('0x39'));return BPromise[_0xf901('0x35')]({'id':_0x2e209e['name_value_list']['id'][_0xf901('0x31')],'name':_0x2e209e[_0xf901('0x30')][_0xf901('0xe')]['value'],'phone':_0x2e209e[_0xf901('0x30')]['phone_home'][_0xf901('0x31')]});}}else{logger[_0xf901('0xc')](_0xf901('0x3a'));return request({'form':{'method':_0xf901('0x21'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON['stringify']({'session':_0x16ed6['id'],'module_name':_0xf901('0x36'),'name_value_list':[{'name':_0xf901('0x3b'),'value':_0x4220ac!==_0xf901('0x3c')?_0x4220ac:util[_0xf901('0x24')](_0xf901('0x3d'),_0x80cdcb)},{'name':_0xf901('0x38'),'value':_0x80cdcb}]})}})[_0xf901('0x3e')](function(_0xf5aeb8){logger[_0xf901('0xc')](_0xf901('0x3f'));return BPromise[_0xf901('0x35')]({'id':_0xf5aeb8['id'],'name':_0xf5aeb8['entry_list'][_0xf901('0x3b')][_0xf901('0x31')],'phone':_0xf5aeb8['entry_list'][_0xf901('0x38')][_0xf901('0x31')]});});}});}function request(_0x2ce4b1){logger[_0xf901('0x40')](_0xf901('0x41'),JSON[_0xf901('0x27')](_0x2ce4b1));return rp(_[_0xf901('0x42')](def,_0x2ce4b1));}function getTags(_0x3a708a,_0x22285c){var _0x6ee4ec=[];if(_0x3a708a&&_0x3a708a[_0xf901('0x1d')]>0x0){_0x6ee4ec=_[_0xf901('0x43')](_0x3a708a,_0x22285c);}return _0x6ee4ec;}function getCustomFields(_0x30c19d,_0x1db2ed){var _0x3dae5e=[];var _0x203fd3={'custom_fields':[]};if(_0x30c19d['length']>0x0){_[_0xf901('0x1e')](_0x30c19d,function(_0x44a746){if(_0x44a746['type']==='string'&&_0x44a746[_0xf901('0x44')]&&!_0x44a746[_0xf901('0x45')]){_0x203fd3[_0x44a746[_0xf901('0x44')][_0xf901('0x46')]()]=_0x44a746[_0xf901('0x47')][_0xf901('0x26')]();}else if(_0x44a746['type']===_0xf901('0x48')&&_0x44a746[_0xf901('0x49')]&&_0x44a746['customField']){_0x203fd3['custom_fields'][_0xf901('0x20')]({'id':_0x44a746['idField'],'value':_0x44a746['content'][_0xf901('0x26')]()});}else if(_0x44a746['type']===_0xf901('0x4a')&&_0x44a746[_0xf901('0x1f')]&&_0x44a746['idField']&&_0x44a746[_0xf901('0x45')]){_0x1db2ed[_0x44a746['variableName']]&&_0x203fd3[_0xf901('0x4b')][_0xf901('0x20')]({'id':_0x44a746[_0xf901('0x49')],'value':_0x1db2ed[_0x44a746[_0xf901('0x1f')]]['toString']()});}else if(_0x44a746[_0xf901('0x4c')]===_0xf901('0x4d')&&_0x44a746['Variable']&&_0x44a746[_0xf901('0x4e')][_0xf901('0xe')]&&_0x44a746[_0xf901('0x49')]&&_0x44a746[_0xf901('0x45')]){_0x1db2ed[_0x44a746['Variable'][_0xf901('0xe')][_0xf901('0x46')]()]&&_0x203fd3['custom_fields'][_0xf901('0x20')]({'id':_0x44a746[_0xf901('0x49')],'value':_0x1db2ed[_0x44a746[_0xf901('0x4e')][_0xf901('0xe')]['toLowerCase']()]['toString']()});}});}return _0x203fd3;}function getConnection(_0x300f18){return request({'method':'POST','form':{'method':_0xf901('0x4f'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'user_auth':{'user_name':_0x300f18[_0xf901('0x50')],'password':_0x300f18['password'],'encryption':_0xf901('0x51')},'application':_0xf901('0x52')})}})[_0xf901('0x3e')](function(_0x3470f1){var _0x109971=_0x3470f1;if(_0x109971['id']){def['sessionID']=_0x109971['id'];return BPromise['resolve'](_0x109971);}else{throw new Error(util[_0xf901('0x24')](_0xf901('0x53'),_0x300f18['id']));}});}function setRelationship(_0x3f0721,_0x364212,_0x35f5f0,_0x132f42){return request({'form':{'method':_0xf901('0x54'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x3f0721['id'],'module_name':_0xf901('0x23'),'module_id':_0x35f5f0['id'],'link_field_name':_0x132f42,'related_ids':[_0x364212['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xf901('0x55')]=function(_0x237b1a,_0x8450af,_0x1e2095,_0x53bfdf,_0x16a186,_0xca21ca){var _0x1ed923,_0x14fbf7,_0x5d21fe,_0x24374f;_0xca21ca[_0xf901('0x56')]=intUtil[_0xf901('0x57')](_0xca21ca['remoteUri']);_0xca21ca[_0xf901('0x58')]=intUtil['stripTrailingSlash'](_0xca21ca['serverUrl']);def[_0xf901('0x59')]=util['format']('%s/service/v4_1/rest.php',_0xca21ca[_0xf901('0x56')]);if(_0x16a186&&_0x16a186[_0xf901('0x5a')]){logger['info'](_0xf901('0x5b'),_0xf901('0x5c'));_0x8450af[_0xf901('0x5d')]=util['format'](_0xf901('0x5e'),_0xca21ca['serverUrl'],_0x8450af[_0xf901('0x5f')],md5(_0x8450af['uniqueid']));}else{_0x8450af[_0xf901('0x5d')]='';}return getConnection(_0xca21ca)['then'](function(_0x248ff1){_0x24374f=_0x248ff1;return getUser(_0xca21ca,_0x53bfdf[_0xf901('0xe')],_0x24374f);})['then'](function(_0x9df7a7){_0x1ed923=_0x9df7a7;logger['info']('The\x20User\x20ID\x20is:',_0x1ed923['id']);return getEndUser(_0xca21ca,_0x8450af[_0xf901('0x60')],_0x8450af[_0xf901('0x61')],_0x24374f);})[_0xf901('0x3e')](function(_0x5c2e8a){_0x14fbf7=_0x5c2e8a;logger[_0xf901('0xc')](_0xf901('0x62'),_0x14fbf7['id']);return getTicket(_0xca21ca,_0x1ed923,_0x14fbf7,_0x1e2095,_0x8450af,_0x1e2095[_0xf901('0x63')],_0x24374f,_0xf901('0x64'));})[_0xf901('0x3e')](function(_0x1a587e){_0x5d21fe=_0x1a587e;logger[_0xf901('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5d21fe['id']);return setRelationship(_0x24374f,_0x1ed923,_0x5d21fe,_0xf901('0x65'));})[_0xf901('0x3e')](function(){return setRelationship(_0x24374f,_0x14fbf7,_0x5d21fe,_0xf901('0x66'));})[_0xf901('0x3e')](function(){return getServerInfo(_0x24374f);})[_0xf901('0x3e')](function(_0x88e4b3){var _0x3d88a4=parseInt(_0x88e4b3[_0xf901('0x67')][_0xf901('0x68')](0x0));var _0x51e761=util['format'](_0xf901('0x69'),_0xca21ca['remoteUri'],_0x5d21fe['id']);if(_0x3d88a4>0x6){_0x51e761=util[_0xf901('0x24')](_0xf901('0x6a'),_0xca21ca[_0xf901('0x56')],_0x5d21fe['id']);}logger[_0xf901('0xc')](_0xf901('0x5b'),_0xf901('0x6b'));emit(util['format'](_0xf901('0x6c'),_0x53bfdf[_0xf901('0xe')]),_0xf901('0x6d'),{'uri':_0x51e761});})[_0xf901('0x6e')](function(_0x16dc66){logger['error'](_0xf901('0x5b'),JSON[_0xf901('0x27')](_0x16dc66));});};exports[_0xf901('0x6f')]=function(_0x2de000,_0x2e79ea,_0x18754c,_0x4818e2,_0x178cd3,_0x5a1bd5,_0xc253c){var _0x148bfb,_0x201e16,_0x1feae0,_0x3f5d0f;_0x5a1bd5['remoteUri']=intUtil['stripTrailingSlash'](_0x5a1bd5[_0xf901('0x56')]);_0x5a1bd5['serverUrl']=intUtil[_0xf901('0x57')](_0x5a1bd5[_0xf901('0x58')]);def[_0xf901('0x59')]=util[_0xf901('0x24')](_0xf901('0x70'),_0x5a1bd5[_0xf901('0x56')]);if(_0xc253c&&_0xc253c[_0xf901('0x71')]&&_0xc253c[_0xf901('0x71')]!==_0xf901('0x72')){logger[_0xf901('0xc')]('[OUTBOUND]',_0xf901('0x5c'));_0x2e79ea[_0xf901('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a1bd5[_0xf901('0x58')],_0x2e79ea[_0xf901('0x5f')],md5(_0x2e79ea[_0xf901('0x5f')]));}return getConnection(_0x5a1bd5)[_0xf901('0x3e')](function(_0x1a8af4){_0x3f5d0f=_0x1a8af4;return getUser(_0x5a1bd5,_0x4818e2[_0xf901('0xe')],_0x3f5d0f);})[_0xf901('0x3e')](function(_0x14e7b7){_0x148bfb=_0x14e7b7;logger[_0xf901('0xc')](_0xf901('0x73'),_0x148bfb['id']);return getEndUser(_0x5a1bd5,_0x2e79ea[_0xf901('0x74')],_0x2e79ea[_0xf901('0x75')],_0x3f5d0f);})[_0xf901('0x3e')](function(_0x5ace93){_0x201e16=_0x5ace93;logger[_0xf901('0xc')](_0xf901('0x62'),_0x201e16['id']);return getTicket(_0x5a1bd5,_0x148bfb,_0x201e16,_0x18754c,_0x2e79ea,_0x18754c['Fields'],_0x3f5d0f,_0xf901('0x76'));})[_0xf901('0x3e')](function(_0x2f5966){_0x1feae0=_0x2f5966;logger[_0xf901('0xc')]('Ticket\x20created!');logger[_0xf901('0xc')](_0xf901('0x77'),_0x1feae0['id']);return setRelationship(_0x3f5d0f,_0x148bfb,_0x1feae0,_0xf901('0x65'));})[_0xf901('0x3e')](function(){return setRelationship(_0x3f5d0f,_0x201e16,_0x1feae0,_0xf901('0x66'));})[_0xf901('0x3e')](function(){return getServerInfo(_0x3f5d0f);})[_0xf901('0x3e')](function(_0x2e0f88){var _0x1ecb8f=parseInt(_0x2e0f88[_0xf901('0x67')][_0xf901('0x68')](0x0));var _0x43eae3=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x5a1bd5['remoteUri'],_0x1feae0['id']);if(_0x1ecb8f>0x6){_0x43eae3=util[_0xf901('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5a1bd5[_0xf901('0x56')],_0x1feae0['id']);}logger['info'](_0xf901('0x78'),_0xf901('0x6b'));emit(util[_0xf901('0x24')](_0xf901('0x6c'),_0x4818e2[_0xf901('0xe')]),'trigger:browser:url',{'uri':_0x43eae3});})[_0xf901('0x6e')](function(_0x11a8e0){logger['error']('[OUTBOUND]',JSON[_0xf901('0x27')](_0x11a8e0));});};exports[_0xf901('0x79')]=function(_0x3dc61e,_0x54938b,_0x19727b,_0x5bcac5,_0x40ae44,_0x192cd9){var _0x446890,_0x18ee9f,_0x1c3298,_0x4633bf;_0x192cd9[_0xf901('0x56')]=intUtil[_0xf901('0x57')](_0x192cd9[_0xf901('0x56')]);_0x192cd9[_0xf901('0x58')]=intUtil[_0xf901('0x57')](_0x192cd9['serverUrl']);def[_0xf901('0x59')]=util[_0xf901('0x24')](_0xf901('0x70'),_0x192cd9['remoteUri']);if(_0x40ae44&&_0x40ae44['monitor_format']){logger['info']('['+_0x54938b[_0xf901('0x7a')][_0xf901('0x7b')]()+']','Recording\x20is\x20enabled!');_0x54938b['recordingURL']=util[_0xf901('0x24')](_0xf901('0x5e'),_0x192cd9[_0xf901('0x58')],_0x54938b[_0xf901('0x5f')],md5(_0x54938b[_0xf901('0x5f')]));}else{_0x54938b[_0xf901('0x5d')]='';}return getConnection(_0x192cd9)[_0xf901('0x3e')](function(_0x4684d6){_0x4633bf=_0x4684d6;if(!_[_0xf901('0x28')](_0x5bcac5)){return getUser(_0x192cd9,_0x5bcac5[_0xf901('0xe')],_0x4633bf);}else{return getUser(_0x192cd9,null,_0x4633bf);}})['then'](function(_0x35e509){_0x446890=_0x35e509;logger[_0xf901('0xc')](_0xf901('0x73'),_0x446890['id']);return getEndUser(_0x192cd9,_0x54938b[_0xf901('0x60')],_0x54938b[_0xf901('0x61')],_0x4633bf);})[_0xf901('0x3e')](function(_0x3b4f4b){_0x18ee9f=_0x3b4f4b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x18ee9f['id']);return getTicket(_0x192cd9,_0x446890,_0x18ee9f,_0x19727b,_0x54938b,_0x19727b[_0xf901('0x63')],_0x4633bf,_0xf901('0x64'));})['then'](function(_0xe164d5){_0x1c3298=_0xe164d5;logger[_0xf901('0xc')](_0xf901('0x7c'));logger[_0xf901('0xc')](_0xf901('0x77'),_0x1c3298['id']);return setRelationship(_0x4633bf,_0x446890,_0x1c3298,_0xf901('0x65'));})[_0xf901('0x3e')](function(){return setRelationship(_0x4633bf,_0x18ee9f,_0x1c3298,'contacts');})['then'](function(){return getServerInfo(_0x4633bf);})[_0xf901('0x6e')](function(_0x5020bb){logger[_0xf901('0x7d')]('['+_0x54938b[_0xf901('0x7a')][_0xf901('0x7b')]()+']',JSON[_0xf901('0x27')](_0x5020bb));});}; \ No newline at end of file +var _0x9e10=['password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','uri','%s/service/v4_1/rest.php','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridname','Inbound','request-promise','md5','util','ioredis','./util','sugarcrm','redis','localhost','socket.io-emitter','emit','info','getString','Subjects','assigned_user_id','created_by','description','Descriptions','slice','replace','duration_hours','parent_name','length','variableName','push','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','entry_list','Agent\x20found!','resolve','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','stringify','contacts.phone_home\x20=\x20\x22%s\x22','find','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','map','forEach','type','string','customField','nameField','content','toString','idField','custom_fields','variable','customVariable','Variable','toLowerCase','login','username'];(function(_0x37a45b,_0x1056ef){var _0x35f3bb=function(_0x5d73cd){while(--_0x5d73cd){_0x37a45b['push'](_0x37a45b['shift']());}};_0x35f3bb(++_0x1056ef);}(_0x9e10,0x185));var _0x09e1=function(_0x41e589,_0x28c7e9){_0x41e589=_0x41e589-0x0;var _0x1d345f=_0x9e10[_0x41e589];return _0x1d345f;};'use strict';var _=require('lodash');var rp=require(_0x09e1('0x0'));var BPromise=require('bluebird');var md5=require(_0x09e1('0x1'));var util=require(_0x09e1('0x2'));var Redis=require(_0x09e1('0x3'));var intUtil=require(_0x09e1('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x09e1('0x5'));config['redis']=_['defaults'](config[_0x09e1('0x6')],{'host':_0x09e1('0x7'),'port':0x18eb});var io=require(_0x09e1('0x8'))(new Redis(config[_0x09e1('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x2f7bdf,_0x4c0613,_0x565593){io['to'](_0x2f7bdf)[_0x09e1('0x9')](_0x4c0613,_0x565593);}function getTicket(_0x569d08,_0x58dd9b,_0x5bc81d,_0x2cd437,_0x214449,_0x3f67ea,_0x21d17c,_0x2e6ca3){logger[_0x09e1('0xa')]('Creating\x20new\x20ticket...');var _0x3b79f2=new Date();var _0x450984=[{'name':'name','value':intUtil[_0x09e1('0xb')](_0x2cd437[_0x09e1('0xc')],_0x214449,'\x20')},{'name':_0x09e1('0xd'),'value':_0x58dd9b['id']},{'name':_0x09e1('0xe'),'value':_0x58dd9b['id']},{'name':_0x09e1('0xf'),'value':intUtil[_0x09e1('0xb')](_0x2cd437[_0x09e1('0x10')],_0x214449,'\x0a')},{'name':'date_start','value':_0x3b79f2['toISOString']()[_0x09e1('0x11')](0x0,0x13)[_0x09e1('0x12')]('T','\x20')},{'name':_0x09e1('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x5bc81d['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x09e1('0x14'),'value':_0x5bc81d['name']},{'name':'direction','value':_0x2e6ca3}];if(_0x3f67ea[_0x09e1('0x15')]){_['forEach'](_0x3f67ea,function(_0x4ad29b){if(_0x214449[_0x4ad29b[_0x09e1('0x16')]]){_0x450984[_0x09e1('0x17')]({'name':_0x4ad29b['idField'],'value':_0x214449[_0x4ad29b[_0x09e1('0x16')]]});}});}return request({'form':{'method':_0x09e1('0x18'),'input_type':_0x09e1('0x19'),'response_type':_0x09e1('0x19'),'rest_data':JSON['stringify']({'session':_0x21d17c['id'],'module_name':_0x09e1('0x1a'),'name_value_list':_0x450984})}});}function getAuth(_0x380900){return util[_0x09e1('0x1b')](_0x09e1('0x1c'),new Buffer(_0x380900[_0x09e1('0x1d')]+':X')['toString'](_0x09e1('0x1e')));}function getServerInfo(_0x55b379){return request({'form':{'method':_0x09e1('0x1f'),'input_type':_0x09e1('0x19'),'response_type':_0x09e1('0x19'),'rest_data':JSON['stringify']({'session':_0x55b379['id']})}});}function getUser(_0x350f0a,_0x24db1b,_0x4ca656){if(!_['isNil'](_0x24db1b)){logger[_0x09e1('0xa')](_0x09e1('0x20'),_0x24db1b);return request({'form':{'method':_0x09e1('0x21'),'input_type':_0x09e1('0x19'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4ca656['id'],'module_name':_0x09e1('0x22'),'query':util[_0x09e1('0x1b')](_0x09e1('0x23'),_0x24db1b),'order_by':'','offset':'0','select_fields':['id',_0x09e1('0x24'),_0x09e1('0x25')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x09e1('0x26')](function(_0x43c4d7){if(_0x43c4d7[_0x09e1('0x27')][_0x09e1('0x15')]){var _0x22b5dd=_['find'](_0x43c4d7[_0x09e1('0x27')],function(_0x4857d6){return _0x4857d6['name_value_list'][_0x09e1('0x25')]['value']===_0x24db1b;});if(_0x22b5dd){logger[_0x09e1('0xa')](_0x09e1('0x28'));return BPromise[_0x09e1('0x29')]({'id':_0x22b5dd[_0x09e1('0x2a')]['id'][_0x09e1('0x2b')],'name':_0x22b5dd[_0x09e1('0x2a')][_0x09e1('0x24')][_0x09e1('0x2b')]});}}logger['info'](_0x09e1('0x2c'));return BPromise[_0x09e1('0x29')]({'id':_0x4ca656[_0x09e1('0x2a')][_0x09e1('0x2d')]['value'],'name':_0x4ca656[_0x09e1('0x2a')]['user_name'][_0x09e1('0x2b')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x4ca656['name_value_list'][_0x09e1('0x2d')][_0x09e1('0x2b')],'name':_0x4ca656[_0x09e1('0x2a')][_0x09e1('0x25')]['value']});}}function getEndUser(_0x3d1cf3,_0xc68cb0,_0x303b4c,_0x5bd26c){logger[_0x09e1('0xa')]('Searching\x20enduser\x20with\x20phone',_0x303b4c);return request({'form':{'method':_0x09e1('0x21'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x09e1('0x2e')]({'session':_0x5bd26c['id'],'module_name':'Contacts','query':util['format'](_0x09e1('0x2f'),_0x303b4c),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x09e1('0x26')](function(_0x40079d){if(_0x40079d[_0x09e1('0x27')][_0x09e1('0x15')]){var _0x14fd65=_[_0x09e1('0x30')](_0x40079d[_0x09e1('0x27')],function(_0xe6de43){return _0xe6de43['name_value_list']['phone_home']['value']===_0x303b4c;});if(_0x14fd65){logger[_0x09e1('0xa')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x14fd65[_0x09e1('0x2a')]['id'][_0x09e1('0x2b')],'name':_0x14fd65['name_value_list']['name'][_0x09e1('0x2b')],'phone':_0x14fd65[_0x09e1('0x2a')][_0x09e1('0x31')][_0x09e1('0x2b')]});}}else{logger[_0x09e1('0xa')](_0x09e1('0x32'));return request({'form':{'method':_0x09e1('0x18'),'input_type':_0x09e1('0x19'),'response_type':'JSON','rest_data':JSON[_0x09e1('0x2e')]({'session':_0x5bd26c['id'],'module_name':'Contacts','name_value_list':[{'name':_0x09e1('0x33'),'value':_0xc68cb0!==_0x09e1('0x34')?_0xc68cb0:util[_0x09e1('0x1b')](_0x09e1('0x35'),_0x303b4c)},{'name':_0x09e1('0x31'),'value':_0x303b4c}]})}})[_0x09e1('0x26')](function(_0xbea9f8){logger[_0x09e1('0xa')](_0x09e1('0x36'));return BPromise['resolve']({'id':_0xbea9f8['id'],'name':_0xbea9f8[_0x09e1('0x27')][_0x09e1('0x33')]['value'],'phone':_0xbea9f8['entry_list'][_0x09e1('0x31')][_0x09e1('0x2b')]});});}});}function request(_0x180f00){logger['debug']('[HTTP]',JSON['stringify'](_0x180f00));return rp(_['merge'](def,_0x180f00));}function getTags(_0x2a1035,_0x2781f3){var _0xdea336=[];if(_0x2a1035&&_0x2a1035[_0x09e1('0x15')]>0x0){_0xdea336=_[_0x09e1('0x37')](_0x2a1035,_0x2781f3);}return _0xdea336;}function getCustomFields(_0x5df16b,_0x331925){var _0x2a558e=[];var _0x39fc1a={'custom_fields':[]};if(_0x5df16b[_0x09e1('0x15')]>0x0){_[_0x09e1('0x38')](_0x5df16b,function(_0xb12717){if(_0xb12717[_0x09e1('0x39')]===_0x09e1('0x3a')&&_0xb12717['nameField']&&!_0xb12717[_0x09e1('0x3b')]){_0x39fc1a[_0xb12717[_0x09e1('0x3c')]['toLowerCase']()]=_0xb12717[_0x09e1('0x3d')][_0x09e1('0x3e')]();}else if(_0xb12717[_0x09e1('0x39')]===_0x09e1('0x3a')&&_0xb12717[_0x09e1('0x3f')]&&_0xb12717['customField']){_0x39fc1a[_0x09e1('0x40')][_0x09e1('0x17')]({'id':_0xb12717[_0x09e1('0x3f')],'value':_0xb12717[_0x09e1('0x3d')][_0x09e1('0x3e')]()});}else if(_0xb12717[_0x09e1('0x39')]===_0x09e1('0x41')&&_0xb12717[_0x09e1('0x16')]&&_0xb12717[_0x09e1('0x3f')]&&_0xb12717[_0x09e1('0x3b')]){_0x331925[_0xb12717[_0x09e1('0x16')]]&&_0x39fc1a[_0x09e1('0x40')][_0x09e1('0x17')]({'id':_0xb12717['idField'],'value':_0x331925[_0xb12717['variableName']][_0x09e1('0x3e')]()});}else if(_0xb12717[_0x09e1('0x39')]===_0x09e1('0x42')&&_0xb12717['Variable']&&_0xb12717[_0x09e1('0x43')][_0x09e1('0x24')]&&_0xb12717['idField']&&_0xb12717[_0x09e1('0x3b')]){_0x331925[_0xb12717['Variable']['name'][_0x09e1('0x44')]()]&&_0x39fc1a[_0x09e1('0x40')]['push']({'id':_0xb12717[_0x09e1('0x3f')],'value':_0x331925[_0xb12717[_0x09e1('0x43')][_0x09e1('0x24')]['toLowerCase']()][_0x09e1('0x3e')]()});}});}return _0x39fc1a;}function getConnection(_0x2d2faf){return request({'method':'POST','form':{'method':_0x09e1('0x45'),'input_type':'JSON','response_type':_0x09e1('0x19'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2d2faf[_0x09e1('0x46')],'password':_0x2d2faf[_0x09e1('0x47')],'encryption':_0x09e1('0x48')},'application':_0x09e1('0x49')})}})[_0x09e1('0x26')](function(_0x2b9679){var _0x4b3355=_0x2b9679;if(_0x4b3355['id']){def[_0x09e1('0x4a')]=_0x4b3355['id'];return BPromise[_0x09e1('0x29')](_0x4b3355);}else{throw new Error(util[_0x09e1('0x1b')](_0x09e1('0x4b'),_0x2d2faf['id']));}});}function setRelationship(_0xc8c6e4,_0x55ee69,_0x6f34f0,_0xaccda2){return request({'form':{'method':_0x09e1('0x4c'),'input_type':_0x09e1('0x19'),'response_type':'JSON','rest_data':JSON[_0x09e1('0x2e')]({'session':_0xc8c6e4['id'],'module_name':_0x09e1('0x1a'),'module_id':_0x6f34f0['id'],'link_field_name':_0xaccda2,'related_ids':[_0x55ee69['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x09e1('0x4d')]=function(_0x4a4960,_0x1d3999,_0x398f14,_0x5a527e,_0x569cdc,_0x4bbc21){var _0x5db07e,_0x3c121d,_0x15f99e,_0x5c27cb;_0x4bbc21[_0x09e1('0x4e')]=intUtil[_0x09e1('0x4f')](_0x4bbc21[_0x09e1('0x4e')]);_0x4bbc21['serverUrl']=intUtil[_0x09e1('0x4f')](_0x4bbc21['serverUrl']);def[_0x09e1('0x50')]=util[_0x09e1('0x1b')](_0x09e1('0x51'),_0x4bbc21[_0x09e1('0x4e')]);if(_0x569cdc&&_0x569cdc['monitor_format']){logger[_0x09e1('0xa')](_0x09e1('0x52'),'Recording\x20is\x20enabled!');_0x1d3999['recordingURL']=util[_0x09e1('0x1b')](_0x09e1('0x53'),_0x4bbc21[_0x09e1('0x54')],_0x1d3999[_0x09e1('0x55')],md5(_0x1d3999[_0x09e1('0x55')]));}else{_0x1d3999['recordingURL']='';}return getConnection(_0x4bbc21)[_0x09e1('0x26')](function(_0xec4045){_0x5c27cb=_0xec4045;return getUser(_0x4bbc21,_0x5a527e['name'],_0x5c27cb);})[_0x09e1('0x26')](function(_0x5253e0){_0x5db07e=_0x5253e0;logger[_0x09e1('0xa')]('The\x20User\x20ID\x20is:',_0x5db07e['id']);return getEndUser(_0x4bbc21,_0x1d3999['calleridname'],_0x1d3999[_0x09e1('0x56')],_0x5c27cb);})[_0x09e1('0x26')](function(_0x35700e){_0x3c121d=_0x35700e;logger['info'](_0x09e1('0x57'),_0x3c121d['id']);return getTicket(_0x4bbc21,_0x5db07e,_0x3c121d,_0x398f14,_0x1d3999,_0x398f14[_0x09e1('0x58')],_0x5c27cb,'Inbound');})[_0x09e1('0x26')](function(_0x55d7c8){_0x15f99e=_0x55d7c8;logger['info'](_0x09e1('0x59'));logger['info'](_0x09e1('0x5a'),_0x15f99e['id']);return setRelationship(_0x5c27cb,_0x5db07e,_0x15f99e,'users');})[_0x09e1('0x26')](function(){return setRelationship(_0x5c27cb,_0x3c121d,_0x15f99e,_0x09e1('0x5b'));})[_0x09e1('0x26')](function(){return getServerInfo(_0x5c27cb);})[_0x09e1('0x26')](function(_0x587d58){var _0x44a6dd=parseInt(_0x587d58[_0x09e1('0x5c')][_0x09e1('0x5d')](0x0));var _0x4ec4e7=util[_0x09e1('0x1b')](_0x09e1('0x5e'),_0x4bbc21['remoteUri'],_0x15f99e['id']);if(_0x44a6dd>0x6){_0x4ec4e7=util[_0x09e1('0x1b')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4bbc21[_0x09e1('0x4e')],_0x15f99e['id']);}logger['info']('[QUEUE]',_0x09e1('0x5f'));emit(util[_0x09e1('0x1b')](_0x09e1('0x60'),_0x5a527e['name']),_0x09e1('0x61'),{'uri':_0x4ec4e7});})[_0x09e1('0x62')](function(_0x1316f2){logger[_0x09e1('0x63')](_0x09e1('0x52'),JSON[_0x09e1('0x2e')](_0x1316f2));});};exports[_0x09e1('0x64')]=function(_0x54e83c,_0x523f1b,_0x62157c,_0x3e759e,_0xcf8b43,_0x6bfdfe,_0x5b6935){var _0x3f320f,_0x39f408,_0x31ffe8,_0x212282;_0x6bfdfe[_0x09e1('0x4e')]=intUtil[_0x09e1('0x4f')](_0x6bfdfe[_0x09e1('0x4e')]);_0x6bfdfe['serverUrl']=intUtil['stripTrailingSlash'](_0x6bfdfe['serverUrl']);def[_0x09e1('0x50')]=util[_0x09e1('0x1b')](_0x09e1('0x51'),_0x6bfdfe[_0x09e1('0x4e')]);if(_0x5b6935&&_0x5b6935[_0x09e1('0x65')]&&_0x5b6935['recordingFormat']!==_0x09e1('0x66')){logger[_0x09e1('0xa')](_0x09e1('0x67'),'Recording\x20is\x20enabled!');_0x523f1b[_0x09e1('0x68')]=util[_0x09e1('0x1b')](_0x09e1('0x53'),_0x6bfdfe[_0x09e1('0x54')],_0x523f1b['uniqueid'],md5(_0x523f1b[_0x09e1('0x55')]));}return getConnection(_0x6bfdfe)[_0x09e1('0x26')](function(_0x8cd02f){_0x212282=_0x8cd02f;return getUser(_0x6bfdfe,_0x3e759e[_0x09e1('0x24')],_0x212282);})[_0x09e1('0x26')](function(_0x132252){_0x3f320f=_0x132252;logger[_0x09e1('0xa')](_0x09e1('0x69'),_0x3f320f['id']);return getEndUser(_0x6bfdfe,_0x523f1b['destcalleridname'],_0x523f1b[_0x09e1('0x6a')],_0x212282);})[_0x09e1('0x26')](function(_0x43ac84){_0x39f408=_0x43ac84;logger[_0x09e1('0xa')](_0x09e1('0x57'),_0x39f408['id']);return getTicket(_0x6bfdfe,_0x3f320f,_0x39f408,_0x62157c,_0x523f1b,_0x62157c['Fields'],_0x212282,_0x09e1('0x6b'));})[_0x09e1('0x26')](function(_0x1f41db){_0x31ffe8=_0x1f41db;logger['info']('Ticket\x20created!');logger[_0x09e1('0xa')](_0x09e1('0x5a'),_0x31ffe8['id']);return setRelationship(_0x212282,_0x3f320f,_0x31ffe8,_0x09e1('0x6c'));})[_0x09e1('0x26')](function(){return setRelationship(_0x212282,_0x39f408,_0x31ffe8,_0x09e1('0x5b'));})['then'](function(){return getServerInfo(_0x212282);})[_0x09e1('0x26')](function(_0x373dab){var _0x2a6bec=parseInt(_0x373dab['version']['charAt'](0x0));var _0x41072a=util[_0x09e1('0x1b')](_0x09e1('0x5e'),_0x6bfdfe['remoteUri'],_0x31ffe8['id']);if(_0x2a6bec>0x6){_0x41072a=util['format'](_0x09e1('0x6d'),_0x6bfdfe['remoteUri'],_0x31ffe8['id']);}logger['info']('[OUTBOUND]',_0x09e1('0x5f'));emit(util[_0x09e1('0x1b')](_0x09e1('0x60'),_0x3e759e['name']),_0x09e1('0x61'),{'uri':_0x41072a});})[_0x09e1('0x62')](function(_0x157865){logger['error'](_0x09e1('0x67'),JSON[_0x09e1('0x2e')](_0x157865));});};exports['unmanaged']=function(_0x511913,_0x47a66b,_0x49e2b2,_0x48574b,_0x251d4c,_0x159f56){var _0x586840,_0xe9fe2b,_0x43fb84,_0x2cb5fa;_0x159f56[_0x09e1('0x4e')]=intUtil[_0x09e1('0x4f')](_0x159f56['remoteUri']);_0x159f56[_0x09e1('0x54')]=intUtil[_0x09e1('0x4f')](_0x159f56[_0x09e1('0x54')]);def[_0x09e1('0x50')]=util[_0x09e1('0x1b')]('%s/service/v4_1/rest.php',_0x159f56[_0x09e1('0x4e')]);if(_0x251d4c&&_0x251d4c['monitor_format']){logger[_0x09e1('0xa')]('['+_0x47a66b[_0x09e1('0x6e')][_0x09e1('0x6f')]()+']',_0x09e1('0x70'));_0x47a66b['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x159f56['serverUrl'],_0x47a66b['uniqueid'],md5(_0x47a66b[_0x09e1('0x55')]));}else{_0x47a66b[_0x09e1('0x68')]='';}return getConnection(_0x159f56)[_0x09e1('0x26')](function(_0x1006f6){_0x2cb5fa=_0x1006f6;if(!_['isNil'](_0x48574b)){return getUser(_0x159f56,_0x48574b[_0x09e1('0x24')],_0x2cb5fa);}else{return getUser(_0x159f56,null,_0x2cb5fa);}})[_0x09e1('0x26')](function(_0x4fe21a){_0x586840=_0x4fe21a;logger[_0x09e1('0xa')](_0x09e1('0x69'),_0x586840['id']);return getEndUser(_0x159f56,_0x47a66b[_0x09e1('0x71')],_0x47a66b['calleridnum'],_0x2cb5fa);})['then'](function(_0x385e20){_0xe9fe2b=_0x385e20;logger[_0x09e1('0xa')](_0x09e1('0x57'),_0xe9fe2b['id']);return getTicket(_0x159f56,_0x586840,_0xe9fe2b,_0x49e2b2,_0x47a66b,_0x49e2b2[_0x09e1('0x58')],_0x2cb5fa,_0x09e1('0x72'));})[_0x09e1('0x26')](function(_0x4d80fb){_0x43fb84=_0x4d80fb;logger[_0x09e1('0xa')](_0x09e1('0x59'));logger[_0x09e1('0xa')](_0x09e1('0x5a'),_0x43fb84['id']);return setRelationship(_0x2cb5fa,_0x586840,_0x43fb84,_0x09e1('0x6c'));})['then'](function(){return setRelationship(_0x2cb5fa,_0xe9fe2b,_0x43fb84,'contacts');})[_0x09e1('0x26')](function(){return getServerInfo(_0x2cb5fa);})['catch'](function(_0x32c0e1){logger[_0x09e1('0x63')]('['+_0x47a66b['lastevent'][_0x09e1('0x6f')]()+']',JSON[_0x09e1('0x2e')](_0x32c0e1));});}; \ 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 e40398a..8438c3d 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 _0x87bd=['lodash','getString','length','sortBy','string','content','type','variable','push','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','test'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x87bd,0xd0));var _0xd87b=function(_0x3f80d3,_0x1df024){_0x3f80d3=_0x3f80d3-0x0;var _0x1d13b1=_0x87bd[_0x3f80d3];return _0x1d13b1;};'use strict';var _=require(_0xd87b('0x0'));var util=require('util');exports[_0xd87b('0x1')]=function(_0x43d920,_0x52eeb1,_0x55bd82){var _0x3432b9=[];if(_0x43d920[_0xd87b('0x2')]>0x0){var _0x391e98=_[_0xd87b('0x3')](_0x43d920,['id']);for(var _0x38a841=0x0;_0x38a841<_0x391e98[_0xd87b('0x2')];_0x38a841++){var _0x3a9b5c=_0x391e98[_0x38a841];if(_0x3a9b5c['type']===_0xd87b('0x4')){_0x3432b9['push'](_0x3a9b5c[_0xd87b('0x5')]);}else if(_0x3a9b5c[_0xd87b('0x6')]===_0xd87b('0x7')&&_0x3a9b5c['variableName']){_0x52eeb1[_0x3a9b5c['variableName']]&&_0x3432b9[_0xd87b('0x8')](_0x52eeb1[_0x3a9b5c[_0xd87b('0x9')]][_0xd87b('0xa')]());}else if(_0x3a9b5c[_0xd87b('0x6')]===_0xd87b('0xb')&&_0x3a9b5c[_0xd87b('0xc')]&&_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')]){_0x52eeb1[_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')][_0xd87b('0xe')]()]&&_0x3432b9['push'](_0x52eeb1[_0x3a9b5c['Variable'][_0xd87b('0xd')]['toLowerCase']()][_0xd87b('0xa')]());}else if(_0x3a9b5c[_0xd87b('0x6')]===_0xd87b('0xf')){if(_0x3a9b5c[_0xd87b('0x10')]==='string'&&_0x3a9b5c[_0xd87b('0x11')]){_0x3432b9['push'](util[_0xd87b('0x12')](_0xd87b('0x13'),_0x3a9b5c[_0xd87b('0x11')],_0x3a9b5c['keyContent']));}else if(_0x3a9b5c[_0xd87b('0x10')]===_0xd87b('0x7')&&_0x3a9b5c[_0xd87b('0x9')]&&_0x3a9b5c[_0xd87b('0x11')]){_0x52eeb1[_0x3a9b5c['variableName']]&&_0x3432b9[_0xd87b('0x8')](util['format'](_0xd87b('0x13'),_0x3a9b5c[_0xd87b('0x11')],_0x52eeb1[_0x3a9b5c['variableName']]));}else if(_0x3a9b5c[_0xd87b('0x10')]===_0xd87b('0xb')&&_0x3a9b5c[_0xd87b('0xc')]&&_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')]&&_0x3a9b5c[_0xd87b('0x11')]){_0x52eeb1[_0x3a9b5c['Variable'][_0xd87b('0xd')]['toLowerCase']()]&&_0x3432b9['push'](util['format']('%s:\x20%s',_0x3a9b5c[_0xd87b('0x11')],_0x52eeb1[_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')][_0xd87b('0xe')]()]));}}}}return _0x3432b9[_0xd87b('0x14')](_0x55bd82);};exports[_0xd87b('0x15')]=function(_0x1af403){var _0x1aa900=_0x1af403[_0xd87b('0x16')](-0x1);if(_0x1aa900==='/'){_0x1af403=_0x1af403[_0xd87b('0x17')](0x0,_0x1af403[_0xd87b('0x18')](_0x1aa900));}return _0x1af403;};exports['validateEmail']=function(_0x361989){if(!_['isNil'](_0x361989)&&_0x361989!==''){var _0x4971bf=/^(([^<>()\[\]\\.,;:\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 _0x4971bf[_0xd87b('0x19')](String(_0x361989)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x0085=['util','getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','join','slice','substring','lastIndexOf','validateEmail','isNil','test'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0085,0x138));var _0x5008=function(_0x4a3dc5,_0xa878cd){_0x4a3dc5=_0x4a3dc5-0x0;var _0x27ff50=_0x0085[_0x4a3dc5];return _0x27ff50;};'use strict';var _=require('lodash');var util=require(_0x5008('0x0'));exports[_0x5008('0x1')]=function(_0x104ab7,_0x567641,_0x12d403){var _0x5e5504=[];if(_0x104ab7[_0x5008('0x2')]>0x0){var _0xc2dd9d=_[_0x5008('0x3')](_0x104ab7,['id']);for(var _0x24ead7=0x0;_0x24ead7<_0xc2dd9d[_0x5008('0x2')];_0x24ead7++){var _0x315a7e=_0xc2dd9d[_0x24ead7];if(_0x315a7e[_0x5008('0x4')]===_0x5008('0x5')){_0x5e5504[_0x5008('0x6')](_0x315a7e['content']);}else if(_0x315a7e[_0x5008('0x4')]===_0x5008('0x7')&&_0x315a7e[_0x5008('0x8')]){_0x567641[_0x315a7e[_0x5008('0x8')]]&&_0x5e5504[_0x5008('0x6')](_0x567641[_0x315a7e[_0x5008('0x8')]][_0x5008('0x9')]());}else if(_0x315a7e[_0x5008('0x4')]===_0x5008('0xa')&&_0x315a7e[_0x5008('0xb')]&&_0x315a7e[_0x5008('0xb')]['name']){_0x567641[_0x315a7e[_0x5008('0xb')][_0x5008('0xc')][_0x5008('0xd')]()]&&_0x5e5504[_0x5008('0x6')](_0x567641[_0x315a7e[_0x5008('0xb')]['name']['toLowerCase']()][_0x5008('0x9')]());}else if(_0x315a7e['type']===_0x5008('0xe')){if(_0x315a7e[_0x5008('0xf')]===_0x5008('0x5')&&_0x315a7e['key']){_0x5e5504[_0x5008('0x6')](util[_0x5008('0x10')](_0x5008('0x11'),_0x315a7e[_0x5008('0x12')],_0x315a7e['keyContent']));}else if(_0x315a7e[_0x5008('0xf')]===_0x5008('0x7')&&_0x315a7e['variableName']&&_0x315a7e['key']){_0x567641[_0x315a7e['variableName']]&&_0x5e5504[_0x5008('0x6')](util[_0x5008('0x10')]('%s:\x20%s',_0x315a7e[_0x5008('0x12')],_0x567641[_0x315a7e[_0x5008('0x8')]]));}else if(_0x315a7e['keyType']===_0x5008('0xa')&&_0x315a7e[_0x5008('0xb')]&&_0x315a7e[_0x5008('0xb')][_0x5008('0xc')]&&_0x315a7e[_0x5008('0x12')]){_0x567641[_0x315a7e['Variable'][_0x5008('0xc')]['toLowerCase']()]&&_0x5e5504[_0x5008('0x6')](util[_0x5008('0x10')](_0x5008('0x11'),_0x315a7e[_0x5008('0x12')],_0x567641[_0x315a7e[_0x5008('0xb')][_0x5008('0xc')][_0x5008('0xd')]()]));}}}}return _0x5e5504[_0x5008('0x13')](_0x12d403);};exports['stripTrailingSlash']=function(_0x203944){var _0x4883c4=_0x203944[_0x5008('0x14')](-0x1);if(_0x4883c4==='/'){_0x203944=_0x203944[_0x5008('0x15')](0x0,_0x203944[_0x5008('0x16')](_0x4883c4));}return _0x203944;};exports[_0x5008('0x17')]=function(_0x3bc48e){if(!_[_0x5008('0x18')](_0x3bc48e)&&_0x3bc48e!==''){var _0x1841d0=/^(([^<>()\[\]\\.,;:\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 _0x1841d0[_0x5008('0x19')](String(_0x3bc48e)[_0x5008('0xd')]());}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 0281076..e412ec7 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x3b7fb7,_0x30abbb){var _0x34da82=function(_0x1177ae){while(--_0x1177ae){_0x3b7fb7['push'](_0x3b7fb7['shift']());}};_0x34da82(++_0x30abbb);}(_0xe706,0xa3));var _0x6e70=function(_0x429003,_0x3508da){_0x429003=_0x429003-0x0;var _0x3cc0d9=_0xe706[_0x429003];return _0x3cc0d9;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x3e6440,_0xa10c2b){var _0xc0b1bf=function(_0x200b12){while(--_0x200b12){_0x3e6440['push'](_0x3e6440['shift']());}};_0xc0b1bf(++_0xa10c2b);}(_0xe706,0xa3));var _0x6e70=function(_0x874a49,_0x5b07bc){_0x874a49=_0x874a49-0x0;var _0x343d2f=_0xe706[_0x874a49];return _0x343d2f;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index db856a6..9b3dd69 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 _0x607f=['filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','base64','debug','[HTTP]','stringify','map','forEach','includes','picklist','type','nameField','customField','content','string','custom_fields','push','idField','toString','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','inspect','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Descriptions','Fields','info','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length'];(function(_0x9e5ae7,_0x2499e5){var _0x149e4b=function(_0x47f1f2){while(--_0x47f1f2){_0x9e5ae7['push'](_0x9e5ae7['shift']());}};_0x149e4b(++_0x2499e5);}(_0x607f,0x199));var _0xf607=function(_0x1c7dd7,_0x4e5e2a){_0x1c7dd7=_0x1c7dd7-0x0;var _0x3ab480=_0x607f[_0x1c7dd7];return _0x3ab480;};'use strict';var _=require('lodash');var rp=require(_0xf607('0x0'));var md5=require('md5');var util=require(_0xf607('0x1'));var Redis=require(_0xf607('0x2'));var intUtil=require(_0xf607('0x3'));var config=require('../../../../config/environment');var logger=require(_0xf607('0x4'))(_0xf607('0x5'));config[_0xf607('0x6')]=_[_0xf607('0x7')](config[_0xf607('0x6')],{'host':_0xf607('0x8'),'port':0x18eb});var io=require(_0xf607('0x9'))(new Redis(config[_0xf607('0x6')]));function emit(_0x5de6bf,_0x249a58,_0x305ef9){io['to'](_0x5de6bf)[_0xf607('0xa')](_0x249a58,_0x305ef9);}var headers={'Content-Type':'application/json','Accept':_0xf607('0xb')};function getTicket(_0x5230df,_0x5d1c51,_0x420384,_0x4745a8,_0x36a5a0){logger['info'](_0xf607('0xc'));return request({'uri':util[_0xf607('0xd')](_0xf607('0xe'),_0x5230df[_0xf607('0xf')]),'method':'POST','body':{'ticket':_[_0xf607('0x10')]({'requester_id':_0x420384['id'],'submitter_id':_0x5d1c51?_0x5d1c51['id']:undefined,'assignee_id':_0x5d1c51?_0x5d1c51['id']:undefined,'tags':getTags(_0x4745a8[_0xf607('0x11')],_0xf607('0x12')),'subject':intUtil[_0xf607('0x13')](_0x4745a8['Subjects'],_0x36a5a0,'\x20'),'description':intUtil[_0xf607('0x13')](_0x4745a8['Descriptions'],_0x36a5a0,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x4745a8[_0xf607('0x14')],_0x36a5a0,'\x0a')}},getCustomFields(_0x4745a8[_0xf607('0x15')],_0x36a5a0))}})['then'](function(_0x414925){logger[_0xf607('0x16')]('Ticket\x20created!');return _0x414925[_0xf607('0x17')];});}function getUser(_0x483e53,_0x1906aa){if(intUtil[_0xf607('0x18')](_0x1906aa)){logger[_0xf607('0x16')](_0xf607('0x19'),_0x1906aa);return request({'uri':util[_0xf607('0xd')](_0xf607('0x1a'),_0x483e53[_0xf607('0xf')]),'qs':{'query':util['format'](_0xf607('0x1b'),_0x1906aa)}})[_0xf607('0x1c')](function(_0x1432d7){if(_0x1432d7[_0xf607('0x1d')]){logger[_0xf607('0x16')]('Agent\x20found!');return _[_0xf607('0x1e')](_0x1432d7[_0xf607('0x1f')],{'email':_0x1906aa,'role':_0xf607('0x20')});}else{logger[_0xf607('0x16')](_0xf607('0x21'));return request({'uri':util[_0xf607('0xd')](_0xf607('0x22'),_0x483e53[_0xf607('0xf')])})[_0xf607('0x1c')](function(_0xb2714){logger[_0xf607('0x16')](_0xf607('0x23'));return _0xb2714[_0xf607('0x24')];});}});}else{logger[_0xf607('0x16')](_0xf607('0x21'));return request({'uri':util[_0xf607('0xd')](_0xf607('0x22'),_0x483e53[_0xf607('0xf')])})['then'](function(_0x433e28){logger[_0xf607('0x16')]('Admin\x20account\x20selected.');return _0x433e28[_0xf607('0x24')];});}}function getEndUser(_0x574920,_0x2f9b5c,_0x194d79){logger[_0xf607('0x16')](_0xf607('0x25'),_0x194d79);return request({'uri':util[_0xf607('0xd')](_0xf607('0x1a'),_0x574920['remoteUri']),'qs':{'query':util[_0xf607('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x194d79)}})[_0xf607('0x1c')](function(_0x5ef823){var _0x5e54da;if(_0x5ef823['results'][_0xf607('0x26')]){_0x5ef823['results']=_[_0xf607('0x27')](_0x5ef823[_0xf607('0x1f')],{'suspended':![],'role':_0xf607('0x28')});if(_0x5ef823[_0xf607('0x1f')][_0xf607('0x26')]){_0x5e54da=_[_0xf607('0x29')](_0x5ef823[_0xf607('0x1f')]);}}if(_0x5e54da){logger[_0xf607('0x16')]('Enduser\x20found!');return _0x5e54da;}else{logger[_0xf607('0x16')](_0xf607('0x2a'));return request({'uri':util['format'](_0xf607('0x2b'),_0x574920[_0xf607('0xf')]),'method':_0xf607('0x2c'),'body':{'user':{'role':_0xf607('0x28'),'name':util[_0xf607('0xd')](_0xf607('0x2d'),_0x2f9b5c||_0x194d79),'phone':_0x194d79}}})[_0xf607('0x1c')](function(_0x511a7a){logger[_0xf607('0x16')](_0xf607('0x2e'));return _0x511a7a['user'];});}});}function getAuth(_0x542fcf){var _0x5a21ec;if(_0x542fcf[_0xf607('0x2f')]===_0xf607('0x30')){_0x5a21ec=util[_0xf607('0xd')]('%s:%s',_0x542fcf[_0xf607('0x31')],_0x542fcf['password']);}else if(_0x542fcf[_0xf607('0x2f')]===_0xf607('0x32')){_0x5a21ec=util[_0xf607('0xd')]('%s/token:%s',_0x542fcf[_0xf607('0x31')],_0x542fcf[_0xf607('0x32')]);}return util[_0xf607('0xd')]('Basic\x20%s',new Buffer(_0x5a21ec)['toString'](_0xf607('0x33')));}function request(_0x5822fe){logger[_0xf607('0x34')](_0xf607('0x35'),JSON[_0xf607('0x36')](_0x5822fe));return rp(_[_0xf607('0x7')](_0x5822fe,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x40a40f,_0x50bb13){var _0x46a6ef=[];if(_0x40a40f&&_0x40a40f[_0xf607('0x26')]>0x0){_0x46a6ef=_[_0xf607('0x37')](_0x40a40f,_0x50bb13);}return _0x46a6ef;}function getCustomFields(_0x5d8c9c,_0x17f027){var _0x2448d5=[];var _0x3f122a={'custom_fields':[]};if(_0x5d8c9c[_0xf607('0x26')]>0x0){_[_0xf607('0x38')](_0x5d8c9c,function(_0x54a44f){if(_[_0xf607('0x39')](['string',_0xf607('0x3a')],_0x54a44f[_0xf607('0x3b')])&&_0x54a44f[_0xf607('0x3c')]&&!_0x54a44f[_0xf607('0x3d')]){_0x3f122a[_0x54a44f[_0xf607('0x3c')]['toLowerCase']()]=_0x54a44f[_0xf607('0x3e')]['toString']();}else if(_[_0xf607('0x39')]([_0xf607('0x3f'),'picklist'],_0x54a44f[_0xf607('0x3b')])&&_0x54a44f['idField']&&_0x54a44f[_0xf607('0x3d')]){_0x3f122a[_0xf607('0x40')][_0xf607('0x41')]({'id':_0x54a44f[_0xf607('0x42')],'value':_0x54a44f['content'][_0xf607('0x43')]()});}else if(_0x54a44f[_0xf607('0x3b')]===_0xf607('0x44')&&_0x54a44f[_0xf607('0x45')]&&_0x54a44f[_0xf607('0x42')]&&_0x54a44f[_0xf607('0x3d')]){_0x17f027[_0x54a44f['variableName']]&&_0x3f122a[_0xf607('0x40')][_0xf607('0x41')]({'id':_0x54a44f[_0xf607('0x42')],'value':_0x17f027[_0x54a44f[_0xf607('0x45')]][_0xf607('0x43')]()});}else if(_0x54a44f['type']===_0xf607('0x46')&&_0x54a44f[_0xf607('0x47')]&&_0x54a44f[_0xf607('0x47')][_0xf607('0x12')]&&_0x54a44f[_0xf607('0x42')]&&_0x54a44f['customField']){_0x17f027[_0x54a44f[_0xf607('0x47')][_0xf607('0x12')][_0xf607('0x48')]()]&&_0x3f122a['custom_fields']['push']({'id':_0x54a44f['idField'],'value':_0x17f027[_0x54a44f[_0xf607('0x47')][_0xf607('0x12')][_0xf607('0x48')]()][_0xf607('0x43')]()});}});}return _0x3f122a;}exports[_0xf607('0x49')]=function(_0x4f6339,_0x5da551,_0x221244,_0x3a8468,_0x25dc04,_0x5cd47b){var _0x5d987e,_0x49970d;_0x5cd47b[_0xf607('0xf')]=intUtil['stripTrailingSlash'](_0x5cd47b['remoteUri']);_0x5cd47b[_0xf607('0x4a')]=intUtil[_0xf607('0x4b')](_0x5cd47b[_0xf607('0x4a')]);if(_0x25dc04&&_0x25dc04[_0xf607('0x4c')]){logger[_0xf607('0x16')](_0xf607('0x4d'),_0xf607('0x4e'));_0x5da551[_0xf607('0x4f')]=util['format'](_0xf607('0x50'),_0x5cd47b[_0xf607('0x4a')],_0x5da551['uniqueid'],md5(_0x5da551[_0xf607('0x51')]));}else{_0x5da551[_0xf607('0x4f')]='';}headers['Authorization']=getAuth(_0x5cd47b);return getUser(_0x5cd47b,_0x3a8468[_0xf607('0x52')])[_0xf607('0x1c')](function(_0x2e940c){_0x5d987e=_0x2e940c;logger[_0xf607('0x16')](_0xf607('0x53'),_0x5d987e['id']);return getEndUser(_0x5cd47b,_0x5da551['calleridname'],_0x5da551['calleridnum']);})[_0xf607('0x1c')](function(_0x526e99){_0x49970d=_0x526e99;logger[_0xf607('0x16')]('The\x20Enduser\x20ID\x20is:',_0x49970d['id']);return getTicket(_0x5cd47b,_0x5d987e,_0x49970d,_0x221244,_0x5da551);})['then'](function(_0x21b4a2){if(_0x21b4a2){logger[_0xf607('0x16')](_0xf607('0x54'),_0x21b4a2['id']);switch(_0x5cd47b['type']){case _0xf607('0x55'):logger[_0xf607('0x16')](_0xf607('0x4d'),_0xf607('0x56'));return request({'uri':util['format'](_0xf607('0x57'),_0x5cd47b[_0xf607('0xf')],_0x5d987e['id'],_0x21b4a2['id']),'method':_0xf607('0x2c')});case _0xf607('0x58'):logger[_0xf607('0x16')](_0xf607('0x4d'),_0xf607('0x59'));emit(util[_0xf607('0xd')]('user:%s',_0x3a8468[_0xf607('0x12')]),_0xf607('0x5a'),{'uri':util[_0xf607('0xd')]('%s/agent/tickets/%s',_0x5cd47b['remoteUri'][_0xf607('0x5b')](_0xf607('0x5c'),''),_0x21b4a2['id'])});break;default:logger['error'](_0xf607('0x4d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xf607('0x5d')](function(_0x2d9ce6){logger[_0xf607('0x5e')](_0xf607('0x5f'),util['inspect'](_0x2d9ce6,{'showHidden':!![],'depth':null}));});};exports[_0xf607('0x60')]=function(_0x22411e,_0x41ac91,_0x30cbbc,_0x3d0be0,_0xf372cf,_0x2ddc46,_0x3737d4){var _0x2eb9d3,_0xac2bbd;_0x2ddc46['remoteUri']=intUtil[_0xf607('0x4b')](_0x2ddc46[_0xf607('0xf')]);_0x2ddc46[_0xf607('0x4a')]=intUtil[_0xf607('0x4b')](_0x2ddc46[_0xf607('0x4a')]);if(_0x3737d4&&_0x3737d4['recordingFormat']&&_0x3737d4[_0xf607('0x61')]!==_0xf607('0x62')){logger[_0xf607('0x16')](_0xf607('0x63'),_0xf607('0x4e'));_0x41ac91['recordingURL']=util[_0xf607('0xd')](_0xf607('0x50'),_0x2ddc46[_0xf607('0x4a')],_0x41ac91['uniqueid'],md5(_0x41ac91[_0xf607('0x51')]));}headers[_0xf607('0x64')]=getAuth(_0x2ddc46);return getUser(_0x2ddc46,_0x3d0be0[_0xf607('0x52')])[_0xf607('0x1c')](function(_0x594055){_0x2eb9d3=_0x594055;logger[_0xf607('0x16')](_0xf607('0x53'),_0x2eb9d3['id']);return getEndUser(_0x2ddc46,_0x41ac91[_0xf607('0x65')],_0x41ac91[_0xf607('0x66')]);})['then'](function(_0x84a966){_0xac2bbd=_0x84a966;logger[_0xf607('0x16')](_0xf607('0x67'),_0xac2bbd['id']);return getTicket(_0x2ddc46,_0x2eb9d3,_0xac2bbd,_0x30cbbc,_0x41ac91);})[_0xf607('0x1c')](function(_0x466ac4){if(_0x466ac4){logger[_0xf607('0x16')]('The\x20Ticket\x20ID\x20is:',_0x466ac4['id']);switch(_0x2ddc46[_0xf607('0x3b')]){case _0xf607('0x55'):logger[_0xf607('0x16')](_0xf607('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf607('0xd')](_0xf607('0x57'),_0x2ddc46[_0xf607('0xf')],_0x2eb9d3['id'],_0x466ac4['id']),'method':_0xf607('0x2c')});case _0xf607('0x58'):logger['info'](_0xf607('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xf607('0x68'),_0x3d0be0[_0xf607('0x12')]),_0xf607('0x5a'),{'uri':util[_0xf607('0xd')](_0xf607('0x69'),_0x2ddc46[_0xf607('0xf')][_0xf607('0x5b')](_0xf607('0x5c'),''),_0x466ac4['id'])});break;default:logger[_0xf607('0x5e')](_0xf607('0x63'),_0xf607('0x6a'));}}})['catch'](function(_0x1f4a3d){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf607('0x6b')](_0x1f4a3d,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x298260,_0x1581e9,_0x5dfc20,_0x22f5a2,_0x51c830,_0x1a323d){var _0x59b478,_0x16a011;_0x1a323d[_0xf607('0xf')]=intUtil[_0xf607('0x4b')](_0x1a323d[_0xf607('0xf')]);_0x1a323d[_0xf607('0x4a')]=intUtil[_0xf607('0x4b')](_0x1a323d[_0xf607('0x4a')]);if(_0x51c830&&_0x51c830[_0xf607('0x4c')]){logger['info']('['+_0x1581e9[_0xf607('0x6c')][_0xf607('0x6d')]()+']',_0xf607('0x4e'));_0x1581e9['recordingURL']=util[_0xf607('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a323d[_0xf607('0x4a')],_0x1581e9[_0xf607('0x51')],md5(_0x1581e9[_0xf607('0x51')]));}else{_0x1581e9[_0xf607('0x4f')]='';}headers['Authorization']=getAuth(_0x1a323d);return getUser(_0x1a323d)['then'](function(_0x3361f7){_0x59b478=_0x3361f7;logger[_0xf607('0x16')](_0xf607('0x53'),_0x59b478['id']);return getEndUser(_0x1a323d,_0x1581e9['calleridname'],_0x1581e9[_0xf607('0x6e')]);})[_0xf607('0x1c')](function(_0x5e1094){_0x16a011=_0x5e1094;logger[_0xf607('0x16')](_0xf607('0x67'),_0x16a011['id']);return getTicket(_0x1a323d,_0x59b478,_0x16a011,_0x5dfc20,_0x1581e9);})[_0xf607('0x1c')](function(_0x32be56){if(_0x32be56){logger[_0xf607('0x16')](_0xf607('0x54'),_0x32be56['id']);}})['catch'](function(_0x1d2251){logger[_0xf607('0x5e')]('['+_0x1581e9[_0xf607('0x6c')]['toUpperCase']()+']'+_0xf607('0x6f'),util[_0xf607('0x6b')](_0x1d2251,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x49cf=['idField','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Admin\x20account\x20selected.','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','filter','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','picklist','nameField','toLowerCase','content','string','type','customField','custom_fields','push','variable','variableName'];(function(_0x4ee9dd,_0x2277f3){var _0x5d0a1e=function(_0x1230f3){while(--_0x1230f3){_0x4ee9dd['push'](_0x4ee9dd['shift']());}};_0x5d0a1e(++_0x2277f3);}(_0x49cf,0x9c));var _0xf49c=function(_0x39c2f4,_0x1d571e){_0x39c2f4=_0x39c2f4-0x0;var _0x119804=_0x49cf[_0x39c2f4];return _0x119804;};'use strict';var _=require(_0xf49c('0x0'));var rp=require(_0xf49c('0x1'));var md5=require(_0xf49c('0x2'));var util=require(_0xf49c('0x3'));var Redis=require(_0xf49c('0x4'));var intUtil=require(_0xf49c('0x5'));var config=require(_0xf49c('0x6'));var logger=require(_0xf49c('0x7'))(_0xf49c('0x8'));config['redis']=_[_0xf49c('0x9')](config['redis'],{'host':_0xf49c('0xa'),'port':0x18eb});var io=require(_0xf49c('0xb'))(new Redis(config[_0xf49c('0xc')]));function emit(_0x871600,_0x5c2ce8,_0x1d3200){io['to'](_0x871600)['emit'](_0x5c2ce8,_0x1d3200);}var headers={'Content-Type':'application/json','Accept':_0xf49c('0xd')};function getTicket(_0x29fb01,_0x38e84a,_0xc1dc7e,_0x25b483,_0x4d1325){logger[_0xf49c('0xe')](_0xf49c('0xf'));return request({'uri':util[_0xf49c('0x10')]('%s/tickets.json',_0x29fb01[_0xf49c('0x11')]),'method':_0xf49c('0x12'),'body':{'ticket':_['merge']({'requester_id':_0xc1dc7e['id'],'submitter_id':_0x38e84a?_0x38e84a['id']:undefined,'assignee_id':_0x38e84a?_0x38e84a['id']:undefined,'tags':getTags(_0x25b483[_0xf49c('0x13')],_0xf49c('0x14')),'subject':intUtil[_0xf49c('0x15')](_0x25b483[_0xf49c('0x16')],_0x4d1325,'\x20'),'description':intUtil[_0xf49c('0x15')](_0x25b483[_0xf49c('0x17')],_0x4d1325,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf49c('0x15')](_0x25b483[_0xf49c('0x17')],_0x4d1325,'\x0a')}},getCustomFields(_0x25b483['Fields'],_0x4d1325))}})[_0xf49c('0x18')](function(_0x165dd6){logger[_0xf49c('0xe')]('Ticket\x20created!');return _0x165dd6[_0xf49c('0x19')];});}function getUser(_0x34916e,_0x2d3f60){if(intUtil[_0xf49c('0x1a')](_0x2d3f60)){logger['info'](_0xf49c('0x1b'),_0x2d3f60);return request({'uri':util[_0xf49c('0x10')](_0xf49c('0x1c'),_0x34916e['remoteUri']),'qs':{'query':util[_0xf49c('0x10')](_0xf49c('0x1d'),_0x2d3f60)}})[_0xf49c('0x18')](function(_0x474cd3){if(_0x474cd3[_0xf49c('0x1e')]){logger['info'](_0xf49c('0x1f'));return _[_0xf49c('0x20')](_0x474cd3[_0xf49c('0x21')],{'email':_0x2d3f60,'role':_0xf49c('0x22')});}else{logger[_0xf49c('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf49c('0x10')]('%s/users/me.json',_0x34916e[_0xf49c('0x11')])})[_0xf49c('0x18')](function(_0x23c818){logger['info'](_0xf49c('0x23'));return _0x23c818['user'];});}});}else{logger[_0xf49c('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf49c('0x10')](_0xf49c('0x24'),_0x34916e[_0xf49c('0x11')])})[_0xf49c('0x18')](function(_0x99dec9){logger[_0xf49c('0xe')](_0xf49c('0x23'));return _0x99dec9['user'];});}}function getEndUser(_0x2a7bbb,_0x198eb6,_0x5b5b74){logger[_0xf49c('0xe')]('Searching\x20enduser\x20with\x20phone',_0x5b5b74);return request({'uri':util[_0xf49c('0x10')]('%s/search.json',_0x2a7bbb[_0xf49c('0x11')]),'qs':{'query':util[_0xf49c('0x10')](_0xf49c('0x25'),_0x5b5b74)}})[_0xf49c('0x18')](function(_0x2070ee){var _0x375de2;if(_0x2070ee['results']['length']){_0x2070ee['results']=_[_0xf49c('0x26')](_0x2070ee[_0xf49c('0x21')],{'suspended':![],'role':'end-user'});if(_0x2070ee['results'][_0xf49c('0x27')]){_0x375de2=_['first'](_0x2070ee[_0xf49c('0x21')]);}}if(_0x375de2){logger[_0xf49c('0xe')](_0xf49c('0x28'));return _0x375de2;}else{logger['info'](_0xf49c('0x29'));return request({'uri':util['format'](_0xf49c('0x2a'),_0x2a7bbb[_0xf49c('0x11')]),'method':_0xf49c('0x12'),'body':{'user':{'role':_0xf49c('0x2b'),'name':util['format'](_0xf49c('0x2c'),_0x198eb6||_0x5b5b74),'phone':_0x5b5b74}}})[_0xf49c('0x18')](function(_0x3cd3a3){logger[_0xf49c('0xe')](_0xf49c('0x2d'));return _0x3cd3a3[_0xf49c('0x2e')];});}});}function getAuth(_0x2d3101){var _0x2483b7;if(_0x2d3101[_0xf49c('0x2f')]===_0xf49c('0x30')){_0x2483b7=util[_0xf49c('0x10')](_0xf49c('0x31'),_0x2d3101['username'],_0x2d3101[_0xf49c('0x30')]);}else if(_0x2d3101[_0xf49c('0x2f')]===_0xf49c('0x32')){_0x2483b7=util[_0xf49c('0x10')](_0xf49c('0x33'),_0x2d3101[_0xf49c('0x34')],_0x2d3101[_0xf49c('0x32')]);}return util['format'](_0xf49c('0x35'),new Buffer(_0x2483b7)[_0xf49c('0x36')](_0xf49c('0x37')));}function request(_0x5bc6b3){logger[_0xf49c('0x38')](_0xf49c('0x39'),JSON[_0xf49c('0x3a')](_0x5bc6b3));return rp(_[_0xf49c('0x9')](_0x5bc6b3,{'method':_0xf49c('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x267a21,_0x50f4cc){var _0x12f02e=[];if(_0x267a21&&_0x267a21[_0xf49c('0x27')]>0x0){_0x12f02e=_[_0xf49c('0x3c')](_0x267a21,_0x50f4cc);}return _0x12f02e;}function getCustomFields(_0x2774f3,_0x1e93ce){var _0x4e13f2=[];var _0x2b428c={'custom_fields':[]};if(_0x2774f3[_0xf49c('0x27')]>0x0){_[_0xf49c('0x3d')](_0x2774f3,function(_0x53f0c8){if(_[_0xf49c('0x3e')](['string',_0xf49c('0x3f')],_0x53f0c8['type'])&&_0x53f0c8['nameField']&&!_0x53f0c8['customField']){_0x2b428c[_0x53f0c8[_0xf49c('0x40')][_0xf49c('0x41')]()]=_0x53f0c8[_0xf49c('0x42')][_0xf49c('0x36')]();}else if(_[_0xf49c('0x3e')]([_0xf49c('0x43'),_0xf49c('0x3f')],_0x53f0c8[_0xf49c('0x44')])&&_0x53f0c8['idField']&&_0x53f0c8[_0xf49c('0x45')]){_0x2b428c[_0xf49c('0x46')][_0xf49c('0x47')]({'id':_0x53f0c8['idField'],'value':_0x53f0c8[_0xf49c('0x42')][_0xf49c('0x36')]()});}else if(_0x53f0c8[_0xf49c('0x44')]===_0xf49c('0x48')&&_0x53f0c8[_0xf49c('0x49')]&&_0x53f0c8['idField']&&_0x53f0c8['customField']){_0x1e93ce[_0x53f0c8[_0xf49c('0x49')]]&&_0x2b428c[_0xf49c('0x46')][_0xf49c('0x47')]({'id':_0x53f0c8[_0xf49c('0x4a')],'value':_0x1e93ce[_0x53f0c8[_0xf49c('0x49')]][_0xf49c('0x36')]()});}else if(_0x53f0c8['type']===_0xf49c('0x4b')&&_0x53f0c8[_0xf49c('0x4c')]&&_0x53f0c8[_0xf49c('0x4c')]['name']&&_0x53f0c8[_0xf49c('0x4a')]&&_0x53f0c8[_0xf49c('0x45')]){_0x1e93ce[_0x53f0c8[_0xf49c('0x4c')]['name'][_0xf49c('0x41')]()]&&_0x2b428c[_0xf49c('0x46')][_0xf49c('0x47')]({'id':_0x53f0c8['idField'],'value':_0x1e93ce[_0x53f0c8[_0xf49c('0x4c')][_0xf49c('0x14')]['toLowerCase']()][_0xf49c('0x36')]()});}});}return _0x2b428c;}exports['queue']=function(_0x466c61,_0x133791,_0x42538e,_0x38e910,_0x29385a,_0x296d11){var _0x472e8f,_0x24733b;_0x296d11[_0xf49c('0x11')]=intUtil[_0xf49c('0x4d')](_0x296d11[_0xf49c('0x11')]);_0x296d11[_0xf49c('0x4e')]=intUtil[_0xf49c('0x4d')](_0x296d11[_0xf49c('0x4e')]);if(_0x29385a&&_0x29385a['monitor_format']){logger[_0xf49c('0xe')](_0xf49c('0x4f'),_0xf49c('0x50'));_0x133791['recordingURL']=util['format'](_0xf49c('0x51'),_0x296d11[_0xf49c('0x4e')],_0x133791['uniqueid'],md5(_0x133791[_0xf49c('0x52')]));}else{_0x133791[_0xf49c('0x53')]='';}headers[_0xf49c('0x54')]=getAuth(_0x296d11);return getUser(_0x296d11,_0x38e910[_0xf49c('0x55')])[_0xf49c('0x18')](function(_0x16a5cc){_0x472e8f=_0x16a5cc;logger[_0xf49c('0xe')](_0xf49c('0x56'),_0x472e8f['id']);return getEndUser(_0x296d11,_0x133791[_0xf49c('0x57')],_0x133791[_0xf49c('0x58')]);})[_0xf49c('0x18')](function(_0x246910){_0x24733b=_0x246910;logger[_0xf49c('0xe')](_0xf49c('0x59'),_0x24733b['id']);return getTicket(_0x296d11,_0x472e8f,_0x24733b,_0x42538e,_0x133791);})['then'](function(_0x156caf){if(_0x156caf){logger[_0xf49c('0xe')](_0xf49c('0x5a'),_0x156caf['id']);switch(_0x296d11[_0xf49c('0x44')]){case _0xf49c('0x5b'):logger['info'](_0xf49c('0x4f'),_0xf49c('0x5c'));return request({'uri':util['format'](_0xf49c('0x5d'),_0x296d11['remoteUri'],_0x472e8f['id'],_0x156caf['id']),'method':'POST'});case _0xf49c('0x5e'):logger['info']('[QUEUE]',_0xf49c('0x5f'));emit(util['format']('user:%s',_0x38e910[_0xf49c('0x14')]),'trigger:browser:url',{'uri':util[_0xf49c('0x10')]('%s/agent/tickets/%s',_0x296d11['remoteUri'][_0xf49c('0x60')]('/api/v2',''),_0x156caf['id'])});break;default:logger[_0xf49c('0x61')](_0xf49c('0x4f'),_0xf49c('0x62'));}}})[_0xf49c('0x63')](function(_0xa777cd){logger['error'](_0xf49c('0x64'),util[_0xf49c('0x65')](_0xa777cd,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x2bf0f9,_0xf908dc,_0x264020,_0x585fab,_0x1c7e45,_0x261c2f,_0x961679){var _0x4e8ca9,_0x3356c7;_0x261c2f[_0xf49c('0x11')]=intUtil['stripTrailingSlash'](_0x261c2f[_0xf49c('0x11')]);_0x261c2f[_0xf49c('0x4e')]=intUtil['stripTrailingSlash'](_0x261c2f[_0xf49c('0x4e')]);if(_0x961679&&_0x961679[_0xf49c('0x66')]&&_0x961679[_0xf49c('0x66')]!==_0xf49c('0x67')){logger['info']('[OUTBOUND]',_0xf49c('0x50'));_0xf908dc[_0xf49c('0x53')]=util[_0xf49c('0x10')](_0xf49c('0x51'),_0x261c2f['serverUrl'],_0xf908dc[_0xf49c('0x52')],md5(_0xf908dc[_0xf49c('0x52')]));}headers[_0xf49c('0x54')]=getAuth(_0x261c2f);return getUser(_0x261c2f,_0x585fab['email'])[_0xf49c('0x18')](function(_0x5a2a27){_0x4e8ca9=_0x5a2a27;logger['info'](_0xf49c('0x56'),_0x4e8ca9['id']);return getEndUser(_0x261c2f,_0xf908dc[_0xf49c('0x68')],_0xf908dc[_0xf49c('0x69')]);})[_0xf49c('0x18')](function(_0x3de6f3){_0x3356c7=_0x3de6f3;logger[_0xf49c('0xe')](_0xf49c('0x59'),_0x3356c7['id']);return getTicket(_0x261c2f,_0x4e8ca9,_0x3356c7,_0x264020,_0xf908dc);})[_0xf49c('0x18')](function(_0x23ffd4){if(_0x23ffd4){logger[_0xf49c('0xe')](_0xf49c('0x5a'),_0x23ffd4['id']);switch(_0x261c2f[_0xf49c('0x44')]){case _0xf49c('0x5b'):logger[_0xf49c('0xe')](_0xf49c('0x6a'),_0xf49c('0x5c'));return request({'uri':util['format'](_0xf49c('0x5d'),_0x261c2f[_0xf49c('0x11')],_0x4e8ca9['id'],_0x23ffd4['id']),'method':_0xf49c('0x12')});case _0xf49c('0x5e'):logger[_0xf49c('0xe')]('[OUTBOUND]',_0xf49c('0x5f'));emit(util[_0xf49c('0x10')]('user:%s',_0x585fab['name']),_0xf49c('0x6b'),{'uri':util[_0xf49c('0x10')](_0xf49c('0x6c'),_0x261c2f[_0xf49c('0x11')][_0xf49c('0x60')]('/api/v2',''),_0x23ffd4['id'])});break;default:logger['error'](_0xf49c('0x6a'),_0xf49c('0x62'));}}})[_0xf49c('0x63')](function(_0x156c1c){logger[_0xf49c('0x61')](_0xf49c('0x6d'),util['inspect'](_0x156c1c,{'showHidden':!![],'depth':null}));});};exports[_0xf49c('0x6e')]=function(_0x11227e,_0x3e64b5,_0x3bf877,_0x2c89d3,_0x217451,_0x1690e7){var _0x1d3a4d,_0x463fb1;_0x1690e7[_0xf49c('0x11')]=intUtil[_0xf49c('0x4d')](_0x1690e7[_0xf49c('0x11')]);_0x1690e7[_0xf49c('0x4e')]=intUtil[_0xf49c('0x4d')](_0x1690e7[_0xf49c('0x4e')]);if(_0x217451&&_0x217451[_0xf49c('0x6f')]){logger[_0xf49c('0xe')]('['+_0x3e64b5[_0xf49c('0x70')]['toUpperCase']()+']',_0xf49c('0x50'));_0x3e64b5[_0xf49c('0x53')]=util['format'](_0xf49c('0x51'),_0x1690e7[_0xf49c('0x4e')],_0x3e64b5[_0xf49c('0x52')],md5(_0x3e64b5[_0xf49c('0x52')]));}else{_0x3e64b5[_0xf49c('0x53')]='';}headers['Authorization']=getAuth(_0x1690e7);return getUser(_0x1690e7)['then'](function(_0x4c5115){_0x1d3a4d=_0x4c5115;logger[_0xf49c('0xe')](_0xf49c('0x56'),_0x1d3a4d['id']);return getEndUser(_0x1690e7,_0x3e64b5['calleridname'],_0x3e64b5[_0xf49c('0x58')]);})[_0xf49c('0x18')](function(_0x1bf689){_0x463fb1=_0x1bf689;logger['info'](_0xf49c('0x59'),_0x463fb1['id']);return getTicket(_0x1690e7,_0x1d3a4d,_0x463fb1,_0x3bf877,_0x3e64b5);})[_0xf49c('0x18')](function(_0x21086d){if(_0x21086d){logger['info'](_0xf49c('0x5a'),_0x21086d['id']);}})['catch'](function(_0x4e1e77){logger[_0xf49c('0x61')]('['+_0x3e64b5[_0xf49c('0x70')][_0xf49c('0x71')]()+']'+_0xf49c('0x72'),util[_0xf49c('0x65')](_0x4e1e77,{'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 1b76b92..a1d1dd7 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 _0x5be0=['Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','destcalleridname','Outbound','[OUTBOUND]','https://crm.','unmanaged','toUpperCase','zoho.eu','lodash','request-promise','md5','util','./util','ioredis','bluebird','zoho','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','idField','content','toString','type','variableName','Variable','name','toLowerCase','split','isNil','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','info','Using\x20the\x20admin\x20account!','findIndex','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','Leads','What_Id','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','complete','connect','Answered','rejected','Abandoned','Timeout','Call_Start_Time','starttime','agentcalledAt'];(function(_0x41bb97,_0x5edc27){var _0x551f03=function(_0x2531ff){while(--_0x2531ff){_0x41bb97['push'](_0x41bb97['shift']());}};_0x551f03(++_0x5edc27);}(_0x5be0,0x154));var _0x05be=function(_0x4ab98e,_0x1c9ce1){_0x4ab98e=_0x4ab98e-0x0;var _0x17945b=_0x5be0[_0x4ab98e];return _0x17945b;};'use strict';var _=require(_0x05be('0x0'));var rp=require(_0x05be('0x1'));var md5=require(_0x05be('0x2'));var util=require(_0x05be('0x3'));var intUtil=require(_0x05be('0x4'));var moment=require('moment');var Redis=require(_0x05be('0x5'));var BPromise=require(_0x05be('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x05be('0x7'));config['redis']=_[_0x05be('0x8')](config['redis'],{'host':_0x05be('0x9'),'port':0x18eb});var io=require(_0x05be('0xa'))(new Redis(config['redis']));function emit(_0x202529,_0x228ed4,_0x425b2b){io['to'](_0x202529)[_0x05be('0xb')](_0x228ed4,_0x425b2b);}function request(_0x167aa2){logger[_0x05be('0xc')](_0x05be('0xd'),JSON[_0x05be('0xe')](_0x167aa2));return rp(_0x167aa2);}function getCustomFields(_0x4929fa,_0x428db2){var _0x1aa4df={};if(_0x4929fa[_0x05be('0xf')]>0x0){_[_0x05be('0x10')](_0x4929fa,function(_0x3fd7e4){if(_['includes']([_0x05be('0x11'),'picklist'],_0x3fd7e4['type'])&&_0x3fd7e4[_0x05be('0x12')]){_0x1aa4df[_0x3fd7e4[_0x05be('0x12')]]=_0x3fd7e4[_0x05be('0x13')][_0x05be('0x14')]();}else if(_0x3fd7e4[_0x05be('0x15')]==='variable'&&_0x3fd7e4[_0x05be('0x16')]&&_0x3fd7e4[_0x05be('0x12')]&&_0x428db2[_0x3fd7e4[_0x05be('0x16')]]){_0x1aa4df[_0x3fd7e4['idField']]=_0x428db2[_0x3fd7e4[_0x05be('0x16')]][_0x05be('0x14')]();}else if(_0x3fd7e4[_0x05be('0x15')]==='customVariable'&&_0x3fd7e4[_0x05be('0x17')]&&_0x3fd7e4[_0x05be('0x17')]['name']&&_0x3fd7e4[_0x05be('0x12')]&&_0x428db2[_0x3fd7e4['Variable'][_0x05be('0x18')][_0x05be('0x19')]()]){_0x1aa4df[_0x3fd7e4['idField']]=_0x428db2[_0x3fd7e4[_0x05be('0x17')][_0x05be('0x18')][_0x05be('0x19')]()]['toString']();}});}return _0x1aa4df;}function getName(_0x12d102){if(_0x12d102['indexOf']('\x20')>0x0){var _0x4ac091=_0x12d102[_0x05be('0x1a')](/ (.+)/);if(_0x4ac091[0x1]){return _0x4ac091;}}return[_0x12d102,_0x12d102];}var accountsTokens={};function getAccessToken(_0x83765f){return new Promise(function(_0x49f3a7,_0x58e5b5){if(!_[_0x05be('0x1b')](accountsTokens[_0x83765f['id']])&&!_['isNil'](accountsTokens[_0x83765f['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x83765f['id']][_0x05be('0x1c')])){_0x49f3a7(accountsTokens[_0x83765f['id']][_0x05be('0x1d')]);}}var _0x1e6d3e;switch(_0x83765f[_0x05be('0x1e')]){case'US':_0x1e6d3e='https://accounts.zoho.com';break;case'AU':_0x1e6d3e=_0x05be('0x1f');break;case'EU':_0x1e6d3e='https://accounts.zoho.eu';break;case'IN':_0x1e6d3e=_0x05be('0x20');break;case'CN':_0x1e6d3e=_0x05be('0x21');break;default:_0x1e6d3e='https://accounts.zoho.eu';break;}var _0x29296b={'method':_0x05be('0x22'),'uri':_0x1e6d3e+_0x05be('0x23'),'qs':{'refresh_token':_0x83765f[_0x05be('0x24')],'client_id':_0x83765f[_0x05be('0x25')],'client_secret':_0x83765f[_0x05be('0x26')],'grant_type':_0x05be('0x27')},'json':!![]};return rp(_0x29296b)[_0x05be('0x28')](function(_0x467d40){accountsTokens[_0x83765f['id']]={'access_token':_0x467d40[_0x05be('0x1d')],'expires_in':moment()[_0x05be('0x29')](_0x467d40[_0x05be('0x1c')],_0x05be('0x2a'))};_0x49f3a7(_0x467d40[_0x05be('0x1d')]);})[_0x05be('0x2b')](function(_0x18edeb){logger[_0x05be('0x2c')](_0x05be('0x2d'),_0x18edeb[_0x05be('0x2e')]);_0x58e5b5(_0x18edeb);});});}function getUser(_0x10ecbf,_0x281c3e,_0x315d51,_0x43f2fa){logger['info'](_0x05be('0x2f'));return request({'method':'GET','uri':util[_0x05be('0x30')](_0x05be('0x31'),_0x281c3e),'qs':{'type':_0x05be('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x10ecbf},'json':!![]})[_0x05be('0x28')](function(_0x6e4f87){if(_0x6e4f87[_0x05be('0x33')]){var _0x489905=-0x1;if(_[_0x05be('0x34')](_0x6e4f87[_0x05be('0x33')])){if(!_[_0x05be('0x1b')](_0x43f2fa)){_0x489905=_['findIndex'](_0x6e4f87['users'],function(_0xcf34a5){return _0xcf34a5[_0x05be('0x35')]===_0x43f2fa;});}if(_0x489905>=0x0){logger[_0x05be('0x36')]('Agent\x20found!');}else{logger[_0x05be('0x36')](_0x05be('0x37'));_0x489905=_[_0x05be('0x38')](_0x6e4f87[_0x05be('0x33')],function(_0x5ed261){return _0x5ed261[_0x05be('0x39')]['name']==='Administrator';});}return _0x6e4f87[_0x05be('0x33')][_0x489905];}else{if(_0x6e4f87[_0x05be('0x3a')]['profile'][_0x05be('0x18')]==='Administrator'){logger[_0x05be('0x36')](_0x05be('0x37'));user=_0x6e4f87['user'];return user;}else{logger[_0x05be('0x2c')](_0x05be('0x3b'),JSON[_0x05be('0xe')](_0x6e4f87));throw new Error(_0x05be('0x3c')+JSON[_0x05be('0xe')](_0x6e4f87));}}}else{logger[_0x05be('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x05be('0xe')](_0x6e4f87));throw new Error(_0x05be('0x3c')+JSON[_0x05be('0xe')](_0x6e4f87));}})['catch'](function(_0x23b232){console[_0x05be('0x2c')](_0x23b232);});}function getZohoUser(_0x3035c6,_0x47f5c4){return new BPromise(function(_0x503887,_0xd4fc86){request(_0x3035c6)['then'](function(_0x39462d){var _0x334176=null;if(_0x39462d){_0x334176=_0x39462d[_0x05be('0x3d')][0x0];_0x334176[_0x05be('0x3e')]=_0x47f5c4;}_0x503887(_0x334176);})[_0x05be('0x2b')](function(_0x2a58db){_0xd4fc86(_0x2a58db);});});}function createEndUser(_0xd33c70,_0xc3ce8f,_0x23c102,_0x5506dc,_0x1f246e,_0x216bef){var _0x23c102=getName(_0x23c102);return request({'method':_0x05be('0x22'),'uri':_0x05be('0x3f')+_0xc3ce8f+_0x05be('0x40')+_[_0x05be('0x41')](_0x216bef[_0x05be('0x42')])+'s','body':{'data':[{'Last_Name':_0x23c102[0x1],'First_Name':_0x23c102[0x0],'Phone':_0x5506dc,'Owner':{'name':!_[_0x05be('0x1b')](_0x1f246e[_0x05be('0x43')][_0x05be('0x18')])?_0x1f246e[_0x05be('0x43')][_0x05be('0x18')]:!_[_0x05be('0x1b')](_0x1f246e[_0x05be('0x44')])?_0x1f246e['first_name']+'\x20'+_0x1f246e[_0x05be('0x45')]:_0x1f246e['last_name'],'id':_0x1f246e['id']}}]},'headers':{'Authorization':_0x05be('0x46')+_0xd33c70},'json':!![]})['then'](function(_0x341d68){if(_0x341d68&&_0x341d68[_0x05be('0x3d')][0x0][_0x05be('0x47')]===_0x05be('0x48')){var _0x42898c=_0x341d68['data'][0x0][_0x05be('0x49')];_0x42898c[_0x05be('0x3e')]=_[_0x05be('0x41')](_0x216bef['moduleCreate'])+'s';return _0x42898c;}logger['error'](_0x05be('0x3b'),JSON[_0x05be('0xe')](data));throw new Error(_0x05be('0x4a')+JSON['stringify'](data));})['catch'](function(_0x572fed){console['log']('CREATE\x20ERROR',_0x572fed);});}function getEndUser(_0x52f925,_0x3b3dd2,_0x50ba3d,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79){var _0x1d17b5={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x52f925},'json':!![]};switch(_0x58ac79['moduleSearch']){case _0x05be('0x4b'):_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,_0x05be('0x4d'))[_0x05be('0x28')](function(_0x534ced){if(_0x534ced)return _0x534ced;_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+_0x05be('0x4e')+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,'Leads')[_0x05be('0x28')](function(_0x419311){if(_0x419311)return _0x419311;if(_0x58ac79[_0x05be('0x42')]!=_0x05be('0x4f')){return createEndUser(_0x52f925,_0x3b3dd2,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79);}else{return{};}});});break;case'contact':_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,_0x05be('0x4d'))[_0x05be('0x28')](function(_0x1e2add){if(_0x1e2add)return _0x1e2add;if(_0x58ac79['moduleCreate']!=_0x05be('0x4f')){return createEndUser(_0x52f925,_0x3b3dd2,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79);}else{return{};}});break;case _0x05be('0x50'):_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,'Leads')['then'](function(_0x372720){if(_0x372720)return _0x372720;if(_0x58ac79['moduleCreate']!='nothing'){return createEndUser(_0x52f925,_0x3b3dd2,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79);}else{return{};}});break;}}function getCall(_0x2caf66,_0x11ebc1,_0x15dfa9,_0x35503a,_0x444fe2,_0x3a2fbb,_0x27be62,_0x180ec9){logger['info']('Creating\x20new\x20call...');var _0x383313={};_0x383313['Owner']={'name':!_[_0x05be('0x1b')](_0x35503a[_0x05be('0x43')]['name'])&&!_[_0x05be('0x1b')](_0x35503a[_0x05be('0x39')]['name'])&&_0x35503a[_0x05be('0x39')][_0x05be('0x18')]==='administrator'?_0x35503a['role'][_0x05be('0x18')]:!_['isNil'](_0x35503a[_0x05be('0x44')])?_0x35503a[_0x05be('0x44')]+'\x20'+_0x35503a[_0x05be('0x45')]:_0x35503a['last_name'],'id':_0x35503a['id']};_0x383313[_0x05be('0x51')]=intUtil['getString'](_0x3a2fbb[_0x05be('0x52')],_0x27be62,'\x20');_0x383313[_0x05be('0x53')]=intUtil[_0x05be('0x54')](_0x3a2fbb[_0x05be('0x55')],_0x27be62,'\x0a');if(_0x444fe2[_0x05be('0x3e')]===_0x05be('0x4d')){_0x383313[_0x05be('0x56')]={'name':!_['isNil'](_0x444fe2[_0x05be('0x57')])?_0x444fe2[_0x05be('0x57')]:!_[_0x05be('0x1b')](_0x444fe2['First_Name'])?_0x444fe2['First_Name']+'\x20'+_0x444fe2['Last_Name']:_0x444fe2['Last_Name'],'id':_0x444fe2['id']};}if(_0x444fe2['enduserType']===_0x05be('0x58')){_0x383313[_0x05be('0x59')]={'name':!_[_0x05be('0x1b')](_0x444fe2[_0x05be('0x57')])?_0x444fe2['Full_Name']:!_['isNil'](_0x444fe2['First_Name'])?_0x444fe2[_0x05be('0x5a')]+'\x20'+_0x444fe2[_0x05be('0x5b')]:_0x444fe2[_0x05be('0x5b')],'id':_0x444fe2['id']};_0x383313[_0x05be('0x5c')]=_[_0x05be('0x41')](_0x444fe2[_0x05be('0x3e')]);}if(_0x27be62[_0x05be('0x5d')]){_0x383313[_0x05be('0x5e')]=moment[_0x05be('0x5f')](parseInt(_0x27be62[_0x05be('0x5d')])*0x3e8)[_0x05be('0x30')](_0x05be('0x60'));}else if(_0x27be62[_0x05be('0x61')]&&_0x27be62[_0x05be('0x62')]){_0x383313['Call_Duration']=moment[_0x05be('0x5f')](moment(_0x27be62[_0x05be('0x62')],_0x05be('0x63'))[_0x05be('0x64')](moment(_0x27be62['starttime'],_0x05be('0x63'))))[_0x05be('0x30')](_0x05be('0x60'));}switch(_0x27be62[_0x05be('0x65')]){case _0x05be('0x66'):_0x383313[_0x05be('0x67')]='Called';break;case _0x05be('0x68'):case _0x05be('0x69'):_0x383313[_0x05be('0x67')]=_0x05be('0x6a');break;case _0x05be('0x6b'):_0x383313[_0x05be('0x67')]='Rejected';break;case'abandoned':_0x383313[_0x05be('0x67')]=_0x05be('0x6c');break;case'timeout':_0x383313[_0x05be('0x67')]=_0x05be('0x6d');default:}_0x383313[_0x05be('0x6e')]=(_0x180ec9==='outbound'?moment(_0x27be62[_0x05be('0x6f')])[_0x05be('0x30')](_0x05be('0x63')):moment(_0x27be62[_0x05be('0x70')])['format'](_0x05be('0x63')))||moment()[_0x05be('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x383313[_0x05be('0x71')]=_0x180ec9||_0x05be('0x72');_0x383313=_[_0x05be('0x73')](_0x383313,getCustomFields(_0x3a2fbb[_0x05be('0x74')],_0x27be62));return request({'method':'POST','uri':_0x05be('0x3f')+_0x11ebc1+_0x05be('0x75'),'headers':{'Authorization':_0x05be('0x46')+_0x2caf66},'body':{'data':[_0x383313]},'json':!![]})['then'](function(_0x40c132){if(_0x40c132&&_0x40c132[_0x05be('0x3d')][0x0][_0x05be('0x47')]===_0x05be('0x48')){logger[_0x05be('0x36')](_0x05be('0x76'));return{'id':_0x40c132['data'][0x0]['details']['id']};}})[_0x05be('0x2b')](function(_0x2a2a86){logger['info'](_0x05be('0x77'),_0x2a2a86[_0x05be('0x2e')]);console[_0x05be('0x78')](_0x05be('0x77'),_0x2a2a86);});}exports[_0x05be('0x79')]=function(_0x10d101,_0x49f344,_0x22ca73,_0x328786,_0x59fdb4,_0x2f2aa4){var _0x2f3252,_0x29a937,_0x445085;_0x2f2aa4[_0x05be('0x7a')]=intUtil[_0x05be('0x7b')](_0x2f2aa4[_0x05be('0x7a')]);_0x2f2aa4[_0x05be('0x7c')]=intUtil['stripTrailingSlash'](_0x2f2aa4[_0x05be('0x7c')]);if(_0x59fdb4&&_0x59fdb4[_0x05be('0x7d')]){logger[_0x05be('0x36')](_0x05be('0x7e'),_0x05be('0x7f'));_0x49f344[_0x05be('0x80')]=_0x2f2aa4[_0x05be('0x7c')]+_0x05be('0x81')+_0x49f344[_0x05be('0x82')]+_0x05be('0x83')+md5(_0x49f344['uniqueid']);}else{_0x49f344[_0x05be('0x80')]='';}var _0xd4933c=_0x2f2aa4['host']==='zoho.eu'?'eu':_0x05be('0x84');return getAccessToken(_0x2f2aa4)[_0x05be('0x28')](function(_0x520482){_0x445085=_0x520482;return getUser(_0x445085,_0xd4933c,_0x2f2aa4,_0x328786['email']);})[_0x05be('0x28')](function(_0x4c64e0){_0x2f3252=_0x4c64e0;logger[_0x05be('0x36')](_0x05be('0x85'),_0x2f3252['id']);return getEndUser(_0x445085,_0xd4933c,_0x2f2aa4,_0x49f344[_0x05be('0x86')],_0x49f344[_0x05be('0x87')],_0x2f3252,_0x22ca73);})['then'](function(_0x445620){_0x29a937=_0x445620;return getCall(_0x445085,_0xd4933c,_0x2f2aa4,_0x2f3252,_0x29a937,_0x22ca73,_0x49f344,_0x05be('0x72'));})[_0x05be('0x28')](function(_0x118614){if(_0x118614){logger[_0x05be('0x36')](_0x05be('0x88'),_0x118614['id']);logger[_0x05be('0x36')]('[QUEUE]',_0x05be('0x89'));emit(util['format'](_0x05be('0x8a'),_0x328786['name']),_0x05be('0x8b'),{'uri':'https://crm.'+_0x2f2aa4['host']+_0x05be('0x8c')+_0x118614['id']});}})[_0x05be('0x2b')](function(_0x3c60ff){logger[_0x05be('0x2c')](_0x05be('0x7e'),JSON[_0x05be('0xe')](_0x3c60ff));});};exports[_0x05be('0x8d')]=function(_0x4848d9,_0x8e4cfd,_0x19a8b2,_0x4e2330,_0xfb1c69,_0xd40440,_0x12db15){var _0x564a04,_0x5adc5f,_0x22e210;_0xd40440['host']=intUtil[_0x05be('0x7b')](_0xd40440['host']);_0xd40440[_0x05be('0x7c')]=intUtil[_0x05be('0x7b')](_0xd40440[_0x05be('0x7c')]);if(_0x12db15&&_0x12db15['recordingFormat']&&_0x12db15[_0x05be('0x8e')]!==_0x05be('0x8f')){logger[_0x05be('0x36')]('[OUTBOUND]',_0x05be('0x7f'));_0x8e4cfd['recordingURL']=_0xd40440[_0x05be('0x7c')]+_0x05be('0x81')+_0x8e4cfd[_0x05be('0x82')]+_0x05be('0x83')+md5(_0x8e4cfd[_0x05be('0x82')]);}var _0x80c306=_0xd40440[_0x05be('0x7a')]==='zoho.eu'?'eu':_0x05be('0x84');return getAccessToken(_0xd40440)['then'](function(_0x3798fd){_0x22e210=_0x3798fd;return getUser(_0x22e210,_0x80c306,_0xd40440,_0x4e2330['email']);})[_0x05be('0x28')](function(_0x3fda72){_0x564a04=_0x3fda72;logger[_0x05be('0x36')](_0x05be('0x85'),_0x564a04['id']);return getEndUser(_0x22e210,_0x80c306,_0xd40440,_0x8e4cfd[_0x05be('0x90')],_0x8e4cfd['destcalleridnum'],_0x564a04,_0x19a8b2);})['then'](function(_0x4567af){_0x5adc5f=_0x4567af;return getCall(_0x22e210,_0x80c306,_0xd40440,_0x564a04,_0x5adc5f,_0x19a8b2,_0x8e4cfd,_0x05be('0x91'));})[_0x05be('0x28')](function(_0xd42ebd){if(_0xd42ebd){logger[_0x05be('0x36')](_0x05be('0x88'),_0xd42ebd['id']);logger['info'](_0x05be('0x92'),_0x05be('0x89'));emit(util[_0x05be('0x30')](_0x05be('0x8a'),_0x4e2330[_0x05be('0x18')]),_0x05be('0x8b'),{'uri':_0x05be('0x93')+_0xd40440['host']+_0x05be('0x8c')+_0xd42ebd['id']});}})[_0x05be('0x2b')](function(_0x26a33d){logger[_0x05be('0x2c')](_0x05be('0x92'),JSON[_0x05be('0xe')](_0x26a33d));});};exports[_0x05be('0x94')]=function(_0x23f19e,_0x1212f9,_0x26c735,_0x224155,_0x130ccd,_0x4cc391){var _0x122fa1,_0xe7d8b1,_0x28c81b;_0x4cc391[_0x05be('0x7a')]=intUtil[_0x05be('0x7b')](_0x4cc391[_0x05be('0x7a')]);_0x4cc391[_0x05be('0x7c')]=intUtil['stripTrailingSlash'](_0x4cc391[_0x05be('0x7c')]);if(_0x130ccd&&_0x130ccd['monitor_format']){logger[_0x05be('0x36')]('['+_0x1212f9['lastevent'][_0x05be('0x95')]()+']',_0x05be('0x7f'));_0x1212f9[_0x05be('0x80')]=_0x4cc391['serverUrl']+_0x05be('0x81')+_0x1212f9['uniqueid']+_0x05be('0x83')+md5(_0x1212f9['uniqueid']);}else{_0x1212f9[_0x05be('0x80')]='';}var _0x1155ac=_0x4cc391[_0x05be('0x7a')]===_0x05be('0x96')?'eu':_0x05be('0x84');return getAccessToken(_0x4cc391)['then'](function(_0x49123c){_0x28c81b=_0x49123c;return getUser(_0x28c81b,_0x1155ac,_0x4cc391);})[_0x05be('0x28')](function(_0x576aa4){_0x122fa1=_0x576aa4;logger[_0x05be('0x36')](_0x05be('0x85'),_0x122fa1['id']);return getEndUser(_0x28c81b,_0x1155ac,_0x4cc391,_0x1212f9['calleridname'],_0x1212f9['calleridnum'],_0x122fa1,_0x26c735);})['then'](function(_0x12bf6a){_0xe7d8b1=_0x12bf6a;return getCall(_0x28c81b,_0x1155ac,_0x4cc391,_0x122fa1,_0xe7d8b1,_0x26c735,_0x1212f9,'Inbound');})[_0x05be('0x28')](function(_0x178ca0){if(_0x178ca0){logger['info'](_0x05be('0x88'),_0x178ca0['id']);}})[_0x05be('0x2b')](function(_0x237c91){logger[_0x05be('0x2c')]('['+_0x1212f9[_0x05be('0x65')]['toUpperCase']()+']',JSON['stringify'](_0x237c91));});}; \ No newline at end of file +var _0x9e93=['Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','complete','connect','Call_Result','Answered','Rejected','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','SUCCESS','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','destcalleridnum','user:%s','unmanaged','toUpperCase','lodash','md5','./util','moment','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','[HTTP]','stringify','length','includes','string','picklist','type','idField','toString','variableName','customVariable','name','toLowerCase','indexOf','split','isNil','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','isArrayLikeObject','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','details','enduserType','Error:\x20','log','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id'];(function(_0x38193f,_0x2c6649){var _0x283b66=function(_0x1da004){while(--_0x1da004){_0x38193f['push'](_0x38193f['shift']());}};_0x283b66(++_0x2c6649);}(_0x9e93,0xca));var _0x39e9=function(_0x502598,_0x1e95c8){_0x502598=_0x502598-0x0;var _0xbdee21=_0x9e93[_0x502598];return _0xbdee21;};'use strict';var _=require(_0x39e9('0x0'));var rp=require('request-promise');var md5=require(_0x39e9('0x1'));var util=require('util');var intUtil=require(_0x39e9('0x2'));var moment=require(_0x39e9('0x3'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x39e9('0x4'));var logger=require(_0x39e9('0x5'))(_0x39e9('0x6'));config[_0x39e9('0x7')]=_[_0x39e9('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x39e9('0x9'))(new Redis(config['redis']));function emit(_0x61f709,_0x63d54a,_0x3cb80e){io['to'](_0x61f709)['emit'](_0x63d54a,_0x3cb80e);}function request(_0xc4e8b0){logger['debug'](_0x39e9('0xa'),JSON[_0x39e9('0xb')](_0xc4e8b0));return rp(_0xc4e8b0);}function getCustomFields(_0x2a2607,_0x2b2771){var _0x1d49c3={};if(_0x2a2607[_0x39e9('0xc')]>0x0){_['forEach'](_0x2a2607,function(_0x240fa2){if(_[_0x39e9('0xd')]([_0x39e9('0xe'),_0x39e9('0xf')],_0x240fa2[_0x39e9('0x10')])&&_0x240fa2[_0x39e9('0x11')]){_0x1d49c3[_0x240fa2[_0x39e9('0x11')]]=_0x240fa2['content'][_0x39e9('0x12')]();}else if(_0x240fa2[_0x39e9('0x10')]==='variable'&&_0x240fa2[_0x39e9('0x13')]&&_0x240fa2[_0x39e9('0x11')]&&_0x2b2771[_0x240fa2['variableName']]){_0x1d49c3[_0x240fa2[_0x39e9('0x11')]]=_0x2b2771[_0x240fa2[_0x39e9('0x13')]][_0x39e9('0x12')]();}else if(_0x240fa2[_0x39e9('0x10')]===_0x39e9('0x14')&&_0x240fa2['Variable']&&_0x240fa2['Variable'][_0x39e9('0x15')]&&_0x240fa2[_0x39e9('0x11')]&&_0x2b2771[_0x240fa2['Variable']['name'][_0x39e9('0x16')]()]){_0x1d49c3[_0x240fa2[_0x39e9('0x11')]]=_0x2b2771[_0x240fa2['Variable'][_0x39e9('0x15')][_0x39e9('0x16')]()][_0x39e9('0x12')]();}});}return _0x1d49c3;}function getName(_0x1c75fa){if(_0x1c75fa[_0x39e9('0x17')]('\x20')>0x0){var _0x31aa4e=_0x1c75fa[_0x39e9('0x18')](/ (.+)/);if(_0x31aa4e[0x1]){return _0x31aa4e;}}return[_0x1c75fa,_0x1c75fa];}var accountsTokens={};function getAccessToken(_0x1dd1b2){return new Promise(function(_0x8d203e,_0xcf70ff){if(!_[_0x39e9('0x19')](accountsTokens[_0x1dd1b2['id']])&&!_[_0x39e9('0x19')](accountsTokens[_0x1dd1b2['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x1dd1b2['id']][_0x39e9('0x1a')])){_0x8d203e(accountsTokens[_0x1dd1b2['id']]['access_token']);}}var _0x583b3c;switch(_0x1dd1b2[_0x39e9('0x1b')]){case'US':_0x583b3c='https://accounts.zoho.com';break;case'AU':_0x583b3c='https://accounts.zoho.com.au';break;case'EU':_0x583b3c=_0x39e9('0x1c');break;case'IN':_0x583b3c='https://accounts.zoho.in';break;case'CN':_0x583b3c=_0x39e9('0x1d');break;default:_0x583b3c=_0x39e9('0x1c');break;}var _0x227307={'method':_0x39e9('0x1e'),'uri':_0x583b3c+_0x39e9('0x1f'),'qs':{'refresh_token':_0x1dd1b2[_0x39e9('0x20')],'client_id':_0x1dd1b2[_0x39e9('0x21')],'client_secret':_0x1dd1b2[_0x39e9('0x22')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x227307)['then'](function(_0x310e37){accountsTokens[_0x1dd1b2['id']]={'access_token':_0x310e37[_0x39e9('0x23')],'expires_in':moment()[_0x39e9('0x24')](_0x310e37[_0x39e9('0x1a')],_0x39e9('0x25'))};_0x8d203e(_0x310e37[_0x39e9('0x23')]);})[_0x39e9('0x26')](function(_0x7429b8){logger[_0x39e9('0x27')](_0x39e9('0x28'),_0x7429b8[_0x39e9('0x29')]);_0xcf70ff(_0x7429b8);});});}function getUser(_0x119d81,_0x5365d6,_0x567cfe,_0x2d5274){logger[_0x39e9('0x2a')]('Search\x20user');return request({'method':_0x39e9('0x2b'),'uri':util[_0x39e9('0x2c')](_0x39e9('0x2d'),_0x5365d6),'qs':{'type':_0x39e9('0x2e')},'headers':{'Authorization':_0x39e9('0x2f')+_0x119d81},'json':!![]})[_0x39e9('0x30')](function(_0x13efb9){if(_0x13efb9['users']){var _0x3846bd=-0x1;if(_[_0x39e9('0x31')](_0x13efb9[_0x39e9('0x32')])){if(!_[_0x39e9('0x19')](_0x2d5274)){_0x3846bd=_['findIndex'](_0x13efb9[_0x39e9('0x32')],function(_0x8462c6){return _0x8462c6[_0x39e9('0x33')]===_0x2d5274;});}if(_0x3846bd>=0x0){logger[_0x39e9('0x2a')](_0x39e9('0x34'));}else{logger[_0x39e9('0x2a')](_0x39e9('0x35'));_0x3846bd=_['findIndex'](_0x13efb9[_0x39e9('0x32')],function(_0x3f2615){return _0x3f2615['profile'][_0x39e9('0x15')]===_0x39e9('0x36');});}return _0x13efb9[_0x39e9('0x32')][_0x3846bd];}else{if(_0x13efb9[_0x39e9('0x37')][_0x39e9('0x38')][_0x39e9('0x15')]===_0x39e9('0x36')){logger[_0x39e9('0x2a')]('Using\x20the\x20admin\x20account!');user=_0x13efb9[_0x39e9('0x37')];return user;}else{logger[_0x39e9('0x27')](_0x39e9('0x39'),JSON[_0x39e9('0xb')](_0x13efb9));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x39e9('0xb')](_0x13efb9));}}}else{logger[_0x39e9('0x27')](_0x39e9('0x39'),JSON[_0x39e9('0xb')](_0x13efb9));throw new Error(_0x39e9('0x3a')+JSON[_0x39e9('0xb')](_0x13efb9));}})[_0x39e9('0x26')](function(_0x44c834){console['error'](_0x44c834);});}function getZohoUser(_0x1c4920,_0x613310){return new BPromise(function(_0xe9a38b,_0x361e1a){request(_0x1c4920)[_0x39e9('0x30')](function(_0x27d800){var _0x531682=null;if(_0x27d800){_0x531682=_0x27d800[_0x39e9('0x3b')][0x0];_0x531682['enduserType']=_0x613310;}_0xe9a38b(_0x531682);})[_0x39e9('0x26')](function(_0x1223d7){_0x361e1a(_0x1223d7);});});}function createEndUser(_0x370e88,_0x115a34,_0x449594,_0x18ab20,_0x23a45a,_0x227a1a){var _0x449594=getName(_0x449594);return request({'method':_0x39e9('0x1e'),'uri':_0x39e9('0x3c')+_0x115a34+'/crm/v2/'+_[_0x39e9('0x3d')](_0x227a1a[_0x39e9('0x3e')])+'s','body':{'data':[{'Last_Name':_0x449594[0x1],'First_Name':_0x449594[0x0],'Phone':_0x18ab20,'Owner':{'name':!_[_0x39e9('0x19')](_0x23a45a[_0x39e9('0x3f')][_0x39e9('0x15')])?_0x23a45a[_0x39e9('0x3f')][_0x39e9('0x15')]:!_[_0x39e9('0x19')](_0x23a45a[_0x39e9('0x40')])?_0x23a45a[_0x39e9('0x40')]+'\x20'+_0x23a45a[_0x39e9('0x41')]:_0x23a45a['last_name'],'id':_0x23a45a['id']}}]},'headers':{'Authorization':_0x39e9('0x2f')+_0x370e88},'json':!![]})[_0x39e9('0x30')](function(_0x496f4d){if(_0x496f4d&&_0x496f4d[_0x39e9('0x3b')][0x0][_0x39e9('0x42')]==='SUCCESS'){var _0xfe485c=_0x496f4d[_0x39e9('0x3b')][0x0][_0x39e9('0x43')];_0xfe485c[_0x39e9('0x44')]=_[_0x39e9('0x3d')](_0x227a1a[_0x39e9('0x3e')])+'s';return _0xfe485c;}logger[_0x39e9('0x27')](_0x39e9('0x39'),JSON[_0x39e9('0xb')](data));throw new Error(_0x39e9('0x45')+JSON[_0x39e9('0xb')](data));})[_0x39e9('0x26')](function(_0x5ab035){console[_0x39e9('0x46')]('CREATE\x20ERROR',_0x5ab035);});}function getEndUser(_0x3e7f73,_0x3bfabb,_0x4f8a7f,_0x5e16b2,_0x3bdf37,_0x4f2471,_0xfeedd3){var _0xb9abb9={'method':_0x39e9('0x2b'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3e7f73},'json':!![]};switch(_0xfeedd3[_0x39e9('0x47')]){case _0x39e9('0x48'):_0xb9abb9[_0x39e9('0x49')]=_0x39e9('0x3c')+_0x3bfabb+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3bdf37+'))';return getZohoUser(_0xb9abb9,_0x39e9('0x4a'))[_0x39e9('0x30')](function(_0x375dea){if(_0x375dea)return _0x375dea;_0xb9abb9[_0x39e9('0x49')]=_0x39e9('0x3c')+_0x3bfabb+_0x39e9('0x4b')+_0x3bdf37+'))';return getZohoUser(_0xb9abb9,_0x39e9('0x4c'))[_0x39e9('0x30')](function(_0x3fd528){if(_0x3fd528)return _0x3fd528;if(_0xfeedd3['moduleCreate']!=_0x39e9('0x4d')){return createEndUser(_0x3e7f73,_0x3bfabb,_0x5e16b2,_0x3bdf37,_0x4f2471,_0xfeedd3);}else{return{};}});});break;case _0x39e9('0x4e'):_0xb9abb9['uri']=_0x39e9('0x3c')+_0x3bfabb+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3bdf37+'))';return getZohoUser(_0xb9abb9,_0x39e9('0x4a'))[_0x39e9('0x30')](function(_0x37660c){if(_0x37660c)return _0x37660c;if(_0xfeedd3[_0x39e9('0x3e')]!='nothing'){return createEndUser(_0x3e7f73,_0x3bfabb,_0x5e16b2,_0x3bdf37,_0x4f2471,_0xfeedd3);}else{return{};}});break;case _0x39e9('0x4f'):_0xb9abb9[_0x39e9('0x49')]=_0x39e9('0x3c')+_0x3bfabb+_0x39e9('0x4b')+_0x3bdf37+'))';return getZohoUser(_0xb9abb9,_0x39e9('0x4c'))[_0x39e9('0x30')](function(_0x35d816){if(_0x35d816)return _0x35d816;if(_0xfeedd3[_0x39e9('0x3e')]!='nothing'){return createEndUser(_0x3e7f73,_0x3bfabb,_0x5e16b2,_0x3bdf37,_0x4f2471,_0xfeedd3);}else{return{};}});break;}}function getCall(_0x55aadc,_0x118036,_0x4859c4,_0x2d360f,_0x14e0ac,_0x29279c,_0x2a86ce,_0x575f2c){logger['info'](_0x39e9('0x50'));var _0x1f049e={};_0x1f049e['Owner']={'name':!_[_0x39e9('0x19')](_0x2d360f[_0x39e9('0x3f')][_0x39e9('0x15')])&&!_['isNil'](_0x2d360f['profile'][_0x39e9('0x15')])&&_0x2d360f[_0x39e9('0x38')][_0x39e9('0x15')]===_0x39e9('0x51')?_0x2d360f[_0x39e9('0x3f')][_0x39e9('0x15')]:!_['isNil'](_0x2d360f['first_name'])?_0x2d360f['first_name']+'\x20'+_0x2d360f[_0x39e9('0x41')]:_0x2d360f[_0x39e9('0x41')],'id':_0x2d360f['id']};_0x1f049e[_0x39e9('0x52')]=intUtil[_0x39e9('0x53')](_0x29279c[_0x39e9('0x54')],_0x2a86ce,'\x20');_0x1f049e[_0x39e9('0x55')]=intUtil[_0x39e9('0x53')](_0x29279c[_0x39e9('0x56')],_0x2a86ce,'\x0a');if(_0x14e0ac[_0x39e9('0x44')]==='Contacts'){_0x1f049e[_0x39e9('0x57')]={'name':!_['isNil'](_0x14e0ac[_0x39e9('0x58')])?_0x14e0ac['Full_Name']:!_[_0x39e9('0x19')](_0x14e0ac[_0x39e9('0x59')])?_0x14e0ac['First_Name']+'\x20'+_0x14e0ac[_0x39e9('0x5a')]:_0x14e0ac[_0x39e9('0x5a')],'id':_0x14e0ac['id']};}if(_0x14e0ac[_0x39e9('0x44')]===_0x39e9('0x4c')){_0x1f049e[_0x39e9('0x5b')]={'name':!_[_0x39e9('0x19')](_0x14e0ac[_0x39e9('0x58')])?_0x14e0ac[_0x39e9('0x58')]:!_[_0x39e9('0x19')](_0x14e0ac[_0x39e9('0x59')])?_0x14e0ac[_0x39e9('0x59')]+'\x20'+_0x14e0ac[_0x39e9('0x5a')]:_0x14e0ac[_0x39e9('0x5a')],'id':_0x14e0ac['id']};_0x1f049e[_0x39e9('0x5c')]=_[_0x39e9('0x3d')](_0x14e0ac[_0x39e9('0x44')]);}if(_0x2a86ce['talktime']){_0x1f049e['Call_Duration']=moment[_0x39e9('0x5d')](parseInt(_0x2a86ce['talktime'])*0x3e8)[_0x39e9('0x2c')](_0x39e9('0x5e'));}else if(_0x2a86ce[_0x39e9('0x5f')]&&_0x2a86ce[_0x39e9('0x60')]){_0x1f049e[_0x39e9('0x61')]=moment['utc'](moment(_0x2a86ce['endtime'],_0x39e9('0x62'))['diff'](moment(_0x2a86ce[_0x39e9('0x63')],'YYYY-MM-DDTHH:mm:ss')))[_0x39e9('0x2c')](_0x39e9('0x5e'));}switch(_0x2a86ce[_0x39e9('0x64')]){case _0x39e9('0x65'):_0x1f049e['Call_Result']='Called';break;case _0x39e9('0x66'):case _0x39e9('0x67'):_0x1f049e[_0x39e9('0x68')]=_0x39e9('0x69');break;case'rejected':_0x1f049e['Call_Result']=_0x39e9('0x6a');break;case'abandoned':_0x1f049e[_0x39e9('0x68')]=_0x39e9('0x6b');break;case _0x39e9('0x6c'):_0x1f049e[_0x39e9('0x68')]='Timeout';default:}_0x1f049e[_0x39e9('0x6d')]=(_0x575f2c===_0x39e9('0x6e')?moment(_0x2a86ce[_0x39e9('0x63')])[_0x39e9('0x2c')](_0x39e9('0x62')):moment(_0x2a86ce[_0x39e9('0x6f')])[_0x39e9('0x2c')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x39e9('0x2c')](_0x39e9('0x62'));_0x1f049e['Call_Type']=_0x575f2c||_0x39e9('0x70');_0x1f049e=_[_0x39e9('0x71')](_0x1f049e,getCustomFields(_0x29279c[_0x39e9('0x72')],_0x2a86ce));return request({'method':'POST','uri':_0x39e9('0x3c')+_0x118036+'/crm/v2/Calls','headers':{'Authorization':_0x39e9('0x2f')+_0x55aadc},'body':{'data':[_0x1f049e]},'json':!![]})['then'](function(_0x43f84d){if(_0x43f84d&&_0x43f84d[_0x39e9('0x3b')][0x0][_0x39e9('0x42')]===_0x39e9('0x73')){logger[_0x39e9('0x2a')](_0x39e9('0x74'));return{'id':_0x43f84d['data'][0x0][_0x39e9('0x43')]['id']};}})[_0x39e9('0x26')](function(_0x3b3881){logger['info']('err',_0x3b3881[_0x39e9('0x29')]);console['log'](_0x39e9('0x75'),_0x3b3881);});}exports['queue']=function(_0x17b35a,_0x2da8b2,_0x2eacec,_0x141938,_0x17347d,_0x3b8ff7){var _0x3cee7a,_0x5ae3fb,_0x3fb3e5;_0x3b8ff7[_0x39e9('0x76')]=intUtil[_0x39e9('0x77')](_0x3b8ff7[_0x39e9('0x76')]);_0x3b8ff7[_0x39e9('0x78')]=intUtil[_0x39e9('0x77')](_0x3b8ff7[_0x39e9('0x78')]);if(_0x17347d&&_0x17347d[_0x39e9('0x79')]){logger[_0x39e9('0x2a')](_0x39e9('0x7a'),'Recording\x20is\x20enabled!');_0x2da8b2[_0x39e9('0x7b')]=_0x3b8ff7[_0x39e9('0x78')]+'/api/voice/recordings/'+_0x2da8b2[_0x39e9('0x7c')]+'/downloads?type=uniqueid&token='+md5(_0x2da8b2[_0x39e9('0x7c')]);}else{_0x2da8b2[_0x39e9('0x7b')]='';}var _0x55871c=_0x3b8ff7[_0x39e9('0x76')]==='zoho.eu'?'eu':_0x39e9('0x7d');return getAccessToken(_0x3b8ff7)[_0x39e9('0x30')](function(_0x10af09){_0x3fb3e5=_0x10af09;return getUser(_0x3fb3e5,_0x55871c,_0x3b8ff7,_0x141938[_0x39e9('0x33')]);})['then'](function(_0xfec6f8){_0x3cee7a=_0xfec6f8;logger[_0x39e9('0x2a')]('The\x20User\x20ID\x20is:',_0x3cee7a['id']);return getEndUser(_0x3fb3e5,_0x55871c,_0x3b8ff7,_0x2da8b2[_0x39e9('0x7e')],_0x2da8b2[_0x39e9('0x7f')],_0x3cee7a,_0x2eacec);})['then'](function(_0x1ff6c2){_0x5ae3fb=_0x1ff6c2;return getCall(_0x3fb3e5,_0x55871c,_0x3b8ff7,_0x3cee7a,_0x5ae3fb,_0x2eacec,_0x2da8b2,_0x39e9('0x70'));})[_0x39e9('0x30')](function(_0x3159e1){if(_0x3159e1){logger[_0x39e9('0x2a')](_0x39e9('0x80'),_0x3159e1['id']);logger[_0x39e9('0x2a')](_0x39e9('0x7a'),_0x39e9('0x81'));emit(util[_0x39e9('0x2c')]('user:%s',_0x141938[_0x39e9('0x15')]),_0x39e9('0x82'),{'uri':_0x39e9('0x83')+_0x3b8ff7[_0x39e9('0x76')]+_0x39e9('0x84')+_0x3159e1['id']});}})[_0x39e9('0x26')](function(_0x453628){logger['error']('[QUEUE]',JSON['stringify'](_0x453628));});};exports['outbound']=function(_0x1ec124,_0x1759ef,_0x34a962,_0x2353e3,_0x3e57d4,_0x2029ba,_0x5a0159){var _0x1af8a9,_0x365a0c,_0x2d49bb;_0x2029ba[_0x39e9('0x76')]=intUtil[_0x39e9('0x77')](_0x2029ba['host']);_0x2029ba[_0x39e9('0x78')]=intUtil[_0x39e9('0x77')](_0x2029ba[_0x39e9('0x78')]);if(_0x5a0159&&_0x5a0159['recordingFormat']&&_0x5a0159[_0x39e9('0x85')]!==_0x39e9('0x86')){logger[_0x39e9('0x2a')](_0x39e9('0x87'),_0x39e9('0x88'));_0x1759ef[_0x39e9('0x7b')]=_0x2029ba[_0x39e9('0x78')]+_0x39e9('0x89')+_0x1759ef[_0x39e9('0x7c')]+_0x39e9('0x8a')+md5(_0x1759ef[_0x39e9('0x7c')]);}var _0x5b716c=_0x2029ba[_0x39e9('0x76')]===_0x39e9('0x8b')?'eu':_0x39e9('0x7d');return getAccessToken(_0x2029ba)[_0x39e9('0x30')](function(_0x4c5f97){_0x2d49bb=_0x4c5f97;return getUser(_0x2d49bb,_0x5b716c,_0x2029ba,_0x2353e3[_0x39e9('0x33')]);})[_0x39e9('0x30')](function(_0x2c603f){_0x1af8a9=_0x2c603f;logger[_0x39e9('0x2a')](_0x39e9('0x8c'),_0x1af8a9['id']);return getEndUser(_0x2d49bb,_0x5b716c,_0x2029ba,_0x1759ef['destcalleridname'],_0x1759ef[_0x39e9('0x8d')],_0x1af8a9,_0x34a962);})['then'](function(_0x5a4057){_0x365a0c=_0x5a4057;return getCall(_0x2d49bb,_0x5b716c,_0x2029ba,_0x1af8a9,_0x365a0c,_0x34a962,_0x1759ef,'Outbound');})[_0x39e9('0x30')](function(_0x2368ed){if(_0x2368ed){logger[_0x39e9('0x2a')](_0x39e9('0x80'),_0x2368ed['id']);logger[_0x39e9('0x2a')](_0x39e9('0x87'),_0x39e9('0x81'));emit(util['format'](_0x39e9('0x8e'),_0x2353e3[_0x39e9('0x15')]),_0x39e9('0x82'),{'uri':_0x39e9('0x83')+_0x2029ba['host']+_0x39e9('0x84')+_0x2368ed['id']});}})[_0x39e9('0x26')](function(_0x21ce34){logger['error'](_0x39e9('0x87'),JSON[_0x39e9('0xb')](_0x21ce34));});};exports[_0x39e9('0x8f')]=function(_0x195b56,_0x1baecc,_0x5ae8fe,_0x305ea0,_0x30e553,_0x5bf3f2){var _0x2afb42,_0xe0b432,_0x3a03f2;_0x5bf3f2[_0x39e9('0x76')]=intUtil[_0x39e9('0x77')](_0x5bf3f2['host']);_0x5bf3f2[_0x39e9('0x78')]=intUtil['stripTrailingSlash'](_0x5bf3f2['serverUrl']);if(_0x30e553&&_0x30e553['monitor_format']){logger[_0x39e9('0x2a')]('['+_0x1baecc[_0x39e9('0x64')][_0x39e9('0x90')]()+']','Recording\x20is\x20enabled!');_0x1baecc[_0x39e9('0x7b')]=_0x5bf3f2[_0x39e9('0x78')]+_0x39e9('0x89')+_0x1baecc[_0x39e9('0x7c')]+_0x39e9('0x8a')+md5(_0x1baecc[_0x39e9('0x7c')]);}else{_0x1baecc[_0x39e9('0x7b')]='';}var _0x5de460=_0x5bf3f2[_0x39e9('0x76')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x5bf3f2)[_0x39e9('0x30')](function(_0x16a5c8){_0x3a03f2=_0x16a5c8;return getUser(_0x3a03f2,_0x5de460,_0x5bf3f2);})[_0x39e9('0x30')](function(_0x50f696){_0x2afb42=_0x50f696;logger['info'](_0x39e9('0x8c'),_0x2afb42['id']);return getEndUser(_0x3a03f2,_0x5de460,_0x5bf3f2,_0x1baecc[_0x39e9('0x7e')],_0x1baecc[_0x39e9('0x7f')],_0x2afb42,_0x5ae8fe);})[_0x39e9('0x30')](function(_0x322171){_0xe0b432=_0x322171;return getCall(_0x3a03f2,_0x5de460,_0x5bf3f2,_0x2afb42,_0xe0b432,_0x5ae8fe,_0x1baecc,_0x39e9('0x70'));})['then'](function(_0x1cb51f){if(_0x1cb51f){logger['info'](_0x39e9('0x80'),_0x1cb51f['id']);}})[_0x39e9('0x26')](function(_0x529102){logger['error']('['+_0x1baecc['lastevent'][_0x39e9('0x90')]()+']',JSON[_0x39e9('0xb')](_0x529102));});}; \ 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 194e254..c26a7e5 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 _0x600f=['format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','data2','Script','data3','render','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x5efacc,_0x2aa396){var _0x293342=function(_0x333457){while(--_0x333457){_0x5efacc['push'](_0x5efacc['shift']());}};_0x293342(++_0x2aa396);}(_0x600f,0x1c5));var _0xf600=function(_0x3145af,_0x53a1d5){_0x3145af=_0x3145af-0x0;var _0x37758a=_0x600f[_0x3145af];return _0x37758a;};'use strict';var util=require('util');var sh=require(_0xf600('0x0'));var Mustache=require(_0xf600('0x1'));var logger=require(_0xf600('0x2'))('trigger');exports['exec']=function(_0x40208,_0x48fb4e){var _0x2e95f4=_0x40208[_0xf600('0x3')]?_0x40208[_0xf600('0x3')]:_0xf600('0x4');var _0x86ed87=_0x40208[_0xf600('0x5')]?Mustache[_0xf600('0x6')](_0x40208[_0xf600('0x5')],_0x48fb4e):_0x48fb4e;sh['exec'](_0x86ed87,function(_0x4ef2b8,_0x29283d,_0x4d305e){if(_0x4ef2b8!==0x0){logger['error'](util['format'](_0xf600('0x7'),_0x2e95f4,_0x86ed87,_0x4ef2b8,_0x4d305e));}else{logger[_0xf600('0x8')](util[_0xf600('0x9')](_0xf600('0xa'),_0x2e95f4,_0x86ed87,_0x29283d));}});}; \ No newline at end of file +var _0xfbc4=['shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x36593b,_0x3eb553){var _0x2b25ac=function(_0x2e173a){while(--_0x2e173a){_0x36593b['push'](_0x36593b['shift']());}};_0x2b25ac(++_0x3eb553);}(_0xfbc4,0x84));var _0x4fbc=function(_0x44d5bd,_0x2b0625){_0x44d5bd=_0x44d5bd-0x0;var _0x13589f=_0xfbc4[_0x44d5bd];return _0x13589f;};'use strict';var util=require('util');var sh=require(_0x4fbc('0x0'));var Mustache=require(_0x4fbc('0x1'));var logger=require(_0x4fbc('0x2'))(_0x4fbc('0x3'));exports[_0x4fbc('0x4')]=function(_0x26c106,_0x151542){var _0x93d107=_0x26c106['data2']?_0x26c106[_0x4fbc('0x5')]:'Script';var _0x23e652=_0x26c106[_0x4fbc('0x6')]?Mustache[_0x4fbc('0x7')](_0x26c106[_0x4fbc('0x6')],_0x151542):_0x151542;sh[_0x4fbc('0x4')](_0x23e652,function(_0x2d2183,_0x79faec,_0x1375de){if(_0x2d2183!==0x0){logger['error'](util[_0x4fbc('0x8')](_0x4fbc('0x9'),_0x93d107,_0x23e652,_0x2d2183,_0x1375de));}else{logger[_0x4fbc('0xa')](util[_0x4fbc('0x8')](_0x4fbc('0xb'),_0x93d107,_0x23e652,_0x79faec));}});}; \ 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 26a4802..1ea1a76 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 _0x91bb=['toUpperCase','render','data5','data6','parse','error','stack','data1','GET','DELETE','POST','PUT','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec'];(function(_0x2301de,_0x24321d){var _0x567d75=function(_0x35a1c1){while(--_0x35a1c1){_0x2301de['push'](_0x2301de['shift']());}};_0x567d75(++_0x24321d);}(_0x91bb,0x65));var _0xb91b=function(_0x338f03,_0x28941b){_0x338f03=_0x338f03-0x0;var _0x514d7e=_0x91bb[_0x338f03];return _0x514d7e;};'use strict';var rp=require(_0xb91b('0x0'));var util=require(_0xb91b('0x1'));var _=require(_0xb91b('0x2'));var Mustache=require(_0xb91b('0x3'));var logger=require(_0xb91b('0x4'))(_0xb91b('0x5'));exports[_0xb91b('0x6')]=function(_0x25a7ba,_0xffbc2b){var _0x424282,_0x4d80c1;var _0x294acc={'method':_0x25a7ba['data1'][_0xb91b('0x7')](),'uri':Mustache[_0xb91b('0x8')](_0x25a7ba['data2'],_0xffbc2b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x25a7ba[_0xb91b('0x9')])==='number'&&parseInt(_0x25a7ba[_0xb91b('0x9')])>=0x1&&parseInt(_0x25a7ba[_0xb91b('0x9')])<=0xa?parseInt(_0x25a7ba[_0xb91b('0x9')])*0x3e8:0x5*0x3e8};try{_0x294acc['headers']=_0x25a7ba[_0xb91b('0xa')]?JSON[_0xb91b('0xb')](Mustache[_0xb91b('0x8')](_0x25a7ba['data6'],_0xffbc2b)):{};}catch(_0x5b0428){logger[_0xb91b('0xc')](_0x5b0428[_0xb91b('0xd')]);}switch(_0x25a7ba[_0xb91b('0xe')][_0xb91b('0x7')]()){case _0xb91b('0xf'):case _0xb91b('0x10'):_0x424282=null;_0x294acc['qs']=_0xffbc2b;break;case _0xb91b('0x11'):case _0xb91b('0x12'):if(_0x25a7ba['data7']){try{_0x424282=JSON[_0xb91b('0xb')](Mustache['render'](_0x25a7ba['data7'],_0xffbc2b));_0x294acc['body']=_0x424282;}catch(_0x2d41f3){logger[_0xb91b('0xc')](_0x2d41f3[_0xb91b('0xd')]);logger[_0xb91b('0xc')](_0xb91b('0x13'));}}else{_0x424282=_0xffbc2b;_0x294acc[_0xb91b('0x14')]=_0x424282;}break;}logger[_0xb91b('0x15')](util[_0xb91b('0x16')](_0xb91b('0x17'),_0x25a7ba[_0xb91b('0xe')],_0x25a7ba[_0xb91b('0x18')],JSON['stringify'](_0x294acc)));rp(_0x294acc)[_0xb91b('0x19')](function(_0x21c3e1){_0x424282=!_[_0xb91b('0x1a')](_0x424282)?_0xb91b('0x1b')+_0x424282:'';_0x4d80c1=typeof _0x21c3e1[_0xb91b('0x14')]===_0xb91b('0x1c')?JSON[_0xb91b('0x1d')](_0x21c3e1['body']):_0x21c3e1['body'];logger[_0xb91b('0x15')](util[_0xb91b('0x16')](_0xb91b('0x1e'),_0x25a7ba[_0xb91b('0xe')],_0x25a7ba[_0xb91b('0x18')],_0x21c3e1['statusCode'],_0x4d80c1));})[_0xb91b('0x1f')](function(_0x323acd){logger[_0xb91b('0xc')](util['format'](_0xb91b('0x20'),_0x25a7ba[_0xb91b('0xe')],_0x25a7ba['data2'],_0x323acd[_0xb91b('0x21')],_0x323acd[_0xb91b('0x22')],_0x323acd[_0xb91b('0x23')]));});}; \ No newline at end of file +var _0x146e=['render','data2','data5','number','headers','data6','parse','error','stack','data1','GET','POST','PUT','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','../../../../config/logger','exec','toUpperCase'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x146e,0x9a));var _0xe146=function(_0x3911a0,_0x399077){_0x3911a0=_0x3911a0-0x0;var _0xf3dd14=_0x146e[_0x3911a0];return _0xf3dd14;};'use strict';var rp=require(_0xe146('0x0'));var util=require(_0xe146('0x1'));var _=require(_0xe146('0x2'));var Mustache=require('mustache');var logger=require(_0xe146('0x3'))('trigger');exports[_0xe146('0x4')]=function(_0x3c51bc,_0x4123d3){var _0x538fc0,_0x6d6468;var _0x1f6171={'method':_0x3c51bc['data1'][_0xe146('0x5')](),'uri':Mustache[_0xe146('0x6')](_0x3c51bc[_0xe146('0x7')],_0x4123d3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3c51bc[_0xe146('0x8')])===_0xe146('0x9')&&parseInt(_0x3c51bc[_0xe146('0x8')])>=0x1&&parseInt(_0x3c51bc[_0xe146('0x8')])<=0xa?parseInt(_0x3c51bc[_0xe146('0x8')])*0x3e8:0x5*0x3e8};try{_0x1f6171[_0xe146('0xa')]=_0x3c51bc[_0xe146('0xb')]?JSON[_0xe146('0xc')](Mustache[_0xe146('0x6')](_0x3c51bc[_0xe146('0xb')],_0x4123d3)):{};}catch(_0x555808){logger[_0xe146('0xd')](_0x555808[_0xe146('0xe')]);}switch(_0x3c51bc[_0xe146('0xf')]['toUpperCase']()){case _0xe146('0x10'):case'DELETE':_0x538fc0=null;_0x1f6171['qs']=_0x4123d3;break;case _0xe146('0x11'):case _0xe146('0x12'):if(_0x3c51bc['data7']){try{_0x538fc0=JSON[_0xe146('0xc')](Mustache[_0xe146('0x6')](_0x3c51bc['data7'],_0x4123d3));_0x1f6171[_0xe146('0x13')]=_0x538fc0;}catch(_0x226e3c){logger[_0xe146('0xd')](_0x226e3c[_0xe146('0xe')]);logger[_0xe146('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x538fc0=_0x4123d3;_0x1f6171['body']=_0x538fc0;}break;}logger[_0xe146('0x14')](util[_0xe146('0x15')](_0xe146('0x16'),_0x3c51bc[_0xe146('0xf')],_0x3c51bc['data2'],JSON[_0xe146('0x17')](_0x1f6171)));rp(_0x1f6171)[_0xe146('0x18')](function(_0x5cf07a){_0x538fc0=!_[_0xe146('0x19')](_0x538fc0)?_0xe146('0x1a')+_0x538fc0:'';_0x6d6468=typeof _0x5cf07a[_0xe146('0x13')]==='object'?JSON[_0xe146('0x17')](_0x5cf07a[_0xe146('0x13')]):_0x5cf07a['body'];logger[_0xe146('0x14')](util[_0xe146('0x15')](_0xe146('0x1b'),_0x3c51bc['data1'],_0x3c51bc[_0xe146('0x7')],_0x5cf07a[_0xe146('0x1c')],_0x6d6468));})['catch'](function(_0xfc8f34){logger[_0xe146('0xd')](util[_0xe146('0x15')](_0xe146('0x1d'),_0x3c51bc[_0xe146('0xf')],_0x3c51bc[_0xe146('0x7')],_0xfc8f34[_0xe146('0x1c')],_0xfc8f34[_0xe146('0x1e')],_0xfc8f34[_0xe146('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 908b7c9..a7e5e1c 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 _0xfcdc=['then','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','Request','request'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0xfcdc,0x1e7));var _0xcfcd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfcdc[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0xcfcd('0x0'));var BPromise=require(_0xcfcd('0x1'));var logger=require(_0xcfcd('0x2'))(_0xcfcd('0x3'));var client=jayson[_0xcfcd('0x4')]['http']({'port':0x2329});client[_0xcfcd('0x5')]=function(_0x4b547b,_0x521087){return new BPromise(function(_0x4f8b04,_0x3b76a7){return client[_0xcfcd('0x6')](_0x4b547b,_0x521087)[_0xcfcd('0x7')](function(_0x3f2b02){logger['debug'](_0xcfcd('0x8'),'routing',_0x4b547b,_0x521087,_0x3f2b02);if(_0x3f2b02[_0xcfcd('0x9')]){logger['error'](_0xcfcd('0x8'),'routing',_0x4b547b,_0x3f2b02[_0xcfcd('0x9')][_0xcfcd('0xa')],_0x521087);return _0x3b76a7(_0x3f2b02[_0xcfcd('0x9')][_0xcfcd('0xa')]);}else{return _0x4f8b04(_0x3f2b02[_0xcfcd('0xb')]);}})[_0xcfcd('0xc')](function(_0x1764a3){logger[_0xcfcd('0x9')](_0xcfcd('0x8'),_0xcfcd('0x3'),_0x4b547b,_0x1764a3,_0x521087);return _0x3b76a7(_0x1764a3);});});};module['exports']=client; \ No newline at end of file +var _0x5531=['error','message','jayson/promise','bluebird','client','Request','request','then','debug','rpc','routing'];(function(_0x3ce857,_0x304c70){var _0x26c60f=function(_0x1462a5){while(--_0x1462a5){_0x3ce857['push'](_0x3ce857['shift']());}};_0x26c60f(++_0x304c70);}(_0x5531,0x183));var _0x1553=function(_0x4c0984,_0x4e3c82){_0x4c0984=_0x4c0984-0x0;var _0x242f18=_0x5531[_0x4c0984];return _0x242f18;};'use strict';var jayson=require(_0x1553('0x0'));var BPromise=require(_0x1553('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x1553('0x2')]['http']({'port':0x2329});client[_0x1553('0x3')]=function(_0x55620b,_0x232c2b){return new BPromise(function(_0x2d190f,_0x1fa2eb){return client[_0x1553('0x4')](_0x55620b,_0x232c2b)[_0x1553('0x5')](function(_0x3c4a88){logger[_0x1553('0x6')](_0x1553('0x7'),_0x1553('0x8'),_0x55620b,_0x232c2b,_0x3c4a88);if(_0x3c4a88['error']){logger[_0x1553('0x9')](_0x1553('0x7'),_0x1553('0x8'),_0x55620b,_0x3c4a88[_0x1553('0x9')][_0x1553('0xa')],_0x232c2b);return _0x1fa2eb(_0x3c4a88[_0x1553('0x9')][_0x1553('0xa')]);}else{return _0x2d190f(_0x3c4a88['result']);}})['catch'](function(_0x24c354){logger['error'](_0x1553('0x7'),_0x1553('0x8'),_0x55620b,_0x24c354,_0x232c2b);return _0x1fa2eb(_0x24c354);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index a0a47f7..132adac 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 _0xe01e=['./realtime','./lib/email','./rpc/mailAccount','email','resolve','then','getMailAccounts','initMailAccounts','refresh','getSettings','loginMailFrequency','error','./server'];(function(_0x46d43f,_0x16ec5e){var _0x21d4c0=function(_0x5620f6){while(--_0x5620f6){_0x46d43f['push'](_0x46d43f['shift']());}};_0x21d4c0(++_0x16ec5e);}(_0xe01e,0xdc));var _0xee01=function(_0x70e445,_0x1d2f34){_0x70e445=_0x70e445-0x0;var _0x4abbce=_0xe01e[_0x70e445];return _0x4abbce;};'use strict';var server=require(_0xee01('0x0'));var Realtime=require(_0xee01('0x1'));var EmailChannel=require(_0xee01('0x2'));var mailAccount=require(_0xee01('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0xee01('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xee01('0x5')]()[_0xee01('0x6')](mailAccount[_0xee01('0x7')]())[_0xee01('0x6')](realtime[_0xee01('0x8')]())[_0xee01('0x6')](function(){email[_0xee01('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xee01('0x6')](function(){return initRealtime();})[_0xee01('0x6')](function(){return setting[_0xee01('0xa')]();})['then'](function(_0x18bd26){return setInterval(initRealtime,_0x18bd26[_0xee01('0xb')]*0x3e8);})['catch'](function(_0x545fd4){logger[_0xee01('0xc')]('Email\x20service\x20initialization',_0x545fd4);});}main(); \ No newline at end of file +var _0x950a=['refresh','mailAccounts','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./lib/email','./rpc/mailAccount','email','resolve','then','getMailAccounts','initMailAccounts'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x950a,0xf0));var _0xa950=function(_0x44da0a,_0x37814d){_0x44da0a=_0x44da0a-0x0;var _0x10f937=_0x950a[_0x44da0a];return _0x10f937;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xa950('0x0'));var mailAccount=require(_0xa950('0x1'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0xa950('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa950('0x3')]()[_0xa950('0x4')](mailAccount[_0xa950('0x5')]())['then'](realtime[_0xa950('0x6')]())[_0xa950('0x4')](function(){email[_0xa950('0x7')](realtime[_0xa950('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0xa950('0x9')]();})[_0xa950('0x4')](function(_0x227870){return setInterval(initRealtime,_0x227870[_0xa950('0xa')]*0x3e8);})['catch'](function(_0x495a0f){logger[_0xa950('0xb')](_0xa950('0xc'),_0x495a0f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e40b4fb..5b675a7 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 _0x6d33=['email','redis','defaults','localhost','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','status','Imap','messageStatus','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','active','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','disabled','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','Smtp','verified','verify','exports','lodash','bluebird','md5','ioredis'];(function(_0x1e4e55,_0x537fd5){var _0x23ff83=function(_0x7dbb6c){while(--_0x7dbb6c){_0x1e4e55['push'](_0x1e4e55['shift']());}};_0x23ff83(++_0x537fd5);}(_0x6d33,0xa1));var _0x36d3=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x6d33[_0x20845e];return _0x28cf2b;};'use strict';var _=require(_0x36d3('0x0'));var moment=require('moment');var BPromise=require(_0x36d3('0x1'));var md5=require(_0x36d3('0x2'));var Redis=require(_0x36d3('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x36d3('0x4'));config[_0x36d3('0x5')]=_[_0x36d3('0x6')](config[_0x36d3('0x5')],{'host':_0x36d3('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x36d3('0x8'));var EmailSmtp=require(_0x36d3('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4957ef){logger[_0x36d3('0xa')](_0x36d3('0xb'));this['mailAccounts']=_0x4957ef[_0x36d3('0xc')];this[_0x36d3('0xd')]={};this[_0x36d3('0xe')]=new EmailSmtp();}EmailChannel[_0x36d3('0xf')][_0x36d3('0x10')]=function(_0x38bfcb){var _0x1d80ab=this['mailAccounts'][_0x38bfcb];var _0x2d7bb2={'id':_0x1d80ab['id'],'name':_0x1d80ab[_0x36d3('0x11')],'key':_0x1d80ab[_0x36d3('0x12')],'active':_0x1d80ab['active'],'Imap':{'status':_0x1d80ab['Imap'][_0x36d3('0x13')],'messageStatus':_0x1d80ab[_0x36d3('0x14')][_0x36d3('0x15')],'total':_0x1d80ab[_0x36d3('0x14')]['total']}};if(_[_0x36d3('0x16')](md5Accounts[_0x38bfcb])){md5Accounts[_0x38bfcb]={};}var _0x3761cf=md5(JSON[_0x36d3('0x17')](_0x2d7bb2));if(md5Accounts[_0x38bfcb][_0x36d3('0x2')]!==_0x3761cf){md5Accounts[_0x38bfcb]['md5']=_0x3761cf;io['emit'](_0x36d3('0x18'),_0x2d7bb2);}};EmailChannel[_0x36d3('0xf')][_0x36d3('0x19')]=function(_0x272a31){for(var _0x2ad8ee in _0x272a31){if(_0x272a31[_0x36d3('0x1a')](_0x2ad8ee)){if(_0x272a31[_0x2ad8ee][_0x36d3('0x14')]&&_0x272a31[_0x2ad8ee][_0x36d3('0x1b')]){var _0x510478=_0x272a31[_0x2ad8ee][_0x36d3('0x14')];if(!_0x510478[_0x36d3('0x1c')]&&_0x272a31[_0x2ad8ee][_0x36d3('0x1d')]!==_0x36d3('0x1e'))_0x510478[_0x36d3('0x1c')]=_0x272a31[_0x2ad8ee][_0x36d3('0x1d')];if(!this[_0x36d3('0xd')][_0x36d3('0x1a')](_0x510478['id'])){this[_0x36d3('0xd')][_0x510478['id']]=new EmailImap(_0x510478,_0x272a31[_0x2ad8ee]['email']);this[_0x36d3('0xd')][_0x510478['id']]['on'](_0x36d3('0x1f'),this[_0x36d3('0x20')][_0x36d3('0x21')](this,_0x2ad8ee));this['imapAccounts'][_0x510478['id']]['on'](_0x36d3('0x4'),this[_0x36d3('0x22')][_0x36d3('0x21')](this,_0x2ad8ee));this[_0x36d3('0xd')][_0x510478['id']]['on'](_0x36d3('0x23'),this[_0x36d3('0x24')]['bind'](this,_0x2ad8ee));this['imapAccounts'][_0x510478['id']]['on']('error',this[_0x36d3('0x25')]['bind'](this,_0x2ad8ee));}}else{if(_[_0x36d3('0x16')](this[_0x36d3('0xc')][_0x2ad8ee][_0x36d3('0x14')])){this[_0x36d3('0xc')][_0x2ad8ee][_0x36d3('0x14')]={};}this['mailAccounts'][_0x2ad8ee][_0x36d3('0x14')][_0x36d3('0x13')]=_0x36d3('0x26');this['mailAccounts'][_0x2ad8ee]['Imap']['messageStatus']='';this['emit'](_0x2ad8ee);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x23be42,_0x44646b){if(this[_0x36d3('0xc')][_0x23be42]){this[_0x36d3('0xc')][_0x23be42]['Imap']['status']='connected';this[_0x36d3('0xc')][_0x23be42][_0x36d3('0x14')][_0x36d3('0x15')]=_0x44646b[_0x36d3('0x11')];if(_0x44646b[_0x36d3('0x27')]){this[_0x36d3('0xc')][_0x23be42][_0x36d3('0x14')][_0x36d3('0x28')]=_0x44646b['messages'][_0x36d3('0x28')];}return this['emit'](_0x23be42);}};EmailChannel[_0x36d3('0xf')][_0x36d3('0x22')]=function(_0x1677cb,_0x86e459){logger[_0x36d3('0xa')](_0x36d3('0x29'),_0x86e459['firstName'],_0x86e459[_0x36d3('0x2a')],_0x86e459[_0x36d3('0x2b')],_0x1677cb);if(this[_0x36d3('0xc')][_0x1677cb]){return mailAccount['notify'](_0x1677cb,_0x86e459)[_0x36d3('0x2c')](function(_0x4c1d8f){if(_0x4c1d8f){logger['info'](_0x36d3('0x2d'));}})[_0x36d3('0x2e')](function(_0x565447){logger[_0x36d3('0x2f')](_0x36d3('0x30'),JSON[_0x36d3('0x17')](_0x565447));});}};EmailChannel[_0x36d3('0xf')][_0x36d3('0x24')]=function(_0x23d270){if(this[_0x36d3('0xc')][_0x23d270]&&this[_0x36d3('0xc')][_0x23d270][_0x36d3('0x14')]){if(this['imapAccounts'][this[_0x36d3('0xc')][_0x23d270][_0x36d3('0x14')]['id']]){delete this[_0x36d3('0xd')][this[_0x36d3('0xc')][_0x23d270][_0x36d3('0x14')]['id']];}this['mailAccounts'][_0x23d270][_0x36d3('0x14')][_0x36d3('0x31')]=moment();this[_0x36d3('0x10')](_0x23d270);}};EmailChannel['prototype']['handleImapError']=function(_0x524992,_0x44ce00){if(this[_0x36d3('0xc')][_0x524992]){this[_0x36d3('0xc')][_0x524992][_0x36d3('0x14')][_0x36d3('0x13')]=_0x36d3('0x2f');this[_0x36d3('0xc')][_0x524992][_0x36d3('0x14')]['messageStatus']=_0x44ce00;return this[_0x36d3('0x10')](_0x524992);}};EmailChannel[_0x36d3('0xf')]['sendMail']=function(_0x557881,_0x12e097){return this['smtp'][_0x36d3('0x32')](_0x557881,_0x12e097);};EmailChannel[_0x36d3('0xf')]['verifySmtp']=function(_0x69914f){var _0x3ad460=this;if(this['mailAccounts'][_0x69914f['id']]){if(_['isNil'](this[_0x36d3('0xc')][_0x69914f['id']][_0x36d3('0x33')])){this[_0x36d3('0xc')][_0x69914f['id']][_0x36d3('0x33')]={};}this[_0x36d3('0xc')][_0x69914f['id']]['Smtp'][_0x36d3('0x31')]=moment();return new BPromise(function(_0x47dd89,_0x74a61f){return _0x3ad460['smtp']['verify'](_0x69914f)[_0x36d3('0x2c')](function(_0x2f8d6a){_0x3ad460[_0x36d3('0xc')][_0x69914f['id']][_0x36d3('0x33')]['status']=_0x36d3('0x34');_0x3ad460['mailAccounts'][_0x69914f['id']][_0x36d3('0x33')][_0x36d3('0x15')]='';_0x3ad460['emit'](_0x69914f['id']);_0x47dd89(_0x2f8d6a);})[_0x36d3('0x2e')](function(_0x1fa5a9){_0x3ad460['mailAccounts'][_0x69914f['id']]['Smtp'][_0x36d3('0x13')]='error';_0x3ad460[_0x36d3('0xc')][_0x69914f['id']]['Smtp'][_0x36d3('0x15')]=_0x1fa5a9;_0x3ad460[_0x36d3('0x10')](_0x69914f['id']);_0x74a61f(_0x1fa5a9);});});}return this[_0x36d3('0xe')][_0x36d3('0x35')](_0x69914f);};module[_0x36d3('0x36')]=EmailChannel; \ No newline at end of file +var _0x9b9c=['info','mailAccounts','imapAccounts','prototype','emit','name','key','status','Imap','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','active','service','provider','custom','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','catch','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount'];(function(_0x5c88c9,_0x5b6789){var _0x167455=function(_0x34741b){while(--_0x34741b){_0x5c88c9['push'](_0x5c88c9['shift']());}};_0x167455(++_0x5b6789);}(_0x9b9c,0x1c3));var _0xc9b9=function(_0x56ad87,_0x184d05){_0x56ad87=_0x56ad87-0x0;var _0x1c3218=_0x9b9c[_0x56ad87];return _0x1c3218;};'use strict';var _=require(_0xc9b9('0x0'));var moment=require(_0xc9b9('0x1'));var BPromise=require('bluebird');var md5=require(_0xc9b9('0x2'));var Redis=require(_0xc9b9('0x3'));var config=require(_0xc9b9('0x4'));var logger=require(_0xc9b9('0x5'))(_0xc9b9('0x6'));config[_0xc9b9('0x7')]=_[_0xc9b9('0x8')](config[_0xc9b9('0x7')],{'host':_0xc9b9('0x9'),'port':0x18eb});var io=require(_0xc9b9('0xa'))(new Redis(config['redis']));var EmailImap=require(_0xc9b9('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xc9b9('0xc'));var md5Accounts={};function EmailChannel(_0x341655){logger[_0xc9b9('0xd')]('start\x20email\x20channel');this[_0xc9b9('0xe')]=_0x341655[_0xc9b9('0xe')];this[_0xc9b9('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xc9b9('0x10')][_0xc9b9('0x11')]=function(_0x57966f){var _0x456ea1=this['mailAccounts'][_0x57966f];var _0x4fc5d1={'id':_0x456ea1['id'],'name':_0x456ea1[_0xc9b9('0x12')],'key':_0x456ea1[_0xc9b9('0x13')],'active':_0x456ea1['active'],'Imap':{'status':_0x456ea1['Imap'][_0xc9b9('0x14')],'messageStatus':_0x456ea1[_0xc9b9('0x15')][_0xc9b9('0x16')],'total':_0x456ea1['Imap'][_0xc9b9('0x17')]}};if(_[_0xc9b9('0x18')](md5Accounts[_0x57966f])){md5Accounts[_0x57966f]={};}var _0x2421d8=md5(JSON['stringify'](_0x4fc5d1));if(md5Accounts[_0x57966f][_0xc9b9('0x2')]!==_0x2421d8){md5Accounts[_0x57966f][_0xc9b9('0x2')]=_0x2421d8;io[_0xc9b9('0x11')](_0xc9b9('0x19'),_0x4fc5d1);}};EmailChannel[_0xc9b9('0x10')][_0xc9b9('0x1a')]=function(_0x349947){for(var _0x5d04fe in _0x349947){if(_0x349947[_0xc9b9('0x1b')](_0x5d04fe)){if(_0x349947[_0x5d04fe][_0xc9b9('0x15')]&&_0x349947[_0x5d04fe][_0xc9b9('0x1c')]){var _0x2ebad5=_0x349947[_0x5d04fe][_0xc9b9('0x15')];if(!_0x2ebad5[_0xc9b9('0x1d')]&&_0x349947[_0x5d04fe][_0xc9b9('0x1e')]!==_0xc9b9('0x1f'))_0x2ebad5['service']=_0x349947[_0x5d04fe][_0xc9b9('0x1e')];if(!this[_0xc9b9('0xf')]['hasOwnProperty'](_0x2ebad5['id'])){this[_0xc9b9('0xf')][_0x2ebad5['id']]=new EmailImap(_0x2ebad5,_0x349947[_0x5d04fe][_0xc9b9('0x6')]);this['imapAccounts'][_0x2ebad5['id']]['on']('box',this[_0xc9b9('0x20')]['bind'](this,_0x5d04fe));this['imapAccounts'][_0x2ebad5['id']]['on'](_0xc9b9('0x6'),this[_0xc9b9('0x21')][_0xc9b9('0x22')](this,_0x5d04fe));this[_0xc9b9('0xf')][_0x2ebad5['id']]['on'](_0xc9b9('0x23'),this[_0xc9b9('0x24')][_0xc9b9('0x22')](this,_0x5d04fe));this[_0xc9b9('0xf')][_0x2ebad5['id']]['on'](_0xc9b9('0x25'),this[_0xc9b9('0x26')]['bind'](this,_0x5d04fe));}}else{if(_[_0xc9b9('0x18')](this[_0xc9b9('0xe')][_0x5d04fe][_0xc9b9('0x15')])){this[_0xc9b9('0xe')][_0x5d04fe]['Imap']={};}this['mailAccounts'][_0x5d04fe]['Imap'][_0xc9b9('0x14')]=_0xc9b9('0x27');this['mailAccounts'][_0x5d04fe]['Imap'][_0xc9b9('0x16')]='';this['emit'](_0x5d04fe);}}}};EmailChannel['prototype'][_0xc9b9('0x20')]=function(_0x4a85c6,_0x30dfb0){if(this[_0xc9b9('0xe')][_0x4a85c6]){this[_0xc9b9('0xe')][_0x4a85c6]['Imap'][_0xc9b9('0x14')]=_0xc9b9('0x28');this['mailAccounts'][_0x4a85c6]['Imap'][_0xc9b9('0x16')]=_0x30dfb0[_0xc9b9('0x12')];if(_0x30dfb0[_0xc9b9('0x29')]){this[_0xc9b9('0xe')][_0x4a85c6][_0xc9b9('0x15')][_0xc9b9('0x17')]=_0x30dfb0['messages'][_0xc9b9('0x17')];}return this['emit'](_0x4a85c6);}};EmailChannel[_0xc9b9('0x10')][_0xc9b9('0x21')]=function(_0x1cbbcd,_0xffdcca){logger[_0xc9b9('0xd')](_0xc9b9('0x2a'),_0xffdcca['firstName'],_0xffdcca['lastName'],_0xffdcca[_0xc9b9('0x2b')],_0x1cbbcd);if(this[_0xc9b9('0xe')][_0x1cbbcd]){return mailAccount['notify'](_0x1cbbcd,_0xffdcca)[_0xc9b9('0x2c')](function(_0x31cda1){if(_0x31cda1){logger[_0xc9b9('0xd')](_0xc9b9('0x2d'));}})['catch'](function(_0x7269de){logger[_0xc9b9('0x25')](_0xc9b9('0x2e'),JSON[_0xc9b9('0x2f')](_0x7269de));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x4f7bf3){if(this[_0xc9b9('0xe')][_0x4f7bf3]&&this[_0xc9b9('0xe')][_0x4f7bf3]['Imap']){if(this[_0xc9b9('0xf')][this[_0xc9b9('0xe')][_0x4f7bf3][_0xc9b9('0x15')]['id']]){delete this[_0xc9b9('0xf')][this['mailAccounts'][_0x4f7bf3][_0xc9b9('0x15')]['id']];}this[_0xc9b9('0xe')][_0x4f7bf3][_0xc9b9('0x15')][_0xc9b9('0x30')]=moment();this['emit'](_0x4f7bf3);}};EmailChannel[_0xc9b9('0x10')][_0xc9b9('0x26')]=function(_0x4b15a7,_0x47c43a){if(this[_0xc9b9('0xe')][_0x4b15a7]){this[_0xc9b9('0xe')][_0x4b15a7][_0xc9b9('0x15')][_0xc9b9('0x14')]='error';this[_0xc9b9('0xe')][_0x4b15a7][_0xc9b9('0x15')][_0xc9b9('0x16')]=_0x47c43a;return this[_0xc9b9('0x11')](_0x4b15a7);}};EmailChannel[_0xc9b9('0x10')][_0xc9b9('0x31')]=function(_0x4e016d,_0x2b1509){return this[_0xc9b9('0x32')][_0xc9b9('0x33')](_0x4e016d,_0x2b1509);};EmailChannel[_0xc9b9('0x10')][_0xc9b9('0x34')]=function(_0x1d18a2){var _0x3cab73=this;if(this['mailAccounts'][_0x1d18a2['id']]){if(_[_0xc9b9('0x18')](this[_0xc9b9('0xe')][_0x1d18a2['id']][_0xc9b9('0x35')])){this[_0xc9b9('0xe')][_0x1d18a2['id']][_0xc9b9('0x35')]={};}this[_0xc9b9('0xe')][_0x1d18a2['id']]['Smtp'][_0xc9b9('0x30')]=moment();return new BPromise(function(_0x1c5214,_0xf9f075){return _0x3cab73[_0xc9b9('0x32')][_0xc9b9('0x36')](_0x1d18a2)['then'](function(_0x9d7778){_0x3cab73[_0xc9b9('0xe')][_0x1d18a2['id']][_0xc9b9('0x35')][_0xc9b9('0x14')]=_0xc9b9('0x37');_0x3cab73['mailAccounts'][_0x1d18a2['id']][_0xc9b9('0x35')][_0xc9b9('0x16')]='';_0x3cab73[_0xc9b9('0x11')](_0x1d18a2['id']);_0x1c5214(_0x9d7778);})[_0xc9b9('0x38')](function(_0x411fc4){_0x3cab73[_0xc9b9('0xe')][_0x1d18a2['id']][_0xc9b9('0x35')][_0xc9b9('0x14')]='error';_0x3cab73[_0xc9b9('0xe')][_0x1d18a2['id']][_0xc9b9('0x35')][_0xc9b9('0x16')]=_0x411fc4;_0x3cab73['emit'](_0x1d18a2['id']);_0xf9f075(_0x411fc4);});});}return this[_0xc9b9('0x32')][_0xc9b9('0x36')](_0x1d18a2);};module[_0xc9b9('0x39')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 80b55f3..22e6b2b 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 _0x8780=['handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','account','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','once','handleFetchError','handleFetchEnd','closeBox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8780,0x186));var _0x0878=function(_0x2a7b39,_0x457fda){_0x2a7b39=_0x2a7b39-0x0;var _0x482bc3=_0x8780[_0x2a7b39];return _0x482bc3;};'use strict';var _=require(_0x0878('0x0'));var util=require(_0x0878('0x1'));var Imap=require(_0x0878('0x2'));var simpleParser=require('mailparser')[_0x0878('0x3')];var Iconv=require(_0x0878('0x4'))[_0x0878('0x5')];var EventEmitter=require(_0x0878('0x6'))[_0x0878('0x7')];var utils=require(_0x0878('0x8'));var logger=require(_0x0878('0x9'))(_0x0878('0xa'));function EmailImap(_0x4a7e82,_0x3789c4){this['mailbox']=_0x4a7e82['mailbox'];this[_0x0878('0xb')]=this['getAccount'](_0x4a7e82,_0x3789c4);this['imap']=new Imap(this[_0x0878('0xb')]);this[_0x0878('0x2')]['once'](_0x0878('0xc'),this[_0x0878('0xd')][_0x0878('0xe')](this));this[_0x0878('0x2')]['once'](_0x0878('0xf'),this[_0x0878('0x10')][_0x0878('0xe')](this));this[_0x0878('0x2')]['on'](_0x0878('0x11'),this[_0x0878('0x12')][_0x0878('0xe')](this));this[_0x0878('0x2')]['connect']();}util[_0x0878('0x13')](EmailImap,EventEmitter);EmailImap[_0x0878('0x14')]['getAccount']=function(_0x414d9e,_0x3b94e2){var _0x65ad54={'connTimeout':_0x414d9e['connTimeout']?_0x414d9e[_0x0878('0x15')]*0x3e8:0x2710,'authTimeout':_0x414d9e[_0x0878('0x16')]?_0x414d9e[_0x0878('0x16')]*0x3e8:0x1388};if(_0x414d9e[_0x0878('0x17')]){_0x65ad54[_0x0878('0x18')]=_0x414d9e['user'];if(_0x414d9e['modernAuthentication']){_0x65ad54['xoauth2']=utils['generateXOAuth2Token'](_0x414d9e[_0x0878('0x19')][_0x0878('0x1a')],_0x414d9e[_0x0878('0x18')]);}else{_0x65ad54[_0x0878('0x1b')]=_0x414d9e[_0x0878('0x1b')];}}else{if(_0x414d9e[_0x0878('0x1c')]){_0x65ad54[_0x0878('0x18')]=_0x414d9e[_0x0878('0x18')];_0x65ad54['password']=_0x414d9e[_0x0878('0x1b')];}}_0x65ad54[_0x0878('0xa')]=_0x3b94e2||_0x414d9e[_0x0878('0x18')]||_0x0878('0x1d');_0x65ad54[_0x0878('0x1e')]=_0x414d9e[_0x0878('0x1e')];_0x65ad54['port']=_0x414d9e[_0x0878('0x1f')]||0x3e1;if(_0x414d9e['tls']){_0x65ad54[_0x0878('0x20')]=!![];}else{_0x65ad54[_0x0878('0x20')]=![];_0x65ad54[_0x0878('0x21')]=_0x0878('0x22');}return _0x65ad54;};EmailImap[_0x0878('0x14')][_0x0878('0xd')]=function(){this[_0x0878('0x2')][_0x0878('0x23')](this['mailbox'],![],this[_0x0878('0x24')][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x24')]=function(_0x1b976e,_0x2cc2af){if(_0x1b976e){this[_0x0878('0x12')](_0x1b976e,!![]);}else{this[_0x0878('0x25')](_0x0878('0x26'),_0x2cc2af);this[_0x0878('0x27')]();}};EmailImap[_0x0878('0x14')]['handleCloseBox']=function(_0x2ae83e){if(_0x2ae83e){this['handleError'](_0x2ae83e,!![]);}else{this[_0x0878('0x2')][_0x0878('0xf')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x0878('0x2')][_0x0878('0x28')]([_0x0878('0x29')],this[_0x0878('0x2a')][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x2a')]=function(_0x4d5e25,_0x1f2bea){if(_0x4d5e25){this[_0x0878('0x12')](_0x4d5e25,!![]);}else{if(_0x1f2bea[_0x0878('0x2b')]){try{var _0x488b20=this[_0x0878('0x2')][_0x0878('0x2c')](_0x1f2bea,{'bodies':'','markSeen':!![]});_0x488b20['on'](_0x0878('0x2d'),this[_0x0878('0x2e')]['bind'](this));_0x488b20[_0x0878('0x2f')](_0x0878('0x11'),this[_0x0878('0x30')][_0x0878('0xe')](this));_0x488b20[_0x0878('0x2f')](_0x0878('0xf'),this[_0x0878('0x31')]['bind'](this));}catch(_0x1c3faa){logger[_0x0878('0x11')](_0x1c3faa);}}else{this[_0x0878('0x2')][_0x0878('0x32')](!![],this[_0x0878('0x33')]['bind'](this));}}};EmailImap[_0x0878('0x14')][_0x0878('0x2e')]=function(_0x590668){_0x590668['on'](_0x0878('0x34'),this[_0x0878('0x35')][_0x0878('0xe')](this));_0x590668['once'](_0x0878('0x36'),this[_0x0878('0x37')][_0x0878('0xe')](this));_0x590668[_0x0878('0x2f')](_0x0878('0xf'),this['handleMessageEnd'][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x35')]=function(_0x5ed880){simpleParser(_0x5ed880,{'Iconv':Iconv},this[_0x0878('0x38')][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x37')]=function(){};EmailImap[_0x0878('0x14')][_0x0878('0x39')]=function(){};EmailImap[_0x0878('0x14')][_0x0878('0x38')]=function(_0x4d2876,_0x21ab58){if(_0x4d2876){logger[_0x0878('0x11')](_0x4d2876);}else{var _0x40ba44=this;utils['parser'](this['account'],_0x21ab58,function(_0x25ce85){_0x40ba44[_0x0878('0x25')](_0x0878('0xa'),_0x25ce85);});}};EmailImap[_0x0878('0x14')][_0x0878('0x31')]=function(){this[_0x0878('0x2')]['closeBox'](!![],this[_0x0878('0x33')]['bind'](this));};EmailImap[_0x0878('0x14')]['handleFetchError']=function(_0x341bb1){this[_0x0878('0x12')](_0x341bb1);this[_0x0878('0x2')][_0x0878('0x32')](!![],this[_0x0878('0x33')]['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0x0878('0xf'));};EmailImap[_0x0878('0x14')]['handleError']=function(_0x35501a,_0x5e1594){logger[_0x0878('0x11')]('handleError',this[_0x0878('0xb')][_0x0878('0xa')],JSON[_0x0878('0x3a')](_0x35501a));var _0x336bc1='';if(_0x35501a){if(_0x35501a[_0x0878('0x3b')]){_0x336bc1=_0x35501a[_0x0878('0x3b')];}else{for(var _0x321532 in _0x35501a){if(_0x35501a[_0x0878('0x3c')](_0x321532)){_0x336bc1+=_[_0x0878('0x3d')](_0x321532)+':\x20'+_0x35501a[_0x321532]+'\x0a';}}}}if(_0x5e1594){this[_0x0878('0x2')]['end']();}else{this[_0x0878('0x25')](_0x0878('0x11'),_0x336bc1);this[_0x0878('0x25')](_0x0878('0xf'));}};module[_0x0878('0x3e')]=EmailImap; \ No newline at end of file +var _0xc119=['length','fetch','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchError','textCode','hasOwnProperty','exports','lodash','util','imap','iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','ready','handleReady','once','handleEnd','bind','error','connect','inherits','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','prototype','emit','box','handleCloseBox','handleError','end','UNSEEN','handleReadUnseen'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc119,0xb9));var _0x9c11=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xc119[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x9c11('0x0'));var util=require(_0x9c11('0x1'));var Imap=require(_0x9c11('0x2'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x9c11('0x3'))['Iconv'];var EventEmitter=require(_0x9c11('0x4'))[_0x9c11('0x5')];var utils=require(_0x9c11('0x6'));var logger=require('../../../config/logger')(_0x9c11('0x7'));function EmailImap(_0x57f5f7,_0x56b42e){this[_0x9c11('0x8')]=_0x57f5f7[_0x9c11('0x8')];this[_0x9c11('0x9')]=this[_0x9c11('0xa')](_0x57f5f7,_0x56b42e);this[_0x9c11('0x2')]=new Imap(this['account']);this[_0x9c11('0x2')]['once'](_0x9c11('0xb'),this[_0x9c11('0xc')]['bind'](this));this[_0x9c11('0x2')][_0x9c11('0xd')]('end',this[_0x9c11('0xe')][_0x9c11('0xf')](this));this[_0x9c11('0x2')]['on'](_0x9c11('0x10'),this['handleError'][_0x9c11('0xf')](this));this[_0x9c11('0x2')][_0x9c11('0x11')]();}util[_0x9c11('0x12')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x23aad9,_0x2a3eb8){var _0x44967b={'connTimeout':_0x23aad9[_0x9c11('0x13')]?_0x23aad9['connTimeout']*0x3e8:0x2710,'authTimeout':_0x23aad9['authTimeout']?_0x23aad9[_0x9c11('0x14')]*0x3e8:0x1388};if(_0x23aad9[_0x9c11('0x15')]){_0x44967b['user']=_0x23aad9[_0x9c11('0x16')];if(_0x23aad9[_0x9c11('0x17')]){_0x44967b[_0x9c11('0x18')]=utils['generateXOAuth2Token'](_0x23aad9['CloudProvider'][_0x9c11('0x19')],_0x23aad9[_0x9c11('0x16')]);}else{_0x44967b[_0x9c11('0x1a')]=_0x23aad9[_0x9c11('0x1a')];}}else{if(_0x23aad9[_0x9c11('0x1b')]){_0x44967b[_0x9c11('0x16')]=_0x23aad9[_0x9c11('0x16')];_0x44967b[_0x9c11('0x1a')]=_0x23aad9['password'];}}_0x44967b[_0x9c11('0x7')]=_0x2a3eb8||_0x23aad9[_0x9c11('0x16')]||'anonymous@xcally.com';_0x44967b['host']=_0x23aad9[_0x9c11('0x1c')];_0x44967b['port']=_0x23aad9[_0x9c11('0x1d')]||0x3e1;if(_0x23aad9[_0x9c11('0x1e')]){_0x44967b[_0x9c11('0x1e')]=!![];}else{_0x44967b[_0x9c11('0x1e')]=![];_0x44967b[_0x9c11('0x1f')]=_0x9c11('0x20');}return _0x44967b;};EmailImap['prototype'][_0x9c11('0xc')]=function(){this[_0x9c11('0x2')][_0x9c11('0x21')](this[_0x9c11('0x8')],![],this[_0x9c11('0x22')][_0x9c11('0xf')](this));};EmailImap[_0x9c11('0x23')][_0x9c11('0x22')]=function(_0x1c6c23,_0x4eee23){if(_0x1c6c23){this['handleError'](_0x1c6c23,!![]);}else{this[_0x9c11('0x24')](_0x9c11('0x25'),_0x4eee23);this['readUnseen']();}};EmailImap['prototype'][_0x9c11('0x26')]=function(_0x2fdb3e){if(_0x2fdb3e){this[_0x9c11('0x27')](_0x2fdb3e,!![]);}else{this[_0x9c11('0x2')][_0x9c11('0x28')]();}};EmailImap[_0x9c11('0x23')]['readUnseen']=function(){this['imap']['search']([_0x9c11('0x29')],this[_0x9c11('0x2a')][_0x9c11('0xf')](this));};EmailImap[_0x9c11('0x23')][_0x9c11('0x2a')]=function(_0x32587b,_0x7b24b2){if(_0x32587b){this[_0x9c11('0x27')](_0x32587b,!![]);}else{if(_0x7b24b2[_0x9c11('0x2b')]){try{var _0x22f2a2=this[_0x9c11('0x2')][_0x9c11('0x2c')](_0x7b24b2,{'bodies':'','markSeen':!![]});_0x22f2a2['on']('message',this['handleFetchMessage']['bind'](this));_0x22f2a2[_0x9c11('0xd')]('error',this['handleFetchError'][_0x9c11('0xf')](this));_0x22f2a2[_0x9c11('0xd')]('end',this[_0x9c11('0x2d')][_0x9c11('0xf')](this));}catch(_0x2b6799){logger['error'](_0x2b6799);}}else{this[_0x9c11('0x2')][_0x9c11('0x2e')](!![],this['handleCloseBox'][_0x9c11('0xf')](this));}}};EmailImap['prototype'][_0x9c11('0x2f')]=function(_0x1faa8e){_0x1faa8e['on']('body',this[_0x9c11('0x30')][_0x9c11('0xf')](this));_0x1faa8e['once'](_0x9c11('0x31'),this[_0x9c11('0x32')][_0x9c11('0xf')](this));_0x1faa8e[_0x9c11('0xd')](_0x9c11('0x28'),this[_0x9c11('0x33')]['bind'](this));};EmailImap[_0x9c11('0x23')]['handleMessageBody']=function(_0x21af11){simpleParser(_0x21af11,{'Iconv':Iconv},this[_0x9c11('0x34')]['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x9c11('0x33')]=function(){};EmailImap['prototype'][_0x9c11('0x34')]=function(_0x289786,_0x22d94c){if(_0x289786){logger['error'](_0x289786);}else{var _0xb60bf5=this;utils['parser'](this['account'],_0x22d94c,function(_0xbc52dc){_0xb60bf5['emit'](_0x9c11('0x7'),_0xbc52dc);});}};EmailImap['prototype'][_0x9c11('0x2d')]=function(){this[_0x9c11('0x2')]['closeBox'](!![],this['handleCloseBox'][_0x9c11('0xf')](this));};EmailImap[_0x9c11('0x23')][_0x9c11('0x35')]=function(_0x1d2c42){this[_0x9c11('0x27')](_0x1d2c42);this[_0x9c11('0x2')][_0x9c11('0x2e')](!![],this[_0x9c11('0x26')][_0x9c11('0xf')](this));};EmailImap['prototype'][_0x9c11('0xe')]=function(){this[_0x9c11('0x24')]('end');};EmailImap['prototype'][_0x9c11('0x27')]=function(_0x36d882,_0x32a899){logger[_0x9c11('0x10')](_0x9c11('0x27'),this[_0x9c11('0x9')][_0x9c11('0x7')],JSON['stringify'](_0x36d882));var _0x28f6f5='';if(_0x36d882){if(_0x36d882[_0x9c11('0x36')]){_0x28f6f5=_0x36d882[_0x9c11('0x36')];}else{for(var _0x373f97 in _0x36d882){if(_0x36d882[_0x9c11('0x37')](_0x373f97)){_0x28f6f5+=_['upperFirst'](_0x373f97)+':\x20'+_0x36d882[_0x373f97]+'\x0a';}}}}if(_0x32a899){this['imap'][_0x9c11('0x28')]();}else{this['emit']('error',_0x28f6f5);this[_0x9c11('0x24')]('end');}};module[_0x9c11('0x38')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 92af057..88e6e57 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 _0xcbb5=['Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','verify','toString'];(function(_0x53b6c9,_0x46a2c6){var _0x52cfdd=function(_0x1cdd8c){while(--_0x1cdd8c){_0x53b6c9['push'](_0x53b6c9['shift']());}};_0x52cfdd(++_0x46a2c6);}(_0xcbb5,0x141));var _0x5cbb=function(_0x1a1c0a,_0x4e390e){_0x1a1c0a=_0x1a1c0a-0x0;var _0x496cb2=_0xcbb5[_0x1a1c0a];return _0x496cb2;};'use strict';var nodemailer=require(_0x5cbb('0x0'));var inlineBase64=require(_0x5cbb('0x1'));function EmailSmtp(){}EmailSmtp[_0x5cbb('0x2')]['send']=function(_0x200b80,_0x34ebf2){return new Promise(function(_0xeafac,_0x259ac5){var _0x164d56=nodemailer[_0x5cbb('0x3')](_0x200b80);_0x164d56[_0x5cbb('0x4')](_0x5cbb('0x5'),inlineBase64());_0x164d56[_0x5cbb('0x6')](_0x34ebf2,function(_0x106705,_0x48e0d6){if(_0x106705){_0x259ac5(_0x106705['toString']());}else{_0xeafac(_0x48e0d6);}});});};EmailSmtp[_0x5cbb('0x2')][_0x5cbb('0x7')]=function(_0x19af1b){return new Promise(function(_0x23201f,_0x213563){var _0x274969=nodemailer['createTransport'](_0x19af1b);_0x274969[_0x5cbb('0x7')](function(_0x4c0b05,_0x1306a9){if(_0x4c0b05){_0x213563(_0x4c0b05[_0x5cbb('0x8')]());}else{if(_0x1306a9){_0x23201f(_0x1306a9);}else{_0x213563(_0x5cbb('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xcd27=['verify','toString','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail'];(function(_0x7a5e28,_0x6bc7de){var _0xada9f3=function(_0x78af33){while(--_0x78af33){_0x7a5e28['push'](_0x7a5e28['shift']());}};_0xada9f3(++_0x6bc7de);}(_0xcd27,0x11a));var _0x7cd2=function(_0x32c6ff,_0x269896){_0x32c6ff=_0x32c6ff-0x0;var _0x14222d=_0xcd27[_0x32c6ff];return _0x14222d;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x7cd2('0x0'));function EmailSmtp(){}EmailSmtp[_0x7cd2('0x1')][_0x7cd2('0x2')]=function(_0x4fc932,_0x4eb33b){return new Promise(function(_0x446f5d,_0x48fa36){var _0x239705=nodemailer[_0x7cd2('0x3')](_0x4fc932);_0x239705['use'](_0x7cd2('0x4'),inlineBase64());_0x239705[_0x7cd2('0x5')](_0x4eb33b,function(_0x45b658,_0x102211){if(_0x45b658){_0x48fa36(_0x45b658['toString']());}else{_0x446f5d(_0x102211);}});});};EmailSmtp[_0x7cd2('0x1')]['verify']=function(_0x311feb){return new Promise(function(_0x1fa595,_0xa545e7){var _0x490c85=nodemailer['createTransport'](_0x311feb);_0x490c85[_0x7cd2('0x6')](function(_0x4a5342,_0x2c84d5){if(_0x4a5342){_0xa545e7(_0x4a5342[_0x7cd2('0x7')]());}else{if(_0x2c84d5){_0x1fa595(_0x2c84d5);}else{_0xa545e7('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index eaa0786..bb802ca 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 _0x42aa=['Empty\x20message

','Attachments','Data','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','split','length','join','Anonymous','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body'];(function(_0x45057d,_0x486d28){var _0x2f5bc9=function(_0x7627d1){while(--_0x7627d1){_0x45057d['push'](_0x45057d['shift']());}};_0x2f5bc9(++_0x486d28);}(_0x42aa,0xbb));var _0xa42a=function(_0x284c91,_0x199b02){_0x284c91=_0x284c91-0x0;var _0x4050e1=_0x42aa[_0x284c91];return _0x4050e1;};'use strict';var _=require(_0xa42a('0x0'));var moment=require(_0xa42a('0x1'));var random=require(_0xa42a('0x2'));var fs=require('fs');var path=require(_0xa42a('0x3'));var util=require(_0xa42a('0x4'));var tnef=require('node-tnef');var logger=require(_0xa42a('0x5'))(_0xa42a('0x6'));var config=require('../../../config/environment');function getAddress(_0x1a0927){var _0x579138=_[_0xa42a('0x7')](_0x1a0927[_0xa42a('0x8')]);return _0x579138&&_0x579138[_0xa42a('0x9')]?_0x579138['address']:_0xa42a('0xa')+random[_0xa42a('0xb')](0x6)+_0xa42a('0xc');}function getFirstName(_0x5041f6){var _0x32238f=_[_0xa42a('0x7')](_0x5041f6[_0xa42a('0x8')]);if(_0x32238f&&_0x32238f[_0xa42a('0xd')]){if(_0x32238f[_0xa42a('0xd')]==_0x32238f['address']){return _0x32238f[_0xa42a('0xd')]['substring'](0x0,_0x32238f['name']['indexOf']('@'));}var _0x4b1c3c=_0x32238f['name'][_0xa42a('0xe')](/\s+/);return _0x4b1c3c[_0xa42a('0xf')]>0x1?_0x4b1c3c['slice'](0x0,-0x1)[_0xa42a('0x10')]('\x20'):_0x32238f[_0xa42a('0xd')];}return _0xa42a('0x11');}function getLastName(_0x2ff9d6){var _0x5d6373=_[_0xa42a('0x7')](_0x2ff9d6[_0xa42a('0x8')]);if(_0x5d6373&&_0x5d6373[_0xa42a('0xd')]){var _0x13fc18=_0x5d6373[_0xa42a('0xd')][_0xa42a('0xe')](/\s+/);return _0x13fc18[_0xa42a('0xf')]>0x1?_0x13fc18['pop']():'';}return'';}function getMails(_0x54c562,_0x4f2e05){var _0xa20056='';for(var _0x13db22=0x0;_0x13db22<_0x4f2e05[_0xa42a('0x8')][_0xa42a('0xf')];_0x13db22+=0x1){if(_0x4f2e05[_0xa42a('0x8')][_0x13db22][_0xa42a('0x9')]!==_0x54c562){if(!_[_0xa42a('0x12')](_0xa20056)){_0xa20056+=',';}_0xa20056+=_0x4f2e05['value'][_0x13db22][_0xa42a('0xd')]||_0x4f2e05[_0xa42a('0x8')][_0x13db22]['address']||'';_0xa20056+='\x20<';_0xa20056+=_0x4f2e05[_0xa42a('0x8')][_0x13db22][_0xa42a('0x9')]?_0x4f2e05[_0xa42a('0x8')][_0x13db22]['address']:_0xa42a('0xa')+random[_0xa42a('0xb')](0x6)+_0xa42a('0xc');_0xa20056+='>';}}return _0xa20056;}function parseEmail(_0xe1a333,_0x222ae5,_0x4e3454){if(_0x222ae5[_0xa42a('0x13')]){var _0x21dd00=/)<[^<]*)*<\/script>/gi;while(_0x21dd00[_0xa42a('0x14')](_0x222ae5['html'])){_0x222ae5[_0xa42a('0x13')]=_0x222ae5[_0xa42a('0x13')][_0xa42a('0x15')](_0x21dd00,'');}if(_0x222ae5[_0xa42a('0x13')][_0xa42a('0x16')](_0xa42a('0x17'))){var _0x5f2c2d=[];_0x222ae5['attachments'][_0xa42a('0x18')](_0x229d85=>{_0x5f2c2d[_0xa42a('0x19')](_0x229d85[_0xa42a('0x1a')]);});var _0x946942=/]+>/g;var _0x146ea3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x564e78=_0x222ae5[_0xa42a('0x13')]['replace'](_0x146ea3,_0xa42a('0x1b'));var _0x3bc1f1=_0x564e78[_0xa42a('0x15')](_0x946942,_0xa42a('0x1c'));for(let _0xd8b096=0x0;_0xd8b096<_0x5f2c2d['length'];_0xd8b096++){var _0x433287=_0x3bc1f1[_0xa42a('0x15')](_0xa42a('0x1c'),_0xa42a('0x1d')+_0x5f2c2d[_0xd8b096]+_0xa42a('0x1e'));_0x3bc1f1=_0x433287;}_0x222ae5['html']=_0x3bc1f1;}_0x4e3454[_0xa42a('0x1f')]=_0x222ae5[_0xa42a('0x13')];}else{_0x4e3454[_0xa42a('0x1f')]=_0x222ae5['textAsHtml'];}if(_0x4e3454[_0xa42a('0x1f')]){_0x4e3454[_0xa42a('0x1f')]=_0x4e3454[_0xa42a('0x1f')]['replace'](/0x0){var _0x1ca154=['Auto-Submitted:\x20auto-replied',_0xa42a('0x31'),_0xa42a('0x32')];for(var _0x2d64f4=0x0;_0x2d64f4<_0x222ae5['headerLines'][_0xa42a('0xf')];_0x2d64f4++){var _0x73afe5=_[_0xa42a('0x33')](_0x1ca154,_0x222ae5[_0xa42a('0x30')][_0x2d64f4][_0xa42a('0x34')]);if(_0x73afe5>=0x0){_0x4e3454[_0xa42a('0x35')]=!![];}}}return _0x4e3454;}exports[_0xa42a('0x36')]=function(_0x1b9028,_0xe0d32,_0x3e6129){var _0x4c7a3a={'from':getAddress(_0xe0d32[_0xa42a('0x37')]),'firstName':getFirstName(_0xe0d32[_0xa42a('0x37')]),'lastName':getLastName(_0xe0d32[_0xa42a('0x37')]),'mapKey':_0xa42a('0x6'),'message':{'from':getMails(_0x1b9028[_0xa42a('0x6')],_0xe0d32[_0xa42a('0x37')]),'to':_0x1b9028[_0xa42a('0x6')],'cc':'','subject':_0xe0d32['subject']||'','messageId':_0xe0d32[_0xa42a('0x38')],'inReplyTo':_0xe0d32[_0xa42a('0x39')],'sentAt':moment(_0xe0d32[_0xa42a('0x3a')])[_0xa42a('0x3b')](_0xa42a('0x3c')),'attach':![],'attachments':[]}};if(!_0xe0d32[_0xa42a('0x13')]&&!_0xe0d32[_0xa42a('0x3d')]){var _0x2dbb29=_['filter'](_0xe0d32[_0xa42a('0x25')],{'contentType':_0xa42a('0x3e')});if(_0x2dbb29[_0xa42a('0xf')]){logger['info'](util[_0xa42a('0x3b')](_0xa42a('0x3f'),_0xe0d32[_0xa42a('0x38')]));tnef['parseBuffer'](_[_0xa42a('0x40')](_0x2dbb29)[_0xa42a('0x2f')],function(_0x1c4f6d,_0x4f088a){if(_0x4f088a){_0xe0d32[_0xa42a('0x13')]=_0x4f088a[_0xa42a('0x41')]||_0xa42a('0x42');if(_0x4f088a[_0xa42a('0x43')]){for(var _0x58d267=0x0;_0x58d267<_0x4f088a[_0xa42a('0x43')][_0xa42a('0xf')];_0x58d267++){var _0x52368b=_0x4f088a[_0xa42a('0x43')][_0x58d267];_0x4c7a3a[_0xa42a('0x21')][_0xa42a('0x25')][_0xa42a('0x19')]({'filename':_0x52368b['Title'],'content':Buffer[_0xa42a('0x37')](_0x52368b[_0xa42a('0x44')])});}}}_0x3e6129(parseEmail(_0x1b9028,_0xe0d32,_0x4c7a3a));});}else{_0xe0d32[_0xa42a('0x13')]=_0xa42a('0x42');_0x3e6129(parseEmail(_0x1b9028,_0xe0d32,_0x4c7a3a));}}else{_0x3e6129(parseEmail(_0x1b9028,_0xe0d32,_0x4c7a3a));}};exports['generateXOAuth2Token']=function(_0x39488f,_0x284786){var _0x1ffa76=[_0xa42a('0x45')+(_0x284786||''),'auth=Bearer\x20'+_0x39488f,'',''];return Buffer['from'](_0x1ffa76[_0xa42a('0x10')](''),_0xa42a('0x46'))[_0xa42a('0x47')](_0xa42a('0x48'));}; \ No newline at end of file +var _0xb45b=['html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','path','node-tnef','../../../config/logger','../../../config/environment','head','value','address','@xcally.com','substring','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous'];(function(_0x18aca1,_0x27937d){var _0x571c90=function(_0x252ad6){while(--_0x252ad6){_0x18aca1['push'](_0x18aca1['shift']());}};_0x571c90(++_0x27937d);}(_0xb45b,0x1e3));var _0xbb45=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0xb45b[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0xbb45('0x0'));var moment=require('moment');var random=require(_0xbb45('0x1'));var fs=require('fs');var path=require(_0xbb45('0x2'));var util=require('util');var tnef=require(_0xbb45('0x3'));var logger=require(_0xbb45('0x4'))('email');var config=require(_0xbb45('0x5'));function getAddress(_0x30a184){var _0x34279e=_[_0xbb45('0x6')](_0x30a184[_0xbb45('0x7')]);return _0x34279e&&_0x34279e[_0xbb45('0x8')]?_0x34279e[_0xbb45('0x8')]:'anonymous'+random['generate'](0x6)+_0xbb45('0x9');}function getFirstName(_0x1f5732){var _0x971db5=_[_0xbb45('0x6')](_0x1f5732[_0xbb45('0x7')]);if(_0x971db5&&_0x971db5['name']){if(_0x971db5['name']==_0x971db5[_0xbb45('0x8')]){return _0x971db5['name'][_0xbb45('0xa')](0x0,_0x971db5[_0xbb45('0xb')][_0xbb45('0xc')]('@'));}var _0x458af2=_0x971db5['name'][_0xbb45('0xd')](/\s+/);return _0x458af2[_0xbb45('0xe')]>0x1?_0x458af2[_0xbb45('0xf')](0x0,-0x1)[_0xbb45('0x10')]('\x20'):_0x971db5[_0xbb45('0xb')];}return _0xbb45('0x11');}function getLastName(_0x30e527){var _0x47d66e=_[_0xbb45('0x6')](_0x30e527[_0xbb45('0x7')]);if(_0x47d66e&&_0x47d66e[_0xbb45('0xb')]){var _0x1fc0da=_0x47d66e[_0xbb45('0xb')][_0xbb45('0xd')](/\s+/);return _0x1fc0da[_0xbb45('0xe')]>0x1?_0x1fc0da[_0xbb45('0x12')]():'';}return'';}function getMails(_0x11178c,_0x4d6f50){var _0x27d1d6='';for(var _0x2491f9=0x0;_0x2491f9<_0x4d6f50[_0xbb45('0x7')]['length'];_0x2491f9+=0x1){if(_0x4d6f50['value'][_0x2491f9][_0xbb45('0x8')]!==_0x11178c){if(!_[_0xbb45('0x13')](_0x27d1d6)){_0x27d1d6+=',';}_0x27d1d6+=_0x4d6f50[_0xbb45('0x7')][_0x2491f9][_0xbb45('0xb')]||_0x4d6f50['value'][_0x2491f9][_0xbb45('0x8')]||'';_0x27d1d6+='\x20<';_0x27d1d6+=_0x4d6f50['value'][_0x2491f9][_0xbb45('0x8')]?_0x4d6f50[_0xbb45('0x7')][_0x2491f9][_0xbb45('0x8')]:_0xbb45('0x14')+random['generate'](0x6)+'@xcally.com';_0x27d1d6+='>';}}return _0x27d1d6;}function parseEmail(_0x599df6,_0x54c5fb,_0x23baf6){if(_0x54c5fb[_0xbb45('0x15')]){var _0x92a7a=/)<[^<]*)*<\/script>/gi;while(_0x92a7a[_0xbb45('0x16')](_0x54c5fb[_0xbb45('0x15')])){_0x54c5fb[_0xbb45('0x15')]=_0x54c5fb['html']['replace'](_0x92a7a,'');}if(_0x54c5fb[_0xbb45('0x15')][_0xbb45('0x17')](_0xbb45('0x18'))){var _0x5d6f6a=[];_0x54c5fb[_0xbb45('0x19')][_0xbb45('0x1a')](_0x4e5995=>{_0x5d6f6a[_0xbb45('0x1b')](_0x4e5995['filename']);});var _0x488c29=/]+>/g;var _0x3da900=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x57d1fc=_0x54c5fb[_0xbb45('0x15')][_0xbb45('0x1c')](_0x3da900,_0xbb45('0x1d'));var _0x8bc462=_0x57d1fc['replace'](_0x488c29,_0xbb45('0x1e'));for(let _0x542ab2=0x0;_0x542ab2<_0x5d6f6a[_0xbb45('0xe')];_0x542ab2++){var _0x30d774=_0x8bc462[_0xbb45('0x1c')](_0xbb45('0x1e'),_0xbb45('0x1f')+_0x5d6f6a[_0x542ab2]+_0xbb45('0x20'));_0x8bc462=_0x30d774;}_0x54c5fb['html']=_0x8bc462;}_0x23baf6[_0xbb45('0x21')]=_0x54c5fb[_0xbb45('0x15')];}else{_0x23baf6[_0xbb45('0x21')]=_0x54c5fb[_0xbb45('0x22')];}if(_0x23baf6['body']){_0x23baf6[_0xbb45('0x21')]=_0x23baf6['body'][_0xbb45('0x1c')](/0x0){var _0x9486db=['Auto-Submitted:\x20auto-replied',_0xbb45('0x31'),_0xbb45('0x32')];for(var _0x26bfd1=0x0;_0x26bfd1<_0x54c5fb[_0xbb45('0x30')][_0xbb45('0xe')];_0x26bfd1++){var _0x335b35=_[_0xbb45('0xc')](_0x9486db,_0x54c5fb[_0xbb45('0x30')][_0x26bfd1][_0xbb45('0x33')]);if(_0x335b35>=0x0){_0x23baf6[_0xbb45('0x34')]=!![];}}}return _0x23baf6;}exports['parser']=function(_0x15073b,_0xc3facb,_0x49b2c7){var _0x25c4f8={'from':getAddress(_0xc3facb[_0xbb45('0x35')]),'firstName':getFirstName(_0xc3facb[_0xbb45('0x35')]),'lastName':getLastName(_0xc3facb['from']),'mapKey':_0xbb45('0x25'),'message':{'from':getMails(_0x15073b[_0xbb45('0x25')],_0xc3facb[_0xbb45('0x35')]),'to':_0x15073b[_0xbb45('0x25')],'cc':'','subject':_0xc3facb[_0xbb45('0x36')]||'','messageId':_0xc3facb['messageId'],'inReplyTo':_0xc3facb[_0xbb45('0x37')],'sentAt':moment(_0xc3facb['date'])['format'](_0xbb45('0x38')),'attach':![],'attachments':[]}};if(!_0xc3facb[_0xbb45('0x15')]&&!_0xc3facb[_0xbb45('0x22')]){var _0x51a57f=_[_0xbb45('0x39')](_0xc3facb[_0xbb45('0x19')],{'contentType':_0xbb45('0x3a')});if(_0x51a57f['length']){logger[_0xbb45('0x3b')](util[_0xbb45('0x2c')](_0xbb45('0x3c'),_0xc3facb[_0xbb45('0x3d')]));tnef['parseBuffer'](_[_0xbb45('0x3e')](_0x51a57f)[_0xbb45('0x2f')],function(_0x598b5f,_0x451859){if(_0x451859){_0xc3facb[_0xbb45('0x15')]=_0x451859['BodyHTML']||_0xbb45('0x3f');if(_0x451859[_0xbb45('0x40')]){for(var _0x5ac758=0x0;_0x5ac758<_0x451859['Attachments']['length'];_0x5ac758++){var _0x3d31a8=_0x451859[_0xbb45('0x40')][_0x5ac758];_0x25c4f8['message'][_0xbb45('0x19')]['push']({'filename':_0x3d31a8[_0xbb45('0x41')],'content':Buffer[_0xbb45('0x35')](_0x3d31a8[_0xbb45('0x42')])});}}}_0x49b2c7(parseEmail(_0x15073b,_0xc3facb,_0x25c4f8));});}else{_0xc3facb['html']=_0xbb45('0x3f');_0x49b2c7(parseEmail(_0x15073b,_0xc3facb,_0x25c4f8));}}else{_0x49b2c7(parseEmail(_0x15073b,_0xc3facb,_0x25c4f8));}};exports['generateXOAuth2Token']=function(_0x28dd6e,_0x173225){var _0x1a35db=[_0xbb45('0x43')+(_0x173225||''),_0xbb45('0x44')+_0x28dd6e,'',''];return Buffer['from'](_0x1a35db[_0xbb45('0x10')](''),_0xbb45('0x45'))[_0xbb45('0x46')](_0xbb45('0x47'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 1c8706f..5b70b17 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4db5=['Service','key','SERV','active','Imap','Smtp'];(function(_0x60743a,_0x40ab0e){var _0x282ef4=function(_0x473249){while(--_0x473249){_0x60743a['push'](_0x60743a['shift']());}};_0x282ef4(++_0x40ab0e);}(_0x4db5,0x1c8));var _0x54db=function(_0x181c8e,_0x2a0dc9){_0x181c8e=_0x181c8e-0x0;var _0x3ba7cf=_0x4db5[_0x181c8e];return _0x3ba7cf;};'use strict';var _=require('lodash');function MailAccount(_0x191a23){this['id']=_0x191a23['id']||0x0;this['name']=_0x191a23['name']||_0x54db('0x0');this[_0x54db('0x1')]=_0x191a23['key']||_0x54db('0x2');this[_0x54db('0x3')]=_0x191a23['active']||![];this[_0x54db('0x4')]=_0x191a23[_0x54db('0x4')]||[];this[_0x54db('0x5')]=_0x191a23[_0x54db('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xa4f4=['key','SERV','active','Imap','Smtp','exports','name','Service'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0xa4f4,0xf6));var _0x4a4f=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xa4f4[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');function MailAccount(_0x148d28){this['id']=_0x148d28['id']||0x0;this[_0x4a4f('0x0')]=_0x148d28[_0x4a4f('0x0')]||_0x4a4f('0x1');this[_0x4a4f('0x2')]=_0x148d28[_0x4a4f('0x2')]||_0x4a4f('0x3');this[_0x4a4f('0x4')]=_0x148d28[_0x4a4f('0x4')]||![];this[_0x4a4f('0x5')]=_0x148d28[_0x4a4f('0x5')]||[];this[_0x4a4f('0x6')]=_0x148d28[_0x4a4f('0x6')]||[];}module[_0x4a4f('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index d5bdb62..1b58abd 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd451=['initMailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x401b86,_0x3eccb6){var _0x3b8c45=function(_0x2a036f){while(--_0x2a036f){_0x401b86['push'](_0x401b86['shift']());}};_0x3b8c45(++_0x3eccb6);}(_0xd451,0xca));var _0x1d45=function(_0x273709,_0x34aa00){_0x273709=_0x273709-0x0;var _0x1421bf=_0xd451[_0x273709];return _0x1421bf;};'use strict';var _=require(_0x1d45('0x0'));var MailAccount=require(_0x1d45('0x1'));var Realtime=function(){this[_0x1d45('0x2')]={};};function freeIsNotKey(_0x1d4cf4,_0x354eb8,_0x395877){var _0x15379a=_[_0x1d45('0x3')](_0x1d4cf4,function(_0x4aa014,_0x36d396){return _0x4aa014[_0x395877];});for(var _0x1032ca in _0x354eb8){if(_0x354eb8[_0x1d45('0x4')](_0x1032ca)){if(!_0x15379a[_0x1032ca]){delete _0x354eb8[_0x1032ca];}}}}Realtime[_0x1d45('0x5')][_0x1d45('0x6')]=function(_0x4ebc26,_0x8b96d2){for(var _0x4c756a in _0x8b96d2){if(_0x4ebc26[_0x1d45('0x4')](_0x4c756a)){_0x4ebc26[_0x4c756a]=_0x8b96d2[_0x4c756a];}}};Realtime[_0x1d45('0x5')][_0x1d45('0x7')]=function(){var _0x4329e1=this;return function(_0x1f56b3){if(_0x1f56b3){freeIsNotKey(_0x1f56b3,_0x4329e1[_0x1d45('0x2')],'id');for(var _0x5bedc6=0x0,_0x2e7202={},_0xa5657d={};_0x5bedc6<_0x1f56b3[_0x1d45('0x8')];_0x5bedc6+=0x1){_0x2e7202=_0x1f56b3[_0x5bedc6];if(_[_0x1d45('0x9')](_0x4329e1['mailAccounts'][_0x2e7202['id']])){_0x4329e1['mailAccounts'][_0x2e7202['id']]=new MailAccount(_0x2e7202);}else{_[_0x1d45('0xa')](_0x4329e1['mailAccounts'][_0x2e7202['id']],_0x2e7202);}}}return _0x4329e1[_0x1d45('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0x4936=['mapKeys','hasOwnProperty','mergeFromDatabase','length','isUndefined','merge','../model/mailAccount','mailAccounts'];(function(_0x229484,_0x220fa4){var _0x575cfa=function(_0x5f1a93){while(--_0x5f1a93){_0x229484['push'](_0x229484['shift']());}};_0x575cfa(++_0x220fa4);}(_0x4936,0x96));var _0x6493=function(_0x215224,_0x1b923b){_0x215224=_0x215224-0x0;var _0x3d4cf4=_0x4936[_0x215224];return _0x3d4cf4;};'use strict';var _=require('lodash');var MailAccount=require(_0x6493('0x0'));var Realtime=function(){this[_0x6493('0x1')]={};};function freeIsNotKey(_0x432d8d,_0x507027,_0x9af7af){var _0x29a074=_[_0x6493('0x2')](_0x432d8d,function(_0xc70562,_0x1925c5){return _0xc70562[_0x9af7af];});for(var _0x556e11 in _0x507027){if(_0x507027[_0x6493('0x3')](_0x556e11)){if(!_0x29a074[_0x556e11]){delete _0x507027[_0x556e11];}}}}Realtime['prototype'][_0x6493('0x4')]=function(_0x3db644,_0x42acd5){for(var _0x565434 in _0x42acd5){if(_0x3db644[_0x6493('0x3')](_0x565434)){_0x3db644[_0x565434]=_0x42acd5[_0x565434];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x4784ff=this;return function(_0x4880b5){if(_0x4880b5){freeIsNotKey(_0x4880b5,_0x4784ff[_0x6493('0x1')],'id');for(var _0x3fdbe7=0x0,_0x4f8d46={},_0x1143f8={};_0x3fdbe7<_0x4880b5[_0x6493('0x5')];_0x3fdbe7+=0x1){_0x4f8d46=_0x4880b5[_0x3fdbe7];if(_[_0x6493('0x6')](_0x4784ff['mailAccounts'][_0x4f8d46['id']])){_0x4784ff[_0x6493('0x1')][_0x4f8d46['id']]=new MailAccount(_0x4f8d46);}else{_[_0x6493('0x7')](_0x4784ff[_0x6493('0x1')][_0x4f8d46['id']],_0x4f8d46);}}}return _0x4784ff['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 4179aef..e3ac11c 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0909=['getMailAccounts','name','provider','email','active','key','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','service','getMailAccount','notify','Request','NotifyMailAccount'];(function(_0x3d9df9,_0x5138d4){var _0x1a0953=function(_0xc46d96){while(--_0xc46d96){_0x3d9df9['push'](_0x3d9df9['shift']());}};_0x1a0953(++_0x5138d4);}(_0x0909,0x1e6));var _0x9090=function(_0x3b9bab,_0x3badf3){_0x3b9bab=_0x3b9bab-0x0;var _0x1cbf22=_0x0909[_0x3b9bab];return _0x1cbf22;};'use strict';var client=require('../client');exports[_0x9090('0x0')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x9090('0x1'),_0x9090('0x2'),'service',_0x9090('0x3'),_0x9090('0x4'),_0x9090('0x5'),'ListId',_0x9090('0x6')],'raw':![],'include':[{'model':_0x9090('0x7'),'as':_0x9090('0x8'),'include':[{'model':_0x9090('0x9'),'attributes':['id',_0x9090('0x1'),'service',_0x9090('0xa'),_0x9090('0xb')],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0x9090('0xc'),'include':[{'model':_0x9090('0x9'),'attributes':['id','name',_0x9090('0xd'),_0x9090('0xa'),'data5'],'as':_0x9090('0x9')}]}]},'log':_0x9090('0xe')});};};exports[_0x9090('0xf')]=function(_0x24eede,_0x18e636){return client[_0x9090('0x10')](_0x9090('0x11'),{'account':{'id':_0x24eede},'body':_0x18e636,'log':_0x9090('0x11')});}; \ No newline at end of file +var _0xda42=['GetMailAccount','name','provider','service','active','ListId','CloudProvider','type','data5','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x3dc8ab,_0x4fd9ae){var _0x2337e6=function(_0x2347b9){while(--_0x2347b9){_0x3dc8ab['push'](_0x3dc8ab['shift']());}};_0x2337e6(++_0x4fd9ae);}(_0xda42,0x1bd));var _0x2da4=function(_0x17287c,_0x36814a){_0x17287c=_0x17287c-0x0;var _0x3f26a7=_0xda42[_0x17287c];return _0x3f26a7;};'use strict';var client=require(_0x2da4('0x0'));exports[_0x2da4('0x1')]=function(){return function(){return client[_0x2da4('0x2')](_0x2da4('0x3'),{'options':{'attributes':['id',_0x2da4('0x4'),_0x2da4('0x5'),_0x2da4('0x6'),'email',_0x2da4('0x7'),'key',_0x2da4('0x8'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x2da4('0x9'),'attributes':['id',_0x2da4('0x4'),_0x2da4('0x6'),_0x2da4('0xa'),_0x2da4('0xb')],'as':_0x2da4('0x9')}]},{'model':_0x2da4('0xc'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0x2da4('0x4'),_0x2da4('0x6'),_0x2da4('0xa'),'data5'],'as':_0x2da4('0x9')}]}]},'log':_0x2da4('0xd')});};};exports[_0x2da4('0xe')]=function(_0x400a40,_0x208170){return client[_0x2da4('0x2')](_0x2da4('0xf'),{'account':{'id':_0x400a40},'body':_0x208170,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 6173e0b..57e4880 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f9b=['../client','loginMailFrequency','GetSettings'];(function(_0x13c19c,_0x1d4a84){var _0x594ee4=function(_0x326bb8){while(--_0x326bb8){_0x13c19c['push'](_0x13c19c['shift']());}};_0x594ee4(++_0x1d4a84);}(_0x3f9b,0x6f));var _0xb3f9=function(_0x1b2732,_0xaa3ad8){_0x1b2732=_0x1b2732-0x0;var _0x5bcc4f=_0x3f9b[_0x1b2732];return _0x5bcc4f;};'use strict';var client=require(_0xb3f9('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb3f9('0x1')]},'log':_0xb3f9('0x2')});}; \ No newline at end of file +var _0x35a3=['../client','ShowSetting','loginMailFrequency'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x35a3,0x162));var _0x335a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x35a3[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x335a('0x0'));exports['getSettings']=function(){return client['Request'](_0x335a('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x335a('0x2')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index c64a5a0..61b41f0 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 4cc9b87..f4dea35 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16cb=['defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','../../config/environment','createServer','socket.io','websocket','polling','redis'];(function(_0xe1dbb9,_0x10a535){var _0xf5216f=function(_0x3b4f5e){while(--_0x3b4f5e){_0xe1dbb9['push'](_0xe1dbb9['shift']());}};_0xf5216f(++_0x10a535);}(_0x16cb,0x195));var _0xb16c=function(_0x44d9a7,_0x542cfa){_0x44d9a7=_0x44d9a7-0x0;var _0x48bd30=_0x16cb[_0x44d9a7];return _0x48bd30;};'use strict';var _=require(_0xb16c('0x0'));var http=require(_0xb16c('0x1'));var express=require(_0xb16c('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xb16c('0x3'));var app=express();var server=http[_0xb16c('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xb16c('0x5'))(server,{'transports':[_0xb16c('0x6'),_0xb16c('0x7')]});config[_0xb16c('0x8')]=_[_0xb16c('0x9')](config['redis'],{'host':_0xb16c('0xa'),'port':0x18eb});socketio[_0xb16c('0xb')](require(_0xb16c('0xc'))({'pubClient':new Redis(config[_0xb16c('0x8')]),'subClient':new Redis(config[_0xb16c('0x8')])}));require('../../config/triggers')[_0xb16c('0xd')]();require(_0xb16c('0xe'))[_0xb16c('0xd')](socketio);require(_0xb16c('0xf'))[_0xb16c('0xd')](app);require(_0xb16c('0x10'))[_0xb16c('0xd')](app);}else{server[_0xb16c('0x11')](_0xb16c('0x12'),function(){console[_0xb16c('0x13')](_0xb16c('0x14'),config[_0xb16c('0x15')]);});}exports=module[_0xb16c('0x16')]=app; \ No newline at end of file +var _0x5656=['once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default'];(function(_0xe7d5c7,_0x2a6fb6){var _0x15a9c6=function(_0x4ac384){while(--_0x4ac384){_0xe7d5c7['push'](_0xe7d5c7['shift']());}};_0x15a9c6(++_0x2a6fb6);}(_0x5656,0x14a));var _0x6565=function(_0x11a796,_0x11a8f2){_0x11a796=_0x11a796-0x0;var _0x5a1439=_0x5656[_0x11a796];return _0x5a1439;};'use strict';var _=require(_0x6565('0x0'));var http=require(_0x6565('0x1'));var express=require(_0x6565('0x2'));var sticky=require(_0x6565('0x3'));var Redis=require(_0x6565('0x4'));var config=require(_0x6565('0x5'));var app=express();var server=http[_0x6565('0x6')](app);server[_0x6565('0x7')]=0xdbba0;if(sticky[_0x6565('0x8')](server,config[_0x6565('0x9')])){var socketio=require(_0x6565('0xa'))(server,{'transports':[_0x6565('0xb'),_0x6565('0xc')]});config['redis']=_[_0x6565('0xd')](config[_0x6565('0xe')],{'host':_0x6565('0xf'),'port':0x18eb});socketio[_0x6565('0x10')](require(_0x6565('0x11'))({'pubClient':new Redis(config[_0x6565('0xe')]),'subClient':new Redis(config[_0x6565('0xe')])}));require(_0x6565('0x12'))['default']();require('../../config/socketio')[_0x6565('0x13')](socketio);require('../../config/express')[_0x6565('0x13')](app);require('../../routes')[_0x6565('0x13')](app);}else{server[_0x6565('0x14')](_0x6565('0x15'),function(){console[_0x6565('0x16')](_0x6565('0x17'),config[_0x6565('0x9')]);});}exports=module[_0x6565('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 83b5a8c..42fcce2 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf086=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','debug','rpc','error','message'];(function(_0x57a268,_0x12d2fe){var _0x398b94=function(_0x396f44){while(--_0x396f44){_0x57a268['push'](_0x57a268['shift']());}};_0x398b94(++_0x12d2fe);}(_0xf086,0x65));var _0x6f08=function(_0x48e7ba,_0x120483){_0x48e7ba=_0x48e7ba-0x0;var _0x50a06c=_0xf086[_0x48e7ba];return _0x50a06c;};'use strict';var jayson=require(_0x6f08('0x0'));var BPromise=require(_0x6f08('0x1'));var logger=require(_0x6f08('0x2'))(_0x6f08('0x3'));var client=jayson[_0x6f08('0x4')][_0x6f08('0x5')]({'port':0x2329});client[_0x6f08('0x6')]=function(_0x152f52,_0x5a9a7d){return new BPromise(function(_0x20cee2,_0x43f1b6){return client['request'](_0x152f52,_0x5a9a7d)['then'](function(_0x141cf7){logger[_0x6f08('0x7')](_0x6f08('0x8'),_0x6f08('0x3'),_0x152f52,_0x5a9a7d,_0x141cf7);if(_0x141cf7[_0x6f08('0x9')]){logger[_0x6f08('0x9')](_0x6f08('0x8'),'routing',_0x152f52,_0x141cf7[_0x6f08('0x9')][_0x6f08('0xa')],_0x5a9a7d);return _0x43f1b6(_0x141cf7[_0x6f08('0x9')][_0x6f08('0xa')]);}else{return _0x20cee2(_0x141cf7[_0x6f08('0xb')]);}})[_0x6f08('0xc')](function(_0x4eb81c){logger['error'](_0x6f08('0x8'),_0x6f08('0x3'),_0x152f52,_0x4eb81c,_0x5a9a7d);return _0x43f1b6(_0x4eb81c);});});};module[_0x6f08('0xd')]=client; \ No newline at end of file +var _0xa03d=['exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then','rpc','error','message'];(function(_0x2a7e56,_0x3e8ddd){var _0x1e9436=function(_0x26be80){while(--_0x26be80){_0x2a7e56['push'](_0x2a7e56['shift']());}};_0x1e9436(++_0x3e8ddd);}(_0xa03d,0x1ed));var _0xda03=function(_0x167af2,_0x56bbca){_0x167af2=_0x167af2-0x0;var _0x774212=_0xa03d[_0x167af2];return _0x774212;};'use strict';var jayson=require(_0xda03('0x0'));var BPromise=require(_0xda03('0x1'));var logger=require(_0xda03('0x2'))(_0xda03('0x3'));var client=jayson['client'][_0xda03('0x4')]({'port':0x2329});client[_0xda03('0x5')]=function(_0x5a5f56,_0x3a4e40){return new BPromise(function(_0x35db23,_0xedb6e3){return client[_0xda03('0x6')](_0x5a5f56,_0x3a4e40)[_0xda03('0x7')](function(_0x25bd20){logger['debug'](_0xda03('0x8'),_0xda03('0x3'),_0x5a5f56,_0x3a4e40,_0x25bd20);if(_0x25bd20[_0xda03('0x9')]){logger[_0xda03('0x9')](_0xda03('0x8'),_0xda03('0x3'),_0x5a5f56,_0x25bd20[_0xda03('0x9')]['message'],_0x3a4e40);return _0xedb6e3(_0x25bd20['error'][_0xda03('0xa')]);}else{return _0x35db23(_0x25bd20['result']);}})['catch'](function(_0x105e5a){logger['error'](_0xda03('0x8'),_0xda03('0x3'),_0x5a5f56,_0x105e5a,_0x3a4e40);return _0xedb6e3(_0x105e5a);});});};module[_0xda03('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 50d47e6..eaed77f 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e2d=['./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','initSmsQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue'];(function(_0x40b666,_0x2bd090){var _0x28f92f=function(_0x494442){while(--_0x494442){_0x40b666['push'](_0x40b666['shift']());}};_0x28f92f(++_0x2bd090);}(_0x1e2d,0xb9));var _0xd1e2=function(_0x35fa2a,_0x2a0b4a){_0x35fa2a=_0x35fa2a-0x0;var _0x1be582=_0x1e2d[_0x35fa2a];return _0x1be582;};'use strict';var BPromise=require('bluebird');var server=require(_0xd1e2('0x0'));var Realtime=require(_0xd1e2('0x1'));var user=require(_0xd1e2('0x2'));var interval=require(_0xd1e2('0x3'));var openchannelQueue=require(_0xd1e2('0x4'));var chatQueue=require(_0xd1e2('0x5'));var smsQueue=require(_0xd1e2('0x6'));var mailQueue=require(_0xd1e2('0x7'));var faxQueue=require(_0xd1e2('0x8'));var whatsappQueue=require(_0xd1e2('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd1e2('0xa')]()['then'](user[_0xd1e2('0xb')]())[_0xd1e2('0xc')](realtime['initAgents']())[_0xd1e2('0xc')](interval[_0xd1e2('0xd')]())[_0xd1e2('0xc')](realtime[_0xd1e2('0xe')]())[_0xd1e2('0xc')](openchannelQueue[_0xd1e2('0xf')]())[_0xd1e2('0xc')](realtime[_0xd1e2('0x10')]())[_0xd1e2('0xc')](chatQueue['getChatQueues']())['then'](realtime[_0xd1e2('0x11')]())[_0xd1e2('0xc')](smsQueue['getSmsQueues']())[_0xd1e2('0xc')](realtime[_0xd1e2('0x12')]())[_0xd1e2('0xc')](mailQueue['getMailQueues']())[_0xd1e2('0xc')](realtime['initMailQueues']())['then'](faxQueue[_0xd1e2('0x13')]())[_0xd1e2('0xc')](realtime[_0xd1e2('0x14')]())[_0xd1e2('0xc')](whatsappQueue['getWhatsappQueues']())[_0xd1e2('0xc')](realtime[_0xd1e2('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x3b9bce){return initRealtime();})[_0xd1e2('0xc')](function(_0x4b5be3){return setInterval(initRealtime,0x1388);})[_0xd1e2('0x16')](function(_0x3fee96){console[_0xd1e2('0x17')](_0x3fee96);});}main(); \ No newline at end of file +var _0x8dd5=['initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','resolve','then','getAgents'];(function(_0x3baaf2,_0x894e3d){var _0x50e8b0=function(_0x35dd6f){while(--_0x35dd6f){_0x3baaf2['push'](_0x3baaf2['shift']());}};_0x50e8b0(++_0x894e3d);}(_0x8dd5,0x141));var _0x58dd=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x8dd5[_0x149ca0];return _0x56b6b9;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x58dd('0x0'));var user=require(_0x58dd('0x1'));var interval=require(_0x58dd('0x2'));var openchannelQueue=require(_0x58dd('0x3'));var chatQueue=require(_0x58dd('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x58dd('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x58dd('0x6')]()[_0x58dd('0x7')](user[_0x58dd('0x8')]())[_0x58dd('0x7')](realtime[_0x58dd('0x9')]())['then'](interval['getIntervals']())[_0x58dd('0x7')](realtime[_0x58dd('0xa')]())[_0x58dd('0x7')](openchannelQueue[_0x58dd('0xb')]())[_0x58dd('0x7')](realtime[_0x58dd('0xc')]())[_0x58dd('0x7')](chatQueue[_0x58dd('0xd')]())[_0x58dd('0x7')](realtime[_0x58dd('0xe')]())['then'](smsQueue['getSmsQueues']())['then'](realtime[_0x58dd('0xf')]())[_0x58dd('0x7')](mailQueue['getMailQueues']())[_0x58dd('0x7')](realtime[_0x58dd('0x10')]())['then'](faxQueue[_0x58dd('0x11')]())[_0x58dd('0x7')](realtime[_0x58dd('0x12')]())['then'](whatsappQueue[_0x58dd('0x13')]())[_0x58dd('0x7')](realtime[_0x58dd('0x14')]())[_0x58dd('0x7')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x58dd('0x7')](function(_0x116fdc){return initRealtime();})[_0x58dd('0x7')](function(_0x30f153){return setInterval(initRealtime,0x1388);})[_0x58dd('0x15')](function(_0x3cf2c4){console['log'](_0x3cf2c4);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index b5e3938..f137730 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0xd5ef4d,_0x38ad5d){var _0x67107=function(_0x6f8830){while(--_0x6f8830){_0xd5ef4d['push'](_0xd5ef4d['shift']());}};_0x67107(++_0x38ad5d);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x5fc3[_0xd1b4d7];return _0x3002ec;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x278f6e,_0x27b846){var _0x503930=function(_0x4b9a49){while(--_0x4b9a49){_0x278f6e['push'](_0x278f6e['shift']());}};_0x503930(++_0x27b846);}(_0x7a54,0x106));var _0x47a5=function(_0x56cc23,_0xcc2472){_0x56cc23=_0x56cc23-0x0;var _0x4c8145=_0x7a54[_0x56cc23];return _0x4c8145;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 909c730..45cbb50 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d6d=['result','sendMailMessage','jayson/promise','http','request','error','message'];(function(_0x187306,_0x151cf9){var _0x2e5ecf=function(_0x231cc1){while(--_0x231cc1){_0x187306['push'](_0x187306['shift']());}};_0x2e5ecf(++_0x151cf9);}(_0x0d6d,0x167));var _0xd0d6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0d6d[_0x42cae2];return _0x5f256f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xd0d6('0x0'));var client=jayson['client'][_0xd0d6('0x1')]({'port':0x232b});function request(_0x3438d9,_0x1d5f16){return new BPromise(function(_0x933872,_0x46ce94){return client[_0xd0d6('0x2')](_0x3438d9,_0x1d5f16)['then'](function(_0x44176f){if(_0x44176f[_0xd0d6('0x3')]){return _0x46ce94(_0x44176f[_0xd0d6('0x3')][_0xd0d6('0x4')]);}else{return _0x933872(_0x44176f[_0xd0d6('0x5')]);}})['catch'](function(_0x333261){return _0x46ce94(_0x333261);});});}exports[_0xd0d6('0x6')]=function(_0x14a902,_0x2e1ad2){return request('SendMail',{'account':_0x14a902,'message':_0x2e1ad2});}; \ No newline at end of file +var _0x04c0=['result','SendMail','bluebird','jayson/promise','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04c0,0x116));var _0x004c=function(_0x463efb,_0x4c094c){_0x463efb=_0x463efb-0x0;var _0x2c7cbd=_0x04c0[_0x463efb];return _0x2c7cbd;};'use strict';var BPromise=require(_0x004c('0x0'));var jayson=require(_0x004c('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x44e738,_0x5cab1f){return new BPromise(function(_0x4defc9,_0x4a3139){return client['request'](_0x44e738,_0x5cab1f)[_0x004c('0x2')](function(_0x4352c7){if(_0x4352c7[_0x004c('0x3')]){return _0x4a3139(_0x4352c7[_0x004c('0x3')]['message']);}else{return _0x4defc9(_0x4352c7[_0x004c('0x4')]);}})['catch'](function(_0x1adbe2){return _0x4a3139(_0x1adbe2);});});}exports['sendMailMessage']=function(_0xc3bcae,_0xa89f34){return request(_0x004c('0x5'),{'account':_0xc3bcae,'message':_0xa89f34});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 74f7167..d4800c9 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bb6=['faxStatusTime','smsStatusTime','whatsappStatusTime','openchannelStatus','busy','chatWaitingInteractions','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','unknown','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','Capacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','Status','openchannelPause','chatStatus','chatStatusTime'];(function(_0x8f8baa,_0x58d8cd){var _0x19fe59=function(_0x41328f){while(--_0x41328f){_0x8f8baa['push'](_0x8f8baa['shift']());}};_0x19fe59(++_0x58d8cd);}(_0x9bb6,0x13a));var _0x69bb=function(_0x4bf17a,_0x24d74c){_0x4bf17a=_0x4bf17a-0x0;var _0xe22657=_0x9bb6[_0x4bf17a];return _0xe22657;};'use strict';var _=require(_0x69bb('0x0'));var moment=require(_0x69bb('0x1'));var md5=require(_0x69bb('0x2'));var Redis=require(_0x69bb('0x3'));var config=require(_0x69bb('0x4'));config[_0x69bb('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x69bb('0x6'))(new Redis(config[_0x69bb('0x5')]));function Agent(_0x15555f){this['id']=_0x15555f['id']||0x0;this[_0x69bb('0x7')]=_0x15555f['name']||'';this[_0x69bb('0x8')]=_0x15555f[_0x69bb('0x8')]||!![];this['voicePause']=_0x15555f[_0x69bb('0x9')]||![];this[_0x69bb('0xa')]=_0x15555f[_0x69bb('0xa')]||![];this['mailPause']=_0x15555f[_0x69bb('0xb')]||![];this[_0x69bb('0xc')]=_0x15555f[_0x69bb('0xc')]||![];this[_0x69bb('0xd')]=_0x15555f['smsPause']||![];this['openchannelPause']=_0x15555f['openchannelPause']||![];this['chatStatus']=_0x69bb('0xe');this['chatStatusTime']=0x0;this[_0x69bb('0xf')]=_0x15555f['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x69bb('0x10')]='unknown';this['mailStatusTime']=0x0;this[_0x69bb('0x11')]=_0x15555f['mailCapacity']||0x0;this[_0x69bb('0x12')]=0x0;this[_0x69bb('0x13')]=_0x69bb('0xe');this['faxStatusTime']=0x0;this[_0x69bb('0x14')]=_0x15555f[_0x69bb('0x14')]||0x0;this[_0x69bb('0x15')]=0x0;this[_0x69bb('0x16')]=_0x69bb('0xe');this['smsStatusTime']=0x0;this[_0x69bb('0x17')]=_0x15555f[_0x69bb('0x17')]||0x0;this[_0x69bb('0x18')]=0x0;this[_0x69bb('0x19')]=_0x69bb('0xe');this['whatsappStatusTime']=0x0;this[_0x69bb('0x1a')]=_0x15555f[_0x69bb('0x1a')]||0x0;this[_0x69bb('0x1b')]=0x0;this['openchannelStatus']=_0x69bb('0xe');this[_0x69bb('0x1c')]=0x0;this[_0x69bb('0x1d')]=_0x15555f[_0x69bb('0x1d')]||0x0;this[_0x69bb('0x1e')]=0x0;this['busy']=![];this[_0x69bb('0x1f')]=undefined;this[_0x69bb('0x2')]='';this['chatWaitingInteractions']={};this[_0x69bb('0x20')]={};this[_0x69bb('0x21')]={};this[_0x69bb('0x22')]={};this[_0x69bb('0x23')]={};this[_0x69bb('0x24')]={};this[_0x69bb('0x25')]();}Agent['prototype'][_0x69bb('0x26')]=function(_0x1571b4){if(this[_0x1571b4+'CurrentCapacity']>0x0){if(this[_0x1571b4+'Capacity']>0x0&&this[_0x1571b4+'CurrentCapacity']>=this[_0x1571b4+_0x69bb('0x27')]){return'maxcapacity';}else{return _0x69bb('0x28');}}else{return _0x69bb('0x29');}};Agent['prototype']['updateRealtime']=function(){var _0x156aed=['mail',_0x69bb('0x2a'),_0x69bb('0x2b'),_0x69bb('0x2c'),_0x69bb('0x2d'),_0x69bb('0x2e')];for(var _0x402ec0=0x0;_0x402ec0<_0x156aed[_0x69bb('0x2f')];_0x402ec0+=0x1){var _0xb7fcb9=this['getChannelStatus'](_0x156aed[_0x402ec0]);if(this[_0x156aed[_0x402ec0]+_0x69bb('0x30')]!==_0xb7fcb9){this[_0x156aed[_0x402ec0]+'StatusTime']=_['toNumber'](moment()['format']('x'));}this[_0x156aed[_0x402ec0]+'Status']=_0xb7fcb9;}var _0x31ba73={'id':this['id'],'name':this[_0x69bb('0x7')],'online':this['online'],'voicePause':this[_0x69bb('0x9')],'chatPause':this[_0x69bb('0xa')],'mailPause':this[_0x69bb('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x69bb('0xc')],'openchannelPause':this[_0x69bb('0x31')],'chatStatus':this[_0x69bb('0x32')],'chatStatusTime':this[_0x69bb('0x33')],'chatCapacity':this[_0x69bb('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x69bb('0x10')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x69bb('0x11')],'mailCurrentCapacity':this[_0x69bb('0x12')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x69bb('0x34')],'faxCapacity':this[_0x69bb('0x14')],'faxCurrentCapacity':this[_0x69bb('0x15')],'smsStatus':this[_0x69bb('0x16')],'smsStatusTime':this[_0x69bb('0x35')],'smsCapacity':this[_0x69bb('0x17')],'smsCurrentCapacity':this[_0x69bb('0x18')],'whatsappStatus':this[_0x69bb('0x19')],'whatsappStatusTime':this[_0x69bb('0x36')],'whatsappCapacity':this[_0x69bb('0x1a')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x69bb('0x37')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x69bb('0x1d')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x69bb('0x38')],'busyQueue':this[_0x69bb('0x1f')],'chatWaitingInteractions':this[_0x69bb('0x39')],'faxWaitingInteractions':this[_0x69bb('0x20')],'mailWaitingInteractions':this[_0x69bb('0x21')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x69bb('0x23')],'whatsappWaitingInteractions':this[_0x69bb('0x24')]};var _0xec88cd=md5(JSON[_0x69bb('0x3a')](_0x31ba73));if(this['md5']!==_0xec88cd){this['md5']=_0xec88cd;io[_0x69bb('0x3b')]('user:save',_0x31ba73);}};module[_0x69bb('0x3c')]=Agent; \ No newline at end of file +var _0x36c7=['faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCurrentCapacity','busy','busyQueue','md5','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','updateRealtime','mail','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','voicePause','smsPause','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappStatusTime','openchannelCapacity','mailWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','ioredis','defaults','localhost','redis','name','online','chatPause','mailPause'];(function(_0x24127e,_0x689f53){var _0x12d2b8=function(_0x5c855f){while(--_0x5c855f){_0x24127e['push'](_0x24127e['shift']());}};_0x12d2b8(++_0x689f53);}(_0x36c7,0x194));var _0x736c=function(_0x2b02f7,_0x399b57){_0x2b02f7=_0x2b02f7-0x0;var _0x141c43=_0x36c7[_0x2b02f7];return _0x141c43;};'use strict';var _=require(_0x736c('0x0'));var moment=require(_0x736c('0x1'));var md5=require('md5');var Redis=require(_0x736c('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x736c('0x3')](config['redis'],{'host':_0x736c('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x736c('0x5')]));function Agent(_0xa58854){this['id']=_0xa58854['id']||0x0;this[_0x736c('0x6')]=_0xa58854[_0x736c('0x6')]||'';this[_0x736c('0x7')]=_0xa58854[_0x736c('0x7')]||!![];this['voicePause']=_0xa58854['voicePause']||![];this[_0x736c('0x8')]=_0xa58854[_0x736c('0x8')]||![];this[_0x736c('0x9')]=_0xa58854[_0x736c('0x9')]||![];this['faxPause']=_0xa58854[_0x736c('0xa')]||![];this['smsPause']=_0xa58854['smsPause']||![];this[_0x736c('0xb')]=_0xa58854[_0x736c('0xb')]||![];this[_0x736c('0xc')]=_0x736c('0xd');this[_0x736c('0xe')]=0x0;this[_0x736c('0xf')]=_0xa58854[_0x736c('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x736c('0x10')]=_0x736c('0xd');this[_0x736c('0x11')]=0x0;this[_0x736c('0x12')]=_0xa58854[_0x736c('0x12')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x736c('0x13')]=_0x736c('0xd');this[_0x736c('0x14')]=0x0;this[_0x736c('0x15')]=_0xa58854[_0x736c('0x15')]||0x0;this[_0x736c('0x16')]=0x0;this[_0x736c('0x17')]='unknown';this[_0x736c('0x18')]=0x0;this[_0x736c('0x19')]=_0xa58854['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x736c('0x1a')]='unknown';this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0xa58854[_0x736c('0x1b')]||0x0;this[_0x736c('0x1c')]=0x0;this[_0x736c('0x1d')]='unknown';this[_0x736c('0x1e')]=0x0;this['openchannelCapacity']=_0xa58854['openchannelCapacity']||0x0;this[_0x736c('0x1f')]=0x0;this[_0x736c('0x20')]=![];this[_0x736c('0x21')]=undefined;this[_0x736c('0x22')]='';this[_0x736c('0x23')]={};this[_0x736c('0x24')]={};this['mailWaitingInteractions']={};this[_0x736c('0x25')]={};this[_0x736c('0x26')]={};this[_0x736c('0x27')]={};this['updateRealtime']();}Agent[_0x736c('0x28')][_0x736c('0x29')]=function(_0x16e72b){if(this[_0x16e72b+_0x736c('0x2a')]>0x0){if(this[_0x16e72b+_0x736c('0x2b')]>0x0&&this[_0x16e72b+'CurrentCapacity']>=this[_0x16e72b+_0x736c('0x2b')]){return _0x736c('0x2c');}else{return'working';}}else{return _0x736c('0x2d');}};Agent['prototype'][_0x736c('0x2e')]=function(){var _0x28782d=[_0x736c('0x2f'),'chat',_0x736c('0x30'),_0x736c('0x31'),_0x736c('0x32'),_0x736c('0x33')];for(var _0x30c5b1=0x0;_0x30c5b1<_0x28782d[_0x736c('0x34')];_0x30c5b1+=0x1){var _0x8a317b=this[_0x736c('0x29')](_0x28782d[_0x30c5b1]);if(this[_0x28782d[_0x30c5b1]+_0x736c('0x35')]!==_0x8a317b){this[_0x28782d[_0x30c5b1]+_0x736c('0x36')]=_[_0x736c('0x37')](moment()[_0x736c('0x38')]('x'));}this[_0x28782d[_0x30c5b1]+_0x736c('0x35')]=_0x8a317b;}var _0x375489={'id':this['id'],'name':this[_0x736c('0x6')],'online':this['online'],'voicePause':this[_0x736c('0x39')],'chatPause':this[_0x736c('0x8')],'mailPause':this[_0x736c('0x9')],'smsPause':this[_0x736c('0x3a')],'faxPause':this['faxPause'],'openchannelPause':this[_0x736c('0xb')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x736c('0xe')],'chatCapacity':this[_0x736c('0xf')],'chatCurrentCapacity':this[_0x736c('0x3b')],'mailStatus':this[_0x736c('0x10')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x736c('0x12')],'mailCurrentCapacity':this[_0x736c('0x3c')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x736c('0x15')],'faxCurrentCapacity':this[_0x736c('0x16')],'smsStatus':this[_0x736c('0x17')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x736c('0x19')],'smsCurrentCapacity':this[_0x736c('0x3d')],'whatsappStatus':this[_0x736c('0x1a')],'whatsappStatusTime':this[_0x736c('0x3e')],'whatsappCapacity':this[_0x736c('0x1b')],'whatsappCurrentCapacity':this[_0x736c('0x1c')],'openchannelStatus':this[_0x736c('0x1d')],'openchannelStatusTime':this[_0x736c('0x1e')],'openchannelCapacity':this[_0x736c('0x3f')],'openchannelCurrentCapacity':this[_0x736c('0x1f')],'busy':this[_0x736c('0x20')],'busyQueue':this[_0x736c('0x21')],'chatWaitingInteractions':this[_0x736c('0x23')],'faxWaitingInteractions':this[_0x736c('0x24')],'mailWaitingInteractions':this[_0x736c('0x40')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x736c('0x26')],'whatsappWaitingInteractions':this[_0x736c('0x27')]};var _0x4435be=md5(JSON[_0x736c('0x41')](_0x375489));if(this[_0x736c('0x22')]!==_0x4435be){this[_0x736c('0x22')]=_0x4435be;io[_0x736c('0x42')](_0x736c('0x43'),_0x375489);}};module[_0x736c('0x44')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 478406d..f8d540b 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 _0x1158=['emit','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','map','_rr','loggedIn','paused','online','chatPause','available','format'];(function(_0x3e3f82,_0x535fa2){var _0x1e43fc=function(_0x4a52ec){while(--_0x4a52ec){_0x3e3f82['push'](_0x3e3f82['shift']());}};_0x1e43fc(++_0x535fa2);}(_0x1158,0x1b6));var _0x8115=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x1158[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var md5=require(_0x8115('0x0'));var util=require('util');var Redis=require(_0x8115('0x1'));var config=require(_0x8115('0x2'));config[_0x8115('0x3')]=_[_0x8115('0x4')](config[_0x8115('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x8115('0x5'))(new Redis(config[_0x8115('0x3')]));function ChatQueue(_0x279d27){this['id']=_0x279d27['id']||0x0;this[_0x8115('0x6')]=_0x279d27['name']||'';this[_0x8115('0x7')]=_0x279d27[_0x8115('0x7')]||0xa;this['strategy']=_0x279d27[_0x8115('0x8')]||_0x8115('0x9');this[_0x8115('0xa')]=_0x279d27[_0x8115('0xa')];this[_0x8115('0xb')]={};this['waiting']=0x0;this[_0x8115('0x0')]='';this['updateRouting']();this[_0x8115('0xc')]();}ChatQueue[_0x8115('0xd')]['updateRouting']=function(){var _0x7899a6=this[_0x8115('0xb')]['_rr'];this[_0x8115('0xb')]=_[_0x8115('0xe')](this['Agents'],'id');this[_0x8115('0xb')][_0x8115('0xf')]=_0x7899a6;};ChatQueue[_0x8115('0xd')]['updateRealtime']=function(){this[_0x8115('0x10')]=0x0;this[_0x8115('0x11')]=0x0;for(var _0x51ec7f=0x0;_0x51ec7f=0x0?this['available']:0x0;var _0x576c9b={'id':this['id'],'available':this[_0x8115('0x14')],'loggedIn':this[_0x8115('0x10')],'name':this[_0x8115('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x2a5c61=md5(JSON['stringify'](_0x576c9b));if(this[_0x8115('0x0')]!==_0x2a5c61){this[_0x8115('0x0')]=_0x2a5c61;io['to'](util[_0x8115('0x15')]('chat:queue:%s',_0x576c9b[_0x8115('0x6')]))[_0x8115('0x16')]('chat_queue:save',_0x576c9b);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xebdb=['timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name'];(function(_0x54aea3,_0xae7d81){var _0x21ae46=function(_0xe16dbc){while(--_0xe16dbc){_0x54aea3['push'](_0x54aea3['shift']());}};_0x21ae46(++_0xae7d81);}(_0xebdb,0xa6));var _0xbebd=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0xebdb[_0x37ae26];return _0x1b1902;};'use strict';var _=require(_0xbebd('0x0'));var md5=require(_0xbebd('0x1'));var util=require('util');var Redis=require(_0xbebd('0x2'));var config=require(_0xbebd('0x3'));config[_0xbebd('0x4')]=_[_0xbebd('0x5')](config[_0xbebd('0x4')],{'host':_0xbebd('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x3a5010){this['id']=_0x3a5010['id']||0x0;this[_0xbebd('0x7')]=_0x3a5010['name']||'';this['timeout']=_0x3a5010[_0xbebd('0x8')]||0xa;this['strategy']=_0x3a5010['strategy']||_0xbebd('0x9');this[_0xbebd('0xa')]=_0x3a5010['Agents'];this[_0xbebd('0xb')]={};this[_0xbebd('0xc')]=0x0;this[_0xbebd('0x1')]='';this[_0xbebd('0xd')]();this[_0xbebd('0xe')]();}ChatQueue[_0xbebd('0xf')][_0xbebd('0xd')]=function(){var _0x2621e1=this[_0xbebd('0xb')][_0xbebd('0x10')];this[_0xbebd('0xb')]=_[_0xbebd('0x11')](this[_0xbebd('0xa')],'id');this['mapAgentsId'][_0xbebd('0x10')]=_0x2621e1;};ChatQueue[_0xbebd('0xf')][_0xbebd('0xe')]=function(){this[_0xbebd('0x12')]=0x0;this[_0xbebd('0x13')]=0x0;for(var _0x52b7fc=0x0;_0x52b7fc=0x0?this[_0xbebd('0x17')]:0x0;var _0x432c17={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbebd('0x12')],'name':this['name'],'paused':this[_0xbebd('0x13')],'waiting':this[_0xbebd('0xc')]};var _0x1f1452=md5(JSON[_0xbebd('0x18')](_0x432c17));if(this[_0xbebd('0x1')]!==_0x1f1452){this['md5']=_0x1f1452;io['to'](util['format'](_0xbebd('0x19'),_0x432c17[_0xbebd('0x7')]))[_0xbebd('0x1a')](_0xbebd('0x1b'),_0x432c17);}};module[_0xbebd('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 82e5db4..b52a938 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 _0x31ce=['name','timeout','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x32b56b,_0x2ff149){var _0x856a25=function(_0x23991e){while(--_0x23991e){_0x32b56b['push'](_0x32b56b['shift']());}};_0x856a25(++_0x2ff149);}(_0x31ce,0x121));var _0xe31c=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x31ce[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0xe31c('0x0'));var md5=require(_0xe31c('0x1'));var util=require(_0xe31c('0x2'));var Redis=require(_0xe31c('0x3'));var config=require(_0xe31c('0x4'));config[_0xe31c('0x5')]=_['defaults'](config[_0xe31c('0x5')],{'host':_0xe31c('0x6'),'port':0x18eb});var io=require(_0xe31c('0x7'))(new Redis(config['redis']));function FaxQueue(_0x235432){this['id']=_0x235432['id']||0x0;this[_0xe31c('0x8')]=_0x235432[_0xe31c('0x8')]||'';this[_0xe31c('0x9')]=_0x235432[_0xe31c('0x9')]||0xa;this['strategy']=_0x235432['strategy']||_0xe31c('0xa');this['Agents']=_0x235432[_0xe31c('0xb')];this[_0xe31c('0xc')]={};this[_0xe31c('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xe31c('0xe')]();}FaxQueue[_0xe31c('0xf')][_0xe31c('0x10')]=function(){var _0x182339=this[_0xe31c('0xc')][_0xe31c('0x11')];this[_0xe31c('0xc')]=_['map'](this[_0xe31c('0xb')],'id');this[_0xe31c('0xc')][_0xe31c('0x11')]=_0x182339;};FaxQueue['prototype']['updateRealtime']=function(){this[_0xe31c('0x12')]=0x0;this[_0xe31c('0x13')]=0x0;for(var _0x5b383d=0x0;_0x5b383d=0x0?this[_0xe31c('0x15')]:0x0;var _0x36f3f6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe31c('0x12')],'name':this[_0xe31c('0x8')],'paused':this[_0xe31c('0x13')],'waiting':this[_0xe31c('0xd')]};var _0x1ed2f1=md5(JSON[_0xe31c('0x16')](_0x36f3f6));if(this[_0xe31c('0x1')]!==_0x1ed2f1){this[_0xe31c('0x1')]=_0x1ed2f1;io['to'](util['format'](_0xe31c('0x17'),_0x36f3f6['name']))[_0xe31c('0x18')](_0xe31c('0x19'),_0x36f3f6);}};module[_0xe31c('0x1a')]=FaxQueue; \ No newline at end of file +var _0x465c=['updateRealtime','loggedIn','paused','online','available','waiting','format','fax_queue:save','lodash','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','prototype','updateRouting','map','_rr'];(function(_0x238850,_0x521207){var _0x166f2f=function(_0x12a596){while(--_0x12a596){_0x238850['push'](_0x238850['shift']());}};_0x166f2f(++_0x521207);}(_0x465c,0xd7));var _0xc465=function(_0x5d95b2,_0x405c2e){_0x5d95b2=_0x5d95b2-0x0;var _0x234baf=_0x465c[_0x5d95b2];return _0x234baf;};'use strict';var _=require(_0xc465('0x0'));var md5=require(_0xc465('0x1'));var util=require(_0xc465('0x2'));var Redis=require('ioredis');var config=require(_0xc465('0x3'));config['redis']=_['defaults'](config[_0xc465('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xc465('0x5'))(new Redis(config[_0xc465('0x4')]));function FaxQueue(_0x282030){this['id']=_0x282030['id']||0x0;this['name']=_0x282030[_0xc465('0x6')]||'';this[_0xc465('0x7')]=_0x282030['timeout']||0xa;this['strategy']=_0x282030[_0xc465('0x8')]||'beepall';this['Agents']=_0x282030[_0xc465('0x9')];this[_0xc465('0xa')]={};this['waiting']=0x0;this[_0xc465('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xc465('0xb')][_0xc465('0xc')]=function(){var _0xfd2b2e=this[_0xc465('0xa')]['_rr'];this[_0xc465('0xa')]=_[_0xc465('0xd')](this[_0xc465('0x9')],'id');this[_0xc465('0xa')][_0xc465('0xe')]=_0xfd2b2e;};FaxQueue['prototype'][_0xc465('0xf')]=function(){this[_0xc465('0x10')]=0x0;this[_0xc465('0x11')]=0x0;for(var _0xd6e41b=0x0;_0xd6e41b=0x0?this[_0xc465('0x13')]:0x0;var _0x4ddaf6={'id':this['id'],'available':this[_0xc465('0x13')],'loggedIn':this[_0xc465('0x10')],'name':this[_0xc465('0x6')],'paused':this[_0xc465('0x11')],'waiting':this[_0xc465('0x14')]};var _0x344fd4=md5(JSON['stringify'](_0x4ddaf6));if(this[_0xc465('0x1')]!==_0x344fd4){this[_0xc465('0x1')]=_0x344fd4;io['to'](util[_0xc465('0x15')]('fax:queue:%s',_0x4ddaf6[_0xc465('0x6')]))['emit'](_0xc465('0x16'),_0x4ddaf6);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c0c824a..90b3b4f 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 _0x0456=['name','Intervals'];(function(_0x2eeceb,_0x164a66){var _0x5e6204=function(_0x1c973c){while(--_0x1c973c){_0x2eeceb['push'](_0x2eeceb['shift']());}};_0x5e6204(++_0x164a66);}(_0x0456,0x116));var _0x6045=function(_0x9ed71d,_0x20ff4f){_0x9ed71d=_0x9ed71d-0x0;var _0x56c83e=_0x0456[_0x9ed71d];return _0x56c83e;};'use strict';function Interval(_0x349e98){this['id']=_0x349e98['id']||0x0;this[_0x6045('0x0')]=_0x349e98[_0x6045('0x0')]||'';this[_0x6045('0x1')]=_0x349e98[_0x6045('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x68cb=['name','Intervals'];(function(_0x56ca01,_0x413d47){var _0x719266=function(_0x1560ac){while(--_0x1560ac){_0x56ca01['push'](_0x56ca01['shift']());}};_0x719266(++_0x413d47);}(_0x68cb,0x112));var _0xb68c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x68cb[_0x321bb2];return _0x9c12ed;};'use strict';function Interval(_0xfe71bc){this['id']=_0xfe71bc['id']||0x0;this['name']=_0xfe71bc[_0xb68c('0x0')]||'';this[_0xb68c('0x1')]=_0xfe71bc[_0xb68c('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 5ab7db5..2749c89 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 _0x64a0=['emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','mailPause','paused','available','stringify','format','mail:queue:%s'];(function(_0x535bfe,_0x2594fb){var _0x22df6c=function(_0x2385bc){while(--_0x2385bc){_0x535bfe['push'](_0x535bfe['shift']());}};_0x22df6c(++_0x2594fb);}(_0x64a0,0x103));var _0x064a=function(_0xf9b7a3,_0x2a66f4){_0xf9b7a3=_0xf9b7a3-0x0;var _0x25f0a2=_0x64a0[_0xf9b7a3];return _0x25f0a2;};'use strict';var _=require(_0x064a('0x0'));var md5=require(_0x064a('0x1'));var util=require(_0x064a('0x2'));var Redis=require(_0x064a('0x3'));var config=require('../../../config/environment');config[_0x064a('0x4')]=_[_0x064a('0x5')](config[_0x064a('0x4')],{'host':_0x064a('0x6'),'port':0x18eb});var io=require(_0x064a('0x7'))(new Redis(config['redis']));function MailQueue(_0x188a15){this['id']=_0x188a15['id']||0x0;this[_0x064a('0x8')]=_0x188a15[_0x064a('0x8')]||'';this[_0x064a('0x9')]=_0x188a15[_0x064a('0x9')]||0xa;this[_0x064a('0xa')]=_0x188a15[_0x064a('0xa')]||_0x064a('0xb');this['Agents']=_0x188a15[_0x064a('0xc')];this['mapAgentsId']={};this[_0x064a('0xd')]=0x0;this[_0x064a('0x1')]='';this[_0x064a('0xe')]();this[_0x064a('0xf')]();}MailQueue[_0x064a('0x10')][_0x064a('0xe')]=function(){var _0x5ef994=this[_0x064a('0x11')][_0x064a('0x12')];this['mapAgentsId']=_[_0x064a('0x13')](this['Agents'],'id');this[_0x064a('0x11')][_0x064a('0x12')]=_0x5ef994;};MailQueue['prototype'][_0x064a('0xf')]=function(){this[_0x064a('0x14')]=0x0;this['paused']=0x0;for(var _0xd5dd64=0x0;_0xd5dd64=0x0?this['available']:0x0;var _0xaaad9d={'id':this['id'],'available':this[_0x064a('0x19')],'loggedIn':this[_0x064a('0x14')],'name':this[_0x064a('0x8')],'paused':this[_0x064a('0x18')],'waiting':this['waiting']};var _0x3b8b6e=md5(JSON[_0x064a('0x1a')](_0xaaad9d));if(this[_0x064a('0x1')]!==_0x3b8b6e){this['md5']=_0x3b8b6e;io['to'](util[_0x064a('0x1b')](_0x064a('0x1c'),_0xaaad9d['name']))[_0x064a('0x1d')](_0x064a('0x1e'),_0xaaad9d);}};module[_0x064a('0x1f')]=MailQueue; \ No newline at end of file +var _0x61db=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','online','mailPause','paused','available','waiting','mail:queue:%s','emit','mail_queue:save'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x61db,0xaf));var _0xb61d=function(_0x25dc1c,_0x5e66b8){_0x25dc1c=_0x25dc1c-0x0;var _0x2fee52=_0x61db[_0x25dc1c];return _0x2fee52;};'use strict';var _=require(_0xb61d('0x0'));var md5=require(_0xb61d('0x1'));var util=require(_0xb61d('0x2'));var Redis=require(_0xb61d('0x3'));var config=require(_0xb61d('0x4'));config[_0xb61d('0x5')]=_[_0xb61d('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb61d('0x7'))(new Redis(config[_0xb61d('0x5')]));function MailQueue(_0x3b2e54){this['id']=_0x3b2e54['id']||0x0;this[_0xb61d('0x8')]=_0x3b2e54['name']||'';this['timeout']=_0x3b2e54[_0xb61d('0x9')]||0xa;this[_0xb61d('0xa')]=_0x3b2e54[_0xb61d('0xa')]||_0xb61d('0xb');this[_0xb61d('0xc')]=_0x3b2e54[_0xb61d('0xc')];this[_0xb61d('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xb61d('0xe')]();this[_0xb61d('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x4aa0fa=this['mapAgentsId'][_0xb61d('0x10')];this['mapAgentsId']=_[_0xb61d('0x11')](this['Agents'],'id');this[_0xb61d('0xd')]['_rr']=_0x4aa0fa;};MailQueue[_0xb61d('0x12')]['updateRealtime']=function(){this[_0xb61d('0x13')]=0x0;this['paused']=0x0;for(var _0x5ad317=0x0;_0x5ad317=0x0?this[_0xb61d('0x17')]:0x0;var _0x5ba95d={'id':this['id'],'available':this[_0xb61d('0x17')],'loggedIn':this[_0xb61d('0x13')],'name':this[_0xb61d('0x8')],'paused':this['paused'],'waiting':this[_0xb61d('0x18')]};var _0x4c55ac=md5(JSON['stringify'](_0x5ba95d));if(this[_0xb61d('0x1')]!==_0x4c55ac){this[_0xb61d('0x1')]=_0x4c55ac;io['to'](util['format'](_0xb61d('0x19'),_0x5ba95d[_0xb61d('0x8')]))[_0xb61d('0x1a')](_0xb61d('0x1b'),_0x5ba95d);}};module[_0xb61d('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 15cd177..35990b4 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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x1261,0x144));var _0x1126=function(_0x29b2a2,_0x4b7224){_0x29b2a2=_0x29b2a2-0x0;var _0x836e8c=_0x1261[_0x29b2a2];return _0x836e8c;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x326f,0xd1));var _0xf326=function(_0x48dfe3,_0x502dde){_0x48dfe3=_0x48dfe3-0x0;var _0x25d516=_0x326f[_0x48dfe3];return _0x25d516;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 6c432f9..c502cdf 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 _0x0a9a=['length','online','smsPause','paused','available','waiting','stringify','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','loggedIn'];(function(_0x44aa7a,_0x52d204){var _0x4ac51e=function(_0x45d661){while(--_0x45d661){_0x44aa7a['push'](_0x44aa7a['shift']());}};_0x4ac51e(++_0x52d204);}(_0x0a9a,0x183));var _0xa0a9=function(_0x2faee6,_0x3fd854){_0x2faee6=_0x2faee6-0x0;var _0x1a7e23=_0x0a9a[_0x2faee6];return _0x1a7e23;};'use strict';var _=require('lodash');var md5=require(_0xa0a9('0x0'));var util=require('util');var Redis=require(_0xa0a9('0x1'));var config=require(_0xa0a9('0x2'));config[_0xa0a9('0x3')]=_[_0xa0a9('0x4')](config['redis'],{'host':_0xa0a9('0x5'),'port':0x18eb});var io=require(_0xa0a9('0x6'))(new Redis(config['redis']));function SmsQueue(_0x425c3c){this['id']=_0x425c3c['id']||0x0;this[_0xa0a9('0x7')]=_0x425c3c[_0xa0a9('0x7')]||'';this[_0xa0a9('0x8')]=_0x425c3c['timeout']||0xa;this[_0xa0a9('0x9')]=_0x425c3c['strategy']||_0xa0a9('0xa');this[_0xa0a9('0xb')]=_0x425c3c[_0xa0a9('0xb')];this[_0xa0a9('0xc')]={};this['waiting']=0x0;this[_0xa0a9('0x0')]='';this[_0xa0a9('0xd')]();this['updateRealtime']();}SmsQueue['prototype'][_0xa0a9('0xd')]=function(){var _0x33f54f=this['mapAgentsId'][_0xa0a9('0xe')];this['mapAgentsId']=_[_0xa0a9('0xf')](this['Agents'],'id');this[_0xa0a9('0xc')][_0xa0a9('0xe')]=_0x33f54f;};SmsQueue[_0xa0a9('0x10')][_0xa0a9('0x11')]=function(){this[_0xa0a9('0x12')]=0x0;this['paused']=0x0;for(var _0x1f3f23=0x0;_0x1f3f23=0x0?this['available']:0x0;var _0x320735={'id':this['id'],'available':this[_0xa0a9('0x17')],'loggedIn':this[_0xa0a9('0x12')],'name':this[_0xa0a9('0x7')],'paused':this[_0xa0a9('0x16')],'waiting':this[_0xa0a9('0x18')]};var _0x5c82ed=md5(JSON[_0xa0a9('0x19')](_0x320735));if(this[_0xa0a9('0x0')]!==_0x5c82ed){this['md5']=_0x5c82ed;io['to'](util['format'](_0xa0a9('0x1a'),_0x320735[_0xa0a9('0x7')]))[_0xa0a9('0x1b')]('sms_queue:save',_0x320735);}};module[_0xa0a9('0x1c')]=SmsQueue; \ No newline at end of file +var _0xca8d=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x3a28df,_0x186024){var _0x7414ac=function(_0x35ed81){while(--_0x35ed81){_0x3a28df['push'](_0x3a28df['shift']());}};_0x7414ac(++_0x186024);}(_0xca8d,0x172));var _0xdca8=function(_0x26ef45,_0xe8ca61){_0x26ef45=_0x26ef45-0x0;var _0x45d365=_0xca8d[_0x26ef45];return _0x45d365;};'use strict';var _=require(_0xdca8('0x0'));var md5=require(_0xdca8('0x1'));var util=require(_0xdca8('0x2'));var Redis=require(_0xdca8('0x3'));var config=require(_0xdca8('0x4'));config[_0xdca8('0x5')]=_[_0xdca8('0x6')](config[_0xdca8('0x5')],{'host':_0xdca8('0x7'),'port':0x18eb});var io=require(_0xdca8('0x8'))(new Redis(config[_0xdca8('0x5')]));function SmsQueue(_0x32e549){this['id']=_0x32e549['id']||0x0;this['name']=_0x32e549[_0xdca8('0x9')]||'';this[_0xdca8('0xa')]=_0x32e549[_0xdca8('0xa')]||0xa;this[_0xdca8('0xb')]=_0x32e549[_0xdca8('0xb')]||'beepall';this[_0xdca8('0xc')]=_0x32e549[_0xdca8('0xc')];this[_0xdca8('0xd')]={};this['waiting']=0x0;this[_0xdca8('0x1')]='';this[_0xdca8('0xe')]();this[_0xdca8('0xf')]();}SmsQueue[_0xdca8('0x10')][_0xdca8('0xe')]=function(){var _0x349f88=this[_0xdca8('0xd')][_0xdca8('0x11')];this[_0xdca8('0xd')]=_['map'](this['Agents'],'id');this[_0xdca8('0xd')][_0xdca8('0x11')]=_0x349f88;};SmsQueue[_0xdca8('0x10')][_0xdca8('0xf')]=function(){this[_0xdca8('0x12')]=0x0;this[_0xdca8('0x13')]=0x0;for(var _0x3ea305=0x0;_0x3ea305=0x0?this[_0xdca8('0x17')]:0x0;var _0x490650={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdca8('0x12')],'name':this[_0xdca8('0x9')],'paused':this[_0xdca8('0x13')],'waiting':this[_0xdca8('0x18')]};var _0x4ffe19=md5(JSON[_0xdca8('0x19')](_0x490650));if(this[_0xdca8('0x1')]!==_0x4ffe19){this['md5']=_0x4ffe19;io['to'](util[_0xdca8('0x1a')](_0xdca8('0x1b'),_0x490650[_0xdca8('0x9')]))['emit']('sms_queue:save',_0x490650);}};module[_0xdca8('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 2d80285..85cfeae 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 _0x1fa2=['whatsappPause','available','stringify','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','prototype','loggedIn','paused','online'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x1fa2,0x19b));var _0x21fa=function(_0x59a3aa,_0x155b2b){_0x59a3aa=_0x59a3aa-0x0;var _0x3f64f9=_0x1fa2[_0x59a3aa];return _0x3f64f9;};'use strict';var _=require(_0x21fa('0x0'));var md5=require(_0x21fa('0x1'));var util=require('util');var Redis=require(_0x21fa('0x2'));var config=require(_0x21fa('0x3'));config[_0x21fa('0x4')]=_[_0x21fa('0x5')](config[_0x21fa('0x4')],{'host':_0x21fa('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21fa('0x4')]));function WhatsappQueue(_0x51e440){this['id']=_0x51e440['id']||0x0;this['name']=_0x51e440[_0x21fa('0x7')]||'';this[_0x21fa('0x8')]=_0x51e440['timeout']||0xa;this[_0x21fa('0x9')]=_0x51e440[_0x21fa('0x9')]||_0x21fa('0xa');this[_0x21fa('0xb')]=_0x51e440[_0x21fa('0xb')];this[_0x21fa('0xc')]={};this[_0x21fa('0xd')]=0x0;this[_0x21fa('0x1')]='';this['updateRouting']();this[_0x21fa('0xe')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x30bace=this[_0x21fa('0xc')][_0x21fa('0xf')];this[_0x21fa('0xc')]=_[_0x21fa('0x10')](this[_0x21fa('0xb')],'id');this[_0x21fa('0xc')]['_rr']=_0x30bace;};WhatsappQueue[_0x21fa('0x11')][_0x21fa('0xe')]=function(){this[_0x21fa('0x12')]=0x0;this[_0x21fa('0x13')]=0x0;for(var _0x39de29=0x0;_0x39de29=0x0?this[_0x21fa('0x16')]:0x0;var _0x423f94={'id':this['id'],'available':this[_0x21fa('0x16')],'loggedIn':this[_0x21fa('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x21fa('0xd')]};var _0x411eb0=md5(JSON[_0x21fa('0x17')](_0x423f94));if(this[_0x21fa('0x1')]!==_0x411eb0){this[_0x21fa('0x1')]=_0x411eb0;io['to'](util['format']('whatsapp:queue:%s',_0x423f94[_0x21fa('0x7')]))[_0x21fa('0x18')](_0x21fa('0x19'),_0x423f94);}};module[_0x21fa('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x0917=['exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','online','loggedIn','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x0917,0x1c3));var _0x7091=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0x0917[_0x4cd846];return _0x2f2a7d;};'use strict';var _=require(_0x7091('0x0'));var md5=require(_0x7091('0x1'));var util=require(_0x7091('0x2'));var Redis=require(_0x7091('0x3'));var config=require(_0x7091('0x4'));config['redis']=_[_0x7091('0x5')](config[_0x7091('0x6')],{'host':_0x7091('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7091('0x6')]));function WhatsappQueue(_0x388bab){this['id']=_0x388bab['id']||0x0;this[_0x7091('0x8')]=_0x388bab['name']||'';this[_0x7091('0x9')]=_0x388bab[_0x7091('0x9')]||0xa;this[_0x7091('0xa')]=_0x388bab[_0x7091('0xa')]||_0x7091('0xb');this[_0x7091('0xc')]=_0x388bab[_0x7091('0xc')];this['mapAgentsId']={};this[_0x7091('0xd')]=0x0;this['md5']='';this[_0x7091('0xe')]();this[_0x7091('0xf')]();}WhatsappQueue[_0x7091('0x10')][_0x7091('0xe')]=function(){var _0x5997b5=this[_0x7091('0x11')]['_rr'];this['mapAgentsId']=_[_0x7091('0x12')](this[_0x7091('0xc')],'id');this[_0x7091('0x11')][_0x7091('0x13')]=_0x5997b5;};WhatsappQueue['prototype'][_0x7091('0xf')]=function(){this['loggedIn']=0x0;this[_0x7091('0x14')]=0x0;for(var _0xc4c2bf=0x0;_0xc4c2bf=0x0?this[_0x7091('0x17')]:0x0;var _0x37bab9={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7091('0x16')],'name':this[_0x7091('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x38a0ba=md5(JSON[_0x7091('0x18')](_0x37bab9));if(this[_0x7091('0x1')]!==_0x38a0ba){this[_0x7091('0x1')]=_0x38a0ba;io['to'](util[_0x7091('0x19')](_0x7091('0x1a'),_0x37bab9[_0x7091('0x8')]))[_0x7091('0x1b')](_0x7091('0x1c'),_0x37bab9);}};module[_0x7091('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 0ec65d6..898a4e2 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(_0x5ce8c7,_0x9afbfa){var _0x41dffd=function(_0x1a5cb8){while(--_0x1a5cb8){_0x5ce8c7['push'](_0x5ce8c7['shift']());}};_0x41dffd(++_0x9afbfa);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c0baa,_0x2e110f){_0x4c0baa=_0x4c0baa-0x0;var _0x4bf459=_0xb10b[_0x4c0baa];return _0x4bf459;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 8cce9b5..6ee8d93 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 _0x9b9b=['update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x9b9b,0xb5));var _0xb9b9=function(_0x34ced0,_0x21907f){_0x34ced0=_0x34ced0-0x0;var _0x3db58d=_0x9b9b[_0x34ced0];return _0x3db58d;};'use strict';var client=require(_0xb9b9('0x0'));exports[_0xb9b9('0x1')]=function(_0x2af584,_0x5e64de){return client[_0xb9b9('0x2')]('UpdateChatInteraction',{'body':_0x5e64de,'options':{'where':{'id':_0x2af584}},'log':_0xb9b9('0x3')});};exports[_0xb9b9('0x4')]=function(_0x3ece9c,_0x5d3e4f){return client['Request'](_0xb9b9('0x5'),{'body':_0x5d3e4f,'options':{'where':{'id':_0x3ece9c}},'log':_0xb9b9('0x6')});}; \ No newline at end of file +var _0x9e1c=['addTags','AddTagsToChatInteraction','../client','Request'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9e1c,0x1f2));var _0xc9e1=function(_0x1df7b9,_0x3c28be){_0x1df7b9=_0x1df7b9-0x0;var _0x3f92a0=_0x9e1c[_0x1df7b9];return _0x3f92a0;};'use strict';var client=require(_0xc9e1('0x0'));exports['update']=function(_0x4799cc,_0x28ac4c){return client[_0xc9e1('0x1')]('UpdateChatInteraction',{'body':_0x28ac4c,'options':{'where':{'id':_0x4799cc}},'log':'updateChatInteraction'});};exports[_0xc9e1('0x2')]=function(_0x3ea24e,_0x31d1bc){return client[_0xc9e1('0x1')](_0xc9e1('0x3'),{'body':_0x31d1bc,'options':{'where':{'id':_0x3ea24e}},'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 9ddb114..710c8fc 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 _0x522c=['../client','Request','CreateChatMessage','createChatMessage'];(function(_0x451989,_0x299f13){var _0x211314=function(_0x4af3b5){while(--_0x4af3b5){_0x451989['push'](_0x451989['shift']());}};_0x211314(++_0x299f13);}(_0x522c,0x1dc));var _0xc522=function(_0x52f912,_0x5eb81f){_0x52f912=_0x52f912-0x0;var _0x1ca423=_0x522c[_0x52f912];return _0x1ca423;};'use strict';var client=require(_0xc522('0x0'));exports['create']=function(_0x1539a5){return client[_0xc522('0x1')](_0xc522('0x2'),{'body':_0x1539a5,'log':_0xc522('0x3')});}; \ No newline at end of file +var _0x4e29=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x4e29,0x150));var _0x94e2=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x4e29[_0x4715d2];return _0x141811;};'use strict';var client=require(_0x94e2('0x0'));exports[_0x94e2('0x1')]=function(_0x18fd8f){return client[_0x94e2('0x2')](_0x94e2('0x3'),{'body':_0x18fd8f,'log':_0x94e2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 1bf2811..e2dab90 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 _0x5178=['GetChatQueue','name','timeout','Agents','chatPause','getChatQueues','Request'];(function(_0x54abe0,_0x171919){var _0x403d6b=function(_0x19fc51){while(--_0x19fc51){_0x54abe0['push'](_0x54abe0['shift']());}};_0x403d6b(++_0x171919);}(_0x5178,0x171));var _0x8517=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5178[_0x5ddb1c];return _0x354adc;};'use strict';var client=require('../client');exports[_0x8517('0x0')]=function(){return function(){return client[_0x8517('0x1')](_0x8517('0x2'),{'options':{'raw':![],'attributes':['id',_0x8517('0x3'),_0x8517('0x4'),'strategy'],'include':[{'model':'User','as':_0x8517('0x5'),'attributes':['id',_0x8517('0x3'),'online',_0x8517('0x6')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x5447=['getChatQueues','../client','Request','GetChatQueue','timeout','User','Agents','name','online','chatPause'];(function(_0x1858d8,_0x12ee8a){var _0x2f0227=function(_0xf1c2e7){while(--_0xf1c2e7){_0x1858d8['push'](_0x1858d8['shift']());}};_0x2f0227(++_0x12ee8a);}(_0x5447,0xf1));var _0x7544=function(_0x47e078,_0xb59c5d){_0x47e078=_0x47e078-0x0;var _0x5ecc71=_0x5447[_0x47e078];return _0x5ecc71;};'use strict';var client=require(_0x7544('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x7544('0x1')](_0x7544('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7544('0x3'),'strategy'],'include':[{'model':_0x7544('0x4'),'as':_0x7544('0x5'),'attributes':['id',_0x7544('0x6'),_0x7544('0x7'),_0x7544('0x8')]}]},'log':_0x7544('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 301b540..47910f1 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 _0x72b1=['../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x1b77ff,_0x10c351){var _0x7fc697=function(_0x1208b2){while(--_0x1208b2){_0x1b77ff['push'](_0x1b77ff['shift']());}};_0x7fc697(++_0x10c351);}(_0x72b1,0x16e));var _0x172b=function(_0x90187f,_0x15d090){_0x90187f=_0x90187f-0x0;var _0x10eef5=_0x72b1[_0x90187f];return _0x10eef5;};'use strict';var client=require(_0x172b('0x0'));exports['create']=function(_0x368075){return client[_0x172b('0x1')](_0x172b('0x2'),{'body':_0x368075,'log':_0x172b('0x2')});};exports[_0x172b('0x3')]=function(_0x3fa10d,_0x2c1d6e){return client['Request'](_0x172b('0x4'),{'body':_0x2c1d6e,'options':{'where':{'uniqueid':_0x3fa10d},'order':[['id',_0x172b('0x5')]],'limit':0x1},'log':_0x172b('0x4')});}; \ No newline at end of file +var _0xf452=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x481525,_0x3c9229){var _0x1dd0c0=function(_0x216ad5){while(--_0x216ad5){_0x481525['push'](_0x481525['shift']());}};_0x1dd0c0(++_0x3c9229);}(_0xf452,0x13b));var _0x2f45=function(_0x18ff55,_0x3eb10f){_0x18ff55=_0x18ff55-0x0;var _0x134643=_0xf452[_0x18ff55];return _0x134643;};'use strict';var client=require(_0x2f45('0x0'));exports[_0x2f45('0x1')]=function(_0x55d48e){return client[_0x2f45('0x2')](_0x2f45('0x3'),{'body':_0x55d48e,'log':_0x2f45('0x3')});};exports[_0x2f45('0x4')]=function(_0x602b00,_0x3f0b30){return client[_0x2f45('0x2')](_0x2f45('0x5'),{'body':_0x3f0b30,'options':{'where':{'uniqueid':_0x602b00},'order':[['id',_0x2f45('0x6')]],'limit':0x1},'log':_0x2f45('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 140f1b1..3179bdb 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(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x7a54,0x106));var _0x47a5=function(_0xf2e16a,_0x4087ce){_0xf2e16a=_0xf2e16a-0x0;var _0x553bb6=_0x7a54[_0xf2e16a];return _0x553bb6;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x7a54,0x106));var _0x47a5=function(_0x11e699,_0x4af31f){_0x11e699=_0x11e699-0x0;var _0x5d276d=_0x7a54[_0x11e699];return _0x5d276d;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index b97f1c8..1b8f44b 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 _0xb113=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x1acf4b,_0x5a750c){var _0x4eca09=function(_0xedef3a){while(--_0xedef3a){_0x1acf4b['push'](_0x1acf4b['shift']());}};_0x4eca09(++_0x5a750c);}(_0xb113,0x86));var _0x3b11=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0xb113[_0x4f08dd];return _0x3017ee;};'use strict';var client=require(_0x3b11('0x0'));exports[_0x3b11('0x1')]=function(_0x5929a2){return client[_0x3b11('0x2')](_0x3b11('0x3'),{'body':_0x5929a2,'log':_0x3b11('0x4')});}; \ No newline at end of file +var _0x695a=['Request','CreateFaxMessage','createFaxMessage'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0x695a,0x180));var _0xa695=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x695a[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports['create']=function(_0x57ff41){return client[_0xa695('0x0')](_0xa695('0x1'),{'body':_0x57ff41,'log':_0xa695('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 2f4c394..c3939ca 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 _0x9f50=['../client','Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause'];(function(_0x39da8a,_0x194dc9){var _0x1f234b=function(_0x24ec3e){while(--_0x24ec3e){_0x39da8a['push'](_0x39da8a['shift']());}};_0x1f234b(++_0x194dc9);}(_0x9f50,0x129));var _0x09f5=function(_0x1ec836,_0x1ce2d6){_0x1ec836=_0x1ec836-0x0;var _0x4baf71=_0x9f50[_0x1ec836];return _0x4baf71;};'use strict';var client=require(_0x09f5('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x09f5('0x1')](_0x09f5('0x2'),{'options':{'raw':![],'attributes':['id',_0x09f5('0x3'),'timeout',_0x09f5('0x4')],'include':[{'model':_0x09f5('0x5'),'as':_0x09f5('0x6'),'attributes':['id',_0x09f5('0x3'),_0x09f5('0x7'),_0x09f5('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xef81=['../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','Agents'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xef81,0x188));var _0x1ef8=function(_0x2e3e61,_0x4b9941){_0x2e3e61=_0x2e3e61-0x0;var _0x466cae=_0xef81[_0x2e3e61];return _0x466cae;};'use strict';var client=require(_0x1ef8('0x0'));exports[_0x1ef8('0x1')]=function(){return function(){return client[_0x1ef8('0x2')](_0x1ef8('0x3'),{'options':{'raw':![],'attributes':['id',_0x1ef8('0x4'),_0x1ef8('0x5'),_0x1ef8('0x6')],'include':[{'model':'User','as':_0x1ef8('0x7'),'attributes':['id',_0x1ef8('0x4'),'online','faxPause']}]},'log':_0x1ef8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index a32f521..580e7b1 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 _0x8d30=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x8d30,0x128));var _0x08d3=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x8d30[_0x330723];return _0x60c546;};'use strict';var client=require(_0x08d3('0x0'));exports[_0x08d3('0x1')]=function(_0x347308){return client[_0x08d3('0x2')](_0x08d3('0x3'),{'body':_0x347308,'log':_0x08d3('0x3')});};exports[_0x08d3('0x4')]=function(_0x34a2ee,_0xd7f600){return client[_0x08d3('0x2')](_0x08d3('0x5'),{'body':_0xd7f600,'options':{'where':{'uniqueid':_0x34a2ee},'order':[['id',_0x08d3('0x6')]],'limit':0x1},'log':_0x08d3('0x5')});}; \ No newline at end of file +var _0xc70c=['Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x138293,_0x197e7f){var _0x34c4a2=function(_0x20192b){while(--_0x20192b){_0x138293['push'](_0x138293['shift']());}};_0x34c4a2(++_0x197e7f);}(_0xc70c,0xa6));var _0xcc70=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc70c[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xcc70('0x0'));exports[_0xcc70('0x1')]=function(_0x463727){return client[_0xcc70('0x2')](_0xcc70('0x3'),{'body':_0x463727,'log':'CreateFaxQueueReport'});};exports[_0xcc70('0x4')]=function(_0x5342e1,_0x77ff1d){return client[_0xcc70('0x2')]('UpdateFaxQueueReport',{'body':_0x77ff1d,'options':{'where':{'uniqueid':_0x5342e1},'order':[['id',_0xcc70('0x5')]],'limit':0x1},'log':_0xcc70('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 081f00b..2a415b5 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 _0x5be8=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5be8,0x196));var _0x85be=function(_0x58554a,_0x52a04b){_0x58554a=_0x58554a-0x0;var _0x563946=_0x5be8[_0x58554a];return _0x563946;};'use strict';var client=require('../client');exports[_0x85be('0x0')]=function(){return function(){return client[_0x85be('0x1')](_0x85be('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x85be('0x3')],'include':[{'model':_0x85be('0x4'),'as':_0x85be('0x5'),'attributes':['id','name',_0x85be('0x6')]}]},'log':_0x85be('0x0')});};}; \ No newline at end of file +var _0xeef6=['Intervals','name','interval','../client','getIntervals','Interval'];(function(_0x32c95,_0x3c5580){var _0x5065ae=function(_0x151a25){while(--_0x151a25){_0x32c95['push'](_0x32c95['shift']());}};_0x5065ae(++_0x3c5580);}(_0xeef6,0x19b));var _0x6eef=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeef6[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0x6eef('0x0'));exports[_0x6eef('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x6eef('0x2'),'as':_0x6eef('0x3'),'attributes':['id',_0x6eef('0x4'),_0x6eef('0x5')]}]},'log':_0x6eef('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 4d34c1e..df66bef 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 _0x36ee=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction'];(function(_0x41c737,_0x104568){var _0x1902cb=function(_0x88ab59){while(--_0x88ab59){_0x41c737['push'](_0x41c737['shift']());}};_0x1902cb(++_0x104568);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var client=require('../client');exports['update']=function(_0x34e33c,_0x521ff3){return client[_0xe36e('0x0')](_0xe36e('0x1'),{'body':_0x521ff3,'options':{'where':{'id':_0x34e33c}},'log':_0xe36e('0x2')});};exports[_0xe36e('0x3')]=function(_0x567a84,_0x1118af){return client[_0xe36e('0x0')](_0xe36e('0x4'),{'body':_0x1118af,'options':{'where':{'id':_0x567a84}},'log':_0xe36e('0x5')});}; \ No newline at end of file +var _0x28f2=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xfafb2b,_0x176236){var _0x30aafd=function(_0x78dfa6){while(--_0x78dfa6){_0xfafb2b['push'](_0xfafb2b['shift']());}};_0x30aafd(++_0x176236);}(_0x28f2,0x193));var _0x228f=function(_0x17749b,_0x4b4e3e){_0x17749b=_0x17749b-0x0;var _0x37ad41=_0x28f2[_0x17749b];return _0x37ad41;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(_0x108337,_0x2e5e0b){return client[_0x228f('0x2')]('UpdateMailInteraction',{'body':_0x2e5e0b,'options':{'where':{'id':_0x108337}},'log':_0x228f('0x3')});};exports[_0x228f('0x4')]=function(_0x79ed5f,_0x4303c3){return client[_0x228f('0x2')](_0x228f('0x5'),{'body':_0x4303c3,'options':{'where':{'id':_0x79ed5f}},'log':_0x228f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c423709..76ef835 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 _0x0176=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x35ccac,_0x28d874){var _0x217b96=function(_0x28f932){while(--_0x28f932){_0x35ccac['push'](_0x35ccac['shift']());}};_0x217b96(++_0x28d874);}(_0x0176,0x1d0));var _0x6017=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0176[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x6017('0x0'));exports[_0x6017('0x1')]=function(_0x38c6fb){return client[_0x6017('0x2')](_0x6017('0x3'),{'body':_0x38c6fb,'log':_0x6017('0x4')});}; \ No newline at end of file +var _0x7cb3=['Request','../client','create'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0x7cb3,0x1ed));var _0x37cb=function(_0x1bd492,_0x21d7d5){_0x1bd492=_0x1bd492-0x0;var _0x19c0d2=_0x7cb3[_0x1bd492];return _0x19c0d2;};'use strict';var client=require(_0x37cb('0x0'));exports[_0x37cb('0x1')]=function(_0x213b3b){return client[_0x37cb('0x2')]('CreateMailMessage',{'body':_0x213b3b,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 5d12434..6c615ec 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 _0x9d30=['getMailQueues','Request','GetMailQueue','timeout','User','online','mailPause','../client'];(function(_0x3e2f2c,_0x3cdf76){var _0x12dbd5=function(_0x360087){while(--_0x360087){_0x3e2f2c['push'](_0x3e2f2c['shift']());}};_0x12dbd5(++_0x3cdf76);}(_0x9d30,0x157));var _0x09d3=function(_0x400d62,_0x582cfe){_0x400d62=_0x400d62-0x0;var _0x2462e7=_0x9d30[_0x400d62];return _0x2462e7;};'use strict';var client=require(_0x09d3('0x0'));exports[_0x09d3('0x1')]=function(){return function(){return client[_0x09d3('0x2')](_0x09d3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x09d3('0x4'),'strategy'],'include':[{'model':_0x09d3('0x5'),'as':'Agents','attributes':['id','name',_0x09d3('0x6'),_0x09d3('0x7')]}]},'log':_0x09d3('0x1')});};}; \ No newline at end of file +var _0x8407=['../client','getMailQueues','Request','GetMailQueue','timeout','strategy','User','Agents','online'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8407,0x105));var _0x7840=function(_0xc931e,_0x51f200){_0xc931e=_0xc931e-0x0;var _0x56adfb=_0x8407[_0xc931e];return _0x56adfb;};'use strict';var client=require(_0x7840('0x0'));exports[_0x7840('0x1')]=function(){return function(){return client[_0x7840('0x2')](_0x7840('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7840('0x4'),_0x7840('0x5')],'include':[{'model':_0x7840('0x6'),'as':_0x7840('0x7'),'attributes':['id','name',_0x7840('0x8'),'mailPause']}]},'log':_0x7840('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index bab73fa..5341b60 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 _0x5d0e=['create','Request','update','UpdateMailQueueReport'];(function(_0xf85978,_0x52a3a4){var _0x27376e=function(_0x3ce753){while(--_0x3ce753){_0xf85978['push'](_0xf85978['shift']());}};_0x27376e(++_0x52a3a4);}(_0x5d0e,0xac));var _0xe5d0=function(_0x64b5ec,_0xa1d0cd){_0x64b5ec=_0x64b5ec-0x0;var _0x368213=_0x5d0e[_0x64b5ec];return _0x368213;};'use strict';var client=require('../client');exports[_0xe5d0('0x0')]=function(_0x35cd44){return client[_0xe5d0('0x1')]('CreateMailQueueReport',{'body':_0x35cd44,'log':'CreateMailQueueReport'});};exports[_0xe5d0('0x2')]=function(_0x40301e,_0x11f619){return client['Request'](_0xe5d0('0x3'),{'body':_0x11f619,'options':{'where':{'uniqueid':_0x40301e},'order':[['id','DESC']],'limit':0x1},'log':_0xe5d0('0x3')});}; \ No newline at end of file +var _0x0e1a=['update','../client','create','Request','CreateMailQueueReport'];(function(_0x4139c5,_0x213f76){var _0x3dbccd=function(_0x4043a5){while(--_0x4043a5){_0x4139c5['push'](_0x4139c5['shift']());}};_0x3dbccd(++_0x213f76);}(_0x0e1a,0x1e1));var _0xa0e1=function(_0x368aa5,_0x4d98b4){_0x368aa5=_0x368aa5-0x0;var _0x14e13b=_0x0e1a[_0x368aa5];return _0x14e13b;};'use strict';var client=require(_0xa0e1('0x0'));exports[_0xa0e1('0x1')]=function(_0x1e5993){return client[_0xa0e1('0x2')]('CreateMailQueueReport',{'body':_0x1e5993,'log':_0xa0e1('0x3')});};exports[_0xa0e1('0x4')]=function(_0x1b9f64,_0x4bc2e9){return client[_0xa0e1('0x2')]('UpdateMailQueueReport',{'body':_0x4bc2e9,'options':{'where':{'uniqueid':_0x1b9f64},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b675a79..3578f77 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 _0x6480=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x4c0b4f,_0x524a21){var _0x3c676b=function(_0x47d9af){while(--_0x47d9af){_0x4c0b4f['push'](_0x4c0b4f['shift']());}};_0x3c676b(++_0x524a21);}(_0x6480,0xf5));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0648('0x0'));exports[_0x0648('0x1')]=function(_0xc07a3b,_0x17587b){return client[_0x0648('0x2')](_0x0648('0x3'),{'body':_0x17587b,'options':{'where':{'id':_0xc07a3b}},'log':_0x0648('0x4')});};exports[_0x0648('0x5')]=function(_0xe69b45,_0x234373){return client[_0x0648('0x2')](_0x0648('0x6'),{'body':_0x234373,'options':{'where':{'id':_0xe69b45}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2d81=['UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d81,0x1d8));var _0x12d8=function(_0xcd46d2,_0x218838){_0xcd46d2=_0xcd46d2-0x0;var _0x4bd8a7=_0x2d81[_0xcd46d2];return _0x4bd8a7;};'use strict';var client=require('../client');exports[_0x12d8('0x0')]=function(_0x1bc652,_0x1f6057){return client[_0x12d8('0x1')](_0x12d8('0x2'),{'body':_0x1f6057,'options':{'where':{'id':_0x1bc652}},'log':'updateOpenchannelInteraction'});};exports[_0x12d8('0x3')]=function(_0x34f3b9,_0x4bf34a){return client[_0x12d8('0x1')](_0x12d8('0x4'),{'body':_0x4bf34a,'options':{'where':{'id':_0x34f3b9}},'log':_0x12d8('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index e216980..6908152 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 _0x36c2=['create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x18242b,_0x21c135){var _0x20954b=function(_0x20354e){while(--_0x20354e){_0x18242b['push'](_0x18242b['shift']());}};_0x20954b(++_0x21c135);}(_0x36c2,0x129));var _0x236c=function(_0x3ca8c8,_0x43fef1){_0x3ca8c8=_0x3ca8c8-0x0;var _0x549bf7=_0x36c2[_0x3ca8c8];return _0x549bf7;};'use strict';var client=require('../client');exports[_0x236c('0x0')]=function(_0x261fd2){return client['Request'](_0x236c('0x1'),{'body':_0x261fd2,'log':_0x236c('0x2')});}; \ No newline at end of file +var _0xc1c2=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x1bc675,_0x2cae36){var _0x1ff010=function(_0x2ae1c1){while(--_0x2ae1c1){_0x1bc675['push'](_0x1bc675['shift']());}};_0x1ff010(++_0x2cae36);}(_0xc1c2,0x10f));var _0x2c1c=function(_0x19f382,_0x1e095e){_0x19f382=_0x19f382-0x0;var _0x577e16=_0xc1c2[_0x19f382];return _0x577e16;};'use strict';var client=require(_0x2c1c('0x0'));exports['create']=function(_0x16e727){return client[_0x2c1c('0x1')](_0x2c1c('0x2'),{'body':_0x16e727,'log':_0x2c1c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 04b764f..f7c14bc 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 _0xa6e2=['GetOpenchannelQueue','name','timeout','Agents','openchannelPause','../client','getOpenchannelQueues'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0xa6e2,0x132));var _0x2a6e=function(_0x5c35ef,_0x13f19a){_0x5c35ef=_0x5c35ef-0x0;var _0xb2b68a=_0xa6e2[_0x5c35ef];return _0xb2b68a;};'use strict';var client=require(_0x2a6e('0x0'));exports[_0x2a6e('0x1')]=function(){return function(){return client['Request'](_0x2a6e('0x2'),{'options':{'raw':![],'attributes':['id',_0x2a6e('0x3'),_0x2a6e('0x4'),'strategy'],'include':[{'model':'User','as':_0x2a6e('0x5'),'attributes':['id','name','online',_0x2a6e('0x6')]}]},'log':_0x2a6e('0x1')});};}; \ No newline at end of file +var _0xb93e=['Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','../client'];(function(_0x186684,_0xca280d){var _0x4d7362=function(_0x4640a7){while(--_0x4640a7){_0x186684['push'](_0x186684['shift']());}};_0x4d7362(++_0xca280d);}(_0xb93e,0x6d));var _0xeb93=function(_0xb6c736,_0x4a49b6){_0xb6c736=_0xb6c736-0x0;var _0x409a88=_0xb93e[_0xb6c736];return _0x409a88;};'use strict';var client=require(_0xeb93('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xeb93('0x1')](_0xeb93('0x2'),{'options':{'raw':![],'attributes':['id',_0xeb93('0x3'),_0xeb93('0x4'),_0xeb93('0x5')],'include':[{'model':_0xeb93('0x6'),'as':_0xeb93('0x7'),'attributes':['id',_0xeb93('0x3'),_0xeb93('0x8'),_0xeb93('0x9')]}]},'log':_0xeb93('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 809b7eb..cd9634e 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 _0xa2c6=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x51584f,_0x3601a8){var _0x4dde0e=function(_0x3dd485){while(--_0x3dd485){_0x51584f['push'](_0x51584f['shift']());}};_0x4dde0e(++_0x3601a8);}(_0xa2c6,0xf2));var _0x6a2c=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xa2c6[_0x2d89ce];return _0x3fad10;};'use strict';var client=require(_0x6a2c('0x0'));exports[_0x6a2c('0x1')]=function(_0x722221){return client[_0x6a2c('0x2')](_0x6a2c('0x3'),{'body':_0x722221,'log':'CreateOpenchannelQueueReport'});};exports[_0x6a2c('0x4')]=function(_0x1fba05,_0xff1717){return client[_0x6a2c('0x2')]('UpdateOpenchannelQueueReport',{'body':_0xff1717,'options':{'where':{'uniqueid':_0x1fba05},'order':[['id',_0x6a2c('0x5')]],'limit':0x1},'log':_0x6a2c('0x6')});}; \ No newline at end of file +var _0x2379=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x279994,_0x582317){var _0x353d7a=function(_0x2c101f){while(--_0x2c101f){_0x279994['push'](_0x279994['shift']());}};_0x353d7a(++_0x582317);}(_0x2379,0x82));var _0x9237=function(_0x2133d6,_0x582bfe){_0x2133d6=_0x2133d6-0x0;var _0x279c03=_0x2379[_0x2133d6];return _0x279c03;};'use strict';var client=require('../client');exports['create']=function(_0x5131de){return client[_0x9237('0x0')](_0x9237('0x1'),{'body':_0x5131de,'log':_0x9237('0x1')});};exports[_0x9237('0x2')]=function(_0x170a61,_0x418d1f){return client[_0x9237('0x0')](_0x9237('0x3'),{'body':_0x418d1f,'options':{'where':{'uniqueid':_0x170a61},'order':[['id',_0x9237('0x4')]],'limit':0x1},'log':_0x9237('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 945203f..71c9e9d 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 _0x8ebf=['Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8ebf,0x15c));var _0xf8eb=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x8ebf[_0xc67528];return _0x38e26d;};'use strict';var client=require(_0xf8eb('0x0'));exports[_0xf8eb('0x1')]=function(_0x226e1d,_0x4e42d0){return client[_0xf8eb('0x2')](_0xf8eb('0x3'),{'body':_0x4e42d0,'options':{'where':{'id':_0x226e1d}},'log':'updateSmsInteraction'});};exports[_0xf8eb('0x4')]=function(_0x59d6a7,_0x41e20b){return client['Request'](_0xf8eb('0x5'),{'body':_0x41e20b,'options':{'where':{'id':_0x59d6a7}},'log':_0xf8eb('0x6')});}; \ No newline at end of file +var _0x34f8=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','addTags'];(function(_0x128f92,_0x3a2239){var _0xdd2067=function(_0x2094af){while(--_0x2094af){_0x128f92['push'](_0x128f92['shift']());}};_0xdd2067(++_0x3a2239);}(_0x34f8,0x80));var _0x834f=function(_0x299c6d,_0x2d2072){_0x299c6d=_0x299c6d-0x0;var _0x35d9a5=_0x34f8[_0x299c6d];return _0x35d9a5;};'use strict';var client=require(_0x834f('0x0'));exports[_0x834f('0x1')]=function(_0x2a7837,_0x45ec5b){return client[_0x834f('0x2')]('UpdateSmsInteraction',{'body':_0x45ec5b,'options':{'where':{'id':_0x2a7837}},'log':'updateSmsInteraction'});};exports[_0x834f('0x3')]=function(_0x92264b,_0x4d23b1){return client[_0x834f('0x2')](_0x834f('0x4'),{'body':_0x4d23b1,'options':{'where':{'id':_0x92264b}},'log':_0x834f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index b162b73..9a9563b 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 _0xad4b=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x808de4,_0x1d8a9e){var _0x2a3922=function(_0x24ce97){while(--_0x24ce97){_0x808de4['push'](_0x808de4['shift']());}};_0x2a3922(++_0x1d8a9e);}(_0xad4b,0x189));var _0xbad4=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xad4b[_0x54d4a8];return _0x3b321b;};'use strict';var client=require(_0xbad4('0x0'));exports[_0xbad4('0x1')]=function(_0x3a4c93){return client[_0xbad4('0x2')](_0xbad4('0x3'),{'body':_0x3a4c93,'log':_0xbad4('0x4')});}; \ No newline at end of file +var _0xa2b7=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x10e8ed,_0x384a0d){var _0x4aea4a=function(_0x486ad1){while(--_0x486ad1){_0x10e8ed['push'](_0x10e8ed['shift']());}};_0x4aea4a(++_0x384a0d);}(_0xa2b7,0xfd));var _0x7a2b=function(_0x5cb3fb,_0x255290){_0x5cb3fb=_0x5cb3fb-0x0;var _0x23739b=_0xa2b7[_0x5cb3fb];return _0x23739b;};'use strict';var client=require(_0x7a2b('0x0'));exports[_0x7a2b('0x1')]=function(_0xf9bd83){return client[_0x7a2b('0x2')](_0x7a2b('0x3'),{'body':_0xf9bd83,'log':_0x7a2b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0ed0c4b..fc2a281 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x10197a,_0x5a8a9c){var _0x7f6acc=function(_0x14ec7d){while(--_0x14ec7d){_0x10197a['push'](_0x10197a['shift']());}};_0x7f6acc(++_0x5a8a9c);}(_0x70e0,0x17b));var _0x070e=function(_0x42dcf3,_0x389005){_0x42dcf3=_0x42dcf3-0x0;var _0x5dbd3e=_0x70e0[_0x42dcf3];return _0x5dbd3e;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x333259,_0x1ada7b){var _0x39e421=function(_0x24803f){while(--_0x24803f){_0x333259['push'](_0x333259['shift']());}};_0x39e421(++_0x1ada7b);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 494280d..df0954a 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(_0x426a24,_0xb03c4f){var _0x425bf1=function(_0x43c9c4){while(--_0x43c9c4){_0x426a24['push'](_0x426a24['shift']());}};_0x425bf1(++_0xb03c4f);}(_0x34e8,0x12c));var _0x834e=function(_0x277478,_0x120fd2){_0x277478=_0x277478-0x0;var _0xc7af01=_0x34e8[_0x277478];return _0xc7af01;};'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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x32cae3,_0x3075fe){_0x32cae3=_0x32cae3-0x0;var _0x25526b=_0xedd9[_0x32cae3];return _0x25526b;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 1ec76fb..d51642d 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(_0x18c1d7,_0x34df55){var _0x3f4964=function(_0x2738a1){while(--_0x2738a1){_0x18c1d7['push'](_0x18c1d7['shift']());}};_0x3f4964(++_0x34df55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x57cbfb,_0x2efcc6){var _0x196987=function(_0x1805c7){while(--_0x1805c7){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x196987(++_0x2efcc6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 310b6a5..84c77cd 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 _0x044a=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x3f1b84,_0x392e82){var _0x251ef2=function(_0x409789){while(--_0x409789){_0x3f1b84['push'](_0x3f1b84['shift']());}};_0x251ef2(++_0x392e82);}(_0x044a,0x173));var _0xa044=function(_0x189e9,_0x53e3f9){_0x189e9=_0x189e9-0x0;var _0x5df4cd=_0x044a[_0x189e9];return _0x5df4cd;};'use strict';var client=require(_0xa044('0x0'));exports[_0xa044('0x1')]=function(_0x2ea3b8,_0x1aafce){return client[_0xa044('0x2')](_0xa044('0x3'),{'body':_0x1aafce,'options':{'where':{'id':_0x2ea3b8}},'log':_0xa044('0x4')});};exports[_0xa044('0x5')]=function(_0x25ed77,_0x116358){return client['Request'](_0xa044('0x6'),{'body':_0x116358,'options':{'where':{'id':_0x25ed77}},'log':_0xa044('0x7')});}; \ No newline at end of file +var _0xc61d=['update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x5f1456,_0x3f70da){var _0x4b6fd5=function(_0x350d4e){while(--_0x350d4e){_0x5f1456['push'](_0x5f1456['shift']());}};_0x4b6fd5(++_0x3f70da);}(_0xc61d,0xfb));var _0xdc61=function(_0x519bea,_0x406ee5){_0x519bea=_0x519bea-0x0;var _0x5ccfe4=_0xc61d[_0x519bea];return _0x5ccfe4;};'use strict';var client=require(_0xdc61('0x0'));exports[_0xdc61('0x1')]=function(_0x3078b6,_0x444fd6){return client[_0xdc61('0x2')](_0xdc61('0x3'),{'body':_0x444fd6,'options':{'where':{'id':_0x3078b6}},'log':'updateWhatsappInteraction'});};exports[_0xdc61('0x4')]=function(_0x237baa,_0x4ebd75){return client[_0xdc61('0x2')](_0xdc61('0x5'),{'body':_0x4ebd75,'options':{'where':{'id':_0x237baa}},'log':_0xdc61('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index db14480..3011c80 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 _0x7b2f=['../client','create','Request','createWhatsappMessage'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x7b2f,0x1c8));var _0xf7b2=function(_0x399f3f,_0x4bd01b){_0x399f3f=_0x399f3f-0x0;var _0xb636e2=_0x7b2f[_0x399f3f];return _0xb636e2;};'use strict';var client=require(_0xf7b2('0x0'));exports[_0xf7b2('0x1')]=function(_0x298842){return client[_0xf7b2('0x2')]('CreateWhatsappMessage',{'body':_0x298842,'log':_0xf7b2('0x3')});}; \ No newline at end of file +var _0x6534=['Request','CreateWhatsappMessage','../client','create'];(function(_0x34cea1,_0x16d860){var _0x2d796a=function(_0x11e340){while(--_0x11e340){_0x34cea1['push'](_0x34cea1['shift']());}};_0x2d796a(++_0x16d860);}(_0x6534,0x192));var _0x4653=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6534[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x4653('0x0'));exports[_0x4653('0x1')]=function(_0x51ee05){return client[_0x4653('0x2')](_0x4653('0x3'),{'body':_0x51ee05,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index edccceb..93af3cb 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 _0x1491=['Agents','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','timeout','User'];(function(_0x26031,_0x4fb1b5){var _0x288e2c=function(_0x19188d){while(--_0x19188d){_0x26031['push'](_0x26031['shift']());}};_0x288e2c(++_0x4fb1b5);}(_0x1491,0xbb));var _0x1149=function(_0x186f36,_0x24e2e8){_0x186f36=_0x186f36-0x0;var _0x4f6c44=_0x1491[_0x186f36];return _0x4f6c44;};'use strict';var client=require('../client');exports[_0x1149('0x0')]=function(){return function(){return client[_0x1149('0x1')](_0x1149('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1149('0x3'),'strategy'],'include':[{'model':_0x1149('0x4'),'as':_0x1149('0x5'),'attributes':['id','name',_0x1149('0x6'),_0x1149('0x7')]}]},'log':_0x1149('0x0')});};}; \ No newline at end of file +var _0x6d28=['GetWhatsappQueue','name','timeout','User','Agents','../client','getWhatsappQueues','Request'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x6d28,0x1d5));var _0x86d2=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x6d28[_0x2d994d];return _0xd54be4;};'use strict';var client=require(_0x86d2('0x0'));exports[_0x86d2('0x1')]=function(){return function(){return client[_0x86d2('0x2')](_0x86d2('0x3'),{'options':{'raw':![],'attributes':['id',_0x86d2('0x4'),_0x86d2('0x5'),'strategy'],'include':[{'model':_0x86d2('0x6'),'as':_0x86d2('0x7'),'attributes':['id',_0x86d2('0x4'),'online','whatsappPause']}]},'log':_0x86d2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index b661a3a..28ac478 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 _0xcc15=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0xae0004,_0x5c06e2){var _0x50de90=function(_0x2925c4){while(--_0x2925c4){_0xae0004['push'](_0xae0004['shift']());}};_0x50de90(++_0x5c06e2);}(_0xcc15,0x1bd));var _0x5cc1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xcc15[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x5cc1('0x0'));exports[_0x5cc1('0x1')]=function(_0x230cc4){return client[_0x5cc1('0x2')]('CreateWhatsappQueueReport',{'body':_0x230cc4,'log':_0x5cc1('0x3')});};exports[_0x5cc1('0x4')]=function(_0x3f3073,_0xba38ce){return client[_0x5cc1('0x2')](_0x5cc1('0x5'),{'body':_0xba38ce,'options':{'where':{'uniqueid':_0x3f3073},'order':[['id',_0x5cc1('0x6')]],'limit':0x1},'log':_0x5cc1('0x5')});}; \ No newline at end of file +var _0xa8c5=['UpdateWhatsappQueueReport','../client','CreateWhatsappQueueReport','update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa8c5,0xd9));var _0x5a8c=function(_0x1bcb4a,_0x4c6e6d){_0x1bcb4a=_0x1bcb4a-0x0;var _0x4655c6=_0xa8c5[_0x1bcb4a];return _0x4655c6;};'use strict';var client=require(_0x5a8c('0x0'));exports['create']=function(_0x481ba4){return client['Request'](_0x5a8c('0x1'),{'body':_0x481ba4,'log':'CreateWhatsappQueueReport'});};exports[_0x5a8c('0x2')]=function(_0x5750a7,_0x34e676){return client['Request'](_0x5a8c('0x3'),{'body':_0x34e676,'options':{'where':{'uniqueid':_0x5750a7},'order':[['id','DESC']],'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 1bdb9a6..9be625b 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 _0x7061=['length','error','[%s][AGENT]\x20%s','message','join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','name','toLowerCase','consequence'];(function(_0x4a3570,_0x169197){var _0x235ca8=function(_0x4d167b){while(--_0x4d167b){_0x4a3570['push'](_0x4a3570['shift']());}};_0x235ca8(++_0x169197);}(_0x7061,0x12e));var _0x1706=function(_0x1d8544,_0x17daff){_0x1d8544=_0x1d8544-0x0;var _0x249990=_0x7061[_0x1d8544];return _0x249990;};'use strict';var schema=require(_0x1706('0x0'));var _=require(_0x1706('0x1'));var util=require('util');var seqqueue=require(_0x1706('0x2'));var logger=require(_0x1706('0x3'))(_0x1706('0x4'));var strategy=require(_0x1706('0x5'));var queue=schema({'name':{'type':_0x1706('0x6'),'required':!![],'message':_0x1706('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x252f5d,_0x3423e3,_0x1b00ad){return logger[_0x1706('0x8')](util[_0x1706('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x252f5d,_0x3423e3['name'],_0x1b00ad));}function handleFindAgent(_0x2a45c8){return function(_0x1ae141){return _0x1ae141[_0x1706('0xa')][_0x1706('0xb')]()===_0x2a45c8['toLowerCase']();};}exports[_0x1706('0xc')]=function(_0x50f22b,_0x1bd777,_0x32d604,_0x43cc6e){return function(_0x39116d){try{var _0x4c0e2a={'name':_0x1bd777[0x0],'timeout':_0x1bd777[0x1]};var _0x20099e=queue[_0x1706('0x0')](_0x4c0e2a,{'typecast':!![]});if(_0x20099e[_0x1706('0xd')]){logger[_0x1706('0xe')](_0x1706('0xf'),_0x50f22b,_['map'](_0x20099e,_0x1706('0x10'))[_0x1706('0x11')](',\x20'));_0x39116d[_0x1706('0x12')]();}else{var _0x286204=_['find'](_0x32d604[_0x1706('0x13')],handleFindAgent(_0x4c0e2a[_0x1706('0xa')]));if(_0x286204){var _0x359c24=(_0x4c0e2a[_0x1706('0x14')]||0xa)*0x3e8;var _0x4ea3c9,_0x1abedb;var _0x58d980=seqqueue[_0x1706('0x15')](_0x359c24);_0x58d980['id']=_0x50f22b;_0x58d980[_0x1706('0x16')]=_0x359c24;_0x58d980[_0x1706('0x17')]=_0x43cc6e['channel'];writeLog(_0x50f22b,_0x286204,util[_0x1706('0x9')](_0x1706('0x18'),_0x359c24));_0x32d604[_0x1706('0x19')][_0x50f22b]['on'](_0x1706('0x1a'),function(){logger[_0x1706('0x8')](_0x1706('0x1b'),_0x50f22b);clearTimeout(_0x1abedb);_0x1abedb=undefined;_0x58d980[_0x1706('0x1c')]();if(_0x32d604['rules'][_0x50f22b]){delete _0x32d604[_0x1706('0x19')][_0x50f22b];}_0x39116d['stop']();});_0x32d604[_0x1706('0x19')][_0x50f22b]['on'](_0x1706('0x1d'),function(){if(_0x32d604[_0x1706('0x19')][_0x50f22b]){delete _0x32d604['rules'][_0x50f22b];}});_0x1abedb=setTimeout(function(){logger['info'](_0x1706('0x1e'),_0x50f22b);clearTimeout(_0x1abedb);_0x58d980[_0x1706('0x1c')]();_0x39116d['next']();},_0x359c24);strategy[_0x1706('0x1f')](_0x58d980,_0x286204,_0x32d604,_0x43cc6e);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x50f22b,_0x4c0e2a[_0x1706('0xa')]);_0x39116d[_0x1706('0x12')]();}}}catch(_0x44adcf){console[_0x1706('0x20')](_0x44adcf);logger['error'](_0x1706('0x21'),_0x50f22b,_0x44adcf[_0x1706('0x22')]);_0x39116d[_0x1706('0x12')]();}};}; \ No newline at end of file +var _0xcbd2=['map','join','stop','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','[%s][AGENT]\x20%s'];(function(_0x4790d4,_0x1aba85){var _0x4b7ac1=function(_0x4eaa53){while(--_0x4eaa53){_0x4790d4['push'](_0x4790d4['shift']());}};_0x4b7ac1(++_0x1aba85);}(_0xcbd2,0x64));var _0x2cbd=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0xcbd2[_0x44b7d6];return _0x5346f0;};'use strict';var schema=require('validate');var _=require(_0x2cbd('0x0'));var util=require(_0x2cbd('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x2cbd('0x2'))(_0x2cbd('0x3'));var strategy=require(_0x2cbd('0x4'));var queue=schema({'name':{'type':_0x2cbd('0x5'),'required':!![],'message':_0x2cbd('0x6')},'timeout':{'type':_0x2cbd('0x7'),'message':_0x2cbd('0x8')}});function writeLog(_0x2b8edb,_0xfe0b64,_0x3af425){return logger[_0x2cbd('0x9')](util['format'](_0x2cbd('0xa'),_0x2b8edb,_0xfe0b64[_0x2cbd('0xb')],_0x3af425));}function handleFindAgent(_0x434064){return function(_0x605a9a){return _0x605a9a[_0x2cbd('0xb')][_0x2cbd('0xc')]()===_0x434064[_0x2cbd('0xc')]();};}exports[_0x2cbd('0xd')]=function(_0x159973,_0x64833d,_0x27c961,_0xf3ccb1){return function(_0x137a0b){try{var _0x453fc0={'name':_0x64833d[0x0],'timeout':_0x64833d[0x1]};var _0x2b5ca9=queue[_0x2cbd('0xe')](_0x453fc0,{'typecast':!![]});if(_0x2b5ca9[_0x2cbd('0xf')]){logger['error'](_0x2cbd('0x10'),_0x159973,_[_0x2cbd('0x11')](_0x2b5ca9,'message')[_0x2cbd('0x12')](',\x20'));_0x137a0b[_0x2cbd('0x13')]();}else{var _0xb8d8bd=_['find'](_0x27c961[_0x2cbd('0x14')],handleFindAgent(_0x453fc0[_0x2cbd('0xb')]));if(_0xb8d8bd){var _0x208561=(_0x453fc0[_0x2cbd('0x15')]||0xa)*0x3e8;var _0x17a88b,_0x5c47e4;var _0x1d8d2c=seqqueue[_0x2cbd('0x16')](_0x208561);_0x1d8d2c['id']=_0x159973;_0x1d8d2c[_0x2cbd('0x17')]=_0x208561;_0x1d8d2c['channel']=_0xf3ccb1[_0x2cbd('0x18')];writeLog(_0x159973,_0xb8d8bd,util[_0x2cbd('0x19')](_0x2cbd('0x1a'),_0x208561));_0x27c961[_0x2cbd('0x1b')][_0x159973]['on'](_0x2cbd('0x1c'),function(){logger[_0x2cbd('0x9')](_0x2cbd('0x1d'),_0x159973);clearTimeout(_0x5c47e4);_0x5c47e4=undefined;_0x1d8d2c[_0x2cbd('0x1e')]();if(_0x27c961[_0x2cbd('0x1b')][_0x159973]){delete _0x27c961['rules'][_0x159973];}_0x137a0b['stop']();});_0x27c961[_0x2cbd('0x1b')][_0x159973]['on'](_0x2cbd('0x1f'),function(){if(_0x27c961[_0x2cbd('0x1b')][_0x159973]){delete _0x27c961[_0x2cbd('0x1b')][_0x159973];}});_0x5c47e4=setTimeout(function(){logger[_0x2cbd('0x9')](_0x2cbd('0x20'),_0x159973);clearTimeout(_0x5c47e4);_0x1d8d2c[_0x2cbd('0x1e')]();_0x137a0b[_0x2cbd('0x21')]();},_0x208561);strategy['agent'](_0x1d8d2c,_0xb8d8bd,_0x27c961,_0xf3ccb1);}else{logger[_0x2cbd('0x22')](_0x2cbd('0x23'),_0x159973,_0x453fc0[_0x2cbd('0xb')]);_0x137a0b[_0x2cbd('0x13')]();}}}catch(_0x32a0ff){console[_0x2cbd('0x24')](_0x32a0ff);logger[_0x2cbd('0x22')](_0x2cbd('0x25'),_0x159973,_0x32a0ff[_0x2cbd('0x26')]);_0x137a0b[_0x2cbd('0x13')]();}};}; \ 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 0cd75cb..98cf4a9 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 _0x1241=['whatsapp','phone','chat','account','upperFirst','InteractionId','created','body','getMustacheRender','Message','catch','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','next','amazonlex','providerName','providerResponse','then','dialogState','Failed','error','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x1241,0x174));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1124('0x0'));var moment=require(_0x1124('0x1'));var AWS=require(_0x1124('0x2'));var utils=require('./utils');var logger=require(_0x1124('0x3'))(_0x1124('0x4'));var rpc={'chatMessage':require(_0x1124('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1124('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1124('0x7')),'whatsappMessage':require(_0x1124('0x8'))};exports[_0x1124('0x9')]=function(_0x43133d,_0x49ebac){return function(_0x7e7d89){try{if(!_[_0x1124('0xa')](this[_0x1124('0xb')]['UserId'])){logger[_0x1124('0xc')](_0x1124('0xd'),_0x43133d,_0x1124('0xe'));return _0x7e7d89['next']();}var _0x34713e={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1124('0xf')](_0x1124('0x10')),'direction':_0x1124('0x11')};if(this[_0x1124('0x12')]===_0x1124('0x13')||this[_0x1124('0x12')]===_0x1124('0x14')){_0x34713e[_0x1124('0x15')]=this[_0x1124('0xb')]['phone'];}var _0x1e8048=this[_0x1124('0x12')];if(_0x1e8048===_0x1124('0x16')){_0x34713e['ChatWebsiteId']=this[_0x1124('0x17')]['id'];}else{_0x34713e[_[_0x1124('0x18')](_0x1e8048)+'AccountId']=this[_0x1124('0x17')]['id'];}_0x34713e[_[_0x1124('0x18')](_0x1e8048)+_0x1124('0x19')]=this['interaction']['id'];if(this['interaction'][_0x1124('0x1a')]){var _0x23dcf0=_0x49ebac[0x4];if(!_['isEmpty'](_0x23dcf0)){_0x34713e[_0x1124('0x1b')]=utils[_0x1124('0x1c')](_0x23dcf0,this);return rpc[_0x1e8048+_0x1124('0x1d')]['create'](_0x34713e)['then'](function(_0x50c411){logger[_0x1124('0xc')]('[%s][AMAZONLEX]\x20%s',_0x43133d,_0x34713e[_0x1124('0x1b')]);})[_0x1124('0x1e')](function(_0xfddd8a){logger['error']('[%s][AMAZONLEX]\x20%s',_0x43133d,JSON[_0x1124('0x1f')](_0xfddd8a));})[_0x1124('0x20')](function(){logger[_0x1124('0xc')](_0x1124('0x21'),_0x43133d);_0x7e7d89[_0x1124('0x22')]();});}else{logger[_0x1124('0xc')](_0x1124('0x23'),_0x43133d);_0x7e7d89[_0x1124('0x22')]();}}else{var _0x17c20c=this;var _0x19e89a=new AWS[(_0x1124('0x24'))]({'accessKeyId':_0x49ebac[0x0],'secretAccessKey':_0x49ebac[0x1],'region':_0x49ebac[0x2]});var _0x3ae331={'botAlias':_0x1124('0x25'),'botName':_0x49ebac[0x3],'inputText':this[_0x1124('0x26')][_0x1124('0x1b')],'userId':this['channel']+':'+this[_0x1124('0xb')]['id'][_0x1124('0x27')]()};_0x19e89a[_0x1124('0x28')](_0x3ae331,function(_0x2f67f0,_0x4da2aa){if(_0x2f67f0){logger['error'](_0x1124('0xd'),_0x43133d,_0x2f67f0[_0x1124('0x26')]);_0x7e7d89[_0x1124('0x29')]();}else if(_0x4da2aa&&_0x4da2aa[_0x1124('0x26')]){_0x17c20c['body'][_0x1124('0x2a')]=_0x4da2aa;_0x34713e[_0x1124('0x1b')]=_0x4da2aa[_0x1124('0x26')];_0x34713e[_0x1124('0x2b')]=_0x1124('0x2a');_0x34713e[_0x1124('0x2c')]=JSON[_0x1124('0x1f')](_0x4da2aa);return rpc[_0x1e8048+_0x1124('0x1d')]['create'](_0x34713e)[_0x1124('0x2d')](function(_0x2bde20){logger[_0x1124('0xc')](_0x1124('0xd'),_0x43133d,_0x34713e['body']);if(_0x4da2aa[_0x1124('0x2e')]==_0x1124('0x2f')){_0x7e7d89[_0x1124('0x29')]();}else{_0x7e7d89[_0x1124('0x22')]();}})[_0x1124('0x1e')](function(_0x10f880){logger[_0x1124('0x30')](_0x1124('0xd'),_0x43133d,JSON[_0x1124('0x1f')](_0x10f880));_0x7e7d89[_0x1124('0x29')]();});}else{_0x7e7d89[_0x1124('0x29')]();}});}}catch(_0x53ac7d){logger[_0x1124('0x30')](_0x1124('0xd'),_0x43133d,JSON[_0x1124('0x1f')](_0x53ac7d));_0x7e7d89[_0x1124('0x22')]();}};}; \ No newline at end of file +var _0xa7eb=['error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','Message','Failed','moment','aws-sdk','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','then','body','catch'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xa7eb,0x1d1));var _0xba7e=function(_0x214934,_0x4e23b8){_0x214934=_0x214934-0x0;var _0xef1672=_0xa7eb[_0x214934];return _0xef1672;};'use strict';var _=require('lodash');var moment=require(_0xba7e('0x0'));var AWS=require(_0xba7e('0x1'));var utils=require('./utils');var logger=require(_0xba7e('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xba7e('0x3')),'mailMessage':require(_0xba7e('0x4')),'smsMessage':require(_0xba7e('0x5')),'faxMessage':require(_0xba7e('0x6')),'whatsappMessage':require(_0xba7e('0x7'))};exports[_0xba7e('0x8')]=function(_0x3f16fb,_0x8fd25){return function(_0x252ac1){try{if(!_['isNil'](this[_0xba7e('0x9')]['UserId'])){logger[_0xba7e('0xa')](_0xba7e('0xb'),_0x3f16fb,_0xba7e('0xc'));return _0x252ac1[_0xba7e('0xd')]();}var _0x27a0b2={'ContactId':this[_0xba7e('0xe')]['id'],'sentAt':moment()[_0xba7e('0xf')](_0xba7e('0x10')),'direction':_0xba7e('0x11')};if(this[_0xba7e('0x12')]===_0xba7e('0x13')||this[_0xba7e('0x12')]===_0xba7e('0x14')){_0x27a0b2[_0xba7e('0x15')]=this[_0xba7e('0x9')][_0xba7e('0x15')];}var _0x565a23=this['channel'];if(_0x565a23===_0xba7e('0x16')){_0x27a0b2[_0xba7e('0x17')]=this[_0xba7e('0x18')]['id'];}else{_0x27a0b2[_[_0xba7e('0x19')](_0x565a23)+_0xba7e('0x1a')]=this[_0xba7e('0x18')]['id'];}_0x27a0b2[_[_0xba7e('0x19')](_0x565a23)+_0xba7e('0x1b')]=this[_0xba7e('0x9')]['id'];if(this[_0xba7e('0x9')][_0xba7e('0x1c')]){var _0x136d48=_0x8fd25[0x4];if(!_[_0xba7e('0x1d')](_0x136d48)){_0x27a0b2['body']=utils[_0xba7e('0x1e')](_0x136d48,this);return rpc[_0x565a23+'Message'][_0xba7e('0x1f')](_0x27a0b2)[_0xba7e('0x20')](function(_0x1f25c1){logger[_0xba7e('0xa')](_0xba7e('0xb'),_0x3f16fb,_0x27a0b2[_0xba7e('0x21')]);})[_0xba7e('0x22')](function(_0x4043f1){logger[_0xba7e('0x23')](_0xba7e('0xb'),_0x3f16fb,JSON[_0xba7e('0x24')](_0x4043f1));})['finally'](function(){logger['info'](_0xba7e('0x25'),_0x3f16fb);_0x252ac1['stop']();});}else{logger[_0xba7e('0xa')](_0xba7e('0x26'),_0x3f16fb);_0x252ac1[_0xba7e('0x27')]();}}else{var _0x34d273=this;var _0x1f07fe=new AWS[(_0xba7e('0x28'))]({'accessKeyId':_0x8fd25[0x0],'secretAccessKey':_0x8fd25[0x1],'region':_0x8fd25[0x2]});var _0x18ab87={'botAlias':_0xba7e('0x29'),'botName':_0x8fd25[0x3],'inputText':this[_0xba7e('0x2a')][_0xba7e('0x21')],'userId':this[_0xba7e('0x12')]+':'+this[_0xba7e('0x9')]['id'][_0xba7e('0x2b')]()};_0x1f07fe[_0xba7e('0x2c')](_0x18ab87,function(_0x1920a3,_0x2fa51a){if(_0x1920a3){logger['error'](_0xba7e('0xb'),_0x3f16fb,_0x1920a3[_0xba7e('0x2a')]);_0x252ac1[_0xba7e('0xd')]();}else if(_0x2fa51a&&_0x2fa51a[_0xba7e('0x2a')]){_0x34d273[_0xba7e('0x21')][_0xba7e('0x2d')]=_0x2fa51a;_0x27a0b2[_0xba7e('0x21')]=_0x2fa51a['message'];_0x27a0b2[_0xba7e('0x2e')]='amazonlex';_0x27a0b2[_0xba7e('0x2f')]=JSON[_0xba7e('0x24')](_0x2fa51a);return rpc[_0x565a23+_0xba7e('0x30')]['create'](_0x27a0b2)['then'](function(_0x5841a6){logger[_0xba7e('0xa')](_0xba7e('0xb'),_0x3f16fb,_0x27a0b2[_0xba7e('0x21')]);if(_0x2fa51a['dialogState']==_0xba7e('0x31')){_0x252ac1[_0xba7e('0xd')]();}else{_0x252ac1['stop']();}})['catch'](function(_0x2e2e40){logger[_0xba7e('0x23')](_0xba7e('0xb'),_0x3f16fb,JSON['stringify'](_0x2e2e40));_0x252ac1['next']();});}else{_0x252ac1[_0xba7e('0xd')]();}});}}catch(_0x181569){logger[_0xba7e('0x23')](_0xba7e('0xb'),_0x3f16fb,JSON[_0xba7e('0x24')](_0x181569));_0x252ac1[_0xba7e('0x27')]();}};}; \ 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 0441ae8..b723e92 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 _0x3531=['sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','then','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','headers','auto-replied','All','auto_reply'];(function(_0x55d3b8,_0x2e026e){var _0x1d9710=function(_0x22dfe8){while(--_0x22dfe8){_0x55d3b8['push'](_0x55d3b8['shift']());}};_0x1d9710(++_0x2e026e);}(_0x3531,0x1c6));var _0x1353=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3531[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x1353('0x0'));var moment=require(_0x1353('0x1'));var utils=require(_0x1353('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x1353('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1353('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1353('0x5')),'whatsappMessage':require(_0x1353('0x6')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1353('0x7')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x1353('0x8')),'faxInteraction':require(_0x1353('0x9')),'whatsappInteraction':require(_0x1353('0xa'))};var mailRpc=require('../../mailRpc');exports[_0x1353('0xb')]=function(_0x4c7d08,_0x118293,_0x34e31c,_0x13c308){return function(_0x52c24e){try{var _0x48248c=this[_0x1353('0xc')];if(_0x48248c==='mail'&&_0x13c308[_0x1353('0xd')][_0x1353('0xe')]){logger[_0x1353('0xf')]('[%s][AUTOREPLY]\x20%s',_0x4c7d08,_0x1353('0x10'));return _0x52c24e['next']();}if(_0x118293[0x0]==='1'&&(_['isNil'](this[_0x1353('0x11')][_0x1353('0x12')])||!this[_0x1353('0x11')]['created'])){logger[_0x1353('0xf')](_0x1353('0x13'),_0x4c7d08,_0x1353('0x14'));return _0x52c24e['next']();}if(_0x118293[0x0]==='2'&&this[_0x1353('0x11')][_0x1353('0x15')]){logger[_0x1353('0xf')](_0x1353('0x16'),_0x4c7d08,_0x1353('0x17'));return _0x52c24e[_0x1353('0x18')]();}var _0x21240d={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1353('0x19')](_0x1353('0x1a')),'direction':_0x1353('0x1b')};if(this[_0x1353('0xc')]===_0x1353('0x1c')){_0x21240d[_0x1353('0xd')]=utils[_0x1353('0x1d')](_0x118293[0x2],this);}else{_0x21240d[_0x1353('0xd')]=utils['getMustacheRender'](_0x118293[0x1],this);}if(this[_0x1353('0x1e')]){_0x21240d['to']=this['message'][_0x1353('0x1f')]||'';if(this[_0x1353('0xc')]===_0x1353('0x1c')&&_0x118293[0x1]==='1'){_0x21240d['cc']=this[_0x1353('0x1e')]['cc']||'';}_0x21240d[_0x1353('0x1f')]=this['message']['to']||'';_0x21240d[_0x1353('0x20')]=this[_0x1353('0x1e')][_0x1353('0x20')]||'';_0x21240d[_0x1353('0x21')]=!![];if(this[_0x1353('0x1e')][_0x1353('0x22')]){_0x21240d[_0x1353('0x22')]='';_0x21240d['subject']+=_['startsWith'](this[_0x1353('0x1e')][_0x1353('0x22')],_0x1353('0x23'))?'':_0x1353('0x24');_0x21240d[_0x1353('0x22')]+=this['message']['subject'];}}if(this['channel']==='chat'){_0x21240d[_0x1353('0x25')]=this[_0x1353('0x26')]['id'];}else{_0x21240d[_[_0x1353('0x27')](this['channel'])+_0x1353('0x28')]=this[_0x1353('0x26')]['id'];}_0x21240d[_[_0x1353('0x27')](this[_0x1353('0xc')])+_0x1353('0x29')]=this[_0x1353('0x11')]['id'];var _0x51b88c=this[_0x1353('0x11')];if(rpc[this[_0x1353('0xc')]+_0x1353('0x2a')]){if(this[_0x1353('0xc')]===_0x1353('0x1c')){_0x21240d[_0x1353('0x2b')]=this[_0x1353('0x1e')]['messageId'];_0x21240d[_0x1353('0x2c')]=_0x1353('0x2d')+_['replace'](_0x21240d[_0x1353('0xd')],'';_0x21240d[_0x1353('0x2e')]={'Auto-Submitted':_0x1353('0x2f'),'X-Auto-Response-Suppress':_0x1353('0x30'),'Precedence':_0x1353('0x31')};return mailRpc[_0x1353('0x32')](this[_0x1353('0x26')][_0x1353('0x33')],_0x21240d)['then'](function(_0x68903c){logger['info'](_0x1353('0x34'),_0x4c7d08);_0x21240d['messageId']=_0x68903c[_0x1353('0x1e')]['messageId'];return rpc[_0x48248c+_0x1353('0x2a')]['create'](_0x21240d);})[_0x1353('0x35')](function(_0x7d9aac){logger[_0x1353('0xf')](_0x1353('0x13'),_0x4c7d08,JSON['stringify'](_0x7d9aac));})['catch'](function(_0x2474c4){logger[_0x1353('0x36')](_0x1353('0x37'),_0x4c7d08,JSON[_0x1353('0x38')](_0x2474c4));})[_0x1353('0x39')](function(){Promise[_0x1353('0x3a')]()[_0x1353('0x35')](function(){if(_0x118293[0x0]!=='2'||_0x51b88c[_0x1353('0x15')])return;return rpc[_0x48248c+_0x1353('0x3b')][_0x1353('0x3c')](_0x51b88c['id'],{'autoreplyExecuted':!![]})[_0x1353('0x35')](function(_0x12b38f){logger['info'](_0x1353('0x16'),_0x4c7d08,JSON['stringify'](_0x12b38f));})['catch'](function(_0x14853d){logger[_0x1353('0x36')](_0x1353('0x3d'),_0x4c7d08,JSON[_0x1353('0x38')](_0x14853d));});})[_0x1353('0x35')](function(){_0x52c24e[_0x1353('0x18')]();});});}else{return rpc[this['channel']+_0x1353('0x2a')]['create'](_0x21240d)['then'](function(){logger['info'](_0x1353('0x13'),_0x4c7d08,_0x21240d['body']);})[_0x1353('0x3e')](function(_0x575ccd){logger[_0x1353('0x36')](_0x1353('0x13'),_0x4c7d08,JSON[_0x1353('0x38')](_0x575ccd));})[_0x1353('0x39')](function(){Promise[_0x1353('0x3a')]()[_0x1353('0x35')](function(){if(_0x118293[0x0]!=='2'||_0x51b88c[_0x1353('0x15')])return;return rpc[_0x48248c+'Interaction'][_0x1353('0x3c')](_0x51b88c['id'],{'autoreplyExecuted':!![]})[_0x1353('0x35')](function(_0x37159d){logger[_0x1353('0xf')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4c7d08,JSON['stringify'](_0x37159d));})[_0x1353('0x3e')](function(_0x106dee){logger[_0x1353('0x36')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4c7d08,JSON[_0x1353('0x38')](_0x106dee));});})[_0x1353('0x35')](function(){_0x52c24e[_0x1353('0x18')]();});});}}}catch(_0x1684e6){logger['error'](_0x1353('0x13'),_0x4c7d08,JSON['stringify'](_0x1684e6));_0x52c24e['stop']();}};}; \ No newline at end of file +var _0x749f=['isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','info','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','InteractionId','inReplyTo','messageId','html','','replace','';_0x23bd28['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xf749('0x2e'),'Precedence':'auto_reply'};return mailRpc[_0xf749('0x2f')](this[_0xf749('0x24')]['smtpOptions'],_0x23bd28)[_0xf749('0x30')](function(_0x2dea58){logger[_0xf749('0x14')](_0xf749('0x31'),_0x44f81e);_0x23bd28[_0xf749('0x28')]=_0x2dea58[_0xf749('0x1c')]['messageId'];return rpc[_0x2bc5d0+_0xf749('0x32')]['create'](_0x23bd28);})[_0xf749('0x30')](function(_0x41181d){logger['info'](_0xf749('0x11'),_0x44f81e,JSON['stringify'](_0x41181d));})['catch'](function(_0x332ecc){logger[_0xf749('0x33')](_0xf749('0x34'),_0x44f81e,JSON['stringify'](_0x332ecc));})[_0xf749('0x35')](function(){Promise[_0xf749('0x36')]()[_0xf749('0x30')](function(){if(_0x255072[0x0]!=='2'||_0x57886c['autoreplyExecuted'])return;return rpc[_0x2bc5d0+'Interaction']['update'](_0x57886c['id'],{'autoreplyExecuted':!![]})[_0xf749('0x30')](function(_0x19e8d5){logger[_0xf749('0x14')](_0xf749('0x18'),_0x44f81e,JSON[_0xf749('0x37')](_0x19e8d5));})['catch'](function(_0x5b0161){logger[_0xf749('0x33')](_0xf749('0x38'),_0x44f81e,JSON[_0xf749('0x37')](_0x5b0161));});})[_0xf749('0x30')](function(){_0x4664b7[_0xf749('0x16')]();});});}else{return rpc[this['channel']+'Message'][_0xf749('0x39')](_0x23bd28)['then'](function(){logger[_0xf749('0x14')](_0xf749('0x11'),_0x44f81e,_0x23bd28['body']);})['catch'](function(_0x24a52a){logger['error'](_0xf749('0x11'),_0x44f81e,JSON[_0xf749('0x37')](_0x24a52a));})[_0xf749('0x35')](function(){Promise[_0xf749('0x36')]()['then'](function(){if(_0x255072[0x0]!=='2'||_0x57886c[_0xf749('0x17')])return;return rpc[_0x2bc5d0+_0xf749('0x3a')][_0xf749('0x3b')](_0x57886c['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1706e3){logger[_0xf749('0x14')](_0xf749('0x18'),_0x44f81e,JSON[_0xf749('0x37')](_0x1706e3));})[_0xf749('0x3c')](function(_0x25a3e5){logger[_0xf749('0x33')](_0xf749('0x38'),_0x44f81e,JSON[_0xf749('0x37')](_0x25a3e5));});})[_0xf749('0x30')](function(){_0x4664b7['next']();});});}}}catch(_0x313b11){logger[_0xf749('0x33')](_0xf749('0x11'),_0x44f81e,JSON[_0xf749('0x37')](_0x313b11));_0x4664b7[_0xf749('0x3d')]();}};}; \ 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 8dedcff..06dbb32 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 _0x31c2=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel'];(function(_0x11fe8a,_0x173612){var _0x54bfe5=function(_0x44a1a3){while(--_0x44a1a3){_0x11fe8a['push'](_0x11fe8a['shift']());}};_0x54bfe5(++_0x173612);}(_0x31c2,0x17f));var _0x231c=function(_0x36554d,_0x9de0ad){_0x36554d=_0x36554d-0x0;var _0x23a72e=_0x31c2[_0x36554d];return _0x23a72e;};'use strict';var moment=require(_0x231c('0x0'));var logger=require('../../../../config/logger')(_0x231c('0x1'));var rpc={'chatInteraction':require(_0x231c('0x2')),'openchannelInteraction':require(_0x231c('0x3')),'smsInteraction':require(_0x231c('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x231c('0x5'))};exports[_0x231c('0x6')]=function(_0x84181,_0x27c409,_0x43dc8d,_0x3323b1){return function(_0x2c1394){try{logger[_0x231c('0x7')](_0x231c('0x8'),_0x84181,_0x27c409[0x0]);var _0x10af99={'closed':0x1,'closedAt':moment()[_0x231c('0x9')](_0x231c('0xa')),'closeReason':_0x231c('0xb'),'disposition':_0x27c409[0x0]};if(rpc[_0x3323b1[_0x231c('0xc')]+'Interaction']){rpc[_0x3323b1[_0x231c('0xc')]+'Interaction'][_0x231c('0xd')](_0x3323b1[_0x231c('0xe')]['id'],_0x10af99)[_0x231c('0xf')](function(_0x4e9358){logger[_0x231c('0x7')](_0x231c('0x10'),_0x84181,_0x3323b1['interaction']['id']);})['catch'](function(_0x2c01c4){logger[_0x231c('0x11')](_0x231c('0x12'),_0x84181,JSON[_0x231c('0x13')](_0x2c01c4));})[_0x231c('0x14')](function(){_0x2c1394[_0x231c('0x15')]();});}}catch(_0x4a6dfa){logger[_0x231c('0x11')](_0x231c('0x12'),_0x84181,JSON[_0x231c('0x13')](_0x4a6dfa));_0x2c1394[_0x231c('0x15')]();}};}; \ No newline at end of file +var _0x1b98=['stop','error','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s'];(function(_0x45128c,_0x196bc6){var _0x3122f9=function(_0x5c5a46){while(--_0x5c5a46){_0x45128c['push'](_0x45128c['shift']());}};_0x3122f9(++_0x196bc6);}(_0x1b98,0x1cf));var _0x81b9=function(_0x1d79f0,_0x107a3d){_0x1d79f0=_0x1d79f0-0x0;var _0x558285=_0x1b98[_0x1d79f0];return _0x558285;};'use strict';var moment=require(_0x81b9('0x0'));var logger=require(_0x81b9('0x1'))(_0x81b9('0x2'));var rpc={'chatInteraction':require(_0x81b9('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x81b9('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x81b9('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x81b9('0x6')]=function(_0x4fa678,_0x377ceb,_0xb0b8da,_0x168b9e){return function(_0x4ff633){try{logger['info'](_0x81b9('0x7'),_0x4fa678,_0x377ceb[0x0]);var _0x25c664={'closed':0x1,'closedAt':moment()[_0x81b9('0x8')](_0x81b9('0x9')),'closeReason':_0x81b9('0xa'),'disposition':_0x377ceb[0x0]};if(rpc[_0x168b9e[_0x81b9('0xb')]+'Interaction']){rpc[_0x168b9e['channel']+_0x81b9('0xc')][_0x81b9('0xd')](_0x168b9e[_0x81b9('0xe')]['id'],_0x25c664)[_0x81b9('0xf')](function(_0x3900ff){logger[_0x81b9('0x10')](_0x81b9('0x11'),_0x4fa678,_0x168b9e[_0x81b9('0xe')]['id']);})[_0x81b9('0x12')](function(_0x292476){logger['error'](_0x81b9('0x13'),_0x4fa678,JSON['stringify'](_0x292476));})['finally'](function(){_0x4ff633[_0x81b9('0x14')]();});}}catch(_0xfe095f){logger[_0x81b9('0x15')](_0x81b9('0x13'),_0x4fa678,JSON[_0x81b9('0x16')](_0xfe095f));_0x4ff633['stop']();}};}; \ 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 ea097ef..ac83341 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 _0x297f=['stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','Message','create','endConversation','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','ChatWebsiteId','upperFirst','AccountId','created','body','getMustacheRender','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x4ed60b,_0x7d0852){var _0x53a2d2=function(_0x57019e){while(--_0x57019e){_0x4ed60b['push'](_0x4ed60b['shift']());}};_0x53a2d2(++_0x7d0852);}(_0x297f,0x1f0));var _0xf297=function(_0x58235b,_0xb2ad23){_0x58235b=_0x58235b-0x0;var _0x390dde=_0x297f[_0x58235b];return _0x390dde;};'use strict';var _=require(_0xf297('0x0'));var moment=require(_0xf297('0x1'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xf297('0x2'));var logger=require(_0xf297('0x3'))(_0xf297('0x4'));var rpc={'chatMessage':require(_0xf297('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf297('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf297('0x7')),'whatsappMessage':require(_0xf297('0x8'))};exports[_0xf297('0x9')]=function(_0x4bb956,_0x4a3862){return function(_0x302320){try{if(!_[_0xf297('0xa')](this[_0xf297('0xb')]['UserId'])){logger[_0xf297('0xc')](_0xf297('0xd'),_0x4bb956,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x302320[_0xf297('0xe')]();}var _0x481d0d={'ContactId':this[_0xf297('0xf')]['id'],'sentAt':moment()[_0xf297('0x10')](_0xf297('0x11')),'direction':'out'};if(this[_0xf297('0x12')]==='sms'||this[_0xf297('0x12')]==='whatsapp'){_0x481d0d['phone']=this[_0xf297('0xb')][_0xf297('0x13')];}var _0x1f0459=this[_0xf297('0x12')];if(_0x1f0459===_0xf297('0x14')){_0x481d0d[_0xf297('0x15')]=this['account']['id'];}else{_0x481d0d[_[_0xf297('0x16')](_0x1f0459)+_0xf297('0x17')]=this['account']['id'];}_0x481d0d[_[_0xf297('0x16')](_0x1f0459)+'InteractionId']=this[_0xf297('0xb')]['id'];if(this[_0xf297('0xb')][_0xf297('0x18')]){var _0x4cc9a4=_0x4a3862[0x2];if(!_['isEmpty'](_0x4cc9a4)){_0x481d0d[_0xf297('0x19')]=utils[_0xf297('0x1a')](_0x4cc9a4,this);return rpc[_0x1f0459+'Message']['create'](_0x481d0d)[_0xf297('0x1b')](function(_0x1932df){logger['info'](_0xf297('0xd'),_0x4bb956,_0x481d0d[_0xf297('0x19')]);})[_0xf297('0x1c')](function(_0x480c10){logger[_0xf297('0x1d')](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x480c10));})['finally'](function(){logger[_0xf297('0xc')](_0xf297('0x1f'),_0x4bb956);_0x302320[_0xf297('0x20')]();});}else{logger['info'](_0xf297('0x21'),_0x4bb956);_0x302320[_0xf297('0x20')]();}}else{var _0x4023a3=this;var _0x4cf7f7=apiai(_0x4a3862[0x0],{'language':_0x4a3862[0x1]||'en'});return _0x4cf7f7[_0xf297('0x22')](this[_0xf297('0x23')][_0xf297('0x19')],{'sessionId':md5(this[_0xf297('0xb')]['id'])})['then'](function(_0x27265c){_0x4023a3['body'][_0xf297('0x24')]=_0x27265c;_0x481d0d[_0xf297('0x19')]=_0x27265c[_0xf297('0x25')][_0xf297('0x26')][_0xf297('0x27')];_0x481d0d['providerName']='dialogflow';_0x481d0d[_0xf297('0x28')]=JSON[_0xf297('0x1e')](_0x27265c);return rpc[_0x1f0459+_0xf297('0x29')][_0xf297('0x2a')](_0x481d0d)[_0xf297('0x1b')](function(_0x456573){logger['info'](_0xf297('0xd'),_0x4bb956,_0x481d0d['body']);if(_0x27265c['result']['metadata'][_0xf297('0x2b')]){_0x302320[_0xf297('0xe')]();}else{_0x302320[_0xf297('0x20')]();}})[_0xf297('0x1c')](function(_0x2cdfc6){logger['error'](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x2cdfc6));_0x302320['next']();});})[_0xf297('0x1c')](function(_0x38a4f6){logger[_0xf297('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x4bb956,_0x38a4f6[_0xf297('0x23')]);_0x302320[_0xf297('0xe')]();});}}catch(_0x2be167){logger['error'](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x2be167));_0x302320['stop']();}};}; \ No newline at end of file +var _0x8daf=['isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','then','[%s][DIALOGFLOW]\x20%s','body','catch','error','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','result','fulfillment','speech','dialogflow','providerResponse','create','info','metadata','endConversation','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence'];(function(_0x6d67a7,_0xf4936){var _0x146e0d=function(_0x4e5ccb){while(--_0x4e5ccb){_0x6d67a7['push'](_0x6d67a7['shift']());}};_0x146e0d(++_0xf4936);}(_0x8daf,0x15c));var _0xf8da=function(_0x24579a,_0x59612d){_0x24579a=_0x24579a-0x0;var _0x59dff7=_0x8daf[_0x24579a];return _0x59dff7;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xf8da('0x0'));var logger=require(_0xf8da('0x1'))('routing');var rpc={'chatMessage':require(_0xf8da('0x2')),'openchannelMessage':require(_0xf8da('0x3')),'mailMessage':require(_0xf8da('0x4')),'smsMessage':require(_0xf8da('0x5')),'faxMessage':require(_0xf8da('0x6')),'whatsappMessage':require(_0xf8da('0x7'))};exports[_0xf8da('0x8')]=function(_0x4565a9,_0xef5c26){return function(_0x585e0c){try{if(!_[_0xf8da('0x9')](this['interaction'][_0xf8da('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x4565a9,_0xf8da('0xb'));return _0x585e0c[_0xf8da('0xc')]();}var _0xbd4f48={'ContactId':this[_0xf8da('0xd')]['id'],'sentAt':moment()[_0xf8da('0xe')](_0xf8da('0xf')),'direction':_0xf8da('0x10')};if(this[_0xf8da('0x11')]==='sms'||this[_0xf8da('0x11')]===_0xf8da('0x12')){_0xbd4f48[_0xf8da('0x13')]=this[_0xf8da('0x14')]['phone'];}var _0x26deca=this['channel'];if(_0x26deca===_0xf8da('0x15')){_0xbd4f48[_0xf8da('0x16')]=this[_0xf8da('0x17')]['id'];}else{_0xbd4f48[_[_0xf8da('0x18')](_0x26deca)+_0xf8da('0x19')]=this['account']['id'];}_0xbd4f48[_[_0xf8da('0x18')](_0x26deca)+_0xf8da('0x1a')]=this[_0xf8da('0x14')]['id'];if(this[_0xf8da('0x14')][_0xf8da('0x1b')]){var _0x41257e=_0xef5c26[0x2];if(!_[_0xf8da('0x1c')](_0x41257e)){_0xbd4f48['body']=utils[_0xf8da('0x1d')](_0x41257e,this);return rpc[_0x26deca+'Message']['create'](_0xbd4f48)[_0xf8da('0x1e')](function(_0x2611c2){logger['info'](_0xf8da('0x1f'),_0x4565a9,_0xbd4f48[_0xf8da('0x20')]);})[_0xf8da('0x21')](function(_0x73afe5){logger[_0xf8da('0x22')](_0xf8da('0x1f'),_0x4565a9,JSON[_0xf8da('0x23')](_0x73afe5));})[_0xf8da('0x24')](function(){logger['info'](_0xf8da('0x25'),_0x4565a9);_0x585e0c[_0xf8da('0x26')]();});}else{logger['info'](_0xf8da('0x27'),_0x4565a9);_0x585e0c[_0xf8da('0x26')]();}}else{var _0x4ca909=this;var _0x5a295f=apiai(_0xef5c26[0x0],{'language':_0xef5c26[0x1]||'en'});return _0x5a295f[_0xf8da('0x28')](this[_0xf8da('0x29')][_0xf8da('0x20')],{'sessionId':md5(this[_0xf8da('0x14')]['id'])})['then'](function(_0x4f7ceb){_0x4ca909['body']['dialogflow']=_0x4f7ceb;_0xbd4f48[_0xf8da('0x20')]=_0x4f7ceb[_0xf8da('0x2a')][_0xf8da('0x2b')][_0xf8da('0x2c')];_0xbd4f48['providerName']=_0xf8da('0x2d');_0xbd4f48[_0xf8da('0x2e')]=JSON[_0xf8da('0x23')](_0x4f7ceb);return rpc[_0x26deca+'Message'][_0xf8da('0x2f')](_0xbd4f48)['then'](function(_0x2c0866){logger[_0xf8da('0x30')](_0xf8da('0x1f'),_0x4565a9,_0xbd4f48[_0xf8da('0x20')]);if(_0x4f7ceb[_0xf8da('0x2a')][_0xf8da('0x31')][_0xf8da('0x32')]){_0x585e0c[_0xf8da('0xc')]();}else{_0x585e0c['stop']();}})[_0xf8da('0x21')](function(_0x552ed3){logger['error'](_0xf8da('0x1f'),_0x4565a9,JSON[_0xf8da('0x23')](_0x552ed3));_0x585e0c[_0xf8da('0xc')]();});})[_0xf8da('0x21')](function(_0x41cee6){logger['error'](_0xf8da('0x1f'),_0x4565a9,_0x41cee6['message']);_0x585e0c['next']();});}}catch(_0x5eda69){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4565a9,JSON[_0xf8da('0x23')](_0x5eda69));_0x585e0c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 634ee36..c44d584 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 _0xdd78=['format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','upperFirst','AccountId','account','created','stringify','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','length','push','fulfillmentText','all','error','message','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x3e1bac,_0x1b9b0b){var _0x3d4708=function(_0x11144b){while(--_0x11144b){_0x3e1bac['push'](_0x3e1bac['shift']());}};_0x3d4708(++_0x1b9b0b);}(_0xdd78,0x103));var _0x8dd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd78[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd7('0x0'));var dialogflow=require(_0x8dd7('0x1'));var md5=require(_0x8dd7('0x2'));var moment=require('moment');var Promise=require(_0x8dd7('0x3'));var logger=require(_0x8dd7('0x4'))(_0x8dd7('0x5'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8dd7('0x6')),'mailMessage':require(_0x8dd7('0x7')),'smsMessage':require(_0x8dd7('0x8')),'faxMessage':require(_0x8dd7('0x9')),'whatsappMessage':require(_0x8dd7('0xa'))};function createMessage(_0x5b47b6,_0x15e53e,_0x23da3e,_0x537a64){return new Promise(function(_0x472098,_0x4520d4){var _0x26582b=_[_0x8dd7('0xb')](_0x23da3e);_0x26582b['body']=_0x537a64;return rpc[_0x15e53e+'Message'][_0x8dd7('0xc')](_0x26582b)[_0x8dd7('0xd')](function(){logger[_0x8dd7('0xe')](_0x8dd7('0xf'),_0x5b47b6,_0x26582b[_0x8dd7('0x10')]);_0x472098();})[_0x8dd7('0x11')](function(_0x4bc1a1){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5b47b6,JSON['stringify'](_0x4bc1a1));_0x4520d4(_0x4bc1a1);});});}exports[_0x8dd7('0x12')]=function(_0x8f349c,_0x5b4d6b){return function(_0x5b7025){try{if(!_[_0x8dd7('0x13')](this[_0x8dd7('0x14')][_0x8dd7('0x15')])){logger[_0x8dd7('0xe')](_0x8dd7('0xf'),_0x8f349c,_0x8dd7('0x16'));return _0x5b7025[_0x8dd7('0x17')]();}var _0x1998ea={'ContactId':this[_0x8dd7('0x18')]['id'],'sentAt':moment()[_0x8dd7('0x19')](_0x8dd7('0x1a')),'direction':_0x8dd7('0x1b')};if(this[_0x8dd7('0x1c')]==='sms'||this[_0x8dd7('0x1c')]===_0x8dd7('0x1d')){_0x1998ea[_0x8dd7('0x1e')]=this[_0x8dd7('0x14')][_0x8dd7('0x1e')];}var _0x5b2199=this['channel'];if(_0x5b2199===_0x8dd7('0x1f')){_0x1998ea['ChatWebsiteId']=this['account']['id'];}else{_0x1998ea[_[_0x8dd7('0x20')](_0x5b2199)+_0x8dd7('0x21')]=this[_0x8dd7('0x22')]['id'];}_0x1998ea[_[_0x8dd7('0x20')](_0x5b2199)+'InteractionId']=this[_0x8dd7('0x14')]['id'];if(this[_0x8dd7('0x14')][_0x8dd7('0x23')]){var _0xfa2ecf=_0x5b4d6b[0x4];if(!_['isEmpty'](_0xfa2ecf)){_0x1998ea[_0x8dd7('0x10')]=utils['getMustacheRender'](_0xfa2ecf,this);return rpc[_0x5b2199+'Message'][_0x8dd7('0xc')](_0x1998ea)['then'](function(_0x59216c){logger[_0x8dd7('0xe')](_0x8dd7('0xf'),_0x8f349c,_0x1998ea[_0x8dd7('0x10')]);})[_0x8dd7('0x11')](function(_0x53c567){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x8f349c,JSON[_0x8dd7('0x24')](_0x53c567));})['finally'](function(){logger[_0x8dd7('0xe')](_0x8dd7('0x25'),_0x8f349c);_0x5b7025[_0x8dd7('0x26')]();});}else{logger[_0x8dd7('0xe')](_0x8dd7('0x27'),_0x8f349c);_0x5b7025[_0x8dd7('0x26')]();}}else{var _0x49a69e=this;var _0x31e93f=_0x5b4d6b[0x2][_0x8dd7('0x28')](/\\n/g,'\x0a');var _0x10bb4d={'credentials':{'private_key':_0x31e93f,'client_email':_0x5b4d6b[0x1]}};var _0x38e1d4=new dialogflow[(_0x8dd7('0x29'))](_0x10bb4d);var _0x257fec=_0x38e1d4['sessionPath'](_0x5b4d6b[0x0],md5(_0x49a69e[_0x8dd7('0x14')]['id']));var _0x2995b3={'session':_0x257fec,'queryInput':{'text':{'text':_0x49a69e['message']['body'],'languageCode':_0x5b4d6b[0x3]||'en'}}};return _0x38e1d4[_0x8dd7('0x2a')](_0x2995b3)['then'](function(_0x406f35){if(_0x406f35&&_0x406f35['length']){_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x2b')]=_0x406f35;var _0x4b4497=_0x406f35[0x0];var _0x2fbb79=_0x4b4497[_0x8dd7('0x2c')]['diagnosticInfo']&&_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x2d')][_0x8dd7('0x2e')]?_0x4b4497[_0x8dd7('0x2c')]['diagnosticInfo'][_0x8dd7('0x2e')][_0x8dd7('0x2f')][_0x8dd7('0x30')]:![];_0x49a69e['body'][_0x8dd7('0x31')]=_0x4b4497[_0x8dd7('0x2c')]['action'];_0x49a69e['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x32')];_0x49a69e['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x4b4497['queryResult'][_0x8dd7('0x2d')]&&_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x2d')][_0x8dd7('0x2e')]?_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x2d')][_0x8dd7('0x2e')][_0x8dd7('0x2f')][_0x8dd7('0x30')]:![];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x33')]=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x34')][_0x8dd7('0x35')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x36')]=_0x4b4497[_0x8dd7('0x2c')]['intent'][_0x8dd7('0x37')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x38')]=_0x4b4497[_0x8dd7('0x2c')]['intent'][_0x8dd7('0x39')];_0x49a69e[_0x8dd7('0x10')]['DIALOGFLOWV2_LANGUAGECODE']=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x3a')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x3b')]=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x3c')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x3d')]=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x3e')];_0x1998ea['providerName']=_0x8dd7('0x2b');_0x1998ea[_0x8dd7('0x3f')]=JSON['stringify'](_0x406f35);var _0x3791a1=[];for(var _0x2f7716=0x0;_0x2f7716<_0x406f35[_0x8dd7('0x40')];_0x2f7716++){var _0x5db704=_0x406f35[_0x2f7716];if(_0x5db704&&_0x5db704['queryResult']&&_0x5db704[_0x8dd7('0x2c')]['fulfillmentText']){_0x3791a1[_0x8dd7('0x41')](createMessage(_0x8f349c,_0x5b2199,_0x1998ea,_0x5db704[_0x8dd7('0x2c')][_0x8dd7('0x42')]));}}return Promise[_0x8dd7('0x43')](_0x3791a1)[_0x8dd7('0xd')](function(){if(_0x2fbb79){_0x5b7025['next']();}else{_0x5b7025[_0x8dd7('0x26')]();}})[_0x8dd7('0x11')](function(_0x126285){logger['error'](_0x8dd7('0xf'),_0x8f349c,JSON[_0x8dd7('0x24')](_0x126285));_0x5b7025[_0x8dd7('0x17')]();});}})[_0x8dd7('0x11')](function(_0x2f962c){logger[_0x8dd7('0x44')](_0x8dd7('0xf'),_0x8f349c,_0x2f962c[_0x8dd7('0x45')],_0x2f962c[_0x8dd7('0x46')]);_0x5b7025['next']();});}}catch(_0x2152f3){logger[_0x8dd7('0x44')](_0x8dd7('0xf'),_0x8f349c,JSON[_0x8dd7('0x24')](_0x2152f3));_0x5b7025[_0x8dd7('0x26')]();}};}; \ No newline at end of file +var _0x4853=['whatsapp','phone','chat','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','create','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','diagnosticInfo','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','all','stop','stack','lodash','dialogflow','moment','bluebird','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel'];(function(_0x5eba00,_0x5990b5){var _0x1b516a=function(_0x3df89c){while(--_0x3df89c){_0x5eba00['push'](_0x5eba00['shift']());}};_0x1b516a(++_0x5990b5);}(_0x4853,0x1c3));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x3485('0x0'));var dialogflow=require(_0x3485('0x1'));var md5=require('md5');var moment=require(_0x3485('0x2'));var Promise=require(_0x3485('0x3'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x3485('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3485('0x5')),'mailMessage':require(_0x3485('0x6')),'smsMessage':require(_0x3485('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x3485('0x8'))};function createMessage(_0x4ed30a,_0x28c155,_0x4b396e,_0x14ae2a){return new Promise(function(_0x4441b0,_0x51b12c){var _0x4647b0=_[_0x3485('0x9')](_0x4b396e);_0x4647b0[_0x3485('0xa')]=_0x14ae2a;return rpc[_0x28c155+_0x3485('0xb')]['create'](_0x4647b0)['then'](function(){logger[_0x3485('0xc')](_0x3485('0xd'),_0x4ed30a,_0x4647b0[_0x3485('0xa')]);_0x4441b0();})[_0x3485('0xe')](function(_0x4677e2){logger[_0x3485('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x4ed30a,JSON[_0x3485('0x10')](_0x4677e2));_0x51b12c(_0x4677e2);});});}exports[_0x3485('0x11')]=function(_0x4e5ad4,_0x537694){return function(_0x351f46){try{if(!_[_0x3485('0x12')](this[_0x3485('0x13')]['UserId'])){logger[_0x3485('0xc')](_0x3485('0xd'),_0x4e5ad4,_0x3485('0x14'));return _0x351f46[_0x3485('0x15')]();}var _0x21df68={'ContactId':this[_0x3485('0x16')]['id'],'sentAt':moment()[_0x3485('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']==='sms'||this[_0x3485('0x18')]===_0x3485('0x19')){_0x21df68[_0x3485('0x1a')]=this[_0x3485('0x13')]['phone'];}var _0x35488d=this[_0x3485('0x18')];if(_0x35488d===_0x3485('0x1b')){_0x21df68['ChatWebsiteId']=this[_0x3485('0x1c')]['id'];}else{_0x21df68[_[_0x3485('0x1d')](_0x35488d)+_0x3485('0x1e')]=this[_0x3485('0x1c')]['id'];}_0x21df68[_[_0x3485('0x1d')](_0x35488d)+'InteractionId']=this[_0x3485('0x13')]['id'];if(this[_0x3485('0x13')][_0x3485('0x1f')]){var _0x27007b=_0x537694[0x4];if(!_[_0x3485('0x20')](_0x27007b)){_0x21df68[_0x3485('0xa')]=utils[_0x3485('0x21')](_0x27007b,this);return rpc[_0x35488d+_0x3485('0xb')][_0x3485('0x22')](_0x21df68)[_0x3485('0x23')](function(_0x2a8931){logger[_0x3485('0xc')](_0x3485('0xd'),_0x4e5ad4,_0x21df68[_0x3485('0xa')]);})['catch'](function(_0x49140c){logger[_0x3485('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x4e5ad4,JSON['stringify'](_0x49140c));})[_0x3485('0x24')](function(){logger[_0x3485('0xc')](_0x3485('0x25'),_0x4e5ad4);_0x351f46['stop']();});}else{logger[_0x3485('0xc')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4e5ad4);_0x351f46['stop']();}}else{var _0x14389a=this;var _0x57f948=_0x537694[0x2]['replace'](/\\n/g,'\x0a');var _0x128d7e={'credentials':{'private_key':_0x57f948,'client_email':_0x537694[0x1]}};var _0x2bffe7=new dialogflow[(_0x3485('0x26'))](_0x128d7e);var _0x135821=_0x2bffe7[_0x3485('0x27')](_0x537694[0x0],md5(_0x14389a[_0x3485('0x13')]['id']));var _0x5c610c={'session':_0x135821,'queryInput':{'text':{'text':_0x14389a[_0x3485('0x28')][_0x3485('0xa')],'languageCode':_0x537694[0x3]||'en'}}};return _0x2bffe7[_0x3485('0x29')](_0x5c610c)[_0x3485('0x23')](function(_0x42e3bd){if(_0x42e3bd&&_0x42e3bd[_0x3485('0x2a')]){_0x14389a['body'][_0x3485('0x2b')]=_0x42e3bd;var _0x215f9c=_0x42e3bd[0x0];var _0x4c3d91=_0x215f9c[_0x3485('0x2c')]['diagnosticInfo']&&_0x215f9c[_0x3485('0x2c')]['diagnosticInfo'][_0x3485('0x2d')]?_0x215f9c[_0x3485('0x2c')]['diagnosticInfo'][_0x3485('0x2d')][_0x3485('0x2e')][_0x3485('0x2f')]:![];_0x14389a[_0x3485('0xa')][_0x3485('0x30')]=_0x215f9c[_0x3485('0x2c')][_0x3485('0x31')];_0x14389a[_0x3485('0xa')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x215f9c['queryResult'][_0x3485('0x32')];_0x14389a[_0x3485('0xa')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x215f9c[_0x3485('0x2c')][_0x3485('0x33')]&&_0x215f9c[_0x3485('0x2c')]['diagnosticInfo'][_0x3485('0x2d')]?_0x215f9c[_0x3485('0x2c')][_0x3485('0x33')][_0x3485('0x2d')][_0x3485('0x2e')][_0x3485('0x2f')]:![];_0x14389a[_0x3485('0xa')][_0x3485('0x34')]=_0x215f9c[_0x3485('0x2c')]['intent'][_0x3485('0x35')];_0x14389a[_0x3485('0xa')][_0x3485('0x36')]=_0x215f9c[_0x3485('0x2c')][_0x3485('0x37')][_0x3485('0x38')];_0x14389a[_0x3485('0xa')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x215f9c[_0x3485('0x2c')]['intent'][_0x3485('0x39')];_0x14389a['body'][_0x3485('0x3a')]=_0x215f9c[_0x3485('0x2c')][_0x3485('0x3b')];_0x14389a['body']['DIALOGFLOWV2_QUERYTEXT']=_0x215f9c[_0x3485('0x2c')]['queryText'];_0x14389a['body'][_0x3485('0x3c')]=_0x215f9c[_0x3485('0x2c')][_0x3485('0x3d')];_0x21df68[_0x3485('0x3e')]='dialogflowV2';_0x21df68['providerResponse']=JSON[_0x3485('0x10')](_0x42e3bd);var _0x36d021=[];for(var _0x4ad659=0x0;_0x4ad659<_0x42e3bd['length'];_0x4ad659++){var _0x14cd14=_0x42e3bd[_0x4ad659];if(_0x14cd14&&_0x14cd14[_0x3485('0x2c')]&&_0x14cd14['queryResult'][_0x3485('0x3f')]){_0x36d021[_0x3485('0x40')](createMessage(_0x4e5ad4,_0x35488d,_0x21df68,_0x14cd14[_0x3485('0x2c')][_0x3485('0x3f')]));}}return Promise[_0x3485('0x41')](_0x36d021)[_0x3485('0x23')](function(){if(_0x4c3d91){_0x351f46['next']();}else{_0x351f46[_0x3485('0x42')]();}})[_0x3485('0xe')](function(_0x46bbaa){logger[_0x3485('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x4e5ad4,JSON[_0x3485('0x10')](_0x46bbaa));_0x351f46[_0x3485('0x15')]();});}})[_0x3485('0xe')](function(_0x22dcf3){logger[_0x3485('0xf')](_0x3485('0xd'),_0x4e5ad4,_0x22dcf3['message'],_0x22dcf3[_0x3485('0x43')]);_0x351f46['next']();});}}catch(_0x4a4dcb){logger['error'](_0x3485('0xd'),_0x4e5ad4,JSON[_0x3485('0x10')](_0x4a4dcb));_0x351f46[_0x3485('0x42')]();}};}; \ 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 65bc034..588fdb2 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 _0xb2c6=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityFalse'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xb2c6,0xf1));var _0x6b2c=function(_0x1b178a,_0x1ed6ac){_0x1b178a=_0x1b178a-0x0;var _0x3d7a5a=_0xb2c6[_0x1b178a];return _0x3d7a5a;};'use strict';var schema=require(_0x6b2c('0x0'));var _=require(_0x6b2c('0x1'));var htmlToText=require(_0x6b2c('0x2'));var utils=require(_0x6b2c('0x3'));var logger=require(_0x6b2c('0x4'))(_0x6b2c('0x5'));var gotoif=schema({'condition':{'type':_0x6b2c('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x6b2c('0x7'),'message':_0x6b2c('0x8')},'priorityFalse':{'type':_0x6b2c('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x6b2c('0x9')]=function(_0x56346a,_0x1ff762){return function(_0x29bf97){try{var _0x7149bc={'condition':htmlToText[_0x6b2c('0xa')](utils['getMustacheRender'](_0x1ff762[0x0],this),{'wordwrap':![]})[_0x6b2c('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ff762[0x1],'priorityFalse':_0x1ff762[0x2]};var _0x49601c=gotoif['validate'](_0x7149bc,{'typecast':!![]});if(_0x49601c[_0x6b2c('0xc')]){logger[_0x6b2c('0xd')](_0x6b2c('0xe'),_0x56346a,_[_0x6b2c('0xf')](_0x49601c,_0x6b2c('0x10'))[_0x6b2c('0x11')](',\x20'));_0x29bf97[_0x6b2c('0x12')]();}else{try{var _0x29ea8f=eval('('+_0x7149bc['condition']+')');var _0x2be51e=_0x29ea8f?_0x7149bc['priorityTrue']:_0x7149bc[_0x6b2c('0x13')];logger[_0x6b2c('0x14')](_0x6b2c('0x15'),_0x56346a,_0x7149bc[_0x6b2c('0x16')],_0x29ea8f,_0x2be51e||_0x6b2c('0x17'));if(_0x2be51e){var _0x22e090=_['findIndex'](_0x29bf97[_0x6b2c('0x18')](),{'p':_0x2be51e});if(_0x22e090>=0x0){logger[_0x6b2c('0x14')](_0x6b2c('0x19'),_0x56346a,_0x2be51e||_0x6b2c('0x17'),_0x22e090);_0x29bf97[_0x6b2c('0x17')](_0x22e090);}else{logger[_0x6b2c('0x14')](_0x6b2c('0x1a'),_0x56346a,_0x2be51e||_0x6b2c('0x17'));_0x29bf97['stop']();}}else{_0x29bf97['next']();}}catch(_0x48e115){logger['error'](_0x6b2c('0x1b'),_0x56346a,_0x48e115[_0x6b2c('0x10')]);_0x29bf97['stop']();}}}catch(_0x1544f7){logger[_0x6b2c('0xd')](_0x6b2c('0xe'),_0x56346a,JSON[_0x6b2c('0x1c')](_0x1544f7));_0x29bf97[_0x6b2c('0x12')]();}};}; \ No newline at end of file +var _0xcf06=['rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','fromString','getMustacheRender','length','error','map','message','stop','condition','priorityTrue','priorityFalse','next','findIndex'];(function(_0x4c033d,_0x44bd2b){var _0x21e478=function(_0x5ef075){while(--_0x5ef075){_0x4c033d['push'](_0x4c033d['shift']());}};_0x21e478(++_0x44bd2b);}(_0xcf06,0x1d7));var _0x6cf0=function(_0x56210f,_0x1f1e19){_0x56210f=_0x56210f-0x0;var _0x1d525=_0xcf06[_0x56210f];return _0x1d525;};'use strict';var schema=require(_0x6cf0('0x0'));var _=require(_0x6cf0('0x1'));var htmlToText=require(_0x6cf0('0x2'));var utils=require(_0x6cf0('0x3'));var logger=require(_0x6cf0('0x4'))(_0x6cf0('0x5'));var gotoif=schema({'condition':{'type':_0x6cf0('0x6'),'required':!![],'message':_0x6cf0('0x7')},'priorityTrue':{'type':_0x6cf0('0x8'),'message':_0x6cf0('0x9')},'priorityFalse':{'type':_0x6cf0('0x8'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x378a35,_0x55d5e7){return function(_0x1fc08e){try{var _0x28e5c1={'condition':htmlToText[_0x6cf0('0xa')](utils[_0x6cf0('0xb')](_0x55d5e7[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x55d5e7[0x1],'priorityFalse':_0x55d5e7[0x2]};var _0x4d7f28=gotoif[_0x6cf0('0x0')](_0x28e5c1,{'typecast':!![]});if(_0x4d7f28[_0x6cf0('0xc')]){logger[_0x6cf0('0xd')]('[%s][GOTOIF]\x20%s',_0x378a35,_[_0x6cf0('0xe')](_0x4d7f28,_0x6cf0('0xf'))['join'](',\x20'));_0x1fc08e[_0x6cf0('0x10')]();}else{try{var _0x1306fe=eval('('+_0x28e5c1[_0x6cf0('0x11')]+')');var _0x2a3420=_0x1306fe?_0x28e5c1[_0x6cf0('0x12')]:_0x28e5c1[_0x6cf0('0x13')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x378a35,_0x28e5c1[_0x6cf0('0x11')],_0x1306fe,_0x2a3420||_0x6cf0('0x14'));if(_0x2a3420){var _0x419158=_[_0x6cf0('0x15')](_0x1fc08e[_0x6cf0('0x16')](),{'p':_0x2a3420});if(_0x419158>=0x0){logger[_0x6cf0('0x17')](_0x6cf0('0x18'),_0x378a35,_0x2a3420||_0x6cf0('0x14'),_0x419158);_0x1fc08e['next'](_0x419158);}else{logger['info'](_0x6cf0('0x19'),_0x378a35,_0x2a3420||_0x6cf0('0x14'));_0x1fc08e['stop']();}}else{_0x1fc08e['next']();}}catch(_0x32c704){logger[_0x6cf0('0xd')](_0x6cf0('0x1a'),_0x378a35,_0x32c704['message']);_0x1fc08e[_0x6cf0('0x10')]();}}}catch(_0x515085){logger['error'](_0x6cf0('0x1b'),_0x378a35,JSON[_0x6cf0('0x1c')](_0x515085));_0x1fc08e[_0x6cf0('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 7cac62d..ec14ad0 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 _0x70b2=['error','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x47d8da,_0x4c6f3b){var _0x1eb3b7=function(_0x7f0178){while(--_0x7f0178){_0x47d8da['push'](_0x47d8da['shift']());}};_0x1eb3b7(++_0x4c6f3b);}(_0x70b2,0x1b6));var _0x270b=function(_0x3fdcb9,_0x4013d9){_0x3fdcb9=_0x3fdcb9-0x0;var _0x269d5b=_0x70b2[_0x3fdcb9];return _0x269d5b;};'use strict';var schema=require(_0x270b('0x0'));var _=require(_0x270b('0x1'));var logger=require('../../../../config/logger')(_0x270b('0x2'));var gotop=schema({'priority':{'type':_0x270b('0x3'),'required':!![],'message':_0x270b('0x4')}});exports[_0x270b('0x5')]=function(_0x39b51a,_0x486a8e){return function(_0x239cb4){try{var _0x491c9e={'priority':_0x486a8e[0x0]};var _0x24cc9f=gotop[_0x270b('0x0')](_0x491c9e,{'typecast':!![]});if(_0x24cc9f['length']){logger['error'](_0x270b('0x6'),_0x39b51a,_[_0x270b('0x7')](_0x24cc9f,_0x270b('0x8'))[_0x270b('0x9')](',\x20'));_0x239cb4[_0x270b('0xa')]();}else{logger['info'](_0x270b('0xb'),_0x39b51a,_0x491c9e['priority']);if(_0x491c9e[_0x270b('0xc')]){var _0x325733=_['findIndex'](_0x239cb4[_0x270b('0xd')](),{'p':_0x491c9e['priority']});if(_0x325733>=0x0){logger[_0x270b('0xe')](_0x270b('0xf'),_0x39b51a,_0x491c9e['priority']||_0x270b('0x10'),_0x325733);_0x239cb4[_0x270b('0x10')](_0x325733);}else{logger[_0x270b('0xe')](_0x270b('0x11'),_0x39b51a,_0x491c9e[_0x270b('0xc')]||_0x270b('0x10'));_0x239cb4['stop']();}}else{_0x239cb4[_0x270b('0x10')]();}}}catch(_0x2a400d){logger[_0x270b('0x12')](_0x270b('0x6'),_0x39b51a,JSON['stringify'](_0x2a400d));_0x239cb4[_0x270b('0xa')]();}};}; \ No newline at end of file +var _0xad60=['lodash','../../../../config/logger','routing','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0xad60,0x1da));var _0x0ad6=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xad60[_0x46e363];return _0x3fb059;};'use strict';var schema=require(_0x0ad6('0x0'));var _=require(_0x0ad6('0x1'));var logger=require(_0x0ad6('0x2'))(_0x0ad6('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x0ad6('0x4')]=function(_0x56dfbf,_0x4ebebc){return function(_0x9f2fb9){try{var _0x212418={'priority':_0x4ebebc[0x0]};var _0x4b377f=gotop['validate'](_0x212418,{'typecast':!![]});if(_0x4b377f[_0x0ad6('0x5')]){logger[_0x0ad6('0x6')](_0x0ad6('0x7'),_0x56dfbf,_['map'](_0x4b377f,_0x0ad6('0x8'))[_0x0ad6('0x9')](',\x20'));_0x9f2fb9[_0x0ad6('0xa')]();}else{logger['info'](_0x0ad6('0xb'),_0x56dfbf,_0x212418[_0x0ad6('0xc')]);if(_0x212418[_0x0ad6('0xc')]){var _0x56d8b2=_['findIndex'](_0x9f2fb9[_0x0ad6('0xd')](),{'p':_0x212418[_0x0ad6('0xc')]});if(_0x56d8b2>=0x0){logger[_0x0ad6('0xe')](_0x0ad6('0xf'),_0x56dfbf,_0x212418[_0x0ad6('0xc')]||_0x0ad6('0x10'),_0x56d8b2);_0x9f2fb9[_0x0ad6('0x10')](_0x56d8b2);}else{logger['info'](_0x0ad6('0x11'),_0x56dfbf,_0x212418[_0x0ad6('0xc')]||_0x0ad6('0x10'));_0x9f2fb9[_0x0ad6('0xa')]();}}else{_0x9f2fb9[_0x0ad6('0x10')]();}}}catch(_0x29bb68){logger[_0x0ad6('0x6')](_0x0ad6('0x7'),_0x56dfbf,JSON[_0x0ad6('0x12')](_0x29bb68));_0x9f2fb9[_0x0ad6('0xa')]();}};}; \ 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 f4cb182..12a633b 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 _0xf5fe=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','next','stringify','stop','error','lodash'];(function(_0x1ba4d1,_0x54fd0e){var _0x29a4a5=function(_0x15c9b8){while(--_0x15c9b8){_0x1ba4d1['push'](_0x1ba4d1['shift']());}};_0x29a4a5(++_0x54fd0e);}(_0xf5fe,0x1da));var _0xef5f=function(_0x252db9,_0x583db9){_0x252db9=_0x252db9-0x0;var _0x47fd16=_0xf5fe[_0x252db9];return _0x47fd16;};'use strict';var _=require(_0xef5f('0x0'));var utils=require(_0xef5f('0x1'));var logger=require(_0xef5f('0x2'))(_0xef5f('0x3'));var rpc={'chatMessage':require(_0xef5f('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xef5f('0x5')),'smsMessage':require(_0xef5f('0x6')),'faxMessage':require(_0xef5f('0x7')),'whatsappMessage':require(_0xef5f('0x8'))};exports['consequence']=function(_0x3f74ca,_0x254970){return function(_0x4bf0e6){try{var _0x3e09e5={'body':utils['getMustacheRender'](_0x254970[0x0],this),'ContactId':this['contact']['id']};if(this[_0xef5f('0x9')]===_0xef5f('0xa')){_0x3e09e5[_0xef5f('0xb')]=this[_0xef5f('0xc')]['id'];}else{_0x3e09e5[_[_0xef5f('0xd')](this[_0xef5f('0x9')])+_0xef5f('0xe')]=this[_0xef5f('0xc')]['id'];}_0x3e09e5[_[_0xef5f('0xd')](this[_0xef5f('0x9')])+_0xef5f('0xf')]=this[_0xef5f('0x10')]['id'];if(rpc[this[_0xef5f('0x9')]+_0xef5f('0x11')]){return rpc[this['channel']+_0xef5f('0x11')][_0xef5f('0x12')](_0x3e09e5)[_0xef5f('0x13')](function(_0xc7cac1){logger['info'](_0xef5f('0x14'),_0x3f74ca,_0x3e09e5['body']);_0x4bf0e6[_0xef5f('0x15')]();})['catch'](function(_0x4d5716){logger['error']('[%s][MESSAGE]\x20%s',_0x3f74ca,JSON[_0xef5f('0x16')](_0x4d5716));_0x4bf0e6[_0xef5f('0x17')]();});}}catch(_0x3ab4f9){logger[_0xef5f('0x18')]('[%s][MESSAGE]\x20%s',_0x3f74ca,JSON[_0xef5f('0x16')](_0x3ab4f9));_0x4bf0e6[_0xef5f('0x17')]();}};}; \ No newline at end of file +var _0x3306=['catch','error','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body'];(function(_0x498c9a,_0x43cd7f){var _0x63ef27=function(_0x7f9370){while(--_0x7f9370){_0x498c9a['push'](_0x498c9a['shift']());}};_0x63ef27(++_0x43cd7f);}(_0x3306,0x107));var _0x6330=function(_0x3bebc0,_0x232a27){_0x3bebc0=_0x3bebc0-0x0;var _0x1330b0=_0x3306[_0x3bebc0];return _0x1330b0;};'use strict';var _=require(_0x6330('0x0'));var utils=require(_0x6330('0x1'));var logger=require(_0x6330('0x2'))(_0x6330('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6330('0x4')),'mailMessage':require(_0x6330('0x5')),'smsMessage':require(_0x6330('0x6')),'faxMessage':require(_0x6330('0x7')),'whatsappMessage':require(_0x6330('0x8'))};exports['consequence']=function(_0x2f26ed,_0x457797){return function(_0x2942ec){try{var _0x1f164b={'body':utils[_0x6330('0x9')](_0x457797[0x0],this),'ContactId':this[_0x6330('0xa')]['id']};if(this[_0x6330('0xb')]===_0x6330('0xc')){_0x1f164b[_0x6330('0xd')]=this[_0x6330('0xe')]['id'];}else{_0x1f164b[_['upperFirst'](this[_0x6330('0xb')])+'AccountId']=this[_0x6330('0xe')]['id'];}_0x1f164b[_[_0x6330('0xf')](this[_0x6330('0xb')])+_0x6330('0x10')]=this[_0x6330('0x11')]['id'];if(rpc[this[_0x6330('0xb')]+_0x6330('0x12')]){return rpc[this[_0x6330('0xb')]+'Message']['create'](_0x1f164b)[_0x6330('0x13')](function(_0x27ff9a){logger[_0x6330('0x14')](_0x6330('0x15'),_0x2f26ed,_0x1f164b[_0x6330('0x16')]);_0x2942ec['next']();})[_0x6330('0x17')](function(_0x38367a){logger[_0x6330('0x18')](_0x6330('0x15'),_0x2f26ed,JSON['stringify'](_0x38367a));_0x2942ec['stop']();});}}catch(_0x32b59f){logger[_0x6330('0x18')](_0x6330('0x15'),_0x2f26ed,JSON['stringify'](_0x32b59f));_0x2942ec[_0x6330('0x19')]();}};}; \ 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 cd46fe5..ea30456 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 _0x434c=['error','stringify','stop','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x207140,_0x4c6556){var _0x39e8cf=function(_0x16b730){while(--_0x16b730){_0x207140['push'](_0x207140['shift']());}};_0x39e8cf(++_0x4c6556);}(_0x434c,0x174));var _0xc434=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x434c[_0x3947c9];return _0x2e7871;};'use strict';var utils=require('./utils');var logger=require(_0xc434('0x0'))(_0xc434('0x1'));exports[_0xc434('0x2')]=function(_0x434653,_0x35af86){return function(_0x2fb842){try{logger['info'](_0xc434('0x3'),_0x434653,utils[_0xc434('0x4')](_0x35af86[0x0],this));_0x2fb842[_0xc434('0x5')]();}catch(_0xd2feaf){logger[_0xc434('0x6')](_0xc434('0x3'),_0x434653,JSON[_0xc434('0x7')](_0xd2feaf));_0x2fb842[_0xc434('0x8')]();}};}; \ No newline at end of file +var _0x3824=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','./utils'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x3824,0x167));var _0x4382=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x3824[_0x261b8a];return _0x3455e8;};'use strict';var utils=require(_0x4382('0x0'));var logger=require(_0x4382('0x1'))(_0x4382('0x2'));exports[_0x4382('0x3')]=function(_0x59212b,_0x8f1bc){return function(_0x864215){try{logger[_0x4382('0x4')](_0x4382('0x5'),_0x59212b,utils[_0x4382('0x6')](_0x8f1bc[0x0],this));_0x864215['next']();}catch(_0x16bbca){logger[_0x4382('0x7')](_0x4382('0x5'),_0x59212b,JSON[_0x4382('0x8')](_0x16bbca));_0x864215['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 46fbd53..b489840 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 _0x1e42=['validate','lodash','util','moment','ioredis','../../../../config/logger','routing','redis','defaults','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','log','stack'];(function(_0x56b555,_0x5b272d){var _0x44f17a=function(_0xc2b19a){while(--_0xc2b19a){_0x56b555['push'](_0x56b555['shift']());}};_0x44f17a(++_0x5b272d);}(_0x1e42,0xa2));var _0x21e4=function(_0x25bb19,_0x5cafa2){_0x25bb19=_0x25bb19-0x0;var _0x5d4ebd=_0x1e42[_0x25bb19];return _0x5d4ebd;};'use strict';var schema=require(_0x21e4('0x0'));var _=require(_0x21e4('0x1'));var util=require(_0x21e4('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x21e4('0x3'));var Redis=require(_0x21e4('0x4'));var config=require('../../../../config/environment');var logger=require(_0x21e4('0x5'))(_0x21e4('0x6'));var strategy=require('./strategy');config[_0x21e4('0x7')]=_[_0x21e4('0x8')](config[_0x21e4('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x21e4('0x9'),_0x21e4('0xa'),_0x21e4('0xb'),_0x21e4('0xc'),_0x21e4('0xd')];function emit(_0x499fe9,_0x4ae1fd,_0x1e587e){io['to'](_0x499fe9)[_0x21e4('0xe')](_0x4ae1fd,_0x1e587e);}function emitChannelQueueInteraction(_0x2d73be,_0x63449b,_0x11790c,_0x2707e2,_0x4a94bf,_0x6ea0e8,_0x59c3f1,_0x487d7c){var _0x3203bc=_[_0x21e4('0xf')](_0x11790c);_0x3203bc[_0x21e4('0x9')]=_0x487d7c;_0x3203bc[_0x21e4('0xb')]=_0x63449b;_0x3203bc['account']=_0x2707e2;_0x3203bc['id']=_0x4a94bf;if(_0x6ea0e8){attributes[_0x21e4('0x10')](_[_0x21e4('0x11')](_0x2d73be)+_0x21e4('0x12'));_0x59c3f1[util[_0x21e4('0x13')](_0x21e4('0x14'),_0x2d73be)][_0x4a94bf]=_[_0x21e4('0x15')](_0x3203bc,attributes);}else{delete _0x59c3f1[util[_0x21e4('0x13')](_0x21e4('0x14'),_0x2d73be)][_0x4a94bf];}emit(util['format'](_0x21e4('0x16'),_0x2d73be,_0x63449b),util[_0x21e4('0x13')](_0x21e4('0x17'),_0x2d73be,_0x6ea0e8?_0x21e4('0x18'):_0x21e4('0x19')),_[_0x21e4('0x15')](_0x3203bc,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x21e4('0x1a')),'chatQueueReport':require(_0x21e4('0x1b')),'smsQueueReport':require(_0x21e4('0x1c')),'faxQueueReport':require(_0x21e4('0x1d')),'whatsappQueueReport':require(_0x21e4('0x1e'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x21e4('0x1f')},'timeout':{'type':_0x21e4('0x20'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x310bbb,_0x5a55a8,_0x4b3433,_0x23c3ac){if(_0x310bbb&&_0x5a55a8&&_0x4b3433){_0x5a55a8[_0x21e4('0x21')]+=0x1;var _0x10b572={'uniqueid':_0x310bbb,'from':_0x4b3433[_0x21e4('0x22')]?_0x4b3433['body']['from']:'','joinAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'ContactId':_0x4b3433['contact']?_0x4b3433[_0x21e4('0x24')]['id']:null,'ListId':_0x4b3433[_0x21e4('0x25')]?_0x4b3433[_0x21e4('0x25')]['id']:null};_0x10b572[_[_0x21e4('0x26')](_0x4b3433[_0x21e4('0x27')])+_0x21e4('0x28')]=_0x5a55a8['id']||null;_0x10b572[_['upperFirst'](_0x4b3433[_0x21e4('0x27')])+'InteractionId']=_0x4b3433[_0x21e4('0x29')]?_0x4b3433[_0x21e4('0x29')]['id']:null;_0x10b572[_[_0x21e4('0x26')](_0x4b3433['channel'])+_0x21e4('0x2a')]=_0x4b3433['message']?_0x4b3433[_0x21e4('0x2b')]['id']:null;_0x10b572[_[_0x21e4('0x26')](_0x4b3433[_0x21e4('0x27')])+(_0x4b3433[_0x21e4('0x27')]!==_0x21e4('0x2c')?_0x21e4('0x2d'):_0x21e4('0x2e'))]=_0x4b3433[_0x21e4('0xa')]?_0x4b3433[_0x21e4('0xa')]['id']:null;logger[_0x21e4('0x2f')](util['format'](_0x21e4('0x30'),_0x310bbb,_0x5a55a8['name']));emitChannelQueueInteraction(_0x4b3433[_0x21e4('0x27')],_0x5a55a8[_0x21e4('0x31')],_0x10b572,_0x4b3433[_0x21e4('0xa')]['name'],_0x4b3433['message']['id'],!![],_0x23c3ac,_0x5a55a8['id']);if(rpc[_0x4b3433[_0x21e4('0x27')]+_0x21e4('0x32')]){return rpc[_0x4b3433[_0x21e4('0x27')]+_0x21e4('0x32')][_0x21e4('0x33')](_0x10b572)[_0x21e4('0x34')](function(_0x1e1d62){logger[_0x21e4('0x35')]('create\x20queue\x20report');});}}}function stopRouting(_0x40abde,_0x48c32e,_0x209a4f,_0x1b9f34){if(_0x40abde&&_0x48c32e){_0x48c32e[_0x21e4('0x21')]-=0x1;var _0x562b47={'leaveAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'acceptAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'reason':_0x21e4('0x36')};logger[_0x21e4('0x2f')](util[_0x21e4('0x13')](_0x21e4('0x37'),_0x40abde,_0x48c32e[_0x21e4('0x31')]));emitChannelQueueInteraction(_0x209a4f[_0x21e4('0x27')],_0x48c32e[_0x21e4('0x31')],_0x209a4f[_0x21e4('0x22')],_0x209a4f['account'][_0x21e4('0x31')],_0x209a4f[_0x21e4('0x2b')]['id'],![],_0x1b9f34,_0x48c32e['id']);if(rpc[_0x209a4f[_0x21e4('0x27')]+'QueueReport']){return rpc[_0x209a4f[_0x21e4('0x27')]+_0x21e4('0x32')][_0x21e4('0x38')](_0x40abde,_0x562b47)[_0x21e4('0x34')](function(_0x47394a){logger[_0x21e4('0x35')](_0x21e4('0x39'));});}}}function endRouting(_0x4a8d29,_0x4ed209,_0x4687f8,_0x53c6b1){if(_0x4a8d29&&_0x4ed209){_0x4ed209[_0x21e4('0x21')]-=0x1;var _0x1ed711={'leaveAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'exitAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'reason':'timeout'};logger['info'](util[_0x21e4('0x13')](_0x21e4('0x3a'),_0x4a8d29,_0x4ed209[_0x21e4('0x31')]));emitChannelQueueInteraction(_0x4687f8[_0x21e4('0x27')],_0x4ed209[_0x21e4('0x31')],_0x4687f8[_0x21e4('0x22')],_0x4687f8[_0x21e4('0xa')][_0x21e4('0x31')],_0x4687f8['message']['id'],![],_0x53c6b1);if(rpc[_0x4687f8[_0x21e4('0x27')]+_0x21e4('0x32')]){return rpc[_0x4687f8[_0x21e4('0x27')]+_0x21e4('0x32')][_0x21e4('0x38')](_0x4a8d29,_0x1ed711)[_0x21e4('0x34')](function(_0x507111){logger[_0x21e4('0x35')](_0x21e4('0x39'));});}}}function handleFindQueue(_0x298392){return function(_0x4b291a){return _0x4b291a[_0x21e4('0x31')][_0x21e4('0x3b')]()===_0x298392[_0x21e4('0x3b')]();};}exports[_0x21e4('0x3c')]=function(_0x4bd99c,_0x13a7ee,_0x3cdb4f,_0x19cf8d){return function(_0x1ded87){try{var _0xc4d36a={'name':_0x13a7ee[0x0],'timeout':_0x13a7ee[0x1]};var _0x54395e=queue['validate'](_0xc4d36a,{'typecast':!![]});if(_0x54395e[_0x21e4('0x3d')]){logger['error'](_0x21e4('0x3e'),_0x4bd99c,_['map'](_0x54395e,'message')[_0x21e4('0x3f')](',\x20'));_0x1ded87[_0x21e4('0x40')]();}else{var _0x17c834=_[_0x21e4('0x41')](_0x3cdb4f[_0x19cf8d['channel']+_0x21e4('0x42')],handleFindQueue(_0xc4d36a['name']));if(_0x17c834){startRouting(_0x4bd99c,_0x17c834,_0x19cf8d,_0x3cdb4f);var _0x49fa4c=(_0x17c834[_0x21e4('0x43')]||0xa)*0x3e8;var _0x3eedba=(_0xc4d36a['timeout']||0x14)*0x3e8;var _0x32360a;if(_0x49fa4c>_0x3eedba){_0x3eedba=_0x49fa4c;}var _0x8f2e51=seqqueue[_0x21e4('0x44')](_0x49fa4c);_0x8f2e51['id']=_0x4bd99c;_0x8f2e51[_0x21e4('0x45')]=_0x49fa4c;_0x8f2e51[_0x21e4('0x46')]=_0x3eedba;_0x8f2e51['channel']=_0x19cf8d[_0x21e4('0x27')];_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]['on'](_0x21e4('0x48'),function(){logger[_0x21e4('0x2f')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4bd99c);stopRouting(_0x4bd99c,_0x17c834,_0x19cf8d,_0x3cdb4f);clearTimeout(_0x32360a);_0x32360a=undefined;_0x8f2e51[_0x21e4('0x49')](!![]);if(_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]){delete _0x3cdb4f[_0x21e4('0x47')][_0x4bd99c];}_0x1ded87[_0x21e4('0x40')]();});_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]['on'](_0x21e4('0x4a'),function(){if(_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]){delete _0x3cdb4f[_0x21e4('0x47')][_0x4bd99c];}});_0x32360a=setTimeout(function(){logger['info'](_0x21e4('0x4b'),_0x4bd99c);endRouting(_0x4bd99c,_0x17c834,_0x19cf8d,_0x3cdb4f);clearTimeout(_0x32360a);_0x8f2e51['close'](!![]);_0x1ded87[_0x21e4('0x4c')]();},_0x3eedba);switch(_0x17c834[_0x21e4('0x4d')]){case _0x21e4('0x4e'):strategy[_0x21e4('0x4e')](_0x8f2e51,_0x17c834,_0x3cdb4f,_0x19cf8d);break;default:strategy['beepall'](_0x8f2e51,_0x17c834,_0x3cdb4f,_0x19cf8d);}}else{logger[_0x21e4('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4bd99c,_0xc4d36a[_0x21e4('0x31')]);_0x1ded87[_0x21e4('0x40')]();}}}catch(_0x79e538){console[_0x21e4('0x4f')](_0x79e538);logger[_0x21e4('0x35')](_0x21e4('0x3e'),_0x4bd99c,_0x79e538[_0x21e4('0x50')]);_0x1ded87[_0x21e4('0x40')]();}};}; \ No newline at end of file +var _0x330e=['catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','message','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','socket.io-emitter','queue_id','account','from','joinAt','clone','queue','push','capitalize','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','chat','AccountId','WebsiteId','info','name','QueueReport','create'];(function(_0x1564a3,_0x4e3d5c){var _0x25fa98=function(_0x4e5125){while(--_0x4e5125){_0x1564a3['push'](_0x1564a3['shift']());}};_0x25fa98(++_0x4e3d5c);}(_0x330e,0x15e));var _0xe330=function(_0x51424a,_0x21ae65){_0x51424a=_0x51424a-0x0;var _0x5748f3=_0x330e[_0x51424a];return _0x5748f3;};'use strict';var schema=require(_0xe330('0x0'));var _=require(_0xe330('0x1'));var util=require('util');var seqqueue=require(_0xe330('0x2'));var moment=require(_0xe330('0x3'));var Redis=require(_0xe330('0x4'));var config=require('../../../../config/environment');var logger=require(_0xe330('0x5'))(_0xe330('0x6'));var strategy=require(_0xe330('0x7'));config[_0xe330('0x8')]=_['defaults'](config[_0xe330('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe330('0x9'))(new Redis(config[_0xe330('0x8')]));var attributes=['id',_0xe330('0xa'),_0xe330('0xb'),'queue',_0xe330('0xc'),_0xe330('0xd')];function emit(_0xb9baa1,_0x11685b,_0x43a46b){io['to'](_0xb9baa1)['emit'](_0x11685b,_0x43a46b);}function emitChannelQueueInteraction(_0x53622f,_0x518eb4,_0x275e5,_0x4d40fe,_0x338e04,_0x370b8c,_0x4acaa6,_0x5d422f){var _0x5b8076=_[_0xe330('0xe')](_0x275e5);_0x5b8076[_0xe330('0xa')]=_0x5d422f;_0x5b8076[_0xe330('0xf')]=_0x518eb4;_0x5b8076[_0xe330('0xb')]=_0x4d40fe;_0x5b8076['id']=_0x338e04;if(_0x370b8c){attributes[_0xe330('0x10')](_[_0xe330('0x11')](_0x53622f)+'InteractionId');_0x4acaa6[util[_0xe330('0x12')]('%sQueuesWaitingInteractions',_0x53622f)][_0x338e04]=_[_0xe330('0x13')](_0x5b8076,attributes);}else{delete _0x4acaa6[util[_0xe330('0x12')](_0xe330('0x14'),_0x53622f)][_0x338e04];}emit(util['format'](_0xe330('0x15'),_0x53622f,_0x518eb4),util['format']('%s_queue_waiting_interaction:%s',_0x53622f,_0x370b8c?_0xe330('0x16'):_0xe330('0x17')),_[_0xe330('0x13')](_0x5b8076,attributes));}var rpc={'openchannelQueueReport':require(_0xe330('0x18')),'mailQueueReport':require(_0xe330('0x19')),'chatQueueReport':require(_0xe330('0x1a')),'smsQueueReport':require(_0xe330('0x1b')),'faxQueueReport':require(_0xe330('0x1c')),'whatsappQueueReport':require(_0xe330('0x1d'))};var queue=schema({'name':{'type':_0xe330('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xe330('0x1f'),'message':_0xe330('0x20')}});function startRouting(_0x27b361,_0x54e9fb,_0x157d04,_0x3f4389){if(_0x27b361&&_0x54e9fb&&_0x157d04){_0x54e9fb[_0xe330('0x21')]+=0x1;var _0x42f185={'uniqueid':_0x27b361,'from':_0x157d04[_0xe330('0x22')]?_0x157d04['body']['from']:'','joinAt':moment()[_0xe330('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x157d04[_0xe330('0x23')]?_0x157d04[_0xe330('0x23')]['id']:null,'ListId':_0x157d04[_0xe330('0x24')]?_0x157d04[_0xe330('0x24')]['id']:null};_0x42f185[_[_0xe330('0x25')](_0x157d04['channel'])+_0xe330('0x26')]=_0x54e9fb['id']||null;_0x42f185[_['upperFirst'](_0x157d04[_0xe330('0x27')])+_0xe330('0x28')]=_0x157d04[_0xe330('0x29')]?_0x157d04[_0xe330('0x29')]['id']:null;_0x42f185[_[_0xe330('0x25')](_0x157d04['channel'])+_0xe330('0x2a')]=_0x157d04['message']?_0x157d04['message']['id']:null;_0x42f185[_[_0xe330('0x25')](_0x157d04[_0xe330('0x27')])+(_0x157d04[_0xe330('0x27')]!==_0xe330('0x2b')?_0xe330('0x2c'):_0xe330('0x2d'))]=_0x157d04[_0xe330('0xb')]?_0x157d04[_0xe330('0xb')]['id']:null;logger[_0xe330('0x2e')](util[_0xe330('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x27b361,_0x54e9fb[_0xe330('0x2f')]));emitChannelQueueInteraction(_0x157d04['channel'],_0x54e9fb['name'],_0x42f185,_0x157d04['account'][_0xe330('0x2f')],_0x157d04['message']['id'],!![],_0x3f4389,_0x54e9fb['id']);if(rpc[_0x157d04[_0xe330('0x27')]+_0xe330('0x30')]){return rpc[_0x157d04['channel']+_0xe330('0x30')][_0xe330('0x31')](_0x42f185)[_0xe330('0x32')](function(_0x575381){logger[_0xe330('0x33')]('create\x20queue\x20report');});}}}function stopRouting(_0x41861b,_0x1d85ad,_0x1eb129,_0x688e42){if(_0x41861b&&_0x1d85ad){_0x1d85ad['waiting']-=0x1;var _0xbc9548={'leaveAt':moment()[_0xe330('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xe330('0x34')),'reason':_0xe330('0x35')};logger[_0xe330('0x2e')](util[_0xe330('0x12')](_0xe330('0x36'),_0x41861b,_0x1d85ad[_0xe330('0x2f')]));emitChannelQueueInteraction(_0x1eb129[_0xe330('0x27')],_0x1d85ad['name'],_0x1eb129[_0xe330('0x22')],_0x1eb129[_0xe330('0xb')]['name'],_0x1eb129[_0xe330('0x37')]['id'],![],_0x688e42,_0x1d85ad['id']);if(rpc[_0x1eb129[_0xe330('0x27')]+_0xe330('0x30')]){return rpc[_0x1eb129[_0xe330('0x27')]+_0xe330('0x30')][_0xe330('0x38')](_0x41861b,_0xbc9548)[_0xe330('0x32')](function(_0x1ce4dd){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x38dfd5,_0xdc0338,_0x5e4f03,_0x40a2cc){if(_0x38dfd5&&_0xdc0338){_0xdc0338[_0xe330('0x21')]-=0x1;var _0x262c17={'leaveAt':moment()['format'](_0xe330('0x34')),'exitAt':moment()[_0xe330('0x12')](_0xe330('0x34')),'reason':_0xe330('0x39')};logger[_0xe330('0x2e')](util[_0xe330('0x12')](_0xe330('0x3a'),_0x38dfd5,_0xdc0338[_0xe330('0x2f')]));emitChannelQueueInteraction(_0x5e4f03[_0xe330('0x27')],_0xdc0338[_0xe330('0x2f')],_0x5e4f03[_0xe330('0x22')],_0x5e4f03[_0xe330('0xb')][_0xe330('0x2f')],_0x5e4f03[_0xe330('0x37')]['id'],![],_0x40a2cc);if(rpc[_0x5e4f03['channel']+_0xe330('0x30')]){return rpc[_0x5e4f03['channel']+_0xe330('0x30')]['update'](_0x38dfd5,_0x262c17)[_0xe330('0x32')](function(_0x2eec1c){logger[_0xe330('0x33')](_0xe330('0x3b'));});}}}function handleFindQueue(_0x16e818){return function(_0x589c80){return _0x589c80['name'][_0xe330('0x3c')]()===_0x16e818[_0xe330('0x3c')]();};}exports[_0xe330('0x3d')]=function(_0x291b41,_0x5c71c3,_0x12e5a7,_0x275e0){return function(_0x370245){try{var _0x46dde2={'name':_0x5c71c3[0x0],'timeout':_0x5c71c3[0x1]};var _0x1fe80f=queue['validate'](_0x46dde2,{'typecast':!![]});if(_0x1fe80f['length']){logger['error'](_0xe330('0x3e'),_0x291b41,_[_0xe330('0x3f')](_0x1fe80f,_0xe330('0x37'))[_0xe330('0x40')](',\x20'));_0x370245[_0xe330('0x41')]();}else{var _0x3bb15d=_[_0xe330('0x42')](_0x12e5a7[_0x275e0[_0xe330('0x27')]+_0xe330('0x43')],handleFindQueue(_0x46dde2['name']));if(_0x3bb15d){startRouting(_0x291b41,_0x3bb15d,_0x275e0,_0x12e5a7);var _0x2879c9=(_0x3bb15d[_0xe330('0x39')]||0xa)*0x3e8;var _0x4dcdc1=(_0x46dde2['timeout']||0x14)*0x3e8;var _0x5dae4a;if(_0x2879c9>_0x4dcdc1){_0x4dcdc1=_0x2879c9;}var _0x4b0534=seqqueue['createQueue'](_0x2879c9);_0x4b0534['id']=_0x291b41;_0x4b0534[_0xe330('0x44')]=_0x2879c9;_0x4b0534['qtimeout']=_0x4dcdc1;_0x4b0534[_0xe330('0x27')]=_0x275e0['channel'];_0x12e5a7[_0xe330('0x45')][_0x291b41]['on'](_0xe330('0x46'),function(){logger[_0xe330('0x2e')](_0xe330('0x47'),_0x291b41);stopRouting(_0x291b41,_0x3bb15d,_0x275e0,_0x12e5a7);clearTimeout(_0x5dae4a);_0x5dae4a=undefined;_0x4b0534['close'](!![]);if(_0x12e5a7[_0xe330('0x45')][_0x291b41]){delete _0x12e5a7[_0xe330('0x45')][_0x291b41];}_0x370245['stop']();});_0x12e5a7[_0xe330('0x45')][_0x291b41]['on'](_0xe330('0x48'),function(){if(_0x12e5a7[_0xe330('0x45')][_0x291b41]){delete _0x12e5a7[_0xe330('0x45')][_0x291b41];}});_0x5dae4a=setTimeout(function(){logger[_0xe330('0x2e')](_0xe330('0x49'),_0x291b41);endRouting(_0x291b41,_0x3bb15d,_0x275e0,_0x12e5a7);clearTimeout(_0x5dae4a);_0x4b0534[_0xe330('0x4a')](!![]);_0x370245[_0xe330('0x4b')]();},_0x4dcdc1);switch(_0x3bb15d[_0xe330('0x4c')]){case _0xe330('0x4d'):strategy['rrmemory'](_0x4b0534,_0x3bb15d,_0x12e5a7,_0x275e0);break;default:strategy['beepall'](_0x4b0534,_0x3bb15d,_0x12e5a7,_0x275e0);}}else{logger[_0xe330('0x33')](_0xe330('0x4e'),_0x291b41,_0x46dde2['name']);_0x370245['stop']();}}}catch(_0x8a12b6){console[_0xe330('0x4f')](_0x8a12b6);logger[_0xe330('0x33')](_0xe330('0x3e'),_0x291b41,_0x8a12b6['stack']);_0x370245['stop']();}};}; \ 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 95e304b..c69f44a 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 _0x98a8=['prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','push','isAgentAvailable','busy','saveWaitingNotification','channel','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','handleTimeout','bind','timeout','drained','handleDrained'];(function(_0x35e88f,_0x424ea0){var _0x4f9934=function(_0x1b5dd3){while(--_0x1b5dd3){_0x35e88f['push'](_0x35e88f['shift']());}};_0x4f9934(++_0x424ea0);}(_0x98a8,0x12c));var _0x898a=function(_0x4320bd,_0x12d8a4){_0x4320bd=_0x4320bd-0x0;var _0x364179=_0x98a8[_0x4320bd];return _0x364179;};'use strict';var _=require(_0x898a('0x0'));var uuid=require(_0x898a('0x1'));var util=require(_0x898a('0x2'));var logger=require(_0x898a('0x3'))(_0x898a('0x4'));var Agent=function(_0x226db7,_0x69c61f,_0x4a0836,_0x2bb3e2){this[_0x898a('0x5')]=uuid['v4']();this[_0x898a('0x6')]=_0x226db7;this[_0x898a('0x7')]=_0x69c61f;this[_0x898a('0x8')]=_0x4a0836;this['routing']=_0x2bb3e2;this[_0x898a('0x6')]['push'](this[_0x898a('0x9')]['bind'](this),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xc'),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xd'),this[_0x898a('0xe')]['bind'](this));};Agent[_0x898a('0xf')]['push']=function(){this[_0x898a('0x6')]['push'](this[_0x898a('0x9')][_0x898a('0xb')](this),this[_0x898a('0xa')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0x898a('0xa')](!![]);};Agent[_0x898a('0xf')][_0x898a('0x9')]=function(){logger[_0x898a('0x10')](_0x898a('0x11'),this[_0x898a('0x6')]['id'],this['agent']['id']);if(_[_0x898a('0x12')](this['realtime'][_0x898a('0x13')][this['agent']['id']])){logger[_0x898a('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x898a('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x898a('0x14')][_0x898a('0xb')](this),0x3e8);}else{if(this[_0x898a('0x4')]['forcedOwnership']||util[_0x898a('0x15')](this['squeue']['id'],this['realtime'][_0x898a('0x13')][this[_0x898a('0x7')]['id']],this['squeue']['channel'],![])){this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x16')]=!![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busyQueue']=undefined;util[_0x898a('0x17')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this[_0x898a('0x6')][_0x898a('0x18')]);util['showNotification'](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']],null,this[_0x898a('0x4')]);util['writeLog'](this[_0x898a('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],_0x898a('0x19')+(this[_0x898a('0x4')][_0x898a('0x1a')]?_0x898a('0x1b'):''));}else{logger[_0x898a('0x10')](_0x898a('0x1c'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);setTimeout(this[_0x898a('0x14')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0xe9c33d){if(_[_0x898a('0x12')](this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']])){return logger[_0x898a('0x10')](_0x898a('0x1d'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);}else{logger[_0x898a('0x10')](_0x898a('0x1e'),this[_0x898a('0x6')]['id'],this['agent']['id']);util[_0x898a('0x1f')](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this['agent']['id']],null,this['routing']);this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busy']=![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x20')]=undefined;util[_0x898a('0x21')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this['squeue'][_0x898a('0x18')]);util['writeLog'](this['squeue']['id'],this[_0x898a('0x8')]['agents'][this[_0x898a('0x7')]['id']],_0xe9c33d?'STOP':_0x898a('0x22'));}if(!_0xe9c33d){setTimeout(this['push'][_0x898a('0xb')](this),0x3e8);}};function agent(_0x354703,_0x101182,_0x50c0e4,_0x554897){return new Agent(_0x354703,_0x101182,_0x50c0e4,_0x554897);}module['exports']=agent; \ No newline at end of file +var _0xd67b=['handleRun','bind','handleTimeout','timeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push'];(function(_0x2cf65e,_0x24b694){var _0x5d76ff=function(_0x129112){while(--_0x129112){_0x2cf65e['push'](_0x2cf65e['shift']());}};_0x5d76ff(++_0x24b694);}(_0xd67b,0x133));var _0xbd67=function(_0x2a77b4,_0x33578d){_0x2a77b4=_0x2a77b4-0x0;var _0x386fb4=_0xd67b[_0x2a77b4];return _0x386fb4;};'use strict';var _=require('lodash');var uuid=require(_0xbd67('0x0'));var util=require('./util');var logger=require(_0xbd67('0x1'))(_0xbd67('0x2'));var Agent=function(_0x317e33,_0x5e967b,_0x40e384,_0x50da5a){this[_0xbd67('0x3')]=uuid['v4']();this['squeue']=_0x317e33;this[_0xbd67('0x4')]=_0x5e967b;this[_0xbd67('0x5')]=_0x40e384;this[_0xbd67('0x2')]=_0x50da5a;this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this[_0xbd67('0x6')]['on'](_0xbd67('0xb'),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this['squeue']['on']('drained',this[_0xbd67('0xc')]['bind'](this));};Agent[_0xbd67('0xd')][_0xbd67('0x7')]=function(){this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));};Agent[_0xbd67('0xd')][_0xbd67('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0xbd67('0xd')][_0xbd67('0x8')]=function(){logger[_0xbd67('0xe')](_0xbd67('0xf'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this[_0xbd67('0x7')]['bind'](this),0x3e8);}else{if(this[_0xbd67('0x2')][_0xbd67('0x12')]||util[_0xbd67('0x13')](this['squeue']['id'],this[_0xbd67('0x5')]['agents'][this[_0xbd67('0x4')]['id']],this[_0xbd67('0x6')][_0xbd67('0x14')],![])){this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=!![];this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']]['busyQueue']=undefined;util[_0xbd67('0x16')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this[_0xbd67('0x6')][_0xbd67('0x14')]);util[_0xbd67('0x17')](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this[_0xbd67('0x2')]);util['writeLog'](this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],_0xbd67('0x18')+(this[_0xbd67('0x2')]['forcedOwnership']?_0xbd67('0x19'):''));}else{logger[_0xbd67('0xe')](_0xbd67('0x1a'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xbd67('0xd')][_0xbd67('0xa')]=function(_0x4675ac){if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){return logger[_0xbd67('0xe')](_0xbd67('0x1b'),this[_0xbd67('0x6')]['id'],this['agent']['id']);}else{logger['debug'](_0xbd67('0x1c'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);util['hideNotification'](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this['routing']);this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=![];this['realtime']['agents'][this[_0xbd67('0x4')]['id']][_0xbd67('0x1d')]=undefined;util[_0xbd67('0x1e')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this['squeue'][_0xbd67('0x14')]);util[_0xbd67('0x1f')](this[_0xbd67('0x6')]['id'],this['realtime'][_0xbd67('0x11')][this['agent']['id']],_0x4675ac?_0xbd67('0x20'):_0xbd67('0x21'));}if(!_0x4675ac){setTimeout(this['push'][_0xbd67('0x9')](this),0x3e8);}};function agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777){return new Agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777);}module[_0xbd67('0x22')]=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 b45105f..510ef9a 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 _0x22ea=['debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','RINGING','busy','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0x22ea,0x179));var _0xa22e=function(_0x21c6f7,_0x4d96ed){_0x21c6f7=_0x21c6f7-0x0;var _0x1051e2=_0x22ea[_0x21c6f7];return _0x1051e2;};'use strict';var _=require(_0xa22e('0x0'));var uuid=require('uuid');var util=require(_0xa22e('0x1'));var logger=require(_0xa22e('0x2'))(_0xa22e('0x3'));var Beepall=function(_0x156617,_0x5817ce,_0x559a59,_0x36c25c){this[_0xa22e('0x4')]=uuid['v4']();this[_0xa22e('0x5')]=_0x156617;this[_0xa22e('0x6')]=_0x5817ce;this['realtime']=_0x559a59;this[_0xa22e('0x3')]=_0x36c25c;this[_0xa22e('0x5')][_0xa22e('0x7')](this[_0xa22e('0x8')]['bind'](this),this[_0xa22e('0x9')][_0xa22e('0xa')](this));this[_0xa22e('0x5')]['on'](_0xa22e('0xb'),this[_0xa22e('0x9')][_0xa22e('0xa')](this));this['squeue']['on'](_0xa22e('0xc'),this[_0xa22e('0xd')][_0xa22e('0xa')](this));};Beepall['prototype'][_0xa22e('0x7')]=function(){this[_0xa22e('0x5')][_0xa22e('0x7')](this[_0xa22e('0x8')][_0xa22e('0xa')](this),this['handleTimeout'][_0xa22e('0xa')](this));};Beepall[_0xa22e('0xe')][_0xa22e('0xd')]=function(){this[_0xa22e('0x9')](!![]);};Beepall[_0xa22e('0xe')]['handleRun']=function(){var _0x3abde7=!![];if(!_[_0xa22e('0xf')](this['queue'])&&!_[_0xa22e('0xf')](this[_0xa22e('0x6')][_0xa22e('0x10')])&&this[_0xa22e('0x6')][_0xa22e('0x10')][_0xa22e('0x11')]>0x0){for(var _0x5ca876=0x0,_0x4052f2;_0x5ca8760x0){for(var _0x3b40c9=0x0,_0x8700b;_0x3b40c90x0&&_0x4f272e[_0x20281e+_0xbb3a('0x25')]>=_0x4f272e[_0x20281e+_0xbb3a('0x24')]){writeLog(_0x3cf6dc,_0x4f272e,_0x20281e[_0xbb3a('0x26')]()+_0xbb3a('0x27'));return![];}}return!![];};exports[_0xbb3a('0x28')]=function(_0x467cb1,_0x57190f,_0xe0b72c,_0x9736ac,_0x3f86f3){return sendNotification(!![],_0x467cb1,_0x57190f,_0xe0b72c,_0x9736ac,_0x3f86f3);};exports[_0xbb3a('0x29')]=function(_0x40bec5,_0x26c93f,_0x1be95a,_0x180660,_0x44dd3e){return sendNotification(![],_0x40bec5,_0x26c93f,_0x1be95a,_0x180660,_0x44dd3e);};exports[_0xbb3a('0x2a')]=function(_0x13c554,_0x249d33,_0x22d51c){var _0x2479bd=_0x249d33[_0xbb3a('0x2b')][_0xbb3a('0x2c')];if(!_0x2479bd&&_0x22d51c){_0x2479bd=_0x22d51c['id'];}var _0x258b18=_[_0xbb3a('0x2d')](_0x13c554[_0x249d33[_0xbb3a('0x2e')]+_0xbb3a('0x2f')],function(_0x175ebb){var _0x5ecc1e=_[_0xbb3a('0x30')](_0x249d33[_0xbb3a('0x2e')])+_0xbb3a('0x31');return _0x175ebb[_0x5ecc1e]===_0x249d33[_0xbb3a('0x2b')]['id'];});if(!_0x258b18&&_0x2479bd){_0x258b18=_[_0xbb3a('0x2d')](_0x13c554[_0xbb3a('0x32')][_0x2479bd][_0x249d33[_0xbb3a('0x2e')]+_0xbb3a('0x33')],function(_0xd01ace){return _0xd01ace['id']===_0x249d33[_0xbb3a('0x2b')]['id'];});}return _0x258b18;};exports[_0xbb3a('0x34')]=function(_0x10e324,_0x5bf878,_0x37fefe,_0x37a426){_0x10e324[_0xbb3a('0x32')][_0x37fefe['id']][_0x37a426+'WaitingInteractions'][_0x5bf878[_0xbb3a('0x19')]['id']]={'id':_0x5bf878[_0xbb3a('0x2b')]['id']};};exports['removeWaitingNotification']=function(_0x20cc84,_0x35709b,_0x17ff6d,_0x1da012){delete _0x20cc84['agents'][_0x17ff6d['id']][_0x1da012+'WaitingInteractions'][_0x35709b[_0xbb3a('0x19')]['id']];};exports[_0xbb3a('0x35')]=writeLog; \ No newline at end of file +var _0x8b5a=['online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','name','emit','user:save','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','user:%s','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy'];(function(_0x3328c2,_0x54bfa1){var _0x1fef4b=function(_0x4be147){while(--_0x4be147){_0x3328c2['push'](_0x3328c2['shift']());}};_0x1fef4b(++_0x54bfa1);}(_0x8b5a,0xac));var _0xa8b5=function(_0x3163a7,_0x40d331){_0x3163a7=_0x3163a7-0x0;var _0x3fb1f4=_0x8b5a[_0x3163a7];return _0x3fb1f4;};'use strict';var _=require('lodash');var util=require(_0xa8b5('0x0'));var utils=require(_0xa8b5('0x1'));var Redis=require('ioredis');var config=require(_0xa8b5('0x2'));var logger=require(_0xa8b5('0x3'))(_0xa8b5('0x4'));config[_0xa8b5('0x5')]=_[_0xa8b5('0x6')](config[_0xa8b5('0x5')],{'host':_0xa8b5('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa8b5('0x5')]));function sendNotification(_0x320d0c,_0x40c713,_0x36468f,_0x2e4bc6,_0xdff6b,_0x41d4b6){io['to'](util['format']('user:%s',_0x2e4bc6[_0xa8b5('0x8')]))[_0xa8b5('0x9')](_0xa8b5('0xa'),_0x2e4bc6);var _0x21771b=_0x41d4b6||{};var _0x1e2c08=_0x36468f['split']('.');var _0x311145={'uniqueid':_0x40c713,'channel':_0x1e2c08[0x0],'id':_0x1e2c08[0x1],'title':_0x1e2c08[0x0]+_0xa8b5('0xb'),'interactionId':_0x1e2c08[0x2],'queue':_0xdff6b?_0xdff6b['name']:null,'sound':_0x21771b['account'][_0xa8b5('0xc')],'shake':_0x21771b[_0xa8b5('0xd')][_0xa8b5('0xe')]};try{if(!_0x21771b['body']){_0x21771b[_0xa8b5('0xf')]={};}if(_0xdff6b){_0x21771b[_0xa8b5('0xf')][_0xa8b5('0x10')]=_0xdff6b;}else if(_0x21771b[_0xa8b5('0xf')][_0xa8b5('0x10')]){delete _0x21771b[_0xa8b5('0xf')][_0xa8b5('0x10')];}_0x311145[_0xa8b5('0x11')]=utils['getMustacheRender'](_0x21771b[_0xa8b5('0xd')][_0xa8b5('0x12')],_0x21771b);}catch(_0x5451c9){_0x311145['msg']=_0xa8b5('0x13');logger[_0xa8b5('0x14')](util[_0xa8b5('0x15')]('[%s][QUEUE]\x20%s',_0x40c713,_0x5451c9[_0xa8b5('0x16')]));}io['to'](util[_0xa8b5('0x15')](_0xa8b5('0x17'),_0x2e4bc6[_0xa8b5('0x8')]))[_0xa8b5('0x9')](util['format']('notification:%s',_0x320d0c?'save':_0xa8b5('0x18')),_0x311145);}function writeLog(_0x3b82dc,_0x3d43e0,_0xc7c7d3){return logger['debug'](util[_0xa8b5('0x15')](_0xa8b5('0x19'),_0x3b82dc,_0x3d43e0[_0xa8b5('0x8')],_0xc7c7d3));}exports[_0xa8b5('0x1a')]=function(_0x2ae048,_0x2a9fd6,_0x4dde89,_0x109aab){if(_0x2a9fd6[_0xa8b5('0x1b')]){writeLog(_0x2ae048,_0x2a9fd6,'BUSY');return![];}if(!_0x2a9fd6[_0xa8b5('0x1c')]){writeLog(_0x2ae048,_0x2a9fd6,_0xa8b5('0x1d'));return![];}if(_0x2a9fd6[_0x4dde89+_0xa8b5('0x1e')]){writeLog(_0x2ae048,_0x2a9fd6,'PAUSE');return![];}if(_0x109aab&&_0x2a9fd6[_0xa8b5('0x1f')](_0x4dde89+_0xa8b5('0x20'))&&_0x2a9fd6[_0xa8b5('0x1f')](_0x4dde89+_0xa8b5('0x21'))){if(_0x2a9fd6[_0x4dde89+'Capacity']>0x0&&_0x2a9fd6[_0x4dde89+'CurrentCapacity']>=_0x2a9fd6[_0x4dde89+_0xa8b5('0x20')]){writeLog(_0x2ae048,_0x2a9fd6,_0x4dde89[_0xa8b5('0x22')]()+_0xa8b5('0x23'));return![];}}return!![];};exports[_0xa8b5('0x24')]=function(_0x131577,_0x2e95ae,_0x40743f,_0x61abc1,_0x34f256){return sendNotification(!![],_0x131577,_0x2e95ae,_0x40743f,_0x61abc1,_0x34f256);};exports['hideNotification']=function(_0xeb0cdd,_0x4e7d11,_0xcb5810,_0x3e5de3,_0x444c3a){return sendNotification(![],_0xeb0cdd,_0x4e7d11,_0xcb5810,_0x3e5de3,_0x444c3a);};exports[_0xa8b5('0x25')]=function(_0x78c2a5,_0x2a83e2,_0x2eff18){var _0x2043ae=_0x2a83e2[_0xa8b5('0x26')][_0xa8b5('0x27')];if(!_0x2043ae&&_0x2eff18){_0x2043ae=_0x2eff18['id'];}var _0x2da242=_[_0xa8b5('0x28')](_0x78c2a5[_0x2a83e2[_0xa8b5('0x29')]+_0xa8b5('0x2a')],function(_0x574736){var _0x36dac9=_[_0xa8b5('0x2b')](_0x2a83e2[_0xa8b5('0x29')])+_0xa8b5('0x2c');return _0x574736[_0x36dac9]===_0x2a83e2[_0xa8b5('0x26')]['id'];});if(!_0x2da242&&_0x2043ae){_0x2da242=_[_0xa8b5('0x28')](_0x78c2a5[_0xa8b5('0x2d')][_0x2043ae][_0x2a83e2[_0xa8b5('0x29')]+_0xa8b5('0x2e')],function(_0x4f1ffc){return _0x4f1ffc['id']===_0x2a83e2['interaction']['id'];});}return _0x2da242;};exports[_0xa8b5('0x2f')]=function(_0x25100c,_0x645281,_0x27f474,_0x5f2709){_0x25100c['agents'][_0x27f474['id']][_0x5f2709+_0xa8b5('0x2e')][_0x645281[_0xa8b5('0x16')]['id']]={'id':_0x645281[_0xa8b5('0x26')]['id']};};exports[_0xa8b5('0x30')]=function(_0x20e6e6,_0x520734,_0x30aff0,_0xaeebb){delete _0x20e6e6[_0xa8b5('0x2d')][_0x30aff0['id']][_0xaeebb+_0xa8b5('0x2e')][_0x520734[_0xa8b5('0x16')]['id']];};exports[_0xa8b5('0x31')]=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 9619362..972b50b 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 _0xecc5=['message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xecc5,0x96));var _0x5ecc=function(_0x104c14,_0x4586ee){_0x104c14=_0x104c14-0x0;var _0x391ab4=_0xecc5[_0x104c14];return _0x391ab4;};'use strict';var schema=require(_0x5ecc('0x0'));var sh=require('shelljs');var _=require(_0x5ecc('0x1'));var utils=require(_0x5ecc('0x2'));var logger=require(_0x5ecc('0x3'))(_0x5ecc('0x4'));var system=schema({'command':{'type':_0x5ecc('0x5'),'required':!![],'message':_0x5ecc('0x6')}});exports[_0x5ecc('0x7')]=function(_0xbb7b14,_0x17e2fe){return function(_0x17f466){try{var _0xb516eb={'command':_0x17e2fe[0x0]};var _0x47ae8f=system[_0x5ecc('0x0')](_0xb516eb,{'typecast':!![]});if(_0x47ae8f[_0x5ecc('0x8')]){logger[_0x5ecc('0x9')](_0x5ecc('0xa'),_0xbb7b14,_[_0x5ecc('0xb')](_0x47ae8f,_0x5ecc('0xc'))['join'](',\x20'));logger[_0x5ecc('0xd')](_0x5ecc('0xe'),_0xbb7b14);_0x17f466['next']();}else{var _0x4d57bb=this;var _0x4447aa=utils[_0x5ecc('0xf')](_0x17e2fe[0x0],this);logger[_0x5ecc('0xd')](_0x5ecc('0x10'),_0xbb7b14,_0x4447aa);sh[_0x5ecc('0x11')](_[_0x5ecc('0x12')](_0x4447aa),function(_0x2f8ad3,_0x4ffe2d){logger[_0x5ecc('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xbb7b14,_0x2f8ad3);if(_0x2f8ad3==0x0){var _0x2c4340=_0x4ffe2d[_0x5ecc('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x5ecc('0x14')](_0x17e2fe[0x1])||_[_0x5ecc('0x15')](_0x17e2fe[0x1])){logger[_0x5ecc('0xd')](_0x5ecc('0x16'),_0xbb7b14);_0x4d57bb['body'][_0x17e2fe[0x1]]=_0x2c4340;}else{logger[_0x5ecc('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0xbb7b14,_0x17e2fe[0x1],_0x2c4340);_0x4d57bb[_0x5ecc('0x17')][_0x17e2fe[0x1]]=_0x2c4340;}}_0x17f466[_0x5ecc('0x18')]();});}}catch(_0x3dec16){logger[_0x5ecc('0x9')](_0x5ecc('0xa'),_0xbb7b14,_[_0x5ecc('0x19')](_0x3dec16)?JSON[_0x5ecc('0x1a')](_0x3dec16):_0x3dec16);logger['info'](_0x5ecc('0xe'),_0xbb7b14);_0x17f466[_0x5ecc('0x18')]();}};}; \ No newline at end of file +var _0x8bea=['message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','validate','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][SYSTEM]\x20%s','map'];(function(_0x56906a,_0x1f68ad){var _0x3d9358=function(_0x42162e){while(--_0x42162e){_0x56906a['push'](_0x56906a['shift']());}};_0x3d9358(++_0x1f68ad);}(_0x8bea,0x116));var _0xa8be=function(_0x2627df,_0x3887e9){_0x2627df=_0x2627df-0x0;var _0x388825=_0x8bea[_0x2627df];return _0x388825;};'use strict';var schema=require(_0xa8be('0x0'));var sh=require('shelljs');var _=require(_0xa8be('0x1'));var utils=require(_0xa8be('0x2'));var logger=require('../../../../config/logger')(_0xa8be('0x3'));var system=schema({'command':{'type':_0xa8be('0x4'),'required':!![],'message':_0xa8be('0x5')}});exports['consequence']=function(_0x557c2f,_0x1cf3d3){return function(_0xdac608){try{var _0x3d6800={'command':_0x1cf3d3[0x0]};var _0x25dc1b=system[_0xa8be('0x0')](_0x3d6800,{'typecast':!![]});if(_0x25dc1b['length']){logger['error'](_0xa8be('0x6'),_0x557c2f,_[_0xa8be('0x7')](_0x25dc1b,_0xa8be('0x8'))[_0xa8be('0x9')](',\x20'));logger[_0xa8be('0xa')](_0xa8be('0xb'),_0x557c2f);_0xdac608[_0xa8be('0xc')]();}else{var _0x5ec25f=this;var _0x1fe10e=utils[_0xa8be('0xd')](_0x1cf3d3[0x0],this);logger[_0xa8be('0xa')](_0xa8be('0xe'),_0x557c2f,_0x1fe10e);sh[_0xa8be('0xf')](_[_0xa8be('0x10')](_0x1fe10e),function(_0x5a24ba,_0x105f84){logger[_0xa8be('0xa')](_0xa8be('0x11'),_0x557c2f,_0x5a24ba);if(_0x5a24ba==0x0){var _0x4b97da=_0x105f84[_0xa8be('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xa8be('0x13')](_0x1cf3d3[0x1])||_[_0xa8be('0x14')](_0x1cf3d3[0x1])){logger[_0xa8be('0xa')](_0xa8be('0x15'),_0x557c2f);_0x5ec25f[_0xa8be('0x16')][_0x1cf3d3[0x1]]=_0x4b97da;}else{logger[_0xa8be('0xa')](_0xa8be('0x17'),_0x557c2f,_0x1cf3d3[0x1],_0x4b97da);_0x5ec25f[_0xa8be('0x16')][_0x1cf3d3[0x1]]=_0x4b97da;}}_0xdac608[_0xa8be('0xc')]();});}}catch(_0x10fafe){logger[_0xa8be('0x18')](_0xa8be('0x6'),_0x557c2f,_[_0xa8be('0x19')](_0x10fafe)?JSON['stringify'](_0x10fafe):_0x10fafe);logger['info'](_0xa8be('0xb'),_0x557c2f);_0xdac608[_0xa8be('0xc')]();}};}; \ 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 36880df..0b25219 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 _0x0ef2=['length','[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x29640a,_0x2b04a9){var _0x485fc0=function(_0x22ee35){while(--_0x22ee35){_0x29640a['push'](_0x29640a['shift']());}};_0x485fc0(++_0x2b04a9);}(_0x0ef2,0xe8));var _0x20ef=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0x0ef2[_0x5bf2b3];return _0x5e8a9b;};'use strict';var schema=require(_0x20ef('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x20ef('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x20ef('0x2')),'mailInteraction':require(_0x20ef('0x3')),'faxInteraction':require(_0x20ef('0x4')),'whatsappInteraction':require(_0x20ef('0x5'))};var logger=require(_0x20ef('0x6'))(_0x20ef('0x7'));var tag=schema({'tag':{'type':_0x20ef('0x8'),'required':!![],'message':_0x20ef('0x9')}});exports[_0x20ef('0xa')]=function(_0x4dcb55,_0x35f5bd,_0x4a5d0,_0x2df81d){return function(_0x5511eb){try{var _0xe0f04c={'tag':_0x35f5bd[0x0]};var _0x37bf37=tag['validate'](_0xe0f04c,{'typecast':!![]});if(_0x37bf37[_0x20ef('0xb')]){logger['error'](_0x20ef('0xc'),_0x4dcb55,_[_0x20ef('0xd')](_0x37bf37,_0x20ef('0xe'))['join'](',\x20'));logger['info'](_0x20ef('0xf'),_0x4dcb55);_0x5511eb[_0x20ef('0x10')]();}else{var _0x4a1b35={'ids':[_0x35f5bd[0x0]]};if(rpc[_0x2df81d[_0x20ef('0x11')]+_0x20ef('0x12')]){rpc[_0x2df81d['channel']+_0x20ef('0x12')]['addTags'](_0x2df81d[_0x20ef('0x13')]['id'],_0x4a1b35)[_0x20ef('0x14')](function(_0x5eed1a){logger[_0x20ef('0x15')](_0x20ef('0x16'),_0x4dcb55,_0x35f5bd[0x1],_0x2df81d['channel'],_0x2df81d['interaction']['id']);})[_0x20ef('0x17')](function(_0x2b4a52){logger[_0x20ef('0x18')]('[%s][TAG]\x20%s',_0x4dcb55,JSON[_0x20ef('0x19')](_0x2b4a52));logger[_0x20ef('0x15')](_0x20ef('0xf'),_0x4dcb55);})[_0x20ef('0x1a')](function(){_0x5511eb[_0x20ef('0x10')]();});}}}catch(_0x51c888){logger[_0x20ef('0x18')](_0x20ef('0xc'),_0x4dcb55,_['isObject'](_0x51c888)?JSON['stringify'](_0x51c888):_0x51c888);logger[_0x20ef('0x15')](_0x20ef('0xf'),_0x4dcb55);_0x5511eb[_0x20ef('0x10')]();}};}; \ No newline at end of file +var _0x8be4=['channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','finally','next','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','length','error','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8be4,0x18a));var _0x48be=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0x8be4[_0x5ba549];return _0x36e3a1;};'use strict';var schema=require(_0x48be('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x48be('0x1')),'openchannelInteraction':require(_0x48be('0x2')),'smsInteraction':require(_0x48be('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x48be('0x4'))};var logger=require(_0x48be('0x5'))(_0x48be('0x6'));var tag=schema({'tag':{'type':_0x48be('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x55eb20,_0x25a307,_0x525c1d,_0x4aa637){return function(_0x4fd053){try{var _0x49aa22={'tag':_0x25a307[0x0]};var _0x22ba12=tag[_0x48be('0x0')](_0x49aa22,{'typecast':!![]});if(_0x22ba12[_0x48be('0x8')]){logger[_0x48be('0x9')](_0x48be('0xa'),_0x55eb20,_[_0x48be('0xb')](_0x22ba12,'message')['join'](',\x20'));logger[_0x48be('0xc')](_0x48be('0xd'),_0x55eb20);_0x4fd053['next']();}else{var _0x698dac={'ids':[_0x25a307[0x0]]};if(rpc[_0x4aa637[_0x48be('0xe')]+_0x48be('0xf')]){rpc[_0x4aa637['channel']+'Interaction'][_0x48be('0x10')](_0x4aa637['interaction']['id'],_0x698dac)[_0x48be('0x11')](function(_0x3b23e8){logger[_0x48be('0xc')](_0x48be('0x12'),_0x55eb20,_0x25a307[0x1],_0x4aa637[_0x48be('0xe')],_0x4aa637[_0x48be('0x13')]['id']);})[_0x48be('0x14')](function(_0x59df04){logger['error']('[%s][TAG]\x20%s',_0x55eb20,JSON[_0x48be('0x15')](_0x59df04));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x55eb20);})[_0x48be('0x16')](function(){_0x4fd053[_0x48be('0x17')]();});}}}catch(_0x3fe463){logger['error']('[%s][TAG]\x20%s',_0x55eb20,_['isObject'](_0x3fe463)?JSON[_0x48be('0x15')](_0x3fe463):_0x3fe463);logger[_0x48be('0xc')](_0x48be('0xd'),_0x55eb20);_0x4fd053[_0x48be('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 5824f4d..52b94be 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfacf=['channelId=','&serviceId=','&sessionId=','info','stop','catch','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','params','stringify','utf8','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application'];(function(_0x545aad,_0x53365d){var _0x49d312=function(_0x3b13d4){while(--_0x3b13d4){_0x545aad['push'](_0x545aad['shift']());}};_0x49d312(++_0x53365d);}(_0xfacf,0x165));var _0xffac=function(_0x2d8ec6,_0x8cdec7){_0x2d8ec6=_0x2d8ec6-0x0;var _0xcd7bb3=_0xfacf[_0x2d8ec6];return _0xcd7bb3;};'use strict';var rp=require('request-promise');var logger=require(_0xffac('0x0'))('routing');var _=require(_0xffac('0x1'));var arr=[];exports[_0xffac('0x2')]=function(_0x2ac92c,_0x16936c){return function(_0x25183f){var _0x8514e1=_0x16936c[0xa];var _0x48719a=_0x16936c[0xb];var _0x1af160=_0x16936c[0xc];var _0x4f860f=_0x16936c[0xd];var _0xc9e71b=_0x16936c[0xe];var _0x5c1c6b=_0x16936c[0xf][_0xffac('0x3')](/\n/g,'\x20-\x20');var _0x1f8a07=_0x16936c[0x10][_0xffac('0x3')](/\n/g,'\x20');if(!arr[_0xffac('0x4')](_0x48719a)){arr[_0xffac('0x5')](_0x48719a);var _0x26c800=_0x16936c[0x3];var _0x3a4dfc=_0x16936c[0x4];var _0x4c35a7=_0x16936c[0x1];var _0x34c393=_0x16936c[0x0];var _0x5cf224={};_0x5cf224[_0xffac('0x6')]=_0x16936c[0x8]+_0xffac('0x7')+_0x1af160+'|'+_0x8514e1+'|'+_0x4f860f+'|'+_0x48719a+'|'+_0xc9e71b;_0x5cf224[_0xffac('0x8')]=_0x16936c[0x7]+_0xffac('0x7')+_0x1af160+'|'+_0x8514e1+'|'+_0x4f860f+'|'+_0x48719a+'|'+_0xc9e71b+'|'+_0x5c1c6b+'|'+_0x1f8a07;_0x5cf224[_0xffac('0x9')]=_0x16936c[0x9];var _0x5f50a2={};_0x5f50a2['jsonrpc']=_0xffac('0xa');_0x5f50a2[_0xffac('0xb')]='login';var _0xa68936=[];_0xa68936['push'](_0x16936c[0x2]);_0xa68936['push'](_0x16936c[0x5]);_0xa68936[_0xffac('0x5')](_0x16936c[0x6]);_0x5f50a2[_0xffac('0xc')]=_0xa68936;_0x5f50a2['id']=0x1;var _0x37d565=JSON[_0xffac('0xd')](_0x5f50a2);var _0x1a2b64={'encoding':_0xffac('0xe'),'method':'POST','timeout':0x2710,'url':_0x26c800,'headers':{'Content-Type':_0xffac('0xf')},'body':_0x37d565};return rp(_0x1a2b64)[_0xffac('0x10')](function(_0x426515){const _0x7012d=JSON['parse'](_0x426515);if(!_0x7012d[_0xffac('0x11')][_0xffac('0x12')]){throw new Error(_0xffac('0x13'));}var _0x158d09=_0x48719a;var _0x20217b=_0xffac('0x14')+_0x4c35a7+_0xffac('0x15')+_0x34c393+_0xffac('0x16')+_0x158d09+'&data='+JSON[_0xffac('0xd')](_0x5cf224);var _0x3e9933=_0x3a4dfc+'?'+_0x20217b;return rp(_0x3e9933);})[_0xffac('0x10')](function(_0x236f02){logger[_0xffac('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x2ac92c,_0x236f02);_0x25183f[_0xffac('0x18')]();})[_0xffac('0x19')](function(_0x567825){logger[_0xffac('0x1a')](_0xffac('0x1b'),_0x2ac92c,_['isObject'](_0x567825)?JSON[_0xffac('0xd')](_0x567825):_0x567825);_0x25183f['stop']();});}else{logger[_0xffac('0x17')](_0xffac('0x1c'),_0x2ac92c);_0x25183f['next']();}};}; \ No newline at end of file +var _0x729b=['replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','login','params','utf8','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','isObject','stringify','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x729b,0x114));var _0xb729=function(_0x3636fc,_0x32d1d5){_0x3636fc=_0x3636fc-0x0;var _0x15601e=_0x729b[_0x3636fc];return _0x15601e;};'use strict';var rp=require(_0xb729('0x0'));var logger=require(_0xb729('0x1'))(_0xb729('0x2'));var _=require('lodash');var arr=[];exports[_0xb729('0x3')]=function(_0x29f258,_0x282fd0){return function(_0x1fedff){var _0x4e2597=_0x282fd0[0xa];var _0x30e817=_0x282fd0[0xb];var _0x245705=_0x282fd0[0xc];var _0x131f63=_0x282fd0[0xd];var _0x429018=_0x282fd0[0xe];var _0x4f82d4=_0x282fd0[0xf][_0xb729('0x4')](/\n/g,_0xb729('0x5'));var _0x363567=_0x282fd0[0x10][_0xb729('0x4')](/\n/g,'\x20');if(!arr[_0xb729('0x6')](_0x30e817)){arr[_0xb729('0x7')](_0x30e817);var _0xbf3eb0=_0x282fd0[0x3];var _0x53e8a3=_0x282fd0[0x4];var _0x8de817=_0x282fd0[0x1];var _0x1983a5=_0x282fd0[0x0];var _0x5a4a8f={};_0x5a4a8f[_0xb729('0x8')]=_0x282fd0[0x8]+'?params='+_0x245705+'|'+_0x4e2597+'|'+_0x131f63+'|'+_0x30e817+'|'+_0x429018;_0x5a4a8f[_0xb729('0x9')]=_0x282fd0[0x7]+_0xb729('0xa')+_0x245705+'|'+_0x4e2597+'|'+_0x131f63+'|'+_0x30e817+'|'+_0x429018+'|'+_0x4f82d4+'|'+_0x363567;_0x5a4a8f[_0xb729('0xb')]=_0x282fd0[0x9];var _0x1ccc86={};_0x1ccc86[_0xb729('0xc')]=_0xb729('0xd');_0x1ccc86[_0xb729('0xe')]=_0xb729('0xf');var _0xa0376e=[];_0xa0376e[_0xb729('0x7')](_0x282fd0[0x2]);_0xa0376e[_0xb729('0x7')](_0x282fd0[0x5]);_0xa0376e[_0xb729('0x7')](_0x282fd0[0x6]);_0x1ccc86[_0xb729('0x10')]=_0xa0376e;_0x1ccc86['id']=0x1;var _0x530b81=JSON['stringify'](_0x1ccc86);var _0x59bbc1={'encoding':_0xb729('0x11'),'method':_0xb729('0x12'),'timeout':0x2710,'url':_0xbf3eb0,'headers':{'Content-Type':_0xb729('0x13')},'body':_0x530b81};return rp(_0x59bbc1)[_0xb729('0x14')](function(_0x33cd21){const _0x274eb8=JSON[_0xb729('0x15')](_0x33cd21);if(!_0x274eb8['result'][_0xb729('0x16')]){throw new Error(_0xb729('0x17'));}var _0x2ddfd5=_0x30e817;var _0x435f46=_0xb729('0x18')+_0x8de817+_0xb729('0x19')+_0x1983a5+_0xb729('0x1a')+_0x2ddfd5+_0xb729('0x1b')+JSON['stringify'](_0x5a4a8f);var _0x4fc460=_0x53e8a3+'?'+_0x435f46;return rp(_0x4fc460);})[_0xb729('0x14')](function(_0x1649c4){logger['info'](_0xb729('0x1c'),_0x29f258,_0x1649c4);_0x1fedff[_0xb729('0x1d')]();})['catch'](function(_0x3f8081){logger[_0xb729('0x1e')]('[%s][TVOX]\x20%s',_0x29f258,_[_0xb729('0x1f')](_0x3f8081)?JSON[_0xb729('0x20')](_0x3f8081):_0x3f8081);_0x1fedff[_0xb729('0x1d')]();});}else{logger['info'](_0xb729('0x21'),_0x29f258);_0x1fedff[_0xb729('0x22')]();}};}; \ 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 7342d8b..494a6ac 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x1b04ab,_0x277fbd){var _0x58990d=function(_0xc6bca){while(--_0xc6bca){_0x1b04ab['push'](_0x1b04ab['shift']());}};_0x58990d(++_0x277fbd);}(_0xe706,0xa3));var _0x6e70=function(_0x52195d,_0x52e4fd){_0x52195d=_0x52195d-0x0;var _0x522e83=_0xe706[_0x52195d];return _0x522e83;};'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 +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5ac5e2,_0x2ff97d){var _0x5249e1=function(_0x3e6f37){while(--_0x3e6f37){_0x5ac5e2['push'](_0x5ac5e2['shift']());}};_0x5249e1(++_0x2ff97d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 31c1836..63b52fc 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 _0x16eb=['lodash','util','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','appdata','split','mail','push','slice','dialogflowv2','amazonlex','TagId','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','info','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','name','waiting','mailQueues','paused','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','stringify','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:'];(function(_0x3f2057,_0x1906be){var _0x374f77=function(_0x379dd5){while(--_0x379dd5){_0x3f2057['push'](_0x3f2057['shift']());}};_0x374f77(++_0x1906be);}(_0x16eb,0x18c));var _0xb16e=function(_0x5b1486,_0x17be9c){_0x5b1486=_0x5b1486-0x0;var _0x5cd4fc=_0x16eb[_0x5b1486];return _0x5cd4fc;};'use strict';var _=require(_0xb16e('0x0'));var util=require(_0xb16e('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xb16e('0x2'));var BPromise=require('bluebird');var utils=require(_0xb16e('0x3'));var sUtils=require(_0xb16e('0x4'));var logger=require(_0xb16e('0x5'))(_0xb16e('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb16e('0x7')),'chatQueueReport':require(_0xb16e('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x25543d,_0x26b25d,_0x1ae491){return util[_0xb16e('0x9')](_0xb16e('0xa'),_0x25543d,_0x26b25d||0x0,_0x1ae491||0x0);}function getIntervals(_0x2de3b9,_0x24c290){var _0xb95406=[];if(!_[_0xb16e('0xb')](_0x24c290[_0xb16e('0xc')])&&!_['isNil'](_0x2de3b9[_0x24c290['IntervalId']])&&!_[_0xb16e('0xb')](_0x2de3b9[_0x24c290[_0xb16e('0xc')]]['Intervals'])){_0xb95406=_[_0xb16e('0xd')](_0x2de3b9[_0x24c290[_0xb16e('0xc')]][_0xb16e('0xe')],_0xb16e('0xf'));}else if(!_[_0xb16e('0xb')](_0x24c290[_0xb16e('0xf')])){_0xb95406=[_0x24c290[_0xb16e('0xf')]];}return _0xb95406;}exports[_0xb16e('0x10')]=function(_0x28cc1b){_0x28cc1b[_0xb16e('0x11')]={};return new BPromise(function(_0x473745,_0x517c7a){var _0x38f75d={'Start':function(_0x215774){var _0x288f81=this;return new Promise(function(_0x27ae2c,_0x568bbd){if(_0x215774){try{var _0x27f248=[];var _0x3ea308=getId(_0x215774[_0xb16e('0x12')],_0x215774['message']?_0x215774[_0xb16e('0x13')]['id']:0x0,_0x215774[_0xb16e('0x14')]?_0x215774[_0xb16e('0x14')]['id']:0x0);var _0x1a45a3=sUtils['checkWaitingNotifications'](_0x28cc1b,_0x215774);if(!_0x1a45a3&&_0x215774[_0xb16e('0x15')]&&_[_0xb16e('0x16')](_0x215774['applications'])&&_0x215774[_0xb16e('0x15')]['length']){for(var _0x38e8c1=0x0;_0x38e8c1<_0x215774[_0xb16e('0x15')][_0xb16e('0x17')];_0x38e8c1+=0x1){var _0x1556e9=_0x215774[_0xb16e('0x15')][_0x38e8c1];if(fs[_0xb16e('0x18')](path[_0xb16e('0x19')](__dirname,_0xb16e('0x15'),_0x1556e9[_0xb16e('0x1a')]+'.js'))){var _0x5df7d3=[];switch(_0x1556e9['app'][_0xb16e('0x1b')]()){case'autoreply':var _0x33dc7a=_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');if(_0x215774[_0xb16e('0x12')]===_0xb16e('0x1e')){_0x5df7d3[_0xb16e('0x1f')](_0x33dc7a[0x0]);_0x5df7d3['push'](_0x33dc7a[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x33dc7a[_0xb16e('0x20')](0x2,_0x33dc7a[_0xb16e('0x17')])[_0xb16e('0x19')](','));}else{_0x5df7d3[_0xb16e('0x1f')](_0x33dc7a[0x0]);_0x5df7d3['push'](_0x33dc7a[_0xb16e('0x20')](0x1,_0x33dc7a[_0xb16e('0x17')])[_0xb16e('0x19')](','));}break;case'dialogflow':var _0x58650f=_0x1556e9[_0xb16e('0x1c')]['split'](',');_0x5df7d3[_0xb16e('0x1f')](_0x58650f[0x0]);_0x5df7d3['push'](_0x58650f[0x1]);_0x5df7d3['push'](_0x58650f[_0xb16e('0x20')](0x2,_0x58650f['length'])[_0xb16e('0x19')](','));break;case _0xb16e('0x21'):var _0x525069=_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x0]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x2]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x3]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[_0xb16e('0x20')](0x4,_0x525069[_0xb16e('0x17')])['join'](','));break;case _0xb16e('0x22'):var _0x43e9d3=_0x1556e9['appdata'][_0xb16e('0x1d')](',');_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x0]);_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x2]);_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x3]);_0x5df7d3['push'](_0x43e9d3['slice'](0x4,_0x43e9d3['length'])['join'](','));break;case _0xb16e('0x13'):_0x5df7d3['push'](_0x1556e9['appdata']);break;case'tag':_0x5df7d3['push'](_0x1556e9[_0xb16e('0x23')]);_0x5df7d3[_0xb16e('0x1f')](_0x1556e9['appdata']);break;case'tvox':var _0x4317ce=utils['getMustacheRender'](_0x215774[_0xb16e('0x24')][_0xb16e('0x25')],_0x215774);var _0x453a43=_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x0]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x2]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x3]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x4]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x5]);_0x5df7d3['push'](_0x453a43[0x6]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x7]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x8]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x9]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0xa]);_0x5df7d3[_0xb16e('0x1f')](_0x215774['interaction']['id']);_0x5df7d3['push'](_0x215774[_0xb16e('0x13')]['id']);_0x5df7d3[_0xb16e('0x1f')](_0x1556e9[_0xb16e('0x26')]);_0x5df7d3[_0xb16e('0x1f')](_0x215774[_0xb16e('0x14')][_0xb16e('0x27')]);_0x5df7d3[_0xb16e('0x1f')](_0x215774['body'][_0xb16e('0x28')]);_0x5df7d3[_0xb16e('0x1f')](_0x4317ce);break;default:_0x5df7d3=_['isNil'](_0x1556e9[_0xb16e('0x1c')])?[]:_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');}var _0x18b52a={'id':util['format'](_0xb16e('0x29'),_0x3ea308,_0x1556e9['id'],_0x1556e9['app']),'condition':require(_0xb16e('0x2a'))['condition'](_0x3ea308,getIntervals(_0x28cc1b[_0xb16e('0x2b')],_0x1556e9),_0x28cc1b),'consequence':require(_0xb16e('0x2c')+_0x1556e9[_0xb16e('0x1a')])[_0xb16e('0x2d')](_0x3ea308,_0x5df7d3,_0x28cc1b,_0x215774),'p':_0x1556e9[_0xb16e('0x2e')]||0x0};logger['info'](_0xb16e('0x2f'),_0x18b52a['id'],_0xb16e('0x30'),getIntervals(_0x28cc1b[_0xb16e('0x2b')],_0x1556e9)['join'](_0xb16e('0x31')));_0x27f248[_0xb16e('0x1f')](_0x18b52a);}else{logger['error'](_0xb16e('0x32'),path[_0xb16e('0x19')](__dirname,'applications',_0x1556e9[_0xb16e('0x1a')]+'.js'));}}_0x28cc1b[_0xb16e('0x11')][_0x3ea308]=new RuleEngine(_0x27f248);_0x28cc1b['rules'][_0x3ea308][_0xb16e('0x33')](_0x215774,function(_0x4fe8cd){logger[_0xb16e('0x34')]('Applications\x20executed',JSON['stringify'](_0x4fe8cd[_0xb16e('0x35')]));if(_0x28cc1b[_0xb16e('0x11')][_0x3ea308]){_0x28cc1b[_0xb16e('0x11')][_0x3ea308][_0xb16e('0x36')](_0xb16e('0x37'));}});return _0x27ae2c({'code':0xc8,'message':_0x215774});}else{if(_0x1a45a3){logger[_0xb16e('0x34')](util[_0xb16e('0x9')](_0xb16e('0x38'),_0x3ea308));}else{logger[_0xb16e('0x34')](_0xb16e('0x39'));}return _0x27ae2c({'code':0xc8,'message':_0x215774});}}catch(_0x9c2e05){logger[_0xb16e('0x3a')](_0x9c2e05[_0xb16e('0x3b')]);return _0x568bbd(_0x288f81[_0xb16e('0x3a')](0x1f4,_0x9c2e05));}}return _0x568bbd(_0xb16e('0x3c'));});},'AcceptMessage':function(_0x10f4bb){var _0x48becf=this;return new Promise(function(_0x40b9cd,_0x4e9134){if(_0x10f4bb[_0xb16e('0x3d')]&&_0x10f4bb[_0xb16e('0x3d')]['id']){if(_0x28cc1b['agents'][_0x10f4bb['agent']['id']]){_0x28cc1b[_0xb16e('0x3e')][_0x10f4bb[_0xb16e('0x3d')]['id']][_0xb16e('0x3f')]=![];_0x28cc1b['agents'][_0x10f4bb[_0xb16e('0x3d')]['id']][_0xb16e('0x40')]=undefined;}}if(_0x10f4bb[_0xb16e('0x13')]&&_0x10f4bb[_0xb16e('0x13')]['id']){try{var _0x3a215c=getId(_0x10f4bb[_0xb16e('0x12')],_0x10f4bb[_0xb16e('0x13')]?_0x10f4bb[_0xb16e('0x13')]['id']:0x0,_0x10f4bb[_0xb16e('0x14')]?_0x10f4bb[_0xb16e('0x14')]['id']:0x0);if(_0x28cc1b[_0xb16e('0x11')][_0x3a215c]){_0x28cc1b[_0xb16e('0x11')][_0x3a215c][_0xb16e('0x36')](_0xb16e('0x41'));if(rpc[_0x10f4bb['channel']+'QueueReport']){rpc[_0x10f4bb[_0xb16e('0x12')]+_0xb16e('0x42')][_0xb16e('0x43')](_0x3a215c,{'UserId':_0x10f4bb[_0xb16e('0x13')][_0xb16e('0x44')]})[_0xb16e('0x45')](function(){logger[_0xb16e('0x3a')](_0xb16e('0x46'));});}}return _0x40b9cd({'code':0xc8,'message':_0x10f4bb});}catch(_0x509960){logger[_0xb16e('0x3a')](_0x509960[_0xb16e('0x3b')]);return _0x4e9134(_0x48becf[_0xb16e('0x3a')](0x1f4,_0x509960));}}logger[_0xb16e('0x3a')](_0xb16e('0x47'));return _0x4e9134(_0x48becf['error'](0x1f4,_0xb16e('0x47')));});},'RejectMessage':function(_0x480af0){var _0x13e30f=this;return new Promise(function(_0x47fe10,_0x18aa36){if(_0x480af0[_0xb16e('0x3d')]&&_0x480af0['agent']['id']){try{if(_0x28cc1b[_0xb16e('0x3e')][_0x480af0[_0xb16e('0x3d')]['id']]){_0x28cc1b[_0xb16e('0x3e')][_0x480af0[_0xb16e('0x3d')]['id']][_0xb16e('0x3f')]=![];_0x28cc1b[_0xb16e('0x3e')][_0x480af0[_0xb16e('0x3d')]['id']][_0xb16e('0x40')]=undefined;}return _0x47fe10({'code':0xc8,'message':_0x480af0});}catch(_0x5b7daf){logger['error'](_0x5b7daf['stack']);return _0x18aa36(_0x13e30f[_0xb16e('0x3a')](0x1f4,_0x5b7daf));}}logger['error'](_0xb16e('0x47'));return _0x18aa36(_0x13e30f[_0xb16e('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2a2e21){var _0x346dcb=this;return new Promise(function(_0x2008fc,_0x5b0bed){if(_0x2a2e21[_0xb16e('0x12')]&&_0x2a2e21[_0xb16e('0x14')]&&_0x2a2e21[_0xb16e('0x14')]['id']){try{var _0x891f11=getId(_0x2a2e21[_0xb16e('0x12')],_0x2a2e21['message']?_0x2a2e21[_0xb16e('0x13')]['id']:0x0,_0x2a2e21['interaction']?_0x2a2e21[_0xb16e('0x14')]['id']:0x0);if(_0x28cc1b[_0xb16e('0x11')][_0x891f11]){_0x28cc1b[_0xb16e('0x11')][_0x891f11][_0xb16e('0x36')](_0xb16e('0x41'));}return _0x2008fc({'code':0xc8,'message':_0x2a2e21});}catch(_0x498ea0){logger[_0xb16e('0x3a')](_0x498ea0[_0xb16e('0x3b')]);return _0x5b0bed(_0x346dcb[_0xb16e('0x3a')](0x1f4,_0x498ea0));}}logger[_0xb16e('0x3a')](_0xb16e('0x47'));return _0x5b0bed(_0x346dcb[_0xb16e('0x3a')](0x1f4,_0xb16e('0x47')));});},'AgentCapacity':function(_0x2dc4d2){var _0x4b34c6=this;return new Promise(function(_0x5bb2a5,_0x11d23e){if(_0x28cc1b[_0xb16e('0x3e')]['hasOwnProperty'](_0x2dc4d2['id'])){for(var _0x18a3c7 in _0x2dc4d2[_0xb16e('0x48')]){if(_0x2dc4d2[_0xb16e('0x48')][_0xb16e('0x49')](_0x18a3c7)){if(_0x28cc1b[_0xb16e('0x3e')][_0x2dc4d2['id']][_0xb16e('0x49')](_0x18a3c7+_0xb16e('0x4a'))){_0x28cc1b['agents'][_0x2dc4d2['id']][_0x18a3c7+_0xb16e('0x4a')]=parseInt(_0x2dc4d2[_0xb16e('0x48')][_0x18a3c7],0xa);}}}_0x28cc1b[_0xb16e('0x3e')][_0x2dc4d2['id']][_0xb16e('0x4b')]();return _0x5bb2a5({'code':0xc8,'message':_0x28cc1b[_0xb16e('0x3e')][_0x2dc4d2['id']]});}else{return _0x11d23e(_0x4b34c6['error'](0x1f4,_0xb16e('0x4c')));}});},'Agents':function(_0x21b346){return new Promise(function(_0x7b131d){var _0x5613db=_['values'](_0x28cc1b[_0xb16e('0x3e')]);if(_0x21b346&&_0x21b346['id']){var _0x3cf4f8=_[_0xb16e('0x4d')](_0x5613db,function(_0xf1b9a2){return _0xf1b9a2['id']===_0x21b346['id'];});_0x7b131d(_0x3cf4f8);}else{_0x7b131d({'count':_0x5613db[_0xb16e('0x17')],'rows':_0x5613db});}});},'ChatQueues':function(){return new Promise(function(_0x59f017){var _0xba58b4=[];for(var _0x43e7ba in _0x28cc1b[_0xb16e('0x4e')]){if(_0x28cc1b['chatQueues'][_0xb16e('0x49')](_0x43e7ba)){var _0x56576c=_0x28cc1b['chatQueues'][_0x43e7ba];var _0x54224b={'id':_0x56576c['id'],'available':_0x56576c[_0xb16e('0x4f')],'loggedIn':_0x56576c['loggedIn'],'name':_0x56576c[_0xb16e('0x50')],'paused':_0x56576c['paused'],'waiting':_0x56576c[_0xb16e('0x51')]};_0xba58b4[_0xb16e('0x1f')](_0x54224b);}}_0x59f017({'count':_0xba58b4[_0xb16e('0x17')],'rows':_0xba58b4});});},'MailQueues':function(){return new Promise(function(_0x4e0eb9){var _0x274881=[];for(var _0x35c8f3 in _0x28cc1b['mailQueues']){if(_0x28cc1b[_0xb16e('0x52')]['hasOwnProperty'](_0x35c8f3)){var _0x45f19d=_0x28cc1b['mailQueues'][_0x35c8f3];var _0x12e45d={'id':_0x45f19d['id'],'available':_0x45f19d['available'],'loggedIn':_0x45f19d['loggedIn'],'name':_0x45f19d[_0xb16e('0x50')],'paused':_0x45f19d[_0xb16e('0x53')],'waiting':_0x45f19d[_0xb16e('0x51')]};_0x274881[_0xb16e('0x1f')](_0x12e45d);}}_0x4e0eb9({'count':_0x274881[_0xb16e('0x17')],'rows':_0x274881});});},'OpenchannelQueues':function(){return new Promise(function(_0x1510b4){var _0x57a431=[];for(var _0x58f5bb in _0x28cc1b[_0xb16e('0x54')]){if(_0x28cc1b[_0xb16e('0x54')][_0xb16e('0x49')](_0x58f5bb)){var _0x56e5d8=_0x28cc1b[_0xb16e('0x54')][_0x58f5bb];var _0x22437e={'id':_0x56e5d8['id'],'available':_0x56e5d8['available'],'loggedIn':_0x56e5d8[_0xb16e('0x55')],'name':_0x56e5d8[_0xb16e('0x50')],'paused':_0x56e5d8[_0xb16e('0x53')],'waiting':_0x56e5d8[_0xb16e('0x51')]};_0x57a431['push'](_0x22437e);}}_0x1510b4({'count':_0x57a431[_0xb16e('0x17')],'rows':_0x57a431});});},'SmsQueues':function(){return new Promise(function(_0x53e89c){var _0x5f161b=[];for(var _0x4b39d6 in _0x28cc1b[_0xb16e('0x56')]){if(_0x28cc1b[_0xb16e('0x56')][_0xb16e('0x49')](_0x4b39d6)){var _0x4fa6d6=_0x28cc1b['smsQueues'][_0x4b39d6];var _0x4b67e0={'id':_0x4fa6d6['id'],'available':_0x4fa6d6['available'],'loggedIn':_0x4fa6d6[_0xb16e('0x55')],'name':_0x4fa6d6[_0xb16e('0x50')],'paused':_0x4fa6d6[_0xb16e('0x53')],'waiting':_0x4fa6d6[_0xb16e('0x51')]};_0x5f161b[_0xb16e('0x1f')](_0x4b67e0);}}_0x53e89c({'count':_0x5f161b[_0xb16e('0x17')],'rows':_0x5f161b});});},'FaxQueues':function(){return new Promise(function(_0x5262b7){var _0x14ca38=[];for(var _0x973f6d in _0x28cc1b[_0xb16e('0x57')]){if(_0x28cc1b[_0xb16e('0x57')][_0xb16e('0x49')](_0x973f6d)){var _0x1e3bd9=_0x28cc1b[_0xb16e('0x57')][_0x973f6d];var _0x4652b3={'id':_0x1e3bd9['id'],'available':_0x1e3bd9[_0xb16e('0x4f')],'loggedIn':_0x1e3bd9[_0xb16e('0x55')],'name':_0x1e3bd9[_0xb16e('0x50')],'paused':_0x1e3bd9[_0xb16e('0x53')],'waiting':_0x1e3bd9[_0xb16e('0x51')]};_0x14ca38['push'](_0x4652b3);}}_0x5262b7({'count':_0x14ca38[_0xb16e('0x17')],'rows':_0x14ca38});});},'WhatsappQueues':function(){return new Promise(function(_0x4c2c6b){var _0x4720bc=[];for(var _0x518f68 in _0x28cc1b[_0xb16e('0x58')]){if(_0x28cc1b[_0xb16e('0x58')][_0xb16e('0x49')](_0x518f68)){var _0x1e00f4=_0x28cc1b[_0xb16e('0x58')][_0x518f68];var _0x373bac={'id':_0x1e00f4['id'],'available':_0x1e00f4[_0xb16e('0x4f')],'loggedIn':_0x1e00f4[_0xb16e('0x55')],'name':_0x1e00f4[_0xb16e('0x50')],'paused':_0x1e00f4[_0xb16e('0x53')],'waiting':_0x1e00f4[_0xb16e('0x51')]};_0x4720bc['push'](_0x373bac);}}_0x4c2c6b({'count':_0x4720bc[_0xb16e('0x17')],'rows':_0x4720bc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x88fc42){var _0x46aad1=_[_0xb16e('0x59')](_0x28cc1b['chatQueuesWaitingInteractions']);_0x88fc42({'count':_0x46aad1[_0xb16e('0x17')],'rows':_0x46aad1});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x13fc3c){var _0x5da6ec=_[_0xb16e('0x59')](_0x28cc1b[_0xb16e('0x5a')]);_0x13fc3c({'count':_0x5da6ec[_0xb16e('0x17')],'rows':_0x5da6ec});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1fa215){var _0x2a3711=_['values'](_0x28cc1b['openchannelQueuesWaitingInteractions']);_0x1fa215({'count':_0x2a3711[_0xb16e('0x17')],'rows':_0x2a3711});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x540ce4){var _0x382fac=_['values'](_0x28cc1b[_0xb16e('0x5b')]);_0x540ce4({'count':_0x382fac['length'],'rows':_0x382fac});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x46919d){var _0x54fdc5=_[_0xb16e('0x59')](_0x28cc1b[_0xb16e('0x5c')]);_0x46919d({'count':_0x54fdc5[_0xb16e('0x17')],'rows':_0x54fdc5});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x413581){var _0x6be912=_[_0xb16e('0x59')](_0x28cc1b[_0xb16e('0x5d')]);_0x413581({'count':_0x6be912[_0xb16e('0x17')],'rows':_0x6be912});});}};var _0x37c183=jayson['server'](_0x38f75d)[_0xb16e('0x5e')]();_0x37c183['on'](_0xb16e('0x3a'),function(_0x5c8517){logger[_0xb16e('0x3a')](JSON[_0xb16e('0x5f')](_0x5c8517));return _0x517c7a(_0x5c8517);});_0x37c183[_0xb16e('0x10')](0x232c,'127.0.0.1',function(){console[_0xb16e('0x60')](_0xb16e('0x61'),0x232c);return _0x473745(_0xb16e('0x62')+0x232c);});});}; \ No newline at end of file +var _0x2ee2=['.js','autoreply','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','execute','Applications\x20executed','matchPath','emit','error','stack','agent','agents','busy','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','listen','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','length','join','app'];(function(_0x5b2e73,_0x2eeb88){var _0x27ee32=function(_0x56f90b){while(--_0x56f90b){_0x5b2e73['push'](_0x5b2e73['shift']());}};_0x27ee32(++_0x2eeb88);}(_0x2ee2,0xaa));var _0x22ee=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x2ee2[_0x178f52];return _0x556f99;};'use strict';var _=require(_0x22ee('0x0'));var util=require(_0x22ee('0x1'));var path=require(_0x22ee('0x2'));var fs=require('fs');var jayson=require(_0x22ee('0x3'));var BPromise=require(_0x22ee('0x4'));var utils=require(_0x22ee('0x5'));var sUtils=require(_0x22ee('0x6'));var logger=require('../../../config/logger')(_0x22ee('0x7'));var rpc={'openchannelQueueReport':require(_0x22ee('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x22ee('0x9')),'smsQueueReport':require(_0x22ee('0xa')),'faxQueueReport':require(_0x22ee('0xb')),'whatsappQueueReport':require(_0x22ee('0xc'))};var RuleEngine=require(_0x22ee('0xd'));function getId(_0xcf66da,_0x2a2442,_0xb9e223){return util[_0x22ee('0xe')](_0x22ee('0xf'),_0xcf66da,_0x2a2442||0x0,_0xb9e223||0x0);}function getIntervals(_0x15d5ea,_0x46dff9){var _0x4843c7=[];if(!_['isNil'](_0x46dff9[_0x22ee('0x10')])&&!_[_0x22ee('0x11')](_0x15d5ea[_0x46dff9[_0x22ee('0x10')]])&&!_[_0x22ee('0x11')](_0x15d5ea[_0x46dff9[_0x22ee('0x10')]]['Intervals'])){_0x4843c7=_[_0x22ee('0x12')](_0x15d5ea[_0x46dff9[_0x22ee('0x10')]][_0x22ee('0x13')],_0x22ee('0x14'));}else if(!_[_0x22ee('0x11')](_0x46dff9[_0x22ee('0x14')])){_0x4843c7=[_0x46dff9[_0x22ee('0x14')]];}return _0x4843c7;}exports['listen']=function(_0x5ee171){_0x5ee171[_0x22ee('0x15')]={};return new BPromise(function(_0x5760dc,_0x4f4bdc){var _0x1ebef1={'Start':function(_0x1d3888){var _0x2729dc=this;return new Promise(function(_0x98c770,_0x459b3a){if(_0x1d3888){try{var _0x1ca4ec=[];var _0x486e71=getId(_0x1d3888[_0x22ee('0x16')],_0x1d3888[_0x22ee('0x17')]?_0x1d3888[_0x22ee('0x17')]['id']:0x0,_0x1d3888['interaction']?_0x1d3888[_0x22ee('0x18')]['id']:0x0);var _0x55c56a=sUtils[_0x22ee('0x19')](_0x5ee171,_0x1d3888);if(!_0x55c56a&&_0x1d3888['applications']&&_['isArray'](_0x1d3888[_0x22ee('0x1a')])&&_0x1d3888[_0x22ee('0x1a')][_0x22ee('0x1b')]){for(var _0x465401=0x0;_0x465401<_0x1d3888[_0x22ee('0x1a')][_0x22ee('0x1b')];_0x465401+=0x1){var _0x3f4f56=_0x1d3888[_0x22ee('0x1a')][_0x465401];if(fs['existsSync'](path[_0x22ee('0x1c')](__dirname,_0x22ee('0x1a'),_0x3f4f56[_0x22ee('0x1d')]+_0x22ee('0x1e')))){var _0x4477bd=[];switch(_0x3f4f56[_0x22ee('0x1d')]['toLowerCase']()){case _0x22ee('0x1f'):var _0x207607=_0x3f4f56[_0x22ee('0x20')][_0x22ee('0x21')](',');if(_0x1d3888[_0x22ee('0x16')]==='mail'){_0x4477bd['push'](_0x207607[0x0]);_0x4477bd[_0x22ee('0x22')](_0x207607[0x1]);_0x4477bd[_0x22ee('0x22')](_0x207607[_0x22ee('0x23')](0x2,_0x207607[_0x22ee('0x1b')])[_0x22ee('0x1c')](','));}else{_0x4477bd['push'](_0x207607[0x0]);_0x4477bd[_0x22ee('0x22')](_0x207607[_0x22ee('0x23')](0x1,_0x207607[_0x22ee('0x1b')])[_0x22ee('0x1c')](','));}break;case _0x22ee('0x24'):var _0x5482b4=_0x3f4f56[_0x22ee('0x20')][_0x22ee('0x21')](',');_0x4477bd[_0x22ee('0x22')](_0x5482b4[0x0]);_0x4477bd[_0x22ee('0x22')](_0x5482b4[0x1]);_0x4477bd[_0x22ee('0x22')](_0x5482b4[_0x22ee('0x23')](0x2,_0x5482b4[_0x22ee('0x1b')])[_0x22ee('0x1c')](','));break;case _0x22ee('0x25'):var _0x17687c=_0x3f4f56['appdata'][_0x22ee('0x21')](',');_0x4477bd[_0x22ee('0x22')](_0x17687c[0x0]);_0x4477bd['push'](_0x17687c[0x1]);_0x4477bd['push'](_0x17687c[0x2]);_0x4477bd[_0x22ee('0x22')](_0x17687c[0x3]);_0x4477bd[_0x22ee('0x22')](_0x17687c['slice'](0x4,_0x17687c[_0x22ee('0x1b')])[_0x22ee('0x1c')](','));break;case _0x22ee('0x26'):var _0x2ca4ef=_0x3f4f56[_0x22ee('0x20')]['split'](',');_0x4477bd[_0x22ee('0x22')](_0x2ca4ef[0x0]);_0x4477bd[_0x22ee('0x22')](_0x2ca4ef[0x1]);_0x4477bd[_0x22ee('0x22')](_0x2ca4ef[0x2]);_0x4477bd[_0x22ee('0x22')](_0x2ca4ef[0x3]);_0x4477bd['push'](_0x2ca4ef[_0x22ee('0x23')](0x4,_0x2ca4ef[_0x22ee('0x1b')])[_0x22ee('0x1c')](','));break;case _0x22ee('0x17'):_0x4477bd[_0x22ee('0x22')](_0x3f4f56[_0x22ee('0x20')]);break;case _0x22ee('0x27'):_0x4477bd[_0x22ee('0x22')](_0x3f4f56[_0x22ee('0x28')]);_0x4477bd[_0x22ee('0x22')](_0x3f4f56[_0x22ee('0x20')]);break;case _0x22ee('0x29'):var _0x5237a7=utils[_0x22ee('0x2a')](_0x1d3888[_0x22ee('0x2b')]['notificationTemplate'],_0x1d3888);var _0x1fdb26=_0x3f4f56[_0x22ee('0x20')][_0x22ee('0x21')](',');_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x0]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x1]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x2]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x3]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x4]);_0x4477bd['push'](_0x1fdb26[0x5]);_0x4477bd['push'](_0x1fdb26[0x6]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x7]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x8]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0x9]);_0x4477bd[_0x22ee('0x22')](_0x1fdb26[0xa]);_0x4477bd['push'](_0x1d3888[_0x22ee('0x18')]['id']);_0x4477bd[_0x22ee('0x22')](_0x1d3888[_0x22ee('0x17')]['id']);_0x4477bd['push'](_0x3f4f56[_0x22ee('0x2c')]);_0x4477bd['push'](_0x1d3888[_0x22ee('0x18')][_0x22ee('0x2d')]);_0x4477bd[_0x22ee('0x22')](_0x1d3888[_0x22ee('0x2e')]['body']);_0x4477bd['push'](_0x5237a7);break;default:_0x4477bd=_['isNil'](_0x3f4f56[_0x22ee('0x20')])?[]:_0x3f4f56[_0x22ee('0x20')][_0x22ee('0x21')](',');}var _0x31a4b2={'id':util[_0x22ee('0xe')](_0x22ee('0x2f'),_0x486e71,_0x3f4f56['id'],_0x3f4f56['app']),'condition':require(_0x22ee('0x30'))[_0x22ee('0x31')](_0x486e71,getIntervals(_0x5ee171[_0x22ee('0x32')],_0x3f4f56),_0x5ee171),'consequence':require(_0x22ee('0x33')+_0x3f4f56[_0x22ee('0x1d')])[_0x22ee('0x34')](_0x486e71,_0x4477bd,_0x5ee171,_0x1d3888),'p':_0x3f4f56[_0x22ee('0x35')]||0x0};logger[_0x22ee('0x36')](_0x22ee('0x37'),_0x31a4b2['id'],_0x22ee('0x38'),getIntervals(_0x5ee171[_0x22ee('0x32')],_0x3f4f56)['join'](_0x22ee('0x39')));_0x1ca4ec['push'](_0x31a4b2);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x22ee('0x1c')](__dirname,_0x22ee('0x1a'),_0x3f4f56['app']+_0x22ee('0x1e')));}}_0x5ee171[_0x22ee('0x15')][_0x486e71]=new RuleEngine(_0x1ca4ec);_0x5ee171[_0x22ee('0x15')][_0x486e71][_0x22ee('0x3a')](_0x1d3888,function(_0x7da048){logger[_0x22ee('0x36')](_0x22ee('0x3b'),JSON['stringify'](_0x7da048[_0x22ee('0x3c')]));if(_0x5ee171[_0x22ee('0x15')][_0x486e71]){_0x5ee171['rules'][_0x486e71][_0x22ee('0x3d')]('complete');}});return _0x98c770({'code':0xc8,'message':_0x1d3888});}else{if(_0x55c56a){logger[_0x22ee('0x36')](util['format']('Skipped\x20routing\x20for\x20%s',_0x486e71));}else{logger[_0x22ee('0x36')]('No\x20applications\x20to\x20execute');}return _0x98c770({'code':0xc8,'message':_0x1d3888});}}catch(_0x7dcc2){logger[_0x22ee('0x3e')](_0x7dcc2[_0x22ee('0x3f')]);return _0x459b3a(_0x2729dc[_0x22ee('0x3e')](0x1f4,_0x7dcc2));}}return _0x459b3a('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2d31f6){var _0x373feb=this;return new Promise(function(_0x61a7db,_0x323778){if(_0x2d31f6[_0x22ee('0x40')]&&_0x2d31f6[_0x22ee('0x40')]['id']){if(_0x5ee171['agents'][_0x2d31f6[_0x22ee('0x40')]['id']]){_0x5ee171[_0x22ee('0x41')][_0x2d31f6[_0x22ee('0x40')]['id']][_0x22ee('0x42')]=![];_0x5ee171[_0x22ee('0x41')][_0x2d31f6[_0x22ee('0x40')]['id']][_0x22ee('0x43')]=undefined;}}if(_0x2d31f6[_0x22ee('0x17')]&&_0x2d31f6['message']['id']){try{var _0x7d2a8e=getId(_0x2d31f6[_0x22ee('0x16')],_0x2d31f6[_0x22ee('0x17')]?_0x2d31f6['message']['id']:0x0,_0x2d31f6[_0x22ee('0x18')]?_0x2d31f6[_0x22ee('0x18')]['id']:0x0);if(_0x5ee171[_0x22ee('0x15')][_0x7d2a8e]){_0x5ee171[_0x22ee('0x15')][_0x7d2a8e][_0x22ee('0x3d')](_0x22ee('0x44'));if(rpc[_0x2d31f6[_0x22ee('0x16')]+'QueueReport']){rpc[_0x2d31f6[_0x22ee('0x16')]+_0x22ee('0x45')]['update'](_0x7d2a8e,{'UserId':_0x2d31f6[_0x22ee('0x17')][_0x22ee('0x46')]})['catch'](function(){logger[_0x22ee('0x3e')](_0x22ee('0x47'));});}}return _0x61a7db({'code':0xc8,'message':_0x2d31f6});}catch(_0x354d56){logger[_0x22ee('0x3e')](_0x354d56['stack']);return _0x323778(_0x373feb[_0x22ee('0x3e')](0x1f4,_0x354d56));}}logger[_0x22ee('0x3e')](_0x22ee('0x48'));return _0x323778(_0x373feb[_0x22ee('0x3e')](0x1f4,_0x22ee('0x48')));});},'RejectMessage':function(_0x848054){var _0x3ac619=this;return new Promise(function(_0x25cfaf,_0x355492){if(_0x848054['agent']&&_0x848054[_0x22ee('0x40')]['id']){try{if(_0x5ee171[_0x22ee('0x41')][_0x848054['agent']['id']]){_0x5ee171[_0x22ee('0x41')][_0x848054[_0x22ee('0x40')]['id']]['busy']=![];_0x5ee171['agents'][_0x848054[_0x22ee('0x40')]['id']][_0x22ee('0x43')]=undefined;}return _0x25cfaf({'code':0xc8,'message':_0x848054});}catch(_0x281689){logger[_0x22ee('0x3e')](_0x281689['stack']);return _0x355492(_0x3ac619[_0x22ee('0x3e')](0x1f4,_0x281689));}}logger['error'](_0x22ee('0x48'));return _0x355492(_0x3ac619[_0x22ee('0x3e')](0x1f4,_0x22ee('0x48')));});},'AbandonInteraction':function(_0x3a78ed){var _0x31ff9e=this;return new Promise(function(_0xd73e83,_0x2e9d3e){if(_0x3a78ed[_0x22ee('0x16')]&&_0x3a78ed[_0x22ee('0x18')]&&_0x3a78ed['interaction']['id']){try{var _0x519583=getId(_0x3a78ed['channel'],_0x3a78ed[_0x22ee('0x17')]?_0x3a78ed['message']['id']:0x0,_0x3a78ed[_0x22ee('0x18')]?_0x3a78ed[_0x22ee('0x18')]['id']:0x0);if(_0x5ee171[_0x22ee('0x15')][_0x519583]){_0x5ee171[_0x22ee('0x15')][_0x519583][_0x22ee('0x3d')](_0x22ee('0x44'));}return _0xd73e83({'code':0xc8,'message':_0x3a78ed});}catch(_0x29c7b9){logger[_0x22ee('0x3e')](_0x29c7b9[_0x22ee('0x3f')]);return _0x2e9d3e(_0x31ff9e['error'](0x1f4,_0x29c7b9));}}logger[_0x22ee('0x3e')](_0x22ee('0x48'));return _0x2e9d3e(_0x31ff9e[_0x22ee('0x3e')](0x1f4,_0x22ee('0x48')));});},'AgentCapacity':function(_0x325781){var _0x5142fa=this;return new Promise(function(_0x57247a,_0x194abc){if(_0x5ee171[_0x22ee('0x41')][_0x22ee('0x49')](_0x325781['id'])){for(var _0x2128b1 in _0x325781['capacity']){if(_0x325781[_0x22ee('0x4a')][_0x22ee('0x49')](_0x2128b1)){if(_0x5ee171[_0x22ee('0x41')][_0x325781['id']][_0x22ee('0x49')](_0x2128b1+_0x22ee('0x4b'))){_0x5ee171[_0x22ee('0x41')][_0x325781['id']][_0x2128b1+_0x22ee('0x4b')]=parseInt(_0x325781['capacity'][_0x2128b1],0xa);}}}_0x5ee171[_0x22ee('0x41')][_0x325781['id']][_0x22ee('0x4c')]();return _0x57247a({'code':0xc8,'message':_0x5ee171[_0x22ee('0x41')][_0x325781['id']]});}else{return _0x194abc(_0x5142fa[_0x22ee('0x3e')](0x1f4,_0x22ee('0x4d')));}});},'Agents':function(_0x4ead76){return new Promise(function(_0x45243c){var _0xe299d2=_[_0x22ee('0x4e')](_0x5ee171[_0x22ee('0x41')]);if(_0x4ead76&&_0x4ead76['id']){var _0x5f1bf1=_[_0x22ee('0x4f')](_0xe299d2,function(_0x285b8c){return _0x285b8c['id']===_0x4ead76['id'];});_0x45243c(_0x5f1bf1);}else{_0x45243c({'count':_0xe299d2[_0x22ee('0x1b')],'rows':_0xe299d2});}});},'ChatQueues':function(){return new Promise(function(_0x51c331){var _0x4d2de3=[];for(var _0x4b14ca in _0x5ee171[_0x22ee('0x50')]){if(_0x5ee171['chatQueues'][_0x22ee('0x49')](_0x4b14ca)){var _0x4136f8=_0x5ee171[_0x22ee('0x50')][_0x4b14ca];var _0x46a4a8={'id':_0x4136f8['id'],'available':_0x4136f8['available'],'loggedIn':_0x4136f8[_0x22ee('0x51')],'name':_0x4136f8['name'],'paused':_0x4136f8[_0x22ee('0x52')],'waiting':_0x4136f8[_0x22ee('0x53')]};_0x4d2de3['push'](_0x46a4a8);}}_0x51c331({'count':_0x4d2de3[_0x22ee('0x1b')],'rows':_0x4d2de3});});},'MailQueues':function(){return new Promise(function(_0xbcccad){var _0xea9b63=[];for(var _0x37bd57 in _0x5ee171[_0x22ee('0x54')]){if(_0x5ee171[_0x22ee('0x54')][_0x22ee('0x49')](_0x37bd57)){var _0x40c9d2=_0x5ee171[_0x22ee('0x54')][_0x37bd57];var _0x23b824={'id':_0x40c9d2['id'],'available':_0x40c9d2[_0x22ee('0x55')],'loggedIn':_0x40c9d2[_0x22ee('0x51')],'name':_0x40c9d2[_0x22ee('0x56')],'paused':_0x40c9d2[_0x22ee('0x52')],'waiting':_0x40c9d2['waiting']};_0xea9b63['push'](_0x23b824);}}_0xbcccad({'count':_0xea9b63[_0x22ee('0x1b')],'rows':_0xea9b63});});},'OpenchannelQueues':function(){return new Promise(function(_0x4f27ea){var _0x4ea070=[];for(var _0x373b77 in _0x5ee171[_0x22ee('0x57')]){if(_0x5ee171[_0x22ee('0x57')]['hasOwnProperty'](_0x373b77)){var _0x10293a=_0x5ee171[_0x22ee('0x57')][_0x373b77];var _0x4b7ba9={'id':_0x10293a['id'],'available':_0x10293a[_0x22ee('0x55')],'loggedIn':_0x10293a[_0x22ee('0x51')],'name':_0x10293a[_0x22ee('0x56')],'paused':_0x10293a[_0x22ee('0x52')],'waiting':_0x10293a['waiting']};_0x4ea070['push'](_0x4b7ba9);}}_0x4f27ea({'count':_0x4ea070['length'],'rows':_0x4ea070});});},'SmsQueues':function(){return new Promise(function(_0x2e57be){var _0xa53fb7=[];for(var _0x39b7c4 in _0x5ee171[_0x22ee('0x58')]){if(_0x5ee171[_0x22ee('0x58')]['hasOwnProperty'](_0x39b7c4)){var _0x2c28f0=_0x5ee171[_0x22ee('0x58')][_0x39b7c4];var _0x3eb7b4={'id':_0x2c28f0['id'],'available':_0x2c28f0[_0x22ee('0x55')],'loggedIn':_0x2c28f0[_0x22ee('0x51')],'name':_0x2c28f0[_0x22ee('0x56')],'paused':_0x2c28f0[_0x22ee('0x52')],'waiting':_0x2c28f0[_0x22ee('0x53')]};_0xa53fb7[_0x22ee('0x22')](_0x3eb7b4);}}_0x2e57be({'count':_0xa53fb7[_0x22ee('0x1b')],'rows':_0xa53fb7});});},'FaxQueues':function(){return new Promise(function(_0x8d71f7){var _0x26d9a6=[];for(var _0xb13ae in _0x5ee171[_0x22ee('0x59')]){if(_0x5ee171['faxQueues']['hasOwnProperty'](_0xb13ae)){var _0x5e94fa=_0x5ee171[_0x22ee('0x59')][_0xb13ae];var _0x2fbd2c={'id':_0x5e94fa['id'],'available':_0x5e94fa[_0x22ee('0x55')],'loggedIn':_0x5e94fa[_0x22ee('0x51')],'name':_0x5e94fa[_0x22ee('0x56')],'paused':_0x5e94fa[_0x22ee('0x52')],'waiting':_0x5e94fa[_0x22ee('0x53')]};_0x26d9a6[_0x22ee('0x22')](_0x2fbd2c);}}_0x8d71f7({'count':_0x26d9a6[_0x22ee('0x1b')],'rows':_0x26d9a6});});},'WhatsappQueues':function(){return new Promise(function(_0x2997be){var _0x5b0d1e=[];for(var _0x10b422 in _0x5ee171['whatsappQueues']){if(_0x5ee171['whatsappQueues'][_0x22ee('0x49')](_0x10b422)){var _0x2c7691=_0x5ee171[_0x22ee('0x5a')][_0x10b422];var _0x53c820={'id':_0x2c7691['id'],'available':_0x2c7691[_0x22ee('0x55')],'loggedIn':_0x2c7691[_0x22ee('0x51')],'name':_0x2c7691['name'],'paused':_0x2c7691[_0x22ee('0x52')],'waiting':_0x2c7691[_0x22ee('0x53')]};_0x5b0d1e['push'](_0x53c820);}}_0x2997be({'count':_0x5b0d1e[_0x22ee('0x1b')],'rows':_0x5b0d1e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1ef20f){var _0x5f4ab2=_[_0x22ee('0x4e')](_0x5ee171[_0x22ee('0x5b')]);_0x1ef20f({'count':_0x5f4ab2[_0x22ee('0x1b')],'rows':_0x5f4ab2});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1bee99){var _0x2c82df=_[_0x22ee('0x4e')](_0x5ee171[_0x22ee('0x5c')]);_0x1bee99({'count':_0x2c82df['length'],'rows':_0x2c82df});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xe87c0d){var _0x3d9ea3=_[_0x22ee('0x4e')](_0x5ee171['openchannelQueuesWaitingInteractions']);_0xe87c0d({'count':_0x3d9ea3[_0x22ee('0x1b')],'rows':_0x3d9ea3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x21b348){var _0x27287c=_[_0x22ee('0x4e')](_0x5ee171[_0x22ee('0x5d')]);_0x21b348({'count':_0x27287c[_0x22ee('0x1b')],'rows':_0x27287c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x58f3bf){var _0x1a12aa=_['values'](_0x5ee171[_0x22ee('0x5e')]);_0x58f3bf({'count':_0x1a12aa[_0x22ee('0x1b')],'rows':_0x1a12aa});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x26bdf9){var _0x269127=_[_0x22ee('0x4e')](_0x5ee171[_0x22ee('0x5f')]);_0x26bdf9({'count':_0x269127[_0x22ee('0x1b')],'rows':_0x269127});});}};var _0x1556f7=jayson[_0x22ee('0x60')](_0x1ebef1)['http']();_0x1556f7['on']('error',function(_0x1ca27b){logger[_0x22ee('0x3e')](JSON[_0x22ee('0x61')](_0x1ca27b));return _0x4f4bdc(_0x1ca27b);});_0x1556f7[_0x22ee('0x62')](0x232c,'127.0.0.1',function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5760dc(_0x22ee('0x63')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 301f85b..c72c19e 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 _0xaac1=['\x20|\x20','log','stack','util','../../../config/logger','routing','client','http','request','then','error','message','catch','condition','rules','info','stop','push','Command','format','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x5491d3,_0xe8807e){var _0x4d7521=function(_0xbb41a2){while(--_0xbb41a2){_0x5491d3['push'](_0x5491d3['shift']());}};_0x4d7521(++_0xe8807e);}(_0xaac1,0x9f));var _0x1aac=function(_0x343dfb,_0xed8587){_0x343dfb=_0x343dfb-0x0;var _0x297fe2=_0xaac1[_0x343dfb];return _0x297fe2;};'use strict';var util=require(_0x1aac('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x1aac('0x1'))(_0x1aac('0x2'));var client=jayson[_0x1aac('0x3')][_0x1aac('0x4')]({'port':0x232a});function request(_0x130b8e,_0x4de08e){return new BPromise(function(_0xb7b3bd,_0x27dd80){return client[_0x1aac('0x5')](_0x130b8e,_0x4de08e)[_0x1aac('0x6')](function(_0x55b1ba){if(_0x55b1ba[_0x1aac('0x7')]){return _0x27dd80(_0x55b1ba['error'][_0x1aac('0x8')]);}else{return _0xb7b3bd(_0x55b1ba['result']);}})[_0x1aac('0x9')](function(_0x45ba1f){return _0x27dd80(_0x45ba1f);});});}exports[_0x1aac('0xa')]=function(_0x9c9fad,_0x278c99,_0x41fe0e){return function(_0x3926c6){if(_0x41fe0e[_0x1aac('0xb')]&&!_0x41fe0e[_0x1aac('0xb')][_0x9c9fad]){logger[_0x1aac('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x9c9fad);return _0x3926c6[_0x1aac('0xd')]();}var _0xbe1229=[];for(var _0x10c86f=0x0;_0x10c86f<_0x278c99['length'];_0x10c86f+=0x1){_0xbe1229[_0x1aac('0xe')](request(_0x1aac('0xf'),{'command':util[_0x1aac('0x10')]('iftime\x20%s',_0x278c99[_0x10c86f])})[_0x1aac('0x6')](function(_0x20c638){return _0x20c638&&_0x20c638[_0x1aac('0x8')]&&_0x20c638[_0x1aac('0x8')]['indexOf'](_0x1aac('0x11'))>=0x0?!![]:![];})[_0x1aac('0x9')](function(_0x1c1eba){logger[_0x1aac('0x7')](_0x1aac('0x12'),_0x9c9fad,_0x278c99[_0x10c86f]);}));}BPromise[_0x1aac('0x13')](_0xbe1229)[_0x1aac('0x6')](function(_0x2e524d){var _0xf6f6eb=_[_0x1aac('0x14')](_0x2e524d);logger[_0x1aac('0xc')](_0x1aac('0x15'),_0x9c9fad,_0x278c99[_0x1aac('0x16')](_0x1aac('0x17')),_0xf6f6eb);_0x3926c6['when'](_0xf6f6eb);})[_0x1aac('0x9')](function(_0xda8b5){console[_0x1aac('0x18')](_0xda8b5);logger[_0x1aac('0x7')](_0x1aac('0x15'),_0x9c9fad,_0x278c99[_0x1aac('0x16')]('\x20|\x20'),_0xda8b5[_0x1aac('0x19')]);_0x3926c6[_0x1aac('0xd')]();});};}; \ No newline at end of file +var _0x0d25=['error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','then','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','jayson/promise','lodash','http'];(function(_0x4dcbea,_0x304889){var _0x2f31d9=function(_0x457898){while(--_0x457898){_0x4dcbea['push'](_0x4dcbea['shift']());}};_0x2f31d9(++_0x304889);}(_0x0d25,0x1b6));var _0x50d2=function(_0x1b664d,_0x1d8695){_0x1b664d=_0x1b664d-0x0;var _0x43af6b=_0x0d25[_0x1b664d];return _0x43af6b;};'use strict';var util=require(_0x50d2('0x0'));var BPromise=require('bluebird');var jayson=require(_0x50d2('0x1'));var _=require(_0x50d2('0x2'));var logger=require('../../../config/logger')('routing');var client=jayson['client'][_0x50d2('0x3')]({'port':0x232a});function request(_0x13e55b,_0x290e44){return new BPromise(function(_0x3a8f1f,_0x1822e8){return client['request'](_0x13e55b,_0x290e44)['then'](function(_0x40efde){if(_0x40efde[_0x50d2('0x4')]){return _0x1822e8(_0x40efde[_0x50d2('0x4')][_0x50d2('0x5')]);}else{return _0x3a8f1f(_0x40efde[_0x50d2('0x6')]);}})[_0x50d2('0x7')](function(_0x17ca41){return _0x1822e8(_0x17ca41);});});}exports['condition']=function(_0x1ef158,_0x47aec7,_0x3d5208){return function(_0x109af5){if(_0x3d5208[_0x50d2('0x8')]&&!_0x3d5208['rules'][_0x1ef158]){logger[_0x50d2('0x9')](_0x50d2('0xa'),_0x1ef158);return _0x109af5[_0x50d2('0xb')]();}var _0x526d0c=[];for(var _0x1fced4=0x0;_0x1fced4<_0x47aec7[_0x50d2('0xc')];_0x1fced4+=0x1){_0x526d0c[_0x50d2('0xd')](request('Command',{'command':util[_0x50d2('0xe')](_0x50d2('0xf'),_0x47aec7[_0x1fced4])})[_0x50d2('0x10')](function(_0x1ddd6b){return _0x1ddd6b&&_0x1ddd6b[_0x50d2('0x5')]&&_0x1ddd6b[_0x50d2('0x5')]['indexOf'](_0x50d2('0x11'))>=0x0?!![]:![];})[_0x50d2('0x7')](function(_0x43bf2e){logger['error'](_0x50d2('0x12'),_0x1ef158,_0x47aec7[_0x1fced4]);}));}BPromise['all'](_0x526d0c)[_0x50d2('0x10')](function(_0x15b932){var _0xb75d57=_[_0x50d2('0x13')](_0x15b932);logger['info'](_0x50d2('0x14'),_0x1ef158,_0x47aec7[_0x50d2('0x15')](_0x50d2('0x16')),_0xb75d57);_0x109af5[_0x50d2('0x17')](_0xb75d57);})[_0x50d2('0x7')](function(_0x20feef){console[_0x50d2('0x18')](_0x20feef);logger['error'](_0x50d2('0x14'),_0x1ef158,_0x47aec7[_0x50d2('0x15')]('\x20|\x20'),_0x20feef[_0x50d2('0x19')]);_0x109af5[_0x50d2('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2238d20..f24de83 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 _0x2547=['transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten'];(function(_0x7af451,_0x1bfa95){var _0x30083a=function(_0x1a7b34){while(--_0x1a7b34){_0x7af451['push'](_0x7af451['shift']());}};_0x30083a(++_0x1bfa95);}(_0x2547,0x1cd));var _0x7254=function(_0x190394,_0x54939e){_0x190394=_0x190394-0x0;var _0x347e45=_0x2547[_0x190394];return _0x347e45;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var utils=require(_0x7254('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44b692,_0x3ea6e6){utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x4'),_0x44b692[_0x7254('0x5')],_0x44b692['channel'],_0x44b692[_0x7254('0x6')],_0x44b692[_0x7254('0x7')],_0x44b692[_0x7254('0x8')],_0x44b692[_0x7254('0x9')],_0x44b692['connectedlinenum'],_0x44b692[_0x7254('0xa')]));if(_0x44b692[_0x7254('0x6')]){utils[_0x7254('0xb')](_0x44b692['queue'])[_0x7254('0xc')](function(_0x555b2e){if(_0x555b2e){_0x44b692['type']=_0x555b2e['type'];_0x44b692[_0x7254('0xd')]=_0x44b692[_0x7254('0xe')]?_0x555b2e[_0x7254('0xf')]:![];_0x44b692[_0x7254('0x10')]=_0x44b692[_0x7254('0xd')]?_0x555b2e[_0x7254('0x11')]:0x0;}utils['request'](_0x7254('0x12'),_0x44b692);});}else{utils['request'](_0x7254('0x12'),_0x44b692);}if(_0x3ea6e6){delete transfers[_0x44b692['uniqueid']];}else{delete agents[_0x44b692[_0x7254('0x13')]];}}exports[_0x7254('0x14')]=function(_0x348d4e){try{utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x348d4e);agents[_0x348d4e[_0x7254('0x13')]]=_0x348d4e;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0xa')]='called';agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x19')]=null;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x1a')]=null;utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x1b'),_0x348d4e['uniqueid'],agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x7')],_0x348d4e[_0x7254('0x13')]));}catch(_0x45aa93){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x45aa93);}};exports[_0x7254('0x1d')]=function(_0x3b6cb6){try{if(!_[_0x7254('0x1e')](agents[_0x3b6cb6[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x3b6cb6);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x20'),_0x3b6cb6[_0x7254('0x5')],agents[_0x3b6cb6[_0x7254('0x13')]]['membername'],_0x3b6cb6['destuniqueid']));agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x1d')]=!![];agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x21')]=utils[_0x7254('0x18')]();agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0xa')]='timeout';agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x22')]=_0x7254('0x23');agents[_0x3b6cb6['destuniqueid']][_0x7254('0x24')]=_0x3b6cb6['ringtime']?parseInt(_0x3b6cb6[_0x7254('0x25')])/0x3e8:0x0;agents[_0x3b6cb6[_0x7254('0x13')]]['talktime']=0x0;unanswered[_0x7254('0x26')](_0x3b6cb6[_0x7254('0x13')]);}}catch(_0x4f684c){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x4f684c);}};exports[_0x7254('0x27')]=function(_0xfe02ea){try{_['forIn'](agents,function(_0x146028,_0x2dba3f){if(_0x146028['uniqueid']==_0xfe02ea[_0x7254('0x5')]&&!_[_0x7254('0x28')](unanswered,_0x146028[_0x7254('0x13')])){utils['debug'](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0xfe02ea);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x2a'),_0xfe02ea[_0x7254('0x5')],_0x146028['membername'],_0x146028[_0x7254('0x13')]));_0x146028['agentringnoanswer']=!![];_0x146028['agentringnoanswerAt']=utils[_0x7254('0x18')]();_0x146028[_0x7254('0xa')]=_0x7254('0x2b');_0x146028[_0x7254('0x22')]=_0x7254('0x2b');_0x146028[_0x7254('0x24')]=_0xfe02ea[_0x7254('0x24')];_0x146028[_0x7254('0x2c')]=0x0;writeDB(_0x146028);}});}catch(_0x447515){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0x447515);}};exports[_0x7254('0x2d')]=function(_0x57a7d4){try{if(agents[_0x57a7d4[_0x7254('0x13')]]){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x57a7d4);utils['info'](util[_0x7254('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x57a7d4[_0x7254('0x5')],agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x7')],_0x57a7d4[_0x7254('0x13')]));agents[_0x57a7d4[_0x7254('0x13')]]['agentconnectAt']=utils[_0x7254('0x18')]();agents[_0x57a7d4['destuniqueid']][_0x7254('0x19')]=_0x57a7d4[_0x7254('0x19')];agents[_0x57a7d4['destuniqueid']][_0x7254('0x1a')]=_0x57a7d4[_0x7254('0x1a')];agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];agents[_0x57a7d4[_0x7254('0x13')]]['lastevent']=_0x7254('0x2f');_[_0x7254('0x30')](agents,function(_0x105b8c,_0x4eca7a){if(_0x105b8c[_0x7254('0x13')]!=_0x57a7d4[_0x7254('0x13')]&&_0x105b8c[_0x7254('0x5')]==_0x57a7d4['uniqueid']){_0x105b8c[_0x7254('0x2c')]=0x0;_0x105b8c[_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];_0x105b8c[_0x7254('0x1d')]=!![];_0x105b8c[_0x7254('0x21')]=utils['now']();_0x105b8c['lastevent']=_0x7254('0x31');_0x105b8c[_0x7254('0x22')]=_0x7254('0x31');_0x105b8c[_0x7254('0x32')]=_0x57a7d4['destuniqueid'];_0x105b8c['answeredelsewheremembername']=_0x57a7d4[_0x7254('0x7')];writeDB(_0x105b8c);}});}}catch(_0x565cd8){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x565cd8);}};exports['agentcomplete']=function(_0x4adf34){try{if(!_[_0x7254('0x1e')](agents[_0x4adf34[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x33'),_0x4adf34['uniqueid']),_0x4adf34);utils['info'](util[_0x7254('0x3')](_0x7254('0x34'),_0x4adf34[_0x7254('0x5')],agents[_0x4adf34['destuniqueid']][_0x7254('0x7')],_0x4adf34[_0x7254('0x13')]));agents[_0x4adf34['destuniqueid']][_0x7254('0xe')]=!![];agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x35')]=utils[_0x7254('0x18')]();agents[_0x4adf34['destuniqueid']][_0x7254('0x2c')]=utils[_0x7254('0x36')](agents[_0x4adf34['destuniqueid']][_0x7254('0x35')],agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x37')]);agents[_0x4adf34['destuniqueid']][_0x7254('0x22')]=_0x4adf34[_0x7254('0x22')];agents[_0x4adf34['destuniqueid']]['lastevent']=_0x7254('0x38');writeDB(agents[_0x4adf34['destuniqueid']]);}}catch(_0x2e437c){utils[_0x7254('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x4adf34[_0x7254('0x5')]),_0x2e437c);}};exports[_0x7254('0x39')]=function(_0x38bcd5){try{if(!_[_0x7254('0x1e')](agents[_0x38bcd5[_0x7254('0x3a')]])){utils[_0x7254('0x15')](util['format'](_0x7254('0x3b'),_0x38bcd5['uniqueid']),_0x38bcd5);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x3c'),_0x38bcd5['uniqueid'],agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x7')],agents[_0x38bcd5[_0x7254('0x3a')]]['uniqueid']));agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3d')]=!![];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3e')]=_0x7254('0x3f');agents[_0x38bcd5['transfereruniqueid']]['transferexten']=_0x38bcd5[_0x7254('0x40')];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x41')]=agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x5')];}}catch(_0x4c6838){utils['error'](util[_0x7254('0x3')](_0x7254('0x3b'),_0x38bcd5[_0x7254('0x5')]),_0x4c6838);}};exports[_0x7254('0x42')]=function(_0x5061be){try{utils[_0x7254('0x15')](util[_0x7254('0x3')]('[%s][agents][attendedtransfer]',_0x5061be[_0x7254('0x43')]),_0x5061be);if(_0x5061be['origtransfereruniqueid']==_0x5061be[_0x7254('0x44')]){if(!_['isNil'](agents[_0x5061be[_0x7254('0x45')]])){utils['info'](util['format'](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x7')]));agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x49')];agents[_0x5061be[_0x7254('0x45')]]['transferuniqueid']=_0x5061be[_0x7254('0x43')];}if(_0x5061be[_0x7254('0x4a')]&&agents[_0x5061be[_0x7254('0x4a')]]){agents[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4b')]=0x1;transfers[_0x5061be[_0x7254('0x4a')]]=_['clone'](agents[_0x5061be[_0x7254('0x4a')]]);transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4c')]=agents[_0x5061be['secondtransfereruniqueid']]['calleridname'];transfers[_0x5061be[_0x7254('0x4a')]]['agentcalledAt']=utils['now']();transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x37')]=utils[_0x7254('0x18')]();transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x4b')]=0x2;}}else if(_0x5061be[_0x7254('0x45')]==_0x5061be[_0x7254('0x4d')]){if(!_[_0x7254('0x1e')](agents[_0x5061be[_0x7254('0x43')]])){utils['info'](util[_0x7254('0x3')](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x43')]]['membername']));agents[_0x5061be['origtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x4e')];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x41')]=_0x5061be[_0x7254('0x45')];}if(_0x5061be[_0x7254('0x4f')]&&agents[_0x5061be[_0x7254('0x4f')]]){agents[_0x5061be[_0x7254('0x4f')]]['agententerreason']=0x1;transfers[_0x5061be[_0x7254('0x4f')]]=_[_0x7254('0x50')](agents[_0x5061be[_0x7254('0x4f')]]);transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4f')]]['calleridname']=agents[_0x5061be[_0x7254('0x43')]]['calleridname'];transfers[_0x5061be[_0x7254('0x4f')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();transfers[_0x5061be[_0x7254('0x4f')]]['agentconnectAt']=utils[_0x7254('0x18')]();transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x4b')]=0x2;}}}catch(_0x42dc64){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x51'),_0x5061be[_0x7254('0x43')]),_0x42dc64);}};exports[_0x7254('0x52')]=function(_0x23b89a){try{utils['debug'](util[_0x7254('0x3')]('[%s][agents][hangup]',_0x23b89a[_0x7254('0x5')]),_0x23b89a);if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]===_0x7254('0x23')){if(_0x23b89a[_0x7254('0x53')]==='21'){agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='rejected';agents[_0x23b89a[_0x7254('0x5')]]['lastevent']=_0x7254('0x54');}utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x7')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);var _0x3f7be7=unanswered[_0x7254('0x56')](_0x23b89a[_0x7254('0x5')]);if(_0x3f7be7>-0x1){unanswered[_0x7254('0x57')](_0x3f7be7,0x1);}}if(transfers[_0x23b89a[_0x7254('0x5')]]){transfers[_0x23b89a['uniqueid']]['agentcomplete']=!![];transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')]=utils['now']();transfers[_0x23b89a['uniqueid']]['talktime']=utils[_0x7254('0x36')](transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],transfers[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='agent';transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils['info'](util['format'](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],transfers[_0x23b89a['uniqueid']][_0x7254('0x7')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(transfers[_0x23b89a['uniqueid']],!![]);}if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x37')]){agents[_0x23b89a['uniqueid']][_0x7254('0xe')]=!![];agents[_0x23b89a['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x23b89a[_0x7254('0x5')]]['talktime']=utils['diffTime'](agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],agents[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);agents[_0x23b89a[_0x7254('0x5')]]['reason']=agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x3d')]?'transfer':_0x7254('0x58');agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a['uniqueid'],agents[_0x23b89a[_0x7254('0x5')]]['membername'],agents[_0x23b89a['uniqueid']][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);}}catch(_0x54c7d5){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x59'),_0x23b89a[_0x7254('0x5')]),_0x54c7d5);}}; \ No newline at end of file +var _0x97c1=['connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','ringtime','talktime','push','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','called'];(function(_0x17de62,_0x561f1b){var _0x1014d4=function(_0x4dd9f1){while(--_0x4dd9f1){_0x17de62['push'](_0x17de62['shift']());}};_0x1014d4(++_0x561f1b);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e2e81,_0x498f9c){utils['info'](util[_0x197c('0x2')](_0x197c('0x3'),_0x5e2e81[_0x197c('0x4')],_0x5e2e81[_0x197c('0x5')],_0x5e2e81[_0x197c('0x6')],_0x5e2e81['membername'],_0x5e2e81['interface'],_0x5e2e81[_0x197c('0x7')],_0x5e2e81[_0x197c('0x8')],_0x5e2e81[_0x197c('0x9')]));if(_0x5e2e81[_0x197c('0x6')]){utils['getVoiceQueueByName'](_0x5e2e81['queue'])[_0x197c('0xa')](function(_0x5cffb8){if(_0x5cffb8){_0x5e2e81[_0x197c('0xb')]=_0x5cffb8[_0x197c('0xb')];_0x5e2e81[_0x197c('0xc')]=_0x5e2e81[_0x197c('0xd')]?_0x5cffb8['acw']:![];_0x5e2e81[_0x197c('0xe')]=_0x5e2e81[_0x197c('0xc')]?_0x5cffb8[_0x197c('0xf')]:0x0;}utils[_0x197c('0x10')](_0x197c('0x11'),_0x5e2e81);});}else{utils['request'](_0x197c('0x11'),_0x5e2e81);}if(_0x498f9c){delete transfers[_0x5e2e81[_0x197c('0x4')]];}else{delete agents[_0x5e2e81[_0x197c('0x12')]];}}exports[_0x197c('0x13')]=function(_0x567658){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x567658);agents[_0x567658[_0x197c('0x12')]]=_0x567658;agents[_0x567658[_0x197c('0x12')]]['agentcalledAt']=utils['now']();agents[_0x567658[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x16');agents[_0x567658[_0x197c('0x12')]][_0x197c('0x8')]=null;agents[_0x567658[_0x197c('0x12')]][_0x197c('0x17')]=null;utils[_0x197c('0x18')](util['format'](_0x197c('0x19'),_0x567658['uniqueid'],agents[_0x567658['destuniqueid']][_0x197c('0x1a')],_0x567658[_0x197c('0x12')]));}catch(_0x2eca5e){utils[_0x197c('0x1b')](util['format'](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x2eca5e);}};exports[_0x197c('0x1c')]=function(_0x5c278a){try{if(!_[_0x197c('0x1d')](agents[_0x5c278a[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a[_0x197c('0x4')]),_0x5c278a);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x1f'),_0x5c278a[_0x197c('0x4')],agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1a')],_0x5c278a[_0x197c('0x12')]));agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1c')]=!![];agents[_0x5c278a[_0x197c('0x12')]]['agentringnoanswerAt']=utils[_0x197c('0x20')]();agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x9')]='timeout';agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x21')]='timeout';agents[_0x5c278a['destuniqueid']][_0x197c('0x22')]=_0x5c278a['ringtime']?parseInt(_0x5c278a[_0x197c('0x23')])/0x3e8:0x0;agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x24')]=0x0;unanswered[_0x197c('0x25')](_0x5c278a[_0x197c('0x12')]);}}catch(_0x3cdcd8){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a['uniqueid']),_0x3cdcd8);}};exports['queuecallerabandon']=function(_0x574274){try{_['forIn'](agents,function(_0x5f7425,_0x4c9256){if(_0x5f7425[_0x197c('0x4')]==_0x574274[_0x197c('0x4')]&&!_['includes'](unanswered,_0x5f7425[_0x197c('0x12')])){utils['debug'](util[_0x197c('0x2')](_0x197c('0x26'),_0x574274[_0x197c('0x4')]),_0x574274);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x27'),_0x574274[_0x197c('0x4')],_0x5f7425[_0x197c('0x1a')],_0x5f7425[_0x197c('0x12')]));_0x5f7425['agentringnoanswer']=!![];_0x5f7425['agentringnoanswerAt']=utils[_0x197c('0x20')]();_0x5f7425[_0x197c('0x9')]=_0x197c('0x28');_0x5f7425[_0x197c('0x21')]=_0x197c('0x28');_0x5f7425[_0x197c('0x22')]=_0x574274[_0x197c('0x22')];_0x5f7425['talktime']=0x0;writeDB(_0x5f7425);}});}catch(_0x54e6be){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][queuecallerabandon]',_0x574274['uniqueid']),_0x54e6be);}};exports[_0x197c('0x29')]=function(_0x2a884b){try{if(agents[_0x2a884b[_0x197c('0x12')]]){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x2a'),_0x2a884b[_0x197c('0x4')]),_0x2a884b);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a884b[_0x197c('0x4')],agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x1a')],_0x2a884b[_0x197c('0x12')]));agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x2b')]=utils['now']();agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x8')]=_0x2a884b[_0x197c('0x8')];agents[_0x2a884b['destuniqueid']][_0x197c('0x17')]=_0x2a884b[_0x197c('0x17')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x2c');_[_0x197c('0x2d')](agents,function(_0x1dc01b,_0x4a12fc){if(_0x1dc01b[_0x197c('0x12')]!=_0x2a884b[_0x197c('0x12')]&&_0x1dc01b['uniqueid']==_0x2a884b['uniqueid']){_0x1dc01b[_0x197c('0x24')]=0x0;_0x1dc01b[_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];_0x1dc01b[_0x197c('0x1c')]=!![];_0x1dc01b[_0x197c('0x2e')]=utils['now']();_0x1dc01b[_0x197c('0x9')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x21')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x30')]=_0x2a884b['destuniqueid'];_0x1dc01b[_0x197c('0x31')]=_0x2a884b[_0x197c('0x1a')];writeDB(_0x1dc01b);}});}}catch(_0x6d7bda){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][agentconnect]',_0x2a884b[_0x197c('0x4')]),_0x6d7bda);}};exports[_0x197c('0xd')]=function(_0x3b7fc1){try{if(!_[_0x197c('0x1d')](agents[_0x3b7fc1[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1[_0x197c('0x4')]),_0x3b7fc1);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3b7fc1['uniqueid'],agents[_0x3b7fc1['destuniqueid']]['membername'],_0x3b7fc1[_0x197c('0x12')]));agents[_0x3b7fc1[_0x197c('0x12')]]['agentcomplete']=!![];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')]=utils['now']();agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x24')]=utils['diffTime'](agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')],agents[_0x3b7fc1['destuniqueid']][_0x197c('0x2b')]);agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x21')]=_0x3b7fc1['reason'];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x34');writeDB(agents[_0x3b7fc1[_0x197c('0x12')]]);}}catch(_0x53295b){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1['uniqueid']),_0x53295b);}};exports['blindtransfer']=function(_0x3a5089){try{if(!_[_0x197c('0x1d')](agents[_0x3a5089[_0x197c('0x35')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089['uniqueid']),_0x3a5089);utils[_0x197c('0x18')](util['format'](_0x197c('0x37'),_0x3a5089[_0x197c('0x4')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x1a')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')]));agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x38')]=!![];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x39')]=_0x197c('0x3a');agents[_0x3a5089[_0x197c('0x35')]]['transferexten']=_0x3a5089[_0x197c('0x3b')];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x3c')]=agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')];}}catch(_0x22a106){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089[_0x197c('0x4')]),_0x22a106);}};exports['attendedtransfer']=function(_0x3e3176){try{utils[_0x197c('0x14')](util[_0x197c('0x2')]('[%s][agents][attendedtransfer]',_0x3e3176[_0x197c('0x3d')]),_0x3e3176);if(_0x3e3176[_0x197c('0x3d')]==_0x3e3176[_0x197c('0x3e')]){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3f')]])){utils['info'](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3f')]]['transfer']=!![];agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x42')]=_0x3e3176[_0x197c('0x43')];agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x3c')]=_0x3e3176[_0x197c('0x3d')];}if(_0x3e3176[_0x197c('0x44')]&&agents[_0x3e3176['transfereeuniqueid']]){agents[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176['transfereeuniqueid']]=_['clone'](agents[_0x3e3176[_0x197c('0x44')]]);transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x7')]=agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x7')];transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3f')]]['calleridname'];transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x47')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x2b')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x2;}}else if(_0x3e3176[_0x197c('0x3f')]==_0x3e3176['secondtransfererlinkedid']){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3d')]])){utils[_0x197c('0x18')](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x38')]=!![];agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176[_0x197c('0x3d')]]['transferexten']=_0x3e3176[_0x197c('0x48')];agents[_0x3e3176['origtransfereruniqueid']]['transferuniqueid']=_0x3e3176['secondtransfereruniqueid'];}if(_0x3e3176['transfertargetuniqueid']&&agents[_0x3e3176[_0x197c('0x49')]]){agents[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176[_0x197c('0x49')]]=_['clone'](agents[_0x3e3176[_0x197c('0x49')]]);transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x7')]=agents[_0x3e3176['origtransfereruniqueid']][_0x197c('0x7')];transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x46')];transfers[_0x3e3176[_0x197c('0x49')]]['agentcalledAt']=utils[_0x197c('0x20')]();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x2b')]=utils['now']();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x22')]=0x0;transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x2;}}}catch(_0x5596f3){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x4a'),_0x3e3176[_0x197c('0x3d')]),_0x5596f3);}};exports[_0x197c('0x4b')]=function(_0x342efa){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x4c'),_0x342efa[_0x197c('0x4')]),_0x342efa);if(agents[_0x342efa[_0x197c('0x4')]]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]==='timeout'){if(_0x342efa['cause']==='21'){agents[_0x342efa['uniqueid']][_0x197c('0x21')]='rejected';agents[_0x342efa[_0x197c('0x4')]]['lastevent']='rejected';}utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa['uniqueid'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],agents[_0x342efa['uniqueid']][_0x197c('0x21')],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);var _0x54206a=unanswered[_0x197c('0x4e')](_0x342efa['uniqueid']);if(_0x54206a>-0x1){unanswered[_0x197c('0x4f')](_0x54206a,0x1);}}if(transfers[_0x342efa['uniqueid']]){transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0xd')]=!![];transfers[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils[_0x197c('0x20')]();transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils['diffTime'](transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]);transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]='agent';transfers[_0x342efa[_0x197c('0x4')]]['lastevent']='complete';utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x342efa[_0x197c('0x4')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],transfers[_0x342efa['uniqueid']]['lastevent']));writeDB(transfers[_0x342efa['uniqueid']],!![]);}if(agents[_0x342efa['uniqueid']]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]){agents[_0x342efa['uniqueid']]['agentcomplete']=!![];agents[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils['now']();agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils[_0x197c('0x50')](agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],agents[_0x342efa[_0x197c('0x4')]]['agentconnectAt']);agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]=agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x38')]?_0x197c('0x38'):_0x197c('0x51');agents[_0x342efa[_0x197c('0x4')]]['lastevent']=_0x197c('0x34');utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa[_0x197c('0x4')],agents[_0x342efa[_0x197c('0x4')]]['membername'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],agents[_0x342efa['uniqueid']][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);}}catch(_0x173303){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][hangup]',_0x342efa['uniqueid']),_0x173303);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index af0d117..b714db7 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 _0xfc65=['error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','xmd-callerid-preview','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','lastIndexOf','includes','hangup','noop','execif','set','gotoif','lastdata','lodash','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION'];(function(_0x2c65f4,_0x57811e){var _0x1f836f=function(_0x377506){while(--_0x377506){_0x2c65f4['push'](_0x2c65f4['shift']());}};_0x1f836f(++_0x57811e);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x4d7978,_0x2353d2){_0x4d7978=_0x4d7978-0x0;var _0x3d4179=_0xfc65[_0x4d7978];return _0x3d4179;};'use strict';var _=require(_0x5fc6('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x5fc6('0x1'));var dispositions=[_0x5fc6('0x2'),_0x5fc6('0x3'),_0x5fc6('0x3'),_0x5fc6('0x2'),_0x5fc6('0x2'),_0x5fc6('0x2'),_0x5fc6('0x4'),_0x5fc6('0x5'),_0x5fc6('0x3'),_0x5fc6('0x3'),_0x5fc6('0x3')];var channels={};function writeDB(_0x1a9600){var _0x572941;if(transfers[_0x5fc6('0x6')][_0x1a9600[_0x5fc6('0x7')]]){_0x572941=_0x1a9600[_0x5fc6('0x7')];_0x1a9600[_0x5fc6('0x7')]=transfers[_0x5fc6('0x6')][_0x1a9600[_0x5fc6('0x7')]][_0x5fc6('0x8')];}utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0xb'),_0x1a9600['uniqueid'],_0x1a9600[_0x5fc6('0xc')],_0x1a9600['queue'],_0x1a9600[_0x5fc6('0xd')],_0x1a9600[_0x5fc6('0xe')],_0x1a9600[_0x5fc6('0xf')],_0x1a9600[_0x5fc6('0x10')],_0x1a9600['lastevent']));if(_0x1a9600[_0x5fc6('0x11')]){utils[_0x5fc6('0x12')](_0x1a9600[_0x5fc6('0x11')])[_0x5fc6('0x13')](function(_0x436a0c){if(_0x436a0c){_0x1a9600[_0x5fc6('0x14')]=_0x436a0c['id'];}utils[_0x5fc6('0x15')](_0x5fc6('0x16'),_0x1a9600);});}else{utils[_0x5fc6('0x15')](_0x5fc6('0x16'),_0x1a9600);}if(channels[_0x1a9600['uniqueid']]){delete channels[_0x1a9600['uniqueid']];}else if(_0x572941&&channels[_0x572941]){if(!transfers[_0x5fc6('0x6')][_0x572941][_0x5fc6('0x17')])delete transfers['blinds'][_0x572941];delete channels[_0x572941];}}exports[_0x5fc6('0x18')]=function(_0x168119){try{utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x1a'),_0x168119[_0x5fc6('0x7')]),_0x168119);if(_0x168119['uniqueid']==_0x168119[_0x5fc6('0x1b')]&&_0x168119[_0x5fc6('0xc')]!=_0x5fc6('0x1c')){utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x1d'),_0x168119[_0x5fc6('0x7')],_0x168119[_0x5fc6('0x1e')],_0x168119[_0x5fc6('0x1f')]));channels[_0x168119[_0x5fc6('0x7')]]={'uniqueid':_0x168119[_0x5fc6('0x7')],'accountcode':_0x168119[_0x5fc6('0x11')],'source':_0x168119[_0x5fc6('0xf')],'destination':_0x168119[_0x5fc6('0x1f')],'destinationcontext':_0x168119[_0x5fc6('0x1e')],'channel':_0x168119['channel'],'starttime':utils[_0x5fc6('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5fc6('0x2'),'amaflags':_0x5fc6('0x21')};}}catch(_0x2342f4){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x1a'),_0x168119[_0x5fc6('0x7')]),_0x2342f4);}};exports['newstate']=function(_0x122890){try{utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x23'),_0x122890[_0x5fc6('0x7')]),_0x122890);if(!_[_0x5fc6('0x24')](channels[_0x122890['uniqueid']])&&_0x122890[_0x5fc6('0x25')]==0x6){utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x26'),_0x122890[_0x5fc6('0x7')],_0x122890[_0x5fc6('0x1e')],_0x122890[_0x5fc6('0xc')]));if(_[_0x5fc6('0x24')](channels[_0x122890['uniqueid']][_0x5fc6('0x27')])){channels[_0x122890[_0x5fc6('0x7')]][_0x5fc6('0x27')]=utils[_0x5fc6('0x20')]();}}else if(!_[_0x5fc6('0x24')](channels[_0x122890[_0x5fc6('0x1b')]])&&_0x122890[_0x5fc6('0x25')]==0x6&&_0x122890[_0x5fc6('0x1e')]!=_0x5fc6('0x28')){utils['info'](util[_0x5fc6('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x122890[_0x5fc6('0x7')],_0x122890[_0x5fc6('0x1b')],_0x122890[_0x5fc6('0x1e')],_0x122890[_0x5fc6('0xc')]));channels[_0x122890[_0x5fc6('0x1b')]]['accountcode']=_0x122890[_0x5fc6('0x11')];channels[_0x122890[_0x5fc6('0x1b')]][_0x5fc6('0x29')]=_0x122890[_0x5fc6('0xc')];if(_[_0x5fc6('0x24')](channels[_0x122890[_0x5fc6('0x1b')]][_0x5fc6('0x2a')])){channels[_0x122890[_0x5fc6('0x1b')]]['answertime']=utils[_0x5fc6('0x20')]();}channels[_0x122890[_0x5fc6('0x1b')]]['disposition']=dispositions[_['toNumber'](_0x122890[_0x5fc6('0x25')])]||_0x5fc6('0x4');}}catch(_0x554876){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x23'),_0x122890[_0x5fc6('0x7')]),_0x554876);}};exports['hangup']=function(_0x52e98b){try{if(!_[_0x5fc6('0x24')](channels[_0x52e98b[_0x5fc6('0x7')]])){utils['debug'](util['format'](_0x5fc6('0x2b'),_0x52e98b[_0x5fc6('0x7')]),_0x52e98b);if(_['isNil'](channels[_0x52e98b[_0x5fc6('0x7')]]['callerid'])){channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2c')]=_0x52e98b[_0x5fc6('0x2d')]+'\x20<'+_0x52e98b[_0x5fc6('0xf')]+'>';}utils['info'](util[_0x5fc6('0xa')](_0x5fc6('0x2e'),_0x52e98b[_0x5fc6('0x7')],channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2c')],_0x52e98b[_0x5fc6('0x2f')]));channels[_0x52e98b['uniqueid']][_0x5fc6('0x30')]=utils['now']();channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x31')]=utils['diffTime'](channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x30')],channels[_0x52e98b['uniqueid']]['starttime']);channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x32')]=channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2a')]?utils[_0x5fc6('0x33')](channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x30')],channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2a')]):0x0;writeDB(channels[_0x52e98b[_0x5fc6('0x7')]]);}}catch(_0x326956){utils['error'](util[_0x5fc6('0xa')](_0x5fc6('0x2b'),_0x52e98b[_0x5fc6('0x7')]),_0x326956);}};exports[_0x5fc6('0x34')]=function(_0x141d04){try{if(!_['isNil'](channels[_0x141d04['localtwolinkedid']])){utils['debug'](util[_0x5fc6('0xa')](_0x5fc6('0x35'),_0x141d04[_0x5fc6('0x36')]),_0x141d04);if(channels[_0x141d04[_0x5fc6('0x37')]]['channel']==_0x141d04[_0x5fc6('0x38')]){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0x39'),_0x141d04[_0x5fc6('0x36')],_0x141d04[_0x5fc6('0x37')],_0x141d04['secondtransfererchannel']));channels[_0x141d04[_0x5fc6('0x37')]]['destinationchannel']=_0x141d04['secondtransfererchannel'];channels[_0x141d04['localtwolinkedid']][_0x5fc6('0x3a')]='_attended';}else if(channels[_0x141d04[_0x5fc6('0x37')]][_0x5fc6('0xc')]=_0x141d04[_0x5fc6('0x3b')]){utils['info'](util[_0x5fc6('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x141d04[_0x5fc6('0x36')],_0x141d04[_0x5fc6('0x37')],_0x141d04['origtransfererchannel']));channels[_0x141d04[_0x5fc6('0x37')]]['destinationchannel']=_0x141d04[_0x5fc6('0x3c')];channels[_0x141d04[_0x5fc6('0x37')]][_0x5fc6('0x3a')]=_0x5fc6('0x3d');}}}catch(_0x4f8431){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x35'),_0x141d04[_0x5fc6('0x36')]),_0x4f8431);}};exports['musiconholdstart']=function(_0x4540dd){try{if(!_[_0x5fc6('0x24')](channels[_0x4540dd[_0x5fc6('0x7')]])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x3e'),_0x4540dd[_0x5fc6('0x7')]),_0x4540dd);channels[_0x4540dd['uniqueid']][_0x5fc6('0x3f')]=utils[_0x5fc6('0x20')]();utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x40'),_0x4540dd[_0x5fc6('0x7')],channels[_0x4540dd[_0x5fc6('0x7')]][_0x5fc6('0x3f')]));}}catch(_0x46dbfd){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x3e'),_0x4540dd[_0x5fc6('0x7')]),_0x46dbfd);}};exports['musiconholdstop']=function(_0x30614c){try{if(!_[_0x5fc6('0x24')](channels[_0x30614c[_0x5fc6('0x7')]])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')]('[%s][calls][musiconholdstop]',_0x30614c[_0x5fc6('0x7')]),_0x30614c);if(!_[_0x5fc6('0x24')](channels[_0x30614c['uniqueid']][_0x5fc6('0x3f')])){channels[_0x30614c[_0x5fc6('0x7')]][_0x5fc6('0x41')]+=utils[_0x5fc6('0x33')](utils[_0x5fc6('0x20')](),channels[_0x30614c[_0x5fc6('0x7')]][_0x5fc6('0x3f')]);utils['info'](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x30614c[_0x5fc6('0x7')],channels[_0x30614c[_0x5fc6('0x7')]][_0x5fc6('0x41')]));delete channels[_0x30614c['uniqueid']][_0x5fc6('0x3f')];}}}catch(_0x220684){utils['error'](util[_0x5fc6('0xa')](_0x5fc6('0x42'),_0x30614c[_0x5fc6('0x7')]),_0x220684);}};exports['varset']=function(_0x2acc84){try{if(!_[_0x5fc6('0x24')](channels[_0x2acc84['uniqueid']])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x43'),_0x2acc84[_0x5fc6('0x7')]),_0x2acc84);if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x45')])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2acc84['uniqueid'],_0x2acc84['value']));channels[_0x2acc84[_0x5fc6('0x7')]]['source']=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['xmd-phone'])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0x47'),_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84['uniqueid']]['destination']=_0x2acc84['value'];channels[_0x2acc84['uniqueid']][_0x5fc6('0x2c')]='\x22'+_0x2acc84[_0x5fc6('0x46')]+'\x22\x20<'+_0x2acc84[_0x5fc6('0x46')]+'>';}if(!_['isNil'](_0x2acc84['variable']['xmd-callerid-preview'])||!_[_0x5fc6('0x24')](_0x2acc84['variable'][_0x5fc6('0x48')])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2acc84[_0x5fc6('0x7')],!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['xmd-callerid-preview'])?_0x5fc6('0x49'):_0x5fc6('0x48'),_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x2c')]=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x4a')])||!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x4b')])){utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x4c'),_0x2acc84[_0x5fc6('0x7')],!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x4a')])?_0x5fc6('0x4a'):'xmcs-queue',_0x2acc84['value']));channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x4d')]=_0x5fc6('0x4e');channels[_0x2acc84[_0x5fc6('0x7')]]['lastdata']=_0x2acc84[_0x5fc6('0x46')];channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x4f')]=!![];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x50')])){utils['info'](util[_0x5fc6('0xa')](_0x5fc6('0x51'),_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]]['ContactId']=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['xmd-cdrtype'])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84['uniqueid']][_0x5fc6('0x52')]=_0x2acc84[_0x5fc6('0x46')];}if(!_['isNil'](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x53')])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x54')]=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['sipcallid'])){utils['info'](util[_0x5fc6('0xa')](_0x5fc6('0x55'),_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]]['sipcallid']=_0x2acc84[_0x5fc6('0x46')];}}}catch(_0x4d1348){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')]('[%s][calls][varset]',_0x2acc84[_0x5fc6('0x7')]),_0x4d1348);}};exports[_0x5fc6('0x56')]=function(_0x2713bb){try{if(!_['isNil'](channels[_0x2713bb[_0x5fc6('0x7')]])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x57'),_0x2713bb[_0x5fc6('0x7')]),_0x2713bb);utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0x58'),_0x2713bb[_0x5fc6('0x7')],_0x2713bb[_0x5fc6('0x59')],_0x2713bb[_0x5fc6('0x5a')]));if(_0x2713bb['application'][_0x5fc6('0x5b')]()=='set'&&_[_0x5fc6('0x5c')](_0x2713bb[_0x5fc6('0x5a')][_0x5fc6('0x5b')](),_0x5fc6('0x5d'))){var _0x44ec64=_0x2713bb[_0x5fc6('0x5a')][_0x5fc6('0x5e')]('=');var _0x32f586=_0x44ec64[0x0]['substring'](_0x44ec64[0x0][_0x5fc6('0x5f')]('(')+0x1,_0x44ec64[0x0]['lastIndexOf'](')'));var _0x47c554=_0x44ec64[0x1];channels[_0x2713bb['uniqueid']][_0x32f586]=_0x47c554;}if(!_[_0x5fc6('0x60')]([_0x5fc6('0x61'),_0x5fc6('0x62'),_0x5fc6('0x63'),_0x5fc6('0x64'),_0x5fc6('0x65')],_0x2713bb[_0x5fc6('0x59')]['toLowerCase']())){channels[_0x2713bb[_0x5fc6('0x7')]][_0x5fc6('0x4d')]=_0x2713bb[_0x5fc6('0x59')];channels[_0x2713bb[_0x5fc6('0x7')]][_0x5fc6('0x66')]=_0x2713bb['appdata'];}}}catch(_0x5dfab6){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')]('[%s][calls][newexten]',_0x2713bb['uniqueid']),_0x5dfab6);}}; \ No newline at end of file +var _0x5d0a=['xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','split','substring','lastIndexOf','includes','hangup','execif','gotoif','lastapplication','[%s][calls][newexten]','lodash','util','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<'];(function(_0x2f1f5a,_0xe16335){var _0x113ec4=function(_0x232b79){while(--_0x232b79){_0x2f1f5a['push'](_0x2f1f5a['shift']());}};_0x113ec4(++_0xe16335);}(_0x5d0a,0x173));var _0xa5d0=function(_0x1894f2,_0x1fa9db){_0x1894f2=_0x1894f2-0x0;var _0x9c2a8c=_0x5d0a[_0x1894f2];return _0x9c2a8c;};'use strict';var _=require(_0xa5d0('0x0'));var util=require(_0xa5d0('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0xa5d0('0x2'),_0xa5d0('0x2'),_0xa5d0('0x3'),_0xa5d0('0x3'),_0xa5d0('0x3'),_0xa5d0('0x4'),_0xa5d0('0x5'),_0xa5d0('0x2'),'FAILED',_0xa5d0('0x2')];var channels={};function writeDB(_0x56c62a){var _0x42574b;if(transfers[_0xa5d0('0x6')][_0x56c62a[_0xa5d0('0x7')]]){_0x42574b=_0x56c62a[_0xa5d0('0x7')];_0x56c62a[_0xa5d0('0x7')]=transfers[_0xa5d0('0x6')][_0x56c62a[_0xa5d0('0x7')]][_0xa5d0('0x8')];}utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0xb'),_0x56c62a[_0xa5d0('0x7')],_0x56c62a[_0xa5d0('0xc')],_0x56c62a[_0xa5d0('0xd')],_0x56c62a['membername'],_0x56c62a[_0xa5d0('0xe')],_0x56c62a[_0xa5d0('0xf')],_0x56c62a[_0xa5d0('0x10')],_0x56c62a[_0xa5d0('0x11')]));if(_0x56c62a[_0xa5d0('0x12')]){utils[_0xa5d0('0x13')](_0x56c62a[_0xa5d0('0x12')])[_0xa5d0('0x14')](function(_0x5f0754){if(_0x5f0754){_0x56c62a[_0xa5d0('0x15')]=_0x5f0754['id'];}utils[_0xa5d0('0x16')](_0xa5d0('0x17'),_0x56c62a);});}else{utils['request'](_0xa5d0('0x17'),_0x56c62a);}if(channels[_0x56c62a[_0xa5d0('0x7')]]){delete channels[_0x56c62a[_0xa5d0('0x7')]];}else if(_0x42574b&&channels[_0x42574b]){if(!transfers[_0xa5d0('0x6')][_0x42574b]['recording'])delete transfers[_0xa5d0('0x6')][_0x42574b];delete channels[_0x42574b];}}exports[_0xa5d0('0x18')]=function(_0x2095f7){try{utils['debug'](util[_0xa5d0('0xa')](_0xa5d0('0x19'),_0x2095f7['uniqueid']),_0x2095f7);if(_0x2095f7[_0xa5d0('0x7')]==_0x2095f7['linkedid']&&_0x2095f7[_0xa5d0('0xc')]!=_0xa5d0('0x1a')){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x1b'),_0x2095f7[_0xa5d0('0x7')],_0x2095f7[_0xa5d0('0x1c')],_0x2095f7[_0xa5d0('0x1d')]));channels[_0x2095f7[_0xa5d0('0x7')]]={'uniqueid':_0x2095f7[_0xa5d0('0x7')],'accountcode':_0x2095f7[_0xa5d0('0x12')],'source':_0x2095f7[_0xa5d0('0xf')],'destination':_0x2095f7[_0xa5d0('0x1d')],'destinationcontext':_0x2095f7[_0xa5d0('0x1c')],'channel':_0x2095f7['channel'],'starttime':utils[_0xa5d0('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa5d0('0x3'),'amaflags':_0xa5d0('0x1f')};}}catch(_0x583794){utils[_0xa5d0('0x20')](util[_0xa5d0('0xa')]('[%s][calls][newchannel]',_0x2095f7[_0xa5d0('0x7')]),_0x583794);}};exports[_0xa5d0('0x21')]=function(_0x7841ca){try{utils[_0xa5d0('0x22')](util[_0xa5d0('0xa')](_0xa5d0('0x23'),_0x7841ca[_0xa5d0('0x7')]),_0x7841ca);if(!_[_0xa5d0('0x24')](channels[_0x7841ca[_0xa5d0('0x7')]])&&_0x7841ca[_0xa5d0('0x25')]==0x6){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x26'),_0x7841ca[_0xa5d0('0x7')],_0x7841ca[_0xa5d0('0x1c')],_0x7841ca['channel']));if(_[_0xa5d0('0x24')](channels[_0x7841ca[_0xa5d0('0x7')]][_0xa5d0('0x27')])){channels[_0x7841ca['uniqueid']]['systemanswertime']=utils[_0xa5d0('0x1e')]();}}else if(!_[_0xa5d0('0x24')](channels[_0x7841ca[_0xa5d0('0x28')]])&&_0x7841ca[_0xa5d0('0x25')]==0x6&&_0x7841ca[_0xa5d0('0x1c')]!=_0xa5d0('0x29')){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x2a'),_0x7841ca[_0xa5d0('0x7')],_0x7841ca[_0xa5d0('0x28')],_0x7841ca[_0xa5d0('0x1c')],_0x7841ca[_0xa5d0('0xc')]));channels[_0x7841ca['linkedid']]['accountcode']=_0x7841ca['accountcode'];channels[_0x7841ca[_0xa5d0('0x28')]][_0xa5d0('0x2b')]=_0x7841ca[_0xa5d0('0xc')];if(_[_0xa5d0('0x24')](channels[_0x7841ca['linkedid']]['answertime'])){channels[_0x7841ca[_0xa5d0('0x28')]][_0xa5d0('0x2c')]=utils[_0xa5d0('0x1e')]();}channels[_0x7841ca[_0xa5d0('0x28')]][_0xa5d0('0x2d')]=dispositions[_[_0xa5d0('0x2e')](_0x7841ca[_0xa5d0('0x25')])]||_0xa5d0('0x4');}}catch(_0x4faf93){utils[_0xa5d0('0x20')](util[_0xa5d0('0xa')](_0xa5d0('0x23'),_0x7841ca[_0xa5d0('0x7')]),_0x4faf93);}};exports['hangup']=function(_0x399185){try{if(!_['isNil'](channels[_0x399185[_0xa5d0('0x7')]])){utils['debug'](util[_0xa5d0('0xa')](_0xa5d0('0x2f'),_0x399185['uniqueid']),_0x399185);if(_[_0xa5d0('0x24')](channels[_0x399185[_0xa5d0('0x7')]][_0xa5d0('0x30')])){channels[_0x399185[_0xa5d0('0x7')]][_0xa5d0('0x30')]=_0x399185[_0xa5d0('0x31')]+'\x20<'+_0x399185['calleridnum']+'>';}utils['info'](util[_0xa5d0('0xa')](_0xa5d0('0x32'),_0x399185[_0xa5d0('0x7')],channels[_0x399185[_0xa5d0('0x7')]][_0xa5d0('0x30')],_0x399185[_0xa5d0('0x33')]));channels[_0x399185[_0xa5d0('0x7')]][_0xa5d0('0x34')]=utils[_0xa5d0('0x1e')]();channels[_0x399185[_0xa5d0('0x7')]]['duration']=utils[_0xa5d0('0x35')](channels[_0x399185['uniqueid']][_0xa5d0('0x34')],channels[_0x399185[_0xa5d0('0x7')]][_0xa5d0('0x36')]);channels[_0x399185[_0xa5d0('0x7')]]['billableseconds']=channels[_0x399185['uniqueid']][_0xa5d0('0x2c')]?utils['diffTime'](channels[_0x399185[_0xa5d0('0x7')]][_0xa5d0('0x34')],channels[_0x399185[_0xa5d0('0x7')]][_0xa5d0('0x2c')]):0x0;writeDB(channels[_0x399185[_0xa5d0('0x7')]]);}}catch(_0x4388f8){utils[_0xa5d0('0x20')](util[_0xa5d0('0xa')](_0xa5d0('0x2f'),_0x399185[_0xa5d0('0x7')]),_0x4388f8);}};exports[_0xa5d0('0x37')]=function(_0x289c3e){try{if(!_['isNil'](channels[_0x289c3e['localtwolinkedid']])){utils[_0xa5d0('0x22')](util[_0xa5d0('0xa')](_0xa5d0('0x38'),_0x289c3e[_0xa5d0('0x39')]),_0x289c3e);if(channels[_0x289c3e[_0xa5d0('0x3a')]][_0xa5d0('0xc')]==_0x289c3e[_0xa5d0('0x3b')]){utils[_0xa5d0('0x9')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x289c3e['origtransfereruniqueid'],_0x289c3e[_0xa5d0('0x3a')],_0x289c3e[_0xa5d0('0x3c')]));channels[_0x289c3e[_0xa5d0('0x3a')]][_0xa5d0('0x2b')]=_0x289c3e[_0xa5d0('0x3c')];channels[_0x289c3e[_0xa5d0('0x3a')]][_0xa5d0('0x3d')]=_0xa5d0('0x3e');}else if(channels[_0x289c3e['localtwolinkedid']][_0xa5d0('0xc')]=_0x289c3e[_0xa5d0('0x3f')]){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x289c3e['origtransfereruniqueid'],_0x289c3e['localtwolinkedid'],_0x289c3e[_0xa5d0('0x40')]));channels[_0x289c3e[_0xa5d0('0x3a')]][_0xa5d0('0x2b')]=_0x289c3e[_0xa5d0('0x40')];channels[_0x289c3e[_0xa5d0('0x3a')]][_0xa5d0('0x3d')]=_0xa5d0('0x3e');}}}catch(_0x265f60){utils['error'](util['format'](_0xa5d0('0x38'),_0x289c3e[_0xa5d0('0x39')]),_0x265f60);}};exports[_0xa5d0('0x41')]=function(_0x5916a7){try{if(!_[_0xa5d0('0x24')](channels[_0x5916a7[_0xa5d0('0x7')]])){utils[_0xa5d0('0x22')](util[_0xa5d0('0xa')](_0xa5d0('0x42'),_0x5916a7[_0xa5d0('0x7')]),_0x5916a7);channels[_0x5916a7[_0xa5d0('0x7')]]['musiconholdstartAt']=utils['now']();utils['info'](util[_0xa5d0('0xa')](_0xa5d0('0x43'),_0x5916a7[_0xa5d0('0x7')],channels[_0x5916a7[_0xa5d0('0x7')]][_0xa5d0('0x44')]));}}catch(_0x2ee350){utils[_0xa5d0('0x20')](util[_0xa5d0('0xa')](_0xa5d0('0x42'),_0x5916a7['uniqueid']),_0x2ee350);}};exports[_0xa5d0('0x45')]=function(_0x6d9e59){try{if(!_[_0xa5d0('0x24')](channels[_0x6d9e59['uniqueid']])){utils[_0xa5d0('0x22')](util['format'](_0xa5d0('0x46'),_0x6d9e59[_0xa5d0('0x7')]),_0x6d9e59);if(!_[_0xa5d0('0x24')](channels[_0x6d9e59['uniqueid']][_0xa5d0('0x44')])){channels[_0x6d9e59[_0xa5d0('0x7')]][_0xa5d0('0x47')]+=utils[_0xa5d0('0x35')](utils[_0xa5d0('0x1e')](),channels[_0x6d9e59[_0xa5d0('0x7')]][_0xa5d0('0x44')]);utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x48'),_0x6d9e59['uniqueid'],channels[_0x6d9e59[_0xa5d0('0x7')]][_0xa5d0('0x47')]));delete channels[_0x6d9e59[_0xa5d0('0x7')]][_0xa5d0('0x44')];}}}catch(_0x587140){utils['error'](util[_0xa5d0('0xa')](_0xa5d0('0x46'),_0x6d9e59['uniqueid']),_0x587140);}};exports[_0xa5d0('0x49')]=function(_0x2a96b4){try{if(!_[_0xa5d0('0x24')](channels[_0x2a96b4[_0xa5d0('0x7')]])){utils[_0xa5d0('0x22')](util['format']('[%s][calls][varset]',_0x2a96b4[_0xa5d0('0x7')]),_0x2a96b4);if(!_[_0xa5d0('0x24')](_0x2a96b4[_0xa5d0('0x4a')]['xmd-originatecalleridnum'])){utils['info'](util[_0xa5d0('0xa')](_0xa5d0('0x4b'),_0x2a96b4['uniqueid'],_0x2a96b4['value']));channels[_0x2a96b4[_0xa5d0('0x7')]]['source']=_0x2a96b4[_0xa5d0('0x4c')];}if(!_[_0xa5d0('0x24')](_0x2a96b4['variable'][_0xa5d0('0x4d')])){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x4e'),_0x2a96b4['uniqueid'],_0x2a96b4[_0xa5d0('0x4c')]));channels[_0x2a96b4[_0xa5d0('0x7')]][_0xa5d0('0x4f')]=_0x2a96b4[_0xa5d0('0x4c')];channels[_0x2a96b4[_0xa5d0('0x7')]][_0xa5d0('0x30')]='\x22'+_0x2a96b4[_0xa5d0('0x4c')]+_0xa5d0('0x50')+_0x2a96b4[_0xa5d0('0x4c')]+'>';}if(!_['isNil'](_0x2a96b4['variable'][_0xa5d0('0x51')])||!_[_0xa5d0('0x24')](_0x2a96b4[_0xa5d0('0x4a')][_0xa5d0('0x52')])){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x53'),_0x2a96b4[_0xa5d0('0x7')],!_['isNil'](_0x2a96b4[_0xa5d0('0x4a')][_0xa5d0('0x51')])?_0xa5d0('0x51'):_0xa5d0('0x52'),_0x2a96b4[_0xa5d0('0x4c')]));channels[_0x2a96b4[_0xa5d0('0x7')]][_0xa5d0('0x30')]=_0x2a96b4[_0xa5d0('0x4c')];}if(!_[_0xa5d0('0x24')](_0x2a96b4['variable']['xmd-queue'])||!_[_0xa5d0('0x24')](_0x2a96b4['variable'][_0xa5d0('0x54')])){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x53'),_0x2a96b4[_0xa5d0('0x7')],!_[_0xa5d0('0x24')](_0x2a96b4[_0xa5d0('0x4a')][_0xa5d0('0x55')])?_0xa5d0('0x55'):_0xa5d0('0x54'),_0x2a96b4[_0xa5d0('0x4c')]));channels[_0x2a96b4[_0xa5d0('0x7')]]['lastapplication']=_0xa5d0('0x56');channels[_0x2a96b4['uniqueid']][_0xa5d0('0x57')]=_0x2a96b4['value'];channels[_0x2a96b4[_0xa5d0('0x7')]][_0xa5d0('0xd')]=!![];}if(!_[_0xa5d0('0x24')](_0x2a96b4[_0xa5d0('0x4a')][_0xa5d0('0x58')])){utils['info'](util[_0xa5d0('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x2a96b4[_0xa5d0('0x7')],_0x2a96b4[_0xa5d0('0x4c')]));channels[_0x2a96b4['uniqueid']][_0xa5d0('0x59')]=_0x2a96b4[_0xa5d0('0x4c')];}if(!_[_0xa5d0('0x24')](_0x2a96b4[_0xa5d0('0x4a')][_0xa5d0('0x5a')])){utils['info'](util[_0xa5d0('0xa')](_0xa5d0('0x5b'),_0x2a96b4[_0xa5d0('0x7')],_0x2a96b4[_0xa5d0('0x4c')]));channels[_0x2a96b4[_0xa5d0('0x7')]][_0xa5d0('0x5c')]=_0x2a96b4['value'];}if(!_[_0xa5d0('0x24')](_0x2a96b4[_0xa5d0('0x4a')][_0xa5d0('0x5d')])){utils[_0xa5d0('0x9')](util[_0xa5d0('0xa')](_0xa5d0('0x5e'),_0x2a96b4['uniqueid'],_0x2a96b4['value']));channels[_0x2a96b4[_0xa5d0('0x7')]][_0xa5d0('0x5f')]=_0x2a96b4['value'];}if(!_[_0xa5d0('0x24')](_0x2a96b4[_0xa5d0('0x4a')]['sipcallid'])){utils['info'](util[_0xa5d0('0xa')](_0xa5d0('0x60'),_0x2a96b4[_0xa5d0('0x7')],_0x2a96b4[_0xa5d0('0x4c')]));channels[_0x2a96b4[_0xa5d0('0x7')]][_0xa5d0('0x61')]=_0x2a96b4[_0xa5d0('0x4c')];}}}catch(_0x4db3d4){utils['error'](util[_0xa5d0('0xa')]('[%s][calls][varset]',_0x2a96b4['uniqueid']),_0x4db3d4);}};exports[_0xa5d0('0x62')]=function(_0x3c0e5c){try{if(!_[_0xa5d0('0x24')](channels[_0x3c0e5c['uniqueid']])){utils[_0xa5d0('0x22')](util[_0xa5d0('0xa')]('[%s][calls][newexten]',_0x3c0e5c['uniqueid']),_0x3c0e5c);utils['info'](util[_0xa5d0('0xa')](_0xa5d0('0x63'),_0x3c0e5c[_0xa5d0('0x7')],_0x3c0e5c['application'],_0x3c0e5c['appdata']));if(_0x3c0e5c[_0xa5d0('0x64')][_0xa5d0('0x65')]()==_0xa5d0('0x66')&&_['startsWith'](_0x3c0e5c[_0xa5d0('0x67')][_0xa5d0('0x65')](),'cdr')){var _0x1cc139=_0x3c0e5c['appdata'][_0xa5d0('0x68')]('=');var _0x40a7d5=_0x1cc139[0x0][_0xa5d0('0x69')](_0x1cc139[0x0][_0xa5d0('0x6a')]('(')+0x1,_0x1cc139[0x0][_0xa5d0('0x6a')](')'));var _0x23095e=_0x1cc139[0x1];channels[_0x3c0e5c['uniqueid']][_0x40a7d5]=_0x23095e;}if(!_[_0xa5d0('0x6b')]([_0xa5d0('0x6c'),'noop',_0xa5d0('0x6d'),_0xa5d0('0x66'),_0xa5d0('0x6e')],_0x3c0e5c[_0xa5d0('0x64')]['toLowerCase']())){channels[_0x3c0e5c[_0xa5d0('0x7')]][_0xa5d0('0x6f')]=_0x3c0e5c[_0xa5d0('0x64')];channels[_0x3c0e5c['uniqueid']][_0xa5d0('0x57')]=_0x3c0e5c['appdata'];}}}catch(_0x1394d8){utils['error'](util[_0xa5d0('0xa')](_0xa5d0('0x70'),_0x3c0e5c[_0xa5d0('0x7')]),_0x1394d8);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 8e520c6..c0e609d 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 _0x4718=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x2a6297,_0xdf8f8f){var _0x2bb76a=function(_0x202a95){while(--_0x202a95){_0x2a6297['push'](_0x2a6297['shift']());}};_0x2bb76a(++_0xdf8f8f);}(_0x4718,0x18d));var _0x8471=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4718[_0x4b055c];return _0x4b62bb;};'use strict';var utils=require(_0x8471('0x0'));exports[_0x8471('0x1')]=function(){utils[_0x8471('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x8471('0x2')](_0x8471('0x3'));};exports[_0x8471('0x4')]=function(){utils[_0x8471('0x2')](_0x8471('0x5'));};exports[_0x8471('0x6')]=function(_0x323831){utils[_0x8471('0x6')](_0x8471('0x7'),_0x323831);};exports['close']=function(){utils[_0x8471('0x2')](_0x8471('0x8'));};exports[_0x8471('0x9')]=function(_0x15979f){}; \ No newline at end of file +var _0xed21=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x20210e,_0x1603f6){var _0x439c00=function(_0x5b4cc2){while(--_0x5b4cc2){_0x20210e['push'](_0x20210e['shift']());}};_0x439c00(++_0x1603f6);}(_0xed21,0x9e));var _0x1ed2=function(_0xf3c5e,_0x22fcc1){_0xf3c5e=_0xf3c5e-0x0;var _0x562f2b=_0xed21[_0xf3c5e];return _0x562f2b;};'use strict';var utils=require(_0x1ed2('0x0'));exports[_0x1ed2('0x1')]=function(){utils[_0x1ed2('0x2')](_0x1ed2('0x3'));};exports['shutdown']=function(){utils[_0x1ed2('0x2')](_0x1ed2('0x4'));};exports[_0x1ed2('0x5')]=function(){utils[_0x1ed2('0x2')](_0x1ed2('0x6'));};exports[_0x1ed2('0x7')]=function(_0x1f92d6){utils[_0x1ed2('0x7')](_0x1ed2('0x8'),_0x1f92d6);};exports[_0x1ed2('0x9')]=function(){utils[_0x1ed2('0x2')](_0x1ed2('0xa'));};exports[_0x1ed2('0xb')]=function(_0x27a300){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 11b6ac1..b8f5351 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 _0x4153=['request','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','isNil','debug','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x4153,0x90));var _0x3415=function(_0x59cfce,_0x3dbbc9){_0x59cfce=_0x59cfce-0x0;var _0x1cf483=_0x4153[_0x59cfce];return _0x1cf483;};'use strict';var _=require(_0x3415('0x0'));var util=require(_0x3415('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x20a703){utils[_0x3415('0x2')](util['format'](_0x3415('0x3'),_0x20a703[_0x3415('0x4')],_0x20a703[_0x3415('0x5')],_0x20a703[_0x3415('0x6')],_0x20a703[_0x3415('0x7')],_0x20a703['connectedlinenum'],_0x20a703[_0x3415('0x8')]));utils[_0x3415('0x9')]('CreateVoiceDialReport',_0x20a703);delete dials[_0x20a703[_0x3415('0x4')]];}exports['newexten']=function(_0x533658){try{utils['debug'](util[_0x3415('0xa')](_0x3415('0xb'),_0x533658[_0x3415('0x4')]),_0x533658);utils[_0x3415('0x2')](util['format'](_0x3415('0xc'),_0x533658[_0x3415('0x4')],_0x533658[_0x3415('0xd')],_0x533658[_0x3415('0xe')]));if(_0x533658[_0x3415('0xd')][_0x3415('0xf')]()==_0x3415('0x10')&&_[_0x3415('0x11')](_0x533658[_0x3415('0xe')][_0x3415('0xf')](),_0x3415('0x12'))){var _0x579f84=_0x533658[_0x3415('0xe')][_0x3415('0x13')]('=');dials[_0x533658[_0x3415('0x4')]]={'routeId':_0x579f84[0x1]};}}catch(_0x17792f){utils['error'](util['format'](_0x3415('0xb'),_0x533658[_0x3415('0x4')]),_0x17792f);}};exports[_0x3415('0x14')]=function(_0x1a4b6c){try{utils['debug'](util[_0x3415('0xa')](_0x3415('0x15'),_0x1a4b6c[_0x3415('0x4')]),_0x1a4b6c);if(!_['isNil'](_0x1a4b6c[_0x3415('0x16')][_0x3415('0x17')])){utils[_0x3415('0x2')](util['format'](_0x3415('0x18'),_0x1a4b6c[_0x3415('0x4')],_0x1a4b6c['value']));dials[_0x1a4b6c[_0x3415('0x4')]]={'routeId':_0x1a4b6c[_0x3415('0x19')]};}}catch(_0x7346b0){utils[_0x3415('0x1a')](util[_0x3415('0xa')](_0x3415('0x15'),_0x1a4b6c[_0x3415('0x4')]),_0x7346b0);}};exports[_0x3415('0x1b')]=function(_0xc26d5c){try{if(!_[_0x3415('0x1c')](dials[_0xc26d5c['uniqueid']])){utils[_0x3415('0x1d')](util[_0x3415('0xa')]('[%s][dials][dialbegin]',_0xc26d5c[_0x3415('0x4')]),_0xc26d5c);dials[_0xc26d5c[_0x3415('0x4')]]=_['assign'](dials[_0xc26d5c['uniqueid']],_0xc26d5c);dials[_0xc26d5c['uniqueid']][_0x3415('0x1e')]=utils[_0x3415('0x1f')]();dials[_0xc26d5c[_0x3415('0x4')]][_0x3415('0x20')]=_0x3415('0x21');utils[_0x3415('0x2')](util['format'](_0x3415('0x22'),_0xc26d5c[_0x3415('0x4')],dials[_0xc26d5c[_0x3415('0x4')]][_0x3415('0x1e')]));}}catch(_0x2bb093){utils[_0x3415('0x1a')](util['format'](_0x3415('0x23'),_0xc26d5c['uniqueid']),_0x2bb093);}};exports[_0x3415('0x24')]=function(_0x386998){try{if(!_[_0x3415('0x1c')](dials[_0x386998[_0x3415('0x4')]])){utils[_0x3415('0x1d')](util[_0x3415('0xa')](_0x3415('0x25'),_0x386998[_0x3415('0x4')]),_0x386998);dials[_0x386998['uniqueid']][_0x3415('0x8')]=_0x386998[_0x3415('0x8')];if(_0x386998['dialstatus']==_0x3415('0x26')){dials[_0x386998[_0x3415('0x4')]]=_[_0x3415('0x27')](dials[_0x386998[_0x3415('0x4')]],_0x386998);dials[_0x386998[_0x3415('0x4')]][_0x3415('0x28')]=utils[_0x3415('0x1f')]();dials[_0x386998['uniqueid']][_0x3415('0x20')]=_0x3415('0x29');utils[_0x3415('0x2')](util[_0x3415('0xa')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x386998[_0x3415('0x4')],_0x386998[_0x3415('0x8')],dials[_0x386998[_0x3415('0x4')]]['answertime']));}else{utils[_0x3415('0x2')](util[_0x3415('0xa')]('[%s][dials][dialend]\x20dialstatus:%s',_0x386998[_0x3415('0x4')],_0x386998[_0x3415('0x8')]));}}}catch(_0x3a83b8){utils[_0x3415('0x1a')](util['format']('[%s][dials][dialend]',_0x386998[_0x3415('0x4')]),_0x3a83b8);}};exports[_0x3415('0x2a')]=function(_0x54e762){try{if(!_['isNil'](dials[_0x54e762['uniqueid']])){utils['debug'](util[_0x3415('0xa')]('[%s][dials][hangup]',_0x54e762[_0x3415('0x4')]),_0x54e762);utils[_0x3415('0x2')](util[_0x3415('0xa')](_0x3415('0x2b'),_0x54e762[_0x3415('0x4')],_0x54e762[_0x3415('0x7')],_0x54e762[_0x3415('0x2c')],_0x54e762[_0x3415('0x2d')]));dials[_0x54e762[_0x3415('0x4')]]=_[_0x3415('0x27')](dials[_0x54e762[_0x3415('0x4')]],{'endtime':utils[_0x3415('0x1f')](),'lastevent':_0x3415('0x2e')});dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x2f')]=utils[_0x3415('0x30')](dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x31')],dials[_0x54e762['uniqueid']]['starttime']);dials[_0x54e762['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x28')]||dials[_0x54e762['uniqueid']]['endtime'],dials[_0x54e762[_0x3415('0x4')]]['starttime']);dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x32')]=dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x28')]?utils[_0x3415('0x30')](dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x31')],dials[_0x54e762['uniqueid']]['answertime']):0x0;writeDB(dials[_0x54e762[_0x3415('0x4')]]);}}catch(_0x473ab1){utils[_0x3415('0x1a')](util[_0x3415('0xa')]('[%s][dials][hangup]',_0x54e762[_0x3415('0x4')]),_0x473ab1);}}; \ No newline at end of file +var _0x04b3=['error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialend]','dialstatus','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','complete','duration','diffTime','endtime','billableseconds','lodash','util','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split'];(function(_0x10bf5c,_0x2fdc30){var _0x4c5791=function(_0x38be8a){while(--_0x38be8a){_0x10bf5c['push'](_0x10bf5c['shift']());}};_0x4c5791(++_0x2fdc30);}(_0x04b3,0x10c));var _0x304b=function(_0x30b289,_0x4bd0a9){_0x30b289=_0x30b289-0x0;var _0xa92a8e=_0x04b3[_0x30b289];return _0xa92a8e;};'use strict';var _=require(_0x304b('0x0'));var util=require(_0x304b('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x49b7da){utils['info'](util[_0x304b('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x49b7da[_0x304b('0x3')],_0x49b7da[_0x304b('0x4')],_0x49b7da[_0x304b('0x5')],_0x49b7da[_0x304b('0x6')],_0x49b7da[_0x304b('0x7')],_0x49b7da['dialstatus']));utils['request'](_0x304b('0x8'),_0x49b7da);delete dials[_0x49b7da[_0x304b('0x3')]];}exports[_0x304b('0x9')]=function(_0x5e9032){try{utils[_0x304b('0xa')](util[_0x304b('0x2')](_0x304b('0xb'),_0x5e9032['uniqueid']),_0x5e9032);utils[_0x304b('0xc')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x5e9032[_0x304b('0x3')],_0x5e9032[_0x304b('0xd')],_0x5e9032[_0x304b('0xe')]));if(_0x5e9032['application']['toLowerCase']()==_0x304b('0xf')&&_[_0x304b('0x10')](_0x5e9032['appdata'][_0x304b('0x11')](),_0x304b('0x12'))){var _0x17dda5=_0x5e9032[_0x304b('0xe')][_0x304b('0x13')]('=');dials[_0x5e9032[_0x304b('0x3')]]={'routeId':_0x17dda5[0x1]};}}catch(_0x314e91){utils[_0x304b('0x14')](util['format'](_0x304b('0xb'),_0x5e9032[_0x304b('0x3')]),_0x314e91);}};exports[_0x304b('0x15')]=function(_0x2ab640){try{utils['debug'](util[_0x304b('0x2')](_0x304b('0x16'),_0x2ab640[_0x304b('0x3')]),_0x2ab640);if(!_[_0x304b('0x17')](_0x2ab640[_0x304b('0x18')][_0x304b('0x19')])){utils[_0x304b('0xc')](util[_0x304b('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x2ab640['uniqueid'],_0x2ab640[_0x304b('0x1a')]));dials[_0x2ab640[_0x304b('0x3')]]={'routeId':_0x2ab640['value']};}}catch(_0x18f94a){utils[_0x304b('0x14')](util[_0x304b('0x2')]('[%s][dials][varset]',_0x2ab640[_0x304b('0x3')]),_0x18f94a);}};exports[_0x304b('0x1b')]=function(_0x6873d2){try{if(!_['isNil'](dials[_0x6873d2[_0x304b('0x3')]])){utils['debug'](util['format'](_0x304b('0x1c'),_0x6873d2['uniqueid']),_0x6873d2);dials[_0x6873d2['uniqueid']]=_[_0x304b('0x1d')](dials[_0x6873d2['uniqueid']],_0x6873d2);dials[_0x6873d2['uniqueid']]['starttime']=utils[_0x304b('0x1e')]();dials[_0x6873d2[_0x304b('0x3')]][_0x304b('0x1f')]=_0x304b('0x20');utils['info'](util[_0x304b('0x2')](_0x304b('0x21'),_0x6873d2[_0x304b('0x3')],dials[_0x6873d2['uniqueid']][_0x304b('0x22')]));}}catch(_0x61dc6a){utils['error'](util[_0x304b('0x2')](_0x304b('0x1c'),_0x6873d2[_0x304b('0x3')]),_0x61dc6a);}};exports['dialend']=function(_0x3cc924){try{if(!_[_0x304b('0x17')](dials[_0x3cc924[_0x304b('0x3')]])){utils[_0x304b('0xa')](util[_0x304b('0x2')](_0x304b('0x23'),_0x3cc924[_0x304b('0x3')]),_0x3cc924);dials[_0x3cc924['uniqueid']][_0x304b('0x24')]=_0x3cc924[_0x304b('0x24')];if(_0x3cc924[_0x304b('0x24')]=='ANSWER'){dials[_0x3cc924[_0x304b('0x3')]]=_[_0x304b('0x1d')](dials[_0x3cc924[_0x304b('0x3')]],_0x3cc924);dials[_0x3cc924['uniqueid']][_0x304b('0x25')]=utils['now']();dials[_0x3cc924[_0x304b('0x3')]][_0x304b('0x1f')]=_0x304b('0x26');utils[_0x304b('0xc')](util[_0x304b('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3cc924[_0x304b('0x3')],_0x3cc924['dialstatus'],dials[_0x3cc924['uniqueid']][_0x304b('0x25')]));}else{utils[_0x304b('0xc')](util['format'](_0x304b('0x27'),_0x3cc924[_0x304b('0x3')],_0x3cc924[_0x304b('0x24')]));}}}catch(_0x4f4511){utils['error'](util[_0x304b('0x2')](_0x304b('0x23'),_0x3cc924[_0x304b('0x3')]),_0x4f4511);}};exports[_0x304b('0x28')]=function(_0x587bc2){try{if(!_[_0x304b('0x17')](dials[_0x587bc2['uniqueid']])){utils[_0x304b('0xa')](util[_0x304b('0x2')](_0x304b('0x29'),_0x587bc2[_0x304b('0x3')]),_0x587bc2);utils[_0x304b('0xc')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x587bc2['uniqueid'],_0x587bc2[_0x304b('0x6')],_0x587bc2[_0x304b('0x2a')],_0x587bc2['cause-txt']));dials[_0x587bc2[_0x304b('0x3')]]=_[_0x304b('0x1d')](dials[_0x587bc2[_0x304b('0x3')]],{'endtime':utils[_0x304b('0x1e')](),'lastevent':_0x304b('0x2b')});dials[_0x587bc2['uniqueid']][_0x304b('0x2c')]=utils[_0x304b('0x2d')](dials[_0x587bc2[_0x304b('0x3')]][_0x304b('0x2e')],dials[_0x587bc2[_0x304b('0x3')]][_0x304b('0x22')]);dials[_0x587bc2[_0x304b('0x3')]]['holdtime']=utils['diffTime'](dials[_0x587bc2[_0x304b('0x3')]][_0x304b('0x25')]||dials[_0x587bc2[_0x304b('0x3')]][_0x304b('0x2e')],dials[_0x587bc2[_0x304b('0x3')]]['starttime']);dials[_0x587bc2[_0x304b('0x3')]][_0x304b('0x2f')]=dials[_0x587bc2[_0x304b('0x3')]][_0x304b('0x25')]?utils[_0x304b('0x2d')](dials[_0x587bc2[_0x304b('0x3')]]['endtime'],dials[_0x587bc2[_0x304b('0x3')]][_0x304b('0x25')]):0x0;writeDB(dials[_0x587bc2[_0x304b('0x3')]]);}}catch(_0x2bbb4a){utils[_0x304b('0x14')](util[_0x304b('0x2')]('[%s][dials][hangup]',_0x587bc2['uniqueid']),_0x2bbb4a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index dc8bf65..e5a2ca7 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 _0xa329=['asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','asterisk','port','password','keepConnected','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','device','devicestatechange','[%s][index][devicestatechange]','agentcalled','format','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x2230c2,_0x41909e){var _0x2085a8=function(_0x2b5241){while(--_0x2b5241){_0x2230c2['push'](_0x2230c2['shift']());}};_0x2085a8(++_0x41909e);}(_0xa329,0xcf));var _0x9a32=function(_0x37f362,_0x33d31f){_0x37f362=_0x37f362-0x0;var _0x5ddf9d=_0xa329[_0x37f362];return _0x5ddf9d;};var AsteriskManager=require(_0x9a32('0x0'));var config=require(_0x9a32('0x1'));var utils=require(_0x9a32('0x2'));var util=require(_0x9a32('0x3'));var isXDREnabled=config[_0x9a32('0x4')]&&config['xdr']['disabled']?!config[_0x9a32('0x4')][_0x9a32('0x5')]:!![];var isProduction=config['env']===_0x9a32('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x9a32('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x9a32('0x7')][_0x9a32('0x8')],config[_0x9a32('0x7')]['ip'],config[_0x9a32('0x7')]['username'],config[_0x9a32('0x7')][_0x9a32('0x9')],!![]);ami[_0x9a32('0xa')]();if(!isXDREnabled){utils[_0x9a32('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x9a32('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x9a32('0xc'));var calls=require(_0x9a32('0xd'));var queues=require(_0x9a32('0xe'));var recordings=require(_0x9a32('0xf'));var members=require(_0x9a32('0x10'));var dials=require(_0x9a32('0x11'));var transfers=require(_0x9a32('0x12'));var core=require(_0x9a32('0x13'));ami['on']('connect',core[_0x9a32('0x14')]);ami['on'](_0x9a32('0x15'),core[_0x9a32('0x15')]);ami['on'](_0x9a32('0x16'),core['fullybooted']);ami['on']('error',core[_0x9a32('0x17')]);ami['on'](_0x9a32('0x18'),core[_0x9a32('0x18')]);ami['on']('managerevent',core[_0x9a32('0x19')]);ami['on']('devicestatechange',function(_0x4b41d4){try{utils[_0x9a32('0x1a')](util['format']('[%s][index][devicestatechange]',_0x4b41d4[_0x9a32('0x1b')]),_0x4b41d4);members[_0x9a32('0x1c')](_0x4b41d4);}catch(_0x334a4f){utils[_0x9a32('0x17')](util['format'](_0x9a32('0x1d'),_0x4b41d4[_0x9a32('0x1b')]),_0x334a4f);}});ami['on'](_0x9a32('0x1e'),function(_0x148f96){try{utils[_0x9a32('0x1a')](util['format']('[%s][index][agentcalled]',_0x148f96['uniqueid']),_0x148f96);agents[_0x9a32('0x1e')](_0x148f96);}catch(_0x5866b6){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')]('[%s][index][agentcalled]',_0x148f96[_0x9a32('0x20')]),_0x5866b6);}});ami['on'](_0x9a32('0x21'),function(_0x2b15cf){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x22'),_0x2b15cf[_0x9a32('0x20')]),_0x2b15cf);agents[_0x9a32('0x21')](_0x2b15cf);}catch(_0x5e7bd6){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x22'),_0x2b15cf[_0x9a32('0x20')]),_0x5e7bd6);}});ami['on'](_0x9a32('0x23'),function(_0x2c29e9){try{utils[_0x9a32('0x1a')](util['format'](_0x9a32('0x24'),_0x2c29e9[_0x9a32('0x20')]),_0x2c29e9);agents[_0x9a32('0x23')](_0x2c29e9);queues[_0x9a32('0x23')](_0x2c29e9);}catch(_0x49427d){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x24'),_0x2c29e9[_0x9a32('0x20')]),_0x49427d);}});ami['on']('agentcomplete',function(_0x301e22){try{utils[_0x9a32('0x1a')](util['format'](_0x9a32('0x25'),_0x301e22[_0x9a32('0x20')]),_0x301e22);agents[_0x9a32('0x26')](_0x301e22);queues[_0x9a32('0x26')](_0x301e22);members[_0x9a32('0x26')](_0x301e22);}catch(_0x3edc97){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x25'),_0x301e22[_0x9a32('0x20')]),_0x3edc97);}});ami['on'](_0x9a32('0x27'),function(_0x3c0ee2){try{utils['debug'](util['format'](_0x9a32('0x28'),_0x3c0ee2[_0x9a32('0x20')]),_0x3c0ee2);agents[_0x9a32('0x27')](_0x3c0ee2);queues['queuecallerabandon'](_0x3c0ee2);}catch(_0x1511fd){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')]('[%s][index][queuecallerabandon]',_0x3c0ee2['uniqueid']),_0x1511fd);}});ami['on']('queuecallerjoin',function(_0x1a25ad){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x29'),_0x1a25ad[_0x9a32('0x20')]),_0x1a25ad);queues[_0x9a32('0x2a')](_0x1a25ad);recordings[_0x9a32('0x2a')](_0x1a25ad);}catch(_0x5282ea){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x29'),_0x1a25ad[_0x9a32('0x20')]),_0x5282ea);}});ami['on'](_0x9a32('0x2b'),function(_0x16d2f8){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x2c'),_0x16d2f8[_0x9a32('0x20')]),_0x16d2f8);queues[_0x9a32('0x2b')](_0x16d2f8);}catch(_0x5b786f){utils['error'](util[_0x9a32('0x1f')](_0x9a32('0x2c'),_0x16d2f8[_0x9a32('0x20')]),_0x5b786f);}});ami['on'](_0x9a32('0x2d'),function(_0x4d06e3){try{utils['debug'](util[_0x9a32('0x1f')]('[%s][index][musiconholdstart]',_0x4d06e3[_0x9a32('0x20')]),_0x4d06e3);queues[_0x9a32('0x2d')](_0x4d06e3);calls[_0x9a32('0x2d')](_0x4d06e3);}catch(_0x19d7da){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')]('[%s][index][musiconholdstart]',_0x4d06e3[_0x9a32('0x20')]),_0x19d7da);}});ami['on'](_0x9a32('0x2e'),function(_0x3008b0){try{utils['debug'](util['format'](_0x9a32('0x2f'),_0x3008b0['uniqueid']),_0x3008b0);queues['musiconholdstop'](_0x3008b0);calls[_0x9a32('0x2e')](_0x3008b0);}catch(_0x1f5695){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x2f'),_0x3008b0['uniqueid']),_0x1f5695);}});ami['on'](_0x9a32('0x30'),function(_0x519362){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')]('[%s][index][newstate]',_0x519362['uniqueid']),_0x519362);calls[_0x9a32('0x30')](_0x519362);recordings[_0x9a32('0x30')](_0x519362);}catch(_0xe78e82){utils[_0x9a32('0x17')](util['format']('[%s][index][newstate]',_0x519362['uniqueid']),_0xe78e82);}});ami['on'](_0x9a32('0x31'),function(_0x314773){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x32'),_0x314773[_0x9a32('0x20')]),_0x314773);calls[_0x9a32('0x31')](_0x314773);recordings[_0x9a32('0x31')](_0x314773);dials[_0x9a32('0x31')](_0x314773);agents[_0x9a32('0x31')](_0x314773);queues['hangup'](_0x314773);}catch(_0x40738d){utils[_0x9a32('0x17')](util['format']('[%s][index][hangup]',_0x314773[_0x9a32('0x20')]),_0x40738d);}});ami['on'](_0x9a32('0x33'),function(_0x240566){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x34'),_0x240566[_0x9a32('0x20')]),_0x240566);members['cdr'](_0x240566);}catch(_0x17ba50){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x34'),_0x240566[_0x9a32('0x20')]),_0x17ba50);}});ami['on']('blindtransfer',function(_0x5c8e40){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')]('[%s][index][blindtransfer]',_0x5c8e40[_0x9a32('0x20')]),_0x5c8e40);queues['blindtransfer'](_0x5c8e40);agents[_0x9a32('0x35')](_0x5c8e40);transfers[_0x9a32('0x35')](_0x5c8e40);recordings[_0x9a32('0x35')](_0x5c8e40);}catch(_0x1d88be){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x36'),_0x5c8e40[_0x9a32('0x20')]),_0x1d88be);}});ami['on'](_0x9a32('0x37'),function(_0x46f581){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x38'),_0x46f581[_0x9a32('0x39')]),_0x46f581);queues['attendedtransfer'](_0x46f581);transfers[_0x9a32('0x37')](_0x46f581);agents[_0x9a32('0x37')](_0x46f581);calls[_0x9a32('0x37')](_0x46f581);}catch(_0x3a976f){utils['error'](util['format']('[%s][index][attendedtransfer]',_0x46f581[_0x9a32('0x39')]),_0x3a976f);}});ami['on'](_0x9a32('0x3a'),function(_0x3df246){try{utils[_0x9a32('0x1a')](util['format']('[%s][index][varset]',_0x3df246[_0x9a32('0x20')]),_0x3df246);queues[_0x9a32('0x3a')](_0x3df246);recordings[_0x9a32('0x3a')](_0x3df246);calls['varset'](_0x3df246);dials['varset'](_0x3df246);}catch(_0x229f0e){utils[_0x9a32('0x17')](util['format'](_0x9a32('0x3b'),_0x3df246[_0x9a32('0x20')]),_0x229f0e);}});ami['on'](_0x9a32('0x3c'),function(_0x2c0018){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x3d'),_0x2c0018['uniqueid']),_0x2c0018);calls[_0x9a32('0x3c')](_0x2c0018);recordings[_0x9a32('0x3c')](_0x2c0018);dials[_0x9a32('0x3c')](_0x2c0018);}catch(_0x51a1b0){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x3d'),_0x2c0018[_0x9a32('0x20')]),_0x51a1b0);}});ami['on']('newchannel',function(_0x420396){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x3e'),_0x420396[_0x9a32('0x20')]),_0x420396);calls[_0x9a32('0x3f')](_0x420396);recordings[_0x9a32('0x3f')](_0x420396);}catch(_0x2e411f){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x3e'),_0x420396[_0x9a32('0x20')]),_0x2e411f);}});ami['on']('dialbegin',function(_0x26b8a3){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x40'),_0x26b8a3[_0x9a32('0x20')]),_0x26b8a3);dials[_0x9a32('0x41')](_0x26b8a3);}catch(_0xf490c6){utils['error'](util['format'](_0x9a32('0x42'),_0x26b8a3['uniqueid']),_0xf490c6);}});ami['on'](_0x9a32('0x43'),function(_0x4d8b87){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x44'),_0x4d8b87['uniqueid']),_0x4d8b87);dials[_0x9a32('0x43')](_0x4d8b87);}catch(_0xddb00){utils['error'](util[_0x9a32('0x1f')](_0x9a32('0x44'),_0x4d8b87[_0x9a32('0x20')]),_0xddb00);}});} \ No newline at end of file +var _0xc76d=['agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','production','local','asterisk','port','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xc76d,0x9f));var _0xdc76=function(_0x32cd29,_0x29f6bb){_0x32cd29=_0x32cd29-0x0;var _0x2f7e6e=_0xc76d[_0x32cd29];return _0x2f7e6e;};var AsteriskManager=require(_0xdc76('0x0'));var config=require(_0xdc76('0x1'));var utils=require(_0xdc76('0x2'));var util=require('util');var isXDREnabled=config[_0xdc76('0x3')]&&config[_0xdc76('0x3')][_0xdc76('0x4')]?!config['xdr'][_0xdc76('0x4')]:!![];var isProduction=config['env']===_0xdc76('0x5')||![];var isLocalAsterisk=config[_0xdc76('0x3')]&&config['xdr'][_0xdc76('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xdc76('0x7')][_0xdc76('0x8')],config[_0xdc76('0x7')]['ip'],config[_0xdc76('0x7')]['username'],config[_0xdc76('0x7')][_0xdc76('0x9')],!![]);ami[_0xdc76('0xa')]();if(!isXDREnabled){utils[_0xdc76('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xdc76('0xc'));}else{var agents=require(_0xdc76('0xd'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xdc76('0xe'));var members=require(_0xdc76('0xf'));var dials=require(_0xdc76('0x10'));var transfers=require(_0xdc76('0x11'));var core=require('./core.controller');ami['on'](_0xdc76('0x12'),core[_0xdc76('0x12')]);ami['on'](_0xdc76('0x13'),core[_0xdc76('0x13')]);ami['on'](_0xdc76('0x14'),core[_0xdc76('0x14')]);ami['on'](_0xdc76('0x15'),core[_0xdc76('0x15')]);ami['on'](_0xdc76('0x16'),core[_0xdc76('0x16')]);ami['on']('managerevent',core[_0xdc76('0x17')]);ami['on']('devicestatechange',function(_0x164b1f){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')]('[%s][index][devicestatechange]',_0x164b1f[_0xdc76('0x1a')]),_0x164b1f);members['devicestatechange'](_0x164b1f);}catch(_0x277a1f){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x1b'),_0x164b1f['device']),_0x277a1f);}});ami['on'](_0xdc76('0x1c'),function(_0x24f847){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')](_0xdc76('0x1d'),_0x24f847[_0xdc76('0x1e')]),_0x24f847);agents['agentcalled'](_0x24f847);}catch(_0x593830){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x1d'),_0x24f847['uniqueid']),_0x593830);}});ami['on'](_0xdc76('0x1f'),function(_0x4a5936){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')]('[%s][index][agentringnoanswer]',_0x4a5936[_0xdc76('0x1e')]),_0x4a5936);agents['agentringnoanswer'](_0x4a5936);}catch(_0x4b3e86){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x20'),_0x4a5936['uniqueid']),_0x4b3e86);}});ami['on'](_0xdc76('0x21'),function(_0x1847c2){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')]('[%s][index][agentconnect]',_0x1847c2[_0xdc76('0x1e')]),_0x1847c2);agents[_0xdc76('0x21')](_0x1847c2);queues[_0xdc76('0x21')](_0x1847c2);}catch(_0xbbe9b4){utils[_0xdc76('0x15')](util[_0xdc76('0x19')]('[%s][index][agentconnect]',_0x1847c2[_0xdc76('0x1e')]),_0xbbe9b4);}});ami['on'](_0xdc76('0x22'),function(_0x267846){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')](_0xdc76('0x23'),_0x267846[_0xdc76('0x1e')]),_0x267846);agents[_0xdc76('0x22')](_0x267846);queues[_0xdc76('0x22')](_0x267846);members['agentcomplete'](_0x267846);}catch(_0x4b1455){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x23'),_0x267846['uniqueid']),_0x4b1455);}});ami['on'](_0xdc76('0x24'),function(_0x1a12d5){try{utils['debug'](util['format'](_0xdc76('0x25'),_0x1a12d5[_0xdc76('0x1e')]),_0x1a12d5);agents[_0xdc76('0x24')](_0x1a12d5);queues[_0xdc76('0x24')](_0x1a12d5);}catch(_0x1321fb){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x25'),_0x1a12d5[_0xdc76('0x1e')]),_0x1321fb);}});ami['on'](_0xdc76('0x26'),function(_0x27fc56){try{utils['debug'](util[_0xdc76('0x19')](_0xdc76('0x27'),_0x27fc56[_0xdc76('0x1e')]),_0x27fc56);queues['queuecallerjoin'](_0x27fc56);recordings[_0xdc76('0x26')](_0x27fc56);}catch(_0x472d3e){utils['error'](util[_0xdc76('0x19')](_0xdc76('0x27'),_0x27fc56[_0xdc76('0x1e')]),_0x472d3e);}});ami['on'](_0xdc76('0x28'),function(_0x40ce05){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')]('[%s][index][queuecallerleave]',_0x40ce05['uniqueid']),_0x40ce05);queues[_0xdc76('0x28')](_0x40ce05);}catch(_0x1e49af){utils[_0xdc76('0x15')](util['format'](_0xdc76('0x29'),_0x40ce05['uniqueid']),_0x1e49af);}});ami['on'](_0xdc76('0x2a'),function(_0x256a2e){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')](_0xdc76('0x2b'),_0x256a2e[_0xdc76('0x1e')]),_0x256a2e);queues[_0xdc76('0x2a')](_0x256a2e);calls[_0xdc76('0x2a')](_0x256a2e);}catch(_0x11010a){utils['error'](util[_0xdc76('0x19')](_0xdc76('0x2b'),_0x256a2e[_0xdc76('0x1e')]),_0x11010a);}});ami['on'](_0xdc76('0x2c'),function(_0x22bf80){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')](_0xdc76('0x2d'),_0x22bf80[_0xdc76('0x1e')]),_0x22bf80);queues[_0xdc76('0x2c')](_0x22bf80);calls['musiconholdstop'](_0x22bf80);}catch(_0xb6ab61){utils['error'](util[_0xdc76('0x19')](_0xdc76('0x2d'),_0x22bf80[_0xdc76('0x1e')]),_0xb6ab61);}});ami['on']('newstate',function(_0x25aa2d){try{utils['debug'](util['format'](_0xdc76('0x2e'),_0x25aa2d[_0xdc76('0x1e')]),_0x25aa2d);calls['newstate'](_0x25aa2d);recordings['newstate'](_0x25aa2d);}catch(_0x61d566){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x2e'),_0x25aa2d['uniqueid']),_0x61d566);}});ami['on'](_0xdc76('0x2f'),function(_0x58caa7){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')](_0xdc76('0x30'),_0x58caa7[_0xdc76('0x1e')]),_0x58caa7);calls['hangup'](_0x58caa7);recordings['hangup'](_0x58caa7);dials[_0xdc76('0x2f')](_0x58caa7);agents['hangup'](_0x58caa7);queues[_0xdc76('0x2f')](_0x58caa7);}catch(_0x46f219){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x30'),_0x58caa7[_0xdc76('0x1e')]),_0x46f219);}});ami['on']('cdr',function(_0x3bba12){try{utils[_0xdc76('0x18')](util['format'](_0xdc76('0x31'),_0x3bba12[_0xdc76('0x1e')]),_0x3bba12);members['cdr'](_0x3bba12);}catch(_0x36ab90){utils[_0xdc76('0x15')](util['format'](_0xdc76('0x31'),_0x3bba12[_0xdc76('0x1e')]),_0x36ab90);}});ami['on'](_0xdc76('0x32'),function(_0x55ead4){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')](_0xdc76('0x33'),_0x55ead4[_0xdc76('0x1e')]),_0x55ead4);queues[_0xdc76('0x32')](_0x55ead4);agents[_0xdc76('0x32')](_0x55ead4);transfers[_0xdc76('0x32')](_0x55ead4);recordings[_0xdc76('0x32')](_0x55ead4);}catch(_0x232daa){utils[_0xdc76('0x15')](util[_0xdc76('0x19')](_0xdc76('0x33'),_0x55ead4[_0xdc76('0x1e')]),_0x232daa);}});ami['on'](_0xdc76('0x34'),function(_0x50aa77){try{utils['debug'](util[_0xdc76('0x19')](_0xdc76('0x35'),_0x50aa77[_0xdc76('0x36')]),_0x50aa77);queues['attendedtransfer'](_0x50aa77);transfers[_0xdc76('0x34')](_0x50aa77);agents[_0xdc76('0x34')](_0x50aa77);calls[_0xdc76('0x34')](_0x50aa77);}catch(_0x5bdc96){utils[_0xdc76('0x15')](util[_0xdc76('0x19')]('[%s][index][attendedtransfer]',_0x50aa77[_0xdc76('0x36')]),_0x5bdc96);}});ami['on'](_0xdc76('0x37'),function(_0x4234e6){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')]('[%s][index][varset]',_0x4234e6[_0xdc76('0x1e')]),_0x4234e6);queues[_0xdc76('0x37')](_0x4234e6);recordings[_0xdc76('0x37')](_0x4234e6);calls[_0xdc76('0x37')](_0x4234e6);dials[_0xdc76('0x37')](_0x4234e6);}catch(_0x151362){utils['error'](util[_0xdc76('0x19')](_0xdc76('0x38'),_0x4234e6[_0xdc76('0x1e')]),_0x151362);}});ami['on'](_0xdc76('0x39'),function(_0x10d6ae){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')]('[%s][index][newexten]',_0x10d6ae[_0xdc76('0x1e')]),_0x10d6ae);calls[_0xdc76('0x39')](_0x10d6ae);recordings['newexten'](_0x10d6ae);dials['newexten'](_0x10d6ae);}catch(_0x4fe872){utils['error'](util['format'](_0xdc76('0x3a'),_0x10d6ae[_0xdc76('0x1e')]),_0x4fe872);}});ami['on'](_0xdc76('0x3b'),function(_0x2edca1){try{utils[_0xdc76('0x18')](util[_0xdc76('0x19')]('[%s][index][newchannel]',_0x2edca1[_0xdc76('0x1e')]),_0x2edca1);calls[_0xdc76('0x3b')](_0x2edca1);recordings[_0xdc76('0x3b')](_0x2edca1);}catch(_0x13226a){utils['error'](util['format']('[%s][index][newchannel]',_0x2edca1[_0xdc76('0x1e')]),_0x13226a);}});ami['on'](_0xdc76('0x3c'),function(_0x355a7d){try{utils[_0xdc76('0x18')](util['format']('[%s][index][dialbegin]',_0x355a7d[_0xdc76('0x1e')]),_0x355a7d);dials[_0xdc76('0x3c')](_0x355a7d);}catch(_0x35c686){utils[_0xdc76('0x15')](util['format'](_0xdc76('0x3d'),_0x355a7d['uniqueid']),_0x35c686);}});ami['on'](_0xdc76('0x3e'),function(_0x2fe020){try{utils['debug'](util['format'](_0xdc76('0x3f'),_0x2fe020[_0xdc76('0x1e')]),_0x2fe020);dials[_0xdc76('0x3e')](_0x2fe020);}catch(_0x8d56e6){utils['error'](util['format'](_0xdc76('0x3f'),_0x2fe020[_0xdc76('0x1e')]),_0x8d56e6);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 67b9290..37de066 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 _0xe3c5=['membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','catch','error','startsWith','devicestatechange','debug','device','state','INUSE','BUSY','voice','NOT_INUSE','isNil','exitAt','now','duration','diffTime','[%s][members][devicestatechange]','[%s][members][agentcomplete]','info','queue','assign','cdr','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0xe3c5[_0x1af0e5];return _0x3c444a;};'use strict';var _=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var utils=require(_0x5e3c('0x2'));var members={};var exclude=[_0x5e3c('0x3'),_0x5e3c('0x4')];function writeDB(_0x383d11){utils['info'](util[_0x5e3c('0x5')](_0x5e3c('0x6'),_0x383d11[_0x5e3c('0x7')],_0x383d11[_0x5e3c('0x8')],_0x383d11[_0x5e3c('0x9')],_0x383d11[_0x5e3c('0xa')],_0x383d11[_0x5e3c('0xb')],_0x383d11[_0x5e3c('0xc')]));if(_0x383d11[_0x5e3c('0x8')]){utils[_0x5e3c('0xd')](_0x383d11[_0x5e3c('0x8')])[_0x5e3c('0xe')](function(_0x4995a3){if(_0x4995a3){_0x383d11['membername']=_0x4995a3[_0x5e3c('0xf')];_0x383d11[_0x5e3c('0x10')]=_0x4995a3[_0x5e3c('0x10')];utils[_0x5e3c('0x11')](_0x5e3c('0x12'),_0x383d11);}else{utils['getUserByName'](_0x383d11[_0x5e3c('0x8')][_0x5e3c('0x13')]('/')[0x1])['then'](function(_0x465e5d){if(_0x465e5d){_0x383d11['membername']=_0x465e5d['name'];_0x383d11[_0x5e3c('0x10')]=_0x465e5d[_0x5e3c('0x10')];utils[_0x5e3c('0x11')](_0x5e3c('0x12'),_0x383d11);}});}})[_0x5e3c('0x14')](function(_0x30bc22){utils[_0x5e3c('0x15')](util[_0x5e3c('0x5')]('[%s][members][writeDB]',_0x383d11['uniqueid']),_0x30bc22);});}delete members[_0x383d11[_0x5e3c('0x8')]];}function startsWith(_0x2183ba,_0xa7f61d){return _['some'](_0x2183ba,function(_0x4f7318){return _[_0x5e3c('0x16')](_0xa7f61d,_0x4f7318);});}exports[_0x5e3c('0x17')]=function(_0x321487){try{utils[_0x5e3c('0x18')](util['format']('[%s][members][devicestatechange]',members[_0x321487[_0x5e3c('0x19')]]?members[_0x321487['device']]['uniqueid']:_0x321487[_0x5e3c('0x19')]),_0x321487);utils['info'](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x321487[_0x5e3c('0x19')]]?members[_0x321487[_0x5e3c('0x19')]]['uniqueid']:_0x321487[_0x5e3c('0x19')],_0x321487['state'],_0x321487[_0x5e3c('0x19')]));switch(_0x321487[_0x5e3c('0x1a')]){case _0x5e3c('0x1b'):case _0x5e3c('0x1c'):if(!startsWith(exclude,_0x321487[_0x5e3c('0x19')])){members[_0x321487[_0x5e3c('0x19')]]={'channel':_0x5e3c('0x1d'),'interface':_0x321487['device'],'type':'TALKING','enterAt':utils['now'](),'role':'agent'};}break;case _0x5e3c('0x1e'):if(!_[_0x5e3c('0x1f')](members[_0x321487[_0x5e3c('0x19')]])){members[_0x321487[_0x5e3c('0x19')]][_0x5e3c('0x20')]=utils[_0x5e3c('0x21')]();members[_0x321487['device']][_0x5e3c('0x22')]=utils[_0x5e3c('0x23')](members[_0x321487[_0x5e3c('0x19')]][_0x5e3c('0x20')],members[_0x321487['device']]['enterAt']);if(members[_0x321487[_0x5e3c('0x19')]][_0x5e3c('0x7')]){writeDB(members[_0x321487['device']]);}}break;default:break;}}catch(_0x1048a0){utils[_0x5e3c('0x15')](util[_0x5e3c('0x5')](_0x5e3c('0x24'),members[_0x321487[_0x5e3c('0x19')]]?members[_0x321487['device']][_0x5e3c('0x7')]:_0x321487['device']),_0x1048a0);}};exports['agentcomplete']=function(_0x40e5c0){try{if(!_[_0x5e3c('0x1f')](members[_0x40e5c0[_0x5e3c('0x8')]])){utils[_0x5e3c('0x18')](util['format'](_0x5e3c('0x25'),_0x40e5c0[_0x5e3c('0x7')]),_0x40e5c0);utils[_0x5e3c('0x26')](util[_0x5e3c('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x40e5c0['uniqueid'],_0x40e5c0[_0x5e3c('0x8')],_0x40e5c0[_0x5e3c('0x27')]));members[_0x40e5c0[_0x5e3c('0x8')]]=_[_0x5e3c('0x28')](members[_0x40e5c0['interface']],{'data4':_0x40e5c0[_0x5e3c('0x27')],'uniqueid':_0x40e5c0[_0x5e3c('0x7')]});}}catch(_0x2d5a08){utils['error'](util[_0x5e3c('0x5')]('[%s][members][agentcomplete]',_0x40e5c0[_0x5e3c('0x7')]),_0x2d5a08);}};exports[_0x5e3c('0x29')]=function(_0x2ec1a7){try{utils['debug'](util[_0x5e3c('0x5')]('[%s][members][cdr]',_0x2ec1a7[_0x5e3c('0x7')]),_0x2ec1a7);if(_0x2ec1a7[_0x5e3c('0x9')]){var _0x198883=_0x2ec1a7[_0x5e3c('0x9')]['split']('-')[0x0];if(!_[_0x5e3c('0x1f')](members[_0x198883])){members[_0x198883]=_[_0x5e3c('0x28')](members[_0x198883],{'data1':members[_0x198883][_0x5e3c('0x2a')]||_0x2ec1a7[_0x5e3c('0xc')],'data2':members[_0x198883][_0x5e3c('0xa')]||_0x2ec1a7[_0x5e3c('0x2b')],'data3':members[_0x198883][_0x5e3c('0x2c')]||_0x2ec1a7[_0x5e3c('0x2d')],'uniqueid':members[_0x198883]['uniqueid']||_0x2ec1a7[_0x5e3c('0x7')]});utils[_0x5e3c('0x26')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2ec1a7[_0x5e3c('0x7')],members[_0x198883]['data1'],members[_0x198883][_0x5e3c('0xa')],members[_0x198883][_0x5e3c('0x2c')]));if(members[_0x198883][_0x5e3c('0x20')]){writeDB(members[_0x198883]);}}}if(_0x2ec1a7[_0x5e3c('0x2e')]){var _0x758016=_0x2ec1a7['destinationchannel'][_0x5e3c('0x13')]('-')[0x0];if(!_['isNil'](members[_0x758016])){members[_0x758016]=_[_0x5e3c('0x28')](members[_0x758016],{'data1':members[_0x758016][_0x5e3c('0x2a')]||_0x2ec1a7[_0x5e3c('0xc')],'data2':members[_0x758016][_0x5e3c('0xa')]||_0x2ec1a7[_0x5e3c('0x2b')],'data3':members[_0x758016][_0x5e3c('0x2c')]||_0x2ec1a7[_0x5e3c('0x2d')],'uniqueid':members[_0x758016][_0x5e3c('0x7')]||_0x2ec1a7[_0x5e3c('0x7')]});utils[_0x5e3c('0x26')](util[_0x5e3c('0x5')](_0x5e3c('0x2f'),_0x2ec1a7[_0x5e3c('0x7')],members[_0x758016][_0x5e3c('0x2a')],members[_0x758016][_0x5e3c('0xa')],members[_0x758016]['data3']));if(members[_0x758016]['exitAt']){writeDB(members[_0x758016]);}}}}catch(_0x410687){utils[_0x5e3c('0x15')](util['format'](_0x5e3c('0x30'),_0x2ec1a7[_0x5e3c('0x7')]),_0x410687);}}; \ No newline at end of file +var _0x190b=['[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','info','format','uniqueid','interface','channel','data2','membername','type','then','request','CreateMemberReport','getUserByName','split','name','internal','catch','error','startsWith','debug'];(function(_0x3652cf,_0x8143a4){var _0x6d1a47=function(_0x3437e1){while(--_0x3437e1){_0x3652cf['push'](_0x3652cf['shift']());}};_0x6d1a47(++_0x8143a4);}(_0x190b,0x1ab));var _0xb190=function(_0x494bfc,_0x2e27e8){_0x494bfc=_0x494bfc-0x0;var _0x32eafa=_0x190b[_0x494bfc];return _0x32eafa;};'use strict';var _=require(_0xb190('0x0'));var util=require(_0xb190('0x1'));var utils=require(_0xb190('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xb190('0x3')];function writeDB(_0x39f291){utils[_0xb190('0x4')](util[_0xb190('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x39f291[_0xb190('0x6')],_0x39f291[_0xb190('0x7')],_0x39f291[_0xb190('0x8')],_0x39f291[_0xb190('0x9')],_0x39f291[_0xb190('0xa')],_0x39f291[_0xb190('0xb')]));if(_0x39f291['interface']){utils['getUserByInterface'](_0x39f291[_0xb190('0x7')])[_0xb190('0xc')](function(_0x3a0c29){if(_0x3a0c29){_0x39f291[_0xb190('0xa')]=_0x3a0c29['name'];_0x39f291['internal']=_0x3a0c29['internal'];utils[_0xb190('0xd')](_0xb190('0xe'),_0x39f291);}else{utils[_0xb190('0xf')](_0x39f291['interface'][_0xb190('0x10')]('/')[0x1])['then'](function(_0x39f6b3){if(_0x39f6b3){_0x39f291[_0xb190('0xa')]=_0x39f6b3[_0xb190('0x11')];_0x39f291[_0xb190('0x12')]=_0x39f6b3[_0xb190('0x12')];utils[_0xb190('0xd')](_0xb190('0xe'),_0x39f291);}});}})[_0xb190('0x13')](function(_0x1edc49){utils[_0xb190('0x14')](util[_0xb190('0x5')]('[%s][members][writeDB]',_0x39f291[_0xb190('0x6')]),_0x1edc49);});}delete members[_0x39f291['interface']];}function startsWith(_0x358cc6,_0x4ec5a0){return _['some'](_0x358cc6,function(_0x7badc5){return _[_0xb190('0x15')](_0x4ec5a0,_0x7badc5);});}exports['devicestatechange']=function(_0x554cb1){try{utils[_0xb190('0x16')](util[_0xb190('0x5')](_0xb190('0x17'),members[_0x554cb1[_0xb190('0x18')]]?members[_0x554cb1['device']]['uniqueid']:_0x554cb1[_0xb190('0x18')]),_0x554cb1);utils['info'](util[_0xb190('0x5')](_0xb190('0x19'),members[_0x554cb1['device']]?members[_0x554cb1['device']][_0xb190('0x6')]:_0x554cb1['device'],_0x554cb1[_0xb190('0x1a')],_0x554cb1[_0xb190('0x18')]));switch(_0x554cb1[_0xb190('0x1a')]){case _0xb190('0x1b'):case _0xb190('0x1c'):if(!startsWith(exclude,_0x554cb1[_0xb190('0x18')])){members[_0x554cb1['device']]={'channel':_0xb190('0x1d'),'interface':_0x554cb1[_0xb190('0x18')],'type':'TALKING','enterAt':utils[_0xb190('0x1e')](),'role':_0xb190('0x1f')};}break;case _0xb190('0x20'):if(!_[_0xb190('0x21')](members[_0x554cb1[_0xb190('0x18')]])){members[_0x554cb1[_0xb190('0x18')]][_0xb190('0x22')]=utils[_0xb190('0x1e')]();members[_0x554cb1[_0xb190('0x18')]][_0xb190('0x23')]=utils['diffTime'](members[_0x554cb1[_0xb190('0x18')]][_0xb190('0x22')],members[_0x554cb1[_0xb190('0x18')]][_0xb190('0x24')]);if(members[_0x554cb1[_0xb190('0x18')]][_0xb190('0x6')]){writeDB(members[_0x554cb1[_0xb190('0x18')]]);}}break;default:break;}}catch(_0xe58fbc){utils[_0xb190('0x14')](util[_0xb190('0x5')]('[%s][members][devicestatechange]',members[_0x554cb1[_0xb190('0x18')]]?members[_0x554cb1['device']][_0xb190('0x6')]:_0x554cb1[_0xb190('0x18')]),_0xe58fbc);}};exports[_0xb190('0x25')]=function(_0x1b298c){try{if(!_[_0xb190('0x21')](members[_0x1b298c['interface']])){utils[_0xb190('0x16')](util['format'](_0xb190('0x26'),_0x1b298c[_0xb190('0x6')]),_0x1b298c);utils[_0xb190('0x4')](util[_0xb190('0x5')](_0xb190('0x27'),_0x1b298c[_0xb190('0x6')],_0x1b298c[_0xb190('0x7')],_0x1b298c['queue']));members[_0x1b298c[_0xb190('0x7')]]=_[_0xb190('0x28')](members[_0x1b298c['interface']],{'data4':_0x1b298c[_0xb190('0x29')],'uniqueid':_0x1b298c['uniqueid']});}}catch(_0x70be87){utils['error'](util[_0xb190('0x5')](_0xb190('0x26'),_0x1b298c[_0xb190('0x6')]),_0x70be87);}};exports[_0xb190('0x2a')]=function(_0x420784){try{utils[_0xb190('0x16')](util['format'](_0xb190('0x2b'),_0x420784['uniqueid']),_0x420784);if(_0x420784[_0xb190('0x8')]){var _0x14ff23=_0x420784[_0xb190('0x8')][_0xb190('0x10')]('-')[0x0];if(!_[_0xb190('0x21')](members[_0x14ff23])){members[_0x14ff23]=_[_0xb190('0x28')](members[_0x14ff23],{'data1':members[_0x14ff23][_0xb190('0x2c')]||_0x420784[_0xb190('0xb')],'data2':members[_0x14ff23][_0xb190('0x9')]||_0x420784[_0xb190('0x2d')],'data3':members[_0x14ff23][_0xb190('0x2e')]||_0x420784[_0xb190('0x2f')],'uniqueid':members[_0x14ff23]['uniqueid']||_0x420784[_0xb190('0x6')]});utils[_0xb190('0x4')](util[_0xb190('0x5')](_0xb190('0x30'),_0x420784[_0xb190('0x6')],members[_0x14ff23][_0xb190('0x2c')],members[_0x14ff23][_0xb190('0x9')],members[_0x14ff23][_0xb190('0x2e')]));if(members[_0x14ff23][_0xb190('0x22')]){writeDB(members[_0x14ff23]);}}}if(_0x420784[_0xb190('0x31')]){var _0x30ea30=_0x420784[_0xb190('0x31')][_0xb190('0x10')]('-')[0x0];if(!_[_0xb190('0x21')](members[_0x30ea30])){members[_0x30ea30]=_[_0xb190('0x28')](members[_0x30ea30],{'data1':members[_0x30ea30][_0xb190('0x2c')]||_0x420784['type'],'data2':members[_0x30ea30][_0xb190('0x9')]||_0x420784[_0xb190('0x2d')],'data3':members[_0x30ea30]['data3']||_0x420784[_0xb190('0x2f')],'uniqueid':members[_0x30ea30][_0xb190('0x6')]||_0x420784[_0xb190('0x6')]});utils['info'](util[_0xb190('0x5')](_0xb190('0x30'),_0x420784[_0xb190('0x6')],members[_0x30ea30][_0xb190('0x2c')],members[_0x30ea30][_0xb190('0x9')],members[_0x30ea30][_0xb190('0x2e')]));if(members[_0x30ea30]['exitAt']){writeDB(members[_0x30ea30]);}}}}catch(_0x55ee7f){utils[_0xb190('0x14')](util[_0xb190('0x5')]('[%s][members][cdr]',_0x420784[_0xb190('0x6')]),_0x55ee7f);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2f1dc72..594c21c 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 _0xd06a=['now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','[%s][queues][varset]','variable','value','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','holdtime','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfereelinkedid','queuecallerenterreason','clone','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','assign','position'];(function(_0x259706,_0x2937c9){var _0x1524a8=function(_0x29fac1){while(--_0x29fac1){_0x259706['push'](_0x259706['shift']());}};_0x1524a8(++_0x2937c9);}(_0xd06a,0x17b));var _0xad06=function(_0x11c160,_0x111531){_0x11c160=_0x11c160-0x0;var _0x27bbba=_0xd06a[_0x11c160];return _0x27bbba;};'use strict';var _=require(_0xad06('0x0'));var util=require(_0xad06('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x2cd6db){utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x4'),_0x2cd6db[_0xad06('0x5')],_0x2cd6db[_0xad06('0x6')],_0x2cd6db['queue'],_0x2cd6db[_0xad06('0x7')],_0x2cd6db[_0xad06('0x8')],_0x2cd6db[_0xad06('0x9')],_0x2cd6db[_0xad06('0xa')]));if(_0x2cd6db['queue']){utils[_0xad06('0xb')](_0x2cd6db[_0xad06('0xc')])['then'](function(_0x5820c4){if(_0x5820c4){_0x2cd6db['type']=_0x5820c4[_0xad06('0xd')];}utils[_0xad06('0xe')]('CreateVoiceQueueReport',_0x2cd6db);});}else{utils[_0xad06('0xe')](_0xad06('0xf'),_0x2cd6db);}if(_0x2cd6db['transfereduniqueid']){delete queues[_0x2cd6db['transfereduniqueid']];}else{delete queues[_0x2cd6db[_0xad06('0x5')]];}}exports[_0xad06('0x10')]=function(_0x289548){try{utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x12'),_0x289548['uniqueid']),_0x289548);utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x289548[_0xad06('0x5')],_0x289548[_0xad06('0xc')],_0x289548['position']));queues[_0x289548[_0xad06('0x5')]]=_[_0xad06('0x13')](_0x289548,{'originalposition':_0x289548[_0xad06('0x14')],'queuecallerjoinAt':utils[_0xad06('0x15')](),'mohtime':0x0});}catch(_0x5bd7f8){utils['error'](util[_0xad06('0x3')]('[%s][queues][queuecallerjoin]',_0x289548[_0xad06('0x5')]),_0x5bd7f8);}};exports[_0xad06('0x16')]=function(_0x58a80b){try{if(!_[_0xad06('0x17')](queues[_0x58a80b['uniqueid']])){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x18'),_0x58a80b[_0xad06('0x5')]),_0x58a80b);if(queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x19')]){if(!queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1a')]&&!queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1b')]){queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1c')]=!![];queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1d')]=utils[_0xad06('0x15')]();queues[_0x58a80b['uniqueid']][_0xad06('0xa')]=_0xad06('0x1e');}utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x1f'),_0x58a80b[_0xad06('0x5')],queues[_0x58a80b['uniqueid']][_0xad06('0x20')],queues[_0x58a80b[_0xad06('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x58a80b[_0xad06('0x5')]]);}else if(queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x21')]){utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x58a80b[_0xad06('0x5')],queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x20')],queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x21')]));queues[queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x21')]]=queues[_0x58a80b[_0xad06('0x5')]];queues[queues[_0x58a80b[_0xad06('0x5')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x58a80b[_0xad06('0x5')]];}}}catch(_0xbfb401){utils['error'](util['format']('[%s][queues][hangup]',_0x58a80b[_0xad06('0x5')]),_0xbfb401);}};exports['varset']=function(_0x41bc65){try{utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x22'),_0x41bc65[_0xad06('0x5')]),_0x41bc65);if(!_['isNil'](_0x41bc65[_0xad06('0x23')]['queuestatus'])&&_0x41bc65[_0xad06('0x24')]['toUpperCase']()!==_0xad06('0x25')){if(!_[_0xad06('0x17')](queues[_0x41bc65[_0xad06('0x5')]])){queues[_0x41bc65[_0xad06('0x5')]]['queuecallerabandon']=![];queues[_0x41bc65['uniqueid']]['queuecallerabandonAt']=null;queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1b')]=!![];queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x26')]=utils[_0xad06('0x15')]();queues[_0x41bc65['uniqueid']]['queuecallerexitreason']=_0x41bc65[_0xad06('0x24')]['toUpperCase']();utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x27'),_0x41bc65[_0xad06('0x5')],queues[_0x41bc65['uniqueid']][_0xad06('0x20')],_0x41bc65['value'],queues[_0x41bc65[_0xad06('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x41bc65[_0xad06('0x5')]]);}}else if(!_[_0xad06('0x17')](_0x41bc65[_0xad06('0x23')][_0xad06('0x28')])){if(!_['isNil'](queues[_0x41bc65[_0xad06('0x5')]])&&!queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1a')]){queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1a')]=![];queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x29')]=null;queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1b')]=!![];queues[_0x41bc65[_0xad06('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x41bc65['uniqueid']]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util['format'](_0xad06('0x2a'),_0x41bc65['uniqueid'],queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x20')],_0x41bc65[_0xad06('0x24')],queues[_0x41bc65['uniqueid']][_0xad06('0xa')]));}}}catch(_0x5263be){utils[_0xad06('0x2b')](util[_0xad06('0x3')](_0xad06('0x22'),_0x41bc65[_0xad06('0x5')]),_0x5263be);}};exports[_0xad06('0x1a')]=function(_0x1472b0){try{if(!_[_0xad06('0x17')](queues[_0x1472b0[_0xad06('0x5')]])){utils['debug'](util[_0xad06('0x3')]('[%s][queues][queuecallerabandon]',_0x1472b0['uniqueid']),_0x1472b0);queues[_0x1472b0['uniqueid']][_0xad06('0x1b')]=![];queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x26')]=null;queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x1a')]=!![];queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x29')]=utils[_0xad06('0x15')]();queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0xa')]=_0xad06('0x2c');utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x2d'),_0x1472b0[_0xad06('0x5')],queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x20')],queues[_0x1472b0['uniqueid']][_0xad06('0xa')]));}}catch(_0x7896b2){utils[_0xad06('0x2b')](util[_0xad06('0x3')]('[%s][queues][queuecallerabandon]',_0x1472b0[_0xad06('0x5')]),_0x7896b2);}};exports['queuecallerleave']=function(_0x21ab80){try{if(!_['isNil'](queues[_0x21ab80[_0xad06('0x5')]])){utils['debug'](util[_0xad06('0x3')](_0xad06('0x2e'),_0x21ab80[_0xad06('0x5')]),_0x21ab80);utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x21ab80[_0xad06('0x5')],queues[_0x21ab80['uniqueid']]['name'],_0x21ab80[_0xad06('0x2f')],_0x21ab80[_0xad06('0x30')]));queues[_0x21ab80['uniqueid']][_0xad06('0x31')]=!![];queues[_0x21ab80['uniqueid']][_0xad06('0x19')]=utils[_0xad06('0x15')]();queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x32')]=utils['diffTime'](queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x19')],queues[_0x21ab80[_0xad06('0x5')]]['queuecallerjoinAt']);queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x14')]=_0x21ab80[_0xad06('0x14')];queues[_0x21ab80['uniqueid']][_0xad06('0x33')]=_0x21ab80['count'];queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x2f')]=_0x21ab80[_0xad06('0x2f')];queues[_0x21ab80['uniqueid']][_0xad06('0x30')]=_0x21ab80[_0xad06('0x30')];}}catch(_0x332e34){utils[_0xad06('0x2b')](util['format']('[%s][queues][queuecallerleave]',_0x21ab80[_0xad06('0x5')]),_0x332e34);}};exports['agentconnect']=function(_0x166907){try{if(!_['isNil'](queues[_0x166907[_0xad06('0x5')]])){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x34'),_0x166907[_0xad06('0x5')]),_0x166907);utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x35'),_0x166907['uniqueid'],queues[_0x166907['uniqueid']][_0xad06('0x20')],_0x166907[_0xad06('0x36')],_0x166907[_0xad06('0x37')]));queues[_0x166907[_0xad06('0x5')]][_0xad06('0x1a')]=![];queues[_0x166907['uniqueid']][_0xad06('0x1a')]=![];queues[_0x166907[_0xad06('0x5')]][_0xad06('0x29')]=null;queues[_0x166907[_0xad06('0x5')]][_0xad06('0x1b')]=![];queues[_0x166907[_0xad06('0x5')]][_0xad06('0xa')]=null;queues[_0x166907['uniqueid']][_0xad06('0x26')]=null;queues[_0x166907[_0xad06('0x5')]][_0xad06('0x38')]=!![];queues[_0x166907[_0xad06('0x5')]][_0xad06('0x9')]=_0x166907[_0xad06('0x37')];queues[_0x166907[_0xad06('0x5')]][_0xad06('0x7')]=_0x166907[_0xad06('0x36')];}}catch(_0x40ecca){utils['error'](util[_0xad06('0x3')](_0xad06('0x34'),_0x166907[_0xad06('0x5')]),_0x40ecca);}};exports[_0xad06('0x39')]=function(_0xb6b70c){try{if(!_[_0xad06('0x17')](queues[_0xb6b70c['uniqueid']])){if(queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x19')]){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x3a'),_0xb6b70c[_0xad06('0x5')]),_0xb6b70c);queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x1a')]=![];queues[_0xb6b70c[_0xad06('0x5')]]['queuecallerabandon']=![];queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x29')]=null;queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x1b')]=![];queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x26')]=null;queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x38')]=!![];queues[_0xb6b70c['uniqueid']][_0xad06('0x7')]=_0xb6b70c[_0xad06('0x36')];queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x1c')]=!![];queues[_0xb6b70c[_0xad06('0x5')]]['queuecallercompleteAt']=utils['now']();if(_0xb6b70c['reason']==_0xad06('0x3b')){if(!queues[_0xb6b70c['uniqueid']][_0xad06('0x3b')]){queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0xa')]=_0xad06('0x3c');}}else{queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0xa')]=_0xad06('0x3d')+_0xb6b70c['reason'][_0xad06('0x3e')]();}utils['info'](util['format'](_0xad06('0x3f'),_0xb6b70c[_0xad06('0x5')],queues[_0xb6b70c[_0xad06('0x5')]]['name'],_0xb6b70c[_0xad06('0x36')],queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0xa')]));writeDB(queues[_0xb6b70c[_0xad06('0x5')]]);}}}catch(_0x91c7cc){utils[_0xad06('0x2b')](util[_0xad06('0x3')](_0xad06('0x3a'),_0xb6b70c[_0xad06('0x5')]),_0x91c7cc);}};exports[_0xad06('0x40')]=function(_0x527297){try{if(!_[_0xad06('0x17')](queues[_0x527297[_0xad06('0x41')]])){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x42'),_0x527297[_0xad06('0x5')]),_0x527297);queues[_0x527297['transfereeuniqueid']]['transfer']=!![];queues[_0x527297[_0xad06('0x41')]][_0xad06('0x43')]='BLIND';queues[_0x527297['transfereeuniqueid']][_0xad06('0x44')]=_0x527297['extension'];queues[_0x527297[_0xad06('0x41')]]['transferuniqueid']=_0x527297[_0xad06('0x41')];queues[_0x527297[_0xad06('0x41')]][_0xad06('0xa')]='BLINDTRANSFER';utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x45'),_0x527297[_0xad06('0x5')],queues[_0x527297[_0xad06('0x41')]][_0xad06('0x20')],_0x527297['transfereeuniqueid'],_0x527297[_0xad06('0x46')]));}}catch(_0x5044e8){utils[_0xad06('0x2b')](util['format'](_0xad06('0x42'),_0x527297[_0xad06('0x5')]),_0x5044e8);}};exports[_0xad06('0x47')]=function(_0x1cefc8){try{utils[_0xad06('0x11')](util['format'](_0xad06('0x48'),_0x1cefc8[_0xad06('0x49')]),_0x1cefc8);if(_0x1cefc8[_0xad06('0x49')]==_0x1cefc8[_0xad06('0x4a')]){if(!_['isNil'](queues[_0x1cefc8[_0xad06('0x4b')]])){utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8['secondtransfererlinkedid']]['name'],_0x1cefc8['origtransfererexten']));queues[_0x1cefc8[_0xad06('0x4b')]][_0xad06('0x3b')]=!![];queues[_0x1cefc8[_0xad06('0x4b')]][_0xad06('0x43')]='ATTENDED';queues[_0x1cefc8[_0xad06('0x4b')]]['transferexten']=_0x1cefc8[_0xad06('0x4c')];queues[_0x1cefc8['secondtransfererlinkedid']]['transferuniqueid']=_0x1cefc8[_0xad06('0x49')];queues[_0x1cefc8[_0xad06('0x4b')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x1cefc8['origtransfererlinkedid']])){if(_0x1cefc8['transfereelinkedid']&&queues[_0x1cefc8[_0xad06('0x4d')]]){queues[_0x1cefc8[_0xad06('0x4d')]][_0xad06('0x4e')]=0x1;queues[_0x1cefc8[_0xad06('0x41')]]=_[_0xad06('0x4f')](queues[_0x1cefc8[_0xad06('0x4d')]]);queues[_0x1cefc8[_0xad06('0x41')]]['transfereduniqueid']=_0x1cefc8['transfertargetuniqueid'];queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x4e')]=0x2;queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x8')]=queues[_0x1cefc8['secondtransfererlinkedid']][_0xad06('0x8')];queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x50')]=queues[_0x1cefc8[_0xad06('0x4b')]][_0xad06('0x50')];queues[_0x1cefc8['transfereeuniqueid']][_0xad06('0x51')]=utils[_0xad06('0x15')]();queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x19')]=utils[_0xad06('0x15')]();queues[_0x1cefc8[_0xad06('0x41')]]['holdtime']=0x0;queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x52')]=0x0;utils[_0xad06('0x2')](util['format'](_0xad06('0x53'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x20')],queues[_0x1cefc8['transfereeuniqueid']][_0xad06('0x8')],queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x50')]));}else{utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x54'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x20')],_0x1cefc8['secondtransfererlinkedid']));queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x21')]=_0x1cefc8[_0xad06('0x4b')];}}}else if(_0x1cefc8[_0xad06('0x55')]==_0x1cefc8[_0xad06('0x4b')]){if(!_['isNil'](queues[_0x1cefc8[_0xad06('0x4a')]])){utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x56'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8[_0xad06('0x4a')]]['name'],_0x1cefc8[_0xad06('0x55')],_0x1cefc8[_0xad06('0x57')]));queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x3b')]=!![];queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x43')]=_0xad06('0x58');queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x44')]=_0x1cefc8['secondtransfererexten'];queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x59')]=_0x1cefc8[_0xad06('0x55')];queues[_0x1cefc8[_0xad06('0x4a')]]['queuecallerexitreason']=_0xad06('0x5a');}if(!_[_0xad06('0x17')](queues[_0x1cefc8[_0xad06('0x4b')]])){if(_0x1cefc8['transfertargetlinkedid']&&queues[_0x1cefc8[_0xad06('0x5b')]]){queues[_0x1cefc8[_0xad06('0x5b')]][_0xad06('0x4e')]=0x1;queues[_0x1cefc8[_0xad06('0x5c')]]=_[_0xad06('0x4f')](queues[_0x1cefc8[_0xad06('0x5b')]]);queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x21')]=_0x1cefc8['transfertargetuniqueid'];queues[_0x1cefc8[_0xad06('0x5c')]]['queuecallerenterreason']=0x2;queues[_0x1cefc8['transfertargetuniqueid']][_0xad06('0x8')]=queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x8')];queues[_0x1cefc8[_0xad06('0x5c')]]['calleridname']=queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x50')];queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x51')]=utils[_0xad06('0x15')]();queues[_0x1cefc8[_0xad06('0x5c')]]['queuecallerleaveAt']=utils['now']();queues[_0x1cefc8['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x52')]=0x0;utils['info'](util['format'](_0xad06('0x5d'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x20')],queues[_0x1cefc8['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x1cefc8['transfertargetuniqueid']][_0xad06('0x8')],queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x50')]));}else{utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x54'),_0x1cefc8['origtransfereruniqueid'],queues[_0x1cefc8['secondtransfererlinkedid']][_0xad06('0x20')],_0x1cefc8[_0xad06('0x4a')]));queues[_0x1cefc8['secondtransfererlinkedid']][_0xad06('0x21')]=_0x1cefc8[_0xad06('0x4a')];}}}}catch(_0x453dbe){utils[_0xad06('0x2b')](util[_0xad06('0x3')]('[%s][queues][attendedtransfer]',_0x1cefc8['origtransfereruniqueid']),_0x453dbe);}};exports['musiconholdstart']=function(_0x412392){try{if(!_[_0xad06('0x17')](queues[_0x412392[_0xad06('0x5')]])){utils['debug'](util[_0xad06('0x3')](_0xad06('0x5e'),_0x412392[_0xad06('0x5')]),_0x412392);queues[_0x412392['uniqueid']][_0xad06('0x5f')]=utils[_0xad06('0x15')]();utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x60'),_0x412392[_0xad06('0x5')],queues[_0x412392[_0xad06('0x5')]]['name'],queues[_0x412392[_0xad06('0x5')]]['musiconholdstartAt']));}}catch(_0x4b8ea7){utils[_0xad06('0x2b')](util[_0xad06('0x3')](_0xad06('0x5e'),_0x412392[_0xad06('0x5')]),_0x4b8ea7);}};exports['musiconholdstop']=function(_0x4d1b19){try{if(!_[_0xad06('0x17')](queues[_0x4d1b19[_0xad06('0x5')]])){if(!_[_0xad06('0x17')](queues[_0x4d1b19['uniqueid']][_0xad06('0x5f')])){utils['debug'](util['format'](_0xad06('0x61'),_0x4d1b19[_0xad06('0x5')]),_0x4d1b19);queues[_0x4d1b19['uniqueid']]['mohtime']+=utils[_0xad06('0x62')](utils[_0xad06('0x15')](),queues[_0x4d1b19[_0xad06('0x5')]][_0xad06('0x5f')]);utils['info'](util[_0xad06('0x3')](_0xad06('0x63'),_0x4d1b19[_0xad06('0x5')],queues[_0x4d1b19[_0xad06('0x5')]][_0xad06('0x20')],queues[_0x4d1b19['uniqueid']][_0xad06('0x52')]));delete queues[_0x4d1b19[_0xad06('0x5')]][_0xad06('0x5f')];}}}catch(_0x3e7007){utils[_0xad06('0x2b')](util[_0xad06('0x3')]('[%s][queues][musiconholdstop]',_0x4d1b19[_0xad06('0x5')]),_0x3e7007);}}; \ No newline at end of file +var _0xf450=['transfertype','BLIND','transferexten','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','transfertargetuniqueid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','info','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','membername','assigned','accountcode','destaccountcode','lastAssignedTo','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]'];(function(_0x1aa835,_0x23e8ac){var _0x5ad5c7=function(_0x4aed6e){while(--_0x4aed6e){_0x1aa835['push'](_0x1aa835['shift']());}};_0x5ad5c7(++_0x23e8ac);}(_0xf450,0x168));var _0x0f45=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf450[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x0f45('0x0'));var utils=require(_0x0f45('0x1'));var queues={};function writeDB(_0x73d7e6){utils['info'](util[_0x0f45('0x2')](_0x0f45('0x3'),_0x73d7e6[_0x0f45('0x4')],_0x73d7e6[_0x0f45('0x5')],_0x73d7e6[_0x0f45('0x6')],_0x73d7e6['lastAssignedTo'],_0x73d7e6[_0x0f45('0x7')],_0x73d7e6['accountcode'],_0x73d7e6[_0x0f45('0x8')]));if(_0x73d7e6['queue']){utils[_0x0f45('0x9')](_0x73d7e6[_0x0f45('0x6')])[_0x0f45('0xa')](function(_0x6aa1da){if(_0x6aa1da){_0x73d7e6['type']=_0x6aa1da[_0x0f45('0xb')];}utils[_0x0f45('0xc')](_0x0f45('0xd'),_0x73d7e6);});}else{utils['request'](_0x0f45('0xd'),_0x73d7e6);}if(_0x73d7e6[_0x0f45('0xe')]){delete queues[_0x73d7e6[_0x0f45('0xe')]];}else{delete queues[_0x73d7e6[_0x0f45('0x4')]];}}exports[_0x0f45('0xf')]=function(_0x2654a3){try{utils[_0x0f45('0x10')](util[_0x0f45('0x2')](_0x0f45('0x11'),_0x2654a3[_0x0f45('0x4')]),_0x2654a3);utils['info'](util[_0x0f45('0x2')](_0x0f45('0x12'),_0x2654a3['uniqueid'],_0x2654a3[_0x0f45('0x6')],_0x2654a3[_0x0f45('0x13')]));queues[_0x2654a3[_0x0f45('0x4')]]=_[_0x0f45('0x14')](_0x2654a3,{'originalposition':_0x2654a3[_0x0f45('0x13')],'queuecallerjoinAt':utils[_0x0f45('0x15')](),'mohtime':0x0});}catch(_0x18d68c){utils[_0x0f45('0x16')](util['format'](_0x0f45('0x11'),_0x2654a3[_0x0f45('0x4')]),_0x18d68c);}};exports[_0x0f45('0x17')]=function(_0x355e1b){try{if(!_[_0x0f45('0x18')](queues[_0x355e1b['uniqueid']])){utils[_0x0f45('0x10')](util['format'](_0x0f45('0x19'),_0x355e1b['uniqueid']),_0x355e1b);if(queues[_0x355e1b[_0x0f45('0x4')]]['queuecallerleaveAt']){if(!queues[_0x355e1b[_0x0f45('0x4')]][_0x0f45('0x1a')]&&!queues[_0x355e1b[_0x0f45('0x4')]][_0x0f45('0x1b')]){queues[_0x355e1b['uniqueid']][_0x0f45('0x1c')]=!![];queues[_0x355e1b['uniqueid']][_0x0f45('0x1d')]=utils[_0x0f45('0x15')]();queues[_0x355e1b[_0x0f45('0x4')]][_0x0f45('0x8')]=_0x0f45('0x1e');}utils[_0x0f45('0x1f')](util[_0x0f45('0x2')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x355e1b[_0x0f45('0x4')],queues[_0x355e1b['uniqueid']][_0x0f45('0x20')],queues[_0x355e1b[_0x0f45('0x4')]][_0x0f45('0x8')]));writeDB(queues[_0x355e1b[_0x0f45('0x4')]]);}else if(queues[_0x355e1b[_0x0f45('0x4')]][_0x0f45('0xe')]){utils[_0x0f45('0x1f')](util['format'](_0x0f45('0x21'),_0x355e1b[_0x0f45('0x4')],queues[_0x355e1b['uniqueid']][_0x0f45('0x20')],queues[_0x355e1b[_0x0f45('0x4')]][_0x0f45('0xe')]));queues[queues[_0x355e1b[_0x0f45('0x4')]]['transfereduniqueid']]=queues[_0x355e1b[_0x0f45('0x4')]];queues[queues[_0x355e1b[_0x0f45('0x4')]]['transfereduniqueid']][_0x0f45('0x22')]=0x2;delete queues[_0x355e1b[_0x0f45('0x4')]];}}}catch(_0x3f7796){utils['error'](util['format']('[%s][queues][hangup]',_0x355e1b[_0x0f45('0x4')]),_0x3f7796);}};exports['varset']=function(_0x25abe7){try{utils['debug'](util[_0x0f45('0x2')](_0x0f45('0x23'),_0x25abe7['uniqueid']),_0x25abe7);if(!_[_0x0f45('0x18')](_0x25abe7[_0x0f45('0x24')][_0x0f45('0x25')])&&_0x25abe7[_0x0f45('0x26')][_0x0f45('0x27')]()!==_0x0f45('0x28')){if(!_['isNil'](queues[_0x25abe7[_0x0f45('0x4')]])){queues[_0x25abe7[_0x0f45('0x4')]]['queuecallerabandon']=![];queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x29')]=null;queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x1b')]=!![];queues[_0x25abe7['uniqueid']][_0x0f45('0x2a')]=utils[_0x0f45('0x15')]();queues[_0x25abe7['uniqueid']]['queuecallerexitreason']=_0x25abe7[_0x0f45('0x26')][_0x0f45('0x27')]();utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x2b'),_0x25abe7['uniqueid'],queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x20')],_0x25abe7[_0x0f45('0x26')],queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x8')]));writeDB(queues[_0x25abe7[_0x0f45('0x4')]]);}}else if(!_[_0x0f45('0x18')](_0x25abe7[_0x0f45('0x24')][_0x0f45('0x2c')])){if(!_['isNil'](queues[_0x25abe7['uniqueid']])&&!queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x1a')]){queues[_0x25abe7['uniqueid']][_0x0f45('0x1a')]=![];queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x29')]=null;queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x1b')]=!![];queues[_0x25abe7['uniqueid']][_0x0f45('0x2a')]=utils[_0x0f45('0x15')]();queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x8')]=_0x0f45('0x2d');utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x2e'),_0x25abe7[_0x0f45('0x4')],queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x20')],_0x25abe7['value'],queues[_0x25abe7[_0x0f45('0x4')]][_0x0f45('0x8')]));}}}catch(_0x28151e){utils[_0x0f45('0x16')](util[_0x0f45('0x2')](_0x0f45('0x23'),_0x25abe7['uniqueid']),_0x28151e);}};exports[_0x0f45('0x1a')]=function(_0x5ca20){try{if(!_['isNil'](queues[_0x5ca20[_0x0f45('0x4')]])){utils['debug'](util[_0x0f45('0x2')](_0x0f45('0x2f'),_0x5ca20[_0x0f45('0x4')]),_0x5ca20);queues[_0x5ca20['uniqueid']][_0x0f45('0x1b')]=![];queues[_0x5ca20['uniqueid']][_0x0f45('0x2a')]=null;queues[_0x5ca20['uniqueid']][_0x0f45('0x1a')]=!![];queues[_0x5ca20['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x5ca20['uniqueid']]['queuecallerexitreason']=_0x0f45('0x30');utils['info'](util['format'](_0x0f45('0x31'),_0x5ca20[_0x0f45('0x4')],queues[_0x5ca20[_0x0f45('0x4')]][_0x0f45('0x20')],queues[_0x5ca20[_0x0f45('0x4')]]['queuecallerexitreason']));}}catch(_0x49efdb){utils[_0x0f45('0x16')](util[_0x0f45('0x2')](_0x0f45('0x2f'),_0x5ca20[_0x0f45('0x4')]),_0x49efdb);}};exports[_0x0f45('0x32')]=function(_0x257307){try{if(!_[_0x0f45('0x18')](queues[_0x257307[_0x0f45('0x4')]])){utils[_0x0f45('0x10')](util[_0x0f45('0x2')](_0x0f45('0x33'),_0x257307[_0x0f45('0x4')]),_0x257307);utils[_0x0f45('0x1f')](util['format'](_0x0f45('0x34'),_0x257307[_0x0f45('0x4')],queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x20')],_0x257307['connectedlinenum'],_0x257307[_0x0f45('0x35')]));queues[_0x257307[_0x0f45('0x4')]]['queuecallerleave']=!![];queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x36')]=utils[_0x0f45('0x15')]();queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x37')]=utils[_0x0f45('0x38')](queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x36')],queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x39')]);queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x13')]=_0x257307[_0x0f45('0x13')];queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x3a')]=_0x257307[_0x0f45('0x3a')];queues[_0x257307[_0x0f45('0x4')]][_0x0f45('0x3b')]=_0x257307[_0x0f45('0x3b')];queues[_0x257307['uniqueid']]['connectedlinename']=_0x257307['connectedlinename'];}}catch(_0x43a4ff){utils[_0x0f45('0x16')](util['format']('[%s][queues][queuecallerleave]',_0x257307[_0x0f45('0x4')]),_0x43a4ff);}};exports[_0x0f45('0x3c')]=function(_0x75464b){try{if(!_[_0x0f45('0x18')](queues[_0x75464b['uniqueid']])){utils[_0x0f45('0x10')](util['format'](_0x0f45('0x3d'),_0x75464b['uniqueid']),_0x75464b);utils['info'](util[_0x0f45('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x75464b[_0x0f45('0x4')],queues[_0x75464b[_0x0f45('0x4')]][_0x0f45('0x20')],_0x75464b[_0x0f45('0x3e')],_0x75464b['destaccountcode']));queues[_0x75464b[_0x0f45('0x4')]][_0x0f45('0x1a')]=![];queues[_0x75464b[_0x0f45('0x4')]][_0x0f45('0x1a')]=![];queues[_0x75464b['uniqueid']][_0x0f45('0x29')]=null;queues[_0x75464b[_0x0f45('0x4')]][_0x0f45('0x1b')]=![];queues[_0x75464b[_0x0f45('0x4')]][_0x0f45('0x8')]=null;queues[_0x75464b[_0x0f45('0x4')]]['queuecallerexitAt']=null;queues[_0x75464b['uniqueid']][_0x0f45('0x3f')]=!![];queues[_0x75464b[_0x0f45('0x4')]][_0x0f45('0x40')]=_0x75464b[_0x0f45('0x41')];queues[_0x75464b[_0x0f45('0x4')]][_0x0f45('0x42')]=_0x75464b[_0x0f45('0x3e')];}}catch(_0x333f6e){utils[_0x0f45('0x16')](util[_0x0f45('0x2')](_0x0f45('0x3d'),_0x75464b[_0x0f45('0x4')]),_0x333f6e);}};exports[_0x0f45('0x43')]=function(_0x3b752e){try{if(!_[_0x0f45('0x18')](queues[_0x3b752e['uniqueid']])){if(queues[_0x3b752e[_0x0f45('0x4')]]['queuecallerleaveAt']){utils[_0x0f45('0x10')](util[_0x0f45('0x2')]('[%s][queues][agentcomplete]',_0x3b752e[_0x0f45('0x4')]),_0x3b752e);queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x1a')]=![];queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x1a')]=![];queues[_0x3b752e[_0x0f45('0x4')]]['queuecallerabandonAt']=null;queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x1b')]=![];queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x2a')]=null;queues[_0x3b752e['uniqueid']]['assigned']=!![];queues[_0x3b752e['uniqueid']][_0x0f45('0x42')]=_0x3b752e['membername'];queues[_0x3b752e['uniqueid']][_0x0f45('0x1c')]=!![];queues[_0x3b752e[_0x0f45('0x4')]]['queuecallercompleteAt']=utils[_0x0f45('0x15')]();if(_0x3b752e[_0x0f45('0x44')]==_0x0f45('0x45')){if(!queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x45')]){queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x8')]=_0x0f45('0x46');}}else{queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x8')]=_0x0f45('0x47')+_0x3b752e[_0x0f45('0x44')][_0x0f45('0x27')]();}utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x48'),_0x3b752e['uniqueid'],queues[_0x3b752e[_0x0f45('0x4')]][_0x0f45('0x20')],_0x3b752e['membername'],queues[_0x3b752e['uniqueid']][_0x0f45('0x8')]));writeDB(queues[_0x3b752e['uniqueid']]);}}}catch(_0x4f2db1){utils[_0x0f45('0x16')](util[_0x0f45('0x2')](_0x0f45('0x49'),_0x3b752e[_0x0f45('0x4')]),_0x4f2db1);}};exports['blindtransfer']=function(_0x5197cc){try{if(!_['isNil'](queues[_0x5197cc[_0x0f45('0x4a')]])){utils['debug'](util[_0x0f45('0x2')](_0x0f45('0x4b'),_0x5197cc['uniqueid']),_0x5197cc);queues[_0x5197cc[_0x0f45('0x4a')]][_0x0f45('0x45')]=!![];queues[_0x5197cc[_0x0f45('0x4a')]][_0x0f45('0x4c')]=_0x0f45('0x4d');queues[_0x5197cc['transfereeuniqueid']][_0x0f45('0x4e')]=_0x5197cc['extension'];queues[_0x5197cc[_0x0f45('0x4a')]][_0x0f45('0x4f')]=_0x5197cc[_0x0f45('0x4a')];queues[_0x5197cc['transfereeuniqueid']][_0x0f45('0x8')]='BLINDTRANSFER';utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x50'),_0x5197cc[_0x0f45('0x4')],queues[_0x5197cc['transfereeuniqueid']][_0x0f45('0x20')],_0x5197cc['transfereeuniqueid'],_0x5197cc[_0x0f45('0x51')]));}}catch(_0x5a4efa){utils[_0x0f45('0x16')](util['format']('[%s][queues][blindtransfer]',_0x5197cc[_0x0f45('0x4')]),_0x5a4efa);}};exports[_0x0f45('0x52')]=function(_0x4b1c10){try{utils[_0x0f45('0x10')](util[_0x0f45('0x2')](_0x0f45('0x53'),_0x4b1c10[_0x0f45('0x54')]),_0x4b1c10);if(_0x4b1c10[_0x0f45('0x54')]==_0x4b1c10[_0x0f45('0x55')]){if(!_[_0x0f45('0x18')](queues[_0x4b1c10[_0x0f45('0x56')]])){utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x57'),_0x4b1c10[_0x0f45('0x54')],queues[_0x4b1c10['secondtransfererlinkedid']][_0x0f45('0x20')],_0x4b1c10[_0x0f45('0x58')]));queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0x45')]=!![];queues[_0x4b1c10[_0x0f45('0x56')]]['transfertype']=_0x0f45('0x59');queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0x4e')]=_0x4b1c10[_0x0f45('0x58')];queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0x4f')]=_0x4b1c10['origtransfereruniqueid'];queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0x8')]=_0x0f45('0x5a');}if(!_['isNil'](queues[_0x4b1c10[_0x0f45('0x55')]])){if(_0x4b1c10[_0x0f45('0x5b')]&&queues[_0x4b1c10[_0x0f45('0x5b')]]){queues[_0x4b1c10[_0x0f45('0x5b')]][_0x0f45('0x22')]=0x1;queues[_0x4b1c10['transfereeuniqueid']]=_[_0x0f45('0x5c')](queues[_0x4b1c10[_0x0f45('0x5b')]]);queues[_0x4b1c10[_0x0f45('0x4a')]]['transfereduniqueid']=_0x4b1c10['transfertargetuniqueid'];queues[_0x4b1c10[_0x0f45('0x4a')]][_0x0f45('0x22')]=0x2;queues[_0x4b1c10[_0x0f45('0x4a')]][_0x0f45('0x7')]=queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0x7')];queues[_0x4b1c10['transfereeuniqueid']]['calleridname']=queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0x5d')];queues[_0x4b1c10[_0x0f45('0x4a')]]['queuecallerjoinAt']=utils[_0x0f45('0x15')]();queues[_0x4b1c10['transfereeuniqueid']][_0x0f45('0x36')]=utils['now']();queues[_0x4b1c10[_0x0f45('0x4a')]][_0x0f45('0x37')]=0x0;queues[_0x4b1c10[_0x0f45('0x4a')]][_0x0f45('0x5e')]=0x0;utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x5f'),_0x4b1c10[_0x0f45('0x54')],queues[_0x4b1c10['transfereeuniqueid']][_0x0f45('0x20')],queues[_0x4b1c10[_0x0f45('0x4a')]][_0x0f45('0x7')],queues[_0x4b1c10[_0x0f45('0x4a')]][_0x0f45('0x5d')]));}else{utils['info'](util[_0x0f45('0x2')](_0x0f45('0x60'),_0x4b1c10['origtransfereruniqueid'],queues[_0x4b1c10['origtransfererlinkedid']][_0x0f45('0x20')],_0x4b1c10[_0x0f45('0x56')]));queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0xe')]=_0x4b1c10[_0x0f45('0x56')];}}}else if(_0x4b1c10['secondtransfereruniqueid']==_0x4b1c10[_0x0f45('0x56')]){if(!_[_0x0f45('0x18')](queues[_0x4b1c10[_0x0f45('0x55')]])){utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x61'),_0x4b1c10[_0x0f45('0x54')],queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x20')],_0x4b1c10['secondtransfereruniqueid'],_0x4b1c10[_0x0f45('0x62')]));queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x45')]=!![];queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x4c')]=_0x0f45('0x59');queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x4e')]=_0x4b1c10[_0x0f45('0x62')];queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x4f')]=_0x4b1c10[_0x0f45('0x63')];queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x8')]=_0x0f45('0x5a');}if(!_[_0x0f45('0x18')](queues[_0x4b1c10[_0x0f45('0x56')]])){if(_0x4b1c10[_0x0f45('0x64')]&&queues[_0x4b1c10[_0x0f45('0x64')]]){queues[_0x4b1c10['transfertargetlinkedid']][_0x0f45('0x22')]=0x1;queues[_0x4b1c10[_0x0f45('0x65')]]=_[_0x0f45('0x5c')](queues[_0x4b1c10[_0x0f45('0x64')]]);queues[_0x4b1c10[_0x0f45('0x65')]][_0x0f45('0xe')]=_0x4b1c10[_0x0f45('0x65')];queues[_0x4b1c10[_0x0f45('0x65')]][_0x0f45('0x22')]=0x2;queues[_0x4b1c10['transfertargetuniqueid']][_0x0f45('0x7')]=queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x7')];queues[_0x4b1c10[_0x0f45('0x65')]][_0x0f45('0x5d')]=queues[_0x4b1c10[_0x0f45('0x55')]][_0x0f45('0x5d')];queues[_0x4b1c10['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x0f45('0x15')]();queues[_0x4b1c10['transfertargetuniqueid']][_0x0f45('0x36')]=utils[_0x0f45('0x15')]();queues[_0x4b1c10[_0x0f45('0x65')]][_0x0f45('0x37')]=0x0;queues[_0x4b1c10['transfertargetuniqueid']][_0x0f45('0x5e')]=0x0;utils['info'](util[_0x0f45('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x4b1c10[_0x0f45('0x54')],queues[_0x4b1c10[_0x0f45('0x65')]][_0x0f45('0x20')],queues[_0x4b1c10[_0x0f45('0x65')]][_0x0f45('0xe')],queues[_0x4b1c10[_0x0f45('0x65')]][_0x0f45('0x7')],queues[_0x4b1c10[_0x0f45('0x65')]]['calleridname']));}else{utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x60'),_0x4b1c10['origtransfereruniqueid'],queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0x20')],_0x4b1c10[_0x0f45('0x55')]));queues[_0x4b1c10[_0x0f45('0x56')]][_0x0f45('0xe')]=_0x4b1c10[_0x0f45('0x55')];}}}}catch(_0x4f1f8f){utils[_0x0f45('0x16')](util['format']('[%s][queues][attendedtransfer]',_0x4b1c10[_0x0f45('0x54')]),_0x4f1f8f);}};exports[_0x0f45('0x66')]=function(_0x2256ad){try{if(!_[_0x0f45('0x18')](queues[_0x2256ad[_0x0f45('0x4')]])){utils['debug'](util[_0x0f45('0x2')](_0x0f45('0x67'),_0x2256ad[_0x0f45('0x4')]),_0x2256ad);queues[_0x2256ad[_0x0f45('0x4')]][_0x0f45('0x68')]=utils['now']();utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x69'),_0x2256ad[_0x0f45('0x4')],queues[_0x2256ad[_0x0f45('0x4')]][_0x0f45('0x20')],queues[_0x2256ad[_0x0f45('0x4')]]['musiconholdstartAt']));}}catch(_0x32b3c6){utils[_0x0f45('0x16')](util[_0x0f45('0x2')](_0x0f45('0x67'),_0x2256ad[_0x0f45('0x4')]),_0x32b3c6);}};exports[_0x0f45('0x6a')]=function(_0x446441){try{if(!_[_0x0f45('0x18')](queues[_0x446441[_0x0f45('0x4')]])){if(!_[_0x0f45('0x18')](queues[_0x446441[_0x0f45('0x4')]]['musiconholdstartAt'])){utils['debug'](util[_0x0f45('0x2')](_0x0f45('0x6b'),_0x446441[_0x0f45('0x4')]),_0x446441);queues[_0x446441['uniqueid']][_0x0f45('0x5e')]+=utils[_0x0f45('0x38')](utils[_0x0f45('0x15')](),queues[_0x446441[_0x0f45('0x4')]]['musiconholdstartAt']);utils[_0x0f45('0x1f')](util[_0x0f45('0x2')](_0x0f45('0x6c'),_0x446441['uniqueid'],queues[_0x446441[_0x0f45('0x4')]][_0x0f45('0x20')],queues[_0x446441[_0x0f45('0x4')]][_0x0f45('0x5e')]));delete queues[_0x446441[_0x0f45('0x4')]][_0x0f45('0x68')];}}}catch(_0xdbda20){utils[_0x0f45('0x16')](util[_0x0f45('0x2')](_0x0f45('0x6b'),_0x446441['uniqueid']),_0xdbda20);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 1a99b26..38cb662 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 _0x2f66=['info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x2f66,0x89));var _0x62f6=function(_0x819ce,_0xf25f51){_0x819ce=_0x819ce-0x0;var _0x1edcf0=_0x2f66[_0x819ce];return _0x1edcf0;};'use strict';var _=require(_0x62f6('0x0'));var util=require(_0x62f6('0x1'));var utils=require(_0x62f6('0x2'));var transfers=require(_0x62f6('0x3'));var recordings={};function writeDB(_0x160060){var _0x377c60;utils['info'](util[_0x62f6('0x4')](_0x62f6('0x5'),_0x160060[_0x62f6('0x6')]));if(transfers['blinds'][_0x160060[_0x62f6('0x6')]]){_0x377c60=_0x160060[_0x62f6('0x6')];_0x160060['uniqueid']=transfers[_0x62f6('0x7')][_0x160060[_0x62f6('0x6')]][_0x62f6('0x8')];}if(_0x160060['accountcode']){utils[_0x62f6('0x9')](_0x160060[_0x62f6('0xa')])['then'](function(_0x1a9422){if(_0x1a9422){_0x160060[_0x62f6('0xb')]=_0x1a9422['name'];_0x160060[_0x62f6('0xc')]=_0x1a9422['id'];}utils[_0x62f6('0xd')](_0x62f6('0xe'),_0x160060);});}else{utils[_0x62f6('0xd')](_0x62f6('0xe'),_0x160060);}if(_0x377c60)delete transfers['blinds'][_0x377c60];}exports[_0x62f6('0xf')]=function(_0x3dde7e){try{utils[_0x62f6('0x10')](util[_0x62f6('0x4')](_0x62f6('0x11'),_0x3dde7e[_0x62f6('0x6')]),_0x3dde7e);if(_0x3dde7e['uniqueid']==_0x3dde7e[_0x62f6('0x12')]){utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x14'),_0x3dde7e[_0x62f6('0x6')],_0x3dde7e[_0x62f6('0x15')],_0x3dde7e[_0x62f6('0x16')]));recordings[_0x3dde7e[_0x62f6('0x6')]]={'uniqueid':_0x3dde7e[_0x62f6('0x6')],'accountcode':_0x3dde7e['accountcode'],'exten':_0x3dde7e[_0x62f6('0x16')],'context':_0x3dde7e[_0x62f6('0x15')],'channel':_0x3dde7e['channel'],'monitors':[]};}}catch(_0x190988){utils[_0x62f6('0x17')](util['format'](_0x62f6('0x11'),_0x3dde7e['uniqueid']),_0x190988);}};exports[_0x62f6('0x18')]=function(_0x30f6fe){try{utils[_0x62f6('0x10')](util['format'](_0x62f6('0x19'),_0x30f6fe[_0x62f6('0x6')]),_0x30f6fe);if(!_[_0x62f6('0x1a')](recordings[_0x30f6fe['uniqueid']])&&_0x30f6fe['channelstate']==0x6){utils['info'](util[_0x62f6('0x4')](_0x62f6('0x1b'),_0x30f6fe['uniqueid'],_0x30f6fe[_0x62f6('0x15')],_0x30f6fe[_0x62f6('0x1c')]));}else if(!_[_0x62f6('0x1a')](recordings[_0x30f6fe[_0x62f6('0x12')]])&&_0x30f6fe['channelstate']==0x6&&_0x30f6fe['context']!=_0x62f6('0x1d')){utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x1e'),_0x30f6fe[_0x62f6('0x6')],_0x30f6fe[_0x62f6('0x12')],_0x30f6fe['context'],_0x30f6fe[_0x62f6('0x1c')]));recordings[_0x30f6fe[_0x62f6('0x12')]][_0x62f6('0xa')]=_0x30f6fe[_0x62f6('0xa')];}}catch(_0x4076e5){utils[_0x62f6('0x17')](util['format'](_0x62f6('0x19'),_0x30f6fe['uniqueid']),_0x4076e5);}};exports[_0x62f6('0x1f')]=function(_0xa208f7){try{if(!_[_0x62f6('0x1a')](_0xa208f7[_0x62f6('0x20')])&&!_['isNil'](_0xa208f7[_0x62f6('0x20')][_0x62f6('0x21')])){utils[_0x62f6('0x10')](util[_0x62f6('0x4')]('[%s][recordings][varset]',_0xa208f7['uniqueid']),_0xa208f7);utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x22'),_0xa208f7['uniqueid'],_0xa208f7[_0x62f6('0x20')],_0xa208f7[_0x62f6('0x23')]));if(_[_0x62f6('0x24')](_0xa208f7[_0x62f6('0x23')],'.wav49')){_0xa208f7[_0x62f6('0x23')]=_0xa208f7[_0x62f6('0x23')][_0x62f6('0x25')](_0x62f6('0x26'),_0x62f6('0x27'));}if(recordings[_0xa208f7[_0x62f6('0x12')]]){var _0x23a95b=_['find'](recordings[_0xa208f7[_0x62f6('0x12')]][_0x62f6('0x28')],{'value':_0xa208f7[_0x62f6('0x23')]});if(_['isNil'](_0x23a95b)){recordings[_0xa208f7[_0x62f6('0x12')]]['monitors'][_0x62f6('0x29')]({'value':_0xa208f7[_0x62f6('0x23')]});}}}}catch(_0xafeff3){utils['error'](util[_0x62f6('0x4')](_0x62f6('0x2a'),_0xa208f7[_0x62f6('0x6')]),_0xafeff3);}};exports[_0x62f6('0x2b')]=function(_0x5378db){try{if(!_[_0x62f6('0x1a')](recordings[_0x5378db[_0x62f6('0x6')]])){utils[_0x62f6('0x10')](util[_0x62f6('0x4')](_0x62f6('0x2c'),_0x5378db['uniqueid']),_0x5378db);utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x2d'),_0x5378db[_0x62f6('0x6')],_0x5378db[_0x62f6('0x2e')],_0x5378db[_0x62f6('0x2f')],_0x5378db['cause-txt']));recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x2e')]=_0x5378db[_0x62f6('0x2e')];recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x2f')]=_0x5378db[_0x62f6('0x2f')];recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x30')]=_0x5378db[_0x62f6('0x30')];recordings[_0x5378db[_0x62f6('0x6')]]['connectedlinename']=_0x5378db[_0x62f6('0x31')];if(recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x32')]=='outbound'&&recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0xa')]){recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x30')]=recordings[_0x5378db[_0x62f6('0x6')]]['accountcode'];recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x31')]='';}recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x28')][_0x62f6('0x33')](function(_0x3af775){var _0x212bb5=_[_0x62f6('0x34')](recordings[_0x5378db[_0x62f6('0x6')]]);_0x212bb5[_0x62f6('0x23')]=_0x3af775[_0x62f6('0x23')];writeDB(_0x212bb5);});delete recordings[_0x5378db[_0x62f6('0x6')]];}}catch(_0x296001){utils[_0x62f6('0x17')](util['format']('[%s][recordings][hangup]',_0x5378db[_0x62f6('0x6')]),_0x296001);}};exports[_0x62f6('0x35')]=function(_0x1db7fd){try{if(!_[_0x62f6('0x1a')](recordings[_0x1db7fd[_0x62f6('0x6')]])){utils[_0x62f6('0x10')](util['format']('[%s][recordings][newexten]',_0x1db7fd[_0x62f6('0x6')]),_0x1db7fd);utils['info'](util[_0x62f6('0x4')](_0x62f6('0x36'),_0x1db7fd[_0x62f6('0x6')],_0x1db7fd[_0x62f6('0x37')],_0x1db7fd[_0x62f6('0x38')]));if(_0x1db7fd[_0x62f6('0x37')][_0x62f6('0x39')]()==_0x62f6('0x3a')&&_[_0x62f6('0x3b')](_0x1db7fd[_0x62f6('0x38')][_0x62f6('0x39')](),_0x62f6('0x3c'))){var _0x540848=_0x1db7fd[_0x62f6('0x38')][_0x62f6('0x3d')]('=');var _0x3825a2=_0x540848[0x0][_0x62f6('0x3e')](_0x540848[0x0][_0x62f6('0x3f')]('(')+0x1,_0x540848[0x0][_0x62f6('0x3f')](')'));var _0x5cc669=_0x540848[0x1];recordings[_0x1db7fd[_0x62f6('0x6')]][_0x3825a2]=_0x5cc669;}}}catch(_0x324405){utils[_0x62f6('0x17')](util['format'](_0x62f6('0x40'),_0x1db7fd[_0x62f6('0x6')]),_0x324405);}};exports[_0x62f6('0x41')]=function(_0x29d783){try{if(!_[_0x62f6('0x1a')](recordings[_0x29d783[_0x62f6('0x6')]])){utils[_0x62f6('0x10')](util['format'](_0x62f6('0x42'),_0x29d783[_0x62f6('0x6')]),_0x29d783);utils['info'](util[_0x62f6('0x4')](_0x62f6('0x43'),_0x29d783[_0x62f6('0x6')],_0x29d783[_0x62f6('0x44')]));recordings[_0x29d783[_0x62f6('0x6')]][_0x62f6('0x44')]=_0x29d783[_0x62f6('0x44')];}}catch(_0x28c369){utils[_0x62f6('0x17')](util[_0x62f6('0x4')](_0x62f6('0x42'),_0x29d783[_0x62f6('0x6')]),_0x28c369);}};exports[_0x62f6('0x45')]=function(_0x5133cb){try{utils[_0x62f6('0x10')](util[_0x62f6('0x4')](_0x62f6('0x46'),_0x5133cb[_0x62f6('0x6')]),_0x5133cb);utils['info'](util[_0x62f6('0x4')](_0x62f6('0x47'),_0x5133cb[_0x62f6('0x6')],_0x5133cb[_0x62f6('0x48')],_0x5133cb[_0x62f6('0x49')],_0x5133cb[_0x62f6('0x4a')],_0x5133cb[_0x62f6('0x4b')]));if(recordings[_0x5133cb[_0x62f6('0x4c')]]&&transfers[_0x62f6('0x7')][_0x5133cb[_0x62f6('0x4c')]]){transfers['blinds'][_0x5133cb[_0x62f6('0x4c')]][_0x62f6('0x4d')]=!![];}}catch(_0x375f3c){utils[_0x62f6('0x17')](util[_0x62f6('0x4')](_0x62f6('0x46'),_0x5133cb[_0x62f6('0x6')]),_0x375f3c);}}; \ No newline at end of file +var _0xdf36=['outbound','forEach','clone','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','replace','find','monitors','push','error','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','type'];(function(_0x1d7827,_0x42b0db){var _0xb449f1=function(_0x482ebc){while(--_0x482ebc){_0x1d7827['push'](_0x1d7827['shift']());}};_0xb449f1(++_0x42b0db);}(_0xdf36,0xa8));var _0x6df3=function(_0x54a83f,_0x528962){_0x54a83f=_0x54a83f-0x0;var _0x5a5366=_0xdf36[_0x54a83f];return _0x5a5366;};'use strict';var _=require(_0x6df3('0x0'));var util=require(_0x6df3('0x1'));var utils=require(_0x6df3('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x3388a4){var _0x5d499b;utils[_0x6df3('0x3')](util[_0x6df3('0x4')]('[%s][recordings][writeDB]',_0x3388a4['uniqueid']));if(transfers['blinds'][_0x3388a4[_0x6df3('0x5')]]){_0x5d499b=_0x3388a4[_0x6df3('0x5')];_0x3388a4[_0x6df3('0x5')]=transfers[_0x6df3('0x6')][_0x3388a4['uniqueid']][_0x6df3('0x7')];}if(_0x3388a4[_0x6df3('0x8')]){utils['getUserByInternal'](_0x3388a4['accountcode'])[_0x6df3('0x9')](function(_0x5c8444){if(_0x5c8444){_0x3388a4[_0x6df3('0xa')]=_0x5c8444[_0x6df3('0xb')];_0x3388a4[_0x6df3('0xc')]=_0x5c8444['id'];}utils[_0x6df3('0xd')](_0x6df3('0xe'),_0x3388a4);});}else{utils[_0x6df3('0xd')](_0x6df3('0xe'),_0x3388a4);}if(_0x5d499b)delete transfers[_0x6df3('0x6')][_0x5d499b];}exports[_0x6df3('0xf')]=function(_0x2daee8){try{utils[_0x6df3('0x10')](util[_0x6df3('0x4')]('[%s][recordings][newchannel]',_0x2daee8[_0x6df3('0x5')]),_0x2daee8);if(_0x2daee8[_0x6df3('0x5')]==_0x2daee8[_0x6df3('0x11')]){utils[_0x6df3('0x3')](util[_0x6df3('0x4')](_0x6df3('0x12'),_0x2daee8[_0x6df3('0x5')],_0x2daee8[_0x6df3('0x13')],_0x2daee8[_0x6df3('0x14')]));recordings[_0x2daee8['uniqueid']]={'uniqueid':_0x2daee8['uniqueid'],'accountcode':_0x2daee8['accountcode'],'exten':_0x2daee8[_0x6df3('0x14')],'context':_0x2daee8[_0x6df3('0x13')],'channel':_0x2daee8[_0x6df3('0x15')],'monitors':[]};}}catch(_0x73e64a){utils['error'](util[_0x6df3('0x4')](_0x6df3('0x16'),_0x2daee8[_0x6df3('0x5')]),_0x73e64a);}};exports[_0x6df3('0x17')]=function(_0x44c2e9){try{utils[_0x6df3('0x10')](util[_0x6df3('0x4')](_0x6df3('0x18'),_0x44c2e9['uniqueid']),_0x44c2e9);if(!_[_0x6df3('0x19')](recordings[_0x44c2e9[_0x6df3('0x5')]])&&_0x44c2e9['channelstate']==0x6){utils[_0x6df3('0x3')](util['format'](_0x6df3('0x1a'),_0x44c2e9[_0x6df3('0x5')],_0x44c2e9['context'],_0x44c2e9['channel']));}else if(!_['isNil'](recordings[_0x44c2e9['linkedid']])&&_0x44c2e9[_0x6df3('0x1b')]==0x6&&_0x44c2e9[_0x6df3('0x13')]!=_0x6df3('0x1c')){utils['info'](util['format'](_0x6df3('0x1d'),_0x44c2e9[_0x6df3('0x5')],_0x44c2e9['linkedid'],_0x44c2e9['context'],_0x44c2e9['channel']));recordings[_0x44c2e9[_0x6df3('0x11')]][_0x6df3('0x8')]=_0x44c2e9[_0x6df3('0x8')];}}catch(_0x4a240f){utils['error'](util['format'](_0x6df3('0x18'),_0x44c2e9[_0x6df3('0x5')]),_0x4a240f);}};exports[_0x6df3('0x1e')]=function(_0x4726b1){try{if(!_[_0x6df3('0x19')](_0x4726b1[_0x6df3('0x1f')])&&!_['isNil'](_0x4726b1['variable'][_0x6df3('0x20')])){utils[_0x6df3('0x10')](util[_0x6df3('0x4')](_0x6df3('0x21'),_0x4726b1[_0x6df3('0x5')]),_0x4726b1);utils[_0x6df3('0x3')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x4726b1[_0x6df3('0x5')],_0x4726b1[_0x6df3('0x1f')],_0x4726b1[_0x6df3('0x22')]));if(_[_0x6df3('0x23')](_0x4726b1[_0x6df3('0x22')],_0x6df3('0x24'))){_0x4726b1[_0x6df3('0x22')]=_0x4726b1[_0x6df3('0x22')][_0x6df3('0x25')](_0x6df3('0x24'),'.WAV');}if(recordings[_0x4726b1[_0x6df3('0x11')]]){var _0x3c2e71=_[_0x6df3('0x26')](recordings[_0x4726b1[_0x6df3('0x11')]]['monitors'],{'value':_0x4726b1['value']});if(_[_0x6df3('0x19')](_0x3c2e71)){recordings[_0x4726b1[_0x6df3('0x11')]][_0x6df3('0x27')][_0x6df3('0x28')]({'value':_0x4726b1[_0x6df3('0x22')]});}}}}catch(_0x3b05c5){utils[_0x6df3('0x29')](util[_0x6df3('0x4')](_0x6df3('0x21'),_0x4726b1[_0x6df3('0x5')]),_0x3b05c5);}};exports[_0x6df3('0x2a')]=function(_0xd70a83){try{if(!_[_0x6df3('0x19')](recordings[_0xd70a83[_0x6df3('0x5')]])){utils[_0x6df3('0x10')](util['format'](_0x6df3('0x2b'),_0xd70a83[_0x6df3('0x5')]),_0xd70a83);utils[_0x6df3('0x3')](util[_0x6df3('0x4')](_0x6df3('0x2c'),_0xd70a83['uniqueid'],_0xd70a83['calleridnum'],_0xd70a83['calleridname'],_0xd70a83[_0x6df3('0x2d')]));recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x2e')]=_0xd70a83['calleridnum'];recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x2f')]=_0xd70a83[_0x6df3('0x2f')];recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x30')]=_0xd70a83['connectedlinenum'];recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x31')]=_0xd70a83['connectedlinename'];if(recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x32')]==_0x6df3('0x33')&&recordings[_0xd70a83['uniqueid']][_0x6df3('0x8')]){recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x30')]=recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x8')];recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x31')]='';}recordings[_0xd70a83[_0x6df3('0x5')]][_0x6df3('0x27')][_0x6df3('0x34')](function(_0xccb1d8){var _0x1d065d=_[_0x6df3('0x35')](recordings[_0xd70a83['uniqueid']]);_0x1d065d[_0x6df3('0x22')]=_0xccb1d8[_0x6df3('0x22')];writeDB(_0x1d065d);});delete recordings[_0xd70a83[_0x6df3('0x5')]];}}catch(_0x185e4b){utils['error'](util[_0x6df3('0x4')](_0x6df3('0x2b'),_0xd70a83[_0x6df3('0x5')]),_0x185e4b);}};exports['newexten']=function(_0x5de718){try{if(!_['isNil'](recordings[_0x5de718[_0x6df3('0x5')]])){utils[_0x6df3('0x10')](util['format'](_0x6df3('0x36'),_0x5de718[_0x6df3('0x5')]),_0x5de718);utils[_0x6df3('0x3')](util[_0x6df3('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5de718[_0x6df3('0x5')],_0x5de718[_0x6df3('0x37')],_0x5de718[_0x6df3('0x38')]));if(_0x5de718[_0x6df3('0x37')][_0x6df3('0x39')]()==_0x6df3('0x3a')&&_[_0x6df3('0x3b')](_0x5de718[_0x6df3('0x38')][_0x6df3('0x39')](),_0x6df3('0x3c'))){var _0x19d16f=_0x5de718[_0x6df3('0x38')]['split']('=');var _0x50b3ba=_0x19d16f[0x0][_0x6df3('0x3d')](_0x19d16f[0x0][_0x6df3('0x3e')]('(')+0x1,_0x19d16f[0x0][_0x6df3('0x3e')](')'));var _0x2c14ee=_0x19d16f[0x1];recordings[_0x5de718['uniqueid']][_0x50b3ba]=_0x2c14ee;}}}catch(_0x351d36){utils[_0x6df3('0x29')](util[_0x6df3('0x4')](_0x6df3('0x36'),_0x5de718['uniqueid']),_0x351d36);}};exports[_0x6df3('0x3f')]=function(_0x596df2){try{if(!_[_0x6df3('0x19')](recordings[_0x596df2['uniqueid']])){utils[_0x6df3('0x10')](util[_0x6df3('0x4')]('[%s][recordings][queuecallerjoin]',_0x596df2[_0x6df3('0x5')]),_0x596df2);utils[_0x6df3('0x3')](util[_0x6df3('0x4')](_0x6df3('0x40'),_0x596df2[_0x6df3('0x5')],_0x596df2[_0x6df3('0x41')]));recordings[_0x596df2['uniqueid']][_0x6df3('0x41')]=_0x596df2[_0x6df3('0x41')];}}catch(_0x47d19d){utils[_0x6df3('0x29')](util[_0x6df3('0x4')](_0x6df3('0x42'),_0x596df2[_0x6df3('0x5')]),_0x47d19d);}};exports[_0x6df3('0x43')]=function(_0x181d1c){try{utils[_0x6df3('0x10')](util[_0x6df3('0x4')](_0x6df3('0x44'),_0x181d1c[_0x6df3('0x5')]),_0x181d1c);utils[_0x6df3('0x3')](util[_0x6df3('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x181d1c['uniqueid'],_0x181d1c[_0x6df3('0x45')],_0x181d1c['transferercalleridname'],_0x181d1c['transfereecalleridnum'],_0x181d1c[_0x6df3('0x46')]));if(recordings[_0x181d1c[_0x6df3('0x47')]]&&transfers[_0x6df3('0x6')][_0x181d1c['transfereruniqueid']]){transfers[_0x6df3('0x6')][_0x181d1c[_0x6df3('0x47')]][_0x6df3('0x48')]=!![];}}catch(_0x5d882f){utils[_0x6df3('0x29')](util['format'](_0x6df3('0x44'),_0x181d1c[_0x6df3('0x5')]),_0x5d882f);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ddae5b0..6bed6f9 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 _0x1812=['type','request','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','transferercalleridnum','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid'];(function(_0x37d374,_0x5b1075){var _0x4dacb7=function(_0x55d21f){while(--_0x55d21f){_0x37d374['push'](_0x37d374['shift']());}};_0x4dacb7(++_0x5b1075);}(_0x1812,0xc6));var _0x2181=function(_0x165bf3,_0x49fcfc){_0x165bf3=_0x165bf3-0x0;var _0xd12540=_0x1812[_0x165bf3];return _0xd12540;};'use strict';var _=require(_0x2181('0x0'));var util=require('util');var utils=require(_0x2181('0x1'));function writeDB(_0x26e028){utils[_0x2181('0x2')](util[_0x2181('0x3')](_0x2181('0x4'),_0x26e028['type']===_0x2181('0x5')?_0x26e028['origtransfereruniqueid']:_0x26e028[_0x2181('0x6')],_0x26e028[_0x2181('0x7')]));utils[_0x2181('0x8')](_0x2181('0x9'),_0x26e028);}exports['blinds']={};exports['blindtransfer']=function(_0xd650f1){try{utils['debug'](util[_0x2181('0x3')](_0x2181('0xa'),_0xd650f1[_0x2181('0x6')]),_0xd650f1);utils[_0x2181('0x2')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xd650f1[_0x2181('0x6')],_0xd650f1[_0x2181('0xb')],_0xd650f1['transferercalleridname'],_0xd650f1['transfereecalleridnum'],_0xd650f1['transfereecalleridname']));_0xd650f1[_0x2181('0x7')]=_0x2181('0xc');exports['blinds'][_0xd650f1[_0x2181('0xd')]]=_0xd650f1;writeDB(_0xd650f1);}catch(_0xf8c591){utils[_0x2181('0xe')](util['format'](_0x2181('0xa'),_0xd650f1[_0x2181('0x6')]),_0xf8c591);}};exports[_0x2181('0xf')]=function(_0x4ed5ff){try{utils[_0x2181('0x10')](util[_0x2181('0x3')](_0x2181('0x11'),_0x4ed5ff[_0x2181('0x12')]),_0x4ed5ff);utils['info'](util[_0x2181('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4ed5ff[_0x2181('0x12')],_0x4ed5ff[_0x2181('0x13')],_0x4ed5ff['origtransferercalleridname'],_0x4ed5ff[_0x2181('0x14')],_0x4ed5ff['transfertargetcalleridname']));_0x4ed5ff=_[_0x2181('0x15')](_0x4ed5ff,{'transfererchannel':_0x4ed5ff[_0x2181('0x16')],'transferercalleridnum':_0x4ed5ff[_0x2181('0x13')],'transferercalleridname':_0x4ed5ff[_0x2181('0x17')],'transfererconnectedlinenum':_0x4ed5ff[_0x2181('0x18')],'transfererconnectedlinename':_0x4ed5ff[_0x2181('0x19')],'transfereraccountcode':_0x4ed5ff[_0x2181('0x1a')],'transferercontext':_0x4ed5ff[_0x2181('0x1b')],'transfererexten':_0x4ed5ff[_0x2181('0x1c')],'transfererlinkedid':_0x4ed5ff[_0x2181('0x1d')],'context':_0x4ed5ff[_0x2181('0x1e')],'extension':_0x4ed5ff[_0x2181('0x1f')],'type':_0x2181('0x5')});if(_[_0x2181('0x20')](_0x4ed5ff[_0x2181('0x21')])){_0x4ed5ff=_['assign'](_0x4ed5ff,{'transfereechannel':_0x4ed5ff[_0x2181('0x22')],'transfereecalleridnum':_0x4ed5ff[_0x2181('0x14')],'transfereecalleridname':_0x4ed5ff[_0x2181('0x23')],'transfereeconnectedlinenum':_0x4ed5ff[_0x2181('0x24')],'transfereeconnectedlinename':_0x4ed5ff[_0x2181('0x25')],'transfereeaccountcode':_0x4ed5ff[_0x2181('0x26')],'transfereecontext':_0x4ed5ff[_0x2181('0x27')],'transfereeexten':_0x4ed5ff['transfertargetexten'],'transfereelinkedid':_0x4ed5ff[_0x2181('0x28')]});}writeDB(_0x4ed5ff);}catch(_0x44fdf7){utils['error'](util[_0x2181('0x3')](_0x2181('0x11'),_0x4ed5ff['origtransfereruniqueid']),_0x44fdf7);}}; \ No newline at end of file +var _0x7261=['format','[%s][transfers][writeDB]\x20type:%s','type','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info'];(function(_0x278787,_0xa27e4d){var _0x3078d2=function(_0x44f459){while(--_0x44f459){_0x278787['push'](_0x278787['shift']());}};_0x3078d2(++_0xa27e4d);}(_0x7261,0x129));var _0x1726=function(_0x3d1047,_0x14d621){_0x3d1047=_0x3d1047-0x0;var _0x21c4e7=_0x7261[_0x3d1047];return _0x21c4e7;};'use strict';var _=require(_0x1726('0x0'));var util=require(_0x1726('0x1'));var utils=require(_0x1726('0x2'));function writeDB(_0x4b8d1d){utils[_0x1726('0x3')](util[_0x1726('0x4')](_0x1726('0x5'),_0x4b8d1d[_0x1726('0x6')]==='attended'?_0x4b8d1d['origtransfereruniqueid']:_0x4b8d1d['uniqueid'],_0x4b8d1d[_0x1726('0x6')]));utils['request']('CreateVoiceTransferReport',_0x4b8d1d);}exports['blinds']={};exports[_0x1726('0x7')]=function(_0x504381){try{utils[_0x1726('0x8')](util[_0x1726('0x4')](_0x1726('0x9'),_0x504381[_0x1726('0xa')]),_0x504381);utils[_0x1726('0x3')](util['format'](_0x1726('0xb'),_0x504381[_0x1726('0xa')],_0x504381[_0x1726('0xc')],_0x504381[_0x1726('0xd')],_0x504381[_0x1726('0xe')],_0x504381[_0x1726('0xf')]));_0x504381[_0x1726('0x6')]=_0x1726('0x10');exports[_0x1726('0x11')][_0x504381[_0x1726('0x12')]]=_0x504381;writeDB(_0x504381);}catch(_0x43c3cd){utils[_0x1726('0x13')](util['format'](_0x1726('0x9'),_0x504381[_0x1726('0xa')]),_0x43c3cd);}};exports[_0x1726('0x14')]=function(_0x221498){try{utils[_0x1726('0x8')](util[_0x1726('0x4')](_0x1726('0x15'),_0x221498[_0x1726('0x16')]),_0x221498);utils[_0x1726('0x3')](util[_0x1726('0x4')](_0x1726('0x17'),_0x221498[_0x1726('0x16')],_0x221498[_0x1726('0x18')],_0x221498['origtransferercalleridname'],_0x221498[_0x1726('0x19')],_0x221498[_0x1726('0x1a')]));_0x221498=_[_0x1726('0x1b')](_0x221498,{'transfererchannel':_0x221498[_0x1726('0x1c')],'transferercalleridnum':_0x221498[_0x1726('0x18')],'transferercalleridname':_0x221498['origtransferercalleridname'],'transfererconnectedlinenum':_0x221498[_0x1726('0x1d')],'transfererconnectedlinename':_0x221498[_0x1726('0x1e')],'transfereraccountcode':_0x221498[_0x1726('0x1f')],'transferercontext':_0x221498['secondtransferercontext'],'transfererexten':_0x221498[_0x1726('0x20')],'transfererlinkedid':_0x221498[_0x1726('0x21')],'context':_0x221498[_0x1726('0x22')],'extension':_0x221498['origtransfererexten'],'type':_0x1726('0x23')});if(_[_0x1726('0x24')](_0x221498[_0x1726('0x25')])){_0x221498=_[_0x1726('0x1b')](_0x221498,{'transfereechannel':_0x221498['transfertargetchannel'],'transfereecalleridnum':_0x221498['transfertargetcalleridnum'],'transfereecalleridname':_0x221498['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x221498[_0x1726('0x26')],'transfereeconnectedlinename':_0x221498[_0x1726('0x27')],'transfereeaccountcode':_0x221498[_0x1726('0x28')],'transfereecontext':_0x221498[_0x1726('0x29')],'transfereeexten':_0x221498[_0x1726('0x2a')],'transfereelinkedid':_0x221498['transfertargetlinkedid']});}writeDB(_0x221498);}catch(_0x31e007){utils[_0x1726('0x13')](util[_0x1726('0x4')](_0x1726('0x15'),_0x221498['origtransfereruniqueid']),_0x31e007);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 9192abc..b9fbfd4 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 _0x3c9f=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','found','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','internal','interface','then','[utils][getUser]\x20where:%s','result','length','getUserByInternal','notfound','getUserByInterface','[utils][getUserByInterface]'];(function(_0x30be49,_0x37d3bf){var _0x401c55=function(_0x1a3e10){while(--_0x1a3e10){_0x30be49['push'](_0x30be49['shift']());}};_0x401c55(++_0x37d3bf);}(_0x3c9f,0x148));var _0xf3c9=function(_0xb99ac5,_0x4dd5fb){_0xb99ac5=_0xb99ac5-0x0;var _0x4c8255=_0x3c9f[_0xb99ac5];return _0x4c8255;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xf3c9('0x0'));var moment=require(_0xf3c9('0x1'));var util=require(_0xf3c9('0x2'));var client=jayson[_0xf3c9('0x3')][_0xf3c9('0x4')]({'port':0x2329});var logger=require(_0xf3c9('0x5'))(_0xf3c9('0x6'));exports['info']=function(_0x10bc04,_0x1888d1){logger[_0xf3c9('0x7')](_0x10bc04,_0x1888d1?util[_0xf3c9('0x8')](_0x1888d1,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x3ab952,_0x4c25c2){logger[_0xf3c9('0x9')](_0x3ab952,_0x4c25c2?util[_0xf3c9('0x8')](_0x4c25c2,{'showHidden':![],'depth':null}):'');};exports[_0xf3c9('0xa')]=function(_0x29b4af,_0x80858f){logger[_0xf3c9('0xa')](_0x29b4af,_0x80858f?util[_0xf3c9('0x8')](_0x80858f,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x513a95,_0xf4a849){return client[_0xf3c9('0xb')](_0x513a95,{'body':_0xf4a849})['then'](function(_0x34e8e6){logger[_0xf3c9('0x9')](_0xf3c9('0xc'),_0x513a95,_0x34e8e6?util['inspect'](_0x34e8e6,{'showHidden':![],'depth':null}):'');})[_0xf3c9('0xd')](function(_0xba0072){logger[_0xf3c9('0xa')](_0xf3c9('0xc'),_0x513a95,_0xba0072?util[_0xf3c9('0x8')](_0xba0072,{'showHidden':![],'depth':null}):'');});};function getUser(_0x17bcc2){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf3c9('0xe'),'name',_0xf3c9('0xf')],'where':_0x17bcc2,'limit':0x1}})[_0xf3c9('0x10')](function(_0x1f26d4){logger['debug'](_0xf3c9('0x11'),JSON['stringify'](_0x17bcc2),_0x1f26d4?util[_0xf3c9('0x8')](_0x1f26d4,{'showHidden':![],'depth':null}):'');return _0x1f26d4[_0xf3c9('0x12')][_0xf3c9('0x13')]?_0x1f26d4[_0xf3c9('0x12')][0x0]:null;});}exports[_0xf3c9('0x14')]=function(_0xc3483d){return new BPromise(function(_0x4ba7e5,_0x871c75){if(_0xc3483d){return getUser({'internal':_0xc3483d})[_0xf3c9('0x10')](function(_0x15921f){logger[_0xf3c9('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xc3483d,_0x15921f?'found':_0xf3c9('0x15'));return _0x4ba7e5(_0x15921f);})[_0xf3c9('0xd')](function(_0x1b9c78){logger[_0xf3c9('0xa')]('[utils][getUserByInternal]',_0x1b9c78?util['inspect'](_0x1b9c78,{'showHidden':![],'depth':null}):'');return _0x4ba7e5(null);});}return _0x4ba7e5(null);});};exports[_0xf3c9('0x16')]=function(_0x3bddd0){return new BPromise(function(_0x1a97bc,_0x4cd4f9){if(_0x3bddd0){return getUser({'interface':_0x3bddd0})[_0xf3c9('0x10')](function(_0x4a706c){logger[_0xf3c9('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3bddd0,_0x4a706c?'found':'notfound');return _0x1a97bc(_0x4a706c);})[_0xf3c9('0xd')](function(_0x16cd3b){logger['error'](_0xf3c9('0x17'),_0x16cd3b?util[_0xf3c9('0x8')](_0x16cd3b,{'showHidden':![],'depth':null}):'');return _0x1a97bc(null);});}return _0x1a97bc(null);});};exports[_0xf3c9('0x18')]=function(_0x3a1eec){return new BPromise(function(_0x3cb474,_0x49f93a){if(_0x3a1eec){return getUser({'name':_0x3a1eec})[_0xf3c9('0x10')](function(_0x542f60){logger[_0xf3c9('0x7')](_0xf3c9('0x19'),_0x3a1eec,_0x542f60?_0xf3c9('0x1a'):_0xf3c9('0x15'));return _0x3cb474(_0x542f60);})[_0xf3c9('0xd')](function(_0xcc4cbd){logger[_0xf3c9('0xa')]('[utils][getUserByName]',_0xcc4cbd?util[_0xf3c9('0x8')](_0xcc4cbd,{'showHidden':![],'depth':null}):'');return _0x3cb474(null);});}return _0x3cb474(null);});};exports[_0xf3c9('0x1b')]=function(_0x498320){return new BPromise(function(_0x4539c0,_0x4b616d){if(_0x498320){return client[_0xf3c9('0xb')](_0xf3c9('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xf3c9('0x1d'),'type',_0xf3c9('0x1e'),_0xf3c9('0x1f')],'where':{'name':_0x498320},'limit':0x1}})[_0xf3c9('0x10')](function(_0x190b28){logger['debug'](_0xf3c9('0x20'),_0x498320,_0x190b28?util[_0xf3c9('0x8')](_0x190b28,{'showHidden':![],'depth':null}):'');logger[_0xf3c9('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x498320,_0x190b28?_0xf3c9('0x1a'):'notfound');return _0x4539c0(_0x190b28['result']['length']?_0x190b28['result'][0x0]:null);})[_0xf3c9('0xd')](function(_0x3d8853){logger[_0xf3c9('0xa')](_0xf3c9('0x21'),_0x3d8853?util[_0xf3c9('0x8')](_0x3d8853,{'showHidden':![],'depth':null}):'');return _0x4539c0(null);});}return _0x4539c0(null);});};exports['addTime']=function(_0x388697,_0x39a6fc){return moment(_0x388697)['add'](_0x39a6fc,'seconds')[_0xf3c9('0x22')](_0xf3c9('0x23'));};exports[_0xf3c9('0x24')]=function(_0x58f764,_0x2397cb){return moment(_0x58f764)[_0xf3c9('0x25')](_0x2397cb,_0xf3c9('0x26'))[_0xf3c9('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf3c9('0x27')]=function(_0x55c887,_0x44cb75){return moment(_0x55c887)['diff'](moment(_0x44cb75),_0xf3c9('0x26'));};exports[_0xf3c9('0x28')]=function(_0x4f56fa,_0x6e272f){return parseInt(_0x4f56fa,0xa)+parseInt(_0x6e272f,0xa);};exports[_0xf3c9('0x29')]=function(){return moment()['format'](_0xf3c9('0x23'));};exports[_0xf3c9('0x2a')]=function(_0x480423,_0x384369){if(_0x384369){return moment(_0x480423)[_0xf3c9('0x2a')](_0x384369);}return!![];};exports[_0xf3c9('0x2b')]=function(_0x58c0ef,_0x270331){if(_0x270331){return moment(_0x58c0ef)[_0xf3c9('0x2b')](_0x270331);}else if(_0x58c0ef){return!![];}return![];}; \ No newline at end of file +var _0xf9f3=['format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','client','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds'];(function(_0x103657,_0x4b812a){var _0x336f83=function(_0x422dba){while(--_0x422dba){_0x103657['push'](_0x103657['shift']());}};_0x336f83(++_0x4b812a);}(_0xf9f3,0x12e));var _0x3f9f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf9f3[_0x167cc1];return _0x10bc4b;};'use strict';var BPromise=require(_0x3f9f('0x0'));var jayson=require(_0x3f9f('0x1'));var moment=require('moment');var util=require('util');var client=jayson[_0x3f9f('0x2')]['http']({'port':0x2329});var logger=require(_0x3f9f('0x3'))(_0x3f9f('0x4'));exports['info']=function(_0x3fc416,_0xc77e30){logger[_0x3f9f('0x5')](_0x3fc416,_0xc77e30?util['inspect'](_0xc77e30,{'showHidden':![],'depth':null}):'');};exports[_0x3f9f('0x6')]=function(_0x373b75,_0x8489a0){logger[_0x3f9f('0x6')](_0x373b75,_0x8489a0?util[_0x3f9f('0x7')](_0x8489a0,{'showHidden':![],'depth':null}):'');};exports[_0x3f9f('0x8')]=function(_0x59d287,_0x5e94f6){logger['error'](_0x59d287,_0x5e94f6?util['inspect'](_0x5e94f6,{'showHidden':![],'depth':null}):'');};exports[_0x3f9f('0x9')]=function(_0x578096,_0x34e057){return client[_0x3f9f('0x9')](_0x578096,{'body':_0x34e057})[_0x3f9f('0xa')](function(_0x5ed02a){logger[_0x3f9f('0x6')](_0x3f9f('0xb'),_0x578096,_0x5ed02a?util['inspect'](_0x5ed02a,{'showHidden':![],'depth':null}):'');})[_0x3f9f('0xc')](function(_0x137198){logger[_0x3f9f('0x8')](_0x3f9f('0xb'),_0x578096,_0x137198?util[_0x3f9f('0x7')](_0x137198,{'showHidden':![],'depth':null}):'');});};function getUser(_0x495b8d){return client[_0x3f9f('0x9')](_0x3f9f('0xd'),{'options':{'raw':!![],'attributes':['id',_0x3f9f('0xe'),_0x3f9f('0xf'),_0x3f9f('0x10')],'where':_0x495b8d,'limit':0x1}})[_0x3f9f('0xa')](function(_0xc21fda){logger[_0x3f9f('0x6')](_0x3f9f('0x11'),JSON[_0x3f9f('0x12')](_0x495b8d),_0xc21fda?util[_0x3f9f('0x7')](_0xc21fda,{'showHidden':![],'depth':null}):'');return _0xc21fda[_0x3f9f('0x13')][_0x3f9f('0x14')]?_0xc21fda[_0x3f9f('0x13')][0x0]:null;});}exports[_0x3f9f('0x15')]=function(_0x339643){return new BPromise(function(_0x243132,_0x12ad9b){if(_0x339643){return getUser({'internal':_0x339643})[_0x3f9f('0xa')](function(_0x2aa409){logger[_0x3f9f('0x5')](_0x3f9f('0x16'),_0x339643,_0x2aa409?_0x3f9f('0x17'):_0x3f9f('0x18'));return _0x243132(_0x2aa409);})[_0x3f9f('0xc')](function(_0x3b2b8e){logger[_0x3f9f('0x8')](_0x3f9f('0x19'),_0x3b2b8e?util[_0x3f9f('0x7')](_0x3b2b8e,{'showHidden':![],'depth':null}):'');return _0x243132(null);});}return _0x243132(null);});};exports[_0x3f9f('0x1a')]=function(_0x129b8b){return new BPromise(function(_0xf1d5,_0x4ce954){if(_0x129b8b){return getUser({'interface':_0x129b8b})['then'](function(_0x14ec75){logger[_0x3f9f('0x5')](_0x3f9f('0x1b'),_0x129b8b,_0x14ec75?'found':_0x3f9f('0x18'));return _0xf1d5(_0x14ec75);})[_0x3f9f('0xc')](function(_0x390ee6){logger[_0x3f9f('0x8')](_0x3f9f('0x1c'),_0x390ee6?util[_0x3f9f('0x7')](_0x390ee6,{'showHidden':![],'depth':null}):'');return _0xf1d5(null);});}return _0xf1d5(null);});};exports[_0x3f9f('0x1d')]=function(_0x4e3146){return new BPromise(function(_0x2a24da,_0x114719){if(_0x4e3146){return getUser({'name':_0x4e3146})[_0x3f9f('0xa')](function(_0x4f268f){logger[_0x3f9f('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4e3146,_0x4f268f?'found':_0x3f9f('0x18'));return _0x2a24da(_0x4f268f);})[_0x3f9f('0xc')](function(_0x1ca49e){logger[_0x3f9f('0x8')](_0x3f9f('0x1e'),_0x1ca49e?util[_0x3f9f('0x7')](_0x1ca49e,{'showHidden':![],'depth':null}):'');return _0x2a24da(null);});}return _0x2a24da(null);});};exports[_0x3f9f('0x1f')]=function(_0x2f6736){return new BPromise(function(_0x36f707,_0x50bb44){if(_0x2f6736){return client[_0x3f9f('0x9')](_0x3f9f('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0x3f9f('0x21'),_0x3f9f('0x22'),_0x3f9f('0x23')],'where':{'name':_0x2f6736},'limit':0x1}})[_0x3f9f('0xa')](function(_0x113810){logger[_0x3f9f('0x6')]('[utils][getVoiceQueueByName]\x20name:%s',_0x2f6736,_0x113810?util['inspect'](_0x113810,{'showHidden':![],'depth':null}):'');logger[_0x3f9f('0x5')](_0x3f9f('0x24'),_0x2f6736,_0x113810?_0x3f9f('0x17'):_0x3f9f('0x18'));return _0x36f707(_0x113810[_0x3f9f('0x13')]['length']?_0x113810[_0x3f9f('0x13')][0x0]:null);})[_0x3f9f('0xc')](function(_0x6aff19){logger[_0x3f9f('0x8')](_0x3f9f('0x25'),_0x6aff19?util[_0x3f9f('0x7')](_0x6aff19,{'showHidden':![],'depth':null}):'');return _0x36f707(null);});}return _0x36f707(null);});};exports[_0x3f9f('0x26')]=function(_0x1c80df,_0x4c13eb){return moment(_0x1c80df)[_0x3f9f('0x27')](_0x4c13eb,_0x3f9f('0x28'))[_0x3f9f('0x29')](_0x3f9f('0x2a'));};exports[_0x3f9f('0x2b')]=function(_0x5d26d6,_0x14d77c){return moment(_0x5d26d6)['subtract'](_0x14d77c,_0x3f9f('0x28'))[_0x3f9f('0x29')](_0x3f9f('0x2a'));};exports[_0x3f9f('0x2c')]=function(_0x338d1d,_0x224a4b){return moment(_0x338d1d)[_0x3f9f('0x2d')](moment(_0x224a4b),'seconds');};exports['sumTime']=function(_0x122ad6,_0x285d48){return parseInt(_0x122ad6,0xa)+parseInt(_0x285d48,0xa);};exports[_0x3f9f('0x2e')]=function(){return moment()['format'](_0x3f9f('0x2a'));};exports['isAfter']=function(_0x23f405,_0x2aa0aa){if(_0x2aa0aa){return moment(_0x23f405)[_0x3f9f('0x2f')](_0x2aa0aa);}return!![];};exports['isBefore']=function(_0x4c5e17,_0x106a80){if(_0x106a80){return moment(_0x4c5e17)[_0x3f9f('0x30')](_0x106a80);}else if(_0x4c5e17){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index caa939b..b6735ef 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf1a=['then','catch','user','no-user','data','timestamp','auth','set','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','name','ensureDir'];(function(_0x2f0175,_0x250c03){var _0x1d9e63=function(_0x3932c8){while(--_0x3932c8){_0x2f0175['push'](_0x2f0175['shift']());}};_0x1d9e63(++_0x250c03);}(_0xdf1a,0x159));var _0xadf1=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0xdf1a[_0x3794a0];return _0x5bdaba;};var fs=require(_0xadf1('0x0'));var _=require(_0xadf1('0x1'));var ewinston=require(_0xadf1('0x2'));var path=require(_0xadf1('0x3'));var util=require('util');var fileLogger=require('./loggers')[_0xadf1('0x4')];var safeTemplate=require(_0xadf1('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xadf1('0x6'))[_0xadf1('0x7')];function ClientSideLogger(){function _0x1e4318(_0x30527e){var _0x5b0d23=path['join'](_0xadf1('0x8'),_0xadf1('0x9'),_0xadf1('0xa'));var _0x4bdfcd=path[_0xadf1('0xb')](_0xadf1('0xc'),_0x30527e['role']+'-'+_0x30527e[_0xadf1('0xd')]);return fs[_0xadf1('0xe')](path[_0xadf1('0xb')](_0x5b0d23,_0x4bdfcd))[_0xadf1('0xf')](function(){var _0x265e1b=fileLogger(_0xadf1('0xc'),path[_0xadf1('0xb')](_0x5b0d23,_0x4bdfcd));return _0x265e1b;})[_0xadf1('0x10')](function(_0x16fafb){throw _0x16fafb;});}this[_0xadf1('0x9')]=function(_0x50031f,_0xae32df,_0x3d0ff5,_0x3b9bea){return _0x1e4318(_0x50031f[_0xadf1('0x11')])['then'](function(_0x57646f){var _0x3a1e6f=_0x57646f[_0xae32df];return _0x3a1e6f;})[_0xadf1('0xf')](function(_0x465d5b){var _0x297f4e=_0x50031f['user']?_0x50031f[_0xadf1('0x11')]['id']:_0xadf1('0x12');var _0x20295f=_0x3b9bea[_0xadf1('0x13')];var _0x397ded=_0x3b9bea[_0xadf1('0x14')];var _0x9b92bb=new Date(Number(_0x397ded));return _0x465d5b(_0x297f4e,_0x9b92bb,_0x3d0ff5,_0x20295f);})[_0xadf1('0x10')](function(_0x509601){fileLogger('client')['error'](_0x509601);});};}function setupLoggers(_0x46fd9c){return new Promise(function(_0x20ab6d){var _0x3ee137=new ClientSideLogger();var _0x2bf0b9=fileLogger('api');var _0x712a6c=fileLogger(_0xadf1('0x15'));_0x46fd9c[_0xadf1('0x16')]('client-side-logger',_0x3ee137);_0x46fd9c['use'](ewinston[_0xadf1('0x17')]({'winstonInstance':_0x2bf0b9,'meta':![],'statusLevels':!![],'msg':function(_0x5d0b69,_0xc2490a){var _0x2e1ab8=_0xadf1('0x18');if(!_[_0xadf1('0x19')](_0x5d0b69[_0xadf1('0x1a')])){_0x2e1ab8+=_0xadf1('0x1b');var _0x332492=_0x5d0b69[_0xadf1('0x1a')];maskSensitiveData(_0x332492);}return safeTemplate(util[_0xadf1('0x1c')](_0x2e1ab8,_0x5d0b69[_0xadf1('0x1d')],_0x5d0b69[_0xadf1('0x1e')][_0xadf1('0x1f')]?_0x5d0b69[_0xadf1('0x1e')][_0xadf1('0x1f')]:_0x5d0b69[_0xadf1('0x20')][_0xadf1('0x21')]||_0x5d0b69['ip'],_0x5d0b69[_0xadf1('0x22')],_0xc2490a['statusCode'],_0xc2490a[_0xadf1('0x23')],_0x5d0b69[_0xadf1('0x11')]?_0x5d0b69[_0xadf1('0x11')]['id']:null,_0x5d0b69[_0xadf1('0x11')]?_0x5d0b69[_0xadf1('0x11')][_0xadf1('0xd')]:null,_0x5d0b69[_0xadf1('0x11')]?_0x5d0b69['user'][_0xadf1('0x24')]:null,_0x332492?util['inspect'](_0x332492,![],null):''));}}));_0x46fd9c[_0xadf1('0x25')](ewinston[_0xadf1('0x17')]({'winstonInstance':_0x712a6c,'meta':![],'statusLevels':!![],'msg':function(_0x7af315,_0x44fb1d){var _0x28acae=_0xadf1('0x26');if(_0x7af315['body']&&_0x7af315['body'][_0xadf1('0x27')]&&_0x7af315['body'][_0xadf1('0x28')]){_0x28acae=_0xadf1('0x29');}return util[_0xadf1('0x1c')](_0x28acae,_0x7af315[_0xadf1('0x1d')],_0x7af315['headers'][_0xadf1('0x1f')]?_0x7af315['headers'][_0xadf1('0x1f')]:_0x7af315['connection'][_0xadf1('0x21')]||_0x7af315['ip'],_0x7af315[_0xadf1('0x22')],_0x44fb1d[_0xadf1('0x2a')],_0x44fb1d[_0xadf1('0x23')],_0x7af315['user']?_0x7af315[_0xadf1('0x11')]['id']:null,_0x7af315[_0xadf1('0x11')]?_0x7af315[_0xadf1('0x11')][_0xadf1('0xd')]:null,_0x7af315[_0xadf1('0x11')]?_0x7af315['user']['role']:null,_0x7af315[_0xadf1('0x1a')]&&_0x7af315['body'][_0xadf1('0x27')]?_0x7af315[_0xadf1('0x1a')]['device']:'other',_0x7af315[_0xadf1('0x1a')]&&_0x7af315[_0xadf1('0x1a')][_0xadf1('0x28')]?_0x7af315[_0xadf1('0x1a')]['agent_id']:'',_0x7af315[_0xadf1('0x1a')]&&_0x7af315[_0xadf1('0x1a')][_0xadf1('0x2b')]?_0x7af315[_0xadf1('0x1a')][_0xadf1('0x2b')]:'');},'ignoreRoute':function(_0x1d4dd7){var _0x30d97f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x30d97f['test'](_0x1d4dd7[_0xadf1('0x22')]);}}));return _0x20ab6d();});}exports[_0xadf1('0x2c')]=setupLoggers; \ No newline at end of file +var _0xa656=['then','catch','log','user','timestamp','error','api','auth','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','agent_name','fs-extra','lodash','express-winston','path','util','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','xcally','client','role','name','ensureDir'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0xa656,0x71));var _0x6a65=function(_0x439a53,_0x51e060){_0x439a53=_0x439a53-0x0;var _0x2736e8=_0xa656[_0x439a53];return _0x2736e8;};var fs=require(_0x6a65('0x0'));var _=require(_0x6a65('0x1'));var ewinston=require(_0x6a65('0x2'));var path=require(_0x6a65('0x3'));var util=require(_0x6a65('0x4'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0x6a65('0x5'))[_0x6a65('0x6')];var maskSensitiveData=require(_0x6a65('0x7'))[_0x6a65('0x8')];function ClientSideLogger(){function _0x54c814(_0x1642af){var _0x59a44c=path[_0x6a65('0x9')](_0x6a65('0xa'),'log',_0x6a65('0xb'));var _0x49c1e1=path[_0x6a65('0x9')](_0x6a65('0xc'),_0x1642af[_0x6a65('0xd')]+'-'+_0x1642af[_0x6a65('0xe')]);return fs[_0x6a65('0xf')](path[_0x6a65('0x9')](_0x59a44c,_0x49c1e1))[_0x6a65('0x10')](function(){var _0x2ccb0d=fileLogger('client',path[_0x6a65('0x9')](_0x59a44c,_0x49c1e1));return _0x2ccb0d;})[_0x6a65('0x11')](function(_0x53e089){throw _0x53e089;});}this[_0x6a65('0x12')]=function(_0x1dee7a,_0x566903,_0x3fd796,_0x190210){return _0x54c814(_0x1dee7a['user'])[_0x6a65('0x10')](function(_0x1befa0){var _0x36bb31=_0x1befa0[_0x566903];return _0x36bb31;})[_0x6a65('0x10')](function(_0x42ac0b){var _0x3d46ac=_0x1dee7a[_0x6a65('0x13')]?_0x1dee7a[_0x6a65('0x13')]['id']:'no-user';var _0x78852d=_0x190210['data'];var _0xec2e77=_0x190210[_0x6a65('0x14')];var _0x55f620=new Date(Number(_0xec2e77));return _0x42ac0b(_0x3d46ac,_0x55f620,_0x3fd796,_0x78852d);})['catch'](function(_0x1b0bcb){fileLogger(_0x6a65('0xc'))[_0x6a65('0x15')](_0x1b0bcb);});};}function setupLoggers(_0x2f2607){return new Promise(function(_0x17b6fe){var _0x21c649=new ClientSideLogger();var _0x16740c=fileLogger(_0x6a65('0x16'));var _0x4ea016=fileLogger(_0x6a65('0x17'));_0x2f2607['set'](_0x6a65('0x18'),_0x21c649);_0x2f2607[_0x6a65('0x19')](ewinston['logger']({'winstonInstance':_0x16740c,'meta':![],'statusLevels':!![],'msg':function(_0x558408,_0x578376){var _0x45e5cc=_0x6a65('0x1a');if(!_[_0x6a65('0x1b')](_0x558408[_0x6a65('0x1c')])){_0x45e5cc+='\x20body=%s';var _0x206dd7=_0x558408['body'];maskSensitiveData(_0x206dd7);}return safeTemplate(util[_0x6a65('0x1d')](_0x45e5cc,_0x558408[_0x6a65('0x1e')],_0x558408[_0x6a65('0x1f')][_0x6a65('0x20')]?_0x558408['headers']['x-forwarded-for']:_0x558408[_0x6a65('0x21')][_0x6a65('0x22')]||_0x558408['ip'],_0x558408[_0x6a65('0x23')],_0x578376['statusCode'],_0x578376[_0x6a65('0x24')],_0x558408['user']?_0x558408[_0x6a65('0x13')]['id']:null,_0x558408[_0x6a65('0x13')]?_0x558408['user'][_0x6a65('0xe')]:null,_0x558408[_0x6a65('0x13')]?_0x558408[_0x6a65('0x13')][_0x6a65('0xd')]:null,_0x206dd7?util[_0x6a65('0x25')](_0x206dd7,![],null):''));}}));_0x2f2607['use'](ewinston[_0x6a65('0x26')]({'winstonInstance':_0x4ea016,'meta':![],'statusLevels':!![],'msg':function(_0x46af8b,_0x5ce18b){var _0x189368=_0x6a65('0x27');if(_0x46af8b['body']&&_0x46af8b[_0x6a65('0x1c')][_0x6a65('0x28')]&&_0x46af8b[_0x6a65('0x1c')][_0x6a65('0x29')]){_0x189368='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x6a65('0x1d')](_0x189368,_0x46af8b[_0x6a65('0x1e')],_0x46af8b[_0x6a65('0x1f')][_0x6a65('0x20')]?_0x46af8b[_0x6a65('0x1f')][_0x6a65('0x20')]:_0x46af8b[_0x6a65('0x21')]['remoteAddress']||_0x46af8b['ip'],_0x46af8b[_0x6a65('0x23')],_0x5ce18b['statusCode'],_0x5ce18b[_0x6a65('0x24')],_0x46af8b[_0x6a65('0x13')]?_0x46af8b['user']['id']:null,_0x46af8b[_0x6a65('0x13')]?_0x46af8b[_0x6a65('0x13')][_0x6a65('0xe')]:null,_0x46af8b[_0x6a65('0x13')]?_0x46af8b['user']['role']:null,_0x46af8b[_0x6a65('0x1c')]&&_0x46af8b[_0x6a65('0x1c')][_0x6a65('0x28')]?_0x46af8b['body'][_0x6a65('0x28')]:'other',_0x46af8b['body']&&_0x46af8b[_0x6a65('0x1c')][_0x6a65('0x29')]?_0x46af8b['body'][_0x6a65('0x29')]:'',_0x46af8b['body']&&_0x46af8b[_0x6a65('0x1c')][_0x6a65('0x2a')]?_0x46af8b['body'][_0x6a65('0x2a')]:'');},'ignoreRoute':function(_0x3f9922){var _0x458404=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x458404['test'](_0x3f9922[_0x6a65('0x23')]);}}));return _0x17b6fe();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 043eaed..699eaf1 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75c3=['guess','test','isMoment','padStart','length','split','iftime','lodash','moment-timezone','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','day','endOf','isBetween','format','ddd','includes','dowCompare','date','daysInMonth','min','max','domCompare','monthCompare'];(function(_0x512ee1,_0x26701e){var _0x167513=function(_0x4ead35){while(--_0x4ead35){_0x512ee1['push'](_0x512ee1['shift']());}};_0x167513(++_0x26701e);}(_0x75c3,0x13f));var _0x375c=function(_0x89123f,_0x5b5342){_0x89123f=_0x89123f-0x0;var _0x487f72=_0x75c3[_0x89123f];return _0x487f72;};var _=require(_0x375c('0x0'));var moment=require(_0x375c('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x375c('0x2')](function(_0x3f06a2){return _0x3f06a2[_0x375c('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x375c('0x4');var EINVALID_DATE=_0x375c('0x5');function throwIfDateNotValid(_0x2745aa){if(!_0x2745aa[_0x375c('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x50a287){var _0x578925=_0x50a287['split'](':')['map'](function(_0x106e3b){return parseInt(_0x106e3b,0xa);});var _0x4a5c46=_0x578925[0x0];var _0x39d9d8=_0x578925[0x1];if(_0x4a5c46<0x0||_0x4a5c46>0x17||_0x39d9d8<0x0||_0x39d9d8>0x3b){throw new Error(EINVALID_DATE);}return[_0x4a5c46,_0x39d9d8];}function circularDoWInterval(_0x5b1d19,_0x418965){if(_0x5b1d19===_0x418965){return[_0x5b1d19];}else{var _0x1d885f=moment[_0x375c('0x7')]();moment[_0x375c('0x7')]('en');var _0x184075=moment['weekdaysShort']()[_0x375c('0x2')](function(_0x649f2f){return _0x649f2f[_0x375c('0x8')]();});moment['locale'](_0x1d885f);var _0x93b54a=_0x184075[_0x375c('0x9')](_0x5b1d19);var _0x14d651=_0x184075[_0x375c('0x9')](_0x418965);if(_0x14d651>_0x93b54a){return _0x184075[_0x375c('0xa')](_0x93b54a,_0x14d651+0x1);}else{var _0x2d5918=_0x184075['slice'](0x0,_0x14d651+0x1);var _0x4def7e=_0x184075[_0x375c('0xa')](_0x93b54a);return _0x4def7e[_0x375c('0xb')](_0x2d5918);}}}module[_0x375c('0xc')][_0x375c('0xd')]=circularDoWInterval;function circularMonthInterval(_0x3727e9,_0x3a2c65){if(_0x3727e9===_0x3a2c65){return[_0x3727e9];}else{var _0x4f4281=moment['locale']();moment[_0x375c('0x7')]('en');var _0x1a2020=moment[_0x375c('0xe')]()[_0x375c('0x2')](function(_0x4eaf09){return _0x4eaf09['toLowerCase']();});moment[_0x375c('0x7')](_0x4f4281);var _0x42f12e=_0x1a2020[_0x375c('0x9')](_0x3727e9);var _0x5a3dfd=_0x1a2020['indexOf'](_0x3a2c65);if(_0x5a3dfd>_0x42f12e){return _0x1a2020[_0x375c('0xa')](_0x42f12e,_0x5a3dfd+0x1);}else{var _0x14675a=_0x1a2020[_0x375c('0xa')](0x0,_0x5a3dfd+0x1);var _0x5589d7=_0x1a2020['slice'](_0x42f12e);return _0x5589d7[_0x375c('0xb')](_0x14675a);}}}module[_0x375c('0xc')][_0x375c('0xf')]=circularMonthInterval;function parseDom(_0x31e6fb){var _0x49f9af=parseInt(_0x31e6fb,0xa);if(_0x49f9af<0x1||_0x49f9af>0x1f){throw new Error(EINVALID_DATE);}return _0x49f9af;}function timeCompare(_0x476514,_0x61ac37,_0x101341){var _0x261b4a=_0x476514[_0x375c('0x10')]();var _0x5c11e7=extractTime(_0x61ac37);var _0x2df06c=_0x5c11e7[0x0];var _0x2aa512=_0x5c11e7[0x1];var _0x419892=_0x476514[_0x375c('0x10')]()[_0x375c('0x11')](_0x2df06c)[_0x375c('0x12')](_0x2aa512);throwIfDateNotValid(_0x419892);var _0x21d034=extractTime(_0x101341);var _0x4fba1a=_0x21d034[0x0];var _0x27f030=_0x21d034[0x1];var _0x5c40f3=_0x476514[_0x375c('0x10')]()[_0x375c('0x11')](_0x4fba1a)[_0x375c('0x12')](_0x27f030);throwIfDateNotValid(_0x5c40f3);if(_0x5c40f3['isBefore'](_0x419892)){var _0x37c70e=_0x261b4a[_0x375c('0x10')]()['startOf'](_0x375c('0x13'));var _0x36eec3=_0x261b4a['clone']()[_0x375c('0x14')](_0x375c('0x13'));return _0x261b4a['isBetween'](_0x419892,_0x36eec3,undefined,'[]')||_0x261b4a['isBetween'](_0x37c70e,_0x5c40f3,undefined,'[]');}else{return _0x261b4a[_0x375c('0x15')](_0x419892,_0x5c40f3,undefined,'[]');}}module[_0x375c('0xc')]['timeCompare']=timeCompare;function dowCompare(_0x16ddb6,_0x189edc,_0x5721ea){var _0xc93f03=_0x16ddb6['locale']('en')[_0x375c('0x16')](_0x375c('0x17'))[_0x375c('0x8')]();return circularDoWInterval(_0x189edc,_0x5721ea)[_0x375c('0x18')](_0xc93f03);}module[_0x375c('0xc')][_0x375c('0x19')]=dowCompare;function domCompare(_0x1959b2,_0x59b536,_0x518b62){var _0x52d351=_0x1959b2[_0x375c('0x1a')]();if(_0x59b536===_0x518b62){return _0x52d351===_0x59b536;}else{var _0x12c88e=_0x1959b2[_0x375c('0x1b')]();var _0x555558=_0x59b536<_0x518b62;let _0x10849d=![];var _0x139993=0x0;var _0x106f88=0x0;if(_0x555558){_0x139993=Math['max'](0x1,_0x59b536);_0x106f88=Math[_0x375c('0x1c')](_0x518b62,_0x12c88e);_0x10849d=_0x52d351>=_0x139993&&_0x52d351<=_0x106f88;}else{_0x139993=Math[_0x375c('0x1c')](_0x59b536,_0x12c88e);_0x106f88=Math[_0x375c('0x1d')](0x1,_0x518b62);_0x10849d=_0x52d351>=_0x139993||_0x52d351<=_0x106f88;}return _0x10849d;}}module[_0x375c('0xc')][_0x375c('0x1e')]=domCompare;function monthCompare(_0x1bc0ce,_0x4fc9b9,_0x179b01){var _0x19ce41=_0x1bc0ce[_0x375c('0x7')]('en')[_0x375c('0x16')]('MMM')[_0x375c('0x8')]();return circularMonthInterval(_0x4fc9b9,_0x179b01)[_0x375c('0x18')](_0x19ce41);}module[_0x375c('0xc')][_0x375c('0x1f')]=monthCompare;function iftime(_0x1b8b10,_0x2d122d=moment['tz'][_0x375c('0x20')](),_0x3b23b9=moment()){if(!validateRx[_0x375c('0x21')](_0x1b8b10)){throw new Error(EINVALID_STRING);}else{var _0x5e03f2=(moment[_0x375c('0x22')](_0x3b23b9)?_0x3b23b9[_0x375c('0x10')]():moment(_0x3b23b9))['tz'](_0x2d122d)[_0x375c('0x7')]('en');throwIfDateNotValid(_0x5e03f2);var _0xe99da4=_0x1b8b10['split'](',');var _0x26513b=_0xe99da4[0x0];var _0x46a7ea=_0xe99da4[0x1];var _0x514b77=_0xe99da4[0x2];var _0x576632=_0xe99da4[0x3];let _0x3961f0=!![];if(_0x26513b!=='*'){var _0x579fd3=_0x26513b['split']('-');var _0x33deec=_[_0x375c('0x23')](_0x579fd3[0x0],0x5,'0');var _0x26cf6c=_0x579fd3[_0x375c('0x24')]===0x2?_[_0x375c('0x23')](_0x579fd3[0x1],0x5,'0'):_0x33deec;_0x3961f0=timeCompare(_0x5e03f2,_0x33deec,_0x26cf6c);}let _0x283b2b=!![];if(_0x46a7ea!=='*'){var _0x43626f=_0x46a7ea['split']('-');var _0xb80418=_0x43626f[0x0];var _0x2a0952=_0x43626f[_0x375c('0x24')]===0x2?_0x43626f[0x1]:_0xb80418;_0x283b2b=dowCompare(_0x5e03f2,_0xb80418,_0x2a0952);}let _0x5028c0=!![];if(_0x514b77!=='*'){var _0x146155=_0x514b77[_0x375c('0x25')]('-');var _0x45bb1d=parseDom(_0x146155[0x0]);var _0x114e57=_0x146155[_0x375c('0x24')]===0x2?parseDom(_0x146155[0x1]):_0x45bb1d;_0x5028c0=domCompare(_0x5e03f2,_0x45bb1d,_0x114e57);}let _0x342a64=!![];if(_0x576632!=='*'){var _0x248c6b=_0x576632[_0x375c('0x25')]('-');var _0x5241f1=_0x248c6b[0x0];var _0x2cba69=_0x248c6b[_0x375c('0x24')]===0x2?_0x248c6b[0x1]:_0x248c6b[0x0];_0x342a64=monthCompare(_0x5e03f2,_0x5241f1,_0x2cba69);}return _0x3961f0&&_0x283b2b&&_0x5028c0&&_0x342a64;}}module[_0x375c('0xc')][_0x375c('0x26')]=iftime; \ No newline at end of file +var _0x8800=['max','min','MMM','guess','isMoment','split','padStart','length','lodash','moment-timezone','map','source','Date\x20not\x20valid','isValid','locale','toLowerCase','indexOf','slice','exports','circularDoWInterval','monthsShort','concat','circularMonthInterval','clone','hours','minutes','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth'];(function(_0x2ac654,_0x24be56){var _0x3d25f9=function(_0x24e95c){while(--_0x24e95c){_0x2ac654['push'](_0x2ac654['shift']());}};_0x3d25f9(++_0x24be56);}(_0x8800,0x155));var _0x0880=function(_0x26b738,_0x4bd64d){_0x26b738=_0x26b738-0x0;var _0x6d0d7e=_0x8800[_0x26b738];return _0x6d0d7e;};var _=require(_0x0880('0x0'));var moment=require(_0x0880('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x0880('0x2')](function(_0x3e7a87){return _0x3e7a87[_0x0880('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x0880('0x4');function throwIfDateNotValid(_0x848339){if(!_0x848339[_0x0880('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0xbb4522){var _0x47e01b=_0xbb4522['split'](':')[_0x0880('0x2')](function(_0x3526bc){return parseInt(_0x3526bc,0xa);});var _0x1c9848=_0x47e01b[0x0];var _0x531e2e=_0x47e01b[0x1];if(_0x1c9848<0x0||_0x1c9848>0x17||_0x531e2e<0x0||_0x531e2e>0x3b){throw new Error(EINVALID_DATE);}return[_0x1c9848,_0x531e2e];}function circularDoWInterval(_0x227a7d,_0x4ee6bb){if(_0x227a7d===_0x4ee6bb){return[_0x227a7d];}else{var _0x3e1d50=moment['locale']();moment[_0x0880('0x6')]('en');var _0x27bd15=moment['weekdaysShort']()[_0x0880('0x2')](function(_0x1d90cf){return _0x1d90cf[_0x0880('0x7')]();});moment[_0x0880('0x6')](_0x3e1d50);var _0x1389a0=_0x27bd15['indexOf'](_0x227a7d);var _0x326d39=_0x27bd15[_0x0880('0x8')](_0x4ee6bb);if(_0x326d39>_0x1389a0){return _0x27bd15[_0x0880('0x9')](_0x1389a0,_0x326d39+0x1);}else{var _0x1881fa=_0x27bd15[_0x0880('0x9')](0x0,_0x326d39+0x1);var _0x3d7c55=_0x27bd15[_0x0880('0x9')](_0x1389a0);return _0x3d7c55['concat'](_0x1881fa);}}}module[_0x0880('0xa')][_0x0880('0xb')]=circularDoWInterval;function circularMonthInterval(_0x43debd,_0x225ffa){if(_0x43debd===_0x225ffa){return[_0x43debd];}else{var _0x48a213=moment['locale']();moment[_0x0880('0x6')]('en');var _0x251571=moment[_0x0880('0xc')]()[_0x0880('0x2')](function(_0x36a034){return _0x36a034[_0x0880('0x7')]();});moment['locale'](_0x48a213);var _0x38eeae=_0x251571['indexOf'](_0x43debd);var _0x2eca84=_0x251571[_0x0880('0x8')](_0x225ffa);if(_0x2eca84>_0x38eeae){return _0x251571[_0x0880('0x9')](_0x38eeae,_0x2eca84+0x1);}else{var _0xfcc11=_0x251571[_0x0880('0x9')](0x0,_0x2eca84+0x1);var _0x30f6a8=_0x251571[_0x0880('0x9')](_0x38eeae);return _0x30f6a8[_0x0880('0xd')](_0xfcc11);}}}module[_0x0880('0xa')][_0x0880('0xe')]=circularMonthInterval;function parseDom(_0x4f7bc8){var _0x14cae2=parseInt(_0x4f7bc8,0xa);if(_0x14cae2<0x1||_0x14cae2>0x1f){throw new Error(EINVALID_DATE);}return _0x14cae2;}function timeCompare(_0x554616,_0xb28a90,_0x1bc285){var _0xc87d6=_0x554616[_0x0880('0xf')]();var _0x25f163=extractTime(_0xb28a90);var _0x45339b=_0x25f163[0x0];var _0x1ee285=_0x25f163[0x1];var _0x3beee0=_0x554616[_0x0880('0xf')]()[_0x0880('0x10')](_0x45339b)['minutes'](_0x1ee285);throwIfDateNotValid(_0x3beee0);var _0x384ae7=extractTime(_0x1bc285);var _0x4798d3=_0x384ae7[0x0];var _0x5a6647=_0x384ae7[0x1];var _0x53ebec=_0x554616[_0x0880('0xf')]()[_0x0880('0x10')](_0x4798d3)[_0x0880('0x11')](_0x5a6647);throwIfDateNotValid(_0x53ebec);if(_0x53ebec['isBefore'](_0x3beee0)){var _0x1d8613=_0xc87d6['clone']()[_0x0880('0x12')](_0x0880('0x13'));var _0x5708aa=_0xc87d6[_0x0880('0xf')]()[_0x0880('0x14')](_0x0880('0x13'));return _0xc87d6[_0x0880('0x15')](_0x3beee0,_0x5708aa,undefined,'[]')||_0xc87d6[_0x0880('0x15')](_0x1d8613,_0x53ebec,undefined,'[]');}else{return _0xc87d6['isBetween'](_0x3beee0,_0x53ebec,undefined,'[]');}}module[_0x0880('0xa')][_0x0880('0x16')]=timeCompare;function dowCompare(_0x5a827e,_0x4cbb25,_0x270e17){var _0x22c6f6=_0x5a827e[_0x0880('0x6')]('en')[_0x0880('0x17')](_0x0880('0x18'))[_0x0880('0x7')]();return circularDoWInterval(_0x4cbb25,_0x270e17)[_0x0880('0x19')](_0x22c6f6);}module[_0x0880('0xa')][_0x0880('0x1a')]=dowCompare;function domCompare(_0x507e9a,_0x29cf98,_0x4821c2){var _0x923027=_0x507e9a[_0x0880('0x1b')]();if(_0x29cf98===_0x4821c2){return _0x923027===_0x29cf98;}else{var _0x27394d=_0x507e9a[_0x0880('0x1c')]();var _0x5f27ac=_0x29cf98<_0x4821c2;let _0x56e063=![];var _0xd43d3f=0x0;var _0x38fb62=0x0;if(_0x5f27ac){_0xd43d3f=Math[_0x0880('0x1d')](0x1,_0x29cf98);_0x38fb62=Math[_0x0880('0x1e')](_0x4821c2,_0x27394d);_0x56e063=_0x923027>=_0xd43d3f&&_0x923027<=_0x38fb62;}else{_0xd43d3f=Math['min'](_0x29cf98,_0x27394d);_0x38fb62=Math['max'](0x1,_0x4821c2);_0x56e063=_0x923027>=_0xd43d3f||_0x923027<=_0x38fb62;}return _0x56e063;}}module[_0x0880('0xa')]['domCompare']=domCompare;function monthCompare(_0x48e725,_0x5c6fec,_0x403c16){var _0x4796e0=_0x48e725[_0x0880('0x6')]('en')[_0x0880('0x17')](_0x0880('0x1f'))['toLowerCase']();return circularMonthInterval(_0x5c6fec,_0x403c16)[_0x0880('0x19')](_0x4796e0);}module['exports']['monthCompare']=monthCompare;function iftime(_0x802278,_0x4d55a8=moment['tz'][_0x0880('0x20')](),_0x513913=moment()){if(!validateRx['test'](_0x802278)){throw new Error(EINVALID_STRING);}else{var _0x4b7961=(moment[_0x0880('0x21')](_0x513913)?_0x513913['clone']():moment(_0x513913))['tz'](_0x4d55a8)[_0x0880('0x6')]('en');throwIfDateNotValid(_0x4b7961);var _0x4dc4d4=_0x802278[_0x0880('0x22')](',');var _0x3e9e16=_0x4dc4d4[0x0];var _0x22f619=_0x4dc4d4[0x1];var _0x271ed8=_0x4dc4d4[0x2];var _0x1d45a1=_0x4dc4d4[0x3];let _0x3c7de9=!![];if(_0x3e9e16!=='*'){var _0x388d26=_0x3e9e16['split']('-');var _0x3b821a=_[_0x0880('0x23')](_0x388d26[0x0],0x5,'0');var _0xb46c13=_0x388d26['length']===0x2?_[_0x0880('0x23')](_0x388d26[0x1],0x5,'0'):_0x3b821a;_0x3c7de9=timeCompare(_0x4b7961,_0x3b821a,_0xb46c13);}let _0x35a387=!![];if(_0x22f619!=='*'){var _0x5ccca8=_0x22f619[_0x0880('0x22')]('-');var _0x566dc5=_0x5ccca8[0x0];var _0xa21585=_0x5ccca8[_0x0880('0x24')]===0x2?_0x5ccca8[0x1]:_0x566dc5;_0x35a387=dowCompare(_0x4b7961,_0x566dc5,_0xa21585);}let _0x554b67=!![];if(_0x271ed8!=='*'){var _0x19ccdb=_0x271ed8['split']('-');var _0x2dda9c=parseDom(_0x19ccdb[0x0]);var _0x523539=_0x19ccdb[_0x0880('0x24')]===0x2?parseDom(_0x19ccdb[0x1]):_0x2dda9c;_0x554b67=domCompare(_0x4b7961,_0x2dda9c,_0x523539);}let _0x505a31=!![];if(_0x1d45a1!=='*'){var _0x7a7d7d=_0x1d45a1['split']('-');var _0x4f912d=_0x7a7d7d[0x0];var _0x18a2be=_0x7a7d7d[_0x0880('0x24')]===0x2?_0x7a7d7d[0x1]:_0x7a7d7d[0x0];_0x505a31=monthCompare(_0x4b7961,_0x4f912d,_0x18a2be);}return _0x3c7de9&&_0x35a387&&_0x554b67&&_0x505a31;}}module[_0x0880('0xa')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index a9e7287..ccf4246 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ef3=['gray','bold\x20blue','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','Console','warn','transports','File','%s-%s','error','consoleLogger','fileLogger','moment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20green'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x3ef3,0xac));var _0x33ef=function(_0x237f07,_0x2142a9){_0x237f07=_0x237f07-0x0;var _0x22c133=_0x3ef3[_0x237f07];return _0x22c133;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x33ef('0x0'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config[_0x33ef('0x1')]?config[_0x33ef('0x1')][_0x33ef('0x2')]():_0x33ef('0x3');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x33ef('0x4'),'error':'red','warn':_0x33ef('0x5'),'info':_0x33ef('0x6'),'print':'bold\x20white','success':_0x33ef('0x7'),'http':_0x33ef('0x8'),'verbose':'bold\x20magenta','debug':_0x33ef('0x9'),'silly':'bold\x20cyan'};winston[_0x33ef('0xa')](XC_LOG_COLORS);function getLogFileName(_0x2244b3,_0x295bbd,_0x1a8ea5){var _0x48204e=_0x2244b3||_0x33ef('0xb');return path[_0x33ef('0xc')](_0x48204e,util[_0x33ef('0xd')](_0x33ef('0xe'),_0x295bbd,_0x1a8ea5));}function formatter(_0x552d55,_0x3b3f9a){_0x3b3f9a[_0x33ef('0xf')]=_0x3b3f9a[_0x33ef('0xf')][_0x33ef('0x10')](/@@{/g,_0x33ef('0x11'))[_0x33ef('0x10')](/}@@/g,_0x33ef('0x12'))[_0x33ef('0x10')](/@{/g,'{{')[_0x33ef('0x10')](/}@/g,'}}');return util['format'](_0x33ef('0x13'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x3b3f9a[_0x33ef('0x14')][_0x33ef('0x15')](),_0x552d55,_0x3b3f9a[_0x33ef('0xf')]);}function fileFormat(_0x9b3806,_0x14a269){_0x14a269[_0x33ef('0xf')]=_0x14a269[_0x33ef('0xf')][_0x33ef('0x10')](/@@{/g,_0x33ef('0x11'))['replace'](/}@@/g,_0x33ef('0x12'))[_0x33ef('0x10')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x35eb2e=_0x14a269[_0x33ef('0x16')]&&Object['keys'](_0x14a269['meta'])[_0x33ef('0x17')]?'\x0a\x09'+JSON[_0x33ef('0x18')](_0x14a269[_0x33ef('0x16')]):'';return util[_0x33ef('0xd')](_0x33ef('0x19'),moment()[_0x33ef('0xd')](_0x33ef('0x1a')),_0x14a269['level'][_0x33ef('0x15')](),_0x9b3806,_0x14a269[_0x33ef('0xf')],_0x35eb2e);}function consoleLogger(){var _0x32a00a=new winston[(_0x33ef('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x33ef('0x1c'))]({'level':_0x33ef('0x1d'),'json':![],'formatter':function(_0xa810f9){return formatter('',_0xa810f9);}})]});return _0x32a00a;}function fileLogger(_0x3908fe,_0xd9c7d6){var _0x57ca76=new winston[(_0x33ef('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x33ef('0x1e'))][(_0x33ef('0x1f'))]({'name':util[_0x33ef('0xd')](_0x33ef('0x20'),_0x3908fe,_0x33ef('0x21')),'filename':getLogFileName(_0xd9c7d6,_0x3908fe,_0x33ef('0x21')),'level':_0x33ef('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xfc4ca6){return fileFormat(_0x3908fe,_0xfc4ca6);}}),new winston['transports'][(_0x33ef('0x1f'))]({'name':util[_0x33ef('0xd')](_0x33ef('0x20'),_0x3908fe,debugLevel),'filename':getLogFileName(_0xd9c7d6,_0x3908fe,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a4ffc){return fileFormat(_0x3908fe,_0x2a4ffc);}}),new winston[(_0x33ef('0x1e'))][(_0x33ef('0x1c'))]({'level':_0x33ef('0x1d'),'json':![],'formatter':function(_0x32f9c8){return fileFormat(_0x3908fe,_0x32f9c8);}})]});return _0x57ca76;}exports[_0x33ef('0x22')]=consoleLogger;exports[_0x33ef('0x23')]=fileLogger; \ No newline at end of file +var _0x2ce0=['winston','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','transports','File','%s-%s','error','warn','consoleLogger','fileLogger','util','moment'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2ce0,0x1c6));var _0x02ce=function(_0x5e9abf,_0xd85289){_0x5e9abf=_0x5e9abf-0x0;var _0x42a421=_0x2ce0[_0x5e9abf];return _0x42a421;};'use strict';var path=require('path');var util=require(_0x02ce('0x0'));var moment=require(_0x02ce('0x1'));var winston=require(_0x02ce('0x2'));var config=require('../config/environment');var debugLevel=config[_0x02ce('0x3')]?config[_0x02ce('0x3')][_0x02ce('0x4')]():_0x02ce('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x02ce('0x6'),'warn':_0x02ce('0x7'),'info':_0x02ce('0x8'),'print':_0x02ce('0x9'),'success':'bold\x20green','http':_0x02ce('0xa'),'verbose':_0x02ce('0xb'),'debug':_0x02ce('0xc'),'silly':_0x02ce('0xd')};winston[_0x02ce('0xe')](XC_LOG_COLORS);function getLogFileName(_0x275b02,_0x3d688e,_0x44cbf5){var _0x37ab04=_0x275b02||_0x02ce('0xf');return path[_0x02ce('0x10')](_0x37ab04,util[_0x02ce('0x11')](_0x02ce('0x12'),_0x3d688e,_0x44cbf5));}function formatter(_0x290847,_0x13c661){_0x13c661[_0x02ce('0x13')]=_0x13c661['message'][_0x02ce('0x14')](/@@{/g,_0x02ce('0x15'))['replace'](/}@@/g,_0x02ce('0x16'))[_0x02ce('0x14')](/@{/g,'{{')[_0x02ce('0x14')](/}@/g,'}}');return util[_0x02ce('0x11')](_0x02ce('0x17'),moment()[_0x02ce('0x11')](_0x02ce('0x18')),_0x13c661[_0x02ce('0x19')]['toUpperCase'](),_0x290847,_0x13c661[_0x02ce('0x13')]);}function fileFormat(_0x2fd899,_0x4750c7){_0x4750c7[_0x02ce('0x13')]=_0x4750c7['message'][_0x02ce('0x14')](/@@{/g,_0x02ce('0x15'))[_0x02ce('0x14')](/}@@/g,'}}}')['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5c929d=_0x4750c7[_0x02ce('0x1a')]&&Object['keys'](_0x4750c7['meta'])[_0x02ce('0x1b')]?'\x0a\x09'+JSON[_0x02ce('0x1c')](_0x4750c7[_0x02ce('0x1a')]):'';return util[_0x02ce('0x11')](_0x02ce('0x1d'),moment()[_0x02ce('0x11')](_0x02ce('0x18')),_0x4750c7[_0x02ce('0x19')][_0x02ce('0x1e')](),_0x2fd899,_0x4750c7[_0x02ce('0x13')],_0x5c929d);}function consoleLogger(){var _0xaebc16=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x02ce('0x1f'))]['Console']({'level':'warn','json':![],'formatter':function(_0x28c9ad){return formatter('',_0x28c9ad);}})]});return _0xaebc16;}function fileLogger(_0x44d131,_0x27dbe4){var _0x431722=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x02ce('0x1f'))][(_0x02ce('0x20'))]({'name':util[_0x02ce('0x11')](_0x02ce('0x21'),_0x44d131,_0x02ce('0x22')),'filename':getLogFileName(_0x27dbe4,_0x44d131,_0x02ce('0x22')),'level':_0x02ce('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xdb84ac){return fileFormat(_0x44d131,_0xdb84ac);}}),new winston['transports'][(_0x02ce('0x20'))]({'name':util[_0x02ce('0x11')](_0x02ce('0x21'),_0x44d131,debugLevel),'filename':getLogFileName(_0x27dbe4,_0x44d131,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4e4b37){return fileFormat(_0x44d131,_0x4e4b37);}}),new winston[(_0x02ce('0x1f'))]['Console']({'level':_0x02ce('0x23'),'json':![],'formatter':function(_0x41e9de){return fileFormat(_0x44d131,_0x41e9de);}})]});return _0x431722;}exports[_0x02ce('0x24')]=consoleLogger;exports[_0x02ce('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 6363e10..d5eb63b 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x1967,0x173));var _0x7196=function(_0x58bfbe,_0x28dcb6){_0x58bfbe=_0x58bfbe-0x0;var _0x180a60=_0x1967[_0x58bfbe];return _0x180a60;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x5d8d73,_0x23ebf8){var _0x517d0e=function(_0x279e9c){while(--_0x279e9c){_0x5d8d73['push'](_0x5d8d73['shift']());}};_0x517d0e(++_0x23ebf8);}(_0xda2d,0x102));var _0xdda2=function(_0x1fb014,_0x14614e){_0x1fb014=_0x1fb014-0x0;var _0x5c0ac2=_0xda2d[_0x1fb014];return _0x5c0ac2;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 4d81d18..e88b36e 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0x7db016,_0x22f7a7){var _0x473c3b=function(_0x232492){while(--_0x232492){_0x7db016['push'](_0x7db016['shift']());}};_0x473c3b(++_0x22f7a7);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1dc484,_0x46350a){_0x1dc484=_0x1dc484-0x0;var _0x5cf305=_0x8f4c[_0x1dc484];return _0x5cf305;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('0x7')]=safeTemplate; \ No newline at end of file +var _0xf4f4=['replace','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}','string'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x371951,_0x2796e3){_0x371951=_0x371951-0x0;var _0x23b47f=_0xf4f4[_0x371951];return _0x23b47f;};var _=require(_0x4f4f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x230375){return _0x230375==='{{'?'{\x20{\x20':_0x4f4f('0x1');}function safeTemplate(_0x304b11){var _0x19aa05=_0x304b11;if(typeof _0x304b11===_0x4f4f('0x2')){_0x19aa05=_0x304b11[_0x4f4f('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x304b11)){_0x19aa05=_0x304b11[_0x4f4f('0x4')](function(_0x593952){return safeTemplate(_0x593952);});}else if(_[_0x4f4f('0x5')](_0x304b11)){_0x19aa05=Object[_0x4f4f('0x6')](_0x304b11)[_0x4f4f('0x7')](function(_0x1ff75a,_0x3c4877){_0x1ff75a[_0x3c4877]=safeTemplate(_0x304b11[_0x3c4877]);return _0x1ff75a;},{});}return _0x19aa05;}module[_0x4f4f('0x8')][_0x4f4f('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 2c3ea32..8ce672c 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbb0=['path','../config/environment','server/app.json','resolve','legacy-libs','isArray','apps','findIndex','name','env','NODE_PATH','string','pathExists','then','exports','fs-extra'];(function(_0x3d391b,_0x139db6){var _0x34adb6=function(_0x464b1e){while(--_0x464b1e){_0x3d391b['push'](_0x3d391b['shift']());}};_0x34adb6(++_0x139db6);}(_0xfbb0,0x10f));var _0x0fbb=function(_0x1a2493,_0x1cadae){_0x1a2493=_0x1a2493-0x0;var _0x2d0ec6=_0xfbb0[_0x1a2493];return _0x2d0ec6;};var fs=require(_0x0fbb('0x0'));var path=require(_0x0fbb('0x1'));var config=require(_0x0fbb('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0x0fbb('0x3'));var NODEPATH=path[_0x0fbb('0x4')](root,_0x0fbb('0x5'));function setLegacyLibsNodeEnvPath(_0x2794ac){let _0x45e1ec=![];if(Array[_0x0fbb('0x6')](_0x2794ac[_0x0fbb('0x7')])){var _0x38f533=_0x2794ac[_0x0fbb('0x7')][_0x0fbb('0x8')](function(_0x4f48d7){return _0x4f48d7[_0x0fbb('0x9')]==='motion2';});if(_0x38f533>-0x1){var _0x38e5c5=_0x2794ac[_0x0fbb('0x7')][_0x38f533];if(typeof _0x38e5c5[_0x0fbb('0xa')][_0x0fbb('0xb')]!==_0x0fbb('0xc')){_0x38e5c5['env'][_0x0fbb('0xb')]=NODEPATH;_0x45e1ec=!![];}}return{'appConfig':_0x2794ac,'updated':_0x45e1ec};}}function updateAppConfig(_0x1e6949){return fs[_0x0fbb('0xd')](APP_JSON_PATH)[_0x0fbb('0xe')](function(_0x53ce42){if(_0x53ce42){return fs['readJSON'](APP_JSON_PATH)[_0x0fbb('0xe')](function(_0x5eadfb){var _0x5cb6fa=setLegacyLibsNodeEnvPath(_0x5eadfb);if(_0x5cb6fa['updated']){_0x1e6949['info']('Updating\x20app.json');return fs['writeJSON'](APP_JSON_PATH,_0x5eadfb,{'spaces':0x2});}else{return Promise[_0x0fbb('0x4')]();}});}else{return Promise['resolve']();}});}module[_0x0fbb('0xf')]=updateAppConfig; \ No newline at end of file +var _0x2f30=['server/app.json','legacy-libs','apps','findIndex','name','motion2','NODE_PATH','env','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x2f30,0xb8));var _0x02f3=function(_0x1b6d82,_0x29e189){_0x1b6d82=_0x1b6d82-0x0;var _0x30ac4e=_0x2f30[_0x1b6d82];return _0x30ac4e;};var fs=require(_0x02f3('0x0'));var path=require(_0x02f3('0x1'));var config=require(_0x02f3('0x2'));var root=config[_0x02f3('0x3')];var APP_JSON_PATH=path[_0x02f3('0x4')](root,_0x02f3('0x5'));var NODEPATH=path[_0x02f3('0x4')](root,_0x02f3('0x6'));function setLegacyLibsNodeEnvPath(_0x22a176){let _0x4bc379=![];if(Array['isArray'](_0x22a176[_0x02f3('0x7')])){var _0x13c4b2=_0x22a176['apps'][_0x02f3('0x8')](function(_0x5f228f){return _0x5f228f[_0x02f3('0x9')]===_0x02f3('0xa');});if(_0x13c4b2>-0x1){var _0x5845a2=_0x22a176[_0x02f3('0x7')][_0x13c4b2];if(typeof _0x5845a2['env'][_0x02f3('0xb')]!=='string'){_0x5845a2[_0x02f3('0xc')][_0x02f3('0xb')]=NODEPATH;_0x4bc379=!![];}}return{'appConfig':_0x22a176,'updated':_0x4bc379};}}function updateAppConfig(_0x3ce42f){return fs[_0x02f3('0xd')](APP_JSON_PATH)[_0x02f3('0xe')](function(_0x1fbf2a){if(_0x1fbf2a){return fs[_0x02f3('0xf')](APP_JSON_PATH)[_0x02f3('0xe')](function(_0x302a5b){var _0x56c93c=setLegacyLibsNodeEnvPath(_0x302a5b);if(_0x56c93c[_0x02f3('0x10')]){_0x3ce42f[_0x02f3('0x11')](_0x02f3('0x12'));return fs[_0x02f3('0x13')](APP_JSON_PATH,_0x302a5b,{'spaces':0x2});}else{return Promise[_0x02f3('0x4')]();}});}else{return Promise[_0x02f3('0x4')]();}});}module[_0x02f3('0x14')]=updateAppConfig; \ No newline at end of file -- 1.7.1